From: support Date: Tue, 24 Jan 2023 13:30:22 +0000 (+0000) Subject: Built motion from commit 6a92c2cd.|2.6.29 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22avatar.png//%27?a=commitdiff_plain;h=21e54f4cb47326f293ad41d97369037441b4fb0b;p=motion2.git Built motion from commit 6a92c2cd.|2.6.29 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 41489d7..dd813fd 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-23T14:36:07.133Z", + "time": "2023-01-24T13:21:33.150Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index c5807a9..142e6c6 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-23T14:36:07.133Z", + "time": "2023-01-24T13:21:33.150Z", "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 b4902d8..8102266 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 _0x8873=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x268ad0,_0x3cdfcd){var _0xc8139a=function(_0x248abd){while(--_0x248abd){_0x268ad0['push'](_0x268ad0['shift']());}};_0xc8139a(++_0x3cdfcd);}(_0x8873,0x9f));var _0x3887=function(_0x5178fb,_0x121e19){_0x5178fb=_0x5178fb-0x0;var _0x348183=_0x8873[_0x5178fb];return _0x348183;};'use strict';var Sequelize=require(_0x3887('0x0'));module[_0x3887('0x1')]={'name':{'type':Sequelize[_0x3887('0x2')],'get':function(_0x378d88){return this[_0x3887('0x3')](_0x3887('0x4'));}},'action':{'type':Sequelize[_0x3887('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x3887('0x6'),'integration',_0x3887('0x7'),_0x3887('0x8'),_0x3887('0x9'),_0x3887('0xa'),_0x3887('0xb'),_0x3887('0xc')]],'msg':_0x3887('0xd')}},'comment':_0x3887('0xd')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xe')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0xf')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3887('0x10')},'data4':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x11')},'data5':{'type':Sequelize[_0x3887('0x5')](0x1000),'comments':_0x3887('0x12')},'data6':{'type':Sequelize[_0x3887('0x5')],'comments':_0x3887('0x13')},'data7':{'type':Sequelize[_0x3887('0x14')],'comments':_0x3887('0x15')}}; \ No newline at end of file +var _0xf796=['action','contactManager','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','getDataValue'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf796,0x19b));var _0x6f79=function(_0x5796d9,_0x1f3540){_0x5796d9=_0x5796d9-0x0;var _0x2d0299=_0xf796[_0x5796d9];return _0x2d0299;};'use strict';var Sequelize=require(_0x6f79('0x0'));module[_0x6f79('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3c8193){return this[_0x6f79('0x2')](_0x6f79('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x6f79('0x4'),'integration',_0x6f79('0x5'),_0x6f79('0x6'),_0x6f79('0x7'),_0x6f79('0x8'),_0x6f79('0x9'),_0x6f79('0xa')]],'msg':_0x6f79('0xb')}},'comment':_0x6f79('0xb')},'data1':{'type':Sequelize[_0x6f79('0xc')](0x1000),'comment':_0x6f79('0xd')},'data2':{'type':Sequelize[_0x6f79('0xc')](0x1000),'comment':_0x6f79('0xe')},'data3':{'type':Sequelize[_0x6f79('0xc')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6f79('0xc')](0x1000),'comments':_0x6f79('0xf')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6f79('0x10')],'comments':_0x6f79('0x11')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index de5170e..a6dbe20 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 _0x1fd0=['then','destroy','sendStatus','error','stack','name','send','body','Action','find','params','catch','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset','set','apply','save','update'];(function(_0x3cae4a,_0x7f583f){var _0x18a7f7=function(_0xa5fbca){while(--_0xa5fbca){_0x3cae4a['push'](_0x3cae4a['shift']());}};_0x18a7f7(++_0x7f583f);}(_0x1fd0,0x147));var _0x01fd=function(_0x3e0a02,_0x221324){_0x3e0a02=_0x3e0a02-0x0;var _0x5efc5b=_0x1fd0[_0x3e0a02];return _0x5efc5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01fd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01fd('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x01fd('0x2'));var Mustache=require(_0x01fd('0x3'));var util=require(_0x01fd('0x4'));var path=require(_0x01fd('0x5'));var sox=require(_0x01fd('0x6'));var csv=require(_0x01fd('0x7'));var ejs=require(_0x01fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01fd('0x9'));var squel=require(_0x01fd('0xa'));var crypto=require('crypto');var jsforce=require(_0x01fd('0xb'));var deskjs=require(_0x01fd('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01fd('0xd'));var Redis=require(_0x01fd('0xe'));var authService=require(_0x01fd('0xf'));var qs=require(_0x01fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01fd('0x11'));var logger=require(_0x01fd('0x12'))(_0x01fd('0x13'));var utils=require(_0x01fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x01fd('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13004a,_0x417235){_0x417235=_0x417235||0xcc;return function(_0x1dac52){if(_0x1dac52){return _0x13004a['sendStatus'](_0x417235);}return _0x13004a[_0x01fd('0x16')](_0x417235)[_0x01fd('0x17')]();};}function respondWithResult(_0x4c53a7,_0x3d646f){_0x3d646f=_0x3d646f||0xc8;return function(_0x4bd28d){if(_0x4bd28d){return _0x4c53a7[_0x01fd('0x16')](_0x3d646f)[_0x01fd('0x18')](_0x4bd28d);}};}function respondWithFilteredResult(_0x146fdf,_0x4b337b){return function(_0x5ecbd3){if(_0x5ecbd3){var _0x54916f=typeof _0x4b337b['offset']===_0x01fd('0x19')&&typeof _0x4b337b[_0x01fd('0x1a')]===_0x01fd('0x19');var _0x30844e=_0x5ecbd3[_0x01fd('0x1b')];var _0x4ac4c6=_0x54916f?0x0:_0x4b337b[_0x01fd('0x1c')];var _0x4f3dd5=_0x54916f?_0x5ecbd3[_0x01fd('0x1b')]:_0x4b337b['offset']+_0x4b337b[_0x01fd('0x1a')];var _0xb1ac8d;if(_0x4f3dd5>=_0x30844e){_0x4f3dd5=_0x30844e;_0xb1ac8d=0xc8;}else{_0xb1ac8d=0xce;}_0x146fdf[_0x01fd('0x16')](_0xb1ac8d);return _0x146fdf[_0x01fd('0x1d')]('Content-Range',_0x4ac4c6+'-'+_0x4f3dd5+'/'+_0x30844e)[_0x01fd('0x18')](_0x5ecbd3);}return null;};}function patchUpdates(_0x4b47a2){return function(_0x11a46f){try{jsonpatch[_0x01fd('0x1e')](_0x11a46f,_0x4b47a2,!![]);}catch(_0x259b6e){return BPromise['reject'](_0x259b6e);}return _0x11a46f[_0x01fd('0x1f')]();};}function saveUpdates(_0x4f79ef,_0x32468e){return function(_0x3d69f8){if(_0x3d69f8){return _0x3d69f8[_0x01fd('0x20')](_0x4f79ef)[_0x01fd('0x21')](function(_0x410aa1){return _0x410aa1;});}return null;};}function removeEntity(_0x57bf54,_0x25bb05){return function(_0x287c6d){if(_0x287c6d){return _0x287c6d[_0x01fd('0x22')]()[_0x01fd('0x21')](function(){_0x57bf54[_0x01fd('0x16')](0xcc)[_0x01fd('0x17')]();});}};}function handleEntityNotFound(_0x4bfed8,_0x2ca7d6){return function(_0x28bad2){if(!_0x28bad2){_0x4bfed8[_0x01fd('0x23')](0x194);}return _0x28bad2;};}function handleError(_0x759ee6,_0x153fdf){_0x153fdf=_0x153fdf||0x1f4;return function(_0x2d6bcd){logger[_0x01fd('0x24')](_0x2d6bcd[_0x01fd('0x25')]);if(_0x2d6bcd[_0x01fd('0x26')]){delete _0x2d6bcd[_0x01fd('0x26')];}_0x759ee6[_0x01fd('0x16')](_0x153fdf)[_0x01fd('0x27')](_0x2d6bcd);};}exports[_0x01fd('0x20')]=function(_0x5e8512,_0x55ce20){if(_0x5e8512[_0x01fd('0x28')]['id']){delete _0x5e8512[_0x01fd('0x28')]['id'];}return db[_0x01fd('0x29')][_0x01fd('0x2a')]({'where':{'id':_0x5e8512[_0x01fd('0x2b')]['id']}})['then'](handleEntityNotFound(_0x55ce20,null))[_0x01fd('0x21')](saveUpdates(_0x5e8512[_0x01fd('0x28')],null))['then'](respondWithResult(_0x55ce20,null))[_0x01fd('0x2c')](handleError(_0x55ce20,null));};exports[_0x01fd('0x22')]=function(_0x388072,_0x26c7af){return db[_0x01fd('0x29')][_0x01fd('0x2a')]({'where':{'id':_0x388072['params']['id']}})[_0x01fd('0x21')](handleEntityNotFound(_0x26c7af,null))[_0x01fd('0x21')](removeEntity(_0x26c7af,null))[_0x01fd('0x2c')](handleError(_0x26c7af,null));}; \ No newline at end of file +var _0x16f7=['fast-json-patch','request-promise','moment','mustache','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','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','then','error','stack','name','update','body','find','params','catch','destroy','Action','eml-format','rimraf','zip-dir'];(function(_0x225b26,_0x5af384){var _0x17c3af=function(_0x577ac4){while(--_0x577ac4){_0x225b26['push'](_0x225b26['shift']());}};_0x17c3af(++_0x5af384);}(_0x16f7,0x8a));var _0x716f=function(_0x3c21f1,_0x13a19a){_0x3c21f1=_0x3c21f1-0x0;var _0x291e9d=_0x16f7[_0x3c21f1];return _0x291e9d;};'use strict';var emlformat=require(_0x716f('0x0'));var rimraf=require(_0x716f('0x1'));var zipdir=require(_0x716f('0x2'));var jsonpatch=require(_0x716f('0x3'));var rp=require(_0x716f('0x4'));var moment=require(_0x716f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x716f('0x6'));var util=require('util');var path=require(_0x716f('0x7'));var sox=require(_0x716f('0x8'));var csv=require(_0x716f('0x9'));var ejs=require(_0x716f('0xa'));var fs=require('fs');var fs_extra=require(_0x716f('0xb'));var _=require('lodash');var squel=require(_0x716f('0xc'));var crypto=require(_0x716f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x716f('0xe'));var toCsv=require(_0x716f('0x9'));var querystring=require(_0x716f('0xf'));var Papa=require(_0x716f('0x10'));var Redis=require(_0x716f('0x11'));var authService=require(_0x716f('0x12'));var qs=require(_0x716f('0x13'));var as=require(_0x716f('0x14'));var hardwareService=require(_0x716f('0x15'));var logger=require(_0x716f('0x16'))(_0x716f('0x17'));var utils=require('../../config/utils');var config=require(_0x716f('0x18'));var licenseUtil=require(_0x716f('0x19'));var db=require(_0x716f('0x1a'))['db'];function respondWithStatusCode(_0x2cf754,_0x58fd6f){_0x58fd6f=_0x58fd6f||0xcc;return function(_0x524851){if(_0x524851){return _0x2cf754[_0x716f('0x1b')](_0x58fd6f);}return _0x2cf754[_0x716f('0x1c')](_0x58fd6f)['end']();};}function respondWithResult(_0x20f7ae,_0x5d1fd0){_0x5d1fd0=_0x5d1fd0||0xc8;return function(_0x21f13f){if(_0x21f13f){return _0x20f7ae['status'](_0x5d1fd0)['json'](_0x21f13f);}};}function respondWithFilteredResult(_0x241993,_0x2c9328){return function(_0x364152){if(_0x364152){var _0x58cb04=typeof _0x2c9328[_0x716f('0x1d')]===_0x716f('0x1e')&&typeof _0x2c9328['limit']===_0x716f('0x1e');var _0x4ef6c2=_0x364152[_0x716f('0x1f')];var _0x2ed808=_0x58cb04?0x0:_0x2c9328['offset'];var _0x28e868=_0x58cb04?_0x364152[_0x716f('0x1f')]:_0x2c9328[_0x716f('0x1d')]+_0x2c9328[_0x716f('0x20')];var _0x3993b8;if(_0x28e868>=_0x4ef6c2){_0x28e868=_0x4ef6c2;_0x3993b8=0xc8;}else{_0x3993b8=0xce;}_0x241993[_0x716f('0x1c')](_0x3993b8);return _0x241993[_0x716f('0x21')](_0x716f('0x22'),_0x2ed808+'-'+_0x28e868+'/'+_0x4ef6c2)[_0x716f('0x23')](_0x364152);}return null;};}function patchUpdates(_0x5a86e3){return function(_0x68a94a){try{jsonpatch['apply'](_0x68a94a,_0x5a86e3,!![]);}catch(_0x528697){return BPromise['reject'](_0x528697);}return _0x68a94a['save']();};}function saveUpdates(_0x12f3db,_0x13b133){return function(_0x2599fd){if(_0x2599fd){return _0x2599fd['update'](_0x12f3db)['then'](function(_0x570153){return _0x570153;});}return null;};}function removeEntity(_0x9ae511,_0x125fc0){return function(_0x413adf){if(_0x413adf){return _0x413adf['destroy']()[_0x716f('0x24')](function(){_0x9ae511[_0x716f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42f184,_0x11a577){return function(_0x14dbd3){if(!_0x14dbd3){_0x42f184[_0x716f('0x1b')](0x194);}return _0x14dbd3;};}function handleError(_0x279392,_0x7dee08){_0x7dee08=_0x7dee08||0x1f4;return function(_0x3cb16e){logger[_0x716f('0x25')](_0x3cb16e[_0x716f('0x26')]);if(_0x3cb16e[_0x716f('0x27')]){delete _0x3cb16e['name'];}_0x279392['status'](_0x7dee08)['send'](_0x3cb16e);};}exports[_0x716f('0x28')]=function(_0x3f972d,_0x54f5e8){if(_0x3f972d[_0x716f('0x29')]['id']){delete _0x3f972d['body']['id'];}return db['Action'][_0x716f('0x2a')]({'where':{'id':_0x3f972d[_0x716f('0x2b')]['id']}})['then'](handleEntityNotFound(_0x54f5e8,null))[_0x716f('0x24')](saveUpdates(_0x3f972d['body'],null))[_0x716f('0x24')](respondWithResult(_0x54f5e8,null))[_0x716f('0x2c')](handleError(_0x54f5e8,null));};exports[_0x716f('0x2d')]=function(_0x8b81af,_0x408d6a){return db[_0x716f('0x2e')][_0x716f('0x2a')]({'where':{'id':_0x8b81af[_0x716f('0x2b')]['id']}})[_0x716f('0x24')](handleEntityNotFound(_0x408d6a,null))[_0x716f('0x24')](removeEntity(_0x408d6a,null))[_0x716f('0x2c')](handleError(_0x408d6a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a088b39..71efc17 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 _0x6959=['rimraf','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x2f1787,_0x321733){var _0x50c4c2=function(_0x2e6569){while(--_0x2e6569){_0x2f1787['push'](_0x2f1787['shift']());}};_0x50c4c2(++_0x321733);}(_0x6959,0x119));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9695('0x0'));var util=require('util');var logger=require(_0x9695('0x1'))(_0x9695('0x2'));var moment=require(_0x9695('0x3'));var BPromise=require(_0x9695('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9695('0x5'));var rimraf=require(_0x9695('0x6'));var config=require('../../config/environment');var attributes=require('./action.attributes');module['exports']=function(_0x48a295,_0x4d7645){return _0x48a295['define']('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a5=['tools_actions','util','path','./action.attributes','exports','define'];(function(_0x493bfc,_0x2ec14a){var _0x40480a=function(_0x568ed2){while(--_0x568ed2){_0x493bfc['push'](_0x493bfc['shift']());}};_0x40480a(++_0x2ec14a);}(_0xf0a5,0x139));var _0x5f0a=function(_0x28a88c,_0x46194f){_0x28a88c=_0x28a88c-0x0;var _0x2c8a73=_0xf0a5[_0x28a88c];return _0x2c8a73;};'use strict';var _=require('lodash');var util=require(_0x5f0a('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f0a('0x1'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5f0a('0x2'));module[_0x5f0a('0x3')]=function(_0x4baf3d,_0x276584){return _0x4baf3d[_0x5f0a('0x4')]('Action',attributes,{'tableName':_0x5f0a('0x5'),'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 b4ea718..d557638 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xf494,0x1c6));var _0x4f49=function(_0x4834cb,_0x5bd190){_0x4834cb=_0x4834cb-0x0;var _0x329b84=_0xf494[_0x4834cb];return _0x329b84;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x4d3747,_0x3736f0){var _0x587dca=function(_0x343ddd){while(--_0x343ddd){_0x4d3747['push'](_0x4d3747['shift']());}};_0x587dca(++_0x3736f0);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index b17eb63..7e16a13 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 _0x0fbe=['delete','isAuthenticated','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','/:id','update'];(function(_0x47cfa0,_0x176b87){var _0x386b1d=function(_0x5785e5){while(--_0x5785e5){_0x47cfa0['push'](_0x47cfa0['shift']());}};_0x386b1d(++_0x176b87);}(_0x0fbe,0x156));var _0xe0fb=function(_0x2e1879,_0x25c62a){_0x2e1879=_0x2e1879-0x0;var _0x5d2cc3=_0x0fbe[_0x2e1879];return _0x5d2cc3;};'use strict';var multer=require('multer');var util=require(_0xe0fb('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe0fb('0x1')]();var fs_extra=require(_0xe0fb('0x2'));var auth=require(_0xe0fb('0x3'));var interaction=require(_0xe0fb('0x4'));var config=require('../../config/environment');var controller=require(_0xe0fb('0x5'));router[_0xe0fb('0x6')](_0xe0fb('0x7'),auth['isAuthenticated'](),controller[_0xe0fb('0x8')]);router[_0xe0fb('0x9')]('/:id',auth[_0xe0fb('0xa')](),controller[_0xe0fb('0xb')]);module[_0xe0fb('0xc')]=router; \ No newline at end of file +var _0x2c86=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','destroy','multer','path','connect-timeout'];(function(_0xc07e77,_0x131f5f){var _0x8a489e=function(_0x3cc02a){while(--_0x3cc02a){_0xc07e77['push'](_0xc07e77['shift']());}};_0x8a489e(++_0x131f5f);}(_0x2c86,0x13f));var _0x62c8=function(_0x16637f,_0x49c8ec){_0x16637f=_0x16637f-0x0;var _0xb9441c=_0x2c86[_0x16637f];return _0xb9441c;};'use strict';var multer=require(_0x62c8('0x0'));var util=require('util');var path=require(_0x62c8('0x1'));var timeout=require(_0x62c8('0x2'));var express=require(_0x62c8('0x3'));var router=express[_0x62c8('0x4')]();var fs_extra=require(_0x62c8('0x5'));var auth=require(_0x62c8('0x6'));var interaction=require(_0x62c8('0x7'));var config=require(_0x62c8('0x8'));var controller=require(_0x62c8('0x9'));router['put'](_0x62c8('0xa'),auth[_0x62c8('0xb')](),controller[_0x62c8('0xc')]);router['delete'](_0x62c8('0xa'),auth[_0x62c8('0xb')](),controller[_0x62c8('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index a4e5b3e..73e8f4e 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x337537,_0x4ea7b8){var _0x4fdd67=function(_0x59ad18){while(--_0x59ad18){_0x337537['push'](_0x337537['shift']());}};_0x4fdd67(++_0x4ea7b8);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0xfdbd[_0x3c51d4];return _0x53c45f;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x207c=['STRING','TEXT','exports'];(function(_0x5abf6b,_0xd6889f){var _0x4964a9=function(_0x2d9ff7){while(--_0x2d9ff7){_0x5abf6b['push'](_0x5abf6b['shift']());}};_0x4964a9(++_0xd6889f);}(_0x207c,0x1e8));var _0xc207=function(_0x504575,_0x1ad9e0){_0x504575=_0x504575-0x0;var _0x4484cc=_0x207c[_0x504575];return _0x4484cc;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc207('0x1')]},'parent':{'type':Sequelize[_0xc207('0x1')]},'table':{'type':Sequelize[_0xc207('0x1')]},'conditions':{'type':Sequelize[_0xc207('0x2')]},'joins':{'type':Sequelize[_0xc207('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 27d283f..334ee03 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 _0x6c58=['joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','right_join','GROUP_CONCAT(%s)','condition','value','alias','output','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','SELECT','run','MAX(%s)','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','CustomReports','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC'];(function(_0x403b83,_0xd1eb6e){var _0x2404d3=function(_0x3f1033){while(--_0x3f1033){_0x403b83['push'](_0x403b83['shift']());}};_0x2404d3(++_0xd1eb6e);}(_0x6c58,0xcd));var _0x86c5=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x6c58[_0x34021d];return _0x16597b;};'use strict';var emlformat=require(_0x86c5('0x0'));var rimraf=require(_0x86c5('0x1'));var zipdir=require(_0x86c5('0x2'));var jsonpatch=require(_0x86c5('0x3'));var rp=require('request-promise');var moment=require(_0x86c5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x86c5('0x5'));var path=require(_0x86c5('0x6'));var sox=require(_0x86c5('0x7'));var csv=require(_0x86c5('0x8'));var ejs=require(_0x86c5('0x9'));var fs=require('fs');var fs_extra=require(_0x86c5('0xa'));var _=require('lodash');var squel=require(_0x86c5('0xb'));var crypto=require(_0x86c5('0xc'));var jsforce=require(_0x86c5('0xd'));var deskjs=require(_0x86c5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x86c5('0xf'));var Papa=require(_0x86c5('0x10'));var Redis=require(_0x86c5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x86c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x86c5('0x13'));var logger=require(_0x86c5('0x14'))('api');var utils=require(_0x86c5('0x15'));var config=require(_0x86c5('0x16'));var licenseUtil=require(_0x86c5('0x17'));var db=require(_0x86c5('0x18'))['db'];var dbH=require('../../mysqldb')[_0x86c5('0x19')];function respondWithStatusCode(_0x2ec688,_0x1b8aa8){_0x1b8aa8=_0x1b8aa8||0xcc;return function(_0x19906b){if(_0x19906b){return _0x2ec688['sendStatus'](_0x1b8aa8);}return _0x2ec688[_0x86c5('0x1a')](_0x1b8aa8)['end']();};}function respondWithResult(_0xb07dbd,_0x1e1914){_0x1e1914=_0x1e1914||0xc8;return function(_0x5148e4){if(_0x5148e4){return _0xb07dbd['status'](_0x1e1914)[_0x86c5('0x1b')](_0x5148e4);}};}function respondWithFilteredResult(_0x52e743,_0x39ca85){return function(_0x1b653e){if(_0x1b653e){var _0x157a35=typeof _0x39ca85[_0x86c5('0x1c')]===_0x86c5('0x1d')&&typeof _0x39ca85[_0x86c5('0x1e')]===_0x86c5('0x1d');var _0x3c76f9=_0x1b653e[_0x86c5('0x1f')];var _0x507d30=_0x157a35?0x0:_0x39ca85[_0x86c5('0x1c')];var _0x42efcd=_0x157a35?_0x1b653e[_0x86c5('0x1f')]:_0x39ca85[_0x86c5('0x1c')]+_0x39ca85[_0x86c5('0x1e')];var _0xc5cccc;if(_0x42efcd>=_0x3c76f9){_0x42efcd=_0x3c76f9;_0xc5cccc=0xc8;}else{_0xc5cccc=0xce;}_0x52e743['status'](_0xc5cccc);return _0x52e743[_0x86c5('0x20')](_0x86c5('0x21'),_0x507d30+'-'+_0x42efcd+'/'+_0x3c76f9)['json'](_0x1b653e);}return null;};}function patchUpdates(_0x526326){return function(_0x3e270d){try{jsonpatch[_0x86c5('0x22')](_0x3e270d,_0x526326,!![]);}catch(_0x2e2775){return BPromise['reject'](_0x2e2775);}return _0x3e270d[_0x86c5('0x23')]();};}function saveUpdates(_0x39b9ca,_0x5923cb){return function(_0x15330c){if(_0x15330c){return _0x15330c[_0x86c5('0x24')](_0x39b9ca)[_0x86c5('0x25')](function(_0x493f3f){return _0x493f3f;});}return null;};}function removeEntity(_0x5c4581,_0x341b95){return function(_0x44600d){if(_0x44600d){return _0x44600d[_0x86c5('0x26')]()[_0x86c5('0x25')](function(){var _0x1b44be=_0x44600d['get']({'plain':!![]});var _0x1850a7=_0x86c5('0x27');return db[_0x86c5('0x28')][_0x86c5('0x26')]({'where':{'type':_0x1850a7,'resourceId':_0x1b44be['id']}})[_0x86c5('0x25')](function(){return _0x44600d;});})[_0x86c5('0x25')](function(){_0x5c4581[_0x86c5('0x1a')](0xcc)[_0x86c5('0x29')]();});}};}function handleEntityNotFound(_0x5f19d7,_0x48d4e4){return function(_0x41f317){if(!_0x41f317){_0x5f19d7['sendStatus'](0x194);}return _0x41f317;};}function handleError(_0x3f36da,_0x484e5c){_0x484e5c=_0x484e5c||0x1f4;return function(_0x4ee56e){logger[_0x86c5('0x2a')](_0x4ee56e['stack']);if(_0x4ee56e[_0x86c5('0x2b')]){delete _0x4ee56e[_0x86c5('0x2b')];}_0x3f36da[_0x86c5('0x1a')](_0x484e5c)[_0x86c5('0x2c')](_0x4ee56e);};}exports[_0x86c5('0x2d')]=function(_0x49d717,_0x1f1d7e){var _0x6d83d2={},_0x4ba6da={},_0x1a4819={'count':0x0,'rows':[]};var _0x5d26d3=_[_0x86c5('0x2e')](db[_0x86c5('0x2f')]['rawAttributes'],function(_0x185aac){return{'name':_0x185aac[_0x86c5('0x30')],'type':_0x185aac[_0x86c5('0x31')][_0x86c5('0x32')]};});_0x4ba6da[_0x86c5('0x33')]=_[_0x86c5('0x2e')](_0x5d26d3,_0x86c5('0x2b'));_0x4ba6da['query']=_[_0x86c5('0x34')](_0x49d717[_0x86c5('0x35')]);_0x4ba6da[_0x86c5('0x36')]=_[_0x86c5('0x37')](_0x4ba6da[_0x86c5('0x33')],_0x4ba6da['query']);_0x6d83d2[_0x86c5('0x38')]=_[_0x86c5('0x37')](_0x4ba6da[_0x86c5('0x33')],qs['fields'](_0x49d717[_0x86c5('0x35')][_0x86c5('0x39')]));_0x6d83d2[_0x86c5('0x38')]=_0x6d83d2[_0x86c5('0x38')][_0x86c5('0x3a')]?_0x6d83d2['attributes']:_0x4ba6da['model'];if(!_0x49d717[_0x86c5('0x35')]['hasOwnProperty'](_0x86c5('0x3b'))){_0x6d83d2['limit']=qs[_0x86c5('0x1e')](_0x49d717[_0x86c5('0x35')][_0x86c5('0x1e')]);_0x6d83d2[_0x86c5('0x1c')]=qs['offset'](_0x49d717[_0x86c5('0x35')][_0x86c5('0x1c')]);}_0x6d83d2[_0x86c5('0x3c')]=qs[_0x86c5('0x3d')](_0x49d717[_0x86c5('0x35')][_0x86c5('0x3d')]);_0x6d83d2[_0x86c5('0x3e')]=qs['filters'](_[_0x86c5('0x3f')](_0x49d717[_0x86c5('0x35')],_0x4ba6da[_0x86c5('0x36')]),_0x5d26d3);if(_0x49d717[_0x86c5('0x35')][_0x86c5('0x40')]){_0x6d83d2['where']=_['merge'](_0x6d83d2[_0x86c5('0x3e')],{'$or':_[_0x86c5('0x2e')](_0x5d26d3,function(_0x3eddb0){if(_0x3eddb0[_0x86c5('0x31')]!==_0x86c5('0x41')){var _0x378ab3={};_0x378ab3[_0x3eddb0[_0x86c5('0x2b')]]={'$like':'%'+_0x49d717[_0x86c5('0x35')][_0x86c5('0x40')]+'%'};return _0x378ab3;}})});}_0x6d83d2=_[_0x86c5('0x42')]({},_0x6d83d2,_0x49d717[_0x86c5('0x43')]);var _0x3fe95f={'where':_0x6d83d2[_0x86c5('0x3e')]};return db[_0x86c5('0x2f')]['count'](_0x3fe95f)[_0x86c5('0x25')](function(_0x4c2545){_0x1a4819['count']=_0x4c2545;if(_0x49d717[_0x86c5('0x35')][_0x86c5('0x44')]){_0x6d83d2[_0x86c5('0x45')]=[{'all':!![]}];}return db[_0x86c5('0x2f')]['findAll'](_0x6d83d2);})[_0x86c5('0x25')](function(_0x3f3bf9){_0x1a4819[_0x86c5('0x46')]=_0x3f3bf9;return _0x1a4819;})['then'](respondWithFilteredResult(_0x1f1d7e,_0x6d83d2))[_0x86c5('0x47')](handleError(_0x1f1d7e,null));};exports[_0x86c5('0x48')]=function(_0x2a0432,_0xc7fd57){var _0x4bcc3c={'raw':![],'where':{'id':_0x2a0432[_0x86c5('0x49')]['id']}},_0x410467={};_0x410467[_0x86c5('0x33')]=_['keys'](db['AnalyticCustomReport']['rawAttributes']);_0x410467[_0x86c5('0x35')]=_[_0x86c5('0x34')](_0x2a0432[_0x86c5('0x35')]);_0x410467[_0x86c5('0x36')]=_[_0x86c5('0x37')](_0x410467['model'],_0x410467['query']);_0x4bcc3c[_0x86c5('0x38')]=_[_0x86c5('0x37')](_0x410467[_0x86c5('0x33')],qs[_0x86c5('0x39')](_0x2a0432[_0x86c5('0x35')][_0x86c5('0x39')]));_0x4bcc3c['attributes']=_0x4bcc3c[_0x86c5('0x38')]['length']?_0x4bcc3c[_0x86c5('0x38')]:_0x410467[_0x86c5('0x33')];if(_0x2a0432[_0x86c5('0x35')][_0x86c5('0x44')]){_0x4bcc3c[_0x86c5('0x45')]=[{'all':!![]}];}_0x4bcc3c=_[_0x86c5('0x42')]({},_0x4bcc3c,_0x2a0432[_0x86c5('0x43')]);return db[_0x86c5('0x2f')]['find'](_0x4bcc3c)[_0x86c5('0x25')](handleEntityNotFound(_0xc7fd57,null))[_0x86c5('0x25')](respondWithResult(_0xc7fd57,null))[_0x86c5('0x47')](handleError(_0xc7fd57,null));};exports['create']=function(_0x342db0,_0x34da20){return db['AnalyticCustomReport'][_0x86c5('0x4a')](_0x342db0['body'],{})[_0x86c5('0x25')](function(_0x450d45){var _0x5528fa=_0x342db0['user'][_0x86c5('0x4b')]({'plain':!![]});if(!_0x5528fa)throw new Error(_0x86c5('0x4c'));if(_0x5528fa[_0x86c5('0x4d')]===_0x86c5('0x4e')){var _0x4b756f=_0x450d45[_0x86c5('0x4b')]({'plain':!![]});var _0x44efdc=_0x86c5('0x4f');return db[_0x86c5('0x50')][_0x86c5('0x51')]({'where':{'name':_0x44efdc,'userProfileId':_0x5528fa[_0x86c5('0x52')]},'raw':!![]})[_0x86c5('0x25')](function(_0x14a0dc){if(_0x14a0dc&&_0x14a0dc['autoAssociation']===0x0){return db[_0x86c5('0x28')][_0x86c5('0x4a')]({'name':_0x4b756f[_0x86c5('0x2b')],'resourceId':_0x4b756f['id'],'type':_0x86c5('0x27'),'sectionId':_0x14a0dc['id']},{})[_0x86c5('0x25')](function(){return _0x450d45;});}else{return _0x450d45;}})[_0x86c5('0x47')](function(_0x1b8ae0){logger[_0x86c5('0x2a')](_0x86c5('0x53'),_0x1b8ae0);throw _0x1b8ae0;});}return _0x450d45;})[_0x86c5('0x25')](respondWithResult(_0x34da20,0xc9))[_0x86c5('0x47')](handleError(_0x34da20,null));};exports['update']=function(_0x2d34d2,_0x3e6635){if(_0x2d34d2['body']['id']){delete _0x2d34d2['body']['id'];}return db['AnalyticCustomReport'][_0x86c5('0x51')]({'where':{'id':_0x2d34d2[_0x86c5('0x49')]['id']}})[_0x86c5('0x25')](handleEntityNotFound(_0x3e6635,null))[_0x86c5('0x25')](saveUpdates(_0x2d34d2[_0x86c5('0x54')],null))[_0x86c5('0x25')](respondWithResult(_0x3e6635,null))['catch'](handleError(_0x3e6635,null));};exports[_0x86c5('0x26')]=function(_0x3b7aa1,_0x364b7b){return db[_0x86c5('0x2f')]['find']({'where':{'id':_0x3b7aa1[_0x86c5('0x49')]['id']}})[_0x86c5('0x25')](handleEntityNotFound(_0x364b7b,null))[_0x86c5('0x25')](removeEntity(_0x364b7b,null))[_0x86c5('0x47')](handleError(_0x364b7b,null));};exports[_0x86c5('0x55')]=function(_0xcf18d7,_0x48d989){var _0xe3240=0xa;var _0x560b68=[_0x86c5('0x56'),_0x86c5('0x57'),'right_join',_0x86c5('0x58')];var _0x307919={'SUM':_0x86c5('0x59'),'COUNT':_0x86c5('0x5a'),'COUNT DISTINCT':_0x86c5('0x5b'),'MAX':'MAX(%s)','MIN':_0x86c5('0x5c'),'AVG':_0x86c5('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86c5('0x5e'),'GROUP_CONCAT DESC':_0x86c5('0x5f')};var _0x51e30d={'SEC_TO_TIME':_0x86c5('0x60'),'DATE':_0x86c5('0x61'),'HOUR':_0x86c5('0x62'),'ROUND':_0x86c5('0x63'),'UNIX_TIMESTAMP':_0x86c5('0x64')};var _0x563060=function(_0x50c1d9){return!_[_0x86c5('0x65')]([_0x86c5('0x66'),_0x86c5('0x67'),_0x86c5('0x68'),'IS\x20NOT\x20EMPTY'],_0x50c1d9);};var _0x47c952=function(_0x4579bb){if(!_0x4579bb||!_0x4579bb['rules'][_0x86c5('0x3a')]){return'';}for(var _0x368d54='(',_0x4e59cb=0x0;_0x4e59cb<_0x4579bb[_0x86c5('0x69')]['length'];_0x4e59cb+=0x1){_0x4e59cb>0x0&&(_0x368d54+='\x20'+_0x4579bb[_0x86c5('0x6a')]+'\x20');_0x368d54+=_0x4579bb[_0x86c5('0x69')][_0x4e59cb][_0x86c5('0x6b')]?_0x47c952(_0x4579bb[_0x86c5('0x69')][_0x4e59cb][_0x86c5('0x6b')]):_0x4579bb['rules'][_0x4e59cb][_0x86c5('0x6c')]+'\x20'+_0x4579bb[_0x86c5('0x69')][_0x4e59cb]['condition']+(_0x563060(_0x4579bb[_0x86c5('0x69')][_0x4e59cb]['condition'])?'\x20'+_0x4579bb[_0x86c5('0x69')][_0x4e59cb]['value']:'');}return _0x368d54+')';};var _0x544b9b={'where':{'id':_0xcf18d7[_0x86c5('0x49')]['id']}},_0x196bb9,_0x572b24,_0x135cf2,_0x240042,_0x1b542f;_0x544b9b=_[_0x86c5('0x42')]({},_0x544b9b,_0xcf18d7['options']);return db['AnalyticCustomReport']['find'](_0x544b9b)[_0x86c5('0x25')](function(_0x401c06){if(_0x401c06){_0x196bb9=_0x401c06;return _0x401c06[_0x86c5('0x6d')]();}return null;})[_0x86c5('0x25')](function(_0x20471a){if(_0x20471a){if(!_0x20471a[_0x86c5('0x3a')]){throw new db[(_0x86c5('0x6e'))][(_0x86c5('0x6f'))](_0x86c5('0x70'),0x193);}_0x572b24=_0x20471a;return db[_0x86c5('0x71')][_0x86c5('0x72')]({'raw':!![]});}return null;})[_0x86c5('0x25')](function(_0x38152b){if(_0x38152b){_0x135cf2=_[_0x86c5('0x73')](_0x38152b,'id');var _0x1f8cc5;var _0x2b0b14=squel[_0x86c5('0x74')]();_0x2b0b14[_0x86c5('0x75')](_0x196bb9[_0x86c5('0x76')]);for(var _0x1011d2=0x0;_0x1011d2<_0x572b24[_0x86c5('0x3a')];_0x1011d2+=0x1){_0x1f8cc5=_0x572b24[_0x1011d2][_0x86c5('0x77')]?_0x135cf2[_0x572b24[_0x1011d2][_0x86c5('0x77')]][_0x86c5('0x78')]:_0x572b24[_0x1011d2][_0x86c5('0x6c')];_0x1f8cc5=_0x572b24[_0x1011d2][_0x86c5('0x79')]?_[_0x86c5('0x7a')](_0x307919[_0x572b24[_0x1011d2][_0x86c5('0x79')]],'%s',_0x1f8cc5):_0x1f8cc5;_0x1f8cc5=_0x572b24[_0x1011d2][_0x86c5('0x7b')]?_['replace'](_0x51e30d[_0x572b24[_0x1011d2]['format']],'%s',_0x1f8cc5):_0x1f8cc5;if(_0x572b24[_0x1011d2][_0x86c5('0x7c')]){_0x2b0b14['group'](_0x1f8cc5);}_0x572b24[_0x1011d2][_0x86c5('0x7d')]&&_0x2b0b14[_0x86c5('0x3c')](_0x1f8cc5,_0x572b24[_0x1011d2][_0x86c5('0x7d')]===_0x86c5('0x7e')?![]:!![]);_0x2b0b14[_0x86c5('0x6c')](_0x1f8cc5,_0x572b24[_0x1011d2]['alias']||_0x1f8cc5);}if(_0x196bb9[_0x86c5('0x7f')]){_0x196bb9['joins']=JSON['parse'](_0x196bb9[_0x86c5('0x7f')]);for(var _0x528ccb=0x0;_0x528ccb<_0x196bb9[_0x86c5('0x7f')]['length'];_0x528ccb+=0x1){if(_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x31')]&&_[_0x86c5('0x65')](_0x560b68,_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x31')])&&_0x196bb9['joins'][_0x528ccb]['parentKey']&&_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x80')]&&_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x81')]){_0x2b0b14[_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x31')]](_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x80')],null,util[_0x86c5('0x7b')](_0x86c5('0x82'),_0x196bb9[_0x86c5('0x76')],_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x83')],_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x80')],_0x196bb9[_0x86c5('0x7f')][_0x528ccb][_0x86c5('0x81')]));}}}if(_0x196bb9[_0x86c5('0x84')]){_0x196bb9[_0x86c5('0x84')]=JSON[_0x86c5('0x85')](_0x196bb9[_0x86c5('0x84')]);_0x2b0b14['where'](_0x47c952(_0x196bb9['conditions'][_0x86c5('0x6b')]));}_0x1b542f=_0x2b0b14[_0x86c5('0x86')]();_0x2b0b14[_0x86c5('0x1e')](_0xe3240);_0x2b0b14['offset'](0x0);logger[_0x86c5('0x87')]('Limited\x20Query:',_0x2b0b14[_0x86c5('0x88')]());return dbH[_0x86c5('0x89')][_0x86c5('0x35')](_0x2b0b14[_0x86c5('0x88')](),{'type':dbH[_0x86c5('0x89')][_0x86c5('0x8a')]['SELECT']});}})[_0x86c5('0x25')](respondWithResult(_0x48d989,null))[_0x86c5('0x47')](handleError(_0x48d989,null));};function runReport(_0x1ea165,_0x419212,_0x29a2b9){var _0x2d3a46=_0x419212['name'];var _0x1b57d1=0xa;var _0x441512=[_0x86c5('0x56'),_0x86c5('0x57'),_0x86c5('0x8b'),_0x86c5('0x58')];var _0x184128={'SUM':'SUM(%s)','COUNT':_0x86c5('0x5a'),'COUNT DISTINCT':_0x86c5('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x86c5('0x5d'),'GROUP_CONCAT':_0x86c5('0x8c'),'GROUP_CONCAT ASC':_0x86c5('0x5e'),'GROUP_CONCAT DESC':_0x86c5('0x5f')};var _0x4877fa={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86c5('0x62'),'ROUND':_0x86c5('0x63'),'UNIX_TIMESTAMP':_0x86c5('0x64')};var _0x545e8b=function(_0x350cd2){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x350cd2);};var _0x5ca8b1=function(_0x571b5d){if(!_0x571b5d||!_0x571b5d[_0x86c5('0x69')][_0x86c5('0x3a')]){return'';}for(var _0x32ace3='(',_0x3dec51=0x0;_0x3dec51<_0x571b5d[_0x86c5('0x69')][_0x86c5('0x3a')];_0x3dec51+=0x1){_0x3dec51>0x0&&(_0x32ace3+='\x20'+_0x571b5d[_0x86c5('0x6a')]+'\x20');_0x32ace3+=_0x571b5d[_0x86c5('0x69')][_0x3dec51][_0x86c5('0x6b')]?_0x5ca8b1(_0x571b5d[_0x86c5('0x69')][_0x3dec51][_0x86c5('0x6b')]):_0x571b5d['rules'][_0x3dec51][_0x86c5('0x6c')]+'\x20'+_0x571b5d[_0x86c5('0x69')][_0x3dec51][_0x86c5('0x8d')]+(_0x545e8b(_0x571b5d[_0x86c5('0x69')][_0x3dec51]['condition'])?'\x20'+_0x571b5d[_0x86c5('0x69')][_0x3dec51][_0x86c5('0x8e')]:'');}return _0x32ace3+')';};var _0x521353={'where':{'id':_0x1ea165['id']}},_0x3ed1d3,_0x1b878a,_0x11778d,_0x3b35f9,_0x277508;_0x521353=_[_0x86c5('0x42')]({},_0x521353,_0x29a2b9);return db[_0x86c5('0x2f')][_0x86c5('0x51')](_0x521353)[_0x86c5('0x25')](function(_0x1c2332){if(_0x1c2332){_0x3ed1d3=_0x1c2332;return _0x1c2332[_0x86c5('0x6d')]();}return null;})[_0x86c5('0x25')](function(_0x5c64dc){if(_0x5c64dc){if(!_0x5c64dc[_0x86c5('0x3a')]){throw new db[(_0x86c5('0x6e'))][(_0x86c5('0x6f'))](_0x86c5('0x70'),0x193);}_0x1b878a=_0x5c64dc;return db[_0x86c5('0x71')][_0x86c5('0x72')]({'raw':!![]});}return null;})[_0x86c5('0x25')](function(_0x7c4343){if(_0x7c4343){_0x11778d=_[_0x86c5('0x73')](_0x7c4343,'id');var _0x16cd71;var _0x12b203=squel['select']();_0x12b203[_0x86c5('0x75')](_0x3ed1d3[_0x86c5('0x76')]);for(var _0x8d0314=0x0;_0x8d0314<_0x1b878a[_0x86c5('0x3a')];_0x8d0314+=0x1){_0x16cd71=_0x1b878a[_0x8d0314][_0x86c5('0x77')]?_0x11778d[_0x1b878a[_0x8d0314]['MetricId']][_0x86c5('0x78')]:_0x1b878a[_0x8d0314]['field'];_0x16cd71=_0x1b878a[_0x8d0314][_0x86c5('0x79')]?_['replace'](_0x184128[_0x1b878a[_0x8d0314][_0x86c5('0x79')]],'%s',_0x16cd71):_0x16cd71;_0x16cd71=_0x1b878a[_0x8d0314]['format']?_[_0x86c5('0x7a')](_0x4877fa[_0x1b878a[_0x8d0314][_0x86c5('0x7b')]],'%s',_0x16cd71):_0x16cd71;if(_0x1b878a[_0x8d0314]['groupBy']){_0x12b203[_0x86c5('0x6b')](_0x16cd71);}_0x1b878a[_0x8d0314][_0x86c5('0x7d')]&&_0x12b203[_0x86c5('0x3c')](_0x16cd71,_0x1b878a[_0x8d0314][_0x86c5('0x7d')]==='DESC'?![]:!![]);_0x12b203['field'](_0x16cd71,_0x1b878a[_0x8d0314][_0x86c5('0x8f')]||_0x16cd71);}if(_0x3ed1d3['joins']){_0x3ed1d3[_0x86c5('0x7f')]=JSON['parse'](_0x3ed1d3['joins']);for(var _0x5cbfb0=0x0;_0x5cbfb0<_0x3ed1d3[_0x86c5('0x7f')][_0x86c5('0x3a')];_0x5cbfb0+=0x1){if(_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x31')]&&_[_0x86c5('0x65')](_0x441512,_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x31')])&&_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x83')]&&_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x80')]&&_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0]['foreignKey']){_0x12b203[_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x31')]](_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x80')],null,util[_0x86c5('0x7b')](_0x86c5('0x82'),_0x3ed1d3[_0x86c5('0x76')],_0x3ed1d3['joins'][_0x5cbfb0][_0x86c5('0x83')],_0x3ed1d3['joins'][_0x5cbfb0]['foreignTable'],_0x3ed1d3[_0x86c5('0x7f')][_0x5cbfb0][_0x86c5('0x81')]));}}}if(_0x3ed1d3[_0x86c5('0x84')]){_0x3ed1d3['conditions']=JSON[_0x86c5('0x85')](_0x3ed1d3[_0x86c5('0x84')]);_0x12b203[_0x86c5('0x3e')](_0x5ca8b1(_0x3ed1d3['conditions'][_0x86c5('0x6b')]));}_0x277508=_0x12b203[_0x86c5('0x86')]();_0x12b203[_0x86c5('0x1e')](_0x1b57d1);_0x12b203[_0x86c5('0x1c')](0x0);return;}})[_0x86c5('0x25')](function(){if(_0x419212[_0x86c5('0x90')]==='web'){return null;}var _0x1e9232=_[_0x86c5('0x42')](_0x419212,{'name':_0x419212[_0x86c5('0x91')]||_0x419212['name']||_0x3ed1d3[_0x86c5('0x2b')],'basename':_0x2d3a46,'savename':util[_0x86c5('0x7b')]('%s-%s.%s',_0x419212[_0x86c5('0x2b')]||_0x3ed1d3[_0x86c5('0x2b')],require('randomstring')[_0x86c5('0x92')](0x4),_0x419212[_0x86c5('0x90')]||_0x86c5('0x93')),'reportId':_0x3ed1d3['id'],'reportType':_0x86c5('0x94')});return db[_0x86c5('0x95')]['create'](_0x1e9232,{'raw':!![]});})[_0x86c5('0x25')](function(_0x15b2b7){if(_0x3ed1d3['table']===_0x86c5('0x96')){_0x277508[_0x86c5('0x3e')](_0x3ed1d3[_0x86c5('0x76')]+_0x86c5('0x97'),_0x419212['startDate'],_0x419212['endDate']);}else{_0x277508[_0x86c5('0x3e')](_0x3ed1d3['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x419212[_0x86c5('0x98')],_0x419212[_0x86c5('0x99')]);}if(_0x15b2b7){logger[_0x86c5('0x9a')](_0x86c5('0x9b'),_0x277508[_0x86c5('0x88')]());require(_0x86c5('0x9c'))[_0x86c5('0x9d')](path[_0x86c5('0x56')](__dirname,_0x86c5('0x9e'),_0x15b2b7[_0x86c5('0x90')]),[_0x15b2b7['id'],_0x277508[_0x86c5('0x88')](),path[_0x86c5('0x56')](__dirname,_0x86c5('0x9f'),_0x15b2b7[_0x86c5('0xa0')]),_0x2d3a46]);return _0x15b2b7;}else{var _0x44ee5b=squel[_0x86c5('0x74')]();_0x44ee5b[_0x86c5('0x75')]('('+_0x277508[_0x86c5('0x88')]()+')','countTable');_0x44ee5b[_0x86c5('0x6c')](_0x86c5('0xa1'),_0x86c5('0x1f'));_0x277508[_0x86c5('0x1e')](_0x419212[_0x86c5('0x1e')]||_0x1b57d1);_0x277508[_0x86c5('0x1c')](_0x419212[_0x86c5('0x1c')]||0x0);return dbH[_0x86c5('0x89')][_0x86c5('0x35')](_0x44ee5b['toString'](),{'type':dbH[_0x86c5('0x89')]['QueryTypes'][_0x86c5('0xa2')]})[_0x86c5('0x25')](function(_0x56578f){if(!_0x56578f[_0x86c5('0x3a')]){_0x3b35f9=0x0;}else{_0x3b35f9=_0x56578f[0x0][_0x86c5('0x1f')]||0x0;}return dbH[_0x86c5('0x89')][_0x86c5('0x35')](_0x277508[_0x86c5('0x88')](),{'type':dbH['sequelize'][_0x86c5('0x8a')]['SELECT']});})[_0x86c5('0x25')](function(_0x38b5fb){return{'rows':_0x38b5fb||[],'count':_0x3b35f9};});}});}exports[_0x86c5('0xa3')]=function(_0xa75117,_0xaa0c22){return runReport(_0xa75117['params'],_0xa75117[_0x86c5('0x35')],_0xa75117[_0x86c5('0x43')])[_0x86c5('0x25')](respondWithResult(_0xaa0c22,null))['catch'](handleError(_0xaa0c22,null));};exports['runReport']=runReport;exports['query']=function(_0x4b1878,_0x432809){var _0x13e9db=0xa;var _0x50216d=[_0x86c5('0x56'),_0x86c5('0x57'),_0x86c5('0x8b'),_0x86c5('0x58')];var _0x1a2e06={'SUM':_0x86c5('0x59'),'COUNT':_0x86c5('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86c5('0xa4'),'MIN':_0x86c5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86c5('0x8c'),'GROUP_CONCAT ASC':_0x86c5('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5d9eea={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86c5('0x61'),'HOUR':_0x86c5('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x86c5('0x64')};var _0x4e092e=function(_0x593d15){return!_[_0x86c5('0x65')](['IS\x20NULL',_0x86c5('0x67'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x593d15);};var _0x19ebf0=function(_0x2b08d5){if(!_0x2b08d5||!_0x2b08d5[_0x86c5('0x69')]['length']){return'';}for(var _0x2af60='(',_0x16e9fc=0x0;_0x16e9fc<_0x2b08d5[_0x86c5('0x69')][_0x86c5('0x3a')];_0x16e9fc+=0x1){_0x16e9fc>0x0&&(_0x2af60+='\x20'+_0x2b08d5[_0x86c5('0x6a')]+'\x20');_0x2af60+=_0x2b08d5['rules'][_0x16e9fc]['group']?_0x19ebf0(_0x2b08d5[_0x86c5('0x69')][_0x16e9fc][_0x86c5('0x6b')]):_0x2b08d5[_0x86c5('0x69')][_0x16e9fc][_0x86c5('0x6c')]+'\x20'+_0x2b08d5[_0x86c5('0x69')][_0x16e9fc]['condition']+(_0x4e092e(_0x2b08d5['rules'][_0x16e9fc][_0x86c5('0x8d')])?'\x20'+_0x2b08d5[_0x86c5('0x69')][_0x16e9fc][_0x86c5('0x8e')]:'');}return _0x2af60+')';};var _0x18228d={'where':{'id':_0x4b1878[_0x86c5('0x49')]['id']}},_0x4e09e9,_0xe70a6d,_0x4e442e,_0x330be0,_0x1fcb8c;_0x18228d=_[_0x86c5('0x42')]({},_0x18228d,_0x4b1878['options']);return db[_0x86c5('0x2f')]['find'](_0x18228d)[_0x86c5('0x25')](function(_0x4afd58){if(_0x4afd58){_0x4e09e9=_0x4afd58;return _0x4afd58[_0x86c5('0x6d')]();}return null;})[_0x86c5('0x25')](function(_0x5cfcea){if(_0x5cfcea){if(!_0x5cfcea[_0x86c5('0x3a')]){throw new db[(_0x86c5('0x6e'))]['ValidationErrorItem'](_0x86c5('0x70'),0x193);}_0xe70a6d=_0x5cfcea;return db[_0x86c5('0x71')]['findAll']({'raw':!![]});}return null;})[_0x86c5('0x25')](function(_0x36b1c8){if(_0x36b1c8){_0x4e442e=_[_0x86c5('0x73')](_0x36b1c8,'id');var _0xbf4e16;var _0x1d366c=squel[_0x86c5('0x74')]();_0x1d366c['from'](_0x4e09e9[_0x86c5('0x76')]);for(var _0x5e3cf1=0x0;_0x5e3cf1<_0xe70a6d[_0x86c5('0x3a')];_0x5e3cf1+=0x1){_0xbf4e16=_0xe70a6d[_0x5e3cf1]['MetricId']?_0x4e442e[_0xe70a6d[_0x5e3cf1]['MetricId']][_0x86c5('0x78')]:_0xe70a6d[_0x5e3cf1][_0x86c5('0x6c')];_0xbf4e16=_0xe70a6d[_0x5e3cf1]['function']?_[_0x86c5('0x7a')](_0x1a2e06[_0xe70a6d[_0x5e3cf1][_0x86c5('0x79')]],'%s',_0xbf4e16):_0xbf4e16;_0xbf4e16=_0xe70a6d[_0x5e3cf1][_0x86c5('0x7b')]?_['replace'](_0x5d9eea[_0xe70a6d[_0x5e3cf1]['format']],'%s',_0xbf4e16):_0xbf4e16;if(_0xe70a6d[_0x5e3cf1][_0x86c5('0x7c')]){_0x1d366c['group'](_0xbf4e16);}_0xe70a6d[_0x5e3cf1][_0x86c5('0x7d')]&&_0x1d366c['order'](_0xbf4e16,_0xe70a6d[_0x5e3cf1][_0x86c5('0x7d')]===_0x86c5('0x7e')?![]:!![]);_0x1d366c[_0x86c5('0x6c')](_0xbf4e16,_0xe70a6d[_0x5e3cf1][_0x86c5('0x8f')]||_0xbf4e16);}if(_0x4e09e9[_0x86c5('0x7f')]){_0x4e09e9['joins']=JSON[_0x86c5('0x85')](_0x4e09e9[_0x86c5('0x7f')]);for(var _0x34a996=0x0;_0x34a996<_0x4e09e9[_0x86c5('0x7f')]['length'];_0x34a996+=0x1){if(_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x31')]&&_[_0x86c5('0x65')](_0x50216d,_0x4e09e9['joins'][_0x34a996][_0x86c5('0x31')])&&_0x4e09e9[_0x86c5('0x7f')][_0x34a996]['parentKey']&&_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x80')]&&_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x81')]){_0x1d366c[_0x4e09e9[_0x86c5('0x7f')][_0x34a996]['type']](_0x4e09e9['joins'][_0x34a996][_0x86c5('0x80')],null,util[_0x86c5('0x7b')]('%s.%s\x20=\x20%s.%s',_0x4e09e9['table'],_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x83')],_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x80')],_0x4e09e9[_0x86c5('0x7f')][_0x34a996][_0x86c5('0x81')]));}}}if(_0x4e09e9['conditions']){_0x4e09e9['conditions']=JSON[_0x86c5('0x85')](_0x4e09e9[_0x86c5('0x84')]);_0x1d366c[_0x86c5('0x3e')](_0x19ebf0(_0x4e09e9[_0x86c5('0x84')][_0x86c5('0x6b')]));}_0x1fcb8c=_0x1d366c[_0x86c5('0x86')]();_0x1d366c[_0x86c5('0x1e')](_0x13e9db);_0x1d366c['offset'](0x0);logger['debug'](_0x86c5('0xa5'),_0x1d366c[_0x86c5('0x88')]());return dbH['sequelize']['query'](_0x1d366c[_0x86c5('0x88')](),{'type':dbH[_0x86c5('0x89')][_0x86c5('0x8a')]['SELECT']});}})[_0x86c5('0x25')](function(){return{'sql':_0x1fcb8c[_0x86c5('0x88')]()};})[_0x86c5('0x25')](respondWithResult(_0x432809,null))[_0x86c5('0x47')](handleError(_0x432809,null));}; \ No newline at end of file +var _0xda23=['UserProfileResource','destroy','end','sendStatus','error','stack','name','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','parse','conditions','clone','debug','toString','sequelize','QueryTypes','cross_join','MIN(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','getFields','Sequelize','metric','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','output','../../files/reports','savename','from','countTable','SELECT','run','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','Limited\x20Query:','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','get'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xda23,0x1d1));var _0x3da2=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0xda23[_0x102881];return _0x5c63d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3da2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3da2('0x1'));var rp=require(_0x3da2('0x2'));var moment=require(_0x3da2('0x3'));var BPromise=require(_0x3da2('0x4'));var Mustache=require(_0x3da2('0x5'));var util=require('util');var path=require(_0x3da2('0x6'));var sox=require('sox');var csv=require(_0x3da2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3da2('0x8'));var _=require(_0x3da2('0x9'));var squel=require(_0x3da2('0xa'));var crypto=require('crypto');var jsforce=require(_0x3da2('0xb'));var deskjs=require(_0x3da2('0xc'));var toCsv=require(_0x3da2('0x7'));var querystring=require(_0x3da2('0xd'));var Papa=require('papaparse');var Redis=require(_0x3da2('0xe'));var authService=require(_0x3da2('0xf'));var qs=require(_0x3da2('0x10'));var as=require(_0x3da2('0x11'));var hardwareService=require(_0x3da2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3da2('0x13'));var config=require(_0x3da2('0x14'));var licenseUtil=require(_0x3da2('0x15'));var db=require(_0x3da2('0x16'))['db'];var dbH=require(_0x3da2('0x16'))[_0x3da2('0x17')];function respondWithStatusCode(_0x3f8cc7,_0x4308ac){_0x4308ac=_0x4308ac||0xcc;return function(_0x46558c){if(_0x46558c){return _0x3f8cc7['sendStatus'](_0x4308ac);}return _0x3f8cc7[_0x3da2('0x18')](_0x4308ac)['end']();};}function respondWithResult(_0x443909,_0x2836f2){_0x2836f2=_0x2836f2||0xc8;return function(_0x31c7ad){if(_0x31c7ad){return _0x443909[_0x3da2('0x18')](_0x2836f2)[_0x3da2('0x19')](_0x31c7ad);}};}function respondWithFilteredResult(_0x52710e,_0x19e6d7){return function(_0x3475ae){if(_0x3475ae){var _0x57f7f7=typeof _0x19e6d7['offset']===_0x3da2('0x1a')&&typeof _0x19e6d7[_0x3da2('0x1b')]===_0x3da2('0x1a');var _0x398783=_0x3475ae['count'];var _0x22aef5=_0x57f7f7?0x0:_0x19e6d7[_0x3da2('0x1c')];var _0x45da89=_0x57f7f7?_0x3475ae[_0x3da2('0x1d')]:_0x19e6d7['offset']+_0x19e6d7[_0x3da2('0x1b')];var _0x797adb;if(_0x45da89>=_0x398783){_0x45da89=_0x398783;_0x797adb=0xc8;}else{_0x797adb=0xce;}_0x52710e['status'](_0x797adb);return _0x52710e['set'](_0x3da2('0x1e'),_0x22aef5+'-'+_0x45da89+'/'+_0x398783)[_0x3da2('0x19')](_0x3475ae);}return null;};}function patchUpdates(_0x400671){return function(_0x2f8302){try{jsonpatch[_0x3da2('0x1f')](_0x2f8302,_0x400671,!![]);}catch(_0xca831d){return BPromise[_0x3da2('0x20')](_0xca831d);}return _0x2f8302[_0x3da2('0x21')]();};}function saveUpdates(_0xddcbda,_0x33fcc9){return function(_0x41c825){if(_0x41c825){return _0x41c825['update'](_0xddcbda)[_0x3da2('0x22')](function(_0x27b7b0){return _0x27b7b0;});}return null;};}function removeEntity(_0x14690a,_0x1c36eb){return function(_0x167de6){if(_0x167de6){return _0x167de6['destroy']()[_0x3da2('0x22')](function(){var _0x539de5=_0x167de6[_0x3da2('0x23')]({'plain':!![]});var _0x36156f='CustomReports';return db[_0x3da2('0x24')][_0x3da2('0x25')]({'where':{'type':_0x36156f,'resourceId':_0x539de5['id']}})[_0x3da2('0x22')](function(){return _0x167de6;});})[_0x3da2('0x22')](function(){_0x14690a[_0x3da2('0x18')](0xcc)[_0x3da2('0x26')]();});}};}function handleEntityNotFound(_0x241838,_0x46ace5){return function(_0x3f4916){if(!_0x3f4916){_0x241838[_0x3da2('0x27')](0x194);}return _0x3f4916;};}function handleError(_0x16c8db,_0x4e4e9d){_0x4e4e9d=_0x4e4e9d||0x1f4;return function(_0x4de139){logger[_0x3da2('0x28')](_0x4de139[_0x3da2('0x29')]);if(_0x4de139[_0x3da2('0x2a')]){delete _0x4de139[_0x3da2('0x2a')];}_0x16c8db['status'](_0x4e4e9d)['send'](_0x4de139);};}exports['index']=function(_0x3e294a,_0x4f744c){var _0x3b9916={},_0x4b8275={},_0x5b87c0={'count':0x0,'rows':[]};var _0x5ef0c7=_[_0x3da2('0x2b')](db[_0x3da2('0x2c')][_0x3da2('0x2d')],function(_0x1f46de){return{'name':_0x1f46de['fieldName'],'type':_0x1f46de[_0x3da2('0x2e')][_0x3da2('0x2f')]};});_0x4b8275[_0x3da2('0x30')]=_['map'](_0x5ef0c7,_0x3da2('0x2a'));_0x4b8275[_0x3da2('0x31')]=_[_0x3da2('0x32')](_0x3e294a[_0x3da2('0x31')]);_0x4b8275[_0x3da2('0x33')]=_[_0x3da2('0x34')](_0x4b8275[_0x3da2('0x30')],_0x4b8275['query']);_0x3b9916[_0x3da2('0x35')]=_['intersection'](_0x4b8275[_0x3da2('0x30')],qs[_0x3da2('0x36')](_0x3e294a[_0x3da2('0x31')][_0x3da2('0x36')]));_0x3b9916[_0x3da2('0x35')]=_0x3b9916[_0x3da2('0x35')][_0x3da2('0x37')]?_0x3b9916[_0x3da2('0x35')]:_0x4b8275[_0x3da2('0x30')];if(!_0x3e294a[_0x3da2('0x31')][_0x3da2('0x38')]('nolimit')){_0x3b9916['limit']=qs['limit'](_0x3e294a[_0x3da2('0x31')]['limit']);_0x3b9916['offset']=qs[_0x3da2('0x1c')](_0x3e294a[_0x3da2('0x31')][_0x3da2('0x1c')]);}_0x3b9916[_0x3da2('0x39')]=qs[_0x3da2('0x3a')](_0x3e294a[_0x3da2('0x31')][_0x3da2('0x3a')]);_0x3b9916[_0x3da2('0x3b')]=qs[_0x3da2('0x33')](_[_0x3da2('0x3c')](_0x3e294a['query'],_0x4b8275['filters']),_0x5ef0c7);if(_0x3e294a['query'][_0x3da2('0x3d')]){_0x3b9916['where']=_[_0x3da2('0x3e')](_0x3b9916[_0x3da2('0x3b')],{'$or':_[_0x3da2('0x2b')](_0x5ef0c7,function(_0x523f3e){if(_0x523f3e[_0x3da2('0x2e')]!==_0x3da2('0x3f')){var _0x6eb2e6={};_0x6eb2e6[_0x523f3e[_0x3da2('0x2a')]]={'$like':'%'+_0x3e294a[_0x3da2('0x31')][_0x3da2('0x3d')]+'%'};return _0x6eb2e6;}})});}_0x3b9916=_[_0x3da2('0x3e')]({},_0x3b9916,_0x3e294a[_0x3da2('0x40')]);var _0x36eb19={'where':_0x3b9916[_0x3da2('0x3b')]};return db[_0x3da2('0x2c')][_0x3da2('0x1d')](_0x36eb19)['then'](function(_0x32d51e){_0x5b87c0[_0x3da2('0x1d')]=_0x32d51e;if(_0x3e294a[_0x3da2('0x31')][_0x3da2('0x41')]){_0x3b9916['include']=[{'all':!![]}];}return db[_0x3da2('0x2c')][_0x3da2('0x42')](_0x3b9916);})[_0x3da2('0x22')](function(_0x1112f2){_0x5b87c0[_0x3da2('0x43')]=_0x1112f2;return _0x5b87c0;})[_0x3da2('0x22')](respondWithFilteredResult(_0x4f744c,_0x3b9916))['catch'](handleError(_0x4f744c,null));};exports[_0x3da2('0x44')]=function(_0x5d3a61,_0x569a68){var _0x404b50={'raw':![],'where':{'id':_0x5d3a61['params']['id']}},_0xaf5da2={};_0xaf5da2[_0x3da2('0x30')]=_['keys'](db[_0x3da2('0x2c')][_0x3da2('0x2d')]);_0xaf5da2[_0x3da2('0x31')]=_[_0x3da2('0x32')](_0x5d3a61['query']);_0xaf5da2['filters']=_[_0x3da2('0x34')](_0xaf5da2[_0x3da2('0x30')],_0xaf5da2[_0x3da2('0x31')]);_0x404b50[_0x3da2('0x35')]=_[_0x3da2('0x34')](_0xaf5da2[_0x3da2('0x30')],qs[_0x3da2('0x36')](_0x5d3a61[_0x3da2('0x31')]['fields']));_0x404b50[_0x3da2('0x35')]=_0x404b50[_0x3da2('0x35')]['length']?_0x404b50[_0x3da2('0x35')]:_0xaf5da2[_0x3da2('0x30')];if(_0x5d3a61[_0x3da2('0x31')][_0x3da2('0x41')]){_0x404b50[_0x3da2('0x45')]=[{'all':!![]}];}_0x404b50=_['merge']({},_0x404b50,_0x5d3a61[_0x3da2('0x40')]);return db[_0x3da2('0x2c')][_0x3da2('0x46')](_0x404b50)[_0x3da2('0x22')](handleEntityNotFound(_0x569a68,null))[_0x3da2('0x22')](respondWithResult(_0x569a68,null))[_0x3da2('0x47')](handleError(_0x569a68,null));};exports[_0x3da2('0x48')]=function(_0x409e22,_0x1e82fe){return db[_0x3da2('0x2c')][_0x3da2('0x48')](_0x409e22[_0x3da2('0x49')],{})[_0x3da2('0x22')](function(_0x4a31e9){var _0x2b1a9b=_0x409e22[_0x3da2('0x4a')][_0x3da2('0x23')]({'plain':!![]});if(!_0x2b1a9b)throw new Error(_0x3da2('0x4b'));if(_0x2b1a9b[_0x3da2('0x4c')]===_0x3da2('0x4a')){var _0x574fbe=_0x4a31e9[_0x3da2('0x23')]({'plain':!![]});var _0xa0c324='Reports';return db[_0x3da2('0x4d')][_0x3da2('0x46')]({'where':{'name':_0xa0c324,'userProfileId':_0x2b1a9b[_0x3da2('0x4e')]},'raw':!![]})['then'](function(_0x3490bf){if(_0x3490bf&&_0x3490bf[_0x3da2('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x574fbe[_0x3da2('0x2a')],'resourceId':_0x574fbe['id'],'type':_0x3da2('0x50'),'sectionId':_0x3490bf['id']},{})[_0x3da2('0x22')](function(){return _0x4a31e9;});}else{return _0x4a31e9;}})['catch'](function(_0x7356b6){logger[_0x3da2('0x28')](_0x3da2('0x51'),_0x7356b6);throw _0x7356b6;});}return _0x4a31e9;})[_0x3da2('0x22')](respondWithResult(_0x1e82fe,0xc9))[_0x3da2('0x47')](handleError(_0x1e82fe,null));};exports[_0x3da2('0x52')]=function(_0x14e1f1,_0x4eb20d){if(_0x14e1f1[_0x3da2('0x49')]['id']){delete _0x14e1f1[_0x3da2('0x49')]['id'];}return db[_0x3da2('0x2c')][_0x3da2('0x46')]({'where':{'id':_0x14e1f1[_0x3da2('0x53')]['id']}})[_0x3da2('0x22')](handleEntityNotFound(_0x4eb20d,null))[_0x3da2('0x22')](saveUpdates(_0x14e1f1[_0x3da2('0x49')],null))[_0x3da2('0x22')](respondWithResult(_0x4eb20d,null))[_0x3da2('0x47')](handleError(_0x4eb20d,null));};exports[_0x3da2('0x25')]=function(_0x51441f,_0x4c050b){return db[_0x3da2('0x2c')]['find']({'where':{'id':_0x51441f['params']['id']}})[_0x3da2('0x22')](handleEntityNotFound(_0x4c050b,null))[_0x3da2('0x22')](removeEntity(_0x4c050b,null))[_0x3da2('0x47')](handleError(_0x4c050b,null));};exports[_0x3da2('0x54')]=function(_0x5df3fb,_0x37b0d8){var _0x388afa=0xa;var _0x67d5eb=[_0x3da2('0x55'),_0x3da2('0x56'),_0x3da2('0x57'),'cross_join'];var _0x3dc3ad={'SUM':_0x3da2('0x58'),'COUNT':_0x3da2('0x59'),'COUNT DISTINCT':_0x3da2('0x5a'),'MAX':_0x3da2('0x5b'),'MIN':'MIN(%s)','AVG':_0x3da2('0x5c'),'GROUP_CONCAT':_0x3da2('0x5d'),'GROUP_CONCAT ASC':_0x3da2('0x5e'),'GROUP_CONCAT DESC':_0x3da2('0x5f')};var _0x30cc98={'SEC_TO_TIME':_0x3da2('0x60'),'DATE':_0x3da2('0x61'),'HOUR':_0x3da2('0x62'),'ROUND':_0x3da2('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x21df7d=function(_0x36fda6){return!_[_0x3da2('0x64')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x3da2('0x65'),'IS\x20NOT\x20EMPTY'],_0x36fda6);};var _0x36dbe5=function(_0x15fdf2){if(!_0x15fdf2||!_0x15fdf2[_0x3da2('0x66')][_0x3da2('0x37')]){return'';}for(var _0x302786='(',_0x53f99b=0x0;_0x53f99b<_0x15fdf2[_0x3da2('0x66')]['length'];_0x53f99b+=0x1){_0x53f99b>0x0&&(_0x302786+='\x20'+_0x15fdf2[_0x3da2('0x67')]+'\x20');_0x302786+=_0x15fdf2[_0x3da2('0x66')][_0x53f99b]['group']?_0x36dbe5(_0x15fdf2[_0x3da2('0x66')][_0x53f99b][_0x3da2('0x68')]):_0x15fdf2[_0x3da2('0x66')][_0x53f99b][_0x3da2('0x69')]+'\x20'+_0x15fdf2[_0x3da2('0x66')][_0x53f99b]['condition']+(_0x21df7d(_0x15fdf2[_0x3da2('0x66')][_0x53f99b][_0x3da2('0x6a')])?'\x20'+_0x15fdf2['rules'][_0x53f99b][_0x3da2('0x6b')]:'');}return _0x302786+')';};var _0x4dffb3={'where':{'id':_0x5df3fb[_0x3da2('0x53')]['id']}},_0xc83eaf,_0x46ae95,_0xbfff95,_0x6fc32b,_0x17298a;_0x4dffb3=_[_0x3da2('0x3e')]({},_0x4dffb3,_0x5df3fb['options']);return db[_0x3da2('0x2c')][_0x3da2('0x46')](_0x4dffb3)['then'](function(_0xbd1643){if(_0xbd1643){_0xc83eaf=_0xbd1643;return _0xbd1643['getFields']();}return null;})['then'](function(_0x390b17){if(_0x390b17){if(!_0x390b17['length']){throw new db['Sequelize'][(_0x3da2('0x6c'))](_0x3da2('0x6d'),0x193);}_0x46ae95=_0x390b17;return db[_0x3da2('0x6e')][_0x3da2('0x42')]({'raw':!![]});}return null;})[_0x3da2('0x22')](function(_0x59104a){if(_0x59104a){_0xbfff95=_[_0x3da2('0x6f')](_0x59104a,'id');var _0x415c1a;var _0x48325f=squel[_0x3da2('0x70')]();_0x48325f['from'](_0xc83eaf['table']);for(var _0x5616e3=0x0;_0x5616e3<_0x46ae95[_0x3da2('0x37')];_0x5616e3+=0x1){_0x415c1a=_0x46ae95[_0x5616e3][_0x3da2('0x71')]?_0xbfff95[_0x46ae95[_0x5616e3][_0x3da2('0x71')]]['metric']:_0x46ae95[_0x5616e3][_0x3da2('0x69')];_0x415c1a=_0x46ae95[_0x5616e3][_0x3da2('0x72')]?_[_0x3da2('0x73')](_0x3dc3ad[_0x46ae95[_0x5616e3][_0x3da2('0x72')]],'%s',_0x415c1a):_0x415c1a;_0x415c1a=_0x46ae95[_0x5616e3][_0x3da2('0x74')]?_['replace'](_0x30cc98[_0x46ae95[_0x5616e3][_0x3da2('0x74')]],'%s',_0x415c1a):_0x415c1a;if(_0x46ae95[_0x5616e3][_0x3da2('0x75')]){_0x48325f[_0x3da2('0x68')](_0x415c1a);}_0x46ae95[_0x5616e3][_0x3da2('0x76')]&&_0x48325f[_0x3da2('0x39')](_0x415c1a,_0x46ae95[_0x5616e3]['orderBy']===_0x3da2('0x77')?![]:!![]);_0x48325f[_0x3da2('0x69')](_0x415c1a,_0x46ae95[_0x5616e3][_0x3da2('0x78')]||_0x415c1a);}if(_0xc83eaf[_0x3da2('0x79')]){_0xc83eaf[_0x3da2('0x79')]=JSON['parse'](_0xc83eaf[_0x3da2('0x79')]);for(var _0x454ec2=0x0;_0x454ec2<_0xc83eaf[_0x3da2('0x79')]['length'];_0x454ec2+=0x1){if(_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x2e')]&&_[_0x3da2('0x64')](_0x67d5eb,_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x2e')])&&_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x7a')]&&_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x7b')]&&_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x7c')]){_0x48325f[_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x2e')]](_0xc83eaf[_0x3da2('0x79')][_0x454ec2]['foreignTable'],null,util[_0x3da2('0x74')](_0x3da2('0x7d'),_0xc83eaf[_0x3da2('0x7e')],_0xc83eaf[_0x3da2('0x79')][_0x454ec2]['parentKey'],_0xc83eaf[_0x3da2('0x79')][_0x454ec2][_0x3da2('0x7b')],_0xc83eaf[_0x3da2('0x79')][_0x454ec2]['foreignKey']));}}}if(_0xc83eaf['conditions']){_0xc83eaf['conditions']=JSON[_0x3da2('0x7f')](_0xc83eaf[_0x3da2('0x80')]);_0x48325f[_0x3da2('0x3b')](_0x36dbe5(_0xc83eaf[_0x3da2('0x80')]['group']));}_0x17298a=_0x48325f[_0x3da2('0x81')]();_0x48325f['limit'](_0x388afa);_0x48325f[_0x3da2('0x1c')](0x0);logger[_0x3da2('0x82')]('Limited\x20Query:',_0x48325f['toString']());return dbH['sequelize']['query'](_0x48325f[_0x3da2('0x83')](),{'type':dbH[_0x3da2('0x84')][_0x3da2('0x85')]['SELECT']});}})[_0x3da2('0x22')](respondWithResult(_0x37b0d8,null))['catch'](handleError(_0x37b0d8,null));};function runReport(_0x44f358,_0x4fcf50,_0x39e37b){var _0x89ff4b=_0x4fcf50['name'];var _0x34e8f6=0xa;var _0xa4c857=[_0x3da2('0x55'),_0x3da2('0x56'),_0x3da2('0x57'),_0x3da2('0x86')];var _0x59fa52={'SUM':_0x3da2('0x58'),'COUNT':_0x3da2('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3da2('0x5b'),'MIN':_0x3da2('0x87'),'AVG':_0x3da2('0x5c'),'GROUP_CONCAT':_0x3da2('0x5d'),'GROUP_CONCAT ASC':_0x3da2('0x5e'),'GROUP_CONCAT DESC':_0x3da2('0x5f')};var _0x2cb4e8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3da2('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3da2('0x88')};var _0x7f8821=function(_0x3a9e9f){return!_[_0x3da2('0x64')](['IS\x20NULL',_0x3da2('0x89'),_0x3da2('0x65'),'IS\x20NOT\x20EMPTY'],_0x3a9e9f);};var _0x30c794=function(_0x1db437){if(!_0x1db437||!_0x1db437[_0x3da2('0x66')]['length']){return'';}for(var _0x1f1994='(',_0x56d414=0x0;_0x56d414<_0x1db437[_0x3da2('0x66')][_0x3da2('0x37')];_0x56d414+=0x1){_0x56d414>0x0&&(_0x1f1994+='\x20'+_0x1db437[_0x3da2('0x67')]+'\x20');_0x1f1994+=_0x1db437['rules'][_0x56d414][_0x3da2('0x68')]?_0x30c794(_0x1db437[_0x3da2('0x66')][_0x56d414][_0x3da2('0x68')]):_0x1db437[_0x3da2('0x66')][_0x56d414][_0x3da2('0x69')]+'\x20'+_0x1db437['rules'][_0x56d414]['condition']+(_0x7f8821(_0x1db437['rules'][_0x56d414][_0x3da2('0x6a')])?'\x20'+_0x1db437[_0x3da2('0x66')][_0x56d414][_0x3da2('0x6b')]:'');}return _0x1f1994+')';};var _0x52d166={'where':{'id':_0x44f358['id']}},_0x402cdb,_0x215ed,_0x4a819f,_0x179486,_0x2ee379;_0x52d166=_[_0x3da2('0x3e')]({},_0x52d166,_0x39e37b);return db[_0x3da2('0x2c')][_0x3da2('0x46')](_0x52d166)[_0x3da2('0x22')](function(_0x388330){if(_0x388330){_0x402cdb=_0x388330;return _0x388330[_0x3da2('0x8a')]();}return null;})[_0x3da2('0x22')](function(_0x240587){if(_0x240587){if(!_0x240587[_0x3da2('0x37')]){throw new db[(_0x3da2('0x8b'))][(_0x3da2('0x6c'))](_0x3da2('0x6d'),0x193);}_0x215ed=_0x240587;return db[_0x3da2('0x6e')][_0x3da2('0x42')]({'raw':!![]});}return null;})[_0x3da2('0x22')](function(_0x35b373){if(_0x35b373){_0x4a819f=_[_0x3da2('0x6f')](_0x35b373,'id');var _0x14589f;var _0x21f23a=squel[_0x3da2('0x70')]();_0x21f23a['from'](_0x402cdb[_0x3da2('0x7e')]);for(var _0xd3332d=0x0;_0xd3332d<_0x215ed[_0x3da2('0x37')];_0xd3332d+=0x1){_0x14589f=_0x215ed[_0xd3332d][_0x3da2('0x71')]?_0x4a819f[_0x215ed[_0xd3332d][_0x3da2('0x71')]][_0x3da2('0x8c')]:_0x215ed[_0xd3332d]['field'];_0x14589f=_0x215ed[_0xd3332d][_0x3da2('0x72')]?_['replace'](_0x59fa52[_0x215ed[_0xd3332d][_0x3da2('0x72')]],'%s',_0x14589f):_0x14589f;_0x14589f=_0x215ed[_0xd3332d]['format']?_[_0x3da2('0x73')](_0x2cb4e8[_0x215ed[_0xd3332d][_0x3da2('0x74')]],'%s',_0x14589f):_0x14589f;if(_0x215ed[_0xd3332d]['groupBy']){_0x21f23a['group'](_0x14589f);}_0x215ed[_0xd3332d][_0x3da2('0x76')]&&_0x21f23a[_0x3da2('0x39')](_0x14589f,_0x215ed[_0xd3332d][_0x3da2('0x76')]==='DESC'?![]:!![]);_0x21f23a[_0x3da2('0x69')](_0x14589f,_0x215ed[_0xd3332d][_0x3da2('0x78')]||_0x14589f);}if(_0x402cdb[_0x3da2('0x79')]){_0x402cdb[_0x3da2('0x79')]=JSON['parse'](_0x402cdb['joins']);for(var _0x4cc605=0x0;_0x4cc605<_0x402cdb['joins']['length'];_0x4cc605+=0x1){if(_0x402cdb['joins'][_0x4cc605][_0x3da2('0x2e')]&&_['includes'](_0xa4c857,_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x2e')])&&_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7a')]&&_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7b')]&&_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7c')]){_0x21f23a[_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x2e')]](_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7b')],null,util[_0x3da2('0x74')](_0x3da2('0x7d'),_0x402cdb[_0x3da2('0x7e')],_0x402cdb['joins'][_0x4cc605][_0x3da2('0x7a')],_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7b')],_0x402cdb[_0x3da2('0x79')][_0x4cc605][_0x3da2('0x7c')]));}}}if(_0x402cdb['conditions']){_0x402cdb['conditions']=JSON[_0x3da2('0x7f')](_0x402cdb[_0x3da2('0x80')]);_0x21f23a[_0x3da2('0x3b')](_0x30c794(_0x402cdb[_0x3da2('0x80')]['group']));}_0x2ee379=_0x21f23a[_0x3da2('0x81')]();_0x21f23a[_0x3da2('0x1b')](_0x34e8f6);_0x21f23a[_0x3da2('0x1c')](0x0);return;}})['then'](function(){if(_0x4fcf50['output']===_0x3da2('0x8d')){return null;}var _0x47f465=_['merge'](_0x4fcf50,{'name':_0x4fcf50[_0x3da2('0x8e')]||_0x4fcf50[_0x3da2('0x2a')]||_0x402cdb['name'],'basename':_0x89ff4b,'savename':util['format']('%s-%s.%s',_0x4fcf50[_0x3da2('0x2a')]||_0x402cdb['name'],require(_0x3da2('0x8f'))[_0x3da2('0x90')](0x4),_0x4fcf50['output']||_0x3da2('0x91')),'reportId':_0x402cdb['id'],'reportType':_0x3da2('0x92')});return db[_0x3da2('0x93')][_0x3da2('0x48')](_0x47f465,{'raw':!![]});})[_0x3da2('0x22')](function(_0x2ee708){if(_0x402cdb[_0x3da2('0x7e')]===_0x3da2('0x94')){_0x2ee379['where'](_0x402cdb[_0x3da2('0x7e')]+_0x3da2('0x95'),_0x4fcf50[_0x3da2('0x96')],_0x4fcf50[_0x3da2('0x97')]);}else{_0x2ee379[_0x3da2('0x3b')](_0x402cdb[_0x3da2('0x7e')]+_0x3da2('0x98'),_0x4fcf50[_0x3da2('0x96')],_0x4fcf50[_0x3da2('0x97')]);}if(_0x2ee708){logger[_0x3da2('0x99')](_0x3da2('0x9a'),_0x2ee379[_0x3da2('0x83')]());require('child_process')['fork'](path['join'](__dirname,_0x3da2('0x9b'),_0x2ee708[_0x3da2('0x9c')]),[_0x2ee708['id'],_0x2ee379[_0x3da2('0x83')](),path[_0x3da2('0x55')](__dirname,_0x3da2('0x9d'),_0x2ee708[_0x3da2('0x9e')]),_0x89ff4b]);return _0x2ee708;}else{var _0x56ec06=squel[_0x3da2('0x70')]();_0x56ec06[_0x3da2('0x9f')]('('+_0x2ee379[_0x3da2('0x83')]()+')',_0x3da2('0xa0'));_0x56ec06[_0x3da2('0x69')]('COUNT(*)','count');_0x2ee379['limit'](_0x4fcf50[_0x3da2('0x1b')]||_0x34e8f6);_0x2ee379['offset'](_0x4fcf50[_0x3da2('0x1c')]||0x0);return dbH[_0x3da2('0x84')]['query'](_0x56ec06[_0x3da2('0x83')](),{'type':dbH[_0x3da2('0x84')][_0x3da2('0x85')][_0x3da2('0xa1')]})[_0x3da2('0x22')](function(_0x2b9900){if(!_0x2b9900['length']){_0x179486=0x0;}else{_0x179486=_0x2b9900[0x0][_0x3da2('0x1d')]||0x0;}return dbH[_0x3da2('0x84')][_0x3da2('0x31')](_0x2ee379[_0x3da2('0x83')](),{'type':dbH[_0x3da2('0x84')]['QueryTypes'][_0x3da2('0xa1')]});})[_0x3da2('0x22')](function(_0x4ceab3){return{'rows':_0x4ceab3||[],'count':_0x179486};});}});}exports[_0x3da2('0xa2')]=function(_0x461e9d,_0x288860){return runReport(_0x461e9d['params'],_0x461e9d[_0x3da2('0x31')],_0x461e9d[_0x3da2('0x40')])['then'](respondWithResult(_0x288860,null))['catch'](handleError(_0x288860,null));};exports[_0x3da2('0xa3')]=runReport;exports[_0x3da2('0x31')]=function(_0x1cb91d,_0x23f72d){var _0x1fe31e=0xa;var _0x2f2166=[_0x3da2('0x55'),_0x3da2('0x56'),'right_join',_0x3da2('0x86')];var _0x3d7134={'SUM':_0x3da2('0x58'),'COUNT':_0x3da2('0x59'),'COUNT DISTINCT':_0x3da2('0x5a'),'MAX':'MAX(%s)','MIN':_0x3da2('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3da2('0x5d'),'GROUP_CONCAT ASC':_0x3da2('0x5e'),'GROUP_CONCAT DESC':_0x3da2('0x5f')};var _0x2f0155={'SEC_TO_TIME':_0x3da2('0x60'),'DATE':_0x3da2('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x3da2('0x63'),'UNIX_TIMESTAMP':_0x3da2('0x88')};var _0x21403f=function(_0x1384bc){return!_['includes']([_0x3da2('0xa4'),_0x3da2('0x89'),'IS\x20EMPTY',_0x3da2('0xa5')],_0x1384bc);};var _0x461d4d=function(_0x26b671){if(!_0x26b671||!_0x26b671[_0x3da2('0x66')][_0x3da2('0x37')]){return'';}for(var _0x52a06f='(',_0x451365=0x0;_0x451365<_0x26b671[_0x3da2('0x66')][_0x3da2('0x37')];_0x451365+=0x1){_0x451365>0x0&&(_0x52a06f+='\x20'+_0x26b671['operator']+'\x20');_0x52a06f+=_0x26b671[_0x3da2('0x66')][_0x451365][_0x3da2('0x68')]?_0x461d4d(_0x26b671[_0x3da2('0x66')][_0x451365][_0x3da2('0x68')]):_0x26b671[_0x3da2('0x66')][_0x451365]['field']+'\x20'+_0x26b671['rules'][_0x451365]['condition']+(_0x21403f(_0x26b671[_0x3da2('0x66')][_0x451365][_0x3da2('0x6a')])?'\x20'+_0x26b671[_0x3da2('0x66')][_0x451365]['value']:'');}return _0x52a06f+')';};var _0xfd6c38={'where':{'id':_0x1cb91d[_0x3da2('0x53')]['id']}},_0x4ad3af,_0x3822c9,_0x4706f7,_0x30eb5b,_0x56c3ff;_0xfd6c38=_[_0x3da2('0x3e')]({},_0xfd6c38,_0x1cb91d[_0x3da2('0x40')]);return db['AnalyticCustomReport'][_0x3da2('0x46')](_0xfd6c38)[_0x3da2('0x22')](function(_0x7e4aaf){if(_0x7e4aaf){_0x4ad3af=_0x7e4aaf;return _0x7e4aaf[_0x3da2('0x8a')]();}return null;})['then'](function(_0x2355cd){if(_0x2355cd){if(!_0x2355cd['length']){throw new db[(_0x3da2('0x8b'))][(_0x3da2('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3822c9=_0x2355cd;return db[_0x3da2('0x6e')][_0x3da2('0x42')]({'raw':!![]});}return null;})[_0x3da2('0x22')](function(_0x2a189b){if(_0x2a189b){_0x4706f7=_[_0x3da2('0x6f')](_0x2a189b,'id');var _0x5823e7;var _0x477ea3=squel['select']();_0x477ea3[_0x3da2('0x9f')](_0x4ad3af[_0x3da2('0x7e')]);for(var _0x352e69=0x0;_0x352e69<_0x3822c9['length'];_0x352e69+=0x1){_0x5823e7=_0x3822c9[_0x352e69][_0x3da2('0x71')]?_0x4706f7[_0x3822c9[_0x352e69]['MetricId']][_0x3da2('0x8c')]:_0x3822c9[_0x352e69][_0x3da2('0x69')];_0x5823e7=_0x3822c9[_0x352e69][_0x3da2('0x72')]?_[_0x3da2('0x73')](_0x3d7134[_0x3822c9[_0x352e69][_0x3da2('0x72')]],'%s',_0x5823e7):_0x5823e7;_0x5823e7=_0x3822c9[_0x352e69]['format']?_[_0x3da2('0x73')](_0x2f0155[_0x3822c9[_0x352e69][_0x3da2('0x74')]],'%s',_0x5823e7):_0x5823e7;if(_0x3822c9[_0x352e69][_0x3da2('0x75')]){_0x477ea3['group'](_0x5823e7);}_0x3822c9[_0x352e69][_0x3da2('0x76')]&&_0x477ea3[_0x3da2('0x39')](_0x5823e7,_0x3822c9[_0x352e69]['orderBy']==='DESC'?![]:!![]);_0x477ea3['field'](_0x5823e7,_0x3822c9[_0x352e69]['alias']||_0x5823e7);}if(_0x4ad3af['joins']){_0x4ad3af[_0x3da2('0x79')]=JSON[_0x3da2('0x7f')](_0x4ad3af[_0x3da2('0x79')]);for(var _0x450d4e=0x0;_0x450d4e<_0x4ad3af[_0x3da2('0x79')][_0x3da2('0x37')];_0x450d4e+=0x1){if(_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x2e')]&&_['includes'](_0x2f2166,_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x2e')])&&_0x4ad3af['joins'][_0x450d4e][_0x3da2('0x7a')]&&_0x4ad3af[_0x3da2('0x79')][_0x450d4e]['foreignTable']&&_0x4ad3af['joins'][_0x450d4e]['foreignKey']){_0x477ea3[_0x4ad3af[_0x3da2('0x79')][_0x450d4e]['type']](_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x7b')],null,util[_0x3da2('0x74')]('%s.%s\x20=\x20%s.%s',_0x4ad3af[_0x3da2('0x7e')],_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x7a')],_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x7b')],_0x4ad3af[_0x3da2('0x79')][_0x450d4e][_0x3da2('0x7c')]));}}}if(_0x4ad3af[_0x3da2('0x80')]){_0x4ad3af['conditions']=JSON[_0x3da2('0x7f')](_0x4ad3af[_0x3da2('0x80')]);_0x477ea3[_0x3da2('0x3b')](_0x461d4d(_0x4ad3af[_0x3da2('0x80')]['group']));}_0x56c3ff=_0x477ea3['clone']();_0x477ea3[_0x3da2('0x1b')](_0x1fe31e);_0x477ea3['offset'](0x0);logger[_0x3da2('0x82')](_0x3da2('0xa6'),_0x477ea3[_0x3da2('0x83')]());return dbH[_0x3da2('0x84')][_0x3da2('0x31')](_0x477ea3[_0x3da2('0x83')](),{'type':dbH[_0x3da2('0x84')]['QueryTypes'][_0x3da2('0xa1')]});}})[_0x3da2('0x22')](function(){return{'sql':_0x56c3ff[_0x3da2('0x83')]()};})[_0x3da2('0x22')](respondWithResult(_0x23f72d,null))['catch'](handleError(_0x23f72d,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index a0660b7..2993a0b 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 _0x3ff8=['bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x4ace88,_0x6eebc6){var _0x578723=function(_0x1a2772){while(--_0x1a2772){_0x4ace88['push'](_0x4ace88['shift']());}};_0x578723(++_0x6eebc6);}(_0x3ff8,0x194));var _0x83ff=function(_0x3d3d96,_0x28998e){_0x3d3d96=_0x3d3d96-0x0;var _0x2e479a=_0x3ff8[_0x3d3d96];return _0x2e479a;};'use strict';var _=require(_0x83ff('0x0'));var util=require(_0x83ff('0x1'));var logger=require(_0x83ff('0x2'))('api');var moment=require('moment');var BPromise=require(_0x83ff('0x3'));var rp=require(_0x83ff('0x4'));var fs=require('fs');var path=require(_0x83ff('0x5'));var rimraf=require(_0x83ff('0x6'));var config=require('../../config/environment');var attributes=require(_0x83ff('0x7'));module[_0x83ff('0x8')]=function(_0x4c6fa3,_0x15f06c){return _0x4c6fa3[_0x83ff('0x9')](_0x83ff('0xa'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa29d=['../../config/environment','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0xa29d,0xa0));var _0xda29=function(_0x5bf115,_0x38d85d){_0x5bf115=_0x5bf115-0x0;var _0x1735e6=_0xa29d[_0x5bf115];return _0x1735e6;};'use strict';var _=require(_0xda29('0x0'));var util=require(_0xda29('0x1'));var logger=require(_0xda29('0x2'))(_0xda29('0x3'));var moment=require('moment');var BPromise=require(_0xda29('0x4'));var rp=require(_0xda29('0x5'));var fs=require('fs');var path=require(_0xda29('0x6'));var rimraf=require(_0xda29('0x7'));var config=require(_0xda29('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xda29('0x9')]=function(_0x5bbde8,_0x4ba106){return _0x5bbde8[_0xda29('0xa')](_0xda29('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 1aeb934..7cdc5dc 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 _0x59a1=['../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','AnalyticCustomReport,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x10b762,_0x49d960){var _0x4776a4=function(_0x21bf9e){while(--_0x21bf9e){_0x10b762['push'](_0x10b762['shift']());}};_0x4776a4(++_0x49d960);}(_0x59a1,0x8e));var _0x159a=function(_0x514085,_0x4467f3){_0x514085=_0x514085-0x0;var _0x4576a7=_0x59a1[_0x514085];return _0x4576a7;};'use strict';var _=require(_0x159a('0x0'));var util=require(_0x159a('0x1'));var moment=require('moment');var BPromise=require(_0x159a('0x2'));var rs=require(_0x159a('0x3'));var fs=require('fs');var Redis=require(_0x159a('0x4'));var db=require(_0x159a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x159a('0x6'))(_0x159a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x159a('0x8')][_0x159a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x521f1e,_0xef42a3,_0x59e678){return new BPromise(function(_0x17a411,_0x124dbd){return client[_0x159a('0xa')](_0x521f1e,_0x59e678)[_0x159a('0xb')](function(_0x163e29){logger[_0x159a('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0xef42a3,_0x159a('0xd'));logger[_0x159a('0xe')](_0x159a('0xf'),_0xef42a3,_0x159a('0xd'),JSON[_0x159a('0x10')](_0x163e29));if(_0x163e29[_0x159a('0x11')]){if(_0x163e29[_0x159a('0x11')]['code']===0x1f4){logger[_0x159a('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0xef42a3,_0x163e29['error'][_0x159a('0x12')]);return _0x124dbd(_0x163e29[_0x159a('0x11')][_0x159a('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xef42a3,_0x163e29['error'][_0x159a('0x12')]);return _0x17a411(_0x163e29[_0x159a('0x11')][_0x159a('0x12')]);}else{logger[_0x159a('0xc')](_0x159a('0x13'),_0xef42a3,_0x159a('0xd'));_0x17a411(_0x163e29['result']['message']);}})[_0x159a('0x14')](function(_0x40ed44){logger[_0x159a('0x11')](_0x159a('0x13'),_0xef42a3,_0x40ed44);_0x124dbd(_0x40ed44);});});} \ No newline at end of file +var _0x492f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','lodash','moment'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x492f,0x13e));var _0xf492=function(_0x4ae616,_0x3dac8){_0x4ae616=_0x4ae616-0x0;var _0x36bc6f=_0x492f[_0x4ae616];return _0x36bc6f;};'use strict';var _=require(_0xf492('0x0'));var util=require('util');var moment=require(_0xf492('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf492('0x2'));var db=require(_0xf492('0x3'))['db'];var utils=require(_0xf492('0x4'));var logger=require(_0xf492('0x5'))('rpc');var config=require(_0xf492('0x6'));var jayson=require(_0xf492('0x7'));var client=jayson[_0xf492('0x8')][_0xf492('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x560019,_0xf500a2,_0x4e991a){return new BPromise(function(_0x711f96,_0x2d131d){return client['request'](_0x560019,_0x4e991a)[_0xf492('0xa')](function(_0x2150c8){logger['info'](_0xf492('0xb'),_0xf500a2,'request\x20sent');logger[_0xf492('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xf500a2,'request\x20sent',JSON[_0xf492('0xd')](_0x2150c8));if(_0x2150c8[_0xf492('0xe')]){if(_0x2150c8[_0xf492('0xe')][_0xf492('0xf')]===0x1f4){logger[_0xf492('0xe')](_0xf492('0xb'),_0xf500a2,_0x2150c8[_0xf492('0xe')]['message']);return _0x2d131d(_0x2150c8[_0xf492('0xe')]['message']);}logger[_0xf492('0xe')](_0xf492('0xb'),_0xf500a2,_0x2150c8['error'][_0xf492('0x10')]);return _0x711f96(_0x2150c8[_0xf492('0xe')][_0xf492('0x10')]);}else{logger[_0xf492('0x11')](_0xf492('0xb'),_0xf500a2,_0xf492('0x12'));_0x711f96(_0x2150c8[_0xf492('0x13')][_0xf492('0x10')]);}})['catch'](function(_0x24404f){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xf500a2,_0x24404f);_0x2d131d(_0x24404f);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 9c152a8..8cc4850 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 _0x8b4e=['get','/:id','show','/:id/run','run','query','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0xc2eb73,_0x5dd08f){var _0x5d090f=function(_0x2373a3){while(--_0x2373a3){_0xc2eb73['push'](_0xc2eb73['shift']());}};_0x5d090f(++_0x5dd08f);}(_0x8b4e,0x109));var _0xe8b4=function(_0x2e092b,_0x3010d7){_0x2e092b=_0x2e092b-0x0;var _0x570bd9=_0x8b4e[_0x2e092b];return _0x570bd9;};'use strict';var multer=require(_0xe8b4('0x0'));var util=require(_0xe8b4('0x1'));var path=require(_0xe8b4('0x2'));var timeout=require(_0xe8b4('0x3'));var express=require(_0xe8b4('0x4'));var router=express[_0xe8b4('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe8b4('0x6'));var interaction=require(_0xe8b4('0x7'));var config=require(_0xe8b4('0x8'));var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xe8b4('0x9')](),controller[_0xe8b4('0xa')]);router[_0xe8b4('0xb')](_0xe8b4('0xc'),auth[_0xe8b4('0x9')](),controller[_0xe8b4('0xd')]);router[_0xe8b4('0xb')]('/:id/preview',auth[_0xe8b4('0x9')](),controller['preview']);router[_0xe8b4('0xb')](_0xe8b4('0xe'),auth[_0xe8b4('0x9')](),controller[_0xe8b4('0xf')]);router[_0xe8b4('0xb')]('/:id/query',auth[_0xe8b4('0x9')](),controller[_0xe8b4('0x10')]);router[_0xe8b4('0x11')]('/',auth[_0xe8b4('0x9')](),controller['create']);router[_0xe8b4('0x12')](_0xe8b4('0xc'),auth[_0xe8b4('0x9')](),controller[_0xe8b4('0x13')]);router[_0xe8b4('0x14')](_0xe8b4('0xc'),auth[_0xe8b4('0x9')](),controller[_0xe8b4('0x15')]);module[_0xe8b4('0x16')]=router; \ No newline at end of file +var _0xceef=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','/:id/run','run','query','create','put','update','exports','multer','util','connect-timeout'];(function(_0x2ad127,_0x192754){var _0xe51768=function(_0xacb60c){while(--_0xacb60c){_0x2ad127['push'](_0x2ad127['shift']());}};_0xe51768(++_0x192754);}(_0xceef,0x189));var _0xfcee=function(_0x25fded,_0x34216e){_0x25fded=_0x25fded-0x0;var _0x269156=_0xceef[_0x25fded];return _0x269156;};'use strict';var multer=require(_0xfcee('0x0'));var util=require(_0xfcee('0x1'));var path=require('path');var timeout=require(_0xfcee('0x2'));var express=require(_0xfcee('0x3'));var router=express[_0xfcee('0x4')]();var fs_extra=require(_0xfcee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfcee('0x6'));var config=require(_0xfcee('0x7'));var controller=require(_0xfcee('0x8'));router[_0xfcee('0x9')]('/',auth[_0xfcee('0xa')](),controller[_0xfcee('0xb')]);router[_0xfcee('0x9')](_0xfcee('0xc'),auth['isAuthenticated'](),controller[_0xfcee('0xd')]);router[_0xfcee('0x9')]('/:id/preview',auth[_0xfcee('0xa')](),controller[_0xfcee('0xe')]);router[_0xfcee('0x9')](_0xfcee('0xf'),auth[_0xfcee('0xa')](),controller[_0xfcee('0x10')]);router[_0xfcee('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xfcee('0x11')]);router['post']('/',auth[_0xfcee('0xa')](),controller[_0xfcee('0x12')]);router[_0xfcee('0x13')](_0xfcee('0xc'),auth[_0xfcee('0xa')](),controller[_0xfcee('0x14')]);router['delete'](_0xfcee('0xc'),auth[_0xfcee('0xa')](),controller['destroy']);module[_0xfcee('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7a43361..7d288e4 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0xd56af9,_0x28270d){var _0x5f0b6f=function(_0x178212){while(--_0x178212){_0xd56af9['push'](_0xd56af9['shift']());}};_0x5f0b6f(++_0x28270d);}(_0xac9d,0x14d));var _0xdac9=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xac9d[_0x29e3ec];return _0x25727e;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0xb138=['TEXT','sequelize','exports','STRING'];(function(_0x107910,_0x14a33d){var _0x279b6f=function(_0x2819dd){while(--_0x2819dd){_0x107910['push'](_0x107910['shift']());}};_0x279b6f(++_0x14a33d);}(_0xb138,0x1dd));var _0x8b13=function(_0xb1937e,_0x330b2f){_0xb1937e=_0xb1937e-0x0;var _0x44474f=_0xb138[_0xb1937e];return _0x44474f;};'use strict';var Sequelize=require(_0x8b13('0x0'));module[_0x8b13('0x1')]={'name':{'type':Sequelize[_0x8b13('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8b13('0x2')]},'parent':{'type':Sequelize[_0x8b13('0x2')]},'table':{'type':Sequelize[_0x8b13('0x2')]},'conditions':{'type':Sequelize[_0x8b13('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4eea9ff..41daa6d 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 _0xba34=['save','then','destroy','get','DefaultReports','UserProfileResource','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','COUNT(%s)','AVG(%s)','IS\x20NOT\x20NULL','value','order','output','%s-%s.%s','randomstring','generate','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','fork','countTable','QueryTypes','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject'];(function(_0x37878c,_0x595f2b){var _0x5e7e1e=function(_0x543a5c){while(--_0x543a5c){_0x37878c['push'](_0x37878c['shift']());}};_0x5e7e1e(++_0x595f2b);}(_0xba34,0x119));var _0x4ba3=function(_0x10d9a8,_0x5fdf8f){_0x10d9a8=_0x10d9a8-0x0;var _0x2712de=_0xba34[_0x10d9a8];return _0x2712de;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4ba3('0x19'))['dbH'];function respondWithStatusCode(_0x256f02,_0x4419b4){_0x4419b4=_0x4419b4||0xcc;return function(_0x29e498){if(_0x29e498){return _0x256f02[_0x4ba3('0x1a')](_0x4419b4);}return _0x256f02[_0x4ba3('0x1b')](_0x4419b4)[_0x4ba3('0x1c')]();};}function respondWithResult(_0x3a74f7,_0x12ac90){_0x12ac90=_0x12ac90||0xc8;return function(_0x1dec48){if(_0x1dec48){return _0x3a74f7[_0x4ba3('0x1b')](_0x12ac90)[_0x4ba3('0x1d')](_0x1dec48);}};}function respondWithFilteredResult(_0x301359,_0x29a9d1){return function(_0x25f584){if(_0x25f584){var _0x40e75b=typeof _0x29a9d1[_0x4ba3('0x1e')]==='undefined'&&typeof _0x29a9d1[_0x4ba3('0x1f')]===_0x4ba3('0x20');var _0x5ff7ce=_0x25f584[_0x4ba3('0x21')];var _0x556290=_0x40e75b?0x0:_0x29a9d1[_0x4ba3('0x1e')];var _0xe4eff9=_0x40e75b?_0x25f584[_0x4ba3('0x21')]:_0x29a9d1[_0x4ba3('0x1e')]+_0x29a9d1[_0x4ba3('0x1f')];var _0x125944;if(_0xe4eff9>=_0x5ff7ce){_0xe4eff9=_0x5ff7ce;_0x125944=0xc8;}else{_0x125944=0xce;}_0x301359['status'](_0x125944);return _0x301359['set'](_0x4ba3('0x22'),_0x556290+'-'+_0xe4eff9+'/'+_0x5ff7ce)['json'](_0x25f584);}return null;};}function patchUpdates(_0x18dff5){return function(_0x163967){try{jsonpatch[_0x4ba3('0x23')](_0x163967,_0x18dff5,!![]);}catch(_0xbc7023){return BPromise[_0x4ba3('0x24')](_0xbc7023);}return _0x163967[_0x4ba3('0x25')]();};}function saveUpdates(_0x4a0823,_0x143c78){return function(_0x1f87e1){if(_0x1f87e1){return _0x1f87e1['update'](_0x4a0823)[_0x4ba3('0x26')](function(_0x4ffe39){return _0x4ffe39;});}return null;};}function removeEntity(_0x1ae4de,_0x18abb3){return function(_0x11a917){if(_0x11a917){return _0x11a917[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){var _0xe29a49=_0x11a917[_0x4ba3('0x28')]({'plain':!![]});var _0xe1f7d2=_0x4ba3('0x29');return db[_0x4ba3('0x2a')]['destroy']({'where':{'type':_0xe1f7d2,'resourceId':_0xe29a49['id']}})[_0x4ba3('0x26')](function(){return _0x11a917;});})[_0x4ba3('0x26')](function(){_0x1ae4de[_0x4ba3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10537e,_0x1fe5e2){return function(_0x44d78c){if(!_0x44d78c){_0x10537e['sendStatus'](0x194);}return _0x44d78c;};}function handleError(_0x10cae6,_0x843276){_0x843276=_0x843276||0x1f4;return function(_0x34ecb4){logger[_0x4ba3('0x2b')](_0x34ecb4['stack']);if(_0x34ecb4['name']){delete _0x34ecb4[_0x4ba3('0x2c')];}_0x10cae6[_0x4ba3('0x1b')](_0x843276)[_0x4ba3('0x2d')](_0x34ecb4);};}exports[_0x4ba3('0x2e')]=function(_0x2cb5d5,_0x11f88f){var _0x48b3b7={},_0x27444b={},_0x28f36c={'count':0x0,'rows':[]};var _0x24d8fc=_[_0x4ba3('0x2f')](db[_0x4ba3('0x30')][_0x4ba3('0x31')],function(_0x457236){return{'name':_0x457236[_0x4ba3('0x32')],'type':_0x457236[_0x4ba3('0x33')][_0x4ba3('0x34')]};});_0x27444b['model']=_['map'](_0x24d8fc,'name');_0x27444b[_0x4ba3('0x35')]=_[_0x4ba3('0x36')](_0x2cb5d5[_0x4ba3('0x35')]);_0x27444b[_0x4ba3('0x37')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],_0x27444b[_0x4ba3('0x35')]);_0x48b3b7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x27444b[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x2cb5d5[_0x4ba3('0x35')]['fields']));_0x48b3b7[_0x4ba3('0x3a')]=_0x48b3b7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x48b3b7['attributes']:_0x27444b[_0x4ba3('0x39')];if(!_0x2cb5d5['query'][_0x4ba3('0x3d')](_0x4ba3('0x3e'))){_0x48b3b7[_0x4ba3('0x1f')]=qs[_0x4ba3('0x1f')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1f')]);_0x48b3b7['offset']=qs[_0x4ba3('0x1e')](_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x1e')]);}_0x48b3b7['order']=qs[_0x4ba3('0x3f')](_0x2cb5d5[_0x4ba3('0x35')]['sort']);_0x48b3b7[_0x4ba3('0x40')]=qs['filters'](_['pick'](_0x2cb5d5[_0x4ba3('0x35')],_0x27444b[_0x4ba3('0x37')]),_0x24d8fc);if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x41')]){_0x48b3b7[_0x4ba3('0x40')]=_['merge'](_0x48b3b7[_0x4ba3('0x40')],{'$or':_[_0x4ba3('0x2f')](_0x24d8fc,function(_0x46d2ca){if(_0x46d2ca[_0x4ba3('0x33')]!==_0x4ba3('0x42')){var _0x2acc92={};_0x2acc92[_0x46d2ca[_0x4ba3('0x2c')]]={'$like':'%'+_0x2cb5d5[_0x4ba3('0x35')]['filter']+'%'};return _0x2acc92;}})});}_0x48b3b7=_[_0x4ba3('0x43')]({},_0x48b3b7,_0x2cb5d5[_0x4ba3('0x44')]);var _0x3cb07f={'where':_0x48b3b7[_0x4ba3('0x40')]};return db[_0x4ba3('0x30')][_0x4ba3('0x21')](_0x3cb07f)[_0x4ba3('0x26')](function(_0xdcc2a2){_0x28f36c[_0x4ba3('0x21')]=_0xdcc2a2;if(_0x2cb5d5[_0x4ba3('0x35')][_0x4ba3('0x45')]){_0x48b3b7[_0x4ba3('0x46')]=[{'all':!![]}];}return db[_0x4ba3('0x30')][_0x4ba3('0x47')](_0x48b3b7);})['then'](function(_0x5af671){_0x28f36c['rows']=_0x5af671;return _0x28f36c;})['then'](respondWithFilteredResult(_0x11f88f,_0x48b3b7))['catch'](handleError(_0x11f88f,null));};exports[_0x4ba3('0x48')]=function(_0x5c4659,_0x29e74d){var _0x5567c7={'raw':!![],'where':{'id':_0x5c4659[_0x4ba3('0x49')]['id']}},_0x53d6eb={};_0x53d6eb[_0x4ba3('0x39')]=_[_0x4ba3('0x36')](db[_0x4ba3('0x30')]['rawAttributes']);_0x53d6eb[_0x4ba3('0x35')]=_['keys'](_0x5c4659[_0x4ba3('0x35')]);_0x53d6eb['filters']=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],_0x53d6eb[_0x4ba3('0x35')]);_0x5567c7[_0x4ba3('0x3a')]=_[_0x4ba3('0x38')](_0x53d6eb[_0x4ba3('0x39')],qs[_0x4ba3('0x3b')](_0x5c4659['query'][_0x4ba3('0x3b')]));_0x5567c7[_0x4ba3('0x3a')]=_0x5567c7[_0x4ba3('0x3a')][_0x4ba3('0x3c')]?_0x5567c7[_0x4ba3('0x3a')]:_0x53d6eb['model'];if(_0x5c4659['query'][_0x4ba3('0x45')]){_0x5567c7[_0x4ba3('0x46')]=[{'all':!![]}];}_0x5567c7=_[_0x4ba3('0x43')]({},_0x5567c7,_0x5c4659['options']);return db[_0x4ba3('0x30')][_0x4ba3('0x4a')](_0x5567c7)[_0x4ba3('0x26')](handleEntityNotFound(_0x29e74d,null))['then'](respondWithResult(_0x29e74d,null))['catch'](handleError(_0x29e74d,null));};exports[_0x4ba3('0x4b')]=function(_0x482a83,_0x439acf){return db[_0x4ba3('0x30')][_0x4ba3('0x4b')](_0x482a83[_0x4ba3('0x4c')],{})[_0x4ba3('0x26')](function(_0x213eb0){var _0x590739=_0x482a83[_0x4ba3('0x4d')][_0x4ba3('0x28')]({'plain':!![]});if(!_0x590739)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x590739[_0x4ba3('0x4e')]===_0x4ba3('0x4d')){var _0x156c2d=_0x213eb0[_0x4ba3('0x28')]({'plain':!![]});var _0x360472='Reports';return db[_0x4ba3('0x4f')][_0x4ba3('0x4a')]({'where':{'name':_0x360472,'userProfileId':_0x590739['userProfileId']},'raw':!![]})[_0x4ba3('0x26')](function(_0x19d70f){if(_0x19d70f&&_0x19d70f[_0x4ba3('0x50')]===0x0){return db[_0x4ba3('0x2a')][_0x4ba3('0x4b')]({'name':_0x156c2d[_0x4ba3('0x2c')],'resourceId':_0x156c2d['id'],'type':_0x4ba3('0x29'),'sectionId':_0x19d70f['id']},{})[_0x4ba3('0x26')](function(){return _0x213eb0;});}else{return _0x213eb0;}})[_0x4ba3('0x51')](function(_0x428a27){logger[_0x4ba3('0x2b')](_0x4ba3('0x52'),_0x428a27);throw _0x428a27;});}return _0x213eb0;})[_0x4ba3('0x26')](respondWithResult(_0x439acf,0xc9))[_0x4ba3('0x51')](handleError(_0x439acf,null));};exports[_0x4ba3('0x53')]=function(_0x48a3d4,_0x5e7ed5){if(_0x48a3d4['body']['id']){delete _0x48a3d4[_0x4ba3('0x4c')]['id'];}return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x48a3d4[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5e7ed5,null))['then'](saveUpdates(_0x48a3d4[_0x4ba3('0x4c')],null))[_0x4ba3('0x26')](respondWithResult(_0x5e7ed5,null))[_0x4ba3('0x51')](handleError(_0x5e7ed5,null));};exports[_0x4ba3('0x27')]=function(_0x5359d1,_0x1e83fb){return db[_0x4ba3('0x30')][_0x4ba3('0x4a')]({'where':{'id':_0x5359d1[_0x4ba3('0x49')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x1e83fb,null))[_0x4ba3('0x26')](removeEntity(_0x1e83fb,null))[_0x4ba3('0x51')](handleError(_0x1e83fb,null));};exports[_0x4ba3('0x54')]=function(_0x328314,_0x4fa64d){var _0x20c849=0xa;var _0x42bb4b=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x40827a={'SUM':_0x4ba3('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':_0x4ba3('0x5b'),'MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x4cc10a={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4ba3('0x62')};var _0xaef1b=function(_0x2a48fe){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),'IS\x20NOT\x20NULL',_0x4ba3('0x65'),_0x4ba3('0x66')],_0x2a48fe);};var _0x34cc21=function(_0x469ef0){if(!_0x469ef0||!_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')]){return'';}for(var _0x3fdf7f='(',_0x38699e=0x0;_0x38699e<_0x469ef0[_0x4ba3('0x67')][_0x4ba3('0x3c')];_0x38699e+=0x1){_0x38699e>0x0&&(_0x3fdf7f+='\x20'+_0x469ef0[_0x4ba3('0x68')]+'\x20');_0x3fdf7f+=_0x469ef0['rules'][_0x38699e][_0x4ba3('0x69')]?_0x34cc21(_0x469ef0[_0x4ba3('0x67')][_0x38699e]['group']):_0x469ef0['rules'][_0x38699e][_0x4ba3('0x6a')]+'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['condition']+(_0xaef1b(_0x469ef0[_0x4ba3('0x67')][_0x38699e][_0x4ba3('0x6b')])?'\x20'+_0x469ef0[_0x4ba3('0x67')][_0x38699e]['value']:'');}return _0x3fdf7f+')';};var _0x1f5815={'where':{'id':_0x328314['params']['id']}},_0x46224,_0x1af489,_0x11209b,_0x24a75a,_0x3a4838;_0x1f5815=_[_0x4ba3('0x43')]({},_0x1f5815,_0x328314[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x1f5815)[_0x4ba3('0x26')](function(_0x2f8bcc){if(_0x2f8bcc){_0x46224=_0x2f8bcc;return _0x2f8bcc[_0x4ba3('0x6c')]();}return null;})[_0x4ba3('0x26')](function(_0x21c8b1){if(_0x21c8b1){if(!_0x21c8b1[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1af489=_0x21c8b1;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})['then'](function(_0x13ee2c){if(_0x13ee2c){_0x11209b=_[_0x4ba3('0x6f')](_0x13ee2c,'id');var _0x442d66;var _0x5c7fc2=squel[_0x4ba3('0x70')]();_0x5c7fc2[_0x4ba3('0x71')](_0x46224[_0x4ba3('0x72')]);for(var _0x5baf26=0x0;_0x5baf26<_0x1af489[_0x4ba3('0x3c')];_0x5baf26+=0x1){_0x442d66=_0x1af489[_0x5baf26]['MetricId']?_0x11209b[_0x1af489[_0x5baf26][_0x4ba3('0x73')]][_0x4ba3('0x74')]:_0x1af489[_0x5baf26]['field'];_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x40827a[_0x1af489[_0x5baf26][_0x4ba3('0x75')]],'%s',_0x442d66):_0x442d66;_0x442d66=_0x1af489[_0x5baf26][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x4cc10a[_0x1af489[_0x5baf26][_0x4ba3('0x77')]],'%s',_0x442d66):_0x442d66;if(_0x1af489[_0x5baf26][_0x4ba3('0x78')]){_0x5c7fc2[_0x4ba3('0x69')](_0x442d66);}_0x1af489[_0x5baf26][_0x4ba3('0x79')]&&_0x5c7fc2['order'](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x5c7fc2[_0x4ba3('0x6a')](_0x442d66,_0x1af489[_0x5baf26][_0x4ba3('0x7b')]||_0x442d66);}if(_0x46224[_0x4ba3('0x7c')]){_0x46224[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x7c')]);for(var _0x365d94=0x0;_0x365d94<_0x46224[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x365d94+=0x1){if(_0x46224[_0x4ba3('0x7c')][_0x365d94]['type']&&_[_0x4ba3('0x63')](_0x42bb4b,_0x46224[_0x4ba3('0x7c')][_0x365d94]['type'])&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7e')]&&_0x46224['joins'][_0x365d94]['foreignTable']&&_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]){_0x5c7fc2[_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x33')]](_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x46224['table'],_0x46224[_0x4ba3('0x7c')][_0x365d94]['parentKey'],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x80')],_0x46224[_0x4ba3('0x7c')][_0x365d94][_0x4ba3('0x7f')]));}}}if(_0x46224[_0x4ba3('0x82')]){_0x46224[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x46224[_0x4ba3('0x82')]);_0x5c7fc2['where'](_0x34cc21(_0x46224[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x3a4838=_0x5c7fc2[_0x4ba3('0x83')]();_0x5c7fc2['limit'](_0x20c849);_0x5c7fc2[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x5c7fc2[_0x4ba3('0x86')]());return dbH[_0x4ba3('0x87')][_0x4ba3('0x35')](_0x5c7fc2[_0x4ba3('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x4ba3('0x88')]});}})['then'](respondWithResult(_0x4fa64d,null))[_0x4ba3('0x51')](handleError(_0x4fa64d,null));};function runReport(_0x15508f,_0x108679,_0x20f7db){var _0x5a3c63=_0x108679['name'];var _0x2d16e5=0xa;var _0x2b2132=['join',_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x1e8232={'SUM':_0x4ba3('0x59'),'COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':_0x4ba3('0x8a'),'GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4ba3('0x5e')};var _0x13dbc4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4ba3('0x60'),'HOUR':_0x4ba3('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5aa412=function(_0x4ec70e){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),_0x4ba3('0x65'),_0x4ba3('0x66')],_0x4ec70e);};var _0x333a97=function(_0x30d7a9){if(!_0x30d7a9||!_0x30d7a9['rules'][_0x4ba3('0x3c')]){return'';}for(var _0x4cd4a2='(',_0x31a725=0x0;_0x31a725<_0x30d7a9['rules'][_0x4ba3('0x3c')];_0x31a725+=0x1){_0x31a725>0x0&&(_0x4cd4a2+='\x20'+_0x30d7a9[_0x4ba3('0x68')]+'\x20');_0x4cd4a2+=_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x69')]?_0x333a97(_0x30d7a9[_0x4ba3('0x67')][_0x31a725]['group']):_0x30d7a9['rules'][_0x31a725][_0x4ba3('0x6a')]+'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')]+(_0x5aa412(_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x6b')])?'\x20'+_0x30d7a9[_0x4ba3('0x67')][_0x31a725][_0x4ba3('0x8c')]:'');}return _0x4cd4a2+')';};var _0x3d8606={'where':{'id':_0x15508f['id']}},_0x2d00e3,_0x35441e,_0x217ea4,_0x40dcee,_0x5ea9d0;_0x3d8606=_[_0x4ba3('0x43')]({},_0x3d8606,_0x20f7db);return db['AnalyticDefaultReport'][_0x4ba3('0x4a')](_0x3d8606)[_0x4ba3('0x26')](function(_0x17b970){if(_0x17b970){_0x2d00e3=_0x17b970;return _0x17b970[_0x4ba3('0x6c')]();}return null;})['then'](function(_0x2a2dc2){if(_0x2a2dc2){if(!_0x2a2dc2[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x35441e=_0x2a2dc2;return db['AnalyticMetric'][_0x4ba3('0x47')]({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0x3188c8){if(_0x3188c8){_0x217ea4=_['keyBy'](_0x3188c8,'id');var _0x2f793a;var _0x1194a5=squel[_0x4ba3('0x70')]();_0x1194a5[_0x4ba3('0x71')](_0x2d00e3[_0x4ba3('0x72')]);for(var _0x1e2134=0x0;_0x1e2134<_0x35441e['length'];_0x1e2134+=0x1){_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x73')]?_0x217ea4[_0x35441e[_0x1e2134]['MetricId']][_0x4ba3('0x74')]:_0x35441e[_0x1e2134][_0x4ba3('0x6a')];_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x75')]?_[_0x4ba3('0x76')](_0x1e8232[_0x35441e[_0x1e2134]['function']],'%s',_0x2f793a):_0x2f793a;_0x2f793a=_0x35441e[_0x1e2134][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x13dbc4[_0x35441e[_0x1e2134]['format']],'%s',_0x2f793a):_0x2f793a;if(_0x35441e[_0x1e2134][_0x4ba3('0x78')]){_0x1194a5['group'](_0x2f793a);}_0x35441e[_0x1e2134][_0x4ba3('0x79')]&&_0x1194a5[_0x4ba3('0x8d')](_0x2f793a,_0x35441e[_0x1e2134][_0x4ba3('0x79')]===_0x4ba3('0x7a')?![]:!![]);_0x1194a5[_0x4ba3('0x6a')](_0x2f793a,_0x35441e[_0x1e2134]['alias']||_0x2f793a);}if(_0x2d00e3['joins']){_0x2d00e3[_0x4ba3('0x7c')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x7c')]);for(var _0x56244e=0x0;_0x56244e<_0x2d00e3[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x56244e+=0x1){if(_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x2b2132,_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')])&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')]&&_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')]&&_0x2d00e3['joins'][_0x56244e][_0x4ba3('0x7f')]){_0x1194a5[_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x33')]](_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x2d00e3[_0x4ba3('0x72')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x7e')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e][_0x4ba3('0x80')],_0x2d00e3[_0x4ba3('0x7c')][_0x56244e]['foreignKey']));}}}if(_0x2d00e3['conditions']){_0x2d00e3[_0x4ba3('0x82')]=JSON[_0x4ba3('0x7d')](_0x2d00e3[_0x4ba3('0x82')]);_0x1194a5[_0x4ba3('0x40')](_0x333a97(_0x2d00e3[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x5ea9d0=_0x1194a5[_0x4ba3('0x83')]();_0x1194a5['limit'](_0x2d16e5);_0x1194a5['offset'](0x0);return;}})[_0x4ba3('0x26')](function(){if(_0x108679[_0x4ba3('0x8e')]==='web'){return null;}var _0x4fb6b5=_['merge'](_0x108679,{'name':_0x108679['fullPath']||_0x108679[_0x4ba3('0x2c')]||_0x2d00e3[_0x4ba3('0x2c')],'basename':_0x5a3c63,'savename':util[_0x4ba3('0x77')](_0x4ba3('0x8f'),_0x108679[_0x4ba3('0x2c')]||_0x2d00e3['name'],require(_0x4ba3('0x90'))[_0x4ba3('0x91')](0x4),_0x108679[_0x4ba3('0x8e')]||'csv'),'reportId':_0x2d00e3['id'],'reportType':'default'});return db['AnalyticExtractedReport']['create'](_0x4fb6b5,{'raw':!![]});})[_0x4ba3('0x26')](function(_0x17d501){if(_0x2d00e3[_0x4ba3('0x72')]===_0x4ba3('0x92')){_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3['table']+_0x4ba3('0x93'),_0x108679['startDate'],_0x108679[_0x4ba3('0x94')]);}else{_0x5ea9d0[_0x4ba3('0x40')](_0x2d00e3[_0x4ba3('0x72')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x108679[_0x4ba3('0x95')],_0x108679[_0x4ba3('0x94')]);}if(_0x17d501){logger[_0x4ba3('0x96')](_0x4ba3('0x97'),_0x5ea9d0['toString']());require('child_process')[_0x4ba3('0x98')](path[_0x4ba3('0x55')](__dirname,'../../components/export/',_0x17d501[_0x4ba3('0x8e')]),[_0x17d501['id'],_0x5ea9d0['toString'](),path['join'](__dirname,'../../files/reports',_0x17d501['savename']),_0x5a3c63]);return _0x17d501;}else{var _0x2d2ca3=squel[_0x4ba3('0x70')]();_0x2d2ca3[_0x4ba3('0x71')]('('+_0x5ea9d0[_0x4ba3('0x86')]()+')',_0x4ba3('0x99'));_0x2d2ca3['field']('COUNT(*)',_0x4ba3('0x21'));_0x5ea9d0['limit'](_0x108679[_0x4ba3('0x1f')]||_0x2d16e5);_0x5ea9d0[_0x4ba3('0x1e')](_0x108679[_0x4ba3('0x1e')]||0x0);return dbH['sequelize'][_0x4ba3('0x35')](_0x2d2ca3[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]})[_0x4ba3('0x26')](function(_0xc938c){if(!_0xc938c[_0x4ba3('0x3c')]){_0x40dcee=0x0;}else{_0x40dcee=_0xc938c[0x0][_0x4ba3('0x21')]||0x0;}return dbH['sequelize']['query'](_0x5ea9d0[_0x4ba3('0x86')](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')][_0x4ba3('0x88')]});})[_0x4ba3('0x26')](function(_0xd97c26){return{'rows':_0xd97c26||[],'count':_0x40dcee};});}});}exports['run']=function(_0x1fbdc7,_0x9e45ec){return runReport(_0x1fbdc7['params'],_0x1fbdc7[_0x4ba3('0x35')],_0x1fbdc7[_0x4ba3('0x44')])[_0x4ba3('0x26')](respondWithResult(_0x9e45ec,null))[_0x4ba3('0x51')](handleError(_0x9e45ec,null));};exports[_0x4ba3('0x9b')]=runReport;exports[_0x4ba3('0x35')]=function(_0xddfb0c,_0x41c531){var _0x25bf75=0xa;var _0x18bd77=[_0x4ba3('0x55'),_0x4ba3('0x56'),_0x4ba3('0x57'),_0x4ba3('0x58')];var _0x2e812b={'SUM':'SUM(%s)','COUNT':_0x4ba3('0x89'),'COUNT DISTINCT':_0x4ba3('0x5a'),'MAX':'MAX(%s)','MIN':_0x4ba3('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4ba3('0x5d'),'GROUP_CONCAT ASC':_0x4ba3('0x9c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5dc74f={'SEC_TO_TIME':_0x4ba3('0x5f'),'DATE':'DATE(%s)','HOUR':_0x4ba3('0x61'),'ROUND':_0x4ba3('0x9d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1590f0=function(_0x5efab9){return!_[_0x4ba3('0x63')]([_0x4ba3('0x64'),_0x4ba3('0x8b'),'IS\x20EMPTY',_0x4ba3('0x66')],_0x5efab9);};var _0x4d3262=function(_0x4ad4d3){if(!_0x4ad4d3||!_0x4ad4d3[_0x4ba3('0x67')]['length']){return'';}for(var _0x4529a3='(',_0x9b9c64=0x0;_0x9b9c64<_0x4ad4d3[_0x4ba3('0x67')]['length'];_0x9b9c64+=0x1){_0x9b9c64>0x0&&(_0x4529a3+='\x20'+_0x4ad4d3['operator']+'\x20');_0x4529a3+=_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]?_0x4d3262(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x69')]):_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64]['field']+'\x20'+_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')]+(_0x1590f0(_0x4ad4d3[_0x4ba3('0x67')][_0x9b9c64][_0x4ba3('0x6b')])?'\x20'+_0x4ad4d3['rules'][_0x9b9c64][_0x4ba3('0x8c')]:'');}return _0x4529a3+')';};var _0x3073c5={'where':{'id':_0xddfb0c[_0x4ba3('0x49')]['id']}},_0x3d1c11,_0xa41747,_0x25c92c,_0x422a8d,_0x225746;_0x3073c5=_[_0x4ba3('0x43')]({},_0x3073c5,_0xddfb0c[_0x4ba3('0x44')]);return db[_0x4ba3('0x30')]['find'](_0x3073c5)[_0x4ba3('0x26')](function(_0x3db4c2){if(_0x3db4c2){_0x3d1c11=_0x3db4c2;return _0x3db4c2['getFields']();}return null;})[_0x4ba3('0x26')](function(_0x4a8449){if(_0x4a8449){if(!_0x4a8449[_0x4ba3('0x3c')]){throw new db[(_0x4ba3('0x6d'))][(_0x4ba3('0x6e'))](_0x4ba3('0x9e'),0x193);}_0xa41747=_0x4a8449;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4ba3('0x26')](function(_0xfaf98a){if(_0xfaf98a){_0x25c92c=_['keyBy'](_0xfaf98a,'id');var _0x30c904;var _0x267801=squel[_0x4ba3('0x70')]();_0x267801[_0x4ba3('0x71')](_0x3d1c11['table']);for(var _0x1bae1b=0x0;_0x1bae1b<_0xa41747[_0x4ba3('0x3c')];_0x1bae1b+=0x1){_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x73')]?_0x25c92c[_0xa41747[_0x1bae1b][_0x4ba3('0x73')]]['metric']:_0xa41747[_0x1bae1b][_0x4ba3('0x6a')];_0x30c904=_0xa41747[_0x1bae1b]['function']?_[_0x4ba3('0x76')](_0x2e812b[_0xa41747[_0x1bae1b][_0x4ba3('0x75')]],'%s',_0x30c904):_0x30c904;_0x30c904=_0xa41747[_0x1bae1b][_0x4ba3('0x77')]?_[_0x4ba3('0x76')](_0x5dc74f[_0xa41747[_0x1bae1b]['format']],'%s',_0x30c904):_0x30c904;if(_0xa41747[_0x1bae1b]['groupBy']){_0x267801[_0x4ba3('0x69')](_0x30c904);}_0xa41747[_0x1bae1b][_0x4ba3('0x79')]&&_0x267801[_0x4ba3('0x8d')](_0x30c904,_0xa41747[_0x1bae1b]['orderBy']==='DESC'?![]:!![]);_0x267801[_0x4ba3('0x6a')](_0x30c904,_0xa41747[_0x1bae1b][_0x4ba3('0x7b')]||_0x30c904);}if(_0x3d1c11[_0x4ba3('0x7c')]){_0x3d1c11[_0x4ba3('0x7c')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x7c')]);for(var _0x2f4966=0x0;_0x2f4966<_0x3d1c11[_0x4ba3('0x7c')][_0x4ba3('0x3c')];_0x2f4966+=0x1){if(_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]&&_[_0x4ba3('0x63')](_0x18bd77,_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')])&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x80')]&&_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7f')]){_0x267801[_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x33')]](_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],null,util[_0x4ba3('0x77')](_0x4ba3('0x81'),_0x3d1c11[_0x4ba3('0x72')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966][_0x4ba3('0x7e')],_0x3d1c11[_0x4ba3('0x7c')][_0x2f4966]['foreignTable'],_0x3d1c11['joins'][_0x2f4966][_0x4ba3('0x7f')]));}}}if(_0x3d1c11[_0x4ba3('0x82')]){_0x3d1c11[_0x4ba3('0x82')]=JSON['parse'](_0x3d1c11[_0x4ba3('0x82')]);_0x267801[_0x4ba3('0x40')](_0x4d3262(_0x3d1c11[_0x4ba3('0x82')][_0x4ba3('0x69')]));}_0x225746=_0x267801[_0x4ba3('0x83')]();_0x267801[_0x4ba3('0x1f')](_0x25bf75);_0x267801[_0x4ba3('0x1e')](0x0);logger[_0x4ba3('0x84')](_0x4ba3('0x85'),_0x267801['toString']());return dbH[_0x4ba3('0x87')]['query'](_0x267801['toString'](),{'type':dbH[_0x4ba3('0x87')][_0x4ba3('0x9a')]['SELECT']});}})[_0x4ba3('0x26')](function(){return{'sql':_0x225746[_0x4ba3('0x86')]()};})[_0x4ba3('0x26')](respondWithResult(_0x41c531,null))[_0x4ba3('0x51')](handleError(_0x41c531,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(_0x186740,_0x4cfd59){var _0x1863b5=function(_0x57004b){while(--_0x57004b){_0x186740['push'](_0x186740['shift']());}};_0x1863b5(++_0x4cfd59);}(_0x1967,0x173));var _0x7196=function(_0x26bb09,_0x45bbba){_0x26bb09=_0x26bb09-0x0;var _0xcd50b4=_0x1967[_0x26bb09];return _0xcd50b4;};'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 bb50597..06a1069 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 _0x51fc=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x29561f,_0x313c5a){var _0x5d8beb=function(_0x3df0c1){while(--_0x3df0c1){_0x29561f['push'](_0x29561f['shift']());}};_0x5d8beb(++_0x313c5a);}(_0x51fc,0xe1));var _0xc51f=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x51fc[_0x2caaef];return _0xd011f8;};'use strict';var _=require(_0xc51f('0x0'));var util=require('util');var logger=require(_0xc51f('0x1'))(_0xc51f('0x2'));var moment=require(_0xc51f('0x3'));var BPromise=require(_0xc51f('0x4'));var rp=require(_0xc51f('0x5'));var fs=require('fs');var path=require(_0xc51f('0x6'));var rimraf=require(_0xc51f('0x7'));var config=require(_0xc51f('0x8'));var attributes=require(_0xc51f('0x9'));module['exports']=function(_0x596560,_0x1024df){return _0x596560[_0xc51f('0xa')](_0xc51f('0xb'),attributes,{'tableName':_0xc51f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e9=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x13d929,_0x28fa20){var _0x3b3f24=function(_0x44de8e){while(--_0x44de8e){_0x13d929['push'](_0x13d929['shift']());}};_0x3b3f24(++_0x28fa20);}(_0xa9e9,0xad));var _0x9a9e=function(_0xa62ef2,_0x2617e9){_0xa62ef2=_0xa62ef2-0x0;var _0x1d0d2e=_0xa9e9[_0xa62ef2];return _0x1d0d2e;};'use strict';var _=require(_0x9a9e('0x0'));var util=require(_0x9a9e('0x1'));var logger=require(_0x9a9e('0x2'))(_0x9a9e('0x3'));var moment=require(_0x9a9e('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a9e('0x5'));var fs=require('fs');var path=require(_0x9a9e('0x6'));var rimraf=require(_0x9a9e('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a9e('0x8'));module[_0x9a9e('0x9')]=function(_0x3a6e7a,_0x28ca38){return _0x3a6e7a[_0x9a9e('0xa')](_0x9a9e('0xb'),attributes,{'tableName':_0x9a9e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index a351008..3b5a2fa 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 _0x5872=['client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x58ac5b,_0x2b3fcb){var _0x47f26a=function(_0x4bdf66){while(--_0x4bdf66){_0x58ac5b['push'](_0x58ac5b['shift']());}};_0x47f26a(++_0x2b3fcb);}(_0x5872,0xb4));var _0x2587=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0x5872[_0x2bf5bd];return _0xc810c0;};'use strict';var _=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var moment=require(_0x2587('0x2'));var BPromise=require(_0x2587('0x3'));var rs=require(_0x2587('0x4'));var fs=require('fs');var Redis=require(_0x2587('0x5'));var db=require(_0x2587('0x6'))['db'];var utils=require(_0x2587('0x7'));var logger=require(_0x2587('0x8'))(_0x2587('0x9'));var config=require(_0x2587('0xa'));var jayson=require(_0x2587('0xb'));var client=jayson[_0x2587('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2fce,_0x5ab3a6,_0x3314b2){return new BPromise(function(_0x162158,_0x514444){return client['request'](_0x3d2fce,_0x3314b2)[_0x2587('0xd')](function(_0x54dce1){logger['info'](_0x2587('0xe'),_0x5ab3a6,'request\x20sent');logger[_0x2587('0xf')](_0x2587('0x10'),_0x5ab3a6,_0x2587('0x11'),JSON[_0x2587('0x12')](_0x54dce1));if(_0x54dce1[_0x2587('0x13')]){if(_0x54dce1[_0x2587('0x13')][_0x2587('0x14')]===0x1f4){logger[_0x2587('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5ab3a6,_0x54dce1['error'][_0x2587('0x15')]);return _0x514444(_0x54dce1[_0x2587('0x13')][_0x2587('0x15')]);}logger[_0x2587('0x13')](_0x2587('0xe'),_0x5ab3a6,_0x54dce1[_0x2587('0x13')][_0x2587('0x15')]);return _0x162158(_0x54dce1['error']['message']);}else{logger[_0x2587('0x16')](_0x2587('0xe'),_0x5ab3a6,'request\x20sent');_0x162158(_0x54dce1[_0x2587('0x17')][_0x2587('0x15')]);}})['catch'](function(_0x2a7994){logger['error'](_0x2587('0xe'),_0x5ab3a6,_0x2a7994);_0x514444(_0x2a7994);});});} \ No newline at end of file +var _0x38ad=['http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4be6f4,_0x385b23){var _0x3e9098=function(_0x17ff9a){while(--_0x17ff9a){_0x4be6f4['push'](_0x4be6f4['shift']());}};_0x3e9098(++_0x385b23);}(_0x38ad,0x183));var _0xd38a=function(_0x20e6d7,_0x4db8fb){_0x20e6d7=_0x20e6d7-0x0;var _0x27f9ae=_0x38ad[_0x20e6d7];return _0x27f9ae;};'use strict';var _=require(_0xd38a('0x0'));var util=require('util');var moment=require(_0xd38a('0x1'));var BPromise=require(_0xd38a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd38a('0x3'))['db'];var utils=require(_0xd38a('0x4'));var logger=require(_0xd38a('0x5'))(_0xd38a('0x6'));var config=require('../../config/environment');var jayson=require(_0xd38a('0x7'));var client=jayson[_0xd38a('0x8')][_0xd38a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5021ad,_0x3b358c,_0x1265af){return new BPromise(function(_0x552d9e,_0xd997aa){return client[_0xd38a('0xa')](_0x5021ad,_0x1265af)[_0xd38a('0xb')](function(_0x292a07){logger[_0xd38a('0xc')](_0xd38a('0xd'),_0x3b358c,_0xd38a('0xe'));logger[_0xd38a('0xf')](_0xd38a('0x10'),_0x3b358c,'request\x20sent',JSON[_0xd38a('0x11')](_0x292a07));if(_0x292a07['error']){if(_0x292a07[_0xd38a('0x12')][_0xd38a('0x13')]===0x1f4){logger[_0xd38a('0x12')](_0xd38a('0xd'),_0x3b358c,_0x292a07['error'][_0xd38a('0x14')]);return _0xd997aa(_0x292a07[_0xd38a('0x12')]['message']);}logger[_0xd38a('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3b358c,_0x292a07[_0xd38a('0x12')][_0xd38a('0x14')]);return _0x552d9e(_0x292a07[_0xd38a('0x12')][_0xd38a('0x14')]);}else{logger[_0xd38a('0xc')](_0xd38a('0xd'),_0x3b358c,'request\x20sent');_0x552d9e(_0x292a07[_0xd38a('0x15')]['message']);}})['catch'](function(_0xb90d6f){logger[_0xd38a('0x12')](_0xd38a('0xd'),_0x3b358c,_0xb90d6f);_0xd997aa(_0xb90d6f);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 00d6815..7221d76 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 _0x1445=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','preview','run','post','create'];(function(_0x20f2ed,_0x1a3f00){var _0x4bade7=function(_0x3f4fd9){while(--_0x3f4fd9){_0x20f2ed['push'](_0x20f2ed['shift']());}};_0x4bade7(++_0x1a3f00);}(_0x1445,0xf5));var _0x5144=function(_0x4526c8,_0x38d4c7){_0x4526c8=_0x4526c8-0x0;var _0x5c7295=_0x1445[_0x4526c8];return _0x5c7295;};'use strict';var multer=require(_0x5144('0x0'));var util=require(_0x5144('0x1'));var path=require(_0x5144('0x2'));var timeout=require(_0x5144('0x3'));var express=require(_0x5144('0x4'));var router=express[_0x5144('0x5')]();var fs_extra=require(_0x5144('0x6'));var auth=require(_0x5144('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5144('0x8'));var controller=require('./analyticDefaultReport.controller');router[_0x5144('0x9')]('/',auth['isAuthenticated'](),controller[_0x5144('0xa')]);router['get'](_0x5144('0xb'),auth[_0x5144('0xc')](),controller[_0x5144('0xd')]);router['get'](_0x5144('0xe'),auth[_0x5144('0xc')](),controller[_0x5144('0xf')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x5144('0x10')]);router[_0x5144('0x9')]('/:id/query',auth['isAuthenticated'](),controller['query']);router[_0x5144('0x11')]('/',auth[_0x5144('0xc')](),controller[_0x5144('0x12')]);router[_0x5144('0x13')](_0x5144('0xb'),auth['isAuthenticated'](),controller[_0x5144('0x14')]);router['delete'](_0x5144('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x5144('0x15')]=router; \ No newline at end of file +var _0x39b2=['exports','multer','path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id/preview','preview','run','/:id/query','post','create','put','update'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x39b2,0x10f));var _0x239b=function(_0x1b67be,_0x222a4a){_0x1b67be=_0x1b67be-0x0;var _0x122bf2=_0x39b2[_0x1b67be];return _0x122bf2;};'use strict';var multer=require(_0x239b('0x0'));var util=require('util');var path=require(_0x239b('0x1'));var timeout=require('connect-timeout');var express=require(_0x239b('0x2'));var router=express['Router']();var fs_extra=require(_0x239b('0x3'));var auth=require(_0x239b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x239b('0x5'));var controller=require(_0x239b('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x239b('0x7')]('/:id',auth[_0x239b('0x8')](),controller['show']);router[_0x239b('0x7')](_0x239b('0x9'),auth[_0x239b('0x8')](),controller[_0x239b('0xa')]);router[_0x239b('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x239b('0xb')]);router['get'](_0x239b('0xc'),auth[_0x239b('0x8')](),controller['query']);router[_0x239b('0xd')]('/',auth[_0x239b('0x8')](),controller[_0x239b('0xe')]);router[_0x239b('0xf')]('/:id',auth[_0x239b('0x8')](),controller[_0x239b('0x10')]);router['delete']('/:id',auth[_0x239b('0x8')](),controller['destroy']);module[_0x239b('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index e096a7c..36e4399 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 _0x8f6b=['ENUM','csv','DATE','manual','scheduled','INTEGER','UNSIGNED','moment','STRING'];(function(_0x5b3636,_0x2c07d){var _0x42061e=function(_0x5b4771){while(--_0x5b4771){_0x5b3636['push'](_0x5b3636['shift']());}};_0x42061e(++_0x2c07d);}(_0x8f6b,0x15d));var _0xb8f6=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x8f6b[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb8f6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8f6('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xb8f6('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xb8f6('0x2')](_0xb8f6('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xb8f6('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0xb8f6('0x4')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xb8f6('0x2')](_0xb8f6('0x5'),_0xb8f6('0x6')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xb8f6('0x7')](0xb)[_0xb8f6('0x8')]},'reportType':{'type':Sequelize[_0xb8f6('0x1')]}}; \ No newline at end of file +var _0x9fce=['pdf','xlsx','DATE','Loading','ENUM','manual','INTEGER','sequelize','moment','exports','STRING','csv'];(function(_0x144fe4,_0x4c65b0){var _0x1487f9=function(_0x7d39ed){while(--_0x7d39ed){_0x144fe4['push'](_0x144fe4['shift']());}};_0x1487f9(++_0x4c65b0);}(_0x9fce,0x73));var _0xe9fc=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x9fce[_0x420b24];return _0x4da552;};'use strict';var Sequelize=require(_0xe9fc('0x0'));var moment=require(_0xe9fc('0x1'));module[_0xe9fc('0x2')]={'name':{'type':Sequelize[_0xe9fc('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xe9fc('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0xe9fc('0x4'),_0xe9fc('0x5'),_0xe9fc('0x6')),'allowNull':![],'defaultValue':_0xe9fc('0x4')},'savename':{'type':Sequelize[_0xe9fc('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xe9fc('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xe9fc('0x3')],'defaultValue':_0xe9fc('0x8')},'type':{'type':Sequelize[_0xe9fc('0x9')](_0xe9fc('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xe9fc('0xa')},'reportId':{'type':Sequelize[_0xe9fc('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0xe9fc('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 9fb3d07..58f5951 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 _0x1000=['index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','exists','server/files/reports','format','%s.%s','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1000,0x9d));var _0x0100=function(_0x55189a,_0x35d0d0){_0x55189a=_0x55189a-0x0;var _0x3731f6=_0x1000[_0x55189a];return _0x3731f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0100('0x0'));var zipdir=require(_0x0100('0x1'));var jsonpatch=require(_0x0100('0x2'));var rp=require(_0x0100('0x3'));var moment=require(_0x0100('0x4'));var BPromise=require(_0x0100('0x5'));var Mustache=require(_0x0100('0x6'));var util=require(_0x0100('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x0100('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0100('0x9'));var _=require(_0x0100('0xa'));var squel=require(_0x0100('0xb'));var crypto=require(_0x0100('0xc'));var jsforce=require(_0x0100('0xd'));var deskjs=require(_0x0100('0xe'));var toCsv=require(_0x0100('0x8'));var querystring=require(_0x0100('0xf'));var Papa=require(_0x0100('0x10'));var Redis=require(_0x0100('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0100('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0100('0x13'));var utils=require('../../config/utils');var config=require(_0x0100('0x14'));var licenseUtil=require(_0x0100('0x15'));var db=require(_0x0100('0x16'))['db'];function respondWithStatusCode(_0x1a14d7,_0x4be7b7){_0x4be7b7=_0x4be7b7||0xcc;return function(_0x17d11b){if(_0x17d11b){return _0x1a14d7['sendStatus'](_0x4be7b7);}return _0x1a14d7[_0x0100('0x17')](_0x4be7b7)[_0x0100('0x18')]();};}function respondWithResult(_0x331bc7,_0x4d291e){_0x4d291e=_0x4d291e||0xc8;return function(_0x1a6f44){if(_0x1a6f44){return _0x331bc7[_0x0100('0x17')](_0x4d291e)['json'](_0x1a6f44);}};}function respondWithFilteredResult(_0x5d067a,_0xf6c9ea){return function(_0x40d8aa){if(_0x40d8aa){var _0x251ebe=typeof _0xf6c9ea[_0x0100('0x19')]===_0x0100('0x1a')&&typeof _0xf6c9ea[_0x0100('0x1b')]===_0x0100('0x1a');var _0x1b9e65=_0x40d8aa[_0x0100('0x1c')];var _0x50babc=_0x251ebe?0x0:_0xf6c9ea[_0x0100('0x19')];var _0x5ae58b=_0x251ebe?_0x40d8aa[_0x0100('0x1c')]:_0xf6c9ea['offset']+_0xf6c9ea['limit'];var _0x476b74;if(_0x5ae58b>=_0x1b9e65){_0x5ae58b=_0x1b9e65;_0x476b74=0xc8;}else{_0x476b74=0xce;}_0x5d067a[_0x0100('0x17')](_0x476b74);return _0x5d067a[_0x0100('0x1d')](_0x0100('0x1e'),_0x50babc+'-'+_0x5ae58b+'/'+_0x1b9e65)[_0x0100('0x1f')](_0x40d8aa);}return null;};}function patchUpdates(_0x22fcd3){return function(_0x1b9a20){try{jsonpatch[_0x0100('0x20')](_0x1b9a20,_0x22fcd3,!![]);}catch(_0x2038c8){return BPromise[_0x0100('0x21')](_0x2038c8);}return _0x1b9a20[_0x0100('0x22')]();};}function saveUpdates(_0x1ccf0a,_0xa06a2c){return function(_0xaab29c){if(_0xaab29c){return _0xaab29c[_0x0100('0x23')](_0x1ccf0a)['then'](function(_0x2711fb){return _0x2711fb;});}return null;};}function removeEntity(_0x14f864,_0x32cd36){return function(_0x15ad68){if(_0x15ad68){return _0x15ad68[_0x0100('0x24')]()[_0x0100('0x25')](function(){var _0x49e7da=_0x15ad68['get']({'plain':!![]});var _0x5c47bc=_0x0100('0x26');return db[_0x0100('0x27')][_0x0100('0x24')]({'where':{'type':_0x5c47bc,'resourceId':_0x49e7da['id']}})['then'](function(){return _0x15ad68;});})[_0x0100('0x25')](function(){_0x14f864['status'](0xcc)[_0x0100('0x18')]();});}};}function handleEntityNotFound(_0x208d6c,_0x394383){return function(_0x5efe30){if(!_0x5efe30){_0x208d6c[_0x0100('0x28')](0x194);}return _0x5efe30;};}function handleError(_0x35beef,_0x1c5d41){_0x1c5d41=_0x1c5d41||0x1f4;return function(_0x28cfea){logger[_0x0100('0x29')](_0x28cfea[_0x0100('0x2a')]);if(_0x28cfea[_0x0100('0x2b')]){delete _0x28cfea[_0x0100('0x2b')];}_0x35beef[_0x0100('0x17')](_0x1c5d41)[_0x0100('0x2c')](_0x28cfea);};}exports[_0x0100('0x2d')]=function(_0x62932,_0x448ecd){var _0x3dd74b={},_0x14b2a9={},_0x5306d3={'count':0x0,'rows':[]};var _0x4fc502=_['map'](db[_0x0100('0x2e')][_0x0100('0x2f')],function(_0x5937dd){return{'name':_0x5937dd[_0x0100('0x30')],'type':_0x5937dd[_0x0100('0x31')]['key']};});_0x14b2a9[_0x0100('0x32')]=_['map'](_0x4fc502,_0x0100('0x2b'));_0x14b2a9[_0x0100('0x33')]=_[_0x0100('0x34')](_0x62932[_0x0100('0x33')]);_0x14b2a9['filters']=_[_0x0100('0x35')](_0x14b2a9[_0x0100('0x32')],_0x14b2a9['query']);_0x3dd74b['attributes']=_[_0x0100('0x35')](_0x14b2a9['model'],qs[_0x0100('0x36')](_0x62932[_0x0100('0x33')][_0x0100('0x36')]));_0x3dd74b[_0x0100('0x37')]=_0x3dd74b[_0x0100('0x37')][_0x0100('0x38')]?_0x3dd74b[_0x0100('0x37')]:_0x14b2a9[_0x0100('0x32')];if(!_0x62932['query'][_0x0100('0x39')](_0x0100('0x3a'))){_0x3dd74b['limit']=qs[_0x0100('0x1b')](_0x62932[_0x0100('0x33')][_0x0100('0x1b')]);_0x3dd74b['offset']=qs[_0x0100('0x19')](_0x62932['query'][_0x0100('0x19')]);}_0x3dd74b[_0x0100('0x3b')]=qs[_0x0100('0x3c')](_0x62932['query'][_0x0100('0x3c')]);_0x3dd74b['where']=qs['filters'](_[_0x0100('0x3d')](_0x62932[_0x0100('0x33')],_0x14b2a9[_0x0100('0x3e')]),_0x4fc502);if(_0x62932[_0x0100('0x33')][_0x0100('0x3f')]){_0x3dd74b[_0x0100('0x40')]=_[_0x0100('0x41')](_0x3dd74b[_0x0100('0x40')],{'$or':_[_0x0100('0x42')](_0x4fc502,function(_0x331c02){if(_0x331c02[_0x0100('0x31')]!==_0x0100('0x43')){var _0x1393a6={};_0x1393a6[_0x331c02[_0x0100('0x2b')]]={'$like':'%'+_0x62932[_0x0100('0x33')][_0x0100('0x3f')]+'%'};return _0x1393a6;}})});}_0x3dd74b=_[_0x0100('0x41')]({},_0x3dd74b,_0x62932[_0x0100('0x44')]);var _0x236f7e={'where':_0x3dd74b[_0x0100('0x40')]};return db[_0x0100('0x2e')][_0x0100('0x1c')](_0x236f7e)[_0x0100('0x25')](function(_0x5a4dd7){_0x5306d3[_0x0100('0x1c')]=_0x5a4dd7;if(_0x62932['query'][_0x0100('0x45')]){_0x3dd74b['include']=[{'all':!![]}];}return db[_0x0100('0x2e')][_0x0100('0x46')](_0x3dd74b);})['then'](function(_0x19e96e){_0x5306d3[_0x0100('0x47')]=_0x19e96e;return _0x5306d3;})[_0x0100('0x25')](respondWithFilteredResult(_0x448ecd,_0x3dd74b))[_0x0100('0x48')](handleError(_0x448ecd,null));};exports[_0x0100('0x49')]=function(_0x7d4e9c,_0x49f2be){var _0x12656c={'raw':!![],'where':{'id':_0x7d4e9c[_0x0100('0x4a')]['id']}},_0x576064={};_0x576064[_0x0100('0x32')]=_['keys'](db[_0x0100('0x2e')][_0x0100('0x2f')]);_0x576064[_0x0100('0x33')]=_[_0x0100('0x34')](_0x7d4e9c['query']);_0x576064['filters']=_['intersection'](_0x576064[_0x0100('0x32')],_0x576064[_0x0100('0x33')]);_0x12656c[_0x0100('0x37')]=_[_0x0100('0x35')](_0x576064[_0x0100('0x32')],qs[_0x0100('0x36')](_0x7d4e9c[_0x0100('0x33')]['fields']));_0x12656c[_0x0100('0x37')]=_0x12656c['attributes']['length']?_0x12656c['attributes']:_0x576064[_0x0100('0x32')];if(_0x7d4e9c[_0x0100('0x33')][_0x0100('0x45')]){_0x12656c[_0x0100('0x4b')]=[{'all':!![]}];}_0x12656c=_[_0x0100('0x41')]({},_0x12656c,_0x7d4e9c['options']);return db[_0x0100('0x2e')][_0x0100('0x4c')](_0x12656c)[_0x0100('0x25')](handleEntityNotFound(_0x49f2be,null))[_0x0100('0x25')](respondWithResult(_0x49f2be,null))['catch'](handleError(_0x49f2be,null));};exports[_0x0100('0x4d')]=function(_0x546e61,_0x19662e){return db['AnalyticExtractedReport']['create'](_0x546e61[_0x0100('0x4e')],{})[_0x0100('0x25')](function(_0x1dbcaf){var _0x3e5b9a=_0x546e61[_0x0100('0x4f')][_0x0100('0x50')]({'plain':!![]});if(!_0x3e5b9a)throw new Error(_0x0100('0x51'));if(_0x3e5b9a[_0x0100('0x52')]==='user'){var _0x5d1304=_0x1dbcaf[_0x0100('0x50')]({'plain':!![]});var _0x55589a='ExtractedReports';return db[_0x0100('0x53')][_0x0100('0x4c')]({'where':{'name':_0x55589a,'userProfileId':_0x3e5b9a[_0x0100('0x54')]},'raw':!![]})[_0x0100('0x25')](function(_0xc448a5){if(_0xc448a5&&_0xc448a5[_0x0100('0x55')]===0x0){return db[_0x0100('0x27')][_0x0100('0x4d')]({'name':_0x5d1304[_0x0100('0x2b')],'resourceId':_0x5d1304['id'],'type':_0xc448a5[_0x0100('0x2b')],'sectionId':_0xc448a5['id']},{})[_0x0100('0x25')](function(){return _0x1dbcaf;});}else{return _0x1dbcaf;}})['catch'](function(_0x5e7bb5){logger['error'](_0x0100('0x56'),_0x5e7bb5);throw _0x5e7bb5;});}return _0x1dbcaf;})[_0x0100('0x25')](respondWithResult(_0x19662e,0xc9))['catch'](handleError(_0x19662e,null));};exports['update']=function(_0x497727,_0x164e86){if(_0x497727[_0x0100('0x4e')]['id']){delete _0x497727['body']['id'];}return db[_0x0100('0x2e')][_0x0100('0x4c')]({'where':{'id':_0x497727[_0x0100('0x4a')]['id']}})[_0x0100('0x25')](handleEntityNotFound(_0x164e86,null))[_0x0100('0x25')](saveUpdates(_0x497727[_0x0100('0x4e')],null))[_0x0100('0x25')](respondWithResult(_0x164e86,null))[_0x0100('0x48')](handleError(_0x164e86,null));};exports[_0x0100('0x24')]=function(_0x407d7,_0x2d777d){return db[_0x0100('0x2e')][_0x0100('0x4c')]({'where':{'id':_0x407d7['params']['id']}})['then'](handleEntityNotFound(_0x2d777d,null))['then'](removeEntity(_0x2d777d,null))[_0x0100('0x48')](handleError(_0x2d777d,null));};exports[_0x0100('0x57')]=function(_0x45338a,_0x40e2ce,_0x1b626c){return db['AnalyticExtractedReport'][_0x0100('0x4c')]({'where':{'id':_0x45338a['params']['id']},'attributes':[_0x0100('0x2b'),_0x0100('0x58'),_0x0100('0x59'),_0x0100('0x5a')],'raw':!![]})['then'](handleEntityNotFound(_0x40e2ce,null))[_0x0100('0x25')](function(_0x2d1348){if(_0x2d1348){if(!fs[_0x0100('0x5b')](path[_0x0100('0x5c')](config[_0x0100('0x5d')],'server/files/reports',_0x2d1348[_0x0100('0x59')]))){throw new db[(_0x0100('0x5e'))][(_0x0100('0x5f'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x45338a['query'][_0x0100('0x60')]){return _0x40e2ce['sendStatus'](0xc8);}return _0x40e2ce['download'](path[_0x0100('0x5c')](config[_0x0100('0x5d')],_0x0100('0x61'),_0x2d1348[_0x0100('0x59')]),util[_0x0100('0x62')](_0x0100('0x63'),_0x2d1348['basename']||_0x2d1348['name'],_0x2d1348[_0x0100('0x5a')][_0x0100('0x64')]()));}})[_0x0100('0x48')](handleError(_0x40e2ce,null));}; \ No newline at end of file +var _0x924a=['count','set','Content-Range','apply','reject','update','then','destroy','get','status','end','error','stack','name','index','AnalyticExtractedReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','catch','show','include','options','create','body','user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','existsSync','join','root','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','download','server/files/reports','%s.%s','basename','toLowerCase','fast-json-patch','request-promise','mustache','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/license/util','sendStatus','json','offset','undefined','limit'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x924a,0x1ad));var _0xa924=function(_0x3eb7ef,_0x5c6ea8){_0x3eb7ef=_0x3eb7ef-0x0;var _0x42404a=_0x924a[_0x3eb7ef];return _0x42404a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa924('0x0'));var rp=require(_0xa924('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa924('0x2'));var util=require('util');var path=require(_0xa924('0x3'));var sox=require(_0xa924('0x4'));var csv=require(_0xa924('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa924('0x6'));var _=require(_0xa924('0x7'));var squel=require(_0xa924('0x8'));var crypto=require(_0xa924('0x9'));var jsforce=require(_0xa924('0xa'));var deskjs=require(_0xa924('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa924('0xc'));var Papa=require(_0xa924('0xd'));var Redis=require(_0xa924('0xe'));var authService=require(_0xa924('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa924('0x10'));var hardwareService=require(_0xa924('0x11'));var logger=require(_0xa924('0x12'))(_0xa924('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa924('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11524f,_0x4b3b83){_0x4b3b83=_0x4b3b83||0xcc;return function(_0x3cb23f){if(_0x3cb23f){return _0x11524f[_0xa924('0x15')](_0x4b3b83);}return _0x11524f['status'](_0x4b3b83)['end']();};}function respondWithResult(_0x1c7216,_0x2a6df1){_0x2a6df1=_0x2a6df1||0xc8;return function(_0xcfd6f){if(_0xcfd6f){return _0x1c7216['status'](_0x2a6df1)[_0xa924('0x16')](_0xcfd6f);}};}function respondWithFilteredResult(_0x4b0d5b,_0x260889){return function(_0x1a9a22){if(_0x1a9a22){var _0xdfe53=typeof _0x260889[_0xa924('0x17')]===_0xa924('0x18')&&typeof _0x260889[_0xa924('0x19')]===_0xa924('0x18');var _0x1f161b=_0x1a9a22[_0xa924('0x1a')];var _0x1a6d72=_0xdfe53?0x0:_0x260889[_0xa924('0x17')];var _0x1429b8=_0xdfe53?_0x1a9a22[_0xa924('0x1a')]:_0x260889[_0xa924('0x17')]+_0x260889[_0xa924('0x19')];var _0x6b513a;if(_0x1429b8>=_0x1f161b){_0x1429b8=_0x1f161b;_0x6b513a=0xc8;}else{_0x6b513a=0xce;}_0x4b0d5b['status'](_0x6b513a);return _0x4b0d5b[_0xa924('0x1b')](_0xa924('0x1c'),_0x1a6d72+'-'+_0x1429b8+'/'+_0x1f161b)[_0xa924('0x16')](_0x1a9a22);}return null;};}function patchUpdates(_0x98273c){return function(_0x23f3a2){try{jsonpatch[_0xa924('0x1d')](_0x23f3a2,_0x98273c,!![]);}catch(_0x663287){return BPromise[_0xa924('0x1e')](_0x663287);}return _0x23f3a2['save']();};}function saveUpdates(_0x6ded2f,_0x3f91ae){return function(_0x5e2889){if(_0x5e2889){return _0x5e2889[_0xa924('0x1f')](_0x6ded2f)[_0xa924('0x20')](function(_0x199838){return _0x199838;});}return null;};}function removeEntity(_0x33a49c,_0x38329d){return function(_0x5678bf){if(_0x5678bf){return _0x5678bf[_0xa924('0x21')]()[_0xa924('0x20')](function(){var _0x247bbc=_0x5678bf[_0xa924('0x22')]({'plain':!![]});var _0x186e9f='ExtractedReports';return db['UserProfileResource'][_0xa924('0x21')]({'where':{'type':_0x186e9f,'resourceId':_0x247bbc['id']}})[_0xa924('0x20')](function(){return _0x5678bf;});})['then'](function(){_0x33a49c[_0xa924('0x23')](0xcc)[_0xa924('0x24')]();});}};}function handleEntityNotFound(_0x198d79,_0x27979f){return function(_0x1d1f02){if(!_0x1d1f02){_0x198d79[_0xa924('0x15')](0x194);}return _0x1d1f02;};}function handleError(_0x508a01,_0x55a1af){_0x55a1af=_0x55a1af||0x1f4;return function(_0x438a53){logger[_0xa924('0x25')](_0x438a53[_0xa924('0x26')]);if(_0x438a53[_0xa924('0x27')]){delete _0x438a53[_0xa924('0x27')];}_0x508a01[_0xa924('0x23')](_0x55a1af)['send'](_0x438a53);};}exports[_0xa924('0x28')]=function(_0x44499c,_0x7a6e54){var _0xff41dc={},_0xeaa19={},_0x497c10={'count':0x0,'rows':[]};var _0x5b824b=_['map'](db[_0xa924('0x29')][_0xa924('0x2a')],function(_0x7cb105){return{'name':_0x7cb105[_0xa924('0x2b')],'type':_0x7cb105[_0xa924('0x2c')]['key']};});_0xeaa19[_0xa924('0x2d')]=_[_0xa924('0x2e')](_0x5b824b,_0xa924('0x27'));_0xeaa19[_0xa924('0x2f')]=_[_0xa924('0x30')](_0x44499c[_0xa924('0x2f')]);_0xeaa19[_0xa924('0x31')]=_[_0xa924('0x32')](_0xeaa19['model'],_0xeaa19[_0xa924('0x2f')]);_0xff41dc['attributes']=_[_0xa924('0x32')](_0xeaa19[_0xa924('0x2d')],qs[_0xa924('0x33')](_0x44499c[_0xa924('0x2f')]['fields']));_0xff41dc[_0xa924('0x34')]=_0xff41dc[_0xa924('0x34')][_0xa924('0x35')]?_0xff41dc[_0xa924('0x34')]:_0xeaa19[_0xa924('0x2d')];if(!_0x44499c[_0xa924('0x2f')]['hasOwnProperty'](_0xa924('0x36'))){_0xff41dc[_0xa924('0x19')]=qs[_0xa924('0x19')](_0x44499c[_0xa924('0x2f')][_0xa924('0x19')]);_0xff41dc['offset']=qs['offset'](_0x44499c[_0xa924('0x2f')]['offset']);}_0xff41dc['order']=qs['sort'](_0x44499c[_0xa924('0x2f')][_0xa924('0x37')]);_0xff41dc[_0xa924('0x38')]=qs['filters'](_[_0xa924('0x39')](_0x44499c['query'],_0xeaa19[_0xa924('0x31')]),_0x5b824b);if(_0x44499c[_0xa924('0x2f')][_0xa924('0x3a')]){_0xff41dc[_0xa924('0x38')]=_['merge'](_0xff41dc[_0xa924('0x38')],{'$or':_[_0xa924('0x2e')](_0x5b824b,function(_0x591fcf){if(_0x591fcf[_0xa924('0x2c')]!==_0xa924('0x3b')){var _0x295f0e={};_0x295f0e[_0x591fcf[_0xa924('0x27')]]={'$like':'%'+_0x44499c[_0xa924('0x2f')][_0xa924('0x3a')]+'%'};return _0x295f0e;}})});}_0xff41dc=_[_0xa924('0x3c')]({},_0xff41dc,_0x44499c['options']);var _0x255474={'where':_0xff41dc[_0xa924('0x38')]};return db['AnalyticExtractedReport'][_0xa924('0x1a')](_0x255474)['then'](function(_0x4753ea){_0x497c10['count']=_0x4753ea;if(_0x44499c[_0xa924('0x2f')][_0xa924('0x3d')]){_0xff41dc['include']=[{'all':!![]}];}return db[_0xa924('0x29')]['findAll'](_0xff41dc);})[_0xa924('0x20')](function(_0x3fa9f0){_0x497c10[_0xa924('0x3e')]=_0x3fa9f0;return _0x497c10;})[_0xa924('0x20')](respondWithFilteredResult(_0x7a6e54,_0xff41dc))[_0xa924('0x3f')](handleError(_0x7a6e54,null));};exports[_0xa924('0x40')]=function(_0x5542bb,_0x43fcce){var _0x33b035={'raw':!![],'where':{'id':_0x5542bb['params']['id']}},_0x10008a={};_0x10008a[_0xa924('0x2d')]=_[_0xa924('0x30')](db['AnalyticExtractedReport'][_0xa924('0x2a')]);_0x10008a['query']=_[_0xa924('0x30')](_0x5542bb[_0xa924('0x2f')]);_0x10008a[_0xa924('0x31')]=_['intersection'](_0x10008a[_0xa924('0x2d')],_0x10008a['query']);_0x33b035[_0xa924('0x34')]=_[_0xa924('0x32')](_0x10008a[_0xa924('0x2d')],qs[_0xa924('0x33')](_0x5542bb['query'][_0xa924('0x33')]));_0x33b035[_0xa924('0x34')]=_0x33b035[_0xa924('0x34')]['length']?_0x33b035[_0xa924('0x34')]:_0x10008a[_0xa924('0x2d')];if(_0x5542bb[_0xa924('0x2f')][_0xa924('0x3d')]){_0x33b035[_0xa924('0x41')]=[{'all':!![]}];}_0x33b035=_[_0xa924('0x3c')]({},_0x33b035,_0x5542bb[_0xa924('0x42')]);return db[_0xa924('0x29')]['find'](_0x33b035)[_0xa924('0x20')](handleEntityNotFound(_0x43fcce,null))[_0xa924('0x20')](respondWithResult(_0x43fcce,null))['catch'](handleError(_0x43fcce,null));};exports[_0xa924('0x43')]=function(_0x26887e,_0x2f9e40){return db[_0xa924('0x29')][_0xa924('0x43')](_0x26887e[_0xa924('0x44')],{})['then'](function(_0x3b596c){var _0x278c1b=_0x26887e[_0xa924('0x45')][_0xa924('0x22')]({'plain':!![]});if(!_0x278c1b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278c1b[_0xa924('0x46')]===_0xa924('0x45')){var _0x39e499=_0x3b596c[_0xa924('0x22')]({'plain':!![]});var _0x17a540=_0xa924('0x47');return db[_0xa924('0x48')][_0xa924('0x49')]({'where':{'name':_0x17a540,'userProfileId':_0x278c1b[_0xa924('0x4a')]},'raw':!![]})[_0xa924('0x20')](function(_0x1e90d4){if(_0x1e90d4&&_0x1e90d4[_0xa924('0x4b')]===0x0){return db[_0xa924('0x4c')][_0xa924('0x43')]({'name':_0x39e499[_0xa924('0x27')],'resourceId':_0x39e499['id'],'type':_0x1e90d4[_0xa924('0x27')],'sectionId':_0x1e90d4['id']},{})[_0xa924('0x20')](function(){return _0x3b596c;});}else{return _0x3b596c;}})[_0xa924('0x3f')](function(_0x4e28a8){logger[_0xa924('0x25')](_0xa924('0x4d'),_0x4e28a8);throw _0x4e28a8;});}return _0x3b596c;})[_0xa924('0x20')](respondWithResult(_0x2f9e40,0xc9))['catch'](handleError(_0x2f9e40,null));};exports['update']=function(_0x27a79b,_0x3d2527){if(_0x27a79b[_0xa924('0x44')]['id']){delete _0x27a79b['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x27a79b['params']['id']}})['then'](handleEntityNotFound(_0x3d2527,null))[_0xa924('0x20')](saveUpdates(_0x27a79b[_0xa924('0x44')],null))['then'](respondWithResult(_0x3d2527,null))[_0xa924('0x3f')](handleError(_0x3d2527,null));};exports['destroy']=function(_0x410491,_0x3844b7){return db['AnalyticExtractedReport'][_0xa924('0x49')]({'where':{'id':_0x410491['params']['id']}})['then'](handleEntityNotFound(_0x3844b7,null))[_0xa924('0x20')](removeEntity(_0x3844b7,null))[_0xa924('0x3f')](handleError(_0x3844b7,null));};exports['download']=function(_0x185970,_0x11a342,_0x2f03bf){return db[_0xa924('0x29')][_0xa924('0x49')]({'where':{'id':_0x185970[_0xa924('0x4e')]['id']},'attributes':['name','basename','savename','output'],'raw':!![]})[_0xa924('0x20')](handleEntityNotFound(_0x11a342,null))[_0xa924('0x20')](function(_0x3b280a){if(_0x3b280a){if(!fs[_0xa924('0x4f')](path[_0xa924('0x50')](config[_0xa924('0x51')],'server/files/reports',_0x3b280a[_0xa924('0x52')]))){throw new db[(_0xa924('0x53'))]['ValidationError'](_0xa924('0x54'));}if(_0x185970['query'][_0xa924('0x55')]){return _0x11a342[_0xa924('0x15')](0xc8);}return _0x11a342[_0xa924('0x56')](path[_0xa924('0x50')](config[_0xa924('0x51')],_0xa924('0x57'),_0x3b280a[_0xa924('0x52')]),util['format'](_0xa924('0x58'),_0x3b280a[_0xa924('0x59')]||_0x3b280a[_0xa924('0x27')],_0x3b280a['output'][_0xa924('0x5a')]()));}})[_0xa924('0x3f')](handleError(_0x11a342,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f8fc116..f9be128 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 _0x01c9=['lodash','api','moment','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x358d16,_0x446177){var _0x308690=function(_0x1fa39e){while(--_0x1fa39e){_0x358d16['push'](_0x358d16['shift']());}};_0x308690(++_0x446177);}(_0x01c9,0x181));var _0x901c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01c9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x901c('0x1'));var moment=require(_0x901c('0x2'));var BPromise=require(_0x901c('0x3'));var rp=require(_0x901c('0x4'));var fs=require('fs');var path=require(_0x901c('0x5'));var rimraf=require(_0x901c('0x6'));var config=require('../../config/environment');var attributes=require(_0x901c('0x7'));module['exports']=function(_0x3f81ca,_0x146795){return _0x3f81ca[_0x901c('0x8')](_0x901c('0x9'),attributes,{'tableName':_0x901c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2be1=['rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','moment','path'];(function(_0x8e6c5b,_0x33e4df){var _0x39e9d3=function(_0x5f0b6f){while(--_0x5f0b6f){_0x8e6c5b['push'](_0x8e6c5b['shift']());}};_0x39e9d3(++_0x33e4df);}(_0x2be1,0x1be));var _0x12be=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x2be1[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0x12be('0x0'));var util=require('util');var logger=require(_0x12be('0x1'))('api');var moment=require(_0x12be('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x12be('0x3'));var rimraf=require(_0x12be('0x4'));var config=require(_0x12be('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0x12be('0x6')]=function(_0x572827,_0x57f0b4){return _0x572827[_0x12be('0x7')](_0x12be('0x8'),attributes,{'tableName':_0x12be('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 8b48932..4a93459 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 _0x60aa=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x478755,_0x3b7f0e){var _0x18d7e5=function(_0x25e21b){while(--_0x25e21b){_0x478755['push'](_0x478755['shift']());}};_0x18d7e5(++_0x3b7f0e);}(_0x60aa,0x13e));var _0xa60a=function(_0x3a3df9,_0x260c41){_0x3a3df9=_0x3a3df9-0x0;var _0x5457e0=_0x60aa[_0x3a3df9];return _0x5457e0;};'use strict';var _=require('lodash');var util=require(_0xa60a('0x0'));var moment=require('moment');var BPromise=require(_0xa60a('0x1'));var rs=require(_0xa60a('0x2'));var fs=require('fs');var Redis=require(_0xa60a('0x3'));var db=require(_0xa60a('0x4'))['db'];var utils=require(_0xa60a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa60a('0x6'));var jayson=require(_0xa60a('0x7'));var client=jayson[_0xa60a('0x8')][_0xa60a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c9cbc,_0x38239e,_0x13bec1){return new BPromise(function(_0x5dc47c,_0x5c2371){return client[_0xa60a('0xa')](_0x5c9cbc,_0x13bec1)[_0xa60a('0xb')](function(_0x37bd78){logger[_0xa60a('0xc')](_0xa60a('0xd'),_0x38239e,_0xa60a('0xe'));logger[_0xa60a('0xf')](_0xa60a('0x10'),_0x38239e,_0xa60a('0xe'),JSON[_0xa60a('0x11')](_0x37bd78));if(_0x37bd78[_0xa60a('0x12')]){if(_0x37bd78['error'][_0xa60a('0x13')]===0x1f4){logger[_0xa60a('0x12')](_0xa60a('0xd'),_0x38239e,_0x37bd78[_0xa60a('0x12')][_0xa60a('0x14')]);return _0x5c2371(_0x37bd78[_0xa60a('0x12')]['message']);}logger[_0xa60a('0x12')](_0xa60a('0xd'),_0x38239e,_0x37bd78[_0xa60a('0x12')]['message']);return _0x5dc47c(_0x37bd78['error'][_0xa60a('0x14')]);}else{logger[_0xa60a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x38239e,_0xa60a('0xe'));_0x5dc47c(_0x37bd78[_0xa60a('0x15')][_0xa60a('0x14')]);}})[_0xa60a('0x16')](function(_0x11556c){logger[_0xa60a('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x38239e,_0x11556c);_0x5c2371(_0x11556c);});});} \ No newline at end of file +var _0x52ae=['lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x460478,_0x4c15d5){var _0x4f91b6=function(_0x4ffa93){while(--_0x4ffa93){_0x460478['push'](_0x460478['shift']());}};_0x4f91b6(++_0x4c15d5);}(_0x52ae,0x18f));var _0xe52a=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0x52ae[_0x403115];return _0x596ef3;};'use strict';var _=require(_0xe52a('0x0'));var util=require(_0xe52a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe52a('0x2'));var db=require(_0xe52a('0x3'))['db'];var utils=require(_0xe52a('0x4'));var logger=require(_0xe52a('0x5'))(_0xe52a('0x6'));var config=require(_0xe52a('0x7'));var jayson=require(_0xe52a('0x8'));var client=jayson[_0xe52a('0x9')][_0xe52a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x570238,_0x55292f,_0x152ce3){return new BPromise(function(_0x29e551,_0x389bb6){return client['request'](_0x570238,_0x152ce3)[_0xe52a('0xb')](function(_0x3a5c31){logger[_0xe52a('0xc')](_0xe52a('0xd'),_0x55292f,'request\x20sent');logger[_0xe52a('0xe')](_0xe52a('0xf'),_0x55292f,'request\x20sent',JSON[_0xe52a('0x10')](_0x3a5c31));if(_0x3a5c31[_0xe52a('0x11')]){if(_0x3a5c31[_0xe52a('0x11')]['code']===0x1f4){logger[_0xe52a('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x55292f,_0x3a5c31['error'][_0xe52a('0x12')]);return _0x389bb6(_0x3a5c31[_0xe52a('0x11')][_0xe52a('0x12')]);}logger[_0xe52a('0x11')](_0xe52a('0xd'),_0x55292f,_0x3a5c31['error'][_0xe52a('0x12')]);return _0x29e551(_0x3a5c31[_0xe52a('0x11')][_0xe52a('0x12')]);}else{logger[_0xe52a('0xc')](_0xe52a('0xd'),_0x55292f,_0xe52a('0x13'));_0x29e551(_0x3a5c31['result'][_0xe52a('0x12')]);}})[_0xe52a('0x14')](function(_0x31763e){logger['error'](_0xe52a('0xd'),_0x55292f,_0x31763e);_0x389bb6(_0x31763e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 63e29b8..703d5d4 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 _0x0c4b=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','download','create','put','delete','destroy','util'];(function(_0x40b508,_0x40ae66){var _0x7772c7=function(_0x138c0b){while(--_0x138c0b){_0x40b508['push'](_0x40b508['shift']());}};_0x7772c7(++_0x40ae66);}(_0x0c4b,0x9f));var _0xb0c4=function(_0x2ba955,_0x580252){_0x2ba955=_0x2ba955-0x0;var _0x3fe3c9=_0x0c4b[_0x2ba955];return _0x3fe3c9;};'use strict';var multer=require('multer');var util=require(_0xb0c4('0x0'));var path=require(_0xb0c4('0x1'));var timeout=require(_0xb0c4('0x2'));var express=require('express');var router=express[_0xb0c4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb0c4('0x4'));var interaction=require(_0xb0c4('0x5'));var config=require('../../config/environment');var controller=require(_0xb0c4('0x6'));router['get']('/',auth[_0xb0c4('0x7')](),controller['index']);router[_0xb0c4('0x8')](_0xb0c4('0x9'),auth[_0xb0c4('0x7')](),controller['show']);router[_0xb0c4('0x8')](_0xb0c4('0xa'),auth[_0xb0c4('0x7')](),controller[_0xb0c4('0xb')]);router['post']('/',auth[_0xb0c4('0x7')](),controller[_0xb0c4('0xc')]);router[_0xb0c4('0xd')](_0xb0c4('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xb0c4('0xe')](_0xb0c4('0x9'),auth[_0xb0c4('0x7')](),controller[_0xb0c4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9649=['isAuthenticated','index','get','show','/:id/download','download','post','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9649,0xdf));var _0x9964=function(_0x38a6f5,_0x5cb7eb){_0x38a6f5=_0x38a6f5-0x0;var _0x456b76=_0x9649[_0x38a6f5];return _0x456b76;};'use strict';var multer=require(_0x9964('0x0'));var util=require(_0x9964('0x1'));var path=require(_0x9964('0x2'));var timeout=require(_0x9964('0x3'));var express=require('express');var router=express[_0x9964('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9964('0x5'));var interaction=require(_0x9964('0x6'));var config=require(_0x9964('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0x9964('0x8')](),controller[_0x9964('0x9')]);router[_0x9964('0xa')]('/:id',auth[_0x9964('0x8')](),controller[_0x9964('0xb')]);router[_0x9964('0xa')](_0x9964('0xc'),auth['isAuthenticated'](),controller[_0x9964('0xd')]);router[_0x9964('0xe')]('/',auth[_0x9964('0x8')](),controller[_0x9964('0xf')]);router['put'](_0x9964('0x10'),auth['isAuthenticated'](),controller[_0x9964('0x11')]);router[_0x9964('0x12')](_0x9964('0x10'),auth[_0x9964('0x8')](),controller[_0x9964('0x13')]);module[_0x9964('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index d1b4c3c..d093d18 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 _0x4cc2=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x391199,_0x3179e4){var _0x2475aa=function(_0x12303a){while(--_0x12303a){_0x391199['push'](_0x391199['shift']());}};_0x2475aa(++_0x3179e4);}(_0x4cc2,0x73));var _0x24cc=function(_0x306081,_0x3bc051){_0x306081=_0x306081-0x0;var _0x31260d=_0x4cc2[_0x306081];return _0x31260d;};'use strict';var Sequelize=require(_0x24cc('0x0'));module[_0x24cc('0x1')]={'field':{'type':Sequelize[_0x24cc('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x24cc('0x3')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x24cc('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x24cc('0x3')]},'custom':{'type':Sequelize[_0x24cc('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x54fb=['STRING','BOOLEAN','exports','TEXT'];(function(_0x272d54,_0x1912a0){var _0x428ecc=function(_0x575e9e){while(--_0x575e9e){_0x272d54['push'](_0x272d54['shift']());}};_0x428ecc(++_0x1912a0);}(_0x54fb,0xca));var _0xb54f=function(_0x357431,_0x464d8c){_0x357431=_0x357431-0x0;var _0x3d80f6=_0x54fb[_0x357431];return _0x3d80f6;};'use strict';var Sequelize=require('sequelize');module[_0xb54f('0x0')]={'field':{'type':Sequelize[_0xb54f('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xb54f('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xb54f('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb54f('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 36f7d96..2a69481 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 _0x97d6=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','then','catch','show','params','includeAll','include','find','create','body','bulkCreate','update','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x504268,_0x191f93){var _0x3b94b8=function(_0x1aaadb){while(--_0x1aaadb){_0x504268['push'](_0x504268['shift']());}};_0x3b94b8(++_0x191f93);}(_0x97d6,0x19c));var _0x697d=function(_0x259c59,_0x56c41d){_0x259c59=_0x259c59-0x0;var _0x360f54=_0x97d6[_0x259c59];return _0x360f54;};'use strict';var emlformat=require(_0x697d('0x0'));var rimraf=require(_0x697d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x697d('0x2'));var rp=require(_0x697d('0x3'));var moment=require(_0x697d('0x4'));var BPromise=require(_0x697d('0x5'));var Mustache=require('mustache');var util=require(_0x697d('0x6'));var path=require(_0x697d('0x7'));var sox=require(_0x697d('0x8'));var csv=require(_0x697d('0x9'));var ejs=require(_0x697d('0xa'));var fs=require('fs');var fs_extra=require(_0x697d('0xb'));var _=require(_0x697d('0xc'));var squel=require(_0x697d('0xd'));var crypto=require(_0x697d('0xe'));var jsforce=require(_0x697d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x697d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x697d('0x10'));var qs=require(_0x697d('0x11'));var as=require(_0x697d('0x12'));var hardwareService=require(_0x697d('0x13'));var logger=require(_0x697d('0x14'))(_0x697d('0x15'));var utils=require(_0x697d('0x16'));var config=require(_0x697d('0x17'));var licenseUtil=require(_0x697d('0x18'));var db=require(_0x697d('0x19'))['db'];function respondWithStatusCode(_0x30adff,_0x116f0b){_0x116f0b=_0x116f0b||0xcc;return function(_0x36836a){if(_0x36836a){return _0x30adff[_0x697d('0x1a')](_0x116f0b);}return _0x30adff[_0x697d('0x1b')](_0x116f0b)[_0x697d('0x1c')]();};}function respondWithResult(_0x275f7d,_0x2df208){_0x2df208=_0x2df208||0xc8;return function(_0x7b3602){if(_0x7b3602){return _0x275f7d[_0x697d('0x1b')](_0x2df208)[_0x697d('0x1d')](_0x7b3602);}};}function respondWithFilteredResult(_0xe3f60a,_0x496505){return function(_0x2a1453){if(_0x2a1453){var _0x21a580=typeof _0x496505[_0x697d('0x1e')]===_0x697d('0x1f')&&typeof _0x496505[_0x697d('0x20')]===_0x697d('0x1f');var _0x36ded0=_0x2a1453['count'];var _0x5ae7ff=_0x21a580?0x0:_0x496505[_0x697d('0x1e')];var _0x59a1fe=_0x21a580?_0x2a1453[_0x697d('0x21')]:_0x496505['offset']+_0x496505['limit'];var _0x27d9bb;if(_0x59a1fe>=_0x36ded0){_0x59a1fe=_0x36ded0;_0x27d9bb=0xc8;}else{_0x27d9bb=0xce;}_0xe3f60a['status'](_0x27d9bb);return _0xe3f60a[_0x697d('0x22')](_0x697d('0x23'),_0x5ae7ff+'-'+_0x59a1fe+'/'+_0x36ded0)[_0x697d('0x1d')](_0x2a1453);}return null;};}function patchUpdates(_0x409bdd){return function(_0x18daba){try{jsonpatch[_0x697d('0x24')](_0x18daba,_0x409bdd,!![]);}catch(_0x547ee8){return BPromise[_0x697d('0x25')](_0x547ee8);}return _0x18daba[_0x697d('0x26')]();};}function saveUpdates(_0x1d3871,_0x4bafe6){return function(_0x349faa){if(_0x349faa){return _0x349faa['update'](_0x1d3871)['then'](function(_0x13ac47){return _0x13ac47;});}return null;};}function removeEntity(_0x5c9b47,_0xea9486){return function(_0x4b4cd5){if(_0x4b4cd5){return _0x4b4cd5['destroy']()['then'](function(){_0x5c9b47[_0x697d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598ff4,_0x2664e9){return function(_0x1fa5a7){if(!_0x1fa5a7){_0x598ff4['sendStatus'](0x194);}return _0x1fa5a7;};}function handleError(_0x19c0b4,_0x2d2c97){_0x2d2c97=_0x2d2c97||0x1f4;return function(_0x3c8321){logger[_0x697d('0x27')](_0x3c8321[_0x697d('0x28')]);if(_0x3c8321[_0x697d('0x29')]){delete _0x3c8321[_0x697d('0x29')];}_0x19c0b4[_0x697d('0x1b')](_0x2d2c97)[_0x697d('0x2a')](_0x3c8321);};}exports[_0x697d('0x2b')]=function(_0x2ddfd3,_0x1736c6){var _0x2cebf5={},_0x5d67f={},_0x13d7d2={'count':0x0,'rows':[]};var _0x2994fc=_['map'](db[_0x697d('0x2c')][_0x697d('0x2d')],function(_0x1864a1){return{'name':_0x1864a1[_0x697d('0x2e')],'type':_0x1864a1[_0x697d('0x2f')]['key']};});_0x5d67f[_0x697d('0x30')]=_[_0x697d('0x31')](_0x2994fc,'name');_0x5d67f['query']=_[_0x697d('0x32')](_0x2ddfd3[_0x697d('0x33')]);_0x5d67f[_0x697d('0x34')]=_[_0x697d('0x35')](_0x5d67f[_0x697d('0x30')],_0x5d67f[_0x697d('0x33')]);_0x2cebf5[_0x697d('0x36')]=_['intersection'](_0x5d67f['model'],qs[_0x697d('0x37')](_0x2ddfd3[_0x697d('0x33')]['fields']));_0x2cebf5[_0x697d('0x36')]=_0x2cebf5[_0x697d('0x36')][_0x697d('0x38')]?_0x2cebf5[_0x697d('0x36')]:_0x5d67f['model'];if(!_0x2ddfd3['query']['hasOwnProperty'](_0x697d('0x39'))){_0x2cebf5[_0x697d('0x20')]=qs[_0x697d('0x20')](_0x2ddfd3[_0x697d('0x33')][_0x697d('0x20')]);_0x2cebf5['offset']=qs[_0x697d('0x1e')](_0x2ddfd3['query'][_0x697d('0x1e')]);}_0x2cebf5[_0x697d('0x3a')]=qs['sort'](_0x2ddfd3[_0x697d('0x33')][_0x697d('0x3b')]);_0x2cebf5[_0x697d('0x3c')]=qs[_0x697d('0x34')](_[_0x697d('0x3d')](_0x2ddfd3[_0x697d('0x33')],_0x5d67f['filters']),_0x2994fc);if(_0x2ddfd3[_0x697d('0x33')][_0x697d('0x3e')]){_0x2cebf5[_0x697d('0x3c')]=_[_0x697d('0x3f')](_0x2cebf5[_0x697d('0x3c')],{'$or':_[_0x697d('0x31')](_0x2994fc,function(_0x1ca5e5){if(_0x1ca5e5[_0x697d('0x2f')]!==_0x697d('0x40')){var _0xdc790c={};_0xdc790c[_0x1ca5e5[_0x697d('0x29')]]={'$like':'%'+_0x2ddfd3['query'][_0x697d('0x3e')]+'%'};return _0xdc790c;}})});}_0x2cebf5=_[_0x697d('0x3f')]({},_0x2cebf5,_0x2ddfd3[_0x697d('0x41')]);var _0x40c597={'where':_0x2cebf5[_0x697d('0x3c')]};return db[_0x697d('0x2c')][_0x697d('0x21')](_0x40c597)['then'](function(_0x18813e){_0x13d7d2[_0x697d('0x21')]=_0x18813e;if(_0x2ddfd3['query']['includeAll']){_0x2cebf5['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x697d('0x42')](_0x2cebf5);})['then'](function(_0x202d17){_0x13d7d2[_0x697d('0x43')]=_0x202d17;return _0x13d7d2;})[_0x697d('0x44')](respondWithFilteredResult(_0x1736c6,_0x2cebf5))[_0x697d('0x45')](handleError(_0x1736c6,null));};exports[_0x697d('0x46')]=function(_0x44fb96,_0x5684ce){var _0x4582d={'raw':![],'where':{'id':_0x44fb96[_0x697d('0x47')]['id']}},_0x3ac8c4={};_0x3ac8c4[_0x697d('0x30')]=_[_0x697d('0x32')](db[_0x697d('0x2c')][_0x697d('0x2d')]);_0x3ac8c4[_0x697d('0x33')]=_[_0x697d('0x32')](_0x44fb96[_0x697d('0x33')]);_0x3ac8c4[_0x697d('0x34')]=_[_0x697d('0x35')](_0x3ac8c4[_0x697d('0x30')],_0x3ac8c4['query']);_0x4582d['attributes']=_[_0x697d('0x35')](_0x3ac8c4[_0x697d('0x30')],qs['fields'](_0x44fb96['query'][_0x697d('0x37')]));_0x4582d[_0x697d('0x36')]=_0x4582d[_0x697d('0x36')][_0x697d('0x38')]?_0x4582d[_0x697d('0x36')]:_0x3ac8c4[_0x697d('0x30')];if(_0x44fb96['query'][_0x697d('0x48')]){_0x4582d[_0x697d('0x49')]=[{'all':!![]}];}_0x4582d=_[_0x697d('0x3f')]({},_0x4582d,_0x44fb96['options']);return db[_0x697d('0x2c')][_0x697d('0x4a')](_0x4582d)['then'](handleEntityNotFound(_0x5684ce,null))['then'](respondWithResult(_0x5684ce,null))[_0x697d('0x45')](handleError(_0x5684ce,null));};exports['create']=function(_0x5b4e4b,_0x2b11c8){return db[_0x697d('0x2c')][_0x697d('0x4b')](_0x5b4e4b[_0x697d('0x4c')],{})[_0x697d('0x44')](respondWithResult(_0x2b11c8,0xc9))[_0x697d('0x45')](handleError(_0x2b11c8,null));};exports[_0x697d('0x4d')]=function(_0x43f9b3,_0x249675){return db['AnalyticFieldReport']['bulkCreate'](_0x43f9b3['body'],{'raw':![],'individualHooks':!![]})[_0x697d('0x44')](respondWithResult(_0x249675,0xc9))[_0x697d('0x45')](handleError(_0x249675,null));};exports[_0x697d('0x4e')]=function(_0x47eb9e,_0x4c68d4){if(_0x47eb9e[_0x697d('0x4c')]['id']){delete _0x47eb9e[_0x697d('0x4c')]['id'];}return db['AnalyticFieldReport'][_0x697d('0x4a')]({'where':{'id':_0x47eb9e[_0x697d('0x47')]['id']}})[_0x697d('0x44')](handleEntityNotFound(_0x4c68d4,null))['then'](saveUpdates(_0x47eb9e[_0x697d('0x4c')],null))[_0x697d('0x44')](respondWithResult(_0x4c68d4,null))[_0x697d('0x45')](handleError(_0x4c68d4,null));};exports[_0x697d('0x4f')]=function(_0x176eca,_0x4a0d34){return db['AnalyticFieldReport'][_0x697d('0x4a')]({'where':{'id':_0x176eca[_0x697d('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a0d34,null))['then'](removeEntity(_0x4a0d34,null))['catch'](handleError(_0x4a0d34,null));};exports[_0x697d('0x50')]=function(_0x1bd4cc,_0x507ce1){return db['AnalyticFieldReport'][_0x697d('0x4f')]({'where':{'id':_0x1bd4cc[_0x697d('0x33')][_0x697d('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x697d('0x44')](respondWithResult(_0x507ce1,0xcc))['catch'](handleError(_0x507ce1,null));};exports[_0x697d('0x52')]=function(_0x2789e7,_0x3d9fc2,_0x3d90fa){return db[_0x697d('0x53')][_0x697d('0x54')]({'where':{'id':_0x2789e7['params']['id']}})[_0x697d('0x44')](handleEntityNotFound(_0x3d9fc2,null))[_0x697d('0x44')](function(_0x4e988f){if(_0x4e988f){return db[_0x697d('0x55')]['transaction'](function(_0x10c792){return db[_0x697d('0x2c')][_0x697d('0x4f')]({'where':{'CustomReportId':_0x2789e7[_0x697d('0x47')]['id']},'transaction':_0x10c792})['then'](function(_0x27b515){var _0x1b4543=_[_0x697d('0x31')](_0x2789e7[_0x697d('0x4c')],function(_0x530c00){delete _0x530c00['id'];_0x530c00[_0x697d('0x56')]=_0x2789e7[_0x697d('0x47')]['id'];return _0x530c00;});return db[_0x697d('0x2c')][_0x697d('0x4d')](_0x1b4543,{'transaction':_0x10c792});});})[_0x697d('0x44')](function(){return db[_0x697d('0x2c')][_0x697d('0x42')]({'where':{'CustomReportId':_0x2789e7[_0x697d('0x47')]['id']}});});}})[_0x697d('0x44')](respondWithResult(_0x3d9fc2,null))[_0x697d('0x45')](handleError(_0x3d9fc2,null));}; \ No newline at end of file +var _0x3d68=['includeAll','include','findAll','rows','catch','show','create','bulkCreate','body','update','find','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','name','send','map','AnalyticFieldReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options'];(function(_0x436b9d,_0x58a51f){var _0x2b1c2a=function(_0x28f305){while(--_0x28f305){_0x436b9d['push'](_0x436b9d['shift']());}};_0x2b1c2a(++_0x58a51f);}(_0x3d68,0x107));var _0x83d6=function(_0x7d8d12,_0x36b609){_0x7d8d12=_0x7d8d12-0x0;var _0xe69896=_0x3d68[_0x7d8d12];return _0xe69896;};'use strict';var emlformat=require(_0x83d6('0x0'));var rimraf=require(_0x83d6('0x1'));var zipdir=require(_0x83d6('0x2'));var jsonpatch=require(_0x83d6('0x3'));var rp=require(_0x83d6('0x4'));var moment=require(_0x83d6('0x5'));var BPromise=require(_0x83d6('0x6'));var Mustache=require('mustache');var util=require(_0x83d6('0x7'));var path=require('path');var sox=require(_0x83d6('0x8'));var csv=require(_0x83d6('0x9'));var ejs=require(_0x83d6('0xa'));var fs=require('fs');var fs_extra=require(_0x83d6('0xb'));var _=require('lodash');var squel=require(_0x83d6('0xc'));var crypto=require(_0x83d6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x83d6('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83d6('0xf'));var Redis=require(_0x83d6('0x10'));var authService=require(_0x83d6('0x11'));var qs=require(_0x83d6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x83d6('0x13'));var utils=require(_0x83d6('0x14'));var config=require(_0x83d6('0x15'));var licenseUtil=require(_0x83d6('0x16'));var db=require(_0x83d6('0x17'))['db'];function respondWithStatusCode(_0x10e668,_0xf7cceb){_0xf7cceb=_0xf7cceb||0xcc;return function(_0x400b19){if(_0x400b19){return _0x10e668[_0x83d6('0x18')](_0xf7cceb);}return _0x10e668[_0x83d6('0x19')](_0xf7cceb)['end']();};}function respondWithResult(_0x3aed8e,_0x5ca995){_0x5ca995=_0x5ca995||0xc8;return function(_0x1d8ac0){if(_0x1d8ac0){return _0x3aed8e[_0x83d6('0x19')](_0x5ca995)[_0x83d6('0x1a')](_0x1d8ac0);}};}function respondWithFilteredResult(_0x59c4c4,_0xdcd2ba){return function(_0x346e2a){if(_0x346e2a){var _0x2b8860=typeof _0xdcd2ba[_0x83d6('0x1b')]===_0x83d6('0x1c')&&typeof _0xdcd2ba[_0x83d6('0x1d')]===_0x83d6('0x1c');var _0x5bdf16=_0x346e2a[_0x83d6('0x1e')];var _0x8a7ece=_0x2b8860?0x0:_0xdcd2ba[_0x83d6('0x1b')];var _0x21a7ed=_0x2b8860?_0x346e2a[_0x83d6('0x1e')]:_0xdcd2ba[_0x83d6('0x1b')]+_0xdcd2ba[_0x83d6('0x1d')];var _0x2f6e3e;if(_0x21a7ed>=_0x5bdf16){_0x21a7ed=_0x5bdf16;_0x2f6e3e=0xc8;}else{_0x2f6e3e=0xce;}_0x59c4c4[_0x83d6('0x19')](_0x2f6e3e);return _0x59c4c4[_0x83d6('0x1f')](_0x83d6('0x20'),_0x8a7ece+'-'+_0x21a7ed+'/'+_0x5bdf16)[_0x83d6('0x1a')](_0x346e2a);}return null;};}function patchUpdates(_0x5c6c54){return function(_0x3dca73){try{jsonpatch[_0x83d6('0x21')](_0x3dca73,_0x5c6c54,!![]);}catch(_0x256f6a){return BPromise[_0x83d6('0x22')](_0x256f6a);}return _0x3dca73['save']();};}function saveUpdates(_0x3991ca,_0x24c19a){return function(_0x46a97a){if(_0x46a97a){return _0x46a97a['update'](_0x3991ca)[_0x83d6('0x23')](function(_0x32cfb9){return _0x32cfb9;});}return null;};}function removeEntity(_0x1a81c8,_0x2affa6){return function(_0x3d6e94){if(_0x3d6e94){return _0x3d6e94[_0x83d6('0x24')]()[_0x83d6('0x23')](function(){_0x1a81c8['status'](0xcc)[_0x83d6('0x25')]();});}};}function handleEntityNotFound(_0x388e8e,_0x24261d){return function(_0x5cc9f4){if(!_0x5cc9f4){_0x388e8e[_0x83d6('0x18')](0x194);}return _0x5cc9f4;};}function handleError(_0x281721,_0x1322e0){_0x1322e0=_0x1322e0||0x1f4;return function(_0x1eb303){logger['error'](_0x1eb303['stack']);if(_0x1eb303[_0x83d6('0x26')]){delete _0x1eb303[_0x83d6('0x26')];}_0x281721[_0x83d6('0x19')](_0x1322e0)[_0x83d6('0x27')](_0x1eb303);};}exports['index']=function(_0x32b11b,_0xadd7fb){var _0x4cf1a5={},_0x5241f0={},_0xf184b7={'count':0x0,'rows':[]};var _0x20364a=_[_0x83d6('0x28')](db[_0x83d6('0x29')][_0x83d6('0x2a')],function(_0x3d7b25){return{'name':_0x3d7b25['fieldName'],'type':_0x3d7b25['type']['key']};});_0x5241f0[_0x83d6('0x2b')]=_['map'](_0x20364a,_0x83d6('0x26'));_0x5241f0[_0x83d6('0x2c')]=_[_0x83d6('0x2d')](_0x32b11b['query']);_0x5241f0[_0x83d6('0x2e')]=_['intersection'](_0x5241f0['model'],_0x5241f0['query']);_0x4cf1a5[_0x83d6('0x2f')]=_[_0x83d6('0x30')](_0x5241f0[_0x83d6('0x2b')],qs['fields'](_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x31')]));_0x4cf1a5[_0x83d6('0x2f')]=_0x4cf1a5['attributes'][_0x83d6('0x32')]?_0x4cf1a5[_0x83d6('0x2f')]:_0x5241f0['model'];if(!_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x33')](_0x83d6('0x34'))){_0x4cf1a5[_0x83d6('0x1d')]=qs[_0x83d6('0x1d')](_0x32b11b['query'][_0x83d6('0x1d')]);_0x4cf1a5['offset']=qs[_0x83d6('0x1b')](_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x1b')]);}_0x4cf1a5[_0x83d6('0x35')]=qs[_0x83d6('0x36')](_0x32b11b['query']['sort']);_0x4cf1a5['where']=qs['filters'](_[_0x83d6('0x37')](_0x32b11b[_0x83d6('0x2c')],_0x5241f0['filters']),_0x20364a);if(_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x38')]){_0x4cf1a5[_0x83d6('0x39')]=_[_0x83d6('0x3a')](_0x4cf1a5[_0x83d6('0x39')],{'$or':_[_0x83d6('0x28')](_0x20364a,function(_0x3e3f4c){if(_0x3e3f4c[_0x83d6('0x3b')]!=='VIRTUAL'){var _0x88bb2f={};_0x88bb2f[_0x3e3f4c[_0x83d6('0x26')]]={'$like':'%'+_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x38')]+'%'};return _0x88bb2f;}})});}_0x4cf1a5=_[_0x83d6('0x3a')]({},_0x4cf1a5,_0x32b11b[_0x83d6('0x3c')]);var _0x1b9c27={'where':_0x4cf1a5[_0x83d6('0x39')]};return db['AnalyticFieldReport'][_0x83d6('0x1e')](_0x1b9c27)[_0x83d6('0x23')](function(_0x3c74a7){_0xf184b7[_0x83d6('0x1e')]=_0x3c74a7;if(_0x32b11b[_0x83d6('0x2c')][_0x83d6('0x3d')]){_0x4cf1a5[_0x83d6('0x3e')]=[{'all':!![]}];}return db[_0x83d6('0x29')][_0x83d6('0x3f')](_0x4cf1a5);})[_0x83d6('0x23')](function(_0x2159c1){_0xf184b7[_0x83d6('0x40')]=_0x2159c1;return _0xf184b7;})[_0x83d6('0x23')](respondWithFilteredResult(_0xadd7fb,_0x4cf1a5))[_0x83d6('0x41')](handleError(_0xadd7fb,null));};exports[_0x83d6('0x42')]=function(_0x5241dd,_0x304f2e){var _0x2cd890={'raw':![],'where':{'id':_0x5241dd['params']['id']}},_0x44b5db={};_0x44b5db[_0x83d6('0x2b')]=_['keys'](db[_0x83d6('0x29')][_0x83d6('0x2a')]);_0x44b5db['query']=_['keys'](_0x5241dd[_0x83d6('0x2c')]);_0x44b5db[_0x83d6('0x2e')]=_[_0x83d6('0x30')](_0x44b5db[_0x83d6('0x2b')],_0x44b5db[_0x83d6('0x2c')]);_0x2cd890[_0x83d6('0x2f')]=_[_0x83d6('0x30')](_0x44b5db['model'],qs['fields'](_0x5241dd['query'][_0x83d6('0x31')]));_0x2cd890['attributes']=_0x2cd890[_0x83d6('0x2f')][_0x83d6('0x32')]?_0x2cd890[_0x83d6('0x2f')]:_0x44b5db[_0x83d6('0x2b')];if(_0x5241dd['query'][_0x83d6('0x3d')]){_0x2cd890[_0x83d6('0x3e')]=[{'all':!![]}];}_0x2cd890=_['merge']({},_0x2cd890,_0x5241dd[_0x83d6('0x3c')]);return db[_0x83d6('0x29')]['find'](_0x2cd890)[_0x83d6('0x23')](handleEntityNotFound(_0x304f2e,null))[_0x83d6('0x23')](respondWithResult(_0x304f2e,null))[_0x83d6('0x41')](handleError(_0x304f2e,null));};exports[_0x83d6('0x43')]=function(_0x5f0b12,_0x1f7fc0){return db[_0x83d6('0x29')][_0x83d6('0x43')](_0x5f0b12['body'],{})[_0x83d6('0x23')](respondWithResult(_0x1f7fc0,0xc9))[_0x83d6('0x41')](handleError(_0x1f7fc0,null));};exports[_0x83d6('0x44')]=function(_0x3ec8b6,_0x27cb2a){return db[_0x83d6('0x29')][_0x83d6('0x44')](_0x3ec8b6[_0x83d6('0x45')],{'raw':![],'individualHooks':!![]})[_0x83d6('0x23')](respondWithResult(_0x27cb2a,0xc9))[_0x83d6('0x41')](handleError(_0x27cb2a,null));};exports[_0x83d6('0x46')]=function(_0x1ae248,_0x5ed6c1){if(_0x1ae248[_0x83d6('0x45')]['id']){delete _0x1ae248[_0x83d6('0x45')]['id'];}return db[_0x83d6('0x29')][_0x83d6('0x47')]({'where':{'id':_0x1ae248[_0x83d6('0x48')]['id']}})['then'](handleEntityNotFound(_0x5ed6c1,null))[_0x83d6('0x23')](saveUpdates(_0x1ae248[_0x83d6('0x45')],null))[_0x83d6('0x23')](respondWithResult(_0x5ed6c1,null))[_0x83d6('0x41')](handleError(_0x5ed6c1,null));};exports[_0x83d6('0x24')]=function(_0x4c4a81,_0x491df7){return db[_0x83d6('0x29')][_0x83d6('0x47')]({'where':{'id':_0x4c4a81[_0x83d6('0x48')]['id']}})[_0x83d6('0x23')](handleEntityNotFound(_0x491df7,null))[_0x83d6('0x23')](removeEntity(_0x491df7,null))['catch'](handleError(_0x491df7,null));};exports[_0x83d6('0x49')]=function(_0x16af9c,_0x255ccb){return db[_0x83d6('0x29')][_0x83d6('0x24')]({'where':{'id':_0x16af9c[_0x83d6('0x2c')][_0x83d6('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x255ccb,0xcc))[_0x83d6('0x41')](handleError(_0x255ccb,null));};exports[_0x83d6('0x4b')]=function(_0xdf8bf9,_0x1cf661,_0x563dff){return db[_0x83d6('0x4c')][_0x83d6('0x4d')]({'where':{'id':_0xdf8bf9['params']['id']}})[_0x83d6('0x23')](handleEntityNotFound(_0x1cf661,null))[_0x83d6('0x23')](function(_0x22cc75){if(_0x22cc75){return db[_0x83d6('0x4e')][_0x83d6('0x4f')](function(_0x294e3a){return db[_0x83d6('0x29')][_0x83d6('0x24')]({'where':{'CustomReportId':_0xdf8bf9[_0x83d6('0x48')]['id']},'transaction':_0x294e3a})[_0x83d6('0x23')](function(_0x1aae4e){var _0x451594=_[_0x83d6('0x28')](_0xdf8bf9[_0x83d6('0x45')],function(_0x167425){delete _0x167425['id'];_0x167425[_0x83d6('0x50')]=_0xdf8bf9[_0x83d6('0x48')]['id'];return _0x167425;});return db[_0x83d6('0x29')][_0x83d6('0x44')](_0x451594,{'transaction':_0x294e3a});});})[_0x83d6('0x23')](function(){return db[_0x83d6('0x29')]['findAll']({'where':{'CustomReportId':_0xdf8bf9[_0x83d6('0x48')]['id']}});});}})[_0x83d6('0x23')](respondWithResult(_0x1cf661,null))[_0x83d6('0x41')](handleError(_0x1cf661,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ea67fd0..9be4279 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 _0x028f=['analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x236cea,_0x3fb18d){var _0x32938b=function(_0x219a1f){while(--_0x219a1f){_0x236cea['push'](_0x236cea['shift']());}};_0x32938b(++_0x3fb18d);}(_0x028f,0x109));var _0xf028=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x028f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf028('0x0'));var util=require(_0xf028('0x1'));var logger=require(_0xf028('0x2'))(_0xf028('0x3'));var moment=require('moment');var BPromise=require(_0xf028('0x4'));var rp=require(_0xf028('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf028('0x6'));var config=require('../../config/environment');var attributes=require(_0xf028('0x7'));module[_0xf028('0x8')]=function(_0x45319e,_0x3e0ebb){return _0x45319e[_0xf028('0x9')](_0xf028('0xa'),attributes,{'tableName':_0xf028('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe86d=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4165aa,_0xf9dd5c){var _0x4f2a3d=function(_0x1842b4){while(--_0x1842b4){_0x4165aa['push'](_0x4165aa['shift']());}};_0x4f2a3d(++_0xf9dd5c);}(_0xe86d,0xee));var _0xde86=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe86d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xde86('0x0'));var util=require(_0xde86('0x1'));var logger=require(_0xde86('0x2'))(_0xde86('0x3'));var moment=require(_0xde86('0x4'));var BPromise=require(_0xde86('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde86('0x6'));var rimraf=require(_0xde86('0x7'));var config=require(_0xde86('0x8'));var attributes=require(_0xde86('0x9'));module[_0xde86('0xa')]=function(_0x1a68f4,_0xc461e9){return _0x1a68f4['define'](_0xde86('0xb'),attributes,{'tableName':_0xde86('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 9af6935..1a05e86 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 _0x2c6b=['bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x551146,_0x272ebf){var _0x3894f6=function(_0x368e63){while(--_0x368e63){_0x551146['push'](_0x551146['shift']());}};_0x3894f6(++_0x272ebf);}(_0x2c6b,0x18c));var _0xb2c6=function(_0x2140ae,_0x276645){_0x2140ae=_0x2140ae-0x0;var _0x33ccc7=_0x2c6b[_0x2140ae];return _0x33ccc7;};'use strict';var _=require(_0xb2c6('0x0'));var util=require(_0xb2c6('0x1'));var moment=require(_0xb2c6('0x2'));var BPromise=require(_0xb2c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2c6('0x4'));var logger=require(_0xb2c6('0x5'))('rpc');var config=require(_0xb2c6('0x6'));var jayson=require(_0xb2c6('0x7'));var client=jayson[_0xb2c6('0x8')][_0xb2c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41fa86,_0xbcc5ac,_0x420c93){return new BPromise(function(_0x405639,_0x595b13){return client[_0xb2c6('0xa')](_0x41fa86,_0x420c93)[_0xb2c6('0xb')](function(_0x30ffd4){logger[_0xb2c6('0xc')](_0xb2c6('0xd'),_0xbcc5ac,_0xb2c6('0xe'));logger[_0xb2c6('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xbcc5ac,'request\x20sent',JSON['stringify'](_0x30ffd4));if(_0x30ffd4[_0xb2c6('0x10')]){if(_0x30ffd4[_0xb2c6('0x10')][_0xb2c6('0x11')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xbcc5ac,_0x30ffd4[_0xb2c6('0x10')][_0xb2c6('0x12')]);return _0x595b13(_0x30ffd4[_0xb2c6('0x10')][_0xb2c6('0x12')]);}logger[_0xb2c6('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xbcc5ac,_0x30ffd4[_0xb2c6('0x10')]['message']);return _0x405639(_0x30ffd4[_0xb2c6('0x10')][_0xb2c6('0x12')]);}else{logger[_0xb2c6('0xc')](_0xb2c6('0xd'),_0xbcc5ac,_0xb2c6('0xe'));_0x405639(_0x30ffd4[_0xb2c6('0x13')][_0xb2c6('0x12')]);}})[_0xb2c6('0x14')](function(_0x214062){logger[_0xb2c6('0x10')](_0xb2c6('0xd'),_0xbcc5ac,_0x214062);_0x595b13(_0x214062);});});} \ No newline at end of file +var _0x24e0=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x24e0,0xfb));var _0x024e=function(_0x257137,_0x52a6f4){_0x257137=_0x257137-0x0;var _0x4c16a8=_0x24e0[_0x257137];return _0x4c16a8;};'use strict';var _=require('lodash');var util=require(_0x024e('0x0'));var moment=require(_0x024e('0x1'));var BPromise=require('bluebird');var rs=require(_0x024e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x024e('0x3'))['db'];var utils=require(_0x024e('0x4'));var logger=require(_0x024e('0x5'))('rpc');var config=require(_0x024e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x024e('0x7')][_0x024e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4adaf3,_0x405d99,_0x461f1b){return new BPromise(function(_0x7a4f0a,_0x48fee0){return client[_0x024e('0x9')](_0x4adaf3,_0x461f1b)['then'](function(_0x5c00ad){logger[_0x024e('0xa')](_0x024e('0xb'),_0x405d99,_0x024e('0xc'));logger['debug'](_0x024e('0xd'),_0x405d99,_0x024e('0xc'),JSON[_0x024e('0xe')](_0x5c00ad));if(_0x5c00ad[_0x024e('0xf')]){if(_0x5c00ad[_0x024e('0xf')]['code']===0x1f4){logger[_0x024e('0xf')](_0x024e('0xb'),_0x405d99,_0x5c00ad[_0x024e('0xf')][_0x024e('0x10')]);return _0x48fee0(_0x5c00ad[_0x024e('0xf')]['message']);}logger[_0x024e('0xf')](_0x024e('0xb'),_0x405d99,_0x5c00ad[_0x024e('0xf')][_0x024e('0x10')]);return _0x7a4f0a(_0x5c00ad[_0x024e('0xf')]['message']);}else{logger[_0x024e('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x405d99,_0x024e('0xc'));_0x7a4f0a(_0x5c00ad['result'][_0x024e('0x10')]);}})[_0x024e('0x11')](function(_0xa22ae7){logger[_0x024e('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x405d99,_0xa22ae7);_0x48fee0(_0xa22ae7);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 85b00d1..a8ee5bb 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(_0x194a35,_0x3c69a6){var _0x36281c=function(_0x5040a8){while(--_0x5040a8){_0x194a35['push'](_0x194a35['shift']());}};_0x36281c(++_0x3c69a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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(_0x1dc854,_0x4a04b7){var _0x2e3dbc=function(_0x19422b){while(--_0x19422b){_0x1dc854['push'](_0x1dc854['shift']());}};_0x2e3dbc(++_0x4a04b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 50008ed..d091a11 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 _0x12c9=['STRING','sequelize'];(function(_0x43dc68,_0xbb4bc9){var _0x380746=function(_0x5a2400){while(--_0x5a2400){_0x43dc68['push'](_0x43dc68['shift']());}};_0x380746(++_0xbb4bc9);}(_0x12c9,0x9f));var _0x912c=function(_0x259ca6,_0x32bd8a){_0x259ca6=_0x259ca6-0x0;var _0x211d9f=_0x12c9[_0x259ca6];return _0x211d9f;};'use strict';var Sequelize=require(_0x912c('0x0'));module['exports']={'name':{'type':Sequelize[_0x912c('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x912c('0x1')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x912c('0x1')]}}; \ No newline at end of file +var _0x6947=['STRING','TEXT','exports','name'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x6947,0x72));var _0x7694=function(_0x56d1d5,_0x404591){_0x56d1d5=_0x56d1d5-0x0;var _0x3c679a=_0x6947[_0x56d1d5];return _0x3c679a;};'use strict';var Sequelize=require('sequelize');module[_0x7694('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7694('0x1')},'table':{'type':Sequelize[_0x7694('0x2')]},'metric':{'type':Sequelize[_0x7694('0x3')]},'description':{'type':Sequelize[_0x7694('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 667c18a..742b7da 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 _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x28fa58,_0x750017){var _0x578725=function(_0x40c6b0){while(--_0x40c6b0){_0x28fa58['push'](_0x28fa58['shift']());}};_0x578725(++_0x750017);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xa9430,_0x14f536){_0xa9430=_0xa9430-0x0;var _0x220b68=_0x7fbe[_0xa9430];return _0x220b68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file +var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x487c4b,_0x1dc750){var _0x1ac3bd=function(_0x60737b){while(--_0x60737b){_0x487c4b['push'](_0x487c4b['shift']());}};_0x1ac3bd(++_0x1dc750);}(_0x55ca,0x126));var _0xa55c=function(_0x3457b4,_0x4cd8f9){_0x3457b4=_0x3457b4-0x0;var _0xaa8fa9=_0x55ca[_0x3457b4];return _0xaa8fa9;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 66c791d..f4256d2 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 _0xf13b=['analytics_metrics','lodash','moment','bluebird','request-promise','path','./analyticMetric.attributes','exports','define'];(function(_0x364044,_0x2a1b0c){var _0x2fd0af=function(_0x14ee07){while(--_0x14ee07){_0x364044['push'](_0x364044['shift']());}};_0x2fd0af(++_0x2a1b0c);}(_0xf13b,0x1f0));var _0xbf13=function(_0x4ba547,_0x5bd5ad){_0x4ba547=_0x4ba547-0x0;var _0x5e7874=_0xf13b[_0x4ba547];return _0x5e7874;};'use strict';var _=require(_0xbf13('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbf13('0x1'));var BPromise=require(_0xbf13('0x2'));var rp=require(_0xbf13('0x3'));var fs=require('fs');var path=require(_0xbf13('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf13('0x5'));module[_0xbf13('0x6')]=function(_0x5f4b13,_0x325b03){return _0x5f4b13[_0xbf13('0x7')]('AnalyticMetric',attributes,{'tableName':_0xbf13('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3d8=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0xd216a4,_0x206e25){var _0x221c23=function(_0x317d5d){while(--_0x317d5d){_0xd216a4['push'](_0xd216a4['shift']());}};_0x221c23(++_0x206e25);}(_0xb3d8,0xdc));var _0x8b3d=function(_0x3e7da5,_0x3a927e){_0x3e7da5=_0x3e7da5-0x0;var _0x42030a=_0xb3d8[_0x3e7da5];return _0x42030a;};'use strict';var _=require('lodash');var util=require(_0x8b3d('0x0'));var logger=require(_0x8b3d('0x1'))(_0x8b3d('0x2'));var moment=require(_0x8b3d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b3d('0x4'));var rimraf=require(_0x8b3d('0x5'));var config=require(_0x8b3d('0x6'));var attributes=require(_0x8b3d('0x7'));module[_0x8b3d('0x8')]=function(_0x22d97b,_0x3b0f04){return _0x22d97b[_0x8b3d('0x9')](_0x8b3d('0xa'),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 dd98279..d135ffe 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 _0x8811=['rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x8811,0x98));var _0x1881=function(_0x180efc,_0x75ba6b){_0x180efc=_0x180efc-0x0;var _0xc4722f=_0x8811[_0x180efc];return _0xc4722f;};'use strict';var _=require(_0x1881('0x0'));var util=require(_0x1881('0x1'));var moment=require(_0x1881('0x2'));var BPromise=require(_0x1881('0x3'));var rs=require(_0x1881('0x4'));var fs=require('fs');var Redis=require(_0x1881('0x5'));var db=require(_0x1881('0x6'))['db'];var utils=require(_0x1881('0x7'));var logger=require(_0x1881('0x8'))(_0x1881('0x9'));var config=require(_0x1881('0xa'));var jayson=require(_0x1881('0xb'));var client=jayson['client'][_0x1881('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e451f,_0x27ad22,_0x3f4072){return new BPromise(function(_0x248d14,_0x1c49db){return client[_0x1881('0xd')](_0x1e451f,_0x3f4072)['then'](function(_0x425103){logger[_0x1881('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x27ad22,_0x1881('0xf'));logger[_0x1881('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x27ad22,_0x1881('0xf'),JSON[_0x1881('0x11')](_0x425103));if(_0x425103[_0x1881('0x12')]){if(_0x425103[_0x1881('0x12')][_0x1881('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x27ad22,_0x425103[_0x1881('0x12')][_0x1881('0x14')]);return _0x1c49db(_0x425103[_0x1881('0x12')][_0x1881('0x14')]);}logger[_0x1881('0x12')](_0x1881('0x15'),_0x27ad22,_0x425103[_0x1881('0x12')][_0x1881('0x14')]);return _0x248d14(_0x425103[_0x1881('0x12')][_0x1881('0x14')]);}else{logger[_0x1881('0xe')]('AnalyticMetric,\x20%s,\x20%s',_0x27ad22,_0x1881('0xf'));_0x248d14(_0x425103[_0x1881('0x16')][_0x1881('0x14')]);}})['catch'](function(_0x25dc14){logger[_0x1881('0x12')](_0x1881('0x15'),_0x27ad22,_0x25dc14);_0x1c49db(_0x25dc14);});});} \ No newline at end of file +var _0xcebe=['client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x14a8af,_0x334db6){var _0x1a278c=function(_0x360d88){while(--_0x360d88){_0x14a8af['push'](_0x14a8af['shift']());}};_0x1a278c(++_0x334db6);}(_0xcebe,0xae));var _0xeceb=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xcebe[_0x6131cd];return _0x47e916;};'use strict';var _=require('lodash');var util=require(_0xeceb('0x0'));var moment=require(_0xeceb('0x1'));var BPromise=require(_0xeceb('0x2'));var rs=require(_0xeceb('0x3'));var fs=require('fs');var Redis=require(_0xeceb('0x4'));var db=require(_0xeceb('0x5'))['db'];var utils=require(_0xeceb('0x6'));var logger=require(_0xeceb('0x7'))('rpc');var config=require(_0xeceb('0x8'));var jayson=require(_0xeceb('0x9'));var client=jayson[_0xeceb('0xa')][_0xeceb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12765a,_0x592a79,_0x186b95){return new BPromise(function(_0x57730a,_0x35ba16){return client['request'](_0x12765a,_0x186b95)[_0xeceb('0xc')](function(_0x12efe1){logger[_0xeceb('0xd')](_0xeceb('0xe'),_0x592a79,_0xeceb('0xf'));logger[_0xeceb('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x592a79,_0xeceb('0xf'),JSON[_0xeceb('0x11')](_0x12efe1));if(_0x12efe1[_0xeceb('0x12')]){if(_0x12efe1[_0xeceb('0x12')][_0xeceb('0x13')]===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x592a79,_0x12efe1[_0xeceb('0x12')][_0xeceb('0x14')]);return _0x35ba16(_0x12efe1[_0xeceb('0x12')][_0xeceb('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x592a79,_0x12efe1[_0xeceb('0x12')]['message']);return _0x57730a(_0x12efe1[_0xeceb('0x12')][_0xeceb('0x14')]);}else{logger['info'](_0xeceb('0xe'),_0x592a79,_0xeceb('0xf'));_0x57730a(_0x12efe1[_0xeceb('0x15')]['message']);}})[_0xeceb('0x16')](function(_0x3bbe7b){logger['error'](_0xeceb('0xe'),_0x592a79,_0x3bbe7b);_0x35ba16(_0x3bbe7b);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 5c9d832..361075e 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 _0x5a63=['put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','isAuthenticated','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a63,0xe3));var _0x35a6=function(_0x567d88,_0x2df23e){_0x567d88=_0x567d88-0x0;var _0x3653cd=_0x5a63[_0x567d88];return _0x3653cd;};'use strict';var multer=require(_0x35a6('0x0'));var util=require(_0x35a6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x35a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x35a6('0x3'));var interaction=require(_0x35a6('0x4'));var config=require(_0x35a6('0x5'));var controller=require(_0x35a6('0x6'));router[_0x35a6('0x7')]('/',auth['isAuthenticated'](),controller[_0x35a6('0x8')]);router['get'](_0x35a6('0x9'),auth['isAuthenticated'](),controller[_0x35a6('0xa')]);router['post']('/',auth[_0x35a6('0xb')](),controller[_0x35a6('0xc')]);router[_0x35a6('0xd')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['update']);router[_0x35a6('0xe')](_0x35a6('0x9'),auth[_0x35a6('0xb')](),controller['destroy']);module[_0x35a6('0xf')]=router; \ No newline at end of file +var _0xd13e=['show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd13e,0x193));var _0xed13=function(_0x17cf09,_0x27d006){_0x17cf09=_0x17cf09-0x0;var _0xf46a3e=_0xd13e[_0x17cf09];return _0xf46a3e;};'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('0xc')]('/',auth[_0xed13('0xa')](),controller[_0xed13('0xd')]);router[_0xed13('0xe')](_0xed13('0x9'),auth['isAuthenticated'](),controller[_0xed13('0xf')]);router[_0xed13('0x10')](_0xed13('0x9'),auth[_0xed13('0xa')](),controller[_0xed13('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index eb52173..4f98aab 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 _0xadd3=['sequelize','exports'];(function(_0x48c69d,_0x59fdca){var _0x586c35=function(_0x2ef148){while(--_0x2ef148){_0x48c69d['push'](_0x48c69d['shift']());}};_0x586c35(++_0x59fdca);}(_0xadd3,0x13a));var _0x3add=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xadd3[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0x3add('0x0'));module[_0x3add('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x7b14=['TEXT','sequelize'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x7b14,0x1b5));var _0x47b1=function(_0x45c6ed,_0x358d6a){_0x45c6ed=_0x45c6ed-0x0;var _0x4a90d4=_0x7b14[_0x45c6ed];return _0x4a90d4;};'use strict';var Sequelize=require(_0x47b1('0x0'));module['exports']={'tree':{'type':Sequelize[_0x47b1('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c45a442..f1beff1 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 _0x4bed=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','error','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','rows','show','params','keys','catch','create','body','update','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x30df91,_0x1345c9){var _0x39923c=function(_0xeba13){while(--_0xeba13){_0x30df91['push'](_0x30df91['shift']());}};_0x39923c(++_0x1345c9);}(_0x4bed,0x107));var _0xd4be=function(_0x3a8052,_0x1de359){_0x3a8052=_0x3a8052-0x0;var _0x3220bb=_0x4bed[_0x3a8052];return _0x3220bb;};'use strict';var emlformat=require(_0xd4be('0x0'));var rimraf=require(_0xd4be('0x1'));var zipdir=require(_0xd4be('0x2'));var jsonpatch=require(_0xd4be('0x3'));var rp=require(_0xd4be('0x4'));var moment=require('moment');var BPromise=require(_0xd4be('0x5'));var Mustache=require(_0xd4be('0x6'));var util=require(_0xd4be('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xd4be('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd4be('0x9'));var crypto=require(_0xd4be('0xa'));var jsforce=require(_0xd4be('0xb'));var deskjs=require(_0xd4be('0xc'));var toCsv=require(_0xd4be('0x8'));var querystring=require(_0xd4be('0xd'));var Papa=require(_0xd4be('0xe'));var Redis=require(_0xd4be('0xf'));var authService=require(_0xd4be('0x10'));var qs=require(_0xd4be('0x11'));var as=require(_0xd4be('0x12'));var hardwareService=require(_0xd4be('0x13'));var logger=require(_0xd4be('0x14'))(_0xd4be('0x15'));var utils=require(_0xd4be('0x16'));var config=require(_0xd4be('0x17'));var licenseUtil=require(_0xd4be('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ce887,_0x12581c){_0x12581c=_0x12581c||0xcc;return function(_0x19c1a3){if(_0x19c1a3){return _0x4ce887[_0xd4be('0x19')](_0x12581c);}return _0x4ce887[_0xd4be('0x1a')](_0x12581c)[_0xd4be('0x1b')]();};}function respondWithResult(_0x529c6d,_0x28dbd5){_0x28dbd5=_0x28dbd5||0xc8;return function(_0x335a53){if(_0x335a53){return _0x529c6d[_0xd4be('0x1a')](_0x28dbd5)[_0xd4be('0x1c')](_0x335a53);}};}function respondWithFilteredResult(_0x432b01,_0x20b12f){return function(_0x4b6964){if(_0x4b6964){var _0x4a766b=typeof _0x20b12f['offset']===_0xd4be('0x1d')&&typeof _0x20b12f[_0xd4be('0x1e')]===_0xd4be('0x1d');var _0xb1e722=_0x4b6964[_0xd4be('0x1f')];var _0x34a21e=_0x4a766b?0x0:_0x20b12f[_0xd4be('0x20')];var _0x55a203=_0x4a766b?_0x4b6964[_0xd4be('0x1f')]:_0x20b12f[_0xd4be('0x20')]+_0x20b12f[_0xd4be('0x1e')];var _0x5181a3;if(_0x55a203>=_0xb1e722){_0x55a203=_0xb1e722;_0x5181a3=0xc8;}else{_0x5181a3=0xce;}_0x432b01[_0xd4be('0x1a')](_0x5181a3);return _0x432b01[_0xd4be('0x21')](_0xd4be('0x22'),_0x34a21e+'-'+_0x55a203+'/'+_0xb1e722)['json'](_0x4b6964);}return null;};}function patchUpdates(_0x57c35b){return function(_0x23f5c2){try{jsonpatch['apply'](_0x23f5c2,_0x57c35b,!![]);}catch(_0x2ed4a3){return BPromise[_0xd4be('0x23')](_0x2ed4a3);}return _0x23f5c2[_0xd4be('0x24')]();};}function saveUpdates(_0x59f4f4,_0x3981f9){return function(_0x147939){if(_0x147939){return _0x147939['update'](_0x59f4f4)[_0xd4be('0x25')](function(_0x2440bc){return _0x2440bc;});}return null;};}function removeEntity(_0x16fa47,_0x5476a8){return function(_0x204c16){if(_0x204c16){return _0x204c16['destroy']()[_0xd4be('0x25')](function(){_0x16fa47[_0xd4be('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9e5e,_0x5bfbda){return function(_0x3da1b3){if(!_0x3da1b3){_0x2b9e5e['sendStatus'](0x194);}return _0x3da1b3;};}function handleError(_0x143256,_0x275a15){_0x275a15=_0x275a15||0x1f4;return function(_0x526f9a){logger[_0xd4be('0x26')](_0x526f9a['stack']);if(_0x526f9a['name']){delete _0x526f9a['name'];}_0x143256[_0xd4be('0x1a')](_0x275a15)['send'](_0x526f9a);};}exports[_0xd4be('0x27')]=function(_0x3980c8,_0x38755a){var _0x30d5f7={},_0x4bc097={},_0x104924={'count':0x0,'rows':[]};var _0x3390ca=_['map'](db['AnalyticTreeReport'][_0xd4be('0x28')],function(_0x259a78){return{'name':_0x259a78[_0xd4be('0x29')],'type':_0x259a78[_0xd4be('0x2a')][_0xd4be('0x2b')]};});_0x4bc097[_0xd4be('0x2c')]=_[_0xd4be('0x2d')](_0x3390ca,'name');_0x4bc097[_0xd4be('0x2e')]=_['keys'](_0x3980c8['query']);_0x4bc097[_0xd4be('0x2f')]=_[_0xd4be('0x30')](_0x4bc097['model'],_0x4bc097['query']);_0x30d5f7['attributes']=_[_0xd4be('0x30')](_0x4bc097[_0xd4be('0x2c')],qs[_0xd4be('0x31')](_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x31')]));_0x30d5f7[_0xd4be('0x32')]=_0x30d5f7[_0xd4be('0x32')][_0xd4be('0x33')]?_0x30d5f7[_0xd4be('0x32')]:_0x4bc097[_0xd4be('0x2c')];if(!_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x34')]('nolimit')){_0x30d5f7[_0xd4be('0x1e')]=qs['limit'](_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x1e')]);_0x30d5f7['offset']=qs[_0xd4be('0x20')](_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x20')]);}_0x30d5f7['order']=qs[_0xd4be('0x35')](_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x35')]);_0x30d5f7[_0xd4be('0x36')]=qs[_0xd4be('0x2f')](_[_0xd4be('0x37')](_0x3980c8[_0xd4be('0x2e')],_0x4bc097[_0xd4be('0x2f')]),_0x3390ca);if(_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x38')]){_0x30d5f7[_0xd4be('0x36')]=_[_0xd4be('0x39')](_0x30d5f7[_0xd4be('0x36')],{'$or':_[_0xd4be('0x2d')](_0x3390ca,function(_0x228208){if(_0x228208[_0xd4be('0x2a')]!==_0xd4be('0x3a')){var _0x2ed0c3={};_0x2ed0c3[_0x228208['name']]={'$like':'%'+_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x38')]+'%'};return _0x2ed0c3;}})});}_0x30d5f7=_[_0xd4be('0x39')]({},_0x30d5f7,_0x3980c8[_0xd4be('0x3b')]);var _0x27165c={'where':_0x30d5f7['where']};return db[_0xd4be('0x3c')]['count'](_0x27165c)[_0xd4be('0x25')](function(_0x348c1e){_0x104924[_0xd4be('0x1f')]=_0x348c1e;if(_0x3980c8[_0xd4be('0x2e')][_0xd4be('0x3d')]){_0x30d5f7['include']=[{'all':!![]}];}return db[_0xd4be('0x3c')]['findAll'](_0x30d5f7);})[_0xd4be('0x25')](function(_0x704cdc){_0x104924[_0xd4be('0x3e')]=_0x704cdc;return _0x104924;})[_0xd4be('0x25')](respondWithFilteredResult(_0x38755a,_0x30d5f7))['catch'](handleError(_0x38755a,null));};exports[_0xd4be('0x3f')]=function(_0x38604d,_0x528183){var _0x1bd7e1={'raw':!![],'where':{'id':_0x38604d[_0xd4be('0x40')]['id']}},_0xb8e631={};_0xb8e631['model']=_[_0xd4be('0x41')](db['AnalyticTreeReport'][_0xd4be('0x28')]);_0xb8e631[_0xd4be('0x2e')]=_['keys'](_0x38604d['query']);_0xb8e631[_0xd4be('0x2f')]=_['intersection'](_0xb8e631[_0xd4be('0x2c')],_0xb8e631[_0xd4be('0x2e')]);_0x1bd7e1[_0xd4be('0x32')]=_[_0xd4be('0x30')](_0xb8e631['model'],qs[_0xd4be('0x31')](_0x38604d['query'][_0xd4be('0x31')]));_0x1bd7e1[_0xd4be('0x32')]=_0x1bd7e1[_0xd4be('0x32')][_0xd4be('0x33')]?_0x1bd7e1[_0xd4be('0x32')]:_0xb8e631[_0xd4be('0x2c')];if(_0x38604d[_0xd4be('0x2e')][_0xd4be('0x3d')]){_0x1bd7e1['include']=[{'all':!![]}];}_0x1bd7e1=_['merge']({},_0x1bd7e1,_0x38604d['options']);return db[_0xd4be('0x3c')]['find'](_0x1bd7e1)[_0xd4be('0x25')](handleEntityNotFound(_0x528183,null))[_0xd4be('0x25')](respondWithResult(_0x528183,null))[_0xd4be('0x42')](handleError(_0x528183,null));};exports['create']=function(_0x39e518,_0x83a8aa){return db[_0xd4be('0x3c')][_0xd4be('0x43')](_0x39e518[_0xd4be('0x44')],{})[_0xd4be('0x25')](respondWithResult(_0x83a8aa,0xc9))[_0xd4be('0x42')](handleError(_0x83a8aa,null));};exports[_0xd4be('0x45')]=function(_0x186c71,_0x4f1281){if(_0x186c71[_0xd4be('0x44')]['id']){delete _0x186c71[_0xd4be('0x44')]['id'];}return db[_0xd4be('0x3c')][_0xd4be('0x46')]({'where':{'id':_0x186c71['params']['id']}})[_0xd4be('0x25')](handleEntityNotFound(_0x4f1281,null))[_0xd4be('0x25')](saveUpdates(_0x186c71[_0xd4be('0x44')],null))[_0xd4be('0x25')](respondWithResult(_0x4f1281,null))['catch'](handleError(_0x4f1281,null));};exports[_0xd4be('0x47')]=function(_0x4560cb,_0x254abd){return db[_0xd4be('0x3c')][_0xd4be('0x46')]({'where':{'id':_0x4560cb['params']['id']}})[_0xd4be('0x25')](handleEntityNotFound(_0x254abd,null))['then'](removeEntity(_0x254abd,null))[_0xd4be('0x42')](handleError(_0x254abd,null));}; \ No newline at end of file +var _0xc711=['apply','update','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','show','params','rawAttributes','find','create','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','Content-Range','json'];(function(_0x20076b,_0x4f218e){var _0x1ae3de=function(_0x545d7a){while(--_0x545d7a){_0x20076b['push'](_0x20076b['shift']());}};_0x1ae3de(++_0x4f218e);}(_0xc711,0x1f0));var _0x1c71=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xc711[_0x277af0];return _0x43bd7c;};'use strict';var emlformat=require(_0x1c71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1c71('0x1'));var jsonpatch=require(_0x1c71('0x2'));var rp=require(_0x1c71('0x3'));var moment=require(_0x1c71('0x4'));var BPromise=require(_0x1c71('0x5'));var Mustache=require(_0x1c71('0x6'));var util=require(_0x1c71('0x7'));var path=require(_0x1c71('0x8'));var sox=require(_0x1c71('0x9'));var csv=require('to-csv');var ejs=require(_0x1c71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c71('0xb'));var squel=require(_0x1c71('0xc'));var crypto=require('crypto');var jsforce=require(_0x1c71('0xd'));var deskjs=require(_0x1c71('0xe'));var toCsv=require(_0x1c71('0xf'));var querystring=require(_0x1c71('0x10'));var Papa=require(_0x1c71('0x11'));var Redis=require('ioredis');var authService=require(_0x1c71('0x12'));var qs=require(_0x1c71('0x13'));var as=require(_0x1c71('0x14'));var hardwareService=require(_0x1c71('0x15'));var logger=require(_0x1c71('0x16'))('api');var utils=require(_0x1c71('0x17'));var config=require(_0x1c71('0x18'));var licenseUtil=require(_0x1c71('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50306e,_0x51f768){_0x51f768=_0x51f768||0xcc;return function(_0x534b66){if(_0x534b66){return _0x50306e[_0x1c71('0x1a')](_0x51f768);}return _0x50306e['status'](_0x51f768)[_0x1c71('0x1b')]();};}function respondWithResult(_0x24c421,_0x19243a){_0x19243a=_0x19243a||0xc8;return function(_0xed2ac7){if(_0xed2ac7){return _0x24c421[_0x1c71('0x1c')](_0x19243a)['json'](_0xed2ac7);}};}function respondWithFilteredResult(_0x10f582,_0x330340){return function(_0x2ed8a2){if(_0x2ed8a2){var _0xcfb77f=typeof _0x330340['offset']===_0x1c71('0x1d')&&typeof _0x330340['limit']===_0x1c71('0x1d');var _0xe7a7a7=_0x2ed8a2[_0x1c71('0x1e')];var _0x12e13a=_0xcfb77f?0x0:_0x330340[_0x1c71('0x1f')];var _0x74f03=_0xcfb77f?_0x2ed8a2['count']:_0x330340[_0x1c71('0x1f')]+_0x330340[_0x1c71('0x20')];var _0x1c10a7;if(_0x74f03>=_0xe7a7a7){_0x74f03=_0xe7a7a7;_0x1c10a7=0xc8;}else{_0x1c10a7=0xce;}_0x10f582[_0x1c71('0x1c')](_0x1c10a7);return _0x10f582[_0x1c71('0x21')](_0x1c71('0x22'),_0x12e13a+'-'+_0x74f03+'/'+_0xe7a7a7)[_0x1c71('0x23')](_0x2ed8a2);}return null;};}function patchUpdates(_0x3733d7){return function(_0x584e1e){try{jsonpatch[_0x1c71('0x24')](_0x584e1e,_0x3733d7,!![]);}catch(_0x4fc9c9){return BPromise['reject'](_0x4fc9c9);}return _0x584e1e['save']();};}function saveUpdates(_0x47c546,_0x12ea27){return function(_0x39ccb5){if(_0x39ccb5){return _0x39ccb5[_0x1c71('0x25')](_0x47c546)[_0x1c71('0x26')](function(_0x3ec17d){return _0x3ec17d;});}return null;};}function removeEntity(_0x1fa317,_0x5881ea){return function(_0x271363){if(_0x271363){return _0x271363[_0x1c71('0x27')]()[_0x1c71('0x26')](function(){_0x1fa317[_0x1c71('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10290b,_0xd3b29f){return function(_0x48b06d){if(!_0x48b06d){_0x10290b[_0x1c71('0x1a')](0x194);}return _0x48b06d;};}function handleError(_0x4ff0a2,_0x4db192){_0x4db192=_0x4db192||0x1f4;return function(_0x53ed42){logger[_0x1c71('0x28')](_0x53ed42[_0x1c71('0x29')]);if(_0x53ed42[_0x1c71('0x2a')]){delete _0x53ed42[_0x1c71('0x2a')];}_0x4ff0a2[_0x1c71('0x1c')](_0x4db192)[_0x1c71('0x2b')](_0x53ed42);};}exports[_0x1c71('0x2c')]=function(_0x1ca5df,_0x239b23){var _0x37a4f2={},_0x51e9c3={},_0x5d10eb={'count':0x0,'rows':[]};var _0x13e750=_[_0x1c71('0x2d')](db['AnalyticTreeReport']['rawAttributes'],function(_0x209955){return{'name':_0x209955[_0x1c71('0x2e')],'type':_0x209955[_0x1c71('0x2f')]['key']};});_0x51e9c3['model']=_[_0x1c71('0x2d')](_0x13e750,_0x1c71('0x2a'));_0x51e9c3[_0x1c71('0x30')]=_[_0x1c71('0x31')](_0x1ca5df[_0x1c71('0x30')]);_0x51e9c3['filters']=_[_0x1c71('0x32')](_0x51e9c3[_0x1c71('0x33')],_0x51e9c3['query']);_0x37a4f2[_0x1c71('0x34')]=_[_0x1c71('0x32')](_0x51e9c3[_0x1c71('0x33')],qs[_0x1c71('0x35')](_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x35')]));_0x37a4f2['attributes']=_0x37a4f2[_0x1c71('0x34')][_0x1c71('0x36')]?_0x37a4f2[_0x1c71('0x34')]:_0x51e9c3['model'];if(!_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x37')]('nolimit')){_0x37a4f2[_0x1c71('0x20')]=qs[_0x1c71('0x20')](_0x1ca5df['query']['limit']);_0x37a4f2[_0x1c71('0x1f')]=qs['offset'](_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x1f')]);}_0x37a4f2[_0x1c71('0x38')]=qs[_0x1c71('0x39')](_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x39')]);_0x37a4f2['where']=qs[_0x1c71('0x3a')](_[_0x1c71('0x3b')](_0x1ca5df['query'],_0x51e9c3[_0x1c71('0x3a')]),_0x13e750);if(_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x3c')]){_0x37a4f2[_0x1c71('0x3d')]=_[_0x1c71('0x3e')](_0x37a4f2[_0x1c71('0x3d')],{'$or':_['map'](_0x13e750,function(_0x1fcb08){if(_0x1fcb08[_0x1c71('0x2f')]!==_0x1c71('0x3f')){var _0x158dc7={};_0x158dc7[_0x1fcb08['name']]={'$like':'%'+_0x1ca5df[_0x1c71('0x30')]['filter']+'%'};return _0x158dc7;}})});}_0x37a4f2=_['merge']({},_0x37a4f2,_0x1ca5df[_0x1c71('0x40')]);var _0x51ccff={'where':_0x37a4f2[_0x1c71('0x3d')]};return db[_0x1c71('0x41')][_0x1c71('0x1e')](_0x51ccff)[_0x1c71('0x26')](function(_0x88bb6e){_0x5d10eb[_0x1c71('0x1e')]=_0x88bb6e;if(_0x1ca5df[_0x1c71('0x30')][_0x1c71('0x42')]){_0x37a4f2[_0x1c71('0x43')]=[{'all':!![]}];}return db[_0x1c71('0x41')]['findAll'](_0x37a4f2);})[_0x1c71('0x26')](function(_0x31ad86){_0x5d10eb[_0x1c71('0x44')]=_0x31ad86;return _0x5d10eb;})['then'](respondWithFilteredResult(_0x239b23,_0x37a4f2))['catch'](handleError(_0x239b23,null));};exports[_0x1c71('0x45')]=function(_0x59b626,_0x1f8816){var _0x3d7019={'raw':!![],'where':{'id':_0x59b626[_0x1c71('0x46')]['id']}},_0x593cdb={};_0x593cdb[_0x1c71('0x33')]=_[_0x1c71('0x31')](db[_0x1c71('0x41')][_0x1c71('0x47')]);_0x593cdb[_0x1c71('0x30')]=_['keys'](_0x59b626[_0x1c71('0x30')]);_0x593cdb['filters']=_[_0x1c71('0x32')](_0x593cdb['model'],_0x593cdb[_0x1c71('0x30')]);_0x3d7019[_0x1c71('0x34')]=_[_0x1c71('0x32')](_0x593cdb[_0x1c71('0x33')],qs[_0x1c71('0x35')](_0x59b626[_0x1c71('0x30')][_0x1c71('0x35')]));_0x3d7019[_0x1c71('0x34')]=_0x3d7019[_0x1c71('0x34')][_0x1c71('0x36')]?_0x3d7019[_0x1c71('0x34')]:_0x593cdb['model'];if(_0x59b626[_0x1c71('0x30')][_0x1c71('0x42')]){_0x3d7019[_0x1c71('0x43')]=[{'all':!![]}];}_0x3d7019=_['merge']({},_0x3d7019,_0x59b626['options']);return db[_0x1c71('0x41')][_0x1c71('0x48')](_0x3d7019)['then'](handleEntityNotFound(_0x1f8816,null))[_0x1c71('0x26')](respondWithResult(_0x1f8816,null))['catch'](handleError(_0x1f8816,null));};exports[_0x1c71('0x49')]=function(_0x7ef041,_0x546361){return db['AnalyticTreeReport'][_0x1c71('0x49')](_0x7ef041['body'],{})[_0x1c71('0x26')](respondWithResult(_0x546361,0xc9))[_0x1c71('0x4a')](handleError(_0x546361,null));};exports['update']=function(_0x58a9c2,_0x54e419){if(_0x58a9c2[_0x1c71('0x4b')]['id']){delete _0x58a9c2['body']['id'];}return db[_0x1c71('0x41')][_0x1c71('0x48')]({'where':{'id':_0x58a9c2[_0x1c71('0x46')]['id']}})[_0x1c71('0x26')](handleEntityNotFound(_0x54e419,null))[_0x1c71('0x26')](saveUpdates(_0x58a9c2[_0x1c71('0x4b')],null))[_0x1c71('0x26')](respondWithResult(_0x54e419,null))[_0x1c71('0x4a')](handleError(_0x54e419,null));};exports[_0x1c71('0x27')]=function(_0x56cb7a,_0x3b6e10){return db['AnalyticTreeReport']['find']({'where':{'id':_0x56cb7a['params']['id']}})[_0x1c71('0x26')](handleEntityNotFound(_0x3b6e10,null))[_0x1c71('0x26')](removeEntity(_0x3b6e10,null))[_0x1c71('0x4a')](handleError(_0x3b6e10,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index d6deffb..f7010e9 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 _0x6bcd=['moment','rimraf','../../config/environment','./analyticTreeReport.attributes','lodash','util'];(function(_0x4194c3,_0x33fb29){var _0x25324d=function(_0x850ecd){while(--_0x850ecd){_0x4194c3['push'](_0x4194c3['shift']());}};_0x25324d(++_0x33fb29);}(_0x6bcd,0x178));var _0xd6bc=function(_0x4aa4c9,_0x194b73){_0x4aa4c9=_0x4aa4c9-0x0;var _0x16b842=_0x6bcd[_0x4aa4c9];return _0x16b842;};'use strict';var _=require(_0xd6bc('0x0'));var util=require(_0xd6bc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd6bc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd6bc('0x3'));var config=require(_0xd6bc('0x4'));var attributes=require(_0xd6bc('0x5'));module['exports']=function(_0x3451b3,_0x447d03){return _0x3451b3['define']('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf68=['./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger','api','bluebird','path','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xbf68,0x11a));var _0x8bf6=function(_0x2b1bb9,_0x3f85cc){_0x2b1bb9=_0x2b1bb9-0x0;var _0x59f401=_0xbf68[_0x2b1bb9];return _0x59f401;};'use strict';var _=require('lodash');var util=require(_0x8bf6('0x0'));var logger=require(_0x8bf6('0x1'))(_0x8bf6('0x2'));var moment=require('moment');var BPromise=require(_0x8bf6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bf6('0x4'));var rimraf=require('rimraf');var config=require(_0x8bf6('0x5'));var attributes=require(_0x8bf6('0x6'));module['exports']=function(_0x3f21c1,_0x4ed9b1){return _0x3f21c1[_0x8bf6('0x7')](_0x8bf6('0x8'),attributes,{'tableName':'analytics_report_trees','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 1c3af9e..39884b6 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x20ae0d,_0x19fa96){var _0xd419d4=function(_0x437295){while(--_0x437295){_0x20ae0d['push'](_0x20ae0d['shift']());}};_0xd419d4(++_0x19fa96);}(_0xdb28,0x106));var _0x8db2=function(_0x269c57,_0x3f6672){_0x269c57=_0x269c57-0x0;var _0x5bcc25=_0xdb28[_0x269c57];return _0x5bcc25;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0xadb5,0xad));var _0x5adb=function(_0x22d6e7,_0x5ecc94){_0x22d6e7=_0x22d6e7-0x0;var _0x1264bc=_0xadb5[_0x22d6e7];return _0x1264bc;};'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']('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 3346b64..09ea1cc 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 _0x2459=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1470ea,_0x538d1a){var _0x44da11=function(_0x4f9d1a){while(--_0x4f9d1a){_0x1470ea['push'](_0x1470ea['shift']());}};_0x44da11(++_0x538d1a);}(_0x2459,0xd4));var _0x9245=function(_0x2dfb77,_0x9b4e41){_0x2dfb77=_0x2dfb77-0x0;var _0x12ad92=_0x2459[_0x2dfb77];return _0x12ad92;};'use strict';var multer=require(_0x9245('0x0'));var util=require(_0x9245('0x1'));var path=require(_0x9245('0x2'));var timeout=require(_0x9245('0x3'));var express=require(_0x9245('0x4'));var router=express[_0x9245('0x5')]();var fs_extra=require(_0x9245('0x6'));var auth=require(_0x9245('0x7'));var interaction=require(_0x9245('0x8'));var config=require(_0x9245('0x9'));var controller=require(_0x9245('0xa'));router[_0x9245('0xb')]('/',auth[_0x9245('0xc')](),controller['index']);router['get'](_0x9245('0xd'),auth[_0x9245('0xc')](),controller[_0x9245('0xe')]);router[_0x9245('0xf')]('/',auth[_0x9245('0xc')](),controller['create']);router[_0x9245('0x10')](_0x9245('0xd'),auth[_0x9245('0xc')](),controller[_0x9245('0x11')]);router['delete'](_0x9245('0xd'),auth['isAuthenticated'](),controller[_0x9245('0x12')]);module[_0x9245('0x13')]=router; \ No newline at end of file +var _0xe875=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x800daa,_0x53ad7b){var _0x6ec626=function(_0x27b9fd){while(--_0x27b9fd){_0x800daa['push'](_0x800daa['shift']());}};_0x6ec626(++_0x53ad7b);}(_0xe875,0x1cb));var _0x5e87=function(_0x80e08f,_0x1a2059){_0x80e08f=_0x80e08f-0x0;var _0x1f3832=_0xe875[_0x80e08f];return _0x1f3832;};'use strict';var multer=require('multer');var util=require(_0x5e87('0x0'));var path=require(_0x5e87('0x1'));var timeout=require(_0x5e87('0x2'));var express=require(_0x5e87('0x3'));var router=express[_0x5e87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5e87('0x5'));var interaction=require(_0x5e87('0x6'));var config=require(_0x5e87('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x5e87('0x8')]('/',auth[_0x5e87('0x9')](),controller[_0x5e87('0xa')]);router['get'](_0x5e87('0xb'),auth[_0x5e87('0x9')](),controller['show']);router[_0x5e87('0xc')]('/',auth[_0x5e87('0x9')](),controller[_0x5e87('0xd')]);router[_0x5e87('0xe')](_0x5e87('0xb'),auth[_0x5e87('0x9')](),controller[_0x5e87('0xf')]);router[_0x5e87('0x10')](_0x5e87('0xb'),auth[_0x5e87('0x9')](),controller[_0x5e87('0x11')]);module[_0x5e87('0x12')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index dc218c3..36f2715 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 _0x1e69=['STRING','exports'];(function(_0x59ddbc,_0xf8b1dc){var _0x46b03a=function(_0xb474ac){while(--_0xb474ac){_0x59ddbc['push'](_0x59ddbc['shift']());}};_0x46b03a(++_0xf8b1dc);}(_0x1e69,0x85));var _0x91e6=function(_0x6b256c,_0xae3260){_0x6b256c=_0x6b256c-0x0;var _0x3cfef0=_0x1e69[_0x6b256c];return _0x3cfef0;};'use strict';var Sequelize=require('sequelize');module[_0x91e6('0x0')]={'name':{'type':Sequelize[_0x91e6('0x1')]},'basename':{'type':Sequelize[_0x91e6('0x1')]},'type':{'type':Sequelize[_0x91e6('0x1')]}}; \ No newline at end of file +var _0x4c4e=['sequelize','STRING'];(function(_0x18769b,_0x254bad){var _0x5479cf=function(_0x1bc39f){while(--_0x1bc39f){_0x18769b['push'](_0x18769b['shift']());}};_0x5479cf(++_0x254bad);}(_0x4c4e,0x152));var _0xe4c4=function(_0x52f5c4,_0x43461c){_0x52f5c4=_0x52f5c4-0x0;var _0x2bd25d=_0x4c4e[_0x52f5c4];return _0x2bd25d;};'use strict';var Sequelize=require(_0xe4c4('0x0'));module['exports']={'name':{'type':Sequelize[_0xe4c4('0x1')]},'basename':{'type':Sequelize[_0xe4c4('0x1')]},'type':{'type':Sequelize[_0xe4c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index deaae6d..3e90b49 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 _0x4b5a=['intersection','model','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','include','findAll','rows','show','fields','includeAll','catch','clone','params','find','get','createdAt','updatedAt','omit','body','create','originalname','basename','file','filename','mimetype','findOne','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','Attachment','rawAttributes','fieldName','key','map','query','keys'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4b5a,0x1e9));var _0xa4b5=function(_0x48f4aa,_0x2a8ab2){_0x48f4aa=_0x48f4aa-0x0;var _0x51870a=_0x4b5a[_0x48f4aa];return _0x51870a;};'use strict';var emlformat=require(_0xa4b5('0x0'));var rimraf=require(_0xa4b5('0x1'));var zipdir=require(_0xa4b5('0x2'));var jsonpatch=require(_0xa4b5('0x3'));var rp=require(_0xa4b5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa4b5('0x5'));var util=require(_0xa4b5('0x6'));var path=require(_0xa4b5('0x7'));var sox=require('sox');var csv=require(_0xa4b5('0x8'));var ejs=require(_0xa4b5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4b5('0xa'));var squel=require(_0xa4b5('0xb'));var crypto=require(_0xa4b5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa4b5('0xd'));var toCsv=require(_0xa4b5('0x8'));var querystring=require(_0xa4b5('0xe'));var Papa=require('papaparse');var Redis=require(_0xa4b5('0xf'));var authService=require(_0xa4b5('0x10'));var qs=require(_0xa4b5('0x11'));var as=require(_0xa4b5('0x12'));var hardwareService=require(_0xa4b5('0x13'));var logger=require(_0xa4b5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa4b5('0x15'));var licenseUtil=require(_0xa4b5('0x16'));var db=require(_0xa4b5('0x17'))['db'];function respondWithStatusCode(_0x358fca,_0x58c743){_0x58c743=_0x58c743||0xcc;return function(_0x41dff6){if(_0x41dff6){return _0x358fca[_0xa4b5('0x18')](_0x58c743);}return _0x358fca[_0xa4b5('0x19')](_0x58c743)[_0xa4b5('0x1a')]();};}function respondWithResult(_0x4cc03f,_0x2ae00c){_0x2ae00c=_0x2ae00c||0xc8;return function(_0x42bca4){if(_0x42bca4){return _0x4cc03f[_0xa4b5('0x19')](_0x2ae00c)['json'](_0x42bca4);}};}function respondWithFilteredResult(_0x8d2b42,_0x29c6e7){return function(_0x4ca422){if(_0x4ca422){var _0x3c40b3=typeof _0x29c6e7[_0xa4b5('0x1b')]==='undefined'&&typeof _0x29c6e7[_0xa4b5('0x1c')]===_0xa4b5('0x1d');var _0xe1a771=_0x4ca422[_0xa4b5('0x1e')];var _0x4ecd79=_0x3c40b3?0x0:_0x29c6e7['offset'];var _0x35396a=_0x3c40b3?_0x4ca422[_0xa4b5('0x1e')]:_0x29c6e7[_0xa4b5('0x1b')]+_0x29c6e7[_0xa4b5('0x1c')];var _0x40c58b;if(_0x35396a>=_0xe1a771){_0x35396a=_0xe1a771;_0x40c58b=0xc8;}else{_0x40c58b=0xce;}_0x8d2b42[_0xa4b5('0x19')](_0x40c58b);return _0x8d2b42[_0xa4b5('0x1f')](_0xa4b5('0x20'),_0x4ecd79+'-'+_0x35396a+'/'+_0xe1a771)[_0xa4b5('0x21')](_0x4ca422);}return null;};}function patchUpdates(_0x197abc){return function(_0x2229b7){try{jsonpatch[_0xa4b5('0x22')](_0x2229b7,_0x197abc,!![]);}catch(_0x414d7c){return BPromise[_0xa4b5('0x23')](_0x414d7c);}return _0x2229b7[_0xa4b5('0x24')]();};}function saveUpdates(_0x4c2f25,_0x7c4518){return function(_0x218299){if(_0x218299){return _0x218299[_0xa4b5('0x25')](_0x4c2f25)['then'](function(_0x23088d){return _0x23088d;});}return null;};}function removeEntity(_0x56b099,_0x2dc15b){return function(_0x10e1ed){if(_0x10e1ed){return _0x10e1ed[_0xa4b5('0x26')]()[_0xa4b5('0x27')](function(){_0x56b099[_0xa4b5('0x19')](0xcc)[_0xa4b5('0x1a')]();});}};}function handleEntityNotFound(_0x4fb92a,_0x1d3339){return function(_0x180d04){if(!_0x180d04){_0x4fb92a[_0xa4b5('0x18')](0x194);}return _0x180d04;};}function handleError(_0x42ac98,_0x154eb2){_0x154eb2=_0x154eb2||0x1f4;return function(_0xf5ce81){logger[_0xa4b5('0x28')](_0xf5ce81['stack']);if(_0xf5ce81[_0xa4b5('0x29')]){delete _0xf5ce81[_0xa4b5('0x29')];}_0x42ac98[_0xa4b5('0x19')](_0x154eb2)[_0xa4b5('0x2a')](_0xf5ce81);};}exports[_0xa4b5('0x2b')]=function(_0x59de2b,_0x17460c){var _0x4c9d3c={},_0x2a61b7={},_0x6118f0={'count':0x0,'rows':[]};var _0x4ac409=_['map'](db[_0xa4b5('0x2c')][_0xa4b5('0x2d')],function(_0x5d23e2){return{'name':_0x5d23e2[_0xa4b5('0x2e')],'type':_0x5d23e2['type'][_0xa4b5('0x2f')]};});_0x2a61b7['model']=_[_0xa4b5('0x30')](_0x4ac409,_0xa4b5('0x29'));_0x2a61b7[_0xa4b5('0x31')]=_[_0xa4b5('0x32')](_0x59de2b[_0xa4b5('0x31')]);_0x2a61b7['filters']=_[_0xa4b5('0x33')](_0x2a61b7[_0xa4b5('0x34')],_0x2a61b7[_0xa4b5('0x31')]);_0x4c9d3c[_0xa4b5('0x35')]=_[_0xa4b5('0x33')](_0x2a61b7[_0xa4b5('0x34')],qs['fields'](_0x59de2b[_0xa4b5('0x31')]['fields']));_0x4c9d3c['attributes']=_0x4c9d3c[_0xa4b5('0x35')][_0xa4b5('0x36')]?_0x4c9d3c[_0xa4b5('0x35')]:_0x2a61b7['model'];if(!_0x59de2b[_0xa4b5('0x31')]['hasOwnProperty'](_0xa4b5('0x37'))){_0x4c9d3c[_0xa4b5('0x1c')]=qs[_0xa4b5('0x1c')](_0x59de2b[_0xa4b5('0x31')][_0xa4b5('0x1c')]);_0x4c9d3c[_0xa4b5('0x1b')]=qs['offset'](_0x59de2b[_0xa4b5('0x31')][_0xa4b5('0x1b')]);}_0x4c9d3c[_0xa4b5('0x38')]=qs['sort'](_0x59de2b[_0xa4b5('0x31')][_0xa4b5('0x39')]);_0x4c9d3c[_0xa4b5('0x3a')]=qs[_0xa4b5('0x3b')](_[_0xa4b5('0x3c')](_0x59de2b['query'],_0x2a61b7['filters']),_0x4ac409);if(_0x59de2b[_0xa4b5('0x31')][_0xa4b5('0x3d')]){_0x4c9d3c[_0xa4b5('0x3a')]=_[_0xa4b5('0x3e')](_0x4c9d3c[_0xa4b5('0x3a')],{'$or':_['map'](_0x4ac409,function(_0x1ba7d5){if(_0x1ba7d5[_0xa4b5('0x3f')]!=='VIRTUAL'){var _0x47aa0d={};_0x47aa0d[_0x1ba7d5[_0xa4b5('0x29')]]={'$like':'%'+_0x59de2b[_0xa4b5('0x31')]['filter']+'%'};return _0x47aa0d;}})});}_0x4c9d3c=_[_0xa4b5('0x3e')]({},_0x4c9d3c,_0x59de2b[_0xa4b5('0x40')]);var _0x1cff5b={'where':_0x4c9d3c[_0xa4b5('0x3a')]};return db[_0xa4b5('0x2c')][_0xa4b5('0x1e')](_0x1cff5b)[_0xa4b5('0x27')](function(_0x51f78b){_0x6118f0[_0xa4b5('0x1e')]=_0x51f78b;if(_0x59de2b[_0xa4b5('0x31')]['includeAll']){_0x4c9d3c[_0xa4b5('0x41')]=[{'all':!![]}];}return db[_0xa4b5('0x2c')][_0xa4b5('0x42')](_0x4c9d3c);})['then'](function(_0x2573f1){_0x6118f0[_0xa4b5('0x43')]=_0x2573f1;return _0x6118f0;})[_0xa4b5('0x27')](respondWithFilteredResult(_0x17460c,_0x4c9d3c))['catch'](handleError(_0x17460c,null));};exports[_0xa4b5('0x44')]=function(_0x53cc0a,_0x2698b9){var _0x44a140={'raw':!![],'where':{'id':_0x53cc0a['params']['id']}},_0x44552c={};_0x44552c[_0xa4b5('0x34')]=_[_0xa4b5('0x32')](db[_0xa4b5('0x2c')][_0xa4b5('0x2d')]);_0x44552c[_0xa4b5('0x31')]=_[_0xa4b5('0x32')](_0x53cc0a['query']);_0x44552c[_0xa4b5('0x3b')]=_[_0xa4b5('0x33')](_0x44552c['model'],_0x44552c[_0xa4b5('0x31')]);_0x44a140[_0xa4b5('0x35')]=_[_0xa4b5('0x33')](_0x44552c['model'],qs[_0xa4b5('0x45')](_0x53cc0a[_0xa4b5('0x31')][_0xa4b5('0x45')]));_0x44a140[_0xa4b5('0x35')]=_0x44a140[_0xa4b5('0x35')][_0xa4b5('0x36')]?_0x44a140[_0xa4b5('0x35')]:_0x44552c['model'];if(_0x53cc0a[_0xa4b5('0x31')][_0xa4b5('0x46')]){_0x44a140['include']=[{'all':!![]}];}_0x44a140=_[_0xa4b5('0x3e')]({},_0x44a140,_0x53cc0a[_0xa4b5('0x40')]);return db[_0xa4b5('0x2c')]['find'](_0x44a140)[_0xa4b5('0x27')](handleEntityNotFound(_0x2698b9,null))[_0xa4b5('0x27')](respondWithResult(_0x2698b9,null))[_0xa4b5('0x47')](handleError(_0x2698b9,null));};exports[_0xa4b5('0x48')]=function(_0x2d1792,_0x1b70e1){var _0x2a4111={'where':{'id':_0x2d1792[_0xa4b5('0x49')]['id']}},_0x5b5850={};_0x5b5850[_0xa4b5('0x34')]=_[_0xa4b5('0x32')](db[_0xa4b5('0x2c')]['rawAttributes']);_0x2a4111[_0xa4b5('0x35')]=_[_0xa4b5('0x33')](_0x5b5850[_0xa4b5('0x34')],qs['fields'](_0x2d1792['query'][_0xa4b5('0x45')]));_0x2a4111[_0xa4b5('0x35')]=_0x2a4111[_0xa4b5('0x35')][_0xa4b5('0x36')]?_0x2a4111[_0xa4b5('0x35')]:_0x5b5850[_0xa4b5('0x34')];if(_0x2d1792[_0xa4b5('0x31')][_0xa4b5('0x46')]){_0x2a4111['include']=[{'all':!![]}];}_0x2a4111=_[_0xa4b5('0x3e')]({},_0x2a4111,_0x2d1792[_0xa4b5('0x40')]);return db[_0xa4b5('0x2c')][_0xa4b5('0x4a')](_0x2a4111)[_0xa4b5('0x27')](handleEntityNotFound(_0x1b70e1,null))[_0xa4b5('0x27')](function(_0x59babb){if(_0x59babb){var _0x453140=_0x59babb[_0xa4b5('0x4b')]({'plain':!![]});_0x453140=qs['omit'](_0x453140,['id',_0xa4b5('0x4c'),_0xa4b5('0x4d')]);_0x2d1792['body']=_[_0xa4b5('0x4e')](_0x2d1792[_0xa4b5('0x4f')],['id','createdAt',_0xa4b5('0x4d')]);return db['Attachment']['create'](_[_0xa4b5('0x3e')](_0x453140,_0x2d1792[_0xa4b5('0x4f')]),{'include':_0x2d1792['query'][_0xa4b5('0x46')]?[{'all':!![]}]:undefined});}})[_0xa4b5('0x27')](respondWithResult(_0x1b70e1,0xc9))[_0xa4b5('0x47')](handleError(_0x1b70e1,null));};exports[_0xa4b5('0x25')]=function(_0x11be4e,_0x207681){if(_0x11be4e[_0xa4b5('0x4f')]['id']){delete _0x11be4e[_0xa4b5('0x4f')]['id'];}return db[_0xa4b5('0x2c')][_0xa4b5('0x4a')]({'where':{'id':_0x11be4e['params']['id']}})[_0xa4b5('0x27')](handleEntityNotFound(_0x207681,null))[_0xa4b5('0x27')](saveUpdates(_0x11be4e['body'],null))[_0xa4b5('0x27')](respondWithResult(_0x207681,null))[_0xa4b5('0x47')](handleError(_0x207681,null));};exports[_0xa4b5('0x26')]=function(_0xc30939,_0x5cea44){return db[_0xa4b5('0x2c')][_0xa4b5('0x4a')]({'where':{'id':_0xc30939[_0xa4b5('0x49')]['id']}})[_0xa4b5('0x27')](handleEntityNotFound(_0x5cea44,null))[_0xa4b5('0x27')](removeEntity(_0x5cea44,null))['catch'](handleError(_0x5cea44,null));};exports[_0xa4b5('0x50')]=function(_0x2fae0f,_0x1d7122,_0xe87f58){_0x2fae0f['body'][_0xa4b5('0x29')]=_0x2fae0f['file'][_0xa4b5('0x51')];_0x2fae0f[_0xa4b5('0x4f')][_0xa4b5('0x52')]=_0x2fae0f[_0xa4b5('0x53')][_0xa4b5('0x54')];_0x2fae0f[_0xa4b5('0x4f')]['type']=_0x2fae0f['file'][_0xa4b5('0x55')];return db[_0xa4b5('0x2c')]['create'](_0x2fae0f['body'])[_0xa4b5('0x27')](respondWithResult(_0x1d7122,0xc9))['catch'](handleError(_0x1d7122,null));};exports['download']=function(_0x839223,_0x1a3e0c,_0x3488bb){return db[_0xa4b5('0x2c')][_0xa4b5('0x56')]({'where':{'id':_0x839223[_0xa4b5('0x49')]['id']},'raw':!![]})[_0xa4b5('0x27')](handleEntityNotFound(_0x1a3e0c,null))['then'](function(_0x305909){if(_0x305909){var _0x42bc32=_0x305909['ChatOfflineMessageId']!==null;var _0x3c1ad1=path['join'](config[_0xa4b5('0x57')],_0xa4b5('0x58'));if(_0x42bc32){_0x3c1ad1=path[_0xa4b5('0x59')](_0x3c1ad1,'offline-chat/');}var _0x54872a=path[_0xa4b5('0x59')](_0x3c1ad1,_0x305909[_0xa4b5('0x52')]);return _0x1a3e0c['download'](_0x54872a);}})[_0xa4b5('0x47')](handleError(_0x1a3e0c,null));}; \ No newline at end of file +var _0xdd56=['then','destroy','error','stack','name','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','catch','show','params','find','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update'];(function(_0x580965,_0xd5c0fe){var _0x254714=function(_0x47f113){while(--_0x47f113){_0x580965['push'](_0x580965['shift']());}};_0x254714(++_0xd5c0fe);}(_0xdd56,0xde));var _0x6dd5=function(_0x46b623,_0x507555){_0x46b623=_0x46b623-0x0;var _0x3c1556=_0xdd56[_0x46b623];return _0x3c1556;};'use strict';var emlformat=require(_0x6dd5('0x0'));var rimraf=require(_0x6dd5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6dd5('0x2'));var moment=require(_0x6dd5('0x3'));var BPromise=require(_0x6dd5('0x4'));var Mustache=require(_0x6dd5('0x5'));var util=require(_0x6dd5('0x6'));var path=require('path');var sox=require(_0x6dd5('0x7'));var csv=require(_0x6dd5('0x8'));var ejs=require(_0x6dd5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dd5('0xa'));var squel=require(_0x6dd5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6dd5('0x8'));var querystring=require(_0x6dd5('0xc'));var Papa=require('papaparse');var Redis=require(_0x6dd5('0xd'));var authService=require(_0x6dd5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6dd5('0xf'));var hardwareService=require(_0x6dd5('0x10'));var logger=require(_0x6dd5('0x11'))('api');var utils=require(_0x6dd5('0x12'));var config=require(_0x6dd5('0x13'));var licenseUtil=require(_0x6dd5('0x14'));var db=require(_0x6dd5('0x15'))['db'];function respondWithStatusCode(_0x38d3da,_0x4f0823){_0x4f0823=_0x4f0823||0xcc;return function(_0x41367c){if(_0x41367c){return _0x38d3da[_0x6dd5('0x16')](_0x4f0823);}return _0x38d3da[_0x6dd5('0x17')](_0x4f0823)[_0x6dd5('0x18')]();};}function respondWithResult(_0x26b36e,_0x4477c2){_0x4477c2=_0x4477c2||0xc8;return function(_0xad1108){if(_0xad1108){return _0x26b36e[_0x6dd5('0x17')](_0x4477c2)[_0x6dd5('0x19')](_0xad1108);}};}function respondWithFilteredResult(_0x10f7b2,_0x363818){return function(_0x29ac96){if(_0x29ac96){var _0xa993e=typeof _0x363818['offset']===_0x6dd5('0x1a')&&typeof _0x363818[_0x6dd5('0x1b')]==='undefined';var _0x5569e5=_0x29ac96['count'];var _0x5882f2=_0xa993e?0x0:_0x363818[_0x6dd5('0x1c')];var _0xeee682=_0xa993e?_0x29ac96[_0x6dd5('0x1d')]:_0x363818[_0x6dd5('0x1c')]+_0x363818['limit'];var _0x15e616;if(_0xeee682>=_0x5569e5){_0xeee682=_0x5569e5;_0x15e616=0xc8;}else{_0x15e616=0xce;}_0x10f7b2[_0x6dd5('0x17')](_0x15e616);return _0x10f7b2[_0x6dd5('0x1e')](_0x6dd5('0x1f'),_0x5882f2+'-'+_0xeee682+'/'+_0x5569e5)[_0x6dd5('0x19')](_0x29ac96);}return null;};}function patchUpdates(_0x209d84){return function(_0x129c5d){try{jsonpatch[_0x6dd5('0x20')](_0x129c5d,_0x209d84,!![]);}catch(_0x141336){return BPromise[_0x6dd5('0x21')](_0x141336);}return _0x129c5d[_0x6dd5('0x22')]();};}function saveUpdates(_0x2e478c,_0x2d5490){return function(_0x2041f0){if(_0x2041f0){return _0x2041f0[_0x6dd5('0x23')](_0x2e478c)[_0x6dd5('0x24')](function(_0x10c18a){return _0x10c18a;});}return null;};}function removeEntity(_0x388ffe,_0x151ac3){return function(_0x1de60a){if(_0x1de60a){return _0x1de60a[_0x6dd5('0x25')]()[_0x6dd5('0x24')](function(){_0x388ffe['status'](0xcc)[_0x6dd5('0x18')]();});}};}function handleEntityNotFound(_0x12b25b,_0x4eff8a){return function(_0x407db2){if(!_0x407db2){_0x12b25b[_0x6dd5('0x16')](0x194);}return _0x407db2;};}function handleError(_0x4b2343,_0x274a00){_0x274a00=_0x274a00||0x1f4;return function(_0x23c9a4){logger[_0x6dd5('0x26')](_0x23c9a4[_0x6dd5('0x27')]);if(_0x23c9a4[_0x6dd5('0x28')]){delete _0x23c9a4[_0x6dd5('0x28')];}_0x4b2343['status'](_0x274a00)['send'](_0x23c9a4);};}exports['index']=function(_0x3ea75a,_0x5d9bc9){var _0x409f74={},_0x1754dd={},_0x9aab48={'count':0x0,'rows':[]};var _0x292dbf=_[_0x6dd5('0x29')](db[_0x6dd5('0x2a')][_0x6dd5('0x2b')],function(_0x41e360){return{'name':_0x41e360[_0x6dd5('0x2c')],'type':_0x41e360[_0x6dd5('0x2d')][_0x6dd5('0x2e')]};});_0x1754dd[_0x6dd5('0x2f')]=_['map'](_0x292dbf,_0x6dd5('0x28'));_0x1754dd[_0x6dd5('0x30')]=_[_0x6dd5('0x31')](_0x3ea75a[_0x6dd5('0x30')]);_0x1754dd['filters']=_['intersection'](_0x1754dd[_0x6dd5('0x2f')],_0x1754dd['query']);_0x409f74[_0x6dd5('0x32')]=_[_0x6dd5('0x33')](_0x1754dd['model'],qs[_0x6dd5('0x34')](_0x3ea75a[_0x6dd5('0x30')][_0x6dd5('0x34')]));_0x409f74[_0x6dd5('0x32')]=_0x409f74[_0x6dd5('0x32')][_0x6dd5('0x35')]?_0x409f74[_0x6dd5('0x32')]:_0x1754dd[_0x6dd5('0x2f')];if(!_0x3ea75a['query'][_0x6dd5('0x36')](_0x6dd5('0x37'))){_0x409f74[_0x6dd5('0x1b')]=qs[_0x6dd5('0x1b')](_0x3ea75a[_0x6dd5('0x30')][_0x6dd5('0x1b')]);_0x409f74['offset']=qs[_0x6dd5('0x1c')](_0x3ea75a[_0x6dd5('0x30')]['offset']);}_0x409f74[_0x6dd5('0x38')]=qs[_0x6dd5('0x39')](_0x3ea75a[_0x6dd5('0x30')][_0x6dd5('0x39')]);_0x409f74[_0x6dd5('0x3a')]=qs['filters'](_[_0x6dd5('0x3b')](_0x3ea75a[_0x6dd5('0x30')],_0x1754dd[_0x6dd5('0x3c')]),_0x292dbf);if(_0x3ea75a[_0x6dd5('0x30')][_0x6dd5('0x3d')]){_0x409f74[_0x6dd5('0x3a')]=_[_0x6dd5('0x3e')](_0x409f74[_0x6dd5('0x3a')],{'$or':_[_0x6dd5('0x29')](_0x292dbf,function(_0xa43722){if(_0xa43722[_0x6dd5('0x2d')]!=='VIRTUAL'){var _0x49ec67={};_0x49ec67[_0xa43722[_0x6dd5('0x28')]]={'$like':'%'+_0x3ea75a['query'][_0x6dd5('0x3d')]+'%'};return _0x49ec67;}})});}_0x409f74=_[_0x6dd5('0x3e')]({},_0x409f74,_0x3ea75a[_0x6dd5('0x3f')]);var _0x537f91={'where':_0x409f74[_0x6dd5('0x3a')]};return db['Attachment'][_0x6dd5('0x1d')](_0x537f91)[_0x6dd5('0x24')](function(_0x1f5f18){_0x9aab48['count']=_0x1f5f18;if(_0x3ea75a[_0x6dd5('0x30')][_0x6dd5('0x40')]){_0x409f74[_0x6dd5('0x41')]=[{'all':!![]}];}return db[_0x6dd5('0x2a')]['findAll'](_0x409f74);})[_0x6dd5('0x24')](function(_0x5495ea){_0x9aab48['rows']=_0x5495ea;return _0x9aab48;})['then'](respondWithFilteredResult(_0x5d9bc9,_0x409f74))[_0x6dd5('0x42')](handleError(_0x5d9bc9,null));};exports[_0x6dd5('0x43')]=function(_0x3cf571,_0x209ea7){var _0x30dff8={'raw':!![],'where':{'id':_0x3cf571[_0x6dd5('0x44')]['id']}},_0x4448d4={};_0x4448d4[_0x6dd5('0x2f')]=_[_0x6dd5('0x31')](db[_0x6dd5('0x2a')][_0x6dd5('0x2b')]);_0x4448d4['query']=_[_0x6dd5('0x31')](_0x3cf571['query']);_0x4448d4[_0x6dd5('0x3c')]=_[_0x6dd5('0x33')](_0x4448d4[_0x6dd5('0x2f')],_0x4448d4[_0x6dd5('0x30')]);_0x30dff8[_0x6dd5('0x32')]=_[_0x6dd5('0x33')](_0x4448d4[_0x6dd5('0x2f')],qs['fields'](_0x3cf571['query'][_0x6dd5('0x34')]));_0x30dff8['attributes']=_0x30dff8[_0x6dd5('0x32')][_0x6dd5('0x35')]?_0x30dff8[_0x6dd5('0x32')]:_0x4448d4['model'];if(_0x3cf571[_0x6dd5('0x30')][_0x6dd5('0x40')]){_0x30dff8[_0x6dd5('0x41')]=[{'all':!![]}];}_0x30dff8=_[_0x6dd5('0x3e')]({},_0x30dff8,_0x3cf571[_0x6dd5('0x3f')]);return db['Attachment']['find'](_0x30dff8)['then'](handleEntityNotFound(_0x209ea7,null))[_0x6dd5('0x24')](respondWithResult(_0x209ea7,null))[_0x6dd5('0x42')](handleError(_0x209ea7,null));};exports['clone']=function(_0x46dc28,_0x4c8569){var _0x31f761={'where':{'id':_0x46dc28['params']['id']}},_0x7cbe1a={};_0x7cbe1a[_0x6dd5('0x2f')]=_['keys'](db[_0x6dd5('0x2a')][_0x6dd5('0x2b')]);_0x31f761[_0x6dd5('0x32')]=_[_0x6dd5('0x33')](_0x7cbe1a[_0x6dd5('0x2f')],qs['fields'](_0x46dc28[_0x6dd5('0x30')][_0x6dd5('0x34')]));_0x31f761['attributes']=_0x31f761[_0x6dd5('0x32')]['length']?_0x31f761[_0x6dd5('0x32')]:_0x7cbe1a['model'];if(_0x46dc28[_0x6dd5('0x30')]['includeAll']){_0x31f761[_0x6dd5('0x41')]=[{'all':!![]}];}_0x31f761=_[_0x6dd5('0x3e')]({},_0x31f761,_0x46dc28[_0x6dd5('0x3f')]);return db['Attachment'][_0x6dd5('0x45')](_0x31f761)[_0x6dd5('0x24')](handleEntityNotFound(_0x4c8569,null))[_0x6dd5('0x24')](function(_0xb1237e){if(_0xb1237e){var _0x1496cb=_0xb1237e['get']({'plain':!![]});_0x1496cb=qs[_0x6dd5('0x46')](_0x1496cb,['id',_0x6dd5('0x47'),_0x6dd5('0x48')]);_0x46dc28[_0x6dd5('0x49')]=_['omit'](_0x46dc28['body'],['id',_0x6dd5('0x47'),_0x6dd5('0x48')]);return db[_0x6dd5('0x2a')][_0x6dd5('0x4a')](_[_0x6dd5('0x3e')](_0x1496cb,_0x46dc28['body']),{'include':_0x46dc28['query'][_0x6dd5('0x40')]?[{'all':!![]}]:undefined});}})[_0x6dd5('0x24')](respondWithResult(_0x4c8569,0xc9))[_0x6dd5('0x42')](handleError(_0x4c8569,null));};exports[_0x6dd5('0x23')]=function(_0x631495,_0x2c423e){if(_0x631495[_0x6dd5('0x49')]['id']){delete _0x631495[_0x6dd5('0x49')]['id'];}return db[_0x6dd5('0x2a')][_0x6dd5('0x45')]({'where':{'id':_0x631495[_0x6dd5('0x44')]['id']}})[_0x6dd5('0x24')](handleEntityNotFound(_0x2c423e,null))[_0x6dd5('0x24')](saveUpdates(_0x631495['body'],null))[_0x6dd5('0x24')](respondWithResult(_0x2c423e,null))[_0x6dd5('0x42')](handleError(_0x2c423e,null));};exports[_0x6dd5('0x25')]=function(_0x3c857d,_0x1e51ff){return db['Attachment']['find']({'where':{'id':_0x3c857d[_0x6dd5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e51ff,null))['then'](removeEntity(_0x1e51ff,null))[_0x6dd5('0x42')](handleError(_0x1e51ff,null));};exports[_0x6dd5('0x4a')]=function(_0x514266,_0x3cbfb3,_0x3dc0ff){_0x514266[_0x6dd5('0x49')]['name']=_0x514266[_0x6dd5('0x4b')][_0x6dd5('0x4c')];_0x514266[_0x6dd5('0x49')][_0x6dd5('0x4d')]=_0x514266[_0x6dd5('0x4b')]['filename'];_0x514266[_0x6dd5('0x49')][_0x6dd5('0x2d')]=_0x514266[_0x6dd5('0x4b')][_0x6dd5('0x4e')];return db['Attachment'][_0x6dd5('0x4a')](_0x514266[_0x6dd5('0x49')])[_0x6dd5('0x24')](respondWithResult(_0x3cbfb3,0xc9))[_0x6dd5('0x42')](handleError(_0x3cbfb3,null));};exports[_0x6dd5('0x4f')]=function(_0x3d2bfa,_0x5803fd,_0x21c665){return db[_0x6dd5('0x2a')][_0x6dd5('0x50')]({'where':{'id':_0x3d2bfa['params']['id']},'raw':!![]})[_0x6dd5('0x24')](handleEntityNotFound(_0x5803fd,null))[_0x6dd5('0x24')](function(_0x5146d0){if(_0x5146d0){var _0x1bf3e1=_0x5146d0[_0x6dd5('0x51')]!==null;var _0x39010c=path[_0x6dd5('0x52')](config[_0x6dd5('0x53')],_0x6dd5('0x54'));if(_0x1bf3e1){_0x39010c=path[_0x6dd5('0x52')](_0x39010c,_0x6dd5('0x55'));}var _0x6b429a=path[_0x6dd5('0x52')](_0x39010c,_0x5146d0[_0x6dd5('0x4d')]);return _0x5803fd[_0x6dd5('0x4f')](_0x6b429a);}})[_0x6dd5('0x42')](handleError(_0x5803fd,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index be0bb2e..afd54d1 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 _0x34b5=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','lodash'];(function(_0x202ecc,_0x3ce5b0){var _0x102089=function(_0x176bd2){while(--_0x176bd2){_0x202ecc['push'](_0x202ecc['shift']());}};_0x102089(++_0x3ce5b0);}(_0x34b5,0x11f));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x534b('0x0'));var util=require(_0x534b('0x1'));var logger=require(_0x534b('0x2'))('api');var moment=require(_0x534b('0x3'));var BPromise=require(_0x534b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x534b('0x5'));var rimraf=require(_0x534b('0x6'));var config=require(_0x534b('0x7'));var attributes=require(_0x534b('0x8'));module[_0x534b('0x9')]=function(_0x3c5bab,_0x5f352a){return _0x3c5bab[_0x534b('0xa')](_0x534b('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6349=['exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x6349,0x18c));var _0x9634=function(_0x1f8d06,_0x55a035){_0x1f8d06=_0x1f8d06-0x0;var _0x164b6c=_0x6349[_0x1f8d06];return _0x164b6c;};'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(_0x9634('0x5'));var rp=require(_0x9634('0x6'));var fs=require('fs');var path=require(_0x9634('0x7'));var rimraf=require('rimraf');var config=require(_0x9634('0x8'));var attributes=require(_0x9634('0x9'));module[_0x9634('0xa')]=function(_0x3d2ab6,_0x1e47d5){return _0x3d2ab6[_0x9634('0xb')](_0x9634('0xc'),attributes,{'tableName':_0x9634('0xd'),'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 50c83bd..49a3404 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 _0xf3cd=['stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x12b22d,_0x1f044a){var _0x31dff7=function(_0x52e1e2){while(--_0x52e1e2){_0x12b22d['push'](_0x12b22d['shift']());}};_0x31dff7(++_0x1f044a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xf3cd[_0x4ca333];return _0x13b2e1;};'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')]('Attachment,\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')]('Attachment,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});}exports[_0xdf3c('0x17')]=function(_0x465e7d){var _0xf1da1f=this;return new Promise(function(_0x18d4ec,_0x1e2690){return db[_0xdf3c('0x18')][_0xdf3c('0x19')](_0x465e7d[_0xdf3c('0x1a')],{'raw':_0x465e7d[_0xdf3c('0x1b')]?_0x465e7d[_0xdf3c('0x1b')][_0xdf3c('0x1c')]===undefined?!![]:![]:!![]})[_0xdf3c('0x1d')](function(_0x25487c){logger['info']('CreateAttachment',_0x465e7d);logger[_0xdf3c('0xe')]('CreateAttachment',_0x465e7d,JSON[_0xdf3c('0x10')](_0x25487c));_0x18d4ec(_0x25487c);})[_0xdf3c('0x16')](function(_0x36552e){logger[_0xdf3c('0x11')](_0xdf3c('0x17'),_0x36552e[_0xdf3c('0x14')],_0x465e7d);_0x1e2690(_0xf1da1f['error'](0x1f4,_0x36552e[_0xdf3c('0x14')]));});});}; \ No newline at end of file +var _0x4f29=['../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','then','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x4f29,0xfd));var _0x94f2=function(_0x2dab3a,_0x38308f){_0x2dab3a=_0x2dab3a-0x0;var _0x1dd99e=_0x4f29[_0x2dab3a];return _0x1dd99e;};'use strict';var _=require('lodash');var util=require(_0x94f2('0x0'));var moment=require(_0x94f2('0x1'));var BPromise=require(_0x94f2('0x2'));var rs=require(_0x94f2('0x3'));var fs=require('fs');var Redis=require(_0x94f2('0x4'));var db=require(_0x94f2('0x5'))['db'];var utils=require(_0x94f2('0x6'));var logger=require(_0x94f2('0x7'))(_0x94f2('0x8'));var config=require(_0x94f2('0x9'));var jayson=require(_0x94f2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe14ba5,_0x4042b1,_0x1d1910){return new BPromise(function(_0x224a93,_0x3eca06){return client['request'](_0xe14ba5,_0x1d1910)['then'](function(_0x5bc91c){logger[_0x94f2('0xb')]('Attachment,\x20%s,\x20%s',_0x4042b1,_0x94f2('0xc'));logger[_0x94f2('0xd')](_0x94f2('0xe'),_0x4042b1,_0x94f2('0xc'),JSON['stringify'](_0x5bc91c));if(_0x5bc91c[_0x94f2('0xf')]){if(_0x5bc91c[_0x94f2('0xf')][_0x94f2('0x10')]===0x1f4){logger[_0x94f2('0xf')](_0x94f2('0x11'),_0x4042b1,_0x5bc91c[_0x94f2('0xf')][_0x94f2('0x12')]);return _0x3eca06(_0x5bc91c['error'][_0x94f2('0x12')]);}logger['error'](_0x94f2('0x11'),_0x4042b1,_0x5bc91c[_0x94f2('0xf')][_0x94f2('0x12')]);return _0x224a93(_0x5bc91c['error']['message']);}else{logger[_0x94f2('0xb')](_0x94f2('0x11'),_0x4042b1,_0x94f2('0xc'));_0x224a93(_0x5bc91c['result'][_0x94f2('0x12')]);}})[_0x94f2('0x13')](function(_0x5ae9d2){logger['error'](_0x94f2('0x11'),_0x4042b1,_0x5ae9d2);_0x3eca06(_0x5ae9d2);});});}exports[_0x94f2('0x14')]=function(_0x32100c){var _0x59b045=this;return new Promise(function(_0x302c00,_0x294157){return db[_0x94f2('0x15')][_0x94f2('0x16')](_0x32100c['body'],{'raw':_0x32100c[_0x94f2('0x17')]?_0x32100c[_0x94f2('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x94f2('0x18')](function(_0x25bd7f){logger[_0x94f2('0xb')](_0x94f2('0x14'),_0x32100c);logger[_0x94f2('0xd')](_0x94f2('0x14'),_0x32100c,JSON[_0x94f2('0x19')](_0x25bd7f));_0x302c00(_0x25bd7f);})[_0x94f2('0x13')](function(_0x3da505){logger[_0x94f2('0xf')](_0x94f2('0x14'),_0x3da505[_0x94f2('0x12')],_0x32100c);_0x294157(_0x59b045[_0x94f2('0xf')](0x1f4,_0x3da505[_0x94f2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a1c4e93..9939fa6 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5a5ac8,_0x377065){var _0x4b52dc=function(_0x58769e){while(--_0x58769e){_0x5a5ac8['push'](_0x5a5ac8['shift']());}};_0x4b52dc(++_0x377065);}(_0x5f2f,0x73));var _0xf5f2=function(_0x58d56e,_0x63f0bd){_0x58d56e=_0x58d56e-0x0;var _0x5a1dbc=_0x5f2f[_0x58d56e];return _0x5a1dbc;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0xecdd36,_0x576e32){var _0x1c729a=function(_0x499069){while(--_0x499069){_0xecdd36['push'](_0xecdd36['shift']());}};_0x1c729a(++_0x576e32);}(_0x5f2f,0x73));var _0xf5f2=function(_0x432324,_0x3e5677){_0x432324=_0x432324-0x0;var _0x2b2267=_0x5f2f[_0x432324];return _0x2b2267;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d92c3aa..9178d19 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 _0xf058=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','user','blockDuration','add','minutes','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','ad-login','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','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','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then'];(function(_0x5b5f70,_0xc951e6){var _0x3affc7=function(_0x449708){while(--_0x449708){_0x5b5f70['push'](_0x5b5f70['shift']());}};_0x3affc7(++_0xc951e6);}(_0xf058,0x13f));var _0x8f05=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf058[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x8f05('0x0'));var LocalStrategy=require(_0x8f05('0x1'))[_0x8f05('0x2')];var moment=require(_0x8f05('0x3'));var ActiveDirectory=require(_0x8f05('0x4'));var BPromise=require(_0x8f05('0x5'));var util=require(_0x8f05('0x6'));var db=require(_0x8f05('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require(_0x8f05('0x8'))(_0x8f05('0x9'));function isActiveDirectoryConfigured(_0x3f72ac){var _0xa2cd68=![];if(typeof _0x3f72ac[_0x8f05('0xa')]!=='undefined'){_0xa2cd68=_0x3f72ac['activedirectory'][_0x8f05('0xb')]&&_0x3f72ac['activedirectory'][_0x8f05('0xc')]&&_0x3f72ac[_0x8f05('0xa')][_0x8f05('0xd')];}return _0xa2cd68;}function adAuthenticate(_0x277814,_0x24aad3,_0x271f3a){return new BPromise(function(_0x19b6b9,_0x5d6155){try{var _0x4901c8=new ActiveDirectory(_0x277814);_0x4901c8[_0x8f05('0xe')](_0x24aad3,_0x271f3a,function(_0x5ce7a1,_0x3b127e){if(_0x5ce7a1){logger['error'](_0x8f05('0xf'),_0x24aad3,util['inspect'](_0x5ce7a1,{'showHidden':![],'depth':null}));_0x5d6155(_0x8f05('0x10'));}else if(!_0x3b127e){logger['error'](_0x8f05('0x11'),_0x24aad3);_0x5d6155('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x19b6b9(_0x3b127e);}});}catch(_0xafb550){_0x5d6155(_0xafb550);}});}function ActiveDirectoryAuthenticate(_0x2978d2,_0x3f7742,_0x2444c3,_0x49096b){var _0x2e9ff9,_0x3d452f;if(!isActiveDirectoryConfigured(config)){logger[_0x8f05('0x12')](_0x8f05('0x13'),_0x3f7742);return _0x49096b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x8f05('0x14')][_0x8f05('0x15')]({'where':{'id':0x1},'attributes':[_0x8f05('0x16'),'blockDuration'],'raw':!![]})[_0x8f05('0x17')](function(_0x34b32c){_0x2e9ff9=_0x34b32c;if(!_0x2e9ff9[_0x8f05('0x16')]){logger[_0x8f05('0x12')](_0x8f05('0x18'),_0x3f7742);throw new Error(_0x8f05('0x10'));}return _0x2978d2[_0x8f05('0x15')]({'attributes':['id',_0x8f05('0x19'),_0x8f05('0x1a'),_0x8f05('0x1b'),_0x8f05('0x1c'),_0x8f05('0x1d'),_0x8f05('0x1e'),_0x8f05('0x1f'),_0x8f05('0x20')],'where':{'name':_0x3f7742,'role':{'$or':[_0x8f05('0x21'),_0x8f05('0x22'),'agent']},'adSsoEnabled':!![]}});})[_0x8f05('0x17')](function(_0x140bb3){if(!_0x140bb3||_0x140bb3&&_0x140bb3[_0x8f05('0x19')]!==_0x3f7742){throw new Error(_0x8f05('0x10'));}_0x3d452f=_0x140bb3;var _0x43d22d=_0x3d452f[_0x8f05('0x19')]+'@'+config['activedirectory']['domain'];return adAuthenticate(config['activedirectory'],_0x43d22d,_0x2444c3);})[_0x8f05('0x17')](function(_0x2786ab){if(_0x3d452f[_0x8f05('0x1d')]){throw new Error(_0x8f05('0x10'));}if(_0x2e9ff9[_0x8f05('0x23')]>0x0){if(_0x3d452f[_0x8f05('0x1e')]){if(moment(_0x3d452f[_0x8f05('0x1f')])[_0x8f05('0x24')](_0x2e9ff9['blockDuration'],_0x8f05('0x25'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x3d452f,0x0,![],null)['then'](function(){return utils[_0x8f05('0x26')](_0x3d452f);})['then'](function(){return _0x49096b(null,_0x3d452f);});}else{return utils['getLicense'](_0x3d452f)[_0x8f05('0x17')](function(){return _0x49096b(null,_0x3d452f);});}}else{return utils[_0x8f05('0x26')](_0x3d452f)[_0x8f05('0x17')](function(){return _0x49096b(null,_0x3d452f);});}})[_0x8f05('0x27')](function(_0x33d88c){return _0x49096b(null,![],_0x33d88c);});}function handleError(_0x38acea,_0x305742,_0x44a353){return _0x38acea[_0x8f05('0x28')](_0x305742||0x1f4)[_0x8f05('0x29')]({'message':_0x44a353?_0x44a353[_0x8f05('0x2a')]||_0x44a353:''});}exports[_0x8f05('0x2b')]=function(_0xa6255e,_0x45ef97,_0x13e68d){passport[_0x8f05('0xe')]('ad-login',function(_0x39d76c,_0x36d470,_0x5771ef){var _0x29079f=_0x39d76c||_0x5771ef;if(_0x29079f){return handleError(_0x45ef97,0x191,_0x29079f);}if(!_0x36d470){return handleError(_0x45ef97,0x194,{'message':_0x8f05('0x2c')});}else{var _0x4e1053={'payload':{'id':_0x36d470['id'],'role':_0x36d470['role']},'options':{'expiresIn':0x15180}};return authService[_0x8f05('0x2d')](_0x4e1053)['then'](function(_0x524fc0){_0x45ef97[_0x8f05('0x2e')]({'id':_0x36d470['id'],'token':_0x524fc0,'statusCall':'','isAlreadyLogged':_0x36d470[_0x8f05('0x20')]});});}})(_0xa6255e,_0x45ef97,_0x13e68d);};passport['use'](_0x8f05('0x2f'),new LocalStrategy({'usernameField':_0x8f05('0x19'),'passwordField':'password'},function(_0x33d271,_0x2dde7c,_0x3e80e7){return ActiveDirectoryAuthenticate(db[_0x8f05('0x30')],_0x33d271,_0x2dde7c,_0x3e80e7);})); \ No newline at end of file +var _0x51ac=['baseDN','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:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','blocked','online','agent','disabled','add','minutes','clearBlockUser','getLicense','catch','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','ad-login','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined'];(function(_0x5c353c,_0x2ae92d){var _0xd384b2=function(_0x4f529c){while(--_0x4f529c){_0x5c353c['push'](_0x5c353c['shift']());}};_0xd384b2(++_0x2ae92d);}(_0x51ac,0xfd));var _0xc51a=function(_0x4934a8,_0x4a10e5){_0x4934a8=_0x4934a8-0x0;var _0x1ab798=_0x51ac[_0x4934a8];return _0x1ab798;};'use strict';var passport=require(_0xc51a('0x0'));var LocalStrategy=require(_0xc51a('0x1'))[_0xc51a('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xc51a('0x3'));var BPromise=require(_0xc51a('0x4'));var util=require(_0xc51a('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xc51a('0x6'));var utils=require(_0xc51a('0x7'));var config=require('../../config/environment');var logger=require(_0xc51a('0x8'))('api');function isActiveDirectoryConfigured(_0x412160){var _0x4516ef=![];if(typeof _0x412160[_0xc51a('0x9')]!==_0xc51a('0xa')){_0x4516ef=_0x412160[_0xc51a('0x9')][_0xc51a('0xb')]&&_0x412160['activedirectory'][_0xc51a('0xc')]&&_0x412160[_0xc51a('0x9')][_0xc51a('0xd')];}return _0x4516ef;}function adAuthenticate(_0x2e7a46,_0x1bd35d,_0x27a3b2){return new BPromise(function(_0x3c48ee,_0xfc5b15){try{var _0x5d21dd=new ActiveDirectory(_0x2e7a46);_0x5d21dd[_0xc51a('0xe')](_0x1bd35d,_0x27a3b2,function(_0x4083c1,_0x346ad8){if(_0x4083c1){logger[_0xc51a('0xf')](_0xc51a('0x10'),_0x1bd35d,util['inspect'](_0x4083c1,{'showHidden':![],'depth':null}));_0xfc5b15(_0xc51a('0x11'));}else if(!_0x346ad8){logger[_0xc51a('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x1bd35d);_0xfc5b15(_0xc51a('0x11'));}else{_0x3c48ee(_0x346ad8);}});}catch(_0x5d43b9){_0xfc5b15(_0x5d43b9);}});}function ActiveDirectoryAuthenticate(_0x504c46,_0xc93c5c,_0x322265,_0x20502e){var _0x76d146,_0x327399;if(!isActiveDirectoryConfigured(config)){logger[_0xc51a('0xf')](_0xc51a('0x12'),_0xc93c5c);return _0x20502e(null,![],{'message':_0xc51a('0x11')});}return db[_0xc51a('0x13')][_0xc51a('0x14')]({'where':{'id':0x1},'attributes':[_0xc51a('0x15'),_0xc51a('0x16')],'raw':!![]})[_0xc51a('0x17')](function(_0x4dc16f){_0x76d146=_0x4dc16f;if(!_0x76d146[_0xc51a('0x15')]){logger['error'](_0xc51a('0x18'),_0xc93c5c);throw new Error(_0xc51a('0x11'));}return _0x504c46[_0xc51a('0x14')]({'attributes':['id',_0xc51a('0x19'),_0xc51a('0x1a'),_0xc51a('0x1b'),'role','disabled',_0xc51a('0x1c'),'blockedAt',_0xc51a('0x1d')],'where':{'name':_0xc93c5c,'role':{'$or':['admin','user',_0xc51a('0x1e')]},'adSsoEnabled':!![]}});})[_0xc51a('0x17')](function(_0x14dba4){if(!_0x14dba4||_0x14dba4&&_0x14dba4[_0xc51a('0x19')]!==_0xc93c5c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x327399=_0x14dba4;var _0xe22743=_0x327399['name']+'@'+config[_0xc51a('0x9')][_0xc51a('0xd')];return adAuthenticate(config[_0xc51a('0x9')],_0xe22743,_0x322265);})['then'](function(_0x18ff51){if(_0x327399[_0xc51a('0x1f')]){throw new Error(_0xc51a('0x11'));}if(_0x76d146[_0xc51a('0x16')]>0x0){if(_0x327399[_0xc51a('0x1c')]){if(moment(_0x327399['blockedAt'])[_0xc51a('0x20')](_0x76d146[_0xc51a('0x16')],_0xc51a('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xc51a('0x22')](_0x327399,0x0,![],null)[_0xc51a('0x17')](function(){return utils[_0xc51a('0x23')](_0x327399);})[_0xc51a('0x17')](function(){return _0x20502e(null,_0x327399);});}else{return utils['getLicense'](_0x327399)[_0xc51a('0x17')](function(){return _0x20502e(null,_0x327399);});}}else{return utils[_0xc51a('0x23')](_0x327399)[_0xc51a('0x17')](function(){return _0x20502e(null,_0x327399);});}})[_0xc51a('0x24')](function(_0x396aa1){return _0x20502e(null,![],_0x396aa1);});}function handleError(_0x274ec3,_0x441e78,_0x21ce21){return _0x274ec3['status'](_0x441e78||0x1f4)['send']({'message':_0x21ce21?_0x21ce21['message']||_0x21ce21:''});}exports[_0xc51a('0x25')]=function(_0x11919f,_0x57bc9a,_0x2a975d){passport[_0xc51a('0xe')]('ad-login',function(_0x432e94,_0x4e0665,_0x8f1509){var _0xdcf618=_0x432e94||_0x8f1509;if(_0xdcf618){return handleError(_0x57bc9a,0x191,_0xdcf618);}if(!_0x4e0665){return handleError(_0x57bc9a,0x194,{'message':_0xc51a('0x26')});}else{var _0x28b3eb={'payload':{'id':_0x4e0665['id'],'role':_0x4e0665[_0xc51a('0x27')]},'options':{'expiresIn':0x15180}};return authService[_0xc51a('0x28')](_0x28b3eb)[_0xc51a('0x17')](function(_0x500888){_0x57bc9a[_0xc51a('0x29')]({'id':_0x4e0665['id'],'token':_0x500888,'statusCall':'','isAlreadyLogged':_0x4e0665['online']});});}})(_0x11919f,_0x57bc9a,_0x2a975d);};passport['use'](_0xc51a('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0xc51a('0x1a')},function(_0x3e4638,_0x402a0b,_0x154ca3){return ActiveDirectoryAuthenticate(db[_0xc51a('0x2b')],_0x3e4638,_0x402a0b,_0x154ca3);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index d53c3c9..b5fad79 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 _0x4466=['./authActiveDirectory.controller','post','express'];(function(_0x19e9be,_0xb2e144){var _0xb3d255=function(_0x4ca068){while(--_0x4ca068){_0x19e9be['push'](_0x19e9be['shift']());}};_0xb3d255(++_0xb2e144);}(_0x4466,0x1a0));var _0x6446=function(_0x3f2855,_0x220576){_0x3f2855=_0x3f2855-0x0;var _0x20c16f=_0x4466[_0x3f2855];return _0x20c16f;};'use strict';var express=require(_0x6446('0x0'));var router=express['Router']();var controller=require(_0x6446('0x1'));router[_0x6446('0x2')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x9c38=['exports','express'];(function(_0x35499e,_0x17900e){var _0x4a5f00=function(_0x2d99ab){while(--_0x2d99ab){_0x35499e['push'](_0x35499e['shift']());}};_0x4a5f00(++_0x17900e);}(_0x9c38,0x167));var _0x89c3=function(_0x78fb3,_0x422411){_0x78fb3=_0x78fb3-0x0;var _0x58ef4a=_0x9c38[_0x78fb3];return _0x58ef4a;};'use strict';var express=require(_0x89c3('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router['post']('/',controller['login']);module[_0x89c3('0x1')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7417220..7d1c3a0 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x2c047b,_0xa3ad1e){var _0x842d98=function(_0x54d0d6){while(--_0x54d0d6){_0x2c047b['push'](_0x2c047b['shift']());}};_0x842d98(++_0xa3ad1e);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7a54,0x106));var _0x47a5=function(_0xde7884,_0x1b8f96){_0xde7884=_0xde7884-0x0;var _0x4b260c=_0x7a54[_0xde7884];return _0x4b260c;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 61cc6ed..fa08c87 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 _0xf438=['exports','express','Router','../user/user.controller.js','../../components/auth/service','get','callback','isMiddleware','login','setTokenCookie'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf438,0x14b));var _0x8f43=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xf438[_0x3511d3];return _0x5d6321;};'use strict';var express=require(_0x8f43('0x0'));var passport=require('passport');var router=express[_0x8f43('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x8f43('0x2'));var authService=require(_0x8f43('0x3'));router['get']('/',controller['login']);router[_0x8f43('0x4')]('/callback',controller[_0x8f43('0x5')],authService[_0x8f43('0x6')],userController[_0x8f43('0x7')],authService[_0x8f43('0x8')]);module[_0x8f43('0x9')]=router; \ No newline at end of file +var _0xcb16=['exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','setTokenCookie'];(function(_0x962edb,_0x5dd356){var _0x359dcf=function(_0x978f40){while(--_0x978f40){_0x962edb['push'](_0x962edb['shift']());}};_0x359dcf(++_0x5dd356);}(_0xcb16,0x109));var _0x6cb1=function(_0x318152,_0x4c8bd2){_0x318152=_0x318152-0x0;var _0x1c05e8=_0xcb16[_0x318152];return _0x1c05e8;};'use strict';var express=require(_0x6cb1('0x0'));var passport=require(_0x6cb1('0x1'));var router=express[_0x6cb1('0x2')]();var controller=require(_0x6cb1('0x3'));var userController=require(_0x6cb1('0x4'));var authService=require(_0x6cb1('0x5'));router[_0x6cb1('0x6')]('/',controller[_0x6cb1('0x7')]);router[_0x6cb1('0x6')](_0x6cb1('0x8'),controller['callback'],authService['isMiddleware'],userController[_0x6cb1('0x7')],authService[_0x6cb1('0x9')]);module[_0x6cb1('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 b0daf16..4cd5182 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 _0x09b3=['Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','/reset/','status','Reset\x20Email\x20sent!','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','blockedAt','clearBlockUser','add','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','user','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','email','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','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(_0x2d9d42,_0x46bb08){var _0x325e9f=function(_0x49d1b7){while(--_0x49d1b7){_0x2d9d42['push'](_0x2d9d42['shift']());}};_0x325e9f(++_0x46bb08);}(_0x09b3,0x1f2));var _0x309b=function(_0x816369,_0x5092f6){_0x816369=_0x816369-0x0;var _0xbbd9bc=_0x09b3[_0x816369];return _0xbbd9bc;};'use strict';var util=require(_0x309b('0x0'));var passport=require('passport');var LocalStrategy=require(_0x309b('0x1'))['Strategy'];var jayson=require(_0x309b('0x2'));var _=require(_0x309b('0x3'));var rs=require(_0x309b('0x4'));var moment=require(_0x309b('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0x309b('0x6'));var utils=require(_0x309b('0x7'));var client=jayson[_0x309b('0x8')][_0x309b('0x9')]({'port':0x232b});function localAuthenticate(_0x141d90,_0x483aea,_0x5a0c4b,_0x162ad0){var _0x1bd447,_0x211a99;return db['Setting'][_0x309b('0xa')]({'where':{'id':0x1},'attributes':[_0x309b('0xb'),'blockDuration'],'raw':!![]})[_0x309b('0xc')](function(_0x31b0cb){_0x1bd447=_0x31b0cb;return _0x141d90[_0x309b('0xa')]({'attributes':['id',_0x309b('0xd'),_0x309b('0xe'),_0x309b('0xf'),_0x309b('0x10'),_0x309b('0x11'),_0x309b('0x12'),'blockedAt',_0x309b('0x13')],'where':{'name':_0x483aea,'role':{'$or':[_0x309b('0x14'),'user','agent']}}});})[_0x309b('0xc')](function(_0x160e9e){if(!_0x160e9e||_0x160e9e&&_0x160e9e[_0x309b('0xd')]!==_0x483aea){throw new Error(_0x309b('0x15'));}else{_0x211a99=_0x160e9e;return _0x211a99;}})['then'](function(){_0x211a99[_0x309b('0x16')](_0x5a0c4b,function(_0x3e66ae,_0x1e9311){var _0x36057c=_0x211a99[_0x309b('0x13')]+0x1;if(_0x3e66ae){return _0x162ad0(_0x3e66ae);}else if(!_0x1e9311){if(_0x211a99['disabled']){return _0x162ad0(null,![],{'message':_0x309b('0x15')});}else if(_0x1bd447['allowedLoginAttempts']>0x0){if(_0x211a99[_0x309b('0x12')]){if(_0x1bd447[_0x309b('0x17')]>0x0){if(moment(_0x211a99[_0x309b('0x18')])['add'](_0x1bd447[_0x309b('0x17')],'minutes')>moment()){return _0x162ad0(null,![],{'message':_0x309b('0x15')});}else{return utils[_0x309b('0x19')](_0x211a99,_0x36057c,![],null)[_0x309b('0xc')](function(){return _0x162ad0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x162ad0(null,![],{'message':_0x309b('0x15')});}}else{if(_0x36057c>=_0x1bd447[_0x309b('0xb')]){return utils['clearBlockUser'](_0x211a99,0x0,!![],moment())[_0x309b('0xc')](function(){return _0x162ad0(null,![],{'message':_0x309b('0x15')});});}else{return utils[_0x309b('0x19')](_0x211a99,_0x36057c,![],null)[_0x309b('0xc')](function(){return _0x162ad0(null,![],{'message':_0x309b('0x15')});});}}}else{return _0x162ad0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x211a99[_0x309b('0x11')]){return _0x162ad0(null,![],{'message':_0x309b('0x15')});}else if(_0x1bd447[_0x309b('0xb')]>0x0){if(_0x211a99[_0x309b('0x12')]){if(_0x1bd447[_0x309b('0x17')]>0x0){if(moment(_0x211a99[_0x309b('0x18')])[_0x309b('0x1a')](_0x1bd447['blockDuration'],_0x309b('0x1b'))>moment()){return _0x162ad0(null,![],{'message':_0x309b('0x15')});}else{return utils[_0x309b('0x19')](_0x211a99,0x0,![],null)[_0x309b('0xc')](function(){return utils['getLicense'](_0x211a99);})[_0x309b('0xc')](function(){return _0x162ad0(null,_0x211a99);});}}else{return _0x162ad0(null,![],{'message':_0x309b('0x15')});}}else{return utils[_0x309b('0x19')](_0x211a99,0x0,![],null)['then'](function(){return utils[_0x309b('0x1c')](_0x211a99);})['then'](function(){return _0x162ad0(null,_0x211a99);})['catch'](function(_0x575bea){return _0x162ad0(null,![],_0x575bea);});}}else{if(_0x211a99[_0x309b('0x12')]){return _0x162ad0(null,![],{'message':_0x309b('0x15')});}else{return utils[_0x309b('0x1c')](_0x211a99)[_0x309b('0xc')](function(){return _0x162ad0(null,_0x211a99);});}}}});})[_0x309b('0x1d')](function(_0x4fe00f){return _0x162ad0(null,![],_0x4fe00f);});}function sendServiceMail(_0x27eaf4){return db[_0x309b('0x1e')][_0x309b('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x309b('0xd'),'email'],'include':[{'model':db[_0x309b('0x20')],'as':_0x309b('0x21'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]})[_0x309b('0xc')](function(_0x51b6a8){if(!_0x51b6a8){throw new Error(_0x309b('0x22'));}var _0x2ce800=_0x51b6a8['getSmtpOptions']();var _0x1e7b92={'account':_0x2ce800,'message':_[_0x309b('0x23')]({'from':util[_0x309b('0x24')](_0x309b('0x25'),_0x51b6a8[_0x309b('0xd')],_0x51b6a8['email']||_0x51b6a8[_0x309b('0x21')][_0x309b('0x26')])},_0x27eaf4)};return client['request'](_0x309b('0x27'),_0x1e7b92);})[_0x309b('0xc')](function(_0x12b0cb){if(_0x12b0cb[_0x309b('0x28')]){throw new Error(util[_0x309b('0x24')](_0x309b('0x29'),_0x12b0cb[_0x309b('0x28')][_0x309b('0x2a')]||JSON[_0x309b('0x2b')](_0x12b0cb[_0x309b('0x28')])));}return!![];});}function handleError(_0x13b811,_0x4c364d,_0x48481c){return _0x13b811['status'](_0x4c364d||0x1f4)[_0x309b('0x2c')]({'message':_0x48481c?_0x48481c[_0x309b('0x2a')]||_0x48481c:''});}exports[_0x309b('0x2d')]=function(_0x31dbbc,_0x280bb6,_0x448c24){passport[_0x309b('0x16')]('local-login',function(_0x1d8591,_0x48dbe2,_0x59be9a){var _0x2346d4=_0x1d8591||_0x59be9a;if(_0x2346d4){return handleError(_0x280bb6,0x191,_0x2346d4);}if(!_0x48dbe2){return handleError(_0x280bb6,0x194,{'message':_0x309b('0x2e')});}else{var _0x3c4050={'payload':{'id':_0x48dbe2['id'],'role':_0x48dbe2[_0x309b('0x10')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x3c4050)[_0x309b('0xc')](function(_0x27d3cf){_0x280bb6[_0x309b('0x2f')]({'id':_0x48dbe2['id'],'token':_0x27d3cf,'statusCall':'','isAlreadyLogged':_0x48dbe2[_0x309b('0x30')]});});}})(_0x31dbbc,_0x280bb6,_0x448c24);};exports[_0x309b('0x31')]=function(_0x4583b5,_0x2cae7a){if(!_0x4583b5[_0x309b('0x32')][_0x309b('0x33')]){return handleError(_0x2cae7a,0x1f4,{'message':_0x309b('0x34')});}var _0x4c49ab=rs['generate']();_0x4583b5[_0x309b('0x32')]['email']=_0x4583b5['body']['email'][_0x309b('0x35')]()[_0x309b('0x36')]();var _0x408545;return db['Setting'][_0x309b('0xa')]({'where':{'id':0x1},'attributes':[_0x309b('0xb'),_0x309b('0x17')],'raw':!![]})['then'](function(_0x301e87){_0x408545=_0x301e87;return db[_0x309b('0x37')][_0x309b('0x1f')]({'where':{'email':_0x4583b5[_0x309b('0x32')][_0x309b('0x33')]}});})[_0x309b('0xc')](function(_0x58a1dc){if(!_0x58a1dc){throw new Error(_0x309b('0x38'));}if(_0x58a1dc['disabled']){throw new Error(_0x309b('0x39'));}if(_0x58a1dc[_0x309b('0x12')]){if(moment(_0x58a1dc[_0x309b('0x18')])['add'](_0x408545[_0x309b('0x17')],_0x309b('0x1b'))>moment()){throw new Error(_0x309b('0x3a'));}else{_0x58a1dc[_0x309b('0x12')]=![];_0x58a1dc[_0x309b('0x18')]=null;}}_0x58a1dc[_0x309b('0x3b')]=_0x4c49ab;_0x58a1dc['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x58a1dc['save']();})['then'](function(){return sendServiceMail({'to':_0x4583b5[_0x309b('0x32')][_0x309b('0x33')],'subject':_0x309b('0x3c'),'text':_0x309b('0x3d')+_0x309b('0x3e')+_0x309b('0x3f')+_0x4583b5['headers']['host']+_0x309b('0x40')+_0x4c49ab+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x309b('0xc')](function(){_0x2cae7a[_0x309b('0x41')](0xc8)['send']({'message':_0x309b('0x42')});})[_0x309b('0x1d')](function(_0x1bfa19){return handleError(_0x2cae7a,0x1f4,_0x1bfa19);});};exports['reset']=function(_0x1d21cb,_0x47cbfd){return db[_0x309b('0x37')][_0x309b('0x1f')]({'where':{'resetPasswordToken':_0x1d21cb[_0x309b('0x43')][_0x309b('0x44')],'resetPasswordExpires':{'$gt':Date[_0x309b('0x45')]()}}})[_0x309b('0xc')](function(_0x44b7db){if(!_0x44b7db){throw new Error(_0x309b('0x46'));}return db['Setting'][_0x309b('0xa')]({'attributes':['id',_0x309b('0x47'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0xceb94c){if(_0xceb94c[_0x309b('0x47')])authService[_0x309b('0x48')](_0x1d21cb[_0x309b('0x32')]['password']);if(!_0xceb94c[_0x309b('0x49')]||!_0x44b7db[_0x309b('0x4a')])return _0x44b7db;authService[_0x309b('0x4b')](_0x1d21cb['body'][_0x309b('0xe')],_0x44b7db[_0x309b('0x4a')],_0xceb94c[_0x309b('0x4c')]);return _0x44b7db;})[_0x309b('0xc')](function(){_0x44b7db[_0x309b('0xe')]=_0x1d21cb[_0x309b('0x32')][_0x309b('0xe')];_0x44b7db[_0x309b('0x3b')]=null;_0x44b7db['resetPasswordExpires']=null;return _0x44b7db[_0x309b('0x4d')]();});})[_0x309b('0xc')](function(){_0x47cbfd[_0x309b('0x41')](0xc8)['send']({'message':_0x309b('0x4e')});})[_0x309b('0x1d')](function(_0xf3e21f){return handleError(_0x47cbfd,0x1f4,_0xf3e21f);});};passport[_0x309b('0x4f')]('local-login',new LocalStrategy({'usernameField':_0x309b('0xd'),'passwordField':_0x309b('0xe')},function(_0x1a2cf5,_0x3bd4d7,_0xe25d11){return localAuthenticate(db[_0x309b('0x37')],_0x1a2cf5,_0x3bd4d7,_0xe25d11);})); \ No newline at end of file +var _0xff00=['password','salt','blocked','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','SendMail','error','message','stringify','login','local-login','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','reset','params','securePassword','enforcePasswordHistory','validatePasswordPattern','validatePasswordHistory','previousPasswords','passwordHistoryLimit','use','util','passport','passport-local','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','name'];(function(_0x58d17e,_0x2f4fdb){var _0x30a6da=function(_0x342015){while(--_0x342015){_0x58d17e['push'](_0x58d17e['shift']());}};_0x30a6da(++_0x2f4fdb);}(_0xff00,0x90));var _0x0ff0=function(_0x373f3f,_0x5f552d){_0x373f3f=_0x373f3f-0x0;var _0x264165=_0xff00[_0x373f3f];return _0x264165;};'use strict';var util=require(_0x0ff0('0x0'));var passport=require(_0x0ff0('0x1'));var LocalStrategy=require(_0x0ff0('0x2'))[_0x0ff0('0x3')];var jayson=require('jayson/promise');var _=require(_0x0ff0('0x4'));var rs=require(_0x0ff0('0x5'));var moment=require(_0x0ff0('0x6'));var db=require(_0x0ff0('0x7'))['db'];var authService=require(_0x0ff0('0x8'));var utils=require(_0x0ff0('0x9'));var client=jayson[_0x0ff0('0xa')][_0x0ff0('0xb')]({'port':0x232b});function localAuthenticate(_0x3f7f83,_0x576e39,_0x291714,_0x1d3355){var _0x19c060,_0x21869f;return db['Setting'][_0x0ff0('0xc')]({'where':{'id':0x1},'attributes':[_0x0ff0('0xd'),_0x0ff0('0xe')],'raw':!![]})['then'](function(_0x48c7b4){_0x19c060=_0x48c7b4;return _0x3f7f83[_0x0ff0('0xc')]({'attributes':['id',_0x0ff0('0xf'),_0x0ff0('0x10'),_0x0ff0('0x11'),'role','disabled',_0x0ff0('0x12'),_0x0ff0('0x13'),'loginAttempts'],'where':{'name':_0x576e39,'role':{'$or':[_0x0ff0('0x14'),_0x0ff0('0x15'),_0x0ff0('0x16')]}}});})[_0x0ff0('0x17')](function(_0x211938){if(!_0x211938||_0x211938&&_0x211938[_0x0ff0('0xf')]!==_0x576e39){throw new Error(_0x0ff0('0x18'));}else{_0x21869f=_0x211938;return _0x21869f;}})[_0x0ff0('0x17')](function(){_0x21869f[_0x0ff0('0x19')](_0x291714,function(_0x3fd19e,_0x73fb26){var _0x4523dd=_0x21869f['loginAttempts']+0x1;if(_0x3fd19e){return _0x1d3355(_0x3fd19e);}else if(!_0x73fb26){if(_0x21869f[_0x0ff0('0x1a')]){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}else if(_0x19c060['allowedLoginAttempts']>0x0){if(_0x21869f['blocked']){if(_0x19c060[_0x0ff0('0xe')]>0x0){if(moment(_0x21869f[_0x0ff0('0x13')])[_0x0ff0('0x1b')](_0x19c060[_0x0ff0('0xe')],_0x0ff0('0x1c'))>moment()){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}else{return utils[_0x0ff0('0x1d')](_0x21869f,_0x4523dd,![],null)['then'](function(){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});});}}else{return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}}else{if(_0x4523dd>=_0x19c060[_0x0ff0('0xd')]){return utils[_0x0ff0('0x1d')](_0x21869f,0x0,!![],moment())['then'](function(){return _0x1d3355(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x0ff0('0x1d')](_0x21869f,_0x4523dd,![],null)[_0x0ff0('0x17')](function(){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});});}}}else{return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}}else{if(_0x21869f[_0x0ff0('0x1a')]){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}else if(_0x19c060[_0x0ff0('0xd')]>0x0){if(_0x21869f[_0x0ff0('0x12')]){if(_0x19c060[_0x0ff0('0xe')]>0x0){if(moment(_0x21869f[_0x0ff0('0x13')])[_0x0ff0('0x1b')](_0x19c060['blockDuration'],_0x0ff0('0x1c'))>moment()){return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}else{return utils[_0x0ff0('0x1d')](_0x21869f,0x0,![],null)[_0x0ff0('0x17')](function(){return utils[_0x0ff0('0x1e')](_0x21869f);})[_0x0ff0('0x17')](function(){return _0x1d3355(null,_0x21869f);});}}else{return _0x1d3355(null,![],{'message':_0x0ff0('0x18')});}}else{return utils[_0x0ff0('0x1d')](_0x21869f,0x0,![],null)[_0x0ff0('0x17')](function(){return utils[_0x0ff0('0x1e')](_0x21869f);})[_0x0ff0('0x17')](function(){return _0x1d3355(null,_0x21869f);})['catch'](function(_0x13380e){return _0x1d3355(null,![],_0x13380e);});}}else{if(_0x21869f[_0x0ff0('0x12')]){return _0x1d3355(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x21869f)[_0x0ff0('0x17')](function(){return _0x1d3355(null,_0x21869f);});}}}});})[_0x0ff0('0x1f')](function(_0x4e9da0){return _0x1d3355(null,![],_0x4e9da0);});}function sendServiceMail(_0x3e9935){return db[_0x0ff0('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0x0ff0('0xf'),_0x0ff0('0x21')],'include':[{'model':db[_0x0ff0('0x22')],'as':_0x0ff0('0x23'),'include':[{'model':db[_0x0ff0('0x24')],'as':_0x0ff0('0x24')}]}]})[_0x0ff0('0x17')](function(_0x3c029f){if(!_0x3c029f){throw new Error(_0x0ff0('0x25'));}var _0x97f1a4=_0x3c029f[_0x0ff0('0x26')]();var _0x4d766d={'account':_0x97f1a4,'message':_['merge']({'from':util[_0x0ff0('0x27')]('\x22%s\x22\x20<%s>',_0x3c029f[_0x0ff0('0xf')],_0x3c029f['email']||_0x3c029f[_0x0ff0('0x23')][_0x0ff0('0x15')])},_0x3e9935)};return client['request'](_0x0ff0('0x28'),_0x4d766d);})['then'](function(_0x34bb59){if(_0x34bb59[_0x0ff0('0x29')]){throw new Error(util[_0x0ff0('0x27')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x34bb59['error'][_0x0ff0('0x2a')]||JSON[_0x0ff0('0x2b')](_0x34bb59[_0x0ff0('0x29')])));}return!![];});}function handleError(_0xaf6b0c,_0x19eab4,_0x410393){return _0xaf6b0c['status'](_0x19eab4||0x1f4)['send']({'message':_0x410393?_0x410393[_0x0ff0('0x2a')]||_0x410393:''});}exports[_0x0ff0('0x2c')]=function(_0x34ce57,_0x34d0ef,_0x141699){passport[_0x0ff0('0x19')](_0x0ff0('0x2d'),function(_0x398071,_0x5143be,_0x403c8b){var _0x38ef92=_0x398071||_0x403c8b;if(_0x38ef92){return handleError(_0x34d0ef,0x191,_0x38ef92);}if(!_0x5143be){return handleError(_0x34d0ef,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x28cd46={'payload':{'id':_0x5143be['id'],'role':_0x5143be[_0x0ff0('0x2e')]},'options':{'expiresIn':0x15180}};return authService[_0x0ff0('0x2f')](_0x28cd46)['then'](function(_0x35fa11){_0x34d0ef[_0x0ff0('0x30')]({'id':_0x5143be['id'],'token':_0x35fa11,'statusCall':'','isAlreadyLogged':_0x5143be[_0x0ff0('0x31')]});});}})(_0x34ce57,_0x34d0ef,_0x141699);};exports[_0x0ff0('0x32')]=function(_0x296764,_0x21db9f){if(!_0x296764[_0x0ff0('0x33')]['email']){return handleError(_0x21db9f,0x1f4,{'message':_0x0ff0('0x34')});}var _0x123643=rs[_0x0ff0('0x35')]();_0x296764['body'][_0x0ff0('0x21')]=_0x296764[_0x0ff0('0x33')][_0x0ff0('0x21')]['trim']()[_0x0ff0('0x36')]();var _0x2bfade;return db[_0x0ff0('0x37')][_0x0ff0('0xc')]({'where':{'id':0x1},'attributes':[_0x0ff0('0xd'),_0x0ff0('0xe')],'raw':!![]})[_0x0ff0('0x17')](function(_0x429c15){_0x2bfade=_0x429c15;return db[_0x0ff0('0x38')][_0x0ff0('0x39')]({'where':{'email':_0x296764[_0x0ff0('0x33')][_0x0ff0('0x21')]}});})[_0x0ff0('0x17')](function(_0x69119e){if(!_0x69119e){throw new Error(_0x0ff0('0x3a'));}if(_0x69119e[_0x0ff0('0x1a')]){throw new Error(_0x0ff0('0x3b'));}if(_0x69119e[_0x0ff0('0x12')]){if(moment(_0x69119e[_0x0ff0('0x13')])[_0x0ff0('0x1b')](_0x2bfade['blockDuration'],_0x0ff0('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x69119e[_0x0ff0('0x12')]=![];_0x69119e[_0x0ff0('0x13')]=null;}}_0x69119e[_0x0ff0('0x3c')]=_0x123643;_0x69119e[_0x0ff0('0x3d')]=Date[_0x0ff0('0x3e')]()+0x36ee80;return _0x69119e['save']();})[_0x0ff0('0x17')](function(){return sendServiceMail({'to':_0x296764['body'][_0x0ff0('0x21')],'subject':_0x0ff0('0x3f'),'text':_0x0ff0('0x40')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x0ff0('0x41')+_0x296764['headers']['host']+_0x0ff0('0x42')+_0x123643+'\x0a\x0a'+_0x0ff0('0x43')});})[_0x0ff0('0x17')](function(){_0x21db9f[_0x0ff0('0x44')](0xc8)[_0x0ff0('0x45')]({'message':_0x0ff0('0x46')});})[_0x0ff0('0x1f')](function(_0x4a9703){return handleError(_0x21db9f,0x1f4,_0x4a9703);});};exports[_0x0ff0('0x47')]=function(_0x3f8673,_0x1f67e3){return db[_0x0ff0('0x38')][_0x0ff0('0x39')]({'where':{'resetPasswordToken':_0x3f8673[_0x0ff0('0x48')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x0ff0('0x17')](function(_0x33e305){if(!_0x33e305){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x0ff0('0xc')]({'attributes':['id',_0x0ff0('0x49'),_0x0ff0('0x4a'),'passwordHistoryLimit']})['then'](function(_0x2e75d0){if(_0x2e75d0['securePassword'])authService[_0x0ff0('0x4b')](_0x3f8673['body'][_0x0ff0('0x10')]);if(!_0x2e75d0[_0x0ff0('0x4a')]||!_0x33e305['previousPasswords'])return _0x33e305;authService[_0x0ff0('0x4c')](_0x3f8673[_0x0ff0('0x33')][_0x0ff0('0x10')],_0x33e305[_0x0ff0('0x4d')],_0x2e75d0[_0x0ff0('0x4e')]);return _0x33e305;})[_0x0ff0('0x17')](function(){_0x33e305['password']=_0x3f8673[_0x0ff0('0x33')][_0x0ff0('0x10')];_0x33e305[_0x0ff0('0x3c')]=null;_0x33e305[_0x0ff0('0x3d')]=null;return _0x33e305['save']();});})['then'](function(){_0x1f67e3[_0x0ff0('0x44')](0xc8)[_0x0ff0('0x45')]({'message':'Password\x20reset!'});})[_0x0ff0('0x1f')](function(_0x23f436){return handleError(_0x1f67e3,0x1f4,_0x23f436);});};passport[_0x0ff0('0x4f')](_0x0ff0('0x2d'),new LocalStrategy({'usernameField':_0x0ff0('0xf'),'passwordField':_0x0ff0('0x10')},function(_0x2c5022,_0x812138,_0x13a61d){return localAuthenticate(db['User'],_0x2c5022,_0x812138,_0x13a61d);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 4f18ca1..8f5fb7b 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 _0x9de5=['/reset/:token','reset','exports','express','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x47aded,_0xb76625){var _0x505e9a=function(_0x68696d){while(--_0x68696d){_0x47aded['push'](_0x47aded['shift']());}};_0x505e9a(++_0xb76625);}(_0x9de5,0x186));var _0x59de=function(_0x412ab1,_0x202ca7){_0x412ab1=_0x412ab1-0x0;var _0x3191e1=_0x9de5[_0x412ab1];return _0x3191e1;};'use strict';var express=require(_0x59de('0x0'));var router=express['Router']();var controller=require(_0x59de('0x1'));router[_0x59de('0x2')]('/',controller[_0x59de('0x3')]);router[_0x59de('0x2')](_0x59de('0x4'),controller[_0x59de('0x5')]);router[_0x59de('0x2')](_0x59de('0x6'),controller[_0x59de('0x7')]);module[_0x59de('0x8')]=router; \ No newline at end of file +var _0xf454=['reset','exports','express','Router','./authLocal.controller','login','post','/forgot'];(function(_0x454709,_0xa28117){var _0x3fb5dc=function(_0x49dbb2){while(--_0x49dbb2){_0x454709['push'](_0x454709['shift']());}};_0x3fb5dc(++_0xa28117);}(_0xf454,0xc2));var _0x4f45=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf454[_0x4b369d];return _0x571a98;};'use strict';var express=require(_0x4f45('0x0'));var router=express[_0x4f45('0x1')]();var controller=require(_0x4f45('0x2'));router['post']('/',controller[_0x4f45('0x3')]);router[_0x4f45('0x4')](_0x4f45('0x5'),controller['forgot']);router[_0x4f45('0x4')]('/reset/:token',controller[_0x4f45('0x6')]);module[_0x4f45('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index bd0442f..f8b6076 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 _0xf4e5=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x2d0d2b,_0x4032f4){var _0x4c7445=function(_0x7e100a){while(--_0x7e100a){_0x2d0d2b['push'](_0x2d0d2b['shift']());}};_0x4c7445(++_0x4032f4);}(_0xf4e5,0x73));var _0x5f4e=function(_0x2feff8,_0x1f9d93){_0x2feff8=_0x2feff8-0x0;var _0x46a0f3=_0xf4e5[_0x2feff8];return _0x46a0f3;};'use strict';var Sequelize=require(_0x5f4e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x5f4e('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x5f4e('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5f4e('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3ce4=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x3ce4,0x92));var _0x43ce=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x3ce4[_0x48999d];return _0x1ad0d1;};'use strict';var Sequelize=require(_0x43ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x43ce('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0x43ce('0x1')]},'description':{'type':Sequelize[_0x43ce('0x1')]},'status':{'type':Sequelize[_0x43ce('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x43ce('0x3')],'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 1e23faf..18b6fad 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 _0x9d48=['pick','filter','merge','options','includeAll','include','rows','params','rawAttributes','intersection','create','body','find','catch','addConditions','Condition','getConditions','findOne','addActions','Action','ids','omit','getActions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where'];(function(_0x2bf921,_0x30b415){var _0x37d969=function(_0x30a21b){while(--_0x30a21b){_0x2bf921['push'](_0x2bf921['shift']());}};_0x37d969(++_0x30b415);}(_0x9d48,0x1bb));var _0x89d4=function(_0x514bd1,_0x25ea3e){_0x514bd1=_0x514bd1-0x0;var _0x58a281=_0x9d48[_0x514bd1];return _0x58a281;};'use strict';var emlformat=require(_0x89d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89d4('0x1'));var jsonpatch=require(_0x89d4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x89d4('0x3'));var Mustache=require(_0x89d4('0x4'));var util=require('util');var path=require(_0x89d4('0x5'));var sox=require('sox');var csv=require(_0x89d4('0x6'));var ejs=require(_0x89d4('0x7'));var fs=require('fs');var fs_extra=require(_0x89d4('0x8'));var _=require('lodash');var squel=require(_0x89d4('0x9'));var crypto=require(_0x89d4('0xa'));var jsforce=require(_0x89d4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x89d4('0x6'));var querystring=require(_0x89d4('0xc'));var Papa=require(_0x89d4('0xd'));var Redis=require(_0x89d4('0xe'));var authService=require(_0x89d4('0xf'));var qs=require(_0x89d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89d4('0x11'));var logger=require(_0x89d4('0x12'))(_0x89d4('0x13'));var utils=require(_0x89d4('0x14'));var config=require(_0x89d4('0x15'));var licenseUtil=require(_0x89d4('0x16'));var db=require(_0x89d4('0x17'))['db'];function respondWithStatusCode(_0x1f80bd,_0x1c5b31){_0x1c5b31=_0x1c5b31||0xcc;return function(_0x14137c){if(_0x14137c){return _0x1f80bd[_0x89d4('0x18')](_0x1c5b31);}return _0x1f80bd[_0x89d4('0x19')](_0x1c5b31)[_0x89d4('0x1a')]();};}function respondWithResult(_0x1b4354,_0x341e05){_0x341e05=_0x341e05||0xc8;return function(_0x16cad6){if(_0x16cad6){return _0x1b4354[_0x89d4('0x19')](_0x341e05)[_0x89d4('0x1b')](_0x16cad6);}};}function respondWithFilteredResult(_0x32928b,_0x1636c5){return function(_0x14d045){if(_0x14d045){var _0x463886=typeof _0x1636c5['offset']==='undefined'&&typeof _0x1636c5['limit']===_0x89d4('0x1c');var _0x429baa=_0x14d045[_0x89d4('0x1d')];var _0x562cb5=_0x463886?0x0:_0x1636c5[_0x89d4('0x1e')];var _0x118cc2=_0x463886?_0x14d045[_0x89d4('0x1d')]:_0x1636c5[_0x89d4('0x1e')]+_0x1636c5[_0x89d4('0x1f')];var _0x5541bb;if(_0x118cc2>=_0x429baa){_0x118cc2=_0x429baa;_0x5541bb=0xc8;}else{_0x5541bb=0xce;}_0x32928b[_0x89d4('0x19')](_0x5541bb);return _0x32928b[_0x89d4('0x20')](_0x89d4('0x21'),_0x562cb5+'-'+_0x118cc2+'/'+_0x429baa)[_0x89d4('0x1b')](_0x14d045);}return null;};}function patchUpdates(_0x270b28){return function(_0x434c07){try{jsonpatch[_0x89d4('0x22')](_0x434c07,_0x270b28,!![]);}catch(_0x1501ae){return BPromise[_0x89d4('0x23')](_0x1501ae);}return _0x434c07[_0x89d4('0x24')]();};}function saveUpdates(_0x4ec555,_0x9c64e1){return function(_0x54a0cc){if(_0x54a0cc){return _0x54a0cc[_0x89d4('0x25')](_0x4ec555)[_0x89d4('0x26')](function(_0x21b741){return _0x21b741;});}return null;};}function removeEntity(_0x179d1d,_0x316fad){return function(_0x3698ec){if(_0x3698ec){return _0x3698ec[_0x89d4('0x27')]()[_0x89d4('0x26')](function(){_0x179d1d[_0x89d4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b9c06,_0x41b527){return function(_0x5276d0){if(!_0x5276d0){_0x4b9c06['sendStatus'](0x194);}return _0x5276d0;};}function handleError(_0x500e6f,_0x56e115){_0x56e115=_0x56e115||0x1f4;return function(_0x9648e9){logger[_0x89d4('0x28')](_0x9648e9[_0x89d4('0x29')]);if(_0x9648e9['name']){delete _0x9648e9[_0x89d4('0x2a')];}_0x500e6f[_0x89d4('0x19')](_0x56e115)[_0x89d4('0x2b')](_0x9648e9);};}exports[_0x89d4('0x2c')]=function(_0x2d5eef,_0x550817){var _0x20063a={},_0x2d4bbc={},_0x128416={'count':0x0,'rows':[]};var _0x3f0db5=_[_0x89d4('0x2d')](db[_0x89d4('0x2e')]['rawAttributes'],function(_0x31b526){return{'name':_0x31b526[_0x89d4('0x2f')],'type':_0x31b526[_0x89d4('0x30')][_0x89d4('0x31')]};});_0x2d4bbc[_0x89d4('0x32')]=_['map'](_0x3f0db5,_0x89d4('0x2a'));_0x2d4bbc[_0x89d4('0x33')]=_[_0x89d4('0x34')](_0x2d5eef[_0x89d4('0x33')]);_0x2d4bbc[_0x89d4('0x35')]=_['intersection'](_0x2d4bbc['model'],_0x2d4bbc['query']);_0x20063a['attributes']=_['intersection'](_0x2d4bbc[_0x89d4('0x32')],qs[_0x89d4('0x36')](_0x2d5eef['query'][_0x89d4('0x36')]));_0x20063a['attributes']=_0x20063a[_0x89d4('0x37')][_0x89d4('0x38')]?_0x20063a[_0x89d4('0x37')]:_0x2d4bbc[_0x89d4('0x32')];if(!_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x39')](_0x89d4('0x3a'))){_0x20063a[_0x89d4('0x1f')]=qs[_0x89d4('0x1f')](_0x2d5eef['query']['limit']);_0x20063a['offset']=qs[_0x89d4('0x1e')](_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x1e')]);}_0x20063a['order']=qs['sort'](_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x3b')]);_0x20063a[_0x89d4('0x3c')]=qs[_0x89d4('0x35')](_[_0x89d4('0x3d')](_0x2d5eef[_0x89d4('0x33')],_0x2d4bbc[_0x89d4('0x35')]),_0x3f0db5);if(_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x3e')]){_0x20063a[_0x89d4('0x3c')]=_[_0x89d4('0x3f')](_0x20063a[_0x89d4('0x3c')],{'$or':_[_0x89d4('0x2d')](_0x3f0db5,function(_0x7cd5e){if(_0x7cd5e[_0x89d4('0x30')]!=='VIRTUAL'){var _0x294302={};_0x294302[_0x7cd5e['name']]={'$like':'%'+_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x3e')]+'%'};return _0x294302;}})});}_0x20063a=_[_0x89d4('0x3f')]({},_0x20063a,_0x2d5eef[_0x89d4('0x40')]);var _0x1f888c={'where':_0x20063a['where']};return db[_0x89d4('0x2e')][_0x89d4('0x1d')](_0x1f888c)[_0x89d4('0x26')](function(_0x466974){_0x128416[_0x89d4('0x1d')]=_0x466974;if(_0x2d5eef[_0x89d4('0x33')][_0x89d4('0x41')]){_0x20063a[_0x89d4('0x42')]=[{'all':!![]}];}return db[_0x89d4('0x2e')]['findAll'](_0x20063a);})[_0x89d4('0x26')](function(_0x48678c){_0x128416[_0x89d4('0x43')]=_0x48678c;return _0x128416;})['then'](respondWithFilteredResult(_0x550817,_0x20063a))['catch'](handleError(_0x550817,null));};exports['show']=function(_0x14a2d9,_0x3f6e94){var _0x1a35f7={'raw':![],'where':{'id':_0x14a2d9[_0x89d4('0x44')]['id']}},_0x220c30={};_0x220c30[_0x89d4('0x32')]=_[_0x89d4('0x34')](db['Automation'][_0x89d4('0x45')]);_0x220c30[_0x89d4('0x33')]=_[_0x89d4('0x34')](_0x14a2d9[_0x89d4('0x33')]);_0x220c30[_0x89d4('0x35')]=_[_0x89d4('0x46')](_0x220c30['model'],_0x220c30[_0x89d4('0x33')]);_0x1a35f7[_0x89d4('0x37')]=_[_0x89d4('0x46')](_0x220c30[_0x89d4('0x32')],qs[_0x89d4('0x36')](_0x14a2d9['query'][_0x89d4('0x36')]));_0x1a35f7['attributes']=_0x1a35f7[_0x89d4('0x37')][_0x89d4('0x38')]?_0x1a35f7[_0x89d4('0x37')]:_0x220c30[_0x89d4('0x32')];if(_0x14a2d9[_0x89d4('0x33')][_0x89d4('0x41')]){_0x1a35f7[_0x89d4('0x42')]=[{'all':!![]}];}_0x1a35f7=_[_0x89d4('0x3f')]({},_0x1a35f7,_0x14a2d9[_0x89d4('0x40')]);return db[_0x89d4('0x2e')]['find'](_0x1a35f7)[_0x89d4('0x26')](handleEntityNotFound(_0x3f6e94,null))[_0x89d4('0x26')](respondWithResult(_0x3f6e94,null))['catch'](handleError(_0x3f6e94,null));};exports[_0x89d4('0x47')]=function(_0x436a34,_0x2e7491){return db[_0x89d4('0x2e')][_0x89d4('0x47')](_0x436a34[_0x89d4('0x48')],{})['then'](respondWithResult(_0x2e7491,0xc9))['catch'](handleError(_0x2e7491,null));};exports['update']=function(_0x115c3d,_0x1f6ca8){if(_0x115c3d[_0x89d4('0x48')]['id']){delete _0x115c3d[_0x89d4('0x48')]['id'];}return db[_0x89d4('0x2e')][_0x89d4('0x49')]({'where':{'id':_0x115c3d[_0x89d4('0x44')]['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x1f6ca8,null))[_0x89d4('0x26')](saveUpdates(_0x115c3d[_0x89d4('0x48')],null))[_0x89d4('0x26')](respondWithResult(_0x1f6ca8,null))[_0x89d4('0x4a')](handleError(_0x1f6ca8,null));};exports[_0x89d4('0x27')]=function(_0x759df5,_0x350d71){return db[_0x89d4('0x2e')][_0x89d4('0x49')]({'where':{'id':_0x759df5[_0x89d4('0x44')]['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x350d71,null))[_0x89d4('0x26')](removeEntity(_0x350d71,null))[_0x89d4('0x4a')](handleError(_0x350d71,null));};exports[_0x89d4('0x4b')]=function(_0x338661,_0x43ae08,_0x34d85f){return db[_0x89d4('0x4c')]['find']({'where':{'id':_0x338661[_0x89d4('0x44')]['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x43ae08,null))['then'](function(_0x3c86fb){if(_0x3c86fb){return _0x3c86fb[_0x89d4('0x4b')](_0x338661['body']['ids'],_['omit'](_0x338661[_0x89d4('0x48')],['ids','id'])||{});}})[_0x89d4('0x26')](respondWithResult(_0x43ae08,null))[_0x89d4('0x4a')](handleError(_0x43ae08,null));};exports[_0x89d4('0x4d')]=function(_0x5dbc72,_0x3b2f6c,_0x2c7b97){var _0x5307c7={};var _0xf6f77d={};var _0x21b77d;var _0x486c5a;return db['Automation'][_0x89d4('0x4e')]({'where':{'id':_0x5dbc72['params']['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x3b2f6c,null))['then'](function(_0x9ee78a){if(_0x9ee78a){_0x21b77d=_0x9ee78a;_0xf6f77d[_0x89d4('0x32')]=_['keys'](db[_0x89d4('0x4c')][_0x89d4('0x45')]);_0xf6f77d['query']=_['keys'](_0x5dbc72[_0x89d4('0x33')]);_0xf6f77d[_0x89d4('0x35')]=_[_0x89d4('0x46')](_0xf6f77d[_0x89d4('0x32')],_0xf6f77d[_0x89d4('0x33')]);_0x5307c7[_0x89d4('0x37')]=_['intersection'](_0xf6f77d['model'],qs['fields'](_0x5dbc72[_0x89d4('0x33')][_0x89d4('0x36')]));_0x5307c7[_0x89d4('0x37')]=_0x5307c7[_0x89d4('0x37')]['length']?_0x5307c7[_0x89d4('0x37')]:_0xf6f77d[_0x89d4('0x32')];_0x5307c7['order']=qs[_0x89d4('0x3b')](_0x5dbc72[_0x89d4('0x33')][_0x89d4('0x3b')]);_0x5307c7[_0x89d4('0x3c')]=qs[_0x89d4('0x35')](_['pick'](_0x5dbc72[_0x89d4('0x33')],_0xf6f77d[_0x89d4('0x35')]));if(_0x5dbc72[_0x89d4('0x33')][_0x89d4('0x3e')]){_0x5307c7['where']=_[_0x89d4('0x3f')](_0x5307c7[_0x89d4('0x3c')],{'$or':_[_0x89d4('0x2d')](_0x5307c7[_0x89d4('0x37')],function(_0x35ca88){var _0x5f2235={};_0x5f2235[_0x35ca88]={'$like':'%'+_0x5dbc72['query']['filter']+'%'};return _0x5f2235;})});}_0x5307c7=_[_0x89d4('0x3f')]({},_0x5307c7,_0x5dbc72[_0x89d4('0x40')]);return _0x21b77d[_0x89d4('0x4d')](_0x5307c7);}})[_0x89d4('0x26')](function(_0x179787){if(_0x179787){_0x486c5a=_0x179787[_0x89d4('0x38')];if(!_0x5dbc72[_0x89d4('0x33')]['hasOwnProperty'](_0x89d4('0x3a'))){_0x5307c7['limit']=qs['limit'](_0x5dbc72[_0x89d4('0x33')]['limit']);_0x5307c7['offset']=qs[_0x89d4('0x1e')](_0x5dbc72[_0x89d4('0x33')][_0x89d4('0x1e')]);}return _0x21b77d[_0x89d4('0x4d')](_0x5307c7);}})[_0x89d4('0x26')](function(_0x1728be){if(_0x1728be){return _0x1728be?{'count':_0x486c5a,'rows':_0x1728be}:null;}})[_0x89d4('0x26')](respondWithResult(_0x3b2f6c,null))[_0x89d4('0x4a')](handleError(_0x3b2f6c,null));};exports[_0x89d4('0x4f')]=function(_0xe87896,_0x517e08,_0x2ee5a4){return db[_0x89d4('0x50')][_0x89d4('0x49')]({'where':{'id':_0xe87896[_0x89d4('0x44')]['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x517e08,null))[_0x89d4('0x26')](function(_0x222560){if(_0x222560){return _0x222560[_0x89d4('0x4f')](_0xe87896[_0x89d4('0x48')][_0x89d4('0x51')],_[_0x89d4('0x52')](_0xe87896['body'],['ids','id'])||{});}})[_0x89d4('0x26')](respondWithResult(_0x517e08,null))[_0x89d4('0x4a')](handleError(_0x517e08,null));};exports[_0x89d4('0x53')]=function(_0x55c1ca,_0x4ad7ea,_0x30537a){var _0x41b7e5={};var _0x324206={};var _0x3978d3;var _0x3cf577;return db[_0x89d4('0x2e')][_0x89d4('0x4e')]({'where':{'id':_0x55c1ca[_0x89d4('0x44')]['id']}})[_0x89d4('0x26')](handleEntityNotFound(_0x4ad7ea,null))['then'](function(_0x46dc61){if(_0x46dc61){_0x3978d3=_0x46dc61;_0x324206[_0x89d4('0x32')]=_[_0x89d4('0x34')](db[_0x89d4('0x50')][_0x89d4('0x45')]);_0x324206['query']=_['keys'](_0x55c1ca[_0x89d4('0x33')]);_0x324206[_0x89d4('0x35')]=_[_0x89d4('0x46')](_0x324206[_0x89d4('0x32')],_0x324206[_0x89d4('0x33')]);_0x41b7e5[_0x89d4('0x37')]=_[_0x89d4('0x46')](_0x324206[_0x89d4('0x32')],qs[_0x89d4('0x36')](_0x55c1ca[_0x89d4('0x33')][_0x89d4('0x36')]));_0x41b7e5[_0x89d4('0x37')]=_0x41b7e5['attributes'][_0x89d4('0x38')]?_0x41b7e5[_0x89d4('0x37')]:_0x324206['model'];_0x41b7e5['order']=qs[_0x89d4('0x3b')](_0x55c1ca['query'][_0x89d4('0x3b')]);_0x41b7e5[_0x89d4('0x3c')]=qs['filters'](_[_0x89d4('0x3d')](_0x55c1ca['query'],_0x324206[_0x89d4('0x35')]));if(_0x55c1ca[_0x89d4('0x33')][_0x89d4('0x3e')]){_0x41b7e5['where']=_[_0x89d4('0x3f')](_0x41b7e5[_0x89d4('0x3c')],{'$or':_[_0x89d4('0x2d')](_0x41b7e5['attributes'],function(_0x430fde){var _0x22ba46={};_0x22ba46[_0x430fde]={'$like':'%'+_0x55c1ca[_0x89d4('0x33')]['filter']+'%'};return _0x22ba46;})});}_0x41b7e5=_[_0x89d4('0x3f')]({},_0x41b7e5,_0x55c1ca[_0x89d4('0x40')]);return _0x3978d3['getActions'](_0x41b7e5);}})['then'](function(_0x27b714){if(_0x27b714){_0x3cf577=_0x27b714[_0x89d4('0x38')];if(!_0x55c1ca[_0x89d4('0x33')][_0x89d4('0x39')](_0x89d4('0x3a'))){_0x41b7e5[_0x89d4('0x1f')]=qs[_0x89d4('0x1f')](_0x55c1ca['query'][_0x89d4('0x1f')]);_0x41b7e5[_0x89d4('0x1e')]=qs[_0x89d4('0x1e')](_0x55c1ca[_0x89d4('0x33')][_0x89d4('0x1e')]);}return _0x3978d3['getActions'](_0x41b7e5);}})[_0x89d4('0x26')](function(_0x21ca86){if(_0x21ca86){return _0x21ca86?{'count':_0x3cf577,'rows':_0x21ca86}:null;}})[_0x89d4('0x26')](respondWithResult(_0x4ad7ea,null))[_0x89d4('0x4a')](handleError(_0x4ad7ea,null));}; \ No newline at end of file +var _0x4302=['map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','keys','options','find','create','update','body','addConditions','omit','getConditions','findOne','Condition','addActions','Action','ids','getActions','nolimit','eml-format','rimraf','request-promise','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','limit','undefined','count','offset','status','set','Content-Range','apply','destroy','then','error','name','send','index','Automation','rawAttributes','fieldName','type','model'];(function(_0x5adde7,_0x4c9767){var _0x578207=function(_0x25180b){while(--_0x25180b){_0x5adde7['push'](_0x5adde7['shift']());}};_0x578207(++_0x4c9767);}(_0x4302,0x1b5));var _0x2430=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x4302[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require(_0x2430('0x0'));var rimraf=require(_0x2430('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2430('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2430('0x3'));var util=require('util');var path=require(_0x2430('0x4'));var sox=require(_0x2430('0x5'));var csv=require(_0x2430('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2430('0x7'));var squel=require('squel');var crypto=require(_0x2430('0x8'));var jsforce=require(_0x2430('0x9'));var deskjs=require(_0x2430('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2430('0xb'));var Papa=require(_0x2430('0xc'));var Redis=require('ioredis');var authService=require(_0x2430('0xd'));var qs=require(_0x2430('0xe'));var as=require(_0x2430('0xf'));var hardwareService=require(_0x2430('0x10'));var logger=require(_0x2430('0x11'))('api');var utils=require(_0x2430('0x12'));var config=require(_0x2430('0x13'));var licenseUtil=require(_0x2430('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x85554a,_0x1c95b9){_0x1c95b9=_0x1c95b9||0xcc;return function(_0x5d9af3){if(_0x5d9af3){return _0x85554a[_0x2430('0x15')](_0x1c95b9);}return _0x85554a['status'](_0x1c95b9)[_0x2430('0x16')]();};}function respondWithResult(_0xf6a460,_0x369637){_0x369637=_0x369637||0xc8;return function(_0x248954){if(_0x248954){return _0xf6a460['status'](_0x369637)[_0x2430('0x17')](_0x248954);}};}function respondWithFilteredResult(_0x49a61b,_0x45d689){return function(_0x19ca09){if(_0x19ca09){var _0x5b56b8=typeof _0x45d689['offset']==='undefined'&&typeof _0x45d689[_0x2430('0x18')]===_0x2430('0x19');var _0x2a01af=_0x19ca09[_0x2430('0x1a')];var _0x127fe5=_0x5b56b8?0x0:_0x45d689[_0x2430('0x1b')];var _0x1bedf2=_0x5b56b8?_0x19ca09[_0x2430('0x1a')]:_0x45d689[_0x2430('0x1b')]+_0x45d689[_0x2430('0x18')];var _0x355769;if(_0x1bedf2>=_0x2a01af){_0x1bedf2=_0x2a01af;_0x355769=0xc8;}else{_0x355769=0xce;}_0x49a61b[_0x2430('0x1c')](_0x355769);return _0x49a61b[_0x2430('0x1d')](_0x2430('0x1e'),_0x127fe5+'-'+_0x1bedf2+'/'+_0x2a01af)[_0x2430('0x17')](_0x19ca09);}return null;};}function patchUpdates(_0x2deed1){return function(_0x44fd4c){try{jsonpatch[_0x2430('0x1f')](_0x44fd4c,_0x2deed1,!![]);}catch(_0x518b04){return BPromise['reject'](_0x518b04);}return _0x44fd4c['save']();};}function saveUpdates(_0x301d84,_0x3ca740){return function(_0x246db9){if(_0x246db9){return _0x246db9['update'](_0x301d84)['then'](function(_0x550c33){return _0x550c33;});}return null;};}function removeEntity(_0x54a71c,_0x141e08){return function(_0xd167cf){if(_0xd167cf){return _0xd167cf[_0x2430('0x20')]()[_0x2430('0x21')](function(){_0x54a71c[_0x2430('0x1c')](0xcc)[_0x2430('0x16')]();});}};}function handleEntityNotFound(_0x33e901,_0x36cc31){return function(_0x10b59e){if(!_0x10b59e){_0x33e901['sendStatus'](0x194);}return _0x10b59e;};}function handleError(_0x24e4b3,_0x1e050b){_0x1e050b=_0x1e050b||0x1f4;return function(_0x2a0e7f){logger[_0x2430('0x22')](_0x2a0e7f['stack']);if(_0x2a0e7f[_0x2430('0x23')]){delete _0x2a0e7f[_0x2430('0x23')];}_0x24e4b3[_0x2430('0x1c')](_0x1e050b)[_0x2430('0x24')](_0x2a0e7f);};}exports[_0x2430('0x25')]=function(_0x27c43b,_0x4a20b5){var _0x3b49fe={},_0xfb3b9e={},_0x2d3505={'count':0x0,'rows':[]};var _0x3b9c82=_['map'](db[_0x2430('0x26')][_0x2430('0x27')],function(_0x5484e6){return{'name':_0x5484e6[_0x2430('0x28')],'type':_0x5484e6[_0x2430('0x29')]['key']};});_0xfb3b9e[_0x2430('0x2a')]=_[_0x2430('0x2b')](_0x3b9c82,_0x2430('0x23'));_0xfb3b9e[_0x2430('0x2c')]=_['keys'](_0x27c43b['query']);_0xfb3b9e[_0x2430('0x2d')]=_[_0x2430('0x2e')](_0xfb3b9e[_0x2430('0x2a')],_0xfb3b9e['query']);_0x3b49fe[_0x2430('0x2f')]=_[_0x2430('0x2e')](_0xfb3b9e[_0x2430('0x2a')],qs[_0x2430('0x30')](_0x27c43b[_0x2430('0x2c')][_0x2430('0x30')]));_0x3b49fe[_0x2430('0x2f')]=_0x3b49fe[_0x2430('0x2f')][_0x2430('0x31')]?_0x3b49fe[_0x2430('0x2f')]:_0xfb3b9e[_0x2430('0x2a')];if(!_0x27c43b[_0x2430('0x2c')][_0x2430('0x32')]('nolimit')){_0x3b49fe[_0x2430('0x18')]=qs[_0x2430('0x18')](_0x27c43b[_0x2430('0x2c')][_0x2430('0x18')]);_0x3b49fe[_0x2430('0x1b')]=qs[_0x2430('0x1b')](_0x27c43b[_0x2430('0x2c')]['offset']);}_0x3b49fe[_0x2430('0x33')]=qs['sort'](_0x27c43b['query'][_0x2430('0x34')]);_0x3b49fe[_0x2430('0x35')]=qs['filters'](_[_0x2430('0x36')](_0x27c43b[_0x2430('0x2c')],_0xfb3b9e['filters']),_0x3b9c82);if(_0x27c43b['query']['filter']){_0x3b49fe[_0x2430('0x35')]=_[_0x2430('0x37')](_0x3b49fe[_0x2430('0x35')],{'$or':_[_0x2430('0x2b')](_0x3b9c82,function(_0x4ee20f){if(_0x4ee20f[_0x2430('0x29')]!==_0x2430('0x38')){var _0x3d1109={};_0x3d1109[_0x4ee20f[_0x2430('0x23')]]={'$like':'%'+_0x27c43b['query'][_0x2430('0x39')]+'%'};return _0x3d1109;}})});}_0x3b49fe=_[_0x2430('0x37')]({},_0x3b49fe,_0x27c43b['options']);var _0x4ed02b={'where':_0x3b49fe[_0x2430('0x35')]};return db[_0x2430('0x26')][_0x2430('0x1a')](_0x4ed02b)[_0x2430('0x21')](function(_0x50f75f){_0x2d3505[_0x2430('0x1a')]=_0x50f75f;if(_0x27c43b[_0x2430('0x2c')][_0x2430('0x3a')]){_0x3b49fe[_0x2430('0x3b')]=[{'all':!![]}];}return db['Automation'][_0x2430('0x3c')](_0x3b49fe);})['then'](function(_0x7a3046){_0x2d3505['rows']=_0x7a3046;return _0x2d3505;})['then'](respondWithFilteredResult(_0x4a20b5,_0x3b49fe))[_0x2430('0x3d')](handleError(_0x4a20b5,null));};exports[_0x2430('0x3e')]=function(_0x42c710,_0x327ac0){var _0x1f0d40={'raw':![],'where':{'id':_0x42c710[_0x2430('0x3f')]['id']}},_0x6e560c={};_0x6e560c[_0x2430('0x2a')]=_[_0x2430('0x40')](db[_0x2430('0x26')]['rawAttributes']);_0x6e560c['query']=_[_0x2430('0x40')](_0x42c710['query']);_0x6e560c['filters']=_[_0x2430('0x2e')](_0x6e560c[_0x2430('0x2a')],_0x6e560c['query']);_0x1f0d40[_0x2430('0x2f')]=_[_0x2430('0x2e')](_0x6e560c[_0x2430('0x2a')],qs[_0x2430('0x30')](_0x42c710[_0x2430('0x2c')][_0x2430('0x30')]));_0x1f0d40[_0x2430('0x2f')]=_0x1f0d40[_0x2430('0x2f')][_0x2430('0x31')]?_0x1f0d40[_0x2430('0x2f')]:_0x6e560c[_0x2430('0x2a')];if(_0x42c710[_0x2430('0x2c')][_0x2430('0x3a')]){_0x1f0d40[_0x2430('0x3b')]=[{'all':!![]}];}_0x1f0d40=_[_0x2430('0x37')]({},_0x1f0d40,_0x42c710[_0x2430('0x41')]);return db[_0x2430('0x26')][_0x2430('0x42')](_0x1f0d40)[_0x2430('0x21')](handleEntityNotFound(_0x327ac0,null))['then'](respondWithResult(_0x327ac0,null))[_0x2430('0x3d')](handleError(_0x327ac0,null));};exports[_0x2430('0x43')]=function(_0x362f76,_0x45f7e5){return db[_0x2430('0x26')][_0x2430('0x43')](_0x362f76['body'],{})[_0x2430('0x21')](respondWithResult(_0x45f7e5,0xc9))['catch'](handleError(_0x45f7e5,null));};exports[_0x2430('0x44')]=function(_0xe410da,_0x4fb3fa){if(_0xe410da[_0x2430('0x45')]['id']){delete _0xe410da['body']['id'];}return db[_0x2430('0x26')][_0x2430('0x42')]({'where':{'id':_0xe410da[_0x2430('0x3f')]['id']}})[_0x2430('0x21')](handleEntityNotFound(_0x4fb3fa,null))[_0x2430('0x21')](saveUpdates(_0xe410da['body'],null))[_0x2430('0x21')](respondWithResult(_0x4fb3fa,null))[_0x2430('0x3d')](handleError(_0x4fb3fa,null));};exports[_0x2430('0x20')]=function(_0xc4b69d,_0x1799f7){return db[_0x2430('0x26')]['find']({'where':{'id':_0xc4b69d[_0x2430('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1799f7,null))[_0x2430('0x21')](removeEntity(_0x1799f7,null))[_0x2430('0x3d')](handleError(_0x1799f7,null));};exports[_0x2430('0x46')]=function(_0x54d8f8,_0x5116b2,_0x1ef5a6){return db['Condition'][_0x2430('0x42')]({'where':{'id':_0x54d8f8[_0x2430('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5116b2,null))[_0x2430('0x21')](function(_0x3472d2){if(_0x3472d2){return _0x3472d2[_0x2430('0x46')](_0x54d8f8[_0x2430('0x45')]['ids'],_[_0x2430('0x47')](_0x54d8f8[_0x2430('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x5116b2,null))[_0x2430('0x3d')](handleError(_0x5116b2,null));};exports[_0x2430('0x48')]=function(_0x379076,_0x101123,_0x45bedd){var _0x1820a7={};var _0x40ed28={};var _0x574256;var _0x38022b;return db['Automation'][_0x2430('0x49')]({'where':{'id':_0x379076[_0x2430('0x3f')]['id']}})['then'](handleEntityNotFound(_0x101123,null))['then'](function(_0x4198cc){if(_0x4198cc){_0x574256=_0x4198cc;_0x40ed28[_0x2430('0x2a')]=_['keys'](db[_0x2430('0x4a')][_0x2430('0x27')]);_0x40ed28[_0x2430('0x2c')]=_[_0x2430('0x40')](_0x379076[_0x2430('0x2c')]);_0x40ed28[_0x2430('0x2d')]=_['intersection'](_0x40ed28[_0x2430('0x2a')],_0x40ed28[_0x2430('0x2c')]);_0x1820a7[_0x2430('0x2f')]=_[_0x2430('0x2e')](_0x40ed28[_0x2430('0x2a')],qs[_0x2430('0x30')](_0x379076[_0x2430('0x2c')][_0x2430('0x30')]));_0x1820a7['attributes']=_0x1820a7[_0x2430('0x2f')]['length']?_0x1820a7[_0x2430('0x2f')]:_0x40ed28['model'];_0x1820a7[_0x2430('0x33')]=qs[_0x2430('0x34')](_0x379076[_0x2430('0x2c')][_0x2430('0x34')]);_0x1820a7[_0x2430('0x35')]=qs[_0x2430('0x2d')](_[_0x2430('0x36')](_0x379076['query'],_0x40ed28['filters']));if(_0x379076[_0x2430('0x2c')][_0x2430('0x39')]){_0x1820a7[_0x2430('0x35')]=_[_0x2430('0x37')](_0x1820a7[_0x2430('0x35')],{'$or':_['map'](_0x1820a7[_0x2430('0x2f')],function(_0x5bf783){var _0x2024ba={};_0x2024ba[_0x5bf783]={'$like':'%'+_0x379076['query'][_0x2430('0x39')]+'%'};return _0x2024ba;})});}_0x1820a7=_[_0x2430('0x37')]({},_0x1820a7,_0x379076[_0x2430('0x41')]);return _0x574256[_0x2430('0x48')](_0x1820a7);}})[_0x2430('0x21')](function(_0x2d674e){if(_0x2d674e){_0x38022b=_0x2d674e[_0x2430('0x31')];if(!_0x379076['query']['hasOwnProperty']('nolimit')){_0x1820a7[_0x2430('0x18')]=qs[_0x2430('0x18')](_0x379076['query'][_0x2430('0x18')]);_0x1820a7[_0x2430('0x1b')]=qs[_0x2430('0x1b')](_0x379076[_0x2430('0x2c')][_0x2430('0x1b')]);}return _0x574256[_0x2430('0x48')](_0x1820a7);}})[_0x2430('0x21')](function(_0x4f6002){if(_0x4f6002){return _0x4f6002?{'count':_0x38022b,'rows':_0x4f6002}:null;}})[_0x2430('0x21')](respondWithResult(_0x101123,null))['catch'](handleError(_0x101123,null));};exports[_0x2430('0x4b')]=function(_0x212cc7,_0x2c7166,_0x262e15){return db[_0x2430('0x4c')][_0x2430('0x42')]({'where':{'id':_0x212cc7[_0x2430('0x3f')]['id']}})[_0x2430('0x21')](handleEntityNotFound(_0x2c7166,null))[_0x2430('0x21')](function(_0x4b0cb7){if(_0x4b0cb7){return _0x4b0cb7[_0x2430('0x4b')](_0x212cc7[_0x2430('0x45')][_0x2430('0x4d')],_[_0x2430('0x47')](_0x212cc7[_0x2430('0x45')],['ids','id'])||{});}})[_0x2430('0x21')](respondWithResult(_0x2c7166,null))[_0x2430('0x3d')](handleError(_0x2c7166,null));};exports['getActions']=function(_0x309515,_0x128a77,_0x58ce1d){var _0x3889f6={};var _0x4a8fa7={};var _0x1abbaf;var _0x56ee55;return db[_0x2430('0x26')]['findOne']({'where':{'id':_0x309515[_0x2430('0x3f')]['id']}})['then'](handleEntityNotFound(_0x128a77,null))[_0x2430('0x21')](function(_0x547a62){if(_0x547a62){_0x1abbaf=_0x547a62;_0x4a8fa7[_0x2430('0x2a')]=_['keys'](db[_0x2430('0x4c')]['rawAttributes']);_0x4a8fa7['query']=_[_0x2430('0x40')](_0x309515[_0x2430('0x2c')]);_0x4a8fa7[_0x2430('0x2d')]=_[_0x2430('0x2e')](_0x4a8fa7[_0x2430('0x2a')],_0x4a8fa7['query']);_0x3889f6['attributes']=_[_0x2430('0x2e')](_0x4a8fa7[_0x2430('0x2a')],qs[_0x2430('0x30')](_0x309515[_0x2430('0x2c')][_0x2430('0x30')]));_0x3889f6[_0x2430('0x2f')]=_0x3889f6[_0x2430('0x2f')][_0x2430('0x31')]?_0x3889f6[_0x2430('0x2f')]:_0x4a8fa7[_0x2430('0x2a')];_0x3889f6[_0x2430('0x33')]=qs[_0x2430('0x34')](_0x309515[_0x2430('0x2c')][_0x2430('0x34')]);_0x3889f6[_0x2430('0x35')]=qs[_0x2430('0x2d')](_[_0x2430('0x36')](_0x309515[_0x2430('0x2c')],_0x4a8fa7[_0x2430('0x2d')]));if(_0x309515['query'][_0x2430('0x39')]){_0x3889f6['where']=_[_0x2430('0x37')](_0x3889f6[_0x2430('0x35')],{'$or':_[_0x2430('0x2b')](_0x3889f6[_0x2430('0x2f')],function(_0x5929e7){var _0x4432a7={};_0x4432a7[_0x5929e7]={'$like':'%'+_0x309515[_0x2430('0x2c')][_0x2430('0x39')]+'%'};return _0x4432a7;})});}_0x3889f6=_[_0x2430('0x37')]({},_0x3889f6,_0x309515[_0x2430('0x41')]);return _0x1abbaf[_0x2430('0x4e')](_0x3889f6);}})[_0x2430('0x21')](function(_0x4f8777){if(_0x4f8777){_0x56ee55=_0x4f8777[_0x2430('0x31')];if(!_0x309515['query'][_0x2430('0x32')](_0x2430('0x4f'))){_0x3889f6[_0x2430('0x18')]=qs[_0x2430('0x18')](_0x309515[_0x2430('0x2c')][_0x2430('0x18')]);_0x3889f6[_0x2430('0x1b')]=qs[_0x2430('0x1b')](_0x309515[_0x2430('0x2c')][_0x2430('0x1b')]);}return _0x1abbaf['getActions'](_0x3889f6);}})['then'](function(_0x2d13ed){if(_0x2d13ed){return _0x2d13ed?{'count':_0x56ee55,'rows':_0x2d13ed}:null;}})[_0x2430('0x21')](respondWithResult(_0x128a77,null))[_0x2430('0x3d')](handleError(_0x128a77,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index ac88fef..8ac84ba 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 _0x5dc4=['Automation','tools_automations','moment','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define'];(function(_0x5e1b7c,_0x147e2d){var _0x25f0dd=function(_0x56a6a2){while(--_0x56a6a2){_0x5e1b7c['push'](_0x5e1b7c['shift']());}};_0x25f0dd(++_0x147e2d);}(_0x5dc4,0x110));var _0x45dc=function(_0x5d43d2,_0x166d69){_0x5d43d2=_0x5d43d2-0x0;var _0x449c35=_0x5dc4[_0x5d43d2];return _0x449c35;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x45dc('0x0'));var BPromise=require(_0x45dc('0x1'));var rp=require(_0x45dc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x45dc('0x3'));var attributes=require(_0x45dc('0x4'));module[_0x45dc('0x5')]=function(_0x424c4e,_0x1d7086){return _0x424c4e[_0x45dc('0x6')](_0x45dc('0x7'),attributes,{'tableName':_0x45dc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2986=['path','./automation.attributes','exports','define','Automation','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0x2986,0x9f));var _0x6298=function(_0x4177fc,_0x55d099){_0x4177fc=_0x4177fc-0x0;var _0x80d1b3=_0x2986[_0x4177fc];return _0x80d1b3;};'use strict';var _=require(_0x6298('0x0'));var util=require(_0x6298('0x1'));var logger=require(_0x6298('0x2'))(_0x6298('0x3'));var moment=require(_0x6298('0x4'));var BPromise=require(_0x6298('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6298('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6298('0x7'));module[_0x6298('0x8')]=function(_0x1ab57b,_0x51654e){return _0x1ab57b[_0x6298('0x9')](_0x6298('0xa'),attributes,{'tableName':'tools_automations','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 e1ec6c0..25eacd2 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 _0xb10d=['debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Automation,\x20%s,\x20%s','request\x20sent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb10d,0x17f));var _0xdb10=function(_0x235ce1,_0x5f33ee){_0x235ce1=_0x235ce1-0x0;var _0x14213e=_0xb10d[_0x235ce1];return _0x14213e;};'use strict';var _=require(_0xdb10('0x0'));var util=require('util');var moment=require(_0xdb10('0x1'));var BPromise=require(_0xdb10('0x2'));var rs=require(_0xdb10('0x3'));var fs=require('fs');var Redis=require(_0xdb10('0x4'));var db=require(_0xdb10('0x5'))['db'];var utils=require(_0xdb10('0x6'));var logger=require(_0xdb10('0x7'))(_0xdb10('0x8'));var config=require(_0xdb10('0x9'));var jayson=require(_0xdb10('0xa'));var client=jayson[_0xdb10('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x431feb,_0x1faed7,_0x13a590){return new BPromise(function(_0x2e43df,_0x3d59e3){return client[_0xdb10('0xc')](_0x431feb,_0x13a590)[_0xdb10('0xd')](function(_0x1cad13){logger[_0xdb10('0xe')](_0xdb10('0xf'),_0x1faed7,_0xdb10('0x10'));logger[_0xdb10('0x11')](_0xdb10('0x12'),_0x1faed7,_0xdb10('0x10'),JSON[_0xdb10('0x13')](_0x1cad13));if(_0x1cad13[_0xdb10('0x14')]){if(_0x1cad13[_0xdb10('0x14')][_0xdb10('0x15')]===0x1f4){logger[_0xdb10('0x14')](_0xdb10('0xf'),_0x1faed7,_0x1cad13[_0xdb10('0x14')][_0xdb10('0x16')]);return _0x3d59e3(_0x1cad13[_0xdb10('0x14')][_0xdb10('0x16')]);}logger['error'](_0xdb10('0xf'),_0x1faed7,_0x1cad13[_0xdb10('0x14')][_0xdb10('0x16')]);return _0x2e43df(_0x1cad13[_0xdb10('0x14')][_0xdb10('0x16')]);}else{logger[_0xdb10('0xe')]('Automation,\x20%s,\x20%s',_0x1faed7,_0xdb10('0x10'));_0x2e43df(_0x1cad13[_0xdb10('0x17')][_0xdb10('0x16')]);}})[_0xdb10('0x18')](function(_0xbce3f1){logger['error'](_0xdb10('0xf'),_0x1faed7,_0xbce3f1);_0x3d59e3(_0xbce3f1);});});} \ No newline at end of file +var _0x0120=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3fbf32,_0x42d572){var _0x1e4710=function(_0x10dc55){while(--_0x10dc55){_0x3fbf32['push'](_0x3fbf32['shift']());}};_0x1e4710(++_0x42d572);}(_0x0120,0x6f));var _0x0012=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x0120[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('Automation,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 94919c1..844d6cb 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 _0x33c5=['fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','destroy','exports','util','path','express','Router'];(function(_0x39803d,_0x360e50){var _0x33a9c9=function(_0x39d448){while(--_0x39d448){_0x39803d['push'](_0x39803d['shift']());}};_0x33a9c9(++_0x360e50);}(_0x33c5,0xe6));var _0x533c=function(_0x59ab65,_0x410a52){_0x59ab65=_0x59ab65-0x0;var _0x57db9b=_0x33c5[_0x59ab65];return _0x57db9b;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var fs_extra=require(_0x533c('0x4'));var auth=require(_0x533c('0x5'));var interaction=require(_0x533c('0x6'));var config=require('../../config/environment');var controller=require(_0x533c('0x7'));router[_0x533c('0x8')]('/',auth[_0x533c('0x9')](),controller[_0x533c('0xa')]);router[_0x533c('0x8')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0xc')]);router[_0x533c('0x8')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0xe')]);router[_0x533c('0x8')](_0x533c('0xf'),auth[_0x533c('0x9')](),controller[_0x533c('0x10')]);router['post']('/',auth[_0x533c('0x9')](),controller[_0x533c('0x11')]);router[_0x533c('0x12')](_0x533c('0xd'),auth[_0x533c('0x9')](),controller[_0x533c('0x13')]);router['post'](_0x533c('0xf'),auth[_0x533c('0x9')](),controller[_0x533c('0x14')]);router[_0x533c('0x15')](_0x533c('0xb'),auth[_0x533c('0x9')](),controller[_0x533c('0x16')]);router[_0x533c('0x17')]('/:id',auth[_0x533c('0x9')](),controller[_0x533c('0x18')]);module[_0x533c('0x19')]=router; \ No newline at end of file +var _0x5c4d=['path','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','getConditions','/:id/actions','getActions','post','/:id/conditions','addConditions','addActions','put','delete','exports','multer'];(function(_0x3e4ee8,_0x4194f6){var _0x10b191=function(_0xdc94f9){while(--_0xdc94f9){_0x3e4ee8['push'](_0x3e4ee8['shift']());}};_0x10b191(++_0x4194f6);}(_0x5c4d,0x18f));var _0xd5c4=function(_0x3572b3,_0x593ffe){_0x3572b3=_0x3572b3-0x0;var _0x55e4aa=_0x5c4d[_0x3572b3];return _0x55e4aa;};'use strict';var multer=require(_0xd5c4('0x0'));var util=require('util');var path=require(_0xd5c4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd5c4('0x2'));var auth=require(_0xd5c4('0x3'));var interaction=require(_0xd5c4('0x4'));var config=require('../../config/environment');var controller=require(_0xd5c4('0x5'));router[_0xd5c4('0x6')]('/',auth[_0xd5c4('0x7')](),controller[_0xd5c4('0x8')]);router[_0xd5c4('0x6')](_0xd5c4('0x9'),auth[_0xd5c4('0x7')](),controller['show']);router[_0xd5c4('0x6')]('/:id/conditions',auth[_0xd5c4('0x7')](),controller[_0xd5c4('0xa')]);router[_0xd5c4('0x6')](_0xd5c4('0xb'),auth[_0xd5c4('0x7')](),controller[_0xd5c4('0xc')]);router['post']('/',auth[_0xd5c4('0x7')](),controller['create']);router[_0xd5c4('0xd')](_0xd5c4('0xe'),auth[_0xd5c4('0x7')](),controller[_0xd5c4('0xf')]);router['post']('/:id/actions',auth[_0xd5c4('0x7')](),controller[_0xd5c4('0x10')]);router[_0xd5c4('0x11')](_0xd5c4('0x9'),auth[_0xd5c4('0x7')](),controller['update']);router[_0xd5c4('0x12')]('/:id',auth[_0xd5c4('0x7')](),controller['destroy']);module[_0xd5c4('0x13')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 6c8c0f8..0e36be5 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 _0xa7d0=['#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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,*,*,*','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x592054,_0x55dab3){var _0x263cf2=function(_0x4f0351){while(--_0x4f0351){_0x592054['push'](_0x592054['shift']());}};_0x263cf2(++_0x55dab3);}(_0xa7d0,0xe2));var _0x0a7d=function(_0x8ba4cf,_0xfb7d7b){_0x8ba4cf=_0x8ba4cf-0x0;var _0x31f3f5=_0xa7d0[_0x8ba4cf];return _0x31f3f5;};'use strict';var Sequelize=require(_0x0a7d('0x0'));module['exports']={'name':{'type':Sequelize[_0x0a7d('0x1')],'unique':_0x0a7d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x0a7d('0x3')),'allowNull':![],'defaultValue':_0x0a7d('0x3')},'description':{'type':Sequelize[_0x0a7d('0x1')]},'active':{'type':Sequelize[_0x0a7d('0x4')],'defaultValue':0x0,'comment':_0x0a7d('0x5')},'limitCalls':{'type':Sequelize[_0x0a7d('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a7d('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x7')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x0a7d('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a7d('0xf')},'dialTimezone':{'type':Sequelize[_0x0a7d('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0a7d('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x0a7d('0x11')),'defaultValue':_0x0a7d('0x12')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0a7d('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a7d('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a7d('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a7d('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0a7d('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a7d('0x6')](0x9)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0a7d('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a7d('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a7d('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0a7d('0x1b')](_0x0a7d('0x1c'),_0x0a7d('0x1d')),'defaultValue':_0x0a7d('0x1c')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a7d('0x1e')},'dialCutDigit':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a7d('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a7d('0x6')](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a7d('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a7d('0x6')](0x3)[_0x0a7d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a7d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x4e96=['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)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','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','ASC','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x4e96,0x1c3));var _0x64e9=function(_0x1ed229,_0x342d4d){_0x1ed229=_0x1ed229-0x0;var _0x299412=_0x4e96[_0x1ed229];return _0x299412;};'use strict';var Sequelize=require('sequelize');module[_0x64e9('0x0')]={'name':{'type':Sequelize[_0x64e9('0x1')],'unique':_0x64e9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x64e9('0x3')](_0x64e9('0x4')),'allowNull':![],'defaultValue':_0x64e9('0x4')},'description':{'type':Sequelize[_0x64e9('0x1')]},'active':{'type':Sequelize[_0x64e9('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x64e9('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x64e9('0x7')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x64e9('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x64e9('0x6')](0x3)[_0x64e9('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x64e9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x64e9('0x6')](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x64e9('0x6')](0x3)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x64e9('0xe')},'dialTimezone':{'type':Sequelize[_0x64e9('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x64e9('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x64e9('0x3')](_0x64e9('0xf'),_0x64e9('0x10'),_0x64e9('0x11')),'defaultValue':_0x64e9('0xf')},'dialAMDActive':{'type':Sequelize[_0x64e9('0x5')],'defaultValue':0x0,'comment':_0x64e9('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x64e9('0x6')](0x9)[_0x64e9('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x64e9('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x64e9('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x64e9('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x64e9('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x64e9('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x64e9('0x6')](0x9)[_0x64e9('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x64e9('0x6')](0x9)[_0x64e9('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x64e9('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x64e9('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x64e9('0x6')](0x9)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x64e9('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x64e9('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x64e9('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x64e9('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x64e9('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x64e9('0x3')]('DESC',_0x64e9('0x1a')),'defaultValue':_0x64e9('0x1b')},'dialPrefix':{'type':Sequelize[_0x64e9('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x64e9('0x6')](0x3)[_0x64e9('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x64e9('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x64e9('0x6')](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0x64e9('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0x64e9('0x6')](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x64e9('0x6')](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x64e9('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x64e9('0x6')](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x64e9('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x64e9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x64e9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 20a7460..789d31e 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 _0x342e=['UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','findOne','CmHopper','CampaignId','rows','getHopperHistories','options','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','into','cm_hopper','fromQuery','scheduledAt','ContactId','phone','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','select','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','ListId','phone\x20IS\x20NOT\x20NULL','NOW()','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','Campaign','catch','show','params','include','find','body','user','role'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x342e,0xde));var _0xe342=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x342e[_0x2c9b79];return _0x265032;};'use strict';var emlformat=require(_0xe342('0x0'));var rimraf=require(_0xe342('0x1'));var zipdir=require(_0xe342('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe342('0x5'));var sox=require(_0xe342('0x6'));var csv=require(_0xe342('0x7'));var ejs=require(_0xe342('0x8'));var fs=require('fs');var fs_extra=require(_0xe342('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe342('0xa'));var jsforce=require(_0xe342('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe342('0xc'));var Papa=require(_0xe342('0xd'));var Redis=require(_0xe342('0xe'));var authService=require(_0xe342('0xf'));var qs=require(_0xe342('0x10'));var as=require(_0xe342('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe342('0x12'))(_0xe342('0x13'));var utils=require(_0xe342('0x14'));var config=require(_0xe342('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe342('0x16'))['db'];function respondWithStatusCode(_0x50c16e,_0x2fff81){_0x2fff81=_0x2fff81||0xcc;return function(_0x419815){if(_0x419815){return _0x50c16e[_0xe342('0x17')](_0x2fff81);}return _0x50c16e[_0xe342('0x18')](_0x2fff81)['end']();};}function respondWithResult(_0x428c0b,_0x404989){_0x404989=_0x404989||0xc8;return function(_0x59434c){if(_0x59434c){return _0x428c0b[_0xe342('0x18')](_0x404989)[_0xe342('0x19')](_0x59434c);}};}function respondWithFilteredResult(_0xe384cd,_0x8a23f0){return function(_0xe8b832){if(_0xe8b832){var _0x219f51=typeof _0x8a23f0[_0xe342('0x1a')]===_0xe342('0x1b')&&typeof _0x8a23f0[_0xe342('0x1c')]===_0xe342('0x1b');var _0x144b24=_0xe8b832['count'];var _0xf70e61=_0x219f51?0x0:_0x8a23f0['offset'];var _0x5df492=_0x219f51?_0xe8b832[_0xe342('0x1d')]:_0x8a23f0[_0xe342('0x1a')]+_0x8a23f0[_0xe342('0x1c')];var _0x273865;if(_0x5df492>=_0x144b24){_0x5df492=_0x144b24;_0x273865=0xc8;}else{_0x273865=0xce;}_0xe384cd[_0xe342('0x18')](_0x273865);return _0xe384cd[_0xe342('0x1e')](_0xe342('0x1f'),_0xf70e61+'-'+_0x5df492+'/'+_0x144b24)[_0xe342('0x19')](_0xe8b832);}return null;};}function patchUpdates(_0x420036){return function(_0x5731e8){try{jsonpatch[_0xe342('0x20')](_0x5731e8,_0x420036,!![]);}catch(_0x45d096){return BPromise['reject'](_0x45d096);}return _0x5731e8[_0xe342('0x21')]();};}function saveUpdates(_0x56cd1e,_0x2fe50d){return function(_0x26d2a2){if(_0x26d2a2){return _0x26d2a2[_0xe342('0x22')](_0x56cd1e)[_0xe342('0x23')](function(_0x4e3950){return _0x4e3950;});}return null;};}function removeEntity(_0x2e70f5,_0x415aaf){return function(_0x212a7e){if(_0x212a7e){return _0x212a7e['destroy']()['then'](function(){var _0x16dff3=_0x212a7e[_0xe342('0x24')]({'plain':!![]});var _0x5e6e3f=_0xe342('0x25');return db[_0xe342('0x26')][_0xe342('0x27')]({'where':{'type':_0x5e6e3f,'resourceId':_0x16dff3['id']}})[_0xe342('0x23')](function(){return _0x212a7e;});})[_0xe342('0x23')](function(){_0x2e70f5[_0xe342('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e28a,_0x5a63f9){return function(_0x2625a7){if(!_0x2625a7){_0x36e28a[_0xe342('0x17')](0x194);}return _0x2625a7;};}function handleError(_0x59ddce,_0x509192){_0x509192=_0x509192||0x1f4;return function(_0x1c7c97){logger[_0xe342('0x28')](_0x1c7c97[_0xe342('0x29')]);if(_0x1c7c97[_0xe342('0x2a')]){delete _0x1c7c97[_0xe342('0x2a')];}_0x59ddce[_0xe342('0x18')](_0x509192)[_0xe342('0x2b')](_0x1c7c97);};}exports[_0xe342('0x2c')]=function(_0x1cb746,_0x334f7d){var _0x539d3d={},_0x368e45={},_0x2313be={'count':0x0,'rows':[]};var _0xc1b5d0=_['map'](db['Campaign'][_0xe342('0x2d')],function(_0x4aa534){return{'name':_0x4aa534[_0xe342('0x2e')],'type':_0x4aa534[_0xe342('0x2f')][_0xe342('0x30')]};});_0x368e45[_0xe342('0x31')]=_[_0xe342('0x32')](_0xc1b5d0,_0xe342('0x2a'));_0x368e45[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1cb746[_0xe342('0x33')]);_0x368e45[_0xe342('0x35')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],_0x368e45['query']);_0x539d3d[_0xe342('0x37')]=_[_0xe342('0x36')](_0x368e45[_0xe342('0x31')],qs['fields'](_0x1cb746['query'][_0xe342('0x38')]));_0x539d3d[_0xe342('0x37')]=_0x539d3d['attributes'][_0xe342('0x39')]?_0x539d3d[_0xe342('0x37')]:_0x368e45[_0xe342('0x31')];if(!_0x1cb746[_0xe342('0x33')][_0xe342('0x3a')](_0xe342('0x3b'))){_0x539d3d['limit']=qs[_0xe342('0x1c')](_0x1cb746[_0xe342('0x33')]['limit']);_0x539d3d[_0xe342('0x1a')]=qs['offset'](_0x1cb746[_0xe342('0x33')][_0xe342('0x1a')]);}_0x539d3d[_0xe342('0x3c')]=qs[_0xe342('0x3d')](_0x1cb746[_0xe342('0x33')][_0xe342('0x3d')]);_0x539d3d[_0xe342('0x3e')]=qs['filters'](_[_0xe342('0x3f')](_0x1cb746[_0xe342('0x33')],_0x368e45[_0xe342('0x35')]),_0xc1b5d0);if(_0x1cb746[_0xe342('0x33')][_0xe342('0x40')]){_0x539d3d['where']=_['merge'](_0x539d3d[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0xc1b5d0,function(_0x4331bd){if(_0x4331bd['type']!==_0xe342('0x41')){var _0x41efbb={};_0x41efbb[_0x4331bd['name']]={'$like':'%'+_0x1cb746['query'][_0xe342('0x40')]+'%'};return _0x41efbb;}})});}_0x539d3d=_[_0xe342('0x42')]({},_0x539d3d,_0x1cb746['options']);var _0x1c454f={'where':_0x539d3d[_0xe342('0x3e')]};return db['Campaign'][_0xe342('0x1d')](_0x1c454f)[_0xe342('0x23')](function(_0x36f66e){_0x2313be[_0xe342('0x1d')]=_0x36f66e;if(_0x1cb746[_0xe342('0x33')]['includeAll']){_0x539d3d['include']=[{'all':!![]}];}return db[_0xe342('0x43')]['findAll'](_0x539d3d);})['then'](function(_0x174855){_0x2313be['rows']=_0x174855;return _0x2313be;})['then'](respondWithFilteredResult(_0x334f7d,_0x539d3d))[_0xe342('0x44')](handleError(_0x334f7d,null));};exports[_0xe342('0x45')]=function(_0x1f4373,_0x59c8d2){var _0x183b98={'raw':![],'where':{'id':_0x1f4373[_0xe342('0x46')]['id']}},_0x540f6c={};_0x540f6c['model']=_[_0xe342('0x34')](db['Campaign'][_0xe342('0x2d')]);_0x540f6c[_0xe342('0x33')]=_[_0xe342('0x34')](_0x1f4373[_0xe342('0x33')]);_0x540f6c[_0xe342('0x35')]=_[_0xe342('0x36')](_0x540f6c['model'],_0x540f6c[_0xe342('0x33')]);_0x183b98['attributes']=_['intersection'](_0x540f6c[_0xe342('0x31')],qs['fields'](_0x1f4373[_0xe342('0x33')][_0xe342('0x38')]));_0x183b98[_0xe342('0x37')]=_0x183b98[_0xe342('0x37')][_0xe342('0x39')]?_0x183b98['attributes']:_0x540f6c['model'];if(_0x1f4373[_0xe342('0x33')]['includeAll']){_0x183b98[_0xe342('0x47')]=[{'all':!![]}];}_0x183b98=_['merge']({},_0x183b98,_0x1f4373['options']);return db[_0xe342('0x43')][_0xe342('0x48')](_0x183b98)[_0xe342('0x23')](handleEntityNotFound(_0x59c8d2,null))[_0xe342('0x23')](respondWithResult(_0x59c8d2,null))['catch'](handleError(_0x59c8d2,null));};exports['create']=function(_0x48fc25,_0x535f50){return db[_0xe342('0x43')]['create'](_0x48fc25[_0xe342('0x49')],{})[_0xe342('0x23')](function(_0x962aa1){var _0x3ce025=_0x48fc25[_0xe342('0x4a')][_0xe342('0x24')]({'plain':!![]});if(!_0x3ce025)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ce025[_0xe342('0x4b')]==='user'){var _0x304dbf=_0x962aa1[_0xe342('0x24')]({'plain':!![]});var _0x216cc3=_0xe342('0x25');return db[_0xe342('0x4c')]['find']({'where':{'name':_0x216cc3,'userProfileId':_0x3ce025[_0xe342('0x4d')]},'raw':!![]})[_0xe342('0x23')](function(_0x34a3e2){if(_0x34a3e2&&_0x34a3e2[_0xe342('0x4e')]===0x0){return db[_0xe342('0x26')][_0xe342('0x4f')]({'name':_0x304dbf['name'],'resourceId':_0x304dbf['id'],'type':_0x34a3e2['name'],'sectionId':_0x34a3e2['id']},{})[_0xe342('0x23')](function(){return _0x962aa1;});}else{return _0x962aa1;}})[_0xe342('0x44')](function(_0x139855){logger[_0xe342('0x28')](_0xe342('0x50'),_0x139855);throw _0x139855;});}return _0x962aa1;})['then'](respondWithResult(_0x535f50,0xc9))[_0xe342('0x44')](handleError(_0x535f50,null));};exports[_0xe342('0x51')]=function(_0x35ae19,_0x505574){var _0x3e8546={'where':{'id':_0x35ae19[_0xe342('0x46')]['id']}},_0x463d88={};_0x463d88['model']=_[_0xe342('0x34')](db['Campaign']['rawAttributes']);_0x3e8546[_0xe342('0x37')]=_['intersection'](_0x463d88[_0xe342('0x31')],qs['fields'](_0x35ae19[_0xe342('0x33')][_0xe342('0x38')]));_0x3e8546[_0xe342('0x37')]=_0x3e8546[_0xe342('0x37')]['length']?_0x3e8546[_0xe342('0x37')]:_0x463d88[_0xe342('0x31')];if(_0x35ae19['query'][_0xe342('0x52')]){_0x3e8546['include']=[{'all':!![]}];}_0x3e8546=_[_0xe342('0x42')]({},_0x3e8546,_0x35ae19['options']);return db[_0xe342('0x43')]['find'](_0x3e8546)[_0xe342('0x23')](handleEntityNotFound(_0x505574,null))[_0xe342('0x23')](function(_0x194ddf){if(_0x194ddf){var _0x595fd1=_0x194ddf[_0xe342('0x24')]({'plain':!![]});_0x595fd1=qs[_0xe342('0x53')](_0x595fd1,['id',_0xe342('0x54'),_0xe342('0x55')]);_0x35ae19[_0xe342('0x49')]=_['omit'](_0x35ae19[_0xe342('0x49')],['id',_0xe342('0x54'),_0xe342('0x55')]);return db['Campaign'][_0xe342('0x4f')](_[_0xe342('0x42')](_0x595fd1,_0x35ae19['body']),{'include':_0x35ae19[_0xe342('0x33')][_0xe342('0x52')]?[{'all':!![]}]:undefined})[_0xe342('0x23')](function(_0x36c87a){var _0x1c07ef=_0x35ae19[_0xe342('0x4a')][_0xe342('0x24')]({'plain':!![]});if(!_0x1c07ef)throw new Error(_0xe342('0x56'));if(_0x1c07ef[_0xe342('0x4b')]===_0xe342('0x4a')){var _0x128614=_0x36c87a[_0xe342('0x24')]({'plain':!![]});var _0x4dac3b='IvrCampaigns';return db[_0xe342('0x4c')][_0xe342('0x48')]({'where':{'name':_0x4dac3b,'userProfileId':_0x1c07ef[_0xe342('0x4d')]},'raw':!![]})['then'](function(_0x5074ae){if(_0x5074ae&&_0x5074ae[_0xe342('0x4e')]===0x0){return db[_0xe342('0x26')]['create']({'name':_0x128614[_0xe342('0x2a')],'resourceId':_0x128614['id'],'type':_0x5074ae[_0xe342('0x2a')],'sectionId':_0x5074ae['id']},{})['then'](function(){return _0x36c87a;});}else{return _0x36c87a;}})[_0xe342('0x44')](function(_0x471613){logger[_0xe342('0x28')](_0xe342('0x50'),_0x471613);throw _0x471613;});}return _0x36c87a;});}})[_0xe342('0x23')](respondWithResult(_0x505574,0xc9))['catch'](handleError(_0x505574,null));};exports[_0xe342('0x22')]=function(_0x44575c,_0x4321dc){if(_0x44575c[_0xe342('0x49')]['id']){delete _0x44575c[_0xe342('0x49')]['id'];}return db['Campaign'][_0xe342('0x48')]({'where':{'id':_0x44575c['params']['id']}})['then'](handleEntityNotFound(_0x4321dc,null))[_0xe342('0x23')](saveUpdates(_0x44575c[_0xe342('0x49')],null))[_0xe342('0x23')](respondWithResult(_0x4321dc,null))['catch'](handleError(_0x4321dc,null));};exports[_0xe342('0x27')]=function(_0x189649,_0x43cc18){return db['Campaign'][_0xe342('0x48')]({'where':{'id':_0x189649[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x43cc18,null))['then'](removeEntity(_0x43cc18,null))[_0xe342('0x44')](handleError(_0x43cc18,null));};exports['getHoppers']=function(_0x241820,_0x5d3272,_0x488d1a){var _0x30fb19={'raw':!![],'where':{}};var _0x25f20b={};var _0x2a811d={'count':0x0,'rows':[]};return db[_0xe342('0x43')][_0xe342('0x57')]({'where':{'id':_0x241820['params']['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x5d3272,null))['then'](function(_0x4ef328){if(_0x4ef328){_0x25f20b[_0xe342('0x31')]=_[_0xe342('0x34')](db[_0xe342('0x58')][_0xe342('0x2d')]);_0x25f20b['query']=_[_0xe342('0x34')](_0x241820[_0xe342('0x33')]);_0x25f20b[_0xe342('0x35')]=_[_0xe342('0x36')](_0x25f20b[_0xe342('0x31')],_0x25f20b[_0xe342('0x33')]);_0x30fb19['attributes']=_['intersection'](_0x25f20b[_0xe342('0x31')],qs['fields'](_0x241820[_0xe342('0x33')][_0xe342('0x38')]));_0x30fb19['attributes']=_0x30fb19['attributes'][_0xe342('0x39')]?_0x30fb19[_0xe342('0x37')]:_0x25f20b[_0xe342('0x31')];if(!_0x241820[_0xe342('0x33')][_0xe342('0x3a')](_0xe342('0x3b'))){_0x30fb19['limit']=qs[_0xe342('0x1c')](_0x241820[_0xe342('0x33')]['limit']);_0x30fb19['offset']=qs[_0xe342('0x1a')](_0x241820['query']['offset']);}_0x30fb19[_0xe342('0x3c')]=qs['sort'](_0x241820[_0xe342('0x33')][_0xe342('0x3d')]);_0x30fb19['where']=qs[_0xe342('0x35')](_[_0xe342('0x3f')](_0x241820[_0xe342('0x33')],_0x25f20b['filters']));_0x30fb19['where'][_0xe342('0x59')]=_0x4ef328['id'];if(_0x241820[_0xe342('0x33')]['filter']){_0x30fb19[_0xe342('0x3e')]=_[_0xe342('0x42')](_0x30fb19[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0x30fb19['attributes'],function(_0x201322){var _0x8f7861={};_0x8f7861[_0x201322]={'$like':'%'+_0x241820[_0xe342('0x33')][_0xe342('0x40')]+'%'};return _0x8f7861;})});}_0x30fb19=_[_0xe342('0x42')]({},_0x30fb19,_0x241820['options']);return db[_0xe342('0x58')][_0xe342('0x1d')]({'where':_0x30fb19[_0xe342('0x3e')]})[_0xe342('0x23')](function(_0x355971){_0x2a811d['count']=_0x355971;if(_0x241820[_0xe342('0x33')]['includeAll']){_0x30fb19['include']=[{'all':!![]}];}return db[_0xe342('0x58')]['findAll'](_0x30fb19);})[_0xe342('0x23')](function(_0x221cf4){_0x2a811d[_0xe342('0x5a')]=_0x221cf4;return _0x2a811d;});}})[_0xe342('0x23')](respondWithFilteredResult(_0x5d3272,_0x30fb19))[_0xe342('0x44')](handleError(_0x5d3272,null));};exports[_0xe342('0x5b')]=function(_0x559fd6,_0x258151,_0x57d07e){var _0x2ce315={'raw':!![],'where':{}};var _0xfd37aa={};var _0x49cf59={'count':0x0,'rows':[]};return db['Campaign'][_0xe342('0x57')]({'where':{'id':_0x559fd6[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x258151,null))[_0xe342('0x23')](function(_0x9384a8){if(_0x9384a8){_0xfd37aa[_0xe342('0x31')]=_[_0xe342('0x34')](db['CmHopperHistory']['rawAttributes']);_0xfd37aa[_0xe342('0x33')]=_[_0xe342('0x34')](_0x559fd6['query']);_0xfd37aa[_0xe342('0x35')]=_['intersection'](_0xfd37aa[_0xe342('0x31')],_0xfd37aa['query']);_0x2ce315[_0xe342('0x37')]=_[_0xe342('0x36')](_0xfd37aa[_0xe342('0x31')],qs[_0xe342('0x38')](_0x559fd6[_0xe342('0x33')][_0xe342('0x38')]));_0x2ce315[_0xe342('0x37')]=_0x2ce315[_0xe342('0x37')]['length']?_0x2ce315['attributes']:_0xfd37aa[_0xe342('0x31')];if(!_0x559fd6[_0xe342('0x33')]['hasOwnProperty'](_0xe342('0x3b'))){_0x2ce315[_0xe342('0x1c')]=qs[_0xe342('0x1c')](_0x559fd6[_0xe342('0x33')][_0xe342('0x1c')]);_0x2ce315[_0xe342('0x1a')]=qs[_0xe342('0x1a')](_0x559fd6[_0xe342('0x33')][_0xe342('0x1a')]);}_0x2ce315[_0xe342('0x3c')]=qs['sort'](_0x559fd6[_0xe342('0x33')][_0xe342('0x3d')]);_0x2ce315[_0xe342('0x3e')]=qs[_0xe342('0x35')](_[_0xe342('0x3f')](_0x559fd6[_0xe342('0x33')],_0xfd37aa[_0xe342('0x35')]));_0x2ce315[_0xe342('0x3e')][_0xe342('0x59')]=_0x9384a8['id'];if(_0x559fd6[_0xe342('0x33')][_0xe342('0x40')]){_0x2ce315[_0xe342('0x3e')]=_[_0xe342('0x42')](_0x2ce315[_0xe342('0x3e')],{'$or':_['map'](_0x2ce315[_0xe342('0x37')],function(_0x5634b9){var _0x4b6357={};_0x4b6357[_0x5634b9]={'$like':'%'+_0x559fd6[_0xe342('0x33')]['filter']+'%'};return _0x4b6357;})});}_0x2ce315=_[_0xe342('0x42')]({},_0x2ce315,_0x559fd6[_0xe342('0x5c')]);return db[_0xe342('0x5d')][_0xe342('0x1d')]({'where':_0x2ce315[_0xe342('0x3e')]})[_0xe342('0x23')](function(_0xbf2d8d){_0x49cf59['count']=_0xbf2d8d;if(_0x559fd6[_0xe342('0x33')]['includeAll']){_0x2ce315[_0xe342('0x47')]=[{'all':!![]}];}return db[_0xe342('0x5d')][_0xe342('0x5e')](_0x2ce315);})[_0xe342('0x23')](function(_0x570aaf){_0x49cf59['rows']=_0x570aaf;return _0x49cf59;});}})[_0xe342('0x23')](respondWithFilteredResult(_0x258151,_0x2ce315))[_0xe342('0x44')](handleError(_0x258151,null));};exports[_0xe342('0x5f')]=function(_0x36f3b4,_0xe1a485,_0x4cf910){var _0x54d87b={'raw':!![],'where':{}};var _0x4f5b24={};var _0x57db83={'count':0x0,'rows':[]};return db[_0xe342('0x43')][_0xe342('0x57')]({'where':{'id':_0x36f3b4[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0xe1a485,null))['then'](function(_0x56d98c){if(_0x56d98c){_0x4f5b24[_0xe342('0x31')]=_[_0xe342('0x34')](db[_0xe342('0x60')][_0xe342('0x2d')]);_0x4f5b24[_0xe342('0x33')]=_[_0xe342('0x34')](_0x36f3b4[_0xe342('0x33')]);_0x4f5b24['filters']=_[_0xe342('0x36')](_0x4f5b24[_0xe342('0x31')],_0x4f5b24['query']);_0x54d87b['attributes']=_[_0xe342('0x36')](_0x4f5b24[_0xe342('0x31')],qs['fields'](_0x36f3b4['query'][_0xe342('0x38')]));_0x54d87b['attributes']=_0x54d87b[_0xe342('0x37')]['length']?_0x54d87b[_0xe342('0x37')]:_0x4f5b24[_0xe342('0x31')];if(!_0x36f3b4['query'][_0xe342('0x3a')]('nolimit')){_0x54d87b[_0xe342('0x1c')]=qs['limit'](_0x36f3b4[_0xe342('0x33')][_0xe342('0x1c')]);_0x54d87b[_0xe342('0x1a')]=qs[_0xe342('0x1a')](_0x36f3b4[_0xe342('0x33')][_0xe342('0x1a')]);}_0x54d87b[_0xe342('0x3c')]=qs['sort'](_0x36f3b4[_0xe342('0x33')][_0xe342('0x3d')]);_0x54d87b[_0xe342('0x3e')]=qs[_0xe342('0x35')](_['pick'](_0x36f3b4[_0xe342('0x33')],_0x4f5b24['filters']));_0x54d87b[_0xe342('0x3e')][_0xe342('0x59')]=_0x56d98c['id'];if(_0x36f3b4[_0xe342('0x33')][_0xe342('0x40')]){_0x54d87b[_0xe342('0x3e')]=_['merge'](_0x54d87b[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0x54d87b['attributes'],function(_0xadef4b){var _0xe87aab={};_0xe87aab[_0xadef4b]={'$like':'%'+_0x36f3b4[_0xe342('0x33')][_0xe342('0x40')]+'%'};return _0xe87aab;})});}_0x54d87b=_[_0xe342('0x42')]({},_0x54d87b,_0x36f3b4[_0xe342('0x5c')]);return db[_0xe342('0x60')][_0xe342('0x1d')]({'where':_0x54d87b[_0xe342('0x3e')]})[_0xe342('0x23')](function(_0x23eecb){_0x57db83['count']=_0x23eecb;if(_0x36f3b4[_0xe342('0x33')][_0xe342('0x52')]){_0x54d87b[_0xe342('0x47')]=[{'all':!![]}];}return db[_0xe342('0x60')][_0xe342('0x5e')](_0x54d87b);})[_0xe342('0x23')](function(_0xf1d8e6){_0x57db83[_0xe342('0x5a')]=_0xf1d8e6;return _0x57db83;});}})[_0xe342('0x23')](respondWithFilteredResult(_0xe1a485,_0x54d87b))[_0xe342('0x44')](handleError(_0xe1a485,null));};exports[_0xe342('0x61')]=function(_0x15a178,_0x1fb1d8,_0x42573e){var _0x6928d1={'raw':!![],'where':{}};var _0x487cf4={};var _0x27f850={'count':0x0,'rows':[]};return db[_0xe342('0x43')][_0xe342('0x57')]({'where':{'id':_0x15a178[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x1fb1d8,null))[_0xe342('0x23')](function(_0x23e845){if(_0x23e845){_0x487cf4[_0xe342('0x31')]=_[_0xe342('0x34')](db[_0xe342('0x62')][_0xe342('0x2d')]);_0x487cf4[_0xe342('0x33')]=_[_0xe342('0x34')](_0x15a178[_0xe342('0x33')]);_0x487cf4[_0xe342('0x35')]=_[_0xe342('0x36')](_0x487cf4[_0xe342('0x31')],_0x487cf4[_0xe342('0x33')]);_0x6928d1[_0xe342('0x37')]=_[_0xe342('0x36')](_0x487cf4[_0xe342('0x31')],qs['fields'](_0x15a178[_0xe342('0x33')][_0xe342('0x38')]));_0x6928d1[_0xe342('0x37')]=_0x6928d1[_0xe342('0x37')][_0xe342('0x39')]?_0x6928d1['attributes']:_0x487cf4[_0xe342('0x31')];if(!_0x15a178['query'][_0xe342('0x3a')](_0xe342('0x3b'))){_0x6928d1[_0xe342('0x1c')]=qs['limit'](_0x15a178['query'][_0xe342('0x1c')]);_0x6928d1[_0xe342('0x1a')]=qs[_0xe342('0x1a')](_0x15a178[_0xe342('0x33')][_0xe342('0x1a')]);}_0x6928d1[_0xe342('0x3c')]=qs['sort'](_0x15a178[_0xe342('0x33')][_0xe342('0x3d')]);_0x6928d1[_0xe342('0x3e')]=qs[_0xe342('0x35')](_['pick'](_0x15a178[_0xe342('0x33')],_0x487cf4['filters']));_0x6928d1['where'][_0xe342('0x59')]=_0x23e845['id'];if(_0x15a178[_0xe342('0x33')]['filter']){_0x6928d1[_0xe342('0x3e')]=_[_0xe342('0x42')](_0x6928d1['where'],{'$or':_[_0xe342('0x32')](_0x6928d1[_0xe342('0x37')],function(_0x1821ee){var _0x1b6cb6={};_0x1b6cb6[_0x1821ee]={'$like':'%'+_0x15a178[_0xe342('0x33')][_0xe342('0x40')]+'%'};return _0x1b6cb6;})});}_0x6928d1=_[_0xe342('0x42')]({},_0x6928d1,_0x15a178[_0xe342('0x5c')]);return db[_0xe342('0x62')][_0xe342('0x1d')]({'where':_0x6928d1[_0xe342('0x3e')]})[_0xe342('0x23')](function(_0x37907d){_0x27f850[_0xe342('0x1d')]=_0x37907d;if(_0x15a178[_0xe342('0x33')][_0xe342('0x52')]){_0x6928d1['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xe342('0x5e')](_0x6928d1);})['then'](function(_0x15f103){_0x27f850[_0xe342('0x5a')]=_0x15f103;return _0x27f850;});}})[_0xe342('0x23')](respondWithFilteredResult(_0x1fb1d8,_0x6928d1))['catch'](handleError(_0x1fb1d8,null));};exports[_0xe342('0x63')]=function(_0x1b63d4,_0x289a24,_0x2e5172){var _0x4b2016={};var _0x19a871={};var _0x27c658;var _0xcd17a6;return db[_0xe342('0x43')][_0xe342('0x57')]({'where':{'id':_0x1b63d4[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x289a24,null))['then'](function(_0x182b64){if(_0x182b64){_0x27c658=_0x182b64;_0x19a871['model']=_['keys'](db[_0xe342('0x64')][_0xe342('0x2d')]);_0x19a871['query']=_[_0xe342('0x34')](_0x1b63d4[_0xe342('0x33')]);_0x19a871['filters']=_['intersection'](_0x19a871[_0xe342('0x31')],_0x19a871['query']);_0x4b2016[_0xe342('0x37')]=_['intersection'](_0x19a871[_0xe342('0x31')],qs['fields'](_0x1b63d4['query'][_0xe342('0x38')]));_0x4b2016[_0xe342('0x37')]=_0x4b2016[_0xe342('0x37')][_0xe342('0x39')]?_0x4b2016[_0xe342('0x37')]:_0x19a871[_0xe342('0x31')];_0x4b2016['order']=qs['sort'](_0x1b63d4[_0xe342('0x33')][_0xe342('0x3d')]);_0x4b2016[_0xe342('0x3e')]=qs[_0xe342('0x35')](_[_0xe342('0x3f')](_0x1b63d4[_0xe342('0x33')],_0x19a871[_0xe342('0x35')]));if(_0x1b63d4[_0xe342('0x33')]['filter']){_0x4b2016[_0xe342('0x3e')]=_['merge'](_0x4b2016['where'],{'$or':_[_0xe342('0x32')](_0x4b2016['attributes'],function(_0x3b5239){var _0x5eca07={};_0x5eca07[_0x3b5239]={'$like':'%'+_0x1b63d4[_0xe342('0x33')][_0xe342('0x40')]+'%'};return _0x5eca07;})});}_0x4b2016=_[_0xe342('0x42')]({},_0x4b2016,_0x1b63d4['options']);return _0x27c658[_0xe342('0x63')](_0x4b2016);}})[_0xe342('0x23')](function(_0x4bd0fb){if(_0x4bd0fb){_0xcd17a6=_0x4bd0fb[_0xe342('0x39')];if(!_0x1b63d4[_0xe342('0x33')]['hasOwnProperty'](_0xe342('0x3b'))){_0x4b2016[_0xe342('0x1c')]=qs[_0xe342('0x1c')](_0x1b63d4[_0xe342('0x33')]['limit']);_0x4b2016[_0xe342('0x1a')]=qs['offset'](_0x1b63d4[_0xe342('0x33')][_0xe342('0x1a')]);}return _0x27c658['getLists'](_0x4b2016);}})[_0xe342('0x23')](function(_0x2c7eaa){if(_0x2c7eaa){return _0x2c7eaa?{'count':_0xcd17a6,'rows':_0x2c7eaa}:null;}})[_0xe342('0x23')](respondWithResult(_0x289a24,null))[_0xe342('0x44')](handleError(_0x289a24,null));};exports[_0xe342('0x65')]=function(_0xdf7ae9,_0x2ed472,_0x4460f6){var _0x54b905,_0x44471a;var _0x3f5817=[];var _0x3acda3=moment()[_0xe342('0x66')](_0xe342('0x67'));return db[_0xe342('0x43')][_0xe342('0x48')]({'where':{'id':_0xdf7ae9[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ed472,null))[_0xe342('0x23')](function(_0x1c493b){if(_0x1c493b){_0x44471a=_0x1c493b;return _0x1c493b['addLists'](_0xdf7ae9[_0xe342('0x49')][_0xe342('0x68')],_[_0xe342('0x53')](_0xdf7ae9[_0xe342('0x49')],[_0xe342('0x68'),'id'])||{});}return null;})[_0xe342('0x69')](function(_0x455aa2){var _0x49217e;var _0x46cd72;_0x54b905=_0x455aa2||[];var _0x2f0b13=[];if(_0x455aa2){for(var _0x46615f=0x0;_0x46615f<_0x455aa2[_0xe342('0x39')];_0x46615f+=0x1){var _0x3d25d3=_0x455aa2[_0x46615f]['get']({'plain':!![]});_0x44471a['dialCheckDuplicateType']=_0xdf7ae9[_0xe342('0x49')][_0xe342('0x6a')]?_0xdf7ae9['body']['dialCheckDuplicateType']:_0x44471a[_0xe342('0x6a')];switch(_0x44471a[_0xe342('0x6a')]){case'always':_0x49217e=squel['insert']()[_0xe342('0x6b')](_0xe342('0x6c'))[_0xe342('0x6d')](['phone',_0xe342('0x6e'),_0xe342('0x6f'),'ListId','CampaignId',_0xe342('0x54'),_0xe342('0x55')],squel['select']()['field']('phone',_0xe342('0x70'))['field']('NOW()',_0xe342('0x6e'))[_0xe342('0x71')]('id',_0xe342('0x6f'))[_0xe342('0x71')](_0x3d25d3[_0xe342('0x72')]['toString'](),'ListId')[_0xe342('0x71')](_0xdf7ae9[_0xe342('0x46')]['id'][_0xe342('0x73')](),_0xe342('0x59'))[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27',_0xe342('0x54'))['field']('\x27'+_0x3acda3+'\x27',_0xe342('0x55'))[_0xe342('0x74')](_0xe342('0x75'))['where'](_0xe342('0x76'))[_0xe342('0x3e')](_0xe342('0x77'),_0x3d25d3[_0xe342('0x72')][_0xe342('0x73')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe342('0x3e')](_0xe342('0x78'),squel['select']()[_0xe342('0x71')](_0xe342('0x79'))[_0xe342('0x74')]('cm_hopper_final')[_0xe342('0x3e')](_0xe342('0x7a'),_0xdf7ae9[_0xe342('0x46')]['id'][_0xe342('0x73')]()))[_0xe342('0x3e')](_0xe342('0x78'),squel[_0xe342('0x7b')]()['field'](_0xe342('0x7c'))[_0xe342('0x74')](_0xe342('0x6c'))[_0xe342('0x3e')]('CampaignId\x20=\x20?',_0xdf7ae9[_0xe342('0x46')]['id'][_0xe342('0x73')]())))[_0xe342('0x73')]();break;case _0xe342('0x7d'):_0x49217e=squel[_0xe342('0x7e')]()[_0xe342('0x6b')](_0xe342('0x6c'))[_0xe342('0x6d')]([_0xe342('0x70'),'scheduledAt',_0xe342('0x6f'),_0xe342('0x7f'),_0xe342('0x59'),'createdAt',_0xe342('0x55')],squel[_0xe342('0x7b')]()[_0xe342('0x71')](_0xe342('0x70'),_0xe342('0x70'))[_0xe342('0x71')]('NOW()',_0xe342('0x6e'))[_0xe342('0x71')]('id',_0xe342('0x6f'))[_0xe342('0x71')](_0x3d25d3['CmListId'][_0xe342('0x73')](),_0xe342('0x7f'))[_0xe342('0x71')](_0xdf7ae9['params']['id']['toString'](),_0xe342('0x59'))['field']('\x27'+_0x3acda3+'\x27',_0xe342('0x54'))[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27','updatedAt')[_0xe342('0x74')](_0xe342('0x75'))[_0xe342('0x3e')](_0xe342('0x76'))[_0xe342('0x3e')]('ListId\x20=\x20?',_0x3d25d3[_0xe342('0x72')][_0xe342('0x73')]())['where'](_0xe342('0x80'))['where'](_0xe342('0x78'),squel[_0xe342('0x7b')]()['field'](_0xe342('0x7c'))[_0xe342('0x74')](_0xe342('0x6c'))[_0xe342('0x3e')](_0xe342('0x7a'),_0xdf7ae9[_0xe342('0x46')]['id']['toString']())))['toString']();break;default:_0x49217e=squel[_0xe342('0x7e')]()[_0xe342('0x6b')](_0xe342('0x6c'))[_0xe342('0x6d')](['phone',_0xe342('0x6e'),_0xe342('0x6f'),_0xe342('0x7f'),_0xe342('0x59'),_0xe342('0x54'),_0xe342('0x55')],squel['select']()[_0xe342('0x71')]('phone','phone')[_0xe342('0x71')](_0xe342('0x81'),_0xe342('0x6e'))[_0xe342('0x71')]('id',_0xe342('0x6f'))['field'](_0x3d25d3[_0xe342('0x72')][_0xe342('0x73')](),_0xe342('0x7f'))[_0xe342('0x71')](_0xdf7ae9[_0xe342('0x46')]['id']['toString'](),_0xe342('0x59'))[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27',_0xe342('0x54'))[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27','updatedAt')['from'](_0xe342('0x75'))[_0xe342('0x3e')](_0xe342('0x76'))[_0xe342('0x3e')]('ListId\x20=\x20?',_0x3d25d3['CmListId'][_0xe342('0x73')]())[_0xe342('0x3e')](_0xe342('0x80')))[_0xe342('0x73')]();}_0x46cd72=squel[_0xe342('0x7e')]()['into']('cm_hopper_additional_phones')[_0xe342('0x6d')]([_0xe342('0x82'),_0xe342('0x6e'),_0xe342('0x70'),_0xe342('0x83'),_0xe342('0x54'),'updatedAt'],squel['select']()[_0xe342('0x71')](_0xe342('0x84'),'id')[_0xe342('0x71')](_0xe342('0x81'),_0xe342('0x6e'))[_0xe342('0x71')](_0xe342('0x85'),_0xe342('0x70'))[_0xe342('0x71')](_0xe342('0x86'),_0xe342('0x83'))[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27','createdAt')[_0xe342('0x71')]('\x27'+_0x3acda3+'\x27',_0xe342('0x55'))[_0xe342('0x74')](_0xe342('0x87'),'ci')[_0xe342('0x88')](_0xe342('0x6c'),'h',_0xe342('0x89'))[_0xe342('0x3e')](_0xe342('0x8a'),_0x3d25d3[_0xe342('0x72')][_0xe342('0x73')]())[_0xe342('0x3e')](_0xe342('0x8b'),_0xdf7ae9[_0xe342('0x46')]['id']['toString']())[_0xe342('0x3e')](_0xe342('0x8c'),_0x3acda3))[_0xe342('0x73')]();_0x2f0b13['push'](db[_0xe342('0x8d')]['query'](_0x49217e));_0x3f5817[_0xe342('0x8e')](db[_0xe342('0x8d')][_0xe342('0x33')](_0x46cd72));}return BPromise[_0xe342('0x8f')](_0x2f0b13);}})[_0xe342('0x23')](function(){return BPromise[_0xe342('0x8f')](_0x3f5817);})['then'](function(){return _0x54b905;})[_0xe342('0x23')](respondWithResult(_0x2ed472,null))[_0xe342('0x44')](handleError(_0x2ed472,null));};exports[_0xe342('0x90')]=function(_0x292bf4,_0x1b6ff9,_0x5e785b){return db[_0xe342('0x43')][_0xe342('0x48')]({'where':{'id':_0x292bf4[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x1b6ff9,null))[_0xe342('0x23')](function(_0x1a1b59){if(_0x1a1b59){return _0x1a1b59[_0xe342('0x90')](_0x292bf4[_0xe342('0x33')][_0xe342('0x68')]);}})[_0xe342('0x23')](function(_0x1ed085){if(_0x1ed085){return db[_0xe342('0x58')][_0xe342('0x27')]({'where':{'ListId':_0x292bf4[_0xe342('0x33')]['ids'],'CampaignId':_0x292bf4[_0xe342('0x46')]['id']}})[_0xe342('0x23')](function(){return _0x1ed085;});}})[_0xe342('0x23')](respondWithStatusCode(_0x1b6ff9,null))[_0xe342('0x44')](handleError(_0x1b6ff9,null));};exports['getBlackLists']=function(_0x10c3a1,_0x403d09,_0x40aa0e){var _0x8bc675={};var _0x566cf3={};var _0x51fd7c;var _0x1f0959;return db['Campaign'][_0xe342('0x57')]({'where':{'id':_0x10c3a1[_0xe342('0x46')]['id']}})['then'](handleEntityNotFound(_0x403d09,null))['then'](function(_0x278457){if(_0x278457){_0x51fd7c=_0x278457;_0x566cf3[_0xe342('0x31')]=_[_0xe342('0x34')](db[_0xe342('0x64')][_0xe342('0x2d')]);_0x566cf3[_0xe342('0x33')]=_[_0xe342('0x34')](_0x10c3a1[_0xe342('0x33')]);_0x566cf3[_0xe342('0x35')]=_['intersection'](_0x566cf3[_0xe342('0x31')],_0x566cf3[_0xe342('0x33')]);_0x8bc675[_0xe342('0x37')]=_[_0xe342('0x36')](_0x566cf3['model'],qs['fields'](_0x10c3a1[_0xe342('0x33')][_0xe342('0x38')]));_0x8bc675[_0xe342('0x37')]=_0x8bc675[_0xe342('0x37')][_0xe342('0x39')]?_0x8bc675[_0xe342('0x37')]:_0x566cf3['model'];_0x8bc675[_0xe342('0x3c')]=qs[_0xe342('0x3d')](_0x10c3a1[_0xe342('0x33')][_0xe342('0x3d')]);_0x8bc675[_0xe342('0x3e')]=qs[_0xe342('0x35')](_[_0xe342('0x3f')](_0x10c3a1[_0xe342('0x33')],_0x566cf3['filters']));if(_0x10c3a1[_0xe342('0x33')][_0xe342('0x40')]){_0x8bc675[_0xe342('0x3e')]=_[_0xe342('0x42')](_0x8bc675[_0xe342('0x3e')],{'$or':_[_0xe342('0x32')](_0x8bc675[_0xe342('0x37')],function(_0x4b1b6b){var _0x2fd0c5={};_0x2fd0c5[_0x4b1b6b]={'$like':'%'+_0x10c3a1[_0xe342('0x33')][_0xe342('0x40')]+'%'};return _0x2fd0c5;})});}_0x8bc675=_[_0xe342('0x42')]({},_0x8bc675,_0x10c3a1[_0xe342('0x5c')]);return _0x51fd7c[_0xe342('0x91')](_0x8bc675);}})[_0xe342('0x23')](function(_0x44ab6b){if(_0x44ab6b){_0x1f0959=_0x44ab6b[_0xe342('0x39')];if(!_0x10c3a1[_0xe342('0x33')][_0xe342('0x3a')]('nolimit')){_0x8bc675[_0xe342('0x1c')]=qs[_0xe342('0x1c')](_0x10c3a1[_0xe342('0x33')]['limit']);_0x8bc675[_0xe342('0x1a')]=qs[_0xe342('0x1a')](_0x10c3a1[_0xe342('0x33')]['offset']);}return _0x51fd7c[_0xe342('0x91')](_0x8bc675);}})['then'](function(_0x3b4d07){if(_0x3b4d07){return _0x3b4d07?{'count':_0x1f0959,'rows':_0x3b4d07}:null;}})['then'](respondWithResult(_0x403d09,null))[_0xe342('0x44')](handleError(_0x403d09,null));};exports[_0xe342('0x92')]=function(_0xfe2f7a,_0x1bcf3c,_0x52deab){var _0x288ed3,_0x1057b6;var _0x3886b2=[];var _0x4c94f1=moment()[_0xe342('0x66')](_0xe342('0x67'));return db['Campaign'][_0xe342('0x48')]({'where':{'id':_0xfe2f7a[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x1bcf3c,null))[_0xe342('0x23')](function(_0x1d5c5a){if(_0x1d5c5a){_0x1057b6=_0x1d5c5a;return _0x1d5c5a[_0xe342('0x92')](_0xfe2f7a[_0xe342('0x49')]['ids'],_[_0xe342('0x53')](_0xfe2f7a[_0xe342('0x49')],['ids','id'])||{});}return null;})[_0xe342('0x69')](function(_0x309ec){var _0x2cc7e7;var _0x236da8;_0x288ed3=_0x309ec||[];var _0x4c1da7=[];if(_0x309ec){for(var _0x34c3a9=0x0;_0x34c3a9<_0x309ec[_0xe342('0x39')];_0x34c3a9+=0x1){var _0x3b61d4=_0x309ec[_0x34c3a9]['get']({'plain':!![]});_0x2cc7e7=squel[_0xe342('0x7e')]()[_0xe342('0x6b')](_0xe342('0x93'))[_0xe342('0x6d')]([_0xe342('0x70'),_0xe342('0x6f'),_0xe342('0x7f'),_0xe342('0x59'),_0xe342('0x54'),'updatedAt'],squel[_0xe342('0x7b')]()['field'](_0xe342('0x70'),'phone')[_0xe342('0x71')]('id',_0xe342('0x6f'))['field'](_0x3b61d4[_0xe342('0x72')][_0xe342('0x73')](),_0xe342('0x7f'))[_0xe342('0x71')](_0xfe2f7a[_0xe342('0x46')]['id'][_0xe342('0x73')](),_0xe342('0x59'))[_0xe342('0x71')](_0xe342('0x81'),_0xe342('0x54'))[_0xe342('0x71')](_0xe342('0x81'),_0xe342('0x55'))[_0xe342('0x74')](_0xe342('0x75'))[_0xe342('0x3e')]('deletedAt\x20IS\x20NULL')[_0xe342('0x3e')](_0xe342('0x77'),_0x3b61d4[_0xe342('0x72')][_0xe342('0x73')]())[_0xe342('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0xe342('0x73')]();_0x4c1da7[_0xe342('0x8e')](db[_0xe342('0x8d')][_0xe342('0x33')](_0x2cc7e7));}return BPromise[_0xe342('0x8f')](_0x4c1da7);}})['then'](function(){return _0x288ed3;})[_0xe342('0x23')](respondWithResult(_0x1bcf3c,null))[_0xe342('0x44')](handleError(_0x1bcf3c,null));};exports[_0xe342('0x94')]=function(_0x55a5d0,_0x38f867,_0x593598){return db[_0xe342('0x43')][_0xe342('0x48')]({'where':{'id':_0x55a5d0[_0xe342('0x46')]['id']}})[_0xe342('0x23')](handleEntityNotFound(_0x38f867,null))['then'](function(_0x39c239){if(_0x39c239){return _0x39c239[_0xe342('0x94')](_0x55a5d0[_0xe342('0x33')][_0xe342('0x68')]);}})[_0xe342('0x23')](function(_0x36c49d){if(_0x36c49d){return db[_0xe342('0x62')][_0xe342('0x27')]({'where':{'ListId':_0x55a5d0['query']['ids'],'CampaignId':_0x55a5d0[_0xe342('0x46')]['id']}})[_0xe342('0x23')](function(){return _0x36c49d;});}})['then'](respondWithStatusCode(_0x38f867,null))['catch'](handleError(_0x38f867,null));}; \ No newline at end of file +var _0x96d9=['attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','update','getHoppers','findOne','order','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','ListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','NOW()','from','cm_contacts','cm_hopper_additional_phones','OrderBy','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','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','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','apply','reject','destroy','then','IvrCampaigns','UserProfileResource','end','error','stack','name','map','Campaign','fieldName','key','model','query','keys','filters','intersection','fields'];(function(_0xdc972f,_0x541dbe){var _0x4219bd=function(_0x114846){while(--_0x114846){_0xdc972f['push'](_0xdc972f['shift']());}};_0x4219bd(++_0x541dbe);}(_0x96d9,0xea));var _0x996d=function(_0x141c5a,_0x5c8655){_0x141c5a=_0x141c5a-0x0;var _0x5d465a=_0x96d9[_0x141c5a];return _0x5d465a;};'use strict';var emlformat=require(_0x996d('0x0'));var rimraf=require(_0x996d('0x1'));var zipdir=require(_0x996d('0x2'));var jsonpatch=require(_0x996d('0x3'));var rp=require(_0x996d('0x4'));var moment=require(_0x996d('0x5'));var BPromise=require(_0x996d('0x6'));var Mustache=require(_0x996d('0x7'));var util=require('util');var path=require(_0x996d('0x8'));var sox=require(_0x996d('0x9'));var csv=require(_0x996d('0xa'));var ejs=require(_0x996d('0xb'));var fs=require('fs');var fs_extra=require(_0x996d('0xc'));var _=require(_0x996d('0xd'));var squel=require(_0x996d('0xe'));var crypto=require('crypto');var jsforce=require(_0x996d('0xf'));var deskjs=require(_0x996d('0x10'));var toCsv=require(_0x996d('0xa'));var querystring=require(_0x996d('0x11'));var Papa=require(_0x996d('0x12'));var Redis=require('ioredis');var authService=require(_0x996d('0x13'));var qs=require(_0x996d('0x14'));var as=require(_0x996d('0x15'));var hardwareService=require(_0x996d('0x16'));var logger=require('../../config/logger')(_0x996d('0x17'));var utils=require(_0x996d('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200f12,_0x2a585a){_0x2a585a=_0x2a585a||0xcc;return function(_0x54d85b){if(_0x54d85b){return _0x200f12[_0x996d('0x19')](_0x2a585a);}return _0x200f12[_0x996d('0x1a')](_0x2a585a)['end']();};}function respondWithResult(_0x2890fb,_0x269179){_0x269179=_0x269179||0xc8;return function(_0x18c2b8){if(_0x18c2b8){return _0x2890fb['status'](_0x269179)[_0x996d('0x1b')](_0x18c2b8);}};}function respondWithFilteredResult(_0x4c9568,_0x1da7b0){return function(_0xd8bcba){if(_0xd8bcba){var _0x281281=typeof _0x1da7b0[_0x996d('0x1c')]===_0x996d('0x1d')&&typeof _0x1da7b0[_0x996d('0x1e')]===_0x996d('0x1d');var _0x5a8b12=_0xd8bcba['count'];var _0x465c94=_0x281281?0x0:_0x1da7b0[_0x996d('0x1c')];var _0x33bf07=_0x281281?_0xd8bcba[_0x996d('0x1f')]:_0x1da7b0[_0x996d('0x1c')]+_0x1da7b0[_0x996d('0x1e')];var _0x1c2234;if(_0x33bf07>=_0x5a8b12){_0x33bf07=_0x5a8b12;_0x1c2234=0xc8;}else{_0x1c2234=0xce;}_0x4c9568[_0x996d('0x1a')](_0x1c2234);return _0x4c9568['set']('Content-Range',_0x465c94+'-'+_0x33bf07+'/'+_0x5a8b12)[_0x996d('0x1b')](_0xd8bcba);}return null;};}function patchUpdates(_0x21b00a){return function(_0x2da682){try{jsonpatch[_0x996d('0x20')](_0x2da682,_0x21b00a,!![]);}catch(_0x141bcb){return BPromise[_0x996d('0x21')](_0x141bcb);}return _0x2da682['save']();};}function saveUpdates(_0x2fbc32,_0x76a7e){return function(_0x379165){if(_0x379165){return _0x379165['update'](_0x2fbc32)['then'](function(_0x25d4c3){return _0x25d4c3;});}return null;};}function removeEntity(_0x42fae4,_0x53c4d9){return function(_0x2a9da1){if(_0x2a9da1){return _0x2a9da1[_0x996d('0x22')]()[_0x996d('0x23')](function(){var _0x42935d=_0x2a9da1['get']({'plain':!![]});var _0x534873=_0x996d('0x24');return db[_0x996d('0x25')]['destroy']({'where':{'type':_0x534873,'resourceId':_0x42935d['id']}})[_0x996d('0x23')](function(){return _0x2a9da1;});})['then'](function(){_0x42fae4[_0x996d('0x1a')](0xcc)[_0x996d('0x26')]();});}};}function handleEntityNotFound(_0x139399,_0x4419d0){return function(_0x29f1df){if(!_0x29f1df){_0x139399[_0x996d('0x19')](0x194);}return _0x29f1df;};}function handleError(_0x3c45be,_0x53123b){_0x53123b=_0x53123b||0x1f4;return function(_0xf93301){logger[_0x996d('0x27')](_0xf93301[_0x996d('0x28')]);if(_0xf93301[_0x996d('0x29')]){delete _0xf93301[_0x996d('0x29')];}_0x3c45be[_0x996d('0x1a')](_0x53123b)['send'](_0xf93301);};}exports['index']=function(_0x53cf8f,_0x220893){var _0x6b3221={},_0xf84d49={},_0x2ce7b7={'count':0x0,'rows':[]};var _0x1cf99e=_[_0x996d('0x2a')](db[_0x996d('0x2b')]['rawAttributes'],function(_0x58f595){return{'name':_0x58f595[_0x996d('0x2c')],'type':_0x58f595['type'][_0x996d('0x2d')]};});_0xf84d49[_0x996d('0x2e')]=_['map'](_0x1cf99e,_0x996d('0x29'));_0xf84d49[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x53cf8f['query']);_0xf84d49[_0x996d('0x31')]=_[_0x996d('0x32')](_0xf84d49[_0x996d('0x2e')],_0xf84d49['query']);_0x6b3221['attributes']=_[_0x996d('0x32')](_0xf84d49[_0x996d('0x2e')],qs['fields'](_0x53cf8f[_0x996d('0x2f')][_0x996d('0x33')]));_0x6b3221[_0x996d('0x34')]=_0x6b3221[_0x996d('0x34')][_0x996d('0x35')]?_0x6b3221['attributes']:_0xf84d49[_0x996d('0x2e')];if(!_0x53cf8f[_0x996d('0x2f')][_0x996d('0x36')](_0x996d('0x37'))){_0x6b3221[_0x996d('0x1e')]=qs['limit'](_0x53cf8f[_0x996d('0x2f')][_0x996d('0x1e')]);_0x6b3221[_0x996d('0x1c')]=qs[_0x996d('0x1c')](_0x53cf8f[_0x996d('0x2f')]['offset']);}_0x6b3221['order']=qs['sort'](_0x53cf8f['query'][_0x996d('0x38')]);_0x6b3221[_0x996d('0x39')]=qs[_0x996d('0x31')](_['pick'](_0x53cf8f[_0x996d('0x2f')],_0xf84d49[_0x996d('0x31')]),_0x1cf99e);if(_0x53cf8f[_0x996d('0x2f')][_0x996d('0x3a')]){_0x6b3221[_0x996d('0x39')]=_[_0x996d('0x3b')](_0x6b3221[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x1cf99e,function(_0x13ba9d){if(_0x13ba9d[_0x996d('0x3c')]!==_0x996d('0x3d')){var _0x3e08b={};_0x3e08b[_0x13ba9d['name']]={'$like':'%'+_0x53cf8f[_0x996d('0x2f')][_0x996d('0x3a')]+'%'};return _0x3e08b;}})});}_0x6b3221=_['merge']({},_0x6b3221,_0x53cf8f[_0x996d('0x3e')]);var _0x523d31={'where':_0x6b3221['where']};return db['Campaign']['count'](_0x523d31)[_0x996d('0x23')](function(_0x288f06){_0x2ce7b7['count']=_0x288f06;if(_0x53cf8f[_0x996d('0x2f')][_0x996d('0x3f')]){_0x6b3221[_0x996d('0x40')]=[{'all':!![]}];}return db[_0x996d('0x2b')][_0x996d('0x41')](_0x6b3221);})['then'](function(_0x113997){_0x2ce7b7[_0x996d('0x42')]=_0x113997;return _0x2ce7b7;})[_0x996d('0x23')](respondWithFilteredResult(_0x220893,_0x6b3221))[_0x996d('0x43')](handleError(_0x220893,null));};exports[_0x996d('0x44')]=function(_0x5dfba5,_0x57c975){var _0x3e4555={'raw':![],'where':{'id':_0x5dfba5[_0x996d('0x45')]['id']}},_0x906237={};_0x906237['model']=_[_0x996d('0x30')](db[_0x996d('0x2b')]['rawAttributes']);_0x906237['query']=_[_0x996d('0x30')](_0x5dfba5['query']);_0x906237[_0x996d('0x31')]=_[_0x996d('0x32')](_0x906237['model'],_0x906237[_0x996d('0x2f')]);_0x3e4555[_0x996d('0x34')]=_[_0x996d('0x32')](_0x906237[_0x996d('0x2e')],qs[_0x996d('0x33')](_0x5dfba5['query'][_0x996d('0x33')]));_0x3e4555['attributes']=_0x3e4555['attributes']['length']?_0x3e4555['attributes']:_0x906237[_0x996d('0x2e')];if(_0x5dfba5[_0x996d('0x2f')][_0x996d('0x3f')]){_0x3e4555['include']=[{'all':!![]}];}_0x3e4555=_['merge']({},_0x3e4555,_0x5dfba5[_0x996d('0x3e')]);return db[_0x996d('0x2b')][_0x996d('0x46')](_0x3e4555)[_0x996d('0x23')](handleEntityNotFound(_0x57c975,null))[_0x996d('0x23')](respondWithResult(_0x57c975,null))['catch'](handleError(_0x57c975,null));};exports[_0x996d('0x47')]=function(_0x23c8aa,_0xed150d){return db[_0x996d('0x2b')][_0x996d('0x47')](_0x23c8aa[_0x996d('0x48')],{})[_0x996d('0x23')](function(_0x4a5046){var _0x4aa0a3=_0x23c8aa[_0x996d('0x49')][_0x996d('0x4a')]({'plain':!![]});if(!_0x4aa0a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa0a3['role']===_0x996d('0x49')){var _0x588979=_0x4a5046[_0x996d('0x4a')]({'plain':!![]});var _0xcd988b=_0x996d('0x24');return db[_0x996d('0x4b')]['find']({'where':{'name':_0xcd988b,'userProfileId':_0x4aa0a3[_0x996d('0x4c')]},'raw':!![]})['then'](function(_0x42926e){if(_0x42926e&&_0x42926e[_0x996d('0x4d')]===0x0){return db[_0x996d('0x25')][_0x996d('0x47')]({'name':_0x588979['name'],'resourceId':_0x588979['id'],'type':_0x42926e[_0x996d('0x29')],'sectionId':_0x42926e['id']},{})[_0x996d('0x23')](function(){return _0x4a5046;});}else{return _0x4a5046;}})[_0x996d('0x43')](function(_0x1107c1){logger[_0x996d('0x27')](_0x996d('0x4e'),_0x1107c1);throw _0x1107c1;});}return _0x4a5046;})[_0x996d('0x23')](respondWithResult(_0xed150d,0xc9))[_0x996d('0x43')](handleError(_0xed150d,null));};exports['clone']=function(_0x590549,_0x5096be){var _0x34466f={'where':{'id':_0x590549[_0x996d('0x45')]['id']}},_0x259690={};_0x259690[_0x996d('0x2e')]=_[_0x996d('0x30')](db['Campaign'][_0x996d('0x4f')]);_0x34466f[_0x996d('0x34')]=_[_0x996d('0x32')](_0x259690[_0x996d('0x2e')],qs[_0x996d('0x33')](_0x590549[_0x996d('0x2f')][_0x996d('0x33')]));_0x34466f[_0x996d('0x34')]=_0x34466f[_0x996d('0x34')][_0x996d('0x35')]?_0x34466f['attributes']:_0x259690[_0x996d('0x2e')];if(_0x590549[_0x996d('0x2f')][_0x996d('0x3f')]){_0x34466f['include']=[{'all':!![]}];}_0x34466f=_['merge']({},_0x34466f,_0x590549[_0x996d('0x3e')]);return db[_0x996d('0x2b')][_0x996d('0x46')](_0x34466f)['then'](handleEntityNotFound(_0x5096be,null))['then'](function(_0xc5119){if(_0xc5119){var _0xdac7f1=_0xc5119[_0x996d('0x4a')]({'plain':!![]});_0xdac7f1=qs['omit'](_0xdac7f1,['id',_0x996d('0x50'),'updatedAt']);_0x590549[_0x996d('0x48')]=_[_0x996d('0x51')](_0x590549[_0x996d('0x48')],['id',_0x996d('0x50'),_0x996d('0x52')]);return db[_0x996d('0x2b')][_0x996d('0x47')](_[_0x996d('0x3b')](_0xdac7f1,_0x590549[_0x996d('0x48')]),{'include':_0x590549['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x1debd5){var _0x6739b=_0x590549[_0x996d('0x49')][_0x996d('0x4a')]({'plain':!![]});if(!_0x6739b)throw new Error(_0x996d('0x53'));if(_0x6739b[_0x996d('0x54')]===_0x996d('0x49')){var _0x3d1d4d=_0x1debd5['get']({'plain':!![]});var _0x3ef853=_0x996d('0x24');return db[_0x996d('0x4b')][_0x996d('0x46')]({'where':{'name':_0x3ef853,'userProfileId':_0x6739b[_0x996d('0x4c')]},'raw':!![]})['then'](function(_0x2babdc){if(_0x2babdc&&_0x2babdc['autoAssociation']===0x0){return db[_0x996d('0x25')][_0x996d('0x47')]({'name':_0x3d1d4d[_0x996d('0x29')],'resourceId':_0x3d1d4d['id'],'type':_0x2babdc['name'],'sectionId':_0x2babdc['id']},{})[_0x996d('0x23')](function(){return _0x1debd5;});}else{return _0x1debd5;}})[_0x996d('0x43')](function(_0x445feb){logger[_0x996d('0x27')](_0x996d('0x4e'),_0x445feb);throw _0x445feb;});}return _0x1debd5;});}})[_0x996d('0x23')](respondWithResult(_0x5096be,0xc9))[_0x996d('0x43')](handleError(_0x5096be,null));};exports[_0x996d('0x55')]=function(_0x3eb579,_0x44b7a5){if(_0x3eb579[_0x996d('0x48')]['id']){delete _0x3eb579[_0x996d('0x48')]['id'];}return db['Campaign'][_0x996d('0x46')]({'where':{'id':_0x3eb579[_0x996d('0x45')]['id']}})['then'](handleEntityNotFound(_0x44b7a5,null))[_0x996d('0x23')](saveUpdates(_0x3eb579[_0x996d('0x48')],null))[_0x996d('0x23')](respondWithResult(_0x44b7a5,null))[_0x996d('0x43')](handleError(_0x44b7a5,null));};exports['destroy']=function(_0x4df866,_0x5eae09){return db['Campaign']['find']({'where':{'id':_0x4df866['params']['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x5eae09,null))['then'](removeEntity(_0x5eae09,null))[_0x996d('0x43')](handleError(_0x5eae09,null));};exports[_0x996d('0x56')]=function(_0x49a166,_0x140dc9,_0x4b7f87){var _0x31bf2a={'raw':!![],'where':{}};var _0x2a34c0={};var _0x51aa5f={'count':0x0,'rows':[]};return db[_0x996d('0x2b')][_0x996d('0x57')]({'where':{'id':_0x49a166[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x140dc9,null))[_0x996d('0x23')](function(_0x35fae8){if(_0x35fae8){_0x2a34c0[_0x996d('0x2e')]=_[_0x996d('0x30')](db['CmHopper'][_0x996d('0x4f')]);_0x2a34c0[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x49a166[_0x996d('0x2f')]);_0x2a34c0[_0x996d('0x31')]=_[_0x996d('0x32')](_0x2a34c0[_0x996d('0x2e')],_0x2a34c0[_0x996d('0x2f')]);_0x31bf2a['attributes']=_['intersection'](_0x2a34c0[_0x996d('0x2e')],qs['fields'](_0x49a166[_0x996d('0x2f')][_0x996d('0x33')]));_0x31bf2a[_0x996d('0x34')]=_0x31bf2a[_0x996d('0x34')][_0x996d('0x35')]?_0x31bf2a['attributes']:_0x2a34c0['model'];if(!_0x49a166[_0x996d('0x2f')][_0x996d('0x36')](_0x996d('0x37'))){_0x31bf2a[_0x996d('0x1e')]=qs[_0x996d('0x1e')](_0x49a166[_0x996d('0x2f')]['limit']);_0x31bf2a['offset']=qs['offset'](_0x49a166['query'][_0x996d('0x1c')]);}_0x31bf2a[_0x996d('0x58')]=qs['sort'](_0x49a166['query'][_0x996d('0x38')]);_0x31bf2a[_0x996d('0x39')]=qs[_0x996d('0x31')](_['pick'](_0x49a166[_0x996d('0x2f')],_0x2a34c0['filters']));_0x31bf2a[_0x996d('0x39')][_0x996d('0x59')]=_0x35fae8['id'];if(_0x49a166[_0x996d('0x2f')][_0x996d('0x3a')]){_0x31bf2a[_0x996d('0x39')]=_[_0x996d('0x3b')](_0x31bf2a[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x31bf2a[_0x996d('0x34')],function(_0x53d4b5){var _0x5a6868={};_0x5a6868[_0x53d4b5]={'$like':'%'+_0x49a166[_0x996d('0x2f')][_0x996d('0x3a')]+'%'};return _0x5a6868;})});}_0x31bf2a=_['merge']({},_0x31bf2a,_0x49a166[_0x996d('0x3e')]);return db[_0x996d('0x5a')]['count']({'where':_0x31bf2a[_0x996d('0x39')]})[_0x996d('0x23')](function(_0x36e9c7){_0x51aa5f['count']=_0x36e9c7;if(_0x49a166['query'][_0x996d('0x3f')]){_0x31bf2a[_0x996d('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x996d('0x41')](_0x31bf2a);})[_0x996d('0x23')](function(_0x5b013a){_0x51aa5f[_0x996d('0x42')]=_0x5b013a;return _0x51aa5f;});}})[_0x996d('0x23')](respondWithFilteredResult(_0x140dc9,_0x31bf2a))[_0x996d('0x43')](handleError(_0x140dc9,null));};exports[_0x996d('0x5b')]=function(_0x226a4e,_0x5abcab,_0x426e72){var _0x3d45dd={'raw':!![],'where':{}};var _0x3be48e={};var _0x46c79e={'count':0x0,'rows':[]};return db[_0x996d('0x2b')][_0x996d('0x57')]({'where':{'id':_0x226a4e[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x5abcab,null))[_0x996d('0x23')](function(_0x584951){if(_0x584951){_0x3be48e['model']=_[_0x996d('0x30')](db[_0x996d('0x5c')][_0x996d('0x4f')]);_0x3be48e[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x226a4e[_0x996d('0x2f')]);_0x3be48e[_0x996d('0x31')]=_[_0x996d('0x32')](_0x3be48e[_0x996d('0x2e')],_0x3be48e[_0x996d('0x2f')]);_0x3d45dd['attributes']=_[_0x996d('0x32')](_0x3be48e['model'],qs[_0x996d('0x33')](_0x226a4e[_0x996d('0x2f')][_0x996d('0x33')]));_0x3d45dd[_0x996d('0x34')]=_0x3d45dd[_0x996d('0x34')]['length']?_0x3d45dd['attributes']:_0x3be48e[_0x996d('0x2e')];if(!_0x226a4e[_0x996d('0x2f')][_0x996d('0x36')]('nolimit')){_0x3d45dd[_0x996d('0x1e')]=qs['limit'](_0x226a4e['query'][_0x996d('0x1e')]);_0x3d45dd[_0x996d('0x1c')]=qs['offset'](_0x226a4e[_0x996d('0x2f')][_0x996d('0x1c')]);}_0x3d45dd[_0x996d('0x58')]=qs[_0x996d('0x38')](_0x226a4e[_0x996d('0x2f')]['sort']);_0x3d45dd['where']=qs[_0x996d('0x31')](_[_0x996d('0x5d')](_0x226a4e[_0x996d('0x2f')],_0x3be48e[_0x996d('0x31')]));_0x3d45dd['where'][_0x996d('0x59')]=_0x584951['id'];if(_0x226a4e[_0x996d('0x2f')][_0x996d('0x3a')]){_0x3d45dd[_0x996d('0x39')]=_['merge'](_0x3d45dd[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x3d45dd['attributes'],function(_0x369d3f){var _0x4734fd={};_0x4734fd[_0x369d3f]={'$like':'%'+_0x226a4e['query'][_0x996d('0x3a')]+'%'};return _0x4734fd;})});}_0x3d45dd=_[_0x996d('0x3b')]({},_0x3d45dd,_0x226a4e[_0x996d('0x3e')]);return db[_0x996d('0x5c')][_0x996d('0x1f')]({'where':_0x3d45dd['where']})[_0x996d('0x23')](function(_0x47f38f){_0x46c79e['count']=_0x47f38f;if(_0x226a4e[_0x996d('0x2f')][_0x996d('0x3f')]){_0x3d45dd['include']=[{'all':!![]}];}return db[_0x996d('0x5c')]['findAll'](_0x3d45dd);})[_0x996d('0x23')](function(_0x476ce8){_0x46c79e[_0x996d('0x42')]=_0x476ce8;return _0x46c79e;});}})[_0x996d('0x23')](respondWithFilteredResult(_0x5abcab,_0x3d45dd))[_0x996d('0x43')](handleError(_0x5abcab,null));};exports[_0x996d('0x5e')]=function(_0x4b9b84,_0x5062e6,_0x5b4d91){var _0x249d5e={'raw':!![],'where':{}};var _0x2d5838={};var _0x38238d={'count':0x0,'rows':[]};return db[_0x996d('0x2b')][_0x996d('0x57')]({'where':{'id':_0x4b9b84[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x5062e6,null))['then'](function(_0x3922f8){if(_0x3922f8){_0x2d5838[_0x996d('0x2e')]=_['keys'](db[_0x996d('0x5f')]['rawAttributes']);_0x2d5838[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x4b9b84[_0x996d('0x2f')]);_0x2d5838[_0x996d('0x31')]=_[_0x996d('0x32')](_0x2d5838[_0x996d('0x2e')],_0x2d5838[_0x996d('0x2f')]);_0x249d5e[_0x996d('0x34')]=_[_0x996d('0x32')](_0x2d5838[_0x996d('0x2e')],qs[_0x996d('0x33')](_0x4b9b84[_0x996d('0x2f')]['fields']));_0x249d5e[_0x996d('0x34')]=_0x249d5e['attributes']['length']?_0x249d5e[_0x996d('0x34')]:_0x2d5838['model'];if(!_0x4b9b84['query']['hasOwnProperty'](_0x996d('0x37'))){_0x249d5e[_0x996d('0x1e')]=qs[_0x996d('0x1e')](_0x4b9b84['query'][_0x996d('0x1e')]);_0x249d5e[_0x996d('0x1c')]=qs[_0x996d('0x1c')](_0x4b9b84['query'][_0x996d('0x1c')]);}_0x249d5e['order']=qs['sort'](_0x4b9b84[_0x996d('0x2f')][_0x996d('0x38')]);_0x249d5e[_0x996d('0x39')]=qs[_0x996d('0x31')](_['pick'](_0x4b9b84['query'],_0x2d5838[_0x996d('0x31')]));_0x249d5e[_0x996d('0x39')][_0x996d('0x59')]=_0x3922f8['id'];if(_0x4b9b84[_0x996d('0x2f')][_0x996d('0x3a')]){_0x249d5e[_0x996d('0x39')]=_['merge'](_0x249d5e[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x249d5e['attributes'],function(_0xeea435){var _0x34ebb0={};_0x34ebb0[_0xeea435]={'$like':'%'+_0x4b9b84[_0x996d('0x2f')][_0x996d('0x3a')]+'%'};return _0x34ebb0;})});}_0x249d5e=_['merge']({},_0x249d5e,_0x4b9b84[_0x996d('0x3e')]);return db[_0x996d('0x5f')][_0x996d('0x1f')]({'where':_0x249d5e[_0x996d('0x39')]})[_0x996d('0x23')](function(_0x51ad26){_0x38238d[_0x996d('0x1f')]=_0x51ad26;if(_0x4b9b84[_0x996d('0x2f')][_0x996d('0x3f')]){_0x249d5e['include']=[{'all':!![]}];}return db[_0x996d('0x5f')][_0x996d('0x41')](_0x249d5e);})[_0x996d('0x23')](function(_0x29ac71){_0x38238d[_0x996d('0x42')]=_0x29ac71;return _0x38238d;});}})[_0x996d('0x23')](respondWithFilteredResult(_0x5062e6,_0x249d5e))[_0x996d('0x43')](handleError(_0x5062e6,null));};exports[_0x996d('0x60')]=function(_0x5318f3,_0x17cd8e,_0x345505){var _0x3e2d06={'raw':!![],'where':{}};var _0x288a50={};var _0x277628={'count':0x0,'rows':[]};return db[_0x996d('0x2b')]['findOne']({'where':{'id':_0x5318f3[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x17cd8e,null))['then'](function(_0x4c2088){if(_0x4c2088){_0x288a50[_0x996d('0x2e')]=_[_0x996d('0x30')](db[_0x996d('0x61')][_0x996d('0x4f')]);_0x288a50[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x5318f3[_0x996d('0x2f')]);_0x288a50[_0x996d('0x31')]=_[_0x996d('0x32')](_0x288a50[_0x996d('0x2e')],_0x288a50[_0x996d('0x2f')]);_0x3e2d06[_0x996d('0x34')]=_[_0x996d('0x32')](_0x288a50[_0x996d('0x2e')],qs[_0x996d('0x33')](_0x5318f3[_0x996d('0x2f')][_0x996d('0x33')]));_0x3e2d06[_0x996d('0x34')]=_0x3e2d06['attributes'][_0x996d('0x35')]?_0x3e2d06[_0x996d('0x34')]:_0x288a50[_0x996d('0x2e')];if(!_0x5318f3[_0x996d('0x2f')][_0x996d('0x36')](_0x996d('0x37'))){_0x3e2d06['limit']=qs[_0x996d('0x1e')](_0x5318f3[_0x996d('0x2f')]['limit']);_0x3e2d06[_0x996d('0x1c')]=qs[_0x996d('0x1c')](_0x5318f3['query'][_0x996d('0x1c')]);}_0x3e2d06['order']=qs[_0x996d('0x38')](_0x5318f3[_0x996d('0x2f')]['sort']);_0x3e2d06[_0x996d('0x39')]=qs[_0x996d('0x31')](_[_0x996d('0x5d')](_0x5318f3['query'],_0x288a50[_0x996d('0x31')]));_0x3e2d06[_0x996d('0x39')]['CampaignId']=_0x4c2088['id'];if(_0x5318f3[_0x996d('0x2f')][_0x996d('0x3a')]){_0x3e2d06['where']=_['merge'](_0x3e2d06[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x3e2d06['attributes'],function(_0x5c2ce4){var _0x1ccbf6={};_0x1ccbf6[_0x5c2ce4]={'$like':'%'+_0x5318f3[_0x996d('0x2f')][_0x996d('0x3a')]+'%'};return _0x1ccbf6;})});}_0x3e2d06=_[_0x996d('0x3b')]({},_0x3e2d06,_0x5318f3[_0x996d('0x3e')]);return db['CmHopperBlack'][_0x996d('0x1f')]({'where':_0x3e2d06[_0x996d('0x39')]})[_0x996d('0x23')](function(_0x3d6e8d){_0x277628[_0x996d('0x1f')]=_0x3d6e8d;if(_0x5318f3[_0x996d('0x2f')][_0x996d('0x3f')]){_0x3e2d06[_0x996d('0x40')]=[{'all':!![]}];}return db[_0x996d('0x61')]['findAll'](_0x3e2d06);})['then'](function(_0x2312bd){_0x277628[_0x996d('0x42')]=_0x2312bd;return _0x277628;});}})[_0x996d('0x23')](respondWithFilteredResult(_0x17cd8e,_0x3e2d06))[_0x996d('0x43')](handleError(_0x17cd8e,null));};exports[_0x996d('0x62')]=function(_0x4bd37c,_0x300095,_0xb687f5){var _0x450088={};var _0x2026a8={};var _0x17b359;var _0x19db11;return db[_0x996d('0x2b')]['findOne']({'where':{'id':_0x4bd37c[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x300095,null))[_0x996d('0x23')](function(_0x1f683f){if(_0x1f683f){_0x17b359=_0x1f683f;_0x2026a8['model']=_['keys'](db['CmList']['rawAttributes']);_0x2026a8['query']=_[_0x996d('0x30')](_0x4bd37c['query']);_0x2026a8[_0x996d('0x31')]=_[_0x996d('0x32')](_0x2026a8['model'],_0x2026a8[_0x996d('0x2f')]);_0x450088[_0x996d('0x34')]=_['intersection'](_0x2026a8[_0x996d('0x2e')],qs[_0x996d('0x33')](_0x4bd37c[_0x996d('0x2f')][_0x996d('0x33')]));_0x450088['attributes']=_0x450088[_0x996d('0x34')][_0x996d('0x35')]?_0x450088[_0x996d('0x34')]:_0x2026a8[_0x996d('0x2e')];_0x450088[_0x996d('0x58')]=qs[_0x996d('0x38')](_0x4bd37c[_0x996d('0x2f')]['sort']);_0x450088['where']=qs['filters'](_[_0x996d('0x5d')](_0x4bd37c[_0x996d('0x2f')],_0x2026a8[_0x996d('0x31')]));if(_0x4bd37c['query'][_0x996d('0x3a')]){_0x450088['where']=_[_0x996d('0x3b')](_0x450088[_0x996d('0x39')],{'$or':_[_0x996d('0x2a')](_0x450088['attributes'],function(_0x716370){var _0x3ab056={};_0x3ab056[_0x716370]={'$like':'%'+_0x4bd37c[_0x996d('0x2f')][_0x996d('0x3a')]+'%'};return _0x3ab056;})});}_0x450088=_['merge']({},_0x450088,_0x4bd37c[_0x996d('0x3e')]);return _0x17b359[_0x996d('0x62')](_0x450088);}})[_0x996d('0x23')](function(_0x1f8537){if(_0x1f8537){_0x19db11=_0x1f8537['length'];if(!_0x4bd37c['query'][_0x996d('0x36')](_0x996d('0x37'))){_0x450088['limit']=qs[_0x996d('0x1e')](_0x4bd37c[_0x996d('0x2f')][_0x996d('0x1e')]);_0x450088[_0x996d('0x1c')]=qs[_0x996d('0x1c')](_0x4bd37c[_0x996d('0x2f')][_0x996d('0x1c')]);}return _0x17b359[_0x996d('0x62')](_0x450088);}})[_0x996d('0x23')](function(_0x7388f3){if(_0x7388f3){return _0x7388f3?{'count':_0x19db11,'rows':_0x7388f3}:null;}})[_0x996d('0x23')](respondWithResult(_0x300095,null))['catch'](handleError(_0x300095,null));};exports['addLists']=function(_0x283aae,_0x37b411,_0x5c17c6){var _0x48dd4c,_0x7bb8e8;var _0xd29d6e=[];var _0x4f9fb7=moment()[_0x996d('0x63')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x996d('0x46')]({'where':{'id':_0x283aae['params']['id']}})['then'](handleEntityNotFound(_0x37b411,null))[_0x996d('0x23')](function(_0x83547){if(_0x83547){_0x7bb8e8=_0x83547;return _0x83547[_0x996d('0x64')](_0x283aae[_0x996d('0x48')][_0x996d('0x65')],_[_0x996d('0x51')](_0x283aae[_0x996d('0x48')],[_0x996d('0x65'),'id'])||{});}return null;})[_0x996d('0x66')](function(_0x492c32){var _0x47b394;var _0xd8f8d0;_0x48dd4c=_0x492c32||[];var _0x292b3c=[];if(_0x492c32){for(var _0x1de50a=0x0;_0x1de50a<_0x492c32[_0x996d('0x35')];_0x1de50a+=0x1){var _0x697ed6=_0x492c32[_0x1de50a][_0x996d('0x4a')]({'plain':!![]});_0x7bb8e8[_0x996d('0x67')]=_0x283aae[_0x996d('0x48')][_0x996d('0x67')]?_0x283aae[_0x996d('0x48')][_0x996d('0x67')]:_0x7bb8e8['dialCheckDuplicateType'];switch(_0x7bb8e8[_0x996d('0x67')]){case _0x996d('0x68'):_0x47b394=squel[_0x996d('0x69')]()[_0x996d('0x6a')](_0x996d('0x6b'))[_0x996d('0x6c')]([_0x996d('0x6d'),_0x996d('0x6e'),_0x996d('0x6f'),'ListId',_0x996d('0x59'),_0x996d('0x50'),'updatedAt'],squel[_0x996d('0x70')]()[_0x996d('0x71')](_0x996d('0x6d'),_0x996d('0x6d'))[_0x996d('0x71')]('NOW()',_0x996d('0x6e'))['field']('id',_0x996d('0x6f'))['field'](_0x697ed6[_0x996d('0x72')]['toString'](),_0x996d('0x73'))[_0x996d('0x71')](_0x283aae[_0x996d('0x45')]['id'][_0x996d('0x74')](),_0x996d('0x59'))[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27',_0x996d('0x50'))[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27','updatedAt')['from']('cm_contacts')[_0x996d('0x39')](_0x996d('0x75'))['where'](_0x996d('0x76'),_0x697ed6[_0x996d('0x72')][_0x996d('0x74')]())[_0x996d('0x39')](_0x996d('0x77'))[_0x996d('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0x996d('0x70')]()[_0x996d('0x71')](_0x996d('0x78'))['from'](_0x996d('0x79'))['where'](_0x996d('0x7a'),_0x283aae[_0x996d('0x45')]['id'][_0x996d('0x74')]()))[_0x996d('0x39')](_0x996d('0x7b'),squel[_0x996d('0x70')]()[_0x996d('0x71')]('COALESCE(phone,\x27\x27)')['from'](_0x996d('0x6b'))[_0x996d('0x39')](_0x996d('0x7a'),_0x283aae[_0x996d('0x45')]['id'][_0x996d('0x74')]())))[_0x996d('0x74')]();break;case _0x996d('0x7c'):_0x47b394=squel[_0x996d('0x69')]()[_0x996d('0x6a')](_0x996d('0x6b'))['fromQuery'](['phone','scheduledAt','ContactId',_0x996d('0x73'),_0x996d('0x59'),_0x996d('0x50'),_0x996d('0x52')],squel[_0x996d('0x70')]()[_0x996d('0x71')](_0x996d('0x6d'),'phone')[_0x996d('0x71')](_0x996d('0x7d'),_0x996d('0x6e'))[_0x996d('0x71')]('id','ContactId')[_0x996d('0x71')](_0x697ed6[_0x996d('0x72')][_0x996d('0x74')](),_0x996d('0x73'))[_0x996d('0x71')](_0x283aae[_0x996d('0x45')]['id'][_0x996d('0x74')](),_0x996d('0x59'))[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27',_0x996d('0x50'))[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27',_0x996d('0x52'))[_0x996d('0x7e')](_0x996d('0x7f'))[_0x996d('0x39')](_0x996d('0x75'))[_0x996d('0x39')]('ListId\x20=\x20?',_0x697ed6[_0x996d('0x72')][_0x996d('0x74')]())['where'](_0x996d('0x77'))[_0x996d('0x39')](_0x996d('0x7b'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x996d('0x7e')](_0x996d('0x6b'))['where'](_0x996d('0x7a'),_0x283aae[_0x996d('0x45')]['id'][_0x996d('0x74')]())))[_0x996d('0x74')]();break;default:_0x47b394=squel[_0x996d('0x69')]()['into'](_0x996d('0x6b'))['fromQuery']([_0x996d('0x6d'),_0x996d('0x6e'),_0x996d('0x6f'),_0x996d('0x73'),_0x996d('0x59'),_0x996d('0x50'),_0x996d('0x52')],squel[_0x996d('0x70')]()['field'](_0x996d('0x6d'),_0x996d('0x6d'))[_0x996d('0x71')](_0x996d('0x7d'),_0x996d('0x6e'))[_0x996d('0x71')]('id',_0x996d('0x6f'))[_0x996d('0x71')](_0x697ed6[_0x996d('0x72')]['toString'](),_0x996d('0x73'))[_0x996d('0x71')](_0x283aae[_0x996d('0x45')]['id']['toString'](),'CampaignId')['field']('\x27'+_0x4f9fb7+'\x27',_0x996d('0x50'))[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27',_0x996d('0x52'))['from'](_0x996d('0x7f'))[_0x996d('0x39')](_0x996d('0x75'))[_0x996d('0x39')](_0x996d('0x76'),_0x697ed6[_0x996d('0x72')][_0x996d('0x74')]())[_0x996d('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x996d('0x74')]();}_0xd8f8d0=squel['insert']()[_0x996d('0x6a')](_0x996d('0x80'))[_0x996d('0x6c')](['cmHopperId',_0x996d('0x6e'),_0x996d('0x6d'),_0x996d('0x81'),_0x996d('0x50'),_0x996d('0x52')],squel['select']()[_0x996d('0x71')]('h.id','id')[_0x996d('0x71')](_0x996d('0x7d'),'scheduledAt')[_0x996d('0x71')](_0x996d('0x82'),_0x996d('0x6d'))[_0x996d('0x71')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x4f9fb7+'\x27','createdAt')[_0x996d('0x71')]('\x27'+_0x4f9fb7+'\x27','updatedAt')[_0x996d('0x7e')](_0x996d('0x83'),'ci')['join']('cm_hopper','h',_0x996d('0x84'))['where'](_0x996d('0x85'),_0x697ed6[_0x996d('0x72')][_0x996d('0x74')]())[_0x996d('0x39')](_0x996d('0x86'),_0x283aae[_0x996d('0x45')]['id']['toString']())[_0x996d('0x39')]('h.createdAt\x20=\x20?',_0x4f9fb7))['toString']();_0x292b3c[_0x996d('0x87')](db['sequelize'][_0x996d('0x2f')](_0x47b394));_0xd29d6e['push'](db[_0x996d('0x88')][_0x996d('0x2f')](_0xd8f8d0));}return BPromise[_0x996d('0x89')](_0x292b3c);}})['then'](function(){return BPromise[_0x996d('0x89')](_0xd29d6e);})[_0x996d('0x23')](function(){return _0x48dd4c;})['then'](respondWithResult(_0x37b411,null))['catch'](handleError(_0x37b411,null));};exports[_0x996d('0x8a')]=function(_0x2a193a,_0x4d5cdd,_0x405b0f){return db[_0x996d('0x2b')][_0x996d('0x46')]({'where':{'id':_0x2a193a[_0x996d('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d5cdd,null))[_0x996d('0x23')](function(_0x5144bb){if(_0x5144bb){return _0x5144bb[_0x996d('0x8a')](_0x2a193a[_0x996d('0x2f')][_0x996d('0x65')]);}})[_0x996d('0x23')](function(_0x53f50f){if(_0x53f50f){return db[_0x996d('0x5a')]['destroy']({'where':{'ListId':_0x2a193a[_0x996d('0x2f')]['ids'],'CampaignId':_0x2a193a[_0x996d('0x45')]['id']}})[_0x996d('0x23')](function(){return _0x53f50f;});}})[_0x996d('0x23')](respondWithStatusCode(_0x4d5cdd,null))['catch'](handleError(_0x4d5cdd,null));};exports[_0x996d('0x8b')]=function(_0x36230b,_0x16c2df,_0x523739){var _0x41c540={};var _0x330cf3={};var _0x52ac37;var _0x35923c;return db[_0x996d('0x2b')][_0x996d('0x57')]({'where':{'id':_0x36230b[_0x996d('0x45')]['id']}})['then'](handleEntityNotFound(_0x16c2df,null))[_0x996d('0x23')](function(_0xdaf65d){if(_0xdaf65d){_0x52ac37=_0xdaf65d;_0x330cf3[_0x996d('0x2e')]=_['keys'](db['CmList'][_0x996d('0x4f')]);_0x330cf3[_0x996d('0x2f')]=_[_0x996d('0x30')](_0x36230b[_0x996d('0x2f')]);_0x330cf3[_0x996d('0x31')]=_[_0x996d('0x32')](_0x330cf3[_0x996d('0x2e')],_0x330cf3['query']);_0x41c540['attributes']=_[_0x996d('0x32')](_0x330cf3['model'],qs[_0x996d('0x33')](_0x36230b['query']['fields']));_0x41c540[_0x996d('0x34')]=_0x41c540[_0x996d('0x34')][_0x996d('0x35')]?_0x41c540[_0x996d('0x34')]:_0x330cf3[_0x996d('0x2e')];_0x41c540[_0x996d('0x58')]=qs['sort'](_0x36230b[_0x996d('0x2f')][_0x996d('0x38')]);_0x41c540[_0x996d('0x39')]=qs[_0x996d('0x31')](_[_0x996d('0x5d')](_0x36230b[_0x996d('0x2f')],_0x330cf3[_0x996d('0x31')]));if(_0x36230b['query'][_0x996d('0x3a')]){_0x41c540['where']=_[_0x996d('0x3b')](_0x41c540['where'],{'$or':_[_0x996d('0x2a')](_0x41c540[_0x996d('0x34')],function(_0x344944){var _0x558851={};_0x558851[_0x344944]={'$like':'%'+_0x36230b[_0x996d('0x2f')]['filter']+'%'};return _0x558851;})});}_0x41c540=_[_0x996d('0x3b')]({},_0x41c540,_0x36230b[_0x996d('0x3e')]);return _0x52ac37[_0x996d('0x8b')](_0x41c540);}})[_0x996d('0x23')](function(_0x2a1718){if(_0x2a1718){_0x35923c=_0x2a1718[_0x996d('0x35')];if(!_0x36230b['query'][_0x996d('0x36')](_0x996d('0x37'))){_0x41c540['limit']=qs['limit'](_0x36230b[_0x996d('0x2f')][_0x996d('0x1e')]);_0x41c540[_0x996d('0x1c')]=qs[_0x996d('0x1c')](_0x36230b['query'][_0x996d('0x1c')]);}return _0x52ac37['getBlackLists'](_0x41c540);}})['then'](function(_0x4e3d2d){if(_0x4e3d2d){return _0x4e3d2d?{'count':_0x35923c,'rows':_0x4e3d2d}:null;}})['then'](respondWithResult(_0x16c2df,null))['catch'](handleError(_0x16c2df,null));};exports[_0x996d('0x8c')]=function(_0x582038,_0x33a860,_0xf44c5a){var _0x4f5854,_0x5f07d5;var _0x5689aa=[];var _0x3beb24=moment()[_0x996d('0x63')](_0x996d('0x8d'));return db['Campaign'][_0x996d('0x46')]({'where':{'id':_0x582038[_0x996d('0x45')]['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x33a860,null))['then'](function(_0x1ba7b5){if(_0x1ba7b5){_0x5f07d5=_0x1ba7b5;return _0x1ba7b5[_0x996d('0x8c')](_0x582038[_0x996d('0x48')]['ids'],_[_0x996d('0x51')](_0x582038[_0x996d('0x48')],['ids','id'])||{});}return null;})['spread'](function(_0x17dcc6){var _0x45f39e;var _0x3c08b3;_0x4f5854=_0x17dcc6||[];var _0x47239a=[];if(_0x17dcc6){for(var _0x301bb6=0x0;_0x301bb6<_0x17dcc6[_0x996d('0x35')];_0x301bb6+=0x1){var _0x2c3eef=_0x17dcc6[_0x301bb6][_0x996d('0x4a')]({'plain':!![]});_0x45f39e=squel[_0x996d('0x69')]()[_0x996d('0x6a')]('cm_hopper_black')[_0x996d('0x6c')]([_0x996d('0x6d'),_0x996d('0x6f'),'ListId',_0x996d('0x59'),'createdAt','updatedAt'],squel['select']()[_0x996d('0x71')]('phone',_0x996d('0x6d'))[_0x996d('0x71')]('id',_0x996d('0x6f'))[_0x996d('0x71')](_0x2c3eef[_0x996d('0x72')][_0x996d('0x74')](),_0x996d('0x73'))['field'](_0x582038[_0x996d('0x45')]['id'][_0x996d('0x74')](),_0x996d('0x59'))[_0x996d('0x71')](_0x996d('0x7d'),_0x996d('0x50'))[_0x996d('0x71')]('NOW()',_0x996d('0x52'))[_0x996d('0x7e')](_0x996d('0x7f'))[_0x996d('0x39')](_0x996d('0x75'))['where'](_0x996d('0x76'),_0x2c3eef[_0x996d('0x72')][_0x996d('0x74')]())[_0x996d('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x996d('0x74')]();_0x47239a[_0x996d('0x87')](db[_0x996d('0x88')][_0x996d('0x2f')](_0x45f39e));}return BPromise[_0x996d('0x89')](_0x47239a);}})[_0x996d('0x23')](function(){return _0x4f5854;})[_0x996d('0x23')](respondWithResult(_0x33a860,null))['catch'](handleError(_0x33a860,null));};exports['removeBlackLists']=function(_0x57b967,_0x57e2df,_0x5cbb04){return db[_0x996d('0x2b')][_0x996d('0x46')]({'where':{'id':_0x57b967['params']['id']}})[_0x996d('0x23')](handleEntityNotFound(_0x57e2df,null))['then'](function(_0x3db19f){if(_0x3db19f){return _0x3db19f[_0x996d('0x8e')](_0x57b967[_0x996d('0x2f')]['ids']);}})[_0x996d('0x23')](function(_0x10eb82){if(_0x10eb82){return db[_0x996d('0x61')][_0x996d('0x22')]({'where':{'ListId':_0x57b967[_0x996d('0x2f')][_0x996d('0x65')],'CampaignId':_0x57b967['params']['id']}})['then'](function(){return _0x10eb82;});}})[_0x996d('0x23')](respondWithStatusCode(_0x57e2df,null))['catch'](handleError(_0x57e2df,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 929a65e..cb7279b 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 2544e21..e397ad9 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 _0xb2b5=['request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','model','map','debug','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2b5,0xa3));var _0x5b2b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b2b('0x0'));var fs=require('fs');var Redis=require(_0x5b2b('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b2b('0x2'))(_0x5b2b('0x3'));var config=require(_0x5b2b('0x4'));var jayson=require(_0x5b2b('0x5'));var client=jayson['client'][_0x5b2b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x362524,_0x51a531,_0x54389e){return new BPromise(function(_0x1e08e6,_0x8e6e14){return client[_0x5b2b('0x7')](_0x362524,_0x54389e)[_0x5b2b('0x8')](function(_0x6cc9ab){logger[_0x5b2b('0x9')](_0x5b2b('0xa'),_0x51a531,_0x5b2b('0xb'));logger['debug'](_0x5b2b('0xc'),_0x51a531,_0x5b2b('0xb'),JSON['stringify'](_0x6cc9ab));if(_0x6cc9ab[_0x5b2b('0xd')]){if(_0x6cc9ab[_0x5b2b('0xd')]['code']===0x1f4){logger[_0x5b2b('0xd')](_0x5b2b('0xa'),_0x51a531,_0x6cc9ab[_0x5b2b('0xd')][_0x5b2b('0xe')]);return _0x8e6e14(_0x6cc9ab[_0x5b2b('0xd')][_0x5b2b('0xe')]);}logger[_0x5b2b('0xd')]('Campaign,\x20%s,\x20%s',_0x51a531,_0x6cc9ab[_0x5b2b('0xd')]['message']);return _0x1e08e6(_0x6cc9ab[_0x5b2b('0xd')][_0x5b2b('0xe')]);}else{logger[_0x5b2b('0x9')](_0x5b2b('0xa'),_0x51a531,'request\x20sent');_0x1e08e6(_0x6cc9ab[_0x5b2b('0xf')]['message']);}})[_0x5b2b('0x10')](function(_0x481d65){logger['error'](_0x5b2b('0xa'),_0x51a531,_0x481d65);_0x8e6e14(_0x481d65);});});}exports[_0x5b2b('0x11')]=function(_0x5b6645){var _0x13eaa1=this;return new Promise(function(_0x2db9ee,_0x3d6684){return db[_0x5b2b('0x12')][_0x5b2b('0x13')]({'raw':_0x5b6645['options']?_0x5b6645[_0x5b2b('0x14')][_0x5b2b('0x15')]===undefined?!![]:![]:!![],'where':_0x5b6645[_0x5b2b('0x14')]?_0x5b6645[_0x5b2b('0x14')][_0x5b2b('0x16')]||null:null,'attributes':_0x5b6645[_0x5b2b('0x14')]?_0x5b6645[_0x5b2b('0x14')][_0x5b2b('0x17')]||null:null,'limit':_0x5b6645[_0x5b2b('0x14')]?_0x5b6645[_0x5b2b('0x14')][_0x5b2b('0x18')]||null:null,'include':_0x5b6645[_0x5b2b('0x14')]?_0x5b6645[_0x5b2b('0x14')][_0x5b2b('0x19')]?_['map'](_0x5b6645['options'][_0x5b2b('0x19')],function(_0x58e346){return{'model':db[_0x58e346[_0x5b2b('0x1a')]],'as':_0x58e346['as'],'attributes':_0x58e346['attributes'],'include':_0x58e346[_0x5b2b('0x19')]?_[_0x5b2b('0x1b')](_0x58e346[_0x5b2b('0x19')],function(_0x37cbd8){return{'model':db[_0x37cbd8[_0x5b2b('0x1a')]],'as':_0x37cbd8['as'],'attributes':_0x37cbd8['attributes'],'include':_0x37cbd8[_0x5b2b('0x19')]?_[_0x5b2b('0x1b')](_0x37cbd8['include'],function(_0x3fd917){return{'model':db[_0x3fd917[_0x5b2b('0x1a')]],'as':_0x3fd917['as'],'attributes':_0x3fd917['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b2b('0x8')](function(_0x4469f8){logger[_0x5b2b('0x9')](_0x5b2b('0x11'),_0x5b6645);logger[_0x5b2b('0x1c')](_0x5b2b('0x11'),_0x5b6645,JSON['stringify'](_0x4469f8));_0x2db9ee(_0x4469f8);})[_0x5b2b('0x10')](function(_0x42b46c){logger[_0x5b2b('0xd')](_0x5b2b('0x11'),_0x42b46c[_0x5b2b('0xe')],_0x5b6645);_0x3d6684(_0x13eaa1['error'](0x1f4,_0x42b46c[_0x5b2b('0xe')]));});});}; \ No newline at end of file +var _0x5b05=['attributes','include','model','map','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','where'];(function(_0x20d8bc,_0x39f4c5){var _0x1a9a7e=function(_0x11358b){while(--_0x11358b){_0x20d8bc['push'](_0x20d8bc['shift']());}};_0x1a9a7e(++_0x39f4c5);}(_0x5b05,0x190));var _0x55b0=function(_0x3f473c,_0x423879){_0x3f473c=_0x3f473c-0x0;var _0x414b16=_0x5b05[_0x3f473c];return _0x414b16;};'use strict';var _=require('lodash');var util=require(_0x55b0('0x0'));var moment=require(_0x55b0('0x1'));var BPromise=require(_0x55b0('0x2'));var rs=require(_0x55b0('0x3'));var fs=require('fs');var Redis=require(_0x55b0('0x4'));var db=require(_0x55b0('0x5'))['db'];var utils=require(_0x55b0('0x6'));var logger=require(_0x55b0('0x7'))(_0x55b0('0x8'));var config=require(_0x55b0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0c407,_0x46c475,_0x355e20){return new BPromise(function(_0xdf375f,_0x598abf){return client[_0x55b0('0xb')](_0xe0c407,_0x355e20)[_0x55b0('0xc')](function(_0xc1d43){logger[_0x55b0('0xd')]('Campaign,\x20%s,\x20%s',_0x46c475,'request\x20sent');logger[_0x55b0('0xe')](_0x55b0('0xf'),_0x46c475,_0x55b0('0x10'),JSON[_0x55b0('0x11')](_0xc1d43));if(_0xc1d43[_0x55b0('0x12')]){if(_0xc1d43[_0x55b0('0x12')]['code']===0x1f4){logger[_0x55b0('0x12')](_0x55b0('0x13'),_0x46c475,_0xc1d43['error'][_0x55b0('0x14')]);return _0x598abf(_0xc1d43[_0x55b0('0x12')][_0x55b0('0x14')]);}logger[_0x55b0('0x12')]('Campaign,\x20%s,\x20%s',_0x46c475,_0xc1d43['error']['message']);return _0xdf375f(_0xc1d43[_0x55b0('0x12')]['message']);}else{logger[_0x55b0('0xd')](_0x55b0('0x13'),_0x46c475,'request\x20sent');_0xdf375f(_0xc1d43[_0x55b0('0x15')][_0x55b0('0x14')]);}})[_0x55b0('0x16')](function(_0x947f96){logger[_0x55b0('0x12')]('Campaign,\x20%s,\x20%s',_0x46c475,_0x947f96);_0x598abf(_0x947f96);});});}exports[_0x55b0('0x17')]=function(_0x20b1c5){var _0x4e7bf1=this;return new Promise(function(_0x5ca2ec,_0x5404cb){return db[_0x55b0('0x18')][_0x55b0('0x19')]({'raw':_0x20b1c5[_0x55b0('0x1a')]?_0x20b1c5['options'][_0x55b0('0x1b')]===undefined?!![]:![]:!![],'where':_0x20b1c5[_0x55b0('0x1a')]?_0x20b1c5[_0x55b0('0x1a')][_0x55b0('0x1c')]||null:null,'attributes':_0x20b1c5['options']?_0x20b1c5[_0x55b0('0x1a')][_0x55b0('0x1d')]||null:null,'limit':_0x20b1c5[_0x55b0('0x1a')]?_0x20b1c5[_0x55b0('0x1a')]['limit']||null:null,'include':_0x20b1c5[_0x55b0('0x1a')]?_0x20b1c5['options'][_0x55b0('0x1e')]?_['map'](_0x20b1c5[_0x55b0('0x1a')][_0x55b0('0x1e')],function(_0x1ea756){return{'model':db[_0x1ea756[_0x55b0('0x1f')]],'as':_0x1ea756['as'],'attributes':_0x1ea756[_0x55b0('0x1d')],'include':_0x1ea756[_0x55b0('0x1e')]?_[_0x55b0('0x20')](_0x1ea756['include'],function(_0x244092){return{'model':db[_0x244092['model']],'as':_0x244092['as'],'attributes':_0x244092[_0x55b0('0x1d')],'include':_0x244092[_0x55b0('0x1e')]?_[_0x55b0('0x20')](_0x244092['include'],function(_0x177bb8){return{'model':db[_0x177bb8['model']],'as':_0x177bb8['as'],'attributes':_0x177bb8[_0x55b0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x55b0('0xc')](function(_0x3842ff){logger[_0x55b0('0xd')](_0x55b0('0x17'),_0x20b1c5);logger[_0x55b0('0xe')](_0x55b0('0x17'),_0x20b1c5,JSON[_0x55b0('0x11')](_0x3842ff));_0x5ca2ec(_0x3842ff);})[_0x55b0('0x16')](function(_0x4273e0){logger[_0x55b0('0x12')](_0x55b0('0x17'),_0x4273e0[_0x55b0('0x14')],_0x20b1c5);_0x5404cb(_0x4e7bf1[_0x55b0('0x12')](0x1f4,_0x4273e0[_0x55b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5f03238..667715b 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 _0x2bd6=['addLists','/:id/blacklists','put','/:id','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','index','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','create','post','/:id/clone','clone'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x2bd6,0x1f4));var _0x62bd=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0x2bd6[_0x28669c];return _0x4a3af6;};'use strict';var multer=require(_0x62bd('0x0'));var util=require(_0x62bd('0x1'));var path=require(_0x62bd('0x2'));var timeout=require(_0x62bd('0x3'));var express=require(_0x62bd('0x4'));var router=express['Router']();var fs_extra=require(_0x62bd('0x5'));var auth=require(_0x62bd('0x6'));var interaction=require(_0x62bd('0x7'));var config=require('../../config/environment');var controller=require(_0x62bd('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x62bd('0x9')]);router[_0x62bd('0xa')]('/:id',auth[_0x62bd('0xb')](),controller[_0x62bd('0xc')]);router['get'](_0x62bd('0xd'),auth[_0x62bd('0xb')](),controller[_0x62bd('0xe')]);router[_0x62bd('0xa')](_0x62bd('0xf'),auth[_0x62bd('0xb')](),controller[_0x62bd('0x10')]);router[_0x62bd('0xa')](_0x62bd('0x11'),auth[_0x62bd('0xb')](),controller['getHopperFinals']);router['get'](_0x62bd('0x12'),auth[_0x62bd('0xb')](),controller[_0x62bd('0x13')]);router[_0x62bd('0xa')](_0x62bd('0x14'),auth[_0x62bd('0xb')](),controller['getLists']);router[_0x62bd('0xa')]('/:id/blacklists',auth[_0x62bd('0xb')](),controller['getBlackLists']);router['post']('/',auth[_0x62bd('0xb')](),controller[_0x62bd('0x15')]);router[_0x62bd('0x16')](_0x62bd('0x17'),auth[_0x62bd('0xb')](),controller[_0x62bd('0x18')]);router[_0x62bd('0x16')](_0x62bd('0x14'),auth['isAuthenticated'](),controller[_0x62bd('0x19')]);router[_0x62bd('0x16')](_0x62bd('0x1a'),auth[_0x62bd('0xb')](),controller['addBlackLists']);router[_0x62bd('0x1b')](_0x62bd('0x1c'),auth[_0x62bd('0xb')](),controller[_0x62bd('0x1d')]);router['delete'](_0x62bd('0x1c'),auth[_0x62bd('0xb')](),controller[_0x62bd('0x1e')]);router[_0x62bd('0x1f')]('/:id/lists',auth[_0x62bd('0xb')](),controller[_0x62bd('0x20')]);router[_0x62bd('0x1f')](_0x62bd('0x1a'),auth['isAuthenticated'](),controller[_0x62bd('0x21')]);module[_0x62bd('0x22')]=router; \ No newline at end of file +var _0xbd6a=['removeBlackLists','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','/:id','get','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','create','clone','post','addLists','put','update','destroy','delete','removeLists'];(function(_0x614ef4,_0x28a060){var _0x35e8e2=function(_0x55e81b){while(--_0x55e81b){_0x614ef4['push'](_0x614ef4['shift']());}};_0x35e8e2(++_0x28a060);}(_0xbd6a,0x140));var _0xabd6=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xbd6a[_0x39096d];return _0x13da4f;};'use strict';var multer=require('multer');var util=require(_0xabd6('0x0'));var path=require(_0xabd6('0x1'));var timeout=require('connect-timeout');var express=require(_0xabd6('0x2'));var router=express[_0xabd6('0x3')]();var fs_extra=require(_0xabd6('0x4'));var auth=require(_0xabd6('0x5'));var interaction=require(_0xabd6('0x6'));var config=require('../../config/environment');var controller=require(_0xabd6('0x7'));router['get']('/',auth[_0xabd6('0x8')](),controller[_0xabd6('0x9')]);router['get'](_0xabd6('0xa'),auth[_0xabd6('0x8')](),controller['show']);router[_0xabd6('0xb')]('/:id/hoppers',auth[_0xabd6('0x8')](),controller[_0xabd6('0xc')]);router[_0xabd6('0xb')]('/:id/hopper_histories',auth[_0xabd6('0x8')](),controller['getHopperHistories']);router[_0xabd6('0xb')](_0xabd6('0xd'),auth[_0xabd6('0x8')](),controller[_0xabd6('0xe')]);router[_0xabd6('0xb')](_0xabd6('0xf'),auth[_0xabd6('0x8')](),controller['getHopperBlacks']);router['get'](_0xabd6('0x10'),auth[_0xabd6('0x8')](),controller['getLists']);router['get'](_0xabd6('0x11'),auth[_0xabd6('0x8')](),controller[_0xabd6('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xabd6('0x13')]);router['post']('/:id/clone',auth[_0xabd6('0x8')](),controller[_0xabd6('0x14')]);router[_0xabd6('0x15')]('/:id/lists',auth[_0xabd6('0x8')](),controller[_0xabd6('0x16')]);router[_0xabd6('0x15')](_0xabd6('0x11'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xabd6('0x17')](_0xabd6('0xa'),auth[_0xabd6('0x8')](),controller[_0xabd6('0x18')]);router['delete'](_0xabd6('0xa'),auth['isAuthenticated'](),controller[_0xabd6('0x19')]);router[_0xabd6('0x1a')](_0xabd6('0x10'),auth['isAuthenticated'](),controller[_0xabd6('0x1b')]);router[_0xabd6('0x1a')](_0xabd6('0x11'),auth[_0xabd6('0x8')](),controller[_0xabd6('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index afe3f22..1a07740 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 _0x2aea=['STRING','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2aea,0xd7));var _0xa2ae=function(_0x502953,_0x28de83){_0x502953=_0x502953-0x0;var _0x2fa32d=_0x2aea[_0x502953];return _0x2fa32d;};'use strict';var Sequelize=require(_0xa2ae('0x0'));module[_0xa2ae('0x1')]={'key':{'type':Sequelize[_0xa2ae('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xa2ae('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa2ae('0x4')],'get':function(){return this[_0xa2ae('0x5')](_0xa2ae('0x6'));}}}; \ No newline at end of file +var _0xbb57=['key','exports','STRING','TEXT','medium','getDataValue'];(function(_0x55163d,_0x31632e){var _0x2ee0d2=function(_0x285b66){while(--_0x285b66){_0x55163d['push'](_0x55163d['shift']());}};_0x2ee0d2(++_0x31632e);}(_0xbb57,0x16f));var _0x7bb5=function(_0x5c358c,_0x435f1c){_0x5c358c=_0x5c358c-0x0;var _0x2495db=_0xbb57[_0x5c358c];return _0x2495db;};'use strict';var Sequelize=require('sequelize');module[_0x7bb5('0x0')]={'key':{'type':Sequelize[_0x7bb5('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x7bb5('0x2')],'length':_0x7bb5('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7bb5('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7bb5('0x4')](_0x7bb5('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 9d29fc6..b873fdf 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 _0x9436=['Content-Range','apply','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','send','map','CannedAnswer','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','get','role','userProfileId','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0x3f4079,_0x36dc18){var _0xe11281=function(_0x82d4ef){while(--_0x82d4ef){_0x3f4079['push'](_0x3f4079['shift']());}};_0xe11281(++_0x36dc18);}(_0x9436,0x128));var _0x6943=function(_0xf299a5,_0x7d8487){_0xf299a5=_0xf299a5-0x0;var _0x2ffc02=_0x9436[_0xf299a5];return _0x2ffc02;};'use strict';var emlformat=require(_0x6943('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6943('0x1'));var moment=require('moment');var BPromise=require(_0x6943('0x2'));var Mustache=require(_0x6943('0x3'));var util=require(_0x6943('0x4'));var path=require(_0x6943('0x5'));var sox=require(_0x6943('0x6'));var csv=require(_0x6943('0x7'));var ejs=require(_0x6943('0x8'));var fs=require('fs');var fs_extra=require(_0x6943('0x9'));var _=require(_0x6943('0xa'));var squel=require(_0x6943('0xb'));var crypto=require(_0x6943('0xc'));var jsforce=require(_0x6943('0xd'));var deskjs=require(_0x6943('0xe'));var toCsv=require(_0x6943('0x7'));var querystring=require('querystring');var Papa=require(_0x6943('0xf'));var Redis=require(_0x6943('0x10'));var authService=require(_0x6943('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6943('0x12'));var hardwareService=require(_0x6943('0x13'));var logger=require(_0x6943('0x14'))('api');var utils=require(_0x6943('0x15'));var config=require(_0x6943('0x16'));var licenseUtil=require(_0x6943('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c4c38,_0x5072bc){_0x5072bc=_0x5072bc||0xcc;return function(_0x59ff90){if(_0x59ff90){return _0x4c4c38[_0x6943('0x18')](_0x5072bc);}return _0x4c4c38['status'](_0x5072bc)[_0x6943('0x19')]();};}function respondWithResult(_0x416469,_0x41e22a){_0x41e22a=_0x41e22a||0xc8;return function(_0x340cd5){if(_0x340cd5){return _0x416469['status'](_0x41e22a)[_0x6943('0x1a')](_0x340cd5);}};}function respondWithFilteredResult(_0x24ca16,_0x34823d){return function(_0x340910){if(_0x340910){var _0x4016f0=typeof _0x34823d[_0x6943('0x1b')]===_0x6943('0x1c')&&typeof _0x34823d[_0x6943('0x1d')]==='undefined';var _0x21f315=_0x340910[_0x6943('0x1e')];var _0xb9628d=_0x4016f0?0x0:_0x34823d[_0x6943('0x1b')];var _0x36e8c1=_0x4016f0?_0x340910['count']:_0x34823d[_0x6943('0x1b')]+_0x34823d[_0x6943('0x1d')];var _0x3c2618;if(_0x36e8c1>=_0x21f315){_0x36e8c1=_0x21f315;_0x3c2618=0xc8;}else{_0x3c2618=0xce;}_0x24ca16[_0x6943('0x1f')](_0x3c2618);return _0x24ca16['set'](_0x6943('0x20'),_0xb9628d+'-'+_0x36e8c1+'/'+_0x21f315)[_0x6943('0x1a')](_0x340910);}return null;};}function patchUpdates(_0x576ef0){return function(_0x414a70){try{jsonpatch[_0x6943('0x21')](_0x414a70,_0x576ef0,!![]);}catch(_0x51d843){return BPromise['reject'](_0x51d843);}return _0x414a70['save']();};}function saveUpdates(_0x18e3cf,_0x1b155d){return function(_0x36c319){if(_0x36c319){return _0x36c319[_0x6943('0x22')](_0x18e3cf)[_0x6943('0x23')](function(_0x5cd0d6){return _0x5cd0d6;});}return null;};}function removeEntity(_0xb3e991,_0x10b517){return function(_0x17bd99){if(_0x17bd99){return _0x17bd99[_0x6943('0x24')]()[_0x6943('0x23')](function(){var _0x38621d=_0x17bd99['get']({'plain':!![]});var _0x475489=_0x6943('0x25');return db[_0x6943('0x26')][_0x6943('0x24')]({'where':{'type':_0x475489,'resourceId':_0x38621d['id']}})[_0x6943('0x23')](function(){return _0x17bd99;});})['then'](function(){_0xb3e991['status'](0xcc)[_0x6943('0x19')]();});}};}function handleEntityNotFound(_0x10018b,_0x32d2e8){return function(_0x8c0610){if(!_0x8c0610){_0x10018b['sendStatus'](0x194);}return _0x8c0610;};}function handleError(_0x16e162,_0x585b47){_0x585b47=_0x585b47||0x1f4;return function(_0x124065){logger[_0x6943('0x27')](_0x124065[_0x6943('0x28')]);if(_0x124065[_0x6943('0x29')]){delete _0x124065[_0x6943('0x29')];}_0x16e162[_0x6943('0x1f')](_0x585b47)[_0x6943('0x2a')](_0x124065);};}exports['index']=function(_0x20e724,_0x242d92){var _0x8df340={},_0x3cdccd={},_0x17c486={'count':0x0,'rows':[]};var _0x40f499=_[_0x6943('0x2b')](db[_0x6943('0x2c')]['rawAttributes'],function(_0x384b8d){return{'name':_0x384b8d[_0x6943('0x2d')],'type':_0x384b8d['type'][_0x6943('0x2e')]};});_0x3cdccd[_0x6943('0x2f')]=_[_0x6943('0x2b')](_0x40f499,'name');_0x3cdccd['query']=_[_0x6943('0x30')](_0x20e724[_0x6943('0x31')]);_0x3cdccd[_0x6943('0x32')]=_[_0x6943('0x33')](_0x3cdccd[_0x6943('0x2f')],_0x3cdccd['query']);_0x8df340[_0x6943('0x34')]=_[_0x6943('0x33')](_0x3cdccd[_0x6943('0x2f')],qs[_0x6943('0x35')](_0x20e724[_0x6943('0x31')]['fields']));_0x8df340[_0x6943('0x34')]=_0x8df340[_0x6943('0x34')][_0x6943('0x36')]?_0x8df340[_0x6943('0x34')]:_0x3cdccd[_0x6943('0x2f')];if(!_0x20e724[_0x6943('0x31')][_0x6943('0x37')](_0x6943('0x38'))){_0x8df340[_0x6943('0x1d')]=qs[_0x6943('0x1d')](_0x20e724['query'][_0x6943('0x1d')]);_0x8df340[_0x6943('0x1b')]=qs['offset'](_0x20e724[_0x6943('0x31')][_0x6943('0x1b')]);}_0x8df340[_0x6943('0x39')]=qs[_0x6943('0x3a')](_0x20e724[_0x6943('0x31')][_0x6943('0x3a')]);_0x8df340['where']=qs[_0x6943('0x32')](_[_0x6943('0x3b')](_0x20e724[_0x6943('0x31')],_0x3cdccd['filters']),_0x40f499);if(_0x20e724['query'][_0x6943('0x3c')]){_0x8df340[_0x6943('0x3d')]=_['merge'](_0x8df340['where'],{'$or':[{'key':{'$like':'%'+_0x20e724[_0x6943('0x31')][_0x6943('0x3c')]+'%'}},{'value':{'$like':'%'+_0x20e724[_0x6943('0x31')]['filter']+'%'}}]});}_0x8df340=_[_0x6943('0x3e')]({},_0x8df340,_0x20e724[_0x6943('0x3f')]);var _0x5580c1={'where':_0x8df340[_0x6943('0x3d')]};return db[_0x6943('0x2c')][_0x6943('0x1e')](_0x5580c1)[_0x6943('0x23')](function(_0x52e169){_0x17c486[_0x6943('0x1e')]=_0x52e169;if(_0x20e724[_0x6943('0x31')][_0x6943('0x40')]){_0x8df340[_0x6943('0x41')]=[{'all':!![]}];}return db[_0x6943('0x2c')][_0x6943('0x42')](_0x8df340);})[_0x6943('0x23')](function(_0x5a8a89){_0x17c486[_0x6943('0x43')]=_0x5a8a89;return _0x17c486;})[_0x6943('0x23')](respondWithFilteredResult(_0x242d92,_0x8df340))[_0x6943('0x44')](handleError(_0x242d92,null));};exports['show']=function(_0x28212b,_0x58bd1c){var _0xc9bc06={'raw':!![],'where':{'id':_0x28212b[_0x6943('0x45')]['id']}},_0x1b202a={};_0x1b202a[_0x6943('0x2f')]=_[_0x6943('0x30')](db[_0x6943('0x2c')]['rawAttributes']);_0x1b202a['query']=_[_0x6943('0x30')](_0x28212b['query']);_0x1b202a[_0x6943('0x32')]=_[_0x6943('0x33')](_0x1b202a['model'],_0x1b202a['query']);_0xc9bc06[_0x6943('0x34')]=_[_0x6943('0x33')](_0x1b202a[_0x6943('0x2f')],qs[_0x6943('0x35')](_0x28212b[_0x6943('0x31')]['fields']));_0xc9bc06[_0x6943('0x34')]=_0xc9bc06[_0x6943('0x34')][_0x6943('0x36')]?_0xc9bc06['attributes']:_0x1b202a[_0x6943('0x2f')];if(_0x28212b[_0x6943('0x31')][_0x6943('0x40')]){_0xc9bc06[_0x6943('0x41')]=[{'all':!![]}];}_0xc9bc06=_[_0x6943('0x3e')]({},_0xc9bc06,_0x28212b['options']);return db[_0x6943('0x2c')]['find'](_0xc9bc06)[_0x6943('0x23')](handleEntityNotFound(_0x58bd1c,null))[_0x6943('0x23')](respondWithResult(_0x58bd1c,null))[_0x6943('0x44')](handleError(_0x58bd1c,null));};exports[_0x6943('0x22')]=function(_0x12ec13,_0x5ad7c6){if(_0x12ec13[_0x6943('0x46')]['id']){delete _0x12ec13[_0x6943('0x46')]['id'];}return db['CannedAnswer'][_0x6943('0x47')]({'where':{'id':_0x12ec13[_0x6943('0x45')]['id']}})[_0x6943('0x23')](handleEntityNotFound(_0x5ad7c6,null))[_0x6943('0x23')](saveUpdates(_0x12ec13[_0x6943('0x46')],null))[_0x6943('0x23')](respondWithResult(_0x5ad7c6,null))[_0x6943('0x44')](handleError(_0x5ad7c6,null));};exports[_0x6943('0x24')]=function(_0x11581a,_0x15a72b){return db[_0x6943('0x2c')][_0x6943('0x47')]({'where':{'id':_0x11581a[_0x6943('0x45')]['id']}})[_0x6943('0x23')](handleEntityNotFound(_0x15a72b,null))[_0x6943('0x23')](removeEntity(_0x15a72b,null))['catch'](handleError(_0x15a72b,null));};exports[_0x6943('0x48')]=function(_0x290918,_0x58b743){var _0x3bb066={'key':_0x290918[_0x6943('0x46')][_0x6943('0x2e')]};if(_0x290918[_0x6943('0x46')][_0x6943('0x49')]){_0x3bb066[_0x6943('0x49')]=_0x290918[_0x6943('0x46')][_0x6943('0x49')];}else if(_0x290918['body'][_0x6943('0x4a')]){_0x3bb066[_0x6943('0x4a')]=_0x290918[_0x6943('0x46')][_0x6943('0x4a')];}else if(_0x290918[_0x6943('0x46')][_0x6943('0x4b')]){_0x3bb066[_0x6943('0x4b')]=_0x290918['body']['OpenchannelAccountId'];}else if(_0x290918[_0x6943('0x46')]['ChatWebsiteId']){_0x3bb066[_0x6943('0x4c')]=_0x290918[_0x6943('0x46')]['ChatWebsiteId'];}return db['CannedAnswer'][_0x6943('0x47')]({'where':_0x3bb066})[_0x6943('0x23')](function(_0x5d9cdc){if(_0x5d9cdc){throw new db[(_0x6943('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x6943('0x2c')][_0x6943('0x48')](_0x290918['body']);})[_0x6943('0x23')](function(_0x2303d1){var _0x393cd3=_0x290918[_0x6943('0x4e')][_0x6943('0x4f')]({'plain':!![]});if(!_0x393cd3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x393cd3[_0x6943('0x50')]===_0x6943('0x4e')){var _0x2d408b=_0x2303d1['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x393cd3[_0x6943('0x51')]},'raw':!![]})[_0x6943('0x23')](function(_0x2cbd3c){if(_0x2cbd3c&&_0x2cbd3c['autoAssociation']===0x0){return db[_0x6943('0x26')][_0x6943('0x48')]({'name':_0x2d408b[_0x6943('0x29')],'resourceId':_0x2d408b['id'],'type':_0x2cbd3c[_0x6943('0x29')],'sectionId':_0x2cbd3c['id']},{})['then'](function(){return _0x2303d1;});}else{return _0x2303d1;}})[_0x6943('0x44')](function(_0x8f5b80){logger[_0x6943('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x8f5b80);throw _0x8f5b80;});}return _0x2303d1;})[_0x6943('0x23')](respondWithResult(_0x58b743,0xc9))[_0x6943('0x44')](handleError(_0x58b743,null));}; \ No newline at end of file +var _0x8818=['body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','findAll','catch','show','params','include','find','update'];(function(_0x114281,_0x23c3f2){var _0x866964=function(_0x43c0f3){while(--_0x43c0f3){_0x114281['push'](_0x114281['shift']());}};_0x866964(++_0x23c3f2);}(_0x8818,0x67));var _0x8881=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x8818[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x8881('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8881('0x1'));var jsonpatch=require(_0x8881('0x2'));var rp=require(_0x8881('0x3'));var moment=require(_0x8881('0x4'));var BPromise=require(_0x8881('0x5'));var Mustache=require(_0x8881('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8881('0x7'));var csv=require(_0x8881('0x8'));var ejs=require(_0x8881('0x9'));var fs=require('fs');var fs_extra=require(_0x8881('0xa'));var _=require(_0x8881('0xb'));var squel=require('squel');var crypto=require(_0x8881('0xc'));var jsforce=require(_0x8881('0xd'));var deskjs=require(_0x8881('0xe'));var toCsv=require(_0x8881('0x8'));var querystring=require(_0x8881('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8881('0x10'));var qs=require(_0x8881('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8881('0x12'));var logger=require(_0x8881('0x13'))(_0x8881('0x14'));var utils=require(_0x8881('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8881('0x16'));var db=require(_0x8881('0x17'))['db'];function respondWithStatusCode(_0x150e0,_0x42c53d){_0x42c53d=_0x42c53d||0xcc;return function(_0x50f4a6){if(_0x50f4a6){return _0x150e0[_0x8881('0x18')](_0x42c53d);}return _0x150e0[_0x8881('0x19')](_0x42c53d)['end']();};}function respondWithResult(_0x4aea32,_0x47329f){_0x47329f=_0x47329f||0xc8;return function(_0x273977){if(_0x273977){return _0x4aea32[_0x8881('0x19')](_0x47329f)[_0x8881('0x1a')](_0x273977);}};}function respondWithFilteredResult(_0x19867d,_0x225977){return function(_0x53003b){if(_0x53003b){var _0x1f6497=typeof _0x225977[_0x8881('0x1b')]===_0x8881('0x1c')&&typeof _0x225977['limit']==='undefined';var _0x172281=_0x53003b[_0x8881('0x1d')];var _0x12af88=_0x1f6497?0x0:_0x225977[_0x8881('0x1b')];var _0x16b09f=_0x1f6497?_0x53003b[_0x8881('0x1d')]:_0x225977[_0x8881('0x1b')]+_0x225977[_0x8881('0x1e')];var _0x175d53;if(_0x16b09f>=_0x172281){_0x16b09f=_0x172281;_0x175d53=0xc8;}else{_0x175d53=0xce;}_0x19867d['status'](_0x175d53);return _0x19867d[_0x8881('0x1f')](_0x8881('0x20'),_0x12af88+'-'+_0x16b09f+'/'+_0x172281)[_0x8881('0x1a')](_0x53003b);}return null;};}function patchUpdates(_0x5401f8){return function(_0x2b9966){try{jsonpatch['apply'](_0x2b9966,_0x5401f8,!![]);}catch(_0xe17842){return BPromise[_0x8881('0x21')](_0xe17842);}return _0x2b9966[_0x8881('0x22')]();};}function saveUpdates(_0xb554f0,_0x35dd29){return function(_0x35ad00){if(_0x35ad00){return _0x35ad00['update'](_0xb554f0)[_0x8881('0x23')](function(_0x57b47f){return _0x57b47f;});}return null;};}function removeEntity(_0x19c931,_0x5a3844){return function(_0x463827){if(_0x463827){return _0x463827[_0x8881('0x24')]()[_0x8881('0x23')](function(){var _0x417747=_0x463827[_0x8881('0x25')]({'plain':!![]});var _0x18a320=_0x8881('0x26');return db[_0x8881('0x27')]['destroy']({'where':{'type':_0x18a320,'resourceId':_0x417747['id']}})['then'](function(){return _0x463827;});})[_0x8881('0x23')](function(){_0x19c931[_0x8881('0x19')](0xcc)[_0x8881('0x28')]();});}};}function handleEntityNotFound(_0x43405e,_0xb2d75a){return function(_0x1a8786){if(!_0x1a8786){_0x43405e[_0x8881('0x18')](0x194);}return _0x1a8786;};}function handleError(_0x50c5e5,_0x5a374f){_0x5a374f=_0x5a374f||0x1f4;return function(_0x29bfdd){logger[_0x8881('0x29')](_0x29bfdd[_0x8881('0x2a')]);if(_0x29bfdd['name']){delete _0x29bfdd[_0x8881('0x2b')];}_0x50c5e5[_0x8881('0x19')](_0x5a374f)[_0x8881('0x2c')](_0x29bfdd);};}exports[_0x8881('0x2d')]=function(_0x3afe85,_0x3a1e71){var _0x107d39={},_0x437fe4={},_0x3a1347={'count':0x0,'rows':[]};var _0x4ca987=_[_0x8881('0x2e')](db[_0x8881('0x2f')][_0x8881('0x30')],function(_0xa4b2f9){return{'name':_0xa4b2f9[_0x8881('0x31')],'type':_0xa4b2f9[_0x8881('0x32')][_0x8881('0x33')]};});_0x437fe4['model']=_[_0x8881('0x2e')](_0x4ca987,'name');_0x437fe4['query']=_[_0x8881('0x34')](_0x3afe85[_0x8881('0x35')]);_0x437fe4[_0x8881('0x36')]=_[_0x8881('0x37')](_0x437fe4[_0x8881('0x38')],_0x437fe4[_0x8881('0x35')]);_0x107d39[_0x8881('0x39')]=_['intersection'](_0x437fe4[_0x8881('0x38')],qs[_0x8881('0x3a')](_0x3afe85[_0x8881('0x35')][_0x8881('0x3a')]));_0x107d39[_0x8881('0x39')]=_0x107d39[_0x8881('0x39')][_0x8881('0x3b')]?_0x107d39['attributes']:_0x437fe4[_0x8881('0x38')];if(!_0x3afe85[_0x8881('0x35')][_0x8881('0x3c')](_0x8881('0x3d'))){_0x107d39['limit']=qs['limit'](_0x3afe85[_0x8881('0x35')][_0x8881('0x1e')]);_0x107d39[_0x8881('0x1b')]=qs['offset'](_0x3afe85[_0x8881('0x35')][_0x8881('0x1b')]);}_0x107d39[_0x8881('0x3e')]=qs[_0x8881('0x3f')](_0x3afe85['query'][_0x8881('0x3f')]);_0x107d39[_0x8881('0x40')]=qs[_0x8881('0x36')](_[_0x8881('0x41')](_0x3afe85[_0x8881('0x35')],_0x437fe4['filters']),_0x4ca987);if(_0x3afe85[_0x8881('0x35')][_0x8881('0x42')]){_0x107d39[_0x8881('0x40')]=_[_0x8881('0x43')](_0x107d39[_0x8881('0x40')],{'$or':[{'key':{'$like':'%'+_0x3afe85[_0x8881('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x3afe85[_0x8881('0x35')][_0x8881('0x42')]+'%'}}]});}_0x107d39=_[_0x8881('0x43')]({},_0x107d39,_0x3afe85['options']);var _0x2ff4ea={'where':_0x107d39[_0x8881('0x40')]};return db['CannedAnswer'][_0x8881('0x1d')](_0x2ff4ea)[_0x8881('0x23')](function(_0x598fa3){_0x3a1347[_0x8881('0x1d')]=_0x598fa3;if(_0x3afe85[_0x8881('0x35')]['includeAll']){_0x107d39['include']=[{'all':!![]}];}return db[_0x8881('0x2f')][_0x8881('0x44')](_0x107d39);})[_0x8881('0x23')](function(_0x38430f){_0x3a1347['rows']=_0x38430f;return _0x3a1347;})['then'](respondWithFilteredResult(_0x3a1e71,_0x107d39))[_0x8881('0x45')](handleError(_0x3a1e71,null));};exports[_0x8881('0x46')]=function(_0xadb2bf,_0x3bb9fe){var _0xc0b5ec={'raw':!![],'where':{'id':_0xadb2bf[_0x8881('0x47')]['id']}},_0x4a8e52={};_0x4a8e52['model']=_[_0x8881('0x34')](db[_0x8881('0x2f')]['rawAttributes']);_0x4a8e52['query']=_[_0x8881('0x34')](_0xadb2bf[_0x8881('0x35')]);_0x4a8e52[_0x8881('0x36')]=_['intersection'](_0x4a8e52[_0x8881('0x38')],_0x4a8e52[_0x8881('0x35')]);_0xc0b5ec[_0x8881('0x39')]=_['intersection'](_0x4a8e52['model'],qs['fields'](_0xadb2bf[_0x8881('0x35')][_0x8881('0x3a')]));_0xc0b5ec[_0x8881('0x39')]=_0xc0b5ec[_0x8881('0x39')]['length']?_0xc0b5ec[_0x8881('0x39')]:_0x4a8e52[_0x8881('0x38')];if(_0xadb2bf['query']['includeAll']){_0xc0b5ec[_0x8881('0x48')]=[{'all':!![]}];}_0xc0b5ec=_[_0x8881('0x43')]({},_0xc0b5ec,_0xadb2bf['options']);return db[_0x8881('0x2f')][_0x8881('0x49')](_0xc0b5ec)[_0x8881('0x23')](handleEntityNotFound(_0x3bb9fe,null))[_0x8881('0x23')](respondWithResult(_0x3bb9fe,null))[_0x8881('0x45')](handleError(_0x3bb9fe,null));};exports[_0x8881('0x4a')]=function(_0x1e460d,_0x3c368a){if(_0x1e460d[_0x8881('0x4b')]['id']){delete _0x1e460d[_0x8881('0x4b')]['id'];}return db[_0x8881('0x2f')][_0x8881('0x49')]({'where':{'id':_0x1e460d[_0x8881('0x47')]['id']}})[_0x8881('0x23')](handleEntityNotFound(_0x3c368a,null))[_0x8881('0x23')](saveUpdates(_0x1e460d[_0x8881('0x4b')],null))[_0x8881('0x23')](respondWithResult(_0x3c368a,null))['catch'](handleError(_0x3c368a,null));};exports['destroy']=function(_0x1cbc91,_0xa39339){return db[_0x8881('0x2f')][_0x8881('0x49')]({'where':{'id':_0x1cbc91[_0x8881('0x47')]['id']}})[_0x8881('0x23')](handleEntityNotFound(_0xa39339,null))[_0x8881('0x23')](removeEntity(_0xa39339,null))[_0x8881('0x45')](handleError(_0xa39339,null));};exports[_0x8881('0x4c')]=function(_0x4d7d82,_0x207b45){var _0x46fa39={'key':_0x4d7d82[_0x8881('0x4b')][_0x8881('0x33')]};if(_0x4d7d82[_0x8881('0x4b')][_0x8881('0x4d')]){_0x46fa39['MailAccountId']=_0x4d7d82['body'][_0x8881('0x4d')];}else if(_0x4d7d82[_0x8881('0x4b')]['SmsAccountId']){_0x46fa39[_0x8881('0x4e')]=_0x4d7d82[_0x8881('0x4b')][_0x8881('0x4e')];}else if(_0x4d7d82[_0x8881('0x4b')][_0x8881('0x4f')]){_0x46fa39[_0x8881('0x4f')]=_0x4d7d82['body'][_0x8881('0x4f')];}else if(_0x4d7d82['body'][_0x8881('0x50')]){_0x46fa39[_0x8881('0x50')]=_0x4d7d82[_0x8881('0x4b')][_0x8881('0x50')];}return db[_0x8881('0x2f')][_0x8881('0x49')]({'where':_0x46fa39})[_0x8881('0x23')](function(_0x29f077){if(_0x29f077){throw new db['Sequelize']['ValidationError'](_0x8881('0x51'));}return db[_0x8881('0x2f')][_0x8881('0x4c')](_0x4d7d82[_0x8881('0x4b')]);})[_0x8881('0x23')](function(_0x1761b5){var _0x32f3a4=_0x4d7d82[_0x8881('0x52')][_0x8881('0x25')]({'plain':!![]});if(!_0x32f3a4)throw new Error(_0x8881('0x53'));if(_0x32f3a4[_0x8881('0x54')]===_0x8881('0x52')){var _0xeb2bf7=_0x1761b5[_0x8881('0x25')]({'plain':!![]});return db[_0x8881('0x55')][_0x8881('0x49')]({'where':{'name':_0x8881('0x26'),'userProfileId':_0x32f3a4[_0x8881('0x56')]},'raw':!![]})[_0x8881('0x23')](function(_0x15893d){if(_0x15893d&&_0x15893d[_0x8881('0x57')]===0x0){return db[_0x8881('0x27')][_0x8881('0x4c')]({'name':_0xeb2bf7[_0x8881('0x2b')],'resourceId':_0xeb2bf7['id'],'type':_0x15893d['name'],'sectionId':_0x15893d['id']},{})['then'](function(){return _0x1761b5;});}else{return _0x1761b5;}})[_0x8881('0x45')](function(_0x476a3c){logger[_0x8881('0x29')](_0x8881('0x58'),_0x476a3c);throw _0x476a3c;});}return _0x1761b5;})[_0x8881('0x23')](respondWithResult(_0x207b45,0xc9))['catch'](handleError(_0x207b45,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f8b64da..53538bf 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 _0xfe24=['rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird'];(function(_0xc0b920,_0x23a834){var _0x141c99=function(_0x225da9){while(--_0x225da9){_0xc0b920['push'](_0xc0b920['shift']());}};_0x141c99(++_0x23a834);}(_0xfe24,0x96));var _0x4fe2=function(_0x423751,_0x5a236e){_0x423751=_0x423751-0x0;var _0xdbcbb=_0xfe24[_0x423751];return _0xdbcbb;};'use strict';var _=require(_0x4fe2('0x0'));var util=require(_0x4fe2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4fe2('0x2'));var BPromise=require(_0x4fe2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4fe2('0x4'));var config=require(_0x4fe2('0x5'));var attributes=require(_0x4fe2('0x6'));module['exports']=function(_0x4cc058,_0x55eeed){return _0x4cc058[_0x4fe2('0x7')](_0x4fe2('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fe2('0x9'),'collate':_0x4fe2('0xa')});}; \ No newline at end of file +var _0x5dda=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x28fc1a,_0x100a66){var _0x3bec00=function(_0x3580ec){while(--_0x3580ec){_0x28fc1a['push'](_0x28fc1a['shift']());}};_0x3bec00(++_0x100a66);}(_0x5dda,0xed));var _0xa5dd=function(_0x4bcdb3,_0x2ed477){_0x4bcdb3=_0x4bcdb3-0x0;var _0x2839a8=_0x5dda[_0x4bcdb3];return _0x2839a8;};'use strict';var _=require(_0xa5dd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa5dd('0x1'));var moment=require(_0xa5dd('0x2'));var BPromise=require(_0xa5dd('0x3'));var rp=require(_0xa5dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa5dd('0x5'));var config=require(_0xa5dd('0x6'));var attributes=require(_0xa5dd('0x7'));module[_0xa5dd('0x8')]=function(_0x5c4d56,_0x30b474){return _0x5c4d56[_0xa5dd('0x9')](_0xa5dd('0xa'),attributes,{'tableName':_0xa5dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa5dd('0xc'),'collate':_0xa5dd('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c88060f..6e465ce 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(_0x19725f,_0x432ada){var _0x3818e9=function(_0x4669a2){while(--_0x4669a2){_0x19725f['push'](_0x19725f['shift']());}};_0x3818e9(++_0x432ada);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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(_0x91468e,_0x5e4a8d){var _0x376e01=function(_0x7f0876){while(--_0x7f0876){_0x91468e['push'](_0x91468e['shift']());}};_0x376e01(++_0x5e4a8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index db49de7..db2c60e 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 _0x7a86=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','update'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a86,0x88));var _0x67a8=function(_0x2f4ed6,_0x20961a){_0x2f4ed6=_0x2f4ed6-0x0;var _0x3751fe=_0x7a86[_0x2f4ed6];return _0x3751fe;};'use strict';var multer=require('multer');var util=require(_0x67a8('0x0'));var path=require(_0x67a8('0x1'));var timeout=require(_0x67a8('0x2'));var express=require(_0x67a8('0x3'));var router=express[_0x67a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x67a8('0x5'));var interaction=require(_0x67a8('0x6'));var config=require(_0x67a8('0x7'));var controller=require(_0x67a8('0x8'));router[_0x67a8('0x9')]('/',auth[_0x67a8('0xa')](),controller[_0x67a8('0xb')]);router[_0x67a8('0x9')](_0x67a8('0xc'),auth['isAuthenticated'](),controller[_0x67a8('0xd')]);router['post']('/',auth[_0x67a8('0xa')](),controller[_0x67a8('0xe')]);router['put'](_0x67a8('0xc'),auth['isAuthenticated'](),controller[_0x67a8('0xf')]);router[_0x67a8('0x10')](_0x67a8('0xc'),auth[_0x67a8('0xa')](),controller[_0x67a8('0x11')]);module[_0x67a8('0x12')]=router; \ No newline at end of file +var _0xaa3e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','post','put'];(function(_0x561060,_0x584264){var _0x4b8b02=function(_0x3b7b1b){while(--_0x3b7b1b){_0x561060['push'](_0x561060['shift']());}};_0x4b8b02(++_0x584264);}(_0xaa3e,0x154));var _0xeaa3=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xaa3e[_0x35485a];return _0x5148e6;};'use strict';var multer=require(_0xeaa3('0x0'));var util=require(_0xeaa3('0x1'));var path=require(_0xeaa3('0x2'));var timeout=require(_0xeaa3('0x3'));var express=require(_0xeaa3('0x4'));var router=express[_0xeaa3('0x5')]();var fs_extra=require(_0xeaa3('0x6'));var auth=require(_0xeaa3('0x7'));var interaction=require(_0xeaa3('0x8'));var config=require(_0xeaa3('0x9'));var controller=require(_0xeaa3('0xa'));router['get']('/',auth[_0xeaa3('0xb')](),controller[_0xeaa3('0xc')]);router[_0xeaa3('0xd')](_0xeaa3('0xe'),auth[_0xeaa3('0xb')](),controller['show']);router[_0xeaa3('0xf')]('/',auth[_0xeaa3('0xb')](),controller['create']);router[_0xeaa3('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xeaa3('0x11')]);router[_0xeaa3('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xeaa3('0x13')]);module[_0xeaa3('0x14')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 0102662..5a5b6ac 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 _0xaa53=['INTEGER','sequelize','exports','DATE','STRING'];(function(_0x768bcd,_0x139d7c){var _0x46048d=function(_0x45c6ee){while(--_0x45c6ee){_0x768bcd['push'](_0x768bcd['shift']());}};_0x46048d(++_0x139d7c);}(_0xaa53,0xb0));var _0x3aa5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa53[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x3aa5('0x0'));module[_0x3aa5('0x1')]={'calldate':{'type':Sequelize[_0x3aa5('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x3aa5('0x3')]},'dst':{'type':Sequelize[_0x3aa5('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x3aa5('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3aa5('0x3')]},'lastdata':{'type':Sequelize[_0x3aa5('0x3')]},'duration':{'type':Sequelize[_0x3aa5('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3aa5('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3aa5('0x3')]},'amaflags':{'type':Sequelize[_0x3aa5('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3aa5('0x3')]},'userfield':{'type':Sequelize[_0x3aa5('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x3aa5('0x3')]},'peeraccount':{'type':Sequelize[_0x3aa5('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5a8c=['exports','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x287e90,_0x4a77f1){_0x287e90=_0x287e90-0x0;var _0x4e95e2=_0x5a8c[_0x287e90];return _0x4e95e2;};'use strict';var Sequelize=require(_0xc5a8('0x0'));module[_0xc5a8('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xc5a8('0x2')},'clid':{'type':Sequelize[_0xc5a8('0x3')]},'src':{'type':Sequelize[_0xc5a8('0x3')]},'dst':{'type':Sequelize[_0xc5a8('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc5a8('0x3')]},'dstchannel':{'type':Sequelize[_0xc5a8('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xc5a8('0x3')]},'duration':{'type':Sequelize[_0xc5a8('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xc5a8('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc5a8('0x3')]},'amaflags':{'type':Sequelize[_0xc5a8('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc5a8('0x3')]},'userfield':{'type':Sequelize[_0xc5a8('0x3')]},'uniqueid':{'type':Sequelize[_0xc5a8('0x3')]},'linkedid':{'type':Sequelize[_0xc5a8('0x3')]},'sequence':{'type':Sequelize[_0xc5a8('0x3')]},'peeraccount':{'type':Sequelize[_0xc5a8('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc5a8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 1a43ef8..d7b2335 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 _0xf873=['options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Cdr','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge'];(function(_0x34dbec,_0x42fca4){var _0xf7d163=function(_0x4ea3bf){while(--_0x4ea3bf){_0x34dbec['push'](_0x34dbec['shift']());}};_0xf7d163(++_0x42fca4);}(_0xf873,0xb2));var _0x3f87=function(_0x5d3808,_0x300128){_0x5d3808=_0x5d3808-0x0;var _0x55fa4a=_0xf873[_0x5d3808];return _0x55fa4a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f87('0x0'));var zipdir=require(_0x3f87('0x1'));var jsonpatch=require(_0x3f87('0x2'));var rp=require(_0x3f87('0x3'));var moment=require(_0x3f87('0x4'));var BPromise=require(_0x3f87('0x5'));var Mustache=require(_0x3f87('0x6'));var util=require(_0x3f87('0x7'));var path=require(_0x3f87('0x8'));var sox=require('sox');var csv=require(_0x3f87('0x9'));var ejs=require(_0x3f87('0xa'));var fs=require('fs');var fs_extra=require(_0x3f87('0xb'));var _=require('lodash');var squel=require(_0x3f87('0xc'));var crypto=require(_0x3f87('0xd'));var jsforce=require(_0x3f87('0xe'));var deskjs=require(_0x3f87('0xf'));var toCsv=require(_0x3f87('0x9'));var querystring=require(_0x3f87('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f87('0x11'));var authService=require(_0x3f87('0x12'));var qs=require(_0x3f87('0x13'));var as=require(_0x3f87('0x14'));var hardwareService=require(_0x3f87('0x15'));var logger=require(_0x3f87('0x16'))(_0x3f87('0x17'));var utils=require(_0x3f87('0x18'));var config=require(_0x3f87('0x19'));var licenseUtil=require(_0x3f87('0x1a'));var db=require(_0x3f87('0x1b'))['db'];function respondWithStatusCode(_0x593e9,_0xfd5b65){_0xfd5b65=_0xfd5b65||0xcc;return function(_0x160861){if(_0x160861){return _0x593e9['sendStatus'](_0xfd5b65);}return _0x593e9[_0x3f87('0x1c')](_0xfd5b65)[_0x3f87('0x1d')]();};}function respondWithResult(_0x4ea5c1,_0x1cfba3){_0x1cfba3=_0x1cfba3||0xc8;return function(_0x14324f){if(_0x14324f){return _0x4ea5c1[_0x3f87('0x1c')](_0x1cfba3)[_0x3f87('0x1e')](_0x14324f);}};}function respondWithFilteredResult(_0x3f192a,_0x1c8fb0){return function(_0xd6df66){if(_0xd6df66){var _0x2ccf4d=typeof _0x1c8fb0['offset']===_0x3f87('0x1f')&&typeof _0x1c8fb0[_0x3f87('0x20')]===_0x3f87('0x1f');var _0x4e1df8=_0xd6df66[_0x3f87('0x21')];var _0x56d79e=_0x2ccf4d?0x0:_0x1c8fb0[_0x3f87('0x22')];var _0x13550c=_0x2ccf4d?_0xd6df66[_0x3f87('0x21')]:_0x1c8fb0[_0x3f87('0x22')]+_0x1c8fb0[_0x3f87('0x20')];var _0x4fe75c;if(_0x13550c>=_0x4e1df8){_0x13550c=_0x4e1df8;_0x4fe75c=0xc8;}else{_0x4fe75c=0xce;}_0x3f192a[_0x3f87('0x1c')](_0x4fe75c);return _0x3f192a[_0x3f87('0x23')](_0x3f87('0x24'),_0x56d79e+'-'+_0x13550c+'/'+_0x4e1df8)[_0x3f87('0x1e')](_0xd6df66);}return null;};}function patchUpdates(_0x57f7c5){return function(_0x4acd30){try{jsonpatch['apply'](_0x4acd30,_0x57f7c5,!![]);}catch(_0x73aba6){return BPromise[_0x3f87('0x25')](_0x73aba6);}return _0x4acd30[_0x3f87('0x26')]();};}function saveUpdates(_0x5ed5f1,_0x17e411){return function(_0xb01673){if(_0xb01673){return _0xb01673[_0x3f87('0x27')](_0x5ed5f1)[_0x3f87('0x28')](function(_0x15fad7){return _0x15fad7;});}return null;};}function removeEntity(_0x46d773,_0x30b061){return function(_0xea7dda){if(_0xea7dda){return _0xea7dda[_0x3f87('0x29')]()[_0x3f87('0x28')](function(){_0x46d773[_0x3f87('0x1c')](0xcc)[_0x3f87('0x1d')]();});}};}function handleEntityNotFound(_0x5ca13a,_0x3d03d7){return function(_0x9ed827){if(!_0x9ed827){_0x5ca13a[_0x3f87('0x2a')](0x194);}return _0x9ed827;};}function handleError(_0x5922e9,_0x49674f){_0x49674f=_0x49674f||0x1f4;return function(_0x41f9e9){logger[_0x3f87('0x2b')](_0x41f9e9[_0x3f87('0x2c')]);if(_0x41f9e9[_0x3f87('0x2d')]){delete _0x41f9e9[_0x3f87('0x2d')];}_0x5922e9[_0x3f87('0x1c')](_0x49674f)[_0x3f87('0x2e')](_0x41f9e9);};}exports[_0x3f87('0x2f')]=function(_0x113e40,_0x2e18cb){var _0x43576d={},_0x407828={},_0x439a7d={'count':0x0,'rows':[]};var _0x241d88=_[_0x3f87('0x30')](db[_0x3f87('0x31')]['rawAttributes'],function(_0x150dbb){return{'name':_0x150dbb[_0x3f87('0x32')],'type':_0x150dbb[_0x3f87('0x33')][_0x3f87('0x34')]};});_0x407828['model']=_['map'](_0x241d88,'name');_0x407828[_0x3f87('0x35')]=_[_0x3f87('0x36')](_0x113e40[_0x3f87('0x35')]);_0x407828[_0x3f87('0x37')]=_[_0x3f87('0x38')](_0x407828['model'],_0x407828[_0x3f87('0x35')]);_0x43576d['attributes']=_[_0x3f87('0x38')](_0x407828[_0x3f87('0x39')],qs[_0x3f87('0x3a')](_0x113e40[_0x3f87('0x35')][_0x3f87('0x3a')]));_0x43576d[_0x3f87('0x3b')]=_0x43576d[_0x3f87('0x3b')]['length']?_0x43576d['attributes']:_0x407828[_0x3f87('0x39')];if(!_0x113e40[_0x3f87('0x35')][_0x3f87('0x3c')](_0x3f87('0x3d'))){_0x43576d[_0x3f87('0x20')]=qs[_0x3f87('0x20')](_0x113e40[_0x3f87('0x35')]['limit']);_0x43576d[_0x3f87('0x22')]=qs['offset'](_0x113e40[_0x3f87('0x35')][_0x3f87('0x22')]);}_0x43576d[_0x3f87('0x3e')]=qs[_0x3f87('0x3f')](_0x113e40['query'][_0x3f87('0x3f')]);_0x43576d['where']=qs[_0x3f87('0x37')](_[_0x3f87('0x40')](_0x113e40[_0x3f87('0x35')],_0x407828[_0x3f87('0x37')]),_0x241d88);if(_0x113e40[_0x3f87('0x35')]['filter']){_0x43576d['where']=_['merge'](_0x43576d[_0x3f87('0x41')],{'$or':_[_0x3f87('0x30')](_0x241d88,function(_0x33c9f5){if(_0x33c9f5[_0x3f87('0x33')]!==_0x3f87('0x42')){var _0x18656a={};_0x18656a[_0x33c9f5['name']]={'$like':'%'+_0x113e40[_0x3f87('0x35')]['filter']+'%'};return _0x18656a;}})});}_0x43576d=_[_0x3f87('0x43')]({},_0x43576d,_0x113e40[_0x3f87('0x44')]);var _0x4cd683={'where':_0x43576d[_0x3f87('0x41')]};return db[_0x3f87('0x31')][_0x3f87('0x21')](_0x4cd683)['then'](function(_0x246976){_0x439a7d['count']=_0x246976;if(_0x113e40['query'][_0x3f87('0x45')]){_0x43576d[_0x3f87('0x46')]=[{'all':!![]}];}return db[_0x3f87('0x31')][_0x3f87('0x47')](_0x43576d);})[_0x3f87('0x28')](function(_0x4d9a67){_0x439a7d[_0x3f87('0x48')]=_0x4d9a67;return _0x439a7d;})[_0x3f87('0x28')](respondWithFilteredResult(_0x2e18cb,_0x43576d))[_0x3f87('0x49')](handleError(_0x2e18cb,null));};exports[_0x3f87('0x4a')]=function(_0x50ca7f,_0x13e99f){var _0x458c79={'raw':!![],'where':{'id':_0x50ca7f[_0x3f87('0x4b')]['id']}},_0x33b9ea={};_0x33b9ea[_0x3f87('0x39')]=_[_0x3f87('0x36')](db[_0x3f87('0x31')][_0x3f87('0x4c')]);_0x33b9ea['query']=_['keys'](_0x50ca7f[_0x3f87('0x35')]);_0x33b9ea[_0x3f87('0x37')]=_[_0x3f87('0x38')](_0x33b9ea[_0x3f87('0x39')],_0x33b9ea[_0x3f87('0x35')]);_0x458c79[_0x3f87('0x3b')]=_[_0x3f87('0x38')](_0x33b9ea[_0x3f87('0x39')],qs[_0x3f87('0x3a')](_0x50ca7f[_0x3f87('0x35')][_0x3f87('0x3a')]));_0x458c79['attributes']=_0x458c79[_0x3f87('0x3b')][_0x3f87('0x4d')]?_0x458c79[_0x3f87('0x3b')]:_0x33b9ea[_0x3f87('0x39')];if(_0x50ca7f[_0x3f87('0x35')][_0x3f87('0x45')]){_0x458c79[_0x3f87('0x46')]=[{'all':!![]}];}_0x458c79=_[_0x3f87('0x43')]({},_0x458c79,_0x50ca7f[_0x3f87('0x44')]);return db[_0x3f87('0x31')][_0x3f87('0x4e')](_0x458c79)['then'](handleEntityNotFound(_0x13e99f,null))[_0x3f87('0x28')](respondWithResult(_0x13e99f,null))[_0x3f87('0x49')](handleError(_0x13e99f,null));};exports[_0x3f87('0x4f')]=function(_0x4ec3e4,_0x19d928){return db[_0x3f87('0x31')][_0x3f87('0x4f')](_0x4ec3e4[_0x3f87('0x50')],{})[_0x3f87('0x28')](respondWithResult(_0x19d928,0xc9))[_0x3f87('0x49')](handleError(_0x19d928,null));};exports[_0x3f87('0x27')]=function(_0x5799eb,_0x163ebf){if(_0x5799eb[_0x3f87('0x50')]['id']){delete _0x5799eb[_0x3f87('0x50')]['id'];}return db[_0x3f87('0x31')][_0x3f87('0x4e')]({'where':{'id':_0x5799eb[_0x3f87('0x4b')]['id']}})[_0x3f87('0x28')](handleEntityNotFound(_0x163ebf,null))[_0x3f87('0x28')](saveUpdates(_0x5799eb[_0x3f87('0x50')],null))[_0x3f87('0x28')](respondWithResult(_0x163ebf,null))[_0x3f87('0x49')](handleError(_0x163ebf,null));};exports[_0x3f87('0x29')]=function(_0x53783f,_0x25c95f){return db['Cdr'][_0x3f87('0x4e')]({'where':{'id':_0x53783f[_0x3f87('0x4b')]['id']}})[_0x3f87('0x28')](handleEntityNotFound(_0x25c95f,null))[_0x3f87('0x28')](removeEntity(_0x25c95f,null))[_0x3f87('0x49')](handleError(_0x25c95f,null));};exports[_0x3f87('0x51')]=function(_0x560567,_0x46dee4){return db[_0x3f87('0x31')][_0x3f87('0x51')]()[_0x3f87('0x28')](respondWithResult(_0x46dee4,null))[_0x3f87('0x49')](handleError(_0x46dee4,null));}; \ No newline at end of file +var _0xe0c3=['request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../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','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','Cdr','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x39339b,_0x2a1730){var _0x37a7cf=function(_0x1b4a20){while(--_0x1b4a20){_0x39339b['push'](_0x39339b['shift']());}};_0x37a7cf(++_0x2a1730);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x3e0c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3e0c('0x1'));var jsonpatch=require(_0x3e0c('0x2'));var rp=require(_0x3e0c('0x3'));var moment=require(_0x3e0c('0x4'));var BPromise=require(_0x3e0c('0x5'));var Mustache=require(_0x3e0c('0x6'));var util=require(_0x3e0c('0x7'));var path=require(_0x3e0c('0x8'));var sox=require(_0x3e0c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e0c('0xa'));var _=require(_0x3e0c('0xb'));var squel=require(_0x3e0c('0xc'));var crypto=require(_0x3e0c('0xd'));var jsforce=require(_0x3e0c('0xe'));var deskjs=require(_0x3e0c('0xf'));var toCsv=require(_0x3e0c('0x10'));var querystring=require(_0x3e0c('0x11'));var Papa=require(_0x3e0c('0x12'));var Redis=require(_0x3e0c('0x13'));var authService=require(_0x3e0c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e0c('0x15'));var logger=require(_0x3e0c('0x16'))(_0x3e0c('0x17'));var utils=require(_0x3e0c('0x18'));var config=require(_0x3e0c('0x19'));var licenseUtil=require(_0x3e0c('0x1a'));var db=require(_0x3e0c('0x1b'))['db'];function respondWithStatusCode(_0x5dc732,_0x38b416){_0x38b416=_0x38b416||0xcc;return function(_0x491432){if(_0x491432){return _0x5dc732[_0x3e0c('0x1c')](_0x38b416);}return _0x5dc732[_0x3e0c('0x1d')](_0x38b416)['end']();};}function respondWithResult(_0x5f2654,_0x6d9c61){_0x6d9c61=_0x6d9c61||0xc8;return function(_0x409b2c){if(_0x409b2c){return _0x5f2654[_0x3e0c('0x1d')](_0x6d9c61)[_0x3e0c('0x1e')](_0x409b2c);}};}function respondWithFilteredResult(_0x15a269,_0x24fcf9){return function(_0x1947c2){if(_0x1947c2){var _0x274d75=typeof _0x24fcf9[_0x3e0c('0x1f')]===_0x3e0c('0x20')&&typeof _0x24fcf9[_0x3e0c('0x21')]==='undefined';var _0x58c498=_0x1947c2[_0x3e0c('0x22')];var _0x216993=_0x274d75?0x0:_0x24fcf9[_0x3e0c('0x1f')];var _0x41b19f=_0x274d75?_0x1947c2[_0x3e0c('0x22')]:_0x24fcf9[_0x3e0c('0x1f')]+_0x24fcf9['limit'];var _0x2e4a4a;if(_0x41b19f>=_0x58c498){_0x41b19f=_0x58c498;_0x2e4a4a=0xc8;}else{_0x2e4a4a=0xce;}_0x15a269[_0x3e0c('0x1d')](_0x2e4a4a);return _0x15a269[_0x3e0c('0x23')]('Content-Range',_0x216993+'-'+_0x41b19f+'/'+_0x58c498)[_0x3e0c('0x1e')](_0x1947c2);}return null;};}function patchUpdates(_0x5e3a93){return function(_0x479265){try{jsonpatch[_0x3e0c('0x24')](_0x479265,_0x5e3a93,!![]);}catch(_0x1f3bad){return BPromise[_0x3e0c('0x25')](_0x1f3bad);}return _0x479265[_0x3e0c('0x26')]();};}function saveUpdates(_0x4f8d38,_0x4cd447){return function(_0x3320c6){if(_0x3320c6){return _0x3320c6['update'](_0x4f8d38)['then'](function(_0x3fd7de){return _0x3fd7de;});}return null;};}function removeEntity(_0x1769b1,_0x44ce68){return function(_0x5bb7aa){if(_0x5bb7aa){return _0x5bb7aa[_0x3e0c('0x27')]()[_0x3e0c('0x28')](function(){_0x1769b1['status'](0xcc)[_0x3e0c('0x29')]();});}};}function handleEntityNotFound(_0x3de58b,_0x308fd5){return function(_0x1db945){if(!_0x1db945){_0x3de58b['sendStatus'](0x194);}return _0x1db945;};}function handleError(_0x412960,_0xc2f3cc){_0xc2f3cc=_0xc2f3cc||0x1f4;return function(_0x2c5fba){logger[_0x3e0c('0x2a')](_0x2c5fba['stack']);if(_0x2c5fba[_0x3e0c('0x2b')]){delete _0x2c5fba['name'];}_0x412960['status'](_0xc2f3cc)[_0x3e0c('0x2c')](_0x2c5fba);};}exports[_0x3e0c('0x2d')]=function(_0x4d3ce2,_0x16fb92){var _0x3f22b1={},_0x21d7a0={},_0x59c22f={'count':0x0,'rows':[]};var _0x44ecad=_[_0x3e0c('0x2e')](db['Cdr'][_0x3e0c('0x2f')],function(_0x2f31ad){return{'name':_0x2f31ad[_0x3e0c('0x30')],'type':_0x2f31ad[_0x3e0c('0x31')]['key']};});_0x21d7a0[_0x3e0c('0x32')]=_[_0x3e0c('0x2e')](_0x44ecad,_0x3e0c('0x2b'));_0x21d7a0['query']=_[_0x3e0c('0x33')](_0x4d3ce2[_0x3e0c('0x34')]);_0x21d7a0[_0x3e0c('0x35')]=_['intersection'](_0x21d7a0[_0x3e0c('0x32')],_0x21d7a0[_0x3e0c('0x34')]);_0x3f22b1[_0x3e0c('0x36')]=_[_0x3e0c('0x37')](_0x21d7a0[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x3f22b1[_0x3e0c('0x36')]=_0x3f22b1[_0x3e0c('0x36')][_0x3e0c('0x39')]?_0x3f22b1[_0x3e0c('0x36')]:_0x21d7a0[_0x3e0c('0x32')];if(!_0x4d3ce2[_0x3e0c('0x34')]['hasOwnProperty'](_0x3e0c('0x3a'))){_0x3f22b1[_0x3e0c('0x21')]=qs[_0x3e0c('0x21')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x21')]);_0x3f22b1[_0x3e0c('0x1f')]=qs[_0x3e0c('0x1f')](_0x4d3ce2[_0x3e0c('0x34')]['offset']);}_0x3f22b1['order']=qs[_0x3e0c('0x3b')](_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3b')]);_0x3f22b1[_0x3e0c('0x3c')]=qs[_0x3e0c('0x35')](_[_0x3e0c('0x3d')](_0x4d3ce2['query'],_0x21d7a0[_0x3e0c('0x35')]),_0x44ecad);if(_0x4d3ce2[_0x3e0c('0x34')]['filter']){_0x3f22b1['where']=_['merge'](_0x3f22b1[_0x3e0c('0x3c')],{'$or':_[_0x3e0c('0x2e')](_0x44ecad,function(_0x3d6ed7){if(_0x3d6ed7[_0x3e0c('0x31')]!==_0x3e0c('0x3e')){var _0x45ec69={};_0x45ec69[_0x3d6ed7[_0x3e0c('0x2b')]]={'$like':'%'+_0x4d3ce2[_0x3e0c('0x34')][_0x3e0c('0x3f')]+'%'};return _0x45ec69;}})});}_0x3f22b1=_[_0x3e0c('0x40')]({},_0x3f22b1,_0x4d3ce2[_0x3e0c('0x41')]);var _0x20135d={'where':_0x3f22b1['where']};return db['Cdr']['count'](_0x20135d)[_0x3e0c('0x28')](function(_0x22fcd8){_0x59c22f['count']=_0x22fcd8;if(_0x4d3ce2['query'][_0x3e0c('0x42')]){_0x3f22b1[_0x3e0c('0x43')]=[{'all':!![]}];}return db[_0x3e0c('0x44')][_0x3e0c('0x45')](_0x3f22b1);})['then'](function(_0x2e562f){_0x59c22f[_0x3e0c('0x46')]=_0x2e562f;return _0x59c22f;})[_0x3e0c('0x28')](respondWithFilteredResult(_0x16fb92,_0x3f22b1))[_0x3e0c('0x47')](handleError(_0x16fb92,null));};exports[_0x3e0c('0x48')]=function(_0x4b5638,_0x1bc4b3){var _0x5f4274={'raw':!![],'where':{'id':_0x4b5638[_0x3e0c('0x49')]['id']}},_0x35111f={};_0x35111f['model']=_['keys'](db[_0x3e0c('0x44')][_0x3e0c('0x2f')]);_0x35111f['query']=_[_0x3e0c('0x33')](_0x4b5638[_0x3e0c('0x34')]);_0x35111f[_0x3e0c('0x35')]=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],_0x35111f[_0x3e0c('0x34')]);_0x5f4274['attributes']=_[_0x3e0c('0x37')](_0x35111f[_0x3e0c('0x32')],qs[_0x3e0c('0x38')](_0x4b5638[_0x3e0c('0x34')][_0x3e0c('0x38')]));_0x5f4274[_0x3e0c('0x36')]=_0x5f4274['attributes'][_0x3e0c('0x39')]?_0x5f4274[_0x3e0c('0x36')]:_0x35111f[_0x3e0c('0x32')];if(_0x4b5638['query'][_0x3e0c('0x42')]){_0x5f4274[_0x3e0c('0x43')]=[{'all':!![]}];}_0x5f4274=_['merge']({},_0x5f4274,_0x4b5638[_0x3e0c('0x41')]);return db[_0x3e0c('0x44')][_0x3e0c('0x4a')](_0x5f4274)['then'](handleEntityNotFound(_0x1bc4b3,null))[_0x3e0c('0x28')](respondWithResult(_0x1bc4b3,null))[_0x3e0c('0x47')](handleError(_0x1bc4b3,null));};exports[_0x3e0c('0x4b')]=function(_0x2c7b8c,_0x109078){return db[_0x3e0c('0x44')][_0x3e0c('0x4b')](_0x2c7b8c[_0x3e0c('0x4c')],{})[_0x3e0c('0x28')](respondWithResult(_0x109078,0xc9))[_0x3e0c('0x47')](handleError(_0x109078,null));};exports[_0x3e0c('0x4d')]=function(_0x4efbf2,_0x20c9df){if(_0x4efbf2['body']['id']){delete _0x4efbf2['body']['id'];}return db[_0x3e0c('0x44')]['find']({'where':{'id':_0x4efbf2[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x20c9df,null))['then'](saveUpdates(_0x4efbf2[_0x3e0c('0x4c')],null))[_0x3e0c('0x28')](respondWithResult(_0x20c9df,null))['catch'](handleError(_0x20c9df,null));};exports[_0x3e0c('0x27')]=function(_0x3e04c9,_0x166203){return db[_0x3e0c('0x44')][_0x3e0c('0x4a')]({'where':{'id':_0x3e04c9[_0x3e0c('0x49')]['id']}})[_0x3e0c('0x28')](handleEntityNotFound(_0x166203,null))[_0x3e0c('0x28')](removeEntity(_0x166203,null))[_0x3e0c('0x47')](handleError(_0x166203,null));};exports[_0x3e0c('0x4e')]=function(_0x4d0f77,_0x3743ae){return db[_0x3e0c('0x44')][_0x3e0c('0x4e')]()[_0x3e0c('0x28')](respondWithResult(_0x3743ae,null))[_0x3e0c('0x47')](handleError(_0x3743ae,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 7ddc527..b7d8aac 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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x3ba894,_0x32c93a){var _0x7ae36c=function(_0x247a67){while(--_0x247a67){_0x3ba894['push'](_0x3ba894['shift']());}};_0x7ae36c(++_0x32c93a);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x28d0e4,_0x4f117d){var _0x3125c5=function(_0x19a646){while(--_0x19a646){_0x28d0e4['push'](_0x28d0e4['shift']());}};_0x3125c5(++_0x4f117d);}(_0x7a54,0x106));var _0x47a5=function(_0x5b6a2f,_0x46824c){_0x5b6a2f=_0x5b6a2f-0x0;var _0x5f4783=_0x7a54[_0x5b6a2f];return _0x5f4783;};'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 a5bc146..13d5a0f 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 _0x2d49=['http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise'];(function(_0x209302,_0x5826ac){var _0x1df8e9=function(_0x16ae49){while(--_0x16ae49){_0x209302['push'](_0x209302['shift']());}};_0x1df8e9(++_0x5826ac);}(_0x2d49,0x148));var _0x92d4=function(_0x47a3f0,_0x4762ee){_0x47a3f0=_0x47a3f0-0x0;var _0xb6e32c=_0x2d49[_0x47a3f0];return _0xb6e32c;};'use strict';var _=require(_0x92d4('0x0'));var util=require(_0x92d4('0x1'));var moment=require(_0x92d4('0x2'));var BPromise=require(_0x92d4('0x3'));var rs=require(_0x92d4('0x4'));var fs=require('fs');var Redis=require(_0x92d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x92d4('0x6'));var jayson=require(_0x92d4('0x7'));var client=jayson['client'][_0x92d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cb186,_0x3af580,_0x15c552){return new BPromise(function(_0x2a7236,_0x12dac7){return client[_0x92d4('0x9')](_0x2cb186,_0x15c552)[_0x92d4('0xa')](function(_0x356a58){logger[_0x92d4('0xb')](_0x92d4('0xc'),_0x3af580,_0x92d4('0xd'));logger[_0x92d4('0xe')](_0x92d4('0xf'),_0x3af580,'request\x20sent',JSON[_0x92d4('0x10')](_0x356a58));if(_0x356a58[_0x92d4('0x11')]){if(_0x356a58['error']['code']===0x1f4){logger['error'](_0x92d4('0xc'),_0x3af580,_0x356a58[_0x92d4('0x11')][_0x92d4('0x12')]);return _0x12dac7(_0x356a58[_0x92d4('0x11')]['message']);}logger[_0x92d4('0x11')](_0x92d4('0xc'),_0x3af580,_0x356a58[_0x92d4('0x11')][_0x92d4('0x12')]);return _0x2a7236(_0x356a58[_0x92d4('0x11')][_0x92d4('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x3af580,'request\x20sent');_0x2a7236(_0x356a58[_0x92d4('0x13')][_0x92d4('0x12')]);}})[_0x92d4('0x14')](function(_0x166d12){logger[_0x92d4('0x11')]('Cdr,\x20%s,\x20%s',_0x3af580,_0x166d12);_0x12dac7(_0x166d12);});});} \ No newline at end of file +var _0x88a3=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x6d410e,_0x46120c){var _0x4cebdc=function(_0xc61c8f){while(--_0xc61c8f){_0x6d410e['push'](_0x6d410e['shift']());}};_0x4cebdc(++_0x46120c);}(_0x88a3,0x7c));var _0x388a=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0x88a3[_0x59cda9];return _0x26c18f;};'use strict';var _=require(_0x388a('0x0'));var util=require(_0x388a('0x1'));var moment=require('moment');var BPromise=require(_0x388a('0x2'));var rs=require(_0x388a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x388a('0x4'))['db'];var utils=require(_0x388a('0x5'));var logger=require(_0x388a('0x6'))(_0x388a('0x7'));var config=require(_0x388a('0x8'));var jayson=require(_0x388a('0x9'));var client=jayson[_0x388a('0xa')][_0x388a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c009d,_0x16722f,_0x2ddf6d){return new BPromise(function(_0x388d16,_0x12e404){return client[_0x388a('0xc')](_0x4c009d,_0x2ddf6d)[_0x388a('0xd')](function(_0x562eeb){logger[_0x388a('0xe')]('Cdr,\x20%s,\x20%s',_0x16722f,_0x388a('0xf'));logger[_0x388a('0x10')](_0x388a('0x11'),_0x16722f,_0x388a('0xf'),JSON[_0x388a('0x12')](_0x562eeb));if(_0x562eeb[_0x388a('0x13')]){if(_0x562eeb[_0x388a('0x13')][_0x388a('0x14')]===0x1f4){logger['error'](_0x388a('0x15'),_0x16722f,_0x562eeb[_0x388a('0x13')][_0x388a('0x16')]);return _0x12e404(_0x562eeb[_0x388a('0x13')][_0x388a('0x16')]);}logger[_0x388a('0x13')](_0x388a('0x15'),_0x16722f,_0x562eeb['error'][_0x388a('0x16')]);return _0x388d16(_0x562eeb[_0x388a('0x13')][_0x388a('0x16')]);}else{logger[_0x388a('0xe')](_0x388a('0x15'),_0x16722f,_0x388a('0xf'));_0x388d16(_0x562eeb[_0x388a('0x17')][_0x388a('0x16')]);}})[_0x388a('0x18')](function(_0x5a9e73){logger[_0x388a('0x13')]('Cdr,\x20%s,\x20%s',_0x16722f,_0x5a9e73);_0x12e404(_0x5a9e73);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 92b9326..783b198 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x608625,_0x58aea2){var _0x38d78a=function(_0x26a924){while(--_0x26a924){_0x608625['push'](_0x608625['shift']());}};_0x38d78a(++_0x58aea2);}(_0xb10b,0x12a));var _0xbb10=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0xb10b[_0x46c9cc];return _0x21b46e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index eaa66c3..3058074 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 _0x3a9d=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0x3a9d,0x1aa));var _0xd3a9=function(_0x16c931,_0x3bba34){_0x16c931=_0x16c931-0x0;var _0x5c0b8c=_0x3a9d[_0x16c931];return _0x5c0b8c;};'use strict';var Sequelize=require(_0xd3a9('0x0'));module[_0xd3a9('0x1')]={'priority':{'type':Sequelize[_0xd3a9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd3a9('0x3')],'allowNull':![],'defaultValue':_0xd3a9('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd3a9('0x3')]},'interval':{'type':Sequelize[_0xd3a9('0x3')],'defaultValue':_0xd3a9('0x5')}}; \ No newline at end of file +var _0xf1b4=['INTEGER','STRING','noop','*,*,*,*','exports'];(function(_0x53ddab,_0x4ada9d){var _0x5819ac=function(_0x4d5fc8){while(--_0x4d5fc8){_0x53ddab['push'](_0x53ddab['shift']());}};_0x5819ac(++_0x4ada9d);}(_0xf1b4,0x13a));var _0x4f1b=function(_0x5ad4cf,_0x212ffb){_0x5ad4cf=_0x5ad4cf-0x0;var _0x530aba=_0xf1b4[_0x5ad4cf];return _0x530aba;};'use strict';var Sequelize=require('sequelize');module[_0x4f1b('0x0')]={'priority':{'type':Sequelize[_0x4f1b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4f1b('0x2')],'allowNull':![],'defaultValue':_0x4f1b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4f1b('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 813b861..ba2d3bf 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 _0x43c8=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../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','Content-Range','apply','save','destroy','then','error','stack','name','send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','include','merge','options','find','catch','body','rimraf','fast-json-patch'];(function(_0x5ae94a,_0x235bae){var _0x1939ea=function(_0x17169a){while(--_0x17169a){_0x5ae94a['push'](_0x5ae94a['shift']());}};_0x1939ea(++_0x235bae);}(_0x43c8,0xaf));var _0x843c=function(_0x1e2f92,_0x1e5be5){_0x1e2f92=_0x1e2f92-0x0;var _0x2f49b0=_0x43c8[_0x1e2f92];return _0x2f49b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x843c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x843c('0x1'));var rp=require(_0x843c('0x2'));var moment=require(_0x843c('0x3'));var BPromise=require(_0x843c('0x4'));var Mustache=require(_0x843c('0x5'));var util=require(_0x843c('0x6'));var path=require(_0x843c('0x7'));var sox=require('sox');var csv=require(_0x843c('0x8'));var ejs=require(_0x843c('0x9'));var fs=require('fs');var fs_extra=require(_0x843c('0xa'));var _=require(_0x843c('0xb'));var squel=require(_0x843c('0xc'));var crypto=require('crypto');var jsforce=require(_0x843c('0xd'));var deskjs=require(_0x843c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x843c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x843c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x843c('0x11'));var hardwareService=require(_0x843c('0x12'));var logger=require(_0x843c('0x13'))(_0x843c('0x14'));var utils=require('../../config/utils');var config=require(_0x843c('0x15'));var licenseUtil=require(_0x843c('0x16'));var db=require(_0x843c('0x17'))['db'];function respondWithStatusCode(_0xe0ae48,_0x231ce1){_0x231ce1=_0x231ce1||0xcc;return function(_0x34e297){if(_0x34e297){return _0xe0ae48[_0x843c('0x18')](_0x231ce1);}return _0xe0ae48[_0x843c('0x19')](_0x231ce1)[_0x843c('0x1a')]();};}function respondWithResult(_0x7092f0,_0x313947){_0x313947=_0x313947||0xc8;return function(_0x36e07f){if(_0x36e07f){return _0x7092f0[_0x843c('0x19')](_0x313947)[_0x843c('0x1b')](_0x36e07f);}};}function respondWithFilteredResult(_0x3c67eb,_0x5577ff){return function(_0x3dc50d){if(_0x3dc50d){var _0x2c013c=typeof _0x5577ff[_0x843c('0x1c')]===_0x843c('0x1d')&&typeof _0x5577ff[_0x843c('0x1e')]==='undefined';var _0x37c476=_0x3dc50d[_0x843c('0x1f')];var _0x1a7966=_0x2c013c?0x0:_0x5577ff[_0x843c('0x1c')];var _0x47d16a=_0x2c013c?_0x3dc50d[_0x843c('0x1f')]:_0x5577ff[_0x843c('0x1c')]+_0x5577ff[_0x843c('0x1e')];var _0x65b0e5;if(_0x47d16a>=_0x37c476){_0x47d16a=_0x37c476;_0x65b0e5=0xc8;}else{_0x65b0e5=0xce;}_0x3c67eb[_0x843c('0x19')](_0x65b0e5);return _0x3c67eb['set'](_0x843c('0x20'),_0x1a7966+'-'+_0x47d16a+'/'+_0x37c476)['json'](_0x3dc50d);}return null;};}function patchUpdates(_0x505d5c){return function(_0x5eb8ca){try{jsonpatch[_0x843c('0x21')](_0x5eb8ca,_0x505d5c,!![]);}catch(_0x1df525){return BPromise['reject'](_0x1df525);}return _0x5eb8ca[_0x843c('0x22')]();};}function saveUpdates(_0x30c897,_0x2d1d43){return function(_0x15513d){if(_0x15513d){return _0x15513d['update'](_0x30c897)['then'](function(_0x4b44d8){return _0x4b44d8;});}return null;};}function removeEntity(_0x3f914b,_0x17e6ab){return function(_0x2d90f9){if(_0x2d90f9){return _0x2d90f9[_0x843c('0x23')]()[_0x843c('0x24')](function(){_0x3f914b[_0x843c('0x19')](0xcc)[_0x843c('0x1a')]();});}};}function handleEntityNotFound(_0x51f75b,_0x4584be){return function(_0x2a8c56){if(!_0x2a8c56){_0x51f75b[_0x843c('0x18')](0x194);}return _0x2a8c56;};}function handleError(_0x4aa4b7,_0x2a34d2){_0x2a34d2=_0x2a34d2||0x1f4;return function(_0x5caa13){logger[_0x843c('0x25')](_0x5caa13[_0x843c('0x26')]);if(_0x5caa13[_0x843c('0x27')]){delete _0x5caa13['name'];}_0x4aa4b7[_0x843c('0x19')](_0x2a34d2)[_0x843c('0x28')](_0x5caa13);};}exports[_0x843c('0x29')]=function(_0x3bf6a6,_0x8473bb){var _0xb8b544={'raw':!![],'where':{'id':_0x3bf6a6[_0x843c('0x2a')]['id']}},_0x4e2a13={};_0x4e2a13['model']=_[_0x843c('0x2b')](db[_0x843c('0x2c')][_0x843c('0x2d')]);_0x4e2a13[_0x843c('0x2e')]=_['keys'](_0x3bf6a6[_0x843c('0x2e')]);_0x4e2a13[_0x843c('0x2f')]=_[_0x843c('0x30')](_0x4e2a13[_0x843c('0x31')],_0x4e2a13[_0x843c('0x2e')]);_0xb8b544[_0x843c('0x32')]=_[_0x843c('0x30')](_0x4e2a13[_0x843c('0x31')],qs[_0x843c('0x33')](_0x3bf6a6[_0x843c('0x2e')][_0x843c('0x33')]));_0xb8b544[_0x843c('0x32')]=_0xb8b544['attributes'][_0x843c('0x34')]?_0xb8b544['attributes']:_0x4e2a13[_0x843c('0x31')];if(_0x3bf6a6[_0x843c('0x2e')]['includeAll']){_0xb8b544[_0x843c('0x35')]=[{'all':!![]}];}_0xb8b544=_[_0x843c('0x36')]({},_0xb8b544,_0x3bf6a6[_0x843c('0x37')]);return db['ChatApplication'][_0x843c('0x38')](_0xb8b544)[_0x843c('0x24')](handleEntityNotFound(_0x8473bb,null))['then'](respondWithResult(_0x8473bb,null))[_0x843c('0x39')](handleError(_0x8473bb,null));};exports['update']=function(_0xe3173e,_0x28d9b8){if(_0xe3173e[_0x843c('0x3a')]['id']){delete _0xe3173e['body']['id'];}return db[_0x843c('0x2c')][_0x843c('0x38')]({'where':{'id':_0xe3173e[_0x843c('0x2a')]['id']}})[_0x843c('0x24')](handleEntityNotFound(_0x28d9b8,null))[_0x843c('0x24')](saveUpdates(_0xe3173e['body'],null))[_0x843c('0x24')](respondWithResult(_0x28d9b8,null))[_0x843c('0x39')](handleError(_0x28d9b8,null));};exports[_0x843c('0x23')]=function(_0x16d3d1,_0xd8896c){return db[_0x843c('0x2c')]['find']({'where':{'id':_0x16d3d1[_0x843c('0x2a')]['id']}})[_0x843c('0x24')](handleEntityNotFound(_0xd8896c,null))[_0x843c('0x24')](removeEntity(_0xd8896c,null))[_0x843c('0x39')](handleError(_0xd8896c,null));}; \ No newline at end of file +var _0x30fe=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','status','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','fields','includeAll','merge','options','find','catch','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x30fe,0x149));var _0xe30f=function(_0x37f7cd,_0x5e5987){_0x37f7cd=_0x37f7cd-0x0;var _0x53f11e=_0x30fe[_0x37f7cd];return _0x53f11e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe30f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe30f('0x1'));var rp=require('request-promise');var moment=require(_0xe30f('0x2'));var BPromise=require(_0xe30f('0x3'));var Mustache=require(_0xe30f('0x4'));var util=require(_0xe30f('0x5'));var path=require(_0xe30f('0x6'));var sox=require('sox');var csv=require(_0xe30f('0x7'));var ejs=require(_0xe30f('0x8'));var fs=require('fs');var fs_extra=require(_0xe30f('0x9'));var _=require(_0xe30f('0xa'));var squel=require(_0xe30f('0xb'));var crypto=require(_0xe30f('0xc'));var jsforce=require(_0xe30f('0xd'));var deskjs=require(_0xe30f('0xe'));var toCsv=require(_0xe30f('0x7'));var querystring=require(_0xe30f('0xf'));var Papa=require('papaparse');var Redis=require(_0xe30f('0x10'));var authService=require(_0xe30f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe30f('0x12'));var hardwareService=require(_0xe30f('0x13'));var logger=require(_0xe30f('0x14'))(_0xe30f('0x15'));var utils=require('../../config/utils');var config=require(_0xe30f('0x16'));var licenseUtil=require(_0xe30f('0x17'));var db=require(_0xe30f('0x18'))['db'];function respondWithStatusCode(_0x583eb9,_0x3859df){_0x3859df=_0x3859df||0xcc;return function(_0x19970e){if(_0x19970e){return _0x583eb9[_0xe30f('0x19')](_0x3859df);}return _0x583eb9['status'](_0x3859df)[_0xe30f('0x1a')]();};}function respondWithResult(_0x460e07,_0x122e2a){_0x122e2a=_0x122e2a||0xc8;return function(_0x7d684c){if(_0x7d684c){return _0x460e07['status'](_0x122e2a)['json'](_0x7d684c);}};}function respondWithFilteredResult(_0x5ac4b2,_0x3c9680){return function(_0x494ad3){if(_0x494ad3){var _0x2b6a9b=typeof _0x3c9680[_0xe30f('0x1b')]==='undefined'&&typeof _0x3c9680[_0xe30f('0x1c')]==='undefined';var _0x2dbb2b=_0x494ad3[_0xe30f('0x1d')];var _0x406c98=_0x2b6a9b?0x0:_0x3c9680[_0xe30f('0x1b')];var _0x17024a=_0x2b6a9b?_0x494ad3['count']:_0x3c9680['offset']+_0x3c9680[_0xe30f('0x1c')];var _0x535873;if(_0x17024a>=_0x2dbb2b){_0x17024a=_0x2dbb2b;_0x535873=0xc8;}else{_0x535873=0xce;}_0x5ac4b2[_0xe30f('0x1e')](_0x535873);return _0x5ac4b2['set'](_0xe30f('0x1f'),_0x406c98+'-'+_0x17024a+'/'+_0x2dbb2b)[_0xe30f('0x20')](_0x494ad3);}return null;};}function patchUpdates(_0x2c4d1f){return function(_0x2a0432){try{jsonpatch[_0xe30f('0x21')](_0x2a0432,_0x2c4d1f,!![]);}catch(_0x5b33fa){return BPromise[_0xe30f('0x22')](_0x5b33fa);}return _0x2a0432['save']();};}function saveUpdates(_0xf66c5a,_0x5af7b5){return function(_0x322ee0){if(_0x322ee0){return _0x322ee0[_0xe30f('0x23')](_0xf66c5a)[_0xe30f('0x24')](function(_0x42833a){return _0x42833a;});}return null;};}function removeEntity(_0x7f7b1f,_0x378d6f){return function(_0x50bca4){if(_0x50bca4){return _0x50bca4[_0xe30f('0x25')]()['then'](function(){_0x7f7b1f[_0xe30f('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4fbe,_0x4fc220){return function(_0x11a539){if(!_0x11a539){_0x4d4fbe['sendStatus'](0x194);}return _0x11a539;};}function handleError(_0x412015,_0x25e3cf){_0x25e3cf=_0x25e3cf||0x1f4;return function(_0x37c716){logger[_0xe30f('0x26')](_0x37c716[_0xe30f('0x27')]);if(_0x37c716[_0xe30f('0x28')]){delete _0x37c716['name'];}_0x412015[_0xe30f('0x1e')](_0x25e3cf)[_0xe30f('0x29')](_0x37c716);};}exports['show']=function(_0x15a217,_0x2d67d4){var _0x5a6cc3={'raw':!![],'where':{'id':_0x15a217['params']['id']}},_0x500626={};_0x500626[_0xe30f('0x2a')]=_[_0xe30f('0x2b')](db[_0xe30f('0x2c')][_0xe30f('0x2d')]);_0x500626[_0xe30f('0x2e')]=_[_0xe30f('0x2b')](_0x15a217['query']);_0x500626[_0xe30f('0x2f')]=_['intersection'](_0x500626[_0xe30f('0x2a')],_0x500626[_0xe30f('0x2e')]);_0x5a6cc3[_0xe30f('0x30')]=_[_0xe30f('0x31')](_0x500626['model'],qs[_0xe30f('0x32')](_0x15a217[_0xe30f('0x2e')][_0xe30f('0x32')]));_0x5a6cc3['attributes']=_0x5a6cc3[_0xe30f('0x30')]['length']?_0x5a6cc3[_0xe30f('0x30')]:_0x500626[_0xe30f('0x2a')];if(_0x15a217[_0xe30f('0x2e')][_0xe30f('0x33')]){_0x5a6cc3['include']=[{'all':!![]}];}_0x5a6cc3=_[_0xe30f('0x34')]({},_0x5a6cc3,_0x15a217[_0xe30f('0x35')]);return db[_0xe30f('0x2c')][_0xe30f('0x36')](_0x5a6cc3)[_0xe30f('0x24')](handleEntityNotFound(_0x2d67d4,null))[_0xe30f('0x24')](respondWithResult(_0x2d67d4,null))[_0xe30f('0x37')](handleError(_0x2d67d4,null));};exports['update']=function(_0x139915,_0xcc659c){if(_0x139915[_0xe30f('0x38')]['id']){delete _0x139915['body']['id'];}return db[_0xe30f('0x2c')][_0xe30f('0x36')]({'where':{'id':_0x139915['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0xcc659c,null))['then'](saveUpdates(_0x139915[_0xe30f('0x38')],null))['then'](respondWithResult(_0xcc659c,null))['catch'](handleError(_0xcc659c,null));};exports['destroy']=function(_0xf09327,_0x86fbbc){return db['ChatApplication'][_0xe30f('0x36')]({'where':{'id':_0xf09327['params']['id']}})[_0xe30f('0x24')](handleEntityNotFound(_0x86fbbc,null))[_0xe30f('0x24')](removeEntity(_0x86fbbc,null))[_0xe30f('0x37')](handleError(_0x86fbbc,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 89b7795..add2842 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 _0x8cdd=['util','../../config/logger','api','moment','request-promise','path','rimraf','./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x268425,_0x16a100){var _0x25798b=function(_0x54a3ea){while(--_0x54a3ea){_0x268425['push'](_0x268425['shift']());}};_0x25798b(++_0x16a100);}(_0x8cdd,0x1ec));var _0xd8cd=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x8cdd[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require(_0xd8cd('0x0'));var logger=require(_0xd8cd('0x1'))(_0xd8cd('0x2'));var moment=require(_0xd8cd('0x3'));var BPromise=require('bluebird');var rp=require(_0xd8cd('0x4'));var fs=require('fs');var path=require(_0xd8cd('0x5'));var rimraf=require(_0xd8cd('0x6'));var config=require('../../config/environment');var attributes=require(_0xd8cd('0x7'));module[_0xd8cd('0x8')]=function(_0x48fdfc,_0x1b46ad){return _0x48fdfc['define']('ChatApplication',attributes,{'tableName':_0xd8cd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd8cd('0xa'),'collate':_0xd8cd('0xb')});}; \ No newline at end of file +var _0x897b=['chat_applications','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1801ea,_0x39574b){var _0x412da5=function(_0x55807a){while(--_0x55807a){_0x1801ea['push'](_0x1801ea['shift']());}};_0x412da5(++_0x39574b);}(_0x897b,0x90));var _0xb897=function(_0x59b61d,_0x26b059){_0x59b61d=_0x59b61d-0x0;var _0x49fd57=_0x897b[_0x59b61d];return _0x49fd57;};'use strict';var _=require(_0xb897('0x0'));var util=require(_0xb897('0x1'));var logger=require(_0xb897('0x2'))(_0xb897('0x3'));var moment=require(_0xb897('0x4'));var BPromise=require(_0xb897('0x5'));var rp=require(_0xb897('0x6'));var fs=require('fs');var path=require(_0xb897('0x7'));var rimraf=require(_0xb897('0x8'));var config=require(_0xb897('0x9'));var attributes=require('./chatApplication.attributes');module[_0xb897('0xa')]=function(_0x17e923,_0x162651){return _0x17e923[_0xb897('0xb')]('ChatApplication',attributes,{'tableName':_0xb897('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d1a09dd..e4e16ad 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 _0x3e6c=['stringify','error','ChatApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x58d4ea,_0x36673a){var _0x4ba29e=function(_0x21380d){while(--_0x21380d){_0x58d4ea['push'](_0x58d4ea['shift']());}};_0x4ba29e(++_0x36673a);}(_0x3e6c,0x98));var _0xc3e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e6c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc3e6('0x0'));var util=require(_0xc3e6('0x1'));var moment=require(_0xc3e6('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e6('0x3'));var fs=require('fs');var Redis=require(_0xc3e6('0x4'));var db=require(_0xc3e6('0x5'))['db'];var utils=require(_0xc3e6('0x6'));var logger=require(_0xc3e6('0x7'))('rpc');var config=require(_0xc3e6('0x8'));var jayson=require(_0xc3e6('0x9'));var client=jayson[_0xc3e6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d1fdf,_0xff8f3d,_0x816a31){return new BPromise(function(_0x3dc4a1,_0x3fb9b7){return client['request'](_0x1d1fdf,_0x816a31)[_0xc3e6('0xb')](function(_0x3379a5){logger[_0xc3e6('0xc')]('ChatApplication,\x20%s,\x20%s',_0xff8f3d,'request\x20sent');logger[_0xc3e6('0xd')](_0xc3e6('0xe'),_0xff8f3d,_0xc3e6('0xf'),JSON[_0xc3e6('0x10')](_0x3379a5));if(_0x3379a5[_0xc3e6('0x11')]){if(_0x3379a5[_0xc3e6('0x11')]['code']===0x1f4){logger[_0xc3e6('0x11')](_0xc3e6('0x12'),_0xff8f3d,_0x3379a5[_0xc3e6('0x11')][_0xc3e6('0x13')]);return _0x3fb9b7(_0x3379a5['error'][_0xc3e6('0x13')]);}logger[_0xc3e6('0x11')](_0xc3e6('0x12'),_0xff8f3d,_0x3379a5[_0xc3e6('0x11')][_0xc3e6('0x13')]);return _0x3dc4a1(_0x3379a5[_0xc3e6('0x11')][_0xc3e6('0x13')]);}else{logger[_0xc3e6('0xc')]('ChatApplication,\x20%s,\x20%s',_0xff8f3d,_0xc3e6('0xf'));_0x3dc4a1(_0x3379a5['result']['message']);}})[_0xc3e6('0x14')](function(_0x517c32){logger[_0xc3e6('0x11')](_0xc3e6('0x12'),_0xff8f3d,_0x517c32);_0x3fb9b7(_0x517c32);});});} \ No newline at end of file +var _0x8e17=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment'];(function(_0x401bd1,_0x486a2b){var _0x32bad7=function(_0x6d3b1){while(--_0x6d3b1){_0x401bd1['push'](_0x401bd1['shift']());}};_0x32bad7(++_0x486a2b);}(_0x8e17,0x13f));var _0x78e1=function(_0x127bc9,_0x2b2dea){_0x127bc9=_0x127bc9-0x0;var _0x2a1ab7=_0x8e17[_0x127bc9];return _0x2a1ab7;};'use strict';var _=require(_0x78e1('0x0'));var util=require(_0x78e1('0x1'));var moment=require(_0x78e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x78e1('0x3'));var fs=require('fs');var Redis=require(_0x78e1('0x4'));var db=require(_0x78e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x78e1('0x6'))(_0x78e1('0x7'));var config=require(_0x78e1('0x8'));var jayson=require(_0x78e1('0x9'));var client=jayson[_0x78e1('0xa')][_0x78e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd92b4d,_0x52af2c,_0x59fbc5){return new BPromise(function(_0x436678,_0x1f7354){return client[_0x78e1('0xc')](_0xd92b4d,_0x59fbc5)[_0x78e1('0xd')](function(_0x56fca9){logger[_0x78e1('0xe')](_0x78e1('0xf'),_0x52af2c,_0x78e1('0x10'));logger[_0x78e1('0x11')](_0x78e1('0x12'),_0x52af2c,'request\x20sent',JSON['stringify'](_0x56fca9));if(_0x56fca9[_0x78e1('0x13')]){if(_0x56fca9[_0x78e1('0x13')][_0x78e1('0x14')]===0x1f4){logger['error'](_0x78e1('0xf'),_0x52af2c,_0x56fca9[_0x78e1('0x13')][_0x78e1('0x15')]);return _0x1f7354(_0x56fca9[_0x78e1('0x13')][_0x78e1('0x15')]);}logger[_0x78e1('0x13')]('ChatApplication,\x20%s,\x20%s',_0x52af2c,_0x56fca9[_0x78e1('0x13')][_0x78e1('0x15')]);return _0x436678(_0x56fca9[_0x78e1('0x13')][_0x78e1('0x15')]);}else{logger[_0x78e1('0xe')](_0x78e1('0xf'),_0x52af2c,_0x78e1('0x10'));_0x436678(_0x56fca9['result']['message']);}})[_0x78e1('0x16')](function(_0xee5dae){logger[_0x78e1('0x13')]('ChatApplication,\x20%s,\x20%s',_0x52af2c,_0xee5dae);_0x1f7354(_0xee5dae);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index c91c82f..9b55839 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 _0x55c6=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3e3b13,_0x27a74f){var _0x39cdbf=function(_0x1f4c2f){while(--_0x1f4c2f){_0x3e3b13['push'](_0x3e3b13['shift']());}};_0x39cdbf(++_0x27a74f);}(_0x55c6,0x6f));var _0x655c=function(_0x23df93,_0x2bc5dc){_0x23df93=_0x23df93-0x0;var _0x577ed2=_0x55c6[_0x23df93];return _0x577ed2;};'use strict';var multer=require(_0x655c('0x0'));var util=require(_0x655c('0x1'));var path=require(_0x655c('0x2'));var timeout=require(_0x655c('0x3'));var express=require(_0x655c('0x4'));var router=express[_0x655c('0x5')]();var fs_extra=require(_0x655c('0x6'));var auth=require(_0x655c('0x7'));var interaction=require(_0x655c('0x8'));var config=require(_0x655c('0x9'));var controller=require(_0x655c('0xa'));router[_0x655c('0xb')](_0x655c('0xc'),auth[_0x655c('0xd')](),controller[_0x655c('0xe')]);router[_0x655c('0xf')](_0x655c('0xc'),auth[_0x655c('0xd')](),controller[_0x655c('0x10')]);router[_0x655c('0x11')](_0x655c('0xc'),auth[_0x655c('0xd')](),controller[_0x655c('0x12')]);module[_0x655c('0x13')]=router; \ No newline at end of file +var _0xc5b4=['show','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x11f345,_0x3d1ac3){var _0x5d66c9=function(_0x8ac91a){while(--_0x8ac91a){_0x11f345['push'](_0x11f345['shift']());}};_0x5d66c9(++_0x3d1ac3);}(_0xc5b4,0x85));var _0x4c5b=function(_0xdb7ded,_0x4015bd){_0xdb7ded=_0xdb7ded-0x0;var _0x36f909=_0xc5b4[_0xdb7ded];return _0x36f909;};'use strict';var multer=require(_0x4c5b('0x0'));var util=require('util');var path=require(_0x4c5b('0x1'));var timeout=require(_0x4c5b('0x2'));var express=require(_0x4c5b('0x3'));var router=express[_0x4c5b('0x4')]();var fs_extra=require(_0x4c5b('0x5'));var auth=require(_0x4c5b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4c5b('0x7'));var controller=require('./chatApplication.controller');router[_0x4c5b('0x8')](_0x4c5b('0x9'),auth[_0x4c5b('0xa')](),controller[_0x4c5b('0xb')]);router[_0x4c5b('0xc')](_0x4c5b('0x9'),auth[_0x4c5b('0xa')](),controller['update']);router[_0x4c5b('0xd')](_0x4c5b('0x9'),auth['isAuthenticated'](),controller[_0x4c5b('0xe')]);module[_0x4c5b('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 41f0997..9ffc380 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 _0x2d1d=['STRING','BOOLEAN'];(function(_0x5f4785,_0x1b22f9){var _0x5353fb=function(_0x1b5e10){while(--_0x1b5e10){_0x5f4785['push'](_0x5f4785['shift']());}};_0x5353fb(++_0x1b22f9);}(_0x2d1d,0x10e));var _0xd2d1=function(_0x5d54d7,_0x10a809){_0x5d54d7=_0x5d54d7-0x0;var _0x318529=_0x2d1d[_0x5d54d7];return _0x318529;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd2d1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xd2d1('0x0')]},'write':{'type':Sequelize[_0xd2d1('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb09a=['exports','STRING','sequelize'];(function(_0x45b409,_0x29d42e){var _0x345fba=function(_0x51d428){while(--_0x51d428){_0x45b409['push'](_0x45b409['shift']());}};_0x345fba(++_0x29d42e);}(_0xb09a,0xe6));var _0xab09=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0xb09a[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require(_0xab09('0x0'));module[_0xab09('0x1')]={'name':{'type':Sequelize[_0xab09('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 8b61f2a..50d3f56 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 _0x96e7=['error','name','send','index','map','ChatGroup','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','update','params','describe','user','toInteger','ids','getMembers','findOne','User','rawAttributes','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy'];(function(_0x3ddb5a,_0x393f8e){var _0x393fc9=function(_0x291375){while(--_0x291375){_0x3ddb5a['push'](_0x3ddb5a['shift']());}};_0x393fc9(++_0x393f8e);}(_0x96e7,0x1a4));var _0x796e=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x96e7[_0x7791d5];return _0x5ce288;};'use strict';var emlformat=require(_0x796e('0x0'));var rimraf=require(_0x796e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x796e('0x2'));var rp=require(_0x796e('0x3'));var moment=require(_0x796e('0x4'));var BPromise=require(_0x796e('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x796e('0x6'));var sox=require(_0x796e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x796e('0x8'));var squel=require(_0x796e('0x9'));var crypto=require('crypto');var jsforce=require(_0x796e('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x796e('0xb'));var Redis=require(_0x796e('0xc'));var authService=require(_0x796e('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x796e('0xe'));var hardwareService=require(_0x796e('0xf'));var logger=require('../../config/logger')(_0x796e('0x10'));var utils=require(_0x796e('0x11'));var config=require(_0x796e('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x796e('0x13'))['db'];config[_0x796e('0x14')]=_[_0x796e('0x15')](config[_0x796e('0x14')],{'host':_0x796e('0x16'),'port':0x18eb});var socket=require(_0x796e('0x17'))(new Redis(config['redis']));require('./chatGroup.socket')[_0x796e('0x18')](socket);function respondWithStatusCode(_0x507dbf,_0x52b5d7){_0x52b5d7=_0x52b5d7||0xcc;return function(_0x8318cf){if(_0x8318cf){return _0x507dbf[_0x796e('0x19')](_0x52b5d7);}return _0x507dbf['status'](_0x52b5d7)[_0x796e('0x1a')]();};}function respondWithResult(_0x4451d9,_0x3164ed){_0x3164ed=_0x3164ed||0xc8;return function(_0x153b17){if(_0x153b17){return _0x4451d9[_0x796e('0x1b')](_0x3164ed)[_0x796e('0x1c')](_0x153b17);}};}function respondWithFilteredResult(_0x2e518b,_0x2c8981){return function(_0x2d7a64){if(_0x2d7a64){var _0xd43d88=typeof _0x2c8981[_0x796e('0x1d')]===_0x796e('0x1e')&&typeof _0x2c8981[_0x796e('0x1f')]==='undefined';var _0x4e3d21=_0x2d7a64[_0x796e('0x20')];var _0x464c6a=_0xd43d88?0x0:_0x2c8981[_0x796e('0x1d')];var _0x1cdfea=_0xd43d88?_0x2d7a64[_0x796e('0x20')]:_0x2c8981[_0x796e('0x1d')]+_0x2c8981[_0x796e('0x1f')];var _0x1725ed;if(_0x1cdfea>=_0x4e3d21){_0x1cdfea=_0x4e3d21;_0x1725ed=0xc8;}else{_0x1725ed=0xce;}_0x2e518b[_0x796e('0x1b')](_0x1725ed);return _0x2e518b[_0x796e('0x21')](_0x796e('0x22'),_0x464c6a+'-'+_0x1cdfea+'/'+_0x4e3d21)['json'](_0x2d7a64);}return null;};}function patchUpdates(_0x1052b5){return function(_0x4fa776){try{jsonpatch[_0x796e('0x23')](_0x4fa776,_0x1052b5,!![]);}catch(_0x185b40){return BPromise[_0x796e('0x24')](_0x185b40);}return _0x4fa776[_0x796e('0x25')]();};}function saveUpdates(_0x2e076c,_0x1438c8){return function(_0x71849b){if(_0x71849b){return _0x71849b['update'](_0x2e076c)[_0x796e('0x26')](function(_0x1e5bf8){return _0x1e5bf8;});}return null;};}function removeEntity(_0x5d33ea,_0x369c10){return function(_0x764c81){if(_0x764c81){return _0x764c81[_0x796e('0x27')]()[_0x796e('0x26')](function(){_0x5d33ea[_0x796e('0x1b')](0xcc)[_0x796e('0x1a')]();});}};}function handleEntityNotFound(_0x343e4b,_0x5c12aa){return function(_0x31b52d){if(!_0x31b52d){_0x343e4b[_0x796e('0x19')](0x194);}return _0x31b52d;};}function handleError(_0x2f1e0f,_0x1eed58){_0x1eed58=_0x1eed58||0x1f4;return function(_0x548fd1){logger[_0x796e('0x28')](_0x548fd1['stack']);if(_0x548fd1[_0x796e('0x29')]){delete _0x548fd1[_0x796e('0x29')];}_0x2f1e0f[_0x796e('0x1b')](_0x1eed58)[_0x796e('0x2a')](_0x548fd1);};}exports[_0x796e('0x2b')]=function(_0x4ceee8,_0x5a958c){var _0x2955c8={},_0x2ee4d7={},_0x14c3fb={'count':0x0,'rows':[]};var _0xf32a4d=_[_0x796e('0x2c')](db[_0x796e('0x2d')]['rawAttributes'],function(_0x327005){return{'name':_0x327005[_0x796e('0x2e')],'type':_0x327005[_0x796e('0x2f')][_0x796e('0x30')]};});_0x2ee4d7['model']=_['map'](_0xf32a4d,'name');_0x2ee4d7['query']=_[_0x796e('0x31')](_0x4ceee8[_0x796e('0x32')]);_0x2ee4d7[_0x796e('0x33')]=_[_0x796e('0x34')](_0x2ee4d7[_0x796e('0x35')],_0x2ee4d7[_0x796e('0x32')]);_0x2955c8[_0x796e('0x36')]=_[_0x796e('0x34')](_0x2ee4d7['model'],qs['fields'](_0x4ceee8[_0x796e('0x32')][_0x796e('0x37')]));_0x2955c8[_0x796e('0x36')]=_0x2955c8[_0x796e('0x36')][_0x796e('0x38')]?_0x2955c8[_0x796e('0x36')]:_0x2ee4d7[_0x796e('0x35')];if(!_0x4ceee8[_0x796e('0x32')][_0x796e('0x39')]('nolimit')){_0x2955c8[_0x796e('0x1f')]=qs[_0x796e('0x1f')](_0x4ceee8['query'][_0x796e('0x1f')]);_0x2955c8[_0x796e('0x1d')]=qs[_0x796e('0x1d')](_0x4ceee8['query'][_0x796e('0x1d')]);}_0x2955c8[_0x796e('0x3a')]=qs[_0x796e('0x3b')](_0x4ceee8[_0x796e('0x32')]['sort']);_0x2955c8['where']=qs[_0x796e('0x33')](_[_0x796e('0x3c')](_0x4ceee8[_0x796e('0x32')],_0x2ee4d7[_0x796e('0x33')]),_0xf32a4d);if(_0x4ceee8[_0x796e('0x32')][_0x796e('0x3d')]){_0x2955c8[_0x796e('0x3e')]=_[_0x796e('0x3f')](_0x2955c8['where'],{'$or':_['map'](_0xf32a4d,function(_0x45fde2){if(_0x45fde2[_0x796e('0x2f')]!==_0x796e('0x40')){var _0x4fe0fa={};_0x4fe0fa[_0x45fde2[_0x796e('0x29')]]={'$like':'%'+_0x4ceee8[_0x796e('0x32')]['filter']+'%'};return _0x4fe0fa;}})});}_0x2955c8=_[_0x796e('0x3f')]({},_0x2955c8,_0x4ceee8[_0x796e('0x41')]);var _0x1d3ba3={'where':_0x2955c8[_0x796e('0x3e')]};return db['ChatGroup'][_0x796e('0x20')](_0x1d3ba3)[_0x796e('0x26')](function(_0x623f24){_0x14c3fb[_0x796e('0x20')]=_0x623f24;if(_0x4ceee8[_0x796e('0x32')]['includeAll']){_0x2955c8[_0x796e('0x42')]=[{'all':!![]}];}return db[_0x796e('0x2d')][_0x796e('0x43')](_0x2955c8);})[_0x796e('0x26')](function(_0xb08c9){_0x14c3fb[_0x796e('0x44')]=_0xb08c9;return _0x14c3fb;})[_0x796e('0x26')](respondWithFilteredResult(_0x5a958c,_0x2955c8))[_0x796e('0x45')](handleError(_0x5a958c,null));};exports['show']=function(_0x355f58,_0x39d217){var _0x48ff51={'raw':!![],'where':{'id':_0x355f58['params']['id']}},_0x276831={};_0x276831[_0x796e('0x35')]=_[_0x796e('0x31')](db[_0x796e('0x2d')]['rawAttributes']);_0x276831['query']=_[_0x796e('0x31')](_0x355f58[_0x796e('0x32')]);_0x276831[_0x796e('0x33')]=_[_0x796e('0x34')](_0x276831['model'],_0x276831['query']);_0x48ff51[_0x796e('0x36')]=_[_0x796e('0x34')](_0x276831[_0x796e('0x35')],qs[_0x796e('0x37')](_0x355f58[_0x796e('0x32')][_0x796e('0x37')]));_0x48ff51[_0x796e('0x36')]=_0x48ff51[_0x796e('0x36')]['length']?_0x48ff51['attributes']:_0x276831[_0x796e('0x35')];if(_0x355f58[_0x796e('0x32')][_0x796e('0x46')]){_0x48ff51[_0x796e('0x42')]=[{'all':!![]}];}_0x48ff51=_['merge']({},_0x48ff51,_0x355f58[_0x796e('0x41')]);return db[_0x796e('0x2d')][_0x796e('0x47')](_0x48ff51)['then'](handleEntityNotFound(_0x39d217,null))[_0x796e('0x26')](respondWithResult(_0x39d217,null))[_0x796e('0x45')](handleError(_0x39d217,null));};exports[_0x796e('0x48')]=function(_0x2c68aa,_0x43475f){return db[_0x796e('0x2d')]['create'](_0x2c68aa[_0x796e('0x49')],{})[_0x796e('0x26')](respondWithResult(_0x43475f,0xc9))[_0x796e('0x45')](handleError(_0x43475f,null));};exports[_0x796e('0x4a')]=function(_0x2ffffd,_0x447683){if(_0x2ffffd['body']['id']){delete _0x2ffffd[_0x796e('0x49')]['id'];}return db['ChatGroup'][_0x796e('0x47')]({'where':{'id':_0x2ffffd[_0x796e('0x4b')]['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x447683,null))[_0x796e('0x26')](saveUpdates(_0x2ffffd[_0x796e('0x49')],null))[_0x796e('0x26')](respondWithResult(_0x447683,null))[_0x796e('0x45')](handleError(_0x447683,null));};exports[_0x796e('0x27')]=function(_0x41cd96,_0x13da35){return db[_0x796e('0x2d')][_0x796e('0x47')]({'where':{'id':_0x41cd96[_0x796e('0x4b')]['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x13da35,null))[_0x796e('0x26')](removeEntity(_0x13da35,null))[_0x796e('0x45')](handleError(_0x13da35,null));};exports[_0x796e('0x4c')]=function(_0x4426d1,_0x522a57){return db['ChatGroup']['describe']()[_0x796e('0x26')](respondWithResult(_0x522a57,null))[_0x796e('0x45')](handleError(_0x522a57,null));};exports['getUnread']=function(_0x3b6b35,_0x51a280,_0x29a8e6){return db['ChatInternalMessage'][_0x796e('0x20')]({'where':{'ChatGroupId':_0x3b6b35[_0x796e('0x4b')]['id'],'ToId':_0x3b6b35[_0x796e('0x4d')]['id'],'read':![]}})[_0x796e('0x26')](function(_0x4f1beb){return{'id':_[_0x796e('0x4e')](_0x3b6b35[_0x796e('0x4b')]['id']),'count':_0x4f1beb};})[_0x796e('0x26')](respondWithResult(_0x51a280,null))[_0x796e('0x45')](handleError(_0x51a280,null));};exports['addMembers']=function(_0x34d4bb,_0x66e5f2,_0x419986){return db['ChatGroup'][_0x796e('0x47')]({'where':{'id':_0x34d4bb['params']['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x66e5f2,null))[_0x796e('0x26')](function(_0x195511){if(_0x195511){return _0x195511['addMembers'](_0x34d4bb['body'][_0x796e('0x4f')],_['omit'](_0x34d4bb[_0x796e('0x49')],[_0x796e('0x4f'),'id'])||{});}})[_0x796e('0x26')](respondWithResult(_0x66e5f2,null))[_0x796e('0x45')](handleError(_0x66e5f2,null));};exports[_0x796e('0x50')]=function(_0xbbd1be,_0x3c9ecb,_0x30e37c){var _0x1ae139={};var _0x473fe6={};var _0x599ba4;var _0x2fb4bc;return db['ChatGroup'][_0x796e('0x51')]({'where':{'id':_0xbbd1be[_0x796e('0x4b')]['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x3c9ecb,null))[_0x796e('0x26')](function(_0x325ed5){if(_0x325ed5){_0x599ba4=_0x325ed5;_0x473fe6[_0x796e('0x35')]=_[_0x796e('0x31')](db[_0x796e('0x52')][_0x796e('0x53')]);_0x473fe6[_0x796e('0x32')]=_[_0x796e('0x31')](_0xbbd1be[_0x796e('0x32')]);_0x473fe6[_0x796e('0x33')]=_[_0x796e('0x34')](_0x473fe6[_0x796e('0x35')],_0x473fe6[_0x796e('0x32')]);_0x1ae139['attributes']=_[_0x796e('0x34')](_0x473fe6[_0x796e('0x35')],qs[_0x796e('0x37')](_0xbbd1be['query'][_0x796e('0x37')]));_0x1ae139[_0x796e('0x36')]=_0x1ae139[_0x796e('0x36')]['length']?_0x1ae139['attributes']:_0x473fe6[_0x796e('0x35')];_0x1ae139[_0x796e('0x3a')]=qs['sort'](_0xbbd1be['query'][_0x796e('0x3b')]);_0x1ae139['where']=qs[_0x796e('0x33')](_[_0x796e('0x3c')](_0xbbd1be[_0x796e('0x32')],_0x473fe6[_0x796e('0x33')]));if(_0xbbd1be['query'][_0x796e('0x3d')]){_0x1ae139[_0x796e('0x3e')]=_[_0x796e('0x3f')](_0x1ae139['where'],{'$or':_['map'](_0x1ae139[_0x796e('0x36')],function(_0x2cadb7){var _0x48ffec={};_0x48ffec[_0x2cadb7]={'$like':'%'+_0xbbd1be['query'][_0x796e('0x3d')]+'%'};return _0x48ffec;})});}_0x1ae139=_['merge']({},_0x1ae139,_0xbbd1be[_0x796e('0x41')]);return _0x599ba4[_0x796e('0x50')](_0x1ae139);}})[_0x796e('0x26')](function(_0x5d2516){if(_0x5d2516){_0x2fb4bc=_0x5d2516[_0x796e('0x38')];if(!_0xbbd1be[_0x796e('0x32')][_0x796e('0x39')]('nolimit')){_0x1ae139['limit']=qs[_0x796e('0x1f')](_0xbbd1be['query'][_0x796e('0x1f')]);_0x1ae139['offset']=qs[_0x796e('0x1d')](_0xbbd1be['query'][_0x796e('0x1d')]);}return _0x599ba4[_0x796e('0x50')](_0x1ae139);}})[_0x796e('0x26')](function(_0x460133){if(_0x460133){return _0x460133?{'count':_0x2fb4bc,'rows':_0x460133}:null;}})[_0x796e('0x26')](respondWithResult(_0x3c9ecb,null))[_0x796e('0x45')](handleError(_0x3c9ecb,null));};exports[_0x796e('0x54')]=function(_0x5932d8,_0x3cbd30,_0x6e8210){return db[_0x796e('0x2d')][_0x796e('0x47')]({'where':{'id':_0x5932d8[_0x796e('0x4b')]['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x3cbd30,null))[_0x796e('0x26')](function(_0x1c5a01){if(_0x1c5a01){return _0x1c5a01[_0x796e('0x54')](_0x5932d8['query'][_0x796e('0x4f')]);}})[_0x796e('0x26')](respondWithStatusCode(_0x3cbd30,null))['catch'](handleError(_0x3cbd30,null));};exports[_0x796e('0x55')]=function(_0x584f00,_0x1109e5,_0x4c8fd4){if(_0x584f00['body']['id']){delete _0x584f00[_0x796e('0x49')]['id'];}return db[_0x796e('0x2d')][_0x796e('0x47')]({'where':{'id':_0x584f00[_0x796e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1109e5,null))['then'](function(_0x299d38){if(_0x299d38){_0x584f00[_0x796e('0x49')][_0x796e('0x56')]=_0x299d38['id'];return db[_0x796e('0x57')][_0x796e('0x48')](_0x584f00[_0x796e('0x49')]);}})['then'](respondWithResult(_0x1109e5,null))[_0x796e('0x45')](handleError(_0x1109e5,null));};exports[_0x796e('0x58')]=function(_0x5510c0,_0x505589,_0x1307b8){var _0x12c1bd={};var _0x35fb83={};var _0x3cbd7e;var _0x287fd9;return db[_0x796e('0x2d')][_0x796e('0x51')]({'where':{'id':_0x5510c0[_0x796e('0x4b')]['id']}})[_0x796e('0x26')](handleEntityNotFound(_0x505589,null))['then'](function(_0x424f5c){if(_0x424f5c){_0x3cbd7e=_0x424f5c;_0x35fb83['model']=_[_0x796e('0x31')](db[_0x796e('0x57')][_0x796e('0x53')]);_0x35fb83[_0x796e('0x32')]=_[_0x796e('0x31')](_0x5510c0['query']);_0x35fb83[_0x796e('0x33')]=_['intersection'](_0x35fb83[_0x796e('0x35')],_0x35fb83['query']);_0x12c1bd[_0x796e('0x36')]=_[_0x796e('0x34')](_0x35fb83[_0x796e('0x35')],qs[_0x796e('0x37')](_0x5510c0[_0x796e('0x32')]['fields']));_0x12c1bd[_0x796e('0x36')]=_0x12c1bd[_0x796e('0x36')][_0x796e('0x38')]?_0x12c1bd[_0x796e('0x36')]:_0x35fb83[_0x796e('0x35')];_0x12c1bd[_0x796e('0x3a')]=qs[_0x796e('0x3b')](_0x5510c0['query']['sort']);_0x12c1bd['where']=qs[_0x796e('0x33')](_[_0x796e('0x3c')](_0x5510c0[_0x796e('0x32')],_0x35fb83[_0x796e('0x33')]));if(_0x5510c0[_0x796e('0x32')][_0x796e('0x3d')]){_0x12c1bd[_0x796e('0x3e')]=_[_0x796e('0x3f')](_0x12c1bd['where'],{'$or':_[_0x796e('0x2c')](_0x12c1bd[_0x796e('0x36')],function(_0x507cb6){var _0x35fee2={};_0x35fee2[_0x507cb6]={'$like':'%'+_0x5510c0[_0x796e('0x32')][_0x796e('0x3d')]+'%'};return _0x35fee2;})});}if(_0x5510c0[_0x796e('0x32')]['$gte']){var _0x129886=_0x5510c0[_0x796e('0x32')][_0x796e('0x59')][_0x796e('0x5a')](',');var _0x2c26b3={};_0x2c26b3[_0x129886[0x0]]={'$gte':moment(_0x129886[0x1])['format'](_0x796e('0x5b'))};_0x12c1bd[_0x796e('0x3e')]=_[_0x796e('0x3f')](_0x12c1bd[_0x796e('0x3e')],_0x2c26b3);}_0x12c1bd=_['merge']({},_0x12c1bd,_0x5510c0[_0x796e('0x41')]);return _0x3cbd7e[_0x796e('0x58')](_0x12c1bd);}})[_0x796e('0x26')](function(_0x173ef5){if(_0x173ef5){_0x287fd9=_0x173ef5[_0x796e('0x38')];if(!_0x5510c0[_0x796e('0x32')][_0x796e('0x39')]('nolimit')){_0x12c1bd[_0x796e('0x1f')]=qs[_0x796e('0x1f')](_0x5510c0[_0x796e('0x32')]['limit']);_0x12c1bd[_0x796e('0x1d')]=qs[_0x796e('0x1d')](_0x5510c0['query'][_0x796e('0x1d')]);}return _0x3cbd7e[_0x796e('0x58')](_0x12c1bd);}})[_0x796e('0x26')](function(_0x2fd3b2){if(_0x2fd3b2){return _0x2fd3b2?{'count':_0x287fd9,'rows':_0x2fd3b2}:null;}})['then'](respondWithResult(_0x505589,null))['catch'](handleError(_0x505589,null));}; \ No newline at end of file +var _0x40d9=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','ChatGroup','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','order','pick','options','nolimit','removeMembers','addMessage','ChatGroupId','split','format','getMessages','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register'];(function(_0x330b91,_0x45dca7){var _0x212443=function(_0x3b6d77){while(--_0x3b6d77){_0x330b91['push'](_0x330b91['shift']());}};_0x212443(++_0x45dca7);}(_0x40d9,0xfc));var _0x940d=function(_0x1f1aee,_0x2243ce){_0x1f1aee=_0x1f1aee-0x0;var _0x9ddd7d=_0x40d9[_0x1f1aee];return _0x9ddd7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x940d('0x0'));var zipdir=require(_0x940d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x940d('0x2'));var moment=require('moment');var BPromise=require(_0x940d('0x3'));var Mustache=require(_0x940d('0x4'));var util=require(_0x940d('0x5'));var path=require('path');var sox=require(_0x940d('0x6'));var csv=require(_0x940d('0x7'));var ejs=require(_0x940d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x940d('0x9'));var crypto=require(_0x940d('0xa'));var jsforce=require(_0x940d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x940d('0x7'));var querystring=require('querystring');var Papa=require(_0x940d('0xc'));var Redis=require(_0x940d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x940d('0xe'));var hardwareService=require(_0x940d('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x940d('0x10'));var licenseUtil=require(_0x940d('0x11'));var db=require(_0x940d('0x12'))['db'];config[_0x940d('0x13')]=_[_0x940d('0x14')](config[_0x940d('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x940d('0x15'))(new Redis(config['redis']));require(_0x940d('0x16'))[_0x940d('0x17')](socket);function respondWithStatusCode(_0x16ea3b,_0x27c42f){_0x27c42f=_0x27c42f||0xcc;return function(_0x2e4fb3){if(_0x2e4fb3){return _0x16ea3b[_0x940d('0x18')](_0x27c42f);}return _0x16ea3b[_0x940d('0x19')](_0x27c42f)[_0x940d('0x1a')]();};}function respondWithResult(_0x41abec,_0x1b36e8){_0x1b36e8=_0x1b36e8||0xc8;return function(_0x521d64){if(_0x521d64){return _0x41abec[_0x940d('0x19')](_0x1b36e8)['json'](_0x521d64);}};}function respondWithFilteredResult(_0x542640,_0x283b88){return function(_0x226284){if(_0x226284){var _0x4a4d25=typeof _0x283b88[_0x940d('0x1b')]===_0x940d('0x1c')&&typeof _0x283b88[_0x940d('0x1d')]===_0x940d('0x1c');var _0x2891b2=_0x226284[_0x940d('0x1e')];var _0x39a944=_0x4a4d25?0x0:_0x283b88[_0x940d('0x1b')];var _0x44c224=_0x4a4d25?_0x226284[_0x940d('0x1e')]:_0x283b88['offset']+_0x283b88['limit'];var _0x5bf9b6;if(_0x44c224>=_0x2891b2){_0x44c224=_0x2891b2;_0x5bf9b6=0xc8;}else{_0x5bf9b6=0xce;}_0x542640[_0x940d('0x19')](_0x5bf9b6);return _0x542640[_0x940d('0x1f')](_0x940d('0x20'),_0x39a944+'-'+_0x44c224+'/'+_0x2891b2)[_0x940d('0x21')](_0x226284);}return null;};}function patchUpdates(_0x84c672){return function(_0x5580a4){try{jsonpatch['apply'](_0x5580a4,_0x84c672,!![]);}catch(_0x432f76){return BPromise[_0x940d('0x22')](_0x432f76);}return _0x5580a4[_0x940d('0x23')]();};}function saveUpdates(_0x3862e0,_0x4d93d9){return function(_0x20e785){if(_0x20e785){return _0x20e785[_0x940d('0x24')](_0x3862e0)[_0x940d('0x25')](function(_0x3b58d0){return _0x3b58d0;});}return null;};}function removeEntity(_0x39036d,_0x5f2dd1){return function(_0x16db03){if(_0x16db03){return _0x16db03[_0x940d('0x26')]()[_0x940d('0x25')](function(){_0x39036d[_0x940d('0x19')](0xcc)[_0x940d('0x1a')]();});}};}function handleEntityNotFound(_0x303205,_0x3445f6){return function(_0x3224d1){if(!_0x3224d1){_0x303205[_0x940d('0x18')](0x194);}return _0x3224d1;};}function handleError(_0x828bf,_0x11e548){_0x11e548=_0x11e548||0x1f4;return function(_0x235330){logger[_0x940d('0x27')](_0x235330[_0x940d('0x28')]);if(_0x235330[_0x940d('0x29')]){delete _0x235330[_0x940d('0x29')];}_0x828bf['status'](_0x11e548)[_0x940d('0x2a')](_0x235330);};}exports['index']=function(_0x534f70,_0x598006){var _0x4a0082={},_0x2b8b74={},_0x1b26a8={'count':0x0,'rows':[]};var _0x4b480d=_[_0x940d('0x2b')](db[_0x940d('0x2c')]['rawAttributes'],function(_0x2884fa){return{'name':_0x2884fa[_0x940d('0x2d')],'type':_0x2884fa[_0x940d('0x2e')]['key']};});_0x2b8b74['model']=_['map'](_0x4b480d,_0x940d('0x29'));_0x2b8b74['query']=_[_0x940d('0x2f')](_0x534f70[_0x940d('0x30')]);_0x2b8b74[_0x940d('0x31')]=_[_0x940d('0x32')](_0x2b8b74[_0x940d('0x33')],_0x2b8b74[_0x940d('0x30')]);_0x4a0082[_0x940d('0x34')]=_[_0x940d('0x32')](_0x2b8b74['model'],qs[_0x940d('0x35')](_0x534f70[_0x940d('0x30')][_0x940d('0x35')]));_0x4a0082[_0x940d('0x34')]=_0x4a0082[_0x940d('0x34')][_0x940d('0x36')]?_0x4a0082[_0x940d('0x34')]:_0x2b8b74['model'];if(!_0x534f70[_0x940d('0x30')][_0x940d('0x37')]('nolimit')){_0x4a0082['limit']=qs[_0x940d('0x1d')](_0x534f70['query'][_0x940d('0x1d')]);_0x4a0082['offset']=qs[_0x940d('0x1b')](_0x534f70[_0x940d('0x30')][_0x940d('0x1b')]);}_0x4a0082['order']=qs[_0x940d('0x38')](_0x534f70[_0x940d('0x30')][_0x940d('0x38')]);_0x4a0082[_0x940d('0x39')]=qs[_0x940d('0x31')](_['pick'](_0x534f70['query'],_0x2b8b74[_0x940d('0x31')]),_0x4b480d);if(_0x534f70[_0x940d('0x30')][_0x940d('0x3a')]){_0x4a0082[_0x940d('0x39')]=_[_0x940d('0x3b')](_0x4a0082['where'],{'$or':_[_0x940d('0x2b')](_0x4b480d,function(_0x162f5e){if(_0x162f5e[_0x940d('0x2e')]!==_0x940d('0x3c')){var _0x528a57={};_0x528a57[_0x162f5e[_0x940d('0x29')]]={'$like':'%'+_0x534f70['query'][_0x940d('0x3a')]+'%'};return _0x528a57;}})});}_0x4a0082=_[_0x940d('0x3b')]({},_0x4a0082,_0x534f70['options']);var _0x34d2b8={'where':_0x4a0082[_0x940d('0x39')]};return db['ChatGroup'][_0x940d('0x1e')](_0x34d2b8)['then'](function(_0x47462e){_0x1b26a8[_0x940d('0x1e')]=_0x47462e;if(_0x534f70['query'][_0x940d('0x3d')]){_0x4a0082[_0x940d('0x3e')]=[{'all':!![]}];}return db[_0x940d('0x2c')][_0x940d('0x3f')](_0x4a0082);})[_0x940d('0x25')](function(_0x3425df){_0x1b26a8['rows']=_0x3425df;return _0x1b26a8;})[_0x940d('0x25')](respondWithFilteredResult(_0x598006,_0x4a0082))['catch'](handleError(_0x598006,null));};exports[_0x940d('0x40')]=function(_0x53daf9,_0x4d6825){var _0x3fa3d7={'raw':!![],'where':{'id':_0x53daf9[_0x940d('0x41')]['id']}},_0xea91ad={};_0xea91ad[_0x940d('0x33')]=_[_0x940d('0x2f')](db[_0x940d('0x2c')][_0x940d('0x42')]);_0xea91ad['query']=_['keys'](_0x53daf9[_0x940d('0x30')]);_0xea91ad[_0x940d('0x31')]=_[_0x940d('0x32')](_0xea91ad[_0x940d('0x33')],_0xea91ad[_0x940d('0x30')]);_0x3fa3d7[_0x940d('0x34')]=_[_0x940d('0x32')](_0xea91ad['model'],qs[_0x940d('0x35')](_0x53daf9['query'][_0x940d('0x35')]));_0x3fa3d7[_0x940d('0x34')]=_0x3fa3d7[_0x940d('0x34')][_0x940d('0x36')]?_0x3fa3d7[_0x940d('0x34')]:_0xea91ad[_0x940d('0x33')];if(_0x53daf9['query'][_0x940d('0x3d')]){_0x3fa3d7['include']=[{'all':!![]}];}_0x3fa3d7=_[_0x940d('0x3b')]({},_0x3fa3d7,_0x53daf9['options']);return db['ChatGroup'][_0x940d('0x43')](_0x3fa3d7)['then'](handleEntityNotFound(_0x4d6825,null))['then'](respondWithResult(_0x4d6825,null))[_0x940d('0x44')](handleError(_0x4d6825,null));};exports['create']=function(_0x5454b9,_0x5a6fe3){return db[_0x940d('0x2c')][_0x940d('0x45')](_0x5454b9[_0x940d('0x46')],{})[_0x940d('0x25')](respondWithResult(_0x5a6fe3,0xc9))[_0x940d('0x44')](handleError(_0x5a6fe3,null));};exports[_0x940d('0x24')]=function(_0x10c9e2,_0x48cbe7){if(_0x10c9e2['body']['id']){delete _0x10c9e2[_0x940d('0x46')]['id'];}return db[_0x940d('0x2c')][_0x940d('0x43')]({'where':{'id':_0x10c9e2[_0x940d('0x41')]['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x48cbe7,null))[_0x940d('0x25')](saveUpdates(_0x10c9e2[_0x940d('0x46')],null))['then'](respondWithResult(_0x48cbe7,null))[_0x940d('0x44')](handleError(_0x48cbe7,null));};exports[_0x940d('0x26')]=function(_0xcf87a5,_0x76e43c){return db[_0x940d('0x2c')][_0x940d('0x43')]({'where':{'id':_0xcf87a5[_0x940d('0x41')]['id']}})['then'](handleEntityNotFound(_0x76e43c,null))[_0x940d('0x25')](removeEntity(_0x76e43c,null))[_0x940d('0x44')](handleError(_0x76e43c,null));};exports[_0x940d('0x47')]=function(_0x32e352,_0x335895){return db['ChatGroup'][_0x940d('0x47')]()['then'](respondWithResult(_0x335895,null))[_0x940d('0x44')](handleError(_0x335895,null));};exports[_0x940d('0x48')]=function(_0x2d5393,_0x2eb0cb,_0x220b67){return db[_0x940d('0x49')][_0x940d('0x1e')]({'where':{'ChatGroupId':_0x2d5393[_0x940d('0x41')]['id'],'ToId':_0x2d5393[_0x940d('0x4a')]['id'],'read':![]}})['then'](function(_0x155d45){return{'id':_[_0x940d('0x4b')](_0x2d5393[_0x940d('0x41')]['id']),'count':_0x155d45};})[_0x940d('0x25')](respondWithResult(_0x2eb0cb,null))[_0x940d('0x44')](handleError(_0x2eb0cb,null));};exports[_0x940d('0x4c')]=function(_0x2fcb08,_0x3bca3e,_0x5d87b4){return db[_0x940d('0x2c')][_0x940d('0x43')]({'where':{'id':_0x2fcb08[_0x940d('0x41')]['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x3bca3e,null))[_0x940d('0x25')](function(_0x27ec70){if(_0x27ec70){return _0x27ec70[_0x940d('0x4c')](_0x2fcb08[_0x940d('0x46')][_0x940d('0x4d')],_[_0x940d('0x4e')](_0x2fcb08[_0x940d('0x46')],[_0x940d('0x4d'),'id'])||{});}})[_0x940d('0x25')](respondWithResult(_0x3bca3e,null))[_0x940d('0x44')](handleError(_0x3bca3e,null));};exports[_0x940d('0x4f')]=function(_0x21a606,_0x44c54d,_0x4a585a){var _0x452881={};var _0x5879d4={};var _0x4bc159;var _0x5b44b7;return db[_0x940d('0x2c')][_0x940d('0x50')]({'where':{'id':_0x21a606[_0x940d('0x41')]['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x44c54d,null))[_0x940d('0x25')](function(_0x43bd84){if(_0x43bd84){_0x4bc159=_0x43bd84;_0x5879d4[_0x940d('0x33')]=_[_0x940d('0x2f')](db[_0x940d('0x51')]['rawAttributes']);_0x5879d4[_0x940d('0x30')]=_[_0x940d('0x2f')](_0x21a606[_0x940d('0x30')]);_0x5879d4[_0x940d('0x31')]=_['intersection'](_0x5879d4[_0x940d('0x33')],_0x5879d4[_0x940d('0x30')]);_0x452881[_0x940d('0x34')]=_[_0x940d('0x32')](_0x5879d4[_0x940d('0x33')],qs['fields'](_0x21a606[_0x940d('0x30')]['fields']));_0x452881['attributes']=_0x452881[_0x940d('0x34')][_0x940d('0x36')]?_0x452881[_0x940d('0x34')]:_0x5879d4[_0x940d('0x33')];_0x452881[_0x940d('0x52')]=qs[_0x940d('0x38')](_0x21a606[_0x940d('0x30')][_0x940d('0x38')]);_0x452881['where']=qs[_0x940d('0x31')](_[_0x940d('0x53')](_0x21a606['query'],_0x5879d4['filters']));if(_0x21a606[_0x940d('0x30')][_0x940d('0x3a')]){_0x452881[_0x940d('0x39')]=_[_0x940d('0x3b')](_0x452881[_0x940d('0x39')],{'$or':_[_0x940d('0x2b')](_0x452881['attributes'],function(_0x30fcc7){var _0x5e4678={};_0x5e4678[_0x30fcc7]={'$like':'%'+_0x21a606['query'][_0x940d('0x3a')]+'%'};return _0x5e4678;})});}_0x452881=_[_0x940d('0x3b')]({},_0x452881,_0x21a606[_0x940d('0x54')]);return _0x4bc159['getMembers'](_0x452881);}})[_0x940d('0x25')](function(_0x5e1535){if(_0x5e1535){_0x5b44b7=_0x5e1535[_0x940d('0x36')];if(!_0x21a606[_0x940d('0x30')][_0x940d('0x37')](_0x940d('0x55'))){_0x452881[_0x940d('0x1d')]=qs['limit'](_0x21a606['query']['limit']);_0x452881[_0x940d('0x1b')]=qs['offset'](_0x21a606[_0x940d('0x30')][_0x940d('0x1b')]);}return _0x4bc159[_0x940d('0x4f')](_0x452881);}})[_0x940d('0x25')](function(_0x3f1b9b){if(_0x3f1b9b){return _0x3f1b9b?{'count':_0x5b44b7,'rows':_0x3f1b9b}:null;}})[_0x940d('0x25')](respondWithResult(_0x44c54d,null))['catch'](handleError(_0x44c54d,null));};exports['removeMembers']=function(_0x4e44e0,_0x35c5d8,_0x48e4b3){return db[_0x940d('0x2c')][_0x940d('0x43')]({'where':{'id':_0x4e44e0[_0x940d('0x41')]['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x35c5d8,null))[_0x940d('0x25')](function(_0x13dd14){if(_0x13dd14){return _0x13dd14[_0x940d('0x56')](_0x4e44e0[_0x940d('0x30')][_0x940d('0x4d')]);}})['then'](respondWithStatusCode(_0x35c5d8,null))['catch'](handleError(_0x35c5d8,null));};exports[_0x940d('0x57')]=function(_0x558f69,_0x4263bb,_0x27219c){if(_0x558f69[_0x940d('0x46')]['id']){delete _0x558f69[_0x940d('0x46')]['id'];}return db[_0x940d('0x2c')][_0x940d('0x43')]({'where':{'id':_0x558f69['params']['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x4263bb,null))[_0x940d('0x25')](function(_0x16ab5d){if(_0x16ab5d){_0x558f69['body'][_0x940d('0x58')]=_0x16ab5d['id'];return db[_0x940d('0x49')][_0x940d('0x45')](_0x558f69[_0x940d('0x46')]);}})['then'](respondWithResult(_0x4263bb,null))[_0x940d('0x44')](handleError(_0x4263bb,null));};exports['getMessages']=function(_0x12805d,_0x31307a,_0x20ba0b){var _0x1042ce={};var _0x23b15b={};var _0x34ad03;var _0x1da7f0;return db[_0x940d('0x2c')][_0x940d('0x50')]({'where':{'id':_0x12805d[_0x940d('0x41')]['id']}})[_0x940d('0x25')](handleEntityNotFound(_0x31307a,null))[_0x940d('0x25')](function(_0x3113f6){if(_0x3113f6){_0x34ad03=_0x3113f6;_0x23b15b[_0x940d('0x33')]=_[_0x940d('0x2f')](db[_0x940d('0x49')]['rawAttributes']);_0x23b15b[_0x940d('0x30')]=_['keys'](_0x12805d['query']);_0x23b15b[_0x940d('0x31')]=_[_0x940d('0x32')](_0x23b15b['model'],_0x23b15b['query']);_0x1042ce[_0x940d('0x34')]=_[_0x940d('0x32')](_0x23b15b['model'],qs[_0x940d('0x35')](_0x12805d[_0x940d('0x30')][_0x940d('0x35')]));_0x1042ce['attributes']=_0x1042ce['attributes']['length']?_0x1042ce['attributes']:_0x23b15b[_0x940d('0x33')];_0x1042ce[_0x940d('0x52')]=qs[_0x940d('0x38')](_0x12805d['query'][_0x940d('0x38')]);_0x1042ce['where']=qs[_0x940d('0x31')](_[_0x940d('0x53')](_0x12805d[_0x940d('0x30')],_0x23b15b['filters']));if(_0x12805d['query'][_0x940d('0x3a')]){_0x1042ce[_0x940d('0x39')]=_[_0x940d('0x3b')](_0x1042ce['where'],{'$or':_['map'](_0x1042ce[_0x940d('0x34')],function(_0x1133c6){var _0x4db4ad={};_0x4db4ad[_0x1133c6]={'$like':'%'+_0x12805d[_0x940d('0x30')]['filter']+'%'};return _0x4db4ad;})});}if(_0x12805d[_0x940d('0x30')]['$gte']){var _0x30ad56=_0x12805d[_0x940d('0x30')]['$gte'][_0x940d('0x59')](',');var _0xe77ab4={};_0xe77ab4[_0x30ad56[0x0]]={'$gte':moment(_0x30ad56[0x1])[_0x940d('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1042ce[_0x940d('0x39')]=_['merge'](_0x1042ce[_0x940d('0x39')],_0xe77ab4);}_0x1042ce=_[_0x940d('0x3b')]({},_0x1042ce,_0x12805d[_0x940d('0x54')]);return _0x34ad03[_0x940d('0x5b')](_0x1042ce);}})['then'](function(_0x560457){if(_0x560457){_0x1da7f0=_0x560457[_0x940d('0x36')];if(!_0x12805d[_0x940d('0x30')]['hasOwnProperty'](_0x940d('0x55'))){_0x1042ce[_0x940d('0x1d')]=qs['limit'](_0x12805d[_0x940d('0x30')][_0x940d('0x1d')]);_0x1042ce[_0x940d('0x1b')]=qs[_0x940d('0x1b')](_0x12805d[_0x940d('0x30')]['offset']);}return _0x34ad03[_0x940d('0x5b')](_0x1042ce);}})[_0x940d('0x25')](function(_0x34a400){if(_0x34a400){return _0x34a400?{'count':_0x1da7f0,'rows':_0x34a400}:null;}})['then'](respondWithResult(_0x31307a,null))[_0x940d('0x44')](handleError(_0x31307a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 91d9b11..77785aa 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 _0x3b4e=['hasOwnProperty','hook','exports','../../mysqldb','ChatGroup','remove','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3b4e,0x15a));var _0xe3b4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3b4e[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xe3b4('0x0'))['db'][_0xe3b4('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe3b4('0x2')};function emitEvent(_0x13989c){return function(_0x1151bf,_0x14d0c,_0x556eec){ChatGroupEvents[_0xe3b4('0x3')](_0x13989c+':'+_0x1151bf['id'],_0x1151bf);ChatGroupEvents[_0xe3b4('0x3')](_0x13989c,_0x1151bf);_0x556eec(null);};}for(var e in events){if(events[_0xe3b4('0x4')](e)){var event=events[e];ChatGroup[_0xe3b4('0x5')](e,emitEvent(event));}}module[_0xe3b4('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x43d6=['ChatGroup','update','remove','hasOwnProperty','hook','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43d6,0xe9));var _0x643d=function(_0x223fcd,_0x4d5c1c){_0x223fcd=_0x223fcd-0x0;var _0x403285=_0x43d6[_0x223fcd];return _0x403285;};'use strict';var EventEmitter=require(_0x643d('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x643d('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x643d('0x2'),'afterDestroy':_0x643d('0x3')};function emitEvent(_0x21f952){return function(_0x102a8a,_0x5c8b33,_0x1561f0){ChatGroupEvents['emit'](_0x21f952+':'+_0x102a8a['id'],_0x102a8a);ChatGroupEvents['emit'](_0x21f952,_0x102a8a);_0x1561f0(null);};}for(var e in events){if(events[_0x643d('0x4')](e)){var event=events[e];ChatGroup[_0x643d('0x5')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index b0b9b75..4dd344c 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 _0x86af=['../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','chat_groups','lodash','util'];(function(_0x457b2c,_0x5a1e37){var _0xe40d25=function(_0x2be7e2){while(--_0x2be7e2){_0x457b2c['push'](_0x457b2c['shift']());}};_0xe40d25(++_0x5a1e37);}(_0x86af,0xcf));var _0xf86a=function(_0x211448,_0x333996){_0x211448=_0x211448-0x0;var _0x162266=_0x86af[_0x211448];return _0x162266;};'use strict';var _=require(_0xf86a('0x0'));var util=require(_0xf86a('0x1'));var logger=require(_0xf86a('0x2'))('api');var moment=require(_0xf86a('0x3'));var BPromise=require(_0xf86a('0x4'));var rp=require(_0xf86a('0x5'));var fs=require('fs');var path=require(_0xf86a('0x6'));var rimraf=require(_0xf86a('0x7'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xf86a('0x8')]=function(_0x341276,_0x178c62){return _0x341276[_0xf86a('0x9')]('ChatGroup',attributes,{'tableName':_0xf86a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9cff=['exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9cff,0x86));var _0xf9cf=function(_0x2b1620,_0x575dab){_0x2b1620=_0x2b1620-0x0;var _0x3d55cd=_0x9cff[_0x2b1620];return _0x3d55cd;};'use strict';var _=require(_0xf9cf('0x0'));var util=require(_0xf9cf('0x1'));var logger=require(_0xf9cf('0x2'))('api');var moment=require(_0xf9cf('0x3'));var BPromise=require(_0xf9cf('0x4'));var rp=require(_0xf9cf('0x5'));var fs=require('fs');var path=require(_0xf9cf('0x6'));var rimraf=require(_0xf9cf('0x7'));var config=require(_0xf9cf('0x8'));var attributes=require(_0xf9cf('0x9'));module[_0xf9cf('0xa')]=function(_0xa027b1,_0x4cf668){return _0xa027b1[_0xf9cf('0xb')]('ChatGroup',attributes,{'tableName':'chat_groups','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 d9fe1c3..82e72d6 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 _0x487d=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x487d,0x1b4));var _0xd487=function(_0x374226,_0x56ec5c){_0x374226=_0x374226-0x0;var _0xb2e1e8=_0x487d[_0x374226];return _0xb2e1e8;};'use strict';var _=require(_0xd487('0x0'));var util=require(_0xd487('0x1'));var moment=require(_0xd487('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd487('0x3'));var db=require(_0xd487('0x4'))['db'];var utils=require(_0xd487('0x5'));var logger=require(_0xd487('0x6'))(_0xd487('0x7'));var config=require('../../config/environment');var jayson=require(_0xd487('0x8'));var client=jayson[_0xd487('0x9')]['http']({'port':0x232a});config[_0xd487('0xa')]=_[_0xd487('0xb')](config[_0xd487('0xa')],{'host':_0xd487('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd487('0xa')]));require(_0xd487('0xd'))[_0xd487('0xe')](socket);function respondWithRpcPromise(_0x5eb590,_0x5ddecc,_0x5cc2e6){return new BPromise(function(_0x47038c,_0x30f94e){return client['request'](_0x5eb590,_0x5cc2e6)[_0xd487('0xf')](function(_0x20ebbb){logger[_0xd487('0x10')](_0xd487('0x11'),_0x5ddecc,_0xd487('0x12'));logger[_0xd487('0x13')](_0xd487('0x14'),_0x5ddecc,_0xd487('0x12'),JSON['stringify'](_0x20ebbb));if(_0x20ebbb[_0xd487('0x15')]){if(_0x20ebbb[_0xd487('0x15')][_0xd487('0x16')]===0x1f4){logger[_0xd487('0x15')](_0xd487('0x11'),_0x5ddecc,_0x20ebbb[_0xd487('0x15')][_0xd487('0x17')]);return _0x30f94e(_0x20ebbb[_0xd487('0x15')][_0xd487('0x17')]);}logger[_0xd487('0x15')](_0xd487('0x11'),_0x5ddecc,_0x20ebbb[_0xd487('0x15')]['message']);return _0x47038c(_0x20ebbb[_0xd487('0x15')][_0xd487('0x17')]);}else{logger[_0xd487('0x10')](_0xd487('0x11'),_0x5ddecc,'request\x20sent');_0x47038c(_0x20ebbb[_0xd487('0x18')][_0xd487('0x17')]);}})[_0xd487('0x19')](function(_0x2027c5){logger[_0xd487('0x15')](_0xd487('0x11'),_0x5ddecc,_0x2027c5);_0x30f94e(_0x2027c5);});});} \ No newline at end of file +var _0x8c39=['request','then','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x5803cc,_0x5d09ec){var _0x2aa531=function(_0x3ce44c){while(--_0x3ce44c){_0x5803cc['push'](_0x5803cc['shift']());}};_0x2aa531(++_0x5d09ec);}(_0x8c39,0x1df));var _0x98c3=function(_0x3a4d5e,_0x33f645){_0x3a4d5e=_0x3a4d5e-0x0;var _0x32ddbd=_0x8c39[_0x3a4d5e];return _0x32ddbd;};'use strict';var _=require(_0x98c3('0x0'));var util=require('util');var moment=require(_0x98c3('0x1'));var BPromise=require(_0x98c3('0x2'));var rs=require(_0x98c3('0x3'));var fs=require('fs');var Redis=require(_0x98c3('0x4'));var db=require(_0x98c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98c3('0x6'))(_0x98c3('0x7'));var config=require(_0x98c3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x98c3('0x9')][_0x98c3('0xa')]({'port':0x232a});config['redis']=_[_0x98c3('0xb')](config['redis'],{'host':_0x98c3('0xc'),'port':0x18eb});var socket=require(_0x98c3('0xd'))(new Redis(config['redis']));require(_0x98c3('0xe'))['register'](socket);function respondWithRpcPromise(_0x536957,_0x29b268,_0x2f703a){return new BPromise(function(_0x55eeef,_0x1b7e05){return client[_0x98c3('0xf')](_0x536957,_0x2f703a)[_0x98c3('0x10')](function(_0x310c19){logger[_0x98c3('0x11')](_0x98c3('0x12'),_0x29b268,'request\x20sent');logger[_0x98c3('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x29b268,_0x98c3('0x14'),JSON[_0x98c3('0x15')](_0x310c19));if(_0x310c19[_0x98c3('0x16')]){if(_0x310c19[_0x98c3('0x16')][_0x98c3('0x17')]===0x1f4){logger['error'](_0x98c3('0x12'),_0x29b268,_0x310c19[_0x98c3('0x16')][_0x98c3('0x18')]);return _0x1b7e05(_0x310c19[_0x98c3('0x16')]['message']);}logger['error'](_0x98c3('0x12'),_0x29b268,_0x310c19['error'][_0x98c3('0x18')]);return _0x55eeef(_0x310c19[_0x98c3('0x16')][_0x98c3('0x18')]);}else{logger[_0x98c3('0x11')](_0x98c3('0x12'),_0x29b268,_0x98c3('0x14'));_0x55eeef(_0x310c19[_0x98c3('0x19')][_0x98c3('0x18')]);}})['catch'](function(_0x42d2ab){logger['error'](_0x98c3('0x12'),_0x29b268,_0x42d2ab);_0x1b7e05(_0x42d2ab);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 7b37e5a..9bf1ea0 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 _0x6472=['length','save','remove','update','emit','removeListener','register'];(function(_0x28e1e1,_0x5923c7){var _0x570707=function(_0x4ab1f6){while(--_0x4ab1f6){_0x28e1e1['push'](_0x28e1e1['shift']());}};_0x570707(++_0x5923c7);}(_0x6472,0xcc));var _0x2647=function(_0x4d3bc4,_0x46556e){_0x4d3bc4=_0x4d3bc4-0x0;var _0x42e7d3=_0x6472[_0x4d3bc4];return _0x42e7d3;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x2647('0x0'),_0x2647('0x1'),_0x2647('0x2')];function createListener(_0x4c3de3,_0x5ed20a){return function(_0x48dd18){_0x5ed20a[_0x2647('0x3')](_0x4c3de3,_0x48dd18);};}function removeListener(_0x358b59,_0x5a29d0){return function(){ChatGroupEvents[_0x2647('0x4')](_0x358b59,_0x5a29d0);};}exports[_0x2647('0x5')]=function(_0x416306){for(var _0x3f83e9=0x0,_0x99b11e=events[_0x2647('0x6')];_0x3f83e9<_0x99b11e;_0x3f83e9++){var _0x1f7039=events[_0x3f83e9];var _0x3d63e2=createListener('chatGroup:'+_0x1f7039,_0x416306);ChatGroupEvents['on'](_0x1f7039,_0x3d63e2);}}; \ No newline at end of file +var _0x3081=['length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x18fc82,_0x5693f3){var _0x3467db=function(_0xc96d8b){while(--_0xc96d8b){_0x18fc82['push'](_0x18fc82['shift']());}};_0x3467db(++_0x5693f3);}(_0x3081,0x167));var _0x1308=function(_0x57e7f2,_0x35b12d){_0x57e7f2=_0x57e7f2-0x0;var _0x2696f4=_0x3081[_0x57e7f2];return _0x2696f4;};'use strict';var ChatGroupEvents=require(_0x1308('0x0'));var events=[_0x1308('0x1'),_0x1308('0x2'),_0x1308('0x3')];function createListener(_0x40a072,_0x548529){return function(_0x4acf3d){_0x548529[_0x1308('0x4')](_0x40a072,_0x4acf3d);};}function removeListener(_0x5bb37a,_0x5bb694){return function(){ChatGroupEvents['removeListener'](_0x5bb37a,_0x5bb694);};}exports['register']=function(_0x2d8d0e){for(var _0x401695=0x0,_0x22744c=events[_0x1308('0x5')];_0x401695<_0x22744c;_0x401695++){var _0x168f44=events[_0x401695];var _0x4e611d=createListener(_0x1308('0x6')+_0x168f44,_0x2d8d0e);ChatGroupEvents['on'](_0x168f44,_0x4e611d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 082d2d7..3444636 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 _0x393c=['describe','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','create','addMembers','/:id/messages','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x393c,0xa0));var _0xc393=function(_0x474be5,_0xc9cf47){_0x474be5=_0x474be5-0x0;var _0x48cc8d=_0x393c[_0x474be5];return _0x48cc8d;};'use strict';var multer=require(_0xc393('0x0'));var util=require(_0xc393('0x1'));var path=require(_0xc393('0x2'));var timeout=require(_0xc393('0x3'));var express=require(_0xc393('0x4'));var router=express[_0xc393('0x5')]();var fs_extra=require(_0xc393('0x6'));var auth=require(_0xc393('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc393('0x8'));var controller=require(_0xc393('0x9'));router[_0xc393('0xa')]('/',auth[_0xc393('0xb')](),controller[_0xc393('0xc')]);router[_0xc393('0xa')](_0xc393('0xd'),auth[_0xc393('0xb')](),controller[_0xc393('0xe')]);router[_0xc393('0xa')]('/:id',auth[_0xc393('0xb')](),controller[_0xc393('0xf')]);router[_0xc393('0xa')](_0xc393('0x10'),auth['isAuthenticated'](),controller[_0xc393('0x11')]);router[_0xc393('0xa')](_0xc393('0x12'),auth['isAuthenticated'](),controller[_0xc393('0x13')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xc393('0x14')]);router[_0xc393('0x15')]('/',auth['isAuthenticated'](),controller[_0xc393('0x16')]);router['post'](_0xc393('0x12'),auth['isAuthenticated'](),controller[_0xc393('0x17')]);router[_0xc393('0x15')](_0xc393('0x18'),auth[_0xc393('0xb')](),controller['addMessage']);router[_0xc393('0x19')](_0xc393('0x1a'),auth[_0xc393('0xb')](),controller['update']);router['delete'](_0xc393('0x1a'),auth[_0xc393('0xb')](),controller['destroy']);router[_0xc393('0x1b')](_0xc393('0x12'),auth[_0xc393('0xb')](),controller['removeMembers']);module[_0xc393('0x1c')]=router; \ No newline at end of file +var _0xe8ac=['delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update'];(function(_0x59fae6,_0xd30af7){var _0x39fede=function(_0x27dc8b){while(--_0x27dc8b){_0x59fae6['push'](_0x59fae6['shift']());}};_0x39fede(++_0xd30af7);}(_0xe8ac,0x12a));var _0xce8a=function(_0x243f29,_0x25156a){_0x243f29=_0x243f29-0x0;var _0x44a0aa=_0xe8ac[_0x243f29];return _0x44a0aa;};'use strict';var multer=require(_0xce8a('0x0'));var util=require(_0xce8a('0x1'));var path=require(_0xce8a('0x2'));var timeout=require(_0xce8a('0x3'));var express=require(_0xce8a('0x4'));var router=express[_0xce8a('0x5')]();var fs_extra=require(_0xce8a('0x6'));var auth=require(_0xce8a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xce8a('0x8'));var controller=require(_0xce8a('0x9'));router['get']('/',auth[_0xce8a('0xa')](),controller[_0xce8a('0xb')]);router[_0xce8a('0xc')](_0xce8a('0xd'),auth[_0xce8a('0xa')](),controller[_0xce8a('0xe')]);router['get'](_0xce8a('0xf'),auth[_0xce8a('0xa')](),controller['show']);router[_0xce8a('0xc')](_0xce8a('0x10'),auth['isAuthenticated'](),controller[_0xce8a('0x11')]);router['get'](_0xce8a('0x12'),auth[_0xce8a('0xa')](),controller[_0xce8a('0x13')]);router[_0xce8a('0xc')](_0xce8a('0x14'),auth['isAuthenticated'](),controller['getMessages']);router[_0xce8a('0x15')]('/',auth['isAuthenticated'](),controller[_0xce8a('0x16')]);router[_0xce8a('0x15')](_0xce8a('0x12'),auth[_0xce8a('0xa')](),controller[_0xce8a('0x17')]);router[_0xce8a('0x15')](_0xce8a('0x14'),auth[_0xce8a('0xa')](),controller[_0xce8a('0x18')]);router['put'](_0xce8a('0xf'),auth[_0xce8a('0xa')](),controller[_0xce8a('0x19')]);router['delete']('/:id',auth[_0xce8a('0xa')](),controller['destroy']);router[_0xce8a('0x1a')]('/:id/members',auth['isAuthenticated'](),controller['removeMembers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 0dfa2ef..96b7dd0 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 _0x529f=['BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0xa726f,_0x10bfda){var _0x5b277e=function(_0x1062bd){while(--_0x1062bd){_0xa726f['push'](_0xa726f['shift']());}};_0x5b277e(++_0x10bfda);}(_0x529f,0xcd));var _0xf529=function(_0x567584,_0x4123f0){_0x567584=_0x567584-0x0;var _0x54ef74=_0x529f[_0x567584];return _0x54ef74;};'use strict';var Sequelize=require(_0xf529('0x0'));module[_0xf529('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf529('0x2')]},'ratingType':{'type':Sequelize[_0xf529('0x3')](_0xf529('0x4'),_0xf529('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xf529('0x6')]},'pathTranscript':{'type':Sequelize[_0xf529('0x6')]},'mailTranscript':{'type':Sequelize[_0xf529('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf529('0x8')]},'disposition':{'type':Sequelize[_0xf529('0x7')]},'secondDisposition':{'type':Sequelize[_0xf529('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf529('0x7')]},'browserName':{'type':Sequelize[_0xf529('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf529('0x7')]},'osVersion':{'type':Sequelize[_0xf529('0x7')]},'deviceModel':{'type':Sequelize[_0xf529('0x7')]},'deviceVendor':{'type':Sequelize[_0xf529('0x7')]},'deviceType':{'type':Sequelize[_0xf529('0x7')]},'referer':{'type':Sequelize[_0xf529('0x6')]},'customerIp':{'type':Sequelize[_0xf529('0x7')]},'formData':{'type':Sequelize[_0xf529('0x6')](_0xf529('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xf529('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf529('0x3')]('in',_0xf529('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf529('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xf529('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xf529('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x254e=['INTEGER','ENUM','thumb','star','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x254e,0x1d2));var _0xe254=function(_0xc4d98d,_0x3421e0){_0xc4d98d=_0xc4d98d-0x0;var _0x415e5f=_0x254e[_0xc4d98d];return _0x415e5f;};'use strict';var Sequelize=require(_0xe254('0x0'));module[_0xe254('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xe254('0x2')]},'ratingType':{'type':Sequelize[_0xe254('0x3')]('star',_0xe254('0x4')),'defaultValue':_0xe254('0x5')},'ratingMessage':{'type':Sequelize[_0xe254('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xe254('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xe254('0x8')]},'disposition':{'type':Sequelize[_0xe254('0x7')]},'secondDisposition':{'type':Sequelize[_0xe254('0x7')]},'thirdDisposition':{'type':Sequelize[_0xe254('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xe254('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xe254('0x7')]},'osVersion':{'type':Sequelize[_0xe254('0x7')]},'deviceModel':{'type':Sequelize[_0xe254('0x7')]},'deviceVendor':{'type':Sequelize[_0xe254('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xe254('0x7')]},'formData':{'type':Sequelize['TEXT'](_0xe254('0x9'))},'read1stAt':{'type':Sequelize[_0xe254('0x8')]},'lastMsgAt':{'type':Sequelize[_0xe254('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe254('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xe254('0x7')]},'customerPort':{'type':Sequelize[_0xe254('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xe254('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xe254('0xb')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xe254('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2bf1e74..534d410 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 _0x6c96=['create','ChatInteraction','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','user','fullname','POST','email','isNull','follow','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','closed','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','basename','download','close','mailTranscript','format','now','User','ContactId','Messages','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','keys','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','$gte','includeAll','rows','getMyMessages','pick','ChatInteractionId','includeAgent','push','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','attachments','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','osName','customerIp','customerPort','tail','createReadStream','createWriteStream','read','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','body','contact','agent','interaction','account','index','map','fieldName','key','getOptions','findAll','chat','query','show','params','model','rawAttributes','intersection','attributes','fields','length','include','options','find'];(function(_0xf74dc,_0x3d601b){var _0x201e3f=function(_0x3ff7db){while(--_0x3ff7db){_0xf74dc['push'](_0xf74dc['shift']());}};_0x201e3f(++_0x3d601b);}(_0x6c96,0x8a));var _0x66c9=function(_0x74f8ca,_0x432d65){_0x74f8ca=_0x74f8ca-0x0;var _0x57190a=_0x6c96[_0x74f8ca];return _0x57190a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x66c9('0x0'));var rp=require(_0x66c9('0x1'));var moment=require(_0x66c9('0x2'));var BPromise=require(_0x66c9('0x3'));var Mustache=require(_0x66c9('0x4'));var util=require('util');var path=require(_0x66c9('0x5'));var ejs=require(_0x66c9('0x6'));var fs=require('fs');var _=require(_0x66c9('0x7'));var Redis=require(_0x66c9('0x8'));var interaction=require(_0x66c9('0x9'));var qs=require(_0x66c9('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0x66c9('0xb'))(_0x66c9('0xc'));var config=require('../../config/environment');var db=require(_0x66c9('0xd'))['db'];config[_0x66c9('0xe')]=_[_0x66c9('0xf')](config[_0x66c9('0xe')],{'host':_0x66c9('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66c9('0xe')]));require('./chatInteraction.socket')[_0x66c9('0x11')](socket);var jayson=require(_0x66c9('0x12'));var client=jayson[_0x66c9('0x13')]['http']({'port':0x232b});var client9004=jayson['client'][_0x66c9('0x14')]({'port':0x232c});function respondWithRpcPromise(_0xec8202,_0x4851be,_0x5aed07,_0x54186e){return new BPromise(function(_0x4cac90,_0x5f5777){var _0x11270b=_0x54186e||client;return _0x11270b[_0x66c9('0x15')](_0xec8202,_0x5aed07)[_0x66c9('0x16')](function(_0x59e2da){logger[_0x66c9('0x17')](_0x66c9('0x18'),_0x4851be,_0x66c9('0x19'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x4851be,_0x66c9('0x19'),JSON['stringify'](_0x59e2da));if(_0x59e2da['error']){if(_0x59e2da[_0x66c9('0x1a')][_0x66c9('0x1b')]===0x1f4){logger['error'](_0x66c9('0x18'),_0x4851be,_0x59e2da[_0x66c9('0x1a')][_0x66c9('0x1c')]);return _0x5f5777(_0x59e2da[_0x66c9('0x1a')][_0x66c9('0x1c')]);}logger[_0x66c9('0x1a')](_0x66c9('0x18'),_0x4851be,_0x59e2da[_0x66c9('0x1a')][_0x66c9('0x1c')]);return _0x4cac90(_0x59e2da[_0x66c9('0x1a')][_0x66c9('0x1c')]);}else{logger['info'](_0x66c9('0x18'),_0x4851be,_0x66c9('0x19'));_0x4cac90(_0x59e2da[_0x66c9('0x1d')][_0x66c9('0x1c')]);}})[_0x66c9('0x1e')](function(_0x53ab0e){logger[_0x66c9('0x1a')](_0x66c9('0x18'),_0x4851be,_0x53ab0e);_0x5f5777(_0x53ab0e);});});}function respondWithStatusCode(_0x3c19d3,_0x1402bd){_0x1402bd=_0x1402bd||0xcc;return function(_0x250a99){if(_0x250a99){return _0x3c19d3['sendStatus'](_0x1402bd);}return _0x3c19d3[_0x66c9('0x1f')](_0x1402bd)[_0x66c9('0x20')]();};}function respondWithResult(_0x38ebc3,_0x3fa1b2){_0x3fa1b2=_0x3fa1b2||0xc8;return function(_0x47ce6d){if(_0x47ce6d){return _0x38ebc3[_0x66c9('0x1f')](_0x3fa1b2)[_0x66c9('0x21')](_0x47ce6d);}};}function respondWithFilteredResult(_0x306035,_0x6cabe8){return function(_0x2df0d5){if(_0x2df0d5){var _0xba0eb6=typeof _0x6cabe8[_0x66c9('0x22')]===_0x66c9('0x23')&&typeof _0x6cabe8[_0x66c9('0x24')]===_0x66c9('0x23');var _0x5c19a3=_0x2df0d5['count'];var _0x82857e=_0xba0eb6?0x0:_0x6cabe8['offset'];var _0x180b9a=_0xba0eb6?_0x2df0d5[_0x66c9('0x25')]:_0x6cabe8[_0x66c9('0x22')]+_0x6cabe8[_0x66c9('0x24')];var _0x1dfb1a;if(_0x180b9a>=_0x5c19a3){_0x180b9a=_0x5c19a3;_0x1dfb1a=0xc8;}else{_0x1dfb1a=0xce;}_0x306035[_0x66c9('0x1f')](_0x1dfb1a);return _0x306035[_0x66c9('0x26')]('Content-Range',_0x82857e+'-'+_0x180b9a+'/'+_0x5c19a3)[_0x66c9('0x21')](_0x2df0d5);}return null;};}function saveUpdates(_0x5f59f2){return function(_0x680afb){if(_0x680afb){return _0x680afb[_0x66c9('0x27')](_0x5f59f2)[_0x66c9('0x16')](function(_0x5260ce){return _0x5260ce;});}return null;};}function removeEntity(_0x3f3c08){return function(_0x1ad890){if(_0x1ad890){return _0x1ad890[_0x66c9('0x28')]()[_0x66c9('0x16')](function(){_0x3f3c08[_0x66c9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47e03a){return function(_0x3c56a1){if(!_0x3c56a1){_0x47e03a[_0x66c9('0x29')](0x194);}return _0x3c56a1;};}function handleError(_0x4c7bc7,_0x27fa31){_0x27fa31=_0x27fa31||0x1f4;return function(_0x509953){logger[_0x66c9('0x1a')](_0x509953[_0x66c9('0x2a')]);if(_0x509953[_0x66c9('0x2b')]){delete _0x509953[_0x66c9('0x2b')];}_0x4c7bc7['status'](_0x27fa31)['send'](_0x509953);};}function getMustacheRender(_0x31937d,_0x2cd8d3){return Mustache['render'](_0x31937d,_['merge'](_0x2cd8d3[_0x66c9('0x2c')],{'contact':_0x2cd8d3[_0x66c9('0x2d')],'message':_0x2cd8d3[_0x66c9('0x1c')],'agent':_0x2cd8d3[_0x66c9('0x2e')],'interaction':_0x2cd8d3[_0x66c9('0x2f')],'account':_0x2cd8d3[_0x66c9('0x30')]}))||'';}exports[_0x66c9('0x31')]=function(_0x3a5d2f,_0x30cdfb){var _0x59ad2b={};var _0x1eadda=_[_0x66c9('0x32')](db['ChatInteraction']['rawAttributes'],function(_0x57199a){return{'name':_0x57199a[_0x66c9('0x33')],'type':_0x57199a['type'][_0x66c9('0x34')]};});_0x59ad2b=qs[_0x66c9('0x35')](_0x1eadda,_0x3a5d2f);return interaction[_0x66c9('0x36')](_0x66c9('0x37'),_0x3a5d2f[_0x66c9('0x38')],_0x3a5d2f['user'],_0x59ad2b,_0x1eadda)[_0x66c9('0x16')](respondWithFilteredResult(_0x30cdfb,_0x59ad2b))[_0x66c9('0x1e')](handleError(_0x30cdfb,null));};exports[_0x66c9('0x39')]=function(_0x3d45e6,_0x1ddac9){var _0x2f689c={'raw':![],'where':{'id':_0x3d45e6[_0x66c9('0x3a')]['id']}},_0xd4bee2={};_0xd4bee2[_0x66c9('0x3b')]=_['keys'](db['ChatInteraction'][_0x66c9('0x3c')]);_0xd4bee2[_0x66c9('0x38')]=_['keys'](_0x3d45e6['query']);_0xd4bee2['filters']=_[_0x66c9('0x3d')](_0xd4bee2[_0x66c9('0x3b')],_0xd4bee2[_0x66c9('0x38')]);_0x2f689c[_0x66c9('0x3e')]=_[_0x66c9('0x3d')](_0xd4bee2[_0x66c9('0x3b')],qs['fields'](_0x3d45e6[_0x66c9('0x38')][_0x66c9('0x3f')]));_0x2f689c[_0x66c9('0x3e')]=_0x2f689c[_0x66c9('0x3e')][_0x66c9('0x40')]?_0x2f689c[_0x66c9('0x3e')]:_0xd4bee2[_0x66c9('0x3b')];if(_0x3d45e6['query']['includeAll']){_0x2f689c[_0x66c9('0x41')]=[{'all':!![]}];}_0x2f689c=_['merge']({},_0x2f689c,_0x3d45e6[_0x66c9('0x42')]);return db['ChatInteraction'][_0x66c9('0x43')](_0x2f689c)['then'](handleEntityNotFound(_0x1ddac9,null))[_0x66c9('0x16')](respondWithResult(_0x1ddac9,null))[_0x66c9('0x1e')](handleError(_0x1ddac9,null));};exports['create']=function(_0x503ca1,_0x3e33c0){return db['ChatInteraction'][_0x66c9('0x44')](_0x503ca1[_0x66c9('0x2c')],{})[_0x66c9('0x16')](respondWithResult(_0x3e33c0,0xc9))[_0x66c9('0x1e')](handleError(_0x3e33c0,null));};exports[_0x66c9('0x27')]=function(_0x17538d,_0x33cd48){if(_0x17538d[_0x66c9('0x2c')]['id']){delete _0x17538d[_0x66c9('0x2c')]['id'];}return db[_0x66c9('0x45')][_0x66c9('0x43')]({'where':{'id':_0x17538d[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x33cd48,null))[_0x66c9('0x16')](saveUpdates(_0x17538d[_0x66c9('0x2c')],null))['then'](respondWithResult(_0x33cd48,null))[_0x66c9('0x1e')](handleError(_0x33cd48,null));};exports[_0x66c9('0x28')]=function(_0x49ad6c,_0x5117f8){return db[_0x66c9('0x45')]['find']({'where':{'id':_0x49ad6c[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x5117f8,null))[_0x66c9('0x16')](removeEntity(_0x5117f8,null))[_0x66c9('0x1e')](handleError(_0x5117f8,null));};exports['describe']=function(_0xfa8398,_0xa37a2f){return db[_0x66c9('0x45')]['describe']()[_0x66c9('0x16')](respondWithResult(_0xa37a2f,null))[_0x66c9('0x1e')](handleError(_0xa37a2f,null));};exports[_0x66c9('0x46')]=function(_0x5738d1,_0x1c699c){var _0x3a9910=_0x5738d1['params']['id'];var _0x1d3a9b;var _0x581a71;var _0x3dfa62;return db[_0x66c9('0x45')]['findOne']({'where':{'id':_0x3a9910}})['then'](function(_0x954298){_0x1d3a9b=_0x954298;return db[_0x66c9('0x47')][_0x66c9('0x48')]({'where':{'id':_0x954298[_0x66c9('0x49')]},'attributes':['id','vidaooApiKey',_0x66c9('0x4a'),_0x66c9('0x4b'),_0x66c9('0x4c'),_0x66c9('0x4d')],'raw':!![]});})[_0x66c9('0x16')](function(_0x401899){if(_0x401899&&_0x401899[_0x66c9('0x4e')]&&_0x401899[_0x66c9('0x4a')]){_0x581a71=_0x401899;var _0x5bd891={'interaction':{'id':_0x3a9910},'agent':{'id':_0x5738d1[_0x66c9('0x4f')]['id'],'name':_0x5738d1[_0x66c9('0x4f')][_0x66c9('0x2b')],'fullname':_0x5738d1[_0x66c9('0x4f')][_0x66c9('0x50')],'email':_0x5738d1['user']['email']},'contact':_0x5738d1[_0x66c9('0x2c')]['contact'],'account':_0x5738d1[_0x66c9('0x2c')][_0x66c9('0x30')]};var _0x18a00e={'rejectUnauthorized':![],'method':_0x66c9('0x51'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x401899[_0x66c9('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5738d1['user'][_0x66c9('0x52')]],'buttons':null,'topic':_0x581a71[_0x66c9('0x4b')],'note':_[_0x66c9('0x53')](_0x581a71['vidaooNote'])?null:getMustacheRender(_0x581a71[_0x66c9('0x4c')],_0x5bd891),'metadata':null},'redirect':_0x66c9('0x54'),'json':!![]};try{if(!_[_0x66c9('0x53')](_0x581a71['vidaooMetadata'])){var _0x5289f2=getMustacheRender(_0x581a71[_0x66c9('0x4d')],_0x5bd891);var _0x5dae7e=JSON[_0x66c9('0x55')](_0x5289f2);_0x18a00e[_0x66c9('0x2c')]['metadata']=_0x5dae7e;}}catch(_0x39dcd3){throw new db['Sequelize'][(_0x66c9('0x56'))](_0x66c9('0x57'));}return rp(_0x18a00e);}else{throw new db[(_0x66c9('0x58'))][(_0x66c9('0x56'))](_0x66c9('0x59'));}})['then'](function(_0x41472e){_0x3dfa62=_0x41472e;if(_0x3dfa62['id']){var _0xeac868={'body':_0x3dfa62[_0x66c9('0x5a')],'ChatWebsiteId':_0x581a71['id'],'ChatInteractionId':_0x1d3a9b['id'],'direction':_0x66c9('0x5b'),'UserId':_0x5738d1['user']['id']};return db[_0x66c9('0x5c')][_0x66c9('0x44')](_0xeac868,{});}else{throw new db[(_0x66c9('0x58'))]['ValidationError'](_0x66c9('0x5d'));}})[_0x66c9('0x16')](function(){return _0x1d3a9b['updateAttributes']({'vidaooSessionId':_0x3dfa62['id']});})['then'](respondWithResult(_0x1c699c,null))[_0x66c9('0x1e')](handleError(_0x1c699c,null));};exports[_0x66c9('0x5e')]=function(_0x47094e,_0x530fec){if(_0x47094e['body']['id']){delete _0x47094e[_0x66c9('0x2c')]['id'];}return db[_0x66c9('0x45')][_0x66c9('0x43')]({'where':{'id':_0x47094e[_0x66c9('0x3a')]['id']},'include':[{'model':db[_0x66c9('0x5f')],'as':_0x66c9('0x60')}]})[_0x66c9('0x16')](handleEntityNotFound(_0x530fec,null))['then'](saveUpdates(_0x47094e['body'],null))['then'](respondWithResult(_0x530fec,null))[_0x66c9('0x1e')](handleError(_0x530fec,null));};exports['abandon']=function(_0x23a708,_0x16c5ba){if(_0x23a708[_0x66c9('0x2c')]['id']){delete _0x23a708[_0x66c9('0x2c')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x23a708[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](function(_0x4034b0){if(!_0x4034b0){logger[_0x66c9('0x1a')](_0x66c9('0x61'),_0x66c9('0x62'),0x194,_0x66c9('0x63'));_0x16c5ba[_0x66c9('0x29')](0x194);}else{if(_0x4034b0[_0x66c9('0x64')]){throw new db[(_0x66c9('0x58'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x4034b0;})[_0x66c9('0x16')](function(_0x28c310){if(_0x28c310){return _0x28c310[_0x66c9('0x27')]({'closed':_0x23a708[_0x66c9('0x2c')][_0x66c9('0x65')],'disposition':_0x23a708[_0x66c9('0x2c')]['disposition']})['then'](function(_0x502148){return _0x502148;});}})[_0x66c9('0x16')](function(){return respondWithRpcPromise(_0x66c9('0x66'),'abandon',_0x23a708[_0x66c9('0x2c')],client9004);})[_0x66c9('0x16')](respondWithResult(_0x16c5ba,null))[_0x66c9('0x1e')](handleError(_0x16c5ba,null));};exports[_0x66c9('0x67')]=function(_0x3fe64a,_0x3c4f96){_0x3fe64a[_0x66c9('0x2c')][_0x66c9('0x2b')]=_0x3fe64a[_0x66c9('0x68')][_0x66c9('0x69')];_0x3fe64a[_0x66c9('0x2c')]['basename']=_0x3fe64a[_0x66c9('0x68')][_0x66c9('0x6a')];_0x3fe64a[_0x66c9('0x2c')]['type']=_0x3fe64a[_0x66c9('0x68')][_0x66c9('0x6b')];return db[_0x66c9('0x6c')][_0x66c9('0x44')](_0x3fe64a[_0x66c9('0x2c')])[_0x66c9('0x16')](respondWithResult(_0x3c4f96,0xc9))[_0x66c9('0x1e')](handleError(_0x3c4f96,null));};exports[_0x66c9('0x6d')]=function(_0x333352,_0x40b260){return db[_0x66c9('0x45')][_0x66c9('0x48')]({'where':{'id':_0x333352[_0x66c9('0x3a')]['id']},'raw':!![]})[_0x66c9('0x16')](handleEntityNotFound(_0x40b260,null))[_0x66c9('0x16')](function(_0x58b49b){if(_0x58b49b){if(_0x58b49b['closed']){return _0x40b260[_0x66c9('0x1f')](0x193)[_0x66c9('0x21')]({'status':0x193,'message':_0x66c9('0x6e')});}return db[_0x66c9('0x6c')][_0x66c9('0x48')]({'where':{'id':_0x333352['query'][_0x66c9('0x6f')]},'raw':!![]})[_0x66c9('0x16')](handleEntityNotFound(_0x40b260,null));}})[_0x66c9('0x16')](function(_0x2027f2){if(_0x2027f2){var _0x27f268=_0x2027f2[_0x66c9('0x70')]!==null;var _0x2f9c90=path[_0x66c9('0x71')](config[_0x66c9('0x72')],'server/files/attachments/');if(_0x27f268){_0x2f9c90=path['join'](_0x2f9c90,'offline-chat/');}var _0x2ee6c1=path[_0x66c9('0x71')](_0x2f9c90,_0x2027f2[_0x66c9('0x73')]);return _0x40b260[_0x66c9('0x74')](_0x2ee6c1);}})[_0x66c9('0x1e')](handleError(_0x40b260,null));};exports[_0x66c9('0x75')]=function(_0x484468,_0x57350d){var _0x3092bf=null;var _0x1bfa8d=null;var _0x2d8218=null;if(_0x484468[_0x66c9('0x2c')]['id']){delete _0x484468[_0x66c9('0x2c')]['id'];}if(_0x484468['body'][_0x66c9('0x76')]){_0x2d8218=path['join'](config[_0x66c9('0x72')],'server/files/chat/upload/',util[_0x66c9('0x77')]('transcript-%s.txt',Date[_0x66c9('0x78')]()));_0x484468[_0x66c9('0x2c')]['pathTranscript']=_0x2d8218;}return db['ChatInteraction'][_0x66c9('0x43')]({'where':{'id':_0x484468[_0x66c9('0x3a')]['id']},'include':[{'model':db[_0x66c9('0x5c')],'as':'Messages','include':[{'model':db[_0x66c9('0x79')],'as':_0x66c9('0x79')}]}]})[_0x66c9('0x16')](handleEntityNotFound(_0x57350d,null))[_0x66c9('0x16')](saveUpdates(_0x484468[_0x66c9('0x2c')],null))[_0x66c9('0x16')](function(_0x218543){if(_0x218543){_0x3092bf=_0x218543;return db[_0x66c9('0x47')][_0x66c9('0x43')]({'where':{'id':_0x3092bf[_0x66c9('0x49')]}});}})[_0x66c9('0x16')](function(_0x1b86f5){if(_0x1b86f5){_0x1bfa8d=_0x1b86f5;return db[_0x66c9('0x5f')][_0x66c9('0x43')]({'where':{'id':_0x3092bf[_0x66c9('0x7a')]}});}})['then'](function(_0x3c13f7){if(_0x3c13f7){if(_0x2d8218){var _0x4258e8=null;for(var _0x4aec07=0x1;_0x4aec07<_0x3092bf['Messages']['length'];++_0x4aec07){_0x4258e8=_0x3092bf[_0x66c9('0x7b')][_0x4aec07];var _0xd52598=_0x4258e8['UserId']?util['format']('%s%d',_0x1bfa8d[_0x66c9('0x7c')],_0x4258e8['UserId']):_0x66c9('0x7d');var _0x30a19f=_0x484468[_0x66c9('0x2c')][_0x66c9('0x7e')]||util[_0x66c9('0x77')](_0x66c9('0x7f'),_0x66c9('0x80'),_0x4258e8[_0x66c9('0x7a')]);switch(_0x1bfa8d[_0x66c9('0x81')]){case'website_alias':_0xd52598=_0x4258e8[_0x66c9('0x64')]?util['format'](_0x66c9('0x7f'),_0x1bfa8d[_0x66c9('0x7c')],_0x4258e8[_0x66c9('0x64')]):'System';break;case _0x66c9('0x82'):_0xd52598=_0x4258e8[_0x66c9('0x64')]?_0x4258e8[_0x66c9('0x79')][_0x66c9('0x83')]||_0x4258e8[_0x66c9('0x79')][_0x66c9('0x50')]:_0x66c9('0x7d');break;case _0x66c9('0x84'):_0xd52598=_0x4258e8[_0x66c9('0x64')]?_0x4258e8[_0x66c9('0x79')][_0x66c9('0x50')]:_0x66c9('0x7d');break;default:_0xd52598=_0x4258e8[_0x66c9('0x64')]?util['format'](_0x66c9('0x7f'),_0x1bfa8d[_0x66c9('0x7c')],_0x4258e8['UserId']):'System';}var _0x3d3bf8=util['format'](_0x66c9('0x85'),moment(_0x4258e8[_0x66c9('0x86')])[_0x66c9('0x77')](_0x66c9('0x87')),_0x4258e8[_0x66c9('0x88')]==='in'?_0x30a19f:_0xd52598,_0x4258e8[_0x66c9('0x2c')]);if(!_0x4258e8[_0x66c9('0x89')]){fs[_0x66c9('0x8a')](_0x2d8218,_0x3d3bf8);}}return db[_0x66c9('0x8b')][_0x66c9('0x48')]({'where':{'service':!![]},'include':[{'model':db[_0x66c9('0x8c')],'as':_0x66c9('0x8d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x66c9('0x8e'),'raw':!![]}]}]});}}})[_0x66c9('0x16')](function(_0x2ebd91){if(!_0x2ebd91||!_0x2ebd91[_0x66c9('0x8d')]||!_0x484468['body'])return _0x3092bf;var _0x23a139=_0x2ebd91['getSmtpOptions']();return respondWithRpcPromise(_0x66c9('0x8f'),_0x66c9('0x90'),{'account':_0x23a139,'message':{'from':util[_0x66c9('0x77')](_0x66c9('0x91'),_0x2ebd91['name'],_0x2ebd91[_0x66c9('0x52')]||_0x2ebd91['Smtp'][_0x66c9('0x4f')]),'to':_0x484468[_0x66c9('0x2c')][_0x66c9('0x76')],'subject':_0x66c9('0x92'),'text':util['format'](_0x66c9('0x93'),_0x484468[_0x66c9('0x2c')][_0x66c9('0x76')]),'attachments':[{'path':_0x2d8218}]}})[_0x66c9('0x16')](function(){return _0x3092bf;})[_0x66c9('0x1e')](function(_0x38074a){logger[_0x66c9('0x1a')](_0x38074a);});})[_0x66c9('0x16')](respondWithStatusCode(_0x57350d,0xc8))[_0x66c9('0x1e')](handleError(_0x57350d,null));};exports[_0x66c9('0x94')]=function(_0x1d285f,_0x5d4048){return db['ChatMessage']['find']({'where':{'id':_0x1d285f[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x5d4048,null))[_0x66c9('0x16')](function(_0x206883){if(_0x206883){return _0x206883['addMessage'](_0x1d285f[_0x66c9('0x2c')][_0x66c9('0x95')],_[_0x66c9('0x96')](_0x1d285f[_0x66c9('0x2c')],[_0x66c9('0x95'),'id'])||{});}})['then'](respondWithResult(_0x5d4048,null))[_0x66c9('0x1e')](handleError(_0x5d4048,null));};exports[_0x66c9('0x97')]=function(_0xe7724a,_0x2da9cb){var _0x631f91={'raw':![],'where':{}};var _0x42fd31={};var _0x10d3f7={'count':0x0,'rows':[]};return db[_0x66c9('0x45')][_0x66c9('0x48')]({'where':{'id':_0xe7724a[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x2da9cb,null))[_0x66c9('0x16')](function(_0x16a1bd){if(_0x16a1bd){_0x42fd31[_0x66c9('0x3b')]=_[_0x66c9('0x98')](db[_0x66c9('0x5c')]['rawAttributes']);_0x42fd31[_0x66c9('0x38')]=_[_0x66c9('0x98')](_0xe7724a[_0x66c9('0x38')]);_0x42fd31['filters']=_[_0x66c9('0x3d')](_0x42fd31[_0x66c9('0x3b')],_0x42fd31[_0x66c9('0x38')]);_0x631f91[_0x66c9('0x3e')]=_['intersection'](_0x42fd31['model'],qs[_0x66c9('0x3f')](_0xe7724a[_0x66c9('0x38')][_0x66c9('0x3f')]));_0x631f91[_0x66c9('0x3e')]=_0x631f91[_0x66c9('0x3e')][_0x66c9('0x40')]?_0x631f91[_0x66c9('0x3e')]:_0x42fd31['model'];if(!_0xe7724a[_0x66c9('0x38')][_0x66c9('0x99')](_0x66c9('0x9a'))){_0x631f91[_0x66c9('0x24')]=qs[_0x66c9('0x24')](_0xe7724a['query'][_0x66c9('0x24')]);_0x631f91['offset']=qs[_0x66c9('0x22')](_0xe7724a['query'][_0x66c9('0x22')]);}_0x631f91[_0x66c9('0x9b')]=qs['sort'](_0xe7724a[_0x66c9('0x38')][_0x66c9('0x9c')]);_0x631f91[_0x66c9('0x9d')]=qs['filters'](_['pick'](_0xe7724a[_0x66c9('0x38')],_0x42fd31[_0x66c9('0x9e')]));_0x631f91['where']['ChatInteractionId']=_0x16a1bd['id'];if(_0xe7724a[_0x66c9('0x38')][_0x66c9('0x9f')]){_0x631f91[_0x66c9('0x9d')]=_[_0x66c9('0xa0')](_0x631f91[_0x66c9('0x9d')],{'$or':_['map'](_0x631f91[_0x66c9('0x3e')],function(_0x261a2b){var _0x36d5ec={};_0x36d5ec[_0x261a2b]={'$like':'%'+_0xe7724a[_0x66c9('0x38')][_0x66c9('0x9f')]+'%'};return _0x36d5ec;})});}if(_0xe7724a['query'][_0x66c9('0xa1')]){var _0x9dedc3=_0xe7724a[_0x66c9('0x38')][_0x66c9('0xa1')]['split'](',');var _0x562ac8={};_0x562ac8[_0x9dedc3[0x0]]={'$gte':moment(_0x9dedc3[0x1])[_0x66c9('0x77')]('YYYY-MM-DD\x20HH:mm:ss')};_0x631f91[_0x66c9('0x9d')]=_[_0x66c9('0xa0')](_0x631f91[_0x66c9('0x9d')],_0x562ac8);}_0x631f91=_[_0x66c9('0xa0')]({},_0x631f91,_0xe7724a['options']);return db[_0x66c9('0x5c')][_0x66c9('0x25')]({'where':_0x631f91[_0x66c9('0x9d')]})['then'](function(_0x5ab131){_0x10d3f7[_0x66c9('0x25')]=_0x5ab131;if(_0xe7724a[_0x66c9('0x38')][_0x66c9('0xa2')]){_0x631f91[_0x66c9('0x41')]=[{'all':!![]}];}return db[_0x66c9('0x5c')]['findAll'](_0x631f91);})[_0x66c9('0x16')](function(_0x3e93ce){_0x10d3f7[_0x66c9('0xa3')]=_0x3e93ce;return _0x10d3f7;});}})['then'](respondWithFilteredResult(_0x2da9cb,_0x631f91))[_0x66c9('0x1e')](handleError(_0x2da9cb,null));};exports[_0x66c9('0xa4')]=function(_0x12a146,_0x3a75a3){var _0x652c03={'where':{}},_0x4ad81b={},_0x1fb350={'count':0x0,'rows':[]};return db[_0x66c9('0x45')][_0x66c9('0x48')]({'where':{'id':_0x12a146[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x3a75a3,null))[_0x66c9('0x16')](function(_0x3d7766){if(_0x3d7766){_0x4ad81b[_0x66c9('0x3b')]=_['keys'](db[_0x66c9('0x5c')][_0x66c9('0x3c')]);_0x4ad81b[_0x66c9('0x38')]=_[_0x66c9('0x98')](_0x12a146['query']);_0x4ad81b[_0x66c9('0x9e')]=_[_0x66c9('0x3d')](_0x4ad81b[_0x66c9('0x3b')],_0x4ad81b[_0x66c9('0x38')]);_0x652c03[_0x66c9('0x3e')]=_[_0x66c9('0x3d')](_0x4ad81b[_0x66c9('0x3b')],qs[_0x66c9('0x3f')](_0x12a146[_0x66c9('0x38')]['fields']));_0x652c03[_0x66c9('0x3e')]=_0x652c03['attributes'][_0x66c9('0x40')]?_0x652c03[_0x66c9('0x3e')]:_0x4ad81b[_0x66c9('0x3b')];if(!_0x12a146['query'][_0x66c9('0x99')](_0x66c9('0x9a'))){_0x652c03['limit']=qs[_0x66c9('0x24')](_0x12a146[_0x66c9('0x38')][_0x66c9('0x24')]);_0x652c03[_0x66c9('0x22')]=qs[_0x66c9('0x22')](_0x12a146['query'][_0x66c9('0x22')]);}_0x652c03[_0x66c9('0x9b')]=qs[_0x66c9('0x9c')](_0x12a146[_0x66c9('0x38')][_0x66c9('0x9c')]);_0x652c03[_0x66c9('0x9d')]=qs[_0x66c9('0x9e')](_[_0x66c9('0xa5')](_0x12a146[_0x66c9('0x38')],_0x4ad81b['filters']));_0x652c03['where'][_0x66c9('0xa6')]=_0x3d7766['id'];if(_0x12a146[_0x66c9('0x38')][_0x66c9('0x9f')]){_0x652c03[_0x66c9('0x9d')]=_['merge'](_0x652c03['where'],{'$or':_[_0x66c9('0x32')](_0x652c03[_0x66c9('0x3e')],function(_0x602d45){var _0x4e8a64={};_0x4e8a64[_0x602d45]={'$like':'%'+_0x12a146[_0x66c9('0x38')][_0x66c9('0x9f')]+'%'};return _0x4e8a64;})});}_0x652c03[_0x66c9('0x9d')][_0x66c9('0x89')]=![];if(_0x12a146[_0x66c9('0x38')]['id']){_0x652c03[_0x66c9('0x9d')]['id']={'$gt':_0x12a146[_0x66c9('0x38')]['id']};}_0x652c03=_[_0x66c9('0xa0')]({},_0x652c03,_0x12a146['options']);return db['ChatMessage'][_0x66c9('0x25')]({'where':_0x652c03[_0x66c9('0x9d')]})[_0x66c9('0x16')](function(_0x571357){_0x1fb350[_0x66c9('0x25')]=_0x571357;_0x652c03[_0x66c9('0x41')]=[];if(_0x12a146['query'][_0x66c9('0xa7')]){_0x652c03[_0x66c9('0x41')][_0x66c9('0xa8')]({'model':db[_0x66c9('0x79')],'as':_0x66c9('0x79'),'attributes':['id',_0x66c9('0x50'),_0x66c9('0x83')]});}if(_0x12a146[_0x66c9('0x38')][_0x66c9('0xa2')]){_0x652c03['include']=[{'all':!![]}];}return db['ChatMessage'][_0x66c9('0x36')](_0x652c03);})[_0x66c9('0x16')](function(_0x6603fd){_0x1fb350[_0x66c9('0xa3')]=_0x6603fd;return _0x1fb350;});}})[_0x66c9('0x16')](respondWithFilteredResult(_0x3a75a3,_0x652c03))[_0x66c9('0x1e')](handleError(_0x3a75a3,null));};exports[_0x66c9('0xa9')]=function(_0x1efe57,_0x14f299){return db['ChatInteraction'][_0x66c9('0x43')]({'where':{'id':_0x1efe57[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x14f299,null))[_0x66c9('0x16')](function(_0x4dfe57){if(_0x4dfe57){return _0x4dfe57[_0x66c9('0xaa')](_0x1efe57[_0x66c9('0x2c')][_0x66c9('0x95')],_[_0x66c9('0x96')](_0x1efe57[_0x66c9('0x2c')],[_0x66c9('0x95'),'id'])||{})[_0x66c9('0xab')](function(){return db[_0x66c9('0xac')][_0x66c9('0x36')]({'attributes':['id',_0x66c9('0x2b'),_0x66c9('0xad')],'where':{'id':_0x1efe57[_0x66c9('0x2c')][_0x66c9('0x95')]}});})[_0x66c9('0x16')](function(_0x388e9b){socket[_0x66c9('0xae')](_0x66c9('0xaf'),{'id':Number(_0x1efe57[_0x66c9('0x3a')]['id']),'tags':_0x388e9b||[]});return{'id':Number(_0x1efe57[_0x66c9('0x3a')]['id']),'tags':_0x388e9b||[]};});}})['then'](respondWithResult(_0x14f299,null))[_0x66c9('0x1e')](handleError(_0x14f299,null));};exports['removeTags']=function(_0x54b15e,_0x1a6196){return db[_0x66c9('0x45')][_0x66c9('0x43')]({'where':{'id':_0x54b15e[_0x66c9('0x3a')]['id']}})[_0x66c9('0x16')](handleEntityNotFound(_0x1a6196,null))[_0x66c9('0x16')](function(_0x525748){if(_0x525748){return _0x525748[_0x66c9('0xb0')](_0x54b15e[_0x66c9('0x38')][_0x66c9('0x95')]);}})[_0x66c9('0x16')](respondWithStatusCode(_0x1a6196,null))[_0x66c9('0x1e')](handleError(_0x1a6196,null));};exports['download']=function(_0x5834c4,_0x6f7d46){var _0x17810e=moment()[_0x66c9('0xb1')]()[_0x66c9('0xb2')]();var _0x2329d6=path[_0x66c9('0x71')](config[_0x66c9('0x72')],_0x66c9('0xb3'),_0x66c9('0xb4'),_0x66c9('0xb5'));var _0x137e75=path[_0x66c9('0x71')](config[_0x66c9('0x72')],_0x66c9('0xb3'),'files',_0x66c9('0xb6'));var _0x4d02ec=path['join'](_0x2329d6,_0x17810e);var _0x122e75=util[_0x66c9('0x77')]('transcript-%d-%s.zip',_0x5834c4[_0x66c9('0x3a')]['id'],_0x17810e);var _0x47a2fc=path[_0x66c9('0x71')](_0x2329d6,_0x122e75);var _0x228fa8=[];_0x228fa8[_0x66c9('0xa8')]({'model':db['User'],'as':'User','attributes':['id',_0x66c9('0x50')],'raw':!![]});_0x228fa8[_0x66c9('0xa8')]({'model':db[_0x66c9('0x5f')],'as':_0x66c9('0x60'),'attributes':['id',_0x66c9('0xb7'),_0x66c9('0xb8')],'raw':!![]});if(_0x5834c4[_0x66c9('0x38')][_0x66c9('0xb6')]){_0x228fa8[_0x66c9('0xa8')]({'model':db[_0x66c9('0x6c')],'as':_0x66c9('0x6c'),'raw':!![]});}var _0x5c7d14=[{'model':db[_0x66c9('0x5c')],'as':_0x66c9('0x7b'),'attributes':['id',_0x66c9('0x2c'),'createdAt',_0x66c9('0x88'),'secret','read'],'include':_0x228fa8}];_0x5c7d14[_0x66c9('0xa8')]({'model':db[_0x66c9('0x47')],'as':_0x66c9('0xb9'),'attributes':['id',_0x66c9('0x2b')]});_0x5c7d14['push']({'model':db[_0x66c9('0x79')],'as':_0x66c9('0xba'),'attributes':['id','fullname']});return db[_0x66c9('0x45')][_0x66c9('0x43')]({'where':{'id':_0x5834c4[_0x66c9('0x3a')]['id']},'include':_0x5c7d14})[_0x66c9('0x16')](handleEntityNotFound(_0x6f7d46,null))[_0x66c9('0x16')](function(_0x1d6cd2){if(_0x1d6cd2){var _0x1abc15=_0x1d6cd2[_0x66c9('0xbb')]({'plain':!![]});fs[_0x66c9('0xbc')](_0x4d02ec);var _0x19381b={'channel':_0x66c9('0xbd'),'account':_0x1abc15[_0x66c9('0xb9')][_0x66c9('0x2b')],'agent':_0x1abc15[_0x66c9('0xba')]?_0x1abc15['Owner'][_0x66c9('0x50')]:_0x66c9('0xbe'),'createdAt':moment(_0x1abc15['createdAt'])[_0x66c9('0x77')](_0x66c9('0xbf'))[_0x66c9('0xb2')](),'closedAt':_0x1abc15['closed']?moment(_0x1abc15[_0x66c9('0xc0')])[_0x66c9('0x77')]('YYYY-MM-DD\x20HH:mm:ss')[_0x66c9('0xb2')]():'','disposition':_0x1abc15['disposition'],'chatInfo':{'browser':_0x1abc15['browserName'],'os':_0x1abc15[_0x66c9('0xc1')],'referer':_0x1abc15['referer'],'customerIp':_0x1abc15[_0x66c9('0xc2')],'customerPort':_0x1abc15[_0x66c9('0xc3')]?_0x1abc15['customerPort']:_0x66c9('0xbe')},'messages':_(_0x1abc15[_0x66c9('0x7b')])[_0x66c9('0xc4')]()[_0x66c9('0x9f')]({'secret':![]})['map'](function(_0xab17b7){if(_0xab17b7[_0x66c9('0x6c')]){var _0x4612ee=path[_0x66c9('0x71')](_0x137e75,_0xab17b7[_0x66c9('0x6c')][_0x66c9('0x73')]);if(fs['existsSync'](_0x4612ee)){fs[_0x66c9('0xc5')](_0x4612ee)['pipe'](fs[_0x66c9('0xc6')](path[_0x66c9('0x71')](_0x4d02ec,_0xab17b7[_0x66c9('0x6c')][_0x66c9('0x73')])));}}return{'date':moment(_0xab17b7[_0x66c9('0x86')])[_0x66c9('0x77')](_0x66c9('0xbf'))[_0x66c9('0xb2')](),'sender':_0xab17b7[_0x66c9('0x88')]===_0x66c9('0x5b')?_0xab17b7[_0x66c9('0x79')]?_0xab17b7['User'][_0x66c9('0x50')]:_0x66c9('0x7d'):_0xab17b7[_0x66c9('0x60')][_0x66c9('0xb7')]+(_0xab17b7['Contact'][_0x66c9('0xb8')]?'\x20'+_0xab17b7[_0x66c9('0x60')]['lastName']:''),'body':_0xab17b7[_0x66c9('0x6c')]?_0xab17b7[_0x66c9('0x6c')][_0x66c9('0x73')]:_0xab17b7['body'],'direction':_0xab17b7[_0x66c9('0x88')]===_0x66c9('0x5b')?'A':'C','secret':_0xab17b7['secret'],'read':_0xab17b7[_0x66c9('0xc7')],'attachment':_0xab17b7[_0x66c9('0x6c')]};})[_0x66c9('0xc8')]()};return ejs[_0x66c9('0xc9')](path[_0x66c9('0x71')](config[_0x66c9('0x72')],_0x66c9('0xb3'),_0x66c9('0xca'),_0x66c9('0xcb')),{'interaction':_0x19381b})['then'](function(_0x34eadd){var _0x20d9c0=path[_0x66c9('0x71')](_0x4d02ec,_0x66c9('0xcc')+_0x1abc15['id']+'-'+_0x17810e+'.pdf');var _0x4c6480={'path':_0x20d9c0,'channel':'Chat','interactionId':_0x1abc15['id']};return pdf[_0x66c9('0xcd')](_0x34eadd,_0x4c6480);})[_0x66c9('0x16')](function(){return new Promise(function(_0x4b3e97,_0x3337ff){zipdir(_0x4d02ec,{'saveTo':_0x47a2fc},function(_0x2c4d34,_0xc39123){if(_0x2c4d34)return _0x3337ff(_0x2c4d34);return _0x4b3e97(_0xc39123);});})[_0x66c9('0x16')](function(){return new BPromise(function(_0x7c65a4,_0x318bc9){rimraf(_0x4d02ec,function(_0xb10853){if(_0xb10853)_0x318bc9(_0xb10853);return _0x7c65a4();});});})[_0x66c9('0x16')](function(){return _0x6f7d46[_0x66c9('0x74')](_0x47a2fc,_0x122e75,function(_0x109eed){if(_0x109eed){logger[_0x66c9('0x1a')]('err',_0x109eed);}else{fs['unlinkSync'](_0x47a2fc);}});});});}else{return _0x6f7d46['sendStatus'](0xc8);}})[_0x66c9('0x1e')](handleError(_0x6f7d46,null));}; \ No newline at end of file +var _0x3904=['ContactId','agentIdentifier','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','CloudProvider','SendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','keys','filters','nolimit','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','options','include','includeAgent','push','addTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','read','Account','Chat','Owner','N.A.','closedAt','osName','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','lastName','value','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','end','json','offset','limit','count','status','set','Content-Range','update','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','findAll','chat','query','user','show','params','model','attributes','intersection','fields','length','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','disposition','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','now','pathTranscript','Messages','User','agentAlias','System','customer','%s%d'];(function(_0x1ab82b,_0x4b2e77){var _0x176a39=function(_0x469035){while(--_0x469035){_0x1ab82b['push'](_0x1ab82b['shift']());}};_0x176a39(++_0x4b2e77);}(_0x3904,0x1e7));var _0x4390=function(_0x216e58,_0x497adc){_0x216e58=_0x216e58-0x0;var _0x5adcad=_0x3904[_0x216e58];return _0x5adcad;};'use strict';var rimraf=require(_0x4390('0x0'));var zipdir=require(_0x4390('0x1'));var rp=require(_0x4390('0x2'));var moment=require('moment');var BPromise=require(_0x4390('0x3'));var Mustache=require(_0x4390('0x4'));var util=require(_0x4390('0x5'));var path=require(_0x4390('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4390('0x7'));var Redis=require(_0x4390('0x8'));var interaction=require(_0x4390('0x9'));var qs=require(_0x4390('0xa'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x4390('0xb'));var config=require(_0x4390('0xc'));var db=require('../../mysqldb')['db'];config[_0x4390('0xd')]=_[_0x4390('0xe')](config['redis'],{'host':_0x4390('0xf'),'port':0x18eb});var socket=require(_0x4390('0x10'))(new Redis(config['redis']));require(_0x4390('0x11'))[_0x4390('0x12')](socket);var jayson=require(_0x4390('0x13'));var client=jayson[_0x4390('0x14')][_0x4390('0x15')]({'port':0x232b});var client9004=jayson[_0x4390('0x14')][_0x4390('0x15')]({'port':0x232c});function respondWithRpcPromise(_0xf5bfc3,_0x290829,_0x281ca8,_0x5d6c54){return new BPromise(function(_0x254195,_0x1bf9b6){var _0x51cdf8=_0x5d6c54||client;return _0x51cdf8['request'](_0xf5bfc3,_0x281ca8)[_0x4390('0x16')](function(_0x4bc56e){logger['info'](_0x4390('0x17'),_0x290829,'request\x20sent');logger[_0x4390('0x18')](_0x4390('0x19'),_0x290829,_0x4390('0x1a'),JSON['stringify'](_0x4bc56e));if(_0x4bc56e[_0x4390('0x1b')]){if(_0x4bc56e[_0x4390('0x1b')][_0x4390('0x1c')]===0x1f4){logger[_0x4390('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x290829,_0x4bc56e[_0x4390('0x1b')][_0x4390('0x1d')]);return _0x1bf9b6(_0x4bc56e[_0x4390('0x1b')][_0x4390('0x1d')]);}logger[_0x4390('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x290829,_0x4bc56e[_0x4390('0x1b')][_0x4390('0x1d')]);return _0x254195(_0x4bc56e[_0x4390('0x1b')][_0x4390('0x1d')]);}else{logger['info'](_0x4390('0x17'),_0x290829,_0x4390('0x1a'));_0x254195(_0x4bc56e['result'][_0x4390('0x1d')]);}})[_0x4390('0x1e')](function(_0x7e7b92){logger[_0x4390('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x290829,_0x7e7b92);_0x1bf9b6(_0x7e7b92);});});}function respondWithStatusCode(_0x2f04d6,_0x34d316){_0x34d316=_0x34d316||0xcc;return function(_0x4f99a6){if(_0x4f99a6){return _0x2f04d6['sendStatus'](_0x34d316);}return _0x2f04d6['status'](_0x34d316)[_0x4390('0x1f')]();};}function respondWithResult(_0x229381,_0x4567d8){_0x4567d8=_0x4567d8||0xc8;return function(_0x5e5eee){if(_0x5e5eee){return _0x229381['status'](_0x4567d8)[_0x4390('0x20')](_0x5e5eee);}};}function respondWithFilteredResult(_0x5b870c,_0x183cc4){return function(_0x4120da){if(_0x4120da){var _0x22f20a=typeof _0x183cc4[_0x4390('0x21')]==='undefined'&&typeof _0x183cc4[_0x4390('0x22')]==='undefined';var _0x41b8c6=_0x4120da['count'];var _0x50860e=_0x22f20a?0x0:_0x183cc4[_0x4390('0x21')];var _0x51d6ec=_0x22f20a?_0x4120da[_0x4390('0x23')]:_0x183cc4[_0x4390('0x21')]+_0x183cc4[_0x4390('0x22')];var _0x4e5004;if(_0x51d6ec>=_0x41b8c6){_0x51d6ec=_0x41b8c6;_0x4e5004=0xc8;}else{_0x4e5004=0xce;}_0x5b870c[_0x4390('0x24')](_0x4e5004);return _0x5b870c[_0x4390('0x25')](_0x4390('0x26'),_0x50860e+'-'+_0x51d6ec+'/'+_0x41b8c6)[_0x4390('0x20')](_0x4120da);}return null;};}function saveUpdates(_0x1a59c0){return function(_0x56be01){if(_0x56be01){return _0x56be01[_0x4390('0x27')](_0x1a59c0)[_0x4390('0x16')](function(_0xa6f84c){return _0xa6f84c;});}return null;};}function removeEntity(_0x50c3b5){return function(_0x1fa2b3){if(_0x1fa2b3){return _0x1fa2b3['destroy']()[_0x4390('0x16')](function(){_0x50c3b5['status'](0xcc)[_0x4390('0x1f')]();});}};}function handleEntityNotFound(_0x1162b5){return function(_0xd28917){if(!_0xd28917){_0x1162b5['sendStatus'](0x194);}return _0xd28917;};}function handleError(_0x39f038,_0xdbf86d){_0xdbf86d=_0xdbf86d||0x1f4;return function(_0x24fd23){logger['error'](_0x24fd23['stack']);if(_0x24fd23[_0x4390('0x28')]){delete _0x24fd23['name'];}_0x39f038['status'](_0xdbf86d)[_0x4390('0x29')](_0x24fd23);};}function getMustacheRender(_0x5adf7a,_0x79d79a){return Mustache[_0x4390('0x2a')](_0x5adf7a,_[_0x4390('0x2b')](_0x79d79a[_0x4390('0x2c')],{'contact':_0x79d79a[_0x4390('0x2d')],'message':_0x79d79a[_0x4390('0x1d')],'agent':_0x79d79a[_0x4390('0x2e')],'interaction':_0x79d79a[_0x4390('0x2f')],'account':_0x79d79a[_0x4390('0x30')]}))||'';}exports[_0x4390('0x31')]=function(_0x45161d,_0x14b52c){var _0x1418c6={};var _0x2d8faa=_[_0x4390('0x32')](db[_0x4390('0x33')][_0x4390('0x34')],function(_0x2e4938){return{'name':_0x2e4938[_0x4390('0x35')],'type':_0x2e4938[_0x4390('0x36')]['key']};});_0x1418c6=qs['getOptions'](_0x2d8faa,_0x45161d);return interaction[_0x4390('0x37')](_0x4390('0x38'),_0x45161d[_0x4390('0x39')],_0x45161d[_0x4390('0x3a')],_0x1418c6,_0x2d8faa)[_0x4390('0x16')](respondWithFilteredResult(_0x14b52c,_0x1418c6))['catch'](handleError(_0x14b52c,null));};exports[_0x4390('0x3b')]=function(_0x2bb299,_0x39c065){var _0x3d0c12={'raw':![],'where':{'id':_0x2bb299[_0x4390('0x3c')]['id']}},_0x4b8c41={};_0x4b8c41[_0x4390('0x3d')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x4b8c41[_0x4390('0x39')]=_['keys'](_0x2bb299['query']);_0x4b8c41['filters']=_['intersection'](_0x4b8c41[_0x4390('0x3d')],_0x4b8c41[_0x4390('0x39')]);_0x3d0c12[_0x4390('0x3e')]=_[_0x4390('0x3f')](_0x4b8c41[_0x4390('0x3d')],qs[_0x4390('0x40')](_0x2bb299[_0x4390('0x39')]['fields']));_0x3d0c12[_0x4390('0x3e')]=_0x3d0c12[_0x4390('0x3e')][_0x4390('0x41')]?_0x3d0c12[_0x4390('0x3e')]:_0x4b8c41[_0x4390('0x3d')];if(_0x2bb299[_0x4390('0x39')][_0x4390('0x42')]){_0x3d0c12['include']=[{'all':!![]}];}_0x3d0c12=_[_0x4390('0x2b')]({},_0x3d0c12,_0x2bb299['options']);return db[_0x4390('0x33')][_0x4390('0x43')](_0x3d0c12)[_0x4390('0x16')](handleEntityNotFound(_0x39c065,null))[_0x4390('0x16')](respondWithResult(_0x39c065,null))[_0x4390('0x1e')](handleError(_0x39c065,null));};exports['create']=function(_0x4dc47b,_0x5d0490){return db[_0x4390('0x33')]['create'](_0x4dc47b[_0x4390('0x2c')],{})[_0x4390('0x16')](respondWithResult(_0x5d0490,0xc9))['catch'](handleError(_0x5d0490,null));};exports['update']=function(_0x187065,_0x537e9c){if(_0x187065['body']['id']){delete _0x187065[_0x4390('0x2c')]['id'];}return db['ChatInteraction'][_0x4390('0x43')]({'where':{'id':_0x187065[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0x537e9c,null))[_0x4390('0x16')](saveUpdates(_0x187065[_0x4390('0x2c')],null))['then'](respondWithResult(_0x537e9c,null))[_0x4390('0x1e')](handleError(_0x537e9c,null));};exports[_0x4390('0x44')]=function(_0x5fb5a9,_0x4cfef2){return db[_0x4390('0x33')][_0x4390('0x43')]({'where':{'id':_0x5fb5a9[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0x4cfef2,null))[_0x4390('0x16')](removeEntity(_0x4cfef2,null))[_0x4390('0x1e')](handleError(_0x4cfef2,null));};exports[_0x4390('0x45')]=function(_0x543999,_0xfbe791){return db[_0x4390('0x33')]['describe']()[_0x4390('0x16')](respondWithResult(_0xfbe791,null))['catch'](handleError(_0xfbe791,null));};exports[_0x4390('0x46')]=function(_0x36c473,_0x11caae){var _0x2e2afb=_0x36c473[_0x4390('0x3c')]['id'];var _0x3b9566;var _0x54ddf0;var _0x1cd0bb;return db[_0x4390('0x33')][_0x4390('0x47')]({'where':{'id':_0x2e2afb}})[_0x4390('0x16')](function(_0x37184c){_0x3b9566=_0x37184c;return db[_0x4390('0x48')]['findOne']({'where':{'id':_0x37184c[_0x4390('0x49')]},'attributes':['id',_0x4390('0x4a'),'vidaooEscalation','vidaooTopic',_0x4390('0x4b'),_0x4390('0x4c')],'raw':!![]});})[_0x4390('0x16')](function(_0x4ac96c){if(_0x4ac96c&&_0x4ac96c['vidaooApiKey']&&_0x4ac96c[_0x4390('0x4d')]){_0x54ddf0=_0x4ac96c;var _0x35cc5d={'interaction':{'id':_0x2e2afb},'agent':{'id':_0x36c473[_0x4390('0x3a')]['id'],'name':_0x36c473[_0x4390('0x3a')][_0x4390('0x28')],'fullname':_0x36c473[_0x4390('0x3a')][_0x4390('0x4e')],'email':_0x36c473[_0x4390('0x3a')][_0x4390('0x4f')]},'contact':_0x36c473['body'][_0x4390('0x2d')],'account':_0x36c473[_0x4390('0x2c')][_0x4390('0x30')]};var _0x5caea8={'rejectUnauthorized':![],'method':_0x4390('0x50'),'url':_0x4390('0x51'),'headers':{'X-APIKEY':_0x4ac96c[_0x4390('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x36c473[_0x4390('0x3a')][_0x4390('0x4f')]],'buttons':null,'topic':_0x54ddf0['vidaooTopic'],'note':_[_0x4390('0x52')](_0x54ddf0[_0x4390('0x4b')])?null:getMustacheRender(_0x54ddf0['vidaooNote'],_0x35cc5d),'metadata':null},'redirect':_0x4390('0x53'),'json':!![]};try{if(!_[_0x4390('0x52')](_0x54ddf0[_0x4390('0x4c')])){var _0x525947=getMustacheRender(_0x54ddf0[_0x4390('0x4c')],_0x35cc5d);var _0x37d46c=JSON[_0x4390('0x54')](_0x525947);_0x5caea8['body'][_0x4390('0x55')]=_0x37d46c;}}catch(_0x5d7200){throw new db[(_0x4390('0x56'))][(_0x4390('0x57'))](_0x4390('0x58'));}return rp(_0x5caea8);}else{throw new db['Sequelize'][(_0x4390('0x57'))](_0x4390('0x59'));}})[_0x4390('0x16')](function(_0x507a16){_0x1cd0bb=_0x507a16;if(_0x1cd0bb['id']){var _0x383c3c={'body':_0x1cd0bb[_0x4390('0x5a')],'ChatWebsiteId':_0x54ddf0['id'],'ChatInteractionId':_0x3b9566['id'],'direction':_0x4390('0x5b'),'UserId':_0x36c473['user']['id']};return db[_0x4390('0x5c')][_0x4390('0x5d')](_0x383c3c,{});}else{throw new db[(_0x4390('0x56'))][(_0x4390('0x57'))](_0x4390('0x5e'));}})['then'](function(){return _0x3b9566[_0x4390('0x5f')]({'vidaooSessionId':_0x1cd0bb['id']});})[_0x4390('0x16')](respondWithResult(_0x11caae,null))['catch'](handleError(_0x11caae,null));};exports[_0x4390('0x60')]=function(_0x12ae75,_0x219ec9){if(_0x12ae75[_0x4390('0x2c')]['id']){delete _0x12ae75['body']['id'];}return db[_0x4390('0x33')][_0x4390('0x43')]({'where':{'id':_0x12ae75[_0x4390('0x3c')]['id']},'include':[{'model':db[_0x4390('0x61')],'as':_0x4390('0x62')}]})[_0x4390('0x16')](handleEntityNotFound(_0x219ec9,null))[_0x4390('0x16')](saveUpdates(_0x12ae75['body'],null))[_0x4390('0x16')](respondWithResult(_0x219ec9,null))[_0x4390('0x1e')](handleError(_0x219ec9,null));};exports[_0x4390('0x63')]=function(_0x556417,_0x130914){if(_0x556417[_0x4390('0x2c')]['id']){delete _0x556417['body']['id'];}return db[_0x4390('0x33')][_0x4390('0x43')]({'where':{'id':_0x556417['params']['id']}})['then'](function(_0x25adab){if(!_0x25adab){logger[_0x4390('0x1b')](_0x4390('0x64'),'abandon',0x194,'entity\x20not\x20found');_0x130914['sendStatus'](0x194);}else{if(_0x25adab[_0x4390('0x65')]){throw new db[(_0x4390('0x56'))]['ValidationError'](_0x4390('0x66'));}}return _0x25adab;})[_0x4390('0x16')](function(_0x442709){if(_0x442709){return _0x442709[_0x4390('0x27')]({'closed':_0x556417[_0x4390('0x2c')]['closed'],'disposition':_0x556417['body'][_0x4390('0x67')]})[_0x4390('0x16')](function(_0x27112c){return _0x27112c;});}})[_0x4390('0x16')](function(){return respondWithRpcPromise('AbandonInteraction',_0x4390('0x63'),_0x556417[_0x4390('0x2c')],client9004);})['then'](respondWithResult(_0x130914,null))[_0x4390('0x1e')](handleError(_0x130914,null));};exports[_0x4390('0x68')]=function(_0x1530de,_0x13fcbd){_0x1530de[_0x4390('0x2c')][_0x4390('0x28')]=_0x1530de[_0x4390('0x69')][_0x4390('0x6a')];_0x1530de[_0x4390('0x2c')][_0x4390('0x6b')]=_0x1530de[_0x4390('0x69')][_0x4390('0x6c')];_0x1530de[_0x4390('0x2c')][_0x4390('0x36')]=_0x1530de['file']['mimetype'];return db[_0x4390('0x6d')][_0x4390('0x5d')](_0x1530de[_0x4390('0x2c')])[_0x4390('0x16')](respondWithResult(_0x13fcbd,0xc9))['catch'](handleError(_0x13fcbd,null));};exports[_0x4390('0x6e')]=function(_0x7b07b9,_0x183ea5){return db['ChatInteraction'][_0x4390('0x47')]({'where':{'id':_0x7b07b9[_0x4390('0x3c')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x183ea5,null))[_0x4390('0x16')](function(_0x2453f6){if(_0x2453f6){if(_0x2453f6[_0x4390('0x6f')]){return _0x183ea5[_0x4390('0x24')](0x193)[_0x4390('0x20')]({'status':0x193,'message':_0x4390('0x70')});}return db[_0x4390('0x6d')][_0x4390('0x47')]({'where':{'id':_0x7b07b9['query'][_0x4390('0x71')]},'raw':!![]})[_0x4390('0x16')](handleEntityNotFound(_0x183ea5,null));}})['then'](function(_0x539d80){if(_0x539d80){var _0xe559d4=_0x539d80[_0x4390('0x72')]!==null;var _0x2294f9=path['join'](config[_0x4390('0x73')],_0x4390('0x74'));if(_0xe559d4){_0x2294f9=path[_0x4390('0x75')](_0x2294f9,_0x4390('0x76'));}var _0x507fe5=path[_0x4390('0x75')](_0x2294f9,_0x539d80[_0x4390('0x6b')]);return _0x183ea5['download'](_0x507fe5);}})[_0x4390('0x1e')](handleError(_0x183ea5,null));};exports[_0x4390('0x77')]=function(_0x59d857,_0x7785e){var _0xa587e1=null;var _0x12aa4b=null;var _0x2de5bf=null;if(_0x59d857[_0x4390('0x2c')]['id']){delete _0x59d857[_0x4390('0x2c')]['id'];}if(_0x59d857[_0x4390('0x2c')][_0x4390('0x78')]){_0x2de5bf=path['join'](config['root'],_0x4390('0x79'),util[_0x4390('0x7a')]('transcript-%s.txt',Date[_0x4390('0x7b')]()));_0x59d857[_0x4390('0x2c')][_0x4390('0x7c')]=_0x2de5bf;}return db[_0x4390('0x33')]['find']({'where':{'id':_0x59d857[_0x4390('0x3c')]['id']},'include':[{'model':db[_0x4390('0x5c')],'as':_0x4390('0x7d'),'include':[{'model':db[_0x4390('0x7e')],'as':_0x4390('0x7e')}]}]})[_0x4390('0x16')](handleEntityNotFound(_0x7785e,null))[_0x4390('0x16')](saveUpdates(_0x59d857[_0x4390('0x2c')],null))[_0x4390('0x16')](function(_0x4fad02){if(_0x4fad02){_0xa587e1=_0x4fad02;return db[_0x4390('0x48')]['find']({'where':{'id':_0xa587e1[_0x4390('0x49')]}});}})[_0x4390('0x16')](function(_0x232e5e){if(_0x232e5e){_0x12aa4b=_0x232e5e;return db[_0x4390('0x61')][_0x4390('0x43')]({'where':{'id':_0xa587e1['ContactId']}});}})['then'](function(_0x3a4852){if(_0x3a4852){if(_0x2de5bf){var _0x320c0c=null;for(var _0x450e36=0x1;_0x450e36<_0xa587e1['Messages']['length'];++_0x450e36){_0x320c0c=_0xa587e1[_0x4390('0x7d')][_0x450e36];var _0x1daa35=_0x320c0c[_0x4390('0x65')]?util[_0x4390('0x7a')]('%s%d',_0x12aa4b[_0x4390('0x7f')],_0x320c0c[_0x4390('0x65')]):_0x4390('0x80');var _0x2fd5da=_0x59d857[_0x4390('0x2c')][_0x4390('0x81')]||util[_0x4390('0x7a')](_0x4390('0x82'),'Visitor',_0x320c0c[_0x4390('0x83')]);switch(_0x12aa4b[_0x4390('0x84')]){case'website_alias':_0x1daa35=_0x320c0c[_0x4390('0x65')]?util[_0x4390('0x7a')](_0x4390('0x82'),_0x12aa4b[_0x4390('0x7f')],_0x320c0c['UserId']):_0x4390('0x80');break;case _0x4390('0x85'):_0x1daa35=_0x320c0c['UserId']?_0x320c0c['User'][_0x4390('0x86')]||_0x320c0c[_0x4390('0x7e')]['fullname']:'System';break;case _0x4390('0x87'):_0x1daa35=_0x320c0c['UserId']?_0x320c0c[_0x4390('0x7e')]['fullname']:_0x4390('0x80');break;default:_0x1daa35=_0x320c0c[_0x4390('0x65')]?util[_0x4390('0x7a')](_0x4390('0x82'),_0x12aa4b[_0x4390('0x7f')],_0x320c0c[_0x4390('0x65')]):_0x4390('0x80');}var _0x5947d1=util['format'](_0x4390('0x88'),moment(_0x320c0c[_0x4390('0x89')])['format'](_0x4390('0x8a')),_0x320c0c[_0x4390('0x8b')]==='in'?_0x2fd5da:_0x1daa35,_0x320c0c['body']);if(!_0x320c0c[_0x4390('0x8c')]){fs['appendFileSync'](_0x2de5bf,_0x5947d1);}}return db[_0x4390('0x8d')][_0x4390('0x47')]({'where':{'service':!![]},'include':[{'model':db[_0x4390('0x8e')],'as':_0x4390('0x8f'),'raw':!![],'include':[{'model':db[_0x4390('0x90')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x4390('0x16')](function(_0x3b8fb4){if(!_0x3b8fb4||!_0x3b8fb4['Smtp']||!_0x59d857[_0x4390('0x2c')])return _0xa587e1;var _0x3b81c8=_0x3b8fb4['getSmtpOptions']();return respondWithRpcPromise(_0x4390('0x91'),'sendMail',{'account':_0x3b81c8,'message':{'from':util['format'](_0x4390('0x92'),_0x3b8fb4[_0x4390('0x28')],_0x3b8fb4[_0x4390('0x4f')]||_0x3b8fb4['Smtp'][_0x4390('0x3a')]),'to':_0x59d857[_0x4390('0x2c')]['mailTranscript'],'subject':_0x4390('0x93'),'text':util[_0x4390('0x7a')](_0x4390('0x94'),_0x59d857[_0x4390('0x2c')]['mailTranscript']),'attachments':[{'path':_0x2de5bf}]}})[_0x4390('0x16')](function(){return _0xa587e1;})[_0x4390('0x1e')](function(_0x491df8){logger[_0x4390('0x1b')](_0x491df8);});})['then'](respondWithStatusCode(_0x7785e,0xc8))[_0x4390('0x1e')](handleError(_0x7785e,null));};exports['addMessage']=function(_0x1f1b52,_0x2966c9){return db[_0x4390('0x5c')][_0x4390('0x43')]({'where':{'id':_0x1f1b52[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0x2966c9,null))[_0x4390('0x16')](function(_0x461558){if(_0x461558){return _0x461558['addMessage'](_0x1f1b52[_0x4390('0x2c')][_0x4390('0x95')],_[_0x4390('0x96')](_0x1f1b52[_0x4390('0x2c')],[_0x4390('0x95'),'id'])||{});}})[_0x4390('0x16')](respondWithResult(_0x2966c9,null))['catch'](handleError(_0x2966c9,null));};exports[_0x4390('0x97')]=function(_0x9dbff2,_0xbe9300){var _0x34e355={'raw':![],'where':{}};var _0x1e07ba={};var _0x439322={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4390('0x47')]({'where':{'id':_0x9dbff2[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0xbe9300,null))[_0x4390('0x16')](function(_0x353144){if(_0x353144){_0x1e07ba[_0x4390('0x3d')]=_[_0x4390('0x98')](db[_0x4390('0x5c')][_0x4390('0x34')]);_0x1e07ba['query']=_['keys'](_0x9dbff2['query']);_0x1e07ba[_0x4390('0x99')]=_[_0x4390('0x3f')](_0x1e07ba[_0x4390('0x3d')],_0x1e07ba[_0x4390('0x39')]);_0x34e355['attributes']=_[_0x4390('0x3f')](_0x1e07ba[_0x4390('0x3d')],qs[_0x4390('0x40')](_0x9dbff2[_0x4390('0x39')][_0x4390('0x40')]));_0x34e355[_0x4390('0x3e')]=_0x34e355[_0x4390('0x3e')][_0x4390('0x41')]?_0x34e355[_0x4390('0x3e')]:_0x1e07ba['model'];if(!_0x9dbff2[_0x4390('0x39')]['hasOwnProperty'](_0x4390('0x9a'))){_0x34e355['limit']=qs[_0x4390('0x22')](_0x9dbff2[_0x4390('0x39')][_0x4390('0x22')]);_0x34e355[_0x4390('0x21')]=qs['offset'](_0x9dbff2[_0x4390('0x39')][_0x4390('0x21')]);}_0x34e355['order']=qs[_0x4390('0x9b')](_0x9dbff2[_0x4390('0x39')]['sort']);_0x34e355[_0x4390('0x9c')]=qs[_0x4390('0x99')](_[_0x4390('0x9d')](_0x9dbff2[_0x4390('0x39')],_0x1e07ba[_0x4390('0x99')]));_0x34e355['where'][_0x4390('0x9e')]=_0x353144['id'];if(_0x9dbff2['query']['filter']){_0x34e355['where']=_[_0x4390('0x2b')](_0x34e355[_0x4390('0x9c')],{'$or':_[_0x4390('0x32')](_0x34e355[_0x4390('0x3e')],function(_0x4275b0){var _0x2314ac={};_0x2314ac[_0x4275b0]={'$like':'%'+_0x9dbff2['query'][_0x4390('0x9f')]+'%'};return _0x2314ac;})});}if(_0x9dbff2['query'][_0x4390('0xa0')]){var _0x84147f=_0x9dbff2['query'][_0x4390('0xa0')][_0x4390('0xa1')](',');var _0x46c5c1={};_0x46c5c1[_0x84147f[0x0]]={'$gte':moment(_0x84147f[0x1])[_0x4390('0x7a')](_0x4390('0xa2'))};_0x34e355[_0x4390('0x9c')]=_[_0x4390('0x2b')](_0x34e355[_0x4390('0x9c')],_0x46c5c1);}_0x34e355=_[_0x4390('0x2b')]({},_0x34e355,_0x9dbff2['options']);return db[_0x4390('0x5c')][_0x4390('0x23')]({'where':_0x34e355['where']})['then'](function(_0x44ebdf){_0x439322['count']=_0x44ebdf;if(_0x9dbff2[_0x4390('0x39')][_0x4390('0x42')]){_0x34e355['include']=[{'all':!![]}];}return db['ChatMessage'][_0x4390('0x37')](_0x34e355);})[_0x4390('0x16')](function(_0x1dd9c8){_0x439322[_0x4390('0xa3')]=_0x1dd9c8;return _0x439322;});}})[_0x4390('0x16')](respondWithFilteredResult(_0xbe9300,_0x34e355))[_0x4390('0x1e')](handleError(_0xbe9300,null));};exports['getMyMessages']=function(_0x33688a,_0x237672){var _0xf35658={'where':{}},_0x17a019={},_0x236a28={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x4390('0x47')]({'where':{'id':_0x33688a[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0x237672,null))[_0x4390('0x16')](function(_0x173f43){if(_0x173f43){_0x17a019['model']=_[_0x4390('0x98')](db[_0x4390('0x5c')][_0x4390('0x34')]);_0x17a019['query']=_[_0x4390('0x98')](_0x33688a[_0x4390('0x39')]);_0x17a019[_0x4390('0x99')]=_[_0x4390('0x3f')](_0x17a019[_0x4390('0x3d')],_0x17a019[_0x4390('0x39')]);_0xf35658[_0x4390('0x3e')]=_['intersection'](_0x17a019[_0x4390('0x3d')],qs[_0x4390('0x40')](_0x33688a[_0x4390('0x39')][_0x4390('0x40')]));_0xf35658[_0x4390('0x3e')]=_0xf35658[_0x4390('0x3e')][_0x4390('0x41')]?_0xf35658[_0x4390('0x3e')]:_0x17a019['model'];if(!_0x33688a[_0x4390('0x39')][_0x4390('0xa4')](_0x4390('0x9a'))){_0xf35658[_0x4390('0x22')]=qs[_0x4390('0x22')](_0x33688a[_0x4390('0x39')][_0x4390('0x22')]);_0xf35658[_0x4390('0x21')]=qs[_0x4390('0x21')](_0x33688a[_0x4390('0x39')][_0x4390('0x21')]);}_0xf35658['order']=qs[_0x4390('0x9b')](_0x33688a['query'][_0x4390('0x9b')]);_0xf35658[_0x4390('0x9c')]=qs[_0x4390('0x99')](_['pick'](_0x33688a['query'],_0x17a019[_0x4390('0x99')]));_0xf35658['where']['ChatInteractionId']=_0x173f43['id'];if(_0x33688a[_0x4390('0x39')][_0x4390('0x9f')]){_0xf35658[_0x4390('0x9c')]=_[_0x4390('0x2b')](_0xf35658[_0x4390('0x9c')],{'$or':_[_0x4390('0x32')](_0xf35658[_0x4390('0x3e')],function(_0x561700){var _0x107255={};_0x107255[_0x561700]={'$like':'%'+_0x33688a[_0x4390('0x39')]['filter']+'%'};return _0x107255;})});}_0xf35658[_0x4390('0x9c')]['secret']=![];if(_0x33688a[_0x4390('0x39')]['id']){_0xf35658[_0x4390('0x9c')]['id']={'$gt':_0x33688a[_0x4390('0x39')]['id']};}_0xf35658=_[_0x4390('0x2b')]({},_0xf35658,_0x33688a[_0x4390('0xa5')]);return db[_0x4390('0x5c')][_0x4390('0x23')]({'where':_0xf35658[_0x4390('0x9c')]})['then'](function(_0x486dcd){_0x236a28[_0x4390('0x23')]=_0x486dcd;_0xf35658[_0x4390('0xa6')]=[];if(_0x33688a[_0x4390('0x39')][_0x4390('0xa7')]){_0xf35658[_0x4390('0xa6')][_0x4390('0xa8')]({'model':db[_0x4390('0x7e')],'as':_0x4390('0x7e'),'attributes':['id',_0x4390('0x4e'),_0x4390('0x86')]});}if(_0x33688a[_0x4390('0x39')][_0x4390('0x42')]){_0xf35658[_0x4390('0xa6')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0xf35658);})[_0x4390('0x16')](function(_0x407536){_0x236a28[_0x4390('0xa3')]=_0x407536;return _0x236a28;});}})[_0x4390('0x16')](respondWithFilteredResult(_0x237672,_0xf35658))[_0x4390('0x1e')](handleError(_0x237672,null));};exports[_0x4390('0xa9')]=function(_0x2914ed,_0x31bd63){return db[_0x4390('0x33')][_0x4390('0x43')]({'where':{'id':_0x2914ed[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0x31bd63,null))[_0x4390('0x16')](function(_0x427a43){if(_0x427a43){return _0x427a43['setTags'](_0x2914ed[_0x4390('0x2c')][_0x4390('0x95')],_[_0x4390('0x96')](_0x2914ed['body'],[_0x4390('0x95'),'id'])||{})[_0x4390('0xaa')](function(){return db[_0x4390('0xab')][_0x4390('0x37')]({'attributes':['id',_0x4390('0x28'),_0x4390('0xac')],'where':{'id':_0x2914ed[_0x4390('0x2c')][_0x4390('0x95')]}});})['then'](function(_0x42d201){socket[_0x4390('0xad')](_0x4390('0xae'),{'id':Number(_0x2914ed[_0x4390('0x3c')]['id']),'tags':_0x42d201||[]});return{'id':Number(_0x2914ed[_0x4390('0x3c')]['id']),'tags':_0x42d201||[]};});}})['then'](respondWithResult(_0x31bd63,null))[_0x4390('0x1e')](handleError(_0x31bd63,null));};exports[_0x4390('0xaf')]=function(_0x338d1f,_0xafead3){return db[_0x4390('0x33')]['find']({'where':{'id':_0x338d1f[_0x4390('0x3c')]['id']}})[_0x4390('0x16')](handleEntityNotFound(_0xafead3,null))[_0x4390('0x16')](function(_0x2f2f39){if(_0x2f2f39){return _0x2f2f39[_0x4390('0xaf')](_0x338d1f[_0x4390('0x39')][_0x4390('0x95')]);}})[_0x4390('0x16')](respondWithStatusCode(_0xafead3,null))[_0x4390('0x1e')](handleError(_0xafead3,null));};exports[_0x4390('0xb0')]=function(_0x4ec6be,_0x2a2dc1){var _0x3a9805=moment()[_0x4390('0xb1')]()[_0x4390('0xb2')]();var _0x1bb84e=path[_0x4390('0x75')](config['root'],_0x4390('0xb3'),_0x4390('0xb4'),_0x4390('0xb5'));var _0x33f8fb=path[_0x4390('0x75')](config[_0x4390('0x73')],_0x4390('0xb3'),_0x4390('0xb4'),_0x4390('0xb6'));var _0x4c415c=path['join'](_0x1bb84e,_0x3a9805);var _0x162f27=util[_0x4390('0x7a')](_0x4390('0xb7'),_0x4ec6be[_0x4390('0x3c')]['id'],_0x3a9805);var _0x3cdca0=path[_0x4390('0x75')](_0x1bb84e,_0x162f27);var _0x4001dd=[];_0x4001dd['push']({'model':db[_0x4390('0x7e')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x4001dd[_0x4390('0xa8')]({'model':db[_0x4390('0x61')],'as':'Contact','attributes':['id',_0x4390('0xb8'),'lastName'],'raw':!![]});if(_0x4ec6be['query'][_0x4390('0xb6')]){_0x4001dd[_0x4390('0xa8')]({'model':db[_0x4390('0x6d')],'as':'Attachment','raw':!![]});}var _0x440d92=[{'model':db[_0x4390('0x5c')],'as':_0x4390('0x7d'),'attributes':['id',_0x4390('0x2c'),_0x4390('0x89'),_0x4390('0x8b'),'secret',_0x4390('0xb9')],'include':_0x4001dd}];_0x440d92[_0x4390('0xa8')]({'model':db['ChatWebsite'],'as':_0x4390('0xba'),'attributes':['id',_0x4390('0x28')]});_0x440d92[_0x4390('0xa8')]({'model':db['User'],'as':'Owner','attributes':['id',_0x4390('0x4e')]});return db[_0x4390('0x33')][_0x4390('0x43')]({'where':{'id':_0x4ec6be[_0x4390('0x3c')]['id']},'include':_0x440d92})['then'](handleEntityNotFound(_0x2a2dc1,null))[_0x4390('0x16')](function(_0x1cba6b){if(_0x1cba6b){var _0x18a908=_0x1cba6b['get']({'plain':!![]});fs['mkdirSync'](_0x4c415c);var _0x279eb8={'channel':_0x4390('0xbb'),'account':_0x18a908[_0x4390('0xba')][_0x4390('0x28')],'agent':_0x18a908[_0x4390('0xbc')]?_0x18a908[_0x4390('0xbc')][_0x4390('0x4e')]:_0x4390('0xbd'),'createdAt':moment(_0x18a908[_0x4390('0x89')])[_0x4390('0x7a')](_0x4390('0xa2'))[_0x4390('0xb2')](),'closedAt':_0x18a908[_0x4390('0x6f')]?moment(_0x18a908[_0x4390('0xbe')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x4390('0xb2')]():'','disposition':_0x18a908[_0x4390('0x67')],'chatInfo':{'browser':_0x18a908['browserName'],'os':_0x18a908[_0x4390('0xbf')],'referer':_0x18a908['referer'],'customerIp':_0x18a908[_0x4390('0xc0')],'customerPort':_0x18a908[_0x4390('0xc1')]?_0x18a908[_0x4390('0xc1')]:_0x4390('0xbd')},'messages':_(_0x18a908['Messages'])[_0x4390('0xc2')]()[_0x4390('0x9f')]({'secret':![]})[_0x4390('0x32')](function(_0x50db0e){if(_0x50db0e[_0x4390('0x6d')]){var _0x1355a6=path['join'](_0x33f8fb,_0x50db0e['Attachment'][_0x4390('0x6b')]);if(fs[_0x4390('0xc3')](_0x1355a6)){fs['createReadStream'](_0x1355a6)[_0x4390('0xc4')](fs[_0x4390('0xc5')](path[_0x4390('0x75')](_0x4c415c,_0x50db0e[_0x4390('0x6d')][_0x4390('0x6b')])));}}return{'date':moment(_0x50db0e[_0x4390('0x89')])[_0x4390('0x7a')](_0x4390('0xa2'))[_0x4390('0xb2')](),'sender':_0x50db0e[_0x4390('0x8b')]===_0x4390('0x5b')?_0x50db0e[_0x4390('0x7e')]?_0x50db0e[_0x4390('0x7e')][_0x4390('0x4e')]:_0x4390('0x80'):_0x50db0e[_0x4390('0x62')][_0x4390('0xb8')]+(_0x50db0e['Contact'][_0x4390('0xc6')]?'\x20'+_0x50db0e['Contact']['lastName']:''),'body':_0x50db0e[_0x4390('0x6d')]?_0x50db0e[_0x4390('0x6d')][_0x4390('0x6b')]:_0x50db0e[_0x4390('0x2c')],'direction':_0x50db0e[_0x4390('0x8b')]===_0x4390('0x5b')?'A':'C','secret':_0x50db0e[_0x4390('0x8c')],'read':_0x50db0e[_0x4390('0xb9')],'attachment':_0x50db0e[_0x4390('0x6d')]};})[_0x4390('0xc7')]()};return ejs['renderFile'](path[_0x4390('0x75')](config['root'],_0x4390('0xb3'),_0x4390('0xc8'),_0x4390('0xc9')),{'interaction':_0x279eb8})[_0x4390('0x16')](function(_0xd0422a){var _0x412e43=path[_0x4390('0x75')](_0x4c415c,_0x4390('0xca')+_0x18a908['id']+'-'+_0x3a9805+_0x4390('0xcb'));var _0x5b8058={'path':_0x412e43,'channel':_0x4390('0xbb'),'interactionId':_0x18a908['id']};return pdf[_0x4390('0xcc')](_0xd0422a,_0x5b8058);})[_0x4390('0x16')](function(){return new Promise(function(_0x32533f,_0x2b6e7b){zipdir(_0x4c415c,{'saveTo':_0x3cdca0},function(_0x4deef9,_0x5614df){if(_0x4deef9)return _0x2b6e7b(_0x4deef9);return _0x32533f(_0x5614df);});})[_0x4390('0x16')](function(){return new BPromise(function(_0x2bce62,_0x2dced3){rimraf(_0x4c415c,function(_0x539c5b){if(_0x539c5b)_0x2dced3(_0x539c5b);return _0x2bce62();});});})['then'](function(){return _0x2a2dc1[_0x4390('0xb0')](_0x3cdca0,_0x162f27,function(_0x20b0ba){if(_0x20b0ba){logger['error']('err',_0x20b0ba);}else{fs[_0x4390('0xcd')](_0x3cdca0);}});});});}else{return _0x2a2dc1['sendStatus'](0xc8);}})['catch'](handleError(_0x2a2dc1,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index d8f9a95..ab0c3f6 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 _0x65a4=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x65a4,0xb0));var _0x465a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x65a4[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x465a('0x0'));var ChatInteraction=require(_0x465a('0x1'))['db'][_0x465a('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x465a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x465a('0x4')](0x0);var events={'afterCreate':_0x465a('0x5'),'afterUpdate':_0x465a('0x6'),'afterDestroy':_0x465a('0x7')};function emitEvent(_0x33222e){return function(_0x279367,_0x5c1f4d,_0x246ba4){_0x279367['getUsers']({'attributes':['id'],'raw':!![]})[_0x465a('0x8')](function(_0x567b5f){_0x279367[_0x465a('0x9')](_0x465a('0xa'),_0x567b5f[_0x465a('0xb')](function(_0x238fb5){return{'id':_0x238fb5['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x279367['id'],'direction':'in','read':![]},'raw':!![]});})[_0x465a('0x8')](function(_0x5e7a13){_0x279367['setDataValue'](_0x465a('0xc'),_0x5e7a13[_0x465a('0xd')]);ChatInteractionEvents[_0x465a('0xe')](_0x33222e+':'+_0x279367['id'],_0x279367);ChatInteractionEvents[_0x465a('0xe')](_0x33222e,_0x279367);_0x246ba4(null);})[_0x465a('0xf')](_0x246ba4(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x465a('0x10')](e,emitEvent(event));}}module[_0x465a('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xd1ba=['findAll','length','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x74df19,_0x5f1d9d){var _0x559892=function(_0x3226a7){while(--_0x3226a7){_0x74df19['push'](_0x74df19['shift']());}};_0x559892(++_0x5f1d9d);}(_0xd1ba,0x19d));var _0xad1b=function(_0xf5b55a,_0x43ab5e){_0xf5b55a=_0xf5b55a-0x0;var _0x57de1e=_0xd1ba[_0xf5b55a];return _0x57de1e;};'use strict';var EventEmitter=require(_0xad1b('0x0'));var ChatInteraction=require(_0xad1b('0x1'))['db'][_0xad1b('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xad1b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xad1b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad1b('0x5'),'afterDestroy':_0xad1b('0x6')};function emitEvent(_0x41d28e){return function(_0x2e25d8,_0x375144,_0x4c98ce){_0x2e25d8[_0xad1b('0x7')]({'attributes':['id'],'raw':!![]})[_0xad1b('0x8')](function(_0x49f94c){_0x2e25d8[_0xad1b('0x9')](_0xad1b('0xa'),_0x49f94c[_0xad1b('0xb')](function(_0x577f06){return{'id':_0x577f06['id']};}));return ChatMessage[_0xad1b('0xc')]({'where':{'ChatInteractionId':_0x2e25d8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xad1b('0x8')](function(_0x5fe285){_0x2e25d8[_0xad1b('0x9')]('unreadMessages',_0x5fe285[_0xad1b('0xd')]);ChatInteractionEvents['emit'](_0x41d28e+':'+_0x2e25d8['id'],_0x2e25d8);ChatInteractionEvents['emit'](_0x41d28e,_0x2e25d8);_0x4c98ce(null);})[_0xad1b('0xe')](_0x4c98ce(null));};}for(var e in events){if(events[_0xad1b('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xad1b('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 07efd13..188caa3 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 _0x3ec6=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','path','rimraf','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt'];(function(_0x4f126e,_0xb30d77){var _0x5ee251=function(_0x3aa193){while(--_0x3aa193){_0x4f126e['push'](_0x4f126e['shift']());}};_0x5ee251(++_0xb30d77);}(_0x3ec6,0x114));var _0x63ec=function(_0x28b698,_0x502ed6){_0x28b698=_0x28b698-0x0;var _0xc4f2bb=_0x3ec6[_0x28b698];return _0xc4f2bb;};'use strict';var _=require(_0x63ec('0x0'));var util=require(_0x63ec('0x1'));var logger=require(_0x63ec('0x2'))(_0x63ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ec('0x4'));var rimraf=require(_0x63ec('0x5'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x63ec('0x6')]=function(_0x575859,_0x40fa60){return _0x575859[_0x63ec('0x7')](_0x63ec('0x8'),attributes,{'tableName':_0x63ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14e5f4,_0x509108,_0xf1ccb0){if(_0x14e5f4[_0x63ec('0xa')](_0x63ec('0xb'))){_0x14e5f4[_0x63ec('0xc')]=moment()[_0x63ec('0xd')](_0x63ec('0xe'));}_0xf1ccb0(null,_0x14e5f4);}},'charset':_0x63ec('0xf'),'collate':_0x63ec('0x10')});}; \ No newline at end of file +var _0xa886=['../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','moment','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa886,0x163));var _0x6a88=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa886[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6a88('0x0'));var util=require('util');var logger=require(_0x6a88('0x1'))('api');var moment=require(_0x6a88('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a88('0x3'));var rimraf=require(_0x6a88('0x4'));var config=require(_0x6a88('0x5'));var attributes=require(_0x6a88('0x6'));module['exports']=function(_0x3995ae,_0x1115c2){return _0x3995ae[_0x6a88('0x7')](_0x6a88('0x8'),attributes,{'tableName':_0x6a88('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x210690,_0x4b56ad,_0x63c34f){if(_0x210690[_0x6a88('0xa')](_0x6a88('0xb'))){_0x210690['closedAt']=moment()[_0x6a88('0xc')](_0x6a88('0xd'));}_0x63c34f(null,_0x210690);}},'charset':'utf8mb4','collate':_0x6a88('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 04ac8a3..d747d66 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 _0x96eb=['debug','AddTagsToChatInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateChatInteraction','ChatInteraction','update','raw','options','where','limit'];(function(_0x5edebb,_0x312579){var _0xbfb1bd=function(_0x26367c){while(--_0x26367c){_0x5edebb['push'](_0x5edebb['shift']());}};_0xbfb1bd(++_0x312579);}(_0x96eb,0x104));var _0xb96e=function(_0x5f42ea,_0x4a08c3){_0x5f42ea=_0x5f42ea-0x0;var _0x145bb6=_0x96eb[_0x5f42ea];return _0x145bb6;};'use strict';var _=require(_0xb96e('0x0'));var util=require(_0xb96e('0x1'));var moment=require('moment');var BPromise=require(_0xb96e('0x2'));var rs=require(_0xb96e('0x3'));var fs=require('fs');var Redis=require(_0xb96e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb96e('0x5'));var logger=require('../../config/logger')(_0xb96e('0x6'));var config=require(_0xb96e('0x7'));var jayson=require(_0xb96e('0x8'));var client=jayson[_0xb96e('0x9')][_0xb96e('0xa')]({'port':0x232a});config['redis']=_[_0xb96e('0xb')](config[_0xb96e('0xc')],{'host':_0xb96e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb96e('0xc')]));require(_0xb96e('0xe'))[_0xb96e('0xf')](socket);function respondWithRpcPromise(_0x428410,_0x47f41d,_0x355090){return new BPromise(function(_0x1eb80c,_0x413084){return client[_0xb96e('0x10')](_0x428410,_0x355090)[_0xb96e('0x11')](function(_0x39b86a){logger[_0xb96e('0x12')](_0xb96e('0x13'),_0x47f41d,_0xb96e('0x14'));logger['debug'](_0xb96e('0x15'),_0x47f41d,_0xb96e('0x14'),JSON[_0xb96e('0x16')](_0x39b86a));if(_0x39b86a['error']){if(_0x39b86a[_0xb96e('0x17')]['code']===0x1f4){logger[_0xb96e('0x17')](_0xb96e('0x13'),_0x47f41d,_0x39b86a[_0xb96e('0x17')][_0xb96e('0x18')]);return _0x413084(_0x39b86a[_0xb96e('0x17')][_0xb96e('0x18')]);}logger[_0xb96e('0x17')](_0xb96e('0x13'),_0x47f41d,_0x39b86a[_0xb96e('0x17')][_0xb96e('0x18')]);return _0x1eb80c(_0x39b86a[_0xb96e('0x17')][_0xb96e('0x18')]);}else{logger[_0xb96e('0x12')](_0xb96e('0x13'),_0x47f41d,'request\x20sent');_0x1eb80c(_0x39b86a[_0xb96e('0x19')]['message']);}})[_0xb96e('0x1a')](function(_0x20ae40){logger[_0xb96e('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x47f41d,_0x20ae40);_0x413084(_0x20ae40);});});}exports[_0xb96e('0x1b')]=function(_0x5958fa){var _0xd74565=this;return new Promise(function(_0x4daa8b,_0x58f456){return db[_0xb96e('0x1c')][_0xb96e('0x1d')](_0x5958fa['body'],{'raw':_0x5958fa['options']?_0x5958fa['options'][_0xb96e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5958fa[_0xb96e('0x1f')]?_0x5958fa[_0xb96e('0x1f')][_0xb96e('0x20')]||null:null,'attributes':_0x5958fa['options']?_0x5958fa['options']['attributes']||null:null,'limit':_0x5958fa[_0xb96e('0x1f')]?_0x5958fa[_0xb96e('0x1f')][_0xb96e('0x21')]||null:null})['then'](function(_0x53c04c){logger[_0xb96e('0x12')]('UpdateChatInteraction',_0x5958fa);logger[_0xb96e('0x22')](_0xb96e('0x1b'),_0x5958fa,JSON[_0xb96e('0x16')](_0x53c04c));_0x4daa8b(_0x53c04c);})['catch'](function(_0x50b40e){logger[_0xb96e('0x17')](_0xb96e('0x1b'),_0x50b40e[_0xb96e('0x18')],_0x5958fa);_0x58f456(_0xd74565['error'](0x1f4,_0x50b40e[_0xb96e('0x18')]));});});};exports[_0xb96e('0x23')]=function(_0xb3719b){return new Promise(function(_0xc7c769,_0x65216a){return db[_0xb96e('0x1c')][_0xb96e('0x24')]({'where':_0xb3719b[_0xb96e('0x1f')]?_0xb3719b[_0xb96e('0x1f')][_0xb96e('0x20')]||null:null})[_0xb96e('0x11')](function(_0x299b7e){if(_0x299b7e){return _0x299b7e[_0xb96e('0x25')](_0xb3719b[_0xb96e('0x26')]['ids'],_['omit'](_0xb3719b['body'],[_0xb96e('0x27'),'id'])||{});}})[_0xb96e('0x28')](function(_0xc39e0e){logger['info'](_0xb96e('0x29'),_0xb3719b);logger[_0xb96e('0x22')](_0xb96e('0x29'),_0xb3719b,JSON['stringify'](_0xc39e0e));_0xc7c769(_0xc39e0e);})[_0xb96e('0x1a')](function(_0x3d4edd){logger[_0xb96e('0x17')](_0xb96e('0x29'),_0x3d4edd[_0xb96e('0x18')],_0xb3719b);_0x65216a(_this[_0xb96e('0x17')](0x1f4,_0x3d4edd[_0xb96e('0x18')]));});});}; \ No newline at end of file +var _0x37f4=['AddTags','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','spread'];(function(_0x3aa0e4,_0x4aaa61){var _0x45845c=function(_0x1607c7){while(--_0x1607c7){_0x3aa0e4['push'](_0x3aa0e4['shift']());}};_0x45845c(++_0x4aaa61);}(_0x37f4,0x1e5));var _0x437f=function(_0x3ad653,_0x40d046){_0x3ad653=_0x3ad653-0x0;var _0x3a9585=_0x37f4[_0x3ad653];return _0x3a9585;};'use strict';var _=require('lodash');var util=require(_0x437f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x437f('0x1'));var fs=require('fs');var Redis=require(_0x437f('0x2'));var db=require(_0x437f('0x3'))['db'];var utils=require(_0x437f('0x4'));var logger=require(_0x437f('0x5'))('rpc');var config=require(_0x437f('0x6'));var jayson=require(_0x437f('0x7'));var client=jayson[_0x437f('0x8')][_0x437f('0x9')]({'port':0x232a});config['redis']=_[_0x437f('0xa')](config[_0x437f('0xb')],{'host':_0x437f('0xc'),'port':0x18eb});var socket=require(_0x437f('0xd'))(new Redis(config[_0x437f('0xb')]));require(_0x437f('0xe'))[_0x437f('0xf')](socket);function respondWithRpcPromise(_0x3a4fb2,_0xaf62fa,_0x40da62){return new BPromise(function(_0x55ea22,_0x546147){return client['request'](_0x3a4fb2,_0x40da62)[_0x437f('0x10')](function(_0x20484e){logger[_0x437f('0x11')]('ChatInteraction,\x20%s,\x20%s',_0xaf62fa,_0x437f('0x12'));logger[_0x437f('0x13')](_0x437f('0x14'),_0xaf62fa,_0x437f('0x12'),JSON[_0x437f('0x15')](_0x20484e));if(_0x20484e[_0x437f('0x16')]){if(_0x20484e[_0x437f('0x16')][_0x437f('0x17')]===0x1f4){logger[_0x437f('0x16')](_0x437f('0x18'),_0xaf62fa,_0x20484e[_0x437f('0x16')]['message']);return _0x546147(_0x20484e['error']['message']);}logger[_0x437f('0x16')](_0x437f('0x18'),_0xaf62fa,_0x20484e[_0x437f('0x16')][_0x437f('0x19')]);return _0x55ea22(_0x20484e[_0x437f('0x16')][_0x437f('0x19')]);}else{logger[_0x437f('0x11')](_0x437f('0x18'),_0xaf62fa,_0x437f('0x12'));_0x55ea22(_0x20484e[_0x437f('0x1a')][_0x437f('0x19')]);}})[_0x437f('0x1b')](function(_0x2a66ba){logger['error'](_0x437f('0x18'),_0xaf62fa,_0x2a66ba);_0x546147(_0x2a66ba);});});}exports['UpdateChatInteraction']=function(_0x302970){var _0x5b18d4=this;return new Promise(function(_0x2f4d82,_0x3f9fe8){return db[_0x437f('0x1c')][_0x437f('0x1d')](_0x302970[_0x437f('0x1e')],{'raw':_0x302970[_0x437f('0x1f')]?_0x302970[_0x437f('0x1f')][_0x437f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x302970['options']?_0x302970['options'][_0x437f('0x21')]||null:null,'attributes':_0x302970['options']?_0x302970[_0x437f('0x1f')][_0x437f('0x22')]||null:null,'limit':_0x302970[_0x437f('0x1f')]?_0x302970[_0x437f('0x1f')][_0x437f('0x23')]||null:null})[_0x437f('0x10')](function(_0x57c817){logger['info'](_0x437f('0x24'),_0x302970);logger[_0x437f('0x13')](_0x437f('0x24'),_0x302970,JSON[_0x437f('0x15')](_0x57c817));_0x2f4d82(_0x57c817);})[_0x437f('0x1b')](function(_0x1aae55){logger[_0x437f('0x16')]('UpdateChatInteraction',_0x1aae55[_0x437f('0x19')],_0x302970);_0x3f9fe8(_0x5b18d4['error'](0x1f4,_0x1aae55[_0x437f('0x19')]));});});};exports[_0x437f('0x25')]=function(_0x368ff4){return new Promise(function(_0x244c3b,_0x266bbe){return db[_0x437f('0x1c')][_0x437f('0x26')]({'where':_0x368ff4[_0x437f('0x1f')]?_0x368ff4[_0x437f('0x1f')][_0x437f('0x21')]||null:null})[_0x437f('0x10')](function(_0xb0a403){if(_0xb0a403){return _0xb0a403[_0x437f('0x27')](_0x368ff4[_0x437f('0x1e')][_0x437f('0x28')],_[_0x437f('0x29')](_0x368ff4[_0x437f('0x1e')],[_0x437f('0x28'),'id'])||{});}})[_0x437f('0x2a')](function(_0x41bbeb){logger['info'](_0x437f('0x2b'),_0x368ff4);logger[_0x437f('0x13')](_0x437f('0x2b'),_0x368ff4,JSON['stringify'](_0x41bbeb));_0x244c3b(_0x41bbeb);})['catch'](function(_0x5d0816){logger[_0x437f('0x16')]('AddTags',_0x5d0816[_0x437f('0x19')],_0x368ff4);_0x266bbe(_this[_0x437f('0x16')](0x1f4,_0x5d0816[_0x437f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index c210d6a..efc3b35 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 _0x7cab=['./chatInteraction.events','save','remove','register','chatInteraction:'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x7cab,0x91));var _0xb7ca=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x7cab[_0x1b70e3];return _0x1452ab;};'use strict';var ChatInteractionEvents=require(_0xb7ca('0x0'));var events=[_0xb7ca('0x1'),_0xb7ca('0x2'),'update'];function createListener(_0x215da3,_0x2aca5c){return function(_0x317484){_0x2aca5c['emit'](_0x215da3,_0x317484);};}function removeListener(_0x37e571,_0x5014c1){return function(){ChatInteractionEvents['removeListener'](_0x37e571,_0x5014c1);};}exports[_0xb7ca('0x3')]=function(_0x3f038a){for(var _0x582824=0x0,_0x42656e=events['length'];_0x582824<_0x42656e;_0x582824++){var _0x16f21b=events[_0x582824];var _0x462848=createListener(_0xb7ca('0x4')+_0x16f21b,_0x3f038a);ChatInteractionEvents['on'](_0x16f21b,_0x462848);}}; \ No newline at end of file +var _0xe351=['update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x368250,_0x431e8f){var _0x5d8a5d=function(_0x26a674){while(--_0x26a674){_0x368250['push'](_0x368250['shift']());}};_0x5d8a5d(++_0x431e8f);}(_0xe351,0x10b));var _0x1e35=function(_0x323e75,_0x262682){_0x323e75=_0x323e75-0x0;var _0x2a6bc6=_0xe351[_0x323e75];return _0x2a6bc6;};'use strict';var ChatInteractionEvents=require(_0x1e35('0x0'));var events=[_0x1e35('0x1'),_0x1e35('0x2'),_0x1e35('0x3')];function createListener(_0x3b2eb9,_0x19a824){return function(_0x5ec4cf){_0x19a824[_0x1e35('0x4')](_0x3b2eb9,_0x5ec4cf);};}function removeListener(_0xdb1554,_0x2798db){return function(){ChatInteractionEvents[_0x1e35('0x5')](_0xdb1554,_0x2798db);};}exports[_0x1e35('0x6')]=function(_0x2c1af8){for(var _0x3a311f=0x0,_0x4ded90=events[_0x1e35('0x7')];_0x3a311f<_0x4ded90;_0x3a311f++){var _0x20d386=events[_0x3a311f];var _0x3706d5=createListener(_0x1e35('0x8')+_0x20d386,_0x2c1af8);ChatInteractionEvents['on'](_0x20d386,_0x3706d5);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b19cd9c..b27f9ba 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 _0xdbc6=['chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','util','path','express','Router','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','file','attachmentUpload','/:id/tags','tracked','chat'];(function(_0x69fb6a,_0x46ec8d){var _0x2faee2=function(_0x56b079){while(--_0x56b079){_0x69fb6a['push'](_0x69fb6a['shift']());}};_0x2faee2(++_0x46ec8d);}(_0xdbc6,0x13f));var _0x6dbc=function(_0x2df04c,_0x3acc0f){_0x2df04c=_0x2df04c-0x0;var _0x2dad82=_0xdbc6[_0x2df04c];return _0x2dad82;};'use strict';var multer=require(_0x6dbc('0x0'));var util=require(_0x6dbc('0x1'));var path=require(_0x6dbc('0x2'));var timeout=require('connect-timeout');var express=require(_0x6dbc('0x3'));var router=express[_0x6dbc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6dbc('0x5'));var controller=require(_0x6dbc('0x6'));router['get']('/',auth[_0x6dbc('0x7')](),controller[_0x6dbc('0x8')]);router[_0x6dbc('0x9')](_0x6dbc('0xa'),auth[_0x6dbc('0x7')](),controller['describe']);router[_0x6dbc('0x9')](_0x6dbc('0xb'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x6dbc('0x9')](_0x6dbc('0xc'),auth[_0x6dbc('0xd')](),controller[_0x6dbc('0xe')]);router['get'](_0x6dbc('0xf'),auth[_0x6dbc('0x7')](),controller['getMessages']);router[_0x6dbc('0x9')](_0x6dbc('0x10'),auth[_0x6dbc('0xd')](),controller[_0x6dbc('0x11')]);router[_0x6dbc('0x9')](_0x6dbc('0x12'),auth[_0x6dbc('0x7')](),controller[_0x6dbc('0x13')]);router[_0x6dbc('0x14')]('/',auth[_0x6dbc('0x7')](),controller[_0x6dbc('0x15')]);router[_0x6dbc('0x14')](_0x6dbc('0x16'),auth[_0x6dbc('0x7')](),controller[_0x6dbc('0x17')]);var upload=multer({'storage':multer[_0x6dbc('0x18')]({'destination':function(_0x26846e,_0x51bb64,_0xe9ec86){_0xe9ec86(null,path[_0x6dbc('0x19')](config[_0x6dbc('0x1a')],_0x6dbc('0x1b')));},'filename':function(_0x1bc967,_0x3091d6,_0xf4b9ec){_0xf4b9ec(null,util[_0x6dbc('0x1c')](_0x6dbc('0x1d'),Date[_0x6dbc('0x1e')](),_0x3091d6[_0x6dbc('0x1f')][_0x6dbc('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6dbc('0x14')]('/:id/attachment_upload',upload['single'](_0x6dbc('0x21')),controller[_0x6dbc('0x22')]);router[_0x6dbc('0x14')](_0x6dbc('0xf'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router['post'](_0x6dbc('0x23'),auth[_0x6dbc('0x7')](),interaction[_0x6dbc('0x24')](_0x6dbc('0x25'),_0x6dbc('0x26')),controller[_0x6dbc('0x27')]);router[_0x6dbc('0x28')](_0x6dbc('0xb'),auth[_0x6dbc('0x7')](),interaction[_0x6dbc('0x24')](_0x6dbc('0x25'),'chatinteraction:update'),controller['update']);router[_0x6dbc('0x28')](_0x6dbc('0x29'),controller[_0x6dbc('0x2a')]);router[_0x6dbc('0x28')](_0x6dbc('0x2b'),auth[_0x6dbc('0xd')](),controller[_0x6dbc('0x2c')]);router[_0x6dbc('0x28')](_0x6dbc('0x2d'),controller[_0x6dbc('0x2e')]);router[_0x6dbc('0x2f')](_0x6dbc('0xb'),auth[_0x6dbc('0x7')](),interaction[_0x6dbc('0x24')](_0x6dbc('0x25'),_0x6dbc('0x30')),controller[_0x6dbc('0x31')]);router['delete'](_0x6dbc('0x23'),auth['isAuthenticated'](),controller['removeTags']);module[_0x6dbc('0x32')]=router; \ No newline at end of file +var _0xd978=['/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index'];(function(_0x1d0ef0,_0x2b5a52){var _0xb16eac=function(_0x4864a5){while(--_0x4864a5){_0x1d0ef0['push'](_0x1d0ef0['shift']());}};_0xb16eac(++_0x2b5a52);}(_0xd978,0xc8));var _0x8d97=function(_0x346f68,_0xb45d9d){_0x346f68=_0x346f68-0x0;var _0x2d1803=_0xd978[_0x346f68];return _0x2d1803;};'use strict';var multer=require(_0x8d97('0x0'));var util=require(_0x8d97('0x1'));var path=require(_0x8d97('0x2'));var timeout=require('connect-timeout');var express=require(_0x8d97('0x3'));var router=express[_0x8d97('0x4')]();var fs_extra=require(_0x8d97('0x5'));var auth=require(_0x8d97('0x6'));var interaction=require(_0x8d97('0x7'));var config=require('../../config/environment');var controller=require(_0x8d97('0x8'));router[_0x8d97('0x9')]('/',auth[_0x8d97('0xa')](),controller[_0x8d97('0xb')]);router[_0x8d97('0x9')]('/describe',auth[_0x8d97('0xa')](),controller['describe']);router[_0x8d97('0x9')](_0x8d97('0xc'),auth[_0x8d97('0xd')](),controller[_0x8d97('0xe')]);router[_0x8d97('0x9')](_0x8d97('0xf'),auth[_0x8d97('0xd')](),controller[_0x8d97('0x10')]);router['get'](_0x8d97('0x11'),auth[_0x8d97('0xa')](),controller[_0x8d97('0x12')]);router[_0x8d97('0x9')]('/:id/my_messages',auth[_0x8d97('0xd')](),controller[_0x8d97('0x13')]);router[_0x8d97('0x9')](_0x8d97('0x14'),auth[_0x8d97('0xa')](),controller[_0x8d97('0x15')]);router[_0x8d97('0x16')]('/',auth[_0x8d97('0xa')](),controller[_0x8d97('0x17')]);router[_0x8d97('0x16')](_0x8d97('0x18'),auth[_0x8d97('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22dc2a,_0x3d4259,_0x5741e6){_0x5741e6(null,path[_0x8d97('0x19')](config[_0x8d97('0x1a')],_0x8d97('0x1b')));},'filename':function(_0x2a2957,_0x5dd0a1,_0x6d33c6){_0x6d33c6(null,util[_0x8d97('0x1c')](_0x8d97('0x1d'),Date[_0x8d97('0x1e')](),_0x5dd0a1[_0x8d97('0x1f')][_0x8d97('0x20')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8d97('0x16')](_0x8d97('0x21'),upload[_0x8d97('0x22')](_0x8d97('0x23')),controller[_0x8d97('0x24')]);router[_0x8d97('0x16')](_0x8d97('0x11'),auth[_0x8d97('0xd')](),controller[_0x8d97('0x25')]);router[_0x8d97('0x16')](_0x8d97('0x26'),auth[_0x8d97('0xa')](),interaction[_0x8d97('0x27')]('chat','chatinteraction:addtags'),controller[_0x8d97('0x28')]);router[_0x8d97('0x29')](_0x8d97('0xc'),auth[_0x8d97('0xa')](),interaction[_0x8d97('0x27')](_0x8d97('0x2a'),_0x8d97('0x2b')),controller[_0x8d97('0x2c')]);router[_0x8d97('0x29')](_0x8d97('0x2d'),controller['customUpdate']);router[_0x8d97('0x29')](_0x8d97('0x2e'),auth[_0x8d97('0xd')](),controller['abandon']);router['put'](_0x8d97('0x2f'),controller[_0x8d97('0x30')]);router[_0x8d97('0x31')](_0x8d97('0xc'),auth[_0x8d97('0xa')](),interaction[_0x8d97('0x27')](_0x8d97('0x2a'),_0x8d97('0x32')),controller[_0x8d97('0x33')]);router[_0x8d97('0x31')](_0x8d97('0x26'),auth[_0x8d97('0xa')](),controller[_0x8d97('0x34')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 4d08d0f..4be9273 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 _0x83d1=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x214511,_0x5d5d40){var _0xd3665f=function(_0x22d6c7){while(--_0x22d6c7){_0x214511['push'](_0x214511['shift']());}};_0xd3665f(++_0x5d5d40);}(_0x83d1,0x139));var _0x183d=function(_0x4e70ab,_0x110af2){_0x4e70ab=_0x4e70ab-0x0;var _0x96cb08=_0x83d1[_0x4e70ab];return _0x96cb08;};'use strict';var Sequelize=require(_0x183d('0x0'));module['exports']={'body':{'type':Sequelize[_0x183d('0x1')](_0x183d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x183d('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x183d('0x4')]}}; \ No newline at end of file +var _0x9a40=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a40,0x97));var _0x09a4=function(_0x13db7c,_0x442054){_0x13db7c=_0x13db7c-0x0;var _0x1d4be9=_0x9a40[_0x13db7c];return _0x1d4be9;};'use strict';var Sequelize=require('sequelize');module[_0x09a4('0x0')]={'body':{'type':Sequelize[_0x09a4('0x1')](_0x09a4('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x09a4('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x09a4('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ff9b281..8e6b578 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 _0x7a71=['ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','./chatInternalMessage.socket','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','destroy','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','admin','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId'];(function(_0x37f6c0,_0x47a155){var _0x18f854=function(_0x2ba6b6){while(--_0x2ba6b6){_0x37f6c0['push'](_0x37f6c0['shift']());}};_0x18f854(++_0x47a155);}(_0x7a71,0x1c3));var _0x17a7=function(_0x467b0f,_0x8dca54){_0x467b0f=_0x467b0f-0x0;var _0x286338=_0x7a71[_0x467b0f];return _0x286338;};'use strict';var emlformat=require(_0x17a7('0x0'));var rimraf=require(_0x17a7('0x1'));var zipdir=require(_0x17a7('0x2'));var jsonpatch=require(_0x17a7('0x3'));var rp=require('request-promise');var moment=require(_0x17a7('0x4'));var BPromise=require(_0x17a7('0x5'));var Mustache=require('mustache');var util=require(_0x17a7('0x6'));var path=require(_0x17a7('0x7'));var sox=require(_0x17a7('0x8'));var csv=require(_0x17a7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17a7('0xa'));var squel=require(_0x17a7('0xb'));var crypto=require(_0x17a7('0xc'));var jsforce=require(_0x17a7('0xd'));var deskjs=require(_0x17a7('0xe'));var toCsv=require(_0x17a7('0x9'));var querystring=require(_0x17a7('0xf'));var Papa=require(_0x17a7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x17a7('0x11'));var as=require(_0x17a7('0x12'));var hardwareService=require(_0x17a7('0x13'));var logger=require(_0x17a7('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x17a7('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x17a7('0x16')]=_[_0x17a7('0x17')](config[_0x17a7('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17a7('0x16')]));require(_0x17a7('0x18'))['register'](socket);function respondWithStatusCode(_0x20a111,_0x10f313){_0x10f313=_0x10f313||0xcc;return function(_0x57bb87){if(_0x57bb87){return _0x20a111['sendStatus'](_0x10f313);}return _0x20a111[_0x17a7('0x19')](_0x10f313)['end']();};}function respondWithResult(_0x3e7997,_0x52dff8){_0x52dff8=_0x52dff8||0xc8;return function(_0x4274d9){if(_0x4274d9){return _0x3e7997[_0x17a7('0x19')](_0x52dff8)[_0x17a7('0x1a')](_0x4274d9);}};}function respondWithFilteredResult(_0x2070a0,_0x12bb79){return function(_0x113dae){if(_0x113dae){var _0x172586=typeof _0x12bb79['offset']===_0x17a7('0x1b')&&typeof _0x12bb79['limit']==='undefined';var _0x443272=_0x113dae[_0x17a7('0x1c')];var _0x1da49f=_0x172586?0x0:_0x12bb79[_0x17a7('0x1d')];var _0x442741=_0x172586?_0x113dae['count']:_0x12bb79['offset']+_0x12bb79['limit'];var _0x7ba170;if(_0x442741>=_0x443272){_0x442741=_0x443272;_0x7ba170=0xc8;}else{_0x7ba170=0xce;}_0x2070a0[_0x17a7('0x19')](_0x7ba170);return _0x2070a0[_0x17a7('0x1e')](_0x17a7('0x1f'),_0x1da49f+'-'+_0x442741+'/'+_0x443272)[_0x17a7('0x1a')](_0x113dae);}return null;};}function patchUpdates(_0x441f66){return function(_0x1f21f6){try{jsonpatch[_0x17a7('0x20')](_0x1f21f6,_0x441f66,!![]);}catch(_0x5c4f1c){return BPromise[_0x17a7('0x21')](_0x5c4f1c);}return _0x1f21f6[_0x17a7('0x22')]();};}function saveUpdates(_0x4d0db5,_0x417f5c){return function(_0x55c4a2){if(_0x55c4a2){return _0x55c4a2['update'](_0x4d0db5)[_0x17a7('0x23')](function(_0x19a629){return _0x19a629;});}return null;};}function removeEntity(_0x1f57d5,_0x47d669){return function(_0xcd3a93){if(_0xcd3a93){return _0xcd3a93['destroy']()[_0x17a7('0x23')](function(){_0x1f57d5[_0x17a7('0x19')](0xcc)[_0x17a7('0x24')]();});}};}function handleEntityNotFound(_0x440c9f,_0x1d1a39){return function(_0x3d74be){if(!_0x3d74be){_0x440c9f['sendStatus'](0x194);}return _0x3d74be;};}function handleError(_0x5ddc85,_0x4343f0){_0x4343f0=_0x4343f0||0x1f4;return function(_0x31e1bb){logger[_0x17a7('0x25')](_0x31e1bb[_0x17a7('0x26')]);if(_0x31e1bb['name']){delete _0x31e1bb[_0x17a7('0x27')];}_0x5ddc85[_0x17a7('0x19')](_0x4343f0)[_0x17a7('0x28')](_0x31e1bb);};}exports[_0x17a7('0x29')]=function(_0x82ec0b,_0x5785f3){var _0x3bb11b={},_0x34639f={},_0x3952c4={'count':0x0,'rows':[]};var _0x385af3=_[_0x17a7('0x2a')](db[_0x17a7('0x2b')][_0x17a7('0x2c')],function(_0x3ba83e){return{'name':_0x3ba83e[_0x17a7('0x2d')],'type':_0x3ba83e['type'][_0x17a7('0x2e')]};});_0x34639f[_0x17a7('0x2f')]=_['map'](_0x385af3,'name');_0x34639f['query']=_[_0x17a7('0x30')](_0x82ec0b[_0x17a7('0x31')]);_0x34639f[_0x17a7('0x32')]=_[_0x17a7('0x33')](_0x34639f[_0x17a7('0x2f')],_0x34639f['query']);_0x3bb11b[_0x17a7('0x34')]=_[_0x17a7('0x33')](_0x34639f[_0x17a7('0x2f')],qs[_0x17a7('0x35')](_0x82ec0b[_0x17a7('0x31')][_0x17a7('0x35')]));_0x3bb11b[_0x17a7('0x34')]=_0x3bb11b[_0x17a7('0x34')][_0x17a7('0x36')]?_0x3bb11b['attributes']:_0x34639f[_0x17a7('0x2f')];if(!_0x82ec0b['query'][_0x17a7('0x37')](_0x17a7('0x38'))){_0x3bb11b[_0x17a7('0x39')]=qs[_0x17a7('0x39')](_0x82ec0b['query'][_0x17a7('0x39')]);_0x3bb11b[_0x17a7('0x1d')]=qs[_0x17a7('0x1d')](_0x82ec0b[_0x17a7('0x31')][_0x17a7('0x1d')]);}_0x3bb11b[_0x17a7('0x3a')]=qs[_0x17a7('0x3b')](_0x82ec0b['query']['sort']);_0x3bb11b[_0x17a7('0x3c')]=qs['filters'](_[_0x17a7('0x3d')](_0x82ec0b[_0x17a7('0x31')],_0x34639f['filters']),_0x385af3);if(_0x82ec0b['query'][_0x17a7('0x3e')]){_0x3bb11b['where']=_[_0x17a7('0x3f')](_0x3bb11b[_0x17a7('0x3c')],{'$or':_[_0x17a7('0x2a')](_0x385af3,function(_0x1b51b1){if(_0x1b51b1[_0x17a7('0x40')]!==_0x17a7('0x41')){var _0x2917df={};_0x2917df[_0x1b51b1[_0x17a7('0x27')]]={'$like':'%'+_0x82ec0b[_0x17a7('0x31')][_0x17a7('0x3e')]+'%'};return _0x2917df;}})});}_0x3bb11b=_['merge']({},_0x3bb11b,_0x82ec0b[_0x17a7('0x42')]);var _0x47d96a={'where':_0x3bb11b['where']};return db[_0x17a7('0x2b')][_0x17a7('0x1c')](_0x47d96a)[_0x17a7('0x23')](function(_0x504ca2){_0x3952c4[_0x17a7('0x1c')]=_0x504ca2;if(_0x82ec0b[_0x17a7('0x31')][_0x17a7('0x43')]){_0x3bb11b['include']=[{'all':!![]}];}return db[_0x17a7('0x2b')][_0x17a7('0x44')](_0x3bb11b);})[_0x17a7('0x23')](function(_0x4fb2e1){_0x3952c4[_0x17a7('0x45')]=_0x4fb2e1;return _0x3952c4;})[_0x17a7('0x23')](respondWithFilteredResult(_0x5785f3,_0x3bb11b))[_0x17a7('0x46')](handleError(_0x5785f3,null));};exports[_0x17a7('0x47')]=function(_0x30571d,_0x2e0ab0){var _0x309082={'raw':!![],'where':{'id':_0x30571d[_0x17a7('0x48')]['id']}},_0x340e3a={};_0x340e3a[_0x17a7('0x2f')]=_[_0x17a7('0x30')](db[_0x17a7('0x2b')]['rawAttributes']);_0x340e3a[_0x17a7('0x31')]=_[_0x17a7('0x30')](_0x30571d[_0x17a7('0x31')]);_0x340e3a['filters']=_[_0x17a7('0x33')](_0x340e3a[_0x17a7('0x2f')],_0x340e3a[_0x17a7('0x31')]);_0x309082['attributes']=_[_0x17a7('0x33')](_0x340e3a['model'],qs['fields'](_0x30571d['query'][_0x17a7('0x35')]));_0x309082[_0x17a7('0x34')]=_0x309082[_0x17a7('0x34')][_0x17a7('0x36')]?_0x309082[_0x17a7('0x34')]:_0x340e3a[_0x17a7('0x2f')];if(_0x30571d[_0x17a7('0x31')][_0x17a7('0x43')]){_0x309082[_0x17a7('0x49')]=[{'all':!![]}];}_0x309082=_[_0x17a7('0x3f')]({},_0x309082,_0x30571d[_0x17a7('0x42')]);return db['ChatInternalMessage'][_0x17a7('0x4a')](_0x309082)['then'](handleEntityNotFound(_0x2e0ab0,null))[_0x17a7('0x23')](respondWithResult(_0x2e0ab0,null))['catch'](handleError(_0x2e0ab0,null));};exports[_0x17a7('0x4b')]=function(_0x44f4a2,_0xe7a38c){return db[_0x17a7('0x2b')]['create'](_0x44f4a2['body'],{})[_0x17a7('0x23')](respondWithResult(_0xe7a38c,0xc9))[_0x17a7('0x46')](handleError(_0xe7a38c,null));};exports[_0x17a7('0x4c')]=function(_0x55c640,_0x25176e){if(_0x55c640['body']['id']){delete _0x55c640['body']['id'];}return db[_0x17a7('0x2b')][_0x17a7('0x4a')]({'where':{'id':_0x55c640[_0x17a7('0x48')]['id']}})[_0x17a7('0x23')](handleEntityNotFound(_0x25176e,null))[_0x17a7('0x23')](saveUpdates(_0x55c640[_0x17a7('0x4d')],null))[_0x17a7('0x23')](respondWithResult(_0x25176e,null))[_0x17a7('0x46')](handleError(_0x25176e,null));};exports[_0x17a7('0x4e')]=function(_0x2162be,_0x5d9ae5){return db['ChatInternalMessage']['find']({'where':{'id':_0x2162be[_0x17a7('0x48')]['id']}})[_0x17a7('0x23')](handleEntityNotFound(_0x5d9ae5,null))[_0x17a7('0x23')](removeEntity(_0x5d9ae5,null))[_0x17a7('0x46')](handleError(_0x5d9ae5,null));};exports['describe']=function(_0x575be7,_0x5ea5d2){return db[_0x17a7('0x2b')]['describe']()[_0x17a7('0x23')](respondWithResult(_0x5ea5d2,null))[_0x17a7('0x46')](handleError(_0x5ea5d2,null));};function wrapUser(_0x122a1e){return function(_0x48803b){var _0x1e1480=_0x122a1e[_0x17a7('0x4f')]({'plain':!![]});_0x1e1480[_0x17a7('0x50')]=[];if(_0x48803b){_0x1e1480['lastMessageAt']=_0x48803b['createdAt'];_0x1e1480['lastMessage']=_0x48803b;}else{_0x1e1480[_0x17a7('0x51')]=moment(0x0)[_0x17a7('0x52')](_0x17a7('0x53'));_0x1e1480[_0x17a7('0x54')]={};}return _0x1e1480;};}exports[_0x17a7('0x55')]=function(_0x2c0999,_0x174d70,_0x576bf6){var _0x2f0f64=[];return db[_0x17a7('0x56')]['findAll']({'where':{'role':['agent',_0x17a7('0x57'),_0x17a7('0x58')]},'attributes':['id',_0x17a7('0x59'),'name','role',_0x17a7('0x5a'),_0x17a7('0x5b'),'online',_0x17a7('0x5c'),_0x17a7('0x5d'),_0x17a7('0x5e')],'order':qs[_0x17a7('0x3b')](_0x17a7('0x5f')),'include':[{'model':db[_0x17a7('0x60')],'as':_0x17a7('0x61'),'attributes':['id',_0x17a7('0x27'),_0x17a7('0x40')],'through':{'attributes':[]}}]})[_0x17a7('0x23')](function(_0x34b417){if(_0x34b417){var _0x589ece=_0x2c0999[_0x17a7('0x58')][_0x17a7('0x4f')]({'plain':!![]});if(!_0x589ece)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x589ece[_0x17a7('0x62')]===_0x17a7('0x58')){return db[_0x17a7('0x63')][_0x17a7('0x4a')]({'where':{'name':_0x17a7('0x64'),'userProfileId':_0x589ece[_0x17a7('0x65')]},'raw':!![]})['then'](function(_0x5e0182){if(_0x5e0182){if(_0x5e0182[_0x17a7('0x66')]===0x0){return db[_0x17a7('0x67')][_0x17a7('0x44')]({'where':{'sectionId':_0x5e0182['id']},'raw':!![]})[_0x17a7('0x23')](function(_0x195153){var _0x1c951a=[];if(_[_0x17a7('0x68')](_0x195153)){_0x1c951a=_['filter'](_0x34b417,function(_0x4c3461){if(_0x4c3461[_0x17a7('0x62')]!==_0x17a7('0x69')){return _0x4c3461;}});return _0x1c951a;}else{for(var _0x5c85a3=0x0;_0x5c85a3<_0x34b417[_0x17a7('0x36')];_0x5c85a3++){var _0x54a646=_0x34b417[_0x5c85a3];if(_0x54a646[_0x17a7('0x62')]===_0x17a7('0x69')){var _0x3facc2=_[_0x17a7('0x4a')](_0x195153,function(_0x42ddbe){return _0x42ddbe[_0x17a7('0x6a')]===_0x54a646['id'];});if(_0x3facc2)_0x1c951a[_0x17a7('0x6b')](_0x54a646);}else{_0x1c951a['push'](_0x54a646);}}return _0x1c951a;}});}else{return _0x34b417;}}else{var _0x2c114b=_[_0x17a7('0x3e')](_0x34b417,function(_0x108641){if(_0x108641[_0x17a7('0x62')]!=='agent'){return _0x108641;}});return _0x2c114b;}});}else{return _0x34b417;}}})[_0x17a7('0x23')](function(_0x343d73){var _0x51bf77=[];if(_0x343d73){_0x2f0f64=_0x343d73;for(var _0x155f1a=0x0;_0x155f1a<_0x343d73['length'];_0x155f1a+=0x1){_0x2f0f64[_0x155f1a]['messages']=[];_0x51bf77['push'](db[_0x17a7('0x2b')][_0x17a7('0x4a')]({'where':{'FromId':[_0x2c0999['user']['id'],_0x343d73[_0x155f1a]['id']],'ToId':[_0x2c0999['user']['id'],_0x343d73[_0x155f1a]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x17a7('0x6c'),_0x17a7('0x6d'),_0x17a7('0x6e'),_0x17a7('0x4d')],'order':qs[_0x17a7('0x3b')](_0x17a7('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x17a7('0x23')](wrapUser(_0x343d73[_0x155f1a])));}return BPromise['all'](_0x51bf77);}return[];})[_0x17a7('0x23')](function(_0x938cd4){return{'rows':_0x938cd4,'count':_0x938cd4[_0x17a7('0x36')]};})['then'](respondWithResult(_0x174d70,null))[_0x17a7('0x46')](handleError(_0x174d70,null));}; \ No newline at end of file +var _0x9741=['rows','show','params','find','body','catch','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','internal','online','-online','VoiceQueue','VoiceQueues','UserProfileSection','Agents','autoAssociation','isEmpty','filter','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x9741,0xed));var _0x1974=function(_0x4f9f78,_0x14c6a3){_0x4f9f78=_0x4f9f78-0x0;var _0x328fb7=_0x9741[_0x4f9f78];return _0x328fb7;};'use strict';var emlformat=require(_0x1974('0x0'));var rimraf=require(_0x1974('0x1'));var zipdir=require(_0x1974('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1974('0x3'));var moment=require(_0x1974('0x4'));var BPromise=require(_0x1974('0x5'));var Mustache=require(_0x1974('0x6'));var util=require(_0x1974('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1974('0x8'));var jsforce=require(_0x1974('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x1974('0xa'));var querystring=require(_0x1974('0xb'));var Papa=require('papaparse');var Redis=require(_0x1974('0xc'));var authService=require(_0x1974('0xd'));var qs=require(_0x1974('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1974('0xf'));var utils=require(_0x1974('0x10'));var config=require(_0x1974('0x11'));var licenseUtil=require(_0x1974('0x12'));var db=require(_0x1974('0x13'))['db'];config[_0x1974('0x14')]=_[_0x1974('0x15')](config[_0x1974('0x14')],{'host':_0x1974('0x16'),'port':0x18eb});var socket=require(_0x1974('0x17'))(new Redis(config[_0x1974('0x14')]));require(_0x1974('0x18'))['register'](socket);function respondWithStatusCode(_0x2447d4,_0x415f8c){_0x415f8c=_0x415f8c||0xcc;return function(_0xab3105){if(_0xab3105){return _0x2447d4[_0x1974('0x19')](_0x415f8c);}return _0x2447d4[_0x1974('0x1a')](_0x415f8c)['end']();};}function respondWithResult(_0x59a6d6,_0x191bbe){_0x191bbe=_0x191bbe||0xc8;return function(_0x55c0a9){if(_0x55c0a9){return _0x59a6d6[_0x1974('0x1a')](_0x191bbe)[_0x1974('0x1b')](_0x55c0a9);}};}function respondWithFilteredResult(_0x4bc3b5,_0x2e8570){return function(_0x14479e){if(_0x14479e){var _0x4844fe=typeof _0x2e8570[_0x1974('0x1c')]==='undefined'&&typeof _0x2e8570[_0x1974('0x1d')]===_0x1974('0x1e');var _0x452f81=_0x14479e[_0x1974('0x1f')];var _0x187eca=_0x4844fe?0x0:_0x2e8570[_0x1974('0x1c')];var _0x5c9499=_0x4844fe?_0x14479e[_0x1974('0x1f')]:_0x2e8570['offset']+_0x2e8570['limit'];var _0x3311cd;if(_0x5c9499>=_0x452f81){_0x5c9499=_0x452f81;_0x3311cd=0xc8;}else{_0x3311cd=0xce;}_0x4bc3b5[_0x1974('0x1a')](_0x3311cd);return _0x4bc3b5['set'](_0x1974('0x20'),_0x187eca+'-'+_0x5c9499+'/'+_0x452f81)[_0x1974('0x1b')](_0x14479e);}return null;};}function patchUpdates(_0x5dec38){return function(_0x3cf6dd){try{jsonpatch[_0x1974('0x21')](_0x3cf6dd,_0x5dec38,!![]);}catch(_0x3c750c){return BPromise[_0x1974('0x22')](_0x3c750c);}return _0x3cf6dd[_0x1974('0x23')]();};}function saveUpdates(_0x378722,_0x4d5d69){return function(_0x38476d){if(_0x38476d){return _0x38476d[_0x1974('0x24')](_0x378722)['then'](function(_0x15fdbf){return _0x15fdbf;});}return null;};}function removeEntity(_0x4a2965,_0x47f5db){return function(_0x34388d){if(_0x34388d){return _0x34388d[_0x1974('0x25')]()[_0x1974('0x26')](function(){_0x4a2965['status'](0xcc)[_0x1974('0x27')]();});}};}function handleEntityNotFound(_0x2e6fb5,_0x411366){return function(_0x475d64){if(!_0x475d64){_0x2e6fb5[_0x1974('0x19')](0x194);}return _0x475d64;};}function handleError(_0x8b50bb,_0x302025){_0x302025=_0x302025||0x1f4;return function(_0xbc3c81){logger[_0x1974('0x28')](_0xbc3c81['stack']);if(_0xbc3c81[_0x1974('0x29')]){delete _0xbc3c81[_0x1974('0x29')];}_0x8b50bb['status'](_0x302025)[_0x1974('0x2a')](_0xbc3c81);};}exports[_0x1974('0x2b')]=function(_0x43ab39,_0x112f55){var _0x361d4a={},_0x46f8ee={},_0x194b47={'count':0x0,'rows':[]};var _0x2eaa0b=_[_0x1974('0x2c')](db['ChatInternalMessage'][_0x1974('0x2d')],function(_0x3444ae){return{'name':_0x3444ae['fieldName'],'type':_0x3444ae[_0x1974('0x2e')]['key']};});_0x46f8ee[_0x1974('0x2f')]=_[_0x1974('0x2c')](_0x2eaa0b,_0x1974('0x29'));_0x46f8ee['query']=_['keys'](_0x43ab39[_0x1974('0x30')]);_0x46f8ee[_0x1974('0x31')]=_[_0x1974('0x32')](_0x46f8ee[_0x1974('0x2f')],_0x46f8ee[_0x1974('0x30')]);_0x361d4a['attributes']=_[_0x1974('0x32')](_0x46f8ee[_0x1974('0x2f')],qs[_0x1974('0x33')](_0x43ab39[_0x1974('0x30')][_0x1974('0x33')]));_0x361d4a[_0x1974('0x34')]=_0x361d4a[_0x1974('0x34')][_0x1974('0x35')]?_0x361d4a['attributes']:_0x46f8ee[_0x1974('0x2f')];if(!_0x43ab39[_0x1974('0x30')][_0x1974('0x36')](_0x1974('0x37'))){_0x361d4a['limit']=qs[_0x1974('0x1d')](_0x43ab39[_0x1974('0x30')][_0x1974('0x1d')]);_0x361d4a[_0x1974('0x1c')]=qs[_0x1974('0x1c')](_0x43ab39[_0x1974('0x30')][_0x1974('0x1c')]);}_0x361d4a[_0x1974('0x38')]=qs[_0x1974('0x39')](_0x43ab39[_0x1974('0x30')][_0x1974('0x39')]);_0x361d4a[_0x1974('0x3a')]=qs[_0x1974('0x31')](_['pick'](_0x43ab39[_0x1974('0x30')],_0x46f8ee[_0x1974('0x31')]),_0x2eaa0b);if(_0x43ab39[_0x1974('0x30')]['filter']){_0x361d4a['where']=_[_0x1974('0x3b')](_0x361d4a['where'],{'$or':_['map'](_0x2eaa0b,function(_0x259057){if(_0x259057['type']!==_0x1974('0x3c')){var _0x45159d={};_0x45159d[_0x259057[_0x1974('0x29')]]={'$like':'%'+_0x43ab39['query']['filter']+'%'};return _0x45159d;}})});}_0x361d4a=_['merge']({},_0x361d4a,_0x43ab39[_0x1974('0x3d')]);var _0x28768d={'where':_0x361d4a[_0x1974('0x3a')]};return db[_0x1974('0x3e')][_0x1974('0x1f')](_0x28768d)['then'](function(_0x203c17){_0x194b47[_0x1974('0x1f')]=_0x203c17;if(_0x43ab39['query'][_0x1974('0x3f')]){_0x361d4a[_0x1974('0x40')]=[{'all':!![]}];}return db[_0x1974('0x3e')][_0x1974('0x41')](_0x361d4a);})['then'](function(_0x5aa724){_0x194b47[_0x1974('0x42')]=_0x5aa724;return _0x194b47;})['then'](respondWithFilteredResult(_0x112f55,_0x361d4a))['catch'](handleError(_0x112f55,null));};exports[_0x1974('0x43')]=function(_0xca6c68,_0x3cafad){var _0x10f2a4={'raw':!![],'where':{'id':_0xca6c68[_0x1974('0x44')]['id']}},_0x141d9b={};_0x141d9b['model']=_['keys'](db[_0x1974('0x3e')][_0x1974('0x2d')]);_0x141d9b[_0x1974('0x30')]=_['keys'](_0xca6c68['query']);_0x141d9b[_0x1974('0x31')]=_[_0x1974('0x32')](_0x141d9b[_0x1974('0x2f')],_0x141d9b[_0x1974('0x30')]);_0x10f2a4['attributes']=_[_0x1974('0x32')](_0x141d9b[_0x1974('0x2f')],qs[_0x1974('0x33')](_0xca6c68[_0x1974('0x30')]['fields']));_0x10f2a4['attributes']=_0x10f2a4[_0x1974('0x34')][_0x1974('0x35')]?_0x10f2a4[_0x1974('0x34')]:_0x141d9b['model'];if(_0xca6c68[_0x1974('0x30')][_0x1974('0x3f')]){_0x10f2a4[_0x1974('0x40')]=[{'all':!![]}];}_0x10f2a4=_[_0x1974('0x3b')]({},_0x10f2a4,_0xca6c68[_0x1974('0x3d')]);return db[_0x1974('0x3e')][_0x1974('0x45')](_0x10f2a4)[_0x1974('0x26')](handleEntityNotFound(_0x3cafad,null))['then'](respondWithResult(_0x3cafad,null))['catch'](handleError(_0x3cafad,null));};exports['create']=function(_0x5d0a56,_0x3ce204){return db[_0x1974('0x3e')]['create'](_0x5d0a56[_0x1974('0x46')],{})['then'](respondWithResult(_0x3ce204,0xc9))['catch'](handleError(_0x3ce204,null));};exports[_0x1974('0x24')]=function(_0x3c12b2,_0x5a5507){if(_0x3c12b2[_0x1974('0x46')]['id']){delete _0x3c12b2['body']['id'];}return db[_0x1974('0x3e')]['find']({'where':{'id':_0x3c12b2['params']['id']}})['then'](handleEntityNotFound(_0x5a5507,null))[_0x1974('0x26')](saveUpdates(_0x3c12b2[_0x1974('0x46')],null))[_0x1974('0x26')](respondWithResult(_0x5a5507,null))['catch'](handleError(_0x5a5507,null));};exports[_0x1974('0x25')]=function(_0x53b6cc,_0x96c9a5){return db[_0x1974('0x3e')][_0x1974('0x45')]({'where':{'id':_0x53b6cc['params']['id']}})[_0x1974('0x26')](handleEntityNotFound(_0x96c9a5,null))[_0x1974('0x26')](removeEntity(_0x96c9a5,null))[_0x1974('0x47')](handleError(_0x96c9a5,null));};exports[_0x1974('0x48')]=function(_0xe052c0,_0x4e0b1a){return db['ChatInternalMessage'][_0x1974('0x48')]()['then'](respondWithResult(_0x4e0b1a,null))[_0x1974('0x47')](handleError(_0x4e0b1a,null));};function wrapUser(_0x1584c2){return function(_0x30604a){var _0x246b53=_0x1584c2[_0x1974('0x49')]({'plain':!![]});_0x246b53[_0x1974('0x4a')]=[];if(_0x30604a){_0x246b53['lastMessageAt']=_0x30604a[_0x1974('0x4b')];_0x246b53[_0x1974('0x4c')]=_0x30604a;}else{_0x246b53[_0x1974('0x4d')]=moment(0x0)[_0x1974('0x4e')](_0x1974('0x4f'));_0x246b53[_0x1974('0x4c')]={};}return _0x246b53;};}exports[_0x1974('0x50')]=function(_0x3f134a,_0x5190a5,_0xf19540){var _0x4b162b=[];return db[_0x1974('0x51')][_0x1974('0x41')]({'where':{'role':[_0x1974('0x52'),'admin',_0x1974('0x53')]},'attributes':['id',_0x1974('0x54'),_0x1974('0x29'),_0x1974('0x55'),'userpic',_0x1974('0x56'),_0x1974('0x57'),'lastLoginAt','allowmessenger','showWebBar'],'order':qs[_0x1974('0x39')](_0x1974('0x58')),'include':[{'model':db[_0x1974('0x59')],'as':_0x1974('0x5a'),'attributes':['id',_0x1974('0x29'),_0x1974('0x2e')],'through':{'attributes':[]}}]})[_0x1974('0x26')](function(_0x4d88a0){if(_0x4d88a0){var _0x257493=_0x3f134a[_0x1974('0x53')][_0x1974('0x49')]({'plain':!![]});if(!_0x257493)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x257493[_0x1974('0x55')]===_0x1974('0x53')){return db[_0x1974('0x5b')][_0x1974('0x45')]({'where':{'name':_0x1974('0x5c'),'userProfileId':_0x257493['userProfileId']},'raw':!![]})[_0x1974('0x26')](function(_0x321057){if(_0x321057){if(_0x321057[_0x1974('0x5d')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x321057['id']},'raw':!![]})['then'](function(_0x2f5789){var _0x200809=[];if(_[_0x1974('0x5e')](_0x2f5789)){_0x200809=_[_0x1974('0x5f')](_0x4d88a0,function(_0x3cbd33){if(_0x3cbd33[_0x1974('0x55')]!==_0x1974('0x52')){return _0x3cbd33;}});return _0x200809;}else{for(var _0x5383fa=0x0;_0x5383fa<_0x4d88a0['length'];_0x5383fa++){var _0x301ea2=_0x4d88a0[_0x5383fa];if(_0x301ea2[_0x1974('0x55')]===_0x1974('0x52')){var _0x31d5c0=_[_0x1974('0x45')](_0x2f5789,function(_0x1daed5){return _0x1daed5['resourceId']===_0x301ea2['id'];});if(_0x31d5c0)_0x200809[_0x1974('0x60')](_0x301ea2);}else{_0x200809['push'](_0x301ea2);}}return _0x200809;}});}else{return _0x4d88a0;}}else{var _0x528d7b=_[_0x1974('0x5f')](_0x4d88a0,function(_0x188819){if(_0x188819[_0x1974('0x55')]!==_0x1974('0x52')){return _0x188819;}});return _0x528d7b;}});}else{return _0x4d88a0;}}})[_0x1974('0x26')](function(_0x4bdd24){var _0x3b468f=[];if(_0x4bdd24){_0x4b162b=_0x4bdd24;for(var _0x4c98e8=0x0;_0x4c98e8<_0x4bdd24[_0x1974('0x35')];_0x4c98e8+=0x1){_0x4b162b[_0x4c98e8][_0x1974('0x4a')]=[];_0x3b468f[_0x1974('0x60')](db['ChatInternalMessage'][_0x1974('0x45')]({'where':{'FromId':[_0x3f134a[_0x1974('0x53')]['id'],_0x4bdd24[_0x4c98e8]['id']],'ToId':[_0x3f134a[_0x1974('0x53')]['id'],_0x4bdd24[_0x4c98e8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x1974('0x61'),_0x1974('0x62'),_0x1974('0x63'),_0x1974('0x46')],'order':qs[_0x1974('0x39')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x4bdd24[_0x4c98e8])));}return BPromise[_0x1974('0x64')](_0x3b468f);}return[];})[_0x1974('0x26')](function(_0x469f14){return{'rows':_0x469f14,'count':_0x469f14['length']};})[_0x1974('0x26')](respondWithResult(_0x5190a5,null))[_0x1974('0x47')](handleError(_0x5190a5,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index e3bf334..f5983df 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 _0x9e91=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x5777d3,_0x586040){var _0x5c3298=function(_0x189e96){while(--_0x189e96){_0x5777d3['push'](_0x5777d3['shift']());}};_0x5c3298(++_0x586040);}(_0x9e91,0x138));var _0x19e9=function(_0x3d3d55,_0x370a27){_0x3d3d55=_0x3d3d55-0x0;var _0x205c22=_0x9e91[_0x3d3d55];return _0x205c22;};'use strict';var EventEmitter=require(_0x19e9('0x0'));var ChatInternalMessage=require(_0x19e9('0x1'))['db'][_0x19e9('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x19e9('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x19e9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x538e4b){return function(_0x5748b2,_0xd51f78,_0x22df51){ChatInternalMessageEvents[_0x19e9('0x5')](_0x538e4b+':'+_0x5748b2['id'],_0x5748b2);ChatInternalMessageEvents[_0x19e9('0x5')](_0x538e4b,_0x5748b2);_0x22df51(null);};}for(var e in events){if(events[_0x19e9('0x6')](e)){var event=events[e];ChatInternalMessage[_0x19e9('0x7')](e,emitEvent(event));}}module[_0x19e9('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x6d35=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x6d35,0xd7));var _0x56d3=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x6d35[_0x25662e];return _0x59b7bc;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x56d3('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x56d3('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x56d3('0x2'),'afterDestroy':_0x56d3('0x3')};function emitEvent(_0x1e4118){return function(_0x14e585,_0x1dc2e2,_0x1cc223){ChatInternalMessageEvents[_0x56d3('0x4')](_0x1e4118+':'+_0x14e585['id'],_0x14e585);ChatInternalMessageEvents['emit'](_0x1e4118,_0x14e585);_0x1cc223(null);};}for(var e in events){if(events[_0x56d3('0x5')](e)){var event=events[e];ChatInternalMessage[_0x56d3('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 7611377..b69268a 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 _0x9a9b=['path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3d474e,_0x431f54){var _0x30b3e3=function(_0xbe43e){while(--_0xbe43e){_0x3d474e['push'](_0x3d474e['shift']());}};_0x30b3e3(++_0x431f54);}(_0x9a9b,0xb0));var _0xb9a9=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x9a9b[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xb9a9('0x0'));var util=require(_0xb9a9('0x1'));var logger=require(_0xb9a9('0x2'))(_0xb9a9('0x3'));var moment=require('moment');var BPromise=require(_0xb9a9('0x4'));var rp=require(_0xb9a9('0x5'));var fs=require('fs');var path=require(_0xb9a9('0x6'));var rimraf=require('rimraf');var config=require(_0xb9a9('0x7'));var attributes=require(_0xb9a9('0x8'));module[_0xb9a9('0x9')]=function(_0x5cf3df,_0x517f42){return _0x5cf3df[_0xb9a9('0xa')](_0xb9a9('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9a9('0xc'),'collate':_0xb9a9('0xd')});}; \ No newline at end of file +var _0xf787=['./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x17e653,_0x4c21e9){var _0x4341a1=function(_0xaac312){while(--_0xaac312){_0x17e653['push'](_0x17e653['shift']());}};_0x4341a1(++_0x4c21e9);}(_0xf787,0x139));var _0x7f78=function(_0x501191,_0x39efe3){_0x501191=_0x501191-0x0;var _0x4b3f94=_0xf787[_0x501191];return _0x4b3f94;};'use strict';var _=require(_0x7f78('0x0'));var util=require(_0x7f78('0x1'));var logger=require(_0x7f78('0x2'))(_0x7f78('0x3'));var moment=require(_0x7f78('0x4'));var BPromise=require('bluebird');var rp=require(_0x7f78('0x5'));var fs=require('fs');var path=require(_0x7f78('0x6'));var rimraf=require(_0x7f78('0x7'));var config=require(_0x7f78('0x8'));var attributes=require(_0x7f78('0x9'));module[_0x7f78('0xa')]=function(_0x319eda,_0x55ae85){return _0x319eda[_0x7f78('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7f78('0xc'),'collate':_0x7f78('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 133d311..415da7a 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 _0x815b=['register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','./chatInternalMessage.socket'];(function(_0x22cb5f,_0x2cdd63){var _0x274d36=function(_0x421472){while(--_0x421472){_0x22cb5f['push'](_0x22cb5f['shift']());}};_0x274d36(++_0x2cdd63);}(_0x815b,0xb4));var _0xb815=function(_0x3b0247,_0x40e5b5){_0x3b0247=_0x3b0247-0x0;var _0xec9ea9=_0x815b[_0x3b0247];return _0xec9ea9;};'use strict';var _=require(_0xb815('0x0'));var util=require(_0xb815('0x1'));var moment=require(_0xb815('0x2'));var BPromise=require(_0xb815('0x3'));var rs=require(_0xb815('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb815('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb815('0x6'));var config=require(_0xb815('0x7'));var jayson=require(_0xb815('0x8'));var client=jayson['client'][_0xb815('0x9')]({'port':0x232a});config[_0xb815('0xa')]=_['defaults'](config[_0xb815('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb815('0xa')]));require(_0xb815('0xb'))[_0xb815('0xc')](socket);function respondWithRpcPromise(_0x38128c,_0x2f673f,_0x1ad8eb){return new BPromise(function(_0x402def,_0x205a49){return client['request'](_0x38128c,_0x1ad8eb)[_0xb815('0xd')](function(_0x11abab){logger[_0xb815('0xe')](_0xb815('0xf'),_0x2f673f,_0xb815('0x10'));logger[_0xb815('0x11')](_0xb815('0x12'),_0x2f673f,'request\x20sent',JSON['stringify'](_0x11abab));if(_0x11abab[_0xb815('0x13')]){if(_0x11abab[_0xb815('0x13')][_0xb815('0x14')]===0x1f4){logger[_0xb815('0x13')](_0xb815('0xf'),_0x2f673f,_0x11abab[_0xb815('0x13')][_0xb815('0x15')]);return _0x205a49(_0x11abab[_0xb815('0x13')][_0xb815('0x15')]);}logger[_0xb815('0x13')](_0xb815('0xf'),_0x2f673f,_0x11abab[_0xb815('0x13')][_0xb815('0x15')]);return _0x402def(_0x11abab['error']['message']);}else{logger[_0xb815('0xe')](_0xb815('0xf'),_0x2f673f,_0xb815('0x10'));_0x402def(_0x11abab[_0xb815('0x16')][_0xb815('0x15')]);}})[_0xb815('0x17')](function(_0xf22d35){logger[_0xb815('0x13')](_0xb815('0xf'),_0x2f673f,_0xf22d35);_0x205a49(_0xf22d35);});});} \ No newline at end of file +var _0x0f54=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x98d118,_0x465c8a){var _0xc353c4=function(_0x319aa8){while(--_0x319aa8){_0x98d118['push'](_0x98d118['shift']());}};_0xc353c4(++_0x465c8a);}(_0x0f54,0x1db));var _0x40f5=function(_0x1e88cb,_0x3d8d88){_0x1e88cb=_0x1e88cb-0x0;var _0x12a9d0=_0x0f54[_0x1e88cb];return _0x12a9d0;};'use strict';var _=require(_0x40f5('0x0'));var util=require(_0x40f5('0x1'));var moment=require('moment');var BPromise=require(_0x40f5('0x2'));var rs=require(_0x40f5('0x3'));var fs=require('fs');var Redis=require(_0x40f5('0x4'));var db=require(_0x40f5('0x5'))['db'];var utils=require(_0x40f5('0x6'));var logger=require(_0x40f5('0x7'))(_0x40f5('0x8'));var config=require(_0x40f5('0x9'));var jayson=require(_0x40f5('0xa'));var client=jayson[_0x40f5('0xb')][_0x40f5('0xc')]({'port':0x232a});config['redis']=_[_0x40f5('0xd')](config[_0x40f5('0xe')],{'host':_0x40f5('0xf'),'port':0x18eb});var socket=require(_0x40f5('0x10'))(new Redis(config[_0x40f5('0xe')]));require(_0x40f5('0x11'))[_0x40f5('0x12')](socket);function respondWithRpcPromise(_0x7ae80,_0x1a2225,_0x495f1c){return new BPromise(function(_0x71902c,_0xed80cb){return client[_0x40f5('0x13')](_0x7ae80,_0x495f1c)[_0x40f5('0x14')](function(_0x5e559a){logger[_0x40f5('0x15')](_0x40f5('0x16'),_0x1a2225,_0x40f5('0x17'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1a2225,_0x40f5('0x17'),JSON[_0x40f5('0x18')](_0x5e559a));if(_0x5e559a['error']){if(_0x5e559a['error'][_0x40f5('0x19')]===0x1f4){logger[_0x40f5('0x1a')](_0x40f5('0x16'),_0x1a2225,_0x5e559a[_0x40f5('0x1a')]['message']);return _0xed80cb(_0x5e559a[_0x40f5('0x1a')][_0x40f5('0x1b')]);}logger[_0x40f5('0x1a')](_0x40f5('0x16'),_0x1a2225,_0x5e559a[_0x40f5('0x1a')][_0x40f5('0x1b')]);return _0x71902c(_0x5e559a[_0x40f5('0x1a')][_0x40f5('0x1b')]);}else{logger[_0x40f5('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x1a2225,_0x40f5('0x17'));_0x71902c(_0x5e559a[_0x40f5('0x1c')][_0x40f5('0x1b')]);}})['catch'](function(_0x225e46){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x1a2225,_0x225e46);_0xed80cb(_0x225e46);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 8c4f07a..5a25536 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 _0x05bc=['length','./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x3a3903,_0x4ea1ab){var _0x4a6a80=function(_0x2c4375){while(--_0x2c4375){_0x3a3903['push'](_0x3a3903['shift']());}};_0x4a6a80(++_0x4ea1ab);}(_0x05bc,0x10b));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xc05b('0x0'));var events=['save',_0xc05b('0x1'),_0xc05b('0x2')];function createListener(_0x4fc430,_0x422ecd){return function(_0x6da2e7){_0x422ecd[_0xc05b('0x3')](_0x4fc430,_0x6da2e7);};}function removeListener(_0x28203f,_0x331a15){return function(){ChatInternalMessageEvents[_0xc05b('0x4')](_0x28203f,_0x331a15);};}exports[_0xc05b('0x5')]=function(_0x1a879f){for(var _0x38a63a=0x0,_0x4ad978=events[_0xc05b('0x6')];_0x38a63a<_0x4ad978;_0x38a63a++){var _0x929589=events[_0x38a63a];var _0x1f1bee=createListener('chatInternalMessage:'+_0x929589,_0x1a879f);ChatInternalMessageEvents['on'](_0x929589,_0x1f1bee);}}; \ No newline at end of file +var _0xec03=['chatInternalMessage:','./chatInternalMessage.events','remove','update','removeListener','register','length'];(function(_0x2f2a16,_0x55fe3c){var _0x1b3c03=function(_0x3ce413){while(--_0x3ce413){_0x2f2a16['push'](_0x2f2a16['shift']());}};_0x1b3c03(++_0x55fe3c);}(_0xec03,0x143));var _0x3ec0=function(_0xeb1a09,_0x1da7d2){_0xeb1a09=_0xeb1a09-0x0;var _0xaaab1a=_0xec03[_0xeb1a09];return _0xaaab1a;};'use strict';var ChatInternalMessageEvents=require(_0x3ec0('0x0'));var events=['save',_0x3ec0('0x1'),_0x3ec0('0x2')];function createListener(_0x365604,_0x1f4cae){return function(_0x512835){_0x1f4cae['emit'](_0x365604,_0x512835);};}function removeListener(_0x3cd5d3,_0x5c5213){return function(){ChatInternalMessageEvents[_0x3ec0('0x3')](_0x3cd5d3,_0x5c5213);};}exports[_0x3ec0('0x4')]=function(_0xff59c){for(var _0x19465d=0x0,_0x580baf=events[_0x3ec0('0x5')];_0x19465d<_0x580baf;_0x19465d++){var _0xca5658=events[_0x19465d];var _0x301602=createListener(_0x3ec0('0x6')+_0xca5658,_0xff59c);ChatInternalMessageEvents['on'](_0xca5658,_0x301602);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7e7c161..a3fc026 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 _0x6655=['isAuthenticated','/describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','get'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x6655,0x193));var _0x5665=function(_0x11e29c,_0x1e14a0){_0x11e29c=_0x11e29c-0x0;var _0x496195=_0x6655[_0x11e29c];return _0x496195;};'use strict';var multer=require(_0x5665('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5665('0x1')]();var fs_extra=require(_0x5665('0x2'));var auth=require(_0x5665('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x5665('0x4')]('/',auth[_0x5665('0x5')](),controller['index']);router[_0x5665('0x4')](_0x5665('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0x5665('0x4')](_0x5665('0x7'),auth[_0x5665('0x5')](),controller[_0x5665('0x8')]);router['get'](_0x5665('0x9'),auth[_0x5665('0x5')](),controller[_0x5665('0xa')]);router[_0x5665('0xb')]('/',auth[_0x5665('0x5')](),controller[_0x5665('0xc')]);router[_0x5665('0xd')](_0x5665('0x9'),controller[_0x5665('0xe')]);router[_0x5665('0xf')]('/:id',auth[_0x5665('0x5')](),controller[_0x5665('0x10')]);module['exports']=router; \ No newline at end of file +var _0xdd91=['destroy','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','create','put','delete'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0xdd91,0x65));var _0x1dd9=function(_0xeb3526,_0x4ee7b8){_0xeb3526=_0xeb3526-0x0;var _0x48d897=_0xdd91[_0xeb3526];return _0x48d897;};'use strict';var multer=require(_0x1dd9('0x0'));var util=require('util');var path=require(_0x1dd9('0x1'));var timeout=require('connect-timeout');var express=require(_0x1dd9('0x2'));var router=express['Router']();var fs_extra=require(_0x1dd9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1dd9('0x4'));var config=require(_0x1dd9('0x5'));var controller=require(_0x1dd9('0x6'));router[_0x1dd9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1dd9('0x8')]);router[_0x1dd9('0x7')](_0x1dd9('0x9'),auth[_0x1dd9('0xa')](),controller[_0x1dd9('0xb')]);router[_0x1dd9('0x7')](_0x1dd9('0xc'),auth[_0x1dd9('0xa')](),controller[_0x1dd9('0xd')]);router[_0x1dd9('0x7')](_0x1dd9('0xe'),auth[_0x1dd9('0xa')](),controller[_0x1dd9('0xf')]);router['post']('/',auth[_0x1dd9('0xa')](),controller[_0x1dd9('0x10')]);router[_0x1dd9('0x11')]('/:id',controller['update']);router[_0x1dd9('0x12')](_0x1dd9('0xe'),auth['isAuthenticated'](),controller[_0x1dd9('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 2345867..d51c9fc 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 _0x7708=['DATE','TEXT','sequelize','exports','medium','out'];(function(_0x4cd6ea,_0x138514){var _0x5ef205=function(_0x11d626){while(--_0x11d626){_0x4cd6ea['push'](_0x4cd6ea['shift']());}};_0x5ef205(++_0x138514);}(_0x7708,0x188));var _0x8770=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0x7708[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require(_0x8770('0x0'));module[_0x8770('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8770('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x8770('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8770('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x8770('0x5')]}}; \ No newline at end of file +var _0xbb59=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb59,0xec));var _0x9bb5=function(_0x10c921,_0x1ef7a4){_0x10c921=_0x10c921-0x0;var _0x4591e2=_0xbb59[_0x10c921];return _0x4591e2;};'use strict';var Sequelize=require(_0x9bb5('0x0'));module[_0x9bb5('0x1')]={'body':{'type':Sequelize[_0x9bb5('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x9bb5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9bb5('0x4')]('in',_0x9bb5('0x5')),'defaultValue':_0x9bb5('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9bb5('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9bb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 731d363..6c8bbeb 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 _0x3316=['rows','show','params','length','find','create','body','describe','../../config/logger','chat-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','chat','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','status','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','ChatMessage','include','findAll'];(function(_0x4dd072,_0x515c74){var _0x45ee58=function(_0x2bf321){while(--_0x2bf321){_0x4dd072['push'](_0x4dd072['shift']());}};_0x45ee58(++_0x515c74);}(_0x3316,0x13e));var _0x6331=function(_0x2b90dc,_0x10b832){_0x2b90dc=_0x2b90dc-0x0;var _0x4794a6=_0x3316[_0x2b90dc];return _0x4794a6;};'use strict';var emlformat=require(_0x6331('0x0'));var rimraf=require(_0x6331('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6331('0x2'));var moment=require(_0x6331('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6331('0x4'));var util=require(_0x6331('0x5'));var path=require(_0x6331('0x6'));var sox=require(_0x6331('0x7'));var csv=require('to-csv');var ejs=require(_0x6331('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6331('0x9'));var squel=require('squel');var crypto=require(_0x6331('0xa'));var jsforce=require(_0x6331('0xb'));var deskjs=require(_0x6331('0xc'));var toCsv=require(_0x6331('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6331('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x6331('0xf'));var as=require(_0x6331('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6331('0x11'));var utils=require(_0x6331('0x12'));var config=require(_0x6331('0x13'));var licenseUtil=require(_0x6331('0x14'));var db=require(_0x6331('0x15'))['db'];config['redis']=_['defaults'](config[_0x6331('0x16')],{'host':_0x6331('0x17'),'port':0x18eb});var socket=require(_0x6331('0x18'))(new Redis(config['redis']));require(_0x6331('0x19'))[_0x6331('0x1a')](socket);var jayson=require(_0x6331('0x1b'));var client=jayson[_0x6331('0x1c')][_0x6331('0x1d')]({'port':0x232c});var client9002=jayson[_0x6331('0x1c')][_0x6331('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2cf8ba,_0x86c289,_0x14a5fe,_0x40dd9d){return new BPromise(function(_0xa0160d,_0x2bf42e){var _0xc4970f=_0x40dd9d||client;return _0xc4970f[_0x6331('0x1e')](_0x2cf8ba,_0x14a5fe)['then'](function(_0x50155e){logger[_0x6331('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x86c289,_0x6331('0x20'));logger[_0x6331('0x21')](_0x6331('0x22'),_0x86c289,'request\x20sent',JSON[_0x6331('0x23')](_0x50155e));if(_0x50155e[_0x6331('0x24')]){if(_0x50155e[_0x6331('0x24')][_0x6331('0x25')]===0x1f4){logger[_0x6331('0x24')](_0x6331('0x26'),_0x86c289,_0x50155e[_0x6331('0x24')]['message']);return _0x2bf42e(_0x50155e[_0x6331('0x24')][_0x6331('0x27')]);}logger[_0x6331('0x24')](_0x6331('0x26'),_0x86c289,_0x50155e['error'][_0x6331('0x27')]);return _0xa0160d(_0x50155e[_0x6331('0x24')][_0x6331('0x27')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x86c289,_0x6331('0x20'));_0xa0160d(_0x50155e[_0x6331('0x28')][_0x6331('0x27')]);}})[_0x6331('0x29')](function(_0x50538d){logger[_0x6331('0x24')](_0x6331('0x26'),_0x86c289,_0x50538d);_0x2bf42e(_0x50538d);});});}function respondWithStatusCode(_0x24fdda,_0x52e3cc){_0x52e3cc=_0x52e3cc||0xcc;return function(_0x4ab4c1){if(_0x4ab4c1){return _0x24fdda['sendStatus'](_0x52e3cc);}return _0x24fdda['status'](_0x52e3cc)['end']();};}function respondWithResult(_0x483ecb,_0x3a4837){_0x3a4837=_0x3a4837||0xc8;return function(_0xd269d1){if(_0xd269d1){return _0x483ecb['status'](_0x3a4837)[_0x6331('0x2a')](_0xd269d1);}};}function respondWithFilteredResult(_0x2ada7b,_0x4aee12){return function(_0x122072){if(_0x122072){var _0x32be78=typeof _0x4aee12[_0x6331('0x2b')]==='undefined'&&typeof _0x4aee12[_0x6331('0x2c')]===_0x6331('0x2d');var _0x31e8e2=_0x122072['count'];var _0x4e9a94=_0x32be78?0x0:_0x4aee12[_0x6331('0x2b')];var _0x4164cd=_0x32be78?_0x122072[_0x6331('0x2e')]:_0x4aee12[_0x6331('0x2b')]+_0x4aee12['limit'];var _0x69908a;if(_0x4164cd>=_0x31e8e2){_0x4164cd=_0x31e8e2;_0x69908a=0xc8;}else{_0x69908a=0xce;}_0x2ada7b['status'](_0x69908a);return _0x2ada7b[_0x6331('0x2f')](_0x6331('0x30'),_0x4e9a94+'-'+_0x4164cd+'/'+_0x31e8e2)[_0x6331('0x2a')](_0x122072);}return null;};}function patchUpdates(_0x149da6){return function(_0x41b1c4){try{jsonpatch[_0x6331('0x31')](_0x41b1c4,_0x149da6,!![]);}catch(_0x3b493){return BPromise[_0x6331('0x32')](_0x3b493);}return _0x41b1c4[_0x6331('0x33')]();};}function saveUpdates(_0xb31090,_0x1e09d3){return function(_0x395afc){if(_0x395afc){return _0x395afc[_0x6331('0x34')](_0xb31090)[_0x6331('0x35')](function(_0x2bcd54){return _0x2bcd54;});}return null;};}function removeEntity(_0xcdd113,_0x1382dd){return function(_0xbbdb4f){if(_0xbbdb4f){return _0xbbdb4f[_0x6331('0x36')]()['then'](function(){_0xcdd113[_0x6331('0x37')](0xcc)[_0x6331('0x38')]();});}};}function handleEntityNotFound(_0x4195fe,_0xee4e42){return function(_0x4e00ad){if(!_0x4e00ad){_0x4195fe[_0x6331('0x39')](0x194);}return _0x4e00ad;};}function handleError(_0x15556d,_0x5e7d71){_0x5e7d71=_0x5e7d71||0x1f4;return function(_0x51bc0a){logger[_0x6331('0x24')](_0x51bc0a[_0x6331('0x3a')]);if(_0x51bc0a['name']){delete _0x51bc0a[_0x6331('0x3b')];}_0x15556d[_0x6331('0x37')](_0x5e7d71)['send'](_0x51bc0a);};}exports[_0x6331('0x3c')]=function(_0x19cf2c,_0x456af2){var _0x28830d={},_0x15ec8f={},_0x2dac42={'count':0x0,'rows':[]};var _0x385902=_[_0x6331('0x3d')](db['ChatMessage'][_0x6331('0x3e')],function(_0x341506){return{'name':_0x341506[_0x6331('0x3f')],'type':_0x341506[_0x6331('0x40')][_0x6331('0x41')]};});_0x15ec8f[_0x6331('0x42')]=_['map'](_0x385902,_0x6331('0x3b'));_0x15ec8f[_0x6331('0x43')]=_[_0x6331('0x44')](_0x19cf2c[_0x6331('0x43')]);_0x15ec8f[_0x6331('0x45')]=_[_0x6331('0x46')](_0x15ec8f[_0x6331('0x42')],_0x15ec8f[_0x6331('0x43')]);_0x28830d['attributes']=_['intersection'](_0x15ec8f[_0x6331('0x42')],qs[_0x6331('0x47')](_0x19cf2c['query']['fields']));_0x28830d['attributes']=_0x28830d[_0x6331('0x48')]['length']?_0x28830d[_0x6331('0x48')]:_0x15ec8f[_0x6331('0x42')];if(!_0x19cf2c[_0x6331('0x43')][_0x6331('0x49')]('nolimit')){_0x28830d[_0x6331('0x2c')]=qs[_0x6331('0x2c')](_0x19cf2c[_0x6331('0x43')][_0x6331('0x2c')]);_0x28830d['offset']=qs['offset'](_0x19cf2c[_0x6331('0x43')]['offset']);}_0x28830d['order']=qs['sort'](_0x19cf2c['query'][_0x6331('0x4a')]);_0x28830d[_0x6331('0x4b')]=qs[_0x6331('0x45')](_[_0x6331('0x4c')](_0x19cf2c[_0x6331('0x43')],_0x15ec8f[_0x6331('0x45')]),_0x385902);if(_0x19cf2c[_0x6331('0x43')][_0x6331('0x4d')]){_0x28830d[_0x6331('0x4b')]=_['merge'](_0x28830d['where'],{'$or':_[_0x6331('0x3d')](_0x385902,function(_0x1a5c48){if(_0x1a5c48[_0x6331('0x40')]!==_0x6331('0x4e')){var _0xa7cb6d={};_0xa7cb6d[_0x1a5c48['name']]={'$like':'%'+_0x19cf2c[_0x6331('0x43')][_0x6331('0x4d')]+'%'};return _0xa7cb6d;}})});}_0x28830d=_[_0x6331('0x4f')]({},_0x28830d,_0x19cf2c[_0x6331('0x50')]);var _0x46345c={'where':_0x28830d[_0x6331('0x4b')]};return db[_0x6331('0x51')][_0x6331('0x2e')](_0x46345c)[_0x6331('0x35')](function(_0x2acc12){_0x2dac42[_0x6331('0x2e')]=_0x2acc12;if(_0x19cf2c['query']['includeAll']){_0x28830d[_0x6331('0x52')]=[{'all':!![]}];}return db['ChatMessage'][_0x6331('0x53')](_0x28830d);})[_0x6331('0x35')](function(_0x5edff5){_0x2dac42[_0x6331('0x54')]=_0x5edff5;return _0x2dac42;})[_0x6331('0x35')](respondWithFilteredResult(_0x456af2,_0x28830d))[_0x6331('0x29')](handleError(_0x456af2,null));};exports[_0x6331('0x55')]=function(_0x1e7ff7,_0x35467b){var _0x3b03b9={'raw':!![],'where':{'id':_0x1e7ff7[_0x6331('0x56')]['id']}},_0x2f4ff6={};_0x2f4ff6[_0x6331('0x42')]=_['keys'](db[_0x6331('0x51')]['rawAttributes']);_0x2f4ff6[_0x6331('0x43')]=_[_0x6331('0x44')](_0x1e7ff7[_0x6331('0x43')]);_0x2f4ff6[_0x6331('0x45')]=_[_0x6331('0x46')](_0x2f4ff6[_0x6331('0x42')],_0x2f4ff6['query']);_0x3b03b9[_0x6331('0x48')]=_[_0x6331('0x46')](_0x2f4ff6[_0x6331('0x42')],qs[_0x6331('0x47')](_0x1e7ff7[_0x6331('0x43')][_0x6331('0x47')]));_0x3b03b9[_0x6331('0x48')]=_0x3b03b9[_0x6331('0x48')][_0x6331('0x57')]?_0x3b03b9[_0x6331('0x48')]:_0x2f4ff6['model'];if(_0x1e7ff7['query']['includeAll']){_0x3b03b9[_0x6331('0x52')]=[{'all':!![]}];}_0x3b03b9=_[_0x6331('0x4f')]({},_0x3b03b9,_0x1e7ff7[_0x6331('0x50')]);return db[_0x6331('0x51')][_0x6331('0x58')](_0x3b03b9)[_0x6331('0x35')](handleEntityNotFound(_0x35467b,null))[_0x6331('0x35')](respondWithResult(_0x35467b,null))[_0x6331('0x29')](handleError(_0x35467b,null));};exports['create']=function(_0x450474,_0x31970b){return db[_0x6331('0x51')][_0x6331('0x59')](_0x450474[_0x6331('0x5a')],{})['then'](respondWithResult(_0x31970b,0xc9))[_0x6331('0x29')](handleError(_0x31970b,null));};exports[_0x6331('0x34')]=function(_0x34ae7f,_0x47b803){if(_0x34ae7f[_0x6331('0x5a')]['id']){delete _0x34ae7f['body']['id'];}return db[_0x6331('0x51')][_0x6331('0x58')]({'where':{'id':_0x34ae7f[_0x6331('0x56')]['id']}})['then'](handleEntityNotFound(_0x47b803,null))[_0x6331('0x35')](saveUpdates(_0x34ae7f['body'],null))['then'](respondWithResult(_0x47b803,null))['catch'](handleError(_0x47b803,null));};exports[_0x6331('0x36')]=function(_0x1f8dc2,_0x37cd89){return db[_0x6331('0x51')][_0x6331('0x58')]({'where':{'id':_0x1f8dc2[_0x6331('0x56')]['id']}})[_0x6331('0x35')](handleEntityNotFound(_0x37cd89,null))[_0x6331('0x35')](removeEntity(_0x37cd89,null))[_0x6331('0x29')](handleError(_0x37cd89,null));};exports[_0x6331('0x5b')]=function(_0x5ff693,_0x18411f){return db[_0x6331('0x51')][_0x6331('0x5b')]()[_0x6331('0x35')](respondWithResult(_0x18411f,null))[_0x6331('0x29')](handleError(_0x18411f,null));};var interaction_log=require(_0x6331('0x5c'))(_0x6331('0x5d'));exports[_0x6331('0x5e')]=function(_0x2e9b76,_0x3f426d,_0xb176dc){var _0x5e3a18={'agent':{},'channel':'chat'};if(_0x2e9b76[_0x6331('0x5a')]['id']){delete _0x2e9b76[_0x6331('0x5a')]['id'];}_0x2e9b76['body'][_0x6331('0x5f')]=!![];_0x2e9b76[_0x6331('0x5a')]['readAt']=moment()[_0x6331('0x60')](_0x6331('0x61'));_0x2e9b76[_0x6331('0x5a')][_0x6331('0x62')]=_0x2e9b76['body'][_0x6331('0x62')]||_0x2e9b76[_0x6331('0x63')]['id'];_0x5e3a18[_0x6331('0x64')]['id']=_0x2e9b76['body'][_0x6331('0x62')];return db['ChatMessage'][_0x6331('0x58')]({'where':{'id':_0x2e9b76[_0x6331('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f426d,null))[_0x6331('0x35')](saveUpdates(_0x2e9b76['body'],null))[_0x6331('0x35')](function(_0x38340b){if(_0x38340b){_0x5e3a18[_0x6331('0x27')]=_0x38340b[_0x6331('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x6331('0x58')]({'where':{'id':_0x38340b['ChatInteractionId']}});}return null;})[_0x6331('0x35')](handleEntityNotFound(_0x3f426d,null))[_0x6331('0x35')](function(_0x27e079){if(_0x27e079){return _0x27e079[_0x6331('0x34')]({'UserId':_0x2e9b76['body'][_0x6331('0x62')],'read1stAt':_['isNil'](_0x27e079[_0x6331('0x66')])?moment()[_0x6331('0x60')](_0x6331('0x61')):undefined});}return null;})[_0x6331('0x35')](function(_0x198d44){if(_0x198d44){_0x5e3a18[_0x6331('0x67')]=_0x198d44['get']({'plain':!![]});interaction_log[_0x6331('0x1f')](_0x6331('0x68'),_0x2e9b76[_0x6331('0x63')]['id'],_0x2e9b76['user']['name'],_0x2e9b76[_0x6331('0x63')]['role'],_0x5e3a18[_0x6331('0x67')]['id'],_0x2e9b76[_0x6331('0x5a')]?JSON['stringify'](_0x2e9b76[_0x6331('0x5a')]):_0x6331('0x69'));return respondWithRpcPromise(_0x6331('0x6a'),_0x6331('0x6b'),_0x5e3a18);}return null;})['then'](function(_0x381b74){var _0x38f4d0=_0x6331('0x6c')+_0x381b74['message'][_0x6331('0x6d')];return db[_0x6331('0x6e')]['query'](_0x38f4d0,{'type':db[_0x6331('0x6f')][_0x6331('0x70')][_0x6331('0x71')],'raw':!![]})['then'](function(_0x267642){return _0x267642;});})[_0x6331('0x35')](function(_0x170280){if(_0x170280){_0x5e3a18['message'][_0x6331('0x72')]=_0x170280[0x0];if(!_0x2e9b76[_0x6331('0x5a')][_0x6331('0x62')])return;return db['User'][_0x6331('0x58')]({'where':{'id':_0x2e9b76[_0x6331('0x5a')][_0x6331('0x62')],'role':'agent'},'attributes':['id',_0x6331('0x3b'),_0x6331('0x73'),_0x6331('0x74'),_0x6331('0x75')],'raw':!![]});}return null;})[_0x6331('0x35')](function(_0x44e308){if(!_0x44e308)return null;_0x5e3a18['message']['agent']=_0x44e308;return _0x5e3a18;})[_0x6331('0x35')](function(_0x472430){if(_0x472430){if(_0x2e9b76['body'][_0x6331('0x76')]){_0x5e3a18[_0x6331('0x27')][_0x6331('0x77')]=util[_0x6331('0x60')](_0x6331('0x78'),_0x2e9b76[_0x6331('0x63')][_0x6331('0x3b')]);_0x5e3a18[_0x6331('0x27')]['channel']=_0x5e3a18[_0x6331('0x79')];_0x5e3a18[_0x6331('0x27')][_0x6331('0x7a')]=_0x5e3a18['channel'];_0x5e3a18[_0x6331('0x27')][_0x6331('0x7b')]='accept';return respondWithRpcPromise(_0x6331('0x7c'),_0x6331('0x7c'),{'event':'acceptmessage','message':_['merge'](_0x5e3a18[_0x6331('0x27')],JSON[_0x6331('0x7d')](_0x5e3a18[_0x6331('0x67')][_0x6331('0x7e')]))},client9002)['then'](function(){return _0x5e3a18;});}return _0x5e3a18;}return null;})[_0x6331('0x35')](respondWithResult(_0x3f426d,null))[_0x6331('0x29')](handleError(_0x3f426d,null));};var interaction_log=require(_0x6331('0x5c'))('chat-interactions');exports['reject']=function(_0x17c786,_0x3a7383,_0x5159e5){var _0x596c55={'agent':{},'channel':_0x6331('0x7f')};if(_0x17c786[_0x6331('0x5a')]['id']){delete _0x17c786[_0x6331('0x5a')]['id'];}_0x17c786[_0x6331('0x5a')][_0x6331('0x62')]=_0x17c786[_0x6331('0x5a')][_0x6331('0x62')]||_0x17c786[_0x6331('0x63')]['id'];_0x596c55[_0x6331('0x64')]['id']=_0x17c786[_0x6331('0x5a')][_0x6331('0x62')];return db[_0x6331('0x51')]['find']({'where':{'id':_0x17c786[_0x6331('0x56')]['id'],'UserId':null}})[_0x6331('0x35')](handleEntityNotFound(_0x3a7383,null))['then'](function(_0xea4f28){if(_0xea4f28){_0x596c55[_0x6331('0x27')]=_0xea4f28[_0x6331('0x65')]({'plain':!![]});return db[_0x6331('0x80')][_0x6331('0x58')]({'where':{'id':_0xea4f28[_0x6331('0x81')]}});}return null;})[_0x6331('0x35')](handleEntityNotFound(_0x3a7383,null))[_0x6331('0x35')](function(_0x447663){if(_0x447663){_0x596c55[_0x6331('0x67')]=_0x447663[_0x6331('0x65')]({'plain':!![]});interaction_log[_0x6331('0x1f')](_0x6331('0x82'),_0x17c786[_0x6331('0x63')]['id'],_0x17c786[_0x6331('0x63')][_0x6331('0x3b')],_0x17c786['user'][_0x6331('0x83')],_0x596c55[_0x6331('0x67')]['id'],_0x17c786[_0x6331('0x5a')]?JSON[_0x6331('0x23')](_0x17c786['body']):_0x6331('0x69'));return respondWithRpcPromise(_0x6331('0x84'),_0x6331('0x85'),_0x596c55);}return null;})[_0x6331('0x35')](function(_0x1405d6){var _0x2d328e=_0x6331('0x6c')+_0x1405d6[_0x6331('0x27')][_0x6331('0x6d')];return db[_0x6331('0x6e')][_0x6331('0x43')](_0x2d328e,{'type':db[_0x6331('0x6f')][_0x6331('0x70')][_0x6331('0x71')],'raw':!![]})['then'](function(_0x422a4a){return _0x422a4a;});})['then'](function(_0x413257){if(_0x413257){_0x596c55[_0x6331('0x27')][_0x6331('0x72')]=_0x413257[0x0];if(!_0x17c786[_0x6331('0x5a')]['UserId'])return;return db['User'][_0x6331('0x58')]({'where':{'id':_0x17c786[_0x6331('0x5a')][_0x6331('0x62')],'role':_0x6331('0x64')},'attributes':['id',_0x6331('0x3b'),_0x6331('0x73'),'email',_0x6331('0x75')],'raw':!![]});}return null;})[_0x6331('0x35')](function(_0x44e177){if(!_0x44e177)return null;_0x596c55['message']['agent']=_0x44e177;return _0x596c55;})[_0x6331('0x35')](function(_0x36954c){if(_0x36954c){_0x36954c['message'][_0x6331('0x77')]=util[_0x6331('0x60')]('SIP/%s',_0x17c786[_0x6331('0x63')][_0x6331('0x3b')]);_0x36954c[_0x6331('0x27')][_0x6331('0x79')]=_0x596c55[_0x6331('0x79')];_0x36954c['message'][_0x6331('0x7a')]=_0x596c55['channel'];_0x36954c['message']['event']=_0x6331('0x32');respondWithRpcPromise('EventManager',_0x6331('0x7c'),{'event':'rejectmessage','message':_[_0x6331('0x4f')](_0x596c55[_0x6331('0x27')],JSON[_0x6331('0x7d')](_0x596c55[_0x6331('0x67')][_0x6331('0x7e')]))},client9002);return _0x596c55;}return null;})[_0x6331('0x35')](respondWithResult(_0x3a7383,null))[_0x6331('0x29')](handleError(_0x3a7383,null));}; \ No newline at end of file +var _0xcf3a=['get','ChatInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','manual','SIP/%s','channel','motionChannel','event','EventManager','parse','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','internal','interface','rejectmessage','formData','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','code','error','message','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','end','stack','name','send','index','map','ChatMessage','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','rawAttributes','create','body','params','destroy','find','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent'];(function(_0x9c93f5,_0x2fe9c8){var _0x5e613a=function(_0x25c92f){while(--_0x25c92f){_0x9c93f5['push'](_0x9c93f5['shift']());}};_0x5e613a(++_0x2fe9c8);}(_0xcf3a,0x134));var _0xacf3=function(_0x276c4,_0x4a4554){_0x276c4=_0x276c4-0x0;var _0x4e069e=_0xcf3a[_0x276c4];return _0x4e069e;};'use strict';var emlformat=require(_0xacf3('0x0'));var rimraf=require(_0xacf3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xacf3('0x2'));var rp=require(_0xacf3('0x3'));var moment=require(_0xacf3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xacf3('0x5'));var util=require(_0xacf3('0x6'));var path=require(_0xacf3('0x7'));var sox=require(_0xacf3('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xacf3('0x9'));var _=require(_0xacf3('0xa'));var squel=require(_0xacf3('0xb'));var crypto=require(_0xacf3('0xc'));var jsforce=require(_0xacf3('0xd'));var deskjs=require(_0xacf3('0xe'));var toCsv=require(_0xacf3('0xf'));var querystring=require('querystring');var Papa=require(_0xacf3('0x10'));var Redis=require('ioredis');var authService=require(_0xacf3('0x11'));var qs=require(_0xacf3('0x12'));var as=require(_0xacf3('0x13'));var hardwareService=require(_0xacf3('0x14'));var logger=require(_0xacf3('0x15'))(_0xacf3('0x16'));var utils=require(_0xacf3('0x17'));var config=require(_0xacf3('0x18'));var licenseUtil=require(_0xacf3('0x19'));var db=require('../../mysqldb')['db'];config[_0xacf3('0x1a')]=_['defaults'](config[_0xacf3('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xacf3('0x1b'))(new Redis(config[_0xacf3('0x1a')]));require(_0xacf3('0x1c'))[_0xacf3('0x1d')](socket);var jayson=require(_0xacf3('0x1e'));var client=jayson[_0xacf3('0x1f')][_0xacf3('0x20')]({'port':0x232c});var client9002=jayson[_0xacf3('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1eaa,_0x2c9a96,_0x39bb5a,_0x52023b){return new BPromise(function(_0x24000a,_0x5eb36d){var _0x10a9b2=_0x52023b||client;return _0x10a9b2[_0xacf3('0x21')](_0x2b1eaa,_0x39bb5a)[_0xacf3('0x22')](function(_0x571dcb){logger[_0xacf3('0x23')](_0xacf3('0x24'),_0x2c9a96,_0xacf3('0x25'));logger[_0xacf3('0x26')](_0xacf3('0x27'),_0x2c9a96,_0xacf3('0x25'),JSON['stringify'](_0x571dcb));if(_0x571dcb['error']){if(_0x571dcb['error'][_0xacf3('0x28')]===0x1f4){logger[_0xacf3('0x29')](_0xacf3('0x24'),_0x2c9a96,_0x571dcb[_0xacf3('0x29')][_0xacf3('0x2a')]);return _0x5eb36d(_0x571dcb[_0xacf3('0x29')]['message']);}logger[_0xacf3('0x29')](_0xacf3('0x24'),_0x2c9a96,_0x571dcb['error'][_0xacf3('0x2a')]);return _0x24000a(_0x571dcb[_0xacf3('0x29')]['message']);}else{logger[_0xacf3('0x23')](_0xacf3('0x24'),_0x2c9a96,'request\x20sent');_0x24000a(_0x571dcb['result'][_0xacf3('0x2a')]);}})[_0xacf3('0x2b')](function(_0x5f38e6){logger['error'](_0xacf3('0x24'),_0x2c9a96,_0x5f38e6);_0x5eb36d(_0x5f38e6);});});}function respondWithStatusCode(_0x101ff5,_0x24b034){_0x24b034=_0x24b034||0xcc;return function(_0x18bde0){if(_0x18bde0){return _0x101ff5[_0xacf3('0x2c')](_0x24b034);}return _0x101ff5[_0xacf3('0x2d')](_0x24b034)['end']();};}function respondWithResult(_0x55e58d,_0x1151ad){_0x1151ad=_0x1151ad||0xc8;return function(_0x4a7144){if(_0x4a7144){return _0x55e58d['status'](_0x1151ad)[_0xacf3('0x2e')](_0x4a7144);}};}function respondWithFilteredResult(_0xdb7154,_0x9fe300){return function(_0x588470){if(_0x588470){var _0x4a61b8=typeof _0x9fe300['offset']===_0xacf3('0x2f')&&typeof _0x9fe300[_0xacf3('0x30')]===_0xacf3('0x2f');var _0x3e3327=_0x588470[_0xacf3('0x31')];var _0xa2ad56=_0x4a61b8?0x0:_0x9fe300[_0xacf3('0x32')];var _0x41987e=_0x4a61b8?_0x588470[_0xacf3('0x31')]:_0x9fe300[_0xacf3('0x32')]+_0x9fe300[_0xacf3('0x30')];var _0x383cf0;if(_0x41987e>=_0x3e3327){_0x41987e=_0x3e3327;_0x383cf0=0xc8;}else{_0x383cf0=0xce;}_0xdb7154[_0xacf3('0x2d')](_0x383cf0);return _0xdb7154[_0xacf3('0x33')](_0xacf3('0x34'),_0xa2ad56+'-'+_0x41987e+'/'+_0x3e3327)['json'](_0x588470);}return null;};}function patchUpdates(_0x18fb6c){return function(_0x5df785){try{jsonpatch['apply'](_0x5df785,_0x18fb6c,!![]);}catch(_0x4dba40){return BPromise[_0xacf3('0x35')](_0x4dba40);}return _0x5df785['save']();};}function saveUpdates(_0x3e47bf,_0x3b91db){return function(_0x5c915e){if(_0x5c915e){return _0x5c915e[_0xacf3('0x36')](_0x3e47bf)[_0xacf3('0x22')](function(_0x565a4a){return _0x565a4a;});}return null;};}function removeEntity(_0x4738ff,_0x1d6c0e){return function(_0x484b85){if(_0x484b85){return _0x484b85['destroy']()['then'](function(){_0x4738ff[_0xacf3('0x2d')](0xcc)[_0xacf3('0x37')]();});}};}function handleEntityNotFound(_0x540f58,_0x387318){return function(_0x4cfc8f){if(!_0x4cfc8f){_0x540f58[_0xacf3('0x2c')](0x194);}return _0x4cfc8f;};}function handleError(_0x3fd93b,_0xb912d9){_0xb912d9=_0xb912d9||0x1f4;return function(_0x4c0495){logger[_0xacf3('0x29')](_0x4c0495[_0xacf3('0x38')]);if(_0x4c0495[_0xacf3('0x39')]){delete _0x4c0495['name'];}_0x3fd93b[_0xacf3('0x2d')](_0xb912d9)[_0xacf3('0x3a')](_0x4c0495);};}exports[_0xacf3('0x3b')]=function(_0x369562,_0x19903c){var _0x2e5555={},_0x2fa405={},_0x4a25d8={'count':0x0,'rows':[]};var _0x1e8517=_[_0xacf3('0x3c')](db[_0xacf3('0x3d')]['rawAttributes'],function(_0x3c0ed7){return{'name':_0x3c0ed7[_0xacf3('0x3e')],'type':_0x3c0ed7[_0xacf3('0x3f')][_0xacf3('0x40')]};});_0x2fa405['model']=_[_0xacf3('0x3c')](_0x1e8517,'name');_0x2fa405[_0xacf3('0x41')]=_[_0xacf3('0x42')](_0x369562[_0xacf3('0x41')]);_0x2fa405[_0xacf3('0x43')]=_[_0xacf3('0x44')](_0x2fa405[_0xacf3('0x45')],_0x2fa405[_0xacf3('0x41')]);_0x2e5555[_0xacf3('0x46')]=_['intersection'](_0x2fa405[_0xacf3('0x45')],qs[_0xacf3('0x47')](_0x369562['query'][_0xacf3('0x47')]));_0x2e5555[_0xacf3('0x46')]=_0x2e5555[_0xacf3('0x46')][_0xacf3('0x48')]?_0x2e5555['attributes']:_0x2fa405[_0xacf3('0x45')];if(!_0x369562[_0xacf3('0x41')][_0xacf3('0x49')](_0xacf3('0x4a'))){_0x2e5555['limit']=qs[_0xacf3('0x30')](_0x369562[_0xacf3('0x41')][_0xacf3('0x30')]);_0x2e5555[_0xacf3('0x32')]=qs[_0xacf3('0x32')](_0x369562[_0xacf3('0x41')]['offset']);}_0x2e5555[_0xacf3('0x4b')]=qs[_0xacf3('0x4c')](_0x369562[_0xacf3('0x41')][_0xacf3('0x4c')]);_0x2e5555[_0xacf3('0x4d')]=qs[_0xacf3('0x43')](_[_0xacf3('0x4e')](_0x369562[_0xacf3('0x41')],_0x2fa405[_0xacf3('0x43')]),_0x1e8517);if(_0x369562[_0xacf3('0x41')]['filter']){_0x2e5555[_0xacf3('0x4d')]=_['merge'](_0x2e5555[_0xacf3('0x4d')],{'$or':_[_0xacf3('0x3c')](_0x1e8517,function(_0x3af3e7){if(_0x3af3e7[_0xacf3('0x3f')]!==_0xacf3('0x4f')){var _0x217c1e={};_0x217c1e[_0x3af3e7[_0xacf3('0x39')]]={'$like':'%'+_0x369562[_0xacf3('0x41')][_0xacf3('0x50')]+'%'};return _0x217c1e;}})});}_0x2e5555=_[_0xacf3('0x51')]({},_0x2e5555,_0x369562[_0xacf3('0x52')]);var _0x3c3079={'where':_0x2e5555[_0xacf3('0x4d')]};return db[_0xacf3('0x3d')]['count'](_0x3c3079)['then'](function(_0x3e0eaa){_0x4a25d8[_0xacf3('0x31')]=_0x3e0eaa;if(_0x369562[_0xacf3('0x41')][_0xacf3('0x53')]){_0x2e5555[_0xacf3('0x54')]=[{'all':!![]}];}return db['ChatMessage'][_0xacf3('0x55')](_0x2e5555);})[_0xacf3('0x22')](function(_0x55d0d6){_0x4a25d8[_0xacf3('0x56')]=_0x55d0d6;return _0x4a25d8;})[_0xacf3('0x22')](respondWithFilteredResult(_0x19903c,_0x2e5555))[_0xacf3('0x2b')](handleError(_0x19903c,null));};exports['show']=function(_0x39f451,_0x455cff){var _0xeaf848={'raw':!![],'where':{'id':_0x39f451['params']['id']}},_0x10ecfd={};_0x10ecfd[_0xacf3('0x45')]=_[_0xacf3('0x42')](db[_0xacf3('0x3d')][_0xacf3('0x57')]);_0x10ecfd[_0xacf3('0x41')]=_['keys'](_0x39f451[_0xacf3('0x41')]);_0x10ecfd[_0xacf3('0x43')]=_[_0xacf3('0x44')](_0x10ecfd[_0xacf3('0x45')],_0x10ecfd[_0xacf3('0x41')]);_0xeaf848[_0xacf3('0x46')]=_[_0xacf3('0x44')](_0x10ecfd[_0xacf3('0x45')],qs[_0xacf3('0x47')](_0x39f451[_0xacf3('0x41')][_0xacf3('0x47')]));_0xeaf848['attributes']=_0xeaf848[_0xacf3('0x46')][_0xacf3('0x48')]?_0xeaf848[_0xacf3('0x46')]:_0x10ecfd[_0xacf3('0x45')];if(_0x39f451[_0xacf3('0x41')]['includeAll']){_0xeaf848[_0xacf3('0x54')]=[{'all':!![]}];}_0xeaf848=_[_0xacf3('0x51')]({},_0xeaf848,_0x39f451[_0xacf3('0x52')]);return db['ChatMessage']['find'](_0xeaf848)[_0xacf3('0x22')](handleEntityNotFound(_0x455cff,null))[_0xacf3('0x22')](respondWithResult(_0x455cff,null))[_0xacf3('0x2b')](handleError(_0x455cff,null));};exports[_0xacf3('0x58')]=function(_0x31ffd0,_0x3693bb){return db[_0xacf3('0x3d')][_0xacf3('0x58')](_0x31ffd0[_0xacf3('0x59')],{})[_0xacf3('0x22')](respondWithResult(_0x3693bb,0xc9))[_0xacf3('0x2b')](handleError(_0x3693bb,null));};exports['update']=function(_0x3a7296,_0x1d4d43){if(_0x3a7296[_0xacf3('0x59')]['id']){delete _0x3a7296[_0xacf3('0x59')]['id'];}return db[_0xacf3('0x3d')]['find']({'where':{'id':_0x3a7296[_0xacf3('0x5a')]['id']}})[_0xacf3('0x22')](handleEntityNotFound(_0x1d4d43,null))[_0xacf3('0x22')](saveUpdates(_0x3a7296[_0xacf3('0x59')],null))[_0xacf3('0x22')](respondWithResult(_0x1d4d43,null))[_0xacf3('0x2b')](handleError(_0x1d4d43,null));};exports[_0xacf3('0x5b')]=function(_0x2db410,_0x16147a){return db[_0xacf3('0x3d')][_0xacf3('0x5c')]({'where':{'id':_0x2db410[_0xacf3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x16147a,null))[_0xacf3('0x22')](removeEntity(_0x16147a,null))[_0xacf3('0x2b')](handleError(_0x16147a,null));};exports['describe']=function(_0x561c8e,_0x129240){return db[_0xacf3('0x3d')][_0xacf3('0x5d')]()[_0xacf3('0x22')](respondWithResult(_0x129240,null))['catch'](handleError(_0x129240,null));};var interaction_log=require(_0xacf3('0x15'))(_0xacf3('0x5e'));exports[_0xacf3('0x5f')]=function(_0x1305b4,_0x2fbca5,_0x2c558e){var _0x1ff991={'agent':{},'channel':_0xacf3('0x60')};if(_0x1305b4['body']['id']){delete _0x1305b4[_0xacf3('0x59')]['id'];}_0x1305b4[_0xacf3('0x59')][_0xacf3('0x61')]=!![];_0x1305b4[_0xacf3('0x59')][_0xacf3('0x62')]=moment()[_0xacf3('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x1305b4[_0xacf3('0x59')][_0xacf3('0x64')]=_0x1305b4[_0xacf3('0x59')][_0xacf3('0x64')]||_0x1305b4[_0xacf3('0x65')]['id'];_0x1ff991[_0xacf3('0x66')]['id']=_0x1305b4[_0xacf3('0x59')][_0xacf3('0x64')];return db[_0xacf3('0x3d')][_0xacf3('0x5c')]({'where':{'id':_0x1305b4[_0xacf3('0x5a')]['id'],'UserId':null}})[_0xacf3('0x22')](handleEntityNotFound(_0x2fbca5,null))[_0xacf3('0x22')](saveUpdates(_0x1305b4['body'],null))[_0xacf3('0x22')](function(_0x39a9c6){if(_0x39a9c6){_0x1ff991[_0xacf3('0x2a')]=_0x39a9c6[_0xacf3('0x67')]({'plain':!![]});return db['ChatInteraction'][_0xacf3('0x5c')]({'where':{'id':_0x39a9c6[_0xacf3('0x68')]}});}return null;})[_0xacf3('0x22')](handleEntityNotFound(_0x2fbca5,null))[_0xacf3('0x22')](function(_0x40b9e0){if(_0x40b9e0){return _0x40b9e0[_0xacf3('0x36')]({'UserId':_0x1305b4['body'][_0xacf3('0x64')],'read1stAt':_['isNil'](_0x40b9e0[_0xacf3('0x69')])?moment()['format'](_0xacf3('0x6a')):undefined});}return null;})[_0xacf3('0x22')](function(_0x1c8fde){if(_0x1c8fde){_0x1ff991[_0xacf3('0x6b')]=_0x1c8fde[_0xacf3('0x67')]({'plain':!![]});interaction_log[_0xacf3('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1305b4[_0xacf3('0x65')]['id'],_0x1305b4[_0xacf3('0x65')]['name'],_0x1305b4[_0xacf3('0x65')][_0xacf3('0x6c')],_0x1ff991['interaction']['id'],_0x1305b4['body']?JSON[_0xacf3('0x6d')](_0x1305b4[_0xacf3('0x59')]):'null');return respondWithRpcPromise(_0xacf3('0x6e'),_0xacf3('0x6f'),_0x1ff991);}return null;})[_0xacf3('0x22')](function(_0xdcacda){var _0x1e63fa=_0xacf3('0x70')+_0xdcacda[_0xacf3('0x2a')]['ContactId'];return db[_0xacf3('0x71')][_0xacf3('0x41')](_0x1e63fa,{'type':db[_0xacf3('0x72')][_0xacf3('0x73')][_0xacf3('0x74')],'raw':!![]})['then'](function(_0x3b9521){return _0x3b9521;});})[_0xacf3('0x22')](function(_0x3a14a9){if(_0x3a14a9){_0x1ff991[_0xacf3('0x2a')][_0xacf3('0x75')]=_0x3a14a9[0x0];if(!_0x1305b4['body'][_0xacf3('0x64')])return;return db[_0xacf3('0x76')][_0xacf3('0x5c')]({'where':{'id':_0x1305b4['body'][_0xacf3('0x64')],'role':_0xacf3('0x66')},'attributes':['id',_0xacf3('0x39'),_0xacf3('0x77'),'email','internal'],'raw':!![]});}return null;})[_0xacf3('0x22')](function(_0x8d617a){if(!_0x8d617a)return null;_0x1ff991[_0xacf3('0x2a')][_0xacf3('0x66')]=_0x8d617a;return _0x1ff991;})['then'](function(_0x2e4905){if(_0x2e4905){if(_0x1305b4['body'][_0xacf3('0x78')]){_0x1ff991[_0xacf3('0x2a')]['interface']=util[_0xacf3('0x63')](_0xacf3('0x79'),_0x1305b4[_0xacf3('0x65')][_0xacf3('0x39')]);_0x1ff991[_0xacf3('0x2a')][_0xacf3('0x7a')]=_0x1ff991[_0xacf3('0x7a')];_0x1ff991[_0xacf3('0x2a')][_0xacf3('0x7b')]=_0x1ff991[_0xacf3('0x7a')];_0x1ff991[_0xacf3('0x2a')][_0xacf3('0x7c')]='accept';return respondWithRpcPromise(_0xacf3('0x7d'),'EventManager',{'event':'acceptmessage','message':_[_0xacf3('0x51')](_0x1ff991[_0xacf3('0x2a')],JSON[_0xacf3('0x7e')](_0x1ff991[_0xacf3('0x6b')]['formData']))},client9002)[_0xacf3('0x22')](function(){return _0x1ff991;});}return _0x1ff991;}return null;})[_0xacf3('0x22')](respondWithResult(_0x2fbca5,null))[_0xacf3('0x2b')](handleError(_0x2fbca5,null));};var interaction_log=require(_0xacf3('0x15'))(_0xacf3('0x5e'));exports[_0xacf3('0x35')]=function(_0x41a78e,_0x35261c,_0x3fcae2){var _0x28e950={'agent':{},'channel':_0xacf3('0x60')};if(_0x41a78e[_0xacf3('0x59')]['id']){delete _0x41a78e['body']['id'];}_0x41a78e[_0xacf3('0x59')]['UserId']=_0x41a78e['body'][_0xacf3('0x64')]||_0x41a78e[_0xacf3('0x65')]['id'];_0x28e950[_0xacf3('0x66')]['id']=_0x41a78e['body'][_0xacf3('0x64')];return db[_0xacf3('0x3d')]['find']({'where':{'id':_0x41a78e[_0xacf3('0x5a')]['id'],'UserId':null}})[_0xacf3('0x22')](handleEntityNotFound(_0x35261c,null))[_0xacf3('0x22')](function(_0x33720c){if(_0x33720c){_0x28e950[_0xacf3('0x2a')]=_0x33720c['get']({'plain':!![]});return db[_0xacf3('0x7f')][_0xacf3('0x5c')]({'where':{'id':_0x33720c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x35261c,null))['then'](function(_0x2c4eba){if(_0x2c4eba){_0x28e950[_0xacf3('0x6b')]=_0x2c4eba['get']({'plain':!![]});interaction_log[_0xacf3('0x23')](_0xacf3('0x80'),_0x41a78e['user']['id'],_0x41a78e[_0xacf3('0x65')]['name'],_0x41a78e[_0xacf3('0x65')][_0xacf3('0x6c')],_0x28e950[_0xacf3('0x6b')]['id'],_0x41a78e[_0xacf3('0x59')]?JSON[_0xacf3('0x6d')](_0x41a78e['body']):_0xacf3('0x81'));return respondWithRpcPromise(_0xacf3('0x82'),_0xacf3('0x83'),_0x28e950);}return null;})[_0xacf3('0x22')](function(_0x524aa9){var _0x390ba2=_0xacf3('0x70')+_0x524aa9[_0xacf3('0x2a')][_0xacf3('0x84')];return db[_0xacf3('0x71')]['query'](_0x390ba2,{'type':db[_0xacf3('0x72')][_0xacf3('0x73')][_0xacf3('0x74')],'raw':!![]})[_0xacf3('0x22')](function(_0x5b2ac1){return _0x5b2ac1;});})[_0xacf3('0x22')](function(_0x51dcc5){if(_0x51dcc5){_0x28e950[_0xacf3('0x2a')][_0xacf3('0x75')]=_0x51dcc5[0x0];if(!_0x41a78e[_0xacf3('0x59')][_0xacf3('0x64')])return;return db[_0xacf3('0x76')][_0xacf3('0x5c')]({'where':{'id':_0x41a78e['body'][_0xacf3('0x64')],'role':_0xacf3('0x66')},'attributes':['id','name',_0xacf3('0x77'),'email',_0xacf3('0x85')],'raw':!![]});}return null;})[_0xacf3('0x22')](function(_0x58516c){if(!_0x58516c)return null;_0x28e950[_0xacf3('0x2a')][_0xacf3('0x66')]=_0x58516c;return _0x28e950;})[_0xacf3('0x22')](function(_0xa6fa83){if(_0xa6fa83){_0xa6fa83[_0xacf3('0x2a')][_0xacf3('0x86')]=util[_0xacf3('0x63')](_0xacf3('0x79'),_0x41a78e[_0xacf3('0x65')][_0xacf3('0x39')]);_0xa6fa83[_0xacf3('0x2a')][_0xacf3('0x7a')]=_0x28e950[_0xacf3('0x7a')];_0xa6fa83[_0xacf3('0x2a')][_0xacf3('0x7b')]=_0x28e950[_0xacf3('0x7a')];_0xa6fa83['message']['event']=_0xacf3('0x35');respondWithRpcPromise(_0xacf3('0x7d'),_0xacf3('0x7d'),{'event':_0xacf3('0x87'),'message':_['merge'](_0x28e950['message'],JSON[_0xacf3('0x7e')](_0x28e950[_0xacf3('0x6b')][_0xacf3('0x88')]))},client9002);return _0x28e950;}return null;})[_0xacf3('0x22')](respondWithResult(_0x35261c,null))[_0xacf3('0x2b')](handleError(_0x35261c,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4750191..10806cc 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 _0x9f8c=['update','emit','hook','exports','ChatMessage','setMaxListeners','save'];(function(_0x389a78,_0x176298){var _0x41dfe6=function(_0x3a1e73){while(--_0x3a1e73){_0x389a78['push'](_0x389a78['shift']());}};_0x41dfe6(++_0x176298);}(_0x9f8c,0x185));var _0xc9f8=function(_0x2c3782,_0x3e1d02){_0x2c3782=_0x2c3782-0x0;var _0x39ca91=_0x9f8c[_0x2c3782];return _0x39ca91;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0xc9f8('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc9f8('0x1')](0x0);var events={'afterCreate':_0xc9f8('0x2'),'afterUpdate':_0xc9f8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5570cd){return function(_0x145961,_0x2728af,_0x290ba4){ChatMessageEvents['emit'](_0x5570cd+':'+_0x145961['id'],_0x145961);ChatMessageEvents[_0xc9f8('0x4')](_0x5570cd,_0x145961);_0x290ba4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xc9f8('0x5')](e,emitEvent(event));}}module[_0xc9f8('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0xb5f8=['remove','emit','hasOwnProperty','exports','events','setMaxListeners','update'];(function(_0x20007d,_0x208b64){var _0x57b651=function(_0x29b670){while(--_0x29b670){_0x20007d['push'](_0x20007d['shift']());}};_0x57b651(++_0x208b64);}(_0xb5f8,0x89));var _0x8b5f=function(_0x2da9e7,_0x43e3b6){_0x2da9e7=_0x2da9e7-0x0;var _0xdeff78=_0xb5f8[_0x2da9e7];return _0xdeff78;};'use strict';var EventEmitter=require(_0x8b5f('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8b5f('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8b5f('0x2'),'afterDestroy':_0x8b5f('0x3')};function emitEvent(_0x2c291f){return function(_0x232026,_0x1aa98c,_0x5bd69c){ChatMessageEvents[_0x8b5f('0x4')](_0x2c291f+':'+_0x232026['id'],_0x232026);ChatMessageEvents[_0x8b5f('0x4')](_0x2c291f,_0x232026);_0x5bd69c(null);};}for(var e in events){if(events[_0x8b5f('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8b5f('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5fde029..0c17fd2 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 _0x018c=['chat_messages','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes'];(function(_0x49fa11,_0x3bcb7e){var _0xd8c059=function(_0x4c1ee0){while(--_0x4c1ee0){_0x49fa11['push'](_0x49fa11['shift']());}};_0xd8c059(++_0x3bcb7e);}(_0x018c,0x9f));var _0xc018=function(_0x21e7e8,_0x706f4f){_0x21e7e8=_0x21e7e8-0x0;var _0x54ece7=_0x018c[_0x21e7e8];return _0x54ece7;};'use strict';var _=require(_0xc018('0x0'));var util=require('util');var logger=require(_0xc018('0x1'))(_0xc018('0x2'));var moment=require(_0xc018('0x3'));var BPromise=require('bluebird');var rp=require(_0xc018('0x4'));var fs=require('fs');var path=require(_0xc018('0x5'));var rimraf=require(_0xc018('0x6'));var config=require(_0xc018('0x7'));var attributes=require(_0xc018('0x8'));module['exports']=function(_0x202e69,_0x440c1b){return _0x202e69['define']('ChatMessage',attributes,{'tableName':_0xc018('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f7d12,_0x58dba8,_0x1e9af7){var _0x365455=_0x202e69['models'];var _0x504129=_0x2f7d12[_0xc018('0xa')]({'plain':!![]});if(_0x504129[_0xc018('0xb')][_0xc018('0xc')]()==='in'||_0x504129[_0xc018('0xb')][_0xc018('0xc')]()===_0xc018('0xd')&&!_0x504129[_0xc018('0xe')]&&!_[_0xc018('0xf')](_0x504129[_0xc018('0x10')])){_0x365455[_0xc018('0x11')]['findOne']({'where':{'id':_0x504129['ChatInteractionId']}})[_0xc018('0x12')](function(_0x42299c){if(_0x42299c){_0x42299c['update']({'lastMsgAt':_0x504129[_0xc018('0x13')],'lastMsgDirection':_0x504129['direction']['toLowerCase']()});}})[_0xc018('0x14')](function(_0x289d75){console[_0xc018('0x15')](_0x289d75);});}_0x1e9af7();}},'charset':_0xc018('0x16'),'collate':_0xc018('0x17')});}; \ No newline at end of file +var _0x06be=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','ChatInteraction','findOne','then'];(function(_0x151b7d,_0x283b82){var _0x1d97bf=function(_0x420e75){while(--_0x420e75){_0x151b7d['push'](_0x151b7d['shift']());}};_0x1d97bf(++_0x283b82);}(_0x06be,0xee));var _0xe06b=function(_0x560d99,_0x134a20){_0x560d99=_0x560d99-0x0;var _0x5d2ea6=_0x06be[_0x560d99];return _0x5d2ea6;};'use strict';var _=require(_0xe06b('0x0'));var util=require(_0xe06b('0x1'));var logger=require('../../config/logger')(_0xe06b('0x2'));var moment=require('moment');var BPromise=require(_0xe06b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe06b('0x4'));var rimraf=require(_0xe06b('0x5'));var config=require(_0xe06b('0x6'));var attributes=require('./chatMessage.attributes');module[_0xe06b('0x7')]=function(_0x555801,_0x13213c){return _0x555801[_0xe06b('0x8')](_0xe06b('0x9'),attributes,{'tableName':_0xe06b('0xa'),'paranoid':![],'indexes':[{'name':_0xe06b('0xb'),'fields':[_0xe06b('0xc')],'type':_0xe06b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x251a39,_0x528695,_0x56f046){var _0x2c0154=_0x555801[_0xe06b('0xe')];var _0x5baabc=_0x251a39[_0xe06b('0xf')]({'plain':!![]});if(_0x5baabc[_0xe06b('0x10')][_0xe06b('0x11')]()==='in'||_0x5baabc[_0xe06b('0x10')][_0xe06b('0x11')]()==='out'&&!_0x5baabc[_0xe06b('0x12')]&&!_['isNil'](_0x5baabc[_0xe06b('0x13')])){_0x2c0154[_0xe06b('0x14')][_0xe06b('0x15')]({'where':{'id':_0x5baabc['ChatInteractionId']}})[_0xe06b('0x16')](function(_0x19b5b7){if(_0x19b5b7){_0x19b5b7[_0xe06b('0x17')]({'lastMsgAt':_0x5baabc[_0xe06b('0x18')],'lastMsgDirection':_0x5baabc[_0xe06b('0x10')][_0xe06b('0x11')]()});}})[_0xe06b('0x19')](function(_0x276172){console[_0xe06b('0x1a')](_0x276172);});}_0x56f046();}},'charset':_0xe06b('0x1b'),'collate':_0xe06b('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 4f45ee2..ecdd43a 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 _0xfbd2=['raw','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateChatMessage','ChatMessage','create','body','options'];(function(_0x4bab02,_0x5e9b4c){var _0xdcf1b=function(_0x38b011){while(--_0x38b011){_0x4bab02['push'](_0x4bab02['shift']());}};_0xdcf1b(++_0x5e9b4c);}(_0xfbd2,0x143));var _0x2fbd=function(_0x46585b,_0x36ee90){_0x46585b=_0x46585b-0x0;var _0x1a0c84=_0xfbd2[_0x46585b];return _0x1a0c84;};'use strict';var _=require(_0x2fbd('0x0'));var util=require(_0x2fbd('0x1'));var moment=require(_0x2fbd('0x2'));var BPromise=require(_0x2fbd('0x3'));var rs=require(_0x2fbd('0x4'));var fs=require('fs');var Redis=require(_0x2fbd('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fbd('0x6'));var logger=require('../../config/logger')(_0x2fbd('0x7'));var config=require(_0x2fbd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2fbd('0x9')]['http']({'port':0x232a});config[_0x2fbd('0xa')]=_[_0x2fbd('0xb')](config[_0x2fbd('0xa')],{'host':_0x2fbd('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2fbd('0xa')]));require(_0x2fbd('0xd'))[_0x2fbd('0xe')](socket);function respondWithRpcPromise(_0x2aa571,_0x17606b,_0x3d0acf){return new BPromise(function(_0xa25a6e,_0x550d88){return client['request'](_0x2aa571,_0x3d0acf)[_0x2fbd('0xf')](function(_0x180bc0){logger['info'](_0x2fbd('0x10'),_0x17606b,_0x2fbd('0x11'));logger[_0x2fbd('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x17606b,_0x2fbd('0x11'),JSON['stringify'](_0x180bc0));if(_0x180bc0[_0x2fbd('0x13')]){if(_0x180bc0[_0x2fbd('0x13')][_0x2fbd('0x14')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x17606b,_0x180bc0[_0x2fbd('0x13')]['message']);return _0x550d88(_0x180bc0[_0x2fbd('0x13')]['message']);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x17606b,_0x180bc0['error'][_0x2fbd('0x15')]);return _0xa25a6e(_0x180bc0['error']['message']);}else{logger[_0x2fbd('0x16')](_0x2fbd('0x10'),_0x17606b,_0x2fbd('0x11'));_0xa25a6e(_0x180bc0[_0x2fbd('0x17')]['message']);}})['catch'](function(_0x3a4f5c){logger[_0x2fbd('0x13')]('ChatMessage,\x20%s,\x20%s',_0x17606b,_0x3a4f5c);_0x550d88(_0x3a4f5c);});});}exports[_0x2fbd('0x18')]=function(_0x5c26c9){var _0x393b19=this;return new Promise(function(_0x583f57,_0x1136d1){return db[_0x2fbd('0x19')][_0x2fbd('0x1a')](_0x5c26c9[_0x2fbd('0x1b')],{'raw':_0x5c26c9[_0x2fbd('0x1c')]?_0x5c26c9[_0x2fbd('0x1c')][_0x2fbd('0x1d')]===undefined?!![]:![]:!![]})[_0x2fbd('0xf')](function(_0x2ce571){logger[_0x2fbd('0x16')]('CreateChatMessage',_0x5c26c9);logger[_0x2fbd('0x12')](_0x2fbd('0x18'),_0x5c26c9,JSON[_0x2fbd('0x1e')](_0x2ce571));_0x583f57(_0x2ce571);})[_0x2fbd('0x1f')](function(_0x48b8fb){logger[_0x2fbd('0x13')]('CreateChatMessage',_0x48b8fb['message'],_0x5c26c9);_0x1136d1(_0x393b19['error'](0x1f4,_0x48b8fb['message']));});});}; \ No newline at end of file +var _0x392f=['body','options','raw','stringify','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateChatMessage','create'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x392f,0x17d));var _0xf392=function(_0x489fe3,_0x5ebb81){_0x489fe3=_0x489fe3-0x0;var _0x592190=_0x392f[_0x489fe3];return _0x592190;};'use strict';var _=require(_0xf392('0x0'));var util=require(_0xf392('0x1'));var moment=require('moment');var BPromise=require(_0xf392('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf392('0x3'));var db=require(_0xf392('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf392('0x5'))(_0xf392('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf392('0x7')](config[_0xf392('0x8')],{'host':_0xf392('0x9'),'port':0x18eb});var socket=require(_0xf392('0xa'))(new Redis(config[_0xf392('0x8')]));require('./chatMessage.socket')[_0xf392('0xb')](socket);function respondWithRpcPromise(_0x1b6bc3,_0x29cf97,_0x198c59){return new BPromise(function(_0xec2c4d,_0x2deda8){return client[_0xf392('0xc')](_0x1b6bc3,_0x198c59)[_0xf392('0xd')](function(_0x18c435){logger[_0xf392('0xe')](_0xf392('0xf'),_0x29cf97,_0xf392('0x10'));logger[_0xf392('0x11')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x29cf97,_0xf392('0x10'),JSON['stringify'](_0x18c435));if(_0x18c435['error']){if(_0x18c435[_0xf392('0x12')][_0xf392('0x13')]===0x1f4){logger[_0xf392('0x12')](_0xf392('0xf'),_0x29cf97,_0x18c435[_0xf392('0x12')]['message']);return _0x2deda8(_0x18c435['error'][_0xf392('0x14')]);}logger['error'](_0xf392('0xf'),_0x29cf97,_0x18c435['error']['message']);return _0xec2c4d(_0x18c435['error'][_0xf392('0x14')]);}else{logger[_0xf392('0xe')](_0xf392('0xf'),_0x29cf97,_0xf392('0x10'));_0xec2c4d(_0x18c435[_0xf392('0x15')][_0xf392('0x14')]);}})[_0xf392('0x16')](function(_0x68315a){logger['error']('ChatMessage,\x20%s,\x20%s',_0x29cf97,_0x68315a);_0x2deda8(_0x68315a);});});}exports[_0xf392('0x17')]=function(_0x9b117c){var _0x568fe3=this;return new Promise(function(_0x307beb,_0x401943){return db['ChatMessage'][_0xf392('0x18')](_0x9b117c[_0xf392('0x19')],{'raw':_0x9b117c[_0xf392('0x1a')]?_0x9b117c[_0xf392('0x1a')][_0xf392('0x1b')]===undefined?!![]:![]:!![]})[_0xf392('0xd')](function(_0x385d39){logger[_0xf392('0xe')]('CreateChatMessage',_0x9b117c);logger[_0xf392('0x11')](_0xf392('0x17'),_0x9b117c,JSON[_0xf392('0x1c')](_0x385d39));_0x307beb(_0x385d39);})['catch'](function(_0x208f32){logger[_0xf392('0x12')]('CreateChatMessage',_0x208f32[_0xf392('0x14')],_0x9b117c);_0x401943(_0x568fe3[_0xf392('0x12')](0x1f4,_0x208f32[_0xf392('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 3543812..e28cfff 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 _0x61df=['emit','removeListener','register','chatMessage:','update'];(function(_0x547408,_0x1eae55){var _0xff690c=function(_0x3b0068){while(--_0x3b0068){_0x547408['push'](_0x547408['shift']());}};_0xff690c(++_0x1eae55);}(_0x61df,0xbd));var _0xf61d=function(_0x30dd5c,_0x1473ae){_0x30dd5c=_0x30dd5c-0x0;var _0x630046=_0x61df[_0x30dd5c];return _0x630046;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove',_0xf61d('0x0')];function createListener(_0x449fc,_0x5d85f0){return function(_0x40127d){_0x5d85f0[_0xf61d('0x1')](_0x449fc,_0x40127d);};}function removeListener(_0x485a55,_0x3170e7){return function(){ChatMessageEvents[_0xf61d('0x2')](_0x485a55,_0x3170e7);};}exports[_0xf61d('0x3')]=function(_0x458eb9){for(var _0x2d0791=0x0,_0x3ac0ec=events['length'];_0x2d0791<_0x3ac0ec;_0x2d0791++){var _0x42b382=events[_0x2d0791];var _0x49523e=createListener(_0xf61d('0x4')+_0x42b382,_0x458eb9);ChatMessageEvents['on'](_0x42b382,_0x49523e);}}; \ No newline at end of file +var _0x8819=['removeListener','register','length','chatMessage:','remove','update'];(function(_0x1de0b9,_0xc6f046){var _0x18edae=function(_0x2d3ad1){while(--_0x2d3ad1){_0x1de0b9['push'](_0x1de0b9['shift']());}};_0x18edae(++_0xc6f046);}(_0x8819,0x94));var _0x9881=function(_0x346ed3,_0x3d76fb){_0x346ed3=_0x346ed3-0x0;var _0x5f49df=_0x8819[_0x346ed3];return _0x5f49df;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x9881('0x0'),_0x9881('0x1')];function createListener(_0x317d26,_0x14cd6c){return function(_0x17e6bf){_0x14cd6c['emit'](_0x317d26,_0x17e6bf);};}function removeListener(_0x333d6f,_0x446deb){return function(){ChatMessageEvents[_0x9881('0x2')](_0x333d6f,_0x446deb);};}exports[_0x9881('0x3')]=function(_0x1791fd){for(var _0x2a3664=0x0,_0x5f1d45=events[_0x9881('0x4')];_0x2a3664<_0x5f1d45;_0x2a3664++){var _0x4a6471=events[_0x2a3664];var _0x530547=createListener(_0x9881('0x5')+_0x4a6471,_0x1791fd);ChatMessageEvents['on'](_0x4a6471,_0x530547);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index b657e32..3a1a41a 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 _0x85ab=['connect-timeout','express','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','create','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','util','path'];(function(_0x2d42e7,_0x1242bf){var _0x813738=function(_0x2c3b33){while(--_0x2c3b33){_0x2d42e7['push'](_0x2d42e7['shift']());}};_0x813738(++_0x1242bf);}(_0x85ab,0xe5));var _0xb85a=function(_0x543583,_0x371d21){_0x543583=_0x543583-0x0;var _0x5d79c3=_0x85ab[_0x543583];return _0x5d79c3;};'use strict';var multer=require('multer');var util=require(_0xb85a('0x0'));var path=require(_0xb85a('0x1'));var timeout=require(_0xb85a('0x2'));var express=require(_0xb85a('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb85a('0x4'));var config=require('../../config/environment');var controller=require(_0xb85a('0x5'));router['get']('/',auth[_0xb85a('0x6')](),controller[_0xb85a('0x7')]);router[_0xb85a('0x8')](_0xb85a('0x9'),auth[_0xb85a('0x6')](),controller[_0xb85a('0xa')]);router[_0xb85a('0x8')](_0xb85a('0xb'),auth[_0xb85a('0x6')](),controller['show']);router['post']('/',auth[_0xb85a('0x6')](),interaction['tracked']('chat','chatmessage:create'),controller[_0xb85a('0xc')]);router['put'](_0xb85a('0xb'),controller[_0xb85a('0xd')]);router[_0xb85a('0xe')](_0xb85a('0xf'),auth['isAuthenticated'](),controller[_0xb85a('0x10')]);router[_0xb85a('0xe')](_0xb85a('0x11'),auth[_0xb85a('0x6')](),controller[_0xb85a('0x12')]);router['delete'](_0xb85a('0xb'),auth['isAuthenticated'](),controller[_0xb85a('0x13')]);module[_0xb85a('0x14')]=router; \ No newline at end of file +var _0x9473=['../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','tracked','create','put','/:id','accept','/:id/reject','reject','destroy','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x9473,0x182));var _0x3947=function(_0xf4fc72,_0x5bdde6){_0xf4fc72=_0xf4fc72-0x0;var _0x40ed4f=_0x9473[_0xf4fc72];return _0x40ed4f;};'use strict';var multer=require(_0x3947('0x0'));var util=require(_0x3947('0x1'));var path=require(_0x3947('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3947('0x3'));var auth=require(_0x3947('0x4'));var interaction=require(_0x3947('0x5'));var config=require(_0x3947('0x6'));var controller=require(_0x3947('0x7'));router[_0x3947('0x8')]('/',auth[_0x3947('0x9')](),controller[_0x3947('0xa')]);router['get'](_0x3947('0xb'),auth[_0x3947('0x9')](),controller[_0x3947('0xc')]);router[_0x3947('0x8')]('/:id',auth[_0x3947('0x9')](),controller[_0x3947('0xd')]);router[_0x3947('0xe')]('/',auth[_0x3947('0x9')](),interaction[_0x3947('0xf')]('chat','chatmessage:create'),controller[_0x3947('0x10')]);router[_0x3947('0x11')](_0x3947('0x12'),controller['update']);router['put']('/:id/accept',auth[_0x3947('0x9')](),controller[_0x3947('0x13')]);router[_0x3947('0x11')](_0x3947('0x14'),auth[_0x3947('0x9')](),controller[_0x3947('0x15')]);router['delete'](_0x3947('0x12'),auth[_0x3947('0x9')](),controller[_0x3947('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 023a228..09c7553 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x514e0b,_0xedd3e8){var _0x2c7782=function(_0x490d88){while(--_0x490d88){_0x514e0b['push'](_0x514e0b['shift']());}};_0x2c7782(++_0xedd3e8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x16af01,_0x9c623c){_0x16af01=_0x16af01-0x0;var _0x4d4b9a=_0x5f2f[_0x16af01];return _0x4d4b9a;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x31379c,_0x312a90){var _0x1667ae=function(_0x4cec71){while(--_0x4cec71){_0x31379c['push'](_0x31379c['shift']());}};_0x1667ae(++_0x312a90);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1ab97c,_0x20dfc8){_0x1ab97c=_0x1ab97c-0x0;var _0x2ea95c=_0x5f2f[_0x1ab97c];return _0x2ea95c;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index a74ebf3..eda93a4 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(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x7a54,0x106));var _0x47a5=function(_0x3537d4,_0xd3fd7c){_0x3537d4=_0x3537d4-0x0;var _0x4c3fc2=_0x7a54[_0x3537d4];return _0x4c3fc2;};'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 _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(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x7a54,0x106));var _0x47a5=function(_0x3d9095,_0x399cb9){_0x3d9095=_0x3d9095-0x0;var _0x1bbf3d=_0x7a54[_0x3d9095];return _0x1bbf3d;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 5300a89..fa6e7cc 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 _0x56e3=['setMaxListeners','update','emit','hasOwnProperty','hook','events','../../mysqldb','ChatOfflineMessage'];(function(_0x5d1fb0,_0x411156){var _0x1c7da0=function(_0xe617fa){while(--_0xe617fa){_0x5d1fb0['push'](_0x5d1fb0['shift']());}};_0x1c7da0(++_0x411156);}(_0x56e3,0xb5));var _0x356e=function(_0x3ba7a0,_0x310269){_0x3ba7a0=_0x3ba7a0-0x0;var _0x421ebd=_0x56e3[_0x3ba7a0];return _0x421ebd;};'use strict';var EventEmitter=require(_0x356e('0x0'));var ChatOfflineMessage=require(_0x356e('0x1'))['db'][_0x356e('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x356e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x356e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46804c){return function(_0x14ef3a,_0x4cb164,_0x5a67d3){ChatOfflineMessageEvents[_0x356e('0x5')](_0x46804c+':'+_0x14ef3a['id'],_0x14ef3a);ChatOfflineMessageEvents[_0x356e('0x5')](_0x46804c,_0x14ef3a);_0x5a67d3(null);};}for(var e in events){if(events[_0x356e('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x356e('0x7')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file +var _0x71a5=['events','../../mysqldb','save','update','emit','hasOwnProperty'];(function(_0x387569,_0xcbdc11){var _0x308f22=function(_0xef8619){while(--_0xef8619){_0x387569['push'](_0x387569['shift']());}};_0x308f22(++_0xcbdc11);}(_0x71a5,0x168));var _0x571a=function(_0x42bac0,_0x47a8ba){_0x42bac0=_0x42bac0-0x0;var _0x46d559=_0x71a5[_0x42bac0];return _0x46d559;};'use strict';var EventEmitter=require(_0x571a('0x0'));var ChatOfflineMessage=require(_0x571a('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x571a('0x2'),'afterUpdate':_0x571a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x234f18){return function(_0xc15697,_0x5b4931,_0x4262fb){ChatOfflineMessageEvents['emit'](_0x234f18+':'+_0xc15697['id'],_0xc15697);ChatOfflineMessageEvents[_0x571a('0x4')](_0x234f18,_0xc15697);_0x4262fb(null);};}for(var e in events){if(events[_0x571a('0x5')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f49a0bc..3c9b06e 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 _0x907c=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0x280e9c,_0x320742){var _0x4c3809=function(_0x7a4b57){while(--_0x7a4b57){_0x280e9c['push'](_0x280e9c['shift']());}};_0x4c3809(++_0x320742);}(_0x907c,0x8e));var _0xc907=function(_0x3c177a,_0x5b49ae){_0x3c177a=_0x3c177a-0x0;var _0x53f1c8=_0x907c[_0x3c177a];return _0x53f1c8;};'use strict';var attributes=require(_0xc907('0x0'));module[_0xc907('0x1')]=function(_0x351b9f){return _0x351b9f[_0xc907('0x2')](_0xc907('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc907('0x4'),'collate':_0xc907('0x5')});}; \ No newline at end of file +var _0xe83b=['utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x255557,_0x1784ff){var _0x4bf2a6=function(_0x5573e4){while(--_0x5573e4){_0x255557['push'](_0x255557['shift']());}};_0x4bf2a6(++_0x1784ff);}(_0xe83b,0x14b));var _0xbe83=function(_0x4e204f,_0x417205){_0x4e204f=_0x4e204f-0x0;var _0x32e8e1=_0xe83b[_0x4e204f];return _0x32e8e1;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xbe83('0x0')]=function(_0x5e5f46){return _0x5e5f46[_0xbe83('0x1')](_0xbe83('0x2'),attributes,{'tableName':_0xbe83('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe83('0x4'),'collate':_0xbe83('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index b85256a..fb0c7e8 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 _0x582f=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f21c6,_0x51de35){var _0x32cbd5=function(_0x651591){while(--_0x651591){_0x2f21c6['push'](_0x2f21c6['shift']());}};_0x32cbd5(++_0x51de35);}(_0x582f,0xce));var _0xf582=function(_0x46cf00,_0x457a43){_0x46cf00=_0x46cf00-0x0;var _0x3974dc=_0x582f[_0x46cf00];return _0x3974dc;};'use strict';var _=require(_0xf582('0x0'));var util=require(_0xf582('0x1'));var moment=require(_0xf582('0x2'));var BPromise=require(_0xf582('0x3'));var rs=require(_0xf582('0x4'));var fs=require('fs');var Redis=require(_0xf582('0x5'));var db=require(_0xf582('0x6'))['db'];var utils=require(_0xf582('0x7'));var logger=require(_0xf582('0x8'))(_0xf582('0x9'));var config=require(_0xf582('0xa'));var jayson=require(_0xf582('0xb'));var client=jayson['client'][_0xf582('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7158f9,_0x3dd9c7,_0x4ace78){return new BPromise(function(_0x449cd2,_0x387e35){return client[_0xf582('0xd')](_0x7158f9,_0x4ace78)['then'](function(_0x2ca911){logger['info'](_0xf582('0xe'),_0x3dd9c7,_0xf582('0xf'));logger[_0xf582('0x10')](_0xf582('0x11'),_0x3dd9c7,'request\x20sent',JSON[_0xf582('0x12')](_0x2ca911));if(_0x2ca911[_0xf582('0x13')]){if(_0x2ca911[_0xf582('0x13')][_0xf582('0x14')]===0x1f4){logger[_0xf582('0x13')](_0xf582('0xe'),_0x3dd9c7,_0x2ca911[_0xf582('0x13')][_0xf582('0x15')]);return _0x387e35(_0x2ca911[_0xf582('0x13')][_0xf582('0x15')]);}logger[_0xf582('0x13')](_0xf582('0xe'),_0x3dd9c7,_0x2ca911[_0xf582('0x13')][_0xf582('0x15')]);return _0x449cd2(_0x2ca911['error'][_0xf582('0x15')]);}else{logger[_0xf582('0x16')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3dd9c7,_0xf582('0xf'));_0x449cd2(_0x2ca911[_0xf582('0x17')]['message']);}})[_0xf582('0x18')](function(_0x237b66){logger[_0xf582('0x13')](_0xf582('0xe'),_0x3dd9c7,_0x237b66);_0x387e35(_0x237b66);});});} \ No newline at end of file +var _0x3068=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0x3068,0xe7));var _0x8306=function(_0x4acebd,_0x590441){_0x4acebd=_0x4acebd-0x0;var _0x1fb7e9=_0x3068[_0x4acebd];return _0x1fb7e9;};'use strict';var _=require(_0x8306('0x0'));var util=require(_0x8306('0x1'));var moment=require('moment');var BPromise=require(_0x8306('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8306('0x3'))['db'];var utils=require(_0x8306('0x4'));var logger=require(_0x8306('0x5'))(_0x8306('0x6'));var config=require('../../config/environment');var jayson=require(_0x8306('0x7'));var client=jayson['client'][_0x8306('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ec2b9,_0x16b6b0,_0x4f2a3b){return new BPromise(function(_0x327882,_0x2ab1b9){return client[_0x8306('0x9')](_0x3ec2b9,_0x4f2a3b)[_0x8306('0xa')](function(_0x53e236){logger['info'](_0x8306('0xb'),_0x16b6b0,_0x8306('0xc'));logger['debug'](_0x8306('0xd'),_0x16b6b0,_0x8306('0xc'),JSON['stringify'](_0x53e236));if(_0x53e236[_0x8306('0xe')]){if(_0x53e236[_0x8306('0xe')][_0x8306('0xf')]===0x1f4){logger['error'](_0x8306('0xb'),_0x16b6b0,_0x53e236[_0x8306('0xe')][_0x8306('0x10')]);return _0x2ab1b9(_0x53e236[_0x8306('0xe')]['message']);}logger[_0x8306('0xe')](_0x8306('0xb'),_0x16b6b0,_0x53e236['error']['message']);return _0x327882(_0x53e236['error'][_0x8306('0x10')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x16b6b0,_0x8306('0xc'));_0x327882(_0x53e236['result']['message']);}})[_0x8306('0x11')](function(_0x2c3b3f){logger[_0x8306('0xe')](_0x8306('0xb'),_0x16b6b0,_0x2c3b3f);_0x2ab1b9(_0x2c3b3f);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index e99312b..aa2661b 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 _0x6f68=['show','put','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id'];(function(_0x47fb80,_0x46cce0){var _0x233b4=function(_0x3869e9){while(--_0x3869e9){_0x47fb80['push'](_0x47fb80['shift']());}};_0x233b4(++_0x46cce0);}(_0x6f68,0x136));var _0x86f6=function(_0xe0b368,_0x5dce0){_0xe0b368=_0xe0b368-0x0;var _0x6c5a3f=_0x6f68[_0xe0b368];return _0x6c5a3f;};'use strict';var multer=require(_0x86f6('0x0'));var util=require('util');var path=require(_0x86f6('0x1'));var timeout=require(_0x86f6('0x2'));var express=require(_0x86f6('0x3'));var router=express[_0x86f6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86f6('0x5'));var interaction=require(_0x86f6('0x6'));var config=require(_0x86f6('0x7'));var controller=require(_0x86f6('0x8'));router[_0x86f6('0x9')]('/',auth[_0x86f6('0xa')](),controller['index']);router[_0x86f6('0x9')]('/describe',auth[_0x86f6('0xa')](),controller[_0x86f6('0xb')]);router[_0x86f6('0x9')](_0x86f6('0xc'),auth['isAuthenticated'](),controller[_0x86f6('0xd')]);router['post']('/',auth[_0x86f6('0xa')](),controller['create']);router[_0x86f6('0xe')](_0x86f6('0xc'),auth[_0x86f6('0xa')](),controller[_0x86f6('0xf')]);router[_0x86f6('0x10')]('/:id',auth[_0x86f6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1575=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','index','get','isAuthenticated','show','post','create','put','/:id'];(function(_0x45d5df,_0x19432f){var _0x5ee7a2=function(_0x3382c7){while(--_0x3382c7){_0x45d5df['push'](_0x45d5df['shift']());}};_0x5ee7a2(++_0x19432f);}(_0x1575,0xd5));var _0x5157=function(_0x2c9db2,_0x65ff16){_0x2c9db2=_0x2c9db2-0x0;var _0x18eb9c=_0x1575[_0x2c9db2];return _0x18eb9c;};'use strict';var multer=require(_0x5157('0x0'));var util=require(_0x5157('0x1'));var path=require(_0x5157('0x2'));var timeout=require(_0x5157('0x3'));var express=require(_0x5157('0x4'));var router=express[_0x5157('0x5')]();var fs_extra=require(_0x5157('0x6'));var auth=require(_0x5157('0x7'));var interaction=require(_0x5157('0x8'));var config=require('../../config/environment');var controller=require(_0x5157('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5157('0xa')]);router[_0x5157('0xb')]('/describe',auth[_0x5157('0xc')](),controller['describe']);router['get']('/:id',auth[_0x5157('0xc')](),controller[_0x5157('0xd')]);router[_0x5157('0xe')]('/',auth['isAuthenticated'](),controller[_0x5157('0xf')]);router[_0x5157('0x10')](_0x5157('0x11'),auth['isAuthenticated'](),controller[_0x5157('0x12')]);router[_0x5157('0x13')](_0x5157('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x5157('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 54fb424..1738779 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 _0x0b0e=['INTEGER','exports','STRING','mouseOver','timeout'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x0b0e,0xf6));var _0xe0b0=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x0b0e[_0xbf8ebe];return _0x1e25e8;};'use strict';var Sequelize=require('sequelize');module[_0xe0b0('0x0')]={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe0b0('0x2'),_0xe0b0('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe0b0('0x1')]},'timeout':{'type':Sequelize[_0xe0b0('0x4')]}}; \ No newline at end of file +var _0xe21d=['STRING','ENUM','mouseOver'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xe21d,0x1cf));var _0xde21=function(_0x4edc11,_0x109791){_0x4edc11=_0x4edc11-0x0;var _0x169ff1=_0xe21d[_0x4edc11];return _0x169ff1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xde21('0x0')](_0xde21('0x1'),'timeout'),'defaultValue':_0xde21('0x1')},'selector':{'type':Sequelize[_0xde21('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 2d9ed39..ca101c4 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 _0x448b=['querystring','papaparse','ioredis','../../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','Content-Range','reject','update','then','destroy','error','name','send','show','model','ChatProactiveAction','rawAttributes','keys','filters','intersection','query','attributes','fields','length','include','options','catch','create','body','params','find','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'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x448b,0x125));var _0xb448=function(_0x17a963,_0x39566e){_0x17a963=_0x17a963-0x0;var _0x2110f3=_0x448b[_0x17a963];return _0x2110f3;};'use strict';var emlformat=require(_0xb448('0x0'));var rimraf=require(_0xb448('0x1'));var zipdir=require(_0xb448('0x2'));var jsonpatch=require(_0xb448('0x3'));var rp=require(_0xb448('0x4'));var moment=require(_0xb448('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb448('0x6'));var util=require(_0xb448('0x7'));var path=require(_0xb448('0x8'));var sox=require(_0xb448('0x9'));var csv=require(_0xb448('0xa'));var ejs=require(_0xb448('0xb'));var fs=require('fs');var fs_extra=require(_0xb448('0xc'));var _=require('lodash');var squel=require(_0xb448('0xd'));var crypto=require(_0xb448('0xe'));var jsforce=require(_0xb448('0xf'));var deskjs=require(_0xb448('0x10'));var toCsv=require(_0xb448('0xa'));var querystring=require(_0xb448('0x11'));var Papa=require(_0xb448('0x12'));var Redis=require(_0xb448('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb448('0x14'));var as=require(_0xb448('0x15'));var hardwareService=require(_0xb448('0x16'));var logger=require(_0xb448('0x17'))(_0xb448('0x18'));var utils=require(_0xb448('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb448('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5506eb,_0x13c0a9){_0x13c0a9=_0x13c0a9||0xcc;return function(_0x35a883){if(_0x35a883){return _0x5506eb[_0xb448('0x1b')](_0x13c0a9);}return _0x5506eb[_0xb448('0x1c')](_0x13c0a9)[_0xb448('0x1d')]();};}function respondWithResult(_0x4ff345,_0x46978b){_0x46978b=_0x46978b||0xc8;return function(_0x116376){if(_0x116376){return _0x4ff345[_0xb448('0x1c')](_0x46978b)[_0xb448('0x1e')](_0x116376);}};}function respondWithFilteredResult(_0x2eab92,_0x38e884){return function(_0x219908){if(_0x219908){var _0x4744f7=typeof _0x38e884[_0xb448('0x1f')]==='undefined'&&typeof _0x38e884['limit']===_0xb448('0x20');var _0x5ac2b5=_0x219908[_0xb448('0x21')];var _0x1986de=_0x4744f7?0x0:_0x38e884['offset'];var _0x27906d=_0x4744f7?_0x219908[_0xb448('0x21')]:_0x38e884['offset']+_0x38e884[_0xb448('0x22')];var _0x1616bb;if(_0x27906d>=_0x5ac2b5){_0x27906d=_0x5ac2b5;_0x1616bb=0xc8;}else{_0x1616bb=0xce;}_0x2eab92[_0xb448('0x1c')](_0x1616bb);return _0x2eab92[_0xb448('0x23')](_0xb448('0x24'),_0x1986de+'-'+_0x27906d+'/'+_0x5ac2b5)[_0xb448('0x1e')](_0x219908);}return null;};}function patchUpdates(_0x1c25af){return function(_0x265951){try{jsonpatch['apply'](_0x265951,_0x1c25af,!![]);}catch(_0xec04af){return BPromise[_0xb448('0x25')](_0xec04af);}return _0x265951['save']();};}function saveUpdates(_0x245135,_0x3ef9c7){return function(_0x22e2ec){if(_0x22e2ec){return _0x22e2ec[_0xb448('0x26')](_0x245135)[_0xb448('0x27')](function(_0x4e123b){return _0x4e123b;});}return null;};}function removeEntity(_0x5126a8,_0x756e92){return function(_0xd27219){if(_0xd27219){return _0xd27219[_0xb448('0x28')]()[_0xb448('0x27')](function(){_0x5126a8[_0xb448('0x1c')](0xcc)[_0xb448('0x1d')]();});}};}function handleEntityNotFound(_0x5d1c6e,_0x35e3e2){return function(_0x2cdb88){if(!_0x2cdb88){_0x5d1c6e['sendStatus'](0x194);}return _0x2cdb88;};}function handleError(_0x14d636,_0x1c2183){_0x1c2183=_0x1c2183||0x1f4;return function(_0x2e3b84){logger[_0xb448('0x29')](_0x2e3b84['stack']);if(_0x2e3b84[_0xb448('0x2a')]){delete _0x2e3b84[_0xb448('0x2a')];}_0x14d636[_0xb448('0x1c')](_0x1c2183)[_0xb448('0x2b')](_0x2e3b84);};}exports[_0xb448('0x2c')]=function(_0x1e9266,_0x17654e){var _0xb9204d={'raw':!![],'where':{'id':_0x1e9266['params']['id']}},_0x4b698a={};_0x4b698a[_0xb448('0x2d')]=_['keys'](db[_0xb448('0x2e')][_0xb448('0x2f')]);_0x4b698a['query']=_[_0xb448('0x30')](_0x1e9266['query']);_0x4b698a[_0xb448('0x31')]=_[_0xb448('0x32')](_0x4b698a[_0xb448('0x2d')],_0x4b698a[_0xb448('0x33')]);_0xb9204d[_0xb448('0x34')]=_[_0xb448('0x32')](_0x4b698a[_0xb448('0x2d')],qs['fields'](_0x1e9266[_0xb448('0x33')][_0xb448('0x35')]));_0xb9204d[_0xb448('0x34')]=_0xb9204d[_0xb448('0x34')][_0xb448('0x36')]?_0xb9204d[_0xb448('0x34')]:_0x4b698a[_0xb448('0x2d')];if(_0x1e9266['query']['includeAll']){_0xb9204d[_0xb448('0x37')]=[{'all':!![]}];}_0xb9204d=_['merge']({},_0xb9204d,_0x1e9266[_0xb448('0x38')]);return db[_0xb448('0x2e')]['find'](_0xb9204d)[_0xb448('0x27')](handleEntityNotFound(_0x17654e,null))[_0xb448('0x27')](respondWithResult(_0x17654e,null))[_0xb448('0x39')](handleError(_0x17654e,null));};exports[_0xb448('0x3a')]=function(_0xe2238e,_0x146190){return db[_0xb448('0x2e')]['create'](_0xe2238e[_0xb448('0x3b')],{})['then'](respondWithResult(_0x146190,0xc9))['catch'](handleError(_0x146190,null));};exports[_0xb448('0x26')]=function(_0x4ada42,_0x402885){if(_0x4ada42[_0xb448('0x3b')]['id']){delete _0x4ada42[_0xb448('0x3b')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x4ada42[_0xb448('0x3c')]['id']}})['then'](handleEntityNotFound(_0x402885,null))[_0xb448('0x27')](saveUpdates(_0x4ada42[_0xb448('0x3b')],null))['then'](respondWithResult(_0x402885,null))[_0xb448('0x39')](handleError(_0x402885,null));};exports['destroy']=function(_0x478731,_0x1f96c4){return db['ChatProactiveAction'][_0xb448('0x3d')]({'where':{'id':_0x478731[_0xb448('0x3c')]['id']}})[_0xb448('0x27')](handleEntityNotFound(_0x1f96c4,null))['then'](removeEntity(_0x1f96c4,null))[_0xb448('0x39')](handleError(_0x1f96c4,null));}; \ No newline at end of file +var _0x308a=['ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','options','find','catch','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0x308a,0x71));var _0xa308=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x308a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xa308('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa308('0x1'));var jsonpatch=require(_0xa308('0x2'));var rp=require(_0xa308('0x3'));var moment=require(_0xa308('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa308('0x5'));var path=require(_0xa308('0x6'));var sox=require(_0xa308('0x7'));var csv=require(_0xa308('0x8'));var ejs=require(_0xa308('0x9'));var fs=require('fs');var fs_extra=require(_0xa308('0xa'));var _=require(_0xa308('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa308('0xc'));var deskjs=require(_0xa308('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa308('0xe'));var Papa=require('papaparse');var Redis=require(_0xa308('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa308('0x10'));var as=require(_0xa308('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa308('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa308('0x13'));var licenseUtil=require(_0xa308('0x14'));var db=require(_0xa308('0x15'))['db'];function respondWithStatusCode(_0x36b6eb,_0x224599){_0x224599=_0x224599||0xcc;return function(_0x4577ca){if(_0x4577ca){return _0x36b6eb['sendStatus'](_0x224599);}return _0x36b6eb[_0xa308('0x16')](_0x224599)[_0xa308('0x17')]();};}function respondWithResult(_0x80ee50,_0x32d57e){_0x32d57e=_0x32d57e||0xc8;return function(_0x39b04c){if(_0x39b04c){return _0x80ee50['status'](_0x32d57e)['json'](_0x39b04c);}};}function respondWithFilteredResult(_0x558c31,_0x1ba897){return function(_0x31193e){if(_0x31193e){var _0x178c33=typeof _0x1ba897[_0xa308('0x18')]==='undefined'&&typeof _0x1ba897[_0xa308('0x19')]===_0xa308('0x1a');var _0x1a94ba=_0x31193e[_0xa308('0x1b')];var _0x309ac0=_0x178c33?0x0:_0x1ba897[_0xa308('0x18')];var _0x4d6ab9=_0x178c33?_0x31193e[_0xa308('0x1b')]:_0x1ba897[_0xa308('0x18')]+_0x1ba897[_0xa308('0x19')];var _0x5408b1;if(_0x4d6ab9>=_0x1a94ba){_0x4d6ab9=_0x1a94ba;_0x5408b1=0xc8;}else{_0x5408b1=0xce;}_0x558c31[_0xa308('0x16')](_0x5408b1);return _0x558c31[_0xa308('0x1c')](_0xa308('0x1d'),_0x309ac0+'-'+_0x4d6ab9+'/'+_0x1a94ba)[_0xa308('0x1e')](_0x31193e);}return null;};}function patchUpdates(_0x1312aa){return function(_0x2e1d96){try{jsonpatch[_0xa308('0x1f')](_0x2e1d96,_0x1312aa,!![]);}catch(_0x57cec3){return BPromise[_0xa308('0x20')](_0x57cec3);}return _0x2e1d96[_0xa308('0x21')]();};}function saveUpdates(_0x167a27,_0x1588d0){return function(_0x31eb17){if(_0x31eb17){return _0x31eb17['update'](_0x167a27)[_0xa308('0x22')](function(_0x3acb1c){return _0x3acb1c;});}return null;};}function removeEntity(_0x1c5a22,_0x18ec9a){return function(_0x5dbbbf){if(_0x5dbbbf){return _0x5dbbbf[_0xa308('0x23')]()[_0xa308('0x22')](function(){_0x1c5a22[_0xa308('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed1a2,_0x5f3995){return function(_0x557a11){if(!_0x557a11){_0x1ed1a2[_0xa308('0x24')](0x194);}return _0x557a11;};}function handleError(_0x54bfc4,_0x592364){_0x592364=_0x592364||0x1f4;return function(_0x192597){logger[_0xa308('0x25')](_0x192597[_0xa308('0x26')]);if(_0x192597['name']){delete _0x192597[_0xa308('0x27')];}_0x54bfc4[_0xa308('0x16')](_0x592364)[_0xa308('0x28')](_0x192597);};}exports[_0xa308('0x29')]=function(_0x15666f,_0x1f49f2){var _0x5814eb={'raw':!![],'where':{'id':_0x15666f[_0xa308('0x2a')]['id']}},_0x1f9db4={};_0x1f9db4[_0xa308('0x2b')]=_[_0xa308('0x2c')](db[_0xa308('0x2d')][_0xa308('0x2e')]);_0x1f9db4['query']=_[_0xa308('0x2c')](_0x15666f[_0xa308('0x2f')]);_0x1f9db4[_0xa308('0x30')]=_['intersection'](_0x1f9db4[_0xa308('0x2b')],_0x1f9db4['query']);_0x5814eb[_0xa308('0x31')]=_[_0xa308('0x32')](_0x1f9db4[_0xa308('0x2b')],qs[_0xa308('0x33')](_0x15666f['query'][_0xa308('0x33')]));_0x5814eb[_0xa308('0x31')]=_0x5814eb[_0xa308('0x31')][_0xa308('0x34')]?_0x5814eb['attributes']:_0x1f9db4['model'];if(_0x15666f[_0xa308('0x2f')][_0xa308('0x35')]){_0x5814eb[_0xa308('0x36')]=[{'all':!![]}];}_0x5814eb=_['merge']({},_0x5814eb,_0x15666f[_0xa308('0x37')]);return db['ChatProactiveAction'][_0xa308('0x38')](_0x5814eb)[_0xa308('0x22')](handleEntityNotFound(_0x1f49f2,null))[_0xa308('0x22')](respondWithResult(_0x1f49f2,null))[_0xa308('0x39')](handleError(_0x1f49f2,null));};exports[_0xa308('0x3a')]=function(_0x101ed6,_0x4940bf){return db[_0xa308('0x2d')]['create'](_0x101ed6['body'],{})[_0xa308('0x22')](respondWithResult(_0x4940bf,0xc9))['catch'](handleError(_0x4940bf,null));};exports[_0xa308('0x3b')]=function(_0x3b8cc8,_0x1eac26){if(_0x3b8cc8['body']['id']){delete _0x3b8cc8[_0xa308('0x3c')]['id'];}return db[_0xa308('0x2d')][_0xa308('0x38')]({'where':{'id':_0x3b8cc8[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1eac26,null))[_0xa308('0x22')](saveUpdates(_0x3b8cc8[_0xa308('0x3c')],null))[_0xa308('0x22')](respondWithResult(_0x1eac26,null))[_0xa308('0x39')](handleError(_0x1eac26,null));};exports['destroy']=function(_0x501def,_0x1ea9d1){return db['ChatProactiveAction']['find']({'where':{'id':_0x501def[_0xa308('0x2a')]['id']}})[_0xa308('0x22')](handleEntityNotFound(_0x1ea9d1,null))[_0xa308('0x22')](removeEntity(_0x1ea9d1,null))[_0xa308('0x39')](handleError(_0x1ea9d1,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0489816..0e03ffe 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 _0x652f=['ChatProactiveAction','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x4094db,_0x37747d){var _0x2fc37a=function(_0x5247bb){while(--_0x5247bb){_0x4094db['push'](_0x4094db['shift']());}};_0x2fc37a(++_0x37747d);}(_0x652f,0xb1));var _0xf652=function(_0xd8d09e,_0x3a589e){_0xd8d09e=_0xd8d09e-0x0;var _0x3feb0a=_0x652f[_0xd8d09e];return _0x3feb0a;};'use strict';var _=require(_0xf652('0x0'));var util=require(_0xf652('0x1'));var logger=require(_0xf652('0x2'))(_0xf652('0x3'));var moment=require(_0xf652('0x4'));var BPromise=require(_0xf652('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf652('0x6'));var config=require('../../config/environment');var attributes=require(_0xf652('0x7'));module[_0xf652('0x8')]=function(_0x5333e0,_0x4d544a){return _0x5333e0[_0xf652('0x9')](_0xf652('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe467=['rimraf','./chatProactiveAction.attributes','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','path'];(function(_0x492662,_0x47584a){var _0x1401bd=function(_0x43a6c9){while(--_0x43a6c9){_0x492662['push'](_0x492662['shift']());}};_0x1401bd(++_0x47584a);}(_0xe467,0x90));var _0x7e46=function(_0x4c6e4a,_0x263ab8){_0x4c6e4a=_0x4c6e4a-0x0;var _0x3d69f4=_0xe467[_0x4c6e4a];return _0x3d69f4;};'use strict';var _=require('lodash');var util=require(_0x7e46('0x0'));var logger=require(_0x7e46('0x1'))(_0x7e46('0x2'));var moment=require(_0x7e46('0x3'));var BPromise=require(_0x7e46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e46('0x5'));var rimraf=require(_0x7e46('0x6'));var config=require('../../config/environment');var attributes=require(_0x7e46('0x7'));module['exports']=function(_0x3de806,_0x3645de){return _0x3de806['define'](_0x7e46('0x8'),attributes,{'tableName':_0x7e46('0x9'),'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 36ee2a0..9bc058b 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 _0xcbc5=['ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','code'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xcbc5,0x17a));var _0x5cbc=function(_0x1c5e2f,_0x372a8d){_0x1c5e2f=_0x1c5e2f-0x0;var _0x5defd1=_0xcbc5[_0x1c5e2f];return _0x5defd1;};'use strict';var _=require(_0x5cbc('0x0'));var util=require(_0x5cbc('0x1'));var moment=require(_0x5cbc('0x2'));var BPromise=require('bluebird');var rs=require(_0x5cbc('0x3'));var fs=require('fs');var Redis=require(_0x5cbc('0x4'));var db=require(_0x5cbc('0x5'))['db'];var utils=require(_0x5cbc('0x6'));var logger=require(_0x5cbc('0x7'))('rpc');var config=require(_0x5cbc('0x8'));var jayson=require(_0x5cbc('0x9'));var client=jayson[_0x5cbc('0xa')][_0x5cbc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42358e,_0x3c9de5,_0x58b015){return new BPromise(function(_0x14c31c,_0x44043e){return client[_0x5cbc('0xc')](_0x42358e,_0x58b015)['then'](function(_0x563dae){logger[_0x5cbc('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x3c9de5,_0x5cbc('0xe'));logger[_0x5cbc('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x3c9de5,_0x5cbc('0xe'),JSON['stringify'](_0x563dae));if(_0x563dae[_0x5cbc('0x10')]){if(_0x563dae['error'][_0x5cbc('0x11')]===0x1f4){logger[_0x5cbc('0x10')](_0x5cbc('0x12'),_0x3c9de5,_0x563dae[_0x5cbc('0x10')][_0x5cbc('0x13')]);return _0x44043e(_0x563dae[_0x5cbc('0x10')]['message']);}logger['error'](_0x5cbc('0x12'),_0x3c9de5,_0x563dae['error']['message']);return _0x14c31c(_0x563dae[_0x5cbc('0x10')][_0x5cbc('0x13')]);}else{logger[_0x5cbc('0xd')](_0x5cbc('0x12'),_0x3c9de5,_0x5cbc('0xe'));_0x14c31c(_0x563dae[_0x5cbc('0x14')][_0x5cbc('0x13')]);}})[_0x5cbc('0x15')](function(_0x1ca71a){logger[_0x5cbc('0x10')](_0x5cbc('0x12'),_0x3c9de5,_0x1ca71a);_0x44043e(_0x1ca71a);});});} \ No newline at end of file +var _0x0296=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3d7cbc,_0x12323d){var _0x3174c1=function(_0x210f29){while(--_0x210f29){_0x3d7cbc['push'](_0x3d7cbc['shift']());}};_0x3174c1(++_0x12323d);}(_0x0296,0x1ac));var _0x6029=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x0296[_0x2053ea];return _0x2232c4;};'use strict';var _=require(_0x6029('0x0'));var util=require(_0x6029('0x1'));var moment=require(_0x6029('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6029('0x3'));var db=require(_0x6029('0x4'))['db'];var utils=require(_0x6029('0x5'));var logger=require(_0x6029('0x6'))(_0x6029('0x7'));var config=require(_0x6029('0x8'));var jayson=require(_0x6029('0x9'));var client=jayson[_0x6029('0xa')][_0x6029('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e0660,_0x1e3e42,_0x1a3175){return new BPromise(function(_0x1373dd,_0x7e4066){return client['request'](_0x1e0660,_0x1a3175)[_0x6029('0xc')](function(_0x4e7170){logger[_0x6029('0xd')](_0x6029('0xe'),_0x1e3e42,_0x6029('0xf'));logger[_0x6029('0x10')](_0x6029('0x11'),_0x1e3e42,_0x6029('0xf'),JSON['stringify'](_0x4e7170));if(_0x4e7170['error']){if(_0x4e7170[_0x6029('0x12')]['code']===0x1f4){logger[_0x6029('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1e3e42,_0x4e7170[_0x6029('0x12')][_0x6029('0x13')]);return _0x7e4066(_0x4e7170[_0x6029('0x12')][_0x6029('0x13')]);}logger[_0x6029('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x1e3e42,_0x4e7170[_0x6029('0x12')][_0x6029('0x13')]);return _0x1373dd(_0x4e7170['error']['message']);}else{logger[_0x6029('0xd')](_0x6029('0xe'),_0x1e3e42,_0x6029('0xf'));_0x1373dd(_0x4e7170[_0x6029('0x14')][_0x6029('0x13')]);}})[_0x6029('0x15')](function(_0x1c4dc2){logger['error'](_0x6029('0xe'),_0x1e3e42,_0x1c4dc2);_0x7e4066(_0x1c4dc2);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 62df743..991e0ec 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 _0xda19=['post','create','update','destroy','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x43ea0a,_0x3cf89b){var _0x431572=function(_0x1f04e2){while(--_0x1f04e2){_0x43ea0a['push'](_0x43ea0a['shift']());}};_0x431572(++_0x3cf89b);}(_0xda19,0xd5));var _0x9da1=function(_0x2fdf99,_0x475724){_0x2fdf99=_0x2fdf99-0x0;var _0x2d401a=_0xda19[_0x2fdf99];return _0x2d401a;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth[_0x9da1('0x9')](),controller[_0x9da1('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xd')]);router['delete'](_0x9da1('0x8'),auth[_0x9da1('0x9')](),controller[_0x9da1('0xe')]);module[_0x9da1('0xf')]=router; \ No newline at end of file +var _0x8d0e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x252812,_0x7f2c5){_0x252812=_0x252812-0x0;var _0x39c536=_0x8d0e[_0x252812];return _0x39c536;};'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']('/:id',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xb')]);router[_0xe8d0('0xc')]('/',auth[_0xe8d0('0xa')](),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xe')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['update']);router[_0xe8d0('0x10')](_0xe8d0('0xf'),auth[_0xe8d0('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 5091cd1..eeb8cf8 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 _0x8174=['sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x8174,0x178));var _0x4817=function(_0x4d121d,_0x3fe733){_0x4d121d=_0x4d121d-0x0;var _0xffa031=_0x8174[_0x4d121d];return _0xffa031;};'use strict';var Sequelize=require(_0x4817('0x0'));module[_0x4817('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4817('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4817('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4817('0x4')](_0x4817('0x5'),_0x4817('0x6'),_0x4817('0x7'))}}; \ No newline at end of file +var _0xb42d=['beepall','roundrobin','sequelize','STRING','name','rrmemory'];(function(_0x1c413e,_0x51788b){var _0x1d8309=function(_0x335195){while(--_0x335195){_0x1c413e['push'](_0x1c413e['shift']());}};_0x1d8309(++_0x51788b);}(_0xb42d,0x1a6));var _0xdb42=function(_0x11018f,_0x5ac140){_0x11018f=_0x11018f-0x0;var _0x41093a=_0xb42d[_0x11018f];return _0x41093a;};'use strict';var Sequelize=require(_0xdb42('0x0'));module['exports']={'name':{'type':Sequelize[_0xdb42('0x1')],'unique':_0xdb42('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xdb42('0x3'),_0xdb42('0x4'),_0xdb42('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5e7d478..d020568 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 _0x9087=['./chatQueue.socket','register','sendStatus','status','json','offset','undefined','limit','Content-Range','then','destroy','get','ChatQueues','end','error','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','count','include','query','rows','show','params','keys','intersection','model','attributes','fields','length','options','find','catch','create','body','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','sort','pick','ChatQueueId','filter','merge','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','order','getTeams','Team','findAll','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','compact','value','ids','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','nolimit','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../mysqldb','defaults','redis','localhost'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x9087,0x159));var _0x7908=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9087[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x7908('0x0'));var util=require('util');var _=require(_0x7908('0x1'));var squel=require(_0x7908('0x2'));var Redis=require(_0x7908('0x3'));var qs=require(_0x7908('0x4'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x7908('0x5'))['db'];config['redis']=_[_0x7908('0x6')](config[_0x7908('0x7')],{'host':_0x7908('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7908('0x7')]));require(_0x7908('0x9'))[_0x7908('0xa')](socket);function respondWithStatusCode(_0x384c06,_0x2fe3fd){_0x2fe3fd=_0x2fe3fd||0xcc;return function(_0x4fc900){if(_0x4fc900){return _0x384c06[_0x7908('0xb')](_0x2fe3fd);}return _0x384c06[_0x7908('0xc')](_0x2fe3fd)['end']();};}function respondWithResult(_0x404c8b,_0x434500){_0x434500=_0x434500||0xc8;return function(_0x5131f6){if(_0x5131f6){return _0x404c8b['status'](_0x434500)[_0x7908('0xd')](_0x5131f6);}};}function respondWithFilteredResult(_0x155a43,_0x28e078){return function(_0xffa723){if(_0xffa723){var _0x1aac4a=typeof _0x28e078[_0x7908('0xe')]===_0x7908('0xf')&&typeof _0x28e078[_0x7908('0x10')]===_0x7908('0xf');var _0x1544dd=_0xffa723['count'];var _0x20a2d8=_0x1aac4a?0x0:_0x28e078['offset'];var _0xa36243=_0x1aac4a?_0xffa723['count']:_0x28e078[_0x7908('0xe')]+_0x28e078[_0x7908('0x10')];var _0x597dc0;if(_0xa36243>=_0x1544dd){_0xa36243=_0x1544dd;_0x597dc0=0xc8;}else{_0x597dc0=0xce;}_0x155a43['status'](_0x597dc0);return _0x155a43['set'](_0x7908('0x11'),_0x20a2d8+'-'+_0xa36243+'/'+_0x1544dd)[_0x7908('0xd')](_0xffa723);}return null;};}function saveUpdates(_0x555f81){return function(_0x45e2e0){if(_0x45e2e0){return _0x45e2e0['update'](_0x555f81)[_0x7908('0x12')](function(_0x27cb2f){return _0x27cb2f;});}return null;};}function removeEntity(_0x574c63){return function(_0x5aef66){if(_0x5aef66){return _0x5aef66[_0x7908('0x13')]()[_0x7908('0x12')](function(){var _0x50ef89=_0x5aef66[_0x7908('0x14')]({'plain':!![]});var _0x42c95b=_0x7908('0x15');return db['UserProfileResource'][_0x7908('0x13')]({'where':{'type':_0x42c95b,'resourceId':_0x50ef89['id']}})[_0x7908('0x12')](function(){return _0x5aef66;});})[_0x7908('0x12')](function(){_0x574c63[_0x7908('0xc')](0xcc)[_0x7908('0x16')]();});}};}function handleEntityNotFound(_0xfa003b){return function(_0x185d60){if(!_0x185d60){_0xfa003b['sendStatus'](0x194);}return _0x185d60;};}function handleError(_0x5c791c,_0x5a1d6d){_0x5a1d6d=_0x5a1d6d||0x1f4;return function(_0x127b79){logger[_0x7908('0x17')](_0x127b79[_0x7908('0x18')]);if(_0x127b79['name']){delete _0x127b79[_0x7908('0x19')];}_0x5c791c['status'](_0x5a1d6d)[_0x7908('0x1a')](_0x127b79);};}exports['index']=function(_0x28b717,_0x1232ef){var _0x4e18bb={};var _0x5813cb={'count':0x0,'rows':[]};var _0x1e7e40=_[_0x7908('0x1b')](db[_0x7908('0x1c')][_0x7908('0x1d')],function(_0x378a5c){return{'name':_0x378a5c[_0x7908('0x1e')],'type':_0x378a5c[_0x7908('0x1f')][_0x7908('0x20')]};});_0x4e18bb=qs[_0x7908('0x21')](_0x1e7e40,_0x28b717);var _0x1e6e36={'where':_0x4e18bb[_0x7908('0x22')]};return db[_0x7908('0x1c')][_0x7908('0x23')](_0x1e6e36)['then'](function(_0x1d92ba){_0x5813cb[_0x7908('0x23')]=_0x1d92ba;_0x4e18bb[_0x7908('0x24')]=qs[_0x7908('0x24')](_0x28b717[_0x7908('0x25')]);return db[_0x7908('0x1c')]['findAll'](_0x4e18bb);})['then'](function(_0x534918){_0x5813cb[_0x7908('0x26')]=_0x534918;return _0x5813cb;})[_0x7908('0x12')](respondWithFilteredResult(_0x1232ef,_0x4e18bb))['catch'](handleError(_0x1232ef,null));};exports[_0x7908('0x27')]=function(_0x4d5ef4,_0x44b863){var _0x1e6a1f={'raw':!![],'where':{'id':_0x4d5ef4[_0x7908('0x28')]['id']}},_0x3ccd06={};_0x3ccd06['model']=_[_0x7908('0x29')](db[_0x7908('0x1c')][_0x7908('0x1d')]);_0x3ccd06['query']=_[_0x7908('0x29')](_0x4d5ef4['query']);_0x3ccd06['filters']=_[_0x7908('0x2a')](_0x3ccd06[_0x7908('0x2b')],_0x3ccd06[_0x7908('0x25')]);_0x1e6a1f[_0x7908('0x2c')]=_[_0x7908('0x2a')](_0x3ccd06[_0x7908('0x2b')],qs[_0x7908('0x2d')](_0x4d5ef4[_0x7908('0x25')]['fields']));_0x1e6a1f[_0x7908('0x2c')]=_0x1e6a1f[_0x7908('0x2c')][_0x7908('0x2e')]?_0x1e6a1f['attributes']:_0x3ccd06[_0x7908('0x2b')];if(_0x4d5ef4['query']['includeAll']){_0x1e6a1f[_0x7908('0x24')]=[{'all':!![]}];}_0x1e6a1f=_['merge']({},_0x1e6a1f,_0x4d5ef4[_0x7908('0x2f')]);return db[_0x7908('0x1c')][_0x7908('0x30')](_0x1e6a1f)[_0x7908('0x12')](handleEntityNotFound(_0x44b863,null))[_0x7908('0x12')](respondWithResult(_0x44b863,null))[_0x7908('0x31')](handleError(_0x44b863,null));};exports[_0x7908('0x32')]=function(_0x527ed6,_0x1cfdc2){return db[_0x7908('0x1c')][_0x7908('0x32')](_0x527ed6[_0x7908('0x33')],{})['then'](function(_0x2ffb15){var _0xced164=_0x527ed6[_0x7908('0x34')][_0x7908('0x14')]({'plain':!![]});if(!_0xced164)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xced164['role']===_0x7908('0x34')){var _0xea05e2=_0x2ffb15[_0x7908('0x14')]({'plain':!![]});var _0x5e0fb5='ChatQueues';return db[_0x7908('0x35')][_0x7908('0x30')]({'where':{'name':_0x5e0fb5,'userProfileId':_0xced164[_0x7908('0x36')]},'raw':!![]})['then'](function(_0x2263cb){if(_0x2263cb&&_0x2263cb['autoAssociation']===0x0){return db[_0x7908('0x37')][_0x7908('0x32')]({'name':_0xea05e2[_0x7908('0x19')],'resourceId':_0xea05e2['id'],'type':_0x2263cb[_0x7908('0x19')],'sectionId':_0x2263cb['id']},{})['then'](function(){return _0x2ffb15;});}else{return _0x2ffb15;}})[_0x7908('0x31')](function(_0x9045f1){logger[_0x7908('0x17')](_0x7908('0x38'),_0x9045f1);throw _0x9045f1;});}return _0x2ffb15;})['then'](respondWithResult(_0x1cfdc2,0xc9))[_0x7908('0x31')](handleError(_0x1cfdc2,null));};exports['update']=function(_0x2b3499,_0x589ff2){if(_0x2b3499['body']['id']){delete _0x2b3499[_0x7908('0x33')]['id'];}return db[_0x7908('0x1c')][_0x7908('0x30')]({'where':{'id':_0x2b3499[_0x7908('0x28')]['id']}})[_0x7908('0x12')](handleEntityNotFound(_0x589ff2,null))[_0x7908('0x12')](saveUpdates(_0x2b3499[_0x7908('0x33')],null))['then'](respondWithResult(_0x589ff2,null))['catch'](handleError(_0x589ff2,null));};exports['destroy']=function(_0x40b796,_0x1ae58e){return db[_0x7908('0x1c')][_0x7908('0x30')]({'where':{'id':_0x40b796['params']['id']}})[_0x7908('0x12')](handleEntityNotFound(_0x1ae58e,null))[_0x7908('0x12')](removeEntity(_0x1ae58e,null))[_0x7908('0x31')](handleError(_0x1ae58e,null));};exports['describe']=function(_0x252321,_0x1c6c9d){return db[_0x7908('0x1c')]['describe']()[_0x7908('0x12')](respondWithResult(_0x1c6c9d,null))[_0x7908('0x31')](handleError(_0x1c6c9d,null));};exports[_0x7908('0x39')]=function(_0x3565bf,_0x18aa1f){var _0x14c52f={'raw':!![],'where':{}},_0x433d4c={},_0x24cd21;return db[_0x7908('0x1c')][_0x7908('0x3a')]({'where':{'id':_0x3565bf['params']['id']}})['then'](handleEntityNotFound(_0x18aa1f,null))['then'](function(_0x3812d7){if(_0x3812d7){_0x24cd21=_0x3812d7[_0x7908('0x14')]({'plain':!![]});_0x433d4c[_0x7908('0x2b')]=_[_0x7908('0x29')](db[_0x7908('0x3b')]['rawAttributes']);_0x433d4c[_0x7908('0x25')]=_[_0x7908('0x29')](_0x3565bf[_0x7908('0x25')]);_0x433d4c[_0x7908('0x3c')]=_[_0x7908('0x2a')](_0x433d4c[_0x7908('0x2b')],_0x433d4c['query']);_0x14c52f[_0x7908('0x2c')]=_['intersection'](_0x433d4c[_0x7908('0x2b')],qs['fields'](_0x3565bf[_0x7908('0x25')]['fields']));_0x14c52f[_0x7908('0x2c')]=_0x14c52f['attributes']['length']?_0x14c52f['attributes']:_0x433d4c['model'];if(!_0x3565bf[_0x7908('0x25')][_0x7908('0x3d')]('nolimit')){_0x14c52f[_0x7908('0x10')]=qs[_0x7908('0x10')](_0x3565bf[_0x7908('0x25')][_0x7908('0x10')]);_0x14c52f[_0x7908('0xe')]=qs['offset'](_0x3565bf[_0x7908('0x25')][_0x7908('0xe')]);}_0x14c52f['order']=qs['sort'](_0x3565bf[_0x7908('0x25')][_0x7908('0x3e')]);_0x14c52f[_0x7908('0x22')]=qs[_0x7908('0x3c')](_[_0x7908('0x3f')](_0x3565bf[_0x7908('0x25')],_0x433d4c[_0x7908('0x3c')]));_0x14c52f['where'][_0x7908('0x40')]=_0x3812d7['id'];if(_0x3565bf[_0x7908('0x25')][_0x7908('0x41')]){_0x14c52f[_0x7908('0x22')]=_[_0x7908('0x42')](_0x14c52f[_0x7908('0x22')],{'$or':_[_0x7908('0x1b')](_0x14c52f[_0x7908('0x2c')],function(_0x4fea9e){var _0x5687bb={};_0x5687bb[_0x4fea9e]={'$like':'%'+_0x3565bf[_0x7908('0x25')][_0x7908('0x41')]+'%'};return _0x5687bb;})});}_0x14c52f=_[_0x7908('0x42')]({},_0x14c52f,_0x3565bf[_0x7908('0x2f')]);return db[_0x7908('0x3b')]['findAll'](_0x14c52f);}})[_0x7908('0x12')](function(_0x574446){if(_0x574446){return db[_0x7908('0x43')][_0x7908('0x44')]({'where':{'id':_[_0x7908('0x1b')](_0x574446,_0x7908('0x45')),'role':_0x7908('0x46')},'attributes':['id',_0x7908('0x19'),_0x7908('0x47'),_0x7908('0x48'),_0x7908('0x49')]});}})[_0x7908('0x12')](function(_0x26b7dc){if(_0x26b7dc){return{'count':_0x26b7dc[_0x7908('0x23')],'rows':_[_0x7908('0x1b')](_0x26b7dc[_0x7908('0x26')],function(_0x4bc583){return{'membername':_0x4bc583[_0x7908('0x19')],'UserId':_0x4bc583['id'],'queue_name':_0x24cd21['name'],'ChatQueueId':_0x24cd21['id'],'interface':util[_0x7908('0x4a')](_0x7908('0x4b'),_0x7908('0x4c'),_0x4bc583[_0x7908('0x19')]),'penalty':0x0,'paused':_0x4bc583['chatPause'],'createdAt':_0x4bc583[_0x7908('0x49')],'updatedAt':_0x4bc583[_0x7908('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x18aa1f,_0x14c52f))['catch'](handleError(_0x18aa1f,null));};exports['getTeams']=function(_0x19d151,_0x39cf87){var _0x49a8f1={};var _0x43706b={};var _0x3ac521;var _0x272cad;return db[_0x7908('0x1c')][_0x7908('0x3a')]({'where':{'id':_0x19d151[_0x7908('0x28')]['id']}})['then'](handleEntityNotFound(_0x39cf87,null))['then'](function(_0x11e14a){if(_0x11e14a){_0x3ac521=_0x11e14a;_0x43706b[_0x7908('0x2b')]=_['keys'](db['Team'][_0x7908('0x1d')]);_0x43706b['query']=_['keys'](_0x19d151['query']);_0x43706b['filters']=_['intersection'](_0x43706b[_0x7908('0x2b')],_0x43706b[_0x7908('0x25')]);_0x49a8f1['attributes']=_['intersection'](_0x43706b['model'],qs[_0x7908('0x2d')](_0x19d151[_0x7908('0x25')][_0x7908('0x2d')]));_0x49a8f1['attributes']=_0x49a8f1[_0x7908('0x2c')][_0x7908('0x2e')]?_0x49a8f1[_0x7908('0x2c')]:_0x43706b['model'];_0x49a8f1[_0x7908('0x4d')]=qs[_0x7908('0x3e')](_0x19d151[_0x7908('0x25')]['sort']);_0x49a8f1['where']=qs[_0x7908('0x3c')](_['pick'](_0x19d151[_0x7908('0x25')],_0x43706b[_0x7908('0x3c')]));if(_0x19d151[_0x7908('0x25')][_0x7908('0x41')]){_0x49a8f1[_0x7908('0x22')]=_[_0x7908('0x42')](_0x49a8f1[_0x7908('0x22')],{'$or':_[_0x7908('0x1b')](_0x49a8f1[_0x7908('0x2c')],function(_0x429790){var _0x5ba9c5={};_0x5ba9c5[_0x429790]={'$like':'%'+_0x19d151['query']['filter']+'%'};return _0x5ba9c5;})});}_0x49a8f1=_['merge']({},_0x49a8f1,_0x19d151['options']);return _0x3ac521[_0x7908('0x4e')](_0x49a8f1);}})[_0x7908('0x12')](function(_0x559bb1){if(_0x559bb1){_0x272cad=_0x559bb1[_0x7908('0x2e')];if(!_0x19d151[_0x7908('0x25')][_0x7908('0x3d')]('nolimit')){_0x49a8f1[_0x7908('0x10')]=qs[_0x7908('0x10')](_0x19d151[_0x7908('0x25')][_0x7908('0x10')]);_0x49a8f1['offset']=qs[_0x7908('0xe')](_0x19d151[_0x7908('0x25')][_0x7908('0xe')]);}return _0x3ac521[_0x7908('0x4e')](_0x49a8f1);}})[_0x7908('0x12')](function(_0x52fbbc){if(_0x52fbbc){return _0x52fbbc?{'count':_0x272cad,'rows':_0x52fbbc}:null;}})[_0x7908('0x12')](respondWithResult(_0x39cf87,null))[_0x7908('0x31')](handleError(_0x39cf87,null));};exports['addTeams']=function(_0x22bafe,_0x3598b3){var _0x2678ec=_0x22bafe[_0x7908('0x33')]['ids'];return db[_0x7908('0x4f')][_0x7908('0x50')]({'where':{'id':_0x2678ec},'attributes':['id'],'include':[{'model':db[_0x7908('0x43')],'as':_0x7908('0x51'),'attributes':['id',_0x7908('0x19'),_0x7908('0x52'),'voicePause',_0x7908('0x53')],'raw':!![]}]})[_0x7908('0x12')](function(_0x2c56fd){if(_0x2c56fd){var _0x256ca4=_[_0x7908('0x54')](_0x2c56fd,function(_0x5337dd){var _0x37362e=_0x5337dd['get']({'plain':!![]});return _0x37362e[_0x7908('0x51')];});return db['ChatQueue'][_0x7908('0x30')]({'where':{'id':_0x22bafe[_0x7908('0x28')]['id']}})[_0x7908('0x12')](function(_0x18a520){return db[_0x7908('0x55')][_0x7908('0x56')](function(_0x240cf8){return _0x18a520[_0x7908('0x57')](_0x2678ec,{'transaction':_0x240cf8})[_0x7908('0x12')](function(){return BPromise[_0x7908('0x58')](_0x256ca4,function(_0x274e60){return db[_0x7908('0x3b')][_0x7908('0x59')]({'where':{'UserId':_0x274e60['id'],'ChatQueueId':_0x22bafe[_0x7908('0x28')]['id']},'transaction':_0x240cf8});});})['then'](function(){_0x256ca4[_0x7908('0x5a')](function(_0x560206){socket[_0x7908('0x5b')](_0x7908('0x5c'),{'UserId':_0x560206['id'],'ChatQueueId':_0x18a520['id']});});});});});}})[_0x7908('0x12')](respondWithStatusCode(_0x3598b3,null))[_0x7908('0x31')](handleError(_0x3598b3,null));};exports[_0x7908('0x5d')]=function(_0x3d5570,_0x46e4b8){return db[_0x7908('0x4f')][_0x7908('0x50')]({'where':{'id':_0x3d5570[_0x7908('0x25')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7908('0x51'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46e4b8,null))[_0x7908('0x12')](function(_0x5709c7){var _0x3183ff=_[_0x7908('0x1b')](_0x5709c7,'id');var _0x1ab04a=[];var _0x2e5953=[];var _0x34b2c2=squel[_0x7908('0x5e')]();_0x34b2c2[_0x7908('0x5f')]('tq.TeamId')[_0x7908('0x60')](_0x7908('0x61'),'tq')[_0x7908('0x62')](_0x7908('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7908('0x22')](_0x7908('0x64'),_0x3d5570[_0x7908('0x28')]['id']);for(var _0x482018=0x0;_0x482018<_0x5709c7['length'];_0x482018+=0x1){let _0x1aba06=_0x5709c7[_0x482018];for(var _0x329ff4=0x0;_0x329ff4<_0x1aba06[_0x7908('0x51')][_0x7908('0x2e')];_0x329ff4+=0x1){let _0x33109b=_0x1aba06[_0x7908('0x51')][_0x329ff4];var _0x483d33=_0x34b2c2['clone']();_0x483d33['where']('ut.UserId\x20=\x20?',_0x33109b['id']);_0x2e5953[_0x7908('0x65')](db['sequelize'][_0x7908('0x25')](_0x483d33[_0x7908('0x66')](),{'type':db[_0x7908('0x55')][_0x7908('0x67')][_0x7908('0x68')]})[_0x7908('0x12')](function(_0x252f79){if(_0x252f79[_0x7908('0x2e')]===0x1){return _0x33109b['id'];}else{var _0x25db1f=_[_0x7908('0x69')](_[_0x7908('0x1b')](_0x252f79,_0x7908('0x6a')),function(_0x25311c){return _[_0x7908('0x6b')](_0x3183ff,_0x25311c);});if(_0x25db1f){return _0x33109b['id'];}}}));}}return BPromise['all'](_0x2e5953)[_0x7908('0x12')](function(_0x251e72){_0x1ab04a=_(_0x1ab04a)['union'](_0x251e72)[_0x7908('0x6c')]()[_0x7908('0x6d')]();return db[_0x7908('0x1c')][_0x7908('0x30')]({'where':{'id':_0x3d5570[_0x7908('0x28')]['id']}})['then'](function(_0xe635b1){return db[_0x7908('0x55')][_0x7908('0x56')](function(_0x54f307){return _0xe635b1['removeTeams'](_0x3d5570['query'][_0x7908('0x6e')],{'transaction':_0x54f307})[_0x7908('0x12')](function(){if(!_['isEmpty'](_0x1ab04a)){return _0xe635b1['removeAgents'](_0x1ab04a,{'transaction':_0x54f307});}})[_0x7908('0x12')](function(){_0x1ab04a[_0x7908('0x5a')](function(_0x397fe4){socket[_0x7908('0x5b')](_0x7908('0x6f'),{'UserId':_0x397fe4,'ChatQueueId':_0xe635b1['id']});});});});});});})[_0x7908('0x12')](respondWithStatusCode(_0x46e4b8,null))[_0x7908('0x31')](handleError(_0x46e4b8,null));};exports[_0x7908('0x70')]=function(_0x3355b7,_0xf57858){return db[_0x7908('0x1c')][_0x7908('0x30')]({'where':{'id':_0x3355b7[_0x7908('0x28')]['id']}})[_0x7908('0x12')](handleEntityNotFound(_0xf57858,null))['then'](function(_0x581dc3){if(_0x581dc3){return _0x581dc3['addAgents'](_0x3355b7[_0x7908('0x33')][_0x7908('0x6e')],_[_0x7908('0x71')](_0x3355b7[_0x7908('0x33')],[_0x7908('0x6e'),'id'])||{})['spread'](function(_0x1dda02){for(var _0x4c30ca=0x0;_0x4c30ca<_0x3355b7[_0x7908('0x33')][_0x7908('0x6e')]['length'];_0x4c30ca+=0x1){socket[_0x7908('0x5b')]('userChatQueue:save',{'UserId':Number(_0x3355b7[_0x7908('0x33')][_0x7908('0x6e')][_0x4c30ca]),'ChatQueueId':Number(_0x3355b7[_0x7908('0x28')]['id'])});}return _0x1dda02;});}})[_0x7908('0x12')](respondWithResult(_0xf57858,null))['catch'](handleError(_0xf57858,null));};exports[_0x7908('0x72')]=function(_0x3fdd89,_0x1cde2c){return db['ChatQueue'][_0x7908('0x30')]({'where':{'id':_0x3fdd89[_0x7908('0x28')]['id']}})[_0x7908('0x12')](handleEntityNotFound(_0x1cde2c,null))['then'](function(_0x4a9747){if(_0x4a9747){return _0x4a9747[_0x7908('0x72')](_0x3fdd89[_0x7908('0x25')][_0x7908('0x6e')])[_0x7908('0x12')](function(){if(_[_0x7908('0x73')](_0x3fdd89['query'][_0x7908('0x6e')])){for(var _0x4f073d=0x0;_0x4f073d<_0x3fdd89[_0x7908('0x25')][_0x7908('0x6e')][_0x7908('0x2e')];_0x4f073d+=0x1){socket['emit'](_0x7908('0x6f'),{'UserId':Number(_0x3fdd89[_0x7908('0x25')][_0x7908('0x6e')][_0x4f073d]),'ChatQueueId':Number(_0x3fdd89[_0x7908('0x28')]['id'])});}}else{socket[_0x7908('0x5b')](_0x7908('0x6f'),{'UserId':Number(_0x3fdd89[_0x7908('0x25')][_0x7908('0x6e')]),'ChatQueueId':Number(_0x3fdd89[_0x7908('0x28')]['id'])});}});}})[_0x7908('0x12')](respondWithStatusCode(_0x1cde2c,null))[_0x7908('0x31')](handleError(_0x1cde2c,null));};exports[_0x7908('0x74')]=function(_0x249d47,_0x498b90){var _0x1979bc={};var _0x283122={};var _0x4d564d;var _0x41f818;return db[_0x7908('0x1c')]['findOne']({'where':{'id':_0x249d47[_0x7908('0x28')]['id']}})[_0x7908('0x12')](handleEntityNotFound(_0x498b90,null))['then'](function(_0x5ba359){if(_0x5ba359){_0x4d564d=_0x5ba359;_0x283122['model']=_[_0x7908('0x29')](db[_0x7908('0x43')][_0x7908('0x1d')]);_0x283122[_0x7908('0x25')]=_[_0x7908('0x29')](_0x249d47[_0x7908('0x25')]);_0x283122[_0x7908('0x3c')]=_[_0x7908('0x2a')](_0x283122[_0x7908('0x2b')],_0x283122[_0x7908('0x25')]);_0x1979bc[_0x7908('0x2c')]=_[_0x7908('0x2a')](_0x283122[_0x7908('0x2b')],qs[_0x7908('0x2d')](_0x249d47[_0x7908('0x25')][_0x7908('0x2d')]));_0x1979bc[_0x7908('0x2c')]=_0x1979bc['attributes']['length']?_0x1979bc[_0x7908('0x2c')]:_0x283122[_0x7908('0x2b')];_0x1979bc[_0x7908('0x4d')]=qs['sort'](_0x249d47['query']['sort']);_0x1979bc[_0x7908('0x22')]=qs[_0x7908('0x3c')](_[_0x7908('0x3f')](_0x249d47['query'],_0x283122[_0x7908('0x3c')]));if(_0x249d47['query'][_0x7908('0x41')]){_0x1979bc[_0x7908('0x22')]=_[_0x7908('0x42')](_0x1979bc[_0x7908('0x22')],{'$or':_['map'](_0x1979bc['attributes'],function(_0x536aed){var _0x20d629={};_0x20d629[_0x536aed]={'$like':'%'+_0x249d47[_0x7908('0x25')]['filter']+'%'};return _0x20d629;})});}_0x1979bc=_[_0x7908('0x42')]({},_0x1979bc,_0x249d47[_0x7908('0x2f')]);return _0x4d564d['getAgents'](_0x1979bc);}})[_0x7908('0x12')](function(_0x38ad70){if(_0x38ad70){_0x41f818=_0x38ad70[_0x7908('0x2e')];if(!_0x249d47['query']['hasOwnProperty'](_0x7908('0x75'))){_0x1979bc['limit']=qs[_0x7908('0x10')](_0x249d47[_0x7908('0x25')][_0x7908('0x10')]);_0x1979bc['offset']=qs[_0x7908('0xe')](_0x249d47['query'][_0x7908('0xe')]);}return _0x4d564d['getAgents'](_0x1979bc);}})['then'](function(_0x550800){if(_0x550800){return _0x550800?{'count':_0x41f818,'rows':_0x550800}:null;}})[_0x7908('0x12')](respondWithResult(_0x498b90,null))[_0x7908('0x31')](handleError(_0x498b90,null));}; \ No newline at end of file +var _0xc2c5=['addTeams','ids','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','every','TeamId','all','compact','value','isEmpty','forEach','userChatQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','./chatQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','destroy','get','ChatQueues','UserProfileResource','then','error','stack','name','index','ChatQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','model','keys','intersection','fields','attributes','length','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','describe','getMembers','findOne','UserChatQueue','filters','hasOwnProperty','nolimit','order','sort','pick','ChatQueueId','filter','merge','map','User','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team'];(function(_0x31a180,_0x3924b9){var _0x4b0502=function(_0x2e9ad6){while(--_0x2e9ad6){_0x31a180['push'](_0x31a180['shift']());}};_0x4b0502(++_0x3924b9);}(_0xc2c5,0x192));var _0x5c2c=function(_0xf1b354,_0x32048c){_0xf1b354=_0xf1b354-0x0;var _0x405d3a=_0xc2c5[_0xf1b354];return _0x405d3a;};'use strict';var BPromise=require('bluebird');var util=require(_0x5c2c('0x0'));var _=require(_0x5c2c('0x1'));var squel=require(_0x5c2c('0x2'));var Redis=require('ioredis');var qs=require(_0x5c2c('0x3'));var logger=require(_0x5c2c('0x4'))(_0x5c2c('0x5'));var config=require(_0x5c2c('0x6'));var db=require('../../mysqldb')['db'];config[_0x5c2c('0x7')]=_['defaults'](config[_0x5c2c('0x7')],{'host':_0x5c2c('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c2c('0x7')]));require(_0x5c2c('0x9'))['register'](socket);function respondWithStatusCode(_0x405ddf,_0x307463){_0x307463=_0x307463||0xcc;return function(_0x47af36){if(_0x47af36){return _0x405ddf[_0x5c2c('0xa')](_0x307463);}return _0x405ddf['status'](_0x307463)[_0x5c2c('0xb')]();};}function respondWithResult(_0x1eb216,_0x52e96a){_0x52e96a=_0x52e96a||0xc8;return function(_0x394124){if(_0x394124){return _0x1eb216[_0x5c2c('0xc')](_0x52e96a)[_0x5c2c('0xd')](_0x394124);}};}function respondWithFilteredResult(_0x575b56,_0x4dfe31){return function(_0x29a021){if(_0x29a021){var _0x2cb466=typeof _0x4dfe31[_0x5c2c('0xe')]===_0x5c2c('0xf')&&typeof _0x4dfe31[_0x5c2c('0x10')]===_0x5c2c('0xf');var _0x50f26b=_0x29a021[_0x5c2c('0x11')];var _0x3449a5=_0x2cb466?0x0:_0x4dfe31[_0x5c2c('0xe')];var _0x4c2a61=_0x2cb466?_0x29a021['count']:_0x4dfe31[_0x5c2c('0xe')]+_0x4dfe31[_0x5c2c('0x10')];var _0x1f2952;if(_0x4c2a61>=_0x50f26b){_0x4c2a61=_0x50f26b;_0x1f2952=0xc8;}else{_0x1f2952=0xce;}_0x575b56[_0x5c2c('0xc')](_0x1f2952);return _0x575b56[_0x5c2c('0x12')](_0x5c2c('0x13'),_0x3449a5+'-'+_0x4c2a61+'/'+_0x50f26b)['json'](_0x29a021);}return null;};}function saveUpdates(_0x5f6439){return function(_0x342634){if(_0x342634){return _0x342634['update'](_0x5f6439)['then'](function(_0x2e2488){return _0x2e2488;});}return null;};}function removeEntity(_0x51f619){return function(_0xc0188a){if(_0xc0188a){return _0xc0188a[_0x5c2c('0x14')]()['then'](function(){var _0x43ccce=_0xc0188a[_0x5c2c('0x15')]({'plain':!![]});var _0x5d1852=_0x5c2c('0x16');return db[_0x5c2c('0x17')]['destroy']({'where':{'type':_0x5d1852,'resourceId':_0x43ccce['id']}})['then'](function(){return _0xc0188a;});})[_0x5c2c('0x18')](function(){_0x51f619[_0x5c2c('0xc')](0xcc)[_0x5c2c('0xb')]();});}};}function handleEntityNotFound(_0x17d96c){return function(_0x559386){if(!_0x559386){_0x17d96c[_0x5c2c('0xa')](0x194);}return _0x559386;};}function handleError(_0x2a7252,_0x436a39){_0x436a39=_0x436a39||0x1f4;return function(_0xb454){logger[_0x5c2c('0x19')](_0xb454[_0x5c2c('0x1a')]);if(_0xb454['name']){delete _0xb454[_0x5c2c('0x1b')];}_0x2a7252[_0x5c2c('0xc')](_0x436a39)['send'](_0xb454);};}exports[_0x5c2c('0x1c')]=function(_0x43b56d,_0x4f456b){var _0x3a2766={};var _0x2e43fc={'count':0x0,'rows':[]};var _0x54245e=_['map'](db[_0x5c2c('0x1d')][_0x5c2c('0x1e')],function(_0x46b9db){return{'name':_0x46b9db[_0x5c2c('0x1f')],'type':_0x46b9db[_0x5c2c('0x20')][_0x5c2c('0x21')]};});_0x3a2766=qs[_0x5c2c('0x22')](_0x54245e,_0x43b56d);var _0x6d1ea0={'where':_0x3a2766[_0x5c2c('0x23')]};return db[_0x5c2c('0x1d')][_0x5c2c('0x11')](_0x6d1ea0)[_0x5c2c('0x18')](function(_0x4f3da8){_0x2e43fc['count']=_0x4f3da8;_0x3a2766[_0x5c2c('0x24')]=qs[_0x5c2c('0x24')](_0x43b56d[_0x5c2c('0x25')]);return db['ChatQueue'][_0x5c2c('0x26')](_0x3a2766);})[_0x5c2c('0x18')](function(_0x500680){_0x2e43fc[_0x5c2c('0x27')]=_0x500680;return _0x2e43fc;})[_0x5c2c('0x18')](respondWithFilteredResult(_0x4f456b,_0x3a2766))[_0x5c2c('0x28')](handleError(_0x4f456b,null));};exports[_0x5c2c('0x29')]=function(_0x5f0faa,_0x58b4c5){var _0x31cc1a={'raw':!![],'where':{'id':_0x5f0faa[_0x5c2c('0x2a')]['id']}},_0x406591={};_0x406591[_0x5c2c('0x2b')]=_['keys'](db['ChatQueue']['rawAttributes']);_0x406591[_0x5c2c('0x25')]=_[_0x5c2c('0x2c')](_0x5f0faa[_0x5c2c('0x25')]);_0x406591['filters']=_[_0x5c2c('0x2d')](_0x406591[_0x5c2c('0x2b')],_0x406591[_0x5c2c('0x25')]);_0x31cc1a['attributes']=_['intersection'](_0x406591['model'],qs['fields'](_0x5f0faa[_0x5c2c('0x25')][_0x5c2c('0x2e')]));_0x31cc1a[_0x5c2c('0x2f')]=_0x31cc1a[_0x5c2c('0x2f')][_0x5c2c('0x30')]?_0x31cc1a[_0x5c2c('0x2f')]:_0x406591[_0x5c2c('0x2b')];if(_0x5f0faa[_0x5c2c('0x25')][_0x5c2c('0x31')]){_0x31cc1a['include']=[{'all':!![]}];}_0x31cc1a=_['merge']({},_0x31cc1a,_0x5f0faa[_0x5c2c('0x32')]);return db[_0x5c2c('0x1d')]['find'](_0x31cc1a)['then'](handleEntityNotFound(_0x58b4c5,null))[_0x5c2c('0x18')](respondWithResult(_0x58b4c5,null))[_0x5c2c('0x28')](handleError(_0x58b4c5,null));};exports['create']=function(_0x19aa80,_0x1837d6){return db[_0x5c2c('0x1d')][_0x5c2c('0x33')](_0x19aa80['body'],{})[_0x5c2c('0x18')](function(_0x18a971){var _0x754ae7=_0x19aa80[_0x5c2c('0x34')][_0x5c2c('0x15')]({'plain':!![]});if(!_0x754ae7)throw new Error(_0x5c2c('0x35'));if(_0x754ae7[_0x5c2c('0x36')]===_0x5c2c('0x34')){var _0x281655=_0x18a971[_0x5c2c('0x15')]({'plain':!![]});var _0x3676df='ChatQueues';return db[_0x5c2c('0x37')]['find']({'where':{'name':_0x3676df,'userProfileId':_0x754ae7[_0x5c2c('0x38')]},'raw':!![]})[_0x5c2c('0x18')](function(_0x1fd38f){if(_0x1fd38f&&_0x1fd38f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5c2c('0x33')]({'name':_0x281655['name'],'resourceId':_0x281655['id'],'type':_0x1fd38f['name'],'sectionId':_0x1fd38f['id']},{})[_0x5c2c('0x18')](function(){return _0x18a971;});}else{return _0x18a971;}})[_0x5c2c('0x28')](function(_0x102bc8){logger['error'](_0x5c2c('0x39'),_0x102bc8);throw _0x102bc8;});}return _0x18a971;})['then'](respondWithResult(_0x1837d6,0xc9))[_0x5c2c('0x28')](handleError(_0x1837d6,null));};exports[_0x5c2c('0x3a')]=function(_0x46ed6a,_0x11cdd3){if(_0x46ed6a[_0x5c2c('0x3b')]['id']){delete _0x46ed6a[_0x5c2c('0x3b')]['id'];}return db[_0x5c2c('0x1d')][_0x5c2c('0x3c')]({'where':{'id':_0x46ed6a['params']['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x11cdd3,null))[_0x5c2c('0x18')](saveUpdates(_0x46ed6a[_0x5c2c('0x3b')],null))[_0x5c2c('0x18')](respondWithResult(_0x11cdd3,null))[_0x5c2c('0x28')](handleError(_0x11cdd3,null));};exports[_0x5c2c('0x14')]=function(_0x1a2c8a,_0x2607f1){return db[_0x5c2c('0x1d')]['find']({'where':{'id':_0x1a2c8a[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x2607f1,null))[_0x5c2c('0x18')](removeEntity(_0x2607f1,null))[_0x5c2c('0x28')](handleError(_0x2607f1,null));};exports[_0x5c2c('0x3d')]=function(_0x20a72a,_0x1c892d){return db['ChatQueue'][_0x5c2c('0x3d')]()[_0x5c2c('0x18')](respondWithResult(_0x1c892d,null))['catch'](handleError(_0x1c892d,null));};exports[_0x5c2c('0x3e')]=function(_0x4752a0,_0x1b8bf9){var _0x31d9cc={'raw':!![],'where':{}},_0x83034={},_0x462eeb;return db[_0x5c2c('0x1d')][_0x5c2c('0x3f')]({'where':{'id':_0x4752a0['params']['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x1b8bf9,null))[_0x5c2c('0x18')](function(_0x19de18){if(_0x19de18){_0x462eeb=_0x19de18[_0x5c2c('0x15')]({'plain':!![]});_0x83034[_0x5c2c('0x2b')]=_[_0x5c2c('0x2c')](db[_0x5c2c('0x40')]['rawAttributes']);_0x83034[_0x5c2c('0x25')]=_['keys'](_0x4752a0[_0x5c2c('0x25')]);_0x83034[_0x5c2c('0x41')]=_[_0x5c2c('0x2d')](_0x83034['model'],_0x83034[_0x5c2c('0x25')]);_0x31d9cc[_0x5c2c('0x2f')]=_[_0x5c2c('0x2d')](_0x83034[_0x5c2c('0x2b')],qs[_0x5c2c('0x2e')](_0x4752a0[_0x5c2c('0x25')][_0x5c2c('0x2e')]));_0x31d9cc[_0x5c2c('0x2f')]=_0x31d9cc['attributes'][_0x5c2c('0x30')]?_0x31d9cc['attributes']:_0x83034[_0x5c2c('0x2b')];if(!_0x4752a0['query'][_0x5c2c('0x42')](_0x5c2c('0x43'))){_0x31d9cc['limit']=qs[_0x5c2c('0x10')](_0x4752a0[_0x5c2c('0x25')]['limit']);_0x31d9cc[_0x5c2c('0xe')]=qs[_0x5c2c('0xe')](_0x4752a0[_0x5c2c('0x25')][_0x5c2c('0xe')]);}_0x31d9cc[_0x5c2c('0x44')]=qs[_0x5c2c('0x45')](_0x4752a0[_0x5c2c('0x25')][_0x5c2c('0x45')]);_0x31d9cc[_0x5c2c('0x23')]=qs['filters'](_[_0x5c2c('0x46')](_0x4752a0[_0x5c2c('0x25')],_0x83034['filters']));_0x31d9cc[_0x5c2c('0x23')][_0x5c2c('0x47')]=_0x19de18['id'];if(_0x4752a0[_0x5c2c('0x25')][_0x5c2c('0x48')]){_0x31d9cc['where']=_[_0x5c2c('0x49')](_0x31d9cc['where'],{'$or':_[_0x5c2c('0x4a')](_0x31d9cc[_0x5c2c('0x2f')],function(_0xb5ca90){var _0x161966={};_0x161966[_0xb5ca90]={'$like':'%'+_0x4752a0[_0x5c2c('0x25')]['filter']+'%'};return _0x161966;})});}_0x31d9cc=_[_0x5c2c('0x49')]({},_0x31d9cc,_0x4752a0[_0x5c2c('0x32')]);return db[_0x5c2c('0x40')][_0x5c2c('0x26')](_0x31d9cc);}})[_0x5c2c('0x18')](function(_0x29b5f0){if(_0x29b5f0){return db[_0x5c2c('0x4b')][_0x5c2c('0x4c')]({'where':{'id':_[_0x5c2c('0x4a')](_0x29b5f0,'UserId'),'role':_0x5c2c('0x4d')},'attributes':['id',_0x5c2c('0x1b'),_0x5c2c('0x4e'),_0x5c2c('0x4f'),_0x5c2c('0x50')]});}})[_0x5c2c('0x18')](function(_0x4c1e7f){if(_0x4c1e7f){return{'count':_0x4c1e7f[_0x5c2c('0x11')],'rows':_[_0x5c2c('0x4a')](_0x4c1e7f['rows'],function(_0x5593a6){return{'membername':_0x5593a6['name'],'UserId':_0x5593a6['id'],'queue_name':_0x462eeb[_0x5c2c('0x1b')],'ChatQueueId':_0x462eeb['id'],'interface':util[_0x5c2c('0x51')](_0x5c2c('0x52'),_0x5c2c('0x53'),_0x5593a6[_0x5c2c('0x1b')]),'penalty':0x0,'paused':_0x5593a6[_0x5c2c('0x4e')],'createdAt':_0x5593a6['createdAt'],'updatedAt':_0x5593a6[_0x5c2c('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b8bf9,_0x31d9cc))[_0x5c2c('0x28')](handleError(_0x1b8bf9,null));};exports[_0x5c2c('0x54')]=function(_0xada92b,_0xe03802){var _0x1ff1e8={};var _0x551eb0={};var _0x3cdc21;var _0x4a5418;return db['ChatQueue'][_0x5c2c('0x3f')]({'where':{'id':_0xada92b[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0xe03802,null))['then'](function(_0x3d2316){if(_0x3d2316){_0x3cdc21=_0x3d2316;_0x551eb0[_0x5c2c('0x2b')]=_[_0x5c2c('0x2c')](db[_0x5c2c('0x55')][_0x5c2c('0x1e')]);_0x551eb0[_0x5c2c('0x25')]=_[_0x5c2c('0x2c')](_0xada92b[_0x5c2c('0x25')]);_0x551eb0[_0x5c2c('0x41')]=_[_0x5c2c('0x2d')](_0x551eb0[_0x5c2c('0x2b')],_0x551eb0['query']);_0x1ff1e8['attributes']=_[_0x5c2c('0x2d')](_0x551eb0[_0x5c2c('0x2b')],qs['fields'](_0xada92b[_0x5c2c('0x25')][_0x5c2c('0x2e')]));_0x1ff1e8[_0x5c2c('0x2f')]=_0x1ff1e8['attributes'][_0x5c2c('0x30')]?_0x1ff1e8[_0x5c2c('0x2f')]:_0x551eb0[_0x5c2c('0x2b')];_0x1ff1e8[_0x5c2c('0x44')]=qs[_0x5c2c('0x45')](_0xada92b[_0x5c2c('0x25')]['sort']);_0x1ff1e8[_0x5c2c('0x23')]=qs[_0x5c2c('0x41')](_[_0x5c2c('0x46')](_0xada92b['query'],_0x551eb0['filters']));if(_0xada92b['query']['filter']){_0x1ff1e8[_0x5c2c('0x23')]=_[_0x5c2c('0x49')](_0x1ff1e8[_0x5c2c('0x23')],{'$or':_[_0x5c2c('0x4a')](_0x1ff1e8[_0x5c2c('0x2f')],function(_0x59da8c){var _0x3eec8a={};_0x3eec8a[_0x59da8c]={'$like':'%'+_0xada92b[_0x5c2c('0x25')]['filter']+'%'};return _0x3eec8a;})});}_0x1ff1e8=_[_0x5c2c('0x49')]({},_0x1ff1e8,_0xada92b[_0x5c2c('0x32')]);return _0x3cdc21[_0x5c2c('0x54')](_0x1ff1e8);}})[_0x5c2c('0x18')](function(_0x2b381d){if(_0x2b381d){_0x4a5418=_0x2b381d[_0x5c2c('0x30')];if(!_0xada92b[_0x5c2c('0x25')][_0x5c2c('0x42')]('nolimit')){_0x1ff1e8['limit']=qs['limit'](_0xada92b[_0x5c2c('0x25')][_0x5c2c('0x10')]);_0x1ff1e8[_0x5c2c('0xe')]=qs[_0x5c2c('0xe')](_0xada92b[_0x5c2c('0x25')][_0x5c2c('0xe')]);}return _0x3cdc21[_0x5c2c('0x54')](_0x1ff1e8);}})['then'](function(_0x4ab9e1){if(_0x4ab9e1){return _0x4ab9e1?{'count':_0x4a5418,'rows':_0x4ab9e1}:null;}})[_0x5c2c('0x18')](respondWithResult(_0xe03802,null))[_0x5c2c('0x28')](handleError(_0xe03802,null));};exports[_0x5c2c('0x56')]=function(_0x472a7b,_0x3f3ef9){var _0x120295=_0x472a7b['body'][_0x5c2c('0x57')];return db[_0x5c2c('0x55')][_0x5c2c('0x26')]({'where':{'id':_0x120295},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x5c2c('0x58'),_0x5c2c('0x59'),'interface'],'raw':!![]}]})['then'](function(_0x4d0f5a){if(_0x4d0f5a){var _0x438959=_[_0x5c2c('0x5a')](_0x4d0f5a,function(_0x4e7563){var _0x29ea9a=_0x4e7563[_0x5c2c('0x15')]({'plain':!![]});return _0x29ea9a[_0x5c2c('0x5b')];});return db[_0x5c2c('0x1d')][_0x5c2c('0x3c')]({'where':{'id':_0x472a7b[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](function(_0x20cd09){return db[_0x5c2c('0x5c')][_0x5c2c('0x5d')](function(_0x2c7ddb){return _0x20cd09[_0x5c2c('0x56')](_0x120295,{'transaction':_0x2c7ddb})[_0x5c2c('0x18')](function(){return BPromise[_0x5c2c('0x5e')](_0x438959,function(_0x2a91d7){return db[_0x5c2c('0x40')][_0x5c2c('0x5f')]({'where':{'UserId':_0x2a91d7['id'],'ChatQueueId':_0x472a7b[_0x5c2c('0x2a')]['id']},'transaction':_0x2c7ddb});});})[_0x5c2c('0x18')](function(){_0x438959['forEach'](function(_0x121b93){socket[_0x5c2c('0x60')](_0x5c2c('0x61'),{'UserId':_0x121b93['id'],'ChatQueueId':_0x20cd09['id']});});});});});}})[_0x5c2c('0x18')](respondWithStatusCode(_0x3f3ef9,null))[_0x5c2c('0x28')](handleError(_0x3f3ef9,null));};exports[_0x5c2c('0x62')]=function(_0x420716,_0x320f83){return db[_0x5c2c('0x55')]['findAll']({'where':{'id':_0x420716['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x320f83,null))['then'](function(_0x138f5c){var _0x58c200=_['map'](_0x138f5c,'id');var _0x15a47e=[];var _0x13664a=[];var _0x47edf2=squel[_0x5c2c('0x63')]();_0x47edf2['field'](_0x5c2c('0x64'))[_0x5c2c('0x65')]('team_has_chat_queues','tq')[_0x5c2c('0x66')](_0x5c2c('0x67'),'ut',_0x5c2c('0x68'))['where']('ChatQueueId\x20=\x20?',_0x420716['params']['id']);for(var _0xe353f2=0x0;_0xe353f2<_0x138f5c[_0x5c2c('0x30')];_0xe353f2+=0x1){let _0x319084=_0x138f5c[_0xe353f2];for(var _0x46b814=0x0;_0x46b814<_0x319084[_0x5c2c('0x5b')][_0x5c2c('0x30')];_0x46b814+=0x1){let _0x10bbbd=_0x319084['Agents'][_0x46b814];var _0x5daec6=_0x47edf2[_0x5c2c('0x69')]();_0x5daec6[_0x5c2c('0x23')]('ut.UserId\x20=\x20?',_0x10bbbd['id']);_0x13664a[_0x5c2c('0x6a')](db['sequelize'][_0x5c2c('0x25')](_0x5daec6[_0x5c2c('0x6b')](),{'type':db['sequelize'][_0x5c2c('0x6c')]['SELECT']})[_0x5c2c('0x18')](function(_0x5d569d){if(_0x5d569d['length']===0x1){return _0x10bbbd['id'];}else{var _0x5edcac=_[_0x5c2c('0x6d')](_[_0x5c2c('0x4a')](_0x5d569d,_0x5c2c('0x6e')),function(_0x42a2f5){return _['includes'](_0x58c200,_0x42a2f5);});if(_0x5edcac){return _0x10bbbd['id'];}}}));}}return BPromise[_0x5c2c('0x6f')](_0x13664a)[_0x5c2c('0x18')](function(_0x11e621){_0x15a47e=_(_0x15a47e)['union'](_0x11e621)[_0x5c2c('0x70')]()[_0x5c2c('0x71')]();return db[_0x5c2c('0x1d')][_0x5c2c('0x3c')]({'where':{'id':_0x420716[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](function(_0x251b59){return db['sequelize'][_0x5c2c('0x5d')](function(_0x41cd32){return _0x251b59[_0x5c2c('0x62')](_0x420716[_0x5c2c('0x25')][_0x5c2c('0x57')],{'transaction':_0x41cd32})['then'](function(){if(!_[_0x5c2c('0x72')](_0x15a47e)){return _0x251b59['removeAgents'](_0x15a47e,{'transaction':_0x41cd32});}})[_0x5c2c('0x18')](function(){_0x15a47e[_0x5c2c('0x73')](function(_0x57ded2){socket[_0x5c2c('0x60')](_0x5c2c('0x74'),{'UserId':_0x57ded2,'ChatQueueId':_0x251b59['id']});});});});});});})[_0x5c2c('0x18')](respondWithStatusCode(_0x320f83,null))[_0x5c2c('0x28')](handleError(_0x320f83,null));};exports['addAgents']=function(_0x5d2333,_0x4d82a4){return db[_0x5c2c('0x1d')][_0x5c2c('0x3c')]({'where':{'id':_0x5d2333[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x4d82a4,null))[_0x5c2c('0x18')](function(_0x77b252){if(_0x77b252){return _0x77b252[_0x5c2c('0x75')](_0x5d2333[_0x5c2c('0x3b')][_0x5c2c('0x57')],_[_0x5c2c('0x76')](_0x5d2333[_0x5c2c('0x3b')],[_0x5c2c('0x57'),'id'])||{})['spread'](function(_0x3168e1){for(var _0x1b428f=0x0;_0x1b428f<_0x5d2333[_0x5c2c('0x3b')][_0x5c2c('0x57')][_0x5c2c('0x30')];_0x1b428f+=0x1){socket[_0x5c2c('0x60')]('userChatQueue:save',{'UserId':Number(_0x5d2333[_0x5c2c('0x3b')][_0x5c2c('0x57')][_0x1b428f]),'ChatQueueId':Number(_0x5d2333['params']['id'])});}return _0x3168e1;});}})[_0x5c2c('0x18')](respondWithResult(_0x4d82a4,null))[_0x5c2c('0x28')](handleError(_0x4d82a4,null));};exports[_0x5c2c('0x77')]=function(_0x398dee,_0x1ac9d7){return db[_0x5c2c('0x1d')][_0x5c2c('0x3c')]({'where':{'id':_0x398dee[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x1ac9d7,null))[_0x5c2c('0x18')](function(_0x867e42){if(_0x867e42){return _0x867e42[_0x5c2c('0x77')](_0x398dee[_0x5c2c('0x25')][_0x5c2c('0x57')])[_0x5c2c('0x18')](function(){if(_[_0x5c2c('0x78')](_0x398dee['query'][_0x5c2c('0x57')])){for(var _0x3f9d6c=0x0;_0x3f9d6c<_0x398dee[_0x5c2c('0x25')]['ids']['length'];_0x3f9d6c+=0x1){socket[_0x5c2c('0x60')]('userChatQueue:remove',{'UserId':Number(_0x398dee[_0x5c2c('0x25')][_0x5c2c('0x57')][_0x3f9d6c]),'ChatQueueId':Number(_0x398dee[_0x5c2c('0x2a')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x398dee[_0x5c2c('0x25')]['ids']),'ChatQueueId':Number(_0x398dee[_0x5c2c('0x2a')]['id'])});}});}})[_0x5c2c('0x18')](respondWithStatusCode(_0x1ac9d7,null))[_0x5c2c('0x28')](handleError(_0x1ac9d7,null));};exports[_0x5c2c('0x79')]=function(_0x303e5b,_0x11867c){var _0x1e3ed4={};var _0x7b6b6e={};var _0x59f15d;var _0x1a6e1c;return db[_0x5c2c('0x1d')][_0x5c2c('0x3f')]({'where':{'id':_0x303e5b[_0x5c2c('0x2a')]['id']}})[_0x5c2c('0x18')](handleEntityNotFound(_0x11867c,null))['then'](function(_0x2020e1){if(_0x2020e1){_0x59f15d=_0x2020e1;_0x7b6b6e[_0x5c2c('0x2b')]=_['keys'](db[_0x5c2c('0x4b')][_0x5c2c('0x1e')]);_0x7b6b6e[_0x5c2c('0x25')]=_['keys'](_0x303e5b[_0x5c2c('0x25')]);_0x7b6b6e[_0x5c2c('0x41')]=_[_0x5c2c('0x2d')](_0x7b6b6e['model'],_0x7b6b6e[_0x5c2c('0x25')]);_0x1e3ed4[_0x5c2c('0x2f')]=_['intersection'](_0x7b6b6e[_0x5c2c('0x2b')],qs[_0x5c2c('0x2e')](_0x303e5b[_0x5c2c('0x25')][_0x5c2c('0x2e')]));_0x1e3ed4[_0x5c2c('0x2f')]=_0x1e3ed4[_0x5c2c('0x2f')][_0x5c2c('0x30')]?_0x1e3ed4[_0x5c2c('0x2f')]:_0x7b6b6e['model'];_0x1e3ed4[_0x5c2c('0x44')]=qs['sort'](_0x303e5b[_0x5c2c('0x25')]['sort']);_0x1e3ed4['where']=qs[_0x5c2c('0x41')](_[_0x5c2c('0x46')](_0x303e5b['query'],_0x7b6b6e[_0x5c2c('0x41')]));if(_0x303e5b[_0x5c2c('0x25')][_0x5c2c('0x48')]){_0x1e3ed4[_0x5c2c('0x23')]=_['merge'](_0x1e3ed4['where'],{'$or':_[_0x5c2c('0x4a')](_0x1e3ed4[_0x5c2c('0x2f')],function(_0x540efb){var _0x44ecb9={};_0x44ecb9[_0x540efb]={'$like':'%'+_0x303e5b['query'][_0x5c2c('0x48')]+'%'};return _0x44ecb9;})});}_0x1e3ed4=_[_0x5c2c('0x49')]({},_0x1e3ed4,_0x303e5b[_0x5c2c('0x32')]);return _0x59f15d[_0x5c2c('0x79')](_0x1e3ed4);}})[_0x5c2c('0x18')](function(_0x2d8c01){if(_0x2d8c01){_0x1a6e1c=_0x2d8c01['length'];if(!_0x303e5b[_0x5c2c('0x25')][_0x5c2c('0x42')](_0x5c2c('0x43'))){_0x1e3ed4[_0x5c2c('0x10')]=qs[_0x5c2c('0x10')](_0x303e5b[_0x5c2c('0x25')][_0x5c2c('0x10')]);_0x1e3ed4['offset']=qs[_0x5c2c('0xe')](_0x303e5b['query'][_0x5c2c('0xe')]);}return _0x59f15d[_0x5c2c('0x79')](_0x1e3ed4);}})['then'](function(_0x33b101){if(_0x33b101){return _0x33b101?{'count':_0x1a6e1c,'rows':_0x33b101}:null;}})['then'](respondWithResult(_0x11867c,null))['catch'](handleError(_0x11867c,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 7f7e9a9..9bf3f0a 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 _0xae79=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x28710c,_0x2fdac4){var _0x3af83d=function(_0x577caa){while(--_0x577caa){_0x28710c['push'](_0x28710c['shift']());}};_0x3af83d(++_0x2fdac4);}(_0xae79,0x1d3));var _0x9ae7=function(_0x320ca6,_0x3707b5){_0x320ca6=_0x320ca6-0x0;var _0x563619=_0xae79[_0x320ca6];return _0x563619;};'use strict';var EventEmitter=require(_0x9ae7('0x0'));var ChatQueue=require(_0x9ae7('0x1'))['db'][_0x9ae7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x9ae7('0x3')](0x0);var events={'afterCreate':_0x9ae7('0x4'),'afterUpdate':_0x9ae7('0x5'),'afterDestroy':_0x9ae7('0x6')};function emitEvent(_0x43f4d9){return function(_0x988f5e,_0x27817e,_0x3bb7d0){ChatQueueEvents[_0x9ae7('0x7')](_0x43f4d9+':'+_0x988f5e['id'],_0x988f5e);ChatQueueEvents[_0x9ae7('0x7')](_0x43f4d9,_0x988f5e);_0x3bb7d0(null);};}for(var e in events){if(events[_0x9ae7('0x8')](e)){var event=events[e];ChatQueue[_0x9ae7('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x0155=['remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x2cc30d,_0x1cfc1c){var _0x3af92d=function(_0x4ed0b2){while(--_0x4ed0b2){_0x2cc30d['push'](_0x2cc30d['shift']());}};_0x3af92d(++_0x1cfc1c);}(_0x0155,0x1da));var _0x5015=function(_0x2bbbb8,_0x55db9c){_0x2bbbb8=_0x2bbbb8-0x0;var _0x3ee70=_0x0155[_0x2bbbb8];return _0x3ee70;};'use strict';var EventEmitter=require(_0x5015('0x0'));var ChatQueue=require(_0x5015('0x1'))['db'][_0x5015('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5015('0x3')](0x0);var events={'afterCreate':_0x5015('0x4'),'afterUpdate':_0x5015('0x5'),'afterDestroy':_0x5015('0x6')};function emitEvent(_0x29b69e){return function(_0x3e5ca5,_0xbf8e0,_0x3c5dcb){ChatQueueEvents[_0x5015('0x7')](_0x29b69e+':'+_0x3e5ca5['id'],_0x3e5ca5);ChatQueueEvents[_0x5015('0x7')](_0x29b69e,_0x3e5ca5);_0x3c5dcb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x5015('0x8')](e,emitEvent(event));}}module[_0x5015('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 9cf36aa..8260389 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 _0xc071=['moment','request-promise','rimraf','../../config/environment','./chatQueue.attributes','chat_queues','lodash','util','api'];(function(_0x5193b7,_0x21e5e9){var _0x12012f=function(_0x56d996){while(--_0x56d996){_0x5193b7['push'](_0x5193b7['shift']());}};_0x12012f(++_0x21e5e9);}(_0xc071,0x8d));var _0x1c07=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc071[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1c07('0x0'));var util=require(_0x1c07('0x1'));var logger=require('../../config/logger')(_0x1c07('0x2'));var moment=require(_0x1c07('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c07('0x5'));var config=require(_0x1c07('0x6'));var attributes=require(_0x1c07('0x7'));module['exports']=function(_0x3cadbd,_0x2e6c32){return _0x3cadbd['define']('ChatQueue',attributes,{'tableName':_0x1c07('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x641c=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','util'];(function(_0x687ab5,_0x1ceca1){var _0x420143=function(_0x266bfb){while(--_0x266bfb){_0x687ab5['push'](_0x687ab5['shift']());}};_0x420143(++_0x1ceca1);}(_0x641c,0x1d7));var _0xc641=function(_0x2263c3,_0x126cac){_0x2263c3=_0x2263c3-0x0;var _0x2362e8=_0x641c[_0x2263c3];return _0x2362e8;};'use strict';var _=require(_0xc641('0x0'));var util=require(_0xc641('0x1'));var logger=require(_0xc641('0x2'))('api');var moment=require(_0xc641('0x3'));var BPromise=require(_0xc641('0x4'));var rp=require(_0xc641('0x5'));var fs=require('fs');var path=require(_0xc641('0x6'));var rimraf=require('rimraf');var config=require(_0xc641('0x7'));var attributes=require(_0xc641('0x8'));module[_0xc641('0x9')]=function(_0x57e8bd,_0x5bb86c){return _0x57e8bd['define']('ChatQueue',attributes,{'tableName':_0xc641('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index b0a848b..e258470 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 _0x8e3f=['rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','then','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xbd111b,_0x525007){var _0x1e1da1=function(_0x5d22d3){while(--_0x5d22d3){_0xbd111b['push'](_0xbd111b['shift']());}};_0x1e1da1(++_0x525007);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});config[_0xf8e3('0xb')]=_['defaults'](config[_0xf8e3('0xb')],{'host':_0xf8e3('0xc'),'port':0x18eb});var socket=require(_0xf8e3('0xd'))(new Redis(config[_0xf8e3('0xb')]));require(_0xf8e3('0xe'))[_0xf8e3('0xf')](socket);function respondWithRpcPromise(_0x299a7e,_0x2a3b59,_0x2d914d){return new BPromise(function(_0x2bc3cd,_0x28f5f0){return client[_0xf8e3('0x10')](_0x299a7e,_0x2d914d)['then'](function(_0xb7d14f){logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,'request\x20sent');logger[_0xf8e3('0x13')](_0xf8e3('0x14'),_0x2a3b59,_0xf8e3('0x15'),JSON[_0xf8e3('0x16')](_0xb7d14f));if(_0xb7d14f['error']){if(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x18')]===0x1f4){logger[_0xf8e3('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f[_0xf8e3('0x17')]['message']);return _0x28f5f0(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}logger[_0xf8e3('0x17')]('ChatQueue,\x20%s,\x20%s',_0x2a3b59,_0xb7d14f['error'][_0xf8e3('0x19')]);return _0x2bc3cd(_0xb7d14f[_0xf8e3('0x17')][_0xf8e3('0x19')]);}else{logger[_0xf8e3('0x11')](_0xf8e3('0x12'),_0x2a3b59,_0xf8e3('0x15'));_0x2bc3cd(_0xb7d14f[_0xf8e3('0x1a')][_0xf8e3('0x19')]);}})[_0xf8e3('0x1b')](function(_0x13fb31){logger['error'](_0xf8e3('0x12'),_0x2a3b59,_0x13fb31);_0x28f5f0(_0x13fb31);});});}exports[_0xf8e3('0x1c')]=function(_0x24e8d6){var _0x31f55d=this;return new Promise(function(_0x3128ad,_0x11c58e){return db[_0xf8e3('0x1d')][_0xf8e3('0x1e')]({'raw':_0x24e8d6['options']?_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x20')]===undefined?!![]:![]:!![],'where':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')]['where']||null:null,'attributes':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6['options'][_0xf8e3('0x21')]||null:null,'limit':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x22')]||null:null,'include':_0x24e8d6[_0xf8e3('0x1f')]?_0x24e8d6[_0xf8e3('0x1f')]['include']?_[_0xf8e3('0x23')](_0x24e8d6[_0xf8e3('0x1f')][_0xf8e3('0x24')],function(_0x417b42){return{'model':db[_0x417b42[_0xf8e3('0x25')]],'as':_0x417b42['as'],'attributes':_0x417b42[_0xf8e3('0x21')],'include':_0x417b42[_0xf8e3('0x24')]?_[_0xf8e3('0x23')](_0x417b42['include'],function(_0x356e0a){return{'model':db[_0x356e0a[_0xf8e3('0x25')]],'as':_0x356e0a['as'],'attributes':_0x356e0a[_0xf8e3('0x21')],'include':_0x356e0a[_0xf8e3('0x24')]?_[_0xf8e3('0x23')](_0x356e0a[_0xf8e3('0x24')],function(_0x16485e){return{'model':db[_0x16485e[_0xf8e3('0x25')]],'as':_0x16485e['as'],'attributes':_0x16485e['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0x26')](function(_0x243e28){logger[_0xf8e3('0x11')](_0xf8e3('0x1c'),_0x24e8d6);logger['debug'](_0xf8e3('0x1c'),_0x24e8d6,JSON[_0xf8e3('0x16')](_0x243e28));_0x3128ad(_0x243e28);})[_0xf8e3('0x1b')](function(_0x45df49){logger[_0xf8e3('0x17')](_0xf8e3('0x1c'),_0x45df49[_0xf8e3('0x19')],_0x24e8d6);_0x11c58e(_0x31f55d[_0xf8e3('0x17')](0x1f4,_0x45df49['message']));});});};exports[_0xf8e3('0x27')]=function(_0x527337){var _0x4acd6c=this;return new Promise(function(_0x5d2dd5,_0x5cc1ed){return db[_0xf8e3('0x1d')]['find']({'raw':_0x527337[_0xf8e3('0x1f')]?_0x527337[_0xf8e3('0x1f')][_0xf8e3('0x20')]===undefined?!![]:![]:!![],'where':_0x527337[_0xf8e3('0x1f')]?_0x527337['options']['where']||null:null,'attributes':_0x527337[_0xf8e3('0x1f')]?_0x527337[_0xf8e3('0x1f')][_0xf8e3('0x21')]||null:null,'include':_0x527337[_0xf8e3('0x1f')]?_0x527337[_0xf8e3('0x1f')][_0xf8e3('0x24')]?_['map'](_0x527337[_0xf8e3('0x1f')]['include'],function(_0x56cd7b){return{'model':db[_0x56cd7b[_0xf8e3('0x25')]],'as':_0x56cd7b['as'],'attributes':_0x56cd7b[_0xf8e3('0x21')],'include':_0x56cd7b[_0xf8e3('0x24')]?_[_0xf8e3('0x23')](_0x56cd7b['include'],function(_0x5ece46){return{'model':db[_0x5ece46[_0xf8e3('0x25')]],'as':_0x5ece46['as'],'attributes':_0x5ece46[_0xf8e3('0x21')],'include':_0x5ece46['include']?_[_0xf8e3('0x23')](_0x5ece46[_0xf8e3('0x24')],function(_0x35ac8a){return{'model':db[_0x35ac8a[_0xf8e3('0x25')]],'as':_0x35ac8a['as'],'attributes':_0x35ac8a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d307e){logger[_0xf8e3('0x11')](_0xf8e3('0x27'),_0x527337);logger[_0xf8e3('0x13')](_0xf8e3('0x27'),_0x527337,JSON['stringify'](_0x5d307e));_0x5d2dd5(_0x5d307e);})[_0xf8e3('0x1b')](function(_0x4b55fb){logger[_0xf8e3('0x17')](_0xf8e3('0x27'),_0x4b55fb[_0xf8e3('0x19')],_0x527337);_0x5cc1ed(_0x4acd6c[_0xf8e3('0x17')](0x1f4,_0x4b55fb[_0xf8e3('0x19')]));});});}; \ No newline at end of file +var _0x6bc4=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ChatQueue','find','ShowChatQueue','util','bluebird','randomstring','ioredis'];(function(_0x17bd62,_0x42c63d){var _0x59ac40=function(_0x295916){while(--_0x295916){_0x17bd62['push'](_0x17bd62['shift']());}};_0x59ac40(++_0x42c63d);}(_0x6bc4,0x164));var _0x46bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc4[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x46bc('0x0'));var moment=require('moment');var BPromise=require(_0x46bc('0x1'));var rs=require(_0x46bc('0x2'));var fs=require('fs');var Redis=require(_0x46bc('0x3'));var db=require(_0x46bc('0x4'))['db'];var utils=require(_0x46bc('0x5'));var logger=require(_0x46bc('0x6'))('rpc');var config=require(_0x46bc('0x7'));var jayson=require(_0x46bc('0x8'));var client=jayson['client'][_0x46bc('0x9')]({'port':0x232a});config[_0x46bc('0xa')]=_[_0x46bc('0xb')](config[_0x46bc('0xa')],{'host':_0x46bc('0xc'),'port':0x18eb});var socket=require(_0x46bc('0xd'))(new Redis(config['redis']));require(_0x46bc('0xe'))[_0x46bc('0xf')](socket);function respondWithRpcPromise(_0x543a08,_0x2145a2,_0x4ed751){return new BPromise(function(_0x20efb6,_0x425d1e){return client['request'](_0x543a08,_0x4ed751)[_0x46bc('0x10')](function(_0x5e7151){logger['info'](_0x46bc('0x11'),_0x2145a2,'request\x20sent');logger[_0x46bc('0x12')](_0x46bc('0x13'),_0x2145a2,_0x46bc('0x14'),JSON['stringify'](_0x5e7151));if(_0x5e7151[_0x46bc('0x15')]){if(_0x5e7151[_0x46bc('0x15')][_0x46bc('0x16')]===0x1f4){logger[_0x46bc('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2145a2,_0x5e7151[_0x46bc('0x15')][_0x46bc('0x17')]);return _0x425d1e(_0x5e7151[_0x46bc('0x15')]['message']);}logger[_0x46bc('0x15')]('ChatQueue,\x20%s,\x20%s',_0x2145a2,_0x5e7151[_0x46bc('0x15')][_0x46bc('0x17')]);return _0x20efb6(_0x5e7151[_0x46bc('0x15')][_0x46bc('0x17')]);}else{logger[_0x46bc('0x18')](_0x46bc('0x11'),_0x2145a2,_0x46bc('0x14'));_0x20efb6(_0x5e7151[_0x46bc('0x19')]['message']);}})[_0x46bc('0x1a')](function(_0x40fce2){logger[_0x46bc('0x15')](_0x46bc('0x11'),_0x2145a2,_0x40fce2);_0x425d1e(_0x40fce2);});});}exports['GetChatQueue']=function(_0x1dcc2d){var _0x261bfd=this;return new Promise(function(_0x14679c,_0x1b89bc){return db['ChatQueue'][_0x46bc('0x1b')]({'raw':_0x1dcc2d[_0x46bc('0x1c')]?_0x1dcc2d[_0x46bc('0x1c')][_0x46bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x1dcc2d['options']?_0x1dcc2d[_0x46bc('0x1c')][_0x46bc('0x1e')]||null:null,'attributes':_0x1dcc2d[_0x46bc('0x1c')]?_0x1dcc2d[_0x46bc('0x1c')]['attributes']||null:null,'limit':_0x1dcc2d[_0x46bc('0x1c')]?_0x1dcc2d['options'][_0x46bc('0x1f')]||null:null,'include':_0x1dcc2d[_0x46bc('0x1c')]?_0x1dcc2d['options'][_0x46bc('0x20')]?_[_0x46bc('0x21')](_0x1dcc2d[_0x46bc('0x1c')][_0x46bc('0x20')],function(_0x4241a2){return{'model':db[_0x4241a2[_0x46bc('0x22')]],'as':_0x4241a2['as'],'attributes':_0x4241a2[_0x46bc('0x23')],'include':_0x4241a2[_0x46bc('0x20')]?_['map'](_0x4241a2[_0x46bc('0x20')],function(_0x1c5407){return{'model':db[_0x1c5407[_0x46bc('0x22')]],'as':_0x1c5407['as'],'attributes':_0x1c5407[_0x46bc('0x23')],'include':_0x1c5407[_0x46bc('0x20')]?_[_0x46bc('0x21')](_0x1c5407[_0x46bc('0x20')],function(_0x48d3c9){return{'model':db[_0x48d3c9['model']],'as':_0x48d3c9['as'],'attributes':_0x48d3c9[_0x46bc('0x23')]};}):[]};}):[]};}):[]:[]})[_0x46bc('0x10')](function(_0x353f2a){logger['info']('GetChatQueue',_0x1dcc2d);logger[_0x46bc('0x12')]('GetChatQueue',_0x1dcc2d,JSON[_0x46bc('0x24')](_0x353f2a));_0x14679c(_0x353f2a);})[_0x46bc('0x1a')](function(_0x723c2b){logger[_0x46bc('0x15')]('GetChatQueue',_0x723c2b['message'],_0x1dcc2d);_0x1b89bc(_0x261bfd[_0x46bc('0x15')](0x1f4,_0x723c2b[_0x46bc('0x17')]));});});};exports['ShowChatQueue']=function(_0x1cf3eb){var _0x40c552=this;return new Promise(function(_0x5a27ff,_0x2d93c6){return db[_0x46bc('0x25')][_0x46bc('0x26')]({'raw':_0x1cf3eb[_0x46bc('0x1c')]?_0x1cf3eb[_0x46bc('0x1c')][_0x46bc('0x1d')]===undefined?!![]:![]:!![],'where':_0x1cf3eb[_0x46bc('0x1c')]?_0x1cf3eb[_0x46bc('0x1c')]['where']||null:null,'attributes':_0x1cf3eb[_0x46bc('0x1c')]?_0x1cf3eb[_0x46bc('0x1c')]['attributes']||null:null,'include':_0x1cf3eb[_0x46bc('0x1c')]?_0x1cf3eb[_0x46bc('0x1c')][_0x46bc('0x20')]?_[_0x46bc('0x21')](_0x1cf3eb[_0x46bc('0x1c')][_0x46bc('0x20')],function(_0x5deb64){return{'model':db[_0x5deb64[_0x46bc('0x22')]],'as':_0x5deb64['as'],'attributes':_0x5deb64[_0x46bc('0x23')],'include':_0x5deb64[_0x46bc('0x20')]?_[_0x46bc('0x21')](_0x5deb64['include'],function(_0x3fed5c){return{'model':db[_0x3fed5c[_0x46bc('0x22')]],'as':_0x3fed5c['as'],'attributes':_0x3fed5c['attributes'],'include':_0x3fed5c['include']?_['map'](_0x3fed5c[_0x46bc('0x20')],function(_0x402aea){return{'model':db[_0x402aea[_0x46bc('0x22')]],'as':_0x402aea['as'],'attributes':_0x402aea[_0x46bc('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58dce2){logger[_0x46bc('0x18')](_0x46bc('0x27'),_0x1cf3eb);logger[_0x46bc('0x12')](_0x46bc('0x27'),_0x1cf3eb,JSON[_0x46bc('0x24')](_0x58dce2));_0x5a27ff(_0x58dce2);})[_0x46bc('0x1a')](function(_0x4777bd){logger[_0x46bc('0x15')](_0x46bc('0x27'),_0x4777bd[_0x46bc('0x17')],_0x1cf3eb);_0x2d93c6(_0x40c552[_0x46bc('0x15')](0x1f4,_0x4777bd[_0x46bc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 75b1f08..d3c02a7 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 _0xac31=['remove','update','length','chatQueue:','./chatQueue.events','save'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0xac31,0xca));var _0x1ac3=function(_0x22c92e,_0x3dc34e){_0x22c92e=_0x22c92e-0x0;var _0x812b21=_0xac31[_0x22c92e];return _0x812b21;};'use strict';var ChatQueueEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){ChatQueueEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);ChatQueueEvents['on'](_0x157604,_0x57893c);}}; \ No newline at end of file +var _0xc874=['emit','removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x3c9d21,_0x217873){var _0x2030d6=function(_0x5c8697){while(--_0x5c8697){_0x3c9d21['push'](_0x3c9d21['shift']());}};_0x2030d6(++_0x217873);}(_0xc874,0x154));var _0x4c87=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xc874[_0x110c3d];return _0x226d67;};'use strict';var ChatQueueEvents=require(_0x4c87('0x0'));var events=['save',_0x4c87('0x1'),_0x4c87('0x2')];function createListener(_0x505440,_0x5e6d61){return function(_0xfc1b9f){_0x5e6d61[_0x4c87('0x3')](_0x505440,_0xfc1b9f);};}function removeListener(_0x1c3dbc,_0x575a7c){return function(){ChatQueueEvents[_0x4c87('0x4')](_0x1c3dbc,_0x575a7c);};}exports[_0x4c87('0x5')]=function(_0x5d63ae){for(var _0x46e0f5=0x0,_0x3dafe0=events[_0x4c87('0x6')];_0x46e0f5<_0x3dafe0;_0x46e0f5++){var _0xdc4a29=events[_0x46e0f5];var _0x116649=createListener('chatQueue:'+_0xdc4a29,_0x5d63ae);ChatQueueEvents['on'](_0xdc4a29,_0x116649);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 31a5a86..005cf7d 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x1f8e02,_0x16df81){var _0x2488cf=function(_0x41c303){while(--_0x41c303){_0x1f8e02['push'](_0x1f8e02['shift']());}};_0x2488cf(++_0x16df81);}(_0xe14b,0x93));var _0xbe14=function(_0x141dc8,_0x22bcf4){_0x141dc8=_0x141dc8-0x0;var _0x12f8fb=_0xe14b[_0x141dc8];return _0x12f8fb;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +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(_0x46e63c,_0xf58796){var _0x398ef7=function(_0x5e8460){while(--_0x5e8460){_0x46e63c['push'](_0x46e63c['shift']());}};_0x398ef7(++_0xf58796);}(_0x008c,0x188));var _0xc008=function(_0x3ef984,_0x3f5981){_0x3ef984=_0x3ef984-0x0;var _0x578b03=_0x008c[_0x3ef984];return _0x578b03;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index d86ac43..da56aeb 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 _0x2fb3=['DATE','moment','exports','STRING'];(function(_0xd90316,_0x41db3d){var _0x2ae51c=function(_0x56b892){while(--_0x56b892){_0xd90316['push'](_0xd90316['shift']());}};_0x2ae51c(++_0x41db3d);}(_0x2fb3,0x1ed));var _0x32fb=function(_0x4d905d,_0x278003){_0x4d905d=_0x4d905d-0x0;var _0x727215=_0x2fb3[_0x4d905d];return _0x727215;};'use strict';var moment=require(_0x32fb('0x0'));var Sequelize=require('sequelize');module[_0x32fb('0x1')]={'uniqueid':{'type':Sequelize[_0x32fb('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x32fb('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x32fb('0x3')]},'acceptAt':{'type':Sequelize[_0x32fb('0x3')]},'exitAt':{'type':Sequelize[_0x32fb('0x3')]},'reason':{'type':Sequelize[_0x32fb('0x2')]}}; \ No newline at end of file +var _0x1b39=['DATE','moment','sequelize','exports','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x1b39,0x100));var _0x91b3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x1b39[_0x4a9fb1];return _0x348672;};'use strict';var moment=require(_0x91b3('0x0'));var Sequelize=require(_0x91b3('0x1'));module[_0x91b3('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x91b3('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x91b3('0x4')]},'acceptAt':{'type':Sequelize[_0x91b3('0x4')]},'exitAt':{'type':Sequelize[_0x91b3('0x4')]},'reason':{'type':Sequelize[_0x91b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index b39af84..e491da8 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 _0xf03a=['rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','include','findAll','catch','show','params','length','includeAll','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','map','ChatQueueReport'];(function(_0x2635d1,_0x2f2c0c){var _0x2a041c=function(_0x18bdfb){while(--_0x18bdfb){_0x2635d1['push'](_0x2635d1['shift']());}};_0x2a041c(++_0x2f2c0c);}(_0xf03a,0x1a0));var _0xaf03=function(_0x1e90de,_0x28f696){_0x1e90de=_0x1e90de-0x0;var _0x349f69=_0xf03a[_0x1e90de];return _0x349f69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaf03('0x0'));var zipdir=require(_0xaf03('0x1'));var jsonpatch=require(_0xaf03('0x2'));var rp=require(_0xaf03('0x3'));var moment=require('moment');var BPromise=require(_0xaf03('0x4'));var Mustache=require(_0xaf03('0x5'));var util=require('util');var path=require(_0xaf03('0x6'));var sox=require(_0xaf03('0x7'));var csv=require(_0xaf03('0x8'));var ejs=require(_0xaf03('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf03('0xa'));var squel=require('squel');var crypto=require(_0xaf03('0xb'));var jsforce=require(_0xaf03('0xc'));var deskjs=require(_0xaf03('0xd'));var toCsv=require(_0xaf03('0x8'));var querystring=require(_0xaf03('0xe'));var Papa=require(_0xaf03('0xf'));var Redis=require('ioredis');var authService=require(_0xaf03('0x10'));var qs=require(_0xaf03('0x11'));var as=require(_0xaf03('0x12'));var hardwareService=require(_0xaf03('0x13'));var logger=require(_0xaf03('0x14'))('api');var utils=require(_0xaf03('0x15'));var config=require(_0xaf03('0x16'));var licenseUtil=require(_0xaf03('0x17'));var db=require(_0xaf03('0x18'))['db'];function respondWithStatusCode(_0x37156e,_0x216ccd){_0x216ccd=_0x216ccd||0xcc;return function(_0x2b1ccf){if(_0x2b1ccf){return _0x37156e['sendStatus'](_0x216ccd);}return _0x37156e['status'](_0x216ccd)[_0xaf03('0x19')]();};}function respondWithResult(_0x525cfb,_0x464635){_0x464635=_0x464635||0xc8;return function(_0x550e22){if(_0x550e22){return _0x525cfb['status'](_0x464635)[_0xaf03('0x1a')](_0x550e22);}};}function respondWithFilteredResult(_0x2d825c,_0x38ca61){return function(_0x2de266){if(_0x2de266){var _0x342f7a=typeof _0x38ca61[_0xaf03('0x1b')]==='undefined'&&typeof _0x38ca61[_0xaf03('0x1c')]===_0xaf03('0x1d');var _0x12bd6=_0x2de266[_0xaf03('0x1e')];var _0x24a074=_0x342f7a?0x0:_0x38ca61[_0xaf03('0x1b')];var _0x5cede9=_0x342f7a?_0x2de266['count']:_0x38ca61[_0xaf03('0x1b')]+_0x38ca61[_0xaf03('0x1c')];var _0x3f5064;if(_0x5cede9>=_0x12bd6){_0x5cede9=_0x12bd6;_0x3f5064=0xc8;}else{_0x3f5064=0xce;}_0x2d825c[_0xaf03('0x1f')](_0x3f5064);return _0x2d825c[_0xaf03('0x20')]('Content-Range',_0x24a074+'-'+_0x5cede9+'/'+_0x12bd6)[_0xaf03('0x1a')](_0x2de266);}return null;};}function patchUpdates(_0x55eca3){return function(_0x14f5e3){try{jsonpatch[_0xaf03('0x21')](_0x14f5e3,_0x55eca3,!![]);}catch(_0x9e28b4){return BPromise[_0xaf03('0x22')](_0x9e28b4);}return _0x14f5e3[_0xaf03('0x23')]();};}function saveUpdates(_0x3664b6,_0x230dd7){return function(_0x1cefca){if(_0x1cefca){return _0x1cefca[_0xaf03('0x24')](_0x3664b6)[_0xaf03('0x25')](function(_0x1e8cac){return _0x1e8cac;});}return null;};}function removeEntity(_0x49cb83,_0x47647f){return function(_0x1ab68b){if(_0x1ab68b){return _0x1ab68b[_0xaf03('0x26')]()[_0xaf03('0x25')](function(){_0x49cb83['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38aa61,_0x382e43){return function(_0x4db61b){if(!_0x4db61b){_0x38aa61[_0xaf03('0x27')](0x194);}return _0x4db61b;};}function handleError(_0xec24e2,_0x247b05){_0x247b05=_0x247b05||0x1f4;return function(_0x1b1ac8){logger[_0xaf03('0x28')](_0x1b1ac8[_0xaf03('0x29')]);if(_0x1b1ac8['name']){delete _0x1b1ac8['name'];}_0xec24e2[_0xaf03('0x1f')](_0x247b05)[_0xaf03('0x2a')](_0x1b1ac8);};}exports[_0xaf03('0x2b')]=function(_0x166a23,_0x416728){var _0x3a74b9={},_0x2e2d91={},_0x4e98c1={'count':0x0,'rows':[]};var _0x256ed5=_[_0xaf03('0x2c')](db[_0xaf03('0x2d')][_0xaf03('0x2e')],function(_0xe05319){return{'name':_0xe05319['fieldName'],'type':_0xe05319[_0xaf03('0x2f')][_0xaf03('0x30')]};});_0x2e2d91['model']=_[_0xaf03('0x2c')](_0x256ed5,'name');_0x2e2d91[_0xaf03('0x31')]=_[_0xaf03('0x32')](_0x166a23[_0xaf03('0x31')]);_0x2e2d91[_0xaf03('0x33')]=_[_0xaf03('0x34')](_0x2e2d91[_0xaf03('0x35')],_0x2e2d91['query']);_0x3a74b9[_0xaf03('0x36')]=_['intersection'](_0x2e2d91[_0xaf03('0x35')],qs[_0xaf03('0x37')](_0x166a23[_0xaf03('0x31')][_0xaf03('0x37')]));_0x3a74b9['attributes']=_0x3a74b9['attributes']['length']?_0x3a74b9[_0xaf03('0x36')]:_0x2e2d91[_0xaf03('0x35')];if(!_0x166a23[_0xaf03('0x31')][_0xaf03('0x38')]('nolimit')){_0x3a74b9[_0xaf03('0x1c')]=qs[_0xaf03('0x1c')](_0x166a23[_0xaf03('0x31')][_0xaf03('0x1c')]);_0x3a74b9['offset']=qs[_0xaf03('0x1b')](_0x166a23['query'][_0xaf03('0x1b')]);}_0x3a74b9[_0xaf03('0x39')]=qs[_0xaf03('0x3a')](_0x166a23[_0xaf03('0x31')][_0xaf03('0x3a')]);_0x3a74b9[_0xaf03('0x3b')]=qs[_0xaf03('0x33')](_[_0xaf03('0x3c')](_0x166a23[_0xaf03('0x31')],_0x2e2d91['filters']),_0x256ed5);if(_0x166a23[_0xaf03('0x31')][_0xaf03('0x3d')]){_0x3a74b9[_0xaf03('0x3b')]=_[_0xaf03('0x3e')](_0x3a74b9[_0xaf03('0x3b')],{'$or':_['map'](_0x256ed5,function(_0x2e22c8){if(_0x2e22c8['type']!==_0xaf03('0x3f')){var _0x477b31={};_0x477b31[_0x2e22c8[_0xaf03('0x40')]]={'$like':'%'+_0x166a23[_0xaf03('0x31')]['filter']+'%'};return _0x477b31;}})});}_0x3a74b9=_[_0xaf03('0x3e')]({},_0x3a74b9,_0x166a23[_0xaf03('0x41')]);var _0x41a323={'where':_0x3a74b9[_0xaf03('0x3b')]};return db[_0xaf03('0x2d')][_0xaf03('0x1e')](_0x41a323)[_0xaf03('0x25')](function(_0x49236c){_0x4e98c1['count']=_0x49236c;if(_0x166a23[_0xaf03('0x31')]['includeAll']){_0x3a74b9[_0xaf03('0x42')]=[{'all':!![]}];}return db[_0xaf03('0x2d')][_0xaf03('0x43')](_0x3a74b9);})[_0xaf03('0x25')](function(_0x184a88){_0x4e98c1['rows']=_0x184a88;return _0x4e98c1;})[_0xaf03('0x25')](respondWithFilteredResult(_0x416728,_0x3a74b9))[_0xaf03('0x44')](handleError(_0x416728,null));};exports[_0xaf03('0x45')]=function(_0x17efbd,_0x11c11e){var _0x27ad10={'raw':!![],'where':{'id':_0x17efbd[_0xaf03('0x46')]['id']}},_0x133531={};_0x133531['model']=_[_0xaf03('0x32')](db[_0xaf03('0x2d')][_0xaf03('0x2e')]);_0x133531[_0xaf03('0x31')]=_['keys'](_0x17efbd[_0xaf03('0x31')]);_0x133531[_0xaf03('0x33')]=_[_0xaf03('0x34')](_0x133531[_0xaf03('0x35')],_0x133531[_0xaf03('0x31')]);_0x27ad10[_0xaf03('0x36')]=_['intersection'](_0x133531[_0xaf03('0x35')],qs[_0xaf03('0x37')](_0x17efbd[_0xaf03('0x31')][_0xaf03('0x37')]));_0x27ad10['attributes']=_0x27ad10[_0xaf03('0x36')][_0xaf03('0x47')]?_0x27ad10[_0xaf03('0x36')]:_0x133531[_0xaf03('0x35')];if(_0x17efbd[_0xaf03('0x31')][_0xaf03('0x48')]){_0x27ad10[_0xaf03('0x42')]=[{'all':!![]}];}_0x27ad10=_['merge']({},_0x27ad10,_0x17efbd[_0xaf03('0x41')]);return db[_0xaf03('0x2d')][_0xaf03('0x49')](_0x27ad10)[_0xaf03('0x25')](handleEntityNotFound(_0x11c11e,null))['then'](respondWithResult(_0x11c11e,null))[_0xaf03('0x44')](handleError(_0x11c11e,null));};exports['create']=function(_0x5a073b,_0x14dc29){return db[_0xaf03('0x2d')][_0xaf03('0x4a')](_0x5a073b['body'],{})[_0xaf03('0x25')](respondWithResult(_0x14dc29,0xc9))[_0xaf03('0x44')](handleError(_0x14dc29,null));};exports['update']=function(_0x53767e,_0x172cc0){if(_0x53767e[_0xaf03('0x4b')]['id']){delete _0x53767e[_0xaf03('0x4b')]['id'];}return db[_0xaf03('0x2d')][_0xaf03('0x49')]({'where':{'id':_0x53767e[_0xaf03('0x46')]['id']}})[_0xaf03('0x25')](handleEntityNotFound(_0x172cc0,null))['then'](saveUpdates(_0x53767e[_0xaf03('0x4b')],null))['then'](respondWithResult(_0x172cc0,null))['catch'](handleError(_0x172cc0,null));};exports[_0xaf03('0x26')]=function(_0x235043,_0x83c57f){return db[_0xaf03('0x2d')]['find']({'where':{'id':_0x235043[_0xaf03('0x46')]['id']}})[_0xaf03('0x25')](handleEntityNotFound(_0x83c57f,null))[_0xaf03('0x25')](removeEntity(_0x83c57f,null))[_0xaf03('0x44')](handleError(_0x83c57f,null));};exports[_0xaf03('0x4c')]=function(_0x2408f0,_0x3a0fdd){return db[_0xaf03('0x2d')][_0xaf03('0x4c')]()[_0xaf03('0x25')](respondWithResult(_0x3a0fdd,null))[_0xaf03('0x44')](handleError(_0x3a0fdd,null));}; \ No newline at end of file +var _0x3079=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','ChatQueueReport','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x36bdd0,_0x2c85f8){var _0xdf7e85=function(_0x30f5bf){while(--_0x30f5bf){_0x36bdd0['push'](_0x36bdd0['shift']());}};_0xdf7e85(++_0x2c85f8);}(_0x3079,0x110));var _0x9307=function(_0x3b9382,_0x32d102){_0x3b9382=_0x3b9382-0x0;var _0x303c10=_0x3079[_0x3b9382];return _0x303c10;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9307('0x0'));var zipdir=require(_0x9307('0x1'));var jsonpatch=require(_0x9307('0x2'));var rp=require(_0x9307('0x3'));var moment=require('moment');var BPromise=require(_0x9307('0x4'));var Mustache=require(_0x9307('0x5'));var util=require('util');var path=require('path');var sox=require(_0x9307('0x6'));var csv=require(_0x9307('0x7'));var ejs=require(_0x9307('0x8'));var fs=require('fs');var fs_extra=require(_0x9307('0x9'));var _=require(_0x9307('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9307('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9307('0x7'));var querystring=require(_0x9307('0xc'));var Papa=require('papaparse');var Redis=require(_0x9307('0xd'));var authService=require(_0x9307('0xe'));var qs=require(_0x9307('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9307('0x10'))(_0x9307('0x11'));var utils=require(_0x9307('0x12'));var config=require(_0x9307('0x13'));var licenseUtil=require(_0x9307('0x14'));var db=require(_0x9307('0x15'))['db'];function respondWithStatusCode(_0x4bc72d,_0x2bab66){_0x2bab66=_0x2bab66||0xcc;return function(_0x2fc4a5){if(_0x2fc4a5){return _0x4bc72d['sendStatus'](_0x2bab66);}return _0x4bc72d['status'](_0x2bab66)[_0x9307('0x16')]();};}function respondWithResult(_0x3d3671,_0x4a7e80){_0x4a7e80=_0x4a7e80||0xc8;return function(_0x3d9864){if(_0x3d9864){return _0x3d3671[_0x9307('0x17')](_0x4a7e80)['json'](_0x3d9864);}};}function respondWithFilteredResult(_0x108830,_0x231bba){return function(_0x4e79f7){if(_0x4e79f7){var _0x3fc6fd=typeof _0x231bba[_0x9307('0x18')]===_0x9307('0x19')&&typeof _0x231bba['limit']===_0x9307('0x19');var _0x27682a=_0x4e79f7['count'];var _0xbba867=_0x3fc6fd?0x0:_0x231bba[_0x9307('0x18')];var _0x1e8af2=_0x3fc6fd?_0x4e79f7[_0x9307('0x1a')]:_0x231bba[_0x9307('0x18')]+_0x231bba[_0x9307('0x1b')];var _0x5810d7;if(_0x1e8af2>=_0x27682a){_0x1e8af2=_0x27682a;_0x5810d7=0xc8;}else{_0x5810d7=0xce;}_0x108830[_0x9307('0x17')](_0x5810d7);return _0x108830[_0x9307('0x1c')](_0x9307('0x1d'),_0xbba867+'-'+_0x1e8af2+'/'+_0x27682a)['json'](_0x4e79f7);}return null;};}function patchUpdates(_0x2f35c7){return function(_0x3a139e){try{jsonpatch['apply'](_0x3a139e,_0x2f35c7,!![]);}catch(_0x307ab9){return BPromise[_0x9307('0x1e')](_0x307ab9);}return _0x3a139e[_0x9307('0x1f')]();};}function saveUpdates(_0x39bbcc,_0x15e7c4){return function(_0xf39222){if(_0xf39222){return _0xf39222[_0x9307('0x20')](_0x39bbcc)[_0x9307('0x21')](function(_0x2f5f68){return _0x2f5f68;});}return null;};}function removeEntity(_0x29b0c2,_0x3241d9){return function(_0x5d42a0){if(_0x5d42a0){return _0x5d42a0[_0x9307('0x22')]()['then'](function(){_0x29b0c2[_0x9307('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c59ef,_0x5bb98a){return function(_0x4d1a13){if(!_0x4d1a13){_0x2c59ef[_0x9307('0x23')](0x194);}return _0x4d1a13;};}function handleError(_0x366dea,_0xfeffdc){_0xfeffdc=_0xfeffdc||0x1f4;return function(_0x330d48){logger[_0x9307('0x24')](_0x330d48[_0x9307('0x25')]);if(_0x330d48[_0x9307('0x26')]){delete _0x330d48['name'];}_0x366dea[_0x9307('0x17')](_0xfeffdc)['send'](_0x330d48);};}exports[_0x9307('0x27')]=function(_0x1c7e60,_0x10ea72){var _0x5deda1={},_0x4619e5={},_0x5459c1={'count':0x0,'rows':[]};var _0x5440a6=_['map'](db[_0x9307('0x28')]['rawAttributes'],function(_0xfe280b){return{'name':_0xfe280b[_0x9307('0x29')],'type':_0xfe280b[_0x9307('0x2a')][_0x9307('0x2b')]};});_0x4619e5[_0x9307('0x2c')]=_[_0x9307('0x2d')](_0x5440a6,'name');_0x4619e5[_0x9307('0x2e')]=_[_0x9307('0x2f')](_0x1c7e60[_0x9307('0x2e')]);_0x4619e5[_0x9307('0x30')]=_[_0x9307('0x31')](_0x4619e5[_0x9307('0x2c')],_0x4619e5[_0x9307('0x2e')]);_0x5deda1['attributes']=_['intersection'](_0x4619e5[_0x9307('0x2c')],qs[_0x9307('0x32')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x32')]));_0x5deda1[_0x9307('0x33')]=_0x5deda1[_0x9307('0x33')][_0x9307('0x34')]?_0x5deda1[_0x9307('0x33')]:_0x4619e5[_0x9307('0x2c')];if(!_0x1c7e60[_0x9307('0x2e')]['hasOwnProperty'](_0x9307('0x35'))){_0x5deda1[_0x9307('0x1b')]=qs[_0x9307('0x1b')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x1b')]);_0x5deda1[_0x9307('0x18')]=qs[_0x9307('0x18')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x18')]);}_0x5deda1[_0x9307('0x36')]=qs[_0x9307('0x37')](_0x1c7e60[_0x9307('0x2e')][_0x9307('0x37')]);_0x5deda1[_0x9307('0x38')]=qs['filters'](_[_0x9307('0x39')](_0x1c7e60[_0x9307('0x2e')],_0x4619e5[_0x9307('0x30')]),_0x5440a6);if(_0x1c7e60[_0x9307('0x2e')][_0x9307('0x3a')]){_0x5deda1[_0x9307('0x38')]=_[_0x9307('0x3b')](_0x5deda1[_0x9307('0x38')],{'$or':_['map'](_0x5440a6,function(_0x11a404){if(_0x11a404[_0x9307('0x2a')]!==_0x9307('0x3c')){var _0x5a8665={};_0x5a8665[_0x11a404[_0x9307('0x26')]]={'$like':'%'+_0x1c7e60[_0x9307('0x2e')][_0x9307('0x3a')]+'%'};return _0x5a8665;}})});}_0x5deda1=_['merge']({},_0x5deda1,_0x1c7e60[_0x9307('0x3d')]);var _0x356747={'where':_0x5deda1[_0x9307('0x38')]};return db[_0x9307('0x28')]['count'](_0x356747)['then'](function(_0x2a7e00){_0x5459c1[_0x9307('0x1a')]=_0x2a7e00;if(_0x1c7e60[_0x9307('0x2e')]['includeAll']){_0x5deda1['include']=[{'all':!![]}];}return db[_0x9307('0x28')]['findAll'](_0x5deda1);})[_0x9307('0x21')](function(_0x24cff3){_0x5459c1['rows']=_0x24cff3;return _0x5459c1;})[_0x9307('0x21')](respondWithFilteredResult(_0x10ea72,_0x5deda1))[_0x9307('0x3e')](handleError(_0x10ea72,null));};exports[_0x9307('0x3f')]=function(_0x39055e,_0x18a738){var _0x1a63ff={'raw':!![],'where':{'id':_0x39055e[_0x9307('0x40')]['id']}},_0x248d24={};_0x248d24[_0x9307('0x2c')]=_['keys'](db['ChatQueueReport'][_0x9307('0x41')]);_0x248d24[_0x9307('0x2e')]=_[_0x9307('0x2f')](_0x39055e[_0x9307('0x2e')]);_0x248d24[_0x9307('0x30')]=_[_0x9307('0x31')](_0x248d24['model'],_0x248d24['query']);_0x1a63ff[_0x9307('0x33')]=_[_0x9307('0x31')](_0x248d24['model'],qs[_0x9307('0x32')](_0x39055e['query'][_0x9307('0x32')]));_0x1a63ff[_0x9307('0x33')]=_0x1a63ff['attributes'][_0x9307('0x34')]?_0x1a63ff[_0x9307('0x33')]:_0x248d24[_0x9307('0x2c')];if(_0x39055e[_0x9307('0x2e')][_0x9307('0x42')]){_0x1a63ff[_0x9307('0x43')]=[{'all':!![]}];}_0x1a63ff=_[_0x9307('0x3b')]({},_0x1a63ff,_0x39055e[_0x9307('0x3d')]);return db['ChatQueueReport'][_0x9307('0x44')](_0x1a63ff)[_0x9307('0x21')](handleEntityNotFound(_0x18a738,null))[_0x9307('0x21')](respondWithResult(_0x18a738,null))[_0x9307('0x3e')](handleError(_0x18a738,null));};exports[_0x9307('0x45')]=function(_0x4f1615,_0x119cc2){return db['ChatQueueReport']['create'](_0x4f1615[_0x9307('0x46')],{})[_0x9307('0x21')](respondWithResult(_0x119cc2,0xc9))[_0x9307('0x3e')](handleError(_0x119cc2,null));};exports[_0x9307('0x20')]=function(_0x196a8e,_0x48a768){if(_0x196a8e[_0x9307('0x46')]['id']){delete _0x196a8e['body']['id'];}return db[_0x9307('0x28')][_0x9307('0x44')]({'where':{'id':_0x196a8e['params']['id']}})['then'](handleEntityNotFound(_0x48a768,null))[_0x9307('0x21')](saveUpdates(_0x196a8e[_0x9307('0x46')],null))[_0x9307('0x21')](respondWithResult(_0x48a768,null))[_0x9307('0x3e')](handleError(_0x48a768,null));};exports[_0x9307('0x22')]=function(_0x5a5f7c,_0x1aa8cb){return db[_0x9307('0x28')][_0x9307('0x44')]({'where':{'id':_0x5a5f7c[_0x9307('0x40')]['id']}})['then'](handleEntityNotFound(_0x1aa8cb,null))['then'](removeEntity(_0x1aa8cb,null))['catch'](handleError(_0x1aa8cb,null));};exports[_0x9307('0x47')]=function(_0x517e52,_0x48ccb6){return db['ChatQueueReport'][_0x9307('0x47')]()[_0x9307('0x21')](respondWithResult(_0x48ccb6,null))[_0x9307('0x3e')](handleError(_0x48ccb6,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index c804638..f92165a 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x286595,_0x29f350){var _0x3ea6b8=function(_0x157dc3){while(--_0x157dc3){_0x286595['push'](_0x286595['shift']());}};_0x3ea6b8(++_0x29f350);}(_0xb10b,0x12a));var _0xbb10=function(_0x7d261d,_0x4e1d2f){_0x7d261d=_0x7d261d-0x0;var _0x1a992a=_0xb10b[_0x7d261d];return _0x1a992a;};'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 11e968c..e148a31 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 _0x4171=['result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','debug','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x4171,0xcf));var _0x1417=function(_0x203491,_0x1df4dc){_0x203491=_0x203491-0x0;var _0x382539=_0x4171[_0x203491];return _0x382539;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1417('0x0'));var BPromise=require('bluebird');var rs=require(_0x1417('0x1'));var fs=require('fs');var Redis=require(_0x1417('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1417('0x3'));var logger=require(_0x1417('0x4'))(_0x1417('0x5'));var config=require(_0x1417('0x6'));var jayson=require(_0x1417('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x130817,_0x12374b,_0x146796){return new BPromise(function(_0x5e1a35,_0xa233ba){return client[_0x1417('0x8')](_0x130817,_0x146796)['then'](function(_0x2ad490){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x12374b,_0x1417('0x9'));logger['debug'](_0x1417('0xa'),_0x12374b,_0x1417('0x9'),JSON[_0x1417('0xb')](_0x2ad490));if(_0x2ad490[_0x1417('0xc')]){if(_0x2ad490[_0x1417('0xc')][_0x1417('0xd')]===0x1f4){logger[_0x1417('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x12374b,_0x2ad490['error'][_0x1417('0xe')]);return _0xa233ba(_0x2ad490[_0x1417('0xc')][_0x1417('0xe')]);}logger[_0x1417('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x12374b,_0x2ad490['error']['message']);return _0x5e1a35(_0x2ad490[_0x1417('0xc')][_0x1417('0xe')]);}else{logger[_0x1417('0xf')](_0x1417('0x10'),_0x12374b,_0x1417('0x9'));_0x5e1a35(_0x2ad490[_0x1417('0x11')][_0x1417('0xe')]);}})[_0x1417('0x12')](function(_0x55afd7){logger[_0x1417('0xc')](_0x1417('0x10'),_0x12374b,_0x55afd7);_0xa233ba(_0x55afd7);});});}exports['CreateChatQueueReport']=function(_0x324747){var _0x1f7ee6=this;return new Promise(function(_0x346920,_0xecb388){return db[_0x1417('0x13')][_0x1417('0x14')](_0x324747[_0x1417('0x15')],{'raw':_0x324747[_0x1417('0x16')]?_0x324747['options'][_0x1417('0x17')]===undefined?!![]:![]:!![]})[_0x1417('0x18')](function(_0x442dc8){logger[_0x1417('0xf')]('CreateChatQueueReport',_0x324747);logger['debug'](_0x1417('0x19'),_0x324747,JSON[_0x1417('0xb')](_0x442dc8));_0x346920(_0x442dc8);})[_0x1417('0x12')](function(_0x1dc0cd){logger[_0x1417('0xc')](_0x1417('0x19'),_0x1dc0cd[_0x1417('0xe')],_0x324747);_0xecb388(_0x1f7ee6[_0x1417('0xc')](0x1f4,_0x1dc0cd['message']));});});};exports[_0x1417('0x1a')]=function(_0x3d8271){var _0x19925f=this;return new Promise(function(_0x4bfafe,_0x3f698a){return db[_0x1417('0x13')][_0x1417('0x1b')](_0x3d8271['body'],{'raw':_0x3d8271[_0x1417('0x16')]?_0x3d8271['options'][_0x1417('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d8271[_0x1417('0x16')]?_0x3d8271['options'][_0x1417('0x1c')]||null:null,'attributes':_0x3d8271[_0x1417('0x16')]?_0x3d8271['options'][_0x1417('0x1d')]||null:null,'limit':_0x3d8271[_0x1417('0x16')]?_0x3d8271[_0x1417('0x16')][_0x1417('0x1e')]||null:null})[_0x1417('0x18')](function(_0x2018ec){logger[_0x1417('0xf')](_0x1417('0x1a'),_0x3d8271);logger[_0x1417('0x1f')]('UpdateChatQueueReport',_0x3d8271,JSON[_0x1417('0xb')](_0x2018ec));_0x4bfafe(_0x2018ec);})[_0x1417('0x12')](function(_0x336878){logger[_0x1417('0xc')](_0x1417('0x1a'),_0x336878['message'],_0x3d8271);_0x3f698a(_0x19925f[_0x1417('0xc')](0x1f4,_0x336878['message']));});});}; \ No newline at end of file +var _0xa9b7=['then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','where','attributes','limit','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0xcb2026,_0x4e8607){var _0x123c22=function(_0x32a31b){while(--_0x32a31b){_0xcb2026['push'](_0xcb2026['shift']());}};_0x123c22(++_0x4e8607);}(_0xa9b7,0x149));var _0x7a9b=function(_0x288b22,_0x19b65a){_0x288b22=_0x288b22-0x0;var _0x495914=_0xa9b7[_0x288b22];return _0x495914;};'use strict';var _=require('lodash');var util=require(_0x7a9b('0x0'));var moment=require(_0x7a9b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a9b('0x2'));var fs=require('fs');var Redis=require(_0x7a9b('0x3'));var db=require(_0x7a9b('0x4'))['db'];var utils=require(_0x7a9b('0x5'));var logger=require(_0x7a9b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7a9b('0x7'));var client=jayson[_0x7a9b('0x8')][_0x7a9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3eaf1a,_0x1045bd,_0x385b2a){return new BPromise(function(_0x22c9f7,_0x4292d4){return client[_0x7a9b('0xa')](_0x3eaf1a,_0x385b2a)[_0x7a9b('0xb')](function(_0x1a4a0e){logger[_0x7a9b('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x1045bd,'request\x20sent');logger[_0x7a9b('0xd')](_0x7a9b('0xe'),_0x1045bd,_0x7a9b('0xf'),JSON['stringify'](_0x1a4a0e));if(_0x1a4a0e[_0x7a9b('0x10')]){if(_0x1a4a0e[_0x7a9b('0x10')][_0x7a9b('0x11')]===0x1f4){logger[_0x7a9b('0x10')](_0x7a9b('0x12'),_0x1045bd,_0x1a4a0e[_0x7a9b('0x10')][_0x7a9b('0x13')]);return _0x4292d4(_0x1a4a0e[_0x7a9b('0x10')][_0x7a9b('0x13')]);}logger[_0x7a9b('0x10')](_0x7a9b('0x12'),_0x1045bd,_0x1a4a0e[_0x7a9b('0x10')][_0x7a9b('0x13')]);return _0x22c9f7(_0x1a4a0e[_0x7a9b('0x10')]['message']);}else{logger['info'](_0x7a9b('0x12'),_0x1045bd,'request\x20sent');_0x22c9f7(_0x1a4a0e[_0x7a9b('0x14')][_0x7a9b('0x13')]);}})[_0x7a9b('0x15')](function(_0x4044ec){logger[_0x7a9b('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x1045bd,_0x4044ec);_0x4292d4(_0x4044ec);});});}exports[_0x7a9b('0x16')]=function(_0x526cfb){var _0x2bb5bb=this;return new Promise(function(_0x359c3f,_0x470e65){return db[_0x7a9b('0x17')][_0x7a9b('0x18')](_0x526cfb[_0x7a9b('0x19')],{'raw':_0x526cfb[_0x7a9b('0x1a')]?_0x526cfb['options'][_0x7a9b('0x1b')]===undefined?!![]:![]:!![]})[_0x7a9b('0xb')](function(_0x6b8ec0){logger[_0x7a9b('0xc')](_0x7a9b('0x16'),_0x526cfb);logger['debug']('CreateChatQueueReport',_0x526cfb,JSON['stringify'](_0x6b8ec0));_0x359c3f(_0x6b8ec0);})[_0x7a9b('0x15')](function(_0x40422a){logger[_0x7a9b('0x10')](_0x7a9b('0x16'),_0x40422a[_0x7a9b('0x13')],_0x526cfb);_0x470e65(_0x2bb5bb[_0x7a9b('0x10')](0x1f4,_0x40422a[_0x7a9b('0x13')]));});});};exports[_0x7a9b('0x1c')]=function(_0x3480cb){var _0x36c7a3=this;return new Promise(function(_0x227d76,_0x458671){return db[_0x7a9b('0x17')][_0x7a9b('0x1d')](_0x3480cb[_0x7a9b('0x19')],{'raw':_0x3480cb[_0x7a9b('0x1a')]?_0x3480cb['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3480cb['options']?_0x3480cb[_0x7a9b('0x1a')][_0x7a9b('0x1e')]||null:null,'attributes':_0x3480cb[_0x7a9b('0x1a')]?_0x3480cb['options'][_0x7a9b('0x1f')]||null:null,'limit':_0x3480cb[_0x7a9b('0x1a')]?_0x3480cb[_0x7a9b('0x1a')][_0x7a9b('0x20')]||null:null})[_0x7a9b('0xb')](function(_0x3dde8c){logger['info'](_0x7a9b('0x1c'),_0x3480cb);logger[_0x7a9b('0xd')](_0x7a9b('0x1c'),_0x3480cb,JSON[_0x7a9b('0x21')](_0x3dde8c));_0x227d76(_0x3dde8c);})[_0x7a9b('0x15')](function(_0x35e874){logger[_0x7a9b('0x10')]('UpdateChatQueueReport',_0x35e874[_0x7a9b('0x13')],_0x3480cb);_0x458671(_0x36c7a3[_0x7a9b('0x10')](0x1f4,_0x35e874[_0x7a9b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index fdb0c66..80427e3 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 _0xa53b=['describe','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa53b,0x196));var _0xba53=function(_0x21de6,_0x5823ce){_0x21de6=_0x21de6-0x0;var _0x169a14=_0xa53b[_0x21de6];return _0x169a14;};'use strict';var multer=require(_0xba53('0x0'));var util=require(_0xba53('0x1'));var path=require(_0xba53('0x2'));var timeout=require(_0xba53('0x3'));var express=require(_0xba53('0x4'));var router=express[_0xba53('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba53('0x6'));var interaction=require(_0xba53('0x7'));var config=require(_0xba53('0x8'));var controller=require(_0xba53('0x9'));router[_0xba53('0xa')]('/',auth[_0xba53('0xb')](),controller[_0xba53('0xc')]);router[_0xba53('0xa')](_0xba53('0xd'),auth[_0xba53('0xb')](),controller[_0xba53('0xe')]);router['get'](_0xba53('0xf'),auth['isAuthenticated'](),controller[_0xba53('0x10')]);router[_0xba53('0x11')]('/',auth[_0xba53('0xb')](),controller[_0xba53('0x12')]);router['put'](_0xba53('0xf'),auth[_0xba53('0xb')](),controller[_0xba53('0x13')]);router['delete']('/:id',auth[_0xba53('0xb')](),controller['destroy']);module[_0xba53('0x14')]=router; \ No newline at end of file +var _0x210d=['describe','create','put','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x31f18e,_0x368b9e){var _0x519690=function(_0x2fb4ff){while(--_0x2fb4ff){_0x31f18e['push'](_0x31f18e['shift']());}};_0x519690(++_0x368b9e);}(_0x210d,0x137));var _0xd210=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x210d[_0x557fd2];return _0x1b54a2;};'use strict';var multer=require(_0xd210('0x0'));var util=require(_0xd210('0x1'));var path=require(_0xd210('0x2'));var timeout=require(_0xd210('0x3'));var express=require('express');var router=express[_0xd210('0x4')]();var fs_extra=require(_0xd210('0x5'));var auth=require(_0xd210('0x6'));var interaction=require(_0xd210('0x7'));var config=require(_0xd210('0x8'));var controller=require(_0xd210('0x9'));router[_0xd210('0xa')]('/',auth[_0xd210('0xb')](),controller['index']);router['get'](_0xd210('0xc'),auth['isAuthenticated'](),controller[_0xd210('0xd')]);router[_0xd210('0xa')]('/:id',auth[_0xd210('0xb')](),controller['show']);router['post']('/',auth[_0xd210('0xb')](),controller[_0xd210('0xe')]);router[_0xd210('0xf')](_0xd210('0x10'),auth[_0xd210('0xb')](),controller['update']);router['delete'](_0xd210('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0xd210('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index b5969b3..b1b3ec7 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x584d18,_0x73581e){var _0x17efd9=function(_0x362bb6){while(--_0x362bb6){_0x584d18['push'](_0x584d18['shift']());}};_0x17efd9(++_0x73581e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0xcb91[_0x35fb56];return _0x2fd52c;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x28a5e4,_0x3d47e6){var _0x4ecb3c=function(_0x311910){while(--_0x311910){_0x28a5e4['push'](_0x28a5e4['shift']());}};_0x4ecb3c(++_0x3d47e6);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x39d980,_0x15c127){_0x39d980=_0x39d980-0x0;var _0x33fcbc=_0xf3cd[_0x39d980];return _0x33fcbc;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index db44593..d5ac930 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 _0xb3fd=['length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','includeAll','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x547bd4,_0x1e98ef){var _0x507449=function(_0x3146bf){while(--_0x3146bf){_0x547bd4['push'](_0x547bd4['shift']());}};_0x507449(++_0x1e98ef);}(_0xb3fd,0x18c));var _0xdb3f=function(_0x858b3d,_0x8bbfc3){_0x858b3d=_0x858b3d-0x0;var _0x1536e9=_0xb3fd[_0x858b3d];return _0x1536e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb3f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb3f('0x1'));var rp=require(_0xdb3f('0x2'));var moment=require(_0xdb3f('0x3'));var BPromise=require(_0xdb3f('0x4'));var Mustache=require(_0xdb3f('0x5'));var util=require(_0xdb3f('0x6'));var path=require(_0xdb3f('0x7'));var sox=require(_0xdb3f('0x8'));var csv=require('to-csv');var ejs=require(_0xdb3f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb3f('0xa'));var squel=require(_0xdb3f('0xb'));var crypto=require(_0xdb3f('0xc'));var jsforce=require(_0xdb3f('0xd'));var deskjs=require(_0xdb3f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdb3f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdb3f('0x10'));var qs=require(_0xdb3f('0x11'));var as=require(_0xdb3f('0x12'));var hardwareService=require(_0xdb3f('0x13'));var logger=require('../../config/logger')(_0xdb3f('0x14'));var utils=require(_0xdb3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdb3f('0x16'));var db=require(_0xdb3f('0x17'))['db'];function respondWithStatusCode(_0x4791b8,_0x211d58){_0x211d58=_0x211d58||0xcc;return function(_0x4ea9b0){if(_0x4ea9b0){return _0x4791b8['sendStatus'](_0x211d58);}return _0x4791b8['status'](_0x211d58)[_0xdb3f('0x18')]();};}function respondWithResult(_0xa35ae8,_0x1ee5aa){_0x1ee5aa=_0x1ee5aa||0xc8;return function(_0x1e13a3){if(_0x1e13a3){return _0xa35ae8[_0xdb3f('0x19')](_0x1ee5aa)['json'](_0x1e13a3);}};}function respondWithFilteredResult(_0x3d94ab,_0x4ab427){return function(_0x820251){if(_0x820251){var _0x2af8ec=typeof _0x4ab427[_0xdb3f('0x1a')]===_0xdb3f('0x1b')&&typeof _0x4ab427[_0xdb3f('0x1c')]===_0xdb3f('0x1b');var _0x400548=_0x820251[_0xdb3f('0x1d')];var _0x390f4b=_0x2af8ec?0x0:_0x4ab427[_0xdb3f('0x1a')];var _0x1687c3=_0x2af8ec?_0x820251[_0xdb3f('0x1d')]:_0x4ab427[_0xdb3f('0x1a')]+_0x4ab427[_0xdb3f('0x1c')];var _0x445223;if(_0x1687c3>=_0x400548){_0x1687c3=_0x400548;_0x445223=0xc8;}else{_0x445223=0xce;}_0x3d94ab['status'](_0x445223);return _0x3d94ab[_0xdb3f('0x1e')](_0xdb3f('0x1f'),_0x390f4b+'-'+_0x1687c3+'/'+_0x400548)[_0xdb3f('0x20')](_0x820251);}return null;};}function patchUpdates(_0x6250dc){return function(_0x593ed8){try{jsonpatch[_0xdb3f('0x21')](_0x593ed8,_0x6250dc,!![]);}catch(_0xb4ecdd){return BPromise[_0xdb3f('0x22')](_0xb4ecdd);}return _0x593ed8['save']();};}function saveUpdates(_0xfb15a6,_0x3ea8e3){return function(_0x172eef){if(_0x172eef){return _0x172eef[_0xdb3f('0x23')](_0xfb15a6)[_0xdb3f('0x24')](function(_0x1bbfdd){return _0x1bbfdd;});}return null;};}function removeEntity(_0x138a6f,_0x11e7d2){return function(_0x128f9c){if(_0x128f9c){return _0x128f9c[_0xdb3f('0x25')]()[_0xdb3f('0x24')](function(){_0x138a6f[_0xdb3f('0x19')](0xcc)[_0xdb3f('0x18')]();});}};}function handleEntityNotFound(_0x54b75a,_0x131507){return function(_0x19e859){if(!_0x19e859){_0x54b75a[_0xdb3f('0x26')](0x194);}return _0x19e859;};}function handleError(_0x27298b,_0xc365e0){_0xc365e0=_0xc365e0||0x1f4;return function(_0x2ddf72){logger[_0xdb3f('0x27')](_0x2ddf72[_0xdb3f('0x28')]);if(_0x2ddf72[_0xdb3f('0x29')]){delete _0x2ddf72[_0xdb3f('0x29')];}_0x27298b['status'](_0xc365e0)['send'](_0x2ddf72);};}exports[_0xdb3f('0x2a')]=function(_0x442a32,_0x52e5d2){var _0x1be557={},_0x3bb289={},_0x4a782f={'count':0x0,'rows':[]};var _0x32aed7=_[_0xdb3f('0x2b')](db[_0xdb3f('0x2c')]['rawAttributes'],function(_0x7d0495){return{'name':_0x7d0495[_0xdb3f('0x2d')],'type':_0x7d0495[_0xdb3f('0x2e')][_0xdb3f('0x2f')]};});_0x3bb289[_0xdb3f('0x30')]=_[_0xdb3f('0x2b')](_0x32aed7,_0xdb3f('0x29'));_0x3bb289[_0xdb3f('0x31')]=_[_0xdb3f('0x32')](_0x442a32[_0xdb3f('0x31')]);_0x3bb289['filters']=_[_0xdb3f('0x33')](_0x3bb289['model'],_0x3bb289[_0xdb3f('0x31')]);_0x1be557[_0xdb3f('0x34')]=_['intersection'](_0x3bb289[_0xdb3f('0x30')],qs['fields'](_0x442a32[_0xdb3f('0x31')][_0xdb3f('0x35')]));_0x1be557[_0xdb3f('0x34')]=_0x1be557[_0xdb3f('0x34')][_0xdb3f('0x36')]?_0x1be557[_0xdb3f('0x34')]:_0x3bb289[_0xdb3f('0x30')];if(!_0x442a32[_0xdb3f('0x31')][_0xdb3f('0x37')](_0xdb3f('0x38'))){_0x1be557[_0xdb3f('0x1c')]=qs[_0xdb3f('0x1c')](_0x442a32[_0xdb3f('0x31')][_0xdb3f('0x1c')]);_0x1be557['offset']=qs[_0xdb3f('0x1a')](_0x442a32['query'][_0xdb3f('0x1a')]);}_0x1be557[_0xdb3f('0x39')]=qs[_0xdb3f('0x3a')](_0x442a32[_0xdb3f('0x31')][_0xdb3f('0x3a')]);_0x1be557['where']=qs['filters'](_['pick'](_0x442a32[_0xdb3f('0x31')],_0x3bb289[_0xdb3f('0x3b')]),_0x32aed7);if(_0x442a32[_0xdb3f('0x31')][_0xdb3f('0x3c')]){_0x1be557[_0xdb3f('0x3d')]=_[_0xdb3f('0x3e')](_0x1be557['where'],{'$or':_[_0xdb3f('0x2b')](_0x32aed7,function(_0x3e6fd1){if(_0x3e6fd1[_0xdb3f('0x2e')]!==_0xdb3f('0x3f')){var _0x39d514={};_0x39d514[_0x3e6fd1[_0xdb3f('0x29')]]={'$like':'%'+_0x442a32['query'][_0xdb3f('0x3c')]+'%'};return _0x39d514;}})});}_0x1be557=_[_0xdb3f('0x3e')]({},_0x1be557,_0x442a32[_0xdb3f('0x40')]);var _0x7dc56f={'where':_0x1be557[_0xdb3f('0x3d')]};return db[_0xdb3f('0x2c')][_0xdb3f('0x1d')](_0x7dc56f)[_0xdb3f('0x24')](function(_0x1abcc0){_0x4a782f[_0xdb3f('0x1d')]=_0x1abcc0;if(_0x442a32[_0xdb3f('0x31')]['includeAll']){_0x1be557[_0xdb3f('0x41')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x1be557);})['then'](function(_0x26e884){_0x4a782f[_0xdb3f('0x42')]=_0x26e884;return _0x4a782f;})[_0xdb3f('0x24')](respondWithFilteredResult(_0x52e5d2,_0x1be557))[_0xdb3f('0x43')](handleError(_0x52e5d2,null));};exports[_0xdb3f('0x44')]=function(_0x3224ab,_0x5421f0){var _0x5481af={'raw':!![],'where':{'id':_0x3224ab[_0xdb3f('0x45')]['id']}},_0x4aad57={};_0x4aad57[_0xdb3f('0x30')]=_[_0xdb3f('0x32')](db[_0xdb3f('0x2c')][_0xdb3f('0x46')]);_0x4aad57[_0xdb3f('0x31')]=_[_0xdb3f('0x32')](_0x3224ab[_0xdb3f('0x31')]);_0x4aad57['filters']=_[_0xdb3f('0x33')](_0x4aad57[_0xdb3f('0x30')],_0x4aad57['query']);_0x5481af[_0xdb3f('0x34')]=_[_0xdb3f('0x33')](_0x4aad57[_0xdb3f('0x30')],qs['fields'](_0x3224ab[_0xdb3f('0x31')]['fields']));_0x5481af[_0xdb3f('0x34')]=_0x5481af[_0xdb3f('0x34')][_0xdb3f('0x36')]?_0x5481af['attributes']:_0x4aad57['model'];if(_0x3224ab[_0xdb3f('0x31')][_0xdb3f('0x47')]){_0x5481af[_0xdb3f('0x41')]=[{'all':!![]}];}_0x5481af=_[_0xdb3f('0x3e')]({},_0x5481af,_0x3224ab['options']);return db[_0xdb3f('0x2c')]['find'](_0x5481af)[_0xdb3f('0x24')](handleEntityNotFound(_0x5421f0,null))[_0xdb3f('0x24')](respondWithResult(_0x5421f0,null))['catch'](handleError(_0x5421f0,null));};exports['create']=function(_0x1d6b87,_0x2c1998){return db[_0xdb3f('0x2c')]['create'](_0x1d6b87[_0xdb3f('0x48')],{})[_0xdb3f('0x24')](respondWithResult(_0x2c1998,0xc9))[_0xdb3f('0x43')](handleError(_0x2c1998,null));};exports['update']=function(_0xe0723c,_0x3487c0){if(_0xe0723c['body']['id']){delete _0xe0723c[_0xdb3f('0x48')]['id'];}return db[_0xdb3f('0x2c')][_0xdb3f('0x49')]({'where':{'id':_0xe0723c[_0xdb3f('0x45')]['id']}})[_0xdb3f('0x24')](handleEntityNotFound(_0x3487c0,null))['then'](saveUpdates(_0xe0723c[_0xdb3f('0x48')],null))['then'](respondWithResult(_0x3487c0,null))[_0xdb3f('0x43')](handleError(_0x3487c0,null));};exports[_0xdb3f('0x25')]=function(_0x6ae4fd,_0x10c18c){return db[_0xdb3f('0x2c')][_0xdb3f('0x49')]({'where':{'id':_0x6ae4fd['params']['id']}})[_0xdb3f('0x24')](handleEntityNotFound(_0x10c18c,null))[_0xdb3f('0x24')](removeEntity(_0x10c18c,null))['catch'](handleError(_0x10c18c,null));};exports[_0xdb3f('0x4a')]=function(_0x172528,_0x4d4ee5){return db[_0xdb3f('0x2c')][_0xdb3f('0x4a')]()[_0xdb3f('0x24')](respondWithResult(_0x4d4ee5,null))[_0xdb3f('0x43')](handleError(_0x4d4ee5,null));}; \ No newline at end of file +var _0x7494=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','describe','rimraf','zip-dir'];(function(_0x6097c4,_0xbaf0ec){var _0x53c5bb=function(_0x51294d){while(--_0x51294d){_0x6097c4['push'](_0x6097c4['shift']());}};_0x53c5bb(++_0xbaf0ec);}(_0x7494,0x184));var _0x4749=function(_0x72600e,_0x10840a){_0x72600e=_0x72600e-0x0;var _0xdc00e=_0x7494[_0x72600e];return _0xdc00e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4749('0x0'));var zipdir=require(_0x4749('0x1'));var jsonpatch=require(_0x4749('0x2'));var rp=require(_0x4749('0x3'));var moment=require(_0x4749('0x4'));var BPromise=require(_0x4749('0x5'));var Mustache=require(_0x4749('0x6'));var util=require(_0x4749('0x7'));var path=require(_0x4749('0x8'));var sox=require(_0x4749('0x9'));var csv=require(_0x4749('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4749('0xb'));var squel=require(_0x4749('0xc'));var crypto=require('crypto');var jsforce=require(_0x4749('0xd'));var deskjs=require(_0x4749('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4749('0xf'));var Papa=require(_0x4749('0x10'));var Redis=require('ioredis');var authService=require(_0x4749('0x11'));var qs=require(_0x4749('0x12'));var as=require(_0x4749('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4749('0x14'))(_0x4749('0x15'));var utils=require(_0x4749('0x16'));var config=require(_0x4749('0x17'));var licenseUtil=require(_0x4749('0x18'));var db=require(_0x4749('0x19'))['db'];function respondWithStatusCode(_0x301320,_0xbd25b5){_0xbd25b5=_0xbd25b5||0xcc;return function(_0x45f56b){if(_0x45f56b){return _0x301320['sendStatus'](_0xbd25b5);}return _0x301320[_0x4749('0x1a')](_0xbd25b5)[_0x4749('0x1b')]();};}function respondWithResult(_0x5c43b9,_0xd1ebc5){_0xd1ebc5=_0xd1ebc5||0xc8;return function(_0x43c699){if(_0x43c699){return _0x5c43b9['status'](_0xd1ebc5)[_0x4749('0x1c')](_0x43c699);}};}function respondWithFilteredResult(_0x3b6a3e,_0x2d50a2){return function(_0x3b95b5){if(_0x3b95b5){var _0x471ab8=typeof _0x2d50a2[_0x4749('0x1d')]===_0x4749('0x1e')&&typeof _0x2d50a2[_0x4749('0x1f')]===_0x4749('0x1e');var _0x6d914a=_0x3b95b5[_0x4749('0x20')];var _0x1cb450=_0x471ab8?0x0:_0x2d50a2[_0x4749('0x1d')];var _0x50482d=_0x471ab8?_0x3b95b5['count']:_0x2d50a2[_0x4749('0x1d')]+_0x2d50a2[_0x4749('0x1f')];var _0x7d7b8a;if(_0x50482d>=_0x6d914a){_0x50482d=_0x6d914a;_0x7d7b8a=0xc8;}else{_0x7d7b8a=0xce;}_0x3b6a3e[_0x4749('0x1a')](_0x7d7b8a);return _0x3b6a3e[_0x4749('0x21')](_0x4749('0x22'),_0x1cb450+'-'+_0x50482d+'/'+_0x6d914a)[_0x4749('0x1c')](_0x3b95b5);}return null;};}function patchUpdates(_0x36456f){return function(_0x5d6eeb){try{jsonpatch['apply'](_0x5d6eeb,_0x36456f,!![]);}catch(_0x3c165c){return BPromise[_0x4749('0x23')](_0x3c165c);}return _0x5d6eeb[_0x4749('0x24')]();};}function saveUpdates(_0xb2feaf,_0x4731cf){return function(_0xa8244a){if(_0xa8244a){return _0xa8244a[_0x4749('0x25')](_0xb2feaf)[_0x4749('0x26')](function(_0x20c0a8){return _0x20c0a8;});}return null;};}function removeEntity(_0x5aa604,_0x17c0df){return function(_0x28acce){if(_0x28acce){return _0x28acce[_0x4749('0x27')]()[_0x4749('0x26')](function(){_0x5aa604['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x308bbc,_0xdfb3ca){return function(_0x219f2e){if(!_0x219f2e){_0x308bbc[_0x4749('0x28')](0x194);}return _0x219f2e;};}function handleError(_0x31b25d,_0x304f5b){_0x304f5b=_0x304f5b||0x1f4;return function(_0x33704e){logger[_0x4749('0x29')](_0x33704e[_0x4749('0x2a')]);if(_0x33704e[_0x4749('0x2b')]){delete _0x33704e[_0x4749('0x2b')];}_0x31b25d['status'](_0x304f5b)[_0x4749('0x2c')](_0x33704e);};}exports[_0x4749('0x2d')]=function(_0x394ab2,_0xc3a724){var _0x4a7f16={},_0xdbb4cf={},_0xd1dfba={'count':0x0,'rows':[]};var _0x780425=_[_0x4749('0x2e')](db[_0x4749('0x2f')]['rawAttributes'],function(_0x204408){return{'name':_0x204408['fieldName'],'type':_0x204408['type'][_0x4749('0x30')]};});_0xdbb4cf[_0x4749('0x31')]=_['map'](_0x780425,_0x4749('0x2b'));_0xdbb4cf['query']=_[_0x4749('0x32')](_0x394ab2['query']);_0xdbb4cf[_0x4749('0x33')]=_[_0x4749('0x34')](_0xdbb4cf[_0x4749('0x31')],_0xdbb4cf[_0x4749('0x35')]);_0x4a7f16[_0x4749('0x36')]=_[_0x4749('0x34')](_0xdbb4cf[_0x4749('0x31')],qs[_0x4749('0x37')](_0x394ab2[_0x4749('0x35')]['fields']));_0x4a7f16['attributes']=_0x4a7f16[_0x4749('0x36')]['length']?_0x4a7f16[_0x4749('0x36')]:_0xdbb4cf['model'];if(!_0x394ab2['query'][_0x4749('0x38')](_0x4749('0x39'))){_0x4a7f16[_0x4749('0x1f')]=qs['limit'](_0x394ab2[_0x4749('0x35')]['limit']);_0x4a7f16[_0x4749('0x1d')]=qs['offset'](_0x394ab2['query']['offset']);}_0x4a7f16[_0x4749('0x3a')]=qs[_0x4749('0x3b')](_0x394ab2[_0x4749('0x35')][_0x4749('0x3b')]);_0x4a7f16[_0x4749('0x3c')]=qs[_0x4749('0x33')](_[_0x4749('0x3d')](_0x394ab2[_0x4749('0x35')],_0xdbb4cf[_0x4749('0x33')]),_0x780425);if(_0x394ab2[_0x4749('0x35')][_0x4749('0x3e')]){_0x4a7f16['where']=_[_0x4749('0x3f')](_0x4a7f16[_0x4749('0x3c')],{'$or':_['map'](_0x780425,function(_0x167288){if(_0x167288['type']!==_0x4749('0x40')){var _0x491ec2={};_0x491ec2[_0x167288[_0x4749('0x2b')]]={'$like':'%'+_0x394ab2[_0x4749('0x35')][_0x4749('0x3e')]+'%'};return _0x491ec2;}})});}_0x4a7f16=_[_0x4749('0x3f')]({},_0x4a7f16,_0x394ab2[_0x4749('0x41')]);var _0x37a348={'where':_0x4a7f16['where']};return db[_0x4749('0x2f')]['count'](_0x37a348)[_0x4749('0x26')](function(_0x3c8a58){_0xd1dfba[_0x4749('0x20')]=_0x3c8a58;if(_0x394ab2[_0x4749('0x35')][_0x4749('0x42')]){_0x4a7f16[_0x4749('0x43')]=[{'all':!![]}];}return db[_0x4749('0x2f')][_0x4749('0x44')](_0x4a7f16);})[_0x4749('0x26')](function(_0x4c2d23){_0xd1dfba['rows']=_0x4c2d23;return _0xd1dfba;})['then'](respondWithFilteredResult(_0xc3a724,_0x4a7f16))[_0x4749('0x45')](handleError(_0xc3a724,null));};exports[_0x4749('0x46')]=function(_0x64cff0,_0x170a0a){var _0xf4415f={'raw':!![],'where':{'id':_0x64cff0[_0x4749('0x47')]['id']}},_0x24a86b={};_0x24a86b[_0x4749('0x31')]=_[_0x4749('0x32')](db[_0x4749('0x2f')][_0x4749('0x48')]);_0x24a86b[_0x4749('0x35')]=_['keys'](_0x64cff0['query']);_0x24a86b[_0x4749('0x33')]=_[_0x4749('0x34')](_0x24a86b[_0x4749('0x31')],_0x24a86b[_0x4749('0x35')]);_0xf4415f[_0x4749('0x36')]=_[_0x4749('0x34')](_0x24a86b['model'],qs[_0x4749('0x37')](_0x64cff0[_0x4749('0x35')][_0x4749('0x37')]));_0xf4415f[_0x4749('0x36')]=_0xf4415f[_0x4749('0x36')][_0x4749('0x49')]?_0xf4415f[_0x4749('0x36')]:_0x24a86b[_0x4749('0x31')];if(_0x64cff0[_0x4749('0x35')][_0x4749('0x42')]){_0xf4415f[_0x4749('0x43')]=[{'all':!![]}];}_0xf4415f=_[_0x4749('0x3f')]({},_0xf4415f,_0x64cff0[_0x4749('0x41')]);return db[_0x4749('0x2f')][_0x4749('0x4a')](_0xf4415f)[_0x4749('0x26')](handleEntityNotFound(_0x170a0a,null))[_0x4749('0x26')](respondWithResult(_0x170a0a,null))['catch'](handleError(_0x170a0a,null));};exports[_0x4749('0x4b')]=function(_0x166a88,_0x2e3afe){return db[_0x4749('0x2f')]['create'](_0x166a88[_0x4749('0x4c')],{})[_0x4749('0x26')](respondWithResult(_0x2e3afe,0xc9))[_0x4749('0x45')](handleError(_0x2e3afe,null));};exports[_0x4749('0x25')]=function(_0x574796,_0x34c481){if(_0x574796[_0x4749('0x4c')]['id']){delete _0x574796[_0x4749('0x4c')]['id'];}return db[_0x4749('0x2f')]['find']({'where':{'id':_0x574796[_0x4749('0x47')]['id']}})[_0x4749('0x26')](handleEntityNotFound(_0x34c481,null))[_0x4749('0x26')](saveUpdates(_0x574796[_0x4749('0x4c')],null))[_0x4749('0x26')](respondWithResult(_0x34c481,null))[_0x4749('0x45')](handleError(_0x34c481,null));};exports[_0x4749('0x27')]=function(_0x1e2250,_0x583305){return db[_0x4749('0x2f')][_0x4749('0x4a')]({'where':{'id':_0x1e2250['params']['id']}})[_0x4749('0x26')](handleEntityNotFound(_0x583305,null))[_0x4749('0x26')](removeEntity(_0x583305,null))[_0x4749('0x45')](handleError(_0x583305,null));};exports[_0x4749('0x4d')]=function(_0x253a07,_0x2a62c6){return db[_0x4749('0x2f')]['describe']()['then'](respondWithResult(_0x2a62c6,null))[_0x4749('0x45')](handleError(_0x2a62c6,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index ae1af0d..77be2b8 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 _0xe4c8=['uniqueid','lodash','util','../../config/logger','moment','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x447d01,_0x28026b){var _0x570f79=function(_0x5d9183){while(--_0x5d9183){_0x447d01['push'](_0x447d01['shift']());}};_0x570f79(++_0x28026b);}(_0xe4c8,0x114));var _0x8e4c=function(_0x32ffb6,_0x5bfac1){_0x32ffb6=_0x32ffb6-0x0;var _0x48e99c=_0xe4c8[_0x32ffb6];return _0x48e99c;};'use strict';var _=require(_0x8e4c('0x0'));var util=require(_0x8e4c('0x1'));var logger=require(_0x8e4c('0x2'))('api');var moment=require(_0x8e4c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8e4c('0x4'));var attributes=require(_0x8e4c('0x5'));module[_0x8e4c('0x6')]=function(_0x4d1bfb,_0x9ed493){return _0x4d1bfb[_0x8e4c('0x7')](_0x8e4c('0x8'),attributes,{'tableName':_0x8e4c('0x9'),'paranoid':![],'indexes':[{'name':_0x8e4c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x339e=['report_chat_transfer','uniqueid','../../config/logger','request-promise','path','rimraf','./chatTransferReport.attributes','define'];(function(_0x3ad1ab,_0x3c8799){var _0x26d4c9=function(_0x2b0adf){while(--_0x2b0adf){_0x3ad1ab['push'](_0x3ad1ab['shift']());}};_0x26d4c9(++_0x3c8799);}(_0x339e,0x72));var _0xe339=function(_0x32b122,_0x1ad490){_0x32b122=_0x32b122-0x0;var _0x4ad25a=_0x339e[_0x32b122];return _0x4ad25a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe339('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe339('0x1'));var fs=require('fs');var path=require(_0xe339('0x2'));var rimraf=require(_0xe339('0x3'));var config=require('../../config/environment');var attributes=require(_0xe339('0x4'));module['exports']=function(_0x4bc2d2,_0x4e9e49){return _0x4bc2d2[_0xe339('0x5')]('ChatTransferReport',attributes,{'tableName':_0xe339('0x6'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe339('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 71748ef..fc9259f 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 _0x8b4e=['client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x8b4e,0x1a5));var _0xe8b4=function(_0x5920bf,_0x33ab51){_0x5920bf=_0x5920bf-0x0;var _0x159584=_0x8b4e[_0x5920bf];return _0x159584;};'use strict';var _=require(_0xe8b4('0x0'));var util=require(_0xe8b4('0x1'));var moment=require('moment');var BPromise=require(_0xe8b4('0x2'));var rs=require(_0xe8b4('0x3'));var fs=require('fs');var Redis=require(_0xe8b4('0x4'));var db=require(_0xe8b4('0x5'))['db'];var utils=require(_0xe8b4('0x6'));var logger=require(_0xe8b4('0x7'))(_0xe8b4('0x8'));var config=require(_0xe8b4('0x9'));var jayson=require(_0xe8b4('0xa'));var client=jayson[_0xe8b4('0xb')][_0xe8b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36dad0,_0x21eb8f,_0x8fe470){return new BPromise(function(_0x14f7c8,_0x47f41c){return client[_0xe8b4('0xd')](_0x36dad0,_0x8fe470)['then'](function(_0x4b0e6f){logger[_0xe8b4('0xe')](_0xe8b4('0xf'),_0x21eb8f,_0xe8b4('0x10'));logger[_0xe8b4('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x21eb8f,'request\x20sent',JSON[_0xe8b4('0x12')](_0x4b0e6f));if(_0x4b0e6f['error']){if(_0x4b0e6f[_0xe8b4('0x13')][_0xe8b4('0x14')]===0x1f4){logger[_0xe8b4('0x13')](_0xe8b4('0xf'),_0x21eb8f,_0x4b0e6f[_0xe8b4('0x13')]['message']);return _0x47f41c(_0x4b0e6f[_0xe8b4('0x13')][_0xe8b4('0x15')]);}logger[_0xe8b4('0x13')](_0xe8b4('0xf'),_0x21eb8f,_0x4b0e6f['error'][_0xe8b4('0x15')]);return _0x14f7c8(_0x4b0e6f[_0xe8b4('0x13')][_0xe8b4('0x15')]);}else{logger[_0xe8b4('0xe')](_0xe8b4('0xf'),_0x21eb8f,_0xe8b4('0x10'));_0x14f7c8(_0x4b0e6f[_0xe8b4('0x16')][_0xe8b4('0x15')]);}})[_0xe8b4('0x17')](function(_0x2c5a9c){logger[_0xe8b4('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x21eb8f,_0x2c5a9c);_0x47f41c(_0x2c5a9c);});});} \ No newline at end of file +var _0x4b85=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x6d127f,_0x18e586){var _0x320297=function(_0x3cb053){while(--_0x3cb053){_0x6d127f['push'](_0x6d127f['shift']());}};_0x320297(++_0x18e586);}(_0x4b85,0xef));var _0x54b8=function(_0x85221c,_0x1faf88){_0x85221c=_0x85221c-0x0;var _0x397dc0=_0x4b85[_0x85221c];return _0x397dc0;};'use strict';var _=require(_0x54b8('0x0'));var util=require(_0x54b8('0x1'));var moment=require('moment');var BPromise=require(_0x54b8('0x2'));var rs=require(_0x54b8('0x3'));var fs=require('fs');var Redis=require(_0x54b8('0x4'));var db=require(_0x54b8('0x5'))['db'];var utils=require(_0x54b8('0x6'));var logger=require(_0x54b8('0x7'))(_0x54b8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x54b8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a019d,_0x14d9e3,_0x5cae7c){return new BPromise(function(_0x3e1b1c,_0x4f95fa){return client[_0x54b8('0xa')](_0x5a019d,_0x5cae7c)[_0x54b8('0xb')](function(_0x114ac8){logger[_0x54b8('0xc')](_0x54b8('0xd'),_0x14d9e3,_0x54b8('0xe'));logger[_0x54b8('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x14d9e3,_0x54b8('0xe'),JSON['stringify'](_0x114ac8));if(_0x114ac8[_0x54b8('0x10')]){if(_0x114ac8[_0x54b8('0x10')][_0x54b8('0x11')]===0x1f4){logger['error'](_0x54b8('0xd'),_0x14d9e3,_0x114ac8[_0x54b8('0x10')]['message']);return _0x4f95fa(_0x114ac8[_0x54b8('0x10')][_0x54b8('0x12')]);}logger[_0x54b8('0x10')](_0x54b8('0xd'),_0x14d9e3,_0x114ac8[_0x54b8('0x10')][_0x54b8('0x12')]);return _0x3e1b1c(_0x114ac8[_0x54b8('0x10')][_0x54b8('0x12')]);}else{logger[_0x54b8('0xc')](_0x54b8('0xd'),_0x14d9e3,_0x54b8('0xe'));_0x3e1b1c(_0x114ac8[_0x54b8('0x13')][_0x54b8('0x12')]);}})[_0x54b8('0x14')](function(_0x1f2c39){logger[_0x54b8('0x10')](_0x54b8('0xd'),_0x14d9e3,_0x1f2c39);_0x4f95fa(_0x1f2c39);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index fb40451..461a5e9 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 _0xf7eb=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0xf7eb,0x102));var _0xbf7e=function(_0x10f7fa,_0x41ffa2){_0x10f7fa=_0x10f7fa-0x0;var _0x34dc72=_0xf7eb[_0x10f7fa];return _0x34dc72;};'use strict';var multer=require(_0xbf7e('0x0'));var util=require('util');var path=require(_0xbf7e('0x1'));var timeout=require(_0xbf7e('0x2'));var express=require('express');var router=express[_0xbf7e('0x3')]();var fs_extra=require(_0xbf7e('0x4'));var auth=require(_0xbf7e('0x5'));var interaction=require(_0xbf7e('0x6'));var config=require('../../config/environment');var controller=require(_0xbf7e('0x7'));router[_0xbf7e('0x8')]('/',auth[_0xbf7e('0x9')](),controller[_0xbf7e('0xa')]);router['get']('/describe',auth[_0xbf7e('0x9')](),controller[_0xbf7e('0xb')]);router[_0xbf7e('0x8')](_0xbf7e('0xc'),auth[_0xbf7e('0x9')](),controller[_0xbf7e('0xd')]);router[_0xbf7e('0xe')]('/',auth[_0xbf7e('0x9')](),controller[_0xbf7e('0xf')]);router[_0xbf7e('0x10')](_0xbf7e('0xc'),auth[_0xbf7e('0x9')](),controller[_0xbf7e('0x11')]);router[_0xbf7e('0x12')](_0xbf7e('0xc'),auth[_0xbf7e('0x9')](),controller[_0xbf7e('0x13')]);module[_0xbf7e('0x14')]=router; \ No newline at end of file +var _0x1b2b=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update'];(function(_0x4a5fa5,_0x51dadc){var _0x241266=function(_0x404501){while(--_0x404501){_0x4a5fa5['push'](_0x4a5fa5['shift']());}};_0x241266(++_0x51dadc);}(_0x1b2b,0x1d1));var _0xb1b2=function(_0x32fb8d,_0x567a64){_0x32fb8d=_0x32fb8d-0x0;var _0x37cf13=_0x1b2b[_0x32fb8d];return _0x37cf13;};'use strict';var multer=require('multer');var util=require(_0xb1b2('0x0'));var path=require(_0xb1b2('0x1'));var timeout=require(_0xb1b2('0x2'));var express=require(_0xb1b2('0x3'));var router=express[_0xb1b2('0x4')]();var fs_extra=require(_0xb1b2('0x5'));var auth=require(_0xb1b2('0x6'));var interaction=require(_0xb1b2('0x7'));var config=require(_0xb1b2('0x8'));var controller=require('./chatTransferReport.controller');router[_0xb1b2('0x9')]('/',auth[_0xb1b2('0xa')](),controller['index']);router[_0xb1b2('0x9')](_0xb1b2('0xb'),auth[_0xb1b2('0xa')](),controller[_0xb1b2('0xc')]);router[_0xb1b2('0x9')](_0xb1b2('0xd'),auth['isAuthenticated'](),controller[_0xb1b2('0xe')]);router[_0xb1b2('0xf')]('/',auth['isAuthenticated'](),controller[_0xb1b2('0x10')]);router[_0xb1b2('0x11')]('/:id',auth[_0xb1b2('0xa')](),controller[_0xb1b2('0x12')]);router[_0xb1b2('0x13')]('/:id',auth[_0xb1b2('0xa')](),controller[_0xb1b2('0x14')]);module[_0xb1b2('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index a8b07f5..158ee77 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 _0x3125=['Leave\x20your\x20comments','offlineForm','parse','setDataValue','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','stringify','input','name','getDataValue','onlineForm','Comments'];(function(_0xf2628e,_0x521bf7){var _0x13863a=function(_0x2b04ab){while(--_0x2b04ab){_0xf2628e['push'](_0xf2628e['shift']());}};_0x13863a(++_0x521bf7);}(_0x3125,0xb1));var _0x5312=function(_0x3f7879,_0x1a31c9){_0x3f7879=_0x3f7879-0x0;var _0x5d8250=_0x3125[_0x3f7879];return _0x5d8250;};'use strict';var Sequelize=require(_0x5312('0x0'));var rs=require(_0x5312('0x1'));module[_0x5312('0x2')]={'name':{'type':Sequelize[_0x5312('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x5312('0x3')],'allowNull':![],'unique':_0x5312('0x4')},'description':{'type':Sequelize[_0x5312('0x3')]},'mapKey':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x5')},'mapKeyOffline':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x6')},'customerAlias':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5312('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x5312('0x3')],'allowNull':![],'defaultValue':_0x5312('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5312('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5312('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5312('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x5312('0x3')]},'animation':{'type':Sequelize[_0x5312('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5312('0xb')](_0x5312('0xc'),'squared'),'defaultValue':_0x5312('0xc')},'header_online':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0xd')},'start_chat_button':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0xe')},'header_offline':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0xf')},'download_transcript':{'type':Sequelize[_0x5312('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x5312('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x5312('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5312('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x14')},'closingMessage':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x15')},'conditionAgreement':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x16')},'ratingType':{'type':Sequelize[_0x5312('0xb')](_0x5312('0x17'),_0x5312('0x18')),'defaultValue':_0x5312('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x5312('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x5312('0x10')],'defaultValue':function(){return JSON[_0x5312('0x19')]({'items':[{'type':_0x5312('0x1a'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x5312('0x1b'),'helpText':''}},{'type':_0x5312('0x1a'),'props':{'title':_0x5312('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5312('0x5'),'type':_0x5312('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x5312('0x1c')](_0x5312('0x1d'))?JSON['parse'](this[_0x5312('0x1c')](_0x5312('0x1d'))):{};},'set':function(_0x596c67){return this['setDataValue']('onlineForm',JSON['stringify'](_0x596c67));}},'offlineForm':{'type':Sequelize[_0x5312('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x5312('0x1a'),'props':{'title':_0x5312('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5312('0x5'),'type':_0x5312('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x5312('0x1e')},'props':{'title':_0x5312('0x1e'),'helpText':_0x5312('0x1f')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x5312('0x20'))?JSON[_0x5312('0x21')](this[_0x5312('0x1c')](_0x5312('0x20'))):{};},'set':function(_0x53c25f){return this[_0x5312('0x22')](_0x5312('0x20'),JSON[_0x5312('0x19')](_0x53c25f));}},'token':{'type':Sequelize[_0x5312('0x3')],'defaultValue':function(){return rs[_0x5312('0x23')]();}},'autoclose':{'type':Sequelize[_0x5312('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5312('0x3')]},'forwardOffline':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x24')},'waitingMessage':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x27')},'skipUnmanaged':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x15')},'sendUnmanaged':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x5312('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5312('0x28');}},'notificationSound':{'type':Sequelize[_0x5312('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5312('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5312('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x2a')},'verticalAlignment':{'type':Sequelize[_0x5312('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x5312('0x3')],'defaultValue':_0x5312('0x2b')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5312('0x2c')},'defaultTitle':{'type':Sequelize[_0x5312('0x3')]},'customerAvatar':{'type':Sequelize[_0x5312('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5312('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x5312('0x3')],'allowNull':![],'defaultValue':_0x5312('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5312('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5312('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x5312('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5312('0x9')],'comment':_0x5312('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![],'comment':_0x5312('0x2f'),'set':function(_0xaf0619){if(!_0xaf0619)this[_0x5312('0x22')](_0x5312('0x30'),null);this[_0x5312('0x22')](_0x5312('0x31'),_0xaf0619);}},'vidaooEscalation':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5312('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5312('0x32')},'vidaooNote':{'type':Sequelize[_0x5312('0x3')],'defaultValue':function(){return _0x5312('0x33');}},'vidaooMetadata':{'type':Sequelize[_0x5312('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x5312('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x5312('0x10')]}}; \ No newline at end of file +var _0x3647=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name','text','getDataValue','parse','onlineForm','setDataValue','stringify','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT'];(function(_0x15173e,_0x48af1e){var _0x475188=function(_0x1ff075){while(--_0x1ff075){_0x15173e['push'](_0x15173e['shift']());}};_0x475188(++_0x48af1e);}(_0x3647,0xcf));var _0x7364=function(_0x535da1,_0x1560ed){_0x535da1=_0x535da1-0x0;var _0x4c4b7c=_0x3647[_0x535da1];return _0x4c4b7c;};'use strict';var Sequelize=require(_0x7364('0x0'));var rs=require(_0x7364('0x1'));module['exports']={'name':{'type':Sequelize[_0x7364('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'unique':_0x7364('0x3')},'description':{'type':Sequelize[_0x7364('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x7364('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x5')},'customerAlias':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7364('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'defaultValue':_0x7364('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7364('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7364('0x2')]},'animation':{'type':Sequelize[_0x7364('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7364('0x9')](_0x7364('0xa'),_0x7364('0xb')),'defaultValue':_0x7364('0xa')},'header_online':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0xc')},'start_chat_button':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7364('0xe')},'header_offline':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0xf')},'download_transcript':{'type':Sequelize[_0x7364('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x7364('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7364('0x10')]},'closingQuestion':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x13')},'placeholderMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x14')},'closingMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x15')},'conditionAgreement':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x7364('0x17'),_0x7364('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x7364('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7364('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x7364('0x19'),'variable':null,'config':{'placeholder':_0x7364('0x1a'),'type':_0x7364('0x1b'),'required':!![]},'props':{'title':_0x7364('0x1a'),'helpText':''}},{'type':_0x7364('0x19'),'props':{'title':_0x7364('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x7364('0x4'),'type':_0x7364('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x7364('0x1c')]('onlineForm')?JSON[_0x7364('0x1d')](this['getDataValue'](_0x7364('0x1e'))):{};},'set':function(_0x139881){return this[_0x7364('0x1f')](_0x7364('0x1e'),JSON[_0x7364('0x20')](_0x139881));}},'offlineForm':{'type':Sequelize[_0x7364('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x7364('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x7364('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x7364('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x7364('0x1c')](_0x7364('0x22'))?JSON[_0x7364('0x1d')](this[_0x7364('0x1c')]('offlineForm')):{};},'set':function(_0xaaa25c){return this[_0x7364('0x1f')]('offlineForm',JSON['stringify'](_0xaaa25c));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x7364('0x23')]();}},'autoclose':{'type':Sequelize[_0x7364('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7364('0x2')]},'waitingTitle':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x24')},'waitingMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x7364('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x27')},'skipUnmanaged':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x7364('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7364('0x2')]},'notificationTemplate':{'type':Sequelize[_0x7364('0x10')],'defaultValue':function(){return _0x7364('0x28');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7364('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x7364('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x7364('0x2')],'defaultValue':_0x7364('0x2a')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7364('0x2b')},'defaultTitle':{'type':Sequelize[_0x7364('0x2')]},'customerAvatar':{'type':Sequelize[_0x7364('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7364('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'defaultValue':_0x7364('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7364('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7364('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x7364('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7364('0x7')],'comment':_0x7364('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![],'comment':_0x7364('0x2e'),'set':function(_0x53005b){if(!_0x53005b)this[_0x7364('0x1f')]('mandatoryDispositionPauseId',null);this[_0x7364('0x1f')](_0x7364('0x2f'),_0x53005b);}},'vidaooEscalation':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x7364('0x2')],'allowNull':![],'defaultValue':_0x7364('0x30')},'vidaooNote':{'type':Sequelize[_0x7364('0x2')],'defaultValue':function(){return _0x7364('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x7364('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7364('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7364('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c0e9d02..9b089d5 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 _0x70b7=['root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','Interval','resolve','timezone','ifTime','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','referer','CmContact','createdAt','includes','updatedAt','ListId','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','from','CmList','Contacts','DESC','ChatApplication','Intervals','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','Applications','asc','list','List','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','ValidationError','no\x20available\x20attributes','Sequelize','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','attachments','offline-chat','basename','transaction','Attachment','bulkCreate','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','Tag','color','tag','getSnippet','interval','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','3.9.0','origin','http://localhost:9000','remote','x-real-ip','connection','remoteAddress','replace','color_button','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','findAndCountAll','priority','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','removeAgents','emit','userChatWebsite:remove','getAgents','util','ejs','querystring','ioredis','jayson/promise','../../components/parsers/qs','api','APIBadRequestError','../../errors/api','handleError','APIConflictError','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','catch','end','status','json','undefined','count','offset','limit','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','sendStatus','name','send','user-agent-parser','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','ChatWebsiteId','getDispositions','Disposition','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','systemAvatar','getLogo'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x70b7,0x1de));var _0x770b=function(_0x1fb4e1,_0x3d4ce6){_0x1fb4e1=_0x1fb4e1-0x0;var _0x22d1b0=_0x70b7[_0x1fb4e1];return _0x22d1b0;};'use strict';var Mustache=require('mustache');var util=require(_0x770b('0x0'));var path=require('path');var ejs=require(_0x770b('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0x770b('0x2'));var htmlToText=require('html-to-text');var Redis=require(_0x770b('0x3'));var jayson=require(_0x770b('0x4'));var qs=require(_0x770b('0x5'));var logger=require('../../config/logger')(_0x770b('0x6'));var config=require('../../config/environment');var APIBadRequestError=require('../../errors/api')[_0x770b('0x7')];var APINotFoundError=require(_0x770b('0x8'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x770b('0x8'))['APIOutOfIntervalError'];var APIHandleError=require('../../errors/api')[_0x770b('0x9')];var APIConflictError=require(_0x770b('0x8'))[_0x770b('0xa')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x770b('0xb'))[_0x770b('0xc')];var db=require(_0x770b('0xd'))['db'];config[_0x770b('0xe')]=_[_0x770b('0xf')](config[_0x770b('0xe')],{'host':_0x770b('0x10'),'port':0x18eb});var socket=require(_0x770b('0x11'))(new Redis(config['redis']));require(_0x770b('0x12'))[_0x770b('0x13')](socket);var client=jayson[_0x770b('0x14')][_0x770b('0x15')]({'port':0x232c});var client9002=jayson[_0x770b('0x14')][_0x770b('0x15')]({'port':0x232a});var client9003=jayson[_0x770b('0x14')]['http']({'port':0x232b});var client9001=jayson[_0x770b('0x14')][_0x770b('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x1d1730,_0x3c459c,_0x4664d8,_0x42d748){return new Promise(function(_0x3593e0,_0x4cd9d6){var _0x5be953=_0x42d748||client;return _0x5be953[_0x770b('0x16')](_0x1d1730,_0x4664d8)[_0x770b('0x17')](function(_0x573b69){logger[_0x770b('0x18')](_0x770b('0x19'),_0x3c459c,'request\x20sent');logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3c459c,'request\x20sent',JSON[_0x770b('0x1a')](_0x573b69));if(_0x573b69['error']){if(_0x573b69['error'][_0x770b('0x1b')]===0x1f4){logger[_0x770b('0x1c')](_0x770b('0x19'),_0x3c459c,_0x573b69['error'][_0x770b('0x1d')]);return _0x4cd9d6(_0x573b69['error'][_0x770b('0x1d')]);}logger[_0x770b('0x1c')](_0x770b('0x19'),_0x3c459c,_0x573b69['error'][_0x770b('0x1d')]);return _0x3593e0(_0x573b69['error']['message']);}else{logger[_0x770b('0x18')](_0x770b('0x19'),_0x3c459c,_0x770b('0x1e'));_0x3593e0(_0x573b69['result']['message']);}})[_0x770b('0x1f')](function(_0x17226a){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x3c459c,_0x17226a);_0x4cd9d6(_0x17226a);});});}function respondWithStatusCode(_0x1690e7,_0xe5acdd){_0xe5acdd=_0xe5acdd||0xcc;return function(_0x2ec400){if(_0x2ec400){return _0x1690e7['sendStatus'](_0xe5acdd);}return _0x1690e7['status'](_0xe5acdd)[_0x770b('0x20')]();};}function respondWithResult(_0x1350bc,_0x2e48ec){_0x2e48ec=_0x2e48ec||0xc8;return function(_0x188545){if(_0x188545){return _0x1350bc[_0x770b('0x21')](_0x2e48ec)[_0x770b('0x22')](_0x188545);}};}function respondWithFilteredResult(_0xf9c61d,_0x59629b){return function(_0x1fc411){if(_0x1fc411){var _0x26f2fe=typeof _0x59629b['offset']==='undefined'&&typeof _0x59629b['limit']===_0x770b('0x23');var _0x4e5716=_0x1fc411[_0x770b('0x24')];var _0x567620=_0x26f2fe?0x0:_0x59629b[_0x770b('0x25')];var _0x550e96=_0x26f2fe?_0x1fc411[_0x770b('0x24')]:_0x59629b[_0x770b('0x25')]+_0x59629b[_0x770b('0x26')];var _0x5b447e;if(_0x550e96>=_0x4e5716){_0x550e96=_0x4e5716;_0x5b447e=0xc8;}else{_0x5b447e=0xce;}_0xf9c61d[_0x770b('0x21')](_0x5b447e);return _0xf9c61d[_0x770b('0x27')](_0x770b('0x28'),_0x567620+'-'+_0x550e96+'/'+_0x4e5716)['json'](_0x1fc411);}return null;};}function saveUpdates(_0x1d6f66){return function(_0x563635){if(_0x563635){return _0x563635['update'](_0x1d6f66)['then'](function(_0x36e431){return _0x36e431;});}return null;};}function removeEntity(_0xecbfae){return function(_0x391d96){if(_0x391d96){return _0x391d96[_0x770b('0x29')]()['then'](function(){var _0x19b95d=_0x391d96[_0x770b('0x2a')]({'plain':!![]});var _0x437422=_0x770b('0x2b');return db[_0x770b('0x2c')]['destroy']({'where':{'type':_0x437422,'resourceId':_0x19b95d['id']}})[_0x770b('0x17')](function(){return _0x391d96;});})[_0x770b('0x17')](function(){_0xecbfae[_0x770b('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x212820){return function(_0x5366bc){if(!_0x5366bc){_0x212820[_0x770b('0x2d')](0x194);}return _0x5366bc;};}function handleError(_0x11f705,_0x2f66f7){_0x2f66f7=_0x2f66f7||0x1f4;return function(_0x5d124b){logger[_0x770b('0x1c')](_0x5d124b['stack']);if(_0x5d124b[_0x770b('0x2e')]){delete _0x5d124b[_0x770b('0x2e')];}_0x11f705[_0x770b('0x21')](_0x2f66f7)[_0x770b('0x2f')](_0x5d124b);};}function createInteractionObject(_0x56f3bb,_0x23758d,_0x5f2563,_0xe3962c){var _0x2218e0=require(_0x770b('0x30'));var _0x3fa0a9=new _0x2218e0();var _0x4570c1=_0x3fa0a9['setUA'](_0x5f2563[_0x770b('0x31')])['getResult']();var _0x5a63e4=_0x23758d[_0x770b('0x32')];if(_0x5f2563['cf-connecting-ip']){_0x5a63e4=_0x5f2563[_0x770b('0x33')];}else if(_0x5f2563[_0x770b('0x34')]){_0x5a63e4=_[_0x770b('0x35')](_0x5f2563[_0x770b('0x34')][_0x770b('0x36')](','));}return{'ContactId':_0xe3962c['id'],'ChatWebsiteId':_0x56f3bb,'from':(_0xe3962c['firstName']||'')+'\x20'+(_0xe3962c[_0x770b('0x37')]||''),'customerIp':_0x5a63e4,'customerPort':_0x5f2563[_0x770b('0x38')]?_0x5f2563[_0x770b('0x38')]:null,'referer':_0x23758d['referer'],'browserName':_0x4570c1[_0x770b('0x39')]['name']&&_0x4570c1[_0x770b('0x39')][_0x770b('0x3a')]?util[_0x770b('0x3b')](_0x770b('0x3c'),_0x4570c1[_0x770b('0x39')][_0x770b('0x2e')],_0x4570c1[_0x770b('0x39')][_0x770b('0x3a')]):_0x770b('0x3d'),'browserVersion':_0x4570c1['browser'][_0x770b('0x3a')]||_0x770b('0x3d'),'osName':util[_0x770b('0x3b')]('%s\x20%s',_0x4570c1['os'][_0x770b('0x2e')],_0x4570c1['os'][_0x770b('0x3a')]),'osVersion':_0x4570c1['os'][_0x770b('0x3a')],'deviceModel':_0x4570c1[_0x770b('0x3e')][_0x770b('0x3f')]&&_0x4570c1[_0x770b('0x3e')][_0x770b('0x40')]?util['format'](_0x770b('0x41'),_0x4570c1['device'][_0x770b('0x3f')],_0x4570c1[_0x770b('0x3e')][_0x770b('0x40')],_0x4570c1[_0x770b('0x3e')][_0x770b('0x42')]):null,'deviceVendor':_0x4570c1[_0x770b('0x3e')][_0x770b('0x40')],'deviceType':_0x4570c1['device'][_0x770b('0x42')],'formData':JSON[_0x770b('0x1a')](_0x23758d)};}exports[_0x770b('0x43')]=function(_0x5ec2f5,_0x51c469){var _0x246231={'include':[{'model':db[_0x770b('0x44')],'as':_0x770b('0x45')}]},_0x29c641={},_0x153871={'count':0x0,'rows':[]};var _0x3f79db=_[_0x770b('0x46')](db[_0x770b('0x47')][_0x770b('0x48')],function(_0x339242){return{'name':_0x339242[_0x770b('0x49')],'type':_0x339242[_0x770b('0x42')][_0x770b('0x4a')]};});_0x29c641[_0x770b('0x3f')]=_[_0x770b('0x46')](_0x3f79db,_0x770b('0x2e'));_0x29c641[_0x770b('0x4b')]=_[_0x770b('0x4c')](_0x5ec2f5[_0x770b('0x4b')]);_0x29c641['filters']=_[_0x770b('0x4d')](_0x29c641['model'],_0x29c641[_0x770b('0x4b')]);_0x246231[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0x29c641['model'],qs['fields'](_0x5ec2f5[_0x770b('0x4b')][_0x770b('0x4f')]));_0x246231[_0x770b('0x4e')]=_0x246231['attributes']['length']?_0x246231[_0x770b('0x4e')]:_0x29c641[_0x770b('0x3f')];if(!_0x5ec2f5[_0x770b('0x4b')]['hasOwnProperty'](_0x770b('0x50'))){_0x246231[_0x770b('0x26')]=qs[_0x770b('0x26')](_0x5ec2f5[_0x770b('0x4b')]['limit']);_0x246231[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x5ec2f5[_0x770b('0x4b')][_0x770b('0x25')]);}_0x246231[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x5ec2f5['query'][_0x770b('0x52')]);_0x246231[_0x770b('0x53')]=qs['filters'](_[_0x770b('0x54')](_0x5ec2f5['query'],_0x29c641[_0x770b('0x55')]),_0x3f79db);if(_0x5ec2f5[_0x770b('0x4b')][_0x770b('0x56')]){_0x246231[_0x770b('0x53')]=_[_0x770b('0x57')](_0x246231[_0x770b('0x53')],{'$or':_[_0x770b('0x46')](_0x3f79db,function(_0x388fdd){if(_0x388fdd['type']!==_0x770b('0x58')){var _0x39ffce={};_0x39ffce[_0x388fdd['name']]={'$like':'%'+_0x5ec2f5['query'][_0x770b('0x56')]+'%'};return _0x39ffce;}})});}_0x246231=_[_0x770b('0x57')]({},_0x246231,_0x5ec2f5[_0x770b('0x59')]);var _0x2d1ae0={'where':_0x246231[_0x770b('0x53')]};return db[_0x770b('0x47')][_0x770b('0x24')](_0x2d1ae0)[_0x770b('0x17')](function(_0x3dd91c){_0x153871['count']=_0x3dd91c;if(_0x5ec2f5[_0x770b('0x4b')][_0x770b('0x5a')]){_0x246231[_0x770b('0x5b')]=[{'all':!![]}];}return db['ChatWebsite'][_0x770b('0x5c')](_0x246231);})[_0x770b('0x17')](function(_0x474d26){_0x153871[_0x770b('0x5d')]=_0x474d26;return _0x153871;})[_0x770b('0x17')](respondWithFilteredResult(_0x51c469,_0x246231))[_0x770b('0x1f')](handleError(_0x51c469,null));};exports[_0x770b('0x5e')]=function(_0x286511,_0x335d4f){var _0x5aac59={'raw':![],'where':{'id':_0x286511[_0x770b('0x5f')]['id']},'include':[{'model':db[_0x770b('0x44')],'as':_0x770b('0x45')}]},_0x17b406={};_0x17b406['model']=_[_0x770b('0x4c')](db[_0x770b('0x47')]['rawAttributes']);_0x17b406[_0x770b('0x4b')]=_[_0x770b('0x4c')](_0x286511['query']);_0x17b406[_0x770b('0x55')]=_[_0x770b('0x4d')](_0x17b406[_0x770b('0x3f')],_0x17b406[_0x770b('0x4b')]);_0x5aac59['attributes']=_['intersection'](_0x17b406[_0x770b('0x3f')],qs[_0x770b('0x4f')](_0x286511[_0x770b('0x4b')][_0x770b('0x4f')]));_0x5aac59[_0x770b('0x4e')]=_0x5aac59[_0x770b('0x4e')][_0x770b('0x60')]?_0x5aac59[_0x770b('0x4e')]:_0x17b406['model'];if(_0x286511[_0x770b('0x4b')][_0x770b('0x5a')]){_0x5aac59[_0x770b('0x5b')]=[{'all':!![]}];}_0x5aac59=_[_0x770b('0x57')]({},_0x5aac59,_0x286511[_0x770b('0x59')]);return db[_0x770b('0x47')][_0x770b('0x61')](_0x5aac59)[_0x770b('0x17')](handleEntityNotFound(_0x335d4f,null))[_0x770b('0x17')](respondWithResult(_0x335d4f,null))[_0x770b('0x1f')](handleError(_0x335d4f,null));};exports[_0x770b('0x62')]=function(_0x178211,_0x1c705f){var _0x39f114=null;_0x178211[_0x770b('0x63')][_0x770b('0x64')][_0x770b('0x36')](',')[_0x770b('0x65')](_0x29ef49=>{if(_0x29ef49[_0x770b('0x66')]()!==''&&!wildcardUtils[_0x770b('0x67')](_0x29ef49[_0x770b('0x66')]())){_0x39f114=new APIBadRequestError('\x22'+_0x29ef49+_0x770b('0x68'));}});if(_0x39f114){return handleError(_0x1c705f,null)(_0x39f114);}return db[_0x770b('0x47')][_0x770b('0x62')](_0x178211[_0x770b('0x63')],{})[_0x770b('0x17')](function(_0x546419){var _0x23698c=_0x178211['user'][_0x770b('0x2a')]({'plain':!![]});if(!_0x23698c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23698c[_0x770b('0x69')]===_0x770b('0x6a')){var _0x1fb7cd=_0x546419['get']({'plain':!![]});var _0x4455b4=_0x770b('0x2b');return db[_0x770b('0x6b')]['find']({'where':{'name':_0x4455b4,'userProfileId':_0x23698c[_0x770b('0x6c')]},'raw':!![]})[_0x770b('0x17')](function(_0xd43448){if(_0xd43448&&_0xd43448[_0x770b('0x6d')]===0x0){return db[_0x770b('0x2c')][_0x770b('0x62')]({'name':_0x1fb7cd['name'],'resourceId':_0x1fb7cd['id'],'type':_0xd43448['name'],'sectionId':_0xd43448['id']},{})['then'](function(){return _0x546419;});}else{return _0x546419;}})[_0x770b('0x1f')](function(_0x4b9200){logger['error'](_0x770b('0x6e'),_0x4b9200);throw _0x4b9200;});}return _0x546419;})['then'](respondWithResult(_0x1c705f,0xc9))['catch'](handleError(_0x1c705f,null));};exports[_0x770b('0x6f')]=function(_0x488210,_0x167864){var _0x20dbb1=null;_0x488210[_0x770b('0x63')]['address'][_0x770b('0x36')](',')[_0x770b('0x65')](_0x3cfcac=>{if(_0x3cfcac['trim']()!==''&&!wildcardUtils[_0x770b('0x67')](_0x3cfcac['trim']())){_0x20dbb1=new APIBadRequestError('\x22'+_0x3cfcac+_0x770b('0x68'));}});if(_0x20dbb1){return handleError(_0x167864,null)(_0x20dbb1);}if(_0x488210[_0x770b('0x63')]['id']){delete _0x488210['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x488210[_0x770b('0x5f')]['id']},'include':[{'model':db[_0x770b('0x44')],'as':_0x770b('0x45')}]})[_0x770b('0x17')](handleEntityNotFound(_0x167864,null))[_0x770b('0x17')](saveUpdates(_0x488210[_0x770b('0x63')],null))[_0x770b('0x17')](respondWithResult(_0x167864,null))[_0x770b('0x1f')](handleError(_0x167864,null));};exports['destroy']=function(_0x35c168,_0x5abf92){return db[_0x770b('0x47')]['find']({'where':{'id':_0x35c168[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x5abf92,null))[_0x770b('0x17')](removeEntity(_0x5abf92,null))[_0x770b('0x1f')](handleError(_0x5abf92,null));};exports[_0x770b('0x70')]=function(_0x1ae576,_0x40032d){return db['ChatWebsite']['describe']()[_0x770b('0x17')](respondWithResult(_0x40032d,null))['catch'](handleError(_0x40032d,null));};exports['addDisposition']=function(_0x2d9e42,_0x2e913a){if(_0x2d9e42[_0x770b('0x63')]['id']){delete _0x2d9e42[_0x770b('0x63')]['id'];}return db[_0x770b('0x47')][_0x770b('0x61')]({'where':{'id':_0x2d9e42[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2e913a,null))['then'](function(_0x47aad4){if(_0x47aad4){_0x2d9e42[_0x770b('0x63')][_0x770b('0x71')]=_0x47aad4['id'];return db['Disposition'][_0x770b('0x62')](_0x2d9e42[_0x770b('0x63')]);}})[_0x770b('0x17')](respondWithResult(_0x2e913a,null))[_0x770b('0x1f')](handleError(_0x2e913a,null));};exports[_0x770b('0x72')]=function(_0x208206,_0x35b16e){var _0x57deab={'raw':![],'where':{}};var _0x549812={};var _0x1170ff={'count':0x0,'rows':[]};return db[_0x770b('0x47')]['findOne']({'where':{'id':_0x208206[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x35b16e,null))[_0x770b('0x17')](function(_0x3b7eee){if(_0x3b7eee){_0x549812[_0x770b('0x3f')]=_[_0x770b('0x4c')](db[_0x770b('0x73')][_0x770b('0x48')]);_0x549812[_0x770b('0x4b')]=_[_0x770b('0x4c')](_0x208206[_0x770b('0x4b')]);_0x549812[_0x770b('0x55')]=_[_0x770b('0x4d')](_0x549812['model'],_0x549812['query']);_0x57deab[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0x549812['model'],qs[_0x770b('0x4f')](_0x208206[_0x770b('0x4b')][_0x770b('0x4f')]));_0x57deab[_0x770b('0x4e')]=_0x57deab[_0x770b('0x4e')]['length']?_0x57deab[_0x770b('0x4e')]:_0x549812[_0x770b('0x3f')];if(!_0x208206[_0x770b('0x4b')][_0x770b('0x74')](_0x770b('0x50'))){_0x57deab['limit']=qs[_0x770b('0x26')](_0x208206[_0x770b('0x4b')][_0x770b('0x26')]);_0x57deab[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x208206[_0x770b('0x4b')][_0x770b('0x25')]);}_0x57deab[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x208206[_0x770b('0x4b')]['sort']);_0x57deab[_0x770b('0x53')]=qs['filters'](_[_0x770b('0x54')](_0x208206['query'],_0x549812[_0x770b('0x55')]));_0x57deab['where'][_0x770b('0x71')]=_0x3b7eee['id'];if(_0x208206[_0x770b('0x4b')][_0x770b('0x56')]){_0x57deab['where']=_[_0x770b('0x57')](_0x57deab[_0x770b('0x53')],{'$or':_[_0x770b('0x46')](_0x57deab[_0x770b('0x4e')],function(_0x30b7de){var _0x581e12={};_0x581e12[_0x30b7de]={'$like':'%'+_0x208206[_0x770b('0x4b')]['filter']+'%'};return _0x581e12;})});}_0x57deab=_[_0x770b('0x57')]({},_0x57deab,_0x208206[_0x770b('0x59')]);return db[_0x770b('0x73')][_0x770b('0x24')]({'where':_0x57deab['where']})[_0x770b('0x17')](function(_0x4e0c00){_0x1170ff['count']=_0x4e0c00;if(_0x208206['query'][_0x770b('0x5a')]){_0x57deab[_0x770b('0x5b')]=[{'all':!![]}];}return db[_0x770b('0x73')]['findAll'](_0x57deab);})[_0x770b('0x17')](function(_0x579904){_0x1170ff[_0x770b('0x5d')]=_0x579904;return _0x1170ff;});}})['then'](respondWithFilteredResult(_0x35b16e,_0x57deab))[_0x770b('0x1f')](handleError(_0x35b16e,null));};exports['removeDispositions']=function(_0x20123b,_0x37c654){return db[_0x770b('0x47')]['find']({'where':{'id':_0x20123b['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x37c654,null))[_0x770b('0x17')](function(_0x3d4973){if(_0x3d4973){return _0x3d4973[_0x770b('0x75')](_0x20123b[_0x770b('0x4b')][_0x770b('0x76')]);}})[_0x770b('0x17')](respondWithStatusCode(_0x37c654,null))['catch'](handleError(_0x37c654,null));};exports[_0x770b('0x77')]=function(_0x649c69,_0x5cf3d5){if(_0x649c69[_0x770b('0x63')]['id']){delete _0x649c69[_0x770b('0x63')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x649c69[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x5cf3d5,null))[_0x770b('0x17')](function(_0x3fa6f2){if(_0x3fa6f2){_0x649c69[_0x770b('0x63')][_0x770b('0x71')]=_0x3fa6f2['id'];return db[_0x770b('0x78')][_0x770b('0x62')](_0x649c69[_0x770b('0x63')]);}})['then'](respondWithResult(_0x5cf3d5,null))[_0x770b('0x1f')](handleError(_0x5cf3d5,null));};exports[_0x770b('0x79')]=function(_0x5ee936,_0x4547ee){var _0x1fb01a={'raw':![],'where':{}};var _0x29dc55={};var _0x47bd16={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x770b('0x7a')]({'where':{'id':_0x5ee936['params']['id']}})['then'](handleEntityNotFound(_0x4547ee,null))[_0x770b('0x17')](function(_0x43f431){if(_0x43f431){_0x29dc55['model']=_[_0x770b('0x4c')](db[_0x770b('0x78')]['rawAttributes']);_0x29dc55['query']=_['keys'](_0x5ee936['query']);_0x29dc55[_0x770b('0x55')]=_[_0x770b('0x4d')](_0x29dc55[_0x770b('0x3f')],_0x29dc55['query']);_0x1fb01a['attributes']=_[_0x770b('0x4d')](_0x29dc55[_0x770b('0x3f')],qs['fields'](_0x5ee936['query'][_0x770b('0x4f')]));_0x1fb01a[_0x770b('0x4e')]=_0x1fb01a[_0x770b('0x4e')][_0x770b('0x60')]?_0x1fb01a[_0x770b('0x4e')]:_0x29dc55[_0x770b('0x3f')];if(!_0x5ee936[_0x770b('0x4b')]['hasOwnProperty'](_0x770b('0x50'))){_0x1fb01a[_0x770b('0x26')]=qs['limit'](_0x5ee936[_0x770b('0x4b')][_0x770b('0x26')]);_0x1fb01a[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x5ee936[_0x770b('0x4b')][_0x770b('0x25')]);}_0x1fb01a[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x5ee936['query'][_0x770b('0x52')]);_0x1fb01a[_0x770b('0x53')]=qs[_0x770b('0x55')](_[_0x770b('0x54')](_0x5ee936[_0x770b('0x4b')],_0x29dc55['filters']));_0x1fb01a[_0x770b('0x53')][_0x770b('0x71')]=_0x43f431['id'];if(_0x5ee936[_0x770b('0x4b')][_0x770b('0x56')]){_0x1fb01a['where']=_[_0x770b('0x57')](_0x1fb01a[_0x770b('0x53')],{'$or':_[_0x770b('0x46')](_0x1fb01a[_0x770b('0x4e')],function(_0xa235a3){var _0x16cb1a={};_0x16cb1a[_0xa235a3]={'$like':'%'+_0x5ee936[_0x770b('0x4b')][_0x770b('0x56')]+'%'};return _0x16cb1a;})});}_0x1fb01a=_['merge']({},_0x1fb01a,_0x5ee936['options']);return db[_0x770b('0x78')][_0x770b('0x24')]({'where':_0x1fb01a[_0x770b('0x53')]})[_0x770b('0x17')](function(_0x47cb81){_0x47bd16['count']=_0x47cb81;if(_0x5ee936[_0x770b('0x4b')][_0x770b('0x5a')]){_0x1fb01a[_0x770b('0x5b')]=[{'all':!![]}];}return db[_0x770b('0x78')][_0x770b('0x5c')](_0x1fb01a);})['then'](function(_0x51c44c){_0x47bd16[_0x770b('0x5d')]=_0x51c44c;return _0x47bd16;});}})[_0x770b('0x17')](respondWithFilteredResult(_0x4547ee,_0x1fb01a))[_0x770b('0x1f')](handleError(_0x4547ee,null));};exports[_0x770b('0x7b')]=function(_0x2280fc,_0x3e2491){return db['ChatWebsite'][_0x770b('0x61')]({'where':{'id':_0x2280fc[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x3e2491,null))[_0x770b('0x17')](function(_0x12eff6){if(_0x12eff6){return _0x12eff6[_0x770b('0x7b')](_0x2280fc['query'][_0x770b('0x76')]);}})[_0x770b('0x17')](respondWithStatusCode(_0x3e2491,null))[_0x770b('0x1f')](handleError(_0x3e2491,null));};exports[_0x770b('0x7c')]=function(_0x3c89d6,_0x411f8c){_0x3c89d6[_0x770b('0x63')][_0x770b('0x7d')]=_0x3c89d6[_0x770b('0x7e')][_0x770b('0x7f')];return db[_0x770b('0x47')][_0x770b('0x61')]({'where':{'id':_0x3c89d6['params']['id']}})['then'](handleEntityNotFound(_0x411f8c,null))['then'](saveUpdates(_0x3c89d6['body'],null))['then'](respondWithResult(_0x411f8c,null))[_0x770b('0x1f')](handleError(_0x411f8c,null));};exports[_0x770b('0x80')]=function(_0x21e8a7,_0x3de568){_0x21e8a7[_0x770b('0x63')][_0x770b('0x81')]=_0x21e8a7[_0x770b('0x7e')][_0x770b('0x7f')];return db[_0x770b('0x47')]['find']({'where':{'id':_0x21e8a7['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x3de568,null))[_0x770b('0x17')](saveUpdates(_0x21e8a7[_0x770b('0x63')],null))[_0x770b('0x17')](respondWithResult(_0x3de568,null))[_0x770b('0x1f')](handleError(_0x3de568,null));};exports[_0x770b('0x82')]=function(_0x41be44,_0x591590){_0x41be44['body'][_0x770b('0x83')]=_0x41be44[_0x770b('0x7e')]['filename'];return db[_0x770b('0x47')][_0x770b('0x61')]({'where':{'id':_0x41be44[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x591590,null))[_0x770b('0x17')](saveUpdates(_0x41be44[_0x770b('0x63')],null))[_0x770b('0x17')](respondWithResult(_0x591590,null))[_0x770b('0x1f')](handleError(_0x591590,null));};exports['addSystemAvatar']=function(_0x164c79,_0x35d81e){_0x164c79[_0x770b('0x63')][_0x770b('0x84')]=_0x164c79[_0x770b('0x7e')][_0x770b('0x7f')];return db['ChatWebsite']['find']({'where':{'id':_0x164c79[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x35d81e,null))[_0x770b('0x17')](saveUpdates(_0x164c79['body'],null))[_0x770b('0x17')](respondWithResult(_0x35d81e,null))['catch'](handleError(_0x35d81e,null));};exports[_0x770b('0x85')]=function(_0xe749fc,_0x2e6b4c){var _0x3179ff=path['join'](config[_0x770b('0x86')],_0x770b('0x87'));var _0xc699f2={'where':{'id':_0xe749fc[_0x770b('0x5f')]['id']},'attributes':['id',_0x770b('0x7d')],'raw':!![]};var _0x3bc7b6=![];return require('../../config/license/util')[_0x770b('0x88')]()['then'](function(_0x532ed0){if(_0x532ed0){_0x3bc7b6=_0x532ed0[_0x770b('0x89')];}})[_0x770b('0x17')](function(){return db['ChatWebsite'][_0x770b('0x61')](_0xc699f2);})[_0x770b('0x17')](handleEntityNotFound(_0x2e6b4c,null))[_0x770b('0x17')](function(_0x3c4fc5){if(_0x3c4fc5){if(!_['isNil'](_0x3c4fc5[_0x770b('0x7d')])){if(fs[_0x770b('0x8a')](path[_0x770b('0x8b')](config[_0x770b('0x86')],_0x770b('0x8c'),_0x3c4fc5['sitepic']))&&_0x3bc7b6){_0x3179ff=path['join'](config[_0x770b('0x86')],'server/files/images/logos/',_0x3c4fc5[_0x770b('0x7d')]);}}return _0x2e6b4c[_0x770b('0x8d')](_0x3179ff);}})[_0x770b('0x1f')](handleError(_0x2e6b4c,null));};exports[_0x770b('0x8e')]=function(_0x214635,_0x2688ec){var _0x5e8a3d=path[_0x770b('0x8b')](config[_0x770b('0x86')],'server/files/images/avatars/default_avatar.png');var _0x171da5={'where':{'id':_0x214635[_0x770b('0x5f')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x770b('0x47')][_0x770b('0x61')](_0x171da5)['then'](handleEntityNotFound(_0x2688ec,null))[_0x770b('0x17')](function(_0x4b5a30){if(_0x4b5a30){if(!_[_0x770b('0x8f')](_0x4b5a30[_0x770b('0x81')])){if(fs[_0x770b('0x8a')](path['join'](config[_0x770b('0x86')],_0x770b('0x90'),_0x4b5a30[_0x770b('0x81')]))){_0x5e8a3d=path[_0x770b('0x8b')](config[_0x770b('0x86')],'server/files/images/avatars/',_0x4b5a30[_0x770b('0x81')]);}}return _0x2688ec['download'](_0x5e8a3d);}})[_0x770b('0x1f')](handleError(_0x2688ec,null));};exports[_0x770b('0x91')]=function(_0x239f16,_0x46e510){var _0x4678fd=path['join'](config[_0x770b('0x86')],_0x770b('0x92'));var _0x1eb60d={'where':{'id':_0x239f16['params']['id']},'attributes':['id',_0x770b('0x83'),_0x770b('0x93')],'raw':!![]};return db[_0x770b('0x47')]['find'](_0x1eb60d)[_0x770b('0x17')](handleEntityNotFound(_0x46e510,null))[_0x770b('0x17')](function(_0x12782c){if(_0x12782c){if(!_[_0x770b('0x8f')](_0x12782c[_0x770b('0x83')])){if(fs['existsSync'](path[_0x770b('0x8b')](config[_0x770b('0x86')],'server/files/images/avatars/',_0x12782c['customerAvatar']))&&_0x12782c[_0x770b('0x93')]){_0x4678fd=path['join'](config['root'],_0x770b('0x90'),_0x12782c[_0x770b('0x83')]);}}return _0x46e510['download'](_0x4678fd);}})[_0x770b('0x1f')](handleError(_0x46e510,null));};exports['getSystemAvatar']=function(_0x4497da,_0x52a2f1){var _0x183307=path[_0x770b('0x8b')](config[_0x770b('0x86')],_0x770b('0x94'));var _0x4341ec={'where':{'id':_0x4497da[_0x770b('0x5f')]['id']},'attributes':['id',_0x770b('0x84')],'raw':!![]};return db[_0x770b('0x47')][_0x770b('0x61')](_0x4341ec)[_0x770b('0x17')](handleEntityNotFound(_0x52a2f1,null))[_0x770b('0x17')](function(_0xa7d806){if(_0xa7d806){if(!_[_0x770b('0x8f')](_0xa7d806[_0x770b('0x84')])){if(fs[_0x770b('0x8a')](path[_0x770b('0x8b')](config[_0x770b('0x86')],'server/files/images/avatars/',_0xa7d806[_0x770b('0x84')]))){_0x183307=path[_0x770b('0x8b')](config[_0x770b('0x86')],_0x770b('0x90'),_0xa7d806[_0x770b('0x84')]);}}return _0x52a2f1[_0x770b('0x8d')](_0x183307);}})[_0x770b('0x1f')](handleError(_0x52a2f1,null));};function checkWebsiteInterval(_0x3ab3f3){var _0x44aa6e=_0x3ab3f3[_0x770b('0x95')];if(!_0x44aa6e){return Promise[_0x770b('0x96')](_0x3ab3f3);}var _0x28d249=_0x3ab3f3[_0x770b('0x97')]||undefined;return _0x44aa6e[_0x770b('0x98')](_0x28d249)[_0x770b('0x17')](function(_0x3ec1e2){if(!_0x3ec1e2){throw new APIOutOfIntervalError();}return _0x3ab3f3;});}exports['notify']=function(_0x1eac15,_0x15a79f){var _0x5b2298={'body':_0x1eac15[_0x770b('0x63')],'channel':_0x770b('0x99')};var _0x3b4927=[];var _0x140f24=[];var _0x1db4db={};var _0x3ec703=![];if(_0x1eac15[_0x770b('0x63')]['id']){delete _0x1eac15[_0x770b('0x63')]['id'];}if(_[_0x770b('0x8f')](_0x1eac15['body']['from'])){throw new APIBadRequestError(_0x770b('0x9a'));}if(_['isNil'](_0x1eac15[_0x770b('0x63')][_0x770b('0x9b')])){throw new APIBadRequestError(_0x770b('0x9c'));}if(_[_0x770b('0x9d')](_0x1eac15[_0x770b('0x63')][_0x770b('0x63')])){throw new APIBadRequestError(_0x770b('0x9e'));}var _0x355591=_0x1eac15[_0x770b('0x63')]['customerIp']&&_0x1eac15[_0x770b('0x63')][_0x770b('0x9f')];return db[_0x770b('0xa0')]['describe']()[_0x770b('0x17')](function(_0x4337a9){if(!_0x4337a9){throw new Error('No\x20available\x20attributes');}_0x3b4927=Object[_0x770b('0x4c')](_0x4337a9)['filter'](function(_0xdf9f76){return![_0x770b('0xa1'),'updatedAt'][_0x770b('0xa2')](_0xdf9f76);});_0x140f24=Object[_0x770b('0x4c')](_0x4337a9)[_0x770b('0x56')](function(_0xa12024){return![_0x770b('0xa1'),_0x770b('0xa3'),'CompanyId',_0x770b('0xa4')][_0x770b('0xa2')](_0xa12024);});if(!_[_0x770b('0xa2')](_0x140f24,_0x1eac15[_0x770b('0x63')][_0x770b('0x9b')])){throw new APIBadRequestError(_0x770b('0xa5')+_0x140f24[_0x770b('0x8b')](',\x20'));}_0x1db4db[_0x1eac15[_0x770b('0x63')][_0x770b('0x9b')]]=_0x1eac15['body'][_0x770b('0xa6')];})[_0x770b('0x17')](function(){return db[_0x770b('0x47')]['find']({'where':{'id':_0x1eac15[_0x770b('0x5f')]['id']},'include':[{'model':db[_0x770b('0xa7')],'as':'List','include':[{'model':db[_0x770b('0xa0')],'as':_0x770b('0xa8'),'where':_0x1db4db,'limit':0x1,'order':[[_0x770b('0xa3'),_0x770b('0xa9')]]}]},{'model':db[_0x770b('0xaa')],'as':'Applications'},{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0x770b('0xab'),'attributes':['id','interval'],'raw':!![]}]}]});})[_0x770b('0x17')](function(_0x59cffc){if(!_0x59cffc){throw new APINotFoundError(util[_0x770b('0x3b')](_0x770b('0xac'),_0x1eac15[_0x770b('0x5f')]['id']));}if(_0x355591){return checkWebsiteInterval(_0x59cffc);}return _0x59cffc;})['then'](function(_0x37e80d){_0x5b2298[_0x770b('0xad')]=_0x37e80d;_0x5b2298['applications']=_[_0x770b('0xae')](_0x37e80d[_0x770b('0xaf')],['priority'],[_0x770b('0xb0')]);if(_0x5b2298['account'][_0x770b('0xaf')]){delete _0x5b2298[_0x770b('0xad')][_0x770b('0xaf')];}_0x5b2298[_0x770b('0xb1')]=_0x37e80d[_0x770b('0xb2')]||{'id':_0x37e80d[_0x770b('0xa4')]};if(_0x5b2298['list']&&_0x5b2298[_0x770b('0xb1')][_0x770b('0xa8')][_0x770b('0x60')]){return _0x5b2298[_0x770b('0xb1')][_0x770b('0xa8')][0x0];}var _0x17624b=_[_0x770b('0xf')](_0x1eac15[_0x770b('0x63')],{'firstName':_0x1eac15['body']['from'],'ListId':_0x37e80d[_0x770b('0xa4')]});_0x17624b[_0x1eac15[_0x770b('0x63')][_0x770b('0x9b')]]=_0x1eac15[_0x770b('0x63')][_0x770b('0xa6')];return db[_0x770b('0xa0')][_0x770b('0x62')](_0x17624b,{'fields':_0x3b4927,'raw':!![]});})[_0x770b('0x17')](function(_0x4ee6be){_0x5b2298[_0x770b('0xb3')]=_0x4ee6be;var _0x324bce=createInteractionObject(_0x1eac15[_0x770b('0x5f')]['id'],_0x1eac15[_0x770b('0x63')],_0x1eac15[_0x770b('0xb4')],_0x4ee6be);var _0x12d1b2={'ChatWebsiteId':_0x1eac15[_0x770b('0x5f')]['id']};if(_0x1eac15[_0x770b('0x63')][_0x770b('0xb5')]){_0x12d1b2['threadId']=_0x1eac15[_0x770b('0x63')]['threadId'];_0x12d1b2[_0x770b('0xb6')]=![];return db[_0x770b('0xb7')][_0x770b('0x61')]({'where':_0x12d1b2})['then'](function(_0x18ae42){var _0x5fbdd1=_0x1eac15['body'][_0x770b('0x32')]&&_0x1eac15['body'][_0x770b('0x9f')];if(_0x18ae42){_0x3ec703=!![];return _0x18ae42;}else if(!_0x5fbdd1&&_0x18ae42&&_0x18ae42[_0x770b('0xb6')]){throw new APIConflictError(_0x770b('0xb8'));}_0x324bce[_0x770b('0xb5')]=_0x1eac15[_0x770b('0x63')][_0x770b('0xb5')];_0x324bce['externalUrl']=_0x1eac15[_0x770b('0x63')][_0x770b('0xb9')];return db['ChatInteraction'][_0x770b('0x62')](_0x324bce);});}_0x12d1b2[_0x770b('0xba')]=_0x4ee6be['id'];if(_0x1eac15[_0x770b('0x63')][_0x770b('0xbb')]&&_0x1eac15[_0x770b('0x63')]['interaction']['id']){_0x12d1b2['id']=_0x1eac15[_0x770b('0x63')][_0x770b('0xbb')]['id'];return db[_0x770b('0xb7')][_0x770b('0x61')]({'where':_0x12d1b2})[_0x770b('0x17')](function(_0x1f3c40){var _0x47be83=_0x1eac15['body'][_0x770b('0x32')]&&_0x1eac15[_0x770b('0x63')]['referer'];if(!_0x47be83&&_0x1f3c40&&_0x1f3c40[_0x770b('0xb6')]){throw new APIConflictError(_0x770b('0xb8'));}else if(_0x1f3c40){_0x3ec703=!![];return _0x1f3c40;}else{return db[_0x770b('0xb7')][_0x770b('0x62')](_0x324bce);}});}return db[_0x770b('0xb7')][_0x770b('0x62')](_0x324bce);})[_0x770b('0x17')](function(_0x40d1a6){if(!_0x3ec703){return _0x40d1a6;}var _0x42f080={'from':(_0x5b2298['contact'][_0x770b('0xbc')]||'')+'\x20'+(_0x5b2298[_0x770b('0xb3')]['lastName']||'')};if(_0x1eac15[_0x770b('0x63')][_0x770b('0xb5')]&&_0x1eac15['body'][_0x770b('0xbd')]&&_0x1eac15[_0x770b('0x63')][_0x770b('0xb5')]!=_0x1eac15[_0x770b('0x63')][_0x770b('0xbd')]){_0x42f080[_0x770b('0xb5')]=_0x1eac15[_0x770b('0x63')][_0x770b('0xbd')];}return _0x40d1a6[_0x770b('0x6f')](_0x42f080);})[_0x770b('0x17')](function(_0x292a1d){_0x5b2298[_0x770b('0xbb')]=_0x292a1d[_0x770b('0x2a')]({'plain':!![]});_0x5b2298[_0x770b('0xbb')]['created']=!_0x3ec703;if(_0x5b2298[_0x770b('0xbb')][_0x770b('0xbe')]){if(_0x5b2298[_0x770b('0xad')][_0x770b('0xbf')]){_0x5b2298[_0x770b('0xc0')]['push']({'id':0x0,'priority':_0x5b2298[_0x770b('0xc0')]['length']+0x1,'app':_0x770b('0xc1'),'appdata':_0x770b('0xc2'),'interval':_0x770b('0xc3')});}}return db[_0x770b('0xc4')][_0x770b('0x62')]({'body':_0x1eac15[_0x770b('0x63')][_0x770b('0x63')],'ChatWebsiteId':_0x1eac15['params']['id'],'ChatInteractionId':_0x292a1d['id'],'direction':'in','ContactId':_0x5b2298['contact']['id'],'AttachmentId':_0x1eac15[_0x770b('0x63')][_0x770b('0xc5')]});})['then'](function(_0x128d73){_0x5b2298['message']=_0x128d73;if(!_0x5b2298[_0x770b('0xbb')]['UserId']){return;}return db[_0x770b('0xc6')][_0x770b('0x61')]({'attributes':['id','name'],'where':{'id':_0x5b2298['interaction'][_0x770b('0xc7')]}});})[_0x770b('0x17')](function(_0x1a0d9a){if(_0x1a0d9a){_0x5b2298[_0x770b('0xc0')][_0x770b('0xc8')]({'id':0x0,'priority':0x0,'app':_0x770b('0xc9'),'appdata':_0x1a0d9a['name']+','+(_0x5b2298['account'][_0x770b('0xca')]||0xa),'interval':_0x770b('0xc3')});_0x5b2298[_0x770b('0xcb')]=!![];}if(!_0x5b2298[_0x770b('0xbb')][_0x770b('0xcc')]){return;}return db[_0x770b('0xcd')][_0x770b('0x61')]({'attributes':['id',_0x770b('0x2e')],'where':{'id':_0x5b2298['interaction'][_0x770b('0xcc')]}});})[_0x770b('0x17')](function(_0x5c6715){if(_0x5c6715){_0x5b2298[_0x770b('0xc0')][_0x770b('0xc8')]({'id':0x0,'priority':0x1,'app':_0x770b('0xce'),'appdata':_0x5c6715[_0x770b('0x2e')]+','+(_0x5b2298['account'][_0x770b('0xcf')]||0x12c),'interval':_0x770b('0xc3')});}return respondWithRpcPromise(_0x770b('0xd0'),_0x770b('0xd1'),_0x5b2298);})[_0x770b('0x17')](function(_0x17225c){respondWithRpcPromise(_0x770b('0xd2'),_0x770b('0xd2'),{'event':'notify','message':_0x17225c},client9002);return _0x17225c;})[_0x770b('0x17')](respondWithResult(_0x15a79f,null))['catch'](APIHandleError(_0x15a79f));};exports[_0x770b('0xd3')]=function(_0xab78db,_0x261c4e){var _0x22fc8b,_0x4ddd8c,_0x58dd4;var _0x483c64=[];var _0xd548ef={};var _0x5e94e9=_0xab78db[_0x770b('0xd4')]||[];var _0x422287=[];var _0x17603;return db['CmContact']['describe']()['then'](function(_0x42ab1a){if(!_0x42ab1a){throw new db['Sequelize'][(_0x770b('0xd5'))](_0x770b('0xd6'));}_0x483c64=_['difference'](_[_0x770b('0x4c')](_0x42ab1a),[_0x770b('0xa1'),_0x770b('0xa3'),'CompanyId',_0x770b('0xa4')]);if(_0xab78db[_0x770b('0x63')]['id']){delete _0xab78db['body']['id'];}if(_['isNil'](_0xab78db[_0x770b('0x63')][_0x770b('0xa6')])){throw _0x261c4e[_0x770b('0x21')](0x1f4)[_0x770b('0x2f')](new db[(_0x770b('0xd7'))]['ValidationError'](_0x770b('0xd8')));}if(_[_0x770b('0x8f')](_0xab78db[_0x770b('0x63')]['body'])||_0xab78db['body'][_0x770b('0x63')]===''){throw _0x261c4e['status'](0x1f4)[_0x770b('0x2f')](new db[(_0x770b('0xd7'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x770b('0x8f')](_0xab78db[_0x770b('0x63')][_0x770b('0xd9')])){throw _0x261c4e[_0x770b('0x21')](0x1f4)[_0x770b('0x2f')](new db[(_0x770b('0xd7'))][(_0x770b('0xd5'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x483c64));}if(!_[_0x770b('0xa2')](_0x483c64,_0xab78db['body'][_0x770b('0xd9')])){throw _0x261c4e[_0x770b('0x21')](0x1f4)['send'](new db[(_0x770b('0xd7'))][(_0x770b('0xd5'))](_0x770b('0xda')+_0x483c64));}_0xd548ef[_0xab78db[_0x770b('0x63')][_0x770b('0xd9')]]=_0xab78db[_0x770b('0x63')][_0x770b('0xa6')];})[_0x770b('0x17')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xab78db[_0x770b('0x5f')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x770b('0xdb')],'as':_0x770b('0xdb')}]});})[_0x770b('0x17')](handleEntityNotFound(_0x261c4e,null))[_0x770b('0x17')](function(_0x362122){if(_0x362122&&_0x362122[_0x770b('0xb2')]){_0x4ddd8c=_0x362122;var _0x553f72=_[_0x770b('0xf')](_0xab78db[_0x770b('0x63')],{'firstName':_0xab78db['body'][_0x770b('0xa6')],'phone':_0xab78db[_0x770b('0x63')]['from'],'ListId':_0x362122[_0x770b('0xa4')]});_0x553f72[_0xab78db[_0x770b('0x63')][_0x770b('0xd9')]]=_0xab78db[_0x770b('0x63')][_0x770b('0xa6')];return db[_0x770b('0xa0')][_0x770b('0xdc')]({'where':_0xd548ef,'defaults':_0x553f72});}})[_0x770b('0xdd')](function(_0x18db6b){if(_0x18db6b){_0x58dd4=_0x18db6b;var _0x1991cf=fs['readFileSync'](path[_0x770b('0x8b')](config[_0x770b('0x86')],_0x770b('0xde')),'utf8');var _0x406e32=ejs[_0x770b('0xdf')](_0x1991cf,{'body':_[_0x770b('0xe0')](_0xab78db['body'][_0x770b('0x63')]),'bodyTitle':_0x4ddd8c[_0x770b('0xe1')]});return db['ChatOfflineMessage'][_0x770b('0x62')]({'body':_0x406e32,'plainBody':htmlToText[_0x770b('0xe2')](_0x406e32),'ContactId':_0x18db6b['id'],'ChatWebsiteId':_0x4ddd8c['id']});}})['then'](function(_0x40cadc){_0x17603=_0x40cadc;if(_0x5e94e9[_0x770b('0x60')]){var _0x10dbcf=_0x5e94e9[_0x770b('0x46')](function(_0x16e840){return{'name':_0x16e840[_0x770b('0xe3')],'basename':_0x16e840[_0x770b('0x7f')],'type':_0x16e840[_0x770b('0xe4')],'ChatOfflineMessageId':_0x40cadc['id']};});_0x422287=_0x10dbcf[_0x770b('0x46')](_0x27757e=>{var _0x12f4d5={'filename':_0x27757e[_0x770b('0x2e')],'path':path['join'](config[_0x770b('0x86')],'server',_0x770b('0xd4'),_0x770b('0xe5'),_0x770b('0xe6'),_0x27757e[_0x770b('0xe7')])};return _0x12f4d5;});if(!_0x4ddd8c['openNewInteraction']){return db['sequelize'][_0x770b('0xe8')](function(_0x34aafb){return db[_0x770b('0xe9')][_0x770b('0xea')](_0x10dbcf,{'transaction':_0x34aafb});});}}})[_0x770b('0x17')](function(){if(_0x17603){_0x22fc8b=_0x17603;return db[_0x770b('0xdb')][_0x770b('0x7a')]({'where':{'service':!![]},'include':[{'model':db[_0x770b('0xeb')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x770b('0xec'),'raw':!![]}]}]});}})[_0x770b('0x17')](function(_0x207c76){if(_0x207c76&&_0x207c76[_0x770b('0xed')]&&_0x4ddd8c['forwardOffline']&&_0x4ddd8c['forwardOfflineAddress']){var _0x58af60=_0x207c76[_0x770b('0xee')]();return respondWithRpcPromise(_0x770b('0xef'),_0x770b('0xf0'),{'account':_0x58af60,'message':{'from':util[_0x770b('0x3b')](_0x770b('0xf1'),_0x207c76['name'],_0x207c76[_0x770b('0xf2')]||_0x207c76['Smtp'][_0x770b('0x6a')]),'to':_0x4ddd8c[_0x770b('0xf3')],'subject':_0x4ddd8c[_0x770b('0xf4')],'html':_0x22fc8b[_0x770b('0x63')],'attachments':_0x422287}},client9003)[_0x770b('0x17')](function(){return _0x22fc8b;})[_0x770b('0x1f')](function(_0x3e4062){logger[_0x770b('0x1c')](_0x3e4062);});}})[_0x770b('0x17')](function(){if(_0x4ddd8c&&_0x4ddd8c[_0x770b('0xf5')]&&_0x4ddd8c[_0x770b('0xf6')]){var _0x5a0d8e=[];if(_0x5e94e9[_0x770b('0x60')]){_0x5a0d8e=_0x5e94e9[_0x770b('0x46')](function(_0xa7ffd){return{'name':_0xa7ffd[_0x770b('0xe3')],'basename':_0xa7ffd['filename'],'type':_0xa7ffd[_0x770b('0xe4')],'ChatOfflineMessageId':_0x17603['id']};});}var _0x18382e;if(!_[_0x770b('0x8f')](_0x4ddd8c['subjectOffline'])){var _0x2b779d=_['map'](_0xab78db['body'],function(_0x3fa168){return _0x3fa168;});var _0x1edb5f=_['toPairsIn'](_0x2b779d)[0x0];var _0x290161=_[_0x770b('0xf7')](_0x1edb5f,function(_0x16ec0d){return _0x16ec0d;});_0x18382e=_0x290161[0x1][_0x4ddd8c[_0x770b('0xf8')]];}var _0x43fca9={'from':_0x58dd4['email'],'firstName':_0x58dd4[_0x770b('0xbc')],'lastName':_0x58dd4[_0x770b('0x37')],'mapKey':'email','message':{'from':_0x58dd4[_0x770b('0xf2')],'to':_0x4ddd8c[_0x770b('0xdb')][_0x770b('0xf2')],'cc':'','subject':_[_0x770b('0x8f')](_0x18382e)?_0x4ddd8c[_0x770b('0xf4')]:_0x18382e,'messageId':'','sentAt':new Date(),'attach':_0x5a0d8e[_0x770b('0x60')],'attachments':_0x5a0d8e,'originChannel':_0x770b('0xf9'),'ChatWebsiteId':_0x4ddd8c['id'],'ChatOfflineMessageId':_0x22fc8b['id'],'originTo':_0x4ddd8c['MailAccount'][_0x770b('0xf2')]},'body':_0x22fc8b[_0x770b('0x63')]};var _0x48c40f={'account':{'id':_0x4ddd8c[_0x770b('0xf6')]},'body':_0x43fca9,'log':_0x770b('0xfa')};return respondWithRpcPromise(_0x770b('0xfa'),_0x770b('0xfb'),_0x48c40f,client9001)[_0x770b('0x17')](function(){return _0x22fc8b;})['catch'](function(_0x18c26c){logger[_0x770b('0x1c')](_0x18c26c);});}return;})['then'](function(){if(_0x22fc8b){return _0x22fc8b;}})[_0x770b('0x17')](respondWithResult(_0x261c4e,null))[_0x770b('0x1f')](function(){for(var _0xb48fa4 of _0x5e94e9){var _0x2a6b41=path[_0x770b('0x8b')](config[_0x770b('0x86')],'server','files','attachments','offline-chat',_0xb48fa4['filename']);fs_extra['remove'](_0x2a6b41)[_0x770b('0x1f')](function(_0x47b6cb){logger[_0x770b('0x1c')](_0x770b('0xfc'),_0x2a6b41,_0x47b6cb);});}});};exports[_0x770b('0xfd')]=function(_0x6c4248,_0x1286df){return db['ChatInteraction'][_0x770b('0x61')]({'where':{'id':_0x6c4248[_0x770b('0x5f')]['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x1286df,null))[_0x770b('0x17')](function(_0x29759c){if(_0x29759c){return _0x29759c[_0x770b('0xfd')](_0x6c4248['body'][_0x770b('0x76')],_[_0x770b('0xfe')](_0x6c4248['body'],[_0x770b('0x76'),'id'])||{});}})[_0x770b('0x17')](respondWithResult(_0x1286df,null))['catch'](handleError(_0x1286df,null));};exports[_0x770b('0xff')]=function(_0x28d4da,_0x238b02){var _0x4ba567={'raw':![],'where':{}};var _0x4764c2={};var _0xa65c52={'count':0x0,'rows':[]};return db[_0x770b('0x47')][_0x770b('0x7a')]({'where':{'id':_0x28d4da[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x238b02,null))[_0x770b('0x17')](function(_0xb60638){if(_0xb60638){_0x4764c2[_0x770b('0x3f')]=_['keys'](db[_0x770b('0xb7')][_0x770b('0x48')]);_0x4764c2[_0x770b('0x4b')]=_[_0x770b('0x4c')](_0x28d4da[_0x770b('0x4b')]);_0x4764c2['filters']=_['intersection'](_0x4764c2[_0x770b('0x3f')],_0x4764c2[_0x770b('0x4b')]);_0x4ba567[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0x4764c2['model'],qs[_0x770b('0x4f')](_0x28d4da[_0x770b('0x4b')][_0x770b('0x4f')]));_0x4ba567['attributes']=_0x4ba567[_0x770b('0x4e')][_0x770b('0x60')]?_0x4ba567['attributes']:_0x4764c2[_0x770b('0x3f')];if(!_0x28d4da[_0x770b('0x4b')][_0x770b('0x74')](_0x770b('0x50'))){_0x4ba567[_0x770b('0x26')]=qs[_0x770b('0x26')](_0x28d4da[_0x770b('0x4b')][_0x770b('0x26')]);_0x4ba567[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x28d4da[_0x770b('0x4b')][_0x770b('0x25')]);}_0x4ba567[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x28d4da['query'][_0x770b('0x52')]);_0x4ba567[_0x770b('0x53')]=qs['filters'](_[_0x770b('0x54')](_0x28d4da['query'],_0x4764c2[_0x770b('0x55')]));_0x4ba567[_0x770b('0x53')][_0x770b('0x71')]=_0xb60638['id'];if(_0x28d4da[_0x770b('0x4b')]['filter']){_0x4ba567[_0x770b('0x53')]=_[_0x770b('0x57')](_0x4ba567['where'],{'$or':_['map'](_0x4ba567[_0x770b('0x4e')],function(_0x4a6a76){var _0x28b726={};_0x28b726[_0x4a6a76]={'$like':'%'+_0x28d4da[_0x770b('0x4b')][_0x770b('0x56')]+'%'};return _0x28b726;})});}_0x4ba567=_[_0x770b('0x57')]({},_0x4ba567,_0x28d4da[_0x770b('0x59')]);return db[_0x770b('0xb7')][_0x770b('0x24')]({'where':_0x4ba567[_0x770b('0x53')]})[_0x770b('0x17')](function(_0x37957f){_0xa65c52[_0x770b('0x24')]=_0x37957f;if(_0x28d4da[_0x770b('0x4b')][_0x770b('0x5a')]){_0x4ba567[_0x770b('0x5b')]=[{'model':db[_0x770b('0xa0')],'as':_0x770b('0x100'),'required':![]},{'model':db['User'],'as':_0x770b('0x101'),'attributes':[_0x770b('0x2e'),_0x770b('0x102'),'internal'],'required':![]},{'model':db[_0x770b('0x103')],'as':'Tags','attributes':['id','name',_0x770b('0x104')],'where':_0x28d4da[_0x770b('0x4b')][_0x770b('0x105')]?{'id':_0x28d4da[_0x770b('0x4b')][_0x770b('0x105')]}:undefined,'required':_0x28d4da['query']['tag']?!![]:![]}];}return db['ChatInteraction'][_0x770b('0x5c')](_0x4ba567);})[_0x770b('0x17')](function(_0x677747){_0xa65c52[_0x770b('0x5d')]=_0x677747;return _0xa65c52;});}})[_0x770b('0x17')](respondWithFilteredResult(_0x238b02,_0x4ba567))[_0x770b('0x1f')](handleError(_0x238b02,null));};exports[_0x770b('0x106')]=function(_0x3b8e69,_0x3b607e){var _0x1eab9b=0x0;var _0x369ffd=0x0;var _0x547159=![];var _0x480697;var _0x5c6a3a;return db[_0x770b('0x47')][_0x770b('0x61')]({'where':{'id':_0x3b8e69[_0x770b('0x5f')]['id']},'include':[{'model':db[_0x770b('0x95')],'as':_0x770b('0x95'),'include':[{'model':db[_0x770b('0x95')],'as':_0x770b('0xab'),'attributes':['id',_0x770b('0x107')]}]}]})[_0x770b('0x17')](handleEntityNotFound(_0x3b607e,null))[_0x770b('0x17')](function(_0x1c682f){if(_0x1c682f){_0x480697=_0x1c682f;return _0x1c682f[_0x770b('0x108')]({'raw':!![]});}})[_0x770b('0x17')](function(_0x117640){if(_0x480697){if(_0x117640){_0x5c6a3a=_0x117640;}}return require(_0x770b('0x109'))[_0x770b('0x88')]();})[_0x770b('0x17')](function(_0x4ccc40){if(_0x4ccc40){_0x369ffd=_0x4ccc40[_0x770b('0x10a')];_0x547159=_0x4ccc40[_0x770b('0x89')];}})[_0x770b('0x17')](function(){return db[_0x770b('0xb7')][_0x770b('0x24')]({'where':{'closed':![]}});})[_0x770b('0x17')](function(_0x543610){_0x1eab9b=_0x543610;if(_0x369ffd&&_0x543610>_0x369ffd){return db[_0x770b('0x10b')][_0x770b('0x7a')]({'where':{'id':0x1}})[_0x770b('0x17')](function(_0x4d5dcf){if(_0x4d5dcf){_0x4d5dcf[_0x770b('0x10c')](_0x770b('0x10d'));}});}})[_0x770b('0x17')](function(){var _0x143cfa=_0x480697[_0x770b('0x95')];var _0x3991ae=_0x480697[_0x770b('0x97')]||undefined;return _0x143cfa?_0x143cfa[_0x770b('0x98')](_0x3991ae):!![];})[_0x770b('0x17')](function(_0x2f0aa5){var _0x478f26=fs['readFileSync'](path[_0x770b('0x8b')](config[_0x770b('0x86')],_0x770b('0x10e')),_0x770b('0x10f'));var _0x5b44c1=_0x770b('0x110');var _0xaae2a0=![];var _0x2cbe3c,_0x60badc;if(_0x3b8e69[_0x770b('0xb4')][_0x770b('0x9f')]){_0x2cbe3c=new URL(_0x3b8e69[_0x770b('0xb4')]['referer'])['origin'];}else if(_0x3b8e69[_0x770b('0xb4')][_0x770b('0x111')]){_0x2cbe3c=new URL(_0x3b8e69['headers'][_0x770b('0x111')])[_0x770b('0x111')];}else{_0x2cbe3c=_0x770b('0x112');}_0x60badc=typeof _0x480697[_0x770b('0x64')][_0x770b('0x36')](',')[_0x770b('0x61')](function(_0x2215f4){return wildcardUtils['testWebsiteWithWildcard'](_0x2215f4,_0x2cbe3c);})!==_0x770b('0x23');var _0x3074d4={'chatVersion':_0x5b44c1,'chatWebsiteAddressOrigin':_0x60badc?_0x3b8e69[_0x770b('0xb4')][_0x770b('0x9f')]:_0x480697['address'],'remote':_0x480697[_0x770b('0x113')],'query':querystring[_0x770b('0x1a')](_[_0x770b('0x57')](_0x480697[_0x770b('0x2a')]({'plain':!![]}),{'customerIp':_0x3b8e69[_0x770b('0xb4')][_0x770b('0x34')]||_0x3b8e69['headers'][_0x770b('0x114')]||_0x3b8e69[_0x770b('0x115')][_0x770b('0x116')]||_0x3b8e69['ip'],'referer':_0x3b8e69[_0x770b('0xb4')][_0x770b('0x9f')],'openedInteractions':_0x1eab9b,'maxInteractions':_0x369ffd,'virtual':_0x547159['virtual'],'online':_0x2f0aa5,'custom':_0x547159,'address':_0x60badc?_0x3b8e69[_0x770b('0xb4')][_0x770b('0x9f')]:null}))[_0x770b('0x117')](/'/g,'\x5c\x27')};_0x3b607e[_0x770b('0x2f')](ejs[_0x770b('0xdf')](Mustache[_0x770b('0xdf')](_0x478f26,_0x3074d4),{'proactiveActions':_0x5c6a3a,'alignment':_0x480697['alignment'],'verticalAlignment':_0x480697['verticalAlignment'],'div_color':_0x480697[_0x770b('0x104')],'labelText':_0x480697['labelText'],'text_color':_0x480697['textColor'],'text_button_color':_0x480697['textButtonColor'],'button_color':_0x480697[_0x770b('0x118')],'background_color':_0x480697['backgroundColor'],'hideWhenOffline':_0x480697[_0x770b('0x119')],'intervalId':_0x480697[_0x770b('0x11a')],'isDevelopment':_0xaae2a0,'chatVersion':_0x5b44c1}));})[_0x770b('0x1f')](handleError(_0x3b607e,null));};exports[_0x770b('0x11b')]=function(_0x1b917b,_0x3bba64){var _0x53fec6=_0x1b917b[_0x770b('0x5f')]['id'];var _0x404ed5=_0x1b917b[_0x770b('0x63')];var _0x168c2e=0xc8;var _0x51de67=null;return db[_0x770b('0x11c')]['transaction']({'isolationLevel':db[_0x770b('0x11c')][_0x770b('0x11d')][_0x770b('0x11e')]['READ_COMMITTED']},function(_0x29a6a6){return db['ChatWebsite'][_0x770b('0x7a')]({'where':{'id':_0x53fec6},'transaction':_0x29a6a6})['then'](function(_0x2b3766){if(_0x2b3766){return db[_0x770b('0xaa')][_0x770b('0x29')]({'where':{'ChatWebsiteId':_0x53fec6},'transaction':_0x29a6a6})[_0x770b('0x17')](function(){var _0x563c6c=_[_0x770b('0x46')](_0x404ed5,function(_0x3c178b){_0x3c178b['ChatWebsiteId']=_0x53fec6;return _0x3c178b;});return db[_0x770b('0xaa')][_0x770b('0xea')](_0x563c6c,{'transaction':_0x29a6a6});});}else{_0x168c2e=0x194;_0x51de67=[];}});})[_0x770b('0x17')](function(){if(_0x168c2e!==0x194){return db[_0x770b('0xaa')][_0x770b('0x11f')]({'where':{'ChatWebsiteId':_0x53fec6},'order':_0x770b('0x120')})['then'](function(_0x339720){_0x51de67=_0x339720;});}})[_0x770b('0x1f')](function(_0x5b52bc){_0x168c2e=0x1f4;logger[_0x770b('0x1c')](_0x5b52bc[_0x770b('0x121')]);if(_0x5b52bc[_0x770b('0x2e')]){delete _0x5b52bc['name'];}_0x51de67=_0x5b52bc;})[_0x770b('0x122')](function(){if(_0x51de67===null){_0x3bba64[_0x770b('0x2d')](_0x168c2e);}else{if(_0x168c2e===0x1f4){_0x3bba64['status'](_0x168c2e)['send'](_0x51de67);}else{_0x3bba64[_0x770b('0x21')](_0x168c2e)[_0x770b('0x22')](_0x51de67);}}});};exports[_0x770b('0x123')]=function(_0x235d1f,_0x51a670){var _0x452752={};var _0x4792e3={};var _0x29b58d;var _0x4042d7;return db[_0x770b('0x47')][_0x770b('0x7a')]({'where':{'id':_0x235d1f['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x51a670,null))[_0x770b('0x17')](function(_0x1a6012){if(_0x1a6012){_0x29b58d=_0x1a6012;_0x4792e3['model']=_[_0x770b('0x4c')](db[_0x770b('0xaa')][_0x770b('0x48')]);_0x4792e3[_0x770b('0x4b')]=_['keys'](_0x235d1f[_0x770b('0x4b')]);_0x4792e3[_0x770b('0x55')]=_[_0x770b('0x4d')](_0x4792e3['model'],_0x4792e3['query']);_0x452752[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0x4792e3[_0x770b('0x3f')],qs[_0x770b('0x4f')](_0x235d1f[_0x770b('0x4b')][_0x770b('0x4f')]));_0x452752['attributes']=_0x452752[_0x770b('0x4e')][_0x770b('0x60')]?_0x452752[_0x770b('0x4e')]:_0x4792e3[_0x770b('0x3f')];_0x452752['order']=qs['sort'](_0x235d1f[_0x770b('0x4b')]['sort']);_0x452752[_0x770b('0x53')]=qs['filters'](_[_0x770b('0x54')](_0x235d1f['query'],_0x4792e3[_0x770b('0x55')]));if(_0x235d1f['query'][_0x770b('0x56')]){_0x452752[_0x770b('0x53')]=_[_0x770b('0x57')](_0x452752['where'],{'$or':_['map'](_0x452752[_0x770b('0x4e')],function(_0x65695c){var _0x1005b0={};_0x1005b0[_0x65695c]={'$like':'%'+_0x235d1f[_0x770b('0x4b')][_0x770b('0x56')]+'%'};return _0x1005b0;})});}_0x452752=_[_0x770b('0x57')]({},_0x452752,_0x235d1f[_0x770b('0x59')]);return _0x29b58d[_0x770b('0x123')](_0x452752);}})[_0x770b('0x17')](function(_0x1354f6){if(_0x1354f6){_0x4042d7=_0x1354f6[_0x770b('0x60')];if(!_0x235d1f['query']['hasOwnProperty'](_0x770b('0x50'))){_0x452752[_0x770b('0x26')]=qs[_0x770b('0x26')](_0x235d1f[_0x770b('0x4b')][_0x770b('0x26')]);_0x452752['offset']=qs[_0x770b('0x25')](_0x235d1f[_0x770b('0x4b')][_0x770b('0x25')]);}return _0x29b58d[_0x770b('0x123')](_0x452752);}})[_0x770b('0x17')](function(_0x4f5305){if(_0x4f5305){return _0x4f5305?{'count':_0x4042d7,'rows':_0x4f5305}:null;}})[_0x770b('0x17')](respondWithResult(_0x51a670,null))[_0x770b('0x1f')](handleError(_0x51a670,null));};exports[_0x770b('0x124')]=function(_0x6ba5e8,_0x4be2a9){return db[_0x770b('0x125')][_0x770b('0x61')]({'where':{'id':_0x6ba5e8['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x4be2a9,null))['then'](function(_0x3b5208){if(_0x3b5208){return _0x3b5208[_0x770b('0x124')](_0x6ba5e8['body'][_0x770b('0x76')],_['omit'](_0x6ba5e8[_0x770b('0x63')],[_0x770b('0x76'),'id'])||{});}})['then'](respondWithResult(_0x4be2a9,null))[_0x770b('0x1f')](handleError(_0x4be2a9,null));};exports[_0x770b('0x108')]=function(_0x107217,_0x31cc98){var _0x2585cc={};var _0xe2745c={};var _0x3170a8;var _0x494051;return db[_0x770b('0x47')][_0x770b('0x7a')]({'where':{'id':_0x107217['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x31cc98,null))['then'](function(_0x2b7a63){if(_0x2b7a63){_0x3170a8=_0x2b7a63;_0xe2745c[_0x770b('0x3f')]=_[_0x770b('0x4c')](db[_0x770b('0x126')]['rawAttributes']);_0xe2745c[_0x770b('0x4b')]=_['keys'](_0x107217[_0x770b('0x4b')]);_0xe2745c['filters']=_[_0x770b('0x4d')](_0xe2745c[_0x770b('0x3f')],_0xe2745c[_0x770b('0x4b')]);_0x2585cc[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0xe2745c['model'],qs[_0x770b('0x4f')](_0x107217['query']['fields']));_0x2585cc[_0x770b('0x4e')]=_0x2585cc['attributes'][_0x770b('0x60')]?_0x2585cc[_0x770b('0x4e')]:_0xe2745c[_0x770b('0x3f')];_0x2585cc[_0x770b('0x51')]=qs['sort'](_0x107217[_0x770b('0x4b')][_0x770b('0x52')]);_0x2585cc[_0x770b('0x53')]=qs['filters'](_[_0x770b('0x54')](_0x107217['query'],_0xe2745c[_0x770b('0x55')]));if(_0x107217['query']['filter']){_0x2585cc['where']=_['merge'](_0x2585cc['where'],{'$or':_[_0x770b('0x46')](_0x2585cc['attributes'],function(_0x28f275){var _0x50d04f={};_0x50d04f[_0x28f275]={'$like':'%'+_0x107217[_0x770b('0x4b')]['filter']+'%'};return _0x50d04f;})});}_0x2585cc=_[_0x770b('0x57')]({},_0x2585cc,_0x107217['options']);return _0x3170a8[_0x770b('0x108')](_0x2585cc);}})[_0x770b('0x17')](function(_0x45ef1d){if(_0x45ef1d){_0x494051=_0x45ef1d['length'];if(!_0x107217[_0x770b('0x4b')][_0x770b('0x74')](_0x770b('0x50'))){_0x2585cc[_0x770b('0x26')]=qs['limit'](_0x107217[_0x770b('0x4b')][_0x770b('0x26')]);_0x2585cc[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x107217[_0x770b('0x4b')][_0x770b('0x25')]);}return _0x3170a8[_0x770b('0x108')](_0x2585cc);}})[_0x770b('0x17')](function(_0x4d5fce){if(_0x4d5fce){return _0x4d5fce?{'count':_0x494051,'rows':_0x4d5fce}:null;}})[_0x770b('0x17')](respondWithResult(_0x31cc98,null))[_0x770b('0x1f')](handleError(_0x31cc98,null));};exports['getFields']=function(_0x439469,_0x1862ad){var _0x2268a4=_0x439469[_0x770b('0x4b')]['online']==='false'?_0x770b('0x127'):'onlineForm';return db[_0x770b('0x47')][_0x770b('0x61')]({'attributes':['id',_0x2268a4],'where':{'id':_0x439469[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1862ad,null))[_0x770b('0x17')](function(_0x5e870a){if(_0x5e870a){var _0x4d15e8=_0x5e870a[_0x2268a4];var _0x29ca1d=_0x4d15e8&&_0x4d15e8[_0x770b('0x128')]?_0x4d15e8[_0x770b('0x128')]:[];_0x1862ad[_0x770b('0x2f')]({'fromKey':_[_0x770b('0x8f')](_0x4d15e8[_0x770b('0x129')])?undefined:_0x4d15e8[_0x770b('0x129')],'count':_0x29ca1d['length'],'rows':_0x29ca1d});}})[_0x770b('0x1f')](handleError(_0x1862ad,null));};exports[_0x770b('0x12a')]=function(_0x2bdde4,_0x4679c1){var _0x153109={'raw':![],'where':{}};var _0x4f2235={};var _0x4d2d59={'count':0x0,'rows':[]};return db[_0x770b('0x47')][_0x770b('0x7a')]({'where':{'id':_0x2bdde4['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x4679c1,null))['then'](function(_0x40b759){if(_0x40b759){_0x4f2235[_0x770b('0x3f')]=_[_0x770b('0x4c')](db[_0x770b('0x12b')][_0x770b('0x48')]);_0x4f2235[_0x770b('0x4b')]=_[_0x770b('0x4c')](_0x2bdde4[_0x770b('0x4b')]);_0x4f2235[_0x770b('0x55')]=_['intersection'](_0x4f2235[_0x770b('0x3f')],_0x4f2235[_0x770b('0x4b')]);_0x153109[_0x770b('0x4e')]=_[_0x770b('0x4d')](_0x4f2235['model'],qs[_0x770b('0x4f')](_0x2bdde4[_0x770b('0x4b')][_0x770b('0x4f')]));_0x153109[_0x770b('0x4e')]=_0x153109[_0x770b('0x4e')][_0x770b('0x60')]?_0x153109[_0x770b('0x4e')]:_0x4f2235[_0x770b('0x3f')];if(!_0x2bdde4[_0x770b('0x4b')][_0x770b('0x74')]('nolimit')){_0x153109[_0x770b('0x26')]=qs[_0x770b('0x26')](_0x2bdde4[_0x770b('0x4b')][_0x770b('0x26')]);_0x153109[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x2bdde4[_0x770b('0x4b')][_0x770b('0x25')]);}_0x153109[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x2bdde4[_0x770b('0x4b')][_0x770b('0x52')]);_0x153109[_0x770b('0x53')]=qs[_0x770b('0x55')](_[_0x770b('0x54')](_0x2bdde4[_0x770b('0x4b')],_0x4f2235['filters']));_0x153109[_0x770b('0x53')][_0x770b('0x71')]=_0x40b759['id'];if(_0x2bdde4[_0x770b('0x4b')][_0x770b('0x56')]){_0x153109[_0x770b('0x53')]=_[_0x770b('0x57')](_0x153109[_0x770b('0x53')],{'$or':_[_0x770b('0x46')](_0x153109['attributes'],function(_0x5d3b19){var _0x4ec8e2={};_0x4ec8e2[_0x5d3b19]={'$like':'%'+_0x2bdde4[_0x770b('0x4b')]['filter']+'%'};return _0x4ec8e2;})});}_0x153109=_[_0x770b('0x57')]({},_0x153109,_0x2bdde4[_0x770b('0x59')]);return db[_0x770b('0x12b')][_0x770b('0x24')]({'where':_0x153109['where']})['then'](function(_0x3d6df4){_0x4d2d59[_0x770b('0x24')]=_0x3d6df4;if(_0x2bdde4[_0x770b('0x4b')][_0x770b('0x5a')]){_0x153109[_0x770b('0x5b')]=[{'all':!![]}];}else{_0x153109[_0x770b('0x5b')]=[{'model':db[_0x770b('0xa0')],'as':_0x770b('0x100'),'required':![]},{'model':db[_0x770b('0xe9')],'as':_0x770b('0x12c'),'required':![]}];}return db[_0x770b('0x12b')][_0x770b('0x5c')](_0x153109);})['then'](function(_0x218e5c){_0x4d2d59['rows']=_0x218e5c;return _0x4d2d59;});}})[_0x770b('0x17')](respondWithFilteredResult(_0x4679c1,_0x153109))['catch'](handleError(_0x4679c1,null));};exports[_0x770b('0x12d')]=function(_0x1aa204,_0x622df1){return db['ChatWebsite'][_0x770b('0x61')]({'where':{'id':_0x1aa204[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x622df1,null))[_0x770b('0x17')](function(_0x2630f3){if(_0x2630f3){return _0x2630f3[_0x770b('0x12d')](_0x1aa204[_0x770b('0x63')]['ids'],_[_0x770b('0xfe')](_0x1aa204['body'],[_0x770b('0x76'),'id'])||{})[_0x770b('0xdd')](function(_0x10731a){for(var _0x2f9cab=0x0;_0x2f9cab<_0x1aa204[_0x770b('0x63')][_0x770b('0x76')][_0x770b('0x60')];_0x2f9cab+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x1aa204['body'][_0x770b('0x76')][_0x2f9cab]),'ChatWebsiteId':Number(_0x1aa204['params']['id'])});}return _0x10731a;});}})[_0x770b('0x17')](respondWithResult(_0x622df1,null))[_0x770b('0x1f')](handleError(_0x622df1,null));};exports[_0x770b('0x12e')]=function(_0x51eea8,_0x5f5761){return db[_0x770b('0x47')][_0x770b('0x61')]({'where':{'id':_0x51eea8[_0x770b('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5f5761,null))[_0x770b('0x17')](function(_0x5559c6){if(_0x5559c6){return _0x5559c6[_0x770b('0x12e')](_0x51eea8[_0x770b('0x4b')][_0x770b('0x76')])['then'](function(){if(_['isArray'](_0x51eea8['query'][_0x770b('0x76')])){for(var _0x1bda51=0x0;_0x1bda51<_0x51eea8[_0x770b('0x4b')][_0x770b('0x76')][_0x770b('0x60')];_0x1bda51+=0x1){socket[_0x770b('0x12f')](_0x770b('0x130'),{'UserId':Number(_0x51eea8[_0x770b('0x4b')][_0x770b('0x76')][_0x1bda51]),'ChatWebsiteId':Number(_0x51eea8[_0x770b('0x5f')]['id'])});}}else{socket[_0x770b('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x51eea8[_0x770b('0x4b')]['ids']),'ChatWebsiteId':Number(_0x51eea8[_0x770b('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x5f5761,null))[_0x770b('0x1f')](handleError(_0x5f5761,null));};exports[_0x770b('0x131')]=function(_0x196148,_0x51ad2d){var _0x2aee49={};var _0x5e927d={};var _0x334d8d;var _0x396809;return db[_0x770b('0x47')][_0x770b('0x7a')]({'where':{'id':_0x196148['params']['id']}})[_0x770b('0x17')](handleEntityNotFound(_0x51ad2d,null))[_0x770b('0x17')](function(_0x203584){if(_0x203584){_0x334d8d=_0x203584;_0x5e927d['model']=_[_0x770b('0x4c')](db[_0x770b('0xc6')]['rawAttributes']);_0x5e927d[_0x770b('0x4b')]=_['keys'](_0x196148[_0x770b('0x4b')]);_0x5e927d[_0x770b('0x55')]=_[_0x770b('0x4d')](_0x5e927d[_0x770b('0x3f')],_0x5e927d[_0x770b('0x4b')]);_0x2aee49['attributes']=_[_0x770b('0x4d')](_0x5e927d['model'],qs['fields'](_0x196148[_0x770b('0x4b')][_0x770b('0x4f')]));_0x2aee49[_0x770b('0x4e')]=_0x2aee49['attributes']['length']?_0x2aee49['attributes']:_0x5e927d[_0x770b('0x3f')];_0x2aee49[_0x770b('0x51')]=qs[_0x770b('0x52')](_0x196148[_0x770b('0x4b')][_0x770b('0x52')]);_0x2aee49['where']=qs['filters'](_[_0x770b('0x54')](_0x196148[_0x770b('0x4b')],_0x5e927d['filters']));if(_0x196148[_0x770b('0x4b')][_0x770b('0x56')]){_0x2aee49[_0x770b('0x53')]=_['merge'](_0x2aee49['where'],{'$or':_[_0x770b('0x46')](_0x2aee49[_0x770b('0x4e')],function(_0x2568a9){var _0x420244={};_0x420244[_0x2568a9]={'$like':'%'+_0x196148[_0x770b('0x4b')][_0x770b('0x56')]+'%'};return _0x420244;})});}_0x2aee49=_[_0x770b('0x57')]({},_0x2aee49,_0x196148['options']);return _0x334d8d[_0x770b('0x131')](_0x2aee49);}})[_0x770b('0x17')](function(_0x688a0d){if(_0x688a0d){_0x396809=_0x688a0d[_0x770b('0x60')];if(!_0x196148[_0x770b('0x4b')][_0x770b('0x74')](_0x770b('0x50'))){_0x2aee49[_0x770b('0x26')]=qs['limit'](_0x196148['query'][_0x770b('0x26')]);_0x2aee49[_0x770b('0x25')]=qs[_0x770b('0x25')](_0x196148['query'][_0x770b('0x25')]);}return _0x334d8d[_0x770b('0x131')](_0x2aee49);}})[_0x770b('0x17')](function(_0x54b86d){if(_0x54b86d){return _0x54b86d?{'count':_0x396809,'rows':_0x54b86d}:null;}})[_0x770b('0x17')](respondWithResult(_0x51ad2d,null))['catch'](handleError(_0x51ad2d,null));}; \ No newline at end of file +var _0xfdd9=['interaction','messageId','created','applications','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','toPairsIn','Chat','NotifyMailAccount','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','getSnippet','Intervals','getProactiveActions','../../config/license/util','custom','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','3.9.0','origin','http://localhost:9000','remote','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','Attachments','addAgents','omit','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../config/logger','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','APIConflictError','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','user-agent-parser','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','type','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','create','body','address','forEach','trim','testWildcardValidity','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','find','ChatWebsiteId','findOne','Disposition','includeAll','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','getLicense','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','resolve','timezone','ifTime','chat','From\x20is\x20mandatory','mapKey','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','from','CmList','Contacts','DESC','ChatApplication','Applications','Interval','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','orderBy','priority','list','List','ListId','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId'];(function(_0x3a14ac,_0x55403f){var _0x5e3bc3=function(_0x11f956){while(--_0x11f956){_0x3a14ac['push'](_0x3a14ac['shift']());}};_0x5e3bc3(++_0x55403f);}(_0xfdd9,0x1b4));var _0x9fdd=function(_0x2370e4,_0x37dc3e){_0x2370e4=_0x2370e4-0x0;var _0x23f8a8=_0xfdd9[_0x2370e4];return _0x23f8a8;};'use strict';var Mustache=require(_0x9fdd('0x0'));var util=require(_0x9fdd('0x1'));var path=require(_0x9fdd('0x2'));var ejs=require(_0x9fdd('0x3'));var fs=require('fs');var fs_extra=require(_0x9fdd('0x4'));var _=require(_0x9fdd('0x5'));var querystring=require('querystring');var htmlToText=require(_0x9fdd('0x6'));var Redis=require(_0x9fdd('0x7'));var jayson=require(_0x9fdd('0x8'));var qs=require('../../components/parsers/qs');var logger=require(_0x9fdd('0x9'))('api');var config=require(_0x9fdd('0xa'));var APIBadRequestError=require(_0x9fdd('0xb'))['APIBadRequestError'];var APINotFoundError=require(_0x9fdd('0xb'))[_0x9fdd('0xc')];var APIOutOfIntervalError=require('../../errors/api')[_0x9fdd('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var APIConflictError=require(_0x9fdd('0xb'))[_0x9fdd('0xe')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require(_0x9fdd('0xf'))[_0x9fdd('0x10')];var db=require(_0x9fdd('0x11'))['db'];config[_0x9fdd('0x12')]=_[_0x9fdd('0x13')](config[_0x9fdd('0x12')],{'host':_0x9fdd('0x14'),'port':0x18eb});var socket=require(_0x9fdd('0x15'))(new Redis(config[_0x9fdd('0x12')]));require(_0x9fdd('0x16'))[_0x9fdd('0x17')](socket);var client=jayson[_0x9fdd('0x18')][_0x9fdd('0x19')]({'port':0x232c});var client9002=jayson['client'][_0x9fdd('0x19')]({'port':0x232a});var client9003=jayson[_0x9fdd('0x18')][_0x9fdd('0x19')]({'port':0x232b});var client9001=jayson[_0x9fdd('0x18')][_0x9fdd('0x19')]({'port':0x2329});function respondWithRpcPromise(_0x234aa3,_0x5c4b60,_0x4836b8,_0x438ced){return new Promise(function(_0x1b1423,_0x179e8f){var _0x11f6fe=_0x438ced||client;return _0x11f6fe[_0x9fdd('0x1a')](_0x234aa3,_0x4836b8)[_0x9fdd('0x1b')](function(_0x4aeebe){logger[_0x9fdd('0x1c')](_0x9fdd('0x1d'),_0x5c4b60,_0x9fdd('0x1e'));logger['debug'](_0x9fdd('0x1f'),_0x5c4b60,_0x9fdd('0x1e'),JSON[_0x9fdd('0x20')](_0x4aeebe));if(_0x4aeebe[_0x9fdd('0x21')]){if(_0x4aeebe['error'][_0x9fdd('0x22')]===0x1f4){logger[_0x9fdd('0x21')](_0x9fdd('0x1d'),_0x5c4b60,_0x4aeebe[_0x9fdd('0x21')][_0x9fdd('0x23')]);return _0x179e8f(_0x4aeebe[_0x9fdd('0x21')]['message']);}logger[_0x9fdd('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x5c4b60,_0x4aeebe[_0x9fdd('0x21')][_0x9fdd('0x23')]);return _0x1b1423(_0x4aeebe[_0x9fdd('0x21')]['message']);}else{logger[_0x9fdd('0x1c')](_0x9fdd('0x1d'),_0x5c4b60,_0x9fdd('0x1e'));_0x1b1423(_0x4aeebe[_0x9fdd('0x24')][_0x9fdd('0x23')]);}})[_0x9fdd('0x25')](function(_0x52529e){logger[_0x9fdd('0x21')]('ChatWebsite,\x20%s,\x20%s',_0x5c4b60,_0x52529e);_0x179e8f(_0x52529e);});});}function respondWithStatusCode(_0x27d2cf,_0x1e724c){_0x1e724c=_0x1e724c||0xcc;return function(_0x61784b){if(_0x61784b){return _0x27d2cf[_0x9fdd('0x26')](_0x1e724c);}return _0x27d2cf[_0x9fdd('0x27')](_0x1e724c)['end']();};}function respondWithResult(_0x511e0b,_0x5028d5){_0x5028d5=_0x5028d5||0xc8;return function(_0x10b605){if(_0x10b605){return _0x511e0b[_0x9fdd('0x27')](_0x5028d5)[_0x9fdd('0x28')](_0x10b605);}};}function respondWithFilteredResult(_0x12e8e4,_0x417d2f){return function(_0x19a4d8){if(_0x19a4d8){var _0x262ef4=typeof _0x417d2f['offset']==='undefined'&&typeof _0x417d2f[_0x9fdd('0x29')]===_0x9fdd('0x2a');var _0x59c24c=_0x19a4d8[_0x9fdd('0x2b')];var _0x29bb19=_0x262ef4?0x0:_0x417d2f[_0x9fdd('0x2c')];var _0x571cd9=_0x262ef4?_0x19a4d8['count']:_0x417d2f[_0x9fdd('0x2c')]+_0x417d2f[_0x9fdd('0x29')];var _0x31b13f;if(_0x571cd9>=_0x59c24c){_0x571cd9=_0x59c24c;_0x31b13f=0xc8;}else{_0x31b13f=0xce;}_0x12e8e4[_0x9fdd('0x27')](_0x31b13f);return _0x12e8e4[_0x9fdd('0x2d')](_0x9fdd('0x2e'),_0x29bb19+'-'+_0x571cd9+'/'+_0x59c24c)['json'](_0x19a4d8);}return null;};}function saveUpdates(_0x40a643){return function(_0x267812){if(_0x267812){return _0x267812[_0x9fdd('0x2f')](_0x40a643)[_0x9fdd('0x1b')](function(_0x59d6ad){return _0x59d6ad;});}return null;};}function removeEntity(_0x24ec52){return function(_0x53ab0b){if(_0x53ab0b){return _0x53ab0b[_0x9fdd('0x30')]()['then'](function(){var _0xb0a33e=_0x53ab0b[_0x9fdd('0x31')]({'plain':!![]});var _0x20a1aa=_0x9fdd('0x32');return db[_0x9fdd('0x33')][_0x9fdd('0x30')]({'where':{'type':_0x20a1aa,'resourceId':_0xb0a33e['id']}})[_0x9fdd('0x1b')](function(){return _0x53ab0b;});})[_0x9fdd('0x1b')](function(){_0x24ec52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ef24a){return function(_0x41c29a){if(!_0x41c29a){_0x4ef24a[_0x9fdd('0x26')](0x194);}return _0x41c29a;};}function handleError(_0x115500,_0x5151fa){_0x5151fa=_0x5151fa||0x1f4;return function(_0x2a310a){logger[_0x9fdd('0x21')](_0x2a310a[_0x9fdd('0x34')]);if(_0x2a310a[_0x9fdd('0x35')]){delete _0x2a310a['name'];}_0x115500[_0x9fdd('0x27')](_0x5151fa)[_0x9fdd('0x36')](_0x2a310a);};}function createInteractionObject(_0x34f0c5,_0xd6411f,_0xba133a,_0x315d8b){var _0xf689e=require(_0x9fdd('0x37'));var _0x4919a8=new _0xf689e();var _0x5c26a9=_0x4919a8['setUA'](_0xba133a[_0x9fdd('0x38')])[_0x9fdd('0x39')]();var _0x4ddea8=_0xd6411f[_0x9fdd('0x3a')];if(_0xba133a['cf-connecting-ip']){_0x4ddea8=_0xba133a[_0x9fdd('0x3b')];}else if(_0xba133a[_0x9fdd('0x3c')]){_0x4ddea8=_['first'](_0xba133a['x-forwarded-for'][_0x9fdd('0x3d')](','));}return{'ContactId':_0x315d8b['id'],'ChatWebsiteId':_0x34f0c5,'from':(_0x315d8b[_0x9fdd('0x3e')]||'')+'\x20'+(_0x315d8b[_0x9fdd('0x3f')]||''),'customerIp':_0x4ddea8,'customerPort':_0xba133a[_0x9fdd('0x40')]?_0xba133a[_0x9fdd('0x40')]:null,'referer':_0xd6411f[_0x9fdd('0x41')],'browserName':_0x5c26a9['browser'][_0x9fdd('0x35')]&&_0x5c26a9[_0x9fdd('0x42')][_0x9fdd('0x43')]?util[_0x9fdd('0x44')](_0x9fdd('0x45'),_0x5c26a9['browser'][_0x9fdd('0x35')],_0x5c26a9[_0x9fdd('0x42')][_0x9fdd('0x43')]):_0x9fdd('0x46'),'browserVersion':_0x5c26a9[_0x9fdd('0x42')][_0x9fdd('0x43')]||'unknown','osName':util[_0x9fdd('0x44')](_0x9fdd('0x45'),_0x5c26a9['os'][_0x9fdd('0x35')],_0x5c26a9['os']['version']),'osVersion':_0x5c26a9['os'][_0x9fdd('0x43')],'deviceModel':_0x5c26a9[_0x9fdd('0x47')][_0x9fdd('0x48')]&&_0x5c26a9[_0x9fdd('0x47')][_0x9fdd('0x49')]?util[_0x9fdd('0x44')]('%s\x20%s\x20%s',_0x5c26a9[_0x9fdd('0x47')][_0x9fdd('0x48')],_0x5c26a9[_0x9fdd('0x47')][_0x9fdd('0x49')],_0x5c26a9[_0x9fdd('0x47')][_0x9fdd('0x4a')]):null,'deviceVendor':_0x5c26a9['device'][_0x9fdd('0x49')],'deviceType':_0x5c26a9['device'][_0x9fdd('0x4a')],'formData':JSON[_0x9fdd('0x20')](_0xd6411f)};}exports['index']=function(_0x3c6a42,_0x5660f8){var _0x765b1e={'include':[{'model':db[_0x9fdd('0x4b')],'as':_0x9fdd('0x4c')}]},_0x2594fe={},_0x445c4c={'count':0x0,'rows':[]};var _0xbbb164=_[_0x9fdd('0x4d')](db[_0x9fdd('0x4e')][_0x9fdd('0x4f')],function(_0x2be934){return{'name':_0x2be934[_0x9fdd('0x50')],'type':_0x2be934[_0x9fdd('0x4a')][_0x9fdd('0x51')]};});_0x2594fe[_0x9fdd('0x48')]=_[_0x9fdd('0x4d')](_0xbbb164,_0x9fdd('0x35'));_0x2594fe[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x3c6a42[_0x9fdd('0x52')]);_0x2594fe[_0x9fdd('0x54')]=_['intersection'](_0x2594fe['model'],_0x2594fe[_0x9fdd('0x52')]);_0x765b1e[_0x9fdd('0x55')]=_[_0x9fdd('0x56')](_0x2594fe[_0x9fdd('0x48')],qs[_0x9fdd('0x57')](_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x765b1e['attributes']=_0x765b1e[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x765b1e[_0x9fdd('0x55')]:_0x2594fe[_0x9fdd('0x48')];if(!_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x765b1e['limit']=qs[_0x9fdd('0x29')](_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x765b1e['offset']=qs[_0x9fdd('0x2c')](_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}_0x765b1e[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x765b1e[_0x9fdd('0x5d')]=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0x3c6a42[_0x9fdd('0x52')],_0x2594fe[_0x9fdd('0x54')]),_0xbbb164);if(_0x3c6a42[_0x9fdd('0x52')][_0x9fdd('0x5f')]){_0x765b1e['where']=_['merge'](_0x765b1e[_0x9fdd('0x5d')],{'$or':_['map'](_0xbbb164,function(_0x8e9c6c){if(_0x8e9c6c[_0x9fdd('0x4a')]!==_0x9fdd('0x60')){var _0x171a3a={};_0x171a3a[_0x8e9c6c[_0x9fdd('0x35')]]={'$like':'%'+_0x3c6a42['query'][_0x9fdd('0x5f')]+'%'};return _0x171a3a;}})});}_0x765b1e=_[_0x9fdd('0x61')]({},_0x765b1e,_0x3c6a42[_0x9fdd('0x62')]);var _0x1010b8={'where':_0x765b1e[_0x9fdd('0x5d')]};return db[_0x9fdd('0x4e')]['count'](_0x1010b8)[_0x9fdd('0x1b')](function(_0x2b0c57){_0x445c4c[_0x9fdd('0x2b')]=_0x2b0c57;if(_0x3c6a42['query']['includeAll']){_0x765b1e[_0x9fdd('0x63')]=[{'all':!![]}];}return db[_0x9fdd('0x4e')]['findAll'](_0x765b1e);})[_0x9fdd('0x1b')](function(_0x4302e0){_0x445c4c[_0x9fdd('0x64')]=_0x4302e0;return _0x445c4c;})[_0x9fdd('0x1b')](respondWithFilteredResult(_0x5660f8,_0x765b1e))[_0x9fdd('0x25')](handleError(_0x5660f8,null));};exports['show']=function(_0x578ea9,_0x534e38){var _0x1dca38={'raw':![],'where':{'id':_0x578ea9['params']['id']},'include':[{'model':db['Pause'],'as':_0x9fdd('0x4c')}]},_0x2ed819={};_0x2ed819['model']=_['keys'](db[_0x9fdd('0x4e')][_0x9fdd('0x4f')]);_0x2ed819['query']=_[_0x9fdd('0x53')](_0x578ea9[_0x9fdd('0x52')]);_0x2ed819['filters']=_[_0x9fdd('0x56')](_0x2ed819[_0x9fdd('0x48')],_0x2ed819[_0x9fdd('0x52')]);_0x1dca38['attributes']=_[_0x9fdd('0x56')](_0x2ed819[_0x9fdd('0x48')],qs[_0x9fdd('0x57')](_0x578ea9[_0x9fdd('0x52')]['fields']));_0x1dca38['attributes']=_0x1dca38[_0x9fdd('0x55')]['length']?_0x1dca38[_0x9fdd('0x55')]:_0x2ed819[_0x9fdd('0x48')];if(_0x578ea9['query']['includeAll']){_0x1dca38['include']=[{'all':!![]}];}_0x1dca38=_[_0x9fdd('0x61')]({},_0x1dca38,_0x578ea9[_0x9fdd('0x62')]);return db[_0x9fdd('0x4e')]['find'](_0x1dca38)[_0x9fdd('0x1b')](handleEntityNotFound(_0x534e38,null))['then'](respondWithResult(_0x534e38,null))[_0x9fdd('0x25')](handleError(_0x534e38,null));};exports[_0x9fdd('0x65')]=function(_0x749c3a,_0x4fbd35){var _0x1a8d9b=null;_0x749c3a[_0x9fdd('0x66')][_0x9fdd('0x67')][_0x9fdd('0x3d')](',')[_0x9fdd('0x68')](_0x5ea908=>{if(_0x5ea908[_0x9fdd('0x69')]()!==''&&!wildcardUtils[_0x9fdd('0x6a')](_0x5ea908[_0x9fdd('0x69')]())){_0x1a8d9b=new APIBadRequestError('\x22'+_0x5ea908+_0x9fdd('0x6b'));}});if(_0x1a8d9b){return handleError(_0x4fbd35,null)(_0x1a8d9b);}return db[_0x9fdd('0x4e')][_0x9fdd('0x65')](_0x749c3a[_0x9fdd('0x66')],{})[_0x9fdd('0x1b')](function(_0x459862){var _0x250f36=_0x749c3a['user'][_0x9fdd('0x31')]({'plain':!![]});if(!_0x250f36)throw new Error(_0x9fdd('0x6c'));if(_0x250f36['role']===_0x9fdd('0x6d')){var _0x361f52=_0x459862[_0x9fdd('0x31')]({'plain':!![]});var _0x754095='ChatWebsites';return db[_0x9fdd('0x6e')]['find']({'where':{'name':_0x754095,'userProfileId':_0x250f36[_0x9fdd('0x6f')]},'raw':!![]})[_0x9fdd('0x1b')](function(_0x1f270){if(_0x1f270&&_0x1f270[_0x9fdd('0x70')]===0x0){return db[_0x9fdd('0x33')][_0x9fdd('0x65')]({'name':_0x361f52[_0x9fdd('0x35')],'resourceId':_0x361f52['id'],'type':_0x1f270[_0x9fdd('0x35')],'sectionId':_0x1f270['id']},{})[_0x9fdd('0x1b')](function(){return _0x459862;});}else{return _0x459862;}})[_0x9fdd('0x25')](function(_0x773c5e){logger[_0x9fdd('0x21')](_0x9fdd('0x71'),_0x773c5e);throw _0x773c5e;});}return _0x459862;})[_0x9fdd('0x1b')](respondWithResult(_0x4fbd35,0xc9))[_0x9fdd('0x25')](handleError(_0x4fbd35,null));};exports[_0x9fdd('0x2f')]=function(_0x39b530,_0x169744){var _0x5958bc=null;_0x39b530[_0x9fdd('0x66')][_0x9fdd('0x67')][_0x9fdd('0x3d')](',')['forEach'](_0x2f1e60=>{if(_0x2f1e60[_0x9fdd('0x69')]()!==''&&!wildcardUtils[_0x9fdd('0x6a')](_0x2f1e60['trim']())){_0x5958bc=new APIBadRequestError('\x22'+_0x2f1e60+_0x9fdd('0x6b'));}});if(_0x5958bc){return handleError(_0x169744,null)(_0x5958bc);}if(_0x39b530[_0x9fdd('0x66')]['id']){delete _0x39b530[_0x9fdd('0x66')]['id'];}return db[_0x9fdd('0x4e')]['find']({'where':{'id':_0x39b530[_0x9fdd('0x72')]['id']},'include':[{'model':db[_0x9fdd('0x4b')],'as':_0x9fdd('0x4c')}]})['then'](handleEntityNotFound(_0x169744,null))[_0x9fdd('0x1b')](saveUpdates(_0x39b530[_0x9fdd('0x66')],null))[_0x9fdd('0x1b')](respondWithResult(_0x169744,null))[_0x9fdd('0x25')](handleError(_0x169744,null));};exports[_0x9fdd('0x30')]=function(_0x173306,_0x40aca0){return db[_0x9fdd('0x4e')]['find']({'where':{'id':_0x173306[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x40aca0,null))['then'](removeEntity(_0x40aca0,null))[_0x9fdd('0x25')](handleError(_0x40aca0,null));};exports[_0x9fdd('0x73')]=function(_0x2f7f3d,_0x2146c0){return db[_0x9fdd('0x4e')][_0x9fdd('0x73')]()[_0x9fdd('0x1b')](respondWithResult(_0x2146c0,null))[_0x9fdd('0x25')](handleError(_0x2146c0,null));};exports['addDisposition']=function(_0x4dcc3c,_0x431a21){if(_0x4dcc3c['body']['id']){delete _0x4dcc3c[_0x9fdd('0x66')]['id'];}return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x4dcc3c[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x431a21,null))['then'](function(_0x359779){if(_0x359779){_0x4dcc3c[_0x9fdd('0x66')][_0x9fdd('0x75')]=_0x359779['id'];return db['Disposition']['create'](_0x4dcc3c['body']);}})[_0x9fdd('0x1b')](respondWithResult(_0x431a21,null))[_0x9fdd('0x25')](handleError(_0x431a21,null));};exports['getDispositions']=function(_0x9b2146,_0x4b374a){var _0x1edbc7={'raw':![],'where':{}};var _0x30916a={};var _0x99b4bb={'count':0x0,'rows':[]};return db[_0x9fdd('0x4e')][_0x9fdd('0x76')]({'where':{'id':_0x9b2146['params']['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x4b374a,null))[_0x9fdd('0x1b')](function(_0x49f78b){if(_0x49f78b){_0x30916a['model']=_[_0x9fdd('0x53')](db['Disposition'][_0x9fdd('0x4f')]);_0x30916a[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x9b2146['query']);_0x30916a[_0x9fdd('0x54')]=_['intersection'](_0x30916a['model'],_0x30916a[_0x9fdd('0x52')]);_0x1edbc7['attributes']=_[_0x9fdd('0x56')](_0x30916a['model'],qs[_0x9fdd('0x57')](_0x9b2146[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x1edbc7['attributes']=_0x1edbc7[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x1edbc7[_0x9fdd('0x55')]:_0x30916a[_0x9fdd('0x48')];if(!_0x9b2146[_0x9fdd('0x52')][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x1edbc7[_0x9fdd('0x29')]=qs[_0x9fdd('0x29')](_0x9b2146['query'][_0x9fdd('0x29')]);_0x1edbc7[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x9b2146[_0x9fdd('0x52')]['offset']);}_0x1edbc7[_0x9fdd('0x5b')]=qs['sort'](_0x9b2146[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x1edbc7[_0x9fdd('0x5d')]=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0x9b2146[_0x9fdd('0x52')],_0x30916a[_0x9fdd('0x54')]));_0x1edbc7[_0x9fdd('0x5d')]['ChatWebsiteId']=_0x49f78b['id'];if(_0x9b2146[_0x9fdd('0x52')][_0x9fdd('0x5f')]){_0x1edbc7[_0x9fdd('0x5d')]=_[_0x9fdd('0x61')](_0x1edbc7['where'],{'$or':_[_0x9fdd('0x4d')](_0x1edbc7[_0x9fdd('0x55')],function(_0x57474b){var _0x5ad55d={};_0x5ad55d[_0x57474b]={'$like':'%'+_0x9b2146[_0x9fdd('0x52')][_0x9fdd('0x5f')]+'%'};return _0x5ad55d;})});}_0x1edbc7=_[_0x9fdd('0x61')]({},_0x1edbc7,_0x9b2146[_0x9fdd('0x62')]);return db[_0x9fdd('0x77')][_0x9fdd('0x2b')]({'where':_0x1edbc7[_0x9fdd('0x5d')]})[_0x9fdd('0x1b')](function(_0x216815){_0x99b4bb[_0x9fdd('0x2b')]=_0x216815;if(_0x9b2146['query'][_0x9fdd('0x78')]){_0x1edbc7['include']=[{'all':!![]}];}return db[_0x9fdd('0x77')][_0x9fdd('0x79')](_0x1edbc7);})[_0x9fdd('0x1b')](function(_0x3b5ce5){_0x99b4bb[_0x9fdd('0x64')]=_0x3b5ce5;return _0x99b4bb;});}})[_0x9fdd('0x1b')](respondWithFilteredResult(_0x4b374a,_0x1edbc7))['catch'](handleError(_0x4b374a,null));};exports[_0x9fdd('0x7a')]=function(_0x310b12,_0x5c8491){return db['ChatWebsite']['find']({'where':{'id':_0x310b12[_0x9fdd('0x72')]['id']}})['then'](handleEntityNotFound(_0x5c8491,null))['then'](function(_0x590f46){if(_0x590f46){return _0x590f46[_0x9fdd('0x7a')](_0x310b12[_0x9fdd('0x52')][_0x9fdd('0x7b')]);}})[_0x9fdd('0x1b')](respondWithStatusCode(_0x5c8491,null))[_0x9fdd('0x25')](handleError(_0x5c8491,null));};exports['addAnswer']=function(_0x570c86,_0x9c179f){if(_0x570c86['body']['id']){delete _0x570c86['body']['id'];}return db['ChatWebsite'][_0x9fdd('0x74')]({'where':{'id':_0x570c86['params']['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x9c179f,null))[_0x9fdd('0x1b')](function(_0x271324){if(_0x271324){_0x570c86['body'][_0x9fdd('0x75')]=_0x271324['id'];return db[_0x9fdd('0x7c')][_0x9fdd('0x65')](_0x570c86[_0x9fdd('0x66')]);}})[_0x9fdd('0x1b')](respondWithResult(_0x9c179f,null))[_0x9fdd('0x25')](handleError(_0x9c179f,null));};exports[_0x9fdd('0x7d')]=function(_0xf2db40,_0x42c778){var _0x3f7b6={'raw':![],'where':{}};var _0x4891d2={};var _0x4d159a={'count':0x0,'rows':[]};return db[_0x9fdd('0x4e')]['findOne']({'where':{'id':_0xf2db40['params']['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x42c778,null))[_0x9fdd('0x1b')](function(_0x189280){if(_0x189280){_0x4891d2[_0x9fdd('0x48')]=_['keys'](db[_0x9fdd('0x7c')][_0x9fdd('0x4f')]);_0x4891d2['query']=_['keys'](_0xf2db40['query']);_0x4891d2['filters']=_[_0x9fdd('0x56')](_0x4891d2[_0x9fdd('0x48')],_0x4891d2[_0x9fdd('0x52')]);_0x3f7b6['attributes']=_[_0x9fdd('0x56')](_0x4891d2['model'],qs[_0x9fdd('0x57')](_0xf2db40[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x3f7b6[_0x9fdd('0x55')]=_0x3f7b6[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x3f7b6[_0x9fdd('0x55')]:_0x4891d2[_0x9fdd('0x48')];if(!_0xf2db40[_0x9fdd('0x52')]['hasOwnProperty'](_0x9fdd('0x5a'))){_0x3f7b6[_0x9fdd('0x29')]=qs[_0x9fdd('0x29')](_0xf2db40[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x3f7b6[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0xf2db40[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}_0x3f7b6[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0xf2db40[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x3f7b6['where']=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0xf2db40['query'],_0x4891d2[_0x9fdd('0x54')]));_0x3f7b6[_0x9fdd('0x5d')]['ChatWebsiteId']=_0x189280['id'];if(_0xf2db40['query']['filter']){_0x3f7b6[_0x9fdd('0x5d')]=_['merge'](_0x3f7b6[_0x9fdd('0x5d')],{'$or':_[_0x9fdd('0x4d')](_0x3f7b6['attributes'],function(_0x45ad3b){var _0x291fba={};_0x291fba[_0x45ad3b]={'$like':'%'+_0xf2db40[_0x9fdd('0x52')]['filter']+'%'};return _0x291fba;})});}_0x3f7b6=_[_0x9fdd('0x61')]({},_0x3f7b6,_0xf2db40['options']);return db[_0x9fdd('0x7c')][_0x9fdd('0x2b')]({'where':_0x3f7b6[_0x9fdd('0x5d')]})[_0x9fdd('0x1b')](function(_0x333aad){_0x4d159a['count']=_0x333aad;if(_0xf2db40['query'][_0x9fdd('0x78')]){_0x3f7b6[_0x9fdd('0x63')]=[{'all':!![]}];}return db[_0x9fdd('0x7c')][_0x9fdd('0x79')](_0x3f7b6);})[_0x9fdd('0x1b')](function(_0x39d2c9){_0x4d159a[_0x9fdd('0x64')]=_0x39d2c9;return _0x4d159a;});}})[_0x9fdd('0x1b')](respondWithFilteredResult(_0x42c778,_0x3f7b6))['catch'](handleError(_0x42c778,null));};exports[_0x9fdd('0x7e')]=function(_0x48c81c,_0x24ddfb){return db[_0x9fdd('0x4e')]['find']({'where':{'id':_0x48c81c[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x24ddfb,null))[_0x9fdd('0x1b')](function(_0x5c2ebd){if(_0x5c2ebd){return _0x5c2ebd['removeAnswers'](_0x48c81c[_0x9fdd('0x52')]['ids']);}})['then'](respondWithStatusCode(_0x24ddfb,null))[_0x9fdd('0x25')](handleError(_0x24ddfb,null));};exports[_0x9fdd('0x7f')]=function(_0x44abd5,_0x1d280e){_0x44abd5[_0x9fdd('0x66')]['sitepic']=_0x44abd5[_0x9fdd('0x80')][_0x9fdd('0x81')];return db['ChatWebsite'][_0x9fdd('0x74')]({'where':{'id':_0x44abd5[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x1d280e,null))[_0x9fdd('0x1b')](saveUpdates(_0x44abd5[_0x9fdd('0x66')],null))[_0x9fdd('0x1b')](respondWithResult(_0x1d280e,null))['catch'](handleError(_0x1d280e,null));};exports[_0x9fdd('0x82')]=function(_0x49e770,_0x1a1d56){_0x49e770[_0x9fdd('0x66')][_0x9fdd('0x83')]=_0x49e770[_0x9fdd('0x80')][_0x9fdd('0x81')];return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x49e770['params']['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x1a1d56,null))[_0x9fdd('0x1b')](saveUpdates(_0x49e770[_0x9fdd('0x66')],null))['then'](respondWithResult(_0x1a1d56,null))[_0x9fdd('0x25')](handleError(_0x1a1d56,null));};exports[_0x9fdd('0x84')]=function(_0x4b5164,_0xad5ffa){_0x4b5164[_0x9fdd('0x66')][_0x9fdd('0x85')]=_0x4b5164[_0x9fdd('0x80')][_0x9fdd('0x81')];return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x4b5164[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0xad5ffa,null))[_0x9fdd('0x1b')](saveUpdates(_0x4b5164[_0x9fdd('0x66')],null))[_0x9fdd('0x1b')](respondWithResult(_0xad5ffa,null))[_0x9fdd('0x25')](handleError(_0xad5ffa,null));};exports[_0x9fdd('0x86')]=function(_0x542711,_0x413716){_0x542711['body'][_0x9fdd('0x87')]=_0x542711[_0x9fdd('0x80')][_0x9fdd('0x81')];return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x542711[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x413716,null))[_0x9fdd('0x1b')](saveUpdates(_0x542711[_0x9fdd('0x66')],null))['then'](respondWithResult(_0x413716,null))['catch'](handleError(_0x413716,null));};exports[_0x9fdd('0x88')]=function(_0x4080a0,_0x44260b){var _0x5789fa=path[_0x9fdd('0x89')](config['root'],_0x9fdd('0x8a'));var _0x2cad4e={'where':{'id':_0x4080a0[_0x9fdd('0x72')]['id']},'attributes':['id',_0x9fdd('0x8b')],'raw':!![]};var _0x10a645=![];return require('../../config/license/util')[_0x9fdd('0x8c')]()['then'](function(_0x5ba0e1){if(_0x5ba0e1){_0x10a645=_0x5ba0e1['custom'];}})[_0x9fdd('0x1b')](function(){return db[_0x9fdd('0x4e')][_0x9fdd('0x74')](_0x2cad4e);})[_0x9fdd('0x1b')](handleEntityNotFound(_0x44260b,null))[_0x9fdd('0x1b')](function(_0x594ed0){if(_0x594ed0){if(!_[_0x9fdd('0x8d')](_0x594ed0[_0x9fdd('0x8b')])){if(fs[_0x9fdd('0x8e')](path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x90'),_0x594ed0[_0x9fdd('0x8b')]))&&_0x10a645){_0x5789fa=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x90'),_0x594ed0[_0x9fdd('0x8b')]);}}return _0x44260b[_0x9fdd('0x91')](_0x5789fa);}})['catch'](handleError(_0x44260b,null));};exports['getAvatar']=function(_0x2b70aa,_0x12ad6b){var _0x22da01=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x92'));var _0x583b60={'where':{'id':_0x2b70aa[_0x9fdd('0x72')]['id']},'attributes':['id',_0x9fdd('0x83')],'raw':!![]};return db[_0x9fdd('0x4e')][_0x9fdd('0x74')](_0x583b60)[_0x9fdd('0x1b')](handleEntityNotFound(_0x12ad6b,null))[_0x9fdd('0x1b')](function(_0x25050a){if(_0x25050a){if(!_['isNil'](_0x25050a[_0x9fdd('0x83')])){if(fs['existsSync'](path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x93'),_0x25050a[_0x9fdd('0x83')]))){_0x22da01=path[_0x9fdd('0x89')](config['root'],_0x9fdd('0x93'),_0x25050a[_0x9fdd('0x83')]);}}return _0x12ad6b[_0x9fdd('0x91')](_0x22da01);}})[_0x9fdd('0x25')](handleError(_0x12ad6b,null));};exports[_0x9fdd('0x94')]=function(_0x3ff8ab,_0x2ad275){var _0x427b38=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x95'));var _0xcc3a57={'where':{'id':_0x3ff8ab[_0x9fdd('0x72')]['id']},'attributes':['id',_0x9fdd('0x85'),_0x9fdd('0x96')],'raw':!![]};return db['ChatWebsite'][_0x9fdd('0x74')](_0xcc3a57)['then'](handleEntityNotFound(_0x2ad275,null))[_0x9fdd('0x1b')](function(_0x476396){if(_0x476396){if(!_['isNil'](_0x476396[_0x9fdd('0x85')])){if(fs[_0x9fdd('0x8e')](path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x93'),_0x476396[_0x9fdd('0x85')]))&&_0x476396[_0x9fdd('0x96')]){_0x427b38=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x93'),_0x476396[_0x9fdd('0x85')]);}}return _0x2ad275['download'](_0x427b38);}})[_0x9fdd('0x25')](handleError(_0x2ad275,null));};exports[_0x9fdd('0x97')]=function(_0x55b3d7,_0x3b2240){var _0x42b77e=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],'server/files/images/avatars/system_avatar.png');var _0x37ba45={'where':{'id':_0x55b3d7[_0x9fdd('0x72')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x9fdd('0x4e')][_0x9fdd('0x74')](_0x37ba45)['then'](handleEntityNotFound(_0x3b2240,null))['then'](function(_0x13d3f1){if(_0x13d3f1){if(!_[_0x9fdd('0x8d')](_0x13d3f1[_0x9fdd('0x87')])){if(fs[_0x9fdd('0x8e')](path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0x93'),_0x13d3f1[_0x9fdd('0x87')]))){_0x42b77e=path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],'server/files/images/avatars/',_0x13d3f1[_0x9fdd('0x87')]);}}return _0x3b2240[_0x9fdd('0x91')](_0x42b77e);}})['catch'](handleError(_0x3b2240,null));};function checkWebsiteInterval(_0x3aa2b6){var _0x5a47c6=_0x3aa2b6['Interval'];if(!_0x5a47c6){return Promise[_0x9fdd('0x98')](_0x3aa2b6);}var _0x31d674=_0x3aa2b6[_0x9fdd('0x99')]||undefined;return _0x5a47c6[_0x9fdd('0x9a')](_0x31d674)[_0x9fdd('0x1b')](function(_0x5c77c1){if(!_0x5c77c1){throw new APIOutOfIntervalError();}return _0x3aa2b6;});}exports['notify']=function(_0x2dbeab,_0x44463d){var _0x448cb9={'body':_0x2dbeab['body'],'channel':_0x9fdd('0x9b')};var _0x4f028e=[];var _0xb146f9=[];var _0x4f6b8f={};var _0x6cca8e=![];if(_0x2dbeab[_0x9fdd('0x66')]['id']){delete _0x2dbeab['body']['id'];}if(_['isNil'](_0x2dbeab[_0x9fdd('0x66')]['from'])){throw new APIBadRequestError(_0x9fdd('0x9c'));}if(_[_0x9fdd('0x8d')](_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x9d')])){throw new APIBadRequestError(_0x9fdd('0x9e'));}if(_[_0x9fdd('0x9f')](_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x66')])){throw new APIBadRequestError(_0x9fdd('0xa0'));}var _0x56b296=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x3a')]&&_0x2dbeab['body'][_0x9fdd('0x41')];return db[_0x9fdd('0xa1')][_0x9fdd('0x73')]()[_0x9fdd('0x1b')](function(_0x1bf61b){if(!_0x1bf61b){throw new Error(_0x9fdd('0xa2'));}_0x4f028e=Object[_0x9fdd('0x53')](_0x1bf61b)[_0x9fdd('0x5f')](function(_0xe5a41f){return![_0x9fdd('0xa3'),'updatedAt']['includes'](_0xe5a41f);});_0xb146f9=Object[_0x9fdd('0x53')](_0x1bf61b)[_0x9fdd('0x5f')](function(_0x2818a7){return![_0x9fdd('0xa3'),_0x9fdd('0xa4'),'CompanyId','ListId']['includes'](_0x2818a7);});if(!_['includes'](_0xb146f9,_0x2dbeab['body'][_0x9fdd('0x9d')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0xb146f9[_0x9fdd('0x89')](',\x20'));}_0x4f6b8f[_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x9d')]]=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xa5')];})['then'](function(){return db[_0x9fdd('0x4e')]['find']({'where':{'id':_0x2dbeab[_0x9fdd('0x72')]['id']},'include':[{'model':db[_0x9fdd('0xa6')],'as':'List','include':[{'model':db[_0x9fdd('0xa1')],'as':_0x9fdd('0xa7'),'where':_0x4f6b8f,'limit':0x1,'order':[[_0x9fdd('0xa4'),_0x9fdd('0xa8')]]}]},{'model':db[_0x9fdd('0xa9')],'as':_0x9fdd('0xaa')},{'model':db[_0x9fdd('0xab')],'as':_0x9fdd('0xab'),'include':[{'model':db[_0x9fdd('0xab')],'as':'Intervals','attributes':['id',_0x9fdd('0xac')],'raw':!![]}]}]});})[_0x9fdd('0x1b')](function(_0x3b37c8){if(!_0x3b37c8){throw new APINotFoundError(util['format'](_0x9fdd('0xad'),_0x2dbeab[_0x9fdd('0x72')]['id']));}if(_0x56b296){return checkWebsiteInterval(_0x3b37c8);}return _0x3b37c8;})[_0x9fdd('0x1b')](function(_0x13d21f){_0x448cb9[_0x9fdd('0xae')]=_0x13d21f;_0x448cb9['applications']=_[_0x9fdd('0xaf')](_0x13d21f['Applications'],[_0x9fdd('0xb0')],['asc']);if(_0x448cb9[_0x9fdd('0xae')][_0x9fdd('0xaa')]){delete _0x448cb9[_0x9fdd('0xae')]['Applications'];}_0x448cb9[_0x9fdd('0xb1')]=_0x13d21f[_0x9fdd('0xb2')]||{'id':_0x13d21f[_0x9fdd('0xb3')]};if(_0x448cb9[_0x9fdd('0xb1')]&&_0x448cb9[_0x9fdd('0xb1')][_0x9fdd('0xa7')][_0x9fdd('0x58')]){return _0x448cb9[_0x9fdd('0xb1')][_0x9fdd('0xa7')][0x0];}var _0x2716b9=_['defaults'](_0x2dbeab[_0x9fdd('0x66')],{'firstName':_0x2dbeab['body']['from'],'ListId':_0x13d21f[_0x9fdd('0xb3')]});_0x2716b9[_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x9d')]]=_0x2dbeab['body'][_0x9fdd('0xa5')];return db[_0x9fdd('0xa1')][_0x9fdd('0x65')](_0x2716b9,{'fields':_0x4f028e,'raw':!![]});})[_0x9fdd('0x1b')](function(_0x1aab8d){_0x448cb9[_0x9fdd('0xb4')]=_0x1aab8d;var _0x50ba89=createInteractionObject(_0x2dbeab[_0x9fdd('0x72')]['id'],_0x2dbeab[_0x9fdd('0x66')],_0x2dbeab[_0x9fdd('0xb5')],_0x1aab8d);var _0x586ac4={'ChatWebsiteId':_0x2dbeab[_0x9fdd('0x72')]['id']};if(_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xb6')]){_0x586ac4[_0x9fdd('0xb6')]=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xb6')];_0x586ac4[_0x9fdd('0xb7')]=![];return db[_0x9fdd('0xb8')][_0x9fdd('0x74')]({'where':_0x586ac4})[_0x9fdd('0x1b')](function(_0x5cf61c){var _0x32f3fc=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x3a')]&&_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x41')];if(_0x5cf61c){_0x6cca8e=!![];return _0x5cf61c;}else if(!_0x32f3fc&&_0x5cf61c&&_0x5cf61c['closed']){throw new APIConflictError(_0x9fdd('0xb9'));}_0x50ba89['threadId']=_0x2dbeab['body']['threadId'];_0x50ba89[_0x9fdd('0xba')]=_0x2dbeab['body'][_0x9fdd('0xba')];return db['ChatInteraction']['create'](_0x50ba89);});}_0x586ac4[_0x9fdd('0xbb')]=_0x1aab8d['id'];if(_0x2dbeab['body'][_0x9fdd('0xbc')]&&_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xbc')]['id']){_0x586ac4['id']=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xbc')]['id'];return db[_0x9fdd('0xb8')][_0x9fdd('0x74')]({'where':_0x586ac4})['then'](function(_0x57526b){var _0xb77c43=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x3a')]&&_0x2dbeab[_0x9fdd('0x66')]['referer'];if(!_0xb77c43&&_0x57526b&&_0x57526b[_0x9fdd('0xb7')]){throw new APIConflictError(_0x9fdd('0xb9'));}else if(_0x57526b){_0x6cca8e=!![];return _0x57526b;}else{return db[_0x9fdd('0xb8')]['create'](_0x50ba89);}});}return db[_0x9fdd('0xb8')]['create'](_0x50ba89);})[_0x9fdd('0x1b')](function(_0x398b7f){if(!_0x6cca8e){return _0x398b7f;}var _0x571f4e={'from':(_0x448cb9['contact'][_0x9fdd('0x3e')]||'')+'\x20'+(_0x448cb9['contact'][_0x9fdd('0x3f')]||'')};if(_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xb6')]&&_0x2dbeab['body'][_0x9fdd('0xbd')]&&_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xb6')]!=_0x2dbeab[_0x9fdd('0x66')]['messageId']){_0x571f4e[_0x9fdd('0xb6')]=_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0xbd')];}return _0x398b7f[_0x9fdd('0x2f')](_0x571f4e);})[_0x9fdd('0x1b')](function(_0x578a5b){_0x448cb9[_0x9fdd('0xbc')]=_0x578a5b[_0x9fdd('0x31')]({'plain':!![]});_0x448cb9[_0x9fdd('0xbc')][_0x9fdd('0xbe')]=!_0x6cca8e;if(_0x448cb9[_0x9fdd('0xbc')]['created']){if(_0x448cb9[_0x9fdd('0xae')]['autoclose']){_0x448cb9[_0x9fdd('0xbf')][_0x9fdd('0xc0')]({'id':0x0,'priority':_0x448cb9['applications'][_0x9fdd('0x58')]+0x1,'app':'close','appdata':_0x9fdd('0xc1'),'interval':_0x9fdd('0xc2')});}}return db[_0x9fdd('0xc3')][_0x9fdd('0x65')]({'body':_0x2dbeab[_0x9fdd('0x66')][_0x9fdd('0x66')],'ChatWebsiteId':_0x2dbeab[_0x9fdd('0x72')]['id'],'ChatInteractionId':_0x578a5b['id'],'direction':'in','ContactId':_0x448cb9['contact']['id'],'AttachmentId':_0x2dbeab['body'][_0x9fdd('0xc4')]});})[_0x9fdd('0x1b')](function(_0x47ca62){_0x448cb9[_0x9fdd('0x23')]=_0x47ca62;if(!_0x448cb9['interaction']['UserId']){return;}return db[_0x9fdd('0xc5')][_0x9fdd('0x74')]({'attributes':['id',_0x9fdd('0x35')],'where':{'id':_0x448cb9[_0x9fdd('0xbc')]['UserId']}});})[_0x9fdd('0x1b')](function(_0x21e1dd){if(_0x21e1dd){_0x448cb9[_0x9fdd('0xbf')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9fdd('0xc6'),'appdata':_0x21e1dd[_0x9fdd('0x35')]+','+(_0x448cb9['account'][_0x9fdd('0xc7')]||0xa),'interval':_0x9fdd('0xc2')});_0x448cb9[_0x9fdd('0xc8')]=!![];}if(!_0x448cb9[_0x9fdd('0xbc')][_0x9fdd('0xc9')]){return;}return db[_0x9fdd('0xca')]['find']({'attributes':['id','name'],'where':{'id':_0x448cb9[_0x9fdd('0xbc')][_0x9fdd('0xc9')]}});})[_0x9fdd('0x1b')](function(_0x390c0f){if(_0x390c0f){_0x448cb9[_0x9fdd('0xbf')][_0x9fdd('0xcb')]({'id':0x0,'priority':0x1,'app':_0x9fdd('0xcc'),'appdata':_0x390c0f[_0x9fdd('0x35')]+','+(_0x448cb9[_0x9fdd('0xae')][_0x9fdd('0xcd')]||0x12c),'interval':_0x9fdd('0xc2')});}return respondWithRpcPromise(_0x9fdd('0xce'),_0x9fdd('0xcf'),_0x448cb9);})[_0x9fdd('0x1b')](function(_0x3f81b9){respondWithRpcPromise(_0x9fdd('0xd0'),_0x9fdd('0xd0'),{'event':_0x9fdd('0xd1'),'message':_0x3f81b9},client9002);return _0x3f81b9;})[_0x9fdd('0x1b')](respondWithResult(_0x44463d,null))[_0x9fdd('0x25')](APIHandleError(_0x44463d));};exports[_0x9fdd('0xd2')]=function(_0xf51a7,_0x5924b3){var _0x5290b3,_0x347290,_0x2aa690;var _0x6f904e=[];var _0x57af83={};var _0x5c3ca1=_0xf51a7[_0x9fdd('0xd3')]||[];var _0x2cbc9e=[];var _0x5aaacf;return db[_0x9fdd('0xa1')][_0x9fdd('0x73')]()[_0x9fdd('0x1b')](function(_0x359720){if(!_0x359720){throw new db[(_0x9fdd('0xd4'))][(_0x9fdd('0xd5'))](_0x9fdd('0xd6'));}_0x6f904e=_[_0x9fdd('0xd7')](_[_0x9fdd('0x53')](_0x359720),['createdAt','updatedAt','CompanyId',_0x9fdd('0xb3')]);if(_0xf51a7[_0x9fdd('0x66')]['id']){delete _0xf51a7['body']['id'];}if(_['isNil'](_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xa5')])){throw _0x5924b3[_0x9fdd('0x27')](0x1f4)[_0x9fdd('0x36')](new db['Sequelize'][(_0x9fdd('0xd5'))](_0x9fdd('0xd8')));}if(_[_0x9fdd('0x8d')](_0xf51a7['body']['body'])||_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0x66')]===''){throw _0x5924b3[_0x9fdd('0x27')](0x1f4)[_0x9fdd('0x36')](new db['Sequelize'][(_0x9fdd('0xd5'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9fdd('0x8d')](_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xd9')])){throw _0x5924b3[_0x9fdd('0x27')](0x1f4)[_0x9fdd('0x36')](new db[(_0x9fdd('0xd4'))][(_0x9fdd('0xd5'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6f904e));}if(!_[_0x9fdd('0xda')](_0x6f904e,_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xd9')])){throw _0x5924b3[_0x9fdd('0x27')](0x1f4)['send'](new db[(_0x9fdd('0xd4'))][(_0x9fdd('0xd5'))](_0x9fdd('0xdb')+_0x6f904e));}_0x57af83[_0xf51a7['body'][_0x9fdd('0xd9')]]=_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xa5')];})[_0x9fdd('0x1b')](function(){return db['ChatWebsite']['find']({'where':{'id':_0xf51a7[_0x9fdd('0x72')]['id']},'include':[{'model':db[_0x9fdd('0xa6')],'as':_0x9fdd('0xb2')},{'model':db[_0x9fdd('0xdc')],'as':_0x9fdd('0xdc')}]});})[_0x9fdd('0x1b')](handleEntityNotFound(_0x5924b3,null))[_0x9fdd('0x1b')](function(_0x5b1900){if(_0x5b1900&&_0x5b1900['List']){_0x347290=_0x5b1900;var _0x5defee=_['defaults'](_0xf51a7[_0x9fdd('0x66')],{'firstName':_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xa5')],'phone':_0xf51a7['body']['from'],'ListId':_0x5b1900[_0x9fdd('0xb3')]});_0x5defee[_0xf51a7['body'][_0x9fdd('0xd9')]]=_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0xa5')];return db['CmContact'][_0x9fdd('0xdd')]({'where':_0x57af83,'defaults':_0x5defee});}})[_0x9fdd('0xde')](function(_0x2e22e7){if(_0x2e22e7){_0x2aa690=_0x2e22e7;var _0x36f866=fs[_0x9fdd('0xdf')](path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0xe0')),_0x9fdd('0xe1'));var _0x28516a=ejs['render'](_0x36f866,{'body':_[_0x9fdd('0xe2')](_0xf51a7[_0x9fdd('0x66')][_0x9fdd('0x66')]),'bodyTitle':_0x347290[_0x9fdd('0xe3')]});return db[_0x9fdd('0xe4')]['create']({'body':_0x28516a,'plainBody':htmlToText[_0x9fdd('0xe5')](_0x28516a),'ContactId':_0x2e22e7['id'],'ChatWebsiteId':_0x347290['id']});}})[_0x9fdd('0x1b')](function(_0x2aceb9){_0x5aaacf=_0x2aceb9;if(_0x5c3ca1[_0x9fdd('0x58')]){var _0x2ffd95=_0x5c3ca1[_0x9fdd('0x4d')](function(_0x530ca8){return{'name':_0x530ca8[_0x9fdd('0xe6')],'basename':_0x530ca8['filename'],'type':_0x530ca8['mimetype'],'ChatOfflineMessageId':_0x2aceb9['id']};});_0x2cbc9e=_0x2ffd95[_0x9fdd('0x4d')](_0x3caab5=>{var _0x3ba290={'filename':_0x3caab5[_0x9fdd('0x35')],'path':path[_0x9fdd('0x89')](config[_0x9fdd('0x8f')],_0x9fdd('0xe7'),_0x9fdd('0xd3'),_0x9fdd('0xe8'),_0x9fdd('0xe9'),_0x3caab5['basename'])};return _0x3ba290;});if(!_0x347290[_0x9fdd('0xea')]){return db[_0x9fdd('0xeb')][_0x9fdd('0xec')](function(_0x5e3bd6){return db[_0x9fdd('0xed')]['bulkCreate'](_0x2ffd95,{'transaction':_0x5e3bd6});});}}})[_0x9fdd('0x1b')](function(){if(_0x5aaacf){_0x5290b3=_0x5aaacf;return db[_0x9fdd('0xdc')][_0x9fdd('0x76')]({'where':{'service':!![]},'include':[{'model':db[_0x9fdd('0xee')],'as':_0x9fdd('0xef'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9fdd('0xf0'),'raw':!![]}]}]});}})['then'](function(_0x931b43){if(_0x931b43&&_0x931b43[_0x9fdd('0xef')]&&_0x347290['forwardOffline']&&_0x347290[_0x9fdd('0xf1')]){var _0x192aec=_0x931b43[_0x9fdd('0xf2')]();return respondWithRpcPromise(_0x9fdd('0xf3'),_0x9fdd('0xf4'),{'account':_0x192aec,'message':{'from':util[_0x9fdd('0x44')](_0x9fdd('0xf5'),_0x931b43[_0x9fdd('0x35')],_0x931b43[_0x9fdd('0xf6')]||_0x931b43['Smtp'][_0x9fdd('0x6d')]),'to':_0x347290[_0x9fdd('0xf1')],'subject':_0x347290[_0x9fdd('0xf7')],'html':_0x5290b3[_0x9fdd('0x66')],'attachments':_0x2cbc9e}},client9003)['then'](function(){return _0x5290b3;})[_0x9fdd('0x25')](function(_0x5c3379){logger[_0x9fdd('0x21')](_0x5c3379);});}})[_0x9fdd('0x1b')](function(){if(_0x347290&&_0x347290['openNewInteraction']&&_0x347290[_0x9fdd('0xf8')]){var _0x2cd4ad=[];if(_0x5c3ca1[_0x9fdd('0x58')]){_0x2cd4ad=_0x5c3ca1['map'](function(_0x4f20e0){return{'name':_0x4f20e0['originalname'],'basename':_0x4f20e0[_0x9fdd('0x81')],'type':_0x4f20e0[_0x9fdd('0xf9')],'ChatOfflineMessageId':_0x5aaacf['id']};});}var _0x504f34;if(!_[_0x9fdd('0x8d')](_0x347290[_0x9fdd('0xfa')])){var _0xfca88b=_[_0x9fdd('0x4d')](_0xf51a7[_0x9fdd('0x66')],function(_0x32b40f){return _0x32b40f;});var _0x2926cc=_[_0x9fdd('0xfb')](_0xfca88b)[0x0];var _0x2a94c8=_['mapValues'](_0x2926cc,function(_0x553f3a){return _0x553f3a;});_0x504f34=_0x2a94c8[0x1][_0x347290['subjectOffline']];}var _0x3d0127={'from':_0x2aa690[_0x9fdd('0xf6')],'firstName':_0x2aa690[_0x9fdd('0x3e')],'lastName':_0x2aa690[_0x9fdd('0x3f')],'mapKey':_0x9fdd('0xf6'),'message':{'from':_0x2aa690[_0x9fdd('0xf6')],'to':_0x347290[_0x9fdd('0xdc')][_0x9fdd('0xf6')],'cc':'','subject':_[_0x9fdd('0x8d')](_0x504f34)?_0x347290[_0x9fdd('0xf7')]:_0x504f34,'messageId':'','sentAt':new Date(),'attach':_0x2cd4ad[_0x9fdd('0x58')],'attachments':_0x2cd4ad,'originChannel':_0x9fdd('0xfc'),'ChatWebsiteId':_0x347290['id'],'ChatOfflineMessageId':_0x5290b3['id'],'originTo':_0x347290[_0x9fdd('0xdc')][_0x9fdd('0xf6')]},'body':_0x5290b3['body']};var _0x5ea171={'account':{'id':_0x347290['MailAccountId']},'body':_0x3d0127,'log':_0x9fdd('0xfd')};return respondWithRpcPromise(_0x9fdd('0xfd'),'notifyMail',_0x5ea171,client9001)[_0x9fdd('0x1b')](function(){return _0x5290b3;})[_0x9fdd('0x25')](function(_0x47ac48){logger[_0x9fdd('0x21')](_0x47ac48);});}return;})[_0x9fdd('0x1b')](function(){if(_0x5290b3){return _0x5290b3;}})['then'](respondWithResult(_0x5924b3,null))[_0x9fdd('0x25')](function(){for(var _0x97ae7e of _0x5c3ca1){var _0xeec68=path[_0x9fdd('0x89')](config['root'],_0x9fdd('0xe7'),_0x9fdd('0xd3'),_0x9fdd('0xe8'),_0x9fdd('0xe9'),_0x97ae7e[_0x9fdd('0x81')]);fs_extra['remove'](_0xeec68)[_0x9fdd('0x25')](function(_0x25deee){logger[_0x9fdd('0x21')](_0x9fdd('0xfe'),_0xeec68,_0x25deee);});}});};exports[_0x9fdd('0xff')]=function(_0x587be8,_0xc6e576){return db['ChatInteraction'][_0x9fdd('0x74')]({'where':{'id':_0x587be8[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0xc6e576,null))[_0x9fdd('0x1b')](function(_0x1b43c1){if(_0x1b43c1){return _0x1b43c1[_0x9fdd('0xff')](_0x587be8[_0x9fdd('0x66')][_0x9fdd('0x7b')],_['omit'](_0x587be8['body'],[_0x9fdd('0x7b'),'id'])||{});}})[_0x9fdd('0x1b')](respondWithResult(_0xc6e576,null))[_0x9fdd('0x25')](handleError(_0xc6e576,null));};exports[_0x9fdd('0x100')]=function(_0x6af528,_0x3412ab){var _0x4f8409={'raw':![],'where':{}};var _0x4b0356={};var _0x4f0a13={'count':0x0,'rows':[]};return db[_0x9fdd('0x4e')][_0x9fdd('0x76')]({'where':{'id':_0x6af528[_0x9fdd('0x72')]['id']}})['then'](handleEntityNotFound(_0x3412ab,null))[_0x9fdd('0x1b')](function(_0x5b4fe5){if(_0x5b4fe5){_0x4b0356[_0x9fdd('0x48')]=_[_0x9fdd('0x53')](db[_0x9fdd('0xb8')]['rawAttributes']);_0x4b0356['query']=_[_0x9fdd('0x53')](_0x6af528[_0x9fdd('0x52')]);_0x4b0356['filters']=_['intersection'](_0x4b0356[_0x9fdd('0x48')],_0x4b0356[_0x9fdd('0x52')]);_0x4f8409['attributes']=_[_0x9fdd('0x56')](_0x4b0356[_0x9fdd('0x48')],qs['fields'](_0x6af528[_0x9fdd('0x52')]['fields']));_0x4f8409[_0x9fdd('0x55')]=_0x4f8409[_0x9fdd('0x55')]['length']?_0x4f8409['attributes']:_0x4b0356['model'];if(!_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x4f8409[_0x9fdd('0x29')]=qs['limit'](_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x4f8409[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}_0x4f8409['order']=qs[_0x9fdd('0x5c')](_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x4f8409[_0x9fdd('0x5d')]=qs['filters'](_[_0x9fdd('0x5e')](_0x6af528[_0x9fdd('0x52')],_0x4b0356[_0x9fdd('0x54')]));_0x4f8409[_0x9fdd('0x5d')][_0x9fdd('0x75')]=_0x5b4fe5['id'];if(_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x5f')]){_0x4f8409[_0x9fdd('0x5d')]=_['merge'](_0x4f8409[_0x9fdd('0x5d')],{'$or':_['map'](_0x4f8409[_0x9fdd('0x55')],function(_0x1d032f){var _0x245047={};_0x245047[_0x1d032f]={'$like':'%'+_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x5f')]+'%'};return _0x245047;})});}_0x4f8409=_[_0x9fdd('0x61')]({},_0x4f8409,_0x6af528[_0x9fdd('0x62')]);return db[_0x9fdd('0xb8')][_0x9fdd('0x2b')]({'where':_0x4f8409[_0x9fdd('0x5d')]})[_0x9fdd('0x1b')](function(_0x10a696){_0x4f0a13[_0x9fdd('0x2b')]=_0x10a696;if(_0x6af528['query']['includeAll']){_0x4f8409[_0x9fdd('0x63')]=[{'model':db[_0x9fdd('0xa1')],'as':_0x9fdd('0x101'),'required':![]},{'model':db['User'],'as':_0x9fdd('0x102'),'attributes':[_0x9fdd('0x35'),_0x9fdd('0x103'),'internal'],'required':![]},{'model':db[_0x9fdd('0x104')],'as':_0x9fdd('0x105'),'attributes':['id',_0x9fdd('0x35'),_0x9fdd('0x106')],'where':_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x107')]?{'id':_0x6af528['query'][_0x9fdd('0x107')]}:undefined,'required':_0x6af528[_0x9fdd('0x52')][_0x9fdd('0x107')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x4f8409);})[_0x9fdd('0x1b')](function(_0x5f0482){_0x4f0a13[_0x9fdd('0x64')]=_0x5f0482;return _0x4f0a13;});}})[_0x9fdd('0x1b')](respondWithFilteredResult(_0x3412ab,_0x4f8409))['catch'](handleError(_0x3412ab,null));};exports[_0x9fdd('0x108')]=function(_0x3cc0ed,_0x2938a5){var _0x5b09df=0x0;var _0x6ad56=0x0;var _0x42ac2f=![];var _0x2e9d61;var _0x1b2b77;return db[_0x9fdd('0x4e')]['find']({'where':{'id':_0x3cc0ed['params']['id']},'include':[{'model':db[_0x9fdd('0xab')],'as':_0x9fdd('0xab'),'include':[{'model':db[_0x9fdd('0xab')],'as':_0x9fdd('0x109'),'attributes':['id',_0x9fdd('0xac')]}]}]})[_0x9fdd('0x1b')](handleEntityNotFound(_0x2938a5,null))['then'](function(_0x5d8630){if(_0x5d8630){_0x2e9d61=_0x5d8630;return _0x5d8630[_0x9fdd('0x10a')]({'raw':!![]});}})[_0x9fdd('0x1b')](function(_0x240190){if(_0x2e9d61){if(_0x240190){_0x1b2b77=_0x240190;}}return require(_0x9fdd('0x10b'))[_0x9fdd('0x8c')]();})[_0x9fdd('0x1b')](function(_0x2ff3ba){if(_0x2ff3ba){_0x6ad56=_0x2ff3ba['virtual'];_0x42ac2f=_0x2ff3ba[_0x9fdd('0x10c')];}})[_0x9fdd('0x1b')](function(){return db['ChatInteraction'][_0x9fdd('0x2b')]({'where':{'closed':![]}});})[_0x9fdd('0x1b')](function(_0x102939){_0x5b09df=_0x102939;if(_0x6ad56&&_0x102939>_0x6ad56){return db['License']['findOne']({'where':{'id':0x1}})[_0x9fdd('0x1b')](function(_0x91e7ac){if(_0x91e7ac){_0x91e7ac[_0x9fdd('0x10d')](_0x9fdd('0x10e'));}});}})['then'](function(){var _0x3ddec3=_0x2e9d61[_0x9fdd('0xab')];var _0x1774ac=_0x2e9d61['timezone']||undefined;return _0x3ddec3?_0x3ddec3[_0x9fdd('0x9a')](_0x1774ac):!![];})[_0x9fdd('0x1b')](function(_0x57da6d){var _0x3ed8a1=fs[_0x9fdd('0xdf')](path['join'](config[_0x9fdd('0x8f')],_0x9fdd('0x10f')),_0x9fdd('0xe1'));var _0x28b7b4=_0x9fdd('0x110');var _0x1f9a0f=![];var _0x2c02d5,_0x429a29;if(_0x3cc0ed[_0x9fdd('0xb5')][_0x9fdd('0x41')]){_0x2c02d5=new URL(_0x3cc0ed['headers'][_0x9fdd('0x41')])[_0x9fdd('0x111')];}else if(_0x3cc0ed['headers'][_0x9fdd('0x111')]){_0x2c02d5=new URL(_0x3cc0ed[_0x9fdd('0xb5')][_0x9fdd('0x111')])[_0x9fdd('0x111')];}else{_0x2c02d5=_0x9fdd('0x112');}_0x429a29=typeof _0x2e9d61[_0x9fdd('0x67')][_0x9fdd('0x3d')](',')[_0x9fdd('0x74')](function(_0xa3d8a8){return wildcardUtils['testWebsiteWithWildcard'](_0xa3d8a8,_0x2c02d5);})!==_0x9fdd('0x2a');var _0x203f72={'chatVersion':_0x28b7b4,'chatWebsiteAddressOrigin':_0x429a29?_0x3cc0ed['headers'][_0x9fdd('0x41')]:_0x2e9d61['address'],'remote':_0x2e9d61[_0x9fdd('0x113')],'query':querystring[_0x9fdd('0x20')](_[_0x9fdd('0x61')](_0x2e9d61[_0x9fdd('0x31')]({'plain':!![]}),{'customerIp':_0x3cc0ed[_0x9fdd('0xb5')][_0x9fdd('0x3c')]||_0x3cc0ed['headers']['x-real-ip']||_0x3cc0ed[_0x9fdd('0x114')][_0x9fdd('0x115')]||_0x3cc0ed['ip'],'referer':_0x3cc0ed[_0x9fdd('0xb5')][_0x9fdd('0x41')],'openedInteractions':_0x5b09df,'maxInteractions':_0x6ad56,'virtual':_0x42ac2f['virtual'],'online':_0x57da6d,'custom':_0x42ac2f,'address':_0x429a29?_0x3cc0ed[_0x9fdd('0xb5')][_0x9fdd('0x41')]:null}))[_0x9fdd('0x116')](/'/g,'\x5c\x27')};_0x2938a5[_0x9fdd('0x36')](ejs[_0x9fdd('0x117')](Mustache['render'](_0x3ed8a1,_0x203f72),{'proactiveActions':_0x1b2b77,'alignment':_0x2e9d61[_0x9fdd('0x118')],'verticalAlignment':_0x2e9d61[_0x9fdd('0x119')],'div_color':_0x2e9d61[_0x9fdd('0x106')],'labelText':_0x2e9d61[_0x9fdd('0x11a')],'text_color':_0x2e9d61[_0x9fdd('0x11b')],'text_button_color':_0x2e9d61[_0x9fdd('0x11c')],'button_color':_0x2e9d61[_0x9fdd('0x11d')],'background_color':_0x2e9d61['backgroundColor'],'hideWhenOffline':_0x2e9d61[_0x9fdd('0x11e')],'intervalId':_0x2e9d61[_0x9fdd('0x11f')],'isDevelopment':_0x1f9a0f,'chatVersion':_0x28b7b4}));})['catch'](handleError(_0x2938a5,null));};exports[_0x9fdd('0x120')]=function(_0x361056,_0x3c3a94){var _0x5411a8=_0x361056[_0x9fdd('0x72')]['id'];var _0x22121e=_0x361056[_0x9fdd('0x66')];var _0x3ad1ab=0xc8;var _0x3d10bd=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9fdd('0xeb')][_0x9fdd('0x121')][_0x9fdd('0x122')][_0x9fdd('0x123')]},function(_0x306c02){return db[_0x9fdd('0x4e')]['findOne']({'where':{'id':_0x5411a8},'transaction':_0x306c02})[_0x9fdd('0x1b')](function(_0x320736){if(_0x320736){return db[_0x9fdd('0xa9')][_0x9fdd('0x30')]({'where':{'ChatWebsiteId':_0x5411a8},'transaction':_0x306c02})[_0x9fdd('0x1b')](function(){var _0x44cd68=_[_0x9fdd('0x4d')](_0x22121e,function(_0x13b5e1){_0x13b5e1[_0x9fdd('0x75')]=_0x5411a8;return _0x13b5e1;});return db[_0x9fdd('0xa9')][_0x9fdd('0x124')](_0x44cd68,{'transaction':_0x306c02});});}else{_0x3ad1ab=0x194;_0x3d10bd=[];}});})[_0x9fdd('0x1b')](function(){if(_0x3ad1ab!==0x194){return db['ChatApplication'][_0x9fdd('0x125')]({'where':{'ChatWebsiteId':_0x5411a8},'order':_0x9fdd('0xb0')})['then'](function(_0xb37f41){_0x3d10bd=_0xb37f41;});}})[_0x9fdd('0x25')](function(_0x16ee20){_0x3ad1ab=0x1f4;logger[_0x9fdd('0x21')](_0x16ee20['stack']);if(_0x16ee20['name']){delete _0x16ee20[_0x9fdd('0x35')];}_0x3d10bd=_0x16ee20;})[_0x9fdd('0x126')](function(){if(_0x3d10bd===null){_0x3c3a94[_0x9fdd('0x26')](_0x3ad1ab);}else{if(_0x3ad1ab===0x1f4){_0x3c3a94[_0x9fdd('0x27')](_0x3ad1ab)[_0x9fdd('0x36')](_0x3d10bd);}else{_0x3c3a94[_0x9fdd('0x27')](_0x3ad1ab)[_0x9fdd('0x28')](_0x3d10bd);}}});};exports[_0x9fdd('0x127')]=function(_0x1570d0,_0x577f0a){var _0x1c56c8={};var _0x173295={};var _0x438cf1;var _0x484563;return db[_0x9fdd('0x4e')][_0x9fdd('0x76')]({'where':{'id':_0x1570d0['params']['id']}})['then'](handleEntityNotFound(_0x577f0a,null))[_0x9fdd('0x1b')](function(_0x11e036){if(_0x11e036){_0x438cf1=_0x11e036;_0x173295['model']=_[_0x9fdd('0x53')](db[_0x9fdd('0xa9')][_0x9fdd('0x4f')]);_0x173295[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x1570d0[_0x9fdd('0x52')]);_0x173295['filters']=_[_0x9fdd('0x56')](_0x173295[_0x9fdd('0x48')],_0x173295['query']);_0x1c56c8[_0x9fdd('0x55')]=_[_0x9fdd('0x56')](_0x173295[_0x9fdd('0x48')],qs[_0x9fdd('0x57')](_0x1570d0[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x1c56c8[_0x9fdd('0x55')]=_0x1c56c8[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x1c56c8[_0x9fdd('0x55')]:_0x173295[_0x9fdd('0x48')];_0x1c56c8[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0x1570d0['query'][_0x9fdd('0x5c')]);_0x1c56c8[_0x9fdd('0x5d')]=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0x1570d0[_0x9fdd('0x52')],_0x173295['filters']));if(_0x1570d0[_0x9fdd('0x52')][_0x9fdd('0x5f')]){_0x1c56c8[_0x9fdd('0x5d')]=_[_0x9fdd('0x61')](_0x1c56c8[_0x9fdd('0x5d')],{'$or':_[_0x9fdd('0x4d')](_0x1c56c8['attributes'],function(_0x47b8cd){var _0x29f655={};_0x29f655[_0x47b8cd]={'$like':'%'+_0x1570d0[_0x9fdd('0x52')][_0x9fdd('0x5f')]+'%'};return _0x29f655;})});}_0x1c56c8=_[_0x9fdd('0x61')]({},_0x1c56c8,_0x1570d0[_0x9fdd('0x62')]);return _0x438cf1[_0x9fdd('0x127')](_0x1c56c8);}})[_0x9fdd('0x1b')](function(_0x50109a){if(_0x50109a){_0x484563=_0x50109a[_0x9fdd('0x58')];if(!_0x1570d0[_0x9fdd('0x52')]['hasOwnProperty']('nolimit')){_0x1c56c8[_0x9fdd('0x29')]=qs[_0x9fdd('0x29')](_0x1570d0[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x1c56c8[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x1570d0[_0x9fdd('0x52')]['offset']);}return _0x438cf1[_0x9fdd('0x127')](_0x1c56c8);}})[_0x9fdd('0x1b')](function(_0x36fbd7){if(_0x36fbd7){return _0x36fbd7?{'count':_0x484563,'rows':_0x36fbd7}:null;}})[_0x9fdd('0x1b')](respondWithResult(_0x577f0a,null))[_0x9fdd('0x25')](handleError(_0x577f0a,null));};exports[_0x9fdd('0x128')]=function(_0x51899b,_0x30aef5){return db['chatProactiveAction'][_0x9fdd('0x74')]({'where':{'id':_0x51899b[_0x9fdd('0x72')]['id']}})['then'](handleEntityNotFound(_0x30aef5,null))[_0x9fdd('0x1b')](function(_0x25e58e){if(_0x25e58e){return _0x25e58e[_0x9fdd('0x128')](_0x51899b[_0x9fdd('0x66')][_0x9fdd('0x7b')],_['omit'](_0x51899b['body'],[_0x9fdd('0x7b'),'id'])||{});}})[_0x9fdd('0x1b')](respondWithResult(_0x30aef5,null))[_0x9fdd('0x25')](handleError(_0x30aef5,null));};exports[_0x9fdd('0x10a')]=function(_0x52e2bd,_0x31d369){var _0x28a4b0={};var _0x138251={};var _0x35a633;var _0x3f8619;return db[_0x9fdd('0x4e')]['findOne']({'where':{'id':_0x52e2bd[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x31d369,null))[_0x9fdd('0x1b')](function(_0x27c07d){if(_0x27c07d){_0x35a633=_0x27c07d;_0x138251['model']=_[_0x9fdd('0x53')](db[_0x9fdd('0x129')]['rawAttributes']);_0x138251[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x52e2bd[_0x9fdd('0x52')]);_0x138251[_0x9fdd('0x54')]=_['intersection'](_0x138251['model'],_0x138251[_0x9fdd('0x52')]);_0x28a4b0[_0x9fdd('0x55')]=_[_0x9fdd('0x56')](_0x138251[_0x9fdd('0x48')],qs[_0x9fdd('0x57')](_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x28a4b0['attributes']=_0x28a4b0[_0x9fdd('0x55')]['length']?_0x28a4b0[_0x9fdd('0x55')]:_0x138251[_0x9fdd('0x48')];_0x28a4b0[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x28a4b0['where']=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0x52e2bd[_0x9fdd('0x52')],_0x138251[_0x9fdd('0x54')]));if(_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x5f')]){_0x28a4b0[_0x9fdd('0x5d')]=_['merge'](_0x28a4b0[_0x9fdd('0x5d')],{'$or':_['map'](_0x28a4b0['attributes'],function(_0x3ac30c){var _0x3158d0={};_0x3158d0[_0x3ac30c]={'$like':'%'+_0x52e2bd['query'][_0x9fdd('0x5f')]+'%'};return _0x3158d0;})});}_0x28a4b0=_[_0x9fdd('0x61')]({},_0x28a4b0,_0x52e2bd[_0x9fdd('0x62')]);return _0x35a633['getProactiveActions'](_0x28a4b0);}})[_0x9fdd('0x1b')](function(_0x44a954){if(_0x44a954){_0x3f8619=_0x44a954[_0x9fdd('0x58')];if(!_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x28a4b0['limit']=qs[_0x9fdd('0x29')](_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x28a4b0[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x52e2bd[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}return _0x35a633[_0x9fdd('0x10a')](_0x28a4b0);}})[_0x9fdd('0x1b')](function(_0x27f8e3){if(_0x27f8e3){return _0x27f8e3?{'count':_0x3f8619,'rows':_0x27f8e3}:null;}})[_0x9fdd('0x1b')](respondWithResult(_0x31d369,null))[_0x9fdd('0x25')](handleError(_0x31d369,null));};exports[_0x9fdd('0x12a')]=function(_0x42ad42,_0x4bfbe1){var _0x3ad609=_0x42ad42[_0x9fdd('0x52')][_0x9fdd('0x12b')]===_0x9fdd('0x12c')?_0x9fdd('0x12d'):'onlineForm';return db[_0x9fdd('0x4e')]['find']({'attributes':['id',_0x3ad609],'where':{'id':_0x42ad42[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x4bfbe1,null))[_0x9fdd('0x1b')](function(_0x37ffd7){if(_0x37ffd7){var _0x13abdf=_0x37ffd7[_0x3ad609];var _0x34cccf=_0x13abdf&&_0x13abdf[_0x9fdd('0x12e')]?_0x13abdf['items']:[];_0x4bfbe1[_0x9fdd('0x36')]({'fromKey':_[_0x9fdd('0x8d')](_0x13abdf[_0x9fdd('0x12f')])?undefined:_0x13abdf['fromKey'],'count':_0x34cccf['length'],'rows':_0x34cccf});}})[_0x9fdd('0x25')](handleError(_0x4bfbe1,null));};exports['getOfflineMessages']=function(_0x550cb4,_0x4bbc04){var _0x589d4b={'raw':![],'where':{}};var _0x2b2414={};var _0x55ee73={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9fdd('0x76')]({'where':{'id':_0x550cb4[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x4bbc04,null))[_0x9fdd('0x1b')](function(_0x440fc3){if(_0x440fc3){_0x2b2414[_0x9fdd('0x48')]=_[_0x9fdd('0x53')](db[_0x9fdd('0xe4')][_0x9fdd('0x4f')]);_0x2b2414[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x550cb4['query']);_0x2b2414[_0x9fdd('0x54')]=_['intersection'](_0x2b2414[_0x9fdd('0x48')],_0x2b2414[_0x9fdd('0x52')]);_0x589d4b[_0x9fdd('0x55')]=_['intersection'](_0x2b2414[_0x9fdd('0x48')],qs[_0x9fdd('0x57')](_0x550cb4[_0x9fdd('0x52')]['fields']));_0x589d4b[_0x9fdd('0x55')]=_0x589d4b[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x589d4b[_0x9fdd('0x55')]:_0x2b2414[_0x9fdd('0x48')];if(!_0x550cb4[_0x9fdd('0x52')][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x589d4b[_0x9fdd('0x29')]=qs[_0x9fdd('0x29')](_0x550cb4[_0x9fdd('0x52')]['limit']);_0x589d4b[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x550cb4[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}_0x589d4b[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0x550cb4[_0x9fdd('0x52')][_0x9fdd('0x5c')]);_0x589d4b['where']=qs[_0x9fdd('0x54')](_[_0x9fdd('0x5e')](_0x550cb4['query'],_0x2b2414[_0x9fdd('0x54')]));_0x589d4b[_0x9fdd('0x5d')][_0x9fdd('0x75')]=_0x440fc3['id'];if(_0x550cb4['query'][_0x9fdd('0x5f')]){_0x589d4b['where']=_[_0x9fdd('0x61')](_0x589d4b[_0x9fdd('0x5d')],{'$or':_[_0x9fdd('0x4d')](_0x589d4b[_0x9fdd('0x55')],function(_0x4761bd){var _0x516b70={};_0x516b70[_0x4761bd]={'$like':'%'+_0x550cb4[_0x9fdd('0x52')][_0x9fdd('0x5f')]+'%'};return _0x516b70;})});}_0x589d4b=_[_0x9fdd('0x61')]({},_0x589d4b,_0x550cb4['options']);return db[_0x9fdd('0xe4')]['count']({'where':_0x589d4b[_0x9fdd('0x5d')]})[_0x9fdd('0x1b')](function(_0x352928){_0x55ee73[_0x9fdd('0x2b')]=_0x352928;if(_0x550cb4['query'][_0x9fdd('0x78')]){_0x589d4b[_0x9fdd('0x63')]=[{'all':!![]}];}else{_0x589d4b[_0x9fdd('0x63')]=[{'model':db[_0x9fdd('0xa1')],'as':_0x9fdd('0x101'),'required':![]},{'model':db['Attachment'],'as':_0x9fdd('0x130'),'required':![]}];}return db[_0x9fdd('0xe4')][_0x9fdd('0x79')](_0x589d4b);})['then'](function(_0x9d1844){_0x55ee73[_0x9fdd('0x64')]=_0x9d1844;return _0x55ee73;});}})[_0x9fdd('0x1b')](respondWithFilteredResult(_0x4bbc04,_0x589d4b))['catch'](handleError(_0x4bbc04,null));};exports[_0x9fdd('0x131')]=function(_0x367a66,_0x4bea21){return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x367a66['params']['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x4bea21,null))[_0x9fdd('0x1b')](function(_0x424196){if(_0x424196){return _0x424196[_0x9fdd('0x131')](_0x367a66[_0x9fdd('0x66')][_0x9fdd('0x7b')],_[_0x9fdd('0x132')](_0x367a66[_0x9fdd('0x66')],[_0x9fdd('0x7b'),'id'])||{})['spread'](function(_0x203a9a){for(var _0x32c8c9=0x0;_0x32c8c9<_0x367a66['body']['ids'][_0x9fdd('0x58')];_0x32c8c9+=0x1){socket[_0x9fdd('0x133')]('userChatWebsite:save',{'UserId':Number(_0x367a66[_0x9fdd('0x66')][_0x9fdd('0x7b')][_0x32c8c9]),'ChatWebsiteId':Number(_0x367a66[_0x9fdd('0x72')]['id'])});}return _0x203a9a;});}})[_0x9fdd('0x1b')](respondWithResult(_0x4bea21,null))[_0x9fdd('0x25')](handleError(_0x4bea21,null));};exports[_0x9fdd('0x134')]=function(_0x14e944,_0x50bdb2){return db[_0x9fdd('0x4e')][_0x9fdd('0x74')]({'where':{'id':_0x14e944[_0x9fdd('0x72')]['id']}})['then'](handleEntityNotFound(_0x50bdb2,null))['then'](function(_0x275ba0){if(_0x275ba0){return _0x275ba0['removeAgents'](_0x14e944[_0x9fdd('0x52')][_0x9fdd('0x7b')])[_0x9fdd('0x1b')](function(){if(_[_0x9fdd('0x135')](_0x14e944['query'][_0x9fdd('0x7b')])){for(var _0x4a82da=0x0;_0x4a82da<_0x14e944[_0x9fdd('0x52')][_0x9fdd('0x7b')][_0x9fdd('0x58')];_0x4a82da+=0x1){socket[_0x9fdd('0x133')](_0x9fdd('0x136'),{'UserId':Number(_0x14e944[_0x9fdd('0x52')][_0x9fdd('0x7b')][_0x4a82da]),'ChatWebsiteId':Number(_0x14e944[_0x9fdd('0x72')]['id'])});}}else{socket[_0x9fdd('0x133')](_0x9fdd('0x136'),{'UserId':Number(_0x14e944['query'][_0x9fdd('0x7b')]),'ChatWebsiteId':Number(_0x14e944['params']['id'])});}});}})[_0x9fdd('0x1b')](respondWithStatusCode(_0x50bdb2,null))[_0x9fdd('0x25')](handleError(_0x50bdb2,null));};exports['getAgents']=function(_0x9ffce8,_0x4e0b63){var _0x1cb0dc={};var _0x47f85d={};var _0x40301e;var _0x531696;return db[_0x9fdd('0x4e')][_0x9fdd('0x76')]({'where':{'id':_0x9ffce8[_0x9fdd('0x72')]['id']}})[_0x9fdd('0x1b')](handleEntityNotFound(_0x4e0b63,null))[_0x9fdd('0x1b')](function(_0x2b6f94){if(_0x2b6f94){_0x40301e=_0x2b6f94;_0x47f85d[_0x9fdd('0x48')]=_[_0x9fdd('0x53')](db[_0x9fdd('0xc5')][_0x9fdd('0x4f')]);_0x47f85d[_0x9fdd('0x52')]=_[_0x9fdd('0x53')](_0x9ffce8[_0x9fdd('0x52')]);_0x47f85d['filters']=_[_0x9fdd('0x56')](_0x47f85d[_0x9fdd('0x48')],_0x47f85d['query']);_0x1cb0dc[_0x9fdd('0x55')]=_[_0x9fdd('0x56')](_0x47f85d[_0x9fdd('0x48')],qs['fields'](_0x9ffce8[_0x9fdd('0x52')][_0x9fdd('0x57')]));_0x1cb0dc[_0x9fdd('0x55')]=_0x1cb0dc[_0x9fdd('0x55')][_0x9fdd('0x58')]?_0x1cb0dc[_0x9fdd('0x55')]:_0x47f85d[_0x9fdd('0x48')];_0x1cb0dc[_0x9fdd('0x5b')]=qs[_0x9fdd('0x5c')](_0x9ffce8['query'][_0x9fdd('0x5c')]);_0x1cb0dc[_0x9fdd('0x5d')]=qs['filters'](_[_0x9fdd('0x5e')](_0x9ffce8['query'],_0x47f85d[_0x9fdd('0x54')]));if(_0x9ffce8[_0x9fdd('0x52')]['filter']){_0x1cb0dc[_0x9fdd('0x5d')]=_[_0x9fdd('0x61')](_0x1cb0dc['where'],{'$or':_[_0x9fdd('0x4d')](_0x1cb0dc[_0x9fdd('0x55')],function(_0x258fe2){var _0x4fd14d={};_0x4fd14d[_0x258fe2]={'$like':'%'+_0x9ffce8[_0x9fdd('0x52')][_0x9fdd('0x5f')]+'%'};return _0x4fd14d;})});}_0x1cb0dc=_[_0x9fdd('0x61')]({},_0x1cb0dc,_0x9ffce8['options']);return _0x40301e[_0x9fdd('0x137')](_0x1cb0dc);}})[_0x9fdd('0x1b')](function(_0x316684){if(_0x316684){_0x531696=_0x316684[_0x9fdd('0x58')];if(!_0x9ffce8['query'][_0x9fdd('0x59')](_0x9fdd('0x5a'))){_0x1cb0dc[_0x9fdd('0x29')]=qs['limit'](_0x9ffce8[_0x9fdd('0x52')][_0x9fdd('0x29')]);_0x1cb0dc[_0x9fdd('0x2c')]=qs[_0x9fdd('0x2c')](_0x9ffce8[_0x9fdd('0x52')][_0x9fdd('0x2c')]);}return _0x40301e[_0x9fdd('0x137')](_0x1cb0dc);}})[_0x9fdd('0x1b')](function(_0x3e8ccc){if(_0x3e8ccc){return _0x3e8ccc?{'count':_0x531696,'rows':_0x3e8ccc}:null;}})[_0x9fdd('0x1b')](respondWithResult(_0x4e0b63,null))[_0x9fdd('0x25')](handleError(_0x4e0b63,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 71039b2..06912ae 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 _0x975f=['exports','events','../../mysqldb','save','update','emit','hasOwnProperty','hook'];(function(_0x266a1c,_0x3da6b0){var _0x40bc82=function(_0x3181a6){while(--_0x3181a6){_0x266a1c['push'](_0x266a1c['shift']());}};_0x40bc82(++_0x3da6b0);}(_0x975f,0x109));var _0xf975=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0x975f[_0x128bef];return _0x1ba862;};'use strict';var EventEmitter=require(_0xf975('0x0'));var ChatWebsite=require(_0xf975('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf975('0x2'),'afterUpdate':_0xf975('0x3'),'afterDestroy':'remove'};function emitEvent(_0xc42ebe){return function(_0x2d047c,_0x26c58b,_0x83fa1e){ChatWebsiteEvents['emit'](_0xc42ebe+':'+_0x2d047c['id'],_0x2d047c);ChatWebsiteEvents[_0xf975('0x4')](_0xc42ebe,_0x2d047c);_0x83fa1e(null);};}for(var e in events){if(events[_0xf975('0x5')](e)){var event=events[e];ChatWebsite[_0xf975('0x6')](e,emitEvent(event));}}module[_0xf975('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5a93=['exports','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x247e29,_0x540032){var _0x5ec66e=function(_0x3519ee){while(--_0x3519ee){_0x247e29['push'](_0x247e29['shift']());}};_0x5ec66e(++_0x540032);}(_0x5a93,0xf6));var _0x35a9=function(_0x4f6864,_0xdb09cc){_0x4f6864=_0x4f6864-0x0;var _0xcd9bd1=_0x5a93[_0x4f6864];return _0xcd9bd1;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x35a9('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x35a9('0x1')](0x0);var events={'afterCreate':_0x35a9('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7dc79f){return function(_0xf10dcf,_0x3a23d6,_0x4f45aa){ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f+':'+_0xf10dcf['id'],_0xf10dcf);ChatWebsiteEvents[_0x35a9('0x3')](_0x7dc79f,_0xf10dcf);_0x4f45aa(null);};}for(var e in events){if(events[_0x35a9('0x4')](e)){var event=events[e];ChatWebsite[_0x35a9('0x5')](e,emitEvent(event));}}module[_0x35a9('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 382bb03..050bbcd 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 _0x94fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','chat_websites','lodash','util'];(function(_0x240d75,_0x1961c5){var _0x40b674=function(_0x4e6592){while(--_0x4e6592){_0x240d75['push'](_0x240d75['shift']());}};_0x40b674(++_0x1961c5);}(_0x94fb,0x8a));var _0xb94f=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x94fb[_0x175a55];return _0x167adf;};'use strict';var _=require(_0xb94f('0x0'));var util=require(_0xb94f('0x1'));var logger=require('../../config/logger')(_0xb94f('0x2'));var moment=require(_0xb94f('0x3'));var BPromise=require(_0xb94f('0x4'));var rp=require(_0xb94f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb94f('0x6'));var config=require(_0xb94f('0x7'));var attributes=require(_0xb94f('0x8'));module['exports']=function(_0x150a74,_0x11b66f){return _0x150a74['define']('ChatWebsite',attributes,{'tableName':_0xb94f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3eb=['request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','moment','bluebird'];(function(_0x2f042c,_0x4365f7){var _0x5e9ffb=function(_0x29ec66){while(--_0x29ec66){_0x2f042c['push'](_0x2f042c['shift']());}};_0x5e9ffb(++_0x4365f7);}(_0xe3eb,0x18e));var _0xbe3e=function(_0x126c5d,_0x12adb5){_0x126c5d=_0x126c5d-0x0;var _0x31eefe=_0xe3eb[_0x126c5d];return _0x31eefe;};'use strict';var _=require(_0xbe3e('0x0'));var util=require(_0xbe3e('0x1'));var logger=require('../../config/logger')(_0xbe3e('0x2'));var moment=require(_0xbe3e('0x3'));var BPromise=require(_0xbe3e('0x4'));var rp=require(_0xbe3e('0x5'));var fs=require('fs');var path=require(_0xbe3e('0x6'));var rimraf=require('rimraf');var config=require(_0xbe3e('0x7'));var attributes=require(_0xbe3e('0x8'));module[_0xbe3e('0x9')]=function(_0x226b9e,_0x30f065){return _0x226b9e[_0xbe3e('0xa')](_0xbe3e('0xb'),attributes,{'tableName':_0xbe3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index f53876d..78e1c3d 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 _0xe930=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util'];(function(_0x52ba3b,_0xdf6261){var _0x3de698=function(_0x2dfcf7){while(--_0x2dfcf7){_0x52ba3b['push'](_0x52ba3b['shift']());}};_0x3de698(++_0xdf6261);}(_0xe930,0x179));var _0x0e93=function(_0x5dc03e,_0x54e60c){_0x5dc03e=_0x5dc03e-0x0;var _0x466a07=_0xe930[_0x5dc03e];return _0x466a07;};'use strict';var _=require('lodash');var util=require(_0x0e93('0x0'));var moment=require(_0x0e93('0x1'));var BPromise=require(_0x0e93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e93('0x3'));var db=require(_0x0e93('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e93('0x5'))(_0x0e93('0x6'));var config=require(_0x0e93('0x7'));var jayson=require(_0x0e93('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0e93('0x9')]=_[_0x0e93('0xa')](config['redis'],{'host':_0x0e93('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0e93('0xc'))[_0x0e93('0xd')](socket);function respondWithRpcPromise(_0x52a4a0,_0x3b6a76,_0x1e86f6){return new BPromise(function(_0x249385,_0x2ceeba){return client[_0x0e93('0xe')](_0x52a4a0,_0x1e86f6)[_0x0e93('0xf')](function(_0x1cc092){logger[_0x0e93('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3b6a76,_0x0e93('0x11'));logger[_0x0e93('0x12')](_0x0e93('0x13'),_0x3b6a76,_0x0e93('0x11'),JSON[_0x0e93('0x14')](_0x1cc092));if(_0x1cc092['error']){if(_0x1cc092[_0x0e93('0x15')][_0x0e93('0x16')]===0x1f4){logger[_0x0e93('0x15')](_0x0e93('0x17'),_0x3b6a76,_0x1cc092[_0x0e93('0x15')][_0x0e93('0x18')]);return _0x2ceeba(_0x1cc092[_0x0e93('0x15')][_0x0e93('0x18')]);}logger[_0x0e93('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x3b6a76,_0x1cc092['error']['message']);return _0x249385(_0x1cc092[_0x0e93('0x15')][_0x0e93('0x18')]);}else{logger[_0x0e93('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x3b6a76,_0x0e93('0x11'));_0x249385(_0x1cc092[_0x0e93('0x19')][_0x0e93('0x18')]);}})[_0x0e93('0x1a')](function(_0x4b505a){logger['error'](_0x0e93('0x17'),_0x3b6a76,_0x4b505a);_0x2ceeba(_0x4b505a);});});} \ No newline at end of file +var _0x8549=['info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','redis','defaults','localhost','./chatWebsite.socket','request','then'];(function(_0x205e83,_0x2df5a4){var _0x10bb19=function(_0x41a375){while(--_0x41a375){_0x205e83['push'](_0x205e83['shift']());}};_0x10bb19(++_0x2df5a4);}(_0x8549,0xa0));var _0x9854=function(_0x3fdc4b,_0x39267e){_0x3fdc4b=_0x3fdc4b-0x0;var _0x4b0ea5=_0x8549[_0x3fdc4b];return _0x4b0ea5;};'use strict';var _=require(_0x9854('0x0'));var util=require('util');var moment=require(_0x9854('0x1'));var BPromise=require(_0x9854('0x2'));var rs=require(_0x9854('0x3'));var fs=require('fs');var Redis=require(_0x9854('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9854('0x5'));var logger=require('../../config/logger')(_0x9854('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9854('0x7')][_0x9854('0x8')]({'port':0x232a});config[_0x9854('0x9')]=_[_0x9854('0xa')](config[_0x9854('0x9')],{'host':_0x9854('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9854('0x9')]));require(_0x9854('0xc'))['register'](socket);function respondWithRpcPromise(_0x459c39,_0x3099fd,_0xac0572){return new BPromise(function(_0x335c09,_0x38a9af){return client[_0x9854('0xd')](_0x459c39,_0xac0572)[_0x9854('0xe')](function(_0x11ee31){logger[_0x9854('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3099fd,_0x9854('0x10'));logger[_0x9854('0x11')](_0x9854('0x12'),_0x3099fd,'request\x20sent',JSON[_0x9854('0x13')](_0x11ee31));if(_0x11ee31['error']){if(_0x11ee31[_0x9854('0x14')][_0x9854('0x15')]===0x1f4){logger[_0x9854('0x14')](_0x9854('0x16'),_0x3099fd,_0x11ee31[_0x9854('0x14')][_0x9854('0x17')]);return _0x38a9af(_0x11ee31[_0x9854('0x14')][_0x9854('0x17')]);}logger[_0x9854('0x14')](_0x9854('0x16'),_0x3099fd,_0x11ee31[_0x9854('0x14')]['message']);return _0x335c09(_0x11ee31['error'][_0x9854('0x17')]);}else{logger[_0x9854('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x3099fd,_0x9854('0x10'));_0x335c09(_0x11ee31['result'][_0x9854('0x17')]);}})[_0x9854('0x18')](function(_0x2ee886){logger['error'](_0x9854('0x16'),_0x3099fd,_0x2ee886);_0x38a9af(_0x2ee886);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e5a3332..79879bd 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 _0x466d=['chatWebsite:','./chatWebsite.events','save','update','emit','removeListener'];(function(_0x476669,_0x264bc8){var _0x25f439=function(_0x5d7c51){while(--_0x5d7c51){_0x476669['push'](_0x476669['shift']());}};_0x25f439(++_0x264bc8);}(_0x466d,0x18d));var _0xd466=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x466d[_0x3d34da];return _0xcf6af8;};'use strict';var ChatWebsiteEvents=require(_0xd466('0x0'));var events=[_0xd466('0x1'),'remove',_0xd466('0x2')];function createListener(_0xdcd464,_0x499c56){return function(_0x507871){_0x499c56[_0xd466('0x3')](_0xdcd464,_0x507871);};}function removeListener(_0x38b460,_0x480fe9){return function(){ChatWebsiteEvents[_0xd466('0x4')](_0x38b460,_0x480fe9);};}exports['register']=function(_0x194890){for(var _0x5f7157=0x0,_0x5e64fd=events['length'];_0x5f7157<_0x5e64fd;_0x5f7157++){var _0x1dace3=events[_0x5f7157];var _0x5a86b6=createListener(_0xd466('0x5')+_0x1dace3,_0x194890);ChatWebsiteEvents['on'](_0x1dace3,_0x5a86b6);}}; \ No newline at end of file +var _0x635f=['emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x136c26,_0x25b3e8){var _0x5f0a7a=function(_0x18ade0){while(--_0x18ade0){_0x136c26['push'](_0x136c26['shift']());}};_0x5f0a7a(++_0x25b3e8);}(_0x635f,0x10a));var _0xf635=function(_0xc57f1c,_0x579621){_0xc57f1c=_0xc57f1c-0x0;var _0x117851=_0x635f[_0xc57f1c];return _0x117851;};'use strict';var ChatWebsiteEvents=require(_0xf635('0x0'));var events=[_0xf635('0x1'),_0xf635('0x2'),_0xf635('0x3')];function createListener(_0xcff85f,_0x4a7177){return function(_0x5e39c2){_0x4a7177[_0xf635('0x4')](_0xcff85f,_0x5e39c2);};}function removeListener(_0x2b42b9,_0x3c44e7){return function(){ChatWebsiteEvents[_0xf635('0x5')](_0x2b42b9,_0x3c44e7);};}exports[_0xf635('0x6')]=function(_0x58303a){for(var _0x3b2094=0x0,_0xc3aa4e=events[_0xf635('0x7')];_0x3b2094<_0xc3aa4e;_0x3b2094++){var _0x2f6086=events[_0x3b2094];var _0x360b63=createListener(_0xf635('0x8')+_0x2f6086,_0x58303a);ChatWebsiteEvents['on'](_0x2f6086,_0x360b63);}}; \ 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 930d01b..32a32bc 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 _0x7409=['URL','replace','localhost','test','trim','([\x5cw]+)','../../../utils/misc','escapeRegExp'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x7409,0x6e));var _0x9740=function(_0x34df56,_0x52a58f){_0x34df56=_0x34df56-0x0;var _0x520f88=_0x7409[_0x34df56];return _0x520f88;};var escapeRegExp=require(_0x9740('0x0'))[_0x9740('0x1')];var URL=require('url')[_0x9740('0x2')];function testWildcardValidity(_0xafb57){var _0x266af6=!![];try{new URL(_0xafb57[_0x9740('0x3')]('*',_0x9740('0x4')));}catch(_0x2c15f1){_0x266af6=![];}return _0x266af6&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x9740('0x5')](_0xafb57);}function testWebsiteWithWildcard(_0x2bb453,_0x235c09){var _0x547490;var _0x19865c=escapeRegExp(_0x2bb453[_0x9740('0x6')]()[_0x9740('0x3')](/\/$/,''))['replace']('\x5c*',_0x9740('0x7'));try{new URL(_0x2bb453[_0x9740('0x3')]('\x5c*',_0x9740('0x4')));_0x547490=new RegExp(_0x19865c)['test'](_0x235c09);}catch(_0x142319){_0x547490=![];}return _0x547490;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xea4e=['([\x5cw]+)','exports','../../../utils/misc','replace','localhost','test','trim'];(function(_0xf607c,_0xbc9b33){var _0x59f55a=function(_0xd6584a){while(--_0xd6584a){_0xf607c['push'](_0xf607c['shift']());}};_0x59f55a(++_0xbc9b33);}(_0xea4e,0x10c));var _0xeea4=function(_0x48e6c1,_0x2c5211){_0x48e6c1=_0x48e6c1-0x0;var _0x1521e2=_0xea4e[_0x48e6c1];return _0x1521e2;};var escapeRegExp=require(_0xeea4('0x0'))['escapeRegExp'];var URL=require('url')['URL'];function testWildcardValidity(_0x386b78){var _0x4bee3b=!![];try{new URL(_0x386b78[_0xeea4('0x1')]('*',_0xeea4('0x2')));}catch(_0x5b0c1f){_0x4bee3b=![];}return _0x4bee3b&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xeea4('0x3')](_0x386b78);}function testWebsiteWithWildcard(_0x22d9d8,_0xed7b54){var _0x12e419;var _0x297af5=escapeRegExp(_0x22d9d8[_0xeea4('0x4')]()[_0xeea4('0x1')](/\/$/,''))[_0xeea4('0x1')]('\x5c*',_0xeea4('0x5'));try{new URL(_0x22d9d8['replace']('\x5c*',_0xeea4('0x2')));_0x12e419=new RegExp(_0x297af5)['test'](_0xed7b54);}catch(_0x3a4953){_0x12e419=![];}return _0x12e419;}module[_0xeea4('0x6')]={'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 bf968e8..790f902 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 _0xb5ed=['addDisposition','join','server/files/images/logos/','%s-%s','now','originalname','single','addLogo','diskStorage','server/files/images/avatars/','format','/:id/avatar','file','addAvatar','root','/:id/system_avatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post'];(function(_0x56d64b,_0x1f961a){var _0x41ef0d=function(_0x2e92b7){while(--_0x2e92b7){_0x56d64b['push'](_0x56d64b['shift']());}};_0x41ef0d(++_0x1f961a);}(_0xb5ed,0x185));var _0xdb5e=function(_0x11d890,_0x3d4b22){_0x11d890=_0x11d890-0x0;var _0x511205=_0xb5ed[_0x11d890];return _0x511205;};'use strict';var multer=require(_0xdb5e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb5e('0x1'));var express=require(_0xdb5e('0x2'));var router=express[_0xdb5e('0x3')]();var fs_extra=require(_0xdb5e('0x4'));var auth=require(_0xdb5e('0x5'));var interaction=require(_0xdb5e('0x6'));var config=require(_0xdb5e('0x7'));var controller=require(_0xdb5e('0x8'));router[_0xdb5e('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb5e('0xa')]);router[_0xdb5e('0x9')](_0xdb5e('0xb'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0xd')]);router[_0xdb5e('0x9')](_0xdb5e('0xe'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0xf')]);router[_0xdb5e('0x9')](_0xdb5e('0x10'),auth['isAuthenticated'](),controller[_0xdb5e('0x11')]);router['get'](_0xdb5e('0x12'),auth[_0xdb5e('0xc')](),controller['getAnswers']);router[_0xdb5e('0x9')](_0xdb5e('0x13'),controller['getLogo']);router[_0xdb5e('0x9')]('/:id/avatar',controller[_0xdb5e('0x14')]);router['get'](_0xdb5e('0x15'),controller[_0xdb5e('0x16')]);router[_0xdb5e('0x9')]('/:id/system_avatar',controller['getSystemAvatar']);router[_0xdb5e('0x9')](_0xdb5e('0x17'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x18')]);router[_0xdb5e('0x9')](_0xdb5e('0x19'),controller[_0xdb5e('0x1a')]);router[_0xdb5e('0x9')](_0xdb5e('0x1b'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x1c')]);router[_0xdb5e('0x9')](_0xdb5e('0x1d'),auth['isAuthenticated'](),controller[_0xdb5e('0x1e')]);router[_0xdb5e('0x9')](_0xdb5e('0x1f'),controller[_0xdb5e('0x20')]);router[_0xdb5e('0x9')]('/:id/offline_messages',auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x21')]);router[_0xdb5e('0x9')](_0xdb5e('0x22'),auth['isAuthenticated'](),controller[_0xdb5e('0x23')]);router[_0xdb5e('0x24')]('/',auth[_0xdb5e('0xc')](),controller['create']);router['post']('/:id/dispositions',auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x25')]);router[_0xdb5e('0x24')](_0xdb5e('0x12'),auth[_0xdb5e('0xc')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c26e4,_0xf1f864,_0x42e100){_0x42e100(null,path[_0xdb5e('0x26')](config['root'],_0xdb5e('0x27')));},'filename':function(_0x44fdf7,_0x204535,_0x3c0464){_0x3c0464(null,util['format'](_0xdb5e('0x28'),Date[_0xdb5e('0x29')](),_0x204535[_0xdb5e('0x2a')]));}})});router[_0xdb5e('0x24')](_0xdb5e('0x13'),upload[_0xdb5e('0x2b')]('file'),controller[_0xdb5e('0x2c')]);var upload=multer({'storage':multer[_0xdb5e('0x2d')]({'destination':function(_0x2bb43a,_0x3a34ac,_0xb2d1fc){_0xb2d1fc(null,path[_0xdb5e('0x26')](config['root'],_0xdb5e('0x2e')));},'filename':function(_0x1ac53b,_0xb1a529,_0x3a621e){_0x3a621e(null,util[_0xdb5e('0x2f')]('%s-%s',Date['now'](),_0xb1a529[_0xdb5e('0x2a')]));}})});router['post'](_0xdb5e('0x30'),upload[_0xdb5e('0x2b')](_0xdb5e('0x31')),controller[_0xdb5e('0x32')]);var upload=multer({'storage':multer[_0xdb5e('0x2d')]({'destination':function(_0x34a562,_0x2616d1,_0x2b0f86){_0x2b0f86(null,path[_0xdb5e('0x26')](config[_0xdb5e('0x33')],_0xdb5e('0x2e')));},'filename':function(_0x55109a,_0x3a8cdb,_0xef49eb){_0xef49eb(null,util[_0xdb5e('0x2f')](_0xdb5e('0x28'),Date['now'](),_0x3a8cdb['originalname']));}})});router[_0xdb5e('0x24')](_0xdb5e('0x15'),upload['single']('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1b0ed4,_0x39338,_0x5bc511){_0x5bc511(null,path[_0xdb5e('0x26')](config[_0xdb5e('0x33')],_0xdb5e('0x2e')));},'filename':function(_0x38cb94,_0x26b537,_0x271c1b){_0x271c1b(null,util[_0xdb5e('0x2f')](_0xdb5e('0x28'),Date[_0xdb5e('0x29')](),_0x26b537['originalname']));}})});router[_0xdb5e('0x24')](_0xdb5e('0x34'),upload['single'](_0xdb5e('0x31')),controller[_0xdb5e('0x35')]);router[_0xdb5e('0x24')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdb5e('0x2d')]({'destination':function(_0xee8f96,_0x3d6036,_0x41cf00){const _0x22335e=path[_0xdb5e('0x26')](config[_0xdb5e('0x33')],_0xdb5e('0x36'),_0xdb5e('0x37'),_0xdb5e('0x38'));fs_extra[_0xdb5e('0x39')](_0x22335e,function(){_0x41cf00(null,_0x22335e);});},'filename':function(_0x2f0c22,_0x464e99,_0x141043){const _0x26f2fa=_0x464e99['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x31742d=path['extname'](_0x26f2fa);const _0x44986f=Date[_0xdb5e('0x29')]()+'-'+_0x26f2fa[_0xdb5e('0x3a')](_0x31742d,'')+_0x31742d;_0x141043(null,_0x44986f);}})});router[_0xdb5e('0x24')](_0xdb5e('0x3b'),offlineUploadMulter[_0xdb5e('0x3c')](),controller[_0xdb5e('0x3d')]);router[_0xdb5e('0x24')]('/:id/interactions',auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x3e')]);router[_0xdb5e('0x24')](_0xdb5e('0x1b'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x3f')]);router[_0xdb5e('0x24')](_0xdb5e('0x1d'),auth['isAuthenticated'](),controller[_0xdb5e('0x40')]);router['post'](_0xdb5e('0x22'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x41')]);router['put'](_0xdb5e('0xe'),auth['isAuthenticated'](),controller[_0xdb5e('0x42')]);router[_0xdb5e('0x43')]('/:id',auth[_0xdb5e('0xc')](),controller['destroy']);router['delete'](_0xdb5e('0x10'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x44')]);router[_0xdb5e('0x43')](_0xdb5e('0x12'),auth[_0xdb5e('0xc')](),controller[_0xdb5e('0x45')]);router[_0xdb5e('0x43')](_0xdb5e('0x22'),auth[_0xdb5e('0xc')](),controller['removeAgents']);module[_0xdb5e('0x46')]=router; \ No newline at end of file +var _0x1774=['%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','/:id/system_avatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','replace','offline','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x30597e,_0x3d3e66){var _0x17b1cf=function(_0xa3d995){while(--_0xa3d995){_0x30597e['push'](_0x30597e['shift']());}};_0x17b1cf(++_0x3d3e66);}(_0x1774,0x1d3));var _0x4177=function(_0x2aab6a,_0x19a87e){_0x2aab6a=_0x2aab6a-0x0;var _0x411ef5=_0x1774[_0x2aab6a];return _0x411ef5;};'use strict';var multer=require(_0x4177('0x0'));var util=require('util');var path=require(_0x4177('0x1'));var timeout=require(_0x4177('0x2'));var express=require(_0x4177('0x3'));var router=express['Router']();var fs_extra=require(_0x4177('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4177('0x5'));var config=require(_0x4177('0x6'));var controller=require(_0x4177('0x7'));router[_0x4177('0x8')]('/',auth[_0x4177('0x9')](),controller[_0x4177('0xa')]);router[_0x4177('0x8')]('/describe',auth[_0x4177('0x9')](),controller[_0x4177('0xb')]);router[_0x4177('0x8')](_0x4177('0xc'),auth['isAuthenticated'](),controller[_0x4177('0xd')]);router['get'](_0x4177('0xe'),auth['isAuthenticated'](),controller[_0x4177('0xf')]);router[_0x4177('0x8')]('/:id/canned_answers',auth[_0x4177('0x9')](),controller[_0x4177('0x10')]);router[_0x4177('0x8')](_0x4177('0x11'),controller[_0x4177('0x12')]);router[_0x4177('0x8')](_0x4177('0x13'),controller[_0x4177('0x14')]);router[_0x4177('0x8')](_0x4177('0x15'),controller[_0x4177('0x16')]);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router[_0x4177('0x8')](_0x4177('0x17'),auth[_0x4177('0x9')](),controller[_0x4177('0x18')]);router['get']('/:id/snippet',controller[_0x4177('0x19')]);router[_0x4177('0x8')](_0x4177('0x1a'),auth[_0x4177('0x9')](),controller[_0x4177('0x1b')]);router[_0x4177('0x8')](_0x4177('0x1c'),auth[_0x4177('0x9')](),controller[_0x4177('0x1d')]);router[_0x4177('0x8')]('/:id/fields',controller[_0x4177('0x1e')]);router[_0x4177('0x8')](_0x4177('0x1f'),auth[_0x4177('0x9')](),controller[_0x4177('0x20')]);router['get'](_0x4177('0x21'),auth[_0x4177('0x9')](),controller[_0x4177('0x22')]);router[_0x4177('0x23')]('/',auth[_0x4177('0x9')](),controller['create']);router['post'](_0x4177('0xe'),auth[_0x4177('0x9')](),controller[_0x4177('0x24')]);router[_0x4177('0x23')](_0x4177('0x25'),auth[_0x4177('0x9')](),controller[_0x4177('0x26')]);var upload=multer({'storage':multer[_0x4177('0x27')]({'destination':function(_0x32ae9d,_0x56eb94,_0x2cbbcc){_0x2cbbcc(null,path[_0x4177('0x28')](config[_0x4177('0x29')],_0x4177('0x2a')));},'filename':function(_0x2565c6,_0x3434c4,_0x4ca218){_0x4ca218(null,util[_0x4177('0x2b')](_0x4177('0x2c'),Date[_0x4177('0x2d')](),_0x3434c4[_0x4177('0x2e')]));}})});router[_0x4177('0x23')](_0x4177('0x11'),upload[_0x4177('0x2f')](_0x4177('0x30')),controller[_0x4177('0x31')]);var upload=multer({'storage':multer[_0x4177('0x27')]({'destination':function(_0x1dd3f2,_0x4668c7,_0x5375b3){_0x5375b3(null,path[_0x4177('0x28')](config[_0x4177('0x29')],_0x4177('0x32')));},'filename':function(_0x5e0371,_0x16d941,_0x24397c){_0x24397c(null,util['format']('%s-%s',Date['now'](),_0x16d941[_0x4177('0x2e')]));}})});router[_0x4177('0x23')](_0x4177('0x13'),upload[_0x4177('0x2f')](_0x4177('0x30')),controller[_0x4177('0x33')]);var upload=multer({'storage':multer[_0x4177('0x27')]({'destination':function(_0x4e3eeb,_0x315b2a,_0x5afdd0){_0x5afdd0(null,path[_0x4177('0x28')](config['root'],_0x4177('0x32')));},'filename':function(_0x128089,_0x4490ca,_0x42c6ba){_0x42c6ba(null,util[_0x4177('0x2b')](_0x4177('0x2c'),Date['now'](),_0x4490ca[_0x4177('0x2e')]));}})});router[_0x4177('0x23')](_0x4177('0x15'),upload[_0x4177('0x2f')]('file'),controller[_0x4177('0x34')]);var upload=multer({'storage':multer[_0x4177('0x27')]({'destination':function(_0x386db7,_0x3734eb,_0x334fce){_0x334fce(null,path[_0x4177('0x28')](config['root'],_0x4177('0x32')));},'filename':function(_0xd9413f,_0xa09f17,_0x57807c){_0x57807c(null,util[_0x4177('0x2b')](_0x4177('0x2c'),Date[_0x4177('0x2d')](),_0xa09f17['originalname']));}})});router[_0x4177('0x23')](_0x4177('0x35'),upload[_0x4177('0x2f')]('file'),controller['addSystemAvatar']);router[_0x4177('0x23')](_0x4177('0x36'),controller[_0x4177('0x37')]);const offlineUploadMulter=multer({'storage':multer[_0x4177('0x27')]({'destination':function(_0x5ed5ad,_0x5ce58a,_0x289d40){const _0x3a86a6=path['join'](config[_0x4177('0x29')],_0x4177('0x38'),_0x4177('0x39'),_0x4177('0x3a'));fs_extra[_0x4177('0x3b')](_0x3a86a6,function(){_0x289d40(null,_0x3a86a6);});},'filename':function(_0x3c46c1,_0x4e8308,_0x217545){const _0x182f1d=_0x4e8308['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3cac8c=path[_0x4177('0x3c')](_0x182f1d);const _0x5cc0f6=Date['now']()+'-'+_0x182f1d[_0x4177('0x3d')](_0x3cac8c,'')+_0x3cac8c;_0x217545(null,_0x5cc0f6);}})});router[_0x4177('0x23')]('/:id/offline',offlineUploadMulter['any'](),controller[_0x4177('0x3e')]);router[_0x4177('0x23')]('/:id/interactions',auth[_0x4177('0x9')](),controller['addInteraction']);router[_0x4177('0x23')](_0x4177('0x1a'),auth[_0x4177('0x9')](),controller[_0x4177('0x3f')]);router[_0x4177('0x23')](_0x4177('0x1c'),auth[_0x4177('0x9')](),controller[_0x4177('0x40')]);router[_0x4177('0x23')](_0x4177('0x21'),auth[_0x4177('0x9')](),controller[_0x4177('0x41')]);router[_0x4177('0x42')](_0x4177('0xc'),auth[_0x4177('0x9')](),controller[_0x4177('0x43')]);router[_0x4177('0x44')](_0x4177('0xc'),auth[_0x4177('0x9')](),controller[_0x4177('0x45')]);router[_0x4177('0x44')]('/:id/dispositions',auth[_0x4177('0x9')](),controller[_0x4177('0x46')]);router[_0x4177('0x44')]('/:id/canned_answers',auth[_0x4177('0x9')](),controller[_0x4177('0x47')]);router[_0x4177('0x44')](_0x4177('0x21'),auth['isAuthenticated'](),controller[_0x4177('0x48')]);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 0cbb65d..7ef93d0 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 _0xad09=['app','get','client-side-logger','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','env'];(function(_0x4fd4ed,_0x41fe4b){var _0x5764ec=function(_0x342a7a){while(--_0x342a7a){_0x4fd4ed['push'](_0x4fd4ed['shift']());}};_0x5764ec(++_0x41fe4b);}(_0xad09,0xac));var _0x9ad0=function(_0x19c4bd,_0x19a00d){_0x19c4bd=_0x19c4bd-0x0;var _0x2fc7b5=_0xad09[_0x19c4bd];return _0x2fc7b5;};var beaverLogger=require(_0x9ad0('0x0'));var express=require(_0x9ad0('0x1'));var auth=require(_0x9ad0('0x2'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x9ad0('0x3')]==='production'||![];function clientSideLogs(_0x4445e6,_0x18987d,_0x3b75dd){var _0x333278=_0x4445e6[_0x9ad0('0x4')][_0x9ad0('0x5')](_0x9ad0('0x6'));if(!_0x333278){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':_0x9ad0('0x7'),'logger':_0x333278,'enableCors':!isProduction})(_0x4445e6,_0x18987d,_0x3b75dd);}router[_0x9ad0('0x8')](auth[_0x9ad0('0x9')](),clientSideLogs);module[_0x9ad0('0xa')]=router; \ No newline at end of file +var _0x6310=['get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','../config/environment','Router','app'];(function(_0x57f735,_0x20f51f){var _0x1f6d61=function(_0x3ca2e0){while(--_0x3ca2e0){_0x57f735['push'](_0x57f735['shift']());}};_0x1f6d61(++_0x20f51f);}(_0x6310,0xdd));var _0x0631=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x6310[_0x68ee8b];return _0x5148f7;};var beaverLogger=require(_0x0631('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x0631('0x1'));var router=express[_0x0631('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x10867a,_0x55e270,_0x243fb1){var _0x5e73f6=_0x10867a[_0x0631('0x3')][_0x0631('0x4')]('client-side-logger');if(!_0x5e73f6){throw new Error(_0x0631('0x5'));}return beaverLogger[_0x0631('0x6')]({'uri':_0x0631('0x7'),'logger':_0x5e73f6,'enableCors':!isProduction})(_0x10867a,_0x55e270,_0x243fb1);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x0631('0x8')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 950ba25..b58b782 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 _0xd477=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd477,0x132));var _0x7d47=function(_0x3ba022,_0x3925c7){_0x3ba022=_0x3ba022-0x0;var _0x18716c=_0xd477[_0x3ba022];return _0x18716c;};'use strict';var Sequelize=require(_0x7d47('0x0'));module[_0x7d47('0x1')]={'name':{'type':Sequelize[_0x7d47('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7d47('0x3')](_0x7d47('0x4'),_0x7d47('0x5'),_0x7d47('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7d47('0x7'),_0x7d47('0x8'))},'data1':{'type':Sequelize[_0x7d47('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x7d47('0x9')},'data3':{'type':Sequelize[_0x7d47('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7d47('0x2')],'comment':_0x7d47('0xa')},'data5':{'type':Sequelize[_0x7d47('0xb')],'comment':_0x7d47('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7d47('0xd')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7d47('0xe')}}; \ No newline at end of file +var _0xbef5=['AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM'];(function(_0x10e983,_0x2f4eda){var _0x324138=function(_0x17a377){while(--_0x17a377){_0x10e983['push'](_0x10e983['shift']());}};_0x324138(++_0x2f4eda);}(_0xbef5,0x165));var _0x5bef=function(_0x252f51,_0xbf7947){_0x252f51=_0x252f51-0x0;var _0x19e8ba=_0xbef5[_0x252f51];return _0x19e8ba;};'use strict';var Sequelize=require(_0x5bef('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bef('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5bef('0x2')](_0x5bef('0x3'),_0x5bef('0x4'),_0x5bef('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x5bef('0x2')](_0x5bef('0x6'),_0x5bef('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x5bef('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x5bef('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x5bef('0xa')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x5bef('0xb')],'comment':_0x5bef('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x5bef('0xd')},'data7':{'type':Sequelize[_0x5bef('0xb')],'comment':_0x5bef('0xe')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index dd9b52a..4289706 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 _0xf1fa=['from','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','data5','access_token','refresh_token','data6','emit','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','status','json','undefined','limit','count','offset','set','update','then','destroy','error','name','send','padEnd','slice','map','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','CloudProvider','includeAll','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','rawAttributes','include','options','catch','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse'];(function(_0x42f351,_0x20f87e){var _0xd9c2da=function(_0x4dd6f1){while(--_0x4dd6f1){_0x42f351['push'](_0x42f351['shift']());}};_0xd9c2da(++_0x20f87e);}(_0xf1fa,0x1e2));var _0xaf1f=function(_0x38eb95,_0x44a375){_0x38eb95=_0x38eb95-0x0;var _0x1a0d4a=_0xf1fa[_0x38eb95];return _0x1a0d4a;};'use strict';var _=require(_0xaf1f('0x0'));var Redis=require(_0xaf1f('0x1'));var qs=require(_0xaf1f('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xaf1f('0x3'));var logger=require(_0xaf1f('0x4'))(_0xaf1f('0x5'));var db=require(_0xaf1f('0x6'))['db'];var oauth=require(_0xaf1f('0x7'));config[_0xaf1f('0x8')]=_['defaults'](config['redis'],{'host':_0xaf1f('0x9'),'port':0x18eb});var socket=require(_0xaf1f('0xa'))(new Redis(config['redis']));var redis=new Redis(config[_0xaf1f('0x8')]);function respondWithStatusCode(_0x2c0c09,_0xb441a8){_0xb441a8=_0xb441a8||0xcc;return function(_0x2da2d7){if(_0x2da2d7){return _0x2c0c09[_0xaf1f('0xb')](_0xb441a8);}return _0x2c0c09['status'](_0xb441a8)[_0xaf1f('0xc')]();};}function respondWithResult(_0x8bd81c,_0x20e7a2){_0x20e7a2=_0x20e7a2||0xc8;return function(_0x192d26){if(_0x192d26){return _0x8bd81c[_0xaf1f('0xd')](_0x20e7a2)[_0xaf1f('0xe')](_0x192d26);}};}function respondWithFilteredResult(_0x4ef8ff,_0x54bb57){return function(_0x561925){if(_0x561925){var _0x17766d=typeof _0x54bb57['offset']===_0xaf1f('0xf')&&typeof _0x54bb57[_0xaf1f('0x10')]===_0xaf1f('0xf');var _0x3e86e9=_0x561925['count'];var _0x2d6285=_0x17766d?0x0:_0x54bb57['offset'];var _0x1a9fdf=_0x17766d?_0x561925[_0xaf1f('0x11')]:_0x54bb57[_0xaf1f('0x12')]+_0x54bb57[_0xaf1f('0x10')];var _0x4e72c1;if(_0x1a9fdf>=_0x3e86e9){_0x1a9fdf=_0x3e86e9;_0x4e72c1=0xc8;}else{_0x4e72c1=0xce;}_0x4ef8ff[_0xaf1f('0xd')](_0x4e72c1);return _0x4ef8ff[_0xaf1f('0x13')]('Content-Range',_0x2d6285+'-'+_0x1a9fdf+'/'+_0x3e86e9)[_0xaf1f('0xe')](_0x561925);}return null;};}function saveUpdates(_0xc5c21d){return function(_0x26f5d7){if(_0x26f5d7){return _0x26f5d7[_0xaf1f('0x14')](_0xc5c21d)[_0xaf1f('0x15')](function(_0x501445){return _0x501445;});}return null;};}function removeEntity(_0x35cd2e){return function(_0x73db66){if(_0x73db66){return _0x73db66[_0xaf1f('0x16')]()[_0xaf1f('0x15')](function(){_0x35cd2e[_0xaf1f('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x435a2a){return function(_0x9dc79e){if(!_0x9dc79e){_0x435a2a['sendStatus'](0x194);}return _0x9dc79e;};}function handleError(_0x560564,_0x1869f4){_0x1869f4=_0x1869f4||0x1f4;return function(_0x53e048){logger[_0xaf1f('0x17')](_0x53e048['stack']);if(_0x53e048[_0xaf1f('0x18')]){delete _0x53e048[_0xaf1f('0x18')];}_0x560564[_0xaf1f('0xd')](_0x1869f4)[_0xaf1f('0x19')](_0x53e048);};}function maskClientSecret(_0x2cd0c9){return _[_0xaf1f('0x1a')](_0x2cd0c9[_0xaf1f('0x1b')](0x0,0x3),0x14,'*');}exports['index']=function(_0x551468,_0x395980){var _0x3233ab={},_0x464cd6={},_0x44e359={'count':0x0,'rows':[]};var _0x4f2351=_[_0xaf1f('0x1c')](db['CloudProvider']['rawAttributes'],function(_0x1eec35){return{'name':_0x1eec35[_0xaf1f('0x1d')],'type':_0x1eec35[_0xaf1f('0x1e')]['key']};});_0x464cd6[_0xaf1f('0x1f')]=_[_0xaf1f('0x1c')](_0x4f2351,_0xaf1f('0x18'));_0x464cd6[_0xaf1f('0x20')]=_[_0xaf1f('0x21')](_0x551468['query']);_0x464cd6[_0xaf1f('0x22')]=_['intersection'](_0x464cd6[_0xaf1f('0x1f')],_0x464cd6[_0xaf1f('0x20')]);_0x3233ab[_0xaf1f('0x23')]=_[_0xaf1f('0x24')](_0x464cd6['model'],qs['fields'](_0x551468[_0xaf1f('0x20')][_0xaf1f('0x25')]));_0x3233ab[_0xaf1f('0x23')]=_0x3233ab[_0xaf1f('0x23')][_0xaf1f('0x26')]?_0x3233ab[_0xaf1f('0x23')]:_0x464cd6[_0xaf1f('0x1f')];if(!_0x551468['query'][_0xaf1f('0x27')](_0xaf1f('0x28'))){_0x3233ab[_0xaf1f('0x10')]=qs['limit'](_0x551468['query']['limit']);_0x3233ab[_0xaf1f('0x12')]=qs[_0xaf1f('0x12')](_0x551468[_0xaf1f('0x20')]['offset']);}_0x3233ab['order']=qs['sort'](_0x551468[_0xaf1f('0x20')][_0xaf1f('0x29')]);_0x3233ab[_0xaf1f('0x2a')]=qs['filters'](_[_0xaf1f('0x2b')](_0x551468[_0xaf1f('0x20')],_0x464cd6[_0xaf1f('0x22')]),_0x4f2351);if(_0x551468[_0xaf1f('0x20')][_0xaf1f('0x2c')]){_0x3233ab['where']=_[_0xaf1f('0x2d')](_0x3233ab[_0xaf1f('0x2a')],{'$or':_['map'](_0x4f2351,function(_0x509a4c){if(_0x509a4c[_0xaf1f('0x1e')]!==_0xaf1f('0x2e')){var _0x58bf9c={};_0x58bf9c[_0x509a4c[_0xaf1f('0x18')]]={'$like':'%'+_0x551468[_0xaf1f('0x20')][_0xaf1f('0x2c')]+'%'};return _0x58bf9c;}})});}_0x3233ab=_[_0xaf1f('0x2d')]({},_0x3233ab,_0x551468['options']);var _0x354615={'where':_0x3233ab['where']};return db[_0xaf1f('0x2f')][_0xaf1f('0x11')](_0x354615)[_0xaf1f('0x15')](function(_0x24cdc2){_0x44e359[_0xaf1f('0x11')]=_0x24cdc2;if(_0x551468[_0xaf1f('0x20')][_0xaf1f('0x30')]){_0x3233ab['include']=[{'all':!![]}];}return db[_0xaf1f('0x2f')][_0xaf1f('0x31')](_0x3233ab);})['then'](function(_0x2fa226){_0x44e359[_0xaf1f('0x32')]=_['map'](_0x2fa226,function(_0x5b28af){if(_0x5b28af[_0xaf1f('0x33')]===_0xaf1f('0x34')){var _0x15e2a8=encryptor[_0xaf1f('0x35')](_0x5b28af['data3']);_0x5b28af[_0xaf1f('0x36')]=maskClientSecret(_0x15e2a8);}return _0x5b28af;});return _0x44e359;})[_0xaf1f('0x15')](respondWithFilteredResult(_0x395980,_0x3233ab))['catch'](handleError(_0x395980,null));};exports[_0xaf1f('0x37')]=function(_0x2ba54e,_0x3f7654){var _0x519193={'raw':!![],'where':{'id':_0x2ba54e[_0xaf1f('0x38')]['id']}},_0x27845e={};_0x27845e[_0xaf1f('0x1f')]=_['keys'](db[_0xaf1f('0x2f')][_0xaf1f('0x39')]);_0x27845e[_0xaf1f('0x20')]=_['keys'](_0x2ba54e['query']);_0x27845e[_0xaf1f('0x22')]=_[_0xaf1f('0x24')](_0x27845e['model'],_0x27845e[_0xaf1f('0x20')]);_0x519193['attributes']=_[_0xaf1f('0x24')](_0x27845e[_0xaf1f('0x1f')],qs[_0xaf1f('0x25')](_0x2ba54e[_0xaf1f('0x20')][_0xaf1f('0x25')]));_0x519193[_0xaf1f('0x23')]=_0x519193['attributes'][_0xaf1f('0x26')]?_0x519193[_0xaf1f('0x23')]:_0x27845e[_0xaf1f('0x1f')];if(_0x2ba54e[_0xaf1f('0x20')][_0xaf1f('0x30')]){_0x519193[_0xaf1f('0x3a')]=[{'all':!![]}];}_0x519193=_[_0xaf1f('0x2d')]({},_0x519193,_0x2ba54e[_0xaf1f('0x3b')]);return db[_0xaf1f('0x2f')]['find'](_0x519193)['then'](handleEntityNotFound(_0x3f7654,null))['then'](function(_0x4cdeb9){if(_0x4cdeb9[_0xaf1f('0x33')]===_0xaf1f('0x34')){var _0x3ed09d=encryptor[_0xaf1f('0x35')](_0x4cdeb9[_0xaf1f('0x36')]);_0x4cdeb9[_0xaf1f('0x36')]=maskClientSecret(_0x3ed09d);}return _0x4cdeb9;})[_0xaf1f('0x15')](respondWithResult(_0x3f7654,null))[_0xaf1f('0x3c')](handleError(_0x3f7654,null));};exports['create']=function(_0x36dfc6,_0x151118){if(!_0x36dfc6[_0xaf1f('0x3d')]['name'])throw new Error(_0xaf1f('0x3e'));if(!_0x36dfc6[_0xaf1f('0x3d')]['service'])throw new Error(_0xaf1f('0x3f'));var _0x381ce2=db['CloudProvider'][_0xaf1f('0x39')][_0xaf1f('0x33')][_0xaf1f('0x40')];if(!_0x381ce2['includes'](_0x36dfc6['body'][_0xaf1f('0x33')]))throw new Error(_0xaf1f('0x41')+_0x381ce2[_0xaf1f('0x42')](',\x20'));if(_0x36dfc6[_0xaf1f('0x3d')][_0xaf1f('0x33')]==='MicrosoftAzure'&&_0x36dfc6[_0xaf1f('0x3d')][_0xaf1f('0x36')]){_0x36dfc6[_0xaf1f('0x3d')][_0xaf1f('0x36')]=encryptor[_0xaf1f('0x43')](_0x36dfc6[_0xaf1f('0x3d')][_0xaf1f('0x36')]);}return db[_0xaf1f('0x2f')]['create'](_0x36dfc6['body'],{})['then'](respondWithResult(_0x151118,0xc9))['catch'](handleError(_0x151118,null));};exports[_0xaf1f('0x14')]=function(_0x636ad8,_0x5814d5){if(_0x636ad8[_0xaf1f('0x3d')]['id']){delete _0x636ad8[_0xaf1f('0x3d')]['id'];}return db[_0xaf1f('0x2f')][_0xaf1f('0x44')]({'where':{'id':_0x636ad8[_0xaf1f('0x38')]['id']}})[_0xaf1f('0x15')](handleEntityNotFound(_0x5814d5,null))[_0xaf1f('0x15')](function(_0x4c12d4){if(_0x4c12d4[_0xaf1f('0x33')]===_0xaf1f('0x34')&&_0x636ad8[_0xaf1f('0x3d')][_0xaf1f('0x36')]){_0x636ad8['body'][_0xaf1f('0x36')]=encryptor[_0xaf1f('0x43')](_0x636ad8[_0xaf1f('0x3d')][_0xaf1f('0x36')]);}return _0x4c12d4;})['then'](saveUpdates(_0x636ad8['body'],null))['then'](respondWithResult(_0x5814d5,null))[_0xaf1f('0x3c')](handleError(_0x5814d5,null));};exports['destroy']=function(_0x252351,_0xfa5227){return db[_0xaf1f('0x2f')][_0xaf1f('0x44')]({'where':{'id':_0x252351[_0xaf1f('0x38')]['id']}})[_0xaf1f('0x15')](handleEntityNotFound(_0xfa5227,null))[_0xaf1f('0x15')](removeEntity(_0xfa5227,null))[_0xaf1f('0x3c')](handleError(_0xfa5227,null));};exports['oauth2MicrosoftAuthorize']=function(_0x53fbb3,_0x529260){return db['CloudProvider'][_0xaf1f('0x45')]({'where':{'id':_0x53fbb3[_0xaf1f('0x38')]['id']},'raw':!![]})[_0xaf1f('0x15')](function(_0x466e67){if(!_0x466e67)return _0x529260['sendStatus'](0x194);return{'url':oauth[_0xaf1f('0x46')](_0x466e67,_0x53fbb3[_0xaf1f('0x47')]['id'])};})[_0xaf1f('0x15')](respondWithResult(_0x529260,null))[_0xaf1f('0x3c')](handleError(_0x529260,null));};exports[_0xaf1f('0x48')]=function(_0x174efe,_0x1d06b3){var _0x1fd546=_0x174efe[_0xaf1f('0x3d')];var _0x22b5b2;var _0x56a401;if(_0x1fd546[_0xaf1f('0x17')])throw _0x1fd546;redis[_0xaf1f('0x49')](_0x1fd546[_0xaf1f('0x4a')])['then'](function(_0x10abff){if(!_0x10abff)throw new Error('Invalid\x20state\x20parameter');_0x22b5b2=JSON[_0xaf1f('0x4b')](_0x10abff);var _0x165b9e=Buffer[_0xaf1f('0x4c')](_0x1fd546[_0xaf1f('0x4a')],'base64')[_0xaf1f('0x4d')](_0xaf1f('0x4e'));_0x56a401=JSON[_0xaf1f('0x4b')](_0x165b9e);if(!oauth[_0xaf1f('0x4f')](_0x1fd546[_0xaf1f('0x50')],_0x22b5b2[_0xaf1f('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xaf1f('0x52')](_0x1fd546[_0xaf1f('0x4a')]);return oauth[_0xaf1f('0x53')](_0x1fd546['code'],_0x22b5b2);})[_0xaf1f('0x15')](function(_0x3ba328){_0x22b5b2[_0xaf1f('0x54')]=_0x3ba328[_0xaf1f('0x55')];_0x22b5b2['data6']=_0x3ba328[_0xaf1f('0x56')];return db[_0xaf1f('0x2f')]['update']({'data5':_0x22b5b2['data5'],'data6':_0x22b5b2[_0xaf1f('0x57')]},{'where':{'id':_0x22b5b2['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x22b5b2);socket[_0xaf1f('0x58')]('microsoftAuthorization:success',{'id':_0x56a401['id']});return;})[_0xaf1f('0x15')](respondWithStatusCode(_0x1d06b3,null))[_0xaf1f('0x3c')](function(_0x301df5){if(_0x56a401){socket['emit'](_0xaf1f('0x59'),{'id':_0x56a401['id']});}if(!_0x22b5b2){logger[_0xaf1f('0x17')]('Invalid\x20authentication\x20state\x20parameter',_0x301df5);return _0x1d06b3['status'](0x1f4)[_0xaf1f('0x19')](_0x301df5[_0xaf1f('0x5a')]);}logger[_0xaf1f('0x17')](_0xaf1f('0x5b'),_0x22b5b2['id'],JSON[_0xaf1f('0x5c')](_0x301df5));});}; \ No newline at end of file +var _0x6dd5=['oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','parse','state','base64','toString','ascii','id_token','oauth2Claims','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','emit','send','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','redis','defaults','localhost','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','map','CloudProvider','rawAttributes','fieldName','query','keys','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','MicrosoftAzure','data3','catch','show','params','find','service','decryptString','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString'];(function(_0x1b6d73,_0x3ab331){var _0x381b24=function(_0x3f7f04){while(--_0x3f7f04){_0x1b6d73['push'](_0x1b6d73['shift']());}};_0x381b24(++_0x3ab331);}(_0x6dd5,0x121));var _0x56dd=function(_0x2bac1f,_0x1dba62){_0x2bac1f=_0x2bac1f-0x0;var _0x514736=_0x6dd5[_0x2bac1f];return _0x514736;};'use strict';var _=require(_0x56dd('0x0'));var Redis=require(_0x56dd('0x1'));var qs=require(_0x56dd('0x2'));var encryptor=require(_0x56dd('0x3'));var config=require(_0x56dd('0x4'));var logger=require(_0x56dd('0x5'))('api');var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x56dd('0x6')]=_[_0x56dd('0x7')](config[_0x56dd('0x6')],{'host':_0x56dd('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56dd('0x6')]));var redis=new Redis(config[_0x56dd('0x6')]);function respondWithStatusCode(_0x2a87eb,_0x47e4b8){_0x47e4b8=_0x47e4b8||0xcc;return function(_0x5224b0){if(_0x5224b0){return _0x2a87eb[_0x56dd('0x9')](_0x47e4b8);}return _0x2a87eb['status'](_0x47e4b8)[_0x56dd('0xa')]();};}function respondWithResult(_0x330600,_0x4a8ff4){_0x4a8ff4=_0x4a8ff4||0xc8;return function(_0x2938b0){if(_0x2938b0){return _0x330600[_0x56dd('0xb')](_0x4a8ff4)[_0x56dd('0xc')](_0x2938b0);}};}function respondWithFilteredResult(_0x32f8fd,_0x1074ed){return function(_0x5d74ed){if(_0x5d74ed){var _0x5e7661=typeof _0x1074ed['offset']===_0x56dd('0xd')&&typeof _0x1074ed[_0x56dd('0xe')]===_0x56dd('0xd');var _0x416fbb=_0x5d74ed['count'];var _0x55c493=_0x5e7661?0x0:_0x1074ed['offset'];var _0x2f9426=_0x5e7661?_0x5d74ed[_0x56dd('0xf')]:_0x1074ed[_0x56dd('0x10')]+_0x1074ed[_0x56dd('0xe')];var _0x2bd81b;if(_0x2f9426>=_0x416fbb){_0x2f9426=_0x416fbb;_0x2bd81b=0xc8;}else{_0x2bd81b=0xce;}_0x32f8fd['status'](_0x2bd81b);return _0x32f8fd[_0x56dd('0x11')](_0x56dd('0x12'),_0x55c493+'-'+_0x2f9426+'/'+_0x416fbb)[_0x56dd('0xc')](_0x5d74ed);}return null;};}function saveUpdates(_0x38588c){return function(_0x39e9aa){if(_0x39e9aa){return _0x39e9aa[_0x56dd('0x13')](_0x38588c)[_0x56dd('0x14')](function(_0x3b01c3){return _0x3b01c3;});}return null;};}function removeEntity(_0x4a6c7a){return function(_0x4f44ed){if(_0x4f44ed){return _0x4f44ed[_0x56dd('0x15')]()['then'](function(){_0x4a6c7a[_0x56dd('0xb')](0xcc)[_0x56dd('0xa')]();});}};}function handleEntityNotFound(_0xebe095){return function(_0xee274e){if(!_0xee274e){_0xebe095[_0x56dd('0x9')](0x194);}return _0xee274e;};}function handleError(_0x192947,_0xbf020f){_0xbf020f=_0xbf020f||0x1f4;return function(_0x1aaaab){logger['error'](_0x1aaaab[_0x56dd('0x16')]);if(_0x1aaaab[_0x56dd('0x17')]){delete _0x1aaaab[_0x56dd('0x17')];}_0x192947[_0x56dd('0xb')](_0xbf020f)['send'](_0x1aaaab);};}function maskClientSecret(_0x52b892){return _['padEnd'](_0x52b892['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x272631,_0x5b76f2){var _0x1e4782={},_0x24c26e={},_0xabb1be={'count':0x0,'rows':[]};var _0x51029b=_[_0x56dd('0x18')](db[_0x56dd('0x19')][_0x56dd('0x1a')],function(_0x3a48db){return{'name':_0x3a48db[_0x56dd('0x1b')],'type':_0x3a48db['type']['key']};});_0x24c26e['model']=_[_0x56dd('0x18')](_0x51029b,_0x56dd('0x17'));_0x24c26e[_0x56dd('0x1c')]=_[_0x56dd('0x1d')](_0x272631[_0x56dd('0x1c')]);_0x24c26e['filters']=_[_0x56dd('0x1e')](_0x24c26e['model'],_0x24c26e[_0x56dd('0x1c')]);_0x1e4782[_0x56dd('0x1f')]=_[_0x56dd('0x1e')](_0x24c26e[_0x56dd('0x20')],qs[_0x56dd('0x21')](_0x272631[_0x56dd('0x1c')][_0x56dd('0x21')]));_0x1e4782[_0x56dd('0x1f')]=_0x1e4782[_0x56dd('0x1f')]['length']?_0x1e4782[_0x56dd('0x1f')]:_0x24c26e[_0x56dd('0x20')];if(!_0x272631['query'][_0x56dd('0x22')]('nolimit')){_0x1e4782[_0x56dd('0xe')]=qs['limit'](_0x272631[_0x56dd('0x1c')][_0x56dd('0xe')]);_0x1e4782['offset']=qs[_0x56dd('0x10')](_0x272631[_0x56dd('0x1c')][_0x56dd('0x10')]);}_0x1e4782[_0x56dd('0x23')]=qs[_0x56dd('0x24')](_0x272631[_0x56dd('0x1c')][_0x56dd('0x24')]);_0x1e4782[_0x56dd('0x25')]=qs[_0x56dd('0x26')](_[_0x56dd('0x27')](_0x272631['query'],_0x24c26e[_0x56dd('0x26')]),_0x51029b);if(_0x272631[_0x56dd('0x1c')]['filter']){_0x1e4782[_0x56dd('0x25')]=_[_0x56dd('0x28')](_0x1e4782[_0x56dd('0x25')],{'$or':_['map'](_0x51029b,function(_0xfce0b0){if(_0xfce0b0['type']!==_0x56dd('0x29')){var _0x30b027={};_0x30b027[_0xfce0b0[_0x56dd('0x17')]]={'$like':'%'+_0x272631['query'][_0x56dd('0x2a')]+'%'};return _0x30b027;}})});}_0x1e4782=_[_0x56dd('0x28')]({},_0x1e4782,_0x272631[_0x56dd('0x2b')]);var _0x4cf66f={'where':_0x1e4782[_0x56dd('0x25')]};return db['CloudProvider'][_0x56dd('0xf')](_0x4cf66f)['then'](function(_0x17afc0){_0xabb1be[_0x56dd('0xf')]=_0x17afc0;if(_0x272631[_0x56dd('0x1c')][_0x56dd('0x2c')]){_0x1e4782[_0x56dd('0x2d')]=[{'all':!![]}];}return db[_0x56dd('0x19')]['findAll'](_0x1e4782);})['then'](function(_0x3bfe01){_0xabb1be[_0x56dd('0x2e')]=_[_0x56dd('0x18')](_0x3bfe01,function(_0x3d5e3a){if(_0x3d5e3a['service']===_0x56dd('0x2f')){var _0x3287fc=encryptor['decryptString'](_0x3d5e3a[_0x56dd('0x30')]);_0x3d5e3a[_0x56dd('0x30')]=maskClientSecret(_0x3287fc);}return _0x3d5e3a;});return _0xabb1be;})['then'](respondWithFilteredResult(_0x5b76f2,_0x1e4782))[_0x56dd('0x31')](handleError(_0x5b76f2,null));};exports[_0x56dd('0x32')]=function(_0x1d9163,_0x23f8e5){var _0x540913={'raw':!![],'where':{'id':_0x1d9163[_0x56dd('0x33')]['id']}},_0x2bee9e={};_0x2bee9e[_0x56dd('0x20')]=_[_0x56dd('0x1d')](db[_0x56dd('0x19')][_0x56dd('0x1a')]);_0x2bee9e[_0x56dd('0x1c')]=_[_0x56dd('0x1d')](_0x1d9163['query']);_0x2bee9e[_0x56dd('0x26')]=_[_0x56dd('0x1e')](_0x2bee9e[_0x56dd('0x20')],_0x2bee9e[_0x56dd('0x1c')]);_0x540913[_0x56dd('0x1f')]=_['intersection'](_0x2bee9e[_0x56dd('0x20')],qs['fields'](_0x1d9163[_0x56dd('0x1c')][_0x56dd('0x21')]));_0x540913[_0x56dd('0x1f')]=_0x540913['attributes']['length']?_0x540913[_0x56dd('0x1f')]:_0x2bee9e[_0x56dd('0x20')];if(_0x1d9163[_0x56dd('0x1c')][_0x56dd('0x2c')]){_0x540913['include']=[{'all':!![]}];}_0x540913=_[_0x56dd('0x28')]({},_0x540913,_0x1d9163[_0x56dd('0x2b')]);return db[_0x56dd('0x19')][_0x56dd('0x34')](_0x540913)[_0x56dd('0x14')](handleEntityNotFound(_0x23f8e5,null))['then'](function(_0x1ca513){if(_0x1ca513[_0x56dd('0x35')]===_0x56dd('0x2f')){var _0x26b6bf=encryptor[_0x56dd('0x36')](_0x1ca513[_0x56dd('0x30')]);_0x1ca513[_0x56dd('0x30')]=maskClientSecret(_0x26b6bf);}return _0x1ca513;})[_0x56dd('0x14')](respondWithResult(_0x23f8e5,null))[_0x56dd('0x31')](handleError(_0x23f8e5,null));};exports[_0x56dd('0x37')]=function(_0x194bdb,_0xe1acc5){if(!_0x194bdb['body'][_0x56dd('0x17')])throw new Error(_0x56dd('0x38'));if(!_0x194bdb[_0x56dd('0x39')][_0x56dd('0x35')])throw new Error(_0x56dd('0x3a'));var _0x2892bd=db['CloudProvider']['rawAttributes'][_0x56dd('0x35')][_0x56dd('0x3b')];if(!_0x2892bd[_0x56dd('0x3c')](_0x194bdb[_0x56dd('0x39')][_0x56dd('0x35')]))throw new Error(_0x56dd('0x3d')+_0x2892bd['join'](',\x20'));if(_0x194bdb[_0x56dd('0x39')]['service']===_0x56dd('0x2f')&&_0x194bdb[_0x56dd('0x39')][_0x56dd('0x30')]){_0x194bdb['body'][_0x56dd('0x30')]=encryptor[_0x56dd('0x3e')](_0x194bdb[_0x56dd('0x39')][_0x56dd('0x30')]);}return db[_0x56dd('0x19')]['create'](_0x194bdb['body'],{})[_0x56dd('0x14')](respondWithResult(_0xe1acc5,0xc9))['catch'](handleError(_0xe1acc5,null));};exports[_0x56dd('0x13')]=function(_0x290bc1,_0x3510bf){if(_0x290bc1[_0x56dd('0x39')]['id']){delete _0x290bc1[_0x56dd('0x39')]['id'];}return db['CloudProvider'][_0x56dd('0x34')]({'where':{'id':_0x290bc1[_0x56dd('0x33')]['id']}})[_0x56dd('0x14')](handleEntityNotFound(_0x3510bf,null))[_0x56dd('0x14')](function(_0x5c6597){if(_0x5c6597['service']===_0x56dd('0x2f')&&_0x290bc1['body'][_0x56dd('0x30')]){_0x290bc1['body']['data3']=encryptor[_0x56dd('0x3e')](_0x290bc1[_0x56dd('0x39')][_0x56dd('0x30')]);}return _0x5c6597;})[_0x56dd('0x14')](saveUpdates(_0x290bc1[_0x56dd('0x39')],null))[_0x56dd('0x14')](respondWithResult(_0x3510bf,null))[_0x56dd('0x31')](handleError(_0x3510bf,null));};exports[_0x56dd('0x15')]=function(_0x38c2ad,_0x5d11a8){return db[_0x56dd('0x19')][_0x56dd('0x34')]({'where':{'id':_0x38c2ad[_0x56dd('0x33')]['id']}})[_0x56dd('0x14')](handleEntityNotFound(_0x5d11a8,null))['then'](removeEntity(_0x5d11a8,null))[_0x56dd('0x31')](handleError(_0x5d11a8,null));};exports[_0x56dd('0x3f')]=function(_0x4c71e2,_0xa2a4c2){return db['CloudProvider'][_0x56dd('0x40')]({'where':{'id':_0x4c71e2[_0x56dd('0x33')]['id']},'raw':!![]})['then'](function(_0x16023a){if(!_0x16023a)return _0xa2a4c2['sendStatus'](0x194);return{'url':oauth[_0x56dd('0x41')](_0x16023a,_0x4c71e2[_0x56dd('0x42')]['id'])};})[_0x56dd('0x14')](respondWithResult(_0xa2a4c2,null))[_0x56dd('0x31')](handleError(_0xa2a4c2,null));};exports[_0x56dd('0x43')]=function(_0x46337c,_0x2ae84b){var _0x45874b=_0x46337c[_0x56dd('0x39')];var _0x13bb6e;var _0x40ba94;if(_0x45874b[_0x56dd('0x44')])throw _0x45874b;redis[_0x56dd('0x45')](_0x45874b['state'])[_0x56dd('0x14')](function(_0x49ab3f){if(!_0x49ab3f)throw new Error('Invalid\x20state\x20parameter');_0x13bb6e=JSON[_0x56dd('0x46')](_0x49ab3f);var _0x543775=Buffer['from'](_0x45874b[_0x56dd('0x47')],_0x56dd('0x48'))[_0x56dd('0x49')](_0x56dd('0x4a'));_0x40ba94=JSON['parse'](_0x543775);if(!oauth['isValidIdToken'](_0x45874b[_0x56dd('0x4b')],_0x13bb6e[_0x56dd('0x4c')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x56dd('0x4d')](_0x45874b['state']);return oauth[_0x56dd('0x4e')](_0x45874b[_0x56dd('0x4f')],_0x13bb6e);})[_0x56dd('0x14')](function(_0x4837b7){_0x13bb6e[_0x56dd('0x50')]=_0x4837b7[_0x56dd('0x51')];_0x13bb6e[_0x56dd('0x52')]=_0x4837b7[_0x56dd('0x53')];return db[_0x56dd('0x19')][_0x56dd('0x13')]({'data5':_0x13bb6e[_0x56dd('0x50')],'data6':_0x13bb6e['data6']},{'where':{'id':_0x13bb6e['id']}});})[_0x56dd('0x14')](function(){oauth['startRefreshInterval'](_0x13bb6e);socket['emit']('microsoftAuthorization:success',{'id':_0x40ba94['id']});return;})[_0x56dd('0x14')](respondWithStatusCode(_0x2ae84b,null))[_0x56dd('0x31')](function(_0x25033b){if(_0x40ba94){socket[_0x56dd('0x54')]('microsoftAuthorization:error',{'id':_0x40ba94['id']});}if(!_0x13bb6e){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x25033b);return _0x2ae84b['status'](0x1f4)[_0x56dd('0x55')](_0x25033b[_0x56dd('0x56')]);}logger[_0x56dd('0x44')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x13bb6e['id'],JSON[_0x56dd('0x57')](_0x25033b));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index be57f6e..e184a15 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 _0xb13b=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x507f3a,_0x43ece5){var _0x1dc39d=function(_0x2a3520){while(--_0x2a3520){_0x507f3a['push'](_0x507f3a['shift']());}};_0x1dc39d(++_0x43ece5);}(_0xb13b,0xa0));var _0xbb13=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb13b[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))(_0xbb13('0x2'));var moment=require(_0xbb13('0x3'));var BPromise=require(_0xbb13('0x4'));var rp=require(_0xbb13('0x5'));var fs=require('fs');var path=require(_0xbb13('0x6'));var rimraf=require(_0xbb13('0x7'));var config=require(_0xbb13('0x8'));var attributes=require(_0xbb13('0x9'));module[_0xbb13('0xa')]=function(_0x2b7e21,_0x1ab9e4){return _0x2b7e21['define'](_0xbb13('0xb'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x17e5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','cloud_providers','lodash','util','../../config/logger'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x17e5,0xf9));var _0x517e=function(_0x162e79,_0x14d8db){_0x162e79=_0x162e79-0x0;var _0x5e952d=_0x17e5[_0x162e79];return _0x5e952d;};'use strict';var _=require(_0x517e('0x0'));var util=require(_0x517e('0x1'));var logger=require(_0x517e('0x2'))(_0x517e('0x3'));var moment=require(_0x517e('0x4'));var BPromise=require(_0x517e('0x5'));var rp=require(_0x517e('0x6'));var fs=require('fs');var path=require(_0x517e('0x7'));var rimraf=require(_0x517e('0x8'));var config=require(_0x517e('0x9'));var attributes=require('./cloudProvider.attributes');module[_0x517e('0xa')]=function(_0x265b48,_0x5e4094){return _0x265b48['define']('CloudProvider',attributes,{'tableName':_0x517e('0xb'),'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 d0faf47..b1b01c1 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 _0x0801=['stringify','randomBytes','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','map','key','value','oauth2Claims','oauth2/','set','decode','payload','aud','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','decryptString','POST','access_token','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','replace','intervals','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','crypto','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','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','/authorize','/token','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','code','id_token','from'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0801,0x15f));var _0x1080=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0801[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1080('0x0'));var crypto=require(_0x1080('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x1080('0x2'));var Redis=require(_0x1080('0x3'));var rp=require(_0x1080('0x4'));var util=require(_0x1080('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0x1080('0x6'));var logger=require(_0x1080('0x7'))(_0x1080('0x8'));var schedule=require(_0x1080('0x9'));var db=require(_0x1080('0xa'))['db'];config[_0x1080('0xb')]=_['defaults'](config[_0x1080('0xb')],{'host':_0x1080('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x1080('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x1080('0xe'),_0x1080('0xf'),_0x1080('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x1080('0x11'),_0x1080('0x12')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x1080('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x1080('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2f5e32){var _0x581a46=_['map'](AZURE_AUTH_SCOPES[_0x2f5e32[_0x1080('0x15')]]);if(_0x2f5e32[_0x1080('0x15')]===_0x1080('0x16'))_0x581a46[_0x1080('0x17')](_0x2f5e32[_0x1080('0x18')]+_0x1080('0x19'));return _0x581a46[_0x1080('0x1a')]('\x20');}function getAccessTokenScope(_0x16b098){if(_0x16b098[_0x1080('0x15')]===_0x1080('0x1b'))return _0x1080('0x1c');if(_0x16b098[_0x1080('0x15')]===_0x1080('0x16'))return _0x16b098[_0x1080('0x18')]+_0x1080('0x19');}function generateMicrosoftAuthorizationUrl(_0x204669,_0x1f8988){var _0x1a168a=MICROSOFT_AUTH_URL['replace'](_0x1080('0x1d'),_0x204669[_0x1080('0x1e')]);var _0x51ed19=[_0x1080('0x1f'),_0x1080('0x20')];var _0x589eb6=Buffer[_0x1080('0x21')](JSON[_0x1080('0x22')]({'id':_0x1f8988}))['toString']('base64');var _0x13f466=crypto[_0x1080('0x23')](0x10)['toString']('hex');var _0x17ba44=getAuthorizationScopes(_0x204669);var _0x1a7e33=[{'key':_0x1080('0x24'),'value':_0x204669[_0x1080('0x25')]},{'key':_0x1080('0x26'),'value':encodeURIComponent(_0x51ed19[_0x1080('0x1a')]('\x20'))},{'key':_0x1080('0x27'),'value':_0x204669[_0x1080('0x28')]},{'key':_0x1080('0x29'),'value':_0x1080('0x2a')},{'key':_0x1080('0x2b'),'value':encodeURIComponent(_0x17ba44)},{'key':_0x1080('0x2c'),'value':_0x589eb6},{'key':_0x1080('0x2d'),'value':_0x13f466},{'key':_0x1080('0x2e'),'value':_0x1080('0x2f')}];var _0x4ea67c=_0x1a168a+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x1080('0x30')](_0x1a7e33,function(_0x884017){return _0x884017[_0x1080('0x31')]+'='+_0x884017[_0x1080('0x32')];})[_0x1080('0x1a')]('&');_0x204669[_0x1080('0x33')]={'issuer':_0x1a168a['replace'](_0x1080('0x34'),''),'audience':_0x204669[_0x1080('0x25')],'state':_0x589eb6,'nonce':_0x13f466};redis[_0x1080('0x35')](_0x589eb6,JSON[_0x1080('0x22')](_0x204669));return _0x4ea67c;}function isValidIdToken(_0x3a5ca7,_0x1f256f){try{var _0x8c5aa4=jwt[_0x1080('0x36')](_0x3a5ca7,{'complete':!![]});var _0x592698=_0x8c5aa4[_0x1080('0x37')];if(_0x592698['iss']!==_0x1f256f['issuer'])return![];if(_0x592698[_0x1080('0x38')]!==_0x1f256f['audience'])return![];if(_0x592698[_0x1080('0x2d')]!==_0x1f256f[_0x1080('0x2d')])return![];if(moment()[_0x1080('0x39')](moment[_0x1080('0x3a')](_0x592698[_0x1080('0x3b')])))return![];return!![];}catch(_0x2c4cd2){throw _0x2c4cd2;}}function refreshOauth2MicrosoftAccessToken(_0x248d90){return Promise[_0x1080('0x3c')]()[_0x1080('0x3d')](function(){if(_0x248d90[_0x1080('0x3e')])return _0x248d90;return db[_0x1080('0x3f')][_0x1080('0x40')]({'where':{'id':_0x248d90['id']},'raw':!![]});})['then'](function(_0x586a94){var _0x2e8c0b={'grant_type':'refresh_token','refresh_token':_0x586a94[_0x1080('0x41')],'scope':getAccessTokenScope(_0x586a94),'redirect_uri':_0x586a94[_0x1080('0x28')],'client_id':_0x586a94[_0x1080('0x25')],'client_secret':encryptor[_0x1080('0x42')](_0x586a94['data3'])};var _0x2872a3={'method':_0x1080('0x43'),'uri':MICROSOFT_AUTH_URL['replace'](_0x1080('0x1d'),_0x586a94[_0x1080('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2e8c0b,'json':!![]};return rp(_0x2872a3);})['then'](function(_0x2888db){_0x248d90['data5']=_0x2888db[_0x1080('0x44')];_0x248d90[_0x1080('0x41')]=_0x2888db['refresh_token'];return db['CloudProvider']['update']({'data5':_0x248d90[_0x1080('0x45')],'data6':_0x248d90[_0x1080('0x41')]},{'where':{'id':_0x248d90['id']}});})[_0x1080('0x3d')](function(){return _0x248d90;})['catch'](function(_0xd47e85){logger[_0x1080('0x46')](_0x1080('0x47'),_0x248d90['id'],_0xd47e85);});}function getOauth2MicrosoftAccessToken(_0x2708c7,_0x3d84d7){var _0x5dd5ff={'grant_type':_0x1080('0x48'),'code':_0x2708c7,'scope':getAccessTokenScope(_0x3d84d7),'redirect_uri':_0x3d84d7[_0x1080('0x28')],'client_id':_0x3d84d7['data1'],'client_secret':encryptor[_0x1080('0x42')](_0x3d84d7[_0x1080('0x3e')])};var _0x96d687={'method':_0x1080('0x43'),'uri':MICROSOFT_AUTH_URL[_0x1080('0x49')](_0x1080('0x1d'),_0x3d84d7[_0x1080('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5dd5ff,'json':!![]};return rp(_0x96d687);}function startRefreshInterval(_0x10abdd){var _0x5a8f96=schedule[_0x1080('0x4a')];if(_0x5a8f96[_0x10abdd['id']])clearInterval(_0x5a8f96[_0x10abdd['id']]);_0x5a8f96[_0x10abdd['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x10abdd['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x1080('0x4a')]=_0x5a8f96;}function startAllRefreshIntervals(){return db[_0x1080('0x3f')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x1080('0x3d')](function(_0x700b8f){var _0x41a7eb=_0x700b8f['map'](function(_0x4895de){return refreshOauth2MicrosoftAccessToken(_0x4895de)[_0x1080('0x3d')](function(_0x12fd73){startRefreshInterval(_0x12fd73);});});return Promise['all'](_0x41a7eb);})['catch'](function(_0x5904da){var _0x5881ad=_0x5904da?util[_0x1080('0x4b')](_0x5904da,{'showHidden':![],'depth':null}):'';logger['error'](_0x1080('0x4c'),_0x5881ad);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x94a0=['Outlook365','replace','{TENANT_ID}','code','id_token','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','key','value','oauth2Claims','oauth2/','set','stringify','iss','issuer','aud','audience','nonce','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','POST','data2','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','all','inspect','lodash','jsonwebtoken','moment','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','map','type','Dynamics365','push','data7','/.default','join'];(function(_0xdd82b4,_0x5cd8b8){var _0x549bb2=function(_0x426fd9){while(--_0x426fd9){_0xdd82b4['push'](_0xdd82b4['shift']());}};_0x549bb2(++_0x5cd8b8);}(_0x94a0,0x179));var _0x094a=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x94a0[_0x20e7e3];return _0x14b9de;};'use strict';var _=require(_0x094a('0x0'));var crypto=require('crypto');var jwt=require(_0x094a('0x1'));var moment=require(_0x094a('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x094a('0x3'));var encryptor=require(_0x094a('0x4'));var config=require(_0x094a('0x5'));var logger=require(_0x094a('0x6'))(_0x094a('0x7'));var schedule=require(_0x094a('0x8'));var db=require('../../mysqldb')['db'];config[_0x094a('0x9')]=_[_0x094a('0xa')](config[_0x094a('0x9')],{'host':_0x094a('0xb'),'port':0x18eb});var redis=new Redis(config[_0x094a('0x9')]);var MICROSOFT_AUTH_URL=_0x094a('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x094a('0xd'),_0x094a('0xe'),_0x094a('0xf'),_0x094a('0x10'),_0x094a('0x11'),_0x094a('0x12')],'Dynamics365':[_0x094a('0x13'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x094a('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1fda8c){var _0x4a3bb0=_[_0x094a('0x15')](AZURE_AUTH_SCOPES[_0x1fda8c[_0x094a('0x16')]]);if(_0x1fda8c[_0x094a('0x16')]===_0x094a('0x17'))_0x4a3bb0[_0x094a('0x18')](_0x1fda8c[_0x094a('0x19')]+_0x094a('0x1a'));return _0x4a3bb0[_0x094a('0x1b')]('\x20');}function getAccessTokenScope(_0x3ccfb3){if(_0x3ccfb3[_0x094a('0x16')]===_0x094a('0x1c'))return _0x094a('0x10');if(_0x3ccfb3[_0x094a('0x16')]===_0x094a('0x17'))return _0x3ccfb3['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x42bd84,_0x29077d){var _0x3cb440=MICROSOFT_AUTH_URL[_0x094a('0x1d')](_0x094a('0x1e'),_0x42bd84['data2']);var _0xb5d6d1=[_0x094a('0x1f'),_0x094a('0x20')];var _0x480f00=Buffer['from'](JSON['stringify']({'id':_0x29077d}))[_0x094a('0x21')]('base64');var _0x4531fe=crypto[_0x094a('0x22')](0x10)['toString'](_0x094a('0x23'));var _0x334c12=getAuthorizationScopes(_0x42bd84);var _0x4bea37=[{'key':_0x094a('0x24'),'value':_0x42bd84[_0x094a('0x25')]},{'key':_0x094a('0x26'),'value':encodeURIComponent(_0xb5d6d1['join']('\x20'))},{'key':_0x094a('0x27'),'value':_0x42bd84[_0x094a('0x28')]},{'key':_0x094a('0x29'),'value':_0x094a('0x2a')},{'key':_0x094a('0x2b'),'value':encodeURIComponent(_0x334c12)},{'key':_0x094a('0x2c'),'value':_0x480f00},{'key':'nonce','value':_0x4531fe},{'key':_0x094a('0x2d'),'value':_0x094a('0x2e')}];var _0xe7334e=_0x3cb440+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4bea37,function(_0x10a1bc){return _0x10a1bc[_0x094a('0x2f')]+'='+_0x10a1bc[_0x094a('0x30')];})['join']('&');_0x42bd84[_0x094a('0x31')]={'issuer':_0x3cb440[_0x094a('0x1d')](_0x094a('0x32'),''),'audience':_0x42bd84[_0x094a('0x25')],'state':_0x480f00,'nonce':_0x4531fe};redis[_0x094a('0x33')](_0x480f00,JSON[_0x094a('0x34')](_0x42bd84));return _0xe7334e;}function isValidIdToken(_0x5c3fda,_0x4ccd59){try{var _0x455af3=jwt['decode'](_0x5c3fda,{'complete':!![]});var _0x41acd6=_0x455af3['payload'];if(_0x41acd6[_0x094a('0x35')]!==_0x4ccd59[_0x094a('0x36')])return![];if(_0x41acd6[_0x094a('0x37')]!==_0x4ccd59[_0x094a('0x38')])return![];if(_0x41acd6['nonce']!==_0x4ccd59[_0x094a('0x39')])return![];if(moment()['isAfter'](moment[_0x094a('0x3a')](_0x41acd6[_0x094a('0x3b')])))return![];return!![];}catch(_0x318579){throw _0x318579;}}function refreshOauth2MicrosoftAccessToken(_0x439044){return Promise[_0x094a('0x3c')]()[_0x094a('0x3d')](function(){if(_0x439044[_0x094a('0x3e')])return _0x439044;return db[_0x094a('0x3f')][_0x094a('0x40')]({'where':{'id':_0x439044['id']},'raw':!![]});})[_0x094a('0x3d')](function(_0x3caaef){var _0x108a71={'grant_type':_0x094a('0x41'),'refresh_token':_0x3caaef[_0x094a('0x42')],'scope':getAccessTokenScope(_0x3caaef),'redirect_uri':_0x3caaef[_0x094a('0x28')],'client_id':_0x3caaef[_0x094a('0x25')],'client_secret':encryptor[_0x094a('0x43')](_0x3caaef[_0x094a('0x3e')])};var _0x237a1a={'method':_0x094a('0x44'),'uri':MICROSOFT_AUTH_URL[_0x094a('0x1d')](_0x094a('0x1e'),_0x3caaef[_0x094a('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x108a71,'json':!![]};return rp(_0x237a1a);})[_0x094a('0x3d')](function(_0x3a03cc){_0x439044[_0x094a('0x46')]=_0x3a03cc[_0x094a('0x47')];_0x439044[_0x094a('0x42')]=_0x3a03cc[_0x094a('0x41')];return db[_0x094a('0x3f')][_0x094a('0x48')]({'data5':_0x439044[_0x094a('0x46')],'data6':_0x439044[_0x094a('0x42')]},{'where':{'id':_0x439044['id']}});})[_0x094a('0x3d')](function(){return _0x439044;})[_0x094a('0x49')](function(_0x50f844){logger[_0x094a('0x4a')](_0x094a('0x4b'),_0x439044['id'],_0x50f844);});}function getOauth2MicrosoftAccessToken(_0x326df7,_0x10a381){var _0x2cf7cd={'grant_type':_0x094a('0x4c'),'code':_0x326df7,'scope':getAccessTokenScope(_0x10a381),'redirect_uri':_0x10a381[_0x094a('0x28')],'client_id':_0x10a381[_0x094a('0x25')],'client_secret':encryptor[_0x094a('0x43')](_0x10a381[_0x094a('0x3e')])};var _0x1aab37={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x094a('0x1d')]('{TENANT_ID}',_0x10a381[_0x094a('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cf7cd,'json':!![]};return rp(_0x1aab37);}function startRefreshInterval(_0x442944){var _0x5e3fc1=schedule[_0x094a('0x4d')];if(_0x5e3fc1[_0x442944['id']])clearInterval(_0x5e3fc1[_0x442944['id']]);_0x5e3fc1[_0x442944['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x094a('0x4e')](this,{'id':_0x442944['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x5e3fc1;}function startAllRefreshIntervals(){return db[_0x094a('0x3f')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x094a('0x3d')](function(_0x3e71fb){var _0x5708c6=_0x3e71fb[_0x094a('0x15')](function(_0xa613a9){return refreshOauth2MicrosoftAccessToken(_0xa613a9)[_0x094a('0x3d')](function(_0x5b9066){startRefreshInterval(_0x5b9066);});});return Promise[_0x094a('0x4f')](_0x5708c6);})[_0x094a('0x49')](function(_0x211c8f){var _0x4b9f8c=_0x211c8f?util[_0x094a('0x50')](_0x211c8f,{'showHidden':![],'depth':null}):'';logger[_0x094a('0x4a')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4b9f8c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 604d8a7..5c08e48 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 _0x7d14=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash'];(function(_0x471765,_0x9feced){var _0x519da6=function(_0x5da7dd){while(--_0x5da7dd){_0x471765['push'](_0x471765['shift']());}};_0x519da6(++_0x9feced);}(_0x7d14,0x6d));var _0x47d1=function(_0x26062f,_0xa31db){_0x26062f=_0x26062f-0x0;var _0x24a445=_0x7d14[_0x26062f];return _0x24a445;};'use strict';var _=require(_0x47d1('0x0'));var util=require(_0x47d1('0x1'));var moment=require('moment');var BPromise=require(_0x47d1('0x2'));var rs=require(_0x47d1('0x3'));var fs=require('fs');var Redis=require(_0x47d1('0x4'));var db=require(_0x47d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x47d1('0x6'))(_0x47d1('0x7'));var config=require(_0x47d1('0x8'));var jayson=require(_0x47d1('0x9'));var client=jayson[_0x47d1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x533402,_0x594860,_0x38e165){return new BPromise(function(_0x57d410,_0x422ade){return client[_0x47d1('0xb')](_0x533402,_0x38e165)[_0x47d1('0xc')](function(_0x175dd2){logger[_0x47d1('0xd')](_0x47d1('0xe'),_0x594860,_0x47d1('0xf'));logger[_0x47d1('0x10')](_0x47d1('0x11'),_0x594860,_0x47d1('0xf'),JSON[_0x47d1('0x12')](_0x175dd2));if(_0x175dd2[_0x47d1('0x13')]){if(_0x175dd2[_0x47d1('0x13')]['code']===0x1f4){logger[_0x47d1('0x13')](_0x47d1('0xe'),_0x594860,_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);return _0x422ade(_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);}logger[_0x47d1('0x13')](_0x47d1('0xe'),_0x594860,_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);return _0x57d410(_0x175dd2[_0x47d1('0x13')][_0x47d1('0x14')]);}else{logger[_0x47d1('0xd')](_0x47d1('0xe'),_0x594860,_0x47d1('0xf'));_0x57d410(_0x175dd2[_0x47d1('0x15')]['message']);}})['catch'](function(_0x3d660f){logger[_0x47d1('0x13')]('CloudProvider,\x20%s,\x20%s',_0x594860,_0x3d660f);_0x422ade(_0x3d660f);});});} \ No newline at end of file +var _0x7fee=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent'];(function(_0x58b77c,_0x59ff0e){var _0x130d6c=function(_0xbdec12){while(--_0xbdec12){_0x58b77c['push'](_0x58b77c['shift']());}};_0x130d6c(++_0x59ff0e);}(_0x7fee,0x1a6));var _0xe7fe=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x7fee[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xe7fe('0x0'));var util=require(_0xe7fe('0x1'));var moment=require(_0xe7fe('0x2'));var BPromise=require(_0xe7fe('0x3'));var rs=require(_0xe7fe('0x4'));var fs=require('fs');var Redis=require(_0xe7fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7fe('0x6'));var logger=require(_0xe7fe('0x7'))(_0xe7fe('0x8'));var config=require('../../config/environment');var jayson=require(_0xe7fe('0x9'));var client=jayson['client'][_0xe7fe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeca7d9,_0x25a6a4,_0x9b55e8){return new BPromise(function(_0x1f3366,_0xf5e41b){return client[_0xe7fe('0xb')](_0xeca7d9,_0x9b55e8)['then'](function(_0x5b8d3f){logger['info'](_0xe7fe('0xc'),_0x25a6a4,'request\x20sent');logger[_0xe7fe('0xd')](_0xe7fe('0xe'),_0x25a6a4,'request\x20sent',JSON['stringify'](_0x5b8d3f));if(_0x5b8d3f[_0xe7fe('0xf')]){if(_0x5b8d3f[_0xe7fe('0xf')]['code']===0x1f4){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')]['message']);return _0xf5e41b(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}logger[_0xe7fe('0xf')]('CloudProvider,\x20%s,\x20%s',_0x25a6a4,_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);return _0x1f3366(_0x5b8d3f[_0xe7fe('0xf')][_0xe7fe('0x10')]);}else{logger[_0xe7fe('0x11')](_0xe7fe('0xc'),_0x25a6a4,_0xe7fe('0x12'));_0x1f3366(_0x5b8d3f[_0xe7fe('0x13')][_0xe7fe('0x10')]);}})[_0xe7fe('0x14')](function(_0x3616a6){logger[_0xe7fe('0xf')](_0xe7fe('0xc'),_0x25a6a4,_0x3616a6);_0xf5e41b(_0x3616a6);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index f249ad9..accc78a 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 _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x7a54,0x106));var _0x47a5=function(_0x1c70e2,_0x539c42){_0x1c70e2=_0x1c70e2-0x0;var _0x129f9c=_0x7a54[_0x1c70e2];return _0x129f9c;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x532d78,_0x25b6a8){var _0x5990c4=function(_0x3f23fe){while(--_0x3f23fe){_0x532d78['push'](_0x532d78['shift']());}};_0x5990c4(++_0x25b6a8);}(_0x1261,0x144));var _0x1126=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x1261[_0x3305de];return _0x3b5a84;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index aa96230..e71b9a5 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 _0xc7df=['exports','STRING','sequelize'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xc7df,0x149));var _0xfc7d=function(_0x84dd87,_0x54f5e8){_0x84dd87=_0x84dd87-0x0;var _0xadebd5=_0xc7df[_0x84dd87];return _0xadebd5;};'use strict';var Sequelize=require(_0xfc7d('0x0'));module[_0xfc7d('0x1')]={'name':{'type':Sequelize[_0xfc7d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xfc7d('0x2')]},'companyId':{'type':Sequelize[_0xfc7d('0x2')]},'website':{'type':Sequelize[_0xfc7d('0x2')]},'phone':{'type':Sequelize[_0xfc7d('0x2')]},'fax':{'type':Sequelize[_0xfc7d('0x2')]},'type':{'type':Sequelize[_0xfc7d('0x2')]},'street':{'type':Sequelize[_0xfc7d('0x2')]},'postalCode':{'type':Sequelize[_0xfc7d('0x2')]},'city':{'type':Sequelize[_0xfc7d('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xfc7d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xfc7d('0x2')]},'sStreet':{'type':Sequelize[_0xfc7d('0x2')]},'sPostalCode':{'type':Sequelize[_0xfc7d('0x2')]},'sCity':{'type':Sequelize[_0xfc7d('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfc7d('0x2')]}}; \ No newline at end of file +var _0x7faf=['STRING','sequelize'];(function(_0x4c42a0,_0x50237a){var _0x13170f=function(_0xcd0ade){while(--_0xcd0ade){_0x4c42a0['push'](_0x4c42a0['shift']());}};_0x13170f(++_0x50237a);}(_0x7faf,0x12d));var _0xf7fa=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7faf[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xf7fa('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf7fa('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xf7fa('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xf7fa('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xf7fa('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf7fa('0x1')]},'country':{'type':Sequelize[_0xf7fa('0x1')]},'email':{'type':Sequelize[_0xf7fa('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xf7fa('0x1')]},'sCountry':{'type':Sequelize[_0xf7fa('0x1')]},'description':{'type':Sequelize[_0xf7fa('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index f7d3ee7..0741629 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 _0x5ccf=['intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','map','count','includeAll','findAll','rows','catch','show','length','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','CmContact','addContacts','ids','omit','getContacts','findOne','filter','merge','eml-format','zip-dir','request-promise','moment','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','update','then','destroy','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','attributes'];(function(_0x4a02ba,_0x279370){var _0x5b5c83=function(_0x5b0d42){while(--_0x5b0d42){_0x4a02ba['push'](_0x4a02ba['shift']());}};_0x5b5c83(++_0x279370);}(_0x5ccf,0x171));var _0xf5cc=function(_0x881c98,_0x2f7cc4){_0x881c98=_0x881c98-0x0;var _0x445bc6=_0x5ccf[_0x881c98];return _0x445bc6;};'use strict';var emlformat=require(_0xf5cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf5cc('0x2'));var moment=require(_0xf5cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf5cc('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf5cc('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5cc('0x6'));var _=require(_0xf5cc('0x7'));var squel=require(_0xf5cc('0x8'));var crypto=require(_0xf5cc('0x9'));var jsforce=require(_0xf5cc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xf5cc('0x5'));var querystring=require(_0xf5cc('0xb'));var Papa=require('papaparse');var Redis=require(_0xf5cc('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf5cc('0xd'));var as=require(_0xf5cc('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5cc('0xf'))(_0xf5cc('0x10'));var utils=require('../../config/utils');var config=require(_0xf5cc('0x11'));var licenseUtil=require(_0xf5cc('0x12'));var db=require(_0xf5cc('0x13'))['db'];function respondWithStatusCode(_0x2f377e,_0x20f99c){_0x20f99c=_0x20f99c||0xcc;return function(_0x142dd0){if(_0x142dd0){return _0x2f377e[_0xf5cc('0x14')](_0x20f99c);}return _0x2f377e[_0xf5cc('0x15')](_0x20f99c)[_0xf5cc('0x16')]();};}function respondWithResult(_0x585806,_0xc4479b){_0xc4479b=_0xc4479b||0xc8;return function(_0x314a43){if(_0x314a43){return _0x585806[_0xf5cc('0x15')](_0xc4479b)[_0xf5cc('0x17')](_0x314a43);}};}function respondWithFilteredResult(_0x3e987a,_0x1512d3){return function(_0x3fc0b2){if(_0x3fc0b2){var _0x3ba5b3=typeof _0x1512d3[_0xf5cc('0x18')]===_0xf5cc('0x19')&&typeof _0x1512d3[_0xf5cc('0x1a')]===_0xf5cc('0x19');var _0x4718dd=_0x3fc0b2['count'];var _0x24dbce=_0x3ba5b3?0x0:_0x1512d3[_0xf5cc('0x18')];var _0x42dec9=_0x3ba5b3?_0x3fc0b2['count']:_0x1512d3['offset']+_0x1512d3[_0xf5cc('0x1a')];var _0xa8ee5e;if(_0x42dec9>=_0x4718dd){_0x42dec9=_0x4718dd;_0xa8ee5e=0xc8;}else{_0xa8ee5e=0xce;}_0x3e987a[_0xf5cc('0x15')](_0xa8ee5e);return _0x3e987a[_0xf5cc('0x1b')](_0xf5cc('0x1c'),_0x24dbce+'-'+_0x42dec9+'/'+_0x4718dd)['json'](_0x3fc0b2);}return null;};}function patchUpdates(_0x51e545){return function(_0x1b0490){try{jsonpatch['apply'](_0x1b0490,_0x51e545,!![]);}catch(_0x3bf005){return BPromise[_0xf5cc('0x1d')](_0x3bf005);}return _0x1b0490['save']();};}function saveUpdates(_0x11a4a9,_0x5472bb){return function(_0x14389e){if(_0x14389e){return _0x14389e[_0xf5cc('0x1e')](_0x11a4a9)[_0xf5cc('0x1f')](function(_0x153583){return _0x153583;});}return null;};}function removeEntity(_0x45f320,_0x3c945a){return function(_0x4f9842){if(_0x4f9842){return _0x4f9842[_0xf5cc('0x20')]()[_0xf5cc('0x1f')](function(){var _0x5573b5=_0x4f9842['get']({'plain':!![]});var _0x5e2cca=_0xf5cc('0x21');return db[_0xf5cc('0x22')][_0xf5cc('0x20')]({'where':{'type':_0x5e2cca,'resourceId':_0x5573b5['id']}})['then'](function(){return _0x4f9842;});})[_0xf5cc('0x1f')](function(){_0x45f320['status'](0xcc)[_0xf5cc('0x16')]();});}};}function handleEntityNotFound(_0x544e45,_0x1e0055){return function(_0xacc03d){if(!_0xacc03d){_0x544e45[_0xf5cc('0x14')](0x194);}return _0xacc03d;};}function handleError(_0x493d2f,_0x4bafb8){_0x4bafb8=_0x4bafb8||0x1f4;return function(_0x1dc07e){logger[_0xf5cc('0x23')](_0x1dc07e[_0xf5cc('0x24')]);if(_0x1dc07e[_0xf5cc('0x25')]){delete _0x1dc07e[_0xf5cc('0x25')];}_0x493d2f['status'](_0x4bafb8)[_0xf5cc('0x26')](_0x1dc07e);};}exports[_0xf5cc('0x27')]=function(_0x23e835,_0xf364a7){var _0x285bb7={},_0x42844c={},_0xce6322={'count':0x0,'rows':[]};return db[_0xf5cc('0x28')][_0xf5cc('0x29')]()[_0xf5cc('0x1f')](function(_0x546fb8){_0x42844c[_0xf5cc('0x2a')]=_[_0xf5cc('0x2b')](_0x546fb8);_0x42844c[_0xf5cc('0x2c')]=_[_0xf5cc('0x2b')](_0x23e835['query']);_0x42844c['filters']=_['intersection'](_0x42844c[_0xf5cc('0x2a')],_0x42844c[_0xf5cc('0x2c')]);_0x285bb7[_0xf5cc('0x2d')]=_[_0xf5cc('0x2e')](_0x42844c[_0xf5cc('0x2a')],qs[_0xf5cc('0x2f')](_0x23e835[_0xf5cc('0x2c')]['fields']));_0x285bb7[_0xf5cc('0x2d')]=_0x285bb7[_0xf5cc('0x2d')]['length']?_0x285bb7[_0xf5cc('0x2d')]:_0x42844c[_0xf5cc('0x2a')];if(!_0x23e835[_0xf5cc('0x2c')][_0xf5cc('0x30')](_0xf5cc('0x31'))){_0x285bb7[_0xf5cc('0x1a')]=qs[_0xf5cc('0x1a')](_0x23e835['query']['limit']);_0x285bb7['offset']=qs[_0xf5cc('0x18')](_0x23e835[_0xf5cc('0x2c')]['offset']);}_0x285bb7[_0xf5cc('0x32')]=qs[_0xf5cc('0x33')](_0x23e835[_0xf5cc('0x2c')][_0xf5cc('0x33')]);_0x285bb7[_0xf5cc('0x34')]=qs[_0xf5cc('0x35')](_[_0xf5cc('0x36')](_0x23e835[_0xf5cc('0x2c')],_0x42844c[_0xf5cc('0x35')]),_0x546fb8);if(_0x23e835[_0xf5cc('0x2c')]['filter']){_0x285bb7[_0xf5cc('0x34')]=_['merge'](_0x285bb7['where'],{'$or':_[_0xf5cc('0x37')](_0x285bb7['attributes'],function(_0xa7c9df){var _0x36a7a7={};_0x36a7a7[_0xa7c9df]={'$like':'%'+_0x23e835[_0xf5cc('0x2c')]['filter']+'%'};return _0x36a7a7;})});}_0x285bb7=_['merge']({},_0x285bb7,_0x23e835['options']);var _0x3e4535={'where':_0x285bb7[_0xf5cc('0x34')]};return db['CmCompany']['count'](_0x3e4535)[_0xf5cc('0x1f')](function(_0x4d696b){_0xce6322[_0xf5cc('0x38')]=_0x4d696b;if(_0x23e835[_0xf5cc('0x2c')][_0xf5cc('0x39')]){_0x285bb7['include']=[{'all':!![]}];}return db[_0xf5cc('0x28')][_0xf5cc('0x3a')](_0x285bb7);})['then'](function(_0x3a6124){_0xce6322[_0xf5cc('0x3b')]=_0x3a6124;return _0xce6322;})[_0xf5cc('0x1f')](respondWithFilteredResult(_0xf364a7,_0x285bb7))[_0xf5cc('0x3c')](handleError(_0xf364a7,null));})[_0xf5cc('0x3c')](handleError(_0xf364a7,null));};exports[_0xf5cc('0x3d')]=function(_0x3fee02,_0xd8f5c9){var _0x197104={'raw':![],'where':{'id':_0x3fee02['params']['id']}},_0x3051a5={};_0x3051a5[_0xf5cc('0x2a')]=_[_0xf5cc('0x2b')](db[_0xf5cc('0x28')]['rawAttributes']);_0x3051a5['query']=_[_0xf5cc('0x2b')](_0x3fee02['query']);_0x3051a5[_0xf5cc('0x35')]=_[_0xf5cc('0x2e')](_0x3051a5[_0xf5cc('0x2a')],_0x3051a5[_0xf5cc('0x2c')]);_0x197104[_0xf5cc('0x2d')]=_['intersection'](_0x3051a5[_0xf5cc('0x2a')],qs[_0xf5cc('0x2f')](_0x3fee02[_0xf5cc('0x2c')][_0xf5cc('0x2f')]));_0x197104[_0xf5cc('0x2d')]=_0x197104[_0xf5cc('0x2d')][_0xf5cc('0x3e')]?_0x197104[_0xf5cc('0x2d')]:_0x3051a5[_0xf5cc('0x2a')];if(_0x3fee02['query'][_0xf5cc('0x39')]){_0x197104[_0xf5cc('0x3f')]=[{'all':!![]}];}_0x197104=_['merge']({},_0x197104,_0x3fee02[_0xf5cc('0x40')]);return db[_0xf5cc('0x28')][_0xf5cc('0x41')](_0x197104)['then'](handleEntityNotFound(_0xd8f5c9,null))[_0xf5cc('0x1f')](respondWithResult(_0xd8f5c9,null))['catch'](handleError(_0xd8f5c9,null));};exports[_0xf5cc('0x42')]=function(_0x2617e5,_0x321be1){return db[_0xf5cc('0x28')]['create'](_0x2617e5[_0xf5cc('0x43')],{})[_0xf5cc('0x1f')](function(_0x45f0ca){var _0x29a54d=_0x2617e5[_0xf5cc('0x44')][_0xf5cc('0x45')]({'plain':!![]});if(!_0x29a54d)throw new Error(_0xf5cc('0x46'));if(_0x29a54d[_0xf5cc('0x47')]==='user'){var _0x25e4d6=_0x45f0ca['get']({'plain':!![]});var _0x1d3a2a=_0xf5cc('0x21');return db[_0xf5cc('0x48')][_0xf5cc('0x41')]({'where':{'name':_0x1d3a2a,'userProfileId':_0x29a54d['userProfileId']},'raw':!![]})[_0xf5cc('0x1f')](function(_0xb58618){if(_0xb58618&&_0xb58618[_0xf5cc('0x49')]===0x0){return db[_0xf5cc('0x22')][_0xf5cc('0x42')]({'name':_0x25e4d6['name'],'resourceId':_0x25e4d6['id'],'type':_0xb58618[_0xf5cc('0x25')],'sectionId':_0xb58618['id']},{})[_0xf5cc('0x1f')](function(){return _0x45f0ca;});}else{return _0x45f0ca;}})[_0xf5cc('0x3c')](function(_0x1cfe14){logger[_0xf5cc('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cfe14);throw _0x1cfe14;});}return _0x45f0ca;})['then'](respondWithResult(_0x321be1,0xc9))[_0xf5cc('0x3c')](handleError(_0x321be1,null));};exports[_0xf5cc('0x1e')]=function(_0x5a0b4b,_0x3f64bd){if(_0x5a0b4b['body']['id']){delete _0x5a0b4b[_0xf5cc('0x43')]['id'];}return db[_0xf5cc('0x28')][_0xf5cc('0x41')]({'where':{'id':_0x5a0b4b[_0xf5cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f64bd,null))['then'](saveUpdates(_0x5a0b4b['body'],null))[_0xf5cc('0x1f')](respondWithResult(_0x3f64bd,null))[_0xf5cc('0x3c')](handleError(_0x3f64bd,null));};exports[_0xf5cc('0x20')]=function(_0x5b11a2,_0x551fda){return db[_0xf5cc('0x28')]['find']({'where':{'id':_0x5b11a2[_0xf5cc('0x4a')]['id']}})[_0xf5cc('0x1f')](handleEntityNotFound(_0x551fda,null))[_0xf5cc('0x1f')](removeEntity(_0x551fda,null))[_0xf5cc('0x3c')](handleError(_0x551fda,null));};exports[_0xf5cc('0x29')]=function(_0x27af04,_0x2cf3b3){return db[_0xf5cc('0x28')][_0xf5cc('0x29')]()[_0xf5cc('0x1f')](respondWithResult(_0x2cf3b3,null))[_0xf5cc('0x3c')](handleError(_0x2cf3b3,null));};exports['addContacts']=function(_0x8fdd8b,_0x18efe3,_0x18fe27){return db[_0xf5cc('0x4b')][_0xf5cc('0x41')]({'where':{'id':_0x8fdd8b[_0xf5cc('0x4a')]['id']}})[_0xf5cc('0x1f')](handleEntityNotFound(_0x18efe3,null))[_0xf5cc('0x1f')](function(_0x3ea5b6){if(_0x3ea5b6){return _0x3ea5b6[_0xf5cc('0x4c')](_0x8fdd8b[_0xf5cc('0x43')][_0xf5cc('0x4d')],_[_0xf5cc('0x4e')](_0x8fdd8b[_0xf5cc('0x43')],['ids','id'])||{});}})[_0xf5cc('0x1f')](respondWithResult(_0x18efe3,null))[_0xf5cc('0x3c')](handleError(_0x18efe3,null));};exports[_0xf5cc('0x4f')]=function(_0x24055b,_0x1c3418,_0xe31147){var _0x4110f7={};var _0x2d4752={};var _0x23ff30;var _0x3cc38b;return db['CmCompany'][_0xf5cc('0x50')]({'where':{'id':_0x24055b['params']['id']}})[_0xf5cc('0x1f')](handleEntityNotFound(_0x1c3418,null))[_0xf5cc('0x1f')](function(_0x1aac0e){if(_0x1aac0e){_0x23ff30=_0x1aac0e;_0x2d4752[_0xf5cc('0x2a')]=_[_0xf5cc('0x2b')](db['CmContact']['rawAttributes']);_0x2d4752['query']=_['keys'](_0x24055b[_0xf5cc('0x2c')]);_0x2d4752['filters']=_[_0xf5cc('0x2e')](_0x2d4752[_0xf5cc('0x2a')],_0x2d4752[_0xf5cc('0x2c')]);_0x4110f7[_0xf5cc('0x2d')]=_[_0xf5cc('0x2e')](_0x2d4752[_0xf5cc('0x2a')],qs[_0xf5cc('0x2f')](_0x24055b[_0xf5cc('0x2c')][_0xf5cc('0x2f')]));_0x4110f7[_0xf5cc('0x2d')]=_0x4110f7[_0xf5cc('0x2d')]['length']?_0x4110f7[_0xf5cc('0x2d')]:_0x2d4752[_0xf5cc('0x2a')];_0x4110f7[_0xf5cc('0x32')]=qs[_0xf5cc('0x33')](_0x24055b[_0xf5cc('0x2c')]['sort']);_0x4110f7[_0xf5cc('0x34')]=qs[_0xf5cc('0x35')](_[_0xf5cc('0x36')](_0x24055b[_0xf5cc('0x2c')],_0x2d4752[_0xf5cc('0x35')]));if(_0x24055b['query']['filter']){_0x4110f7[_0xf5cc('0x34')]=_['merge'](_0x4110f7[_0xf5cc('0x34')],{'$or':_[_0xf5cc('0x37')](_0x4110f7[_0xf5cc('0x2d')],function(_0x791cd0){var _0x22ebc1={};_0x22ebc1[_0x791cd0]={'$like':'%'+_0x24055b['query'][_0xf5cc('0x51')]+'%'};return _0x22ebc1;})});}_0x4110f7=_[_0xf5cc('0x52')]({},_0x4110f7,_0x24055b['options']);return _0x23ff30['getContacts'](_0x4110f7);}})[_0xf5cc('0x1f')](function(_0x5d9f6f){if(_0x5d9f6f){_0x3cc38b=_0x5d9f6f[_0xf5cc('0x3e')];if(!_0x24055b[_0xf5cc('0x2c')][_0xf5cc('0x30')]('nolimit')){_0x4110f7[_0xf5cc('0x1a')]=qs[_0xf5cc('0x1a')](_0x24055b['query'][_0xf5cc('0x1a')]);_0x4110f7[_0xf5cc('0x18')]=qs['offset'](_0x24055b[_0xf5cc('0x2c')][_0xf5cc('0x18')]);}return _0x23ff30[_0xf5cc('0x4f')](_0x4110f7);}})[_0xf5cc('0x1f')](function(_0x47e4da){if(_0x47e4da){return _0x47e4da?{'count':_0x3cc38b,'rows':_0x47e4da}:null;}})[_0xf5cc('0x1f')](respondWithResult(_0x1c3418,null))[_0xf5cc('0x3c')](handleError(_0x1c3418,null));}; \ No newline at end of file +var _0xc057=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','rawAttributes','length','find','create','user','userProfileId','autoAssociation','body','params','addContacts','CmContact','ids','omit','getContacts','findOne','order','filter','map','nolimit','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x393cc0,_0x39eccf){var _0xab92aa=function(_0x1732d9){while(--_0x1732d9){_0x393cc0['push'](_0x393cc0['shift']());}};_0xab92aa(++_0x39eccf);}(_0xc057,0x154));var _0x7c05=function(_0x182721,_0x47f1b5){_0x182721=_0x182721-0x0;var _0x1cfb11=_0xc057[_0x182721];return _0x1cfb11;};'use strict';var emlformat=require(_0x7c05('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c05('0x1'));var rp=require(_0x7c05('0x2'));var moment=require(_0x7c05('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7c05('0x4'));var util=require(_0x7c05('0x5'));var path=require(_0x7c05('0x6'));var sox=require(_0x7c05('0x7'));var csv=require(_0x7c05('0x8'));var ejs=require(_0x7c05('0x9'));var fs=require('fs');var fs_extra=require(_0x7c05('0xa'));var _=require(_0x7c05('0xb'));var squel=require(_0x7c05('0xc'));var crypto=require(_0x7c05('0xd'));var jsforce=require(_0x7c05('0xe'));var deskjs=require(_0x7c05('0xf'));var toCsv=require(_0x7c05('0x8'));var querystring=require(_0x7c05('0x10'));var Papa=require(_0x7c05('0x11'));var Redis=require('ioredis');var authService=require(_0x7c05('0x12'));var qs=require(_0x7c05('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c05('0x14'));var utils=require(_0x7c05('0x15'));var config=require(_0x7c05('0x16'));var licenseUtil=require(_0x7c05('0x17'));var db=require(_0x7c05('0x18'))['db'];function respondWithStatusCode(_0x34b2ef,_0x7fccd3){_0x7fccd3=_0x7fccd3||0xcc;return function(_0x411f47){if(_0x411f47){return _0x34b2ef[_0x7c05('0x19')](_0x7fccd3);}return _0x34b2ef[_0x7c05('0x1a')](_0x7fccd3)[_0x7c05('0x1b')]();};}function respondWithResult(_0x6de6ec,_0x29ca95){_0x29ca95=_0x29ca95||0xc8;return function(_0x35223d){if(_0x35223d){return _0x6de6ec[_0x7c05('0x1a')](_0x29ca95)[_0x7c05('0x1c')](_0x35223d);}};}function respondWithFilteredResult(_0x28b38e,_0x3fb215){return function(_0xde44fe){if(_0xde44fe){var _0x1272a5=typeof _0x3fb215['offset']===_0x7c05('0x1d')&&typeof _0x3fb215[_0x7c05('0x1e')]===_0x7c05('0x1d');var _0x4d485c=_0xde44fe[_0x7c05('0x1f')];var _0x2d7e68=_0x1272a5?0x0:_0x3fb215[_0x7c05('0x20')];var _0x3dac05=_0x1272a5?_0xde44fe[_0x7c05('0x1f')]:_0x3fb215[_0x7c05('0x20')]+_0x3fb215['limit'];var _0x29b63c;if(_0x3dac05>=_0x4d485c){_0x3dac05=_0x4d485c;_0x29b63c=0xc8;}else{_0x29b63c=0xce;}_0x28b38e[_0x7c05('0x1a')](_0x29b63c);return _0x28b38e[_0x7c05('0x21')](_0x7c05('0x22'),_0x2d7e68+'-'+_0x3dac05+'/'+_0x4d485c)[_0x7c05('0x1c')](_0xde44fe);}return null;};}function patchUpdates(_0x13d4b9){return function(_0x3ae962){try{jsonpatch[_0x7c05('0x23')](_0x3ae962,_0x13d4b9,!![]);}catch(_0x5bd34f){return BPromise['reject'](_0x5bd34f);}return _0x3ae962[_0x7c05('0x24')]();};}function saveUpdates(_0x1fc154,_0x4a2105){return function(_0x11f01a){if(_0x11f01a){return _0x11f01a[_0x7c05('0x25')](_0x1fc154)['then'](function(_0x218a64){return _0x218a64;});}return null;};}function removeEntity(_0x401932,_0x1694b8){return function(_0x2b8663){if(_0x2b8663){return _0x2b8663[_0x7c05('0x26')]()[_0x7c05('0x27')](function(){var _0xd06974=_0x2b8663[_0x7c05('0x28')]({'plain':!![]});var _0x4ea048=_0x7c05('0x29');return db[_0x7c05('0x2a')][_0x7c05('0x26')]({'where':{'type':_0x4ea048,'resourceId':_0xd06974['id']}})[_0x7c05('0x27')](function(){return _0x2b8663;});})[_0x7c05('0x27')](function(){_0x401932[_0x7c05('0x1a')](0xcc)[_0x7c05('0x1b')]();});}};}function handleEntityNotFound(_0x3d81e6,_0x597c35){return function(_0x2b663e){if(!_0x2b663e){_0x3d81e6[_0x7c05('0x19')](0x194);}return _0x2b663e;};}function handleError(_0x592cb9,_0x42cf66){_0x42cf66=_0x42cf66||0x1f4;return function(_0x276036){logger[_0x7c05('0x2b')](_0x276036[_0x7c05('0x2c')]);if(_0x276036[_0x7c05('0x2d')]){delete _0x276036[_0x7c05('0x2d')];}_0x592cb9[_0x7c05('0x1a')](_0x42cf66)[_0x7c05('0x2e')](_0x276036);};}exports[_0x7c05('0x2f')]=function(_0x1ffbb3,_0xf80010){var _0x1877c4={},_0x5b12a6={},_0x207435={'count':0x0,'rows':[]};return db[_0x7c05('0x30')][_0x7c05('0x31')]()[_0x7c05('0x27')](function(_0x33ff5c){_0x5b12a6[_0x7c05('0x32')]=_[_0x7c05('0x33')](_0x33ff5c);_0x5b12a6[_0x7c05('0x34')]=_[_0x7c05('0x33')](_0x1ffbb3[_0x7c05('0x34')]);_0x5b12a6[_0x7c05('0x35')]=_[_0x7c05('0x36')](_0x5b12a6['model'],_0x5b12a6[_0x7c05('0x34')]);_0x1877c4[_0x7c05('0x37')]=_[_0x7c05('0x36')](_0x5b12a6['model'],qs['fields'](_0x1ffbb3[_0x7c05('0x34')][_0x7c05('0x38')]));_0x1877c4[_0x7c05('0x37')]=_0x1877c4[_0x7c05('0x37')]['length']?_0x1877c4['attributes']:_0x5b12a6[_0x7c05('0x32')];if(!_0x1ffbb3['query'][_0x7c05('0x39')]('nolimit')){_0x1877c4[_0x7c05('0x1e')]=qs[_0x7c05('0x1e')](_0x1ffbb3[_0x7c05('0x34')]['limit']);_0x1877c4[_0x7c05('0x20')]=qs[_0x7c05('0x20')](_0x1ffbb3[_0x7c05('0x34')]['offset']);}_0x1877c4['order']=qs[_0x7c05('0x3a')](_0x1ffbb3[_0x7c05('0x34')][_0x7c05('0x3a')]);_0x1877c4[_0x7c05('0x3b')]=qs[_0x7c05('0x35')](_[_0x7c05('0x3c')](_0x1ffbb3[_0x7c05('0x34')],_0x5b12a6[_0x7c05('0x35')]),_0x33ff5c);if(_0x1ffbb3[_0x7c05('0x34')]['filter']){_0x1877c4[_0x7c05('0x3b')]=_[_0x7c05('0x3d')](_0x1877c4[_0x7c05('0x3b')],{'$or':_['map'](_0x1877c4[_0x7c05('0x37')],function(_0x59d0d0){var _0x269e33={};_0x269e33[_0x59d0d0]={'$like':'%'+_0x1ffbb3[_0x7c05('0x34')]['filter']+'%'};return _0x269e33;})});}_0x1877c4=_[_0x7c05('0x3d')]({},_0x1877c4,_0x1ffbb3[_0x7c05('0x3e')]);var _0x5d6a54={'where':_0x1877c4['where']};return db[_0x7c05('0x30')][_0x7c05('0x1f')](_0x5d6a54)[_0x7c05('0x27')](function(_0x280a02){_0x207435[_0x7c05('0x1f')]=_0x280a02;if(_0x1ffbb3[_0x7c05('0x34')][_0x7c05('0x3f')]){_0x1877c4[_0x7c05('0x40')]=[{'all':!![]}];}return db[_0x7c05('0x30')][_0x7c05('0x41')](_0x1877c4);})[_0x7c05('0x27')](function(_0x51240d){_0x207435[_0x7c05('0x42')]=_0x51240d;return _0x207435;})[_0x7c05('0x27')](respondWithFilteredResult(_0xf80010,_0x1877c4))[_0x7c05('0x43')](handleError(_0xf80010,null));})[_0x7c05('0x43')](handleError(_0xf80010,null));};exports['show']=function(_0x6c5c45,_0x55e62c){var _0x1d2654={'raw':![],'where':{'id':_0x6c5c45['params']['id']}},_0x30d80f={};_0x30d80f[_0x7c05('0x32')]=_['keys'](db[_0x7c05('0x30')][_0x7c05('0x44')]);_0x30d80f[_0x7c05('0x34')]=_[_0x7c05('0x33')](_0x6c5c45['query']);_0x30d80f['filters']=_[_0x7c05('0x36')](_0x30d80f[_0x7c05('0x32')],_0x30d80f['query']);_0x1d2654[_0x7c05('0x37')]=_[_0x7c05('0x36')](_0x30d80f[_0x7c05('0x32')],qs[_0x7c05('0x38')](_0x6c5c45[_0x7c05('0x34')][_0x7c05('0x38')]));_0x1d2654['attributes']=_0x1d2654[_0x7c05('0x37')][_0x7c05('0x45')]?_0x1d2654['attributes']:_0x30d80f['model'];if(_0x6c5c45['query'][_0x7c05('0x3f')]){_0x1d2654[_0x7c05('0x40')]=[{'all':!![]}];}_0x1d2654=_[_0x7c05('0x3d')]({},_0x1d2654,_0x6c5c45[_0x7c05('0x3e')]);return db[_0x7c05('0x30')][_0x7c05('0x46')](_0x1d2654)['then'](handleEntityNotFound(_0x55e62c,null))[_0x7c05('0x27')](respondWithResult(_0x55e62c,null))[_0x7c05('0x43')](handleError(_0x55e62c,null));};exports[_0x7c05('0x47')]=function(_0x399121,_0x2350c8){return db['CmCompany']['create'](_0x399121['body'],{})[_0x7c05('0x27')](function(_0x9fc5a0){var _0x43d04d=_0x399121[_0x7c05('0x48')][_0x7c05('0x28')]({'plain':!![]});if(!_0x43d04d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x43d04d['role']==='user'){var _0x194737=_0x9fc5a0[_0x7c05('0x28')]({'plain':!![]});var _0x389673=_0x7c05('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x389673,'userProfileId':_0x43d04d[_0x7c05('0x49')]},'raw':!![]})[_0x7c05('0x27')](function(_0x18db84){if(_0x18db84&&_0x18db84[_0x7c05('0x4a')]===0x0){return db[_0x7c05('0x2a')]['create']({'name':_0x194737[_0x7c05('0x2d')],'resourceId':_0x194737['id'],'type':_0x18db84['name'],'sectionId':_0x18db84['id']},{})[_0x7c05('0x27')](function(){return _0x9fc5a0;});}else{return _0x9fc5a0;}})[_0x7c05('0x43')](function(_0x516383){logger[_0x7c05('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x516383);throw _0x516383;});}return _0x9fc5a0;})[_0x7c05('0x27')](respondWithResult(_0x2350c8,0xc9))['catch'](handleError(_0x2350c8,null));};exports[_0x7c05('0x25')]=function(_0x507241,_0x43bf4e){if(_0x507241[_0x7c05('0x4b')]['id']){delete _0x507241['body']['id'];}return db[_0x7c05('0x30')][_0x7c05('0x46')]({'where':{'id':_0x507241['params']['id']}})[_0x7c05('0x27')](handleEntityNotFound(_0x43bf4e,null))[_0x7c05('0x27')](saveUpdates(_0x507241['body'],null))[_0x7c05('0x27')](respondWithResult(_0x43bf4e,null))[_0x7c05('0x43')](handleError(_0x43bf4e,null));};exports[_0x7c05('0x26')]=function(_0xca0832,_0x4dd749){return db['CmCompany'][_0x7c05('0x46')]({'where':{'id':_0xca0832[_0x7c05('0x4c')]['id']}})[_0x7c05('0x27')](handleEntityNotFound(_0x4dd749,null))[_0x7c05('0x27')](removeEntity(_0x4dd749,null))[_0x7c05('0x43')](handleError(_0x4dd749,null));};exports[_0x7c05('0x31')]=function(_0x13bee8,_0x54e503){return db[_0x7c05('0x30')]['describe']()[_0x7c05('0x27')](respondWithResult(_0x54e503,null))[_0x7c05('0x43')](handleError(_0x54e503,null));};exports[_0x7c05('0x4d')]=function(_0x5c68cc,_0x12b221,_0x2c4287){return db[_0x7c05('0x4e')][_0x7c05('0x46')]({'where':{'id':_0x5c68cc[_0x7c05('0x4c')]['id']}})[_0x7c05('0x27')](handleEntityNotFound(_0x12b221,null))['then'](function(_0x56c84b){if(_0x56c84b){return _0x56c84b['addContacts'](_0x5c68cc[_0x7c05('0x4b')][_0x7c05('0x4f')],_[_0x7c05('0x50')](_0x5c68cc[_0x7c05('0x4b')],[_0x7c05('0x4f'),'id'])||{});}})[_0x7c05('0x27')](respondWithResult(_0x12b221,null))['catch'](handleError(_0x12b221,null));};exports[_0x7c05('0x51')]=function(_0x5bd3fe,_0x48fa42,_0x3487fb){var _0x19af4b={};var _0x18dd3c={};var _0x23dd2d;var _0x391c30;return db['CmCompany'][_0x7c05('0x52')]({'where':{'id':_0x5bd3fe[_0x7c05('0x4c')]['id']}})[_0x7c05('0x27')](handleEntityNotFound(_0x48fa42,null))[_0x7c05('0x27')](function(_0x173cdd){if(_0x173cdd){_0x23dd2d=_0x173cdd;_0x18dd3c[_0x7c05('0x32')]=_[_0x7c05('0x33')](db['CmContact'][_0x7c05('0x44')]);_0x18dd3c[_0x7c05('0x34')]=_[_0x7c05('0x33')](_0x5bd3fe[_0x7c05('0x34')]);_0x18dd3c[_0x7c05('0x35')]=_['intersection'](_0x18dd3c[_0x7c05('0x32')],_0x18dd3c['query']);_0x19af4b[_0x7c05('0x37')]=_[_0x7c05('0x36')](_0x18dd3c['model'],qs['fields'](_0x5bd3fe[_0x7c05('0x34')]['fields']));_0x19af4b['attributes']=_0x19af4b[_0x7c05('0x37')]['length']?_0x19af4b[_0x7c05('0x37')]:_0x18dd3c[_0x7c05('0x32')];_0x19af4b[_0x7c05('0x53')]=qs[_0x7c05('0x3a')](_0x5bd3fe[_0x7c05('0x34')]['sort']);_0x19af4b[_0x7c05('0x3b')]=qs['filters'](_[_0x7c05('0x3c')](_0x5bd3fe[_0x7c05('0x34')],_0x18dd3c[_0x7c05('0x35')]));if(_0x5bd3fe[_0x7c05('0x34')][_0x7c05('0x54')]){_0x19af4b[_0x7c05('0x3b')]=_[_0x7c05('0x3d')](_0x19af4b[_0x7c05('0x3b')],{'$or':_[_0x7c05('0x55')](_0x19af4b['attributes'],function(_0x3d5320){var _0x4783db={};_0x4783db[_0x3d5320]={'$like':'%'+_0x5bd3fe['query'][_0x7c05('0x54')]+'%'};return _0x4783db;})});}_0x19af4b=_[_0x7c05('0x3d')]({},_0x19af4b,_0x5bd3fe[_0x7c05('0x3e')]);return _0x23dd2d['getContacts'](_0x19af4b);}})[_0x7c05('0x27')](function(_0x4d4bac){if(_0x4d4bac){_0x391c30=_0x4d4bac[_0x7c05('0x45')];if(!_0x5bd3fe[_0x7c05('0x34')][_0x7c05('0x39')](_0x7c05('0x56'))){_0x19af4b[_0x7c05('0x1e')]=qs[_0x7c05('0x1e')](_0x5bd3fe['query'][_0x7c05('0x1e')]);_0x19af4b[_0x7c05('0x20')]=qs[_0x7c05('0x20')](_0x5bd3fe[_0x7c05('0x34')]['offset']);}return _0x23dd2d[_0x7c05('0x51')](_0x19af4b);}})[_0x7c05('0x27')](function(_0xa8fc1e){if(_0xa8fc1e){return _0xa8fc1e?{'count':_0x391c30,'rows':_0xa8fc1e}:null;}})[_0x7c05('0x27')](respondWithResult(_0x48fa42,null))['catch'](handleError(_0x48fa42,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index a72140f..acb8b2b 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 _0x3cc6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api'];(function(_0x5d9a85,_0x55221e){var _0x1ef8aa=function(_0x5241be){while(--_0x5241be){_0x5d9a85['push'](_0x5d9a85['shift']());}};_0x1ef8aa(++_0x55221e);}(_0x3cc6,0x1eb));var _0x63cc=function(_0x3ce78d,_0xdde277){_0x3ce78d=_0x3ce78d-0x0;var _0x246a4c=_0x3cc6[_0x3ce78d];return _0x246a4c;};'use strict';var _=require(_0x63cc('0x0'));var util=require(_0x63cc('0x1'));var logger=require(_0x63cc('0x2'))(_0x63cc('0x3'));var moment=require(_0x63cc('0x4'));var BPromise=require(_0x63cc('0x5'));var rp=require(_0x63cc('0x6'));var fs=require('fs');var path=require(_0x63cc('0x7'));var rimraf=require(_0x63cc('0x8'));var config=require(_0x63cc('0x9'));var attributes=require(_0x63cc('0xa'));module[_0x63cc('0xb')]=function(_0x15061f,_0x3e55a5){return _0x15061f[_0x63cc('0xc')](_0x63cc('0xd'),attributes,{'tableName':_0x63cc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12c=['cm_companies','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmCompany'];(function(_0x3499c1,_0x537974){var _0x40b103=function(_0x4bb246){while(--_0x4bb246){_0x3499c1['push'](_0x3499c1['shift']());}};_0x40b103(++_0x537974);}(_0xa12c,0x1b9));var _0xca12=function(_0x148202,_0x132b6a){_0x148202=_0x148202-0x0;var _0x1b15ad=_0xa12c[_0x148202];return _0x1b15ad;};'use strict';var _=require('lodash');var util=require(_0xca12('0x0'));var logger=require('../../config/logger')(_0xca12('0x1'));var moment=require(_0xca12('0x2'));var BPromise=require(_0xca12('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca12('0x4'));var rimraf=require(_0xca12('0x5'));var config=require(_0xca12('0x6'));var attributes=require('./cmCompany.attributes');module[_0xca12('0x7')]=function(_0x455d22,_0x294f7e){return _0x455d22[_0xca12('0x8')](_0xca12('0x9'),attributes,{'tableName':_0xca12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 87dc7a0..2f1ca46 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 _0x62bb=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x123784,_0x365f4a){var _0x56aafa=function(_0x38774f){while(--_0x38774f){_0x123784['push'](_0x123784['shift']());}};_0x56aafa(++_0x365f4a);}(_0x62bb,0x16b));var _0xb62b=function(_0x3b7053,_0x1a0acb){_0x3b7053=_0x3b7053-0x0;var _0x46663e=_0x62bb[_0x3b7053];return _0x46663e;};'use strict';var _=require('lodash');var util=require(_0xb62b('0x0'));var moment=require(_0xb62b('0x1'));var BPromise=require(_0xb62b('0x2'));var rs=require(_0xb62b('0x3'));var fs=require('fs');var Redis=require(_0xb62b('0x4'));var db=require(_0xb62b('0x5'))['db'];var utils=require(_0xb62b('0x6'));var logger=require(_0xb62b('0x7'))('rpc');var config=require(_0xb62b('0x8'));var jayson=require(_0xb62b('0x9'));var client=jayson[_0xb62b('0xa')][_0xb62b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x158589,_0x3d8c27,_0xebd69d){return new BPromise(function(_0x486f56,_0x3ac174){return client[_0xb62b('0xc')](_0x158589,_0xebd69d)['then'](function(_0x4d0d92){logger[_0xb62b('0xd')](_0xb62b('0xe'),_0x3d8c27,'request\x20sent');logger[_0xb62b('0xf')](_0xb62b('0x10'),_0x3d8c27,'request\x20sent',JSON[_0xb62b('0x11')](_0x4d0d92));if(_0x4d0d92[_0xb62b('0x12')]){if(_0x4d0d92[_0xb62b('0x12')][_0xb62b('0x13')]===0x1f4){logger[_0xb62b('0x12')](_0xb62b('0xe'),_0x3d8c27,_0x4d0d92['error'][_0xb62b('0x14')]);return _0x3ac174(_0x4d0d92[_0xb62b('0x12')][_0xb62b('0x14')]);}logger[_0xb62b('0x12')](_0xb62b('0xe'),_0x3d8c27,_0x4d0d92[_0xb62b('0x12')][_0xb62b('0x14')]);return _0x486f56(_0x4d0d92[_0xb62b('0x12')][_0xb62b('0x14')]);}else{logger[_0xb62b('0xd')](_0xb62b('0xe'),_0x3d8c27,'request\x20sent');_0x486f56(_0x4d0d92[_0xb62b('0x15')][_0xb62b('0x14')]);}})[_0xb62b('0x16')](function(_0x237084){logger[_0xb62b('0x12')](_0xb62b('0xe'),_0x3d8c27,_0x237084);_0x3ac174(_0x237084);});});} \ No newline at end of file +var _0x5e98=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','CmCompany,\x20%s,\x20%s','message','util','moment','bluebird'];(function(_0x1ac8bf,_0x544474){var _0x3b5f76=function(_0x4ff26f){while(--_0x4ff26f){_0x1ac8bf['push'](_0x1ac8bf['shift']());}};_0x3b5f76(++_0x544474);}(_0x5e98,0x7b));var _0x85e9=function(_0x544504,_0x510c20){_0x544504=_0x544504-0x0;var _0x163989=_0x5e98[_0x544504];return _0x163989;};'use strict';var _=require('lodash');var util=require(_0x85e9('0x0'));var moment=require(_0x85e9('0x1'));var BPromise=require(_0x85e9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85e9('0x3'));var db=require(_0x85e9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x85e9('0x5'))(_0x85e9('0x6'));var config=require(_0x85e9('0x7'));var jayson=require(_0x85e9('0x8'));var client=jayson[_0x85e9('0x9')][_0x85e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c88,_0x549a95,_0x49c46b){return new BPromise(function(_0x36a946,_0x43c5d4){return client[_0x85e9('0xb')](_0x4a2c88,_0x49c46b)[_0x85e9('0xc')](function(_0x508a77){logger[_0x85e9('0xd')]('CmCompany,\x20%s,\x20%s',_0x549a95,'request\x20sent');logger[_0x85e9('0xe')](_0x85e9('0xf'),_0x549a95,_0x85e9('0x10'),JSON[_0x85e9('0x11')](_0x508a77));if(_0x508a77['error']){if(_0x508a77[_0x85e9('0x12')]['code']===0x1f4){logger['error'](_0x85e9('0x13'),_0x549a95,_0x508a77[_0x85e9('0x12')]['message']);return _0x43c5d4(_0x508a77[_0x85e9('0x12')][_0x85e9('0x14')]);}logger[_0x85e9('0x12')]('CmCompany,\x20%s,\x20%s',_0x549a95,_0x508a77[_0x85e9('0x12')][_0x85e9('0x14')]);return _0x36a946(_0x508a77[_0x85e9('0x12')][_0x85e9('0x14')]);}else{logger[_0x85e9('0xd')](_0x85e9('0x13'),_0x549a95,_0x85e9('0x10'));_0x36a946(_0x508a77['result'][_0x85e9('0x14')]);}})['catch'](function(_0x550778){logger[_0x85e9('0x12')](_0x85e9('0x13'),_0x549a95,_0x550778);_0x43c5d4(_0x550778);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index cc1c271..98c5545 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 _0xfab4=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','getContacts','post','/:id/contacts','addContacts','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x19561b,_0x2dccef){var _0x135586=function(_0x3ae2b5){while(--_0x3ae2b5){_0x19561b['push'](_0x19561b['shift']());}};_0x135586(++_0x2dccef);}(_0xfab4,0x15b));var _0x4fab=function(_0x4b792b,_0x57289f){_0x4b792b=_0x4b792b-0x0;var _0x5a33c1=_0xfab4[_0x4b792b];return _0x5a33c1;};'use strict';var multer=require('multer');var util=require(_0x4fab('0x0'));var path=require(_0x4fab('0x1'));var timeout=require(_0x4fab('0x2'));var express=require(_0x4fab('0x3'));var router=express[_0x4fab('0x4')]();var fs_extra=require(_0x4fab('0x5'));var auth=require(_0x4fab('0x6'));var interaction=require(_0x4fab('0x7'));var config=require(_0x4fab('0x8'));var controller=require(_0x4fab('0x9'));router[_0x4fab('0xa')]('/',auth[_0x4fab('0xb')](),controller[_0x4fab('0xc')]);router[_0x4fab('0xa')](_0x4fab('0xd'),auth[_0x4fab('0xb')](),controller[_0x4fab('0xe')]);router[_0x4fab('0xa')](_0x4fab('0xf'),auth[_0x4fab('0xb')](),controller['show']);router[_0x4fab('0xa')]('/:id/contacts',auth[_0x4fab('0xb')](),controller[_0x4fab('0x10')]);router['post']('/',auth[_0x4fab('0xb')](),controller['create']);router[_0x4fab('0x11')](_0x4fab('0x12'),auth[_0x4fab('0xb')](),controller[_0x4fab('0x13')]);router[_0x4fab('0x14')](_0x4fab('0xf'),auth[_0x4fab('0xb')](),controller[_0x4fab('0x15')]);router[_0x4fab('0x16')]('/:id',auth[_0x4fab('0xb')](),controller[_0x4fab('0x17')]);module[_0x4fab('0x18')]=router; \ No newline at end of file +var _0xaff5=['get','describe','isAuthenticated','show','/:id/contacts','getContacts','addContacts','update','delete','/:id','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xaff5,0xe8));var _0x5aff=function(_0x147e08,_0x53638e){_0x147e08=_0x147e08-0x0;var _0x51b355=_0xaff5[_0x147e08];return _0x51b355;};'use strict';var multer=require(_0x5aff('0x0'));var util=require(_0x5aff('0x1'));var path=require(_0x5aff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5aff('0x3')]();var fs_extra=require(_0x5aff('0x4'));var auth=require(_0x5aff('0x5'));var interaction=require(_0x5aff('0x6'));var config=require(_0x5aff('0x7'));var controller=require('./cmCompany.controller');router[_0x5aff('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5aff('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x5aff('0x9')]);router[_0x5aff('0x8')]('/:id',auth[_0x5aff('0xa')](),controller[_0x5aff('0xb')]);router['get'](_0x5aff('0xc'),auth['isAuthenticated'](),controller[_0x5aff('0xd')]);router['post']('/',auth[_0x5aff('0xa')](),controller['create']);router['post'](_0x5aff('0xc'),auth['isAuthenticated'](),controller[_0x5aff('0xe')]);router['put']('/:id',auth[_0x5aff('0xa')](),controller[_0x5aff('0xf')]);router[_0x5aff('0x10')](_0x5aff('0x11'),auth[_0x5aff('0xa')](),controller[_0x5aff('0x12')]);module[_0x5aff('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 896d5c6..09ec901 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 _0x7311=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize'];(function(_0x25e806,_0x4d1276){var _0x169b66=function(_0x37984a){while(--_0x37984a){_0x25e806['push'](_0x25e806['shift']());}};_0x169b66(++_0x4d1276);}(_0x7311,0xc9));var _0x1731=function(_0x95fa9d,_0x1e3ed6){_0x95fa9d=_0x95fa9d-0x0;var _0x3140a2=_0x7311[_0x95fa9d];return _0x3140a2;};'use strict';var _=require(_0x1731('0x0'));var Sequelize=require(_0x1731('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x1731('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1731('0x2')]},'street':{'type':Sequelize[_0x1731('0x2')]},'postalCode':{'type':Sequelize[_0x1731('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x1731('0x2')]},'dateOfBirth':{'type':Sequelize[_0x1731('0x2')]},'description':{'type':Sequelize[_0x1731('0x3')]},'phone':{'type':Sequelize[_0x1731('0x2')]},'mobile':{'type':Sequelize[_0x1731('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1731('0x2')]},'url':{'type':Sequelize[_0x1731('0x2')]},'facebook':{'type':Sequelize[_0x1731('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x1731('0x2')]},'viber':{'type':Sequelize[_0x1731('0x2')]},'line':{'type':Sequelize[_0x1731('0x2')]},'wechat':{'type':Sequelize[_0x1731('0x2')]},'telegram':{'type':Sequelize[_0x1731('0x2')]},'UserId':{'type':Sequelize[_0x1731('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x1731('0x2')]},'priority':{'type':Sequelize[_0x1731('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1731('0x5')],'defaultValue':Sequelize[_0x1731('0x6')]},'dialTimezone':{'type':Sequelize[_0x1731('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xfd75=['TEXT','INTEGER','NOW','lodash','sequelize','exports','STRING'];(function(_0x2247ab,_0x3f4162){var _0x430062=function(_0x591dd7){while(--_0x591dd7){_0x2247ab['push'](_0x2247ab['shift']());}};_0x430062(++_0x3f4162);}(_0xfd75,0x16f));var _0x5fd7=function(_0x54a57e,_0x3a8ff9){_0x54a57e=_0x54a57e-0x0;var _0x56dc7f=_0xfd75[_0x54a57e];return _0x56dc7f;};'use strict';var _=require(_0x5fd7('0x0'));var Sequelize=require(_0x5fd7('0x1'));module[_0x5fd7('0x2')]={'firstName':{'type':Sequelize[_0x5fd7('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x5fd7('0x3')]},'street':{'type':Sequelize[_0x5fd7('0x3')]},'postalCode':{'type':Sequelize[_0x5fd7('0x3')]},'city':{'type':Sequelize[_0x5fd7('0x3')]},'country':{'type':Sequelize[_0x5fd7('0x3')]},'dateOfBirth':{'type':Sequelize[_0x5fd7('0x3')]},'description':{'type':Sequelize[_0x5fd7('0x4')]},'phone':{'type':Sequelize[_0x5fd7('0x3')]},'mobile':{'type':Sequelize[_0x5fd7('0x3')]},'fax':{'type':Sequelize[_0x5fd7('0x3')]},'email':{'type':Sequelize[_0x5fd7('0x3')]},'url':{'type':Sequelize[_0x5fd7('0x3')]},'facebook':{'type':Sequelize[_0x5fd7('0x3')]},'fb_data':{'type':Sequelize[_0x5fd7('0x3')]},'twitter':{'type':Sequelize[_0x5fd7('0x3')]},'skype':{'type':Sequelize[_0x5fd7('0x3')]},'teams':{'type':Sequelize[_0x5fd7('0x3')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x5fd7('0x3')]},'wechat':{'type':Sequelize[_0x5fd7('0x3')]},'telegram':{'type':Sequelize[_0x5fd7('0x3')]},'UserId':{'type':Sequelize[_0x5fd7('0x5')]},'AdditionalPhones':{'type':Sequelize[_0x5fd7('0x3')]},'priority':{'type':Sequelize[_0x5fd7('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x5fd7('0x6')]},'dialTimezone':{'type':Sequelize[_0x5fd7('0x3')]},'utcOffset':{'type':Sequelize[_0x5fd7('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7fd5969..aaa214e 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 _0xee0f=['CmContactId','toContactId','hopperId','include','rows','getHopperHistories','ContactId','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','parse','import','User','agent','binding','firstName','fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','sms','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','type','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','fullname','findAndCountAll','startCase','chat','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','Account','Owner','DESC','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','reverse','value','slice','moment','bluebird','util','path','lodash','../../components/contacts','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','undefined','offset','count','limit','status','set','Content-Range','json','update','then','destroy','end','stack','name','send','index','describe','getOptions','findAll','catch','CmContact','find','keys','length','startsWith','cf_','columnName','analytics','CmCustomField','displayName','alias','values','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','tags','join','CmHopper','info','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','Tag','Tags','color','query','tag','Phones','ItemType','literal','Phones.OrderBy','omit','map','format','cf_%d','params','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','toParam','sequelize','text','phone','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','sort','pick','filter','merge','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ContactItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones'];(function(_0x5db211,_0x58023c){var _0x9bb5e0=function(_0x1d4d86){while(--_0x1d4d86){_0x5db211['push'](_0x5db211['shift']());}};_0x9bb5e0(++_0x58023c);}(_0xee0f,0x6a));var _0xfee0=function(_0x314c1d,_0x3fba0c){_0x314c1d=_0x314c1d-0x0;var _0x511529=_0xee0f[_0x314c1d];return _0x511529;};'use strict';var moment=require(_0xfee0('0x0'));var BPromise=require(_0xfee0('0x1'));var util=require(_0xfee0('0x2'));var path=require(_0xfee0('0x3'));var fs=require('fs');var _=require(_0xfee0('0x4'));var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var contacts=require(_0xfee0('0x5'));var qs=require(_0xfee0('0x6'));var logger=require('../../config/logger')(_0xfee0('0x7'));var config=require(_0xfee0('0x8'));var shared=require(_0xfee0('0x9'));var db=require(_0xfee0('0xa'))['db'];config[_0xfee0('0xb')]=_[_0xfee0('0xc')](config['redis'],{'host':_0xfee0('0xd'),'port':0x18eb});var socket=require(_0xfee0('0xe'))(new Redis(config['redis']));require(_0xfee0('0xf'))['register'](socket);function respondWithResult(_0x121224,_0x418d25){_0x418d25=_0x418d25||0xc8;return function(_0x4d826c){if(_0x4d826c){return _0x121224['status'](_0x418d25)['json'](_0x4d826c);}};}function respondWithFilteredResult(_0x2a3cee,_0xf72ddd){return function(_0x4330fa){if(_0x4330fa){var _0x322dec=typeof _0xf72ddd['offset']==='undefined'&&typeof _0xf72ddd['limit']===_0xfee0('0x10');var _0x8f741d=_0x4330fa['count'];var _0x616306=_0x322dec?0x0:_0xf72ddd[_0xfee0('0x11')];var _0x38136a=_0x322dec?_0x4330fa[_0xfee0('0x12')]:_0xf72ddd[_0xfee0('0x11')]+_0xf72ddd[_0xfee0('0x13')];var _0x33e97e;if(_0x38136a>=_0x8f741d){_0x38136a=_0x8f741d;_0x33e97e=0xc8;}else{_0x33e97e=0xce;}_0x2a3cee[_0xfee0('0x14')](_0x33e97e);return _0x2a3cee[_0xfee0('0x15')](_0xfee0('0x16'),_0x616306+'-'+_0x38136a+'/'+_0x8f741d)[_0xfee0('0x17')](_0x4330fa);}return null;};}function saveUpdates(_0x51380e){return function(_0x40ad94){if(_0x40ad94){return _0x40ad94[_0xfee0('0x18')](_0x51380e)[_0xfee0('0x19')](function(_0x3dfc25){return _0x3dfc25;});}return null;};}function removeEntity(_0x3d80a1){return function(_0x338232){if(_0x338232){return _0x338232[_0xfee0('0x1a')]()[_0xfee0('0x19')](function(){_0x3d80a1[_0xfee0('0x14')](0xcc)[_0xfee0('0x1b')]();});}};}function handleEntityNotFound(_0xbb1462){return function(_0xa286c5){if(!_0xa286c5){_0xbb1462['sendStatus'](0x194);}return _0xa286c5;};}function handleError(_0x55b542,_0x4ebc98){_0x4ebc98=_0x4ebc98||0x1f4;return function(_0x25496d){logger['error'](_0x25496d[_0xfee0('0x1c')]);if(_0x25496d[_0xfee0('0x1d')]){delete _0x25496d[_0xfee0('0x1d')];}_0x55b542[_0xfee0('0x14')](_0x4ebc98)[_0xfee0('0x1e')](_0x25496d);};}exports[_0xfee0('0x1f')]=function(_0x1c8ee4,_0x5a0789){var _0x4c91c7={};return contacts[_0xfee0('0x20')]()[_0xfee0('0x19')](function(_0x4b9a71){_0x4c91c7=qs[_0xfee0('0x21')](_0x4b9a71,_0x1c8ee4);return contacts[_0xfee0('0x22')](_0x1c8ee4['query'],_0x1c8ee4['user'],_0x4c91c7,_0x4b9a71);})[_0xfee0('0x19')](respondWithFilteredResult(_0x5a0789,_0x4c91c7))[_0xfee0('0x23')](handleError(_0x5a0789,null));};exports[_0xfee0('0x1a')]=function(_0x83dd9b,_0x2227be){return db[_0xfee0('0x24')][_0xfee0('0x25')]({'where':{'id':_0x83dd9b['params']['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x2227be,null))[_0xfee0('0x19')](removeEntity(_0x2227be,null))[_0xfee0('0x23')](handleError(_0x2227be,null));};exports['describe']=function(_0x23d16a,_0x30dc20){return db['CmContact'][_0xfee0('0x20')]()['then'](function(_0x162e1e){delete _0x162e1e['tags'];for(var _0x5e31bc=0x0;_0x5e31bc0x0){return new Promise(function(_0x43b56e){var _0x403806=[];for(var _0xcc0268=0x0;_0xcc0268<_0x3d4b00[_0xfee0('0x27')];_0xcc0268++){_0x403806[_0xfee0('0x5f')](insertAdditionalPhones(_0x3d4b00[_0xcc0268][_0xfee0('0x63')],_0x3d4b00[_0xcc0268][_0xfee0('0x59')]));}Promise[_0xfee0('0x64')](_0x403806)[_0xfee0('0x19')](function(){_0x43b56e(0x1);});})[_0xfee0('0x19')](function(){return{'success':_0xe2dd2c,'failure':_0x53ac9c,'duplicates':_0x5c9f23};});}else{return{'success':_0xe2dd2c,'failure':_0x53ac9c,'duplicates':_0x5c9f23};}}})[_0xfee0('0x19')](respondWithResult(_0x44ba93,0xc9))[_0xfee0('0x23')](handleError(_0x44ba93,null));};exports[_0xfee0('0x65')]=function(_0x142cc1,_0xea8ba4){var _0x2de5e0;return db[_0xfee0('0x24')]['describe']()[_0xfee0('0x19')](function(_0x5c2cc9){return db[_0xfee0('0x24')][_0xfee0('0x25')]({'where':{'id':_0x142cc1['params']['id']},'include':[{'model':db[_0xfee0('0x66')],'as':_0xfee0('0x67'),'attributes':['id',_0xfee0('0x1d'),_0xfee0('0x68')],'required':_0x142cc1[_0xfee0('0x69')][_0xfee0('0x6a')]?!![]:![]},{'model':db[_0xfee0('0x48')],'as':_0xfee0('0x6b'),'where':{'CmContactId':_0x142cc1['params']['id']},'required':![],'include':[{'model':db['ContactItemType'],'as':_0xfee0('0x6c')}]}],'order':[db['sequelize'][_0xfee0('0x6d')](_0xfee0('0x6e'))],'attributes':_[_0xfee0('0x26')](_0x5c2cc9)});})[_0xfee0('0x19')](function(_0x4010fd){if(!_[_0xfee0('0x55')](_0x4010fd)){_0x2de5e0=_0x4010fd[_0xfee0('0x35')]({'plain':!![]});var _0x22a219={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4010fd&&_0x4010fd[_0xfee0('0x60')]){if(_0x4010fd[_0xfee0('0x60')]){_0x22a219[_0xfee0('0x5d')]['$and'][_0xfee0('0x5f')]({'ListId':{'$ne':_0x4010fd[_0xfee0('0x60')]}});}}return db['CmCustomField'][_0xfee0('0x22')](_0x22a219);}})[_0xfee0('0x19')](function(_0x1f03a8){if(!_[_0xfee0('0x55')](_0x1f03a8)){return _[_0xfee0('0x6f')](_0x2de5e0,_[_0xfee0('0x70')](_0x1f03a8,function(_0xc61b84){return util[_0xfee0('0x71')](_0xfee0('0x72'),_0xc61b84['id']);}));}})[_0xfee0('0x19')](handleEntityNotFound(_0xea8ba4,null))[_0xfee0('0x19')](respondWithResult(_0xea8ba4,null))['catch'](handleError(_0xea8ba4,null));};exports['update']=function(_0x2e8ead,_0x2c7324){var _0x2834c8;if(_0x2e8ead[_0xfee0('0x33')]['id']){delete _0x2e8ead[_0xfee0('0x33')]['id'];}if(!_[_0xfee0('0x55')](_0x2e8ead[_0xfee0('0x33')][_0xfee0('0x56')])){var _0x512194=_0x2e8ead['body'][_0xfee0('0x56')];if(!_[_0xfee0('0x55')](shared['timezones'][_0x512194]))_0x2e8ead[_0xfee0('0x33')][_0xfee0('0x58')]=shared[_0xfee0('0x57')][_0x512194]['utcOffset'];}return db[_0xfee0('0x24')][_0xfee0('0x25')]({'where':{'id':_0x2e8ead[_0xfee0('0x73')]['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x2c7324,null))['then'](saveUpdates(_0x2e8ead['body'],null))['then'](function(_0x253a66){_0x2834c8=_0x253a66;var _0x128920={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x253a66&&_0x253a66[_0xfee0('0x60')]){if(_0x253a66[_0xfee0('0x60')]){_0x128920[_0xfee0('0x5d')]['$and'][_0xfee0('0x5f')]({'ListId':{'$ne':_0x253a66[_0xfee0('0x60')]}});}}return db['CmCustomField'][_0xfee0('0x22')](_0x128920);})[_0xfee0('0x19')](function(_0x4e7205){if(_0x4e7205){return _[_0xfee0('0x6f')](_['pickBy'](_0x2e8ead[_0xfee0('0x33')],function(_0x311518,_0x3ec055){return _[_0xfee0('0x28')](_0x3ec055,_0xfee0('0x29'));}),_[_0xfee0('0x70')](_0x4e7205,function(_0x5b70c1){return util[_0xfee0('0x71')](_0xfee0('0x72'),_0x5b70c1['id']);}));}})[_0xfee0('0x19')](function(_0x3460bd){if(_0x3460bd&&!_[_0xfee0('0x74')](_0x3460bd)){var _0x419a89=squel['update']()[_0xfee0('0x75')](_0xfee0('0x76'))[_0xfee0('0x77')](_0x3460bd)[_0xfee0('0x5d')](_0xfee0('0x78'),_0x2e8ead['params']['id'])[_0xfee0('0x79')]();return db[_0xfee0('0x7a')][_0xfee0('0x69')](_0x419a89[_0xfee0('0x7b')],{'replacements':_0x419a89[_0xfee0('0x2f')]});}})[_0xfee0('0x19')](function(){if(_0x2e8ead[_0xfee0('0x33')][_0xfee0('0x7c')]&&_0x2834c8){return db[_0xfee0('0x3a')][_0xfee0('0x18')]({'phone':_0x2e8ead['body'][_0xfee0('0x7c')],'OrderBy':0x0},{'where':{'ContactId':_0x2834c8['id']}});}})['then'](function(){return _0x2834c8;})[_0xfee0('0x19')](respondWithResult(_0x2c7324,null))[_0xfee0('0x23')](handleError(_0x2c7324,null));};exports[_0xfee0('0x7d')]=function(_0x59db16,_0x542ffb){var _0x652a5c={};var _0x5e272f={};var _0xbcca11;var _0x524007;return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x59db16[_0xfee0('0x73')]['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x542ffb,null))[_0xfee0('0x19')](function(_0x5d3403){if(_0x5d3403){_0xbcca11=_0x5d3403;_0x5e272f[_0xfee0('0x7f')]=_['keys'](db[_0xfee0('0x66')][_0xfee0('0x80')]);_0x5e272f['query']=_[_0xfee0('0x26')](_0x59db16[_0xfee0('0x69')]);_0x5e272f[_0xfee0('0x81')]=_[_0xfee0('0x82')](_0x5e272f[_0xfee0('0x7f')],_0x5e272f['query']);_0x652a5c['attributes']=_[_0xfee0('0x82')](_0x5e272f[_0xfee0('0x7f')],qs[_0xfee0('0x83')](_0x59db16['query'][_0xfee0('0x83')]));_0x652a5c[_0xfee0('0x84')]=_0x652a5c[_0xfee0('0x84')][_0xfee0('0x27')]?_0x652a5c[_0xfee0('0x84')]:_0x5e272f['model'];_0x652a5c[_0xfee0('0x85')]=qs[_0xfee0('0x86')](_0x59db16[_0xfee0('0x69')][_0xfee0('0x86')]);_0x652a5c[_0xfee0('0x5d')]=qs[_0xfee0('0x81')](_[_0xfee0('0x87')](_0x59db16[_0xfee0('0x69')],_0x5e272f[_0xfee0('0x81')]));if(_0x59db16[_0xfee0('0x69')][_0xfee0('0x88')]){_0x652a5c[_0xfee0('0x5d')]=_[_0xfee0('0x89')](_0x652a5c[_0xfee0('0x5d')],{'$or':_[_0xfee0('0x70')](_0x652a5c[_0xfee0('0x84')],function(_0x1f413f){var _0x53c88b={};_0x53c88b[_0x1f413f]={'$like':'%'+_0x59db16[_0xfee0('0x69')][_0xfee0('0x88')]+'%'};return _0x53c88b;})});}_0x652a5c=_['merge']({},_0x652a5c,_0x59db16[_0xfee0('0x8a')]);return _0xbcca11['getTags'](_0x652a5c);}})[_0xfee0('0x19')](function(_0x4d0241){if(_0x4d0241){_0x524007=_0x4d0241['length'];if(!_0x59db16['query'][_0xfee0('0x32')](_0xfee0('0x8b'))){_0x652a5c[_0xfee0('0x13')]=qs[_0xfee0('0x13')](_0x59db16[_0xfee0('0x69')]['limit']);_0x652a5c[_0xfee0('0x11')]=qs[_0xfee0('0x11')](_0x59db16[_0xfee0('0x69')][_0xfee0('0x11')]);}return _0xbcca11[_0xfee0('0x7d')](_0x652a5c);}})[_0xfee0('0x19')](function(_0x3715d2){if(_0x3715d2){return _0x3715d2?{'count':_0x524007,'rows':_0x3715d2}:null;}})[_0xfee0('0x19')](respondWithResult(_0x542ffb,null))['catch'](handleError(_0x542ffb,null));};exports['setTags']=function(_0x2b6aed,_0xad26bb){if(_0x2b6aed[_0xfee0('0x33')]['id']){delete _0x2b6aed['body']['id'];}return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x2b6aed['params']['id']}})['then'](handleEntityNotFound(_0xad26bb,null))[_0xfee0('0x19')](function(_0x1a4472){if(_0x1a4472){return _0x1a4472[_0xfee0('0x8c')](_0x2b6aed[_0xfee0('0x33')][_0xfee0('0x8d')]||[]);}return null;})['then'](respondWithResult(_0xad26bb,null))['catch'](handleError(_0xad26bb,null));};exports[_0xfee0('0x8e')]=function(_0x39d6ea,_0x36083d){var _0x50fda7=[];_0x50fda7[_0xfee0('0x5f')](addAdditionalPhones(_0x39d6ea[_0xfee0('0x33')]));Promise[_0xfee0('0x64')](_0x50fda7)[_0xfee0('0x19')](function(){_0x50fda7=[];_0x50fda7[_0xfee0('0x5f')](deleteCmHopperPhones(_0x39d6ea[_0xfee0('0x33')]['id']));_0x50fda7[_0xfee0('0x5f')](addCmHopperPhones(_0x39d6ea[_0xfee0('0x33')]['id']));Promise[_0xfee0('0x64')](_0x50fda7)[_0xfee0('0x19')](function(){return[0x1];})[_0xfee0('0x19')](respondWithResult(_0x36083d,null));});};function addAdditionalPhones(_0x41d23c){var _0x459c1f;return new Promise(function(_0x550b76){return db[_0xfee0('0x48')][_0xfee0('0x1a')]({'where':{'CmContactId':_0x41d23c['id']}})['then'](function(){db['ContactItemType'][_0xfee0('0x22')]({'raw':!![],'attributes':['id',_0xfee0('0x8f')]})[_0xfee0('0x19')](function(_0x41e683){var _0x423e12=[];for(var _0x366680=0x0;_0x366680<_0x41d23c[_0xfee0('0x90')][_0xfee0('0x27')];_0x366680++){var _0xce17c6=_0x41d23c[_0xfee0('0x91')]?_['isNil'](_0x41d23c['item_types'][_0x366680])?'':_0x41d23c['item_types'][_0x366680]:_0x41d23c['items'][_0x366680][_0xfee0('0x92')]?_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x92')]:'';var _0x20128b=_[_0xfee0('0x55')](_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x93')])?'':_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x93')];var _0x347d11=_0xce17c6+':'+_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x7c')]+'§'+_0x20128b;if(_[_0xfee0('0x55')](_0x459c1f))_0x459c1f=_0x347d11;else _0x459c1f+=';'+_0x347d11;var _0x4381d5=null;var _0x501af1=null;if(_0x41d23c['item_types']){if(!_['isNil'](_0x41d23c[_0xfee0('0x91')][_0x366680])){_0x501af1=_['find'](_0x41e683,function(_0x3e6906){return _0x3e6906['id']===_0x41d23c[_0xfee0('0x91')][_0x366680];});if(!_[_0xfee0('0x55')](_0x501af1)){_0x4381d5=_0x501af1['OrderBy'];}}}else{if(!_[_0xfee0('0x55')](_0x41d23c['items'][_0x366680])){_0x501af1=_['find'](_0x41e683,function(_0x3b743a){return _0x3b743a['id']===_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x92')];});if(!_[_0xfee0('0x55')](_0x501af1)){_0x4381d5=_0x366680;}}}if(_[_0xfee0('0x55')](_0x4381d5)){_0x4381d5=0x64;}_0x423e12['push'](addAdditionalPhone(_0x41d23c['id'],_0x41d23c[_0xfee0('0x90')][_0x366680][_0xfee0('0x7c')],_0x41d23c[_0xfee0('0x91')]?_['isNil'](_0x41d23c[_0xfee0('0x91')][_0x366680])?null:_0x41d23c[_0xfee0('0x91')][_0x366680]:_0x41d23c[_0xfee0('0x90')][_0x366680]['ItemTypeId']?_0x41d23c['items'][_0x366680][_0xfee0('0x92')]:null,_0x4381d5,_0x20128b));}Promise[_0xfee0('0x64')](_0x423e12)[_0xfee0('0x19')](function(){db[_0xfee0('0x24')][_0xfee0('0x18')]({'AdditionalPhones':_0x459c1f},{'where':{'id':_0x41d23c['id']}})[_0xfee0('0x19')](function(){_0x550b76(0x1);});});});});});}function addAdditionalPhone(_0x2667b5,_0x12e12e,_0xe64ace,_0x3694ff,_0x4b3b0f){return db[_0xfee0('0x48')][_0xfee0('0x25')]({'where':{'CmContactId':_0x2667b5,'item':_0x12e12e}})[_0xfee0('0x19')](function(_0x3eb79b){if(_0x3eb79b)logger[_0xfee0('0x3b')](_0xfee0('0x94'),_0x3eb79b);else{db[_0xfee0('0x48')]['create']({'CmContactId':_0x2667b5,'item':_0x12e12e,'ItemTypeId':_0xe64ace,'OrderBy':_0x3694ff,'ItemClass':_0xfee0('0x95'),'description':_0x4b3b0f});}});}function deleteCmHopperPhones(_0x413358){return new Promise(function(_0x170df7){return db['CmHopper'][_0xfee0('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x413358}})[_0xfee0('0x19')](function(_0xeba51){db[_0xfee0('0x96')][_0xfee0('0x1a')]({'where':{'CmHopperId':{'$in':_[_0xfee0('0x70')](_0xeba51,'id')}}});})['then'](function(){_0x170df7(0x1);});});}function addCmHopperPhones(_0x2f76ab){return new Promise(function(_0x176475){return db[_0xfee0('0x3a')][_0xfee0('0x22')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2f76ab}})[_0xfee0('0x19')](function(_0x3436e5){var _0x5f058c=[];_['map'](_0x3436e5,function(_0x497adf){_0x5f058c[_0xfee0('0x5f')](createCmHopperPhone(_0x2f76ab,_0x497adf['id']));});Promise[_0xfee0('0x64')](_0x5f058c)['then'](function(){_0x176475(0x1);});});});}function createCmHopperPhone(_0x3779c9,_0x401a36){return new Promise(function(_0x3ce512){db['CmContactHasItem'][_0xfee0('0x22')]({'raw':!![],'attributes':[_0xfee0('0x97'),_0xfee0('0x8f')],'where':{'CmContactId':_0x3779c9,'ItemClass':'PHONE'},'include':[{'model':db[_0xfee0('0x98')],'attributes':['OrderBy'],'as':_0xfee0('0x6c')}],'order':[_0xfee0('0x8f'),db['sequelize']['literal'](_0xfee0('0x99'))]})[_0xfee0('0x19')](function(_0x2de273){var _0x941c63=0x1;var _0x25e664=_[_0xfee0('0x70')](_0x2de273,function(_0x13d2bb){_0x13d2bb[_0xfee0('0x9a')]=_0x401a36;_0x13d2bb[_0xfee0('0x7c')]=_0x13d2bb['item'];_0x13d2bb[_0xfee0('0x8f')]=_0x941c63;delete _0x13d2bb[_0xfee0('0x9b')];_0x941c63=_0x941c63+0x1;return _0x13d2bb;});return db['CmHopperAdditionalPhone'][_0xfee0('0x5a')](_0x25e664,{});})[_0xfee0('0x19')](function(){_0x3ce512(0x1);});});}function insertAdditionalPhones(_0x1d847f,_0x1e1c5b){return new Promise(function(_0x3cd8fb){var _0x182ef1=[];for(var _0x25e15f=0x0;_0x25e15f<_0x1e1c5b[_0xfee0('0x27')];_0x25e15f++){var _0x2601fb=_0x1e1c5b[_0x25e15f];_0x182ef1['push'](parseContactItemType(_0x2601fb));}Promise[_0xfee0('0x64')](_0x182ef1)[_0xfee0('0x19')](function(){var _0x19f8ff={'id':_0x1d847f['id'],'items':_0x1e1c5b};return addAdditionalPhones(_0x19f8ff)[_0xfee0('0x19')](function(){return addCmHopperPhones(_0x1d847f['id']);});})[_0xfee0('0x19')](function(){_0x3cd8fb(_0x1d847f);});});}function parseContactItemType(_0x5247e2){return new Promise(function(_0x5c36a7){if(_0x5247e2['hasOwnProperty'](_0xfee0('0x92'))){_0x5c36a7(_0x5247e2);}else{return db['ContactItemType'][_0xfee0('0x25')]({'where':{'name':_0x5247e2['ItemType']}})[_0xfee0('0x19')](function(_0x3aacfc){if(_[_0xfee0('0x55')](_0x3aacfc))_0x5247e2[_0xfee0('0x92')]=null;else _0x5247e2['ItemTypeId']=_0x3aacfc['id'];_0x5c36a7(_0x5247e2);});}});}exports[_0xfee0('0x9c')]=function(_0x381ffb,_0x4fcfe6){return db[_0xfee0('0x48')][_0xfee0('0x22')]({'raw':!![],'where':{'CmContactId':_0x381ffb[_0xfee0('0x73')]['id'],'ItemClass':_0xfee0('0x95')},'include':[{'model':db[_0xfee0('0x98')],'as':_0xfee0('0x6c')}],'order':[['OrderBy'],[db[_0xfee0('0x7a')][_0xfee0('0x6d')](_0xfee0('0x99'))]]})[_0xfee0('0x19')](function(_0x444863){return _0x444863;})[_0xfee0('0x19')](respondWithResult(_0x4fcfe6,null))[_0xfee0('0x23')](handleError(_0x4fcfe6,null));};exports[_0xfee0('0x9d')]=function(_0x5d6f3d,_0x121fa4){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x5d6f3d['body']['fromContactId']}})[_0xfee0('0x19')](function(_0xafab21){var _0x4a227c=_['map'](_0xafab21,function(_0x1bd50f){_0x1bd50f[_0xfee0('0x9e')]=_0x5d6f3d[_0xfee0('0x33')][_0xfee0('0x9f')];return _0x1bd50f;});return db[_0xfee0('0x48')]['bulkCreate'](_0x4a227c,{});})[_0xfee0('0x19')](function(){return addCmHopperPhones(_0x5d6f3d[_0xfee0('0x33')][_0xfee0('0x9f')]);})[_0xfee0('0x19')](function(){return['ok'];})[_0xfee0('0x19')](respondWithResult(_0x121fa4,null))[_0xfee0('0x23')](handleError(_0x121fa4,null));};exports['rescheduleAdditionalPhones']=function(_0x4fea5d,_0x582974){var _0xa1382=[];_0xa1382[_0xfee0('0x5f')](createCmHopperPhone(_0x4fea5d[_0xfee0('0x33')]['id'],_0x4fea5d[_0xfee0('0x33')][_0xfee0('0xa0')]));Promise['all'](_0xa1382)[_0xfee0('0x19')](function(){return[0x1];})['then'](respondWithResult(_0x582974,null));};exports['getHoppers']=function(_0x29ebef,_0x339767){var _0x1a2584={'raw':![],'where':{}};var _0x2a9f0d={};var _0x1b4243={'count':0x0,'rows':[]};return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x29ebef[_0xfee0('0x73')]['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x339767,null))[_0xfee0('0x19')](function(_0x1fc400){if(_0x1fc400){_0x2a9f0d['model']=_['keys'](db['CmHopper'][_0xfee0('0x80')]);_0x2a9f0d[_0xfee0('0x69')]=_[_0xfee0('0x26')](_0x29ebef[_0xfee0('0x69')]);_0x2a9f0d[_0xfee0('0x81')]=_[_0xfee0('0x82')](_0x2a9f0d[_0xfee0('0x7f')],_0x2a9f0d[_0xfee0('0x69')]);_0x1a2584[_0xfee0('0x84')]=_['intersection'](_0x2a9f0d['model'],qs[_0xfee0('0x83')](_0x29ebef[_0xfee0('0x69')][_0xfee0('0x83')]));_0x1a2584['attributes']=_0x1a2584['attributes'][_0xfee0('0x27')]?_0x1a2584['attributes']:_0x2a9f0d[_0xfee0('0x7f')];if(!_0x29ebef[_0xfee0('0x69')][_0xfee0('0x32')](_0xfee0('0x8b'))){_0x1a2584[_0xfee0('0x13')]=qs[_0xfee0('0x13')](_0x29ebef['query']['limit']);_0x1a2584[_0xfee0('0x11')]=qs[_0xfee0('0x11')](_0x29ebef['query'][_0xfee0('0x11')]);}_0x1a2584[_0xfee0('0x85')]=qs[_0xfee0('0x86')](_0x29ebef[_0xfee0('0x69')][_0xfee0('0x86')]);_0x1a2584[_0xfee0('0x5d')]=qs[_0xfee0('0x81')](_[_0xfee0('0x87')](_0x29ebef[_0xfee0('0x69')],_0x2a9f0d[_0xfee0('0x81')]));_0x1a2584[_0xfee0('0x5d')]['ContactId']=_0x1fc400['id'];if(_0x29ebef[_0xfee0('0x69')][_0xfee0('0x88')]){_0x1a2584[_0xfee0('0x5d')]=_[_0xfee0('0x89')](_0x1a2584[_0xfee0('0x5d')],{'$or':_[_0xfee0('0x70')](_0x1a2584[_0xfee0('0x84')],function(_0x4eb2f2){var _0x5d422a={};_0x5d422a[_0x4eb2f2]={'$like':'%'+_0x29ebef['query']['filter']+'%'};return _0x5d422a;})});}_0x1a2584=_[_0xfee0('0x89')]({},_0x1a2584,_0x29ebef[_0xfee0('0x8a')]);return db[_0xfee0('0x3a')][_0xfee0('0x12')]({'where':_0x1a2584[_0xfee0('0x5d')]})[_0xfee0('0x19')](function(_0x274a79){_0x1b4243[_0xfee0('0x12')]=_0x274a79;if(_0x29ebef['query']['includeAll']){_0x1a2584[_0xfee0('0xa1')]=[{'all':!![]}];}return db[_0xfee0('0x3a')][_0xfee0('0x22')](_0x1a2584);})['then'](function(_0x172332){_0x1b4243[_0xfee0('0xa2')]=_0x172332;return _0x1b4243;});}})[_0xfee0('0x19')](respondWithFilteredResult(_0x339767,_0x1a2584))[_0xfee0('0x23')](handleError(_0x339767,null));};exports[_0xfee0('0xa3')]=function(_0x4da0a3,_0x196aca){var _0xe5bc25={'raw':!![],'where':{}};var _0x1ceea1={};var _0x339f87={'count':0x0,'rows':[]};return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x4da0a3[_0xfee0('0x73')]['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x196aca,null))['then'](function(_0xc259bc){if(_0xc259bc){_0x1ceea1[_0xfee0('0x7f')]=_[_0xfee0('0x26')](db[_0xfee0('0x4a')]['rawAttributes']);_0x1ceea1[_0xfee0('0x69')]=_[_0xfee0('0x26')](_0x4da0a3[_0xfee0('0x69')]);_0x1ceea1[_0xfee0('0x81')]=_['intersection'](_0x1ceea1[_0xfee0('0x7f')],_0x1ceea1[_0xfee0('0x69')]);_0xe5bc25[_0xfee0('0x84')]=_['intersection'](_0x1ceea1[_0xfee0('0x7f')],qs['fields'](_0x4da0a3[_0xfee0('0x69')][_0xfee0('0x83')]));_0xe5bc25[_0xfee0('0x84')]=_0xe5bc25[_0xfee0('0x84')]['length']?_0xe5bc25[_0xfee0('0x84')]:_0x1ceea1[_0xfee0('0x7f')];if(!_0x4da0a3[_0xfee0('0x69')][_0xfee0('0x32')](_0xfee0('0x8b'))){_0xe5bc25[_0xfee0('0x13')]=qs[_0xfee0('0x13')](_0x4da0a3[_0xfee0('0x69')]['limit']);_0xe5bc25[_0xfee0('0x11')]=qs[_0xfee0('0x11')](_0x4da0a3[_0xfee0('0x69')][_0xfee0('0x11')]);}_0xe5bc25['order']=qs[_0xfee0('0x86')](_0x4da0a3[_0xfee0('0x69')]['sort']);_0xe5bc25[_0xfee0('0x5d')]=qs[_0xfee0('0x81')](_[_0xfee0('0x87')](_0x4da0a3['query'],_0x1ceea1['filters']));_0xe5bc25[_0xfee0('0x5d')][_0xfee0('0xa4')]=_0xc259bc['id'];if(_0x4da0a3['query']['filter']){_0xe5bc25[_0xfee0('0x5d')]=_[_0xfee0('0x89')](_0xe5bc25[_0xfee0('0x5d')],{'$or':_[_0xfee0('0x70')](_0xe5bc25[_0xfee0('0x84')],function(_0x1c8df5){var _0x436292={};_0x436292[_0x1c8df5]={'$like':'%'+_0x4da0a3['query'][_0xfee0('0x88')]+'%'};return _0x436292;})});}_0xe5bc25=_[_0xfee0('0x89')]({},_0xe5bc25,_0x4da0a3['options']);return db[_0xfee0('0x4a')][_0xfee0('0x12')]({'where':_0xe5bc25['where']})[_0xfee0('0x19')](function(_0x54ae94){_0x339f87[_0xfee0('0x12')]=_0x54ae94;if(_0x4da0a3[_0xfee0('0x69')]['includeAll']){_0xe5bc25[_0xfee0('0xa1')]=[{'all':!![]}];}return db[_0xfee0('0x4a')][_0xfee0('0x22')](_0xe5bc25);})[_0xfee0('0x19')](function(_0x362755){_0x339f87[_0xfee0('0xa2')]=_0x362755;return _0x339f87;});}})[_0xfee0('0x19')](respondWithFilteredResult(_0x196aca,_0xe5bc25))['catch'](handleError(_0x196aca,null));};exports[_0xfee0('0xa5')]=function(_0x5413cd,_0x43f718){var _0x2e5561={'raw':!![],'where':{}};var _0x5e5ba3={};var _0x2a5092={'count':0x0,'rows':[]};return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x5413cd['params']['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x43f718,null))[_0xfee0('0x19')](function(_0x4cc122){if(_0x4cc122){_0x5e5ba3[_0xfee0('0x7f')]=_['keys'](db['CmHopperFinal'][_0xfee0('0x80')]);_0x5e5ba3[_0xfee0('0x69')]=_[_0xfee0('0x26')](_0x5413cd[_0xfee0('0x69')]);_0x5e5ba3[_0xfee0('0x81')]=_[_0xfee0('0x82')](_0x5e5ba3[_0xfee0('0x7f')],_0x5e5ba3[_0xfee0('0x69')]);_0x2e5561[_0xfee0('0x84')]=_['intersection'](_0x5e5ba3['model'],qs[_0xfee0('0x83')](_0x5413cd[_0xfee0('0x69')]['fields']));_0x2e5561[_0xfee0('0x84')]=_0x2e5561[_0xfee0('0x84')][_0xfee0('0x27')]?_0x2e5561[_0xfee0('0x84')]:_0x5e5ba3[_0xfee0('0x7f')];if(!_0x5413cd['query'][_0xfee0('0x32')]('nolimit')){_0x2e5561[_0xfee0('0x13')]=qs['limit'](_0x5413cd['query']['limit']);_0x2e5561[_0xfee0('0x11')]=qs[_0xfee0('0x11')](_0x5413cd['query']['offset']);}_0x2e5561['order']=qs['sort'](_0x5413cd[_0xfee0('0x69')]['sort']);_0x2e5561['where']=qs[_0xfee0('0x81')](_[_0xfee0('0x87')](_0x5413cd[_0xfee0('0x69')],_0x5e5ba3['filters']));_0x2e5561[_0xfee0('0x5d')]['ContactId']=_0x4cc122['id'];if(_0x5413cd[_0xfee0('0x69')][_0xfee0('0x88')]){_0x2e5561['where']=_['merge'](_0x2e5561[_0xfee0('0x5d')],{'$or':_[_0xfee0('0x70')](_0x2e5561[_0xfee0('0x84')],function(_0x285c3d){var _0x351dae={};_0x351dae[_0x285c3d]={'$like':'%'+_0x5413cd[_0xfee0('0x69')][_0xfee0('0x88')]+'%'};return _0x351dae;})});}_0x2e5561=_[_0xfee0('0x89')]({},_0x2e5561,_0x5413cd[_0xfee0('0x8a')]);return db[_0xfee0('0x49')][_0xfee0('0x12')]({'where':_0x2e5561[_0xfee0('0x5d')]})['then'](function(_0x2bc1c2){_0x2a5092[_0xfee0('0x12')]=_0x2bc1c2;if(_0x5413cd[_0xfee0('0x69')][_0xfee0('0xa6')]){_0x2e5561[_0xfee0('0xa1')]=[{'all':!![]}];}return db[_0xfee0('0x49')][_0xfee0('0x22')](_0x2e5561);})[_0xfee0('0x19')](function(_0x3a142e){_0x2a5092[_0xfee0('0xa2')]=_0x3a142e;return _0x2a5092;});}})[_0xfee0('0x19')](respondWithFilteredResult(_0x43f718,_0x2e5561))[_0xfee0('0x23')](handleError(_0x43f718,null));};exports[_0xfee0('0xa7')]=function(_0x1a5586,_0x214597){var _0x4ff2a8={'raw':!![],'where':{}};var _0xc38c9a={};var _0x3e4822={'count':0x0,'rows':[]};return db[_0xfee0('0x24')][_0xfee0('0x7e')]({'where':{'id':_0x1a5586[_0xfee0('0x73')]['id']}})[_0xfee0('0x19')](handleEntityNotFound(_0x214597,null))[_0xfee0('0x19')](function(_0x15d0f3){if(_0x15d0f3){_0xc38c9a[_0xfee0('0x7f')]=_[_0xfee0('0x26')](db[_0xfee0('0x51')][_0xfee0('0x80')]);_0xc38c9a[_0xfee0('0x69')]=_['keys'](_0x1a5586['query']);_0xc38c9a[_0xfee0('0x81')]=_[_0xfee0('0x82')](_0xc38c9a['model'],_0xc38c9a[_0xfee0('0x69')]);_0x4ff2a8[_0xfee0('0x84')]=_[_0xfee0('0x82')](_0xc38c9a[_0xfee0('0x7f')],qs[_0xfee0('0x83')](_0x1a5586[_0xfee0('0x69')][_0xfee0('0x83')]));_0x4ff2a8[_0xfee0('0x84')]=_0x4ff2a8[_0xfee0('0x84')]['length']?_0x4ff2a8['attributes']:_0xc38c9a['model'];if(!_0x1a5586[_0xfee0('0x69')][_0xfee0('0x32')](_0xfee0('0x8b'))){_0x4ff2a8['limit']=qs[_0xfee0('0x13')](_0x1a5586[_0xfee0('0x69')]['limit']);_0x4ff2a8['offset']=qs[_0xfee0('0x11')](_0x1a5586[_0xfee0('0x69')]['offset']);}_0x4ff2a8[_0xfee0('0x85')]=qs[_0xfee0('0x86')](_0x1a5586[_0xfee0('0x69')][_0xfee0('0x86')]);_0x4ff2a8[_0xfee0('0x5d')]=qs[_0xfee0('0x81')](_[_0xfee0('0x87')](_0x1a5586['query'],_0xc38c9a[_0xfee0('0x81')]));_0x4ff2a8['where'][_0xfee0('0xa4')]=_0x15d0f3['id'];if(_0x1a5586['query'][_0xfee0('0x88')]){_0x4ff2a8[_0xfee0('0x5d')]=_[_0xfee0('0x89')](_0x4ff2a8['where'],{'$or':_['map'](_0x4ff2a8[_0xfee0('0x84')],function(_0x434e27){var _0x204fac={};_0x204fac[_0x434e27]={'$like':'%'+_0x1a5586[_0xfee0('0x69')][_0xfee0('0x88')]+'%'};return _0x204fac;})});}_0x4ff2a8=_[_0xfee0('0x89')]({},_0x4ff2a8,_0x1a5586[_0xfee0('0x8a')]);return db[_0xfee0('0x51')][_0xfee0('0x12')]({'where':_0x4ff2a8['where']})[_0xfee0('0x19')](function(_0x5d0fa1){_0x3e4822[_0xfee0('0x12')]=_0x5d0fa1;if(_0x1a5586[_0xfee0('0x69')][_0xfee0('0xa6')]){_0x4ff2a8['include']=[{'all':!![]}];}return db[_0xfee0('0x51')][_0xfee0('0x22')](_0x4ff2a8);})['then'](function(_0x5abd09){_0x3e4822[_0xfee0('0xa2')]=_0x5abd09;return _0x3e4822;});}})['then'](respondWithFilteredResult(_0x214597,_0x4ff2a8))[_0xfee0('0x23')](handleError(_0x214597,null));};exports[_0xfee0('0xa8')]=function(_0x473225,_0x27aafd){try{if(!_0x473225[_0xfee0('0x33')][_0xfee0('0x60')]){throw new Error(_0xfee0('0xa9'));}if(!_0x473225[_0xfee0('0x33')]['binding_keys']){throw new Error(_0xfee0('0xaa'));}if(!_0x473225[_0xfee0('0x33')]['binding_values']){throw new Error(_0xfee0('0xab'));}if(!_0x473225[_0xfee0('0x33')][_0xfee0('0xac')]){throw new Error(_0xfee0('0xad'));}var _0x2ba12c=_0x473225[_0xfee0('0x33')][_0xfee0('0xae')][_0xfee0('0xaf')](',');var _0x293308=_0x473225[_0xfee0('0x33')][_0xfee0('0xb0')]['split'](',');if(!_0x2ba12c[_0xfee0('0x27')]||!_0x293308[_0xfee0('0x27')]||_0x2ba12c[_0xfee0('0x27')]!==_0x293308[_0xfee0('0x27')]){throw new Error(_0xfee0('0xb1'));}_0x473225['body'][_0xfee0('0x83')]=_[_0xfee0('0xb2')](_0x2ba12c,_0x293308);if(!_0x473225[_0xfee0('0x33')]['fields'][_0xfee0('0x7c')]){throw new Error(_0xfee0('0xb3'));}if(!_0x473225[_0xfee0('0x33')][_0xfee0('0x83')]['firstName']){throw new Error(_0xfee0('0xb4'));}var _0x3008c9=path[_0xfee0('0x39')](config[_0xfee0('0xb5')],_0xfee0('0xb6'),_0x473225[_0xfee0('0xb7')][_0xfee0('0xb8')]);fs[_0xfee0('0xb9')](_0x3008c9,parseInt(_0xfee0('0xba'),0x8));var _0x2fb808=require(_0xfee0('0xbb'))['fork'](path[_0xfee0('0x39')](__dirname,_0xfee0('0xbc')),[_0x3008c9,_0x473225[_0xfee0('0x33')]['binding_keys'],_0x473225[_0xfee0('0x33')][_0xfee0('0xb0')],_0x473225[_0xfee0('0x33')][_0xfee0('0x60')],_0x473225[_0xfee0('0x33')][_0xfee0('0xbd')],_0x473225['body'][_0xfee0('0x5c')],_0x473225[_0xfee0('0x33')][_0xfee0('0xac')]]);return _0x27aafd['status'](0xc8)[_0xfee0('0x17')]({'message':_0xfee0('0xbe'),'pid':_0x2fb808[_0xfee0('0xbf')]});}catch(_0x312aa5){return _0x27aafd[_0xfee0('0x14')](0x1f4)[_0xfee0('0x1e')](_0x312aa5);}};exports[_0xfee0('0xc0')]=function(_0x28ac10,_0x461487){var _0x10b22b=fs['createReadStream'](_0x28ac10[_0xfee0('0xb7')][_0xfee0('0x3')]);Papa[_0xfee0('0xc1')](_0x10b22b,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5bec66){return _0x461487[_0xfee0('0x14')](0xc8)[_0xfee0('0x17')]({'file':_0x28ac10[_0xfee0('0xb7')],'fields':_0x5bec66['meta']['fields']});}});};exports[_0xfee0('0xc2')]=function(_0x35777f,_0x2b68ee){return db[_0xfee0('0xc3')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xfee0('0xc4')}})['then'](function(_0x1f0378){var _0x27ae8e=![];if(!_0x35777f[_0xfee0('0x33')]['ListId']){throw new Error(_0xfee0('0xa9'));}if(!_0x35777f[_0xfee0('0x33')]['binding'][_0xfee0('0x7c')]){throw new Error(_0xfee0('0xb3'));}if(!_0x35777f[_0xfee0('0x33')][_0xfee0('0xc5')][_0xfee0('0xc6')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x35777f['body'][_0xfee0('0xac')]){throw new Error(_0xfee0('0xad'));}var _0x29aa3d=require('child_process')[_0xfee0('0xc7')](path['join'](__dirname,_0xfee0('0xc8')),[_0x35777f[_0xfee0('0x73')]['id'],JSON[_0xfee0('0xc9')](_0x35777f[_0xfee0('0x33')]),JSON[_0xfee0('0xc9')](_0x1f0378)]);_0x29aa3d['on'](_0xfee0('0xca'),function(){_0x27ae8e=!![];return _0x2b68ee[_0xfee0('0x14')](0xc8)[_0xfee0('0x17')]({'message':_0xfee0('0xcb'),'pid':_0x29aa3d[_0xfee0('0xbf')]});});_0x29aa3d['on'](_0xfee0('0xcc'),function(_0x2268cb){if(_0x2268cb&&!_0x27ae8e){return _0x2b68ee['status'](0x1f4)[_0xfee0('0x17')]({'message':_0xfee0('0xcd'),'pid':_0x29aa3d[_0xfee0('0xbf')]});}});})[_0xfee0('0x23')](handleError(_0x2b68ee,null));};exports[_0xfee0('0xce')]=function(_0x12b121,_0x5ed31d){return db['User'][_0xfee0('0x22')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfee0('0xc4')}})[_0xfee0('0x19')](function(_0x3a1377){var _0x29a9a5=![];if(!_0x12b121[_0xfee0('0x33')][_0xfee0('0x60')]){throw new Error(_0xfee0('0xa9'));}if(!_0x12b121[_0xfee0('0x33')][_0xfee0('0xc5')]['phone']){throw new Error(_0xfee0('0xb3'));}if(!_0x12b121[_0xfee0('0x33')][_0xfee0('0xc5')][_0xfee0('0xc6')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x12b121[_0xfee0('0x33')][_0xfee0('0xac')]){throw new Error(_0xfee0('0xad'));}var _0x52d7ce=require(_0xfee0('0xbb'))['fork'](path['join'](__dirname,_0xfee0('0xcf')),[_0x12b121['params']['id'],JSON[_0xfee0('0xc9')](_0x12b121[_0xfee0('0x33')]),JSON[_0xfee0('0xc9')](_0x3a1377)]);_0x52d7ce['on']('message',function(){_0x29a9a5=!![];return _0x5ed31d[_0xfee0('0x14')](0xc8)[_0xfee0('0x17')]({'message':'start\x20child\x20process\x20correctly!','pid':_0x52d7ce[_0xfee0('0xbf')]});});_0x52d7ce['on'](_0xfee0('0xcc'),function(_0x545f18){if(_0x545f18&&!_0x29a9a5){return _0x5ed31d[_0xfee0('0x14')](0x1f4)[_0xfee0('0x17')]({'message':_0xfee0('0xcd'),'pid':_0x52d7ce[_0xfee0('0xbf')]});}});})[_0xfee0('0x23')](handleError(_0x5ed31d,null));};exports['getJourney']=function(_0x5e8404,_0x4eccc6){var _0x4de547=['mail','chat',_0xfee0('0xd0'),'openchannel',_0xfee0('0xd1'),_0xfee0('0xd2'),_0xfee0('0xd3')];var _0x271e80={'offset':0x0,'order':qs[_0xfee0('0x86')](_0xfee0('0xd4'))},_0x37d57e={'count':0x0,'rows':[]};Promise['resolve']()[_0xfee0('0x19')](function(){if(_0x5e8404['query'][_0xfee0('0xd5')]){if(!_[_0xfee0('0xd6')](_0x4de547,_0x5e8404[_0xfee0('0x69')][_0xfee0('0xd5')][_0xfee0('0xd7')]())){throw new Error(_0xfee0('0xd8'));}_0x4de547=[_0x5e8404[_0xfee0('0x69')][_0xfee0('0xd5')][_0xfee0('0xd7')]()];}if(_0x5e8404['query'][_0xfee0('0xd9')]){try{var _0xa83ae0=JSON[_0xfee0('0xc1')](_0x5e8404['query'][_0xfee0('0xd9')]);if(!moment(_0xa83ae0[_0xfee0('0x34')])[_0xfee0('0xda')]()){throw new Error(_0xfee0('0xdb'));}if(!moment(_0xa83ae0['to'])[_0xfee0('0xda')]()){throw new Error(_0xfee0('0xdc'));}}catch(_0x576a90){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x5e8404[_0xfee0('0x69')]['hasOwnProperty'](_0xfee0('0x8b'))){_0x271e80['limit']=qs['limit'](_0x5e8404[_0xfee0('0x69')]['limit']||0xa);_0x271e80[_0xfee0('0x11')]=qs[_0xfee0('0x11')](_0x5e8404[_0xfee0('0x69')]['offset']);}var _0x37d420=_0x4de547[_0xfee0('0x70')](function(_0x4e970f){if(_0x4e970f==='voice'){var _0xc87535={'attributes':['id',_0xfee0('0xdd'),_0xfee0('0xde'),_0xfee0('0xdf'),_0xfee0('0xe0'),_0xfee0('0xe1'),_0xfee0('0xe2'),_0xfee0('0xe3'),_0xfee0('0xe4'),_0xfee0('0xe5'),_0xfee0('0xe6'),_0xfee0('0xe7'),_0xfee0('0xe8'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x5e8404[_0xfee0('0x73')]['id']},'include':[{'model':db[_0xfee0('0xc3')],'as':_0xfee0('0xc3'),'attributes':['id',_0xfee0('0x1d'),_0xfee0('0xe9'),'alias']}],'order':[[_0xfee0('0xe6'),'DESC']]};if(_0x5e8404['query']['range']){_0xc87535[_0xfee0('0x5d')]['createdAt']={'$gte':_0xa83ae0[_0xfee0('0x34')],'$lte':_0xa83ae0['to']};}return db[_0xfee0('0x4c')][_0xfee0('0xea')](_0xc87535)[_0xfee0('0x19')](function(_0x140d36){_0x37d57e[_0xfee0('0x12')]+=_0x140d36[_0xfee0('0x12')];return _[_0xfee0('0x70')](_0x140d36['rows'],function(_0xa516d8){var _0xe3cf0b=_0xa516d8[_0xfee0('0x35')]({'plain':!![]});_0xe3cf0b['channel']=_0x4e970f;if(_0xe3cf0b[_0xfee0('0xc3')]){_0xe3cf0b[_0xfee0('0xc3')]={'id':_0xe3cf0b[_0xfee0('0xc3')]['id'],'name':_0xe3cf0b[_0xfee0('0xc3')][_0xfee0('0x1d')],'fullname':_0xe3cf0b[_0xfee0('0xc3')][_0xfee0('0xe9')],'alias':_0xe3cf0b[_0xfee0('0xc3')][_0xfee0('0x2e')]};}return _0xe3cf0b;});});}else{var _0x1ac93d=_[_0xfee0('0xeb')](_0x4e970f)+(_0x4e970f===_0xfee0('0xec')?'Website':'Account');var _0x4a3825={'attributes':['id',_0xfee0('0xed'),_0xfee0('0xee'),'createdAt','note',_0xfee0('0xef'),_0xfee0('0xf0'),_0xfee0('0xf1'),_0xfee0('0xf2'),_0x1ac93d+'Id'],'where':{'ContactId':_0x5e8404[_0xfee0('0x73')]['id']},'include':[{'model':db[_0x1ac93d],'as':_0xfee0('0xf3'),'attributes':['id',_0xfee0('0x1d'),'key']},{'model':db[_0xfee0('0xc3')],'as':_0xfee0('0xf4'),'attributes':['id','name',_0xfee0('0xe9')]},{'model':db[_0xfee0('0x66')],'as':_0xfee0('0x67'),'attributes':['id','name','color'],'through':{'attributes':[]}}],'order':[['createdAt',_0xfee0('0xf5')]]};if(_0x5e8404[_0xfee0('0x69')]['range']){_0x4a3825[_0xfee0('0x5d')][_0xfee0('0xe6')]={'$gte':_0xa83ae0[_0xfee0('0x34')],'$lte':_0xa83ae0['to']};}switch(_0x4e970f){case'chat':_0x4a3825[_0xfee0('0x84')][_0xfee0('0x5f')](_0xfee0('0xf6'),_0xfee0('0xf7'),'customerPort','deviceModel',_0xfee0('0xf8'),_0xfee0('0xf9'),_0xfee0('0xfa'),_0xfee0('0xfb'),_0xfee0('0xfc'));break;case _0xfee0('0xfd'):_0x4a3825['attributes']['push'](_0xfee0('0xfe'),_0xfee0('0xff'));break;case'openchannel':_0x4a3825['attributes'][_0xfee0('0x5f')](_0xfee0('0x100'),_0xfee0('0x101'));break;}return db[_[_0xfee0('0xeb')](_0x4e970f)+_0xfee0('0x102')]['findAndCountAll'](_0x4a3825)[_0xfee0('0x19')](function(_0x3481d6){_0x37d57e['count']+=_0x3481d6[_0xfee0('0x12')];return _[_0xfee0('0x70')](_0x3481d6['rows'],function(_0x1ee0f9){var _0x978446=_0x1ee0f9[_0xfee0('0x35')]({'plain':!![]});_0x978446[_0xfee0('0xd5')]=_0x4e970f;if(_0x978446['Owner']){_0x978446[_0xfee0('0xf4')]={'id':_0x978446[_0xfee0('0xf4')]['id'],'name':_0x978446['Owner'][_0xfee0('0x1d')],'fullname':_0x978446['Owner'][_0xfee0('0xe9')]};}return _0x978446;});});}});return Promise[_0xfee0('0x64')](_0x37d420);})[_0xfee0('0x19')](function(_0xab5425){return _(_0xab5425)[_0xfee0('0x103')]()[_0xfee0('0x104')](_0xfee0('0xe6'))[_0xfee0('0x105')]()[_0xfee0('0x106')]();})['then'](function(_0x42abb7){_0x37d57e[_0xfee0('0xa2')]=_0x271e80[_0xfee0('0x13')]?_0x42abb7[_0xfee0('0x107')](_0x271e80['offset'],_0x271e80['offset']+_0x271e80[_0xfee0('0x13')]):_0x42abb7;return _0x37d57e;})[_0xfee0('0x19')](respondWithFilteredResult(_0x4eccc6,_0x271e80))['catch'](handleError(_0x4eccc6,null));}; \ No newline at end of file +var _0x6022=['closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','browserName','customerIp','customerPort','osName','ratingMessage','ratingType','ratingValue','referer','mail','externalUrl','Interaction','Owner','flatten','sortBy','reverse','slice','moment','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../config/environment/shared','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','offset','limit','count','json','then','error','stack','name','send','describe','getOptions','findAll','query','user','destroy','CmContact','find','catch','tags','keys','length','startsWith','columnName','displayName','analytics','CmCustomField','cf_','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','body','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','all','params','Tag','Tags','color','tag','Phones','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','table','cm_contacts','setFields','toParam','text','phone','getTags','findOne','model','filters','attributes','fields','order','sort','pick','merge','filter','options','nolimit','setTags','ids','setAdditionalPhones','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','literal','fromContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','rawAttributes','intersection','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','User','agent','No\x20ListId\x20specified','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','binding','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','chat','sms','openchannel','fax','voice','-createdAt','channel','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','duration','note','userDisposition','userSecondDisposition','UserId','alias','createdAt','DESC','findAndCountAll','fullname','startCase','Website'];(function(_0x2a3225,_0x206e42){var _0x3a15be=function(_0x4896e0){while(--_0x4896e0){_0x2a3225['push'](_0x2a3225['shift']());}};_0x3a15be(++_0x206e42);}(_0x6022,0x118));var _0x2602=function(_0x7def3e,_0x1f79ce){_0x7def3e=_0x7def3e-0x0;var _0x8adf77=_0x6022[_0x7def3e];return _0x8adf77;};'use strict';var moment=require(_0x2602('0x0'));var BPromise=require(_0x2602('0x1'));var util=require(_0x2602('0x2'));var path=require('path');var fs=require('fs');var _=require(_0x2602('0x3'));var squel=require(_0x2602('0x4'));var Papa=require('papaparse');var Redis=require(_0x2602('0x5'));var contacts=require('../../components/contacts');var qs=require(_0x2602('0x6'));var logger=require('../../config/logger')(_0x2602('0x7'));var config=require(_0x2602('0x8'));var shared=require(_0x2602('0x9'));var db=require('../../mysqldb')['db'];config[_0x2602('0xa')]=_[_0x2602('0xb')](config[_0x2602('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x2602('0xc'))(new Redis(config['redis']));require(_0x2602('0xd'))[_0x2602('0xe')](socket);function respondWithResult(_0x347c89,_0x1e87fc){_0x1e87fc=_0x1e87fc||0xc8;return function(_0x18a191){if(_0x18a191){return _0x347c89[_0x2602('0xf')](_0x1e87fc)['json'](_0x18a191);}};}function respondWithFilteredResult(_0x22ba8e,_0x2c5ad2){return function(_0x552470){if(_0x552470){var _0x254346=typeof _0x2c5ad2[_0x2602('0x10')]==='undefined'&&typeof _0x2c5ad2[_0x2602('0x11')]==='undefined';var _0x3a3820=_0x552470[_0x2602('0x12')];var _0x19b82f=_0x254346?0x0:_0x2c5ad2[_0x2602('0x10')];var _0x5c72cd=_0x254346?_0x552470[_0x2602('0x12')]:_0x2c5ad2[_0x2602('0x10')]+_0x2c5ad2['limit'];var _0x57e07e;if(_0x5c72cd>=_0x3a3820){_0x5c72cd=_0x3a3820;_0x57e07e=0xc8;}else{_0x57e07e=0xce;}_0x22ba8e[_0x2602('0xf')](_0x57e07e);return _0x22ba8e['set']('Content-Range',_0x19b82f+'-'+_0x5c72cd+'/'+_0x3a3820)[_0x2602('0x13')](_0x552470);}return null;};}function saveUpdates(_0xd6d3fe){return function(_0x321889){if(_0x321889){return _0x321889['update'](_0xd6d3fe)[_0x2602('0x14')](function(_0x29d879){return _0x29d879;});}return null;};}function removeEntity(_0x2b87bd){return function(_0x469745){if(_0x469745){return _0x469745['destroy']()[_0x2602('0x14')](function(){_0x2b87bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ca12){return function(_0x30bf9c){if(!_0x30bf9c){_0x43ca12['sendStatus'](0x194);}return _0x30bf9c;};}function handleError(_0x2e975f,_0x300fe){_0x300fe=_0x300fe||0x1f4;return function(_0x365172){logger[_0x2602('0x15')](_0x365172[_0x2602('0x16')]);if(_0x365172[_0x2602('0x17')]){delete _0x365172[_0x2602('0x17')];}_0x2e975f[_0x2602('0xf')](_0x300fe)[_0x2602('0x18')](_0x365172);};}exports['index']=function(_0x1934cc,_0x38869f){var _0xcd4b26={};return contacts[_0x2602('0x19')]()[_0x2602('0x14')](function(_0x4ba335){_0xcd4b26=qs[_0x2602('0x1a')](_0x4ba335,_0x1934cc);return contacts[_0x2602('0x1b')](_0x1934cc[_0x2602('0x1c')],_0x1934cc[_0x2602('0x1d')],_0xcd4b26,_0x4ba335);})[_0x2602('0x14')](respondWithFilteredResult(_0x38869f,_0xcd4b26))['catch'](handleError(_0x38869f,null));};exports[_0x2602('0x1e')]=function(_0x5e6dab,_0x160bc0){return db[_0x2602('0x1f')][_0x2602('0x20')]({'where':{'id':_0x5e6dab['params']['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x160bc0,null))[_0x2602('0x14')](removeEntity(_0x160bc0,null))[_0x2602('0x21')](handleError(_0x160bc0,null));};exports['describe']=function(_0x3a8a30,_0x9e8700){return db['CmContact'][_0x2602('0x19')]()['then'](function(_0x385eaf){delete _0x385eaf[_0x2602('0x22')];for(var _0x3164d3=0x0;_0x3164d30x0){return new Promise(function(_0x4a6d8e){var _0x3785b0=[];for(var _0x311663=0x0;_0x311663<_0x40d141[_0x2602('0x24')];_0x311663++){_0x3785b0[_0x2602('0x5c')](insertAdditionalPhones(_0x40d141[_0x311663]['contact'],_0x40d141[_0x311663]['additionalPhones']));}Promise[_0x2602('0x60')](_0x3785b0)[_0x2602('0x14')](function(){_0x4a6d8e(0x1);});})[_0x2602('0x14')](function(){return{'success':_0x24c893,'failure':_0x5c3bb2,'duplicates':_0x1a2cc2};});}else{return{'success':_0x24c893,'failure':_0x5c3bb2,'duplicates':_0x1a2cc2};}}})[_0x2602('0x14')](respondWithResult(_0x261be7,0xc9))[_0x2602('0x21')](handleError(_0x261be7,null));};exports['show']=function(_0x389811,_0x2e4db7){var _0x216016;return db[_0x2602('0x1f')][_0x2602('0x19')]()['then'](function(_0x514e10){return db[_0x2602('0x1f')][_0x2602('0x20')]({'where':{'id':_0x389811[_0x2602('0x61')]['id']},'include':[{'model':db[_0x2602('0x62')],'as':_0x2602('0x63'),'attributes':['id',_0x2602('0x17'),_0x2602('0x64')],'required':_0x389811[_0x2602('0x1c')][_0x2602('0x65')]?!![]:![]},{'model':db[_0x2602('0x47')],'as':_0x2602('0x66'),'where':{'CmContactId':_0x389811[_0x2602('0x61')]['id']},'required':![],'include':[{'model':db[_0x2602('0x67')],'as':_0x2602('0x68')}]}],'order':[db[_0x2602('0x69')]['literal'](_0x2602('0x6a'))],'attributes':_[_0x2602('0x23')](_0x514e10)});})['then'](function(_0x186198){if(!_[_0x2602('0x53')](_0x186198)){_0x216016=_0x186198[_0x2602('0x33')]({'plain':!![]});var _0x643e08={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x186198&&_0x186198[_0x2602('0x5d')]){if(_0x186198[_0x2602('0x5d')]){_0x643e08['where'][_0x2602('0x6b')][_0x2602('0x5c')]({'ListId':{'$ne':_0x186198['ListId']}});}}return db['CmCustomField']['findAll'](_0x643e08);}})['then'](function(_0x534363){if(!_[_0x2602('0x53')](_0x534363)){return _[_0x2602('0x6c')](_0x216016,_[_0x2602('0x6d')](_0x534363,function(_0x1251dd){return util[_0x2602('0x6e')](_0x2602('0x6f'),_0x1251dd['id']);}));}})[_0x2602('0x14')](handleEntityNotFound(_0x2e4db7,null))[_0x2602('0x14')](respondWithResult(_0x2e4db7,null))[_0x2602('0x21')](handleError(_0x2e4db7,null));};exports[_0x2602('0x3e')]=function(_0x39705f,_0x120f88){var _0x225edf;if(_0x39705f[_0x2602('0x38')]['id']){delete _0x39705f['body']['id'];}if(!_[_0x2602('0x53')](_0x39705f['body'][_0x2602('0x52')])){var _0x52a978=_0x39705f[_0x2602('0x38')]['dialTimezone'];if(!_[_0x2602('0x53')](shared['timezones'][_0x52a978]))_0x39705f[_0x2602('0x38')]['utcOffset']=shared[_0x2602('0x54')][_0x52a978][_0x2602('0x55')];}return db[_0x2602('0x1f')]['find']({'where':{'id':_0x39705f[_0x2602('0x61')]['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x120f88,null))[_0x2602('0x14')](saveUpdates(_0x39705f[_0x2602('0x38')],null))[_0x2602('0x14')](function(_0x15374d){_0x225edf=_0x15374d;var _0x55af77={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x15374d&&_0x15374d[_0x2602('0x5d')]){if(_0x15374d[_0x2602('0x5d')]){_0x55af77[_0x2602('0x5a')][_0x2602('0x6b')][_0x2602('0x5c')]({'ListId':{'$ne':_0x15374d[_0x2602('0x5d')]}});}}return db[_0x2602('0x29')][_0x2602('0x1b')](_0x55af77);})[_0x2602('0x14')](function(_0x5775c8){if(_0x5775c8){return _['omit'](_[_0x2602('0x70')](_0x39705f[_0x2602('0x38')],function(_0x58bc8c,_0x4e8f83){return _[_0x2602('0x25')](_0x4e8f83,_0x2602('0x2a'));}),_['map'](_0x5775c8,function(_0x1ca843){return util[_0x2602('0x6e')]('cf_%d',_0x1ca843['id']);}));}})[_0x2602('0x14')](function(_0x4af127){if(_0x4af127&&!_['isEmpty'](_0x4af127)){var _0x379f72=squel[_0x2602('0x3e')]()[_0x2602('0x71')](_0x2602('0x72'))[_0x2602('0x73')](_0x4af127)[_0x2602('0x5a')]('id\x20=\x20?',_0x39705f[_0x2602('0x61')]['id'])[_0x2602('0x74')]();return db['sequelize'][_0x2602('0x1c')](_0x379f72[_0x2602('0x75')],{'replacements':_0x379f72['values']});}})[_0x2602('0x14')](function(){if(_0x39705f[_0x2602('0x38')]['phone']&&_0x225edf){return db[_0x2602('0x39')][_0x2602('0x3e')]({'phone':_0x39705f[_0x2602('0x38')][_0x2602('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x225edf['id']}});}})[_0x2602('0x14')](function(){return _0x225edf;})[_0x2602('0x14')](respondWithResult(_0x120f88,null))[_0x2602('0x21')](handleError(_0x120f88,null));};exports[_0x2602('0x77')]=function(_0xe17458,_0x2b27b8){var _0x2bcfbf={};var _0x2a6853={};var _0x14653e;var _0x2eb00a;return db[_0x2602('0x1f')][_0x2602('0x78')]({'where':{'id':_0xe17458[_0x2602('0x61')]['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x2b27b8,null))[_0x2602('0x14')](function(_0x448aca){if(_0x448aca){_0x14653e=_0x448aca;_0x2a6853[_0x2602('0x79')]=_[_0x2602('0x23')](db[_0x2602('0x62')]['rawAttributes']);_0x2a6853[_0x2602('0x1c')]=_[_0x2602('0x23')](_0xe17458[_0x2602('0x1c')]);_0x2a6853[_0x2602('0x7a')]=_['intersection'](_0x2a6853[_0x2602('0x79')],_0x2a6853[_0x2602('0x1c')]);_0x2bcfbf[_0x2602('0x7b')]=_['intersection'](_0x2a6853[_0x2602('0x79')],qs['fields'](_0xe17458[_0x2602('0x1c')][_0x2602('0x7c')]));_0x2bcfbf[_0x2602('0x7b')]=_0x2bcfbf['attributes'][_0x2602('0x24')]?_0x2bcfbf[_0x2602('0x7b')]:_0x2a6853['model'];_0x2bcfbf[_0x2602('0x7d')]=qs[_0x2602('0x7e')](_0xe17458[_0x2602('0x1c')][_0x2602('0x7e')]);_0x2bcfbf[_0x2602('0x5a')]=qs['filters'](_[_0x2602('0x7f')](_0xe17458[_0x2602('0x1c')],_0x2a6853[_0x2602('0x7a')]));if(_0xe17458[_0x2602('0x1c')]['filter']){_0x2bcfbf[_0x2602('0x5a')]=_[_0x2602('0x80')](_0x2bcfbf[_0x2602('0x5a')],{'$or':_[_0x2602('0x6d')](_0x2bcfbf[_0x2602('0x7b')],function(_0x4e69d8){var _0x1bcd0e={};_0x1bcd0e[_0x4e69d8]={'$like':'%'+_0xe17458[_0x2602('0x1c')][_0x2602('0x81')]+'%'};return _0x1bcd0e;})});}_0x2bcfbf=_[_0x2602('0x80')]({},_0x2bcfbf,_0xe17458[_0x2602('0x82')]);return _0x14653e[_0x2602('0x77')](_0x2bcfbf);}})[_0x2602('0x14')](function(_0x382e82){if(_0x382e82){_0x2eb00a=_0x382e82['length'];if(!_0xe17458[_0x2602('0x1c')]['hasOwnProperty'](_0x2602('0x83'))){_0x2bcfbf[_0x2602('0x11')]=qs[_0x2602('0x11')](_0xe17458['query'][_0x2602('0x11')]);_0x2bcfbf[_0x2602('0x10')]=qs[_0x2602('0x10')](_0xe17458[_0x2602('0x1c')][_0x2602('0x10')]);}return _0x14653e[_0x2602('0x77')](_0x2bcfbf);}})[_0x2602('0x14')](function(_0x575b26){if(_0x575b26){return _0x575b26?{'count':_0x2eb00a,'rows':_0x575b26}:null;}})[_0x2602('0x14')](respondWithResult(_0x2b27b8,null))[_0x2602('0x21')](handleError(_0x2b27b8,null));};exports['setTags']=function(_0x590ca3,_0x48075e){if(_0x590ca3[_0x2602('0x38')]['id']){delete _0x590ca3[_0x2602('0x38')]['id'];}return db[_0x2602('0x1f')][_0x2602('0x78')]({'where':{'id':_0x590ca3[_0x2602('0x61')]['id']}})['then'](handleEntityNotFound(_0x48075e,null))[_0x2602('0x14')](function(_0x103d9d){if(_0x103d9d){return _0x103d9d[_0x2602('0x84')](_0x590ca3['body'][_0x2602('0x85')]||[]);}return null;})[_0x2602('0x14')](respondWithResult(_0x48075e,null))[_0x2602('0x21')](handleError(_0x48075e,null));};exports[_0x2602('0x86')]=function(_0x5deec1,_0x4e1423){var _0x469623=[];_0x469623[_0x2602('0x5c')](addAdditionalPhones(_0x5deec1[_0x2602('0x38')]));Promise[_0x2602('0x60')](_0x469623)[_0x2602('0x14')](function(){_0x469623=[];_0x469623[_0x2602('0x5c')](deleteCmHopperPhones(_0x5deec1[_0x2602('0x38')]['id']));_0x469623[_0x2602('0x5c')](addCmHopperPhones(_0x5deec1[_0x2602('0x38')]['id']));Promise[_0x2602('0x60')](_0x469623)[_0x2602('0x14')](function(){return[0x1];})[_0x2602('0x14')](respondWithResult(_0x4e1423,null));});};function addAdditionalPhones(_0x20daea){var _0x3eca5c;return new Promise(function(_0x28f024){return db[_0x2602('0x47')][_0x2602('0x1e')]({'where':{'CmContactId':_0x20daea['id']}})[_0x2602('0x14')](function(){db[_0x2602('0x67')]['findAll']({'raw':!![],'attributes':['id',_0x2602('0x87')]})['then'](function(_0x4b36b7){var _0x18cdef=[];for(var _0x1f6d36=0x0;_0x1f6d36<_0x20daea['items'][_0x2602('0x24')];_0x1f6d36++){var _0xa64618=_0x20daea[_0x2602('0x88')]?_[_0x2602('0x53')](_0x20daea[_0x2602('0x88')][_0x1f6d36])?'':_0x20daea[_0x2602('0x88')][_0x1f6d36]:_0x20daea[_0x2602('0x89')][_0x1f6d36][_0x2602('0x8a')]?_0x20daea['items'][_0x1f6d36]['ItemTypeId']:'';var _0x55e296=_[_0x2602('0x53')](_0x20daea[_0x2602('0x89')][_0x1f6d36]['description'])?'':_0x20daea[_0x2602('0x89')][_0x1f6d36][_0x2602('0x8b')];var _0x2680f3=_0xa64618+':'+_0x20daea[_0x2602('0x89')][_0x1f6d36]['phone']+'§'+_0x55e296;if(_['isNil'](_0x3eca5c))_0x3eca5c=_0x2680f3;else _0x3eca5c+=';'+_0x2680f3;var _0x199123=null;var _0x19260e=null;if(_0x20daea[_0x2602('0x88')]){if(!_[_0x2602('0x53')](_0x20daea['item_types'][_0x1f6d36])){_0x19260e=_[_0x2602('0x20')](_0x4b36b7,function(_0x41ab99){return _0x41ab99['id']===_0x20daea['item_types'][_0x1f6d36];});if(!_['isNil'](_0x19260e)){_0x199123=_0x19260e[_0x2602('0x87')];}}}else{if(!_['isNil'](_0x20daea[_0x2602('0x89')][_0x1f6d36])){_0x19260e=_[_0x2602('0x20')](_0x4b36b7,function(_0x2632e8){return _0x2632e8['id']===_0x20daea[_0x2602('0x89')][_0x1f6d36]['ItemTypeId'];});if(!_[_0x2602('0x53')](_0x19260e)){_0x199123=_0x1f6d36;}}}if(_[_0x2602('0x53')](_0x199123)){_0x199123=0x64;}_0x18cdef[_0x2602('0x5c')](addAdditionalPhone(_0x20daea['id'],_0x20daea[_0x2602('0x89')][_0x1f6d36][_0x2602('0x76')],_0x20daea[_0x2602('0x88')]?_[_0x2602('0x53')](_0x20daea[_0x2602('0x88')][_0x1f6d36])?null:_0x20daea['item_types'][_0x1f6d36]:_0x20daea[_0x2602('0x89')][_0x1f6d36][_0x2602('0x8a')]?_0x20daea[_0x2602('0x89')][_0x1f6d36]['ItemTypeId']:null,_0x199123,_0x55e296));}Promise[_0x2602('0x60')](_0x18cdef)[_0x2602('0x14')](function(){db[_0x2602('0x1f')][_0x2602('0x3e')]({'AdditionalPhones':_0x3eca5c},{'where':{'id':_0x20daea['id']}})[_0x2602('0x14')](function(){_0x28f024(0x1);});});});});});}function addAdditionalPhone(_0x1002ce,_0x47aa97,_0x38d57f,_0x6a668,_0x5552ca){return db[_0x2602('0x47')][_0x2602('0x20')]({'where':{'CmContactId':_0x1002ce,'item':_0x47aa97}})[_0x2602('0x14')](function(_0xdeab13){if(_0xdeab13)logger[_0x2602('0x2e')](_0x2602('0x8c'),_0xdeab13);else{db[_0x2602('0x47')][_0x2602('0x3c')]({'CmContactId':_0x1002ce,'item':_0x47aa97,'ItemTypeId':_0x38d57f,'OrderBy':_0x6a668,'ItemClass':_0x2602('0x8d'),'description':_0x5552ca});}});}function deleteCmHopperPhones(_0x2b8a2c){return new Promise(function(_0x5dc0f6){return db[_0x2602('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x2b8a2c}})[_0x2602('0x14')](function(_0x1cf637){db[_0x2602('0x8e')][_0x2602('0x1e')]({'where':{'CmHopperId':{'$in':_[_0x2602('0x6d')](_0x1cf637,'id')}}});})[_0x2602('0x14')](function(){_0x5dc0f6(0x1);});});}function addCmHopperPhones(_0x1b953f){return new Promise(function(_0x11fd74){return db[_0x2602('0x39')][_0x2602('0x1b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1b953f}})[_0x2602('0x14')](function(_0x3728b4){var _0x5d3348=[];_['map'](_0x3728b4,function(_0x54ae82){_0x5d3348['push'](createCmHopperPhone(_0x1b953f,_0x54ae82['id']));});Promise[_0x2602('0x60')](_0x5d3348)[_0x2602('0x14')](function(){_0x11fd74(0x1);});});});}function createCmHopperPhone(_0x49acae,_0x3af3ac){return new Promise(function(_0x921102){db[_0x2602('0x47')][_0x2602('0x1b')]({'raw':!![],'attributes':[_0x2602('0x8f'),_0x2602('0x87')],'where':{'CmContactId':_0x49acae,'ItemClass':_0x2602('0x8d')},'include':[{'model':db[_0x2602('0x67')],'attributes':['OrderBy'],'as':_0x2602('0x68')}],'order':['OrderBy',db[_0x2602('0x69')]['literal'](_0x2602('0x90'))]})[_0x2602('0x14')](function(_0x4f1632){var _0x51103c=0x1;var _0x3d1d60=_[_0x2602('0x6d')](_0x4f1632,function(_0x5cf545){_0x5cf545[_0x2602('0x91')]=_0x3af3ac;_0x5cf545[_0x2602('0x76')]=_0x5cf545['item'];_0x5cf545[_0x2602('0x87')]=_0x51103c;delete _0x5cf545[_0x2602('0x92')];_0x51103c=_0x51103c+0x1;return _0x5cf545;});return db[_0x2602('0x8e')][_0x2602('0x57')](_0x3d1d60,{});})['then'](function(){_0x921102(0x1);});});}function insertAdditionalPhones(_0x3891b1,_0x41086a){return new Promise(function(_0x273031){var _0x4fe2b2=[];for(var _0x2434b9=0x0;_0x2434b9<_0x41086a[_0x2602('0x24')];_0x2434b9++){var _0x24a38e=_0x41086a[_0x2434b9];_0x4fe2b2[_0x2602('0x5c')](parseContactItemType(_0x24a38e));}Promise[_0x2602('0x60')](_0x4fe2b2)[_0x2602('0x14')](function(){var _0x1ac2d2={'id':_0x3891b1['id'],'items':_0x41086a};return addAdditionalPhones(_0x1ac2d2)['then'](function(){return addCmHopperPhones(_0x3891b1['id']);});})[_0x2602('0x14')](function(){_0x273031(_0x3891b1);});});}function parseContactItemType(_0x5b2ad9){return new Promise(function(_0x1a6c47){if(_0x5b2ad9['hasOwnProperty'](_0x2602('0x8a'))){_0x1a6c47(_0x5b2ad9);}else{return db[_0x2602('0x67')][_0x2602('0x20')]({'where':{'name':_0x5b2ad9[_0x2602('0x68')]}})[_0x2602('0x14')](function(_0x3f5d5c){if(_[_0x2602('0x53')](_0x3f5d5c))_0x5b2ad9[_0x2602('0x8a')]=null;else _0x5b2ad9['ItemTypeId']=_0x3f5d5c['id'];_0x1a6c47(_0x5b2ad9);});}});}exports[_0x2602('0x93')]=function(_0x535c49,_0x2006a0){return db[_0x2602('0x47')]['findAll']({'raw':!![],'where':{'CmContactId':_0x535c49[_0x2602('0x61')]['id'],'ItemClass':_0x2602('0x8d')},'include':[{'model':db[_0x2602('0x67')],'as':_0x2602('0x68')}],'order':[[_0x2602('0x87')],[db['sequelize'][_0x2602('0x94')]('`ItemType`.OrderBy')]]})[_0x2602('0x14')](function(_0x37cfb1){return _0x37cfb1;})['then'](respondWithResult(_0x2006a0,null))[_0x2602('0x21')](handleError(_0x2006a0,null));};exports['duplicateAdditionalPhones']=function(_0x565b02,_0x377eb7){return db['CmContactHasItem'][_0x2602('0x1b')]({'raw':!![],'where':{'CmContactId':_0x565b02[_0x2602('0x38')][_0x2602('0x95')]}})[_0x2602('0x14')](function(_0x28e8bf){var _0x2aeedb=_[_0x2602('0x6d')](_0x28e8bf,function(_0x5ef28f){_0x5ef28f['CmContactId']=_0x565b02[_0x2602('0x38')][_0x2602('0x96')];return _0x5ef28f;});return db[_0x2602('0x47')][_0x2602('0x57')](_0x2aeedb,{});})[_0x2602('0x14')](function(){return addCmHopperPhones(_0x565b02[_0x2602('0x38')]['toContactId']);})['then'](function(){return['ok'];})[_0x2602('0x14')](respondWithResult(_0x377eb7,null))[_0x2602('0x21')](handleError(_0x377eb7,null));};exports[_0x2602('0x97')]=function(_0x11af13,_0x10c2e1){var _0x1327f9=[];_0x1327f9[_0x2602('0x5c')](createCmHopperPhone(_0x11af13[_0x2602('0x38')]['id'],_0x11af13[_0x2602('0x38')][_0x2602('0x98')]));Promise[_0x2602('0x60')](_0x1327f9)[_0x2602('0x14')](function(){return[0x1];})['then'](respondWithResult(_0x10c2e1,null));};exports[_0x2602('0x99')]=function(_0x1ddf68,_0x42a932){var _0x1eedbe={'raw':![],'where':{}};var _0x398440={};var _0x545d90={'count':0x0,'rows':[]};return db['CmContact'][_0x2602('0x78')]({'where':{'id':_0x1ddf68['params']['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x42a932,null))[_0x2602('0x14')](function(_0x25c9e9){if(_0x25c9e9){_0x398440['model']=_[_0x2602('0x23')](db[_0x2602('0x39')][_0x2602('0x9a')]);_0x398440[_0x2602('0x1c')]=_['keys'](_0x1ddf68[_0x2602('0x1c')]);_0x398440[_0x2602('0x7a')]=_[_0x2602('0x9b')](_0x398440['model'],_0x398440[_0x2602('0x1c')]);_0x1eedbe['attributes']=_['intersection'](_0x398440[_0x2602('0x79')],qs[_0x2602('0x7c')](_0x1ddf68[_0x2602('0x1c')][_0x2602('0x7c')]));_0x1eedbe[_0x2602('0x7b')]=_0x1eedbe[_0x2602('0x7b')][_0x2602('0x24')]?_0x1eedbe[_0x2602('0x7b')]:_0x398440[_0x2602('0x79')];if(!_0x1ddf68[_0x2602('0x1c')][_0x2602('0x31')](_0x2602('0x83'))){_0x1eedbe[_0x2602('0x11')]=qs[_0x2602('0x11')](_0x1ddf68[_0x2602('0x1c')][_0x2602('0x11')]);_0x1eedbe[_0x2602('0x10')]=qs[_0x2602('0x10')](_0x1ddf68['query'][_0x2602('0x10')]);}_0x1eedbe['order']=qs[_0x2602('0x7e')](_0x1ddf68['query']['sort']);_0x1eedbe[_0x2602('0x5a')]=qs[_0x2602('0x7a')](_[_0x2602('0x7f')](_0x1ddf68[_0x2602('0x1c')],_0x398440[_0x2602('0x7a')]));_0x1eedbe[_0x2602('0x5a')][_0x2602('0x9c')]=_0x25c9e9['id'];if(_0x1ddf68[_0x2602('0x1c')]['filter']){_0x1eedbe[_0x2602('0x5a')]=_[_0x2602('0x80')](_0x1eedbe[_0x2602('0x5a')],{'$or':_['map'](_0x1eedbe[_0x2602('0x7b')],function(_0x1a17df){var _0x347f28={};_0x347f28[_0x1a17df]={'$like':'%'+_0x1ddf68['query'][_0x2602('0x81')]+'%'};return _0x347f28;})});}_0x1eedbe=_[_0x2602('0x80')]({},_0x1eedbe,_0x1ddf68['options']);return db['CmHopper'][_0x2602('0x12')]({'where':_0x1eedbe[_0x2602('0x5a')]})[_0x2602('0x14')](function(_0x10f8ef){_0x545d90[_0x2602('0x12')]=_0x10f8ef;if(_0x1ddf68[_0x2602('0x1c')][_0x2602('0x9d')]){_0x1eedbe['include']=[{'all':!![]}];}return db['CmHopper'][_0x2602('0x1b')](_0x1eedbe);})[_0x2602('0x14')](function(_0x3d8700){_0x545d90[_0x2602('0x9e')]=_0x3d8700;return _0x545d90;});}})[_0x2602('0x14')](respondWithFilteredResult(_0x42a932,_0x1eedbe))['catch'](handleError(_0x42a932,null));};exports[_0x2602('0x9f')]=function(_0x207ac7,_0x53abee){var _0x50e8a3={'raw':!![],'where':{}};var _0x429acb={};var _0x3910ad={'count':0x0,'rows':[]};return db[_0x2602('0x1f')][_0x2602('0x78')]({'where':{'id':_0x207ac7[_0x2602('0x61')]['id']}})['then'](handleEntityNotFound(_0x53abee,null))[_0x2602('0x14')](function(_0x5e823c){if(_0x5e823c){_0x429acb[_0x2602('0x79')]=_[_0x2602('0x23')](db[_0x2602('0x49')][_0x2602('0x9a')]);_0x429acb[_0x2602('0x1c')]=_[_0x2602('0x23')](_0x207ac7[_0x2602('0x1c')]);_0x429acb[_0x2602('0x7a')]=_[_0x2602('0x9b')](_0x429acb['model'],_0x429acb[_0x2602('0x1c')]);_0x50e8a3[_0x2602('0x7b')]=_[_0x2602('0x9b')](_0x429acb[_0x2602('0x79')],qs[_0x2602('0x7c')](_0x207ac7[_0x2602('0x1c')][_0x2602('0x7c')]));_0x50e8a3[_0x2602('0x7b')]=_0x50e8a3[_0x2602('0x7b')]['length']?_0x50e8a3[_0x2602('0x7b')]:_0x429acb[_0x2602('0x79')];if(!_0x207ac7[_0x2602('0x1c')][_0x2602('0x31')](_0x2602('0x83'))){_0x50e8a3['limit']=qs['limit'](_0x207ac7[_0x2602('0x1c')][_0x2602('0x11')]);_0x50e8a3[_0x2602('0x10')]=qs[_0x2602('0x10')](_0x207ac7[_0x2602('0x1c')][_0x2602('0x10')]);}_0x50e8a3[_0x2602('0x7d')]=qs[_0x2602('0x7e')](_0x207ac7[_0x2602('0x1c')][_0x2602('0x7e')]);_0x50e8a3['where']=qs[_0x2602('0x7a')](_[_0x2602('0x7f')](_0x207ac7[_0x2602('0x1c')],_0x429acb[_0x2602('0x7a')]));_0x50e8a3[_0x2602('0x5a')][_0x2602('0x9c')]=_0x5e823c['id'];if(_0x207ac7['query'][_0x2602('0x81')]){_0x50e8a3['where']=_['merge'](_0x50e8a3[_0x2602('0x5a')],{'$or':_['map'](_0x50e8a3[_0x2602('0x7b')],function(_0x4c6cfa){var _0x30b25d={};_0x30b25d[_0x4c6cfa]={'$like':'%'+_0x207ac7[_0x2602('0x1c')]['filter']+'%'};return _0x30b25d;})});}_0x50e8a3=_[_0x2602('0x80')]({},_0x50e8a3,_0x207ac7[_0x2602('0x82')]);return db[_0x2602('0x49')][_0x2602('0x12')]({'where':_0x50e8a3[_0x2602('0x5a')]})[_0x2602('0x14')](function(_0x1abe3a){_0x3910ad[_0x2602('0x12')]=_0x1abe3a;if(_0x207ac7['query'][_0x2602('0x9d')]){_0x50e8a3[_0x2602('0xa0')]=[{'all':!![]}];}return db[_0x2602('0x49')][_0x2602('0x1b')](_0x50e8a3);})[_0x2602('0x14')](function(_0x552e3e){_0x3910ad['rows']=_0x552e3e;return _0x3910ad;});}})['then'](respondWithFilteredResult(_0x53abee,_0x50e8a3))['catch'](handleError(_0x53abee,null));};exports[_0x2602('0xa1')]=function(_0x3b18fb,_0x4ee8f9){var _0x438162={'raw':!![],'where':{}};var _0x4984ab={};var _0x1984a8={'count':0x0,'rows':[]};return db[_0x2602('0x1f')][_0x2602('0x78')]({'where':{'id':_0x3b18fb[_0x2602('0x61')]['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x4ee8f9,null))[_0x2602('0x14')](function(_0x58924c){if(_0x58924c){_0x4984ab[_0x2602('0x79')]=_[_0x2602('0x23')](db[_0x2602('0x48')]['rawAttributes']);_0x4984ab[_0x2602('0x1c')]=_['keys'](_0x3b18fb[_0x2602('0x1c')]);_0x4984ab[_0x2602('0x7a')]=_[_0x2602('0x9b')](_0x4984ab[_0x2602('0x79')],_0x4984ab[_0x2602('0x1c')]);_0x438162[_0x2602('0x7b')]=_[_0x2602('0x9b')](_0x4984ab[_0x2602('0x79')],qs[_0x2602('0x7c')](_0x3b18fb[_0x2602('0x1c')][_0x2602('0x7c')]));_0x438162[_0x2602('0x7b')]=_0x438162[_0x2602('0x7b')][_0x2602('0x24')]?_0x438162[_0x2602('0x7b')]:_0x4984ab[_0x2602('0x79')];if(!_0x3b18fb[_0x2602('0x1c')]['hasOwnProperty'](_0x2602('0x83'))){_0x438162['limit']=qs[_0x2602('0x11')](_0x3b18fb['query'][_0x2602('0x11')]);_0x438162[_0x2602('0x10')]=qs['offset'](_0x3b18fb['query']['offset']);}_0x438162[_0x2602('0x7d')]=qs['sort'](_0x3b18fb[_0x2602('0x1c')][_0x2602('0x7e')]);_0x438162[_0x2602('0x5a')]=qs['filters'](_[_0x2602('0x7f')](_0x3b18fb['query'],_0x4984ab['filters']));_0x438162['where']['ContactId']=_0x58924c['id'];if(_0x3b18fb['query'][_0x2602('0x81')]){_0x438162['where']=_[_0x2602('0x80')](_0x438162[_0x2602('0x5a')],{'$or':_[_0x2602('0x6d')](_0x438162[_0x2602('0x7b')],function(_0x59e8c4){var _0x3a926c={};_0x3a926c[_0x59e8c4]={'$like':'%'+_0x3b18fb[_0x2602('0x1c')][_0x2602('0x81')]+'%'};return _0x3a926c;})});}_0x438162=_[_0x2602('0x80')]({},_0x438162,_0x3b18fb[_0x2602('0x82')]);return db[_0x2602('0x48')][_0x2602('0x12')]({'where':_0x438162[_0x2602('0x5a')]})[_0x2602('0x14')](function(_0x18be66){_0x1984a8[_0x2602('0x12')]=_0x18be66;if(_0x3b18fb[_0x2602('0x1c')][_0x2602('0x9d')]){_0x438162['include']=[{'all':!![]}];}return db[_0x2602('0x48')][_0x2602('0x1b')](_0x438162);})['then'](function(_0x4a0f5b){_0x1984a8[_0x2602('0x9e')]=_0x4a0f5b;return _0x1984a8;});}})[_0x2602('0x14')](respondWithFilteredResult(_0x4ee8f9,_0x438162))[_0x2602('0x21')](handleError(_0x4ee8f9,null));};exports[_0x2602('0xa2')]=function(_0x46e556,_0x3743ee){var _0x4aab3d={'raw':!![],'where':{}};var _0x1c379a={};var _0x26d9e9={'count':0x0,'rows':[]};return db[_0x2602('0x1f')][_0x2602('0x78')]({'where':{'id':_0x46e556[_0x2602('0x61')]['id']}})[_0x2602('0x14')](handleEntityNotFound(_0x3743ee,null))[_0x2602('0x14')](function(_0x2ea906){if(_0x2ea906){_0x1c379a[_0x2602('0x79')]=_['keys'](db['JscriptySessionReport'][_0x2602('0x9a')]);_0x1c379a[_0x2602('0x1c')]=_['keys'](_0x46e556[_0x2602('0x1c')]);_0x1c379a['filters']=_['intersection'](_0x1c379a[_0x2602('0x79')],_0x1c379a[_0x2602('0x1c')]);_0x4aab3d[_0x2602('0x7b')]=_[_0x2602('0x9b')](_0x1c379a['model'],qs[_0x2602('0x7c')](_0x46e556[_0x2602('0x1c')][_0x2602('0x7c')]));_0x4aab3d['attributes']=_0x4aab3d[_0x2602('0x7b')][_0x2602('0x24')]?_0x4aab3d[_0x2602('0x7b')]:_0x1c379a[_0x2602('0x79')];if(!_0x46e556['query'][_0x2602('0x31')](_0x2602('0x83'))){_0x4aab3d[_0x2602('0x11')]=qs['limit'](_0x46e556['query'][_0x2602('0x11')]);_0x4aab3d[_0x2602('0x10')]=qs[_0x2602('0x10')](_0x46e556[_0x2602('0x1c')][_0x2602('0x10')]);}_0x4aab3d[_0x2602('0x7d')]=qs[_0x2602('0x7e')](_0x46e556[_0x2602('0x1c')][_0x2602('0x7e')]);_0x4aab3d[_0x2602('0x5a')]=qs[_0x2602('0x7a')](_['pick'](_0x46e556[_0x2602('0x1c')],_0x1c379a[_0x2602('0x7a')]));_0x4aab3d[_0x2602('0x5a')][_0x2602('0x9c')]=_0x2ea906['id'];if(_0x46e556[_0x2602('0x1c')][_0x2602('0x81')]){_0x4aab3d['where']=_[_0x2602('0x80')](_0x4aab3d[_0x2602('0x5a')],{'$or':_[_0x2602('0x6d')](_0x4aab3d[_0x2602('0x7b')],function(_0x3b0f2d){var _0x28cd1a={};_0x28cd1a[_0x3b0f2d]={'$like':'%'+_0x46e556['query'][_0x2602('0x81')]+'%'};return _0x28cd1a;})});}_0x4aab3d=_['merge']({},_0x4aab3d,_0x46e556[_0x2602('0x82')]);return db[_0x2602('0x4e')][_0x2602('0x12')]({'where':_0x4aab3d[_0x2602('0x5a')]})[_0x2602('0x14')](function(_0x14bde0){_0x26d9e9['count']=_0x14bde0;if(_0x46e556[_0x2602('0x1c')][_0x2602('0x9d')]){_0x4aab3d[_0x2602('0xa0')]=[{'all':!![]}];}return db[_0x2602('0x4e')]['findAll'](_0x4aab3d);})[_0x2602('0x14')](function(_0x20b334){_0x26d9e9[_0x2602('0x9e')]=_0x20b334;return _0x26d9e9;});}})[_0x2602('0x14')](respondWithFilteredResult(_0x3743ee,_0x4aab3d))['catch'](handleError(_0x3743ee,null));};exports[_0x2602('0xa3')]=function(_0x51de0c,_0x1f4de6){try{if(!_0x51de0c[_0x2602('0x38')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x51de0c['body'][_0x2602('0xa4')]){throw new Error(_0x2602('0xa5'));}if(!_0x51de0c[_0x2602('0x38')][_0x2602('0xa6')]){throw new Error(_0x2602('0xa7'));}if(!_0x51de0c[_0x2602('0x38')][_0x2602('0xa8')]){throw new Error(_0x2602('0xa9'));}var _0x4c420c=_0x51de0c['body'][_0x2602('0xa4')][_0x2602('0xaa')](',');var _0x17c2b3=_0x51de0c[_0x2602('0x38')][_0x2602('0xa6')][_0x2602('0xaa')](',');if(!_0x4c420c[_0x2602('0x24')]||!_0x17c2b3[_0x2602('0x24')]||_0x4c420c[_0x2602('0x24')]!==_0x17c2b3['length']){throw new Error(_0x2602('0xab'));}_0x51de0c['body']['fields']=_[_0x2602('0xac')](_0x4c420c,_0x17c2b3);if(!_0x51de0c[_0x2602('0x38')]['fields'][_0x2602('0x76')]){throw new Error(_0x2602('0xad'));}if(!_0x51de0c[_0x2602('0x38')][_0x2602('0x7c')][_0x2602('0xae')]){throw new Error(_0x2602('0xaf'));}var _0xe99a6b=path[_0x2602('0x36')](config[_0x2602('0xb0')],_0x2602('0xb1'),_0x51de0c[_0x2602('0xb2')][_0x2602('0xb3')]);fs[_0x2602('0xb4')](_0xe99a6b,parseInt(_0x2602('0xb5'),0x8));var _0x5e13cc=require('child_process')[_0x2602('0xb6')](path[_0x2602('0x36')](__dirname,_0x2602('0xb7')),[_0xe99a6b,_0x51de0c[_0x2602('0x38')][_0x2602('0xa4')],_0x51de0c[_0x2602('0x38')][_0x2602('0xa6')],_0x51de0c[_0x2602('0x38')][_0x2602('0x5d')],_0x51de0c[_0x2602('0x38')][_0x2602('0xb8')],_0x51de0c[_0x2602('0x38')][_0x2602('0x59')],_0x51de0c[_0x2602('0x38')][_0x2602('0xa8')]]);return _0x1f4de6[_0x2602('0xf')](0xc8)[_0x2602('0x13')]({'message':_0x2602('0xb9'),'pid':_0x5e13cc[_0x2602('0xba')]});}catch(_0x2e1074){return _0x1f4de6[_0x2602('0xf')](0x1f4)[_0x2602('0x18')](_0x2e1074);}};exports[_0x2602('0xbb')]=function(_0x174ac9,_0x1c7240){var _0x40cb98=fs[_0x2602('0xbc')](_0x174ac9[_0x2602('0xb2')]['path']);Papa[_0x2602('0xbd')](_0x40cb98,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x154754){return _0x1c7240['status'](0xc8)['json']({'file':_0x174ac9['file'],'fields':_0x154754[_0x2602('0xbe')][_0x2602('0x7c')]});}});};exports[_0x2602('0xbf')]=function(_0x3734cd,_0x4ff176){return db[_0x2602('0xc0')][_0x2602('0x1b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x2602('0xc1')}})[_0x2602('0x14')](function(_0x4d4f2b){var _0x3a13eb=![];if(!_0x3734cd[_0x2602('0x38')][_0x2602('0x5d')]){throw new Error(_0x2602('0xc2'));}if(!_0x3734cd[_0x2602('0x38')]['binding'][_0x2602('0x76')]){throw new Error(_0x2602('0xad'));}if(!_0x3734cd[_0x2602('0x38')]['binding'][_0x2602('0xae')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x3734cd[_0x2602('0x38')]['socket_timestamp']){throw new Error(_0x2602('0xa9'));}var _0x1dd218=require(_0x2602('0xc3'))['fork'](path['join'](__dirname,_0x2602('0xc4')),[_0x3734cd[_0x2602('0x61')]['id'],JSON[_0x2602('0xc5')](_0x3734cd[_0x2602('0x38')]),JSON[_0x2602('0xc5')](_0x4d4f2b)]);_0x1dd218['on'](_0x2602('0xc6'),function(){_0x3a13eb=!![];return _0x4ff176[_0x2602('0xf')](0xc8)[_0x2602('0x13')]({'message':_0x2602('0xc7'),'pid':_0x1dd218[_0x2602('0xba')]});});_0x1dd218['on'](_0x2602('0xc8'),function(_0xd2dbc0){if(_0xd2dbc0&&!_0x3a13eb){return _0x4ff176[_0x2602('0xf')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x1dd218[_0x2602('0xba')]});}});})['catch'](handleError(_0x4ff176,null));};exports[_0x2602('0xc9')]=function(_0x3113ee,_0x4c02b9){return db['User'][_0x2602('0x1b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x2602('0xc1')}})[_0x2602('0x14')](function(_0x2382d8){var _0x428f31=![];if(!_0x3113ee['body'][_0x2602('0x5d')]){throw new Error('No\x20ListId\x20specified');}if(!_0x3113ee['body'][_0x2602('0xca')][_0x2602('0x76')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x3113ee[_0x2602('0x38')][_0x2602('0xca')]['firstName']){throw new Error(_0x2602('0xaf'));}if(!_0x3113ee[_0x2602('0x38')][_0x2602('0xa8')]){throw new Error(_0x2602('0xa9'));}var _0x4f044e=require(_0x2602('0xc3'))['fork'](path[_0x2602('0x36')](__dirname,_0x2602('0xcb')),[_0x3113ee['params']['id'],JSON['stringify'](_0x3113ee[_0x2602('0x38')]),JSON[_0x2602('0xc5')](_0x2382d8)]);_0x4f044e['on'](_0x2602('0xc6'),function(){_0x428f31=!![];return _0x4c02b9[_0x2602('0xf')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x4f044e[_0x2602('0xba')]});});_0x4f044e['on'](_0x2602('0xc8'),function(_0x37cdab){if(_0x37cdab&&!_0x428f31){return _0x4c02b9['status'](0x1f4)[_0x2602('0x13')]({'message':_0x2602('0xcc'),'pid':_0x4f044e[_0x2602('0xba')]});}});})[_0x2602('0x21')](handleError(_0x4c02b9,null));};exports[_0x2602('0xcd')]=function(_0x5ce93e,_0x35ed3b){var _0xd99280=['mail',_0x2602('0xce'),_0x2602('0xcf'),_0x2602('0xd0'),_0x2602('0xd1'),'whatsapp',_0x2602('0xd2')];var _0x45fe39={'offset':0x0,'order':qs['sort'](_0x2602('0xd3'))},_0x191df7={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(_0x5ce93e['query'][_0x2602('0xd4')]){if(!_['includes'](_0xd99280,_0x5ce93e[_0x2602('0x1c')][_0x2602('0xd4')]['toLowerCase']())){throw new Error(_0x2602('0xd5'));}_0xd99280=[_0x5ce93e['query'][_0x2602('0xd4')]['toLowerCase']()];}if(_0x5ce93e[_0x2602('0x1c')][_0x2602('0xd6')]){try{var _0x50690b=JSON['parse'](_0x5ce93e[_0x2602('0x1c')]['range']);if(!moment(_0x50690b[_0x2602('0x32')])[_0x2602('0xd7')]()){throw new Error(_0x2602('0xd8'));}if(!moment(_0x50690b['to'])[_0x2602('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x46cc31){throw new Error(_0x2602('0xd9'));}}if(!_0x5ce93e[_0x2602('0x1c')][_0x2602('0x31')](_0x2602('0x83'))){_0x45fe39[_0x2602('0x11')]=qs[_0x2602('0x11')](_0x5ce93e[_0x2602('0x1c')][_0x2602('0x11')]||0xa);_0x45fe39['offset']=qs[_0x2602('0x10')](_0x5ce93e[_0x2602('0x1c')][_0x2602('0x10')]);}var _0x2bc04a=_0xd99280[_0x2602('0x6d')](function(_0x202603){if(_0x202603===_0x2602('0xd2')){var _0x3eb873={'attributes':['id',_0x2602('0xda'),_0x2602('0x2c'),'source',_0x2602('0xdb'),'callerid',_0x2602('0xdc'),_0x2602('0xdd'),_0x2602('0xde'),_0x2602('0xdf'),'createdAt',_0x2602('0xe0'),_0x2602('0xe1'),'userThirdDisposition',_0x2602('0xe2')],'where':{'ContactId':_0x5ce93e['params']['id']},'include':[{'model':db[_0x2602('0xc0')],'as':_0x2602('0xc0'),'attributes':['id',_0x2602('0x17'),'fullname',_0x2602('0xe3')]}],'order':[[_0x2602('0xe4'),_0x2602('0xe5')]]};if(_0x5ce93e['query'][_0x2602('0xd6')]){_0x3eb873[_0x2602('0x5a')][_0x2602('0xe4')]={'$gte':_0x50690b[_0x2602('0x32')],'$lte':_0x50690b['to']};}return db[_0x2602('0x4a')][_0x2602('0xe6')](_0x3eb873)['then'](function(_0x431af5){_0x191df7['count']+=_0x431af5[_0x2602('0x12')];return _[_0x2602('0x6d')](_0x431af5[_0x2602('0x9e')],function(_0x1e80e8){var _0x332936=_0x1e80e8[_0x2602('0x33')]({'plain':!![]});_0x332936[_0x2602('0xd4')]=_0x202603;if(_0x332936['User']){_0x332936[_0x2602('0xc0')]={'id':_0x332936[_0x2602('0xc0')]['id'],'name':_0x332936[_0x2602('0xc0')][_0x2602('0x17')],'fullname':_0x332936[_0x2602('0xc0')][_0x2602('0xe7')],'alias':_0x332936[_0x2602('0xc0')][_0x2602('0xe3')]};}return _0x332936;});});}else{var _0x341340=_[_0x2602('0xe8')](_0x202603)+(_0x202603==='chat'?_0x2602('0xe9'):'Account');var _0x5953fb={'attributes':['id',_0x2602('0xea'),_0x2602('0xeb'),'createdAt',_0x2602('0xdf'),_0x2602('0xec'),_0x2602('0xed'),_0x2602('0xee'),_0x2602('0xe2'),_0x341340+'Id'],'where':{'ContactId':_0x5ce93e['params']['id']},'include':[{'model':db[_0x341340],'as':_0x2602('0xef'),'attributes':['id','name',_0x2602('0xf0')]},{'model':db[_0x2602('0xc0')],'as':'Owner','attributes':['id',_0x2602('0x17'),_0x2602('0xe7')]},{'model':db[_0x2602('0x62')],'as':_0x2602('0x63'),'attributes':['id','name',_0x2602('0x64')],'through':{'attributes':[]}}],'order':[[_0x2602('0xe4'),_0x2602('0xe5')]]};if(_0x5ce93e[_0x2602('0x1c')]['range']){_0x5953fb['where'][_0x2602('0xe4')]={'$gte':_0x50690b['from'],'$lte':_0x50690b['to']};}switch(_0x202603){case'chat':_0x5953fb['attributes'][_0x2602('0x5c')](_0x2602('0xf1'),_0x2602('0xf2'),_0x2602('0xf3'),'deviceModel',_0x2602('0xf4'),_0x2602('0xf5'),_0x2602('0xf6'),_0x2602('0xf7'),_0x2602('0xf8'));break;case _0x2602('0xf9'):_0x5953fb[_0x2602('0x7b')][_0x2602('0x5c')]('subject','substatus');break;case _0x2602('0xd0'):_0x5953fb[_0x2602('0x7b')][_0x2602('0x5c')](_0x2602('0xfa'),'threadId');break;}return db[_[_0x2602('0xe8')](_0x202603)+_0x2602('0xfb')][_0x2602('0xe6')](_0x5953fb)[_0x2602('0x14')](function(_0x2b3a48){_0x191df7[_0x2602('0x12')]+=_0x2b3a48[_0x2602('0x12')];return _[_0x2602('0x6d')](_0x2b3a48[_0x2602('0x9e')],function(_0x4d3acf){var _0x11e4e4=_0x4d3acf[_0x2602('0x33')]({'plain':!![]});_0x11e4e4[_0x2602('0xd4')]=_0x202603;if(_0x11e4e4[_0x2602('0xfc')]){_0x11e4e4['Owner']={'id':_0x11e4e4[_0x2602('0xfc')]['id'],'name':_0x11e4e4[_0x2602('0xfc')]['name'],'fullname':_0x11e4e4[_0x2602('0xfc')][_0x2602('0xe7')]};}return _0x11e4e4;});});}});return Promise['all'](_0x2bc04a);})['then'](function(_0x5c5378){return _(_0x5c5378)[_0x2602('0xfd')]()[_0x2602('0xfe')]('createdAt')[_0x2602('0xff')]()['value']();})['then'](function(_0xc3674){_0x191df7[_0x2602('0x9e')]=_0x45fe39[_0x2602('0x11')]?_0xc3674[_0x2602('0x100')](_0x45fe39[_0x2602('0x10')],_0x45fe39[_0x2602('0x10')]+_0x45fe39[_0x2602('0x11')]):_0xc3674;return _0x191df7;})[_0x2602('0x14')](respondWithFilteredResult(_0x35ed3b,_0x45fe39))[_0x2602('0x21')](handleError(_0x35ed3b,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 5965584..6c1a68e 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 _0xc16b=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x126786,_0x14eef2){var _0x3d061a=function(_0x4f521c){while(--_0x4f521c){_0x126786['push'](_0x126786['shift']());}};_0x3d061a(++_0x14eef2);}(_0xc16b,0x125));var _0xbc16=function(_0x5a1c3e,_0x4ccf1b){_0x5a1c3e=_0x5a1c3e-0x0;var _0x391ad9=_0xc16b[_0x5a1c3e];return _0x391ad9;};'use strict';var EventEmitter=require(_0xbc16('0x0'));var CmContact=require(_0xbc16('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xbc16('0x2')](0x0);var events={'afterCreate':_0xbc16('0x3'),'afterUpdate':'update','afterDestroy':_0xbc16('0x4')};function emitEvent(_0x5aadb2){return function(_0x206d4d,_0x520b5c,_0x5bdfc5){CmContactEvents['emit'](_0x5aadb2+':'+_0x206d4d['id'],_0x206d4d);CmContactEvents[_0xbc16('0x5')](_0x5aadb2,_0x206d4d);_0x5bdfc5(null);};}for(var e in events){if(events[_0xbc16('0x6')](e)){var event=events[e];CmContact[_0xbc16('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0x1133=['exports','events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1a82bd,_0x46d8a6){var _0x18e8d0=function(_0x5a4118){while(--_0x5a4118){_0x1a82bd['push'](_0x1a82bd['shift']());}};_0x18e8d0(++_0x46d8a6);}(_0x1133,0x105));var _0x3113=function(_0x217279,_0x2a3028){_0x217279=_0x217279-0x0;var _0x4922c7=_0x1133[_0x217279];return _0x4922c7;};'use strict';var EventEmitter=require(_0x3113('0x0'));var CmContact=require(_0x3113('0x1'))['db'][_0x3113('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3113('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3113('0x4'),'afterDestroy':_0x3113('0x5')};function emitEvent(_0x348215){return function(_0x1bea07,_0x34c929,_0x32614b){CmContactEvents['emit'](_0x348215+':'+_0x1bea07['id'],_0x1bea07);CmContactEvents[_0x3113('0x6')](_0x348215,_0x1bea07);_0x32614b(null);};}for(var e in events){if(events[_0x3113('0x7')](e)){var event=events[e];CmContact[_0x3113('0x8')](e,emitEvent(event));}}module[_0x3113('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 83a3310..e6d22d7 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 _0x4591=['[CmContact][afterDestroy][Succesfull]','inspect','catch','[CmContact][afterDestroy][Error]','lodash','../../config/logger','api','moment','./cmContact.attributes','Campaign','VoiceQueue','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','resolve','priority','callbackUniqueid','phone','assign','CmHopper','then','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','VoiceQueueId','CampaignId','create','always','findAll','outbound','CmList','ListId','map','dialCheckDuplicateType','Lists','all','CmHopperBlack','BlackLists','exports','define','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','models','get','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','error','[cmContact][afterCreate]','message','length','destroy','push','info'];(function(_0x3abde4,_0x4076e2){var _0x96f3cc=function(_0x1c3b55){while(--_0x1c3b55){_0x3abde4['push'](_0x3abde4['shift']());}};_0x96f3cc(++_0x4076e2);}(_0x4591,0xfc));var _0x1459=function(_0x379b5e,_0x5e105c){_0x379b5e=_0x379b5e-0x0;var _0x3b66a4=_0x4591[_0x379b5e];return _0x3b66a4;};'use strict';var _=require(_0x1459('0x0'));var util=require('util');var logger=require(_0x1459('0x1'))(_0x1459('0x2'));var moment=require(_0x1459('0x3'));var shared=require('../../config/environment/shared');var attributes=require(_0x1459('0x4'));function getTimezoneCallbackAt(_0x4b3f4b,_0x1fa828,_0xac82e9,_0x291074){var _0x400e4d=_0x291074?_0x1459('0x5'):_0x1459('0x6');var _0x4ffc95=_0xac82e9[_0x1459('0x7')]?_0xac82e9[_0x1459('0x7')]:moment()[_0x1459('0x8')](_0x1459('0x9'));if(_[_0x1459('0xa')](_0xac82e9[_0x1459('0xb')])){return Promise['resolve'](_0x4ffc95);}return _0x4b3f4b[_0x400e4d][_0x1459('0xc')]({'where':{'id':_0x1fa828}})['then'](function(_0xc9e729){if(_[_0x1459('0xa')](_0xc9e729)||_[_0x1459('0xa')](_0xc9e729['dialTimezone'])){return Promise['resolve'](_0x4ffc95);}var _0x5dba79=shared[_0x1459('0xd')];var _0xab17b=_0x5dba79[_0xc9e729[_0x1459('0xb')]];var _0x553175=_0x5dba79[_0xac82e9['dialTimezone']];if(_[_0x1459('0xa')](_0xab17b)&&_[_0x1459('0xa')](_0x553175)){return Promise['resolve'](_0x4ffc95);}var _0x3ce9d6=_0xab17b[_0x1459('0xe')]-_0x553175[_0x1459('0xe')];var _0x2b7977=_0xac82e9[_0x1459('0x7')]?_0xac82e9[_0x1459('0x7')]:moment();_0x4ffc95=moment(_0x2b7977)[_0x1459('0xf')](_0x3ce9d6,'minutes')[_0x1459('0x8')](_0x1459('0x9'));return Promise[_0x1459('0x10')](_0x4ffc95);});}function getNewHopperPayload(_0x4f7052){return{'phone':_0x4f7052['phone'],'ContactId':_0x4f7052['id'],'ListId':_0x4f7052['ListId'],'scheduledat':_0x4f7052[_0x1459('0x7')]?_0x4f7052['scheduledat']:moment()[_0x1459('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4f7052[_0x1459('0x11')]?_0x4f7052[_0x1459('0x11')]:0x2,'callback':_0x4f7052[_0x1459('0x12')]?!![]:![],'callbackuniqueid':_0x4f7052['callbackUniqueid']?_0x4f7052[_0x1459('0x12')]:undefined,'callbackat':_0x4f7052['callbackUniqueid']?moment()[_0x1459('0x8')]('YYYY-MM-DD\x20HH:mm:ss'):undefined};}function handleAlwaysCheckDuplicate(_0x44dc9d,_0x886800,_0x46c6f8,_0x31eb70){var _0x4c6247={'phone':_0x46c6f8[_0x1459('0x13')]};var _0x2ebc88={'calleridnum':_0x46c6f8[_0x1459('0x13')]};if(_0x31eb70){Object[_0x1459('0x14')](_0x4c6247,{'CampaignId':_0x886800['id']});Object[_0x1459('0x14')](_0x2ebc88,{'CampaignId':_0x886800['id']});}else{Object['assign'](_0x4c6247,{'VoiceQueueId':_0x886800['id']});Object[_0x1459('0x14')](_0x2ebc88,{'VoiceQueueId':_0x886800['id']});}return _0x44dc9d[_0x1459('0x15')][_0x1459('0xc')]({'where':_0x4c6247})[_0x1459('0x16')](function(_0x1138ad){if(_0x1138ad){throw new Error(_0x1459('0x17')+_0x46c6f8[_0x1459('0x13')]+_0x1459('0x18')+_0x886800['id']);}return _0x44dc9d[_0x1459('0x19')][_0x1459('0xc')]({'where':_0x2ebc88});})['then'](function(_0x1596b3){if(_0x1596b3){throw new Error(_0x1459('0x1a')+_0x46c6f8['phone']+_0x1459('0x18')+_0x886800['id']);}var _0x12e85f=getNewHopperPayload(_0x46c6f8);if(_0x31eb70){_0x12e85f['CampaignId']=_0x886800['id'];}else{_0x12e85f[_0x1459('0x1b')]=_0x886800['id'];}return _0x44dc9d['CmHopper']['create'](_0x12e85f);});}function handleOnlyIfOpenCheckDuplicate(_0x112b14,_0xfb92a6,_0x24d7de,_0xa9ce73){var _0x27273b={'phone':_0x24d7de[_0x1459('0x13')]};if(_0xa9ce73){Object[_0x1459('0x14')](_0x27273b,{'CampaignId':_0xfb92a6['id']});}else{Object['assign'](_0x27273b,{'VoiceQueueId':_0xfb92a6['id']});}return _0x112b14[_0x1459('0x15')]['findOne']({'where':_0x27273b})['then'](function(_0x374aa5){if(_0x374aa5){throw new Error('[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x24d7de[_0x1459('0x13')]+_0x1459('0x18')+_0xfb92a6['id']);}var _0x20f9b0=getNewHopperPayload(_0x24d7de);if(_0xa9ce73){_0x20f9b0[_0x1459('0x1c')]=_0xfb92a6['id'];}else{_0x20f9b0[_0x1459('0x1b')]=_0xfb92a6['id'];}return _0x112b14[_0x1459('0x15')]['create'](_0x20f9b0);});}function handleNeverCheckDuplicate(_0x131e66,_0x9ddda4,_0x3bc593){var _0x384581=getNewHopperPayload(_0x3bc593);_0x384581['VoiceQueueId']=_0x9ddda4['id'];return _0x131e66[_0x1459('0x15')][_0x1459('0x1d')](_0x384581);}function handleCheckDuplicate(_0x5ebc53,_0x2510bb,_0x5e9671,_0x1d3dd6){return getTimezoneCallbackAt(_0x5ebc53,_0x2510bb,_0x5e9671,_0x1d3dd6)[_0x1459('0x16')](function(_0x317f76){_0x5e9671['scheduledat']=_0x317f76;switch(_0x2510bb['dialCheckDuplicateType']){case _0x1459('0x1e'):return handleAlwaysCheckDuplicate(_0x5ebc53,_0x2510bb,_0x5e9671,_0x1d3dd6);case'onlyIfOpen':return handleOnlyIfOpenCheckDuplicate(_0x5ebc53,_0x2510bb,_0x5e9671,_0x1d3dd6);default:return handleNeverCheckDuplicate(_0x5ebc53,_0x2510bb,_0x5e9671);}});}function createHopperForVoiceQueues(_0x3768e3,_0x26c1fe){return _0x3768e3[_0x1459('0x6')][_0x1459('0x1f')]({'where':{'type':_0x1459('0x20')},'attributes':['id','dialCheckDuplicateType',_0x1459('0xb')],'include':[{'model':_0x3768e3[_0x1459('0x21')],'as':'Lists','where':{'id':_0x26c1fe[_0x1459('0x22')]}}],'raw':!![]})[_0x1459('0x16')](function(_0x1fed98){var _0x3f9cde=_0x1fed98[_0x1459('0x23')](function(_0x5668e9){return handleCheckDuplicate(_0x3768e3,_0x5668e9,_0x26c1fe,![]);});return Promise['all'](_0x3f9cde);});}function createHopperForCampaigns(_0x5449fb,_0x49e216){return _0x5449fb[_0x1459('0x5')][_0x1459('0x1f')]({'attributes':['id',_0x1459('0x24'),'dialTimezone'],'include':[{'model':_0x5449fb['CmList'],'as':_0x1459('0x25'),'where':{'id':_0x49e216[_0x1459('0x22')]}}],'raw':!![]})['then'](function(_0x143704){var _0x2d1b8c=_0x143704['map'](function(_0x4e144){return handleCheckDuplicate(_0x5449fb,_0x4e144,_0x49e216,!![]);});return Promise[_0x1459('0x26')](_0x2d1b8c);});}function createHopperBlackForVoiceQueues(_0xbe4ee0,_0x526e97){return _0xbe4ee0[_0x1459('0x6')][_0x1459('0x1f')]({'where':{'type':_0x1459('0x20')},'attributes':['id'],'include':[{'model':_0xbe4ee0[_0x1459('0x21')],'as':'BlackLists','where':{'id':_0x526e97['ListId']}}],'raw':!![]})[_0x1459('0x16')](function(_0x49ce74){var _0x4fb075=_0x49ce74[_0x1459('0x23')](function(_0x130d6c){return _0xbe4ee0[_0x1459('0x27')][_0x1459('0x1d')]({'phone':_0x526e97['phone'],'ContactId':_0x526e97['id'],'ListId':_0x526e97[_0x1459('0x22')],'VoiceQueueId':_0x130d6c['id']});});return Promise[_0x1459('0x26')](_0x4fb075);});}function createHopperBlackForCampaigns(_0x18b6c0,_0x27ffcd){return _0x18b6c0[_0x1459('0x5')][_0x1459('0x1f')]({'attributes':['id'],'include':[{'model':_0x18b6c0[_0x1459('0x21')],'as':_0x1459('0x28'),'where':{'id':_0x27ffcd['ListId']}}],'raw':!![]})[_0x1459('0x16')](function(_0x4ed141){var _0xb06fb6=_0x4ed141[_0x1459('0x23')](function(_0x385c27){return _0x18b6c0[_0x1459('0x27')]['create']({'phone':_0x27ffcd[_0x1459('0x13')],'ContactId':_0x27ffcd['id'],'ListId':_0x27ffcd[_0x1459('0x22')],'CampaignId':_0x385c27['id']});});return Promise[_0x1459('0x26')](_0xb06fb6);});}module[_0x1459('0x29')]=function(_0x3cf979){return _0x3cf979[_0x1459('0x2a')]('CmContact',attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x1459('0x13'),'fields':['phone']},{'name':_0x1459('0x2b'),'fields':[_0x1459('0x2c'),_0x1459('0x2d'),_0x1459('0x13'),_0x1459('0x2e'),'fax','email'],'type':_0x1459('0x2f')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4b6474,_0xe81635,_0x1f63d8){var _0x231a2f=_0x3cf979[_0x1459('0x30')];var _0x4abbbe=_0x4b6474[_0x1459('0x31')]({'plain':!![]});if(!_0x4abbbe[_0x1459('0x22')]){logger['error'](_0x1459('0x32')+_0x4abbbe['id']);return _0x1f63d8();}if(!_0x4abbbe[_0x1459('0x13')]){return _0x1f63d8();}return createHopperForVoiceQueues(_0x231a2f,_0x4abbbe)[_0x1459('0x16')](function(){return createHopperBlackForVoiceQueues(_0x231a2f,_0x4abbbe);})[_0x1459('0x16')](function(){return createHopperForCampaigns(_0x231a2f,_0x4abbbe);})[_0x1459('0x16')](function(){return createHopperBlackForCampaigns(_0x231a2f,_0x4abbbe);})[_0x1459('0x16')](function(){return _0x1f63d8();})['catch'](function(_0x1d39eb){logger[_0x1459('0x33')](_0x1459('0x34'),_0x1d39eb[_0x1459('0x35')]);_0x1f63d8();});},'afterDestroy':function(_0x12a9a2,_0x43e036,_0x15c7c0){var _0x2d228f=_0x3cf979[_0x1459('0x30')];var _0x18a95c=_0x12a9a2[_0x1459('0x31')]({'plain':!![]});return _0x2d228f['CmHopper']['findAll']({'raw':!![],'where':{'ListId':_0x18a95c['ListId'],'ContactId':_0x18a95c['id']}})[_0x1459('0x16')](function(_0x6aa927){if(!_['isEmpty'](_0x6aa927)){var _0x2d3f54=[];for(var _0x552d03=0x0;_0x552d03<_0x6aa927[_0x1459('0x36')];_0x552d03+=0x1){var _0x9845cf=_0x2d228f[_0x1459('0x15')][_0x1459('0x37')]({'where':{'ListId':_0x6aa927[_0x552d03][_0x1459('0x22')],'ContactId':_0x6aa927[_0x552d03]['ContactId'],'VoiceQueueId':_0x6aa927[_0x552d03]['VoiceQueueId'],'CampaignId':_0x6aa927[_0x552d03][_0x1459('0x1c')]}});_0x2d3f54[_0x1459('0x38')](_0x9845cf);}return Promise[_0x1459('0x26')](_0x2d3f54);}})[_0x1459('0x16')](function(_0xaf5450){logger[_0x1459('0x39')](_0x1459('0x3a'),util[_0x1459('0x3b')](_0xaf5450,{'showHidden':![],'depth':null}));_0x15c7c0();})[_0x1459('0x3c')](function(_0x46005e){logger[_0x1459('0x33')](_0x1459('0x3d'),util[_0x1459('0x3b')](_0x46005e,{'showHidden':![],'depth':null}));_0x15c7c0(_0x46005e);});}}});}; \ No newline at end of file +var _0xd30f=['destroy','ContactId','push','info','inspect','lodash','util','../../config/logger','moment','Campaign','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','resolve','findOne','then','timezones','utcOffset','add','minutes','format','ListId','priority','callbackUniqueid','assign','CmHopper','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','CampaignId','VoiceQueueId','create','phone','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','dialCheckDuplicateType','always','onlyIfOpen','VoiceQueue','findAll','CmList','map','all','Lists','outbound','BlackLists','CmHopperBlack','exports','CmContact','fti_cm_contacts','firstName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','get','error','catch','[cmContact][afterCreate]','message','isEmpty','length'];(function(_0x6e70fc,_0xba7194){var _0x42da00=function(_0x1f0f0d){while(--_0x1f0f0d){_0x6e70fc['push'](_0x6e70fc['shift']());}};_0x42da00(++_0xba7194);}(_0xd30f,0xbf));var _0xfd30=function(_0x7307c,_0x1d2e9e){_0x7307c=_0x7307c-0x0;var _0x2ff440=_0xd30f[_0x7307c];return _0x2ff440;};'use strict';var _=require(_0xfd30('0x0'));var util=require(_0xfd30('0x1'));var logger=require(_0xfd30('0x2'))('api');var moment=require(_0xfd30('0x3'));var shared=require('../../config/environment/shared');var attributes=require('./cmContact.attributes');function getTimezoneCallbackAt(_0x2710fb,_0x372c41,_0xa22109,_0x25a5e9){var _0x49603d=_0x25a5e9?_0xfd30('0x4'):'VoiceQueue';var _0x2efa1c=_0xa22109[_0xfd30('0x5')]?_0xa22109[_0xfd30('0x5')]:moment()['format'](_0xfd30('0x6'));if(_[_0xfd30('0x7')](_0xa22109[_0xfd30('0x8')])){return Promise[_0xfd30('0x9')](_0x2efa1c);}return _0x2710fb[_0x49603d][_0xfd30('0xa')]({'where':{'id':_0x372c41}})[_0xfd30('0xb')](function(_0x54bef7){if(_['isNil'](_0x54bef7)||_['isNil'](_0x54bef7[_0xfd30('0x8')])){return Promise['resolve'](_0x2efa1c);}var _0x486dd4=shared[_0xfd30('0xc')];var _0x230a90=_0x486dd4[_0x54bef7[_0xfd30('0x8')]];var _0x243f4c=_0x486dd4[_0xa22109[_0xfd30('0x8')]];if(_[_0xfd30('0x7')](_0x230a90)&&_['isNil'](_0x243f4c)){return Promise['resolve'](_0x2efa1c);}var _0x3f2544=_0x230a90[_0xfd30('0xd')]-_0x243f4c[_0xfd30('0xd')];var _0x407d23=_0xa22109[_0xfd30('0x5')]?_0xa22109[_0xfd30('0x5')]:moment();_0x2efa1c=moment(_0x407d23)[_0xfd30('0xe')](_0x3f2544,_0xfd30('0xf'))[_0xfd30('0x10')](_0xfd30('0x6'));return Promise[_0xfd30('0x9')](_0x2efa1c);});}function getNewHopperPayload(_0x5a37c1){return{'phone':_0x5a37c1['phone'],'ContactId':_0x5a37c1['id'],'ListId':_0x5a37c1[_0xfd30('0x11')],'scheduledat':_0x5a37c1['scheduledat']?_0x5a37c1['scheduledat']:moment()[_0xfd30('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x5a37c1[_0xfd30('0x12')]?_0x5a37c1['priority']:0x2,'callback':_0x5a37c1[_0xfd30('0x13')]?!![]:![],'callbackuniqueid':_0x5a37c1[_0xfd30('0x13')]?_0x5a37c1['callbackUniqueid']:undefined,'callbackat':_0x5a37c1[_0xfd30('0x13')]?moment()[_0xfd30('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):undefined};}function handleAlwaysCheckDuplicate(_0x59d80d,_0x59245f,_0x3dd3a2,_0x447e2b){var _0x51324d={'phone':_0x3dd3a2['phone']};var _0x43a8e3={'calleridnum':_0x3dd3a2['phone']};if(_0x447e2b){Object[_0xfd30('0x14')](_0x51324d,{'CampaignId':_0x59245f['id']});Object['assign'](_0x43a8e3,{'CampaignId':_0x59245f['id']});}else{Object[_0xfd30('0x14')](_0x51324d,{'VoiceQueueId':_0x59245f['id']});Object[_0xfd30('0x14')](_0x43a8e3,{'VoiceQueueId':_0x59245f['id']});}return _0x59d80d[_0xfd30('0x15')][_0xfd30('0xa')]({'where':_0x51324d})['then'](function(_0x35c03d){if(_0x35c03d){throw new Error('[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x3dd3a2['phone']+_0xfd30('0x16')+_0x59245f['id']);}return _0x59d80d[_0xfd30('0x17')][_0xfd30('0xa')]({'where':_0x43a8e3});})['then'](function(_0x32a364){if(_0x32a364){throw new Error('[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x3dd3a2['phone']+_0xfd30('0x16')+_0x59245f['id']);}var _0x27f31a=getNewHopperPayload(_0x3dd3a2);if(_0x447e2b){_0x27f31a[_0xfd30('0x18')]=_0x59245f['id'];}else{_0x27f31a[_0xfd30('0x19')]=_0x59245f['id'];}return _0x59d80d[_0xfd30('0x15')][_0xfd30('0x1a')](_0x27f31a);});}function handleOnlyIfOpenCheckDuplicate(_0x3a3fde,_0x585d8a,_0x1d804a,_0x543608){var _0x2ec5df={'phone':_0x1d804a[_0xfd30('0x1b')]};if(_0x543608){Object[_0xfd30('0x14')](_0x2ec5df,{'CampaignId':_0x585d8a['id']});}else{Object[_0xfd30('0x14')](_0x2ec5df,{'VoiceQueueId':_0x585d8a['id']});}return _0x3a3fde['CmHopper'][_0xfd30('0xa')]({'where':_0x2ec5df})[_0xfd30('0xb')](function(_0x3460e6){if(_0x3460e6){throw new Error(_0xfd30('0x1c')+_0x1d804a[_0xfd30('0x1b')]+_0xfd30('0x16')+_0x585d8a['id']);}var _0x217a94=getNewHopperPayload(_0x1d804a);if(_0x543608){_0x217a94[_0xfd30('0x18')]=_0x585d8a['id'];}else{_0x217a94[_0xfd30('0x19')]=_0x585d8a['id'];}return _0x3a3fde[_0xfd30('0x15')]['create'](_0x217a94);});}function handleNeverCheckDuplicate(_0x19f5f9,_0x2c26a9,_0x1e7671){var _0x289882=getNewHopperPayload(_0x1e7671);_0x289882[_0xfd30('0x19')]=_0x2c26a9['id'];return _0x19f5f9[_0xfd30('0x15')][_0xfd30('0x1a')](_0x289882);}function handleCheckDuplicate(_0x51a465,_0x42bdd6,_0x24c274,_0x10b17f){return getTimezoneCallbackAt(_0x51a465,_0x42bdd6,_0x24c274,_0x10b17f)[_0xfd30('0xb')](function(_0x8be575){_0x24c274[_0xfd30('0x5')]=_0x8be575;switch(_0x42bdd6[_0xfd30('0x1d')]){case _0xfd30('0x1e'):return handleAlwaysCheckDuplicate(_0x51a465,_0x42bdd6,_0x24c274,_0x10b17f);case _0xfd30('0x1f'):return handleOnlyIfOpenCheckDuplicate(_0x51a465,_0x42bdd6,_0x24c274,_0x10b17f);default:return handleNeverCheckDuplicate(_0x51a465,_0x42bdd6,_0x24c274);}});}function createHopperForVoiceQueues(_0x536028,_0x1acdc9){return _0x536028[_0xfd30('0x20')][_0xfd30('0x21')]({'where':{'type':'outbound'},'attributes':['id',_0xfd30('0x1d'),_0xfd30('0x8')],'include':[{'model':_0x536028[_0xfd30('0x22')],'as':'Lists','where':{'id':_0x1acdc9[_0xfd30('0x11')]}}],'raw':!![]})['then'](function(_0x29451e){var _0x31c2ec=_0x29451e[_0xfd30('0x23')](function(_0x390c3e){return handleCheckDuplicate(_0x536028,_0x390c3e,_0x1acdc9,![]);});return Promise[_0xfd30('0x24')](_0x31c2ec);});}function createHopperForCampaigns(_0x380751,_0x28efee){return _0x380751[_0xfd30('0x4')][_0xfd30('0x21')]({'attributes':['id',_0xfd30('0x1d'),_0xfd30('0x8')],'include':[{'model':_0x380751[_0xfd30('0x22')],'as':_0xfd30('0x25'),'where':{'id':_0x28efee[_0xfd30('0x11')]}}],'raw':!![]})['then'](function(_0x2f8400){var _0x4f897e=_0x2f8400[_0xfd30('0x23')](function(_0x355988){return handleCheckDuplicate(_0x380751,_0x355988,_0x28efee,!![]);});return Promise[_0xfd30('0x24')](_0x4f897e);});}function createHopperBlackForVoiceQueues(_0x28d845,_0x4ef740){return _0x28d845[_0xfd30('0x20')][_0xfd30('0x21')]({'where':{'type':_0xfd30('0x26')},'attributes':['id'],'include':[{'model':_0x28d845[_0xfd30('0x22')],'as':_0xfd30('0x27'),'where':{'id':_0x4ef740[_0xfd30('0x11')]}}],'raw':!![]})['then'](function(_0x22cb88){var _0x4ee177=_0x22cb88[_0xfd30('0x23')](function(_0x4d37cf){return _0x28d845['CmHopperBlack']['create']({'phone':_0x4ef740[_0xfd30('0x1b')],'ContactId':_0x4ef740['id'],'ListId':_0x4ef740['ListId'],'VoiceQueueId':_0x4d37cf['id']});});return Promise[_0xfd30('0x24')](_0x4ee177);});}function createHopperBlackForCampaigns(_0x217c8b,_0xcb4068){return _0x217c8b[_0xfd30('0x4')]['findAll']({'attributes':['id'],'include':[{'model':_0x217c8b[_0xfd30('0x22')],'as':'BlackLists','where':{'id':_0xcb4068[_0xfd30('0x11')]}}],'raw':!![]})[_0xfd30('0xb')](function(_0x575965){var _0x146874=_0x575965[_0xfd30('0x23')](function(_0x100080){return _0x217c8b[_0xfd30('0x28')][_0xfd30('0x1a')]({'phone':_0xcb4068[_0xfd30('0x1b')],'ContactId':_0xcb4068['id'],'ListId':_0xcb4068[_0xfd30('0x11')],'CampaignId':_0x100080['id']});});return Promise[_0xfd30('0x24')](_0x146874);});}module[_0xfd30('0x29')]=function(_0x493b07){return _0x493b07['define'](_0xfd30('0x2a'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':_0xfd30('0x2b'),'fields':[_0xfd30('0x2c'),'lastName','phone',_0xfd30('0x2d'),_0xfd30('0x2e'),_0xfd30('0x2f')],'type':_0xfd30('0x30')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xfd30('0x31'),'hooks':{'afterCreate':function(_0x10eb50,_0x5f3c34,_0x2008dd){var _0x4e72fe=_0x493b07['models'];var _0x1a4345=_0x10eb50[_0xfd30('0x32')]({'plain':!![]});if(!_0x1a4345[_0xfd30('0x11')]){logger[_0xfd30('0x33')]('[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20'+_0x1a4345['id']);return _0x2008dd();}if(!_0x1a4345[_0xfd30('0x1b')]){return _0x2008dd();}return createHopperForVoiceQueues(_0x4e72fe,_0x1a4345)[_0xfd30('0xb')](function(){return createHopperBlackForVoiceQueues(_0x4e72fe,_0x1a4345);})[_0xfd30('0xb')](function(){return createHopperForCampaigns(_0x4e72fe,_0x1a4345);})['then'](function(){return createHopperBlackForCampaigns(_0x4e72fe,_0x1a4345);})['then'](function(){return _0x2008dd();})[_0xfd30('0x34')](function(_0x39d28b){logger['error'](_0xfd30('0x35'),_0x39d28b[_0xfd30('0x36')]);_0x2008dd();});},'afterDestroy':function(_0x164315,_0x240365,_0x33a211){var _0x5dd5f2=_0x493b07['models'];var _0x56c3f9=_0x164315[_0xfd30('0x32')]({'plain':!![]});return _0x5dd5f2['CmHopper'][_0xfd30('0x21')]({'raw':!![],'where':{'ListId':_0x56c3f9['ListId'],'ContactId':_0x56c3f9['id']}})[_0xfd30('0xb')](function(_0x38ae3e){if(!_[_0xfd30('0x37')](_0x38ae3e)){var _0x5ae2a0=[];for(var _0xfb079d=0x0;_0xfb079d<_0x38ae3e[_0xfd30('0x38')];_0xfb079d+=0x1){var _0x4ceab8=_0x5dd5f2[_0xfd30('0x15')][_0xfd30('0x39')]({'where':{'ListId':_0x38ae3e[_0xfb079d][_0xfd30('0x11')],'ContactId':_0x38ae3e[_0xfb079d][_0xfd30('0x3a')],'VoiceQueueId':_0x38ae3e[_0xfb079d][_0xfd30('0x19')],'CampaignId':_0x38ae3e[_0xfb079d]['CampaignId']}});_0x5ae2a0[_0xfd30('0x3b')](_0x4ceab8);}return Promise[_0xfd30('0x24')](_0x5ae2a0);}})['then'](function(_0x1b6e36){logger[_0xfd30('0x3c')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x1b6e36,{'showHidden':![],'depth':null}));_0x33a211();})['catch'](function(_0x3f5047){logger[_0xfd30('0x33')]('[CmContact][afterDestroy][Error]',util[_0xfd30('0x3d')](_0x3f5047,{'showHidden':![],'depth':null}));_0x33a211(_0x3f5047);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index d55e6af..0d94fa7 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_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 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(_0x7dc9aa,_0x2e5043){var _0x5d9c94=function(_0x53e77a){while(--_0x53e77a){_0x7dc9aa['push'](_0x7dc9aa['shift']());}};_0x5d9c94(++_0x2e5043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 8dd3d33..b4adb5c 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 _0xff96=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x4b744a,_0x230328){var _0x1cbdc0=function(_0x559131){while(--_0x559131){_0x4b744a['push'](_0x4b744a['shift']());}};_0x1cbdc0(++_0x230328);}(_0xff96,0x179));var _0x6ff9=function(_0x2820fc,_0x481318){_0x2820fc=_0x2820fc-0x0;var _0x1e1508=_0xff96[_0x2820fc];return _0x1e1508;};'use strict';var Sequelize=require(_0x6ff9('0x0'));module[_0x6ff9('0x1')]={'CmContactId':{'type':Sequelize[_0x6ff9('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x6ff9('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x6ff9('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6ff9('0x3')],'defaultValue':_0x6ff9('0x4')},'OrderBy':{'type':Sequelize[_0x6ff9('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x6ff9('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xd52a=['INTEGER','exports','STRING'];(function(_0x58c24a,_0x41c30a){var _0x179be8=function(_0x57252e){while(--_0x57252e){_0x58c24a['push'](_0x58c24a['shift']());}};_0x179be8(++_0x41c30a);}(_0xd52a,0xca));var _0xad52=function(_0x334a28,_0x5e173d){_0x334a28=_0x334a28-0x0;var _0x163fd5=_0xd52a[_0x334a28];return _0x163fd5;};'use strict';var Sequelize=require('sequelize');module[_0xad52('0x0')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0xad52('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xad52('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xad52('0x1')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xad52('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0xad52('0x1')],'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 d0d6086..cc0e24b 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 _0xc08e=['send','map','CmContactHasItem','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','sendStatus','error','stack','name'];(function(_0x2f735a,_0x50d2ba){var _0x420996=function(_0x42eec0){while(--_0x42eec0){_0x2f735a['push'](_0x2f735a['shift']());}};_0x420996(++_0x50d2ba);}(_0xc08e,0x187));var _0xec08=function(_0x9736a2,_0x405420){_0x9736a2=_0x9736a2-0x0;var _0x419e62=_0xc08e[_0x9736a2];return _0x419e62;};'use strict';var emlformat=require(_0xec08('0x0'));var rimraf=require(_0xec08('0x1'));var zipdir=require(_0xec08('0x2'));var jsonpatch=require(_0xec08('0x3'));var rp=require(_0xec08('0x4'));var moment=require('moment');var BPromise=require(_0xec08('0x5'));var Mustache=require('mustache');var util=require(_0xec08('0x6'));var path=require(_0xec08('0x7'));var sox=require(_0xec08('0x8'));var csv=require(_0xec08('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec08('0xa'));var _=require(_0xec08('0xb'));var squel=require(_0xec08('0xc'));var crypto=require(_0xec08('0xd'));var jsforce=require(_0xec08('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xec08('0xf'));var Papa=require(_0xec08('0x10'));var Redis=require(_0xec08('0x11'));var authService=require(_0xec08('0x12'));var qs=require(_0xec08('0x13'));var as=require(_0xec08('0x14'));var hardwareService=require(_0xec08('0x15'));var logger=require(_0xec08('0x16'))(_0xec08('0x17'));var utils=require(_0xec08('0x18'));var config=require(_0xec08('0x19'));var licenseUtil=require(_0xec08('0x1a'));var db=require(_0xec08('0x1b'))['db'];function respondWithStatusCode(_0x524638,_0x106329){_0x106329=_0x106329||0xcc;return function(_0x36cbf5){if(_0x36cbf5){return _0x524638['sendStatus'](_0x106329);}return _0x524638[_0xec08('0x1c')](_0x106329)[_0xec08('0x1d')]();};}function respondWithResult(_0x2caeea,_0x3111e0){_0x3111e0=_0x3111e0||0xc8;return function(_0x1e93cf){if(_0x1e93cf){return _0x2caeea['status'](_0x3111e0)[_0xec08('0x1e')](_0x1e93cf);}};}function respondWithFilteredResult(_0x5dbe4a,_0x4c9eba){return function(_0x4d9655){if(_0x4d9655){var _0x1a2c8d=typeof _0x4c9eba[_0xec08('0x1f')]===_0xec08('0x20')&&typeof _0x4c9eba[_0xec08('0x21')]===_0xec08('0x20');var _0x256dae=_0x4d9655[_0xec08('0x22')];var _0x263b99=_0x1a2c8d?0x0:_0x4c9eba[_0xec08('0x1f')];var _0x5906c6=_0x1a2c8d?_0x4d9655[_0xec08('0x22')]:_0x4c9eba[_0xec08('0x1f')]+_0x4c9eba[_0xec08('0x21')];var _0x555061;if(_0x5906c6>=_0x256dae){_0x5906c6=_0x256dae;_0x555061=0xc8;}else{_0x555061=0xce;}_0x5dbe4a[_0xec08('0x1c')](_0x555061);return _0x5dbe4a[_0xec08('0x23')](_0xec08('0x24'),_0x263b99+'-'+_0x5906c6+'/'+_0x256dae)[_0xec08('0x1e')](_0x4d9655);}return null;};}function patchUpdates(_0x1da0f2){return function(_0x43cb80){try{jsonpatch[_0xec08('0x25')](_0x43cb80,_0x1da0f2,!![]);}catch(_0x5af662){return BPromise[_0xec08('0x26')](_0x5af662);}return _0x43cb80[_0xec08('0x27')]();};}function saveUpdates(_0x35f4b5,_0x15e006){return function(_0x421dfc){if(_0x421dfc){return _0x421dfc[_0xec08('0x28')](_0x35f4b5)[_0xec08('0x29')](function(_0x2d9461){return _0x2d9461;});}return null;};}function removeEntity(_0x1bc9f7,_0x50b817){return function(_0x94cac0){if(_0x94cac0){return _0x94cac0[_0xec08('0x2a')]()[_0xec08('0x29')](function(){var _0x4f1209=_0x94cac0['get']({'plain':!![]});var _0x3dcf36=_0xec08('0x2b');return db[_0xec08('0x2c')][_0xec08('0x2a')]({'where':{'type':_0x3dcf36,'resourceId':_0x4f1209['id']}})[_0xec08('0x29')](function(){return _0x94cac0;});})['then'](function(){_0x1bc9f7[_0xec08('0x1c')](0xcc)[_0xec08('0x1d')]();});}};}function handleEntityNotFound(_0x2175fa,_0x4107c3){return function(_0x2d21ec){if(!_0x2d21ec){_0x2175fa[_0xec08('0x2d')](0x194);}return _0x2d21ec;};}function handleError(_0x8c5efb,_0x57438a){_0x57438a=_0x57438a||0x1f4;return function(_0x3a48c){logger[_0xec08('0x2e')](_0x3a48c[_0xec08('0x2f')]);if(_0x3a48c['name']){delete _0x3a48c[_0xec08('0x30')];}_0x8c5efb['status'](_0x57438a)[_0xec08('0x31')](_0x3a48c);};}exports['index']=function(_0x2bcb4c,_0x2e9c70){var _0x3263bc={},_0x24d494={},_0x1499db={'count':0x0,'rows':[]};var _0x334159=_[_0xec08('0x32')](db[_0xec08('0x33')]['rawAttributes'],function(_0xc626f2){return{'name':_0xc626f2[_0xec08('0x34')],'type':_0xc626f2[_0xec08('0x35')][_0xec08('0x36')]};});_0x24d494[_0xec08('0x37')]=_[_0xec08('0x32')](_0x334159,_0xec08('0x30'));_0x24d494[_0xec08('0x38')]=_[_0xec08('0x39')](_0x2bcb4c[_0xec08('0x38')]);_0x24d494['filters']=_[_0xec08('0x3a')](_0x24d494[_0xec08('0x37')],_0x24d494[_0xec08('0x38')]);_0x3263bc[_0xec08('0x3b')]=_[_0xec08('0x3a')](_0x24d494[_0xec08('0x37')],qs[_0xec08('0x3c')](_0x2bcb4c['query'][_0xec08('0x3c')]));_0x3263bc['attributes']=_0x3263bc[_0xec08('0x3b')][_0xec08('0x3d')]?_0x3263bc[_0xec08('0x3b')]:_0x24d494[_0xec08('0x37')];if(!_0x2bcb4c['query'][_0xec08('0x3e')]('nolimit')){_0x3263bc[_0xec08('0x21')]=qs['limit'](_0x2bcb4c[_0xec08('0x38')][_0xec08('0x21')]);_0x3263bc[_0xec08('0x1f')]=qs[_0xec08('0x1f')](_0x2bcb4c['query'][_0xec08('0x1f')]);}_0x3263bc[_0xec08('0x3f')]=qs[_0xec08('0x40')](_0x2bcb4c[_0xec08('0x38')][_0xec08('0x40')]);_0x3263bc[_0xec08('0x41')]=qs[_0xec08('0x42')](_[_0xec08('0x43')](_0x2bcb4c[_0xec08('0x38')],_0x24d494[_0xec08('0x42')]),_0x334159);if(_0x2bcb4c[_0xec08('0x38')][_0xec08('0x44')]){_0x3263bc[_0xec08('0x41')]=_[_0xec08('0x45')](_0x3263bc[_0xec08('0x41')],{'$or':_['map'](_0x334159,function(_0x379fa4){if(_0x379fa4[_0xec08('0x35')]!==_0xec08('0x46')){var _0x38f734={};_0x38f734[_0x379fa4[_0xec08('0x30')]]={'$like':'%'+_0x2bcb4c['query'][_0xec08('0x44')]+'%'};return _0x38f734;}})});}_0x3263bc=_[_0xec08('0x45')]({},_0x3263bc,_0x2bcb4c[_0xec08('0x47')]);var _0x16c58f={'where':_0x3263bc[_0xec08('0x41')]};return db[_0xec08('0x33')][_0xec08('0x22')](_0x16c58f)[_0xec08('0x29')](function(_0x336715){_0x1499db[_0xec08('0x22')]=_0x336715;if(_0x2bcb4c[_0xec08('0x38')][_0xec08('0x48')]){_0x3263bc[_0xec08('0x49')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xec08('0x4a')](_0x3263bc);})[_0xec08('0x29')](function(_0x292db2){_0x1499db[_0xec08('0x4b')]=_0x292db2;return _0x1499db;})['then'](respondWithFilteredResult(_0x2e9c70,_0x3263bc))[_0xec08('0x4c')](handleError(_0x2e9c70,null));};exports[_0xec08('0x4d')]=function(_0x12e1e5,_0x3a412e){var _0x1e12b3={'raw':!![],'where':{'id':_0x12e1e5[_0xec08('0x4e')]['id']}},_0x1924e6={};_0x1924e6[_0xec08('0x37')]=_[_0xec08('0x39')](db['CmContactHasItem']['rawAttributes']);_0x1924e6[_0xec08('0x38')]=_[_0xec08('0x39')](_0x12e1e5[_0xec08('0x38')]);_0x1924e6[_0xec08('0x42')]=_[_0xec08('0x3a')](_0x1924e6[_0xec08('0x37')],_0x1924e6['query']);_0x1e12b3[_0xec08('0x3b')]=_['intersection'](_0x1924e6[_0xec08('0x37')],qs[_0xec08('0x3c')](_0x12e1e5[_0xec08('0x38')][_0xec08('0x3c')]));_0x1e12b3[_0xec08('0x3b')]=_0x1e12b3[_0xec08('0x3b')]['length']?_0x1e12b3[_0xec08('0x3b')]:_0x1924e6['model'];if(_0x12e1e5[_0xec08('0x38')][_0xec08('0x48')]){_0x1e12b3[_0xec08('0x49')]=[{'all':!![]}];}_0x1e12b3=_['merge']({},_0x1e12b3,_0x12e1e5['options']);return db[_0xec08('0x33')][_0xec08('0x4f')](_0x1e12b3)['then'](handleEntityNotFound(_0x3a412e,null))[_0xec08('0x29')](respondWithResult(_0x3a412e,null))[_0xec08('0x4c')](handleError(_0x3a412e,null));};exports[_0xec08('0x50')]=function(_0x493781,_0x41cdf8){return db[_0xec08('0x33')][_0xec08('0x50')](_0x493781[_0xec08('0x51')],{})['then'](function(_0x37e983){var _0x3456c2=_0x493781[_0xec08('0x52')][_0xec08('0x53')]({'plain':!![]});if(!_0x3456c2)throw new Error(_0xec08('0x54'));if(_0x3456c2['role']===_0xec08('0x52')){var _0x312529=_0x37e983[_0xec08('0x53')]({'plain':!![]});var _0x329435='CmContactHasItems';return db['UserProfileSection'][_0xec08('0x4f')]({'where':{'name':_0x329435,'userProfileId':_0x3456c2[_0xec08('0x55')]},'raw':!![]})['then'](function(_0x16f3ad){if(_0x16f3ad&&_0x16f3ad[_0xec08('0x56')]===0x0){return db[_0xec08('0x2c')][_0xec08('0x50')]({'name':_0x312529[_0xec08('0x30')],'resourceId':_0x312529['id'],'type':_0x16f3ad[_0xec08('0x30')],'sectionId':_0x16f3ad['id']},{})[_0xec08('0x29')](function(){return _0x37e983;});}else{return _0x37e983;}})[_0xec08('0x4c')](function(_0x15a48e){logger[_0xec08('0x2e')](_0xec08('0x57'),_0x15a48e);throw _0x15a48e;});}return _0x37e983;})[_0xec08('0x29')](respondWithResult(_0x41cdf8,0xc9))[_0xec08('0x4c')](handleError(_0x41cdf8,null));};exports['update']=function(_0x3dd7d8,_0x1a2120){if(_0x3dd7d8[_0xec08('0x51')]['id']){delete _0x3dd7d8['body']['id'];}return db[_0xec08('0x33')][_0xec08('0x4f')]({'where':{'id':_0x3dd7d8[_0xec08('0x4e')]['id']}})[_0xec08('0x29')](handleEntityNotFound(_0x1a2120,null))[_0xec08('0x29')](saveUpdates(_0x3dd7d8['body'],null))[_0xec08('0x29')](respondWithResult(_0x1a2120,null))['catch'](handleError(_0x1a2120,null));};exports[_0xec08('0x2a')]=function(_0x40c709,_0x340be0){return db[_0xec08('0x33')][_0xec08('0x4f')]({'where':{'id':_0x40c709[_0xec08('0x4e')]['id']}})[_0xec08('0x29')](handleEntityNotFound(_0x340be0,null))[_0xec08('0x29')](removeEntity(_0x340be0,null))[_0xec08('0x4c')](handleError(_0x340be0,null));}; \ No newline at end of file +var _0xcbd7=['map','CmContactHasItem','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','name','send'];(function(_0x12580,_0x4e2a21){var _0x10a5dc=function(_0x280c67){while(--_0x280c67){_0x12580['push'](_0x12580['shift']());}};_0x10a5dc(++_0x4e2a21);}(_0xcbd7,0x1b5));var _0x7cbd=function(_0x554c1a,_0x502476){_0x554c1a=_0x554c1a-0x0;var _0x4db8df=_0xcbd7[_0x554c1a];return _0x4db8df;};'use strict';var emlformat=require(_0x7cbd('0x0'));var rimraf=require(_0x7cbd('0x1'));var zipdir=require(_0x7cbd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7cbd('0x3'));var BPromise=require(_0x7cbd('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7cbd('0x5'));var sox=require(_0x7cbd('0x6'));var csv=require(_0x7cbd('0x7'));var ejs=require(_0x7cbd('0x8'));var fs=require('fs');var fs_extra=require(_0x7cbd('0x9'));var _=require(_0x7cbd('0xa'));var squel=require(_0x7cbd('0xb'));var crypto=require('crypto');var jsforce=require(_0x7cbd('0xc'));var deskjs=require(_0x7cbd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7cbd('0xe'));var Papa=require('papaparse');var Redis=require(_0x7cbd('0xf'));var authService=require(_0x7cbd('0x10'));var qs=require(_0x7cbd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cbd('0x12'));var logger=require('../../config/logger')(_0x7cbd('0x13'));var utils=require(_0x7cbd('0x14'));var config=require(_0x7cbd('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31b2ec,_0x33a37f){_0x33a37f=_0x33a37f||0xcc;return function(_0x5873ae){if(_0x5873ae){return _0x31b2ec['sendStatus'](_0x33a37f);}return _0x31b2ec[_0x7cbd('0x16')](_0x33a37f)[_0x7cbd('0x17')]();};}function respondWithResult(_0x40aa7c,_0x3adf1b){_0x3adf1b=_0x3adf1b||0xc8;return function(_0x9d3a93){if(_0x9d3a93){return _0x40aa7c[_0x7cbd('0x16')](_0x3adf1b)[_0x7cbd('0x18')](_0x9d3a93);}};}function respondWithFilteredResult(_0xd246e4,_0x1b4247){return function(_0x161191){if(_0x161191){var _0x1a3c79=typeof _0x1b4247[_0x7cbd('0x19')]===_0x7cbd('0x1a')&&typeof _0x1b4247['limit']===_0x7cbd('0x1a');var _0x3c50a1=_0x161191[_0x7cbd('0x1b')];var _0x2a49f9=_0x1a3c79?0x0:_0x1b4247[_0x7cbd('0x19')];var _0x4adfdc=_0x1a3c79?_0x161191['count']:_0x1b4247[_0x7cbd('0x19')]+_0x1b4247[_0x7cbd('0x1c')];var _0x5451fd;if(_0x4adfdc>=_0x3c50a1){_0x4adfdc=_0x3c50a1;_0x5451fd=0xc8;}else{_0x5451fd=0xce;}_0xd246e4[_0x7cbd('0x16')](_0x5451fd);return _0xd246e4[_0x7cbd('0x1d')](_0x7cbd('0x1e'),_0x2a49f9+'-'+_0x4adfdc+'/'+_0x3c50a1)[_0x7cbd('0x18')](_0x161191);}return null;};}function patchUpdates(_0xb65da2){return function(_0x1a0e92){try{jsonpatch[_0x7cbd('0x1f')](_0x1a0e92,_0xb65da2,!![]);}catch(_0x15829f){return BPromise[_0x7cbd('0x20')](_0x15829f);}return _0x1a0e92['save']();};}function saveUpdates(_0x525750,_0x20a3b0){return function(_0x463513){if(_0x463513){return _0x463513[_0x7cbd('0x21')](_0x525750)[_0x7cbd('0x22')](function(_0x560223){return _0x560223;});}return null;};}function removeEntity(_0x118027,_0x32b91f){return function(_0x2009ed){if(_0x2009ed){return _0x2009ed[_0x7cbd('0x23')]()[_0x7cbd('0x22')](function(){var _0x238aac=_0x2009ed[_0x7cbd('0x24')]({'plain':!![]});var _0x3d3988=_0x7cbd('0x25');return db[_0x7cbd('0x26')]['destroy']({'where':{'type':_0x3d3988,'resourceId':_0x238aac['id']}})[_0x7cbd('0x22')](function(){return _0x2009ed;});})['then'](function(){_0x118027[_0x7cbd('0x16')](0xcc)[_0x7cbd('0x17')]();});}};}function handleEntityNotFound(_0x564307,_0x1029b2){return function(_0x4da7c7){if(!_0x4da7c7){_0x564307['sendStatus'](0x194);}return _0x4da7c7;};}function handleError(_0x22f6f5,_0x1fa075){_0x1fa075=_0x1fa075||0x1f4;return function(_0x3561b2){logger[_0x7cbd('0x27')](_0x3561b2[_0x7cbd('0x28')]);if(_0x3561b2['name']){delete _0x3561b2[_0x7cbd('0x29')];}_0x22f6f5[_0x7cbd('0x16')](_0x1fa075)[_0x7cbd('0x2a')](_0x3561b2);};}exports['index']=function(_0x4170e3,_0x1a3e33){var _0x30013a={},_0x2bda21={},_0x329316={'count':0x0,'rows':[]};var _0x13ec85=_[_0x7cbd('0x2b')](db[_0x7cbd('0x2c')][_0x7cbd('0x2d')],function(_0x15d9a3){return{'name':_0x15d9a3[_0x7cbd('0x2e')],'type':_0x15d9a3[_0x7cbd('0x2f')][_0x7cbd('0x30')]};});_0x2bda21[_0x7cbd('0x31')]=_[_0x7cbd('0x2b')](_0x13ec85,'name');_0x2bda21[_0x7cbd('0x32')]=_[_0x7cbd('0x33')](_0x4170e3[_0x7cbd('0x32')]);_0x2bda21[_0x7cbd('0x34')]=_[_0x7cbd('0x35')](_0x2bda21[_0x7cbd('0x31')],_0x2bda21[_0x7cbd('0x32')]);_0x30013a[_0x7cbd('0x36')]=_[_0x7cbd('0x35')](_0x2bda21[_0x7cbd('0x31')],qs[_0x7cbd('0x37')](_0x4170e3['query'][_0x7cbd('0x37')]));_0x30013a[_0x7cbd('0x36')]=_0x30013a[_0x7cbd('0x36')][_0x7cbd('0x38')]?_0x30013a['attributes']:_0x2bda21['model'];if(!_0x4170e3[_0x7cbd('0x32')][_0x7cbd('0x39')](_0x7cbd('0x3a'))){_0x30013a[_0x7cbd('0x1c')]=qs[_0x7cbd('0x1c')](_0x4170e3['query'][_0x7cbd('0x1c')]);_0x30013a[_0x7cbd('0x19')]=qs['offset'](_0x4170e3['query'][_0x7cbd('0x19')]);}_0x30013a[_0x7cbd('0x3b')]=qs['sort'](_0x4170e3[_0x7cbd('0x32')][_0x7cbd('0x3c')]);_0x30013a[_0x7cbd('0x3d')]=qs[_0x7cbd('0x34')](_[_0x7cbd('0x3e')](_0x4170e3['query'],_0x2bda21['filters']),_0x13ec85);if(_0x4170e3[_0x7cbd('0x32')]['filter']){_0x30013a[_0x7cbd('0x3d')]=_[_0x7cbd('0x3f')](_0x30013a[_0x7cbd('0x3d')],{'$or':_[_0x7cbd('0x2b')](_0x13ec85,function(_0x3a74fd){if(_0x3a74fd['type']!==_0x7cbd('0x40')){var _0x914e7e={};_0x914e7e[_0x3a74fd[_0x7cbd('0x29')]]={'$like':'%'+_0x4170e3[_0x7cbd('0x32')][_0x7cbd('0x41')]+'%'};return _0x914e7e;}})});}_0x30013a=_['merge']({},_0x30013a,_0x4170e3[_0x7cbd('0x42')]);var _0x59b7dd={'where':_0x30013a[_0x7cbd('0x3d')]};return db[_0x7cbd('0x2c')][_0x7cbd('0x1b')](_0x59b7dd)['then'](function(_0x352f20){_0x329316[_0x7cbd('0x1b')]=_0x352f20;if(_0x4170e3[_0x7cbd('0x32')][_0x7cbd('0x43')]){_0x30013a[_0x7cbd('0x44')]=[{'all':!![]}];}return db[_0x7cbd('0x2c')]['findAll'](_0x30013a);})[_0x7cbd('0x22')](function(_0x5c1ba6){_0x329316[_0x7cbd('0x45')]=_0x5c1ba6;return _0x329316;})[_0x7cbd('0x22')](respondWithFilteredResult(_0x1a3e33,_0x30013a))[_0x7cbd('0x46')](handleError(_0x1a3e33,null));};exports[_0x7cbd('0x47')]=function(_0x3c9a3d,_0x11b399){var _0x3aa4ad={'raw':!![],'where':{'id':_0x3c9a3d[_0x7cbd('0x48')]['id']}},_0x37ea03={};_0x37ea03[_0x7cbd('0x31')]=_[_0x7cbd('0x33')](db[_0x7cbd('0x2c')][_0x7cbd('0x2d')]);_0x37ea03['query']=_[_0x7cbd('0x33')](_0x3c9a3d[_0x7cbd('0x32')]);_0x37ea03['filters']=_[_0x7cbd('0x35')](_0x37ea03['model'],_0x37ea03[_0x7cbd('0x32')]);_0x3aa4ad[_0x7cbd('0x36')]=_['intersection'](_0x37ea03[_0x7cbd('0x31')],qs[_0x7cbd('0x37')](_0x3c9a3d['query'][_0x7cbd('0x37')]));_0x3aa4ad[_0x7cbd('0x36')]=_0x3aa4ad[_0x7cbd('0x36')]['length']?_0x3aa4ad['attributes']:_0x37ea03[_0x7cbd('0x31')];if(_0x3c9a3d[_0x7cbd('0x32')][_0x7cbd('0x43')]){_0x3aa4ad['include']=[{'all':!![]}];}_0x3aa4ad=_[_0x7cbd('0x3f')]({},_0x3aa4ad,_0x3c9a3d[_0x7cbd('0x42')]);return db[_0x7cbd('0x2c')][_0x7cbd('0x49')](_0x3aa4ad)[_0x7cbd('0x22')](handleEntityNotFound(_0x11b399,null))[_0x7cbd('0x22')](respondWithResult(_0x11b399,null))['catch'](handleError(_0x11b399,null));};exports[_0x7cbd('0x4a')]=function(_0x5a460e,_0xff79b3){return db['CmContactHasItem'][_0x7cbd('0x4a')](_0x5a460e[_0x7cbd('0x4b')],{})[_0x7cbd('0x22')](function(_0xd6c718){var _0x28151a=_0x5a460e[_0x7cbd('0x4c')]['get']({'plain':!![]});if(!_0x28151a)throw new Error(_0x7cbd('0x4d'));if(_0x28151a['role']===_0x7cbd('0x4c')){var _0x4c837f=_0xd6c718[_0x7cbd('0x24')]({'plain':!![]});var _0xf484cb=_0x7cbd('0x25');return db[_0x7cbd('0x4e')]['find']({'where':{'name':_0xf484cb,'userProfileId':_0x28151a['userProfileId']},'raw':!![]})[_0x7cbd('0x22')](function(_0x42e8ab){if(_0x42e8ab&&_0x42e8ab['autoAssociation']===0x0){return db[_0x7cbd('0x26')]['create']({'name':_0x4c837f[_0x7cbd('0x29')],'resourceId':_0x4c837f['id'],'type':_0x42e8ab[_0x7cbd('0x29')],'sectionId':_0x42e8ab['id']},{})[_0x7cbd('0x22')](function(){return _0xd6c718;});}else{return _0xd6c718;}})[_0x7cbd('0x46')](function(_0xef645b){logger['error'](_0x7cbd('0x4f'),_0xef645b);throw _0xef645b;});}return _0xd6c718;})[_0x7cbd('0x22')](respondWithResult(_0xff79b3,0xc9))[_0x7cbd('0x46')](handleError(_0xff79b3,null));};exports[_0x7cbd('0x21')]=function(_0x334b56,_0x587b4e){if(_0x334b56['body']['id']){delete _0x334b56['body']['id'];}return db[_0x7cbd('0x2c')][_0x7cbd('0x49')]({'where':{'id':_0x334b56[_0x7cbd('0x48')]['id']}})[_0x7cbd('0x22')](handleEntityNotFound(_0x587b4e,null))['then'](saveUpdates(_0x334b56[_0x7cbd('0x4b')],null))[_0x7cbd('0x22')](respondWithResult(_0x587b4e,null))[_0x7cbd('0x46')](handleError(_0x587b4e,null));};exports[_0x7cbd('0x23')]=function(_0x4a7cfd,_0x4de9df){return db[_0x7cbd('0x2c')]['find']({'where':{'id':_0x4a7cfd[_0x7cbd('0x48')]['id']}})[_0x7cbd('0x22')](handleEntityNotFound(_0x4de9df,null))['then'](removeEntity(_0x4de9df,null))['catch'](handleError(_0x4de9df,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 01a464c..6777f56 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 _0xc6e4=['CmContactHasItem','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x26e6a5,_0x6e1e55){var _0x2a04a3=function(_0x3f05f5){while(--_0x3f05f5){_0x26e6a5['push'](_0x26e6a5['shift']());}};_0x2a04a3(++_0x6e1e55);}(_0xc6e4,0x1a5));var _0x4c6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc6e4[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4c6e('0x0'));var util=require('util');var logger=require(_0x4c6e('0x1'))(_0x4c6e('0x2'));var moment=require(_0x4c6e('0x3'));var BPromise=require(_0x4c6e('0x4'));var rp=require(_0x4c6e('0x5'));var fs=require('fs');var path=require(_0x4c6e('0x6'));var rimraf=require(_0x4c6e('0x7'));var config=require(_0x4c6e('0x8'));var attributes=require(_0x4c6e('0x9'));module[_0x4c6e('0xa')]=function(_0x2d6af9,_0x5e2dc3){return _0x2d6af9['define'](_0x4c6e('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1e8=['bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc1e8,0x13c));var _0x8c1e=function(_0x129c27,_0x333c44){_0x129c27=_0x129c27-0x0;var _0x5a8017=_0xc1e8[_0x129c27];return _0x5a8017;};'use strict';var _=require('lodash');var util=require(_0x8c1e('0x0'));var logger=require(_0x8c1e('0x1'))(_0x8c1e('0x2'));var moment=require('moment');var BPromise=require(_0x8c1e('0x3'));var rp=require(_0x8c1e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c1e('0x5'));var config=require(_0x8c1e('0x6'));var attributes=require(_0x8c1e('0x7'));module[_0x8c1e('0x8')]=function(_0x4711fb,_0x43f538){return _0x4711fb['define'](_0x8c1e('0x9'),attributes,{'tableName':_0x8c1e('0xa'),'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 44e8482..5491754 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 _0xd560=['rpc','../../config/environment','jayson/promise','client','http','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3be7c0,_0xd70971){var _0x4faf3a=function(_0x5d75c1){while(--_0x5d75c1){_0x3be7c0['push'](_0x3be7c0['shift']());}};_0x4faf3a(++_0xd70971);}(_0xd560,0x6c));var _0x0d56=function(_0x296ee6,_0x2c9872){_0x296ee6=_0x296ee6-0x0;var _0x38d838=_0xd560[_0x296ee6];return _0x38d838;};'use strict';var _=require(_0x0d56('0x0'));var util=require(_0x0d56('0x1'));var moment=require('moment');var BPromise=require(_0x0d56('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d56('0x3'));var db=require(_0x0d56('0x4'))['db'];var utils=require(_0x0d56('0x5'));var logger=require(_0x0d56('0x6'))(_0x0d56('0x7'));var config=require(_0x0d56('0x8'));var jayson=require(_0x0d56('0x9'));var client=jayson[_0x0d56('0xa')][_0x0d56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f32b2,_0x2bb680,_0x1a190b){return new BPromise(function(_0xcee4d,_0x42488b){return client['request'](_0x2f32b2,_0x1a190b)[_0x0d56('0xc')](function(_0x4c8ec1){logger[_0x0d56('0xd')](_0x0d56('0xe'),_0x2bb680,_0x0d56('0xf'));logger[_0x0d56('0x10')](_0x0d56('0x11'),_0x2bb680,'request\x20sent',JSON[_0x0d56('0x12')](_0x4c8ec1));if(_0x4c8ec1[_0x0d56('0x13')]){if(_0x4c8ec1[_0x0d56('0x13')][_0x0d56('0x14')]===0x1f4){logger[_0x0d56('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bb680,_0x4c8ec1['error'][_0x0d56('0x15')]);return _0x42488b(_0x4c8ec1[_0x0d56('0x13')]['message']);}logger[_0x0d56('0x13')](_0x0d56('0xe'),_0x2bb680,_0x4c8ec1['error']['message']);return _0xcee4d(_0x4c8ec1[_0x0d56('0x13')][_0x0d56('0x15')]);}else{logger[_0x0d56('0xd')](_0x0d56('0xe'),_0x2bb680,_0x0d56('0xf'));_0xcee4d(_0x4c8ec1[_0x0d56('0x16')][_0x0d56('0x15')]);}})['catch'](function(_0x3dc823){logger[_0x0d56('0x13')]('CmContactHasItem,\x20%s,\x20%s',_0x2bb680,_0x3dc823);_0x42488b(_0x3dc823);});});} \ No newline at end of file +var _0x1e2d=['stringify','error','code','message','CmContactHasItem,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug'];(function(_0x516ffb,_0x5b5b42){var _0x319667=function(_0x250098){while(--_0x250098){_0x516ffb['push'](_0x516ffb['shift']());}};_0x319667(++_0x5b5b42);}(_0x1e2d,0x19f));var _0xd1e2=function(_0xce255a,_0x26e6b0){_0xce255a=_0xce255a-0x0;var _0x3400cd=_0x1e2d[_0xce255a];return _0x3400cd;};'use strict';var _=require(_0xd1e2('0x0'));var util=require(_0xd1e2('0x1'));var moment=require(_0xd1e2('0x2'));var BPromise=require(_0xd1e2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e2('0x4'));var db=require(_0xd1e2('0x5'))['db'];var utils=require(_0xd1e2('0x6'));var logger=require(_0xd1e2('0x7'))(_0xd1e2('0x8'));var config=require(_0xd1e2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd1e2('0xa')][_0xd1e2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a8274,_0x3adadf,_0x51c547){return new BPromise(function(_0x34de95,_0x47881f){return client[_0xd1e2('0xc')](_0x3a8274,_0x51c547)[_0xd1e2('0xd')](function(_0x3d447e){logger[_0xd1e2('0xe')]('CmContactHasItem,\x20%s,\x20%s',_0x3adadf,_0xd1e2('0xf'));logger[_0xd1e2('0x10')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x3adadf,'request\x20sent',JSON[_0xd1e2('0x11')](_0x3d447e));if(_0x3d447e[_0xd1e2('0x12')]){if(_0x3d447e[_0xd1e2('0x12')][_0xd1e2('0x13')]===0x1f4){logger[_0xd1e2('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x3adadf,_0x3d447e[_0xd1e2('0x12')][_0xd1e2('0x14')]);return _0x47881f(_0x3d447e[_0xd1e2('0x12')][_0xd1e2('0x14')]);}logger[_0xd1e2('0x12')](_0xd1e2('0x15'),_0x3adadf,_0x3d447e['error'][_0xd1e2('0x14')]);return _0x34de95(_0x3d447e[_0xd1e2('0x12')][_0xd1e2('0x14')]);}else{logger[_0xd1e2('0xe')](_0xd1e2('0x15'),_0x3adadf,_0xd1e2('0xf'));_0x34de95(_0x3d447e[_0xd1e2('0x16')][_0xd1e2('0x14')]);}})[_0xd1e2('0x17')](function(_0x28b847){logger[_0xd1e2('0x12')](_0xd1e2('0x15'),_0x3adadf,_0x28b847);_0x47881f(_0x28b847);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index d946b70..214361a 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 _0xecce=['../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xecce,0x100));var _0xeecc=function(_0x17045c,_0x470ebe){_0x17045c=_0x17045c-0x0;var _0x844ac5=_0xecce[_0x17045c];return _0x844ac5;};'use strict';var multer=require(_0xeecc('0x0'));var util=require(_0xeecc('0x1'));var path=require(_0xeecc('0x2'));var timeout=require(_0xeecc('0x3'));var express=require(_0xeecc('0x4'));var router=express[_0xeecc('0x5')]();var fs_extra=require(_0xeecc('0x6'));var auth=require(_0xeecc('0x7'));var interaction=require(_0xeecc('0x8'));var config=require(_0xeecc('0x9'));var controller=require(_0xeecc('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xeecc('0xb')]);router['get']('/:id',auth[_0xeecc('0xc')](),controller[_0xeecc('0xd')]);router[_0xeecc('0xe')]('/',auth[_0xeecc('0xc')](),controller[_0xeecc('0xf')]);router[_0xeecc('0x10')](_0xeecc('0x11'),auth[_0xeecc('0xc')](),controller[_0xeecc('0x12')]);router[_0xeecc('0x13')](_0xeecc('0x11'),auth['isAuthenticated'](),controller[_0xeecc('0x14')]);module[_0xeecc('0x15')]=router; \ No newline at end of file +var _0x0d7b=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x351fd5,_0x136eb9){var _0x20a855=function(_0x3cc8e1){while(--_0x3cc8e1){_0x351fd5['push'](_0x351fd5['shift']());}};_0x20a855(++_0x136eb9);}(_0x0d7b,0xc4));var _0xb0d7=function(_0xe8b4b2,_0x23804c){_0xe8b4b2=_0xe8b4b2-0x0;var _0x5e0eb7=_0x0d7b[_0xe8b4b2];return _0x5e0eb7;};'use strict';var multer=require(_0xb0d7('0x0'));var util=require(_0xb0d7('0x1'));var path=require(_0xb0d7('0x2'));var timeout=require(_0xb0d7('0x3'));var express=require(_0xb0d7('0x4'));var router=express[_0xb0d7('0x5')]();var fs_extra=require(_0xb0d7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb0d7('0x7'));var config=require(_0xb0d7('0x8'));var controller=require(_0xb0d7('0x9'));router[_0xb0d7('0xa')]('/',auth[_0xb0d7('0xb')](),controller[_0xb0d7('0xc')]);router[_0xb0d7('0xa')](_0xb0d7('0xd'),auth[_0xb0d7('0xb')](),controller['show']);router[_0xb0d7('0xe')]('/',auth[_0xb0d7('0xb')](),controller[_0xb0d7('0xf')]);router[_0xb0d7('0x10')](_0xb0d7('0xd'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0x11')]);router[_0xb0d7('0x12')](_0xb0d7('0xd'),auth[_0xb0d7('0xb')](),controller[_0xb0d7('0x13')]);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 c3736e8..e8ff271 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 _0xe0de=['BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','select','parse','isArray'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xe0de,0xc3));var _0xee0d=function(_0x315e76,_0x4b58a9){_0x315e76=_0x315e76-0x0;var _0x928001=_0xe0de[_0x315e76];return _0x928001;};'use strict';var Sequelize=require('sequelize');var _=require(_0xee0d('0x0'));module[_0xee0d('0x1')]={'name':{'type':Sequelize[_0xee0d('0x2')],'get':function(_0x179b5e){return this[_0xee0d('0x3')](_0xee0d('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4d0215){this[_0xee0d('0x5')](_0xee0d('0x4'),_0x4d0215?_0x4d0215:this[_0xee0d('0x3')](_0xee0d('0x6')));}},'type':{'type':Sequelize[_0xee0d('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xee0d('0x8')](_0xee0d('0x9')),'get':function(){if(this[_0xee0d('0x3')]('type')===_0xee0d('0xa')){return JSON[_0xee0d('0xb')](this[_0xee0d('0x3')]('values'));}else{return this[_0xee0d('0x3')]('values');}},'set':function(_0x2ecfe5){if(Array[_0xee0d('0xc')](_0x2ecfe5)){this[_0xee0d('0x5')]('values',JSON['stringify'](_0x2ecfe5));}else{this[_0xee0d('0x5')]('values',_0x2ecfe5);}}},'required':{'type':Sequelize[_0xee0d('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xee0d('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xee0d('0xe')](_0xee0d('0xf'))}}; \ No newline at end of file +var _0x2153=['setDataValue','TEXT','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','STRING'];(function(_0x1bc71d,_0x26e5f9){var _0x1c6acf=function(_0x3ec174){while(--_0x3ec174){_0x1bc71d['push'](_0x1bc71d['shift']());}};_0x1c6acf(++_0x26e5f9);}(_0x2153,0x12c));var _0x3215=function(_0x52a1b4,_0x1bafba){_0x52a1b4=_0x52a1b4-0x0;var _0xf6826d=_0x2153[_0x52a1b4];return _0xf6826d;};'use strict';var Sequelize=require(_0x3215('0x0'));var _=require('lodash');module[_0x3215('0x1')]={'name':{'type':Sequelize[_0x3215('0x2')],'get':function(_0x441bc4){return this[_0x3215('0x3')](_0x3215('0x4'));}},'alias':{'type':Sequelize[_0x3215('0x5')],'allowNull':![],'set':function(_0x835e69){this[_0x3215('0x6')]('alias',_0x835e69?_0x835e69:this[_0x3215('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x3215('0x7')]('long'),'get':function(){if(this[_0x3215('0x3')](_0x3215('0x8'))===_0x3215('0x9')){return JSON[_0x3215('0xa')](this[_0x3215('0x3')](_0x3215('0xb')));}else{return this[_0x3215('0x3')]('values');}},'set':function(_0x1d3faf){if(Array[_0x3215('0xc')](_0x1d3faf)){this[_0x3215('0x6')]('values',JSON[_0x3215('0xd')](_0x1d3faf));}else{this[_0x3215('0x6')](_0x3215('0xb'),_0x1d3faf);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3215('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3215('0xf')](_0x3215('0x10'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 358ee8c..cf4feb6 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 _0x1291=['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','count','limit','set','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','CmCustomField','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','length','body','find','sequelize','create','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x15d9b4,_0x427b76){var _0x25543e=function(_0x410b00){while(--_0x410b00){_0x15d9b4['push'](_0x15d9b4['shift']());}};_0x25543e(++_0x427b76);}(_0x1291,0x152));var _0x1129=function(_0x2bd8a8,_0x22562c){_0x2bd8a8=_0x2bd8a8-0x0;var _0x3106bb=_0x1291[_0x2bd8a8];return _0x3106bb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1129('0x0'));var zipdir=require(_0x1129('0x1'));var jsonpatch=require(_0x1129('0x2'));var rp=require(_0x1129('0x3'));var moment=require(_0x1129('0x4'));var BPromise=require(_0x1129('0x5'));var Mustache=require(_0x1129('0x6'));var util=require('util');var path=require('path');var sox=require(_0x1129('0x7'));var csv=require(_0x1129('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1129('0x9'));var _=require(_0x1129('0xa'));var squel=require(_0x1129('0xb'));var crypto=require(_0x1129('0xc'));var jsforce=require(_0x1129('0xd'));var deskjs=require(_0x1129('0xe'));var toCsv=require(_0x1129('0x8'));var querystring=require(_0x1129('0xf'));var Papa=require(_0x1129('0x10'));var Redis=require(_0x1129('0x11'));var authService=require(_0x1129('0x12'));var qs=require(_0x1129('0x13'));var as=require(_0x1129('0x14'));var hardwareService=require(_0x1129('0x15'));var logger=require(_0x1129('0x16'))(_0x1129('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1129('0x18'));var db=require(_0x1129('0x19'))['db'];function respondWithStatusCode(_0x3f3fe6,_0x2625b8){_0x2625b8=_0x2625b8||0xcc;return function(_0x442533){if(_0x442533){return _0x3f3fe6['sendStatus'](_0x2625b8);}return _0x3f3fe6[_0x1129('0x1a')](_0x2625b8)[_0x1129('0x1b')]();};}function respondWithResult(_0x4f70d3,_0x5e4a9b){_0x5e4a9b=_0x5e4a9b||0xc8;return function(_0x4a2a43){if(_0x4a2a43){return _0x4f70d3['status'](_0x5e4a9b)[_0x1129('0x1c')](_0x4a2a43);}};}function respondWithFilteredResult(_0x478cab,_0x458652){return function(_0x2dc51c){if(_0x2dc51c){var _0x27d24f=typeof _0x458652[_0x1129('0x1d')]===_0x1129('0x1e')&&typeof _0x458652['limit']===_0x1129('0x1e');var _0x5c3099=_0x2dc51c[_0x1129('0x1f')];var _0xf9f3f6=_0x27d24f?0x0:_0x458652[_0x1129('0x1d')];var _0x491b5f=_0x27d24f?_0x2dc51c['count']:_0x458652[_0x1129('0x1d')]+_0x458652[_0x1129('0x20')];var _0x80eee0;if(_0x491b5f>=_0x5c3099){_0x491b5f=_0x5c3099;_0x80eee0=0xc8;}else{_0x80eee0=0xce;}_0x478cab[_0x1129('0x1a')](_0x80eee0);return _0x478cab[_0x1129('0x21')]('Content-Range',_0xf9f3f6+'-'+_0x491b5f+'/'+_0x5c3099)[_0x1129('0x1c')](_0x2dc51c);}return null;};}function patchUpdates(_0x5d4916){return function(_0x371dab){try{jsonpatch['apply'](_0x371dab,_0x5d4916,!![]);}catch(_0x308385){return BPromise[_0x1129('0x22')](_0x308385);}return _0x371dab[_0x1129('0x23')]();};}function saveUpdates(_0x1825fc,_0x18db6b){return function(_0x5b844f){if(_0x5b844f){return _0x5b844f[_0x1129('0x24')](_0x1825fc)['then'](function(_0x566029){return _0x566029;});}return null;};}function removeEntity(_0x5ec1dc,_0x331b2a){return function(_0x1ab1f6){if(_0x1ab1f6){return _0x1ab1f6[_0x1129('0x25')]()['then'](function(){_0x5ec1dc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56d992,_0xf9f164){return function(_0x89e810){if(!_0x89e810){_0x56d992[_0x1129('0x26')](0x194);}return _0x89e810;};}function handleError(_0xab018d,_0x533784){_0x533784=_0x533784||0x1f4;return function(_0x174892){logger[_0x1129('0x27')](_0x174892[_0x1129('0x28')]);if(_0x174892['name']){delete _0x174892[_0x1129('0x29')];}_0xab018d[_0x1129('0x1a')](_0x533784)[_0x1129('0x2a')](_0x174892);};}exports[_0x1129('0x2b')]=function(_0x2cc9d0,_0x15db29){var _0x11f1a3={},_0x2cc97c={},_0x2e15be={'count':0x0,'rows':[]};var _0x6c0b78=_[_0x1129('0x2c')](db[_0x1129('0x2d')]['rawAttributes'],function(_0x463016){return{'name':_0x463016['fieldName'],'type':_0x463016[_0x1129('0x2e')][_0x1129('0x2f')]};});_0x2cc97c[_0x1129('0x30')]=_[_0x1129('0x31')](_[_0x1129('0x2c')](_0x6c0b78,'name'),[_0x1129('0x29')]);_0x2cc97c[_0x1129('0x32')]=_[_0x1129('0x33')](_0x2cc9d0[_0x1129('0x32')]);_0x2cc97c[_0x1129('0x34')]=_[_0x1129('0x35')](_0x2cc97c[_0x1129('0x30')],_0x2cc97c[_0x1129('0x32')]);_0x11f1a3[_0x1129('0x36')]=_['intersection'](_0x2cc97c['model'],qs[_0x1129('0x37')](_0x2cc9d0[_0x1129('0x32')][_0x1129('0x37')]));_0x11f1a3[_0x1129('0x36')]=_0x11f1a3[_0x1129('0x36')]['length']?_0x11f1a3[_0x1129('0x36')]:_0x2cc97c['model'];if(!_0x2cc9d0[_0x1129('0x32')][_0x1129('0x38')](_0x1129('0x39'))){_0x11f1a3[_0x1129('0x20')]=qs['limit'](_0x2cc9d0[_0x1129('0x32')]['limit']);_0x11f1a3[_0x1129('0x1d')]=qs[_0x1129('0x1d')](_0x2cc9d0[_0x1129('0x32')][_0x1129('0x1d')]);}_0x11f1a3[_0x1129('0x3a')]=qs[_0x1129('0x3b')](_0x2cc9d0[_0x1129('0x32')][_0x1129('0x3b')]);_0x11f1a3[_0x1129('0x3c')]=qs['filters'](_['pick'](_0x2cc9d0[_0x1129('0x32')],_0x2cc97c['filters']),_0x6c0b78);if(_0x2cc9d0[_0x1129('0x32')][_0x1129('0x3d')]){_0x11f1a3['where']=_[_0x1129('0x3e')](_0x11f1a3[_0x1129('0x3c')],{'$or':_[_0x1129('0x2c')](_0x6c0b78,function(_0x5e9fee){if(_0x5e9fee[_0x1129('0x2e')]!=='VIRTUAL'){var _0x13d99e={};_0x13d99e[_0x5e9fee['name']]={'$like':'%'+_0x2cc9d0[_0x1129('0x32')]['filter']+'%'};return _0x13d99e;}})});}_0x11f1a3=_[_0x1129('0x3e')]({},_0x11f1a3,_0x2cc9d0['options']);var _0x1e0d90={'where':_0x11f1a3[_0x1129('0x3c')]};return db[_0x1129('0x2d')][_0x1129('0x1f')](_0x1e0d90)['then'](function(_0x25df90){_0x2e15be[_0x1129('0x1f')]=_0x25df90;if(_0x2cc9d0[_0x1129('0x32')][_0x1129('0x3f')]){_0x11f1a3[_0x1129('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0x1129('0x41')](_0x11f1a3);})[_0x1129('0x42')](function(_0xec52fa){_0x2e15be[_0x1129('0x43')]=_0xec52fa;return _0x2e15be;})[_0x1129('0x42')](respondWithFilteredResult(_0x15db29,_0x11f1a3))[_0x1129('0x44')](handleError(_0x15db29,null));};exports[_0x1129('0x45')]=function(_0x1edfa1,_0x2f9349){var _0x5f13db={'raw':!![],'where':{'id':_0x1edfa1[_0x1129('0x46')]['id']}},_0x1aba9d={};_0x1aba9d[_0x1129('0x30')]=_[_0x1129('0x33')](db[_0x1129('0x2d')]['rawAttributes']);_0x1aba9d['query']=_[_0x1129('0x33')](_0x1edfa1[_0x1129('0x32')]);_0x1aba9d[_0x1129('0x34')]=_[_0x1129('0x35')](_0x1aba9d[_0x1129('0x30')],_0x1aba9d[_0x1129('0x32')]);_0x5f13db[_0x1129('0x36')]=_[_0x1129('0x35')](_0x1aba9d[_0x1129('0x30')],qs[_0x1129('0x37')](_0x1edfa1[_0x1129('0x32')][_0x1129('0x37')]));_0x5f13db[_0x1129('0x36')]=_0x5f13db[_0x1129('0x36')][_0x1129('0x47')]?_0x5f13db['attributes']:_0x1aba9d[_0x1129('0x30')];if(_0x1edfa1[_0x1129('0x32')][_0x1129('0x3f')]){_0x5f13db[_0x1129('0x40')]=[{'all':!![]}];}_0x5f13db=_[_0x1129('0x3e')]({},_0x5f13db,_0x1edfa1['options']);return db[_0x1129('0x2d')]['find'](_0x5f13db)[_0x1129('0x42')](handleEntityNotFound(_0x2f9349,null))['then'](respondWithResult(_0x2f9349,null))[_0x1129('0x44')](handleError(_0x2f9349,null));};exports[_0x1129('0x24')]=function(_0x1caac2,_0x4a1ed2){if(_0x1caac2[_0x1129('0x48')]['id']){delete _0x1caac2[_0x1129('0x48')]['id'];}return db[_0x1129('0x2d')][_0x1129('0x49')]({'where':{'id':_0x1caac2['params']['id']}})[_0x1129('0x42')](handleEntityNotFound(_0x4a1ed2,null))[_0x1129('0x42')](saveUpdates(_0x1caac2[_0x1129('0x48')],null))[_0x1129('0x42')](respondWithResult(_0x4a1ed2,null))[_0x1129('0x44')](handleError(_0x4a1ed2,null));};exports['destroy']=function(_0x2708cc,_0x2bca29){return db['CmCustomField'][_0x1129('0x49')]({'where':{'id':_0x2708cc['params']['id']}})['then'](handleEntityNotFound(_0x2bca29,null))[_0x1129('0x42')](removeEntity(_0x2bca29,null))[_0x1129('0x44')](handleError(_0x2bca29,null));};exports['create']=function(_0x374127,_0x30a05d){var _0x3d5400;return db[_0x1129('0x4a')]['transaction'](function(_0x417f80){return db[_0x1129('0x2d')][_0x1129('0x4b')](_0x374127[_0x1129('0x48')],{'transaction':_0x417f80})[_0x1129('0x42')](function(_0x4fce2e){_0x3d5400=_0x4fce2e;var _0x1a3372={'type':db[_0x1129('0x4c')][_0x1129('0x4d')],'transaction':_0x417f80};switch(_0x374127[_0x1129('0x48')][_0x1129('0x2e')]){case _0x1129('0x4e'):_0x1a3372[_0x1129('0x2e')]=db[_0x1129('0x4c')][_0x1129('0x4d')];break;case'number':_0x1a3372[_0x1129('0x2e')]=db[_0x1129('0x4c')][_0x1129('0x4f')];break;case _0x1129('0x50'):_0x1a3372[_0x1129('0x2e')]=db[_0x1129('0x4c')][_0x1129('0x51')];_0x1a3372[_0x1129('0x52')]=![];break;default:}return db[_0x1129('0x4a')][_0x1129('0x53')][_0x1129('0x54')](_0x1129('0x55'),util[_0x1129('0x56')](_0x1129('0x57'),_0x3d5400['id']),_0x1a3372);})[_0x1129('0x42')](function(){return _0x3d5400;});})[_0x1129('0x42')](respondWithResult(_0x30a05d,0xc9))[_0x1129('0x44')](handleError(_0x30a05d,null));}; \ No newline at end of file +var _0xefdc=['fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','key','differenceBy','keys','query','filters','intersection','model','attributes'];(function(_0x38cf75,_0x2aa799){var _0x222b18=function(_0x3a11b9){while(--_0x3a11b9){_0x38cf75['push'](_0x38cf75['shift']());}};_0x222b18(++_0x2aa799);}(_0xefdc,0x196));var _0xcefd=function(_0x134448,_0x591d7b){_0x134448=_0x134448-0x0;var _0x2d52a1=_0xefdc[_0x134448];return _0x2d52a1;};'use strict';var emlformat=require(_0xcefd('0x0'));var rimraf=require(_0xcefd('0x1'));var zipdir=require(_0xcefd('0x2'));var jsonpatch=require(_0xcefd('0x3'));var rp=require(_0xcefd('0x4'));var moment=require(_0xcefd('0x5'));var BPromise=require(_0xcefd('0x6'));var Mustache=require(_0xcefd('0x7'));var util=require('util');var path=require(_0xcefd('0x8'));var sox=require(_0xcefd('0x9'));var csv=require('to-csv');var ejs=require(_0xcefd('0xa'));var fs=require('fs');var fs_extra=require(_0xcefd('0xb'));var _=require(_0xcefd('0xc'));var squel=require('squel');var crypto=require(_0xcefd('0xd'));var jsforce=require(_0xcefd('0xe'));var deskjs=require(_0xcefd('0xf'));var toCsv=require(_0xcefd('0x10'));var querystring=require(_0xcefd('0x11'));var Papa=require(_0xcefd('0x12'));var Redis=require(_0xcefd('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcefd('0x14'));var as=require(_0xcefd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcefd('0x16'))('api');var utils=require(_0xcefd('0x17'));var config=require(_0xcefd('0x18'));var licenseUtil=require(_0xcefd('0x19'));var db=require(_0xcefd('0x1a'))['db'];function respondWithStatusCode(_0x53856a,_0x4dac7d){_0x4dac7d=_0x4dac7d||0xcc;return function(_0x538b4c){if(_0x538b4c){return _0x53856a[_0xcefd('0x1b')](_0x4dac7d);}return _0x53856a[_0xcefd('0x1c')](_0x4dac7d)[_0xcefd('0x1d')]();};}function respondWithResult(_0x3eb416,_0x3e7bbc){_0x3e7bbc=_0x3e7bbc||0xc8;return function(_0xab43be){if(_0xab43be){return _0x3eb416[_0xcefd('0x1c')](_0x3e7bbc)[_0xcefd('0x1e')](_0xab43be);}};}function respondWithFilteredResult(_0x132f66,_0x538108){return function(_0x1b495c){if(_0x1b495c){var _0x5e77ac=typeof _0x538108[_0xcefd('0x1f')]===_0xcefd('0x20')&&typeof _0x538108[_0xcefd('0x21')]===_0xcefd('0x20');var _0x56e721=_0x1b495c[_0xcefd('0x22')];var _0x305b85=_0x5e77ac?0x0:_0x538108['offset'];var _0x207a5a=_0x5e77ac?_0x1b495c[_0xcefd('0x22')]:_0x538108[_0xcefd('0x1f')]+_0x538108['limit'];var _0x3a0eb9;if(_0x207a5a>=_0x56e721){_0x207a5a=_0x56e721;_0x3a0eb9=0xc8;}else{_0x3a0eb9=0xce;}_0x132f66[_0xcefd('0x1c')](_0x3a0eb9);return _0x132f66[_0xcefd('0x23')](_0xcefd('0x24'),_0x305b85+'-'+_0x207a5a+'/'+_0x56e721)[_0xcefd('0x1e')](_0x1b495c);}return null;};}function patchUpdates(_0x1a8fdd){return function(_0x276a03){try{jsonpatch[_0xcefd('0x25')](_0x276a03,_0x1a8fdd,!![]);}catch(_0x83ade1){return BPromise['reject'](_0x83ade1);}return _0x276a03[_0xcefd('0x26')]();};}function saveUpdates(_0x397788,_0x32a8c5){return function(_0x4fddad){if(_0x4fddad){return _0x4fddad[_0xcefd('0x27')](_0x397788)[_0xcefd('0x28')](function(_0x410fee){return _0x410fee;});}return null;};}function removeEntity(_0x3b6565,_0x1ba80f){return function(_0x118dd8){if(_0x118dd8){return _0x118dd8[_0xcefd('0x29')]()[_0xcefd('0x28')](function(){_0x3b6565[_0xcefd('0x1c')](0xcc)[_0xcefd('0x1d')]();});}};}function handleEntityNotFound(_0x347431,_0x51bf50){return function(_0xc77954){if(!_0xc77954){_0x347431[_0xcefd('0x1b')](0x194);}return _0xc77954;};}function handleError(_0x10c1a8,_0x8b97a){_0x8b97a=_0x8b97a||0x1f4;return function(_0xee6339){logger[_0xcefd('0x2a')](_0xee6339[_0xcefd('0x2b')]);if(_0xee6339[_0xcefd('0x2c')]){delete _0xee6339[_0xcefd('0x2c')];}_0x10c1a8[_0xcefd('0x1c')](_0x8b97a)[_0xcefd('0x2d')](_0xee6339);};}exports[_0xcefd('0x2e')]=function(_0x12e068,_0x2454a7){var _0x12b087={},_0x329973={},_0x368cf2={'count':0x0,'rows':[]};var _0x37bca3=_[_0xcefd('0x2f')](db[_0xcefd('0x30')][_0xcefd('0x31')],function(_0x3ee7a7){return{'name':_0x3ee7a7[_0xcefd('0x32')],'type':_0x3ee7a7['type'][_0xcefd('0x33')]};});_0x329973['model']=_[_0xcefd('0x34')](_[_0xcefd('0x2f')](_0x37bca3,_0xcefd('0x2c')),[_0xcefd('0x2c')]);_0x329973['query']=_[_0xcefd('0x35')](_0x12e068[_0xcefd('0x36')]);_0x329973[_0xcefd('0x37')]=_[_0xcefd('0x38')](_0x329973[_0xcefd('0x39')],_0x329973[_0xcefd('0x36')]);_0x12b087[_0xcefd('0x3a')]=_[_0xcefd('0x38')](_0x329973[_0xcefd('0x39')],qs[_0xcefd('0x3b')](_0x12e068[_0xcefd('0x36')][_0xcefd('0x3b')]));_0x12b087[_0xcefd('0x3a')]=_0x12b087['attributes'][_0xcefd('0x3c')]?_0x12b087[_0xcefd('0x3a')]:_0x329973[_0xcefd('0x39')];if(!_0x12e068[_0xcefd('0x36')][_0xcefd('0x3d')]('nolimit')){_0x12b087[_0xcefd('0x21')]=qs['limit'](_0x12e068['query'][_0xcefd('0x21')]);_0x12b087[_0xcefd('0x1f')]=qs[_0xcefd('0x1f')](_0x12e068['query'][_0xcefd('0x1f')]);}_0x12b087['order']=qs[_0xcefd('0x3e')](_0x12e068[_0xcefd('0x36')][_0xcefd('0x3e')]);_0x12b087[_0xcefd('0x3f')]=qs[_0xcefd('0x37')](_[_0xcefd('0x40')](_0x12e068[_0xcefd('0x36')],_0x329973['filters']),_0x37bca3);if(_0x12e068[_0xcefd('0x36')][_0xcefd('0x41')]){_0x12b087['where']=_[_0xcefd('0x42')](_0x12b087['where'],{'$or':_[_0xcefd('0x2f')](_0x37bca3,function(_0x370665){if(_0x370665[_0xcefd('0x43')]!==_0xcefd('0x44')){var _0x473408={};_0x473408[_0x370665[_0xcefd('0x2c')]]={'$like':'%'+_0x12e068['query'][_0xcefd('0x41')]+'%'};return _0x473408;}})});}_0x12b087=_[_0xcefd('0x42')]({},_0x12b087,_0x12e068[_0xcefd('0x45')]);var _0x2f1434={'where':_0x12b087[_0xcefd('0x3f')]};return db[_0xcefd('0x30')][_0xcefd('0x22')](_0x2f1434)['then'](function(_0x519c33){_0x368cf2['count']=_0x519c33;if(_0x12e068[_0xcefd('0x36')]['includeAll']){_0x12b087[_0xcefd('0x46')]=[{'all':!![]}];}return db[_0xcefd('0x30')][_0xcefd('0x47')](_0x12b087);})['then'](function(_0x2841be){_0x368cf2[_0xcefd('0x48')]=_0x2841be;return _0x368cf2;})[_0xcefd('0x28')](respondWithFilteredResult(_0x2454a7,_0x12b087))[_0xcefd('0x49')](handleError(_0x2454a7,null));};exports[_0xcefd('0x4a')]=function(_0x27323a,_0x1cbe64){var _0x5d61ea={'raw':!![],'where':{'id':_0x27323a[_0xcefd('0x4b')]['id']}},_0x4898e9={};_0x4898e9[_0xcefd('0x39')]=_[_0xcefd('0x35')](db[_0xcefd('0x30')]['rawAttributes']);_0x4898e9[_0xcefd('0x36')]=_[_0xcefd('0x35')](_0x27323a[_0xcefd('0x36')]);_0x4898e9[_0xcefd('0x37')]=_[_0xcefd('0x38')](_0x4898e9[_0xcefd('0x39')],_0x4898e9[_0xcefd('0x36')]);_0x5d61ea[_0xcefd('0x3a')]=_['intersection'](_0x4898e9[_0xcefd('0x39')],qs[_0xcefd('0x3b')](_0x27323a[_0xcefd('0x36')]['fields']));_0x5d61ea[_0xcefd('0x3a')]=_0x5d61ea[_0xcefd('0x3a')][_0xcefd('0x3c')]?_0x5d61ea[_0xcefd('0x3a')]:_0x4898e9[_0xcefd('0x39')];if(_0x27323a['query'][_0xcefd('0x4c')]){_0x5d61ea[_0xcefd('0x46')]=[{'all':!![]}];}_0x5d61ea=_[_0xcefd('0x42')]({},_0x5d61ea,_0x27323a['options']);return db[_0xcefd('0x30')][_0xcefd('0x4d')](_0x5d61ea)['then'](handleEntityNotFound(_0x1cbe64,null))[_0xcefd('0x28')](respondWithResult(_0x1cbe64,null))['catch'](handleError(_0x1cbe64,null));};exports[_0xcefd('0x27')]=function(_0x548ebb,_0x3f6187){if(_0x548ebb[_0xcefd('0x4e')]['id']){delete _0x548ebb['body']['id'];}return db[_0xcefd('0x30')]['find']({'where':{'id':_0x548ebb[_0xcefd('0x4b')]['id']}})[_0xcefd('0x28')](handleEntityNotFound(_0x3f6187,null))['then'](saveUpdates(_0x548ebb[_0xcefd('0x4e')],null))[_0xcefd('0x28')](respondWithResult(_0x3f6187,null))[_0xcefd('0x49')](handleError(_0x3f6187,null));};exports[_0xcefd('0x29')]=function(_0x16e7a6,_0x3be3c6){return db[_0xcefd('0x30')][_0xcefd('0x4d')]({'where':{'id':_0x16e7a6[_0xcefd('0x4b')]['id']}})[_0xcefd('0x28')](handleEntityNotFound(_0x3be3c6,null))[_0xcefd('0x28')](removeEntity(_0x3be3c6,null))[_0xcefd('0x49')](handleError(_0x3be3c6,null));};exports[_0xcefd('0x4f')]=function(_0x3e82b8,_0x348e91){var _0x4af012;return db[_0xcefd('0x50')][_0xcefd('0x51')](function(_0x589acf){return db[_0xcefd('0x30')][_0xcefd('0x4f')](_0x3e82b8['body'],{'transaction':_0x589acf})[_0xcefd('0x28')](function(_0x5bf391){_0x4af012=_0x5bf391;var _0xf3eb5f={'type':db[_0xcefd('0x52')][_0xcefd('0x53')],'transaction':_0x589acf};switch(_0x3e82b8[_0xcefd('0x4e')][_0xcefd('0x43')]){case'text':_0xf3eb5f[_0xcefd('0x43')]=db['Sequelize'][_0xcefd('0x53')];break;case _0xcefd('0x54'):_0xf3eb5f[_0xcefd('0x43')]=db[_0xcefd('0x52')][_0xcefd('0x55')];break;case _0xcefd('0x56'):_0xf3eb5f['type']=db[_0xcefd('0x52')][_0xcefd('0x57')];_0xf3eb5f[_0xcefd('0x58')]=![];break;default:}return db[_0xcefd('0x50')][_0xcefd('0x59')][_0xcefd('0x5a')]('cm_contacts',util[_0xcefd('0x5b')](_0xcefd('0x5c'),_0x4af012['id']),_0xf3eb5f);})[_0xcefd('0x28')](function(){return _0x4af012;});})[_0xcefd('0x28')](respondWithResult(_0x348e91,0xc9))[_0xcefd('0x49')](handleError(_0x348e91,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 83bb1e2..2b6d62f 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 _0xd1dc=['api','moment','bluebird','request-promise','path','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','../../config/logger'];(function(_0x3909e4,_0x47f00a){var _0x18bafc=function(_0x176f65){while(--_0x176f65){_0x3909e4['push'](_0x3909e4['shift']());}};_0x18bafc(++_0x47f00a);}(_0xd1dc,0x174));var _0xcd1d=function(_0x5aa2bd,_0x5c445b){_0x5aa2bd=_0x5aa2bd-0x0;var _0x52bcba=_0xd1dc[_0x5aa2bd];return _0x52bcba;};'use strict';var _=require(_0xcd1d('0x0'));var util=require('util');var logger=require(_0xcd1d('0x1'))(_0xcd1d('0x2'));var moment=require(_0xcd1d('0x3'));var BPromise=require(_0xcd1d('0x4'));var rp=require(_0xcd1d('0x5'));var fs=require('fs');var path=require(_0xcd1d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd1d('0x7'));module[_0xcd1d('0x8')]=function(_0x440c7d,_0x3da58e){return _0x440c7d[_0xcd1d('0x9')]('CmCustomField',attributes,{'tableName':_0xcd1d('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6ab=['request-promise','path','rimraf','./cmCustomField.attributes','exports','util','api','moment','bluebird'];(function(_0x1a49c7,_0x2ab443){var _0x3f5f00=function(_0x5503b7){while(--_0x5503b7){_0x1a49c7['push'](_0x1a49c7['shift']());}};_0x3f5f00(++_0x2ab443);}(_0xc6ab,0xef));var _0xbc6a=function(_0x1f9ffb,_0x2e8a17){_0x1f9ffb=_0x1f9ffb-0x0;var _0x570922=_0xc6ab[_0x1f9ffb];return _0x570922;};'use strict';var _=require('lodash');var util=require(_0xbc6a('0x0'));var logger=require('../../config/logger')(_0xbc6a('0x1'));var moment=require(_0xbc6a('0x2'));var BPromise=require(_0xbc6a('0x3'));var rp=require(_0xbc6a('0x4'));var fs=require('fs');var path=require(_0xbc6a('0x5'));var rimraf=require(_0xbc6a('0x6'));var config=require('../../config/environment');var attributes=require(_0xbc6a('0x7'));module[_0xbc6a('0x8')]=function(_0x3dc911,_0x3ca8fc){return _0x3dc911['define']('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 4a9c2cf..27f51db 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 _0xccf3=['rpc','../../config/environment','jayson/promise','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xccf3,0xeb));var _0x3ccf=function(_0x3f9014,_0x46d8f5){_0x3f9014=_0x3f9014-0x0;var _0x3a6151=_0xccf3[_0x3f9014];return _0x3a6151;};'use strict';var _=require(_0x3ccf('0x0'));var util=require(_0x3ccf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3ccf('0x2'));var fs=require('fs');var Redis=require(_0x3ccf('0x3'));var db=require(_0x3ccf('0x4'))['db'];var utils=require(_0x3ccf('0x5'));var logger=require(_0x3ccf('0x6'))(_0x3ccf('0x7'));var config=require(_0x3ccf('0x8'));var jayson=require(_0x3ccf('0x9'));var client=jayson[_0x3ccf('0xa')][_0x3ccf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37689f,_0x45f85d,_0x57ecc3){return new BPromise(function(_0x121627,_0x273a6f){return client['request'](_0x37689f,_0x57ecc3)[_0x3ccf('0xc')](function(_0x5b6e13){logger['info'](_0x3ccf('0xd'),_0x45f85d,_0x3ccf('0xe'));logger[_0x3ccf('0xf')](_0x3ccf('0x10'),_0x45f85d,_0x3ccf('0xe'),JSON['stringify'](_0x5b6e13));if(_0x5b6e13['error']){if(_0x5b6e13[_0x3ccf('0x11')][_0x3ccf('0x12')]===0x1f4){logger[_0x3ccf('0x11')](_0x3ccf('0xd'),_0x45f85d,_0x5b6e13[_0x3ccf('0x11')][_0x3ccf('0x13')]);return _0x273a6f(_0x5b6e13[_0x3ccf('0x11')][_0x3ccf('0x13')]);}logger['error'](_0x3ccf('0xd'),_0x45f85d,_0x5b6e13[_0x3ccf('0x11')][_0x3ccf('0x13')]);return _0x121627(_0x5b6e13[_0x3ccf('0x11')][_0x3ccf('0x13')]);}else{logger['info'](_0x3ccf('0xd'),_0x45f85d,_0x3ccf('0xe'));_0x121627(_0x5b6e13[_0x3ccf('0x14')][_0x3ccf('0x13')]);}})[_0x3ccf('0x15')](function(_0x3cfb36){logger[_0x3ccf('0x11')]('CmCustomField,\x20%s,\x20%s',_0x45f85d,_0x3cfb36);_0x273a6f(_0x3cfb36);});});} \ No newline at end of file +var _0x1afa=['http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x200549,_0x122279){var _0x1b13c8=function(_0x32c2b4){while(--_0x32c2b4){_0x200549['push'](_0x200549['shift']());}};_0x1b13c8(++_0x122279);}(_0x1afa,0xf3));var _0xa1af=function(_0x572c2d,_0x4a7369){_0x572c2d=_0x572c2d-0x0;var _0x300e02=_0x1afa[_0x572c2d];return _0x300e02;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa1af('0x0'));var rs=require(_0xa1af('0x1'));var fs=require('fs');var Redis=require(_0xa1af('0x2'));var db=require(_0xa1af('0x3'))['db'];var utils=require(_0xa1af('0x4'));var logger=require(_0xa1af('0x5'))(_0xa1af('0x6'));var config=require(_0xa1af('0x7'));var jayson=require(_0xa1af('0x8'));var client=jayson['client'][_0xa1af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd46740,_0x157cc7,_0x346b13){return new BPromise(function(_0x12e260,_0x1dbaae){return client[_0xa1af('0xa')](_0xd46740,_0x346b13)[_0xa1af('0xb')](function(_0xcde52c){logger['info'](_0xa1af('0xc'),_0x157cc7,_0xa1af('0xd'));logger[_0xa1af('0xe')](_0xa1af('0xf'),_0x157cc7,_0xa1af('0xd'),JSON['stringify'](_0xcde52c));if(_0xcde52c[_0xa1af('0x10')]){if(_0xcde52c[_0xa1af('0x10')][_0xa1af('0x11')]===0x1f4){logger[_0xa1af('0x10')](_0xa1af('0xc'),_0x157cc7,_0xcde52c[_0xa1af('0x10')][_0xa1af('0x12')]);return _0x1dbaae(_0xcde52c[_0xa1af('0x10')][_0xa1af('0x12')]);}logger[_0xa1af('0x10')](_0xa1af('0xc'),_0x157cc7,_0xcde52c[_0xa1af('0x10')]['message']);return _0x12e260(_0xcde52c[_0xa1af('0x10')]['message']);}else{logger[_0xa1af('0x13')](_0xa1af('0xc'),_0x157cc7,'request\x20sent');_0x12e260(_0xcde52c['result'][_0xa1af('0x12')]);}})[_0xa1af('0x14')](function(_0x210db3){logger[_0xa1af('0x10')]('CmCustomField,\x20%s,\x20%s',_0x157cc7,_0x210db3);_0x1dbaae(_0x210db3);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 5608124..0083197 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 _0xe0c3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','isAuthenticated','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x10a2cd,_0x1d567d){var _0x500f18=function(_0x478ca8){while(--_0x478ca8){_0x10a2cd['push'](_0x10a2cd['shift']());}};_0x500f18(++_0x1d567d);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3e0c('0x0'));var util=require('util');var path=require(_0x3e0c('0x1'));var timeout=require(_0x3e0c('0x2'));var express=require(_0x3e0c('0x3'));var router=express[_0x3e0c('0x4')]();var fs_extra=require(_0x3e0c('0x5'));var auth=require(_0x3e0c('0x6'));var interaction=require(_0x3e0c('0x7'));var config=require(_0x3e0c('0x8'));var controller=require(_0x3e0c('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x3e0c('0xa')]);router[_0x3e0c('0xb')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0xe')]);router[_0x3e0c('0xf')]('/',auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x10')]);router[_0x3e0c('0x11')](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller['update']);router['delete'](_0x3e0c('0xc'),auth[_0x3e0c('0xd')](),controller[_0x3e0c('0x12')]);module[_0x3e0c('0x13')]=router; \ No newline at end of file +var _0x3fe7=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x5c259b,_0x5d8ec8){var _0x52d930=function(_0x132e0e){while(--_0x132e0e){_0x5c259b['push'](_0x5c259b['shift']());}};_0x52d930(++_0x5d8ec8);}(_0x3fe7,0x97));var _0x73fe=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x3fe7[_0x2b152a];return _0x2ad4c7;};'use strict';var multer=require(_0x73fe('0x0'));var util=require(_0x73fe('0x1'));var path=require(_0x73fe('0x2'));var timeout=require(_0x73fe('0x3'));var express=require('express');var router=express[_0x73fe('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x73fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73fe('0x6'));var controller=require(_0x73fe('0x7'));router['get']('/',auth[_0x73fe('0x8')](),controller['index']);router[_0x73fe('0x9')](_0x73fe('0xa'),auth[_0x73fe('0x8')](),controller[_0x73fe('0xb')]);router[_0x73fe('0xc')]('/',auth[_0x73fe('0x8')](),controller[_0x73fe('0xd')]);router[_0x73fe('0xe')](_0x73fe('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x73fe('0xf')](_0x73fe('0xa'),auth[_0x73fe('0x8')](),controller[_0x73fe('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 197900d..a88761e 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 _0x4729=['contactListQueue','STRING','moment','sequelize','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','DATE'];(function(_0x11f167,_0x1b1d7e){var _0x29e67d=function(_0x3a973a){while(--_0x3a973a){_0x11f167['push'](_0x11f167['shift']());}};_0x29e67d(++_0x1b1d7e);}(_0x4729,0x134));var _0x9472=function(_0xce202a,_0x14ede1){_0xce202a=_0xce202a-0x0;var _0xbe5f4c=_0x4729[_0xce202a];return _0xbe5f4c;};'use strict';var moment=require(_0x9472('0x0'));var Sequelize=require(_0x9472('0x1'));module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9472('0x2')](_0x9472('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9472('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9472('0x6')]},'priority':{'type':Sequelize[_0x9472('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9472('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9472('0x4')],'unique':_0x9472('0x7')},'ListId':{'type':Sequelize[_0x9472('0x4')],'unique':_0x9472('0x7')},'UserId':{'type':Sequelize[_0x9472('0x4')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x9472('0x7')},'CampaignId':{'type':Sequelize[_0x9472('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9472('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9472('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9472('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0x9472('0x6')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x1d3a=['contactListQueue','moment','sequelize','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','BOOLEAN'];(function(_0x5cc649,_0x441ba3){var _0x4f5f79=function(_0x70e7c8){while(--_0x70e7c8){_0x5cc649['push'](_0x5cc649['shift']());}};_0x4f5f79(++_0x441ba3);}(_0x1d3a,0x14b));var _0xa1d3=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x1d3a[_0x5d4607];return _0x5e4a86;};'use strict';var moment=require(_0xa1d3('0x0'));var Sequelize=require(_0xa1d3('0x1'));module[_0xa1d3('0x2')]={'phone':{'type':Sequelize[_0xa1d3('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa1d3('0x4')],'defaultValue':moment()[_0xa1d3('0x5')](_0xa1d3('0x6'))},'countbusyretry':{'type':Sequelize[_0xa1d3('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa1d3('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa1d3('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xa1d3('0x7')](0x2)[_0xa1d3('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa1d3('0x9')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xa1d3('0xa')},'ListId':{'type':Sequelize[_0xa1d3('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xa1d3('0x7')],'unique':_0xa1d3('0xa')},'CampaignId':{'type':Sequelize[_0xa1d3('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa1d3('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa1d3('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa1d3('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa1d3('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa1d3('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa1d3('0x4')],'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 2378adf..8d0c9fd 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 _0x6c7b=['Company','CmList','dialActive','outbound','preview','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','timezones','push','moment','api','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','name','send','index','map','CmHopper','fieldName','key','query','filters','model','concat','$and','$gt','$gte','$lt','$lte','$eq','$not','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contains','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','rows','show','keys','rawAttributes','includeAll','find','catch','body','params','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','create','CmHopperAdditionalPhone','end','getVoiceQueues','dialOrderByScheduledAt','transaction','value','direction','isEmpty','ASC','scheduledAt','DESC','sequelize','literal','hopperIds','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','List','Queue','getPreviewRecall','CmCompany'];(function(_0x4df5bf,_0x1a5037){var _0x3b5a66=function(_0x24c5a4){while(--_0x24c5a4){_0x4df5bf['push'](_0x4df5bf['shift']());}};_0x3b5a66(++_0x1a5037);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x2d7209,_0x43a4f3){_0x2d7209=_0x2d7209-0x0;var _0x3c9be7=_0x6c7b[_0x2d7209];return _0x3c9be7;};'use strict';var moment=require(_0xb6c7('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xb6c7('0x1'));var shared=require('../../config/environment');var db=require(_0xb6c7('0x2'))['db'];function respondWithResult(_0x438aa8,_0x35674b){_0x35674b=_0x35674b||0xc8;return function(_0x5857e0){if(_0x5857e0){return _0x438aa8[_0xb6c7('0x3')](_0x35674b)[_0xb6c7('0x4')](_0x5857e0);}};}function respondWithFilteredResult(_0xfe3eb9,_0x219abc){return function(_0xb889c3){if(_0xb889c3){var _0x5dd47a=typeof _0x219abc[_0xb6c7('0x5')]===_0xb6c7('0x6')&&typeof _0x219abc[_0xb6c7('0x7')]===_0xb6c7('0x6');var _0x577c54=_0xb889c3[_0xb6c7('0x8')];var _0x245016=_0x5dd47a?0x0:_0x219abc[_0xb6c7('0x5')];var _0x594dbb=_0x5dd47a?_0xb889c3['count']:_0x219abc[_0xb6c7('0x5')]+_0x219abc[_0xb6c7('0x7')];var _0x2f9c01;if(_0x594dbb>=_0x577c54){_0x594dbb=_0x577c54;_0x2f9c01=0xc8;}else{_0x2f9c01=0xce;}_0xfe3eb9[_0xb6c7('0x3')](_0x2f9c01);return _0xfe3eb9[_0xb6c7('0x9')](_0xb6c7('0xa'),_0x245016+'-'+_0x594dbb+'/'+_0x577c54)[_0xb6c7('0x4')](_0xb889c3);}return null;};}function saveUpdates(_0x50c2de,_0x9b32b7){return function(_0xa858c5){if(_0xa858c5){return _0xa858c5[_0xb6c7('0xb')](_0x50c2de)[_0xb6c7('0xc')](function(_0x4086a1){return _0x4086a1;});}return null;};}function handleEntityNotFound(_0x383ac5,_0x147e4a){return function(_0x561eb4){if(!_0x561eb4){_0x383ac5[_0xb6c7('0xd')](0x194);}return _0x561eb4;};}function handleError(_0x4e4c3f,_0x480d9a){_0x480d9a=_0x480d9a||0x1f4;return function(_0x5d5428){logger[_0xb6c7('0xe')](_0x5d5428['stack']);if(_0x5d5428[_0xb6c7('0xf')]){delete _0x5d5428[_0xb6c7('0xf')];}_0x4e4c3f[_0xb6c7('0x3')](_0x480d9a)[_0xb6c7('0x10')](_0x5d5428);};}exports[_0xb6c7('0x11')]=function(_0x200833,_0x2c819d){var _0x1317f5={},_0x1a591f={},_0xd0434e={'count':0x0,'rows':[]};var _0xef5eb1=_[_0xb6c7('0x12')](db[_0xb6c7('0x13')]['rawAttributes'],function(_0x274f76){return{'name':_0x274f76[_0xb6c7('0x14')],'type':_0x274f76['type'][_0xb6c7('0x15')]};});_0x1a591f['model']=_[_0xb6c7('0x12')](_0xef5eb1,'name');_0x1a591f[_0xb6c7('0x16')]=_['keys'](_0x200833[_0xb6c7('0x16')]);_0x1a591f[_0xb6c7('0x17')]=_['intersection'](_0x1a591f[_0xb6c7('0x18')],_0x1a591f[_0xb6c7('0x16')]);_0x1a591f[_0xb6c7('0x17')]=_[_0xb6c7('0x19')](_0x1a591f[_0xb6c7('0x17')],[_0xb6c7('0x1a'),'$or',_0xb6c7('0x1b'),_0xb6c7('0x1c'),_0xb6c7('0x1d'),_0xb6c7('0x1e'),'$ne',_0xb6c7('0x1f'),_0xb6c7('0x20'),'$between',_0xb6c7('0x21'),_0xb6c7('0x22'),_0xb6c7('0x23'),_0xb6c7('0x24'),'$notLike',_0xb6c7('0x25'),'$notILike',_0xb6c7('0x24'),_0xb6c7('0x26'),_0xb6c7('0x27'),'$contained','$any']);_0x1317f5['attributes']=_[_0xb6c7('0x28')](_0x1a591f[_0xb6c7('0x18')],qs[_0xb6c7('0x29')](_0x200833[_0xb6c7('0x16')][_0xb6c7('0x29')]));_0x1317f5[_0xb6c7('0x2a')]=_0x1317f5[_0xb6c7('0x2a')][_0xb6c7('0x2b')]?_0x1317f5[_0xb6c7('0x2a')]:_0x1a591f[_0xb6c7('0x18')];if(!_0x200833['query'][_0xb6c7('0x2c')]('nolimit')){_0x1317f5[_0xb6c7('0x7')]=qs[_0xb6c7('0x7')](_0x200833[_0xb6c7('0x16')][_0xb6c7('0x7')]);_0x1317f5[_0xb6c7('0x5')]=qs['offset'](_0x200833['query']['offset']);}_0x1317f5[_0xb6c7('0x2d')]=qs[_0xb6c7('0x2e')](_0x200833['query'][_0xb6c7('0x2e')]);_0x1317f5[_0xb6c7('0x2f')]=qs['filters'](_[_0xb6c7('0x30')](_0x200833[_0xb6c7('0x16')],_0x1a591f[_0xb6c7('0x17')]),_0xef5eb1);if(_0x200833[_0xb6c7('0x16')][_0xb6c7('0x31')]){_0x1317f5[_0xb6c7('0x2f')]=_['merge'](_0x1317f5[_0xb6c7('0x2f')],{'$or':_[_0xb6c7('0x12')](_0xef5eb1,function(_0xbf1395){if(_0xbf1395[_0xb6c7('0x32')]!==_0xb6c7('0x33')){var _0x158bf7={};_0x158bf7[_0xbf1395[_0xb6c7('0xf')]]={'$like':'%'+_0x200833['query']['filter']+'%'};return _0x158bf7;}})});}_0x1317f5=_[_0xb6c7('0x34')]({},_0x1317f5,_0x200833[_0xb6c7('0x35')]);var _0x33afa6={'where':_0x1317f5[_0xb6c7('0x2f')]};return db[_0xb6c7('0x13')][_0xb6c7('0x8')](_0x33afa6)[_0xb6c7('0xc')](function(_0x157b86){_0xd0434e[_0xb6c7('0x8')]=_0x157b86;if(_0x200833[_0xb6c7('0x16')]['includeAll']){_0x1317f5[_0xb6c7('0x36')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x1317f5);})[_0xb6c7('0xc')](function(_0x527c7e){_0xd0434e[_0xb6c7('0x37')]=_0x527c7e;return _0xd0434e;})[_0xb6c7('0xc')](respondWithFilteredResult(_0x2c819d,_0x1317f5))['catch'](handleError(_0x2c819d,null));};exports[_0xb6c7('0x38')]=function(_0x22f5b2,_0x42897d){var _0x84861f={'raw':!![],'where':{'id':_0x22f5b2['params']['id']}},_0x3c3374={};_0x3c3374['model']=_[_0xb6c7('0x39')](db[_0xb6c7('0x13')][_0xb6c7('0x3a')]);_0x3c3374[_0xb6c7('0x16')]=_['keys'](_0x22f5b2['query']);_0x3c3374[_0xb6c7('0x17')]=_[_0xb6c7('0x28')](_0x3c3374[_0xb6c7('0x18')],_0x3c3374[_0xb6c7('0x16')]);_0x84861f[_0xb6c7('0x2a')]=_['intersection'](_0x3c3374['model'],qs['fields'](_0x22f5b2[_0xb6c7('0x16')][_0xb6c7('0x29')]));_0x84861f[_0xb6c7('0x2a')]=_0x84861f['attributes'][_0xb6c7('0x2b')]?_0x84861f[_0xb6c7('0x2a')]:_0x3c3374['model'];if(_0x22f5b2[_0xb6c7('0x16')][_0xb6c7('0x3b')]){_0x84861f[_0xb6c7('0x36')]=[{'all':!![]}];}_0x84861f=_[_0xb6c7('0x34')]({},_0x84861f,_0x22f5b2[_0xb6c7('0x35')]);return db['CmHopper'][_0xb6c7('0x3c')](_0x84861f)[_0xb6c7('0xc')](handleEntityNotFound(_0x42897d,null))[_0xb6c7('0xc')](respondWithResult(_0x42897d,null))['catch'](handleError(_0x42897d,null));};exports['create']=function(_0x1565b5,_0x37b131){return db[_0xb6c7('0x13')]['create'](_0x1565b5['body'],{})['then'](respondWithResult(_0x37b131,0xc9))[_0xb6c7('0x3d')](handleError(_0x37b131,null));};exports[_0xb6c7('0xb')]=function(_0x211584,_0x284fe3){if(_0x211584[_0xb6c7('0x3e')]['id']){delete _0x211584[_0xb6c7('0x3e')]['id'];}return db[_0xb6c7('0x13')]['find']({'where':{'id':_0x211584[_0xb6c7('0x3f')]['id']}})[_0xb6c7('0xc')](handleEntityNotFound(_0x284fe3,null))[_0xb6c7('0xc')](saveUpdates(_0x211584[_0xb6c7('0x3e')],null))[_0xb6c7('0xc')](respondWithResult(_0x284fe3,null))['catch'](handleError(_0x284fe3,null));};exports[_0xb6c7('0x40')]=function(_0x40bbff,_0x40292c){return db[_0xb6c7('0x13')][_0xb6c7('0x40')]()[_0xb6c7('0xc')](respondWithResult(_0x40292c,null))['catch'](handleError(_0x40292c,null));};exports[_0xb6c7('0x41')]=function(_0x141cd5,_0x2116cb){var _0x27ce47;var _0x3153c8=_0x141cd5[_0xb6c7('0x3f')]['id'];return db[_0xb6c7('0x13')]['find']({'where':{'id':_0x141cd5['params']['id']}})['then'](handleEntityNotFound(_0x2116cb,null))[_0xb6c7('0xc')](function(_0x22e7a1){if(_0x22e7a1){return _0x22e7a1[_0xb6c7('0x41')]()[_0xb6c7('0xc')](function(_0x2278c0){return _0x2278c0;});}})[_0xb6c7('0xc')](function(_0x581da8){_0x27ce47=_0x581da8;if(_0x581da8){if(_0x581da8['VoiceQueueId']||_0x581da8[_0xb6c7('0x42')]){return db[_0x581da8['VoiceQueueId']?_0xb6c7('0x43'):_0xb6c7('0x44')][_0xb6c7('0x3c')]({'where':{'id':_0x581da8[_0xb6c7('0x45')]?_0x581da8[_0xb6c7('0x45')]:_0x581da8['CampaignId']},'attributes':['id',_0xb6c7('0xf')],'raw':!![]});}}})['then'](function(_0x3956f2){var _0xdfcaa9={};if(_0x3956f2){_[_0xb6c7('0x34')](_0xdfcaa9,_[_0xb6c7('0x46')](_0x27ce47[_0xb6c7('0x47')],['createdAt',_0xb6c7('0x48'),'id']));_0xdfcaa9[_0xb6c7('0x49')]=0x15;_0xdfcaa9[_0xb6c7('0x4a')]=_0xb6c7('0x4b');_0xdfcaa9[_0xb6c7('0x4c')]=_0x3956f2[_0xb6c7('0xf')];_0xdfcaa9[_0xb6c7('0x4d')]=_0x141cd5[_0xb6c7('0x4e')]['name'];_0xdfcaa9[_0xb6c7('0x4f')]=_0x141cd5[_0xb6c7('0x4e')]['id'];_0xdfcaa9[_0xb6c7('0x4b')]=!![];_0xdfcaa9[_0xb6c7('0x50')]=moment()[_0xb6c7('0x51')](_0xb6c7('0x52'));_0xdfcaa9['calleridnum']=_0x27ce47[_0xb6c7('0x53')];_0xdfcaa9[_0xb6c7('0x54')]=_0x27ce47[_0xb6c7('0x45')]?_0xb6c7('0x55'):'ivr';return db[_0xb6c7('0x56')][_0xb6c7('0x3c')]({'where':{'id':_0xdfcaa9[_0xb6c7('0x57')]},'attributes':[_0xb6c7('0x58'),_0xb6c7('0x59')]})[_0xb6c7('0xc')](function(_0x11d67a){if(!_['isNil'](_0x2116cb)&&!_[_0xb6c7('0x5a')](_0x11d67a[_0xb6c7('0x58')])){_0xdfcaa9[_0xb6c7('0x5b')]=_0x11d67a['firstName'];if(!_[_0xb6c7('0x5a')](_0x11d67a[_0xb6c7('0x59')])){_0xdfcaa9[_0xb6c7('0x5b')]+='\x20'+_0x11d67a[_0xb6c7('0x59')];}}})[_0xb6c7('0x5c')](function(){return db['CmHopperFinal'][_0xb6c7('0x5d')](_0xdfcaa9);});}})[_0xb6c7('0xc')](function(_0xa0da40){return db[_0xb6c7('0x5e')][_0xb6c7('0x41')]({'where':{'CmHopperId':_0x3153c8}});})[_0xb6c7('0xc')](function(){return _0x2116cb['status'](0xcc)[_0xb6c7('0x5f')]();})[_0xb6c7('0x3d')](handleError(_0x2116cb,null));};exports['getPreview']=function(_0x30c069,_0x1a41f7){var _0x4ff673=[];return db[_0xb6c7('0x56')][_0xb6c7('0x40')]()[_0xb6c7('0xc')](function(_0x414ddb){_0x4ff673=_[_0xb6c7('0x39')](_0x414ddb);return _0x30c069[_0xb6c7('0x4e')][_0xb6c7('0x60')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xb6c7('0x61'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xb6c7('0xc')](function(_0x54bf0b){if(_0x54bf0b&&_0x54bf0b['length']){return db['sequelize'][_0xb6c7('0x62')](function(_0x4df3c9){var _0x142165={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xb6c7('0x52'))},'VoiceQueueId':{'$in':_['map'](_0x54bf0b,'id')},'$or':[{'UserId':null},{'UserId':_0x30c069[_0xb6c7('0x4e')]['id']}]};var _0x34432b={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x54bf0b)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xb6c7('0x12')]('id')[_0xb6c7('0x63')]()},'$or':[{'UserId':null},{'UserId':_0x30c069[_0xb6c7('0x4e')]['id']}]};var _0xfacd80={'$or':[_0x142165,_0x34432b]};var _0x2cc079=[];if(_0x30c069[_0xb6c7('0x3e')][_0xb6c7('0x64')]&&_0x30c069[_0xb6c7('0x3e')][_0xb6c7('0x64')]==='prev'){if(!_[_0xb6c7('0x65')](_0x30c069[_0xb6c7('0x3e')]['hopperIds'])){_0xfacd80['id']={'$in':_0x30c069[_0xb6c7('0x3e')]['hopperIds']};}_0x2cc079=[['priority',_0xb6c7('0x66')],[_0xb6c7('0x67'),_0x54bf0b[0x0]['dialOrderByScheduledAt']===_0xb6c7('0x66')?_0xb6c7('0x68'):'ASC'],db[_0xb6c7('0x69')][_0xb6c7('0x6a')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xb6c7('0x68')]];}else{if(!_[_0xb6c7('0x65')](_0x30c069['body'][_0xb6c7('0x6b')])){_0xfacd80['id']={'$notIn':_0x30c069['body'][_0xb6c7('0x6b')]};}_0x2cc079=[[_0xb6c7('0x6c'),_0xb6c7('0x68')],[_0xb6c7('0x67'),_0x54bf0b[0x0][_0xb6c7('0x61')]],db[_0xb6c7('0x69')][_0xb6c7('0x6a')](_0xb6c7('0x6d')),['id',_0xb6c7('0x66')]];}return db[_0xb6c7('0x13')][_0xb6c7('0x6e')]({'attributes':['id',_0xb6c7('0x6f'),_0xb6c7('0x53'),_0xb6c7('0x70')],'where':_0xfacd80,'order':_0x2cc079,'transaction':_0x4df3c9,'lock':_0x4df3c9[_0xb6c7('0x71')][_0xb6c7('0x72')],'include':[{'model':db[_0xb6c7('0x56')],'as':_0xb6c7('0x73'),'attributes':_0x4ff673,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xb6c7('0xf')]}]},{'model':db['CmList'],'as':_0xb6c7('0x74'),'attributes':['id',_0xb6c7('0xf')]},{'model':db[_0xb6c7('0x43')],'as':_0xb6c7('0x75'),'attributes':['id',_0xb6c7('0xf'),'dialActive']}]})[_0xb6c7('0xc')](function(_0x1a25a9){if(_0x1a25a9){return _0x1a25a9[_0xb6c7('0xb')]({'UserId':_0x30c069[_0xb6c7('0x4e')]['id']},{'transaction':_0x4df3c9});}});});}})[_0xb6c7('0xc')](handleEntityNotFound(_0x1a41f7,null))[_0xb6c7('0xc')](respondWithResult(_0x1a41f7,null))['catch'](handleError(_0x1a41f7,null));};exports[_0xb6c7('0x76')]=function(_0x5362cb,_0x15391c,_0x234ef7){var _0x23ce66=[];var _0xf3ac9b=_0x5362cb[_0xb6c7('0x3f')]['id'];var _0x456da7=_0x5362cb[_0xb6c7('0x4e')]['id'];return db[_0xb6c7('0x56')][_0xb6c7('0x40')]()[_0xb6c7('0xc')](function(_0x2e917a){_0x23ce66=_[_0xb6c7('0x39')](_0x2e917a);return db[_0xb6c7('0x69')][_0xb6c7('0x62')](function(_0x2e2d5f){const _0x28d7bd={'id':_0xf3ac9b};return db[_0xb6c7('0x13')][_0xb6c7('0x6e')]({'attributes':['id',_0xb6c7('0x6f'),_0xb6c7('0x70')],'where':_0x28d7bd,'transaction':_0x2e2d5f,'lock':_0x2e2d5f[_0xb6c7('0x71')][_0xb6c7('0x72')],'include':[{'model':db[_0xb6c7('0x56')],'as':_0xb6c7('0x73'),'attributes':_0x23ce66,'include':[{'model':db[_0xb6c7('0x77')],'as':_0xb6c7('0x78'),'attributes':['id',_0xb6c7('0xf')]}]},{'model':db[_0xb6c7('0x79')],'as':_0xb6c7('0x74'),'attributes':['id',_0xb6c7('0xf')]},{'model':db[_0xb6c7('0x43')],'as':_0xb6c7('0x75'),'attributes':['id',_0xb6c7('0xf'),_0xb6c7('0x7a')]}]})[_0xb6c7('0xc')](function(_0x3e6851){if(_0x3e6851){return _0x3e6851[_0xb6c7('0xb')]({'UserId':_0x456da7},{'transaction':_0x2e2d5f});}});});})[_0xb6c7('0xc')](handleEntityNotFound(_0x15391c,null))['then'](respondWithResult(_0x15391c,null))[_0xb6c7('0x3d')](handleError(_0x15391c,null));};exports['getOpenContacts']=function(_0x2913bd,_0x388dff){return _0x2913bd['user'][_0xb6c7('0x60')]({'where':{'type':_0xb6c7('0x7b'),'dialActive':!![],'dialMethod':_0xb6c7('0x7c')},'attributes':['id'],'raw':!![]})[_0xb6c7('0xc')](function(_0x5dc818){if(_0x5dc818&&_0x5dc818[_0xb6c7('0x2b')]){return db[_0xb6c7('0x13')][_0xb6c7('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xb6c7('0x51')](_0xb6c7('0x52'))},'VoiceQueueId':{'$in':_[_0xb6c7('0x12')](_0x5dc818,'id')},'$or':[{'UserId':null},{'UserId':_0x2913bd['user']['id']}]}});}return 0x0;})[_0xb6c7('0xc')](function(_0x5b1e5f){if(!_['isNil'](_0x5b1e5f)&&_['isNumber'](_0x5b1e5f)){return _0x388dff[_0xb6c7('0x3')](0xc8)[_0xb6c7('0x4')]({'contacts':_0x5b1e5f});}else{logger[_0xb6c7('0xe')](_0xb6c7('0x7d'),'getOpenContacts',0x194,'entity\x20not\x20found');_0x388dff[_0xb6c7('0xd')](0x194);}})['catch'](handleError(_0x388dff,null));};exports[_0xb6c7('0x7e')]=function(_0x417581,_0x30a5f3){var _0x514a8b=shared[_0xb6c7('0x7f')];var _0x35057a=[];_[_0xb6c7('0x12')](_0x514a8b,function(_0x54aebd){_0x35057a[_0xb6c7('0x80')]({'id':_0x54aebd['name'],'name':_0x54aebd[_0xb6c7('0xf')],'utcOffset':_0x54aebd['utcOffset']});});return _0x30a5f3[_0xb6c7('0x3')](0xc8)[_0xb6c7('0x4')]({'tz':_0x35057a});};exports['getTimezone']=function(_0x483e0b,_0x32c401){var _0x196566=shared[_0xb6c7('0x7f')];var _0x32fd25={};if(!_[_0xb6c7('0x5a')](_0x196566[_0x483e0b['body']['id']]))_0x32fd25=_0x196566[_0x483e0b[_0xb6c7('0x3e')]['id']];return _0x32c401['status'](0xc8)['json'](_0x32fd25);}; \ No newline at end of file +var _0xa990=['describe','destroy','find','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','dialOrderByScheduledAt','findOne','scheduledat','recallme','LOCK','UPDATE','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','transaction','CmList','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','set','update','then','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','type','model','keys','query','filters','intersection','concat','$gt','$gte','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$any','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','rows','catch','show','include','create','body','params'];(function(_0x383057,_0x1d573f){var _0x2ba02b=function(_0xd1554e){while(--_0xd1554e){_0x383057['push'](_0x383057['shift']());}};_0x2ba02b(++_0x1d573f);}(_0xa990,0xc9));var _0x0a99=function(_0x3c7c3f,_0x542f3b){_0x3c7c3f=_0x3c7c3f-0x0;var _0x5f58e1=_0xa990[_0x3c7c3f];return _0x5f58e1;};'use strict';var moment=require(_0x0a99('0x0'));var _=require(_0x0a99('0x1'));var qs=require(_0x0a99('0x2'));var logger=require(_0x0a99('0x3'))(_0x0a99('0x4'));var shared=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];function respondWithResult(_0x394f1c,_0x4d4992){_0x4d4992=_0x4d4992||0xc8;return function(_0x4d1781){if(_0x4d1781){return _0x394f1c[_0x0a99('0x7')](_0x4d4992)[_0x0a99('0x8')](_0x4d1781);}};}function respondWithFilteredResult(_0xfdb594,_0x320560){return function(_0x45b195){if(_0x45b195){var _0x398d95=typeof _0x320560[_0x0a99('0x9')]===_0x0a99('0xa')&&typeof _0x320560[_0x0a99('0xb')]===_0x0a99('0xa');var _0x1eaa2a=_0x45b195['count'];var _0x813e91=_0x398d95?0x0:_0x320560[_0x0a99('0x9')];var _0x5b5ec3=_0x398d95?_0x45b195['count']:_0x320560[_0x0a99('0x9')]+_0x320560[_0x0a99('0xb')];var _0x1eb2bd;if(_0x5b5ec3>=_0x1eaa2a){_0x5b5ec3=_0x1eaa2a;_0x1eb2bd=0xc8;}else{_0x1eb2bd=0xce;}_0xfdb594[_0x0a99('0x7')](_0x1eb2bd);return _0xfdb594[_0x0a99('0xc')]('Content-Range',_0x813e91+'-'+_0x5b5ec3+'/'+_0x1eaa2a)[_0x0a99('0x8')](_0x45b195);}return null;};}function saveUpdates(_0x3aaaad,_0x57ab88){return function(_0xb6a34d){if(_0xb6a34d){return _0xb6a34d[_0x0a99('0xd')](_0x3aaaad)[_0x0a99('0xe')](function(_0x2bbf1a){return _0x2bbf1a;});}return null;};}function handleEntityNotFound(_0x346061,_0x23d018){return function(_0x18c124){if(!_0x18c124){_0x346061[_0x0a99('0xf')](0x194);}return _0x18c124;};}function handleError(_0x4b6946,_0x5a17e1){_0x5a17e1=_0x5a17e1||0x1f4;return function(_0x2c40db){logger[_0x0a99('0x10')](_0x2c40db[_0x0a99('0x11')]);if(_0x2c40db['name']){delete _0x2c40db[_0x0a99('0x12')];}_0x4b6946['status'](_0x5a17e1)['send'](_0x2c40db);};}exports[_0x0a99('0x13')]=function(_0x3bab16,_0x3de006){var _0x544c2={},_0x572ce5={},_0x564ae9={'count':0x0,'rows':[]};var _0x27a14f=_[_0x0a99('0x14')](db[_0x0a99('0x15')][_0x0a99('0x16')],function(_0x5e6c7e){return{'name':_0x5e6c7e['fieldName'],'type':_0x5e6c7e[_0x0a99('0x17')]['key']};});_0x572ce5[_0x0a99('0x18')]=_['map'](_0x27a14f,_0x0a99('0x12'));_0x572ce5['query']=_[_0x0a99('0x19')](_0x3bab16[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],_0x572ce5[_0x0a99('0x1a')]);_0x572ce5[_0x0a99('0x1b')]=_[_0x0a99('0x1d')](_0x572ce5[_0x0a99('0x1b')],['$and','$or',_0x0a99('0x1e'),_0x0a99('0x1f'),_0x0a99('0x20'),'$lte','$ne',_0x0a99('0x21'),_0x0a99('0x22'),_0x0a99('0x23'),_0x0a99('0x24'),_0x0a99('0x25'),_0x0a99('0x26'),_0x0a99('0x27'),_0x0a99('0x28'),_0x0a99('0x29'),'$notILike',_0x0a99('0x27'),'$overlap','$contains','$contained',_0x0a99('0x2a')]);_0x544c2[_0x0a99('0x2b')]=_[_0x0a99('0x1c')](_0x572ce5[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x2c')]));_0x544c2['attributes']=_0x544c2[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x544c2[_0x0a99('0x2b')]:_0x572ce5[_0x0a99('0x18')];if(!_0x3bab16['query']['hasOwnProperty']('nolimit')){_0x544c2[_0x0a99('0xb')]=qs[_0x0a99('0xb')](_0x3bab16[_0x0a99('0x1a')]['limit']);_0x544c2[_0x0a99('0x9')]=qs[_0x0a99('0x9')](_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x9')]);}_0x544c2[_0x0a99('0x2e')]=qs[_0x0a99('0x2f')](_0x3bab16[_0x0a99('0x1a')]['sort']);_0x544c2[_0x0a99('0x30')]=qs[_0x0a99('0x1b')](_[_0x0a99('0x31')](_0x3bab16[_0x0a99('0x1a')],_0x572ce5[_0x0a99('0x1b')]),_0x27a14f);if(_0x3bab16['query'][_0x0a99('0x32')]){_0x544c2['where']=_['merge'](_0x544c2['where'],{'$or':_['map'](_0x27a14f,function(_0x155a14){if(_0x155a14['type']!==_0x0a99('0x33')){var _0x3d5e0f={};_0x3d5e0f[_0x155a14[_0x0a99('0x12')]]={'$like':'%'+_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x32')]+'%'};return _0x3d5e0f;}})});}_0x544c2=_[_0x0a99('0x34')]({},_0x544c2,_0x3bab16[_0x0a99('0x35')]);var _0x3bc3fc={'where':_0x544c2[_0x0a99('0x30')]};return db[_0x0a99('0x15')][_0x0a99('0x36')](_0x3bc3fc)[_0x0a99('0xe')](function(_0x472850){_0x564ae9['count']=_0x472850;if(_0x3bab16[_0x0a99('0x1a')][_0x0a99('0x37')]){_0x544c2['include']=[{'all':!![]}];}return db[_0x0a99('0x15')]['findAll'](_0x544c2);})[_0x0a99('0xe')](function(_0x563fbc){_0x564ae9[_0x0a99('0x38')]=_0x563fbc;return _0x564ae9;})[_0x0a99('0xe')](respondWithFilteredResult(_0x3de006,_0x544c2))[_0x0a99('0x39')](handleError(_0x3de006,null));};exports[_0x0a99('0x3a')]=function(_0x4a5c58,_0x19774f){var _0x11e046={'raw':!![],'where':{'id':_0x4a5c58['params']['id']}},_0x3b7efc={};_0x3b7efc[_0x0a99('0x18')]=_[_0x0a99('0x19')](db[_0x0a99('0x15')][_0x0a99('0x16')]);_0x3b7efc['query']=_[_0x0a99('0x19')](_0x4a5c58['query']);_0x3b7efc['filters']=_[_0x0a99('0x1c')](_0x3b7efc['model'],_0x3b7efc[_0x0a99('0x1a')]);_0x11e046['attributes']=_[_0x0a99('0x1c')](_0x3b7efc[_0x0a99('0x18')],qs[_0x0a99('0x2c')](_0x4a5c58[_0x0a99('0x1a')]['fields']));_0x11e046[_0x0a99('0x2b')]=_0x11e046[_0x0a99('0x2b')][_0x0a99('0x2d')]?_0x11e046[_0x0a99('0x2b')]:_0x3b7efc['model'];if(_0x4a5c58['query']['includeAll']){_0x11e046[_0x0a99('0x3b')]=[{'all':!![]}];}_0x11e046=_['merge']({},_0x11e046,_0x4a5c58[_0x0a99('0x35')]);return db['CmHopper']['find'](_0x11e046)['then'](handleEntityNotFound(_0x19774f,null))['then'](respondWithResult(_0x19774f,null))[_0x0a99('0x39')](handleError(_0x19774f,null));};exports['create']=function(_0x3e6213,_0x78cd0c){return db['CmHopper'][_0x0a99('0x3c')](_0x3e6213[_0x0a99('0x3d')],{})['then'](respondWithResult(_0x78cd0c,0xc9))[_0x0a99('0x39')](handleError(_0x78cd0c,null));};exports['update']=function(_0x3107bc,_0x278454){if(_0x3107bc['body']['id']){delete _0x3107bc[_0x0a99('0x3d')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x3107bc[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x278454,null))[_0x0a99('0xe')](saveUpdates(_0x3107bc[_0x0a99('0x3d')],null))[_0x0a99('0xe')](respondWithResult(_0x278454,null))['catch'](handleError(_0x278454,null));};exports[_0x0a99('0x3f')]=function(_0x174298,_0x4525d1){return db[_0x0a99('0x15')][_0x0a99('0x3f')]()[_0x0a99('0xe')](respondWithResult(_0x4525d1,null))[_0x0a99('0x39')](handleError(_0x4525d1,null));};exports[_0x0a99('0x40')]=function(_0x1cd328,_0x1621d9){var _0x52c754;var _0x50e04f=_0x1cd328[_0x0a99('0x3e')]['id'];return db[_0x0a99('0x15')][_0x0a99('0x41')]({'where':{'id':_0x1cd328[_0x0a99('0x3e')]['id']}})[_0x0a99('0xe')](handleEntityNotFound(_0x1621d9,null))[_0x0a99('0xe')](function(_0x5cda7d){if(_0x5cda7d){return _0x5cda7d[_0x0a99('0x40')]()[_0x0a99('0xe')](function(_0x55fee0){return _0x55fee0;});}})[_0x0a99('0xe')](function(_0x474e8b){_0x52c754=_0x474e8b;if(_0x474e8b){if(_0x474e8b['VoiceQueueId']||_0x474e8b[_0x0a99('0x42')]){return db[_0x474e8b[_0x0a99('0x43')]?_0x0a99('0x44'):_0x0a99('0x45')][_0x0a99('0x41')]({'where':{'id':_0x474e8b[_0x0a99('0x43')]?_0x474e8b[_0x0a99('0x43')]:_0x474e8b['CampaignId']},'attributes':['id',_0x0a99('0x12')],'raw':!![]});}}})[_0x0a99('0xe')](function(_0x1e9e9d){var _0x5a6762={};if(_0x1e9e9d){_[_0x0a99('0x34')](_0x5a6762,_[_0x0a99('0x46')](_0x52c754[_0x0a99('0x47')],['createdAt',_0x0a99('0x48'),'id']));_0x5a6762[_0x0a99('0x49')]=0x15;_0x5a6762[_0x0a99('0x4a')]=_0x0a99('0x4b');_0x5a6762[_0x0a99('0x4c')]=_0x1e9e9d[_0x0a99('0x12')];_0x5a6762['membername']=_0x1cd328[_0x0a99('0x4d')]['name'];_0x5a6762[_0x0a99('0x4e')]=_0x1cd328[_0x0a99('0x4d')]['id'];_0x5a6762[_0x0a99('0x4b')]=!![];_0x5a6762[_0x0a99('0x4f')]=moment()['format'](_0x0a99('0x50'));_0x5a6762['calleridnum']=_0x52c754[_0x0a99('0x51')];_0x5a6762[_0x0a99('0x52')]=_0x52c754[_0x0a99('0x43')]?_0x0a99('0x53'):_0x0a99('0x54');return db[_0x0a99('0x55')][_0x0a99('0x41')]({'where':{'id':_0x5a6762[_0x0a99('0x56')]},'attributes':[_0x0a99('0x57'),_0x0a99('0x58')]})[_0x0a99('0xe')](function(_0x3f2e09){if(!_[_0x0a99('0x59')](_0x1621d9)&&!_['isNil'](_0x3f2e09[_0x0a99('0x57')])){_0x5a6762[_0x0a99('0x5a')]=_0x3f2e09[_0x0a99('0x57')];if(!_['isNil'](_0x3f2e09[_0x0a99('0x58')])){_0x5a6762[_0x0a99('0x5a')]+='\x20'+_0x3f2e09[_0x0a99('0x58')];}}})['finally'](function(){return db[_0x0a99('0x5b')][_0x0a99('0x3c')](_0x5a6762);});}})[_0x0a99('0xe')](function(_0x144032){return db['CmHopperAdditionalPhone'][_0x0a99('0x40')]({'where':{'CmHopperId':_0x50e04f}});})[_0x0a99('0xe')](function(){return _0x1621d9[_0x0a99('0x7')](0xcc)['end']();})['catch'](handleError(_0x1621d9,null));};exports[_0x0a99('0x5c')]=function(_0x528a5d,_0x53b1f4){var _0x5406a7=[];return db[_0x0a99('0x55')]['describe']()[_0x0a99('0xe')](function(_0x436942){_0x5406a7=_[_0x0a99('0x19')](_0x436942);return _0x528a5d[_0x0a99('0x4d')][_0x0a99('0x5d')]({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id','dialOrderByScheduledAt',_0x0a99('0x60')],'raw':!![]});})[_0x0a99('0xe')](function(_0x2d3b63){if(_0x2d3b63&&_0x2d3b63['length']){return db[_0x0a99('0x61')]['transaction'](function(_0x2109db){var _0x51d18a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')](_0x0a99('0x50'))},'VoiceQueueId':{'$in':_['map'](_0x2d3b63,'id')},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x4ce300={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d3b63)[_0x0a99('0x32')]([_0x0a99('0x60'),0x0])[_0x0a99('0x14')]('id')[_0x0a99('0x63')]()},'$or':[{'UserId':null},{'UserId':_0x528a5d[_0x0a99('0x4d')]['id']}]};var _0x9b52c7={'$or':[_0x51d18a,_0x4ce300]};var _0x44aa5d=[];if(_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]&&_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x64')]===_0x0a99('0x65')){if(!_[_0x0a99('0x66')](_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')])){_0x9b52c7['id']={'$in':_0x528a5d[_0x0a99('0x3d')][_0x0a99('0x67')]};}_0x44aa5d=[[_0x0a99('0x68'),'ASC'],['scheduledAt',_0x2d3b63[0x0]['dialOrderByScheduledAt']===_0x0a99('0x69')?_0x0a99('0x6a'):_0x0a99('0x69')],db['sequelize'][_0x0a99('0x6b')](_0x0a99('0x6c')),['id',_0x0a99('0x6a')]];}else{if(!_[_0x0a99('0x66')](_0x528a5d['body'][_0x0a99('0x67')])){_0x9b52c7['id']={'$notIn':_0x528a5d[_0x0a99('0x3d')]['hopperIds']};}_0x44aa5d=[['priority',_0x0a99('0x6a')],[_0x0a99('0x6d'),_0x2d3b63[0x0][_0x0a99('0x6e')]],db[_0x0a99('0x61')][_0x0a99('0x6b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x0a99('0x15')][_0x0a99('0x6f')]({'attributes':['id',_0x0a99('0x70'),_0x0a99('0x51'),_0x0a99('0x71')],'where':_0x9b52c7,'order':_0x44aa5d,'transaction':_0x2109db,'lock':_0x2109db[_0x0a99('0x72')][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x5406a7,'include':[{'model':db[_0x0a99('0x74')],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db['CmList'],'as':_0x0a99('0x76'),'attributes':['id','name']},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x3435e3){if(_0x3435e3){return _0x3435e3[_0x0a99('0xd')]({'UserId':_0x528a5d[_0x0a99('0x4d')]['id']},{'transaction':_0x2109db});}});});}})[_0x0a99('0xe')](handleEntityNotFound(_0x53b1f4,null))[_0x0a99('0xe')](respondWithResult(_0x53b1f4,null))[_0x0a99('0x39')](handleError(_0x53b1f4,null));};exports[_0x0a99('0x79')]=function(_0x4c6a12,_0x656dd,_0x31950f){var _0x436163=[];var _0x2bae3d=_0x4c6a12['params']['id'];var _0x1a40e9=_0x4c6a12['user']['id'];return db['CmContact'][_0x0a99('0x3f')]()[_0x0a99('0xe')](function(_0x3bed6e){_0x436163=_[_0x0a99('0x19')](_0x3bed6e);return db[_0x0a99('0x61')][_0x0a99('0x7a')](function(_0x24a389){const _0x353660={'id':_0x2bae3d};return db['CmHopper'][_0x0a99('0x6f')]({'attributes':['id','scheduledat','recallme'],'where':_0x353660,'transaction':_0x24a389,'lock':_0x24a389['LOCK'][_0x0a99('0x73')],'include':[{'model':db[_0x0a99('0x55')],'as':'Contact','attributes':_0x436163,'include':[{'model':db['CmCompany'],'as':_0x0a99('0x75'),'attributes':['id',_0x0a99('0x12')]}]},{'model':db[_0x0a99('0x7b')],'as':_0x0a99('0x76'),'attributes':['id',_0x0a99('0x12')]},{'model':db[_0x0a99('0x44')],'as':_0x0a99('0x77'),'attributes':['id',_0x0a99('0x12'),_0x0a99('0x78')]}]})['then'](function(_0x51627a){if(_0x51627a){return _0x51627a[_0x0a99('0xd')]({'UserId':_0x1a40e9},{'transaction':_0x24a389});}});});})[_0x0a99('0xe')](handleEntityNotFound(_0x656dd,null))[_0x0a99('0xe')](respondWithResult(_0x656dd,null))[_0x0a99('0x39')](handleError(_0x656dd,null));};exports[_0x0a99('0x7c')]=function(_0x22b737,_0x3a6773){return _0x22b737['user']['getVoiceQueues']({'where':{'type':_0x0a99('0x5e'),'dialActive':!![],'dialMethod':_0x0a99('0x5f')},'attributes':['id'],'raw':!![]})['then'](function(_0x587442){if(_0x587442&&_0x587442[_0x0a99('0x2d')]){return db['CmHopper'][_0x0a99('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0a99('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x587442,'id')},'$or':[{'UserId':null},{'UserId':_0x22b737[_0x0a99('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x17436d){if(!_['isNil'](_0x17436d)&&_[_0x0a99('0x7d')](_0x17436d)){return _0x3a6773[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'contacts':_0x17436d});}else{logger[_0x0a99('0x10')](_0x0a99('0x7e'),_0x0a99('0x7c'),0x194,_0x0a99('0x7f'));_0x3a6773[_0x0a99('0xf')](0x194);}})[_0x0a99('0x39')](handleError(_0x3a6773,null));};exports[_0x0a99('0x80')]=function(_0x2d3efa,_0xe18018){var _0x51df2a=shared[_0x0a99('0x81')];var _0x2f4d34=[];_[_0x0a99('0x14')](_0x51df2a,function(_0x25c31b){_0x2f4d34[_0x0a99('0x82')]({'id':_0x25c31b[_0x0a99('0x12')],'name':_0x25c31b[_0x0a99('0x12')],'utcOffset':_0x25c31b[_0x0a99('0x83')]});});return _0xe18018[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')]({'tz':_0x2f4d34});};exports['getTimezone']=function(_0x5607f1,_0x505a2c){var _0x59228e=shared[_0x0a99('0x81')];var _0x38932f={};if(!_[_0x0a99('0x59')](_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']]))_0x38932f=_0x59228e[_0x5607f1[_0x0a99('0x3d')]['id']];return _0x505a2c[_0x0a99('0x7')](0xc8)[_0x0a99('0x8')](_0x38932f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 04180eb..ff845b3 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 _0x524e=['define','CmHopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x96d462,_0x3fcc39){var _0x4bb9fe=function(_0x56afdc){while(--_0x56afdc){_0x96d462['push'](_0x96d462['shift']());}};_0x4bb9fe(++_0x3fcc39);}(_0x524e,0x15e));var _0xe524=function(_0x33b8a9,_0x5c02dc){_0x33b8a9=_0x33b8a9-0x0;var _0x41556d=_0x524e[_0x33b8a9];return _0x41556d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));module[_0xe524('0x9')]=function(_0x4f75d6,_0xaaeaa9){return _0x4f75d6[_0xe524('0xa')](_0xe524('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xe524('0xc'),'fields':[_0xe524('0xc')]},{'name':_0xe524('0xd'),'fields':[_0xe524('0xd')]},{'name':_0xe524('0xe'),'fields':[_0xe524('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x154cd3,_0x1ef026){var _0x243cd6=function(_0x53c322){while(--_0x53c322){_0x154cd3['push'](_0x154cd3['shift']());}};_0x243cd6(++_0x1ef026);}(_0x2542,0x169));var _0x2254=function(_0x19c3bd,_0x5d33c4){_0x19c3bd=_0x19c3bd-0x0;var _0x53acfb=_0x2542[_0x19c3bd];return _0x53acfb;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 4e6075e..ea9cad5 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 _0xfdf4=['include','info','debug','stringify','catch','error','message','find','where','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','then','DestroyCmHopper','destroy','describe','transaction','order','LOCK','UPDATE','CmContact','Contact','Agent','voicePause','length','UserId','push','includes','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','sequelize','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','name','CmList','List','NOW()','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','findAll','options','raw','attributes','limit','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdf4,0x1c6));var _0x4fdf=function(_0x888a02,_0x5df389){_0x888a02=_0x888a02-0x0;var _0xedd786=_0xfdf4[_0x888a02];return _0xedd786;};'use strict';var _=require(_0x4fdf('0x0'));var util=require(_0x4fdf('0x1'));var moment=require('moment');var BPromise=require(_0x4fdf('0x2'));var db=require(_0x4fdf('0x3'))['db'];var logger=require('../../config/logger')(_0x4fdf('0x4'));exports[_0x4fdf('0x5')]=function(_0x170df6){var _0x554329=this;return new Promise(function(_0x2a0c78,_0x7146d2){return db[_0x4fdf('0x6')][_0x4fdf('0x7')]({'raw':_0x170df6[_0x4fdf('0x8')]?_0x170df6['options'][_0x4fdf('0x9')]===undefined?!![]:![]:!![],'where':_0x170df6['options']?_0x170df6[_0x4fdf('0x8')]['where']||null:null,'attributes':_0x170df6['options']?_0x170df6[_0x4fdf('0x8')][_0x4fdf('0xa')]||null:null,'limit':_0x170df6[_0x4fdf('0x8')]?_0x170df6['options'][_0x4fdf('0xb')]||null:null,'include':_0x170df6['options']?_0x170df6[_0x4fdf('0x8')]['include']?_[_0x4fdf('0xc')](_0x170df6[_0x4fdf('0x8')]['include'],function(_0x3706ee){return{'model':db[_0x3706ee[_0x4fdf('0xd')]],'as':_0x3706ee['as'],'attributes':_0x3706ee[_0x4fdf('0xa')],'include':_0x3706ee[_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x3706ee['include'],function(_0xa87e33){return{'model':db[_0xa87e33['model']],'as':_0xa87e33['as'],'attributes':_0xa87e33[_0x4fdf('0xa')],'include':_0xa87e33[_0x4fdf('0xe')]?_['map'](_0xa87e33[_0x4fdf('0xe')],function(_0x3fca3a){return{'model':db[_0x3fca3a[_0x4fdf('0xd')]],'as':_0x3fca3a['as'],'attributes':_0x3fca3a[_0x4fdf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cbc50){logger[_0x4fdf('0xf')]('GetCmHopper',_0x170df6);logger[_0x4fdf('0x10')]('GetCmHopper',_0x170df6,JSON[_0x4fdf('0x11')](_0x3cbc50));_0x2a0c78(_0x3cbc50);})[_0x4fdf('0x12')](function(_0x335ff5){logger[_0x4fdf('0x13')](_0x4fdf('0x5'),_0x335ff5[_0x4fdf('0x14')],_0x170df6);_0x7146d2(_0x554329['error'](0x1f4,_0x335ff5[_0x4fdf('0x14')]));});});};exports['ShowCmHopper']=function(_0x26c180){var _0x28a365=this;return new Promise(function(_0x5eefb5,_0xda8403){return db[_0x4fdf('0x6')][_0x4fdf('0x15')]({'raw':_0x26c180[_0x4fdf('0x8')]?_0x26c180['options']['raw']===undefined?!![]:![]:!![],'where':_0x26c180['options']?_0x26c180[_0x4fdf('0x8')][_0x4fdf('0x16')]||null:null,'attributes':_0x26c180[_0x4fdf('0x8')]?_0x26c180[_0x4fdf('0x8')][_0x4fdf('0xa')]||null:null,'include':_0x26c180[_0x4fdf('0x8')]?_0x26c180['options'][_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x26c180[_0x4fdf('0x8')][_0x4fdf('0xe')],function(_0x2c1f51){return{'model':db[_0x2c1f51[_0x4fdf('0xd')]],'as':_0x2c1f51['as'],'attributes':_0x2c1f51[_0x4fdf('0xa')],'include':_0x2c1f51[_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x2c1f51[_0x4fdf('0xe')],function(_0x447140){return{'model':db[_0x447140[_0x4fdf('0xd')]],'as':_0x447140['as'],'attributes':_0x447140['attributes'],'include':_0x447140[_0x4fdf('0xe')]?_['map'](_0x447140[_0x4fdf('0xe')],function(_0x259ae8){return{'model':db[_0x259ae8[_0x4fdf('0xd')]],'as':_0x259ae8['as'],'attributes':_0x259ae8[_0x4fdf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31f6e8){logger['info']('ShowCmHopper',_0x26c180);logger[_0x4fdf('0x10')]('ShowCmHopper',_0x26c180,JSON[_0x4fdf('0x11')](_0x31f6e8));_0x5eefb5(_0x31f6e8);})['catch'](function(_0x45dcef){logger['error'](_0x4fdf('0x17'),_0x45dcef[_0x4fdf('0x14')],_0x26c180);_0xda8403(_0x28a365[_0x4fdf('0x13')](0x1f4,_0x45dcef['message']));});});};exports[_0x4fdf('0x18')]=function(_0x2fecaa){var _0x311073=this;return new Promise(function(_0x1cee28,_0x102408){return db[_0x4fdf('0x6')]['create'](_0x2fecaa[_0x4fdf('0x19')],{'raw':_0x2fecaa[_0x4fdf('0x8')]?_0x2fecaa[_0x4fdf('0x8')][_0x4fdf('0x9')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3c37){logger['info'](_0x4fdf('0x18'),_0x2fecaa);logger['debug']('CreateCmHopper',_0x2fecaa,JSON[_0x4fdf('0x11')](_0x4e3c37));_0x1cee28(_0x4e3c37);})[_0x4fdf('0x12')](function(_0x30d137){logger[_0x4fdf('0x13')](_0x4fdf('0x18'),_0x30d137[_0x4fdf('0x14')],_0x2fecaa);_0x102408(_0x311073[_0x4fdf('0x13')](0x1f4,_0x30d137['message']));});});};exports[_0x4fdf('0x1a')]=function(_0x17cecb){var _0x29f211=this;return new Promise(function(_0x43e2e4,_0xbb4fd3){return db[_0x4fdf('0x6')][_0x4fdf('0x1b')](_0x17cecb['body'],{'raw':_0x17cecb[_0x4fdf('0x8')]?_0x17cecb['options'][_0x4fdf('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17cecb[_0x4fdf('0x8')]?_0x17cecb['options'][_0x4fdf('0x16')]||null:null,'attributes':_0x17cecb[_0x4fdf('0x8')]?_0x17cecb[_0x4fdf('0x8')][_0x4fdf('0xa')]||null:null,'limit':_0x17cecb[_0x4fdf('0x8')]?_0x17cecb[_0x4fdf('0x8')][_0x4fdf('0xb')]||null:null})[_0x4fdf('0x1c')](function(_0x1afcd9){logger[_0x4fdf('0xf')]('UpdateCmHopper',_0x17cecb);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x17cecb[_0x4fdf('0x8')]['where']),_0x17cecb[_0x4fdf('0x19')]['active']);logger[_0x4fdf('0x10')](_0x4fdf('0x1a'),_0x17cecb,JSON[_0x4fdf('0x11')](_0x1afcd9));_0x43e2e4(_0x1afcd9);})['catch'](function(_0x9f0611){logger[_0x4fdf('0x13')](_0x4fdf('0x1a'),_0x9f0611[_0x4fdf('0x14')],_0x17cecb);_0xbb4fd3(_0x29f211[_0x4fdf('0x13')](0x1f4,_0x9f0611[_0x4fdf('0x14')]));});});};exports[_0x4fdf('0x1d')]=function(_0xc03a2b){var _0x400086=this;return new Promise(function(_0x4e1368,_0x5f5881){return db['CmHopper'][_0x4fdf('0x1e')]({'where':_0xc03a2b[_0x4fdf('0x8')]?_0xc03a2b[_0x4fdf('0x8')][_0x4fdf('0x16')]||null:null})[_0x4fdf('0x1c')](function(_0x19795c){logger[_0x4fdf('0xf')](_0x4fdf('0x1d'),_0xc03a2b);logger['debug'](_0x4fdf('0x1d'),_0xc03a2b,JSON['stringify'](_0x19795c));_0x4e1368(_0x19795c);})['catch'](function(_0x4683a8){logger[_0x4fdf('0x13')]('DestroyCmHopper',_0x4683a8[_0x4fdf('0x14')],_0xc03a2b);_0x5f5881(_0x400086[_0x4fdf('0x13')](0x1f4,_0x4683a8['message']));});});};exports['GetContactDialer']=function(_0xe77cc6){var _0x4a150f=this;return new Promise(function(_0x24d37d,_0x752ca){return db['CmContact'][_0x4fdf('0x1f')]()[_0x4fdf('0x1c')](function(_0x260263){return db['sequelize'][_0x4fdf('0x20')](function(_0x2adb78){return db[_0x4fdf('0x6')][_0x4fdf('0x7')]({'where':_0xe77cc6['options']?_0xe77cc6[_0x4fdf('0x8')][_0x4fdf('0x16')]||null:null,'attributes':_0xe77cc6['options']?_0xe77cc6['options'][_0x4fdf('0xa')]||null:null,'limit':_0xe77cc6['options']?_0xe77cc6[_0x4fdf('0x8')][_0x4fdf('0xb')]||null:null,'order':_0xe77cc6[_0x4fdf('0x8')]?_0xe77cc6[_0x4fdf('0x8')][_0x4fdf('0x21')]||null:null,'transaction':_0x2adb78,'lock':_0x2adb78[_0x4fdf('0x22')][_0x4fdf('0x23')],'include':[{'model':db[_0x4fdf('0x24')],'as':_0x4fdf('0x25'),'attributes':_['keys'](_0x260263)},{'model':db['User'],'as':_0x4fdf('0x26'),'attributes':['id','name',_0x4fdf('0x27')]}]})['then'](function(_0x2a7d58){var _0x3b6034=[];var _0x5ae26a=[];for(var _0x3502cb=0x0;_0x3502cb<_0x2a7d58[_0x4fdf('0x28')];_0x3502cb+=0x1){var _0x57cae3=_0x2a7d58[_0x3502cb][_0x4fdf('0x29')];if(_0x57cae3===null){_0x3b6034[_0x4fdf('0x2a')](_0x2a7d58[_0x3502cb][_0x4fdf('0x1b')](_0xe77cc6[_0x4fdf('0x19')],{'transaction':_0x2adb78}));}else if(!_0x5ae26a[_0x4fdf('0x2b')](_0x57cae3)){_0x5ae26a[_0x4fdf('0x2a')](_0x57cae3);_0x3b6034['push'](_0x2a7d58[_0x3502cb][_0x4fdf('0x1b')](_0xe77cc6[_0x4fdf('0x19')],{'transaction':_0x2adb78}));}}return BPromise['all'](_0x3b6034);});})[_0x4fdf('0x1c')](function(_0x597c9a){logger[_0x4fdf('0xf')](_0x4fdf('0x2c'),_0xe77cc6);if(_0x597c9a[_0x4fdf('0x28')]>0x0){logger[_0x4fdf('0xf')](_0x4fdf('0x2d'),_0x597c9a[0x0][_0x4fdf('0x2e')]['id'],_0x597c9a[0x0][_0x4fdf('0x2e')]['ContactId'],_0x597c9a[0x0][_0x4fdf('0x2e')][_0x4fdf('0x2f')]);}logger[_0x4fdf('0x10')](_0x4fdf('0x2c'),_0xe77cc6,JSON[_0x4fdf('0x11')](_0x597c9a));_0x24d37d(_0x597c9a);})['catch'](function(_0x48fced){logger['error'](_0x4fdf('0x2c'),_0x48fced['message'],_0xe77cc6);_0x752ca(_0x4a150f['error'](0x1f4,_0x48fced[_0x4fdf('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x1670e3){var _0x1651c4=this;return new Promise(function(_0xf9af72,_0x2956c5){return db[_0x4fdf('0x30')][_0x4fdf('0x20')](function(_0x2d6afa){return db['CmHopperFinal'][_0x4fdf('0x31')](_0x1670e3[_0x4fdf('0x19')],{'raw':_0x1670e3[_0x4fdf('0x8')]?_0x1670e3[_0x4fdf('0x8')][_0x4fdf('0x9')]===undefined?!![]:![]:!![],'transaction':_0x2d6afa})[_0x4fdf('0x1c')](function(){logger[_0x4fdf('0xf')](_0x4fdf('0x32'),JSON[_0x4fdf('0x11')](_0x1670e3[_0x4fdf('0x8')][_0x4fdf('0x16')]),_0x1670e3[_0x4fdf('0x8')][_0x4fdf('0x16')][_0x4fdf('0x2f')]);return db['CmHopper'][_0x4fdf('0x1e')]({'where':_0x1670e3[_0x4fdf('0x8')]?_0x1670e3[_0x4fdf('0x8')][_0x4fdf('0x16')]||null:null,'transaction':_0x2d6afa});});})['then'](function(_0x49c5aa){logger['info'](_0x4fdf('0x33'),_0x1670e3);logger['debug'](_0x4fdf('0x33'),_0x1670e3,JSON[_0x4fdf('0x11')](_0x49c5aa));_0xf9af72(_0x49c5aa);})[_0x4fdf('0x12')](function(_0x534f70){logger[_0x4fdf('0x13')](_0x4fdf('0x33'),_0x534f70[_0x4fdf('0x14')],_0x1670e3);_0x2956c5(_0x1651c4[_0x4fdf('0x13')](0x1f4,_0x534f70[_0x4fdf('0x14')]));});});};exports[_0x4fdf('0x34')]=function(_0x37357d){var _0x208ba3=this;return new Promise(function(_0x266a24,_0x419b48){return db['CmHopper']['findAll']({'raw':_0x37357d['options']?_0x37357d[_0x4fdf('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x37357d[_0x4fdf('0x8')]?_0x37357d['options'][_0x4fdf('0x16')]||null:null,'attributes':[[db[_0x4fdf('0x30')]['fn'](_0x4fdf('0x35'),db[_0x4fdf('0x30')]['fn']('IF',db[_0x4fdf('0x30')][_0x4fdf('0x36')]('`scheduledat`\x20>=\x20'+util[_0x4fdf('0x37')]('\x22%s\x22',moment()['format'](_0x4fdf('0x38')))+_0x4fdf('0x39')))),_0x4fdf('0x3a')]]})[_0x4fdf('0x1c')](function(_0x4d30b4){logger['info'](_0x4fdf('0x34'),_0x37357d);logger['debug'](_0x4fdf('0x34'),_0x37357d,JSON[_0x4fdf('0x11')](_0x4d30b4));_0x266a24(_0x4d30b4);})['catch'](function(_0x516b42){logger[_0x4fdf('0x13')](_0x4fdf('0x34'),_0x516b42[_0x4fdf('0x14')],_0x37357d);_0x419b48(_0x208ba3[_0x4fdf('0x13')](0x1f4,_0x516b42[_0x4fdf('0x14')]));});});};exports[_0x4fdf('0x3b')]=function(_0x5762b7){var _0xed555=this;return new Promise(function(_0x566ba9,_0x518a74){return db[_0x4fdf('0x24')]['describe']()[_0x4fdf('0x1c')](function(){return db[_0x4fdf('0x30')]['transaction'](function(_0x156433){return db['CmHopper'][_0x4fdf('0x7')]({'where':_0x5762b7[_0x4fdf('0x8')]?_0x5762b7['options'][_0x4fdf('0x16')]||null:null,'attributes':_0x5762b7[_0x4fdf('0x8')]?_0x5762b7['options'][_0x4fdf('0xa')]||null:null,'limit':0x1,'order':_0x5762b7[_0x4fdf('0x8')]?_0x5762b7[_0x4fdf('0x8')]['order']||null:null,'group':db[_0x4fdf('0x6')][_0x4fdf('0x29')],'transaction':_0x156433,'lock':_0x156433[_0x4fdf('0x22')][_0x4fdf('0x23')],'include':_0x5762b7[_0x4fdf('0x8')]?_0x5762b7[_0x4fdf('0x8')][_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x5762b7[_0x4fdf('0x8')][_0x4fdf('0xe')],function(_0x237ce6){return{'model':db[_0x237ce6[_0x4fdf('0xd')]],'as':_0x237ce6['as'],'attributes':_0x237ce6[_0x4fdf('0xa')],'include':_0x237ce6[_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x237ce6[_0x4fdf('0xe')],function(_0x1f0c5c){return{'model':db[_0x1f0c5c[_0x4fdf('0xd')]],'as':_0x1f0c5c['as'],'attributes':_0x1f0c5c['attributes'],'include':_0x1f0c5c['include']?_[_0x4fdf('0xc')](_0x1f0c5c[_0x4fdf('0xe')],function(_0x206b82){return{'model':db[_0x206b82[_0x4fdf('0xd')]],'as':_0x206b82['as'],'attributes':_0x206b82[_0x4fdf('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4fdf('0x1c')](function(_0x38e5fd){var _0x17ae8d=[];for(var _0x39e7d0=0x0;_0x39e7d0<_0x38e5fd[_0x4fdf('0x28')];_0x39e7d0+=0x1){_0x17ae8d[_0x4fdf('0x2a')](_0x38e5fd[_0x39e7d0][_0x4fdf('0x1b')](_0x5762b7[_0x4fdf('0x19')],{'transaction':_0x156433}));}return BPromise['all'](_0x17ae8d);});})[_0x4fdf('0x1c')](function(_0x25dc32){logger['info'](_0x4fdf('0x3b'),_0x5762b7);logger[_0x4fdf('0x10')](_0x4fdf('0x3b'),_0x5762b7,JSON[_0x4fdf('0x11')](_0x25dc32));_0x566ba9(_0x25dc32);})['catch'](function(_0x17b1f8){logger['error'](_0x4fdf('0x3b'),_0x17b1f8[_0x4fdf('0x14')],_0x5762b7);_0x518a74(_0xed555[_0x4fdf('0x13')](0x1f4,_0x17b1f8[_0x4fdf('0x14')]));});});});};exports[_0x4fdf('0x3c')]=function(_0x11d794){var _0x2917b2=this;return new Promise(function(_0x1ebce9,_0x515b9e){db[_0x4fdf('0x24')]['describe']()['then'](function(_0x52d249){return db[_0x4fdf('0x6')][_0x4fdf('0x7')]({'raw':_0x11d794[_0x4fdf('0x8')]?_0x11d794[_0x4fdf('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x11d794[_0x4fdf('0x8')]?_0x11d794[_0x4fdf('0x8')]['where']||null:null,'attributes':_0x11d794[_0x4fdf('0x8')]?_0x11d794[_0x4fdf('0x8')][_0x4fdf('0xa')]||null:null,'limit':_0x11d794[_0x4fdf('0x8')]?_0x11d794[_0x4fdf('0x8')][_0x4fdf('0xb')]||null:null,'include':_0x11d794[_0x4fdf('0x8')]?_0x11d794[_0x4fdf('0x8')][_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x11d794[_0x4fdf('0x8')][_0x4fdf('0xe')],function(_0x874517){return{'model':db[_0x874517[_0x4fdf('0xd')]],'as':_0x874517['as'],'attributes':_0x874517['as']===_0x4fdf('0x25')?_[_0x4fdf('0x3d')](_0x52d249):_0x874517[_0x4fdf('0xa')],'include':_0x874517[_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x874517[_0x4fdf('0xe')],function(_0x2ddcec){return{'model':db[_0x2ddcec[_0x4fdf('0xd')]],'as':_0x2ddcec['as'],'attributes':_0x2ddcec['attributes'],'include':_0x2ddcec[_0x4fdf('0xe')]?_[_0x4fdf('0xc')](_0x2ddcec[_0x4fdf('0xe')],function(_0x19c7a9){return{'model':db[_0x19c7a9[_0x4fdf('0xd')]],'as':_0x19c7a9['as'],'attributes':_0x19c7a9[_0x4fdf('0xa')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x548558){logger[_0x4fdf('0xf')](_0x4fdf('0x5'),_0x11d794);logger[_0x4fdf('0x10')](_0x4fdf('0x5'),_0x11d794,JSON['stringify'](_0x548558));_0x1ebce9(_0x548558);})[_0x4fdf('0x12')](function(_0x43d8ec){logger[_0x4fdf('0x13')](_0x4fdf('0x5'),_0x43d8ec[_0x4fdf('0x14')],_0x11d794);_0x515b9e(_0x2917b2['error'](0x1f4,_0x43d8ec['message']));});});});};exports[_0x4fdf('0x3e')]=function(_0xf6f64f){var _0x177779=this;return new Promise(function(_0x1c1ed1,_0x20b9ff){return db[_0x4fdf('0x24')][_0x4fdf('0x3f')]({'raw':!![],'where':{'phone':_0xf6f64f[_0x4fdf('0x8')][_0x4fdf('0x16')][_0x4fdf('0x40')]},'attributes':['id',_0x4fdf('0x41')],'order':[['id',_0x4fdf('0x42')]]})[_0x4fdf('0x1c')](function(_0x227bfa){logger[_0x4fdf('0xf')]('getContactByPhone',_0xf6f64f);logger[_0x4fdf('0x10')](_0x4fdf('0x43'),_0xf6f64f,JSON[_0x4fdf('0x11')](_0x227bfa));_0x1c1ed1(_0x227bfa);})[_0x4fdf('0x12')](function(_0x2dc9a1){logger['error'](_0x4fdf('0x43'),_0x2dc9a1['message'],_0xf6f64f);_0x20b9ff(_0x177779[_0x4fdf('0x13')](0x1f4,_0x2dc9a1['message']));});});};exports[_0x4fdf('0x44')]=function(_0x1e331b){var _0x51be06=this;return new Promise(function(_0xdb6f4,_0xbc01b3){return db[_0x4fdf('0x30')][_0x4fdf('0x20')](function(_0x30f86f){var _0x4f2c80=_0x1e331b[_0x4fdf('0x8')]&&_0x1e331b[_0x4fdf('0x8')][_0x4fdf('0x16')]?_0x1e331b[_0x4fdf('0x8')][_0x4fdf('0x16')]:{};return db[_0x4fdf('0x6')][_0x4fdf('0x1b')](_0x1e331b[_0x4fdf('0x19')],{'where':_0x4f2c80,'transaction':_0x30f86f})[_0x4fdf('0x1c')](function(_0x25a66a){logger['info']('ResetActiveCalls',_0x1e331b);logger[_0x4fdf('0x10')](_0x4fdf('0x44'),_0x1e331b,JSON[_0x4fdf('0x11')](_0x25a66a));_0xdb6f4(_0x25a66a);})[_0x4fdf('0x12')](function(_0x3c90f2){logger[_0x4fdf('0x13')](_0x4fdf('0x44'),_0x3c90f2[_0x4fdf('0x14')],_0x1e331b);_0xbc01b3(_0x51be06[_0x4fdf('0x13')](0x1f4,_0x3c90f2['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x1427c6){var _0x24691f=this;var _0x2df1ee=_0x1427c6['body'][_0x4fdf('0x16')]['voiceQueueIds'];var _0x42878f=_0x1427c6['body'][_0x4fdf('0x16')]['interval'];var _0x1d253f=_0x1427c6[_0x4fdf('0x19')][_0x4fdf('0x16')][_0x4fdf('0x45')];return new Promise(function(_0x306089,_0x2a8a0e){return db[_0x4fdf('0x6')][_0x4fdf('0x7')]({'where':{'voiceQueueId':{'$in':_0x2df1ee},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4fdf('0x30')][_0x4fdf('0x36')](_0x4fdf('0x46')+_0x42878f+_0x4fdf('0x47')),'$gt':db[_0x4fdf('0x30')][_0x4fdf('0x36')]('NOW()')}},'UserId':{'$in':_0x1d253f}},'include':[{'model':db['CmContact'],'as':_0x4fdf('0x25')},{'model':db[_0x4fdf('0x48')],'as':_0x4fdf('0x26'),'attributes':['id',_0x4fdf('0x49'),_0x4fdf('0x27')]},{'model':db[_0x4fdf('0x4a')],'as':_0x4fdf('0x4b')}]})[_0x4fdf('0x1c')](function(_0x49c539){if(_0x49c539['length']>0x0){return db['sequelize'][_0x4fdf('0x20')](function(_0x1f8600){return db[_0x4fdf('0x6')][_0x4fdf('0x1b')]({'recallmeNotifiedDate':db['sequelize'][_0x4fdf('0x36')](_0x4fdf('0x4c'))},{'where':{'id':{'$in':_['map'](_0x49c539,'id')}},'transaction':_0x1f8600})['then'](function(){_0x306089(_0x49c539);})[_0x4fdf('0x12')](function(_0x4bbf52){logger['error'](_0x4fdf('0x4d'),_0x4bbf52[_0x4fdf('0x14')],_0x1427c6);_0x2a8a0e(_0x24691f[_0x4fdf('0x13')](0x1f4,_0x4bbf52[_0x4fdf('0x14')]));});})[_0x4fdf('0x12')](function(_0x25e397){logger['error'](_0x4fdf('0x4d'),_0x25e397[_0x4fdf('0x14')],_0x1427c6);_0x2a8a0e(_0x24691f[_0x4fdf('0x13')](0x1f4,_0x25e397['message']));});}else{_0x306089(_0x49c539);}});});}; \ No newline at end of file +var _0x19c7=['name','length','push','includes','dataValues','ContactId','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','all','GetCmHopperPreview','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','stringify','error','message','ShowCmHopper','find','info','catch','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','debug','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','findAll','order','UPDATE','Contact','keys','User','Agent'];(function(_0x3cd325,_0x5419b2){var _0x4e7f24=function(_0x546111){while(--_0x546111){_0x3cd325['push'](_0x3cd325['shift']());}};_0x4e7f24(++_0x5419b2);}(_0x19c7,0x16d));var _0x719c=function(_0x3f3dfc,_0x3711a7){_0x3f3dfc=_0x3f3dfc-0x0;var _0x434785=_0x19c7[_0x3f3dfc];return _0x434785;};'use strict';var _=require('lodash');var util=require(_0x719c('0x0'));var moment=require(_0x719c('0x1'));var BPromise=require(_0x719c('0x2'));var db=require(_0x719c('0x3'))['db'];var logger=require(_0x719c('0x4'))(_0x719c('0x5'));exports[_0x719c('0x6')]=function(_0x144405){var _0x3ad380=this;return new Promise(function(_0x15a5d6,_0x24f642){return db[_0x719c('0x7')]['findAll']({'raw':_0x144405[_0x719c('0x8')]?_0x144405[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'where':_0x144405[_0x719c('0x8')]?_0x144405[_0x719c('0x8')][_0x719c('0xa')]||null:null,'attributes':_0x144405['options']?_0x144405[_0x719c('0x8')][_0x719c('0xb')]||null:null,'limit':_0x144405[_0x719c('0x8')]?_0x144405[_0x719c('0x8')][_0x719c('0xc')]||null:null,'include':_0x144405['options']?_0x144405['options']['include']?_[_0x719c('0xd')](_0x144405['options'][_0x719c('0xe')],function(_0x496255){return{'model':db[_0x496255[_0x719c('0xf')]],'as':_0x496255['as'],'attributes':_0x496255['attributes'],'include':_0x496255[_0x719c('0xe')]?_[_0x719c('0xd')](_0x496255[_0x719c('0xe')],function(_0x29d36d){return{'model':db[_0x29d36d['model']],'as':_0x29d36d['as'],'attributes':_0x29d36d[_0x719c('0xb')],'include':_0x29d36d['include']?_[_0x719c('0xd')](_0x29d36d[_0x719c('0xe')],function(_0x24748b){return{'model':db[_0x24748b[_0x719c('0xf')]],'as':_0x24748b['as'],'attributes':_0x24748b[_0x719c('0xb')]};}):[]};}):[]};}):[]:[]})[_0x719c('0x10')](function(_0x3da8f1){logger['info'](_0x719c('0x6'),_0x144405);logger['debug'](_0x719c('0x6'),_0x144405,JSON[_0x719c('0x11')](_0x3da8f1));_0x15a5d6(_0x3da8f1);})['catch'](function(_0x155236){logger[_0x719c('0x12')](_0x719c('0x6'),_0x155236['message'],_0x144405);_0x24f642(_0x3ad380[_0x719c('0x12')](0x1f4,_0x155236[_0x719c('0x13')]));});});};exports[_0x719c('0x14')]=function(_0x482640){var _0x20c467=this;return new Promise(function(_0x212734,_0x12f173){return db[_0x719c('0x7')][_0x719c('0x15')]({'raw':_0x482640[_0x719c('0x8')]?_0x482640[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'where':_0x482640[_0x719c('0x8')]?_0x482640['options']['where']||null:null,'attributes':_0x482640[_0x719c('0x8')]?_0x482640[_0x719c('0x8')][_0x719c('0xb')]||null:null,'include':_0x482640['options']?_0x482640[_0x719c('0x8')][_0x719c('0xe')]?_[_0x719c('0xd')](_0x482640[_0x719c('0x8')]['include'],function(_0x3065ed){return{'model':db[_0x3065ed['model']],'as':_0x3065ed['as'],'attributes':_0x3065ed[_0x719c('0xb')],'include':_0x3065ed[_0x719c('0xe')]?_[_0x719c('0xd')](_0x3065ed[_0x719c('0xe')],function(_0x590f8e){return{'model':db[_0x590f8e['model']],'as':_0x590f8e['as'],'attributes':_0x590f8e[_0x719c('0xb')],'include':_0x590f8e[_0x719c('0xe')]?_['map'](_0x590f8e[_0x719c('0xe')],function(_0x1bac08){return{'model':db[_0x1bac08[_0x719c('0xf')]],'as':_0x1bac08['as'],'attributes':_0x1bac08[_0x719c('0xb')]};}):[]};}):[]};}):[]:[]})[_0x719c('0x10')](function(_0x1bf279){logger[_0x719c('0x16')](_0x719c('0x14'),_0x482640);logger['debug']('ShowCmHopper',_0x482640,JSON[_0x719c('0x11')](_0x1bf279));_0x212734(_0x1bf279);})[_0x719c('0x17')](function(_0x5145f0){logger[_0x719c('0x12')](_0x719c('0x14'),_0x5145f0[_0x719c('0x13')],_0x482640);_0x12f173(_0x20c467[_0x719c('0x12')](0x1f4,_0x5145f0[_0x719c('0x13')]));});});};exports[_0x719c('0x18')]=function(_0x530c47){var _0x57b1be=this;return new Promise(function(_0x174608,_0x1d4e88){return db[_0x719c('0x7')][_0x719c('0x19')](_0x530c47[_0x719c('0x1a')],{'raw':_0x530c47[_0x719c('0x8')]?_0x530c47['options'][_0x719c('0x9')]===undefined?!![]:![]:!![]})[_0x719c('0x10')](function(_0x496e64){logger[_0x719c('0x16')]('CreateCmHopper',_0x530c47);logger['debug'](_0x719c('0x18'),_0x530c47,JSON[_0x719c('0x11')](_0x496e64));_0x174608(_0x496e64);})['catch'](function(_0x6e9038){logger[_0x719c('0x12')](_0x719c('0x18'),_0x6e9038[_0x719c('0x13')],_0x530c47);_0x1d4e88(_0x57b1be[_0x719c('0x12')](0x1f4,_0x6e9038[_0x719c('0x13')]));});});};exports[_0x719c('0x1b')]=function(_0x29cadb){var _0x36d7c8=this;return new Promise(function(_0x1bfa13,_0x364feb){return db[_0x719c('0x7')][_0x719c('0x1c')](_0x29cadb['body'],{'raw':_0x29cadb['options']?_0x29cadb[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29cadb[_0x719c('0x8')]?_0x29cadb['options'][_0x719c('0xa')]||null:null,'attributes':_0x29cadb['options']?_0x29cadb['options'][_0x719c('0xb')]||null:null,'limit':_0x29cadb['options']?_0x29cadb['options'][_0x719c('0xc')]||null:null})[_0x719c('0x10')](function(_0x4d443f){logger[_0x719c('0x16')](_0x719c('0x1b'),_0x29cadb);logger['info'](_0x719c('0x1d'),JSON[_0x719c('0x11')](_0x29cadb[_0x719c('0x8')][_0x719c('0xa')]),_0x29cadb[_0x719c('0x1a')][_0x719c('0x1e')]);logger[_0x719c('0x1f')](_0x719c('0x1b'),_0x29cadb,JSON[_0x719c('0x11')](_0x4d443f));_0x1bfa13(_0x4d443f);})[_0x719c('0x17')](function(_0x1133e8){logger[_0x719c('0x12')]('UpdateCmHopper',_0x1133e8[_0x719c('0x13')],_0x29cadb);_0x364feb(_0x36d7c8[_0x719c('0x12')](0x1f4,_0x1133e8['message']));});});};exports['DestroyCmHopper']=function(_0x5bdd72){var _0x5b2209=this;return new Promise(function(_0x5e529a,_0x31dfc2){return db['CmHopper'][_0x719c('0x20')]({'where':_0x5bdd72['options']?_0x5bdd72[_0x719c('0x8')][_0x719c('0xa')]||null:null})['then'](function(_0x4ed79b){logger['info'](_0x719c('0x21'),_0x5bdd72);logger['debug'](_0x719c('0x21'),_0x5bdd72,JSON[_0x719c('0x11')](_0x4ed79b));_0x5e529a(_0x4ed79b);})[_0x719c('0x17')](function(_0x503631){logger[_0x719c('0x12')](_0x719c('0x21'),_0x503631[_0x719c('0x13')],_0x5bdd72);_0x31dfc2(_0x5b2209[_0x719c('0x12')](0x1f4,_0x503631[_0x719c('0x13')]));});});};exports[_0x719c('0x22')]=function(_0x176770){var _0x534a76=this;return new Promise(function(_0xd818c0,_0x88ab2){return db[_0x719c('0x23')][_0x719c('0x24')]()[_0x719c('0x10')](function(_0x584dbe){return db[_0x719c('0x25')]['transaction'](function(_0x2cadd4){return db[_0x719c('0x7')][_0x719c('0x26')]({'where':_0x176770['options']?_0x176770[_0x719c('0x8')]['where']||null:null,'attributes':_0x176770[_0x719c('0x8')]?_0x176770[_0x719c('0x8')][_0x719c('0xb')]||null:null,'limit':_0x176770['options']?_0x176770[_0x719c('0x8')][_0x719c('0xc')]||null:null,'order':_0x176770[_0x719c('0x8')]?_0x176770['options'][_0x719c('0x27')]||null:null,'transaction':_0x2cadd4,'lock':_0x2cadd4['LOCK'][_0x719c('0x28')],'include':[{'model':db[_0x719c('0x23')],'as':_0x719c('0x29'),'attributes':_[_0x719c('0x2a')](_0x584dbe)},{'model':db[_0x719c('0x2b')],'as':_0x719c('0x2c'),'attributes':['id',_0x719c('0x2d'),'voicePause']}]})[_0x719c('0x10')](function(_0x47b70d){var _0x2661c8=[];var _0x2cf007=[];for(var _0x813b0c=0x0;_0x813b0c<_0x47b70d[_0x719c('0x2e')];_0x813b0c+=0x1){var _0x1558f6=_0x47b70d[_0x813b0c]['UserId'];if(_0x1558f6===null){_0x2661c8[_0x719c('0x2f')](_0x47b70d[_0x813b0c]['update'](_0x176770['body'],{'transaction':_0x2cadd4}));}else if(!_0x2cf007[_0x719c('0x30')](_0x1558f6)){_0x2cf007[_0x719c('0x2f')](_0x1558f6);_0x2661c8['push'](_0x47b70d[_0x813b0c]['update'](_0x176770['body'],{'transaction':_0x2cadd4}));}}return BPromise['all'](_0x2661c8);});})[_0x719c('0x10')](function(_0x35d2ca){logger['info']('GetContactDialer',_0x176770);if(_0x35d2ca['length']>0x0){logger['info']('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x35d2ca[0x0][_0x719c('0x31')]['id'],_0x35d2ca[0x0]['dataValues'][_0x719c('0x32')],_0x35d2ca[0x0][_0x719c('0x31')]['active']);}logger[_0x719c('0x1f')](_0x719c('0x22'),_0x176770,JSON[_0x719c('0x11')](_0x35d2ca));_0xd818c0(_0x35d2ca);})[_0x719c('0x17')](function(_0x360597){logger[_0x719c('0x12')]('GetContactDialer',_0x360597['message'],_0x176770);_0x88ab2(_0x534a76[_0x719c('0x12')](0x1f4,_0x360597[_0x719c('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x57330b){var _0x437511=this;return new Promise(function(_0x383f68,_0x1ff582){return db['sequelize'][_0x719c('0x33')](function(_0x38cf2d){return db[_0x719c('0x34')][_0x719c('0x19')](_0x57330b['body'],{'raw':_0x57330b[_0x719c('0x8')]?_0x57330b[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'transaction':_0x38cf2d})[_0x719c('0x10')](function(){logger[_0x719c('0x16')](_0x719c('0x35'),JSON['stringify'](_0x57330b[_0x719c('0x8')][_0x719c('0xa')]),_0x57330b[_0x719c('0x8')][_0x719c('0xa')][_0x719c('0x1e')]);return db[_0x719c('0x7')][_0x719c('0x20')]({'where':_0x57330b[_0x719c('0x8')]?_0x57330b['options']['where']||null:null,'transaction':_0x38cf2d});});})[_0x719c('0x10')](function(_0x36900a){logger[_0x719c('0x16')](_0x719c('0x36'),_0x57330b);logger[_0x719c('0x1f')](_0x719c('0x36'),_0x57330b,JSON[_0x719c('0x11')](_0x36900a));_0x383f68(_0x36900a);})['catch'](function(_0x42e020){logger[_0x719c('0x12')]('MoveContactManagedDialer',_0x42e020[_0x719c('0x13')],_0x57330b);_0x1ff582(_0x437511[_0x719c('0x12')](0x1f4,_0x42e020['message']));});});};exports[_0x719c('0x37')]=function(_0x2343ce){var _0x1ab9c2=this;return new Promise(function(_0x3a33e0,_0xbe00c3){return db['CmHopper'][_0x719c('0x26')]({'raw':_0x2343ce[_0x719c('0x8')]?_0x2343ce[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'where':_0x2343ce['options']?_0x2343ce['options'][_0x719c('0xa')]||null:null,'attributes':[[db[_0x719c('0x25')]['fn'](_0x719c('0x38'),db[_0x719c('0x25')]['fn']('IF',db[_0x719c('0x25')][_0x719c('0x39')](_0x719c('0x3a')+util['format'](_0x719c('0x3b'),moment()[_0x719c('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x719c('0x3d')))),_0x719c('0x3e')]]})['then'](function(_0x344bcb){logger[_0x719c('0x16')](_0x719c('0x37'),_0x2343ce);logger['debug']('CountReScheduled',_0x2343ce,JSON[_0x719c('0x11')](_0x344bcb));_0x3a33e0(_0x344bcb);})[_0x719c('0x17')](function(_0xa83c4b){logger[_0x719c('0x12')](_0x719c('0x37'),_0xa83c4b[_0x719c('0x13')],_0x2343ce);_0xbe00c3(_0x1ab9c2[_0x719c('0x12')](0x1f4,_0xa83c4b[_0x719c('0x13')]));});});};exports[_0x719c('0x3f')]=function(_0x469e36){var _0x3b09a6=this;return new Promise(function(_0x30fdd4,_0x278352){return db[_0x719c('0x23')]['describe']()[_0x719c('0x10')](function(){return db[_0x719c('0x25')]['transaction'](function(_0xa21ba0){return db['CmHopper'][_0x719c('0x26')]({'where':_0x469e36['options']?_0x469e36[_0x719c('0x8')][_0x719c('0xa')]||null:null,'attributes':_0x469e36[_0x719c('0x8')]?_0x469e36[_0x719c('0x8')][_0x719c('0xb')]||null:null,'limit':0x1,'order':_0x469e36['options']?_0x469e36[_0x719c('0x8')][_0x719c('0x27')]||null:null,'group':db[_0x719c('0x7')][_0x719c('0x40')],'transaction':_0xa21ba0,'lock':_0xa21ba0[_0x719c('0x41')]['UPDATE'],'include':_0x469e36['options']?_0x469e36[_0x719c('0x8')][_0x719c('0xe')]?_[_0x719c('0xd')](_0x469e36[_0x719c('0x8')][_0x719c('0xe')],function(_0x71ac6c){return{'model':db[_0x71ac6c['model']],'as':_0x71ac6c['as'],'attributes':_0x71ac6c['attributes'],'include':_0x71ac6c[_0x719c('0xe')]?_['map'](_0x71ac6c[_0x719c('0xe')],function(_0x1f8080){return{'model':db[_0x1f8080[_0x719c('0xf')]],'as':_0x1f8080['as'],'attributes':_0x1f8080[_0x719c('0xb')],'include':_0x1f8080[_0x719c('0xe')]?_[_0x719c('0xd')](_0x1f8080['include'],function(_0x4a6213){return{'model':db[_0x4a6213['model']],'as':_0x4a6213['as'],'attributes':_0x4a6213['attributes']};}):[]};}):[]};}):[]:[]})[_0x719c('0x10')](function(_0x11b912){var _0x5c0b54=[];for(var _0x2a79b3=0x0;_0x2a79b3<_0x11b912[_0x719c('0x2e')];_0x2a79b3+=0x1){_0x5c0b54['push'](_0x11b912[_0x2a79b3][_0x719c('0x1c')](_0x469e36[_0x719c('0x1a')],{'transaction':_0xa21ba0}));}return BPromise[_0x719c('0x42')](_0x5c0b54);});})['then'](function(_0x3a5db6){logger[_0x719c('0x16')](_0x719c('0x3f'),_0x469e36);logger[_0x719c('0x1f')](_0x719c('0x3f'),_0x469e36,JSON[_0x719c('0x11')](_0x3a5db6));_0x30fdd4(_0x3a5db6);})[_0x719c('0x17')](function(_0x2277c4){logger[_0x719c('0x12')](_0x719c('0x3f'),_0x2277c4['message'],_0x469e36);_0x278352(_0x3b09a6[_0x719c('0x12')](0x1f4,_0x2277c4[_0x719c('0x13')]));});});});};exports[_0x719c('0x43')]=function(_0x4488d6){var _0x32f492=this;return new Promise(function(_0x5ddfc7,_0x1af295){db['CmContact'][_0x719c('0x24')]()[_0x719c('0x10')](function(_0x5b3a86){return db['CmHopper']['findAll']({'raw':_0x4488d6['options']?_0x4488d6[_0x719c('0x8')][_0x719c('0x9')]===undefined?!![]:![]:!![],'where':_0x4488d6[_0x719c('0x8')]?_0x4488d6[_0x719c('0x8')][_0x719c('0xa')]||null:null,'attributes':_0x4488d6['options']?_0x4488d6[_0x719c('0x8')][_0x719c('0xb')]||null:null,'limit':_0x4488d6[_0x719c('0x8')]?_0x4488d6['options'][_0x719c('0xc')]||null:null,'include':_0x4488d6[_0x719c('0x8')]?_0x4488d6[_0x719c('0x8')][_0x719c('0xe')]?_[_0x719c('0xd')](_0x4488d6[_0x719c('0x8')][_0x719c('0xe')],function(_0x143204){return{'model':db[_0x143204[_0x719c('0xf')]],'as':_0x143204['as'],'attributes':_0x143204['as']===_0x719c('0x29')?_['keys'](_0x5b3a86):_0x143204[_0x719c('0xb')],'include':_0x143204[_0x719c('0xe')]?_['map'](_0x143204[_0x719c('0xe')],function(_0x24064b){return{'model':db[_0x24064b[_0x719c('0xf')]],'as':_0x24064b['as'],'attributes':_0x24064b['attributes'],'include':_0x24064b[_0x719c('0xe')]?_[_0x719c('0xd')](_0x24064b[_0x719c('0xe')],function(_0xa7134b){return{'model':db[_0xa7134b['model']],'as':_0xa7134b['as'],'attributes':_0xa7134b[_0x719c('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ab82f){logger[_0x719c('0x16')](_0x719c('0x6'),_0x4488d6);logger[_0x719c('0x1f')](_0x719c('0x6'),_0x4488d6,JSON[_0x719c('0x11')](_0x1ab82f));_0x5ddfc7(_0x1ab82f);})[_0x719c('0x17')](function(_0x496a50){logger[_0x719c('0x12')](_0x719c('0x6'),_0x496a50[_0x719c('0x13')],_0x4488d6);_0x1af295(_0x32f492[_0x719c('0x12')](0x1f4,_0x496a50[_0x719c('0x13')]));});});});};exports[_0x719c('0x44')]=function(_0x4edbb9){var _0x243e73=this;return new Promise(function(_0x43e68b,_0xcbbaf9){return db[_0x719c('0x23')]['findOne']({'raw':!![],'where':{'phone':_0x4edbb9[_0x719c('0x8')]['where'][_0x719c('0x45')]},'attributes':['id',_0x719c('0x46')],'order':[['id',_0x719c('0x47')]]})[_0x719c('0x10')](function(_0x14d047){logger[_0x719c('0x16')](_0x719c('0x48'),_0x4edbb9);logger[_0x719c('0x1f')]('getContactByPhone',_0x4edbb9,JSON[_0x719c('0x11')](_0x14d047));_0x43e68b(_0x14d047);})[_0x719c('0x17')](function(_0xb77595){logger[_0x719c('0x12')](_0x719c('0x48'),_0xb77595['message'],_0x4edbb9);_0xcbbaf9(_0x243e73[_0x719c('0x12')](0x1f4,_0xb77595['message']));});});};exports[_0x719c('0x49')]=function(_0x80e5f6){var _0xa5db92=this;return new Promise(function(_0x320606,_0x18a711){return db[_0x719c('0x25')][_0x719c('0x33')](function(_0x43e884){var _0x25aae4=_0x80e5f6[_0x719c('0x8')]&&_0x80e5f6[_0x719c('0x8')][_0x719c('0xa')]?_0x80e5f6[_0x719c('0x8')][_0x719c('0xa')]:{};return db[_0x719c('0x7')][_0x719c('0x1c')](_0x80e5f6[_0x719c('0x1a')],{'where':_0x25aae4,'transaction':_0x43e884})[_0x719c('0x10')](function(_0x3c1eda){logger[_0x719c('0x16')](_0x719c('0x49'),_0x80e5f6);logger['debug'](_0x719c('0x49'),_0x80e5f6,JSON['stringify'](_0x3c1eda));_0x320606(_0x3c1eda);})[_0x719c('0x17')](function(_0x17b380){logger[_0x719c('0x12')](_0x719c('0x49'),_0x17b380[_0x719c('0x13')],_0x80e5f6);_0x18a711(_0xa5db92[_0x719c('0x12')](0x1f4,_0x17b380[_0x719c('0x13')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x239847){var _0x1f1243=this;var _0x5d6145=_0x239847[_0x719c('0x1a')][_0x719c('0xa')][_0x719c('0x4a')];var _0x2afb19=_0x239847[_0x719c('0x1a')][_0x719c('0xa')][_0x719c('0x4b')];var _0x4943bc=_0x239847[_0x719c('0x1a')][_0x719c('0xa')]['availableAgentsIds'];return new Promise(function(_0x478c86,_0x2e091){return db['CmHopper']['findAll']({'where':{'voiceQueueId':{'$in':_0x5d6145},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x719c('0x25')][_0x719c('0x39')](_0x719c('0x4c')+_0x2afb19+_0x719c('0x4d')),'$gt':db[_0x719c('0x25')][_0x719c('0x39')](_0x719c('0x4e'))}},'UserId':{'$in':_0x4943bc}},'include':[{'model':db[_0x719c('0x23')],'as':'Contact'},{'model':db[_0x719c('0x2b')],'as':_0x719c('0x2c'),'attributes':['id',_0x719c('0x2d'),_0x719c('0x4f')]},{'model':db['CmList'],'as':_0x719c('0x50')}]})[_0x719c('0x10')](function(_0x125db4){if(_0x125db4[_0x719c('0x2e')]>0x0){return db['sequelize'][_0x719c('0x33')](function(_0x468ab5){return db['CmHopper'][_0x719c('0x1c')]({'recallmeNotifiedDate':db[_0x719c('0x25')][_0x719c('0x39')](_0x719c('0x4e'))},{'where':{'id':{'$in':_[_0x719c('0xd')](_0x125db4,'id')}},'transaction':_0x468ab5})[_0x719c('0x10')](function(){_0x478c86(_0x125db4);})[_0x719c('0x17')](function(_0x15b1ee){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x15b1ee[_0x719c('0x13')],_0x239847);_0x2e091(_0x1f1243[_0x719c('0x12')](0x1f4,_0x15b1ee['message']));});})[_0x719c('0x17')](function(_0x3d6446){logger['error'](_0x719c('0x51'),_0x3d6446[_0x719c('0x13')],_0x239847);_0x2e091(_0x1f1243[_0x719c('0x12')](0x1f4,_0x3d6446[_0x719c('0x13')]));});}else{_0x478c86(_0x125db4);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 3c4a3ef..63b2efe 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 _0xbebd=['destroy','exports','Router','../../components/auth/service','index','get','isAuthenticated','describe','getOpenContacts','/timezones','/:id','show','getPreviewRecall','create','getPreview','/timezone','put','delete'];(function(_0x2d4ddb,_0x5129c1){var _0x392c4a=function(_0x22ba66){while(--_0x22ba66){_0x2d4ddb['push'](_0x2d4ddb['shift']());}};_0x392c4a(++_0x5129c1);}(_0xbebd,0x122));var _0xdbeb=function(_0x5c3ced,_0x30f86f){_0x5c3ced=_0x5c3ced-0x0;var _0x55f277=_0xbebd[_0x5c3ced];return _0x55f277;};'use strict';var express=require('express');var router=express[_0xdbeb('0x0')]();var auth=require(_0xdbeb('0x1'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdbeb('0x2')]);router[_0xdbeb('0x3')]('/describe',auth[_0xdbeb('0x4')](),controller[_0xdbeb('0x5')]);router[_0xdbeb('0x3')]('/opencontacts',auth['isAuthenticated'](),controller[_0xdbeb('0x6')]);router[_0xdbeb('0x3')](_0xdbeb('0x7'),auth['isAuthenticated'](),controller['getTimezones']);router['get'](_0xdbeb('0x8'),auth[_0xdbeb('0x4')](),controller[_0xdbeb('0x9')]);router['get']('/:id/previewrecall',auth[_0xdbeb('0x4')](),controller[_0xdbeb('0xa')]);router['post']('/',auth[_0xdbeb('0x4')](),controller[_0xdbeb('0xb')]);router['post']('/preview',auth[_0xdbeb('0x4')](),controller[_0xdbeb('0xc')]);router['post'](_0xdbeb('0xd'),auth['isAuthenticated'](),controller['getTimezone']);router[_0xdbeb('0xe')]('/:id',auth[_0xdbeb('0x4')](),controller['update']);router[_0xdbeb('0xf')](_0xdbeb('0x8'),auth[_0xdbeb('0x4')](),controller[_0xdbeb('0x10')]);module[_0xdbeb('0x11')]=router; \ No newline at end of file +var _0x2901=['isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','getPreview','/timezone','getTimezone','put','/:id','update','delete','destroy','exports','express','../../components/auth/service','./cmHopper.controller','get','/describe'];(function(_0x58c2d4,_0x5b9b54){var _0x4478ce=function(_0x1f7a75){while(--_0x1f7a75){_0x58c2d4['push'](_0x58c2d4['shift']());}};_0x4478ce(++_0x5b9b54);}(_0x2901,0x193));var _0x1290=function(_0x4f9600,_0x408e68){_0x4f9600=_0x4f9600-0x0;var _0x1adced=_0x2901[_0x4f9600];return _0x1adced;};'use strict';var express=require(_0x1290('0x0'));var router=express['Router']();var auth=require(_0x1290('0x1'));var controller=require(_0x1290('0x2'));router[_0x1290('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1290('0x3')](_0x1290('0x4'),auth[_0x1290('0x5')](),controller[_0x1290('0x6')]);router[_0x1290('0x3')](_0x1290('0x7'),auth[_0x1290('0x5')](),controller[_0x1290('0x8')]);router[_0x1290('0x3')](_0x1290('0x9'),auth[_0x1290('0x5')](),controller[_0x1290('0xa')]);router[_0x1290('0x3')]('/:id',auth[_0x1290('0x5')](),controller[_0x1290('0xb')]);router[_0x1290('0x3')](_0x1290('0xc'),auth['isAuthenticated'](),controller[_0x1290('0xd')]);router[_0x1290('0xe')]('/',auth[_0x1290('0x5')](),controller['create']);router[_0x1290('0xe')]('/preview',auth[_0x1290('0x5')](),controller[_0x1290('0xf')]);router[_0x1290('0xe')](_0x1290('0x10'),auth[_0x1290('0x5')](),controller[_0x1290('0x11')]);router[_0x1290('0x12')](_0x1290('0x13'),auth[_0x1290('0x5')](),controller[_0x1290('0x14')]);router[_0x1290('0x15')](_0x1290('0x13'),auth[_0x1290('0x5')](),controller[_0x1290('0x16')]);module[_0x1290('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index b98799f..99474dd 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 _0x3389=['exports','INTEGER','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x3389,0xcb));var _0x9338=function(_0x14f083,_0x1e48cb){_0x14f083=_0x14f083-0x0;var _0x21dadb=_0x3389[_0x14f083];return _0x21dadb;};'use strict';var moment=require('moment');var Sequelize=require(_0x9338('0x0'));module[_0x9338('0x1')]={'CmHopperId':{'type':Sequelize[_0x9338('0x2')]},'phone':{'type':Sequelize[_0x9338('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9338('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x9338('0x4')],'defaultValue':moment()['format'](_0x9338('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9338('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9338('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9338('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9338('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xae99=['STRING','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER'];(function(_0x4057bd,_0x201752){var _0x3cb508=function(_0x3890af){while(--_0x3890af){_0x4057bd['push'](_0x4057bd['shift']());}};_0x3cb508(++_0x201752);}(_0xae99,0x68));var _0x9ae9=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xae99[_0x5bd426];return _0x23a7eb;};'use strict';var moment=require(_0x9ae9('0x0'));var Sequelize=require(_0x9ae9('0x1'));module[_0x9ae9('0x2')]={'CmHopperId':{'type':Sequelize[_0x9ae9('0x3')]},'phone':{'type':Sequelize[_0x9ae9('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x9ae9('0x5'))},'countbusyretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 926c240..213c8ed 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 _0x950f=['userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','error','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','name','filter','findAll','rows','catch','params','intersection','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x58362f,_0x2f51a7){var _0x32f6cd=function(_0x350b62){while(--_0x350b62){_0x58362f['push'](_0x58362f['shift']());}};_0x32f6cd(++_0x2f51a7);}(_0x950f,0x1e4));var _0xf950=function(_0x46d14b,_0x147907){_0x46d14b=_0x46d14b-0x0;var _0x367dfd=_0x950f[_0x46d14b];return _0x367dfd;};'use strict';var emlformat=require(_0xf950('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf950('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf950('0x2'));var moment=require(_0xf950('0x3'));var BPromise=require(_0xf950('0x4'));var Mustache=require(_0xf950('0x5'));var util=require('util');var path=require(_0xf950('0x6'));var sox=require(_0xf950('0x7'));var csv=require(_0xf950('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf950('0x9'));var _=require(_0xf950('0xa'));var squel=require(_0xf950('0xb'));var crypto=require(_0xf950('0xc'));var jsforce=require(_0xf950('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf950('0x8'));var querystring=require(_0xf950('0xe'));var Papa=require('papaparse');var Redis=require(_0xf950('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf950('0x10'));var as=require(_0xf950('0x11'));var hardwareService=require(_0xf950('0x12'));var logger=require('../../config/logger')(_0xf950('0x13'));var utils=require(_0xf950('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf950('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d4f5,_0x5ad835){_0x5ad835=_0x5ad835||0xcc;return function(_0x1e4bf2){if(_0x1e4bf2){return _0x26d4f5['sendStatus'](_0x5ad835);}return _0x26d4f5[_0xf950('0x16')](_0x5ad835)[_0xf950('0x17')]();};}function respondWithResult(_0x501504,_0x49cae1){_0x49cae1=_0x49cae1||0xc8;return function(_0x2214ab){if(_0x2214ab){return _0x501504[_0xf950('0x16')](_0x49cae1)[_0xf950('0x18')](_0x2214ab);}};}function respondWithFilteredResult(_0x4cd76f,_0x259418){return function(_0x3be980){if(_0x3be980){var _0x3309d9=typeof _0x259418['offset']==='undefined'&&typeof _0x259418['limit']===_0xf950('0x19');var _0x20ea4d=_0x3be980[_0xf950('0x1a')];var _0x3d5d53=_0x3309d9?0x0:_0x259418[_0xf950('0x1b')];var _0x452802=_0x3309d9?_0x3be980[_0xf950('0x1a')]:_0x259418['offset']+_0x259418['limit'];var _0x3cacc8;if(_0x452802>=_0x20ea4d){_0x452802=_0x20ea4d;_0x3cacc8=0xc8;}else{_0x3cacc8=0xce;}_0x4cd76f['status'](_0x3cacc8);return _0x4cd76f[_0xf950('0x1c')](_0xf950('0x1d'),_0x3d5d53+'-'+_0x452802+'/'+_0x20ea4d)[_0xf950('0x18')](_0x3be980);}return null;};}function patchUpdates(_0x2ec4c2){return function(_0xe846f6){try{jsonpatch[_0xf950('0x1e')](_0xe846f6,_0x2ec4c2,!![]);}catch(_0x2c124d){return BPromise[_0xf950('0x1f')](_0x2c124d);}return _0xe846f6[_0xf950('0x20')]();};}function saveUpdates(_0x55dee8,_0x12e106){return function(_0x4cbe49){if(_0x4cbe49){return _0x4cbe49['update'](_0x55dee8)[_0xf950('0x21')](function(_0x48343d){return _0x48343d;});}return null;};}function removeEntity(_0x326220,_0x5aa1b1){return function(_0x10ca59){if(_0x10ca59){return _0x10ca59[_0xf950('0x22')]()['then'](function(){var _0x4234a2=_0x10ca59[_0xf950('0x23')]({'plain':!![]});var _0x21331b=_0xf950('0x24');return db['UserProfileResource'][_0xf950('0x22')]({'where':{'type':_0x21331b,'resourceId':_0x4234a2['id']}})['then'](function(){return _0x10ca59;});})[_0xf950('0x21')](function(){_0x326220[_0xf950('0x16')](0xcc)[_0xf950('0x17')]();});}};}function handleEntityNotFound(_0x14dd1a,_0x5d6b96){return function(_0x3d0098){if(!_0x3d0098){_0x14dd1a['sendStatus'](0x194);}return _0x3d0098;};}function handleError(_0x1f582d,_0xa67e79){_0xa67e79=_0xa67e79||0x1f4;return function(_0x349326){logger[_0xf950('0x25')](_0x349326['stack']);if(_0x349326['name']){delete _0x349326['name'];}_0x1f582d[_0xf950('0x16')](_0xa67e79)['send'](_0x349326);};}exports[_0xf950('0x26')]=function(_0xcb45bf,_0x4126bc){var _0x1342c8={},_0x269b43={},_0x57b96a={'count':0x0,'rows':[]};var _0x5119b1=_[_0xf950('0x27')](db[_0xf950('0x28')][_0xf950('0x29')],function(_0x35bcd7){return{'name':_0x35bcd7[_0xf950('0x2a')],'type':_0x35bcd7[_0xf950('0x2b')][_0xf950('0x2c')]};});_0x269b43['model']=_['map'](_0x5119b1,'name');_0x269b43[_0xf950('0x2d')]=_[_0xf950('0x2e')](_0xcb45bf[_0xf950('0x2d')]);_0x269b43[_0xf950('0x2f')]=_['intersection'](_0x269b43['model'],_0x269b43[_0xf950('0x2d')]);_0x1342c8[_0xf950('0x30')]=_['intersection'](_0x269b43['model'],qs[_0xf950('0x31')](_0xcb45bf[_0xf950('0x2d')][_0xf950('0x31')]));_0x1342c8['attributes']=_0x1342c8['attributes'][_0xf950('0x32')]?_0x1342c8[_0xf950('0x30')]:_0x269b43[_0xf950('0x33')];if(!_0xcb45bf[_0xf950('0x2d')][_0xf950('0x34')](_0xf950('0x35'))){_0x1342c8[_0xf950('0x36')]=qs['limit'](_0xcb45bf[_0xf950('0x2d')][_0xf950('0x36')]);_0x1342c8['offset']=qs['offset'](_0xcb45bf['query'][_0xf950('0x1b')]);}_0x1342c8[_0xf950('0x37')]=qs[_0xf950('0x38')](_0xcb45bf[_0xf950('0x2d')][_0xf950('0x38')]);_0x1342c8[_0xf950('0x39')]=qs[_0xf950('0x2f')](_[_0xf950('0x3a')](_0xcb45bf[_0xf950('0x2d')],_0x269b43[_0xf950('0x2f')]),_0x5119b1);if(_0xcb45bf[_0xf950('0x2d')]['filter']){_0x1342c8[_0xf950('0x39')]=_[_0xf950('0x3b')](_0x1342c8[_0xf950('0x39')],{'$or':_[_0xf950('0x27')](_0x5119b1,function(_0x4ab534){if(_0x4ab534[_0xf950('0x2b')]!==_0xf950('0x3c')){var _0x4cee0c={};_0x4cee0c[_0x4ab534[_0xf950('0x3d')]]={'$like':'%'+_0xcb45bf[_0xf950('0x2d')][_0xf950('0x3e')]+'%'};return _0x4cee0c;}})});}_0x1342c8=_[_0xf950('0x3b')]({},_0x1342c8,_0xcb45bf['options']);var _0x51dd25={'where':_0x1342c8[_0xf950('0x39')]};return db['CmHopperAdditionalPhone'][_0xf950('0x1a')](_0x51dd25)[_0xf950('0x21')](function(_0x267687){_0x57b96a[_0xf950('0x1a')]=_0x267687;if(_0xcb45bf[_0xf950('0x2d')]['includeAll']){_0x1342c8['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xf950('0x3f')](_0x1342c8);})['then'](function(_0x294c5e){_0x57b96a[_0xf950('0x40')]=_0x294c5e;return _0x57b96a;})[_0xf950('0x21')](respondWithFilteredResult(_0x4126bc,_0x1342c8))[_0xf950('0x41')](handleError(_0x4126bc,null));};exports['show']=function(_0x3231c2,_0x1d8472){var _0x47ca79={'raw':!![],'where':{'id':_0x3231c2[_0xf950('0x42')]['id']}},_0x5cfafe={};_0x5cfafe[_0xf950('0x33')]=_[_0xf950('0x2e')](db[_0xf950('0x28')][_0xf950('0x29')]);_0x5cfafe['query']=_['keys'](_0x3231c2[_0xf950('0x2d')]);_0x5cfafe['filters']=_[_0xf950('0x43')](_0x5cfafe[_0xf950('0x33')],_0x5cfafe['query']);_0x47ca79[_0xf950('0x30')]=_[_0xf950('0x43')](_0x5cfafe[_0xf950('0x33')],qs['fields'](_0x3231c2['query']['fields']));_0x47ca79['attributes']=_0x47ca79[_0xf950('0x30')][_0xf950('0x32')]?_0x47ca79[_0xf950('0x30')]:_0x5cfafe[_0xf950('0x33')];if(_0x3231c2['query'][_0xf950('0x44')]){_0x47ca79['include']=[{'all':!![]}];}_0x47ca79=_[_0xf950('0x3b')]({},_0x47ca79,_0x3231c2[_0xf950('0x45')]);return db['CmHopperAdditionalPhone'][_0xf950('0x46')](_0x47ca79)[_0xf950('0x21')](handleEntityNotFound(_0x1d8472,null))['then'](respondWithResult(_0x1d8472,null))[_0xf950('0x41')](handleError(_0x1d8472,null));};exports[_0xf950('0x47')]=function(_0xfdb7f1,_0x23330c){return db[_0xf950('0x28')]['create'](_0xfdb7f1[_0xf950('0x48')],{})[_0xf950('0x21')](function(_0x219d45){var _0x9099ff=_0xfdb7f1[_0xf950('0x49')]['get']({'plain':!![]});if(!_0x9099ff)throw new Error(_0xf950('0x4a'));if(_0x9099ff[_0xf950('0x4b')]==='user'){var _0x1a2ca7=_0x219d45[_0xf950('0x23')]({'plain':!![]});var _0x154778=_0xf950('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x154778,'userProfileId':_0x9099ff[_0xf950('0x4c')]},'raw':!![]})[_0xf950('0x21')](function(_0x11d5e0){if(_0x11d5e0&&_0x11d5e0['autoAssociation']===0x0){return db[_0xf950('0x4d')][_0xf950('0x47')]({'name':_0x1a2ca7['name'],'resourceId':_0x1a2ca7['id'],'type':_0x11d5e0[_0xf950('0x3d')],'sectionId':_0x11d5e0['id']},{})[_0xf950('0x21')](function(){return _0x219d45;});}else{return _0x219d45;}})['catch'](function(_0x374eb5){logger[_0xf950('0x25')](_0xf950('0x4e'),_0x374eb5);throw _0x374eb5;});}return _0x219d45;})[_0xf950('0x21')](respondWithResult(_0x23330c,0xc9))[_0xf950('0x41')](handleError(_0x23330c,null));};exports[_0xf950('0x4f')]=function(_0x383f4a,_0x14bc86){if(_0x383f4a[_0xf950('0x48')]['id']){delete _0x383f4a[_0xf950('0x48')]['id'];}return db[_0xf950('0x28')][_0xf950('0x46')]({'where':{'id':_0x383f4a[_0xf950('0x42')]['id']}})['then'](handleEntityNotFound(_0x14bc86,null))[_0xf950('0x21')](saveUpdates(_0x383f4a[_0xf950('0x48')],null))[_0xf950('0x21')](respondWithResult(_0x14bc86,null))[_0xf950('0x41')](handleError(_0x14bc86,null));};exports[_0xf950('0x22')]=function(_0x3444e1,_0x301540){return db[_0xf950('0x28')][_0xf950('0x46')]({'where':{'id':_0x3444e1[_0xf950('0x42')]['id']}})['then'](handleEntityNotFound(_0x301540,null))[_0xf950('0x21')](removeEntity(_0x301540,null))[_0xf950('0x41')](handleError(_0x301540,null));}; \ No newline at end of file +var _0xd946=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','find','body','user','role','CmHopperAdditionalPhones','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xd946,0x1ae));var _0x6d94=function(_0x4c6c47,_0x420cd0){_0x4c6c47=_0x4c6c47-0x0;var _0x170cef=_0xd946[_0x4c6c47];return _0x170cef;};'use strict';var emlformat=require(_0x6d94('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6d94('0x1'));var BPromise=require(_0x6d94('0x2'));var Mustache=require(_0x6d94('0x3'));var util=require(_0x6d94('0x4'));var path=require('path');var sox=require(_0x6d94('0x5'));var csv=require(_0x6d94('0x6'));var ejs=require(_0x6d94('0x7'));var fs=require('fs');var fs_extra=require(_0x6d94('0x8'));var _=require(_0x6d94('0x9'));var squel=require('squel');var crypto=require(_0x6d94('0xa'));var jsforce=require(_0x6d94('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6d94('0x6'));var querystring=require(_0x6d94('0xc'));var Papa=require(_0x6d94('0xd'));var Redis=require(_0x6d94('0xe'));var authService=require(_0x6d94('0xf'));var qs=require(_0x6d94('0x10'));var as=require(_0x6d94('0x11'));var hardwareService=require(_0x6d94('0x12'));var logger=require('../../config/logger')(_0x6d94('0x13'));var utils=require('../../config/utils');var config=require(_0x6d94('0x14'));var licenseUtil=require(_0x6d94('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10c7ce,_0x39d9d2){_0x39d9d2=_0x39d9d2||0xcc;return function(_0xb70478){if(_0xb70478){return _0x10c7ce[_0x6d94('0x16')](_0x39d9d2);}return _0x10c7ce['status'](_0x39d9d2)['end']();};}function respondWithResult(_0x8d2016,_0x231fc8){_0x231fc8=_0x231fc8||0xc8;return function(_0x25a3bf){if(_0x25a3bf){return _0x8d2016['status'](_0x231fc8)[_0x6d94('0x17')](_0x25a3bf);}};}function respondWithFilteredResult(_0x20940d,_0x4120fd){return function(_0x1ef52c){if(_0x1ef52c){var _0x1cb7a8=typeof _0x4120fd[_0x6d94('0x18')]===_0x6d94('0x19')&&typeof _0x4120fd['limit']==='undefined';var _0x30261f=_0x1ef52c[_0x6d94('0x1a')];var _0x3a1ea2=_0x1cb7a8?0x0:_0x4120fd[_0x6d94('0x18')];var _0x4e469e=_0x1cb7a8?_0x1ef52c['count']:_0x4120fd[_0x6d94('0x18')]+_0x4120fd[_0x6d94('0x1b')];var _0x37019a;if(_0x4e469e>=_0x30261f){_0x4e469e=_0x30261f;_0x37019a=0xc8;}else{_0x37019a=0xce;}_0x20940d[_0x6d94('0x1c')](_0x37019a);return _0x20940d[_0x6d94('0x1d')]('Content-Range',_0x3a1ea2+'-'+_0x4e469e+'/'+_0x30261f)[_0x6d94('0x17')](_0x1ef52c);}return null;};}function patchUpdates(_0x1dcbec){return function(_0x5109f7){try{jsonpatch[_0x6d94('0x1e')](_0x5109f7,_0x1dcbec,!![]);}catch(_0x4b7603){return BPromise[_0x6d94('0x1f')](_0x4b7603);}return _0x5109f7[_0x6d94('0x20')]();};}function saveUpdates(_0x41f5c0,_0x45d7fd){return function(_0x54cd8c){if(_0x54cd8c){return _0x54cd8c[_0x6d94('0x21')](_0x41f5c0)[_0x6d94('0x22')](function(_0x54836d){return _0x54836d;});}return null;};}function removeEntity(_0x2f14f0,_0x5c7451){return function(_0x1ade0b){if(_0x1ade0b){return _0x1ade0b[_0x6d94('0x23')]()[_0x6d94('0x22')](function(){var _0x239bc1=_0x1ade0b[_0x6d94('0x24')]({'plain':!![]});var _0x53c097='CmHopperAdditionalPhones';return db[_0x6d94('0x25')][_0x6d94('0x23')]({'where':{'type':_0x53c097,'resourceId':_0x239bc1['id']}})['then'](function(){return _0x1ade0b;});})[_0x6d94('0x22')](function(){_0x2f14f0['status'](0xcc)[_0x6d94('0x26')]();});}};}function handleEntityNotFound(_0x5be026,_0x5d8bde){return function(_0x4c5bee){if(!_0x4c5bee){_0x5be026['sendStatus'](0x194);}return _0x4c5bee;};}function handleError(_0x1fd7f7,_0xaa3c78){_0xaa3c78=_0xaa3c78||0x1f4;return function(_0x3928b4){logger[_0x6d94('0x27')](_0x3928b4[_0x6d94('0x28')]);if(_0x3928b4[_0x6d94('0x29')]){delete _0x3928b4[_0x6d94('0x29')];}_0x1fd7f7[_0x6d94('0x1c')](_0xaa3c78)[_0x6d94('0x2a')](_0x3928b4);};}exports[_0x6d94('0x2b')]=function(_0x57f9b3,_0x5829a1){var _0x3bc0a8={},_0x4a42d3={},_0xd60338={'count':0x0,'rows':[]};var _0x2ba947=_['map'](db[_0x6d94('0x2c')][_0x6d94('0x2d')],function(_0x27cf94){return{'name':_0x27cf94[_0x6d94('0x2e')],'type':_0x27cf94[_0x6d94('0x2f')][_0x6d94('0x30')]};});_0x4a42d3[_0x6d94('0x31')]=_[_0x6d94('0x32')](_0x2ba947,_0x6d94('0x29'));_0x4a42d3[_0x6d94('0x33')]=_[_0x6d94('0x34')](_0x57f9b3[_0x6d94('0x33')]);_0x4a42d3[_0x6d94('0x35')]=_[_0x6d94('0x36')](_0x4a42d3['model'],_0x4a42d3['query']);_0x3bc0a8[_0x6d94('0x37')]=_[_0x6d94('0x36')](_0x4a42d3[_0x6d94('0x31')],qs[_0x6d94('0x38')](_0x57f9b3['query'][_0x6d94('0x38')]));_0x3bc0a8[_0x6d94('0x37')]=_0x3bc0a8[_0x6d94('0x37')][_0x6d94('0x39')]?_0x3bc0a8[_0x6d94('0x37')]:_0x4a42d3[_0x6d94('0x31')];if(!_0x57f9b3[_0x6d94('0x33')][_0x6d94('0x3a')](_0x6d94('0x3b'))){_0x3bc0a8[_0x6d94('0x1b')]=qs[_0x6d94('0x1b')](_0x57f9b3['query'][_0x6d94('0x1b')]);_0x3bc0a8[_0x6d94('0x18')]=qs['offset'](_0x57f9b3['query'][_0x6d94('0x18')]);}_0x3bc0a8[_0x6d94('0x3c')]=qs[_0x6d94('0x3d')](_0x57f9b3[_0x6d94('0x33')][_0x6d94('0x3d')]);_0x3bc0a8[_0x6d94('0x3e')]=qs[_0x6d94('0x35')](_[_0x6d94('0x3f')](_0x57f9b3[_0x6d94('0x33')],_0x4a42d3['filters']),_0x2ba947);if(_0x57f9b3[_0x6d94('0x33')][_0x6d94('0x40')]){_0x3bc0a8['where']=_[_0x6d94('0x41')](_0x3bc0a8['where'],{'$or':_[_0x6d94('0x32')](_0x2ba947,function(_0x4d41e9){if(_0x4d41e9[_0x6d94('0x2f')]!==_0x6d94('0x42')){var _0x6e10c8={};_0x6e10c8[_0x4d41e9[_0x6d94('0x29')]]={'$like':'%'+_0x57f9b3[_0x6d94('0x33')][_0x6d94('0x40')]+'%'};return _0x6e10c8;}})});}_0x3bc0a8=_[_0x6d94('0x41')]({},_0x3bc0a8,_0x57f9b3[_0x6d94('0x43')]);var _0x891cd3={'where':_0x3bc0a8['where']};return db[_0x6d94('0x2c')][_0x6d94('0x1a')](_0x891cd3)[_0x6d94('0x22')](function(_0x29cfcc){_0xd60338[_0x6d94('0x1a')]=_0x29cfcc;if(_0x57f9b3[_0x6d94('0x33')][_0x6d94('0x44')]){_0x3bc0a8[_0x6d94('0x45')]=[{'all':!![]}];}return db[_0x6d94('0x2c')]['findAll'](_0x3bc0a8);})[_0x6d94('0x22')](function(_0x412841){_0xd60338[_0x6d94('0x46')]=_0x412841;return _0xd60338;})[_0x6d94('0x22')](respondWithFilteredResult(_0x5829a1,_0x3bc0a8))[_0x6d94('0x47')](handleError(_0x5829a1,null));};exports['show']=function(_0x522635,_0x582e58){var _0x3a90a8={'raw':!![],'where':{'id':_0x522635['params']['id']}},_0x3a194e={};_0x3a194e[_0x6d94('0x31')]=_[_0x6d94('0x34')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x3a194e[_0x6d94('0x33')]=_[_0x6d94('0x34')](_0x522635[_0x6d94('0x33')]);_0x3a194e[_0x6d94('0x35')]=_[_0x6d94('0x36')](_0x3a194e[_0x6d94('0x31')],_0x3a194e['query']);_0x3a90a8['attributes']=_['intersection'](_0x3a194e[_0x6d94('0x31')],qs[_0x6d94('0x38')](_0x522635[_0x6d94('0x33')]['fields']));_0x3a90a8['attributes']=_0x3a90a8['attributes'][_0x6d94('0x39')]?_0x3a90a8[_0x6d94('0x37')]:_0x3a194e[_0x6d94('0x31')];if(_0x522635[_0x6d94('0x33')]['includeAll']){_0x3a90a8[_0x6d94('0x45')]=[{'all':!![]}];}_0x3a90a8=_[_0x6d94('0x41')]({},_0x3a90a8,_0x522635['options']);return db[_0x6d94('0x2c')][_0x6d94('0x48')](_0x3a90a8)[_0x6d94('0x22')](handleEntityNotFound(_0x582e58,null))[_0x6d94('0x22')](respondWithResult(_0x582e58,null))['catch'](handleError(_0x582e58,null));};exports['create']=function(_0x2a00c7,_0x3f1706){return db[_0x6d94('0x2c')]['create'](_0x2a00c7[_0x6d94('0x49')],{})[_0x6d94('0x22')](function(_0x181f2f){var _0xdcc369=_0x2a00c7[_0x6d94('0x4a')][_0x6d94('0x24')]({'plain':!![]});if(!_0xdcc369)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdcc369[_0x6d94('0x4b')]===_0x6d94('0x4a')){var _0x11c054=_0x181f2f[_0x6d94('0x24')]({'plain':!![]});var _0x15f483=_0x6d94('0x4c');return db[_0x6d94('0x4d')][_0x6d94('0x48')]({'where':{'name':_0x15f483,'userProfileId':_0xdcc369[_0x6d94('0x4e')]},'raw':!![]})['then'](function(_0xc8338e){if(_0xc8338e&&_0xc8338e[_0x6d94('0x4f')]===0x0){return db[_0x6d94('0x25')]['create']({'name':_0x11c054[_0x6d94('0x29')],'resourceId':_0x11c054['id'],'type':_0xc8338e['name'],'sectionId':_0xc8338e['id']},{})[_0x6d94('0x22')](function(){return _0x181f2f;});}else{return _0x181f2f;}})[_0x6d94('0x47')](function(_0x5acfd8){logger[_0x6d94('0x27')](_0x6d94('0x50'),_0x5acfd8);throw _0x5acfd8;});}return _0x181f2f;})[_0x6d94('0x22')](respondWithResult(_0x3f1706,0xc9))['catch'](handleError(_0x3f1706,null));};exports[_0x6d94('0x21')]=function(_0x2979db,_0x1d9ac9){if(_0x2979db[_0x6d94('0x49')]['id']){delete _0x2979db[_0x6d94('0x49')]['id'];}return db[_0x6d94('0x2c')][_0x6d94('0x48')]({'where':{'id':_0x2979db['params']['id']}})[_0x6d94('0x22')](handleEntityNotFound(_0x1d9ac9,null))['then'](saveUpdates(_0x2979db['body'],null))[_0x6d94('0x22')](respondWithResult(_0x1d9ac9,null))[_0x6d94('0x47')](handleError(_0x1d9ac9,null));};exports[_0x6d94('0x23')]=function(_0x16fe8b,_0x44d512){return db[_0x6d94('0x2c')][_0x6d94('0x48')]({'where':{'id':_0x16fe8b[_0x6d94('0x51')]['id']}})['then'](handleEntityNotFound(_0x44d512,null))[_0x6d94('0x22')](removeEntity(_0x44d512,null))[_0x6d94('0x47')](handleError(_0x44d512,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 06bb1c5..3bc8464 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 _0xe1e4=['request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','lodash','util','api','moment','bluebird'];(function(_0x42ea4f,_0x112788){var _0x1ce9ae=function(_0xb2a798){while(--_0xb2a798){_0x42ea4f['push'](_0x42ea4f['shift']());}};_0x1ce9ae(++_0x112788);}(_0xe1e4,0x18e));var _0x4e1e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xe1e4[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x4e1e('0x0'));var util=require(_0x4e1e('0x1'));var logger=require('../../config/logger')(_0x4e1e('0x2'));var moment=require(_0x4e1e('0x3'));var BPromise=require(_0x4e1e('0x4'));var rp=require(_0x4e1e('0x5'));var fs=require('fs');var path=require(_0x4e1e('0x6'));var rimraf=require(_0x4e1e('0x7'));var config=require(_0x4e1e('0x8'));var attributes=require(_0x4e1e('0x9'));module[_0x4e1e('0xa')]=function(_0x1823ef,_0x2f0025){return _0x1823ef[_0x4e1e('0xb')](_0x4e1e('0xc'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04dd=['define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger','moment','request-promise','path','./cmHopperAdditionalPhone.attributes','exports'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x04dd,0xd4));var _0xd04d=function(_0x2b18c9,_0x49659f){_0x2b18c9=_0x2b18c9-0x0;var _0x8b913c=_0x04dd[_0x2b18c9];return _0x8b913c;};'use strict';var _=require(_0xd04d('0x0'));var util=require(_0xd04d('0x1'));var logger=require(_0xd04d('0x2'))('api');var moment=require(_0xd04d('0x3'));var BPromise=require('bluebird');var rp=require(_0xd04d('0x4'));var fs=require('fs');var path=require(_0xd04d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd04d('0x6'));module[_0xd04d('0x7')]=function(_0x1e6770,_0x10db57){return _0x1e6770[_0xd04d('0x8')](_0xd04d('0x9'),attributes,{'tableName':_0xd04d('0xa'),'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 418935e..5d21480 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 _0x25c8=['ASC','duration','waitTime','scheduledat','add','minutes','phone','isNil','createdAt','updatedAt','sequelize','transaction','IncrementPreviewCounters','field','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperAdditionalPhone,\x20%s,\x20%s','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countbusyretry'];(function(_0x3dd3bc,_0x332f04){var _0x28d039=function(_0x10b604){while(--_0x10b604){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x28d039(++_0x332f04);}(_0x25c8,0xb3));var _0x825c=function(_0x52d421,_0xad381a){_0x52d421=_0x52d421-0x0;var _0x4aba38=_0x25c8[_0x52d421];return _0x4aba38;};'use strict';var _=require('lodash');var util=require(_0x825c('0x0'));var moment=require(_0x825c('0x1'));var BPromise=require('bluebird');var rs=require(_0x825c('0x2'));var fs=require('fs');var Redis=require(_0x825c('0x3'));var db=require(_0x825c('0x4'))['db'];var utils=require(_0x825c('0x5'));var logger=require(_0x825c('0x6'))(_0x825c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x825c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b42e8,_0x486d00,_0x28f138){return new BPromise(function(_0x47d8da,_0x2c1c7a){return client[_0x825c('0x9')](_0x3b42e8,_0x28f138)[_0x825c('0xa')](function(_0x5d2cc2){logger[_0x825c('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x486d00,_0x825c('0xc'));logger['debug'](_0x825c('0xd'),_0x486d00,_0x825c('0xc'),JSON[_0x825c('0xe')](_0x5d2cc2));if(_0x5d2cc2[_0x825c('0xf')]){if(_0x5d2cc2['error'][_0x825c('0x10')]===0x1f4){logger[_0x825c('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x486d00,_0x5d2cc2[_0x825c('0xf')][_0x825c('0x11')]);return _0x2c1c7a(_0x5d2cc2[_0x825c('0xf')][_0x825c('0x11')]);}logger[_0x825c('0xf')](_0x825c('0x12'),_0x486d00,_0x5d2cc2['error'][_0x825c('0x11')]);return _0x47d8da(_0x5d2cc2[_0x825c('0xf')][_0x825c('0x11')]);}else{logger[_0x825c('0xb')](_0x825c('0x12'),_0x486d00,_0x825c('0xc'));_0x47d8da(_0x5d2cc2[_0x825c('0x13')][_0x825c('0x11')]);}})[_0x825c('0x14')](function(_0x3ed8af){logger[_0x825c('0xf')](_0x825c('0x12'),_0x486d00,_0x3ed8af);_0x2c1c7a(_0x3ed8af);});});}exports[_0x825c('0x15')]=function(_0x35dd41){var _0x5c0904=this;return new Promise(function(_0x1f81b6,_0x321255){return db[_0x825c('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x35dd41[_0x825c('0x17')][_0x825c('0x18')],'ListId':_0x35dd41[_0x825c('0x17')][_0x825c('0x19')],'VoiceQueueId':_0x35dd41[_0x825c('0x17')]['VoiceQueueId']===undefined?null:_0x35dd41[_0x825c('0x17')][_0x825c('0x1a')],'CampaignId':_0x35dd41['body']['CampaignId']===undefined?null:_0x35dd41[_0x825c('0x17')][_0x825c('0x1b')]}})['then'](function(_0x485d31){if(_0x485d31!=null){return db['CmHopperAdditionalPhone'][_0x825c('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x485d31['id'],'OrderBy':{'$gt':_0x485d31[_0x825c('0x1d')]}},'order':[[_0x825c('0x1d'),'ASC']]})[_0x825c('0xa')](function(_0x5f103c){var _0xaab55b=0x0;if(_0x5f103c){if(_0x5f103c['countbusyretry']+_0x5f103c[_0x825c('0x1e')]+_0x5f103c[_0x825c('0x1f')]+_0x5f103c[_0x825c('0x20')]+_0x5f103c[_0x825c('0x21')]+_0x5f103c[_0x825c('0x22')]+_0x5f103c[_0x825c('0x23')]+_0x5f103c[_0x825c('0x24')]<_0x35dd41[_0x825c('0x25')][_0x825c('0x26')])_0xaab55b=0x1;_0x1f81b6({'additional':_0xaab55b});}else{return db[_0x825c('0x27')][_0x825c('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x485d31['id']},'order':[['OrderBy','ASC']]})[_0x825c('0xa')](function(_0x563f14){var _0x5a5a0a=0x0;if(_0x563f14){if(_0x563f14[_0x825c('0x28')]+_0x563f14[_0x825c('0x1e')]+_0x563f14[_0x825c('0x1f')]+_0x563f14[_0x825c('0x20')]+_0x563f14[_0x825c('0x21')]+_0x563f14[_0x825c('0x22')]+_0x563f14[_0x825c('0x23')]+_0x563f14[_0x825c('0x24')]<_0x35dd41[_0x825c('0x25')]['dialGlobalMaxRetry'])_0x5a5a0a=0x1;_0x1f81b6({'additional':_0x5a5a0a});}else{_0x1f81b6({'additional':0x0});}})[_0x825c('0x14')](function(_0x13f7cd){logger[_0x825c('0xf')](_0x825c('0x15'),_0x13f7cd[_0x825c('0x11')]);_0x321255(_0x5c0904[_0x825c('0xf')](0x1f4,_0x13f7cd[_0x825c('0x11')]));});}})[_0x825c('0x14')](function(_0xa044b7){logger[_0x825c('0xf')]('VerifyAdditionalPhones',_0xa044b7['message']);_0x321255(_0x5c0904[_0x825c('0xf')](0x1f4,_0xa044b7['message']));});}else _0x1f81b6({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x32986a){var _0x38c6d9=this;return new Promise(function(_0x2aa75e,_0x1b1a15){return db[_0x825c('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x32986a[_0x825c('0x17')][_0x825c('0x18')],'ListId':_0x32986a[_0x825c('0x17')]['ListId'],'VoiceQueueId':_0x32986a[_0x825c('0x17')][_0x825c('0x1a')]===undefined?null:_0x32986a[_0x825c('0x17')]['VoiceQueueId'],'CampaignId':_0x32986a[_0x825c('0x17')]['CampaignId']===undefined?null:_0x32986a[_0x825c('0x17')]['CampaignId']}})[_0x825c('0xa')](function(_0x537347){if(_0x537347!=null){return db[_0x825c('0x27')][_0x825c('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x537347['id'],'OrderBy':{'$gte':_0x537347['OrderBy']}},'order':[[_0x825c('0x1d'),_0x825c('0x29')]]})[_0x825c('0xa')](function(_0x413893){if(_0x413893)return activateAdditionalPhone(_0x537347,_0x32986a['body'],_0x413893,_0x32986a[_0x825c('0x2a')],_0x32986a[_0x825c('0x2b')])[_0x825c('0xa')](function(_0x480bc7){_0x2aa75e(_0x480bc7);});else{return db[_0x825c('0x27')][_0x825c('0x1c')]({'raw':!![],'where':{'CmHopperId':_0x537347['id']},'order':[[_0x825c('0x1d'),_0x825c('0x29')]]})[_0x825c('0xa')](function(_0x51b335){if(_0x51b335)return activateAdditionalPhone(_0x537347,_0x32986a['body'],_0x51b335,_0x32986a[_0x825c('0x2a')],_0x32986a[_0x825c('0x2b')])[_0x825c('0xa')](function(_0x10a611){_0x2aa75e(_0x10a611);});else{_0x2aa75e({'id':_0x537347['id'],'phone':''});}})[_0x825c('0x14')](function(_0x330811){logger['error'](_0x825c('0x15'),_0x330811[_0x825c('0x11')]);_0x1b1a15(_0x38c6d9[_0x825c('0xf')](0x1f4,_0x330811[_0x825c('0x11')]));});}})[_0x825c('0x14')](function(_0xf51224){logger[_0x825c('0xf')](_0x825c('0x15'),_0xf51224[_0x825c('0x11')]);_0x1b1a15(_0x38c6d9[_0x825c('0xf')](0x1f4,_0xf51224[_0x825c('0x11')]));});}else _0x2aa75e(0x1);});});};function activateAdditionalPhone(_0x7ebadd,_0x524685,_0x143527,_0x36acaf,_0x258d40){return new Promise(function(_0x432353,_0x102116){var _0x317471;if(_['isNil'](_0x143527[_0x825c('0x2c')])){_0x143527[_0x825c('0x2c')]=moment();}if(moment()>moment(_0x143527[_0x825c('0x2c')])){_0x317471=moment()[_0x825c('0x2d')](_0x258d40||0x3,_0x825c('0x2e'));}else{if(_0x143527[_0x825c('0x1d')]==0x0){_0x317471=moment(_0x143527[_0x825c('0x2c')]);}else{_0x317471=moment()['add'](_0x258d40||0x3,_0x825c('0x2e'));}}if(_['isNil'](_0x317471)){_0x317471=moment()[_0x825c('0x2d')](_0x258d40||0x3,_0x825c('0x2e'));}var _0xb25f85={'phone':_0x7ebadd[_0x825c('0x2f')],'active':0x0,'OrderBy':_[_0x825c('0x30')](_0x7ebadd[_0x825c('0x1d')])?0x0:_0x7ebadd['OrderBy'],'scheduledat':moment()[_0x825c('0x2d')](_0x36acaf||0x1,_0x825c('0x2e')),'countbusyretry':_0x524685[_0x825c('0x28')],'countcongestionretry':_0x524685[_0x825c('0x1e')],'countnoanswerretry':_0x524685[_0x825c('0x1f')],'countnosuchnumberretry':_0x524685[_0x825c('0x20')],'countdropretry':_0x524685[_0x825c('0x21')],'countabandonedretry':_0x524685['countabandonedretry'],'countmachineretry':_0x524685['countmachineretry'],'countagentrejectretry':_0x524685['countagentrejectretry'],'createdAt':_0x524685[_0x825c('0x31')],'updatedAt':_0x524685[_0x825c('0x32')]};var _0x52402d={'CmHopperId':_0x7ebadd['id'],'phone':_0x143527[_0x825c('0x2f')],'active':0x0,'OrderBy':_[_0x825c('0x30')](_0x143527[_0x825c('0x1d')])?0x0:_0x143527[_0x825c('0x1d')],'scheduledat':_0x317471,'countbusyretry':_0x143527['countbusyretry'],'countcongestionretry':_0x143527[_0x825c('0x1e')],'countnoanswerretry':_0x143527[_0x825c('0x1f')],'countnosuchnumberretry':_0x143527['countnosuchnumberretry'],'countdropretry':_0x143527[_0x825c('0x21')],'countabandonedretry':_0x143527[_0x825c('0x22')],'countmachineretry':_0x143527['countmachineretry'],'countagentrejectretry':_0x143527['countagentrejectretry'],'createdAt':_0x143527[_0x825c('0x31')],'updatedAt':_0x143527['updatedAt']};return db[_0x825c('0x33')][_0x825c('0x34')](function(_0x235ca2){return db[_0x825c('0x27')]['update'](_0xb25f85,{'where':{'id':_0x143527['id']}},{'transaction':_0x235ca2})[_0x825c('0xa')](function(){return db[_0x825c('0x16')]['update'](_0x52402d,{'where':{'id':_0x7ebadd['id']}},{'transaction':_0x235ca2});});})[_0x825c('0xa')](function(_0xd19f9){_0x432353({'id':_0x7ebadd['id'],'phone':_0x143527[_0x825c('0x2f')]});})[_0x825c('0x14')](function(_0x164fae){logger['error']('activateAdditionalPhone',_0x164fae[_0x825c('0x11')]);_0x102116({'error':_0x164fae[_0x825c('0x11')]});});});}exports[_0x825c('0x35')]=function(_0x17a447){var _0x226bc1=this;return new Promise(function(_0x253d44,_0xdfb215){return db[_0x825c('0x16')]['update'](_0x17a447[_0x825c('0x17')][_0x825c('0x36')],{'where':{'id':_0x17a447[_0x825c('0x17')]['id']}})[_0x825c('0xa')](function(_0x134ef7){_0x253d44(_0x134ef7);})['catch'](function(_0x1ec903){logger[_0x825c('0xf')](_0x825c('0x35'),_0x1ec903[_0x825c('0x11')]);_0xdfb215(_0x226bc1[_0x825c('0xf')](0x1f4,_0x1ec903[_0x825c('0x11')]));});});}; \ No newline at end of file +var _0xf7e5=['add','minutes','countcongestionretry','createdAt','phone','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countagentrejectretry','SwapAdditionalPhones','duration','ASC','waitTime','isNil','scheduledat'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x2389d3,_0x39428f){_0x2389d3=_0x2389d3-0x0;var _0xcbbdcc=_0xf7e5[_0x2389d3];return _0xcbbdcc;};'use strict';var _=require('lodash');var util=require(_0x5f7e('0x0'));var moment=require(_0x5f7e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f7e('0x2'));var db=require(_0x5f7e('0x3'))['db'];var utils=require(_0x5f7e('0x4'));var logger=require(_0x5f7e('0x5'))(_0x5f7e('0x6'));var config=require(_0x5f7e('0x7'));var jayson=require(_0x5f7e('0x8'));var client=jayson[_0x5f7e('0x9')][_0x5f7e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d2751,_0x509fd5,_0x186646){return new BPromise(function(_0xf2902e,_0x4a1ea2){return client['request'](_0x5d2751,_0x186646)[_0x5f7e('0xb')](function(_0xbabec1){logger[_0x5f7e('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x509fd5,_0x5f7e('0xd'));logger[_0x5f7e('0xe')](_0x5f7e('0xf'),_0x509fd5,_0x5f7e('0xd'),JSON[_0x5f7e('0x10')](_0xbabec1));if(_0xbabec1[_0x5f7e('0x11')]){if(_0xbabec1[_0x5f7e('0x11')]['code']===0x1f4){logger[_0x5f7e('0x11')](_0x5f7e('0x12'),_0x509fd5,_0xbabec1[_0x5f7e('0x11')][_0x5f7e('0x13')]);return _0x4a1ea2(_0xbabec1[_0x5f7e('0x11')]['message']);}logger[_0x5f7e('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x509fd5,_0xbabec1['error']['message']);return _0xf2902e(_0xbabec1[_0x5f7e('0x11')][_0x5f7e('0x13')]);}else{logger[_0x5f7e('0xc')](_0x5f7e('0x12'),_0x509fd5,'request\x20sent');_0xf2902e(_0xbabec1['result'][_0x5f7e('0x13')]);}})[_0x5f7e('0x14')](function(_0x2da1cb){logger[_0x5f7e('0x11')](_0x5f7e('0x12'),_0x509fd5,_0x2da1cb);_0x4a1ea2(_0x2da1cb);});});}exports[_0x5f7e('0x15')]=function(_0x5a2208){var _0x421b34=this;return new Promise(function(_0x46f3fd,_0x2fd8cf){return db[_0x5f7e('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x5a2208[_0x5f7e('0x17')][_0x5f7e('0x18')],'ListId':_0x5a2208[_0x5f7e('0x17')][_0x5f7e('0x19')],'VoiceQueueId':_0x5a2208[_0x5f7e('0x17')][_0x5f7e('0x1a')]===undefined?null:_0x5a2208[_0x5f7e('0x17')][_0x5f7e('0x1a')],'CampaignId':_0x5a2208['body']['CampaignId']===undefined?null:_0x5a2208[_0x5f7e('0x17')][_0x5f7e('0x1b')]}})[_0x5f7e('0xb')](function(_0x381b5a){if(_0x381b5a!=null){return db[_0x5f7e('0x1c')][_0x5f7e('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x381b5a['id'],'OrderBy':{'$gt':_0x381b5a[_0x5f7e('0x1e')]}},'order':[[_0x5f7e('0x1e'),'ASC']]})['then'](function(_0x251e81){var _0x24d221=0x0;if(_0x251e81){if(_0x251e81[_0x5f7e('0x1f')]+_0x251e81['countcongestionretry']+_0x251e81[_0x5f7e('0x20')]+_0x251e81[_0x5f7e('0x21')]+_0x251e81[_0x5f7e('0x22')]+_0x251e81[_0x5f7e('0x23')]+_0x251e81[_0x5f7e('0x24')]+_0x251e81['countagentrejectretry']<_0x5a2208[_0x5f7e('0x25')][_0x5f7e('0x26')])_0x24d221=0x1;_0x46f3fd({'additional':_0x24d221});}else{return db[_0x5f7e('0x1c')][_0x5f7e('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x381b5a['id']},'order':[['OrderBy','ASC']]})[_0x5f7e('0xb')](function(_0x4c1e00){var _0x4077e6=0x0;if(_0x4c1e00){if(_0x4c1e00['countbusyretry']+_0x4c1e00['countcongestionretry']+_0x4c1e00['countnoanswerretry']+_0x4c1e00[_0x5f7e('0x21')]+_0x4c1e00['countdropretry']+_0x4c1e00['countabandonedretry']+_0x4c1e00[_0x5f7e('0x24')]+_0x4c1e00[_0x5f7e('0x27')]<_0x5a2208[_0x5f7e('0x25')][_0x5f7e('0x26')])_0x4077e6=0x1;_0x46f3fd({'additional':_0x4077e6});}else{_0x46f3fd({'additional':0x0});}})[_0x5f7e('0x14')](function(_0x5f1f35){logger[_0x5f7e('0x11')](_0x5f7e('0x15'),_0x5f1f35['message']);_0x2fd8cf(_0x421b34[_0x5f7e('0x11')](0x1f4,_0x5f1f35[_0x5f7e('0x13')]));});}})['catch'](function(_0x5d2251){logger[_0x5f7e('0x11')](_0x5f7e('0x15'),_0x5d2251[_0x5f7e('0x13')]);_0x2fd8cf(_0x421b34[_0x5f7e('0x11')](0x1f4,_0x5d2251['message']));});}else _0x46f3fd({'additional':0x0});});});};exports[_0x5f7e('0x28')]=function(_0xeb5592){var _0x357541=this;return new Promise(function(_0x2bfc9c,_0x3c1e1a){return db[_0x5f7e('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0xeb5592['body'][_0x5f7e('0x18')],'ListId':_0xeb5592['body'][_0x5f7e('0x19')],'VoiceQueueId':_0xeb5592[_0x5f7e('0x17')][_0x5f7e('0x1a')]===undefined?null:_0xeb5592['body'][_0x5f7e('0x1a')],'CampaignId':_0xeb5592[_0x5f7e('0x17')][_0x5f7e('0x1b')]===undefined?null:_0xeb5592[_0x5f7e('0x17')][_0x5f7e('0x1b')]}})[_0x5f7e('0xb')](function(_0x57c0b0){if(_0x57c0b0!=null){return db[_0x5f7e('0x1c')][_0x5f7e('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x57c0b0['id'],'OrderBy':{'$gte':_0x57c0b0[_0x5f7e('0x1e')]}},'order':[[_0x5f7e('0x1e'),'ASC']]})[_0x5f7e('0xb')](function(_0x468765){if(_0x468765)return activateAdditionalPhone(_0x57c0b0,_0xeb5592[_0x5f7e('0x17')],_0x468765,_0xeb5592[_0x5f7e('0x29')],_0xeb5592['waitTime'])['then'](function(_0x4cded6){_0x2bfc9c(_0x4cded6);});else{return db[_0x5f7e('0x1c')][_0x5f7e('0x1d')]({'raw':!![],'where':{'CmHopperId':_0x57c0b0['id']},'order':[[_0x5f7e('0x1e'),_0x5f7e('0x2a')]]})[_0x5f7e('0xb')](function(_0x1e817c){if(_0x1e817c)return activateAdditionalPhone(_0x57c0b0,_0xeb5592['body'],_0x1e817c,_0xeb5592[_0x5f7e('0x29')],_0xeb5592[_0x5f7e('0x2b')])[_0x5f7e('0xb')](function(_0x480423){_0x2bfc9c(_0x480423);});else{_0x2bfc9c({'id':_0x57c0b0['id'],'phone':''});}})[_0x5f7e('0x14')](function(_0x14cd09){logger['error'](_0x5f7e('0x15'),_0x14cd09[_0x5f7e('0x13')]);_0x3c1e1a(_0x357541['error'](0x1f4,_0x14cd09[_0x5f7e('0x13')]));});}})[_0x5f7e('0x14')](function(_0x424c6d){logger['error'](_0x5f7e('0x15'),_0x424c6d[_0x5f7e('0x13')]);_0x3c1e1a(_0x357541[_0x5f7e('0x11')](0x1f4,_0x424c6d[_0x5f7e('0x13')]));});}else _0x2bfc9c(0x1);});});};function activateAdditionalPhone(_0x247957,_0x43addd,_0x3548c5,_0x38b36b,_0x4eced2){return new Promise(function(_0x36c337,_0xaf9f28){var _0x11f910;if(_[_0x5f7e('0x2c')](_0x3548c5[_0x5f7e('0x2d')])){_0x3548c5['scheduledat']=moment();}if(moment()>moment(_0x3548c5[_0x5f7e('0x2d')])){_0x11f910=moment()[_0x5f7e('0x2e')](_0x4eced2||0x3,'minutes');}else{if(_0x3548c5[_0x5f7e('0x1e')]==0x0){_0x11f910=moment(_0x3548c5[_0x5f7e('0x2d')]);}else{_0x11f910=moment()['add'](_0x4eced2||0x3,_0x5f7e('0x2f'));}}if(_[_0x5f7e('0x2c')](_0x11f910)){_0x11f910=moment()[_0x5f7e('0x2e')](_0x4eced2||0x3,'minutes');}var _0x4bb37c={'phone':_0x247957['phone'],'active':0x0,'OrderBy':_[_0x5f7e('0x2c')](_0x247957[_0x5f7e('0x1e')])?0x0:_0x247957[_0x5f7e('0x1e')],'scheduledat':moment()[_0x5f7e('0x2e')](_0x38b36b||0x1,_0x5f7e('0x2f')),'countbusyretry':_0x43addd[_0x5f7e('0x1f')],'countcongestionretry':_0x43addd[_0x5f7e('0x30')],'countnoanswerretry':_0x43addd['countnoanswerretry'],'countnosuchnumberretry':_0x43addd[_0x5f7e('0x21')],'countdropretry':_0x43addd[_0x5f7e('0x22')],'countabandonedretry':_0x43addd[_0x5f7e('0x23')],'countmachineretry':_0x43addd[_0x5f7e('0x24')],'countagentrejectretry':_0x43addd[_0x5f7e('0x27')],'createdAt':_0x43addd[_0x5f7e('0x31')],'updatedAt':_0x43addd['updatedAt']};var _0x251fbc={'CmHopperId':_0x247957['id'],'phone':_0x3548c5[_0x5f7e('0x32')],'active':0x0,'OrderBy':_[_0x5f7e('0x2c')](_0x3548c5[_0x5f7e('0x1e')])?0x0:_0x3548c5[_0x5f7e('0x1e')],'scheduledat':_0x11f910,'countbusyretry':_0x3548c5[_0x5f7e('0x1f')],'countcongestionretry':_0x3548c5[_0x5f7e('0x30')],'countnoanswerretry':_0x3548c5[_0x5f7e('0x20')],'countnosuchnumberretry':_0x3548c5[_0x5f7e('0x21')],'countdropretry':_0x3548c5[_0x5f7e('0x22')],'countabandonedretry':_0x3548c5[_0x5f7e('0x23')],'countmachineretry':_0x3548c5[_0x5f7e('0x24')],'countagentrejectretry':_0x3548c5[_0x5f7e('0x27')],'createdAt':_0x3548c5[_0x5f7e('0x31')],'updatedAt':_0x3548c5[_0x5f7e('0x33')]};return db[_0x5f7e('0x34')][_0x5f7e('0x35')](function(_0x1a799f){return db[_0x5f7e('0x1c')][_0x5f7e('0x36')](_0x4bb37c,{'where':{'id':_0x3548c5['id']}},{'transaction':_0x1a799f})[_0x5f7e('0xb')](function(){return db[_0x5f7e('0x16')]['update'](_0x251fbc,{'where':{'id':_0x247957['id']}},{'transaction':_0x1a799f});});})['then'](function(_0x480e2b){_0x36c337({'id':_0x247957['id'],'phone':_0x3548c5[_0x5f7e('0x32')]});})['catch'](function(_0x46758b){logger['error'](_0x5f7e('0x37'),_0x46758b[_0x5f7e('0x13')]);_0xaf9f28({'error':_0x46758b[_0x5f7e('0x13')]});});});}exports['IncrementPreviewCounters']=function(_0x3fcfa7){var _0x509d95=this;return new Promise(function(_0x234dde,_0x3adc3a){return db['CmHopper'][_0x5f7e('0x36')](_0x3fcfa7[_0x5f7e('0x17')]['field'],{'where':{'id':_0x3fcfa7[_0x5f7e('0x17')]['id']}})['then'](function(_0x1a172f){_0x234dde(_0x1a172f);})[_0x5f7e('0x14')](function(_0x1f7c89){logger[_0x5f7e('0x11')](_0x5f7e('0x38'),_0x1f7c89[_0x5f7e('0x13')]);_0x3adc3a(_0x509d95[_0x5f7e('0x11')](0x1f4,_0x1f7c89[_0x5f7e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index cd42109..0e20e2a 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 _0x257f=['/:id','delete','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','show','isAuthenticated','create','put'];(function(_0x445238,_0x74c087){var _0x1fb6e1=function(_0x3b6491){while(--_0x3b6491){_0x445238['push'](_0x445238['shift']());}};_0x1fb6e1(++_0x74c087);}(_0x257f,0x198));var _0xf257=function(_0xea6c1e,_0x5f1c21){_0xea6c1e=_0xea6c1e-0x0;var _0x452062=_0x257f[_0xea6c1e];return _0x452062;};'use strict';var multer=require('multer');var util=require(_0xf257('0x0'));var path=require(_0xf257('0x1'));var timeout=require('connect-timeout');var express=require(_0xf257('0x2'));var router=express['Router']();var fs_extra=require(_0xf257('0x3'));var auth=require(_0xf257('0x4'));var interaction=require(_0xf257('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperAdditionalPhone.controller');router[_0xf257('0x6')]('/',auth['isAuthenticated'](),controller[_0xf257('0x7')]);router[_0xf257('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xf257('0x8')]);router['post']('/',auth[_0xf257('0x9')](),controller[_0xf257('0xa')]);router[_0xf257('0xb')](_0xf257('0xc'),auth[_0xf257('0x9')](),controller['update']);router[_0xf257('0xd')](_0xf257('0xc'),auth[_0xf257('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa5a4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','post','create','destroy','multer','util','path','connect-timeout','express'];(function(_0x4ac60a,_0x503a99){var _0x4b22e8=function(_0x145c47){while(--_0x145c47){_0x4ac60a['push'](_0x4ac60a['shift']());}};_0x4b22e8(++_0x503a99);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xa5a4[_0x173441];return _0x2423a8;};'use strict';var multer=require(_0x4a5a('0x0'));var util=require(_0x4a5a('0x1'));var path=require(_0x4a5a('0x2'));var timeout=require(_0x4a5a('0x3'));var express=require(_0x4a5a('0x4'));var router=express[_0x4a5a('0x5')]();var fs_extra=require(_0x4a5a('0x6'));var auth=require(_0x4a5a('0x7'));var interaction=require(_0x4a5a('0x8'));var config=require(_0x4a5a('0x9'));var controller=require(_0x4a5a('0xa'));router[_0x4a5a('0xb')]('/',auth['isAuthenticated'](),controller[_0x4a5a('0xc')]);router[_0x4a5a('0xb')](_0x4a5a('0xd'),auth[_0x4a5a('0xe')](),controller['show']);router[_0x4a5a('0xf')]('/',auth[_0x4a5a('0xe')](),controller[_0x4a5a('0x10')]);router['put'](_0x4a5a('0xd'),auth[_0x4a5a('0xe')](),controller['update']);router['delete'](_0x4a5a('0xd'),auth['isAuthenticated'](),controller[_0x4a5a('0x11')]);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 b1417fa..0525d89 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 _0x158f=['contactListQueue','sequelize','exports','STRING','INTEGER'];(function(_0x173c25,_0x1bf5a9){var _0x5834a7=function(_0x480f01){while(--_0x480f01){_0x173c25['push'](_0x173c25['shift']());}};_0x5834a7(++_0x1bf5a9);}(_0x158f,0x137));var _0xf158=function(_0x584b1a,_0x5b4d87){_0x584b1a=_0x584b1a-0x0;var _0x1a72aa=_0x158f[_0x584b1a];return _0x1a72aa;};'use strict';var moment=require('moment');var Sequelize=require(_0xf158('0x0'));module[_0xf158('0x1')]={'phone':{'type':Sequelize[_0xf158('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf158('0x3')],'unique':_0xf158('0x4')},'ListId':{'type':Sequelize[_0xf158('0x3')],'unique':_0xf158('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf158('0x4')}}; \ No newline at end of file +var _0x06bf=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x06bf,0x105));var _0xf06b=function(_0x277fda,_0x57df6e){_0x277fda=_0x277fda-0x0;var _0x34475a=_0x06bf[_0x277fda];return _0x34475a;};'use strict';var moment=require(_0xf06b('0x0'));var Sequelize=require(_0xf06b('0x1'));module[_0xf06b('0x2')]={'phone':{'type':Sequelize[_0xf06b('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf06b('0x4')],'unique':_0xf06b('0x5')},'ListId':{'type':Sequelize[_0xf06b('0x4')],'unique':_0xf06b('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf06b('0x5')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 7a7028a..59948f3 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 _0x8f33=['../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','VIRTUAL','options','CmHopperBlack','includeAll','findAll','rows','catch','params','include','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x535cf1,_0x146e50){var _0x29adba=function(_0x25381e){while(--_0x25381e){_0x535cf1['push'](_0x535cf1['shift']());}};_0x29adba(++_0x146e50);}(_0x8f33,0x10c));var _0x38f3=function(_0x5c225c,_0x5b0b1f){_0x5c225c=_0x5c225c-0x0;var _0x1668e7=_0x8f33[_0x5c225c];return _0x1668e7;};'use strict';var emlformat=require(_0x38f3('0x0'));var rimraf=require(_0x38f3('0x1'));var zipdir=require(_0x38f3('0x2'));var jsonpatch=require(_0x38f3('0x3'));var rp=require('request-promise');var moment=require(_0x38f3('0x4'));var BPromise=require(_0x38f3('0x5'));var Mustache=require(_0x38f3('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x38f3('0x7'));var ejs=require(_0x38f3('0x8'));var fs=require('fs');var fs_extra=require(_0x38f3('0x9'));var _=require(_0x38f3('0xa'));var squel=require('squel');var crypto=require(_0x38f3('0xb'));var jsforce=require(_0x38f3('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x38f3('0x7'));var querystring=require('querystring');var Papa=require(_0x38f3('0xd'));var Redis=require(_0x38f3('0xe'));var authService=require(_0x38f3('0xf'));var qs=require(_0x38f3('0x10'));var as=require(_0x38f3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x38f3('0x12'))(_0x38f3('0x13'));var utils=require(_0x38f3('0x14'));var config=require(_0x38f3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x38f3('0x16'))['db'];function respondWithStatusCode(_0x460c59,_0x53348a){_0x53348a=_0x53348a||0xcc;return function(_0x27002e){if(_0x27002e){return _0x460c59['sendStatus'](_0x53348a);}return _0x460c59['status'](_0x53348a)[_0x38f3('0x17')]();};}function respondWithResult(_0x211b60,_0x28f3ab){_0x28f3ab=_0x28f3ab||0xc8;return function(_0x5509cc){if(_0x5509cc){return _0x211b60[_0x38f3('0x18')](_0x28f3ab)[_0x38f3('0x19')](_0x5509cc);}};}function respondWithFilteredResult(_0x53b8cd,_0x253791){return function(_0x11c6ab){if(_0x11c6ab){var _0x499de2=typeof _0x253791[_0x38f3('0x1a')]==='undefined'&&typeof _0x253791['limit']==='undefined';var _0x3aea0f=_0x11c6ab[_0x38f3('0x1b')];var _0x52cc3a=_0x499de2?0x0:_0x253791[_0x38f3('0x1a')];var _0x2ca894=_0x499de2?_0x11c6ab[_0x38f3('0x1b')]:_0x253791[_0x38f3('0x1a')]+_0x253791['limit'];var _0x3d6bf3;if(_0x2ca894>=_0x3aea0f){_0x2ca894=_0x3aea0f;_0x3d6bf3=0xc8;}else{_0x3d6bf3=0xce;}_0x53b8cd[_0x38f3('0x18')](_0x3d6bf3);return _0x53b8cd['set'](_0x38f3('0x1c'),_0x52cc3a+'-'+_0x2ca894+'/'+_0x3aea0f)[_0x38f3('0x19')](_0x11c6ab);}return null;};}function patchUpdates(_0x384124){return function(_0x2cf848){try{jsonpatch[_0x38f3('0x1d')](_0x2cf848,_0x384124,!![]);}catch(_0x2c332d){return BPromise['reject'](_0x2c332d);}return _0x2cf848[_0x38f3('0x1e')]();};}function saveUpdates(_0x5a2305,_0x22765e){return function(_0x39de25){if(_0x39de25){return _0x39de25[_0x38f3('0x1f')](_0x5a2305)[_0x38f3('0x20')](function(_0x407b38){return _0x407b38;});}return null;};}function removeEntity(_0x1e11f8,_0xb62196){return function(_0xd38d6){if(_0xd38d6){return _0xd38d6[_0x38f3('0x21')]()[_0x38f3('0x20')](function(){_0x1e11f8[_0x38f3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bc18a,_0x391ecc){return function(_0x4a2808){if(!_0x4a2808){_0x1bc18a['sendStatus'](0x194);}return _0x4a2808;};}function handleError(_0x8cb0f9,_0x98d43a){_0x98d43a=_0x98d43a||0x1f4;return function(_0x1498a0){logger[_0x38f3('0x22')](_0x1498a0[_0x38f3('0x23')]);if(_0x1498a0[_0x38f3('0x24')]){delete _0x1498a0[_0x38f3('0x24')];}_0x8cb0f9['status'](_0x98d43a)[_0x38f3('0x25')](_0x1498a0);};}exports[_0x38f3('0x26')]=function(_0x171dde,_0xd90ffb){var _0x18db9a={},_0x53d671={},_0x32506e={'count':0x0,'rows':[]};var _0x20c8ff=_[_0x38f3('0x27')](db['CmHopperBlack'][_0x38f3('0x28')],function(_0x3bffa4){return{'name':_0x3bffa4[_0x38f3('0x29')],'type':_0x3bffa4[_0x38f3('0x2a')][_0x38f3('0x2b')]};});_0x53d671[_0x38f3('0x2c')]=_[_0x38f3('0x27')](_0x20c8ff,_0x38f3('0x24'));_0x53d671['query']=_[_0x38f3('0x2d')](_0x171dde[_0x38f3('0x2e')]);_0x53d671['filters']=_[_0x38f3('0x2f')](_0x53d671[_0x38f3('0x2c')],_0x53d671['query']);_0x18db9a[_0x38f3('0x30')]=_['intersection'](_0x53d671['model'],qs[_0x38f3('0x31')](_0x171dde[_0x38f3('0x2e')][_0x38f3('0x31')]));_0x18db9a['attributes']=_0x18db9a[_0x38f3('0x30')][_0x38f3('0x32')]?_0x18db9a[_0x38f3('0x30')]:_0x53d671[_0x38f3('0x2c')];if(!_0x171dde[_0x38f3('0x2e')][_0x38f3('0x33')](_0x38f3('0x34'))){_0x18db9a[_0x38f3('0x35')]=qs[_0x38f3('0x35')](_0x171dde[_0x38f3('0x2e')][_0x38f3('0x35')]);_0x18db9a['offset']=qs[_0x38f3('0x1a')](_0x171dde[_0x38f3('0x2e')][_0x38f3('0x1a')]);}_0x18db9a[_0x38f3('0x36')]=qs['sort'](_0x171dde[_0x38f3('0x2e')][_0x38f3('0x37')]);_0x18db9a['where']=qs[_0x38f3('0x38')](_['pick'](_0x171dde[_0x38f3('0x2e')],_0x53d671[_0x38f3('0x38')]),_0x20c8ff);if(_0x171dde[_0x38f3('0x2e')][_0x38f3('0x39')]){_0x18db9a[_0x38f3('0x3a')]=_[_0x38f3('0x3b')](_0x18db9a['where'],{'$or':_['map'](_0x20c8ff,function(_0x8dbfa0){if(_0x8dbfa0['type']!==_0x38f3('0x3c')){var _0x2a004e={};_0x2a004e[_0x8dbfa0[_0x38f3('0x24')]]={'$like':'%'+_0x171dde[_0x38f3('0x2e')][_0x38f3('0x39')]+'%'};return _0x2a004e;}})});}_0x18db9a=_[_0x38f3('0x3b')]({},_0x18db9a,_0x171dde[_0x38f3('0x3d')]);var _0x72ae48={'where':_0x18db9a[_0x38f3('0x3a')]};return db[_0x38f3('0x3e')][_0x38f3('0x1b')](_0x72ae48)[_0x38f3('0x20')](function(_0x24ac7c){_0x32506e[_0x38f3('0x1b')]=_0x24ac7c;if(_0x171dde[_0x38f3('0x2e')][_0x38f3('0x3f')]){_0x18db9a['include']=[{'all':!![]}];}return db[_0x38f3('0x3e')][_0x38f3('0x40')](_0x18db9a);})['then'](function(_0x4db6e3){_0x32506e[_0x38f3('0x41')]=_0x4db6e3;return _0x32506e;})[_0x38f3('0x20')](respondWithFilteredResult(_0xd90ffb,_0x18db9a))[_0x38f3('0x42')](handleError(_0xd90ffb,null));};exports['show']=function(_0x542c1d,_0x9a2e1e){var _0x5e2aab={'raw':!![],'where':{'id':_0x542c1d[_0x38f3('0x43')]['id']}},_0x18d66a={};_0x18d66a[_0x38f3('0x2c')]=_[_0x38f3('0x2d')](db[_0x38f3('0x3e')][_0x38f3('0x28')]);_0x18d66a[_0x38f3('0x2e')]=_[_0x38f3('0x2d')](_0x542c1d[_0x38f3('0x2e')]);_0x18d66a['filters']=_[_0x38f3('0x2f')](_0x18d66a[_0x38f3('0x2c')],_0x18d66a[_0x38f3('0x2e')]);_0x5e2aab['attributes']=_[_0x38f3('0x2f')](_0x18d66a[_0x38f3('0x2c')],qs[_0x38f3('0x31')](_0x542c1d[_0x38f3('0x2e')][_0x38f3('0x31')]));_0x5e2aab[_0x38f3('0x30')]=_0x5e2aab[_0x38f3('0x30')][_0x38f3('0x32')]?_0x5e2aab[_0x38f3('0x30')]:_0x18d66a[_0x38f3('0x2c')];if(_0x542c1d['query'][_0x38f3('0x3f')]){_0x5e2aab[_0x38f3('0x44')]=[{'all':!![]}];}_0x5e2aab=_[_0x38f3('0x3b')]({},_0x5e2aab,_0x542c1d[_0x38f3('0x3d')]);return db['CmHopperBlack'][_0x38f3('0x45')](_0x5e2aab)[_0x38f3('0x20')](handleEntityNotFound(_0x9a2e1e,null))[_0x38f3('0x20')](respondWithResult(_0x9a2e1e,null))['catch'](handleError(_0x9a2e1e,null));};exports[_0x38f3('0x1f')]=function(_0x45c4cd,_0x2c2248){if(_0x45c4cd[_0x38f3('0x46')]['id']){delete _0x45c4cd[_0x38f3('0x46')]['id'];}return db[_0x38f3('0x3e')][_0x38f3('0x45')]({'where':{'id':_0x45c4cd[_0x38f3('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c2248,null))[_0x38f3('0x20')](saveUpdates(_0x45c4cd['body'],null))[_0x38f3('0x20')](respondWithResult(_0x2c2248,null))[_0x38f3('0x42')](handleError(_0x2c2248,null));};exports[_0x38f3('0x21')]=function(_0x1c8e0a,_0x4b02a5){return db[_0x38f3('0x3e')]['find']({'where':{'id':_0x1c8e0a[_0x38f3('0x43')]['id']}})[_0x38f3('0x20')](handleEntityNotFound(_0x4b02a5,null))[_0x38f3('0x20')](removeEntity(_0x4b02a5,null))['catch'](handleError(_0x4b02a5,null));};exports[_0x38f3('0x47')]=function(_0x413947,_0x1a9168){return db['CmHopperBlack'][_0x38f3('0x47')]()[_0x38f3('0x20')](respondWithResult(_0x1a9168,null))[_0x38f3('0x42')](handleError(_0x1a9168,null));}; \ No newline at end of file +var _0x604c=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x394739,_0x19ce1e){var _0x48d11e=function(_0x570c40){while(--_0x570c40){_0x394739['push'](_0x394739['shift']());}};_0x48d11e(++_0x19ce1e);}(_0x604c,0x1f0));var _0xc604=function(_0x4c00f2,_0x1f60a9){_0x4c00f2=_0x4c00f2-0x0;var _0x14ee6e=_0x604c[_0x4c00f2];return _0x14ee6e;};'use strict';var emlformat=require(_0xc604('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc604('0x1'));var jsonpatch=require(_0xc604('0x2'));var rp=require(_0xc604('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc604('0x4'));var util=require('util');var path=require(_0xc604('0x5'));var sox=require('sox');var csv=require(_0xc604('0x6'));var ejs=require(_0xc604('0x7'));var fs=require('fs');var fs_extra=require(_0xc604('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc604('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc604('0x6'));var querystring=require(_0xc604('0xa'));var Papa=require('papaparse');var Redis=require(_0xc604('0xb'));var authService=require(_0xc604('0xc'));var qs=require(_0xc604('0xd'));var as=require(_0xc604('0xe'));var hardwareService=require(_0xc604('0xf'));var logger=require(_0xc604('0x10'))(_0xc604('0x11'));var utils=require(_0xc604('0x12'));var config=require(_0xc604('0x13'));var licenseUtil=require(_0xc604('0x14'));var db=require(_0xc604('0x15'))['db'];function respondWithStatusCode(_0x3c8162,_0x56b292){_0x56b292=_0x56b292||0xcc;return function(_0x39cdeb){if(_0x39cdeb){return _0x3c8162[_0xc604('0x16')](_0x56b292);}return _0x3c8162[_0xc604('0x17')](_0x56b292)[_0xc604('0x18')]();};}function respondWithResult(_0x557ef0,_0x10fd89){_0x10fd89=_0x10fd89||0xc8;return function(_0x1791fa){if(_0x1791fa){return _0x557ef0[_0xc604('0x17')](_0x10fd89)[_0xc604('0x19')](_0x1791fa);}};}function respondWithFilteredResult(_0x57519d,_0x1bd090){return function(_0x2dd6dc){if(_0x2dd6dc){var _0x3d27da=typeof _0x1bd090[_0xc604('0x1a')]===_0xc604('0x1b')&&typeof _0x1bd090['limit']===_0xc604('0x1b');var _0x470040=_0x2dd6dc[_0xc604('0x1c')];var _0x581b23=_0x3d27da?0x0:_0x1bd090['offset'];var _0x389d75=_0x3d27da?_0x2dd6dc[_0xc604('0x1c')]:_0x1bd090[_0xc604('0x1a')]+_0x1bd090[_0xc604('0x1d')];var _0x5dcd4c;if(_0x389d75>=_0x470040){_0x389d75=_0x470040;_0x5dcd4c=0xc8;}else{_0x5dcd4c=0xce;}_0x57519d[_0xc604('0x17')](_0x5dcd4c);return _0x57519d['set'](_0xc604('0x1e'),_0x581b23+'-'+_0x389d75+'/'+_0x470040)[_0xc604('0x19')](_0x2dd6dc);}return null;};}function patchUpdates(_0x5f1a89){return function(_0x346314){try{jsonpatch[_0xc604('0x1f')](_0x346314,_0x5f1a89,!![]);}catch(_0x49b118){return BPromise['reject'](_0x49b118);}return _0x346314['save']();};}function saveUpdates(_0xa8996,_0x7b770f){return function(_0x4c9492){if(_0x4c9492){return _0x4c9492[_0xc604('0x20')](_0xa8996)[_0xc604('0x21')](function(_0x32614b){return _0x32614b;});}return null;};}function removeEntity(_0x4b767a,_0x37a0da){return function(_0x3d767e){if(_0x3d767e){return _0x3d767e[_0xc604('0x22')]()[_0xc604('0x21')](function(){_0x4b767a[_0xc604('0x17')](0xcc)[_0xc604('0x18')]();});}};}function handleEntityNotFound(_0x2f699f,_0x62b72b){return function(_0x5d996d){if(!_0x5d996d){_0x2f699f[_0xc604('0x16')](0x194);}return _0x5d996d;};}function handleError(_0x5b33ea,_0x240159){_0x240159=_0x240159||0x1f4;return function(_0x15e13c){logger[_0xc604('0x23')](_0x15e13c[_0xc604('0x24')]);if(_0x15e13c[_0xc604('0x25')]){delete _0x15e13c[_0xc604('0x25')];}_0x5b33ea[_0xc604('0x17')](_0x240159)[_0xc604('0x26')](_0x15e13c);};}exports[_0xc604('0x27')]=function(_0x433c24,_0xf9eef8){var _0x196df1={},_0x47b93f={},_0x32bbeb={'count':0x0,'rows':[]};var _0x17d70e=_[_0xc604('0x28')](db[_0xc604('0x29')]['rawAttributes'],function(_0xade6db){return{'name':_0xade6db[_0xc604('0x2a')],'type':_0xade6db[_0xc604('0x2b')][_0xc604('0x2c')]};});_0x47b93f['model']=_[_0xc604('0x28')](_0x17d70e,_0xc604('0x25'));_0x47b93f['query']=_['keys'](_0x433c24[_0xc604('0x2d')]);_0x47b93f[_0xc604('0x2e')]=_['intersection'](_0x47b93f['model'],_0x47b93f[_0xc604('0x2d')]);_0x196df1[_0xc604('0x2f')]=_[_0xc604('0x30')](_0x47b93f[_0xc604('0x31')],qs[_0xc604('0x32')](_0x433c24[_0xc604('0x2d')][_0xc604('0x32')]));_0x196df1[_0xc604('0x2f')]=_0x196df1[_0xc604('0x2f')]['length']?_0x196df1[_0xc604('0x2f')]:_0x47b93f[_0xc604('0x31')];if(!_0x433c24[_0xc604('0x2d')][_0xc604('0x33')](_0xc604('0x34'))){_0x196df1[_0xc604('0x1d')]=qs['limit'](_0x433c24[_0xc604('0x2d')]['limit']);_0x196df1[_0xc604('0x1a')]=qs[_0xc604('0x1a')](_0x433c24['query'][_0xc604('0x1a')]);}_0x196df1[_0xc604('0x35')]=qs['sort'](_0x433c24['query'][_0xc604('0x36')]);_0x196df1['where']=qs[_0xc604('0x2e')](_['pick'](_0x433c24['query'],_0x47b93f[_0xc604('0x2e')]),_0x17d70e);if(_0x433c24[_0xc604('0x2d')]['filter']){_0x196df1[_0xc604('0x37')]=_[_0xc604('0x38')](_0x196df1[_0xc604('0x37')],{'$or':_['map'](_0x17d70e,function(_0x134992){if(_0x134992[_0xc604('0x2b')]!==_0xc604('0x39')){var _0x3e300f={};_0x3e300f[_0x134992['name']]={'$like':'%'+_0x433c24[_0xc604('0x2d')][_0xc604('0x3a')]+'%'};return _0x3e300f;}})});}_0x196df1=_[_0xc604('0x38')]({},_0x196df1,_0x433c24[_0xc604('0x3b')]);var _0x156a7d={'where':_0x196df1[_0xc604('0x37')]};return db[_0xc604('0x29')][_0xc604('0x1c')](_0x156a7d)['then'](function(_0x2ade1f){_0x32bbeb[_0xc604('0x1c')]=_0x2ade1f;if(_0x433c24['query'][_0xc604('0x3c')]){_0x196df1['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xc604('0x3d')](_0x196df1);})[_0xc604('0x21')](function(_0x395b6d){_0x32bbeb[_0xc604('0x3e')]=_0x395b6d;return _0x32bbeb;})['then'](respondWithFilteredResult(_0xf9eef8,_0x196df1))[_0xc604('0x3f')](handleError(_0xf9eef8,null));};exports[_0xc604('0x40')]=function(_0x1a58a3,_0x4e6d6b){var _0x317d7e={'raw':!![],'where':{'id':_0x1a58a3[_0xc604('0x41')]['id']}},_0x113d03={};_0x113d03[_0xc604('0x31')]=_[_0xc604('0x42')](db[_0xc604('0x29')][_0xc604('0x43')]);_0x113d03[_0xc604('0x2d')]=_[_0xc604('0x42')](_0x1a58a3[_0xc604('0x2d')]);_0x113d03[_0xc604('0x2e')]=_['intersection'](_0x113d03[_0xc604('0x31')],_0x113d03[_0xc604('0x2d')]);_0x317d7e[_0xc604('0x2f')]=_[_0xc604('0x30')](_0x113d03[_0xc604('0x31')],qs['fields'](_0x1a58a3[_0xc604('0x2d')][_0xc604('0x32')]));_0x317d7e[_0xc604('0x2f')]=_0x317d7e[_0xc604('0x2f')][_0xc604('0x44')]?_0x317d7e[_0xc604('0x2f')]:_0x113d03[_0xc604('0x31')];if(_0x1a58a3[_0xc604('0x2d')]['includeAll']){_0x317d7e[_0xc604('0x45')]=[{'all':!![]}];}_0x317d7e=_[_0xc604('0x38')]({},_0x317d7e,_0x1a58a3[_0xc604('0x3b')]);return db['CmHopperBlack'][_0xc604('0x46')](_0x317d7e)[_0xc604('0x21')](handleEntityNotFound(_0x4e6d6b,null))[_0xc604('0x21')](respondWithResult(_0x4e6d6b,null))[_0xc604('0x3f')](handleError(_0x4e6d6b,null));};exports[_0xc604('0x20')]=function(_0x582985,_0x3945ae){if(_0x582985['body']['id']){delete _0x582985[_0xc604('0x47')]['id'];}return db[_0xc604('0x29')][_0xc604('0x46')]({'where':{'id':_0x582985[_0xc604('0x41')]['id']}})[_0xc604('0x21')](handleEntityNotFound(_0x3945ae,null))['then'](saveUpdates(_0x582985[_0xc604('0x47')],null))[_0xc604('0x21')](respondWithResult(_0x3945ae,null))['catch'](handleError(_0x3945ae,null));};exports[_0xc604('0x22')]=function(_0xd6f99b,_0x361fde){return db['CmHopperBlack'][_0xc604('0x46')]({'where':{'id':_0xd6f99b[_0xc604('0x41')]['id']}})[_0xc604('0x21')](handleEntityNotFound(_0x361fde,null))['then'](removeEntity(_0x361fde,null))['catch'](handleError(_0x361fde,null));};exports[_0xc604('0x48')]=function(_0x8c6e90,_0x448991){return db[_0xc604('0x29')]['describe']()['then'](respondWithResult(_0x448991,null))[_0xc604('0x3f')](handleError(_0x448991,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 06c82d7..3c7e0ea 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 _0x67c3=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x67c3,0x18c));var _0x367c=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0x67c3[_0x531607];return _0x1b1fbb;};'use strict';var _=require('lodash');var util=require(_0x367c('0x0'));var logger=require(_0x367c('0x1'))(_0x367c('0x2'));var moment=require(_0x367c('0x3'));var BPromise=require(_0x367c('0x4'));var rp=require(_0x367c('0x5'));var fs=require('fs');var path=require(_0x367c('0x6'));var rimraf=require('rimraf');var config=require(_0x367c('0x7'));var attributes=require(_0x367c('0x8'));module[_0x367c('0x9')]=function(_0x17f8c3,_0x5477bc){return _0x17f8c3[_0x367c('0xa')](_0x367c('0xb'),attributes,{'tableName':_0x367c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1aac=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','../../config/logger','api','moment','request-promise'];(function(_0x4d6703,_0x3eee51){var _0x2c35c2=function(_0x5dba67){while(--_0x5dba67){_0x4d6703['push'](_0x4d6703['shift']());}};_0x2c35c2(++_0x3eee51);}(_0x1aac,0xed));var _0xc1aa=function(_0x2cd97b,_0x2390f7){_0x2cd97b=_0x2cd97b-0x0;var _0x195a75=_0x1aac[_0x2cd97b];return _0x195a75;};'use strict';var _=require(_0xc1aa('0x0'));var util=require('util');var logger=require(_0xc1aa('0x1'))(_0xc1aa('0x2'));var moment=require(_0xc1aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xc1aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1aa('0x5'));var config=require(_0xc1aa('0x6'));var attributes=require(_0xc1aa('0x7'));module[_0xc1aa('0x8')]=function(_0x390499,_0x2e4153){return _0x390499[_0xc1aa('0x9')](_0xc1aa('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 3341c08..a4a7ddd 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 _0xd8ef=['stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','update','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8ef,0xef));var _0xfd8e=function(_0x36a280,_0x184fd5){_0x36a280=_0x36a280-0x0;var _0x59f726=_0xd8ef[_0x36a280];return _0x59f726;};'use strict';var _=require('lodash');var util=require(_0xfd8e('0x0'));var moment=require(_0xfd8e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd8e('0x2'));var logger=require(_0xfd8e('0x3'))(_0xfd8e('0x4'));var config=require(_0xfd8e('0x5'));var jayson=require(_0xfd8e('0x6'));var client=jayson['client'][_0xfd8e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372fa3,_0x5f435e,_0x29bdb7){return new BPromise(function(_0x22ed01,_0x4bf4d){return client[_0xfd8e('0x8')](_0x372fa3,_0x29bdb7)[_0xfd8e('0x9')](function(_0x407022){logger['info'](_0xfd8e('0xa'),_0x5f435e,_0xfd8e('0xb'));logger['debug'](_0xfd8e('0xc'),_0x5f435e,_0xfd8e('0xb'),JSON[_0xfd8e('0xd')](_0x407022));if(_0x407022[_0xfd8e('0xe')]){if(_0x407022[_0xfd8e('0xe')][_0xfd8e('0xf')]===0x1f4){logger['error'](_0xfd8e('0xa'),_0x5f435e,_0x407022[_0xfd8e('0xe')][_0xfd8e('0x10')]);return _0x4bf4d(_0x407022[_0xfd8e('0xe')][_0xfd8e('0x10')]);}logger['error'](_0xfd8e('0xa'),_0x5f435e,_0x407022['error'][_0xfd8e('0x10')]);return _0x22ed01(_0x407022[_0xfd8e('0xe')][_0xfd8e('0x10')]);}else{logger[_0xfd8e('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x5f435e,'request\x20sent');_0x22ed01(_0x407022[_0xfd8e('0x12')][_0xfd8e('0x10')]);}})[_0xfd8e('0x13')](function(_0x4349a2){logger[_0xfd8e('0xe')](_0xfd8e('0xa'),_0x5f435e,_0x4349a2);_0x4bf4d(_0x4349a2);});});}exports[_0xfd8e('0x14')]=function(_0x1b06aa){var _0x1759e9=this;return new Promise(function(_0x4c1381,_0xeff27f){return db[_0xfd8e('0x15')][_0xfd8e('0x16')]({'raw':_0x1b06aa['options']?_0x1b06aa[_0xfd8e('0x17')][_0xfd8e('0x18')]===undefined?!![]:![]:!![],'where':_0x1b06aa[_0xfd8e('0x17')]?_0x1b06aa[_0xfd8e('0x17')][_0xfd8e('0x19')]||null:null,'attributes':_0x1b06aa[_0xfd8e('0x17')]?_0x1b06aa[_0xfd8e('0x17')][_0xfd8e('0x1a')]||null:null,'limit':_0x1b06aa[_0xfd8e('0x17')]?_0x1b06aa[_0xfd8e('0x17')][_0xfd8e('0x1b')]||null:null,'include':_0x1b06aa['options']?_0x1b06aa[_0xfd8e('0x17')][_0xfd8e('0x1c')]?_[_0xfd8e('0x1d')](_0x1b06aa['options'][_0xfd8e('0x1c')],function(_0x4c130f){return{'model':db[_0x4c130f[_0xfd8e('0x1e')]],'as':_0x4c130f['as'],'attributes':_0x4c130f['attributes'],'include':_0x4c130f[_0xfd8e('0x1c')]?_[_0xfd8e('0x1d')](_0x4c130f['include'],function(_0x2c5d99){return{'model':db[_0x2c5d99['model']],'as':_0x2c5d99['as'],'attributes':_0x2c5d99[_0xfd8e('0x1a')],'include':_0x2c5d99['include']?_['map'](_0x2c5d99['include'],function(_0x4cce17){return{'model':db[_0x4cce17[_0xfd8e('0x1e')]],'as':_0x4cce17['as'],'attributes':_0x4cce17[_0xfd8e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19aaef){logger[_0xfd8e('0x11')](_0xfd8e('0x14'),_0x1b06aa);logger[_0xfd8e('0x1f')](_0xfd8e('0x14'),_0x1b06aa,JSON[_0xfd8e('0xd')](_0x19aaef));_0x4c1381(_0x19aaef);})[_0xfd8e('0x13')](function(_0x379cb1){logger[_0xfd8e('0xe')]('GetCmHopperBlack',_0x379cb1[_0xfd8e('0x10')],_0x1b06aa);_0xeff27f(_0x1759e9[_0xfd8e('0xe')](0x1f4,_0x379cb1[_0xfd8e('0x10')]));});});};exports['UpdateCmHopperBlack']=function(_0x1f5042){var _0xc9de53=this;return new Promise(function(_0x41251a,_0x323c6e){return db['CmHopperBlack'][_0xfd8e('0x20')](_0x1f5042['body'],{'raw':_0x1f5042[_0xfd8e('0x17')]?_0x1f5042[_0xfd8e('0x17')][_0xfd8e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f5042[_0xfd8e('0x17')]?_0x1f5042[_0xfd8e('0x17')]['where']||null:null,'attributes':_0x1f5042[_0xfd8e('0x17')]?_0x1f5042['options']['attributes']||null:null,'limit':_0x1f5042[_0xfd8e('0x17')]?_0x1f5042['options']['limit']||null:null})[_0xfd8e('0x9')](function(_0x127e7b){logger[_0xfd8e('0x11')](_0xfd8e('0x21'),_0x1f5042);logger['debug']('UpdateCmHopperBlack',_0x1f5042,JSON[_0xfd8e('0xd')](_0x127e7b));_0x41251a(_0x127e7b);})[_0xfd8e('0x13')](function(_0x155007){logger[_0xfd8e('0xe')](_0xfd8e('0x21'),_0x155007[_0xfd8e('0x10')],_0x1f5042);_0x323c6e(_0xc9de53[_0xfd8e('0xe')](0x1f4,_0x155007['message']));});});};exports[_0xfd8e('0x22')]=function(_0x17dab8){var _0x2671bd=this;return new Promise(function(_0x30a1ad,_0x26b597){return db[_0xfd8e('0x15')][_0xfd8e('0x23')]({'where':_0x17dab8[_0xfd8e('0x17')]?_0x17dab8[_0xfd8e('0x17')][_0xfd8e('0x19')]||null:null})['then'](function(_0x277c8a){logger[_0xfd8e('0x11')](_0xfd8e('0x22'),_0x17dab8);logger['debug'](_0xfd8e('0x22'),_0x17dab8,JSON[_0xfd8e('0xd')](_0x277c8a));_0x30a1ad(_0x277c8a);})['catch'](function(_0x51f3e2){logger[_0xfd8e('0xe')](_0xfd8e('0x22'),_0x51f3e2[_0xfd8e('0x10')],_0x17dab8);_0x26b597(_0x2671bd[_0xfd8e('0xe')](0x1f4,_0x51f3e2[_0xfd8e('0x10')]));});});}; \ No newline at end of file +var _0x4981=['error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','limit','include','map','model','attributes','update','UpdateCmHopperBlack','debug','DestroyCmHopperBlack','lodash','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1ecf92,_0x3a8472){var _0x2a5952=function(_0x58b318){while(--_0x58b318){_0x1ecf92['push'](_0x1ecf92['shift']());}};_0x2a5952(++_0x3a8472);}(_0x4981,0x1c0));var _0x1498=function(_0x189126,_0x61f3c1){_0x189126=_0x189126-0x0;var _0x681c87=_0x4981[_0x189126];return _0x681c87;};'use strict';var _=require(_0x1498('0x0'));var util=require('util');var moment=require(_0x1498('0x1'));var BPromise=require('bluebird');var rs=require(_0x1498('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1498('0x3'));var logger=require('../../config/logger')(_0x1498('0x4'));var config=require(_0x1498('0x5'));var jayson=require(_0x1498('0x6'));var client=jayson['client'][_0x1498('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4cc898,_0x49b90b,_0x2b7c5d){return new BPromise(function(_0x5c7960,_0x243318){return client['request'](_0x4cc898,_0x2b7c5d)[_0x1498('0x8')](function(_0x58ed1d){logger[_0x1498('0x9')](_0x1498('0xa'),_0x49b90b,_0x1498('0xb'));logger['debug'](_0x1498('0xc'),_0x49b90b,_0x1498('0xb'),JSON[_0x1498('0xd')](_0x58ed1d));if(_0x58ed1d['error']){if(_0x58ed1d[_0x1498('0xe')]['code']===0x1f4){logger[_0x1498('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x49b90b,_0x58ed1d['error']['message']);return _0x243318(_0x58ed1d[_0x1498('0xe')]['message']);}logger[_0x1498('0xe')](_0x1498('0xa'),_0x49b90b,_0x58ed1d[_0x1498('0xe')][_0x1498('0xf')]);return _0x5c7960(_0x58ed1d[_0x1498('0xe')][_0x1498('0xf')]);}else{logger['info'](_0x1498('0xa'),_0x49b90b,_0x1498('0xb'));_0x5c7960(_0x58ed1d[_0x1498('0x10')][_0x1498('0xf')]);}})[_0x1498('0x11')](function(_0x1b9096){logger[_0x1498('0xe')](_0x1498('0xa'),_0x49b90b,_0x1b9096);_0x243318(_0x1b9096);});});}exports[_0x1498('0x12')]=function(_0x7579bc){var _0x159c9e=this;return new Promise(function(_0x21a2d5,_0x3531be){return db[_0x1498('0x13')][_0x1498('0x14')]({'raw':_0x7579bc[_0x1498('0x15')]?_0x7579bc[_0x1498('0x15')][_0x1498('0x16')]===undefined?!![]:![]:!![],'where':_0x7579bc['options']?_0x7579bc[_0x1498('0x15')][_0x1498('0x17')]||null:null,'attributes':_0x7579bc[_0x1498('0x15')]?_0x7579bc[_0x1498('0x15')]['attributes']||null:null,'limit':_0x7579bc[_0x1498('0x15')]?_0x7579bc[_0x1498('0x15')][_0x1498('0x18')]||null:null,'include':_0x7579bc[_0x1498('0x15')]?_0x7579bc[_0x1498('0x15')][_0x1498('0x19')]?_[_0x1498('0x1a')](_0x7579bc['options'][_0x1498('0x19')],function(_0x4ebb5c){return{'model':db[_0x4ebb5c[_0x1498('0x1b')]],'as':_0x4ebb5c['as'],'attributes':_0x4ebb5c[_0x1498('0x1c')],'include':_0x4ebb5c[_0x1498('0x19')]?_[_0x1498('0x1a')](_0x4ebb5c['include'],function(_0x924fa2){return{'model':db[_0x924fa2[_0x1498('0x1b')]],'as':_0x924fa2['as'],'attributes':_0x924fa2[_0x1498('0x1c')],'include':_0x924fa2[_0x1498('0x19')]?_[_0x1498('0x1a')](_0x924fa2[_0x1498('0x19')],function(_0x176c1f){return{'model':db[_0x176c1f[_0x1498('0x1b')]],'as':_0x176c1f['as'],'attributes':_0x176c1f[_0x1498('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1498('0x8')](function(_0x4338f2){logger[_0x1498('0x9')](_0x1498('0x12'),_0x7579bc);logger['debug'](_0x1498('0x12'),_0x7579bc,JSON[_0x1498('0xd')](_0x4338f2));_0x21a2d5(_0x4338f2);})[_0x1498('0x11')](function(_0x547d7a){logger[_0x1498('0xe')](_0x1498('0x12'),_0x547d7a[_0x1498('0xf')],_0x7579bc);_0x3531be(_0x159c9e[_0x1498('0xe')](0x1f4,_0x547d7a[_0x1498('0xf')]));});});};exports['UpdateCmHopperBlack']=function(_0x2880ca){var _0x2b767f=this;return new Promise(function(_0x26de8a,_0x3a431f){return db['CmHopperBlack'][_0x1498('0x1d')](_0x2880ca['body'],{'raw':_0x2880ca[_0x1498('0x15')]?_0x2880ca[_0x1498('0x15')][_0x1498('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2880ca['options']?_0x2880ca[_0x1498('0x15')][_0x1498('0x17')]||null:null,'attributes':_0x2880ca[_0x1498('0x15')]?_0x2880ca[_0x1498('0x15')][_0x1498('0x1c')]||null:null,'limit':_0x2880ca[_0x1498('0x15')]?_0x2880ca[_0x1498('0x15')][_0x1498('0x18')]||null:null})['then'](function(_0x3cc4c6){logger[_0x1498('0x9')](_0x1498('0x1e'),_0x2880ca);logger[_0x1498('0x1f')](_0x1498('0x1e'),_0x2880ca,JSON['stringify'](_0x3cc4c6));_0x26de8a(_0x3cc4c6);})[_0x1498('0x11')](function(_0x460204){logger['error'](_0x1498('0x1e'),_0x460204['message'],_0x2880ca);_0x3a431f(_0x2b767f[_0x1498('0xe')](0x1f4,_0x460204[_0x1498('0xf')]));});});};exports[_0x1498('0x20')]=function(_0x4ad071){var _0x3dba0b=this;return new Promise(function(_0x1bfd5a,_0x1fe442){return db[_0x1498('0x13')]['destroy']({'where':_0x4ad071[_0x1498('0x15')]?_0x4ad071[_0x1498('0x15')]['where']||null:null})[_0x1498('0x8')](function(_0x2e064f){logger[_0x1498('0x9')](_0x1498('0x20'),_0x4ad071);logger['debug'](_0x1498('0x20'),_0x4ad071,JSON[_0x1498('0xd')](_0x2e064f));_0x1bfd5a(_0x2e064f);})[_0x1498('0x11')](function(_0x3dcfe5){logger[_0x1498('0xe')](_0x1498('0x20'),_0x3dcfe5[_0x1498('0xf')],_0x4ad071);_0x1fe442(_0x3dba0b[_0x1498('0xe')](0x1f4,_0x3dcfe5[_0x1498('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index f9015d5..df59196 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 _0x3c6c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','put','update','destroy','multer','path','connect-timeout','express','Router'];(function(_0x4fca6e,_0x53b49f){var _0x31d3d9=function(_0x47ed8b){while(--_0x47ed8b){_0x4fca6e['push'](_0x4fca6e['shift']());}};_0x31d3d9(++_0x53b49f);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x523061,_0x87d040){_0x523061=_0x523061-0x0;var _0x5517ca=_0x3c6c[_0x523061];return _0x5517ca;};'use strict';var multer=require(_0xc3c6('0x0'));var util=require('util');var path=require(_0xc3c6('0x1'));var timeout=require(_0xc3c6('0x2'));var express=require(_0xc3c6('0x3'));var router=express[_0xc3c6('0x4')]();var fs_extra=require(_0xc3c6('0x5'));var auth=require(_0xc3c6('0x6'));var interaction=require(_0xc3c6('0x7'));var config=require(_0xc3c6('0x8'));var controller=require('./cmHopperBlack.controller');router[_0xc3c6('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3c6('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller['show']);router[_0xc3c6('0xd')](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xe')]);router['delete'](_0xc3c6('0xb'),auth[_0xc3c6('0xc')](),controller[_0xc3c6('0xf')]);module['exports']=router; \ No newline at end of file +var _0x57ca=['../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1f8a49,_0x4d074f){var _0x4a87d7=function(_0x52b404){while(--_0x52b404){_0x1f8a49['push'](_0x1f8a49['shift']());}};_0x4a87d7(++_0x4d074f);}(_0x57ca,0x108));var _0xa57c=function(_0x58abad,_0xdd7a61){_0x58abad=_0x58abad-0x0;var _0x223750=_0x57ca[_0x58abad];return _0x223750;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0xf')]('/:id',auth[_0xa57c('0x9')](),controller['update']);router[_0xa57c('0x10')](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d63e1da..2d8e2db 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 _0xfc8d=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','setDataValue','followuptime'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfc8d,0x123));var _0xdfc8=function(_0x58d5d4,_0x4f05a3){_0x58d5d4=_0x58d5d4-0x0;var _0x596a07=_0xfc8d[_0x58d5d4];return _0x596a07;};'use strict';var Sequelize=require(_0xdfc8('0x0'));var moment=require(_0xdfc8('0x1'));module[_0xdfc8('0x2')]={'state':{'type':Sequelize[_0xdfc8('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xdfc8('0x4')]},'scheduledat':{'type':Sequelize[_0xdfc8('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdfc8('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xdfc8('0x4')]},'originatecalleridname':{'type':Sequelize[_0xdfc8('0x4')]},'calleridnum':{'type':Sequelize[_0xdfc8('0x4')]},'calleridname':{'type':Sequelize[_0xdfc8('0x4')]},'starttime':{'type':Sequelize[_0xdfc8('0x5')]},'responsetime':{'type':Sequelize[_0xdfc8('0x5')]},'answertime':{'type':Sequelize[_0xdfc8('0x5')]},'droptime':{'type':Sequelize[_0xdfc8('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdfc8('0x4')]},'campaign':{'type':Sequelize[_0xdfc8('0x4')]},'campaigntype':{'type':Sequelize[_0xdfc8('0x4')]},'membername':{'type':Sequelize[_0xdfc8('0x4')]},'reason':{'type':Sequelize[_0xdfc8('0x4')]},'disposition':{'type':Sequelize[_0xdfc8('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xdfc8('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x33577a){var _0x42b258=this[_0xdfc8('0x6')]('endtime');if(_0x42b258&&_0x33577a){this[_0xdfc8('0x7')](_0xdfc8('0x8'),moment(_0x33577a)[_0xdfc8('0x9')](moment(_0x42b258),_0xdfc8('0xa')));}}},'amd':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xdfc8('0x5')]},'callback':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdfc8('0x5')]},'deleted':{'type':Sequelize[_0xdfc8('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdfc8('0x5')]},'recallme':{'type':Sequelize[_0xdfc8('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdfc8('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x525f=['sequelize','moment','exports','INTEGER','DATE','STRING','getDataValue','followuptime','seconds','BOOLEAN'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x525f,0x64));var _0xf525=function(_0x585176,_0xac2ff1){_0x585176=_0x585176-0x0;var _0x1f3baf=_0x525f[_0x585176];return _0x1f3baf;};'use strict';var Sequelize=require(_0xf525('0x0'));var moment=require(_0xf525('0x1'));module[_0xf525('0x2')]={'state':{'type':Sequelize[_0xf525('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf525('0x4')]},'countbusyretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xf525('0x5')]},'originatecalleridname':{'type':Sequelize[_0xf525('0x5')]},'calleridnum':{'type':Sequelize[_0xf525('0x5')]},'calleridname':{'type':Sequelize[_0xf525('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf525('0x4')]},'answertime':{'type':Sequelize[_0xf525('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf525('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xf525('0x5')]},'campaign':{'type':Sequelize[_0xf525('0x5')]},'campaigntype':{'type':Sequelize[_0xf525('0x5')]},'membername':{'type':Sequelize[_0xf525('0x5')]},'reason':{'type':Sequelize[_0xf525('0x5')]},'disposition':{'type':Sequelize[_0xf525('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf525('0x5')]},'dispositionat':{'type':Sequelize[_0xf525('0x4')],'set':function(_0x52c41f){var _0x13777f=this[_0xf525('0x6')]('endtime');if(_0x13777f&&_0x52c41f){this['setDataValue'](_0xf525('0x7'),moment(_0x52c41f)['diff'](moment(_0x13777f),_0xf525('0x8')));}}},'amd':{'type':Sequelize[_0xf525('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xf525('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf525('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf525('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf525('0x4')]},'callback':{'type':Sequelize[_0xf525('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf525('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xf525('0x4')]},'deleted':{'type':Sequelize[_0xf525('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf525('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf525('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf525('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 16c0ce7..f797e66 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 _0xeff8=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','noSuchContacts','noAnswerContacts','`state`\x20=\x2011\x20,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','toString','group','moveContactsIvrCampaignHopperFinal','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne'];(function(_0x1f9272,_0x552e5a){var _0x3e7f35=function(_0x3e3311){while(--_0x3e3311){_0x1f9272['push'](_0x1f9272['shift']());}};_0x3e7f35(++_0x552e5a);}(_0xeff8,0x186));var _0x8eff=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xeff8[_0xa6cc5c];return _0x44803d;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['CmHopperFinal'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['CmHopperFinal']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')]()[_0x8eff('0x26')](respondWithResult(_0x1b5fda,null))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x3287d6,_0x4c7013){if(_0x3287d6[_0x8eff('0x4a')]['uniqueid']){delete _0x3287d6[_0x8eff('0x4a')][_0x8eff('0x4b')];}return db[_0x8eff('0x2d')][_0x8eff('0x4c')]({'where':{'uniqueid':_0x3287d6[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x4c7013,null))[_0x8eff('0x26')](saveUpdates(_0x3287d6[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x4c7013,null))[_0x8eff('0x44')](handleError(_0x4c7013,null));};exports[_0x8eff('0x4d')]=function(_0x452f7a,_0x47b28d,_0x13ae7c){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x452f7a[_0x8eff('0x46')]['id']},'attributes':[[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),'noAnswerContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),_0x8eff('0x53')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x54')))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),_0x8eff('0x57')],[db[_0x8eff('0x4e')]['fn']('COUNT',db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x8eff('0x58')],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x59')))),_0x8eff('0x5a')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal'](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x47b28d,null))[_0x8eff('0x26')](respondWithResult(_0x47b28d,null))[_0x8eff('0x44')](handleError(_0x47b28d,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x4064bd,_0x36afc3,_0x1813df){return db[_0x8eff('0x2d')][_0x8eff('0x42')]({'raw':![],'where':{'CampaignId':_0x4064bd[_0x8eff('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x200,\x201,\x20null'))),_0x8eff('0x5d')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x51')))),_0x8eff('0x5e')],[db['sequelize']['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db['sequelize'][_0x8eff('0x50')](_0x8eff('0x52')))),'busyContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db['sequelize']['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')]('`state`\x20=\x208,\x201,\x20null'))),_0x8eff('0x55')],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5f')))),_0x8eff('0x58')],[db[_0x8eff('0x4e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8eff('0x4e')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x8eff('0x4e')]['fn'](_0x8eff('0x4f'),db[_0x8eff('0x4e')]['fn']('IF',db[_0x8eff('0x4e')][_0x8eff('0x50')](_0x8eff('0x5b')))),_0x8eff('0x5c')]]})[_0x8eff('0x26')](handleEntityNotFound(_0x36afc3,null))['then'](respondWithResult(_0x36afc3,null))[_0x8eff('0x44')](handleError(_0x36afc3,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x42efc6,_0x35a221,_0x12ebd1){return db[_0x8eff('0x60')][_0x8eff('0x4c')]({'where':{'id':_0x42efc6[_0x8eff('0x46')]['id']}})['then'](handleEntityNotFound(_0x35a221,null))[_0x8eff('0x26')](function(_0x545fcf){var _0x1d8d8f;if(_0x545fcf){_0x1d8d8f=squel[_0x8eff('0x61')]()[_0x8eff('0x62')](_0x8eff('0x63'))[_0x8eff('0x64')]([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),'VoiceQueueId',_0x8eff('0x69'),_0x8eff('0x6a')],squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x6d'),_0x8eff('0x65'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x66'))[_0x8eff('0x6c')]('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)',_0x8eff('0x68'))[_0x8eff('0x6c')](_0x8eff('0x6f'),_0x8eff('0x70'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))['field'](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))['where'](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x42efc6[_0x8eff('0x4a')]['state']['toString']())['where'](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')](_0x8eff('0x65'))[_0x8eff('0x71')](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id']['toString']()))[_0x8eff('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x8eff('0x6b')]()[_0x8eff('0x6c')]('calleridnum')[_0x8eff('0x71')]('cm_hopper_final')[_0x8eff('0x3b')](_0x8eff('0x73'),_0x42efc6[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))[_0x8eff('0x78')](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')][_0x8eff('0x33')](_0x1d8d8f);}return[];})[_0x8eff('0x26')](respondWithResult(_0x35a221,null))[_0x8eff('0x44')](handleError(_0x35a221,null));};exports[_0x8eff('0x79')]=function(_0x23a771,_0x452b90,_0x43bbce){return db['Campaign'][_0x8eff('0x4c')]({'where':{'id':_0x23a771[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452b90,null))[_0x8eff('0x26')](function(_0x17f63b){var _0x582478;if(_0x17f63b){_0x582478=squel[_0x8eff('0x61')]()[_0x8eff('0x62')]('cm_hopper')['fromQuery']([_0x8eff('0x65'),_0x8eff('0x66'),_0x8eff('0x67'),_0x8eff('0x68'),_0x8eff('0x7a'),_0x8eff('0x69'),'updatedAt'],squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x6d'),_0x8eff('0x65'))['field'](_0x8eff('0x6e'),'scheduledAt')['field'](_0x8eff('0x7b'),'ContactId')[_0x8eff('0x6c')](_0x8eff('0x7c'),'ListId')[_0x8eff('0x6c')](_0x8eff('0x7d'),'CampaignId')[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x69'))[_0x8eff('0x6c')](_0x8eff('0x6e'),_0x8eff('0x6a'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771['params']['id']['toString']())[_0x8eff('0x3b')](_0x8eff('0x74'),_0x23a771[_0x8eff('0x4a')]['state'][_0x8eff('0x77')]())[_0x8eff('0x3b')](_0x8eff('0x75'))[_0x8eff('0x3b')](_0x8eff('0x76'),squel[_0x8eff('0x6b')]()['field'](_0x8eff('0x65'))['from'](_0x8eff('0x63'))[_0x8eff('0x3b')](_0x8eff('0x7e'),_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]()))[_0x8eff('0x3b')](_0x8eff('0x76'),squel['select']()[_0x8eff('0x6c')](_0x8eff('0x7f'))[_0x8eff('0x71')](_0x8eff('0x72'))[_0x8eff('0x3b')]('CampaignId\x20=\x20?',_0x23a771[_0x8eff('0x46')]['id'][_0x8eff('0x77')]())[_0x8eff('0x3b')]('state\x20=\x204'))['group'](_0x8eff('0x67')))[_0x8eff('0x77')]();return db[_0x8eff('0x4e')]['query'](_0x582478);}return[];})[_0x8eff('0x26')](respondWithResult(_0x452b90,null))['catch'](handleError(_0x452b90,null));};exports['checkContactHopper']=function(_0x10b9ac,_0x6bc93b,_0x10ade6){return db[_0x8eff('0x80')][_0x8eff('0x81')]({'where':{'VoiceQueueId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x70')],'CampaignId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x7a')],'ContactId':_0x10b9ac[_0x8eff('0x4a')][_0x8eff('0x67')]}})[_0x8eff('0x26')](handleEntityNotFound(_0x6bc93b,null))['then'](function(_0x34a0f7){if(_0x34a0f7){return _0x34a0f7;}return null;})[_0x8eff('0x26')](respondWithResult(_0x6bc93b,null))[_0x8eff('0x44')](handleError(_0x6bc93b,null));}; \ No newline at end of file +var _0xe3da=['COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x587288,_0x582bac){var _0x52319e=function(_0x103062){while(--_0x103062){_0x587288['push'](_0x587288['shift']());}};_0x52319e(++_0x582bac);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 29a32f7..9d9e33d 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 _0x3c56=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x2b990d,_0x1bb188){var _0x4594b4=function(_0x3a1806){while(--_0x3a1806){_0x2b990d['push'](_0x2b990d['shift']());}};_0x4594b4(++_0x1bb188);}(_0x3c56,0xfa));var _0x63c5=function(_0x2946a5,_0x336859){_0x2946a5=_0x2946a5-0x0;var _0x1c2088=_0x3c56[_0x2946a5];return _0x1c2088;};'use strict';var _=require(_0x63c5('0x0'));var util=require(_0x63c5('0x1'));var logger=require('../../config/logger')(_0x63c5('0x2'));var moment=require('moment');var BPromise=require(_0x63c5('0x3'));var rp=require(_0x63c5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x63c5('0x5'));var config=require(_0x63c5('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x63c5('0x7')]=function(_0x3c922e,_0x5a2975){return _0x3c922e[_0x63c5('0x8')]('CmHopperFinal',attributes,{'tableName':_0x63c5('0x9'),'paranoid':![],'indexes':[{'name':_0x63c5('0xa'),'fields':[_0x63c5('0xa')]},{'name':'uniqueid','fields':[_0x63c5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e81=['request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger'];(function(_0x4faf08,_0x3325bf){var _0x53e01f=function(_0x4d3f0c){while(--_0x4d3f0c){_0x4faf08['push'](_0x4faf08['shift']());}};_0x53e01f(++_0x3325bf);}(_0x7e81,0x82));var _0x17e8=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x7e81[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require('lodash');var util=require(_0x17e8('0x0'));var logger=require(_0x17e8('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x17e8('0x2'));var fs=require('fs');var path=require(_0x17e8('0x3'));var rimraf=require(_0x17e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x17e8('0x5'));module[_0x17e8('0x6')]=function(_0x8af11d,_0x2aacce){return _0x8af11d[_0x17e8('0x7')]('CmHopperFinal',attributes,{'tableName':_0x17e8('0x8'),'paranoid':![],'indexes':[{'name':_0x17e8('0x9'),'fields':[_0x17e8('0x9')]},{'name':_0x17e8('0xa'),'fields':[_0x17e8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 89f5af7..a2d2f01 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x23ab31,_0x5083df){var _0xac5cb4=function(_0x2685cc){while(--_0x2685cc){_0x23ab31['push'](_0x23ab31['shift']());}};_0xac5cb4(++_0x5083df);}(_0x7a54,0x106));var _0x47a5=function(_0x39c039,_0x261b2a){_0x39c039=_0x39c039-0x0;var _0x39e75a=_0x7a54[_0x39c039];return _0x39e75a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1d3d6f,_0x12ccf2){var _0x23d3a8=function(_0x56af08){while(--_0x56af08){_0x1d3d6f['push'](_0x1d3d6f['shift']());}};_0x23d3a8(++_0x12ccf2);}(_0x7a54,0x106));var _0x47a5=function(_0x4bab24,_0x286f84){_0x4bab24=_0x4bab24-0x0;var _0x2a8b57=_0x7a54[_0x4bab24];return _0x2a8b57;};'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 f7783d6..d2fb76e 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 _0x1981=['./cmHopperFinal.controller','get','isAuthenticated','index','describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3397fa,_0x5de37b){var _0x3cfde0=function(_0x226a4f){while(--_0x226a4f){_0x3397fa['push'](_0x3397fa['shift']());}};_0x3cfde0(++_0x5de37b);}(_0x1981,0xf3));var _0x1198=function(_0x30f272,_0x401f2d){_0x30f272=_0x30f272-0x0;var _0x1969ce=_0x1981[_0x30f272];return _0x1969ce;};'use strict';var multer=require(_0x1198('0x0'));var util=require('util');var path=require(_0x1198('0x1'));var timeout=require(_0x1198('0x2'));var express=require('express');var router=express[_0x1198('0x3')]();var fs_extra=require(_0x1198('0x4'));var auth=require(_0x1198('0x5'));var interaction=require(_0x1198('0x6'));var config=require('../../config/environment');var controller=require(_0x1198('0x7'));router[_0x1198('0x8')]('/',auth[_0x1198('0x9')](),controller[_0x1198('0xa')]);router[_0x1198('0x8')]('/describe',auth[_0x1198('0x9')](),controller[_0x1198('0xb')]);router[_0x1198('0x8')]('/:id',auth[_0x1198('0x9')](),controller[_0x1198('0xc')]);router['get'](_0x1198('0xd'),auth[_0x1198('0x9')](),controller[_0x1198('0xe')]);router[_0x1198('0x8')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1198('0xf')](_0x1198('0x10'),auth[_0x1198('0x9')](),controller[_0x1198('0x11')]);router[_0x1198('0xf')](_0x1198('0x12'),auth[_0x1198('0x9')](),controller[_0x1198('0x13')]);router[_0x1198('0xf')](_0x1198('0x14'),auth[_0x1198('0x9')](),controller[_0x1198('0x15')]);router[_0x1198('0x16')](_0x1198('0x17'),auth[_0x1198('0x9')](),controller['update']);module[_0x1198('0x18')]=router; \ No newline at end of file +var _0x2556=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','put','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','/describe','describe','get','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x32ab89,_0x550a23){var _0x112e4c=function(_0x5c6329){while(--_0x5c6329){_0x32ab89['push'](_0x32ab89['shift']());}};_0x112e4c(++_0x550a23);}(_0x2556,0x11c));var _0x6255=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x2556[_0x344a3f];return _0x264712;};'use strict';var multer=require(_0x6255('0x0'));var util=require(_0x6255('0x1'));var path=require(_0x6255('0x2'));var timeout=require('connect-timeout');var express=require(_0x6255('0x3'));var router=express[_0x6255('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6255('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6255('0x6'));var controller=require(_0x6255('0x7'));router['get']('/',auth[_0x6255('0x8')](),controller['index']);router['get'](_0x6255('0x9'),auth[_0x6255('0x8')](),controller[_0x6255('0xa')]);router[_0x6255('0xb')](_0x6255('0xc'),auth[_0x6255('0x8')](),controller[_0x6255('0xd')]);router[_0x6255('0xb')](_0x6255('0xe'),auth[_0x6255('0x8')](),controller[_0x6255('0xf')]);router['get'](_0x6255('0x10'),auth[_0x6255('0x8')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x6255('0x11')](_0x6255('0x12'),auth['isAuthenticated'](),controller[_0x6255('0x13')]);router[_0x6255('0x11')]('/voice/campaign/moveContacts/:id',auth[_0x6255('0x8')](),controller[_0x6255('0x14')]);router[_0x6255('0x11')]('/checkContactHopper',auth[_0x6255('0x8')](),controller['checkContactHopper']);router[_0x6255('0x15')](_0x6255('0xc'),auth[_0x6255('0x8')](),controller['update']);module[_0x6255('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index d030f27..f65541e 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 _0x77b4=['exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x3d835b,_0x250d33){var _0x30beb0=function(_0x10142d){while(--_0x10142d){_0x3d835b['push'](_0x3d835b['shift']());}};_0x30beb0(++_0x250d33);}(_0x77b4,0x1e0));var _0x477b=function(_0x484c14,_0xe235f0){_0x484c14=_0x484c14-0x0;var _0x5544cb=_0x77b4[_0x484c14];return _0x5544cb;};'use strict';var Sequelize=require('sequelize');module[_0x477b('0x0')]={'state':{'type':Sequelize[_0x477b('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x477b('0x2')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x477b('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x477b('0x3')]},'calleridname':{'type':Sequelize[_0x477b('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x477b('0x2')]},'endtime':{'type':Sequelize[_0x477b('0x2')]},'ringtime':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x477b('0x3')]},'campaign':{'type':Sequelize[_0x477b('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x477b('0x3')]},'reason':{'type':Sequelize[_0x477b('0x3')]},'amd':{'type':Sequelize[_0x477b('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x477b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x477b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x477b('0x2')]},'recallme':{'type':Sequelize[_0x477b('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x477b('0x2')]},'edited':{'type':Sequelize[_0x477b('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x477b('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x477b('0x3')]}}; \ No newline at end of file +var _0xfe89=['INTEGER','STRING','DATE','BOOLEAN','exports'];(function(_0x4aa809,_0x5ea720){var _0x2d46e4=function(_0xb70e00){while(--_0xb70e00){_0x4aa809['push'](_0x4aa809['shift']());}};_0x2d46e4(++_0x5ea720);}(_0xfe89,0x12b));var _0x9fe8=function(_0x349e5f,_0x4465dd){_0x349e5f=_0x349e5f-0x0;var _0x3aedbb=_0xfe89[_0x349e5f];return _0x3aedbb;};'use strict';var Sequelize=require('sequelize');module[_0x9fe8('0x0')]={'state':{'type':Sequelize[_0x9fe8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9fe8('0x2')]},'scheduledat':{'type':Sequelize[_0x9fe8('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9fe8('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9fe8('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9fe8('0x2')]},'calleridnum':{'type':Sequelize[_0x9fe8('0x2')]},'calleridname':{'type':Sequelize[_0x9fe8('0x2')]},'starttime':{'type':Sequelize[_0x9fe8('0x3')]},'responsetime':{'type':Sequelize[_0x9fe8('0x3')]},'answertime':{'type':Sequelize[_0x9fe8('0x3')]},'droptime':{'type':Sequelize[_0x9fe8('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9fe8('0x2')]},'campaign':{'type':Sequelize[_0x9fe8('0x2')]},'campaigntype':{'type':Sequelize[_0x9fe8('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x9fe8('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9fe8('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9fe8('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9fe8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9fe8('0x3')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9fe8('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9fe8('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9fe8('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index c13b64f..a81d31c 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 _0x98f7=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','CmHopperHistory','fieldName','type','query','keys','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','uniqueid','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2ee291,_0x2d9870){var _0x5bb294=function(_0x4c7090){while(--_0x4c7090){_0x2ee291['push'](_0x2ee291['shift']());}};_0x5bb294(++_0x2d9870);}(_0x98f7,0x172));var _0x798f=function(_0x352f42,_0x552e67){_0x352f42=_0x352f42-0x0;var _0x5d21c7=_0x98f7[_0x352f42];return _0x5d21c7;};'use strict';var emlformat=require(_0x798f('0x0'));var rimraf=require(_0x798f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x798f('0x2'));var rp=require(_0x798f('0x3'));var moment=require(_0x798f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x798f('0x5'));var util=require(_0x798f('0x6'));var path=require(_0x798f('0x7'));var sox=require(_0x798f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x798f('0x9'));var _=require('lodash');var squel=require(_0x798f('0xa'));var crypto=require('crypto');var jsforce=require(_0x798f('0xb'));var deskjs=require(_0x798f('0xc'));var toCsv=require(_0x798f('0xd'));var querystring=require(_0x798f('0xe'));var Papa=require(_0x798f('0xf'));var Redis=require('ioredis');var authService=require(_0x798f('0x10'));var qs=require(_0x798f('0x11'));var as=require(_0x798f('0x12'));var hardwareService=require(_0x798f('0x13'));var logger=require(_0x798f('0x14'))(_0x798f('0x15'));var utils=require(_0x798f('0x16'));var config=require(_0x798f('0x17'));var licenseUtil=require(_0x798f('0x18'));var db=require(_0x798f('0x19'))['db'];function respondWithStatusCode(_0x285e49,_0x16a043){_0x16a043=_0x16a043||0xcc;return function(_0x4bbe6e){if(_0x4bbe6e){return _0x285e49[_0x798f('0x1a')](_0x16a043);}return _0x285e49[_0x798f('0x1b')](_0x16a043)['end']();};}function respondWithResult(_0x4ee999,_0xbefab5){_0xbefab5=_0xbefab5||0xc8;return function(_0x2fb574){if(_0x2fb574){return _0x4ee999[_0x798f('0x1b')](_0xbefab5)[_0x798f('0x1c')](_0x2fb574);}};}function respondWithFilteredResult(_0x488f3c,_0x444eb0){return function(_0x376e7c){if(_0x376e7c){var _0x47def4=typeof _0x444eb0['offset']===_0x798f('0x1d')&&typeof _0x444eb0[_0x798f('0x1e')]===_0x798f('0x1d');var _0x2d3fed=_0x376e7c[_0x798f('0x1f')];var _0x2a6b92=_0x47def4?0x0:_0x444eb0[_0x798f('0x20')];var _0x11edb2=_0x47def4?_0x376e7c[_0x798f('0x1f')]:_0x444eb0[_0x798f('0x20')]+_0x444eb0[_0x798f('0x1e')];var _0x2d667d;if(_0x11edb2>=_0x2d3fed){_0x11edb2=_0x2d3fed;_0x2d667d=0xc8;}else{_0x2d667d=0xce;}_0x488f3c[_0x798f('0x1b')](_0x2d667d);return _0x488f3c[_0x798f('0x21')](_0x798f('0x22'),_0x2a6b92+'-'+_0x11edb2+'/'+_0x2d3fed)[_0x798f('0x1c')](_0x376e7c);}return null;};}function patchUpdates(_0x107e02){return function(_0x51a95d){try{jsonpatch[_0x798f('0x23')](_0x51a95d,_0x107e02,!![]);}catch(_0x10ae2a){return BPromise[_0x798f('0x24')](_0x10ae2a);}return _0x51a95d[_0x798f('0x25')]();};}function saveUpdates(_0x3f8868,_0x2fa96e){return function(_0x115b72){if(_0x115b72){return _0x115b72[_0x798f('0x26')](_0x3f8868)[_0x798f('0x27')](function(_0x32e967){return _0x32e967;});}return null;};}function removeEntity(_0x1180b2,_0x351606){return function(_0x38bd86){if(_0x38bd86){return _0x38bd86['destroy']()[_0x798f('0x27')](function(){_0x1180b2[_0x798f('0x1b')](0xcc)[_0x798f('0x28')]();});}};}function handleEntityNotFound(_0x486e6c,_0x48f51f){return function(_0x3d48f0){if(!_0x3d48f0){_0x486e6c['sendStatus'](0x194);}return _0x3d48f0;};}function handleError(_0x32cdd3,_0x262074){_0x262074=_0x262074||0x1f4;return function(_0x53f305){logger[_0x798f('0x29')](_0x53f305[_0x798f('0x2a')]);if(_0x53f305[_0x798f('0x2b')]){delete _0x53f305[_0x798f('0x2b')];}_0x32cdd3[_0x798f('0x1b')](_0x262074)[_0x798f('0x2c')](_0x53f305);};}exports[_0x798f('0x2d')]=function(_0xe547d0,_0xc3146a){var _0x319ce1={},_0x5a42e2={},_0x79a790={'count':0x0,'rows':[]};var _0x31dbf9=_[_0x798f('0x2e')](db[_0x798f('0x2f')]['rawAttributes'],function(_0x45d756){return{'name':_0x45d756[_0x798f('0x30')],'type':_0x45d756[_0x798f('0x31')]['key']};});_0x5a42e2['model']=_[_0x798f('0x2e')](_0x31dbf9,_0x798f('0x2b'));_0x5a42e2[_0x798f('0x32')]=_[_0x798f('0x33')](_0xe547d0[_0x798f('0x32')]);_0x5a42e2['filters']=_['intersection'](_0x5a42e2[_0x798f('0x34')],_0x5a42e2[_0x798f('0x32')]);_0x319ce1['attributes']=_[_0x798f('0x35')](_0x5a42e2[_0x798f('0x34')],qs[_0x798f('0x36')](_0xe547d0[_0x798f('0x32')][_0x798f('0x36')]));_0x319ce1['attributes']=_0x319ce1[_0x798f('0x37')][_0x798f('0x38')]?_0x319ce1[_0x798f('0x37')]:_0x5a42e2[_0x798f('0x34')];if(!_0xe547d0['query'][_0x798f('0x39')](_0x798f('0x3a'))){_0x319ce1[_0x798f('0x1e')]=qs['limit'](_0xe547d0[_0x798f('0x32')][_0x798f('0x1e')]);_0x319ce1[_0x798f('0x20')]=qs[_0x798f('0x20')](_0xe547d0['query'][_0x798f('0x20')]);}_0x319ce1['order']=qs[_0x798f('0x3b')](_0xe547d0[_0x798f('0x32')]['sort']);_0x319ce1[_0x798f('0x3c')]=qs[_0x798f('0x3d')](_[_0x798f('0x3e')](_0xe547d0[_0x798f('0x32')],_0x5a42e2[_0x798f('0x3d')]),_0x31dbf9);if(_0xe547d0[_0x798f('0x32')][_0x798f('0x3f')]){_0x319ce1[_0x798f('0x3c')]=_[_0x798f('0x40')](_0x319ce1[_0x798f('0x3c')],{'$or':_[_0x798f('0x2e')](_0x31dbf9,function(_0x12f48e){if(_0x12f48e[_0x798f('0x31')]!==_0x798f('0x41')){var _0x24e379={};_0x24e379[_0x12f48e[_0x798f('0x2b')]]={'$like':'%'+_0xe547d0['query'][_0x798f('0x3f')]+'%'};return _0x24e379;}})});}_0x319ce1=_[_0x798f('0x40')]({},_0x319ce1,_0xe547d0[_0x798f('0x42')]);var _0x12609f={'where':_0x319ce1[_0x798f('0x3c')]};return db[_0x798f('0x2f')][_0x798f('0x1f')](_0x12609f)[_0x798f('0x27')](function(_0x5c3e92){_0x79a790[_0x798f('0x1f')]=_0x5c3e92;if(_0xe547d0['query'][_0x798f('0x43')]){_0x319ce1[_0x798f('0x44')]=[{'all':!![]}];}return db[_0x798f('0x2f')][_0x798f('0x45')](_0x319ce1);})[_0x798f('0x27')](function(_0x4d1410){_0x79a790['rows']=_0x4d1410;return _0x79a790;})[_0x798f('0x27')](respondWithFilteredResult(_0xc3146a,_0x319ce1))[_0x798f('0x46')](handleError(_0xc3146a,null));};exports['show']=function(_0x53ef6d,_0x755923){var _0x582f87={'raw':!![],'where':{'id':_0x53ef6d[_0x798f('0x47')]['id']}},_0x3a0f00={};_0x3a0f00[_0x798f('0x34')]=_[_0x798f('0x33')](db[_0x798f('0x2f')][_0x798f('0x48')]);_0x3a0f00['query']=_[_0x798f('0x33')](_0x53ef6d[_0x798f('0x32')]);_0x3a0f00[_0x798f('0x3d')]=_[_0x798f('0x35')](_0x3a0f00['model'],_0x3a0f00[_0x798f('0x32')]);_0x582f87[_0x798f('0x37')]=_['intersection'](_0x3a0f00[_0x798f('0x34')],qs[_0x798f('0x36')](_0x53ef6d['query']['fields']));_0x582f87[_0x798f('0x37')]=_0x582f87['attributes']['length']?_0x582f87[_0x798f('0x37')]:_0x3a0f00[_0x798f('0x34')];if(_0x53ef6d[_0x798f('0x32')][_0x798f('0x43')]){_0x582f87[_0x798f('0x44')]=[{'all':!![]}];}_0x582f87=_[_0x798f('0x40')]({},_0x582f87,_0x53ef6d[_0x798f('0x42')]);return db['CmHopperHistory'][_0x798f('0x49')](_0x582f87)[_0x798f('0x27')](handleEntityNotFound(_0x755923,null))[_0x798f('0x27')](respondWithResult(_0x755923,null))[_0x798f('0x46')](handleError(_0x755923,null));};exports[_0x798f('0x4a')]=function(_0x1f7fb1,_0xe9b416){return db[_0x798f('0x2f')][_0x798f('0x4a')](_0x1f7fb1[_0x798f('0x4b')],{})['then'](respondWithResult(_0xe9b416,0xc9))[_0x798f('0x46')](handleError(_0xe9b416,null));};exports[_0x798f('0x4c')]=function(_0x422d76,_0x3bda47){return db['CmHopperHistory'][_0x798f('0x4c')]()['then'](respondWithResult(_0x3bda47,null))[_0x798f('0x46')](handleError(_0x3bda47,null));};exports[_0x798f('0x26')]=function(_0x30a2d6,_0x3a38bb){if(_0x30a2d6['body'][_0x798f('0x4d')]){delete _0x30a2d6['body'][_0x798f('0x4d')];}return db[_0x798f('0x2f')]['find']({'where':{'uniqueid':_0x30a2d6[_0x798f('0x47')]['id']}})[_0x798f('0x27')](handleEntityNotFound(_0x3a38bb,null))[_0x798f('0x27')](saveUpdates(_0x30a2d6[_0x798f('0x4b')],null))['then'](respondWithResult(_0x3a38bb,null))[_0x798f('0x46')](handleError(_0x3a38bb,null));}; \ No newline at end of file +var _0x49fa=['query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','where','merge','map','options','includeAll','include','rows','catch','show','params','length','find','create','describe','body','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','model'];(function(_0x19a028,_0x161bbc){var _0x2822b0=function(_0x3596e6){while(--_0x3596e6){_0x19a028['push'](_0x19a028['shift']());}};_0x2822b0(++_0x161bbc);}(_0x49fa,0xa8));var _0xa49f=function(_0x5d1c3f,_0x37e372){_0x5d1c3f=_0x5d1c3f-0x0;var _0x121577=_0x49fa[_0x5d1c3f];return _0x121577;};'use strict';var emlformat=require(_0xa49f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa49f('0x1'));var jsonpatch=require(_0xa49f('0x2'));var rp=require(_0xa49f('0x3'));var moment=require(_0xa49f('0x4'));var BPromise=require(_0xa49f('0x5'));var Mustache=require('mustache');var util=require(_0xa49f('0x6'));var path=require('path');var sox=require(_0xa49f('0x7'));var csv=require('to-csv');var ejs=require(_0xa49f('0x8'));var fs=require('fs');var fs_extra=require(_0xa49f('0x9'));var _=require(_0xa49f('0xa'));var squel=require('squel');var crypto=require(_0xa49f('0xb'));var jsforce=require(_0xa49f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa49f('0xd'));var querystring=require(_0xa49f('0xe'));var Papa=require(_0xa49f('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa49f('0x10'));var as=require(_0xa49f('0x11'));var hardwareService=require(_0xa49f('0x12'));var logger=require(_0xa49f('0x13'))('api');var utils=require(_0xa49f('0x14'));var config=require(_0xa49f('0x15'));var licenseUtil=require(_0xa49f('0x16'));var db=require(_0xa49f('0x17'))['db'];function respondWithStatusCode(_0x4ae35b,_0x24e1af){_0x24e1af=_0x24e1af||0xcc;return function(_0x3081df){if(_0x3081df){return _0x4ae35b[_0xa49f('0x18')](_0x24e1af);}return _0x4ae35b[_0xa49f('0x19')](_0x24e1af)[_0xa49f('0x1a')]();};}function respondWithResult(_0x5cec28,_0x1a74e8){_0x1a74e8=_0x1a74e8||0xc8;return function(_0xd8a54e){if(_0xd8a54e){return _0x5cec28[_0xa49f('0x19')](_0x1a74e8)[_0xa49f('0x1b')](_0xd8a54e);}};}function respondWithFilteredResult(_0x4fd2eb,_0x43e868){return function(_0x18bd01){if(_0x18bd01){var _0x34e257=typeof _0x43e868[_0xa49f('0x1c')]===_0xa49f('0x1d')&&typeof _0x43e868[_0xa49f('0x1e')]==='undefined';var _0x38f09f=_0x18bd01[_0xa49f('0x1f')];var _0x560871=_0x34e257?0x0:_0x43e868[_0xa49f('0x1c')];var _0x525cad=_0x34e257?_0x18bd01['count']:_0x43e868[_0xa49f('0x1c')]+_0x43e868['limit'];var _0x357e6c;if(_0x525cad>=_0x38f09f){_0x525cad=_0x38f09f;_0x357e6c=0xc8;}else{_0x357e6c=0xce;}_0x4fd2eb[_0xa49f('0x19')](_0x357e6c);return _0x4fd2eb[_0xa49f('0x20')](_0xa49f('0x21'),_0x560871+'-'+_0x525cad+'/'+_0x38f09f)[_0xa49f('0x1b')](_0x18bd01);}return null;};}function patchUpdates(_0x1a98b6){return function(_0x557e19){try{jsonpatch['apply'](_0x557e19,_0x1a98b6,!![]);}catch(_0x1148f4){return BPromise['reject'](_0x1148f4);}return _0x557e19[_0xa49f('0x22')]();};}function saveUpdates(_0x3d793b,_0x438abd){return function(_0x1c1eb1){if(_0x1c1eb1){return _0x1c1eb1[_0xa49f('0x23')](_0x3d793b)[_0xa49f('0x24')](function(_0x3391ab){return _0x3391ab;});}return null;};}function removeEntity(_0x59ad90,_0x1057ec){return function(_0x57ccd2){if(_0x57ccd2){return _0x57ccd2[_0xa49f('0x25')]()[_0xa49f('0x24')](function(){_0x59ad90[_0xa49f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f034,_0x4b755a){return function(_0x521f73){if(!_0x521f73){_0x33f034['sendStatus'](0x194);}return _0x521f73;};}function handleError(_0x4b100a,_0x1beb58){_0x1beb58=_0x1beb58||0x1f4;return function(_0x143418){logger[_0xa49f('0x26')](_0x143418[_0xa49f('0x27')]);if(_0x143418['name']){delete _0x143418[_0xa49f('0x28')];}_0x4b100a[_0xa49f('0x19')](_0x1beb58)[_0xa49f('0x29')](_0x143418);};}exports[_0xa49f('0x2a')]=function(_0x1f9d70,_0x2b4766){var _0x3a4f43={},_0x1eb214={},_0x5e0768={'count':0x0,'rows':[]};var _0x204d18=_['map'](db[_0xa49f('0x2b')][_0xa49f('0x2c')],function(_0x50876f){return{'name':_0x50876f[_0xa49f('0x2d')],'type':_0x50876f[_0xa49f('0x2e')]['key']};});_0x1eb214[_0xa49f('0x2f')]=_['map'](_0x204d18,'name');_0x1eb214[_0xa49f('0x30')]=_['keys'](_0x1f9d70[_0xa49f('0x30')]);_0x1eb214['filters']=_[_0xa49f('0x31')](_0x1eb214[_0xa49f('0x2f')],_0x1eb214['query']);_0x3a4f43[_0xa49f('0x32')]=_[_0xa49f('0x31')](_0x1eb214[_0xa49f('0x2f')],qs[_0xa49f('0x33')](_0x1f9d70[_0xa49f('0x30')]['fields']));_0x3a4f43[_0xa49f('0x32')]=_0x3a4f43[_0xa49f('0x32')]['length']?_0x3a4f43[_0xa49f('0x32')]:_0x1eb214['model'];if(!_0x1f9d70[_0xa49f('0x30')][_0xa49f('0x34')](_0xa49f('0x35'))){_0x3a4f43['limit']=qs[_0xa49f('0x1e')](_0x1f9d70[_0xa49f('0x30')][_0xa49f('0x1e')]);_0x3a4f43[_0xa49f('0x1c')]=qs[_0xa49f('0x1c')](_0x1f9d70[_0xa49f('0x30')][_0xa49f('0x1c')]);}_0x3a4f43['order']=qs[_0xa49f('0x36')](_0x1f9d70[_0xa49f('0x30')][_0xa49f('0x36')]);_0x3a4f43['where']=qs[_0xa49f('0x37')](_['pick'](_0x1f9d70[_0xa49f('0x30')],_0x1eb214[_0xa49f('0x37')]),_0x204d18);if(_0x1f9d70[_0xa49f('0x30')]['filter']){_0x3a4f43[_0xa49f('0x38')]=_[_0xa49f('0x39')](_0x3a4f43['where'],{'$or':_[_0xa49f('0x3a')](_0x204d18,function(_0x19d209){if(_0x19d209[_0xa49f('0x2e')]!=='VIRTUAL'){var _0x5e2b53={};_0x5e2b53[_0x19d209[_0xa49f('0x28')]]={'$like':'%'+_0x1f9d70[_0xa49f('0x30')]['filter']+'%'};return _0x5e2b53;}})});}_0x3a4f43=_['merge']({},_0x3a4f43,_0x1f9d70[_0xa49f('0x3b')]);var _0x51cf80={'where':_0x3a4f43[_0xa49f('0x38')]};return db['CmHopperHistory'][_0xa49f('0x1f')](_0x51cf80)['then'](function(_0x46f268){_0x5e0768[_0xa49f('0x1f')]=_0x46f268;if(_0x1f9d70[_0xa49f('0x30')][_0xa49f('0x3c')]){_0x3a4f43[_0xa49f('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3a4f43);})['then'](function(_0x5ac0b4){_0x5e0768[_0xa49f('0x3e')]=_0x5ac0b4;return _0x5e0768;})[_0xa49f('0x24')](respondWithFilteredResult(_0x2b4766,_0x3a4f43))[_0xa49f('0x3f')](handleError(_0x2b4766,null));};exports[_0xa49f('0x40')]=function(_0x3bdf9f,_0x5e16cf){var _0x2445b7={'raw':!![],'where':{'id':_0x3bdf9f[_0xa49f('0x41')]['id']}},_0x1e7f4e={};_0x1e7f4e[_0xa49f('0x2f')]=_['keys'](db[_0xa49f('0x2b')][_0xa49f('0x2c')]);_0x1e7f4e[_0xa49f('0x30')]=_['keys'](_0x3bdf9f[_0xa49f('0x30')]);_0x1e7f4e[_0xa49f('0x37')]=_[_0xa49f('0x31')](_0x1e7f4e[_0xa49f('0x2f')],_0x1e7f4e[_0xa49f('0x30')]);_0x2445b7[_0xa49f('0x32')]=_[_0xa49f('0x31')](_0x1e7f4e[_0xa49f('0x2f')],qs[_0xa49f('0x33')](_0x3bdf9f[_0xa49f('0x30')]['fields']));_0x2445b7[_0xa49f('0x32')]=_0x2445b7[_0xa49f('0x32')][_0xa49f('0x42')]?_0x2445b7[_0xa49f('0x32')]:_0x1e7f4e[_0xa49f('0x2f')];if(_0x3bdf9f[_0xa49f('0x30')][_0xa49f('0x3c')]){_0x2445b7[_0xa49f('0x3d')]=[{'all':!![]}];}_0x2445b7=_[_0xa49f('0x39')]({},_0x2445b7,_0x3bdf9f[_0xa49f('0x3b')]);return db['CmHopperHistory'][_0xa49f('0x43')](_0x2445b7)[_0xa49f('0x24')](handleEntityNotFound(_0x5e16cf,null))['then'](respondWithResult(_0x5e16cf,null))[_0xa49f('0x3f')](handleError(_0x5e16cf,null));};exports[_0xa49f('0x44')]=function(_0x51ae51,_0x4840e2){return db[_0xa49f('0x2b')]['create'](_0x51ae51['body'],{})[_0xa49f('0x24')](respondWithResult(_0x4840e2,0xc9))[_0xa49f('0x3f')](handleError(_0x4840e2,null));};exports[_0xa49f('0x45')]=function(_0x2e4a36,_0x32e3d6){return db[_0xa49f('0x2b')][_0xa49f('0x45')]()[_0xa49f('0x24')](respondWithResult(_0x32e3d6,null))['catch'](handleError(_0x32e3d6,null));};exports[_0xa49f('0x23')]=function(_0x2564d2,_0x3d7636){if(_0x2564d2[_0xa49f('0x46')][_0xa49f('0x47')]){delete _0x2564d2['body'][_0xa49f('0x47')];}return db['CmHopperHistory'][_0xa49f('0x43')]({'where':{'uniqueid':_0x2564d2[_0xa49f('0x41')]['id']}})[_0xa49f('0x24')](handleEntityNotFound(_0x3d7636,null))[_0xa49f('0x24')](saveUpdates(_0x2564d2[_0xa49f('0x46')],null))[_0xa49f('0x24')](respondWithResult(_0x3d7636,null))[_0xa49f('0x3f')](handleError(_0x3d7636,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 3a11e89..41e51a3 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 _0x1a38=['../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x1a38,0xb0));var _0x81a3=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x1a38[_0x43a1b8];return _0x324ecc;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var logger=require(_0x81a3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81a3('0x3'));var fs=require('fs');var path=require(_0x81a3('0x4'));var rimraf=require(_0x81a3('0x5'));var config=require(_0x81a3('0x6'));var attributes=require(_0x81a3('0x7'));module[_0x81a3('0x8')]=function(_0x2f0a07,_0x189c2b){return _0x2f0a07[_0x81a3('0x9')](_0x81a3('0xa'),attributes,{'tableName':_0x81a3('0xb'),'paranoid':![],'indexes':[{'name':_0x81a3('0xc'),'fields':[_0x81a3('0xc')]},{'name':'uniqueid','fields':[_0x81a3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf6e=['../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','uniqueid','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x274931,_0x2348d4){var _0x256d2e=function(_0x1ef6a4){while(--_0x1ef6a4){_0x274931['push'](_0x274931['shift']());}};_0x256d2e(++_0x2348d4);}(_0xaf6e,0x16e));var _0xeaf6=function(_0x479ada,_0x171a31){_0x479ada=_0x479ada-0x0;var _0x1cc66e=_0xaf6e[_0x479ada];return _0x1cc66e;};'use strict';var _=require(_0xeaf6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeaf6('0x1'));var moment=require(_0xeaf6('0x2'));var BPromise=require(_0xeaf6('0x3'));var rp=require(_0xeaf6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaf6('0x5'));var config=require(_0xeaf6('0x6'));var attributes=require(_0xeaf6('0x7'));module[_0xeaf6('0x8')]=function(_0x284ffc,_0x4c8814){return _0x284ffc['define']('CmHopperHistory',attributes,{'tableName':_0xeaf6('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xeaf6('0xa')]},{'name':'uniqueid','fields':[_0xeaf6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2a88902..b74fd15 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 _0x9c54=['findAll','where','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','debug','request\x20sent','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','sequelize','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','COUNT','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory'];(function(_0x39b82a,_0x289a99){var _0x27e85c=function(_0xfa764f){while(--_0xfa764f){_0x39b82a['push'](_0x39b82a['shift']());}};_0x27e85c(++_0x289a99);}(_0x9c54,0x120));var _0x49c5=function(_0x4ab9d3,_0x25b632){_0x4ab9d3=_0x4ab9d3-0x0;var _0x1d32d3=_0x9c54[_0x4ab9d3];return _0x1d32d3;};'use strict';var _=require(_0x49c5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49c5('0x1'));var db=require(_0x49c5('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x49c5('0x3'))(_0x49c5('0x4'));var config=require(_0x49c5('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x49c5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x12795e,_0xdb4e83,_0x1072c5){return new BPromise(function(_0x2491e6,_0x2f24e2){return client['request'](_0x12795e,_0x1072c5)[_0x49c5('0x7')](function(_0x301dae){logger[_0x49c5('0x8')]('CmHopperHistory,\x20%s,\x20%s',_0xdb4e83,'request\x20sent');logger[_0x49c5('0x9')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xdb4e83,_0x49c5('0xa'),JSON[_0x49c5('0xb')](_0x301dae));if(_0x301dae[_0x49c5('0xc')]){if(_0x301dae[_0x49c5('0xc')]['code']===0x1f4){logger[_0x49c5('0xc')](_0x49c5('0xd'),_0xdb4e83,_0x301dae['error'][_0x49c5('0xe')]);return _0x2f24e2(_0x301dae[_0x49c5('0xc')]['message']);}logger[_0x49c5('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0xdb4e83,_0x301dae[_0x49c5('0xc')][_0x49c5('0xe')]);return _0x2491e6(_0x301dae[_0x49c5('0xc')][_0x49c5('0xe')]);}else{logger['info'](_0x49c5('0xd'),_0xdb4e83,_0x49c5('0xa'));_0x2491e6(_0x301dae[_0x49c5('0xf')]['message']);}})[_0x49c5('0x10')](function(_0x148d20){logger['error'](_0x49c5('0xd'),_0xdb4e83,_0x148d20);_0x2f24e2(_0x148d20);});});}exports[_0x49c5('0x11')]=function(_0x43f568){var _0x17b6e4=this;return new Promise(function(_0x1700b0,_0x5da013){return db[_0x49c5('0x12')][_0x49c5('0x13')](_0x43f568[_0x49c5('0x14')],{'raw':_0x43f568['options']?_0x43f568[_0x49c5('0x15')][_0x49c5('0x16')]===undefined?!![]:![]:!![]})[_0x49c5('0x7')](function(_0x2add64){logger['info']('CreateCmHopperHistory',_0x43f568);logger[_0x49c5('0x9')](_0x49c5('0x11'),_0x43f568,JSON[_0x49c5('0xb')](_0x2add64));_0x1700b0(_0x2add64);})[_0x49c5('0x10')](function(_0x293c95){logger[_0x49c5('0xc')](_0x49c5('0x11'),_0x293c95[_0x49c5('0xe')],_0x43f568);_0x5da013(_0x17b6e4['error'](0x1f4,_0x293c95[_0x49c5('0xe')]));});});};exports['AvgHandleTime']=function(_0x37d70c){var _0x90e2d=this;return new Promise(function(_0x5bad98,_0x10eca7){return db[_0x49c5('0x12')]['findAll']({'raw':_0x37d70c[_0x49c5('0x15')]?_0x37d70c[_0x49c5('0x15')][_0x49c5('0x16')]===undefined?!![]:![]:!![],'where':_0x37d70c['options']?_0x37d70c[_0x49c5('0x15')]['where']||null:null,'attributes':[[db[_0x49c5('0x17')]['fn']('COUNT',db[_0x49c5('0x17')][_0x49c5('0x18')]('id')),_0x49c5('0x19')],[db[_0x49c5('0x17')]['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x49c5('0x1a')],[db[_0x49c5('0x17')]['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x1c')))),_0x49c5('0x1d')],[db['sequelize']['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db['sequelize'][_0x49c5('0x1b')](_0x49c5('0x1f')))),_0x49c5('0x20')],[db[_0x49c5('0x17')]['fn']('AVG',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x21'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x22')))),'predictiveIntervalAvgTalktime']]})[_0x49c5('0x7')](function(_0x5ebebe){logger[_0x49c5('0x8')](_0x49c5('0x23'),_0x37d70c);logger[_0x49c5('0x9')](_0x49c5('0x23'),_0x37d70c,JSON[_0x49c5('0xb')](_0x5ebebe));_0x5bad98(_0x5ebebe);})[_0x49c5('0x10')](function(_0x4bdbe5){logger[_0x49c5('0xc')]('AvgHandleTime',_0x4bdbe5['message'],_0x37d70c);_0x10eca7(_0x90e2d['error'](0x1f4,_0x4bdbe5[_0x49c5('0xe')]));});});};exports[_0x49c5('0x24')]=function(_0x46657b){var _0x59b2fe=this;return new Promise(function(_0x593ba6,_0x20d79f){return db[_0x49c5('0x12')][_0x49c5('0x25')]({'raw':_0x46657b['options']?_0x46657b['options']['raw']===undefined?!![]:![]:!![],'where':_0x46657b[_0x49c5('0x15')]?_0x46657b['options'][_0x49c5('0x26')]||null:null,'attributes':[['campaign',_0x49c5('0x27')],[db['sequelize']['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db['sequelize'][_0x49c5('0x1b')](_0x49c5('0x28')))),_0x49c5('0x29')],[db['sequelize']['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal'](_0x49c5('0x2a')))),_0x49c5('0x2b')],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x2c')))),_0x49c5('0x2d')],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x2e')))),_0x49c5('0x2f')],[db['sequelize']['fn'](_0x49c5('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x49c5('0x1b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x49c5('0x30')],[db[_0x49c5('0x17')]['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x31')))),_0x49c5('0x32')],[db[_0x49c5('0x17')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x33')))),'outboundUnknownCallsDay'],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')]('`state`\x20=\x2013,\x201,\x20null'))),_0x49c5('0x34')],[db['sequelize']['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x35')))),_0x49c5('0x36')],[db[_0x49c5('0x17')]['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal'](_0x49c5('0x37')))),_0x49c5('0x38')],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')][_0x49c5('0x1b')](_0x49c5('0x39')))),_0x49c5('0x3a')],[db[_0x49c5('0x17')]['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x49c5('0x38')],[db['sequelize']['fn'](_0x49c5('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x49c5('0x1b')](_0x49c5('0x3b')))),_0x49c5('0x3c')]],'group':['campaign']})[_0x49c5('0x7')](function(_0x5d0cb9){logger[_0x49c5('0x8')](_0x49c5('0x24'),_0x46657b);logger[_0x49c5('0x9')](_0x49c5('0x24'),_0x46657b,JSON[_0x49c5('0xb')](_0x5d0cb9));_0x593ba6(_0x5d0cb9);})['catch'](function(_0x49b610){logger[_0x49c5('0xc')](_0x49c5('0x24'),_0x49b610[_0x49c5('0xe')],_0x46657b);_0x20d79f(_0x59b2fe[_0x49c5('0xc')](0x1f4,_0x49b610[_0x49c5('0xe')]));});});};exports[_0x49c5('0x3d')]=function(_0x2147fa){var _0x24f95f=this;return new Promise(function(_0x1e3ec9,_0x174e1c){return db['CmHopperHistory'][_0x49c5('0x25')]({'raw':_0x2147fa['options']?_0x2147fa['options'][_0x49c5('0x16')]===undefined?!![]:![]:!![],'where':_0x2147fa[_0x49c5('0x15')]?_0x2147fa[_0x49c5('0x15')][_0x49c5('0x26')]||null:null,'attributes':[[_0x49c5('0x3e'),_0x49c5('0x27')],[db['sequelize']['fn'](_0x49c5('0x1e'),db[_0x49c5('0x17')][_0x49c5('0x18')]('id')),_0x49c5('0x3f')],[db['sequelize']['fn']('COUNT',db[_0x49c5('0x17')]['fn']('IF',db[_0x49c5('0x17')]['literal'](_0x49c5('0x2c')))),_0x49c5('0x40')]],'group':['campaign']})[_0x49c5('0x7')](function(_0x3f50a3){logger[_0x49c5('0x8')]('GetCampaignHopperHistory',_0x2147fa);logger['debug'](_0x49c5('0x3d'),_0x2147fa,JSON[_0x49c5('0xb')](_0x3f50a3));_0x1e3ec9(_0x3f50a3);})[_0x49c5('0x10')](function(_0x4ff149){logger[_0x49c5('0xc')](_0x49c5('0x3d'),_0x4ff149['message'],_0x2147fa);_0x174e1c(_0x24f95f[_0x49c5('0xc')](0x1f4,_0x4ff149[_0x49c5('0xe')]));});});}; \ No newline at end of file +var _0x1109=['name','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','where','col','ivrAnswerCallsDay','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','COUNT','sequelize','literal','predictiveIntervalAnsweredCalls','`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','catch','GetVoiceQueueHopperHistory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1109,0x17d));var _0x9110=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0x1109[_0xe0c564];return _0x32e0f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9110('0x0'));var BPromise=require('bluebird');var rs=require(_0x9110('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9110('0x2'))['db'];var utils=require(_0x9110('0x3'));var logger=require(_0x9110('0x4'))(_0x9110('0x5'));var config=require(_0x9110('0x6'));var jayson=require(_0x9110('0x7'));var client=jayson[_0x9110('0x8')][_0x9110('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35a4a8,_0x4a15c6,_0x5c125b){return new BPromise(function(_0x4d18a6,_0x3d40a9){return client[_0x9110('0xa')](_0x35a4a8,_0x5c125b)[_0x9110('0xb')](function(_0x4e7252){logger[_0x9110('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,'request\x20sent');logger[_0x9110('0xd')](_0x9110('0xe'),_0x4a15c6,_0x9110('0xf'),JSON[_0x9110('0x10')](_0x4e7252));if(_0x4e7252[_0x9110('0x11')]){if(_0x4e7252[_0x9110('0x11')][_0x9110('0x12')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x4e7252[_0x9110('0x11')]['message']);return _0x3d40a9(_0x4e7252['error'][_0x9110('0x13')]);}logger[_0x9110('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x4e7252[_0x9110('0x11')]['message']);return _0x4d18a6(_0x4e7252[_0x9110('0x11')][_0x9110('0x13')]);}else{logger[_0x9110('0xc')](_0x9110('0x14'),_0x4a15c6,_0x9110('0xf'));_0x4d18a6(_0x4e7252[_0x9110('0x15')]['message']);}})['catch'](function(_0x3bffeb){logger[_0x9110('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4a15c6,_0x3bffeb);_0x3d40a9(_0x3bffeb);});});}exports[_0x9110('0x16')]=function(_0x11dec4){var _0x1bcaf2=this;return new Promise(function(_0x3d21e5,_0x2d75d6){return db[_0x9110('0x17')][_0x9110('0x18')](_0x11dec4[_0x9110('0x19')],{'raw':_0x11dec4[_0x9110('0x1a')]?_0x11dec4[_0x9110('0x1a')][_0x9110('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3563c5){logger[_0x9110('0xc')](_0x9110('0x16'),_0x11dec4);logger[_0x9110('0xd')]('CreateCmHopperHistory',_0x11dec4,JSON[_0x9110('0x10')](_0x3563c5));_0x3d21e5(_0x3563c5);})['catch'](function(_0x5a17b0){logger[_0x9110('0x11')](_0x9110('0x16'),_0x5a17b0[_0x9110('0x13')],_0x11dec4);_0x2d75d6(_0x1bcaf2[_0x9110('0x11')](0x1f4,_0x5a17b0[_0x9110('0x13')]));});});};exports[_0x9110('0x1c')]=function(_0x34903c){var _0x2a6f17=this;return new Promise(function(_0x10759b,_0x5aa7a1){return db[_0x9110('0x17')][_0x9110('0x1d')]({'raw':_0x34903c['options']?_0x34903c[_0x9110('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x34903c[_0x9110('0x1a')]?_0x34903c[_0x9110('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x9110('0x1e'),db['sequelize']['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0x9110('0x21')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x22')))),_0x9110('0x23')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x24')))),_0x9110('0x25')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x26'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x27')))),_0x9110('0x28')],[db[_0x9110('0x1f')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x29')))),_0x9110('0x2a')]]})[_0x9110('0xb')](function(_0x34d085){logger[_0x9110('0xc')](_0x9110('0x1c'),_0x34903c);logger[_0x9110('0xd')](_0x9110('0x1c'),_0x34903c,JSON[_0x9110('0x10')](_0x34d085));_0x10759b(_0x34d085);})[_0x9110('0x2b')](function(_0x20e8b2){logger['error'](_0x9110('0x1c'),_0x20e8b2['message'],_0x34903c);_0x5aa7a1(_0x2a6f17[_0x9110('0x11')](0x1f4,_0x20e8b2[_0x9110('0x13')]));});});};exports[_0x9110('0x2c')]=function(_0x3b582c){var _0x4579ce=this;return new Promise(function(_0x240eac,_0x411d29){return db[_0x9110('0x17')][_0x9110('0x1d')]({'raw':_0x3b582c[_0x9110('0x1a')]?_0x3b582c[_0x9110('0x1a')][_0x9110('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b582c[_0x9110('0x1a')]?_0x3b582c['options']['where']||null:null,'attributes':[['campaign',_0x9110('0x2d')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x2e')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x2f')))),_0x9110('0x30')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x31')))),_0x9110('0x32')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x33')))),_0x9110('0x34')],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x35')))),_0x9110('0x36')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9110('0x37')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0x9110('0x38')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x39')))),_0x9110('0x3a')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x3b')))),_0x9110('0x3c')],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x9110('0x1f')]['fn']('COUNT',db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x3d')))),'outboundAnswerAgiCallsDay'],[db[_0x9110('0x1f')]['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db[_0x9110('0x1f')]['literal'](_0x9110('0x3e')))),_0x9110('0x3f')],[db['sequelize']['fn'](_0x9110('0x1e'),db['sequelize']['fn']('IF',db[_0x9110('0x1f')][_0x9110('0x20')](_0x9110('0x40')))),_0x9110('0x41')]],'group':[_0x9110('0x42')]})[_0x9110('0xb')](function(_0x48d4df){logger['info'](_0x9110('0x2c'),_0x3b582c);logger['debug'](_0x9110('0x2c'),_0x3b582c,JSON['stringify'](_0x48d4df));_0x240eac(_0x48d4df);})['catch'](function(_0x25d800){logger[_0x9110('0x11')]('GetVoiceQueueHopperHistory',_0x25d800[_0x9110('0x13')],_0x3b582c);_0x411d29(_0x4579ce[_0x9110('0x11')](0x1f4,_0x25d800[_0x9110('0x13')]));});});};exports[_0x9110('0x43')]=function(_0x214b83){var _0x107130=this;return new Promise(function(_0x4bae4c,_0x43f009){return db['CmHopperHistory'][_0x9110('0x1d')]({'raw':_0x214b83['options']?_0x214b83[_0x9110('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x214b83['options']?_0x214b83[_0x9110('0x1a')][_0x9110('0x44')]||null:null,'attributes':[[_0x9110('0x42'),_0x9110('0x2d')],[db['sequelize']['fn']('COUNT',db[_0x9110('0x1f')][_0x9110('0x45')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x9110('0x1e'),db[_0x9110('0x1f')]['fn']('IF',db['sequelize'][_0x9110('0x20')](_0x9110('0x2f')))),_0x9110('0x46')]],'group':['campaign']})[_0x9110('0xb')](function(_0x5a0def){logger[_0x9110('0xc')](_0x9110('0x43'),_0x214b83);logger[_0x9110('0xd')](_0x9110('0x43'),_0x214b83,JSON[_0x9110('0x10')](_0x5a0def));_0x4bae4c(_0x5a0def);})['catch'](function(_0xa27acf){logger['error']('GetCampaignHopperHistory',_0xa27acf[_0x9110('0x13')],_0x214b83);_0x43f009(_0x107130[_0x9110('0x11')](0x1f4,_0xa27acf['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 015be18..c47fc89 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 _0x870a=['isAuthenticated','/describe','describe','/:id','show','post','create','put','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x870a,0x126));var _0xa870=function(_0x4ee61d,_0x10bda2){_0x4ee61d=_0x4ee61d-0x0;var _0x3dc178=_0x870a[_0x4ee61d];return _0x3dc178;};'use strict';var multer=require('multer');var util=require(_0xa870('0x0'));var path=require(_0xa870('0x1'));var timeout=require(_0xa870('0x2'));var express=require(_0xa870('0x3'));var router=express[_0xa870('0x4')]();var fs_extra=require(_0xa870('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa870('0x6'));var config=require(_0xa870('0x7'));var controller=require(_0xa870('0x8'));router[_0xa870('0x9')]('/',auth[_0xa870('0xa')](),controller['index']);router[_0xa870('0x9')](_0xa870('0xb'),auth['isAuthenticated'](),controller[_0xa870('0xc')]);router[_0xa870('0x9')](_0xa870('0xd'),auth[_0xa870('0xa')](),controller[_0xa870('0xe')]);router[_0xa870('0xf')]('/',auth['isAuthenticated'](),controller[_0xa870('0x10')]);router[_0xa870('0x11')]('/:id',auth[_0xa870('0xa')](),controller['update']);module[_0xa870('0x12')]=router; \ No newline at end of file +var _0x9b1e=['/describe','isAuthenticated','describe','/:id','post','create','put','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmHopperHistory.controller','get','index'];(function(_0x1279f7,_0x4356d6){var _0x59e628=function(_0x42bd4b){while(--_0x42bd4b){_0x1279f7['push'](_0x1279f7['shift']());}};_0x59e628(++_0x4356d6);}(_0x9b1e,0x14a));var _0xe9b1=function(_0x14138a,_0xbc1dd5){_0x14138a=_0x14138a-0x0;var _0x362344=_0x9b1e[_0x14138a];return _0x362344;};'use strict';var multer=require('multer');var util=require(_0xe9b1('0x0'));var path=require(_0xe9b1('0x1'));var timeout=require(_0xe9b1('0x2'));var express=require(_0xe9b1('0x3'));var router=express[_0xe9b1('0x4')]();var fs_extra=require(_0xe9b1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe9b1('0x6'));var controller=require(_0xe9b1('0x7'));router[_0xe9b1('0x8')]('/',auth['isAuthenticated'](),controller[_0xe9b1('0x9')]);router[_0xe9b1('0x8')](_0xe9b1('0xa'),auth[_0xe9b1('0xb')](),controller[_0xe9b1('0xc')]);router['get'](_0xe9b1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe9b1('0xe')]('/',auth[_0xe9b1('0xb')](),controller[_0xe9b1('0xf')]);router[_0xe9b1('0x10')](_0xe9b1('0xd'),auth[_0xe9b1('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b52a6fe..53d8a30 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 _0x740a=['name','sequelize','exports','STRING'];(function(_0x508786,_0x26e090){var _0x2c9780=function(_0x29c8c0){while(--_0x29c8c0){_0x508786['push'](_0x508786['shift']());}};_0x2c9780(++_0x26e090);}(_0x740a,0x175));var _0xa740=function(_0x2b4065,_0x4f9afe){_0x2b4065=_0x2b4065-0x0;var _0x2e7a4b=_0x740a[_0x2b4065];return _0x2e7a4b;};'use strict';var Sequelize=require(_0xa740('0x0'));module[_0xa740('0x1')]={'name':{'type':Sequelize[_0xa740('0x2')],'unique':_0xa740('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa740('0x2')]},'dialPrefix':{'type':Sequelize[_0xa740('0x2')]}}; \ No newline at end of file +var _0x0d4d=['STRING','name','sequelize','exports'];(function(_0x2003a4,_0x2b6412){var _0x1d3631=function(_0x50226e){while(--_0x50226e){_0x2003a4['push'](_0x2003a4['shift']());}};_0x1d3631(++_0x2b6412);}(_0x0d4d,0x132));var _0xd0d4=function(_0x408c99,_0x3dd521){_0x408c99=_0x408c99-0x0;var _0x11d7ac=_0x0d4d[_0x408c99];return _0x11d7ac;};'use strict';var Sequelize=require(_0xd0d4('0x0'));module[_0xd0d4('0x1')]={'name':{'type':Sequelize[_0xd0d4('0x2')],'unique':_0xd0d4('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd0d4('0x2')]},'dialPrefix':{'type':Sequelize[_0xd0d4('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 4295e5f..f328121 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 _0x56c6=['moment','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','Lists','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','describe','tags','join','isArray','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','toString','writeFileSync','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','zip-dir','fast-json-patch'];(function(_0x5137fe,_0x3b15e8){var _0x3eb62a=function(_0x60a68){while(--_0x60a68){_0x5137fe['push'](_0x5137fe['shift']());}};_0x3eb62a(++_0x3b15e8);}(_0x56c6,0x140));var _0x656c=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x56c6[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x656c('0x0'));var jsonpatch=require(_0x656c('0x1'));var rp=require('request-promise');var moment=require(_0x656c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x656c('0x3'));var path=require(_0x656c('0x4'));var sox=require('sox');var csv=require(_0x656c('0x5'));var ejs=require(_0x656c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x656c('0x7'));var crypto=require(_0x656c('0x8'));var jsforce=require(_0x656c('0x9'));var deskjs=require(_0x656c('0xa'));var toCsv=require(_0x656c('0x5'));var querystring=require(_0x656c('0xb'));var Papa=require(_0x656c('0xc'));var Redis=require(_0x656c('0xd'));var authService=require(_0x656c('0xe'));var qs=require(_0x656c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656c('0x10'));var logger=require(_0x656c('0x11'))(_0x656c('0x12'));var utils=require(_0x656c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x656c('0x14'));var db=require('../../mysqldb')['db'];var csv_results;config[_0x656c('0x15')]=_['defaults'](config[_0x656c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x656c('0x16'))(new Redis(config[_0x656c('0x15')]));require(_0x656c('0x17'))[_0x656c('0x18')](socket);function respondWithStatusCode(_0xb10a54,_0x5b9abc){_0x5b9abc=_0x5b9abc||0xcc;return function(_0x3bc9ec){if(_0x3bc9ec){return _0xb10a54[_0x656c('0x19')](_0x5b9abc);}return _0xb10a54[_0x656c('0x1a')](_0x5b9abc)['end']();};}function respondWithResult(_0xa1ff44,_0x5c4598){_0x5c4598=_0x5c4598||0xc8;return function(_0x3c9b00){if(_0x3c9b00){return _0xa1ff44[_0x656c('0x1a')](_0x5c4598)[_0x656c('0x1b')](_0x3c9b00);}};}function respondWithFilteredResult(_0x546aab,_0x5c35ad){return function(_0x496892){if(_0x496892){var _0x4172b1=typeof _0x5c35ad[_0x656c('0x1c')]===_0x656c('0x1d')&&typeof _0x5c35ad[_0x656c('0x1e')]===_0x656c('0x1d');var _0x3ee110=_0x496892[_0x656c('0x1f')];var _0xb7bceb=_0x4172b1?0x0:_0x5c35ad[_0x656c('0x1c')];var _0x3d7f5f=_0x4172b1?_0x496892[_0x656c('0x1f')]:_0x5c35ad[_0x656c('0x1c')]+_0x5c35ad[_0x656c('0x1e')];var _0xdcd511;if(_0x3d7f5f>=_0x3ee110){_0x3d7f5f=_0x3ee110;_0xdcd511=0xc8;}else{_0xdcd511=0xce;}_0x546aab['status'](_0xdcd511);return _0x546aab['set'](_0x656c('0x20'),_0xb7bceb+'-'+_0x3d7f5f+'/'+_0x3ee110)['json'](_0x496892);}return null;};}function patchUpdates(_0x59961c){return function(_0x4f6232){try{jsonpatch[_0x656c('0x21')](_0x4f6232,_0x59961c,!![]);}catch(_0x58a577){return BPromise['reject'](_0x58a577);}return _0x4f6232[_0x656c('0x22')]();};}function saveUpdates(_0x46acbd,_0xd28e53){return function(_0x4a9eb6){if(_0x4a9eb6){return _0x4a9eb6[_0x656c('0x23')](_0x46acbd)[_0x656c('0x24')](function(_0x5a85a2){return _0x5a85a2;});}return null;};}function removeEntity(_0x494ec7,_0x275a2c){return function(_0x29b4e7){if(_0x29b4e7){return _0x29b4e7[_0x656c('0x25')]()[_0x656c('0x24')](function(){var _0x3b97fa=_0x29b4e7[_0x656c('0x26')]({'plain':!![]});var _0x4b825e=_0x656c('0x27');return db['UserProfileResource'][_0x656c('0x25')]({'where':{'type':_0x4b825e,'resourceId':_0x3b97fa['id']}})['then'](function(){return _0x29b4e7;});})['then'](function(){_0x494ec7[_0x656c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf43920,_0x1f05ae){return function(_0x3a0e12){if(!_0x3a0e12){_0xf43920[_0x656c('0x19')](0x194);}return _0x3a0e12;};}function handleError(_0x3befb8,_0x821c6f){_0x821c6f=_0x821c6f||0x1f4;return function(_0xd70b8a){logger[_0x656c('0x28')](_0xd70b8a[_0x656c('0x29')]);if(_0xd70b8a[_0x656c('0x2a')]){delete _0xd70b8a[_0x656c('0x2a')];}_0x3befb8[_0x656c('0x1a')](_0x821c6f)[_0x656c('0x2b')](_0xd70b8a);};}exports[_0x656c('0x2c')]=function(_0x4295e1,_0x391a64){var _0x1ee492={},_0x2818a8={},_0xde9d9d={'count':0x0,'rows':[]};var _0x3b22ce=_['map'](db[_0x656c('0x2d')][_0x656c('0x2e')],function(_0x47ea61){return{'name':_0x47ea61[_0x656c('0x2f')],'type':_0x47ea61[_0x656c('0x30')][_0x656c('0x31')]};});_0x2818a8[_0x656c('0x32')]=_[_0x656c('0x33')](_0x3b22ce,_0x656c('0x2a'));_0x2818a8[_0x656c('0x34')]=_['keys'](_0x4295e1[_0x656c('0x34')]);_0x2818a8[_0x656c('0x35')]=_[_0x656c('0x36')](_0x2818a8[_0x656c('0x32')],_0x2818a8[_0x656c('0x34')]);_0x1ee492[_0x656c('0x37')]=_['intersection'](_0x2818a8[_0x656c('0x32')],qs[_0x656c('0x38')](_0x4295e1[_0x656c('0x34')][_0x656c('0x38')]));_0x1ee492['attributes']=_0x1ee492[_0x656c('0x37')][_0x656c('0x39')]?_0x1ee492[_0x656c('0x37')]:_0x2818a8[_0x656c('0x32')];if(!_0x4295e1['query'][_0x656c('0x3a')](_0x656c('0x3b'))){_0x1ee492[_0x656c('0x1e')]=qs[_0x656c('0x1e')](_0x4295e1[_0x656c('0x34')]['limit']);_0x1ee492[_0x656c('0x1c')]=qs[_0x656c('0x1c')](_0x4295e1[_0x656c('0x34')]['offset']);}_0x1ee492[_0x656c('0x3c')]=qs[_0x656c('0x3d')](_0x4295e1['query'][_0x656c('0x3d')]);_0x1ee492[_0x656c('0x3e')]=qs['filters'](_[_0x656c('0x3f')](_0x4295e1[_0x656c('0x34')],_0x2818a8[_0x656c('0x35')]),_0x3b22ce);if(_0x4295e1[_0x656c('0x34')][_0x656c('0x40')]){_0x1ee492[_0x656c('0x3e')]=_[_0x656c('0x41')](_0x1ee492[_0x656c('0x3e')],{'$or':_[_0x656c('0x33')](_0x3b22ce,function(_0x284ac0){if(_0x284ac0['type']!==_0x656c('0x42')){var _0x321106={};_0x321106[_0x284ac0['name']]={'$like':'%'+_0x4295e1[_0x656c('0x34')]['filter']+'%'};return _0x321106;}})});}_0x1ee492=_[_0x656c('0x41')]({},_0x1ee492,_0x4295e1[_0x656c('0x43')]);var _0x2b3910={'where':_0x1ee492['where']};return db['CmList'][_0x656c('0x1f')](_0x2b3910)[_0x656c('0x24')](function(_0x3b7528){_0xde9d9d[_0x656c('0x1f')]=_0x3b7528;if(_0x4295e1[_0x656c('0x34')][_0x656c('0x44')]){_0x1ee492[_0x656c('0x45')]=[{'all':!![]}];}return db[_0x656c('0x2d')][_0x656c('0x46')](_0x1ee492);})[_0x656c('0x24')](function(_0x377787){_0xde9d9d[_0x656c('0x47')]=_0x377787;return _0xde9d9d;})[_0x656c('0x24')](respondWithFilteredResult(_0x391a64,_0x1ee492))['catch'](handleError(_0x391a64,null));};exports[_0x656c('0x48')]=function(_0x36a7ce,_0x63a365){var _0x3abb31={'raw':![],'where':{'id':_0x36a7ce[_0x656c('0x49')]['id']}},_0x29ef3f={};_0x29ef3f['model']=_[_0x656c('0x4a')](db[_0x656c('0x2d')][_0x656c('0x2e')]);_0x29ef3f[_0x656c('0x34')]=_[_0x656c('0x4a')](_0x36a7ce[_0x656c('0x34')]);_0x29ef3f[_0x656c('0x35')]=_[_0x656c('0x36')](_0x29ef3f['model'],_0x29ef3f['query']);_0x3abb31[_0x656c('0x37')]=_['intersection'](_0x29ef3f['model'],qs[_0x656c('0x38')](_0x36a7ce[_0x656c('0x34')][_0x656c('0x38')]));_0x3abb31['attributes']=_0x3abb31['attributes'][_0x656c('0x39')]?_0x3abb31[_0x656c('0x37')]:_0x29ef3f[_0x656c('0x32')];if(_0x36a7ce[_0x656c('0x34')][_0x656c('0x44')]){_0x3abb31[_0x656c('0x45')]=[{'all':!![]}];}_0x3abb31=_['merge']({},_0x3abb31,_0x36a7ce[_0x656c('0x43')]);return db[_0x656c('0x2d')][_0x656c('0x4b')](_0x3abb31)[_0x656c('0x24')](handleEntityNotFound(_0x63a365,null))[_0x656c('0x24')](respondWithResult(_0x63a365,null))[_0x656c('0x4c')](handleError(_0x63a365,null));};exports[_0x656c('0x4d')]=function(_0x18ba3f,_0x127518){return db[_0x656c('0x2d')][_0x656c('0x4d')](_0x18ba3f['body'],{})[_0x656c('0x24')](function(_0x5e9d71){var _0x1f2f65=_0x18ba3f[_0x656c('0x4e')][_0x656c('0x26')]({'plain':!![]});if(!_0x1f2f65)throw new Error(_0x656c('0x4f'));if(_0x1f2f65[_0x656c('0x50')]==='user'){var _0x3e90e0=_0x5e9d71[_0x656c('0x26')]({'plain':!![]});var _0x3dd2d0=_0x656c('0x27');return db[_0x656c('0x51')][_0x656c('0x4b')]({'where':{'name':_0x3dd2d0,'userProfileId':_0x1f2f65[_0x656c('0x52')]},'raw':!![]})[_0x656c('0x24')](function(_0x24eba3){if(_0x24eba3&&_0x24eba3[_0x656c('0x53')]===0x0){return db['UserProfileResource'][_0x656c('0x4d')]({'name':_0x3e90e0[_0x656c('0x2a')],'resourceId':_0x3e90e0['id'],'type':_0x24eba3[_0x656c('0x2a')],'sectionId':_0x24eba3['id']},{})[_0x656c('0x24')](function(){return _0x5e9d71;});}else{return _0x5e9d71;}})[_0x656c('0x4c')](function(_0x39830f){logger[_0x656c('0x28')](_0x656c('0x54'),_0x39830f);throw _0x39830f;});}return _0x5e9d71;})[_0x656c('0x24')](respondWithResult(_0x127518,0xc9))[_0x656c('0x4c')](handleError(_0x127518,null));};exports[_0x656c('0x23')]=function(_0x40c58c,_0x42c702){if(_0x40c58c[_0x656c('0x55')]['id']){delete _0x40c58c[_0x656c('0x55')]['id'];}return db['CmList'][_0x656c('0x4b')]({'where':{'id':_0x40c58c[_0x656c('0x49')]['id']}})['then'](handleEntityNotFound(_0x42c702,null))[_0x656c('0x24')](saveUpdates(_0x40c58c[_0x656c('0x55')],null))[_0x656c('0x24')](respondWithResult(_0x42c702,null))[_0x656c('0x4c')](handleError(_0x42c702,null));};exports[_0x656c('0x25')]=function(_0x264a7c,_0xa51ee5){return db[_0x656c('0x2d')][_0x656c('0x4b')]({'where':{'id':_0x264a7c['params']['id']}})['then'](handleEntityNotFound(_0xa51ee5,null))[_0x656c('0x24')](removeEntity(_0xa51ee5,null))[_0x656c('0x4c')](handleError(_0xa51ee5,null));};exports['describe']=function(_0xa13479,_0x33bc55){return db[_0x656c('0x2d')]['describe']()[_0x656c('0x24')](respondWithResult(_0x33bc55,null))[_0x656c('0x4c')](handleError(_0x33bc55,null));};exports['addDisposition']=function(_0x54bd1e,_0x369ec2,_0x580847){if(_0x54bd1e[_0x656c('0x55')]['id']){delete _0x54bd1e[_0x656c('0x55')]['id'];}return db[_0x656c('0x2d')][_0x656c('0x4b')]({'where':{'id':_0x54bd1e[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x369ec2,null))['then'](function(_0x115a75){if(_0x115a75){_0x54bd1e['body'][_0x656c('0x56')]=_0x115a75['id'];return db[_0x656c('0x57')][_0x656c('0x4d')](_0x54bd1e['body']);}})['then'](respondWithResult(_0x369ec2,null))[_0x656c('0x4c')](handleError(_0x369ec2,null));};exports['getDispositions']=function(_0x4cdb44,_0x196168,_0x3a86b2){var _0xec2fec={'raw':![],'where':{}};var _0x429bb2={};var _0x59f990={'count':0x0,'rows':[]};return db[_0x656c('0x2d')][_0x656c('0x58')]({'where':{'id':_0x4cdb44[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x196168,null))[_0x656c('0x24')](function(_0x40ea31){if(_0x40ea31){_0x429bb2[_0x656c('0x32')]=_[_0x656c('0x4a')](db['Disposition'][_0x656c('0x2e')]);_0x429bb2[_0x656c('0x34')]=_[_0x656c('0x4a')](_0x4cdb44[_0x656c('0x34')]);_0x429bb2[_0x656c('0x35')]=_['intersection'](_0x429bb2[_0x656c('0x32')],_0x429bb2[_0x656c('0x34')]);_0xec2fec[_0x656c('0x37')]=_[_0x656c('0x36')](_0x429bb2['model'],qs[_0x656c('0x38')](_0x4cdb44['query'][_0x656c('0x38')]));_0xec2fec['attributes']=_0xec2fec[_0x656c('0x37')][_0x656c('0x39')]?_0xec2fec[_0x656c('0x37')]:_0x429bb2[_0x656c('0x32')];if(!_0x4cdb44[_0x656c('0x34')][_0x656c('0x3a')](_0x656c('0x3b'))){_0xec2fec[_0x656c('0x1e')]=qs[_0x656c('0x1e')](_0x4cdb44[_0x656c('0x34')]['limit']);_0xec2fec[_0x656c('0x1c')]=qs[_0x656c('0x1c')](_0x4cdb44[_0x656c('0x34')][_0x656c('0x1c')]);}_0xec2fec[_0x656c('0x3c')]=qs[_0x656c('0x3d')](_0x4cdb44['query'][_0x656c('0x3d')]);_0xec2fec[_0x656c('0x3e')]=qs[_0x656c('0x35')](_[_0x656c('0x3f')](_0x4cdb44['query'],_0x429bb2['filters']));_0xec2fec[_0x656c('0x3e')][_0x656c('0x56')]=_0x40ea31['id'];if(_0x4cdb44[_0x656c('0x34')]['filter']){_0xec2fec[_0x656c('0x3e')]=_['merge'](_0xec2fec[_0x656c('0x3e')],{'$or':_[_0x656c('0x33')](_0xec2fec[_0x656c('0x37')],function(_0x4a9966){var _0x4af670={};_0x4af670[_0x4a9966]={'$like':'%'+_0x4cdb44[_0x656c('0x34')]['filter']+'%'};return _0x4af670;})});}_0xec2fec=_[_0x656c('0x41')]({},_0xec2fec,_0x4cdb44[_0x656c('0x43')]);return db[_0x656c('0x57')][_0x656c('0x1f')]({'where':_0xec2fec[_0x656c('0x3e')]})[_0x656c('0x24')](function(_0x538148){_0x59f990['count']=_0x538148;if(_0x4cdb44[_0x656c('0x34')][_0x656c('0x44')]){_0xec2fec[_0x656c('0x45')]=[{'all':!![]}];}return db[_0x656c('0x57')][_0x656c('0x46')](_0xec2fec);})['then'](function(_0x1c9875){_0x59f990[_0x656c('0x47')]=_0x1c9875;return _0x59f990;});}})[_0x656c('0x24')](respondWithFilteredResult(_0x196168,_0xec2fec))['catch'](handleError(_0x196168,null));};exports[_0x656c('0x59')]=function(_0x1008ae,_0x42ed83,_0xc87335){return db[_0x656c('0x2d')][_0x656c('0x4b')]({'where':{'id':_0x1008ae['params']['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x42ed83,null))['then'](function(_0x4d12ad){if(_0x4d12ad){return _0x4d12ad['removeDispositions'](_0x1008ae['query'][_0x656c('0x5a')]);}})['then'](respondWithStatusCode(_0x42ed83,null))[_0x656c('0x4c')](handleError(_0x42ed83,null));};exports[_0x656c('0x5b')]=function(_0x5d2eba,_0x48c6f8,_0x1a6800){return db[_0x656c('0x2d')]['find']({'where':{'id':_0x5d2eba[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x48c6f8,null))[_0x656c('0x24')](function(_0x431865){if(_0x431865){var _0x3d6dc5=[];var _0x506555={'success':[],'errors':[]};return db[_0x656c('0x5c')][_0x656c('0x5d')]()[_0x656c('0x24')](function(_0x105c7d){if(_0x5d2eba[_0x656c('0x55')][_0x656c('0x5e')]&&_['isArray'](_0x5d2eba[_0x656c('0x55')][_0x656c('0x5e')])){if(_0x5d2eba[_0x656c('0x55')][_0x656c('0x5e')]['length']){_0x5d2eba[_0x656c('0x55')][_0x656c('0x5e')]=_0x5d2eba[_0x656c('0x55')]['tags'][_0x656c('0x5f')](';')+';';}else{_0x5d2eba['body'][_0x656c('0x5e')]=null;}}else{_0x5d2eba[_0x656c('0x55')]['tags']=null;}if(_0x5d2eba[_0x656c('0x55')]&&_[_0x656c('0x60')](_0x5d2eba[_0x656c('0x55')])){for(var _0x4b5559=0x0;_0x4b5559<_0x5d2eba[_0x656c('0x55')][_0x656c('0x39')];_0x4b5559+=0x1){_0x5d2eba[_0x656c('0x55')][_0x4b5559]['ListId']=_0x5d2eba[_0x656c('0x49')]['id'];_0x3d6dc5[_0x656c('0x61')](_0x5d2eba[_0x656c('0x55')][_0x4b5559]);}return BPromise[_0x656c('0x62')](_0x3d6dc5,function(_0x55d944){return db['CmContact'][_0x656c('0x4d')](_[_0x656c('0x63')](_0x55d944,[_0x656c('0x5a'),'id'])||{},{'fields':_[_0x656c('0x4a')](_0x105c7d),'raw':!![]})[_0x656c('0x24')](function(_0x343302){_0x506555[_0x656c('0x64')]['push'](_0x343302[_0x656c('0x65')]);})[_0x656c('0x4c')](function(_0x1bf86e){_0x506555[_0x656c('0x66')][_0x656c('0x61')]({'data':_0x55d944,'error':_0x1bf86e[_0x656c('0x67')]});});})[_0x656c('0x24')](function(_0x40f8f9){return _0x506555;})[_0x656c('0x4c')](function(_0x159c7a){return _0x159c7a;});}else{_0x48c6f8[_0x656c('0x1a')](0x190)[_0x656c('0x1b')]({'message':_0x656c('0x68')});}});}})[_0x656c('0x24')](respondWithResult(_0x48c6f8,null))[_0x656c('0x4c')](handleError(_0x48c6f8,null));};exports[_0x656c('0x69')]=function(_0xbb1892,_0x340a9e,_0x19d7d0){var _0xdfb2b9;return db['CmList'][_0x656c('0x4b')]({'where':{'id':_0xbb1892['params']['id']},'include':[{'model':db[_0x656c('0x6a')],'as':_0x656c('0x6b')}]})['then'](handleEntityNotFound(_0x340a9e,null))[_0x656c('0x24')](function(_0x143a70){if(_0x143a70){_0xdfb2b9=_0x143a70;return db['CmContact'][_0x656c('0x2e')];}})[_0x656c('0x24')](function(_0x5ebab2){if(_0x5ebab2){var _0x530566={};var _0x4749c8={};_0x4749c8[_0x656c('0x32')]=_[_0x656c('0x6c')](_[_0x656c('0x4a')](_0x5ebab2),_[_0x656c('0x33')](_0xdfb2b9[_0x656c('0x6b')],function(_0xded04a){return util[_0x656c('0x6d')](_0x656c('0x6e'),_0xded04a['id']);}));_0x4749c8[_0x656c('0x34')]=_[_0x656c('0x4a')](_0xbb1892[_0x656c('0x34')]);_0x4749c8[_0x656c('0x35')]=_[_0x656c('0x36')](_0x4749c8['model'],_0x4749c8[_0x656c('0x34')]);_0x530566[_0x656c('0x37')]=_[_0x656c('0x36')](_0x4749c8[_0x656c('0x32')],qs[_0x656c('0x38')](_0xbb1892[_0x656c('0x34')]['fields']));_0x530566[_0x656c('0x37')]=_0x530566[_0x656c('0x37')][_0x656c('0x39')]?_0x530566['attributes']:_0x4749c8[_0x656c('0x32')];if(!_0xbb1892[_0x656c('0x34')]['hasOwnProperty'](_0x656c('0x3b'))){_0x530566[_0x656c('0x1e')]=qs[_0x656c('0x1e')](_0xbb1892[_0x656c('0x34')][_0x656c('0x1e')]);_0x530566[_0x656c('0x1c')]=qs[_0x656c('0x1c')](_0xbb1892[_0x656c('0x34')][_0x656c('0x1c')]);}_0x530566[_0x656c('0x3c')]=qs[_0x656c('0x3d')](_0xbb1892['query'][_0x656c('0x3d')]);_0x530566['where']=qs[_0x656c('0x35')](_[_0x656c('0x3f')](_0xbb1892[_0x656c('0x34')],_0x4749c8[_0x656c('0x35')]));_0x530566['raw']=!![];if(_0xbb1892['query'][_0x656c('0x40')]){_0x530566[_0x656c('0x3e')]=_[_0x656c('0x41')](_0x530566['where'],{'$or':_['map'](_0x530566[_0x656c('0x37')],function(_0x495c36){var _0x177b50={};_0x177b50[_0x495c36]={'$like':'%'+_0xbb1892[_0x656c('0x34')][_0x656c('0x40')]+'%'};return _0x177b50;})});}_0x530566=_['merge']({},_0x530566,_0xbb1892[_0x656c('0x43')]);return _0xdfb2b9['getContacts'](_0x530566);}})['then'](respondWithResult(_0x340a9e,null))[_0x656c('0x4c')](handleError(_0x340a9e,null));};exports[_0x656c('0x6f')]=function(_0x4fabb9,_0x9b10f,_0x10fbb0){var _0x69af00;var _0x3d7321;var _0x3b7464;var _0x21aefc=_0x4fabb9['params']['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0x656c('0x2a')],'raw':!![],'order':['OrderBy']})[_0x656c('0x24')](function(_0x425f5a){_0x69af00=_0x425f5a;var _0x472a3e=_['keys'](db['CmContact'][_0x656c('0x2e')]);return db[_0x656c('0x6a')][_0x656c('0x46')]({'raw':!![],'attributes':['id',_0x656c('0x70')]})[_0x656c('0x24')](function(_0x2ee227){_0x3d7321=_0x2ee227;var _0x41759c=squel[_0x656c('0x71')]()[_0x656c('0x38')](_0x472a3e)[_0x656c('0x72')](_0x656c('0x73'),'c')['where'](_0x656c('0x74'),_0x21aefc)[_0x656c('0x3e')](_0x656c('0x75'))['distinct']();for(var _0x339dbc=0x0;_0x339dbc<_0x3d7321[_0x656c('0x39')];_0x339dbc++){_0x41759c[_0x656c('0x76')](_0x656c('0x77')+_0x3d7321[_0x339dbc]['id'],_0x656c('0x78')+_0x3d7321[_0x339dbc][_0x656c('0x70')]);}for(var _0x339dbc=0x0;_0x339dbc<_0x69af00[_0x656c('0x39')];_0x339dbc++){_0x41759c[_0x656c('0x76')](squel[_0x656c('0x71')]()[_0x656c('0x76')](_0x656c('0x79'))[_0x656c('0x72')](_0x656c('0x7a'))[_0x656c('0x3e')](_0x656c('0x7b'),_0x69af00[_0x339dbc]['id'])[_0x656c('0x3e')]('CmContactId\x20=\x20c.id'),_0x656c('0x7c')+_0x69af00[_0x339dbc][_0x656c('0x2a')]);_0x41759c[_0x656c('0x76')](squel[_0x656c('0x71')]()['field'](_0x656c('0x7d'))['from'](_0x656c('0x7a'))[_0x656c('0x3e')](_0x656c('0x7b'),_0x69af00[_0x339dbc]['id'])['where'](_0x656c('0x7e')),'description_additionalPhone_'+_0x69af00[_0x339dbc][_0x656c('0x2a')]);}var _0x19b7a7=[];_0x19b7a7[_0x656c('0x61')](_0x41759c[_0x656c('0x7f')]());BPromise[_0x656c('0x62')](_0x19b7a7,handleQuery)['then'](function(_0x40fa70){handleQuery(_0x41759c[_0x656c('0x7f')]());var _0x3aaa27=csv_results[0x0];if(!_['isEmpty'](_0x3aaa27)){var _0x588e13=toCsv(_0x3aaa27);var _0x563d75=Date['now']();fs[_0x656c('0x80')](util[_0x656c('0x6d')]('/tmp/list_%d_%s.csv',_0x21aefc,_0x563d75),_0x588e13);_0x9b10f[_0x656c('0x81')](_0x656c('0x82'),'attachment;\x20filename='+util[_0x656c('0x6d')](_0x656c('0x83'),_0x21aefc,_0x563d75));_0x9b10f[_0x656c('0x81')](_0x656c('0x84'),_0x656c('0x85'));return _0x9b10f[_0x656c('0x86')](util[_0x656c('0x6d')](_0x656c('0x87'),_0x21aefc,_0x563d75));}else{return _0x9b10f['sendStatus'](0xcc);}});});});};exports[_0x656c('0x88')]=function(_0x4c9c7f,_0x2a5e91,_0x35581f){var _0x355300;delete _0x4c9c7f[_0x656c('0x55')]['id'];return db['CmList'][_0x656c('0x58')]({'where':{'id':_0x4c9c7f[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x2a5e91,null))[_0x656c('0x24')](function(_0x6eeb95){if(_0x6eeb95){return db[_0x656c('0x89')][_0x656c('0x8a')](function(_0x497cd3){return db[_0x656c('0x6a')][_0x656c('0x4d')](_0x4c9c7f[_0x656c('0x55')],{'transaction':_0x497cd3})['then'](function(_0x186512){_0x355300=_0x186512;return _0x6eeb95[_0x656c('0x8b')](_0x186512,{'transaction':_0x497cd3});})[_0x656c('0x24')](function(){var _0x4beff1={'type':db[_0x656c('0x8c')]['TEXT'],'transaction':_0x497cd3};switch(_0x4c9c7f['body'][_0x656c('0x30')]){case'text':_0x4beff1[_0x656c('0x30')]=db[_0x656c('0x8c')][_0x656c('0x8d')];break;case _0x656c('0x8e'):_0x4beff1[_0x656c('0x30')]=db[_0x656c('0x8c')][_0x656c('0x8f')];break;case _0x656c('0x90'):_0x4beff1[_0x656c('0x30')]=db[_0x656c('0x8c')][_0x656c('0x91')];_0x4beff1[_0x656c('0x92')]=![];break;default:}return db['sequelize'][_0x656c('0x93')][_0x656c('0x94')](_0x656c('0x73'),util[_0x656c('0x6d')](_0x656c('0x95'),_0x355300['id']),_0x4beff1);})['then'](function(){return _0x355300;});});}})[_0x656c('0x24')](respondWithResult(_0x2a5e91,null))[_0x656c('0x4c')](handleError(_0x2a5e91,null));};exports[_0x656c('0x96')]=function(_0x21ada6,_0x45c36e,_0x2510a8){var _0x25d9c3={};var _0x56932b={};var _0x5b66fe;var _0x51f244;return db[_0x656c('0x2d')]['findOne']({'where':{'id':_0x21ada6['params']['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x45c36e,null))[_0x656c('0x24')](function(_0x2b7f2a){if(_0x2b7f2a){_0x5b66fe=_0x2b7f2a;_0x56932b[_0x656c('0x32')]=_[_0x656c('0x4a')](db[_0x656c('0x6a')][_0x656c('0x2e')]);_0x56932b[_0x656c('0x34')]=_['keys'](_0x21ada6[_0x656c('0x34')]);_0x56932b['filters']=_['intersection'](_0x56932b[_0x656c('0x32')],_0x56932b['query']);_0x25d9c3[_0x656c('0x37')]=_[_0x656c('0x36')](_0x56932b[_0x656c('0x32')],qs['fields'](_0x21ada6[_0x656c('0x34')][_0x656c('0x38')]));_0x25d9c3['attributes']=_0x25d9c3[_0x656c('0x37')][_0x656c('0x39')]?_0x25d9c3[_0x656c('0x37')]:_0x56932b[_0x656c('0x32')];_0x25d9c3[_0x656c('0x3c')]=qs[_0x656c('0x3d')](_0x21ada6[_0x656c('0x34')][_0x656c('0x3d')]);_0x25d9c3[_0x656c('0x3e')]=qs[_0x656c('0x35')](_['pick'](_0x21ada6['query'],_0x56932b['filters']));_0x25d9c3[_0x656c('0x3e')]=_[_0x656c('0x41')](_0x25d9c3[_0x656c('0x3e')],{'$or':[{'ListId':_0x2b7f2a['id']},{'ListId':null}]});if(_0x21ada6[_0x656c('0x34')]['filter']){_0x25d9c3['where']=_[_0x656c('0x41')](_0x25d9c3['where'],{'$or':_[_0x656c('0x33')](_0x25d9c3['attributes'],function(_0x1dec49){var _0x8f4d8={};_0x8f4d8[_0x1dec49]={'$like':'%'+_0x21ada6['query'][_0x656c('0x40')]+'%'};return _0x8f4d8;})});}_0x25d9c3=_[_0x656c('0x41')]({},_0x25d9c3,_0x21ada6[_0x656c('0x43')]);return db['CmCustomField']['findAndCountAll'](_0x25d9c3);}})[_0x656c('0x24')](respondWithResult(_0x45c36e,null))[_0x656c('0x4c')](handleError(_0x45c36e,null));};exports[_0x656c('0x97')]=function(_0x317bf0,_0x6e9b23){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0x656c('0x24')](handleEntityNotFound(_0x6e9b23,null))[_0x656c('0x24')](function(_0x2e40d0){return _0x2e40d0;})[_0x656c('0x24')](respondWithResult(_0x6e9b23,null))[_0x656c('0x4c')](handleError(_0x6e9b23,null));};exports[_0x656c('0x98')]=function(_0x5a522b,_0x30cd1b,_0x4ca855){return db[_0x656c('0x2d')][_0x656c('0x4b')]({'where':{'id':_0x5a522b[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x30cd1b,null))[_0x656c('0x24')](function(_0x5913f7){if(_0x5913f7){return _0x5913f7[_0x656c('0x98')](_0x5a522b[_0x656c('0x55')][_0x656c('0x5a')],_[_0x656c('0x63')](_0x5a522b[_0x656c('0x55')],[_0x656c('0x5a'),'id'])||{})[_0x656c('0x99')](function(_0x460390){for(var _0x643afa=0x0;_0x643afa<_0x5a522b[_0x656c('0x55')][_0x656c('0x5a')][_0x656c('0x39')];_0x643afa+=0x1){socket[_0x656c('0x9a')](_0x656c('0x9b'),{'UserId':Number(_0x5a522b['body']['ids'][_0x643afa]),'CmListId':Number(_0x5a522b[_0x656c('0x49')]['id'])});}return _0x460390;});}})[_0x656c('0x24')](respondWithResult(_0x30cd1b,null))[_0x656c('0x4c')](handleError(_0x30cd1b,null));};exports[_0x656c('0x9c')]=function(_0x3a1f42,_0x4c8f94,_0x5e4817){return db[_0x656c('0x2d')][_0x656c('0x4b')]({'where':{'id':_0x3a1f42['params']['id']}})['then'](handleEntityNotFound(_0x4c8f94,null))['then'](function(_0x3e0879){if(_0x3e0879){return _0x3e0879[_0x656c('0x9c')](_0x3a1f42[_0x656c('0x34')][_0x656c('0x5a')])['then'](function(){if(_[_0x656c('0x60')](_0x3a1f42['query'][_0x656c('0x5a')])){for(var _0x44445d=0x0;_0x44445d<_0x3a1f42[_0x656c('0x34')][_0x656c('0x5a')][_0x656c('0x39')];_0x44445d+=0x1){socket[_0x656c('0x9a')]('userCmList:remove',{'UserId':Number(_0x3a1f42['query'][_0x656c('0x5a')][_0x44445d]),'CmListId':Number(_0x3a1f42['params']['id'])});}}else{socket[_0x656c('0x9a')](_0x656c('0x9d'),{'UserId':Number(_0x3a1f42[_0x656c('0x34')][_0x656c('0x5a')]),'CmListId':Number(_0x3a1f42['params']['id'])});}});}})[_0x656c('0x24')](respondWithStatusCode(_0x4c8f94,null))['catch'](handleError(_0x4c8f94,null));};exports[_0x656c('0x9e')]=function(_0x53f7f8,_0x3a3c05,_0x433408){var _0x170547={};var _0x12de76={};var _0xe645f;var _0x35ac91;return db[_0x656c('0x2d')]['findOne']({'where':{'id':_0x53f7f8[_0x656c('0x49')]['id']}})[_0x656c('0x24')](handleEntityNotFound(_0x3a3c05,null))['then'](function(_0x2d16ad){if(_0x2d16ad){_0xe645f=_0x2d16ad;_0x12de76[_0x656c('0x32')]=_[_0x656c('0x4a')](db[_0x656c('0x9f')][_0x656c('0x2e')]);_0x12de76['query']=_['keys'](_0x53f7f8[_0x656c('0x34')]);_0x12de76[_0x656c('0x35')]=_[_0x656c('0x36')](_0x12de76[_0x656c('0x32')],_0x12de76[_0x656c('0x34')]);_0x170547[_0x656c('0x37')]=_[_0x656c('0x36')](_0x12de76[_0x656c('0x32')],qs[_0x656c('0x38')](_0x53f7f8['query'][_0x656c('0x38')]));_0x170547[_0x656c('0x37')]=_0x170547[_0x656c('0x37')]['length']?_0x170547[_0x656c('0x37')]:_0x12de76[_0x656c('0x32')];_0x170547[_0x656c('0x3c')]=qs[_0x656c('0x3d')](_0x53f7f8[_0x656c('0x34')][_0x656c('0x3d')]);_0x170547[_0x656c('0x3e')]=qs[_0x656c('0x35')](_[_0x656c('0x3f')](_0x53f7f8[_0x656c('0x34')],_0x12de76[_0x656c('0x35')]));if(_0x53f7f8[_0x656c('0x34')][_0x656c('0x40')]){_0x170547[_0x656c('0x3e')]=_['merge'](_0x170547['where'],{'$or':_[_0x656c('0x33')](_0x170547[_0x656c('0x37')],function(_0x5a394a){var _0x2e40a5={};_0x2e40a5[_0x5a394a]={'$like':'%'+_0x53f7f8[_0x656c('0x34')][_0x656c('0x40')]+'%'};return _0x2e40a5;})});}_0x170547=_[_0x656c('0x41')]({},_0x170547,_0x53f7f8['options']);return _0xe645f[_0x656c('0x9e')](_0x170547);}})[_0x656c('0x24')](function(_0x53adc8){if(_0x53adc8){_0x35ac91=_0x53adc8['length'];if(!_0x53f7f8[_0x656c('0x34')][_0x656c('0x3a')]('nolimit')){_0x170547['limit']=qs[_0x656c('0x1e')](_0x53f7f8['query'][_0x656c('0x1e')]);_0x170547[_0x656c('0x1c')]=qs[_0x656c('0x1c')](_0x53f7f8[_0x656c('0x34')][_0x656c('0x1c')]);}return _0xe645f[_0x656c('0x9e')](_0x170547);}})[_0x656c('0x24')](function(_0x37e50b){if(_0x37e50b){return _0x37e50b?{'count':_0x35ac91,'rows':_0x37e50b}:null;}})[_0x656c('0x24')](respondWithResult(_0x3a3c05,null))['catch'](handleError(_0x3a3c05,null));};function handleQuery(_0x45fd02){logger[_0x656c('0xa0')](_0x45fd02);return db[_0x656c('0x89')]['query'](_0x45fd02)[_0x656c('0x99')](function(_0x4feed5){csv_results[_0x656c('0x61')](_0x4feed5);})['catch'](function(_0x486992){logger[_0x656c('0x28')](_0x486992[_0x656c('0x67')]);});} \ No newline at end of file +var _0x3e7c=['alias','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','c.cf_','field','select','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','format','list_%d_%s.csv','text/csv','download','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','rimraf','fast-json-patch','request-promise','moment','mustache','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','create','body','user','role','UserProfileSection','autoAssociation','describe','addDisposition','params','ListId','Disposition','findOne','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','CmCustomField','CustomFields','cf_%d','order','getContacts','getContactsCsv','OrderBy'];(function(_0xf17a48,_0x5c0175){var _0x198c64=function(_0x4fb521){while(--_0x4fb521){_0xf17a48['push'](_0xf17a48['shift']());}};_0x198c64(++_0x5c0175);}(_0x3e7c,0xc7));var _0xc3e7=function(_0x5b2f24,_0x33282b){_0x5b2f24=_0x5b2f24-0x0;var _0x223f81=_0x3e7c[_0x5b2f24];return _0x223f81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc3e7('0x1'));var rp=require(_0xc3e7('0x2'));var moment=require(_0xc3e7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc3e7('0x4'));var util=require('util');var path=require('path');var sox=require(_0xc3e7('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc3e7('0x6'));var _=require(_0xc3e7('0x7'));var squel=require('squel');var crypto=require(_0xc3e7('0x8'));var jsforce=require(_0xc3e7('0x9'));var deskjs=require(_0xc3e7('0xa'));var toCsv=require(_0xc3e7('0xb'));var querystring=require(_0xc3e7('0xc'));var Papa=require(_0xc3e7('0xd'));var Redis=require(_0xc3e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc3e7('0xf'));var as=require(_0xc3e7('0x10'));var hardwareService=require(_0xc3e7('0x11'));var logger=require(_0xc3e7('0x12'))(_0xc3e7('0x13'));var utils=require(_0xc3e7('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc3e7('0x15'));var db=require(_0xc3e7('0x16'))['db'];var csv_results;config[_0xc3e7('0x17')]=_['defaults'](config[_0xc3e7('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3e7('0x17')]));require(_0xc3e7('0x18'))[_0xc3e7('0x19')](socket);function respondWithStatusCode(_0x34d43e,_0x31fd9d){_0x31fd9d=_0x31fd9d||0xcc;return function(_0x5682f6){if(_0x5682f6){return _0x34d43e[_0xc3e7('0x1a')](_0x31fd9d);}return _0x34d43e[_0xc3e7('0x1b')](_0x31fd9d)[_0xc3e7('0x1c')]();};}function respondWithResult(_0x1fc40b,_0x439558){_0x439558=_0x439558||0xc8;return function(_0xaafd82){if(_0xaafd82){return _0x1fc40b['status'](_0x439558)[_0xc3e7('0x1d')](_0xaafd82);}};}function respondWithFilteredResult(_0x371708,_0x5cee6b){return function(_0x3bdd1f){if(_0x3bdd1f){var _0x5346ae=typeof _0x5cee6b[_0xc3e7('0x1e')]===_0xc3e7('0x1f')&&typeof _0x5cee6b[_0xc3e7('0x20')]===_0xc3e7('0x1f');var _0x409c83=_0x3bdd1f[_0xc3e7('0x21')];var _0x44fea1=_0x5346ae?0x0:_0x5cee6b[_0xc3e7('0x1e')];var _0x5809d0=_0x5346ae?_0x3bdd1f['count']:_0x5cee6b[_0xc3e7('0x1e')]+_0x5cee6b[_0xc3e7('0x20')];var _0x2ad053;if(_0x5809d0>=_0x409c83){_0x5809d0=_0x409c83;_0x2ad053=0xc8;}else{_0x2ad053=0xce;}_0x371708[_0xc3e7('0x1b')](_0x2ad053);return _0x371708['set']('Content-Range',_0x44fea1+'-'+_0x5809d0+'/'+_0x409c83)[_0xc3e7('0x1d')](_0x3bdd1f);}return null;};}function patchUpdates(_0x30932c){return function(_0x169a8e){try{jsonpatch['apply'](_0x169a8e,_0x30932c,!![]);}catch(_0x9a6a91){return BPromise[_0xc3e7('0x22')](_0x9a6a91);}return _0x169a8e[_0xc3e7('0x23')]();};}function saveUpdates(_0x4dacc4,_0x5070ed){return function(_0x27f0a4){if(_0x27f0a4){return _0x27f0a4[_0xc3e7('0x24')](_0x4dacc4)['then'](function(_0x236edf){return _0x236edf;});}return null;};}function removeEntity(_0xafb3c7,_0x39f860){return function(_0xe4018a){if(_0xe4018a){return _0xe4018a[_0xc3e7('0x25')]()[_0xc3e7('0x26')](function(){var _0x2d54db=_0xe4018a[_0xc3e7('0x27')]({'plain':!![]});var _0x2f461f=_0xc3e7('0x28');return db[_0xc3e7('0x29')][_0xc3e7('0x25')]({'where':{'type':_0x2f461f,'resourceId':_0x2d54db['id']}})['then'](function(){return _0xe4018a;});})['then'](function(){_0xafb3c7[_0xc3e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2469af,_0x4e4028){return function(_0x48b113){if(!_0x48b113){_0x2469af[_0xc3e7('0x1a')](0x194);}return _0x48b113;};}function handleError(_0x532e09,_0xa761ac){_0xa761ac=_0xa761ac||0x1f4;return function(_0x5bf7af){logger[_0xc3e7('0x2a')](_0x5bf7af['stack']);if(_0x5bf7af[_0xc3e7('0x2b')]){delete _0x5bf7af[_0xc3e7('0x2b')];}_0x532e09['status'](_0xa761ac)[_0xc3e7('0x2c')](_0x5bf7af);};}exports[_0xc3e7('0x2d')]=function(_0x36c6c7,_0x1f2a80){var _0x57239c={},_0x4563d4={},_0x128c5e={'count':0x0,'rows':[]};var _0x5c9ecb=_[_0xc3e7('0x2e')](db[_0xc3e7('0x2f')][_0xc3e7('0x30')],function(_0x288da5){return{'name':_0x288da5[_0xc3e7('0x31')],'type':_0x288da5[_0xc3e7('0x32')][_0xc3e7('0x33')]};});_0x4563d4['model']=_[_0xc3e7('0x2e')](_0x5c9ecb,_0xc3e7('0x2b'));_0x4563d4['query']=_[_0xc3e7('0x34')](_0x36c6c7[_0xc3e7('0x35')]);_0x4563d4[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x4563d4[_0xc3e7('0x38')],_0x4563d4['query']);_0x57239c[_0xc3e7('0x39')]=_[_0xc3e7('0x37')](_0x4563d4['model'],qs[_0xc3e7('0x3a')](_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x3a')]));_0x57239c['attributes']=_0x57239c[_0xc3e7('0x39')][_0xc3e7('0x3b')]?_0x57239c[_0xc3e7('0x39')]:_0x4563d4[_0xc3e7('0x38')];if(!_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x3c')](_0xc3e7('0x3d'))){_0x57239c[_0xc3e7('0x20')]=qs[_0xc3e7('0x20')](_0x36c6c7[_0xc3e7('0x35')]['limit']);_0x57239c[_0xc3e7('0x1e')]=qs[_0xc3e7('0x1e')](_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x1e')]);}_0x57239c['order']=qs[_0xc3e7('0x3e')](_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x3e')]);_0x57239c[_0xc3e7('0x3f')]=qs[_0xc3e7('0x36')](_[_0xc3e7('0x40')](_0x36c6c7['query'],_0x4563d4[_0xc3e7('0x36')]),_0x5c9ecb);if(_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x41')]){_0x57239c[_0xc3e7('0x3f')]=_[_0xc3e7('0x42')](_0x57239c[_0xc3e7('0x3f')],{'$or':_[_0xc3e7('0x2e')](_0x5c9ecb,function(_0x748a04){if(_0x748a04[_0xc3e7('0x32')]!=='VIRTUAL'){var _0x4f3f4b={};_0x4f3f4b[_0x748a04[_0xc3e7('0x2b')]]={'$like':'%'+_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x41')]+'%'};return _0x4f3f4b;}})});}_0x57239c=_['merge']({},_0x57239c,_0x36c6c7[_0xc3e7('0x43')]);var _0x50119e={'where':_0x57239c[_0xc3e7('0x3f')]};return db[_0xc3e7('0x2f')][_0xc3e7('0x21')](_0x50119e)['then'](function(_0x51cb96){_0x128c5e[_0xc3e7('0x21')]=_0x51cb96;if(_0x36c6c7[_0xc3e7('0x35')][_0xc3e7('0x44')]){_0x57239c[_0xc3e7('0x45')]=[{'all':!![]}];}return db[_0xc3e7('0x2f')][_0xc3e7('0x46')](_0x57239c);})[_0xc3e7('0x26')](function(_0x289c86){_0x128c5e[_0xc3e7('0x47')]=_0x289c86;return _0x128c5e;})['then'](respondWithFilteredResult(_0x1f2a80,_0x57239c))['catch'](handleError(_0x1f2a80,null));};exports['show']=function(_0x202c43,_0x510ce7){var _0x48e221={'raw':![],'where':{'id':_0x202c43['params']['id']}},_0x189435={};_0x189435[_0xc3e7('0x38')]=_['keys'](db[_0xc3e7('0x2f')][_0xc3e7('0x30')]);_0x189435[_0xc3e7('0x35')]=_['keys'](_0x202c43['query']);_0x189435[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x189435[_0xc3e7('0x38')],_0x189435['query']);_0x48e221['attributes']=_[_0xc3e7('0x37')](_0x189435[_0xc3e7('0x38')],qs[_0xc3e7('0x3a')](_0x202c43[_0xc3e7('0x35')][_0xc3e7('0x3a')]));_0x48e221[_0xc3e7('0x39')]=_0x48e221['attributes'][_0xc3e7('0x3b')]?_0x48e221[_0xc3e7('0x39')]:_0x189435[_0xc3e7('0x38')];if(_0x202c43['query'][_0xc3e7('0x44')]){_0x48e221[_0xc3e7('0x45')]=[{'all':!![]}];}_0x48e221=_[_0xc3e7('0x42')]({},_0x48e221,_0x202c43[_0xc3e7('0x43')]);return db[_0xc3e7('0x2f')][_0xc3e7('0x48')](_0x48e221)[_0xc3e7('0x26')](handleEntityNotFound(_0x510ce7,null))['then'](respondWithResult(_0x510ce7,null))[_0xc3e7('0x49')](handleError(_0x510ce7,null));};exports[_0xc3e7('0x4a')]=function(_0x1c3afe,_0x263552){return db[_0xc3e7('0x2f')]['create'](_0x1c3afe[_0xc3e7('0x4b')],{})['then'](function(_0x1dfd6b){var _0x230afd=_0x1c3afe[_0xc3e7('0x4c')]['get']({'plain':!![]});if(!_0x230afd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x230afd[_0xc3e7('0x4d')]===_0xc3e7('0x4c')){var _0x1b47ad=_0x1dfd6b[_0xc3e7('0x27')]({'plain':!![]});var _0x127ac5='Lists';return db[_0xc3e7('0x4e')][_0xc3e7('0x48')]({'where':{'name':_0x127ac5,'userProfileId':_0x230afd['userProfileId']},'raw':!![]})[_0xc3e7('0x26')](function(_0x3c333f){if(_0x3c333f&&_0x3c333f[_0xc3e7('0x4f')]===0x0){return db[_0xc3e7('0x29')][_0xc3e7('0x4a')]({'name':_0x1b47ad[_0xc3e7('0x2b')],'resourceId':_0x1b47ad['id'],'type':_0x3c333f['name'],'sectionId':_0x3c333f['id']},{})[_0xc3e7('0x26')](function(){return _0x1dfd6b;});}else{return _0x1dfd6b;}})[_0xc3e7('0x49')](function(_0x5c4874){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c4874);throw _0x5c4874;});}return _0x1dfd6b;})[_0xc3e7('0x26')](respondWithResult(_0x263552,0xc9))[_0xc3e7('0x49')](handleError(_0x263552,null));};exports[_0xc3e7('0x24')]=function(_0x29b7bd,_0x3ee7ce){if(_0x29b7bd[_0xc3e7('0x4b')]['id']){delete _0x29b7bd[_0xc3e7('0x4b')]['id'];}return db[_0xc3e7('0x2f')][_0xc3e7('0x48')]({'where':{'id':_0x29b7bd['params']['id']}})['then'](handleEntityNotFound(_0x3ee7ce,null))[_0xc3e7('0x26')](saveUpdates(_0x29b7bd[_0xc3e7('0x4b')],null))[_0xc3e7('0x26')](respondWithResult(_0x3ee7ce,null))[_0xc3e7('0x49')](handleError(_0x3ee7ce,null));};exports[_0xc3e7('0x25')]=function(_0x2b1256,_0x57bcbd){return db[_0xc3e7('0x2f')][_0xc3e7('0x48')]({'where':{'id':_0x2b1256['params']['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x57bcbd,null))[_0xc3e7('0x26')](removeEntity(_0x57bcbd,null))[_0xc3e7('0x49')](handleError(_0x57bcbd,null));};exports[_0xc3e7('0x50')]=function(_0x197286,_0x13197f){return db[_0xc3e7('0x2f')][_0xc3e7('0x50')]()[_0xc3e7('0x26')](respondWithResult(_0x13197f,null))[_0xc3e7('0x49')](handleError(_0x13197f,null));};exports[_0xc3e7('0x51')]=function(_0x3554de,_0x3082ec,_0x1df016){if(_0x3554de[_0xc3e7('0x4b')]['id']){delete _0x3554de[_0xc3e7('0x4b')]['id'];}return db['CmList']['find']({'where':{'id':_0x3554de[_0xc3e7('0x52')]['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x3082ec,null))['then'](function(_0x38ed92){if(_0x38ed92){_0x3554de[_0xc3e7('0x4b')][_0xc3e7('0x53')]=_0x38ed92['id'];return db[_0xc3e7('0x54')][_0xc3e7('0x4a')](_0x3554de[_0xc3e7('0x4b')]);}})[_0xc3e7('0x26')](respondWithResult(_0x3082ec,null))[_0xc3e7('0x49')](handleError(_0x3082ec,null));};exports['getDispositions']=function(_0x1535c9,_0x597531,_0x33b3c6){var _0x4b5fc9={'raw':![],'where':{}};var _0x358165={};var _0x232ae3={'count':0x0,'rows':[]};return db[_0xc3e7('0x2f')][_0xc3e7('0x55')]({'where':{'id':_0x1535c9[_0xc3e7('0x52')]['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x597531,null))[_0xc3e7('0x26')](function(_0x1b715d){if(_0x1b715d){_0x358165[_0xc3e7('0x38')]=_[_0xc3e7('0x34')](db[_0xc3e7('0x54')][_0xc3e7('0x30')]);_0x358165[_0xc3e7('0x35')]=_['keys'](_0x1535c9[_0xc3e7('0x35')]);_0x358165[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x358165['model'],_0x358165[_0xc3e7('0x35')]);_0x4b5fc9[_0xc3e7('0x39')]=_[_0xc3e7('0x37')](_0x358165[_0xc3e7('0x38')],qs[_0xc3e7('0x3a')](_0x1535c9['query'][_0xc3e7('0x3a')]));_0x4b5fc9['attributes']=_0x4b5fc9[_0xc3e7('0x39')]['length']?_0x4b5fc9[_0xc3e7('0x39')]:_0x358165[_0xc3e7('0x38')];if(!_0x1535c9[_0xc3e7('0x35')][_0xc3e7('0x3c')](_0xc3e7('0x3d'))){_0x4b5fc9['limit']=qs[_0xc3e7('0x20')](_0x1535c9[_0xc3e7('0x35')][_0xc3e7('0x20')]);_0x4b5fc9['offset']=qs[_0xc3e7('0x1e')](_0x1535c9[_0xc3e7('0x35')]['offset']);}_0x4b5fc9['order']=qs[_0xc3e7('0x3e')](_0x1535c9[_0xc3e7('0x35')]['sort']);_0x4b5fc9[_0xc3e7('0x3f')]=qs[_0xc3e7('0x36')](_['pick'](_0x1535c9[_0xc3e7('0x35')],_0x358165['filters']));_0x4b5fc9['where']['ListId']=_0x1b715d['id'];if(_0x1535c9[_0xc3e7('0x35')][_0xc3e7('0x41')]){_0x4b5fc9['where']=_[_0xc3e7('0x42')](_0x4b5fc9[_0xc3e7('0x3f')],{'$or':_[_0xc3e7('0x2e')](_0x4b5fc9['attributes'],function(_0x4be6b9){var _0x567150={};_0x567150[_0x4be6b9]={'$like':'%'+_0x1535c9[_0xc3e7('0x35')][_0xc3e7('0x41')]+'%'};return _0x567150;})});}_0x4b5fc9=_[_0xc3e7('0x42')]({},_0x4b5fc9,_0x1535c9[_0xc3e7('0x43')]);return db[_0xc3e7('0x54')][_0xc3e7('0x21')]({'where':_0x4b5fc9[_0xc3e7('0x3f')]})[_0xc3e7('0x26')](function(_0x30c374){_0x232ae3[_0xc3e7('0x21')]=_0x30c374;if(_0x1535c9[_0xc3e7('0x35')][_0xc3e7('0x44')]){_0x4b5fc9['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4b5fc9);})['then'](function(_0x9e40bb){_0x232ae3['rows']=_0x9e40bb;return _0x232ae3;});}})['then'](respondWithFilteredResult(_0x597531,_0x4b5fc9))[_0xc3e7('0x49')](handleError(_0x597531,null));};exports['removeDispositions']=function(_0xd88f6,_0x39e9f2,_0x3efe1f){return db[_0xc3e7('0x2f')]['find']({'where':{'id':_0xd88f6[_0xc3e7('0x52')]['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x39e9f2,null))[_0xc3e7('0x26')](function(_0xc8e734){if(_0xc8e734){return _0xc8e734['removeDispositions'](_0xd88f6['query'][_0xc3e7('0x56')]);}})[_0xc3e7('0x26')](respondWithStatusCode(_0x39e9f2,null))['catch'](handleError(_0x39e9f2,null));};exports['addContacts']=function(_0x420dbe,_0x199d90,_0x35566a){return db[_0xc3e7('0x2f')][_0xc3e7('0x48')]({'where':{'id':_0x420dbe['params']['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x199d90,null))['then'](function(_0x5ef5d1){if(_0x5ef5d1){var _0x443796=[];var _0x116f66={'success':[],'errors':[]};return db[_0xc3e7('0x57')][_0xc3e7('0x50')]()[_0xc3e7('0x26')](function(_0x40ff4){if(_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x58')]&&_[_0xc3e7('0x59')](_0x420dbe['body']['tags'])){if(_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x58')]['length']){_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x58')]=_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x58')][_0xc3e7('0x5a')](';')+';';}else{_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x58')]=null;}}else{_0x420dbe[_0xc3e7('0x4b')]['tags']=null;}if(_0x420dbe[_0xc3e7('0x4b')]&&_[_0xc3e7('0x59')](_0x420dbe[_0xc3e7('0x4b')])){for(var _0x2ebb4d=0x0;_0x2ebb4d<_0x420dbe[_0xc3e7('0x4b')][_0xc3e7('0x3b')];_0x2ebb4d+=0x1){_0x420dbe[_0xc3e7('0x4b')][_0x2ebb4d][_0xc3e7('0x53')]=_0x420dbe['params']['id'];_0x443796[_0xc3e7('0x5b')](_0x420dbe['body'][_0x2ebb4d]);}return BPromise[_0xc3e7('0x5c')](_0x443796,function(_0x2d3ba2){return db[_0xc3e7('0x57')]['create'](_[_0xc3e7('0x5d')](_0x2d3ba2,[_0xc3e7('0x56'),'id'])||{},{'fields':_[_0xc3e7('0x34')](_0x40ff4),'raw':!![]})[_0xc3e7('0x26')](function(_0x51c416){_0x116f66[_0xc3e7('0x5e')][_0xc3e7('0x5b')](_0x51c416[_0xc3e7('0x5f')]);})['catch'](function(_0x458efc){_0x116f66[_0xc3e7('0x60')][_0xc3e7('0x5b')]({'data':_0x2d3ba2,'error':_0x458efc[_0xc3e7('0x61')]});});})[_0xc3e7('0x26')](function(_0xd5b996){return _0x116f66;})[_0xc3e7('0x49')](function(_0x3569){return _0x3569;});}else{_0x199d90[_0xc3e7('0x1b')](0x190)[_0xc3e7('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x199d90,null))[_0xc3e7('0x49')](handleError(_0x199d90,null));};exports['getContacts']=function(_0x4e7ac3,_0x50fc06,_0x416007){var _0x3d0a9d;return db[_0xc3e7('0x2f')][_0xc3e7('0x48')]({'where':{'id':_0x4e7ac3[_0xc3e7('0x52')]['id']},'include':[{'model':db[_0xc3e7('0x62')],'as':'CustomFields'}]})[_0xc3e7('0x26')](handleEntityNotFound(_0x50fc06,null))['then'](function(_0x35f16f){if(_0x35f16f){_0x3d0a9d=_0x35f16f;return db[_0xc3e7('0x57')][_0xc3e7('0x30')];}})[_0xc3e7('0x26')](function(_0x5c17a4){if(_0x5c17a4){var _0x1bec73={};var _0x266057={};_0x266057[_0xc3e7('0x38')]=_['concat'](_[_0xc3e7('0x34')](_0x5c17a4),_['map'](_0x3d0a9d[_0xc3e7('0x63')],function(_0x29c464){return util['format'](_0xc3e7('0x64'),_0x29c464['id']);}));_0x266057[_0xc3e7('0x35')]=_[_0xc3e7('0x34')](_0x4e7ac3['query']);_0x266057[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x266057[_0xc3e7('0x38')],_0x266057[_0xc3e7('0x35')]);_0x1bec73['attributes']=_['intersection'](_0x266057[_0xc3e7('0x38')],qs[_0xc3e7('0x3a')](_0x4e7ac3['query'][_0xc3e7('0x3a')]));_0x1bec73[_0xc3e7('0x39')]=_0x1bec73[_0xc3e7('0x39')]['length']?_0x1bec73[_0xc3e7('0x39')]:_0x266057['model'];if(!_0x4e7ac3['query']['hasOwnProperty']('nolimit')){_0x1bec73[_0xc3e7('0x20')]=qs['limit'](_0x4e7ac3[_0xc3e7('0x35')][_0xc3e7('0x20')]);_0x1bec73[_0xc3e7('0x1e')]=qs[_0xc3e7('0x1e')](_0x4e7ac3['query'][_0xc3e7('0x1e')]);}_0x1bec73[_0xc3e7('0x65')]=qs['sort'](_0x4e7ac3[_0xc3e7('0x35')][_0xc3e7('0x3e')]);_0x1bec73[_0xc3e7('0x3f')]=qs[_0xc3e7('0x36')](_[_0xc3e7('0x40')](_0x4e7ac3[_0xc3e7('0x35')],_0x266057[_0xc3e7('0x36')]));_0x1bec73['raw']=!![];if(_0x4e7ac3[_0xc3e7('0x35')][_0xc3e7('0x41')]){_0x1bec73['where']=_['merge'](_0x1bec73['where'],{'$or':_['map'](_0x1bec73[_0xc3e7('0x39')],function(_0xaf6a5a){var _0x50ec44={};_0x50ec44[_0xaf6a5a]={'$like':'%'+_0x4e7ac3[_0xc3e7('0x35')]['filter']+'%'};return _0x50ec44;})});}_0x1bec73=_[_0xc3e7('0x42')]({},_0x1bec73,_0x4e7ac3[_0xc3e7('0x43')]);return _0x3d0a9d[_0xc3e7('0x66')](_0x1bec73);}})[_0xc3e7('0x26')](respondWithResult(_0x50fc06,null))[_0xc3e7('0x49')](handleError(_0x50fc06,null));};exports[_0xc3e7('0x67')]=function(_0xc2b19e,_0x31d390,_0x559577){var _0x3be122;var _0x51ee57;var _0x252257;var _0x37fa7c=_0xc2b19e[_0xc3e7('0x52')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id','name'],'raw':!![],'order':[_0xc3e7('0x68')]})[_0xc3e7('0x26')](function(_0x21168d){_0x3be122=_0x21168d;var _0x4e991b=_[_0xc3e7('0x34')](db[_0xc3e7('0x57')][_0xc3e7('0x30')]);return db[_0xc3e7('0x62')][_0xc3e7('0x46')]({'raw':!![],'attributes':['id',_0xc3e7('0x69')]})[_0xc3e7('0x26')](function(_0x4c4047){_0x51ee57=_0x4c4047;var _0x515897=squel['select']()[_0xc3e7('0x3a')](_0x4e991b)['from'](_0xc3e7('0x6a'),'c')[_0xc3e7('0x3f')](_0xc3e7('0x6b'),_0x37fa7c)['where'](_0xc3e7('0x6c'))[_0xc3e7('0x6d')]();for(var _0x35c4b6=0x0;_0x35c4b6<_0x51ee57['length'];_0x35c4b6++){_0x515897['field'](_0xc3e7('0x6e')+_0x51ee57[_0x35c4b6]['id'],'customField_'+_0x51ee57[_0x35c4b6][_0xc3e7('0x69')]);}for(var _0x35c4b6=0x0;_0x35c4b6<_0x3be122['length'];_0x35c4b6++){_0x515897[_0xc3e7('0x6f')](squel[_0xc3e7('0x70')]()[_0xc3e7('0x6f')](_0xc3e7('0x71'))[_0xc3e7('0x72')](_0xc3e7('0x73'))[_0xc3e7('0x3f')](_0xc3e7('0x74'),_0x3be122[_0x35c4b6]['id'])['where'](_0xc3e7('0x75')),_0xc3e7('0x76')+_0x3be122[_0x35c4b6][_0xc3e7('0x2b')]);_0x515897['field'](squel[_0xc3e7('0x70')]()[_0xc3e7('0x6f')](_0xc3e7('0x77'))['from'](_0xc3e7('0x73'))[_0xc3e7('0x3f')](_0xc3e7('0x74'),_0x3be122[_0x35c4b6]['id'])[_0xc3e7('0x3f')](_0xc3e7('0x75')),'description_additionalPhone_'+_0x3be122[_0x35c4b6][_0xc3e7('0x2b')]);}var _0x302286=[];_0x302286[_0xc3e7('0x5b')](_0x515897['toString']());BPromise['each'](_0x302286,handleQuery)[_0xc3e7('0x26')](function(_0x10ffcb){handleQuery(_0x515897[_0xc3e7('0x78')]());var _0x3a381d=csv_results[0x0];if(!_[_0xc3e7('0x79')](_0x3a381d)){var _0x216908=toCsv(_0x3a381d);var _0x4849db=Date[_0xc3e7('0x7a')]();fs[_0xc3e7('0x7b')](util['format'](_0xc3e7('0x7c'),_0x37fa7c,_0x4849db),_0x216908);_0x31d390[_0xc3e7('0x7d')]('Content-disposition',_0xc3e7('0x7e')+util[_0xc3e7('0x7f')](_0xc3e7('0x80'),_0x37fa7c,_0x4849db));_0x31d390[_0xc3e7('0x7d')]('Content-type',_0xc3e7('0x81'));return _0x31d390[_0xc3e7('0x82')](util[_0xc3e7('0x7f')](_0xc3e7('0x7c'),_0x37fa7c,_0x4849db));}else{return _0x31d390[_0xc3e7('0x1a')](0xcc);}});});});};exports['addCustomField']=function(_0x4ac7ff,_0x2186d3,_0x36ea1b){var _0x172dc1;delete _0x4ac7ff['body']['id'];return db[_0xc3e7('0x2f')][_0xc3e7('0x55')]({'where':{'id':_0x4ac7ff['params']['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x2186d3,null))['then'](function(_0x395bce){if(_0x395bce){return db['sequelize'][_0xc3e7('0x83')](function(_0x312752){return db[_0xc3e7('0x62')][_0xc3e7('0x4a')](_0x4ac7ff[_0xc3e7('0x4b')],{'transaction':_0x312752})[_0xc3e7('0x26')](function(_0x28c033){_0x172dc1=_0x28c033;return _0x395bce['addCustomFields'](_0x28c033,{'transaction':_0x312752});})[_0xc3e7('0x26')](function(){var _0xe5310f={'type':db[_0xc3e7('0x84')][_0xc3e7('0x85')],'transaction':_0x312752};switch(_0x4ac7ff['body'][_0xc3e7('0x32')]){case'text':_0xe5310f['type']=db[_0xc3e7('0x84')]['TEXT'];break;case _0xc3e7('0x86'):_0xe5310f['type']=db['Sequelize'][_0xc3e7('0x87')];break;case _0xc3e7('0x88'):_0xe5310f[_0xc3e7('0x32')]=db[_0xc3e7('0x84')][_0xc3e7('0x89')];_0xe5310f[_0xc3e7('0x8a')]=![];break;default:}return db[_0xc3e7('0x8b')][_0xc3e7('0x8c')][_0xc3e7('0x8d')](_0xc3e7('0x6a'),util['format'](_0xc3e7('0x8e'),_0x172dc1['id']),_0xe5310f);})['then'](function(){return _0x172dc1;});});}})['then'](respondWithResult(_0x2186d3,null))[_0xc3e7('0x49')](handleError(_0x2186d3,null));};exports['getCustomFields']=function(_0x53f189,_0x4be990,_0xd96dad){var _0x1cc618={};var _0x3b1a3e={};var _0x36c81d;var _0x55088b;return db[_0xc3e7('0x2f')][_0xc3e7('0x55')]({'where':{'id':_0x53f189['params']['id']}})['then'](handleEntityNotFound(_0x4be990,null))[_0xc3e7('0x26')](function(_0x51388e){if(_0x51388e){_0x36c81d=_0x51388e;_0x3b1a3e['model']=_[_0xc3e7('0x34')](db[_0xc3e7('0x62')][_0xc3e7('0x30')]);_0x3b1a3e[_0xc3e7('0x35')]=_[_0xc3e7('0x34')](_0x53f189[_0xc3e7('0x35')]);_0x3b1a3e[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x3b1a3e[_0xc3e7('0x38')],_0x3b1a3e['query']);_0x1cc618['attributes']=_['intersection'](_0x3b1a3e['model'],qs[_0xc3e7('0x3a')](_0x53f189['query'][_0xc3e7('0x3a')]));_0x1cc618['attributes']=_0x1cc618[_0xc3e7('0x39')][_0xc3e7('0x3b')]?_0x1cc618[_0xc3e7('0x39')]:_0x3b1a3e['model'];_0x1cc618[_0xc3e7('0x65')]=qs[_0xc3e7('0x3e')](_0x53f189[_0xc3e7('0x35')][_0xc3e7('0x3e')]);_0x1cc618[_0xc3e7('0x3f')]=qs[_0xc3e7('0x36')](_[_0xc3e7('0x40')](_0x53f189['query'],_0x3b1a3e[_0xc3e7('0x36')]));_0x1cc618[_0xc3e7('0x3f')]=_['merge'](_0x1cc618['where'],{'$or':[{'ListId':_0x51388e['id']},{'ListId':null}]});if(_0x53f189[_0xc3e7('0x35')][_0xc3e7('0x41')]){_0x1cc618[_0xc3e7('0x3f')]=_[_0xc3e7('0x42')](_0x1cc618[_0xc3e7('0x3f')],{'$or':_[_0xc3e7('0x2e')](_0x1cc618[_0xc3e7('0x39')],function(_0x6220a6){var _0x7e46c8={};_0x7e46c8[_0x6220a6]={'$like':'%'+_0x53f189[_0xc3e7('0x35')][_0xc3e7('0x41')]+'%'};return _0x7e46c8;})});}_0x1cc618=_[_0xc3e7('0x42')]({},_0x1cc618,_0x53f189['options']);return db[_0xc3e7('0x62')][_0xc3e7('0x8f')](_0x1cc618);}})[_0xc3e7('0x26')](respondWithResult(_0x4be990,null))[_0xc3e7('0x49')](handleError(_0x4be990,null));};exports['getGlobalCustomFields']=function(_0x2d3ec6,_0xd68b9c){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0xc3e7('0x26')](handleEntityNotFound(_0xd68b9c,null))[_0xc3e7('0x26')](function(_0x89166){return _0x89166;})[_0xc3e7('0x26')](respondWithResult(_0xd68b9c,null))[_0xc3e7('0x49')](handleError(_0xd68b9c,null));};exports[_0xc3e7('0x90')]=function(_0x3d579d,_0x5ef270,_0x5af573){return db[_0xc3e7('0x2f')][_0xc3e7('0x48')]({'where':{'id':_0x3d579d[_0xc3e7('0x52')]['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x5ef270,null))[_0xc3e7('0x26')](function(_0x52d325){if(_0x52d325){return _0x52d325[_0xc3e7('0x90')](_0x3d579d[_0xc3e7('0x4b')][_0xc3e7('0x56')],_[_0xc3e7('0x5d')](_0x3d579d[_0xc3e7('0x4b')],[_0xc3e7('0x56'),'id'])||{})[_0xc3e7('0x91')](function(_0x3e91a9){for(var _0x9773f8=0x0;_0x9773f8<_0x3d579d['body'][_0xc3e7('0x56')][_0xc3e7('0x3b')];_0x9773f8+=0x1){socket[_0xc3e7('0x92')](_0xc3e7('0x93'),{'UserId':Number(_0x3d579d[_0xc3e7('0x4b')][_0xc3e7('0x56')][_0x9773f8]),'CmListId':Number(_0x3d579d['params']['id'])});}return _0x3e91a9;});}})['then'](respondWithResult(_0x5ef270,null))[_0xc3e7('0x49')](handleError(_0x5ef270,null));};exports[_0xc3e7('0x94')]=function(_0x536b28,_0x904044,_0x4d9a4b){return db[_0xc3e7('0x2f')]['find']({'where':{'id':_0x536b28['params']['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x904044,null))['then'](function(_0xe70c09){if(_0xe70c09){return _0xe70c09[_0xc3e7('0x94')](_0x536b28[_0xc3e7('0x35')][_0xc3e7('0x56')])['then'](function(){if(_['isArray'](_0x536b28[_0xc3e7('0x35')][_0xc3e7('0x56')])){for(var _0x4bcb90=0x0;_0x4bcb90<_0x536b28[_0xc3e7('0x35')]['ids']['length'];_0x4bcb90+=0x1){socket[_0xc3e7('0x92')](_0xc3e7('0x95'),{'UserId':Number(_0x536b28[_0xc3e7('0x35')][_0xc3e7('0x56')][_0x4bcb90]),'CmListId':Number(_0x536b28['params']['id'])});}}else{socket[_0xc3e7('0x92')](_0xc3e7('0x95'),{'UserId':Number(_0x536b28['query'][_0xc3e7('0x56')]),'CmListId':Number(_0x536b28[_0xc3e7('0x52')]['id'])});}});}})[_0xc3e7('0x26')](respondWithStatusCode(_0x904044,null))['catch'](handleError(_0x904044,null));};exports[_0xc3e7('0x96')]=function(_0x14022b,_0x3e32e9,_0x4e5507){var _0x3697f0={};var _0x13f9c3={};var _0x3ca3c4;var _0x5d8085;return db['CmList'][_0xc3e7('0x55')]({'where':{'id':_0x14022b[_0xc3e7('0x52')]['id']}})[_0xc3e7('0x26')](handleEntityNotFound(_0x3e32e9,null))[_0xc3e7('0x26')](function(_0x782669){if(_0x782669){_0x3ca3c4=_0x782669;_0x13f9c3['model']=_['keys'](db[_0xc3e7('0x97')]['rawAttributes']);_0x13f9c3[_0xc3e7('0x35')]=_['keys'](_0x14022b[_0xc3e7('0x35')]);_0x13f9c3[_0xc3e7('0x36')]=_[_0xc3e7('0x37')](_0x13f9c3[_0xc3e7('0x38')],_0x13f9c3[_0xc3e7('0x35')]);_0x3697f0[_0xc3e7('0x39')]=_['intersection'](_0x13f9c3[_0xc3e7('0x38')],qs[_0xc3e7('0x3a')](_0x14022b['query'][_0xc3e7('0x3a')]));_0x3697f0['attributes']=_0x3697f0[_0xc3e7('0x39')][_0xc3e7('0x3b')]?_0x3697f0[_0xc3e7('0x39')]:_0x13f9c3[_0xc3e7('0x38')];_0x3697f0['order']=qs[_0xc3e7('0x3e')](_0x14022b['query'][_0xc3e7('0x3e')]);_0x3697f0[_0xc3e7('0x3f')]=qs['filters'](_[_0xc3e7('0x40')](_0x14022b['query'],_0x13f9c3[_0xc3e7('0x36')]));if(_0x14022b['query'][_0xc3e7('0x41')]){_0x3697f0['where']=_[_0xc3e7('0x42')](_0x3697f0['where'],{'$or':_[_0xc3e7('0x2e')](_0x3697f0['attributes'],function(_0x2c7526){var _0x3c149e={};_0x3c149e[_0x2c7526]={'$like':'%'+_0x14022b[_0xc3e7('0x35')][_0xc3e7('0x41')]+'%'};return _0x3c149e;})});}_0x3697f0=_[_0xc3e7('0x42')]({},_0x3697f0,_0x14022b['options']);return _0x3ca3c4[_0xc3e7('0x96')](_0x3697f0);}})['then'](function(_0x2d0d15){if(_0x2d0d15){_0x5d8085=_0x2d0d15[_0xc3e7('0x3b')];if(!_0x14022b['query'][_0xc3e7('0x3c')]('nolimit')){_0x3697f0['limit']=qs[_0xc3e7('0x20')](_0x14022b[_0xc3e7('0x35')][_0xc3e7('0x20')]);_0x3697f0['offset']=qs[_0xc3e7('0x1e')](_0x14022b['query'][_0xc3e7('0x1e')]);}return _0x3ca3c4['getAgents'](_0x3697f0);}})['then'](function(_0x30d00c){if(_0x30d00c){return _0x30d00c?{'count':_0x5d8085,'rows':_0x30d00c}:null;}})[_0xc3e7('0x26')](respondWithResult(_0x3e32e9,null))[_0xc3e7('0x49')](handleError(_0x3e32e9,null));};function handleQuery(_0x57bfbe){logger['info'](_0x57bfbe);return db['sequelize'][_0xc3e7('0x35')](_0x57bfbe)[_0xc3e7('0x91')](function(_0x8e5500){csv_results[_0xc3e7('0x5b')](_0x8e5500);})[_0xc3e7('0x49')](function(_0x3ea737){logger[_0xc3e7('0x2a')](_0x3ea737[_0xc3e7('0x61')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index b292c4b..c27e463 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x3add10,_0x457d16){var _0x2da348=function(_0x1fcaa9){while(--_0x1fcaa9){_0x3add10['push'](_0x3add10['shift']());}};_0x2da348(++_0x457d16);}(_0x7217,0x19e));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x5cbfed,_0x2b8ba5){var _0x462d98=function(_0xf4bce9){while(--_0xf4bce9){_0x5cbfed['push'](_0x5cbfed['shift']());}};_0x462d98(++_0x2b8ba5);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 81433d8..d75883d 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 _0x4522=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api','moment','request-promise'];(function(_0x1fb08e,_0x4e2539){var _0x5ce9a2=function(_0x5c5e10){while(--_0x5c5e10){_0x1fb08e['push'](_0x1fb08e['shift']());}};_0x5ce9a2(++_0x4e2539);}(_0x4522,0x1a0));var _0x2452=function(_0x310a77,_0x116413){_0x310a77=_0x310a77-0x0;var _0xc8c73d=_0x4522[_0x310a77];return _0xc8c73d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2452('0x0'))(_0x2452('0x1'));var moment=require(_0x2452('0x2'));var BPromise=require('bluebird');var rp=require(_0x2452('0x3'));var fs=require('fs');var path=require(_0x2452('0x4'));var rimraf=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var attributes=require(_0x2452('0x7'));module[_0x2452('0x8')]=function(_0x15fc69,_0x226578){return _0x15fc69[_0x2452('0x9')](_0x2452('0xa'),attributes,{'tableName':_0x2452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7a=['CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x31435c,_0x56f6eb){_0x31435c=_0x31435c-0x0;var _0x1002eb=_0x6f7a[_0x31435c];return _0x1002eb;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index c8ebf33..b3ead36 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 _0xefd5=['jayson/promise','redis','socket.io-emitter','register','request','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','info','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xefd5,0x117));var _0x5efd=function(_0xed7e14,_0x21465b){_0xed7e14=_0xed7e14-0x0;var _0x46be20=_0xefd5[_0xed7e14];return _0x46be20;};'use strict';var _=require('lodash');var util=require(_0x5efd('0x0'));var moment=require('moment');var BPromise=require(_0x5efd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5efd('0x2'));var db=require(_0x5efd('0x3'))['db'];var utils=require(_0x5efd('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5efd('0x5'));var jayson=require(_0x5efd('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0x5efd('0x7')]=_['defaults'](config[_0x5efd('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x5efd('0x8'))(new Redis(config[_0x5efd('0x7')]));require('./cmList.socket')[_0x5efd('0x9')](socket);function respondWithRpcPromise(_0x14efa4,_0x5418f2,_0x497226){return new BPromise(function(_0x4141d5,_0xc9f60f){return client[_0x5efd('0xa')](_0x14efa4,_0x497226)['then'](function(_0x55a54f){logger['info']('CmList,\x20%s,\x20%s',_0x5418f2,_0x5efd('0xb'));logger[_0x5efd('0xc')](_0x5efd('0xd'),_0x5418f2,'request\x20sent',JSON[_0x5efd('0xe')](_0x55a54f));if(_0x55a54f[_0x5efd('0xf')]){if(_0x55a54f['error']['code']===0x1f4){logger['error'](_0x5efd('0x10'),_0x5418f2,_0x55a54f[_0x5efd('0xf')][_0x5efd('0x11')]);return _0xc9f60f(_0x55a54f[_0x5efd('0xf')][_0x5efd('0x11')]);}logger['error'](_0x5efd('0x10'),_0x5418f2,_0x55a54f['error'][_0x5efd('0x11')]);return _0x4141d5(_0x55a54f['error'][_0x5efd('0x11')]);}else{logger[_0x5efd('0x12')](_0x5efd('0x10'),_0x5418f2,_0x5efd('0xb'));_0x4141d5(_0x55a54f['result'][_0x5efd('0x11')]);}})['catch'](function(_0x53d1a8){logger[_0x5efd('0xf')]('CmList,\x20%s,\x20%s',_0x5418f2,_0x53d1a8);_0xc9f60f(_0x53d1a8);});});} \ No newline at end of file +var _0xc539=['info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x485539,_0x5491b7){var _0x2d3d75=function(_0x46ae89){while(--_0x46ae89){_0x485539['push'](_0x485539['shift']());}};_0x2d3d75(++_0x5491b7);}(_0xc539,0x123));var _0x9c53=function(_0x428e62,_0x4723f7){_0x428e62=_0x428e62-0x0;var _0x454a72=_0xc539[_0x428e62];return _0x454a72;};'use strict';var _=require(_0x9c53('0x0'));var util=require(_0x9c53('0x1'));var moment=require(_0x9c53('0x2'));var BPromise=require(_0x9c53('0x3'));var rs=require(_0x9c53('0x4'));var fs=require('fs');var Redis=require(_0x9c53('0x5'));var db=require(_0x9c53('0x6'))['db'];var utils=require(_0x9c53('0x7'));var logger=require(_0x9c53('0x8'))('rpc');var config=require(_0x9c53('0x9'));var jayson=require(_0x9c53('0xa'));var client=jayson['client'][_0x9c53('0xb')]({'port':0x232a});config['redis']=_[_0x9c53('0xc')](config[_0x9c53('0xd')],{'host':_0x9c53('0xe'),'port':0x18eb});var socket=require(_0x9c53('0xf'))(new Redis(config[_0x9c53('0xd')]));require('./cmList.socket')[_0x9c53('0x10')](socket);function respondWithRpcPromise(_0x153bae,_0x175348,_0x2cf800){return new BPromise(function(_0x4d862b,_0x135414){return client['request'](_0x153bae,_0x2cf800)['then'](function(_0x3f41ba){logger[_0x9c53('0x11')](_0x9c53('0x12'),_0x175348,_0x9c53('0x13'));logger[_0x9c53('0x14')](_0x9c53('0x15'),_0x175348,_0x9c53('0x13'),JSON[_0x9c53('0x16')](_0x3f41ba));if(_0x3f41ba[_0x9c53('0x17')]){if(_0x3f41ba[_0x9c53('0x17')][_0x9c53('0x18')]===0x1f4){logger[_0x9c53('0x17')](_0x9c53('0x12'),_0x175348,_0x3f41ba['error'][_0x9c53('0x19')]);return _0x135414(_0x3f41ba['error']['message']);}logger[_0x9c53('0x17')](_0x9c53('0x12'),_0x175348,_0x3f41ba[_0x9c53('0x17')]['message']);return _0x4d862b(_0x3f41ba[_0x9c53('0x17')][_0x9c53('0x19')]);}else{logger[_0x9c53('0x11')](_0x9c53('0x12'),_0x175348,_0x9c53('0x13'));_0x4d862b(_0x3f41ba[_0x9c53('0x1a')][_0x9c53('0x19')]);}})[_0x9c53('0x1b')](function(_0xefa988){logger[_0x9c53('0x17')]('CmList,\x20%s,\x20%s',_0x175348,_0xefa988);_0x135414(_0xefa988);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 847a63d..5c96707 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 _0xa561=['length','save','remove','update','emit','removeListener','register'];(function(_0x20125e,_0xd9fc0f){var _0x29aaea=function(_0x1dae70){while(--_0x1dae70){_0x20125e['push'](_0x20125e['shift']());}};_0x29aaea(++_0xd9fc0f);}(_0xa561,0xda));var _0x1a56=function(_0x1db43b,_0x47e6f6){_0x1db43b=_0x1db43b-0x0;var _0x4e2d1b=_0xa561[_0x1db43b];return _0x4e2d1b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x1a56('0x0'),_0x1a56('0x1'),_0x1a56('0x2')];function createListener(_0x40c362,_0x3757fb){return function(_0x4a6a1d){_0x3757fb[_0x1a56('0x3')](_0x40c362,_0x4a6a1d);};}function removeListener(_0x13fa23,_0x4886d3){return function(){CmListEvents[_0x1a56('0x4')](_0x13fa23,_0x4886d3);};}exports[_0x1a56('0x5')]=function(_0x4c535a){for(var _0x4a91b6=0x0,_0x5db881=events[_0x1a56('0x6')];_0x4a91b6<_0x5db881;_0x4a91b6++){var _0xef7a5b=events[_0x4a91b6];var _0x45e3d5=createListener('cmList:'+_0xef7a5b,_0x4c535a);CmListEvents['on'](_0xef7a5b,_0x45e3d5);}}; \ No newline at end of file +var _0xcba6=['save','remove','update','removeListener','register','length','cmList:','./cmList.events'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xcba6,0x16f));var _0x6cba=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xcba6[_0x50aa2e];return _0x5e07f0;};'use strict';var CmListEvents=require(_0x6cba('0x0'));var events=[_0x6cba('0x1'),_0x6cba('0x2'),_0x6cba('0x3')];function createListener(_0x52fec2,_0x43eba4){return function(_0xcfe674){_0x43eba4['emit'](_0x52fec2,_0xcfe674);};}function removeListener(_0x2b915a,_0x2956ba){return function(){CmListEvents[_0x6cba('0x4')](_0x2b915a,_0x2956ba);};}exports[_0x6cba('0x5')]=function(_0x369eb3){for(var _0x28689a=0x0,_0x5dac22=events[_0x6cba('0x6')];_0x28689a<_0x5dac22;_0x28689a++){var _0x3e4a0=events[_0x28689a];var _0x5250e0=createListener(_0x6cba('0x7')+_0x3e4a0,_0x369eb3);CmListEvents['on'](_0x3e4a0,_0x5250e0);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 49d30a5..4d0c9bf 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 _0xb95a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','describe','/global_fields','isAuthenticated','getGlobalCustomFields','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','getAgents','post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','delete','destroy','removeDispositions','/:id/users','exports','multer','util','path','connect-timeout','express'];(function(_0x409746,_0x44ad4e){var _0x3faabb=function(_0x2d04b0){while(--_0x2d04b0){_0x409746['push'](_0x409746['shift']());}};_0x3faabb(++_0x44ad4e);}(_0xb95a,0x13b));var _0xab95=function(_0x23045a,_0x339fa4){_0x23045a=_0x23045a-0x0;var _0x16b96f=_0xb95a[_0x23045a];return _0x16b96f;};'use strict';var multer=require(_0xab95('0x0'));var util=require(_0xab95('0x1'));var path=require(_0xab95('0x2'));var timeout=require(_0xab95('0x3'));var express=require(_0xab95('0x4'));var router=express[_0xab95('0x5')]();var fs_extra=require(_0xab95('0x6'));var auth=require(_0xab95('0x7'));var interaction=require(_0xab95('0x8'));var config=require(_0xab95('0x9'));var controller=require(_0xab95('0xa'));router[_0xab95('0xb')]('/',auth['isAuthenticated'](),controller[_0xab95('0xc')]);router[_0xab95('0xb')](_0xab95('0xd'),auth['isAuthenticated'](),controller[_0xab95('0xe')]);router[_0xab95('0xb')](_0xab95('0xf'),auth[_0xab95('0x10')](),controller[_0xab95('0x11')]);router['get']('/:id',auth[_0xab95('0x10')](),controller[_0xab95('0x12')]);router[_0xab95('0xb')]('/:id/dispositions',auth[_0xab95('0x10')](),controller[_0xab95('0x13')]);router[_0xab95('0xb')](_0xab95('0x14'),auth[_0xab95('0x10')](),controller[_0xab95('0x15')]);router[_0xab95('0xb')](_0xab95('0x16'),auth[_0xab95('0x10')](),controller['getContactsCsv']);router[_0xab95('0xb')](_0xab95('0x17'),auth[_0xab95('0x10')](),controller[_0xab95('0x18')]);router[_0xab95('0xb')]('/:id/users',auth[_0xab95('0x10')](),controller[_0xab95('0x19')]);router[_0xab95('0x1a')]('/',auth[_0xab95('0x10')](),controller['create']);router[_0xab95('0x1a')](_0xab95('0x1b'),auth[_0xab95('0x10')](),controller[_0xab95('0x1c')]);router['post'](_0xab95('0x14'),auth['isAuthenticated'](),controller[_0xab95('0x1d')]);router[_0xab95('0x1a')](_0xab95('0x17'),auth[_0xab95('0x10')](),controller[_0xab95('0x1e')]);router['post']('/:id/users',auth[_0xab95('0x10')](),controller[_0xab95('0x1f')]);router[_0xab95('0x20')](_0xab95('0x21'),auth[_0xab95('0x10')](),controller[_0xab95('0x22')]);router[_0xab95('0x23')]('/:id',auth[_0xab95('0x10')](),controller[_0xab95('0x24')]);router[_0xab95('0x23')]('/:id/dispositions',auth[_0xab95('0x10')](),controller[_0xab95('0x25')]);router[_0xab95('0x23')](_0xab95('0x26'),auth[_0xab95('0x10')](),controller['removeAgents']);module[_0xab95('0x27')]=router; \ No newline at end of file +var _0xf56c=['/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','describe','get','/global_fields','getGlobalCustomFields'];(function(_0x5b6205,_0x5cbc3f){var _0x3545dc=function(_0x33ab6d){while(--_0x33ab6d){_0x5b6205['push'](_0x5b6205['shift']());}};_0x3545dc(++_0x5cbc3f);}(_0xf56c,0x106));var _0xcf56=function(_0x596944,_0x30c792){_0x596944=_0x596944-0x0;var _0x4a32b2=_0xf56c[_0x596944];return _0x4a32b2;};'use strict';var multer=require(_0xcf56('0x0'));var util=require(_0xcf56('0x1'));var path=require(_0xcf56('0x2'));var timeout=require(_0xcf56('0x3'));var express=require(_0xcf56('0x4'));var router=express[_0xcf56('0x5')]();var fs_extra=require(_0xcf56('0x6'));var auth=require(_0xcf56('0x7'));var interaction=require(_0xcf56('0x8'));var config=require(_0xcf56('0x9'));var controller=require(_0xcf56('0xa'));router['get']('/',auth[_0xcf56('0xb')](),controller[_0xcf56('0xc')]);router['get'](_0xcf56('0xd'),auth['isAuthenticated'](),controller[_0xcf56('0xe')]);router[_0xcf56('0xf')](_0xcf56('0x10'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x11')]);router['get'](_0xcf56('0x12'),auth[_0xcf56('0xb')](),controller['show']);router[_0xcf56('0xf')](_0xcf56('0x13'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x14')]);router[_0xcf56('0xf')](_0xcf56('0x15'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x16')]);router[_0xcf56('0xf')]('/:id/contacts/csv',auth[_0xcf56('0xb')](),controller['getContactsCsv']);router[_0xcf56('0xf')](_0xcf56('0x17'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x18')]);router[_0xcf56('0xf')]('/:id/users',auth['isAuthenticated'](),controller[_0xcf56('0x19')]);router[_0xcf56('0x1a')]('/',auth['isAuthenticated'](),controller[_0xcf56('0x1b')]);router[_0xcf56('0x1a')](_0xcf56('0x13'),auth['isAuthenticated'](),controller[_0xcf56('0x1c')]);router[_0xcf56('0x1a')](_0xcf56('0x15'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x1d')]);router[_0xcf56('0x1a')](_0xcf56('0x17'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x1e')]);router[_0xcf56('0x1a')](_0xcf56('0x1f'),auth['isAuthenticated'](),controller[_0xcf56('0x20')]);router[_0xcf56('0x21')]('/:id',auth[_0xcf56('0xb')](),controller[_0xcf56('0x22')]);router[_0xcf56('0x23')](_0xcf56('0x12'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x24')]);router[_0xcf56('0x23')](_0xcf56('0x13'),auth[_0xcf56('0xb')](),controller[_0xcf56('0x25')]);router['delete']('/:id/users',auth[_0xcf56('0xb')](),controller[_0xcf56('0x26')]);module[_0xcf56('0x27')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 698d8e8..28ff930 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 _0xcaea=['STRING','sequelize','VIRTUAL','getDataValue','field'];(function(_0x26602f,_0x27b01f){var _0x2c128c=function(_0x3d6d92){while(--_0x3d6d92){_0x26602f['push'](_0x26602f['shift']());}};_0x2c128c(++_0x27b01f);}(_0xcaea,0x146));var _0xacae=function(_0xb0fcd2,_0x4f9069){_0xb0fcd2=_0xb0fcd2-0x0;var _0x326d07=_0xcaea[_0xb0fcd2];return _0x326d07;};'use strict';var Sequelize=require(_0xacae('0x0'));module['exports']={'name':{'type':Sequelize[_0xacae('0x1')],'get':function(_0x431357){return this[_0xacae('0x2')](_0xacae('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xacae('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x6d6a=['field','STRING','sequelize','getDataValue'];(function(_0x141d60,_0x55170a){var _0x34f91a=function(_0x292df1){while(--_0x292df1){_0x141d60['push'](_0x141d60['shift']());}};_0x34f91a(++_0x55170a);}(_0x6d6a,0x132));var _0xa6d6=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x6d6a[_0x5de214];return _0x4df627;};'use strict';var Sequelize=require(_0xa6d6('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2f793f){return this[_0xa6d6('0x1')](_0xa6d6('0x2'));}},'field':{'type':Sequelize[_0xa6d6('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xa6d6('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xa6d6('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 8a5d2d0..7894e47 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x14a608,_0x4a46c8){var _0x1ce418=function(_0x453dd1){while(--_0x453dd1){_0x14a608['push'](_0x14a608['shift']());}};_0x1ce418(++_0x4a46c8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +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(_0x5d9042,_0x58eea4){var _0x36000d=function(_0x4cb298){while(--_0x4cb298){_0x5d9042['push'](_0x5d9042['shift']());}};_0x36000d(++_0x58eea4);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 5d8c1cf..033443f 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 _0x1b09=['request-promise','path','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','util','moment','bluebird'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x1b09,0xbc));var _0x91b0=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x1b09[_0x42ebba];return _0x3fd2af;};'use strict';var _=require(_0x91b0('0x0'));var util=require(_0x91b0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x91b0('0x2'));var BPromise=require(_0x91b0('0x3'));var rp=require(_0x91b0('0x4'));var fs=require('fs');var path=require(_0x91b0('0x5'));var rimraf=require(_0x91b0('0x6'));var config=require(_0x91b0('0x7'));var attributes=require(_0x91b0('0x8'));module['exports']=function(_0x552555,_0x54afcf){return _0x552555[_0x91b0('0x9')](_0x91b0('0xa'),attributes,{'tableName':_0x91b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5de4=['path','../../config/environment','exports','Condition','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x2535cc,_0x228534){var _0x40b1b5=function(_0x3b8d41){while(--_0x3b8d41){_0x2535cc['push'](_0x2535cc['shift']());}};_0x40b1b5(++_0x228534);}(_0x5de4,0x73));var _0x45de=function(_0x20449a,_0x2695f3){_0x20449a=_0x20449a-0x0;var _0x21c665=_0x5de4[_0x20449a];return _0x21c665;};'use strict';var _=require(_0x45de('0x0'));var util=require(_0x45de('0x1'));var logger=require(_0x45de('0x2'))(_0x45de('0x3'));var moment=require(_0x45de('0x4'));var BPromise=require('bluebird');var rp=require(_0x45de('0x5'));var fs=require('fs');var path=require(_0x45de('0x6'));var rimraf=require('rimraf');var config=require(_0x45de('0x7'));var attributes=require('./condition.attributes');module[_0x45de('0x8')]=function(_0x876115,_0x565292){return _0x876115['define'](_0x45de('0x9'),attributes,{'tableName':_0x45de('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 314c986..a44d801 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 _0xc6db=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','Condition,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc6db,0x13a));var _0xbc6d=function(_0x3210f7,_0xecec0e){_0x3210f7=_0x3210f7-0x0;var _0x32f551=_0xc6db[_0x3210f7];return _0x32f551;};'use strict';var _=require(_0xbc6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbc6d('0x1'));var rs=require(_0xbc6d('0x2'));var fs=require('fs');var Redis=require(_0xbc6d('0x3'));var db=require(_0xbc6d('0x4'))['db'];var utils=require(_0xbc6d('0x5'));var logger=require(_0xbc6d('0x6'))('rpc');var config=require(_0xbc6d('0x7'));var jayson=require(_0xbc6d('0x8'));var client=jayson[_0xbc6d('0x9')][_0xbc6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2499f5,_0x1a1da6,_0x5bd0d5){return new BPromise(function(_0xf374c5,_0x69058){return client[_0xbc6d('0xb')](_0x2499f5,_0x5bd0d5)['then'](function(_0x1767fe){logger[_0xbc6d('0xc')]('Condition,\x20%s,\x20%s',_0x1a1da6,_0xbc6d('0xd'));logger[_0xbc6d('0xe')](_0xbc6d('0xf'),_0x1a1da6,'request\x20sent',JSON['stringify'](_0x1767fe));if(_0x1767fe[_0xbc6d('0x10')]){if(_0x1767fe['error']['code']===0x1f4){logger[_0xbc6d('0x10')](_0xbc6d('0x11'),_0x1a1da6,_0x1767fe[_0xbc6d('0x10')][_0xbc6d('0x12')]);return _0x69058(_0x1767fe[_0xbc6d('0x10')][_0xbc6d('0x12')]);}logger[_0xbc6d('0x10')]('Condition,\x20%s,\x20%s',_0x1a1da6,_0x1767fe[_0xbc6d('0x10')][_0xbc6d('0x12')]);return _0xf374c5(_0x1767fe[_0xbc6d('0x10')][_0xbc6d('0x12')]);}else{logger[_0xbc6d('0xc')](_0xbc6d('0x11'),_0x1a1da6,_0xbc6d('0xd'));_0xf374c5(_0x1767fe[_0xbc6d('0x13')][_0xbc6d('0x12')]);}})[_0xbc6d('0x14')](function(_0x19dfd8){logger[_0xbc6d('0x10')](_0xbc6d('0x11'),_0x1a1da6,_0x19dfd8);_0x69058(_0x19dfd8);});});} \ No newline at end of file +var _0x1e36=['jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x72ee00,_0x4f9a0c){var _0x4da881=function(_0x5f1dc2){while(--_0x5f1dc2){_0x72ee00['push'](_0x72ee00['shift']());}};_0x4da881(++_0x4f9a0c);}(_0x1e36,0xfe));var _0x61e3=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x1e36[_0x263a74];return _0x2aa86c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x61e3('0x0'));var BPromise=require(_0x61e3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61e3('0x2'))['db'];var utils=require(_0x61e3('0x3'));var logger=require('../../config/logger')(_0x61e3('0x4'));var config=require(_0x61e3('0x5'));var jayson=require(_0x61e3('0x6'));var client=jayson['client'][_0x61e3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x963609,_0x340941,_0x1ee4a9){return new BPromise(function(_0x717793,_0x3dacdb){return client[_0x61e3('0x8')](_0x963609,_0x1ee4a9)[_0x61e3('0x9')](function(_0x5c1f6d){logger[_0x61e3('0xa')](_0x61e3('0xb'),_0x340941,_0x61e3('0xc'));logger[_0x61e3('0xd')]('Condition,\x20%s,\x20%s,\x20%s',_0x340941,_0x61e3('0xc'),JSON[_0x61e3('0xe')](_0x5c1f6d));if(_0x5c1f6d['error']){if(_0x5c1f6d[_0x61e3('0xf')][_0x61e3('0x10')]===0x1f4){logger[_0x61e3('0xf')]('Condition,\x20%s,\x20%s',_0x340941,_0x5c1f6d[_0x61e3('0xf')][_0x61e3('0x11')]);return _0x3dacdb(_0x5c1f6d[_0x61e3('0xf')][_0x61e3('0x11')]);}logger[_0x61e3('0xf')](_0x61e3('0xb'),_0x340941,_0x5c1f6d['error'][_0x61e3('0x11')]);return _0x717793(_0x5c1f6d[_0x61e3('0xf')][_0x61e3('0x11')]);}else{logger[_0x61e3('0xa')](_0x61e3('0xb'),_0x340941,_0x61e3('0xc'));_0x717793(_0x5c1f6d[_0x61e3('0x12')]['message']);}})[_0x61e3('0x13')](function(_0xf4dfaf){logger[_0x61e3('0xf')](_0x61e3('0xb'),_0x340941,_0xf4dfaf);_0x3dacdb(_0xf4dfaf);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 4326213..403ea24 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 _0x948c=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36ca5d,_0x42813c){var _0x55c164=function(_0x3300c7){while(--_0x3300c7){_0x36ca5d['push'](_0x36ca5d['shift']());}};_0x55c164(++_0x42813c);}(_0x948c,0x172));var _0xc948=function(_0x59987a,_0x399e11){_0x59987a=_0x59987a-0x0;var _0x460646=_0x948c[_0x59987a];return _0x460646;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc948('0x0'));var timeout=require(_0xc948('0x1'));var express=require(_0xc948('0x2'));var router=express[_0xc948('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc948('0x4'));var interaction=require(_0xc948('0x5'));var config=require(_0xc948('0x6'));var controller=require(_0xc948('0x7'));router[_0xc948('0x8')](_0xc948('0x9'),auth[_0xc948('0xa')](),controller[_0xc948('0xb')]);router[_0xc948('0xc')](_0xc948('0x9'),auth[_0xc948('0xa')](),controller[_0xc948('0xd')]);module[_0xc948('0xe')]=router; \ No newline at end of file +var _0x9ec5=['./condition.controller','/:id','isAuthenticated','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0x9ec5,0x84));var _0x59ec=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x9ec5[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require('multer');var util=require(_0x59ec('0x0'));var path=require(_0x59ec('0x1'));var timeout=require(_0x59ec('0x2'));var express=require('express');var router=express[_0x59ec('0x3')]();var fs_extra=require(_0x59ec('0x4'));var auth=require(_0x59ec('0x5'));var interaction=require(_0x59ec('0x6'));var config=require(_0x59ec('0x7'));var controller=require(_0x59ec('0x8'));router['put'](_0x59ec('0x9'),auth[_0x59ec('0xa')](),controller[_0x59ec('0xb')]);router[_0x59ec('0xc')](_0x59ec('0x9'),auth[_0x59ec('0xa')](),controller['destroy']);module[_0x59ec('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index f3737b7..541051f 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 _0x1140=['name','sequelize','exports','STRING'];(function(_0x277cca,_0x2d5c35){var _0x1570be=function(_0x22a631){while(--_0x22a631){_0x277cca['push'](_0x277cca['shift']());}};_0x1570be(++_0x2d5c35);}(_0x1140,0xa5));var _0x0114=function(_0x49f822,_0x56a832){_0x49f822=_0x49f822-0x0;var _0x216caa=_0x1140[_0x49f822];return _0x216caa;};'use strict';var Sequelize=require(_0x0114('0x0'));module[_0x0114('0x1')]={'name':{'type':Sequelize[_0x0114('0x2')],'allowNull':![],'unique':_0x0114('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0114('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2602=['exports','STRING','sequelize'];(function(_0x492875,_0x6c8475){var _0x28ff62=function(_0x5eb3e1){while(--_0x5eb3e1){_0x492875['push'](_0x492875['shift']());}};_0x28ff62(++_0x6c8475);}(_0x2602,0x1ca));var _0x2260=function(_0x3f2d42,_0x118d28){_0x3f2d42=_0x3f2d42-0x0;var _0x542e73=_0x2602[_0x3f2d42];return _0x542e73;};'use strict';var Sequelize=require(_0x2260('0x0'));module[_0x2260('0x1')]={'name':{'type':Sequelize[_0x2260('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2260('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 66eb00d..88b5c8c 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 _0xcf66=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','ContactItemType','rawAttributes','type','key','model','map'];(function(_0x146a18,_0x475229){var _0xe43a45=function(_0x11cbc2){while(--_0x11cbc2){_0x146a18['push'](_0x146a18['shift']());}};_0xe43a45(++_0x475229);}(_0xcf66,0x71));var _0x6cf6=function(_0x3835ab,_0x2c5989){_0x3835ab=_0x3835ab-0x0;var _0x149051=_0xcf66[_0x3835ab];return _0x149051;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['ContactItemType'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='ContactItemTypes';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](db[_0x6cf6('0x4f')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4699d5['params']['id']}}))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));}; \ No newline at end of file +var _0x77e6=['catch','params','intersection','find','create','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','merge','filter','options','include','findAll','rows'];(function(_0x2ea6f5,_0x4adfc4){var _0x2a88b5=function(_0x556500){while(--_0x556500){_0x2ea6f5['push'](_0x2ea6f5['shift']());}};_0x2a88b5(++_0x4adfc4);}(_0x77e6,0x1a6));var _0x677e=function(_0xae535f,_0x1fcdbe){_0xae535f=_0xae535f-0x0;var _0x317d53=_0x77e6[_0xae535f];return _0x317d53;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];function respondWithStatusCode(_0x46a67e,_0x366490){_0x366490=_0x366490||0xcc;return function(_0x2a5f95){if(_0x2a5f95){return _0x46a67e[_0x677e('0x1a')](_0x366490);}return _0x46a67e[_0x677e('0x1b')](_0x366490)['end']();};}function respondWithResult(_0x512631,_0x5c7351){_0x5c7351=_0x5c7351||0xc8;return function(_0x213a50){if(_0x213a50){return _0x512631[_0x677e('0x1b')](_0x5c7351)[_0x677e('0x1c')](_0x213a50);}};}function respondWithFilteredResult(_0x36e976,_0x4daa04){return function(_0x42d0c3){if(_0x42d0c3){var _0x24c9eb=typeof _0x4daa04[_0x677e('0x1d')]===_0x677e('0x1e')&&typeof _0x4daa04[_0x677e('0x1f')]===_0x677e('0x1e');var _0xe4d960=_0x42d0c3['count'];var _0x1c5124=_0x24c9eb?0x0:_0x4daa04[_0x677e('0x1d')];var _0x385b06=_0x24c9eb?_0x42d0c3[_0x677e('0x20')]:_0x4daa04[_0x677e('0x1d')]+_0x4daa04[_0x677e('0x1f')];var _0x52f65d;if(_0x385b06>=_0xe4d960){_0x385b06=_0xe4d960;_0x52f65d=0xc8;}else{_0x52f65d=0xce;}_0x36e976[_0x677e('0x1b')](_0x52f65d);return _0x36e976['set'](_0x677e('0x21'),_0x1c5124+'-'+_0x385b06+'/'+_0xe4d960)[_0x677e('0x1c')](_0x42d0c3);}return null;};}function patchUpdates(_0x26e9c5){return function(_0x593aed){try{jsonpatch[_0x677e('0x22')](_0x593aed,_0x26e9c5,!![]);}catch(_0x1a6122){return BPromise[_0x677e('0x23')](_0x1a6122);}return _0x593aed[_0x677e('0x24')]();};}function saveUpdates(_0x295964,_0x8732e0){return function(_0x3a7895){if(_0x3a7895){return _0x3a7895['update'](_0x295964)['then'](function(_0x52d915){return _0x52d915;});}return null;};}function removeEntity(_0x357466,_0x154fce){return function(_0x31a1e4){if(_0x31a1e4){return _0x31a1e4[_0x677e('0x25')]()[_0x677e('0x26')](function(){var _0x2cda81=_0x31a1e4[_0x677e('0x27')]({'plain':!![]});var _0x42f2b8=_0x677e('0x28');return db[_0x677e('0x29')]['destroy']({'where':{'type':_0x42f2b8,'resourceId':_0x2cda81['id']}})['then'](function(){return _0x31a1e4;});})[_0x677e('0x26')](function(){_0x357466[_0x677e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e39d,_0x264ed3){return function(_0xf6b3ad){if(!_0xf6b3ad){_0x51e39d[_0x677e('0x1a')](0x194);}return _0xf6b3ad;};}function handleError(_0x21a26b,_0x1c0f28){_0x1c0f28=_0x1c0f28||0x1f4;return function(_0x56ad40){logger[_0x677e('0x2a')](_0x56ad40[_0x677e('0x2b')]);if(_0x56ad40[_0x677e('0x2c')]){delete _0x56ad40[_0x677e('0x2c')];}_0x21a26b[_0x677e('0x1b')](_0x1c0f28)[_0x677e('0x2d')](_0x56ad40);};}exports[_0x677e('0x2e')]=function(_0x10eb66,_0x9d49b5){var _0x4c5113={},_0x22ccfb={},_0x3cac19={'count':0x0,'rows':[]};var _0x2fb815=_[_0x677e('0x2f')](db[_0x677e('0x30')][_0x677e('0x31')],function(_0x34bb3d){return{'name':_0x34bb3d[_0x677e('0x32')],'type':_0x34bb3d[_0x677e('0x33')][_0x677e('0x34')]};});_0x22ccfb['model']=_[_0x677e('0x2f')](_0x2fb815,_0x677e('0x2c'));_0x22ccfb[_0x677e('0x35')]=_[_0x677e('0x36')](_0x10eb66[_0x677e('0x35')]);_0x22ccfb[_0x677e('0x37')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],_0x22ccfb[_0x677e('0x35')]);_0x4c5113[_0x677e('0x39')]=_['intersection'](_0x22ccfb[_0x677e('0x38')],qs[_0x677e('0x3a')](_0x10eb66[_0x677e('0x35')][_0x677e('0x3a')]));_0x4c5113[_0x677e('0x39')]=_0x4c5113['attributes'][_0x677e('0x3b')]?_0x4c5113[_0x677e('0x39')]:_0x22ccfb[_0x677e('0x38')];if(!_0x10eb66[_0x677e('0x35')]['hasOwnProperty'](_0x677e('0x3c'))){_0x4c5113[_0x677e('0x1f')]=qs[_0x677e('0x1f')](_0x10eb66['query']['limit']);_0x4c5113[_0x677e('0x1d')]=qs[_0x677e('0x1d')](_0x10eb66['query'][_0x677e('0x1d')]);}_0x4c5113[_0x677e('0x3d')]=qs['sort'](_0x10eb66['query'][_0x677e('0x3e')]);_0x4c5113[_0x677e('0x3f')]=qs['filters'](_['pick'](_0x10eb66[_0x677e('0x35')],_0x22ccfb[_0x677e('0x37')]),_0x2fb815);if(_0x10eb66[_0x677e('0x35')]['filter']){_0x4c5113[_0x677e('0x3f')]=_[_0x677e('0x40')](_0x4c5113[_0x677e('0x3f')],{'$or':_[_0x677e('0x2f')](_0x2fb815,function(_0x6756e8){if(_0x6756e8['type']!=='VIRTUAL'){var _0x15faa3={};_0x15faa3[_0x6756e8[_0x677e('0x2c')]]={'$like':'%'+_0x10eb66[_0x677e('0x35')][_0x677e('0x41')]+'%'};return _0x15faa3;}})});}_0x4c5113=_[_0x677e('0x40')]({},_0x4c5113,_0x10eb66[_0x677e('0x42')]);var _0x1b9a35={'where':_0x4c5113[_0x677e('0x3f')]};return db[_0x677e('0x30')][_0x677e('0x20')](_0x1b9a35)['then'](function(_0x56eb30){_0x3cac19[_0x677e('0x20')]=_0x56eb30;if(_0x10eb66[_0x677e('0x35')]['includeAll']){_0x4c5113[_0x677e('0x43')]=[{'all':!![]}];}return db['ContactItemType'][_0x677e('0x44')](_0x4c5113);})[_0x677e('0x26')](function(_0x283aaa){_0x3cac19[_0x677e('0x45')]=_0x283aaa;return _0x3cac19;})[_0x677e('0x26')](respondWithFilteredResult(_0x9d49b5,_0x4c5113))[_0x677e('0x46')](handleError(_0x9d49b5,null));};exports['show']=function(_0x17fe91,_0x1f2bf5){var _0x2c2fd4={'raw':!![],'where':{'id':_0x17fe91[_0x677e('0x47')]['id']}},_0x33fce2={};_0x33fce2[_0x677e('0x38')]=_['keys'](db[_0x677e('0x30')]['rawAttributes']);_0x33fce2[_0x677e('0x35')]=_[_0x677e('0x36')](_0x17fe91[_0x677e('0x35')]);_0x33fce2[_0x677e('0x37')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],_0x33fce2[_0x677e('0x35')]);_0x2c2fd4[_0x677e('0x39')]=_[_0x677e('0x48')](_0x33fce2[_0x677e('0x38')],qs['fields'](_0x17fe91[_0x677e('0x35')]['fields']));_0x2c2fd4['attributes']=_0x2c2fd4[_0x677e('0x39')][_0x677e('0x3b')]?_0x2c2fd4[_0x677e('0x39')]:_0x33fce2[_0x677e('0x38')];if(_0x17fe91[_0x677e('0x35')]['includeAll']){_0x2c2fd4[_0x677e('0x43')]=[{'all':!![]}];}_0x2c2fd4=_[_0x677e('0x40')]({},_0x2c2fd4,_0x17fe91[_0x677e('0x42')]);return db[_0x677e('0x30')][_0x677e('0x49')](_0x2c2fd4)['then'](handleEntityNotFound(_0x1f2bf5,null))[_0x677e('0x26')](respondWithResult(_0x1f2bf5,null))[_0x677e('0x46')](handleError(_0x1f2bf5,null));};exports[_0x677e('0x4a')]=function(_0x496627,_0x30ed5c){return db['ContactItemType'][_0x677e('0x4a')](_0x496627['body'],{})['then'](function(_0x3bd614){var _0x23f9ec=_0x496627[_0x677e('0x4b')][_0x677e('0x27')]({'plain':!![]});if(!_0x23f9ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f9ec[_0x677e('0x4c')]===_0x677e('0x4b')){var _0x51b2b8=_0x3bd614[_0x677e('0x27')]({'plain':!![]});var _0x558d43=_0x677e('0x28');return db[_0x677e('0x4d')][_0x677e('0x49')]({'where':{'name':_0x558d43,'userProfileId':_0x23f9ec['userProfileId']},'raw':!![]})[_0x677e('0x26')](function(_0x4fa910){if(_0x4fa910&&_0x4fa910['autoAssociation']===0x0){return db[_0x677e('0x29')]['create']({'name':_0x51b2b8[_0x677e('0x2c')],'resourceId':_0x51b2b8['id'],'type':_0x4fa910[_0x677e('0x2c')],'sectionId':_0x4fa910['id']},{})[_0x677e('0x26')](function(){return _0x3bd614;});}else{return _0x3bd614;}})[_0x677e('0x46')](function(_0x410012){logger[_0x677e('0x2a')](_0x677e('0x4e'),_0x410012);throw _0x410012;});}return _0x3bd614;})['then'](respondWithResult(_0x30ed5c,0xc9))['catch'](handleError(_0x30ed5c,null));};exports['update']=function(_0x42799b,_0x3d374d){if(_0x42799b[_0x677e('0x4f')]['id']){delete _0x42799b[_0x677e('0x4f')]['id'];}return db[_0x677e('0x30')][_0x677e('0x49')]({'where':{'id':_0x42799b['params']['id']}})[_0x677e('0x26')](handleEntityNotFound(_0x3d374d,null))[_0x677e('0x26')](saveUpdates(_0x42799b['body'],null))[_0x677e('0x26')](respondWithResult(_0x3d374d,null))['catch'](handleError(_0x3d374d,null));};exports[_0x677e('0x25')]=function(_0x20ae18,_0x284a3a){return db[_0x677e('0x30')]['find']({'where':{'id':_0x20ae18[_0x677e('0x47')]['id']}})['then'](handleEntityNotFound(_0x284a3a,null))[_0x677e('0x26')](db[_0x677e('0x50')][_0x677e('0x51')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x20ae18[_0x677e('0x47')]['id']}}))[_0x677e('0x26')](removeEntity(_0x284a3a,null))['catch'](handleError(_0x284a3a,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index eafb7f6..da5289d 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 _0x9c19=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','util'];(function(_0x1ba969,_0x2d1212){var _0x3c5caf=function(_0x2824f0){while(--_0x2824f0){_0x1ba969['push'](_0x1ba969['shift']());}};_0x3c5caf(++_0x2d1212);}(_0x9c19,0x11d));var _0x99c1=function(_0x23bf40,_0xf05f78){_0x23bf40=_0x23bf40-0x0;var _0x33ca5c=_0x9c19[_0x23bf40];return _0x33ca5c;};'use strict';var _=require('lodash');var util=require(_0x99c1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x99c1('0x1'));var BPromise=require(_0x99c1('0x2'));var rp=require(_0x99c1('0x3'));var fs=require('fs');var path=require(_0x99c1('0x4'));var rimraf=require(_0x99c1('0x5'));var config=require(_0x99c1('0x6'));var attributes=require(_0x99c1('0x7'));module[_0x99c1('0x8')]=function(_0x175fb4,_0x532e8b){return _0x175fb4['define'](_0x99c1('0x9'),attributes,{'tableName':_0x99c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x510e=['exports','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x510e,0xab));var _0xe510=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x510e[_0x456fb1];return _0x4083d6;};'use strict';var _=require(_0xe510('0x0'));var util=require(_0xe510('0x1'));var logger=require(_0xe510('0x2'))('api');var moment=require(_0xe510('0x3'));var BPromise=require('bluebird');var rp=require(_0xe510('0x4'));var fs=require('fs');var path=require(_0xe510('0x5'));var rimraf=require(_0xe510('0x6'));var config=require(_0xe510('0x7'));var attributes=require(_0xe510('0x8'));module[_0xe510('0x9')]=function(_0x4ce7e0,_0x4c9022){return _0x4ce7e0['define'](_0xe510('0xa'),attributes,{'tableName':_0xe510('0xb'),'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 7e1cbb4..7256e76 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 _0xbfda=['http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xbfda,0x193));var _0xabfd=function(_0x1f38c6,_0x428650){_0x1f38c6=_0x1f38c6-0x0;var _0x259367=_0xbfda[_0x1f38c6];return _0x259367;};'use strict';var _=require(_0xabfd('0x0'));var util=require(_0xabfd('0x1'));var moment=require(_0xabfd('0x2'));var BPromise=require(_0xabfd('0x3'));var rs=require(_0xabfd('0x4'));var fs=require('fs');var Redis=require(_0xabfd('0x5'));var db=require(_0xabfd('0x6'))['db'];var utils=require(_0xabfd('0x7'));var logger=require('../../config/logger')(_0xabfd('0x8'));var config=require('../../config/environment');var jayson=require(_0xabfd('0x9'));var client=jayson[_0xabfd('0xa')][_0xabfd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e595e,_0x5c06e0,_0x3ae842){return new BPromise(function(_0x177520,_0x16fef9){return client['request'](_0x3e595e,_0x3ae842)[_0xabfd('0xc')](function(_0x4d82a4){logger[_0xabfd('0xd')](_0xabfd('0xe'),_0x5c06e0,_0xabfd('0xf'));logger[_0xabfd('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x5c06e0,_0xabfd('0xf'),JSON[_0xabfd('0x11')](_0x4d82a4));if(_0x4d82a4[_0xabfd('0x12')]){if(_0x4d82a4[_0xabfd('0x12')][_0xabfd('0x13')]===0x1f4){logger[_0xabfd('0x12')]('ContactItemType,\x20%s,\x20%s',_0x5c06e0,_0x4d82a4[_0xabfd('0x12')][_0xabfd('0x14')]);return _0x16fef9(_0x4d82a4[_0xabfd('0x12')]['message']);}logger[_0xabfd('0x12')](_0xabfd('0xe'),_0x5c06e0,_0x4d82a4[_0xabfd('0x12')]['message']);return _0x177520(_0x4d82a4['error'][_0xabfd('0x14')]);}else{logger[_0xabfd('0xd')](_0xabfd('0xe'),_0x5c06e0,'request\x20sent');_0x177520(_0x4d82a4[_0xabfd('0x15')]['message']);}})[_0xabfd('0x16')](function(_0x336d79){logger[_0xabfd('0x12')](_0xabfd('0xe'),_0x5c06e0,_0x336d79);_0x16fef9(_0x336d79);});});} \ No newline at end of file +var _0x0aae=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x493939,_0x5da63f){var _0x12b109=function(_0xf09a8d){while(--_0xf09a8d){_0x493939['push'](_0x493939['shift']());}};_0x12b109(++_0x5da63f);}(_0x0aae,0x1dd));var _0xe0aa=function(_0x5d25c4,_0x4cff1e){_0x5d25c4=_0x5d25c4-0x0;var _0x317f27=_0x0aae[_0x5d25c4];return _0x317f27;};'use strict';var _=require(_0xe0aa('0x0'));var util=require(_0xe0aa('0x1'));var moment=require(_0xe0aa('0x2'));var BPromise=require(_0xe0aa('0x3'));var rs=require(_0xe0aa('0x4'));var fs=require('fs');var Redis=require(_0xe0aa('0x5'));var db=require(_0xe0aa('0x6'))['db'];var utils=require(_0xe0aa('0x7'));var logger=require(_0xe0aa('0x8'))(_0xe0aa('0x9'));var config=require(_0xe0aa('0xa'));var jayson=require(_0xe0aa('0xb'));var client=jayson[_0xe0aa('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb5ba49,_0x4efcaf,_0x49d318){return new BPromise(function(_0x4114a7,_0x4c10b5){return client[_0xe0aa('0xd')](_0xb5ba49,_0x49d318)[_0xe0aa('0xe')](function(_0x170572){logger[_0xe0aa('0xf')](_0xe0aa('0x10'),_0x4efcaf,_0xe0aa('0x11'));logger['debug'](_0xe0aa('0x12'),_0x4efcaf,_0xe0aa('0x11'),JSON[_0xe0aa('0x13')](_0x170572));if(_0x170572['error']){if(_0x170572['error'][_0xe0aa('0x14')]===0x1f4){logger[_0xe0aa('0x15')](_0xe0aa('0x10'),_0x4efcaf,_0x170572[_0xe0aa('0x15')][_0xe0aa('0x16')]);return _0x4c10b5(_0x170572[_0xe0aa('0x15')]['message']);}logger['error'](_0xe0aa('0x10'),_0x4efcaf,_0x170572['error'][_0xe0aa('0x16')]);return _0x4114a7(_0x170572[_0xe0aa('0x15')][_0xe0aa('0x16')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x4efcaf,_0xe0aa('0x11'));_0x4114a7(_0x170572[_0xe0aa('0x17')]['message']);}})[_0xe0aa('0x18')](function(_0x351c2b){logger['error'](_0xe0aa('0x10'),_0x4efcaf,_0x351c2b);_0x4c10b5(_0x351c2b);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 966972b..dad2a84 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 _0x03fb=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x38b6f7,_0x25b587){var _0x51df22=function(_0x243e87){while(--_0x243e87){_0x38b6f7['push'](_0x38b6f7['shift']());}};_0x51df22(++_0x25b587);}(_0x03fb,0x67));var _0xb03f=function(_0x201621,_0x49d187){_0x201621=_0x201621-0x0;var _0x38c2c0=_0x03fb[_0x201621];return _0x38c2c0;};'use strict';var multer=require(_0xb03f('0x0'));var util=require(_0xb03f('0x1'));var path=require(_0xb03f('0x2'));var timeout=require(_0xb03f('0x3'));var express=require('express');var router=express[_0xb03f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb03f('0x5'));var config=require(_0xb03f('0x6'));var controller=require(_0xb03f('0x7'));router[_0xb03f('0x8')]('/',auth[_0xb03f('0x9')](),controller[_0xb03f('0xa')]);router[_0xb03f('0x8')](_0xb03f('0xb'),auth[_0xb03f('0x9')](),controller[_0xb03f('0xc')]);router['post']('/',auth[_0xb03f('0x9')](),controller[_0xb03f('0xd')]);router[_0xb03f('0xe')](_0xb03f('0xb'),auth[_0xb03f('0x9')](),controller[_0xb03f('0xf')]);router['delete'](_0xb03f('0xb'),auth[_0xb03f('0x9')](),controller[_0xb03f('0x10')]);module[_0xb03f('0x11')]=router; \ No newline at end of file +var _0xb1ba=['../../config/environment','./contactItemType.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','express','../../components/auth/service'];(function(_0x149cdc,_0x3312f8){var _0x3b7a45=function(_0x1f7b1b){while(--_0x1f7b1b){_0x149cdc['push'](_0x149cdc['shift']());}};_0x3b7a45(++_0x3312f8);}(_0xb1ba,0xd9));var _0xab1b=function(_0x5c3652,_0x277e43){_0x5c3652=_0x5c3652-0x0;var _0x586164=_0xb1ba[_0x5c3652];return _0x586164;};'use strict';var multer=require(_0xab1b('0x0'));var util=require(_0xab1b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab1b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xab1b('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xab1b('0x4'));var controller=require(_0xab1b('0x5'));router[_0xab1b('0x6')]('/',auth['isAuthenticated'](),controller[_0xab1b('0x7')]);router['get'](_0xab1b('0x8'),auth[_0xab1b('0x9')](),controller[_0xab1b('0xa')]);router[_0xab1b('0xb')]('/',auth[_0xab1b('0x9')](),controller[_0xab1b('0xc')]);router['put'](_0xab1b('0x8'),auth[_0xab1b('0x9')](),controller[_0xab1b('0xd')]);router[_0xab1b('0xe')](_0xab1b('0x8'),auth[_0xab1b('0x9')](),controller[_0xab1b('0xf')]);module[_0xab1b('0x10')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 842a20b..c410cec 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x5ae7a9,_0xd31bb0){var _0x11a589=function(_0x5970e0){while(--_0x5970e0){_0x5ae7a9['push'](_0x5ae7a9['shift']());}};_0x11a589(++_0xd31bb0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 990c250..1946906 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 _0xcf24=['redis','defaults','socket.io-emitter','register','sendStatus','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','error','clone','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','web-report','reportType','attrReport','attrRefresh','stringify','addItem','DashboardId','getItems','findOne','DashboardItem','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x48290a,_0x1fbbe6){var _0x1f7cc5=function(_0x48907c){while(--_0x48907c){_0x48290a['push'](_0x48290a['shift']());}};_0x1f7cc5(++_0x1fbbe6);}(_0xcf24,0x175));var _0x4cf2=function(_0x593aa3,_0x37aa58){_0x593aa3=_0x593aa3-0x0;var _0x18f704=_0xcf24[_0x593aa3];return _0x18f704;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cf2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cf2('0x1'));var rp=require(_0x4cf2('0x2'));var moment=require(_0x4cf2('0x3'));var BPromise=require(_0x4cf2('0x4'));var Mustache=require(_0x4cf2('0x5'));var util=require(_0x4cf2('0x6'));var path=require(_0x4cf2('0x7'));var sox=require(_0x4cf2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4cf2('0x9'));var _=require('lodash');var squel=require(_0x4cf2('0xa'));var crypto=require(_0x4cf2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4cf2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4cf2('0xd'));var Papa=require(_0x4cf2('0xe'));var Redis=require(_0x4cf2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4cf2('0x10'));var as=require(_0x4cf2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cf2('0x12'))('api');var utils=require(_0x4cf2('0x13'));var config=require(_0x4cf2('0x14'));var licenseUtil=require(_0x4cf2('0x15'));var db=require(_0x4cf2('0x16'))['db'];config[_0x4cf2('0x17')]=_[_0x4cf2('0x18')](config[_0x4cf2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4cf2('0x19'))(new Redis(config[_0x4cf2('0x17')]));require('./dashboard.socket')[_0x4cf2('0x1a')](socket);function respondWithStatusCode(_0x13b45c,_0x16633a){_0x16633a=_0x16633a||0xcc;return function(_0x175e38){if(_0x175e38){return _0x13b45c[_0x4cf2('0x1b')](_0x16633a);}return _0x13b45c[_0x4cf2('0x1c')](_0x16633a)['end']();};}function respondWithResult(_0x4ef20f,_0x366fd4){_0x366fd4=_0x366fd4||0xc8;return function(_0x456f13){if(_0x456f13){return _0x4ef20f[_0x4cf2('0x1c')](_0x366fd4)['json'](_0x456f13);}};}function respondWithFilteredResult(_0x59000b,_0x4ab750){return function(_0x2040d9){if(_0x2040d9){var _0xe12b86=typeof _0x4ab750['offset']===_0x4cf2('0x1d')&&typeof _0x4ab750[_0x4cf2('0x1e')]===_0x4cf2('0x1d');var _0x343e47=_0x2040d9[_0x4cf2('0x1f')];var _0x51d992=_0xe12b86?0x0:_0x4ab750[_0x4cf2('0x20')];var _0x5092e9=_0xe12b86?_0x2040d9['count']:_0x4ab750[_0x4cf2('0x20')]+_0x4ab750[_0x4cf2('0x1e')];var _0x5be6a8;if(_0x5092e9>=_0x343e47){_0x5092e9=_0x343e47;_0x5be6a8=0xc8;}else{_0x5be6a8=0xce;}_0x59000b[_0x4cf2('0x1c')](_0x5be6a8);return _0x59000b[_0x4cf2('0x21')](_0x4cf2('0x22'),_0x51d992+'-'+_0x5092e9+'/'+_0x343e47)['json'](_0x2040d9);}return null;};}function patchUpdates(_0x133ac8){return function(_0x4dfe2a){try{jsonpatch[_0x4cf2('0x23')](_0x4dfe2a,_0x133ac8,!![]);}catch(_0x3c508c){return BPromise[_0x4cf2('0x24')](_0x3c508c);}return _0x4dfe2a[_0x4cf2('0x25')]();};}function saveUpdates(_0x12d79e,_0x1fac23){return function(_0x1892e6){if(_0x1892e6){return _0x1892e6[_0x4cf2('0x26')](_0x12d79e)[_0x4cf2('0x27')](function(_0x36e83f){return _0x36e83f;});}return null;};}function removeEntity(_0x5dedcc,_0x80845a){return function(_0x290a75){if(_0x290a75){return _0x290a75[_0x4cf2('0x28')]()[_0x4cf2('0x27')](function(){var _0x52424a=_0x290a75[_0x4cf2('0x29')]({'plain':!![]});var _0x250ff8='CustomDashboards';return db[_0x4cf2('0x2a')][_0x4cf2('0x28')]({'where':{'type':_0x250ff8,'resourceId':_0x52424a['id']}})[_0x4cf2('0x27')](function(){return _0x290a75;});})[_0x4cf2('0x27')](function(){_0x5dedcc[_0x4cf2('0x1c')](0xcc)[_0x4cf2('0x2b')]();});}};}function handleEntityNotFound(_0x343f8d,_0xa859b2){return function(_0x4fd702){if(!_0x4fd702){_0x343f8d[_0x4cf2('0x1b')](0x194);}return _0x4fd702;};}function handleError(_0x2eed1c,_0x2c6d3d){_0x2c6d3d=_0x2c6d3d||0x1f4;return function(_0x34b090){logger['error'](_0x34b090[_0x4cf2('0x2c')]);if(_0x34b090[_0x4cf2('0x2d')]){delete _0x34b090[_0x4cf2('0x2d')];}_0x2eed1c['status'](_0x2c6d3d)[_0x4cf2('0x2e')](_0x34b090);};}exports[_0x4cf2('0x2f')]=function(_0x1b265c,_0x1dc2b4){var _0x478b11={},_0x180c94={},_0xa12256={'count':0x0,'rows':[]};var _0x2d7243=_[_0x4cf2('0x30')](db[_0x4cf2('0x31')][_0x4cf2('0x32')],function(_0x4ef6e7){return{'name':_0x4ef6e7[_0x4cf2('0x33')],'type':_0x4ef6e7['type'][_0x4cf2('0x34')]};});_0x180c94[_0x4cf2('0x35')]=_[_0x4cf2('0x30')](_0x2d7243,'name');_0x180c94['query']=_[_0x4cf2('0x36')](_0x1b265c[_0x4cf2('0x37')]);_0x180c94[_0x4cf2('0x38')]=_[_0x4cf2('0x39')](_0x180c94[_0x4cf2('0x35')],_0x180c94['query']);_0x478b11[_0x4cf2('0x3a')]=_[_0x4cf2('0x39')](_0x180c94[_0x4cf2('0x35')],qs[_0x4cf2('0x3b')](_0x1b265c[_0x4cf2('0x37')]['fields']));_0x478b11[_0x4cf2('0x3a')]=_0x478b11[_0x4cf2('0x3a')][_0x4cf2('0x3c')]?_0x478b11['attributes']:_0x180c94[_0x4cf2('0x35')];if(!_0x1b265c[_0x4cf2('0x37')][_0x4cf2('0x3d')](_0x4cf2('0x3e'))){_0x478b11[_0x4cf2('0x1e')]=qs[_0x4cf2('0x1e')](_0x1b265c[_0x4cf2('0x37')]['limit']);_0x478b11['offset']=qs[_0x4cf2('0x20')](_0x1b265c[_0x4cf2('0x37')][_0x4cf2('0x20')]);}_0x478b11[_0x4cf2('0x3f')]=qs[_0x4cf2('0x40')](_0x1b265c[_0x4cf2('0x37')][_0x4cf2('0x40')]);_0x478b11[_0x4cf2('0x41')]=qs[_0x4cf2('0x38')](_[_0x4cf2('0x42')](_0x1b265c[_0x4cf2('0x37')],_0x180c94[_0x4cf2('0x38')]),_0x2d7243);if(_0x1b265c[_0x4cf2('0x37')][_0x4cf2('0x43')]){_0x478b11[_0x4cf2('0x41')]=_['merge'](_0x478b11[_0x4cf2('0x41')],{'$or':_['map'](_0x2d7243,function(_0x38a206){if(_0x38a206['type']!==_0x4cf2('0x44')){var _0x2a060d={};_0x2a060d[_0x38a206[_0x4cf2('0x2d')]]={'$like':'%'+_0x1b265c['query'][_0x4cf2('0x43')]+'%'};return _0x2a060d;}})});}_0x478b11=_[_0x4cf2('0x45')]({},_0x478b11,_0x1b265c[_0x4cf2('0x46')]);var _0x4b04b8={'where':_0x478b11[_0x4cf2('0x41')]};return db[_0x4cf2('0x31')]['count'](_0x4b04b8)[_0x4cf2('0x27')](function(_0x6df719){_0xa12256['count']=_0x6df719;if(_0x1b265c['query'][_0x4cf2('0x47')]){_0x478b11[_0x4cf2('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x478b11);})[_0x4cf2('0x27')](function(_0x25f42c){_0xa12256[_0x4cf2('0x49')]=_0x25f42c;return _0xa12256;})[_0x4cf2('0x27')](respondWithFilteredResult(_0x1dc2b4,_0x478b11))[_0x4cf2('0x4a')](handleError(_0x1dc2b4,null));};exports[_0x4cf2('0x4b')]=function(_0x53b3c2,_0x51b8e8){var _0xb7b161={'raw':![],'where':{'id':_0x53b3c2[_0x4cf2('0x4c')]['id']}},_0x12eb95={};_0x12eb95['model']=_[_0x4cf2('0x36')](db[_0x4cf2('0x31')]['rawAttributes']);_0x12eb95[_0x4cf2('0x37')]=_[_0x4cf2('0x36')](_0x53b3c2[_0x4cf2('0x37')]);_0x12eb95[_0x4cf2('0x38')]=_[_0x4cf2('0x39')](_0x12eb95[_0x4cf2('0x35')],_0x12eb95['query']);_0xb7b161['attributes']=_[_0x4cf2('0x39')](_0x12eb95[_0x4cf2('0x35')],qs['fields'](_0x53b3c2['query'][_0x4cf2('0x3b')]));_0xb7b161[_0x4cf2('0x3a')]=_0xb7b161['attributes'][_0x4cf2('0x3c')]?_0xb7b161['attributes']:_0x12eb95[_0x4cf2('0x35')];if(_0x53b3c2[_0x4cf2('0x37')]['includeAll']){_0xb7b161[_0x4cf2('0x48')]=[{'all':!![]}];}_0xb7b161=_['merge']({},_0xb7b161,_0x53b3c2[_0x4cf2('0x46')]);return db['Dashboard'][_0x4cf2('0x4d')](_0xb7b161)[_0x4cf2('0x27')](handleEntityNotFound(_0x51b8e8,null))[_0x4cf2('0x27')](respondWithResult(_0x51b8e8,null))[_0x4cf2('0x4a')](handleError(_0x51b8e8,null));};exports['create']=function(_0x2081b0,_0x23c409){return db[_0x4cf2('0x31')]['create'](_0x2081b0[_0x4cf2('0x4e')],{})[_0x4cf2('0x27')](function(_0x40cb96){var _0x51aab8=_0x2081b0[_0x4cf2('0x4f')][_0x4cf2('0x29')]({'plain':!![]});if(!_0x51aab8)throw new Error(_0x4cf2('0x50'));if(_0x51aab8[_0x4cf2('0x51')]==='user'){var _0x5a72ba=_0x40cb96[_0x4cf2('0x29')]({'plain':!![]});var _0x3a3c0a='CustomDashboards';return db['UserProfileSection'][_0x4cf2('0x4d')]({'where':{'name':_0x3a3c0a,'userProfileId':_0x51aab8[_0x4cf2('0x52')]},'raw':!![]})[_0x4cf2('0x27')](function(_0x43921f){if(_0x43921f&&_0x43921f[_0x4cf2('0x53')]===0x0){return db[_0x4cf2('0x2a')][_0x4cf2('0x54')]({'name':_0x5a72ba[_0x4cf2('0x2d')],'resourceId':_0x5a72ba['id'],'type':_0x43921f[_0x4cf2('0x2d')],'sectionId':_0x43921f['id']},{})[_0x4cf2('0x27')](function(){return _0x40cb96;});}else{return _0x40cb96;}})[_0x4cf2('0x4a')](function(_0x3ad9c5){logger[_0x4cf2('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ad9c5);throw _0x3ad9c5;});}return _0x40cb96;})['then'](respondWithResult(_0x23c409,0xc9))[_0x4cf2('0x4a')](handleError(_0x23c409,null));};exports[_0x4cf2('0x56')]=function(_0x31359e,_0x3ac0aa){var _0x52d4c1={'where':{'id':_0x31359e[_0x4cf2('0x4c')]['id']}},_0x18d72f={};_0x18d72f[_0x4cf2('0x35')]=_[_0x4cf2('0x36')](db['Dashboard']['rawAttributes']);_0x52d4c1[_0x4cf2('0x3a')]=_[_0x4cf2('0x39')](_0x18d72f[_0x4cf2('0x35')],qs['fields'](_0x31359e[_0x4cf2('0x37')][_0x4cf2('0x3b')]));_0x52d4c1['attributes']=_0x52d4c1[_0x4cf2('0x3a')][_0x4cf2('0x3c')]?_0x52d4c1[_0x4cf2('0x3a')]:_0x18d72f[_0x4cf2('0x35')];if(_0x31359e[_0x4cf2('0x37')][_0x4cf2('0x47')]){_0x52d4c1[_0x4cf2('0x48')]=[{'all':!![]}];}_0x52d4c1=_[_0x4cf2('0x45')]({},_0x52d4c1,_0x31359e[_0x4cf2('0x46')]);return db[_0x4cf2('0x31')][_0x4cf2('0x4d')](_0x52d4c1)[_0x4cf2('0x27')](handleEntityNotFound(_0x3ac0aa,null))[_0x4cf2('0x27')](function(_0x25e006){if(_0x25e006){var _0x2baa37=_0x25e006[_0x4cf2('0x29')]({'plain':!![]});_0x2baa37=qs[_0x4cf2('0x57')](_0x2baa37,['id',_0x4cf2('0x58'),_0x4cf2('0x59')]);_0x31359e[_0x4cf2('0x4e')]=_[_0x4cf2('0x57')](_0x31359e['body'],['id',_0x4cf2('0x58'),_0x4cf2('0x59')]);return db['Dashboard'][_0x4cf2('0x54')](_[_0x4cf2('0x45')](_0x2baa37,_0x31359e['body']),{'include':_0x31359e[_0x4cf2('0x37')][_0x4cf2('0x47')]?[{'all':!![]}]:undefined})[_0x4cf2('0x27')](function(_0x169ca6){var _0x1fc2b1=_0x31359e[_0x4cf2('0x4f')]['get']({'plain':!![]});if(!_0x1fc2b1)throw new Error(_0x4cf2('0x50'));if(_0x1fc2b1[_0x4cf2('0x51')]===_0x4cf2('0x4f')){var _0x1008bd=_0x169ca6[_0x4cf2('0x29')]({'plain':!![]});var _0x594f86='CustomDashboards';return db[_0x4cf2('0x5a')]['find']({'where':{'name':_0x594f86,'userProfileId':_0x1fc2b1['userProfileId']},'raw':!![]})[_0x4cf2('0x27')](function(_0x277424){if(_0x277424&&_0x277424[_0x4cf2('0x53')]===0x0){return db['UserProfileResource'][_0x4cf2('0x54')]({'name':_0x1008bd[_0x4cf2('0x2d')],'resourceId':_0x1008bd['id'],'type':_0x277424[_0x4cf2('0x2d')],'sectionId':_0x277424['id']},{})[_0x4cf2('0x27')](function(){return _0x169ca6;});}else{return _0x169ca6;}})[_0x4cf2('0x4a')](function(_0x3238ad){logger[_0x4cf2('0x55')](_0x4cf2('0x5b'),_0x3238ad);throw _0x3238ad;});}return _0x169ca6;});}})[_0x4cf2('0x27')](respondWithResult(_0x3ac0aa,0xc9))['catch'](handleError(_0x3ac0aa,null));};exports['update']=function(_0x584e26,_0x41cee4){if(_0x584e26['body']['id']){delete _0x584e26[_0x4cf2('0x4e')]['id'];}return db[_0x4cf2('0x31')]['find']({'where':{'id':_0x584e26['params']['id']}})[_0x4cf2('0x27')](handleEntityNotFound(_0x41cee4,null))[_0x4cf2('0x27')](saveUpdates(_0x584e26[_0x4cf2('0x4e')],null))[_0x4cf2('0x27')](respondWithResult(_0x41cee4,null))[_0x4cf2('0x4a')](handleError(_0x41cee4,null));};exports[_0x4cf2('0x28')]=function(_0x1a14bb,_0x1f5f4c){return db[_0x4cf2('0x31')][_0x4cf2('0x4d')]({'where':{'id':_0x1a14bb['params']['id']}})[_0x4cf2('0x27')](handleEntityNotFound(_0x1f5f4c,null))[_0x4cf2('0x27')](removeEntity(_0x1f5f4c,null))[_0x4cf2('0x4a')](handleError(_0x1f5f4c,null));};function widgetAttributes(_0x469691){try{switch(_0x469691[_0x4cf2('0x5c')]){case _0x4cf2('0x5d'):return[{'name':'attrUrl','value':_0x469691[_0x4cf2('0x5e')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691[_0x4cf2('0x5f')][0x0][_0x4cf2('0x60')]:undefined)||_0x4cf2('0x61')}];case _0x4cf2('0x62'):return[{'name':'attrPath','value':_0x469691[_0x4cf2('0x63')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691[_0x4cf2('0x5f')][0x0]['value']:undefined)||''}];case _0x4cf2('0x64'):return[{'name':'attrHourFormat','value':_0x469691[_0x4cf2('0x65')]||(_0x469691['attrs']&&_0x469691['attrs'][0x0]?_0x469691[_0x4cf2('0x5f')][0x0][_0x4cf2('0x60')]:undefined)||_0x4cf2('0x66')},{'name':_0x4cf2('0x67'),'value':_0x469691[_0x4cf2('0x67')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x1]?_0x469691[_0x4cf2('0x5f')][0x1]['value']:undefined)||_0x4cf2('0x68')},{'name':_0x4cf2('0x69'),'value':_0x469691[_0x4cf2('0x69')]||(_0x469691['attrs']&&_0x469691[_0x4cf2('0x5f')][0x2]?_0x469691['attrs'][0x2][_0x4cf2('0x60')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x469691[_0x4cf2('0x6a')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691[_0x4cf2('0x5f')][0x0][_0x4cf2('0x60')]:undefined)||_0x4cf2('0x6b')},{'name':_0x4cf2('0x6c'),'value':_0x469691[_0x4cf2('0x6c')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x1]?_0x469691[_0x4cf2('0x5f')][0x1][_0x4cf2('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x469691[_0x4cf2('0x69')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x2]?_0x469691[_0x4cf2('0x5f')][0x2][_0x4cf2('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x469691[_0x4cf2('0x6d')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x3]?_0x469691[_0x4cf2('0x5f')][0x3][_0x4cf2('0x60')]:undefined)||_0x4cf2('0x6e')},{'name':'attrEmailAccounts','value':_0x469691['attrEmailAccounts']||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x4]?_0x469691[_0x4cf2('0x5f')][0x4][_0x4cf2('0x60')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x469691[_0x4cf2('0x6f')]||(_0x469691['attrs']&&_0x469691[_0x4cf2('0x5f')][0x5]?_0x469691[_0x4cf2('0x5f')][0x5][_0x4cf2('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x469691[_0x4cf2('0x70')]||(_0x469691['attrs']&&_0x469691[_0x4cf2('0x5f')][0x6]?_0x469691[_0x4cf2('0x5f')][0x6][_0x4cf2('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x469691[_0x4cf2('0x71')]||(_0x469691['attrs']&&_0x469691[_0x4cf2('0x5f')][0x7]?_0x469691[_0x4cf2('0x5f')][0x7][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x72'),'value':_0x469691[_0x4cf2('0x72')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691['attrs'][0x8]?_0x469691[_0x4cf2('0x5f')][0x8][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x73'),'value':_0x469691['attrChatWebsites']||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x9]?_0x469691['attrs'][0x9][_0x4cf2('0x60')]:undefined)||''}];case _0x4cf2('0x74'):case _0x4cf2('0x75'):return[{'name':_0x4cf2('0x76'),'value':_0x469691['attrSerie1']||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691[_0x4cf2('0x5f')][0x0][_0x4cf2('0x60')]:undefined)||_0x4cf2('0x6b')},{'name':_0x4cf2('0x77'),'value':_0x469691['attrSerie2']||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x1]?_0x469691[_0x4cf2('0x5f')][0x1]['value']:undefined)||null},{'name':_0x4cf2('0x78'),'value':_0x469691[_0x4cf2('0x78')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x2]?_0x469691[_0x4cf2('0x5f')][0x2]['value']:undefined)||null},{'name':_0x4cf2('0x6c'),'value':_0x469691[_0x4cf2('0x6c')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x3]?_0x469691[_0x4cf2('0x5f')][0x3]['value']:undefined)||[]},{'name':_0x4cf2('0x6d'),'value':_0x469691[_0x4cf2('0x6d')]||(_0x469691['attrs']&&_0x469691['attrs'][0x4]?_0x469691['attrs'][0x4][_0x4cf2('0x60')]:undefined)||'voice'},{'name':_0x4cf2('0x79'),'value':_0x469691[_0x4cf2('0x79')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x5]?_0x469691[_0x4cf2('0x5f')][0x5][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x6f'),'value':_0x469691['attrFaxAccounts']||(_0x469691['attrs']&&_0x469691[_0x4cf2('0x5f')][0x6]?_0x469691['attrs'][0x6][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x70'),'value':_0x469691[_0x4cf2('0x70')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x7]?_0x469691['attrs'][0x7][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x71'),'value':_0x469691[_0x4cf2('0x71')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x8]?_0x469691[_0x4cf2('0x5f')][0x8][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x72'),'value':_0x469691[_0x4cf2('0x72')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x9]?_0x469691[_0x4cf2('0x5f')][0x9][_0x4cf2('0x60')]:undefined)||''},{'name':_0x4cf2('0x73'),'value':_0x469691[_0x4cf2('0x73')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0xa]?_0x469691[_0x4cf2('0x5f')][0xa][_0x4cf2('0x60')]:undefined)||''}];case _0x4cf2('0x7a'):return[{'name':'attrReport','type':_0x469691[_0x4cf2('0x7b')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691['attrs'][0x0]['type']:undefined)||null,'value':_0x469691[_0x4cf2('0x7c')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691[_0x4cf2('0x5f')][0x0]?_0x469691['attrs'][0x0]['value']:undefined)||null},{'name':_0x4cf2('0x7d'),'value':_0x469691[_0x4cf2('0x7d')]||(_0x469691[_0x4cf2('0x5f')]&&_0x469691['attrs'][0x1]?_0x469691[_0x4cf2('0x5f')][0x1][_0x4cf2('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x51e247){logger[_0x4cf2('0x55')]('widgetAttributes:\x20%s',JSON[_0x4cf2('0x7e')](_0x51e247));return[];}}exports[_0x4cf2('0x7f')]=function(_0x2c4704,_0x17068b,_0x3f0d23){if(_0x2c4704['body']['id']){delete _0x2c4704[_0x4cf2('0x4e')]['id'];}return db[_0x4cf2('0x31')][_0x4cf2('0x4d')]({'where':{'id':_0x2c4704[_0x4cf2('0x4c')]['id']}})[_0x4cf2('0x27')](handleEntityNotFound(_0x17068b,null))[_0x4cf2('0x27')](function(_0x472518){if(_0x472518){_0x2c4704[_0x4cf2('0x4e')][_0x4cf2('0x80')]=_0x472518['id'];_0x2c4704[_0x4cf2('0x4e')][_0x4cf2('0x5f')]=widgetAttributes(_0x2c4704[_0x4cf2('0x4e')]);return db['DashboardItem'][_0x4cf2('0x54')](_0x2c4704['body']);}})[_0x4cf2('0x27')](respondWithResult(_0x17068b,null))['catch'](handleError(_0x17068b,null));};exports[_0x4cf2('0x81')]=function(_0x268d02,_0x2adaee,_0x30e082){var _0x453ef9={};var _0x570f15={};var _0x337325;var _0x9c887f;return db[_0x4cf2('0x31')][_0x4cf2('0x82')]({'where':{'id':_0x268d02['params']['id']}})[_0x4cf2('0x27')](handleEntityNotFound(_0x2adaee,null))[_0x4cf2('0x27')](function(_0x2f55b6){if(_0x2f55b6){_0x337325=_0x2f55b6;_0x570f15[_0x4cf2('0x35')]=_['keys'](db[_0x4cf2('0x83')][_0x4cf2('0x32')]);_0x570f15['query']=_[_0x4cf2('0x36')](_0x268d02[_0x4cf2('0x37')]);_0x570f15['filters']=_[_0x4cf2('0x39')](_0x570f15[_0x4cf2('0x35')],_0x570f15[_0x4cf2('0x37')]);_0x453ef9['attributes']=_[_0x4cf2('0x39')](_0x570f15[_0x4cf2('0x35')],qs[_0x4cf2('0x3b')](_0x268d02[_0x4cf2('0x37')][_0x4cf2('0x3b')]));_0x453ef9['attributes']=_0x453ef9[_0x4cf2('0x3a')][_0x4cf2('0x3c')]?_0x453ef9[_0x4cf2('0x3a')]:_0x570f15[_0x4cf2('0x35')];_0x453ef9[_0x4cf2('0x3f')]=qs[_0x4cf2('0x40')](_0x268d02[_0x4cf2('0x37')]['sort']);_0x453ef9[_0x4cf2('0x41')]=qs[_0x4cf2('0x38')](_['pick'](_0x268d02[_0x4cf2('0x37')],_0x570f15[_0x4cf2('0x38')]));if(_0x268d02[_0x4cf2('0x37')][_0x4cf2('0x43')]){_0x453ef9['where']=_[_0x4cf2('0x45')](_0x453ef9[_0x4cf2('0x41')],{'$or':_[_0x4cf2('0x30')](_0x453ef9[_0x4cf2('0x3a')],function(_0x304a8a){var _0x4d4fa5={};_0x4d4fa5[_0x304a8a]={'$like':'%'+_0x268d02[_0x4cf2('0x37')]['filter']+'%'};return _0x4d4fa5;})});}_0x453ef9=_[_0x4cf2('0x45')]({},_0x453ef9,_0x268d02['options']);return _0x337325[_0x4cf2('0x81')](_0x453ef9);}})[_0x4cf2('0x27')](function(_0x2114f0){if(_0x2114f0){_0x9c887f=_0x2114f0[_0x4cf2('0x3c')];if(!_0x268d02[_0x4cf2('0x37')][_0x4cf2('0x3d')]('nolimit')){_0x453ef9[_0x4cf2('0x1e')]=qs['limit'](_0x268d02[_0x4cf2('0x37')][_0x4cf2('0x1e')]);_0x453ef9['offset']=qs['offset'](_0x268d02[_0x4cf2('0x37')]['offset']);}return _0x337325[_0x4cf2('0x81')](_0x453ef9);}})['then'](function(_0x378820){if(_0x378820){return _0x378820?{'count':_0x9c887f,'rows':_0x378820}:null;}})['then'](respondWithResult(_0x2adaee,null))[_0x4cf2('0x4a')](handleError(_0x2adaee,null));}; \ No newline at end of file +var _0x902b=['rows','show','params','attributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','clone','createdAt','omit','updatedAt','userProfileId','iframe','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardItem','getItems','findOne','sort','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','CustomDashboards','UserProfileResource','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x902b,0xb6));var _0xb902=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x902b[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xb902('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb902('0x1'));var rp=require(_0xb902('0x2'));var moment=require(_0xb902('0x3'));var BPromise=require(_0xb902('0x4'));var Mustache=require(_0xb902('0x5'));var util=require('util');var path=require(_0xb902('0x6'));var sox=require(_0xb902('0x7'));var csv=require(_0xb902('0x8'));var ejs=require(_0xb902('0x9'));var fs=require('fs');var fs_extra=require(_0xb902('0xa'));var _=require(_0xb902('0xb'));var squel=require(_0xb902('0xc'));var crypto=require(_0xb902('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb902('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb902('0xf'));var Redis=require(_0xb902('0x10'));var authService=require(_0xb902('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb902('0x12'));var logger=require(_0xb902('0x13'))(_0xb902('0x14'));var utils=require(_0xb902('0x15'));var config=require(_0xb902('0x16'));var licenseUtil=require(_0xb902('0x17'));var db=require(_0xb902('0x18'))['db'];config['redis']=_[_0xb902('0x19')](config[_0xb902('0x1a')],{'host':_0xb902('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb902('0x1a')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x43adab,_0x37163a){_0x37163a=_0x37163a||0xcc;return function(_0x4f539c){if(_0x4f539c){return _0x43adab[_0xb902('0x1c')](_0x37163a);}return _0x43adab[_0xb902('0x1d')](_0x37163a)[_0xb902('0x1e')]();};}function respondWithResult(_0xb3f811,_0x292b9c){_0x292b9c=_0x292b9c||0xc8;return function(_0x5c4dbd){if(_0x5c4dbd){return _0xb3f811['status'](_0x292b9c)[_0xb902('0x1f')](_0x5c4dbd);}};}function respondWithFilteredResult(_0x4bf9b0,_0x3b163d){return function(_0x3f28fb){if(_0x3f28fb){var _0x2900a5=typeof _0x3b163d[_0xb902('0x20')]===_0xb902('0x21')&&typeof _0x3b163d[_0xb902('0x22')]===_0xb902('0x21');var _0x4b3dc0=_0x3f28fb[_0xb902('0x23')];var _0x1c61d9=_0x2900a5?0x0:_0x3b163d['offset'];var _0x4943a2=_0x2900a5?_0x3f28fb[_0xb902('0x23')]:_0x3b163d[_0xb902('0x20')]+_0x3b163d[_0xb902('0x22')];var _0xe92034;if(_0x4943a2>=_0x4b3dc0){_0x4943a2=_0x4b3dc0;_0xe92034=0xc8;}else{_0xe92034=0xce;}_0x4bf9b0[_0xb902('0x1d')](_0xe92034);return _0x4bf9b0[_0xb902('0x24')](_0xb902('0x25'),_0x1c61d9+'-'+_0x4943a2+'/'+_0x4b3dc0)['json'](_0x3f28fb);}return null;};}function patchUpdates(_0x20b56e){return function(_0x403d80){try{jsonpatch['apply'](_0x403d80,_0x20b56e,!![]);}catch(_0x4c22cf){return BPromise['reject'](_0x4c22cf);}return _0x403d80['save']();};}function saveUpdates(_0x2c504a,_0x3306cf){return function(_0x54158a){if(_0x54158a){return _0x54158a[_0xb902('0x26')](_0x2c504a)[_0xb902('0x27')](function(_0x15cf2a){return _0x15cf2a;});}return null;};}function removeEntity(_0x435159,_0x354576){return function(_0x44598e){if(_0x44598e){return _0x44598e[_0xb902('0x28')]()[_0xb902('0x27')](function(){var _0x1a3293=_0x44598e[_0xb902('0x29')]({'plain':!![]});var _0x15bab7=_0xb902('0x2a');return db[_0xb902('0x2b')][_0xb902('0x28')]({'where':{'type':_0x15bab7,'resourceId':_0x1a3293['id']}})[_0xb902('0x27')](function(){return _0x44598e;});})[_0xb902('0x27')](function(){_0x435159[_0xb902('0x1d')](0xcc)[_0xb902('0x1e')]();});}};}function handleEntityNotFound(_0x29d2ca,_0x58f84e){return function(_0x5bd405){if(!_0x5bd405){_0x29d2ca[_0xb902('0x1c')](0x194);}return _0x5bd405;};}function handleError(_0x1e4bba,_0x1d67ac){_0x1d67ac=_0x1d67ac||0x1f4;return function(_0x1368a8){logger['error'](_0x1368a8['stack']);if(_0x1368a8['name']){delete _0x1368a8[_0xb902('0x2c')];}_0x1e4bba[_0xb902('0x1d')](_0x1d67ac)[_0xb902('0x2d')](_0x1368a8);};}exports[_0xb902('0x2e')]=function(_0x331c76,_0x2e606c){var _0x68e169={},_0x5c1767={},_0x307ccf={'count':0x0,'rows':[]};var _0x3b8c32=_[_0xb902('0x2f')](db[_0xb902('0x30')][_0xb902('0x31')],function(_0x2918e6){return{'name':_0x2918e6[_0xb902('0x32')],'type':_0x2918e6[_0xb902('0x33')][_0xb902('0x34')]};});_0x5c1767[_0xb902('0x35')]=_[_0xb902('0x2f')](_0x3b8c32,_0xb902('0x2c'));_0x5c1767[_0xb902('0x36')]=_[_0xb902('0x37')](_0x331c76['query']);_0x5c1767[_0xb902('0x38')]=_['intersection'](_0x5c1767[_0xb902('0x35')],_0x5c1767[_0xb902('0x36')]);_0x68e169['attributes']=_[_0xb902('0x39')](_0x5c1767[_0xb902('0x35')],qs['fields'](_0x331c76['query'][_0xb902('0x3a')]));_0x68e169['attributes']=_0x68e169['attributes'][_0xb902('0x3b')]?_0x68e169['attributes']:_0x5c1767[_0xb902('0x35')];if(!_0x331c76[_0xb902('0x36')][_0xb902('0x3c')](_0xb902('0x3d'))){_0x68e169[_0xb902('0x22')]=qs['limit'](_0x331c76['query']['limit']);_0x68e169[_0xb902('0x20')]=qs[_0xb902('0x20')](_0x331c76[_0xb902('0x36')][_0xb902('0x20')]);}_0x68e169[_0xb902('0x3e')]=qs['sort'](_0x331c76['query']['sort']);_0x68e169['where']=qs[_0xb902('0x38')](_[_0xb902('0x3f')](_0x331c76['query'],_0x5c1767[_0xb902('0x38')]),_0x3b8c32);if(_0x331c76[_0xb902('0x36')][_0xb902('0x40')]){_0x68e169[_0xb902('0x41')]=_['merge'](_0x68e169[_0xb902('0x41')],{'$or':_[_0xb902('0x2f')](_0x3b8c32,function(_0x540a09){if(_0x540a09[_0xb902('0x33')]!==_0xb902('0x42')){var _0x34aedd={};_0x34aedd[_0x540a09[_0xb902('0x2c')]]={'$like':'%'+_0x331c76[_0xb902('0x36')][_0xb902('0x40')]+'%'};return _0x34aedd;}})});}_0x68e169=_[_0xb902('0x43')]({},_0x68e169,_0x331c76[_0xb902('0x44')]);var _0x2c8f49={'where':_0x68e169['where']};return db[_0xb902('0x30')][_0xb902('0x23')](_0x2c8f49)[_0xb902('0x27')](function(_0x4c1a69){_0x307ccf[_0xb902('0x23')]=_0x4c1a69;if(_0x331c76['query'][_0xb902('0x45')]){_0x68e169[_0xb902('0x46')]=[{'all':!![]}];}return db[_0xb902('0x30')][_0xb902('0x47')](_0x68e169);})[_0xb902('0x27')](function(_0x1e6c22){_0x307ccf[_0xb902('0x48')]=_0x1e6c22;return _0x307ccf;})[_0xb902('0x27')](respondWithFilteredResult(_0x2e606c,_0x68e169))['catch'](handleError(_0x2e606c,null));};exports[_0xb902('0x49')]=function(_0x23fa4d,_0x2dfc6c){var _0x363ba5={'raw':![],'where':{'id':_0x23fa4d[_0xb902('0x4a')]['id']}},_0x12f39d={};_0x12f39d['model']=_['keys'](db[_0xb902('0x30')][_0xb902('0x31')]);_0x12f39d[_0xb902('0x36')]=_[_0xb902('0x37')](_0x23fa4d[_0xb902('0x36')]);_0x12f39d[_0xb902('0x38')]=_[_0xb902('0x39')](_0x12f39d['model'],_0x12f39d[_0xb902('0x36')]);_0x363ba5[_0xb902('0x4b')]=_[_0xb902('0x39')](_0x12f39d['model'],qs[_0xb902('0x3a')](_0x23fa4d[_0xb902('0x36')][_0xb902('0x3a')]));_0x363ba5[_0xb902('0x4b')]=_0x363ba5[_0xb902('0x4b')][_0xb902('0x3b')]?_0x363ba5[_0xb902('0x4b')]:_0x12f39d[_0xb902('0x35')];if(_0x23fa4d[_0xb902('0x36')][_0xb902('0x45')]){_0x363ba5[_0xb902('0x46')]=[{'all':!![]}];}_0x363ba5=_[_0xb902('0x43')]({},_0x363ba5,_0x23fa4d[_0xb902('0x44')]);return db['Dashboard'][_0xb902('0x4c')](_0x363ba5)[_0xb902('0x27')](handleEntityNotFound(_0x2dfc6c,null))[_0xb902('0x27')](respondWithResult(_0x2dfc6c,null))[_0xb902('0x4d')](handleError(_0x2dfc6c,null));};exports[_0xb902('0x4e')]=function(_0x2398d5,_0x3b2455){return db[_0xb902('0x30')]['create'](_0x2398d5[_0xb902('0x4f')],{})['then'](function(_0x5b1079){var _0x3c657f=_0x2398d5[_0xb902('0x50')][_0xb902('0x29')]({'plain':!![]});if(!_0x3c657f)throw new Error(_0xb902('0x51'));if(_0x3c657f[_0xb902('0x52')]===_0xb902('0x50')){var _0x1fa68a=_0x5b1079[_0xb902('0x29')]({'plain':!![]});var _0x51881c=_0xb902('0x2a');return db[_0xb902('0x53')][_0xb902('0x4c')]({'where':{'name':_0x51881c,'userProfileId':_0x3c657f['userProfileId']},'raw':!![]})['then'](function(_0x1cdb8d){if(_0x1cdb8d&&_0x1cdb8d[_0xb902('0x54')]===0x0){return db[_0xb902('0x2b')][_0xb902('0x4e')]({'name':_0x1fa68a[_0xb902('0x2c')],'resourceId':_0x1fa68a['id'],'type':_0x1cdb8d[_0xb902('0x2c')],'sectionId':_0x1cdb8d['id']},{})[_0xb902('0x27')](function(){return _0x5b1079;});}else{return _0x5b1079;}})[_0xb902('0x4d')](function(_0x1299ae){logger[_0xb902('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1299ae);throw _0x1299ae;});}return _0x5b1079;})[_0xb902('0x27')](respondWithResult(_0x3b2455,0xc9))[_0xb902('0x4d')](handleError(_0x3b2455,null));};exports[_0xb902('0x56')]=function(_0x1c19ab,_0x2c1061){var _0x3f806c={'where':{'id':_0x1c19ab[_0xb902('0x4a')]['id']}},_0x424f01={};_0x424f01[_0xb902('0x35')]=_[_0xb902('0x37')](db['Dashboard'][_0xb902('0x31')]);_0x3f806c['attributes']=_[_0xb902('0x39')](_0x424f01['model'],qs['fields'](_0x1c19ab[_0xb902('0x36')][_0xb902('0x3a')]));_0x3f806c[_0xb902('0x4b')]=_0x3f806c[_0xb902('0x4b')][_0xb902('0x3b')]?_0x3f806c[_0xb902('0x4b')]:_0x424f01[_0xb902('0x35')];if(_0x1c19ab[_0xb902('0x36')][_0xb902('0x45')]){_0x3f806c[_0xb902('0x46')]=[{'all':!![]}];}_0x3f806c=_[_0xb902('0x43')]({},_0x3f806c,_0x1c19ab[_0xb902('0x44')]);return db[_0xb902('0x30')][_0xb902('0x4c')](_0x3f806c)[_0xb902('0x27')](handleEntityNotFound(_0x2c1061,null))[_0xb902('0x27')](function(_0x3dee97){if(_0x3dee97){var _0x410f94=_0x3dee97[_0xb902('0x29')]({'plain':!![]});_0x410f94=qs['omit'](_0x410f94,['id',_0xb902('0x57'),'updatedAt']);_0x1c19ab[_0xb902('0x4f')]=_[_0xb902('0x58')](_0x1c19ab[_0xb902('0x4f')],['id',_0xb902('0x57'),_0xb902('0x59')]);return db['Dashboard'][_0xb902('0x4e')](_[_0xb902('0x43')](_0x410f94,_0x1c19ab[_0xb902('0x4f')]),{'include':_0x1c19ab[_0xb902('0x36')][_0xb902('0x45')]?[{'all':!![]}]:undefined})[_0xb902('0x27')](function(_0x3fad2d){var _0x17de23=_0x1c19ab['user']['get']({'plain':!![]});if(!_0x17de23)throw new Error(_0xb902('0x51'));if(_0x17de23['role']===_0xb902('0x50')){var _0x1d1b4a=_0x3fad2d[_0xb902('0x29')]({'plain':!![]});var _0x3112f9=_0xb902('0x2a');return db[_0xb902('0x53')][_0xb902('0x4c')]({'where':{'name':_0x3112f9,'userProfileId':_0x17de23[_0xb902('0x5a')]},'raw':!![]})[_0xb902('0x27')](function(_0x679921){if(_0x679921&&_0x679921[_0xb902('0x54')]===0x0){return db[_0xb902('0x2b')]['create']({'name':_0x1d1b4a[_0xb902('0x2c')],'resourceId':_0x1d1b4a['id'],'type':_0x679921[_0xb902('0x2c')],'sectionId':_0x679921['id']},{})[_0xb902('0x27')](function(){return _0x3fad2d;});}else{return _0x3fad2d;}})[_0xb902('0x4d')](function(_0x23bc22){logger[_0xb902('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23bc22);throw _0x23bc22;});}return _0x3fad2d;});}})[_0xb902('0x27')](respondWithResult(_0x2c1061,0xc9))[_0xb902('0x4d')](handleError(_0x2c1061,null));};exports[_0xb902('0x26')]=function(_0x4d2246,_0x2d3feb){if(_0x4d2246[_0xb902('0x4f')]['id']){delete _0x4d2246[_0xb902('0x4f')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x4d2246[_0xb902('0x4a')]['id']}})[_0xb902('0x27')](handleEntityNotFound(_0x2d3feb,null))['then'](saveUpdates(_0x4d2246['body'],null))[_0xb902('0x27')](respondWithResult(_0x2d3feb,null))[_0xb902('0x4d')](handleError(_0x2d3feb,null));};exports[_0xb902('0x28')]=function(_0x13eb2b,_0x3975c6){return db['Dashboard'][_0xb902('0x4c')]({'where':{'id':_0x13eb2b[_0xb902('0x4a')]['id']}})[_0xb902('0x27')](handleEntityNotFound(_0x3975c6,null))['then'](removeEntity(_0x3975c6,null))[_0xb902('0x4d')](handleError(_0x3975c6,null));};function widgetAttributes(_0x112dbf){try{switch(_0x112dbf[_0xb902('0x33')]){case _0xb902('0x5b'):return[{'name':_0xb902('0x5c'),'value':_0x112dbf[_0xb902('0x5c')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x0]?_0x112dbf[_0xb902('0x5d')][0x0][_0xb902('0x5e')]:undefined)||_0xb902('0x5f')}];case _0xb902('0x60'):return[{'name':_0xb902('0x61'),'value':_0x112dbf['attrPath']||(_0x112dbf['attrs']&&_0x112dbf['attrs'][0x0]?_0x112dbf[_0xb902('0x5d')][0x0][_0xb902('0x5e')]:undefined)||''}];case'clock':return[{'name':_0xb902('0x62'),'value':_0x112dbf[_0xb902('0x62')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x0]?_0x112dbf[_0xb902('0x5d')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x112dbf[_0xb902('0x63')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x1]?_0x112dbf['attrs'][0x1][_0xb902('0x5e')]:undefined)||_0xb902('0x64')},{'name':_0xb902('0x65'),'value':_0x112dbf[_0xb902('0x65')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x2]?_0x112dbf['attrs'][0x2][_0xb902('0x5e')]:undefined)||0xc}];case _0xb902('0x66'):return[{'name':_0xb902('0x67'),'value':_0x112dbf[_0xb902('0x67')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x0]?_0x112dbf['attrs'][0x0][_0xb902('0x5e')]:undefined)||_0xb902('0x68')},{'name':_0xb902('0x69'),'value':_0x112dbf['attrVoiceQueues']||(_0x112dbf['attrs']&&_0x112dbf['attrs'][0x1]?_0x112dbf['attrs'][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x112dbf[_0xb902('0x65')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x2]?_0x112dbf['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x112dbf[_0xb902('0x6a')]||(_0x112dbf['attrs']&&_0x112dbf['attrs'][0x3]?_0x112dbf['attrs'][0x3][_0xb902('0x5e')]:undefined)||_0xb902('0x6b')},{'name':_0xb902('0x6c'),'value':_0x112dbf[_0xb902('0x6c')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf['attrs'][0x4]?_0x112dbf[_0xb902('0x5d')][0x4][_0xb902('0x5e')]:undefined)||''},{'name':_0xb902('0x6d'),'value':_0x112dbf[_0xb902('0x6d')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf['attrs'][0x5]?_0x112dbf['attrs'][0x5]['value']:undefined)||''},{'name':_0xb902('0x6e'),'value':_0x112dbf[_0xb902('0x6e')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x6]?_0x112dbf['attrs'][0x6][_0xb902('0x5e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x112dbf[_0xb902('0x6f')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf['attrs'][0x7]?_0x112dbf[_0xb902('0x5d')][0x7][_0xb902('0x5e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x112dbf['attrWhatsappAccounts']||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x8]?_0x112dbf[_0xb902('0x5d')][0x8][_0xb902('0x5e')]:undefined)||''},{'name':_0xb902('0x70'),'value':_0x112dbf[_0xb902('0x70')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x9]?_0x112dbf[_0xb902('0x5d')][0x9][_0xb902('0x5e')]:undefined)||''}];case'multibar-chart':case _0xb902('0x71'):return[{'name':'attrSerie1','value':_0x112dbf[_0xb902('0x72')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf['attrs'][0x0]?_0x112dbf['attrs'][0x0][_0xb902('0x5e')]:undefined)||_0xb902('0x68')},{'name':_0xb902('0x73'),'value':_0x112dbf[_0xb902('0x73')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x1]?_0x112dbf[_0xb902('0x5d')][0x1][_0xb902('0x5e')]:undefined)||null},{'name':'attrSerie3','value':_0x112dbf[_0xb902('0x74')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x2]?_0x112dbf['attrs'][0x2][_0xb902('0x5e')]:undefined)||null},{'name':_0xb902('0x69'),'value':_0x112dbf[_0xb902('0x69')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x3]?_0x112dbf[_0xb902('0x5d')][0x3]['value']:undefined)||[]},{'name':_0xb902('0x6a'),'value':_0x112dbf[_0xb902('0x6a')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x4]?_0x112dbf[_0xb902('0x5d')][0x4][_0xb902('0x5e')]:undefined)||_0xb902('0x6b')},{'name':_0xb902('0x6c'),'value':_0x112dbf[_0xb902('0x6c')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x5]?_0x112dbf[_0xb902('0x5d')][0x5]['value']:undefined)||''},{'name':_0xb902('0x6d'),'value':_0x112dbf[_0xb902('0x6d')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x6]?_0x112dbf[_0xb902('0x5d')][0x6][_0xb902('0x5e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x112dbf[_0xb902('0x6e')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x7]?_0x112dbf[_0xb902('0x5d')][0x7][_0xb902('0x5e')]:undefined)||''},{'name':_0xb902('0x6f'),'value':_0x112dbf[_0xb902('0x6f')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x8]?_0x112dbf[_0xb902('0x5d')][0x8]['value']:undefined)||''},{'name':_0xb902('0x75'),'value':_0x112dbf[_0xb902('0x75')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x9]?_0x112dbf[_0xb902('0x5d')][0x9][_0xb902('0x5e')]:undefined)||''},{'name':_0xb902('0x70'),'value':_0x112dbf[_0xb902('0x70')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0xa]?_0x112dbf[_0xb902('0x5d')][0xa][_0xb902('0x5e')]:undefined)||''}];case'web-report':return[{'name':_0xb902('0x76'),'type':_0x112dbf['reportType']||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x0]?_0x112dbf[_0xb902('0x5d')][0x0][_0xb902('0x33')]:undefined)||null,'value':_0x112dbf[_0xb902('0x76')]||(_0x112dbf['attrs']&&_0x112dbf[_0xb902('0x5d')][0x0]?_0x112dbf[_0xb902('0x5d')][0x0][_0xb902('0x5e')]:undefined)||null},{'name':'attrRefresh','value':_0x112dbf[_0xb902('0x77')]||(_0x112dbf[_0xb902('0x5d')]&&_0x112dbf[_0xb902('0x5d')][0x1]?_0x112dbf[_0xb902('0x5d')][0x1][_0xb902('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1d410d){logger[_0xb902('0x55')](_0xb902('0x78'),JSON[_0xb902('0x79')](_0x1d410d));return[];}}exports[_0xb902('0x7a')]=function(_0x2865f9,_0x561722,_0x22f71b){if(_0x2865f9[_0xb902('0x4f')]['id']){delete _0x2865f9['body']['id'];}return db['Dashboard'][_0xb902('0x4c')]({'where':{'id':_0x2865f9[_0xb902('0x4a')]['id']}})[_0xb902('0x27')](handleEntityNotFound(_0x561722,null))[_0xb902('0x27')](function(_0x103648){if(_0x103648){_0x2865f9[_0xb902('0x4f')]['DashboardId']=_0x103648['id'];_0x2865f9[_0xb902('0x4f')][_0xb902('0x5d')]=widgetAttributes(_0x2865f9['body']);return db[_0xb902('0x7b')][_0xb902('0x4e')](_0x2865f9[_0xb902('0x4f')]);}})[_0xb902('0x27')](respondWithResult(_0x561722,null))['catch'](handleError(_0x561722,null));};exports[_0xb902('0x7c')]=function(_0x126727,_0x186c23,_0x5d2541){var _0x1d4859={};var _0x419d53={};var _0x1005de;var _0xa25e2c;return db[_0xb902('0x30')][_0xb902('0x7d')]({'where':{'id':_0x126727['params']['id']}})[_0xb902('0x27')](handleEntityNotFound(_0x186c23,null))['then'](function(_0x1fc604){if(_0x1fc604){_0x1005de=_0x1fc604;_0x419d53['model']=_[_0xb902('0x37')](db['DashboardItem'][_0xb902('0x31')]);_0x419d53[_0xb902('0x36')]=_[_0xb902('0x37')](_0x126727[_0xb902('0x36')]);_0x419d53['filters']=_[_0xb902('0x39')](_0x419d53[_0xb902('0x35')],_0x419d53[_0xb902('0x36')]);_0x1d4859[_0xb902('0x4b')]=_[_0xb902('0x39')](_0x419d53[_0xb902('0x35')],qs[_0xb902('0x3a')](_0x126727[_0xb902('0x36')]['fields']));_0x1d4859[_0xb902('0x4b')]=_0x1d4859[_0xb902('0x4b')][_0xb902('0x3b')]?_0x1d4859[_0xb902('0x4b')]:_0x419d53[_0xb902('0x35')];_0x1d4859[_0xb902('0x3e')]=qs[_0xb902('0x7e')](_0x126727[_0xb902('0x36')]['sort']);_0x1d4859[_0xb902('0x41')]=qs['filters'](_['pick'](_0x126727[_0xb902('0x36')],_0x419d53[_0xb902('0x38')]));if(_0x126727[_0xb902('0x36')][_0xb902('0x40')]){_0x1d4859[_0xb902('0x41')]=_[_0xb902('0x43')](_0x1d4859['where'],{'$or':_[_0xb902('0x2f')](_0x1d4859[_0xb902('0x4b')],function(_0x1f3487){var _0x503c43={};_0x503c43[_0x1f3487]={'$like':'%'+_0x126727[_0xb902('0x36')][_0xb902('0x40')]+'%'};return _0x503c43;})});}_0x1d4859=_[_0xb902('0x43')]({},_0x1d4859,_0x126727[_0xb902('0x44')]);return _0x1005de['getItems'](_0x1d4859);}})[_0xb902('0x27')](function(_0x12be3e){if(_0x12be3e){_0xa25e2c=_0x12be3e['length'];if(!_0x126727[_0xb902('0x36')]['hasOwnProperty']('nolimit')){_0x1d4859['limit']=qs[_0xb902('0x22')](_0x126727[_0xb902('0x36')]['limit']);_0x1d4859[_0xb902('0x20')]=qs[_0xb902('0x20')](_0x126727['query']['offset']);}return _0x1005de[_0xb902('0x7c')](_0x1d4859);}})[_0xb902('0x27')](function(_0x2010f8){if(_0x2010f8){return _0x2010f8?{'count':_0xa25e2c,'rows':_0x2010f8}:null;}})['then'](respondWithResult(_0x186c23,null))[_0xb902('0x4d')](handleError(_0x186c23,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9e98dc9..db0564d 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 _0x884b=['Dashboard','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x240bed,_0x6c6357){var _0x463573=function(_0x765ed1){while(--_0x765ed1){_0x240bed['push'](_0x240bed['shift']());}};_0x463573(++_0x6c6357);}(_0x884b,0x154));var _0xb884=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x884b[_0x3ea913];return _0x2b4f28;};'use strict';var EventEmitter=require(_0xb884('0x0'));var Dashboard=require(_0xb884('0x1'))['db'][_0xb884('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb884('0x3'),'afterUpdate':_0xb884('0x4'),'afterDestroy':_0xb884('0x5')};function emitEvent(_0xe34431){return function(_0x3b3540,_0x3fb6bd,_0x26ef12){DashboardEvents['emit'](_0xe34431+':'+_0x3b3540['id'],_0x3b3540);DashboardEvents[_0xb884('0x6')](_0xe34431,_0x3b3540);_0x26ef12(null);};}for(var e in events){if(events[_0xb884('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xb884('0x8')]=DashboardEvents; \ No newline at end of file +var _0x0a22=['save','update','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x44937b,_0x1bc3de){var _0x5c0fb9=function(_0x31a629){while(--_0x31a629){_0x44937b['push'](_0x44937b['shift']());}};_0x5c0fb9(++_0x1bc3de);}(_0x0a22,0x1eb));var _0x20a2=function(_0x2a86d3,_0x2c9431){_0x2a86d3=_0x2a86d3-0x0;var _0xe7936c=_0x0a22[_0x2a86d3];return _0xe7936c;};'use strict';var EventEmitter=require(_0x20a2('0x0'));var Dashboard=require(_0x20a2('0x1'))['db'][_0x20a2('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x20a2('0x3')](0x0);var events={'afterCreate':_0x20a2('0x4'),'afterUpdate':_0x20a2('0x5'),'afterDestroy':'remove'};function emitEvent(_0x299314){return function(_0x1c36da,_0x297b80,_0x246440){DashboardEvents['emit'](_0x299314+':'+_0x1c36da['id'],_0x1c36da);DashboardEvents['emit'](_0x299314,_0x1c36da);_0x246440(null);};}for(var e in events){if(events[_0x20a2('0x6')](e)){var event=events[e];Dashboard[_0x20a2('0x7')](e,emitEvent(event));}}module[_0x20a2('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 23fce04..e5f1e51 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 _0xffee=['rimraf','../../config/environment','./dashboard.attributes','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x162ee0,_0x291661){var _0x48fc5e=function(_0x297a35){while(--_0x297a35){_0x162ee0['push'](_0x162ee0['shift']());}};_0x48fc5e(++_0x291661);}(_0xffee,0x131));var _0xeffe=function(_0x31eb84,_0x4b5ee2){_0x31eb84=_0x31eb84-0x0;var _0x106b21=_0xffee[_0x31eb84];return _0x106b21;};'use strict';var _=require(_0xeffe('0x0'));var util=require('util');var logger=require(_0xeffe('0x1'))(_0xeffe('0x2'));var moment=require(_0xeffe('0x3'));var BPromise=require(_0xeffe('0x4'));var rp=require(_0xeffe('0x5'));var fs=require('fs');var path=require(_0xeffe('0x6'));var rimraf=require(_0xeffe('0x7'));var config=require(_0xeffe('0x8'));var attributes=require(_0xeffe('0x9'));module['exports']=function(_0xd870cf,_0x542835){return _0xd870cf['define'](_0xeffe('0xa'),attributes,{'tableName':_0xeffe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebb1=['./dashboard.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x54849c,_0x28650a){var _0x5722e3=function(_0x135510){while(--_0x135510){_0x54849c['push'](_0x54849c['shift']());}};_0x5722e3(++_0x28650a);}(_0xebb1,0x1e3));var _0x1ebb=function(_0x4b02c0,_0x41125f){_0x4b02c0=_0x4b02c0-0x0;var _0x1de023=_0xebb1[_0x4b02c0];return _0x1de023;};'use strict';var _=require('lodash');var util=require(_0x1ebb('0x0'));var logger=require(_0x1ebb('0x1'))(_0x1ebb('0x2'));var moment=require(_0x1ebb('0x3'));var BPromise=require(_0x1ebb('0x4'));var rp=require(_0x1ebb('0x5'));var fs=require('fs');var path=require(_0x1ebb('0x6'));var rimraf=require(_0x1ebb('0x7'));var config=require(_0x1ebb('0x8'));var attributes=require(_0x1ebb('0x9'));module[_0x1ebb('0xa')]=function(_0x58d76b,_0x3628f2){return _0x58d76b[_0x1ebb('0xb')]('Dashboard',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 b1617f9..eb188e0 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 _0x5f45=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then'];(function(_0x20733f,_0x261401){var _0x578d54=function(_0x33393f){while(--_0x33393f){_0x20733f['push'](_0x20733f['shift']());}};_0x578d54(++_0x261401);}(_0x5f45,0xfd));var _0x55f4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x5f45[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0x55f4('0x0'));var util=require(_0x55f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55f4('0x2'));var db=require(_0x55f4('0x3'))['db'];var utils=require(_0x55f4('0x4'));var logger=require(_0x55f4('0x5'))(_0x55f4('0x6'));var config=require('../../config/environment');var jayson=require(_0x55f4('0x7'));var client=jayson[_0x55f4('0x8')][_0x55f4('0x9')]({'port':0x232a});config[_0x55f4('0xa')]=_[_0x55f4('0xb')](config['redis'],{'host':_0x55f4('0xc'),'port':0x18eb});var socket=require(_0x55f4('0xd'))(new Redis(config[_0x55f4('0xa')]));require(_0x55f4('0xe'))[_0x55f4('0xf')](socket);function respondWithRpcPromise(_0x24e1f6,_0x345ce4,_0x54a614){return new BPromise(function(_0x57ec12,_0x4a78b7){return client['request'](_0x24e1f6,_0x54a614)[_0x55f4('0x10')](function(_0x1e8a13){logger['info'](_0x55f4('0x11'),_0x345ce4,_0x55f4('0x12'));logger[_0x55f4('0x13')](_0x55f4('0x14'),_0x345ce4,'request\x20sent',JSON[_0x55f4('0x15')](_0x1e8a13));if(_0x1e8a13[_0x55f4('0x16')]){if(_0x1e8a13['error'][_0x55f4('0x17')]===0x1f4){logger[_0x55f4('0x16')]('Dashboard,\x20%s,\x20%s',_0x345ce4,_0x1e8a13[_0x55f4('0x16')][_0x55f4('0x18')]);return _0x4a78b7(_0x1e8a13[_0x55f4('0x16')][_0x55f4('0x18')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x345ce4,_0x1e8a13[_0x55f4('0x16')]['message']);return _0x57ec12(_0x1e8a13['error'][_0x55f4('0x18')]);}else{logger[_0x55f4('0x19')](_0x55f4('0x11'),_0x345ce4,_0x55f4('0x12'));_0x57ec12(_0x1e8a13[_0x55f4('0x1a')][_0x55f4('0x18')]);}})['catch'](function(_0x1becd1){logger[_0x55f4('0x16')](_0x55f4('0x11'),_0x345ce4,_0x1becd1);_0x4a78b7(_0x1becd1);});});} \ No newline at end of file +var _0x6816=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4a15d1,_0x3c4eb7){var _0x10264e=function(_0x4d75b5){while(--_0x4d75b5){_0x4a15d1['push'](_0x4a15d1['shift']());}};_0x10264e(++_0x3c4eb7);}(_0x6816,0x10a));var _0x6681=function(_0x530b2e,_0x20d98d){_0x530b2e=_0x530b2e-0x0;var _0x56225d=_0x6816[_0x530b2e];return _0x56225d;};'use strict';var _=require(_0x6681('0x0'));var util=require(_0x6681('0x1'));var moment=require(_0x6681('0x2'));var BPromise=require('bluebird');var rs=require(_0x6681('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6681('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6681('0x5'))(_0x6681('0x6'));var config=require(_0x6681('0x7'));var jayson=require(_0x6681('0x8'));var client=jayson[_0x6681('0x9')][_0x6681('0xa')]({'port':0x232a});config[_0x6681('0xb')]=_[_0x6681('0xc')](config[_0x6681('0xb')],{'host':_0x6681('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6681('0xb')]));require('./dashboard.socket')[_0x6681('0xe')](socket);function respondWithRpcPromise(_0x22451b,_0x51bde2,_0xd96ce9){return new BPromise(function(_0x38e5b8,_0x1ce69e){return client[_0x6681('0xf')](_0x22451b,_0xd96ce9)['then'](function(_0x10fb03){logger[_0x6681('0x10')](_0x6681('0x11'),_0x51bde2,_0x6681('0x12'));logger[_0x6681('0x13')](_0x6681('0x14'),_0x51bde2,_0x6681('0x12'),JSON[_0x6681('0x15')](_0x10fb03));if(_0x10fb03[_0x6681('0x16')]){if(_0x10fb03[_0x6681('0x16')][_0x6681('0x17')]===0x1f4){logger[_0x6681('0x16')](_0x6681('0x11'),_0x51bde2,_0x10fb03[_0x6681('0x16')][_0x6681('0x18')]);return _0x1ce69e(_0x10fb03[_0x6681('0x16')]['message']);}logger[_0x6681('0x16')](_0x6681('0x11'),_0x51bde2,_0x10fb03[_0x6681('0x16')][_0x6681('0x18')]);return _0x38e5b8(_0x10fb03[_0x6681('0x16')][_0x6681('0x18')]);}else{logger[_0x6681('0x10')](_0x6681('0x11'),_0x51bde2,_0x6681('0x12'));_0x38e5b8(_0x10fb03[_0x6681('0x19')][_0x6681('0x18')]);}})['catch'](function(_0x30d021){logger[_0x6681('0x16')]('Dashboard,\x20%s,\x20%s',_0x51bde2,_0x30d021);_0x1ce69e(_0x30d021);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 00985cc..da28728 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 _0x60c9=['./dashboard.events','save','remove','update','emit','register','length','dashboard:'];(function(_0x4ade33,_0x103537){var _0x162cc1=function(_0x1c52ab){while(--_0x1c52ab){_0x4ade33['push'](_0x4ade33['shift']());}};_0x162cc1(++_0x103537);}(_0x60c9,0x198));var _0x960c=function(_0x2c15f0,_0x9ae691){_0x2c15f0=_0x2c15f0-0x0;var _0x504012=_0x60c9[_0x2c15f0];return _0x504012;};'use strict';var DashboardEvents=require(_0x960c('0x0'));var events=[_0x960c('0x1'),_0x960c('0x2'),_0x960c('0x3')];function createListener(_0x1eef3e,_0xea32c5){return function(_0x459855){_0xea32c5[_0x960c('0x4')](_0x1eef3e,_0x459855);};}function removeListener(_0x4e62cb,_0x718872){return function(){DashboardEvents['removeListener'](_0x4e62cb,_0x718872);};}exports[_0x960c('0x5')]=function(_0x36306d){for(var _0x256b02=0x0,_0x2ef78d=events[_0x960c('0x6')];_0x256b02<_0x2ef78d;_0x256b02++){var _0x5e9e00=events[_0x256b02];var _0x6a9ce4=createListener(_0x960c('0x7')+_0x5e9e00,_0x36306d);DashboardEvents['on'](_0x5e9e00,_0x6a9ce4);}}; \ No newline at end of file +var _0xae49=['register','dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x303139,_0x5ea83f){var _0xd6bd51=function(_0x1369c4){while(--_0x1369c4){_0x303139['push'](_0x303139['shift']());}};_0xd6bd51(++_0x5ea83f);}(_0xae49,0xd2));var _0x9ae4=function(_0x4cb37b,_0x478ff1){_0x4cb37b=_0x4cb37b-0x0;var _0x25f2bf=_0xae49[_0x4cb37b];return _0x25f2bf;};'use strict';var DashboardEvents=require(_0x9ae4('0x0'));var events=[_0x9ae4('0x1'),_0x9ae4('0x2'),_0x9ae4('0x3')];function createListener(_0x56e023,_0x209c79){return function(_0x187ec8){_0x209c79[_0x9ae4('0x4')](_0x56e023,_0x187ec8);};}function removeListener(_0x58eac5,_0x15b98a){return function(){DashboardEvents[_0x9ae4('0x5')](_0x58eac5,_0x15b98a);};}exports[_0x9ae4('0x6')]=function(_0x1d257f){for(var _0x3d8163=0x0,_0x4c2e74=events['length'];_0x3d8163<_0x4c2e74;_0x3d8163++){var _0x10ace3=events[_0x3d8163];var _0x52266d=createListener(_0x9ae4('0x7')+_0x10ace3,_0x1d257f);DashboardEvents['on'](_0x10ace3,_0x52266d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 458969a..e5f9823 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 _0xb44f=['/:id/items','getItems','create','clone','post','addItem','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','show'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb44f,0x1b5));var _0xfb44=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb44f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xfb44('0x0'));var path=require(_0xfb44('0x1'));var timeout=require(_0xfb44('0x2'));var express=require(_0xfb44('0x3'));var router=express['Router']();var fs_extra=require(_0xfb44('0x4'));var auth=require(_0xfb44('0x5'));var interaction=require(_0xfb44('0x6'));var config=require(_0xfb44('0x7'));var controller=require(_0xfb44('0x8'));router[_0xfb44('0x9')]('/',auth[_0xfb44('0xa')](),controller[_0xfb44('0xb')]);router[_0xfb44('0x9')]('/:id',auth[_0xfb44('0xa')](),controller[_0xfb44('0xc')]);router[_0xfb44('0x9')](_0xfb44('0xd'),auth['isAuthenticated'](),controller[_0xfb44('0xe')]);router['post']('/',auth[_0xfb44('0xa')](),controller[_0xfb44('0xf')]);router['post']('/:id/clone',auth[_0xfb44('0xa')](),controller[_0xfb44('0x10')]);router[_0xfb44('0x11')](_0xfb44('0xd'),auth[_0xfb44('0xa')](),controller[_0xfb44('0x12')]);router[_0xfb44('0x13')](_0xfb44('0x14'),auth[_0xfb44('0xa')](),controller[_0xfb44('0x15')]);router[_0xfb44('0x16')](_0xfb44('0x14'),auth[_0xfb44('0xa')](),controller[_0xfb44('0x17')]);module[_0xfb44('0x18')]=router; \ No newline at end of file +var _0x2d18=['update','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x197720,_0x1e3932){var _0x1efdc5=function(_0x371a38){while(--_0x371a38){_0x197720['push'](_0x197720['shift']());}};_0x1efdc5(++_0x1e3932);}(_0x2d18,0x1b7));var _0x82d1=function(_0x5e32c3,_0x4ce1d1){_0x5e32c3=_0x5e32c3-0x0;var _0x49816e=_0x2d18[_0x5e32c3];return _0x49816e;};'use strict';var multer=require(_0x82d1('0x0'));var util=require(_0x82d1('0x1'));var path=require('path');var timeout=require(_0x82d1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x82d1('0x3'));var auth=require(_0x82d1('0x4'));var interaction=require(_0x82d1('0x5'));var config=require('../../config/environment');var controller=require(_0x82d1('0x6'));router[_0x82d1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x82d1('0x7')](_0x82d1('0x8'),auth[_0x82d1('0x9')](),controller[_0x82d1('0xa')]);router['get'](_0x82d1('0xb'),auth[_0x82d1('0x9')](),controller[_0x82d1('0xc')]);router[_0x82d1('0xd')]('/',auth[_0x82d1('0x9')](),controller[_0x82d1('0xe')]);router[_0x82d1('0xd')](_0x82d1('0xf'),auth['isAuthenticated'](),controller[_0x82d1('0x10')]);router['post']('/:id/items',auth[_0x82d1('0x9')](),controller['addItem']);router['put'](_0x82d1('0x8'),auth[_0x82d1('0x9')](),controller[_0x82d1('0x11')]);router['delete'](_0x82d1('0x8'),auth[_0x82d1('0x9')](),controller['destroy']);module[_0x82d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ebebd00..d0d08f6 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 _0x4975=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long'];(function(_0x56d664,_0x2e04a4){var _0x3c914f=function(_0x5969c4){while(--_0x5969c4){_0x56d664['push'](_0x56d664['shift']());}};_0x3c914f(++_0x2e04a4);}(_0x4975,0x86));var _0x5497=function(_0x3ba8e5,_0x37427a){_0x3ba8e5=_0x3ba8e5-0x0;var _0x46261c=_0x4975[_0x3ba8e5];return _0x46261c;};'use strict';var Sequelize=require(_0x5497('0x0'));var squel=require('squel');var _=require(_0x5497('0x1'));module[_0x5497('0x2')]={'title':{'type':Sequelize[_0x5497('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5497('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5497('0x4')](_0x5497('0x5')),'get':function(){try{return JSON[_0x5497('0x6')](this[_0x5497('0x7')](_0x5497('0x8')));}catch(_0x5d5272){return[];}},'set':function(_0x539a27){try{this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')](_0x539a27));}catch(_0x674a2a){this[_0x5497('0x9')]('attrs',JSON[_0x5497('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5497('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5497('0xb')]},'col':{'type':Sequelize[_0x5497('0xb')]},'background':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5497('0x3')],'allowNull':![],'defaultValue':_0x5497('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5497('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x26fc38,_0xa044cc){var _0x133af2=function(_0x3e1132){while(--_0x3e1132){_0x26fc38['push'](_0x26fc38['shift']());}};_0x133af2(++_0xa044cc);}(_0x814b,0x1a2));var _0xb814=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x814b[_0x4629ed];return _0x52ca04;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'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 f256a23..5900c11 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 _0x9c48=['then','destroy','error','name','send','show','params','model','keys','DashboardItem','rawAttributes','filters','intersection','query','attributes','fields','includeAll','include','merge','options','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','update'];(function(_0x42f433,_0x10a23c){var _0x5b4ff0=function(_0x20851c){while(--_0x20851c){_0x42f433['push'](_0x42f433['shift']());}};_0x5b4ff0(++_0x10a23c);}(_0x9c48,0xa1));var _0x89c4=function(_0x725c3,_0x4698e0){_0x725c3=_0x725c3-0x0;var _0x4cea5a=_0x9c48[_0x725c3];return _0x4cea5a;};'use strict';var emlformat=require(_0x89c4('0x0'));var rimraf=require(_0x89c4('0x1'));var zipdir=require(_0x89c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89c4('0x3'));var moment=require(_0x89c4('0x4'));var BPromise=require(_0x89c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89c4('0x6'));var sox=require(_0x89c4('0x7'));var csv=require('to-csv');var ejs=require(_0x89c4('0x8'));var fs=require('fs');var fs_extra=require(_0x89c4('0x9'));var _=require(_0x89c4('0xa'));var squel=require(_0x89c4('0xb'));var crypto=require(_0x89c4('0xc'));var jsforce=require(_0x89c4('0xd'));var deskjs=require(_0x89c4('0xe'));var toCsv=require(_0x89c4('0xf'));var querystring=require(_0x89c4('0x10'));var Papa=require(_0x89c4('0x11'));var Redis=require(_0x89c4('0x12'));var authService=require(_0x89c4('0x13'));var qs=require(_0x89c4('0x14'));var as=require(_0x89c4('0x15'));var hardwareService=require(_0x89c4('0x16'));var logger=require(_0x89c4('0x17'))(_0x89c4('0x18'));var utils=require(_0x89c4('0x19'));var config=require(_0x89c4('0x1a'));var licenseUtil=require(_0x89c4('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x89c4('0x1c')],{'host':_0x89c4('0x1d'),'port':0x18eb});var socket=require(_0x89c4('0x1e'))(new Redis(config[_0x89c4('0x1c')]));require(_0x89c4('0x1f'))[_0x89c4('0x20')](socket);function respondWithStatusCode(_0x84b446,_0x5aca22){_0x5aca22=_0x5aca22||0xcc;return function(_0x132689){if(_0x132689){return _0x84b446[_0x89c4('0x21')](_0x5aca22);}return _0x84b446[_0x89c4('0x22')](_0x5aca22)[_0x89c4('0x23')]();};}function respondWithResult(_0x5cd765,_0x654e7f){_0x654e7f=_0x654e7f||0xc8;return function(_0x2c9a85){if(_0x2c9a85){return _0x5cd765[_0x89c4('0x22')](_0x654e7f)['json'](_0x2c9a85);}};}function respondWithFilteredResult(_0x41cb06,_0x4ddd24){return function(_0x29342c){if(_0x29342c){var _0x477a19=typeof _0x4ddd24['offset']===_0x89c4('0x24')&&typeof _0x4ddd24['limit']==='undefined';var _0x40617b=_0x29342c[_0x89c4('0x25')];var _0x5cb1a9=_0x477a19?0x0:_0x4ddd24['offset'];var _0x1303ca=_0x477a19?_0x29342c['count']:_0x4ddd24[_0x89c4('0x26')]+_0x4ddd24[_0x89c4('0x27')];var _0x55473d;if(_0x1303ca>=_0x40617b){_0x1303ca=_0x40617b;_0x55473d=0xc8;}else{_0x55473d=0xce;}_0x41cb06[_0x89c4('0x22')](_0x55473d);return _0x41cb06[_0x89c4('0x28')](_0x89c4('0x29'),_0x5cb1a9+'-'+_0x1303ca+'/'+_0x40617b)[_0x89c4('0x2a')](_0x29342c);}return null;};}function patchUpdates(_0x15ad38){return function(_0x470d1c){try{jsonpatch['apply'](_0x470d1c,_0x15ad38,!![]);}catch(_0x330226){return BPromise[_0x89c4('0x2b')](_0x330226);}return _0x470d1c['save']();};}function saveUpdates(_0x2e7e6b,_0x222915){return function(_0x13059b){if(_0x13059b){return _0x13059b[_0x89c4('0x2c')](_0x2e7e6b)[_0x89c4('0x2d')](function(_0xa739bd){return _0xa739bd;});}return null;};}function removeEntity(_0x4f0b19,_0x13d4db){return function(_0x3b2aa7){if(_0x3b2aa7){return _0x3b2aa7[_0x89c4('0x2e')]()[_0x89c4('0x2d')](function(){_0x4f0b19[_0x89c4('0x22')](0xcc)[_0x89c4('0x23')]();});}};}function handleEntityNotFound(_0x1031f5,_0x45b4f1){return function(_0x256b9f){if(!_0x256b9f){_0x1031f5[_0x89c4('0x21')](0x194);}return _0x256b9f;};}function handleError(_0xcba596,_0x3ee2ff){_0x3ee2ff=_0x3ee2ff||0x1f4;return function(_0x79e258){logger[_0x89c4('0x2f')](_0x79e258['stack']);if(_0x79e258['name']){delete _0x79e258[_0x89c4('0x30')];}_0xcba596['status'](_0x3ee2ff)[_0x89c4('0x31')](_0x79e258);};}exports[_0x89c4('0x32')]=function(_0x3ddbf1,_0x387e72){var _0x2c732a={'raw':![],'where':{'id':_0x3ddbf1[_0x89c4('0x33')]['id']}},_0x24f61e={};_0x24f61e[_0x89c4('0x34')]=_[_0x89c4('0x35')](db[_0x89c4('0x36')][_0x89c4('0x37')]);_0x24f61e['query']=_['keys'](_0x3ddbf1['query']);_0x24f61e[_0x89c4('0x38')]=_[_0x89c4('0x39')](_0x24f61e[_0x89c4('0x34')],_0x24f61e[_0x89c4('0x3a')]);_0x2c732a[_0x89c4('0x3b')]=_[_0x89c4('0x39')](_0x24f61e[_0x89c4('0x34')],qs[_0x89c4('0x3c')](_0x3ddbf1[_0x89c4('0x3a')][_0x89c4('0x3c')]));_0x2c732a[_0x89c4('0x3b')]=_0x2c732a[_0x89c4('0x3b')]['length']?_0x2c732a[_0x89c4('0x3b')]:_0x24f61e['model'];if(_0x3ddbf1['query'][_0x89c4('0x3d')]){_0x2c732a[_0x89c4('0x3e')]=[{'all':!![]}];}_0x2c732a=_[_0x89c4('0x3f')]({},_0x2c732a,_0x3ddbf1[_0x89c4('0x40')]);return db[_0x89c4('0x36')]['find'](_0x2c732a)[_0x89c4('0x2d')](handleEntityNotFound(_0x387e72,null))[_0x89c4('0x2d')](respondWithResult(_0x387e72,null))[_0x89c4('0x41')](handleError(_0x387e72,null));};exports['destroy']=function(_0x31a913,_0x483239){return db[_0x89c4('0x36')][_0x89c4('0x42')]({'where':{'id':_0x31a913[_0x89c4('0x33')]['id']}})[_0x89c4('0x2d')](handleEntityNotFound(_0x483239,null))[_0x89c4('0x2d')](removeEntity(_0x483239,null))[_0x89c4('0x41')](handleError(_0x483239,null));};function widgetAttributes(_0x941071){try{switch(_0x941071[_0x89c4('0x43')]){case _0x89c4('0x44'):return[{'name':_0x89c4('0x45'),'value':_0x941071[_0x89c4('0x45')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x0]?_0x941071[_0x89c4('0x46')][0x0]['value']:undefined)||_0x89c4('0x47')}];case _0x89c4('0x48'):return[{'name':_0x89c4('0x49'),'value':_0x941071[_0x89c4('0x49')]||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x0]?_0x941071[_0x89c4('0x46')][0x0][_0x89c4('0x4a')]:undefined)||''}];case'clock':return[{'name':_0x89c4('0x4b'),'value':_0x941071[_0x89c4('0x4b')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x0]?_0x941071['attrs'][0x0][_0x89c4('0x4a')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x941071[_0x89c4('0x4c')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x1]?_0x941071[_0x89c4('0x46')][0x1]['value']:undefined)||_0x89c4('0x4d')},{'name':_0x89c4('0x4e'),'value':_0x941071[_0x89c4('0x4e')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x2]?_0x941071[_0x89c4('0x46')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x89c4('0x4f'),'value':_0x941071[_0x89c4('0x4f')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x0]?_0x941071[_0x89c4('0x46')][0x0][_0x89c4('0x4a')]:undefined)||_0x89c4('0x50')},{'name':_0x89c4('0x51'),'value':_0x941071['attrVoiceQueues']||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x1]?_0x941071[_0x89c4('0x46')][0x1][_0x89c4('0x4a')]:undefined)||[]},{'name':'attrFontSize','value':_0x941071[_0x89c4('0x4e')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x2]?_0x941071[_0x89c4('0x46')][0x2][_0x89c4('0x4a')]:undefined)||0x14},{'name':_0x89c4('0x52'),'value':_0x941071['attrChannel']||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x3]?_0x941071['attrs'][0x3][_0x89c4('0x4a')]:undefined)||_0x89c4('0x53')},{'name':'attrEmailAccounts','value':_0x941071[_0x89c4('0x54')]||(_0x941071['attrs']&&_0x941071['attrs'][0x4]?_0x941071[_0x89c4('0x46')][0x4][_0x89c4('0x4a')]:undefined)||''},{'name':_0x89c4('0x55'),'value':_0x941071[_0x89c4('0x55')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x5]?_0x941071[_0x89c4('0x46')][0x5][_0x89c4('0x4a')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x941071[_0x89c4('0x56')]||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x6]?_0x941071[_0x89c4('0x46')][0x6][_0x89c4('0x4a')]:undefined)||''},{'name':_0x89c4('0x57'),'value':_0x941071['attrOpenchannelAccounts']||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x7]?_0x941071[_0x89c4('0x46')][0x7][_0x89c4('0x4a')]:undefined)||''},{'name':_0x89c4('0x58'),'value':_0x941071[_0x89c4('0x58')]||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x8]?_0x941071['attrs'][0x8]['value']:undefined)||''},{'name':_0x89c4('0x59'),'value':_0x941071[_0x89c4('0x59')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x9]?_0x941071[_0x89c4('0x46')][0x9][_0x89c4('0x4a')]:undefined)||''}];case _0x89c4('0x5a'):case _0x89c4('0x5b'):return[{'name':_0x89c4('0x5c'),'value':_0x941071[_0x89c4('0x5c')]||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x0]?_0x941071[_0x89c4('0x46')][0x0][_0x89c4('0x4a')]:undefined)||_0x89c4('0x50')},{'name':'attrSerie2','value':_0x941071[_0x89c4('0x5d')]||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x1]?_0x941071[_0x89c4('0x46')][0x1]['value']:undefined)||null},{'name':_0x89c4('0x5e'),'value':_0x941071[_0x89c4('0x5e')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x2]?_0x941071['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x941071[_0x89c4('0x51')]||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x3]?_0x941071[_0x89c4('0x46')][0x3][_0x89c4('0x4a')]:undefined)||[]},{'name':_0x89c4('0x52'),'value':_0x941071[_0x89c4('0x52')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x4]?_0x941071[_0x89c4('0x46')][0x4][_0x89c4('0x4a')]:undefined)||_0x89c4('0x53')},{'name':_0x89c4('0x54'),'value':_0x941071[_0x89c4('0x54')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x5]?_0x941071['attrs'][0x5][_0x89c4('0x4a')]:undefined)||''},{'name':_0x89c4('0x55'),'value':_0x941071['attrFaxAccounts']||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x6]?_0x941071['attrs'][0x6]['value']:undefined)||''},{'name':_0x89c4('0x56'),'value':_0x941071['attrSmsAccounts']||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x7]?_0x941071[_0x89c4('0x46')][0x7]['value']:undefined)||''},{'name':_0x89c4('0x57'),'value':_0x941071[_0x89c4('0x57')]||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x8]?_0x941071[_0x89c4('0x46')][0x8]['value']:undefined)||''},{'name':_0x89c4('0x58'),'value':_0x941071[_0x89c4('0x58')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x9]?_0x941071['attrs'][0x9]['value']:undefined)||''},{'name':_0x89c4('0x59'),'value':_0x941071['attrChatWebsites']||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0xa]?_0x941071['attrs'][0xa][_0x89c4('0x4a')]:undefined)||''}];case _0x89c4('0x5f'):return[{'name':_0x89c4('0x60'),'type':_0x941071[_0x89c4('0x61')]||(_0x941071[_0x89c4('0x46')]&&_0x941071['attrs'][0x0]?_0x941071['attrs'][0x0][_0x89c4('0x43')]:undefined)||null,'value':_0x941071[_0x89c4('0x60')]||(_0x941071['attrs']&&_0x941071[_0x89c4('0x46')][0x0]?_0x941071[_0x89c4('0x46')][0x0][_0x89c4('0x4a')]:undefined)||null},{'name':_0x89c4('0x62'),'value':_0x941071[_0x89c4('0x62')]||(_0x941071[_0x89c4('0x46')]&&_0x941071[_0x89c4('0x46')][0x1]?_0x941071[_0x89c4('0x46')][0x1][_0x89c4('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x5bcf0d){logger['error'](_0x89c4('0x63'),JSON[_0x89c4('0x64')](_0x5bcf0d));return[];}}exports[_0x89c4('0x65')]=function(_0x522af7,_0x5e87e6){if(_0x522af7[_0x89c4('0x66')]){_0x522af7[_0x89c4('0x66')]['attrs']=widgetAttributes(_0x522af7[_0x89c4('0x66')]);}return db[_0x89c4('0x36')]['create'](_0x522af7[_0x89c4('0x66')],{})[_0x89c4('0x2d')](respondWithResult(_0x5e87e6,0xc9))[_0x89c4('0x41')](handleError(_0x5e87e6,null));};exports[_0x89c4('0x2c')]=function(_0x2ef456,_0x2368d8){if(_0x2ef456['body']['id']){delete _0x2ef456[_0x89c4('0x66')]['id'];}_0x2ef456['body'][_0x89c4('0x46')]=widgetAttributes(_0x2ef456['body']);return db[_0x89c4('0x36')][_0x89c4('0x42')]({'where':{'id':_0x2ef456[_0x89c4('0x33')]['id']}})[_0x89c4('0x2d')](handleEntityNotFound(_0x2368d8,null))[_0x89c4('0x2d')](saveUpdates(_0x2ef456[_0x89c4('0x66')],null))[_0x89c4('0x2d')](respondWithResult(_0x2368d8,null))[_0x89c4('0x41')](handleError(_0x2368d8,null));}; \ No newline at end of file +var _0xafdd=['attrSerie3','voice','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','model','keys','DashboardItem','rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','find','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0xafdd,0x19a));var _0xdafd=function(_0x3ceb8e,_0x61e4b3){_0x3ceb8e=_0x3ceb8e-0x0;var _0x19f9c3=_0xafdd[_0x3ceb8e];return _0x19f9c3;};'use strict';var emlformat=require(_0xdafd('0x0'));var rimraf=require(_0xdafd('0x1'));var zipdir=require(_0xdafd('0x2'));var jsonpatch=require(_0xdafd('0x3'));var rp=require(_0xdafd('0x4'));var moment=require(_0xdafd('0x5'));var BPromise=require(_0xdafd('0x6'));var Mustache=require(_0xdafd('0x7'));var util=require('util');var path=require(_0xdafd('0x8'));var sox=require(_0xdafd('0x9'));var csv=require(_0xdafd('0xa'));var ejs=require(_0xdafd('0xb'));var fs=require('fs');var fs_extra=require(_0xdafd('0xc'));var _=require(_0xdafd('0xd'));var squel=require(_0xdafd('0xe'));var crypto=require('crypto');var jsforce=require(_0xdafd('0xf'));var deskjs=require(_0xdafd('0x10'));var toCsv=require(_0xdafd('0xa'));var querystring=require('querystring');var Papa=require(_0xdafd('0x11'));var Redis=require(_0xdafd('0x12'));var authService=require(_0xdafd('0x13'));var qs=require(_0xdafd('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdafd('0x15'));var logger=require(_0xdafd('0x16'))(_0xdafd('0x17'));var utils=require(_0xdafd('0x18'));var config=require(_0xdafd('0x19'));var licenseUtil=require(_0xdafd('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdafd('0x1b')]=_['defaults'](config['redis'],{'host':_0xdafd('0x1c'),'port':0x18eb});var socket=require(_0xdafd('0x1d'))(new Redis(config['redis']));require(_0xdafd('0x1e'))['register'](socket);function respondWithStatusCode(_0x4b09da,_0x1c312d){_0x1c312d=_0x1c312d||0xcc;return function(_0x14b895){if(_0x14b895){return _0x4b09da[_0xdafd('0x1f')](_0x1c312d);}return _0x4b09da[_0xdafd('0x20')](_0x1c312d)[_0xdafd('0x21')]();};}function respondWithResult(_0x496515,_0x47240f){_0x47240f=_0x47240f||0xc8;return function(_0x1842d3){if(_0x1842d3){return _0x496515[_0xdafd('0x20')](_0x47240f)['json'](_0x1842d3);}};}function respondWithFilteredResult(_0xb382ca,_0x15beca){return function(_0x4fc3a4){if(_0x4fc3a4){var _0x4e6ccc=typeof _0x15beca[_0xdafd('0x22')]==='undefined'&&typeof _0x15beca[_0xdafd('0x23')]===_0xdafd('0x24');var _0x1e64d3=_0x4fc3a4[_0xdafd('0x25')];var _0x1c2029=_0x4e6ccc?0x0:_0x15beca[_0xdafd('0x22')];var _0x44f825=_0x4e6ccc?_0x4fc3a4[_0xdafd('0x25')]:_0x15beca[_0xdafd('0x22')]+_0x15beca[_0xdafd('0x23')];var _0xee767e;if(_0x44f825>=_0x1e64d3){_0x44f825=_0x1e64d3;_0xee767e=0xc8;}else{_0xee767e=0xce;}_0xb382ca[_0xdafd('0x20')](_0xee767e);return _0xb382ca[_0xdafd('0x26')](_0xdafd('0x27'),_0x1c2029+'-'+_0x44f825+'/'+_0x1e64d3)['json'](_0x4fc3a4);}return null;};}function patchUpdates(_0x230495){return function(_0x5127a2){try{jsonpatch[_0xdafd('0x28')](_0x5127a2,_0x230495,!![]);}catch(_0x5e96cc){return BPromise[_0xdafd('0x29')](_0x5e96cc);}return _0x5127a2[_0xdafd('0x2a')]();};}function saveUpdates(_0x7f10f6,_0x3d250d){return function(_0xfc36d7){if(_0xfc36d7){return _0xfc36d7[_0xdafd('0x2b')](_0x7f10f6)[_0xdafd('0x2c')](function(_0x30cba9){return _0x30cba9;});}return null;};}function removeEntity(_0x3846dd,_0x5cd11d){return function(_0x26349d){if(_0x26349d){return _0x26349d[_0xdafd('0x2d')]()[_0xdafd('0x2c')](function(){_0x3846dd[_0xdafd('0x20')](0xcc)[_0xdafd('0x21')]();});}};}function handleEntityNotFound(_0x25f277,_0x383845){return function(_0x29037e){if(!_0x29037e){_0x25f277[_0xdafd('0x1f')](0x194);}return _0x29037e;};}function handleError(_0x18dd7a,_0x4c5363){_0x4c5363=_0x4c5363||0x1f4;return function(_0x243182){logger[_0xdafd('0x2e')](_0x243182[_0xdafd('0x2f')]);if(_0x243182[_0xdafd('0x30')]){delete _0x243182[_0xdafd('0x30')];}_0x18dd7a[_0xdafd('0x20')](_0x4c5363)['send'](_0x243182);};}exports['show']=function(_0x512562,_0xcca4f){var _0xdb822e={'raw':![],'where':{'id':_0x512562['params']['id']}},_0x568996={};_0x568996[_0xdafd('0x31')]=_[_0xdafd('0x32')](db[_0xdafd('0x33')][_0xdafd('0x34')]);_0x568996[_0xdafd('0x35')]=_[_0xdafd('0x32')](_0x512562[_0xdafd('0x35')]);_0x568996['filters']=_[_0xdafd('0x36')](_0x568996[_0xdafd('0x31')],_0x568996[_0xdafd('0x35')]);_0xdb822e['attributes']=_[_0xdafd('0x36')](_0x568996[_0xdafd('0x31')],qs['fields'](_0x512562[_0xdafd('0x35')][_0xdafd('0x37')]));_0xdb822e[_0xdafd('0x38')]=_0xdb822e['attributes'][_0xdafd('0x39')]?_0xdb822e[_0xdafd('0x38')]:_0x568996[_0xdafd('0x31')];if(_0x512562[_0xdafd('0x35')][_0xdafd('0x3a')]){_0xdb822e[_0xdafd('0x3b')]=[{'all':!![]}];}_0xdb822e=_[_0xdafd('0x3c')]({},_0xdb822e,_0x512562['options']);return db[_0xdafd('0x33')][_0xdafd('0x3d')](_0xdb822e)[_0xdafd('0x2c')](handleEntityNotFound(_0xcca4f,null))[_0xdafd('0x2c')](respondWithResult(_0xcca4f,null))[_0xdafd('0x3e')](handleError(_0xcca4f,null));};exports['destroy']=function(_0x386cf6,_0x21d724){return db['DashboardItem'][_0xdafd('0x3d')]({'where':{'id':_0x386cf6[_0xdafd('0x3f')]['id']}})[_0xdafd('0x2c')](handleEntityNotFound(_0x21d724,null))[_0xdafd('0x2c')](removeEntity(_0x21d724,null))[_0xdafd('0x3e')](handleError(_0x21d724,null));};function widgetAttributes(_0x1611f0){try{switch(_0x1611f0[_0xdafd('0x40')]){case _0xdafd('0x41'):return[{'name':_0xdafd('0x42'),'value':_0x1611f0[_0xdafd('0x42')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0][_0xdafd('0x44')]:undefined)||_0xdafd('0x45')}];case _0xdafd('0x46'):return[{'name':_0xdafd('0x47'),'value':_0x1611f0[_0xdafd('0x47')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0][_0xdafd('0x44')]:undefined)||''}];case _0xdafd('0x48'):return[{'name':_0xdafd('0x49'),'value':_0x1611f0[_0xdafd('0x49')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0['attrs'][0x0]?_0x1611f0['attrs'][0x0][_0xdafd('0x44')]:undefined)||'HH:mm:ss'},{'name':_0xdafd('0x4a'),'value':_0x1611f0[_0xdafd('0x4a')]||(_0x1611f0['attrs']&&_0x1611f0['attrs'][0x1]?_0x1611f0[_0xdafd('0x43')][0x1][_0xdafd('0x44')]:undefined)||_0xdafd('0x4b')},{'name':_0xdafd('0x4c'),'value':_0x1611f0[_0xdafd('0x4c')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x2]?_0x1611f0[_0xdafd('0x43')][0x2][_0xdafd('0x44')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1611f0[_0xdafd('0x4d')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0][_0xdafd('0x44')]:undefined)||_0xdafd('0x4e')},{'name':_0xdafd('0x4f'),'value':_0x1611f0[_0xdafd('0x4f')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x1]?_0x1611f0[_0xdafd('0x43')][0x1][_0xdafd('0x44')]:undefined)||[]},{'name':_0xdafd('0x4c'),'value':_0x1611f0['attrFontSize']||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0['attrs'][0x2]?_0x1611f0[_0xdafd('0x43')][0x2]['value']:undefined)||0x14},{'name':_0xdafd('0x50'),'value':_0x1611f0[_0xdafd('0x50')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x3]?_0x1611f0[_0xdafd('0x43')][0x3][_0xdafd('0x44')]:undefined)||'voice'},{'name':_0xdafd('0x51'),'value':_0x1611f0[_0xdafd('0x51')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x4]?_0x1611f0[_0xdafd('0x43')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x1611f0[_0xdafd('0x52')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x5]?_0x1611f0[_0xdafd('0x43')][0x5][_0xdafd('0x44')]:undefined)||''},{'name':_0xdafd('0x53'),'value':_0x1611f0[_0xdafd('0x53')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x6]?_0x1611f0['attrs'][0x6][_0xdafd('0x44')]:undefined)||''},{'name':_0xdafd('0x54'),'value':_0x1611f0[_0xdafd('0x54')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0['attrs'][0x7]?_0x1611f0[_0xdafd('0x43')][0x7][_0xdafd('0x44')]:undefined)||''},{'name':_0xdafd('0x55'),'value':_0x1611f0[_0xdafd('0x55')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0['attrs'][0x8]?_0x1611f0['attrs'][0x8][_0xdafd('0x44')]:undefined)||''},{'name':_0xdafd('0x56'),'value':_0x1611f0['attrChatWebsites']||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0x9]?_0x1611f0[_0xdafd('0x43')][0x9]['value']:undefined)||''}];case _0xdafd('0x57'):case _0xdafd('0x58'):return[{'name':_0xdafd('0x59'),'value':_0x1611f0['attrSerie1']||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0]['value']:undefined)||_0xdafd('0x4e')},{'name':'attrSerie2','value':_0x1611f0['attrSerie2']||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x1]?_0x1611f0[_0xdafd('0x43')][0x1][_0xdafd('0x44')]:undefined)||null},{'name':_0xdafd('0x5a'),'value':_0x1611f0[_0xdafd('0x5a')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x2]?_0x1611f0['attrs'][0x2][_0xdafd('0x44')]:undefined)||null},{'name':_0xdafd('0x4f'),'value':_0x1611f0['attrVoiceQueues']||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x3]?_0x1611f0[_0xdafd('0x43')][0x3][_0xdafd('0x44')]:undefined)||[]},{'name':_0xdafd('0x50'),'value':_0x1611f0['attrChannel']||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x4]?_0x1611f0[_0xdafd('0x43')][0x4][_0xdafd('0x44')]:undefined)||_0xdafd('0x5b')},{'name':'attrEmailAccounts','value':_0x1611f0[_0xdafd('0x51')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0['attrs'][0x5]?_0x1611f0['attrs'][0x5][_0xdafd('0x44')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x1611f0[_0xdafd('0x52')]||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0x6]?_0x1611f0[_0xdafd('0x43')][0x6][_0xdafd('0x44')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1611f0[_0xdafd('0x53')]||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0x7]?_0x1611f0[_0xdafd('0x43')][0x7]['value']:undefined)||''},{'name':_0xdafd('0x54'),'value':_0x1611f0[_0xdafd('0x54')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x8]?_0x1611f0[_0xdafd('0x43')][0x8]['value']:undefined)||''},{'name':_0xdafd('0x55'),'value':_0x1611f0[_0xdafd('0x55')]||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0x9]?_0x1611f0[_0xdafd('0x43')][0x9][_0xdafd('0x44')]:undefined)||''},{'name':_0xdafd('0x56'),'value':_0x1611f0[_0xdafd('0x56')]||(_0x1611f0['attrs']&&_0x1611f0[_0xdafd('0x43')][0xa]?_0x1611f0['attrs'][0xa]['value']:undefined)||''}];case _0xdafd('0x5c'):return[{'name':'attrReport','type':_0x1611f0[_0xdafd('0x5d')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0]['type']:undefined)||null,'value':_0x1611f0[_0xdafd('0x5e')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x0]?_0x1611f0[_0xdafd('0x43')][0x0][_0xdafd('0x44')]:undefined)||null},{'name':_0xdafd('0x5f'),'value':_0x1611f0[_0xdafd('0x5f')]||(_0x1611f0[_0xdafd('0x43')]&&_0x1611f0[_0xdafd('0x43')][0x1]?_0x1611f0[_0xdafd('0x43')][0x1][_0xdafd('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x337394){logger[_0xdafd('0x2e')](_0xdafd('0x60'),JSON[_0xdafd('0x61')](_0x337394));return[];}}exports[_0xdafd('0x62')]=function(_0x190930,_0x54267d){if(_0x190930[_0xdafd('0x63')]){_0x190930['body'][_0xdafd('0x43')]=widgetAttributes(_0x190930['body']);}return db[_0xdafd('0x33')][_0xdafd('0x62')](_0x190930['body'],{})['then'](respondWithResult(_0x54267d,0xc9))[_0xdafd('0x3e')](handleError(_0x54267d,null));};exports[_0xdafd('0x2b')]=function(_0x1b3227,_0x47f9aa){if(_0x1b3227['body']['id']){delete _0x1b3227['body']['id'];}_0x1b3227[_0xdafd('0x63')]['attrs']=widgetAttributes(_0x1b3227[_0xdafd('0x63')]);return db['DashboardItem'][_0xdafd('0x3d')]({'where':{'id':_0x1b3227[_0xdafd('0x3f')]['id']}})[_0xdafd('0x2c')](handleEntityNotFound(_0x47f9aa,null))[_0xdafd('0x2c')](saveUpdates(_0x1b3227[_0xdafd('0x63')],null))['then'](respondWithResult(_0x47f9aa,null))['catch'](handleError(_0x47f9aa,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index f5f43ba..57a58c9 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 _0xf2bd=['events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit','hook'];(function(_0x2a6d45,_0x3c9321){var _0x295253=function(_0x51d622){while(--_0x51d622){_0x2a6d45['push'](_0x2a6d45['shift']());}};_0x295253(++_0x3c9321);}(_0xf2bd,0x118));var _0xdf2b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xf2bd[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require(_0xdf2b('0x0'));var DashboardItem=require(_0xdf2b('0x1'))['db'][_0xdf2b('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xdf2b('0x3')](0x0);var events={'afterCreate':_0xdf2b('0x4'),'afterUpdate':'update','afterDestroy':_0xdf2b('0x5')};function emitEvent(_0x46cbd5){return function(_0x16348d,_0x2f8a94,_0x2b7b06){DashboardItemEvents[_0xdf2b('0x6')](_0x46cbd5+':'+_0x16348d['id'],_0x16348d);DashboardItemEvents[_0xdf2b('0x6')](_0x46cbd5,_0x16348d);_0x2b7b06(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xdf2b('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x834c=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x834c,0x73));var _0xc834=function(_0x589f71,_0x212326){_0x589f71=_0x589f71-0x0;var _0x5763bd=_0x834c[_0x589f71];return _0x5763bd;};'use strict';var EventEmitter=require(_0xc834('0x0'));var DashboardItem=require(_0xc834('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc834('0x2')](0x0);var events={'afterCreate':_0xc834('0x3'),'afterUpdate':_0xc834('0x4'),'afterDestroy':_0xc834('0x5')};function emitEvent(_0x5e464a){return function(_0x118aab,_0x2cd35b,_0x3b72ad){DashboardItemEvents[_0xc834('0x6')](_0x5e464a+':'+_0x118aab['id'],_0x118aab);DashboardItemEvents['emit'](_0x5e464a,_0x118aab);_0x3b72ad(null);};}for(var e in events){if(events[_0xc834('0x7')](e)){var event=events[e];DashboardItem[_0xc834('0x8')](e,emitEvent(event));}}module[_0xc834('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 7396dfb..4071ea8 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 _0x9901=['DashboardItem','dashboard_items','util','api','moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x189d3c,_0x5efebf){var _0x485959=function(_0x1161da){while(--_0x1161da){_0x189d3c['push'](_0x189d3c['shift']());}};_0x485959(++_0x5efebf);}(_0x9901,0x15e));var _0x1990=function(_0x227bfa,_0x51bedc){_0x227bfa=_0x227bfa-0x0;var _0x331aba=_0x9901[_0x227bfa];return _0x331aba;};'use strict';var _=require('lodash');var util=require(_0x1990('0x0'));var logger=require('../../config/logger')(_0x1990('0x1'));var moment=require(_0x1990('0x2'));var BPromise=require(_0x1990('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1990('0x4'));var rimraf=require(_0x1990('0x5'));var config=require(_0x1990('0x6'));var attributes=require(_0x1990('0x7'));module[_0x1990('0x8')]=function(_0x44db1e,_0x29f5fb){return _0x44db1e[_0x1990('0x9')](_0x1990('0xa'),attributes,{'tableName':_0x1990('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61a2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util'];(function(_0xda501a,_0x159d6a){var _0x44be3a=function(_0x5c1c5f){while(--_0x5c1c5f){_0xda501a['push'](_0xda501a['shift']());}};_0x44be3a(++_0x159d6a);}(_0x61a2,0x184));var _0x261a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61a2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x261a('0x0'));var util=require(_0x261a('0x1'));var logger=require('../../config/logger')(_0x261a('0x2'));var moment=require(_0x261a('0x3'));var BPromise=require(_0x261a('0x4'));var rp=require(_0x261a('0x5'));var fs=require('fs');var path=require(_0x261a('0x6'));var rimraf=require(_0x261a('0x7'));var config=require(_0x261a('0x8'));var attributes=require(_0x261a('0x9'));module[_0x261a('0xa')]=function(_0x3bba0c,_0x209c7c){return _0x3bba0c['define'](_0x261a('0xb'),attributes,{'tableName':_0x261a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 585cf96..8113bf4 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 _0x2cc3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5e4310,_0x12167a){var _0x2fae10=function(_0x1e0969){while(--_0x1e0969){_0x5e4310['push'](_0x5e4310['shift']());}};_0x2fae10(++_0x12167a);}(_0x2cc3,0x1c5));var _0x32cc=function(_0x36fcb6,_0x183896){_0x36fcb6=_0x36fcb6-0x0;var _0x240d5a=_0x2cc3[_0x36fcb6];return _0x240d5a;};'use strict';var _=require(_0x32cc('0x0'));var util=require('util');var moment=require(_0x32cc('0x1'));var BPromise=require(_0x32cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32cc('0x3'));var db=require(_0x32cc('0x4'))['db'];var utils=require(_0x32cc('0x5'));var logger=require(_0x32cc('0x6'))(_0x32cc('0x7'));var config=require(_0x32cc('0x8'));var jayson=require(_0x32cc('0x9'));var client=jayson[_0x32cc('0xa')][_0x32cc('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x32cc('0xc'),'port':0x18eb});var socket=require(_0x32cc('0xd'))(new Redis(config['redis']));require(_0x32cc('0xe'))[_0x32cc('0xf')](socket);function respondWithRpcPromise(_0x4d94af,_0x187c8c,_0x4f056a){return new BPromise(function(_0x5422ea,_0x269347){return client[_0x32cc('0x10')](_0x4d94af,_0x4f056a)[_0x32cc('0x11')](function(_0x2d148e){logger[_0x32cc('0x12')](_0x32cc('0x13'),_0x187c8c,_0x32cc('0x14'));logger['debug'](_0x32cc('0x15'),_0x187c8c,_0x32cc('0x14'),JSON[_0x32cc('0x16')](_0x2d148e));if(_0x2d148e[_0x32cc('0x17')]){if(_0x2d148e[_0x32cc('0x17')][_0x32cc('0x18')]===0x1f4){logger[_0x32cc('0x17')](_0x32cc('0x13'),_0x187c8c,_0x2d148e[_0x32cc('0x17')][_0x32cc('0x19')]);return _0x269347(_0x2d148e[_0x32cc('0x17')][_0x32cc('0x19')]);}logger['error'](_0x32cc('0x13'),_0x187c8c,_0x2d148e[_0x32cc('0x17')][_0x32cc('0x19')]);return _0x5422ea(_0x2d148e[_0x32cc('0x17')]['message']);}else{logger[_0x32cc('0x12')](_0x32cc('0x13'),_0x187c8c,_0x32cc('0x14'));_0x5422ea(_0x2d148e['result'][_0x32cc('0x19')]);}})[_0x32cc('0x1a')](function(_0x4a845f){logger[_0x32cc('0x17')](_0x32cc('0x13'),_0x187c8c,_0x4a845f);_0x269347(_0x4a845f);});});} \ No newline at end of file +var _0x22b7=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x22b7,0x169));var _0x722b=function(_0x5637f5,_0x1082c5){_0x5637f5=_0x5637f5-0x0;var _0x2f1873=_0x22b7[_0x5637f5];return _0x2f1873;};'use strict';var _=require(_0x722b('0x0'));var util=require(_0x722b('0x1'));var moment=require(_0x722b('0x2'));var BPromise=require(_0x722b('0x3'));var rs=require(_0x722b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x722b('0x5'))['db'];var utils=require(_0x722b('0x6'));var logger=require(_0x722b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x722b('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x722b('0x9')]=_[_0x722b('0xa')](config[_0x722b('0x9')],{'host':_0x722b('0xb'),'port':0x18eb});var socket=require(_0x722b('0xc'))(new Redis(config[_0x722b('0x9')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x4c858b,_0x243b5a,_0x2ad114){return new BPromise(function(_0x2279d5,_0x291f4c){return client[_0x722b('0xd')](_0x4c858b,_0x2ad114)[_0x722b('0xe')](function(_0x4b5174){logger[_0x722b('0xf')]('DashboardItem,\x20%s,\x20%s',_0x243b5a,_0x722b('0x10'));logger[_0x722b('0x11')](_0x722b('0x12'),_0x243b5a,_0x722b('0x10'),JSON[_0x722b('0x13')](_0x4b5174));if(_0x4b5174[_0x722b('0x14')]){if(_0x4b5174[_0x722b('0x14')][_0x722b('0x15')]===0x1f4){logger['error'](_0x722b('0x16'),_0x243b5a,_0x4b5174[_0x722b('0x14')][_0x722b('0x17')]);return _0x291f4c(_0x4b5174[_0x722b('0x14')][_0x722b('0x17')]);}logger[_0x722b('0x14')](_0x722b('0x16'),_0x243b5a,_0x4b5174['error'][_0x722b('0x17')]);return _0x2279d5(_0x4b5174[_0x722b('0x14')]['message']);}else{logger[_0x722b('0xf')](_0x722b('0x16'),_0x243b5a,_0x722b('0x10'));_0x2279d5(_0x4b5174[_0x722b('0x18')]['message']);}})[_0x722b('0x19')](function(_0x3d0aa0){logger['error'](_0x722b('0x16'),_0x243b5a,_0x3d0aa0);_0x291f4c(_0x3d0aa0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 4217b84..3f387f4 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 _0xf3c0=['length','dashboardItem:','save','remove'];(function(_0x4ef3fc,_0x25d1a9){var _0x5a5a78=function(_0x447666){while(--_0x447666){_0x4ef3fc['push'](_0x4ef3fc['shift']());}};_0x5a5a78(++_0x25d1a9);}(_0xf3c0,0x92));var _0x0f3c=function(_0x3090a7,_0x4ca963){_0x3090a7=_0x3090a7-0x0;var _0x152a9c=_0xf3c0[_0x3090a7];return _0x152a9c;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x0f3c('0x0'),_0x0f3c('0x1'),'update'];function createListener(_0x52e9b9,_0xf6bc82){return function(_0xeee87b){_0xf6bc82['emit'](_0x52e9b9,_0xeee87b);};}function removeListener(_0x1da7cd,_0x2d67e3){return function(){DashboardItemEvents['removeListener'](_0x1da7cd,_0x2d67e3);};}exports['register']=function(_0x4faaa2){for(var _0x270395=0x0,_0x2231b1=events[_0x0f3c('0x2')];_0x270395<_0x2231b1;_0x270395++){var _0x1b8d2c=events[_0x270395];var _0x2d8baf=createListener(_0x0f3c('0x3')+_0x1b8d2c,_0x4faaa2);DashboardItemEvents['on'](_0x1b8d2c,_0x2d8baf);}}; \ No newline at end of file +var _0x3810=['update','removeListener','register','save','remove'];(function(_0x140afe,_0x20d4bb){var _0x5818d9=function(_0xd51e62){while(--_0xd51e62){_0x140afe['push'](_0x140afe['shift']());}};_0x5818d9(++_0x20d4bb);}(_0x3810,0xc6));var _0x0381=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0x3810[_0x1f1fb4];return _0x12fa15;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x0381('0x0'),_0x0381('0x1'),_0x0381('0x2')];function createListener(_0x477414,_0x502861){return function(_0x48b1c5){_0x502861['emit'](_0x477414,_0x48b1c5);};}function removeListener(_0x907ba3,_0x29215a){return function(){DashboardItemEvents[_0x0381('0x3')](_0x907ba3,_0x29215a);};}exports[_0x0381('0x4')]=function(_0x9e3dc9){for(var _0x49d21f=0x0,_0x2296b6=events['length'];_0x49d21f<_0x2296b6;_0x49d21f++){var _0x5f31d7=events[_0x49d21f];var _0x1a54b1=createListener('dashboardItem:'+_0x5f31d7,_0x9e3dc9);DashboardItemEvents['on'](_0x5f31d7,_0x1a54b1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index e2dc425..7a8480a 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 _0x7947=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post'];(function(_0x52efd5,_0x17f922){var _0x541cc0=function(_0x4c7e87){while(--_0x4c7e87){_0x52efd5['push'](_0x52efd5['shift']());}};_0x541cc0(++_0x17f922);}(_0x7947,0x1f2));var _0x7794=function(_0x58ab0e,_0x2aaded){_0x58ab0e=_0x58ab0e-0x0;var _0x6186b5=_0x7947[_0x58ab0e];return _0x6186b5;};'use strict';var multer=require('multer');var util=require(_0x7794('0x0'));var path=require(_0x7794('0x1'));var timeout=require(_0x7794('0x2'));var express=require(_0x7794('0x3'));var router=express[_0x7794('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7794('0x5'));var interaction=require(_0x7794('0x6'));var config=require(_0x7794('0x7'));var controller=require('./dashboardItem.controller');router[_0x7794('0x8')](_0x7794('0x9'),auth[_0x7794('0xa')](),controller['show']);router[_0x7794('0xb')]('/',auth[_0x7794('0xa')](),controller['create']);router[_0x7794('0xc')](_0x7794('0x9'),auth[_0x7794('0xa')](),controller[_0x7794('0xd')]);router[_0x7794('0xe')](_0x7794('0x9'),auth[_0x7794('0xa')](),controller[_0x7794('0xf')]);module[_0x7794('0x10')]=router; \ No newline at end of file +var _0x16bd=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','put','update','delete','destroy','multer','util','path'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0x16bd,0x11e));var _0xd16b=function(_0x2a7c2a,_0x37cc9e){_0x2a7c2a=_0x2a7c2a-0x0;var _0x195732=_0x16bd[_0x2a7c2a];return _0x195732;};'use strict';var multer=require(_0xd16b('0x0'));var util=require(_0xd16b('0x1'));var path=require(_0xd16b('0x2'));var timeout=require(_0xd16b('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd16b('0x4'));var auth=require(_0xd16b('0x5'));var interaction=require(_0xd16b('0x6'));var config=require(_0xd16b('0x7'));var controller=require(_0xd16b('0x8'));router[_0xd16b('0x9')](_0xd16b('0xa'),auth[_0xd16b('0xb')](),controller['show']);router[_0xd16b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd16b('0xd')](_0xd16b('0xa'),auth[_0xd16b('0xb')](),controller[_0xd16b('0xe')]);router[_0xd16b('0xf')](_0xd16b('0xa'),auth[_0xd16b('0xb')](),controller[_0xd16b('0x10')]);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 d71cfc0..fd512dc 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 _0x7899=['ENUM','second','third','sequelize','exports','STRING'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x7899,0x69));var _0x9789=function(_0x252328,_0x4c22f0){_0x252328=_0x252328-0x0;var _0xaa85b7=_0x7899[_0x252328];return _0xaa85b7;};'use strict';var Sequelize=require(_0x9789('0x0'));module[_0x9789('0x1')]={'name':{'type':Sequelize[_0x9789('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x9789('0x3')]('first',_0x9789('0x4'),_0x9789('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbccd=['STRING','sequelize','exports','ENUM','first','second'];(function(_0x3457b4,_0x4cd8f9){var _0xaa8fa9=function(_0x51897a){while(--_0x51897a){_0x3457b4['push'](_0x3457b4['shift']());}};_0xaa8fa9(++_0x4cd8f9);}(_0xbccd,0x133));var _0xdbcc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xbccd[_0x1d9aa0];return _0x226868;};'use strict';var Sequelize=require(_0xdbcc('0x0'));module[_0xdbcc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xdbcc('0x2')](_0xdbcc('0x3'),_0xdbcc('0x4'),'third'),'allowNull':![],'defaultValue':_0xdbcc('0x3')},'description':{'type':Sequelize[_0xdbcc('0x5')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0d43d5e..7b2ef1b 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 _0x0a24=['save','update','then','get','UserProfileResource','sendStatus','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x0a24,0xd0));var _0x40a2=function(_0x3ce15d,_0x13bf9b){_0x3ce15d=_0x3ce15d-0x0;var _0x163ae4=_0x0a24[_0x3ce15d];return _0x163ae4;};'use strict';var emlformat=require(_0x40a2('0x0'));var rimraf=require(_0x40a2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40a2('0x2'));var rp=require('request-promise');var moment=require(_0x40a2('0x3'));var BPromise=require(_0x40a2('0x4'));var Mustache=require(_0x40a2('0x5'));var util=require('util');var path=require(_0x40a2('0x6'));var sox=require(_0x40a2('0x7'));var csv=require(_0x40a2('0x8'));var ejs=require(_0x40a2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x40a2('0xa'));var crypto=require(_0x40a2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x40a2('0xc'));var toCsv=require(_0x40a2('0x8'));var querystring=require(_0x40a2('0xd'));var Papa=require(_0x40a2('0xe'));var Redis=require('ioredis');var authService=require(_0x40a2('0xf'));var qs=require(_0x40a2('0x10'));var as=require(_0x40a2('0x11'));var hardwareService=require(_0x40a2('0x12'));var logger=require(_0x40a2('0x13'))(_0x40a2('0x14'));var utils=require(_0x40a2('0x15'));var config=require(_0x40a2('0x16'));var licenseUtil=require(_0x40a2('0x17'));var db=require(_0x40a2('0x18'))['db'];function respondWithStatusCode(_0x567d51,_0x278931){_0x278931=_0x278931||0xcc;return function(_0x18dbdc){if(_0x18dbdc){return _0x567d51['sendStatus'](_0x278931);}return _0x567d51['status'](_0x278931)[_0x40a2('0x19')]();};}function respondWithResult(_0x5cebe2,_0x934bbf){_0x934bbf=_0x934bbf||0xc8;return function(_0x58f748){if(_0x58f748){return _0x5cebe2[_0x40a2('0x1a')](_0x934bbf)[_0x40a2('0x1b')](_0x58f748);}};}function respondWithFilteredResult(_0x5e1302,_0x493af5){return function(_0x48b157){if(_0x48b157){var _0xea6413=typeof _0x493af5[_0x40a2('0x1c')]===_0x40a2('0x1d')&&typeof _0x493af5[_0x40a2('0x1e')]===_0x40a2('0x1d');var _0x2cf631=_0x48b157[_0x40a2('0x1f')];var _0xa2621f=_0xea6413?0x0:_0x493af5[_0x40a2('0x1c')];var _0xf7540c=_0xea6413?_0x48b157[_0x40a2('0x1f')]:_0x493af5[_0x40a2('0x1c')]+_0x493af5[_0x40a2('0x1e')];var _0x2c9b6d;if(_0xf7540c>=_0x2cf631){_0xf7540c=_0x2cf631;_0x2c9b6d=0xc8;}else{_0x2c9b6d=0xce;}_0x5e1302[_0x40a2('0x1a')](_0x2c9b6d);return _0x5e1302[_0x40a2('0x20')](_0x40a2('0x21'),_0xa2621f+'-'+_0xf7540c+'/'+_0x2cf631)[_0x40a2('0x1b')](_0x48b157);}return null;};}function patchUpdates(_0x326937){return function(_0x3c3ac2){try{jsonpatch['apply'](_0x3c3ac2,_0x326937,!![]);}catch(_0x107997){return BPromise[_0x40a2('0x22')](_0x107997);}return _0x3c3ac2[_0x40a2('0x23')]();};}function saveUpdates(_0x385315,_0x7031cd){return function(_0x599b6f){if(_0x599b6f){return _0x599b6f[_0x40a2('0x24')](_0x385315)[_0x40a2('0x25')](function(_0x56571e){return _0x56571e;});}return null;};}function removeEntity(_0x4682de,_0x34c790){return function(_0x39bfe3){if(_0x39bfe3){return _0x39bfe3['destroy']()[_0x40a2('0x25')](function(){var _0x4add54=_0x39bfe3[_0x40a2('0x26')]({'plain':!![]});var _0x514e44='Dispositions';return db[_0x40a2('0x27')]['destroy']({'where':{'type':_0x514e44,'resourceId':_0x4add54['id']}})[_0x40a2('0x25')](function(){return _0x39bfe3;});})[_0x40a2('0x25')](function(){_0x4682de[_0x40a2('0x1a')](0xcc)[_0x40a2('0x19')]();});}};}function handleEntityNotFound(_0x583f5e,_0x5f0ffd){return function(_0x9aa020){if(!_0x9aa020){_0x583f5e[_0x40a2('0x28')](0x194);}return _0x9aa020;};}function handleError(_0x5da3d4,_0x43998d){_0x43998d=_0x43998d||0x1f4;return function(_0x39d7ad){logger['error'](_0x39d7ad[_0x40a2('0x29')]);if(_0x39d7ad['name']){delete _0x39d7ad[_0x40a2('0x2a')];}_0x5da3d4[_0x40a2('0x1a')](_0x43998d)[_0x40a2('0x2b')](_0x39d7ad);};}exports[_0x40a2('0x2c')]=function(_0x7711b5,_0x4f8843){var _0xbafe16={},_0x275521={},_0x41ae85={'count':0x0,'rows':[]};var _0x2ea495=_[_0x40a2('0x2d')](db[_0x40a2('0x2e')][_0x40a2('0x2f')],function(_0x128882){return{'name':_0x128882[_0x40a2('0x30')],'type':_0x128882[_0x40a2('0x31')]['key']};});_0x275521['model']=_['map'](_0x2ea495,'name');_0x275521[_0x40a2('0x32')]=_[_0x40a2('0x33')](_0x7711b5[_0x40a2('0x32')]);_0x275521[_0x40a2('0x34')]=_[_0x40a2('0x35')](_0x275521[_0x40a2('0x36')],_0x275521['query']);_0xbafe16[_0x40a2('0x37')]=_[_0x40a2('0x35')](_0x275521[_0x40a2('0x36')],qs[_0x40a2('0x38')](_0x7711b5[_0x40a2('0x32')][_0x40a2('0x38')]));_0xbafe16['attributes']=_0xbafe16[_0x40a2('0x37')][_0x40a2('0x39')]?_0xbafe16[_0x40a2('0x37')]:_0x275521[_0x40a2('0x36')];if(!_0x7711b5[_0x40a2('0x32')][_0x40a2('0x3a')]('nolimit')){_0xbafe16[_0x40a2('0x1e')]=qs[_0x40a2('0x1e')](_0x7711b5['query'][_0x40a2('0x1e')]);_0xbafe16['offset']=qs[_0x40a2('0x1c')](_0x7711b5[_0x40a2('0x32')][_0x40a2('0x1c')]);}_0xbafe16['order']=qs[_0x40a2('0x3b')](_0x7711b5['query'][_0x40a2('0x3b')]);_0xbafe16[_0x40a2('0x3c')]=qs['filters'](_[_0x40a2('0x3d')](_0x7711b5[_0x40a2('0x32')],_0x275521['filters']),_0x2ea495);if(_0x7711b5['query'][_0x40a2('0x3e')]){_0xbafe16[_0x40a2('0x3c')]=_[_0x40a2('0x3f')](_0xbafe16[_0x40a2('0x3c')],{'$or':_[_0x40a2('0x2d')](_0x2ea495,function(_0x3485b8){if(_0x3485b8[_0x40a2('0x31')]!=='VIRTUAL'){var _0x56e88f={};_0x56e88f[_0x3485b8[_0x40a2('0x2a')]]={'$like':'%'+_0x7711b5['query'][_0x40a2('0x3e')]+'%'};return _0x56e88f;}})});}_0xbafe16=_[_0x40a2('0x3f')]({},_0xbafe16,_0x7711b5['options']);var _0x1e37ab={'where':_0xbafe16[_0x40a2('0x3c')]};return db['Disposition'][_0x40a2('0x1f')](_0x1e37ab)['then'](function(_0x13c5e3){_0x41ae85[_0x40a2('0x1f')]=_0x13c5e3;if(_0x7711b5[_0x40a2('0x32')][_0x40a2('0x40')]){_0xbafe16[_0x40a2('0x41')]=[{'all':!![]}];}return db[_0x40a2('0x2e')]['findAll'](_0xbafe16);})[_0x40a2('0x25')](function(_0x11b28a){_0x41ae85[_0x40a2('0x42')]=_0x11b28a;return _0x41ae85;})[_0x40a2('0x25')](respondWithFilteredResult(_0x4f8843,_0xbafe16))[_0x40a2('0x43')](handleError(_0x4f8843,null));};exports[_0x40a2('0x44')]=function(_0x3c306e,_0x376bf6){var _0x806f07={'raw':!![],'where':{'id':_0x3c306e['params']['id']}},_0x34811d={};_0x34811d['model']=_['keys'](db[_0x40a2('0x2e')][_0x40a2('0x2f')]);_0x34811d[_0x40a2('0x32')]=_[_0x40a2('0x33')](_0x3c306e['query']);_0x34811d['filters']=_[_0x40a2('0x35')](_0x34811d[_0x40a2('0x36')],_0x34811d[_0x40a2('0x32')]);_0x806f07['attributes']=_['intersection'](_0x34811d[_0x40a2('0x36')],qs[_0x40a2('0x38')](_0x3c306e['query']['fields']));_0x806f07[_0x40a2('0x37')]=_0x806f07[_0x40a2('0x37')][_0x40a2('0x39')]?_0x806f07[_0x40a2('0x37')]:_0x34811d[_0x40a2('0x36')];if(_0x3c306e[_0x40a2('0x32')]['includeAll']){_0x806f07['include']=[{'all':!![]}];}_0x806f07=_[_0x40a2('0x3f')]({},_0x806f07,_0x3c306e['options']);return db[_0x40a2('0x2e')][_0x40a2('0x45')](_0x806f07)[_0x40a2('0x25')](handleEntityNotFound(_0x376bf6,null))[_0x40a2('0x25')](respondWithResult(_0x376bf6,null))[_0x40a2('0x43')](handleError(_0x376bf6,null));};exports[_0x40a2('0x46')]=function(_0x15d766,_0x118b0f){return db[_0x40a2('0x2e')]['create'](_0x15d766[_0x40a2('0x47')],{})['then'](function(_0x321470){var _0x2c3a52=_0x15d766[_0x40a2('0x48')][_0x40a2('0x26')]({'plain':!![]});if(!_0x2c3a52)throw new Error(_0x40a2('0x49'));if(_0x2c3a52[_0x40a2('0x4a')]===_0x40a2('0x48')){var _0x43c48a=_0x321470[_0x40a2('0x26')]({'plain':!![]});var _0x4e4c05='Dispositions';return db['UserProfileSection'][_0x40a2('0x45')]({'where':{'name':_0x4e4c05,'userProfileId':_0x2c3a52[_0x40a2('0x4b')]},'raw':!![]})[_0x40a2('0x25')](function(_0x362848){if(_0x362848&&_0x362848[_0x40a2('0x4c')]===0x0){return db['UserProfileResource'][_0x40a2('0x46')]({'name':_0x43c48a[_0x40a2('0x2a')],'resourceId':_0x43c48a['id'],'type':_0x362848[_0x40a2('0x2a')],'sectionId':_0x362848['id']},{})[_0x40a2('0x25')](function(){return _0x321470;});}else{return _0x321470;}})[_0x40a2('0x43')](function(_0x3d2bcd){logger[_0x40a2('0x4d')](_0x40a2('0x4e'),_0x3d2bcd);throw _0x3d2bcd;});}return _0x321470;})[_0x40a2('0x25')](respondWithResult(_0x118b0f,0xc9))[_0x40a2('0x43')](handleError(_0x118b0f,null));};exports[_0x40a2('0x24')]=function(_0x5b32fa,_0x3df000){if(_0x5b32fa[_0x40a2('0x47')]['id']){delete _0x5b32fa['body']['id'];}return db[_0x40a2('0x2e')][_0x40a2('0x45')]({'where':{'id':_0x5b32fa[_0x40a2('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3df000,null))['then'](saveUpdates(_0x5b32fa['body'],null))['then'](respondWithResult(_0x3df000,null))[_0x40a2('0x43')](handleError(_0x3df000,null));};exports[_0x40a2('0x50')]=function(_0x1470a7,_0xc0da66){return db[_0x40a2('0x2e')][_0x40a2('0x45')]({'where':{'id':_0x1470a7['params']['id']}})[_0x40a2('0x25')](handleEntityNotFound(_0xc0da66,null))[_0x40a2('0x25')](removeEntity(_0xc0da66,null))[_0x40a2('0x43')](handleError(_0xc0da66,null));}; \ No newline at end of file +var _0xee80=['filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','Disposition','fields','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','catch','update','eml-format','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','model','map','query'];(function(_0x1cd65a,_0x29fa8f){var _0xf93849=function(_0x29fbe1){while(--_0x29fbe1){_0x1cd65a['push'](_0x1cd65a['shift']());}};_0xf93849(++_0x29fa8f);}(_0xee80,0x1b0));var _0x0ee8=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xee80[_0x1b6186];return _0x186121;};'use strict';var emlformat=require(_0x0ee8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0ee8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ee8('0x2'));var moment=require(_0x0ee8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0ee8('0x4'));var util=require('util');var path=require(_0x0ee8('0x5'));var sox=require('sox');var csv=require(_0x0ee8('0x6'));var ejs=require(_0x0ee8('0x7'));var fs=require('fs');var fs_extra=require(_0x0ee8('0x8'));var _=require(_0x0ee8('0x9'));var squel=require(_0x0ee8('0xa'));var crypto=require(_0x0ee8('0xb'));var jsforce=require(_0x0ee8('0xc'));var deskjs=require(_0x0ee8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee8('0xe'));var Redis=require(_0x0ee8('0xf'));var authService=require(_0x0ee8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0ee8('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee8('0x12'))(_0x0ee8('0x13'));var utils=require('../../config/utils');var config=require(_0x0ee8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ee8('0x15'))['db'];function respondWithStatusCode(_0x735b5c,_0x342e37){_0x342e37=_0x342e37||0xcc;return function(_0xd30852){if(_0xd30852){return _0x735b5c[_0x0ee8('0x16')](_0x342e37);}return _0x735b5c['status'](_0x342e37)[_0x0ee8('0x17')]();};}function respondWithResult(_0x31a601,_0x516156){_0x516156=_0x516156||0xc8;return function(_0x1bfb91){if(_0x1bfb91){return _0x31a601['status'](_0x516156)[_0x0ee8('0x18')](_0x1bfb91);}};}function respondWithFilteredResult(_0x532097,_0x28ac56){return function(_0x1e23bd){if(_0x1e23bd){var _0x746b9f=typeof _0x28ac56[_0x0ee8('0x19')]===_0x0ee8('0x1a')&&typeof _0x28ac56[_0x0ee8('0x1b')]==='undefined';var _0x246112=_0x1e23bd['count'];var _0x234554=_0x746b9f?0x0:_0x28ac56[_0x0ee8('0x19')];var _0x5c42ac=_0x746b9f?_0x1e23bd[_0x0ee8('0x1c')]:_0x28ac56['offset']+_0x28ac56[_0x0ee8('0x1b')];var _0x2905fa;if(_0x5c42ac>=_0x246112){_0x5c42ac=_0x246112;_0x2905fa=0xc8;}else{_0x2905fa=0xce;}_0x532097[_0x0ee8('0x1d')](_0x2905fa);return _0x532097[_0x0ee8('0x1e')](_0x0ee8('0x1f'),_0x234554+'-'+_0x5c42ac+'/'+_0x246112)[_0x0ee8('0x18')](_0x1e23bd);}return null;};}function patchUpdates(_0x28ac31){return function(_0x444b2f){try{jsonpatch['apply'](_0x444b2f,_0x28ac31,!![]);}catch(_0x31958a){return BPromise['reject'](_0x31958a);}return _0x444b2f[_0x0ee8('0x20')]();};}function saveUpdates(_0x54a190,_0x12e00f){return function(_0x27e130){if(_0x27e130){return _0x27e130['update'](_0x54a190)[_0x0ee8('0x21')](function(_0x59b948){return _0x59b948;});}return null;};}function removeEntity(_0x42a1bc,_0x172a5b){return function(_0x1aff51){if(_0x1aff51){return _0x1aff51[_0x0ee8('0x22')]()[_0x0ee8('0x21')](function(){var _0x382478=_0x1aff51[_0x0ee8('0x23')]({'plain':!![]});var _0x5e00e3=_0x0ee8('0x24');return db[_0x0ee8('0x25')][_0x0ee8('0x22')]({'where':{'type':_0x5e00e3,'resourceId':_0x382478['id']}})[_0x0ee8('0x21')](function(){return _0x1aff51;});})['then'](function(){_0x42a1bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xae7c35,_0x5c9375){return function(_0x1c13bb){if(!_0x1c13bb){_0xae7c35['sendStatus'](0x194);}return _0x1c13bb;};}function handleError(_0x2f7f1e,_0x21b883){_0x21b883=_0x21b883||0x1f4;return function(_0x78752e){logger[_0x0ee8('0x26')](_0x78752e[_0x0ee8('0x27')]);if(_0x78752e[_0x0ee8('0x28')]){delete _0x78752e[_0x0ee8('0x28')];}_0x2f7f1e[_0x0ee8('0x1d')](_0x21b883)[_0x0ee8('0x29')](_0x78752e);};}exports[_0x0ee8('0x2a')]=function(_0x34156a,_0x497304){var _0x4d229d={},_0x387b3c={},_0x4511bc={'count':0x0,'rows':[]};var _0x458c65=_['map'](db['Disposition'][_0x0ee8('0x2b')],function(_0x5e33dd){return{'name':_0x5e33dd[_0x0ee8('0x2c')],'type':_0x5e33dd['type']['key']};});_0x387b3c[_0x0ee8('0x2d')]=_[_0x0ee8('0x2e')](_0x458c65,_0x0ee8('0x28'));_0x387b3c[_0x0ee8('0x2f')]=_['keys'](_0x34156a[_0x0ee8('0x2f')]);_0x387b3c[_0x0ee8('0x30')]=_[_0x0ee8('0x31')](_0x387b3c['model'],_0x387b3c[_0x0ee8('0x2f')]);_0x4d229d[_0x0ee8('0x32')]=_[_0x0ee8('0x31')](_0x387b3c['model'],qs['fields'](_0x34156a[_0x0ee8('0x2f')]['fields']));_0x4d229d[_0x0ee8('0x32')]=_0x4d229d[_0x0ee8('0x32')]['length']?_0x4d229d[_0x0ee8('0x32')]:_0x387b3c[_0x0ee8('0x2d')];if(!_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x33')](_0x0ee8('0x34'))){_0x4d229d[_0x0ee8('0x1b')]=qs[_0x0ee8('0x1b')](_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x1b')]);_0x4d229d[_0x0ee8('0x19')]=qs[_0x0ee8('0x19')](_0x34156a['query'][_0x0ee8('0x19')]);}_0x4d229d[_0x0ee8('0x35')]=qs[_0x0ee8('0x36')](_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x36')]);_0x4d229d[_0x0ee8('0x37')]=qs[_0x0ee8('0x30')](_['pick'](_0x34156a[_0x0ee8('0x2f')],_0x387b3c[_0x0ee8('0x30')]),_0x458c65);if(_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x38')]){_0x4d229d[_0x0ee8('0x37')]=_[_0x0ee8('0x39')](_0x4d229d['where'],{'$or':_[_0x0ee8('0x2e')](_0x458c65,function(_0x263f30){if(_0x263f30['type']!==_0x0ee8('0x3a')){var _0x1f2f94={};_0x1f2f94[_0x263f30[_0x0ee8('0x28')]]={'$like':'%'+_0x34156a[_0x0ee8('0x2f')][_0x0ee8('0x38')]+'%'};return _0x1f2f94;}})});}_0x4d229d=_[_0x0ee8('0x39')]({},_0x4d229d,_0x34156a[_0x0ee8('0x3b')]);var _0x6dbe9={'where':_0x4d229d[_0x0ee8('0x37')]};return db['Disposition'][_0x0ee8('0x1c')](_0x6dbe9)[_0x0ee8('0x21')](function(_0x28265c){_0x4511bc[_0x0ee8('0x1c')]=_0x28265c;if(_0x34156a[_0x0ee8('0x2f')]['includeAll']){_0x4d229d[_0x0ee8('0x3c')]=[{'all':!![]}];}return db['Disposition'][_0x0ee8('0x3d')](_0x4d229d);})[_0x0ee8('0x21')](function(_0x1e38ae){_0x4511bc[_0x0ee8('0x3e')]=_0x1e38ae;return _0x4511bc;})[_0x0ee8('0x21')](respondWithFilteredResult(_0x497304,_0x4d229d))['catch'](handleError(_0x497304,null));};exports[_0x0ee8('0x3f')]=function(_0x17854b,_0x2882c6){var _0xe02f38={'raw':!![],'where':{'id':_0x17854b[_0x0ee8('0x40')]['id']}},_0x149926={};_0x149926[_0x0ee8('0x2d')]=_[_0x0ee8('0x41')](db[_0x0ee8('0x42')][_0x0ee8('0x2b')]);_0x149926['query']=_[_0x0ee8('0x41')](_0x17854b[_0x0ee8('0x2f')]);_0x149926[_0x0ee8('0x30')]=_[_0x0ee8('0x31')](_0x149926[_0x0ee8('0x2d')],_0x149926['query']);_0xe02f38[_0x0ee8('0x32')]=_[_0x0ee8('0x31')](_0x149926[_0x0ee8('0x2d')],qs[_0x0ee8('0x43')](_0x17854b['query']['fields']));_0xe02f38[_0x0ee8('0x32')]=_0xe02f38[_0x0ee8('0x32')][_0x0ee8('0x44')]?_0xe02f38[_0x0ee8('0x32')]:_0x149926[_0x0ee8('0x2d')];if(_0x17854b['query'][_0x0ee8('0x45')]){_0xe02f38[_0x0ee8('0x3c')]=[{'all':!![]}];}_0xe02f38=_['merge']({},_0xe02f38,_0x17854b[_0x0ee8('0x3b')]);return db['Disposition'][_0x0ee8('0x46')](_0xe02f38)[_0x0ee8('0x21')](handleEntityNotFound(_0x2882c6,null))[_0x0ee8('0x21')](respondWithResult(_0x2882c6,null))['catch'](handleError(_0x2882c6,null));};exports[_0x0ee8('0x47')]=function(_0x5c1f23,_0x36b6ec){return db[_0x0ee8('0x42')][_0x0ee8('0x47')](_0x5c1f23[_0x0ee8('0x48')],{})[_0x0ee8('0x21')](function(_0x473063){var _0x41e7a2=_0x5c1f23['user'][_0x0ee8('0x23')]({'plain':!![]});if(!_0x41e7a2)throw new Error(_0x0ee8('0x49'));if(_0x41e7a2['role']===_0x0ee8('0x4a')){var _0x2efda7=_0x473063['get']({'plain':!![]});var _0x593b23='Dispositions';return db[_0x0ee8('0x4b')][_0x0ee8('0x46')]({'where':{'name':_0x593b23,'userProfileId':_0x41e7a2[_0x0ee8('0x4c')]},'raw':!![]})[_0x0ee8('0x21')](function(_0x1cebe5){if(_0x1cebe5&&_0x1cebe5[_0x0ee8('0x4d')]===0x0){return db[_0x0ee8('0x25')][_0x0ee8('0x47')]({'name':_0x2efda7['name'],'resourceId':_0x2efda7['id'],'type':_0x1cebe5['name'],'sectionId':_0x1cebe5['id']},{})[_0x0ee8('0x21')](function(){return _0x473063;});}else{return _0x473063;}})[_0x0ee8('0x4e')](function(_0x3487e0){logger[_0x0ee8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3487e0);throw _0x3487e0;});}return _0x473063;})['then'](respondWithResult(_0x36b6ec,0xc9))[_0x0ee8('0x4e')](handleError(_0x36b6ec,null));};exports[_0x0ee8('0x4f')]=function(_0x1c6f19,_0x451715){if(_0x1c6f19[_0x0ee8('0x48')]['id']){delete _0x1c6f19[_0x0ee8('0x48')]['id'];}return db[_0x0ee8('0x42')]['find']({'where':{'id':_0x1c6f19['params']['id']}})[_0x0ee8('0x21')](handleEntityNotFound(_0x451715,null))[_0x0ee8('0x21')](saveUpdates(_0x1c6f19['body'],null))['then'](respondWithResult(_0x451715,null))[_0x0ee8('0x4e')](handleError(_0x451715,null));};exports[_0x0ee8('0x22')]=function(_0x4aa711,_0x34beb3){return db[_0x0ee8('0x42')][_0x0ee8('0x46')]({'where':{'id':_0x4aa711[_0x0ee8('0x40')]['id']}})['then'](handleEntityNotFound(_0x34beb3,null))[_0x0ee8('0x21')](removeEntity(_0x34beb3,null))[_0x0ee8('0x4e')](handleError(_0x34beb3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 947889c..8ca009b 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 _0x51f5=['api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x55e31f,_0x19538f){var _0x15808c=function(_0x2d9d25){while(--_0x2d9d25){_0x55e31f['push'](_0x55e31f['shift']());}};_0x15808c(++_0x19538f);}(_0x51f5,0x1e1));var _0x551f=function(_0x6bac95,_0x5740a4){_0x6bac95=_0x6bac95-0x0;var _0x20e69b=_0x51f5[_0x6bac95];return _0x20e69b;};'use strict';var _=require(_0x551f('0x0'));var util=require(_0x551f('0x1'));var logger=require(_0x551f('0x2'))(_0x551f('0x3'));var moment=require('moment');var BPromise=require(_0x551f('0x4'));var rp=require(_0x551f('0x5'));var fs=require('fs');var path=require(_0x551f('0x6'));var rimraf=require(_0x551f('0x7'));var config=require(_0x551f('0x8'));var attributes=require(_0x551f('0x9'));module[_0x551f('0xa')]=function(_0x18c06f,_0x1adf57){return _0x18c06f[_0x551f('0xb')]('Disposition',attributes,{'tableName':_0x551f('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x551f('0xd'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x551f('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x551f('0xe'),'fields':[_0x551f('0xd'),_0x551f('0xf')]},{'unique':!![],'name':_0x551f('0x10'),'fields':[_0x551f('0xd'),_0x551f('0x11')]},{'unique':!![],'name':_0x551f('0x12'),'fields':[_0x551f('0xd'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x551f('0xd'),_0x551f('0x13')]},{'unique':!![],'name':_0x551f('0x14'),'fields':[_0x551f('0xd'),_0x551f('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ed3=['./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x229c30,_0x575576){var _0x4d7ac3=function(_0x489025){while(--_0x489025){_0x229c30['push'](_0x229c30['shift']());}};_0x4d7ac3(++_0x575576);}(_0x5ed3,0x1dd));var _0x35ed=function(_0x55c97c,_0x3ba132){_0x55c97c=_0x55c97c-0x0;var _0x148b14=_0x5ed3[_0x55c97c];return _0x148b14;};'use strict';var _=require(_0x35ed('0x0'));var util=require('util');var logger=require(_0x35ed('0x1'))('api');var moment=require(_0x35ed('0x2'));var BPromise=require('bluebird');var rp=require(_0x35ed('0x3'));var fs=require('fs');var path=require(_0x35ed('0x4'));var rimraf=require(_0x35ed('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ed('0x6'));module[_0x35ed('0x7')]=function(_0x2be17e,_0x56dc9b){return _0x2be17e[_0x35ed('0x8')](_0x35ed('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x35ed('0xa'),'fields':[_0x35ed('0xb'),_0x35ed('0xc')]},{'unique':!![],'name':'name_chat','fields':[_0x35ed('0xb'),_0x35ed('0xd')]},{'unique':!![],'name':_0x35ed('0xe'),'fields':['name',_0x35ed('0xf')]},{'unique':!![],'name':_0x35ed('0x10'),'fields':['name',_0x35ed('0x11')]},{'unique':!![],'name':_0x35ed('0x12'),'fields':[_0x35ed('0xb'),_0x35ed('0x13')]},{'unique':!![],'name':'name_openchannel','fields':[_0x35ed('0xb'),_0x35ed('0x14')]},{'unique':!![],'name':_0x35ed('0x15'),'fields':[_0x35ed('0xb'),_0x35ed('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 4cacedb..52ce7b8 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(_0x239b04,_0x47bda2){var _0x16ab17=function(_0x28e6b7){while(--_0x28e6b7){_0x239b04['push'](_0x239b04['shift']());}};_0x16ab17(++_0x47bda2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x23bb9c,_0x1285cb){var _0x3fca71=function(_0x54a375){while(--_0x54a375){_0x23bb9c['push'](_0x23bb9c['shift']());}};_0x3fca71(++_0x1285cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 8ee7e86..7f5f14e 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 _0xc2c5=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show'];(function(_0x453095,_0x5698e6){var _0x4f1ecd=function(_0x6dd40){while(--_0x6dd40){_0x453095['push'](_0x453095['shift']());}};_0x4f1ecd(++_0x5698e6);}(_0xc2c5,0xe2));var _0x5c2c=function(_0x53acef,_0x2bf344){_0x53acef=_0x53acef-0x0;var _0x24d013=_0xc2c5[_0x53acef];return _0x24d013;};'use strict';var multer=require(_0x5c2c('0x0'));var util=require(_0x5c2c('0x1'));var path=require(_0x5c2c('0x2'));var timeout=require(_0x5c2c('0x3'));var express=require(_0x5c2c('0x4'));var router=express[_0x5c2c('0x5')]();var fs_extra=require(_0x5c2c('0x6'));var auth=require(_0x5c2c('0x7'));var interaction=require(_0x5c2c('0x8'));var config=require(_0x5c2c('0x9'));var controller=require(_0x5c2c('0xa'));router[_0x5c2c('0xb')]('/',auth[_0x5c2c('0xc')](),controller[_0x5c2c('0xd')]);router[_0x5c2c('0xb')](_0x5c2c('0xe'),auth['isAuthenticated'](),controller[_0x5c2c('0xf')]);router['post']('/',auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x10')]);router[_0x5c2c('0x11')](_0x5c2c('0xe'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x12')]);router[_0x5c2c('0x13')](_0x5c2c('0xe'),auth[_0x5c2c('0xc')](),controller[_0x5c2c('0x14')]);module[_0x5c2c('0x15')]=router; \ No newline at end of file +var _0x8232=['post','create','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show'];(function(_0x56fd62,_0x41c0ea){var _0xc7d7bc=function(_0x206bdf){while(--_0x206bdf){_0x56fd62['push'](_0x56fd62['shift']());}};_0xc7d7bc(++_0x41c0ea);}(_0x8232,0x11f));var _0x2823=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x8232[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x2823('0x0'));var util=require(_0x2823('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2823('0x2')]();var fs_extra=require(_0x2823('0x3'));var auth=require(_0x2823('0x4'));var interaction=require(_0x2823('0x5'));var config=require(_0x2823('0x6'));var controller=require(_0x2823('0x7'));router[_0x2823('0x8')]('/',auth[_0x2823('0x9')](),controller[_0x2823('0xa')]);router['get'](_0x2823('0xb'),auth[_0x2823('0x9')](),controller[_0x2823('0xc')]);router[_0x2823('0xd')]('/',auth[_0x2823('0x9')](),controller[_0x2823('0xe')]);router[_0x2823('0xf')](_0x2823('0xb'),auth['isAuthenticated'](),controller[_0x2823('0x10')]);router[_0x2823('0x11')](_0x2823('0xb'),auth[_0x2823('0x9')](),controller[_0x2823('0x12')]);module[_0x2823('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 766271f..8ee0390 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 _0x814b=['SIP','IAX','DADHI','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','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','14400','4800','12000','INTEGER'];(function(_0x29f05c,_0x1b4413){var _0x505c6d=function(_0x109eaf){while(--_0x109eaf){_0x29f05c['push'](_0x29f05c['shift']());}};_0x505c6d(++_0x1b4413);}(_0x814b,0x1a2));var _0xb814=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0x814b[_0x4114dd];return _0x26f44c;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb814('0x2')]},'ecm':{'type':Sequelize[_0xb814('0x3')](_0xb814('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xb814('0x2')],'defaultValue':_0xb814('0x5')},'localstationid':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x6')},'minrate':{'type':Sequelize[_0xb814('0x3')](_0xb814('0x7'),'4800',_0xb814('0x8'),_0xb814('0x9'),'12000',_0xb814('0xa')),'defaultValue':_0xb814('0xb')},'maxrate':{'type':Sequelize[_0xb814('0x3')](_0xb814('0x7'),_0xb814('0xb'),_0xb814('0x8'),_0xb814('0x9'),_0xb814('0xc'),_0xb814('0xa')),'defaultValue':_0xb814('0xa')},'modem':{'type':Sequelize[_0xb814('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xb814('0x2')],'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[_0xb814('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xb814('0x3')](_0xb814('0xe'),_0xb814('0xf'),_0xb814('0x10'),_0xb814('0x11')),'defaultValue':_0xb814('0xe')},'key':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb814('0x12')],'defaultValue':function(){return _0xb814('0x13');}},'notificationSound':{'type':Sequelize[_0xb814('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb814('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb814('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xb814('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb814('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb814('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb814('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb814('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb814('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xb814('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xb814('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x168a48){if(!_0x168a48)this['setDataValue'](_0xb814('0x16'),null);this[_0xb814('0x17')]('mandatoryDisposition',_0x168a48);}}}; \ No newline at end of file +var _0x25fa=['setDataValue','sequelize','STRING','yes','localstationid','2400','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','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'];(function(_0x11720a,_0x54d15f){var _0x2b970c=function(_0x48cdc4){while(--_0x48cdc4){_0x11720a['push'](_0x11720a['shift']());}};_0x2b970c(++_0x54d15f);}(_0x25fa,0x109));var _0xa25f=function(_0x374fd6,_0xaa9519){_0x374fd6=_0x374fd6-0x0;var _0x28d215=_0x25fa[_0x374fd6];return _0x28d215;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa25f('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0xa25f('0x2'),'no'),'defaultValue':_0xa25f('0x2')},'headerinfo':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xa25f('0x3')},'minrate':{'type':Sequelize['ENUM'](_0xa25f('0x4'),_0xa25f('0x5'),_0xa25f('0x6'),_0xa25f('0x7'),_0xa25f('0x8'),_0xa25f('0x9')),'defaultValue':_0xa25f('0x5')},'maxrate':{'type':Sequelize[_0xa25f('0xa')](_0xa25f('0x4'),'4800',_0xa25f('0x6'),_0xa25f('0x7'),'12000',_0xa25f('0x9')),'defaultValue':_0xa25f('0x9')},'modem':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':_0xa25f('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa25f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa25f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xa25f('0xd'),_0xa25f('0xe'),'DADHI',_0xa25f('0xf')),'defaultValue':_0xa25f('0xd')},'key':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa25f('0x10')],'defaultValue':function(){return _0xa25f('0x11');}},'notificationSound':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa25f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa25f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xa25f('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xa25f('0x12')],'defaultValue':![],'comment':_0xa25f('0x14'),'set':function(_0x18705c){if(!_0x18705c)this[_0xa25f('0x15')]('mandatoryDispositionPauseId',null);this[_0xa25f('0x15')]('mandatoryDisposition',_0x18705c);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 7346acd..8a247f4 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 _0x02af=['desk.js','querystring','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./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','error','code','message','result','catch','status','end','json','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','UserProfileResource','sendStatus','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','options','FaxAccount','include','findAll','show','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','order','merge','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','TrunkId','ListId','findById','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','List','Contacts','updatedAt','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','path','isNil','from','format','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x547fe3,_0x5bbc1a){var _0x5391b7=function(_0x2b0612){while(--_0x2b0612){_0x547fe3['push'](_0x547fe3['shift']());}};_0x5391b7(++_0x5bbc1a);}(_0x02af,0xb7));var _0xf02a=function(_0x2eabbd,_0x471f8e){_0x2eabbd=_0x2eabbd-0x0;var _0x5cde9c=_0x02af[_0x2eabbd];return _0x5cde9c;};'use strict';var emlformat=require(_0xf02a('0x0'));var rimraf=require(_0xf02a('0x1'));var zipdir=require(_0xf02a('0x2'));var jsonpatch=require(_0xf02a('0x3'));var rp=require(_0xf02a('0x4'));var moment=require(_0xf02a('0x5'));var BPromise=require(_0xf02a('0x6'));var Mustache=require(_0xf02a('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf02a('0x8'));var csv=require(_0xf02a('0x9'));var ejs=require(_0xf02a('0xa'));var fs=require('fs');var fs_extra=require(_0xf02a('0xb'));var _=require(_0xf02a('0xc'));var squel=require('squel');var crypto=require(_0xf02a('0xd'));var jsforce=require(_0xf02a('0xe'));var deskjs=require(_0xf02a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf02a('0x10'));var Papa=require('papaparse');var Redis=require(_0xf02a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf02a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf02a('0x13'));var utils=require('../../config/utils');var config=require(_0xf02a('0x14'));var licenseUtil=require(_0xf02a('0x15'));var db=require(_0xf02a('0x16'))['db'];config['redis']=_[_0xf02a('0x17')](config[_0xf02a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf02a('0x19'))(new Redis(config[_0xf02a('0x18')]));require(_0xf02a('0x1a'))[_0xf02a('0x1b')](socket);var jayson=require(_0xf02a('0x1c'));var client=jayson[_0xf02a('0x1d')][_0xf02a('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xf02a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x305621,_0x5c22ae,_0x27c908,_0x53e316){return new BPromise(function(_0x18fd16,_0x5e563d){var _0xc9d3ad=_0x53e316||client;return _0xc9d3ad[_0xf02a('0x1f')](_0x305621,_0x27c908)[_0xf02a('0x20')](function(_0x3b1048){logger[_0xf02a('0x21')](_0xf02a('0x22'),_0x5c22ae,_0xf02a('0x23'));logger[_0xf02a('0x24')](_0xf02a('0x25'),_0x5c22ae,'request\x20sent',JSON['stringify'](_0x3b1048));if(_0x3b1048[_0xf02a('0x26')]){if(_0x3b1048['error'][_0xf02a('0x27')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5c22ae,_0x3b1048[_0xf02a('0x26')][_0xf02a('0x28')]);return _0x5e563d(_0x3b1048[_0xf02a('0x26')]['message']);}logger[_0xf02a('0x26')](_0xf02a('0x22'),_0x5c22ae,_0x3b1048[_0xf02a('0x26')][_0xf02a('0x28')]);return _0x18fd16(_0x3b1048[_0xf02a('0x26')]['message']);}else{logger[_0xf02a('0x21')](_0xf02a('0x22'),_0x5c22ae,_0xf02a('0x23'));_0x18fd16(_0x3b1048[_0xf02a('0x29')][_0xf02a('0x28')]);}})[_0xf02a('0x2a')](function(_0x170143){logger[_0xf02a('0x26')](_0xf02a('0x22'),_0x5c22ae,_0x170143);_0x5e563d(_0x170143);});});}function respondWithStatusCode(_0x2e1e8f,_0x36c8c3){_0x36c8c3=_0x36c8c3||0xcc;return function(_0x267057){if(_0x267057){return _0x2e1e8f['sendStatus'](_0x36c8c3);}return _0x2e1e8f[_0xf02a('0x2b')](_0x36c8c3)[_0xf02a('0x2c')]();};}function respondWithResult(_0x2c692a,_0x2feb52){_0x2feb52=_0x2feb52||0xc8;return function(_0x5323e5){if(_0x5323e5){return _0x2c692a['status'](_0x2feb52)[_0xf02a('0x2d')](_0x5323e5);}};}function respondWithFilteredResult(_0x16b3f7,_0x3e6017){return function(_0xe2d901){if(_0xe2d901){var _0x297d59=typeof _0x3e6017['offset']===_0xf02a('0x2e')&&typeof _0x3e6017['limit']===_0xf02a('0x2e');var _0x2934f8=_0xe2d901[_0xf02a('0x2f')];var _0x47650c=_0x297d59?0x0:_0x3e6017[_0xf02a('0x30')];var _0x525f7c=_0x297d59?_0xe2d901[_0xf02a('0x2f')]:_0x3e6017[_0xf02a('0x30')]+_0x3e6017['limit'];var _0x1ba98e;if(_0x525f7c>=_0x2934f8){_0x525f7c=_0x2934f8;_0x1ba98e=0xc8;}else{_0x1ba98e=0xce;}_0x16b3f7['status'](_0x1ba98e);return _0x16b3f7['set'](_0xf02a('0x31'),_0x47650c+'-'+_0x525f7c+'/'+_0x2934f8)[_0xf02a('0x2d')](_0xe2d901);}return null;};}function patchUpdates(_0x360629){return function(_0x210455){try{jsonpatch[_0xf02a('0x32')](_0x210455,_0x360629,!![]);}catch(_0x3959c0){return BPromise[_0xf02a('0x33')](_0x3959c0);}return _0x210455[_0xf02a('0x34')]();};}function saveUpdates(_0x4144ce,_0x366905){return function(_0x4ec02d){if(_0x4ec02d){return _0x4ec02d[_0xf02a('0x35')](_0x4144ce)[_0xf02a('0x20')](function(_0x2c8337){return _0x2c8337;});}return null;};}function removeEntity(_0x3165a8,_0x2880cf){return function(_0x51a592){if(_0x51a592){return _0x51a592[_0xf02a('0x36')]()[_0xf02a('0x20')](function(){var _0x2bc9c2=_0x51a592['get']({'plain':!![]});var _0x376d5c='FaxAccounts';return db[_0xf02a('0x37')]['destroy']({'where':{'type':_0x376d5c,'resourceId':_0x2bc9c2['id']}})[_0xf02a('0x20')](function(){return _0x51a592;});})[_0xf02a('0x20')](function(){_0x3165a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x430bdb,_0x3c0882){return function(_0x1c15ae){if(!_0x1c15ae){_0x430bdb[_0xf02a('0x38')](0x194);}return _0x1c15ae;};}function handleError(_0x4815b9,_0x109495){_0x109495=_0x109495||0x1f4;return function(_0x176844){logger[_0xf02a('0x26')](_0x176844[_0xf02a('0x39')]);if(_0x176844[_0xf02a('0x3a')]){delete _0x176844[_0xf02a('0x3a')];}_0x4815b9[_0xf02a('0x2b')](_0x109495)[_0xf02a('0x3b')](_0x176844);};}exports[_0xf02a('0x3c')]=function(_0x56dd65,_0x146793){var _0x255bf8={'include':[{'model':db[_0xf02a('0x3d')],'as':'mandatoryDispositionPause'}]},_0x3182dc={},_0x24f55d={'count':0x0,'rows':[]};var _0x29db3e=_[_0xf02a('0x3e')](db['FaxAccount'][_0xf02a('0x3f')],function(_0x273616){return{'name':_0x273616[_0xf02a('0x40')],'type':_0x273616[_0xf02a('0x41')][_0xf02a('0x42')]};});_0x3182dc[_0xf02a('0x43')]=_['map'](_0x29db3e,_0xf02a('0x3a'));_0x3182dc[_0xf02a('0x44')]=_[_0xf02a('0x45')](_0x56dd65[_0xf02a('0x44')]);_0x3182dc['filters']=_[_0xf02a('0x46')](_0x3182dc[_0xf02a('0x43')],_0x3182dc['query']);_0x255bf8[_0xf02a('0x47')]=_[_0xf02a('0x46')](_0x3182dc['model'],qs[_0xf02a('0x48')](_0x56dd65[_0xf02a('0x44')][_0xf02a('0x48')]));_0x255bf8[_0xf02a('0x47')]=_0x255bf8[_0xf02a('0x47')][_0xf02a('0x49')]?_0x255bf8[_0xf02a('0x47')]:_0x3182dc[_0xf02a('0x43')];if(!_0x56dd65[_0xf02a('0x44')][_0xf02a('0x4a')](_0xf02a('0x4b'))){_0x255bf8[_0xf02a('0x4c')]=qs[_0xf02a('0x4c')](_0x56dd65[_0xf02a('0x44')][_0xf02a('0x4c')]);_0x255bf8[_0xf02a('0x30')]=qs['offset'](_0x56dd65[_0xf02a('0x44')][_0xf02a('0x30')]);}_0x255bf8['order']=qs[_0xf02a('0x4d')](_0x56dd65[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x255bf8[_0xf02a('0x4e')]=qs[_0xf02a('0x4f')](_[_0xf02a('0x50')](_0x56dd65['query'],_0x3182dc['filters']),_0x29db3e);if(_0x56dd65['query'][_0xf02a('0x51')]){_0x255bf8[_0xf02a('0x4e')]=_['merge'](_0x255bf8[_0xf02a('0x4e')],{'$or':_[_0xf02a('0x3e')](_0x29db3e,function(_0x47087c){if(_0x47087c[_0xf02a('0x41')]!==_0xf02a('0x52')){var _0x239723={};_0x239723[_0x47087c[_0xf02a('0x3a')]]={'$like':'%'+_0x56dd65[_0xf02a('0x44')][_0xf02a('0x51')]+'%'};return _0x239723;}})});}_0x255bf8=_['merge']({},_0x255bf8,_0x56dd65[_0xf02a('0x53')]);var _0xb994e7={'where':_0x255bf8['where']};return db[_0xf02a('0x54')][_0xf02a('0x2f')](_0xb994e7)[_0xf02a('0x20')](function(_0x574a11){_0x24f55d[_0xf02a('0x2f')]=_0x574a11;if(_0x56dd65['query']['includeAll']){_0x255bf8[_0xf02a('0x55')]=[{'all':!![]}];}return db[_0xf02a('0x54')][_0xf02a('0x56')](_0x255bf8);})[_0xf02a('0x20')](function(_0xc77ae2){_0x24f55d['rows']=_0xc77ae2;return _0x24f55d;})[_0xf02a('0x20')](respondWithFilteredResult(_0x146793,_0x255bf8))[_0xf02a('0x2a')](handleError(_0x146793,null));};exports[_0xf02a('0x57')]=function(_0x260451,_0x1063fd){var _0x4f877e={'raw':![],'where':{'id':_0x260451['params']['id']},'include':[{'model':db[_0xf02a('0x3d')],'as':'mandatoryDispositionPause'}]},_0x112cdf={};_0x112cdf['model']=_['keys'](db['FaxAccount']['rawAttributes']);_0x112cdf[_0xf02a('0x44')]=_[_0xf02a('0x45')](_0x260451[_0xf02a('0x44')]);_0x112cdf[_0xf02a('0x4f')]=_[_0xf02a('0x46')](_0x112cdf[_0xf02a('0x43')],_0x112cdf[_0xf02a('0x44')]);_0x4f877e['attributes']=_['intersection'](_0x112cdf[_0xf02a('0x43')],qs[_0xf02a('0x48')](_0x260451['query']['fields']));_0x4f877e['attributes']=_0x4f877e[_0xf02a('0x47')][_0xf02a('0x49')]?_0x4f877e['attributes']:_0x112cdf['model'];if(_0x260451[_0xf02a('0x44')][_0xf02a('0x58')]){_0x4f877e[_0xf02a('0x55')]=[{'all':!![]}];}_0x4f877e=_['merge']({},_0x4f877e,_0x260451['options']);return db[_0xf02a('0x54')][_0xf02a('0x59')](_0x4f877e)[_0xf02a('0x20')](handleEntityNotFound(_0x1063fd,null))[_0xf02a('0x20')](respondWithResult(_0x1063fd,null))[_0xf02a('0x2a')](handleError(_0x1063fd,null));};exports['create']=function(_0x23ead9,_0x5ba7a2){return db[_0xf02a('0x54')][_0xf02a('0x5a')](_0x23ead9[_0xf02a('0x5b')],{})[_0xf02a('0x20')](function(_0x2bf2fb){var _0x1a05bb=_0x23ead9[_0xf02a('0x5c')][_0xf02a('0x5d')]({'plain':!![]});if(!_0x1a05bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a05bb[_0xf02a('0x5e')]==='user'){var _0x586323=_0x2bf2fb[_0xf02a('0x5d')]({'plain':!![]});var _0x2075a1='FaxAccounts';return db[_0xf02a('0x5f')][_0xf02a('0x59')]({'where':{'name':_0x2075a1,'userProfileId':_0x1a05bb[_0xf02a('0x60')]},'raw':!![]})['then'](function(_0x574c9d){if(_0x574c9d&&_0x574c9d[_0xf02a('0x61')]===0x0){return db['UserProfileResource'][_0xf02a('0x5a')]({'name':_0x586323['name'],'resourceId':_0x586323['id'],'type':_0x574c9d['name'],'sectionId':_0x574c9d['id']},{})['then'](function(){return _0x2bf2fb;});}else{return _0x2bf2fb;}})[_0xf02a('0x2a')](function(_0x1dd152){logger['error'](_0xf02a('0x62'),_0x1dd152);throw _0x1dd152;});}return _0x2bf2fb;})[_0xf02a('0x20')](respondWithResult(_0x5ba7a2,0xc9))['catch'](handleError(_0x5ba7a2,null));};exports[_0xf02a('0x35')]=function(_0x71c455,_0xe91137){if(_0x71c455['body']['id']){delete _0x71c455[_0xf02a('0x5b')]['id'];}return db[_0xf02a('0x54')]['find']({'where':{'id':_0x71c455[_0xf02a('0x63')]['id']},'include':[{'model':db['Pause'],'as':_0xf02a('0x64')}]})[_0xf02a('0x20')](handleEntityNotFound(_0xe91137,null))[_0xf02a('0x20')](saveUpdates(_0x71c455[_0xf02a('0x5b')],null))[_0xf02a('0x20')](respondWithResult(_0xe91137,null))['catch'](handleError(_0xe91137,null));};exports['destroy']=function(_0x582a75,_0x53fca7){return db['FaxAccount']['find']({'where':{'id':_0x582a75[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x53fca7,null))[_0xf02a('0x20')](removeEntity(_0x53fca7,null))[_0xf02a('0x2a')](handleError(_0x53fca7,null));};exports[_0xf02a('0x65')]=function(_0x7df367,_0x2db902){return db[_0xf02a('0x54')][_0xf02a('0x65')]()['then'](respondWithResult(_0x2db902,null))[_0xf02a('0x2a')](handleError(_0x2db902,null));};exports[_0xf02a('0x66')]=function(_0x3bc719,_0x317da8,_0x4c8a01){if(_0x3bc719[_0xf02a('0x5b')]['id']){delete _0x3bc719[_0xf02a('0x5b')]['id'];}return db[_0xf02a('0x54')]['find']({'where':{'id':_0x3bc719['params']['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x317da8,null))['then'](function(_0x226d44){if(_0x226d44){_0x3bc719['body'][_0xf02a('0x67')]=_0x226d44['id'];return db[_0xf02a('0x68')][_0xf02a('0x5a')](_0x3bc719[_0xf02a('0x5b')]);}})['then'](respondWithResult(_0x317da8,null))[_0xf02a('0x2a')](handleError(_0x317da8,null));};exports[_0xf02a('0x69')]=function(_0x1de9e3,_0x4d885e,_0x74c1aa){var _0x31ef99={'raw':![],'where':{}};var _0x248a16={};var _0x582ac3={'count':0x0,'rows':[]};return db[_0xf02a('0x54')][_0xf02a('0x6a')]({'where':{'id':_0x1de9e3[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x4d885e,null))[_0xf02a('0x20')](function(_0x113e8c){if(_0x113e8c){_0x248a16['model']=_[_0xf02a('0x45')](db[_0xf02a('0x68')][_0xf02a('0x3f')]);_0x248a16[_0xf02a('0x44')]=_[_0xf02a('0x45')](_0x1de9e3[_0xf02a('0x44')]);_0x248a16[_0xf02a('0x4f')]=_[_0xf02a('0x46')](_0x248a16['model'],_0x248a16[_0xf02a('0x44')]);_0x31ef99['attributes']=_[_0xf02a('0x46')](_0x248a16[_0xf02a('0x43')],qs['fields'](_0x1de9e3[_0xf02a('0x44')][_0xf02a('0x48')]));_0x31ef99[_0xf02a('0x47')]=_0x31ef99['attributes'][_0xf02a('0x49')]?_0x31ef99[_0xf02a('0x47')]:_0x248a16[_0xf02a('0x43')];if(!_0x1de9e3[_0xf02a('0x44')]['hasOwnProperty']('nolimit')){_0x31ef99['limit']=qs['limit'](_0x1de9e3[_0xf02a('0x44')][_0xf02a('0x4c')]);_0x31ef99[_0xf02a('0x30')]=qs[_0xf02a('0x30')](_0x1de9e3[_0xf02a('0x44')]['offset']);}_0x31ef99[_0xf02a('0x6b')]=qs[_0xf02a('0x4d')](_0x1de9e3[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x31ef99['where']=qs['filters'](_['pick'](_0x1de9e3[_0xf02a('0x44')],_0x248a16[_0xf02a('0x4f')]));_0x31ef99[_0xf02a('0x4e')][_0xf02a('0x67')]=_0x113e8c['id'];if(_0x1de9e3[_0xf02a('0x44')]['filter']){_0x31ef99['where']=_[_0xf02a('0x6c')](_0x31ef99[_0xf02a('0x4e')],{'$or':_[_0xf02a('0x3e')](_0x31ef99[_0xf02a('0x47')],function(_0xeb1d83){var _0x4c4ce6={};_0x4c4ce6[_0xeb1d83]={'$like':'%'+_0x1de9e3[_0xf02a('0x44')]['filter']+'%'};return _0x4c4ce6;})});}_0x31ef99=_[_0xf02a('0x6c')]({},_0x31ef99,_0x1de9e3[_0xf02a('0x53')]);return db[_0xf02a('0x68')][_0xf02a('0x2f')]({'where':_0x31ef99['where']})[_0xf02a('0x20')](function(_0x4253b4){_0x582ac3[_0xf02a('0x2f')]=_0x4253b4;if(_0x1de9e3[_0xf02a('0x44')]['includeAll']){_0x31ef99[_0xf02a('0x55')]=[{'all':!![]}];}return db[_0xf02a('0x68')][_0xf02a('0x56')](_0x31ef99);})[_0xf02a('0x20')](function(_0x5a02ef){_0x582ac3[_0xf02a('0x6d')]=_0x5a02ef;return _0x582ac3;});}})['then'](respondWithFilteredResult(_0x4d885e,_0x31ef99))[_0xf02a('0x2a')](handleError(_0x4d885e,null));};exports[_0xf02a('0x6e')]=function(_0x2885bd,_0x4a4ebf,_0x1a9bdd){return db[_0xf02a('0x54')]['find']({'where':{'id':_0x2885bd['params']['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x4a4ebf,null))[_0xf02a('0x20')](function(_0x529477){if(_0x529477){return _0x529477[_0xf02a('0x6e')](_0x2885bd[_0xf02a('0x44')][_0xf02a('0x6f')]);}})[_0xf02a('0x20')](respondWithStatusCode(_0x4a4ebf,null))[_0xf02a('0x2a')](handleError(_0x4a4ebf,null));};exports['addAnswer']=function(_0x45817a,_0x3b8cfd,_0xe92495){if(_0x45817a[_0xf02a('0x5b')]['id']){delete _0x45817a[_0xf02a('0x5b')]['id'];}return db[_0xf02a('0x54')][_0xf02a('0x59')]({'where':{'id':_0x45817a['params']['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x3b8cfd,null))[_0xf02a('0x20')](function(_0x3c802b){if(_0x3c802b){_0x45817a['body'][_0xf02a('0x67')]=_0x3c802b['id'];return db['CannedAnswer'][_0xf02a('0x5a')](_0x45817a['body']);}})[_0xf02a('0x20')](respondWithResult(_0x3b8cfd,null))[_0xf02a('0x2a')](handleError(_0x3b8cfd,null));};exports[_0xf02a('0x70')]=function(_0x857c17,_0x41905e,_0x353301){var _0x42b378={'raw':![],'where':{}};var _0x269829={};var _0x468313={'count':0x0,'rows':[]};return db[_0xf02a('0x54')][_0xf02a('0x6a')]({'where':{'id':_0x857c17['params']['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x41905e,null))[_0xf02a('0x20')](function(_0x181c8f){if(_0x181c8f){_0x269829[_0xf02a('0x43')]=_[_0xf02a('0x45')](db[_0xf02a('0x71')][_0xf02a('0x3f')]);_0x269829[_0xf02a('0x44')]=_['keys'](_0x857c17['query']);_0x269829[_0xf02a('0x4f')]=_[_0xf02a('0x46')](_0x269829[_0xf02a('0x43')],_0x269829[_0xf02a('0x44')]);_0x42b378[_0xf02a('0x47')]=_['intersection'](_0x269829['model'],qs[_0xf02a('0x48')](_0x857c17['query'][_0xf02a('0x48')]));_0x42b378['attributes']=_0x42b378['attributes'][_0xf02a('0x49')]?_0x42b378[_0xf02a('0x47')]:_0x269829[_0xf02a('0x43')];if(!_0x857c17[_0xf02a('0x44')][_0xf02a('0x4a')](_0xf02a('0x4b'))){_0x42b378[_0xf02a('0x4c')]=qs['limit'](_0x857c17[_0xf02a('0x44')][_0xf02a('0x4c')]);_0x42b378[_0xf02a('0x30')]=qs[_0xf02a('0x30')](_0x857c17[_0xf02a('0x44')][_0xf02a('0x30')]);}_0x42b378['order']=qs[_0xf02a('0x4d')](_0x857c17[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x42b378['where']=qs['filters'](_['pick'](_0x857c17[_0xf02a('0x44')],_0x269829[_0xf02a('0x4f')]));_0x42b378[_0xf02a('0x4e')][_0xf02a('0x67')]=_0x181c8f['id'];if(_0x857c17['query']['filter']){_0x42b378[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x42b378[_0xf02a('0x4e')],{'$or':_['map'](_0x42b378[_0xf02a('0x47')],function(_0xf2d6e6){var _0x3de982={};_0x3de982[_0xf2d6e6]={'$like':'%'+_0x857c17[_0xf02a('0x44')][_0xf02a('0x51')]+'%'};return _0x3de982;})});}_0x42b378=_[_0xf02a('0x6c')]({},_0x42b378,_0x857c17['options']);return db[_0xf02a('0x71')][_0xf02a('0x2f')]({'where':_0x42b378[_0xf02a('0x4e')]})['then'](function(_0x47b7fd){_0x468313[_0xf02a('0x2f')]=_0x47b7fd;if(_0x857c17[_0xf02a('0x44')][_0xf02a('0x58')]){_0x42b378['include']=[{'all':!![]}];}return db[_0xf02a('0x71')][_0xf02a('0x56')](_0x42b378);})[_0xf02a('0x20')](function(_0x9a8c6b){_0x468313[_0xf02a('0x6d')]=_0x9a8c6b;return _0x468313;});}})[_0xf02a('0x20')](respondWithFilteredResult(_0x41905e,_0x42b378))[_0xf02a('0x2a')](handleError(_0x41905e,null));};exports[_0xf02a('0x72')]=function(_0x59fa27,_0x5726c1,_0x2a333a){return db[_0xf02a('0x54')]['find']({'where':{'id':_0x59fa27['params']['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x5726c1,null))[_0xf02a('0x20')](function(_0x4194f2){if(_0x4194f2){return _0x4194f2[_0xf02a('0x72')](_0x59fa27[_0xf02a('0x44')][_0xf02a('0x6f')]);}})[_0xf02a('0x20')](respondWithStatusCode(_0x5726c1,null))[_0xf02a('0x2a')](handleError(_0x5726c1,null));};exports[_0xf02a('0x73')]=function(_0x3b1cb0,_0x129bb8,_0x10b2b7){return db[_0xf02a('0x74')]['find']({'where':{'id':_0x3b1cb0[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x129bb8,null))['then'](function(_0x547c0b){if(_0x547c0b){return _0x547c0b[_0xf02a('0x73')](_0x3b1cb0['body'][_0xf02a('0x6f')],_[_0xf02a('0x75')](_0x3b1cb0[_0xf02a('0x5b')],['ids','id'])||{});}})[_0xf02a('0x20')](respondWithResult(_0x129bb8,null))[_0xf02a('0x2a')](handleError(_0x129bb8,null));};exports[_0xf02a('0x76')]=function(_0x2a7c1f,_0x2aa19c,_0xf731c9){var _0x2e6a69={'raw':![],'where':{}};var _0x56d733={};var _0x121801={'count':0x0,'rows':[]};return db[_0xf02a('0x54')][_0xf02a('0x6a')]({'where':{'id':_0x2a7c1f[_0xf02a('0x63')]['id']}})['then'](handleEntityNotFound(_0x2aa19c,null))[_0xf02a('0x20')](function(_0xd91b35){if(_0xd91b35){_0x56d733[_0xf02a('0x43')]=_['keys'](db[_0xf02a('0x74')][_0xf02a('0x3f')]);_0x56d733[_0xf02a('0x44')]=_['keys'](_0x2a7c1f[_0xf02a('0x44')]);_0x56d733[_0xf02a('0x4f')]=_['intersection'](_0x56d733[_0xf02a('0x43')],_0x56d733[_0xf02a('0x44')]);_0x2e6a69[_0xf02a('0x47')]=_[_0xf02a('0x46')](_0x56d733[_0xf02a('0x43')],qs[_0xf02a('0x48')](_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x48')]));_0x2e6a69[_0xf02a('0x47')]=_0x2e6a69['attributes']['length']?_0x2e6a69[_0xf02a('0x47')]:_0x56d733[_0xf02a('0x43')];if(!_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x4a')]('nolimit')){_0x2e6a69[_0xf02a('0x4c')]=qs[_0xf02a('0x4c')](_0x2a7c1f['query'][_0xf02a('0x4c')]);_0x2e6a69[_0xf02a('0x30')]=qs[_0xf02a('0x30')](_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x30')]);}_0x2e6a69['order']=qs['sort'](_0x2a7c1f[_0xf02a('0x44')]['sort']);_0x2e6a69['where']=qs['filters'](_['pick'](_0x2a7c1f[_0xf02a('0x44')],_0x56d733[_0xf02a('0x4f')]));_0x2e6a69[_0xf02a('0x4e')][_0xf02a('0x67')]=_0xd91b35['id'];if(_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x51')]){_0x2e6a69[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x2e6a69[_0xf02a('0x4e')],{'$or':_[_0xf02a('0x3e')](_0x2e6a69[_0xf02a('0x47')],function(_0x7eb2fe){var _0x2a5d29={};_0x2a5d29[_0x7eb2fe]={'$like':'%'+_0x2a7c1f['query'][_0xf02a('0x51')]+'%'};return _0x2a5d29;})});}_0x2e6a69=_[_0xf02a('0x6c')]({},_0x2e6a69,_0x2a7c1f[_0xf02a('0x53')]);return db[_0xf02a('0x74')][_0xf02a('0x2f')]({'where':_0x2e6a69[_0xf02a('0x4e')]})['then'](function(_0x2ba894){_0x121801[_0xf02a('0x2f')]=_0x2ba894;if(_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x58')]){_0x2e6a69[_0xf02a('0x55')]=[{'model':db[_0xf02a('0x77')],'as':_0xf02a('0x78'),'required':![]},{'model':db['User'],'as':_0xf02a('0x79'),'attributes':[_0xf02a('0x3a'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xf02a('0x3a'),'color'],'where':_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x7a')]?{'id':_0x2a7c1f[_0xf02a('0x44')][_0xf02a('0x7a')]}:undefined,'required':_0x2a7c1f[_0xf02a('0x44')]['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x2e6a69);})[_0xf02a('0x20')](function(_0x493d61){_0x121801[_0xf02a('0x6d')]=_0x493d61;return _0x121801;});}})[_0xf02a('0x20')](respondWithFilteredResult(_0x2aa19c,_0x2e6a69))[_0xf02a('0x2a')](handleError(_0x2aa19c,null));};exports[_0xf02a('0x7b')]=function(_0x4df596,_0x3ac9ec){var _0x72f9d8=_0x4df596[_0xf02a('0x63')]['id'];var _0x44d93c=_0x4df596[_0xf02a('0x5b')];var _0x4ee169=0xc8;var _0x1477e9=null;return db[_0xf02a('0x7c')][_0xf02a('0x7d')]({'isolationLevel':db[_0xf02a('0x7c')][_0xf02a('0x7e')][_0xf02a('0x7f')][_0xf02a('0x80')]},function(_0x5bca2a){return db['FaxAccount']['findOne']({'where':{'id':_0x72f9d8},'transaction':_0x5bca2a})[_0xf02a('0x20')](function(_0x4d4c62){if(_0x4d4c62){return db[_0xf02a('0x81')][_0xf02a('0x36')]({'where':{'FaxAccountId':_0x72f9d8},'transaction':_0x5bca2a})[_0xf02a('0x20')](function(){var _0x517368=_['map'](_0x44d93c,function(_0x577dcb){_0x577dcb[_0xf02a('0x67')]=_0x72f9d8;return _0x577dcb;});return db[_0xf02a('0x81')][_0xf02a('0x82')](_0x517368,{'transaction':_0x5bca2a});});}else{_0x4ee169=0x194;_0x1477e9=[];}});})[_0xf02a('0x20')](function(){if(_0x4ee169!==0x194){return db[_0xf02a('0x81')][_0xf02a('0x83')]({'where':{'FaxAccountId':_0x72f9d8},'order':_0xf02a('0x84')})[_0xf02a('0x20')](function(_0x324e69){_0x1477e9=_0x324e69;});}})['catch'](function(_0x2b337b){_0x4ee169=0x1f4;logger[_0xf02a('0x26')](_0x2b337b[_0xf02a('0x39')]);if(_0x2b337b['name']){delete _0x2b337b['name'];}_0x1477e9=_0x2b337b;})[_0xf02a('0x85')](function(){if(_0x1477e9===null){_0x3ac9ec[_0xf02a('0x38')](_0x4ee169);}else{if(_0x4ee169===0x1f4){_0x3ac9ec[_0xf02a('0x2b')](_0x4ee169)[_0xf02a('0x3b')](_0x1477e9);}else{_0x3ac9ec['status'](_0x4ee169)['json'](_0x1477e9);}}});};exports[_0xf02a('0x86')]=function(_0x3d8c3a,_0x51a10b,_0x540e77){var _0x19a081={};var _0x57758b={};var _0x542a88;var _0x2573ba;return db[_0xf02a('0x54')]['findOne']({'where':{'id':_0x3d8c3a[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x51a10b,null))['then'](function(_0x12c46e){if(_0x12c46e){_0x542a88=_0x12c46e;_0x57758b[_0xf02a('0x43')]=_[_0xf02a('0x45')](db[_0xf02a('0x81')]['rawAttributes']);_0x57758b[_0xf02a('0x44')]=_[_0xf02a('0x45')](_0x3d8c3a[_0xf02a('0x44')]);_0x57758b['filters']=_[_0xf02a('0x46')](_0x57758b[_0xf02a('0x43')],_0x57758b['query']);_0x19a081[_0xf02a('0x47')]=_[_0xf02a('0x46')](_0x57758b['model'],qs[_0xf02a('0x48')](_0x3d8c3a['query'][_0xf02a('0x48')]));_0x19a081[_0xf02a('0x47')]=_0x19a081[_0xf02a('0x47')][_0xf02a('0x49')]?_0x19a081[_0xf02a('0x47')]:_0x57758b[_0xf02a('0x43')];_0x19a081['order']=qs[_0xf02a('0x4d')](_0x3d8c3a[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x19a081[_0xf02a('0x4e')]=qs[_0xf02a('0x4f')](_[_0xf02a('0x50')](_0x3d8c3a[_0xf02a('0x44')],_0x57758b['filters']));if(_0x3d8c3a[_0xf02a('0x44')][_0xf02a('0x51')]){_0x19a081[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x19a081[_0xf02a('0x4e')],{'$or':_[_0xf02a('0x3e')](_0x19a081[_0xf02a('0x47')],function(_0xc7ce8){var _0x371775={};_0x371775[_0xc7ce8]={'$like':'%'+_0x3d8c3a['query'][_0xf02a('0x51')]+'%'};return _0x371775;})});}_0x19a081=_[_0xf02a('0x6c')]({},_0x19a081,_0x3d8c3a[_0xf02a('0x53')]);return _0x542a88[_0xf02a('0x86')](_0x19a081);}})[_0xf02a('0x20')](function(_0xe097e6){if(_0xe097e6){_0x2573ba=_0xe097e6[_0xf02a('0x49')];if(!_0x3d8c3a['query'][_0xf02a('0x4a')]('nolimit')){_0x19a081[_0xf02a('0x4c')]=qs[_0xf02a('0x4c')](_0x3d8c3a[_0xf02a('0x44')]['limit']);_0x19a081[_0xf02a('0x30')]=qs[_0xf02a('0x30')](_0x3d8c3a['query']['offset']);}return _0x542a88[_0xf02a('0x86')](_0x19a081);}})[_0xf02a('0x20')](function(_0x189f18){if(_0x189f18){return _0x189f18?{'count':_0x2573ba,'rows':_0x189f18}:null;}})[_0xf02a('0x20')](respondWithResult(_0x51a10b,null))[_0xf02a('0x2a')](handleError(_0x51a10b,null));};function Extension(_0x1eecb1,_0x289358,_0x2ecb35,_0xf87d53){this[_0xf02a('0x87')]='from-voip-provider';this[_0xf02a('0x88')]=_0x1eecb1[_0xf02a('0x89')];this[_0xf02a('0x8a')]=_0xf87d53;this[_0xf02a('0x41')]=_0xf02a('0x8b');this[_0xf02a('0x8c')]=_0xf02a('0x8d');this[_0xf02a('0x67')]=_0x1eecb1['id'];this['priority']=_0x289358;this[_0xf02a('0x8e')]=_0x2ecb35;}function createExtensionsReciveFax(_0x53e14c){var _0x3157ae=0x1;var _0x4c2d07=[];_0x4c2d07['push'](new Extension(_0x53e14c,_0x3157ae,'',_0xf02a('0x8f')));_0x3157ae+=0x1;_0x4c2d07[_0xf02a('0x90')](new Extension(_0x53e14c,_0x3157ae,'CDR(type)=inbound-fax',_0xf02a('0x91')));_0x3157ae+=0x1;for(var _0x4433d0 in _0x53e14c){if(_0x53e14c[_0xf02a('0x4a')](_0x4433d0)&&(_0x4433d0===_0xf02a('0x92')||_0x4433d0===_0xf02a('0x89')||_0x4433d0===_0xf02a('0x93')||_0x4433d0==='faxdetect'||_0x4433d0===_0xf02a('0x94')||_0x4433d0===_0xf02a('0x95')||_0x4433d0===_0xf02a('0x96')||_0x4433d0===_0xf02a('0x97')||_0x4433d0===_0xf02a('0x98'))){_0x4c2d07[_0xf02a('0x90')](new Extension(_0x53e14c,_0x3157ae,_0xf02a('0x99')+_0x4433d0+')='+_0x53e14c[_0x4433d0],_0xf02a('0x91')));_0x3157ae+=0x1;}}_0x4c2d07[_0xf02a('0x90')](new Extension(_0x53e14c,_0x3157ae,'6','Wait'));_0x3157ae+=0x1;_0x4c2d07[_0xf02a('0x90')](new Extension(_0x53e14c,_0x3157ae,_0xf02a('0x9a'),'ReceiveFax'));_0x3157ae=0x0;return _0x4c2d07;}exports[_0xf02a('0x9b')]=function(_0x3be536,_0x1b881e,_0x2973cb){var _0x1a9d16;return db[_0xf02a('0x7c')][_0xf02a('0x7d')](function(_0x328ee7){return db[_0xf02a('0x54')][_0xf02a('0x5a')](_0x3be536[_0xf02a('0x5b')],{'transaction':_0x328ee7})[_0xf02a('0x20')](function(_0x23111e){_0x1a9d16=_0x23111e[_0xf02a('0x5d')]({'plain':!![]});return db[_0xf02a('0x9c')]['bulkCreate'](createExtensionsReciveFax(_0x1a9d16),{'transaction':_0x328ee7});});})[_0xf02a('0x20')](function(){return _0x1a9d16;})[_0xf02a('0x20')](respondWithResult(_0x1b881e,null))[_0xf02a('0x2a')](handleError(_0x1b881e,null));};exports[_0xf02a('0x9d')]=function(_0x53a396,_0x5e0807,_0x5ccac1){var _0x80aca8;return db[_0xf02a('0x7c')][_0xf02a('0x7d')](function(_0x51c823){return db[_0xf02a('0x54')][_0xf02a('0x35')](_0x53a396[_0xf02a('0x5b')],{'where':{'id':_0x53a396[_0xf02a('0x5b')]['id']},'transaction':_0x51c823})[_0xf02a('0x20')](function(_0x2cc257){return db[_0xf02a('0x9c')][_0xf02a('0x36')]({'where':{'FaxAccountId':_0x53a396[_0xf02a('0x5b')]['id']},'transaction':_0x51c823})['then'](function(_0x3f0c9b){return db[_0xf02a('0x9c')][_0xf02a('0x82')](createExtensionsReciveFax(_[_0xf02a('0x75')](_0x53a396[_0xf02a('0x5b')],[_0xf02a('0x9e'),'key','createdAt','updatedAt',_0xf02a('0x9f'),_0xf02a('0xa0')])),{'transaction':_0x51c823});});});})[_0xf02a('0x20')](function(){return db[_0xf02a('0x54')][_0xf02a('0xa1')](_0x53a396['body']['id']);})['then'](respondWithResult(_0x5e0807,null))[_0xf02a('0x2a')](handleError(_0x5e0807,null));};exports[_0xf02a('0xa2')]=function(_0x38ab4a,_0x391109,_0x332094){var _0x41a1bd={'raw':!![],'where':{}};var _0x422856={};var _0x4fdb95={'count':0x0,'rows':[]};return db[_0xf02a('0x54')]['findOne']({'where':{'id':_0x38ab4a[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x391109,null))[_0xf02a('0x20')](function(_0x52a431){if(_0x52a431){_0x422856[_0xf02a('0x43')]=_[_0xf02a('0x45')](db['FaxMessage'][_0xf02a('0x3f')]);_0x422856['query']=_[_0xf02a('0x45')](_0x38ab4a[_0xf02a('0x44')]);_0x422856[_0xf02a('0x4f')]=_[_0xf02a('0x46')](_0x422856[_0xf02a('0x43')],_0x422856['query']);_0x41a1bd[_0xf02a('0x47')]=_[_0xf02a('0x46')](_0x422856[_0xf02a('0x43')],qs['fields'](_0x38ab4a['query'][_0xf02a('0x48')]));_0x41a1bd[_0xf02a('0x47')]=_0x41a1bd['attributes']['length']?_0x41a1bd[_0xf02a('0x47')]:_0x422856[_0xf02a('0x43')];if(!_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x4a')](_0xf02a('0x4b'))){_0x41a1bd[_0xf02a('0x4c')]=qs['limit'](_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x4c')]);_0x41a1bd[_0xf02a('0x30')]=qs[_0xf02a('0x30')](_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x30')]);}_0x41a1bd[_0xf02a('0x6b')]=qs[_0xf02a('0x4d')](_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x41a1bd[_0xf02a('0x4e')]=qs['filters'](_[_0xf02a('0x50')](_0x38ab4a[_0xf02a('0x44')],_0x422856[_0xf02a('0x4f')]));_0x41a1bd[_0xf02a('0x4e')][_0xf02a('0x67')]=_0x52a431['id'];if(_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x51')]){_0x41a1bd[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x41a1bd['where'],{'$or':_[_0xf02a('0x3e')](_0x41a1bd[_0xf02a('0x47')],function(_0x315b4c){var _0x35ed8b={};_0x35ed8b[_0x315b4c]={'$like':'%'+_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x51')]+'%'};return _0x35ed8b;})});}if(_0x38ab4a[_0xf02a('0x44')][_0xf02a('0xa3')]){var _0x12c5b4=_0x38ab4a[_0xf02a('0x44')][_0xf02a('0xa3')]['split'](',');var _0x54f2de={};_0x54f2de[_0x12c5b4[0x0]]={'$gte':moment(_0x12c5b4[0x1])['format'](_0xf02a('0xa4'))};_0x41a1bd[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x41a1bd[_0xf02a('0x4e')],_0x54f2de);}_0x41a1bd=_['merge']({},_0x41a1bd,_0x38ab4a[_0xf02a('0x53')]);return db[_0xf02a('0xa5')][_0xf02a('0x2f')]({'where':_0x41a1bd[_0xf02a('0x4e')]})[_0xf02a('0x20')](function(_0x2945dc){_0x4fdb95[_0xf02a('0x2f')]=_0x2945dc;if(_0x38ab4a[_0xf02a('0x44')][_0xf02a('0x58')]){_0x41a1bd[_0xf02a('0x55')]=[{'all':!![]}];}return db[_0xf02a('0xa5')]['findAll'](_0x41a1bd);})['then'](function(_0x37e9ed){_0x4fdb95[_0xf02a('0x6d')]=_0x37e9ed;return _0x4fdb95;});}})[_0xf02a('0x20')](respondWithFilteredResult(_0x391109,_0x41a1bd))[_0xf02a('0x2a')](handleError(_0x391109,null));};exports[_0xf02a('0x3b')]=function(_0x37122d,_0xb1ff67,_0x474bca){var _0x12f30a,_0x4bb5b0={},_0x3daa68;if(_0x37122d['body']['to']){_0x3daa68=_0x37122d[_0xf02a('0x5b')]['to'][0x0];}return db[_0xf02a('0x54')][_0xf02a('0x59')]({'where':{'id':_0x37122d[_0xf02a('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xf02a('0xa6'),'include':[{'model':db[_0xf02a('0x77')],'as':_0xf02a('0xa7'),'where':{'fax':_0x3daa68},'limit':0x1,'order':[[_0xf02a('0xa8'),_0xf02a('0xa9')]]}]}]})[_0xf02a('0x20')](handleEntityNotFound(_0xb1ff67,null))[_0xf02a('0x20')](function(_0x5c8cb6){_0x12f30a=_0x5c8cb6;if(_0x37122d[_0xf02a('0x5b')]['attachments']&&_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][_0xf02a('0x49')]){for(var _0x35a354=0x0;_0x35a354<_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][_0xf02a('0x49')];_0x35a354+=0x1){_0x37122d[_0xf02a('0x5b')]['attachments'][_0x35a354]={'filename':_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][_0x35a354][_0xf02a('0x3a')],'id':_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][_0x35a354]['id'],'path':path['join'](config[_0xf02a('0xab')],_0xf02a('0xac'),_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][_0x35a354][_0xf02a('0xad')])};}}return respondWithRpcPromise(_0xf02a('0xae'),_0xf02a('0xae'),{'FaxAccountId':_['isNil'](_0x37122d[_0xf02a('0x63')]['id'])?undefined:_0x37122d['params']['id'],'path':_['isNil'](_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][0x0][_0xf02a('0xaf')])?undefined:_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][0x0]['path'],'fax':_[_0xf02a('0xb0')](_0x37122d[_0xf02a('0x5b')]['to'][0x0])?undefined:_0x37122d['body']['to'][0x0]},client9002);})['then'](function(){if(_0x12f30a){if(_['isNil'](_0x37122d['body'][_0xf02a('0xb1')])){_0x37122d[_0xf02a('0x5b')][_0xf02a('0xb1')]=util[_0xf02a('0xb2')]('\x22%s\x22\x20<%s>',_0x12f30a[_0xf02a('0x3a')],_0x12f30a[_0xf02a('0xb3')]);}if(_0x12f30a[_0xf02a('0xa6')]){if(_0x12f30a['List'][_0xf02a('0xa7')][_0xf02a('0x49')]){return _0x12f30a[_0xf02a('0xa6')][_0xf02a('0xa7')][0x0];}else{return db[_0xf02a('0x77')][_0xf02a('0x5a')](_['defaults'](_0x37122d[_0xf02a('0x5b')],{'firstName':_0x37122d[_0xf02a('0x5b')]['to'][0x0],'phone':_0x37122d[_0xf02a('0x5b')]['to'][0x0],'fax':_0x37122d['body']['to'][0x0],'ListId':_0x12f30a[_0xf02a('0xa0')]}));}}else{throw new Error(_0xf02a('0xb4'));}}else{throw new Error(_0xf02a('0xb5'));}})[_0xf02a('0x20')](function(_0x4617ea){if(_0x4617ea){return db[_0xf02a('0x74')][_0xf02a('0x59')]({'where':{'ContactId':_0x4617ea['id'],'closed':![],'FaxAccountId':_0x12f30a['id']}})[_0xf02a('0x20')](function(_0x3b775e){if(_0x3b775e){return[_0x3b775e,![]];}return db[_0xf02a('0x74')][_0xf02a('0x5a')]({'UserId':_0x37122d['user']['id'],'ContactId':_0x4617ea['id'],'FaxAccountId':_0x12f30a['id'],'fax':_0x37122d[_0xf02a('0x5b')]['to'][0x0],'firstMsgDirection':_0xf02a('0xb6'),'Messages':[_[_0xf02a('0x6c')](_0x37122d[_0xf02a('0x5b')],{'read':![],'body':_0x37122d[_0xf02a('0x5b')]['attachments'][0x0][_0xf02a('0xb7')],'FaxAccountId':_0x12f30a['id'],'UserId':_0x37122d['user']['id'],'ContactId':_0x4617ea['id'],'AttachmentId':_0x37122d['body'][_0xf02a('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0xf02a('0xa5')],'as':'Messages'}]})[_0xf02a('0x20')](function(_0x1ad0d1){return[_0x1ad0d1,!![]];});});}else{throw new Error(_0xf02a('0xb8'));}})[_0xf02a('0xb9')](function(_0x3bfa89,_0x55c661){if(_0x55c661){return _0x3bfa89;}return db['FaxMessage'][_0xf02a('0x5a')]({'direction':_0xf02a('0xb6'),'read':![],'body':_0x37122d['body'][_0xf02a('0xaa')][0x0][_0xf02a('0xb7')],'FaxAccountId':_0x12f30a['id'],'FaxInteractionId':_0x3bfa89['id'],'UserId':_0x37122d[_0xf02a('0x5c')]['id'],'ContactId':_0x3bfa89[_0xf02a('0xba')],'AttachmentId':_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][0x0]['id']})[_0xf02a('0x20')](function(_0x3aae56){_0x3bfa89[_0xf02a('0xbb')][_0xf02a('0xbc')]=[];_0x3bfa89[_0xf02a('0xbb')]['Messages'][_0xf02a('0x90')](_0x3aae56['dataValues']);return _0x3bfa89;});})[_0xf02a('0x20')](function(_0x59fe06){respondWithRpcPromise(_0xf02a('0xbd'),_0xf02a('0xbd'),{'FaxAccountId':_[_0xf02a('0xb0')](_0x37122d['params']['id'])?undefined:_0x37122d[_0xf02a('0x63')]['id'],'path':_[_0xf02a('0xb0')](_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][0x0][_0xf02a('0xaf')])?undefined:_0x37122d[_0xf02a('0x5b')]['attachments'][0x0][_0xf02a('0xaf')],'fax':_[_0xf02a('0xb0')](_0x37122d[_0xf02a('0x5b')]['to'][0x0])?undefined:_0x37122d[_0xf02a('0x5b')]['to'][0x0],'AttachmentId':_0x37122d[_0xf02a('0x5b')][_0xf02a('0xaa')][0x0]['id']},client9002)[_0xf02a('0x20')](function(_0x1d7c89){logger['info'](_0xf02a('0xbe'),_0x1d7c89);})[_0xf02a('0x2a')](function(_0x860a13){logger[_0xf02a('0x21')]('SendFaxRpc,\x20%s',_0x860a13);});return _0x59fe06;})['then'](respondWithResult(_0xb1ff67,null))[_0xf02a('0x2a')](handleError(_0xb1ff67,null));};exports['addAgents']=function(_0xe01573,_0x171214,_0x117acb){return db[_0xf02a('0x54')][_0xf02a('0x59')]({'where':{'id':_0xe01573[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x171214,null))[_0xf02a('0x20')](function(_0x3e65b8){if(_0x3e65b8){return _0x3e65b8[_0xf02a('0xbf')](_0xe01573[_0xf02a('0x5b')]['ids'],_[_0xf02a('0x75')](_0xe01573[_0xf02a('0x5b')],['ids','id'])||{})[_0xf02a('0xb9')](function(_0x1e1ddc){for(var _0x227c08=0x0;_0x227c08<_0xe01573[_0xf02a('0x5b')][_0xf02a('0x6f')]['length'];_0x227c08+=0x1){socket[_0xf02a('0xc0')](_0xf02a('0xc1'),{'UserId':Number(_0xe01573[_0xf02a('0x5b')]['ids'][_0x227c08]),'FaxAccountId':Number(_0xe01573[_0xf02a('0x63')]['id'])});}return _0x1e1ddc;});}})[_0xf02a('0x20')](respondWithResult(_0x171214,null))[_0xf02a('0x2a')](handleError(_0x171214,null));};exports['removeAgents']=function(_0x824240,_0x35c519,_0x1ecaa7){return db[_0xf02a('0x54')][_0xf02a('0x59')]({'where':{'id':_0x824240[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x35c519,null))[_0xf02a('0x20')](function(_0x165ef7){if(_0x165ef7){return _0x165ef7[_0xf02a('0xc2')](_0x824240[_0xf02a('0x44')][_0xf02a('0x6f')])[_0xf02a('0x20')](function(){if(_[_0xf02a('0xc3')](_0x824240[_0xf02a('0x44')]['ids'])){for(var _0x1c4608=0x0;_0x1c4608<_0x824240[_0xf02a('0x44')][_0xf02a('0x6f')]['length'];_0x1c4608+=0x1){socket['emit'](_0xf02a('0xc4'),{'UserId':Number(_0x824240[_0xf02a('0x44')][_0xf02a('0x6f')][_0x1c4608]),'FaxAccountId':Number(_0x824240['params']['id'])});}}else{socket[_0xf02a('0xc0')](_0xf02a('0xc4'),{'UserId':Number(_0x824240['query'][_0xf02a('0x6f')]),'FaxAccountId':Number(_0x824240[_0xf02a('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x35c519,null))[_0xf02a('0x2a')](handleError(_0x35c519,null));};exports[_0xf02a('0xc5')]=function(_0x2e4cc4,_0x49b06d,_0xfdeed5){var _0x2171a3={};var _0x2f46ee={};var _0x625d48;var _0x1c9b6a;return db['FaxAccount']['findOne']({'where':{'id':_0x2e4cc4[_0xf02a('0x63')]['id']}})[_0xf02a('0x20')](handleEntityNotFound(_0x49b06d,null))[_0xf02a('0x20')](function(_0x87bef9){if(_0x87bef9){_0x625d48=_0x87bef9;_0x2f46ee['model']=_[_0xf02a('0x45')](db['User']['rawAttributes']);_0x2f46ee['query']=_[_0xf02a('0x45')](_0x2e4cc4['query']);_0x2f46ee[_0xf02a('0x4f')]=_['intersection'](_0x2f46ee[_0xf02a('0x43')],_0x2f46ee['query']);_0x2171a3[_0xf02a('0x47')]=_['intersection'](_0x2f46ee['model'],qs['fields'](_0x2e4cc4[_0xf02a('0x44')][_0xf02a('0x48')]));_0x2171a3[_0xf02a('0x47')]=_0x2171a3[_0xf02a('0x47')][_0xf02a('0x49')]?_0x2171a3[_0xf02a('0x47')]:_0x2f46ee[_0xf02a('0x43')];_0x2171a3[_0xf02a('0x6b')]=qs[_0xf02a('0x4d')](_0x2e4cc4[_0xf02a('0x44')][_0xf02a('0x4d')]);_0x2171a3[_0xf02a('0x4e')]=qs['filters'](_[_0xf02a('0x50')](_0x2e4cc4[_0xf02a('0x44')],_0x2f46ee[_0xf02a('0x4f')]));if(_0x2e4cc4[_0xf02a('0x44')][_0xf02a('0x51')]){_0x2171a3[_0xf02a('0x4e')]=_[_0xf02a('0x6c')](_0x2171a3[_0xf02a('0x4e')],{'$or':_[_0xf02a('0x3e')](_0x2171a3[_0xf02a('0x47')],function(_0x34645f){var _0x2cb651={};_0x2cb651[_0x34645f]={'$like':'%'+_0x2e4cc4[_0xf02a('0x44')][_0xf02a('0x51')]+'%'};return _0x2cb651;})});}_0x2171a3=_[_0xf02a('0x6c')]({},_0x2171a3,_0x2e4cc4[_0xf02a('0x53')]);return _0x625d48[_0xf02a('0xc5')](_0x2171a3);}})[_0xf02a('0x20')](function(_0x3b434e){if(_0x3b434e){_0x1c9b6a=_0x3b434e[_0xf02a('0x49')];if(!_0x2e4cc4[_0xf02a('0x44')]['hasOwnProperty'](_0xf02a('0x4b'))){_0x2171a3[_0xf02a('0x4c')]=qs[_0xf02a('0x4c')](_0x2e4cc4['query'][_0xf02a('0x4c')]);_0x2171a3[_0xf02a('0x30')]=qs['offset'](_0x2e4cc4[_0xf02a('0x44')][_0xf02a('0x30')]);}return _0x625d48[_0xf02a('0xc5')](_0x2171a3);}})[_0xf02a('0x20')](function(_0x50484f){if(_0x50484f){return _0x50484f?{'count':_0x1c9b6a,'rows':_0x50484f}:null;}})[_0xf02a('0x20')](respondWithResult(_0x49b06d,null))[_0xf02a('0x2a')](handleError(_0x49b06d,null));}; \ No newline at end of file +var _0x7905=['CheckAfterSend','isNil','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','include','rows','show','params','keys','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','update','describe','addDisposition','Disposition','findOne','FaxAccountId','findAll','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','from-voip-provider','exten','app','description','Fax\x20Extension','priority','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','updatedAt','DESC','attachments','join','server/files/attachments','basename'];(function(_0x20a8ea,_0x3937d8){var _0x4df51b=function(_0x1c6780){while(--_0x1c6780){_0x20a8ea['push'](_0x20a8ea['shift']());}};_0x4df51b(++_0x3937d8);}(_0x7905,0xcd));var _0x5790=function(_0x591b58,_0x45a63a){_0x591b58=_0x591b58-0x0;var _0x1da85a=_0x7905[_0x591b58];return _0x1da85a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5790('0x0'));var jsonpatch=require(_0x5790('0x1'));var rp=require(_0x5790('0x2'));var moment=require('moment');var BPromise=require(_0x5790('0x3'));var Mustache=require(_0x5790('0x4'));var util=require(_0x5790('0x5'));var path=require(_0x5790('0x6'));var sox=require('sox');var csv=require(_0x5790('0x7'));var ejs=require(_0x5790('0x8'));var fs=require('fs');var fs_extra=require(_0x5790('0x9'));var _=require(_0x5790('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5790('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5790('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5790('0xd'));var hardwareService=require(_0x5790('0xe'));var logger=require('../../config/logger')(_0x5790('0xf'));var utils=require(_0x5790('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x5790('0x11'));var db=require(_0x5790('0x12'))['db'];config[_0x5790('0x13')]=_[_0x5790('0x14')](config[_0x5790('0x13')],{'host':_0x5790('0x15'),'port':0x18eb});var socket=require(_0x5790('0x16'))(new Redis(config[_0x5790('0x13')]));require(_0x5790('0x17'))[_0x5790('0x18')](socket);var jayson=require(_0x5790('0x19'));var client=jayson[_0x5790('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x5790('0x1a')][_0x5790('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x53ae0c,_0x4184ae,_0x1340a3,_0x5937db){return new BPromise(function(_0x1dc56f,_0x55b744){var _0x258325=_0x5937db||client;return _0x258325[_0x5790('0x1c')](_0x53ae0c,_0x1340a3)[_0x5790('0x1d')](function(_0x13f7e3){logger[_0x5790('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x4184ae,_0x5790('0x1f'));logger[_0x5790('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4184ae,_0x5790('0x1f'),JSON[_0x5790('0x21')](_0x13f7e3));if(_0x13f7e3[_0x5790('0x22')]){if(_0x13f7e3[_0x5790('0x22')][_0x5790('0x23')]===0x1f4){logger['error'](_0x5790('0x24'),_0x4184ae,_0x13f7e3[_0x5790('0x22')][_0x5790('0x25')]);return _0x55b744(_0x13f7e3[_0x5790('0x22')][_0x5790('0x25')]);}logger[_0x5790('0x22')]('FaxAccount,\x20%s,\x20%s',_0x4184ae,_0x13f7e3[_0x5790('0x22')][_0x5790('0x25')]);return _0x1dc56f(_0x13f7e3[_0x5790('0x22')][_0x5790('0x25')]);}else{logger[_0x5790('0x1e')](_0x5790('0x24'),_0x4184ae,_0x5790('0x1f'));_0x1dc56f(_0x13f7e3[_0x5790('0x26')][_0x5790('0x25')]);}})[_0x5790('0x27')](function(_0x3d1dc1){logger[_0x5790('0x22')](_0x5790('0x24'),_0x4184ae,_0x3d1dc1);_0x55b744(_0x3d1dc1);});});}function respondWithStatusCode(_0x3ec2b8,_0x56b789){_0x56b789=_0x56b789||0xcc;return function(_0x46d16e){if(_0x46d16e){return _0x3ec2b8[_0x5790('0x28')](_0x56b789);}return _0x3ec2b8[_0x5790('0x29')](_0x56b789)['end']();};}function respondWithResult(_0x2a5586,_0x3734c6){_0x3734c6=_0x3734c6||0xc8;return function(_0x2f51ab){if(_0x2f51ab){return _0x2a5586[_0x5790('0x29')](_0x3734c6)[_0x5790('0x2a')](_0x2f51ab);}};}function respondWithFilteredResult(_0x26258c,_0x36f280){return function(_0x1b54d7){if(_0x1b54d7){var _0x1128a1=typeof _0x36f280[_0x5790('0x2b')]===_0x5790('0x2c')&&typeof _0x36f280[_0x5790('0x2d')]===_0x5790('0x2c');var _0x35c5ee=_0x1b54d7[_0x5790('0x2e')];var _0x43a12a=_0x1128a1?0x0:_0x36f280[_0x5790('0x2b')];var _0x336d22=_0x1128a1?_0x1b54d7[_0x5790('0x2e')]:_0x36f280[_0x5790('0x2b')]+_0x36f280[_0x5790('0x2d')];var _0x19634e;if(_0x336d22>=_0x35c5ee){_0x336d22=_0x35c5ee;_0x19634e=0xc8;}else{_0x19634e=0xce;}_0x26258c[_0x5790('0x29')](_0x19634e);return _0x26258c[_0x5790('0x2f')](_0x5790('0x30'),_0x43a12a+'-'+_0x336d22+'/'+_0x35c5ee)[_0x5790('0x2a')](_0x1b54d7);}return null;};}function patchUpdates(_0x26781f){return function(_0x10f5f0){try{jsonpatch[_0x5790('0x31')](_0x10f5f0,_0x26781f,!![]);}catch(_0x504668){return BPromise[_0x5790('0x32')](_0x504668);}return _0x10f5f0[_0x5790('0x33')]();};}function saveUpdates(_0x10db2f,_0x42e616){return function(_0x55d9d9){if(_0x55d9d9){return _0x55d9d9['update'](_0x10db2f)[_0x5790('0x1d')](function(_0x24e58c){return _0x24e58c;});}return null;};}function removeEntity(_0x3818b9,_0x52c07c){return function(_0xebebc5){if(_0xebebc5){return _0xebebc5[_0x5790('0x34')]()[_0x5790('0x1d')](function(){var _0x1f796c=_0xebebc5['get']({'plain':!![]});var _0x1e001d=_0x5790('0x35');return db[_0x5790('0x36')][_0x5790('0x34')]({'where':{'type':_0x1e001d,'resourceId':_0x1f796c['id']}})[_0x5790('0x1d')](function(){return _0xebebc5;});})[_0x5790('0x1d')](function(){_0x3818b9[_0x5790('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13814c,_0x3481d7){return function(_0x3f2961){if(!_0x3f2961){_0x13814c[_0x5790('0x28')](0x194);}return _0x3f2961;};}function handleError(_0x1e3ed4,_0x3e17d3){_0x3e17d3=_0x3e17d3||0x1f4;return function(_0x561e96){logger[_0x5790('0x22')](_0x561e96[_0x5790('0x37')]);if(_0x561e96[_0x5790('0x38')]){delete _0x561e96[_0x5790('0x38')];}_0x1e3ed4[_0x5790('0x29')](_0x3e17d3)[_0x5790('0x39')](_0x561e96);};}exports['index']=function(_0x1213c4,_0x3b7536){var _0xf00605={'include':[{'model':db[_0x5790('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1ad198={},_0x48ae93={'count':0x0,'rows':[]};var _0x3ea036=_[_0x5790('0x3b')](db[_0x5790('0x3c')][_0x5790('0x3d')],function(_0x5962a3){return{'name':_0x5962a3[_0x5790('0x3e')],'type':_0x5962a3[_0x5790('0x3f')][_0x5790('0x40')]};});_0x1ad198[_0x5790('0x41')]=_[_0x5790('0x3b')](_0x3ea036,_0x5790('0x38'));_0x1ad198[_0x5790('0x42')]=_['keys'](_0x1213c4[_0x5790('0x42')]);_0x1ad198[_0x5790('0x43')]=_[_0x5790('0x44')](_0x1ad198[_0x5790('0x41')],_0x1ad198[_0x5790('0x42')]);_0xf00605[_0x5790('0x45')]=_[_0x5790('0x44')](_0x1ad198['model'],qs[_0x5790('0x46')](_0x1213c4[_0x5790('0x42')][_0x5790('0x46')]));_0xf00605[_0x5790('0x45')]=_0xf00605['attributes'][_0x5790('0x47')]?_0xf00605[_0x5790('0x45')]:_0x1ad198['model'];if(!_0x1213c4[_0x5790('0x42')]['hasOwnProperty'](_0x5790('0x48'))){_0xf00605[_0x5790('0x2d')]=qs[_0x5790('0x2d')](_0x1213c4[_0x5790('0x42')][_0x5790('0x2d')]);_0xf00605[_0x5790('0x2b')]=qs[_0x5790('0x2b')](_0x1213c4['query'][_0x5790('0x2b')]);}_0xf00605[_0x5790('0x49')]=qs[_0x5790('0x4a')](_0x1213c4[_0x5790('0x42')][_0x5790('0x4a')]);_0xf00605[_0x5790('0x4b')]=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x1213c4[_0x5790('0x42')],_0x1ad198[_0x5790('0x43')]),_0x3ea036);if(_0x1213c4['query'][_0x5790('0x4d')]){_0xf00605[_0x5790('0x4b')]=_[_0x5790('0x4e')](_0xf00605[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x3ea036,function(_0x2fe33d){if(_0x2fe33d['type']!=='VIRTUAL'){var _0xcbb77b={};_0xcbb77b[_0x2fe33d[_0x5790('0x38')]]={'$like':'%'+_0x1213c4['query'][_0x5790('0x4d')]+'%'};return _0xcbb77b;}})});}_0xf00605=_[_0x5790('0x4e')]({},_0xf00605,_0x1213c4[_0x5790('0x4f')]);var _0x27887b={'where':_0xf00605[_0x5790('0x4b')]};return db['FaxAccount'][_0x5790('0x2e')](_0x27887b)[_0x5790('0x1d')](function(_0x5a8b94){_0x48ae93['count']=_0x5a8b94;if(_0x1213c4['query']['includeAll']){_0xf00605[_0x5790('0x50')]=[{'all':!![]}];}return db[_0x5790('0x3c')]['findAll'](_0xf00605);})[_0x5790('0x1d')](function(_0x4dda64){_0x48ae93[_0x5790('0x51')]=_0x4dda64;return _0x48ae93;})['then'](respondWithFilteredResult(_0x3b7536,_0xf00605))[_0x5790('0x27')](handleError(_0x3b7536,null));};exports[_0x5790('0x52')]=function(_0x5719d8,_0x29483b){var _0x1006e1={'raw':![],'where':{'id':_0x5719d8[_0x5790('0x53')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x69c01b={};_0x69c01b[_0x5790('0x41')]=_[_0x5790('0x54')](db['FaxAccount'][_0x5790('0x3d')]);_0x69c01b[_0x5790('0x42')]=_['keys'](_0x5719d8[_0x5790('0x42')]);_0x69c01b[_0x5790('0x43')]=_[_0x5790('0x44')](_0x69c01b[_0x5790('0x41')],_0x69c01b[_0x5790('0x42')]);_0x1006e1[_0x5790('0x45')]=_[_0x5790('0x44')](_0x69c01b[_0x5790('0x41')],qs['fields'](_0x5719d8[_0x5790('0x42')]['fields']));_0x1006e1[_0x5790('0x45')]=_0x1006e1['attributes'][_0x5790('0x47')]?_0x1006e1[_0x5790('0x45')]:_0x69c01b[_0x5790('0x41')];if(_0x5719d8[_0x5790('0x42')][_0x5790('0x55')]){_0x1006e1[_0x5790('0x50')]=[{'all':!![]}];}_0x1006e1=_['merge']({},_0x1006e1,_0x5719d8['options']);return db[_0x5790('0x3c')][_0x5790('0x56')](_0x1006e1)['then'](handleEntityNotFound(_0x29483b,null))['then'](respondWithResult(_0x29483b,null))['catch'](handleError(_0x29483b,null));};exports[_0x5790('0x57')]=function(_0x50db67,_0x407833){return db[_0x5790('0x3c')][_0x5790('0x57')](_0x50db67[_0x5790('0x58')],{})['then'](function(_0x11f5df){var _0x129255=_0x50db67[_0x5790('0x59')][_0x5790('0x5a')]({'plain':!![]});if(!_0x129255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x129255[_0x5790('0x5b')]===_0x5790('0x59')){var _0x300c3c=_0x11f5df[_0x5790('0x5a')]({'plain':!![]});var _0xed5250=_0x5790('0x35');return db[_0x5790('0x5c')][_0x5790('0x56')]({'where':{'name':_0xed5250,'userProfileId':_0x129255[_0x5790('0x5d')]},'raw':!![]})[_0x5790('0x1d')](function(_0x106a3f){if(_0x106a3f&&_0x106a3f[_0x5790('0x5e')]===0x0){return db[_0x5790('0x36')][_0x5790('0x57')]({'name':_0x300c3c[_0x5790('0x38')],'resourceId':_0x300c3c['id'],'type':_0x106a3f['name'],'sectionId':_0x106a3f['id']},{})[_0x5790('0x1d')](function(){return _0x11f5df;});}else{return _0x11f5df;}})[_0x5790('0x27')](function(_0x5448ed){logger[_0x5790('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5448ed);throw _0x5448ed;});}return _0x11f5df;})[_0x5790('0x1d')](respondWithResult(_0x407833,0xc9))['catch'](handleError(_0x407833,null));};exports[_0x5790('0x5f')]=function(_0x256222,_0x391e13){if(_0x256222[_0x5790('0x58')]['id']){delete _0x256222['body']['id'];}return db[_0x5790('0x3c')][_0x5790('0x56')]({'where':{'id':_0x256222[_0x5790('0x53')]['id']},'include':[{'model':db[_0x5790('0x3a')],'as':'mandatoryDispositionPause'}]})[_0x5790('0x1d')](handleEntityNotFound(_0x391e13,null))[_0x5790('0x1d')](saveUpdates(_0x256222[_0x5790('0x58')],null))[_0x5790('0x1d')](respondWithResult(_0x391e13,null))[_0x5790('0x27')](handleError(_0x391e13,null));};exports[_0x5790('0x34')]=function(_0x2c4888,_0x412939){return db[_0x5790('0x3c')]['find']({'where':{'id':_0x2c4888['params']['id']}})['then'](handleEntityNotFound(_0x412939,null))[_0x5790('0x1d')](removeEntity(_0x412939,null))[_0x5790('0x27')](handleError(_0x412939,null));};exports[_0x5790('0x60')]=function(_0x4dba90,_0x457806){return db[_0x5790('0x3c')][_0x5790('0x60')]()[_0x5790('0x1d')](respondWithResult(_0x457806,null))['catch'](handleError(_0x457806,null));};exports[_0x5790('0x61')]=function(_0x405687,_0x11f198,_0x32cb5e){if(_0x405687[_0x5790('0x58')]['id']){delete _0x405687[_0x5790('0x58')]['id'];}return db[_0x5790('0x3c')][_0x5790('0x56')]({'where':{'id':_0x405687[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x11f198,null))[_0x5790('0x1d')](function(_0x1fe8a2){if(_0x1fe8a2){_0x405687[_0x5790('0x58')]['FaxAccountId']=_0x1fe8a2['id'];return db[_0x5790('0x62')]['create'](_0x405687[_0x5790('0x58')]);}})[_0x5790('0x1d')](respondWithResult(_0x11f198,null))[_0x5790('0x27')](handleError(_0x11f198,null));};exports['getDispositions']=function(_0x364cb3,_0x1f1ca4,_0x4d2319){var _0x3b2d3c={'raw':![],'where':{}};var _0x35c336={};var _0x27663b={'count':0x0,'rows':[]};return db[_0x5790('0x3c')][_0x5790('0x63')]({'where':{'id':_0x364cb3['params']['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x1f1ca4,null))[_0x5790('0x1d')](function(_0x5147b1){if(_0x5147b1){_0x35c336[_0x5790('0x41')]=_[_0x5790('0x54')](db['Disposition'][_0x5790('0x3d')]);_0x35c336[_0x5790('0x42')]=_[_0x5790('0x54')](_0x364cb3['query']);_0x35c336[_0x5790('0x43')]=_[_0x5790('0x44')](_0x35c336[_0x5790('0x41')],_0x35c336['query']);_0x3b2d3c[_0x5790('0x45')]=_['intersection'](_0x35c336['model'],qs[_0x5790('0x46')](_0x364cb3[_0x5790('0x42')][_0x5790('0x46')]));_0x3b2d3c['attributes']=_0x3b2d3c['attributes']['length']?_0x3b2d3c[_0x5790('0x45')]:_0x35c336[_0x5790('0x41')];if(!_0x364cb3['query']['hasOwnProperty'](_0x5790('0x48'))){_0x3b2d3c[_0x5790('0x2d')]=qs[_0x5790('0x2d')](_0x364cb3[_0x5790('0x42')][_0x5790('0x2d')]);_0x3b2d3c[_0x5790('0x2b')]=qs[_0x5790('0x2b')](_0x364cb3[_0x5790('0x42')][_0x5790('0x2b')]);}_0x3b2d3c[_0x5790('0x49')]=qs[_0x5790('0x4a')](_0x364cb3[_0x5790('0x42')][_0x5790('0x4a')]);_0x3b2d3c[_0x5790('0x4b')]=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x364cb3['query'],_0x35c336[_0x5790('0x43')]));_0x3b2d3c['where'][_0x5790('0x64')]=_0x5147b1['id'];if(_0x364cb3[_0x5790('0x42')][_0x5790('0x4d')]){_0x3b2d3c['where']=_['merge'](_0x3b2d3c[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x3b2d3c[_0x5790('0x45')],function(_0x505ad0){var _0x13311f={};_0x13311f[_0x505ad0]={'$like':'%'+_0x364cb3[_0x5790('0x42')][_0x5790('0x4d')]+'%'};return _0x13311f;})});}_0x3b2d3c=_['merge']({},_0x3b2d3c,_0x364cb3['options']);return db[_0x5790('0x62')]['count']({'where':_0x3b2d3c[_0x5790('0x4b')]})[_0x5790('0x1d')](function(_0x59d338){_0x27663b[_0x5790('0x2e')]=_0x59d338;if(_0x364cb3['query'][_0x5790('0x55')]){_0x3b2d3c['include']=[{'all':!![]}];}return db[_0x5790('0x62')][_0x5790('0x65')](_0x3b2d3c);})[_0x5790('0x1d')](function(_0x246686){_0x27663b[_0x5790('0x51')]=_0x246686;return _0x27663b;});}})[_0x5790('0x1d')](respondWithFilteredResult(_0x1f1ca4,_0x3b2d3c))['catch'](handleError(_0x1f1ca4,null));};exports[_0x5790('0x66')]=function(_0x8278fd,_0x28a50b,_0x352597){return db[_0x5790('0x3c')][_0x5790('0x56')]({'where':{'id':_0x8278fd[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x28a50b,null))[_0x5790('0x1d')](function(_0x45b28b){if(_0x45b28b){return _0x45b28b['removeDispositions'](_0x8278fd[_0x5790('0x42')][_0x5790('0x67')]);}})[_0x5790('0x1d')](respondWithStatusCode(_0x28a50b,null))[_0x5790('0x27')](handleError(_0x28a50b,null));};exports[_0x5790('0x68')]=function(_0x10b74c,_0x3e00d8,_0x4c68fb){if(_0x10b74c[_0x5790('0x58')]['id']){delete _0x10b74c[_0x5790('0x58')]['id'];}return db[_0x5790('0x3c')]['find']({'where':{'id':_0x10b74c[_0x5790('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e00d8,null))[_0x5790('0x1d')](function(_0x2420c1){if(_0x2420c1){_0x10b74c[_0x5790('0x58')]['FaxAccountId']=_0x2420c1['id'];return db['CannedAnswer'][_0x5790('0x57')](_0x10b74c[_0x5790('0x58')]);}})[_0x5790('0x1d')](respondWithResult(_0x3e00d8,null))[_0x5790('0x27')](handleError(_0x3e00d8,null));};exports[_0x5790('0x69')]=function(_0x294afe,_0x34b3a1,_0xf42924){var _0x849ad4={'raw':![],'where':{}};var _0x8335b2={};var _0x35c250={'count':0x0,'rows':[]};return db[_0x5790('0x3c')][_0x5790('0x63')]({'where':{'id':_0x294afe[_0x5790('0x53')]['id']}})['then'](handleEntityNotFound(_0x34b3a1,null))['then'](function(_0x3ffdb3){if(_0x3ffdb3){_0x8335b2[_0x5790('0x41')]=_[_0x5790('0x54')](db[_0x5790('0x6a')][_0x5790('0x3d')]);_0x8335b2[_0x5790('0x42')]=_[_0x5790('0x54')](_0x294afe['query']);_0x8335b2[_0x5790('0x43')]=_['intersection'](_0x8335b2[_0x5790('0x41')],_0x8335b2[_0x5790('0x42')]);_0x849ad4['attributes']=_[_0x5790('0x44')](_0x8335b2[_0x5790('0x41')],qs[_0x5790('0x46')](_0x294afe[_0x5790('0x42')][_0x5790('0x46')]));_0x849ad4['attributes']=_0x849ad4['attributes'][_0x5790('0x47')]?_0x849ad4['attributes']:_0x8335b2['model'];if(!_0x294afe['query'][_0x5790('0x6b')](_0x5790('0x48'))){_0x849ad4[_0x5790('0x2d')]=qs[_0x5790('0x2d')](_0x294afe[_0x5790('0x42')]['limit']);_0x849ad4[_0x5790('0x2b')]=qs[_0x5790('0x2b')](_0x294afe[_0x5790('0x42')][_0x5790('0x2b')]);}_0x849ad4[_0x5790('0x49')]=qs[_0x5790('0x4a')](_0x294afe[_0x5790('0x42')][_0x5790('0x4a')]);_0x849ad4[_0x5790('0x4b')]=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x294afe['query'],_0x8335b2[_0x5790('0x43')]));_0x849ad4[_0x5790('0x4b')]['FaxAccountId']=_0x3ffdb3['id'];if(_0x294afe[_0x5790('0x42')]['filter']){_0x849ad4[_0x5790('0x4b')]=_['merge'](_0x849ad4[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x849ad4[_0x5790('0x45')],function(_0x5cb22b){var _0x348dfa={};_0x348dfa[_0x5cb22b]={'$like':'%'+_0x294afe[_0x5790('0x42')][_0x5790('0x4d')]+'%'};return _0x348dfa;})});}_0x849ad4=_[_0x5790('0x4e')]({},_0x849ad4,_0x294afe[_0x5790('0x4f')]);return db[_0x5790('0x6a')][_0x5790('0x2e')]({'where':_0x849ad4[_0x5790('0x4b')]})['then'](function(_0x4459b5){_0x35c250[_0x5790('0x2e')]=_0x4459b5;if(_0x294afe['query'][_0x5790('0x55')]){_0x849ad4['include']=[{'all':!![]}];}return db[_0x5790('0x6a')][_0x5790('0x65')](_0x849ad4);})[_0x5790('0x1d')](function(_0x107042){_0x35c250[_0x5790('0x51')]=_0x107042;return _0x35c250;});}})[_0x5790('0x1d')](respondWithFilteredResult(_0x34b3a1,_0x849ad4))[_0x5790('0x27')](handleError(_0x34b3a1,null));};exports[_0x5790('0x6c')]=function(_0x11c2ca,_0x11140a,_0x19fd5d){return db['FaxAccount'][_0x5790('0x56')]({'where':{'id':_0x11c2ca[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x11140a,null))['then'](function(_0x129df1){if(_0x129df1){return _0x129df1[_0x5790('0x6c')](_0x11c2ca[_0x5790('0x42')][_0x5790('0x67')]);}})['then'](respondWithStatusCode(_0x11140a,null))[_0x5790('0x27')](handleError(_0x11140a,null));};exports[_0x5790('0x6d')]=function(_0x1001ea,_0x1721a0,_0x24ac93){return db[_0x5790('0x6e')][_0x5790('0x56')]({'where':{'id':_0x1001ea[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x1721a0,null))['then'](function(_0x956581){if(_0x956581){return _0x956581[_0x5790('0x6d')](_0x1001ea[_0x5790('0x58')]['ids'],_[_0x5790('0x6f')](_0x1001ea['body'],['ids','id'])||{});}})[_0x5790('0x1d')](respondWithResult(_0x1721a0,null))[_0x5790('0x27')](handleError(_0x1721a0,null));};exports[_0x5790('0x70')]=function(_0x1703fa,_0x30d82b,_0x524bbb){var _0x3a1e73={'raw':![],'where':{}};var _0x11ee27={};var _0x337a2d={'count':0x0,'rows':[]};return db[_0x5790('0x3c')]['findOne']({'where':{'id':_0x1703fa[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x30d82b,null))[_0x5790('0x1d')](function(_0x2a69b0){if(_0x2a69b0){_0x11ee27[_0x5790('0x41')]=_[_0x5790('0x54')](db[_0x5790('0x6e')][_0x5790('0x3d')]);_0x11ee27['query']=_[_0x5790('0x54')](_0x1703fa[_0x5790('0x42')]);_0x11ee27['filters']=_[_0x5790('0x44')](_0x11ee27[_0x5790('0x41')],_0x11ee27[_0x5790('0x42')]);_0x3a1e73[_0x5790('0x45')]=_[_0x5790('0x44')](_0x11ee27['model'],qs[_0x5790('0x46')](_0x1703fa['query'][_0x5790('0x46')]));_0x3a1e73['attributes']=_0x3a1e73[_0x5790('0x45')][_0x5790('0x47')]?_0x3a1e73[_0x5790('0x45')]:_0x11ee27['model'];if(!_0x1703fa['query']['hasOwnProperty'](_0x5790('0x48'))){_0x3a1e73['limit']=qs[_0x5790('0x2d')](_0x1703fa[_0x5790('0x42')][_0x5790('0x2d')]);_0x3a1e73['offset']=qs['offset'](_0x1703fa['query'][_0x5790('0x2b')]);}_0x3a1e73[_0x5790('0x49')]=qs[_0x5790('0x4a')](_0x1703fa[_0x5790('0x42')][_0x5790('0x4a')]);_0x3a1e73['where']=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x1703fa['query'],_0x11ee27[_0x5790('0x43')]));_0x3a1e73[_0x5790('0x4b')][_0x5790('0x64')]=_0x2a69b0['id'];if(_0x1703fa[_0x5790('0x42')][_0x5790('0x4d')]){_0x3a1e73[_0x5790('0x4b')]=_['merge'](_0x3a1e73[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x3a1e73[_0x5790('0x45')],function(_0x4dfe41){var _0x972954={};_0x972954[_0x4dfe41]={'$like':'%'+_0x1703fa[_0x5790('0x42')][_0x5790('0x4d')]+'%'};return _0x972954;})});}_0x3a1e73=_['merge']({},_0x3a1e73,_0x1703fa[_0x5790('0x4f')]);return db[_0x5790('0x6e')][_0x5790('0x2e')]({'where':_0x3a1e73['where']})['then'](function(_0x4d9ec5){_0x337a2d['count']=_0x4d9ec5;if(_0x1703fa[_0x5790('0x42')]['includeAll']){_0x3a1e73['include']=[{'model':db[_0x5790('0x71')],'as':'Contact','required':![]},{'model':db[_0x5790('0x72')],'as':_0x5790('0x73'),'attributes':[_0x5790('0x38'),_0x5790('0x74'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x5790('0x75'),'attributes':['id','name',_0x5790('0x76')],'where':_0x1703fa[_0x5790('0x42')][_0x5790('0x77')]?{'id':_0x1703fa[_0x5790('0x42')][_0x5790('0x77')]}:undefined,'required':_0x1703fa['query'][_0x5790('0x77')]?!![]:![]}];}return db[_0x5790('0x6e')][_0x5790('0x65')](_0x3a1e73);})[_0x5790('0x1d')](function(_0x2a1202){_0x337a2d[_0x5790('0x51')]=_0x2a1202;return _0x337a2d;});}})[_0x5790('0x1d')](respondWithFilteredResult(_0x30d82b,_0x3a1e73))[_0x5790('0x27')](handleError(_0x30d82b,null));};exports['addApplications']=function(_0x559861,_0x1bac2d){var _0xd915a3=_0x559861[_0x5790('0x53')]['id'];var _0x3f77fd=_0x559861[_0x5790('0x58')];var _0x4b144f=0xc8;var _0x385870=null;return db[_0x5790('0x78')]['transaction']({'isolationLevel':db[_0x5790('0x78')][_0x5790('0x79')][_0x5790('0x7a')]['READ_COMMITTED']},function(_0x4915a1){return db['FaxAccount'][_0x5790('0x63')]({'where':{'id':_0xd915a3},'transaction':_0x4915a1})[_0x5790('0x1d')](function(_0x5e13d9){if(_0x5e13d9){return db[_0x5790('0x7b')][_0x5790('0x34')]({'where':{'FaxAccountId':_0xd915a3},'transaction':_0x4915a1})[_0x5790('0x1d')](function(){var _0x30cfc0=_[_0x5790('0x3b')](_0x3f77fd,function(_0x155438){_0x155438[_0x5790('0x64')]=_0xd915a3;return _0x155438;});return db[_0x5790('0x7b')][_0x5790('0x7c')](_0x30cfc0,{'transaction':_0x4915a1});});}else{_0x4b144f=0x194;_0x385870=[];}});})[_0x5790('0x1d')](function(){if(_0x4b144f!==0x194){return db[_0x5790('0x7b')][_0x5790('0x7d')]({'where':{'FaxAccountId':_0xd915a3},'order':'priority'})[_0x5790('0x1d')](function(_0xee5cab){_0x385870=_0xee5cab;});}})[_0x5790('0x27')](function(_0x37b0a1){_0x4b144f=0x1f4;logger[_0x5790('0x22')](_0x37b0a1['stack']);if(_0x37b0a1['name']){delete _0x37b0a1['name'];}_0x385870=_0x37b0a1;})[_0x5790('0x7e')](function(){if(_0x385870===null){_0x1bac2d[_0x5790('0x28')](_0x4b144f);}else{if(_0x4b144f===0x1f4){_0x1bac2d[_0x5790('0x29')](_0x4b144f)[_0x5790('0x39')](_0x385870);}else{_0x1bac2d[_0x5790('0x29')](_0x4b144f)[_0x5790('0x2a')](_0x385870);}}});};exports[_0x5790('0x7f')]=function(_0x4d9e44,_0x1c5ff7,_0x2bd672){var _0x57ff3b={};var _0x2d0a62={};var _0x29e160;var _0x1ece34;return db['FaxAccount']['findOne']({'where':{'id':_0x4d9e44[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x1c5ff7,null))['then'](function(_0x1276ac){if(_0x1276ac){_0x29e160=_0x1276ac;_0x2d0a62[_0x5790('0x41')]=_[_0x5790('0x54')](db[_0x5790('0x7b')][_0x5790('0x3d')]);_0x2d0a62[_0x5790('0x42')]=_[_0x5790('0x54')](_0x4d9e44['query']);_0x2d0a62[_0x5790('0x43')]=_['intersection'](_0x2d0a62[_0x5790('0x41')],_0x2d0a62['query']);_0x57ff3b[_0x5790('0x45')]=_['intersection'](_0x2d0a62['model'],qs[_0x5790('0x46')](_0x4d9e44[_0x5790('0x42')][_0x5790('0x46')]));_0x57ff3b[_0x5790('0x45')]=_0x57ff3b[_0x5790('0x45')][_0x5790('0x47')]?_0x57ff3b['attributes']:_0x2d0a62[_0x5790('0x41')];_0x57ff3b[_0x5790('0x49')]=qs[_0x5790('0x4a')](_0x4d9e44[_0x5790('0x42')]['sort']);_0x57ff3b[_0x5790('0x4b')]=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x4d9e44['query'],_0x2d0a62[_0x5790('0x43')]));if(_0x4d9e44[_0x5790('0x42')][_0x5790('0x4d')]){_0x57ff3b[_0x5790('0x4b')]=_[_0x5790('0x4e')](_0x57ff3b[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x57ff3b[_0x5790('0x45')],function(_0x559d64){var _0x408c3a={};_0x408c3a[_0x559d64]={'$like':'%'+_0x4d9e44['query'][_0x5790('0x4d')]+'%'};return _0x408c3a;})});}_0x57ff3b=_['merge']({},_0x57ff3b,_0x4d9e44[_0x5790('0x4f')]);return _0x29e160[_0x5790('0x7f')](_0x57ff3b);}})[_0x5790('0x1d')](function(_0x1738f8){if(_0x1738f8){_0x1ece34=_0x1738f8[_0x5790('0x47')];if(!_0x4d9e44['query'][_0x5790('0x6b')](_0x5790('0x48'))){_0x57ff3b['limit']=qs['limit'](_0x4d9e44[_0x5790('0x42')]['limit']);_0x57ff3b[_0x5790('0x2b')]=qs[_0x5790('0x2b')](_0x4d9e44[_0x5790('0x42')][_0x5790('0x2b')]);}return _0x29e160[_0x5790('0x7f')](_0x57ff3b);}})[_0x5790('0x1d')](function(_0x3cbb27){if(_0x3cbb27){return _0x3cbb27?{'count':_0x1ece34,'rows':_0x3cbb27}:null;}})['then'](respondWithResult(_0x1c5ff7,null))['catch'](handleError(_0x1c5ff7,null));};function Extension(_0x38fb04,_0x2ce1fc,_0x2f88c4,_0x31b958){this['context']=_0x5790('0x80');this[_0x5790('0x81')]=_0x38fb04['localstationid'];this[_0x5790('0x82')]=_0x31b958;this[_0x5790('0x3f')]='system';this[_0x5790('0x83')]=_0x5790('0x84');this[_0x5790('0x64')]=_0x38fb04['id'];this[_0x5790('0x85')]=_0x2ce1fc;this['appdata']=_0x2f88c4;}function createExtensionsReciveFax(_0x45f00b){var _0x4cc98c=0x1;var _0x49730f=[];_0x49730f[_0x5790('0x86')](new Extension(_0x45f00b,_0x4cc98c,'',_0x5790('0x87')));_0x4cc98c+=0x1;_0x49730f[_0x5790('0x86')](new Extension(_0x45f00b,_0x4cc98c,_0x5790('0x88'),_0x5790('0x89')));_0x4cc98c+=0x1;for(var _0x19b5be in _0x45f00b){if(_0x45f00b['hasOwnProperty'](_0x19b5be)&&(_0x19b5be===_0x5790('0x8a')||_0x19b5be===_0x5790('0x8b')||_0x19b5be==='gateway'||_0x19b5be==='faxdetect'||_0x19b5be==='headerinfo'||_0x19b5be===_0x5790('0x8c')||_0x19b5be==='minrate'||_0x19b5be===_0x5790('0x8d')||_0x19b5be===_0x5790('0x8e'))){_0x49730f[_0x5790('0x86')](new Extension(_0x45f00b,_0x4cc98c,_0x5790('0x8f')+_0x19b5be+')='+_0x45f00b[_0x19b5be],_0x5790('0x89')));_0x4cc98c+=0x1;}}_0x49730f[_0x5790('0x86')](new Extension(_0x45f00b,_0x4cc98c,'6',_0x5790('0x90')));_0x4cc98c+=0x1;_0x49730f[_0x5790('0x86')](new Extension(_0x45f00b,_0x4cc98c,_0x5790('0x91'),_0x5790('0x92')));_0x4cc98c=0x0;return _0x49730f;}exports[_0x5790('0x93')]=function(_0x30cdf3,_0x1891e5,_0x5c9c55){var _0x26fe82;return db[_0x5790('0x78')][_0x5790('0x94')](function(_0x2fa618){return db[_0x5790('0x3c')][_0x5790('0x57')](_0x30cdf3['body'],{'transaction':_0x2fa618})[_0x5790('0x1d')](function(_0x4761a8){_0x26fe82=_0x4761a8[_0x5790('0x5a')]({'plain':!![]});return db[_0x5790('0x95')][_0x5790('0x7c')](createExtensionsReciveFax(_0x26fe82),{'transaction':_0x2fa618});});})['then'](function(){return _0x26fe82;})[_0x5790('0x1d')](respondWithResult(_0x1891e5,null))['catch'](handleError(_0x1891e5,null));};exports[_0x5790('0x96')]=function(_0x552cc5,_0x567bf3,_0x222e3e){var _0x9d03b;return db[_0x5790('0x78')]['transaction'](function(_0x91ee9){return db[_0x5790('0x3c')]['update'](_0x552cc5['body'],{'where':{'id':_0x552cc5['body']['id']},'transaction':_0x91ee9})[_0x5790('0x1d')](function(_0x123411){return db[_0x5790('0x95')][_0x5790('0x34')]({'where':{'FaxAccountId':_0x552cc5[_0x5790('0x58')]['id']},'transaction':_0x91ee9})[_0x5790('0x1d')](function(_0xee5590){return db['VoiceExtension'][_0x5790('0x7c')](createExtensionsReciveFax(_['omit'](_0x552cc5[_0x5790('0x58')],['tech',_0x5790('0x40'),'createdAt','updatedAt','TrunkId',_0x5790('0x97')])),{'transaction':_0x91ee9});});});})[_0x5790('0x1d')](function(){return db[_0x5790('0x3c')][_0x5790('0x98')](_0x552cc5['body']['id']);})[_0x5790('0x1d')](respondWithResult(_0x567bf3,null))[_0x5790('0x27')](handleError(_0x567bf3,null));};exports['getMessages']=function(_0x5d14a0,_0x330716,_0x1dc019){var _0x471b1f={'raw':!![],'where':{}};var _0x15996c={};var _0x4de426={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5790('0x63')]({'where':{'id':_0x5d14a0[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x330716,null))[_0x5790('0x1d')](function(_0x13f8c2){if(_0x13f8c2){_0x15996c['model']=_[_0x5790('0x54')](db['FaxMessage']['rawAttributes']);_0x15996c[_0x5790('0x42')]=_[_0x5790('0x54')](_0x5d14a0[_0x5790('0x42')]);_0x15996c[_0x5790('0x43')]=_[_0x5790('0x44')](_0x15996c['model'],_0x15996c[_0x5790('0x42')]);_0x471b1f[_0x5790('0x45')]=_[_0x5790('0x44')](_0x15996c['model'],qs[_0x5790('0x46')](_0x5d14a0[_0x5790('0x42')][_0x5790('0x46')]));_0x471b1f[_0x5790('0x45')]=_0x471b1f[_0x5790('0x45')][_0x5790('0x47')]?_0x471b1f[_0x5790('0x45')]:_0x15996c[_0x5790('0x41')];if(!_0x5d14a0['query'][_0x5790('0x6b')](_0x5790('0x48'))){_0x471b1f[_0x5790('0x2d')]=qs[_0x5790('0x2d')](_0x5d14a0[_0x5790('0x42')][_0x5790('0x2d')]);_0x471b1f[_0x5790('0x2b')]=qs[_0x5790('0x2b')](_0x5d14a0[_0x5790('0x42')]['offset']);}_0x471b1f['order']=qs[_0x5790('0x4a')](_0x5d14a0[_0x5790('0x42')]['sort']);_0x471b1f[_0x5790('0x4b')]=qs['filters'](_[_0x5790('0x4c')](_0x5d14a0['query'],_0x15996c[_0x5790('0x43')]));_0x471b1f['where'][_0x5790('0x64')]=_0x13f8c2['id'];if(_0x5d14a0[_0x5790('0x42')]['filter']){_0x471b1f[_0x5790('0x4b')]=_['merge'](_0x471b1f[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x471b1f['attributes'],function(_0x76883f){var _0x43ec51={};_0x43ec51[_0x76883f]={'$like':'%'+_0x5d14a0[_0x5790('0x42')][_0x5790('0x4d')]+'%'};return _0x43ec51;})});}if(_0x5d14a0[_0x5790('0x42')][_0x5790('0x99')]){var _0x5ac50f=_0x5d14a0[_0x5790('0x42')]['$gte'][_0x5790('0x9a')](',');var _0x3d618f={};_0x3d618f[_0x5ac50f[0x0]]={'$gte':moment(_0x5ac50f[0x1])[_0x5790('0x9b')](_0x5790('0x9c'))};_0x471b1f['where']=_[_0x5790('0x4e')](_0x471b1f['where'],_0x3d618f);}_0x471b1f=_['merge']({},_0x471b1f,_0x5d14a0[_0x5790('0x4f')]);return db[_0x5790('0x9d')]['count']({'where':_0x471b1f[_0x5790('0x4b')]})[_0x5790('0x1d')](function(_0x2b36b2){_0x4de426[_0x5790('0x2e')]=_0x2b36b2;if(_0x5d14a0[_0x5790('0x42')][_0x5790('0x55')]){_0x471b1f['include']=[{'all':!![]}];}return db[_0x5790('0x9d')][_0x5790('0x65')](_0x471b1f);})[_0x5790('0x1d')](function(_0x16e926){_0x4de426['rows']=_0x16e926;return _0x4de426;});}})['then'](respondWithFilteredResult(_0x330716,_0x471b1f))['catch'](handleError(_0x330716,null));};exports[_0x5790('0x39')]=function(_0x46cf55,_0x1a96dd,_0xf087f0){var _0x405005,_0x16e660={},_0x1b09ff;if(_0x46cf55[_0x5790('0x58')]['to']){_0x1b09ff=_0x46cf55[_0x5790('0x58')]['to'][0x0];}return db[_0x5790('0x3c')][_0x5790('0x56')]({'where':{'id':_0x46cf55['params']['id']},'include':[{'model':db[_0x5790('0x9e')],'as':_0x5790('0x9f'),'include':[{'model':db[_0x5790('0x71')],'as':_0x5790('0xa0'),'where':{'fax':_0x1b09ff},'limit':0x1,'order':[[_0x5790('0xa1'),_0x5790('0xa2')]]}]}]})[_0x5790('0x1d')](handleEntityNotFound(_0x1a96dd,null))[_0x5790('0x1d')](function(_0x559ccb){_0x405005=_0x559ccb;if(_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')]&&_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][_0x5790('0x47')]){for(var _0x4b7c14=0x0;_0x4b7c14<_0x46cf55[_0x5790('0x58')]['attachments'][_0x5790('0x47')];_0x4b7c14+=0x1){_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][_0x4b7c14]={'filename':_0x46cf55[_0x5790('0x58')]['attachments'][_0x4b7c14]['name'],'id':_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][_0x4b7c14]['id'],'path':path[_0x5790('0xa4')](config['root'],_0x5790('0xa5'),_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][_0x4b7c14][_0x5790('0xa6')])};}}return respondWithRpcPromise(_0x5790('0xa7'),_0x5790('0xa7'),{'FaxAccountId':_['isNil'](_0x46cf55[_0x5790('0x53')]['id'])?undefined:_0x46cf55[_0x5790('0x53')]['id'],'path':_[_0x5790('0xa8')](_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0][_0x5790('0x6')])?undefined:_0x46cf55[_0x5790('0x58')]['attachments'][0x0][_0x5790('0x6')],'fax':_['isNil'](_0x46cf55[_0x5790('0x58')]['to'][0x0])?undefined:_0x46cf55[_0x5790('0x58')]['to'][0x0]},client9002);})[_0x5790('0x1d')](function(){if(_0x405005){if(_[_0x5790('0xa8')](_0x46cf55[_0x5790('0x58')]['from'])){_0x46cf55['body']['from']=util['format'](_0x5790('0xa9'),_0x405005[_0x5790('0x38')],_0x405005['fax']);}if(_0x405005[_0x5790('0x9f')]){if(_0x405005[_0x5790('0x9f')]['Contacts'][_0x5790('0x47')]){return _0x405005['List'][_0x5790('0xa0')][0x0];}else{return db[_0x5790('0x71')][_0x5790('0x57')](_[_0x5790('0x14')](_0x46cf55[_0x5790('0x58')],{'firstName':_0x46cf55['body']['to'][0x0],'phone':_0x46cf55[_0x5790('0x58')]['to'][0x0],'fax':_0x46cf55[_0x5790('0x58')]['to'][0x0],'ListId':_0x405005[_0x5790('0x97')]}));}}else{throw new Error(_0x5790('0xaa'));}}else{throw new Error(_0x5790('0xab'));}})[_0x5790('0x1d')](function(_0x2c1506){if(_0x2c1506){return db['FaxInteraction'][_0x5790('0x56')]({'where':{'ContactId':_0x2c1506['id'],'closed':![],'FaxAccountId':_0x405005['id']}})['then'](function(_0x20d772){if(_0x20d772){return[_0x20d772,![]];}return db[_0x5790('0x6e')]['create']({'UserId':_0x46cf55['user']['id'],'ContactId':_0x2c1506['id'],'FaxAccountId':_0x405005['id'],'fax':_0x46cf55['body']['to'][0x0],'firstMsgDirection':_0x5790('0xac'),'Messages':[_[_0x5790('0x4e')](_0x46cf55['body'],{'read':![],'body':_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0][_0x5790('0xad')],'FaxAccountId':_0x405005['id'],'UserId':_0x46cf55['user']['id'],'ContactId':_0x2c1506['id'],'AttachmentId':_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5790('0x9d')],'as':'Messages'}]})[_0x5790('0x1d')](function(_0x3a2625){return[_0x3a2625,!![]];});});}else{throw new Error(_0x5790('0xae'));}})[_0x5790('0xaf')](function(_0x4f6dfa,_0x248f6c){if(_0x248f6c){return _0x4f6dfa;}return db[_0x5790('0x9d')][_0x5790('0x57')]({'direction':'out','read':![],'body':_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0][_0x5790('0xad')],'FaxAccountId':_0x405005['id'],'FaxInteractionId':_0x4f6dfa['id'],'UserId':_0x46cf55['user']['id'],'ContactId':_0x4f6dfa['ContactId'],'AttachmentId':_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0]['id']})[_0x5790('0x1d')](function(_0x37200c){_0x4f6dfa[_0x5790('0xb0')][_0x5790('0xb1')]=[];_0x4f6dfa[_0x5790('0xb0')][_0x5790('0xb1')][_0x5790('0x86')](_0x37200c[_0x5790('0xb0')]);return _0x4f6dfa;});})[_0x5790('0x1d')](function(_0x37f7c9){respondWithRpcPromise(_0x5790('0xb2'),_0x5790('0xb2'),{'FaxAccountId':_[_0x5790('0xa8')](_0x46cf55[_0x5790('0x53')]['id'])?undefined:_0x46cf55['params']['id'],'path':_[_0x5790('0xa8')](_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0]['path'])?undefined:_0x46cf55[_0x5790('0x58')][_0x5790('0xa3')][0x0][_0x5790('0x6')],'fax':_[_0x5790('0xa8')](_0x46cf55['body']['to'][0x0])?undefined:_0x46cf55[_0x5790('0x58')]['to'][0x0],'AttachmentId':_0x46cf55['body']['attachments'][0x0]['id']},client9002)[_0x5790('0x1d')](function(_0x14d02a){logger[_0x5790('0x1e')]('SendFaxRpc,\x20%s',_0x14d02a);})[_0x5790('0x27')](function(_0x38dc95){logger[_0x5790('0x1e')](_0x5790('0xb3'),_0x38dc95);});return _0x37f7c9;})[_0x5790('0x1d')](respondWithResult(_0x1a96dd,null))[_0x5790('0x27')](handleError(_0x1a96dd,null));};exports[_0x5790('0xb4')]=function(_0x5e18bc,_0x2c9eeb,_0x5d1a45){return db['FaxAccount']['find']({'where':{'id':_0x5e18bc[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x2c9eeb,null))[_0x5790('0x1d')](function(_0x492e42){if(_0x492e42){return _0x492e42[_0x5790('0xb4')](_0x5e18bc[_0x5790('0x58')][_0x5790('0x67')],_[_0x5790('0x6f')](_0x5e18bc[_0x5790('0x58')],[_0x5790('0x67'),'id'])||{})[_0x5790('0xaf')](function(_0x1278d3){for(var _0xfb1b2a=0x0;_0xfb1b2a<_0x5e18bc['body']['ids'][_0x5790('0x47')];_0xfb1b2a+=0x1){socket[_0x5790('0xb5')]('userFaxAccount:save',{'UserId':Number(_0x5e18bc[_0x5790('0x58')][_0x5790('0x67')][_0xfb1b2a]),'FaxAccountId':Number(_0x5e18bc[_0x5790('0x53')]['id'])});}return _0x1278d3;});}})[_0x5790('0x1d')](respondWithResult(_0x2c9eeb,null))['catch'](handleError(_0x2c9eeb,null));};exports[_0x5790('0xb6')]=function(_0x5481f5,_0x54c125,_0x449628){return db['FaxAccount'][_0x5790('0x56')]({'where':{'id':_0x5481f5[_0x5790('0x53')]['id']}})[_0x5790('0x1d')](handleEntityNotFound(_0x54c125,null))[_0x5790('0x1d')](function(_0x4318dc){if(_0x4318dc){return _0x4318dc[_0x5790('0xb6')](_0x5481f5['query'][_0x5790('0x67')])['then'](function(){if(_[_0x5790('0xb7')](_0x5481f5['query'][_0x5790('0x67')])){for(var _0x43a148=0x0;_0x43a148<_0x5481f5[_0x5790('0x42')][_0x5790('0x67')][_0x5790('0x47')];_0x43a148+=0x1){socket['emit'](_0x5790('0xb8'),{'UserId':Number(_0x5481f5[_0x5790('0x42')][_0x5790('0x67')][_0x43a148]),'FaxAccountId':Number(_0x5481f5[_0x5790('0x53')]['id'])});}}else{socket[_0x5790('0xb5')](_0x5790('0xb8'),{'UserId':Number(_0x5481f5[_0x5790('0x42')]['ids']),'FaxAccountId':Number(_0x5481f5[_0x5790('0x53')]['id'])});}});}})[_0x5790('0x1d')](respondWithStatusCode(_0x54c125,null))['catch'](handleError(_0x54c125,null));};exports['getAgents']=function(_0x52692c,_0x2d88c4,_0x2f572d){var _0x41c13f={};var _0x587f17={};var _0x41b756;var _0xaf750;return db[_0x5790('0x3c')][_0x5790('0x63')]({'where':{'id':_0x52692c['params']['id']}})['then'](handleEntityNotFound(_0x2d88c4,null))['then'](function(_0x1f062c){if(_0x1f062c){_0x41b756=_0x1f062c;_0x587f17[_0x5790('0x41')]=_[_0x5790('0x54')](db['User']['rawAttributes']);_0x587f17[_0x5790('0x42')]=_['keys'](_0x52692c[_0x5790('0x42')]);_0x587f17['filters']=_[_0x5790('0x44')](_0x587f17['model'],_0x587f17[_0x5790('0x42')]);_0x41c13f[_0x5790('0x45')]=_[_0x5790('0x44')](_0x587f17[_0x5790('0x41')],qs[_0x5790('0x46')](_0x52692c[_0x5790('0x42')][_0x5790('0x46')]));_0x41c13f[_0x5790('0x45')]=_0x41c13f[_0x5790('0x45')][_0x5790('0x47')]?_0x41c13f[_0x5790('0x45')]:_0x587f17[_0x5790('0x41')];_0x41c13f['order']=qs[_0x5790('0x4a')](_0x52692c[_0x5790('0x42')][_0x5790('0x4a')]);_0x41c13f[_0x5790('0x4b')]=qs[_0x5790('0x43')](_[_0x5790('0x4c')](_0x52692c[_0x5790('0x42')],_0x587f17[_0x5790('0x43')]));if(_0x52692c[_0x5790('0x42')][_0x5790('0x4d')]){_0x41c13f['where']=_[_0x5790('0x4e')](_0x41c13f[_0x5790('0x4b')],{'$or':_[_0x5790('0x3b')](_0x41c13f[_0x5790('0x45')],function(_0x7f43dd){var _0x225bc1={};_0x225bc1[_0x7f43dd]={'$like':'%'+_0x52692c[_0x5790('0x42')][_0x5790('0x4d')]+'%'};return _0x225bc1;})});}_0x41c13f=_['merge']({},_0x41c13f,_0x52692c[_0x5790('0x4f')]);return _0x41b756[_0x5790('0xb9')](_0x41c13f);}})[_0x5790('0x1d')](function(_0x4150eb){if(_0x4150eb){_0xaf750=_0x4150eb['length'];if(!_0x52692c[_0x5790('0x42')][_0x5790('0x6b')](_0x5790('0x48'))){_0x41c13f['limit']=qs['limit'](_0x52692c[_0x5790('0x42')][_0x5790('0x2d')]);_0x41c13f['offset']=qs[_0x5790('0x2b')](_0x52692c[_0x5790('0x42')][_0x5790('0x2b')]);}return _0x41b756[_0x5790('0xb9')](_0x41c13f);}})['then'](function(_0x14b120){if(_0x14b120){return _0x14b120?{'count':_0xaf750,'rows':_0x14b120}:null;}})['then'](respondWithResult(_0x2d88c4,null))[_0x5790('0x27')](handleError(_0x2d88c4,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 7f9fe14..65cd9c2 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 _0x4b0f=['exports','../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x469ed3,_0x3c1e7b){_0x469ed3=_0x469ed3-0x0;var _0x11dff4=_0x4b0f[_0x469ed3];return _0x11dff4;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xf4b0('0x0'))['db'][_0xf4b0('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf4b0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf4b0('0x3'),'afterDestroy':_0xf4b0('0x4')};function emitEvent(_0x141c87){return function(_0x28be5f,_0x2a08dc,_0x354cb3){FaxAccountEvents[_0xf4b0('0x5')](_0x141c87+':'+_0x28be5f['id'],_0x28be5f);FaxAccountEvents[_0xf4b0('0x5')](_0x141c87,_0x28be5f);_0x354cb3(null);};}for(var e in events){if(events[_0xf4b0('0x6')](e)){var event=events[e];FaxAccount[_0xf4b0('0x7')](e,emitEvent(event));}}module[_0xf4b0('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0xee42=['exports','../../mysqldb','save','emit','hook'];(function(_0xeb8297,_0x14bf39){var _0x2de179=function(_0x1a5d09){while(--_0x1a5d09){_0xeb8297['push'](_0xeb8297['shift']());}};_0x2de179(++_0x14bf39);}(_0xee42,0xe2));var _0x2ee4=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xee42[_0x243b2f];return _0xcb3c2d;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x2ee4('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ee4('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1bffae){return function(_0x5d7b57,_0x572054,_0x326245){FaxAccountEvents[_0x2ee4('0x2')](_0x1bffae+':'+_0x5d7b57['id'],_0x5d7b57);FaxAccountEvents[_0x2ee4('0x2')](_0x1bffae,_0x5d7b57);_0x326245(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x2ee4('0x3')](e,emitEvent(event));}}module[_0x2ee4('0x4')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 0e7e6fd..fd540f7 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 _0xe896=['api','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','FaxAccount','lodash','util','../../config/logger'];(function(_0x1b2b20,_0x394a3b){var _0x1eeb31=function(_0x205146){while(--_0x205146){_0x1b2b20['push'](_0x1b2b20['shift']());}};_0x1eeb31(++_0x394a3b);}(_0xe896,0x76));var _0x6e89=function(_0x4c2ca2,_0x26f7c7){_0x4c2ca2=_0x4c2ca2-0x0;var _0x4e8cda=_0xe896[_0x4c2ca2];return _0x4e8cda;};'use strict';var _=require(_0x6e89('0x0'));var util=require(_0x6e89('0x1'));var logger=require(_0x6e89('0x2'))(_0x6e89('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6e89('0x4'));var fs=require('fs');var path=require(_0x6e89('0x5'));var rimraf=require(_0x6e89('0x6'));var config=require(_0x6e89('0x7'));var attributes=require(_0x6e89('0x8'));module[_0x6e89('0x9')]=function(_0x3f55a7,_0x106c33){return _0x3f55a7['define'](_0x6e89('0xa'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc8a=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x1aa2c4,_0x1e0c02){var _0x212787=function(_0x5545a8){while(--_0x5545a8){_0x1aa2c4['push'](_0x1aa2c4['shift']());}};_0x212787(++_0x1e0c02);}(_0xbc8a,0x1c1));var _0xabc8=function(_0x5f0b3f,_0xe874c4){_0x5f0b3f=_0x5f0b3f-0x0;var _0x176bd0=_0xbc8a[_0x5f0b3f];return _0x176bd0;};'use strict';var _=require(_0xabc8('0x0'));var util=require(_0xabc8('0x1'));var logger=require(_0xabc8('0x2'))(_0xabc8('0x3'));var moment=require(_0xabc8('0x4'));var BPromise=require(_0xabc8('0x5'));var rp=require(_0xabc8('0x6'));var fs=require('fs');var path=require(_0xabc8('0x7'));var rimraf=require(_0xabc8('0x8'));var config=require('../../config/environment');var attributes=require(_0xabc8('0x9'));module[_0xabc8('0xa')]=function(_0x323bee,_0x3101a9){return _0x323bee[_0xabc8('0xb')](_0xabc8('0xc'),attributes,{'tableName':_0xabc8('0xd'),'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 a6955eb..cc866db 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 _0x6a7a=['socket.io-emitter','./faxAccount.socket','register','request','then','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','model','info','stringify','NotifyFaxAccount','fax','CmContact','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','Contacts','DESC','FaxApplication','List','get','account','applications','list','orderBy','priority','asc','Applications','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','queueId','FaxQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x6a7a,0x170));var _0xa6a7=function(_0x48a275,_0x55e22b){_0x48a275=_0x48a275-0x0;var _0x100469=_0x6a7a[_0x48a275];return _0x100469;};'use strict';var _=require(_0xa6a7('0x0'));var util=require(_0xa6a7('0x1'));var moment=require(_0xa6a7('0x2'));var BPromise=require(_0xa6a7('0x3'));var rs=require(_0xa6a7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa6a7('0x5'))(_0xa6a7('0x6'));var config=require(_0xa6a7('0x7'));var jayson=require(_0xa6a7('0x8'));var client=jayson['client'][_0xa6a7('0x9')]({'port':0x232c});config[_0xa6a7('0xa')]=_[_0xa6a7('0xb')](config[_0xa6a7('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa6a7('0xc'))(new Redis(config[_0xa6a7('0xa')]));require(_0xa6a7('0xd'))[_0xa6a7('0xe')](socket);function respondWithRpcPromise(_0x2324b6,_0x4589bb,_0x48c9bc){return new BPromise(function(_0x82169f,_0x5d13e4){return client[_0xa6a7('0xf')](_0x2324b6,_0x48c9bc)[_0xa6a7('0x10')](function(_0x146f30){logger['info']('FaxAccount,\x20%s,\x20%s',_0x4589bb,'request\x20sent');logger[_0xa6a7('0x11')](_0xa6a7('0x12'),_0x4589bb,_0xa6a7('0x13'),JSON['stringify'](_0x146f30));if(_0x146f30[_0xa6a7('0x14')]){if(_0x146f30[_0xa6a7('0x14')][_0xa6a7('0x15')]===0x1f4){logger['error'](_0xa6a7('0x16'),_0x4589bb,_0x146f30[_0xa6a7('0x14')][_0xa6a7('0x17')]);return _0x5d13e4(_0x146f30[_0xa6a7('0x14')]['message']);}logger[_0xa6a7('0x14')](_0xa6a7('0x16'),_0x4589bb,_0x146f30[_0xa6a7('0x14')][_0xa6a7('0x17')]);return _0x82169f(_0x146f30[_0xa6a7('0x14')][_0xa6a7('0x17')]);}else{logger['info'](_0xa6a7('0x16'),_0x4589bb,_0xa6a7('0x13'));_0x82169f(_0x146f30[_0xa6a7('0x18')][_0xa6a7('0x17')]);}})[_0xa6a7('0x19')](function(_0x173c0c){logger['error']('FaxAccount,\x20%s,\x20%s',_0x4589bb,_0x173c0c);_0x5d13e4(_0x173c0c);});});}exports[_0xa6a7('0x1a')]=function(_0x267996){var _0x4d7a74=this;return new Promise(function(_0x222eb4,_0x58b032){return db[_0xa6a7('0x1b')]['findAll']({'raw':_0x267996[_0xa6a7('0x1c')]?_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x1d')]===undefined?!![]:![]:!![],'where':_0x267996['options']?_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x1e')]||null:null,'attributes':_0x267996[_0xa6a7('0x1c')]?_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x1f')]||null:null,'limit':_0x267996[_0xa6a7('0x1c')]?_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x20')]||null:null,'include':_0x267996[_0xa6a7('0x1c')]?_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x21')]?_['map'](_0x267996[_0xa6a7('0x1c')][_0xa6a7('0x21')],function(_0x2495c6){return{'model':db[_0x2495c6['model']],'as':_0x2495c6['as'],'attributes':_0x2495c6['attributes'],'include':_0x2495c6[_0xa6a7('0x21')]?_['map'](_0x2495c6[_0xa6a7('0x21')],function(_0x12a265){return{'model':db[_0x12a265[_0xa6a7('0x22')]],'as':_0x12a265['as'],'attributes':_0x12a265[_0xa6a7('0x1f')],'include':_0x12a265[_0xa6a7('0x21')]?_['map'](_0x12a265[_0xa6a7('0x21')],function(_0x55664d){return{'model':db[_0x55664d['model']],'as':_0x55664d['as'],'attributes':_0x55664d[_0xa6a7('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa6a7('0x10')](function(_0x1fdb51){logger[_0xa6a7('0x23')]('GetFaxAccount',_0x267996);logger[_0xa6a7('0x11')](_0xa6a7('0x1a'),_0x267996,JSON[_0xa6a7('0x24')](_0x1fdb51));_0x222eb4(_0x1fdb51);})[_0xa6a7('0x19')](function(_0x33095c){logger[_0xa6a7('0x14')](_0xa6a7('0x1a'),_0x33095c[_0xa6a7('0x17')],_0x267996);_0x58b032(_0x4d7a74[_0xa6a7('0x14')](0x1f4,_0x33095c[_0xa6a7('0x17')]));});});};exports[_0xa6a7('0x25')]=function(_0x6e933f,_0x2a3523,_0x29e21a){var _0x2bc5c0=this;return new Promise(function(_0x36cc7b,_0x475d97){var _0xae4589={'body':_0x6e933f['body'],'channel':_0xa6a7('0x26')};var _0x16ec75=[];var _0x2c473f=[];var _0x344f83={};return db[_0xa6a7('0x27')]['describe']()['then'](function(_0x346cc2){if(!_0x346cc2){throw new db['Sequelize']['ValidationError'](_0xa6a7('0x28'));}_0x16ec75=_[_0xa6a7('0x29')](_[_0xa6a7('0x2a')](_0x346cc2),[_0xa6a7('0x2b'),'updatedAt']);_0x2c473f=_[_0xa6a7('0x29')](_[_0xa6a7('0x2a')](_0x346cc2),[_0xa6a7('0x2b'),_0xa6a7('0x2c'),_0xa6a7('0x2d'),_0xa6a7('0x2e')]);if(_0x6e933f[_0xa6a7('0x2f')]['id']){delete _0x6e933f[_0xa6a7('0x2f')]['id'];}if(_[_0xa6a7('0x30')](_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x31')])){throw new db[(_0xa6a7('0x32'))][(_0xa6a7('0x33'))](_0xa6a7('0x34'));}if(_[_0xa6a7('0x30')](_0x6e933f['body'][_0xa6a7('0x2f')])||_0x6e933f['body'][_0xa6a7('0x2f')]===''){throw new db[(_0xa6a7('0x32'))][(_0xa6a7('0x33'))](_0xa6a7('0x35'));}if(_[_0xa6a7('0x30')](_0x6e933f['body']['mapKey'])){throw new db['Sequelize'][(_0xa6a7('0x33'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2c473f);}if(!_[_0xa6a7('0x36')](_0x2c473f,_0x6e933f['body'][_0xa6a7('0x37')])){throw new db['Sequelize'][(_0xa6a7('0x33'))](_0xa6a7('0x38')+_0x2c473f);}_0x344f83[_0x6e933f['body'][_0xa6a7('0x37')]]=_0x6e933f[_0xa6a7('0x2f')]['from'];})[_0xa6a7('0x10')](function(){return db[_0xa6a7('0x1b')][_0xa6a7('0x39')]({'where':{'id':_0x6e933f['account']['id']},'include':[{'model':db[_0xa6a7('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa6a7('0x3b'),'where':_0x344f83,'limit':0x1,'order':[[_0xa6a7('0x2c'),_0xa6a7('0x3c')]]}]},{'model':db[_0xa6a7('0x3d')],'as':'Applications'}]});})[_0xa6a7('0x10')](function(_0x2bd5ca){if(_0x2bd5ca&&_0x2bd5ca[_0xa6a7('0x3e')]){var _0x3d9bd7=_0x2bd5ca[_0xa6a7('0x3f')]({'plain':!![]});_0xae4589[_0xa6a7('0x40')]=_0x3d9bd7;_0xae4589[_0xa6a7('0x41')]=_0x3d9bd7['Applications'];_0xae4589[_0xa6a7('0x42')]=_0x3d9bd7[_0xa6a7('0x3e')];_0xae4589['applications']=_[_0xa6a7('0x43')](_0xae4589[_0xa6a7('0x41')],[_0xa6a7('0x44')],[_0xa6a7('0x45')]);if(_0xae4589[_0xa6a7('0x40')][_0xa6a7('0x46')]){delete _0xae4589[_0xa6a7('0x40')][_0xa6a7('0x46')];}if(_0xae4589[_0xa6a7('0x40')][_0xa6a7('0x3e')]&&_0xae4589[_0xa6a7('0x40')][_0xa6a7('0x3e')][_0xa6a7('0x3b')][_0xa6a7('0x47')]){return _0xae4589[_0xa6a7('0x40')]['List'][_0xa6a7('0x3b')][0x0];}var _0x3adbc7=_[_0xa6a7('0xb')](_0x6e933f[_0xa6a7('0x2f')],{'firstName':_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x31')],'ListId':_0x3d9bd7[_0xa6a7('0x2e')]});_0x3adbc7[_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x37')]]=_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x31')];return db[_0xa6a7('0x27')][_0xa6a7('0x48')](_0x3adbc7,{'fields':_0x16ec75,'raw':!![]});}})[_0xa6a7('0x10')](function(_0x174e37){_0xae4589[_0xa6a7('0x49')]=_0x174e37;if(_0x174e37){var _0x359ca9={'ContactId':_0x174e37['id'],'FaxAccountId':_0x6e933f['account']['id'],'fax':_0x174e37[_0xa6a7('0x26')]};return db[_0xa6a7('0x4a')][_0xa6a7('0x39')]({'where':{'ContactId':_0x174e37['id'],'closed':![],'FaxAccountId':_0x6e933f[_0xa6a7('0x40')]['id']}})['then'](function(_0x18089b){if(_0x18089b){return[_0x18089b,![]];}return db[_0xa6a7('0x4a')][_0xa6a7('0x48')](_0x359ca9)[_0xa6a7('0x10')](function(_0x307a7f){return[_0x307a7f,!![]];});});}else{throw new Error(_0xa6a7('0x4b'));}})['spread'](function(_0x170fff,_0x4a15eb){var _0x59d113=_0x170fff[_0xa6a7('0x3f')]({'plain':!![]});if(_0x4a15eb){if(_0xae4589[_0xa6a7('0x40')][_0xa6a7('0x4c')]){_0xae4589[_0xa6a7('0x41')][_0xa6a7('0x4d')]({'id':0x0,'priority':_0xae4589[_0xa6a7('0x41')]['length']+0x1,'app':_0xa6a7('0x4e'),'appdata':_0xa6a7('0x4f'),'interval':_0xa6a7('0x50')});}_0x59d113['created']=!![];}else{_0x59d113[_0xa6a7('0x51')]=![];}_0xae4589[_0xa6a7('0x52')]=_0x59d113;return db['FaxMessage'][_0xa6a7('0x48')]({'body':_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x2f')],'FaxAccountId':_0x6e933f[_0xa6a7('0x40')]['id'],'FaxInteractionId':_0x170fff['id'],'direction':'in','ContactId':_0x170fff[_0xa6a7('0x53')],'AttachmentId':_0x6e933f[_0xa6a7('0x2f')][_0xa6a7('0x54')]});})[_0xa6a7('0x10')](function(_0x52ede1){_0xae4589[_0xa6a7('0x17')]=_0x52ede1;if(!_0xae4589[_0xa6a7('0x52')][_0xa6a7('0x55')])return;return db[_0xa6a7('0x56')][_0xa6a7('0x39')]({'attributes':['id','name'],'where':{'id':_0xae4589[_0xa6a7('0x52')][_0xa6a7('0x55')]}});})['then'](function(_0x5e107a){if(_0x5e107a){_0xae4589[_0xa6a7('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5e107a[_0xa6a7('0x57')]+','+(_0xae4589['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0xae4589['interaction'][_0xa6a7('0x58')])return;return db[_0xa6a7('0x59')][_0xa6a7('0x39')]({'attributes':['id',_0xa6a7('0x57')],'where':{'id':_0xae4589[_0xa6a7('0x52')]['queueId']}});})[_0xa6a7('0x10')](function(_0x959c53){if(_0x959c53){_0xae4589[_0xa6a7('0x41')][_0xa6a7('0x5a')]({'id':0x0,'priority':0x1,'app':_0xa6a7('0x5b'),'appdata':_0x959c53[_0xa6a7('0x57')]+','+(_0xae4589[_0xa6a7('0x40')][_0xa6a7('0x5c')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa6a7('0x5d'),_0xa6a7('0x5e'),_0xae4589);})[_0xa6a7('0x10')](function(_0x1d1a87){_0x36cc7b(_0x1d1a87);})[_0xa6a7('0x19')](function(_0x118589){_0x475d97(_0x2bc5c0[_0xa6a7('0x14')](0x1f4,_0x118589[_0xa6a7('0x17')]));});});}; \ No newline at end of file +var _0x7513=['find','CmList','List','FaxApplication','Applications','get','account','applications','list','Contacts','length','create','FaxInteraction','Contact\x20not\x20found','spread','push','close','unmanaged','created','interaction','ContactId','UserId','User','name','agent','*,*,*,*','FaxQueue','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','FaxAccount,\x20%s,\x20%s','message','result','FaxAccount','findAll','options','raw','where','attributes','include','model','map','GetFaxAccount','catch','body','fax','CmContact','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'];(function(_0x1a736c,_0x3f7de6){var _0x4a6657=function(_0x4e230d){while(--_0x4e230d){_0x1a736c['push'](_0x1a736c['shift']());}};_0x4a6657(++_0x3f7de6);}(_0x7513,0x170));var _0x3751=function(_0x4a3278,_0x35ef3b){_0x4a3278=_0x4a3278-0x0;var _0x182006=_0x7513[_0x4a3278];return _0x182006;};'use strict';var _=require(_0x3751('0x0'));var util=require(_0x3751('0x1'));var moment=require(_0x3751('0x2'));var BPromise=require(_0x3751('0x3'));var rs=require(_0x3751('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3751('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3751('0x6'));var config=require(_0x3751('0x7'));var jayson=require(_0x3751('0x8'));var client=jayson[_0x3751('0x9')][_0x3751('0xa')]({'port':0x232c});config[_0x3751('0xb')]=_[_0x3751('0xc')](config[_0x3751('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3751('0xd'))(new Redis(config[_0x3751('0xb')]));require('./faxAccount.socket')[_0x3751('0xe')](socket);function respondWithRpcPromise(_0x5834cd,_0x172401,_0x123f5e){return new BPromise(function(_0xe8839d,_0x265f7a){return client[_0x3751('0xf')](_0x5834cd,_0x123f5e)[_0x3751('0x10')](function(_0x1aabca){logger[_0x3751('0x11')]('FaxAccount,\x20%s,\x20%s',_0x172401,_0x3751('0x12'));logger[_0x3751('0x13')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x172401,_0x3751('0x12'),JSON[_0x3751('0x14')](_0x1aabca));if(_0x1aabca['error']){if(_0x1aabca['error']['code']===0x1f4){logger[_0x3751('0x15')](_0x3751('0x16'),_0x172401,_0x1aabca[_0x3751('0x15')][_0x3751('0x17')]);return _0x265f7a(_0x1aabca[_0x3751('0x15')][_0x3751('0x17')]);}logger['error'](_0x3751('0x16'),_0x172401,_0x1aabca[_0x3751('0x15')][_0x3751('0x17')]);return _0xe8839d(_0x1aabca[_0x3751('0x15')][_0x3751('0x17')]);}else{logger[_0x3751('0x11')](_0x3751('0x16'),_0x172401,_0x3751('0x12'));_0xe8839d(_0x1aabca[_0x3751('0x18')][_0x3751('0x17')]);}})['catch'](function(_0x3d44b5){logger[_0x3751('0x15')]('FaxAccount,\x20%s,\x20%s',_0x172401,_0x3d44b5);_0x265f7a(_0x3d44b5);});});}exports['GetFaxAccount']=function(_0x3894a9){var _0x4b6771=this;return new Promise(function(_0x46af51,_0x340149){return db[_0x3751('0x19')][_0x3751('0x1a')]({'raw':_0x3894a9[_0x3751('0x1b')]?_0x3894a9[_0x3751('0x1b')][_0x3751('0x1c')]===undefined?!![]:![]:!![],'where':_0x3894a9[_0x3751('0x1b')]?_0x3894a9[_0x3751('0x1b')][_0x3751('0x1d')]||null:null,'attributes':_0x3894a9['options']?_0x3894a9['options'][_0x3751('0x1e')]||null:null,'limit':_0x3894a9[_0x3751('0x1b')]?_0x3894a9[_0x3751('0x1b')]['limit']||null:null,'include':_0x3894a9[_0x3751('0x1b')]?_0x3894a9[_0x3751('0x1b')][_0x3751('0x1f')]?_['map'](_0x3894a9[_0x3751('0x1b')][_0x3751('0x1f')],function(_0x4c8bd1){return{'model':db[_0x4c8bd1[_0x3751('0x20')]],'as':_0x4c8bd1['as'],'attributes':_0x4c8bd1[_0x3751('0x1e')],'include':_0x4c8bd1[_0x3751('0x1f')]?_[_0x3751('0x21')](_0x4c8bd1[_0x3751('0x1f')],function(_0x37194b){return{'model':db[_0x37194b[_0x3751('0x20')]],'as':_0x37194b['as'],'attributes':_0x37194b[_0x3751('0x1e')],'include':_0x37194b[_0x3751('0x1f')]?_[_0x3751('0x21')](_0x37194b[_0x3751('0x1f')],function(_0xec3bf0){return{'model':db[_0xec3bf0[_0x3751('0x20')]],'as':_0xec3bf0['as'],'attributes':_0xec3bf0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10d406){logger['info'](_0x3751('0x22'),_0x3894a9);logger[_0x3751('0x13')](_0x3751('0x22'),_0x3894a9,JSON[_0x3751('0x14')](_0x10d406));_0x46af51(_0x10d406);})[_0x3751('0x23')](function(_0x4db2cc){logger[_0x3751('0x15')](_0x3751('0x22'),_0x4db2cc[_0x3751('0x17')],_0x3894a9);_0x340149(_0x4b6771['error'](0x1f4,_0x4db2cc[_0x3751('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x1661d3,_0x261d11,_0x436cb0){var _0x1ff491=this;return new Promise(function(_0x3f05a3,_0x4db8f7){var _0x342bae={'body':_0x1661d3[_0x3751('0x24')],'channel':_0x3751('0x25')};var _0x23b0de=[];var _0x24dc94=[];var _0x3ad447={};return db[_0x3751('0x26')]['describe']()['then'](function(_0x5df7b8){if(!_0x5df7b8){throw new db[(_0x3751('0x27'))]['ValidationError'](_0x3751('0x28'));}_0x23b0de=_[_0x3751('0x29')](_[_0x3751('0x2a')](_0x5df7b8),[_0x3751('0x2b'),_0x3751('0x2c')]);_0x24dc94=_[_0x3751('0x29')](_[_0x3751('0x2a')](_0x5df7b8),[_0x3751('0x2b'),_0x3751('0x2c'),'CompanyId',_0x3751('0x2d')]);if(_0x1661d3[_0x3751('0x24')]['id']){delete _0x1661d3[_0x3751('0x24')]['id'];}if(_['isNil'](_0x1661d3[_0x3751('0x24')][_0x3751('0x2e')])){throw new db[(_0x3751('0x27'))][(_0x3751('0x2f'))](_0x3751('0x30'));}if(_['isNil'](_0x1661d3[_0x3751('0x24')][_0x3751('0x24')])||_0x1661d3[_0x3751('0x24')][_0x3751('0x24')]===''){throw new db[(_0x3751('0x27'))][(_0x3751('0x2f'))](_0x3751('0x31'));}if(_['isNil'](_0x1661d3[_0x3751('0x24')][_0x3751('0x32')])){throw new db[(_0x3751('0x27'))][(_0x3751('0x2f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x24dc94);}if(!_['includes'](_0x24dc94,_0x1661d3['body'][_0x3751('0x32')])){throw new db[(_0x3751('0x27'))][(_0x3751('0x2f'))](_0x3751('0x33')+_0x24dc94);}_0x3ad447[_0x1661d3[_0x3751('0x24')][_0x3751('0x32')]]=_0x1661d3[_0x3751('0x24')]['from'];})[_0x3751('0x10')](function(){return db[_0x3751('0x19')][_0x3751('0x34')]({'where':{'id':_0x1661d3['account']['id']},'include':[{'model':db[_0x3751('0x35')],'as':_0x3751('0x36'),'include':[{'model':db[_0x3751('0x26')],'as':'Contacts','where':_0x3ad447,'limit':0x1,'order':[[_0x3751('0x2c'),'DESC']]}]},{'model':db[_0x3751('0x37')],'as':_0x3751('0x38')}]});})[_0x3751('0x10')](function(_0x33201b){if(_0x33201b&&_0x33201b[_0x3751('0x36')]){var _0x5817da=_0x33201b[_0x3751('0x39')]({'plain':!![]});_0x342bae[_0x3751('0x3a')]=_0x5817da;_0x342bae[_0x3751('0x3b')]=_0x5817da[_0x3751('0x38')];_0x342bae[_0x3751('0x3c')]=_0x5817da['List'];_0x342bae[_0x3751('0x3b')]=_['orderBy'](_0x342bae[_0x3751('0x3b')],['priority'],['asc']);if(_0x342bae['account'][_0x3751('0x38')]){delete _0x342bae[_0x3751('0x3a')]['Applications'];}if(_0x342bae[_0x3751('0x3a')][_0x3751('0x36')]&&_0x342bae[_0x3751('0x3a')][_0x3751('0x36')][_0x3751('0x3d')][_0x3751('0x3e')]){return _0x342bae['account']['List'][_0x3751('0x3d')][0x0];}var _0x837c4d=_[_0x3751('0xc')](_0x1661d3[_0x3751('0x24')],{'firstName':_0x1661d3[_0x3751('0x24')][_0x3751('0x2e')],'ListId':_0x5817da['ListId']});_0x837c4d[_0x1661d3[_0x3751('0x24')]['mapKey']]=_0x1661d3[_0x3751('0x24')][_0x3751('0x2e')];return db[_0x3751('0x26')][_0x3751('0x3f')](_0x837c4d,{'fields':_0x23b0de,'raw':!![]});}})[_0x3751('0x10')](function(_0x2c2d82){_0x342bae['contact']=_0x2c2d82;if(_0x2c2d82){var _0x53a7d5={'ContactId':_0x2c2d82['id'],'FaxAccountId':_0x1661d3[_0x3751('0x3a')]['id'],'fax':_0x2c2d82['fax']};return db[_0x3751('0x40')]['find']({'where':{'ContactId':_0x2c2d82['id'],'closed':![],'FaxAccountId':_0x1661d3[_0x3751('0x3a')]['id']}})[_0x3751('0x10')](function(_0x3254b2){if(_0x3254b2){return[_0x3254b2,![]];}return db['FaxInteraction'][_0x3751('0x3f')](_0x53a7d5)['then'](function(_0x56eeab){return[_0x56eeab,!![]];});});}else{throw new Error(_0x3751('0x41'));}})[_0x3751('0x42')](function(_0x1b4317,_0x1709dc){var _0x468cac=_0x1b4317[_0x3751('0x39')]({'plain':!![]});if(_0x1709dc){if(_0x342bae['account']['autoclose']){_0x342bae[_0x3751('0x3b')][_0x3751('0x43')]({'id':0x0,'priority':_0x342bae[_0x3751('0x3b')][_0x3751('0x3e')]+0x1,'app':_0x3751('0x44'),'appdata':_0x3751('0x45'),'interval':'*,*,*,*'});}_0x468cac[_0x3751('0x46')]=!![];}else{_0x468cac[_0x3751('0x46')]=![];}_0x342bae[_0x3751('0x47')]=_0x468cac;return db['FaxMessage'][_0x3751('0x3f')]({'body':_0x1661d3[_0x3751('0x24')][_0x3751('0x24')],'FaxAccountId':_0x1661d3[_0x3751('0x3a')]['id'],'FaxInteractionId':_0x1b4317['id'],'direction':'in','ContactId':_0x1b4317[_0x3751('0x48')],'AttachmentId':_0x1661d3[_0x3751('0x24')]['AttachmentId']});})[_0x3751('0x10')](function(_0x59ab2d){_0x342bae[_0x3751('0x17')]=_0x59ab2d;if(!_0x342bae[_0x3751('0x47')][_0x3751('0x49')])return;return db[_0x3751('0x4a')][_0x3751('0x34')]({'attributes':['id',_0x3751('0x4b')],'where':{'id':_0x342bae[_0x3751('0x47')][_0x3751('0x49')]}});})['then'](function(_0x2b58a5){if(_0x2b58a5){_0x342bae[_0x3751('0x3b')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3751('0x4c'),'appdata':_0x2b58a5[_0x3751('0x4b')]+','+(_0x342bae[_0x3751('0x3a')]['waitForTheAssignedAgent']||0xa),'interval':_0x3751('0x4d')});}if(!_0x342bae['interaction']['queueId'])return;return db[_0x3751('0x4e')][_0x3751('0x34')]({'attributes':['id','name'],'where':{'id':_0x342bae['interaction'][_0x3751('0x4f')]}});})[_0x3751('0x10')](function(_0x307462){if(_0x307462){_0x342bae[_0x3751('0x3b')][_0x3751('0x50')]({'id':0x0,'priority':0x1,'app':_0x3751('0x51'),'appdata':_0x307462['name']+','+(_0x342bae[_0x3751('0x3a')][_0x3751('0x52')]||0x12c),'interval':_0x3751('0x4d')});}return respondWithRpcPromise(_0x3751('0x53'),'startRouting',_0x342bae);})[_0x3751('0x10')](function(_0x4301b9){_0x3f05a3(_0x4301b9);})[_0x3751('0x23')](function(_0x4539a8){_0x4db8f7(_0x1ff491[_0x3751('0x15')](0x1f4,_0x4539a8[_0x3751('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 9fdb33a..3e0b172 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 _0x9be1=['emit','register','length','faxAccount:','./faxAccount.events','remove','update'];(function(_0x20bbbd,_0xbee7d9){var _0x3c2f4e=function(_0xf4ce8b){while(--_0xf4ce8b){_0x20bbbd['push'](_0x20bbbd['shift']());}};_0x3c2f4e(++_0xbee7d9);}(_0x9be1,0x90));var _0x19be=function(_0x103b59,_0x19eab0){_0x103b59=_0x103b59-0x0;var _0x4cca06=_0x9be1[_0x103b59];return _0x4cca06;};'use strict';var FaxAccountEvents=require(_0x19be('0x0'));var events=['save',_0x19be('0x1'),_0x19be('0x2')];function createListener(_0x292ad3,_0x2d3473){return function(_0x19d1eb){_0x2d3473[_0x19be('0x3')](_0x292ad3,_0x19d1eb);};}function removeListener(_0x41a3f6,_0x3b1ff6){return function(){FaxAccountEvents['removeListener'](_0x41a3f6,_0x3b1ff6);};}exports[_0x19be('0x4')]=function(_0x568e9a){for(var _0x3a1239=0x0,_0x2f6a8e=events[_0x19be('0x5')];_0x3a1239<_0x2f6a8e;_0x3a1239++){var _0x202b72=events[_0x3a1239];var _0x73ac5d=createListener(_0x19be('0x6')+_0x202b72,_0x568e9a);FaxAccountEvents['on'](_0x202b72,_0x73ac5d);}}; \ No newline at end of file +var _0x161f=['save','remove','update','removeListener','register','length','faxAccount:'];(function(_0x3c2277,_0x8d1b3f){var _0x3a403e=function(_0x208790){while(--_0x208790){_0x3c2277['push'](_0x3c2277['shift']());}};_0x3a403e(++_0x8d1b3f);}(_0x161f,0x165));var _0xf161=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x161f[_0x3bf83f];return _0x22c4a9;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0xf161('0x0'),_0xf161('0x1'),_0xf161('0x2')];function createListener(_0x5303bd,_0x4c240a){return function(_0x542497){_0x4c240a['emit'](_0x5303bd,_0x542497);};}function removeListener(_0x489993,_0x17b355){return function(){FaxAccountEvents[_0xf161('0x3')](_0x489993,_0x17b355);};}exports[_0xf161('0x4')]=function(_0x32bef7){for(var _0x3bb2aa=0x0,_0x55e10d=events[_0xf161('0x5')];_0x3bb2aa<_0x55e10d;_0x3bb2aa++){var _0x8c420d=events[_0x3bb2aa];var _0x19a388=createListener(_0xf161('0x6')+_0x8c420d,_0x32bef7);FaxAccountEvents['on'](_0x8c420d,_0x19a388);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d594c0d..e73f605 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 _0x51a7=['delete','destroy','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/interactions','getInteractions','getApplications','getMessages','/:id/users','getAgents','post','/:id/dispositions','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update'];(function(_0x105ef0,_0x4aa480){var _0x3132b3=function(_0x1db226){while(--_0x1db226){_0x105ef0['push'](_0x105ef0['shift']());}};_0x3132b3(++_0x4aa480);}(_0x51a7,0x19e));var _0x751a=function(_0x1f5887,_0x2fa1f1){_0x1f5887=_0x1f5887-0x0;var _0x21774b=_0x51a7[_0x1f5887];return _0x21774b;};'use strict';var multer=require(_0x751a('0x0'));var util=require(_0x751a('0x1'));var path=require('path');var timeout=require(_0x751a('0x2'));var express=require(_0x751a('0x3'));var router=express[_0x751a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x751a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x751a('0x6'));var controller=require(_0x751a('0x7'));router[_0x751a('0x8')]('/',auth[_0x751a('0x9')](),controller[_0x751a('0xa')]);router[_0x751a('0x8')](_0x751a('0xb'),auth[_0x751a('0x9')](),controller[_0x751a('0xc')]);router[_0x751a('0x8')](_0x751a('0xd'),auth[_0x751a('0x9')](),controller[_0x751a('0xe')]);router[_0x751a('0x8')]('/:id/dispositions',auth[_0x751a('0x9')](),controller[_0x751a('0xf')]);router[_0x751a('0x8')](_0x751a('0x10'),auth[_0x751a('0x9')](),controller['getAnswers']);router[_0x751a('0x8')](_0x751a('0x11'),auth[_0x751a('0x9')](),controller[_0x751a('0x12')]);router[_0x751a('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x751a('0x13')]);router[_0x751a('0x8')]('/:id/messages',auth[_0x751a('0x9')](),controller[_0x751a('0x14')]);router[_0x751a('0x8')](_0x751a('0x15'),auth['isAuthenticated'](),controller[_0x751a('0x16')]);router[_0x751a('0x17')]('/',auth[_0x751a('0x9')](),controller['create']);router['post'](_0x751a('0x18'),auth[_0x751a('0x9')](),controller['addDisposition']);router[_0x751a('0x17')](_0x751a('0x10'),auth[_0x751a('0x9')](),controller[_0x751a('0x19')]);router['post'](_0x751a('0x11'),auth[_0x751a('0x9')](),controller[_0x751a('0x1a')]);router[_0x751a('0x17')]('/:id/applications',auth[_0x751a('0x9')](),controller[_0x751a('0x1b')]);router[_0x751a('0x17')](_0x751a('0x1c'),auth['isAuthenticated'](),controller[_0x751a('0x1d')]);router[_0x751a('0x17')](_0x751a('0x1e'),auth['isAuthenticated'](),controller[_0x751a('0x1f')]);router[_0x751a('0x17')](_0x751a('0x20'),auth[_0x751a('0x9')](),controller[_0x751a('0x21')]);router[_0x751a('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x751a('0x22')]);router[_0x751a('0x23')](_0x751a('0xd'),auth['isAuthenticated'](),controller[_0x751a('0x24')]);router[_0x751a('0x25')](_0x751a('0xd'),auth[_0x751a('0x9')](),controller[_0x751a('0x26')]);router[_0x751a('0x25')]('/:id/dispositions',auth[_0x751a('0x9')](),controller['removeDispositions']);router[_0x751a('0x25')](_0x751a('0x10'),auth[_0x751a('0x9')](),controller[_0x751a('0x27')]);router[_0x751a('0x25')]('/:id/users',auth['isAuthenticated'](),controller[_0x751a('0x28')]);module['exports']=router; \ No newline at end of file +var _0xd10b=['getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post','create','addAnswer','/:id/interactions','addApplications','/addaccountapplications','/updateaccountapplications','updateAccountApplications','/:id/send','/:id/users','addAgents','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','isAuthenticated','index','get','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x1f1f28,_0x2a62d0){var _0x51f703=function(_0x4ce838){while(--_0x4ce838){_0x1f1f28['push'](_0x1f1f28['shift']());}};_0x51f703(++_0x2a62d0);}(_0xd10b,0x178));var _0xbd10=function(_0x35b75b,_0x17d81c){_0x35b75b=_0x35b75b-0x0;var _0x9cdbab=_0xd10b[_0x35b75b];return _0x9cdbab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbd10('0x0'));var timeout=require('connect-timeout');var express=require(_0xbd10('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbd10('0x2'));var interaction=require(_0xbd10('0x3'));var config=require(_0xbd10('0x4'));var controller=require(_0xbd10('0x5'));router['get']('/',auth[_0xbd10('0x6')](),controller[_0xbd10('0x7')]);router[_0xbd10('0x8')](_0xbd10('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xbd10('0x8')]('/:id',auth[_0xbd10('0x6')](),controller[_0xbd10('0xa')]);router['get'](_0xbd10('0xb'),auth[_0xbd10('0x6')](),controller[_0xbd10('0xc')]);router[_0xbd10('0x8')](_0xbd10('0xd'),auth[_0xbd10('0x6')](),controller['getAnswers']);router[_0xbd10('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xbd10('0xe')]);router[_0xbd10('0x8')](_0xbd10('0xf'),auth[_0xbd10('0x6')](),controller[_0xbd10('0x10')]);router['get'](_0xbd10('0x11'),auth['isAuthenticated'](),controller[_0xbd10('0x12')]);router['get']('/:id/users',auth[_0xbd10('0x6')](),controller[_0xbd10('0x13')]);router[_0xbd10('0x14')]('/',auth['isAuthenticated'](),controller[_0xbd10('0x15')]);router[_0xbd10('0x14')]('/:id/dispositions',auth[_0xbd10('0x6')](),controller['addDisposition']);router[_0xbd10('0x14')]('/:id/canned_answers',auth[_0xbd10('0x6')](),controller[_0xbd10('0x16')]);router[_0xbd10('0x14')](_0xbd10('0x17'),auth[_0xbd10('0x6')](),controller['addInteraction']);router[_0xbd10('0x14')](_0xbd10('0xf'),auth[_0xbd10('0x6')](),controller[_0xbd10('0x18')]);router[_0xbd10('0x14')](_0xbd10('0x19'),auth[_0xbd10('0x6')](),controller['addAccountApplications']);router[_0xbd10('0x14')](_0xbd10('0x1a'),auth[_0xbd10('0x6')](),controller[_0xbd10('0x1b')]);router['post'](_0xbd10('0x1c'),auth[_0xbd10('0x6')](),controller['send']);router[_0xbd10('0x14')](_0xbd10('0x1d'),auth[_0xbd10('0x6')](),controller[_0xbd10('0x1e')]);router[_0xbd10('0x1f')](_0xbd10('0x20'),auth['isAuthenticated'](),controller[_0xbd10('0x21')]);router[_0xbd10('0x22')]('/:id',auth[_0xbd10('0x6')](),controller[_0xbd10('0x23')]);router['delete']('/:id/dispositions',auth[_0xbd10('0x6')](),controller['removeDispositions']);router[_0xbd10('0x22')](_0xbd10('0xd'),auth[_0xbd10('0x6')](),controller[_0xbd10('0x24')]);router[_0xbd10('0x22')](_0xbd10('0x1d'),auth['isAuthenticated'](),controller[_0xbd10('0x25')]);module[_0xbd10('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index a04526a..4565523 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 _0xed44=['noop','TEXT','STRING','exports','INTEGER'];(function(_0x56be45,_0x10cd0e){var _0x1b75d3=function(_0x314616){while(--_0x314616){_0x56be45['push'](_0x56be45['shift']());}};_0x1b75d3(++_0x10cd0e);}(_0xed44,0x1f2));var _0x4ed4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed44[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require('sequelize');module[_0x4ed4('0x0')]={'priority':{'type':Sequelize[_0x4ed4('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4ed4('0x2')},'appdata':{'type':Sequelize[_0x4ed4('0x3')]()},'description':{'type':Sequelize[_0x4ed4('0x4')]},'interval':{'type':Sequelize[_0x4ed4('0x4')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x0cd3=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x3063ac,_0x2b316f){var _0x3a3623=function(_0x539bf9){while(--_0x539bf9){_0x3063ac['push'](_0x3063ac['shift']());}};_0x3a3623(++_0x2b316f);}(_0x0cd3,0x83));var _0x30cd=function(_0x10f490,_0x5e5d2d){_0x10f490=_0x10f490-0x0;var _0x2a1e4c=_0x0cd3[_0x10f490];return _0x2a1e4c;};'use strict';var Sequelize=require(_0x30cd('0x0'));module['exports']={'priority':{'type':Sequelize[_0x30cd('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x30cd('0x2')],'allowNull':![],'defaultValue':_0x30cd('0x3')},'appdata':{'type':Sequelize[_0x30cd('0x4')]()},'description':{'type':Sequelize[_0x30cd('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x30cd('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9ccbb26..3932e29 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 _0x7278=['util','path','to-csv','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','error','stack','send','map','FaxApplication','rawAttributes','fieldName','type','key','name','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','merge','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x2a6b2f,_0x2d59b9){var _0x58aba5=function(_0x120d35){while(--_0x120d35){_0x2a6b2f['push'](_0x2a6b2f['shift']());}};_0x58aba5(++_0x2d59b9);}(_0x7278,0xcd));var _0x8727=function(_0x53349d,_0x20a3ec){_0x53349d=_0x53349d-0x0;var _0x5e37b2=_0x7278[_0x53349d];return _0x5e37b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8727('0x0'));var zipdir=require(_0x8727('0x1'));var jsonpatch=require(_0x8727('0x2'));var rp=require('request-promise');var moment=require(_0x8727('0x3'));var BPromise=require(_0x8727('0x4'));var Mustache=require('mustache');var util=require(_0x8727('0x5'));var path=require(_0x8727('0x6'));var sox=require('sox');var csv=require(_0x8727('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8727('0x8'));var crypto=require('crypto');var jsforce=require(_0x8727('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x8727('0x7'));var querystring=require(_0x8727('0xa'));var Papa=require(_0x8727('0xb'));var Redis=require('ioredis');var authService=require(_0x8727('0xc'));var qs=require(_0x8727('0xd'));var as=require(_0x8727('0xe'));var hardwareService=require(_0x8727('0xf'));var logger=require(_0x8727('0x10'))(_0x8727('0x11'));var utils=require(_0x8727('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8727('0x13'));var db=require(_0x8727('0x14'))['db'];function respondWithStatusCode(_0x336a4b,_0x56b6e8){_0x56b6e8=_0x56b6e8||0xcc;return function(_0xeb7c89){if(_0xeb7c89){return _0x336a4b['sendStatus'](_0x56b6e8);}return _0x336a4b[_0x8727('0x15')](_0x56b6e8)[_0x8727('0x16')]();};}function respondWithResult(_0x2713ab,_0x41283f){_0x41283f=_0x41283f||0xc8;return function(_0x3db82a){if(_0x3db82a){return _0x2713ab['status'](_0x41283f)['json'](_0x3db82a);}};}function respondWithFilteredResult(_0xbffba5,_0x2f8768){return function(_0x4e580d){if(_0x4e580d){var _0x1ff202=typeof _0x2f8768[_0x8727('0x17')]===_0x8727('0x18')&&typeof _0x2f8768[_0x8727('0x19')]===_0x8727('0x18');var _0x3bc40d=_0x4e580d[_0x8727('0x1a')];var _0x393bb9=_0x1ff202?0x0:_0x2f8768['offset'];var _0x3be7df=_0x1ff202?_0x4e580d[_0x8727('0x1a')]:_0x2f8768['offset']+_0x2f8768[_0x8727('0x19')];var _0x386b6a;if(_0x3be7df>=_0x3bc40d){_0x3be7df=_0x3bc40d;_0x386b6a=0xc8;}else{_0x386b6a=0xce;}_0xbffba5[_0x8727('0x15')](_0x386b6a);return _0xbffba5[_0x8727('0x1b')](_0x8727('0x1c'),_0x393bb9+'-'+_0x3be7df+'/'+_0x3bc40d)[_0x8727('0x1d')](_0x4e580d);}return null;};}function patchUpdates(_0x392e73){return function(_0x44d51c){try{jsonpatch['apply'](_0x44d51c,_0x392e73,!![]);}catch(_0x1b1a2b){return BPromise['reject'](_0x1b1a2b);}return _0x44d51c[_0x8727('0x1e')]();};}function saveUpdates(_0x2356e1,_0x4f484b){return function(_0x59edc8){if(_0x59edc8){return _0x59edc8['update'](_0x2356e1)[_0x8727('0x1f')](function(_0x1892cd){return _0x1892cd;});}return null;};}function removeEntity(_0x1b5405,_0x310175){return function(_0x3a678e){if(_0x3a678e){return _0x3a678e[_0x8727('0x20')]()[_0x8727('0x1f')](function(){_0x1b5405['status'](0xcc)[_0x8727('0x16')]();});}};}function handleEntityNotFound(_0x55cd46,_0x2f4a09){return function(_0x3be071){if(!_0x3be071){_0x55cd46['sendStatus'](0x194);}return _0x3be071;};}function handleError(_0x2a364b,_0x3322ee){_0x3322ee=_0x3322ee||0x1f4;return function(_0x5b63b5){logger[_0x8727('0x21')](_0x5b63b5[_0x8727('0x22')]);if(_0x5b63b5['name']){delete _0x5b63b5['name'];}_0x2a364b[_0x8727('0x15')](_0x3322ee)[_0x8727('0x23')](_0x5b63b5);};}exports['index']=function(_0x11024f,_0x91aea5){var _0x3455a4={},_0x243a18={},_0x23033a={'count':0x0,'rows':[]};var _0x4446cb=_[_0x8727('0x24')](db[_0x8727('0x25')][_0x8727('0x26')],function(_0x48bb00){return{'name':_0x48bb00[_0x8727('0x27')],'type':_0x48bb00[_0x8727('0x28')][_0x8727('0x29')]};});_0x243a18['model']=_['map'](_0x4446cb,_0x8727('0x2a'));_0x243a18[_0x8727('0x2b')]=_['keys'](_0x11024f[_0x8727('0x2b')]);_0x243a18[_0x8727('0x2c')]=_['intersection'](_0x243a18[_0x8727('0x2d')],_0x243a18[_0x8727('0x2b')]);_0x3455a4['attributes']=_[_0x8727('0x2e')](_0x243a18[_0x8727('0x2d')],qs[_0x8727('0x2f')](_0x11024f[_0x8727('0x2b')][_0x8727('0x2f')]));_0x3455a4['attributes']=_0x3455a4[_0x8727('0x30')][_0x8727('0x31')]?_0x3455a4['attributes']:_0x243a18[_0x8727('0x2d')];if(!_0x11024f[_0x8727('0x2b')][_0x8727('0x32')](_0x8727('0x33'))){_0x3455a4[_0x8727('0x19')]=qs[_0x8727('0x19')](_0x11024f[_0x8727('0x2b')][_0x8727('0x19')]);_0x3455a4[_0x8727('0x17')]=qs[_0x8727('0x17')](_0x11024f[_0x8727('0x2b')][_0x8727('0x17')]);}_0x3455a4[_0x8727('0x34')]=qs[_0x8727('0x35')](_0x11024f[_0x8727('0x2b')][_0x8727('0x35')]);_0x3455a4[_0x8727('0x36')]=qs[_0x8727('0x2c')](_[_0x8727('0x37')](_0x11024f[_0x8727('0x2b')],_0x243a18[_0x8727('0x2c')]),_0x4446cb);if(_0x11024f['query']['filter']){_0x3455a4[_0x8727('0x36')]=_['merge'](_0x3455a4[_0x8727('0x36')],{'$or':_[_0x8727('0x24')](_0x4446cb,function(_0x31a874){if(_0x31a874[_0x8727('0x28')]!==_0x8727('0x38')){var _0xe52be0={};_0xe52be0[_0x31a874[_0x8727('0x2a')]]={'$like':'%'+_0x11024f[_0x8727('0x2b')]['filter']+'%'};return _0xe52be0;}})});}_0x3455a4=_['merge']({},_0x3455a4,_0x11024f[_0x8727('0x39')]);var _0x53792b={'where':_0x3455a4[_0x8727('0x36')]};return db[_0x8727('0x25')][_0x8727('0x1a')](_0x53792b)[_0x8727('0x1f')](function(_0x4c4543){_0x23033a[_0x8727('0x1a')]=_0x4c4543;if(_0x11024f[_0x8727('0x2b')][_0x8727('0x3a')]){_0x3455a4[_0x8727('0x3b')]=[{'all':!![]}];}return db[_0x8727('0x25')][_0x8727('0x3c')](_0x3455a4);})[_0x8727('0x1f')](function(_0x43b227){_0x23033a[_0x8727('0x3d')]=_0x43b227;return _0x23033a;})['then'](respondWithFilteredResult(_0x91aea5,_0x3455a4))['catch'](handleError(_0x91aea5,null));};exports['show']=function(_0x20c954,_0x4f6243){var _0x184152={'raw':!![],'where':{'id':_0x20c954[_0x8727('0x3e')]['id']}},_0x3ab79a={};_0x3ab79a['model']=_[_0x8727('0x3f')](db['FaxApplication'][_0x8727('0x26')]);_0x3ab79a['query']=_['keys'](_0x20c954[_0x8727('0x2b')]);_0x3ab79a[_0x8727('0x2c')]=_[_0x8727('0x2e')](_0x3ab79a[_0x8727('0x2d')],_0x3ab79a[_0x8727('0x2b')]);_0x184152[_0x8727('0x30')]=_[_0x8727('0x2e')](_0x3ab79a['model'],qs[_0x8727('0x2f')](_0x20c954[_0x8727('0x2b')][_0x8727('0x2f')]));_0x184152[_0x8727('0x30')]=_0x184152[_0x8727('0x30')][_0x8727('0x31')]?_0x184152[_0x8727('0x30')]:_0x3ab79a[_0x8727('0x2d')];if(_0x20c954['query'][_0x8727('0x3a')]){_0x184152[_0x8727('0x3b')]=[{'all':!![]}];}_0x184152=_[_0x8727('0x40')]({},_0x184152,_0x20c954[_0x8727('0x39')]);return db[_0x8727('0x25')][_0x8727('0x41')](_0x184152)[_0x8727('0x1f')](handleEntityNotFound(_0x4f6243,null))[_0x8727('0x1f')](respondWithResult(_0x4f6243,null))[_0x8727('0x42')](handleError(_0x4f6243,null));};exports[_0x8727('0x43')]=function(_0x5a0677,_0x7937){return db['FaxApplication'][_0x8727('0x43')](_0x5a0677[_0x8727('0x44')],{})['then'](respondWithResult(_0x7937,0xc9))[_0x8727('0x42')](handleError(_0x7937,null));};exports[_0x8727('0x45')]=function(_0x232d05,_0x31d865){if(_0x232d05[_0x8727('0x44')]['id']){delete _0x232d05[_0x8727('0x44')]['id'];}return db[_0x8727('0x25')][_0x8727('0x41')]({'where':{'id':_0x232d05[_0x8727('0x3e')]['id']}})[_0x8727('0x1f')](handleEntityNotFound(_0x31d865,null))[_0x8727('0x1f')](saveUpdates(_0x232d05['body'],null))[_0x8727('0x1f')](respondWithResult(_0x31d865,null))[_0x8727('0x42')](handleError(_0x31d865,null));};exports['destroy']=function(_0x3390a9,_0x517421){return db['FaxApplication'][_0x8727('0x41')]({'where':{'id':_0x3390a9[_0x8727('0x3e')]['id']}})[_0x8727('0x1f')](handleEntityNotFound(_0x517421,null))[_0x8727('0x1f')](removeEntity(_0x517421,null))['catch'](handleError(_0x517421,null));}; \ No newline at end of file +var _0xf8df=['key','model','map','query','filters','intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','fields','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','name','FaxApplication','rawAttributes','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf8df,0xad));var _0xff8d=function(_0x4dccbd,_0x5be2cf){_0x4dccbd=_0x4dccbd-0x0;var _0x265038=_0xf8df[_0x4dccbd];return _0x265038;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff8d('0x0'));var zipdir=require(_0xff8d('0x1'));var jsonpatch=require(_0xff8d('0x2'));var rp=require(_0xff8d('0x3'));var moment=require(_0xff8d('0x4'));var BPromise=require(_0xff8d('0x5'));var Mustache=require(_0xff8d('0x6'));var util=require(_0xff8d('0x7'));var path=require(_0xff8d('0x8'));var sox=require(_0xff8d('0x9'));var csv=require(_0xff8d('0xa'));var ejs=require(_0xff8d('0xb'));var fs=require('fs');var fs_extra=require(_0xff8d('0xc'));var _=require(_0xff8d('0xd'));var squel=require(_0xff8d('0xe'));var crypto=require('crypto');var jsforce=require(_0xff8d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xff8d('0xa'));var querystring=require(_0xff8d('0x10'));var Papa=require(_0xff8d('0x11'));var Redis=require(_0xff8d('0x12'));var authService=require(_0xff8d('0x13'));var qs=require(_0xff8d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff8d('0x15'));var logger=require(_0xff8d('0x16'))(_0xff8d('0x17'));var utils=require(_0xff8d('0x18'));var config=require(_0xff8d('0x19'));var licenseUtil=require(_0xff8d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d96e,_0x4542a5){_0x4542a5=_0x4542a5||0xcc;return function(_0x19206b){if(_0x19206b){return _0x55d96e[_0xff8d('0x1b')](_0x4542a5);}return _0x55d96e[_0xff8d('0x1c')](_0x4542a5)[_0xff8d('0x1d')]();};}function respondWithResult(_0x127fb4,_0x13018a){_0x13018a=_0x13018a||0xc8;return function(_0x1f4467){if(_0x1f4467){return _0x127fb4[_0xff8d('0x1c')](_0x13018a)[_0xff8d('0x1e')](_0x1f4467);}};}function respondWithFilteredResult(_0x264d8d,_0x161945){return function(_0x31dc15){if(_0x31dc15){var _0x48f0ed=typeof _0x161945['offset']===_0xff8d('0x1f')&&typeof _0x161945['limit']===_0xff8d('0x1f');var _0x3d3fdb=_0x31dc15[_0xff8d('0x20')];var _0x4068ac=_0x48f0ed?0x0:_0x161945[_0xff8d('0x21')];var _0x736b45=_0x48f0ed?_0x31dc15[_0xff8d('0x20')]:_0x161945[_0xff8d('0x21')]+_0x161945[_0xff8d('0x22')];var _0xb0dfd0;if(_0x736b45>=_0x3d3fdb){_0x736b45=_0x3d3fdb;_0xb0dfd0=0xc8;}else{_0xb0dfd0=0xce;}_0x264d8d[_0xff8d('0x1c')](_0xb0dfd0);return _0x264d8d[_0xff8d('0x23')](_0xff8d('0x24'),_0x4068ac+'-'+_0x736b45+'/'+_0x3d3fdb)[_0xff8d('0x1e')](_0x31dc15);}return null;};}function patchUpdates(_0x55f6da){return function(_0x51926a){try{jsonpatch[_0xff8d('0x25')](_0x51926a,_0x55f6da,!![]);}catch(_0x1955da){return BPromise[_0xff8d('0x26')](_0x1955da);}return _0x51926a[_0xff8d('0x27')]();};}function saveUpdates(_0x5afd66,_0x441572){return function(_0x3ca98a){if(_0x3ca98a){return _0x3ca98a['update'](_0x5afd66)[_0xff8d('0x28')](function(_0xc6503d){return _0xc6503d;});}return null;};}function removeEntity(_0x334212,_0x55e24e){return function(_0x14f27e){if(_0x14f27e){return _0x14f27e['destroy']()[_0xff8d('0x28')](function(){_0x334212[_0xff8d('0x1c')](0xcc)[_0xff8d('0x1d')]();});}};}function handleEntityNotFound(_0x28ea9c,_0x5e77be){return function(_0x17add9){if(!_0x17add9){_0x28ea9c[_0xff8d('0x1b')](0x194);}return _0x17add9;};}function handleError(_0x2ccaf1,_0x1233f3){_0x1233f3=_0x1233f3||0x1f4;return function(_0x2366e2){logger['error'](_0x2366e2[_0xff8d('0x29')]);if(_0x2366e2[_0xff8d('0x2a')]){delete _0x2366e2[_0xff8d('0x2a')];}_0x2ccaf1[_0xff8d('0x1c')](_0x1233f3)['send'](_0x2366e2);};}exports['index']=function(_0x3ed010,_0x4753f8){var _0x5758d7={},_0x439af6={},_0x19a210={'count':0x0,'rows':[]};var _0x46ffde=_['map'](db[_0xff8d('0x2b')][_0xff8d('0x2c')],function(_0x4b257b){return{'name':_0x4b257b['fieldName'],'type':_0x4b257b[_0xff8d('0x2d')][_0xff8d('0x2e')]};});_0x439af6[_0xff8d('0x2f')]=_[_0xff8d('0x30')](_0x46ffde,_0xff8d('0x2a'));_0x439af6['query']=_['keys'](_0x3ed010[_0xff8d('0x31')]);_0x439af6[_0xff8d('0x32')]=_[_0xff8d('0x33')](_0x439af6[_0xff8d('0x2f')],_0x439af6[_0xff8d('0x31')]);_0x5758d7['attributes']=_['intersection'](_0x439af6['model'],qs['fields'](_0x3ed010[_0xff8d('0x31')]['fields']));_0x5758d7[_0xff8d('0x34')]=_0x5758d7[_0xff8d('0x34')]['length']?_0x5758d7[_0xff8d('0x34')]:_0x439af6['model'];if(!_0x3ed010[_0xff8d('0x31')][_0xff8d('0x35')]('nolimit')){_0x5758d7[_0xff8d('0x22')]=qs[_0xff8d('0x22')](_0x3ed010[_0xff8d('0x31')]['limit']);_0x5758d7[_0xff8d('0x21')]=qs[_0xff8d('0x21')](_0x3ed010['query']['offset']);}_0x5758d7[_0xff8d('0x36')]=qs[_0xff8d('0x37')](_0x3ed010[_0xff8d('0x31')][_0xff8d('0x37')]);_0x5758d7[_0xff8d('0x38')]=qs['filters'](_[_0xff8d('0x39')](_0x3ed010[_0xff8d('0x31')],_0x439af6[_0xff8d('0x32')]),_0x46ffde);if(_0x3ed010[_0xff8d('0x31')][_0xff8d('0x3a')]){_0x5758d7['where']=_['merge'](_0x5758d7[_0xff8d('0x38')],{'$or':_[_0xff8d('0x30')](_0x46ffde,function(_0x347d9e){if(_0x347d9e['type']!=='VIRTUAL'){var _0x135181={};_0x135181[_0x347d9e[_0xff8d('0x2a')]]={'$like':'%'+_0x3ed010['query']['filter']+'%'};return _0x135181;}})});}_0x5758d7=_[_0xff8d('0x3b')]({},_0x5758d7,_0x3ed010[_0xff8d('0x3c')]);var _0x1235fb={'where':_0x5758d7['where']};return db[_0xff8d('0x2b')][_0xff8d('0x20')](_0x1235fb)[_0xff8d('0x28')](function(_0x2aad85){_0x19a210['count']=_0x2aad85;if(_0x3ed010[_0xff8d('0x31')][_0xff8d('0x3d')]){_0x5758d7[_0xff8d('0x3e')]=[{'all':!![]}];}return db['FaxApplication'][_0xff8d('0x3f')](_0x5758d7);})[_0xff8d('0x28')](function(_0x25f898){_0x19a210[_0xff8d('0x40')]=_0x25f898;return _0x19a210;})['then'](respondWithFilteredResult(_0x4753f8,_0x5758d7))[_0xff8d('0x41')](handleError(_0x4753f8,null));};exports[_0xff8d('0x42')]=function(_0x416d95,_0x4b280a){var _0xa6669e={'raw':!![],'where':{'id':_0x416d95['params']['id']}},_0x33ec13={};_0x33ec13[_0xff8d('0x2f')]=_[_0xff8d('0x43')](db[_0xff8d('0x2b')][_0xff8d('0x2c')]);_0x33ec13['query']=_[_0xff8d('0x43')](_0x416d95['query']);_0x33ec13[_0xff8d('0x32')]=_[_0xff8d('0x33')](_0x33ec13['model'],_0x33ec13[_0xff8d('0x31')]);_0xa6669e[_0xff8d('0x34')]=_[_0xff8d('0x33')](_0x33ec13[_0xff8d('0x2f')],qs[_0xff8d('0x44')](_0x416d95[_0xff8d('0x31')][_0xff8d('0x44')]));_0xa6669e['attributes']=_0xa6669e[_0xff8d('0x34')]['length']?_0xa6669e[_0xff8d('0x34')]:_0x33ec13[_0xff8d('0x2f')];if(_0x416d95['query'][_0xff8d('0x3d')]){_0xa6669e['include']=[{'all':!![]}];}_0xa6669e=_[_0xff8d('0x3b')]({},_0xa6669e,_0x416d95[_0xff8d('0x3c')]);return db[_0xff8d('0x2b')]['find'](_0xa6669e)[_0xff8d('0x28')](handleEntityNotFound(_0x4b280a,null))[_0xff8d('0x28')](respondWithResult(_0x4b280a,null))[_0xff8d('0x41')](handleError(_0x4b280a,null));};exports['create']=function(_0x4e7435,_0x12d892){return db[_0xff8d('0x2b')][_0xff8d('0x45')](_0x4e7435[_0xff8d('0x46')],{})[_0xff8d('0x28')](respondWithResult(_0x12d892,0xc9))[_0xff8d('0x41')](handleError(_0x12d892,null));};exports['update']=function(_0x1fe803,_0x34b1ec){if(_0x1fe803['body']['id']){delete _0x1fe803[_0xff8d('0x46')]['id'];}return db['FaxApplication'][_0xff8d('0x47')]({'where':{'id':_0x1fe803[_0xff8d('0x48')]['id']}})['then'](handleEntityNotFound(_0x34b1ec,null))[_0xff8d('0x28')](saveUpdates(_0x1fe803[_0xff8d('0x46')],null))[_0xff8d('0x28')](respondWithResult(_0x34b1ec,null))[_0xff8d('0x41')](handleError(_0x34b1ec,null));};exports['destroy']=function(_0x946959,_0x100302){return db[_0xff8d('0x2b')][_0xff8d('0x47')]({'where':{'id':_0x946959[_0xff8d('0x48')]['id']}})[_0xff8d('0x28')](handleEntityNotFound(_0x100302,null))[_0xff8d('0x28')](removeEntity(_0x100302,null))[_0xff8d('0x41')](handleError(_0x100302,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 4de780f..142d220 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 _0xbb9b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','fax_applications','utf8mb4','util','../../config/logger','api'];(function(_0x45f1f5,_0x3824ab){var _0x45060b=function(_0x337ab9){while(--_0x337ab9){_0x45f1f5['push'](_0x45f1f5['shift']());}};_0x45060b(++_0x3824ab);}(_0xbb9b,0x11d));var _0xbbb9=function(_0x421c50,_0x2eea2b){_0x421c50=_0x421c50-0x0;var _0x43b3f0=_0xbb9b[_0x421c50];return _0x43b3f0;};'use strict';var _=require('lodash');var util=require(_0xbbb9('0x0'));var logger=require(_0xbbb9('0x1'))(_0xbbb9('0x2'));var moment=require(_0xbbb9('0x3'));var BPromise=require(_0xbbb9('0x4'));var rp=require(_0xbbb9('0x5'));var fs=require('fs');var path=require(_0xbbb9('0x6'));var rimraf=require(_0xbbb9('0x7'));var config=require(_0xbbb9('0x8'));var attributes=require(_0xbbb9('0x9'));module['exports']=function(_0xba8912,_0x1fe433){return _0xba8912['define']('FaxApplication',attributes,{'tableName':_0xbbb9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbbb9('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2f50=['../../config/logger','api','moment','bluebird','rimraf','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','lodash','util'];(function(_0x497ae6,_0x5d9017){var _0x43dc34=function(_0x3eb9ad){while(--_0x3eb9ad){_0x497ae6['push'](_0x497ae6['shift']());}};_0x43dc34(++_0x5d9017);}(_0x2f50,0x1d2));var _0x02f5=function(_0x386b5c,_0x1080e3){_0x386b5c=_0x386b5c-0x0;var _0x4c18c9=_0x2f50[_0x386b5c];return _0x4c18c9;};'use strict';var _=require(_0x02f5('0x0'));var util=require(_0x02f5('0x1'));var logger=require(_0x02f5('0x2'))(_0x02f5('0x3'));var moment=require(_0x02f5('0x4'));var BPromise=require(_0x02f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x02f5('0x6'));var config=require('../../config/environment');var attributes=require(_0x02f5('0x7'));module[_0x02f5('0x8')]=function(_0x4d6830,_0x3b2607){return _0x4d6830[_0x02f5('0x9')](_0x02f5('0xa'),attributes,{'tableName':_0x02f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x02f5('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index d130209..dce3684 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 _0x1159=['FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','info','debug','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x1159,0xf3));var _0x9115=function(_0x151b46,_0xcdd63b){_0x151b46=_0x151b46-0x0;var _0x26fc61=_0x1159[_0x151b46];return _0x26fc61;};'use strict';var _=require(_0x9115('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9115('0x1'));var rs=require(_0x9115('0x2'));var fs=require('fs');var Redis=require(_0x9115('0x3'));var db=require(_0x9115('0x4'))['db'];var utils=require(_0x9115('0x5'));var logger=require(_0x9115('0x6'))(_0x9115('0x7'));var config=require(_0x9115('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9115('0x9')][_0x9115('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22bf7f,_0x55e62e,_0x27b1ca){return new BPromise(function(_0x1f69c2,_0x42c577){return client['request'](_0x22bf7f,_0x27b1ca)[_0x9115('0xb')](function(_0x121723){logger['info']('FaxApplication,\x20%s,\x20%s',_0x55e62e,_0x9115('0xc'));logger['debug'](_0x9115('0xd'),_0x55e62e,_0x9115('0xc'),JSON[_0x9115('0xe')](_0x121723));if(_0x121723[_0x9115('0xf')]){if(_0x121723['error'][_0x9115('0x10')]===0x1f4){logger[_0x9115('0xf')](_0x9115('0x11'),_0x55e62e,_0x121723[_0x9115('0xf')][_0x9115('0x12')]);return _0x42c577(_0x121723[_0x9115('0xf')][_0x9115('0x12')]);}logger[_0x9115('0xf')](_0x9115('0x11'),_0x55e62e,_0x121723['error'][_0x9115('0x12')]);return _0x1f69c2(_0x121723['error'][_0x9115('0x12')]);}else{logger['info'](_0x9115('0x11'),_0x55e62e,_0x9115('0xc'));_0x1f69c2(_0x121723[_0x9115('0x13')]['message']);}})['catch'](function(_0x5c1022){logger['error'](_0x9115('0x11'),_0x55e62e,_0x5c1022);_0x42c577(_0x5c1022);});});}exports[_0x9115('0x14')]=function(_0x2ade35){var _0x157ad2=this;return new Promise(function(_0x5752a3,_0x31ebb3){return db[_0x9115('0x15')][_0x9115('0x16')](_0x2ade35[_0x9115('0x17')],{'raw':_0x2ade35[_0x9115('0x18')]?_0x2ade35[_0x9115('0x18')][_0x9115('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ade35[_0x9115('0x18')]?_0x2ade35[_0x9115('0x18')][_0x9115('0x1a')]||null:null,'attributes':_0x2ade35[_0x9115('0x18')]?_0x2ade35['options'][_0x9115('0x1b')]||null:null,'limit':_0x2ade35[_0x9115('0x18')]?_0x2ade35[_0x9115('0x18')][_0x9115('0x1c')]||null:null})[_0x9115('0xb')](function(_0xa06aa8){logger[_0x9115('0x1d')](_0x9115('0x14'),_0x2ade35);logger[_0x9115('0x1e')](_0x9115('0x14'),_0x2ade35,JSON[_0x9115('0xe')](_0xa06aa8));_0x5752a3(_0xa06aa8);})[_0x9115('0x1f')](function(_0x3c4c08){logger[_0x9115('0xf')](_0x9115('0x14'),_0x3c4c08[_0x9115('0x12')],_0x2ade35);_0x31ebb3(_0x157ad2[_0x9115('0xf')](0x1f4,_0x3c4c08[_0x9115('0x12')]));});});}; \ No newline at end of file +var _0xf7c2=['http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','FaxApplication','body','options','raw','where','attributes','limit','UpdateFaxApplication','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0xca098c,_0x286c62){var _0x20bfe8=function(_0x147153){while(--_0x147153){_0xca098c['push'](_0xca098c['shift']());}};_0x20bfe8(++_0x286c62);}(_0xf7c2,0x1c7));var _0x2f7c=function(_0x587a3f,_0x52755c){_0x587a3f=_0x587a3f-0x0;var _0x5ad0d9=_0xf7c2[_0x587a3f];return _0x5ad0d9;};'use strict';var _=require(_0x2f7c('0x0'));var util=require(_0x2f7c('0x1'));var moment=require(_0x2f7c('0x2'));var BPromise=require('bluebird');var rs=require(_0x2f7c('0x3'));var fs=require('fs');var Redis=require(_0x2f7c('0x4'));var db=require(_0x2f7c('0x5'))['db'];var utils=require(_0x2f7c('0x6'));var logger=require(_0x2f7c('0x7'))('rpc');var config=require(_0x2f7c('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2f7c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2013,_0x5a869f,_0x31aac4){return new BPromise(function(_0x4eb8d4,_0x4b657e){return client['request'](_0x5d2013,_0x31aac4)[_0x2f7c('0xa')](function(_0x2d256f){logger[_0x2f7c('0xb')](_0x2f7c('0xc'),_0x5a869f,_0x2f7c('0xd'));logger[_0x2f7c('0xe')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x5a869f,_0x2f7c('0xd'),JSON[_0x2f7c('0xf')](_0x2d256f));if(_0x2d256f[_0x2f7c('0x10')]){if(_0x2d256f['error'][_0x2f7c('0x11')]===0x1f4){logger[_0x2f7c('0x10')](_0x2f7c('0xc'),_0x5a869f,_0x2d256f[_0x2f7c('0x10')]['message']);return _0x4b657e(_0x2d256f['error'][_0x2f7c('0x12')]);}logger[_0x2f7c('0x10')]('FaxApplication,\x20%s,\x20%s',_0x5a869f,_0x2d256f['error']['message']);return _0x4eb8d4(_0x2d256f[_0x2f7c('0x10')]['message']);}else{logger[_0x2f7c('0xb')](_0x2f7c('0xc'),_0x5a869f,_0x2f7c('0xd'));_0x4eb8d4(_0x2d256f[_0x2f7c('0x13')]['message']);}})['catch'](function(_0x2dc329){logger[_0x2f7c('0x10')]('FaxApplication,\x20%s,\x20%s',_0x5a869f,_0x2dc329);_0x4b657e(_0x2dc329);});});}exports['UpdateFaxApplication']=function(_0x1d585a){var _0x8b4649=this;return new Promise(function(_0x1aa027,_0x19408a){return db[_0x2f7c('0x14')]['update'](_0x1d585a[_0x2f7c('0x15')],{'raw':_0x1d585a[_0x2f7c('0x16')]?_0x1d585a[_0x2f7c('0x16')][_0x2f7c('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d585a[_0x2f7c('0x16')]?_0x1d585a[_0x2f7c('0x16')][_0x2f7c('0x18')]||null:null,'attributes':_0x1d585a[_0x2f7c('0x16')]?_0x1d585a[_0x2f7c('0x16')][_0x2f7c('0x19')]||null:null,'limit':_0x1d585a[_0x2f7c('0x16')]?_0x1d585a[_0x2f7c('0x16')][_0x2f7c('0x1a')]||null:null})[_0x2f7c('0xa')](function(_0x13dfa3){logger[_0x2f7c('0xb')]('UpdateFaxApplication',_0x1d585a);logger[_0x2f7c('0xe')](_0x2f7c('0x1b'),_0x1d585a,JSON[_0x2f7c('0xf')](_0x13dfa3));_0x1aa027(_0x13dfa3);})[_0x2f7c('0x1c')](function(_0x583cd0){logger[_0x2f7c('0x10')](_0x2f7c('0x1b'),_0x583cd0[_0x2f7c('0x12')],_0x1d585a);_0x19408a(_0x8b4649[_0x2f7c('0x10')](0x1f4,_0x583cd0[_0x2f7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 14d9d7c..51b63f6 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 _0x1775=['../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x49dc71,_0x4a9ba3){var _0x2552d7=function(_0x25683){while(--_0x25683){_0x49dc71['push'](_0x49dc71['shift']());}};_0x2552d7(++_0x4a9ba3);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xf')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0x11')](_0x5177('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x5177('0x12')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);module[_0x5177('0x14')]=router; \ No newline at end of file +var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','create','put','delete','destroy','exports','path','express'];(function(_0x191dff,_0xb60d16){var _0x410a43=function(_0x25ccdc){while(--_0x25ccdc){_0x191dff['push'](_0x191dff['shift']());}};_0x410a43(++_0xb60d16);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['post']('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xd')]);router[_0xe36e('0xe')]('/:id',auth[_0xe36e('0x9')](),controller['update']);router[_0xe36e('0xf')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x10')]);module[_0xe36e('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 97f0f71..da506d7 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 _0x8f4c=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x56ac0c,_0x2dbea4){var _0x425306=function(_0x18d45f){while(--_0x18d45f){_0x56ac0c['push'](_0x56ac0c['shift']());}};_0x425306(++_0x2dbea4);}(_0x8f4c,0x113));var _0xc8f4=function(_0x32ab87,_0x5803d0){_0x32ab87=_0x32ab87-0x0;var _0x5ae2b0=_0x8f4c[_0x32ab87];return _0x5ae2b0;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'closed':{'type':Sequelize[_0xc8f4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc8f4('0x3')]},'disposition':{'type':Sequelize[_0xc8f4('0x4')]},'secondDisposition':{'type':Sequelize[_0xc8f4('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc8f4('0x4')]},'read1stAt':{'type':Sequelize[_0xc8f4('0x3')]},'fax':{'type':Sequelize[_0xc8f4('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xc8f4('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xc8f4('0x6')]}}; \ No newline at end of file +var _0x781d=['INTEGER','sequelize','exports','STRING','DATE','ENUM','out'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x781d,0x14a));var _0xd781=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x781d[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd781('0x2')]},'secondDisposition':{'type':Sequelize[_0xd781('0x2')]},'thirdDisposition':{'type':Sequelize[_0xd781('0x2')]},'note':{'type':Sequelize[_0xd781('0x2')]},'read1stAt':{'type':Sequelize[_0xd781('0x3')]},'fax':{'type':Sequelize[_0xd781('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd781('0x4')]('in',_0xd781('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd781('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xd781('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xd781('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 8d3a950..fc7754e 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 _0xc2b5=['then','destroy','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','show','params','model','keys','filters','intersection','fields','attributes','include','merge','options','find','catch','create','body','describe','FaxMessage','addMessage','ids','getMessages','findOne','length','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','omit','spread','color','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','get','basename','existsSync','createReadStream','resolve','log','rimraf','zip-dir','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update'];(function(_0x434c42,_0x4f687b){var _0x272e65=function(_0x5b365c){while(--_0x5b365c){_0x434c42['push'](_0x434c42['shift']());}};_0x272e65(++_0x4f687b);}(_0xc2b5,0x11d));var _0x5c2b=function(_0x2801ba,_0x397dcb){_0x2801ba=_0x2801ba-0x0;var _0x180255=_0xc2b5[_0x2801ba];return _0x180255;};'use strict';var rimraf=require(_0x5c2b('0x0'));var zipdir=require(_0x5c2b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x5c2b('0x2'));var fs=require('fs');var _=require(_0x5c2b('0x3'));var Redis=require(_0x5c2b('0x4'));var interaction=require(_0x5c2b('0x5'));var qs=require(_0x5c2b('0x6'));var logger=require(_0x5c2b('0x7'))(_0x5c2b('0x8'));var config=require(_0x5c2b('0x9'));var db=require(_0x5c2b('0xa'))['db'];config[_0x5c2b('0xb')]=_[_0x5c2b('0xc')](config['redis'],{'host':_0x5c2b('0xd'),'port':0x18eb});var socket=require(_0x5c2b('0xe'))(new Redis(config[_0x5c2b('0xb')]));require(_0x5c2b('0xf'))[_0x5c2b('0x10')](socket);function respondWithStatusCode(_0x24ac8d,_0x17094c){_0x17094c=_0x17094c||0xcc;return function(_0x1dd225){if(_0x1dd225){return _0x24ac8d[_0x5c2b('0x11')](_0x17094c);}return _0x24ac8d[_0x5c2b('0x12')](_0x17094c)[_0x5c2b('0x13')]();};}function respondWithResult(_0x52d297,_0xa8ad9c){_0xa8ad9c=_0xa8ad9c||0xc8;return function(_0x54f36d){if(_0x54f36d){return _0x52d297[_0x5c2b('0x12')](_0xa8ad9c)[_0x5c2b('0x14')](_0x54f36d);}};}function respondWithFilteredResult(_0x3f1048,_0xfbcc9a){return function(_0x132a28){if(_0x132a28){var _0x41ed3b=typeof _0xfbcc9a['offset']===_0x5c2b('0x15')&&typeof _0xfbcc9a['limit']===_0x5c2b('0x15');var _0x3433b3=_0x132a28[_0x5c2b('0x16')];var _0x554e38=_0x41ed3b?0x0:_0xfbcc9a['offset'];var _0x1a1741=_0x41ed3b?_0x132a28[_0x5c2b('0x16')]:_0xfbcc9a[_0x5c2b('0x17')]+_0xfbcc9a[_0x5c2b('0x18')];var _0x4a9324;if(_0x1a1741>=_0x3433b3){_0x1a1741=_0x3433b3;_0x4a9324=0xc8;}else{_0x4a9324=0xce;}_0x3f1048[_0x5c2b('0x12')](_0x4a9324);return _0x3f1048['set'](_0x5c2b('0x19'),_0x554e38+'-'+_0x1a1741+'/'+_0x3433b3)['json'](_0x132a28);}return null;};}function saveUpdates(_0x3ed205){return function(_0x3443e5){if(_0x3443e5){return _0x3443e5[_0x5c2b('0x1a')](_0x3ed205)[_0x5c2b('0x1b')](function(_0x552867){return _0x552867;});}return null;};}function removeEntity(_0xdcef26){return function(_0x2df49d){if(_0x2df49d){return _0x2df49d[_0x5c2b('0x1c')]()[_0x5c2b('0x1b')](function(){_0xdcef26[_0x5c2b('0x12')](0xcc)[_0x5c2b('0x13')]();});}};}function handleEntityNotFound(_0x3f06d1){return function(_0x2095e1){if(!_0x2095e1){_0x3f06d1[_0x5c2b('0x11')](0x194);}return _0x2095e1;};}function handleError(_0x4a4ca1,_0x5ce380){_0x5ce380=_0x5ce380||0x1f4;return function(_0x4ad1c5){logger[_0x5c2b('0x1d')](_0x4ad1c5[_0x5c2b('0x1e')]);if(_0x4ad1c5[_0x5c2b('0x1f')]){delete _0x4ad1c5[_0x5c2b('0x1f')];}_0x4a4ca1[_0x5c2b('0x12')](_0x5ce380)[_0x5c2b('0x20')](_0x4ad1c5);};}exports[_0x5c2b('0x21')]=function(_0x170b50,_0x1c630e){var _0x1042c8={};var _0x11668e=_[_0x5c2b('0x22')](db[_0x5c2b('0x23')][_0x5c2b('0x24')],function(_0x1e9db4){return{'name':_0x1e9db4[_0x5c2b('0x25')],'type':_0x1e9db4[_0x5c2b('0x26')][_0x5c2b('0x27')]};});_0x1042c8=qs[_0x5c2b('0x28')](_0x11668e,_0x170b50);return interaction[_0x5c2b('0x29')]('fax',_0x170b50[_0x5c2b('0x2a')],_0x170b50[_0x5c2b('0x2b')],_0x1042c8,_0x11668e)[_0x5c2b('0x1b')](respondWithFilteredResult(_0x1c630e,_0x1042c8))['catch'](handleError(_0x1c630e,null));};exports[_0x5c2b('0x2c')]=function(_0x57631b,_0x360eb3){var _0x37b194={'raw':![],'where':{'id':_0x57631b[_0x5c2b('0x2d')]['id']}},_0x55c22b={};_0x55c22b[_0x5c2b('0x2e')]=_[_0x5c2b('0x2f')](db[_0x5c2b('0x23')][_0x5c2b('0x24')]);_0x55c22b[_0x5c2b('0x2a')]=_['keys'](_0x57631b[_0x5c2b('0x2a')]);_0x55c22b[_0x5c2b('0x30')]=_[_0x5c2b('0x31')](_0x55c22b[_0x5c2b('0x2e')],_0x55c22b[_0x5c2b('0x2a')]);_0x37b194['attributes']=_[_0x5c2b('0x31')](_0x55c22b[_0x5c2b('0x2e')],qs['fields'](_0x57631b[_0x5c2b('0x2a')][_0x5c2b('0x32')]));_0x37b194[_0x5c2b('0x33')]=_0x37b194[_0x5c2b('0x33')]['length']?_0x37b194['attributes']:_0x55c22b[_0x5c2b('0x2e')];if(_0x57631b[_0x5c2b('0x2a')]['includeAll']){_0x37b194[_0x5c2b('0x34')]=[{'all':!![]}];}_0x37b194=_[_0x5c2b('0x35')]({},_0x37b194,_0x57631b[_0x5c2b('0x36')]);return db[_0x5c2b('0x23')][_0x5c2b('0x37')](_0x37b194)[_0x5c2b('0x1b')](handleEntityNotFound(_0x360eb3,null))[_0x5c2b('0x1b')](respondWithResult(_0x360eb3,null))[_0x5c2b('0x38')](handleError(_0x360eb3,null));};exports[_0x5c2b('0x39')]=function(_0x35510d,_0x27303f){return db[_0x5c2b('0x23')]['create'](_0x35510d[_0x5c2b('0x3a')],{})['then'](respondWithResult(_0x27303f,0xc9))[_0x5c2b('0x38')](handleError(_0x27303f,null));};exports['update']=function(_0x567aba,_0x2c946c){if(_0x567aba[_0x5c2b('0x3a')]['id']){delete _0x567aba[_0x5c2b('0x3a')]['id'];}return db['FaxInteraction'][_0x5c2b('0x37')]({'where':{'id':_0x567aba[_0x5c2b('0x2d')]['id']}})[_0x5c2b('0x1b')](handleEntityNotFound(_0x2c946c,null))['then'](saveUpdates(_0x567aba['body'],null))[_0x5c2b('0x1b')](respondWithResult(_0x2c946c,null))[_0x5c2b('0x38')](handleError(_0x2c946c,null));};exports[_0x5c2b('0x1c')]=function(_0x185831,_0x531d9e){return db[_0x5c2b('0x23')][_0x5c2b('0x37')]({'where':{'id':_0x185831[_0x5c2b('0x2d')]['id']}})[_0x5c2b('0x1b')](handleEntityNotFound(_0x531d9e,null))[_0x5c2b('0x1b')](removeEntity(_0x531d9e,null))['catch'](handleError(_0x531d9e,null));};exports[_0x5c2b('0x3b')]=function(_0x15dc57,_0x149d71){return db[_0x5c2b('0x23')]['describe']()[_0x5c2b('0x1b')](respondWithResult(_0x149d71,null))[_0x5c2b('0x38')](handleError(_0x149d71,null));};exports['addMessage']=function(_0x39d194,_0x1d07c3){return db[_0x5c2b('0x3c')]['find']({'where':{'id':_0x39d194[_0x5c2b('0x2d')]['id']}})[_0x5c2b('0x1b')](handleEntityNotFound(_0x1d07c3,null))[_0x5c2b('0x1b')](function(_0x38f934){if(_0x38f934){return _0x38f934[_0x5c2b('0x3d')](_0x39d194[_0x5c2b('0x3a')][_0x5c2b('0x3e')],_['omit'](_0x39d194['body'],[_0x5c2b('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x1d07c3,null))[_0x5c2b('0x38')](handleError(_0x1d07c3,null));};exports[_0x5c2b('0x3f')]=function(_0x1a0da3,_0x58a594){var _0x59c1b4={'raw':![],'where':{}};var _0xd5189a={};var _0x91c1eb={'count':0x0,'rows':[]};return db[_0x5c2b('0x23')][_0x5c2b('0x40')]({'where':{'id':_0x1a0da3[_0x5c2b('0x2d')]['id']}})['then'](handleEntityNotFound(_0x58a594,null))[_0x5c2b('0x1b')](function(_0x214540){if(_0x214540){_0xd5189a[_0x5c2b('0x2e')]=_['keys'](db[_0x5c2b('0x3c')][_0x5c2b('0x24')]);_0xd5189a[_0x5c2b('0x2a')]=_[_0x5c2b('0x2f')](_0x1a0da3[_0x5c2b('0x2a')]);_0xd5189a[_0x5c2b('0x30')]=_[_0x5c2b('0x31')](_0xd5189a[_0x5c2b('0x2e')],_0xd5189a['query']);_0x59c1b4[_0x5c2b('0x33')]=_[_0x5c2b('0x31')](_0xd5189a[_0x5c2b('0x2e')],qs['fields'](_0x1a0da3[_0x5c2b('0x2a')]['fields']));_0x59c1b4[_0x5c2b('0x33')]=_0x59c1b4[_0x5c2b('0x33')][_0x5c2b('0x41')]?_0x59c1b4[_0x5c2b('0x33')]:_0xd5189a[_0x5c2b('0x2e')];if(!_0x1a0da3[_0x5c2b('0x2a')]['hasOwnProperty'](_0x5c2b('0x42'))){_0x59c1b4[_0x5c2b('0x18')]=qs['limit'](_0x1a0da3['query']['limit']);_0x59c1b4[_0x5c2b('0x17')]=qs[_0x5c2b('0x17')](_0x1a0da3[_0x5c2b('0x2a')][_0x5c2b('0x17')]);}_0x59c1b4[_0x5c2b('0x43')]=qs[_0x5c2b('0x44')](_0x1a0da3[_0x5c2b('0x2a')][_0x5c2b('0x44')]);_0x59c1b4[_0x5c2b('0x45')]=qs['filters'](_[_0x5c2b('0x46')](_0x1a0da3[_0x5c2b('0x2a')],_0xd5189a[_0x5c2b('0x30')]));_0x59c1b4[_0x5c2b('0x45')][_0x5c2b('0x47')]=_0x214540['id'];if(_0x1a0da3[_0x5c2b('0x2a')]['filter']){_0x59c1b4['where']=_[_0x5c2b('0x35')](_0x59c1b4['where'],{'$or':_[_0x5c2b('0x22')](_0x59c1b4[_0x5c2b('0x33')],function(_0x4dba13){var _0x55da53={};_0x55da53[_0x4dba13]={'$like':'%'+_0x1a0da3['query'][_0x5c2b('0x48')]+'%'};return _0x55da53;})});}if(_0x1a0da3[_0x5c2b('0x2a')][_0x5c2b('0x49')]){var _0x5e82df=_0x1a0da3[_0x5c2b('0x2a')][_0x5c2b('0x49')]['split'](',');var _0x265116={};_0x265116[_0x5e82df[0x0]]={'$gte':moment(_0x5e82df[0x1])[_0x5c2b('0x4a')](_0x5c2b('0x4b'))};_0x59c1b4[_0x5c2b('0x45')]=_[_0x5c2b('0x35')](_0x59c1b4['where'],_0x265116);}_0x59c1b4=_[_0x5c2b('0x35')]({},_0x59c1b4,_0x1a0da3['options']);return db[_0x5c2b('0x3c')][_0x5c2b('0x16')]({'where':_0x59c1b4[_0x5c2b('0x45')]})[_0x5c2b('0x1b')](function(_0x683f2d){_0x91c1eb[_0x5c2b('0x16')]=_0x683f2d;if(_0x1a0da3[_0x5c2b('0x2a')][_0x5c2b('0x4c')]){_0x59c1b4[_0x5c2b('0x34')]=[{'all':!![]}];}return db[_0x5c2b('0x3c')][_0x5c2b('0x29')](_0x59c1b4);})[_0x5c2b('0x1b')](function(_0x4f8e42){_0x91c1eb[_0x5c2b('0x4d')]=_0x4f8e42;return _0x91c1eb;});}})[_0x5c2b('0x1b')](respondWithFilteredResult(_0x58a594,_0x59c1b4))['catch'](handleError(_0x58a594,null));};exports[_0x5c2b('0x4e')]=function(_0x24b15f,_0x374cdb){return db[_0x5c2b('0x23')][_0x5c2b('0x37')]({'where':{'id':_0x24b15f[_0x5c2b('0x2d')]['id']}})[_0x5c2b('0x1b')](handleEntityNotFound(_0x374cdb,null))[_0x5c2b('0x1b')](function(_0x34cd90){if(_0x34cd90){return _0x34cd90[_0x5c2b('0x4f')](_0x24b15f['body'][_0x5c2b('0x3e')],_[_0x5c2b('0x50')](_0x24b15f[_0x5c2b('0x3a')],[_0x5c2b('0x3e'),'id'])||{})[_0x5c2b('0x51')](function(){return db['Tag'][_0x5c2b('0x29')]({'attributes':['id',_0x5c2b('0x1f'),_0x5c2b('0x52')],'where':{'id':_0x24b15f[_0x5c2b('0x3a')]['ids']}});})['then'](function(_0x4aa2c8){socket[_0x5c2b('0x53')]('faxInteractionTags:save',{'id':Number(_0x24b15f[_0x5c2b('0x2d')]['id']),'tags':_0x4aa2c8||[]});return{'id':Number(_0x24b15f[_0x5c2b('0x2d')]['id']),'tags':_0x4aa2c8||[]};});}})[_0x5c2b('0x1b')](respondWithResult(_0x374cdb,null))[_0x5c2b('0x38')](handleError(_0x374cdb,null));};exports[_0x5c2b('0x54')]=function(_0x12e6af,_0xe409ae){return db[_0x5c2b('0x23')][_0x5c2b('0x37')]({'where':{'id':_0x12e6af[_0x5c2b('0x2d')]['id']}})['then'](handleEntityNotFound(_0xe409ae,null))['then'](function(_0x326e80){if(_0x326e80){return _0x326e80[_0x5c2b('0x54')](_0x12e6af[_0x5c2b('0x2a')][_0x5c2b('0x3e')]);}})[_0x5c2b('0x1b')](respondWithStatusCode(_0xe409ae,null))[_0x5c2b('0x38')](handleError(_0xe409ae,null));};exports[_0x5c2b('0x55')]=function(_0x239b75,_0x7bb747){var _0x40a2e5=moment()[_0x5c2b('0x56')]()[_0x5c2b('0x57')]();var _0x1c0911=path['join'](config[_0x5c2b('0x58')],_0x5c2b('0x59'),_0x5c2b('0x5a'),_0x5c2b('0x5b'));var _0x37bb5a=path[_0x5c2b('0x5c')](config[_0x5c2b('0x58')],'server','files',_0x5c2b('0x5d'));var _0x47ebed=path[_0x5c2b('0x5c')](_0x1c0911,_0x40a2e5);var _0xc84fa=util['format'](_0x5c2b('0x5e'),_0x239b75['params']['id'],_0x40a2e5);var _0x387f83=path[_0x5c2b('0x5c')](_0x1c0911,_0xc84fa);var _0x3c5a47=[];_0x3c5a47['push']({'model':db[_0x5c2b('0x5f')],'as':'Attachment','raw':!![]});var _0x3f30a2=[{'model':db[_0x5c2b('0x3c')],'as':'Messages','attributes':['id',_0x5c2b('0x3a'),_0x5c2b('0x60')],'include':_0x3c5a47}];return db['FaxInteraction'][_0x5c2b('0x37')]({'where':{'id':_0x239b75[_0x5c2b('0x2d')]['id']},'include':_0x3f30a2})[_0x5c2b('0x1b')](handleEntityNotFound(_0x7bb747,null))[_0x5c2b('0x1b')](function(_0x591425){if(_0x591425&&_0x591425[_0x5c2b('0x61')]){var _0x24cacd=_0x591425[_0x5c2b('0x62')]({'plain':!![]});fs['mkdirSync'](_0x47ebed);for(var _0x1a853d=0x0;_0x1a853d<_0x24cacd[_0x5c2b('0x61')][_0x5c2b('0x41')];_0x1a853d++){var _0xc6f6f9=_0x24cacd[_0x5c2b('0x61')][_0x1a853d][_0x5c2b('0x5f')];if(_0xc6f6f9){var _0x21ffca=path[_0x5c2b('0x5c')](_0x37bb5a,_0xc6f6f9[_0x5c2b('0x63')]);if(fs[_0x5c2b('0x64')](_0x21ffca)){fs[_0x5c2b('0x65')](_0x21ffca)['pipe'](fs['createWriteStream'](path[_0x5c2b('0x5c')](_0x47ebed,_0xc6f6f9['basename'])));}}}return BPromise[_0x5c2b('0x66')]()[_0x5c2b('0x1b')](function(){return new BPromise(function(_0x4d93a4,_0x55467b){zipdir(_0x47ebed,{'saveTo':_0x387f83},function(_0x4deef2,_0xfba664){if(_0x4deef2)return _0x55467b(_0x4deef2);return _0x4d93a4(_0xfba664);});})[_0x5c2b('0x1b')](function(){return new BPromise(function(_0x3ec512,_0x29b359){rimraf(_0x47ebed,function(_0x335967){if(_0x335967)_0x29b359(_0x335967);return _0x3ec512();});});})[_0x5c2b('0x1b')](function(){return _0x7bb747[_0x5c2b('0x55')](_0x387f83,_0xc84fa,function(_0xbca28){if(_0xbca28){console[_0x5c2b('0x67')]('err',_0xbca28);}else{fs['unlinkSync'](_0x387f83);}});});});}else{return _0x7bb747[_0x5c2b('0x11')](0xc8);}})[_0x5c2b('0x38')](handleError(_0x7bb747,null));}; \ No newline at end of file +var _0xcdf9=['join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','createdAt','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','err','rimraf','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','name','send','fieldName','type','key','getOptions','findAll','fax','query','user','params','model','keys','FaxInteraction','filters','intersection','fields','attributes','length','includeAll','include','merge','catch','create','body','update','find','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','where','map','filter','$gte','addTags','setTags','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString'];(function(_0x14a1f4,_0x3f556e){var _0x3060fa=function(_0x4f4602){while(--_0x4f4602){_0x14a1f4['push'](_0x14a1f4['shift']());}};_0x3060fa(++_0x3f556e);}(_0xcdf9,0x1b7));var _0x9cdf=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0xcdf9[_0x49c057];return _0xd8f0e6;};'use strict';var rimraf=require(_0x9cdf('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9cdf('0x1'));var BPromise=require(_0x9cdf('0x2'));var util=require(_0x9cdf('0x3'));var path=require(_0x9cdf('0x4'));var fs=require('fs');var _=require(_0x9cdf('0x5'));var Redis=require(_0x9cdf('0x6'));var interaction=require(_0x9cdf('0x7'));var qs=require(_0x9cdf('0x8'));var logger=require(_0x9cdf('0x9'))(_0x9cdf('0xa'));var config=require(_0x9cdf('0xb'));var db=require(_0x9cdf('0xc'))['db'];config[_0x9cdf('0xd')]=_[_0x9cdf('0xe')](config[_0x9cdf('0xd')],{'host':_0x9cdf('0xf'),'port':0x18eb});var socket=require(_0x9cdf('0x10'))(new Redis(config[_0x9cdf('0xd')]));require(_0x9cdf('0x11'))[_0x9cdf('0x12')](socket);function respondWithStatusCode(_0x19f74b,_0x28d93c){_0x28d93c=_0x28d93c||0xcc;return function(_0x35ff7b){if(_0x35ff7b){return _0x19f74b[_0x9cdf('0x13')](_0x28d93c);}return _0x19f74b[_0x9cdf('0x14')](_0x28d93c)[_0x9cdf('0x15')]();};}function respondWithResult(_0x2bcaac,_0xeb5cf2){_0xeb5cf2=_0xeb5cf2||0xc8;return function(_0xe8d68f){if(_0xe8d68f){return _0x2bcaac['status'](_0xeb5cf2)[_0x9cdf('0x16')](_0xe8d68f);}};}function respondWithFilteredResult(_0x5bc441,_0x4cdcd3){return function(_0x214925){if(_0x214925){var _0x426643=typeof _0x4cdcd3[_0x9cdf('0x17')]===_0x9cdf('0x18')&&typeof _0x4cdcd3[_0x9cdf('0x19')]===_0x9cdf('0x18');var _0x3e9600=_0x214925['count'];var _0x5dfd26=_0x426643?0x0:_0x4cdcd3[_0x9cdf('0x17')];var _0x5529a9=_0x426643?_0x214925[_0x9cdf('0x1a')]:_0x4cdcd3[_0x9cdf('0x17')]+_0x4cdcd3[_0x9cdf('0x19')];var _0x4915ec;if(_0x5529a9>=_0x3e9600){_0x5529a9=_0x3e9600;_0x4915ec=0xc8;}else{_0x4915ec=0xce;}_0x5bc441['status'](_0x4915ec);return _0x5bc441[_0x9cdf('0x1b')](_0x9cdf('0x1c'),_0x5dfd26+'-'+_0x5529a9+'/'+_0x3e9600)[_0x9cdf('0x16')](_0x214925);}return null;};}function saveUpdates(_0x153425){return function(_0x3c7e93){if(_0x3c7e93){return _0x3c7e93['update'](_0x153425)[_0x9cdf('0x1d')](function(_0x56c1e8){return _0x56c1e8;});}return null;};}function removeEntity(_0x1fffd3){return function(_0x44ba75){if(_0x44ba75){return _0x44ba75[_0x9cdf('0x1e')]()[_0x9cdf('0x1d')](function(){_0x1fffd3[_0x9cdf('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x286d70){return function(_0x42a8ac){if(!_0x42a8ac){_0x286d70[_0x9cdf('0x13')](0x194);}return _0x42a8ac;};}function handleError(_0xa42240,_0x27083d){_0x27083d=_0x27083d||0x1f4;return function(_0x48e150){logger[_0x9cdf('0x1f')](_0x48e150['stack']);if(_0x48e150[_0x9cdf('0x20')]){delete _0x48e150[_0x9cdf('0x20')];}_0xa42240[_0x9cdf('0x14')](_0x27083d)[_0x9cdf('0x21')](_0x48e150);};}exports['index']=function(_0x232f02,_0xea40a){var _0x4957a5={};var _0x50f15c=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x6dbbd){return{'name':_0x6dbbd[_0x9cdf('0x22')],'type':_0x6dbbd[_0x9cdf('0x23')][_0x9cdf('0x24')]};});_0x4957a5=qs[_0x9cdf('0x25')](_0x50f15c,_0x232f02);return interaction[_0x9cdf('0x26')](_0x9cdf('0x27'),_0x232f02[_0x9cdf('0x28')],_0x232f02[_0x9cdf('0x29')],_0x4957a5,_0x50f15c)[_0x9cdf('0x1d')](respondWithFilteredResult(_0xea40a,_0x4957a5))['catch'](handleError(_0xea40a,null));};exports['show']=function(_0x1cf821,_0x4e52e9){var _0x4b58a3={'raw':![],'where':{'id':_0x1cf821[_0x9cdf('0x2a')]['id']}},_0x1698e5={};_0x1698e5[_0x9cdf('0x2b')]=_[_0x9cdf('0x2c')](db[_0x9cdf('0x2d')]['rawAttributes']);_0x1698e5[_0x9cdf('0x28')]=_[_0x9cdf('0x2c')](_0x1cf821['query']);_0x1698e5[_0x9cdf('0x2e')]=_['intersection'](_0x1698e5[_0x9cdf('0x2b')],_0x1698e5[_0x9cdf('0x28')]);_0x4b58a3['attributes']=_[_0x9cdf('0x2f')](_0x1698e5['model'],qs[_0x9cdf('0x30')](_0x1cf821['query'][_0x9cdf('0x30')]));_0x4b58a3['attributes']=_0x4b58a3[_0x9cdf('0x31')][_0x9cdf('0x32')]?_0x4b58a3[_0x9cdf('0x31')]:_0x1698e5[_0x9cdf('0x2b')];if(_0x1cf821[_0x9cdf('0x28')][_0x9cdf('0x33')]){_0x4b58a3[_0x9cdf('0x34')]=[{'all':!![]}];}_0x4b58a3=_[_0x9cdf('0x35')]({},_0x4b58a3,_0x1cf821['options']);return db[_0x9cdf('0x2d')]['find'](_0x4b58a3)[_0x9cdf('0x1d')](handleEntityNotFound(_0x4e52e9,null))[_0x9cdf('0x1d')](respondWithResult(_0x4e52e9,null))[_0x9cdf('0x36')](handleError(_0x4e52e9,null));};exports[_0x9cdf('0x37')]=function(_0x8645c5,_0x45200f){return db[_0x9cdf('0x2d')]['create'](_0x8645c5[_0x9cdf('0x38')],{})[_0x9cdf('0x1d')](respondWithResult(_0x45200f,0xc9))[_0x9cdf('0x36')](handleError(_0x45200f,null));};exports[_0x9cdf('0x39')]=function(_0x2af8eb,_0x220927){if(_0x2af8eb[_0x9cdf('0x38')]['id']){delete _0x2af8eb[_0x9cdf('0x38')]['id'];}return db[_0x9cdf('0x2d')][_0x9cdf('0x3a')]({'where':{'id':_0x2af8eb[_0x9cdf('0x2a')]['id']}})[_0x9cdf('0x1d')](handleEntityNotFound(_0x220927,null))['then'](saveUpdates(_0x2af8eb[_0x9cdf('0x38')],null))['then'](respondWithResult(_0x220927,null))[_0x9cdf('0x36')](handleError(_0x220927,null));};exports[_0x9cdf('0x1e')]=function(_0x2b187f,_0x46cad1){return db[_0x9cdf('0x2d')]['find']({'where':{'id':_0x2b187f[_0x9cdf('0x2a')]['id']}})[_0x9cdf('0x1d')](handleEntityNotFound(_0x46cad1,null))[_0x9cdf('0x1d')](removeEntity(_0x46cad1,null))[_0x9cdf('0x36')](handleError(_0x46cad1,null));};exports['describe']=function(_0x37b0c2,_0x345bb0){return db[_0x9cdf('0x2d')][_0x9cdf('0x3b')]()[_0x9cdf('0x1d')](respondWithResult(_0x345bb0,null))[_0x9cdf('0x36')](handleError(_0x345bb0,null));};exports[_0x9cdf('0x3c')]=function(_0x5846ba,_0x497bbb){return db['FaxMessage'][_0x9cdf('0x3a')]({'where':{'id':_0x5846ba[_0x9cdf('0x2a')]['id']}})['then'](handleEntityNotFound(_0x497bbb,null))[_0x9cdf('0x1d')](function(_0x4074f8){if(_0x4074f8){return _0x4074f8[_0x9cdf('0x3c')](_0x5846ba['body'][_0x9cdf('0x3d')],_[_0x9cdf('0x3e')](_0x5846ba[_0x9cdf('0x38')],[_0x9cdf('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x497bbb,null))['catch'](handleError(_0x497bbb,null));};exports[_0x9cdf('0x3f')]=function(_0x3bd9dc,_0x3f5702){var _0x143c32={'raw':![],'where':{}};var _0xfe2c27={};var _0x4f5caa={'count':0x0,'rows':[]};return db[_0x9cdf('0x2d')][_0x9cdf('0x40')]({'where':{'id':_0x3bd9dc['params']['id']}})[_0x9cdf('0x1d')](handleEntityNotFound(_0x3f5702,null))[_0x9cdf('0x1d')](function(_0x4b1535){if(_0x4b1535){_0xfe2c27[_0x9cdf('0x2b')]=_['keys'](db[_0x9cdf('0x41')][_0x9cdf('0x42')]);_0xfe2c27[_0x9cdf('0x28')]=_['keys'](_0x3bd9dc[_0x9cdf('0x28')]);_0xfe2c27[_0x9cdf('0x2e')]=_[_0x9cdf('0x2f')](_0xfe2c27[_0x9cdf('0x2b')],_0xfe2c27[_0x9cdf('0x28')]);_0x143c32['attributes']=_[_0x9cdf('0x2f')](_0xfe2c27[_0x9cdf('0x2b')],qs['fields'](_0x3bd9dc['query']['fields']));_0x143c32[_0x9cdf('0x31')]=_0x143c32[_0x9cdf('0x31')]['length']?_0x143c32[_0x9cdf('0x31')]:_0xfe2c27[_0x9cdf('0x2b')];if(!_0x3bd9dc['query'][_0x9cdf('0x43')](_0x9cdf('0x44'))){_0x143c32['limit']=qs['limit'](_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x19')]);_0x143c32[_0x9cdf('0x17')]=qs[_0x9cdf('0x17')](_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x17')]);}_0x143c32[_0x9cdf('0x45')]=qs[_0x9cdf('0x46')](_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x46')]);_0x143c32['where']=qs[_0x9cdf('0x2e')](_[_0x9cdf('0x47')](_0x3bd9dc[_0x9cdf('0x28')],_0xfe2c27['filters']));_0x143c32['where']['FaxInteractionId']=_0x4b1535['id'];if(_0x3bd9dc['query']['filter']){_0x143c32[_0x9cdf('0x48')]=_[_0x9cdf('0x35')](_0x143c32[_0x9cdf('0x48')],{'$or':_[_0x9cdf('0x49')](_0x143c32[_0x9cdf('0x31')],function(_0x22c9b8){var _0x94db80={};_0x94db80[_0x22c9b8]={'$like':'%'+_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x4a')]+'%'};return _0x94db80;})});}if(_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x4b')]){var _0x428bd3=_0x3bd9dc[_0x9cdf('0x28')][_0x9cdf('0x4b')]['split'](',');var _0x447f90={};_0x447f90[_0x428bd3[0x0]]={'$gte':moment(_0x428bd3[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x143c32[_0x9cdf('0x48')]=_[_0x9cdf('0x35')](_0x143c32[_0x9cdf('0x48')],_0x447f90);}_0x143c32=_[_0x9cdf('0x35')]({},_0x143c32,_0x3bd9dc['options']);return db[_0x9cdf('0x41')]['count']({'where':_0x143c32['where']})['then'](function(_0x112b76){_0x4f5caa[_0x9cdf('0x1a')]=_0x112b76;if(_0x3bd9dc[_0x9cdf('0x28')]['includeAll']){_0x143c32[_0x9cdf('0x34')]=[{'all':!![]}];}return db[_0x9cdf('0x41')][_0x9cdf('0x26')](_0x143c32);})[_0x9cdf('0x1d')](function(_0x4eb594){_0x4f5caa['rows']=_0x4eb594;return _0x4f5caa;});}})[_0x9cdf('0x1d')](respondWithFilteredResult(_0x3f5702,_0x143c32))['catch'](handleError(_0x3f5702,null));};exports[_0x9cdf('0x4c')]=function(_0x109d8b,_0x28836f){return db['FaxInteraction']['find']({'where':{'id':_0x109d8b[_0x9cdf('0x2a')]['id']}})['then'](handleEntityNotFound(_0x28836f,null))[_0x9cdf('0x1d')](function(_0x5f4b42){if(_0x5f4b42){return _0x5f4b42[_0x9cdf('0x4d')](_0x109d8b['body'][_0x9cdf('0x3d')],_['omit'](_0x109d8b['body'],[_0x9cdf('0x3d'),'id'])||{})['spread'](function(){return db[_0x9cdf('0x4e')][_0x9cdf('0x26')]({'attributes':['id',_0x9cdf('0x20'),_0x9cdf('0x4f')],'where':{'id':_0x109d8b[_0x9cdf('0x38')][_0x9cdf('0x3d')]}});})[_0x9cdf('0x1d')](function(_0x4ed1a6){socket[_0x9cdf('0x50')](_0x9cdf('0x51'),{'id':Number(_0x109d8b[_0x9cdf('0x2a')]['id']),'tags':_0x4ed1a6||[]});return{'id':Number(_0x109d8b[_0x9cdf('0x2a')]['id']),'tags':_0x4ed1a6||[]};});}})['then'](respondWithResult(_0x28836f,null))[_0x9cdf('0x36')](handleError(_0x28836f,null));};exports[_0x9cdf('0x52')]=function(_0x5437cb,_0x1cc512){return db[_0x9cdf('0x2d')][_0x9cdf('0x3a')]({'where':{'id':_0x5437cb[_0x9cdf('0x2a')]['id']}})[_0x9cdf('0x1d')](handleEntityNotFound(_0x1cc512,null))[_0x9cdf('0x1d')](function(_0x529120){if(_0x529120){return _0x529120[_0x9cdf('0x52')](_0x5437cb['query'][_0x9cdf('0x3d')]);}})['then'](respondWithStatusCode(_0x1cc512,null))[_0x9cdf('0x36')](handleError(_0x1cc512,null));};exports[_0x9cdf('0x53')]=function(_0x295c9b,_0x3ffc18){var _0x1b5898=moment()[_0x9cdf('0x54')]()[_0x9cdf('0x55')]();var _0x484e4d=path[_0x9cdf('0x56')](config[_0x9cdf('0x57')],'server',_0x9cdf('0x58'),_0x9cdf('0x59'));var _0x2bc4bc=path[_0x9cdf('0x56')](config[_0x9cdf('0x57')],_0x9cdf('0x5a'),_0x9cdf('0x58'),_0x9cdf('0x5b'));var _0x306072=path[_0x9cdf('0x56')](_0x484e4d,_0x1b5898);var _0x4043b3=util['format'](_0x9cdf('0x5c'),_0x295c9b['params']['id'],_0x1b5898);var _0x3cfd60=path[_0x9cdf('0x56')](_0x484e4d,_0x4043b3);var _0x2bda76=[];_0x2bda76[_0x9cdf('0x5d')]({'model':db[_0x9cdf('0x5e')],'as':'Attachment','raw':!![]});var _0x5aea42=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x9cdf('0x38'),_0x9cdf('0x5f')],'include':_0x2bda76}];return db['FaxInteraction']['find']({'where':{'id':_0x295c9b[_0x9cdf('0x2a')]['id']},'include':_0x5aea42})[_0x9cdf('0x1d')](handleEntityNotFound(_0x3ffc18,null))[_0x9cdf('0x1d')](function(_0x200a23){if(_0x200a23&&_0x200a23[_0x9cdf('0x60')]){var _0x53a154=_0x200a23['get']({'plain':!![]});fs[_0x9cdf('0x61')](_0x306072);for(var _0x1fdf28=0x0;_0x1fdf28<_0x53a154[_0x9cdf('0x60')][_0x9cdf('0x32')];_0x1fdf28++){var _0x41e5bf=_0x53a154[_0x9cdf('0x60')][_0x1fdf28][_0x9cdf('0x5e')];if(_0x41e5bf){var _0x134153=path[_0x9cdf('0x56')](_0x2bc4bc,_0x41e5bf[_0x9cdf('0x62')]);if(fs[_0x9cdf('0x63')](_0x134153)){fs[_0x9cdf('0x64')](_0x134153)[_0x9cdf('0x65')](fs[_0x9cdf('0x66')](path[_0x9cdf('0x56')](_0x306072,_0x41e5bf['basename'])));}}}return BPromise['resolve']()[_0x9cdf('0x1d')](function(){return new BPromise(function(_0x309ffa,_0x2a3469){zipdir(_0x306072,{'saveTo':_0x3cfd60},function(_0x5e156a,_0x12ab6b){if(_0x5e156a)return _0x2a3469(_0x5e156a);return _0x309ffa(_0x12ab6b);});})[_0x9cdf('0x1d')](function(){return new BPromise(function(_0xe7c0f8,_0x25f262){rimraf(_0x306072,function(_0x502ed5){if(_0x502ed5)_0x25f262(_0x502ed5);return _0xe7c0f8();});});})[_0x9cdf('0x1d')](function(){return _0x3ffc18[_0x9cdf('0x53')](_0x3cfd60,_0x4043b3,function(_0x2f2f1e){if(_0x2f2f1e){console[_0x9cdf('0x67')](_0x9cdf('0x68'),_0x2f2f1e);}else{fs['unlinkSync'](_0x3cfd60);}});});});}else{return _0x3ffc18[_0x9cdf('0x13')](0xc8);}})[_0x9cdf('0x36')](handleError(_0x3ffc18,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 8e1a5ac..71695c5 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 _0x4042=['setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x4042,0xf9));var _0x2404=function(_0x13b026,_0x1071c1){_0x13b026=_0x13b026-0x0;var _0x15130e=_0x4042[_0x13b026];return _0x15130e;};'use strict';var EventEmitter=require(_0x2404('0x0'));var FaxInteraction=require(_0x2404('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0x2404('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x2404('0x3')](0x0);var events={'afterCreate':_0x2404('0x4'),'afterUpdate':_0x2404('0x5'),'afterDestroy':_0x2404('0x6')};function emitEvent(_0x5a571e){return function(_0x5af9fd,_0x89c965,_0x444cdc){_0x5af9fd['getUsers']({'attributes':['id'],'raw':!![]})[_0x2404('0x7')](function(_0x5949d8){_0x5af9fd[_0x2404('0x8')](_0x2404('0x9'),_0x5949d8[_0x2404('0xa')](function(_0x29e201){return{'id':_0x29e201['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5af9fd['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2404('0x7')](function(_0x187d5d){_0x5af9fd[_0x2404('0x8')](_0x2404('0xb'),_0x187d5d[_0x2404('0xc')]);FaxInteractionEvents[_0x2404('0xd')](_0x5a571e+':'+_0x5af9fd['id'],_0x5af9fd);FaxInteractionEvents['emit'](_0x5a571e,_0x5af9fd);_0x444cdc(null);})[_0x2404('0xe')](_0x444cdc(null));};}for(var e in events){if(events[_0x2404('0xf')](e)){var event=events[e];FaxInteraction[_0x2404('0x10')](e,emitEvent(event));}}module[_0x2404('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0x8b04=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x91e5f0,_0x2578f4){var _0x543b65=function(_0x384dec){while(--_0x384dec){_0x91e5f0['push'](_0x91e5f0['shift']());}};_0x543b65(++_0x2578f4);}(_0x8b04,0xac));var _0x48b0=function(_0xf312c4,_0x5d81ca){_0xf312c4=_0xf312c4-0x0;var _0x3b3ca1=_0x8b04[_0xf312c4];return _0x3b3ca1;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x48b0('0x0'))['db'][_0x48b0('0x1')];var FaxMessage=require(_0x48b0('0x0'))['db'][_0x48b0('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x48b0('0x3')](0x0);var events={'afterCreate':_0x48b0('0x4'),'afterUpdate':'update','afterDestroy':_0x48b0('0x5')};function emitEvent(_0x26882c){return function(_0x2a5bce,_0x19473b,_0x33e54a){_0x2a5bce[_0x48b0('0x6')]({'attributes':['id'],'raw':!![]})[_0x48b0('0x7')](function(_0x49e466){_0x2a5bce[_0x48b0('0x8')](_0x48b0('0x9'),_0x49e466[_0x48b0('0xa')](function(_0x37091a){return{'id':_0x37091a['id']};}));return FaxMessage[_0x48b0('0xb')]({'where':{'FaxInteractionId':_0x2a5bce['id'],'direction':'in','read':![]},'raw':!![]});})[_0x48b0('0x7')](function(_0x4264d5){_0x2a5bce[_0x48b0('0x8')](_0x48b0('0xc'),_0x4264d5[_0x48b0('0xd')]);FaxInteractionEvents['emit'](_0x26882c+':'+_0x2a5bce['id'],_0x2a5bce);FaxInteractionEvents[_0x48b0('0xe')](_0x26882c,_0x2a5bce);_0x33e54a(null);})[_0x48b0('0xf')](_0x33e54a(null));};}for(var e in events){if(events[_0x48b0('0x10')](e)){var event=events[e];FaxInteraction[_0x48b0('0x11')](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 afa1a26..d331831 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 _0x4d0a=['lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5dc2fa,_0x56279d){var _0x16eaf9=function(_0x83322){while(--_0x83322){_0x5dc2fa['push'](_0x5dc2fa['shift']());}};_0x16eaf9(++_0x56279d);}(_0x4d0a,0x176));var _0xa4d0=function(_0x1dfce4,_0x3a004f){_0x1dfce4=_0x1dfce4-0x0;var _0x48589c=_0x4d0a[_0x1dfce4];return _0x48589c;};'use strict';var _=require(_0xa4d0('0x0'));var util=require(_0xa4d0('0x1'));var logger=require(_0xa4d0('0x2'))('api');var moment=require(_0xa4d0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4d0('0x4'));var rimraf=require(_0xa4d0('0x5'));var config=require(_0xa4d0('0x6'));var attributes=require(_0xa4d0('0x7'));module[_0xa4d0('0x8')]=function(_0x20621e,_0x3b4e44){return _0x20621e[_0xa4d0('0x9')](_0xa4d0('0xa'),attributes,{'tableName':_0xa4d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x204662,_0xd68746,_0x4dce68){if(_0x204662[_0xa4d0('0xc')](_0xa4d0('0xd'))){_0x204662[_0xa4d0('0xe')]=moment()[_0xa4d0('0xf')](_0xa4d0('0x10'));}_0x4dce68(null,_0x204662);}}});}; \ No newline at end of file +var _0xdb8a=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','bluebird','rimraf','../../config/environment','exports','define','FaxInteraction'];(function(_0x433cc4,_0x490998){var _0x416450=function(_0x5931ee){while(--_0x5931ee){_0x433cc4['push'](_0x433cc4['shift']());}};_0x416450(++_0x490998);}(_0xdb8a,0xfc));var _0xadb8=function(_0x52b0b2,_0xf6dbf9){_0x52b0b2=_0x52b0b2-0x0;var _0x322769=_0xdb8a[_0x52b0b2];return _0x322769;};'use strict';var _=require(_0xadb8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xadb8('0x1'));var moment=require('moment');var BPromise=require(_0xadb8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xadb8('0x3'));var config=require(_0xadb8('0x4'));var attributes=require('./faxInteraction.attributes');module[_0xadb8('0x5')]=function(_0x5e1ba1,_0x36feb5){return _0x5e1ba1[_0xadb8('0x6')](_0xadb8('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e67d4,_0xc2782f,_0x12781b){if(_0x1e67d4[_0xadb8('0x8')](_0xadb8('0x9'))){_0x1e67d4[_0xadb8('0xa')]=moment()[_0xadb8('0xb')](_0xadb8('0xc'));}_0x12781b(null,_0x1e67d4);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a5e021b..c1b7cdb 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 _0xba24=['socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x3abe58,_0x184dd9){var _0x457389=function(_0x59f517){while(--_0x59f517){_0x3abe58['push'](_0x3abe58['shift']());}};_0x457389(++_0x184dd9);}(_0xba24,0x182));var _0x4ba2=function(_0x3da1d8,_0x504354){_0x3da1d8=_0x3da1d8-0x0;var _0x50111c=_0xba24[_0x3da1d8];return _0x50111c;};'use strict';var _=require(_0x4ba2('0x0'));var util=require(_0x4ba2('0x1'));var moment=require(_0x4ba2('0x2'));var BPromise=require(_0x4ba2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ba2('0x4'));var db=require(_0x4ba2('0x5'))['db'];var utils=require(_0x4ba2('0x6'));var logger=require(_0x4ba2('0x7'))(_0x4ba2('0x8'));var config=require(_0x4ba2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4ba2('0xa')][_0x4ba2('0xb')]({'port':0x232a});config[_0x4ba2('0xc')]=_['defaults'](config[_0x4ba2('0xc')],{'host':_0x4ba2('0xd'),'port':0x18eb});var socket=require(_0x4ba2('0xe'))(new Redis(config[_0x4ba2('0xc')]));require(_0x4ba2('0xf'))['register'](socket);function respondWithRpcPromise(_0xbd24f5,_0x3cd64a,_0x23d50f){return new BPromise(function(_0x3df03c,_0x3b05d2){return client[_0x4ba2('0x10')](_0xbd24f5,_0x23d50f)[_0x4ba2('0x11')](function(_0x9cde0d){logger[_0x4ba2('0x12')](_0x4ba2('0x13'),_0x3cd64a,'request\x20sent');logger[_0x4ba2('0x14')](_0x4ba2('0x15'),_0x3cd64a,_0x4ba2('0x16'),JSON[_0x4ba2('0x17')](_0x9cde0d));if(_0x9cde0d['error']){if(_0x9cde0d[_0x4ba2('0x18')]['code']===0x1f4){logger[_0x4ba2('0x18')](_0x4ba2('0x13'),_0x3cd64a,_0x9cde0d['error']['message']);return _0x3b05d2(_0x9cde0d[_0x4ba2('0x18')][_0x4ba2('0x19')]);}logger[_0x4ba2('0x18')](_0x4ba2('0x13'),_0x3cd64a,_0x9cde0d[_0x4ba2('0x18')]['message']);return _0x3df03c(_0x9cde0d['error'][_0x4ba2('0x19')]);}else{logger[_0x4ba2('0x12')](_0x4ba2('0x13'),_0x3cd64a,_0x4ba2('0x16'));_0x3df03c(_0x9cde0d[_0x4ba2('0x1a')][_0x4ba2('0x19')]);}})[_0x4ba2('0x1b')](function(_0x54bc70){logger[_0x4ba2('0x18')](_0x4ba2('0x13'),_0x3cd64a,_0x54bc70);_0x3b05d2(_0x54bc70);});});}exports[_0x4ba2('0x1c')]=function(_0x2bdc5c){var _0x7be631=this;return new Promise(function(_0x19e79e,_0x349071){return db[_0x4ba2('0x1d')][_0x4ba2('0x1e')](_0x2bdc5c[_0x4ba2('0x1f')],{'raw':_0x2bdc5c[_0x4ba2('0x20')]?_0x2bdc5c[_0x4ba2('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bdc5c['options']?_0x2bdc5c[_0x4ba2('0x20')][_0x4ba2('0x21')]||null:null,'attributes':_0x2bdc5c[_0x4ba2('0x20')]?_0x2bdc5c[_0x4ba2('0x20')]['attributes']||null:null,'limit':_0x2bdc5c[_0x4ba2('0x20')]?_0x2bdc5c['options']['limit']||null:null})['then'](function(_0xdd525f){logger[_0x4ba2('0x12')]('UpdateFaxInteraction',_0x2bdc5c);logger[_0x4ba2('0x14')](_0x4ba2('0x1c'),_0x2bdc5c,JSON[_0x4ba2('0x17')](_0xdd525f));_0x19e79e(_0xdd525f);})[_0x4ba2('0x1b')](function(_0x40de85){logger[_0x4ba2('0x18')](_0x4ba2('0x1c'),_0x40de85[_0x4ba2('0x19')],_0x2bdc5c);_0x349071(_0x7be631['error'](0x1f4,_0x40de85[_0x4ba2('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x453e30){return new Promise(function(_0x151f8d,_0x32623c){return db[_0x4ba2('0x1d')][_0x4ba2('0x22')]({'where':_0x453e30[_0x4ba2('0x20')]?_0x453e30[_0x4ba2('0x20')][_0x4ba2('0x21')]||null:null})['then'](function(_0x14eb67){if(_0x14eb67){return _0x14eb67[_0x4ba2('0x23')](_0x453e30['body'][_0x4ba2('0x24')],_[_0x4ba2('0x25')](_0x453e30['body'],[_0x4ba2('0x24'),'id'])||{});}})[_0x4ba2('0x26')](function(_0x29fc86){logger[_0x4ba2('0x12')](_0x4ba2('0x27'),_0x453e30);logger[_0x4ba2('0x14')]('AddTags',_0x453e30,JSON[_0x4ba2('0x17')](_0x29fc86));_0x151f8d(_0x29fc86);})[_0x4ba2('0x1b')](function(_0xc90da0){logger[_0x4ba2('0x18')]('AddTags',_0xc90da0[_0x4ba2('0x19')],_0x453e30);_0x32623c(_this[_0x4ba2('0x18')](0x1f4,_0xc90da0[_0x4ba2('0x19')]));});});}; \ No newline at end of file +var _0xe6ca=['FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','AddTagsToFaxInteraction','find','where','addTags','ids','omit','spread','AddTags','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x564fe8,_0x4568b3){var _0x15934f=function(_0x3af327){while(--_0x3af327){_0x564fe8['push'](_0x564fe8['shift']());}};_0x15934f(++_0x4568b3);}(_0xe6ca,0x13c));var _0xae6c=function(_0x5cc3ff,_0x30bbdf){_0x5cc3ff=_0x5cc3ff-0x0;var _0x2b781e=_0xe6ca[_0x5cc3ff];return _0x2b781e;};'use strict';var _=require(_0xae6c('0x0'));var util=require('util');var moment=require(_0xae6c('0x1'));var BPromise=require(_0xae6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae6c('0x3'))['db'];var utils=require(_0xae6c('0x4'));var logger=require(_0xae6c('0x5'))(_0xae6c('0x6'));var config=require(_0xae6c('0x7'));var jayson=require(_0xae6c('0x8'));var client=jayson[_0xae6c('0x9')]['http']({'port':0x232a});config[_0xae6c('0xa')]=_[_0xae6c('0xb')](config['redis'],{'host':_0xae6c('0xc'),'port':0x18eb});var socket=require(_0xae6c('0xd'))(new Redis(config['redis']));require(_0xae6c('0xe'))[_0xae6c('0xf')](socket);function respondWithRpcPromise(_0x1d7c34,_0x370966,_0x2cee69){return new BPromise(function(_0x26a9ec,_0x18ddc6){return client['request'](_0x1d7c34,_0x2cee69)[_0xae6c('0x10')](function(_0x2af0c0){logger[_0xae6c('0x11')](_0xae6c('0x12'),_0x370966,_0xae6c('0x13'));logger['debug'](_0xae6c('0x14'),_0x370966,_0xae6c('0x13'),JSON[_0xae6c('0x15')](_0x2af0c0));if(_0x2af0c0[_0xae6c('0x16')]){if(_0x2af0c0[_0xae6c('0x16')][_0xae6c('0x17')]===0x1f4){logger[_0xae6c('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x370966,_0x2af0c0['error'][_0xae6c('0x18')]);return _0x18ddc6(_0x2af0c0[_0xae6c('0x16')][_0xae6c('0x18')]);}logger[_0xae6c('0x16')](_0xae6c('0x12'),_0x370966,_0x2af0c0[_0xae6c('0x16')][_0xae6c('0x18')]);return _0x26a9ec(_0x2af0c0[_0xae6c('0x16')][_0xae6c('0x18')]);}else{logger['info'](_0xae6c('0x12'),_0x370966,_0xae6c('0x13'));_0x26a9ec(_0x2af0c0['result'][_0xae6c('0x18')]);}})[_0xae6c('0x19')](function(_0x2802e9){logger['error'](_0xae6c('0x12'),_0x370966,_0x2802e9);_0x18ddc6(_0x2802e9);});});}exports[_0xae6c('0x1a')]=function(_0x3aa846){var _0x2afa84=this;return new Promise(function(_0x492ece,_0x577d2a){return db[_0xae6c('0x1b')][_0xae6c('0x1c')](_0x3aa846[_0xae6c('0x1d')],{'raw':_0x3aa846['options']?_0x3aa846[_0xae6c('0x1e')][_0xae6c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa846[_0xae6c('0x1e')]?_0x3aa846[_0xae6c('0x1e')]['where']||null:null,'attributes':_0x3aa846[_0xae6c('0x1e')]?_0x3aa846[_0xae6c('0x1e')][_0xae6c('0x20')]||null:null,'limit':_0x3aa846[_0xae6c('0x1e')]?_0x3aa846['options']['limit']||null:null})['then'](function(_0x10c3f6){logger[_0xae6c('0x11')]('UpdateFaxInteraction',_0x3aa846);logger['debug'](_0xae6c('0x1a'),_0x3aa846,JSON[_0xae6c('0x15')](_0x10c3f6));_0x492ece(_0x10c3f6);})['catch'](function(_0x483a60){logger[_0xae6c('0x16')](_0xae6c('0x1a'),_0x483a60[_0xae6c('0x18')],_0x3aa846);_0x577d2a(_0x2afa84[_0xae6c('0x16')](0x1f4,_0x483a60['message']));});});};exports[_0xae6c('0x21')]=function(_0x170bab){return new Promise(function(_0x42ee87,_0x41632b){return db[_0xae6c('0x1b')][_0xae6c('0x22')]({'where':_0x170bab[_0xae6c('0x1e')]?_0x170bab[_0xae6c('0x1e')][_0xae6c('0x23')]||null:null})[_0xae6c('0x10')](function(_0x7a7ec1){if(_0x7a7ec1){return _0x7a7ec1[_0xae6c('0x24')](_0x170bab[_0xae6c('0x1d')][_0xae6c('0x25')],_[_0xae6c('0x26')](_0x170bab['body'],[_0xae6c('0x25'),'id'])||{});}})[_0xae6c('0x27')](function(_0xe97c78){logger[_0xae6c('0x11')](_0xae6c('0x28'),_0x170bab);logger[_0xae6c('0x29')](_0xae6c('0x28'),_0x170bab,JSON[_0xae6c('0x15')](_0xe97c78));_0x42ee87(_0xe97c78);})[_0xae6c('0x19')](function(_0x228acd){logger[_0xae6c('0x16')](_0xae6c('0x28'),_0x228acd[_0xae6c('0x18')],_0x170bab);_0x41632b(_this['error'](0x1f4,_0x228acd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 607c815..d9c5b68 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 _0x992d=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener'];(function(_0xae5ecc,_0x4653cc){var _0x4ee86c=function(_0x2fa76a){while(--_0x2fa76a){_0xae5ecc['push'](_0xae5ecc['shift']());}};_0x4ee86c(++_0x4653cc);}(_0x992d,0x18a));var _0xd992=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x992d[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require(_0xd992('0x0'));var events=[_0xd992('0x1'),_0xd992('0x2'),_0xd992('0x3')];function createListener(_0x2dd12e,_0x1aae4f){return function(_0x458b2c){_0x1aae4f[_0xd992('0x4')](_0x2dd12e,_0x458b2c);};}function removeListener(_0x2588a8,_0x343a49){return function(){FaxInteractionEvents[_0xd992('0x5')](_0x2588a8,_0x343a49);};}exports['register']=function(_0x3ecce6){for(var _0x2d2001=0x0,_0x58e09a=events[_0xd992('0x6')];_0x2d2001<_0x58e09a;_0x2d2001++){var _0x287b64=events[_0x2d2001];var _0x31062a=createListener(_0xd992('0x7')+_0x287b64,_0x3ecce6);FaxInteractionEvents['on'](_0x287b64,_0x31062a);}}; \ No newline at end of file +var _0xf20b=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x2461cb,_0x3eb56f){var _0x32b060=function(_0xd7f724){while(--_0xd7f724){_0x2461cb['push'](_0x2461cb['shift']());}};_0x32b060(++_0x3eb56f);}(_0xf20b,0x119));var _0xbf20=function(_0x41e7f1,_0x430acc){_0x41e7f1=_0x41e7f1-0x0;var _0x5ada7a=_0xf20b[_0x41e7f1];return _0x5ada7a;};'use strict';var FaxInteractionEvents=require(_0xbf20('0x0'));var events=[_0xbf20('0x1'),_0xbf20('0x2'),_0xbf20('0x3')];function createListener(_0x78947a,_0x2bef1a){return function(_0x714e53){_0x2bef1a[_0xbf20('0x4')](_0x78947a,_0x714e53);};}function removeListener(_0x1c3c25,_0x16fc82){return function(){FaxInteractionEvents[_0xbf20('0x5')](_0x1c3c25,_0x16fc82);};}exports[_0xbf20('0x6')]=function(_0x4d7f0a){for(var _0x2183ee=0x0,_0x15d883=events[_0xbf20('0x7')];_0x2183ee<_0x15d883;_0x2183ee++){var _0x411157=events[_0x2183ee];var _0x250163=createListener(_0xbf20('0x8')+_0x411157,_0x4d7f0a);FaxInteractionEvents['on'](_0x411157,_0x250163);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index e726734..1255e89 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 _0xa73a=['create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','post'];(function(_0x1d432d,_0x401149){var _0x338acb=function(_0x194623){while(--_0x194623){_0x1d432d['push'](_0x1d432d['shift']());}};_0x338acb(++_0x401149);}(_0xa73a,0x82));var _0xaa73=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xa73a[_0x218972];return _0x1bb1a8;};'use strict';var multer=require('multer');var util=require(_0xaa73('0x0'));var path=require(_0xaa73('0x1'));var timeout=require(_0xaa73('0x2'));var express=require(_0xaa73('0x3'));var router=express[_0xaa73('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaa73('0x5'));var controller=require(_0xaa73('0x6'));router[_0xaa73('0x7')]('/',auth[_0xaa73('0x8')](),controller[_0xaa73('0x9')]);router[_0xaa73('0x7')](_0xaa73('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xaa73('0x7')](_0xaa73('0xb'),auth[_0xaa73('0x8')](),controller[_0xaa73('0xc')]);router[_0xaa73('0x7')](_0xaa73('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0xaa73('0x7')]('/:id/download',auth[_0xaa73('0x8')](),controller['download']);router[_0xaa73('0xe')]('/',auth[_0xaa73('0x8')](),controller[_0xaa73('0xf')]);router[_0xaa73('0xe')](_0xaa73('0xd'),auth[_0xaa73('0x8')](),controller['addMessage']);router[_0xaa73('0xe')](_0xaa73('0x10'),auth[_0xaa73('0x8')](),interaction[_0xaa73('0x11')](_0xaa73('0x12'),_0xaa73('0x13')),controller[_0xaa73('0x14')]);router[_0xaa73('0x15')](_0xaa73('0xb'),auth['isAuthenticated'](),interaction[_0xaa73('0x11')]('fax',_0xaa73('0x16')),controller[_0xaa73('0x17')]);router[_0xaa73('0x18')]('/:id',auth['isAuthenticated'](),interaction[_0xaa73('0x11')]('fax',_0xaa73('0x19')),controller[_0xaa73('0x1a')]);router['delete'](_0xaa73('0x10'),auth[_0xaa73('0x8')](),controller[_0xaa73('0x1b')]);module[_0xaa73('0x1c')]=router; \ No newline at end of file +var _0x5f71=['fax','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','/:id','show','getMessages','/:id/download','post','create','/:id/tags','tracked'];(function(_0x5a0426,_0x4a98c6){var _0x1012d0=function(_0x2de3df){while(--_0x2de3df){_0x5a0426['push'](_0x5a0426['shift']());}};_0x1012d0(++_0x4a98c6);}(_0x5f71,0xf9));var _0x15f7=function(_0xf5f2ef,_0x2a4987){_0xf5f2ef=_0xf5f2ef-0x0;var _0x2cc18f=_0x5f71[_0xf5f2ef];return _0x2cc18f;};'use strict';var multer=require(_0x15f7('0x0'));var util=require(_0x15f7('0x1'));var path=require(_0x15f7('0x2'));var timeout=require(_0x15f7('0x3'));var express=require(_0x15f7('0x4'));var router=express[_0x15f7('0x5')]();var fs_extra=require(_0x15f7('0x6'));var auth=require(_0x15f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x15f7('0x8'));var controller=require(_0x15f7('0x9'));router[_0x15f7('0xa')]('/',auth[_0x15f7('0xb')](),controller['index']);router[_0x15f7('0xa')]('/describe',auth[_0x15f7('0xb')](),controller[_0x15f7('0xc')]);router[_0x15f7('0xa')](_0x15f7('0xd'),auth[_0x15f7('0xb')](),controller[_0x15f7('0xe')]);router[_0x15f7('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x15f7('0xf')]);router[_0x15f7('0xa')](_0x15f7('0x10'),auth[_0x15f7('0xb')](),controller['download']);router[_0x15f7('0x11')]('/',auth['isAuthenticated'](),controller[_0x15f7('0x12')]);router[_0x15f7('0x11')]('/:id/messages',auth[_0x15f7('0xb')](),controller['addMessage']);router['post'](_0x15f7('0x13'),auth['isAuthenticated'](),interaction[_0x15f7('0x14')](_0x15f7('0x15'),'faxinteraction:addtags'),controller[_0x15f7('0x16')]);router[_0x15f7('0x17')]('/:id',auth[_0x15f7('0xb')](),interaction[_0x15f7('0x14')](_0x15f7('0x15'),_0x15f7('0x18')),controller[_0x15f7('0x19')]);router['delete'](_0x15f7('0xd'),auth[_0x15f7('0xb')](),interaction[_0x15f7('0x14')](_0x15f7('0x15'),_0x15f7('0x1a')),controller[_0x15f7('0x1b')]);router[_0x15f7('0x1c')]('/:id/tags',auth[_0x15f7('0xb')](),controller['removeTags']);module[_0x15f7('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 5431fa0..34e6d36 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 _0x9d92=['DATE','sequelize','medium','BOOLEAN','out','TEXT'];(function(_0x2ef644,_0x2ab0ff){var _0x11f00e=function(_0x32983a){while(--_0x32983a){_0x2ef644['push'](_0x2ef644['shift']());}};_0x11f00e(++_0x2ab0ff);}(_0x9d92,0xdf));var _0x29d9=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0x9d92[_0x3fb030];return _0xd6899b;};'use strict';var Sequelize=require(_0x29d9('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x29d9('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x29d9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x29d9('0x3')),'defaultValue':_0x29d9('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x29d9('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x29d9('0x5')]}}; \ No newline at end of file +var _0x447b=['ENUM','out','TEXT','DATE','sequelize','exports','medium','BOOLEAN'];(function(_0x43f343,_0x3f5853){var _0x42d383=function(_0x4a6f75){while(--_0x4a6f75){_0x43f343['push'](_0x43f343['shift']());}};_0x42d383(++_0x3f5853);}(_0x447b,0xe4));var _0xb447=function(_0x1bec9e,_0x168154){_0x1bec9e=_0x1bec9e-0x0;var _0x50e54d=_0x447b[_0x1bec9e];return _0x50e54d;};'use strict';var Sequelize=require(_0xb447('0x0'));module[_0xb447('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb447('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb447('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb447('0x4')]('in',_0xb447('0x5')),'defaultValue':_0xb447('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xb447('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb447('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index ca38f50..80b9c1f 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 _0xf875=['SELECT','contact','User','fullname','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','FaxMessage,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','keys','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes'];(function(_0x1b850f,_0x513152){var _0x3d9f10=function(_0x587dbd){while(--_0x587dbd){_0x1b850f['push'](_0x1b850f['shift']());}};_0x3d9f10(++_0x513152);}(_0xf875,0xaf));var _0x5f87=function(_0x33ed22,_0xf2f14){_0x33ed22=_0x33ed22-0x0;var _0x30392b=_0xf875[_0x33ed22];return _0x30392b;};'use strict';var emlformat=require(_0x5f87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f87('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f87('0x2'));var moment=require(_0x5f87('0x3'));var BPromise=require(_0x5f87('0x4'));var Mustache=require(_0x5f87('0x5'));var util=require(_0x5f87('0x6'));var path=require(_0x5f87('0x7'));var sox=require('sox');var csv=require(_0x5f87('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f87('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5f87('0xa'));var deskjs=require(_0x5f87('0xb'));var toCsv=require(_0x5f87('0x8'));var querystring=require(_0x5f87('0xc'));var Papa=require(_0x5f87('0xd'));var Redis=require(_0x5f87('0xe'));var authService=require(_0x5f87('0xf'));var qs=require(_0x5f87('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f87('0x11'));var logger=require(_0x5f87('0x12'))(_0x5f87('0x13'));var utils=require(_0x5f87('0x14'));var config=require(_0x5f87('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x5f87('0x16')],{'host':_0x5f87('0x17'),'port':0x18eb});var socket=require(_0x5f87('0x18'))(new Redis(config[_0x5f87('0x16')]));require(_0x5f87('0x19'))[_0x5f87('0x1a')](socket);var jayson=require(_0x5f87('0x1b'));var client=jayson[_0x5f87('0x1c')][_0x5f87('0x1d')]({'port':0x232c});var client9002=jayson[_0x5f87('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bd815,_0x244fd4,_0x3c8cc4,_0x1073b7){return new BPromise(function(_0x43b245,_0x5eeb0f){var _0x2105c8=_0x1073b7||client;return _0x2105c8[_0x5f87('0x1e')](_0x3bd815,_0x3c8cc4)[_0x5f87('0x1f')](function(_0x2a4e77){logger['info']('FaxMessage,\x20%s,\x20%s',_0x244fd4,_0x5f87('0x20'));logger[_0x5f87('0x21')](_0x5f87('0x22'),_0x244fd4,_0x5f87('0x20'),JSON['stringify'](_0x2a4e77));if(_0x2a4e77[_0x5f87('0x23')]){if(_0x2a4e77[_0x5f87('0x23')]['code']===0x1f4){logger[_0x5f87('0x23')]('FaxMessage,\x20%s,\x20%s',_0x244fd4,_0x2a4e77[_0x5f87('0x23')][_0x5f87('0x24')]);return _0x5eeb0f(_0x2a4e77[_0x5f87('0x23')]['message']);}logger[_0x5f87('0x23')](_0x5f87('0x25'),_0x244fd4,_0x2a4e77[_0x5f87('0x23')]['message']);return _0x43b245(_0x2a4e77[_0x5f87('0x23')][_0x5f87('0x24')]);}else{logger[_0x5f87('0x26')](_0x5f87('0x25'),_0x244fd4,'request\x20sent');_0x43b245(_0x2a4e77[_0x5f87('0x27')][_0x5f87('0x24')]);}})[_0x5f87('0x28')](function(_0x8827d0){logger[_0x5f87('0x23')]('FaxMessage,\x20%s,\x20%s',_0x244fd4,_0x8827d0);_0x5eeb0f(_0x8827d0);});});}function respondWithStatusCode(_0x1e8436,_0x35c749){_0x35c749=_0x35c749||0xcc;return function(_0x136ca9){if(_0x136ca9){return _0x1e8436[_0x5f87('0x29')](_0x35c749);}return _0x1e8436[_0x5f87('0x2a')](_0x35c749)[_0x5f87('0x2b')]();};}function respondWithResult(_0x3ef49f,_0xf45bd4){_0xf45bd4=_0xf45bd4||0xc8;return function(_0x26cbe4){if(_0x26cbe4){return _0x3ef49f[_0x5f87('0x2a')](_0xf45bd4)[_0x5f87('0x2c')](_0x26cbe4);}};}function respondWithFilteredResult(_0x481107,_0x4927e8){return function(_0x49072c){if(_0x49072c){var _0x19b987=typeof _0x4927e8[_0x5f87('0x2d')]===_0x5f87('0x2e')&&typeof _0x4927e8[_0x5f87('0x2f')]===_0x5f87('0x2e');var _0x29d5c6=_0x49072c[_0x5f87('0x30')];var _0x364feb=_0x19b987?0x0:_0x4927e8[_0x5f87('0x2d')];var _0x3b0741=_0x19b987?_0x49072c['count']:_0x4927e8[_0x5f87('0x2d')]+_0x4927e8[_0x5f87('0x2f')];var _0x3ba4d4;if(_0x3b0741>=_0x29d5c6){_0x3b0741=_0x29d5c6;_0x3ba4d4=0xc8;}else{_0x3ba4d4=0xce;}_0x481107['status'](_0x3ba4d4);return _0x481107[_0x5f87('0x31')](_0x5f87('0x32'),_0x364feb+'-'+_0x3b0741+'/'+_0x29d5c6)['json'](_0x49072c);}return null;};}function patchUpdates(_0x4b567d){return function(_0x1bdba6){try{jsonpatch[_0x5f87('0x33')](_0x1bdba6,_0x4b567d,!![]);}catch(_0x6c62d){return BPromise[_0x5f87('0x34')](_0x6c62d);}return _0x1bdba6[_0x5f87('0x35')]();};}function saveUpdates(_0xe33189,_0xa6ad8){return function(_0x57eb36){if(_0x57eb36){return _0x57eb36[_0x5f87('0x36')](_0xe33189)['then'](function(_0x4dc773){return _0x4dc773;});}return null;};}function removeEntity(_0x203577,_0x5a6b4d){return function(_0x2a86f2){if(_0x2a86f2){return _0x2a86f2[_0x5f87('0x37')]()[_0x5f87('0x1f')](function(){_0x203577[_0x5f87('0x2a')](0xcc)[_0x5f87('0x2b')]();});}};}function handleEntityNotFound(_0x503c99,_0x2063e7){return function(_0x57977d){if(!_0x57977d){_0x503c99[_0x5f87('0x29')](0x194);}return _0x57977d;};}function handleError(_0x506561,_0x102919){_0x102919=_0x102919||0x1f4;return function(_0x5a11f6){logger[_0x5f87('0x23')](_0x5a11f6[_0x5f87('0x38')]);if(_0x5a11f6['name']){delete _0x5a11f6[_0x5f87('0x39')];}_0x506561['status'](_0x102919)[_0x5f87('0x3a')](_0x5a11f6);};}exports[_0x5f87('0x3b')]=function(_0x183eb7,_0x5619fd){var _0x331b09={},_0x31995f={},_0x420d7d={'count':0x0,'rows':[]};var _0x11d1f7=_[_0x5f87('0x3c')](db[_0x5f87('0x3d')][_0x5f87('0x3e')],function(_0x126a0e){return{'name':_0x126a0e[_0x5f87('0x3f')],'type':_0x126a0e[_0x5f87('0x40')][_0x5f87('0x41')]};});_0x31995f[_0x5f87('0x42')]=_[_0x5f87('0x3c')](_0x11d1f7,'name');_0x31995f['query']=_['keys'](_0x183eb7[_0x5f87('0x43')]);_0x31995f[_0x5f87('0x44')]=_[_0x5f87('0x45')](_0x31995f['model'],_0x31995f[_0x5f87('0x43')]);_0x331b09[_0x5f87('0x46')]=_[_0x5f87('0x45')](_0x31995f[_0x5f87('0x42')],qs[_0x5f87('0x47')](_0x183eb7[_0x5f87('0x43')][_0x5f87('0x47')]));_0x331b09['attributes']=_0x331b09['attributes'][_0x5f87('0x48')]?_0x331b09[_0x5f87('0x46')]:_0x31995f[_0x5f87('0x42')];if(!_0x183eb7[_0x5f87('0x43')][_0x5f87('0x49')](_0x5f87('0x4a'))){_0x331b09[_0x5f87('0x2f')]=qs['limit'](_0x183eb7['query'][_0x5f87('0x2f')]);_0x331b09[_0x5f87('0x2d')]=qs['offset'](_0x183eb7['query']['offset']);}_0x331b09[_0x5f87('0x4b')]=qs[_0x5f87('0x4c')](_0x183eb7['query']['sort']);_0x331b09[_0x5f87('0x4d')]=qs['filters'](_[_0x5f87('0x4e')](_0x183eb7[_0x5f87('0x43')],_0x31995f['filters']),_0x11d1f7);if(_0x183eb7[_0x5f87('0x43')]['filter']){_0x331b09['where']=_['merge'](_0x331b09[_0x5f87('0x4d')],{'$or':_[_0x5f87('0x3c')](_0x11d1f7,function(_0x5b3c9b){if(_0x5b3c9b[_0x5f87('0x40')]!==_0x5f87('0x4f')){var _0x1e02cc={};_0x1e02cc[_0x5b3c9b['name']]={'$like':'%'+_0x183eb7[_0x5f87('0x43')][_0x5f87('0x50')]+'%'};return _0x1e02cc;}})});}_0x331b09=_[_0x5f87('0x51')]({},_0x331b09,_0x183eb7[_0x5f87('0x52')]);var _0x20f41f={'where':_0x331b09[_0x5f87('0x4d')]};return db['FaxMessage'][_0x5f87('0x30')](_0x20f41f)[_0x5f87('0x1f')](function(_0x57b6b6){_0x420d7d['count']=_0x57b6b6;if(_0x183eb7[_0x5f87('0x43')][_0x5f87('0x53')]){_0x331b09[_0x5f87('0x54')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x331b09);})['then'](function(_0x4e06c8){_0x420d7d[_0x5f87('0x55')]=_0x4e06c8;return _0x420d7d;})[_0x5f87('0x1f')](respondWithFilteredResult(_0x5619fd,_0x331b09))[_0x5f87('0x28')](handleError(_0x5619fd,null));};exports[_0x5f87('0x56')]=function(_0x550879,_0x857e98){var _0x563a54={'raw':!![],'where':{'id':_0x550879[_0x5f87('0x57')]['id']}},_0x33a822={};_0x33a822[_0x5f87('0x42')]=_[_0x5f87('0x58')](db[_0x5f87('0x3d')][_0x5f87('0x3e')]);_0x33a822[_0x5f87('0x43')]=_[_0x5f87('0x58')](_0x550879[_0x5f87('0x43')]);_0x33a822[_0x5f87('0x44')]=_[_0x5f87('0x45')](_0x33a822['model'],_0x33a822[_0x5f87('0x43')]);_0x563a54[_0x5f87('0x46')]=_['intersection'](_0x33a822[_0x5f87('0x42')],qs[_0x5f87('0x47')](_0x550879['query'][_0x5f87('0x47')]));_0x563a54['attributes']=_0x563a54[_0x5f87('0x46')][_0x5f87('0x48')]?_0x563a54[_0x5f87('0x46')]:_0x33a822[_0x5f87('0x42')];if(_0x550879[_0x5f87('0x43')][_0x5f87('0x53')]){_0x563a54['include']=[{'all':!![]}];}_0x563a54=_[_0x5f87('0x51')]({},_0x563a54,_0x550879[_0x5f87('0x52')]);return db[_0x5f87('0x3d')][_0x5f87('0x59')](_0x563a54)['then'](handleEntityNotFound(_0x857e98,null))[_0x5f87('0x1f')](respondWithResult(_0x857e98,null))[_0x5f87('0x28')](handleError(_0x857e98,null));};exports['update']=function(_0x55dacb,_0x187a95){if(_0x55dacb[_0x5f87('0x5a')]['id']){delete _0x55dacb['body']['id'];}return db[_0x5f87('0x3d')]['find']({'where':{'id':_0x55dacb[_0x5f87('0x57')]['id']}})[_0x5f87('0x1f')](handleEntityNotFound(_0x187a95,null))[_0x5f87('0x1f')](saveUpdates(_0x55dacb[_0x5f87('0x5a')],null))[_0x5f87('0x1f')](respondWithResult(_0x187a95,null))[_0x5f87('0x28')](handleError(_0x187a95,null));};exports[_0x5f87('0x37')]=function(_0x1031ef,_0x3afc05){return db[_0x5f87('0x3d')][_0x5f87('0x59')]({'where':{'id':_0x1031ef['params']['id']}})[_0x5f87('0x1f')](handleEntityNotFound(_0x3afc05,null))['then'](removeEntity(_0x3afc05,null))[_0x5f87('0x28')](handleError(_0x3afc05,null));};exports['describe']=function(_0x5bd0b7,_0x21b06e){return db[_0x5f87('0x3d')][_0x5f87('0x5b')]()[_0x5f87('0x1f')](respondWithResult(_0x21b06e,null))['catch'](handleError(_0x21b06e,null));};var interaction_log=require(_0x5f87('0x12'))(_0x5f87('0x5c'));exports[_0x5f87('0x5d')]=function(_0x4b2a80,_0x42aae7,_0x4ed0bf){var _0x50b625={'agent':{},'channel':_0x5f87('0x5e')};if(_0x4b2a80['body']['id']){delete _0x4b2a80[_0x5f87('0x5a')]['id'];}_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x5f')]=!![];_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x60')]=moment()[_0x5f87('0x61')](_0x5f87('0x62'));_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x63')]=_0x4b2a80[_0x5f87('0x5a')]['UserId']||_0x4b2a80[_0x5f87('0x64')]['id'];_0x50b625[_0x5f87('0x65')]['id']=_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x63')];return db['FaxMessage']['find']({'where':{'id':_0x4b2a80['params']['id'],'UserId':null}})[_0x5f87('0x1f')](handleEntityNotFound(_0x42aae7,null))[_0x5f87('0x1f')](saveUpdates(_0x4b2a80[_0x5f87('0x5a')],null))[_0x5f87('0x1f')](function(_0x27a5ca){if(_0x27a5ca){_0x50b625[_0x5f87('0x24')]=_0x27a5ca[_0x5f87('0x66')]({'plain':!![]});return db[_0x5f87('0x67')][_0x5f87('0x59')]({'where':{'id':_0x27a5ca[_0x5f87('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x42aae7,null))[_0x5f87('0x1f')](function(_0x159959){if(_0x159959){return _0x159959[_0x5f87('0x36')]({'UserId':_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x63')],'read1stAt':_[_0x5f87('0x69')](_0x159959['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5f87('0x1f')](function(_0x39dc9a){if(_0x39dc9a){_0x50b625[_0x5f87('0x6a')]=_0x39dc9a[_0x5f87('0x66')]({'plain':!![]});interaction_log[_0x5f87('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4b2a80['user']['id'],_0x4b2a80[_0x5f87('0x64')][_0x5f87('0x39')],_0x4b2a80[_0x5f87('0x64')][_0x5f87('0x6b')],_0x50b625[_0x5f87('0x6a')]['id'],_0x4b2a80['body']?JSON[_0x5f87('0x6c')](_0x4b2a80[_0x5f87('0x5a')]):_0x5f87('0x6d'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x50b625);}return null;})[_0x5f87('0x1f')](function(_0x2c9c92){var _0x2f095f=_0x5f87('0x6e')+_0x2c9c92[_0x5f87('0x24')][_0x5f87('0x6f')];return db[_0x5f87('0x70')]['query'](_0x2f095f,{'type':db[_0x5f87('0x71')][_0x5f87('0x72')][_0x5f87('0x73')],'raw':!![]})[_0x5f87('0x1f')](function(_0x42f294){return _0x42f294;});})[_0x5f87('0x1f')](function(_0x16fe69){if(_0x16fe69){_0x50b625[_0x5f87('0x24')][_0x5f87('0x74')]=_0x16fe69[0x0];if(!_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x63')])return;return db[_0x5f87('0x75')][_0x5f87('0x59')]({'where':{'id':_0x4b2a80[_0x5f87('0x5a')][_0x5f87('0x63')],'role':_0x5f87('0x65')},'attributes':['id',_0x5f87('0x39'),_0x5f87('0x76'),_0x5f87('0x77'),_0x5f87('0x78')],'raw':!![]});}return null;})[_0x5f87('0x1f')](function(_0x185f3b){if(!_0x185f3b)return null;_0x50b625['message']['agent']=_0x185f3b;return _0x50b625;})['then'](function(_0x1879b5){if(_0x1879b5){if(_0x4b2a80[_0x5f87('0x5a')]['manual']){_0x50b625[_0x5f87('0x24')]['interface']=util['format'](_0x5f87('0x79'),_0x4b2a80['user']['name']);_0x50b625[_0x5f87('0x24')]['channel']=_0x50b625[_0x5f87('0x7a')];_0x50b625[_0x5f87('0x24')][_0x5f87('0x7b')]=_0x50b625[_0x5f87('0x7a')];_0x50b625[_0x5f87('0x24')][_0x5f87('0x7c')]=_0x5f87('0x5d');return respondWithRpcPromise(_0x5f87('0x7d'),_0x5f87('0x7d'),{'event':_0x5f87('0x7e'),'message':_0x50b625[_0x5f87('0x24')]},client9002)[_0x5f87('0x1f')](function(){return _0x50b625;});}return _0x50b625;}return null;})['then'](respondWithResult(_0x42aae7,null))['catch'](handleError(_0x42aae7,null));};var interaction_log=require(_0x5f87('0x12'))(_0x5f87('0x5c'));exports[_0x5f87('0x34')]=function(_0x17448b,_0x16cca8,_0x3c2396){var _0x55a43b={'agent':{},'channel':_0x5f87('0x5e')};if(_0x17448b['body']['id']){delete _0x17448b[_0x5f87('0x5a')]['id'];}_0x17448b[_0x5f87('0x5a')][_0x5f87('0x63')]=_0x17448b[_0x5f87('0x5a')][_0x5f87('0x63')]||_0x17448b[_0x5f87('0x64')]['id'];_0x55a43b[_0x5f87('0x65')]['id']=_0x17448b[_0x5f87('0x5a')][_0x5f87('0x63')];return db[_0x5f87('0x3d')][_0x5f87('0x59')]({'where':{'id':_0x17448b[_0x5f87('0x57')]['id'],'UserId':null}})[_0x5f87('0x1f')](handleEntityNotFound(_0x16cca8,null))[_0x5f87('0x1f')](function(_0x1c05a4){if(_0x1c05a4){_0x55a43b[_0x5f87('0x24')]=_0x1c05a4[_0x5f87('0x66')]({'plain':!![]});return db[_0x5f87('0x67')][_0x5f87('0x59')]({'where':{'id':_0x1c05a4['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x16cca8,null))[_0x5f87('0x1f')](function(_0x4fb21a){if(_0x4fb21a){_0x55a43b[_0x5f87('0x6a')]=_0x4fb21a[_0x5f87('0x66')]({'plain':!![]});interaction_log[_0x5f87('0x26')](_0x5f87('0x7f'),_0x17448b['user']['id'],_0x17448b[_0x5f87('0x64')][_0x5f87('0x39')],_0x17448b[_0x5f87('0x64')][_0x5f87('0x6b')],_0x55a43b[_0x5f87('0x6a')]['id'],_0x17448b[_0x5f87('0x5a')]?JSON[_0x5f87('0x6c')](_0x17448b['body']):_0x5f87('0x6d'));return respondWithRpcPromise('RejectMessage',_0x5f87('0x80'),_0x55a43b);}return null;})[_0x5f87('0x1f')](function(_0x29d971){var _0x277e89='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x29d971['message'][_0x5f87('0x6f')];return db[_0x5f87('0x70')][_0x5f87('0x43')](_0x277e89,{'type':db[_0x5f87('0x71')][_0x5f87('0x72')][_0x5f87('0x73')],'raw':!![]})[_0x5f87('0x1f')](function(_0x332418){return _0x332418;});})[_0x5f87('0x1f')](function(_0x32e288){if(_0x32e288){_0x55a43b[_0x5f87('0x24')][_0x5f87('0x74')]=_0x32e288[0x0];if(!_0x17448b['body']['UserId'])return;return db[_0x5f87('0x75')][_0x5f87('0x59')]({'where':{'id':_0x17448b['body'][_0x5f87('0x63')],'role':_0x5f87('0x65')},'attributes':['id',_0x5f87('0x39'),'fullname',_0x5f87('0x77'),'internal'],'raw':!![]});}return null;})[_0x5f87('0x1f')](function(_0x45e5ab){if(!_0x45e5ab)return null;_0x55a43b['message'][_0x5f87('0x65')]=_0x45e5ab;return _0x55a43b;})[_0x5f87('0x1f')](function(_0x113ff0){if(_0x113ff0){_0x113ff0[_0x5f87('0x24')]['interface']=util[_0x5f87('0x61')]('SIP/%s',_0x17448b['user']['name']);_0x113ff0['message'][_0x5f87('0x7a')]=_0x55a43b['channel'];_0x113ff0[_0x5f87('0x24')][_0x5f87('0x7b')]=_0x55a43b[_0x5f87('0x7a')];_0x113ff0['message'][_0x5f87('0x7c')]=_0x5f87('0x34');respondWithRpcPromise(_0x5f87('0x7d'),_0x5f87('0x7d'),{'event':_0x5f87('0x81'),'message':_0x113ff0[_0x5f87('0x24')]},client9002);return _0x55a43b;}return null;})[_0x5f87('0x1f')](respondWithResult(_0x16cca8,null))[_0x5f87('0x28')](handleError(_0x16cca8,null));};exports[_0x5f87('0x82')]=function(_0x31c439,_0x262f7c){var _0x25ba1a;return db[_0x5f87('0x3d')]['create'](_0x31c439[_0x5f87('0x5a')],{})['then'](function(_0x9ae842){_0x25ba1a=_0x9ae842;return db[_0x5f87('0x83')][_0x5f87('0x84')]({'where':{'id':_0x25ba1a[_0x5f87('0x6f')]}});})[_0x5f87('0x1f')](function(_0x44de12){if(_[_0x5f87('0x69')](_0x44de12)){return;}else{_0x25ba1a[_0x5f87('0x5e')]=_0x44de12[_0x5f87('0x5e')];return db[_0x5f87('0x85')][_0x5f87('0x84')]({'where':{'id':_0x25ba1a[_0x5f87('0x86')]}});}})[_0x5f87('0x1f')](function(_0x241adb){return respondWithRpcPromise(_0x5f87('0x87'),'SendFax',{'FaxAccountId':_[_0x5f87('0x69')](_0x31c439[_0x5f87('0x5a')])?undefined:_0x31c439[_0x5f87('0x5a')][_0x5f87('0x88')],'path':_[_0x5f87('0x69')](_0x241adb)?undefined:util[_0x5f87('0x61')](_0x5f87('0x89'),_0x241adb[_0x5f87('0x8a')]),'fax':_[_0x5f87('0x69')](_0x25ba1a[_0x5f87('0x5e')])?undefined:_0x25ba1a['fax'],'AttachmentId':_0x25ba1a[_0x5f87('0x86')]},client9002);})[_0x5f87('0x1f')](respondWithResult(_0x262f7c,0xc9))[_0x5f87('0x28')](handleError(_0x262f7c,null));};exports[_0x5f87('0x8b')]=function(_0x233578,_0x321b28){var _0x176345=path[_0x5f87('0x8c')](config[_0x5f87('0x8d')],_0x5f87('0x8e'),_0x5f87('0x8f'),_0x5f87('0x90'));return db[_0x5f87('0x3d')]['find']({'where':{'id':_0x233578[_0x5f87('0x57')]['id']},'include':[{'model':db[_0x5f87('0x85')],'as':_0x5f87('0x85')}]})[_0x5f87('0x1f')](handleEntityNotFound(_0x321b28,null))[_0x5f87('0x1f')](function(_0xb3b55c){if(_0xb3b55c){return _0x321b28[_0x5f87('0x8b')](path[_0x5f87('0x8c')](_0x176345,_0xb3b55c[_0x5f87('0x85')]['basename']));}})[_0x5f87('0x28')](handleError(_0x321b28,null));}; \ No newline at end of file +var _0x6b71=['destroy','end','stack','name','index','map','FaxMessage','rawAttributes','type','key','query','keys','filters','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','find','body','describe','fax-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','fax','FaxInteraction','FaxInteractionId','RejectMessage','rejectMessage','Sequelize','QueryTypes','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','isNil','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxMessage.socket','http','client','request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then'];(function(_0x32b894,_0x14c458){var _0x1f4d76=function(_0x4737af){while(--_0x4737af){_0x32b894['push'](_0x32b894['shift']());}};_0x1f4d76(++_0x14c458);}(_0x6b71,0x17f));var _0x16b7=function(_0x49192e,_0x4739a3){_0x49192e=_0x49192e-0x0;var _0x4ba592=_0x6b71[_0x49192e];return _0x4ba592;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x16b7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16b7('0x1'));var rp=require('request-promise');var moment=require(_0x16b7('0x2'));var BPromise=require(_0x16b7('0x3'));var Mustache=require(_0x16b7('0x4'));var util=require(_0x16b7('0x5'));var path=require(_0x16b7('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x16b7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x16b7('0x8'));var squel=require(_0x16b7('0x9'));var crypto=require(_0x16b7('0xa'));var jsforce=require(_0x16b7('0xb'));var deskjs=require(_0x16b7('0xc'));var toCsv=require(_0x16b7('0xd'));var querystring=require(_0x16b7('0xe'));var Papa=require(_0x16b7('0xf'));var Redis=require(_0x16b7('0x10'));var authService=require(_0x16b7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x16b7('0x12'));var hardwareService=require(_0x16b7('0x13'));var logger=require(_0x16b7('0x14'))(_0x16b7('0x15'));var utils=require(_0x16b7('0x16'));var config=require(_0x16b7('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x16b7('0x18')],{'host':_0x16b7('0x19'),'port':0x18eb});var socket=require(_0x16b7('0x1a'))(new Redis(config[_0x16b7('0x18')]));require(_0x16b7('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x16b7('0x1c')]({'port':0x232c});var client9002=jayson[_0x16b7('0x1d')][_0x16b7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4bc527,_0x3e3646,_0x5b6cea,_0x39f763){return new BPromise(function(_0x56cd08,_0x12c143){var _0x53e4c9=_0x39f763||client;return _0x53e4c9[_0x16b7('0x1e')](_0x4bc527,_0x5b6cea)['then'](function(_0x19703c){logger[_0x16b7('0x1f')](_0x16b7('0x20'),_0x3e3646,'request\x20sent');logger[_0x16b7('0x21')](_0x16b7('0x22'),_0x3e3646,_0x16b7('0x23'),JSON['stringify'](_0x19703c));if(_0x19703c['error']){if(_0x19703c[_0x16b7('0x24')][_0x16b7('0x25')]===0x1f4){logger[_0x16b7('0x24')]('FaxMessage,\x20%s,\x20%s',_0x3e3646,_0x19703c['error']['message']);return _0x12c143(_0x19703c['error'][_0x16b7('0x26')]);}logger['error'](_0x16b7('0x20'),_0x3e3646,_0x19703c[_0x16b7('0x24')][_0x16b7('0x26')]);return _0x56cd08(_0x19703c['error'][_0x16b7('0x26')]);}else{logger[_0x16b7('0x1f')](_0x16b7('0x20'),_0x3e3646,_0x16b7('0x23'));_0x56cd08(_0x19703c[_0x16b7('0x27')]['message']);}})[_0x16b7('0x28')](function(_0x46c1c6){logger[_0x16b7('0x24')](_0x16b7('0x20'),_0x3e3646,_0x46c1c6);_0x12c143(_0x46c1c6);});});}function respondWithStatusCode(_0x4ae413,_0x42e284){_0x42e284=_0x42e284||0xcc;return function(_0x2b444c){if(_0x2b444c){return _0x4ae413[_0x16b7('0x29')](_0x42e284);}return _0x4ae413[_0x16b7('0x2a')](_0x42e284)['end']();};}function respondWithResult(_0x24eded,_0x111b85){_0x111b85=_0x111b85||0xc8;return function(_0x4943a8){if(_0x4943a8){return _0x24eded[_0x16b7('0x2a')](_0x111b85)[_0x16b7('0x2b')](_0x4943a8);}};}function respondWithFilteredResult(_0x111f5f,_0x3b26da){return function(_0x1189ba){if(_0x1189ba){var _0x232aeb=typeof _0x3b26da[_0x16b7('0x2c')]==='undefined'&&typeof _0x3b26da[_0x16b7('0x2d')]===_0x16b7('0x2e');var _0xcffe2f=_0x1189ba[_0x16b7('0x2f')];var _0x3c8c67=_0x232aeb?0x0:_0x3b26da[_0x16b7('0x2c')];var _0x3f5777=_0x232aeb?_0x1189ba[_0x16b7('0x2f')]:_0x3b26da[_0x16b7('0x2c')]+_0x3b26da[_0x16b7('0x2d')];var _0x96d991;if(_0x3f5777>=_0xcffe2f){_0x3f5777=_0xcffe2f;_0x96d991=0xc8;}else{_0x96d991=0xce;}_0x111f5f[_0x16b7('0x2a')](_0x96d991);return _0x111f5f[_0x16b7('0x30')](_0x16b7('0x31'),_0x3c8c67+'-'+_0x3f5777+'/'+_0xcffe2f)[_0x16b7('0x2b')](_0x1189ba);}return null;};}function patchUpdates(_0x4efe87){return function(_0xf5c831){try{jsonpatch[_0x16b7('0x32')](_0xf5c831,_0x4efe87,!![]);}catch(_0x2276f6){return BPromise[_0x16b7('0x33')](_0x2276f6);}return _0xf5c831[_0x16b7('0x34')]();};}function saveUpdates(_0x5a2fea,_0x5bbb17){return function(_0x497510){if(_0x497510){return _0x497510[_0x16b7('0x35')](_0x5a2fea)[_0x16b7('0x36')](function(_0x56126f){return _0x56126f;});}return null;};}function removeEntity(_0x243305,_0x4ceeda){return function(_0x41d433){if(_0x41d433){return _0x41d433[_0x16b7('0x37')]()[_0x16b7('0x36')](function(){_0x243305[_0x16b7('0x2a')](0xcc)[_0x16b7('0x38')]();});}};}function handleEntityNotFound(_0x25a38b,_0x41a0dd){return function(_0x37e4ae){if(!_0x37e4ae){_0x25a38b[_0x16b7('0x29')](0x194);}return _0x37e4ae;};}function handleError(_0x50e7d3,_0x5d16a6){_0x5d16a6=_0x5d16a6||0x1f4;return function(_0x251c43){logger[_0x16b7('0x24')](_0x251c43[_0x16b7('0x39')]);if(_0x251c43[_0x16b7('0x3a')]){delete _0x251c43[_0x16b7('0x3a')];}_0x50e7d3[_0x16b7('0x2a')](_0x5d16a6)['send'](_0x251c43);};}exports[_0x16b7('0x3b')]=function(_0x1c8ac2,_0xec5c19){var _0x29664e={},_0x338a38={},_0x5191a0={'count':0x0,'rows':[]};var _0x1fdf67=_[_0x16b7('0x3c')](db[_0x16b7('0x3d')][_0x16b7('0x3e')],function(_0xc5233b){return{'name':_0xc5233b['fieldName'],'type':_0xc5233b[_0x16b7('0x3f')][_0x16b7('0x40')]};});_0x338a38['model']=_[_0x16b7('0x3c')](_0x1fdf67,'name');_0x338a38[_0x16b7('0x41')]=_[_0x16b7('0x42')](_0x1c8ac2['query']);_0x338a38[_0x16b7('0x43')]=_['intersection'](_0x338a38['model'],_0x338a38['query']);_0x29664e[_0x16b7('0x44')]=_['intersection'](_0x338a38[_0x16b7('0x45')],qs[_0x16b7('0x46')](_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x46')]));_0x29664e['attributes']=_0x29664e['attributes'][_0x16b7('0x47')]?_0x29664e[_0x16b7('0x44')]:_0x338a38[_0x16b7('0x45')];if(!_0x1c8ac2[_0x16b7('0x41')]['hasOwnProperty'](_0x16b7('0x48'))){_0x29664e[_0x16b7('0x2d')]=qs[_0x16b7('0x2d')](_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x2d')]);_0x29664e['offset']=qs[_0x16b7('0x2c')](_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x2c')]);}_0x29664e[_0x16b7('0x49')]=qs[_0x16b7('0x4a')](_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x4a')]);_0x29664e[_0x16b7('0x4b')]=qs[_0x16b7('0x43')](_['pick'](_0x1c8ac2[_0x16b7('0x41')],_0x338a38[_0x16b7('0x43')]),_0x1fdf67);if(_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x4c')]){_0x29664e[_0x16b7('0x4b')]=_[_0x16b7('0x4d')](_0x29664e[_0x16b7('0x4b')],{'$or':_[_0x16b7('0x3c')](_0x1fdf67,function(_0x2764a6){if(_0x2764a6[_0x16b7('0x3f')]!==_0x16b7('0x4e')){var _0x3e06dd={};_0x3e06dd[_0x2764a6[_0x16b7('0x3a')]]={'$like':'%'+_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x4c')]+'%'};return _0x3e06dd;}})});}_0x29664e=_[_0x16b7('0x4d')]({},_0x29664e,_0x1c8ac2[_0x16b7('0x4f')]);var _0x5aa8d5={'where':_0x29664e[_0x16b7('0x4b')]};return db[_0x16b7('0x3d')]['count'](_0x5aa8d5)[_0x16b7('0x36')](function(_0x10c118){_0x5191a0[_0x16b7('0x2f')]=_0x10c118;if(_0x1c8ac2[_0x16b7('0x41')][_0x16b7('0x50')]){_0x29664e[_0x16b7('0x51')]=[{'all':!![]}];}return db[_0x16b7('0x3d')][_0x16b7('0x52')](_0x29664e);})[_0x16b7('0x36')](function(_0x2e8c22){_0x5191a0[_0x16b7('0x53')]=_0x2e8c22;return _0x5191a0;})[_0x16b7('0x36')](respondWithFilteredResult(_0xec5c19,_0x29664e))[_0x16b7('0x28')](handleError(_0xec5c19,null));};exports[_0x16b7('0x54')]=function(_0x524266,_0x3b6106){var _0x10d8cc={'raw':!![],'where':{'id':_0x524266[_0x16b7('0x55')]['id']}},_0x30cc44={};_0x30cc44[_0x16b7('0x45')]=_[_0x16b7('0x42')](db[_0x16b7('0x3d')][_0x16b7('0x3e')]);_0x30cc44[_0x16b7('0x41')]=_[_0x16b7('0x42')](_0x524266['query']);_0x30cc44[_0x16b7('0x43')]=_[_0x16b7('0x56')](_0x30cc44[_0x16b7('0x45')],_0x30cc44[_0x16b7('0x41')]);_0x10d8cc[_0x16b7('0x44')]=_[_0x16b7('0x56')](_0x30cc44[_0x16b7('0x45')],qs[_0x16b7('0x46')](_0x524266[_0x16b7('0x41')][_0x16b7('0x46')]));_0x10d8cc[_0x16b7('0x44')]=_0x10d8cc[_0x16b7('0x44')][_0x16b7('0x47')]?_0x10d8cc[_0x16b7('0x44')]:_0x30cc44[_0x16b7('0x45')];if(_0x524266[_0x16b7('0x41')]['includeAll']){_0x10d8cc[_0x16b7('0x51')]=[{'all':!![]}];}_0x10d8cc=_[_0x16b7('0x4d')]({},_0x10d8cc,_0x524266['options']);return db['FaxMessage'][_0x16b7('0x57')](_0x10d8cc)[_0x16b7('0x36')](handleEntityNotFound(_0x3b6106,null))['then'](respondWithResult(_0x3b6106,null))[_0x16b7('0x28')](handleError(_0x3b6106,null));};exports[_0x16b7('0x35')]=function(_0x1afc20,_0x2b22e1){if(_0x1afc20['body']['id']){delete _0x1afc20['body']['id'];}return db['FaxMessage']['find']({'where':{'id':_0x1afc20['params']['id']}})[_0x16b7('0x36')](handleEntityNotFound(_0x2b22e1,null))[_0x16b7('0x36')](saveUpdates(_0x1afc20[_0x16b7('0x58')],null))['then'](respondWithResult(_0x2b22e1,null))[_0x16b7('0x28')](handleError(_0x2b22e1,null));};exports['destroy']=function(_0x2915c6,_0x2256a3){return db[_0x16b7('0x3d')]['find']({'where':{'id':_0x2915c6['params']['id']}})[_0x16b7('0x36')](handleEntityNotFound(_0x2256a3,null))[_0x16b7('0x36')](removeEntity(_0x2256a3,null))[_0x16b7('0x28')](handleError(_0x2256a3,null));};exports[_0x16b7('0x59')]=function(_0x3821ac,_0x3c7532){return db[_0x16b7('0x3d')][_0x16b7('0x59')]()['then'](respondWithResult(_0x3c7532,null))[_0x16b7('0x28')](handleError(_0x3c7532,null));};var interaction_log=require(_0x16b7('0x14'))(_0x16b7('0x5a'));exports[_0x16b7('0x5b')]=function(_0x353107,_0x58cc0d,_0x568d20){var _0x616abc={'agent':{},'channel':'fax'};if(_0x353107['body']['id']){delete _0x353107['body']['id'];}_0x353107['body'][_0x16b7('0x5c')]=!![];_0x353107[_0x16b7('0x58')][_0x16b7('0x5d')]=moment()['format'](_0x16b7('0x5e'));_0x353107[_0x16b7('0x58')][_0x16b7('0x5f')]=_0x353107[_0x16b7('0x58')]['UserId']||_0x353107[_0x16b7('0x60')]['id'];_0x616abc[_0x16b7('0x61')]['id']=_0x353107['body'][_0x16b7('0x5f')];return db[_0x16b7('0x3d')][_0x16b7('0x57')]({'where':{'id':_0x353107[_0x16b7('0x55')]['id'],'UserId':null}})[_0x16b7('0x36')](handleEntityNotFound(_0x58cc0d,null))['then'](saveUpdates(_0x353107[_0x16b7('0x58')],null))[_0x16b7('0x36')](function(_0x2bb128){if(_0x2bb128){_0x616abc['message']=_0x2bb128[_0x16b7('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x16b7('0x57')]({'where':{'id':_0x2bb128['FaxInteractionId']}});}return null;})[_0x16b7('0x36')](handleEntityNotFound(_0x58cc0d,null))[_0x16b7('0x36')](function(_0x9d7503){if(_0x9d7503){return _0x9d7503[_0x16b7('0x35')]({'UserId':_0x353107[_0x16b7('0x58')][_0x16b7('0x5f')],'read1stAt':_['isNil'](_0x9d7503[_0x16b7('0x63')])?moment()[_0x16b7('0x64')](_0x16b7('0x5e')):undefined});}return null;})['then'](function(_0x5860a4){if(_0x5860a4){_0x616abc[_0x16b7('0x65')]=_0x5860a4[_0x16b7('0x62')]({'plain':!![]});interaction_log['info'](_0x16b7('0x66'),_0x353107[_0x16b7('0x60')]['id'],_0x353107[_0x16b7('0x60')][_0x16b7('0x3a')],_0x353107[_0x16b7('0x60')][_0x16b7('0x67')],_0x616abc[_0x16b7('0x65')]['id'],_0x353107[_0x16b7('0x58')]?JSON[_0x16b7('0x68')](_0x353107['body']):_0x16b7('0x69'));return respondWithRpcPromise(_0x16b7('0x6a'),_0x16b7('0x6b'),_0x616abc);}return null;})[_0x16b7('0x36')](function(_0x2c4927){var _0x43738f=_0x16b7('0x6c')+_0x2c4927[_0x16b7('0x26')][_0x16b7('0x6d')];return db[_0x16b7('0x6e')][_0x16b7('0x41')](_0x43738f,{'type':db['Sequelize']['QueryTypes'][_0x16b7('0x6f')],'raw':!![]})[_0x16b7('0x36')](function(_0x27baf6){return _0x27baf6;});})['then'](function(_0x3df766){if(_0x3df766){_0x616abc['message'][_0x16b7('0x70')]=_0x3df766[0x0];if(!_0x353107[_0x16b7('0x58')]['UserId'])return;return db[_0x16b7('0x71')][_0x16b7('0x57')]({'where':{'id':_0x353107['body']['UserId'],'role':'agent'},'attributes':['id',_0x16b7('0x3a'),_0x16b7('0x72'),'email',_0x16b7('0x73')],'raw':!![]});}return null;})['then'](function(_0x2310f7){if(!_0x2310f7)return null;_0x616abc['message'][_0x16b7('0x61')]=_0x2310f7;return _0x616abc;})[_0x16b7('0x36')](function(_0x55feb2){if(_0x55feb2){if(_0x353107[_0x16b7('0x58')][_0x16b7('0x74')]){_0x616abc[_0x16b7('0x26')]['interface']=util[_0x16b7('0x64')](_0x16b7('0x75'),_0x353107[_0x16b7('0x60')][_0x16b7('0x3a')]);_0x616abc[_0x16b7('0x26')][_0x16b7('0x76')]=_0x616abc[_0x16b7('0x76')];_0x616abc[_0x16b7('0x26')][_0x16b7('0x77')]=_0x616abc[_0x16b7('0x76')];_0x616abc[_0x16b7('0x26')][_0x16b7('0x78')]=_0x16b7('0x5b');return respondWithRpcPromise(_0x16b7('0x79'),_0x16b7('0x79'),{'event':'acceptmessage','message':_0x616abc[_0x16b7('0x26')]},client9002)[_0x16b7('0x36')](function(){return _0x616abc;});}return _0x616abc;}return null;})[_0x16b7('0x36')](respondWithResult(_0x58cc0d,null))['catch'](handleError(_0x58cc0d,null));};var interaction_log=require('../../config/logger')(_0x16b7('0x5a'));exports[_0x16b7('0x33')]=function(_0x536d63,_0x404e7a,_0x3ed1f3){var _0x1d1c9e={'agent':{},'channel':_0x16b7('0x7a')};if(_0x536d63[_0x16b7('0x58')]['id']){delete _0x536d63['body']['id'];}_0x536d63[_0x16b7('0x58')]['UserId']=_0x536d63[_0x16b7('0x58')][_0x16b7('0x5f')]||_0x536d63['user']['id'];_0x1d1c9e[_0x16b7('0x61')]['id']=_0x536d63[_0x16b7('0x58')][_0x16b7('0x5f')];return db[_0x16b7('0x3d')][_0x16b7('0x57')]({'where':{'id':_0x536d63['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x404e7a,null))[_0x16b7('0x36')](function(_0x3e0239){if(_0x3e0239){_0x1d1c9e['message']=_0x3e0239[_0x16b7('0x62')]({'plain':!![]});return db[_0x16b7('0x7b')][_0x16b7('0x57')]({'where':{'id':_0x3e0239[_0x16b7('0x7c')]}});}return null;})[_0x16b7('0x36')](handleEntityNotFound(_0x404e7a,null))[_0x16b7('0x36')](function(_0x2caea3){if(_0x2caea3){_0x1d1c9e['interaction']=_0x2caea3['get']({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x536d63[_0x16b7('0x60')]['id'],_0x536d63[_0x16b7('0x60')]['name'],_0x536d63[_0x16b7('0x60')][_0x16b7('0x67')],_0x1d1c9e[_0x16b7('0x65')]['id'],_0x536d63[_0x16b7('0x58')]?JSON[_0x16b7('0x68')](_0x536d63[_0x16b7('0x58')]):_0x16b7('0x69'));return respondWithRpcPromise(_0x16b7('0x7d'),_0x16b7('0x7e'),_0x1d1c9e);}return null;})[_0x16b7('0x36')](function(_0x43d35e){var _0x400289=_0x16b7('0x6c')+_0x43d35e[_0x16b7('0x26')]['ContactId'];return db['sequelize'][_0x16b7('0x41')](_0x400289,{'type':db[_0x16b7('0x7f')][_0x16b7('0x80')]['SELECT'],'raw':!![]})[_0x16b7('0x36')](function(_0x5ce5e1){return _0x5ce5e1;});})[_0x16b7('0x36')](function(_0x3c2698){if(_0x3c2698){_0x1d1c9e['message'][_0x16b7('0x70')]=_0x3c2698[0x0];if(!_0x536d63['body']['UserId'])return;return db[_0x16b7('0x71')]['find']({'where':{'id':_0x536d63['body'][_0x16b7('0x5f')],'role':_0x16b7('0x61')},'attributes':['id',_0x16b7('0x3a'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x16b7('0x36')](function(_0x527884){if(!_0x527884)return null;_0x1d1c9e[_0x16b7('0x26')][_0x16b7('0x61')]=_0x527884;return _0x1d1c9e;})[_0x16b7('0x36')](function(_0x5bdba1){if(_0x5bdba1){_0x5bdba1[_0x16b7('0x26')][_0x16b7('0x81')]=util[_0x16b7('0x64')](_0x16b7('0x75'),_0x536d63[_0x16b7('0x60')]['name']);_0x5bdba1['message'][_0x16b7('0x76')]=_0x1d1c9e[_0x16b7('0x76')];_0x5bdba1[_0x16b7('0x26')][_0x16b7('0x77')]=_0x1d1c9e[_0x16b7('0x76')];_0x5bdba1['message']['event']=_0x16b7('0x33');respondWithRpcPromise(_0x16b7('0x79'),_0x16b7('0x79'),{'event':_0x16b7('0x82'),'message':_0x5bdba1[_0x16b7('0x26')]},client9002);return _0x1d1c9e;}return null;})[_0x16b7('0x36')](respondWithResult(_0x404e7a,null))[_0x16b7('0x28')](handleError(_0x404e7a,null));};exports[_0x16b7('0x83')]=function(_0x4e0458,_0x303413){var _0x1491c4;return db[_0x16b7('0x3d')][_0x16b7('0x83')](_0x4e0458[_0x16b7('0x58')],{})['then'](function(_0x44df06){_0x1491c4=_0x44df06;return db[_0x16b7('0x84')][_0x16b7('0x85')]({'where':{'id':_0x1491c4['ContactId']}});})[_0x16b7('0x36')](function(_0x2d8610){if(_['isNil'](_0x2d8610)){return;}else{_0x1491c4[_0x16b7('0x7a')]=_0x2d8610[_0x16b7('0x7a')];return db[_0x16b7('0x86')][_0x16b7('0x85')]({'where':{'id':_0x1491c4[_0x16b7('0x87')]}});}})[_0x16b7('0x36')](function(_0x17fc2a){return respondWithRpcPromise('SendFax',_0x16b7('0x88'),{'FaxAccountId':_[_0x16b7('0x89')](_0x4e0458[_0x16b7('0x58')])?undefined:_0x4e0458[_0x16b7('0x58')]['FaxAccountId'],'path':_['isNil'](_0x17fc2a)?undefined:util['format'](_0x16b7('0x8a'),_0x17fc2a[_0x16b7('0x8b')]),'fax':_['isNil'](_0x1491c4['fax'])?undefined:_0x1491c4[_0x16b7('0x7a')],'AttachmentId':_0x1491c4[_0x16b7('0x87')]},client9002);})[_0x16b7('0x36')](respondWithResult(_0x303413,0xc9))[_0x16b7('0x28')](handleError(_0x303413,null));};exports[_0x16b7('0x8c')]=function(_0x12e5fe,_0x45944d){var _0x143d35=path[_0x16b7('0x8d')](config[_0x16b7('0x8e')],_0x16b7('0x8f'),_0x16b7('0x90'),_0x16b7('0x91'));return db[_0x16b7('0x3d')][_0x16b7('0x57')]({'where':{'id':_0x12e5fe[_0x16b7('0x55')]['id']},'include':[{'model':db[_0x16b7('0x86')],'as':'Attachment'}]})[_0x16b7('0x36')](handleEntityNotFound(_0x45944d,null))[_0x16b7('0x36')](function(_0x10988e){if(_0x10988e){return _0x45944d[_0x16b7('0x8c')](path[_0x16b7('0x8d')](_0x143d35,_0x10988e[_0x16b7('0x86')]['basename']));}})[_0x16b7('0x28')](handleError(_0x45944d,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 2137f8f..c62f85f 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 _0x38b2=['FaxMessage','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x508786,_0x316536){var _0x2adda2=function(_0x311474){while(--_0x311474){_0x508786['push'](_0x508786['shift']());}};_0x2adda2(++_0x316536);}(_0x38b2,0xf6));var _0x238b=function(_0x4e4396,_0x429293){_0x4e4396=_0x4e4396-0x0;var _0x5db554=_0x38b2[_0x4e4396];return _0x5db554;};'use strict';var EventEmitter=require(_0x238b('0x0'));var FaxMessage=require(_0x238b('0x1'))['db'][_0x238b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x238b('0x3'),'afterDestroy':_0x238b('0x4')};function emitEvent(_0x4df021){return function(_0x44251b,_0x4c4f0e,_0x44ddd2){FaxMessageEvents[_0x238b('0x5')](_0x4df021+':'+_0x44251b['id'],_0x44251b);FaxMessageEvents[_0x238b('0x5')](_0x4df021,_0x44251b);_0x44ddd2(null);};}for(var e in events){if(events[_0x238b('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x238b('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x5430=['FaxMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xf255e6,_0x316d38){var _0x159f1f=function(_0xc88a16){while(--_0xc88a16){_0xf255e6['push'](_0xf255e6['shift']());}};_0x159f1f(++_0x316d38);}(_0x5430,0x10c));var _0x0543=function(_0x392eed,_0x5279df){_0x392eed=_0x392eed-0x0;var _0x105f80=_0x5430[_0x392eed];return _0x105f80;};'use strict';var EventEmitter=require(_0x0543('0x0'));var FaxMessage=require(_0x0543('0x1'))['db'][_0x0543('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0543('0x3')](0x0);var events={'afterCreate':_0x0543('0x4'),'afterUpdate':_0x0543('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5b122c){return function(_0x1c5ab7,_0x4ee416,_0x523f3d){FaxMessageEvents[_0x0543('0x6')](_0x5b122c+':'+_0x1c5ab7['id'],_0x1c5ab7);FaxMessageEvents[_0x0543('0x6')](_0x5b122c,_0x1c5ab7);_0x523f3d(null);};}for(var e in events){if(events[_0x0543('0x7')](e)){var event=events[e];FaxMessage[_0x0543('0x8')](e,emitEvent(event));}}module[_0x0543('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d35dea4..68807db 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 _0x724a=['FULLTEXT','models','direction','toLowerCase','out','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','define','FaxMessage','body'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x724a,0x17a));var _0xa724=function(_0x5f2668,_0x29630f){_0x5f2668=_0x5f2668-0x0;var _0x42df13=_0x724a[_0x5f2668];return _0x42df13;};'use strict';var _=require(_0xa724('0x0'));var util=require(_0xa724('0x1'));var logger=require(_0xa724('0x2'))('api');var moment=require(_0xa724('0x3'));var BPromise=require(_0xa724('0x4'));var rp=require(_0xa724('0x5'));var fs=require('fs');var path=require(_0xa724('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa724('0x7'));module[_0xa724('0x8')]=function(_0x5dcf77,_0x52887d){return _0x5dcf77[_0xa724('0x9')](_0xa724('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xa724('0xb')],'type':_0xa724('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a63a8,_0x812f5,_0x28caee){var _0x492dd6=_0x5dcf77[_0xa724('0xd')];var _0x5dd53c=_0x1a63a8['get']({'plain':!![]});if(_0x5dd53c[_0xa724('0xe')][_0xa724('0xf')]()==='in'||_0x5dd53c[_0xa724('0xe')][_0xa724('0xf')]()===_0xa724('0x10')&&!_0x5dd53c['secret']&&!_['isNil'](_0x5dd53c['UserId'])){_0x492dd6[_0xa724('0x11')][_0xa724('0x12')]({'where':{'id':_0x5dd53c[_0xa724('0x13')]}})[_0xa724('0x14')](function(_0x2bcf95){if(_0x2bcf95){_0x2bcf95[_0xa724('0x15')]({'lastMsgAt':_0x5dd53c[_0xa724('0x16')],'lastMsgDirection':_0x5dd53c[_0xa724('0xe')]['toLowerCase']()});}})[_0xa724('0x17')](function(_0x46cc9a){console['error'](_0x46cc9a);});}_0x28caee();}},'charset':_0xa724('0x18'),'collate':_0xa724('0x19')});}; \ No newline at end of file +var _0xb7ec=['createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xb7ec,0xed));var _0xcb7e=function(_0x85f077,_0x362348){_0x85f077=_0x85f077-0x0;var _0x37f55d=_0xb7ec[_0x85f077];return _0x37f55d;};'use strict';var _=require(_0xcb7e('0x0'));var util=require(_0xcb7e('0x1'));var logger=require(_0xcb7e('0x2'))(_0xcb7e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb7e('0x4'));var fs=require('fs');var path=require(_0xcb7e('0x5'));var rimraf=require('rimraf');var config=require(_0xcb7e('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x22fb0c,_0x5ad0bf){return _0x22fb0c[_0xcb7e('0x7')](_0xcb7e('0x8'),attributes,{'tableName':_0xcb7e('0x9'),'paranoid':![],'indexes':[{'name':_0xcb7e('0xa'),'fields':[_0xcb7e('0xb')],'type':_0xcb7e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x29db02,_0x5acb8c,_0x5275cb){var _0x3d2fbd=_0x22fb0c['models'];var _0x5aadd8=_0x29db02[_0xcb7e('0xd')]({'plain':!![]});if(_0x5aadd8[_0xcb7e('0xe')]['toLowerCase']()==='in'||_0x5aadd8[_0xcb7e('0xe')][_0xcb7e('0xf')]()===_0xcb7e('0x10')&&!_0x5aadd8[_0xcb7e('0x11')]&&!_[_0xcb7e('0x12')](_0x5aadd8[_0xcb7e('0x13')])){_0x3d2fbd[_0xcb7e('0x14')][_0xcb7e('0x15')]({'where':{'id':_0x5aadd8[_0xcb7e('0x16')]}})['then'](function(_0x2d1009){if(_0x2d1009){_0x2d1009[_0xcb7e('0x17')]({'lastMsgAt':_0x5aadd8[_0xcb7e('0x18')],'lastMsgDirection':_0x5aadd8['direction'][_0xcb7e('0xf')]()});}})[_0xcb7e('0x19')](function(_0x5c87f9){console[_0xcb7e('0x1a')](_0x5c87f9);});}_0x5275cb();}},'charset':_0xcb7e('0x1b'),'collate':_0xcb7e('0x1c')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e880c7f..8607569 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 _0x84ab=['code','message','result','catch','FaxMessage','create','body','raw','CreateFaxMessage','debug','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./faxMessage.socket','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x110370,_0x2d3e60){var _0x36f825=function(_0x39a896){while(--_0x39a896){_0x110370['push'](_0x110370['shift']());}};_0x36f825(++_0x2d3e60);}(_0x84ab,0x12f));var _0xb84a=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x84ab[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xb84a('0xa')](config['redis'],{'host':_0xb84a('0xb'),'port':0x18eb});var socket=require(_0xb84a('0xc'))(new Redis(config['redis']));require(_0xb84a('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e6a71,_0x1886e0,_0x42daf5){return new BPromise(function(_0x5d3b29,_0x5a34f7){return client['request'](_0x2e6a71,_0x42daf5)[_0xb84a('0xe')](function(_0x17379b){logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));logger['debug'](_0xb84a('0x12'),_0x1886e0,_0xb84a('0x11'),JSON[_0xb84a('0x13')](_0x17379b));if(_0x17379b[_0xb84a('0x14')]){if(_0x17379b[_0xb84a('0x14')][_0xb84a('0x15')]===0x1f4){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5a34f7(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}logger['error'](_0xb84a('0x10'),_0x1886e0,_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);return _0x5d3b29(_0x17379b[_0xb84a('0x14')][_0xb84a('0x16')]);}else{logger[_0xb84a('0xf')](_0xb84a('0x10'),_0x1886e0,_0xb84a('0x11'));_0x5d3b29(_0x17379b[_0xb84a('0x17')][_0xb84a('0x16')]);}})[_0xb84a('0x18')](function(_0x2de49c){logger[_0xb84a('0x14')](_0xb84a('0x10'),_0x1886e0,_0x2de49c);_0x5a34f7(_0x2de49c);});});}exports['CreateFaxMessage']=function(_0x1a0056){var _0x319216=this;return new Promise(function(_0x55a633,_0xac76d3){return db[_0xb84a('0x19')][_0xb84a('0x1a')](_0x1a0056[_0xb84a('0x1b')],{'raw':_0x1a0056['options']?_0x1a0056['options'][_0xb84a('0x1c')]===undefined?!![]:![]:!![]})[_0xb84a('0xe')](function(_0x2d70fd){logger[_0xb84a('0xf')](_0xb84a('0x1d'),_0x1a0056);logger[_0xb84a('0x1e')](_0xb84a('0x1d'),_0x1a0056,JSON[_0xb84a('0x13')](_0x2d70fd));_0x55a633(_0x2d70fd);})[_0xb84a('0x18')](function(_0x26fe42){logger[_0xb84a('0x14')](_0xb84a('0x1d'),_0x26fe42[_0xb84a('0x16')],_0x1a0056);_0xac76d3(_0x319216[_0xb84a('0x14')](0x1f4,_0x26fe42[_0xb84a('0x16')]));});});};exports[_0xb84a('0x1f')]=function(_0x378ce1){var _0x3ff0bc=this;return new Promise(function(_0x3b6805,_0xd468c3){return db[_0xb84a('0x19')][_0xb84a('0x20')](_0x378ce1[_0xb84a('0x1b')],{'raw':_0x378ce1[_0xb84a('0x21')]?_0x378ce1[_0xb84a('0x21')][_0xb84a('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378ce1['options']?_0x378ce1['options'][_0xb84a('0x22')]||null:null,'attributes':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options'][_0xb84a('0x23')]||null:null,'limit':_0x378ce1[_0xb84a('0x21')]?_0x378ce1['options']['limit']||null:null})[_0xb84a('0xe')](function(_0x8e9319){logger['info'](_0xb84a('0x1f'),_0x378ce1);logger[_0xb84a('0x1e')](_0xb84a('0x1f'),_0x378ce1,JSON[_0xb84a('0x13')](_0x8e9319));_0x3b6805(_0x8e9319);})[_0xb84a('0x18')](function(_0x144c25){logger[_0xb84a('0x14')](_0xb84a('0x1f'),_0x144c25['message'],_0x378ce1);_0xd468c3(_0x3ff0bc[_0xb84a('0x14')](0x1f4,_0x144c25['message']));});});}; \ No newline at end of file +var _0xbec5=['then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x9c22ef,_0x3a814d){var _0x34a7da=function(_0x172036){while(--_0x172036){_0x9c22ef['push'](_0x9c22ef['shift']());}};_0x34a7da(++_0x3a814d);}(_0xbec5,0xe5));var _0x5bec=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0xbec5[_0x7791d5];return _0x5ce288;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('FaxMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')](_0x593786[_0x5bec('0x1d')],{'raw':_0x593786[_0x5bec('0x1e')]?_0x593786[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x5bec('0x10')](function(_0x4cfcb8){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger['debug'](_0x5bec('0x1a'),_0x593786,JSON[_0x5bec('0x14')](_0x4cfcb8));_0xab397b(_0x4cfcb8);})['catch'](function(_0x45afb7){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x45afb7[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x45afb7[_0x5bec('0x18')]));});});};exports[_0x5bec('0x1f')]=function(_0x4de66a){var _0x5b63ab=this;return new Promise(function(_0x5e44b3,_0x2961bd){return db[_0x5bec('0x1b')][_0x5bec('0x20')](_0x4de66a['body'],{'raw':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['where']||null:null,'attributes':_0x4de66a['options']?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x21')]||null:null,'limit':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x22')]||null:null})[_0x5bec('0x10')](function(_0x5d6621){logger[_0x5bec('0x11')]('UpdateFaxMessage',_0x4de66a);logger[_0x5bec('0x13')](_0x5bec('0x1f'),_0x4de66a,JSON[_0x5bec('0x14')](_0x5d6621));_0x5e44b3(_0x5d6621);})[_0x5bec('0x19')](function(_0x5128c0){logger[_0x5bec('0x15')](_0x5bec('0x1f'),_0x5128c0[_0x5bec('0x18')],_0x4de66a);_0x2961bd(_0x5b63ab['error'](0x1f4,_0x5128c0[_0x5bec('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 4af6eb3..2140567 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 _0xa97b=['length','faxMessage:','update','emit','removeListener','register'];(function(_0x48e640,_0x31f811){var _0x24a59b=function(_0x3597e1){while(--_0x3597e1){_0x48e640['push'](_0x48e640['shift']());}};_0x24a59b(++_0x31f811);}(_0xa97b,0x1f4));var _0xba97=function(_0x4cfa0e,_0x6aaf72){_0x4cfa0e=_0x4cfa0e-0x0;var _0x307d03=_0xa97b[_0x4cfa0e];return _0x307d03;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove',_0xba97('0x0')];function createListener(_0x50b300,_0x6f3a7e){return function(_0x47626c){_0x6f3a7e[_0xba97('0x1')](_0x50b300,_0x47626c);};}function removeListener(_0x591fec,_0x22a70b){return function(){FaxMessageEvents[_0xba97('0x2')](_0x591fec,_0x22a70b);};}exports[_0xba97('0x3')]=function(_0x38ead9){for(var _0x360462=0x0,_0x59d173=events[_0xba97('0x4')];_0x360462<_0x59d173;_0x360462++){var _0x108961=events[_0x360462];var _0x266b19=createListener(_0xba97('0x5')+_0x108961,_0x38ead9);FaxMessageEvents['on'](_0x108961,_0x266b19);}}; \ No newline at end of file +var _0x4be6=['emit','register','length','./faxMessage.events','remove','update'];(function(_0x3aaf2a,_0x14dc68){var _0x1bddf2=function(_0x144ea4){while(--_0x144ea4){_0x3aaf2a['push'](_0x3aaf2a['shift']());}};_0x1bddf2(++_0x14dc68);}(_0x4be6,0xd5));var _0x64be=function(_0x17e696,_0xad1c39){_0x17e696=_0x17e696-0x0;var _0x1a9e33=_0x4be6[_0x17e696];return _0x1a9e33;};'use strict';var FaxMessageEvents=require(_0x64be('0x0'));var events=['save',_0x64be('0x1'),_0x64be('0x2')];function createListener(_0x68c030,_0x536fd0){return function(_0x2a4cba){_0x536fd0[_0x64be('0x3')](_0x68c030,_0x2a4cba);};}function removeListener(_0x28dc65,_0x49b391){return function(){FaxMessageEvents['removeListener'](_0x28dc65,_0x49b391);};}exports[_0x64be('0x4')]=function(_0x22d288){for(var _0x281615=0x0,_0x356abf=events[_0x64be('0x5')];_0x281615<_0x356abf;_0x281615++){var _0x42373c=events[_0x281615];var _0x9bf04c=createListener('faxMessage:'+_0x42373c,_0x22d288);FaxMessageEvents['on'](_0x42373c,_0x9bf04c);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 1dcfb7c..d488962 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 _0xf4eb=['/:id/accept','accept','/:id/reject','delete','exports','multer','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','tracked','faxmessage:create','create','put'];(function(_0x2621ac,_0x4d8774){var _0x57bc8c=function(_0x2cdfef){while(--_0x2cdfef){_0x2621ac['push'](_0x2621ac['shift']());}};_0x57bc8c(++_0x4d8774);}(_0xf4eb,0xec));var _0xbf4e=function(_0x12555a,_0x4177bf){_0x12555a=_0x12555a-0x0;var _0x59be22=_0xf4eb[_0x12555a];return _0x59be22;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xbf4e('0xc')]('fax',_0xbf4e('0xd')),controller[_0xbf4e('0xe')]);router['put'](_0xbf4e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);router[_0xbf4e('0xf')](_0xbf4e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xbf4e('0x13')](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0x14')]=router; \ No newline at end of file +var _0x4522=['destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','fax','faxmessage:create','create','put','reject'];(function(_0x2f6ce7,_0x3121f4){var _0x16ab0b=function(_0x44dfc8){while(--_0x44dfc8){_0x2f6ce7['push'](_0x2f6ce7['shift']());}};_0x16ab0b(++_0x3121f4);}(_0x4522,0x1a0));var _0x2452=function(_0x40d9c8,_0x42ddab){_0x40d9c8=_0x40d9c8-0x0;var _0x4b11fe=_0x4522[_0x40d9c8];return _0x4b11fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2452('0x0'));var timeout=require(_0x2452('0x1'));var express=require(_0x2452('0x2'));var router=express['Router']();var fs_extra=require(_0x2452('0x3'));var auth=require(_0x2452('0x4'));var interaction=require(_0x2452('0x5'));var config=require(_0x2452('0x6'));var controller=require(_0x2452('0x7'));router[_0x2452('0x8')]('/',auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0x8')](_0x2452('0xb'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0x8')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);router['get']('/:id/download',auth[_0x2452('0x9')](),controller['download']);router['post']('/',auth[_0x2452('0x9')](),interaction[_0x2452('0xf')](_0x2452('0x10'),_0x2452('0x11')),controller[_0x2452('0x12')]);router[_0x2452('0x13')](_0x2452('0xd'),auth[_0x2452('0x9')](),controller['update']);router['put']('/:id/accept',auth[_0x2452('0x9')](),controller['accept']);router[_0x2452('0x13')]('/:id/reject',auth[_0x2452('0x9')](),controller[_0x2452('0x14')]);router['delete'](_0x2452('0xd'),auth['isAuthenticated'](),controller[_0x2452('0x15')]);module[_0x2452('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3cdeea5..3a33d4f 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 _0x13cf=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x4f8b7d,_0x17da18){var _0x59cb76=function(_0x9ed36f){while(--_0x9ed36f){_0x4f8b7d['push'](_0x4f8b7d['shift']());}};_0x59cb76(++_0x17da18);}(_0x13cf,0x13f));var _0xf13c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x13cf[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0xf13c('0x0'));module[_0xf13c('0x1')]={'name':{'type':Sequelize[_0xf13c('0x2')],'unique':_0xf13c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf13c('0x2')]},'timeout':{'type':Sequelize[_0xf13c('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf13c('0x5')](_0xf13c('0x6'),'beepall',_0xf13c('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf13c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d0c=['INTEGER','ENUM','rrmemory','beepall','roundrobin','name','STRING'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6d0c,0x171));var _0xc6d0=function(_0x15f0f4,_0x189fdc){_0x15f0f4=_0x15f0f4-0x0;var _0x4663bc=_0x6d0c[_0x15f0f4];return _0x4663bc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc6d0('0x0'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc6d0('0x1')]},'timeout':{'type':Sequelize[_0xc6d0('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc6d0('0x3')](_0xc6d0('0x4'),_0xc6d0('0x5'),_0xc6d0('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc6d0('0x2')],'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 501bff0..ebbc311 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 _0xd046=['body','user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','hasOwnProperty','nolimit','sort','where','pick','FaxQueueId','filter','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','rows','%s/%s','SIP','createdAt','getTeams','findOne','Team','rawAttributes','addTeams','ids','Agents','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','order','util','lodash','squel','../../components/parsers/qs','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','getOptions','findAll','catch','show','params','model','keys','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create'];(function(_0x3a5b2f,_0x594fae){var _0xe2c09f=function(_0x3a733f){while(--_0x3a733f){_0x3a5b2f['push'](_0x3a5b2f['shift']());}};_0xe2c09f(++_0x594fae);}(_0xd046,0x129));var _0x6d04=function(_0x13a7a3,_0x5a512b){_0x13a7a3=_0x13a7a3-0x0;var _0x130e4c=_0xd046[_0x13a7a3];return _0x130e4c;};'use strict';var BPromise=require('bluebird');var util=require(_0x6d04('0x0'));var _=require(_0x6d04('0x1'));var squel=require(_0x6d04('0x2'));var Redis=require('ioredis');var qs=require(_0x6d04('0x3'));var logger=require('../../config/logger')('api');var config=require(_0x6d04('0x4'));var db=require('../../mysqldb')['db'];config[_0x6d04('0x5')]=_['defaults'](config['redis'],{'host':_0x6d04('0x6'),'port':0x18eb});var socket=require(_0x6d04('0x7'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x6d04('0x8')](socket);function respondWithStatusCode(_0x42aa22,_0x52fc0c){_0x52fc0c=_0x52fc0c||0xcc;return function(_0x533dcf){if(_0x533dcf){return _0x42aa22[_0x6d04('0x9')](_0x52fc0c);}return _0x42aa22['status'](_0x52fc0c)[_0x6d04('0xa')]();};}function respondWithResult(_0x5876b8,_0x5a2dbb){_0x5a2dbb=_0x5a2dbb||0xc8;return function(_0x4d3a31){if(_0x4d3a31){return _0x5876b8[_0x6d04('0xb')](_0x5a2dbb)[_0x6d04('0xc')](_0x4d3a31);}};}function respondWithFilteredResult(_0x3397ea,_0x1acfcc){return function(_0x500adc){if(_0x500adc){var _0x26a6ab=typeof _0x1acfcc[_0x6d04('0xd')]===_0x6d04('0xe')&&typeof _0x1acfcc[_0x6d04('0xf')]===_0x6d04('0xe');var _0x3e1da1=_0x500adc[_0x6d04('0x10')];var _0x3d7dd5=_0x26a6ab?0x0:_0x1acfcc[_0x6d04('0xd')];var _0x3ab977=_0x26a6ab?_0x500adc[_0x6d04('0x10')]:_0x1acfcc[_0x6d04('0xd')]+_0x1acfcc[_0x6d04('0xf')];var _0x92a88b;if(_0x3ab977>=_0x3e1da1){_0x3ab977=_0x3e1da1;_0x92a88b=0xc8;}else{_0x92a88b=0xce;}_0x3397ea[_0x6d04('0xb')](_0x92a88b);return _0x3397ea[_0x6d04('0x11')](_0x6d04('0x12'),_0x3d7dd5+'-'+_0x3ab977+'/'+_0x3e1da1)[_0x6d04('0xc')](_0x500adc);}return null;};}function saveUpdates(_0xed5538){return function(_0x1f8252){if(_0x1f8252){return _0x1f8252[_0x6d04('0x13')](_0xed5538)[_0x6d04('0x14')](function(_0x2bc798){return _0x2bc798;});}return null;};}function removeEntity(_0x3ad325){return function(_0x4e93b5){if(_0x4e93b5){return _0x4e93b5[_0x6d04('0x15')]()[_0x6d04('0x14')](function(){var _0x158383=_0x4e93b5[_0x6d04('0x16')]({'plain':!![]});var _0x1d3dac=_0x6d04('0x17');return db[_0x6d04('0x18')][_0x6d04('0x15')]({'where':{'type':_0x1d3dac,'resourceId':_0x158383['id']}})[_0x6d04('0x14')](function(){return _0x4e93b5;});})[_0x6d04('0x14')](function(){_0x3ad325[_0x6d04('0xb')](0xcc)[_0x6d04('0xa')]();});}};}function handleEntityNotFound(_0xeec9cf){return function(_0x5bda3a){if(!_0x5bda3a){_0xeec9cf[_0x6d04('0x9')](0x194);}return _0x5bda3a;};}function handleError(_0x280eab,_0x54cf0e){_0x54cf0e=_0x54cf0e||0x1f4;return function(_0x5a0224){logger[_0x6d04('0x19')](_0x5a0224[_0x6d04('0x1a')]);if(_0x5a0224[_0x6d04('0x1b')]){delete _0x5a0224[_0x6d04('0x1b')];}_0x280eab[_0x6d04('0xb')](_0x54cf0e)[_0x6d04('0x1c')](_0x5a0224);};}exports[_0x6d04('0x1d')]=function(_0xb2bd60,_0x16a5b8){var _0x38e90f={};var _0x2c4d5b={'count':0x0,'rows':[]};var _0x23d78a=_[_0x6d04('0x1e')](db[_0x6d04('0x1f')]['rawAttributes'],function(_0x1dc29b){return{'name':_0x1dc29b[_0x6d04('0x20')],'type':_0x1dc29b[_0x6d04('0x21')][_0x6d04('0x22')]};});_0x38e90f=qs[_0x6d04('0x23')](_0x23d78a,_0xb2bd60);var _0x3a62d4={'where':_0x38e90f['where']};return db[_0x6d04('0x1f')][_0x6d04('0x10')](_0x3a62d4)[_0x6d04('0x14')](function(_0x40b9e6){_0x2c4d5b[_0x6d04('0x10')]=_0x40b9e6;_0x38e90f['include']=qs['include'](_0xb2bd60['query']);return db['FaxQueue'][_0x6d04('0x24')](_0x38e90f);})['then'](function(_0x43eb48){_0x2c4d5b['rows']=_0x43eb48;return _0x2c4d5b;})[_0x6d04('0x14')](respondWithFilteredResult(_0x16a5b8,_0x38e90f))[_0x6d04('0x25')](handleError(_0x16a5b8,null));};exports[_0x6d04('0x26')]=function(_0x9a95df,_0x34a480){var _0x228b65={'raw':!![],'where':{'id':_0x9a95df[_0x6d04('0x27')]['id']}},_0x3a2a84={};_0x3a2a84[_0x6d04('0x28')]=_[_0x6d04('0x29')](db['FaxQueue']['rawAttributes']);_0x3a2a84[_0x6d04('0x2a')]=_[_0x6d04('0x29')](_0x9a95df[_0x6d04('0x2a')]);_0x3a2a84[_0x6d04('0x2b')]=_['intersection'](_0x3a2a84[_0x6d04('0x28')],_0x3a2a84[_0x6d04('0x2a')]);_0x228b65[_0x6d04('0x2c')]=_[_0x6d04('0x2d')](_0x3a2a84['model'],qs[_0x6d04('0x2e')](_0x9a95df[_0x6d04('0x2a')][_0x6d04('0x2e')]));_0x228b65[_0x6d04('0x2c')]=_0x228b65[_0x6d04('0x2c')][_0x6d04('0x2f')]?_0x228b65[_0x6d04('0x2c')]:_0x3a2a84[_0x6d04('0x28')];if(_0x9a95df[_0x6d04('0x2a')][_0x6d04('0x30')]){_0x228b65[_0x6d04('0x31')]=[{'all':!![]}];}_0x228b65=_[_0x6d04('0x32')]({},_0x228b65,_0x9a95df[_0x6d04('0x33')]);return db[_0x6d04('0x1f')][_0x6d04('0x34')](_0x228b65)['then'](handleEntityNotFound(_0x34a480,null))[_0x6d04('0x14')](respondWithResult(_0x34a480,null))['catch'](handleError(_0x34a480,null));};exports[_0x6d04('0x35')]=function(_0x2f7498,_0x4c1908){return db[_0x6d04('0x1f')][_0x6d04('0x35')](_0x2f7498[_0x6d04('0x36')],{})[_0x6d04('0x14')](function(_0x18ab7d){var _0xdbae2c=_0x2f7498[_0x6d04('0x37')][_0x6d04('0x16')]({'plain':!![]});if(!_0xdbae2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdbae2c[_0x6d04('0x38')]===_0x6d04('0x37')){var _0x39a623=_0x18ab7d[_0x6d04('0x16')]({'plain':!![]});var _0x78cbd0='FaxQueues';return db[_0x6d04('0x39')]['find']({'where':{'name':_0x78cbd0,'userProfileId':_0xdbae2c['userProfileId']},'raw':!![]})['then'](function(_0x4fd1fb){if(_0x4fd1fb&&_0x4fd1fb['autoAssociation']===0x0){return db[_0x6d04('0x18')]['create']({'name':_0x39a623[_0x6d04('0x1b')],'resourceId':_0x39a623['id'],'type':_0x4fd1fb[_0x6d04('0x1b')],'sectionId':_0x4fd1fb['id']},{})[_0x6d04('0x14')](function(){return _0x18ab7d;});}else{return _0x18ab7d;}})[_0x6d04('0x25')](function(_0x5c271f){logger[_0x6d04('0x19')](_0x6d04('0x3a'),_0x5c271f);throw _0x5c271f;});}return _0x18ab7d;})['then'](respondWithResult(_0x4c1908,0xc9))[_0x6d04('0x25')](handleError(_0x4c1908,null));};exports[_0x6d04('0x13')]=function(_0x43873e,_0x44a27d){if(_0x43873e[_0x6d04('0x36')]['id']){delete _0x43873e[_0x6d04('0x36')]['id'];}return db[_0x6d04('0x1f')]['find']({'where':{'id':_0x43873e[_0x6d04('0x27')]['id']}})['then'](handleEntityNotFound(_0x44a27d,null))['then'](saveUpdates(_0x43873e[_0x6d04('0x36')],null))['then'](respondWithResult(_0x44a27d,null))[_0x6d04('0x25')](handleError(_0x44a27d,null));};exports[_0x6d04('0x15')]=function(_0x4a1293,_0x118657){return db[_0x6d04('0x1f')][_0x6d04('0x34')]({'where':{'id':_0x4a1293['params']['id']}})['then'](handleEntityNotFound(_0x118657,null))[_0x6d04('0x14')](removeEntity(_0x118657,null))[_0x6d04('0x25')](handleError(_0x118657,null));};exports[_0x6d04('0x3b')]=function(_0x26f735,_0x36db7a){return db['FaxQueue'][_0x6d04('0x3b')]()[_0x6d04('0x14')](respondWithResult(_0x36db7a,null))[_0x6d04('0x25')](handleError(_0x36db7a,null));};exports[_0x6d04('0x3c')]=function(_0x413c3f,_0x3d3c66){var _0x491de4={'raw':!![],'where':{}},_0x2fdf7e={},_0x291514;return db[_0x6d04('0x1f')]['findOne']({'where':{'id':_0x413c3f['params']['id']}})[_0x6d04('0x14')](handleEntityNotFound(_0x3d3c66,null))[_0x6d04('0x14')](function(_0x559d0b){if(_0x559d0b){_0x291514=_0x559d0b['get']({'plain':!![]});_0x2fdf7e['model']=_['keys'](db['UserFaxQueue']['rawAttributes']);_0x2fdf7e[_0x6d04('0x2a')]=_[_0x6d04('0x29')](_0x413c3f[_0x6d04('0x2a')]);_0x2fdf7e[_0x6d04('0x2b')]=_['intersection'](_0x2fdf7e[_0x6d04('0x28')],_0x2fdf7e[_0x6d04('0x2a')]);_0x491de4['attributes']=_[_0x6d04('0x2d')](_0x2fdf7e['model'],qs[_0x6d04('0x2e')](_0x413c3f['query']['fields']));_0x491de4[_0x6d04('0x2c')]=_0x491de4[_0x6d04('0x2c')][_0x6d04('0x2f')]?_0x491de4[_0x6d04('0x2c')]:_0x2fdf7e[_0x6d04('0x28')];if(!_0x413c3f[_0x6d04('0x2a')][_0x6d04('0x3d')](_0x6d04('0x3e'))){_0x491de4[_0x6d04('0xf')]=qs[_0x6d04('0xf')](_0x413c3f[_0x6d04('0x2a')][_0x6d04('0xf')]);_0x491de4[_0x6d04('0xd')]=qs[_0x6d04('0xd')](_0x413c3f[_0x6d04('0x2a')][_0x6d04('0xd')]);}_0x491de4['order']=qs[_0x6d04('0x3f')](_0x413c3f[_0x6d04('0x2a')][_0x6d04('0x3f')]);_0x491de4[_0x6d04('0x40')]=qs[_0x6d04('0x2b')](_[_0x6d04('0x41')](_0x413c3f[_0x6d04('0x2a')],_0x2fdf7e[_0x6d04('0x2b')]));_0x491de4['where'][_0x6d04('0x42')]=_0x559d0b['id'];if(_0x413c3f[_0x6d04('0x2a')]['filter']){_0x491de4[_0x6d04('0x40')]=_[_0x6d04('0x32')](_0x491de4[_0x6d04('0x40')],{'$or':_[_0x6d04('0x1e')](_0x491de4[_0x6d04('0x2c')],function(_0x20e106){var _0x59609c={};_0x59609c[_0x20e106]={'$like':'%'+_0x413c3f['query'][_0x6d04('0x43')]+'%'};return _0x59609c;})});}_0x491de4=_['merge']({},_0x491de4,_0x413c3f[_0x6d04('0x33')]);return db[_0x6d04('0x44')][_0x6d04('0x24')](_0x491de4);}})[_0x6d04('0x14')](function(_0x576149){if(_0x576149){return db[_0x6d04('0x45')][_0x6d04('0x46')]({'where':{'id':_[_0x6d04('0x1e')](_0x576149,_0x6d04('0x47')),'role':_0x6d04('0x48')},'attributes':['id',_0x6d04('0x1b'),_0x6d04('0x49'),_0x6d04('0x4a'),'createdAt']});}})[_0x6d04('0x14')](function(_0x3f9214){if(_0x3f9214){return{'count':_0x3f9214[_0x6d04('0x10')],'rows':_['map'](_0x3f9214[_0x6d04('0x4b')],function(_0x1a60cf){return{'membername':_0x1a60cf['name'],'UserId':_0x1a60cf['id'],'queue_name':_0x291514['name'],'FaxQueueId':_0x291514['id'],'interface':util['format'](_0x6d04('0x4c'),_0x6d04('0x4d'),_0x1a60cf[_0x6d04('0x1b')]),'penalty':0x0,'paused':_0x1a60cf[_0x6d04('0x49')],'createdAt':_0x1a60cf[_0x6d04('0x4e')],'updatedAt':_0x1a60cf[_0x6d04('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6d04('0x14')](respondWithFilteredResult(_0x3d3c66,_0x491de4))[_0x6d04('0x25')](handleError(_0x3d3c66,null));};exports[_0x6d04('0x4f')]=function(_0xb2edae,_0x5c05b6){var _0x5031f1={};var _0x4d4584={};var _0x2da902;var _0x5cd30;return db[_0x6d04('0x1f')][_0x6d04('0x50')]({'where':{'id':_0xb2edae[_0x6d04('0x27')]['id']}})['then'](handleEntityNotFound(_0x5c05b6,null))[_0x6d04('0x14')](function(_0x54d03e){if(_0x54d03e){_0x2da902=_0x54d03e;_0x4d4584[_0x6d04('0x28')]=_[_0x6d04('0x29')](db[_0x6d04('0x51')][_0x6d04('0x52')]);_0x4d4584[_0x6d04('0x2a')]=_[_0x6d04('0x29')](_0xb2edae[_0x6d04('0x2a')]);_0x4d4584[_0x6d04('0x2b')]=_['intersection'](_0x4d4584[_0x6d04('0x28')],_0x4d4584[_0x6d04('0x2a')]);_0x5031f1[_0x6d04('0x2c')]=_[_0x6d04('0x2d')](_0x4d4584[_0x6d04('0x28')],qs[_0x6d04('0x2e')](_0xb2edae[_0x6d04('0x2a')][_0x6d04('0x2e')]));_0x5031f1['attributes']=_0x5031f1[_0x6d04('0x2c')][_0x6d04('0x2f')]?_0x5031f1[_0x6d04('0x2c')]:_0x4d4584[_0x6d04('0x28')];_0x5031f1['order']=qs[_0x6d04('0x3f')](_0xb2edae['query']['sort']);_0x5031f1[_0x6d04('0x40')]=qs[_0x6d04('0x2b')](_[_0x6d04('0x41')](_0xb2edae[_0x6d04('0x2a')],_0x4d4584['filters']));if(_0xb2edae[_0x6d04('0x2a')][_0x6d04('0x43')]){_0x5031f1[_0x6d04('0x40')]=_[_0x6d04('0x32')](_0x5031f1[_0x6d04('0x40')],{'$or':_[_0x6d04('0x1e')](_0x5031f1[_0x6d04('0x2c')],function(_0x37a6a9){var _0x306ed1={};_0x306ed1[_0x37a6a9]={'$like':'%'+_0xb2edae[_0x6d04('0x2a')][_0x6d04('0x43')]+'%'};return _0x306ed1;})});}_0x5031f1=_[_0x6d04('0x32')]({},_0x5031f1,_0xb2edae['options']);return _0x2da902[_0x6d04('0x4f')](_0x5031f1);}})[_0x6d04('0x14')](function(_0x2e4e80){if(_0x2e4e80){_0x5cd30=_0x2e4e80[_0x6d04('0x2f')];if(!_0xb2edae[_0x6d04('0x2a')]['hasOwnProperty'](_0x6d04('0x3e'))){_0x5031f1['limit']=qs['limit'](_0xb2edae[_0x6d04('0x2a')][_0x6d04('0xf')]);_0x5031f1[_0x6d04('0xd')]=qs[_0x6d04('0xd')](_0xb2edae[_0x6d04('0x2a')]['offset']);}return _0x2da902[_0x6d04('0x4f')](_0x5031f1);}})[_0x6d04('0x14')](function(_0x48f40e){if(_0x48f40e){return _0x48f40e?{'count':_0x5cd30,'rows':_0x48f40e}:null;}})['then'](respondWithResult(_0x5c05b6,null))[_0x6d04('0x25')](handleError(_0x5c05b6,null));};exports[_0x6d04('0x53')]=function(_0x1ed804,_0x384ce9){var _0x2b0731=_0x1ed804[_0x6d04('0x36')][_0x6d04('0x54')];return db[_0x6d04('0x51')][_0x6d04('0x24')]({'where':{'id':_0x2b0731},'attributes':['id'],'include':[{'model':db[_0x6d04('0x45')],'as':_0x6d04('0x55'),'attributes':['id',_0x6d04('0x1b'),'online','voicePause',_0x6d04('0x56')],'raw':!![]}]})['then'](function(_0x56f5f1){if(_0x56f5f1){var _0x59b96f=_['flatMap'](_0x56f5f1,function(_0x22bb0b){var _0x392f31=_0x22bb0b[_0x6d04('0x16')]({'plain':!![]});return _0x392f31[_0x6d04('0x55')];});return db[_0x6d04('0x1f')][_0x6d04('0x34')]({'where':{'id':_0x1ed804[_0x6d04('0x27')]['id']}})['then'](function(_0xc96dca){return db[_0x6d04('0x57')][_0x6d04('0x58')](function(_0x44f307){return _0xc96dca[_0x6d04('0x53')](_0x2b0731,{'transaction':_0x44f307})['then'](function(){return BPromise[_0x6d04('0x59')](_0x59b96f,function(_0x5c2fe7){return db[_0x6d04('0x44')][_0x6d04('0x5a')]({'where':{'UserId':_0x5c2fe7['id'],'FaxQueueId':_0x1ed804[_0x6d04('0x27')]['id']},'transaction':_0x44f307});});})[_0x6d04('0x14')](function(){_0x59b96f[_0x6d04('0x5b')](function(_0x39e49f){socket[_0x6d04('0x5c')](_0x6d04('0x5d'),{'UserId':_0x39e49f['id'],'FaxQueueId':_0xc96dca['id']});});});});});}})['then'](respondWithStatusCode(_0x384ce9,null))[_0x6d04('0x25')](handleError(_0x384ce9,null));};exports['removeTeams']=function(_0x58016e,_0x2b373c){return db[_0x6d04('0x51')]['findAll']({'where':{'id':_0x58016e['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x6d04('0x45')],'as':_0x6d04('0x55'),'attributes':['id'],'raw':!![]}]})[_0x6d04('0x14')](handleEntityNotFound(_0x2b373c,null))['then'](function(_0x534ccc){var _0x2d9b4a=_[_0x6d04('0x1e')](_0x534ccc,'id');var _0x3078c5=[];var _0xb09641=[];var _0x1e5d5e=squel['select']();_0x1e5d5e['field']('tq.TeamId')['from'](_0x6d04('0x5e'),'tq')[_0x6d04('0x5f')](_0x6d04('0x60'),'ut',_0x6d04('0x61'))[_0x6d04('0x40')]('FaxQueueId\x20=\x20?',_0x58016e[_0x6d04('0x27')]['id']);for(var _0x4d487c=0x0;_0x4d487c<_0x534ccc[_0x6d04('0x2f')];_0x4d487c+=0x1){let _0x1b6b47=_0x534ccc[_0x4d487c];for(var _0x16a5ba=0x0;_0x16a5ba<_0x1b6b47[_0x6d04('0x55')][_0x6d04('0x2f')];_0x16a5ba+=0x1){let _0xa9e3aa=_0x1b6b47['Agents'][_0x16a5ba];var _0x3fd892=_0x1e5d5e[_0x6d04('0x62')]();_0x3fd892['where'](_0x6d04('0x63'),_0xa9e3aa['id']);_0xb09641[_0x6d04('0x64')](db[_0x6d04('0x57')][_0x6d04('0x2a')](_0x3fd892[_0x6d04('0x65')](),{'type':db[_0x6d04('0x57')][_0x6d04('0x66')][_0x6d04('0x67')]})[_0x6d04('0x14')](function(_0x1fe3b3){if(_0x1fe3b3['length']===0x1){return _0xa9e3aa['id'];}else{var _0x3fe3d4=_['every'](_[_0x6d04('0x1e')](_0x1fe3b3,'TeamId'),function(_0x36068f){return _[_0x6d04('0x68')](_0x2d9b4a,_0x36068f);});if(_0x3fe3d4){return _0xa9e3aa['id'];}}}));}}return BPromise[_0x6d04('0x69')](_0xb09641)[_0x6d04('0x14')](function(_0x40336e){_0x3078c5=_(_0x3078c5)['union'](_0x40336e)[_0x6d04('0x6a')]()[_0x6d04('0x6b')]();return db['FaxQueue'][_0x6d04('0x34')]({'where':{'id':_0x58016e[_0x6d04('0x27')]['id']}})['then'](function(_0x2a6c30){return db['sequelize'][_0x6d04('0x58')](function(_0x51ffba){return _0x2a6c30[_0x6d04('0x6c')](_0x58016e[_0x6d04('0x2a')][_0x6d04('0x54')],{'transaction':_0x51ffba})[_0x6d04('0x14')](function(){if(!_[_0x6d04('0x6d')](_0x3078c5)){return _0x2a6c30[_0x6d04('0x6e')](_0x3078c5,{'transaction':_0x51ffba});}})[_0x6d04('0x14')](function(){_0x3078c5[_0x6d04('0x5b')](function(_0x7c68eb){socket[_0x6d04('0x5c')](_0x6d04('0x6f'),{'UserId':_0x7c68eb,'FaxQueueId':_0x2a6c30['id']});});});});});});})[_0x6d04('0x14')](respondWithStatusCode(_0x2b373c,null))['catch'](handleError(_0x2b373c,null));};exports[_0x6d04('0x70')]=function(_0x1e68c6,_0x2a6067){return db[_0x6d04('0x1f')]['find']({'where':{'id':_0x1e68c6[_0x6d04('0x27')]['id']}})[_0x6d04('0x14')](handleEntityNotFound(_0x2a6067,null))[_0x6d04('0x14')](function(_0x415421){if(_0x415421){return _0x415421[_0x6d04('0x70')](_0x1e68c6[_0x6d04('0x36')][_0x6d04('0x54')],_[_0x6d04('0x71')](_0x1e68c6['body'],[_0x6d04('0x54'),'id'])||{})['spread'](function(_0x164e01){for(var _0x57e551=0x0;_0x57e551<_0x1e68c6[_0x6d04('0x36')][_0x6d04('0x54')][_0x6d04('0x2f')];_0x57e551+=0x1){socket[_0x6d04('0x5c')](_0x6d04('0x5d'),{'UserId':Number(_0x1e68c6[_0x6d04('0x36')]['ids'][_0x57e551]),'FaxQueueId':Number(_0x1e68c6[_0x6d04('0x27')]['id'])});}return _0x164e01;});}})[_0x6d04('0x14')](respondWithResult(_0x2a6067,null))['catch'](handleError(_0x2a6067,null));};exports[_0x6d04('0x6e')]=function(_0x1d3b13,_0x7e911b){return db['FaxQueue'][_0x6d04('0x34')]({'where':{'id':_0x1d3b13[_0x6d04('0x27')]['id']}})[_0x6d04('0x14')](handleEntityNotFound(_0x7e911b,null))[_0x6d04('0x14')](function(_0x407f98){if(_0x407f98){return _0x407f98[_0x6d04('0x6e')](_0x1d3b13[_0x6d04('0x2a')][_0x6d04('0x54')])[_0x6d04('0x14')](function(){if(_[_0x6d04('0x72')](_0x1d3b13[_0x6d04('0x2a')][_0x6d04('0x54')])){for(var _0x93c05c=0x0;_0x93c05c<_0x1d3b13[_0x6d04('0x2a')]['ids'][_0x6d04('0x2f')];_0x93c05c+=0x1){socket[_0x6d04('0x5c')](_0x6d04('0x6f'),{'UserId':Number(_0x1d3b13[_0x6d04('0x2a')]['ids'][_0x93c05c]),'FaxQueueId':Number(_0x1d3b13[_0x6d04('0x27')]['id'])});}}else{socket[_0x6d04('0x5c')](_0x6d04('0x6f'),{'UserId':Number(_0x1d3b13['query'][_0x6d04('0x54')]),'FaxQueueId':Number(_0x1d3b13[_0x6d04('0x27')]['id'])});}});}})[_0x6d04('0x14')](respondWithStatusCode(_0x7e911b,null))[_0x6d04('0x25')](handleError(_0x7e911b,null));};exports[_0x6d04('0x73')]=function(_0x34f4ab,_0x501c55){var _0x921efd={};var _0x4cb092={};var _0x52e9f8;var _0x461d09;return db[_0x6d04('0x1f')][_0x6d04('0x50')]({'where':{'id':_0x34f4ab[_0x6d04('0x27')]['id']}})[_0x6d04('0x14')](handleEntityNotFound(_0x501c55,null))['then'](function(_0x51c452){if(_0x51c452){_0x52e9f8=_0x51c452;_0x4cb092['model']=_[_0x6d04('0x29')](db['User']['rawAttributes']);_0x4cb092[_0x6d04('0x2a')]=_['keys'](_0x34f4ab[_0x6d04('0x2a')]);_0x4cb092[_0x6d04('0x2b')]=_[_0x6d04('0x2d')](_0x4cb092[_0x6d04('0x28')],_0x4cb092[_0x6d04('0x2a')]);_0x921efd[_0x6d04('0x2c')]=_[_0x6d04('0x2d')](_0x4cb092[_0x6d04('0x28')],qs['fields'](_0x34f4ab['query'][_0x6d04('0x2e')]));_0x921efd['attributes']=_0x921efd[_0x6d04('0x2c')][_0x6d04('0x2f')]?_0x921efd['attributes']:_0x4cb092[_0x6d04('0x28')];_0x921efd[_0x6d04('0x74')]=qs['sort'](_0x34f4ab[_0x6d04('0x2a')][_0x6d04('0x3f')]);_0x921efd['where']=qs[_0x6d04('0x2b')](_[_0x6d04('0x41')](_0x34f4ab[_0x6d04('0x2a')],_0x4cb092[_0x6d04('0x2b')]));if(_0x34f4ab[_0x6d04('0x2a')][_0x6d04('0x43')]){_0x921efd[_0x6d04('0x40')]=_['merge'](_0x921efd[_0x6d04('0x40')],{'$or':_[_0x6d04('0x1e')](_0x921efd[_0x6d04('0x2c')],function(_0x444e51){var _0x599e25={};_0x599e25[_0x444e51]={'$like':'%'+_0x34f4ab[_0x6d04('0x2a')][_0x6d04('0x43')]+'%'};return _0x599e25;})});}_0x921efd=_[_0x6d04('0x32')]({},_0x921efd,_0x34f4ab[_0x6d04('0x33')]);return _0x52e9f8['getAgents'](_0x921efd);}})[_0x6d04('0x14')](function(_0x3703ae){if(_0x3703ae){_0x461d09=_0x3703ae[_0x6d04('0x2f')];if(!_0x34f4ab['query'][_0x6d04('0x3d')](_0x6d04('0x3e'))){_0x921efd[_0x6d04('0xf')]=qs[_0x6d04('0xf')](_0x34f4ab[_0x6d04('0x2a')][_0x6d04('0xf')]);_0x921efd[_0x6d04('0xd')]=qs[_0x6d04('0xd')](_0x34f4ab['query'][_0x6d04('0xd')]);}return _0x52e9f8['getAgents'](_0x921efd);}})[_0x6d04('0x14')](function(_0x56e566){if(_0x56e566){return _0x56e566?{'count':_0x461d09,'rows':_0x56e566}:null;}})[_0x6d04('0x14')](respondWithResult(_0x501c55,null))[_0x6d04('0x25')](handleError(_0x501c55,null));}; \ No newline at end of file +var _0x07e8=['clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeAgents','addAgents','omit','spread','userFaxQueue:remove','getAgents','bluebird','util','lodash','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','fieldName','type','key','getOptions','include','query','findAll','rows','catch','show','params','model','keys','rawAttributes','filters','attributes','intersection','fields','merge','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','select','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?'];(function(_0x475139,_0x50ddb1){var _0x4866fb=function(_0x1b5d61){while(--_0x1b5d61){_0x475139['push'](_0x475139['shift']());}};_0x4866fb(++_0x50ddb1);}(_0x07e8,0x10f));var _0x807e=function(_0x291c3d,_0xfdca34){_0x291c3d=_0x291c3d-0x0;var _0x369b5c=_0x07e8[_0x291c3d];return _0x369b5c;};'use strict';var BPromise=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var _=require(_0x807e('0x2'));var squel=require('squel');var Redis=require(_0x807e('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x807e('0x4'))('api');var config=require('../../config/environment');var db=require(_0x807e('0x5'))['db'];config[_0x807e('0x6')]=_[_0x807e('0x7')](config['redis'],{'host':_0x807e('0x8'),'port':0x18eb});var socket=require(_0x807e('0x9'))(new Redis(config[_0x807e('0x6')]));require(_0x807e('0xa'))[_0x807e('0xb')](socket);function respondWithStatusCode(_0x54e3cb,_0x31f652){_0x31f652=_0x31f652||0xcc;return function(_0x348133){if(_0x348133){return _0x54e3cb[_0x807e('0xc')](_0x31f652);}return _0x54e3cb[_0x807e('0xd')](_0x31f652)[_0x807e('0xe')]();};}function respondWithResult(_0x45e953,_0x382931){_0x382931=_0x382931||0xc8;return function(_0x2f44db){if(_0x2f44db){return _0x45e953[_0x807e('0xd')](_0x382931)[_0x807e('0xf')](_0x2f44db);}};}function respondWithFilteredResult(_0x2ca6f0,_0x114866){return function(_0x40d6b9){if(_0x40d6b9){var _0x2792e5=typeof _0x114866['offset']===_0x807e('0x10')&&typeof _0x114866[_0x807e('0x11')]===_0x807e('0x10');var _0x19e72f=_0x40d6b9[_0x807e('0x12')];var _0x46a368=_0x2792e5?0x0:_0x114866[_0x807e('0x13')];var _0x4ee485=_0x2792e5?_0x40d6b9['count']:_0x114866[_0x807e('0x13')]+_0x114866[_0x807e('0x11')];var _0x1d7a09;if(_0x4ee485>=_0x19e72f){_0x4ee485=_0x19e72f;_0x1d7a09=0xc8;}else{_0x1d7a09=0xce;}_0x2ca6f0[_0x807e('0xd')](_0x1d7a09);return _0x2ca6f0['set'](_0x807e('0x14'),_0x46a368+'-'+_0x4ee485+'/'+_0x19e72f)[_0x807e('0xf')](_0x40d6b9);}return null;};}function saveUpdates(_0x1ffc81){return function(_0x2009a2){if(_0x2009a2){return _0x2009a2[_0x807e('0x15')](_0x1ffc81)[_0x807e('0x16')](function(_0x535987){return _0x535987;});}return null;};}function removeEntity(_0x81676e){return function(_0x57af7a){if(_0x57af7a){return _0x57af7a[_0x807e('0x17')]()[_0x807e('0x16')](function(){var _0x30dfa4=_0x57af7a[_0x807e('0x18')]({'plain':!![]});var _0x3fba0b=_0x807e('0x19');return db[_0x807e('0x1a')][_0x807e('0x17')]({'where':{'type':_0x3fba0b,'resourceId':_0x30dfa4['id']}})[_0x807e('0x16')](function(){return _0x57af7a;});})['then'](function(){_0x81676e['status'](0xcc)[_0x807e('0xe')]();});}};}function handleEntityNotFound(_0x23db10){return function(_0x261137){if(!_0x261137){_0x23db10[_0x807e('0xc')](0x194);}return _0x261137;};}function handleError(_0x2c584a,_0x27173a){_0x27173a=_0x27173a||0x1f4;return function(_0x101027){logger[_0x807e('0x1b')](_0x101027['stack']);if(_0x101027[_0x807e('0x1c')]){delete _0x101027[_0x807e('0x1c')];}_0x2c584a[_0x807e('0xd')](_0x27173a)[_0x807e('0x1d')](_0x101027);};}exports[_0x807e('0x1e')]=function(_0x2af212,_0x55f7c9){var _0x277560={};var _0x5c8148={'count':0x0,'rows':[]};var _0x33ba88=_[_0x807e('0x1f')](db[_0x807e('0x20')]['rawAttributes'],function(_0x36bb30){return{'name':_0x36bb30[_0x807e('0x21')],'type':_0x36bb30[_0x807e('0x22')][_0x807e('0x23')]};});_0x277560=qs[_0x807e('0x24')](_0x33ba88,_0x2af212);var _0x3adcc4={'where':_0x277560['where']};return db[_0x807e('0x20')]['count'](_0x3adcc4)[_0x807e('0x16')](function(_0x285e27){_0x5c8148[_0x807e('0x12')]=_0x285e27;_0x277560['include']=qs[_0x807e('0x25')](_0x2af212[_0x807e('0x26')]);return db['FaxQueue'][_0x807e('0x27')](_0x277560);})[_0x807e('0x16')](function(_0x57af90){_0x5c8148[_0x807e('0x28')]=_0x57af90;return _0x5c8148;})[_0x807e('0x16')](respondWithFilteredResult(_0x55f7c9,_0x277560))[_0x807e('0x29')](handleError(_0x55f7c9,null));};exports[_0x807e('0x2a')]=function(_0x3cf499,_0x2a45d8){var _0x493c2a={'raw':!![],'where':{'id':_0x3cf499[_0x807e('0x2b')]['id']}},_0x50a728={};_0x50a728[_0x807e('0x2c')]=_[_0x807e('0x2d')](db[_0x807e('0x20')][_0x807e('0x2e')]);_0x50a728['query']=_['keys'](_0x3cf499[_0x807e('0x26')]);_0x50a728[_0x807e('0x2f')]=_['intersection'](_0x50a728[_0x807e('0x2c')],_0x50a728[_0x807e('0x26')]);_0x493c2a[_0x807e('0x30')]=_[_0x807e('0x31')](_0x50a728[_0x807e('0x2c')],qs[_0x807e('0x32')](_0x3cf499[_0x807e('0x26')][_0x807e('0x32')]));_0x493c2a[_0x807e('0x30')]=_0x493c2a[_0x807e('0x30')]['length']?_0x493c2a[_0x807e('0x30')]:_0x50a728[_0x807e('0x2c')];if(_0x3cf499[_0x807e('0x26')]['includeAll']){_0x493c2a[_0x807e('0x25')]=[{'all':!![]}];}_0x493c2a=_[_0x807e('0x33')]({},_0x493c2a,_0x3cf499[_0x807e('0x34')]);return db['FaxQueue']['find'](_0x493c2a)[_0x807e('0x16')](handleEntityNotFound(_0x2a45d8,null))['then'](respondWithResult(_0x2a45d8,null))['catch'](handleError(_0x2a45d8,null));};exports[_0x807e('0x35')]=function(_0x703909,_0x33c75f){return db[_0x807e('0x20')][_0x807e('0x35')](_0x703909[_0x807e('0x36')],{})[_0x807e('0x16')](function(_0x31596e){var _0x26663f=_0x703909['user']['get']({'plain':!![]});if(!_0x26663f)throw new Error(_0x807e('0x37'));if(_0x26663f['role']===_0x807e('0x38')){var _0x203ff1=_0x31596e[_0x807e('0x18')]({'plain':!![]});var _0x4a242b=_0x807e('0x19');return db[_0x807e('0x39')][_0x807e('0x3a')]({'where':{'name':_0x4a242b,'userProfileId':_0x26663f[_0x807e('0x3b')]},'raw':!![]})['then'](function(_0x53a3d0){if(_0x53a3d0&&_0x53a3d0[_0x807e('0x3c')]===0x0){return db[_0x807e('0x1a')][_0x807e('0x35')]({'name':_0x203ff1[_0x807e('0x1c')],'resourceId':_0x203ff1['id'],'type':_0x53a3d0['name'],'sectionId':_0x53a3d0['id']},{})['then'](function(){return _0x31596e;});}else{return _0x31596e;}})[_0x807e('0x29')](function(_0x226da2){logger[_0x807e('0x1b')](_0x807e('0x3d'),_0x226da2);throw _0x226da2;});}return _0x31596e;})[_0x807e('0x16')](respondWithResult(_0x33c75f,0xc9))[_0x807e('0x29')](handleError(_0x33c75f,null));};exports[_0x807e('0x15')]=function(_0x904874,_0x383534){if(_0x904874[_0x807e('0x36')]['id']){delete _0x904874[_0x807e('0x36')]['id'];}return db[_0x807e('0x20')][_0x807e('0x3a')]({'where':{'id':_0x904874['params']['id']}})[_0x807e('0x16')](handleEntityNotFound(_0x383534,null))['then'](saveUpdates(_0x904874[_0x807e('0x36')],null))[_0x807e('0x16')](respondWithResult(_0x383534,null))['catch'](handleError(_0x383534,null));};exports[_0x807e('0x17')]=function(_0x169ab8,_0x546884){return db['FaxQueue']['find']({'where':{'id':_0x169ab8['params']['id']}})[_0x807e('0x16')](handleEntityNotFound(_0x546884,null))[_0x807e('0x16')](removeEntity(_0x546884,null))[_0x807e('0x29')](handleError(_0x546884,null));};exports[_0x807e('0x3e')]=function(_0xe6c0d8,_0x1c3a1b){return db[_0x807e('0x20')]['describe']()['then'](respondWithResult(_0x1c3a1b,null))['catch'](handleError(_0x1c3a1b,null));};exports[_0x807e('0x3f')]=function(_0x207a7d,_0xf59443){var _0x127f76={'raw':!![],'where':{}},_0x30c9c8={},_0x17da49;return db['FaxQueue'][_0x807e('0x40')]({'where':{'id':_0x207a7d[_0x807e('0x2b')]['id']}})[_0x807e('0x16')](handleEntityNotFound(_0xf59443,null))[_0x807e('0x16')](function(_0x3671ab){if(_0x3671ab){_0x17da49=_0x3671ab[_0x807e('0x18')]({'plain':!![]});_0x30c9c8[_0x807e('0x2c')]=_[_0x807e('0x2d')](db[_0x807e('0x41')][_0x807e('0x2e')]);_0x30c9c8[_0x807e('0x26')]=_['keys'](_0x207a7d['query']);_0x30c9c8[_0x807e('0x2f')]=_['intersection'](_0x30c9c8['model'],_0x30c9c8['query']);_0x127f76['attributes']=_[_0x807e('0x31')](_0x30c9c8['model'],qs[_0x807e('0x32')](_0x207a7d[_0x807e('0x26')]['fields']));_0x127f76[_0x807e('0x30')]=_0x127f76[_0x807e('0x30')][_0x807e('0x42')]?_0x127f76[_0x807e('0x30')]:_0x30c9c8[_0x807e('0x2c')];if(!_0x207a7d[_0x807e('0x26')][_0x807e('0x43')](_0x807e('0x44'))){_0x127f76[_0x807e('0x11')]=qs[_0x807e('0x11')](_0x207a7d[_0x807e('0x26')][_0x807e('0x11')]);_0x127f76['offset']=qs['offset'](_0x207a7d['query'][_0x807e('0x13')]);}_0x127f76[_0x807e('0x45')]=qs[_0x807e('0x46')](_0x207a7d[_0x807e('0x26')][_0x807e('0x46')]);_0x127f76[_0x807e('0x47')]=qs[_0x807e('0x2f')](_[_0x807e('0x48')](_0x207a7d[_0x807e('0x26')],_0x30c9c8[_0x807e('0x2f')]));_0x127f76[_0x807e('0x47')]['FaxQueueId']=_0x3671ab['id'];if(_0x207a7d[_0x807e('0x26')][_0x807e('0x49')]){_0x127f76[_0x807e('0x47')]=_['merge'](_0x127f76[_0x807e('0x47')],{'$or':_[_0x807e('0x1f')](_0x127f76[_0x807e('0x30')],function(_0x459a0d){var _0x489705={};_0x489705[_0x459a0d]={'$like':'%'+_0x207a7d['query'][_0x807e('0x49')]+'%'};return _0x489705;})});}_0x127f76=_['merge']({},_0x127f76,_0x207a7d[_0x807e('0x34')]);return db['UserFaxQueue'][_0x807e('0x27')](_0x127f76);}})[_0x807e('0x16')](function(_0x1029c7){if(_0x1029c7){return db[_0x807e('0x4a')][_0x807e('0x4b')]({'where':{'id':_[_0x807e('0x1f')](_0x1029c7,_0x807e('0x4c')),'role':_0x807e('0x4d')},'attributes':['id',_0x807e('0x1c'),_0x807e('0x4e'),_0x807e('0x4f'),_0x807e('0x50')]});}})[_0x807e('0x16')](function(_0x1451e0){if(_0x1451e0){return{'count':_0x1451e0[_0x807e('0x12')],'rows':_[_0x807e('0x1f')](_0x1451e0[_0x807e('0x28')],function(_0x4f4c4f){return{'membername':_0x4f4c4f['name'],'UserId':_0x4f4c4f['id'],'queue_name':_0x17da49[_0x807e('0x1c')],'FaxQueueId':_0x17da49['id'],'interface':util[_0x807e('0x51')](_0x807e('0x52'),_0x807e('0x53'),_0x4f4c4f[_0x807e('0x1c')]),'penalty':0x0,'paused':_0x4f4c4f[_0x807e('0x4e')],'createdAt':_0x4f4c4f[_0x807e('0x50')],'updatedAt':_0x4f4c4f[_0x807e('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x807e('0x16')](respondWithFilteredResult(_0xf59443,_0x127f76))[_0x807e('0x29')](handleError(_0xf59443,null));};exports[_0x807e('0x54')]=function(_0x252b5a,_0x4d051c){var _0x43d370={};var _0x5bdc81={};var _0x193589;var _0x26490b;return db[_0x807e('0x20')][_0x807e('0x40')]({'where':{'id':_0x252b5a[_0x807e('0x2b')]['id']}})[_0x807e('0x16')](handleEntityNotFound(_0x4d051c,null))['then'](function(_0x143441){if(_0x143441){_0x193589=_0x143441;_0x5bdc81['model']=_[_0x807e('0x2d')](db['Team'][_0x807e('0x2e')]);_0x5bdc81[_0x807e('0x26')]=_['keys'](_0x252b5a['query']);_0x5bdc81[_0x807e('0x2f')]=_[_0x807e('0x31')](_0x5bdc81['model'],_0x5bdc81[_0x807e('0x26')]);_0x43d370[_0x807e('0x30')]=_[_0x807e('0x31')](_0x5bdc81[_0x807e('0x2c')],qs['fields'](_0x252b5a[_0x807e('0x26')][_0x807e('0x32')]));_0x43d370[_0x807e('0x30')]=_0x43d370[_0x807e('0x30')]['length']?_0x43d370[_0x807e('0x30')]:_0x5bdc81[_0x807e('0x2c')];_0x43d370[_0x807e('0x45')]=qs[_0x807e('0x46')](_0x252b5a[_0x807e('0x26')][_0x807e('0x46')]);_0x43d370[_0x807e('0x47')]=qs[_0x807e('0x2f')](_['pick'](_0x252b5a[_0x807e('0x26')],_0x5bdc81[_0x807e('0x2f')]));if(_0x252b5a[_0x807e('0x26')][_0x807e('0x49')]){_0x43d370[_0x807e('0x47')]=_[_0x807e('0x33')](_0x43d370[_0x807e('0x47')],{'$or':_[_0x807e('0x1f')](_0x43d370['attributes'],function(_0xa49198){var _0x5b4091={};_0x5b4091[_0xa49198]={'$like':'%'+_0x252b5a[_0x807e('0x26')]['filter']+'%'};return _0x5b4091;})});}_0x43d370=_['merge']({},_0x43d370,_0x252b5a['options']);return _0x193589[_0x807e('0x54')](_0x43d370);}})[_0x807e('0x16')](function(_0x50ac7e){if(_0x50ac7e){_0x26490b=_0x50ac7e[_0x807e('0x42')];if(!_0x252b5a[_0x807e('0x26')][_0x807e('0x43')](_0x807e('0x44'))){_0x43d370[_0x807e('0x11')]=qs[_0x807e('0x11')](_0x252b5a[_0x807e('0x26')]['limit']);_0x43d370[_0x807e('0x13')]=qs['offset'](_0x252b5a[_0x807e('0x26')][_0x807e('0x13')]);}return _0x193589[_0x807e('0x54')](_0x43d370);}})['then'](function(_0x4d15a7){if(_0x4d15a7){return _0x4d15a7?{'count':_0x26490b,'rows':_0x4d15a7}:null;}})[_0x807e('0x16')](respondWithResult(_0x4d051c,null))[_0x807e('0x29')](handleError(_0x4d051c,null));};exports[_0x807e('0x55')]=function(_0x1994f6,_0x42499c){var _0x7512f8=_0x1994f6[_0x807e('0x36')][_0x807e('0x56')];return db[_0x807e('0x57')]['findAll']({'where':{'id':_0x7512f8},'attributes':['id'],'include':[{'model':db[_0x807e('0x4a')],'as':_0x807e('0x58'),'attributes':['id',_0x807e('0x1c'),_0x807e('0x59'),_0x807e('0x5a'),_0x807e('0x5b')],'raw':!![]}]})[_0x807e('0x16')](function(_0x39ee5b){if(_0x39ee5b){var _0x3a7bf7=_['flatMap'](_0x39ee5b,function(_0x3ab7bb){var _0x5583b3=_0x3ab7bb[_0x807e('0x18')]({'plain':!![]});return _0x5583b3[_0x807e('0x58')];});return db[_0x807e('0x20')][_0x807e('0x3a')]({'where':{'id':_0x1994f6[_0x807e('0x2b')]['id']}})['then'](function(_0x2f0572){return db['sequelize'][_0x807e('0x5c')](function(_0x3b1225){return _0x2f0572['addTeams'](_0x7512f8,{'transaction':_0x3b1225})[_0x807e('0x16')](function(){return BPromise[_0x807e('0x5d')](_0x3a7bf7,function(_0x13ca96){return db['UserFaxQueue'][_0x807e('0x5e')]({'where':{'UserId':_0x13ca96['id'],'FaxQueueId':_0x1994f6[_0x807e('0x2b')]['id']},'transaction':_0x3b1225});});})['then'](function(){_0x3a7bf7[_0x807e('0x5f')](function(_0xf47ff8){socket[_0x807e('0x60')](_0x807e('0x61'),{'UserId':_0xf47ff8['id'],'FaxQueueId':_0x2f0572['id']});});});});});}})['then'](respondWithStatusCode(_0x42499c,null))[_0x807e('0x29')](handleError(_0x42499c,null));};exports[_0x807e('0x62')]=function(_0x64d5ad,_0x1e073f){return db['Team'][_0x807e('0x27')]({'where':{'id':_0x64d5ad[_0x807e('0x26')][_0x807e('0x56')]},'attributes':['id'],'include':[{'model':db[_0x807e('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e073f,null))[_0x807e('0x16')](function(_0x23c6d4){var _0x32f229=_[_0x807e('0x1f')](_0x23c6d4,'id');var _0x4463b6=[];var _0x371c16=[];var _0x4e6968=squel[_0x807e('0x63')]();_0x4e6968['field'](_0x807e('0x64'))[_0x807e('0x65')](_0x807e('0x66'),'tq')[_0x807e('0x67')](_0x807e('0x68'),'ut',_0x807e('0x69'))[_0x807e('0x47')](_0x807e('0x6a'),_0x64d5ad[_0x807e('0x2b')]['id']);for(var _0x5949f6=0x0;_0x5949f6<_0x23c6d4[_0x807e('0x42')];_0x5949f6+=0x1){let _0x234c13=_0x23c6d4[_0x5949f6];for(var _0x50bdee=0x0;_0x50bdee<_0x234c13[_0x807e('0x58')][_0x807e('0x42')];_0x50bdee+=0x1){let _0x134275=_0x234c13[_0x807e('0x58')][_0x50bdee];var _0xd5b1c=_0x4e6968[_0x807e('0x6b')]();_0xd5b1c[_0x807e('0x47')](_0x807e('0x6c'),_0x134275['id']);_0x371c16[_0x807e('0x6d')](db[_0x807e('0x6e')][_0x807e('0x26')](_0xd5b1c[_0x807e('0x6f')](),{'type':db[_0x807e('0x6e')][_0x807e('0x70')][_0x807e('0x71')]})[_0x807e('0x16')](function(_0x44e61b){if(_0x44e61b[_0x807e('0x42')]===0x1){return _0x134275['id'];}else{var _0x28c491=_[_0x807e('0x72')](_['map'](_0x44e61b,_0x807e('0x73')),function(_0x295ca1){return _[_0x807e('0x74')](_0x32f229,_0x295ca1);});if(_0x28c491){return _0x134275['id'];}}}));}}return BPromise[_0x807e('0x75')](_0x371c16)[_0x807e('0x16')](function(_0x4dfda){_0x4463b6=_(_0x4463b6)[_0x807e('0x76')](_0x4dfda)['compact']()[_0x807e('0x77')]();return db[_0x807e('0x20')][_0x807e('0x3a')]({'where':{'id':_0x64d5ad['params']['id']}})[_0x807e('0x16')](function(_0x31cda0){return db[_0x807e('0x6e')][_0x807e('0x5c')](function(_0x69a8e5){return _0x31cda0[_0x807e('0x62')](_0x64d5ad[_0x807e('0x26')]['ids'],{'transaction':_0x69a8e5})[_0x807e('0x16')](function(){if(!_['isEmpty'](_0x4463b6)){return _0x31cda0[_0x807e('0x78')](_0x4463b6,{'transaction':_0x69a8e5});}})[_0x807e('0x16')](function(){_0x4463b6[_0x807e('0x5f')](function(_0x4a4409){socket['emit']('userFaxQueue:remove',{'UserId':_0x4a4409,'FaxQueueId':_0x31cda0['id']});});});});});});})[_0x807e('0x16')](respondWithStatusCode(_0x1e073f,null))[_0x807e('0x29')](handleError(_0x1e073f,null));};exports[_0x807e('0x79')]=function(_0x33c529,_0x5ca703){return db[_0x807e('0x20')][_0x807e('0x3a')]({'where':{'id':_0x33c529['params']['id']}})['then'](handleEntityNotFound(_0x5ca703,null))['then'](function(_0x18a971){if(_0x18a971){return _0x18a971[_0x807e('0x79')](_0x33c529[_0x807e('0x36')][_0x807e('0x56')],_[_0x807e('0x7a')](_0x33c529[_0x807e('0x36')],[_0x807e('0x56'),'id'])||{})[_0x807e('0x7b')](function(_0x225b62){for(var _0x5969ff=0x0;_0x5969ff<_0x33c529[_0x807e('0x36')]['ids'][_0x807e('0x42')];_0x5969ff+=0x1){socket[_0x807e('0x60')](_0x807e('0x61'),{'UserId':Number(_0x33c529['body'][_0x807e('0x56')][_0x5969ff]),'FaxQueueId':Number(_0x33c529[_0x807e('0x2b')]['id'])});}return _0x225b62;});}})['then'](respondWithResult(_0x5ca703,null))[_0x807e('0x29')](handleError(_0x5ca703,null));};exports[_0x807e('0x78')]=function(_0x3e1894,_0x503879){return db['FaxQueue'][_0x807e('0x3a')]({'where':{'id':_0x3e1894[_0x807e('0x2b')]['id']}})[_0x807e('0x16')](handleEntityNotFound(_0x503879,null))[_0x807e('0x16')](function(_0x406ab4){if(_0x406ab4){return _0x406ab4[_0x807e('0x78')](_0x3e1894[_0x807e('0x26')][_0x807e('0x56')])[_0x807e('0x16')](function(){if(_['isArray'](_0x3e1894[_0x807e('0x26')][_0x807e('0x56')])){for(var _0x4f4820=0x0;_0x4f4820<_0x3e1894[_0x807e('0x26')][_0x807e('0x56')]['length'];_0x4f4820+=0x1){socket[_0x807e('0x60')](_0x807e('0x7c'),{'UserId':Number(_0x3e1894[_0x807e('0x26')][_0x807e('0x56')][_0x4f4820]),'FaxQueueId':Number(_0x3e1894['params']['id'])});}}else{socket[_0x807e('0x60')](_0x807e('0x7c'),{'UserId':Number(_0x3e1894[_0x807e('0x26')][_0x807e('0x56')]),'FaxQueueId':Number(_0x3e1894['params']['id'])});}});}})[_0x807e('0x16')](respondWithStatusCode(_0x503879,null))[_0x807e('0x29')](handleError(_0x503879,null));};exports[_0x807e('0x7d')]=function(_0x200622,_0x1fbcf6){var _0x95bbc3={};var _0xd1a1e3={};var _0x4500bb;var _0xcf9bec;return db['FaxQueue'][_0x807e('0x40')]({'where':{'id':_0x200622[_0x807e('0x2b')]['id']}})[_0x807e('0x16')](handleEntityNotFound(_0x1fbcf6,null))['then'](function(_0x4e2e30){if(_0x4e2e30){_0x4500bb=_0x4e2e30;_0xd1a1e3[_0x807e('0x2c')]=_[_0x807e('0x2d')](db[_0x807e('0x4a')][_0x807e('0x2e')]);_0xd1a1e3['query']=_[_0x807e('0x2d')](_0x200622[_0x807e('0x26')]);_0xd1a1e3[_0x807e('0x2f')]=_[_0x807e('0x31')](_0xd1a1e3[_0x807e('0x2c')],_0xd1a1e3['query']);_0x95bbc3['attributes']=_[_0x807e('0x31')](_0xd1a1e3['model'],qs['fields'](_0x200622[_0x807e('0x26')][_0x807e('0x32')]));_0x95bbc3['attributes']=_0x95bbc3['attributes'][_0x807e('0x42')]?_0x95bbc3[_0x807e('0x30')]:_0xd1a1e3['model'];_0x95bbc3[_0x807e('0x45')]=qs[_0x807e('0x46')](_0x200622[_0x807e('0x26')][_0x807e('0x46')]);_0x95bbc3['where']=qs[_0x807e('0x2f')](_['pick'](_0x200622[_0x807e('0x26')],_0xd1a1e3[_0x807e('0x2f')]));if(_0x200622[_0x807e('0x26')]['filter']){_0x95bbc3['where']=_[_0x807e('0x33')](_0x95bbc3['where'],{'$or':_[_0x807e('0x1f')](_0x95bbc3[_0x807e('0x30')],function(_0x122811){var _0x15b358={};_0x15b358[_0x122811]={'$like':'%'+_0x200622['query'][_0x807e('0x49')]+'%'};return _0x15b358;})});}_0x95bbc3=_['merge']({},_0x95bbc3,_0x200622[_0x807e('0x34')]);return _0x4500bb[_0x807e('0x7d')](_0x95bbc3);}})[_0x807e('0x16')](function(_0x17db56){if(_0x17db56){_0xcf9bec=_0x17db56[_0x807e('0x42')];if(!_0x200622[_0x807e('0x26')][_0x807e('0x43')]('nolimit')){_0x95bbc3[_0x807e('0x11')]=qs['limit'](_0x200622[_0x807e('0x26')][_0x807e('0x11')]);_0x95bbc3[_0x807e('0x13')]=qs['offset'](_0x200622[_0x807e('0x26')][_0x807e('0x13')]);}return _0x4500bb['getAgents'](_0x95bbc3);}})[_0x807e('0x16')](function(_0x18262c){if(_0x18262c){return _0x18262c?{'count':_0xcf9bec,'rows':_0x18262c}:null;}})[_0x807e('0x16')](respondWithResult(_0x1fbcf6,null))[_0x807e('0x29')](handleError(_0x1fbcf6,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 9b4c843..11699e1 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 _0xddf2=['update','remove','emit','exports','events','../../mysqldb','FaxQueue','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xddf2,0x134));var _0x2ddf=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xddf2[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x2ddf('0x0'));var FaxQueue=require(_0x2ddf('0x1'))['db'][_0x2ddf('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2ddf('0x3'),'afterUpdate':_0x2ddf('0x4'),'afterDestroy':_0x2ddf('0x5')};function emitEvent(_0x1fbe40){return function(_0x142bbb,_0x1e89df,_0x2beebb){FaxQueueEvents[_0x2ddf('0x6')](_0x1fbe40+':'+_0x142bbb['id'],_0x142bbb);FaxQueueEvents[_0x2ddf('0x6')](_0x1fbe40,_0x142bbb);_0x2beebb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x2ddf('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xe6ae=['hook','events','FaxQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x5a005c,_0xf40d1e){var _0x5698cc=function(_0x48f86f){while(--_0x48f86f){_0x5a005c['push'](_0x5a005c['shift']());}};_0x5698cc(++_0xf40d1e);}(_0xe6ae,0xc1));var _0xee6a=function(_0x1d58b0,_0x118f1f){_0x1d58b0=_0x1d58b0-0x0;var _0x458b41=_0xe6ae[_0x1d58b0];return _0x458b41;};'use strict';var EventEmitter=require(_0xee6a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xee6a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee6a('0x2'),'afterUpdate':_0xee6a('0x3'),'afterDestroy':_0xee6a('0x4')};function emitEvent(_0x67b982){return function(_0x492c2b,_0xcbe526,_0x1e6a56){FaxQueueEvents[_0xee6a('0x5')](_0x67b982+':'+_0x492c2b['id'],_0x492c2b);FaxQueueEvents[_0xee6a('0x5')](_0x67b982,_0x492c2b);_0x1e6a56(null);};}for(var e in events){if(events[_0xee6a('0x6')](e)){var event=events[e];FaxQueue[_0xee6a('0x7')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b656b5a..37f8f68 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 _0xd68d=['./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0xd68d,0x1cc));var _0xdd68=function(_0x4bb017,_0x496d0a){_0x4bb017=_0x4bb017-0x0;var _0x3b4d70=_0xd68d[_0x4bb017];return _0x3b4d70;};'use strict';var _=require('lodash');var util=require(_0xdd68('0x0'));var logger=require(_0xdd68('0x1'))(_0xdd68('0x2'));var moment=require(_0xdd68('0x3'));var BPromise=require(_0xdd68('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd68('0x5'));var rimraf=require(_0xdd68('0x6'));var config=require(_0xdd68('0x7'));var attributes=require(_0xdd68('0x8'));module[_0xdd68('0x9')]=function(_0x207b76,_0x306dcb){return _0x207b76[_0xdd68('0xa')](_0xdd68('0xb'),attributes,{'tableName':_0xdd68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7869=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','api'];(function(_0x5ef1f4,_0x31055c){var _0x42ee95=function(_0x48fcf5){while(--_0x48fcf5){_0x5ef1f4['push'](_0x5ef1f4['shift']());}};_0x42ee95(++_0x31055c);}(_0x7869,0x1e7));var _0x9786=function(_0x360fff,_0xc69cc9){_0x360fff=_0x360fff-0x0;var _0x202b07=_0x7869[_0x360fff];return _0x202b07;};'use strict';var _=require(_0x9786('0x0'));var util=require(_0x9786('0x1'));var logger=require('../../config/logger')(_0x9786('0x2'));var moment=require(_0x9786('0x3'));var BPromise=require(_0x9786('0x4'));var rp=require(_0x9786('0x5'));var fs=require('fs');var path=require(_0x9786('0x6'));var rimraf=require(_0x9786('0x7'));var config=require(_0x9786('0x8'));var attributes=require(_0x9786('0x9'));module[_0x9786('0xa')]=function(_0x15a24a,_0x586d3e){return _0x15a24a[_0x9786('0xb')](_0x9786('0xc'),attributes,{'tableName':_0x9786('0xd'),'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 68f1876..bd2e71f 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 _0x9747=['then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','options','raw','where','include','attributes','map','model','GetFaxQueue','ShowFaxQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x35bfac,_0x514348){var _0x312938=function(_0x303642){while(--_0x303642){_0x35bfac['push'](_0x35bfac['shift']());}};_0x312938(++_0x514348);}(_0x9747,0xb7));var _0x7974=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9747[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7974('0x0'));var util=require(_0x7974('0x1'));var moment=require('moment');var BPromise=require(_0x7974('0x2'));var rs=require(_0x7974('0x3'));var fs=require('fs');var Redis=require(_0x7974('0x4'));var db=require(_0x7974('0x5'))['db'];var utils=require(_0x7974('0x6'));var logger=require(_0x7974('0x7'))(_0x7974('0x8'));var config=require(_0x7974('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7974('0xa')]({'port':0x232a});config[_0x7974('0xb')]=_[_0x7974('0xc')](config[_0x7974('0xb')],{'host':_0x7974('0xd'),'port':0x18eb});var socket=require(_0x7974('0xe'))(new Redis(config[_0x7974('0xb')]));require('./faxQueue.socket')[_0x7974('0xf')](socket);function respondWithRpcPromise(_0x59f960,_0x3fe59e,_0x46087a){return new BPromise(function(_0x52f11a,_0x4ea564){return client[_0x7974('0x10')](_0x59f960,_0x46087a)[_0x7974('0x11')](function(_0x22cc94){logger[_0x7974('0x12')](_0x7974('0x13'),_0x3fe59e,_0x7974('0x14'));logger[_0x7974('0x15')](_0x7974('0x16'),_0x3fe59e,_0x7974('0x14'),JSON[_0x7974('0x17')](_0x22cc94));if(_0x22cc94[_0x7974('0x18')]){if(_0x22cc94[_0x7974('0x18')][_0x7974('0x19')]===0x1f4){logger[_0x7974('0x18')](_0x7974('0x13'),_0x3fe59e,_0x22cc94[_0x7974('0x18')][_0x7974('0x1a')]);return _0x4ea564(_0x22cc94[_0x7974('0x18')][_0x7974('0x1a')]);}logger[_0x7974('0x18')](_0x7974('0x13'),_0x3fe59e,_0x22cc94[_0x7974('0x18')][_0x7974('0x1a')]);return _0x52f11a(_0x22cc94[_0x7974('0x18')][_0x7974('0x1a')]);}else{logger['info'](_0x7974('0x13'),_0x3fe59e,_0x7974('0x14'));_0x52f11a(_0x22cc94[_0x7974('0x1b')][_0x7974('0x1a')]);}})[_0x7974('0x1c')](function(_0x495c7f){logger['error'](_0x7974('0x13'),_0x3fe59e,_0x495c7f);_0x4ea564(_0x495c7f);});});}exports['GetFaxQueue']=function(_0x2c0a37){var _0x485098=this;return new Promise(function(_0x3b6e10,_0x299009){return db[_0x7974('0x1d')]['findAll']({'raw':_0x2c0a37['options']?_0x2c0a37[_0x7974('0x1e')][_0x7974('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c0a37[_0x7974('0x1e')]?_0x2c0a37[_0x7974('0x1e')][_0x7974('0x20')]||null:null,'attributes':_0x2c0a37[_0x7974('0x1e')]?_0x2c0a37[_0x7974('0x1e')]['attributes']||null:null,'limit':_0x2c0a37[_0x7974('0x1e')]?_0x2c0a37[_0x7974('0x1e')]['limit']||null:null,'include':_0x2c0a37[_0x7974('0x1e')]?_0x2c0a37['options'][_0x7974('0x21')]?_['map'](_0x2c0a37[_0x7974('0x1e')][_0x7974('0x21')],function(_0x301ac3){return{'model':db[_0x301ac3['model']],'as':_0x301ac3['as'],'attributes':_0x301ac3[_0x7974('0x22')],'include':_0x301ac3[_0x7974('0x21')]?_[_0x7974('0x23')](_0x301ac3['include'],function(_0x49dbe3){return{'model':db[_0x49dbe3[_0x7974('0x24')]],'as':_0x49dbe3['as'],'attributes':_0x49dbe3['attributes'],'include':_0x49dbe3[_0x7974('0x21')]?_[_0x7974('0x23')](_0x49dbe3[_0x7974('0x21')],function(_0x250b2e){return{'model':db[_0x250b2e[_0x7974('0x24')]],'as':_0x250b2e['as'],'attributes':_0x250b2e[_0x7974('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7974('0x11')](function(_0xb14dbd){logger[_0x7974('0x12')](_0x7974('0x25'),_0x2c0a37);logger['debug']('GetFaxQueue',_0x2c0a37,JSON[_0x7974('0x17')](_0xb14dbd));_0x3b6e10(_0xb14dbd);})[_0x7974('0x1c')](function(_0x299e4d){logger[_0x7974('0x18')](_0x7974('0x25'),_0x299e4d['message'],_0x2c0a37);_0x299009(_0x485098['error'](0x1f4,_0x299e4d[_0x7974('0x1a')]));});});};exports[_0x7974('0x26')]=function(_0x4451bb){var _0x3f5546=this;return new Promise(function(_0x3715eb,_0x4b993c){return db[_0x7974('0x1d')][_0x7974('0x27')]({'raw':_0x4451bb[_0x7974('0x1e')]?_0x4451bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x4451bb[_0x7974('0x1e')]?_0x4451bb[_0x7974('0x1e')]['where']||null:null,'attributes':_0x4451bb['options']?_0x4451bb['options'][_0x7974('0x22')]||null:null,'include':_0x4451bb[_0x7974('0x1e')]?_0x4451bb[_0x7974('0x1e')][_0x7974('0x21')]?_['map'](_0x4451bb[_0x7974('0x1e')]['include'],function(_0x266fea){return{'model':db[_0x266fea[_0x7974('0x24')]],'as':_0x266fea['as'],'attributes':_0x266fea[_0x7974('0x22')],'include':_0x266fea[_0x7974('0x21')]?_[_0x7974('0x23')](_0x266fea[_0x7974('0x21')],function(_0x17b53c){return{'model':db[_0x17b53c['model']],'as':_0x17b53c['as'],'attributes':_0x17b53c[_0x7974('0x22')],'include':_0x17b53c['include']?_[_0x7974('0x23')](_0x17b53c['include'],function(_0x5a0ab1){return{'model':db[_0x5a0ab1[_0x7974('0x24')]],'as':_0x5a0ab1['as'],'attributes':_0x5a0ab1[_0x7974('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7974('0x11')](function(_0x327212){logger[_0x7974('0x12')](_0x7974('0x26'),_0x4451bb);logger[_0x7974('0x15')](_0x7974('0x26'),_0x4451bb,JSON[_0x7974('0x17')](_0x327212));_0x3715eb(_0x327212);})[_0x7974('0x1c')](function(_0x22d5bd){logger[_0x7974('0x18')](_0x7974('0x26'),_0x22d5bd[_0x7974('0x1a')],_0x4451bb);_0x4b993c(_0x3f5546['error'](0x1f4,_0x22d5bd['message']));});});}; \ No newline at end of file +var _0x0743=['../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','request','then','info','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','FaxQueue','options','raw','where','attributes','limit','map','model','include','GetFaxQueue','find','ShowFaxQueue','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x23ecec,_0xcbcb5e){var _0x49dd33=function(_0x4e3aa2){while(--_0x4e3aa2){_0x23ecec['push'](_0x23ecec['shift']());}};_0x49dd33(++_0xcbcb5e);}(_0x0743,0x70));var _0x3074=function(_0x2e6d86,_0x1e4082){_0x2e6d86=_0x2e6d86-0x0;var _0x5d7dae=_0x0743[_0x2e6d86];return _0x5d7dae;};'use strict';var _=require(_0x3074('0x0'));var util=require('util');var moment=require(_0x3074('0x1'));var BPromise=require(_0x3074('0x2'));var rs=require(_0x3074('0x3'));var fs=require('fs');var Redis=require(_0x3074('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3074('0x5'));var logger=require(_0x3074('0x6'))('rpc');var config=require(_0x3074('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3074('0x8')]['http']({'port':0x232a});config[_0x3074('0x9')]=_[_0x3074('0xa')](config[_0x3074('0x9')],{'host':_0x3074('0xb'),'port':0x18eb});var socket=require(_0x3074('0xc'))(new Redis(config[_0x3074('0x9')]));require(_0x3074('0xd'))['register'](socket);function respondWithRpcPromise(_0x25a3dc,_0x525033,_0x488be8){return new BPromise(function(_0x263506,_0x1524cb){return client[_0x3074('0xe')](_0x25a3dc,_0x488be8)[_0x3074('0xf')](function(_0x419cef){logger[_0x3074('0x10')]('FaxQueue,\x20%s,\x20%s',_0x525033,'request\x20sent');logger[_0x3074('0x11')](_0x3074('0x12'),_0x525033,_0x3074('0x13'),JSON[_0x3074('0x14')](_0x419cef));if(_0x419cef[_0x3074('0x15')]){if(_0x419cef[_0x3074('0x15')][_0x3074('0x16')]===0x1f4){logger['error'](_0x3074('0x17'),_0x525033,_0x419cef[_0x3074('0x15')][_0x3074('0x18')]);return _0x1524cb(_0x419cef[_0x3074('0x15')][_0x3074('0x18')]);}logger[_0x3074('0x15')]('FaxQueue,\x20%s,\x20%s',_0x525033,_0x419cef[_0x3074('0x15')][_0x3074('0x18')]);return _0x263506(_0x419cef[_0x3074('0x15')][_0x3074('0x18')]);}else{logger[_0x3074('0x10')](_0x3074('0x17'),_0x525033,_0x3074('0x13'));_0x263506(_0x419cef[_0x3074('0x19')][_0x3074('0x18')]);}})[_0x3074('0x1a')](function(_0x3eeef1){logger[_0x3074('0x15')]('FaxQueue,\x20%s,\x20%s',_0x525033,_0x3eeef1);_0x1524cb(_0x3eeef1);});});}exports['GetFaxQueue']=function(_0x26bdfc){var _0x2048aa=this;return new Promise(function(_0xb2d249,_0x16f79d){return db[_0x3074('0x1b')]['findAll']({'raw':_0x26bdfc['options']?_0x26bdfc[_0x3074('0x1c')][_0x3074('0x1d')]===undefined?!![]:![]:!![],'where':_0x26bdfc[_0x3074('0x1c')]?_0x26bdfc[_0x3074('0x1c')][_0x3074('0x1e')]||null:null,'attributes':_0x26bdfc[_0x3074('0x1c')]?_0x26bdfc[_0x3074('0x1c')][_0x3074('0x1f')]||null:null,'limit':_0x26bdfc['options']?_0x26bdfc[_0x3074('0x1c')][_0x3074('0x20')]||null:null,'include':_0x26bdfc[_0x3074('0x1c')]?_0x26bdfc[_0x3074('0x1c')]['include']?_[_0x3074('0x21')](_0x26bdfc[_0x3074('0x1c')]['include'],function(_0x3e1a20){return{'model':db[_0x3e1a20[_0x3074('0x22')]],'as':_0x3e1a20['as'],'attributes':_0x3e1a20[_0x3074('0x1f')],'include':_0x3e1a20[_0x3074('0x23')]?_[_0x3074('0x21')](_0x3e1a20[_0x3074('0x23')],function(_0x28a85f){return{'model':db[_0x28a85f[_0x3074('0x22')]],'as':_0x28a85f['as'],'attributes':_0x28a85f['attributes'],'include':_0x28a85f['include']?_[_0x3074('0x21')](_0x28a85f[_0x3074('0x23')],function(_0x256231){return{'model':db[_0x256231[_0x3074('0x22')]],'as':_0x256231['as'],'attributes':_0x256231['attributes']};}):[]};}):[]};}):[]:[]})[_0x3074('0xf')](function(_0x409898){logger['info'](_0x3074('0x24'),_0x26bdfc);logger[_0x3074('0x11')]('GetFaxQueue',_0x26bdfc,JSON[_0x3074('0x14')](_0x409898));_0xb2d249(_0x409898);})[_0x3074('0x1a')](function(_0x597632){logger['error'](_0x3074('0x24'),_0x597632[_0x3074('0x18')],_0x26bdfc);_0x16f79d(_0x2048aa['error'](0x1f4,_0x597632[_0x3074('0x18')]));});});};exports['ShowFaxQueue']=function(_0x2cd166){var _0xcf2600=this;return new Promise(function(_0x18ec0e,_0x40b7cf){return db[_0x3074('0x1b')][_0x3074('0x25')]({'raw':_0x2cd166['options']?_0x2cd166[_0x3074('0x1c')][_0x3074('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cd166[_0x3074('0x1c')]?_0x2cd166['options'][_0x3074('0x1e')]||null:null,'attributes':_0x2cd166[_0x3074('0x1c')]?_0x2cd166[_0x3074('0x1c')][_0x3074('0x1f')]||null:null,'include':_0x2cd166['options']?_0x2cd166[_0x3074('0x1c')][_0x3074('0x23')]?_[_0x3074('0x21')](_0x2cd166[_0x3074('0x1c')]['include'],function(_0x4603c0){return{'model':db[_0x4603c0[_0x3074('0x22')]],'as':_0x4603c0['as'],'attributes':_0x4603c0[_0x3074('0x1f')],'include':_0x4603c0[_0x3074('0x23')]?_[_0x3074('0x21')](_0x4603c0['include'],function(_0x5c1b6d){return{'model':db[_0x5c1b6d['model']],'as':_0x5c1b6d['as'],'attributes':_0x5c1b6d[_0x3074('0x1f')],'include':_0x5c1b6d[_0x3074('0x23')]?_[_0x3074('0x21')](_0x5c1b6d[_0x3074('0x23')],function(_0x295a64){return{'model':db[_0x295a64[_0x3074('0x22')]],'as':_0x295a64['as'],'attributes':_0x295a64[_0x3074('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3074('0xf')](function(_0x45f9c3){logger[_0x3074('0x10')](_0x3074('0x26'),_0x2cd166);logger['debug']('ShowFaxQueue',_0x2cd166,JSON[_0x3074('0x14')](_0x45f9c3));_0x18ec0e(_0x45f9c3);})['catch'](function(_0x3e405a){logger['error'](_0x3074('0x26'),_0x3e405a[_0x3074('0x18')],_0x2cd166);_0x40b7cf(_0xcf2600[_0x3074('0x15')](0x1f4,_0x3e405a[_0x3074('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 7835fb1..38d6387 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 _0x8c2f=['update','removeListener','length','faxQueue:'];(function(_0x42c56a,_0x509d59){var _0x1e6331=function(_0x34e82c){while(--_0x34e82c){_0x42c56a['push'](_0x42c56a['shift']());}};_0x1e6331(++_0x509d59);}(_0x8c2f,0xdc));var _0xf8c2=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x8c2f[_0x3f59b1];return _0x11d2e8;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save','remove',_0xf8c2('0x0')];function createListener(_0x583fc6,_0x4fca4e){return function(_0x16b0c9){_0x4fca4e['emit'](_0x583fc6,_0x16b0c9);};}function removeListener(_0x198af5,_0xa021f8){return function(){FaxQueueEvents[_0xf8c2('0x1')](_0x198af5,_0xa021f8);};}exports['register']=function(_0x3c186a){for(var _0x4d3982=0x0,_0x27589d=events[_0xf8c2('0x2')];_0x4d3982<_0x27589d;_0x4d3982++){var _0x16ccf7=events[_0x4d3982];var _0x2fa175=createListener(_0xf8c2('0x3')+_0x16ccf7,_0x3c186a);FaxQueueEvents['on'](_0x16ccf7,_0x2fa175);}}; \ No newline at end of file +var _0x8d0a=['remove','update','emit','removeListener','length','./faxQueue.events'];(function(_0x14156a,_0x9777e4){var _0x3a810d=function(_0x25239c){while(--_0x25239c){_0x14156a['push'](_0x14156a['shift']());}};_0x3a810d(++_0x9777e4);}(_0x8d0a,0x65));var _0xa8d0=function(_0x7db384,_0x5be31b){_0x7db384=_0x7db384-0x0;var _0x1c4642=_0x8d0a[_0x7db384];return _0x1c4642;};'use strict';var FaxQueueEvents=require(_0xa8d0('0x0'));var events=['save',_0xa8d0('0x1'),_0xa8d0('0x2')];function createListener(_0x1e83ea,_0x10995c){return function(_0x6ec9e7){_0x10995c[_0xa8d0('0x3')](_0x1e83ea,_0x6ec9e7);};}function removeListener(_0x528287,_0x202833){return function(){FaxQueueEvents[_0xa8d0('0x4')](_0x528287,_0x202833);};}exports['register']=function(_0x1cac4f){for(var _0x212aaf=0x0,_0x1f95a7=events[_0xa8d0('0x5')];_0x212aaf<_0x1f95a7;_0x212aaf++){var _0x3ee6b4=events[_0x212aaf];var _0x55ffc0=createListener('faxQueue:'+_0x3ee6b4,_0x1cac4f);FaxQueueEvents['on'](_0x3ee6b4,_0x55ffc0);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index af8bea2..22726d2 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 _0xd101=['addTeams','addAgents','put','update','delete','destroy','removeTeams','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post'];(function(_0x140d0d,_0x8e8e9f){var _0xb98d54=function(_0x32d218){while(--_0x32d218){_0x140d0d['push'](_0x140d0d['shift']());}};_0xb98d54(++_0x8e8e9f);}(_0xd101,0xc1));var _0x1d10=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xd101[_0x37c07d];return _0x10dadc;};'use strict';var multer=require(_0x1d10('0x0'));var util=require('util');var path=require(_0x1d10('0x1'));var timeout=require(_0x1d10('0x2'));var express=require(_0x1d10('0x3'));var router=express[_0x1d10('0x4')]();var fs_extra=require(_0x1d10('0x5'));var auth=require(_0x1d10('0x6'));var interaction=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var controller=require('./faxQueue.controller');router[_0x1d10('0x9')]('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0xb')]);router[_0x1d10('0x9')](_0x1d10('0xc'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xd')]);router[_0x1d10('0x9')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0xf')]);router[_0x1d10('0x9')](_0x1d10('0x10'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x11')]);router[_0x1d10('0x9')](_0x1d10('0x12'),auth['isAuthenticated'](),controller[_0x1d10('0x13')]);router[_0x1d10('0x9')](_0x1d10('0x14'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x15')]);router['post']('/',auth[_0x1d10('0xa')](),controller[_0x1d10('0x16')]);router[_0x1d10('0x17')](_0x1d10('0x12'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x18')]);router['post'](_0x1d10('0x14'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x19')]);router[_0x1d10('0x1a')]('/:id',auth[_0x1d10('0xa')](),controller[_0x1d10('0x1b')]);router[_0x1d10('0x1c')](_0x1d10('0xe'),auth[_0x1d10('0xa')](),controller[_0x1d10('0x1d')]);router[_0x1d10('0x1c')]('/:id/teams',auth[_0x1d10('0xa')](),controller[_0x1d10('0x1e')]);router[_0x1d10('0x1c')](_0x1d10('0x14'),auth[_0x1d10('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x126e=['../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2a9f4,_0x25c14a){var _0x3c39e0=function(_0x3b8deb){while(--_0x3b8deb){_0x2a9f4['push'](_0x2a9f4['shift']());}};_0x3c39e0(++_0x25c14a);}(_0x126e,0x108));var _0xe126=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x126e[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require(_0xe126('0x0'));var path=require(_0xe126('0x1'));var timeout=require(_0xe126('0x2'));var express=require(_0xe126('0x3'));var router=express[_0xe126('0x4')]();var fs_extra=require(_0xe126('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var controller=require(_0xe126('0x8'));router[_0xe126('0x9')]('/',auth[_0xe126('0xa')](),controller[_0xe126('0xb')]);router[_0xe126('0x9')]('/describe',auth[_0xe126('0xa')](),controller[_0xe126('0xc')]);router[_0xe126('0x9')](_0xe126('0xd'),auth[_0xe126('0xa')](),controller['show']);router[_0xe126('0x9')](_0xe126('0xe'),auth['isAuthenticated'](),controller[_0xe126('0xf')]);router[_0xe126('0x9')]('/:id/teams',auth[_0xe126('0xa')](),controller['getTeams']);router[_0xe126('0x9')]('/:id/users',auth[_0xe126('0xa')](),controller[_0xe126('0x10')]);router[_0xe126('0x11')]('/',auth[_0xe126('0xa')](),controller[_0xe126('0x12')]);router[_0xe126('0x11')](_0xe126('0x13'),auth['isAuthenticated'](),controller[_0xe126('0x14')]);router[_0xe126('0x11')]('/:id/users',auth[_0xe126('0xa')](),controller[_0xe126('0x15')]);router[_0xe126('0x16')](_0xe126('0xd'),auth['isAuthenticated'](),controller[_0xe126('0x17')]);router[_0xe126('0x18')](_0xe126('0xd'),auth['isAuthenticated'](),controller[_0xe126('0x19')]);router['delete'](_0xe126('0x13'),auth[_0xe126('0xa')](),controller[_0xe126('0x1a')]);router[_0xe126('0x18')](_0xe126('0x1b'),auth[_0xe126('0xa')](),controller[_0xe126('0x1c')]);module[_0xe126('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index f3bd217..6a99363 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 _0x1ac6=['STRING','DATE','moment','sequelize','exports'];(function(_0x41c842,_0x3865f6){var _0x15ee6b=function(_0x2505f5){while(--_0x2505f5){_0x41c842['push'](_0x41c842['shift']());}};_0x15ee6b(++_0x3865f6);}(_0x1ac6,0x10b));var _0x61ac=function(_0xf5f512,_0x131ec0){_0xf5f512=_0xf5f512-0x0;var _0x1940c9=_0x1ac6[_0xf5f512];return _0x1940c9;};'use strict';var moment=require(_0x61ac('0x0'));var Sequelize=require(_0x61ac('0x1'));module[_0x61ac('0x2')]={'uniqueid':{'type':Sequelize[_0x61ac('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x61ac('0x3')]},'joinAt':{'type':Sequelize[_0x61ac('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x61ac('0x4')]},'exitAt':{'type':Sequelize[_0x61ac('0x4')]},'reason':{'type':Sequelize[_0x61ac('0x3')]}}; \ No newline at end of file +var _0xc42d=['DATE','moment','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc42d,0x1dc));var _0xdc42=function(_0x13719c,_0x1ce756){_0x13719c=_0x13719c-0x0;var _0x1fcfb0=_0xc42d[_0x13719c];return _0x1fcfb0;};'use strict';var moment=require(_0xdc42('0x0'));var Sequelize=require(_0xdc42('0x1'));module[_0xdc42('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xdc42('0x3')]},'joinAt':{'type':Sequelize[_0xdc42('0x4')]},'leaveAt':{'type':Sequelize[_0xdc42('0x4')]},'acceptAt':{'type':Sequelize[_0xdc42('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xdc42('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 67c1494..09b7307 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 _0x4fef=['../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','then','destroy','error','name','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','FaxQueueReport','includeAll','findAll','catch','show','params','rawAttributes','length','include','merge','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x4fef,0x10f));var _0xf4fe=function(_0x26e469,_0x28bb0a){_0x26e469=_0x26e469-0x0;var _0x5c2c68=_0x4fef[_0x26e469];return _0x5c2c68;};'use strict';var emlformat=require(_0xf4fe('0x0'));var rimraf=require(_0xf4fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf4fe('0x2'));var rp=require('request-promise');var moment=require(_0xf4fe('0x3'));var BPromise=require(_0xf4fe('0x4'));var Mustache=require(_0xf4fe('0x5'));var util=require(_0xf4fe('0x6'));var path=require(_0xf4fe('0x7'));var sox=require(_0xf4fe('0x8'));var csv=require(_0xf4fe('0x9'));var ejs=require(_0xf4fe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4fe('0xb'));var squel=require(_0xf4fe('0xc'));var crypto=require('crypto');var jsforce=require(_0xf4fe('0xd'));var deskjs=require(_0xf4fe('0xe'));var toCsv=require(_0xf4fe('0x9'));var querystring=require(_0xf4fe('0xf'));var Papa=require(_0xf4fe('0x10'));var Redis=require(_0xf4fe('0x11'));var authService=require(_0xf4fe('0x12'));var qs=require(_0xf4fe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4fe('0x14'));var logger=require('../../config/logger')(_0xf4fe('0x15'));var utils=require(_0xf4fe('0x16'));var config=require(_0xf4fe('0x17'));var licenseUtil=require(_0xf4fe('0x18'));var db=require(_0xf4fe('0x19'))['db'];function respondWithStatusCode(_0x5c0ae7,_0x1ca9d3){_0x1ca9d3=_0x1ca9d3||0xcc;return function(_0xade41e){if(_0xade41e){return _0x5c0ae7[_0xf4fe('0x1a')](_0x1ca9d3);}return _0x5c0ae7['status'](_0x1ca9d3)[_0xf4fe('0x1b')]();};}function respondWithResult(_0x4824f5,_0x3ce3f1){_0x3ce3f1=_0x3ce3f1||0xc8;return function(_0x457a14){if(_0x457a14){return _0x4824f5[_0xf4fe('0x1c')](_0x3ce3f1)['json'](_0x457a14);}};}function respondWithFilteredResult(_0x93346e,_0x3442f1){return function(_0x5de99e){if(_0x5de99e){var _0x2a00ea=typeof _0x3442f1[_0xf4fe('0x1d')]===_0xf4fe('0x1e')&&typeof _0x3442f1['limit']==='undefined';var _0x10cf15=_0x5de99e[_0xf4fe('0x1f')];var _0x5ad86c=_0x2a00ea?0x0:_0x3442f1['offset'];var _0x24c818=_0x2a00ea?_0x5de99e[_0xf4fe('0x1f')]:_0x3442f1[_0xf4fe('0x1d')]+_0x3442f1[_0xf4fe('0x20')];var _0x364aa6;if(_0x24c818>=_0x10cf15){_0x24c818=_0x10cf15;_0x364aa6=0xc8;}else{_0x364aa6=0xce;}_0x93346e[_0xf4fe('0x1c')](_0x364aa6);return _0x93346e[_0xf4fe('0x21')](_0xf4fe('0x22'),_0x5ad86c+'-'+_0x24c818+'/'+_0x10cf15)[_0xf4fe('0x23')](_0x5de99e);}return null;};}function patchUpdates(_0x223676){return function(_0x2eb45e){try{jsonpatch[_0xf4fe('0x24')](_0x2eb45e,_0x223676,!![]);}catch(_0x453f01){return BPromise[_0xf4fe('0x25')](_0x453f01);}return _0x2eb45e['save']();};}function saveUpdates(_0x3e1d03,_0x5e8e18){return function(_0x502b3c){if(_0x502b3c){return _0x502b3c['update'](_0x3e1d03)[_0xf4fe('0x26')](function(_0x518d0d){return _0x518d0d;});}return null;};}function removeEntity(_0x5eb921,_0xd3bfb3){return function(_0x1ba32a){if(_0x1ba32a){return _0x1ba32a[_0xf4fe('0x27')]()[_0xf4fe('0x26')](function(){_0x5eb921[_0xf4fe('0x1c')](0xcc)[_0xf4fe('0x1b')]();});}};}function handleEntityNotFound(_0x51dc14,_0x1f4013){return function(_0x5ca51d){if(!_0x5ca51d){_0x51dc14[_0xf4fe('0x1a')](0x194);}return _0x5ca51d;};}function handleError(_0xd9b8b4,_0x4141ec){_0x4141ec=_0x4141ec||0x1f4;return function(_0x477de5){logger[_0xf4fe('0x28')](_0x477de5['stack']);if(_0x477de5[_0xf4fe('0x29')]){delete _0x477de5[_0xf4fe('0x29')];}_0xd9b8b4[_0xf4fe('0x1c')](_0x4141ec)['send'](_0x477de5);};}exports['index']=function(_0x2c94c9,_0x47e54c){var _0x5b74b9={},_0x3d5133={},_0xcfc7b5={'count':0x0,'rows':[]};var _0x461367=_[_0xf4fe('0x2a')](db['FaxQueueReport']['rawAttributes'],function(_0x4b4832){return{'name':_0x4b4832[_0xf4fe('0x2b')],'type':_0x4b4832['type'][_0xf4fe('0x2c')]};});_0x3d5133[_0xf4fe('0x2d')]=_[_0xf4fe('0x2a')](_0x461367,_0xf4fe('0x29'));_0x3d5133[_0xf4fe('0x2e')]=_[_0xf4fe('0x2f')](_0x2c94c9[_0xf4fe('0x2e')]);_0x3d5133[_0xf4fe('0x30')]=_[_0xf4fe('0x31')](_0x3d5133[_0xf4fe('0x2d')],_0x3d5133[_0xf4fe('0x2e')]);_0x5b74b9[_0xf4fe('0x32')]=_[_0xf4fe('0x31')](_0x3d5133['model'],qs[_0xf4fe('0x33')](_0x2c94c9[_0xf4fe('0x2e')]['fields']));_0x5b74b9[_0xf4fe('0x32')]=_0x5b74b9[_0xf4fe('0x32')]['length']?_0x5b74b9[_0xf4fe('0x32')]:_0x3d5133[_0xf4fe('0x2d')];if(!_0x2c94c9[_0xf4fe('0x2e')][_0xf4fe('0x34')](_0xf4fe('0x35'))){_0x5b74b9[_0xf4fe('0x20')]=qs['limit'](_0x2c94c9[_0xf4fe('0x2e')][_0xf4fe('0x20')]);_0x5b74b9['offset']=qs[_0xf4fe('0x1d')](_0x2c94c9[_0xf4fe('0x2e')][_0xf4fe('0x1d')]);}_0x5b74b9[_0xf4fe('0x36')]=qs[_0xf4fe('0x37')](_0x2c94c9['query'][_0xf4fe('0x37')]);_0x5b74b9[_0xf4fe('0x38')]=qs[_0xf4fe('0x30')](_['pick'](_0x2c94c9[_0xf4fe('0x2e')],_0x3d5133[_0xf4fe('0x30')]),_0x461367);if(_0x2c94c9['query'][_0xf4fe('0x39')]){_0x5b74b9['where']=_['merge'](_0x5b74b9[_0xf4fe('0x38')],{'$or':_[_0xf4fe('0x2a')](_0x461367,function(_0x75baf4){if(_0x75baf4['type']!==_0xf4fe('0x3a')){var _0x3ffbe5={};_0x3ffbe5[_0x75baf4[_0xf4fe('0x29')]]={'$like':'%'+_0x2c94c9[_0xf4fe('0x2e')][_0xf4fe('0x39')]+'%'};return _0x3ffbe5;}})});}_0x5b74b9=_['merge']({},_0x5b74b9,_0x2c94c9[_0xf4fe('0x3b')]);var _0x4ffacf={'where':_0x5b74b9['where']};return db[_0xf4fe('0x3c')][_0xf4fe('0x1f')](_0x4ffacf)[_0xf4fe('0x26')](function(_0x13fffe){_0xcfc7b5['count']=_0x13fffe;if(_0x2c94c9[_0xf4fe('0x2e')][_0xf4fe('0x3d')]){_0x5b74b9['include']=[{'all':!![]}];}return db[_0xf4fe('0x3c')][_0xf4fe('0x3e')](_0x5b74b9);})[_0xf4fe('0x26')](function(_0xac4bf4){_0xcfc7b5['rows']=_0xac4bf4;return _0xcfc7b5;})[_0xf4fe('0x26')](respondWithFilteredResult(_0x47e54c,_0x5b74b9))[_0xf4fe('0x3f')](handleError(_0x47e54c,null));};exports[_0xf4fe('0x40')]=function(_0x5df5e7,_0x2ce656){var _0x25c098={'raw':!![],'where':{'id':_0x5df5e7[_0xf4fe('0x41')]['id']}},_0x240379={};_0x240379['model']=_[_0xf4fe('0x2f')](db[_0xf4fe('0x3c')][_0xf4fe('0x42')]);_0x240379[_0xf4fe('0x2e')]=_[_0xf4fe('0x2f')](_0x5df5e7['query']);_0x240379[_0xf4fe('0x30')]=_[_0xf4fe('0x31')](_0x240379[_0xf4fe('0x2d')],_0x240379[_0xf4fe('0x2e')]);_0x25c098[_0xf4fe('0x32')]=_[_0xf4fe('0x31')](_0x240379[_0xf4fe('0x2d')],qs[_0xf4fe('0x33')](_0x5df5e7['query'][_0xf4fe('0x33')]));_0x25c098['attributes']=_0x25c098[_0xf4fe('0x32')][_0xf4fe('0x43')]?_0x25c098[_0xf4fe('0x32')]:_0x240379['model'];if(_0x5df5e7[_0xf4fe('0x2e')][_0xf4fe('0x3d')]){_0x25c098[_0xf4fe('0x44')]=[{'all':!![]}];}_0x25c098=_[_0xf4fe('0x45')]({},_0x25c098,_0x5df5e7['options']);return db[_0xf4fe('0x3c')]['find'](_0x25c098)[_0xf4fe('0x26')](handleEntityNotFound(_0x2ce656,null))[_0xf4fe('0x26')](respondWithResult(_0x2ce656,null))[_0xf4fe('0x3f')](handleError(_0x2ce656,null));};exports[_0xf4fe('0x46')]=function(_0x299955,_0x4a0cf0){return db[_0xf4fe('0x3c')]['create'](_0x299955[_0xf4fe('0x47')],{})[_0xf4fe('0x26')](respondWithResult(_0x4a0cf0,0xc9))[_0xf4fe('0x3f')](handleError(_0x4a0cf0,null));};exports['update']=function(_0x59de95,_0x59dcdf){if(_0x59de95[_0xf4fe('0x47')]['id']){delete _0x59de95[_0xf4fe('0x47')]['id'];}return db[_0xf4fe('0x3c')][_0xf4fe('0x48')]({'where':{'id':_0x59de95[_0xf4fe('0x41')]['id']}})[_0xf4fe('0x26')](handleEntityNotFound(_0x59dcdf,null))[_0xf4fe('0x26')](saveUpdates(_0x59de95['body'],null))[_0xf4fe('0x26')](respondWithResult(_0x59dcdf,null))[_0xf4fe('0x3f')](handleError(_0x59dcdf,null));};exports[_0xf4fe('0x27')]=function(_0x4bf5d7,_0x8b8fd9){return db[_0xf4fe('0x3c')]['find']({'where':{'id':_0x4bf5d7[_0xf4fe('0x41')]['id']}})[_0xf4fe('0x26')](handleEntityNotFound(_0x8b8fd9,null))[_0xf4fe('0x26')](removeEntity(_0x8b8fd9,null))['catch'](handleError(_0x8b8fd9,null));};exports['describe']=function(_0x3afd74,_0x3fcf35){return db[_0xf4fe('0x3c')][_0xf4fe('0x49')]()['then'](respondWithResult(_0x3fcf35,null))[_0xf4fe('0x3f')](handleError(_0x3fcf35,null));}; \ No newline at end of file +var _0x65f4=['model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','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','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','index','FaxQueueReport','fieldName','type','key','map','query','filters','intersection','attributes'];(function(_0x291ea3,_0x36f536){var _0x5dddf4=function(_0x5af8d6){while(--_0x5af8d6){_0x291ea3['push'](_0x291ea3['shift']());}};_0x5dddf4(++_0x36f536);}(_0x65f4,0x19a));var _0x465f=function(_0x5c838f,_0xad9ad9){_0x5c838f=_0x5c838f-0x0;var _0x15d3f9=_0x65f4[_0x5c838f];return _0x15d3f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x465f('0x0'));var jsonpatch=require(_0x465f('0x1'));var rp=require(_0x465f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x465f('0x3'));var util=require(_0x465f('0x4'));var path=require(_0x465f('0x5'));var sox=require('sox');var csv=require(_0x465f('0x6'));var ejs=require(_0x465f('0x7'));var fs=require('fs');var fs_extra=require(_0x465f('0x8'));var _=require('lodash');var squel=require(_0x465f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x465f('0xa'));var toCsv=require(_0x465f('0x6'));var querystring=require(_0x465f('0xb'));var Papa=require(_0x465f('0xc'));var Redis=require(_0x465f('0xd'));var authService=require(_0x465f('0xe'));var qs=require(_0x465f('0xf'));var as=require(_0x465f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x465f('0x11'))(_0x465f('0x12'));var utils=require(_0x465f('0x13'));var config=require(_0x465f('0x14'));var licenseUtil=require(_0x465f('0x15'));var db=require(_0x465f('0x16'))['db'];function respondWithStatusCode(_0xa52fdb,_0x2fce97){_0x2fce97=_0x2fce97||0xcc;return function(_0x30e5ba){if(_0x30e5ba){return _0xa52fdb['sendStatus'](_0x2fce97);}return _0xa52fdb['status'](_0x2fce97)[_0x465f('0x17')]();};}function respondWithResult(_0x2558a0,_0x2cb09c){_0x2cb09c=_0x2cb09c||0xc8;return function(_0x3a6c49){if(_0x3a6c49){return _0x2558a0['status'](_0x2cb09c)[_0x465f('0x18')](_0x3a6c49);}};}function respondWithFilteredResult(_0xaffeac,_0x52f29d){return function(_0x5f25d0){if(_0x5f25d0){var _0x20beae=typeof _0x52f29d[_0x465f('0x19')]===_0x465f('0x1a')&&typeof _0x52f29d[_0x465f('0x1b')]===_0x465f('0x1a');var _0x5e9726=_0x5f25d0[_0x465f('0x1c')];var _0x99845e=_0x20beae?0x0:_0x52f29d[_0x465f('0x19')];var _0x5d469c=_0x20beae?_0x5f25d0[_0x465f('0x1c')]:_0x52f29d[_0x465f('0x19')]+_0x52f29d['limit'];var _0x3d9ec1;if(_0x5d469c>=_0x5e9726){_0x5d469c=_0x5e9726;_0x3d9ec1=0xc8;}else{_0x3d9ec1=0xce;}_0xaffeac['status'](_0x3d9ec1);return _0xaffeac[_0x465f('0x1d')](_0x465f('0x1e'),_0x99845e+'-'+_0x5d469c+'/'+_0x5e9726)[_0x465f('0x18')](_0x5f25d0);}return null;};}function patchUpdates(_0xc90d88){return function(_0x3c5ad0){try{jsonpatch[_0x465f('0x1f')](_0x3c5ad0,_0xc90d88,!![]);}catch(_0x2cd76d){return BPromise[_0x465f('0x20')](_0x2cd76d);}return _0x3c5ad0[_0x465f('0x21')]();};}function saveUpdates(_0x3d4dea,_0x36f8eb){return function(_0x4aa4a8){if(_0x4aa4a8){return _0x4aa4a8[_0x465f('0x22')](_0x3d4dea)[_0x465f('0x23')](function(_0x371b16){return _0x371b16;});}return null;};}function removeEntity(_0x317aed,_0x1d6677){return function(_0x2566e3){if(_0x2566e3){return _0x2566e3[_0x465f('0x24')]()[_0x465f('0x23')](function(){_0x317aed[_0x465f('0x25')](0xcc)[_0x465f('0x17')]();});}};}function handleEntityNotFound(_0x59ace5,_0x186fff){return function(_0x329007){if(!_0x329007){_0x59ace5['sendStatus'](0x194);}return _0x329007;};}function handleError(_0x5a9fc3,_0xc45dc){_0xc45dc=_0xc45dc||0x1f4;return function(_0x3cd248){logger[_0x465f('0x26')](_0x3cd248[_0x465f('0x27')]);if(_0x3cd248[_0x465f('0x28')]){delete _0x3cd248[_0x465f('0x28')];}_0x5a9fc3[_0x465f('0x25')](_0xc45dc)[_0x465f('0x29')](_0x3cd248);};}exports[_0x465f('0x2a')]=function(_0x190506,_0x5299c4){var _0x222240={},_0x3ad80e={},_0x522fc3={'count':0x0,'rows':[]};var _0x13a058=_['map'](db[_0x465f('0x2b')]['rawAttributes'],function(_0x2d9bce){return{'name':_0x2d9bce[_0x465f('0x2c')],'type':_0x2d9bce[_0x465f('0x2d')][_0x465f('0x2e')]};});_0x3ad80e['model']=_[_0x465f('0x2f')](_0x13a058,_0x465f('0x28'));_0x3ad80e[_0x465f('0x30')]=_['keys'](_0x190506[_0x465f('0x30')]);_0x3ad80e[_0x465f('0x31')]=_[_0x465f('0x32')](_0x3ad80e['model'],_0x3ad80e[_0x465f('0x30')]);_0x222240[_0x465f('0x33')]=_[_0x465f('0x32')](_0x3ad80e[_0x465f('0x34')],qs[_0x465f('0x35')](_0x190506['query']['fields']));_0x222240[_0x465f('0x33')]=_0x222240[_0x465f('0x33')][_0x465f('0x36')]?_0x222240['attributes']:_0x3ad80e[_0x465f('0x34')];if(!_0x190506['query'][_0x465f('0x37')](_0x465f('0x38'))){_0x222240[_0x465f('0x1b')]=qs[_0x465f('0x1b')](_0x190506[_0x465f('0x30')][_0x465f('0x1b')]);_0x222240['offset']=qs['offset'](_0x190506[_0x465f('0x30')][_0x465f('0x19')]);}_0x222240[_0x465f('0x39')]=qs[_0x465f('0x3a')](_0x190506[_0x465f('0x30')]['sort']);_0x222240[_0x465f('0x3b')]=qs[_0x465f('0x31')](_[_0x465f('0x3c')](_0x190506[_0x465f('0x30')],_0x3ad80e['filters']),_0x13a058);if(_0x190506['query'][_0x465f('0x3d')]){_0x222240['where']=_[_0x465f('0x3e')](_0x222240[_0x465f('0x3b')],{'$or':_[_0x465f('0x2f')](_0x13a058,function(_0x11c216){if(_0x11c216[_0x465f('0x2d')]!=='VIRTUAL'){var _0x3d3220={};_0x3d3220[_0x11c216[_0x465f('0x28')]]={'$like':'%'+_0x190506[_0x465f('0x30')][_0x465f('0x3d')]+'%'};return _0x3d3220;}})});}_0x222240=_['merge']({},_0x222240,_0x190506[_0x465f('0x3f')]);var _0xe84486={'where':_0x222240['where']};return db[_0x465f('0x2b')]['count'](_0xe84486)[_0x465f('0x23')](function(_0x5e2fd9){_0x522fc3['count']=_0x5e2fd9;if(_0x190506[_0x465f('0x30')][_0x465f('0x40')]){_0x222240[_0x465f('0x41')]=[{'all':!![]}];}return db[_0x465f('0x2b')][_0x465f('0x42')](_0x222240);})['then'](function(_0xd1f037){_0x522fc3[_0x465f('0x43')]=_0xd1f037;return _0x522fc3;})[_0x465f('0x23')](respondWithFilteredResult(_0x5299c4,_0x222240))[_0x465f('0x44')](handleError(_0x5299c4,null));};exports[_0x465f('0x45')]=function(_0x2b6a2b,_0x50bf60){var _0x39a47d={'raw':!![],'where':{'id':_0x2b6a2b['params']['id']}},_0x39d770={};_0x39d770[_0x465f('0x34')]=_[_0x465f('0x46')](db[_0x465f('0x2b')][_0x465f('0x47')]);_0x39d770[_0x465f('0x30')]=_[_0x465f('0x46')](_0x2b6a2b[_0x465f('0x30')]);_0x39d770[_0x465f('0x31')]=_[_0x465f('0x32')](_0x39d770[_0x465f('0x34')],_0x39d770[_0x465f('0x30')]);_0x39a47d[_0x465f('0x33')]=_[_0x465f('0x32')](_0x39d770[_0x465f('0x34')],qs[_0x465f('0x35')](_0x2b6a2b[_0x465f('0x30')][_0x465f('0x35')]));_0x39a47d[_0x465f('0x33')]=_0x39a47d[_0x465f('0x33')][_0x465f('0x36')]?_0x39a47d[_0x465f('0x33')]:_0x39d770[_0x465f('0x34')];if(_0x2b6a2b[_0x465f('0x30')][_0x465f('0x40')]){_0x39a47d[_0x465f('0x41')]=[{'all':!![]}];}_0x39a47d=_[_0x465f('0x3e')]({},_0x39a47d,_0x2b6a2b['options']);return db[_0x465f('0x2b')][_0x465f('0x48')](_0x39a47d)[_0x465f('0x23')](handleEntityNotFound(_0x50bf60,null))[_0x465f('0x23')](respondWithResult(_0x50bf60,null))[_0x465f('0x44')](handleError(_0x50bf60,null));};exports[_0x465f('0x49')]=function(_0x312f8f,_0x22d8b6){return db[_0x465f('0x2b')][_0x465f('0x49')](_0x312f8f[_0x465f('0x4a')],{})[_0x465f('0x23')](respondWithResult(_0x22d8b6,0xc9))['catch'](handleError(_0x22d8b6,null));};exports[_0x465f('0x22')]=function(_0x1b8c02,_0x1d7cc0){if(_0x1b8c02[_0x465f('0x4a')]['id']){delete _0x1b8c02[_0x465f('0x4a')]['id'];}return db[_0x465f('0x2b')][_0x465f('0x48')]({'where':{'id':_0x1b8c02[_0x465f('0x4b')]['id']}})[_0x465f('0x23')](handleEntityNotFound(_0x1d7cc0,null))[_0x465f('0x23')](saveUpdates(_0x1b8c02[_0x465f('0x4a')],null))[_0x465f('0x23')](respondWithResult(_0x1d7cc0,null))[_0x465f('0x44')](handleError(_0x1d7cc0,null));};exports[_0x465f('0x24')]=function(_0x1ce22f,_0x1b55ad){return db['FaxQueueReport']['find']({'where':{'id':_0x1ce22f[_0x465f('0x4b')]['id']}})[_0x465f('0x23')](handleEntityNotFound(_0x1b55ad,null))['then'](removeEntity(_0x1b55ad,null))['catch'](handleError(_0x1b55ad,null));};exports[_0x465f('0x4c')]=function(_0x33d798,_0x3c06ac){return db['FaxQueueReport'][_0x465f('0x4c')]()[_0x465f('0x23')](respondWithResult(_0x3c06ac,null))[_0x465f('0x44')](handleError(_0x3c06ac,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index f9f3565..4cd370a 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x11f7ca,_0x478e58){var _0x28162a=function(_0x4cab01){while(--_0x4cab01){_0x11f7ca['push'](_0x11f7ca['shift']());}};_0x28162a(++_0x478e58);}(_0x326f,0xd1));var _0xf326=function(_0x29d6ae,_0x5d99b2){_0x29d6ae=_0x29d6ae-0x0;var _0x29e40c=_0x326f[_0x29d6ae];return _0x29e40c;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0xf67944,_0x580580){var _0x30ddb9=function(_0x375f82){while(--_0x375f82){_0xf67944['push'](_0xf67944['shift']());}};_0x30ddb9(++_0x580580);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var 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 569ab0d..2aa2641 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 _0x617b=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','update','where','attributes','info','catch','util','bluebird'];(function(_0x499132,_0x1f3fd2){var _0x4acc90=function(_0x41e4ee){while(--_0x41e4ee){_0x499132['push'](_0x499132['shift']());}};_0x4acc90(++_0x1f3fd2);}(_0x617b,0x148));var _0xb617=function(_0x399fbd,_0x27ba5a){_0x399fbd=_0x399fbd-0x0;var _0x3131e2=_0x617b[_0x399fbd];return _0x3131e2;};'use strict';var _=require('lodash');var util=require(_0xb617('0x0'));var moment=require('moment');var BPromise=require(_0xb617('0x1'));var rs=require(_0xb617('0x2'));var fs=require('fs');var Redis=require(_0xb617('0x3'));var db=require(_0xb617('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb617('0x5'));var config=require(_0xb617('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb617('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c14c0,_0x478085,_0x46f2db){return new BPromise(function(_0x27e316,_0x2ad72f){return client[_0xb617('0x8')](_0x4c14c0,_0x46f2db)[_0xb617('0x9')](function(_0xcd6950){logger['info'](_0xb617('0xa'),_0x478085,_0xb617('0xb'));logger[_0xb617('0xc')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x478085,_0xb617('0xb'),JSON[_0xb617('0xd')](_0xcd6950));if(_0xcd6950[_0xb617('0xe')]){if(_0xcd6950['error'][_0xb617('0xf')]===0x1f4){logger[_0xb617('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x478085,_0xcd6950['error'][_0xb617('0x10')]);return _0x2ad72f(_0xcd6950['error'][_0xb617('0x10')]);}logger[_0xb617('0xe')](_0xb617('0xa'),_0x478085,_0xcd6950['error'][_0xb617('0x10')]);return _0x27e316(_0xcd6950[_0xb617('0xe')][_0xb617('0x10')]);}else{logger['info'](_0xb617('0xa'),_0x478085,_0xb617('0xb'));_0x27e316(_0xcd6950[_0xb617('0x11')]['message']);}})['catch'](function(_0x237f63){logger[_0xb617('0xe')](_0xb617('0xa'),_0x478085,_0x237f63);_0x2ad72f(_0x237f63);});});}exports['CreateFaxQueueReport']=function(_0x1b429a){var _0x23b10b=this;return new Promise(function(_0x24a1b2,_0x3516a1){return db[_0xb617('0x12')][_0xb617('0x13')](_0x1b429a[_0xb617('0x14')],{'raw':_0x1b429a['options']?_0x1b429a[_0xb617('0x15')][_0xb617('0x16')]===undefined?!![]:![]:!![]})[_0xb617('0x9')](function(_0x5a3eaf){logger['info'](_0xb617('0x17'),_0x1b429a);logger[_0xb617('0xc')]('CreateFaxQueueReport',_0x1b429a,JSON[_0xb617('0xd')](_0x5a3eaf));_0x24a1b2(_0x5a3eaf);})['catch'](function(_0x123822){logger[_0xb617('0xe')](_0xb617('0x17'),_0x123822['message'],_0x1b429a);_0x3516a1(_0x23b10b[_0xb617('0xe')](0x1f4,_0x123822[_0xb617('0x10')]));});});};exports[_0xb617('0x18')]=function(_0x5ab2e8){var _0xd57594=this;return new Promise(function(_0x1cc8ba,_0x397b59){return db[_0xb617('0x12')][_0xb617('0x19')](_0x5ab2e8[_0xb617('0x14')],{'raw':_0x5ab2e8[_0xb617('0x15')]?_0x5ab2e8[_0xb617('0x15')][_0xb617('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ab2e8[_0xb617('0x15')]?_0x5ab2e8[_0xb617('0x15')][_0xb617('0x1a')]||null:null,'attributes':_0x5ab2e8[_0xb617('0x15')]?_0x5ab2e8['options'][_0xb617('0x1b')]||null:null,'limit':_0x5ab2e8['options']?_0x5ab2e8[_0xb617('0x15')]['limit']||null:null})[_0xb617('0x9')](function(_0x7479b6){logger[_0xb617('0x1c')]('UpdateFaxQueueReport',_0x5ab2e8);logger['debug'](_0xb617('0x18'),_0x5ab2e8,JSON[_0xb617('0xd')](_0x7479b6));_0x1cc8ba(_0x7479b6);})[_0xb617('0x1d')](function(_0x143b38){logger[_0xb617('0xe')](_0xb617('0x18'),_0x143b38[_0xb617('0x10')],_0x5ab2e8);_0x397b59(_0xd57594['error'](0x1f4,_0x143b38['message']));});});}; \ No newline at end of file +var _0xa5a6=['options','raw','CreateFaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','FaxQueueReport','create','body'];(function(_0x15ccc0,_0x2ceee3){var _0x251353=function(_0x11ae48){while(--_0x11ae48){_0x15ccc0['push'](_0x15ccc0['shift']());}};_0x251353(++_0x2ceee3);}(_0xa5a6,0x194));var _0x6a5a=function(_0x2c50a6,_0x2a9854){_0x2c50a6=_0x2c50a6-0x0;var _0x3e6556=_0xa5a6[_0x2c50a6];return _0x3e6556;};'use strict';var _=require(_0x6a5a('0x0'));var util=require(_0x6a5a('0x1'));var moment=require(_0x6a5a('0x2'));var BPromise=require(_0x6a5a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a5a('0x4'));var db=require(_0x6a5a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6a5a('0x6'));var config=require(_0x6a5a('0x7'));var jayson=require(_0x6a5a('0x8'));var client=jayson[_0x6a5a('0x9')][_0x6a5a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3acb82,_0x210b9e,_0xa25855){return new BPromise(function(_0x511a3a,_0xfb177b){return client['request'](_0x3acb82,_0xa25855)[_0x6a5a('0xb')](function(_0xfc093f){logger[_0x6a5a('0xc')](_0x6a5a('0xd'),_0x210b9e,'request\x20sent');logger[_0x6a5a('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x210b9e,_0x6a5a('0xf'),JSON[_0x6a5a('0x10')](_0xfc093f));if(_0xfc093f[_0x6a5a('0x11')]){if(_0xfc093f[_0x6a5a('0x11')][_0x6a5a('0x12')]===0x1f4){logger[_0x6a5a('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x210b9e,_0xfc093f[_0x6a5a('0x11')]['message']);return _0xfb177b(_0xfc093f[_0x6a5a('0x11')][_0x6a5a('0x13')]);}logger[_0x6a5a('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x210b9e,_0xfc093f['error'][_0x6a5a('0x13')]);return _0x511a3a(_0xfc093f[_0x6a5a('0x11')][_0x6a5a('0x13')]);}else{logger[_0x6a5a('0xc')](_0x6a5a('0xd'),_0x210b9e,_0x6a5a('0xf'));_0x511a3a(_0xfc093f[_0x6a5a('0x14')][_0x6a5a('0x13')]);}})[_0x6a5a('0x15')](function(_0xbbbefc){logger[_0x6a5a('0x11')](_0x6a5a('0xd'),_0x210b9e,_0xbbbefc);_0xfb177b(_0xbbbefc);});});}exports['CreateFaxQueueReport']=function(_0x3d67d6){var _0x7e24af=this;return new Promise(function(_0xb4d80d,_0x3f0f92){return db[_0x6a5a('0x16')][_0x6a5a('0x17')](_0x3d67d6[_0x6a5a('0x18')],{'raw':_0x3d67d6[_0x6a5a('0x19')]?_0x3d67d6['options'][_0x6a5a('0x1a')]===undefined?!![]:![]:!![]})[_0x6a5a('0xb')](function(_0x417d46){logger[_0x6a5a('0xc')]('CreateFaxQueueReport',_0x3d67d6);logger['debug'](_0x6a5a('0x1b'),_0x3d67d6,JSON[_0x6a5a('0x10')](_0x417d46));_0xb4d80d(_0x417d46);})[_0x6a5a('0x15')](function(_0x5b4782){logger[_0x6a5a('0x11')](_0x6a5a('0x1b'),_0x5b4782[_0x6a5a('0x13')],_0x3d67d6);_0x3f0f92(_0x7e24af[_0x6a5a('0x11')](0x1f4,_0x5b4782[_0x6a5a('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x3b377a){var _0x1c5164=this;return new Promise(function(_0x266b28,_0x3c8124){return db['FaxQueueReport'][_0x6a5a('0x1c')](_0x3b377a[_0x6a5a('0x18')],{'raw':_0x3b377a[_0x6a5a('0x19')]?_0x3b377a['options'][_0x6a5a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b377a[_0x6a5a('0x19')]?_0x3b377a[_0x6a5a('0x19')][_0x6a5a('0x1d')]||null:null,'attributes':_0x3b377a[_0x6a5a('0x19')]?_0x3b377a['options'][_0x6a5a('0x1e')]||null:null,'limit':_0x3b377a['options']?_0x3b377a['options'][_0x6a5a('0x1f')]||null:null})[_0x6a5a('0xb')](function(_0x1de60d){logger[_0x6a5a('0xc')]('UpdateFaxQueueReport',_0x3b377a);logger['debug']('UpdateFaxQueueReport',_0x3b377a,JSON[_0x6a5a('0x10')](_0x1de60d));_0x266b28(_0x1de60d);})[_0x6a5a('0x15')](function(_0x931d2){logger[_0x6a5a('0x11')](_0x6a5a('0x20'),_0x931d2[_0x6a5a('0x13')],_0x3b377a);_0x3c8124(_0x1c5164['error'](0x1f4,_0x931d2['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 2036e93..d9e463c 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 _0x6974=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete'];(function(_0x9a1b6,_0x45099f){var _0x13b2e6=function(_0xc13e11){while(--_0xc13e11){_0x9a1b6['push'](_0x9a1b6['shift']());}};_0x13b2e6(++_0x45099f);}(_0x6974,0x1cf));var _0x4697=function(_0x5210e7,_0x272592){_0x5210e7=_0x5210e7-0x0;var _0x4fb117=_0x6974[_0x5210e7];return _0x4fb117;};'use strict';var multer=require(_0x4697('0x0'));var util=require(_0x4697('0x1'));var path=require(_0x4697('0x2'));var timeout=require(_0x4697('0x3'));var express=require(_0x4697('0x4'));var router=express[_0x4697('0x5')]();var fs_extra=require(_0x4697('0x6'));var auth=require(_0x4697('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4697('0x8'));var controller=require('./faxQueueReport.controller');router[_0x4697('0x9')]('/',auth[_0x4697('0xa')](),controller['index']);router[_0x4697('0x9')](_0x4697('0xb'),auth[_0x4697('0xa')](),controller[_0x4697('0xc')]);router[_0x4697('0x9')]('/:id',auth[_0x4697('0xa')](),controller[_0x4697('0xd')]);router[_0x4697('0xe')]('/',auth[_0x4697('0xa')](),controller[_0x4697('0xf')]);router[_0x4697('0x10')](_0x4697('0x11'),auth['isAuthenticated'](),controller[_0x4697('0x12')]);router[_0x4697('0x13')](_0x4697('0x11'),auth[_0x4697('0xa')](),controller[_0x4697('0x14')]);module['exports']=router; \ No newline at end of file +var _0xf00c=['../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','create','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2337aa,_0xf9a251){var _0x586644=function(_0x7e4ee4){while(--_0x7e4ee4){_0x2337aa['push'](_0x2337aa['shift']());}};_0x586644(++_0xf9a251);}(_0xf00c,0xb6));var _0xcf00=function(_0x1cb39d,_0x4b97d2){_0x1cb39d=_0x1cb39d-0x0;var _0x461626=_0xf00c[_0x1cb39d];return _0x461626;};'use strict';var multer=require(_0xcf00('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcf00('0x1'));var express=require(_0xcf00('0x2'));var router=express[_0xcf00('0x3')]();var fs_extra=require(_0xcf00('0x4'));var auth=require(_0xcf00('0x5'));var interaction=require(_0xcf00('0x6'));var config=require('../../config/environment');var controller=require(_0xcf00('0x7'));router[_0xcf00('0x8')]('/',auth[_0xcf00('0x9')](),controller['index']);router['get'](_0xcf00('0xa'),auth[_0xcf00('0x9')](),controller[_0xcf00('0xb')]);router[_0xcf00('0x8')](_0xcf00('0xc'),auth[_0xcf00('0x9')](),controller['show']);router['post']('/',auth[_0xcf00('0x9')](),controller[_0xcf00('0xd')]);router['put'](_0xcf00('0xc'),auth[_0xcf00('0x9')](),controller[_0xcf00('0xe')]);router['delete']('/:id',auth[_0xcf00('0x9')](),controller[_0xcf00('0xf')]);module[_0xcf00('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 2c7ac7e..6c1a7b3 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x33cf66,_0x30e414){var _0x3a400b=function(_0x29130b){while(--_0x29130b){_0x33cf66['push'](_0x33cf66['shift']());}};_0x3a400b(++_0x30e414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0xf9acdc,_0x1feab4){var _0x74784e=function(_0x43933f){while(--_0x43933f){_0xf9acdc['push'](_0xf9acdc['shift']());}};_0x74784e(++_0x1feab4);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x00bb[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 118cadc..71014d9 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 _0x47aa=['apply','reject','update','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','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/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x47aa,0x185));var _0xa47a=function(_0x3c19c4,_0x2e4686){_0x3c19c4=_0x3c19c4-0x0;var _0x4ac062=_0x47aa[_0x3c19c4];return _0x4ac062;};'use strict';var emlformat=require(_0xa47a('0x0'));var rimraf=require(_0xa47a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa47a('0x2'));var rp=require(_0xa47a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa47a('0x4'));var util=require('util');var path=require(_0xa47a('0x5'));var sox=require(_0xa47a('0x6'));var csv=require(_0xa47a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa47a('0x8'));var _=require(_0xa47a('0x9'));var squel=require(_0xa47a('0xa'));var crypto=require(_0xa47a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa47a('0xc'));var toCsv=require(_0xa47a('0x7'));var querystring=require('querystring');var Papa=require(_0xa47a('0xd'));var Redis=require(_0xa47a('0xe'));var authService=require(_0xa47a('0xf'));var qs=require(_0xa47a('0x10'));var as=require(_0xa47a('0x11'));var hardwareService=require(_0xa47a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa47a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa47a('0x14'))['db'];function respondWithStatusCode(_0x3ea4e7,_0x59520d){_0x59520d=_0x59520d||0xcc;return function(_0x5bffa1){if(_0x5bffa1){return _0x3ea4e7[_0xa47a('0x15')](_0x59520d);}return _0x3ea4e7[_0xa47a('0x16')](_0x59520d)[_0xa47a('0x17')]();};}function respondWithResult(_0x127a70,_0x208ebe){_0x208ebe=_0x208ebe||0xc8;return function(_0x100ae2){if(_0x100ae2){return _0x127a70[_0xa47a('0x16')](_0x208ebe)[_0xa47a('0x18')](_0x100ae2);}};}function respondWithFilteredResult(_0x83d254,_0x541653){return function(_0x1e950d){if(_0x1e950d){var _0x3eb52c=typeof _0x541653[_0xa47a('0x19')]===_0xa47a('0x1a')&&typeof _0x541653[_0xa47a('0x1b')]===_0xa47a('0x1a');var _0x48c0ce=_0x1e950d['count'];var _0x5aca7b=_0x3eb52c?0x0:_0x541653[_0xa47a('0x19')];var _0x556aeb=_0x3eb52c?_0x1e950d[_0xa47a('0x1c')]:_0x541653[_0xa47a('0x19')]+_0x541653[_0xa47a('0x1b')];var _0x602a0c;if(_0x556aeb>=_0x48c0ce){_0x556aeb=_0x48c0ce;_0x602a0c=0xc8;}else{_0x602a0c=0xce;}_0x83d254['status'](_0x602a0c);return _0x83d254[_0xa47a('0x1d')](_0xa47a('0x1e'),_0x5aca7b+'-'+_0x556aeb+'/'+_0x48c0ce)['json'](_0x1e950d);}return null;};}function patchUpdates(_0x872bde){return function(_0x107bcd){try{jsonpatch[_0xa47a('0x1f')](_0x107bcd,_0x872bde,!![]);}catch(_0x250117){return BPromise[_0xa47a('0x20')](_0x250117);}return _0x107bcd['save']();};}function saveUpdates(_0x31e51f,_0x28605e){return function(_0x196e4e){if(_0x196e4e){return _0x196e4e[_0xa47a('0x21')](_0x31e51f)[_0xa47a('0x22')](function(_0x40fd5f){return _0x40fd5f;});}return null;};}function removeEntity(_0x48140b,_0x2d93fe){return function(_0x1ff134){if(_0x1ff134){return _0x1ff134[_0xa47a('0x23')]()[_0xa47a('0x22')](function(){_0x48140b[_0xa47a('0x16')](0xcc)[_0xa47a('0x17')]();});}};}function handleEntityNotFound(_0x3d5a8b,_0x19a957){return function(_0x29c67d){if(!_0x29c67d){_0x3d5a8b['sendStatus'](0x194);}return _0x29c67d;};}function handleError(_0x4a1e27,_0xc8917){_0xc8917=_0xc8917||0x1f4;return function(_0x39f3f8){logger[_0xa47a('0x24')](_0x39f3f8[_0xa47a('0x25')]);if(_0x39f3f8[_0xa47a('0x26')]){delete _0x39f3f8[_0xa47a('0x26')];}_0x4a1e27[_0xa47a('0x16')](_0xc8917)[_0xa47a('0x27')](_0x39f3f8);};}exports[_0xa47a('0x28')]=function(_0x3b1bc9,_0x35dca5){var _0x17a0ff={},_0x47171f={},_0x2707a2={'count':0x0,'rows':[]};var _0xbec8c3=_['map'](db[_0xa47a('0x29')][_0xa47a('0x2a')],function(_0x2d2e0e){return{'name':_0x2d2e0e[_0xa47a('0x2b')],'type':_0x2d2e0e[_0xa47a('0x2c')]['key']};});_0x47171f[_0xa47a('0x2d')]=_[_0xa47a('0x2e')](_0xbec8c3,_0xa47a('0x26'));_0x47171f[_0xa47a('0x2f')]=_[_0xa47a('0x30')](_0x3b1bc9[_0xa47a('0x2f')]);_0x47171f[_0xa47a('0x31')]=_[_0xa47a('0x32')](_0x47171f[_0xa47a('0x2d')],_0x47171f[_0xa47a('0x2f')]);_0x17a0ff[_0xa47a('0x33')]=_['intersection'](_0x47171f['model'],qs[_0xa47a('0x34')](_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x34')]));_0x17a0ff[_0xa47a('0x33')]=_0x17a0ff['attributes'][_0xa47a('0x35')]?_0x17a0ff['attributes']:_0x47171f[_0xa47a('0x2d')];if(!_0x3b1bc9['query'][_0xa47a('0x36')](_0xa47a('0x37'))){_0x17a0ff[_0xa47a('0x1b')]=qs[_0xa47a('0x1b')](_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x1b')]);_0x17a0ff[_0xa47a('0x19')]=qs[_0xa47a('0x19')](_0x3b1bc9[_0xa47a('0x2f')]['offset']);}_0x17a0ff[_0xa47a('0x38')]=qs[_0xa47a('0x39')](_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x39')]);_0x17a0ff[_0xa47a('0x3a')]=qs[_0xa47a('0x31')](_['pick'](_0x3b1bc9['query'],_0x47171f[_0xa47a('0x31')]),_0xbec8c3);if(_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x3b')]){_0x17a0ff[_0xa47a('0x3a')]=_[_0xa47a('0x3c')](_0x17a0ff['where'],{'$or':_['map'](_0xbec8c3,function(_0x559fbf){if(_0x559fbf[_0xa47a('0x2c')]!==_0xa47a('0x3d')){var _0x500f2b={};_0x500f2b[_0x559fbf[_0xa47a('0x26')]]={'$like':'%'+_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x3b')]+'%'};return _0x500f2b;}})});}_0x17a0ff=_[_0xa47a('0x3c')]({},_0x17a0ff,_0x3b1bc9[_0xa47a('0x3e')]);var _0xfd75cb={'where':_0x17a0ff[_0xa47a('0x3a')]};return db[_0xa47a('0x29')][_0xa47a('0x1c')](_0xfd75cb)[_0xa47a('0x22')](function(_0xca281e){_0x2707a2['count']=_0xca281e;if(_0x3b1bc9[_0xa47a('0x2f')][_0xa47a('0x3f')]){_0x17a0ff['include']=[{'all':!![]}];}return db[_0xa47a('0x29')]['findAll'](_0x17a0ff);})['then'](function(_0x4084ed){_0x2707a2['rows']=_0x4084ed;return _0x2707a2;})[_0xa47a('0x22')](respondWithFilteredResult(_0x35dca5,_0x17a0ff))[_0xa47a('0x40')](handleError(_0x35dca5,null));};exports['show']=function(_0xabedfa,_0x13e33d){var _0x14bfc7={'raw':!![],'where':{'id':_0xabedfa[_0xa47a('0x41')]['id']}},_0x5204d3={};_0x5204d3[_0xa47a('0x2d')]=_['keys'](db['FaxTransferReport'][_0xa47a('0x2a')]);_0x5204d3[_0xa47a('0x2f')]=_[_0xa47a('0x30')](_0xabedfa[_0xa47a('0x2f')]);_0x5204d3[_0xa47a('0x31')]=_[_0xa47a('0x32')](_0x5204d3['model'],_0x5204d3[_0xa47a('0x2f')]);_0x14bfc7['attributes']=_['intersection'](_0x5204d3['model'],qs[_0xa47a('0x34')](_0xabedfa[_0xa47a('0x2f')][_0xa47a('0x34')]));_0x14bfc7[_0xa47a('0x33')]=_0x14bfc7[_0xa47a('0x33')]['length']?_0x14bfc7[_0xa47a('0x33')]:_0x5204d3['model'];if(_0xabedfa[_0xa47a('0x2f')][_0xa47a('0x3f')]){_0x14bfc7['include']=[{'all':!![]}];}_0x14bfc7=_[_0xa47a('0x3c')]({},_0x14bfc7,_0xabedfa['options']);return db[_0xa47a('0x29')][_0xa47a('0x42')](_0x14bfc7)[_0xa47a('0x22')](handleEntityNotFound(_0x13e33d,null))['then'](respondWithResult(_0x13e33d,null))[_0xa47a('0x40')](handleError(_0x13e33d,null));};exports[_0xa47a('0x43')]=function(_0x1c36f4,_0x40d7bf){return db['FaxTransferReport'][_0xa47a('0x43')](_0x1c36f4[_0xa47a('0x44')],{})[_0xa47a('0x22')](respondWithResult(_0x40d7bf,0xc9))[_0xa47a('0x40')](handleError(_0x40d7bf,null));};exports[_0xa47a('0x21')]=function(_0x2bf12b,_0x117b16){if(_0x2bf12b[_0xa47a('0x44')]['id']){delete _0x2bf12b[_0xa47a('0x44')]['id'];}return db[_0xa47a('0x29')][_0xa47a('0x42')]({'where':{'id':_0x2bf12b[_0xa47a('0x41')]['id']}})['then'](handleEntityNotFound(_0x117b16,null))['then'](saveUpdates(_0x2bf12b['body'],null))['then'](respondWithResult(_0x117b16,null))[_0xa47a('0x40')](handleError(_0x117b16,null));};exports[_0xa47a('0x23')]=function(_0x5761c,_0x1ccf8f){return db[_0xa47a('0x29')][_0xa47a('0x42')]({'where':{'id':_0x5761c['params']['id']}})[_0xa47a('0x22')](handleEntityNotFound(_0x1ccf8f,null))[_0xa47a('0x22')](removeEntity(_0x1ccf8f,null))['catch'](handleError(_0x1ccf8f,null));};exports[_0xa47a('0x45')]=function(_0x1a3f2d,_0x1781d3){return db[_0xa47a('0x29')][_0xa47a('0x45')]()['then'](respondWithResult(_0x1781d3,null))[_0xa47a('0x40')](handleError(_0x1781d3,null));}; \ No newline at end of file +var _0x9acc=['end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','include','rows','catch','show','params','filters','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9acc,0x114));var _0xc9ac=function(_0x52131f,_0x264f49){_0x52131f=_0x52131f-0x0;var _0xec88ea=_0x9acc[_0x52131f];return _0xec88ea;};'use strict';var emlformat=require(_0xc9ac('0x0'));var rimraf=require(_0xc9ac('0x1'));var zipdir=require(_0xc9ac('0x2'));var jsonpatch=require(_0xc9ac('0x3'));var rp=require(_0xc9ac('0x4'));var moment=require(_0xc9ac('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc9ac('0x6'));var util=require(_0xc9ac('0x7'));var path=require('path');var sox=require(_0xc9ac('0x8'));var csv=require(_0xc9ac('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9ac('0xa'));var _=require(_0xc9ac('0xb'));var squel=require(_0xc9ac('0xc'));var crypto=require(_0xc9ac('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc9ac('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9ac('0xf'));var Papa=require(_0xc9ac('0x10'));var Redis=require(_0xc9ac('0x11'));var authService=require(_0xc9ac('0x12'));var qs=require(_0xc9ac('0x13'));var as=require(_0xc9ac('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc9ac('0x15'));var utils=require(_0xc9ac('0x16'));var config=require(_0xc9ac('0x17'));var licenseUtil=require(_0xc9ac('0x18'));var db=require(_0xc9ac('0x19'))['db'];function respondWithStatusCode(_0x287afb,_0x31fb1c){_0x31fb1c=_0x31fb1c||0xcc;return function(_0x5837d6){if(_0x5837d6){return _0x287afb[_0xc9ac('0x1a')](_0x31fb1c);}return _0x287afb[_0xc9ac('0x1b')](_0x31fb1c)[_0xc9ac('0x1c')]();};}function respondWithResult(_0x5a88cc,_0x38399c){_0x38399c=_0x38399c||0xc8;return function(_0x1d329d){if(_0x1d329d){return _0x5a88cc[_0xc9ac('0x1b')](_0x38399c)[_0xc9ac('0x1d')](_0x1d329d);}};}function respondWithFilteredResult(_0x208295,_0x21c2e7){return function(_0x379d74){if(_0x379d74){var _0x462bbf=typeof _0x21c2e7[_0xc9ac('0x1e')]===_0xc9ac('0x1f')&&typeof _0x21c2e7[_0xc9ac('0x20')]==='undefined';var _0x542ffb=_0x379d74[_0xc9ac('0x21')];var _0x90bc9a=_0x462bbf?0x0:_0x21c2e7[_0xc9ac('0x1e')];var _0x593889=_0x462bbf?_0x379d74['count']:_0x21c2e7['offset']+_0x21c2e7[_0xc9ac('0x20')];var _0xbbdd88;if(_0x593889>=_0x542ffb){_0x593889=_0x542ffb;_0xbbdd88=0xc8;}else{_0xbbdd88=0xce;}_0x208295[_0xc9ac('0x1b')](_0xbbdd88);return _0x208295[_0xc9ac('0x22')](_0xc9ac('0x23'),_0x90bc9a+'-'+_0x593889+'/'+_0x542ffb)['json'](_0x379d74);}return null;};}function patchUpdates(_0xa99bbe){return function(_0x3c1ab4){try{jsonpatch[_0xc9ac('0x24')](_0x3c1ab4,_0xa99bbe,!![]);}catch(_0x222b29){return BPromise['reject'](_0x222b29);}return _0x3c1ab4['save']();};}function saveUpdates(_0x4c28d5,_0xb75802){return function(_0x5dc9a5){if(_0x5dc9a5){return _0x5dc9a5[_0xc9ac('0x25')](_0x4c28d5)['then'](function(_0x29f2fd){return _0x29f2fd;});}return null;};}function removeEntity(_0x216ecd,_0x3c47ed){return function(_0x536e3c){if(_0x536e3c){return _0x536e3c[_0xc9ac('0x26')]()[_0xc9ac('0x27')](function(){_0x216ecd[_0xc9ac('0x1b')](0xcc)[_0xc9ac('0x1c')]();});}};}function handleEntityNotFound(_0x41641a,_0x9eb2dd){return function(_0xf5d74f){if(!_0xf5d74f){_0x41641a[_0xc9ac('0x1a')](0x194);}return _0xf5d74f;};}function handleError(_0x42dff1,_0x38ba25){_0x38ba25=_0x38ba25||0x1f4;return function(_0x14183a){logger[_0xc9ac('0x28')](_0x14183a['stack']);if(_0x14183a[_0xc9ac('0x29')]){delete _0x14183a[_0xc9ac('0x29')];}_0x42dff1[_0xc9ac('0x1b')](_0x38ba25)[_0xc9ac('0x2a')](_0x14183a);};}exports[_0xc9ac('0x2b')]=function(_0x4e82db,_0x53ba52){var _0x1cf219={},_0xfaa794={},_0x5edc97={'count':0x0,'rows':[]};var _0x4a81b3=_[_0xc9ac('0x2c')](db[_0xc9ac('0x2d')][_0xc9ac('0x2e')],function(_0x38aa38){return{'name':_0x38aa38[_0xc9ac('0x2f')],'type':_0x38aa38['type']['key']};});_0xfaa794[_0xc9ac('0x30')]=_['map'](_0x4a81b3,_0xc9ac('0x29'));_0xfaa794[_0xc9ac('0x31')]=_[_0xc9ac('0x32')](_0x4e82db[_0xc9ac('0x31')]);_0xfaa794['filters']=_[_0xc9ac('0x33')](_0xfaa794['model'],_0xfaa794[_0xc9ac('0x31')]);_0x1cf219['attributes']=_['intersection'](_0xfaa794[_0xc9ac('0x30')],qs[_0xc9ac('0x34')](_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x34')]));_0x1cf219[_0xc9ac('0x35')]=_0x1cf219[_0xc9ac('0x35')][_0xc9ac('0x36')]?_0x1cf219['attributes']:_0xfaa794[_0xc9ac('0x30')];if(!_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x37')](_0xc9ac('0x38'))){_0x1cf219[_0xc9ac('0x20')]=qs[_0xc9ac('0x20')](_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x20')]);_0x1cf219['offset']=qs[_0xc9ac('0x1e')](_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x1e')]);}_0x1cf219['order']=qs[_0xc9ac('0x39')](_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x39')]);_0x1cf219[_0xc9ac('0x3a')]=qs['filters'](_[_0xc9ac('0x3b')](_0x4e82db['query'],_0xfaa794['filters']),_0x4a81b3);if(_0x4e82db[_0xc9ac('0x31')]['filter']){_0x1cf219[_0xc9ac('0x3a')]=_['merge'](_0x1cf219[_0xc9ac('0x3a')],{'$or':_['map'](_0x4a81b3,function(_0x4beef0){if(_0x4beef0[_0xc9ac('0x3c')]!==_0xc9ac('0x3d')){var _0x2e7626={};_0x2e7626[_0x4beef0[_0xc9ac('0x29')]]={'$like':'%'+_0x4e82db[_0xc9ac('0x31')][_0xc9ac('0x3e')]+'%'};return _0x2e7626;}})});}_0x1cf219=_[_0xc9ac('0x3f')]({},_0x1cf219,_0x4e82db['options']);var _0x531bd4={'where':_0x1cf219[_0xc9ac('0x3a')]};return db[_0xc9ac('0x2d')][_0xc9ac('0x21')](_0x531bd4)[_0xc9ac('0x27')](function(_0x15e583){_0x5edc97[_0xc9ac('0x21')]=_0x15e583;if(_0x4e82db['query']['includeAll']){_0x1cf219[_0xc9ac('0x40')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x1cf219);})[_0xc9ac('0x27')](function(_0x4d2ea4){_0x5edc97[_0xc9ac('0x41')]=_0x4d2ea4;return _0x5edc97;})['then'](respondWithFilteredResult(_0x53ba52,_0x1cf219))[_0xc9ac('0x42')](handleError(_0x53ba52,null));};exports[_0xc9ac('0x43')]=function(_0x17eee0,_0x24f6a4){var _0x525054={'raw':!![],'where':{'id':_0x17eee0[_0xc9ac('0x44')]['id']}},_0x2d46b6={};_0x2d46b6['model']=_[_0xc9ac('0x32')](db[_0xc9ac('0x2d')][_0xc9ac('0x2e')]);_0x2d46b6[_0xc9ac('0x31')]=_[_0xc9ac('0x32')](_0x17eee0[_0xc9ac('0x31')]);_0x2d46b6[_0xc9ac('0x45')]=_[_0xc9ac('0x33')](_0x2d46b6[_0xc9ac('0x30')],_0x2d46b6[_0xc9ac('0x31')]);_0x525054[_0xc9ac('0x35')]=_[_0xc9ac('0x33')](_0x2d46b6[_0xc9ac('0x30')],qs[_0xc9ac('0x34')](_0x17eee0[_0xc9ac('0x31')][_0xc9ac('0x34')]));_0x525054[_0xc9ac('0x35')]=_0x525054[_0xc9ac('0x35')]['length']?_0x525054['attributes']:_0x2d46b6[_0xc9ac('0x30')];if(_0x17eee0['query'][_0xc9ac('0x46')]){_0x525054['include']=[{'all':!![]}];}_0x525054=_[_0xc9ac('0x3f')]({},_0x525054,_0x17eee0[_0xc9ac('0x47')]);return db['FaxTransferReport'][_0xc9ac('0x48')](_0x525054)[_0xc9ac('0x27')](handleEntityNotFound(_0x24f6a4,null))[_0xc9ac('0x27')](respondWithResult(_0x24f6a4,null))[_0xc9ac('0x42')](handleError(_0x24f6a4,null));};exports[_0xc9ac('0x49')]=function(_0x169847,_0x48cf7f){return db['FaxTransferReport'][_0xc9ac('0x49')](_0x169847[_0xc9ac('0x4a')],{})[_0xc9ac('0x27')](respondWithResult(_0x48cf7f,0xc9))[_0xc9ac('0x42')](handleError(_0x48cf7f,null));};exports[_0xc9ac('0x25')]=function(_0x546947,_0x524b72){if(_0x546947[_0xc9ac('0x4a')]['id']){delete _0x546947['body']['id'];}return db[_0xc9ac('0x2d')][_0xc9ac('0x48')]({'where':{'id':_0x546947[_0xc9ac('0x44')]['id']}})[_0xc9ac('0x27')](handleEntityNotFound(_0x524b72,null))[_0xc9ac('0x27')](saveUpdates(_0x546947['body'],null))['then'](respondWithResult(_0x524b72,null))['catch'](handleError(_0x524b72,null));};exports[_0xc9ac('0x26')]=function(_0x3ce835,_0x48b8de){return db[_0xc9ac('0x2d')][_0xc9ac('0x48')]({'where':{'id':_0x3ce835[_0xc9ac('0x44')]['id']}})['then'](handleEntityNotFound(_0x48b8de,null))[_0xc9ac('0x27')](removeEntity(_0x48b8de,null))[_0xc9ac('0x42')](handleError(_0x48b8de,null));};exports[_0xc9ac('0x4b')]=function(_0x279005,_0x1d2073){return db[_0xc9ac('0x2d')][_0xc9ac('0x4b')]()[_0xc9ac('0x27')](respondWithResult(_0x1d2073,null))['catch'](handleError(_0x1d2073,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 866d818..db1cb76 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 _0xeeff=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0xeeff,0x12b));var _0xfeef=function(_0x1f4b1a,_0x5a0343){_0x1f4b1a=_0x1f4b1a-0x0;var _0x1ea9cb=_0xeeff[_0x1f4b1a];return _0x1ea9cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfeef('0x0'))(_0xfeef('0x1'));var moment=require(_0xfeef('0x2'));var BPromise=require(_0xfeef('0x3'));var rp=require(_0xfeef('0x4'));var fs=require('fs');var path=require(_0xfeef('0x5'));var rimraf=require(_0xfeef('0x6'));var config=require(_0xfeef('0x7'));var attributes=require(_0xfeef('0x8'));module['exports']=function(_0x5af32d,_0x22f3c5){return _0x5af32d[_0xfeef('0x9')](_0xfeef('0xa'),attributes,{'tableName':_0xfeef('0xb'),'paranoid':![],'indexes':[{'name':_0xfeef('0xc'),'fields':[_0xfeef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5919=['api','moment','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x5919,0x15d));var _0x9591=function(_0x3dbc7b,_0x516da5){_0x3dbc7b=_0x3dbc7b-0x0;var _0x217508=_0x5919[_0x3dbc7b];return _0x217508;};'use strict';var _=require(_0x9591('0x0'));var util=require(_0x9591('0x1'));var logger=require('../../config/logger')(_0x9591('0x2'));var moment=require(_0x9591('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9591('0x4'));var rimraf=require(_0x9591('0x5'));var config=require(_0x9591('0x6'));var attributes=require(_0x9591('0x7'));module[_0x9591('0x8')]=function(_0x163a19,_0x588d45){return _0x163a19[_0x9591('0x9')](_0x9591('0xa'),attributes,{'tableName':_0x9591('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9591('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 610f89f..e466515 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 _0xca9a=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3b2983,_0x553477){var _0x303cfe=function(_0x30e397){while(--_0x30e397){_0x3b2983['push'](_0x3b2983['shift']());}};_0x303cfe(++_0x553477);}(_0xca9a,0xb9));var _0xaca9=function(_0xb79efd,_0x19221d){_0xb79efd=_0xb79efd-0x0;var _0x553fe6=_0xca9a[_0xb79efd];return _0x553fe6;};'use strict';var _=require(_0xaca9('0x0'));var util=require(_0xaca9('0x1'));var moment=require(_0xaca9('0x2'));var BPromise=require('bluebird');var rs=require(_0xaca9('0x3'));var fs=require('fs');var Redis=require(_0xaca9('0x4'));var db=require(_0xaca9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaca9('0x6'));var config=require(_0xaca9('0x7'));var jayson=require(_0xaca9('0x8'));var client=jayson[_0xaca9('0x9')][_0xaca9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa8a2,_0x5ac1a0,_0x36e008){return new BPromise(function(_0x1a0461,_0x2e1d){return client[_0xaca9('0xb')](_0x4aa8a2,_0x36e008)[_0xaca9('0xc')](function(_0x5f4139){logger[_0xaca9('0xd')](_0xaca9('0xe'),_0x5ac1a0,_0xaca9('0xf'));logger['debug'](_0xaca9('0x10'),_0x5ac1a0,_0xaca9('0xf'),JSON[_0xaca9('0x11')](_0x5f4139));if(_0x5f4139['error']){if(_0x5f4139[_0xaca9('0x12')][_0xaca9('0x13')]===0x1f4){logger[_0xaca9('0x12')](_0xaca9('0xe'),_0x5ac1a0,_0x5f4139[_0xaca9('0x12')][_0xaca9('0x14')]);return _0x2e1d(_0x5f4139[_0xaca9('0x12')]['message']);}logger[_0xaca9('0x12')](_0xaca9('0xe'),_0x5ac1a0,_0x5f4139['error'][_0xaca9('0x14')]);return _0x1a0461(_0x5f4139[_0xaca9('0x12')][_0xaca9('0x14')]);}else{logger[_0xaca9('0xd')](_0xaca9('0xe'),_0x5ac1a0,_0xaca9('0xf'));_0x1a0461(_0x5f4139[_0xaca9('0x15')][_0xaca9('0x14')]);}})[_0xaca9('0x16')](function(_0x367e88){logger[_0xaca9('0x12')](_0xaca9('0xe'),_0x5ac1a0,_0x367e88);_0x2e1d(_0x367e88);});});} \ No newline at end of file +var _0x999a=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','FaxTransferReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x999a,0x135));var _0xa999=function(_0x92643c,_0x2ed329){_0x92643c=_0x92643c-0x0;var _0x274aa2=_0x999a[_0x92643c];return _0x274aa2;};'use strict';var _=require('lodash');var util=require(_0xa999('0x0'));var moment=require('moment');var BPromise=require(_0xa999('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa999('0x2'))['db'];var utils=require(_0xa999('0x3'));var logger=require('../../config/logger')(_0xa999('0x4'));var config=require(_0xa999('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xa999('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481900,_0x550c51,_0x3e8ff7){return new BPromise(function(_0x8d6c7a,_0x54f7a5){return client[_0xa999('0x7')](_0x481900,_0x3e8ff7)[_0xa999('0x8')](function(_0x3c148e){logger[_0xa999('0x9')](_0xa999('0xa'),_0x550c51,_0xa999('0xb'));logger[_0xa999('0xc')](_0xa999('0xd'),_0x550c51,_0xa999('0xb'),JSON[_0xa999('0xe')](_0x3c148e));if(_0x3c148e['error']){if(_0x3c148e[_0xa999('0xf')][_0xa999('0x10')]===0x1f4){logger[_0xa999('0xf')](_0xa999('0xa'),_0x550c51,_0x3c148e[_0xa999('0xf')]['message']);return _0x54f7a5(_0x3c148e[_0xa999('0xf')]['message']);}logger[_0xa999('0xf')](_0xa999('0xa'),_0x550c51,_0x3c148e[_0xa999('0xf')]['message']);return _0x8d6c7a(_0x3c148e[_0xa999('0xf')][_0xa999('0x11')]);}else{logger['info'](_0xa999('0xa'),_0x550c51,_0xa999('0xb'));_0x8d6c7a(_0x3c148e[_0xa999('0x12')][_0xa999('0x11')]);}})[_0xa999('0x13')](function(_0x4931ab){logger[_0xa999('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x550c51,_0x4931ab);_0x54f7a5(_0x4931ab);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 7095584..6ec0861 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 _0x0c7e=['express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','describe','/:id','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2b1a5a,_0x4a8de8){var _0x4a3790=function(_0x19371c){while(--_0x19371c){_0x2b1a5a['push'](_0x2b1a5a['shift']());}};_0x4a3790(++_0x4a8de8);}(_0x0c7e,0x10a));var _0xe0c7=function(_0x425d4f,_0x3d1a07){_0x425d4f=_0x425d4f-0x0;var _0x518917=_0x0c7e[_0x425d4f];return _0x518917;};'use strict';var multer=require(_0xe0c7('0x0'));var util=require(_0xe0c7('0x1'));var path=require(_0xe0c7('0x2'));var timeout=require(_0xe0c7('0x3'));var express=require(_0xe0c7('0x4'));var router=express[_0xe0c7('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe0c7('0x6'));var config=require(_0xe0c7('0x7'));var controller=require(_0xe0c7('0x8'));router[_0xe0c7('0x9')]('/',auth[_0xe0c7('0xa')](),controller[_0xe0c7('0xb')]);router['get']('/describe',auth[_0xe0c7('0xa')](),controller[_0xe0c7('0xc')]);router[_0xe0c7('0x9')](_0xe0c7('0xd'),auth[_0xe0c7('0xa')](),controller['show']);router['post']('/',auth[_0xe0c7('0xa')](),controller[_0xe0c7('0xe')]);router['put'](_0xe0c7('0xd'),auth[_0xe0c7('0xa')](),controller[_0xe0c7('0xf')]);router[_0xe0c7('0x10')](_0xe0c7('0xd'),auth[_0xe0c7('0xa')](),controller[_0xe0c7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0e49=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x561be2,_0x42e8e4){var _0x41a37f=function(_0x67b782){while(--_0x67b782){_0x561be2['push'](_0x561be2['shift']());}};_0x41a37f(++_0x42e8e4);}(_0x0e49,0x1ed));var _0x90e4=function(_0x56d591,_0x3191a3){_0x56d591=_0x56d591-0x0;var _0x4bf0ff=_0x0e49[_0x56d591];return _0x4bf0ff;};'use strict';var multer=require(_0x90e4('0x0'));var util=require('util');var path=require(_0x90e4('0x1'));var timeout=require(_0x90e4('0x2'));var express=require(_0x90e4('0x3'));var router=express[_0x90e4('0x4')]();var fs_extra=require(_0x90e4('0x5'));var auth=require(_0x90e4('0x6'));var interaction=require(_0x90e4('0x7'));var config=require('../../config/environment');var controller=require(_0x90e4('0x8'));router[_0x90e4('0x9')]('/',auth[_0x90e4('0xa')](),controller[_0x90e4('0xb')]);router['get'](_0x90e4('0xc'),auth['isAuthenticated'](),controller[_0x90e4('0xd')]);router[_0x90e4('0x9')](_0x90e4('0xe'),auth['isAuthenticated'](),controller[_0x90e4('0xf')]);router[_0x90e4('0x10')]('/',auth[_0x90e4('0xa')](),controller[_0x90e4('0x11')]);router[_0x90e4('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x90e4('0x13')]);router[_0x90e4('0x14')](_0x90e4('0xe'),auth['isAuthenticated'](),controller[_0x90e4('0x15')]);module[_0x90e4('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index a5099dc..81a8839 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 _0x96cd=['post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','index','/:id','isAuthenticated','/:id/fields','getFields','create'];(function(_0x58eb53,_0x41a0bc){var _0x5b5c81=function(_0x375e0c){while(--_0x375e0c){_0x58eb53['push'](_0x58eb53['shift']());}};_0x5b5c81(++_0x41a0bc);}(_0x96cd,0x182));var _0xd96c=function(_0x5d3817,_0x3cc59e){_0x5d3817=_0x5d3817-0x0;var _0x3066ea=_0x96cd[_0x5d3817];return _0x3066ea;};'use strict';var multer=require(_0xd96c('0x0'));var util=require(_0xd96c('0x1'));var path=require(_0xd96c('0x2'));var timeout=require(_0xd96c('0x3'));var express=require(_0xd96c('0x4'));var router=express[_0xd96c('0x5')]();var fs_extra=require(_0xd96c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd96c('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd96c('0x8')]);router['get'](_0xd96c('0x9'),auth[_0xd96c('0xa')](),controller['show']);router['get']('/:id/configurations',auth[_0xd96c('0xa')](),controller['getConfigurations']);router['get'](_0xd96c('0xb'),auth[_0xd96c('0xa')](),controller[_0xd96c('0xc')]);router['post']('/',auth[_0xd96c('0xa')](),controller[_0xd96c('0xd')]);router[_0xd96c('0xe')]('/:id/configurations',auth[_0xd96c('0xa')](),controller[_0xd96c('0xf')]);router[_0xd96c('0x10')](_0xd96c('0x9'),auth[_0xd96c('0xa')](),controller[_0xd96c('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd96c('0x12')]);module[_0xd96c('0x13')]=router; \ No newline at end of file +var _0xdb83=['create','post','addConfiguration','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x21c068,_0x369d6a){var _0x5cf199=function(_0x2c0159){while(--_0x2c0159){_0x21c068['push'](_0x21c068['shift']());}};_0x5cf199(++_0x369d6a);}(_0xdb83,0x125));var _0x3db8=function(_0x108c45,_0x4a89b5){_0x108c45=_0x108c45-0x0;var _0x12fbad=_0xdb83[_0x108c45];return _0x12fbad;};'use strict';var multer=require('multer');var util=require(_0x3db8('0x0'));var path=require(_0x3db8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3db8('0x2'));var auth=require(_0x3db8('0x3'));var interaction=require(_0x3db8('0x4'));var config=require(_0x3db8('0x5'));var controller=require(_0x3db8('0x6'));router[_0x3db8('0x7')]('/',auth[_0x3db8('0x8')](),controller[_0x3db8('0x9')]);router['get'](_0x3db8('0xa'),auth[_0x3db8('0x8')](),controller[_0x3db8('0xb')]);router[_0x3db8('0x7')](_0x3db8('0xc'),auth[_0x3db8('0x8')](),controller['getConfigurations']);router[_0x3db8('0x7')](_0x3db8('0xd'),auth[_0x3db8('0x8')](),controller[_0x3db8('0xe')]);router['post']('/',auth[_0x3db8('0x8')](),controller[_0x3db8('0xf')]);router[_0x3db8('0x10')](_0x3db8('0xc'),auth['isAuthenticated'](),controller[_0x3db8('0x11')]);router['put'](_0x3db8('0xa'),auth[_0x3db8('0x8')](),controller[_0x3db8('0x12')]);router[_0x3db8('0x13')](_0x3db8('0xa'),auth['isAuthenticated'](),controller[_0x3db8('0x14')]);module[_0x3db8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index eb1f826..69add27 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 _0xcb7e=['newTab','sequelize','exports','STRING','basic'];(function(_0x2b6238,_0x1d9288){var _0x23d204=function(_0x3a3101){while(--_0x3a3101){_0x2b6238['push'](_0x2b6238['shift']());}};_0x23d204(++_0x1d9288);}(_0xcb7e,0xab));var _0xecb7=function(_0x496d0b,_0x484bbe){_0x496d0b=_0x496d0b-0x0;var _0x2b0508=_0xcb7e[_0x496d0b];return _0x2b0508;};'use strict';var Sequelize=require(_0xecb7('0x0'));module[_0xecb7('0x1')]={'name':{'type':Sequelize[_0xecb7('0x2')]},'description':{'type':Sequelize[_0xecb7('0x2')]},'username':{'type':Sequelize[_0xecb7('0x2')]},'remoteUri':{'type':Sequelize[_0xecb7('0x2')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0xecb7('0x3')},'password':{'type':Sequelize[_0xecb7('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xecb7('0x2')]},'token':{'type':Sequelize[_0xecb7('0x2')]},'tokenSecret':{'type':Sequelize[_0xecb7('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xecb7('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x61b3=['ENUM','basic','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x61b3,0x1af));var _0x361b=function(_0x3c9f65,_0x586363){_0x3c9f65=_0x3c9f65-0x0;var _0x382b8=_0x61b3[_0x3c9f65];return _0x382b8;};'use strict';var Sequelize=require(_0x361b('0x0'));module[_0x361b('0x1')]={'name':{'type':Sequelize[_0x361b('0x2')]},'description':{'type':Sequelize[_0x361b('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x361b('0x2')]},'authType':{'type':Sequelize[_0x361b('0x3')](_0x361b('0x4')),'defaultValue':_0x361b('0x4')},'password':{'type':Sequelize[_0x361b('0x2')]},'consumerKey':{'type':Sequelize[_0x361b('0x2')]},'consumerSecret':{'type':Sequelize[_0x361b('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x361b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x361b('0x3')]('integrationTab',_0x361b('0x5')),'defaultValue':_0x361b('0x6')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 2f5a4d7..ebc1b03 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 _0xd18c=['options','create','body','find','getConfigurations','params','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskConfiguration','Descriptions','getFields','priority','findOne','authType','username','consumerKey','consumerSecret','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','basic','Authorization','Basic\x20%s','%s:%s','password','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','findAll','catch','show','include'];(function(_0x57c6dd,_0x246610){var _0x6fd4e6=function(_0x428145){while(--_0x428145){_0x57c6dd['push'](_0x57c6dd['shift']());}};_0x6fd4e6(++_0x246610);}(_0xd18c,0x1d7));var _0xcd18=function(_0x43251e,_0x584e7f){_0x43251e=_0x43251e-0x0;var _0x5c8edc=_0xd18c[_0x43251e];return _0x5c8edc;};'use strict';var emlformat=require(_0xcd18('0x0'));var rimraf=require(_0xcd18('0x1'));var zipdir=require(_0xcd18('0x2'));var jsonpatch=require(_0xcd18('0x3'));var rp=require('request-promise');var moment=require(_0xcd18('0x4'));var BPromise=require(_0xcd18('0x5'));var Mustache=require(_0xcd18('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcd18('0x7'));var csv=require(_0xcd18('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd18('0x9'));var squel=require(_0xcd18('0xa'));var crypto=require(_0xcd18('0xb'));var jsforce=require(_0xcd18('0xc'));var deskjs=require(_0xcd18('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcd18('0xe'));var Redis=require(_0xcd18('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd18('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd18('0x11'))(_0xcd18('0x12'));var utils=require('../../config/utils');var config=require(_0xcd18('0x13'));var licenseUtil=require(_0xcd18('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x38c55c,_0x106edb){_0x106edb=_0x106edb||0xcc;return function(_0xcec5e1){if(_0xcec5e1){return _0x38c55c['sendStatus'](_0x106edb);}return _0x38c55c[_0xcd18('0x15')](_0x106edb)[_0xcd18('0x16')]();};}function respondWithResult(_0x10011f,_0x3c0a22){_0x3c0a22=_0x3c0a22||0xc8;return function(_0x33ad88){if(_0x33ad88){return _0x10011f[_0xcd18('0x15')](_0x3c0a22)[_0xcd18('0x17')](_0x33ad88);}};}function respondWithFilteredResult(_0x93c462,_0x39f74a){return function(_0x5430b6){if(_0x5430b6){var _0x209111=typeof _0x39f74a[_0xcd18('0x18')]===_0xcd18('0x19')&&typeof _0x39f74a[_0xcd18('0x1a')]===_0xcd18('0x19');var _0x1cb156=_0x5430b6[_0xcd18('0x1b')];var _0x4fabbd=_0x209111?0x0:_0x39f74a[_0xcd18('0x18')];var _0x47c7b4=_0x209111?_0x5430b6[_0xcd18('0x1b')]:_0x39f74a[_0xcd18('0x18')]+_0x39f74a[_0xcd18('0x1a')];var _0xfb1307;if(_0x47c7b4>=_0x1cb156){_0x47c7b4=_0x1cb156;_0xfb1307=0xc8;}else{_0xfb1307=0xce;}_0x93c462[_0xcd18('0x15')](_0xfb1307);return _0x93c462[_0xcd18('0x1c')](_0xcd18('0x1d'),_0x4fabbd+'-'+_0x47c7b4+'/'+_0x1cb156)[_0xcd18('0x17')](_0x5430b6);}return null;};}function patchUpdates(_0x5a903b){return function(_0x42e4f3){try{jsonpatch[_0xcd18('0x1e')](_0x42e4f3,_0x5a903b,!![]);}catch(_0x4010b9){return BPromise['reject'](_0x4010b9);}return _0x42e4f3[_0xcd18('0x1f')]();};}function saveUpdates(_0xdcef44,_0x1c8a2a){return function(_0x5e21d8){if(_0x5e21d8){return _0x5e21d8[_0xcd18('0x20')](_0xdcef44)[_0xcd18('0x21')](function(_0x3c131d){return _0x3c131d;});}return null;};}function removeEntity(_0x252163,_0x5b0c05){return function(_0x4b58c9){if(_0x4b58c9){return _0x4b58c9[_0xcd18('0x22')]()[_0xcd18('0x21')](function(){_0x252163[_0xcd18('0x15')](0xcc)[_0xcd18('0x16')]();});}};}function handleEntityNotFound(_0x45bc10,_0x2c3b10){return function(_0x15792e){if(!_0x15792e){_0x45bc10[_0xcd18('0x23')](0x194);}return _0x15792e;};}function handleError(_0x265fcf,_0x5b941f){_0x5b941f=_0x5b941f||0x1f4;return function(_0x1efa6b){logger[_0xcd18('0x24')](_0x1efa6b[_0xcd18('0x25')]);if(_0x1efa6b[_0xcd18('0x26')]){delete _0x1efa6b[_0xcd18('0x26')];}_0x265fcf['status'](_0x5b941f)[_0xcd18('0x27')](_0x1efa6b);};}exports[_0xcd18('0x28')]=function(_0x18d958,_0x2e1d6c){var _0x5d5e85={},_0x569f64={},_0x5b598a={'count':0x0,'rows':[]};var _0x1ad3fe=_[_0xcd18('0x29')](db[_0xcd18('0x2a')][_0xcd18('0x2b')],function(_0x2a34a1){return{'name':_0x2a34a1['fieldName'],'type':_0x2a34a1[_0xcd18('0x2c')]['key']};});_0x569f64['model']=_[_0xcd18('0x29')](_0x1ad3fe,_0xcd18('0x26'));_0x569f64[_0xcd18('0x2d')]=_[_0xcd18('0x2e')](_0x18d958[_0xcd18('0x2d')]);_0x569f64[_0xcd18('0x2f')]=_[_0xcd18('0x30')](_0x569f64[_0xcd18('0x31')],_0x569f64[_0xcd18('0x2d')]);_0x5d5e85[_0xcd18('0x32')]=_[_0xcd18('0x30')](_0x569f64[_0xcd18('0x31')],qs[_0xcd18('0x33')](_0x18d958[_0xcd18('0x2d')][_0xcd18('0x33')]));_0x5d5e85[_0xcd18('0x32')]=_0x5d5e85['attributes'][_0xcd18('0x34')]?_0x5d5e85[_0xcd18('0x32')]:_0x569f64[_0xcd18('0x31')];if(!_0x18d958[_0xcd18('0x2d')]['hasOwnProperty'](_0xcd18('0x35'))){_0x5d5e85[_0xcd18('0x1a')]=qs[_0xcd18('0x1a')](_0x18d958[_0xcd18('0x2d')][_0xcd18('0x1a')]);_0x5d5e85[_0xcd18('0x18')]=qs[_0xcd18('0x18')](_0x18d958[_0xcd18('0x2d')][_0xcd18('0x18')]);}_0x5d5e85[_0xcd18('0x36')]=qs['sort'](_0x18d958['query'][_0xcd18('0x37')]);_0x5d5e85[_0xcd18('0x38')]=qs['filters'](_['pick'](_0x18d958[_0xcd18('0x2d')],_0x569f64[_0xcd18('0x2f')]),_0x1ad3fe);if(_0x18d958[_0xcd18('0x2d')][_0xcd18('0x39')]){_0x5d5e85['where']=_[_0xcd18('0x3a')](_0x5d5e85['where'],{'$or':_[_0xcd18('0x29')](_0x1ad3fe,function(_0x14fd91){if(_0x14fd91[_0xcd18('0x2c')]!=='VIRTUAL'){var _0x2b468f={};_0x2b468f[_0x14fd91['name']]={'$like':'%'+_0x18d958[_0xcd18('0x2d')][_0xcd18('0x39')]+'%'};return _0x2b468f;}})});}_0x5d5e85=_[_0xcd18('0x3a')]({},_0x5d5e85,_0x18d958['options']);var _0x3a4c99={'where':_0x5d5e85[_0xcd18('0x38')]};return db[_0xcd18('0x2a')][_0xcd18('0x1b')](_0x3a4c99)[_0xcd18('0x21')](function(_0x5b81f8){_0x5b598a[_0xcd18('0x1b')]=_0x5b81f8;if(_0x18d958[_0xcd18('0x2d')][_0xcd18('0x3b')]){_0x5d5e85['include']=[{'all':!![]}];}return db[_0xcd18('0x2a')][_0xcd18('0x3c')](_0x5d5e85);})[_0xcd18('0x21')](function(_0x48ae3b){_0x5b598a['rows']=_0x48ae3b;return _0x5b598a;})[_0xcd18('0x21')](respondWithFilteredResult(_0x2e1d6c,_0x5d5e85))[_0xcd18('0x3d')](handleError(_0x2e1d6c,null));};exports[_0xcd18('0x3e')]=function(_0x18aeb4,_0x2bd36b){var _0x46dc94={'raw':![],'where':{'id':_0x18aeb4['params']['id']}},_0x457fdc={};_0x457fdc['model']=_['keys'](db[_0xcd18('0x2a')]['rawAttributes']);_0x457fdc[_0xcd18('0x2d')]=_[_0xcd18('0x2e')](_0x18aeb4[_0xcd18('0x2d')]);_0x457fdc[_0xcd18('0x2f')]=_[_0xcd18('0x30')](_0x457fdc[_0xcd18('0x31')],_0x457fdc['query']);_0x46dc94['attributes']=_['intersection'](_0x457fdc[_0xcd18('0x31')],qs[_0xcd18('0x33')](_0x18aeb4[_0xcd18('0x2d')]['fields']));_0x46dc94[_0xcd18('0x32')]=_0x46dc94[_0xcd18('0x32')][_0xcd18('0x34')]?_0x46dc94['attributes']:_0x457fdc['model'];if(_0x18aeb4[_0xcd18('0x2d')][_0xcd18('0x3b')]){_0x46dc94[_0xcd18('0x3f')]=[{'all':!![]}];}_0x46dc94=_[_0xcd18('0x3a')]({},_0x46dc94,_0x18aeb4[_0xcd18('0x40')]);return db['DeskAccount']['find'](_0x46dc94)[_0xcd18('0x21')](handleEntityNotFound(_0x2bd36b,null))[_0xcd18('0x21')](respondWithResult(_0x2bd36b,null))['catch'](handleError(_0x2bd36b,null));};exports[_0xcd18('0x41')]=function(_0x4e42b7,_0x8f5c61){return db['DeskAccount'][_0xcd18('0x41')](_0x4e42b7['body'],{})[_0xcd18('0x21')](respondWithResult(_0x8f5c61,0xc9))[_0xcd18('0x3d')](handleError(_0x8f5c61,null));};exports[_0xcd18('0x20')]=function(_0x3f3935,_0x23ae2a){if(_0x3f3935['body']['id']){delete _0x3f3935[_0xcd18('0x42')]['id'];}return db['DeskAccount'][_0xcd18('0x43')]({'where':{'id':_0x3f3935['params']['id']}})[_0xcd18('0x21')](handleEntityNotFound(_0x23ae2a,null))['then'](saveUpdates(_0x3f3935[_0xcd18('0x42')],null))[_0xcd18('0x21')](respondWithResult(_0x23ae2a,null))[_0xcd18('0x3d')](handleError(_0x23ae2a,null));};exports['destroy']=function(_0x392e0d,_0x58a3a2){return db[_0xcd18('0x2a')][_0xcd18('0x43')]({'where':{'id':_0x392e0d['params']['id']}})[_0xcd18('0x21')](handleEntityNotFound(_0x58a3a2,null))[_0xcd18('0x21')](removeEntity(_0x58a3a2,null))[_0xcd18('0x3d')](handleError(_0x58a3a2,null));};exports[_0xcd18('0x44')]=function(_0x31d92e,_0x42b312,_0x29fe68){var _0x13057d={};var _0x255943={};var _0x31cd9f;var _0x1c0f2d;return db[_0xcd18('0x2a')]['findOne']({'where':{'id':_0x31d92e[_0xcd18('0x45')]['id']}})['then'](handleEntityNotFound(_0x42b312,null))[_0xcd18('0x21')](function(_0x11ee51){if(_0x11ee51){_0x31cd9f=_0x11ee51;_0x255943[_0xcd18('0x31')]=_[_0xcd18('0x2e')](db['DeskConfiguration'][_0xcd18('0x2b')]);_0x255943['query']=_['keys'](_0x31d92e[_0xcd18('0x2d')]);_0x255943[_0xcd18('0x2f')]=_[_0xcd18('0x30')](_0x255943[_0xcd18('0x31')],_0x255943[_0xcd18('0x2d')]);_0x13057d[_0xcd18('0x32')]=_[_0xcd18('0x30')](_0x255943[_0xcd18('0x31')],qs[_0xcd18('0x33')](_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x33')]));_0x13057d[_0xcd18('0x32')]=_0x13057d[_0xcd18('0x32')][_0xcd18('0x34')]?_0x13057d[_0xcd18('0x32')]:_0x255943['model'];_0x13057d['order']=qs[_0xcd18('0x37')](_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x37')]);_0x13057d['where']=qs[_0xcd18('0x2f')](_[_0xcd18('0x46')](_0x31d92e['query'],_0x255943[_0xcd18('0x2f')]));if(_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x39')]){_0x13057d[_0xcd18('0x38')]=_[_0xcd18('0x3a')](_0x13057d[_0xcd18('0x38')],{'$or':_[_0xcd18('0x29')](_0x13057d[_0xcd18('0x32')],function(_0x4bd164){var _0x49caf9={};_0x49caf9[_0x4bd164]={'$like':'%'+_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x39')]+'%'};return _0x49caf9;})});}_0x13057d=_[_0xcd18('0x3a')]({},_0x13057d,_0x31d92e[_0xcd18('0x40')]);return _0x31cd9f[_0xcd18('0x44')](_0x13057d);}})[_0xcd18('0x21')](function(_0x59e465){if(_0x59e465){_0x1c0f2d=_0x59e465[_0xcd18('0x34')];if(!_0x31d92e[_0xcd18('0x2d')]['hasOwnProperty']('nolimit')){_0x13057d[_0xcd18('0x1a')]=qs[_0xcd18('0x1a')](_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x1a')]);_0x13057d[_0xcd18('0x18')]=qs[_0xcd18('0x18')](_0x31d92e[_0xcd18('0x2d')][_0xcd18('0x18')]);}return _0x31cd9f['getConfigurations'](_0x13057d);}})[_0xcd18('0x21')](function(_0x315807){if(_0x315807){return _0x315807?{'count':_0x1c0f2d,'rows':_0x315807}:null;}})['then'](respondWithResult(_0x42b312,null))['catch'](handleError(_0x42b312,null));};exports[_0xcd18('0x47')]=function(_0x56951b,_0x5432a8,_0x5dbc31){if(_0x56951b[_0xcd18('0x42')]['id']){delete _0x56951b['body']['id'];}return db[_0xcd18('0x2a')]['findOne']({'where':{'id':_0x56951b[_0xcd18('0x45')]['id']}})[_0xcd18('0x21')](handleEntityNotFound(_0x5432a8,null))[_0xcd18('0x21')](function(_0x1ef605){if(_0x1ef605){_0x56951b[_0xcd18('0x42')][_0xcd18('0x48')]=_0x1ef605['id'];_0x56951b[_0xcd18('0x42')][_0xcd18('0x49')]=integrations[_0xcd18('0x4a')](_0x56951b['body'][_0xcd18('0x4b')],_0x56951b['body'][_0xcd18('0x2c')]);_0x56951b[_0xcd18('0x42')]['Descriptions']=integrations['getDescriptions'](_0x56951b[_0xcd18('0x42')][_0xcd18('0x4b')],_0x56951b[_0xcd18('0x42')][_0xcd18('0x2c')]);return db[_0xcd18('0x4c')]['create'](_0x56951b[_0xcd18('0x42')],{'include':[{'model':db['DeskField'],'as':_0xcd18('0x49')},{'model':db['DeskField'],'as':_0xcd18('0x4d')}]});}return null;})['then'](respondWithResult(_0x5432a8,null))[_0xcd18('0x3d')](handleError(_0x5432a8,null));};exports[_0xcd18('0x4e')]=function(_0x2d5f56,_0x4bcc9a,_0x471464){var _0x47c649=[{'name':'priority','label':_0xcd18('0x4f'),'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 _0x1a8faf='';return db[_0xcd18('0x2a')][_0xcd18('0x50')]({'where':{'id':_0x2d5f56['params']['id']},'attributes':['id','remoteUri',_0xcd18('0x51'),_0xcd18('0x52'),'password',_0xcd18('0x53'),_0xcd18('0x54'),'token',_0xcd18('0x55')]})[_0xcd18('0x21')](handleEntityNotFound(_0x4bcc9a,null))[_0xcd18('0x21')](function(_0xbef1f1){if(_0xbef1f1){_0x1a8faf=_0xbef1f1[_0xcd18('0x56')];var _0x373b6f=_0x1a8faf[_0xcd18('0x57')](-0x1);if(_0x373b6f==='/'){_0x1a8faf=_0x1a8faf[_0xcd18('0x58')](0x0,_0x1a8faf[_0xcd18('0x59')](_0x373b6f));}var _0x1b0474={'method':_0xcd18('0x5a'),'uri':util[_0xcd18('0x5b')](_0xcd18('0x5c'),_0x1a8faf),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xbef1f1['authType']===_0xcd18('0x5d')){_0x1b0474['headers'][_0xcd18('0x5e')]=util[_0xcd18('0x5b')](_0xcd18('0x5f'),new Buffer(util[_0xcd18('0x5b')](_0xcd18('0x60'),_0xbef1f1[_0xcd18('0x52')],_0xbef1f1[_0xcd18('0x61')]))['toString']('base64'));}return rp(_0x1b0474)[_0xcd18('0x21')](function(_0x54c0e4){return _0x47c649[_0xcd18('0x62')](_[_0xcd18('0x29')](_0x54c0e4[_0xcd18('0x63')][_0xcd18('0x64')],function(_0x5d905d){return{'id':_0x5d905d[_0xcd18('0x26')],'name':_0x5d905d[_0xcd18('0x26')],'type':_0x5d905d['type'],'active':_0x5d905d[_0xcd18('0x65')],'label':_0x5d905d[_0xcd18('0x66')],'custom':!![]};}));});}})['then'](function(_0x264a75){return{'count':_0x264a75[_0xcd18('0x34')],'rows':_0x264a75};})[_0xcd18('0x21')](respondWithResult(_0x4bcc9a,null))['catch'](function(_0x6609e6){var _0x348fa0=_0x2d5f56[_0xcd18('0x2d')][_0xcd18('0x67')]?0x1f4:_0x6609e6[_0xcd18('0x68')]||0x1f4;logger[_0xcd18('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xcd18('0x4e'),_0x348fa0,JSON[_0xcd18('0x69')](_0x6609e6));delete _0x6609e6[_0xcd18('0x26')];if(_0x348fa0===0x191){_0x348fa0=0x190;}_0x4bcc9a[_0xcd18('0x15')](_0x348fa0)[_0xcd18('0x27')](_0x2d5f56[_0xcd18('0x2d')][_0xcd18('0x67')]?{'message':_0xcd18('0x6a'),'statusCode':_0x6609e6[_0xcd18('0x68')]}:_0x6609e6);});}; \ No newline at end of file +var _0xeb3c=['stringify','Wrong\x20credentials','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','DeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','body','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','DeskField','priority','username','password','consumerKey','consumerSecret','token','remoteUri','slice','substring','GET','format','application/json','basic','headers','Authorization','base64','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s'];(function(_0x262114,_0x21726e){var _0x433d0b=function(_0x3c38ec){while(--_0x3c38ec){_0x262114['push'](_0x262114['shift']());}};_0x433d0b(++_0x21726e);}(_0xeb3c,0x1be));var _0xceb3=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xeb3c[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xceb3('0x0'));var rimraf=require(_0xceb3('0x1'));var zipdir=require(_0xceb3('0x2'));var jsonpatch=require(_0xceb3('0x3'));var rp=require(_0xceb3('0x4'));var moment=require(_0xceb3('0x5'));var BPromise=require(_0xceb3('0x6'));var Mustache=require(_0xceb3('0x7'));var util=require(_0xceb3('0x8'));var path=require(_0xceb3('0x9'));var sox=require(_0xceb3('0xa'));var csv=require(_0xceb3('0xb'));var ejs=require(_0xceb3('0xc'));var fs=require('fs');var fs_extra=require(_0xceb3('0xd'));var _=require(_0xceb3('0xe'));var squel=require('squel');var crypto=require(_0xceb3('0xf'));var jsforce=require(_0xceb3('0x10'));var deskjs=require(_0xceb3('0x11'));var toCsv=require(_0xceb3('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xceb3('0x12'));var authService=require(_0xceb3('0x13'));var qs=require(_0xceb3('0x14'));var as=require(_0xceb3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xceb3('0x16'))(_0xceb3('0x17'));var utils=require('../../config/utils');var config=require(_0xceb3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xceb3('0x19'));function respondWithStatusCode(_0x311006,_0x32e9bf){_0x32e9bf=_0x32e9bf||0xcc;return function(_0x136f44){if(_0x136f44){return _0x311006['sendStatus'](_0x32e9bf);}return _0x311006['status'](_0x32e9bf)[_0xceb3('0x1a')]();};}function respondWithResult(_0x500866,_0x1f2707){_0x1f2707=_0x1f2707||0xc8;return function(_0x3619d9){if(_0x3619d9){return _0x500866[_0xceb3('0x1b')](_0x1f2707)['json'](_0x3619d9);}};}function respondWithFilteredResult(_0x2cb9c3,_0x379e84){return function(_0x1315f1){if(_0x1315f1){var _0x316da8=typeof _0x379e84[_0xceb3('0x1c')]===_0xceb3('0x1d')&&typeof _0x379e84[_0xceb3('0x1e')]===_0xceb3('0x1d');var _0x29fd08=_0x1315f1[_0xceb3('0x1f')];var _0x2e83ca=_0x316da8?0x0:_0x379e84[_0xceb3('0x1c')];var _0x49a3eb=_0x316da8?_0x1315f1['count']:_0x379e84[_0xceb3('0x1c')]+_0x379e84[_0xceb3('0x1e')];var _0x3de923;if(_0x49a3eb>=_0x29fd08){_0x49a3eb=_0x29fd08;_0x3de923=0xc8;}else{_0x3de923=0xce;}_0x2cb9c3[_0xceb3('0x1b')](_0x3de923);return _0x2cb9c3[_0xceb3('0x20')](_0xceb3('0x21'),_0x2e83ca+'-'+_0x49a3eb+'/'+_0x29fd08)['json'](_0x1315f1);}return null;};}function patchUpdates(_0x597340){return function(_0x2876dd){try{jsonpatch[_0xceb3('0x22')](_0x2876dd,_0x597340,!![]);}catch(_0x7efcfd){return BPromise[_0xceb3('0x23')](_0x7efcfd);}return _0x2876dd[_0xceb3('0x24')]();};}function saveUpdates(_0x36f55a,_0x57eb38){return function(_0x20a013){if(_0x20a013){return _0x20a013[_0xceb3('0x25')](_0x36f55a)[_0xceb3('0x26')](function(_0x375bcf){return _0x375bcf;});}return null;};}function removeEntity(_0x16b6e9,_0x163694){return function(_0x473b3e){if(_0x473b3e){return _0x473b3e[_0xceb3('0x27')]()[_0xceb3('0x26')](function(){_0x16b6e9['status'](0xcc)[_0xceb3('0x1a')]();});}};}function handleEntityNotFound(_0x1549bf,_0x1061e8){return function(_0x447c23){if(!_0x447c23){_0x1549bf[_0xceb3('0x28')](0x194);}return _0x447c23;};}function handleError(_0x108ed6,_0x1788e7){_0x1788e7=_0x1788e7||0x1f4;return function(_0x2d3434){logger[_0xceb3('0x29')](_0x2d3434[_0xceb3('0x2a')]);if(_0x2d3434[_0xceb3('0x2b')]){delete _0x2d3434[_0xceb3('0x2b')];}_0x108ed6[_0xceb3('0x1b')](_0x1788e7)[_0xceb3('0x2c')](_0x2d3434);};}exports[_0xceb3('0x2d')]=function(_0xb4de27,_0x2f3ed7){var _0x133325={},_0x75d7c7={},_0x25c1ab={'count':0x0,'rows':[]};var _0x151372=_['map'](db[_0xceb3('0x2e')][_0xceb3('0x2f')],function(_0x53e5b7){return{'name':_0x53e5b7['fieldName'],'type':_0x53e5b7[_0xceb3('0x30')][_0xceb3('0x31')]};});_0x75d7c7[_0xceb3('0x32')]=_[_0xceb3('0x33')](_0x151372,_0xceb3('0x2b'));_0x75d7c7[_0xceb3('0x34')]=_[_0xceb3('0x35')](_0xb4de27['query']);_0x75d7c7[_0xceb3('0x36')]=_[_0xceb3('0x37')](_0x75d7c7[_0xceb3('0x32')],_0x75d7c7['query']);_0x133325[_0xceb3('0x38')]=_[_0xceb3('0x37')](_0x75d7c7['model'],qs[_0xceb3('0x39')](_0xb4de27[_0xceb3('0x34')]['fields']));_0x133325['attributes']=_0x133325[_0xceb3('0x38')]['length']?_0x133325['attributes']:_0x75d7c7[_0xceb3('0x32')];if(!_0xb4de27[_0xceb3('0x34')][_0xceb3('0x3a')](_0xceb3('0x3b'))){_0x133325['limit']=qs[_0xceb3('0x1e')](_0xb4de27['query'][_0xceb3('0x1e')]);_0x133325[_0xceb3('0x1c')]=qs['offset'](_0xb4de27[_0xceb3('0x34')][_0xceb3('0x1c')]);}_0x133325[_0xceb3('0x3c')]=qs[_0xceb3('0x3d')](_0xb4de27[_0xceb3('0x34')]['sort']);_0x133325[_0xceb3('0x3e')]=qs[_0xceb3('0x36')](_[_0xceb3('0x3f')](_0xb4de27[_0xceb3('0x34')],_0x75d7c7[_0xceb3('0x36')]),_0x151372);if(_0xb4de27[_0xceb3('0x34')]['filter']){_0x133325[_0xceb3('0x3e')]=_[_0xceb3('0x40')](_0x133325[_0xceb3('0x3e')],{'$or':_['map'](_0x151372,function(_0x27d8d7){if(_0x27d8d7[_0xceb3('0x30')]!==_0xceb3('0x41')){var _0x1ea344={};_0x1ea344[_0x27d8d7[_0xceb3('0x2b')]]={'$like':'%'+_0xb4de27[_0xceb3('0x34')][_0xceb3('0x42')]+'%'};return _0x1ea344;}})});}_0x133325=_[_0xceb3('0x40')]({},_0x133325,_0xb4de27[_0xceb3('0x43')]);var _0x312153={'where':_0x133325[_0xceb3('0x3e')]};return db[_0xceb3('0x2e')][_0xceb3('0x1f')](_0x312153)['then'](function(_0x202125){_0x25c1ab[_0xceb3('0x1f')]=_0x202125;if(_0xb4de27[_0xceb3('0x34')][_0xceb3('0x44')]){_0x133325[_0xceb3('0x45')]=[{'all':!![]}];}return db[_0xceb3('0x2e')]['findAll'](_0x133325);})['then'](function(_0x377c09){_0x25c1ab[_0xceb3('0x46')]=_0x377c09;return _0x25c1ab;})['then'](respondWithFilteredResult(_0x2f3ed7,_0x133325))[_0xceb3('0x47')](handleError(_0x2f3ed7,null));};exports[_0xceb3('0x48')]=function(_0x4eb637,_0x141cf8){var _0x13ae31={'raw':![],'where':{'id':_0x4eb637[_0xceb3('0x49')]['id']}},_0x4b63cf={};_0x4b63cf[_0xceb3('0x32')]=_['keys'](db['DeskAccount'][_0xceb3('0x2f')]);_0x4b63cf[_0xceb3('0x34')]=_[_0xceb3('0x35')](_0x4eb637['query']);_0x4b63cf[_0xceb3('0x36')]=_[_0xceb3('0x37')](_0x4b63cf[_0xceb3('0x32')],_0x4b63cf[_0xceb3('0x34')]);_0x13ae31[_0xceb3('0x38')]=_[_0xceb3('0x37')](_0x4b63cf[_0xceb3('0x32')],qs[_0xceb3('0x39')](_0x4eb637[_0xceb3('0x34')][_0xceb3('0x39')]));_0x13ae31[_0xceb3('0x38')]=_0x13ae31[_0xceb3('0x38')][_0xceb3('0x4a')]?_0x13ae31[_0xceb3('0x38')]:_0x4b63cf[_0xceb3('0x32')];if(_0x4eb637[_0xceb3('0x34')][_0xceb3('0x44')]){_0x13ae31['include']=[{'all':!![]}];}_0x13ae31=_['merge']({},_0x13ae31,_0x4eb637[_0xceb3('0x43')]);return db[_0xceb3('0x2e')][_0xceb3('0x4b')](_0x13ae31)[_0xceb3('0x26')](handleEntityNotFound(_0x141cf8,null))[_0xceb3('0x26')](respondWithResult(_0x141cf8,null))[_0xceb3('0x47')](handleError(_0x141cf8,null));};exports['create']=function(_0x38b096,_0x3eba5e){return db['DeskAccount']['create'](_0x38b096[_0xceb3('0x4c')],{})[_0xceb3('0x26')](respondWithResult(_0x3eba5e,0xc9))[_0xceb3('0x47')](handleError(_0x3eba5e,null));};exports[_0xceb3('0x25')]=function(_0x4eaee4,_0x5a861d){if(_0x4eaee4[_0xceb3('0x4c')]['id']){delete _0x4eaee4['body']['id'];}return db[_0xceb3('0x2e')]['find']({'where':{'id':_0x4eaee4['params']['id']}})[_0xceb3('0x26')](handleEntityNotFound(_0x5a861d,null))[_0xceb3('0x26')](saveUpdates(_0x4eaee4[_0xceb3('0x4c')],null))[_0xceb3('0x26')](respondWithResult(_0x5a861d,null))['catch'](handleError(_0x5a861d,null));};exports[_0xceb3('0x27')]=function(_0x42aa33,_0x1f25c2){return db[_0xceb3('0x2e')]['find']({'where':{'id':_0x42aa33[_0xceb3('0x49')]['id']}})[_0xceb3('0x26')](handleEntityNotFound(_0x1f25c2,null))[_0xceb3('0x26')](removeEntity(_0x1f25c2,null))[_0xceb3('0x47')](handleError(_0x1f25c2,null));};exports[_0xceb3('0x4d')]=function(_0xd3b83,_0x1727aa,_0x486fb2){var _0x4ce556={};var _0x4e4ea8={};var _0x767517;var _0x417c3f;return db[_0xceb3('0x2e')][_0xceb3('0x4e')]({'where':{'id':_0xd3b83[_0xceb3('0x49')]['id']}})[_0xceb3('0x26')](handleEntityNotFound(_0x1727aa,null))['then'](function(_0xb97a9e){if(_0xb97a9e){_0x767517=_0xb97a9e;_0x4e4ea8[_0xceb3('0x32')]=_['keys'](db[_0xceb3('0x4f')]['rawAttributes']);_0x4e4ea8[_0xceb3('0x34')]=_[_0xceb3('0x35')](_0xd3b83[_0xceb3('0x34')]);_0x4e4ea8[_0xceb3('0x36')]=_['intersection'](_0x4e4ea8['model'],_0x4e4ea8[_0xceb3('0x34')]);_0x4ce556['attributes']=_['intersection'](_0x4e4ea8[_0xceb3('0x32')],qs[_0xceb3('0x39')](_0xd3b83[_0xceb3('0x34')][_0xceb3('0x39')]));_0x4ce556['attributes']=_0x4ce556[_0xceb3('0x38')][_0xceb3('0x4a')]?_0x4ce556[_0xceb3('0x38')]:_0x4e4ea8[_0xceb3('0x32')];_0x4ce556[_0xceb3('0x3c')]=qs['sort'](_0xd3b83[_0xceb3('0x34')][_0xceb3('0x3d')]);_0x4ce556[_0xceb3('0x3e')]=qs[_0xceb3('0x36')](_['pick'](_0xd3b83[_0xceb3('0x34')],_0x4e4ea8[_0xceb3('0x36')]));if(_0xd3b83[_0xceb3('0x34')]['filter']){_0x4ce556['where']=_[_0xceb3('0x40')](_0x4ce556[_0xceb3('0x3e')],{'$or':_[_0xceb3('0x33')](_0x4ce556['attributes'],function(_0x2e3fa8){var _0x4d1c3e={};_0x4d1c3e[_0x2e3fa8]={'$like':'%'+_0xd3b83[_0xceb3('0x34')]['filter']+'%'};return _0x4d1c3e;})});}_0x4ce556=_['merge']({},_0x4ce556,_0xd3b83[_0xceb3('0x43')]);return _0x767517[_0xceb3('0x4d')](_0x4ce556);}})[_0xceb3('0x26')](function(_0x5182ab){if(_0x5182ab){_0x417c3f=_0x5182ab['length'];if(!_0xd3b83['query']['hasOwnProperty'](_0xceb3('0x3b'))){_0x4ce556[_0xceb3('0x1e')]=qs[_0xceb3('0x1e')](_0xd3b83[_0xceb3('0x34')]['limit']);_0x4ce556['offset']=qs[_0xceb3('0x1c')](_0xd3b83[_0xceb3('0x34')][_0xceb3('0x1c')]);}return _0x767517[_0xceb3('0x4d')](_0x4ce556);}})['then'](function(_0x3f41c6){if(_0x3f41c6){return _0x3f41c6?{'count':_0x417c3f,'rows':_0x3f41c6}:null;}})['then'](respondWithResult(_0x1727aa,null))['catch'](handleError(_0x1727aa,null));};exports[_0xceb3('0x50')]=function(_0x125b55,_0x416264,_0x9b5076){if(_0x125b55['body']['id']){delete _0x125b55[_0xceb3('0x4c')]['id'];}return db[_0xceb3('0x2e')][_0xceb3('0x4e')]({'where':{'id':_0x125b55[_0xceb3('0x49')]['id']}})['then'](handleEntityNotFound(_0x416264,null))['then'](function(_0x2da833){if(_0x2da833){_0x125b55[_0xceb3('0x4c')]['AccountId']=_0x2da833['id'];_0x125b55['body'][_0xceb3('0x51')]=integrations[_0xceb3('0x52')](_0x125b55[_0xceb3('0x4c')][_0xceb3('0x53')],_0x125b55['body'][_0xceb3('0x30')]);_0x125b55[_0xceb3('0x4c')][_0xceb3('0x54')]=integrations[_0xceb3('0x55')](_0x125b55['body'][_0xceb3('0x53')],_0x125b55['body'][_0xceb3('0x30')]);return db[_0xceb3('0x4f')][_0xceb3('0x56')](_0x125b55[_0xceb3('0x4c')],{'include':[{'model':db[_0xceb3('0x57')],'as':_0xceb3('0x51')},{'model':db['DeskField'],'as':_0xceb3('0x54')}]});}return null;})['then'](respondWithResult(_0x416264,null))['catch'](handleError(_0x416264,null));};exports['getFields']=function(_0x3bbda6,_0x33fc03,_0xfe55c7){var _0x4c84fb=[{'name':_0xceb3('0x58'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5b80b1='';return db[_0xceb3('0x2e')][_0xceb3('0x4e')]({'where':{'id':_0x3bbda6[_0xceb3('0x49')]['id']},'attributes':['id','remoteUri','authType',_0xceb3('0x59'),_0xceb3('0x5a'),_0xceb3('0x5b'),_0xceb3('0x5c'),_0xceb3('0x5d'),'tokenSecret']})['then'](handleEntityNotFound(_0x33fc03,null))[_0xceb3('0x26')](function(_0x3c0d66){if(_0x3c0d66){_0x5b80b1=_0x3c0d66[_0xceb3('0x5e')];var _0x43ad0e=_0x5b80b1[_0xceb3('0x5f')](-0x1);if(_0x43ad0e==='/'){_0x5b80b1=_0x5b80b1[_0xceb3('0x60')](0x0,_0x5b80b1['lastIndexOf'](_0x43ad0e));}var _0x3f84f6={'method':_0xceb3('0x61'),'uri':util[_0xceb3('0x62')]('%s/custom_fields',_0x5b80b1),'headers':{'Content-Type':_0xceb3('0x63'),'Accept':_0xceb3('0x63')},'json':!![]};if(_0x3c0d66['authType']===_0xceb3('0x64')){_0x3f84f6[_0xceb3('0x65')][_0xceb3('0x66')]=util[_0xceb3('0x62')]('Basic\x20%s',new Buffer(util[_0xceb3('0x62')]('%s:%s',_0x3c0d66['username'],_0x3c0d66[_0xceb3('0x5a')]))['toString'](_0xceb3('0x67')));}return rp(_0x3f84f6)[_0xceb3('0x26')](function(_0x403e4f){return _0x4c84fb['concat'](_[_0xceb3('0x33')](_0x403e4f['_embedded'][_0xceb3('0x68')],function(_0x133305){return{'id':_0x133305[_0xceb3('0x2b')],'name':_0x133305['name'],'type':_0x133305['type'],'active':_0x133305[_0xceb3('0x69')],'label':_0x133305[_0xceb3('0x6a')],'custom':!![]};}));});}})[_0xceb3('0x26')](function(_0x5c08fe){return{'count':_0x5c08fe['length'],'rows':_0x5c08fe};})[_0xceb3('0x26')](respondWithResult(_0x33fc03,null))[_0xceb3('0x47')](function(_0x94aac2){var _0x593da4=_0x3bbda6[_0xceb3('0x34')][_0xceb3('0x6b')]?0x1f4:_0x94aac2['statusCode']||0x1f4;logger[_0xceb3('0x29')](_0xceb3('0x6c'),'getFields',_0x593da4,JSON[_0xceb3('0x6d')](_0x94aac2));delete _0x94aac2[_0xceb3('0x2b')];if(_0x593da4===0x191){_0x593da4=0x190;}_0x33fc03['status'](_0x593da4)['send'](_0x3bbda6[_0xceb3('0x34')][_0xceb3('0x6b')]?{'message':_0xceb3('0x6e'),'statusCode':_0x94aac2['statusCode']}:_0x94aac2);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 656c72c..f12810a 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 _0xf9c7=['rimraf','../../config/environment','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33d182,_0xdd1b1f){var _0x34697d=function(_0x5c0fae){while(--_0x5c0fae){_0x33d182['push'](_0x33d182['shift']());}};_0x34697d(++_0xdd1b1f);}(_0xf9c7,0x19d));var _0x7f9c=function(_0x37e618,_0xcc41f8){_0x37e618=_0x37e618-0x0;var _0x383afb=_0xf9c7[_0x37e618];return _0x383afb;};'use strict';var _=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var logger=require(_0x7f9c('0x2'))(_0x7f9c('0x3'));var moment=require(_0x7f9c('0x4'));var BPromise=require(_0x7f9c('0x5'));var rp=require(_0x7f9c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7f9c('0x7'));var config=require(_0x7f9c('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x7f9c('0x9'));module[_0x7f9c('0xa')]=function(_0x493de1,_0x403bff){return _0x493de1[_0x7f9c('0xb')](_0x7f9c('0xc'),attributes,{'tableName':_0x7f9c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f7d=['path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x39efbf,_0x118364){var _0xcbd510=function(_0x4e152f){while(--_0x4e152f){_0x39efbf['push'](_0x39efbf['shift']());}};_0xcbd510(++_0x118364);}(_0x0f7d,0xe5));var _0xd0f7=function(_0x46c9cc,_0xd27dca){_0x46c9cc=_0x46c9cc-0x0;var _0x21b46e=_0x0f7d[_0x46c9cc];return _0x21b46e;};'use strict';var _=require(_0xd0f7('0x0'));var util=require('util');var logger=require(_0xd0f7('0x1'))(_0xd0f7('0x2'));var moment=require(_0xd0f7('0x3'));var BPromise=require(_0xd0f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0f7('0x5'));var rimraf=require(_0xd0f7('0x6'));var config=require(_0xd0f7('0x7'));var attributes=require(_0xd0f7('0x8'));var integrations=require(_0xd0f7('0x9'));module[_0xd0f7('0xa')]=function(_0x25fead,_0x4e0060){return _0x25fead[_0xd0f7('0xb')]('DeskAccount',attributes,{'tableName':_0xd0f7('0xc'),'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 bdc9bd5..87e349b 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 _0xb76c=['stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','include','model','map','then','debug','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0xff3357,_0x3b4152){var _0x16d529=function(_0x38d7f7){while(--_0x38d7f7){_0xff3357['push'](_0xff3357['shift']());}};_0x16d529(++_0x3b4152);}(_0xb76c,0x6f));var _0xcb76=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0xb76c[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0xcb76('0x0'));var util=require(_0xcb76('0x1'));var moment=require(_0xcb76('0x2'));var BPromise=require(_0xcb76('0x3'));var rs=require(_0xcb76('0x4'));var fs=require('fs');var Redis=require(_0xcb76('0x5'));var db=require(_0xcb76('0x6'))['db'];var utils=require(_0xcb76('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcb76('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55f7b1,_0x4c268e,_0x358fd1){return new BPromise(function(_0x52d6fc,_0x218a01){return client[_0xcb76('0x9')](_0x55f7b1,_0x358fd1)['then'](function(_0x244eba){logger[_0xcb76('0xa')](_0xcb76('0xb'),_0x4c268e,_0xcb76('0xc'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4c268e,_0xcb76('0xc'),JSON[_0xcb76('0xd')](_0x244eba));if(_0x244eba[_0xcb76('0xe')]){if(_0x244eba[_0xcb76('0xe')][_0xcb76('0xf')]===0x1f4){logger[_0xcb76('0xe')](_0xcb76('0xb'),_0x4c268e,_0x244eba[_0xcb76('0xe')][_0xcb76('0x10')]);return _0x218a01(_0x244eba[_0xcb76('0xe')][_0xcb76('0x10')]);}logger[_0xcb76('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4c268e,_0x244eba['error'][_0xcb76('0x10')]);return _0x52d6fc(_0x244eba[_0xcb76('0xe')]['message']);}else{logger[_0xcb76('0xa')](_0xcb76('0xb'),_0x4c268e,_0xcb76('0xc'));_0x52d6fc(_0x244eba['result'][_0xcb76('0x10')]);}})[_0xcb76('0x11')](function(_0xd67860){logger[_0xcb76('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4c268e,_0xd67860);_0x218a01(_0xd67860);});});}exports[_0xcb76('0x12')]=function(_0x3adf92){var _0x1f3ae3=this;return new Promise(function(_0x54560e,_0x483ecd){return db[_0xcb76('0x13')][_0xcb76('0x14')]({'raw':_0x3adf92[_0xcb76('0x15')]?_0x3adf92[_0xcb76('0x15')][_0xcb76('0x16')]===undefined?!![]:![]:!![],'where':_0x3adf92['options']?_0x3adf92[_0xcb76('0x15')][_0xcb76('0x17')]||null:null,'attributes':_0x3adf92[_0xcb76('0x15')]?_0x3adf92[_0xcb76('0x15')][_0xcb76('0x18')]||null:null,'limit':_0x3adf92[_0xcb76('0x15')]?_0x3adf92['options']['limit']||null:null,'include':_0x3adf92[_0xcb76('0x15')]?_0x3adf92[_0xcb76('0x15')][_0xcb76('0x19')]?_['map'](_0x3adf92[_0xcb76('0x15')]['include'],function(_0x55bfa4){return{'model':db[_0x55bfa4[_0xcb76('0x1a')]],'as':_0x55bfa4['as'],'attributes':_0x55bfa4['attributes'],'include':_0x55bfa4[_0xcb76('0x19')]?_[_0xcb76('0x1b')](_0x55bfa4[_0xcb76('0x19')],function(_0x375616){return{'model':db[_0x375616['model']],'as':_0x375616['as'],'attributes':_0x375616[_0xcb76('0x18')],'include':_0x375616[_0xcb76('0x19')]?_[_0xcb76('0x1b')](_0x375616[_0xcb76('0x19')],function(_0x413ceb){return{'model':db[_0x413ceb[_0xcb76('0x1a')]],'as':_0x413ceb['as'],'attributes':_0x413ceb[_0xcb76('0x18')]};}):[]};}):[]};}):[]:[]})[_0xcb76('0x1c')](function(_0x559bb9){logger[_0xcb76('0xa')]('GetDeskAccount',_0x3adf92);logger[_0xcb76('0x1d')](_0xcb76('0x12'),_0x3adf92,JSON['stringify'](_0x559bb9));_0x54560e(_0x559bb9);})['catch'](function(_0x145825){logger[_0xcb76('0xe')](_0xcb76('0x12'),_0x145825[_0xcb76('0x10')],_0x3adf92);_0x483ecd(_0x1f3ae3[_0xcb76('0xe')](0x1f4,_0x145825[_0xcb76('0x10')]));});});};exports[_0xcb76('0x1e')]=function(_0x5c5a80){var _0x5d65a7=this;return new Promise(function(_0x5a3c77,_0x5147d5){return db[_0xcb76('0x13')]['find']({'raw':_0x5c5a80[_0xcb76('0x15')]?_0x5c5a80[_0xcb76('0x15')][_0xcb76('0x16')]===undefined?!![]:![]:!![],'where':_0x5c5a80['options']?_0x5c5a80['options'][_0xcb76('0x17')]||null:null,'attributes':_0x5c5a80[_0xcb76('0x15')]?_0x5c5a80[_0xcb76('0x15')][_0xcb76('0x18')]||null:null,'include':_0x5c5a80['options']?_0x5c5a80[_0xcb76('0x15')][_0xcb76('0x19')]?_[_0xcb76('0x1b')](_0x5c5a80[_0xcb76('0x15')]['include'],function(_0x553de2){return{'model':db[_0x553de2['model']],'as':_0x553de2['as'],'attributes':_0x553de2[_0xcb76('0x18')],'include':_0x553de2['include']?_[_0xcb76('0x1b')](_0x553de2['include'],function(_0x8fb444){return{'model':db[_0x8fb444['model']],'as':_0x8fb444['as'],'attributes':_0x8fb444[_0xcb76('0x18')],'include':_0x8fb444[_0xcb76('0x19')]?_[_0xcb76('0x1b')](_0x8fb444[_0xcb76('0x19')],function(_0xb6128d){return{'model':db[_0xb6128d[_0xcb76('0x1a')]],'as':_0xb6128d['as'],'attributes':_0xb6128d[_0xcb76('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x109b17){logger[_0xcb76('0xa')]('ShowDeskAccount',_0x5c5a80);logger[_0xcb76('0x1d')]('ShowDeskAccount',_0x5c5a80,JSON[_0xcb76('0xd')](_0x109b17));_0x5a3c77(_0x109b17);})['catch'](function(_0x478c62){logger['error'](_0xcb76('0x1e'),_0x478c62[_0xcb76('0x10')],_0x5c5a80);_0x5147d5(_0x5d65a7[_0xcb76('0xe')](0x1f4,_0x478c62[_0xcb76('0x10')]));});});}; \ No newline at end of file +var _0xdb87=['include','model','attributes','debug','GetDeskAccount','ShowDeskAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskAccount','findAll','options','where','map'];(function(_0x41f2f5,_0x14f33c){var _0x3d49f1=function(_0x300207){while(--_0x300207){_0x41f2f5['push'](_0x41f2f5['shift']());}};_0x3d49f1(++_0x14f33c);}(_0xdb87,0x94));var _0x7db8=function(_0xd41791,_0x2d9196){_0xd41791=_0xd41791-0x0;var _0x5e2759=_0xdb87[_0xd41791];return _0x5e2759;};'use strict';var _=require(_0x7db8('0x0'));var util=require(_0x7db8('0x1'));var moment=require(_0x7db8('0x2'));var BPromise=require('bluebird');var rs=require(_0x7db8('0x3'));var fs=require('fs');var Redis=require(_0x7db8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7db8('0x5'));var logger=require(_0x7db8('0x6'))('rpc');var config=require(_0x7db8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7db8('0x8')][_0x7db8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x411f9f,_0x574f04,_0x3794ba){return new BPromise(function(_0x40aaef,_0x2d4c51){return client[_0x7db8('0xa')](_0x411f9f,_0x3794ba)[_0x7db8('0xb')](function(_0x386920){logger[_0x7db8('0xc')](_0x7db8('0xd'),_0x574f04,_0x7db8('0xe'));logger['debug'](_0x7db8('0xf'),_0x574f04,_0x7db8('0xe'),JSON[_0x7db8('0x10')](_0x386920));if(_0x386920[_0x7db8('0x11')]){if(_0x386920[_0x7db8('0x11')][_0x7db8('0x12')]===0x1f4){logger['error'](_0x7db8('0xd'),_0x574f04,_0x386920[_0x7db8('0x11')][_0x7db8('0x13')]);return _0x2d4c51(_0x386920['error'][_0x7db8('0x13')]);}logger['error'](_0x7db8('0xd'),_0x574f04,_0x386920[_0x7db8('0x11')][_0x7db8('0x13')]);return _0x40aaef(_0x386920[_0x7db8('0x11')]['message']);}else{logger[_0x7db8('0xc')](_0x7db8('0xd'),_0x574f04,_0x7db8('0xe'));_0x40aaef(_0x386920[_0x7db8('0x14')]['message']);}})[_0x7db8('0x15')](function(_0xe46516){logger[_0x7db8('0x11')](_0x7db8('0xd'),_0x574f04,_0xe46516);_0x2d4c51(_0xe46516);});});}exports['GetDeskAccount']=function(_0x54eeca){var _0x3995c3=this;return new Promise(function(_0x1b364f,_0x487a24){return db[_0x7db8('0x16')][_0x7db8('0x17')]({'raw':_0x54eeca['options']?_0x54eeca['options']['raw']===undefined?!![]:![]:!![],'where':_0x54eeca[_0x7db8('0x18')]?_0x54eeca[_0x7db8('0x18')][_0x7db8('0x19')]||null:null,'attributes':_0x54eeca[_0x7db8('0x18')]?_0x54eeca[_0x7db8('0x18')]['attributes']||null:null,'limit':_0x54eeca[_0x7db8('0x18')]?_0x54eeca[_0x7db8('0x18')]['limit']||null:null,'include':_0x54eeca[_0x7db8('0x18')]?_0x54eeca[_0x7db8('0x18')]['include']?_[_0x7db8('0x1a')](_0x54eeca[_0x7db8('0x18')]['include'],function(_0x1f057c){return{'model':db[_0x1f057c['model']],'as':_0x1f057c['as'],'attributes':_0x1f057c['attributes'],'include':_0x1f057c['include']?_['map'](_0x1f057c[_0x7db8('0x1b')],function(_0x5c69dd){return{'model':db[_0x5c69dd[_0x7db8('0x1c')]],'as':_0x5c69dd['as'],'attributes':_0x5c69dd[_0x7db8('0x1d')],'include':_0x5c69dd[_0x7db8('0x1b')]?_[_0x7db8('0x1a')](_0x5c69dd[_0x7db8('0x1b')],function(_0x55ecde){return{'model':db[_0x55ecde['model']],'as':_0x55ecde['as'],'attributes':_0x55ecde[_0x7db8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d8926){logger[_0x7db8('0xc')]('GetDeskAccount',_0x54eeca);logger[_0x7db8('0x1e')](_0x7db8('0x1f'),_0x54eeca,JSON[_0x7db8('0x10')](_0x2d8926));_0x1b364f(_0x2d8926);})[_0x7db8('0x15')](function(_0xb06dd5){logger[_0x7db8('0x11')]('GetDeskAccount',_0xb06dd5[_0x7db8('0x13')],_0x54eeca);_0x487a24(_0x3995c3[_0x7db8('0x11')](0x1f4,_0xb06dd5[_0x7db8('0x13')]));});});};exports[_0x7db8('0x20')]=function(_0x4f66aa){var _0x7b74d=this;return new Promise(function(_0x5c1f69,_0x58e7c7){return db['DeskAccount'][_0x7db8('0x21')]({'raw':_0x4f66aa['options']?_0x4f66aa[_0x7db8('0x18')][_0x7db8('0x22')]===undefined?!![]:![]:!![],'where':_0x4f66aa[_0x7db8('0x18')]?_0x4f66aa[_0x7db8('0x18')][_0x7db8('0x19')]||null:null,'attributes':_0x4f66aa[_0x7db8('0x18')]?_0x4f66aa['options'][_0x7db8('0x1d')]||null:null,'include':_0x4f66aa[_0x7db8('0x18')]?_0x4f66aa[_0x7db8('0x18')]['include']?_[_0x7db8('0x1a')](_0x4f66aa[_0x7db8('0x18')][_0x7db8('0x1b')],function(_0x4f52f6){return{'model':db[_0x4f52f6['model']],'as':_0x4f52f6['as'],'attributes':_0x4f52f6[_0x7db8('0x1d')],'include':_0x4f52f6[_0x7db8('0x1b')]?_[_0x7db8('0x1a')](_0x4f52f6[_0x7db8('0x1b')],function(_0x3eb9ce){return{'model':db[_0x3eb9ce['model']],'as':_0x3eb9ce['as'],'attributes':_0x3eb9ce[_0x7db8('0x1d')],'include':_0x3eb9ce[_0x7db8('0x1b')]?_['map'](_0x3eb9ce['include'],function(_0xbb1ffc){return{'model':db[_0xbb1ffc[_0x7db8('0x1c')]],'as':_0xbb1ffc['as'],'attributes':_0xbb1ffc[_0x7db8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x911343){logger[_0x7db8('0xc')](_0x7db8('0x20'),_0x4f66aa);logger[_0x7db8('0x1e')](_0x7db8('0x20'),_0x4f66aa,JSON[_0x7db8('0x10')](_0x911343));_0x5c1f69(_0x911343);})[_0x7db8('0x15')](function(_0x22d064){logger[_0x7db8('0x11')](_0x7db8('0x20'),_0x22d064['message'],_0x4f66aa);_0x58e7c7(_0x7b74d[_0x7db8('0x11')](0x1f4,_0x22d064[_0x7db8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index bd08e16..6e2e11a 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x770d5c,_0x1eb38){var _0x4b7456=function(_0x32f66e){while(--_0x32f66e){_0x770d5c['push'](_0x770d5c['shift']());}};_0x4b7456(++_0x1eb38);}(_0x008c,0x188));var _0xc008=function(_0x242c29,_0x168f0a){_0x242c29=_0x242c29-0x0;var _0x3f4d1c=_0x008c[_0x242c29];return _0x3f4d1c;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x459a84,_0x163644){var _0x2a2c3c=function(_0x56ca6d){while(--_0x56ca6d){_0x459a84['push'](_0x459a84['shift']());}};_0x2a2c3c(++_0x163644);}(_0x34e8,0x12c));var _0x834e=function(_0x170359,_0x2b8254){_0x170359=_0x170359-0x0;var _0x4392b2=_0x34e8[_0x170359];return _0x4392b2;};'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('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 0441180..29a63a7 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 _0xce5e=['STRING','exports'];(function(_0x441ec4,_0x26dfd4){var _0xa6e100=function(_0x1a387c){while(--_0x1a387c){_0x441ec4['push'](_0x441ec4['shift']());}};_0xa6e100(++_0x26dfd4);}(_0xce5e,0x69));var _0xece5=function(_0x4d95fc,_0x2a2985){_0x4d95fc=_0x4d95fc-0x0;var _0x437299=_0xce5e[_0x4d95fc];return _0x437299;};'use strict';var Sequelize=require('sequelize');module[_0xece5('0x0')]={'name':{'type':Sequelize[_0xece5('0x1')]},'description':{'type':Sequelize[_0xece5('0x1')]}}; \ No newline at end of file +var _0x64e5=['exports','sequelize'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0x64e5,0x1af));var _0x564e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x64e5[_0x5c351c];return _0x26f3b3;};'use strict';var Sequelize=require(_0x564e('0x0'));module[_0x564e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 4095925..8e92b02 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 _0xd62e=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','DeskConfiguration','include','findAll','rows','show','params','fields','includeAll','find','catch','create','body','destroy','getFields','findOne','DeskField','keys','hasOwnProperty','getSubjects','getTags','Tag','setTags','eml-format','rimraf','zip-dir'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xd62e,0xa9));var _0xed62=function(_0x4c4b3c,_0x1a0400){_0x4c4b3c=_0x4c4b3c-0x0;var _0x7ec6d9=_0xd62e[_0x4c4b3c];return _0x7ec6d9;};'use strict';var emlformat=require(_0xed62('0x0'));var rimraf=require(_0xed62('0x1'));var zipdir=require(_0xed62('0x2'));var jsonpatch=require(_0xed62('0x3'));var rp=require(_0xed62('0x4'));var moment=require(_0xed62('0x5'));var BPromise=require(_0xed62('0x6'));var Mustache=require(_0xed62('0x7'));var util=require(_0xed62('0x8'));var path=require(_0xed62('0x9'));var sox=require('sox');var csv=require(_0xed62('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed62('0xb'));var _=require(_0xed62('0xc'));var squel=require(_0xed62('0xd'));var crypto=require(_0xed62('0xe'));var jsforce=require(_0xed62('0xf'));var deskjs=require(_0xed62('0x10'));var toCsv=require(_0xed62('0xa'));var querystring=require(_0xed62('0x11'));var Papa=require(_0xed62('0x12'));var Redis=require(_0xed62('0x13'));var authService=require(_0xed62('0x14'));var qs=require(_0xed62('0x15'));var as=require(_0xed62('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xed62('0x17'));var config=require(_0xed62('0x18'));var licenseUtil=require(_0xed62('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b62e1,_0x450a4f){_0x450a4f=_0x450a4f||0xcc;return function(_0x3e0bdb){if(_0x3e0bdb){return _0x4b62e1[_0xed62('0x1a')](_0x450a4f);}return _0x4b62e1[_0xed62('0x1b')](_0x450a4f)[_0xed62('0x1c')]();};}function respondWithResult(_0x3e7856,_0x3d9dfc){_0x3d9dfc=_0x3d9dfc||0xc8;return function(_0xc33931){if(_0xc33931){return _0x3e7856[_0xed62('0x1b')](_0x3d9dfc)[_0xed62('0x1d')](_0xc33931);}};}function respondWithFilteredResult(_0x1b4950,_0x18146c){return function(_0x3be5d9){if(_0x3be5d9){var _0xf5446e=typeof _0x18146c[_0xed62('0x1e')]===_0xed62('0x1f')&&typeof _0x18146c[_0xed62('0x20')]===_0xed62('0x1f');var _0x41719d=_0x3be5d9[_0xed62('0x21')];var _0x4f67e9=_0xf5446e?0x0:_0x18146c[_0xed62('0x1e')];var _0x4c5eec=_0xf5446e?_0x3be5d9['count']:_0x18146c[_0xed62('0x1e')]+_0x18146c[_0xed62('0x20')];var _0x2cee7c;if(_0x4c5eec>=_0x41719d){_0x4c5eec=_0x41719d;_0x2cee7c=0xc8;}else{_0x2cee7c=0xce;}_0x1b4950[_0xed62('0x1b')](_0x2cee7c);return _0x1b4950[_0xed62('0x22')](_0xed62('0x23'),_0x4f67e9+'-'+_0x4c5eec+'/'+_0x41719d)[_0xed62('0x1d')](_0x3be5d9);}return null;};}function patchUpdates(_0xa1ed5){return function(_0x22df17){try{jsonpatch[_0xed62('0x24')](_0x22df17,_0xa1ed5,!![]);}catch(_0x3e72a9){return BPromise['reject'](_0x3e72a9);}return _0x22df17[_0xed62('0x25')]();};}function saveUpdates(_0x561286,_0x4cea36){return function(_0x5bd825){if(_0x5bd825){return _0x5bd825[_0xed62('0x26')](_0x561286)['then'](function(_0x5df04a){return _0x5df04a;});}return null;};}function removeEntity(_0x2e8468,_0x5edf3e){return function(_0xaf0136){if(_0xaf0136){return _0xaf0136['destroy']()[_0xed62('0x27')](function(){_0x2e8468[_0xed62('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc954,_0x127b75){return function(_0x417d3e){if(!_0x417d3e){_0x3cc954['sendStatus'](0x194);}return _0x417d3e;};}function handleError(_0x4b297e,_0x25882d){_0x25882d=_0x25882d||0x1f4;return function(_0x3eae37){logger[_0xed62('0x28')](_0x3eae37[_0xed62('0x29')]);if(_0x3eae37['name']){delete _0x3eae37[_0xed62('0x2a')];}_0x4b297e[_0xed62('0x1b')](_0x25882d)['send'](_0x3eae37);};}exports[_0xed62('0x2b')]=function(_0x508bdb,_0xf4a571){var _0x1d5186={},_0x571a9e={},_0x1548b0={'count':0x0,'rows':[]};var _0xc1400=_[_0xed62('0x2c')](db['DeskConfiguration'][_0xed62('0x2d')],function(_0x4a1a34){return{'name':_0x4a1a34[_0xed62('0x2e')],'type':_0x4a1a34['type'][_0xed62('0x2f')]};});_0x571a9e[_0xed62('0x30')]=_['map'](_0xc1400,'name');_0x571a9e[_0xed62('0x31')]=_['keys'](_0x508bdb['query']);_0x571a9e[_0xed62('0x32')]=_[_0xed62('0x33')](_0x571a9e['model'],_0x571a9e['query']);_0x1d5186[_0xed62('0x34')]=_[_0xed62('0x33')](_0x571a9e[_0xed62('0x30')],qs['fields'](_0x508bdb['query']['fields']));_0x1d5186[_0xed62('0x34')]=_0x1d5186[_0xed62('0x34')][_0xed62('0x35')]?_0x1d5186[_0xed62('0x34')]:_0x571a9e[_0xed62('0x30')];if(!_0x508bdb[_0xed62('0x31')]['hasOwnProperty'](_0xed62('0x36'))){_0x1d5186[_0xed62('0x20')]=qs[_0xed62('0x20')](_0x508bdb[_0xed62('0x31')][_0xed62('0x20')]);_0x1d5186[_0xed62('0x1e')]=qs[_0xed62('0x1e')](_0x508bdb[_0xed62('0x31')][_0xed62('0x1e')]);}_0x1d5186[_0xed62('0x37')]=qs[_0xed62('0x38')](_0x508bdb[_0xed62('0x31')][_0xed62('0x38')]);_0x1d5186['where']=qs[_0xed62('0x32')](_[_0xed62('0x39')](_0x508bdb[_0xed62('0x31')],_0x571a9e['filters']),_0xc1400);if(_0x508bdb[_0xed62('0x31')]['filter']){_0x1d5186[_0xed62('0x3a')]=_[_0xed62('0x3b')](_0x1d5186[_0xed62('0x3a')],{'$or':_[_0xed62('0x2c')](_0xc1400,function(_0x3d8682){if(_0x3d8682[_0xed62('0x3c')]!==_0xed62('0x3d')){var _0x2faf4b={};_0x2faf4b[_0x3d8682[_0xed62('0x2a')]]={'$like':'%'+_0x508bdb[_0xed62('0x31')][_0xed62('0x3e')]+'%'};return _0x2faf4b;}})});}_0x1d5186=_['merge']({},_0x1d5186,_0x508bdb[_0xed62('0x3f')]);var _0x4ce458={'where':_0x1d5186[_0xed62('0x3a')]};return db[_0xed62('0x40')][_0xed62('0x21')](_0x4ce458)[_0xed62('0x27')](function(_0x519f44){_0x1548b0[_0xed62('0x21')]=_0x519f44;if(_0x508bdb[_0xed62('0x31')]['includeAll']){_0x1d5186[_0xed62('0x41')]=[{'all':!![]}];}return db[_0xed62('0x40')][_0xed62('0x42')](_0x1d5186);})[_0xed62('0x27')](function(_0x2443b4){_0x1548b0[_0xed62('0x43')]=_0x2443b4;return _0x1548b0;})[_0xed62('0x27')](respondWithFilteredResult(_0xf4a571,_0x1d5186))['catch'](handleError(_0xf4a571,null));};exports[_0xed62('0x44')]=function(_0x475cbd,_0x5293a8){var _0x154179={'raw':![],'where':{'id':_0x475cbd[_0xed62('0x45')]['id']}},_0x156124={};_0x156124[_0xed62('0x30')]=_['keys'](db[_0xed62('0x40')][_0xed62('0x2d')]);_0x156124['query']=_['keys'](_0x475cbd[_0xed62('0x31')]);_0x156124[_0xed62('0x32')]=_['intersection'](_0x156124[_0xed62('0x30')],_0x156124[_0xed62('0x31')]);_0x154179[_0xed62('0x34')]=_['intersection'](_0x156124[_0xed62('0x30')],qs[_0xed62('0x46')](_0x475cbd['query'][_0xed62('0x46')]));_0x154179[_0xed62('0x34')]=_0x154179[_0xed62('0x34')][_0xed62('0x35')]?_0x154179['attributes']:_0x156124[_0xed62('0x30')];if(_0x475cbd[_0xed62('0x31')][_0xed62('0x47')]){_0x154179['include']=[{'all':!![]}];}_0x154179=_[_0xed62('0x3b')]({},_0x154179,_0x475cbd[_0xed62('0x3f')]);return db['DeskConfiguration'][_0xed62('0x48')](_0x154179)[_0xed62('0x27')](handleEntityNotFound(_0x5293a8,null))[_0xed62('0x27')](respondWithResult(_0x5293a8,null))[_0xed62('0x49')](handleError(_0x5293a8,null));};exports['create']=function(_0x587379,_0x4c121e){return db[_0xed62('0x40')][_0xed62('0x4a')](_0x587379[_0xed62('0x4b')],{})[_0xed62('0x27')](respondWithResult(_0x4c121e,0xc9))['catch'](handleError(_0x4c121e,null));};exports[_0xed62('0x26')]=function(_0x398422,_0x3ee7c4){if(_0x398422[_0xed62('0x4b')]['id']){delete _0x398422[_0xed62('0x4b')]['id'];}return db[_0xed62('0x40')]['find']({'where':{'id':_0x398422['params']['id']}})['then'](handleEntityNotFound(_0x3ee7c4,null))['then'](saveUpdates(_0x398422[_0xed62('0x4b')],null))[_0xed62('0x27')](respondWithResult(_0x3ee7c4,null))['catch'](handleError(_0x3ee7c4,null));};exports[_0xed62('0x4c')]=function(_0x2bac47,_0x5026d5){return db[_0xed62('0x40')][_0xed62('0x48')]({'where':{'id':_0x2bac47[_0xed62('0x45')]['id']}})[_0xed62('0x27')](handleEntityNotFound(_0x5026d5,null))['then'](removeEntity(_0x5026d5,null))[_0xed62('0x49')](handleError(_0x5026d5,null));};exports[_0xed62('0x4d')]=function(_0x583a9f,_0x16f190,_0x1ef9ed){var _0x45318f={};var _0x4b5506={};var _0x2a59e8;var _0x216936;return db['DeskConfiguration'][_0xed62('0x4e')]({'where':{'id':_0x583a9f[_0xed62('0x45')]['id']}})[_0xed62('0x27')](handleEntityNotFound(_0x16f190,null))[_0xed62('0x27')](function(_0x34617a){if(_0x34617a){_0x2a59e8=_0x34617a;_0x4b5506[_0xed62('0x30')]=_['keys'](db[_0xed62('0x4f')][_0xed62('0x2d')]);_0x4b5506[_0xed62('0x31')]=_[_0xed62('0x50')](_0x583a9f[_0xed62('0x31')]);_0x4b5506[_0xed62('0x32')]=_[_0xed62('0x33')](_0x4b5506[_0xed62('0x30')],_0x4b5506[_0xed62('0x31')]);_0x45318f['attributes']=_['intersection'](_0x4b5506['model'],qs[_0xed62('0x46')](_0x583a9f[_0xed62('0x31')][_0xed62('0x46')]));_0x45318f['attributes']=_0x45318f['attributes'][_0xed62('0x35')]?_0x45318f['attributes']:_0x4b5506[_0xed62('0x30')];_0x45318f[_0xed62('0x37')]=qs[_0xed62('0x38')](_0x583a9f[_0xed62('0x31')][_0xed62('0x38')]);_0x45318f[_0xed62('0x3a')]=qs[_0xed62('0x32')](_['pick'](_0x583a9f[_0xed62('0x31')],_0x4b5506['filters']));if(_0x583a9f[_0xed62('0x31')][_0xed62('0x3e')]){_0x45318f[_0xed62('0x3a')]=_['merge'](_0x45318f[_0xed62('0x3a')],{'$or':_['map'](_0x45318f[_0xed62('0x34')],function(_0x52b470){var _0x68fab8={};_0x68fab8[_0x52b470]={'$like':'%'+_0x583a9f[_0xed62('0x31')]['filter']+'%'};return _0x68fab8;})});}_0x45318f=_[_0xed62('0x3b')]({},_0x45318f,_0x583a9f['options']);return _0x2a59e8[_0xed62('0x4d')](_0x45318f);}})[_0xed62('0x27')](function(_0x3f70ce){if(_0x3f70ce){_0x216936=_0x3f70ce[_0xed62('0x35')];if(!_0x583a9f[_0xed62('0x31')][_0xed62('0x51')](_0xed62('0x36'))){_0x45318f[_0xed62('0x20')]=qs[_0xed62('0x20')](_0x583a9f['query'][_0xed62('0x20')]);_0x45318f[_0xed62('0x1e')]=qs[_0xed62('0x1e')](_0x583a9f[_0xed62('0x31')][_0xed62('0x1e')]);}return _0x2a59e8[_0xed62('0x4d')](_0x45318f);}})['then'](function(_0x5884e7){if(_0x5884e7){return _0x5884e7?{'count':_0x216936,'rows':_0x5884e7}:null;}})['then'](respondWithResult(_0x16f190,null))['catch'](handleError(_0x16f190,null));};exports[_0xed62('0x52')]=function(_0x1912eb,_0x4b9e01,_0x2d38bf){var _0xb59249={};var _0x9178ae={};var _0x327a46;var _0x8fea17;return db[_0xed62('0x40')]['findOne']({'where':{'id':_0x1912eb[_0xed62('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b9e01,null))[_0xed62('0x27')](function(_0x193a44){if(_0x193a44){_0x327a46=_0x193a44;_0x9178ae[_0xed62('0x30')]=_[_0xed62('0x50')](db[_0xed62('0x4f')]['rawAttributes']);_0x9178ae[_0xed62('0x31')]=_[_0xed62('0x50')](_0x1912eb[_0xed62('0x31')]);_0x9178ae[_0xed62('0x32')]=_[_0xed62('0x33')](_0x9178ae[_0xed62('0x30')],_0x9178ae[_0xed62('0x31')]);_0xb59249['attributes']=_['intersection'](_0x9178ae['model'],qs['fields'](_0x1912eb[_0xed62('0x31')][_0xed62('0x46')]));_0xb59249[_0xed62('0x34')]=_0xb59249['attributes'][_0xed62('0x35')]?_0xb59249[_0xed62('0x34')]:_0x9178ae[_0xed62('0x30')];_0xb59249[_0xed62('0x37')]=qs['sort'](_0x1912eb[_0xed62('0x31')][_0xed62('0x38')]);_0xb59249[_0xed62('0x3a')]=qs[_0xed62('0x32')](_['pick'](_0x1912eb[_0xed62('0x31')],_0x9178ae[_0xed62('0x32')]));if(_0x1912eb[_0xed62('0x31')][_0xed62('0x3e')]){_0xb59249[_0xed62('0x3a')]=_['merge'](_0xb59249[_0xed62('0x3a')],{'$or':_['map'](_0xb59249[_0xed62('0x34')],function(_0x78f9c8){var _0x103971={};_0x103971[_0x78f9c8]={'$like':'%'+_0x1912eb['query'][_0xed62('0x3e')]+'%'};return _0x103971;})});}_0xb59249=_[_0xed62('0x3b')]({},_0xb59249,_0x1912eb[_0xed62('0x3f')]);return _0x327a46[_0xed62('0x52')](_0xb59249);}})[_0xed62('0x27')](function(_0x237f4c){if(_0x237f4c){_0x8fea17=_0x237f4c[_0xed62('0x35')];if(!_0x1912eb[_0xed62('0x31')][_0xed62('0x51')](_0xed62('0x36'))){_0xb59249['limit']=qs[_0xed62('0x20')](_0x1912eb['query'][_0xed62('0x20')]);_0xb59249[_0xed62('0x1e')]=qs[_0xed62('0x1e')](_0x1912eb[_0xed62('0x31')]['offset']);}return _0x327a46['getSubjects'](_0xb59249);}})['then'](function(_0xc93768){if(_0xc93768){return _0xc93768?{'count':_0x8fea17,'rows':_0xc93768}:null;}})[_0xed62('0x27')](respondWithResult(_0x4b9e01,null))['catch'](handleError(_0x4b9e01,null));};exports['getDescriptions']=function(_0xdcf28a,_0x4c288a,_0x13999a){var _0x580b15={};var _0x1b2f98={};var _0x3d839e;var _0x2de04a;return db[_0xed62('0x40')][_0xed62('0x4e')]({'where':{'id':_0xdcf28a[_0xed62('0x45')]['id']}})['then'](handleEntityNotFound(_0x4c288a,null))[_0xed62('0x27')](function(_0x1c62d0){if(_0x1c62d0){_0x3d839e=_0x1c62d0;_0x1b2f98[_0xed62('0x30')]=_[_0xed62('0x50')](db[_0xed62('0x4f')][_0xed62('0x2d')]);_0x1b2f98[_0xed62('0x31')]=_[_0xed62('0x50')](_0xdcf28a[_0xed62('0x31')]);_0x1b2f98['filters']=_['intersection'](_0x1b2f98[_0xed62('0x30')],_0x1b2f98[_0xed62('0x31')]);_0x580b15['attributes']=_['intersection'](_0x1b2f98['model'],qs[_0xed62('0x46')](_0xdcf28a[_0xed62('0x31')][_0xed62('0x46')]));_0x580b15[_0xed62('0x34')]=_0x580b15['attributes'][_0xed62('0x35')]?_0x580b15['attributes']:_0x1b2f98[_0xed62('0x30')];_0x580b15[_0xed62('0x37')]=qs[_0xed62('0x38')](_0xdcf28a[_0xed62('0x31')]['sort']);_0x580b15[_0xed62('0x3a')]=qs[_0xed62('0x32')](_[_0xed62('0x39')](_0xdcf28a['query'],_0x1b2f98[_0xed62('0x32')]));if(_0xdcf28a[_0xed62('0x31')][_0xed62('0x3e')]){_0x580b15['where']=_[_0xed62('0x3b')](_0x580b15['where'],{'$or':_[_0xed62('0x2c')](_0x580b15[_0xed62('0x34')],function(_0x202d14){var _0x2c2cf2={};_0x2c2cf2[_0x202d14]={'$like':'%'+_0xdcf28a[_0xed62('0x31')][_0xed62('0x3e')]+'%'};return _0x2c2cf2;})});}_0x580b15=_[_0xed62('0x3b')]({},_0x580b15,_0xdcf28a[_0xed62('0x3f')]);return _0x3d839e['getDescriptions'](_0x580b15);}})[_0xed62('0x27')](function(_0x5be831){if(_0x5be831){_0x2de04a=_0x5be831['length'];if(!_0xdcf28a[_0xed62('0x31')][_0xed62('0x51')](_0xed62('0x36'))){_0x580b15[_0xed62('0x20')]=qs[_0xed62('0x20')](_0xdcf28a[_0xed62('0x31')]['limit']);_0x580b15['offset']=qs[_0xed62('0x1e')](_0xdcf28a['query'][_0xed62('0x1e')]);}return _0x3d839e['getDescriptions'](_0x580b15);}})['then'](function(_0x2df409){if(_0x2df409){return _0x2df409?{'count':_0x2de04a,'rows':_0x2df409}:null;}})['then'](respondWithResult(_0x4c288a,null))['catch'](handleError(_0x4c288a,null));};exports[_0xed62('0x53')]=function(_0x108830,_0x30fc9e,_0x330bc1){var _0x3524f3={};var _0x5d83ef={};var _0x1a8f97;var _0x130e2c;return db[_0xed62('0x40')][_0xed62('0x4e')]({'where':{'id':_0x108830[_0xed62('0x45')]['id']}})[_0xed62('0x27')](handleEntityNotFound(_0x30fc9e,null))[_0xed62('0x27')](function(_0x1caef3){if(_0x1caef3){_0x1a8f97=_0x1caef3;_0x5d83ef['model']=_[_0xed62('0x50')](db[_0xed62('0x54')][_0xed62('0x2d')]);_0x5d83ef['query']=_[_0xed62('0x50')](_0x108830[_0xed62('0x31')]);_0x5d83ef[_0xed62('0x32')]=_[_0xed62('0x33')](_0x5d83ef['model'],_0x5d83ef['query']);_0x3524f3[_0xed62('0x34')]=_[_0xed62('0x33')](_0x5d83ef['model'],qs['fields'](_0x108830['query'][_0xed62('0x46')]));_0x3524f3[_0xed62('0x34')]=_0x3524f3['attributes'][_0xed62('0x35')]?_0x3524f3['attributes']:_0x5d83ef[_0xed62('0x30')];_0x3524f3['order']=qs[_0xed62('0x38')](_0x108830[_0xed62('0x31')][_0xed62('0x38')]);_0x3524f3[_0xed62('0x3a')]=qs[_0xed62('0x32')](_[_0xed62('0x39')](_0x108830[_0xed62('0x31')],_0x5d83ef[_0xed62('0x32')]));if(_0x108830[_0xed62('0x31')][_0xed62('0x3e')]){_0x3524f3[_0xed62('0x3a')]=_[_0xed62('0x3b')](_0x3524f3[_0xed62('0x3a')],{'$or':_[_0xed62('0x2c')](_0x3524f3[_0xed62('0x34')],function(_0x479645){var _0x14f308={};_0x14f308[_0x479645]={'$like':'%'+_0x108830[_0xed62('0x31')][_0xed62('0x3e')]+'%'};return _0x14f308;})});}_0x3524f3=_[_0xed62('0x3b')]({},_0x3524f3,_0x108830['options']);return _0x1a8f97['getTags'](_0x3524f3);}})[_0xed62('0x27')](function(_0x2e6666){if(_0x2e6666){_0x130e2c=_0x2e6666[_0xed62('0x35')];if(!_0x108830[_0xed62('0x31')][_0xed62('0x51')](_0xed62('0x36'))){_0x3524f3[_0xed62('0x20')]=qs[_0xed62('0x20')](_0x108830[_0xed62('0x31')]['limit']);_0x3524f3[_0xed62('0x1e')]=qs[_0xed62('0x1e')](_0x108830['query']['offset']);}return _0x1a8f97[_0xed62('0x53')](_0x3524f3);}})['then'](function(_0x76a3d5){if(_0x76a3d5){return _0x76a3d5?{'count':_0x130e2c,'rows':_0x76a3d5}:null;}})[_0xed62('0x27')](respondWithResult(_0x30fc9e,null))[_0xed62('0x49')](handleError(_0x30fc9e,null));};exports[_0xed62('0x55')]=function(_0x386aab,_0x131822,_0x1a0772){if(_0x386aab[_0xed62('0x4b')]['id']){delete _0x386aab[_0xed62('0x4b')]['id'];}return db[_0xed62('0x40')][_0xed62('0x4e')]({'where':{'id':_0x386aab[_0xed62('0x45')]['id']}})[_0xed62('0x27')](handleEntityNotFound(_0x131822,null))[_0xed62('0x27')](function(_0x8278fc){if(_0x8278fc){return _0x8278fc[_0xed62('0x55')](_0x386aab['body']['ids']||[]);}return null;})[_0xed62('0x27')](respondWithResult(_0x131822,null))['catch'](handleError(_0x131822,null));}; \ No newline at end of file +var _0x97e8=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','catch','show','params','filters','body','find','findOne','filter','getFields','nolimit','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x3e8b04,_0x33d4eb){var _0x3b7b9c=function(_0x2da49f){while(--_0x2da49f){_0x3e8b04['push'](_0x3e8b04['shift']());}};_0x3b7b9c(++_0x33d4eb);}(_0x97e8,0xa3));var _0x897e=function(_0x547bbc,_0x1430b5){_0x547bbc=_0x547bbc-0x0;var _0xcc7127=_0x97e8[_0x547bbc];return _0xcc7127;};'use strict';var emlformat=require(_0x897e('0x0'));var rimraf=require(_0x897e('0x1'));var zipdir=require(_0x897e('0x2'));var jsonpatch=require(_0x897e('0x3'));var rp=require(_0x897e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x897e('0x5'));var util=require(_0x897e('0x6'));var path=require(_0x897e('0x7'));var sox=require(_0x897e('0x8'));var csv=require(_0x897e('0x9'));var ejs=require(_0x897e('0xa'));var fs=require('fs');var fs_extra=require(_0x897e('0xb'));var _=require(_0x897e('0xc'));var squel=require(_0x897e('0xd'));var crypto=require(_0x897e('0xe'));var jsforce=require(_0x897e('0xf'));var deskjs=require(_0x897e('0x10'));var toCsv=require('to-csv');var querystring=require(_0x897e('0x11'));var Papa=require('papaparse');var Redis=require(_0x897e('0x12'));var authService=require(_0x897e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x897e('0x14'));var hardwareService=require(_0x897e('0x15'));var logger=require(_0x897e('0x16'))('api');var utils=require(_0x897e('0x17'));var config=require(_0x897e('0x18'));var licenseUtil=require(_0x897e('0x19'));var db=require(_0x897e('0x1a'))['db'];function respondWithStatusCode(_0x2db279,_0x443f36){_0x443f36=_0x443f36||0xcc;return function(_0x4c240a){if(_0x4c240a){return _0x2db279[_0x897e('0x1b')](_0x443f36);}return _0x2db279[_0x897e('0x1c')](_0x443f36)[_0x897e('0x1d')]();};}function respondWithResult(_0x22917b,_0x587b8b){_0x587b8b=_0x587b8b||0xc8;return function(_0x25f514){if(_0x25f514){return _0x22917b['status'](_0x587b8b)['json'](_0x25f514);}};}function respondWithFilteredResult(_0x4978f0,_0x1fafa3){return function(_0x4650a0){if(_0x4650a0){var _0x4498c9=typeof _0x1fafa3[_0x897e('0x1e')]===_0x897e('0x1f')&&typeof _0x1fafa3[_0x897e('0x20')]===_0x897e('0x1f');var _0x1abaf4=_0x4650a0[_0x897e('0x21')];var _0x4a42c5=_0x4498c9?0x0:_0x1fafa3[_0x897e('0x1e')];var _0x5792b6=_0x4498c9?_0x4650a0[_0x897e('0x21')]:_0x1fafa3['offset']+_0x1fafa3[_0x897e('0x20')];var _0x4f4fc5;if(_0x5792b6>=_0x1abaf4){_0x5792b6=_0x1abaf4;_0x4f4fc5=0xc8;}else{_0x4f4fc5=0xce;}_0x4978f0[_0x897e('0x1c')](_0x4f4fc5);return _0x4978f0[_0x897e('0x22')](_0x897e('0x23'),_0x4a42c5+'-'+_0x5792b6+'/'+_0x1abaf4)['json'](_0x4650a0);}return null;};}function patchUpdates(_0x2a080d){return function(_0x51a54a){try{jsonpatch['apply'](_0x51a54a,_0x2a080d,!![]);}catch(_0xbba253){return BPromise['reject'](_0xbba253);}return _0x51a54a['save']();};}function saveUpdates(_0x3eb68a,_0x3714a9){return function(_0x310efe){if(_0x310efe){return _0x310efe[_0x897e('0x24')](_0x3eb68a)[_0x897e('0x25')](function(_0x1f2a56){return _0x1f2a56;});}return null;};}function removeEntity(_0x3eb08c,_0x2ceadc){return function(_0x591c21){if(_0x591c21){return _0x591c21[_0x897e('0x26')]()[_0x897e('0x25')](function(){_0x3eb08c[_0x897e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e871,_0x36c60f){return function(_0x26bc1e){if(!_0x26bc1e){_0x29e871['sendStatus'](0x194);}return _0x26bc1e;};}function handleError(_0x3b3659,_0x10b119){_0x10b119=_0x10b119||0x1f4;return function(_0x192d6b){logger['error'](_0x192d6b[_0x897e('0x27')]);if(_0x192d6b[_0x897e('0x28')]){delete _0x192d6b['name'];}_0x3b3659[_0x897e('0x1c')](_0x10b119)['send'](_0x192d6b);};}exports[_0x897e('0x29')]=function(_0x2b23e1,_0x2bac5d){var _0x28c0cf={},_0x5a2e2d={},_0x3256e1={'count':0x0,'rows':[]};var _0x1c7be8=_[_0x897e('0x2a')](db[_0x897e('0x2b')][_0x897e('0x2c')],function(_0x43891f){return{'name':_0x43891f[_0x897e('0x2d')],'type':_0x43891f['type']['key']};});_0x5a2e2d[_0x897e('0x2e')]=_['map'](_0x1c7be8,_0x897e('0x28'));_0x5a2e2d[_0x897e('0x2f')]=_[_0x897e('0x30')](_0x2b23e1[_0x897e('0x2f')]);_0x5a2e2d['filters']=_[_0x897e('0x31')](_0x5a2e2d[_0x897e('0x2e')],_0x5a2e2d[_0x897e('0x2f')]);_0x28c0cf[_0x897e('0x32')]=_[_0x897e('0x31')](_0x5a2e2d[_0x897e('0x2e')],qs['fields'](_0x2b23e1[_0x897e('0x2f')][_0x897e('0x33')]));_0x28c0cf[_0x897e('0x32')]=_0x28c0cf['attributes'][_0x897e('0x34')]?_0x28c0cf[_0x897e('0x32')]:_0x5a2e2d['model'];if(!_0x2b23e1['query'][_0x897e('0x35')]('nolimit')){_0x28c0cf[_0x897e('0x20')]=qs[_0x897e('0x20')](_0x2b23e1[_0x897e('0x2f')][_0x897e('0x20')]);_0x28c0cf[_0x897e('0x1e')]=qs[_0x897e('0x1e')](_0x2b23e1['query'][_0x897e('0x1e')]);}_0x28c0cf[_0x897e('0x36')]=qs['sort'](_0x2b23e1['query'][_0x897e('0x37')]);_0x28c0cf[_0x897e('0x38')]=qs['filters'](_[_0x897e('0x39')](_0x2b23e1[_0x897e('0x2f')],_0x5a2e2d['filters']),_0x1c7be8);if(_0x2b23e1[_0x897e('0x2f')]['filter']){_0x28c0cf[_0x897e('0x38')]=_[_0x897e('0x3a')](_0x28c0cf[_0x897e('0x38')],{'$or':_[_0x897e('0x2a')](_0x1c7be8,function(_0x1ce535){if(_0x1ce535[_0x897e('0x3b')]!=='VIRTUAL'){var _0x147a9a={};_0x147a9a[_0x1ce535['name']]={'$like':'%'+_0x2b23e1['query']['filter']+'%'};return _0x147a9a;}})});}_0x28c0cf=_[_0x897e('0x3a')]({},_0x28c0cf,_0x2b23e1[_0x897e('0x3c')]);var _0x369ea3={'where':_0x28c0cf[_0x897e('0x38')]};return db['DeskConfiguration'][_0x897e('0x21')](_0x369ea3)[_0x897e('0x25')](function(_0x3707ec){_0x3256e1['count']=_0x3707ec;if(_0x2b23e1[_0x897e('0x2f')][_0x897e('0x3d')]){_0x28c0cf[_0x897e('0x3e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x897e('0x3f')](_0x28c0cf);})['then'](function(_0xeb4830){_0x3256e1[_0x897e('0x40')]=_0xeb4830;return _0x3256e1;})['then'](respondWithFilteredResult(_0x2bac5d,_0x28c0cf))[_0x897e('0x41')](handleError(_0x2bac5d,null));};exports[_0x897e('0x42')]=function(_0x575ec6,_0x25c5cb){var _0x35ef05={'raw':![],'where':{'id':_0x575ec6[_0x897e('0x43')]['id']}},_0x2dac0b={};_0x2dac0b['model']=_[_0x897e('0x30')](db[_0x897e('0x2b')]['rawAttributes']);_0x2dac0b[_0x897e('0x2f')]=_[_0x897e('0x30')](_0x575ec6['query']);_0x2dac0b[_0x897e('0x44')]=_['intersection'](_0x2dac0b[_0x897e('0x2e')],_0x2dac0b['query']);_0x35ef05[_0x897e('0x32')]=_[_0x897e('0x31')](_0x2dac0b[_0x897e('0x2e')],qs[_0x897e('0x33')](_0x575ec6['query'][_0x897e('0x33')]));_0x35ef05[_0x897e('0x32')]=_0x35ef05[_0x897e('0x32')]['length']?_0x35ef05[_0x897e('0x32')]:_0x2dac0b[_0x897e('0x2e')];if(_0x575ec6[_0x897e('0x2f')][_0x897e('0x3d')]){_0x35ef05[_0x897e('0x3e')]=[{'all':!![]}];}_0x35ef05=_[_0x897e('0x3a')]({},_0x35ef05,_0x575ec6[_0x897e('0x3c')]);return db[_0x897e('0x2b')]['find'](_0x35ef05)[_0x897e('0x25')](handleEntityNotFound(_0x25c5cb,null))[_0x897e('0x25')](respondWithResult(_0x25c5cb,null))[_0x897e('0x41')](handleError(_0x25c5cb,null));};exports['create']=function(_0x55e6fc,_0x5d5a4b){return db['DeskConfiguration']['create'](_0x55e6fc[_0x897e('0x45')],{})[_0x897e('0x25')](respondWithResult(_0x5d5a4b,0xc9))[_0x897e('0x41')](handleError(_0x5d5a4b,null));};exports[_0x897e('0x24')]=function(_0x3503e0,_0x165cf5){if(_0x3503e0[_0x897e('0x45')]['id']){delete _0x3503e0[_0x897e('0x45')]['id'];}return db[_0x897e('0x2b')][_0x897e('0x46')]({'where':{'id':_0x3503e0[_0x897e('0x43')]['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x165cf5,null))[_0x897e('0x25')](saveUpdates(_0x3503e0[_0x897e('0x45')],null))[_0x897e('0x25')](respondWithResult(_0x165cf5,null))[_0x897e('0x41')](handleError(_0x165cf5,null));};exports['destroy']=function(_0x9ff594,_0x5e8b01){return db['DeskConfiguration']['find']({'where':{'id':_0x9ff594[_0x897e('0x43')]['id']}})['then'](handleEntityNotFound(_0x5e8b01,null))['then'](removeEntity(_0x5e8b01,null))[_0x897e('0x41')](handleError(_0x5e8b01,null));};exports['getFields']=function(_0x5d3196,_0x4dd17c,_0xb62d62){var _0xb1d683={};var _0x1074fb={};var _0x2ece65;var _0x516dec;return db[_0x897e('0x2b')][_0x897e('0x47')]({'where':{'id':_0x5d3196[_0x897e('0x43')]['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x4dd17c,null))['then'](function(_0x2a7330){if(_0x2a7330){_0x2ece65=_0x2a7330;_0x1074fb[_0x897e('0x2e')]=_[_0x897e('0x30')](db['DeskField'][_0x897e('0x2c')]);_0x1074fb[_0x897e('0x2f')]=_[_0x897e('0x30')](_0x5d3196[_0x897e('0x2f')]);_0x1074fb[_0x897e('0x44')]=_[_0x897e('0x31')](_0x1074fb[_0x897e('0x2e')],_0x1074fb['query']);_0xb1d683['attributes']=_[_0x897e('0x31')](_0x1074fb[_0x897e('0x2e')],qs[_0x897e('0x33')](_0x5d3196['query'][_0x897e('0x33')]));_0xb1d683[_0x897e('0x32')]=_0xb1d683[_0x897e('0x32')]['length']?_0xb1d683[_0x897e('0x32')]:_0x1074fb['model'];_0xb1d683[_0x897e('0x36')]=qs[_0x897e('0x37')](_0x5d3196['query'][_0x897e('0x37')]);_0xb1d683[_0x897e('0x38')]=qs[_0x897e('0x44')](_['pick'](_0x5d3196['query'],_0x1074fb['filters']));if(_0x5d3196[_0x897e('0x2f')][_0x897e('0x48')]){_0xb1d683['where']=_[_0x897e('0x3a')](_0xb1d683[_0x897e('0x38')],{'$or':_[_0x897e('0x2a')](_0xb1d683['attributes'],function(_0x17f457){var _0x153e7b={};_0x153e7b[_0x17f457]={'$like':'%'+_0x5d3196[_0x897e('0x2f')][_0x897e('0x48')]+'%'};return _0x153e7b;})});}_0xb1d683=_[_0x897e('0x3a')]({},_0xb1d683,_0x5d3196['options']);return _0x2ece65[_0x897e('0x49')](_0xb1d683);}})[_0x897e('0x25')](function(_0x5528ab){if(_0x5528ab){_0x516dec=_0x5528ab[_0x897e('0x34')];if(!_0x5d3196[_0x897e('0x2f')]['hasOwnProperty'](_0x897e('0x4a'))){_0xb1d683[_0x897e('0x20')]=qs['limit'](_0x5d3196[_0x897e('0x2f')]['limit']);_0xb1d683['offset']=qs['offset'](_0x5d3196[_0x897e('0x2f')][_0x897e('0x1e')]);}return _0x2ece65[_0x897e('0x49')](_0xb1d683);}})['then'](function(_0x28ea3b){if(_0x28ea3b){return _0x28ea3b?{'count':_0x516dec,'rows':_0x28ea3b}:null;}})[_0x897e('0x25')](respondWithResult(_0x4dd17c,null))[_0x897e('0x41')](handleError(_0x4dd17c,null));};exports['getSubjects']=function(_0x28a124,_0x19a4e1,_0x3ea92d){var _0x4e523b={};var _0xdd588c={};var _0x3eb5d2;var _0x13b929;return db['DeskConfiguration'][_0x897e('0x47')]({'where':{'id':_0x28a124[_0x897e('0x43')]['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x19a4e1,null))[_0x897e('0x25')](function(_0x1eaf77){if(_0x1eaf77){_0x3eb5d2=_0x1eaf77;_0xdd588c[_0x897e('0x2e')]=_[_0x897e('0x30')](db[_0x897e('0x4b')][_0x897e('0x2c')]);_0xdd588c[_0x897e('0x2f')]=_[_0x897e('0x30')](_0x28a124[_0x897e('0x2f')]);_0xdd588c['filters']=_[_0x897e('0x31')](_0xdd588c[_0x897e('0x2e')],_0xdd588c[_0x897e('0x2f')]);_0x4e523b[_0x897e('0x32')]=_['intersection'](_0xdd588c[_0x897e('0x2e')],qs[_0x897e('0x33')](_0x28a124[_0x897e('0x2f')][_0x897e('0x33')]));_0x4e523b[_0x897e('0x32')]=_0x4e523b[_0x897e('0x32')][_0x897e('0x34')]?_0x4e523b[_0x897e('0x32')]:_0xdd588c[_0x897e('0x2e')];_0x4e523b[_0x897e('0x36')]=qs['sort'](_0x28a124[_0x897e('0x2f')][_0x897e('0x37')]);_0x4e523b[_0x897e('0x38')]=qs[_0x897e('0x44')](_[_0x897e('0x39')](_0x28a124['query'],_0xdd588c['filters']));if(_0x28a124[_0x897e('0x2f')][_0x897e('0x48')]){_0x4e523b['where']=_[_0x897e('0x3a')](_0x4e523b[_0x897e('0x38')],{'$or':_[_0x897e('0x2a')](_0x4e523b[_0x897e('0x32')],function(_0x5f4dfa){var _0x359760={};_0x359760[_0x5f4dfa]={'$like':'%'+_0x28a124[_0x897e('0x2f')][_0x897e('0x48')]+'%'};return _0x359760;})});}_0x4e523b=_[_0x897e('0x3a')]({},_0x4e523b,_0x28a124[_0x897e('0x3c')]);return _0x3eb5d2[_0x897e('0x4c')](_0x4e523b);}})[_0x897e('0x25')](function(_0x2533b3){if(_0x2533b3){_0x13b929=_0x2533b3[_0x897e('0x34')];if(!_0x28a124[_0x897e('0x2f')]['hasOwnProperty']('nolimit')){_0x4e523b[_0x897e('0x20')]=qs['limit'](_0x28a124['query'][_0x897e('0x20')]);_0x4e523b['offset']=qs[_0x897e('0x1e')](_0x28a124['query']['offset']);}return _0x3eb5d2['getSubjects'](_0x4e523b);}})[_0x897e('0x25')](function(_0x2f3ae7){if(_0x2f3ae7){return _0x2f3ae7?{'count':_0x13b929,'rows':_0x2f3ae7}:null;}})[_0x897e('0x25')](respondWithResult(_0x19a4e1,null))[_0x897e('0x41')](handleError(_0x19a4e1,null));};exports[_0x897e('0x4d')]=function(_0x476e11,_0x348c2f,_0x13e23a){var _0x59d531={};var _0x593af5={};var _0x2e18ee;var _0x3cbc11;return db[_0x897e('0x2b')][_0x897e('0x47')]({'where':{'id':_0x476e11[_0x897e('0x43')]['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x348c2f,null))[_0x897e('0x25')](function(_0x5c383b){if(_0x5c383b){_0x2e18ee=_0x5c383b;_0x593af5[_0x897e('0x2e')]=_[_0x897e('0x30')](db[_0x897e('0x4b')]['rawAttributes']);_0x593af5[_0x897e('0x2f')]=_['keys'](_0x476e11[_0x897e('0x2f')]);_0x593af5[_0x897e('0x44')]=_[_0x897e('0x31')](_0x593af5[_0x897e('0x2e')],_0x593af5[_0x897e('0x2f')]);_0x59d531[_0x897e('0x32')]=_[_0x897e('0x31')](_0x593af5[_0x897e('0x2e')],qs[_0x897e('0x33')](_0x476e11[_0x897e('0x2f')][_0x897e('0x33')]));_0x59d531[_0x897e('0x32')]=_0x59d531[_0x897e('0x32')]['length']?_0x59d531[_0x897e('0x32')]:_0x593af5[_0x897e('0x2e')];_0x59d531[_0x897e('0x36')]=qs[_0x897e('0x37')](_0x476e11[_0x897e('0x2f')][_0x897e('0x37')]);_0x59d531[_0x897e('0x38')]=qs[_0x897e('0x44')](_[_0x897e('0x39')](_0x476e11[_0x897e('0x2f')],_0x593af5['filters']));if(_0x476e11[_0x897e('0x2f')]['filter']){_0x59d531[_0x897e('0x38')]=_[_0x897e('0x3a')](_0x59d531[_0x897e('0x38')],{'$or':_[_0x897e('0x2a')](_0x59d531[_0x897e('0x32')],function(_0x16d4d1){var _0x93b9fc={};_0x93b9fc[_0x16d4d1]={'$like':'%'+_0x476e11[_0x897e('0x2f')][_0x897e('0x48')]+'%'};return _0x93b9fc;})});}_0x59d531=_['merge']({},_0x59d531,_0x476e11[_0x897e('0x3c')]);return _0x2e18ee[_0x897e('0x4d')](_0x59d531);}})[_0x897e('0x25')](function(_0x56f335){if(_0x56f335){_0x3cbc11=_0x56f335[_0x897e('0x34')];if(!_0x476e11['query'][_0x897e('0x35')](_0x897e('0x4a'))){_0x59d531[_0x897e('0x20')]=qs[_0x897e('0x20')](_0x476e11[_0x897e('0x2f')][_0x897e('0x20')]);_0x59d531[_0x897e('0x1e')]=qs['offset'](_0x476e11[_0x897e('0x2f')][_0x897e('0x1e')]);}return _0x2e18ee[_0x897e('0x4d')](_0x59d531);}})[_0x897e('0x25')](function(_0x2a3aa3){if(_0x2a3aa3){return _0x2a3aa3?{'count':_0x3cbc11,'rows':_0x2a3aa3}:null;}})[_0x897e('0x25')](respondWithResult(_0x348c2f,null))['catch'](handleError(_0x348c2f,null));};exports[_0x897e('0x4e')]=function(_0x5dc046,_0x476800,_0x8d4dfa){var _0x281c84={};var _0x1b7c2f={};var _0x3e409c;var _0x13d84f;return db['DeskConfiguration'][_0x897e('0x47')]({'where':{'id':_0x5dc046[_0x897e('0x43')]['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x476800,null))[_0x897e('0x25')](function(_0x189458){if(_0x189458){_0x3e409c=_0x189458;_0x1b7c2f['model']=_[_0x897e('0x30')](db[_0x897e('0x4f')][_0x897e('0x2c')]);_0x1b7c2f[_0x897e('0x2f')]=_[_0x897e('0x30')](_0x5dc046[_0x897e('0x2f')]);_0x1b7c2f[_0x897e('0x44')]=_[_0x897e('0x31')](_0x1b7c2f[_0x897e('0x2e')],_0x1b7c2f['query']);_0x281c84['attributes']=_[_0x897e('0x31')](_0x1b7c2f['model'],qs['fields'](_0x5dc046['query'][_0x897e('0x33')]));_0x281c84[_0x897e('0x32')]=_0x281c84[_0x897e('0x32')]['length']?_0x281c84[_0x897e('0x32')]:_0x1b7c2f['model'];_0x281c84[_0x897e('0x36')]=qs[_0x897e('0x37')](_0x5dc046['query']['sort']);_0x281c84[_0x897e('0x38')]=qs['filters'](_[_0x897e('0x39')](_0x5dc046[_0x897e('0x2f')],_0x1b7c2f[_0x897e('0x44')]));if(_0x5dc046[_0x897e('0x2f')][_0x897e('0x48')]){_0x281c84[_0x897e('0x38')]=_['merge'](_0x281c84['where'],{'$or':_[_0x897e('0x2a')](_0x281c84[_0x897e('0x32')],function(_0x5419d9){var _0x1dbc7a={};_0x1dbc7a[_0x5419d9]={'$like':'%'+_0x5dc046[_0x897e('0x2f')][_0x897e('0x48')]+'%'};return _0x1dbc7a;})});}_0x281c84=_[_0x897e('0x3a')]({},_0x281c84,_0x5dc046[_0x897e('0x3c')]);return _0x3e409c[_0x897e('0x4e')](_0x281c84);}})[_0x897e('0x25')](function(_0x46e1e6){if(_0x46e1e6){_0x13d84f=_0x46e1e6[_0x897e('0x34')];if(!_0x5dc046[_0x897e('0x2f')][_0x897e('0x35')](_0x897e('0x4a'))){_0x281c84['limit']=qs[_0x897e('0x20')](_0x5dc046[_0x897e('0x2f')][_0x897e('0x20')]);_0x281c84[_0x897e('0x1e')]=qs[_0x897e('0x1e')](_0x5dc046[_0x897e('0x2f')]['offset']);}return _0x3e409c[_0x897e('0x4e')](_0x281c84);}})[_0x897e('0x25')](function(_0x34956e){if(_0x34956e){return _0x34956e?{'count':_0x13d84f,'rows':_0x34956e}:null;}})[_0x897e('0x25')](respondWithResult(_0x476800,null))[_0x897e('0x41')](handleError(_0x476800,null));};exports[_0x897e('0x50')]=function(_0x297901,_0x8f2a5e,_0x43b9d0){if(_0x297901[_0x897e('0x45')]['id']){delete _0x297901[_0x897e('0x45')]['id'];}return db[_0x897e('0x2b')][_0x897e('0x47')]({'where':{'id':_0x297901['params']['id']}})[_0x897e('0x25')](handleEntityNotFound(_0x8f2a5e,null))['then'](function(_0x101036){if(_0x101036){return _0x101036['setTags'](_0x297901[_0x897e('0x45')][_0x897e('0x51')]||[]);}return null;})[_0x897e('0x25')](respondWithResult(_0x8f2a5e,null))['catch'](handleError(_0x8f2a5e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 37190f6..fb8aa8e 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 _0x8a72=['bluebird','request-promise','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','../../config/logger','moment'];(function(_0x59f0f7,_0x423bc4){var _0xf5ef2a=function(_0x53c37f){while(--_0x53c37f){_0x59f0f7['push'](_0x59f0f7['shift']());}};_0xf5ef2a(++_0x423bc4);}(_0x8a72,0xa6));var _0x28a7=function(_0x32477a,_0x1a5d0d){_0x32477a=_0x32477a-0x0;var _0xe86bce=_0x8a72[_0x32477a];return _0xe86bce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28a7('0x0'))('api');var moment=require(_0x28a7('0x1'));var BPromise=require(_0x28a7('0x2'));var rp=require(_0x28a7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x28a7('0x4'));var attributes=require(_0x28a7('0x5'));module['exports']=function(_0x49ff02,_0x5681da){return _0x49ff02[_0x28a7('0x6')](_0x28a7('0x7'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6268=['./intDeskConfiguration.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d3d7b,_0x4ff57b){var _0x37f7ab=function(_0x21ef05){while(--_0x21ef05){_0x5d3d7b['push'](_0x5d3d7b['shift']());}};_0x37f7ab(++_0x4ff57b);}(_0x6268,0x193));var _0x8626=function(_0xb6895c,_0x5284fd){_0xb6895c=_0xb6895c-0x0;var _0x2afbb1=_0x6268[_0xb6895c];return _0x2afbb1;};'use strict';var _=require(_0x8626('0x0'));var util=require('util');var logger=require(_0x8626('0x1'))('api');var moment=require(_0x8626('0x2'));var BPromise=require(_0x8626('0x3'));var rp=require(_0x8626('0x4'));var fs=require('fs');var path=require(_0x8626('0x5'));var rimraf=require(_0x8626('0x6'));var config=require('../../config/environment');var attributes=require(_0x8626('0x7'));module[_0x8626('0x8')]=function(_0x12a9b5,_0x259e54){return _0x12a9b5[_0x8626('0x9')]('DeskConfiguration',attributes,{'tableName':'int_desk_configurations','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 2ea8797..f11f1c4 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 _0x0936=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29a033,_0x3a9bf3){var _0x19226f=function(_0xfc40dc){while(--_0xfc40dc){_0x29a033['push'](_0x29a033['shift']());}};_0x19226f(++_0x3a9bf3);}(_0x0936,0xde));var _0x6093=function(_0x23052b,_0x4da2b5){_0x23052b=_0x23052b-0x0;var _0x517feb=_0x0936[_0x23052b];return _0x517feb;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});} \ No newline at end of file +var _0x94e6=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x440465,_0x1d3aba){var _0x5ba5bf=function(_0x178391){while(--_0x178391){_0x440465['push'](_0x440465['shift']());}};_0x5ba5bf(++_0x1d3aba);}(_0x94e6,0x194));var _0x694e=function(_0x3dc6d0,_0x314d13){_0x3dc6d0=_0x3dc6d0-0x0;var _0x2168fe=_0x94e6[_0x3dc6d0];return _0x2168fe;};'use strict';var _=require(_0x694e('0x0'));var util=require('util');var moment=require(_0x694e('0x1'));var BPromise=require(_0x694e('0x2'));var rs=require(_0x694e('0x3'));var fs=require('fs');var Redis=require(_0x694e('0x4'));var db=require(_0x694e('0x5'))['db'];var utils=require(_0x694e('0x6'));var logger=require('../../config/logger')(_0x694e('0x7'));var config=require(_0x694e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x694e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x84e66e,_0x1c0a45,_0x492dd2){return new BPromise(function(_0x504e0b,_0x3e3f5c){return client['request'](_0x84e66e,_0x492dd2)['then'](function(_0x4ab419){logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));logger[_0x694e('0xd')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1c0a45,_0x694e('0xc'),JSON[_0x694e('0xe')](_0x4ab419));if(_0x4ab419['error']){if(_0x4ab419[_0x694e('0xf')][_0x694e('0x10')]===0x1f4){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419['error'][_0x694e('0x11')]);return _0x3e3f5c(_0x4ab419['error'][_0x694e('0x11')]);}logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);return _0x504e0b(_0x4ab419[_0x694e('0xf')][_0x694e('0x11')]);}else{logger[_0x694e('0xa')](_0x694e('0xb'),_0x1c0a45,_0x694e('0xc'));_0x504e0b(_0x4ab419[_0x694e('0x12')][_0x694e('0x11')]);}})[_0x694e('0x13')](function(_0x4e608d){logger[_0x694e('0xf')](_0x694e('0xb'),_0x1c0a45,_0x4e608d);_0x3e3f5c(_0x4e608d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 95a55e3..e280244 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 _0x9c57=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9c57,0x99));var _0x79c5=function(_0x167622,_0x407448){_0x167622=_0x167622-0x0;var _0x50226f=_0x9c57[_0x167622];return _0x50226f;};'use strict';var multer=require(_0x79c5('0x0'));var util=require(_0x79c5('0x1'));var path=require(_0x79c5('0x2'));var timeout=require('connect-timeout');var express=require(_0x79c5('0x3'));var router=express[_0x79c5('0x4')]();var fs_extra=require(_0x79c5('0x5'));var auth=require(_0x79c5('0x6'));var interaction=require(_0x79c5('0x7'));var config=require(_0x79c5('0x8'));var controller=require(_0x79c5('0x9'));router[_0x79c5('0xa')]('/',auth[_0x79c5('0xb')](),controller[_0x79c5('0xc')]);router[_0x79c5('0xa')](_0x79c5('0xd'),auth[_0x79c5('0xb')](),controller[_0x79c5('0xe')]);router[_0x79c5('0xf')]('/',auth[_0x79c5('0xb')](),controller[_0x79c5('0x10')]);router[_0x79c5('0x11')](_0x79c5('0xd'),auth[_0x79c5('0xb')](),controller[_0x79c5('0x12')]);router[_0x79c5('0x13')](_0x79c5('0xd'),auth[_0x79c5('0xb')](),controller[_0x79c5('0x14')]);module[_0x79c5('0x15')]=router; \ No newline at end of file +var _0xbe79=['create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x85438c,_0x247e6f){var _0x4d45fe=function(_0x1fe80e){while(--_0x1fe80e){_0x85438c['push'](_0x85438c['shift']());}};_0x4d45fe(++_0x247e6f);}(_0xbe79,0x1e6));var _0x9be7=function(_0x3da6fa,_0x4a1390){_0x3da6fa=_0x3da6fa-0x0;var _0x288c0e=_0xbe79[_0x3da6fa];return _0x288c0e;};'use strict';var multer=require(_0x9be7('0x0'));var util=require('util');var path=require(_0x9be7('0x1'));var timeout=require('connect-timeout');var express=require(_0x9be7('0x2'));var router=express[_0x9be7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9be7('0x4'));var interaction=require(_0x9be7('0x5'));var config=require(_0x9be7('0x6'));var controller=require(_0x9be7('0x7'));router['get']('/',auth[_0x9be7('0x8')](),controller[_0x9be7('0x9')]);router[_0x9be7('0xa')](_0x9be7('0xb'),auth[_0x9be7('0x8')](),controller[_0x9be7('0xc')]);router[_0x9be7('0xd')]('/',auth[_0x9be7('0x8')](),controller[_0x9be7('0xe')]);router[_0x9be7('0xf')](_0x9be7('0xb'),auth['isAuthenticated'](),controller[_0x9be7('0x10')]);router[_0x9be7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9be7('0x12')]);module[_0x9be7('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a8a2bb9..56f6e7c 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 _0x4bff=['ENUM','variable','customVariable','picklist','string','STRING','sequelize','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x4bff,0x1ce));var _0xf4bf=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x4bff[_0x2e0443];return _0x52d450;};'use strict';var Sequelize=require(_0xf4bf('0x0'));module[_0xf4bf('0x1')]={'type':{'type':Sequelize[_0xf4bf('0x2')]('string',_0xf4bf('0x3'),_0xf4bf('0x4'),'keyValue',_0xf4bf('0x5')),'defaultValue':_0xf4bf('0x6')},'content':{'type':Sequelize[_0xf4bf('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf4bf('0x2')]('string',_0xf4bf('0x3'),_0xf4bf('0x4'))},'keyContent':{'type':Sequelize[_0xf4bf('0x7')]},'idField':{'type':Sequelize[_0xf4bf('0x7')]},'nameField':{'type':Sequelize[_0xf4bf('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf4bf('0x7')]}}; \ No newline at end of file +var _0x5413=['string','variable','sequelize','ENUM','customVariable','keyValue','picklist','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5413,0xf2));var _0x3541=function(_0x3a0144,_0x1cae55){_0x3a0144=_0x3a0144-0x0;var _0x2c0ba7=_0x5413[_0x3a0144];return _0x2c0ba7;};'use strict';var Sequelize=require(_0x3541('0x0'));module['exports']={'type':{'type':Sequelize[_0x3541('0x1')]('string','variable',_0x3541('0x2'),_0x3541('0x3'),_0x3541('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3541('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x3541('0x6'),_0x3541('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0x3541('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'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 4aee485..9106fc5 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 _0x680a=['request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','then','destroy','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','eml-format','zip-dir','fast-json-patch'];(function(_0x441038,_0x318ade){var _0x373b31=function(_0x265b32){while(--_0x265b32){_0x441038['push'](_0x441038['shift']());}};_0x373b31(++_0x318ade);}(_0x680a,0xde));var _0xa680=function(_0x1d066c,_0xb62a8b){_0x1d066c=_0x1d066c-0x0;var _0x522f48=_0x680a[_0x1d066c];return _0x522f48;};'use strict';var emlformat=require(_0xa680('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa680('0x1'));var jsonpatch=require(_0xa680('0x2'));var rp=require(_0xa680('0x3'));var moment=require(_0xa680('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa680('0x5'));var util=require(_0xa680('0x6'));var path=require(_0xa680('0x7'));var sox=require(_0xa680('0x8'));var csv=require('to-csv');var ejs=require(_0xa680('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa680('0xa'));var squel=require('squel');var crypto=require(_0xa680('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa680('0xc'));var querystring=require(_0xa680('0xd'));var Papa=require('papaparse');var Redis=require(_0xa680('0xe'));var authService=require(_0xa680('0xf'));var qs=require(_0xa680('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa680('0x11'));var logger=require(_0xa680('0x12'))(_0xa680('0x13'));var utils=require(_0xa680('0x14'));var config=require(_0xa680('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa680('0x16'))['db'];function respondWithStatusCode(_0x2360f5,_0x20658a){_0x20658a=_0x20658a||0xcc;return function(_0x1101ff){if(_0x1101ff){return _0x2360f5[_0xa680('0x17')](_0x20658a);}return _0x2360f5['status'](_0x20658a)[_0xa680('0x18')]();};}function respondWithResult(_0x5ee824,_0x5a5b41){_0x5a5b41=_0x5a5b41||0xc8;return function(_0x264018){if(_0x264018){return _0x5ee824['status'](_0x5a5b41)[_0xa680('0x19')](_0x264018);}};}function respondWithFilteredResult(_0x262c7f,_0x4b976f){return function(_0x3c004c){if(_0x3c004c){var _0x1581b0=typeof _0x4b976f[_0xa680('0x1a')]===_0xa680('0x1b')&&typeof _0x4b976f[_0xa680('0x1c')]===_0xa680('0x1b');var _0xf62a33=_0x3c004c[_0xa680('0x1d')];var _0x2e8926=_0x1581b0?0x0:_0x4b976f[_0xa680('0x1a')];var _0x11d5dd=_0x1581b0?_0x3c004c[_0xa680('0x1d')]:_0x4b976f[_0xa680('0x1a')]+_0x4b976f[_0xa680('0x1c')];var _0x517ee9;if(_0x11d5dd>=_0xf62a33){_0x11d5dd=_0xf62a33;_0x517ee9=0xc8;}else{_0x517ee9=0xce;}_0x262c7f[_0xa680('0x1e')](_0x517ee9);return _0x262c7f[_0xa680('0x1f')]('Content-Range',_0x2e8926+'-'+_0x11d5dd+'/'+_0xf62a33)[_0xa680('0x19')](_0x3c004c);}return null;};}function patchUpdates(_0x5736e0){return function(_0x4ac643){try{jsonpatch[_0xa680('0x20')](_0x4ac643,_0x5736e0,!![]);}catch(_0x776806){return BPromise['reject'](_0x776806);}return _0x4ac643[_0xa680('0x21')]();};}function saveUpdates(_0x31c7b9,_0x2b3c3f){return function(_0x15939e){if(_0x15939e){return _0x15939e['update'](_0x31c7b9)[_0xa680('0x22')](function(_0x4c3bdf){return _0x4c3bdf;});}return null;};}function removeEntity(_0x6c5f6d,_0x4b067a){return function(_0x4a2229){if(_0x4a2229){return _0x4a2229[_0xa680('0x23')]()[_0xa680('0x22')](function(){_0x6c5f6d['status'](0xcc)[_0xa680('0x18')]();});}};}function handleEntityNotFound(_0x3bed9b,_0xc251c6){return function(_0x3dbe1a){if(!_0x3dbe1a){_0x3bed9b[_0xa680('0x17')](0x194);}return _0x3dbe1a;};}function handleError(_0xdcbcad,_0x34560f){_0x34560f=_0x34560f||0x1f4;return function(_0x9dc3c7){logger[_0xa680('0x24')](_0x9dc3c7[_0xa680('0x25')]);if(_0x9dc3c7[_0xa680('0x26')]){delete _0x9dc3c7['name'];}_0xdcbcad['status'](_0x34560f)[_0xa680('0x27')](_0x9dc3c7);};}exports['index']=function(_0x31f20b,_0xcb4669){var _0x16fc82={},_0x21f89c={},_0x54f148={'count':0x0,'rows':[]};var _0x2e976f=_[_0xa680('0x28')](db[_0xa680('0x29')][_0xa680('0x2a')],function(_0x33740a){return{'name':_0x33740a[_0xa680('0x2b')],'type':_0x33740a[_0xa680('0x2c')][_0xa680('0x2d')]};});_0x21f89c[_0xa680('0x2e')]=_['map'](_0x2e976f,'name');_0x21f89c[_0xa680('0x2f')]=_[_0xa680('0x30')](_0x31f20b[_0xa680('0x2f')]);_0x21f89c[_0xa680('0x31')]=_['intersection'](_0x21f89c[_0xa680('0x2e')],_0x21f89c[_0xa680('0x2f')]);_0x16fc82[_0xa680('0x32')]=_[_0xa680('0x33')](_0x21f89c[_0xa680('0x2e')],qs[_0xa680('0x34')](_0x31f20b[_0xa680('0x2f')]['fields']));_0x16fc82[_0xa680('0x32')]=_0x16fc82[_0xa680('0x32')]['length']?_0x16fc82[_0xa680('0x32')]:_0x21f89c[_0xa680('0x2e')];if(!_0x31f20b['query'][_0xa680('0x35')](_0xa680('0x36'))){_0x16fc82[_0xa680('0x1c')]=qs[_0xa680('0x1c')](_0x31f20b[_0xa680('0x2f')][_0xa680('0x1c')]);_0x16fc82[_0xa680('0x1a')]=qs[_0xa680('0x1a')](_0x31f20b['query'][_0xa680('0x1a')]);}_0x16fc82[_0xa680('0x37')]=qs[_0xa680('0x38')](_0x31f20b[_0xa680('0x2f')][_0xa680('0x38')]);_0x16fc82[_0xa680('0x39')]=qs[_0xa680('0x31')](_[_0xa680('0x3a')](_0x31f20b[_0xa680('0x2f')],_0x21f89c[_0xa680('0x31')]),_0x2e976f);if(_0x31f20b[_0xa680('0x2f')][_0xa680('0x3b')]){_0x16fc82[_0xa680('0x39')]=_[_0xa680('0x3c')](_0x16fc82['where'],{'$or':_['map'](_0x2e976f,function(_0x200bd1){if(_0x200bd1['type']!==_0xa680('0x3d')){var _0x28ef4f={};_0x28ef4f[_0x200bd1['name']]={'$like':'%'+_0x31f20b[_0xa680('0x2f')][_0xa680('0x3b')]+'%'};return _0x28ef4f;}})});}_0x16fc82=_[_0xa680('0x3c')]({},_0x16fc82,_0x31f20b[_0xa680('0x3e')]);var _0x366a96={'where':_0x16fc82[_0xa680('0x39')]};return db[_0xa680('0x29')]['count'](_0x366a96)[_0xa680('0x22')](function(_0x10edee){_0x54f148[_0xa680('0x1d')]=_0x10edee;if(_0x31f20b[_0xa680('0x2f')][_0xa680('0x3f')]){_0x16fc82[_0xa680('0x40')]=[{'all':!![]}];}return db[_0xa680('0x29')][_0xa680('0x41')](_0x16fc82);})[_0xa680('0x22')](function(_0x293892){_0x54f148[_0xa680('0x42')]=_0x293892;return _0x54f148;})[_0xa680('0x22')](respondWithFilteredResult(_0xcb4669,_0x16fc82))[_0xa680('0x43')](handleError(_0xcb4669,null));};exports[_0xa680('0x44')]=function(_0x69f19f,_0x5a24c1){var _0x14fb89={'raw':!![],'where':{'id':_0x69f19f[_0xa680('0x45')]['id']}},_0x2efce3={};_0x2efce3[_0xa680('0x2e')]=_[_0xa680('0x30')](db[_0xa680('0x29')][_0xa680('0x2a')]);_0x2efce3[_0xa680('0x2f')]=_['keys'](_0x69f19f[_0xa680('0x2f')]);_0x2efce3[_0xa680('0x31')]=_[_0xa680('0x33')](_0x2efce3['model'],_0x2efce3[_0xa680('0x2f')]);_0x14fb89['attributes']=_[_0xa680('0x33')](_0x2efce3[_0xa680('0x2e')],qs[_0xa680('0x34')](_0x69f19f[_0xa680('0x2f')]['fields']));_0x14fb89[_0xa680('0x32')]=_0x14fb89['attributes'][_0xa680('0x46')]?_0x14fb89['attributes']:_0x2efce3[_0xa680('0x2e')];if(_0x69f19f[_0xa680('0x2f')][_0xa680('0x3f')]){_0x14fb89[_0xa680('0x40')]=[{'all':!![]}];}_0x14fb89=_[_0xa680('0x3c')]({},_0x14fb89,_0x69f19f[_0xa680('0x3e')]);return db['DeskField'][_0xa680('0x47')](_0x14fb89)[_0xa680('0x22')](handleEntityNotFound(_0x5a24c1,null))[_0xa680('0x22')](respondWithResult(_0x5a24c1,null))[_0xa680('0x43')](handleError(_0x5a24c1,null));};exports['create']=function(_0x1174b8,_0x59dc30){return db[_0xa680('0x29')][_0xa680('0x48')](_0x1174b8[_0xa680('0x49')],{})[_0xa680('0x22')](respondWithResult(_0x59dc30,0xc9))[_0xa680('0x43')](handleError(_0x59dc30,null));};exports[_0xa680('0x4a')]=function(_0xf2d6dc,_0x3cbca5){if(_0xf2d6dc[_0xa680('0x49')]['id']){delete _0xf2d6dc[_0xa680('0x49')]['id'];}return db[_0xa680('0x29')]['find']({'where':{'id':_0xf2d6dc[_0xa680('0x45')]['id']}})[_0xa680('0x22')](handleEntityNotFound(_0x3cbca5,null))[_0xa680('0x22')](saveUpdates(_0xf2d6dc['body'],null))[_0xa680('0x22')](respondWithResult(_0x3cbca5,null))['catch'](handleError(_0x3cbca5,null));};exports[_0xa680('0x23')]=function(_0x4c9d99,_0x1f8a86){return db['DeskField'][_0xa680('0x47')]({'where':{'id':_0x4c9d99['params']['id']}})[_0xa680('0x22')](handleEntityNotFound(_0x1f8a86,null))['then'](removeEntity(_0x1f8a86,null))[_0xa680('0x43')](handleError(_0x1f8a86,null));}; \ No newline at end of file +var _0x069e=['send','index','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','stack','name'];(function(_0xb13d17,_0x1cd499){var _0x23c99e=function(_0x309af3){while(--_0x309af3){_0xb13d17['push'](_0xb13d17['shift']());}};_0x23c99e(++_0x1cd499);}(_0x069e,0x108));var _0xe069=function(_0x38b149,_0x34ac58){_0x38b149=_0x38b149-0x0;var _0x97edb8=_0x069e[_0x38b149];return _0x97edb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe069('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe069('0x1'));var rp=require(_0xe069('0x2'));var moment=require(_0xe069('0x3'));var BPromise=require(_0xe069('0x4'));var Mustache=require(_0xe069('0x5'));var util=require(_0xe069('0x6'));var path=require(_0xe069('0x7'));var sox=require(_0xe069('0x8'));var csv=require(_0xe069('0x9'));var ejs=require(_0xe069('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe069('0xb'));var squel=require(_0xe069('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe069('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe069('0xe'));var Papa=require(_0xe069('0xf'));var Redis=require(_0xe069('0x10'));var authService=require(_0xe069('0x11'));var qs=require(_0xe069('0x12'));var as=require(_0xe069('0x13'));var hardwareService=require(_0xe069('0x14'));var logger=require(_0xe069('0x15'))(_0xe069('0x16'));var utils=require(_0xe069('0x17'));var config=require(_0xe069('0x18'));var licenseUtil=require(_0xe069('0x19'));var db=require(_0xe069('0x1a'))['db'];function respondWithStatusCode(_0x491150,_0x12ca05){_0x12ca05=_0x12ca05||0xcc;return function(_0x299d28){if(_0x299d28){return _0x491150[_0xe069('0x1b')](_0x12ca05);}return _0x491150[_0xe069('0x1c')](_0x12ca05)[_0xe069('0x1d')]();};}function respondWithResult(_0x211945,_0xf0321a){_0xf0321a=_0xf0321a||0xc8;return function(_0x1b657e){if(_0x1b657e){return _0x211945[_0xe069('0x1c')](_0xf0321a)[_0xe069('0x1e')](_0x1b657e);}};}function respondWithFilteredResult(_0x22a978,_0x4b2ad9){return function(_0xe33b2e){if(_0xe33b2e){var _0x1604bf=typeof _0x4b2ad9['offset']==='undefined'&&typeof _0x4b2ad9[_0xe069('0x1f')]===_0xe069('0x20');var _0x155436=_0xe33b2e[_0xe069('0x21')];var _0x19c239=_0x1604bf?0x0:_0x4b2ad9[_0xe069('0x22')];var _0x339d44=_0x1604bf?_0xe33b2e['count']:_0x4b2ad9[_0xe069('0x22')]+_0x4b2ad9[_0xe069('0x1f')];var _0x4443e4;if(_0x339d44>=_0x155436){_0x339d44=_0x155436;_0x4443e4=0xc8;}else{_0x4443e4=0xce;}_0x22a978[_0xe069('0x1c')](_0x4443e4);return _0x22a978[_0xe069('0x23')]('Content-Range',_0x19c239+'-'+_0x339d44+'/'+_0x155436)[_0xe069('0x1e')](_0xe33b2e);}return null;};}function patchUpdates(_0x346194){return function(_0x2ae7b2){try{jsonpatch[_0xe069('0x24')](_0x2ae7b2,_0x346194,!![]);}catch(_0x4d90c3){return BPromise[_0xe069('0x25')](_0x4d90c3);}return _0x2ae7b2[_0xe069('0x26')]();};}function saveUpdates(_0x14a04c,_0xe2b0ff){return function(_0x33a6dc){if(_0x33a6dc){return _0x33a6dc[_0xe069('0x27')](_0x14a04c)[_0xe069('0x28')](function(_0x37c5af){return _0x37c5af;});}return null;};}function removeEntity(_0x5be8bf,_0x59f2f6){return function(_0x3cb445){if(_0x3cb445){return _0x3cb445[_0xe069('0x29')]()['then'](function(){_0x5be8bf[_0xe069('0x1c')](0xcc)[_0xe069('0x1d')]();});}};}function handleEntityNotFound(_0x738c19,_0x532841){return function(_0x465502){if(!_0x465502){_0x738c19['sendStatus'](0x194);}return _0x465502;};}function handleError(_0x2d3fcc,_0x332b2d){_0x332b2d=_0x332b2d||0x1f4;return function(_0x445404){logger['error'](_0x445404[_0xe069('0x2a')]);if(_0x445404[_0xe069('0x2b')]){delete _0x445404[_0xe069('0x2b')];}_0x2d3fcc[_0xe069('0x1c')](_0x332b2d)[_0xe069('0x2c')](_0x445404);};}exports[_0xe069('0x2d')]=function(_0x222e1a,_0x40117f){var _0x37f58e={},_0x42ea68={},_0x59f887={'count':0x0,'rows':[]};var _0x5708f6=_[_0xe069('0x2e')](db[_0xe069('0x2f')]['rawAttributes'],function(_0xa3ad85){return{'name':_0xa3ad85[_0xe069('0x30')],'type':_0xa3ad85[_0xe069('0x31')][_0xe069('0x32')]};});_0x42ea68[_0xe069('0x33')]=_[_0xe069('0x2e')](_0x5708f6,_0xe069('0x2b'));_0x42ea68[_0xe069('0x34')]=_[_0xe069('0x35')](_0x222e1a[_0xe069('0x34')]);_0x42ea68[_0xe069('0x36')]=_[_0xe069('0x37')](_0x42ea68['model'],_0x42ea68[_0xe069('0x34')]);_0x37f58e[_0xe069('0x38')]=_[_0xe069('0x37')](_0x42ea68[_0xe069('0x33')],qs['fields'](_0x222e1a[_0xe069('0x34')]['fields']));_0x37f58e[_0xe069('0x38')]=_0x37f58e[_0xe069('0x38')][_0xe069('0x39')]?_0x37f58e[_0xe069('0x38')]:_0x42ea68[_0xe069('0x33')];if(!_0x222e1a[_0xe069('0x34')][_0xe069('0x3a')]('nolimit')){_0x37f58e[_0xe069('0x1f')]=qs[_0xe069('0x1f')](_0x222e1a[_0xe069('0x34')][_0xe069('0x1f')]);_0x37f58e[_0xe069('0x22')]=qs[_0xe069('0x22')](_0x222e1a[_0xe069('0x34')][_0xe069('0x22')]);}_0x37f58e[_0xe069('0x3b')]=qs['sort'](_0x222e1a[_0xe069('0x34')]['sort']);_0x37f58e[_0xe069('0x3c')]=qs[_0xe069('0x36')](_[_0xe069('0x3d')](_0x222e1a[_0xe069('0x34')],_0x42ea68[_0xe069('0x36')]),_0x5708f6);if(_0x222e1a[_0xe069('0x34')]['filter']){_0x37f58e[_0xe069('0x3c')]=_[_0xe069('0x3e')](_0x37f58e['where'],{'$or':_[_0xe069('0x2e')](_0x5708f6,function(_0xa59022){if(_0xa59022[_0xe069('0x31')]!=='VIRTUAL'){var _0x27fc0a={};_0x27fc0a[_0xa59022[_0xe069('0x2b')]]={'$like':'%'+_0x222e1a['query'][_0xe069('0x3f')]+'%'};return _0x27fc0a;}})});}_0x37f58e=_[_0xe069('0x3e')]({},_0x37f58e,_0x222e1a[_0xe069('0x40')]);var _0x1ecc53={'where':_0x37f58e['where']};return db[_0xe069('0x2f')][_0xe069('0x21')](_0x1ecc53)[_0xe069('0x28')](function(_0x446266){_0x59f887[_0xe069('0x21')]=_0x446266;if(_0x222e1a[_0xe069('0x34')][_0xe069('0x41')]){_0x37f58e[_0xe069('0x42')]=[{'all':!![]}];}return db[_0xe069('0x2f')][_0xe069('0x43')](_0x37f58e);})[_0xe069('0x28')](function(_0x48707c){_0x59f887[_0xe069('0x44')]=_0x48707c;return _0x59f887;})[_0xe069('0x28')](respondWithFilteredResult(_0x40117f,_0x37f58e))['catch'](handleError(_0x40117f,null));};exports[_0xe069('0x45')]=function(_0x17647e,_0x1a45d3){var _0x374c01={'raw':!![],'where':{'id':_0x17647e[_0xe069('0x46')]['id']}},_0x32961e={};_0x32961e[_0xe069('0x33')]=_[_0xe069('0x35')](db[_0xe069('0x2f')][_0xe069('0x47')]);_0x32961e['query']=_['keys'](_0x17647e[_0xe069('0x34')]);_0x32961e[_0xe069('0x36')]=_[_0xe069('0x37')](_0x32961e[_0xe069('0x33')],_0x32961e['query']);_0x374c01[_0xe069('0x38')]=_['intersection'](_0x32961e[_0xe069('0x33')],qs[_0xe069('0x48')](_0x17647e[_0xe069('0x34')][_0xe069('0x48')]));_0x374c01['attributes']=_0x374c01[_0xe069('0x38')]['length']?_0x374c01[_0xe069('0x38')]:_0x32961e['model'];if(_0x17647e['query']['includeAll']){_0x374c01['include']=[{'all':!![]}];}_0x374c01=_[_0xe069('0x3e')]({},_0x374c01,_0x17647e['options']);return db[_0xe069('0x2f')][_0xe069('0x49')](_0x374c01)[_0xe069('0x28')](handleEntityNotFound(_0x1a45d3,null))[_0xe069('0x28')](respondWithResult(_0x1a45d3,null))[_0xe069('0x4a')](handleError(_0x1a45d3,null));};exports[_0xe069('0x4b')]=function(_0x416878,_0x2f57f6){return db[_0xe069('0x2f')]['create'](_0x416878[_0xe069('0x4c')],{})[_0xe069('0x28')](respondWithResult(_0x2f57f6,0xc9))[_0xe069('0x4a')](handleError(_0x2f57f6,null));};exports[_0xe069('0x27')]=function(_0x3f09c7,_0xbfc26){if(_0x3f09c7[_0xe069('0x4c')]['id']){delete _0x3f09c7[_0xe069('0x4c')]['id'];}return db['DeskField']['find']({'where':{'id':_0x3f09c7[_0xe069('0x46')]['id']}})[_0xe069('0x28')](handleEntityNotFound(_0xbfc26,null))[_0xe069('0x28')](saveUpdates(_0x3f09c7[_0xe069('0x4c')],null))[_0xe069('0x28')](respondWithResult(_0xbfc26,null))[_0xe069('0x4a')](handleError(_0xbfc26,null));};exports[_0xe069('0x29')]=function(_0x5da051,_0x4ec491){return db['DeskField']['find']({'where':{'id':_0x5da051[_0xe069('0x46')]['id']}})[_0xe069('0x28')](handleEntityNotFound(_0x4ec491,null))[_0xe069('0x28')](removeEntity(_0x4ec491,null))[_0xe069('0x4a')](handleError(_0x4ec491,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index acf3b64..5bfd094 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 _0xc178=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','define','DeskField'];(function(_0x85cb98,_0xe796de){var _0x5f0f08=function(_0x965d14){while(--_0x965d14){_0x85cb98['push'](_0x85cb98['shift']());}};_0x5f0f08(++_0xe796de);}(_0xc178,0x160));var _0x8c17=function(_0x194d48,_0x4a3333){_0x194d48=_0x194d48-0x0;var _0x242c1e=_0xc178[_0x194d48];return _0x242c1e;};'use strict';var _=require(_0x8c17('0x0'));var util=require(_0x8c17('0x1'));var logger=require(_0x8c17('0x2'))(_0x8c17('0x3'));var moment=require(_0x8c17('0x4'));var BPromise=require(_0x8c17('0x5'));var rp=require(_0x8c17('0x6'));var fs=require('fs');var path=require(_0x8c17('0x7'));var rimraf=require(_0x8c17('0x8'));var config=require('../../config/environment');var attributes=require(_0x8c17('0x9'));module['exports']=function(_0x49d74b,_0x54aa31){return _0x49d74b[_0x8c17('0xa')](_0x8c17('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x8c17('0xc'),_0x8c17('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca89=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','desk_unique_index','idField'];(function(_0x2f4a2c,_0x3919f9){var _0x16b084=function(_0x271abd){while(--_0x271abd){_0x2f4a2c['push'](_0x2f4a2c['shift']());}};_0x16b084(++_0x3919f9);}(_0xca89,0x9c));var _0x9ca8=function(_0x4ae906,_0x3089b7){_0x4ae906=_0x4ae906-0x0;var _0x1a078e=_0xca89[_0x4ae906];return _0x1a078e;};'use strict';var _=require('lodash');var util=require(_0x9ca8('0x0'));var logger=require(_0x9ca8('0x1'))(_0x9ca8('0x2'));var moment=require(_0x9ca8('0x3'));var BPromise=require(_0x9ca8('0x4'));var rp=require(_0x9ca8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ca8('0x6'));var config=require(_0x9ca8('0x7'));var attributes=require(_0x9ca8('0x8'));module[_0x9ca8('0x9')]=function(_0xd43bfb,_0x21caf4){return _0xd43bfb['define'](_0x9ca8('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x9ca8('0xb'),'fields':[_0x9ca8('0xc'),'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 09494d2..453198c 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 _0x5156=['debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','info','request\x20sent'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x5156,0x127));var _0x6515=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0x5156[_0x3ba924];return _0x4cc1df;};'use strict';var _=require(_0x6515('0x0'));var util=require(_0x6515('0x1'));var moment=require(_0x6515('0x2'));var BPromise=require(_0x6515('0x3'));var rs=require(_0x6515('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6515('0x5'))['db'];var utils=require(_0x6515('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6515('0x7'));var client=jayson[_0x6515('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe292,_0x550af4,_0x2f3857){return new BPromise(function(_0x3e8fee,_0x5c6727){return client['request'](_0x3fe292,_0x2f3857)['then'](function(_0x9c1a2b){logger[_0x6515('0x9')]('DeskField,\x20%s,\x20%s',_0x550af4,_0x6515('0xa'));logger[_0x6515('0xb')](_0x6515('0xc'),_0x550af4,_0x6515('0xa'),JSON['stringify'](_0x9c1a2b));if(_0x9c1a2b[_0x6515('0xd')]){if(_0x9c1a2b[_0x6515('0xd')][_0x6515('0xe')]===0x1f4){logger[_0x6515('0xd')](_0x6515('0xf'),_0x550af4,_0x9c1a2b[_0x6515('0xd')][_0x6515('0x10')]);return _0x5c6727(_0x9c1a2b['error'][_0x6515('0x10')]);}logger[_0x6515('0xd')](_0x6515('0xf'),_0x550af4,_0x9c1a2b[_0x6515('0xd')][_0x6515('0x10')]);return _0x3e8fee(_0x9c1a2b[_0x6515('0xd')][_0x6515('0x10')]);}else{logger[_0x6515('0x9')](_0x6515('0xf'),_0x550af4,'request\x20sent');_0x3e8fee(_0x9c1a2b[_0x6515('0x11')][_0x6515('0x10')]);}})['catch'](function(_0x1c61dc){logger[_0x6515('0xd')](_0x6515('0xf'),_0x550af4,_0x1c61dc);_0x5c6727(_0x1c61dc);});});} \ No newline at end of file +var _0x953e=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x43178c,_0x2e3782){var _0x61c8ff=function(_0x268e88){while(--_0x268e88){_0x43178c['push'](_0x43178c['shift']());}};_0x61c8ff(++_0x2e3782);}(_0x953e,0x1d2));var _0xe953=function(_0x49091a,_0x11c7e7){_0x49091a=_0x49091a-0x0;var _0x775791=_0x953e[_0x49091a];return _0x775791;};'use strict';var _=require(_0xe953('0x0'));var util=require('util');var moment=require(_0xe953('0x1'));var BPromise=require(_0xe953('0x2'));var rs=require(_0xe953('0x3'));var fs=require('fs');var Redis=require(_0xe953('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe953('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe953('0x6'));var client=jayson[_0xe953('0x7')][_0xe953('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf2f0e1,_0x25c7bd,_0x784901){return new BPromise(function(_0x181ea4,_0x340dbf){return client[_0xe953('0x9')](_0xf2f0e1,_0x784901)['then'](function(_0x30b5dd){logger[_0xe953('0xa')](_0xe953('0xb'),_0x25c7bd,_0xe953('0xc'));logger['debug'](_0xe953('0xd'),_0x25c7bd,_0xe953('0xc'),JSON[_0xe953('0xe')](_0x30b5dd));if(_0x30b5dd[_0xe953('0xf')]){if(_0x30b5dd[_0xe953('0xf')][_0xe953('0x10')]===0x1f4){logger[_0xe953('0xf')]('DeskField,\x20%s,\x20%s',_0x25c7bd,_0x30b5dd[_0xe953('0xf')][_0xe953('0x11')]);return _0x340dbf(_0x30b5dd[_0xe953('0xf')][_0xe953('0x11')]);}logger[_0xe953('0xf')](_0xe953('0xb'),_0x25c7bd,_0x30b5dd['error'][_0xe953('0x11')]);return _0x181ea4(_0x30b5dd[_0xe953('0xf')][_0xe953('0x11')]);}else{logger['info'](_0xe953('0xb'),_0x25c7bd,_0xe953('0xc'));_0x181ea4(_0x30b5dd[_0xe953('0x12')]['message']);}})[_0xe953('0x13')](function(_0x3c07b8){logger[_0xe953('0xf')]('DeskField,\x20%s,\x20%s',_0x25c7bd,_0x3c07b8);_0x340dbf(_0x3c07b8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index b3b5f72..ee15c90 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 _0x49c3=['addConfiguration','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x49c3,0x100));var _0x349c=function(_0x325f38,_0x55bee3){_0x325f38=_0x325f38-0x0;var _0x3bfb28=_0x49c3[_0x325f38];return _0x3bfb28;};'use strict';var multer=require(_0x349c('0x0'));var util=require(_0x349c('0x1'));var path=require('path');var timeout=require(_0x349c('0x2'));var express=require(_0x349c('0x3'));var router=express['Router']();var fs_extra=require(_0x349c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x349c('0x5'));var config=require(_0x349c('0x6'));var controller=require(_0x349c('0x7'));router[_0x349c('0x8')]('/',auth['isAuthenticated'](),controller[_0x349c('0x9')]);router['get'](_0x349c('0xa'),auth[_0x349c('0xb')](),controller[_0x349c('0xc')]);router[_0x349c('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x349c('0xd')]);router[_0x349c('0x8')](_0x349c('0xe'),auth[_0x349c('0xb')](),controller[_0x349c('0xf')]);router[_0x349c('0x10')]('/',auth[_0x349c('0xb')](),controller['create']);router['post']('/:id/configurations',auth[_0x349c('0xb')](),controller[_0x349c('0x11')]);router[_0x349c('0x12')](_0x349c('0xa'),auth[_0x349c('0xb')](),controller['update']);router[_0x349c('0x13')](_0x349c('0xa'),auth[_0x349c('0xb')](),controller['destroy']);module[_0x349c('0x14')]=router; \ No newline at end of file +var _0x1604=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1604,0x179));var _0x4160=function(_0x5a9cf7,_0x30381c){_0x5a9cf7=_0x5a9cf7-0x0;var _0x27ece9=_0x1604[_0x5a9cf7];return _0x27ece9;};'use strict';var multer=require('multer');var util=require(_0x4160('0x0'));var path=require('path');var timeout=require(_0x4160('0x1'));var express=require(_0x4160('0x2'));var router=express[_0x4160('0x3')]();var fs_extra=require(_0x4160('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4160('0x5'));var controller=require(_0x4160('0x6'));router[_0x4160('0x7')]('/',auth[_0x4160('0x8')](),controller[_0x4160('0x9')]);router[_0x4160('0x7')](_0x4160('0xa'),auth[_0x4160('0x8')](),controller[_0x4160('0xb')]);router[_0x4160('0x7')](_0x4160('0xc'),auth[_0x4160('0x8')](),controller[_0x4160('0xd')]);router[_0x4160('0x7')](_0x4160('0xe'),auth[_0x4160('0x8')](),controller['getFields']);router['post']('/',auth[_0x4160('0x8')](),controller[_0x4160('0xf')]);router[_0x4160('0x10')](_0x4160('0xc'),auth['isAuthenticated'](),controller[_0x4160('0x11')]);router[_0x4160('0x12')](_0x4160('0xa'),auth['isAuthenticated'](),controller[_0x4160('0x13')]);router['delete'](_0x4160('0xa'),auth[_0x4160('0x8')](),controller[_0x4160('0x14')]);module[_0x4160('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 624928e..21fa0e5 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 _0x9973=['STRING','exports'];(function(_0x308b13,_0x4d9a91){var _0x450b3d=function(_0x163000){while(--_0x163000){_0x308b13['push'](_0x308b13['shift']());}};_0x450b3d(++_0x4d9a91);}(_0x9973,0x157));var _0x3997=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9973[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x3997('0x0')]={'name':{'type':Sequelize[_0x3997('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3997('0x1')]},'remoteUri':{'type':Sequelize[_0x3997('0x1')]},'tenantId':{'type':Sequelize[_0x3997('0x1')]},'clientId':{'type':Sequelize[_0x3997('0x1')]},'clientSecret':{'type':Sequelize[_0x3997('0x1')]},'serverUrl':{'type':Sequelize[_0x3997('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3997('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xd7c3=['sequelize','exports','STRING'];(function(_0x23d12f,_0x34e58c){var _0x437025=function(_0x5c27ab){while(--_0x5c27ab){_0x23d12f['push'](_0x23d12f['shift']());}};_0x437025(++_0x34e58c);}(_0xd7c3,0x1c5));var _0x3d7c=function(_0x28d427,_0xf210d0){_0x28d427=_0x28d427-0x0;var _0xa5fbae=_0xd7c3[_0x28d427];return _0xa5fbae;};'use strict';var Sequelize=require(_0x3d7c('0x0'));module[_0x3d7c('0x1')]={'name':{'type':Sequelize[_0x3d7c('0x2')]},'username':{'type':Sequelize[_0x3d7c('0x2')]},'password':{'type':Sequelize[_0x3d7c('0x2')]},'remoteUri':{'type':Sequelize[_0x3d7c('0x2')]},'tenantId':{'type':Sequelize[_0x3d7c('0x2')]},'clientId':{'type':Sequelize[_0x3d7c('0x2')]},'clientSecret':{'type':Sequelize[_0x3d7c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3d7c('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 75cdfc4..c6bf644 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 _0x5fcf=['CloudProvider','data5','POST','https://login.microsoftonline.com/','/oauth2/token','username','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','remove','LogicalName','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','forEach','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','GET','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','ticketType','Incident','PhoneCall','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data7','access_token'];(function(_0x15c19a,_0xd4667b){var _0x3290d9=function(_0x1c533d){while(--_0x1c533d){_0x15c19a['push'](_0x15c19a['shift']());}};_0x3290d9(++_0xd4667b);}(_0x5fcf,0xf3));var _0xf5fc=function(_0x51a34f,_0x390f0b){_0x51a34f=_0x51a34f-0x0;var _0x28a736=_0x5fcf[_0x51a34f];return _0x28a736;};'use strict';var rp=require(_0xf5fc('0x0'));var util=require(_0xf5fc('0x1'));var _=require(_0xf5fc('0x2'));var qs=require(_0xf5fc('0x3'));var logger=require('../../config/logger')(_0xf5fc('0x4'));var db=require(_0xf5fc('0x5'))['db'];var integrations=require(_0xf5fc('0x6'));function respondWithResult(_0x6f41f0,_0x5de763){_0x5de763=_0x5de763||0xc8;return function(_0x33cb00){if(_0x33cb00){return _0x6f41f0[_0xf5fc('0x7')](_0x5de763)[_0xf5fc('0x8')](_0x33cb00);}};}function respondWithFilteredResult(_0x20d96f,_0x3a876b){return function(_0x5453dc){if(_0x5453dc){var _0x4a6449=typeof _0x3a876b[_0xf5fc('0x9')]===_0xf5fc('0xa')&&typeof _0x3a876b[_0xf5fc('0xb')]===_0xf5fc('0xa');var _0x13621e=_0x5453dc['count'];var _0x37d4b6=_0x4a6449?0x0:_0x3a876b[_0xf5fc('0x9')];var _0x3a8aa1=_0x4a6449?_0x5453dc[_0xf5fc('0xc')]:_0x3a876b[_0xf5fc('0x9')]+_0x3a876b[_0xf5fc('0xb')];var _0x378547;if(_0x3a8aa1>=_0x13621e){_0x3a8aa1=_0x13621e;_0x378547=0xc8;}else{_0x378547=0xce;}_0x20d96f['status'](_0x378547);return _0x20d96f[_0xf5fc('0xd')](_0xf5fc('0xe'),_0x37d4b6+'-'+_0x3a8aa1+'/'+_0x13621e)['json'](_0x5453dc);}return null;};}function saveUpdates(_0x53a1f8){return function(_0x5eb235){if(_0x5eb235){return _0x5eb235[_0xf5fc('0xf')](_0x53a1f8)[_0xf5fc('0x10')](function(_0x553911){return _0x553911;});}return null;};}function removeEntity(_0x10edbc){return function(_0x250c68){if(_0x250c68){return _0x250c68[_0xf5fc('0x11')]()[_0xf5fc('0x10')](function(){_0x10edbc[_0xf5fc('0x7')](0xcc)[_0xf5fc('0x12')]();});}};}function handleEntityNotFound(_0x127d61){return function(_0x1e924a){if(!_0x1e924a){_0x127d61[_0xf5fc('0x13')](0x194);}return _0x1e924a;};}function handleError(_0x1d2c01,_0x107a57){_0x107a57=_0x107a57||0x1f4;return function(_0x242e6e){logger[_0xf5fc('0x14')](_0x242e6e[_0xf5fc('0x15')]);if(_0x242e6e['name']){delete _0x242e6e[_0xf5fc('0x16')];}_0x1d2c01[_0xf5fc('0x7')](_0x107a57)[_0xf5fc('0x17')](_0x242e6e);};}exports[_0xf5fc('0x18')]=function(_0x15a9aa,_0x464aa1){var _0x351511={},_0xb092d3={},_0x398ac8={'count':0x0,'rows':[]};var _0x17776c=_[_0xf5fc('0x19')](db['Dynamics365Account'][_0xf5fc('0x1a')],function(_0x55c8e9){return{'name':_0x55c8e9['fieldName'],'type':_0x55c8e9[_0xf5fc('0x1b')][_0xf5fc('0x1c')]};});_0xb092d3[_0xf5fc('0x1d')]=_[_0xf5fc('0x19')](_0x17776c,_0xf5fc('0x16'));_0xb092d3[_0xf5fc('0x1e')]=_['keys'](_0x15a9aa['query']);_0xb092d3[_0xf5fc('0x1f')]=_[_0xf5fc('0x20')](_0xb092d3[_0xf5fc('0x1d')],_0xb092d3[_0xf5fc('0x1e')]);_0x351511['attributes']=_[_0xf5fc('0x20')](_0xb092d3['model'],qs['fields'](_0x15a9aa['query'][_0xf5fc('0x21')]));_0x351511[_0xf5fc('0x22')]=_0x351511[_0xf5fc('0x22')]['length']?_0x351511[_0xf5fc('0x22')]:_0xb092d3['model'];if(!_0x15a9aa[_0xf5fc('0x1e')]['hasOwnProperty'](_0xf5fc('0x23'))){_0x351511[_0xf5fc('0xb')]=qs[_0xf5fc('0xb')](_0x15a9aa[_0xf5fc('0x1e')][_0xf5fc('0xb')]);_0x351511['offset']=qs[_0xf5fc('0x9')](_0x15a9aa['query']['offset']);}_0x351511[_0xf5fc('0x24')]=qs['sort'](_0x15a9aa[_0xf5fc('0x1e')][_0xf5fc('0x25')]);_0x351511[_0xf5fc('0x26')]=qs[_0xf5fc('0x1f')](_[_0xf5fc('0x27')](_0x15a9aa['query'],_0xb092d3['filters']),_0x17776c);if(_0x15a9aa[_0xf5fc('0x1e')][_0xf5fc('0x28')]){_0x351511[_0xf5fc('0x26')]=_[_0xf5fc('0x29')](_0x351511[_0xf5fc('0x26')],{'$or':_[_0xf5fc('0x19')](_0x17776c,function(_0x4201c8){if(_0x4201c8['type']!==_0xf5fc('0x2a')){var _0x415fec={};_0x415fec[_0x4201c8[_0xf5fc('0x16')]]={'$like':'%'+_0x15a9aa['query'][_0xf5fc('0x28')]+'%'};return _0x415fec;}})});}_0x351511=_[_0xf5fc('0x29')]({},_0x351511,_0x15a9aa[_0xf5fc('0x2b')]);var _0x39b699={'where':_0x351511[_0xf5fc('0x26')]};return db[_0xf5fc('0x2c')][_0xf5fc('0xc')](_0x39b699)[_0xf5fc('0x10')](function(_0x3a1553){_0x398ac8['count']=_0x3a1553;if(_0x15a9aa['query'][_0xf5fc('0x2d')]){_0x351511[_0xf5fc('0x2e')]=[{'all':!![]}];}return db[_0xf5fc('0x2c')][_0xf5fc('0x2f')](_0x351511);})['then'](function(_0x2b06bb){_0x398ac8[_0xf5fc('0x30')]=_0x2b06bb;return _0x398ac8;})[_0xf5fc('0x10')](respondWithFilteredResult(_0x464aa1,_0x351511))[_0xf5fc('0x31')](handleError(_0x464aa1,null));};exports[_0xf5fc('0x32')]=function(_0x5861b7,_0x10abbe){var _0x38a583={'raw':![],'where':{'id':_0x5861b7[_0xf5fc('0x33')]['id']}},_0x39ce31={};_0x39ce31[_0xf5fc('0x1d')]=_['keys'](db[_0xf5fc('0x2c')][_0xf5fc('0x1a')]);_0x39ce31[_0xf5fc('0x1e')]=_[_0xf5fc('0x34')](_0x5861b7[_0xf5fc('0x1e')]);_0x39ce31[_0xf5fc('0x1f')]=_['intersection'](_0x39ce31[_0xf5fc('0x1d')],_0x39ce31['query']);_0x38a583['attributes']=_['intersection'](_0x39ce31[_0xf5fc('0x1d')],qs[_0xf5fc('0x21')](_0x5861b7[_0xf5fc('0x1e')]['fields']));_0x38a583[_0xf5fc('0x22')]=_0x38a583[_0xf5fc('0x22')][_0xf5fc('0x35')]?_0x38a583[_0xf5fc('0x22')]:_0x39ce31[_0xf5fc('0x1d')];if(_0x5861b7[_0xf5fc('0x1e')][_0xf5fc('0x2d')]){_0x38a583[_0xf5fc('0x2e')]=[{'all':!![]}];}_0x38a583=_[_0xf5fc('0x29')]({},_0x38a583,_0x5861b7[_0xf5fc('0x2b')]);return db['Dynamics365Account'][_0xf5fc('0x36')](_0x38a583)[_0xf5fc('0x10')](handleEntityNotFound(_0x10abbe,null))[_0xf5fc('0x10')](respondWithResult(_0x10abbe,null))[_0xf5fc('0x31')](handleError(_0x10abbe,null));};exports['create']=function(_0x45ceae,_0x1ac543){return db[_0xf5fc('0x2c')][_0xf5fc('0x37')](_0x45ceae[_0xf5fc('0x38')],{})[_0xf5fc('0x10')](respondWithResult(_0x1ac543,0xc9))['catch'](handleError(_0x1ac543,null));};exports['update']=function(_0x115936,_0x39e959){if(_0x115936[_0xf5fc('0x38')]['id']){delete _0x115936[_0xf5fc('0x38')]['id'];}return db[_0xf5fc('0x2c')][_0xf5fc('0x36')]({'where':{'id':_0x115936[_0xf5fc('0x33')]['id']}})['then'](handleEntityNotFound(_0x39e959,null))[_0xf5fc('0x10')](saveUpdates(_0x115936['body'],null))[_0xf5fc('0x10')](respondWithResult(_0x39e959,null))[_0xf5fc('0x31')](handleError(_0x39e959,null));};exports[_0xf5fc('0x11')]=function(_0x5173ec,_0x3d76fb){return db[_0xf5fc('0x2c')]['find']({'where':{'id':_0x5173ec[_0xf5fc('0x33')]['id']}})[_0xf5fc('0x10')](handleEntityNotFound(_0x3d76fb,null))['then'](removeEntity(_0x3d76fb,null))['catch'](handleError(_0x3d76fb,null));};exports[_0xf5fc('0x39')]=function(_0x496ccb,_0x5f50bb){var _0x536f98={};var _0x4dabe1={};var _0x18e64a;var _0x3ef694;return db[_0xf5fc('0x2c')][_0xf5fc('0x3a')]({'where':{'id':_0x496ccb[_0xf5fc('0x33')]['id']}})[_0xf5fc('0x10')](handleEntityNotFound(_0x5f50bb,null))['then'](function(_0x555763){if(_0x555763){_0x18e64a=_0x555763;_0x4dabe1[_0xf5fc('0x1d')]=_['keys'](db[_0xf5fc('0x3b')]['rawAttributes']);_0x4dabe1[_0xf5fc('0x1e')]=_[_0xf5fc('0x34')](_0x496ccb[_0xf5fc('0x1e')]);_0x4dabe1[_0xf5fc('0x1f')]=_[_0xf5fc('0x20')](_0x4dabe1[_0xf5fc('0x1d')],_0x4dabe1[_0xf5fc('0x1e')]);_0x536f98[_0xf5fc('0x22')]=_[_0xf5fc('0x20')](_0x4dabe1[_0xf5fc('0x1d')],qs['fields'](_0x496ccb[_0xf5fc('0x1e')][_0xf5fc('0x21')]));_0x536f98[_0xf5fc('0x22')]=_0x536f98[_0xf5fc('0x22')][_0xf5fc('0x35')]?_0x536f98[_0xf5fc('0x22')]:_0x4dabe1[_0xf5fc('0x1d')];_0x536f98[_0xf5fc('0x24')]=qs[_0xf5fc('0x25')](_0x496ccb[_0xf5fc('0x1e')]['sort']);_0x536f98['where']=qs[_0xf5fc('0x1f')](_['pick'](_0x496ccb['query'],_0x4dabe1[_0xf5fc('0x1f')]));if(_0x496ccb[_0xf5fc('0x1e')][_0xf5fc('0x28')]){_0x536f98[_0xf5fc('0x26')]=_[_0xf5fc('0x29')](_0x536f98[_0xf5fc('0x26')],{'$or':_[_0xf5fc('0x19')](_0x536f98[_0xf5fc('0x22')],function(_0xf27101){var _0x19d0ec={};_0x19d0ec[_0xf27101]={'$like':'%'+_0x496ccb[_0xf5fc('0x1e')][_0xf5fc('0x28')]+'%'};return _0x19d0ec;})});}_0x536f98=_[_0xf5fc('0x29')]({},_0x536f98,_0x496ccb[_0xf5fc('0x2b')]);return _0x18e64a[_0xf5fc('0x39')](_0x536f98);}})[_0xf5fc('0x10')](function(_0xf3f7b1){if(_0xf3f7b1){_0x3ef694=_0xf3f7b1[_0xf5fc('0x35')];if(!_0x496ccb[_0xf5fc('0x1e')][_0xf5fc('0x3c')]('nolimit')){_0x536f98['limit']=qs[_0xf5fc('0xb')](_0x496ccb['query'][_0xf5fc('0xb')]);_0x536f98[_0xf5fc('0x9')]=qs[_0xf5fc('0x9')](_0x496ccb[_0xf5fc('0x1e')][_0xf5fc('0x9')]);}return _0x18e64a[_0xf5fc('0x39')](_0x536f98);}})['then'](function(_0x268966){if(_0x268966){return _0x268966?{'count':_0x3ef694,'rows':_0x268966}:null;}})[_0xf5fc('0x10')](respondWithResult(_0x5f50bb,null))[_0xf5fc('0x31')](handleError(_0x5f50bb,null));};exports[_0xf5fc('0x3d')]=function(_0x53b222,_0x1f38d7){if(_0x53b222['body']['id']){delete _0x53b222[_0xf5fc('0x38')]['id'];}return db[_0xf5fc('0x2c')]['findOne']({'where':{'id':_0x53b222[_0xf5fc('0x33')]['id']}})[_0xf5fc('0x10')](handleEntityNotFound(_0x1f38d7,null))[_0xf5fc('0x10')](function(_0x1be55b){if(_0x1be55b){_0x53b222[_0xf5fc('0x38')]['AccountId']=_0x1be55b['id'];_0x53b222[_0xf5fc('0x38')][_0xf5fc('0x3e')]=integrations[_0xf5fc('0x3f')](_0x53b222[_0xf5fc('0x38')][_0xf5fc('0x40')],_0x53b222[_0xf5fc('0x38')][_0xf5fc('0x1b')]);_0x53b222[_0xf5fc('0x38')]['Descriptions']=integrations['getDescriptions'](_0x53b222[_0xf5fc('0x38')][_0xf5fc('0x40')],_0x53b222[_0xf5fc('0x38')][_0xf5fc('0x1b')]);return db['Dynamics365Configuration'][_0xf5fc('0x37')](_0x53b222[_0xf5fc('0x38')],{'include':[{'model':db[_0xf5fc('0x41')],'as':_0xf5fc('0x3e')},{'model':db[_0xf5fc('0x41')],'as':_0xf5fc('0x42')}]});}return null;})['then'](respondWithResult(_0x1f38d7,null))[_0xf5fc('0x31')](handleError(_0x1f38d7,null));};function sanitizeRemoteUri(_0x4fa0e0){var _0x1276d0=_0x4fa0e0[_0xf5fc('0x43')](-0x1);if(_0x1276d0==='/')return _0x4fa0e0[_0xf5fc('0x44')](0x0,_0x4fa0e0[_0xf5fc('0x45')](_0x1276d0));return _0x4fa0e0;}function getWebApiUrl(_0x512f1c){return util[_0xf5fc('0x46')](_0xf5fc('0x47'),_0x512f1c);}exports['getFields']=function(_0xda327,_0x30f2e2){var _0x448f73=_0xda327[_0xf5fc('0x1e')][_0xf5fc('0x48')];var _0x12658a=_0x448f73==='incident'?_0xf5fc('0x49'):_0xf5fc('0x4a');var _0x2b91b6='';var _0x590ca2='';var _0x1ef827='';var _0x567e91='';var _0x3ecb18='';var _0x45f1cb='';var _0x173864='';var _0x1f9961='';var _0x25378d=['title','description','customerid',_0xf5fc('0x4b'),_0xf5fc('0x4c'),_0xf5fc('0x4d'),_0xf5fc('0x4e'),_0xf5fc('0x4f'),_0xf5fc('0x50'),_0xf5fc('0x51')];var _0x11087b=[_0xf5fc('0x52'),_0xf5fc('0x53'),_0xf5fc('0x54'),_0xf5fc('0x55'),_0xf5fc('0x56'),_0xf5fc('0x57'),_0xf5fc('0x58'),_0xf5fc('0x59'),'createdbyexternalpartyname',_0xf5fc('0x5a'),'createdbyname','createdbyyominame','createdon',_0xf5fc('0x5b'),_0xf5fc('0x5c'),_0xf5fc('0x5d'),_0xf5fc('0x5e'),_0xf5fc('0x5f'),'emailaddress',_0xf5fc('0x60'),_0xf5fc('0x61'),_0xf5fc('0x62'),_0xf5fc('0x63'),_0xf5fc('0x64'),_0xf5fc('0x65'),_0xf5fc('0x66'),_0xf5fc('0x67'),_0xf5fc('0x68'),_0xf5fc('0x69'),_0xf5fc('0x6a'),_0xf5fc('0x6b'),'modifiedbyexternalpartyname',_0xf5fc('0x6c'),_0xf5fc('0x6d'),_0xf5fc('0x6e'),'modifiedon','modifiedonbehalfbyname',_0xf5fc('0x6f'),_0xf5fc('0x70'),_0xf5fc('0x71'),_0xf5fc('0x72'),'onholdtime',_0xf5fc('0x73'),_0xf5fc('0x74'),_0xf5fc('0x75'),_0xf5fc('0x76'),_0xf5fc('0x77'),_0xf5fc('0x78'),'primarycontactidyominame',_0xf5fc('0x79'),_0xf5fc('0x7a'),_0xf5fc('0x7b'),_0xf5fc('0x7c'),_0xf5fc('0x7d'),_0xf5fc('0x7e'),_0xf5fc('0x7f'),_0xf5fc('0x80'),_0xf5fc('0x81'),_0xf5fc('0x82'),_0xf5fc('0x83'),_0xf5fc('0x84'),'statecode',_0xf5fc('0x85'),_0xf5fc('0x86'),_0xf5fc('0x87'),_0xf5fc('0x88'),'transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber'];var _0x1da61f=_0x25378d['concat'](_0x11087b);return db['Dynamics365Account'][_0xf5fc('0x3a')]({'where':{'id':_0xda327[_0xf5fc('0x33')]['id']},'attributes':['id','username',_0xf5fc('0x89'),_0xf5fc('0x8a'),_0xf5fc('0x8b'),_0xf5fc('0x8c'),_0xf5fc('0x8d'),_0xf5fc('0x8e')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id','data5',_0xf5fc('0x8f')]}]})[_0xf5fc('0x10')](handleEntityNotFound(_0x30f2e2,null))['then'](function(_0x1c4744){if(_0x1c4744){if(_0x1c4744[_0xf5fc('0x8e')]){_0x1c4744[_0xf5fc('0x90')]=_0x1c4744[_0xf5fc('0x91')][_0xf5fc('0x92')];_0x1f9961=sanitizeRemoteUri(_0x1c4744[_0xf5fc('0x91')][_0xf5fc('0x8f')]);_0x173864=getWebApiUrl(_0x1f9961);return _0x1c4744;}_0x1f9961=sanitizeRemoteUri(_0x1c4744[_0xf5fc('0x8a')]);_0x173864=getWebApiUrl(_0x1f9961);var _0x54227c={'method':_0xf5fc('0x93'),'uri':_0xf5fc('0x94')+_0x1c4744['tenantId']+_0xf5fc('0x95'),'form':{'client_id':_0x1c4744[_0xf5fc('0x8c')],'resource':_0x1f9961,'username':_0x1c4744[_0xf5fc('0x96')],'password':_0x1c4744[_0xf5fc('0x89')],'grant_type':'password','client_secret':_0x1c4744[_0xf5fc('0x8d')]},'json':!![]};return rp(_0x54227c);}})[_0xf5fc('0x10')](function(_0x388c7c){_0x45f1cb=_0x388c7c[_0xf5fc('0x90')];var _0x2bb804={'method':'GET','uri':encodeURI(_0x173864+_0xf5fc('0x97')+_0x12658a+'\x27'),'headers':{'Authorization':_0xf5fc('0x98')+_0x45f1cb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x2bb804);})['then'](function(_0x2f665a){var _0x1bbc3c=_0x2f665a[_0xf5fc('0x99')][0x0];var _0x207383=_0x1bbc3c['MetadataId'];var _0x2a9c3c={'method':'GET','uri':_0x173864+'EntityDefinitions('+_0x207383+_0xf5fc('0x9a'),'headers':{'Authorization':_0xf5fc('0x98')+_0x45f1cb,'If-None-Match':null,'OData-Version':_0xf5fc('0x9b')},'json':!![]};return rp(_0x2a9c3c);})[_0xf5fc('0x10')](function(_0x18c7dc){_0x2b91b6=_0x18c7dc;_0x590ca2=_0x2b91b6['Attributes'];_0x590ca2=_[_0xf5fc('0x9c')](_0x590ca2,function(_0x44ac60){return!_0x1da61f['includes'](_0x44ac60[_0xf5fc('0x9d')]);});var _0xcec58d=[];var _0x40eeb0=[];_0x590ca2['forEach'](function(_0x368f3f){if(_0x368f3f[_0xf5fc('0x9e')]){var _0x51fa0e=_0x368f3f[_0xf5fc('0x9e')]['substring'](_0x368f3f[_0xf5fc('0x9e')][_0xf5fc('0x45')]('.')+0x1);if(_0x51fa0e===_0xf5fc('0x9f')){_0xcec58d[_0xf5fc('0xa0')](getSelectList(_0x173864,_0x448f73,_0x40eeb0,_0x2b91b6['MetadataId'],_0x368f3f[_0xf5fc('0xa1')],_0x45f1cb));}}});return Promise[_0xf5fc('0xa2')](_0xcec58d);})[_0xf5fc('0x10')](function(_0x458164){_0x1ef827=_0x458164[0x0];var _0x3de9f8=[];var _0x5065df=[];_0x590ca2[_0xf5fc('0xa3')](function(_0x4dce9f){if(!_[_0xf5fc('0xa4')](_0x4dce9f[_0xf5fc('0x9e')])){var _0x2091e9=_0x4dce9f[_0xf5fc('0x9e')][_0xf5fc('0x44')](_0x4dce9f[_0xf5fc('0x9e')]['lastIndexOf']('.')+0x1);if(_0x2091e9===_0xf5fc('0xa5')){_0x3de9f8[_0xf5fc('0xa0')](getBooleanList(_0x173864,_0x448f73,_0x5065df,_0x2b91b6[_0xf5fc('0xa1')],_0x4dce9f[_0xf5fc('0xa1')],_0x45f1cb));}}});return Promise[_0xf5fc('0xa2')](_0x3de9f8);})[_0xf5fc('0x10')](function(_0x41e3c1){_0x567e91=_0x41e3c1[0x0];var _0x2354a7=[];var _0xed162c=[];_0x590ca2['forEach'](function(_0x41489b){if(_0x41489b[_0xf5fc('0x9e')]){var _0x59eb68=_0x41489b[_0xf5fc('0x9e')][_0xf5fc('0x44')](_0x41489b['@odata.type'][_0xf5fc('0x45')]('.')+0x1);if(_0x59eb68===_0xf5fc('0xa6')||_0x59eb68===_0xf5fc('0xa7')||_0x59eb68===_0xf5fc('0xa8')||_0x59eb68===_0xf5fc('0xa9')||_0x59eb68===_0xf5fc('0xaa')||_0x59eb68==='DateTimeAttributeMetadata'||_0x59eb68===_0xf5fc('0xab')||_0x59eb68==='EntityNameAttributeMetadata'||_0x59eb68===_0xf5fc('0xac')||_0x59eb68===_0xf5fc('0xad')){_0x2354a7[_0xf5fc('0xa0')](getInputList(_0x173864,_0x448f73,_0x59eb68,_0xed162c,_0x2b91b6['MetadataId'],_0x41489b['MetadataId'],_0x45f1cb));}}});return Promise[_0xf5fc('0xa2')](_0x2354a7);})[_0xf5fc('0x10')](function(_0x5bb56e){_0x3ecb18=_0x5bb56e[0x0];var _0x29861c=_0x1ef827['concat'](_0x567e91)['concat'](_0x3ecb18);var _0x553d12={'count':_0x29861c[_0xf5fc('0x35')],'rows':_0x29861c};return _0x553d12;})[_0xf5fc('0x10')](respondWithResult(_0x30f2e2,null))[_0xf5fc('0x31')](function(_0x206842){var _0x1ad856=_0xda327[_0xf5fc('0x1e')][_0xf5fc('0xae')]?0x1f4:_0x206842['statusCode']||0x1f4;logger[_0xf5fc('0x14')](_0x206842[_0xf5fc('0x15')]);delete _0x206842[_0xf5fc('0x16')];if(_0x1ad856===0x191){_0x1ad856=0x190;}_0x30f2e2[_0xf5fc('0x7')](_0x1ad856)[_0xf5fc('0x17')](_0xda327[_0xf5fc('0x1e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x206842[_0xf5fc('0xaf')]}:_0x206842);});};function getSelectList(_0x4eb365,_0x52f454,_0xb17fd9,_0x415198,_0x214a6d,_0x1b9391){var _0xf36306={'method':_0xf5fc('0xb0'),'uri':_0x4eb365+_0xf5fc('0xb1')+_0x415198+')/Attributes('+_0x214a6d+_0xf5fc('0xb2')+_0xf5fc('0xb3'),'headers':{'Authorization':'Bearer\x20'+_0x1b9391,'If-None-Match':null,'OData-Version':_0xf5fc('0x9b')},'json':!![]};return rp(_0xf36306)['then'](function(_0x2cc08d){var _0x41aafd=[];var _0x548d50=_0x2cc08d['OptionSet'][_0xf5fc('0xb4')];_0x548d50['forEach'](function(_0xd01f20){_0x41aafd[_0xf5fc('0xa0')]({'name':_0xd01f20[_0xf5fc('0xb5')][_0xf5fc('0xb6')][_0xf5fc('0xb5')],'value':String(_0xd01f20[_0xf5fc('0xb7')])});});var _0x4b0b19={'id':_0x52f454+'_'+_0x2cc08d[_0xf5fc('0x9d')],'name':_0x2cc08d[_0xf5fc('0xb8')][_0xf5fc('0xb6')][_0xf5fc('0xb5')],'custom':![],'options':_0x41aafd};_0xb17fd9[_0xf5fc('0xa0')](_0x4b0b19);return _0xb17fd9;});}function getBooleanList(_0x29914e,_0x2a92a5,_0x32c963,_0x2b6014,_0x21f2c6,_0x36d643){var _0x1f5ee4={'method':_0xf5fc('0xb0'),'uri':_0x29914e+_0xf5fc('0xb1')+_0x2b6014+_0xf5fc('0xb9')+_0x21f2c6+_0xf5fc('0xba'),'headers':{'Authorization':_0xf5fc('0x98')+_0x36d643,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f5ee4)[_0xf5fc('0x10')](function(_0x324fff){var _0x151c66=[];_0x151c66['push']({'name':_0x324fff[_0xf5fc('0xbb')][_0xf5fc('0xbc')][_0xf5fc('0xb5')][_0xf5fc('0xb6')][_0xf5fc('0xb5')],'value':_0xf5fc('0xbd')},{'name':_0x324fff['OptionSet'][_0xf5fc('0xbe')][_0xf5fc('0xb5')][_0xf5fc('0xb6')]['Label'],'value':_0xf5fc('0xbf')});var _0x37e0ad={'id':_0x2a92a5+'_'+_0x324fff[_0xf5fc('0x9d')],'name':_0x324fff[_0xf5fc('0xb8')][_0xf5fc('0xb6')][_0xf5fc('0xb5')],'custom':![],'options':_0x151c66};_0x32c963[_0xf5fc('0xa0')](_0x37e0ad);return _0x32c963;});}function getInputList(_0x5061d2,_0x11a39b,_0x1f11b9,_0x208565,_0x5c885e,_0x41a1b9,_0x418ad9){var _0x4b6283={'method':_0xf5fc('0xb0'),'uri':_0x5061d2+_0xf5fc('0xb1')+_0x5c885e+_0xf5fc('0xb9')+_0x41a1b9+_0xf5fc('0xc0')+_0x1f11b9+_0xf5fc('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x418ad9,'If-None-Match':null,'OData-Version':_0xf5fc('0x9b')},'json':!![]};return rp(_0x4b6283)['then'](function(_0x3b6a60){var _0x33786c={'id':_0x11a39b+'_'+_0x3b6a60[_0xf5fc('0x9d')],'name':_0x3b6a60[_0xf5fc('0xb8')][_0xf5fc('0xb6')]?_0x3b6a60['DisplayName'][_0xf5fc('0xb6')]['Label']:_0x3b6a60['LogicalName'],'custom':![],'options':[]};_0x208565[_0xf5fc('0xa0')](_0x33786c);return _0x208565;});} \ No newline at end of file +var _0x2a62=['overriddencreatedon','owneridname','owneridtype','owneridyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','data7','access_token','CloudProvider','data5','POST','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','error','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','request-promise','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','update','then','end','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','Dynamics365Account','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','customerid','ownerid','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents'];(function(_0xcc0955,_0x58a9dc){var _0x35a368=function(_0x4d6233){while(--_0x4d6233){_0xcc0955['push'](_0xcc0955['shift']());}};_0x35a368(++_0x58a9dc);}(_0x2a62,0x111));var _0x22a6=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x2a62[_0x279d37];return _0x530173;};'use strict';var rp=require(_0x22a6('0x0'));var util=require('util');var _=require(_0x22a6('0x1'));var qs=require(_0x22a6('0x2'));var logger=require(_0x22a6('0x3'))(_0x22a6('0x4'));var db=require(_0x22a6('0x5'))['db'];var integrations=require(_0x22a6('0x6'));function respondWithResult(_0xaf5bc4,_0x295f00){_0x295f00=_0x295f00||0xc8;return function(_0x100093){if(_0x100093){return _0xaf5bc4[_0x22a6('0x7')](_0x295f00)[_0x22a6('0x8')](_0x100093);}};}function respondWithFilteredResult(_0x1a7818,_0x25a8e3){return function(_0x43c2fd){if(_0x43c2fd){var _0xe66883=typeof _0x25a8e3[_0x22a6('0x9')]===_0x22a6('0xa')&&typeof _0x25a8e3[_0x22a6('0xb')]===_0x22a6('0xa');var _0x12d4d4=_0x43c2fd[_0x22a6('0xc')];var _0x9994bd=_0xe66883?0x0:_0x25a8e3[_0x22a6('0x9')];var _0x4a8360=_0xe66883?_0x43c2fd[_0x22a6('0xc')]:_0x25a8e3[_0x22a6('0x9')]+_0x25a8e3[_0x22a6('0xb')];var _0x197d67;if(_0x4a8360>=_0x12d4d4){_0x4a8360=_0x12d4d4;_0x197d67=0xc8;}else{_0x197d67=0xce;}_0x1a7818[_0x22a6('0x7')](_0x197d67);return _0x1a7818[_0x22a6('0xd')]('Content-Range',_0x9994bd+'-'+_0x4a8360+'/'+_0x12d4d4)['json'](_0x43c2fd);}return null;};}function saveUpdates(_0x5618d9){return function(_0x4b9949){if(_0x4b9949){return _0x4b9949[_0x22a6('0xe')](_0x5618d9)[_0x22a6('0xf')](function(_0x4678e9){return _0x4678e9;});}return null;};}function removeEntity(_0x4b1b43){return function(_0x174d7a){if(_0x174d7a){return _0x174d7a['destroy']()[_0x22a6('0xf')](function(){_0x4b1b43[_0x22a6('0x7')](0xcc)[_0x22a6('0x10')]();});}};}function handleEntityNotFound(_0x265511){return function(_0x511c9c){if(!_0x511c9c){_0x265511['sendStatus'](0x194);}return _0x511c9c;};}function handleError(_0x514450,_0x256451){_0x256451=_0x256451||0x1f4;return function(_0x3c7faa){logger['error'](_0x3c7faa[_0x22a6('0x11')]);if(_0x3c7faa[_0x22a6('0x12')]){delete _0x3c7faa['name'];}_0x514450[_0x22a6('0x7')](_0x256451)[_0x22a6('0x13')](_0x3c7faa);};}exports[_0x22a6('0x14')]=function(_0x54c1a5,_0x5e0c73){var _0x2a223b={},_0x558373={},_0x749beb={'count':0x0,'rows':[]};var _0x5dd7ba=_[_0x22a6('0x15')](db['Dynamics365Account']['rawAttributes'],function(_0x36ba52){return{'name':_0x36ba52[_0x22a6('0x16')],'type':_0x36ba52[_0x22a6('0x17')][_0x22a6('0x18')]};});_0x558373[_0x22a6('0x19')]=_[_0x22a6('0x15')](_0x5dd7ba,'name');_0x558373[_0x22a6('0x1a')]=_['keys'](_0x54c1a5[_0x22a6('0x1a')]);_0x558373[_0x22a6('0x1b')]=_['intersection'](_0x558373['model'],_0x558373[_0x22a6('0x1a')]);_0x2a223b['attributes']=_[_0x22a6('0x1c')](_0x558373[_0x22a6('0x19')],qs['fields'](_0x54c1a5[_0x22a6('0x1a')][_0x22a6('0x1d')]));_0x2a223b[_0x22a6('0x1e')]=_0x2a223b[_0x22a6('0x1e')][_0x22a6('0x1f')]?_0x2a223b[_0x22a6('0x1e')]:_0x558373[_0x22a6('0x19')];if(!_0x54c1a5[_0x22a6('0x1a')]['hasOwnProperty']('nolimit')){_0x2a223b[_0x22a6('0xb')]=qs['limit'](_0x54c1a5[_0x22a6('0x1a')][_0x22a6('0xb')]);_0x2a223b[_0x22a6('0x9')]=qs[_0x22a6('0x9')](_0x54c1a5['query'][_0x22a6('0x9')]);}_0x2a223b[_0x22a6('0x20')]=qs[_0x22a6('0x21')](_0x54c1a5[_0x22a6('0x1a')][_0x22a6('0x21')]);_0x2a223b[_0x22a6('0x22')]=qs[_0x22a6('0x1b')](_[_0x22a6('0x23')](_0x54c1a5['query'],_0x558373[_0x22a6('0x1b')]),_0x5dd7ba);if(_0x54c1a5[_0x22a6('0x1a')][_0x22a6('0x24')]){_0x2a223b[_0x22a6('0x22')]=_[_0x22a6('0x25')](_0x2a223b[_0x22a6('0x22')],{'$or':_[_0x22a6('0x15')](_0x5dd7ba,function(_0x252769){if(_0x252769[_0x22a6('0x17')]!==_0x22a6('0x26')){var _0x5cb694={};_0x5cb694[_0x252769[_0x22a6('0x12')]]={'$like':'%'+_0x54c1a5['query']['filter']+'%'};return _0x5cb694;}})});}_0x2a223b=_[_0x22a6('0x25')]({},_0x2a223b,_0x54c1a5['options']);var _0x200590={'where':_0x2a223b[_0x22a6('0x22')]};return db[_0x22a6('0x27')][_0x22a6('0xc')](_0x200590)[_0x22a6('0xf')](function(_0x59a4f6){_0x749beb[_0x22a6('0xc')]=_0x59a4f6;if(_0x54c1a5[_0x22a6('0x1a')][_0x22a6('0x28')]){_0x2a223b[_0x22a6('0x29')]=[{'all':!![]}];}return db[_0x22a6('0x27')][_0x22a6('0x2a')](_0x2a223b);})[_0x22a6('0xf')](function(_0x330fc0){_0x749beb[_0x22a6('0x2b')]=_0x330fc0;return _0x749beb;})[_0x22a6('0xf')](respondWithFilteredResult(_0x5e0c73,_0x2a223b))[_0x22a6('0x2c')](handleError(_0x5e0c73,null));};exports[_0x22a6('0x2d')]=function(_0x3bc035,_0x244739){var _0xbe7f79={'raw':![],'where':{'id':_0x3bc035[_0x22a6('0x2e')]['id']}},_0xb2d43e={};_0xb2d43e[_0x22a6('0x19')]=_[_0x22a6('0x2f')](db['Dynamics365Account'][_0x22a6('0x30')]);_0xb2d43e[_0x22a6('0x1a')]=_[_0x22a6('0x2f')](_0x3bc035[_0x22a6('0x1a')]);_0xb2d43e[_0x22a6('0x1b')]=_[_0x22a6('0x1c')](_0xb2d43e['model'],_0xb2d43e[_0x22a6('0x1a')]);_0xbe7f79['attributes']=_[_0x22a6('0x1c')](_0xb2d43e[_0x22a6('0x19')],qs[_0x22a6('0x1d')](_0x3bc035[_0x22a6('0x1a')][_0x22a6('0x1d')]));_0xbe7f79[_0x22a6('0x1e')]=_0xbe7f79['attributes'][_0x22a6('0x1f')]?_0xbe7f79[_0x22a6('0x1e')]:_0xb2d43e['model'];if(_0x3bc035[_0x22a6('0x1a')]['includeAll']){_0xbe7f79['include']=[{'all':!![]}];}_0xbe7f79=_[_0x22a6('0x25')]({},_0xbe7f79,_0x3bc035[_0x22a6('0x31')]);return db[_0x22a6('0x27')][_0x22a6('0x32')](_0xbe7f79)[_0x22a6('0xf')](handleEntityNotFound(_0x244739,null))[_0x22a6('0xf')](respondWithResult(_0x244739,null))[_0x22a6('0x2c')](handleError(_0x244739,null));};exports[_0x22a6('0x33')]=function(_0x13869e,_0x4de8ca){return db[_0x22a6('0x27')]['create'](_0x13869e[_0x22a6('0x34')],{})['then'](respondWithResult(_0x4de8ca,0xc9))[_0x22a6('0x2c')](handleError(_0x4de8ca,null));};exports[_0x22a6('0xe')]=function(_0x58cdc8,_0x57eb76){if(_0x58cdc8[_0x22a6('0x34')]['id']){delete _0x58cdc8[_0x22a6('0x34')]['id'];}return db[_0x22a6('0x27')][_0x22a6('0x32')]({'where':{'id':_0x58cdc8[_0x22a6('0x2e')]['id']}})[_0x22a6('0xf')](handleEntityNotFound(_0x57eb76,null))['then'](saveUpdates(_0x58cdc8['body'],null))['then'](respondWithResult(_0x57eb76,null))['catch'](handleError(_0x57eb76,null));};exports[_0x22a6('0x35')]=function(_0x346b58,_0xced5b8){return db[_0x22a6('0x27')]['find']({'where':{'id':_0x346b58['params']['id']}})['then'](handleEntityNotFound(_0xced5b8,null))['then'](removeEntity(_0xced5b8,null))['catch'](handleError(_0xced5b8,null));};exports[_0x22a6('0x36')]=function(_0xbca23f,_0x4a8e69){var _0x12dbc8={};var _0x503bf4={};var _0x435637;var _0xb9277;return db['Dynamics365Account'][_0x22a6('0x37')]({'where':{'id':_0xbca23f[_0x22a6('0x2e')]['id']}})[_0x22a6('0xf')](handleEntityNotFound(_0x4a8e69,null))[_0x22a6('0xf')](function(_0x14ddad){if(_0x14ddad){_0x435637=_0x14ddad;_0x503bf4[_0x22a6('0x19')]=_[_0x22a6('0x2f')](db[_0x22a6('0x38')][_0x22a6('0x30')]);_0x503bf4['query']=_['keys'](_0xbca23f[_0x22a6('0x1a')]);_0x503bf4[_0x22a6('0x1b')]=_[_0x22a6('0x1c')](_0x503bf4[_0x22a6('0x19')],_0x503bf4[_0x22a6('0x1a')]);_0x12dbc8['attributes']=_[_0x22a6('0x1c')](_0x503bf4[_0x22a6('0x19')],qs[_0x22a6('0x1d')](_0xbca23f['query']['fields']));_0x12dbc8[_0x22a6('0x1e')]=_0x12dbc8[_0x22a6('0x1e')][_0x22a6('0x1f')]?_0x12dbc8[_0x22a6('0x1e')]:_0x503bf4[_0x22a6('0x19')];_0x12dbc8[_0x22a6('0x20')]=qs[_0x22a6('0x21')](_0xbca23f[_0x22a6('0x1a')][_0x22a6('0x21')]);_0x12dbc8[_0x22a6('0x22')]=qs[_0x22a6('0x1b')](_[_0x22a6('0x23')](_0xbca23f[_0x22a6('0x1a')],_0x503bf4[_0x22a6('0x1b')]));if(_0xbca23f[_0x22a6('0x1a')][_0x22a6('0x24')]){_0x12dbc8[_0x22a6('0x22')]=_['merge'](_0x12dbc8[_0x22a6('0x22')],{'$or':_[_0x22a6('0x15')](_0x12dbc8[_0x22a6('0x1e')],function(_0x5e47d5){var _0x2c5d6f={};_0x2c5d6f[_0x5e47d5]={'$like':'%'+_0xbca23f[_0x22a6('0x1a')]['filter']+'%'};return _0x2c5d6f;})});}_0x12dbc8=_['merge']({},_0x12dbc8,_0xbca23f[_0x22a6('0x31')]);return _0x435637[_0x22a6('0x36')](_0x12dbc8);}})[_0x22a6('0xf')](function(_0x643de3){if(_0x643de3){_0xb9277=_0x643de3[_0x22a6('0x1f')];if(!_0xbca23f[_0x22a6('0x1a')][_0x22a6('0x39')](_0x22a6('0x3a'))){_0x12dbc8[_0x22a6('0xb')]=qs[_0x22a6('0xb')](_0xbca23f[_0x22a6('0x1a')][_0x22a6('0xb')]);_0x12dbc8[_0x22a6('0x9')]=qs[_0x22a6('0x9')](_0xbca23f[_0x22a6('0x1a')][_0x22a6('0x9')]);}return _0x435637[_0x22a6('0x36')](_0x12dbc8);}})[_0x22a6('0xf')](function(_0x5496b){if(_0x5496b){return _0x5496b?{'count':_0xb9277,'rows':_0x5496b}:null;}})['then'](respondWithResult(_0x4a8e69,null))['catch'](handleError(_0x4a8e69,null));};exports[_0x22a6('0x3b')]=function(_0x2b9d4b,_0x3176b7){if(_0x2b9d4b['body']['id']){delete _0x2b9d4b['body']['id'];}return db[_0x22a6('0x27')][_0x22a6('0x37')]({'where':{'id':_0x2b9d4b['params']['id']}})[_0x22a6('0xf')](handleEntityNotFound(_0x3176b7,null))[_0x22a6('0xf')](function(_0x4c77bf){if(_0x4c77bf){_0x2b9d4b[_0x22a6('0x34')][_0x22a6('0x3c')]=_0x4c77bf['id'];_0x2b9d4b[_0x22a6('0x34')][_0x22a6('0x3d')]=integrations[_0x22a6('0x3e')](_0x2b9d4b[_0x22a6('0x34')][_0x22a6('0x3f')],_0x2b9d4b[_0x22a6('0x34')][_0x22a6('0x17')]);_0x2b9d4b[_0x22a6('0x34')]['Descriptions']=integrations[_0x22a6('0x40')](_0x2b9d4b[_0x22a6('0x34')]['channel'],_0x2b9d4b['body'][_0x22a6('0x17')]);return db[_0x22a6('0x38')][_0x22a6('0x33')](_0x2b9d4b['body'],{'include':[{'model':db[_0x22a6('0x41')],'as':_0x22a6('0x3d')},{'model':db[_0x22a6('0x41')],'as':_0x22a6('0x42')}]});}return null;})[_0x22a6('0xf')](respondWithResult(_0x3176b7,null))['catch'](handleError(_0x3176b7,null));};function sanitizeRemoteUri(_0x39ff29){var _0x598336=_0x39ff29[_0x22a6('0x43')](-0x1);if(_0x598336==='/')return _0x39ff29[_0x22a6('0x44')](0x0,_0x39ff29[_0x22a6('0x45')](_0x598336));return _0x39ff29;}function getWebApiUrl(_0x56716a){return util[_0x22a6('0x46')](_0x22a6('0x47'),_0x56716a);}exports[_0x22a6('0x48')]=function(_0x3493cd,_0xf9e423){var _0x4b7ac8=_0x3493cd[_0x22a6('0x1a')][_0x22a6('0x49')];var _0x243369=_0x4b7ac8===_0x22a6('0x4a')?'Incident':_0x22a6('0x4b');var _0x20e296='';var _0x480416='';var _0x8f9a84='';var _0x1b0dcc='';var _0x1b7503='';var _0x1f2d44='';var _0x48168c='';var _0x45f038='';var _0x125cda=[_0x22a6('0x4c'),'description',_0x22a6('0x4d'),_0x22a6('0x4e'),'caseorigincode','subject','phonenumber',_0x22a6('0x4f'),_0x22a6('0x50'),_0x22a6('0x51')];var _0x50ee2e=[_0x22a6('0x52'),_0x22a6('0x53'),_0x22a6('0x54'),_0x22a6('0x55'),'contactidname',_0x22a6('0x56'),'contractdetailidname',_0x22a6('0x57'),_0x22a6('0x58'),_0x22a6('0x59'),'createdbyname',_0x22a6('0x5a'),_0x22a6('0x5b'),'createdonbehalfbyname','createdonbehalfbyyominame',_0x22a6('0x5c'),_0x22a6('0x5d'),_0x22a6('0x5e'),_0x22a6('0x5f'),_0x22a6('0x60'),_0x22a6('0x61'),_0x22a6('0x62'),_0x22a6('0x63'),_0x22a6('0x64'),_0x22a6('0x65'),_0x22a6('0x66'),_0x22a6('0x67'),_0x22a6('0x68'),'kbarticleidname',_0x22a6('0x69'),_0x22a6('0x6a'),_0x22a6('0x6b'),_0x22a6('0x6c'),_0x22a6('0x6d'),'modifiedbyyominame',_0x22a6('0x6e'),_0x22a6('0x6f'),'modifiedonbehalfbyyominame',_0x22a6('0x70'),_0x22a6('0x71'),_0x22a6('0x72'),'onholdtime',_0x22a6('0x73'),_0x22a6('0x74'),_0x22a6('0x75'),_0x22a6('0x76'),'parentcaseidname','primarycontactidname','primarycontactidyominame',_0x22a6('0x77'),_0x22a6('0x78'),_0x22a6('0x79'),_0x22a6('0x7a'),_0x22a6('0x7b'),_0x22a6('0x7c'),'responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x22a6('0x7d'),_0x22a6('0x7e'),_0x22a6('0x7f'),_0x22a6('0x80'),_0x22a6('0x81'),_0x22a6('0x82'),_0x22a6('0x83'),_0x22a6('0x84'),_0x22a6('0x85'),_0x22a6('0x86'),_0x22a6('0x87'),'versionnumber'];var _0x202a56=_0x125cda[_0x22a6('0x88')](_0x50ee2e);return db[_0x22a6('0x27')][_0x22a6('0x37')]({'where':{'id':_0x3493cd['params']['id']},'attributes':['id',_0x22a6('0x89'),_0x22a6('0x8a'),_0x22a6('0x8b'),_0x22a6('0x8c'),_0x22a6('0x8d'),_0x22a6('0x8e'),_0x22a6('0x8f')],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id','data5',_0x22a6('0x90')]}]})['then'](handleEntityNotFound(_0xf9e423,null))[_0x22a6('0xf')](function(_0x36ad0d){if(_0x36ad0d){if(_0x36ad0d['modernAuthentication']){_0x36ad0d[_0x22a6('0x91')]=_0x36ad0d[_0x22a6('0x92')][_0x22a6('0x93')];_0x45f038=sanitizeRemoteUri(_0x36ad0d['CloudProvider'][_0x22a6('0x90')]);_0x48168c=getWebApiUrl(_0x45f038);return _0x36ad0d;}_0x45f038=sanitizeRemoteUri(_0x36ad0d['remoteUri']);_0x48168c=getWebApiUrl(_0x45f038);var _0x5d4acc={'method':_0x22a6('0x94'),'uri':'https://login.microsoftonline.com/'+_0x36ad0d[_0x22a6('0x8c')]+_0x22a6('0x95'),'form':{'client_id':_0x36ad0d['clientId'],'resource':_0x45f038,'username':_0x36ad0d[_0x22a6('0x89')],'password':_0x36ad0d['password'],'grant_type':'password','client_secret':_0x36ad0d['clientSecret']},'json':!![]};return rp(_0x5d4acc);}})[_0x22a6('0xf')](function(_0x1f0a5a){_0x1f2d44=_0x1f0a5a[_0x22a6('0x91')];var _0x336f27={'method':_0x22a6('0x96'),'uri':encodeURI(_0x48168c+_0x22a6('0x97')+_0x243369+'\x27'),'headers':{'Authorization':_0x22a6('0x98')+_0x1f2d44,'If-None-Match':null,'OData-Version':_0x22a6('0x99')},'json':!![]};return rp(_0x336f27);})[_0x22a6('0xf')](function(_0x2c4f27){var _0x5ba9ed=_0x2c4f27['value'][0x0];var _0x454a5c=_0x5ba9ed['MetadataId'];var _0x257d26={'method':_0x22a6('0x96'),'uri':_0x48168c+_0x22a6('0x9a')+_0x454a5c+_0x22a6('0x9b'),'headers':{'Authorization':_0x22a6('0x98')+_0x1f2d44,'If-None-Match':null,'OData-Version':_0x22a6('0x99')},'json':!![]};return rp(_0x257d26);})['then'](function(_0x2d7331){_0x20e296=_0x2d7331;_0x480416=_0x20e296[_0x22a6('0x9c')];_0x480416=_[_0x22a6('0x9d')](_0x480416,function(_0x4435fd){return!_0x202a56[_0x22a6('0x9e')](_0x4435fd[_0x22a6('0x9f')]);});var _0x228597=[];var _0x100d6f=[];_0x480416[_0x22a6('0xa0')](function(_0x148d12){if(_0x148d12[_0x22a6('0xa1')]){var _0x47d355=_0x148d12[_0x22a6('0xa1')][_0x22a6('0x44')](_0x148d12[_0x22a6('0xa1')][_0x22a6('0x45')]('.')+0x1);if(_0x47d355==='PicklistAttributeMetadata'){_0x228597[_0x22a6('0xa2')](getSelectList(_0x48168c,_0x4b7ac8,_0x100d6f,_0x20e296[_0x22a6('0xa3')],_0x148d12[_0x22a6('0xa3')],_0x1f2d44));}}});return Promise[_0x22a6('0xa4')](_0x228597);})[_0x22a6('0xf')](function(_0x2ceb1b){_0x8f9a84=_0x2ceb1b[0x0];var _0x385933=[];var _0x36c09c=[];_0x480416[_0x22a6('0xa0')](function(_0x445b07){if(!_[_0x22a6('0xa5')](_0x445b07[_0x22a6('0xa1')])){var _0xdffc0e=_0x445b07[_0x22a6('0xa1')][_0x22a6('0x44')](_0x445b07[_0x22a6('0xa1')]['lastIndexOf']('.')+0x1);if(_0xdffc0e===_0x22a6('0xa6')){_0x385933[_0x22a6('0xa2')](getBooleanList(_0x48168c,_0x4b7ac8,_0x36c09c,_0x20e296[_0x22a6('0xa3')],_0x445b07[_0x22a6('0xa3')],_0x1f2d44));}}});return Promise['all'](_0x385933);})[_0x22a6('0xf')](function(_0x41ca3f){_0x1b0dcc=_0x41ca3f[0x0];var _0x111e9=[];var _0x421d7e=[];_0x480416['forEach'](function(_0x2814b3){if(_0x2814b3['@odata.type']){var _0x22d21d=_0x2814b3[_0x22a6('0xa1')]['substring'](_0x2814b3[_0x22a6('0xa1')][_0x22a6('0x45')]('.')+0x1);if(_0x22d21d===_0x22a6('0xa7')||_0x22d21d===_0x22a6('0xa8')||_0x22d21d===_0x22a6('0xa9')||_0x22d21d==='IntegerAttributeMetadata'||_0x22d21d===_0x22a6('0xaa')||_0x22d21d===_0x22a6('0xab')||_0x22d21d===_0x22a6('0xac')||_0x22d21d===_0x22a6('0xad')||_0x22d21d===_0x22a6('0xae')||_0x22d21d===_0x22a6('0xaf')){_0x111e9[_0x22a6('0xa2')](getInputList(_0x48168c,_0x4b7ac8,_0x22d21d,_0x421d7e,_0x20e296[_0x22a6('0xa3')],_0x2814b3['MetadataId'],_0x1f2d44));}}});return Promise[_0x22a6('0xa4')](_0x111e9);})['then'](function(_0x45663b){_0x1b7503=_0x45663b[0x0];var _0x2e1f63=_0x8f9a84[_0x22a6('0x88')](_0x1b0dcc)[_0x22a6('0x88')](_0x1b7503);var _0x4f28e3={'count':_0x2e1f63[_0x22a6('0x1f')],'rows':_0x2e1f63};return _0x4f28e3;})[_0x22a6('0xf')](respondWithResult(_0xf9e423,null))[_0x22a6('0x2c')](function(_0x3afee2){var _0x55a8fd=_0x3493cd[_0x22a6('0x1a')][_0x22a6('0xb0')]?0x1f4:_0x3afee2['statusCode']||0x1f4;logger[_0x22a6('0xb1')](_0x3afee2[_0x22a6('0x11')]);delete _0x3afee2['name'];if(_0x55a8fd===0x191){_0x55a8fd=0x190;}_0xf9e423[_0x22a6('0x7')](_0x55a8fd)[_0x22a6('0x13')](_0x3493cd[_0x22a6('0x1a')][_0x22a6('0xb0')]?{'message':_0x22a6('0xb2'),'statusCode':_0x3afee2[_0x22a6('0xb3')]}:_0x3afee2);});};function getSelectList(_0x36e02e,_0x21726f,_0x337033,_0x3540e0,_0x49d5bf,_0x33e4f7){var _0x84457f={'method':_0x22a6('0x96'),'uri':_0x36e02e+'EntityDefinitions('+_0x3540e0+_0x22a6('0xb4')+_0x49d5bf+_0x22a6('0xb5')+_0x22a6('0xb6'),'headers':{'Authorization':_0x22a6('0x98')+_0x33e4f7,'If-None-Match':null,'OData-Version':_0x22a6('0x99')},'json':!![]};return rp(_0x84457f)[_0x22a6('0xf')](function(_0x28887f){var _0x2981f9=[];var _0x2acfe7=_0x28887f['OptionSet'][_0x22a6('0xb7')];_0x2acfe7['forEach'](function(_0x92603d){_0x2981f9[_0x22a6('0xa2')]({'name':_0x92603d[_0x22a6('0xb8')][_0x22a6('0xb9')][_0x22a6('0xb8')],'value':String(_0x92603d['Value'])});});var _0x2f0555={'id':_0x21726f+'_'+_0x28887f[_0x22a6('0x9f')],'name':_0x28887f[_0x22a6('0xba')]['UserLocalizedLabel'][_0x22a6('0xb8')],'custom':![],'options':_0x2981f9};_0x337033['push'](_0x2f0555);return _0x337033;});}function getBooleanList(_0x5e2824,_0x3f1a1e,_0x36d821,_0x50707e,_0x536776,_0x100b60){var _0x27ba3b={'method':_0x22a6('0x96'),'uri':_0x5e2824+_0x22a6('0x9a')+_0x50707e+_0x22a6('0xb4')+_0x536776+_0x22a6('0xbb'),'headers':{'Authorization':_0x22a6('0x98')+_0x100b60,'If-None-Match':null,'OData-Version':_0x22a6('0x99')},'json':!![]};return rp(_0x27ba3b)['then'](function(_0x1f2c6c){var _0x25d5eb=[];_0x25d5eb[_0x22a6('0xa2')]({'name':_0x1f2c6c[_0x22a6('0xbc')][_0x22a6('0xbd')]['Label'][_0x22a6('0xb9')][_0x22a6('0xb8')],'value':_0x22a6('0xbe')},{'name':_0x1f2c6c[_0x22a6('0xbc')][_0x22a6('0xbf')]['Label'][_0x22a6('0xb9')]['Label'],'value':_0x22a6('0xc0')});var _0x386f33={'id':_0x3f1a1e+'_'+_0x1f2c6c[_0x22a6('0x9f')],'name':_0x1f2c6c[_0x22a6('0xba')][_0x22a6('0xb9')]['Label'],'custom':![],'options':_0x25d5eb};_0x36d821[_0x22a6('0xa2')](_0x386f33);return _0x36d821;});}function getInputList(_0x1bbf39,_0x2e3433,_0x5f54e6,_0x59529f,_0x20002a,_0xe83d94,_0x235aaf){var _0x1b21f8={'method':'GET','uri':_0x1bbf39+_0x22a6('0x9a')+_0x20002a+_0x22a6('0xb4')+_0xe83d94+_0x22a6('0xc1')+_0x5f54e6+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x22a6('0x98')+_0x235aaf,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b21f8)[_0x22a6('0xf')](function(_0x4818c0){var _0x25e70e={'id':_0x2e3433+'_'+_0x4818c0[_0x22a6('0x9f')],'name':_0x4818c0['DisplayName'][_0x22a6('0xb9')]?_0x4818c0[_0x22a6('0xba')][_0x22a6('0xb9')][_0x22a6('0xb8')]:_0x4818c0[_0x22a6('0x9f')],'custom':![],'options':[]};_0x59529f[_0x22a6('0xa2')](_0x25e70e);return _0x59529f;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index adcb970..aef2c6e 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(_0x288c30,_0x3f3d07){var _0x486388=function(_0x39ddee){while(--_0x39ddee){_0x288c30['push'](_0x288c30['shift']());}};_0x486388(++_0x3f3d07);}(_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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5cf4c2,_0x50f123){var _0x18e4aa=function(_0x3011d2){while(--_0x3011d2){_0x5cf4c2['push'](_0x5cf4c2['shift']());}};_0x18e4aa(++_0x50f123);}(_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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 3111668..e63c93b 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 _0xaa52=['ShowDynamics365Account','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','limit','include','map','model','attributes'];(function(_0x5885fb,_0x254fd2){var _0x1466f6=function(_0x539ce4){while(--_0x539ce4){_0x5885fb['push'](_0x5885fb['shift']());}};_0x1466f6(++_0x254fd2);}(_0xaa52,0x1bc));var _0x2aa5=function(_0x26dcae,_0x2fbe6a){_0x26dcae=_0x26dcae-0x0;var _0x12890e=_0xaa52[_0x26dcae];return _0x12890e;};'use strict';var _=require(_0x2aa5('0x0'));var util=require(_0x2aa5('0x1'));var moment=require('moment');var BPromise=require(_0x2aa5('0x2'));var rs=require(_0x2aa5('0x3'));var fs=require('fs');var Redis=require(_0x2aa5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2aa5('0x5'))(_0x2aa5('0x6'));var config=require('../../config/environment');var jayson=require(_0x2aa5('0x7'));var client=jayson[_0x2aa5('0x8')][_0x2aa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4936fe,_0x39c8f6,_0x5ae5a0){return new BPromise(function(_0x34c99a,_0x5c4a82){return client[_0x2aa5('0xa')](_0x4936fe,_0x5ae5a0)[_0x2aa5('0xb')](function(_0x323872){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x39c8f6,_0x2aa5('0xc'));logger[_0x2aa5('0xd')](_0x2aa5('0xe'),_0x39c8f6,_0x2aa5('0xc'),JSON[_0x2aa5('0xf')](_0x323872));if(_0x323872['error']){if(_0x323872[_0x2aa5('0x10')]['code']===0x1f4){logger['error'](_0x2aa5('0x11'),_0x39c8f6,_0x323872[_0x2aa5('0x10')][_0x2aa5('0x12')]);return _0x5c4a82(_0x323872[_0x2aa5('0x10')]['message']);}logger['error'](_0x2aa5('0x11'),_0x39c8f6,_0x323872[_0x2aa5('0x10')][_0x2aa5('0x12')]);return _0x34c99a(_0x323872[_0x2aa5('0x10')][_0x2aa5('0x12')]);}else{logger[_0x2aa5('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x39c8f6,_0x2aa5('0xc'));_0x34c99a(_0x323872[_0x2aa5('0x14')][_0x2aa5('0x12')]);}})[_0x2aa5('0x15')](function(_0x174744){logger['error'](_0x2aa5('0x11'),_0x39c8f6,_0x174744);_0x5c4a82(_0x174744);});});}exports[_0x2aa5('0x16')]=function(_0x4940c7){var _0x12f180=this;return new Promise(function(_0x143835,_0x4721fa){return db[_0x2aa5('0x17')]['findAll']({'raw':_0x4940c7[_0x2aa5('0x18')]?_0x4940c7['options'][_0x2aa5('0x19')]===undefined?!![]:![]:!![],'where':_0x4940c7['options']?_0x4940c7[_0x2aa5('0x18')][_0x2aa5('0x1a')]||null:null,'attributes':_0x4940c7['options']?_0x4940c7[_0x2aa5('0x18')]['attributes']||null:null,'limit':_0x4940c7[_0x2aa5('0x18')]?_0x4940c7[_0x2aa5('0x18')][_0x2aa5('0x1b')]||null:null,'include':_0x4940c7['options']?_0x4940c7[_0x2aa5('0x18')][_0x2aa5('0x1c')]?_[_0x2aa5('0x1d')](_0x4940c7[_0x2aa5('0x18')][_0x2aa5('0x1c')],function(_0x594ad5){return{'model':db[_0x594ad5[_0x2aa5('0x1e')]],'as':_0x594ad5['as'],'attributes':_0x594ad5[_0x2aa5('0x1f')],'include':_0x594ad5[_0x2aa5('0x1c')]?_[_0x2aa5('0x1d')](_0x594ad5[_0x2aa5('0x1c')],function(_0x15abbc){return{'model':db[_0x15abbc[_0x2aa5('0x1e')]],'as':_0x15abbc['as'],'attributes':_0x15abbc['attributes'],'include':_0x15abbc[_0x2aa5('0x1c')]?_[_0x2aa5('0x1d')](_0x15abbc[_0x2aa5('0x1c')],function(_0x3bd591){return{'model':db[_0x3bd591['model']],'as':_0x3bd591['as'],'attributes':_0x3bd591[_0x2aa5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2aa5('0xb')](function(_0x537c23){logger['info'](_0x2aa5('0x16'),_0x4940c7);logger[_0x2aa5('0xd')]('GetDynamics365Account',_0x4940c7,JSON[_0x2aa5('0xf')](_0x537c23));_0x143835(_0x537c23);})[_0x2aa5('0x15')](function(_0x568ad1){logger['error'](_0x2aa5('0x16'),_0x568ad1[_0x2aa5('0x12')],_0x4940c7);_0x4721fa(_0x12f180[_0x2aa5('0x10')](0x1f4,_0x568ad1[_0x2aa5('0x12')]));});});};exports[_0x2aa5('0x20')]=function(_0xa57dbc){var _0x35dd8d=this;return new Promise(function(_0x177cf3,_0x4f17b6){return db[_0x2aa5('0x17')][_0x2aa5('0x21')]({'raw':_0xa57dbc[_0x2aa5('0x18')]?_0xa57dbc[_0x2aa5('0x18')][_0x2aa5('0x19')]===undefined?!![]:![]:!![],'where':_0xa57dbc[_0x2aa5('0x18')]?_0xa57dbc[_0x2aa5('0x18')][_0x2aa5('0x1a')]||null:null,'attributes':_0xa57dbc[_0x2aa5('0x18')]?_0xa57dbc[_0x2aa5('0x18')][_0x2aa5('0x1f')]||null:null,'include':_0xa57dbc[_0x2aa5('0x18')]?_0xa57dbc[_0x2aa5('0x18')][_0x2aa5('0x1c')]?_[_0x2aa5('0x1d')](_0xa57dbc[_0x2aa5('0x18')]['include'],function(_0x382139){return{'model':db[_0x382139[_0x2aa5('0x1e')]],'as':_0x382139['as'],'attributes':_0x382139[_0x2aa5('0x1f')],'include':_0x382139[_0x2aa5('0x1c')]?_[_0x2aa5('0x1d')](_0x382139[_0x2aa5('0x1c')],function(_0x3ccb23){return{'model':db[_0x3ccb23['model']],'as':_0x3ccb23['as'],'attributes':_0x3ccb23[_0x2aa5('0x1f')],'include':_0x3ccb23[_0x2aa5('0x1c')]?_['map'](_0x3ccb23['include'],function(_0xd13157){return{'model':db[_0xd13157[_0x2aa5('0x1e')]],'as':_0xd13157['as'],'attributes':_0xd13157['attributes']};}):[]};}):[]};}):[]:[]})[_0x2aa5('0xb')](function(_0x562339){logger[_0x2aa5('0x13')](_0x2aa5('0x20'),_0xa57dbc);logger[_0x2aa5('0xd')]('ShowDynamics365Account',_0xa57dbc,JSON['stringify'](_0x562339));_0x177cf3(_0x562339);})[_0x2aa5('0x15')](function(_0x4be17a){logger['error'](_0x2aa5('0x20'),_0x4be17a[_0x2aa5('0x12')],_0xa57dbc);_0x4f17b6(_0x35dd8d['error'](0x1f4,_0x4be17a[_0x2aa5('0x12')]));});});}; \ No newline at end of file +var _0xb8eb=['where','attributes','limit','include','model','map','then','catch','raw','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetDynamics365Account','Dynamics365Account','findAll','options'];(function(_0x360c97,_0x1efb90){var _0x34a6bf=function(_0x6e40fc){while(--_0x6e40fc){_0x360c97['push'](_0x360c97['shift']());}};_0x34a6bf(++_0x1efb90);}(_0xb8eb,0x1d1));var _0xbb8e=function(_0x45dc4a,_0x49d22e){_0x45dc4a=_0x45dc4a-0x0;var _0x1207e9=_0xb8eb[_0x45dc4a];return _0x1207e9;};'use strict';var _=require('lodash');var util=require(_0xbb8e('0x0'));var moment=require(_0xbb8e('0x1'));var BPromise=require(_0xbb8e('0x2'));var rs=require(_0xbb8e('0x3'));var fs=require('fs');var Redis=require(_0xbb8e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb8e('0x5'));var logger=require(_0xbb8e('0x6'))(_0xbb8e('0x7'));var config=require(_0xbb8e('0x8'));var jayson=require(_0xbb8e('0x9'));var client=jayson[_0xbb8e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e02a4,_0x3a18d6,_0x3a1b3a){return new BPromise(function(_0x56d244,_0x2d1e82){return client[_0xbb8e('0xb')](_0x5e02a4,_0x3a1b3a)['then'](function(_0x256d27){logger[_0xbb8e('0xc')](_0xbb8e('0xd'),_0x3a18d6,'request\x20sent');logger[_0xbb8e('0xe')](_0xbb8e('0xf'),_0x3a18d6,'request\x20sent',JSON[_0xbb8e('0x10')](_0x256d27));if(_0x256d27[_0xbb8e('0x11')]){if(_0x256d27[_0xbb8e('0x11')]['code']===0x1f4){logger[_0xbb8e('0x11')](_0xbb8e('0xd'),_0x3a18d6,_0x256d27['error'][_0xbb8e('0x12')]);return _0x2d1e82(_0x256d27[_0xbb8e('0x11')][_0xbb8e('0x12')]);}logger[_0xbb8e('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x3a18d6,_0x256d27[_0xbb8e('0x11')][_0xbb8e('0x12')]);return _0x56d244(_0x256d27[_0xbb8e('0x11')][_0xbb8e('0x12')]);}else{logger[_0xbb8e('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x3a18d6,_0xbb8e('0x13'));_0x56d244(_0x256d27[_0xbb8e('0x14')][_0xbb8e('0x12')]);}})['catch'](function(_0x5ba22a){logger[_0xbb8e('0x11')](_0xbb8e('0xd'),_0x3a18d6,_0x5ba22a);_0x2d1e82(_0x5ba22a);});});}exports[_0xbb8e('0x15')]=function(_0x5e4731){var _0x1566d4=this;return new Promise(function(_0x4b552f,_0x1e4ec6){return db[_0xbb8e('0x16')][_0xbb8e('0x17')]({'raw':_0x5e4731[_0xbb8e('0x18')]?_0x5e4731[_0xbb8e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5e4731[_0xbb8e('0x18')]?_0x5e4731[_0xbb8e('0x18')][_0xbb8e('0x19')]||null:null,'attributes':_0x5e4731['options']?_0x5e4731[_0xbb8e('0x18')][_0xbb8e('0x1a')]||null:null,'limit':_0x5e4731[_0xbb8e('0x18')]?_0x5e4731[_0xbb8e('0x18')][_0xbb8e('0x1b')]||null:null,'include':_0x5e4731[_0xbb8e('0x18')]?_0x5e4731['options'][_0xbb8e('0x1c')]?_['map'](_0x5e4731[_0xbb8e('0x18')][_0xbb8e('0x1c')],function(_0x5af0cb){return{'model':db[_0x5af0cb[_0xbb8e('0x1d')]],'as':_0x5af0cb['as'],'attributes':_0x5af0cb[_0xbb8e('0x1a')],'include':_0x5af0cb[_0xbb8e('0x1c')]?_[_0xbb8e('0x1e')](_0x5af0cb[_0xbb8e('0x1c')],function(_0xb427f0){return{'model':db[_0xb427f0[_0xbb8e('0x1d')]],'as':_0xb427f0['as'],'attributes':_0xb427f0['attributes'],'include':_0xb427f0[_0xbb8e('0x1c')]?_[_0xbb8e('0x1e')](_0xb427f0[_0xbb8e('0x1c')],function(_0x167a2a){return{'model':db[_0x167a2a[_0xbb8e('0x1d')]],'as':_0x167a2a['as'],'attributes':_0x167a2a[_0xbb8e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbb8e('0x1f')](function(_0x387ff1){logger[_0xbb8e('0xc')](_0xbb8e('0x15'),_0x5e4731);logger['debug']('GetDynamics365Account',_0x5e4731,JSON[_0xbb8e('0x10')](_0x387ff1));_0x4b552f(_0x387ff1);})[_0xbb8e('0x20')](function(_0x1d2fc6){logger[_0xbb8e('0x11')](_0xbb8e('0x15'),_0x1d2fc6['message'],_0x5e4731);_0x1e4ec6(_0x1566d4['error'](0x1f4,_0x1d2fc6[_0xbb8e('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x317dc8){var _0xad3264=this;return new Promise(function(_0x46ed35,_0x53fe44){return db[_0xbb8e('0x16')]['find']({'raw':_0x317dc8['options']?_0x317dc8['options'][_0xbb8e('0x21')]===undefined?!![]:![]:!![],'where':_0x317dc8[_0xbb8e('0x18')]?_0x317dc8[_0xbb8e('0x18')][_0xbb8e('0x19')]||null:null,'attributes':_0x317dc8[_0xbb8e('0x18')]?_0x317dc8[_0xbb8e('0x18')][_0xbb8e('0x1a')]||null:null,'include':_0x317dc8[_0xbb8e('0x18')]?_0x317dc8[_0xbb8e('0x18')][_0xbb8e('0x1c')]?_[_0xbb8e('0x1e')](_0x317dc8[_0xbb8e('0x18')][_0xbb8e('0x1c')],function(_0x356fca){return{'model':db[_0x356fca['model']],'as':_0x356fca['as'],'attributes':_0x356fca[_0xbb8e('0x1a')],'include':_0x356fca[_0xbb8e('0x1c')]?_['map'](_0x356fca[_0xbb8e('0x1c')],function(_0x20c08f){return{'model':db[_0x20c08f[_0xbb8e('0x1d')]],'as':_0x20c08f['as'],'attributes':_0x20c08f['attributes'],'include':_0x20c08f[_0xbb8e('0x1c')]?_[_0xbb8e('0x1e')](_0x20c08f[_0xbb8e('0x1c')],function(_0x19e753){return{'model':db[_0x19e753['model']],'as':_0x19e753['as'],'attributes':_0x19e753[_0xbb8e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x300bf0){logger['info'](_0xbb8e('0x22'),_0x317dc8);logger[_0xbb8e('0xe')](_0xbb8e('0x22'),_0x317dc8,JSON['stringify'](_0x300bf0));_0x46ed35(_0x300bf0);})[_0xbb8e('0x20')](function(_0x6dc873){logger['error'](_0xbb8e('0x22'),_0x6dc873['message'],_0x317dc8);_0x53fe44(_0xad3264[_0xbb8e('0x11')](0x1f4,_0x6dc873[_0xbb8e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index e9a8d0b..55ed0d1 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 _0xcbde=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','post','create','put','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x4ed5f4,_0x46d465){var _0x13f386=function(_0x11ee34){while(--_0x11ee34){_0x4ed5f4['push'](_0x4ed5f4['shift']());}};_0x13f386(++_0x46d465);}(_0xcbde,0x1df));var _0xecbd=function(_0x4bf26b,_0x270a37){_0x4bf26b=_0x4bf26b-0x0;var _0x419281=_0xcbde[_0x4bf26b];return _0x419281;};'use strict';var multer=require('multer');var util=require(_0xecbd('0x0'));var path=require(_0xecbd('0x1'));var timeout=require(_0xecbd('0x2'));var express=require('express');var router=express[_0xecbd('0x3')]();var fs_extra=require(_0xecbd('0x4'));var auth=require(_0xecbd('0x5'));var interaction=require(_0xecbd('0x6'));var config=require(_0xecbd('0x7'));var controller=require(_0xecbd('0x8'));router[_0xecbd('0x9')]('/',auth[_0xecbd('0xa')](),controller[_0xecbd('0xb')]);router['get'](_0xecbd('0xc'),auth['isAuthenticated'](),controller[_0xecbd('0xd')]);router[_0xecbd('0x9')](_0xecbd('0xe'),auth[_0xecbd('0xa')](),controller['getFields']);router[_0xecbd('0x9')]('/:id/subjects',auth[_0xecbd('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xecbd('0xa')](),controller['getDescriptions']);router[_0xecbd('0xf')]('/',auth['isAuthenticated'](),controller[_0xecbd('0x10')]);router[_0xecbd('0x11')](_0xecbd('0xc'),auth[_0xecbd('0xa')](),controller[_0xecbd('0x12')]);router['delete'](_0xecbd('0xc'),auth[_0xecbd('0xa')](),controller[_0xecbd('0x13')]);module[_0xecbd('0x14')]=router; \ No newline at end of file +var _0x6257=['./intDynamics365Configuration.controller','get','isAuthenticated','index','show','getFields','getSubjects','/:id/descriptions','update','delete','/:id','destroy','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x11b004,_0x2a6c74){var _0x2c49d4=function(_0x4b6ac5){while(--_0x4b6ac5){_0x11b004['push'](_0x11b004['shift']());}};_0x2c49d4(++_0x2a6c74);}(_0x6257,0x1d4));var _0x7625=function(_0x17e94c,_0x576ed2){_0x17e94c=_0x17e94c-0x0;var _0x1ca3a6=_0x6257[_0x17e94c];return _0x1ca3a6;};'use strict';var multer=require(_0x7625('0x0'));var util=require('util');var path=require(_0x7625('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7625('0x2')]();var fs_extra=require(_0x7625('0x3'));var auth=require(_0x7625('0x4'));var interaction=require(_0x7625('0x5'));var config=require(_0x7625('0x6'));var controller=require(_0x7625('0x7'));router[_0x7625('0x8')]('/',auth[_0x7625('0x9')](),controller[_0x7625('0xa')]);router[_0x7625('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7625('0xb')]);router[_0x7625('0x8')]('/:id/fields',auth[_0x7625('0x9')](),controller[_0x7625('0xc')]);router[_0x7625('0x8')]('/:id/subjects',auth[_0x7625('0x9')](),controller[_0x7625('0xd')]);router['get'](_0x7625('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x7625('0x9')](),controller['create']);router['put']('/:id',auth[_0x7625('0x9')](),controller[_0x7625('0xf')]);router[_0x7625('0x10')](_0x7625('0x11'),auth[_0x7625('0x9')](),controller[_0x7625('0x12')]);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 a8ef1c6..1795fd8 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 _0x4b74=['ENUM','incident','contact','nothing','BOOLEAN','sequelize','exports','STRING'];(function(_0x1e43ea,_0x452474){var _0x1a26c8=function(_0x1b7e7c){while(--_0x1b7e7c){_0x1e43ea['push'](_0x1e43ea['shift']());}};_0x1a26c8(++_0x452474);}(_0x4b74,0x1c5));var _0x44b7=function(_0x316783,_0x4b0e68){_0x316783=_0x316783-0x0;var _0x341dd1=_0x4b74[_0x316783];return _0x341dd1;};'use strict';var Sequelize=require(_0x44b7('0x0'));module[_0x44b7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44b7('0x2')]},'ticketType':{'type':Sequelize[_0x44b7('0x3')]('incident','phonecall'),'defaultValue':_0x44b7('0x4')},'moduleCreate':{'type':Sequelize[_0x44b7('0x3')](_0x44b7('0x5'),_0x44b7('0x6')),'defaultValue':_0x44b7('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x44b7('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9481=['phonecall','incident','contact','nothing','BOOLEAN','STRING','ENUM'];(function(_0x1290fa,_0x41ad96){var _0x39a998=function(_0x2c58e4){while(--_0x2c58e4){_0x1290fa['push'](_0x1290fa['shift']());}};_0x39a998(++_0x41ad96);}(_0x9481,0x155));var _0x1948=function(_0x38b2a3,_0x535623){_0x38b2a3=_0x38b2a3-0x0;var _0x816b12=_0x9481[_0x38b2a3];return _0x816b12;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1948('0x0')]},'description':{'type':Sequelize[_0x1948('0x0')]},'ticketType':{'type':Sequelize[_0x1948('0x1')]('incident',_0x1948('0x2')),'defaultValue':_0x1948('0x3')},'moduleCreate':{'type':Sequelize[_0x1948('0x1')](_0x1948('0x4'),_0x1948('0x5')),'defaultValue':_0x1948('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1948('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index c3beea3..42c5b84 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 _0x44ae=['../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','show','Dynamics365Configuration','find','create','body','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x4e231f,_0x315a9e){var _0x43a501=function(_0x58bdbb){while(--_0x58bdbb){_0x4e231f['push'](_0x4e231f['shift']());}};_0x43a501(++_0x315a9e);}(_0x44ae,0x8f));var _0xe44a=function(_0x1c9c4c,_0x1d4ccd){_0x1c9c4c=_0x1c9c4c-0x0;var _0x53237f=_0x44ae[_0x1c9c4c];return _0x53237f;};'use strict';var emlformat=require(_0xe44a('0x0'));var rimraf=require(_0xe44a('0x1'));var zipdir=require(_0xe44a('0x2'));var jsonpatch=require(_0xe44a('0x3'));var rp=require(_0xe44a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe44a('0x5'));var util=require(_0xe44a('0x6'));var path=require(_0xe44a('0x7'));var sox=require(_0xe44a('0x8'));var csv=require(_0xe44a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe44a('0xa'));var squel=require(_0xe44a('0xb'));var crypto=require(_0xe44a('0xc'));var jsforce=require(_0xe44a('0xd'));var deskjs=require(_0xe44a('0xe'));var toCsv=require(_0xe44a('0x9'));var querystring=require(_0xe44a('0xf'));var Papa=require(_0xe44a('0x10'));var Redis=require('ioredis');var authService=require(_0xe44a('0x11'));var qs=require(_0xe44a('0x12'));var as=require(_0xe44a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe44a('0x14'))('api');var utils=require(_0xe44a('0x15'));var config=require(_0xe44a('0x16'));var licenseUtil=require(_0xe44a('0x17'));var db=require(_0xe44a('0x18'))['db'];function respondWithStatusCode(_0x3146c1,_0x46322f){_0x46322f=_0x46322f||0xcc;return function(_0x49e66e){if(_0x49e66e){return _0x3146c1[_0xe44a('0x19')](_0x46322f);}return _0x3146c1['status'](_0x46322f)[_0xe44a('0x1a')]();};}function respondWithResult(_0x2661e3,_0x504601){_0x504601=_0x504601||0xc8;return function(_0x278447){if(_0x278447){return _0x2661e3[_0xe44a('0x1b')](_0x504601)[_0xe44a('0x1c')](_0x278447);}};}function respondWithFilteredResult(_0x5bb3d8,_0x5e4702){return function(_0x56ee07){if(_0x56ee07){var _0x134085=typeof _0x5e4702[_0xe44a('0x1d')]===_0xe44a('0x1e')&&typeof _0x5e4702[_0xe44a('0x1f')]===_0xe44a('0x1e');var _0x272625=_0x56ee07[_0xe44a('0x20')];var _0xc06ddb=_0x134085?0x0:_0x5e4702[_0xe44a('0x1d')];var _0x279442=_0x134085?_0x56ee07[_0xe44a('0x20')]:_0x5e4702[_0xe44a('0x1d')]+_0x5e4702['limit'];var _0x1c722f;if(_0x279442>=_0x272625){_0x279442=_0x272625;_0x1c722f=0xc8;}else{_0x1c722f=0xce;}_0x5bb3d8['status'](_0x1c722f);return _0x5bb3d8[_0xe44a('0x21')]('Content-Range',_0xc06ddb+'-'+_0x279442+'/'+_0x272625)[_0xe44a('0x1c')](_0x56ee07);}return null;};}function patchUpdates(_0x4b1878){return function(_0xcb3b86){try{jsonpatch[_0xe44a('0x22')](_0xcb3b86,_0x4b1878,!![]);}catch(_0x5d75c4){return BPromise[_0xe44a('0x23')](_0x5d75c4);}return _0xcb3b86[_0xe44a('0x24')]();};}function saveUpdates(_0x50df7e,_0x56de20){return function(_0x4e145a){if(_0x4e145a){return _0x4e145a[_0xe44a('0x25')](_0x50df7e)[_0xe44a('0x26')](function(_0x4b6e13){return _0x4b6e13;});}return null;};}function removeEntity(_0xcd43b8,_0x5c4811){return function(_0x1334f0){if(_0x1334f0){return _0x1334f0[_0xe44a('0x27')]()['then'](function(){_0xcd43b8[_0xe44a('0x1b')](0xcc)[_0xe44a('0x1a')]();});}};}function handleEntityNotFound(_0x1c767b,_0x42cdb9){return function(_0x385206){if(!_0x385206){_0x1c767b[_0xe44a('0x19')](0x194);}return _0x385206;};}function handleError(_0x1faef5,_0x4b467c){_0x4b467c=_0x4b467c||0x1f4;return function(_0x3996fd){logger['error'](_0x3996fd[_0xe44a('0x28')]);if(_0x3996fd[_0xe44a('0x29')]){delete _0x3996fd[_0xe44a('0x29')];}_0x1faef5[_0xe44a('0x1b')](_0x4b467c)[_0xe44a('0x2a')](_0x3996fd);};}exports[_0xe44a('0x2b')]=function(_0x3d5953,_0x1624bf){var _0x5d25f4={},_0x4a52c7={},_0x53cbe3={'count':0x0,'rows':[]};var _0x2b2138=_[_0xe44a('0x2c')](db['Dynamics365Configuration'][_0xe44a('0x2d')],function(_0x172a7c){return{'name':_0x172a7c[_0xe44a('0x2e')],'type':_0x172a7c[_0xe44a('0x2f')][_0xe44a('0x30')]};});_0x4a52c7[_0xe44a('0x31')]=_[_0xe44a('0x2c')](_0x2b2138,_0xe44a('0x29'));_0x4a52c7[_0xe44a('0x32')]=_[_0xe44a('0x33')](_0x3d5953[_0xe44a('0x32')]);_0x4a52c7['filters']=_[_0xe44a('0x34')](_0x4a52c7[_0xe44a('0x31')],_0x4a52c7[_0xe44a('0x32')]);_0x5d25f4['attributes']=_[_0xe44a('0x34')](_0x4a52c7[_0xe44a('0x31')],qs['fields'](_0x3d5953[_0xe44a('0x32')][_0xe44a('0x35')]));_0x5d25f4[_0xe44a('0x36')]=_0x5d25f4[_0xe44a('0x36')][_0xe44a('0x37')]?_0x5d25f4[_0xe44a('0x36')]:_0x4a52c7[_0xe44a('0x31')];if(!_0x3d5953[_0xe44a('0x32')][_0xe44a('0x38')](_0xe44a('0x39'))){_0x5d25f4[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x3d5953[_0xe44a('0x32')]['limit']);_0x5d25f4[_0xe44a('0x1d')]=qs[_0xe44a('0x1d')](_0x3d5953[_0xe44a('0x32')][_0xe44a('0x1d')]);}_0x5d25f4[_0xe44a('0x3a')]=qs[_0xe44a('0x3b')](_0x3d5953[_0xe44a('0x32')]['sort']);_0x5d25f4[_0xe44a('0x3c')]=qs[_0xe44a('0x3d')](_[_0xe44a('0x3e')](_0x3d5953[_0xe44a('0x32')],_0x4a52c7[_0xe44a('0x3d')]),_0x2b2138);if(_0x3d5953['query']['filter']){_0x5d25f4['where']=_[_0xe44a('0x3f')](_0x5d25f4[_0xe44a('0x3c')],{'$or':_[_0xe44a('0x2c')](_0x2b2138,function(_0x383fcf){if(_0x383fcf[_0xe44a('0x2f')]!=='VIRTUAL'){var _0x267911={};_0x267911[_0x383fcf[_0xe44a('0x29')]]={'$like':'%'+_0x3d5953[_0xe44a('0x32')][_0xe44a('0x40')]+'%'};return _0x267911;}})});}_0x5d25f4=_[_0xe44a('0x3f')]({},_0x5d25f4,_0x3d5953[_0xe44a('0x41')]);var _0x247e7a={'where':_0x5d25f4['where']};return db['Dynamics365Configuration'][_0xe44a('0x20')](_0x247e7a)[_0xe44a('0x26')](function(_0x40a8fa){_0x53cbe3['count']=_0x40a8fa;if(_0x3d5953[_0xe44a('0x32')][_0xe44a('0x42')]){_0x5d25f4[_0xe44a('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x5d25f4);})[_0xe44a('0x26')](function(_0x1ebb2d){_0x53cbe3[_0xe44a('0x44')]=_0x1ebb2d;return _0x53cbe3;})[_0xe44a('0x26')](respondWithFilteredResult(_0x1624bf,_0x5d25f4))[_0xe44a('0x45')](handleError(_0x1624bf,null));};exports[_0xe44a('0x46')]=function(_0x121fcf,_0x3d4389){var _0x5b8d95={'raw':![],'where':{'id':_0x121fcf['params']['id']}},_0x44d186={};_0x44d186[_0xe44a('0x31')]=_[_0xe44a('0x33')](db[_0xe44a('0x47')][_0xe44a('0x2d')]);_0x44d186['query']=_[_0xe44a('0x33')](_0x121fcf[_0xe44a('0x32')]);_0x44d186[_0xe44a('0x3d')]=_[_0xe44a('0x34')](_0x44d186[_0xe44a('0x31')],_0x44d186[_0xe44a('0x32')]);_0x5b8d95[_0xe44a('0x36')]=_[_0xe44a('0x34')](_0x44d186[_0xe44a('0x31')],qs[_0xe44a('0x35')](_0x121fcf['query'][_0xe44a('0x35')]));_0x5b8d95[_0xe44a('0x36')]=_0x5b8d95[_0xe44a('0x36')][_0xe44a('0x37')]?_0x5b8d95[_0xe44a('0x36')]:_0x44d186[_0xe44a('0x31')];if(_0x121fcf[_0xe44a('0x32')][_0xe44a('0x42')]){_0x5b8d95[_0xe44a('0x43')]=[{'all':!![]}];}_0x5b8d95=_['merge']({},_0x5b8d95,_0x121fcf[_0xe44a('0x41')]);return db[_0xe44a('0x47')][_0xe44a('0x48')](_0x5b8d95)[_0xe44a('0x26')](handleEntityNotFound(_0x3d4389,null))[_0xe44a('0x26')](respondWithResult(_0x3d4389,null))['catch'](handleError(_0x3d4389,null));};exports[_0xe44a('0x49')]=function(_0xd8b8f7,_0x595b6b){return db[_0xe44a('0x47')][_0xe44a('0x49')](_0xd8b8f7['body'],{})[_0xe44a('0x26')](respondWithResult(_0x595b6b,0xc9))['catch'](handleError(_0x595b6b,null));};exports['update']=function(_0x12b8e2,_0x326ca1){if(_0x12b8e2['body']['id']){delete _0x12b8e2[_0xe44a('0x4a')]['id'];}return db['Dynamics365Configuration'][_0xe44a('0x48')]({'where':{'id':_0x12b8e2['params']['id']}})[_0xe44a('0x26')](handleEntityNotFound(_0x326ca1,null))[_0xe44a('0x26')](saveUpdates(_0x12b8e2['body'],null))['then'](respondWithResult(_0x326ca1,null))['catch'](handleError(_0x326ca1,null));};exports[_0xe44a('0x27')]=function(_0x546a93,_0xdb712d){return db['Dynamics365Configuration'][_0xe44a('0x48')]({'where':{'id':_0x546a93[_0xe44a('0x4b')]['id']}})[_0xe44a('0x26')](handleEntityNotFound(_0xdb712d,null))[_0xe44a('0x26')](removeEntity(_0xdb712d,null))[_0xe44a('0x45')](handleError(_0xdb712d,null));};exports[_0xe44a('0x4c')]=function(_0x51b676,_0x1202cf,_0x3d733d){var _0x1838e3={};var _0x47e0fa={};var _0x39077c;var _0x1dfc64;return db[_0xe44a('0x47')][_0xe44a('0x4d')]({'where':{'id':_0x51b676['params']['id']}})['then'](handleEntityNotFound(_0x1202cf,null))[_0xe44a('0x26')](function(_0x5638a3){if(_0x5638a3){_0x39077c=_0x5638a3;_0x47e0fa[_0xe44a('0x31')]=_[_0xe44a('0x33')](db[_0xe44a('0x4e')][_0xe44a('0x2d')]);_0x47e0fa[_0xe44a('0x32')]=_[_0xe44a('0x33')](_0x51b676[_0xe44a('0x32')]);_0x47e0fa[_0xe44a('0x3d')]=_[_0xe44a('0x34')](_0x47e0fa['model'],_0x47e0fa['query']);_0x1838e3[_0xe44a('0x36')]=_[_0xe44a('0x34')](_0x47e0fa[_0xe44a('0x31')],qs['fields'](_0x51b676[_0xe44a('0x32')][_0xe44a('0x35')]));_0x1838e3[_0xe44a('0x36')]=_0x1838e3['attributes'][_0xe44a('0x37')]?_0x1838e3[_0xe44a('0x36')]:_0x47e0fa['model'];_0x1838e3[_0xe44a('0x3a')]=qs[_0xe44a('0x3b')](_0x51b676[_0xe44a('0x32')][_0xe44a('0x3b')]);_0x1838e3[_0xe44a('0x3c')]=qs[_0xe44a('0x3d')](_[_0xe44a('0x3e')](_0x51b676['query'],_0x47e0fa[_0xe44a('0x3d')]));if(_0x51b676[_0xe44a('0x32')][_0xe44a('0x40')]){_0x1838e3[_0xe44a('0x3c')]=_[_0xe44a('0x3f')](_0x1838e3[_0xe44a('0x3c')],{'$or':_['map'](_0x1838e3[_0xe44a('0x36')],function(_0x5d0e45){var _0x12c11a={};_0x12c11a[_0x5d0e45]={'$like':'%'+_0x51b676[_0xe44a('0x32')][_0xe44a('0x40')]+'%'};return _0x12c11a;})});}_0x1838e3=_['merge']({},_0x1838e3,_0x51b676['options']);return _0x39077c[_0xe44a('0x4c')](_0x1838e3);}})[_0xe44a('0x26')](function(_0x3fcf61){if(_0x3fcf61){_0x1dfc64=_0x3fcf61[_0xe44a('0x37')];if(!_0x51b676[_0xe44a('0x32')][_0xe44a('0x38')](_0xe44a('0x39'))){_0x1838e3['limit']=qs[_0xe44a('0x1f')](_0x51b676[_0xe44a('0x32')][_0xe44a('0x1f')]);_0x1838e3[_0xe44a('0x1d')]=qs[_0xe44a('0x1d')](_0x51b676['query']['offset']);}return _0x39077c['getFields'](_0x1838e3);}})[_0xe44a('0x26')](function(_0x203580){if(_0x203580){return _0x203580?{'count':_0x1dfc64,'rows':_0x203580}:null;}})[_0xe44a('0x26')](respondWithResult(_0x1202cf,null))['catch'](handleError(_0x1202cf,null));};exports[_0xe44a('0x4f')]=function(_0x15e150,_0x15baae,_0x152adf){var _0x20592b={};var _0x4eb795={};var _0x1f8549;var _0x22ddb1;return db[_0xe44a('0x47')][_0xe44a('0x4d')]({'where':{'id':_0x15e150[_0xe44a('0x4b')]['id']}})[_0xe44a('0x26')](handleEntityNotFound(_0x15baae,null))[_0xe44a('0x26')](function(_0x53ed07){if(_0x53ed07){_0x1f8549=_0x53ed07;_0x4eb795[_0xe44a('0x31')]=_['keys'](db[_0xe44a('0x4e')][_0xe44a('0x2d')]);_0x4eb795['query']=_['keys'](_0x15e150[_0xe44a('0x32')]);_0x4eb795[_0xe44a('0x3d')]=_[_0xe44a('0x34')](_0x4eb795[_0xe44a('0x31')],_0x4eb795[_0xe44a('0x32')]);_0x20592b[_0xe44a('0x36')]=_[_0xe44a('0x34')](_0x4eb795[_0xe44a('0x31')],qs['fields'](_0x15e150[_0xe44a('0x32')]['fields']));_0x20592b['attributes']=_0x20592b[_0xe44a('0x36')][_0xe44a('0x37')]?_0x20592b[_0xe44a('0x36')]:_0x4eb795[_0xe44a('0x31')];_0x20592b[_0xe44a('0x3a')]=qs[_0xe44a('0x3b')](_0x15e150['query'][_0xe44a('0x3b')]);_0x20592b[_0xe44a('0x3c')]=qs[_0xe44a('0x3d')](_['pick'](_0x15e150[_0xe44a('0x32')],_0x4eb795[_0xe44a('0x3d')]));if(_0x15e150[_0xe44a('0x32')][_0xe44a('0x40')]){_0x20592b[_0xe44a('0x3c')]=_[_0xe44a('0x3f')](_0x20592b['where'],{'$or':_[_0xe44a('0x2c')](_0x20592b[_0xe44a('0x36')],function(_0x55330d){var _0x1e2db3={};_0x1e2db3[_0x55330d]={'$like':'%'+_0x15e150[_0xe44a('0x32')][_0xe44a('0x40')]+'%'};return _0x1e2db3;})});}_0x20592b=_[_0xe44a('0x3f')]({},_0x20592b,_0x15e150[_0xe44a('0x41')]);return _0x1f8549[_0xe44a('0x4f')](_0x20592b);}})[_0xe44a('0x26')](function(_0x159651){if(_0x159651){_0x22ddb1=_0x159651[_0xe44a('0x37')];if(!_0x15e150[_0xe44a('0x32')][_0xe44a('0x38')](_0xe44a('0x39'))){_0x20592b[_0xe44a('0x1f')]=qs[_0xe44a('0x1f')](_0x15e150['query'][_0xe44a('0x1f')]);_0x20592b['offset']=qs[_0xe44a('0x1d')](_0x15e150[_0xe44a('0x32')][_0xe44a('0x1d')]);}return _0x1f8549[_0xe44a('0x4f')](_0x20592b);}})[_0xe44a('0x26')](function(_0x4ce40c){if(_0x4ce40c){return _0x4ce40c?{'count':_0x22ddb1,'rows':_0x4ce40c}:null;}})[_0xe44a('0x26')](respondWithResult(_0x15baae,null))[_0xe44a('0x45')](handleError(_0x15baae,null));};exports[_0xe44a('0x50')]=function(_0x459869,_0x16f427,_0x9d2c3a){var _0x3a5212={};var _0x1c0ad4={};var _0x293f58;var _0x1661e8;return db[_0xe44a('0x47')]['findOne']({'where':{'id':_0x459869[_0xe44a('0x4b')]['id']}})[_0xe44a('0x26')](handleEntityNotFound(_0x16f427,null))['then'](function(_0x4795c0){if(_0x4795c0){_0x293f58=_0x4795c0;_0x1c0ad4[_0xe44a('0x31')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x1c0ad4['query']=_['keys'](_0x459869[_0xe44a('0x32')]);_0x1c0ad4[_0xe44a('0x3d')]=_[_0xe44a('0x34')](_0x1c0ad4[_0xe44a('0x31')],_0x1c0ad4[_0xe44a('0x32')]);_0x3a5212[_0xe44a('0x36')]=_[_0xe44a('0x34')](_0x1c0ad4[_0xe44a('0x31')],qs[_0xe44a('0x35')](_0x459869['query'][_0xe44a('0x35')]));_0x3a5212[_0xe44a('0x36')]=_0x3a5212[_0xe44a('0x36')][_0xe44a('0x37')]?_0x3a5212[_0xe44a('0x36')]:_0x1c0ad4[_0xe44a('0x31')];_0x3a5212[_0xe44a('0x3a')]=qs[_0xe44a('0x3b')](_0x459869[_0xe44a('0x32')][_0xe44a('0x3b')]);_0x3a5212['where']=qs[_0xe44a('0x3d')](_[_0xe44a('0x3e')](_0x459869['query'],_0x1c0ad4[_0xe44a('0x3d')]));if(_0x459869[_0xe44a('0x32')][_0xe44a('0x40')]){_0x3a5212[_0xe44a('0x3c')]=_[_0xe44a('0x3f')](_0x3a5212[_0xe44a('0x3c')],{'$or':_[_0xe44a('0x2c')](_0x3a5212[_0xe44a('0x36')],function(_0x2b0cd3){var _0x114c94={};_0x114c94[_0x2b0cd3]={'$like':'%'+_0x459869['query'][_0xe44a('0x40')]+'%'};return _0x114c94;})});}_0x3a5212=_['merge']({},_0x3a5212,_0x459869[_0xe44a('0x41')]);return _0x293f58[_0xe44a('0x50')](_0x3a5212);}})[_0xe44a('0x26')](function(_0x5220fa){if(_0x5220fa){_0x1661e8=_0x5220fa[_0xe44a('0x37')];if(!_0x459869[_0xe44a('0x32')]['hasOwnProperty']('nolimit')){_0x3a5212[_0xe44a('0x1f')]=qs['limit'](_0x459869['query'][_0xe44a('0x1f')]);_0x3a5212[_0xe44a('0x1d')]=qs[_0xe44a('0x1d')](_0x459869[_0xe44a('0x32')]['offset']);}return _0x293f58[_0xe44a('0x50')](_0x3a5212);}})['then'](function(_0x2180f0){if(_0x2180f0){return _0x2180f0?{'count':_0x1661e8,'rows':_0x2180f0}:null;}})[_0xe44a('0x26')](respondWithResult(_0x16f427,null))['catch'](handleError(_0x16f427,null));}; \ No newline at end of file +var _0xfef8=['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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','apply','reject','update','then','destroy','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','params','find','catch','create','body','Dynamics365Field','getFields','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfef8,0xe3));var _0x8fef=function(_0x48e013,_0x59141){_0x48e013=_0x48e013-0x0;var _0x29f667=_0xfef8[_0x48e013];return _0x29f667;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fef('0x0'));var zipdir=require(_0x8fef('0x1'));var jsonpatch=require(_0x8fef('0x2'));var rp=require(_0x8fef('0x3'));var moment=require(_0x8fef('0x4'));var BPromise=require(_0x8fef('0x5'));var Mustache=require(_0x8fef('0x6'));var util=require(_0x8fef('0x7'));var path=require(_0x8fef('0x8'));var sox=require(_0x8fef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8fef('0xa'));var _=require(_0x8fef('0xb'));var squel=require('squel');var crypto=require(_0x8fef('0xc'));var jsforce=require(_0x8fef('0xd'));var deskjs=require(_0x8fef('0xe'));var toCsv=require(_0x8fef('0xf'));var querystring=require(_0x8fef('0x10'));var Papa=require(_0x8fef('0x11'));var Redis=require(_0x8fef('0x12'));var authService=require(_0x8fef('0x13'));var qs=require(_0x8fef('0x14'));var as=require(_0x8fef('0x15'));var hardwareService=require(_0x8fef('0x16'));var logger=require(_0x8fef('0x17'))('api');var utils=require(_0x8fef('0x18'));var config=require(_0x8fef('0x19'));var licenseUtil=require(_0x8fef('0x1a'));var db=require(_0x8fef('0x1b'))['db'];function respondWithStatusCode(_0x337f5f,_0x310c24){_0x310c24=_0x310c24||0xcc;return function(_0x500ef5){if(_0x500ef5){return _0x337f5f[_0x8fef('0x1c')](_0x310c24);}return _0x337f5f[_0x8fef('0x1d')](_0x310c24)[_0x8fef('0x1e')]();};}function respondWithResult(_0x560c0b,_0xce7287){_0xce7287=_0xce7287||0xc8;return function(_0x4c7a7f){if(_0x4c7a7f){return _0x560c0b[_0x8fef('0x1d')](_0xce7287)[_0x8fef('0x1f')](_0x4c7a7f);}};}function respondWithFilteredResult(_0x5d25ce,_0x3936fd){return function(_0x5da13f){if(_0x5da13f){var _0x51449d=typeof _0x3936fd[_0x8fef('0x20')]==='undefined'&&typeof _0x3936fd['limit']==='undefined';var _0x5a81ed=_0x5da13f[_0x8fef('0x21')];var _0x2574ed=_0x51449d?0x0:_0x3936fd[_0x8fef('0x20')];var _0x3cde87=_0x51449d?_0x5da13f[_0x8fef('0x21')]:_0x3936fd['offset']+_0x3936fd[_0x8fef('0x22')];var _0x3877e3;if(_0x3cde87>=_0x5a81ed){_0x3cde87=_0x5a81ed;_0x3877e3=0xc8;}else{_0x3877e3=0xce;}_0x5d25ce[_0x8fef('0x1d')](_0x3877e3);return _0x5d25ce[_0x8fef('0x23')]('Content-Range',_0x2574ed+'-'+_0x3cde87+'/'+_0x5a81ed)['json'](_0x5da13f);}return null;};}function patchUpdates(_0x13f12f){return function(_0x964885){try{jsonpatch[_0x8fef('0x24')](_0x964885,_0x13f12f,!![]);}catch(_0x17c8d1){return BPromise[_0x8fef('0x25')](_0x17c8d1);}return _0x964885['save']();};}function saveUpdates(_0x7adcd6,_0xc48b6c){return function(_0x45b789){if(_0x45b789){return _0x45b789[_0x8fef('0x26')](_0x7adcd6)[_0x8fef('0x27')](function(_0x38b1ac){return _0x38b1ac;});}return null;};}function removeEntity(_0x3bace5,_0x5beb53){return function(_0x286fca){if(_0x286fca){return _0x286fca[_0x8fef('0x28')]()[_0x8fef('0x27')](function(){_0x3bace5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22cf1e,_0x578046){return function(_0x48e7a1){if(!_0x48e7a1){_0x22cf1e['sendStatus'](0x194);}return _0x48e7a1;};}function handleError(_0x3e0018,_0x5e3b21){_0x5e3b21=_0x5e3b21||0x1f4;return function(_0xb54c0b){logger['error'](_0xb54c0b[_0x8fef('0x29')]);if(_0xb54c0b[_0x8fef('0x2a')]){delete _0xb54c0b['name'];}_0x3e0018[_0x8fef('0x1d')](_0x5e3b21)[_0x8fef('0x2b')](_0xb54c0b);};}exports[_0x8fef('0x2c')]=function(_0x5a84fc,_0x2e94d9){var _0x4f69f3={},_0x39e87f={},_0x21e905={'count':0x0,'rows':[]};var _0x198f4f=_['map'](db[_0x8fef('0x2d')][_0x8fef('0x2e')],function(_0x1b6f42){return{'name':_0x1b6f42[_0x8fef('0x2f')],'type':_0x1b6f42[_0x8fef('0x30')][_0x8fef('0x31')]};});_0x39e87f[_0x8fef('0x32')]=_[_0x8fef('0x33')](_0x198f4f,'name');_0x39e87f[_0x8fef('0x34')]=_[_0x8fef('0x35')](_0x5a84fc[_0x8fef('0x34')]);_0x39e87f[_0x8fef('0x36')]=_[_0x8fef('0x37')](_0x39e87f[_0x8fef('0x32')],_0x39e87f[_0x8fef('0x34')]);_0x4f69f3['attributes']=_[_0x8fef('0x37')](_0x39e87f[_0x8fef('0x32')],qs['fields'](_0x5a84fc['query'][_0x8fef('0x38')]));_0x4f69f3[_0x8fef('0x39')]=_0x4f69f3[_0x8fef('0x39')][_0x8fef('0x3a')]?_0x4f69f3[_0x8fef('0x39')]:_0x39e87f[_0x8fef('0x32')];if(!_0x5a84fc[_0x8fef('0x34')][_0x8fef('0x3b')](_0x8fef('0x3c'))){_0x4f69f3[_0x8fef('0x22')]=qs[_0x8fef('0x22')](_0x5a84fc['query'][_0x8fef('0x22')]);_0x4f69f3[_0x8fef('0x20')]=qs[_0x8fef('0x20')](_0x5a84fc[_0x8fef('0x34')][_0x8fef('0x20')]);}_0x4f69f3[_0x8fef('0x3d')]=qs[_0x8fef('0x3e')](_0x5a84fc[_0x8fef('0x34')][_0x8fef('0x3e')]);_0x4f69f3[_0x8fef('0x3f')]=qs[_0x8fef('0x36')](_[_0x8fef('0x40')](_0x5a84fc[_0x8fef('0x34')],_0x39e87f[_0x8fef('0x36')]),_0x198f4f);if(_0x5a84fc['query'][_0x8fef('0x41')]){_0x4f69f3['where']=_[_0x8fef('0x42')](_0x4f69f3[_0x8fef('0x3f')],{'$or':_['map'](_0x198f4f,function(_0x4a2547){if(_0x4a2547[_0x8fef('0x30')]!=='VIRTUAL'){var _0x4b44df={};_0x4b44df[_0x4a2547[_0x8fef('0x2a')]]={'$like':'%'+_0x5a84fc[_0x8fef('0x34')][_0x8fef('0x41')]+'%'};return _0x4b44df;}})});}_0x4f69f3=_[_0x8fef('0x42')]({},_0x4f69f3,_0x5a84fc[_0x8fef('0x43')]);var _0x40bb06={'where':_0x4f69f3[_0x8fef('0x3f')]};return db[_0x8fef('0x2d')][_0x8fef('0x21')](_0x40bb06)['then'](function(_0x37e603){_0x21e905[_0x8fef('0x21')]=_0x37e603;if(_0x5a84fc[_0x8fef('0x34')]['includeAll']){_0x4f69f3[_0x8fef('0x44')]=[{'all':!![]}];}return db[_0x8fef('0x2d')]['findAll'](_0x4f69f3);})['then'](function(_0x33e4b5){_0x21e905['rows']=_0x33e4b5;return _0x21e905;})[_0x8fef('0x27')](respondWithFilteredResult(_0x2e94d9,_0x4f69f3))['catch'](handleError(_0x2e94d9,null));};exports['show']=function(_0x52b311,_0x4777d4){var _0xec6ad7={'raw':![],'where':{'id':_0x52b311[_0x8fef('0x45')]['id']}},_0x31304e={};_0x31304e[_0x8fef('0x32')]=_[_0x8fef('0x35')](db['Dynamics365Configuration']['rawAttributes']);_0x31304e[_0x8fef('0x34')]=_[_0x8fef('0x35')](_0x52b311[_0x8fef('0x34')]);_0x31304e['filters']=_[_0x8fef('0x37')](_0x31304e['model'],_0x31304e['query']);_0xec6ad7[_0x8fef('0x39')]=_[_0x8fef('0x37')](_0x31304e['model'],qs[_0x8fef('0x38')](_0x52b311['query'][_0x8fef('0x38')]));_0xec6ad7[_0x8fef('0x39')]=_0xec6ad7[_0x8fef('0x39')]['length']?_0xec6ad7[_0x8fef('0x39')]:_0x31304e[_0x8fef('0x32')];if(_0x52b311['query']['includeAll']){_0xec6ad7[_0x8fef('0x44')]=[{'all':!![]}];}_0xec6ad7=_[_0x8fef('0x42')]({},_0xec6ad7,_0x52b311['options']);return db[_0x8fef('0x2d')][_0x8fef('0x46')](_0xec6ad7)['then'](handleEntityNotFound(_0x4777d4,null))[_0x8fef('0x27')](respondWithResult(_0x4777d4,null))[_0x8fef('0x47')](handleError(_0x4777d4,null));};exports[_0x8fef('0x48')]=function(_0x30ecc3,_0x1ea99d){return db['Dynamics365Configuration']['create'](_0x30ecc3[_0x8fef('0x49')],{})[_0x8fef('0x27')](respondWithResult(_0x1ea99d,0xc9))[_0x8fef('0x47')](handleError(_0x1ea99d,null));};exports[_0x8fef('0x26')]=function(_0x498520,_0xb6998){if(_0x498520[_0x8fef('0x49')]['id']){delete _0x498520['body']['id'];}return db[_0x8fef('0x2d')]['find']({'where':{'id':_0x498520['params']['id']}})[_0x8fef('0x27')](handleEntityNotFound(_0xb6998,null))['then'](saveUpdates(_0x498520[_0x8fef('0x49')],null))[_0x8fef('0x27')](respondWithResult(_0xb6998,null))[_0x8fef('0x47')](handleError(_0xb6998,null));};exports[_0x8fef('0x28')]=function(_0x208f65,_0x23eeaa){return db['Dynamics365Configuration'][_0x8fef('0x46')]({'where':{'id':_0x208f65[_0x8fef('0x45')]['id']}})[_0x8fef('0x27')](handleEntityNotFound(_0x23eeaa,null))[_0x8fef('0x27')](removeEntity(_0x23eeaa,null))[_0x8fef('0x47')](handleError(_0x23eeaa,null));};exports['getFields']=function(_0x5e8da7,_0x46f2e2,_0x131946){var _0xe95bab={};var _0xda096e={};var _0x1fdb63;var _0x3d0f7e;return db[_0x8fef('0x2d')]['findOne']({'where':{'id':_0x5e8da7[_0x8fef('0x45')]['id']}})[_0x8fef('0x27')](handleEntityNotFound(_0x46f2e2,null))[_0x8fef('0x27')](function(_0x55938c){if(_0x55938c){_0x1fdb63=_0x55938c;_0xda096e[_0x8fef('0x32')]=_[_0x8fef('0x35')](db[_0x8fef('0x4a')][_0x8fef('0x2e')]);_0xda096e[_0x8fef('0x34')]=_[_0x8fef('0x35')](_0x5e8da7[_0x8fef('0x34')]);_0xda096e[_0x8fef('0x36')]=_[_0x8fef('0x37')](_0xda096e[_0x8fef('0x32')],_0xda096e[_0x8fef('0x34')]);_0xe95bab[_0x8fef('0x39')]=_['intersection'](_0xda096e[_0x8fef('0x32')],qs['fields'](_0x5e8da7[_0x8fef('0x34')][_0x8fef('0x38')]));_0xe95bab[_0x8fef('0x39')]=_0xe95bab[_0x8fef('0x39')][_0x8fef('0x3a')]?_0xe95bab[_0x8fef('0x39')]:_0xda096e['model'];_0xe95bab[_0x8fef('0x3d')]=qs[_0x8fef('0x3e')](_0x5e8da7['query']['sort']);_0xe95bab[_0x8fef('0x3f')]=qs[_0x8fef('0x36')](_[_0x8fef('0x40')](_0x5e8da7[_0x8fef('0x34')],_0xda096e[_0x8fef('0x36')]));if(_0x5e8da7['query']['filter']){_0xe95bab[_0x8fef('0x3f')]=_[_0x8fef('0x42')](_0xe95bab['where'],{'$or':_['map'](_0xe95bab[_0x8fef('0x39')],function(_0x1f0fed){var _0x58bcb8={};_0x58bcb8[_0x1f0fed]={'$like':'%'+_0x5e8da7['query'][_0x8fef('0x41')]+'%'};return _0x58bcb8;})});}_0xe95bab=_[_0x8fef('0x42')]({},_0xe95bab,_0x5e8da7[_0x8fef('0x43')]);return _0x1fdb63[_0x8fef('0x4b')](_0xe95bab);}})[_0x8fef('0x27')](function(_0x2378aa){if(_0x2378aa){_0x3d0f7e=_0x2378aa[_0x8fef('0x3a')];if(!_0x5e8da7[_0x8fef('0x34')][_0x8fef('0x3b')](_0x8fef('0x3c'))){_0xe95bab[_0x8fef('0x22')]=qs[_0x8fef('0x22')](_0x5e8da7[_0x8fef('0x34')]['limit']);_0xe95bab['offset']=qs[_0x8fef('0x20')](_0x5e8da7[_0x8fef('0x34')][_0x8fef('0x20')]);}return _0x1fdb63['getFields'](_0xe95bab);}})['then'](function(_0x43864b){if(_0x43864b){return _0x43864b?{'count':_0x3d0f7e,'rows':_0x43864b}:null;}})['then'](respondWithResult(_0x46f2e2,null))[_0x8fef('0x47')](handleError(_0x46f2e2,null));};exports[_0x8fef('0x4c')]=function(_0x845558,_0x4164f5,_0x25ba1c){var _0x4810bf={};var _0xa7e495={};var _0x510f57;var _0x1e89d6;return db['Dynamics365Configuration'][_0x8fef('0x4d')]({'where':{'id':_0x845558[_0x8fef('0x45')]['id']}})[_0x8fef('0x27')](handleEntityNotFound(_0x4164f5,null))[_0x8fef('0x27')](function(_0x46de36){if(_0x46de36){_0x510f57=_0x46de36;_0xa7e495['model']=_['keys'](db[_0x8fef('0x4a')][_0x8fef('0x2e')]);_0xa7e495[_0x8fef('0x34')]=_[_0x8fef('0x35')](_0x845558[_0x8fef('0x34')]);_0xa7e495[_0x8fef('0x36')]=_[_0x8fef('0x37')](_0xa7e495[_0x8fef('0x32')],_0xa7e495[_0x8fef('0x34')]);_0x4810bf[_0x8fef('0x39')]=_['intersection'](_0xa7e495[_0x8fef('0x32')],qs['fields'](_0x845558[_0x8fef('0x34')][_0x8fef('0x38')]));_0x4810bf[_0x8fef('0x39')]=_0x4810bf[_0x8fef('0x39')][_0x8fef('0x3a')]?_0x4810bf[_0x8fef('0x39')]:_0xa7e495[_0x8fef('0x32')];_0x4810bf['order']=qs['sort'](_0x845558['query']['sort']);_0x4810bf['where']=qs[_0x8fef('0x36')](_['pick'](_0x845558['query'],_0xa7e495[_0x8fef('0x36')]));if(_0x845558[_0x8fef('0x34')][_0x8fef('0x41')]){_0x4810bf['where']=_[_0x8fef('0x42')](_0x4810bf[_0x8fef('0x3f')],{'$or':_[_0x8fef('0x33')](_0x4810bf['attributes'],function(_0x592668){var _0x184882={};_0x184882[_0x592668]={'$like':'%'+_0x845558[_0x8fef('0x34')][_0x8fef('0x41')]+'%'};return _0x184882;})});}_0x4810bf=_['merge']({},_0x4810bf,_0x845558[_0x8fef('0x43')]);return _0x510f57['getSubjects'](_0x4810bf);}})[_0x8fef('0x27')](function(_0x23cd75){if(_0x23cd75){_0x1e89d6=_0x23cd75['length'];if(!_0x845558['query'][_0x8fef('0x3b')](_0x8fef('0x3c'))){_0x4810bf['limit']=qs[_0x8fef('0x22')](_0x845558[_0x8fef('0x34')][_0x8fef('0x22')]);_0x4810bf[_0x8fef('0x20')]=qs[_0x8fef('0x20')](_0x845558[_0x8fef('0x34')]['offset']);}return _0x510f57['getSubjects'](_0x4810bf);}})[_0x8fef('0x27')](function(_0x5ce0e6){if(_0x5ce0e6){return _0x5ce0e6?{'count':_0x1e89d6,'rows':_0x5ce0e6}:null;}})[_0x8fef('0x27')](respondWithResult(_0x4164f5,null))['catch'](handleError(_0x4164f5,null));};exports[_0x8fef('0x4e')]=function(_0x204cae,_0xc3e7d9,_0xf4202d){var _0x82ba80={};var _0x57469d={};var _0x1e81bc;var _0x1f93d6;return db[_0x8fef('0x2d')]['findOne']({'where':{'id':_0x204cae[_0x8fef('0x45')]['id']}})[_0x8fef('0x27')](handleEntityNotFound(_0xc3e7d9,null))[_0x8fef('0x27')](function(_0x5e3fba){if(_0x5e3fba){_0x1e81bc=_0x5e3fba;_0x57469d[_0x8fef('0x32')]=_[_0x8fef('0x35')](db[_0x8fef('0x4a')][_0x8fef('0x2e')]);_0x57469d[_0x8fef('0x34')]=_[_0x8fef('0x35')](_0x204cae[_0x8fef('0x34')]);_0x57469d[_0x8fef('0x36')]=_['intersection'](_0x57469d[_0x8fef('0x32')],_0x57469d[_0x8fef('0x34')]);_0x82ba80['attributes']=_['intersection'](_0x57469d[_0x8fef('0x32')],qs[_0x8fef('0x38')](_0x204cae[_0x8fef('0x34')][_0x8fef('0x38')]));_0x82ba80['attributes']=_0x82ba80['attributes'][_0x8fef('0x3a')]?_0x82ba80['attributes']:_0x57469d[_0x8fef('0x32')];_0x82ba80[_0x8fef('0x3d')]=qs[_0x8fef('0x3e')](_0x204cae[_0x8fef('0x34')][_0x8fef('0x3e')]);_0x82ba80['where']=qs[_0x8fef('0x36')](_[_0x8fef('0x40')](_0x204cae['query'],_0x57469d[_0x8fef('0x36')]));if(_0x204cae['query'][_0x8fef('0x41')]){_0x82ba80['where']=_[_0x8fef('0x42')](_0x82ba80['where'],{'$or':_[_0x8fef('0x33')](_0x82ba80['attributes'],function(_0x2c34ba){var _0x32a937={};_0x32a937[_0x2c34ba]={'$like':'%'+_0x204cae['query']['filter']+'%'};return _0x32a937;})});}_0x82ba80=_[_0x8fef('0x42')]({},_0x82ba80,_0x204cae['options']);return _0x1e81bc[_0x8fef('0x4e')](_0x82ba80);}})[_0x8fef('0x27')](function(_0x57df8d){if(_0x57df8d){_0x1f93d6=_0x57df8d[_0x8fef('0x3a')];if(!_0x204cae['query']['hasOwnProperty'](_0x8fef('0x3c'))){_0x82ba80[_0x8fef('0x22')]=qs[_0x8fef('0x22')](_0x204cae['query'][_0x8fef('0x22')]);_0x82ba80[_0x8fef('0x20')]=qs[_0x8fef('0x20')](_0x204cae[_0x8fef('0x34')][_0x8fef('0x20')]);}return _0x1e81bc[_0x8fef('0x4e')](_0x82ba80);}})[_0x8fef('0x27')](function(_0xf2a5fc){if(_0xf2a5fc){return _0xf2a5fc?{'count':_0x1f93d6,'rows':_0xf2a5fc}:null;}})[_0x8fef('0x27')](respondWithResult(_0xc3e7d9,null))[_0x8fef('0x47')](handleError(_0xc3e7d9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index c633aa2..a7624b0 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 _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x55ca,0x126));var _0xa55c=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0x55ca[_0xfcdda0];return _0x17ebe3;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x461dd7,_0x59c4c1){var _0x16e343=function(_0x1b6b76){while(--_0x1b6b76){_0x461dd7['push'](_0x461dd7['shift']());}};_0x16e343(++_0x59c4c1);}(_0x54ef,0x112));var _0xf54e=function(_0x36e1b2,_0x46ff84){_0x36e1b2=_0x36e1b2-0x0;var _0xe8a9a=_0x54ef[_0x36e1b2];return _0xe8a9a;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 16d5e8a..5791835 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 _0x079b=['message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x079b,0x1e7));var _0xb079=function(_0x579b79,_0x5b57b2){_0x579b79=_0x579b79-0x0;var _0x41e899=_0x079b[_0x579b79];return _0x41e899;};'use strict';var _=require(_0xb079('0x0'));var util=require('util');var moment=require(_0xb079('0x1'));var BPromise=require(_0xb079('0x2'));var rs=require(_0xb079('0x3'));var fs=require('fs');var Redis=require(_0xb079('0x4'));var db=require(_0xb079('0x5'))['db'];var utils=require(_0xb079('0x6'));var logger=require(_0xb079('0x7'))(_0xb079('0x8'));var config=require(_0xb079('0x9'));var jayson=require(_0xb079('0xa'));var client=jayson['client'][_0xb079('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49d85b,_0x3202b8,_0x5eff14){return new BPromise(function(_0x182b1d,_0x582fcc){return client['request'](_0x49d85b,_0x5eff14)[_0xb079('0xc')](function(_0x1950db){logger['info'](_0xb079('0xd'),_0x3202b8,_0xb079('0xe'));logger[_0xb079('0xf')](_0xb079('0x10'),_0x3202b8,_0xb079('0xe'),JSON['stringify'](_0x1950db));if(_0x1950db[_0xb079('0x11')]){if(_0x1950db[_0xb079('0x11')][_0xb079('0x12')]===0x1f4){logger[_0xb079('0x11')](_0xb079('0xd'),_0x3202b8,_0x1950db[_0xb079('0x11')][_0xb079('0x13')]);return _0x582fcc(_0x1950db[_0xb079('0x11')][_0xb079('0x13')]);}logger[_0xb079('0x11')](_0xb079('0xd'),_0x3202b8,_0x1950db[_0xb079('0x11')][_0xb079('0x13')]);return _0x182b1d(_0x1950db[_0xb079('0x11')]['message']);}else{logger[_0xb079('0x14')](_0xb079('0xd'),_0x3202b8,_0xb079('0xe'));_0x182b1d(_0x1950db[_0xb079('0x15')]['message']);}})['catch'](function(_0xcff343){logger['error'](_0xb079('0xd'),_0x3202b8,_0xcff343);_0x582fcc(_0xcff343);});});} \ No newline at end of file +var _0x962d=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x551fbe,_0x3a78b3){var _0x5b02ac=function(_0x1948ec){while(--_0x1948ec){_0x551fbe['push'](_0x551fbe['shift']());}};_0x5b02ac(++_0x3a78b3);}(_0x962d,0xb7));var _0xd962=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0x962d[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0xd962('0x0'));var util=require(_0xd962('0x1'));var moment=require(_0xd962('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd962('0x3'));var db=require(_0xd962('0x4'))['db'];var utils=require(_0xd962('0x5'));var logger=require(_0xd962('0x6'))(_0xd962('0x7'));var config=require(_0xd962('0x8'));var jayson=require(_0xd962('0x9'));var client=jayson[_0xd962('0xa')][_0xd962('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5d39,_0x185b62,_0x5ac6bd){return new BPromise(function(_0x24dc72,_0x49ebba){return client[_0xd962('0xc')](_0x1d5d39,_0x5ac6bd)[_0xd962('0xd')](function(_0x4b0ad2){logger['info'](_0xd962('0xe'),_0x185b62,'request\x20sent');logger['debug'](_0xd962('0xf'),_0x185b62,_0xd962('0x10'),JSON['stringify'](_0x4b0ad2));if(_0x4b0ad2[_0xd962('0x11')]){if(_0x4b0ad2[_0xd962('0x11')]['code']===0x1f4){logger[_0xd962('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x185b62,_0x4b0ad2[_0xd962('0x11')][_0xd962('0x12')]);return _0x49ebba(_0x4b0ad2[_0xd962('0x11')]['message']);}logger[_0xd962('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x185b62,_0x4b0ad2[_0xd962('0x11')][_0xd962('0x12')]);return _0x24dc72(_0x4b0ad2['error']['message']);}else{logger['info'](_0xd962('0xe'),_0x185b62,_0xd962('0x10'));_0x24dc72(_0x4b0ad2[_0xd962('0x13')][_0xd962('0x12')]);}})[_0xd962('0x14')](function(_0x5ea0aa){logger[_0xd962('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x185b62,_0x5ea0aa);_0x49ebba(_0x5ea0aa);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4637326..69232a7 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 _0x3416=['post','create','put','/:id','update','delete','exports','util','connect-timeout','express','isAuthenticated','get','show'];(function(_0x41ac90,_0x2b9187){var _0x39eb86=function(_0x186953){while(--_0x186953){_0x41ac90['push'](_0x41ac90['shift']());}};_0x39eb86(++_0x2b9187);}(_0x3416,0x7c));var _0x6341=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x3416[_0x57fa33];return _0x12e724;};'use strict';var multer=require('multer');var util=require(_0x6341('0x0'));var path=require('path');var timeout=require(_0x6341('0x1'));var express=require(_0x6341('0x2'));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('../../config/environment');var controller=require('./intDynamics365Field.controller');router['get']('/',auth[_0x6341('0x3')](),controller['index']);router[_0x6341('0x4')]('/:id',auth[_0x6341('0x3')](),controller[_0x6341('0x5')]);router[_0x6341('0x6')]('/',auth['isAuthenticated'](),controller[_0x6341('0x7')]);router[_0x6341('0x8')](_0x6341('0x9'),auth[_0x6341('0x3')](),controller[_0x6341('0xa')]);router[_0x6341('0xb')](_0x6341('0x9'),auth[_0x6341('0x3')](),controller['destroy']);module[_0x6341('0xc')]=router; \ No newline at end of file +var _0x5fd6=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports'];(function(_0x3f8fc9,_0x2c8ff5){var _0x2696b0=function(_0x357e97){while(--_0x357e97){_0x3f8fc9['push'](_0x3f8fc9['shift']());}};_0x2696b0(++_0x2c8ff5);}(_0x5fd6,0x1f4));var _0x65fd=function(_0x57ea61,_0x1781e2){_0x57ea61=_0x57ea61-0x0;var _0x2e4495=_0x5fd6[_0x57ea61];return _0x2e4495;};'use strict';var multer=require(_0x65fd('0x0'));var util=require('util');var path=require(_0x65fd('0x1'));var timeout=require(_0x65fd('0x2'));var express=require(_0x65fd('0x3'));var router=express[_0x65fd('0x4')]();var fs_extra=require(_0x65fd('0x5'));var auth=require(_0x65fd('0x6'));var interaction=require(_0x65fd('0x7'));var config=require(_0x65fd('0x8'));var controller=require(_0x65fd('0x9'));router[_0x65fd('0xa')]('/',auth[_0x65fd('0xb')](),controller['index']);router[_0x65fd('0xa')](_0x65fd('0xc'),auth[_0x65fd('0xb')](),controller[_0x65fd('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65fd('0xe')]);router[_0x65fd('0xf')]('/:id',auth[_0x65fd('0xb')](),controller[_0x65fd('0x10')]);router[_0x65fd('0x11')](_0x65fd('0xc'),auth[_0x65fd('0xb')](),controller[_0x65fd('0x12')]);module[_0x65fd('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index e19e13f..7cce45d 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 _0x391a=['customVariable','keyValue','picklist','STRING','variable','ENUM','string'];(function(_0x223649,_0x2de456){var _0x1f863a=function(_0x3142ff){while(--_0x3142ff){_0x223649['push'](_0x223649['shift']());}};_0x1f863a(++_0x2de456);}(_0x391a,0x132));var _0xa391=function(_0x1e1185,_0x35ca20){_0x1e1185=_0x1e1185-0x0;var _0x50615d=_0x391a[_0x1e1185];return _0x50615d;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xa391('0x0')](_0xa391('0x1'),'variable',_0xa391('0x2'),_0xa391('0x3'),_0xa391('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa391('0x5')]},'key':{'type':Sequelize[_0xa391('0x5')]},'keyType':{'type':Sequelize[_0xa391('0x0')](_0xa391('0x1'),_0xa391('0x6'),_0xa391('0x2'))},'keyContent':{'type':Sequelize[_0xa391('0x5')]},'idField':{'type':Sequelize[_0xa391('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa391('0x5')]}}; \ No newline at end of file +var _0xe4d3=['exports','ENUM','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x554ae1,_0x40f0b7){var _0x353342=function(_0x3e7287){while(--_0x3e7287){_0x554ae1['push'](_0x554ae1['shift']());}};_0x353342(++_0x40f0b7);}(_0xe4d3,0x15f));var _0x3e4d=function(_0x24f81d,_0x125e9e){_0x24f81d=_0x24f81d-0x0;var _0x997239=_0xe4d3[_0x24f81d];return _0x997239;};'use strict';var Sequelize=require(_0x3e4d('0x0'));module[_0x3e4d('0x1')]={'type':{'type':Sequelize[_0x3e4d('0x2')]('string','variable','customVariable',_0x3e4d('0x3'),_0x3e4d('0x4')),'defaultValue':_0x3e4d('0x5')},'content':{'type':Sequelize[_0x3e4d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3e4d('0x2')](_0x3e4d('0x5'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x3e4d('0x6')]},'idField':{'type':Sequelize[_0x3e4d('0x6')]},'nameField':{'type':Sequelize[_0x3e4d('0x6')]},'customField':{'type':Sequelize[_0x3e4d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3e4d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 072a11a..74e6a3d 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 _0x38ad=['path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','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','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','Dynamics365Field','type','key','map','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x49cae1,_0x30b04c){var _0x5c42a5=function(_0x5062eb){while(--_0x5062eb){_0x49cae1['push'](_0x49cae1['shift']());}};_0x5c42a5(++_0x30b04c);}(_0x38ad,0x95));var _0xd38a=function(_0x3f60f2,_0x354d55){_0x3f60f2=_0x3f60f2-0x0;var _0x4f5711=_0x38ad[_0x3f60f2];return _0x4f5711;};'use strict';var emlformat=require(_0xd38a('0x0'));var rimraf=require(_0xd38a('0x1'));var zipdir=require(_0xd38a('0x2'));var jsonpatch=require(_0xd38a('0x3'));var rp=require(_0xd38a('0x4'));var moment=require(_0xd38a('0x5'));var BPromise=require(_0xd38a('0x6'));var Mustache=require(_0xd38a('0x7'));var util=require(_0xd38a('0x8'));var path=require(_0xd38a('0x9'));var sox=require(_0xd38a('0xa'));var csv=require('to-csv');var ejs=require(_0xd38a('0xb'));var fs=require('fs');var fs_extra=require(_0xd38a('0xc'));var _=require(_0xd38a('0xd'));var squel=require(_0xd38a('0xe'));var crypto=require(_0xd38a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd38a('0x10'));var toCsv=require(_0xd38a('0x11'));var querystring=require(_0xd38a('0x12'));var Papa=require(_0xd38a('0x13'));var Redis=require(_0xd38a('0x14'));var authService=require(_0xd38a('0x15'));var qs=require(_0xd38a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd38a('0x17'));var logger=require(_0xd38a('0x18'))('api');var utils=require(_0xd38a('0x19'));var config=require(_0xd38a('0x1a'));var licenseUtil=require(_0xd38a('0x1b'));var db=require(_0xd38a('0x1c'))['db'];function respondWithStatusCode(_0x5ae959,_0x165580){_0x165580=_0x165580||0xcc;return function(_0x2f056a){if(_0x2f056a){return _0x5ae959[_0xd38a('0x1d')](_0x165580);}return _0x5ae959[_0xd38a('0x1e')](_0x165580)[_0xd38a('0x1f')]();};}function respondWithResult(_0x1e27e4,_0x38999c){_0x38999c=_0x38999c||0xc8;return function(_0x33f0d4){if(_0x33f0d4){return _0x1e27e4[_0xd38a('0x1e')](_0x38999c)[_0xd38a('0x20')](_0x33f0d4);}};}function respondWithFilteredResult(_0x411929,_0x5878e1){return function(_0x1de137){if(_0x1de137){var _0x14a335=typeof _0x5878e1[_0xd38a('0x21')]===_0xd38a('0x22')&&typeof _0x5878e1[_0xd38a('0x23')]===_0xd38a('0x22');var _0x1baa8b=_0x1de137[_0xd38a('0x24')];var _0x5ce78b=_0x14a335?0x0:_0x5878e1[_0xd38a('0x21')];var _0x56c1d0=_0x14a335?_0x1de137[_0xd38a('0x24')]:_0x5878e1[_0xd38a('0x21')]+_0x5878e1['limit'];var _0x530cb7;if(_0x56c1d0>=_0x1baa8b){_0x56c1d0=_0x1baa8b;_0x530cb7=0xc8;}else{_0x530cb7=0xce;}_0x411929[_0xd38a('0x1e')](_0x530cb7);return _0x411929[_0xd38a('0x25')](_0xd38a('0x26'),_0x5ce78b+'-'+_0x56c1d0+'/'+_0x1baa8b)['json'](_0x1de137);}return null;};}function patchUpdates(_0x15c52c){return function(_0x1d3f38){try{jsonpatch[_0xd38a('0x27')](_0x1d3f38,_0x15c52c,!![]);}catch(_0x20d5de){return BPromise[_0xd38a('0x28')](_0x20d5de);}return _0x1d3f38[_0xd38a('0x29')]();};}function saveUpdates(_0x590cda,_0xe1d1ad){return function(_0x2f594a){if(_0x2f594a){return _0x2f594a[_0xd38a('0x2a')](_0x590cda)['then'](function(_0x44c9d1){return _0x44c9d1;});}return null;};}function removeEntity(_0x5df077,_0x2d26f5){return function(_0x2d0805){if(_0x2d0805){return _0x2d0805['destroy']()[_0xd38a('0x2b')](function(){_0x5df077[_0xd38a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c6c86,_0x100fe1){return function(_0x3f5371){if(!_0x3f5371){_0x4c6c86[_0xd38a('0x1d')](0x194);}return _0x3f5371;};}function handleError(_0x2ff472,_0xb5b0f0){_0xb5b0f0=_0xb5b0f0||0x1f4;return function(_0x188c25){logger[_0xd38a('0x2c')](_0x188c25['stack']);if(_0x188c25['name']){delete _0x188c25[_0xd38a('0x2d')];}_0x2ff472[_0xd38a('0x1e')](_0xb5b0f0)[_0xd38a('0x2e')](_0x188c25);};}exports[_0xd38a('0x2f')]=function(_0x53c28c,_0x14a2d7){var _0x57bafe={},_0x2b0d4e={},_0x2efcf2={'count':0x0,'rows':[]};var _0x2cd0e5=_['map'](db[_0xd38a('0x30')]['rawAttributes'],function(_0x2adcde){return{'name':_0x2adcde['fieldName'],'type':_0x2adcde[_0xd38a('0x31')][_0xd38a('0x32')]};});_0x2b0d4e['model']=_[_0xd38a('0x33')](_0x2cd0e5,_0xd38a('0x2d'));_0x2b0d4e['query']=_[_0xd38a('0x34')](_0x53c28c['query']);_0x2b0d4e[_0xd38a('0x35')]=_[_0xd38a('0x36')](_0x2b0d4e[_0xd38a('0x37')],_0x2b0d4e[_0xd38a('0x38')]);_0x57bafe[_0xd38a('0x39')]=_[_0xd38a('0x36')](_0x2b0d4e[_0xd38a('0x37')],qs['fields'](_0x53c28c[_0xd38a('0x38')][_0xd38a('0x3a')]));_0x57bafe[_0xd38a('0x39')]=_0x57bafe[_0xd38a('0x39')][_0xd38a('0x3b')]?_0x57bafe[_0xd38a('0x39')]:_0x2b0d4e[_0xd38a('0x37')];if(!_0x53c28c[_0xd38a('0x38')][_0xd38a('0x3c')]('nolimit')){_0x57bafe[_0xd38a('0x23')]=qs[_0xd38a('0x23')](_0x53c28c['query'][_0xd38a('0x23')]);_0x57bafe[_0xd38a('0x21')]=qs['offset'](_0x53c28c[_0xd38a('0x38')][_0xd38a('0x21')]);}_0x57bafe[_0xd38a('0x3d')]=qs[_0xd38a('0x3e')](_0x53c28c[_0xd38a('0x38')][_0xd38a('0x3e')]);_0x57bafe[_0xd38a('0x3f')]=qs['filters'](_[_0xd38a('0x40')](_0x53c28c[_0xd38a('0x38')],_0x2b0d4e[_0xd38a('0x35')]),_0x2cd0e5);if(_0x53c28c[_0xd38a('0x38')][_0xd38a('0x41')]){_0x57bafe[_0xd38a('0x3f')]=_[_0xd38a('0x42')](_0x57bafe[_0xd38a('0x3f')],{'$or':_[_0xd38a('0x33')](_0x2cd0e5,function(_0x3f9db0){if(_0x3f9db0[_0xd38a('0x31')]!==_0xd38a('0x43')){var _0x4023e2={};_0x4023e2[_0x3f9db0[_0xd38a('0x2d')]]={'$like':'%'+_0x53c28c[_0xd38a('0x38')][_0xd38a('0x41')]+'%'};return _0x4023e2;}})});}_0x57bafe=_[_0xd38a('0x42')]({},_0x57bafe,_0x53c28c['options']);var _0xa3a5d6={'where':_0x57bafe[_0xd38a('0x3f')]};return db['Dynamics365Field'][_0xd38a('0x24')](_0xa3a5d6)[_0xd38a('0x2b')](function(_0x5d24ea){_0x2efcf2[_0xd38a('0x24')]=_0x5d24ea;if(_0x53c28c[_0xd38a('0x38')]['includeAll']){_0x57bafe['include']=[{'all':!![]}];}return db[_0xd38a('0x30')][_0xd38a('0x44')](_0x57bafe);})[_0xd38a('0x2b')](function(_0x37dd00){_0x2efcf2[_0xd38a('0x45')]=_0x37dd00;return _0x2efcf2;})[_0xd38a('0x2b')](respondWithFilteredResult(_0x14a2d7,_0x57bafe))[_0xd38a('0x46')](handleError(_0x14a2d7,null));};exports[_0xd38a('0x47')]=function(_0x4d6780,_0x1fee93){var _0x5b3c4b={'raw':!![],'where':{'id':_0x4d6780[_0xd38a('0x48')]['id']}},_0x4fe51f={};_0x4fe51f[_0xd38a('0x37')]=_['keys'](db[_0xd38a('0x30')][_0xd38a('0x49')]);_0x4fe51f['query']=_['keys'](_0x4d6780[_0xd38a('0x38')]);_0x4fe51f[_0xd38a('0x35')]=_[_0xd38a('0x36')](_0x4fe51f[_0xd38a('0x37')],_0x4fe51f[_0xd38a('0x38')]);_0x5b3c4b['attributes']=_[_0xd38a('0x36')](_0x4fe51f['model'],qs[_0xd38a('0x3a')](_0x4d6780[_0xd38a('0x38')][_0xd38a('0x3a')]));_0x5b3c4b[_0xd38a('0x39')]=_0x5b3c4b['attributes'][_0xd38a('0x3b')]?_0x5b3c4b[_0xd38a('0x39')]:_0x4fe51f[_0xd38a('0x37')];if(_0x4d6780['query'][_0xd38a('0x4a')]){_0x5b3c4b['include']=[{'all':!![]}];}_0x5b3c4b=_['merge']({},_0x5b3c4b,_0x4d6780[_0xd38a('0x4b')]);return db[_0xd38a('0x30')][_0xd38a('0x4c')](_0x5b3c4b)[_0xd38a('0x2b')](handleEntityNotFound(_0x1fee93,null))[_0xd38a('0x2b')](respondWithResult(_0x1fee93,null))[_0xd38a('0x46')](handleError(_0x1fee93,null));};exports['create']=function(_0x3e53e5,_0x1512ff){return db[_0xd38a('0x30')][_0xd38a('0x4d')](_0x3e53e5[_0xd38a('0x4e')],{})['then'](respondWithResult(_0x1512ff,0xc9))[_0xd38a('0x46')](handleError(_0x1512ff,null));};exports[_0xd38a('0x2a')]=function(_0x1b1f70,_0x44de35){if(_0x1b1f70['body']['id']){delete _0x1b1f70[_0xd38a('0x4e')]['id'];}return db[_0xd38a('0x30')][_0xd38a('0x4c')]({'where':{'id':_0x1b1f70[_0xd38a('0x48')]['id']}})[_0xd38a('0x2b')](handleEntityNotFound(_0x44de35,null))[_0xd38a('0x2b')](saveUpdates(_0x1b1f70['body'],null))[_0xd38a('0x2b')](respondWithResult(_0x44de35,null))[_0xd38a('0x46')](handleError(_0x44de35,null));};exports['destroy']=function(_0x1cf16d,_0xf4289b){return db[_0xd38a('0x30')][_0xd38a('0x4c')]({'where':{'id':_0x1cf16d['params']['id']}})[_0xd38a('0x2b')](handleEntityNotFound(_0xf4289b,null))['then'](removeEntity(_0xf4289b,null))[_0xd38a('0x46')](handleError(_0xf4289b,null));}; \ No newline at end of file +var _0x1df1=['params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','Dynamics365Field','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1df1,0x9b));var _0x11df=function(_0x44463a,_0x57a29f){_0x44463a=_0x44463a-0x0;var _0x50a9d6=_0x1df1[_0x44463a];return _0x50a9d6;};'use strict';var emlformat=require(_0x11df('0x0'));var rimraf=require(_0x11df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x11df('0x2'));var rp=require(_0x11df('0x3'));var moment=require(_0x11df('0x4'));var BPromise=require(_0x11df('0x5'));var Mustache=require(_0x11df('0x6'));var util=require('util');var path=require(_0x11df('0x7'));var sox=require(_0x11df('0x8'));var csv=require(_0x11df('0x9'));var ejs=require(_0x11df('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x11df('0xb'));var squel=require(_0x11df('0xc'));var crypto=require(_0x11df('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x11df('0xe'));var toCsv=require(_0x11df('0x9'));var querystring=require(_0x11df('0xf'));var Papa=require('papaparse');var Redis=require(_0x11df('0x10'));var authService=require(_0x11df('0x11'));var qs=require(_0x11df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x11df('0x13'))(_0x11df('0x14'));var utils=require(_0x11df('0x15'));var config=require(_0x11df('0x16'));var licenseUtil=require(_0x11df('0x17'));var db=require(_0x11df('0x18'))['db'];function respondWithStatusCode(_0x1b0754,_0x36c37e){_0x36c37e=_0x36c37e||0xcc;return function(_0x388b0a){if(_0x388b0a){return _0x1b0754[_0x11df('0x19')](_0x36c37e);}return _0x1b0754[_0x11df('0x1a')](_0x36c37e)[_0x11df('0x1b')]();};}function respondWithResult(_0xcac183,_0x122812){_0x122812=_0x122812||0xc8;return function(_0x3b3d0c){if(_0x3b3d0c){return _0xcac183[_0x11df('0x1a')](_0x122812)['json'](_0x3b3d0c);}};}function respondWithFilteredResult(_0x284073,_0x3ae8ef){return function(_0xafb710){if(_0xafb710){var _0x21f48f=typeof _0x3ae8ef[_0x11df('0x1c')]===_0x11df('0x1d')&&typeof _0x3ae8ef['limit']===_0x11df('0x1d');var _0x50bc73=_0xafb710[_0x11df('0x1e')];var _0xe977dc=_0x21f48f?0x0:_0x3ae8ef[_0x11df('0x1c')];var _0x4e4a53=_0x21f48f?_0xafb710[_0x11df('0x1e')]:_0x3ae8ef[_0x11df('0x1c')]+_0x3ae8ef[_0x11df('0x1f')];var _0x50e533;if(_0x4e4a53>=_0x50bc73){_0x4e4a53=_0x50bc73;_0x50e533=0xc8;}else{_0x50e533=0xce;}_0x284073[_0x11df('0x1a')](_0x50e533);return _0x284073[_0x11df('0x20')](_0x11df('0x21'),_0xe977dc+'-'+_0x4e4a53+'/'+_0x50bc73)['json'](_0xafb710);}return null;};}function patchUpdates(_0x482909){return function(_0xc2a995){try{jsonpatch['apply'](_0xc2a995,_0x482909,!![]);}catch(_0x362e0f){return BPromise[_0x11df('0x22')](_0x362e0f);}return _0xc2a995[_0x11df('0x23')]();};}function saveUpdates(_0xf32456,_0x42a053){return function(_0x1ebe93){if(_0x1ebe93){return _0x1ebe93[_0x11df('0x24')](_0xf32456)['then'](function(_0x257723){return _0x257723;});}return null;};}function removeEntity(_0x252f7f,_0xa515de){return function(_0x377895){if(_0x377895){return _0x377895[_0x11df('0x25')]()['then'](function(){_0x252f7f[_0x11df('0x1a')](0xcc)[_0x11df('0x1b')]();});}};}function handleEntityNotFound(_0x467331,_0x1beb8c){return function(_0x50f84d){if(!_0x50f84d){_0x467331[_0x11df('0x19')](0x194);}return _0x50f84d;};}function handleError(_0x3775f8,_0x44f404){_0x44f404=_0x44f404||0x1f4;return function(_0x337dfa){logger[_0x11df('0x26')](_0x337dfa[_0x11df('0x27')]);if(_0x337dfa[_0x11df('0x28')]){delete _0x337dfa[_0x11df('0x28')];}_0x3775f8[_0x11df('0x1a')](_0x44f404)[_0x11df('0x29')](_0x337dfa);};}exports[_0x11df('0x2a')]=function(_0x5af743,_0x3ad108){var _0x40a678={},_0xe59669={},_0x2cbc3e={'count':0x0,'rows':[]};var _0x431d33=_[_0x11df('0x2b')](db[_0x11df('0x2c')]['rawAttributes'],function(_0x492eb7){return{'name':_0x492eb7[_0x11df('0x2d')],'type':_0x492eb7[_0x11df('0x2e')]['key']};});_0xe59669[_0x11df('0x2f')]=_[_0x11df('0x2b')](_0x431d33,_0x11df('0x28'));_0xe59669[_0x11df('0x30')]=_[_0x11df('0x31')](_0x5af743['query']);_0xe59669['filters']=_[_0x11df('0x32')](_0xe59669[_0x11df('0x2f')],_0xe59669[_0x11df('0x30')]);_0x40a678[_0x11df('0x33')]=_[_0x11df('0x32')](_0xe59669[_0x11df('0x2f')],qs[_0x11df('0x34')](_0x5af743[_0x11df('0x30')][_0x11df('0x34')]));_0x40a678['attributes']=_0x40a678[_0x11df('0x33')][_0x11df('0x35')]?_0x40a678[_0x11df('0x33')]:_0xe59669[_0x11df('0x2f')];if(!_0x5af743[_0x11df('0x30')][_0x11df('0x36')]('nolimit')){_0x40a678[_0x11df('0x1f')]=qs[_0x11df('0x1f')](_0x5af743['query']['limit']);_0x40a678[_0x11df('0x1c')]=qs[_0x11df('0x1c')](_0x5af743['query'][_0x11df('0x1c')]);}_0x40a678[_0x11df('0x37')]=qs[_0x11df('0x38')](_0x5af743[_0x11df('0x30')]['sort']);_0x40a678[_0x11df('0x39')]=qs[_0x11df('0x3a')](_['pick'](_0x5af743['query'],_0xe59669['filters']),_0x431d33);if(_0x5af743[_0x11df('0x30')][_0x11df('0x3b')]){_0x40a678[_0x11df('0x39')]=_[_0x11df('0x3c')](_0x40a678['where'],{'$or':_[_0x11df('0x2b')](_0x431d33,function(_0x13b147){if(_0x13b147[_0x11df('0x2e')]!==_0x11df('0x3d')){var _0x3a5743={};_0x3a5743[_0x13b147[_0x11df('0x28')]]={'$like':'%'+_0x5af743[_0x11df('0x30')]['filter']+'%'};return _0x3a5743;}})});}_0x40a678=_[_0x11df('0x3c')]({},_0x40a678,_0x5af743[_0x11df('0x3e')]);var _0xf36880={'where':_0x40a678[_0x11df('0x39')]};return db[_0x11df('0x2c')][_0x11df('0x1e')](_0xf36880)[_0x11df('0x3f')](function(_0xd4b15){_0x2cbc3e[_0x11df('0x1e')]=_0xd4b15;if(_0x5af743[_0x11df('0x30')][_0x11df('0x40')]){_0x40a678[_0x11df('0x41')]=[{'all':!![]}];}return db[_0x11df('0x2c')][_0x11df('0x42')](_0x40a678);})[_0x11df('0x3f')](function(_0x2b8dd9){_0x2cbc3e[_0x11df('0x43')]=_0x2b8dd9;return _0x2cbc3e;})[_0x11df('0x3f')](respondWithFilteredResult(_0x3ad108,_0x40a678))[_0x11df('0x44')](handleError(_0x3ad108,null));};exports[_0x11df('0x45')]=function(_0x35c6b2,_0x26e513){var _0x458769={'raw':!![],'where':{'id':_0x35c6b2[_0x11df('0x46')]['id']}},_0x4af05d={};_0x4af05d['model']=_[_0x11df('0x31')](db['Dynamics365Field'][_0x11df('0x47')]);_0x4af05d[_0x11df('0x30')]=_[_0x11df('0x31')](_0x35c6b2[_0x11df('0x30')]);_0x4af05d['filters']=_[_0x11df('0x32')](_0x4af05d['model'],_0x4af05d[_0x11df('0x30')]);_0x458769[_0x11df('0x33')]=_[_0x11df('0x32')](_0x4af05d[_0x11df('0x2f')],qs[_0x11df('0x34')](_0x35c6b2[_0x11df('0x30')][_0x11df('0x34')]));_0x458769['attributes']=_0x458769['attributes']['length']?_0x458769[_0x11df('0x33')]:_0x4af05d[_0x11df('0x2f')];if(_0x35c6b2[_0x11df('0x30')][_0x11df('0x40')]){_0x458769[_0x11df('0x41')]=[{'all':!![]}];}_0x458769=_[_0x11df('0x3c')]({},_0x458769,_0x35c6b2[_0x11df('0x3e')]);return db['Dynamics365Field']['find'](_0x458769)[_0x11df('0x3f')](handleEntityNotFound(_0x26e513,null))[_0x11df('0x3f')](respondWithResult(_0x26e513,null))[_0x11df('0x44')](handleError(_0x26e513,null));};exports[_0x11df('0x48')]=function(_0x5761c7,_0x389a7d){return db['Dynamics365Field']['create'](_0x5761c7[_0x11df('0x49')],{})[_0x11df('0x3f')](respondWithResult(_0x389a7d,0xc9))[_0x11df('0x44')](handleError(_0x389a7d,null));};exports['update']=function(_0x2805dd,_0x1dd469){if(_0x2805dd['body']['id']){delete _0x2805dd[_0x11df('0x49')]['id'];}return db[_0x11df('0x2c')]['find']({'where':{'id':_0x2805dd['params']['id']}})[_0x11df('0x3f')](handleEntityNotFound(_0x1dd469,null))['then'](saveUpdates(_0x2805dd[_0x11df('0x49')],null))[_0x11df('0x3f')](respondWithResult(_0x1dd469,null))['catch'](handleError(_0x1dd469,null));};exports['destroy']=function(_0x2e2aeb,_0x22db8d){return db['Dynamics365Field'][_0x11df('0x4a')]({'where':{'id':_0x2e2aeb[_0x11df('0x46')]['id']}})[_0x11df('0x3f')](handleEntityNotFound(_0x22db8d,null))[_0x11df('0x3f')](removeEntity(_0x22db8d,null))[_0x11df('0x44')](handleError(_0x22db8d,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0c0794d..3ccb5f7 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 _0x3127=['moment','bluebird','request-promise','./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x439257,_0x1a4a66){var _0x229e6f=function(_0x2954fa){while(--_0x2954fa){_0x439257['push'](_0x439257['shift']());}};_0x229e6f(++_0x1a4a66);}(_0x3127,0x15c));var _0x7312=function(_0x205ea9,_0x1cbfc8){_0x205ea9=_0x205ea9-0x0;var _0x221e26=_0x3127[_0x205ea9];return _0x221e26;};'use strict';var _=require(_0x7312('0x0'));var util=require('util');var logger=require(_0x7312('0x1'))(_0x7312('0x2'));var moment=require(_0x7312('0x3'));var BPromise=require(_0x7312('0x4'));var rp=require(_0x7312('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7312('0x6'));module[_0x7312('0x7')]=function(_0x1b78ed,_0x21084f){return _0x1b78ed[_0x7312('0x8')](_0x7312('0x9'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x7312('0xa'),'fields':[_0x7312('0xb'),_0x7312('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0870=['bluebird','request-promise','rimraf','exports','define','dynamics365_unique_index','idField','../../config/logger'];(function(_0x9641f8,_0x5c2372){var _0x3881b4=function(_0x45b7d9){while(--_0x45b7d9){_0x9641f8['push'](_0x9641f8['shift']());}};_0x3881b4(++_0x5c2372);}(_0x0870,0xe7));var _0x0087=function(_0x175d6a,_0x269c3d){_0x175d6a=_0x175d6a-0x0;var _0x4ef23a=_0x0870[_0x175d6a];return _0x4ef23a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0087('0x0'))('api');var moment=require('moment');var BPromise=require(_0x0087('0x1'));var rp=require(_0x0087('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0087('0x3'));var config=require('../../config/environment');var attributes=require('./intDynamics365Field.attributes');module[_0x0087('0x4')]=function(_0x5147e0,_0xe8152b){return _0x5147e0[_0x0087('0x5')]('Dynamics365Field',attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x0087('0x6'),'fields':[_0x0087('0x7'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 9f93e61..dcd6811 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 _0xe625=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird'];(function(_0x972d30,_0x5ec2d7){var _0x3b6f50=function(_0x14e9d9){while(--_0x14e9d9){_0x972d30['push'](_0x972d30['shift']());}};_0x3b6f50(++_0x5ec2d7);}(_0xe625,0x96));var _0x5e62=function(_0x16dadf,_0x47ae1f){_0x16dadf=_0x16dadf-0x0;var _0x2c60e5=_0xe625[_0x16dadf];return _0x2c60e5;};'use strict';var _=require(_0x5e62('0x0'));var util=require(_0x5e62('0x1'));var moment=require(_0x5e62('0x2'));var BPromise=require(_0x5e62('0x3'));var rs=require(_0x5e62('0x4'));var fs=require('fs');var Redis=require(_0x5e62('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e62('0x6'));var logger=require(_0x5e62('0x7'))('rpc');var config=require(_0x5e62('0x8'));var jayson=require(_0x5e62('0x9'));var client=jayson['client'][_0x5e62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf22a,_0x485d69,_0xe07268){return new BPromise(function(_0x56417d,_0x1903ed){return client[_0x5e62('0xb')](_0x2bf22a,_0xe07268)[_0x5e62('0xc')](function(_0x20281d){logger['info'](_0x5e62('0xd'),_0x485d69,'request\x20sent');logger[_0x5e62('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x485d69,_0x5e62('0xf'),JSON[_0x5e62('0x10')](_0x20281d));if(_0x20281d[_0x5e62('0x11')]){if(_0x20281d['error'][_0x5e62('0x12')]===0x1f4){logger[_0x5e62('0x11')](_0x5e62('0xd'),_0x485d69,_0x20281d[_0x5e62('0x11')][_0x5e62('0x13')]);return _0x1903ed(_0x20281d['error'][_0x5e62('0x13')]);}logger[_0x5e62('0x11')](_0x5e62('0xd'),_0x485d69,_0x20281d[_0x5e62('0x11')]['message']);return _0x56417d(_0x20281d[_0x5e62('0x11')]['message']);}else{logger[_0x5e62('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x485d69,_0x5e62('0xf'));_0x56417d(_0x20281d['result']['message']);}})[_0x5e62('0x15')](function(_0x167731){logger['error'](_0x5e62('0xd'),_0x485d69,_0x167731);_0x1903ed(_0x167731);});});} \ No newline at end of file +var _0x6cbf=['Dynamics365Field,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','then','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x6cbf,0x1a6));var _0xf6cb=function(_0x4cd32e,_0x384826){_0x4cd32e=_0x4cd32e-0x0;var _0xd54b8c=_0x6cbf[_0x4cd32e];return _0xd54b8c;};'use strict';var _=require(_0xf6cb('0x0'));var util=require(_0xf6cb('0x1'));var moment=require(_0xf6cb('0x2'));var BPromise=require(_0xf6cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6cb('0x4'));var db=require(_0xf6cb('0x5'))['db'];var utils=require(_0xf6cb('0x6'));var logger=require(_0xf6cb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf6cb('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa9d67c,_0x5112a6,_0x24909a){return new BPromise(function(_0x57228c,_0x26f943){return client[_0xf6cb('0x9')](_0xa9d67c,_0x24909a)[_0xf6cb('0xa')](function(_0x1f8337){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x5112a6,'request\x20sent');logger[_0xf6cb('0xb')](_0xf6cb('0xc'),_0x5112a6,'request\x20sent',JSON['stringify'](_0x1f8337));if(_0x1f8337[_0xf6cb('0xd')]){if(_0x1f8337['error'][_0xf6cb('0xe')]===0x1f4){logger['error'](_0xf6cb('0xf'),_0x5112a6,_0x1f8337[_0xf6cb('0xd')][_0xf6cb('0x10')]);return _0x26f943(_0x1f8337[_0xf6cb('0xd')][_0xf6cb('0x10')]);}logger[_0xf6cb('0xd')](_0xf6cb('0xf'),_0x5112a6,_0x1f8337['error'][_0xf6cb('0x10')]);return _0x57228c(_0x1f8337['error'][_0xf6cb('0x10')]);}else{logger[_0xf6cb('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x5112a6,'request\x20sent');_0x57228c(_0x1f8337['result'][_0xf6cb('0x10')]);}})[_0xf6cb('0x12')](function(_0x45701f){logger[_0xf6cb('0xd')](_0xf6cb('0xf'),_0x5112a6,_0x45701f);_0x26f943(_0x45701f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 79471c8..b49f467 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 _0x906c=['isAuthenticated','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','index','get','/:id'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x906c,0x77));var _0xc906=function(_0x3347ff,_0x182d7b){_0x3347ff=_0x3347ff-0x0;var _0x57ba8c=_0x906c[_0x3347ff];return _0x57ba8c;};'use strict';var multer=require(_0xc906('0x0'));var util=require(_0xc906('0x1'));var path=require('path');var timeout=require(_0xc906('0x2'));var express=require(_0xc906('0x3'));var router=express[_0xc906('0x4')]();var fs_extra=require(_0xc906('0x5'));var auth=require(_0xc906('0x6'));var interaction=require(_0xc906('0x7'));var config=require(_0xc906('0x8'));var controller=require(_0xc906('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xc906('0xa')]);router[_0xc906('0xb')](_0xc906('0xc'),auth[_0xc906('0xd')](),controller['show']);router['get'](_0xc906('0xe'),auth[_0xc906('0xd')](),controller[_0xc906('0xf')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc906('0x10')]('/',auth[_0xc906('0xd')](),controller['create']);router['post'](_0xc906('0xe'),auth[_0xc906('0xd')](),controller[_0xc906('0x11')]);router[_0xc906('0x12')](_0xc906('0xc'),auth['isAuthenticated'](),controller[_0xc906('0x13')]);router[_0xc906('0x14')](_0xc906('0xc'),auth[_0xc906('0xd')](),controller[_0xc906('0x15')]);module['exports']=router; \ No newline at end of file +var _0xd060=['update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xd060,0xc9));var _0x0d06=function(_0x14559d,_0x2dbfdf){_0x14559d=_0x14559d-0x0;var _0x13e792=_0xd060[_0x14559d];return _0x13e792;};'use strict';var multer=require(_0x0d06('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0d06('0x1'));var express=require(_0x0d06('0x2'));var router=express[_0x0d06('0x3')]();var fs_extra=require(_0x0d06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0d06('0x5'));var config=require(_0x0d06('0x6'));var controller=require(_0x0d06('0x7'));router[_0x0d06('0x8')]('/',auth[_0x0d06('0x9')](),controller[_0x0d06('0xa')]);router['get'](_0x0d06('0xb'),auth[_0x0d06('0x9')](),controller[_0x0d06('0xc')]);router[_0x0d06('0x8')]('/:id/configurations',auth[_0x0d06('0x9')](),controller[_0x0d06('0xd')]);router[_0x0d06('0x8')](_0x0d06('0xe'),auth[_0x0d06('0x9')](),controller['getFields']);router[_0x0d06('0xf')]('/',auth[_0x0d06('0x9')](),controller[_0x0d06('0x10')]);router[_0x0d06('0xf')]('/:id/configurations',auth[_0x0d06('0x9')](),controller[_0x0d06('0x11')]);router[_0x0d06('0x12')](_0x0d06('0xb'),auth['isAuthenticated'](),controller[_0x0d06('0x13')]);router[_0x0d06('0x14')](_0x0d06('0xb'),auth[_0x0d06('0x9')](),controller['destroy']);module[_0x0d06('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 2f95ea2..ad14157 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 _0x1967=['STRING','username','remoteUri','exports'];(function(_0x51b861,_0xb480d3){var _0x52401b=function(_0x30c1ea){while(--_0x30c1ea){_0x51b861['push'](_0x51b861['shift']());}};_0x52401b(++_0xb480d3);}(_0x1967,0x173));var _0x7196=function(_0x291cab,_0x12e9d4){_0x291cab=_0x291cab-0x0;var _0x23c798=_0x1967[_0x291cab];return _0x23c798;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'apiKey':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1893=['STRING','username','remoteUri'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x1893,0xa2));var _0x3189=function(_0x5df35c,_0x2ab072){_0x5df35c=_0x5df35c-0x0;var _0x5233be=_0x1893[_0x5df35c];return _0x5233be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index f70eb20..c9bc670 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 _0x6822=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','Subjects','Descriptions','getDescriptions','channel','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','toString','requester','subject','agent','description','group','source','ticket_type','includes','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x151f6e,_0x4f8453){var _0x19db86=function(_0x374874){while(--_0x374874){_0x151f6e['push'](_0x151f6e['shift']());}};_0x19db86(++_0x4f8453);}(_0x6822,0x18c));var _0x2682=function(_0x53644a,_0x372053){_0x53644a=_0x53644a-0x0;var _0x1e62ca=_0x6822[_0x53644a];return _0x1e62ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2682('0x0'));var zipdir=require(_0x2682('0x1'));var jsonpatch=require(_0x2682('0x2'));var rp=require(_0x2682('0x3'));var moment=require('moment');var BPromise=require(_0x2682('0x4'));var Mustache=require(_0x2682('0x5'));var util=require(_0x2682('0x6'));var path=require(_0x2682('0x7'));var sox=require(_0x2682('0x8'));var csv=require(_0x2682('0x9'));var ejs=require(_0x2682('0xa'));var fs=require('fs');var fs_extra=require(_0x2682('0xb'));var _=require(_0x2682('0xc'));var squel=require(_0x2682('0xd'));var crypto=require(_0x2682('0xe'));var jsforce=require(_0x2682('0xf'));var deskjs=require(_0x2682('0x10'));var toCsv=require(_0x2682('0x9'));var querystring=require('querystring');var Papa=require(_0x2682('0x11'));var Redis=require(_0x2682('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2682('0x13'));var logger=require(_0x2682('0x14'))('api');var utils=require(_0x2682('0x15'));var config=require(_0x2682('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2682('0x17'))['db'];var integrations=require(_0x2682('0x18'));function respondWithStatusCode(_0x1feca6,_0x2cd01f){_0x2cd01f=_0x2cd01f||0xcc;return function(_0x3227f9){if(_0x3227f9){return _0x1feca6[_0x2682('0x19')](_0x2cd01f);}return _0x1feca6[_0x2682('0x1a')](_0x2cd01f)[_0x2682('0x1b')]();};}function respondWithResult(_0xfb9e0c,_0x18dab9){_0x18dab9=_0x18dab9||0xc8;return function(_0x4a7e21){if(_0x4a7e21){return _0xfb9e0c[_0x2682('0x1a')](_0x18dab9)[_0x2682('0x1c')](_0x4a7e21);}};}function respondWithFilteredResult(_0x1ac17b,_0x212aaf){return function(_0x545ba8){if(_0x545ba8){var _0x52a80d=typeof _0x212aaf[_0x2682('0x1d')]===_0x2682('0x1e')&&typeof _0x212aaf[_0x2682('0x1f')]==='undefined';var _0x22b2ed=_0x545ba8['count'];var _0x498424=_0x52a80d?0x0:_0x212aaf[_0x2682('0x1d')];var _0x3d2b43=_0x52a80d?_0x545ba8[_0x2682('0x20')]:_0x212aaf[_0x2682('0x1d')]+_0x212aaf[_0x2682('0x1f')];var _0x554b57;if(_0x3d2b43>=_0x22b2ed){_0x3d2b43=_0x22b2ed;_0x554b57=0xc8;}else{_0x554b57=0xce;}_0x1ac17b[_0x2682('0x1a')](_0x554b57);return _0x1ac17b['set'](_0x2682('0x21'),_0x498424+'-'+_0x3d2b43+'/'+_0x22b2ed)[_0x2682('0x1c')](_0x545ba8);}return null;};}function patchUpdates(_0x348924){return function(_0x20ae5b){try{jsonpatch[_0x2682('0x22')](_0x20ae5b,_0x348924,!![]);}catch(_0x3efec1){return BPromise[_0x2682('0x23')](_0x3efec1);}return _0x20ae5b['save']();};}function saveUpdates(_0x57ae26,_0x599726){return function(_0x3ed75d){if(_0x3ed75d){return _0x3ed75d[_0x2682('0x24')](_0x57ae26)['then'](function(_0xa27b38){return _0xa27b38;});}return null;};}function removeEntity(_0x35aa4c,_0x2b2d81){return function(_0xc996e9){if(_0xc996e9){return _0xc996e9['destroy']()[_0x2682('0x25')](function(){_0x35aa4c[_0x2682('0x1a')](0xcc)[_0x2682('0x1b')]();});}};}function handleEntityNotFound(_0x1d541e,_0x431fbd){return function(_0x2accf0){if(!_0x2accf0){_0x1d541e['sendStatus'](0x194);}return _0x2accf0;};}function handleError(_0x4afd1d,_0x48eee6){_0x48eee6=_0x48eee6||0x1f4;return function(_0x576352){logger[_0x2682('0x26')](_0x576352[_0x2682('0x27')]);if(_0x576352[_0x2682('0x28')]){delete _0x576352[_0x2682('0x28')];}_0x4afd1d[_0x2682('0x1a')](_0x48eee6)[_0x2682('0x29')](_0x576352);};}exports[_0x2682('0x2a')]=function(_0x90f2ec,_0x591660){var _0x9384b5={},_0x8b809b={},_0x545543={'count':0x0,'rows':[]};var _0x19bb3d=_[_0x2682('0x2b')](db[_0x2682('0x2c')][_0x2682('0x2d')],function(_0x358ed9){return{'name':_0x358ed9[_0x2682('0x2e')],'type':_0x358ed9[_0x2682('0x2f')][_0x2682('0x30')]};});_0x8b809b[_0x2682('0x31')]=_[_0x2682('0x2b')](_0x19bb3d,_0x2682('0x28'));_0x8b809b['query']=_[_0x2682('0x32')](_0x90f2ec[_0x2682('0x33')]);_0x8b809b[_0x2682('0x34')]=_[_0x2682('0x35')](_0x8b809b[_0x2682('0x31')],_0x8b809b['query']);_0x9384b5['attributes']=_[_0x2682('0x35')](_0x8b809b[_0x2682('0x31')],qs[_0x2682('0x36')](_0x90f2ec['query'][_0x2682('0x36')]));_0x9384b5[_0x2682('0x37')]=_0x9384b5[_0x2682('0x37')][_0x2682('0x38')]?_0x9384b5['attributes']:_0x8b809b['model'];if(!_0x90f2ec[_0x2682('0x33')]['hasOwnProperty'](_0x2682('0x39'))){_0x9384b5[_0x2682('0x1f')]=qs[_0x2682('0x1f')](_0x90f2ec[_0x2682('0x33')][_0x2682('0x1f')]);_0x9384b5[_0x2682('0x1d')]=qs['offset'](_0x90f2ec['query'][_0x2682('0x1d')]);}_0x9384b5['order']=qs[_0x2682('0x3a')](_0x90f2ec[_0x2682('0x33')][_0x2682('0x3a')]);_0x9384b5[_0x2682('0x3b')]=qs[_0x2682('0x34')](_[_0x2682('0x3c')](_0x90f2ec[_0x2682('0x33')],_0x8b809b[_0x2682('0x34')]),_0x19bb3d);if(_0x90f2ec[_0x2682('0x33')][_0x2682('0x3d')]){_0x9384b5['where']=_[_0x2682('0x3e')](_0x9384b5['where'],{'$or':_['map'](_0x19bb3d,function(_0x3afac7){if(_0x3afac7[_0x2682('0x2f')]!==_0x2682('0x3f')){var _0x1fd3ed={};_0x1fd3ed[_0x3afac7[_0x2682('0x28')]]={'$like':'%'+_0x90f2ec[_0x2682('0x33')]['filter']+'%'};return _0x1fd3ed;}})});}_0x9384b5=_[_0x2682('0x3e')]({},_0x9384b5,_0x90f2ec[_0x2682('0x40')]);var _0x401b31={'where':_0x9384b5[_0x2682('0x3b')]};return db[_0x2682('0x2c')]['count'](_0x401b31)[_0x2682('0x25')](function(_0x4e011b){_0x545543[_0x2682('0x20')]=_0x4e011b;if(_0x90f2ec['query'][_0x2682('0x41')]){_0x9384b5[_0x2682('0x42')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x2682('0x43')](_0x9384b5);})[_0x2682('0x25')](function(_0x3ecf06){_0x545543[_0x2682('0x44')]=_0x3ecf06;return _0x545543;})[_0x2682('0x25')](respondWithFilteredResult(_0x591660,_0x9384b5))[_0x2682('0x45')](handleError(_0x591660,null));};exports[_0x2682('0x46')]=function(_0x209da8,_0x34adb0){var _0x16ba45={'raw':![],'where':{'id':_0x209da8[_0x2682('0x47')]['id']}},_0x2fec5e={};_0x2fec5e['model']=_['keys'](db[_0x2682('0x2c')][_0x2682('0x2d')]);_0x2fec5e[_0x2682('0x33')]=_[_0x2682('0x32')](_0x209da8[_0x2682('0x33')]);_0x2fec5e[_0x2682('0x34')]=_[_0x2682('0x35')](_0x2fec5e['model'],_0x2fec5e['query']);_0x16ba45[_0x2682('0x37')]=_[_0x2682('0x35')](_0x2fec5e[_0x2682('0x31')],qs[_0x2682('0x36')](_0x209da8[_0x2682('0x33')]['fields']));_0x16ba45['attributes']=_0x16ba45[_0x2682('0x37')][_0x2682('0x38')]?_0x16ba45[_0x2682('0x37')]:_0x2fec5e[_0x2682('0x31')];if(_0x209da8[_0x2682('0x33')][_0x2682('0x41')]){_0x16ba45[_0x2682('0x42')]=[{'all':!![]}];}_0x16ba45=_[_0x2682('0x3e')]({},_0x16ba45,_0x209da8[_0x2682('0x40')]);return db['FreshdeskAccount'][_0x2682('0x48')](_0x16ba45)['then'](handleEntityNotFound(_0x34adb0,null))['then'](respondWithResult(_0x34adb0,null))[_0x2682('0x45')](handleError(_0x34adb0,null));};exports[_0x2682('0x49')]=function(_0x487779,_0x4fae9c){return db[_0x2682('0x2c')][_0x2682('0x49')](_0x487779[_0x2682('0x4a')],{})[_0x2682('0x25')](respondWithResult(_0x4fae9c,0xc9))[_0x2682('0x45')](handleError(_0x4fae9c,null));};exports[_0x2682('0x24')]=function(_0x28805b,_0x30b9fc){if(_0x28805b[_0x2682('0x4a')]['id']){delete _0x28805b[_0x2682('0x4a')]['id'];}return db['FreshdeskAccount'][_0x2682('0x48')]({'where':{'id':_0x28805b[_0x2682('0x47')]['id']}})['then'](handleEntityNotFound(_0x30b9fc,null))[_0x2682('0x25')](saveUpdates(_0x28805b[_0x2682('0x4a')],null))['then'](respondWithResult(_0x30b9fc,null))['catch'](handleError(_0x30b9fc,null));};exports[_0x2682('0x4b')]=function(_0x2379c3,_0xcf6edc){return db[_0x2682('0x2c')][_0x2682('0x48')]({'where':{'id':_0x2379c3['params']['id']}})['then'](handleEntityNotFound(_0xcf6edc,null))[_0x2682('0x25')](removeEntity(_0xcf6edc,null))[_0x2682('0x45')](handleError(_0xcf6edc,null));};exports[_0x2682('0x4c')]=function(_0x58c9cd,_0x7e2a88,_0x48925e){var _0xca6e06={};var _0x4072c0={};var _0x567b1f;var _0x2fcc7c;return db[_0x2682('0x2c')][_0x2682('0x4d')]({'where':{'id':_0x58c9cd[_0x2682('0x47')]['id']}})[_0x2682('0x25')](handleEntityNotFound(_0x7e2a88,null))[_0x2682('0x25')](function(_0x4ed39c){if(_0x4ed39c){_0x567b1f=_0x4ed39c;_0x4072c0['model']=_[_0x2682('0x32')](db['FreshdeskConfiguration'][_0x2682('0x2d')]);_0x4072c0[_0x2682('0x33')]=_[_0x2682('0x32')](_0x58c9cd['query']);_0x4072c0[_0x2682('0x34')]=_[_0x2682('0x35')](_0x4072c0[_0x2682('0x31')],_0x4072c0[_0x2682('0x33')]);_0xca6e06[_0x2682('0x37')]=_[_0x2682('0x35')](_0x4072c0[_0x2682('0x31')],qs[_0x2682('0x36')](_0x58c9cd[_0x2682('0x33')]['fields']));_0xca6e06['attributes']=_0xca6e06['attributes']['length']?_0xca6e06['attributes']:_0x4072c0[_0x2682('0x31')];_0xca6e06[_0x2682('0x4e')]=qs[_0x2682('0x3a')](_0x58c9cd[_0x2682('0x33')][_0x2682('0x3a')]);_0xca6e06[_0x2682('0x3b')]=qs[_0x2682('0x34')](_[_0x2682('0x3c')](_0x58c9cd[_0x2682('0x33')],_0x4072c0[_0x2682('0x34')]));if(_0x58c9cd['query'][_0x2682('0x3d')]){_0xca6e06['where']=_[_0x2682('0x3e')](_0xca6e06[_0x2682('0x3b')],{'$or':_['map'](_0xca6e06[_0x2682('0x37')],function(_0x1deb2e){var _0xc3065e={};_0xc3065e[_0x1deb2e]={'$like':'%'+_0x58c9cd['query']['filter']+'%'};return _0xc3065e;})});}_0xca6e06=_[_0x2682('0x3e')]({},_0xca6e06,_0x58c9cd[_0x2682('0x40')]);return _0x567b1f['getConfigurations'](_0xca6e06);}})['then'](function(_0x598b5e){if(_0x598b5e){_0x2fcc7c=_0x598b5e['length'];if(!_0x58c9cd[_0x2682('0x33')][_0x2682('0x4f')](_0x2682('0x39'))){_0xca6e06[_0x2682('0x1f')]=qs[_0x2682('0x1f')](_0x58c9cd[_0x2682('0x33')][_0x2682('0x1f')]);_0xca6e06[_0x2682('0x1d')]=qs[_0x2682('0x1d')](_0x58c9cd[_0x2682('0x33')]['offset']);}return _0x567b1f[_0x2682('0x4c')](_0xca6e06);}})[_0x2682('0x25')](function(_0x2af9ed){if(_0x2af9ed){return _0x2af9ed?{'count':_0x2fcc7c,'rows':_0x2af9ed}:null;}})[_0x2682('0x25')](respondWithResult(_0x7e2a88,null))[_0x2682('0x45')](handleError(_0x7e2a88,null));};exports[_0x2682('0x50')]=function(_0x5c81f3,_0x461dfc,_0x1f0e61){if(_0x5c81f3[_0x2682('0x4a')]['id']){delete _0x5c81f3[_0x2682('0x4a')]['id'];}return db['FreshdeskAccount']['findOne']({'where':{'id':_0x5c81f3['params']['id']}})[_0x2682('0x25')](handleEntityNotFound(_0x461dfc,null))[_0x2682('0x25')](function(_0x4b9d09){if(_0x4b9d09){_0x5c81f3[_0x2682('0x4a')]['AccountId']=_0x4b9d09['id'];_0x5c81f3['body'][_0x2682('0x51')]=integrations['getSubjects'](_0x5c81f3['body']['channel'],_0x5c81f3[_0x2682('0x4a')][_0x2682('0x2f')]);_0x5c81f3[_0x2682('0x4a')][_0x2682('0x52')]=integrations[_0x2682('0x53')](_0x5c81f3['body'][_0x2682('0x54')],_0x5c81f3[_0x2682('0x4a')][_0x2682('0x2f')]);return db[_0x2682('0x55')][_0x2682('0x49')](_0x5c81f3['body'],{'include':[{'model':db[_0x2682('0x56')],'as':_0x2682('0x51')},{'model':db['FreshdeskField'],'as':_0x2682('0x52')}]});}return null;})[_0x2682('0x25')](respondWithResult(_0x461dfc,null))['catch'](handleError(_0x461dfc,null));};exports[_0x2682('0x57')]=function(_0x262450,_0x41ea51,_0x5a0962){var _0x671b71='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x262450['params']['id']},'attributes':['id',_0x2682('0x58'),_0x2682('0x59')]})['then'](handleEntityNotFound(_0x41ea51,null))['then'](function(_0x9c33d0){if(_0x9c33d0){_0x671b71=_0x9c33d0[_0x2682('0x58')];var _0x1bb98f=_0x671b71['slice'](-0x1);if(_0x1bb98f==='/'){_0x671b71=_0x671b71['substring'](0x0,_0x671b71[_0x2682('0x5a')](_0x1bb98f));}return rp({'method':_0x2682('0x5b'),'uri':util[_0x2682('0x5c')]('%s/%s',_0x671b71,_0x2682('0x5d')),'headers':{'Authorization':util[_0x2682('0x5c')](_0x2682('0x5e'),new Buffer(util['format']('%s:X',_0x9c33d0['apiKey']))[_0x2682('0x5f')]('base64'))},'json':!![]});}})[_0x2682('0x25')](function(_0x114a55){if(_0x114a55){var _0x110e70=[_0x2682('0x60'),_0x2682('0x61'),_0x2682('0x62'),_0x2682('0x63'),_0x2682('0x1a'),'priority',_0x2682('0x64'),_0x2682('0x65'),_0x2682('0x66'),_0x2682('0x64'),'company'];_['remove'](_0x114a55,function(_0x9932){return _0x110e70[_0x2682('0x67')](_0x9932[_0x2682('0x28')])||!_0x9932['default']&&_0x9932['type']!==_0x2682('0x68')&&_0x9932['type']!==_0x2682('0x69');});return{'count':_0x114a55[_0x2682('0x38')],'rows':_['map'](_0x114a55,function(_0xc80386){return{'id':_0xc80386['name'],'name':_0xc80386[_0x2682('0x6a')],'custom':!_0xc80386[_0x2682('0x6b')],'options':_0xc80386[_0x2682('0x6c')]?_[_0x2682('0x2b')](_0xc80386[_0x2682('0x6c')],function(_0xd09066){return{'name':_[_0x2682('0x6d')](_0xd09066),'value':_0xd09066};}):[]};})};}})[_0x2682('0x25')](respondWithResult(_0x41ea51,null))[_0x2682('0x45')](function(_0x55fc28){var _0x562e5c=_0x262450[_0x2682('0x33')][_0x2682('0x6e')]?0x1f4:_0x55fc28[_0x2682('0x6f')]||0x1f4;logger[_0x2682('0x26')](_0x2682('0x70'),_0x2682('0x57'),_0x562e5c,JSON[_0x2682('0x71')](_0x55fc28));delete _0x55fc28['name'];if(_0x562e5c===0x191){_0x562e5c=0x190;}_0x41ea51[_0x2682('0x1a')](_0x562e5c)[_0x2682('0x29')](_0x262450['query'][_0x2682('0x6e')]?{'message':_0x2682('0x72'),'statusCode':_0x55fc28[_0x2682('0x6f')]}:_0x55fc28);});}; \ No newline at end of file +var _0xc7ea=['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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','name','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','priority','ticket_type','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox'];(function(_0x54565c,_0x1cafa9){var _0x475cb1=function(_0xffbb48){while(--_0xffbb48){_0x54565c['push'](_0x54565c['shift']());}};_0x475cb1(++_0x1cafa9);}(_0xc7ea,0x171));var _0xac7e=function(_0x3711ad,_0x1a5392){_0x3711ad=_0x3711ad-0x0;var _0x38a49d=_0xc7ea[_0x3711ad];return _0x38a49d;};'use strict';var emlformat=require(_0xac7e('0x0'));var rimraf=require(_0xac7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac7e('0x2'));var rp=require(_0xac7e('0x3'));var moment=require(_0xac7e('0x4'));var BPromise=require(_0xac7e('0x5'));var Mustache=require('mustache');var util=require(_0xac7e('0x6'));var path=require(_0xac7e('0x7'));var sox=require(_0xac7e('0x8'));var csv=require(_0xac7e('0x9'));var ejs=require(_0xac7e('0xa'));var fs=require('fs');var fs_extra=require(_0xac7e('0xb'));var _=require(_0xac7e('0xc'));var squel=require(_0xac7e('0xd'));var crypto=require(_0xac7e('0xe'));var jsforce=require(_0xac7e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xac7e('0x9'));var querystring=require(_0xac7e('0x10'));var Papa=require(_0xac7e('0x11'));var Redis=require(_0xac7e('0x12'));var authService=require(_0xac7e('0x13'));var qs=require(_0xac7e('0x14'));var as=require(_0xac7e('0x15'));var hardwareService=require(_0xac7e('0x16'));var logger=require(_0xac7e('0x17'))(_0xac7e('0x18'));var utils=require(_0xac7e('0x19'));var config=require(_0xac7e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xac7e('0x1b'))['db'];var integrations=require(_0xac7e('0x1c'));function respondWithStatusCode(_0x5d4537,_0x617cf9){_0x617cf9=_0x617cf9||0xcc;return function(_0x24d5e9){if(_0x24d5e9){return _0x5d4537[_0xac7e('0x1d')](_0x617cf9);}return _0x5d4537[_0xac7e('0x1e')](_0x617cf9)[_0xac7e('0x1f')]();};}function respondWithResult(_0x52be09,_0x3486ac){_0x3486ac=_0x3486ac||0xc8;return function(_0x16af2e){if(_0x16af2e){return _0x52be09[_0xac7e('0x1e')](_0x3486ac)[_0xac7e('0x20')](_0x16af2e);}};}function respondWithFilteredResult(_0x333436,_0x232ce5){return function(_0x7ee114){if(_0x7ee114){var _0x11ed74=typeof _0x232ce5['offset']===_0xac7e('0x21')&&typeof _0x232ce5[_0xac7e('0x22')]===_0xac7e('0x21');var _0x54f325=_0x7ee114[_0xac7e('0x23')];var _0x59838b=_0x11ed74?0x0:_0x232ce5[_0xac7e('0x24')];var _0x5c4939=_0x11ed74?_0x7ee114[_0xac7e('0x23')]:_0x232ce5['offset']+_0x232ce5[_0xac7e('0x22')];var _0x406f0a;if(_0x5c4939>=_0x54f325){_0x5c4939=_0x54f325;_0x406f0a=0xc8;}else{_0x406f0a=0xce;}_0x333436[_0xac7e('0x1e')](_0x406f0a);return _0x333436[_0xac7e('0x25')](_0xac7e('0x26'),_0x59838b+'-'+_0x5c4939+'/'+_0x54f325)[_0xac7e('0x20')](_0x7ee114);}return null;};}function patchUpdates(_0x4d23f9){return function(_0x12d34a){try{jsonpatch[_0xac7e('0x27')](_0x12d34a,_0x4d23f9,!![]);}catch(_0x58d211){return BPromise[_0xac7e('0x28')](_0x58d211);}return _0x12d34a[_0xac7e('0x29')]();};}function saveUpdates(_0x2c3b6e,_0x3ce3cc){return function(_0x14c10b){if(_0x14c10b){return _0x14c10b[_0xac7e('0x2a')](_0x2c3b6e)[_0xac7e('0x2b')](function(_0x57abe8){return _0x57abe8;});}return null;};}function removeEntity(_0x2b5f43,_0x32ef52){return function(_0x1bbfab){if(_0x1bbfab){return _0x1bbfab['destroy']()['then'](function(){_0x2b5f43[_0xac7e('0x1e')](0xcc)[_0xac7e('0x1f')]();});}};}function handleEntityNotFound(_0x4620da,_0x50b1e5){return function(_0xd491fd){if(!_0xd491fd){_0x4620da[_0xac7e('0x1d')](0x194);}return _0xd491fd;};}function handleError(_0x2cafcb,_0x3e0f1a){_0x3e0f1a=_0x3e0f1a||0x1f4;return function(_0x5a14f3){logger['error'](_0x5a14f3[_0xac7e('0x2c')]);if(_0x5a14f3['name']){delete _0x5a14f3['name'];}_0x2cafcb[_0xac7e('0x1e')](_0x3e0f1a)[_0xac7e('0x2d')](_0x5a14f3);};}exports[_0xac7e('0x2e')]=function(_0x4864d1,_0x224259){var _0x376247={},_0x52c4a4={},_0x195c9f={'count':0x0,'rows':[]};var _0x5796c1=_[_0xac7e('0x2f')](db[_0xac7e('0x30')][_0xac7e('0x31')],function(_0x5ae85f){return{'name':_0x5ae85f[_0xac7e('0x32')],'type':_0x5ae85f[_0xac7e('0x33')][_0xac7e('0x34')]};});_0x52c4a4[_0xac7e('0x35')]=_['map'](_0x5796c1,_0xac7e('0x36'));_0x52c4a4['query']=_[_0xac7e('0x37')](_0x4864d1[_0xac7e('0x38')]);_0x52c4a4[_0xac7e('0x39')]=_['intersection'](_0x52c4a4[_0xac7e('0x35')],_0x52c4a4[_0xac7e('0x38')]);_0x376247['attributes']=_['intersection'](_0x52c4a4[_0xac7e('0x35')],qs[_0xac7e('0x3a')](_0x4864d1[_0xac7e('0x38')][_0xac7e('0x3a')]));_0x376247[_0xac7e('0x3b')]=_0x376247[_0xac7e('0x3b')][_0xac7e('0x3c')]?_0x376247[_0xac7e('0x3b')]:_0x52c4a4[_0xac7e('0x35')];if(!_0x4864d1['query'][_0xac7e('0x3d')](_0xac7e('0x3e'))){_0x376247[_0xac7e('0x22')]=qs[_0xac7e('0x22')](_0x4864d1[_0xac7e('0x38')][_0xac7e('0x22')]);_0x376247['offset']=qs['offset'](_0x4864d1[_0xac7e('0x38')][_0xac7e('0x24')]);}_0x376247[_0xac7e('0x3f')]=qs[_0xac7e('0x40')](_0x4864d1[_0xac7e('0x38')][_0xac7e('0x40')]);_0x376247[_0xac7e('0x41')]=qs[_0xac7e('0x39')](_[_0xac7e('0x42')](_0x4864d1['query'],_0x52c4a4[_0xac7e('0x39')]),_0x5796c1);if(_0x4864d1[_0xac7e('0x38')]['filter']){_0x376247[_0xac7e('0x41')]=_[_0xac7e('0x43')](_0x376247['where'],{'$or':_[_0xac7e('0x2f')](_0x5796c1,function(_0x4faf7e){if(_0x4faf7e[_0xac7e('0x33')]!==_0xac7e('0x44')){var _0x45e1f9={};_0x45e1f9[_0x4faf7e[_0xac7e('0x36')]]={'$like':'%'+_0x4864d1[_0xac7e('0x38')][_0xac7e('0x45')]+'%'};return _0x45e1f9;}})});}_0x376247=_['merge']({},_0x376247,_0x4864d1[_0xac7e('0x46')]);var _0x43e44a={'where':_0x376247['where']};return db[_0xac7e('0x30')][_0xac7e('0x23')](_0x43e44a)[_0xac7e('0x2b')](function(_0x488da5){_0x195c9f['count']=_0x488da5;if(_0x4864d1[_0xac7e('0x38')][_0xac7e('0x47')]){_0x376247['include']=[{'all':!![]}];}return db[_0xac7e('0x30')][_0xac7e('0x48')](_0x376247);})[_0xac7e('0x2b')](function(_0x2b35bc){_0x195c9f[_0xac7e('0x49')]=_0x2b35bc;return _0x195c9f;})[_0xac7e('0x2b')](respondWithFilteredResult(_0x224259,_0x376247))[_0xac7e('0x4a')](handleError(_0x224259,null));};exports[_0xac7e('0x4b')]=function(_0x2b1a9d,_0x3620c6){var _0x3c4fb9={'raw':![],'where':{'id':_0x2b1a9d[_0xac7e('0x4c')]['id']}},_0x26f779={};_0x26f779['model']=_[_0xac7e('0x37')](db[_0xac7e('0x30')]['rawAttributes']);_0x26f779[_0xac7e('0x38')]=_[_0xac7e('0x37')](_0x2b1a9d[_0xac7e('0x38')]);_0x26f779[_0xac7e('0x39')]=_['intersection'](_0x26f779[_0xac7e('0x35')],_0x26f779[_0xac7e('0x38')]);_0x3c4fb9['attributes']=_['intersection'](_0x26f779['model'],qs[_0xac7e('0x3a')](_0x2b1a9d['query'][_0xac7e('0x3a')]));_0x3c4fb9[_0xac7e('0x3b')]=_0x3c4fb9['attributes'][_0xac7e('0x3c')]?_0x3c4fb9[_0xac7e('0x3b')]:_0x26f779[_0xac7e('0x35')];if(_0x2b1a9d[_0xac7e('0x38')][_0xac7e('0x47')]){_0x3c4fb9[_0xac7e('0x4d')]=[{'all':!![]}];}_0x3c4fb9=_['merge']({},_0x3c4fb9,_0x2b1a9d[_0xac7e('0x46')]);return db[_0xac7e('0x30')][_0xac7e('0x4e')](_0x3c4fb9)['then'](handleEntityNotFound(_0x3620c6,null))[_0xac7e('0x2b')](respondWithResult(_0x3620c6,null))[_0xac7e('0x4a')](handleError(_0x3620c6,null));};exports['create']=function(_0x5dca76,_0x49b6fb){return db['FreshdeskAccount'][_0xac7e('0x4f')](_0x5dca76['body'],{})['then'](respondWithResult(_0x49b6fb,0xc9))['catch'](handleError(_0x49b6fb,null));};exports['update']=function(_0xc96050,_0x50c814){if(_0xc96050[_0xac7e('0x50')]['id']){delete _0xc96050[_0xac7e('0x50')]['id'];}return db[_0xac7e('0x30')]['find']({'where':{'id':_0xc96050['params']['id']}})[_0xac7e('0x2b')](handleEntityNotFound(_0x50c814,null))['then'](saveUpdates(_0xc96050['body'],null))[_0xac7e('0x2b')](respondWithResult(_0x50c814,null))[_0xac7e('0x4a')](handleError(_0x50c814,null));};exports[_0xac7e('0x51')]=function(_0x55c926,_0x4e6563){return db['FreshdeskAccount']['find']({'where':{'id':_0x55c926[_0xac7e('0x4c')]['id']}})[_0xac7e('0x2b')](handleEntityNotFound(_0x4e6563,null))[_0xac7e('0x2b')](removeEntity(_0x4e6563,null))[_0xac7e('0x4a')](handleError(_0x4e6563,null));};exports[_0xac7e('0x52')]=function(_0x456377,_0x3f2c86,_0x7e7cbe){var _0x5a4469={};var _0x50abfd={};var _0x2a1d69;var _0x188f59;return db[_0xac7e('0x30')]['findOne']({'where':{'id':_0x456377[_0xac7e('0x4c')]['id']}})[_0xac7e('0x2b')](handleEntityNotFound(_0x3f2c86,null))[_0xac7e('0x2b')](function(_0x134d28){if(_0x134d28){_0x2a1d69=_0x134d28;_0x50abfd[_0xac7e('0x35')]=_[_0xac7e('0x37')](db[_0xac7e('0x53')][_0xac7e('0x31')]);_0x50abfd[_0xac7e('0x38')]=_[_0xac7e('0x37')](_0x456377[_0xac7e('0x38')]);_0x50abfd[_0xac7e('0x39')]=_['intersection'](_0x50abfd[_0xac7e('0x35')],_0x50abfd['query']);_0x5a4469[_0xac7e('0x3b')]=_['intersection'](_0x50abfd[_0xac7e('0x35')],qs[_0xac7e('0x3a')](_0x456377[_0xac7e('0x38')]['fields']));_0x5a4469['attributes']=_0x5a4469[_0xac7e('0x3b')][_0xac7e('0x3c')]?_0x5a4469[_0xac7e('0x3b')]:_0x50abfd[_0xac7e('0x35')];_0x5a4469[_0xac7e('0x3f')]=qs[_0xac7e('0x40')](_0x456377[_0xac7e('0x38')][_0xac7e('0x40')]);_0x5a4469[_0xac7e('0x41')]=qs[_0xac7e('0x39')](_[_0xac7e('0x42')](_0x456377[_0xac7e('0x38')],_0x50abfd['filters']));if(_0x456377['query'][_0xac7e('0x45')]){_0x5a4469[_0xac7e('0x41')]=_[_0xac7e('0x43')](_0x5a4469[_0xac7e('0x41')],{'$or':_[_0xac7e('0x2f')](_0x5a4469['attributes'],function(_0x3fe6fc){var _0x5b29e2={};_0x5b29e2[_0x3fe6fc]={'$like':'%'+_0x456377[_0xac7e('0x38')][_0xac7e('0x45')]+'%'};return _0x5b29e2;})});}_0x5a4469=_[_0xac7e('0x43')]({},_0x5a4469,_0x456377[_0xac7e('0x46')]);return _0x2a1d69[_0xac7e('0x52')](_0x5a4469);}})[_0xac7e('0x2b')](function(_0x26541a){if(_0x26541a){_0x188f59=_0x26541a[_0xac7e('0x3c')];if(!_0x456377['query']['hasOwnProperty'](_0xac7e('0x3e'))){_0x5a4469['limit']=qs[_0xac7e('0x22')](_0x456377['query'][_0xac7e('0x22')]);_0x5a4469[_0xac7e('0x24')]=qs[_0xac7e('0x24')](_0x456377[_0xac7e('0x38')]['offset']);}return _0x2a1d69[_0xac7e('0x52')](_0x5a4469);}})[_0xac7e('0x2b')](function(_0x479809){if(_0x479809){return _0x479809?{'count':_0x188f59,'rows':_0x479809}:null;}})[_0xac7e('0x2b')](respondWithResult(_0x3f2c86,null))['catch'](handleError(_0x3f2c86,null));};exports[_0xac7e('0x54')]=function(_0x40491e,_0x2eded1,_0x532bad){if(_0x40491e[_0xac7e('0x50')]['id']){delete _0x40491e[_0xac7e('0x50')]['id'];}return db['FreshdeskAccount'][_0xac7e('0x55')]({'where':{'id':_0x40491e['params']['id']}})[_0xac7e('0x2b')](handleEntityNotFound(_0x2eded1,null))[_0xac7e('0x2b')](function(_0xf9dfc){if(_0xf9dfc){_0x40491e['body'][_0xac7e('0x56')]=_0xf9dfc['id'];_0x40491e[_0xac7e('0x50')][_0xac7e('0x57')]=integrations[_0xac7e('0x58')](_0x40491e[_0xac7e('0x50')][_0xac7e('0x59')],_0x40491e['body']['type']);_0x40491e['body'][_0xac7e('0x5a')]=integrations[_0xac7e('0x5b')](_0x40491e[_0xac7e('0x50')][_0xac7e('0x59')],_0x40491e['body']['type']);return db[_0xac7e('0x53')][_0xac7e('0x4f')](_0x40491e[_0xac7e('0x50')],{'include':[{'model':db[_0xac7e('0x5c')],'as':_0xac7e('0x57')},{'model':db[_0xac7e('0x5c')],'as':_0xac7e('0x5a')}]});}return null;})[_0xac7e('0x2b')](respondWithResult(_0x2eded1,null))[_0xac7e('0x4a')](handleError(_0x2eded1,null));};exports[_0xac7e('0x5d')]=function(_0x262f85,_0x362189,_0x2040db){var _0x3ce5b2='';return db[_0xac7e('0x30')][_0xac7e('0x55')]({'where':{'id':_0x262f85[_0xac7e('0x4c')]['id']},'attributes':['id',_0xac7e('0x5e'),_0xac7e('0x5f')]})[_0xac7e('0x2b')](handleEntityNotFound(_0x362189,null))[_0xac7e('0x2b')](function(_0x575d0b){if(_0x575d0b){_0x3ce5b2=_0x575d0b[_0xac7e('0x5e')];var _0x59a54b=_0x3ce5b2[_0xac7e('0x60')](-0x1);if(_0x59a54b==='/'){_0x3ce5b2=_0x3ce5b2[_0xac7e('0x61')](0x0,_0x3ce5b2[_0xac7e('0x62')](_0x59a54b));}return rp({'method':_0xac7e('0x63'),'uri':util[_0xac7e('0x64')](_0xac7e('0x65'),_0x3ce5b2,_0xac7e('0x66')),'headers':{'Authorization':util['format'](_0xac7e('0x67'),new Buffer(util[_0xac7e('0x64')]('%s:X',_0x575d0b['apiKey']))[_0xac7e('0x68')](_0xac7e('0x69')))},'json':!![]});}})[_0xac7e('0x2b')](function(_0x38ba6e){if(_0x38ba6e){var _0x5eeff2=[_0xac7e('0x6a'),_0xac7e('0x6b'),_0xac7e('0x6c'),_0xac7e('0x6d'),'status',_0xac7e('0x6e'),'group','source',_0xac7e('0x6f'),_0xac7e('0x70'),_0xac7e('0x71')];_[_0xac7e('0x72')](_0x38ba6e,function(_0x101f54){return _0x5eeff2[_0xac7e('0x73')](_0x101f54[_0xac7e('0x36')])||!_0x101f54[_0xac7e('0x74')]&&_0x101f54[_0xac7e('0x33')]!==_0xac7e('0x75')&&_0x101f54['type']!==_0xac7e('0x76');});return{'count':_0x38ba6e['length'],'rows':_[_0xac7e('0x2f')](_0x38ba6e,function(_0x43bfca){return{'id':_0x43bfca[_0xac7e('0x36')],'name':_0x43bfca[_0xac7e('0x77')],'custom':!_0x43bfca[_0xac7e('0x74')],'options':_0x43bfca[_0xac7e('0x78')]?_[_0xac7e('0x2f')](_0x43bfca[_0xac7e('0x78')],function(_0x5cfa24){return{'name':_['capitalize'](_0x5cfa24),'value':_0x5cfa24};}):[]};})};}})[_0xac7e('0x2b')](respondWithResult(_0x362189,null))[_0xac7e('0x4a')](function(_0x1afeda){var _0x27b8cc=_0x262f85[_0xac7e('0x38')][_0xac7e('0x79')]?0x1f4:_0x1afeda[_0xac7e('0x7a')]||0x1f4;logger[_0xac7e('0x7b')]('getFields,\x20%s,\x20%s,\x20%s',_0xac7e('0x5d'),_0x27b8cc,JSON[_0xac7e('0x7c')](_0x1afeda));delete _0x1afeda[_0xac7e('0x36')];if(_0x27b8cc===0x191){_0x27b8cc=0x190;}_0x362189[_0xac7e('0x1e')](_0x27b8cc)[_0xac7e('0x2d')](_0x262f85[_0xac7e('0x38')][_0xac7e('0x79')]?{'message':_0xac7e('0x7d'),'statusCode':_0x1afeda[_0xac7e('0x7a')]}:_0x1afeda);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index e598256..f76b9f7 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 _0x8628=['define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x4a2a17,_0x23e07b){var _0x2e3361=function(_0x901efc){while(--_0x901efc){_0x4a2a17['push'](_0x4a2a17['shift']());}};_0x2e3361(++_0x23e07b);}(_0x8628,0x179));var _0x8862=function(_0x240de2,_0x5ee8f){_0x240de2=_0x240de2-0x0;var _0x317fbc=_0x8628[_0x240de2];return _0x317fbc;};'use strict';var _=require('lodash');var util=require(_0x8862('0x0'));var logger=require(_0x8862('0x1'))('api');var moment=require(_0x8862('0x2'));var BPromise=require(_0x8862('0x3'));var rp=require(_0x8862('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8862('0x5'));var config=require(_0x8862('0x6'));var attributes=require(_0x8862('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x15dfe0,_0x21f262){return _0x15dfe0[_0x8862('0x8')](_0x8862('0x9'),attributes,{'tableName':_0x8862('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11c3=['../../components/integrations/configuration','exports','define','int_freshdesk_accounts','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x4aa72d,_0x265b1c){var _0x8145c0=function(_0x12b518){while(--_0x12b518){_0x4aa72d['push'](_0x4aa72d['shift']());}};_0x8145c0(++_0x265b1c);}(_0x11c3,0x1a8));var _0x311c=function(_0x56add3,_0x4ddbba){_0x56add3=_0x56add3-0x0;var _0x488a49=_0x11c3[_0x56add3];return _0x488a49;};'use strict';var _=require('lodash');var util=require(_0x311c('0x0'));var logger=require('../../config/logger')(_0x311c('0x1'));var moment=require('moment');var BPromise=require(_0x311c('0x2'));var rp=require(_0x311c('0x3'));var fs=require('fs');var path=require(_0x311c('0x4'));var rimraf=require(_0x311c('0x5'));var config=require(_0x311c('0x6'));var attributes=require(_0x311c('0x7'));var integrations=require(_0x311c('0x8'));module[_0x311c('0x9')]=function(_0x1dc53a,_0x1e7bba){return _0x1dc53a[_0x311c('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x311c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 5dbc422..bc8425a 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 _0x155e=['http','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','GetFreshdeskAccount','catch','find','ShowFreshdeskAccount','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5c23da,_0x11471e){var _0x1f9652=function(_0x1f457d){while(--_0x1f457d){_0x5c23da['push'](_0x5c23da['shift']());}};_0x1f9652(++_0x11471e);}(_0x155e,0x9c));var _0xe155=function(_0x259969,_0x4b8eb5){_0x259969=_0x259969-0x0;var _0x3c9fcb=_0x155e[_0x259969];return _0x3c9fcb;};'use strict';var _=require(_0xe155('0x0'));var util=require(_0xe155('0x1'));var moment=require(_0xe155('0x2'));var BPromise=require('bluebird');var rs=require(_0xe155('0x3'));var fs=require('fs');var Redis=require(_0xe155('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe155('0x5'));var logger=require(_0xe155('0x6'))('rpc');var config=require(_0xe155('0x7'));var jayson=require(_0xe155('0x8'));var client=jayson['client'][_0xe155('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdf58be,_0x214aec,_0x23fa5d){return new BPromise(function(_0x4f1e3a,_0x3bf02f){return client['request'](_0xdf58be,_0x23fa5d)[_0xe155('0xa')](function(_0x1acc4e){logger[_0xe155('0xb')](_0xe155('0xc'),_0x214aec,'request\x20sent');logger[_0xe155('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x214aec,'request\x20sent',JSON[_0xe155('0xe')](_0x1acc4e));if(_0x1acc4e[_0xe155('0xf')]){if(_0x1acc4e[_0xe155('0xf')][_0xe155('0x10')]===0x1f4){logger[_0xe155('0xf')](_0xe155('0xc'),_0x214aec,_0x1acc4e[_0xe155('0xf')][_0xe155('0x11')]);return _0x3bf02f(_0x1acc4e[_0xe155('0xf')]['message']);}logger[_0xe155('0xf')](_0xe155('0xc'),_0x214aec,_0x1acc4e[_0xe155('0xf')][_0xe155('0x11')]);return _0x4f1e3a(_0x1acc4e[_0xe155('0xf')]['message']);}else{logger[_0xe155('0xb')](_0xe155('0xc'),_0x214aec,_0xe155('0x12'));_0x4f1e3a(_0x1acc4e[_0xe155('0x13')]['message']);}})['catch'](function(_0x37ec99){logger['error'](_0xe155('0xc'),_0x214aec,_0x37ec99);_0x3bf02f(_0x37ec99);});});}exports['GetFreshdeskAccount']=function(_0x32865e){var _0x5bc545=this;return new Promise(function(_0x388b66,_0x14d4c8){return db[_0xe155('0x14')][_0xe155('0x15')]({'raw':_0x32865e[_0xe155('0x16')]?_0x32865e[_0xe155('0x16')][_0xe155('0x17')]===undefined?!![]:![]:!![],'where':_0x32865e[_0xe155('0x16')]?_0x32865e[_0xe155('0x16')][_0xe155('0x18')]||null:null,'attributes':_0x32865e[_0xe155('0x16')]?_0x32865e['options'][_0xe155('0x19')]||null:null,'limit':_0x32865e[_0xe155('0x16')]?_0x32865e[_0xe155('0x16')]['limit']||null:null,'include':_0x32865e[_0xe155('0x16')]?_0x32865e[_0xe155('0x16')][_0xe155('0x1a')]?_['map'](_0x32865e[_0xe155('0x16')][_0xe155('0x1a')],function(_0x1037bf){return{'model':db[_0x1037bf[_0xe155('0x1b')]],'as':_0x1037bf['as'],'attributes':_0x1037bf[_0xe155('0x19')],'include':_0x1037bf[_0xe155('0x1a')]?_[_0xe155('0x1c')](_0x1037bf[_0xe155('0x1a')],function(_0x1b139a){return{'model':db[_0x1b139a['model']],'as':_0x1b139a['as'],'attributes':_0x1b139a[_0xe155('0x19')],'include':_0x1b139a[_0xe155('0x1a')]?_['map'](_0x1b139a[_0xe155('0x1a')],function(_0x12e79e){return{'model':db[_0x12e79e[_0xe155('0x1b')]],'as':_0x12e79e['as'],'attributes':_0x12e79e[_0xe155('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d831b){logger[_0xe155('0xb')](_0xe155('0x1d'),_0x32865e);logger[_0xe155('0xd')]('GetFreshdeskAccount',_0x32865e,JSON[_0xe155('0xe')](_0x3d831b));_0x388b66(_0x3d831b);})[_0xe155('0x1e')](function(_0x1c7c69){logger['error']('GetFreshdeskAccount',_0x1c7c69[_0xe155('0x11')],_0x32865e);_0x14d4c8(_0x5bc545[_0xe155('0xf')](0x1f4,_0x1c7c69['message']));});});};exports['ShowFreshdeskAccount']=function(_0x4756a7){var _0x13235e=this;return new Promise(function(_0x948d3e,_0x58ef73){return db[_0xe155('0x14')][_0xe155('0x1f')]({'raw':_0x4756a7[_0xe155('0x16')]?_0x4756a7[_0xe155('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4756a7[_0xe155('0x16')]?_0x4756a7['options'][_0xe155('0x18')]||null:null,'attributes':_0x4756a7[_0xe155('0x16')]?_0x4756a7[_0xe155('0x16')]['attributes']||null:null,'include':_0x4756a7[_0xe155('0x16')]?_0x4756a7[_0xe155('0x16')][_0xe155('0x1a')]?_[_0xe155('0x1c')](_0x4756a7[_0xe155('0x16')]['include'],function(_0x7edb5c){return{'model':db[_0x7edb5c[_0xe155('0x1b')]],'as':_0x7edb5c['as'],'attributes':_0x7edb5c[_0xe155('0x19')],'include':_0x7edb5c[_0xe155('0x1a')]?_[_0xe155('0x1c')](_0x7edb5c[_0xe155('0x1a')],function(_0x382ff4){return{'model':db[_0x382ff4[_0xe155('0x1b')]],'as':_0x382ff4['as'],'attributes':_0x382ff4[_0xe155('0x19')],'include':_0x382ff4['include']?_[_0xe155('0x1c')](_0x382ff4[_0xe155('0x1a')],function(_0x4fb388){return{'model':db[_0x4fb388['model']],'as':_0x4fb388['as'],'attributes':_0x4fb388[_0xe155('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe155('0xa')](function(_0x250abc){logger[_0xe155('0xb')](_0xe155('0x20'),_0x4756a7);logger[_0xe155('0xd')]('ShowFreshdeskAccount',_0x4756a7,JSON[_0xe155('0xe')](_0x250abc));_0x948d3e(_0x250abc);})['catch'](function(_0x4145d6){logger[_0xe155('0xf')](_0xe155('0x20'),_0x4145d6[_0xe155('0x11')],_0x4756a7);_0x58ef73(_0x13235e[_0xe155('0xf')](0x1f4,_0x4145d6[_0xe155('0x11')]));});});}; \ No newline at end of file +var _0xd2c2=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','where','attributes','limit','include','map','model','raw','then','ShowFreshdeskAccount','lodash','util','moment','bluebird'];(function(_0x154d5a,_0x1bf835){var _0x5a5735=function(_0x4cc330){while(--_0x4cc330){_0x154d5a['push'](_0x154d5a['shift']());}};_0x5a5735(++_0x1bf835);}(_0xd2c2,0xf1));var _0x2d2c=function(_0x435890,_0xddcd86){_0x435890=_0x435890-0x0;var _0x288b72=_0xd2c2[_0x435890];return _0x288b72;};'use strict';var _=require(_0x2d2c('0x0'));var util=require(_0x2d2c('0x1'));var moment=require(_0x2d2c('0x2'));var BPromise=require(_0x2d2c('0x3'));var rs=require(_0x2d2c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d2c('0x5'))['db'];var utils=require(_0x2d2c('0x6'));var logger=require(_0x2d2c('0x7'))(_0x2d2c('0x8'));var config=require('../../config/environment');var jayson=require(_0x2d2c('0x9'));var client=jayson['client'][_0x2d2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1992ab,_0x50dd65,_0xbb6c20){return new BPromise(function(_0x3b0be9,_0x1d230c){return client[_0x2d2c('0xb')](_0x1992ab,_0xbb6c20)['then'](function(_0xf336f5){logger[_0x2d2c('0xc')](_0x2d2c('0xd'),_0x50dd65,'request\x20sent');logger[_0x2d2c('0xe')](_0x2d2c('0xf'),_0x50dd65,_0x2d2c('0x10'),JSON[_0x2d2c('0x11')](_0xf336f5));if(_0xf336f5['error']){if(_0xf336f5[_0x2d2c('0x12')][_0x2d2c('0x13')]===0x1f4){logger[_0x2d2c('0x12')](_0x2d2c('0xd'),_0x50dd65,_0xf336f5[_0x2d2c('0x12')][_0x2d2c('0x14')]);return _0x1d230c(_0xf336f5[_0x2d2c('0x12')]['message']);}logger['error'](_0x2d2c('0xd'),_0x50dd65,_0xf336f5[_0x2d2c('0x12')][_0x2d2c('0x14')]);return _0x3b0be9(_0xf336f5[_0x2d2c('0x12')][_0x2d2c('0x14')]);}else{logger['info'](_0x2d2c('0xd'),_0x50dd65,_0x2d2c('0x10'));_0x3b0be9(_0xf336f5[_0x2d2c('0x15')][_0x2d2c('0x14')]);}})[_0x2d2c('0x16')](function(_0x49c12c){logger['error'](_0x2d2c('0xd'),_0x50dd65,_0x49c12c);_0x1d230c(_0x49c12c);});});}exports[_0x2d2c('0x17')]=function(_0xb7e506){var _0x2cf86e=this;return new Promise(function(_0x263a83,_0x57615f){return db[_0x2d2c('0x18')]['findAll']({'raw':_0xb7e506[_0x2d2c('0x19')]?_0xb7e506[_0x2d2c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xb7e506[_0x2d2c('0x19')]?_0xb7e506[_0x2d2c('0x19')][_0x2d2c('0x1a')]||null:null,'attributes':_0xb7e506[_0x2d2c('0x19')]?_0xb7e506[_0x2d2c('0x19')][_0x2d2c('0x1b')]||null:null,'limit':_0xb7e506[_0x2d2c('0x19')]?_0xb7e506[_0x2d2c('0x19')][_0x2d2c('0x1c')]||null:null,'include':_0xb7e506[_0x2d2c('0x19')]?_0xb7e506[_0x2d2c('0x19')][_0x2d2c('0x1d')]?_[_0x2d2c('0x1e')](_0xb7e506[_0x2d2c('0x19')]['include'],function(_0x13f742){return{'model':db[_0x13f742[_0x2d2c('0x1f')]],'as':_0x13f742['as'],'attributes':_0x13f742['attributes'],'include':_0x13f742['include']?_['map'](_0x13f742[_0x2d2c('0x1d')],function(_0x4d5319){return{'model':db[_0x4d5319['model']],'as':_0x4d5319['as'],'attributes':_0x4d5319['attributes'],'include':_0x4d5319[_0x2d2c('0x1d')]?_['map'](_0x4d5319[_0x2d2c('0x1d')],function(_0x26d650){return{'model':db[_0x26d650[_0x2d2c('0x1f')]],'as':_0x26d650['as'],'attributes':_0x26d650['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cf954){logger[_0x2d2c('0xc')](_0x2d2c('0x17'),_0xb7e506);logger[_0x2d2c('0xe')](_0x2d2c('0x17'),_0xb7e506,JSON[_0x2d2c('0x11')](_0x4cf954));_0x263a83(_0x4cf954);})['catch'](function(_0x5c2baa){logger[_0x2d2c('0x12')]('GetFreshdeskAccount',_0x5c2baa[_0x2d2c('0x14')],_0xb7e506);_0x57615f(_0x2cf86e[_0x2d2c('0x12')](0x1f4,_0x5c2baa[_0x2d2c('0x14')]));});});};exports['ShowFreshdeskAccount']=function(_0x4fac30){var _0x5a2a68=this;return new Promise(function(_0x39ece7,_0xc573a6){return db[_0x2d2c('0x18')]['find']({'raw':_0x4fac30[_0x2d2c('0x19')]?_0x4fac30[_0x2d2c('0x19')][_0x2d2c('0x20')]===undefined?!![]:![]:!![],'where':_0x4fac30['options']?_0x4fac30[_0x2d2c('0x19')][_0x2d2c('0x1a')]||null:null,'attributes':_0x4fac30['options']?_0x4fac30[_0x2d2c('0x19')][_0x2d2c('0x1b')]||null:null,'include':_0x4fac30[_0x2d2c('0x19')]?_0x4fac30['options']['include']?_[_0x2d2c('0x1e')](_0x4fac30['options'][_0x2d2c('0x1d')],function(_0x3b5466){return{'model':db[_0x3b5466[_0x2d2c('0x1f')]],'as':_0x3b5466['as'],'attributes':_0x3b5466[_0x2d2c('0x1b')],'include':_0x3b5466[_0x2d2c('0x1d')]?_[_0x2d2c('0x1e')](_0x3b5466['include'],function(_0x1f2010){return{'model':db[_0x1f2010[_0x2d2c('0x1f')]],'as':_0x1f2010['as'],'attributes':_0x1f2010['attributes'],'include':_0x1f2010[_0x2d2c('0x1d')]?_['map'](_0x1f2010[_0x2d2c('0x1d')],function(_0x18f1fa){return{'model':db[_0x18f1fa['model']],'as':_0x18f1fa['as'],'attributes':_0x18f1fa[_0x2d2c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2d2c('0x21')](function(_0x3eda5e){logger[_0x2d2c('0xc')](_0x2d2c('0x22'),_0x4fac30);logger[_0x2d2c('0xe')]('ShowFreshdeskAccount',_0x4fac30,JSON[_0x2d2c('0x11')](_0x3eda5e));_0x39ece7(_0x3eda5e);})[_0x2d2c('0x16')](function(_0x3c9a4f){logger[_0x2d2c('0x12')](_0x2d2c('0x22'),_0x3c9a4f['message'],_0x4fac30);_0xc573a6(_0x5a2a68[_0x2d2c('0x12')](0x1f4,_0x3c9a4f[_0x2d2c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 2068104..a0eb172 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 _0x052e=['update','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','/:id/tags','setTags','/:id'];(function(_0x126f0d,_0x26adba){var _0x337886=function(_0x51b856){while(--_0x51b856){_0x126f0d['push'](_0x126f0d['shift']());}};_0x337886(++_0x26adba);}(_0x052e,0xea));var _0xe052=function(_0xae2bfe,_0x2f45b9){_0xae2bfe=_0xae2bfe-0x0;var _0x167f73=_0x052e[_0xae2bfe];return _0x167f73;};'use strict';var multer=require(_0xe052('0x0'));var util=require(_0xe052('0x1'));var path=require(_0xe052('0x2'));var timeout=require(_0xe052('0x3'));var express=require('express');var router=express[_0xe052('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe052('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xe052('0x6')]('/',auth[_0xe052('0x7')](),controller['index']);router[_0xe052('0x6')]('/:id',auth[_0xe052('0x7')](),controller['show']);router[_0xe052('0x6')]('/:id/fields',auth[_0xe052('0x7')](),controller[_0xe052('0x8')]);router['get'](_0xe052('0x9'),auth[_0xe052('0x7')](),controller[_0xe052('0xa')]);router[_0xe052('0x6')](_0xe052('0xb'),auth[_0xe052('0x7')](),controller[_0xe052('0xc')]);router[_0xe052('0x6')]('/:id/tags',auth[_0xe052('0x7')](),controller['getTags']);router[_0xe052('0xd')]('/',auth['isAuthenticated'](),controller[_0xe052('0xe')]);router['post'](_0xe052('0xf'),auth['isAuthenticated'](),controller[_0xe052('0x10')]);router['put'](_0xe052('0x11'),auth[_0xe052('0x7')](),controller[_0xe052('0x12')]);router[_0xe052('0x13')]('/:id',auth[_0xe052('0x7')](),controller['destroy']);module[_0xe052('0x14')]=router; \ No newline at end of file +var _0xa94e=['show','/:id/fields','getFields','/:id/descriptions','/:id/tags','getTags','post','create','put','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xa94e,0x192));var _0xea94=function(_0x3350fe,_0x4e5df9){_0x3350fe=_0x3350fe-0x0;var _0x30ba33=_0xa94e[_0x3350fe];return _0x30ba33;};'use strict';var multer=require(_0xea94('0x0'));var util=require(_0xea94('0x1'));var path=require('path');var timeout=require(_0xea94('0x2'));var express=require(_0xea94('0x3'));var router=express['Router']();var fs_extra=require(_0xea94('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xea94('0x5'));var config=require(_0xea94('0x6'));var controller=require(_0xea94('0x7'));router['get']('/',auth[_0xea94('0x8')](),controller[_0xea94('0x9')]);router[_0xea94('0xa')](_0xea94('0xb'),auth[_0xea94('0x8')](),controller[_0xea94('0xc')]);router[_0xea94('0xa')](_0xea94('0xd'),auth[_0xea94('0x8')](),controller[_0xea94('0xe')]);router[_0xea94('0xa')]('/:id/subjects',auth[_0xea94('0x8')](),controller['getSubjects']);router['get'](_0xea94('0xf'),auth[_0xea94('0x8')](),controller['getDescriptions']);router[_0xea94('0xa')](_0xea94('0x10'),auth[_0xea94('0x8')](),controller[_0xea94('0x11')]);router[_0xea94('0x12')]('/',auth['isAuthenticated'](),controller[_0xea94('0x13')]);router[_0xea94('0x12')](_0xea94('0x10'),auth[_0xea94('0x8')](),controller['setTags']);router[_0xea94('0x14')](_0xea94('0xb'),auth[_0xea94('0x8')](),controller['update']);router[_0xea94('0x15')]('/:id',auth[_0xea94('0x8')](),controller['destroy']);module[_0xea94('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 8498cb1..1bfd2be 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 _0x08f2=['exports','STRING','sequelize'];(function(_0x2146eb,_0x16657a){var _0x27a387=function(_0x59377c){while(--_0x59377c){_0x2146eb['push'](_0x2146eb['shift']());}};_0x27a387(++_0x16657a);}(_0x08f2,0x11f));var _0x208f=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x08f2[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x208f('0x0'));module[_0x208f('0x1')]={'name':{'type':Sequelize[_0x208f('0x2')]},'description':{'type':Sequelize[_0x208f('0x2')]}}; \ No newline at end of file +var _0x1e1b=['STRING','sequelize','exports'];(function(_0x35e75f,_0x95eb6){var _0x33866a=function(_0x48d2e6){while(--_0x48d2e6){_0x35e75f['push'](_0x35e75f['shift']());}};_0x33866a(++_0x95eb6);}(_0x1e1b,0x14e));var _0xb1e1=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0x1e1b[_0x3e961c];return _0x474f9c;};'use strict';var Sequelize=require(_0xb1e1('0x0'));module[_0xb1e1('0x1')]={'name':{'type':Sequelize[_0xb1e1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 9bc9a05..6927c53 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 _0xb691=['show','params','options','catch','create','body','find','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xb691,0x111));var _0x1b69=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0xb691[_0x7275e9];return _0x17b99d;};'use strict';var emlformat=require(_0x1b69('0x0'));var rimraf=require(_0x1b69('0x1'));var zipdir=require(_0x1b69('0x2'));var jsonpatch=require(_0x1b69('0x3'));var rp=require('request-promise');var moment=require(_0x1b69('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1b69('0x5'));var util=require(_0x1b69('0x6'));var path=require(_0x1b69('0x7'));var sox=require('sox');var csv=require(_0x1b69('0x8'));var ejs=require(_0x1b69('0x9'));var fs=require('fs');var fs_extra=require(_0x1b69('0xa'));var _=require(_0x1b69('0xb'));var squel=require(_0x1b69('0xc'));var crypto=require(_0x1b69('0xd'));var jsforce=require(_0x1b69('0xe'));var deskjs=require(_0x1b69('0xf'));var toCsv=require(_0x1b69('0x8'));var querystring=require(_0x1b69('0x10'));var Papa=require(_0x1b69('0x11'));var Redis=require(_0x1b69('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1b69('0x13'));var as=require(_0x1b69('0x14'));var hardwareService=require(_0x1b69('0x15'));var logger=require(_0x1b69('0x16'))(_0x1b69('0x17'));var utils=require(_0x1b69('0x18'));var config=require(_0x1b69('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b69('0x1a'))['db'];function respondWithStatusCode(_0x4f98f2,_0x2e2ce8){_0x2e2ce8=_0x2e2ce8||0xcc;return function(_0x152b8e){if(_0x152b8e){return _0x4f98f2['sendStatus'](_0x2e2ce8);}return _0x4f98f2[_0x1b69('0x1b')](_0x2e2ce8)[_0x1b69('0x1c')]();};}function respondWithResult(_0x476c27,_0x54d5f2){_0x54d5f2=_0x54d5f2||0xc8;return function(_0x17f596){if(_0x17f596){return _0x476c27[_0x1b69('0x1b')](_0x54d5f2)[_0x1b69('0x1d')](_0x17f596);}};}function respondWithFilteredResult(_0x522486,_0xd95d7b){return function(_0x5b1dec){if(_0x5b1dec){var _0x32cd64=typeof _0xd95d7b[_0x1b69('0x1e')]===_0x1b69('0x1f')&&typeof _0xd95d7b[_0x1b69('0x20')]===_0x1b69('0x1f');var _0xaae12e=_0x5b1dec[_0x1b69('0x21')];var _0x2ec783=_0x32cd64?0x0:_0xd95d7b[_0x1b69('0x1e')];var _0x20ea46=_0x32cd64?_0x5b1dec['count']:_0xd95d7b[_0x1b69('0x1e')]+_0xd95d7b['limit'];var _0x12184c;if(_0x20ea46>=_0xaae12e){_0x20ea46=_0xaae12e;_0x12184c=0xc8;}else{_0x12184c=0xce;}_0x522486['status'](_0x12184c);return _0x522486[_0x1b69('0x22')](_0x1b69('0x23'),_0x2ec783+'-'+_0x20ea46+'/'+_0xaae12e)['json'](_0x5b1dec);}return null;};}function patchUpdates(_0x175857){return function(_0x15c197){try{jsonpatch['apply'](_0x15c197,_0x175857,!![]);}catch(_0x186e32){return BPromise[_0x1b69('0x24')](_0x186e32);}return _0x15c197[_0x1b69('0x25')]();};}function saveUpdates(_0x270cfc,_0x13746b){return function(_0x2d5d47){if(_0x2d5d47){return _0x2d5d47[_0x1b69('0x26')](_0x270cfc)[_0x1b69('0x27')](function(_0x6eebab){return _0x6eebab;});}return null;};}function removeEntity(_0x2684bd,_0x576211){return function(_0x16c8ae){if(_0x16c8ae){return _0x16c8ae['destroy']()[_0x1b69('0x27')](function(){_0x2684bd[_0x1b69('0x1b')](0xcc)[_0x1b69('0x1c')]();});}};}function handleEntityNotFound(_0x3c23ef,_0x5dfd88){return function(_0x33231e){if(!_0x33231e){_0x3c23ef[_0x1b69('0x28')](0x194);}return _0x33231e;};}function handleError(_0x34a528,_0x1cc3b7){_0x1cc3b7=_0x1cc3b7||0x1f4;return function(_0x4c4b4d){logger[_0x1b69('0x29')](_0x4c4b4d[_0x1b69('0x2a')]);if(_0x4c4b4d[_0x1b69('0x2b')]){delete _0x4c4b4d[_0x1b69('0x2b')];}_0x34a528[_0x1b69('0x1b')](_0x1cc3b7)[_0x1b69('0x2c')](_0x4c4b4d);};}exports[_0x1b69('0x2d')]=function(_0x7e0607,_0x259676){var _0x16f060={},_0x4d6fa2={},_0x5449de={'count':0x0,'rows':[]};var _0x14b1a6=_[_0x1b69('0x2e')](db[_0x1b69('0x2f')][_0x1b69('0x30')],function(_0x1a169f){return{'name':_0x1a169f[_0x1b69('0x31')],'type':_0x1a169f[_0x1b69('0x32')]['key']};});_0x4d6fa2[_0x1b69('0x33')]=_[_0x1b69('0x2e')](_0x14b1a6,'name');_0x4d6fa2['query']=_[_0x1b69('0x34')](_0x7e0607[_0x1b69('0x35')]);_0x4d6fa2[_0x1b69('0x36')]=_[_0x1b69('0x37')](_0x4d6fa2[_0x1b69('0x33')],_0x4d6fa2['query']);_0x16f060['attributes']=_[_0x1b69('0x37')](_0x4d6fa2[_0x1b69('0x33')],qs[_0x1b69('0x38')](_0x7e0607[_0x1b69('0x35')][_0x1b69('0x38')]));_0x16f060[_0x1b69('0x39')]=_0x16f060['attributes'][_0x1b69('0x3a')]?_0x16f060[_0x1b69('0x39')]:_0x4d6fa2[_0x1b69('0x33')];if(!_0x7e0607['query'][_0x1b69('0x3b')](_0x1b69('0x3c'))){_0x16f060['limit']=qs[_0x1b69('0x20')](_0x7e0607[_0x1b69('0x35')]['limit']);_0x16f060['offset']=qs['offset'](_0x7e0607[_0x1b69('0x35')][_0x1b69('0x1e')]);}_0x16f060[_0x1b69('0x3d')]=qs[_0x1b69('0x3e')](_0x7e0607[_0x1b69('0x35')][_0x1b69('0x3e')]);_0x16f060[_0x1b69('0x3f')]=qs['filters'](_[_0x1b69('0x40')](_0x7e0607[_0x1b69('0x35')],_0x4d6fa2[_0x1b69('0x36')]),_0x14b1a6);if(_0x7e0607[_0x1b69('0x35')][_0x1b69('0x41')]){_0x16f060[_0x1b69('0x3f')]=_['merge'](_0x16f060[_0x1b69('0x3f')],{'$or':_[_0x1b69('0x2e')](_0x14b1a6,function(_0x14bc9a){if(_0x14bc9a[_0x1b69('0x32')]!=='VIRTUAL'){var _0x41b1c3={};_0x41b1c3[_0x14bc9a[_0x1b69('0x2b')]]={'$like':'%'+_0x7e0607[_0x1b69('0x35')]['filter']+'%'};return _0x41b1c3;}})});}_0x16f060=_[_0x1b69('0x42')]({},_0x16f060,_0x7e0607['options']);var _0x25ea3c={'where':_0x16f060[_0x1b69('0x3f')]};return db[_0x1b69('0x2f')]['count'](_0x25ea3c)[_0x1b69('0x27')](function(_0x3a33a2){_0x5449de[_0x1b69('0x21')]=_0x3a33a2;if(_0x7e0607[_0x1b69('0x35')][_0x1b69('0x43')]){_0x16f060[_0x1b69('0x44')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x1b69('0x45')](_0x16f060);})['then'](function(_0x282949){_0x5449de[_0x1b69('0x46')]=_0x282949;return _0x5449de;})[_0x1b69('0x27')](respondWithFilteredResult(_0x259676,_0x16f060))['catch'](handleError(_0x259676,null));};exports[_0x1b69('0x47')]=function(_0x367374,_0x42509d){var _0x4744ac={'raw':![],'where':{'id':_0x367374[_0x1b69('0x48')]['id']}},_0x2ab8c7={};_0x2ab8c7[_0x1b69('0x33')]=_[_0x1b69('0x34')](db[_0x1b69('0x2f')]['rawAttributes']);_0x2ab8c7[_0x1b69('0x35')]=_[_0x1b69('0x34')](_0x367374[_0x1b69('0x35')]);_0x2ab8c7[_0x1b69('0x36')]=_[_0x1b69('0x37')](_0x2ab8c7[_0x1b69('0x33')],_0x2ab8c7[_0x1b69('0x35')]);_0x4744ac['attributes']=_[_0x1b69('0x37')](_0x2ab8c7[_0x1b69('0x33')],qs[_0x1b69('0x38')](_0x367374[_0x1b69('0x35')][_0x1b69('0x38')]));_0x4744ac['attributes']=_0x4744ac[_0x1b69('0x39')][_0x1b69('0x3a')]?_0x4744ac[_0x1b69('0x39')]:_0x2ab8c7[_0x1b69('0x33')];if(_0x367374['query'][_0x1b69('0x43')]){_0x4744ac[_0x1b69('0x44')]=[{'all':!![]}];}_0x4744ac=_['merge']({},_0x4744ac,_0x367374[_0x1b69('0x49')]);return db[_0x1b69('0x2f')]['find'](_0x4744ac)[_0x1b69('0x27')](handleEntityNotFound(_0x42509d,null))['then'](respondWithResult(_0x42509d,null))[_0x1b69('0x4a')](handleError(_0x42509d,null));};exports[_0x1b69('0x4b')]=function(_0x3a262f,_0x4f963a){return db[_0x1b69('0x2f')][_0x1b69('0x4b')](_0x3a262f[_0x1b69('0x4c')],{})[_0x1b69('0x27')](respondWithResult(_0x4f963a,0xc9))['catch'](handleError(_0x4f963a,null));};exports['update']=function(_0x5d3c52,_0x35f250){if(_0x5d3c52[_0x1b69('0x4c')]['id']){delete _0x5d3c52[_0x1b69('0x4c')]['id'];}return db[_0x1b69('0x2f')][_0x1b69('0x4d')]({'where':{'id':_0x5d3c52[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x35f250,null))[_0x1b69('0x27')](saveUpdates(_0x5d3c52[_0x1b69('0x4c')],null))[_0x1b69('0x27')](respondWithResult(_0x35f250,null))[_0x1b69('0x4a')](handleError(_0x35f250,null));};exports[_0x1b69('0x4e')]=function(_0x282774,_0x57e1e0){return db['FreshdeskConfiguration'][_0x1b69('0x4d')]({'where':{'id':_0x282774[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x57e1e0,null))[_0x1b69('0x27')](removeEntity(_0x57e1e0,null))[_0x1b69('0x4a')](handleError(_0x57e1e0,null));};exports[_0x1b69('0x4f')]=function(_0x3cb853,_0x53e43d,_0x4c8232){var _0x148e8a={};var _0x2e36c6={};var _0x7d97a0;var _0x34e5e3;return db[_0x1b69('0x2f')][_0x1b69('0x50')]({'where':{'id':_0x3cb853[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x53e43d,null))[_0x1b69('0x27')](function(_0x20aef8){if(_0x20aef8){_0x7d97a0=_0x20aef8;_0x2e36c6[_0x1b69('0x33')]=_[_0x1b69('0x34')](db[_0x1b69('0x51')][_0x1b69('0x30')]);_0x2e36c6[_0x1b69('0x35')]=_[_0x1b69('0x34')](_0x3cb853[_0x1b69('0x35')]);_0x2e36c6['filters']=_[_0x1b69('0x37')](_0x2e36c6[_0x1b69('0x33')],_0x2e36c6['query']);_0x148e8a['attributes']=_[_0x1b69('0x37')](_0x2e36c6[_0x1b69('0x33')],qs[_0x1b69('0x38')](_0x3cb853[_0x1b69('0x35')][_0x1b69('0x38')]));_0x148e8a[_0x1b69('0x39')]=_0x148e8a['attributes'][_0x1b69('0x3a')]?_0x148e8a[_0x1b69('0x39')]:_0x2e36c6['model'];_0x148e8a['order']=qs[_0x1b69('0x3e')](_0x3cb853[_0x1b69('0x35')][_0x1b69('0x3e')]);_0x148e8a['where']=qs['filters'](_[_0x1b69('0x40')](_0x3cb853[_0x1b69('0x35')],_0x2e36c6['filters']));if(_0x3cb853[_0x1b69('0x35')][_0x1b69('0x41')]){_0x148e8a['where']=_[_0x1b69('0x42')](_0x148e8a['where'],{'$or':_[_0x1b69('0x2e')](_0x148e8a['attributes'],function(_0x5ca7e7){var _0x486df4={};_0x486df4[_0x5ca7e7]={'$like':'%'+_0x3cb853['query'][_0x1b69('0x41')]+'%'};return _0x486df4;})});}_0x148e8a=_['merge']({},_0x148e8a,_0x3cb853[_0x1b69('0x49')]);return _0x7d97a0['getFields'](_0x148e8a);}})[_0x1b69('0x27')](function(_0x52ac85){if(_0x52ac85){_0x34e5e3=_0x52ac85['length'];if(!_0x3cb853[_0x1b69('0x35')]['hasOwnProperty']('nolimit')){_0x148e8a[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x3cb853[_0x1b69('0x35')][_0x1b69('0x20')]);_0x148e8a[_0x1b69('0x1e')]=qs[_0x1b69('0x1e')](_0x3cb853[_0x1b69('0x35')]['offset']);}return _0x7d97a0[_0x1b69('0x4f')](_0x148e8a);}})[_0x1b69('0x27')](function(_0x482844){if(_0x482844){return _0x482844?{'count':_0x34e5e3,'rows':_0x482844}:null;}})[_0x1b69('0x27')](respondWithResult(_0x53e43d,null))[_0x1b69('0x4a')](handleError(_0x53e43d,null));};exports['getSubjects']=function(_0x17441a,_0x490639,_0x11ed3b){var _0x5b3ae3={};var _0x1debb2={};var _0x85a88;var _0x5db4da;return db['FreshdeskConfiguration'][_0x1b69('0x50')]({'where':{'id':_0x17441a[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x490639,null))[_0x1b69('0x27')](function(_0x19be27){if(_0x19be27){_0x85a88=_0x19be27;_0x1debb2[_0x1b69('0x33')]=_['keys'](db[_0x1b69('0x51')][_0x1b69('0x30')]);_0x1debb2[_0x1b69('0x35')]=_[_0x1b69('0x34')](_0x17441a[_0x1b69('0x35')]);_0x1debb2[_0x1b69('0x36')]=_[_0x1b69('0x37')](_0x1debb2[_0x1b69('0x33')],_0x1debb2[_0x1b69('0x35')]);_0x5b3ae3[_0x1b69('0x39')]=_[_0x1b69('0x37')](_0x1debb2[_0x1b69('0x33')],qs[_0x1b69('0x38')](_0x17441a['query'][_0x1b69('0x38')]));_0x5b3ae3['attributes']=_0x5b3ae3[_0x1b69('0x39')][_0x1b69('0x3a')]?_0x5b3ae3[_0x1b69('0x39')]:_0x1debb2[_0x1b69('0x33')];_0x5b3ae3[_0x1b69('0x3d')]=qs[_0x1b69('0x3e')](_0x17441a[_0x1b69('0x35')][_0x1b69('0x3e')]);_0x5b3ae3[_0x1b69('0x3f')]=qs[_0x1b69('0x36')](_['pick'](_0x17441a[_0x1b69('0x35')],_0x1debb2['filters']));if(_0x17441a[_0x1b69('0x35')][_0x1b69('0x41')]){_0x5b3ae3[_0x1b69('0x3f')]=_[_0x1b69('0x42')](_0x5b3ae3['where'],{'$or':_[_0x1b69('0x2e')](_0x5b3ae3[_0x1b69('0x39')],function(_0x4afaa6){var _0x5c5e95={};_0x5c5e95[_0x4afaa6]={'$like':'%'+_0x17441a[_0x1b69('0x35')]['filter']+'%'};return _0x5c5e95;})});}_0x5b3ae3=_[_0x1b69('0x42')]({},_0x5b3ae3,_0x17441a[_0x1b69('0x49')]);return _0x85a88[_0x1b69('0x52')](_0x5b3ae3);}})['then'](function(_0x5bccb1){if(_0x5bccb1){_0x5db4da=_0x5bccb1[_0x1b69('0x3a')];if(!_0x17441a['query']['hasOwnProperty']('nolimit')){_0x5b3ae3[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x17441a[_0x1b69('0x35')][_0x1b69('0x20')]);_0x5b3ae3[_0x1b69('0x1e')]=qs['offset'](_0x17441a[_0x1b69('0x35')][_0x1b69('0x1e')]);}return _0x85a88[_0x1b69('0x52')](_0x5b3ae3);}})[_0x1b69('0x27')](function(_0x4a7df6){if(_0x4a7df6){return _0x4a7df6?{'count':_0x5db4da,'rows':_0x4a7df6}:null;}})[_0x1b69('0x27')](respondWithResult(_0x490639,null))['catch'](handleError(_0x490639,null));};exports[_0x1b69('0x53')]=function(_0x344431,_0x36e198,_0x44e420){var _0xb7ff51={};var _0x6432c5={};var _0x252a7c;var _0x50a670;return db[_0x1b69('0x2f')]['findOne']({'where':{'id':_0x344431[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x36e198,null))[_0x1b69('0x27')](function(_0x33d3fe){if(_0x33d3fe){_0x252a7c=_0x33d3fe;_0x6432c5[_0x1b69('0x33')]=_[_0x1b69('0x34')](db[_0x1b69('0x51')]['rawAttributes']);_0x6432c5[_0x1b69('0x35')]=_[_0x1b69('0x34')](_0x344431[_0x1b69('0x35')]);_0x6432c5[_0x1b69('0x36')]=_[_0x1b69('0x37')](_0x6432c5[_0x1b69('0x33')],_0x6432c5['query']);_0xb7ff51[_0x1b69('0x39')]=_[_0x1b69('0x37')](_0x6432c5[_0x1b69('0x33')],qs[_0x1b69('0x38')](_0x344431['query'][_0x1b69('0x38')]));_0xb7ff51[_0x1b69('0x39')]=_0xb7ff51[_0x1b69('0x39')]['length']?_0xb7ff51[_0x1b69('0x39')]:_0x6432c5[_0x1b69('0x33')];_0xb7ff51[_0x1b69('0x3d')]=qs[_0x1b69('0x3e')](_0x344431[_0x1b69('0x35')][_0x1b69('0x3e')]);_0xb7ff51[_0x1b69('0x3f')]=qs[_0x1b69('0x36')](_['pick'](_0x344431['query'],_0x6432c5[_0x1b69('0x36')]));if(_0x344431[_0x1b69('0x35')]['filter']){_0xb7ff51[_0x1b69('0x3f')]=_['merge'](_0xb7ff51[_0x1b69('0x3f')],{'$or':_[_0x1b69('0x2e')](_0xb7ff51[_0x1b69('0x39')],function(_0x144cd2){var _0x56bc65={};_0x56bc65[_0x144cd2]={'$like':'%'+_0x344431['query'][_0x1b69('0x41')]+'%'};return _0x56bc65;})});}_0xb7ff51=_[_0x1b69('0x42')]({},_0xb7ff51,_0x344431['options']);return _0x252a7c[_0x1b69('0x53')](_0xb7ff51);}})[_0x1b69('0x27')](function(_0x1d3bf7){if(_0x1d3bf7){_0x50a670=_0x1d3bf7[_0x1b69('0x3a')];if(!_0x344431[_0x1b69('0x35')][_0x1b69('0x3b')](_0x1b69('0x3c'))){_0xb7ff51[_0x1b69('0x20')]=qs[_0x1b69('0x20')](_0x344431[_0x1b69('0x35')][_0x1b69('0x20')]);_0xb7ff51['offset']=qs[_0x1b69('0x1e')](_0x344431[_0x1b69('0x35')][_0x1b69('0x1e')]);}return _0x252a7c[_0x1b69('0x53')](_0xb7ff51);}})['then'](function(_0x490423){if(_0x490423){return _0x490423?{'count':_0x50a670,'rows':_0x490423}:null;}})[_0x1b69('0x27')](respondWithResult(_0x36e198,null))[_0x1b69('0x4a')](handleError(_0x36e198,null));};exports['getTags']=function(_0x1a5744,_0x2c5cee,_0x18da54){var _0x330a5c={};var _0x36f1a9={};var _0x1adbe7;var _0x425387;return db[_0x1b69('0x2f')][_0x1b69('0x50')]({'where':{'id':_0x1a5744[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x2c5cee,null))['then'](function(_0x3d7306){if(_0x3d7306){_0x1adbe7=_0x3d7306;_0x36f1a9[_0x1b69('0x33')]=_[_0x1b69('0x34')](db[_0x1b69('0x54')][_0x1b69('0x30')]);_0x36f1a9[_0x1b69('0x35')]=_[_0x1b69('0x34')](_0x1a5744[_0x1b69('0x35')]);_0x36f1a9[_0x1b69('0x36')]=_[_0x1b69('0x37')](_0x36f1a9[_0x1b69('0x33')],_0x36f1a9['query']);_0x330a5c[_0x1b69('0x39')]=_[_0x1b69('0x37')](_0x36f1a9['model'],qs[_0x1b69('0x38')](_0x1a5744['query'][_0x1b69('0x38')]));_0x330a5c[_0x1b69('0x39')]=_0x330a5c[_0x1b69('0x39')]['length']?_0x330a5c[_0x1b69('0x39')]:_0x36f1a9['model'];_0x330a5c[_0x1b69('0x3d')]=qs['sort'](_0x1a5744[_0x1b69('0x35')][_0x1b69('0x3e')]);_0x330a5c[_0x1b69('0x3f')]=qs[_0x1b69('0x36')](_[_0x1b69('0x40')](_0x1a5744['query'],_0x36f1a9['filters']));if(_0x1a5744['query'][_0x1b69('0x41')]){_0x330a5c[_0x1b69('0x3f')]=_[_0x1b69('0x42')](_0x330a5c[_0x1b69('0x3f')],{'$or':_[_0x1b69('0x2e')](_0x330a5c[_0x1b69('0x39')],function(_0x452a96){var _0x4fa165={};_0x4fa165[_0x452a96]={'$like':'%'+_0x1a5744[_0x1b69('0x35')][_0x1b69('0x41')]+'%'};return _0x4fa165;})});}_0x330a5c=_[_0x1b69('0x42')]({},_0x330a5c,_0x1a5744['options']);return _0x1adbe7[_0x1b69('0x55')](_0x330a5c);}})[_0x1b69('0x27')](function(_0xd7f499){if(_0xd7f499){_0x425387=_0xd7f499[_0x1b69('0x3a')];if(!_0x1a5744['query'][_0x1b69('0x3b')](_0x1b69('0x3c'))){_0x330a5c['limit']=qs['limit'](_0x1a5744[_0x1b69('0x35')][_0x1b69('0x20')]);_0x330a5c[_0x1b69('0x1e')]=qs[_0x1b69('0x1e')](_0x1a5744['query'][_0x1b69('0x1e')]);}return _0x1adbe7['getTags'](_0x330a5c);}})[_0x1b69('0x27')](function(_0x5e9ee6){if(_0x5e9ee6){return _0x5e9ee6?{'count':_0x425387,'rows':_0x5e9ee6}:null;}})[_0x1b69('0x27')](respondWithResult(_0x2c5cee,null))[_0x1b69('0x4a')](handleError(_0x2c5cee,null));};exports['setTags']=function(_0x5ebafd,_0x1d8ace,_0x69cd21){if(_0x5ebafd['body']['id']){delete _0x5ebafd[_0x1b69('0x4c')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5ebafd[_0x1b69('0x48')]['id']}})[_0x1b69('0x27')](handleEntityNotFound(_0x1d8ace,null))[_0x1b69('0x27')](function(_0x12b614){if(_0x12b614){return _0x12b614['setTags'](_0x5ebafd['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x1d8ace,null))[_0x1b69('0x4a')](handleError(_0x1d8ace,null));}; \ No newline at end of file +var _0x4676=['status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','merge','where','options','include','rows','show','rawAttributes','includeAll','find','catch','create','body','params','getFields','findOne','FreshdeskField','order','nolimit','getSubjects','getDescriptions','getTags','Tag','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0xb77378,_0x229c6e){var _0x217b8a=function(_0x45f1eb){while(--_0x45f1eb){_0xb77378['push'](_0xb77378['shift']());}};_0x217b8a(++_0x229c6e);}(_0x4676,0x178));var _0x6467=function(_0x43315b,_0x850bcc){_0x43315b=_0x43315b-0x0;var _0xd35da0=_0x4676[_0x43315b];return _0xd35da0;};'use strict';var emlformat=require(_0x6467('0x0'));var rimraf=require(_0x6467('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6467('0x2'));var rp=require('request-promise');var moment=require(_0x6467('0x3'));var BPromise=require(_0x6467('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6467('0x5'));var sox=require(_0x6467('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6467('0x7'));var _=require(_0x6467('0x8'));var squel=require(_0x6467('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6467('0xa'));var toCsv=require(_0x6467('0xb'));var querystring=require(_0x6467('0xc'));var Papa=require(_0x6467('0xd'));var Redis=require('ioredis');var authService=require(_0x6467('0xe'));var qs=require(_0x6467('0xf'));var as=require(_0x6467('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6467('0x11'));var utils=require(_0x6467('0x12'));var config=require(_0x6467('0x13'));var licenseUtil=require(_0x6467('0x14'));var db=require(_0x6467('0x15'))['db'];function respondWithStatusCode(_0x21883c,_0x255b80){_0x255b80=_0x255b80||0xcc;return function(_0x3ab212){if(_0x3ab212){return _0x21883c[_0x6467('0x16')](_0x255b80);}return _0x21883c['status'](_0x255b80)[_0x6467('0x17')]();};}function respondWithResult(_0x23067e,_0x3dec61){_0x3dec61=_0x3dec61||0xc8;return function(_0xe2e198){if(_0xe2e198){return _0x23067e[_0x6467('0x18')](_0x3dec61)[_0x6467('0x19')](_0xe2e198);}};}function respondWithFilteredResult(_0x3b04fc,_0x5afa42){return function(_0x391004){if(_0x391004){var _0xf3db19=typeof _0x5afa42[_0x6467('0x1a')]===_0x6467('0x1b')&&typeof _0x5afa42['limit']===_0x6467('0x1b');var _0xafa75e=_0x391004[_0x6467('0x1c')];var _0x1c4394=_0xf3db19?0x0:_0x5afa42[_0x6467('0x1a')];var _0x3e4969=_0xf3db19?_0x391004['count']:_0x5afa42['offset']+_0x5afa42[_0x6467('0x1d')];var _0x47f988;if(_0x3e4969>=_0xafa75e){_0x3e4969=_0xafa75e;_0x47f988=0xc8;}else{_0x47f988=0xce;}_0x3b04fc[_0x6467('0x18')](_0x47f988);return _0x3b04fc[_0x6467('0x1e')](_0x6467('0x1f'),_0x1c4394+'-'+_0x3e4969+'/'+_0xafa75e)[_0x6467('0x19')](_0x391004);}return null;};}function patchUpdates(_0x3795b1){return function(_0x2a87aa){try{jsonpatch[_0x6467('0x20')](_0x2a87aa,_0x3795b1,!![]);}catch(_0x42daad){return BPromise['reject'](_0x42daad);}return _0x2a87aa[_0x6467('0x21')]();};}function saveUpdates(_0x44b05a,_0x595a41){return function(_0x5ed389){if(_0x5ed389){return _0x5ed389[_0x6467('0x22')](_0x44b05a)[_0x6467('0x23')](function(_0x1bc26b){return _0x1bc26b;});}return null;};}function removeEntity(_0x5db138,_0x5d7207){return function(_0x49cbae){if(_0x49cbae){return _0x49cbae[_0x6467('0x24')]()[_0x6467('0x23')](function(){_0x5db138['status'](0xcc)[_0x6467('0x17')]();});}};}function handleEntityNotFound(_0x301e32,_0x3f02ad){return function(_0x1d1268){if(!_0x1d1268){_0x301e32[_0x6467('0x16')](0x194);}return _0x1d1268;};}function handleError(_0x5315f6,_0x3321ab){_0x3321ab=_0x3321ab||0x1f4;return function(_0x443940){logger[_0x6467('0x25')](_0x443940[_0x6467('0x26')]);if(_0x443940['name']){delete _0x443940[_0x6467('0x27')];}_0x5315f6[_0x6467('0x18')](_0x3321ab)[_0x6467('0x28')](_0x443940);};}exports[_0x6467('0x29')]=function(_0x2d29da,_0x5d9527){var _0x44a7ea={},_0x572dbb={},_0x576e46={'count':0x0,'rows':[]};var _0x481c54=_[_0x6467('0x2a')](db[_0x6467('0x2b')]['rawAttributes'],function(_0x18fdcd){return{'name':_0x18fdcd[_0x6467('0x2c')],'type':_0x18fdcd['type'][_0x6467('0x2d')]};});_0x572dbb[_0x6467('0x2e')]=_['map'](_0x481c54,_0x6467('0x27'));_0x572dbb[_0x6467('0x2f')]=_[_0x6467('0x30')](_0x2d29da[_0x6467('0x2f')]);_0x572dbb['filters']=_[_0x6467('0x31')](_0x572dbb[_0x6467('0x2e')],_0x572dbb[_0x6467('0x2f')]);_0x44a7ea[_0x6467('0x32')]=_[_0x6467('0x31')](_0x572dbb[_0x6467('0x2e')],qs[_0x6467('0x33')](_0x2d29da['query'][_0x6467('0x33')]));_0x44a7ea[_0x6467('0x32')]=_0x44a7ea[_0x6467('0x32')][_0x6467('0x34')]?_0x44a7ea[_0x6467('0x32')]:_0x572dbb[_0x6467('0x2e')];if(!_0x2d29da['query'][_0x6467('0x35')]('nolimit')){_0x44a7ea[_0x6467('0x1d')]=qs[_0x6467('0x1d')](_0x2d29da['query'][_0x6467('0x1d')]);_0x44a7ea[_0x6467('0x1a')]=qs['offset'](_0x2d29da[_0x6467('0x2f')][_0x6467('0x1a')]);}_0x44a7ea['order']=qs[_0x6467('0x36')](_0x2d29da[_0x6467('0x2f')][_0x6467('0x36')]);_0x44a7ea['where']=qs[_0x6467('0x37')](_[_0x6467('0x38')](_0x2d29da[_0x6467('0x2f')],_0x572dbb[_0x6467('0x37')]),_0x481c54);if(_0x2d29da['query'][_0x6467('0x39')]){_0x44a7ea['where']=_[_0x6467('0x3a')](_0x44a7ea[_0x6467('0x3b')],{'$or':_[_0x6467('0x2a')](_0x481c54,function(_0x2e9bc8){if(_0x2e9bc8['type']!=='VIRTUAL'){var _0x137aff={};_0x137aff[_0x2e9bc8[_0x6467('0x27')]]={'$like':'%'+_0x2d29da[_0x6467('0x2f')]['filter']+'%'};return _0x137aff;}})});}_0x44a7ea=_[_0x6467('0x3a')]({},_0x44a7ea,_0x2d29da[_0x6467('0x3c')]);var _0x42e786={'where':_0x44a7ea[_0x6467('0x3b')]};return db[_0x6467('0x2b')][_0x6467('0x1c')](_0x42e786)['then'](function(_0x4d3a30){_0x576e46['count']=_0x4d3a30;if(_0x2d29da['query']['includeAll']){_0x44a7ea[_0x6467('0x3d')]=[{'all':!![]}];}return db['FreshdeskConfiguration']['findAll'](_0x44a7ea);})['then'](function(_0x20addb){_0x576e46[_0x6467('0x3e')]=_0x20addb;return _0x576e46;})[_0x6467('0x23')](respondWithFilteredResult(_0x5d9527,_0x44a7ea))['catch'](handleError(_0x5d9527,null));};exports[_0x6467('0x3f')]=function(_0x4ffc09,_0x444815){var _0x40a260={'raw':![],'where':{'id':_0x4ffc09['params']['id']}},_0x55453c={};_0x55453c[_0x6467('0x2e')]=_[_0x6467('0x30')](db[_0x6467('0x2b')][_0x6467('0x40')]);_0x55453c[_0x6467('0x2f')]=_['keys'](_0x4ffc09[_0x6467('0x2f')]);_0x55453c[_0x6467('0x37')]=_[_0x6467('0x31')](_0x55453c[_0x6467('0x2e')],_0x55453c[_0x6467('0x2f')]);_0x40a260['attributes']=_[_0x6467('0x31')](_0x55453c[_0x6467('0x2e')],qs[_0x6467('0x33')](_0x4ffc09[_0x6467('0x2f')][_0x6467('0x33')]));_0x40a260[_0x6467('0x32')]=_0x40a260[_0x6467('0x32')][_0x6467('0x34')]?_0x40a260[_0x6467('0x32')]:_0x55453c[_0x6467('0x2e')];if(_0x4ffc09[_0x6467('0x2f')][_0x6467('0x41')]){_0x40a260[_0x6467('0x3d')]=[{'all':!![]}];}_0x40a260=_[_0x6467('0x3a')]({},_0x40a260,_0x4ffc09['options']);return db[_0x6467('0x2b')][_0x6467('0x42')](_0x40a260)[_0x6467('0x23')](handleEntityNotFound(_0x444815,null))['then'](respondWithResult(_0x444815,null))[_0x6467('0x43')](handleError(_0x444815,null));};exports['create']=function(_0x2930b9,_0x52ddfc){return db[_0x6467('0x2b')][_0x6467('0x44')](_0x2930b9[_0x6467('0x45')],{})[_0x6467('0x23')](respondWithResult(_0x52ddfc,0xc9))[_0x6467('0x43')](handleError(_0x52ddfc,null));};exports[_0x6467('0x22')]=function(_0x36c93f,_0x31a5ab){if(_0x36c93f['body']['id']){delete _0x36c93f[_0x6467('0x45')]['id'];}return db['FreshdeskConfiguration']['find']({'where':{'id':_0x36c93f[_0x6467('0x46')]['id']}})[_0x6467('0x23')](handleEntityNotFound(_0x31a5ab,null))[_0x6467('0x23')](saveUpdates(_0x36c93f[_0x6467('0x45')],null))[_0x6467('0x23')](respondWithResult(_0x31a5ab,null))[_0x6467('0x43')](handleError(_0x31a5ab,null));};exports[_0x6467('0x24')]=function(_0x4890da,_0x345c42){return db[_0x6467('0x2b')][_0x6467('0x42')]({'where':{'id':_0x4890da[_0x6467('0x46')]['id']}})[_0x6467('0x23')](handleEntityNotFound(_0x345c42,null))[_0x6467('0x23')](removeEntity(_0x345c42,null))[_0x6467('0x43')](handleError(_0x345c42,null));};exports[_0x6467('0x47')]=function(_0x75ebea,_0x5e8c9f,_0x52d3fe){var _0x1b90c5={};var _0x1de622={};var _0x112ec4;var _0x79265c;return db['FreshdeskConfiguration'][_0x6467('0x48')]({'where':{'id':_0x75ebea[_0x6467('0x46')]['id']}})[_0x6467('0x23')](handleEntityNotFound(_0x5e8c9f,null))[_0x6467('0x23')](function(_0x311910){if(_0x311910){_0x112ec4=_0x311910;_0x1de622[_0x6467('0x2e')]=_['keys'](db[_0x6467('0x49')]['rawAttributes']);_0x1de622[_0x6467('0x2f')]=_[_0x6467('0x30')](_0x75ebea['query']);_0x1de622[_0x6467('0x37')]=_['intersection'](_0x1de622[_0x6467('0x2e')],_0x1de622['query']);_0x1b90c5[_0x6467('0x32')]=_[_0x6467('0x31')](_0x1de622[_0x6467('0x2e')],qs[_0x6467('0x33')](_0x75ebea[_0x6467('0x2f')][_0x6467('0x33')]));_0x1b90c5[_0x6467('0x32')]=_0x1b90c5[_0x6467('0x32')][_0x6467('0x34')]?_0x1b90c5[_0x6467('0x32')]:_0x1de622['model'];_0x1b90c5[_0x6467('0x4a')]=qs[_0x6467('0x36')](_0x75ebea[_0x6467('0x2f')][_0x6467('0x36')]);_0x1b90c5[_0x6467('0x3b')]=qs['filters'](_[_0x6467('0x38')](_0x75ebea[_0x6467('0x2f')],_0x1de622[_0x6467('0x37')]));if(_0x75ebea[_0x6467('0x2f')][_0x6467('0x39')]){_0x1b90c5[_0x6467('0x3b')]=_['merge'](_0x1b90c5['where'],{'$or':_[_0x6467('0x2a')](_0x1b90c5[_0x6467('0x32')],function(_0x5d7c71){var _0x5cd27b={};_0x5cd27b[_0x5d7c71]={'$like':'%'+_0x75ebea[_0x6467('0x2f')][_0x6467('0x39')]+'%'};return _0x5cd27b;})});}_0x1b90c5=_['merge']({},_0x1b90c5,_0x75ebea[_0x6467('0x3c')]);return _0x112ec4[_0x6467('0x47')](_0x1b90c5);}})[_0x6467('0x23')](function(_0x5509a7){if(_0x5509a7){_0x79265c=_0x5509a7[_0x6467('0x34')];if(!_0x75ebea[_0x6467('0x2f')][_0x6467('0x35')](_0x6467('0x4b'))){_0x1b90c5['limit']=qs[_0x6467('0x1d')](_0x75ebea['query'][_0x6467('0x1d')]);_0x1b90c5[_0x6467('0x1a')]=qs[_0x6467('0x1a')](_0x75ebea[_0x6467('0x2f')][_0x6467('0x1a')]);}return _0x112ec4[_0x6467('0x47')](_0x1b90c5);}})[_0x6467('0x23')](function(_0x52b4eb){if(_0x52b4eb){return _0x52b4eb?{'count':_0x79265c,'rows':_0x52b4eb}:null;}})[_0x6467('0x23')](respondWithResult(_0x5e8c9f,null))[_0x6467('0x43')](handleError(_0x5e8c9f,null));};exports[_0x6467('0x4c')]=function(_0x144331,_0x3039ad,_0x4c2c51){var _0x723dbd={};var _0x2144b7={};var _0x139c17;var _0x1ec9dc;return db[_0x6467('0x2b')][_0x6467('0x48')]({'where':{'id':_0x144331['params']['id']}})[_0x6467('0x23')](handleEntityNotFound(_0x3039ad,null))[_0x6467('0x23')](function(_0x3f3ff0){if(_0x3f3ff0){_0x139c17=_0x3f3ff0;_0x2144b7[_0x6467('0x2e')]=_[_0x6467('0x30')](db['FreshdeskField']['rawAttributes']);_0x2144b7[_0x6467('0x2f')]=_['keys'](_0x144331[_0x6467('0x2f')]);_0x2144b7[_0x6467('0x37')]=_[_0x6467('0x31')](_0x2144b7[_0x6467('0x2e')],_0x2144b7[_0x6467('0x2f')]);_0x723dbd[_0x6467('0x32')]=_[_0x6467('0x31')](_0x2144b7[_0x6467('0x2e')],qs['fields'](_0x144331['query'][_0x6467('0x33')]));_0x723dbd[_0x6467('0x32')]=_0x723dbd['attributes']['length']?_0x723dbd[_0x6467('0x32')]:_0x2144b7['model'];_0x723dbd[_0x6467('0x4a')]=qs['sort'](_0x144331['query'][_0x6467('0x36')]);_0x723dbd['where']=qs['filters'](_[_0x6467('0x38')](_0x144331[_0x6467('0x2f')],_0x2144b7[_0x6467('0x37')]));if(_0x144331[_0x6467('0x2f')][_0x6467('0x39')]){_0x723dbd[_0x6467('0x3b')]=_['merge'](_0x723dbd[_0x6467('0x3b')],{'$or':_[_0x6467('0x2a')](_0x723dbd[_0x6467('0x32')],function(_0x4cba2f){var _0x24f9a5={};_0x24f9a5[_0x4cba2f]={'$like':'%'+_0x144331[_0x6467('0x2f')]['filter']+'%'};return _0x24f9a5;})});}_0x723dbd=_['merge']({},_0x723dbd,_0x144331[_0x6467('0x3c')]);return _0x139c17[_0x6467('0x4c')](_0x723dbd);}})[_0x6467('0x23')](function(_0x543711){if(_0x543711){_0x1ec9dc=_0x543711[_0x6467('0x34')];if(!_0x144331['query'][_0x6467('0x35')](_0x6467('0x4b'))){_0x723dbd['limit']=qs['limit'](_0x144331['query']['limit']);_0x723dbd[_0x6467('0x1a')]=qs[_0x6467('0x1a')](_0x144331[_0x6467('0x2f')]['offset']);}return _0x139c17[_0x6467('0x4c')](_0x723dbd);}})[_0x6467('0x23')](function(_0x1ff47c){if(_0x1ff47c){return _0x1ff47c?{'count':_0x1ec9dc,'rows':_0x1ff47c}:null;}})[_0x6467('0x23')](respondWithResult(_0x3039ad,null))[_0x6467('0x43')](handleError(_0x3039ad,null));};exports[_0x6467('0x4d')]=function(_0x5f0333,_0x805cf0,_0x4ec0da){var _0x1fe1e7={};var _0x17b38f={};var _0x419def;var _0x40a17e;return db[_0x6467('0x2b')][_0x6467('0x48')]({'where':{'id':_0x5f0333['params']['id']}})['then'](handleEntityNotFound(_0x805cf0,null))[_0x6467('0x23')](function(_0x5ce260){if(_0x5ce260){_0x419def=_0x5ce260;_0x17b38f[_0x6467('0x2e')]=_[_0x6467('0x30')](db[_0x6467('0x49')][_0x6467('0x40')]);_0x17b38f['query']=_[_0x6467('0x30')](_0x5f0333[_0x6467('0x2f')]);_0x17b38f[_0x6467('0x37')]=_[_0x6467('0x31')](_0x17b38f[_0x6467('0x2e')],_0x17b38f[_0x6467('0x2f')]);_0x1fe1e7[_0x6467('0x32')]=_['intersection'](_0x17b38f['model'],qs[_0x6467('0x33')](_0x5f0333['query'][_0x6467('0x33')]));_0x1fe1e7[_0x6467('0x32')]=_0x1fe1e7['attributes'][_0x6467('0x34')]?_0x1fe1e7[_0x6467('0x32')]:_0x17b38f[_0x6467('0x2e')];_0x1fe1e7[_0x6467('0x4a')]=qs[_0x6467('0x36')](_0x5f0333['query'][_0x6467('0x36')]);_0x1fe1e7[_0x6467('0x3b')]=qs['filters'](_[_0x6467('0x38')](_0x5f0333['query'],_0x17b38f[_0x6467('0x37')]));if(_0x5f0333[_0x6467('0x2f')]['filter']){_0x1fe1e7[_0x6467('0x3b')]=_[_0x6467('0x3a')](_0x1fe1e7['where'],{'$or':_['map'](_0x1fe1e7[_0x6467('0x32')],function(_0x387888){var _0x21688f={};_0x21688f[_0x387888]={'$like':'%'+_0x5f0333[_0x6467('0x2f')][_0x6467('0x39')]+'%'};return _0x21688f;})});}_0x1fe1e7=_[_0x6467('0x3a')]({},_0x1fe1e7,_0x5f0333['options']);return _0x419def[_0x6467('0x4d')](_0x1fe1e7);}})[_0x6467('0x23')](function(_0x49b743){if(_0x49b743){_0x40a17e=_0x49b743[_0x6467('0x34')];if(!_0x5f0333[_0x6467('0x2f')][_0x6467('0x35')](_0x6467('0x4b'))){_0x1fe1e7[_0x6467('0x1d')]=qs['limit'](_0x5f0333['query'][_0x6467('0x1d')]);_0x1fe1e7[_0x6467('0x1a')]=qs[_0x6467('0x1a')](_0x5f0333[_0x6467('0x2f')][_0x6467('0x1a')]);}return _0x419def[_0x6467('0x4d')](_0x1fe1e7);}})['then'](function(_0x4c15f8){if(_0x4c15f8){return _0x4c15f8?{'count':_0x40a17e,'rows':_0x4c15f8}:null;}})[_0x6467('0x23')](respondWithResult(_0x805cf0,null))['catch'](handleError(_0x805cf0,null));};exports[_0x6467('0x4e')]=function(_0x28b358,_0x2dc08a,_0x59eac2){var _0x58aa2f={};var _0x573dc5={};var _0x516de3;var _0x280b93;return db[_0x6467('0x2b')][_0x6467('0x48')]({'where':{'id':_0x28b358['params']['id']}})[_0x6467('0x23')](handleEntityNotFound(_0x2dc08a,null))['then'](function(_0xdc154){if(_0xdc154){_0x516de3=_0xdc154;_0x573dc5[_0x6467('0x2e')]=_['keys'](db[_0x6467('0x4f')][_0x6467('0x40')]);_0x573dc5[_0x6467('0x2f')]=_[_0x6467('0x30')](_0x28b358[_0x6467('0x2f')]);_0x573dc5[_0x6467('0x37')]=_[_0x6467('0x31')](_0x573dc5[_0x6467('0x2e')],_0x573dc5[_0x6467('0x2f')]);_0x58aa2f[_0x6467('0x32')]=_[_0x6467('0x31')](_0x573dc5[_0x6467('0x2e')],qs[_0x6467('0x33')](_0x28b358[_0x6467('0x2f')][_0x6467('0x33')]));_0x58aa2f['attributes']=_0x58aa2f[_0x6467('0x32')][_0x6467('0x34')]?_0x58aa2f[_0x6467('0x32')]:_0x573dc5[_0x6467('0x2e')];_0x58aa2f[_0x6467('0x4a')]=qs[_0x6467('0x36')](_0x28b358[_0x6467('0x2f')][_0x6467('0x36')]);_0x58aa2f['where']=qs[_0x6467('0x37')](_[_0x6467('0x38')](_0x28b358[_0x6467('0x2f')],_0x573dc5[_0x6467('0x37')]));if(_0x28b358['query'][_0x6467('0x39')]){_0x58aa2f[_0x6467('0x3b')]=_[_0x6467('0x3a')](_0x58aa2f['where'],{'$or':_[_0x6467('0x2a')](_0x58aa2f['attributes'],function(_0x403b39){var _0x571bf9={};_0x571bf9[_0x403b39]={'$like':'%'+_0x28b358[_0x6467('0x2f')][_0x6467('0x39')]+'%'};return _0x571bf9;})});}_0x58aa2f=_[_0x6467('0x3a')]({},_0x58aa2f,_0x28b358[_0x6467('0x3c')]);return _0x516de3['getTags'](_0x58aa2f);}})['then'](function(_0x35fc0c){if(_0x35fc0c){_0x280b93=_0x35fc0c[_0x6467('0x34')];if(!_0x28b358['query'][_0x6467('0x35')](_0x6467('0x4b'))){_0x58aa2f[_0x6467('0x1d')]=qs['limit'](_0x28b358[_0x6467('0x2f')][_0x6467('0x1d')]);_0x58aa2f[_0x6467('0x1a')]=qs[_0x6467('0x1a')](_0x28b358[_0x6467('0x2f')][_0x6467('0x1a')]);}return _0x516de3[_0x6467('0x4e')](_0x58aa2f);}})[_0x6467('0x23')](function(_0x36cdc2){if(_0x36cdc2){return _0x36cdc2?{'count':_0x280b93,'rows':_0x36cdc2}:null;}})[_0x6467('0x23')](respondWithResult(_0x2dc08a,null))['catch'](handleError(_0x2dc08a,null));};exports['setTags']=function(_0x164583,_0x795501,_0x3313b4){if(_0x164583[_0x6467('0x45')]['id']){delete _0x164583[_0x6467('0x45')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x164583['params']['id']}})['then'](handleEntityNotFound(_0x795501,null))[_0x6467('0x23')](function(_0x45aed5){if(_0x45aed5){return _0x45aed5['setTags'](_0x164583[_0x6467('0x45')]['ids']||[]);}return null;})[_0x6467('0x23')](respondWithResult(_0x795501,null))[_0x6467('0x43')](handleError(_0x795501,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 13f73c5..eed7c6d 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 _0x80b1=['api','moment','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations'];(function(_0x4e9220,_0x3f7b5e){var _0x309f8a=function(_0x1d75a4){while(--_0x1d75a4){_0x4e9220['push'](_0x4e9220['shift']());}};_0x309f8a(++_0x3f7b5e);}(_0x80b1,0x12d));var _0x180b=function(_0x50368e,_0x466c09){_0x50368e=_0x50368e-0x0;var _0x4a65cd=_0x80b1[_0x50368e];return _0x4a65cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x180b('0x0'));var moment=require(_0x180b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x180b('0x2'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x180b('0x3')]=function(_0xd67dee,_0x5dc67d){return _0xd67dee[_0x180b('0x4')](_0x180b('0x5'),attributes,{'tableName':_0x180b('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x32d5=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','moment'];(function(_0x2fbce5,_0x1a2b71){var _0x185ced=function(_0x42485b){while(--_0x42485b){_0x2fbce5['push'](_0x2fbce5['shift']());}};_0x185ced(++_0x1a2b71);}(_0x32d5,0xc9));var _0x532d=function(_0x50c9e2,_0xb11729){_0x50c9e2=_0x50c9e2-0x0;var _0x4d16f8=_0x32d5[_0x50c9e2];return _0x4d16f8;};'use strict';var _=require('lodash');var util=require(_0x532d('0x0'));var logger=require(_0x532d('0x1'))('api');var moment=require(_0x532d('0x2'));var BPromise=require(_0x532d('0x3'));var rp=require(_0x532d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x532d('0x5'));var config=require(_0x532d('0x6'));var attributes=require(_0x532d('0x7'));module[_0x532d('0x8')]=function(_0x4ef52d,_0x28563a){return _0x4ef52d[_0x532d('0x9')](_0x532d('0xa'),attributes,{'tableName':_0x532d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 5675c9e..e0fa4a8 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 _0x6c10=['error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c10,0x1a8));var _0x06c1=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0x6c10[_0x38c699];return _0x3b1ded;};'use strict';var _=require(_0x06c1('0x0'));var util=require(_0x06c1('0x1'));var moment=require(_0x06c1('0x2'));var BPromise=require('bluebird');var rs=require(_0x06c1('0x3'));var fs=require('fs');var Redis=require(_0x06c1('0x4'));var db=require(_0x06c1('0x5'))['db'];var utils=require(_0x06c1('0x6'));var logger=require(_0x06c1('0x7'))(_0x06c1('0x8'));var config=require(_0x06c1('0x9'));var jayson=require(_0x06c1('0xa'));var client=jayson['client'][_0x06c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59cee3,_0x1e9275,_0x24e8ba){return new BPromise(function(_0x5a555f,_0x41f94f){return client[_0x06c1('0xc')](_0x59cee3,_0x24e8ba)['then'](function(_0x3951c4){logger['info'](_0x06c1('0xd'),_0x1e9275,'request\x20sent');logger[_0x06c1('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1e9275,_0x06c1('0xf'),JSON['stringify'](_0x3951c4));if(_0x3951c4['error']){if(_0x3951c4[_0x06c1('0x10')][_0x06c1('0x11')]===0x1f4){logger[_0x06c1('0x10')](_0x06c1('0xd'),_0x1e9275,_0x3951c4[_0x06c1('0x10')]['message']);return _0x41f94f(_0x3951c4[_0x06c1('0x10')][_0x06c1('0x12')]);}logger[_0x06c1('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x1e9275,_0x3951c4['error'][_0x06c1('0x12')]);return _0x5a555f(_0x3951c4[_0x06c1('0x10')][_0x06c1('0x12')]);}else{logger[_0x06c1('0x13')](_0x06c1('0xd'),_0x1e9275,_0x06c1('0xf'));_0x5a555f(_0x3951c4[_0x06c1('0x14')][_0x06c1('0x12')]);}})[_0x06c1('0x15')](function(_0x300da7){logger[_0x06c1('0x10')](_0x06c1('0xd'),_0x1e9275,_0x300da7);_0x41f94f(_0x300da7);});});} \ No newline at end of file +var _0x8aa2=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x5f4327,_0x31a825){var _0x1e12f6=function(_0x2bba54){while(--_0x2bba54){_0x5f4327['push'](_0x5f4327['shift']());}};_0x1e12f6(++_0x31a825);}(_0x8aa2,0x1bb));var _0x28aa=function(_0x2d6b7d,_0x43b595){_0x2d6b7d=_0x2d6b7d-0x0;var _0x2ec0d2=_0x8aa2[_0x2d6b7d];return _0x2ec0d2;};'use strict';var _=require(_0x28aa('0x0'));var util=require(_0x28aa('0x1'));var moment=require(_0x28aa('0x2'));var BPromise=require(_0x28aa('0x3'));var rs=require(_0x28aa('0x4'));var fs=require('fs');var Redis=require(_0x28aa('0x5'));var db=require(_0x28aa('0x6'))['db'];var utils=require(_0x28aa('0x7'));var logger=require(_0x28aa('0x8'))(_0x28aa('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d666c,_0xab8214,_0x2bf8bb){return new BPromise(function(_0x5524a9,_0x20db97){return client[_0x28aa('0xa')](_0x4d666c,_0x2bf8bb)['then'](function(_0x16974c){logger[_0x28aa('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xab8214,_0x28aa('0xc'));logger[_0x28aa('0xd')](_0x28aa('0xe'),_0xab8214,_0x28aa('0xc'),JSON[_0x28aa('0xf')](_0x16974c));if(_0x16974c[_0x28aa('0x10')]){if(_0x16974c[_0x28aa('0x10')][_0x28aa('0x11')]===0x1f4){logger[_0x28aa('0x10')](_0x28aa('0x12'),_0xab8214,_0x16974c[_0x28aa('0x10')][_0x28aa('0x13')]);return _0x20db97(_0x16974c[_0x28aa('0x10')][_0x28aa('0x13')]);}logger['error'](_0x28aa('0x12'),_0xab8214,_0x16974c[_0x28aa('0x10')][_0x28aa('0x13')]);return _0x5524a9(_0x16974c[_0x28aa('0x10')][_0x28aa('0x13')]);}else{logger[_0x28aa('0xb')](_0x28aa('0x12'),_0xab8214,_0x28aa('0xc'));_0x5524a9(_0x16974c[_0x28aa('0x14')]['message']);}})[_0x28aa('0x15')](function(_0x109bc9){logger[_0x28aa('0x10')](_0x28aa('0x12'),_0xab8214,_0x109bc9);_0x20db97(_0x109bc9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 7611017..0112201 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 _0x6f5a=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0x2541e2,_0x34c617){var _0xdd1281=function(_0xa0fca6){while(--_0xa0fca6){_0x2541e2['push'](_0x2541e2['shift']());}};_0xdd1281(++_0x34c617);}(_0x6f5a,0x1ed));var _0xa6f5=function(_0x5c127e,_0x31443d){_0x5c127e=_0x5c127e-0x0;var _0x907616=_0x6f5a[_0x5c127e];return _0x907616;};'use strict';var multer=require('multer');var util=require(_0xa6f5('0x0'));var path=require(_0xa6f5('0x1'));var timeout=require(_0xa6f5('0x2'));var express=require(_0xa6f5('0x3'));var router=express[_0xa6f5('0x4')]();var fs_extra=require(_0xa6f5('0x5'));var auth=require(_0xa6f5('0x6'));var interaction=require(_0xa6f5('0x7'));var config=require(_0xa6f5('0x8'));var controller=require(_0xa6f5('0x9'));router[_0xa6f5('0xa')]('/',auth[_0xa6f5('0xb')](),controller['index']);router[_0xa6f5('0xa')](_0xa6f5('0xc'),auth[_0xa6f5('0xb')](),controller[_0xa6f5('0xd')]);router[_0xa6f5('0xe')]('/',auth[_0xa6f5('0xb')](),controller[_0xa6f5('0xf')]);router[_0xa6f5('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa6f5('0x11')]);router[_0xa6f5('0x12')](_0xa6f5('0xc'),auth[_0xa6f5('0xb')](),controller[_0xa6f5('0x13')]);module[_0xa6f5('0x14')]=router; \ No newline at end of file +var _0x8cc1=['get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x26ddb3,_0x1e8676){var _0x227a81=function(_0x28de22){while(--_0x28de22){_0x26ddb3['push'](_0x26ddb3['shift']());}};_0x227a81(++_0x1e8676);}(_0x8cc1,0x160));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x18cc('0x0'));var util=require(_0x18cc('0x1'));var path=require(_0x18cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x18cc('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x18cc('0x4'));var interaction=require(_0x18cc('0x5'));var config=require(_0x18cc('0x6'));var controller=require(_0x18cc('0x7'));router[_0x18cc('0x8')]('/',auth['isAuthenticated'](),controller[_0x18cc('0x9')]);router[_0x18cc('0x8')](_0x18cc('0xa'),auth[_0x18cc('0xb')](),controller[_0x18cc('0xc')]);router[_0x18cc('0xd')]('/',auth['isAuthenticated'](),controller[_0x18cc('0xe')]);router[_0x18cc('0xf')](_0x18cc('0xa'),auth['isAuthenticated'](),controller[_0x18cc('0x10')]);router['delete']('/:id',auth[_0x18cc('0xb')](),controller['destroy']);module[_0x18cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 784135f..e5a0578 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 _0x45bb=['exports','customVariable','string','STRING','ENUM','variable','BOOLEAN'];(function(_0x221eef,_0x2d1200){var _0x207a2c=function(_0x289bf6){while(--_0x289bf6){_0x221eef['push'](_0x221eef['shift']());}};_0x207a2c(++_0x2d1200);}(_0x45bb,0x1dc));var _0xb45b=function(_0x2d3bf9,_0x2821ea){_0x2d3bf9=_0x2d3bf9-0x0;var _0x41f81c=_0x45bb[_0x2d3bf9];return _0x41f81c;};'use strict';var Sequelize=require('sequelize');module[_0xb45b('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0xb45b('0x1'),'keyValue','picklist'),'defaultValue':_0xb45b('0x2')},'content':{'type':Sequelize[_0xb45b('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb45b('0x4')](_0xb45b('0x2'),_0xb45b('0x5'),_0xb45b('0x1'))},'keyContent':{'type':Sequelize[_0xb45b('0x3')]},'idField':{'type':Sequelize[_0xb45b('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xb45b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb45b('0x3')]}}; \ No newline at end of file +var _0xd0bb=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0xd0bb,0x107));var _0xbd0b=function(_0x149de2,_0x5cbeec){_0x149de2=_0x149de2-0x0;var _0x59ffeb=_0xd0bb[_0x149de2];return _0x59ffeb;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xbd0b('0x1'),_0xbd0b('0x2'),_0xbd0b('0x3'),'keyValue',_0xbd0b('0x4')),'defaultValue':_0xbd0b('0x1')},'content':{'type':Sequelize[_0xbd0b('0x5')]},'key':{'type':Sequelize[_0xbd0b('0x5')]},'keyType':{'type':Sequelize[_0xbd0b('0x6')]('string',_0xbd0b('0x2'),_0xbd0b('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbd0b('0x5')]},'nameField':{'type':Sequelize[_0xbd0b('0x5')]},'customField':{'type':Sequelize[_0xbd0b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd0b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 23ad1e6..eda6b2f 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 _0x9c5e=['body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','keys','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x5da8e9,_0x3beb32){_0x5da8e9=_0x5da8e9-0x0;var _0x24a605=_0x9c5e[_0x5da8e9];return _0x24a605;};'use strict';var emlformat=require(_0xe9c5('0x0'));var rimraf=require(_0xe9c5('0x1'));var zipdir=require(_0xe9c5('0x2'));var jsonpatch=require(_0xe9c5('0x3'));var rp=require(_0xe9c5('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe9c5('0x5'));var path=require(_0xe9c5('0x6'));var sox=require('sox');var csv=require(_0xe9c5('0x7'));var ejs=require(_0xe9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xe9c5('0x9'));var _=require(_0xe9c5('0xa'));var squel=require('squel');var crypto=require(_0xe9c5('0xb'));var jsforce=require(_0xe9c5('0xc'));var deskjs=require(_0xe9c5('0xd'));var toCsv=require(_0xe9c5('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe9c5('0xe'));var authService=require(_0xe9c5('0xf'));var qs=require(_0xe9c5('0x10'));var as=require(_0xe9c5('0x11'));var hardwareService=require(_0xe9c5('0x12'));var logger=require(_0xe9c5('0x13'))(_0xe9c5('0x14'));var utils=require(_0xe9c5('0x15'));var config=require(_0xe9c5('0x16'));var licenseUtil=require(_0xe9c5('0x17'));var db=require(_0xe9c5('0x18'))['db'];function respondWithStatusCode(_0x27f3e1,_0x471401){_0x471401=_0x471401||0xcc;return function(_0x25ff11){if(_0x25ff11){return _0x27f3e1[_0xe9c5('0x19')](_0x471401);}return _0x27f3e1[_0xe9c5('0x1a')](_0x471401)['end']();};}function respondWithResult(_0x3cce36,_0xe98b11){_0xe98b11=_0xe98b11||0xc8;return function(_0x5eb474){if(_0x5eb474){return _0x3cce36[_0xe9c5('0x1a')](_0xe98b11)[_0xe9c5('0x1b')](_0x5eb474);}};}function respondWithFilteredResult(_0x232584,_0x5d8236){return function(_0x163253){if(_0x163253){var _0x14eb41=typeof _0x5d8236['offset']===_0xe9c5('0x1c')&&typeof _0x5d8236[_0xe9c5('0x1d')]===_0xe9c5('0x1c');var _0x154390=_0x163253[_0xe9c5('0x1e')];var _0x4d9c7d=_0x14eb41?0x0:_0x5d8236[_0xe9c5('0x1f')];var _0x1cecae=_0x14eb41?_0x163253[_0xe9c5('0x1e')]:_0x5d8236[_0xe9c5('0x1f')]+_0x5d8236['limit'];var _0x26492a;if(_0x1cecae>=_0x154390){_0x1cecae=_0x154390;_0x26492a=0xc8;}else{_0x26492a=0xce;}_0x232584[_0xe9c5('0x1a')](_0x26492a);return _0x232584[_0xe9c5('0x20')](_0xe9c5('0x21'),_0x4d9c7d+'-'+_0x1cecae+'/'+_0x154390)[_0xe9c5('0x1b')](_0x163253);}return null;};}function patchUpdates(_0x58fbad){return function(_0x51e860){try{jsonpatch[_0xe9c5('0x22')](_0x51e860,_0x58fbad,!![]);}catch(_0x57818d){return BPromise[_0xe9c5('0x23')](_0x57818d);}return _0x51e860[_0xe9c5('0x24')]();};}function saveUpdates(_0x21b02a,_0x4d16bc){return function(_0x5750ff){if(_0x5750ff){return _0x5750ff[_0xe9c5('0x25')](_0x21b02a)[_0xe9c5('0x26')](function(_0x37fb90){return _0x37fb90;});}return null;};}function removeEntity(_0x189a13,_0x34a7c8){return function(_0x245161){if(_0x245161){return _0x245161[_0xe9c5('0x27')]()[_0xe9c5('0x26')](function(){_0x189a13[_0xe9c5('0x1a')](0xcc)[_0xe9c5('0x28')]();});}};}function handleEntityNotFound(_0x5a3caa,_0x5c8bb7){return function(_0x250e1c){if(!_0x250e1c){_0x5a3caa[_0xe9c5('0x19')](0x194);}return _0x250e1c;};}function handleError(_0x298dca,_0x3bf679){_0x3bf679=_0x3bf679||0x1f4;return function(_0x33fe71){logger[_0xe9c5('0x29')](_0x33fe71['stack']);if(_0x33fe71[_0xe9c5('0x2a')]){delete _0x33fe71['name'];}_0x298dca[_0xe9c5('0x1a')](_0x3bf679)['send'](_0x33fe71);};}exports[_0xe9c5('0x2b')]=function(_0x2112a6,_0x52d008){var _0x36d145={},_0x46d253={},_0x334f5a={'count':0x0,'rows':[]};var _0x37cfa5=_[_0xe9c5('0x2c')](db['FreshdeskField'][_0xe9c5('0x2d')],function(_0x4fcabd){return{'name':_0x4fcabd[_0xe9c5('0x2e')],'type':_0x4fcabd['type'][_0xe9c5('0x2f')]};});_0x46d253[_0xe9c5('0x30')]=_[_0xe9c5('0x2c')](_0x37cfa5,_0xe9c5('0x2a'));_0x46d253[_0xe9c5('0x31')]=_['keys'](_0x2112a6[_0xe9c5('0x31')]);_0x46d253[_0xe9c5('0x32')]=_[_0xe9c5('0x33')](_0x46d253[_0xe9c5('0x30')],_0x46d253[_0xe9c5('0x31')]);_0x36d145['attributes']=_['intersection'](_0x46d253[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x36d145[_0xe9c5('0x35')]=_0x36d145[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x36d145[_0xe9c5('0x35')]:_0x46d253['model'];if(!_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x37')]('nolimit')){_0x36d145[_0xe9c5('0x1d')]=qs['limit'](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1d')]);_0x36d145[_0xe9c5('0x1f')]=qs[_0xe9c5('0x1f')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x1f')]);}_0x36d145[_0xe9c5('0x38')]=qs[_0xe9c5('0x39')](_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x39')]);_0x36d145[_0xe9c5('0x3a')]=qs[_0xe9c5('0x32')](_[_0xe9c5('0x3b')](_0x2112a6[_0xe9c5('0x31')],_0x46d253[_0xe9c5('0x32')]),_0x37cfa5);if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x3c')]){_0x36d145[_0xe9c5('0x3a')]=_[_0xe9c5('0x3d')](_0x36d145['where'],{'$or':_[_0xe9c5('0x2c')](_0x37cfa5,function(_0x2e3f15){if(_0x2e3f15[_0xe9c5('0x3e')]!==_0xe9c5('0x3f')){var _0x204b53={};_0x204b53[_0x2e3f15[_0xe9c5('0x2a')]]={'$like':'%'+_0x2112a6['query'][_0xe9c5('0x3c')]+'%'};return _0x204b53;}})});}_0x36d145=_[_0xe9c5('0x3d')]({},_0x36d145,_0x2112a6[_0xe9c5('0x40')]);var _0x480b83={'where':_0x36d145[_0xe9c5('0x3a')]};return db[_0xe9c5('0x41')][_0xe9c5('0x1e')](_0x480b83)[_0xe9c5('0x26')](function(_0x2c1615){_0x334f5a[_0xe9c5('0x1e')]=_0x2c1615;if(_0x2112a6[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x36d145[_0xe9c5('0x43')]=[{'all':!![]}];}return db[_0xe9c5('0x41')][_0xe9c5('0x44')](_0x36d145);})['then'](function(_0x51dd18){_0x334f5a[_0xe9c5('0x45')]=_0x51dd18;return _0x334f5a;})[_0xe9c5('0x26')](respondWithFilteredResult(_0x52d008,_0x36d145))[_0xe9c5('0x46')](handleError(_0x52d008,null));};exports[_0xe9c5('0x47')]=function(_0x4ca4b0,_0x4a3fc5){var _0x382405={'raw':!![],'where':{'id':_0x4ca4b0['params']['id']}},_0x144e85={};_0x144e85[_0xe9c5('0x30')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x144e85[_0xe9c5('0x31')]=_[_0xe9c5('0x48')](_0x4ca4b0[_0xe9c5('0x31')]);_0x144e85[_0xe9c5('0x32')]=_['intersection'](_0x144e85[_0xe9c5('0x30')],_0x144e85[_0xe9c5('0x31')]);_0x382405[_0xe9c5('0x35')]=_[_0xe9c5('0x33')](_0x144e85[_0xe9c5('0x30')],qs[_0xe9c5('0x34')](_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x34')]));_0x382405['attributes']=_0x382405[_0xe9c5('0x35')][_0xe9c5('0x36')]?_0x382405[_0xe9c5('0x35')]:_0x144e85[_0xe9c5('0x30')];if(_0x4ca4b0[_0xe9c5('0x31')][_0xe9c5('0x42')]){_0x382405['include']=[{'all':!![]}];}_0x382405=_['merge']({},_0x382405,_0x4ca4b0['options']);return db['FreshdeskField'][_0xe9c5('0x49')](_0x382405)[_0xe9c5('0x26')](handleEntityNotFound(_0x4a3fc5,null))[_0xe9c5('0x26')](respondWithResult(_0x4a3fc5,null))['catch'](handleError(_0x4a3fc5,null));};exports[_0xe9c5('0x4a')]=function(_0x520248,_0x1ed99e){return db[_0xe9c5('0x41')][_0xe9c5('0x4a')](_0x520248[_0xe9c5('0x4b')],{})['then'](respondWithResult(_0x1ed99e,0xc9))[_0xe9c5('0x46')](handleError(_0x1ed99e,null));};exports[_0xe9c5('0x25')]=function(_0x1da6a3,_0x249940){if(_0x1da6a3['body']['id']){delete _0x1da6a3[_0xe9c5('0x4b')]['id'];}return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x1da6a3[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x249940,null))[_0xe9c5('0x26')](saveUpdates(_0x1da6a3['body'],null))[_0xe9c5('0x26')](respondWithResult(_0x249940,null))[_0xe9c5('0x46')](handleError(_0x249940,null));};exports[_0xe9c5('0x27')]=function(_0x9d0154,_0x5e7c24){return db[_0xe9c5('0x41')][_0xe9c5('0x49')]({'where':{'id':_0x9d0154[_0xe9c5('0x4c')]['id']}})[_0xe9c5('0x26')](handleEntityNotFound(_0x5e7c24,null))[_0xe9c5('0x26')](removeEntity(_0x5e7c24,null))[_0xe9c5('0x46')](handleError(_0x5e7c24,null));}; \ No newline at end of file +var _0x8cc8=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','FreshdeskField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','map','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x8cc8,0x177));var _0x88cc=function(_0x3946b9,_0x2d6c1c){_0x3946b9=_0x3946b9-0x0;var _0x5ed6e9=_0x8cc8[_0x3946b9];return _0x5ed6e9;};'use strict';var emlformat=require(_0x88cc('0x0'));var rimraf=require(_0x88cc('0x1'));var zipdir=require(_0x88cc('0x2'));var jsonpatch=require(_0x88cc('0x3'));var rp=require(_0x88cc('0x4'));var moment=require(_0x88cc('0x5'));var BPromise=require(_0x88cc('0x6'));var Mustache=require(_0x88cc('0x7'));var util=require(_0x88cc('0x8'));var path=require(_0x88cc('0x9'));var sox=require(_0x88cc('0xa'));var csv=require(_0x88cc('0xb'));var ejs=require(_0x88cc('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x88cc('0xd'));var crypto=require(_0x88cc('0xe'));var jsforce=require(_0x88cc('0xf'));var deskjs=require(_0x88cc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x88cc('0x11'));var Papa=require(_0x88cc('0x12'));var Redis=require('ioredis');var authService=require(_0x88cc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x88cc('0x14'));var hardwareService=require(_0x88cc('0x15'));var logger=require(_0x88cc('0x16'))(_0x88cc('0x17'));var utils=require('../../config/utils');var config=require(_0x88cc('0x18'));var licenseUtil=require(_0x88cc('0x19'));var db=require(_0x88cc('0x1a'))['db'];function respondWithStatusCode(_0x2219e1,_0x297ca5){_0x297ca5=_0x297ca5||0xcc;return function(_0x1289d0){if(_0x1289d0){return _0x2219e1[_0x88cc('0x1b')](_0x297ca5);}return _0x2219e1[_0x88cc('0x1c')](_0x297ca5)['end']();};}function respondWithResult(_0x20193f,_0x3d1a38){_0x3d1a38=_0x3d1a38||0xc8;return function(_0x3d462b){if(_0x3d462b){return _0x20193f[_0x88cc('0x1c')](_0x3d1a38)[_0x88cc('0x1d')](_0x3d462b);}};}function respondWithFilteredResult(_0x4255bb,_0x49741f){return function(_0x3305f3){if(_0x3305f3){var _0x468101=typeof _0x49741f[_0x88cc('0x1e')]===_0x88cc('0x1f')&&typeof _0x49741f[_0x88cc('0x20')]==='undefined';var _0x30edea=_0x3305f3[_0x88cc('0x21')];var _0x34fb65=_0x468101?0x0:_0x49741f[_0x88cc('0x1e')];var _0x33144a=_0x468101?_0x3305f3['count']:_0x49741f[_0x88cc('0x1e')]+_0x49741f[_0x88cc('0x20')];var _0x5dbfef;if(_0x33144a>=_0x30edea){_0x33144a=_0x30edea;_0x5dbfef=0xc8;}else{_0x5dbfef=0xce;}_0x4255bb[_0x88cc('0x1c')](_0x5dbfef);return _0x4255bb['set'](_0x88cc('0x22'),_0x34fb65+'-'+_0x33144a+'/'+_0x30edea)[_0x88cc('0x1d')](_0x3305f3);}return null;};}function patchUpdates(_0x50cdaf){return function(_0x2cfe2d){try{jsonpatch[_0x88cc('0x23')](_0x2cfe2d,_0x50cdaf,!![]);}catch(_0xe55e9d){return BPromise[_0x88cc('0x24')](_0xe55e9d);}return _0x2cfe2d[_0x88cc('0x25')]();};}function saveUpdates(_0xa2e3eb,_0x4e5edb){return function(_0x155635){if(_0x155635){return _0x155635[_0x88cc('0x26')](_0xa2e3eb)[_0x88cc('0x27')](function(_0xac6e45){return _0xac6e45;});}return null;};}function removeEntity(_0x443631,_0x3c2353){return function(_0x420279){if(_0x420279){return _0x420279[_0x88cc('0x28')]()[_0x88cc('0x27')](function(){_0x443631[_0x88cc('0x1c')](0xcc)[_0x88cc('0x29')]();});}};}function handleEntityNotFound(_0x35c695,_0x22d711){return function(_0x5657ef){if(!_0x5657ef){_0x35c695[_0x88cc('0x1b')](0x194);}return _0x5657ef;};}function handleError(_0x337bab,_0x44ae48){_0x44ae48=_0x44ae48||0x1f4;return function(_0x3474b6){logger[_0x88cc('0x2a')](_0x3474b6[_0x88cc('0x2b')]);if(_0x3474b6[_0x88cc('0x2c')]){delete _0x3474b6[_0x88cc('0x2c')];}_0x337bab['status'](_0x44ae48)['send'](_0x3474b6);};}exports[_0x88cc('0x2d')]=function(_0x45f1c6,_0x1c1d57){var _0x5b77ae={},_0x570ea0={},_0x18ced1={'count':0x0,'rows':[]};var _0x2cc552=_['map'](db[_0x88cc('0x2e')][_0x88cc('0x2f')],function(_0x10248e){return{'name':_0x10248e['fieldName'],'type':_0x10248e[_0x88cc('0x30')][_0x88cc('0x31')]};});_0x570ea0[_0x88cc('0x32')]=_['map'](_0x2cc552,_0x88cc('0x2c'));_0x570ea0[_0x88cc('0x33')]=_[_0x88cc('0x34')](_0x45f1c6[_0x88cc('0x33')]);_0x570ea0[_0x88cc('0x35')]=_[_0x88cc('0x36')](_0x570ea0['model'],_0x570ea0[_0x88cc('0x33')]);_0x5b77ae[_0x88cc('0x37')]=_[_0x88cc('0x36')](_0x570ea0[_0x88cc('0x32')],qs[_0x88cc('0x38')](_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x38')]));_0x5b77ae['attributes']=_0x5b77ae['attributes'][_0x88cc('0x39')]?_0x5b77ae[_0x88cc('0x37')]:_0x570ea0[_0x88cc('0x32')];if(!_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x3a')]('nolimit')){_0x5b77ae[_0x88cc('0x20')]=qs[_0x88cc('0x20')](_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x20')]);_0x5b77ae[_0x88cc('0x1e')]=qs[_0x88cc('0x1e')](_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x1e')]);}_0x5b77ae[_0x88cc('0x3b')]=qs[_0x88cc('0x3c')](_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x3c')]);_0x5b77ae['where']=qs[_0x88cc('0x35')](_[_0x88cc('0x3d')](_0x45f1c6['query'],_0x570ea0[_0x88cc('0x35')]),_0x2cc552);if(_0x45f1c6['query']['filter']){_0x5b77ae['where']=_[_0x88cc('0x3e')](_0x5b77ae['where'],{'$or':_[_0x88cc('0x3f')](_0x2cc552,function(_0x1fb2ca){if(_0x1fb2ca['type']!==_0x88cc('0x40')){var _0x57ecf7={};_0x57ecf7[_0x1fb2ca[_0x88cc('0x2c')]]={'$like':'%'+_0x45f1c6['query'][_0x88cc('0x41')]+'%'};return _0x57ecf7;}})});}_0x5b77ae=_['merge']({},_0x5b77ae,_0x45f1c6[_0x88cc('0x42')]);var _0x35342a={'where':_0x5b77ae[_0x88cc('0x43')]};return db[_0x88cc('0x2e')]['count'](_0x35342a)[_0x88cc('0x27')](function(_0x510e5b){_0x18ced1[_0x88cc('0x21')]=_0x510e5b;if(_0x45f1c6[_0x88cc('0x33')][_0x88cc('0x44')]){_0x5b77ae[_0x88cc('0x45')]=[{'all':!![]}];}return db[_0x88cc('0x2e')][_0x88cc('0x46')](_0x5b77ae);})[_0x88cc('0x27')](function(_0x2138dd){_0x18ced1[_0x88cc('0x47')]=_0x2138dd;return _0x18ced1;})['then'](respondWithFilteredResult(_0x1c1d57,_0x5b77ae))[_0x88cc('0x48')](handleError(_0x1c1d57,null));};exports[_0x88cc('0x49')]=function(_0x1481df,_0x5af511){var _0x188fee={'raw':!![],'where':{'id':_0x1481df[_0x88cc('0x4a')]['id']}},_0x37ad9f={};_0x37ad9f['model']=_[_0x88cc('0x34')](db[_0x88cc('0x2e')][_0x88cc('0x2f')]);_0x37ad9f[_0x88cc('0x33')]=_[_0x88cc('0x34')](_0x1481df['query']);_0x37ad9f[_0x88cc('0x35')]=_[_0x88cc('0x36')](_0x37ad9f[_0x88cc('0x32')],_0x37ad9f[_0x88cc('0x33')]);_0x188fee[_0x88cc('0x37')]=_['intersection'](_0x37ad9f[_0x88cc('0x32')],qs['fields'](_0x1481df['query'][_0x88cc('0x38')]));_0x188fee[_0x88cc('0x37')]=_0x188fee['attributes']['length']?_0x188fee[_0x88cc('0x37')]:_0x37ad9f[_0x88cc('0x32')];if(_0x1481df[_0x88cc('0x33')][_0x88cc('0x44')]){_0x188fee['include']=[{'all':!![]}];}_0x188fee=_[_0x88cc('0x3e')]({},_0x188fee,_0x1481df[_0x88cc('0x42')]);return db[_0x88cc('0x2e')][_0x88cc('0x4b')](_0x188fee)[_0x88cc('0x27')](handleEntityNotFound(_0x5af511,null))[_0x88cc('0x27')](respondWithResult(_0x5af511,null))[_0x88cc('0x48')](handleError(_0x5af511,null));};exports[_0x88cc('0x4c')]=function(_0x14e889,_0x6615dd){return db[_0x88cc('0x2e')]['create'](_0x14e889[_0x88cc('0x4d')],{})[_0x88cc('0x27')](respondWithResult(_0x6615dd,0xc9))[_0x88cc('0x48')](handleError(_0x6615dd,null));};exports['update']=function(_0x2e04e5,_0xdc32cb){if(_0x2e04e5['body']['id']){delete _0x2e04e5[_0x88cc('0x4d')]['id'];}return db[_0x88cc('0x2e')][_0x88cc('0x4b')]({'where':{'id':_0x2e04e5[_0x88cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0xdc32cb,null))[_0x88cc('0x27')](saveUpdates(_0x2e04e5[_0x88cc('0x4d')],null))['then'](respondWithResult(_0xdc32cb,null))[_0x88cc('0x48')](handleError(_0xdc32cb,null));};exports[_0x88cc('0x28')]=function(_0x14912f,_0xa043e){return db[_0x88cc('0x2e')][_0x88cc('0x4b')]({'where':{'id':_0x14912f[_0x88cc('0x4a')]['id']}})[_0x88cc('0x27')](handleEntityNotFound(_0xa043e,null))[_0x88cc('0x27')](removeEntity(_0xa043e,null))[_0x88cc('0x48')](handleError(_0xa043e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 40dc4e3..69310bb 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 _0x0501=['request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','api'];(function(_0x1bff26,_0x499fde){var _0x1156c4=function(_0x2c60a3){while(--_0x2c60a3){_0x1bff26['push'](_0x1bff26['shift']());}};_0x1156c4(++_0x499fde);}(_0x0501,0xcf));var _0x1050=function(_0x179220,_0x507eb2){_0x179220=_0x179220-0x0;var _0x5d1d84=_0x0501[_0x179220];return _0x5d1d84;};'use strict';var _=require(_0x1050('0x0'));var util=require(_0x1050('0x1'));var logger=require('../../config/logger')(_0x1050('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1050('0x3'));var fs=require('fs');var path=require(_0x1050('0x4'));var rimraf=require(_0x1050('0x5'));var config=require(_0x1050('0x6'));var attributes=require(_0x1050('0x7'));module[_0x1050('0x8')]=function(_0x271605,_0x55509f){return _0x271605[_0x1050('0x9')](_0x1050('0xa'),attributes,{'tableName':_0x1050('0xb'),'paranoid':![],'indexes':[{'name':_0x1050('0xc'),'fields':[_0x1050('0xd'),_0x1050('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc856=['exports','define','FreshdeskField','int_freshdesk_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x56f7cf,_0x36fffb){var _0xee4e2f=function(_0x42e442){while(--_0x42e442){_0x56f7cf['push'](_0x56f7cf['shift']());}};_0xee4e2f(++_0x36fffb);}(_0xc856,0x1a9));var _0x6c85=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xc856[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x6c85('0x0'));var util=require(_0x6c85('0x1'));var logger=require(_0x6c85('0x2'))(_0x6c85('0x3'));var moment=require(_0x6c85('0x4'));var BPromise=require(_0x6c85('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c85('0x6'));var rimraf=require(_0x6c85('0x7'));var config=require(_0x6c85('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x6c85('0x9')]=function(_0x1fe753,_0x3105c6){return _0x1fe753[_0x6c85('0xa')](_0x6c85('0xb'),attributes,{'tableName':_0x6c85('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x6c85('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 412db27..586ef82 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 _0x54ea=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x54ea,0x1bb));var _0xa54e=function(_0x24e4fb,_0x3b3825){_0x24e4fb=_0x24e4fb-0x0;var _0x2d25b7=_0x54ea[_0x24e4fb];return _0x2d25b7;};'use strict';var _=require(_0xa54e('0x0'));var util=require(_0xa54e('0x1'));var moment=require('moment');var BPromise=require(_0xa54e('0x2'));var rs=require(_0xa54e('0x3'));var fs=require('fs');var Redis=require(_0xa54e('0x4'));var db=require(_0xa54e('0x5'))['db'];var utils=require(_0xa54e('0x6'));var logger=require(_0xa54e('0x7'))(_0xa54e('0x8'));var config=require(_0xa54e('0x9'));var jayson=require(_0xa54e('0xa'));var client=jayson[_0xa54e('0xb')][_0xa54e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4859df,_0x4d8c7b,_0x23e739){return new BPromise(function(_0x1d6380,_0x40c707){return client[_0xa54e('0xd')](_0x4859df,_0x23e739)['then'](function(_0x22eff6){logger['info'](_0xa54e('0xe'),_0x4d8c7b,_0xa54e('0xf'));logger[_0xa54e('0x10')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4d8c7b,_0xa54e('0xf'),JSON[_0xa54e('0x11')](_0x22eff6));if(_0x22eff6[_0xa54e('0x12')]){if(_0x22eff6[_0xa54e('0x12')][_0xa54e('0x13')]===0x1f4){logger[_0xa54e('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x4d8c7b,_0x22eff6['error'][_0xa54e('0x14')]);return _0x40c707(_0x22eff6[_0xa54e('0x12')]['message']);}logger[_0xa54e('0x12')](_0xa54e('0xe'),_0x4d8c7b,_0x22eff6[_0xa54e('0x12')]['message']);return _0x1d6380(_0x22eff6[_0xa54e('0x12')]['message']);}else{logger['info'](_0xa54e('0xe'),_0x4d8c7b,_0xa54e('0xf'));_0x1d6380(_0x22eff6[_0xa54e('0x15')][_0xa54e('0x14')]);}})['catch'](function(_0x1845d8){logger[_0xa54e('0x12')](_0xa54e('0xe'),_0x4d8c7b,_0x1845d8);_0x40c707(_0x1845d8);});});} \ No newline at end of file +var _0x244d=['request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http'];(function(_0x4fa66c,_0x51f9a3){var _0x9b192b=function(_0x5a930f){while(--_0x5a930f){_0x4fa66c['push'](_0x4fa66c['shift']());}};_0x9b192b(++_0x51f9a3);}(_0x244d,0x88));var _0xd244=function(_0x333a74,_0x4e5043){_0x333a74=_0x333a74-0x0;var _0x5d1062=_0x244d[_0x333a74];return _0x5d1062;};'use strict';var _=require('lodash');var util=require(_0xd244('0x0'));var moment=require(_0xd244('0x1'));var BPromise=require('bluebird');var rs=require(_0xd244('0x2'));var fs=require('fs');var Redis=require(_0xd244('0x3'));var db=require(_0xd244('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd244('0x5'))('rpc');var config=require(_0xd244('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd244('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x465cc3,_0x296400,_0x44de01){return new BPromise(function(_0x191a8e,_0x105ca8){return client[_0xd244('0x8')](_0x465cc3,_0x44de01)['then'](function(_0x1046b3){logger['info'](_0xd244('0x9'),_0x296400,_0xd244('0xa'));logger[_0xd244('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x296400,_0xd244('0xa'),JSON[_0xd244('0xc')](_0x1046b3));if(_0x1046b3[_0xd244('0xd')]){if(_0x1046b3['error']['code']===0x1f4){logger[_0xd244('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x296400,_0x1046b3['error'][_0xd244('0xe')]);return _0x105ca8(_0x1046b3['error'][_0xd244('0xe')]);}logger[_0xd244('0xd')](_0xd244('0x9'),_0x296400,_0x1046b3[_0xd244('0xd')]['message']);return _0x191a8e(_0x1046b3['error'][_0xd244('0xe')]);}else{logger[_0xd244('0xf')](_0xd244('0x9'),_0x296400,_0xd244('0xa'));_0x191a8e(_0x1046b3[_0xd244('0x10')][_0xd244('0xe')]);}})[_0xd244('0x11')](function(_0x517633){logger[_0xd244('0xd')](_0xd244('0x9'),_0x296400,_0x517633);_0x105ca8(_0x517633);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d5cef96..47da9d6 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 _0xcb91=['addConfiguration','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x3ff40c,_0x3b2e12){var _0x57d882=function(_0xb3837c){while(--_0xb3837c){_0x3ff40c['push'](_0x3ff40c['shift']());}};_0x57d882(++_0x3b2e12);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0xcb91[_0x5e42a7];return _0x36d21b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller['destroy']);module[_0x1cb9('0x14')]=router; \ No newline at end of file +var _0xe1e3=['get','isAuthenticated','index','/:id','show','/:id/configurations','post','create','update','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x44742d,_0x2bab08){_0x44742d=_0x44742d-0x0;var _0x33bf0c=_0xe1e3[_0x44742d];return _0x33bf0c;};'use strict';var multer=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var path=require('path');var timeout=require(_0x3e1e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e1e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3e1e('0x4'));var config=require(_0x3e1e('0x5'));var controller=require(_0x3e1e('0x6'));router[_0x3e1e('0x7')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x9')]);router['get'](_0x3e1e('0xa'),auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xb')]);router[_0x3e1e('0x7')](_0x3e1e('0xc'),auth[_0x3e1e('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x3e1e('0x8')](),controller['getFields']);router[_0x3e1e('0xd')]('/',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0xe')]);router['post'](_0x3e1e('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3e1e('0xf')]);router['delete']('/:id',auth[_0x3e1e('0x8')](),controller[_0x3e1e('0x10')]);module[_0x3e1e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 1516f8c..2f80175 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 _0x57ca=['exports','STRING','username','remoteUri'];(function(_0x1a7501,_0x4d2417){var _0x4bfd45=function(_0x54e5c4){while(--_0x54e5c4){_0x1a7501['push'](_0x1a7501['shift']());}};_0x4bfd45(++_0x4d2417);}(_0x57ca,0x108));var _0xa57c=function(_0x5e6c4f,_0x32ceec){_0x5e6c4f=_0x5e6c4f-0x0;var _0x4db461=_0x57ca[_0x5e6c4f];return _0x4db461;};'use strict';var Sequelize=require('sequelize');module[_0xa57c('0x0')]={'name':{'type':Sequelize[_0xa57c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa57c('0x1')],'unique':_0xa57c('0x2')},'apiKey':{'type':Sequelize[_0xa57c('0x1')]},'remoteUri':{'type':Sequelize[_0xa57c('0x1')],'unique':_0xa57c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x43d694,_0x270612){var _0x1c9159=function(_0x2e2c92){while(--_0x2e2c92){_0x43d694['push'](_0x43d694['shift']());}};_0x1c9159(++_0x270612);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x48184c,_0x4d17f2){_0x48184c=_0x48184c-0x0;var _0xad28b8=_0x4e2e[_0x48184c];return _0xad28b8;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index ec14091..17d5f3b 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 _0xe2ec=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','length','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','substring','GET','%s%s','/api/selector/owners','Token\x20token=','email','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bdddb,_0x5a3d21){var _0x4b515b=function(_0x52d267){while(--_0x52d267){_0x3bdddb['push'](_0x3bdddb['shift']());}};_0x4b515b(++_0x5a3d21);}(_0xe2ec,0x1f4));var _0xce2e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xe2ec[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xce2e('0x0'));var rimraf=require(_0xce2e('0x1'));var zipdir=require(_0xce2e('0x2'));var jsonpatch=require(_0xce2e('0x3'));var rp=require(_0xce2e('0x4'));var moment=require(_0xce2e('0x5'));var BPromise=require(_0xce2e('0x6'));var Mustache=require(_0xce2e('0x7'));var util=require(_0xce2e('0x8'));var path=require(_0xce2e('0x9'));var sox=require(_0xce2e('0xa'));var csv=require(_0xce2e('0xb'));var ejs=require(_0xce2e('0xc'));var fs=require('fs');var fs_extra=require(_0xce2e('0xd'));var _=require('lodash');var squel=require(_0xce2e('0xe'));var crypto=require(_0xce2e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xce2e('0x10'));var toCsv=require('to-csv');var querystring=require(_0xce2e('0x11'));var Papa=require(_0xce2e('0x12'));var Redis=require('ioredis');var authService=require(_0xce2e('0x13'));var qs=require(_0xce2e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce2e('0x15'));var utils=require(_0xce2e('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce2e('0x17'));var db=require(_0xce2e('0x18'))['db'];var integrations=require(_0xce2e('0x19'));function respondWithStatusCode(_0x5d7a58,_0x3a40ae){_0x3a40ae=_0x3a40ae||0xcc;return function(_0x7fd934){if(_0x7fd934){return _0x5d7a58[_0xce2e('0x1a')](_0x3a40ae);}return _0x5d7a58['status'](_0x3a40ae)[_0xce2e('0x1b')]();};}function respondWithResult(_0x39410d,_0x4d23a5){_0x4d23a5=_0x4d23a5||0xc8;return function(_0x4dce2f){if(_0x4dce2f){return _0x39410d[_0xce2e('0x1c')](_0x4d23a5)['json'](_0x4dce2f);}};}function respondWithFilteredResult(_0x1cbe3a,_0x4f9651){return function(_0x3a58da){if(_0x3a58da){var _0x106d6a=typeof _0x4f9651[_0xce2e('0x1d')]===_0xce2e('0x1e')&&typeof _0x4f9651[_0xce2e('0x1f')]===_0xce2e('0x1e');var _0x5e2a64=_0x3a58da[_0xce2e('0x20')];var _0xdaeacc=_0x106d6a?0x0:_0x4f9651[_0xce2e('0x1d')];var _0x36a9de=_0x106d6a?_0x3a58da[_0xce2e('0x20')]:_0x4f9651[_0xce2e('0x1d')]+_0x4f9651[_0xce2e('0x1f')];var _0x301eac;if(_0x36a9de>=_0x5e2a64){_0x36a9de=_0x5e2a64;_0x301eac=0xc8;}else{_0x301eac=0xce;}_0x1cbe3a['status'](_0x301eac);return _0x1cbe3a[_0xce2e('0x21')](_0xce2e('0x22'),_0xdaeacc+'-'+_0x36a9de+'/'+_0x5e2a64)[_0xce2e('0x23')](_0x3a58da);}return null;};}function patchUpdates(_0x4e0cea){return function(_0x30f0e1){try{jsonpatch[_0xce2e('0x24')](_0x30f0e1,_0x4e0cea,!![]);}catch(_0x49c1cf){return BPromise[_0xce2e('0x25')](_0x49c1cf);}return _0x30f0e1[_0xce2e('0x26')]();};}function saveUpdates(_0x4ce754,_0x5537c8){return function(_0x507935){if(_0x507935){return _0x507935[_0xce2e('0x27')](_0x4ce754)[_0xce2e('0x28')](function(_0x52020f){return _0x52020f;});}return null;};}function removeEntity(_0x226ace,_0x45e14f){return function(_0x53070c){if(_0x53070c){return _0x53070c[_0xce2e('0x29')]()[_0xce2e('0x28')](function(){_0x226ace[_0xce2e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x467007,_0x74604d){return function(_0x3882fa){if(!_0x3882fa){_0x467007[_0xce2e('0x1a')](0x194);}return _0x3882fa;};}function handleError(_0x59dc4d,_0x2a694c){_0x2a694c=_0x2a694c||0x1f4;return function(_0x32111f){logger[_0xce2e('0x2a')](_0x32111f['stack']);if(_0x32111f[_0xce2e('0x2b')]){delete _0x32111f['name'];}_0x59dc4d['status'](_0x2a694c)[_0xce2e('0x2c')](_0x32111f);};}exports['index']=function(_0x37406a,_0x80d725){var _0x45763c={},_0x3f5c62={},_0x5d7a13={'count':0x0,'rows':[]};var _0x15c384=_[_0xce2e('0x2d')](db[_0xce2e('0x2e')][_0xce2e('0x2f')],function(_0x27c778){return{'name':_0x27c778[_0xce2e('0x30')],'type':_0x27c778[_0xce2e('0x31')][_0xce2e('0x32')]};});_0x3f5c62[_0xce2e('0x33')]=_[_0xce2e('0x2d')](_0x15c384,_0xce2e('0x2b'));_0x3f5c62[_0xce2e('0x34')]=_['keys'](_0x37406a[_0xce2e('0x34')]);_0x3f5c62[_0xce2e('0x35')]=_[_0xce2e('0x36')](_0x3f5c62['model'],_0x3f5c62[_0xce2e('0x34')]);_0x45763c[_0xce2e('0x37')]=_['intersection'](_0x3f5c62[_0xce2e('0x33')],qs[_0xce2e('0x38')](_0x37406a['query']['fields']));_0x45763c[_0xce2e('0x37')]=_0x45763c[_0xce2e('0x37')]['length']?_0x45763c[_0xce2e('0x37')]:_0x3f5c62[_0xce2e('0x33')];if(!_0x37406a[_0xce2e('0x34')][_0xce2e('0x39')](_0xce2e('0x3a'))){_0x45763c[_0xce2e('0x1f')]=qs[_0xce2e('0x1f')](_0x37406a[_0xce2e('0x34')]['limit']);_0x45763c[_0xce2e('0x1d')]=qs['offset'](_0x37406a[_0xce2e('0x34')][_0xce2e('0x1d')]);}_0x45763c['order']=qs[_0xce2e('0x3b')](_0x37406a[_0xce2e('0x34')][_0xce2e('0x3b')]);_0x45763c[_0xce2e('0x3c')]=qs[_0xce2e('0x35')](_[_0xce2e('0x3d')](_0x37406a[_0xce2e('0x34')],_0x3f5c62['filters']),_0x15c384);if(_0x37406a[_0xce2e('0x34')]['filter']){_0x45763c[_0xce2e('0x3c')]=_[_0xce2e('0x3e')](_0x45763c[_0xce2e('0x3c')],{'$or':_[_0xce2e('0x2d')](_0x15c384,function(_0x101465){if(_0x101465['type']!=='VIRTUAL'){var _0x1eb629={};_0x1eb629[_0x101465[_0xce2e('0x2b')]]={'$like':'%'+_0x37406a[_0xce2e('0x34')][_0xce2e('0x3f')]+'%'};return _0x1eb629;}})});}_0x45763c=_['merge']({},_0x45763c,_0x37406a[_0xce2e('0x40')]);var _0x2f9742={'where':_0x45763c[_0xce2e('0x3c')]};return db[_0xce2e('0x2e')][_0xce2e('0x20')](_0x2f9742)[_0xce2e('0x28')](function(_0x10f2d6){_0x5d7a13[_0xce2e('0x20')]=_0x10f2d6;if(_0x37406a[_0xce2e('0x34')]['includeAll']){_0x45763c[_0xce2e('0x41')]=[{'all':!![]}];}return db[_0xce2e('0x2e')][_0xce2e('0x42')](_0x45763c);})['then'](function(_0x4304f4){_0x5d7a13[_0xce2e('0x43')]=_0x4304f4;return _0x5d7a13;})[_0xce2e('0x28')](respondWithFilteredResult(_0x80d725,_0x45763c))[_0xce2e('0x44')](handleError(_0x80d725,null));};exports[_0xce2e('0x45')]=function(_0x5e8f2e,_0xbce1b3){var _0x425696={'raw':![],'where':{'id':_0x5e8f2e[_0xce2e('0x46')]['id']}},_0x53b93f={};_0x53b93f[_0xce2e('0x33')]=_[_0xce2e('0x47')](db[_0xce2e('0x2e')][_0xce2e('0x2f')]);_0x53b93f[_0xce2e('0x34')]=_['keys'](_0x5e8f2e[_0xce2e('0x34')]);_0x53b93f[_0xce2e('0x35')]=_[_0xce2e('0x36')](_0x53b93f[_0xce2e('0x33')],_0x53b93f[_0xce2e('0x34')]);_0x425696[_0xce2e('0x37')]=_['intersection'](_0x53b93f['model'],qs[_0xce2e('0x38')](_0x5e8f2e[_0xce2e('0x34')]['fields']));_0x425696[_0xce2e('0x37')]=_0x425696[_0xce2e('0x37')]['length']?_0x425696[_0xce2e('0x37')]:_0x53b93f['model'];if(_0x5e8f2e[_0xce2e('0x34')][_0xce2e('0x48')]){_0x425696[_0xce2e('0x41')]=[{'all':!![]}];}_0x425696=_[_0xce2e('0x3e')]({},_0x425696,_0x5e8f2e[_0xce2e('0x40')]);return db[_0xce2e('0x2e')][_0xce2e('0x49')](_0x425696)[_0xce2e('0x28')](handleEntityNotFound(_0xbce1b3,null))['then'](respondWithResult(_0xbce1b3,null))['catch'](handleError(_0xbce1b3,null));};exports[_0xce2e('0x4a')]=function(_0x599981,_0x4f3af0){return db[_0xce2e('0x2e')][_0xce2e('0x4a')](_0x599981['body'],{})[_0xce2e('0x28')](respondWithResult(_0x4f3af0,0xc9))['catch'](handleError(_0x4f3af0,null));};exports['update']=function(_0x58bce2,_0x21ba71){if(_0x58bce2[_0xce2e('0x4b')]['id']){delete _0x58bce2[_0xce2e('0x4b')]['id'];}return db[_0xce2e('0x2e')][_0xce2e('0x49')]({'where':{'id':_0x58bce2['params']['id']}})[_0xce2e('0x28')](handleEntityNotFound(_0x21ba71,null))['then'](saveUpdates(_0x58bce2[_0xce2e('0x4b')],null))[_0xce2e('0x28')](respondWithResult(_0x21ba71,null))[_0xce2e('0x44')](handleError(_0x21ba71,null));};exports['destroy']=function(_0x29e864,_0x4ead69){return db[_0xce2e('0x2e')][_0xce2e('0x49')]({'where':{'id':_0x29e864[_0xce2e('0x46')]['id']}})[_0xce2e('0x28')](handleEntityNotFound(_0x4ead69,null))['then'](removeEntity(_0x4ead69,null))[_0xce2e('0x44')](handleError(_0x4ead69,null));};exports[_0xce2e('0x4c')]=function(_0x241add,_0x259bad,_0x126b46){var _0x5770ba={};var _0x36e0f6={};var _0x5f509e;var _0x284fde;return db['FreshsalesAccount'][_0xce2e('0x4d')]({'where':{'id':_0x241add[_0xce2e('0x46')]['id']}})[_0xce2e('0x28')](handleEntityNotFound(_0x259bad,null))[_0xce2e('0x28')](function(_0x1b96b1){if(_0x1b96b1){_0x5f509e=_0x1b96b1;_0x36e0f6[_0xce2e('0x33')]=_[_0xce2e('0x47')](db[_0xce2e('0x4e')][_0xce2e('0x2f')]);_0x36e0f6['query']=_['keys'](_0x241add[_0xce2e('0x34')]);_0x36e0f6[_0xce2e('0x35')]=_[_0xce2e('0x36')](_0x36e0f6[_0xce2e('0x33')],_0x36e0f6['query']);_0x5770ba[_0xce2e('0x37')]=_[_0xce2e('0x36')](_0x36e0f6['model'],qs['fields'](_0x241add['query']['fields']));_0x5770ba[_0xce2e('0x37')]=_0x5770ba[_0xce2e('0x37')]['length']?_0x5770ba['attributes']:_0x36e0f6['model'];_0x5770ba[_0xce2e('0x4f')]=qs[_0xce2e('0x3b')](_0x241add['query'][_0xce2e('0x3b')]);_0x5770ba[_0xce2e('0x3c')]=qs[_0xce2e('0x35')](_[_0xce2e('0x3d')](_0x241add[_0xce2e('0x34')],_0x36e0f6[_0xce2e('0x35')]));if(_0x241add[_0xce2e('0x34')][_0xce2e('0x3f')]){_0x5770ba[_0xce2e('0x3c')]=_[_0xce2e('0x3e')](_0x5770ba[_0xce2e('0x3c')],{'$or':_['map'](_0x5770ba['attributes'],function(_0x202722){var _0x26acf0={};_0x26acf0[_0x202722]={'$like':'%'+_0x241add[_0xce2e('0x34')]['filter']+'%'};return _0x26acf0;})});}_0x5770ba=_[_0xce2e('0x3e')]({},_0x5770ba,_0x241add[_0xce2e('0x40')]);return _0x5f509e[_0xce2e('0x4c')](_0x5770ba);}})[_0xce2e('0x28')](function(_0x3a3b57){if(_0x3a3b57){_0x284fde=_0x3a3b57[_0xce2e('0x50')];if(!_0x241add[_0xce2e('0x34')][_0xce2e('0x39')](_0xce2e('0x3a'))){_0x5770ba['limit']=qs[_0xce2e('0x1f')](_0x241add[_0xce2e('0x34')][_0xce2e('0x1f')]);_0x5770ba[_0xce2e('0x1d')]=qs[_0xce2e('0x1d')](_0x241add[_0xce2e('0x34')][_0xce2e('0x1d')]);}return _0x5f509e[_0xce2e('0x4c')](_0x5770ba);}})[_0xce2e('0x28')](function(_0xa912cb){if(_0xa912cb){return _0xa912cb?{'count':_0x284fde,'rows':_0xa912cb}:null;}})['then'](respondWithResult(_0x259bad,null))[_0xce2e('0x44')](handleError(_0x259bad,null));};exports['addConfiguration']=function(_0x5ad3ca,_0xc1f8bb,_0x3aa60b){if(_0x5ad3ca[_0xce2e('0x4b')]['id']){delete _0x5ad3ca[_0xce2e('0x4b')]['id'];}return db[_0xce2e('0x2e')]['findOne']({'where':{'id':_0x5ad3ca[_0xce2e('0x46')]['id']}})[_0xce2e('0x28')](handleEntityNotFound(_0xc1f8bb,null))[_0xce2e('0x28')](function(_0x15e8ed){if(_0x15e8ed){_0x5ad3ca['body']['AccountId']=_0x15e8ed['id'];_0x5ad3ca[_0xce2e('0x4b')][_0xce2e('0x51')]=integrations['getSubjects'](_0x5ad3ca[_0xce2e('0x4b')][_0xce2e('0x52')],_0x5ad3ca['body'][_0xce2e('0x31')]);_0x5ad3ca['body'][_0xce2e('0x53')]=integrations[_0xce2e('0x54')](_0x5ad3ca[_0xce2e('0x4b')]['channel'],_0x5ad3ca['body'][_0xce2e('0x31')]);return db[_0xce2e('0x4e')]['create'](_0x5ad3ca[_0xce2e('0x4b')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0xce2e('0x55')],'as':'Descriptions'}]});}return null;})[_0xce2e('0x28')](respondWithResult(_0xc1f8bb,null))['catch'](handleError(_0xc1f8bb,null));};exports[_0xce2e('0x56')]=function(_0x573f10,_0x1c0f4b,_0x2b2060){var _0x153aea='';var _0x3e9c72='';return db[_0xce2e('0x2e')]['findOne']({'where':{'id':_0x573f10[_0xce2e('0x46')]['id']},'attributes':['id',_0xce2e('0x57'),_0xce2e('0x58'),_0xce2e('0x59')]})[_0xce2e('0x28')](handleEntityNotFound(_0x1c0f4b,null))[_0xce2e('0x28')](function(_0x89a5f1){if(_0x89a5f1){_0x3e9c72=_0x89a5f1[_0xce2e('0x57')];_0x153aea=_0x89a5f1['remoteUri'];var _0x19e792=_0x89a5f1[_0xce2e('0x58')]['slice'](-0x1);if(_0x19e792==='/'){_0x153aea=_0x153aea[_0xce2e('0x5a')](0x0,_0x153aea['lastIndexOf'](_0x19e792));}return rp({'method':_0xce2e('0x5b'),'uri':util['format'](_0xce2e('0x5c'),_0x153aea,_0xce2e('0x5d')),'headers':{'Authorization':_0xce2e('0x5e')+_0x89a5f1[_0xce2e('0x59')]},'json':!![]});}})[_0xce2e('0x28')](function(_0x294d23){if(_0x294d23){var _0x49d55b=_0x294d23['users'];var _0x34f7b4=![];var _0x587ee0=null;for(_0x587ee0=0x0;_0x587ee0<_0x49d55b[_0xce2e('0x50')];_0x587ee0++){if(_0x49d55b[_0x587ee0][_0xce2e('0x5f')]===_0x3e9c72){_0x34f7b4=!![];}}if(_0x34f7b4){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})['then'](respondWithResult(_0x1c0f4b,null))[_0xce2e('0x44')](function(_0x149b6d){var _0x3bfa9f=_0x573f10['query'][_0xce2e('0x60')]?0x1f4:_0x149b6d[_0xce2e('0x61')]||0x1f4;logger['error'](_0xce2e('0x62'),'getFields',_0x3bfa9f,JSON[_0xce2e('0x63')](_0x149b6d));delete _0x149b6d['name'];if(_0x3bfa9f===0x191){_0x3bfa9f=0x190;}_0x1c0f4b['status'](_0x3bfa9f)[_0xce2e('0x2c')](_0x573f10['query'][_0xce2e('0x60')]?{'message':'Wrong\x20credentials','statusCode':_0x149b6d['statusCode']}:_0x149b6d);});}; \ No newline at end of file +var _0xf426=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','error','name','index','FreshsalesAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','FreshsalesConfiguration','map','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','username','remoteUri','apiKey','substring','lastIndexOf','/api/selector/owners','users','email','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x26cd6a,_0x5ed59c){var _0x1ae60a=function(_0x15b311){while(--_0x15b311){_0x26cd6a['push'](_0x26cd6a['shift']());}};_0x1ae60a(++_0x5ed59c);}(_0xf426,0x168));var _0x6f42=function(_0x399bfc,_0x36d4b0){_0x399bfc=_0x399bfc-0x0;var _0x36846d=_0xf426[_0x399bfc];return _0x36846d;};'use strict';var emlformat=require(_0x6f42('0x0'));var rimraf=require(_0x6f42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f42('0x2'));var rp=require(_0x6f42('0x3'));var moment=require('moment');var BPromise=require(_0x6f42('0x4'));var Mustache=require(_0x6f42('0x5'));var util=require(_0x6f42('0x6'));var path=require(_0x6f42('0x7'));var sox=require(_0x6f42('0x8'));var csv=require(_0x6f42('0x9'));var ejs=require(_0x6f42('0xa'));var fs=require('fs');var fs_extra=require(_0x6f42('0xb'));var _=require(_0x6f42('0xc'));var squel=require('squel');var crypto=require(_0x6f42('0xd'));var jsforce=require(_0x6f42('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6f42('0x9'));var querystring=require(_0x6f42('0xf'));var Papa=require(_0x6f42('0x10'));var Redis=require(_0x6f42('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6f42('0x12'));var as=require(_0x6f42('0x13'));var hardwareService=require(_0x6f42('0x14'));var logger=require(_0x6f42('0x15'))(_0x6f42('0x16'));var utils=require(_0x6f42('0x17'));var config=require(_0x6f42('0x18'));var licenseUtil=require(_0x6f42('0x19'));var db=require(_0x6f42('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3415b0,_0x2c7897){_0x2c7897=_0x2c7897||0xcc;return function(_0x5da99b){if(_0x5da99b){return _0x3415b0[_0x6f42('0x1b')](_0x2c7897);}return _0x3415b0['status'](_0x2c7897)['end']();};}function respondWithResult(_0x3ce5ed,_0x278f61){_0x278f61=_0x278f61||0xc8;return function(_0x12419a){if(_0x12419a){return _0x3ce5ed[_0x6f42('0x1c')](_0x278f61)[_0x6f42('0x1d')](_0x12419a);}};}function respondWithFilteredResult(_0x273fca,_0x2856ce){return function(_0x2f4722){if(_0x2f4722){var _0x31d44b=typeof _0x2856ce[_0x6f42('0x1e')]===_0x6f42('0x1f')&&typeof _0x2856ce[_0x6f42('0x20')]===_0x6f42('0x1f');var _0x463123=_0x2f4722['count'];var _0xa6864b=_0x31d44b?0x0:_0x2856ce[_0x6f42('0x1e')];var _0x45629f=_0x31d44b?_0x2f4722[_0x6f42('0x21')]:_0x2856ce[_0x6f42('0x1e')]+_0x2856ce[_0x6f42('0x20')];var _0x4e8615;if(_0x45629f>=_0x463123){_0x45629f=_0x463123;_0x4e8615=0xc8;}else{_0x4e8615=0xce;}_0x273fca['status'](_0x4e8615);return _0x273fca['set'](_0x6f42('0x22'),_0xa6864b+'-'+_0x45629f+'/'+_0x463123)[_0x6f42('0x1d')](_0x2f4722);}return null;};}function patchUpdates(_0x42d158){return function(_0x52272f){try{jsonpatch['apply'](_0x52272f,_0x42d158,!![]);}catch(_0x4f89dc){return BPromise['reject'](_0x4f89dc);}return _0x52272f[_0x6f42('0x23')]();};}function saveUpdates(_0x2e9f37,_0x18be2f){return function(_0x4a8d8d){if(_0x4a8d8d){return _0x4a8d8d[_0x6f42('0x24')](_0x2e9f37)[_0x6f42('0x25')](function(_0x48837b){return _0x48837b;});}return null;};}function removeEntity(_0x3c8bc3,_0x317818){return function(_0x2cca5b){if(_0x2cca5b){return _0x2cca5b[_0x6f42('0x26')]()[_0x6f42('0x25')](function(){_0x3c8bc3[_0x6f42('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x486519,_0x4dfdbf){return function(_0x14d097){if(!_0x14d097){_0x486519[_0x6f42('0x1b')](0x194);}return _0x14d097;};}function handleError(_0x2a88cd,_0x397742){_0x397742=_0x397742||0x1f4;return function(_0x3e0882){logger[_0x6f42('0x27')](_0x3e0882['stack']);if(_0x3e0882[_0x6f42('0x28')]){delete _0x3e0882[_0x6f42('0x28')];}_0x2a88cd['status'](_0x397742)['send'](_0x3e0882);};}exports[_0x6f42('0x29')]=function(_0x1a77a7,_0x22fe3d){var _0x56dc33={},_0x548381={},_0x26069e={'count':0x0,'rows':[]};var _0x5c1d19=_['map'](db[_0x6f42('0x2a')][_0x6f42('0x2b')],function(_0x57b05f){return{'name':_0x57b05f[_0x6f42('0x2c')],'type':_0x57b05f[_0x6f42('0x2d')][_0x6f42('0x2e')]};});_0x548381['model']=_['map'](_0x5c1d19,'name');_0x548381[_0x6f42('0x2f')]=_[_0x6f42('0x30')](_0x1a77a7[_0x6f42('0x2f')]);_0x548381[_0x6f42('0x31')]=_[_0x6f42('0x32')](_0x548381['model'],_0x548381['query']);_0x56dc33[_0x6f42('0x33')]=_['intersection'](_0x548381['model'],qs[_0x6f42('0x34')](_0x1a77a7[_0x6f42('0x2f')][_0x6f42('0x34')]));_0x56dc33[_0x6f42('0x33')]=_0x56dc33[_0x6f42('0x33')]['length']?_0x56dc33[_0x6f42('0x33')]:_0x548381[_0x6f42('0x35')];if(!_0x1a77a7['query'][_0x6f42('0x36')](_0x6f42('0x37'))){_0x56dc33['limit']=qs[_0x6f42('0x20')](_0x1a77a7['query'][_0x6f42('0x20')]);_0x56dc33[_0x6f42('0x1e')]=qs[_0x6f42('0x1e')](_0x1a77a7['query']['offset']);}_0x56dc33[_0x6f42('0x38')]=qs[_0x6f42('0x39')](_0x1a77a7[_0x6f42('0x2f')][_0x6f42('0x39')]);_0x56dc33[_0x6f42('0x3a')]=qs[_0x6f42('0x31')](_[_0x6f42('0x3b')](_0x1a77a7[_0x6f42('0x2f')],_0x548381['filters']),_0x5c1d19);if(_0x1a77a7['query'][_0x6f42('0x3c')]){_0x56dc33['where']=_[_0x6f42('0x3d')](_0x56dc33['where'],{'$or':_['map'](_0x5c1d19,function(_0x1fc1c1){if(_0x1fc1c1[_0x6f42('0x2d')]!=='VIRTUAL'){var _0x2a2a17={};_0x2a2a17[_0x1fc1c1[_0x6f42('0x28')]]={'$like':'%'+_0x1a77a7['query'][_0x6f42('0x3c')]+'%'};return _0x2a2a17;}})});}_0x56dc33=_['merge']({},_0x56dc33,_0x1a77a7[_0x6f42('0x3e')]);var _0x427a30={'where':_0x56dc33['where']};return db[_0x6f42('0x2a')]['count'](_0x427a30)[_0x6f42('0x25')](function(_0x227d2e){_0x26069e['count']=_0x227d2e;if(_0x1a77a7[_0x6f42('0x2f')]['includeAll']){_0x56dc33[_0x6f42('0x3f')]=[{'all':!![]}];}return db[_0x6f42('0x2a')][_0x6f42('0x40')](_0x56dc33);})[_0x6f42('0x25')](function(_0x3656f2){_0x26069e[_0x6f42('0x41')]=_0x3656f2;return _0x26069e;})[_0x6f42('0x25')](respondWithFilteredResult(_0x22fe3d,_0x56dc33))[_0x6f42('0x42')](handleError(_0x22fe3d,null));};exports['show']=function(_0x11a392,_0x437eb7){var _0x7ec6c1={'raw':![],'where':{'id':_0x11a392[_0x6f42('0x43')]['id']}},_0x40b107={};_0x40b107['model']=_[_0x6f42('0x30')](db[_0x6f42('0x2a')]['rawAttributes']);_0x40b107['query']=_[_0x6f42('0x30')](_0x11a392['query']);_0x40b107[_0x6f42('0x31')]=_[_0x6f42('0x32')](_0x40b107['model'],_0x40b107[_0x6f42('0x2f')]);_0x7ec6c1[_0x6f42('0x33')]=_['intersection'](_0x40b107[_0x6f42('0x35')],qs[_0x6f42('0x34')](_0x11a392[_0x6f42('0x2f')]['fields']));_0x7ec6c1['attributes']=_0x7ec6c1[_0x6f42('0x33')][_0x6f42('0x44')]?_0x7ec6c1[_0x6f42('0x33')]:_0x40b107[_0x6f42('0x35')];if(_0x11a392[_0x6f42('0x2f')]['includeAll']){_0x7ec6c1[_0x6f42('0x3f')]=[{'all':!![]}];}_0x7ec6c1=_[_0x6f42('0x3d')]({},_0x7ec6c1,_0x11a392[_0x6f42('0x3e')]);return db[_0x6f42('0x2a')][_0x6f42('0x45')](_0x7ec6c1)[_0x6f42('0x25')](handleEntityNotFound(_0x437eb7,null))[_0x6f42('0x25')](respondWithResult(_0x437eb7,null))[_0x6f42('0x42')](handleError(_0x437eb7,null));};exports[_0x6f42('0x46')]=function(_0x2b09a1,_0x37a2c0){return db['FreshsalesAccount']['create'](_0x2b09a1[_0x6f42('0x47')],{})[_0x6f42('0x25')](respondWithResult(_0x37a2c0,0xc9))[_0x6f42('0x42')](handleError(_0x37a2c0,null));};exports['update']=function(_0x52bed3,_0x143b18){if(_0x52bed3[_0x6f42('0x47')]['id']){delete _0x52bed3[_0x6f42('0x47')]['id'];}return db['FreshsalesAccount'][_0x6f42('0x45')]({'where':{'id':_0x52bed3[_0x6f42('0x43')]['id']}})[_0x6f42('0x25')](handleEntityNotFound(_0x143b18,null))['then'](saveUpdates(_0x52bed3[_0x6f42('0x47')],null))['then'](respondWithResult(_0x143b18,null))['catch'](handleError(_0x143b18,null));};exports[_0x6f42('0x26')]=function(_0x3e7664,_0x53ccb4){return db[_0x6f42('0x2a')][_0x6f42('0x45')]({'where':{'id':_0x3e7664[_0x6f42('0x43')]['id']}})[_0x6f42('0x25')](handleEntityNotFound(_0x53ccb4,null))[_0x6f42('0x25')](removeEntity(_0x53ccb4,null))['catch'](handleError(_0x53ccb4,null));};exports[_0x6f42('0x48')]=function(_0x457199,_0x481d22,_0x206fa9){var _0x3d3ab6={};var _0x1c80ea={};var _0x1b508a;var _0x5a40dc;return db[_0x6f42('0x2a')]['findOne']({'where':{'id':_0x457199['params']['id']}})[_0x6f42('0x25')](handleEntityNotFound(_0x481d22,null))['then'](function(_0x18d8a7){if(_0x18d8a7){_0x1b508a=_0x18d8a7;_0x1c80ea['model']=_[_0x6f42('0x30')](db[_0x6f42('0x49')][_0x6f42('0x2b')]);_0x1c80ea[_0x6f42('0x2f')]=_[_0x6f42('0x30')](_0x457199['query']);_0x1c80ea[_0x6f42('0x31')]=_[_0x6f42('0x32')](_0x1c80ea['model'],_0x1c80ea['query']);_0x3d3ab6['attributes']=_['intersection'](_0x1c80ea[_0x6f42('0x35')],qs[_0x6f42('0x34')](_0x457199[_0x6f42('0x2f')][_0x6f42('0x34')]));_0x3d3ab6[_0x6f42('0x33')]=_0x3d3ab6['attributes']['length']?_0x3d3ab6['attributes']:_0x1c80ea[_0x6f42('0x35')];_0x3d3ab6[_0x6f42('0x38')]=qs[_0x6f42('0x39')](_0x457199['query'][_0x6f42('0x39')]);_0x3d3ab6[_0x6f42('0x3a')]=qs['filters'](_[_0x6f42('0x3b')](_0x457199[_0x6f42('0x2f')],_0x1c80ea['filters']));if(_0x457199[_0x6f42('0x2f')][_0x6f42('0x3c')]){_0x3d3ab6[_0x6f42('0x3a')]=_[_0x6f42('0x3d')](_0x3d3ab6['where'],{'$or':_[_0x6f42('0x4a')](_0x3d3ab6[_0x6f42('0x33')],function(_0x1f6532){var _0x5c3623={};_0x5c3623[_0x1f6532]={'$like':'%'+_0x457199[_0x6f42('0x2f')]['filter']+'%'};return _0x5c3623;})});}_0x3d3ab6=_[_0x6f42('0x3d')]({},_0x3d3ab6,_0x457199[_0x6f42('0x3e')]);return _0x1b508a[_0x6f42('0x48')](_0x3d3ab6);}})[_0x6f42('0x25')](function(_0x321298){if(_0x321298){_0x5a40dc=_0x321298[_0x6f42('0x44')];if(!_0x457199[_0x6f42('0x2f')][_0x6f42('0x36')](_0x6f42('0x37'))){_0x3d3ab6[_0x6f42('0x20')]=qs[_0x6f42('0x20')](_0x457199[_0x6f42('0x2f')][_0x6f42('0x20')]);_0x3d3ab6['offset']=qs[_0x6f42('0x1e')](_0x457199[_0x6f42('0x2f')]['offset']);}return _0x1b508a['getConfigurations'](_0x3d3ab6);}})['then'](function(_0x1e5b7a){if(_0x1e5b7a){return _0x1e5b7a?{'count':_0x5a40dc,'rows':_0x1e5b7a}:null;}})[_0x6f42('0x25')](respondWithResult(_0x481d22,null))[_0x6f42('0x42')](handleError(_0x481d22,null));};exports['addConfiguration']=function(_0x123188,_0x384761,_0x14673f){if(_0x123188[_0x6f42('0x47')]['id']){delete _0x123188['body']['id'];}return db[_0x6f42('0x2a')][_0x6f42('0x4b')]({'where':{'id':_0x123188[_0x6f42('0x43')]['id']}})[_0x6f42('0x25')](handleEntityNotFound(_0x384761,null))['then'](function(_0x5b64f0){if(_0x5b64f0){_0x123188[_0x6f42('0x47')][_0x6f42('0x4c')]=_0x5b64f0['id'];_0x123188['body'][_0x6f42('0x4d')]=integrations[_0x6f42('0x4e')](_0x123188[_0x6f42('0x47')][_0x6f42('0x4f')],_0x123188[_0x6f42('0x47')][_0x6f42('0x2d')]);_0x123188[_0x6f42('0x47')][_0x6f42('0x50')]=integrations['getDescriptions'](_0x123188[_0x6f42('0x47')]['channel'],_0x123188[_0x6f42('0x47')][_0x6f42('0x2d')]);return db['FreshsalesConfiguration'][_0x6f42('0x46')](_0x123188[_0x6f42('0x47')],{'include':[{'model':db[_0x6f42('0x51')],'as':_0x6f42('0x4d')},{'model':db[_0x6f42('0x51')],'as':_0x6f42('0x50')}]});}return null;})[_0x6f42('0x25')](respondWithResult(_0x384761,null))['catch'](handleError(_0x384761,null));};exports[_0x6f42('0x52')]=function(_0x140569,_0x90171d,_0x4e0034){var _0x5926c8='';var _0x1e87c4='';return db[_0x6f42('0x2a')]['findOne']({'where':{'id':_0x140569[_0x6f42('0x43')]['id']},'attributes':['id',_0x6f42('0x53'),_0x6f42('0x54'),_0x6f42('0x55')]})[_0x6f42('0x25')](handleEntityNotFound(_0x90171d,null))['then'](function(_0x5902f0){if(_0x5902f0){_0x1e87c4=_0x5902f0[_0x6f42('0x53')];_0x5926c8=_0x5902f0[_0x6f42('0x54')];var _0xfda9a7=_0x5902f0[_0x6f42('0x54')]['slice'](-0x1);if(_0xfda9a7==='/'){_0x5926c8=_0x5926c8[_0x6f42('0x56')](0x0,_0x5926c8[_0x6f42('0x57')](_0xfda9a7));}return rp({'method':'GET','uri':util['format']('%s%s',_0x5926c8,_0x6f42('0x58')),'headers':{'Authorization':'Token\x20token='+_0x5902f0[_0x6f42('0x55')]},'json':!![]});}})[_0x6f42('0x25')](function(_0x6ca59f){if(_0x6ca59f){var _0x176937=_0x6ca59f[_0x6f42('0x59')];var _0x48c870=![];var _0x3e33ef=null;for(_0x3e33ef=0x0;_0x3e33ef<_0x176937[_0x6f42('0x44')];_0x3e33ef++){if(_0x176937[_0x3e33ef][_0x6f42('0x5a')]===_0x1e87c4){_0x48c870=!![];}}if(_0x48c870){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x6f42('0x25')](respondWithResult(_0x90171d,null))[_0x6f42('0x42')](function(_0x37f05a){var _0x5f31ca=_0x140569[_0x6f42('0x2f')][_0x6f42('0x5b')]?0x1f4:_0x37f05a['statusCode']||0x1f4;logger[_0x6f42('0x27')](_0x6f42('0x5c'),_0x6f42('0x52'),_0x5f31ca,JSON[_0x6f42('0x5d')](_0x37f05a));delete _0x37f05a[_0x6f42('0x28')];if(_0x5f31ca===0x191){_0x5f31ca=0x190;}_0x90171d[_0x6f42('0x1c')](_0x5f31ca)['send'](_0x140569[_0x6f42('0x2f')][_0x6f42('0x5b')]?{'message':'Wrong\x20credentials','statusCode':_0x37f05a[_0x6f42('0x5e')]}:_0x37f05a);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 8c9a78e..5aa68a3 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 _0x6343=['../../components/integrations/configuration','exports','define','../../config/logger','api','rimraf','../../config/environment'];(function(_0xe5e3d3,_0x4db18c){var _0x507e53=function(_0x5ecea9){while(--_0x5ecea9){_0xe5e3d3['push'](_0xe5e3d3['shift']());}};_0x507e53(++_0x4db18c);}(_0x6343,0x168));var _0x3634=function(_0x3002a2,_0x5f3752){_0x3002a2=_0x3002a2-0x0;var _0x463ace=_0x6343[_0x3002a2];return _0x463ace;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3634('0x0'))(_0x3634('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(_0x3634('0x2'));var config=require(_0x3634('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x3634('0x4'));module[_0x3634('0x5')]=function(_0x4bb496,_0x302828){return _0x4bb496[_0x3634('0x6')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7278=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53aab7,_0x216e7a){var _0x19ea6b=function(_0x46ac91){while(--_0x46ac91){_0x53aab7['push'](_0x53aab7['shift']());}};_0x19ea6b(++_0x216e7a);}(_0x7278,0x161));var _0x8727=function(_0xcd5616,_0x2b0cb3){_0xcd5616=_0xcd5616-0x0;var _0x23edb6=_0x7278[_0xcd5616];return _0x23edb6;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));var integrations=require(_0x8727('0xa'));module[_0x8727('0xb')]=function(_0x5549d5,_0xfd1902){return _0x5549d5[_0x8727('0xc')](_0x8727('0xd'),attributes,{'tableName':_0x8727('0xe'),'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 804a196..5a3e350 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 _0x6343=['attributes','map','GetFreshsalesAccount','stringify','ShowFreshsalesAccount','find','where','debug','moment','bluebird','../../config/logger','rpc','jayson/promise','client','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','FreshsalesAccount','findAll','options','raw','limit','include','model'];(function(_0x527e1f,_0x271a21){var _0x3885bd=function(_0x5b23cb){while(--_0x5b23cb){_0x527e1f['push'](_0x527e1f['shift']());}};_0x3885bd(++_0x271a21);}(_0x6343,0x168));var _0x3634=function(_0xe90eba,_0x2ceb4b){_0xe90eba=_0xe90eba-0x0;var _0x11a424=_0x6343[_0xe90eba];return _0x11a424;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3634('0x0'));var BPromise=require(_0x3634('0x1'));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(_0x3634('0x2'))(_0x3634('0x3'));var config=require('../../config/environment');var jayson=require(_0x3634('0x4'));var client=jayson[_0x3634('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x302828,_0xd40513,_0x4e6d71){return new BPromise(function(_0x5affba,_0x19170a){return client[_0x3634('0x6')](_0x302828,_0x4e6d71)[_0x3634('0x7')](function(_0x3c813b){logger[_0x3634('0x8')](_0x3634('0x9'),_0xd40513,'request\x20sent');logger['debug'](_0x3634('0xa'),_0xd40513,_0x3634('0xb'),JSON['stringify'](_0x3c813b));if(_0x3c813b[_0x3634('0xc')]){if(_0x3c813b[_0x3634('0xc')][_0x3634('0xd')]===0x1f4){logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x19170a(_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);}logger[_0x3634('0xc')](_0x3634('0x9'),_0xd40513,_0x3c813b[_0x3634('0xc')][_0x3634('0xe')]);return _0x5affba(_0x3c813b[_0x3634('0xc')]['message']);}else{logger[_0x3634('0x8')]('FreshsalesAccount,\x20%s,\x20%s',_0xd40513,_0x3634('0xb'));_0x5affba(_0x3c813b[_0x3634('0xf')][_0x3634('0xe')]);}})[_0x3634('0x10')](function(_0x91061e){logger['error'](_0x3634('0x9'),_0xd40513,_0x91061e);_0x19170a(_0x91061e);});});}exports['GetFreshsalesAccount']=function(_0x50350d){var _0x2aaac7=this;return new Promise(function(_0x4b2115,_0x2fac8b){return db[_0x3634('0x11')][_0x3634('0x12')]({'raw':_0x50350d['options']?_0x50350d[_0x3634('0x13')][_0x3634('0x14')]===undefined?!![]:![]:!![],'where':_0x50350d['options']?_0x50350d[_0x3634('0x13')]['where']||null:null,'attributes':_0x50350d[_0x3634('0x13')]?_0x50350d[_0x3634('0x13')]['attributes']||null:null,'limit':_0x50350d[_0x3634('0x13')]?_0x50350d[_0x3634('0x13')][_0x3634('0x15')]||null:null,'include':_0x50350d['options']?_0x50350d[_0x3634('0x13')][_0x3634('0x16')]?_['map'](_0x50350d[_0x3634('0x13')]['include'],function(_0x5e9188){return{'model':db[_0x5e9188[_0x3634('0x17')]],'as':_0x5e9188['as'],'attributes':_0x5e9188[_0x3634('0x18')],'include':_0x5e9188['include']?_[_0x3634('0x19')](_0x5e9188[_0x3634('0x16')],function(_0x17db44){return{'model':db[_0x17db44[_0x3634('0x17')]],'as':_0x17db44['as'],'attributes':_0x17db44[_0x3634('0x18')],'include':_0x17db44[_0x3634('0x16')]?_[_0x3634('0x19')](_0x17db44[_0x3634('0x16')],function(_0x22f1f1){return{'model':db[_0x22f1f1['model']],'as':_0x22f1f1['as'],'attributes':_0x22f1f1[_0x3634('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x58841d){logger['info'](_0x3634('0x1a'),_0x50350d);logger['debug'](_0x3634('0x1a'),_0x50350d,JSON[_0x3634('0x1b')](_0x58841d));_0x4b2115(_0x58841d);})['catch'](function(_0x55a77f){logger[_0x3634('0xc')]('GetFreshsalesAccount',_0x55a77f[_0x3634('0xe')],_0x50350d);_0x2fac8b(_0x2aaac7['error'](0x1f4,_0x55a77f[_0x3634('0xe')]));});});};exports[_0x3634('0x1c')]=function(_0x1d88f7){var _0x17a0fd=this;return new Promise(function(_0x1f46d9,_0x20b062){return db[_0x3634('0x11')][_0x3634('0x1d')]({'raw':_0x1d88f7['options']?_0x1d88f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7['options'][_0x3634('0x1e')]||null:null,'attributes':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7[_0x3634('0x13')][_0x3634('0x18')]||null:null,'include':_0x1d88f7[_0x3634('0x13')]?_0x1d88f7[_0x3634('0x13')]['include']?_[_0x3634('0x19')](_0x1d88f7[_0x3634('0x13')][_0x3634('0x16')],function(_0x1b686c){return{'model':db[_0x1b686c[_0x3634('0x17')]],'as':_0x1b686c['as'],'attributes':_0x1b686c[_0x3634('0x18')],'include':_0x1b686c[_0x3634('0x16')]?_[_0x3634('0x19')](_0x1b686c[_0x3634('0x16')],function(_0x598c7e){return{'model':db[_0x598c7e[_0x3634('0x17')]],'as':_0x598c7e['as'],'attributes':_0x598c7e[_0x3634('0x18')],'include':_0x598c7e[_0x3634('0x16')]?_[_0x3634('0x19')](_0x598c7e['include'],function(_0x149840){return{'model':db[_0x149840[_0x3634('0x17')]],'as':_0x149840['as'],'attributes':_0x149840[_0x3634('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5efd00){logger['info'](_0x3634('0x1c'),_0x1d88f7);logger[_0x3634('0x1f')]('ShowFreshsalesAccount',_0x1d88f7,JSON[_0x3634('0x1b')](_0x5efd00));_0x1f46d9(_0x5efd00);})[_0x3634('0x10')](function(_0x105507){logger[_0x3634('0xc')](_0x3634('0x1c'),_0x105507[_0x3634('0xe')],_0x1d88f7);_0x20b062(_0x17a0fd[_0x3634('0xc')](0x1f4,_0x105507['message']));});});}; \ No newline at end of file +var _0xd943=['limit','include','map','model','attributes','debug','ShowFreshsalesAccount','find','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where'];(function(_0x3ef45e,_0xe84f33){var _0x69e7c=function(_0x43ba11){while(--_0x43ba11){_0x3ef45e['push'](_0x3ef45e['shift']());}};_0x69e7c(++_0xe84f33);}(_0xd943,0x15d));var _0x3d94=function(_0x3bcfff,_0x2a4cef){_0x3bcfff=_0x3bcfff-0x0;var _0x4df7f9=_0xd943[_0x3bcfff];return _0x4df7f9;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}exports[_0x3d94('0x14')]=function(_0x2acee3){var _0x1c35a8=this;return new Promise(function(_0x4afc92,_0x3ca0e3){return db[_0x3d94('0x15')]['findAll']({'raw':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options'][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x18')]||null:null,'attributes':_0x2acee3[_0x3d94('0x16')]?_0x2acee3['options']['attributes']||null:null,'limit':_0x2acee3[_0x3d94('0x16')]?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x19')]||null:null,'include':_0x2acee3['options']?_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x2acee3[_0x3d94('0x16')][_0x3d94('0x1a')],function(_0x4093a4){return{'model':db[_0x4093a4[_0x3d94('0x1c')]],'as':_0x4093a4['as'],'attributes':_0x4093a4[_0x3d94('0x1d')],'include':_0x4093a4[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4093a4[_0x3d94('0x1a')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1c')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1d')],'include':_0x192839[_0x3d94('0x1a')]?_['map'](_0x192839[_0x3d94('0x1a')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1c')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xa')](function(_0x439173){logger[_0x3d94('0xb')](_0x3d94('0x14'),_0x2acee3);logger[_0x3d94('0x1e')]('GetFreshsalesAccount',_0x2acee3,JSON['stringify'](_0x439173));_0x4afc92(_0x439173);})[_0x3d94('0x13')](function(_0x4813e1){logger['error'](_0x3d94('0x14'),_0x4813e1['message'],_0x2acee3);_0x3ca0e3(_0x1c35a8[_0x3d94('0xe')](0x1f4,_0x4813e1[_0x3d94('0x11')]));});});};exports[_0x3d94('0x1f')]=function(_0x4cef9c){var _0x2a07b4=this;return new Promise(function(_0x4c1237,_0x3d4994){return db['FreshsalesAccount'][_0x3d94('0x20')]({'raw':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x17')]===undefined?!![]:![]:!![],'where':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')]['where']||null:null,'attributes':_0x4cef9c[_0x3d94('0x16')]?_0x4cef9c[_0x3d94('0x16')]['attributes']||null:null,'include':_0x4cef9c['options']?_0x4cef9c[_0x3d94('0x16')][_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x4cef9c['options'][_0x3d94('0x1a')],function(_0x3d29fd){return{'model':db[_0x3d29fd['model']],'as':_0x3d29fd['as'],'attributes':_0x3d29fd[_0x3d94('0x1d')],'include':_0x3d29fd[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x3d29fd[_0x3d94('0x1a')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1d')],'include':_0x782c1[_0x3d94('0x1a')]?_[_0x3d94('0x1b')](_0x782c1[_0x3d94('0x1a')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1c')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xfe58eb){logger[_0x3d94('0xb')](_0x3d94('0x1f'),_0x4cef9c);logger[_0x3d94('0x1e')](_0x3d94('0x1f'),_0x4cef9c,JSON[_0x3d94('0x21')](_0xfe58eb));_0x4c1237(_0xfe58eb);})[_0x3d94('0x13')](function(_0x12c01a){logger[_0x3d94('0xe')](_0x3d94('0x1f'),_0x12c01a['message'],_0x4cef9c);_0x3d4994(_0x2a07b4[_0x3d94('0xe')](0x1f4,_0x12c01a[_0x3d94('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e1b65ba..93c9156 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 _0x5b6c=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0xdc7170,_0x571276){var _0x9e8216=function(_0x4ebfbc){while(--_0x4ebfbc){_0xdc7170['push'](_0xdc7170['shift']());}};_0x9e8216(++_0x571276);}(_0x5b6c,0x8f));var _0xc5b6=function(_0xfa634c,_0x414e0e){_0xfa634c=_0xfa634c-0x0;var _0x73e478=_0x5b6c[_0xfa634c];return _0x73e478;};'use strict';var multer=require(_0xc5b6('0x0'));var util=require(_0xc5b6('0x1'));var path=require(_0xc5b6('0x2'));var timeout=require(_0xc5b6('0x3'));var express=require(_0xc5b6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc5b6('0x5'));var config=require(_0xc5b6('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xc5b6('0x7')]('/',auth['isAuthenticated'](),controller[_0xc5b6('0x8')]);router[_0xc5b6('0x7')]('/:id',auth[_0xc5b6('0x9')](),controller[_0xc5b6('0xa')]);router['get'](_0xc5b6('0xb'),auth[_0xc5b6('0x9')](),controller['getSubjects']);router['get'](_0xc5b6('0xc'),auth[_0xc5b6('0x9')](),controller[_0xc5b6('0xd')]);router[_0xc5b6('0x7')](_0xc5b6('0xe'),auth[_0xc5b6('0x9')](),controller[_0xc5b6('0xf')]);router[_0xc5b6('0x10')]('/',auth[_0xc5b6('0x9')](),controller[_0xc5b6('0x11')]);router[_0xc5b6('0x12')](_0xc5b6('0x13'),auth[_0xc5b6('0x9')](),controller[_0xc5b6('0x14')]);router[_0xc5b6('0x15')](_0xc5b6('0x13'),auth['isAuthenticated'](),controller[_0xc5b6('0x16')]);module[_0xc5b6('0x17')]=router; \ No newline at end of file +var _0xe98d=['express','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','/:id','isAuthenticated','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','create','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x45d9bb,_0x2c0350){var _0x1a36e9=function(_0x643803){while(--_0x643803){_0x45d9bb['push'](_0x45d9bb['shift']());}};_0x1a36e9(++_0x2c0350);}(_0xe98d,0xb4));var _0xde98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe98d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde98('0x0'));var util=require(_0xde98('0x1'));var path=require(_0xde98('0x2'));var timeout=require(_0xde98('0x3'));var express=require(_0xde98('0x4'));var router=express[_0xde98('0x5')]();var fs_extra=require(_0xde98('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xde98('0x7'));var config=require('../../config/environment');var controller=require(_0xde98('0x8'));router[_0xde98('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xde98('0x9')](_0xde98('0xa'),auth[_0xde98('0xb')](),controller[_0xde98('0xc')]);router['get'](_0xde98('0xd'),auth['isAuthenticated'](),controller[_0xde98('0xe')]);router[_0xde98('0x9')]('/:id/descriptions',auth[_0xde98('0xb')](),controller[_0xde98('0xf')]);router[_0xde98('0x9')](_0xde98('0x10'),auth['isAuthenticated'](),controller[_0xde98('0x11')]);router['post']('/',auth[_0xde98('0xb')](),controller[_0xde98('0x12')]);router[_0xde98('0x13')](_0xde98('0xa'),auth['isAuthenticated'](),controller[_0xde98('0x14')]);router['delete'](_0xde98('0xa'),auth[_0xde98('0xb')](),controller[_0xde98('0x15')]);module[_0xde98('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index f422a7c..1724b58 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 _0x9d91=['STRING','sequelize','exports'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x9d91,0x1ea));var _0x19d9=function(_0x4158e5,_0xf23d0){_0x4158e5=_0x4158e5-0x0;var _0x398647=_0x9d91[_0x4158e5];return _0x398647;};'use strict';var Sequelize=require(_0x19d9('0x0'));module[_0x19d9('0x1')]={'name':{'type':Sequelize[_0x19d9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf05b=['exports','STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf05b,0x1f4));var _0xbf05=function(_0x1c3c15,_0x226363){_0x1c3c15=_0x1c3c15-0x0;var _0x57a555=_0xf05b[_0x1c3c15];return _0x57a555;};'use strict';var Sequelize=require(_0xbf05('0x0'));module[_0xbf05('0x1')]={'name':{'type':Sequelize[_0xbf05('0x2')]},'description':{'type':Sequelize[_0xbf05('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0e92553..f602344 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 _0x0d87=['limit','undefined','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','getSubjects','findOne','FreshsalesField','order','options','hasOwnProperty','getDescriptions','getFields','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x368b4c,_0x5d1435){var _0x1a6022=function(_0x8f6c90){while(--_0x8f6c90){_0x368b4c['push'](_0x368b4c['shift']());}};_0x1a6022(++_0x5d1435);}(_0x0d87,0x83));var _0x70d8=function(_0x228a97,_0x254113){_0x228a97=_0x228a97-0x0;var _0x39379f=_0x0d87[_0x228a97];return _0x39379f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x70d8('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x70d8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x70d8('0x2'));var util=require(_0x70d8('0x3'));var path=require('path');var sox=require(_0x70d8('0x4'));var csv=require(_0x70d8('0x5'));var ejs=require(_0x70d8('0x6'));var fs=require('fs');var fs_extra=require(_0x70d8('0x7'));var _=require('lodash');var squel=require(_0x70d8('0x8'));var crypto=require('crypto');var jsforce=require(_0x70d8('0x9'));var deskjs=require(_0x70d8('0xa'));var toCsv=require(_0x70d8('0x5'));var querystring=require(_0x70d8('0xb'));var Papa=require(_0x70d8('0xc'));var Redis=require(_0x70d8('0xd'));var authService=require(_0x70d8('0xe'));var qs=require(_0x70d8('0xf'));var as=require(_0x70d8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70d8('0x11'))(_0x70d8('0x12'));var utils=require('../../config/utils');var config=require(_0x70d8('0x13'));var licenseUtil=require(_0x70d8('0x14'));var db=require(_0x70d8('0x15'))['db'];function respondWithStatusCode(_0x2d0445,_0x34033f){_0x34033f=_0x34033f||0xcc;return function(_0x3433aa){if(_0x3433aa){return _0x2d0445[_0x70d8('0x16')](_0x34033f);}return _0x2d0445[_0x70d8('0x17')](_0x34033f)[_0x70d8('0x18')]();};}function respondWithResult(_0x4bf746,_0x3e9705){_0x3e9705=_0x3e9705||0xc8;return function(_0x54c272){if(_0x54c272){return _0x4bf746[_0x70d8('0x17')](_0x3e9705)[_0x70d8('0x19')](_0x54c272);}};}function respondWithFilteredResult(_0x6629a3,_0x35bf0b){return function(_0xe5b243){if(_0xe5b243){var _0xb4bf57=typeof _0x35bf0b[_0x70d8('0x1a')]==='undefined'&&typeof _0x35bf0b[_0x70d8('0x1b')]===_0x70d8('0x1c');var _0x1d11bf=_0xe5b243['count'];var _0x416b2a=_0xb4bf57?0x0:_0x35bf0b[_0x70d8('0x1a')];var _0x438268=_0xb4bf57?_0xe5b243[_0x70d8('0x1d')]:_0x35bf0b[_0x70d8('0x1a')]+_0x35bf0b[_0x70d8('0x1b')];var _0x49e049;if(_0x438268>=_0x1d11bf){_0x438268=_0x1d11bf;_0x49e049=0xc8;}else{_0x49e049=0xce;}_0x6629a3[_0x70d8('0x17')](_0x49e049);return _0x6629a3[_0x70d8('0x1e')](_0x70d8('0x1f'),_0x416b2a+'-'+_0x438268+'/'+_0x1d11bf)[_0x70d8('0x19')](_0xe5b243);}return null;};}function patchUpdates(_0x592994){return function(_0x136e6c){try{jsonpatch['apply'](_0x136e6c,_0x592994,!![]);}catch(_0x242473){return BPromise[_0x70d8('0x20')](_0x242473);}return _0x136e6c[_0x70d8('0x21')]();};}function saveUpdates(_0x1ef562,_0x2666af){return function(_0xafa250){if(_0xafa250){return _0xafa250['update'](_0x1ef562)[_0x70d8('0x22')](function(_0x5033d6){return _0x5033d6;});}return null;};}function removeEntity(_0x5b4fba,_0x3b7537){return function(_0x4b29eb){if(_0x4b29eb){return _0x4b29eb[_0x70d8('0x23')]()[_0x70d8('0x22')](function(){_0x5b4fba[_0x70d8('0x17')](0xcc)[_0x70d8('0x18')]();});}};}function handleEntityNotFound(_0x1e4867,_0x1f4c06){return function(_0x550c9e){if(!_0x550c9e){_0x1e4867['sendStatus'](0x194);}return _0x550c9e;};}function handleError(_0x19d6b7,_0x1fa23a){_0x1fa23a=_0x1fa23a||0x1f4;return function(_0x4b7008){logger[_0x70d8('0x24')](_0x4b7008[_0x70d8('0x25')]);if(_0x4b7008[_0x70d8('0x26')]){delete _0x4b7008[_0x70d8('0x26')];}_0x19d6b7['status'](_0x1fa23a)[_0x70d8('0x27')](_0x4b7008);};}exports[_0x70d8('0x28')]=function(_0x343847,_0x57c416){var _0x564db7={},_0x4456ed={},_0x85227a={'count':0x0,'rows':[]};var _0x2b44fa=_['map'](db[_0x70d8('0x29')][_0x70d8('0x2a')],function(_0x13ab24){return{'name':_0x13ab24[_0x70d8('0x2b')],'type':_0x13ab24[_0x70d8('0x2c')]['key']};});_0x4456ed[_0x70d8('0x2d')]=_['map'](_0x2b44fa,'name');_0x4456ed[_0x70d8('0x2e')]=_[_0x70d8('0x2f')](_0x343847[_0x70d8('0x2e')]);_0x4456ed[_0x70d8('0x30')]=_[_0x70d8('0x31')](_0x4456ed[_0x70d8('0x2d')],_0x4456ed['query']);_0x564db7[_0x70d8('0x32')]=_['intersection'](_0x4456ed[_0x70d8('0x2d')],qs['fields'](_0x343847[_0x70d8('0x2e')][_0x70d8('0x33')]));_0x564db7['attributes']=_0x564db7[_0x70d8('0x32')][_0x70d8('0x34')]?_0x564db7[_0x70d8('0x32')]:_0x4456ed[_0x70d8('0x2d')];if(!_0x343847[_0x70d8('0x2e')]['hasOwnProperty'](_0x70d8('0x35'))){_0x564db7['limit']=qs[_0x70d8('0x1b')](_0x343847[_0x70d8('0x2e')][_0x70d8('0x1b')]);_0x564db7['offset']=qs[_0x70d8('0x1a')](_0x343847[_0x70d8('0x2e')][_0x70d8('0x1a')]);}_0x564db7['order']=qs['sort'](_0x343847[_0x70d8('0x2e')][_0x70d8('0x36')]);_0x564db7[_0x70d8('0x37')]=qs[_0x70d8('0x30')](_[_0x70d8('0x38')](_0x343847['query'],_0x4456ed[_0x70d8('0x30')]),_0x2b44fa);if(_0x343847['query'][_0x70d8('0x39')]){_0x564db7['where']=_[_0x70d8('0x3a')](_0x564db7[_0x70d8('0x37')],{'$or':_[_0x70d8('0x3b')](_0x2b44fa,function(_0x565045){if(_0x565045[_0x70d8('0x2c')]!=='VIRTUAL'){var _0x5290fe={};_0x5290fe[_0x565045[_0x70d8('0x26')]]={'$like':'%'+_0x343847[_0x70d8('0x2e')][_0x70d8('0x39')]+'%'};return _0x5290fe;}})});}_0x564db7=_[_0x70d8('0x3a')]({},_0x564db7,_0x343847['options']);var _0x9bf175={'where':_0x564db7['where']};return db[_0x70d8('0x29')][_0x70d8('0x1d')](_0x9bf175)[_0x70d8('0x22')](function(_0x516668){_0x85227a[_0x70d8('0x1d')]=_0x516668;if(_0x343847['query'][_0x70d8('0x3c')]){_0x564db7['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x70d8('0x3d')](_0x564db7);})[_0x70d8('0x22')](function(_0x1d43f9){_0x85227a[_0x70d8('0x3e')]=_0x1d43f9;return _0x85227a;})[_0x70d8('0x22')](respondWithFilteredResult(_0x57c416,_0x564db7))[_0x70d8('0x3f')](handleError(_0x57c416,null));};exports[_0x70d8('0x40')]=function(_0x15e5e8,_0x1f2c91){var _0x11d909={'raw':![],'where':{'id':_0x15e5e8[_0x70d8('0x41')]['id']}},_0x162927={};_0x162927[_0x70d8('0x2d')]=_[_0x70d8('0x2f')](db[_0x70d8('0x29')][_0x70d8('0x2a')]);_0x162927[_0x70d8('0x2e')]=_[_0x70d8('0x2f')](_0x15e5e8[_0x70d8('0x2e')]);_0x162927['filters']=_[_0x70d8('0x31')](_0x162927[_0x70d8('0x2d')],_0x162927['query']);_0x11d909['attributes']=_['intersection'](_0x162927[_0x70d8('0x2d')],qs[_0x70d8('0x33')](_0x15e5e8['query'][_0x70d8('0x33')]));_0x11d909['attributes']=_0x11d909[_0x70d8('0x32')][_0x70d8('0x34')]?_0x11d909[_0x70d8('0x32')]:_0x162927[_0x70d8('0x2d')];if(_0x15e5e8[_0x70d8('0x2e')][_0x70d8('0x3c')]){_0x11d909[_0x70d8('0x42')]=[{'all':!![]}];}_0x11d909=_[_0x70d8('0x3a')]({},_0x11d909,_0x15e5e8['options']);return db[_0x70d8('0x29')][_0x70d8('0x43')](_0x11d909)[_0x70d8('0x22')](handleEntityNotFound(_0x1f2c91,null))[_0x70d8('0x22')](respondWithResult(_0x1f2c91,null))[_0x70d8('0x3f')](handleError(_0x1f2c91,null));};exports[_0x70d8('0x44')]=function(_0x2e09bd,_0x38fff9){return db[_0x70d8('0x29')]['create'](_0x2e09bd[_0x70d8('0x45')],{})['then'](respondWithResult(_0x38fff9,0xc9))[_0x70d8('0x3f')](handleError(_0x38fff9,null));};exports[_0x70d8('0x46')]=function(_0x51f168,_0x5249be){if(_0x51f168[_0x70d8('0x45')]['id']){delete _0x51f168[_0x70d8('0x45')]['id'];}return db[_0x70d8('0x29')][_0x70d8('0x43')]({'where':{'id':_0x51f168['params']['id']}})[_0x70d8('0x22')](handleEntityNotFound(_0x5249be,null))[_0x70d8('0x22')](saveUpdates(_0x51f168['body'],null))[_0x70d8('0x22')](respondWithResult(_0x5249be,null))[_0x70d8('0x3f')](handleError(_0x5249be,null));};exports['destroy']=function(_0x5dbcc0,_0x55628e){return db[_0x70d8('0x29')]['find']({'where':{'id':_0x5dbcc0[_0x70d8('0x41')]['id']}})[_0x70d8('0x22')](handleEntityNotFound(_0x55628e,null))[_0x70d8('0x22')](removeEntity(_0x55628e,null))[_0x70d8('0x3f')](handleError(_0x55628e,null));};exports[_0x70d8('0x47')]=function(_0x5e4d78,_0x3bdf18,_0x2691c9){var _0x5929c3={};var _0x25a740={};var _0x5ac4b9;var _0x24360c;return db[_0x70d8('0x29')][_0x70d8('0x48')]({'where':{'id':_0x5e4d78[_0x70d8('0x41')]['id']}})[_0x70d8('0x22')](handleEntityNotFound(_0x3bdf18,null))[_0x70d8('0x22')](function(_0x178fd4){if(_0x178fd4){_0x5ac4b9=_0x178fd4;_0x25a740['model']=_[_0x70d8('0x2f')](db[_0x70d8('0x49')][_0x70d8('0x2a')]);_0x25a740['query']=_[_0x70d8('0x2f')](_0x5e4d78[_0x70d8('0x2e')]);_0x25a740[_0x70d8('0x30')]=_[_0x70d8('0x31')](_0x25a740[_0x70d8('0x2d')],_0x25a740[_0x70d8('0x2e')]);_0x5929c3[_0x70d8('0x32')]=_[_0x70d8('0x31')](_0x25a740[_0x70d8('0x2d')],qs[_0x70d8('0x33')](_0x5e4d78[_0x70d8('0x2e')][_0x70d8('0x33')]));_0x5929c3['attributes']=_0x5929c3[_0x70d8('0x32')]['length']?_0x5929c3[_0x70d8('0x32')]:_0x25a740['model'];_0x5929c3[_0x70d8('0x4a')]=qs[_0x70d8('0x36')](_0x5e4d78['query']['sort']);_0x5929c3[_0x70d8('0x37')]=qs[_0x70d8('0x30')](_[_0x70d8('0x38')](_0x5e4d78[_0x70d8('0x2e')],_0x25a740['filters']));if(_0x5e4d78[_0x70d8('0x2e')][_0x70d8('0x39')]){_0x5929c3['where']=_[_0x70d8('0x3a')](_0x5929c3[_0x70d8('0x37')],{'$or':_[_0x70d8('0x3b')](_0x5929c3[_0x70d8('0x32')],function(_0x551ee3){var _0x81db22={};_0x81db22[_0x551ee3]={'$like':'%'+_0x5e4d78['query'][_0x70d8('0x39')]+'%'};return _0x81db22;})});}_0x5929c3=_[_0x70d8('0x3a')]({},_0x5929c3,_0x5e4d78[_0x70d8('0x4b')]);return _0x5ac4b9[_0x70d8('0x47')](_0x5929c3);}})[_0x70d8('0x22')](function(_0x334efe){if(_0x334efe){_0x24360c=_0x334efe['length'];if(!_0x5e4d78[_0x70d8('0x2e')][_0x70d8('0x4c')]('nolimit')){_0x5929c3[_0x70d8('0x1b')]=qs[_0x70d8('0x1b')](_0x5e4d78[_0x70d8('0x2e')]['limit']);_0x5929c3[_0x70d8('0x1a')]=qs[_0x70d8('0x1a')](_0x5e4d78[_0x70d8('0x2e')][_0x70d8('0x1a')]);}return _0x5ac4b9[_0x70d8('0x47')](_0x5929c3);}})['then'](function(_0x48ca59){if(_0x48ca59){return _0x48ca59?{'count':_0x24360c,'rows':_0x48ca59}:null;}})['then'](respondWithResult(_0x3bdf18,null))[_0x70d8('0x3f')](handleError(_0x3bdf18,null));};exports[_0x70d8('0x4d')]=function(_0x2c1928,_0x21f68b,_0x316652){var _0x2e9adc={};var _0x1e7cfb={};var _0x2341a2;var _0x3685f5;return db[_0x70d8('0x29')][_0x70d8('0x48')]({'where':{'id':_0x2c1928[_0x70d8('0x41')]['id']}})['then'](handleEntityNotFound(_0x21f68b,null))[_0x70d8('0x22')](function(_0x2df5b2){if(_0x2df5b2){_0x2341a2=_0x2df5b2;_0x1e7cfb[_0x70d8('0x2d')]=_['keys'](db[_0x70d8('0x49')]['rawAttributes']);_0x1e7cfb['query']=_[_0x70d8('0x2f')](_0x2c1928['query']);_0x1e7cfb[_0x70d8('0x30')]=_['intersection'](_0x1e7cfb[_0x70d8('0x2d')],_0x1e7cfb[_0x70d8('0x2e')]);_0x2e9adc[_0x70d8('0x32')]=_['intersection'](_0x1e7cfb[_0x70d8('0x2d')],qs[_0x70d8('0x33')](_0x2c1928[_0x70d8('0x2e')][_0x70d8('0x33')]));_0x2e9adc['attributes']=_0x2e9adc[_0x70d8('0x32')][_0x70d8('0x34')]?_0x2e9adc['attributes']:_0x1e7cfb['model'];_0x2e9adc[_0x70d8('0x4a')]=qs[_0x70d8('0x36')](_0x2c1928['query']['sort']);_0x2e9adc[_0x70d8('0x37')]=qs[_0x70d8('0x30')](_[_0x70d8('0x38')](_0x2c1928['query'],_0x1e7cfb[_0x70d8('0x30')]));if(_0x2c1928['query']['filter']){_0x2e9adc['where']=_[_0x70d8('0x3a')](_0x2e9adc[_0x70d8('0x37')],{'$or':_[_0x70d8('0x3b')](_0x2e9adc[_0x70d8('0x32')],function(_0x886572){var _0x3eba17={};_0x3eba17[_0x886572]={'$like':'%'+_0x2c1928[_0x70d8('0x2e')]['filter']+'%'};return _0x3eba17;})});}_0x2e9adc=_[_0x70d8('0x3a')]({},_0x2e9adc,_0x2c1928[_0x70d8('0x4b')]);return _0x2341a2[_0x70d8('0x4d')](_0x2e9adc);}})['then'](function(_0x1192c7){if(_0x1192c7){_0x3685f5=_0x1192c7[_0x70d8('0x34')];if(!_0x2c1928[_0x70d8('0x2e')][_0x70d8('0x4c')](_0x70d8('0x35'))){_0x2e9adc[_0x70d8('0x1b')]=qs[_0x70d8('0x1b')](_0x2c1928[_0x70d8('0x2e')][_0x70d8('0x1b')]);_0x2e9adc[_0x70d8('0x1a')]=qs[_0x70d8('0x1a')](_0x2c1928[_0x70d8('0x2e')][_0x70d8('0x1a')]);}return _0x2341a2[_0x70d8('0x4d')](_0x2e9adc);}})['then'](function(_0x91a39d){if(_0x91a39d){return _0x91a39d?{'count':_0x3685f5,'rows':_0x91a39d}:null;}})[_0x70d8('0x22')](respondWithResult(_0x21f68b,null))['catch'](handleError(_0x21f68b,null));};exports[_0x70d8('0x4e')]=function(_0x444e64,_0x526eb3,_0x3476ea){var _0x33c0b9={};var _0x2f6f1d={};var _0x299899;var _0x27d20e;return db[_0x70d8('0x29')][_0x70d8('0x48')]({'where':{'id':_0x444e64[_0x70d8('0x41')]['id']}})[_0x70d8('0x22')](handleEntityNotFound(_0x526eb3,null))['then'](function(_0x42278e){if(_0x42278e){_0x299899=_0x42278e;_0x2f6f1d[_0x70d8('0x2d')]=_[_0x70d8('0x2f')](db[_0x70d8('0x49')][_0x70d8('0x2a')]);_0x2f6f1d[_0x70d8('0x2e')]=_[_0x70d8('0x2f')](_0x444e64['query']);_0x2f6f1d[_0x70d8('0x30')]=_[_0x70d8('0x31')](_0x2f6f1d['model'],_0x2f6f1d['query']);_0x33c0b9[_0x70d8('0x32')]=_['intersection'](_0x2f6f1d[_0x70d8('0x2d')],qs[_0x70d8('0x33')](_0x444e64[_0x70d8('0x2e')][_0x70d8('0x33')]));_0x33c0b9['attributes']=_0x33c0b9['attributes'][_0x70d8('0x34')]?_0x33c0b9[_0x70d8('0x32')]:_0x2f6f1d['model'];_0x33c0b9[_0x70d8('0x4a')]=qs[_0x70d8('0x36')](_0x444e64['query'][_0x70d8('0x36')]);_0x33c0b9[_0x70d8('0x37')]=qs[_0x70d8('0x30')](_['pick'](_0x444e64[_0x70d8('0x2e')],_0x2f6f1d[_0x70d8('0x30')]));if(_0x444e64[_0x70d8('0x2e')]['filter']){_0x33c0b9[_0x70d8('0x37')]=_[_0x70d8('0x3a')](_0x33c0b9[_0x70d8('0x37')],{'$or':_[_0x70d8('0x3b')](_0x33c0b9[_0x70d8('0x32')],function(_0x3962f7){var _0x34c6c9={};_0x34c6c9[_0x3962f7]={'$like':'%'+_0x444e64['query']['filter']+'%'};return _0x34c6c9;})});}_0x33c0b9=_['merge']({},_0x33c0b9,_0x444e64['options']);return _0x299899['getFields'](_0x33c0b9);}})[_0x70d8('0x22')](function(_0x449d11){if(_0x449d11){_0x27d20e=_0x449d11['length'];if(!_0x444e64[_0x70d8('0x2e')]['hasOwnProperty']('nolimit')){_0x33c0b9[_0x70d8('0x1b')]=qs[_0x70d8('0x1b')](_0x444e64[_0x70d8('0x2e')][_0x70d8('0x1b')]);_0x33c0b9[_0x70d8('0x1a')]=qs['offset'](_0x444e64[_0x70d8('0x2e')][_0x70d8('0x1a')]);}return _0x299899[_0x70d8('0x4e')](_0x33c0b9);}})[_0x70d8('0x22')](function(_0xbb6480){if(_0xbb6480){return _0xbb6480?{'count':_0x27d20e,'rows':_0xbb6480}:null;}})[_0x70d8('0x22')](respondWithResult(_0x526eb3,null))[_0x70d8('0x3f')](handleError(_0x526eb3,null));}; \ No newline at end of file +var _0xb763=['sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','reject','save','update','then','end','error','stack','name','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0xcf5436,_0x4632c3){var _0xc4f5c8=function(_0x567528){while(--_0x567528){_0xcf5436['push'](_0xcf5436['shift']());}};_0xc4f5c8(++_0x4632c3);}(_0xb763,0x117));var _0x3b76=function(_0x44046c,_0x370b32){_0x44046c=_0x44046c-0x0;var _0x18fa46=_0xb763[_0x44046c];return _0x18fa46;};'use strict';var emlformat=require(_0x3b76('0x0'));var rimraf=require(_0x3b76('0x1'));var zipdir=require(_0x3b76('0x2'));var jsonpatch=require(_0x3b76('0x3'));var rp=require(_0x3b76('0x4'));var moment=require(_0x3b76('0x5'));var BPromise=require(_0x3b76('0x6'));var Mustache=require(_0x3b76('0x7'));var util=require(_0x3b76('0x8'));var path=require(_0x3b76('0x9'));var sox=require(_0x3b76('0xa'));var csv=require('to-csv');var ejs=require(_0x3b76('0xb'));var fs=require('fs');var fs_extra=require(_0x3b76('0xc'));var _=require(_0x3b76('0xd'));var squel=require(_0x3b76('0xe'));var crypto=require(_0x3b76('0xf'));var jsforce=require(_0x3b76('0x10'));var deskjs=require(_0x3b76('0x11'));var toCsv=require(_0x3b76('0x12'));var querystring=require(_0x3b76('0x13'));var Papa=require('papaparse');var Redis=require(_0x3b76('0x14'));var authService=require(_0x3b76('0x15'));var qs=require(_0x3b76('0x16'));var as=require(_0x3b76('0x17'));var hardwareService=require(_0x3b76('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x3b76('0x19'));var config=require(_0x3b76('0x1a'));var licenseUtil=require(_0x3b76('0x1b'));var db=require(_0x3b76('0x1c'))['db'];function respondWithStatusCode(_0x16996a,_0x1736ae){_0x1736ae=_0x1736ae||0xcc;return function(_0x4361c5){if(_0x4361c5){return _0x16996a[_0x3b76('0x1d')](_0x1736ae);}return _0x16996a[_0x3b76('0x1e')](_0x1736ae)['end']();};}function respondWithResult(_0x42681a,_0x34952c){_0x34952c=_0x34952c||0xc8;return function(_0x2105e3){if(_0x2105e3){return _0x42681a[_0x3b76('0x1e')](_0x34952c)[_0x3b76('0x1f')](_0x2105e3);}};}function respondWithFilteredResult(_0x38a95a,_0x1a41a2){return function(_0x25fd84){if(_0x25fd84){var _0x2e3f4b=typeof _0x1a41a2['offset']===_0x3b76('0x20')&&typeof _0x1a41a2[_0x3b76('0x21')]===_0x3b76('0x20');var _0x310cbf=_0x25fd84['count'];var _0x14c1e5=_0x2e3f4b?0x0:_0x1a41a2[_0x3b76('0x22')];var _0x2c7c66=_0x2e3f4b?_0x25fd84[_0x3b76('0x23')]:_0x1a41a2[_0x3b76('0x22')]+_0x1a41a2[_0x3b76('0x21')];var _0x3886eb;if(_0x2c7c66>=_0x310cbf){_0x2c7c66=_0x310cbf;_0x3886eb=0xc8;}else{_0x3886eb=0xce;}_0x38a95a[_0x3b76('0x1e')](_0x3886eb);return _0x38a95a['set']('Content-Range',_0x14c1e5+'-'+_0x2c7c66+'/'+_0x310cbf)[_0x3b76('0x1f')](_0x25fd84);}return null;};}function patchUpdates(_0x17d46f){return function(_0x4590e1){try{jsonpatch['apply'](_0x4590e1,_0x17d46f,!![]);}catch(_0x4faf03){return BPromise[_0x3b76('0x24')](_0x4faf03);}return _0x4590e1[_0x3b76('0x25')]();};}function saveUpdates(_0x4bb5b6,_0x46e9f9){return function(_0x333a89){if(_0x333a89){return _0x333a89[_0x3b76('0x26')](_0x4bb5b6)[_0x3b76('0x27')](function(_0x550a71){return _0x550a71;});}return null;};}function removeEntity(_0x23e447,_0x2f02b3){return function(_0x2695dc){if(_0x2695dc){return _0x2695dc['destroy']()[_0x3b76('0x27')](function(){_0x23e447[_0x3b76('0x1e')](0xcc)[_0x3b76('0x28')]();});}};}function handleEntityNotFound(_0xdfe146,_0xfa2305){return function(_0x2cc807){if(!_0x2cc807){_0xdfe146[_0x3b76('0x1d')](0x194);}return _0x2cc807;};}function handleError(_0x2dd8b4,_0x5a2e99){_0x5a2e99=_0x5a2e99||0x1f4;return function(_0x259978){logger[_0x3b76('0x29')](_0x259978[_0x3b76('0x2a')]);if(_0x259978[_0x3b76('0x2b')]){delete _0x259978[_0x3b76('0x2b')];}_0x2dd8b4[_0x3b76('0x1e')](_0x5a2e99)['send'](_0x259978);};}exports[_0x3b76('0x2c')]=function(_0x26a30a,_0x446fff){var _0x477810={},_0x1d8805={},_0x588be7={'count':0x0,'rows':[]};var _0x225b6e=_['map'](db[_0x3b76('0x2d')][_0x3b76('0x2e')],function(_0x59add5){return{'name':_0x59add5[_0x3b76('0x2f')],'type':_0x59add5['type'][_0x3b76('0x30')]};});_0x1d8805[_0x3b76('0x31')]=_[_0x3b76('0x32')](_0x225b6e,_0x3b76('0x2b'));_0x1d8805[_0x3b76('0x33')]=_[_0x3b76('0x34')](_0x26a30a['query']);_0x1d8805[_0x3b76('0x35')]=_['intersection'](_0x1d8805[_0x3b76('0x31')],_0x1d8805[_0x3b76('0x33')]);_0x477810['attributes']=_[_0x3b76('0x36')](_0x1d8805[_0x3b76('0x31')],qs[_0x3b76('0x37')](_0x26a30a[_0x3b76('0x33')][_0x3b76('0x37')]));_0x477810[_0x3b76('0x38')]=_0x477810[_0x3b76('0x38')][_0x3b76('0x39')]?_0x477810['attributes']:_0x1d8805['model'];if(!_0x26a30a[_0x3b76('0x33')][_0x3b76('0x3a')](_0x3b76('0x3b'))){_0x477810[_0x3b76('0x21')]=qs['limit'](_0x26a30a[_0x3b76('0x33')][_0x3b76('0x21')]);_0x477810[_0x3b76('0x22')]=qs['offset'](_0x26a30a['query']['offset']);}_0x477810[_0x3b76('0x3c')]=qs[_0x3b76('0x3d')](_0x26a30a[_0x3b76('0x33')]['sort']);_0x477810['where']=qs['filters'](_[_0x3b76('0x3e')](_0x26a30a[_0x3b76('0x33')],_0x1d8805[_0x3b76('0x35')]),_0x225b6e);if(_0x26a30a[_0x3b76('0x33')][_0x3b76('0x3f')]){_0x477810[_0x3b76('0x40')]=_[_0x3b76('0x41')](_0x477810[_0x3b76('0x40')],{'$or':_['map'](_0x225b6e,function(_0x492c22){if(_0x492c22[_0x3b76('0x42')]!==_0x3b76('0x43')){var _0x1e0f35={};_0x1e0f35[_0x492c22[_0x3b76('0x2b')]]={'$like':'%'+_0x26a30a[_0x3b76('0x33')][_0x3b76('0x3f')]+'%'};return _0x1e0f35;}})});}_0x477810=_[_0x3b76('0x41')]({},_0x477810,_0x26a30a[_0x3b76('0x44')]);var _0x21ab6d={'where':_0x477810[_0x3b76('0x40')]};return db[_0x3b76('0x2d')][_0x3b76('0x23')](_0x21ab6d)['then'](function(_0x42512e){_0x588be7[_0x3b76('0x23')]=_0x42512e;if(_0x26a30a[_0x3b76('0x33')]['includeAll']){_0x477810[_0x3b76('0x45')]=[{'all':!![]}];}return db[_0x3b76('0x2d')][_0x3b76('0x46')](_0x477810);})[_0x3b76('0x27')](function(_0x43cac0){_0x588be7[_0x3b76('0x47')]=_0x43cac0;return _0x588be7;})[_0x3b76('0x27')](respondWithFilteredResult(_0x446fff,_0x477810))[_0x3b76('0x48')](handleError(_0x446fff,null));};exports[_0x3b76('0x49')]=function(_0x201180,_0x3c1036){var _0x1c377a={'raw':![],'where':{'id':_0x201180[_0x3b76('0x4a')]['id']}},_0x172f0a={};_0x172f0a[_0x3b76('0x31')]=_[_0x3b76('0x34')](db[_0x3b76('0x2d')][_0x3b76('0x2e')]);_0x172f0a[_0x3b76('0x33')]=_[_0x3b76('0x34')](_0x201180[_0x3b76('0x33')]);_0x172f0a[_0x3b76('0x35')]=_[_0x3b76('0x36')](_0x172f0a[_0x3b76('0x31')],_0x172f0a[_0x3b76('0x33')]);_0x1c377a['attributes']=_[_0x3b76('0x36')](_0x172f0a['model'],qs['fields'](_0x201180[_0x3b76('0x33')][_0x3b76('0x37')]));_0x1c377a[_0x3b76('0x38')]=_0x1c377a['attributes'][_0x3b76('0x39')]?_0x1c377a[_0x3b76('0x38')]:_0x172f0a['model'];if(_0x201180[_0x3b76('0x33')][_0x3b76('0x4b')]){_0x1c377a[_0x3b76('0x45')]=[{'all':!![]}];}_0x1c377a=_[_0x3b76('0x41')]({},_0x1c377a,_0x201180[_0x3b76('0x44')]);return db[_0x3b76('0x2d')][_0x3b76('0x4c')](_0x1c377a)['then'](handleEntityNotFound(_0x3c1036,null))['then'](respondWithResult(_0x3c1036,null))[_0x3b76('0x48')](handleError(_0x3c1036,null));};exports[_0x3b76('0x4d')]=function(_0x2defc8,_0x8e66cb){return db[_0x3b76('0x2d')]['create'](_0x2defc8[_0x3b76('0x4e')],{})['then'](respondWithResult(_0x8e66cb,0xc9))[_0x3b76('0x48')](handleError(_0x8e66cb,null));};exports[_0x3b76('0x26')]=function(_0x58d03a,_0x4d0c2e){if(_0x58d03a['body']['id']){delete _0x58d03a[_0x3b76('0x4e')]['id'];}return db[_0x3b76('0x2d')]['find']({'where':{'id':_0x58d03a[_0x3b76('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d0c2e,null))['then'](saveUpdates(_0x58d03a[_0x3b76('0x4e')],null))[_0x3b76('0x27')](respondWithResult(_0x4d0c2e,null))['catch'](handleError(_0x4d0c2e,null));};exports[_0x3b76('0x4f')]=function(_0x5c99c5,_0x87485c){return db[_0x3b76('0x2d')][_0x3b76('0x4c')]({'where':{'id':_0x5c99c5['params']['id']}})[_0x3b76('0x27')](handleEntityNotFound(_0x87485c,null))[_0x3b76('0x27')](removeEntity(_0x87485c,null))[_0x3b76('0x48')](handleError(_0x87485c,null));};exports[_0x3b76('0x50')]=function(_0x4cc143,_0x316c45,_0x2cc0f4){var _0x2e0c68={};var _0xa434e3={};var _0x2a465a;var _0x46d989;return db[_0x3b76('0x2d')][_0x3b76('0x51')]({'where':{'id':_0x4cc143[_0x3b76('0x4a')]['id']}})[_0x3b76('0x27')](handleEntityNotFound(_0x316c45,null))[_0x3b76('0x27')](function(_0x344c89){if(_0x344c89){_0x2a465a=_0x344c89;_0xa434e3[_0x3b76('0x31')]=_[_0x3b76('0x34')](db['FreshsalesField'][_0x3b76('0x2e')]);_0xa434e3[_0x3b76('0x33')]=_[_0x3b76('0x34')](_0x4cc143['query']);_0xa434e3['filters']=_[_0x3b76('0x36')](_0xa434e3[_0x3b76('0x31')],_0xa434e3[_0x3b76('0x33')]);_0x2e0c68['attributes']=_[_0x3b76('0x36')](_0xa434e3[_0x3b76('0x31')],qs['fields'](_0x4cc143[_0x3b76('0x33')]['fields']));_0x2e0c68[_0x3b76('0x38')]=_0x2e0c68['attributes']['length']?_0x2e0c68[_0x3b76('0x38')]:_0xa434e3[_0x3b76('0x31')];_0x2e0c68[_0x3b76('0x3c')]=qs[_0x3b76('0x3d')](_0x4cc143[_0x3b76('0x33')][_0x3b76('0x3d')]);_0x2e0c68[_0x3b76('0x40')]=qs[_0x3b76('0x35')](_[_0x3b76('0x3e')](_0x4cc143[_0x3b76('0x33')],_0xa434e3[_0x3b76('0x35')]));if(_0x4cc143[_0x3b76('0x33')][_0x3b76('0x3f')]){_0x2e0c68['where']=_[_0x3b76('0x41')](_0x2e0c68[_0x3b76('0x40')],{'$or':_[_0x3b76('0x32')](_0x2e0c68['attributes'],function(_0x55a7d6){var _0xe301a6={};_0xe301a6[_0x55a7d6]={'$like':'%'+_0x4cc143[_0x3b76('0x33')]['filter']+'%'};return _0xe301a6;})});}_0x2e0c68=_[_0x3b76('0x41')]({},_0x2e0c68,_0x4cc143[_0x3b76('0x44')]);return _0x2a465a[_0x3b76('0x50')](_0x2e0c68);}})[_0x3b76('0x27')](function(_0x5339f9){if(_0x5339f9){_0x46d989=_0x5339f9[_0x3b76('0x39')];if(!_0x4cc143[_0x3b76('0x33')][_0x3b76('0x3a')](_0x3b76('0x3b'))){_0x2e0c68[_0x3b76('0x21')]=qs[_0x3b76('0x21')](_0x4cc143[_0x3b76('0x33')][_0x3b76('0x21')]);_0x2e0c68[_0x3b76('0x22')]=qs[_0x3b76('0x22')](_0x4cc143['query'][_0x3b76('0x22')]);}return _0x2a465a[_0x3b76('0x50')](_0x2e0c68);}})[_0x3b76('0x27')](function(_0x43d40b){if(_0x43d40b){return _0x43d40b?{'count':_0x46d989,'rows':_0x43d40b}:null;}})['then'](respondWithResult(_0x316c45,null))['catch'](handleError(_0x316c45,null));};exports['getDescriptions']=function(_0x4cbdc2,_0x32e873,_0x3c95d8){var _0x2be51c={};var _0x3ff364={};var _0x5c78b8;var _0x32c7b3;return db[_0x3b76('0x2d')][_0x3b76('0x51')]({'where':{'id':_0x4cbdc2[_0x3b76('0x4a')]['id']}})[_0x3b76('0x27')](handleEntityNotFound(_0x32e873,null))[_0x3b76('0x27')](function(_0x1bfcfd){if(_0x1bfcfd){_0x5c78b8=_0x1bfcfd;_0x3ff364['model']=_[_0x3b76('0x34')](db[_0x3b76('0x52')][_0x3b76('0x2e')]);_0x3ff364[_0x3b76('0x33')]=_[_0x3b76('0x34')](_0x4cbdc2[_0x3b76('0x33')]);_0x3ff364['filters']=_[_0x3b76('0x36')](_0x3ff364['model'],_0x3ff364[_0x3b76('0x33')]);_0x2be51c[_0x3b76('0x38')]=_[_0x3b76('0x36')](_0x3ff364[_0x3b76('0x31')],qs[_0x3b76('0x37')](_0x4cbdc2[_0x3b76('0x33')]['fields']));_0x2be51c[_0x3b76('0x38')]=_0x2be51c[_0x3b76('0x38')][_0x3b76('0x39')]?_0x2be51c[_0x3b76('0x38')]:_0x3ff364[_0x3b76('0x31')];_0x2be51c[_0x3b76('0x3c')]=qs[_0x3b76('0x3d')](_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x3d')]);_0x2be51c[_0x3b76('0x40')]=qs[_0x3b76('0x35')](_['pick'](_0x4cbdc2[_0x3b76('0x33')],_0x3ff364[_0x3b76('0x35')]));if(_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x3f')]){_0x2be51c[_0x3b76('0x40')]=_['merge'](_0x2be51c[_0x3b76('0x40')],{'$or':_[_0x3b76('0x32')](_0x2be51c[_0x3b76('0x38')],function(_0x49cc92){var _0x119eb3={};_0x119eb3[_0x49cc92]={'$like':'%'+_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x3f')]+'%'};return _0x119eb3;})});}_0x2be51c=_[_0x3b76('0x41')]({},_0x2be51c,_0x4cbdc2[_0x3b76('0x44')]);return _0x5c78b8[_0x3b76('0x53')](_0x2be51c);}})['then'](function(_0x513acc){if(_0x513acc){_0x32c7b3=_0x513acc[_0x3b76('0x39')];if(!_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x3a')](_0x3b76('0x3b'))){_0x2be51c['limit']=qs['limit'](_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x21')]);_0x2be51c[_0x3b76('0x22')]=qs[_0x3b76('0x22')](_0x4cbdc2[_0x3b76('0x33')][_0x3b76('0x22')]);}return _0x5c78b8[_0x3b76('0x53')](_0x2be51c);}})['then'](function(_0x57350a){if(_0x57350a){return _0x57350a?{'count':_0x32c7b3,'rows':_0x57350a}:null;}})[_0x3b76('0x27')](respondWithResult(_0x32e873,null))[_0x3b76('0x48')](handleError(_0x32e873,null));};exports['getFields']=function(_0xadc4f3,_0x17db17,_0x2756c4){var _0x3b8f67={};var _0x355a58={};var _0x3859f9;var _0x59acba;return db['FreshsalesConfiguration'][_0x3b76('0x51')]({'where':{'id':_0xadc4f3[_0x3b76('0x4a')]['id']}})[_0x3b76('0x27')](handleEntityNotFound(_0x17db17,null))[_0x3b76('0x27')](function(_0x21dd05){if(_0x21dd05){_0x3859f9=_0x21dd05;_0x355a58[_0x3b76('0x31')]=_[_0x3b76('0x34')](db[_0x3b76('0x52')][_0x3b76('0x2e')]);_0x355a58[_0x3b76('0x33')]=_[_0x3b76('0x34')](_0xadc4f3['query']);_0x355a58['filters']=_['intersection'](_0x355a58[_0x3b76('0x31')],_0x355a58[_0x3b76('0x33')]);_0x3b8f67['attributes']=_[_0x3b76('0x36')](_0x355a58[_0x3b76('0x31')],qs[_0x3b76('0x37')](_0xadc4f3[_0x3b76('0x33')]['fields']));_0x3b8f67[_0x3b76('0x38')]=_0x3b8f67[_0x3b76('0x38')][_0x3b76('0x39')]?_0x3b8f67[_0x3b76('0x38')]:_0x355a58[_0x3b76('0x31')];_0x3b8f67[_0x3b76('0x3c')]=qs['sort'](_0xadc4f3['query'][_0x3b76('0x3d')]);_0x3b8f67['where']=qs[_0x3b76('0x35')](_[_0x3b76('0x3e')](_0xadc4f3['query'],_0x355a58[_0x3b76('0x35')]));if(_0xadc4f3[_0x3b76('0x33')][_0x3b76('0x3f')]){_0x3b8f67[_0x3b76('0x40')]=_[_0x3b76('0x41')](_0x3b8f67[_0x3b76('0x40')],{'$or':_[_0x3b76('0x32')](_0x3b8f67[_0x3b76('0x38')],function(_0x580529){var _0x3287f4={};_0x3287f4[_0x580529]={'$like':'%'+_0xadc4f3[_0x3b76('0x33')][_0x3b76('0x3f')]+'%'};return _0x3287f4;})});}_0x3b8f67=_['merge']({},_0x3b8f67,_0xadc4f3[_0x3b76('0x44')]);return _0x3859f9[_0x3b76('0x54')](_0x3b8f67);}})['then'](function(_0x4f8289){if(_0x4f8289){_0x59acba=_0x4f8289[_0x3b76('0x39')];if(!_0xadc4f3['query']['hasOwnProperty'](_0x3b76('0x3b'))){_0x3b8f67['limit']=qs[_0x3b76('0x21')](_0xadc4f3['query'][_0x3b76('0x21')]);_0x3b8f67[_0x3b76('0x22')]=qs[_0x3b76('0x22')](_0xadc4f3['query']['offset']);}return _0x3859f9['getFields'](_0x3b8f67);}})[_0x3b76('0x27')](function(_0x2208a9){if(_0x2208a9){return _0x2208a9?{'count':_0x59acba,'rows':_0x2208a9}:null;}})[_0x3b76('0x27')](respondWithResult(_0x17db17,null))['catch'](handleError(_0x17db17,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index d1763bc..b5d803b 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 _0x0b43=['define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','request-promise','path','rimraf','./intFreshsalesConfiguration.attributes'];(function(_0x236881,_0x4e3fd0){var _0x35584e=function(_0x203582){while(--_0x203582){_0x236881['push'](_0x236881['shift']());}};_0x35584e(++_0x4e3fd0);}(_0x0b43,0x87));var _0x30b4=function(_0x1a1366,_0x12a97b){_0x1a1366=_0x1a1366-0x0;var _0x3924fc=_0x0b43[_0x1a1366];return _0x3924fc;};'use strict';var _=require(_0x30b4('0x0'));var util=require(_0x30b4('0x1'));var logger=require('../../config/logger')(_0x30b4('0x2'));var moment=require(_0x30b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x30b4('0x4'));var fs=require('fs');var path=require(_0x30b4('0x5'));var rimraf=require(_0x30b4('0x6'));var config=require('../../config/environment');var attributes=require(_0x30b4('0x7'));module['exports']=function(_0x3353b8,_0x3b70d3){return _0x3353b8[_0x30b4('0x8')](_0x30b4('0x9'),attributes,{'tableName':_0x30b4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22bf=['FreshsalesConfiguration','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x22bf,0x1d5));var _0xf22b=function(_0x3c1944,_0x22f29d){_0x3c1944=_0x3c1944-0x0;var _0x28c831=_0x22bf[_0x3c1944];return _0x28c831;};'use strict';var _=require(_0xf22b('0x0'));var util=require(_0xf22b('0x1'));var logger=require('../../config/logger')(_0xf22b('0x2'));var moment=require(_0xf22b('0x3'));var BPromise=require(_0xf22b('0x4'));var rp=require(_0xf22b('0x5'));var fs=require('fs');var path=require(_0xf22b('0x6'));var rimraf=require('rimraf');var config=require(_0xf22b('0x7'));var attributes=require(_0xf22b('0x8'));module[_0xf22b('0x9')]=function(_0x1c26d6,_0x181ffe){return _0x1c26d6[_0xf22b('0xa')](_0xf22b('0xb'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 415bf68..ee5fe4a 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 _0x3507=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xea897b,_0x269096){var _0x8a736e=function(_0x2b13b6){while(--_0x2b13b6){_0xea897b['push'](_0xea897b['shift']());}};_0x8a736e(++_0x269096);}(_0x3507,0xb4));var _0x7350=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0x3507[_0x23c6f2];return _0x4c270b;};'use strict';var _=require(_0x7350('0x0'));var util=require(_0x7350('0x1'));var moment=require(_0x7350('0x2'));var BPromise=require(_0x7350('0x3'));var rs=require(_0x7350('0x4'));var fs=require('fs');var Redis=require(_0x7350('0x5'));var db=require(_0x7350('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7350('0x7'));var config=require(_0x7350('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7350('0x9')][_0x7350('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30d63f,_0x3de874,_0x4f87d3){return new BPromise(function(_0x33b2f1,_0x503f24){return client[_0x7350('0xb')](_0x30d63f,_0x4f87d3)[_0x7350('0xc')](function(_0x49f95d){logger[_0x7350('0xd')](_0x7350('0xe'),_0x3de874,_0x7350('0xf'));logger[_0x7350('0x10')](_0x7350('0x11'),_0x3de874,_0x7350('0xf'),JSON['stringify'](_0x49f95d));if(_0x49f95d[_0x7350('0x12')]){if(_0x49f95d['error']['code']===0x1f4){logger[_0x7350('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3de874,_0x49f95d['error'][_0x7350('0x13')]);return _0x503f24(_0x49f95d[_0x7350('0x12')][_0x7350('0x13')]);}logger[_0x7350('0x12')](_0x7350('0xe'),_0x3de874,_0x49f95d[_0x7350('0x12')][_0x7350('0x13')]);return _0x33b2f1(_0x49f95d[_0x7350('0x12')][_0x7350('0x13')]);}else{logger[_0x7350('0xd')](_0x7350('0xe'),_0x3de874,_0x7350('0xf'));_0x33b2f1(_0x49f95d[_0x7350('0x14')]['message']);}})[_0x7350('0x15')](function(_0x290705){logger[_0x7350('0x12')](_0x7350('0xe'),_0x3de874,_0x290705);_0x503f24(_0x290705);});});} \ No newline at end of file +var _0x5ed9=['rpc','../../config/environment','jayson/promise','client','http','request','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x277fde,_0x38c46e){var _0x3665c9=function(_0x354576){while(--_0x354576){_0x277fde['push'](_0x277fde['shift']());}};_0x3665c9(++_0x38c46e);}(_0x5ed9,0x12b));var _0x95ed=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5ed9[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x95ed('0x0'));var util=require('util');var moment=require(_0x95ed('0x1'));var BPromise=require('bluebird');var rs=require(_0x95ed('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95ed('0x3'))['db'];var utils=require(_0x95ed('0x4'));var logger=require('../../config/logger')(_0x95ed('0x5'));var config=require(_0x95ed('0x6'));var jayson=require(_0x95ed('0x7'));var client=jayson[_0x95ed('0x8')][_0x95ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x455f1a,_0x58a51e,_0x45a928){return new BPromise(function(_0x480428,_0x313161){return client[_0x95ed('0xa')](_0x455f1a,_0x45a928)['then'](function(_0x4d8b9e){logger[_0x95ed('0xb')](_0x95ed('0xc'),_0x58a51e,'request\x20sent');logger[_0x95ed('0xd')](_0x95ed('0xe'),_0x58a51e,'request\x20sent',JSON[_0x95ed('0xf')](_0x4d8b9e));if(_0x4d8b9e[_0x95ed('0x10')]){if(_0x4d8b9e['error']['code']===0x1f4){logger[_0x95ed('0x10')](_0x95ed('0xc'),_0x58a51e,_0x4d8b9e[_0x95ed('0x10')][_0x95ed('0x11')]);return _0x313161(_0x4d8b9e[_0x95ed('0x10')]['message']);}logger[_0x95ed('0x10')](_0x95ed('0xc'),_0x58a51e,_0x4d8b9e[_0x95ed('0x10')]['message']);return _0x480428(_0x4d8b9e[_0x95ed('0x10')][_0x95ed('0x11')]);}else{logger[_0x95ed('0xb')](_0x95ed('0xc'),_0x58a51e,_0x95ed('0x12'));_0x480428(_0x4d8b9e['result']['message']);}})['catch'](function(_0x323899){logger[_0x95ed('0x10')](_0x95ed('0xc'),_0x58a51e,_0x323899);_0x313161(_0x323899);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a0085a9..4333e14 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 _0x2c6a=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','path'];(function(_0x5bc750,_0x479e9a){var _0x4d39d6=function(_0x5bb02a){while(--_0x5bb02a){_0x5bc750['push'](_0x5bc750['shift']());}};_0x4d39d6(++_0x479e9a);}(_0x2c6a,0xa7));var _0xa2c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c6a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa2c6('0x0'));var util=require(_0xa2c6('0x1'));var path=require(_0xa2c6('0x2'));var timeout=require(_0xa2c6('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa2c6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa2c6('0x5'));var config=require(_0xa2c6('0x6'));var controller=require(_0xa2c6('0x7'));router[_0xa2c6('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa2c6('0x8')](_0xa2c6('0x9'),auth[_0xa2c6('0xa')](),controller[_0xa2c6('0xb')]);router[_0xa2c6('0xc')]('/',auth[_0xa2c6('0xa')](),controller[_0xa2c6('0xd')]);router['put'](_0xa2c6('0x9'),auth[_0xa2c6('0xa')](),controller[_0xa2c6('0xe')]);router[_0xa2c6('0xf')]('/:id',auth[_0xa2c6('0xa')](),controller['destroy']);module[_0xa2c6('0x10')]=router; \ No newline at end of file +var _0x6fad=['../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','create','put','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x559cd4,_0x593dab){var _0x308b81=function(_0x4aab99){while(--_0x4aab99){_0x559cd4['push'](_0x559cd4['shift']());}};_0x308b81(++_0x593dab);}(_0x6fad,0x174));var _0xd6fa=function(_0x255b79,_0x1e6990){_0x255b79=_0x255b79-0x0;var _0x28b7db=_0x6fad[_0x255b79];return _0x28b7db;};'use strict';var multer=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var path=require(_0xd6fa('0x2'));var timeout=require(_0xd6fa('0x3'));var express=require('express');var router=express[_0xd6fa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd6fa('0x5'));var interaction=require(_0xd6fa('0x6'));var config=require(_0xd6fa('0x7'));var controller=require(_0xd6fa('0x8'));router['get']('/',auth[_0xd6fa('0x9')](),controller[_0xd6fa('0xa')]);router[_0xd6fa('0xb')](_0xd6fa('0xc'),auth['isAuthenticated'](),controller[_0xd6fa('0xd')]);router['post']('/',auth[_0xd6fa('0x9')](),controller[_0xd6fa('0xe')]);router[_0xd6fa('0xf')](_0xd6fa('0xc'),auth[_0xd6fa('0x9')](),controller['update']);router['delete'](_0xd6fa('0xc'),auth[_0xd6fa('0x9')](),controller[_0xd6fa('0x10')]);module[_0xd6fa('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index f516f8c..410e35d 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 _0x04cd=['customVariable','STRING','ENUM','string','keyValue','picklist','variable'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x04cd,0x144));var _0xd04c=function(_0x12f1eb,_0x6f81bd){_0x12f1eb=_0x12f1eb-0x0;var _0x35695c=_0x04cd[_0x12f1eb];return _0x35695c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xd04c('0x0')](_0xd04c('0x1'),'variable','customVariable',_0xd04c('0x2'),_0xd04c('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd04c('0x0')](_0xd04c('0x1'),_0xd04c('0x4'),_0xd04c('0x5'))},'keyContent':{'type':Sequelize[_0xd04c('0x6')]},'idField':{'type':Sequelize[_0xd04c('0x6')]},'nameField':{'type':Sequelize[_0xd04c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd04c('0x6')]}}; \ No newline at end of file +var _0x3838=['STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x29de7f,_0x35cc2e){var _0x3676c0=function(_0x12f322){while(--_0x12f322){_0x29de7f['push'](_0x29de7f['shift']());}};_0x3676c0(++_0x35cc2e);}(_0x3838,0x133));var _0x8383=function(_0x5cf391,_0x2beabf){_0x5cf391=_0x5cf391-0x0;var _0x593b2c=_0x3838[_0x5cf391];return _0x593b2c;};'use strict';var Sequelize=require(_0x8383('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8383('0x1'),_0x8383('0x2'),_0x8383('0x3'),_0x8383('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x8383('0x5')]},'key':{'type':Sequelize[_0x8383('0x5')]},'keyType':{'type':Sequelize[_0x8383('0x6')](_0x8383('0x1'),_0x8383('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x8383('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8383('0x5')]},'customField':{'type':Sequelize[_0x8383('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8383('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 84a60ba..e021fbe 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 _0x272e=['map','FreshsalesField','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index'];(function(_0x36084a,_0x3947a4){var _0x290111=function(_0x2870d7){while(--_0x2870d7){_0x36084a['push'](_0x36084a['shift']());}};_0x290111(++_0x3947a4);}(_0x272e,0xb3));var _0xe272=function(_0x1fce8b,_0x3d5030){_0x1fce8b=_0x1fce8b-0x0;var _0x5a97e7=_0x272e[_0x1fce8b];return _0x5a97e7;};'use strict';var emlformat=require(_0xe272('0x0'));var rimraf=require(_0xe272('0x1'));var zipdir=require(_0xe272('0x2'));var jsonpatch=require(_0xe272('0x3'));var rp=require(_0xe272('0x4'));var moment=require(_0xe272('0x5'));var BPromise=require(_0xe272('0x6'));var Mustache=require('mustache');var util=require(_0xe272('0x7'));var path=require(_0xe272('0x8'));var sox=require(_0xe272('0x9'));var csv=require(_0xe272('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe272('0xb'));var jsforce=require(_0xe272('0xc'));var deskjs=require(_0xe272('0xd'));var toCsv=require(_0xe272('0xa'));var querystring=require(_0xe272('0xe'));var Papa=require(_0xe272('0xf'));var Redis=require(_0xe272('0x10'));var authService=require(_0xe272('0x11'));var qs=require(_0xe272('0x12'));var as=require(_0xe272('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe272('0x14'))('api');var utils=require(_0xe272('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe272('0x16'));var db=require(_0xe272('0x17'))['db'];function respondWithStatusCode(_0x5ea4b9,_0x3c3652){_0x3c3652=_0x3c3652||0xcc;return function(_0x30eb8d){if(_0x30eb8d){return _0x5ea4b9[_0xe272('0x18')](_0x3c3652);}return _0x5ea4b9[_0xe272('0x19')](_0x3c3652)[_0xe272('0x1a')]();};}function respondWithResult(_0x490521,_0x2e11a3){_0x2e11a3=_0x2e11a3||0xc8;return function(_0x7cafdf){if(_0x7cafdf){return _0x490521[_0xe272('0x19')](_0x2e11a3)[_0xe272('0x1b')](_0x7cafdf);}};}function respondWithFilteredResult(_0x2e6d3d,_0x4a4e4b){return function(_0x4efc99){if(_0x4efc99){var _0x537500=typeof _0x4a4e4b['offset']===_0xe272('0x1c')&&typeof _0x4a4e4b[_0xe272('0x1d')]==='undefined';var _0x4e0158=_0x4efc99['count'];var _0x4a9702=_0x537500?0x0:_0x4a4e4b[_0xe272('0x1e')];var _0x108bd0=_0x537500?_0x4efc99[_0xe272('0x1f')]:_0x4a4e4b['offset']+_0x4a4e4b[_0xe272('0x1d')];var _0x42288e;if(_0x108bd0>=_0x4e0158){_0x108bd0=_0x4e0158;_0x42288e=0xc8;}else{_0x42288e=0xce;}_0x2e6d3d['status'](_0x42288e);return _0x2e6d3d[_0xe272('0x20')](_0xe272('0x21'),_0x4a9702+'-'+_0x108bd0+'/'+_0x4e0158)[_0xe272('0x1b')](_0x4efc99);}return null;};}function patchUpdates(_0x32fadd){return function(_0x8dfda0){try{jsonpatch[_0xe272('0x22')](_0x8dfda0,_0x32fadd,!![]);}catch(_0x4af84c){return BPromise[_0xe272('0x23')](_0x4af84c);}return _0x8dfda0[_0xe272('0x24')]();};}function saveUpdates(_0x432f68,_0x126cfb){return function(_0x254cd4){if(_0x254cd4){return _0x254cd4['update'](_0x432f68)[_0xe272('0x25')](function(_0x203ed8){return _0x203ed8;});}return null;};}function removeEntity(_0x10fdd9,_0x166265){return function(_0x46d00b){if(_0x46d00b){return _0x46d00b['destroy']()[_0xe272('0x25')](function(){_0x10fdd9['status'](0xcc)[_0xe272('0x1a')]();});}};}function handleEntityNotFound(_0x1a2599,_0x168738){return function(_0x71c1d5){if(!_0x71c1d5){_0x1a2599['sendStatus'](0x194);}return _0x71c1d5;};}function handleError(_0x128cd3,_0x5cab60){_0x5cab60=_0x5cab60||0x1f4;return function(_0x1c92cd){logger[_0xe272('0x26')](_0x1c92cd[_0xe272('0x27')]);if(_0x1c92cd['name']){delete _0x1c92cd[_0xe272('0x28')];}_0x128cd3[_0xe272('0x19')](_0x5cab60)[_0xe272('0x29')](_0x1c92cd);};}exports[_0xe272('0x2a')]=function(_0x4781e2,_0x5ba8a0){var _0x373692={},_0xcec83b={},_0x59d069={'count':0x0,'rows':[]};var _0x5a56e3=_[_0xe272('0x2b')](db[_0xe272('0x2c')]['rawAttributes'],function(_0x2d9b86){return{'name':_0x2d9b86['fieldName'],'type':_0x2d9b86[_0xe272('0x2d')]['key']};});_0xcec83b[_0xe272('0x2e')]=_['map'](_0x5a56e3,_0xe272('0x28'));_0xcec83b[_0xe272('0x2f')]=_[_0xe272('0x30')](_0x4781e2[_0xe272('0x2f')]);_0xcec83b[_0xe272('0x31')]=_[_0xe272('0x32')](_0xcec83b[_0xe272('0x2e')],_0xcec83b[_0xe272('0x2f')]);_0x373692[_0xe272('0x33')]=_[_0xe272('0x32')](_0xcec83b[_0xe272('0x2e')],qs[_0xe272('0x34')](_0x4781e2[_0xe272('0x2f')]['fields']));_0x373692[_0xe272('0x33')]=_0x373692[_0xe272('0x33')][_0xe272('0x35')]?_0x373692[_0xe272('0x33')]:_0xcec83b[_0xe272('0x2e')];if(!_0x4781e2[_0xe272('0x2f')][_0xe272('0x36')](_0xe272('0x37'))){_0x373692[_0xe272('0x1d')]=qs[_0xe272('0x1d')](_0x4781e2[_0xe272('0x2f')][_0xe272('0x1d')]);_0x373692[_0xe272('0x1e')]=qs[_0xe272('0x1e')](_0x4781e2[_0xe272('0x2f')][_0xe272('0x1e')]);}_0x373692['order']=qs[_0xe272('0x38')](_0x4781e2[_0xe272('0x2f')][_0xe272('0x38')]);_0x373692[_0xe272('0x39')]=qs[_0xe272('0x31')](_[_0xe272('0x3a')](_0x4781e2[_0xe272('0x2f')],_0xcec83b['filters']),_0x5a56e3);if(_0x4781e2['query'][_0xe272('0x3b')]){_0x373692[_0xe272('0x39')]=_['merge'](_0x373692['where'],{'$or':_[_0xe272('0x2b')](_0x5a56e3,function(_0x3b8196){if(_0x3b8196[_0xe272('0x2d')]!==_0xe272('0x3c')){var _0x2cc060={};_0x2cc060[_0x3b8196[_0xe272('0x28')]]={'$like':'%'+_0x4781e2[_0xe272('0x2f')][_0xe272('0x3b')]+'%'};return _0x2cc060;}})});}_0x373692=_[_0xe272('0x3d')]({},_0x373692,_0x4781e2[_0xe272('0x3e')]);var _0x2984f0={'where':_0x373692['where']};return db[_0xe272('0x2c')][_0xe272('0x1f')](_0x2984f0)[_0xe272('0x25')](function(_0x41e346){_0x59d069[_0xe272('0x1f')]=_0x41e346;if(_0x4781e2[_0xe272('0x2f')][_0xe272('0x3f')]){_0x373692[_0xe272('0x40')]=[{'all':!![]}];}return db[_0xe272('0x2c')]['findAll'](_0x373692);})[_0xe272('0x25')](function(_0x22f470){_0x59d069[_0xe272('0x41')]=_0x22f470;return _0x59d069;})[_0xe272('0x25')](respondWithFilteredResult(_0x5ba8a0,_0x373692))[_0xe272('0x42')](handleError(_0x5ba8a0,null));};exports[_0xe272('0x43')]=function(_0x5543ce,_0x56fda8){var _0x514ad3={'raw':!![],'where':{'id':_0x5543ce[_0xe272('0x44')]['id']}},_0x1a20e8={};_0x1a20e8['model']=_[_0xe272('0x30')](db[_0xe272('0x2c')][_0xe272('0x45')]);_0x1a20e8[_0xe272('0x2f')]=_['keys'](_0x5543ce[_0xe272('0x2f')]);_0x1a20e8['filters']=_[_0xe272('0x32')](_0x1a20e8[_0xe272('0x2e')],_0x1a20e8['query']);_0x514ad3['attributes']=_[_0xe272('0x32')](_0x1a20e8[_0xe272('0x2e')],qs[_0xe272('0x34')](_0x5543ce[_0xe272('0x2f')]['fields']));_0x514ad3[_0xe272('0x33')]=_0x514ad3[_0xe272('0x33')][_0xe272('0x35')]?_0x514ad3[_0xe272('0x33')]:_0x1a20e8[_0xe272('0x2e')];if(_0x5543ce[_0xe272('0x2f')][_0xe272('0x3f')]){_0x514ad3[_0xe272('0x40')]=[{'all':!![]}];}_0x514ad3=_[_0xe272('0x3d')]({},_0x514ad3,_0x5543ce[_0xe272('0x3e')]);return db[_0xe272('0x2c')][_0xe272('0x46')](_0x514ad3)[_0xe272('0x25')](handleEntityNotFound(_0x56fda8,null))['then'](respondWithResult(_0x56fda8,null))[_0xe272('0x42')](handleError(_0x56fda8,null));};exports['create']=function(_0x1ca657,_0x166e33){return db[_0xe272('0x2c')][_0xe272('0x47')](_0x1ca657[_0xe272('0x48')],{})[_0xe272('0x25')](respondWithResult(_0x166e33,0xc9))[_0xe272('0x42')](handleError(_0x166e33,null));};exports[_0xe272('0x49')]=function(_0x158a60,_0xaa998a){if(_0x158a60[_0xe272('0x48')]['id']){delete _0x158a60['body']['id'];}return db[_0xe272('0x2c')][_0xe272('0x46')]({'where':{'id':_0x158a60[_0xe272('0x44')]['id']}})[_0xe272('0x25')](handleEntityNotFound(_0xaa998a,null))[_0xe272('0x25')](saveUpdates(_0x158a60['body'],null))[_0xe272('0x25')](respondWithResult(_0xaa998a,null))[_0xe272('0x42')](handleError(_0xaa998a,null));};exports['destroy']=function(_0x3f9e3d,_0x59f935){return db[_0xe272('0x2c')][_0xe272('0x46')]({'where':{'id':_0x3f9e3d[_0xe272('0x44')]['id']}})[_0xe272('0x25')](handleEntityNotFound(_0x59f935,null))[_0xe272('0x25')](removeEntity(_0x59f935,null))['catch'](handleError(_0x59f935,null));}; \ No newline at end of file +var _0xb0c2=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','map','FreshsalesField','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','include','catch','show','params','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x30e520,_0x4949f9){var _0x114706=function(_0x20c381){while(--_0x20c381){_0x30e520['push'](_0x30e520['shift']());}};_0x114706(++_0x4949f9);}(_0xb0c2,0x18f));var _0x2b0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0c2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2b0c('0x0'));var zipdir=require(_0x2b0c('0x1'));var jsonpatch=require(_0x2b0c('0x2'));var rp=require(_0x2b0c('0x3'));var moment=require(_0x2b0c('0x4'));var BPromise=require(_0x2b0c('0x5'));var Mustache=require(_0x2b0c('0x6'));var util=require(_0x2b0c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2b0c('0x8'));var ejs=require(_0x2b0c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2b0c('0xa'));var crypto=require(_0x2b0c('0xb'));var jsforce=require(_0x2b0c('0xc'));var deskjs=require(_0x2b0c('0xd'));var toCsv=require(_0x2b0c('0x8'));var querystring=require(_0x2b0c('0xe'));var Papa=require('papaparse');var Redis=require(_0x2b0c('0xf'));var authService=require(_0x2b0c('0x10'));var qs=require(_0x2b0c('0x11'));var as=require(_0x2b0c('0x12'));var hardwareService=require(_0x2b0c('0x13'));var logger=require('../../config/logger')(_0x2b0c('0x14'));var utils=require(_0x2b0c('0x15'));var config=require(_0x2b0c('0x16'));var licenseUtil=require(_0x2b0c('0x17'));var db=require(_0x2b0c('0x18'))['db'];function respondWithStatusCode(_0x4ba44f,_0x13ddc2){_0x13ddc2=_0x13ddc2||0xcc;return function(_0x441776){if(_0x441776){return _0x4ba44f[_0x2b0c('0x19')](_0x13ddc2);}return _0x4ba44f[_0x2b0c('0x1a')](_0x13ddc2)['end']();};}function respondWithResult(_0x130492,_0x2d4c7d){_0x2d4c7d=_0x2d4c7d||0xc8;return function(_0x188642){if(_0x188642){return _0x130492[_0x2b0c('0x1a')](_0x2d4c7d)[_0x2b0c('0x1b')](_0x188642);}};}function respondWithFilteredResult(_0x5992ca,_0x64c8bc){return function(_0x39604d){if(_0x39604d){var _0x58bbb6=typeof _0x64c8bc[_0x2b0c('0x1c')]===_0x2b0c('0x1d')&&typeof _0x64c8bc[_0x2b0c('0x1e')]===_0x2b0c('0x1d');var _0x2fac5d=_0x39604d['count'];var _0x52c393=_0x58bbb6?0x0:_0x64c8bc[_0x2b0c('0x1c')];var _0x5d1574=_0x58bbb6?_0x39604d[_0x2b0c('0x1f')]:_0x64c8bc[_0x2b0c('0x1c')]+_0x64c8bc[_0x2b0c('0x1e')];var _0x421807;if(_0x5d1574>=_0x2fac5d){_0x5d1574=_0x2fac5d;_0x421807=0xc8;}else{_0x421807=0xce;}_0x5992ca[_0x2b0c('0x1a')](_0x421807);return _0x5992ca[_0x2b0c('0x20')](_0x2b0c('0x21'),_0x52c393+'-'+_0x5d1574+'/'+_0x2fac5d)['json'](_0x39604d);}return null;};}function patchUpdates(_0x12f378){return function(_0x3d3dd9){try{jsonpatch['apply'](_0x3d3dd9,_0x12f378,!![]);}catch(_0x24213e){return BPromise[_0x2b0c('0x22')](_0x24213e);}return _0x3d3dd9[_0x2b0c('0x23')]();};}function saveUpdates(_0x4983f6,_0x20244d){return function(_0x1fcaa9){if(_0x1fcaa9){return _0x1fcaa9[_0x2b0c('0x24')](_0x4983f6)['then'](function(_0x30d228){return _0x30d228;});}return null;};}function removeEntity(_0x27266c,_0x16efa7){return function(_0x3b710f){if(_0x3b710f){return _0x3b710f[_0x2b0c('0x25')]()[_0x2b0c('0x26')](function(){_0x27266c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x40b08d,_0x4da195){return function(_0x365b42){if(!_0x365b42){_0x40b08d['sendStatus'](0x194);}return _0x365b42;};}function handleError(_0x11adf4,_0x1500e7){_0x1500e7=_0x1500e7||0x1f4;return function(_0x475ad1){logger['error'](_0x475ad1[_0x2b0c('0x27')]);if(_0x475ad1[_0x2b0c('0x28')]){delete _0x475ad1[_0x2b0c('0x28')];}_0x11adf4[_0x2b0c('0x1a')](_0x1500e7)['send'](_0x475ad1);};}exports['index']=function(_0x3cdeb8,_0x44ed56){var _0x3795c7={},_0x14db50={},_0x4ebe91={'count':0x0,'rows':[]};var _0x3bf2b9=_[_0x2b0c('0x29')](db[_0x2b0c('0x2a')][_0x2b0c('0x2b')],function(_0x439ee6){return{'name':_0x439ee6['fieldName'],'type':_0x439ee6[_0x2b0c('0x2c')][_0x2b0c('0x2d')]};});_0x14db50[_0x2b0c('0x2e')]=_[_0x2b0c('0x29')](_0x3bf2b9,_0x2b0c('0x28'));_0x14db50[_0x2b0c('0x2f')]=_[_0x2b0c('0x30')](_0x3cdeb8[_0x2b0c('0x2f')]);_0x14db50['filters']=_[_0x2b0c('0x31')](_0x14db50['model'],_0x14db50['query']);_0x3795c7['attributes']=_[_0x2b0c('0x31')](_0x14db50['model'],qs[_0x2b0c('0x32')](_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x32')]));_0x3795c7[_0x2b0c('0x33')]=_0x3795c7[_0x2b0c('0x33')]['length']?_0x3795c7[_0x2b0c('0x33')]:_0x14db50['model'];if(!_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x34')](_0x2b0c('0x35'))){_0x3795c7[_0x2b0c('0x1e')]=qs[_0x2b0c('0x1e')](_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x1e')]);_0x3795c7[_0x2b0c('0x1c')]=qs['offset'](_0x3cdeb8[_0x2b0c('0x2f')]['offset']);}_0x3795c7['order']=qs[_0x2b0c('0x36')](_0x3cdeb8['query'][_0x2b0c('0x36')]);_0x3795c7[_0x2b0c('0x37')]=qs[_0x2b0c('0x38')](_[_0x2b0c('0x39')](_0x3cdeb8[_0x2b0c('0x2f')],_0x14db50['filters']),_0x3bf2b9);if(_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x3a')]){_0x3795c7['where']=_[_0x2b0c('0x3b')](_0x3795c7[_0x2b0c('0x37')],{'$or':_['map'](_0x3bf2b9,function(_0x152f6e){if(_0x152f6e[_0x2b0c('0x2c')]!=='VIRTUAL'){var _0x58c2ab={};_0x58c2ab[_0x152f6e['name']]={'$like':'%'+_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x3a')]+'%'};return _0x58c2ab;}})});}_0x3795c7=_['merge']({},_0x3795c7,_0x3cdeb8[_0x2b0c('0x3c')]);var _0x1335ea={'where':_0x3795c7[_0x2b0c('0x37')]};return db['FreshsalesField'][_0x2b0c('0x1f')](_0x1335ea)[_0x2b0c('0x26')](function(_0xd490d){_0x4ebe91[_0x2b0c('0x1f')]=_0xd490d;if(_0x3cdeb8[_0x2b0c('0x2f')][_0x2b0c('0x3d')]){_0x3795c7[_0x2b0c('0x3e')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x3795c7);})[_0x2b0c('0x26')](function(_0x2048dd){_0x4ebe91['rows']=_0x2048dd;return _0x4ebe91;})[_0x2b0c('0x26')](respondWithFilteredResult(_0x44ed56,_0x3795c7))[_0x2b0c('0x3f')](handleError(_0x44ed56,null));};exports[_0x2b0c('0x40')]=function(_0x6362d3,_0x4748a9){var _0x4627ee={'raw':!![],'where':{'id':_0x6362d3[_0x2b0c('0x41')]['id']}},_0x2ca565={};_0x2ca565[_0x2b0c('0x2e')]=_[_0x2b0c('0x30')](db[_0x2b0c('0x2a')][_0x2b0c('0x2b')]);_0x2ca565[_0x2b0c('0x2f')]=_[_0x2b0c('0x30')](_0x6362d3['query']);_0x2ca565['filters']=_[_0x2b0c('0x31')](_0x2ca565[_0x2b0c('0x2e')],_0x2ca565['query']);_0x4627ee[_0x2b0c('0x33')]=_[_0x2b0c('0x31')](_0x2ca565[_0x2b0c('0x2e')],qs[_0x2b0c('0x32')](_0x6362d3[_0x2b0c('0x2f')]['fields']));_0x4627ee[_0x2b0c('0x33')]=_0x4627ee[_0x2b0c('0x33')][_0x2b0c('0x42')]?_0x4627ee[_0x2b0c('0x33')]:_0x2ca565[_0x2b0c('0x2e')];if(_0x6362d3[_0x2b0c('0x2f')][_0x2b0c('0x3d')]){_0x4627ee[_0x2b0c('0x3e')]=[{'all':!![]}];}_0x4627ee=_[_0x2b0c('0x3b')]({},_0x4627ee,_0x6362d3[_0x2b0c('0x3c')]);return db[_0x2b0c('0x2a')][_0x2b0c('0x43')](_0x4627ee)[_0x2b0c('0x26')](handleEntityNotFound(_0x4748a9,null))[_0x2b0c('0x26')](respondWithResult(_0x4748a9,null))['catch'](handleError(_0x4748a9,null));};exports[_0x2b0c('0x44')]=function(_0x2a7040,_0x2065cc){return db[_0x2b0c('0x2a')]['create'](_0x2a7040[_0x2b0c('0x45')],{})[_0x2b0c('0x26')](respondWithResult(_0x2065cc,0xc9))[_0x2b0c('0x3f')](handleError(_0x2065cc,null));};exports[_0x2b0c('0x24')]=function(_0x5ca62d,_0x36a433){if(_0x5ca62d[_0x2b0c('0x45')]['id']){delete _0x5ca62d[_0x2b0c('0x45')]['id'];}return db[_0x2b0c('0x2a')][_0x2b0c('0x43')]({'where':{'id':_0x5ca62d[_0x2b0c('0x41')]['id']}})[_0x2b0c('0x26')](handleEntityNotFound(_0x36a433,null))[_0x2b0c('0x26')](saveUpdates(_0x5ca62d['body'],null))['then'](respondWithResult(_0x36a433,null))['catch'](handleError(_0x36a433,null));};exports[_0x2b0c('0x25')]=function(_0xad07f5,_0x3eea10){return db[_0x2b0c('0x2a')][_0x2b0c('0x43')]({'where':{'id':_0xad07f5[_0x2b0c('0x41')]['id']}})['then'](handleEntityNotFound(_0x3eea10,null))[_0x2b0c('0x26')](removeEntity(_0x3eea10,null))[_0x2b0c('0x3f')](handleError(_0x3eea10,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e40bb57..5d72d5a 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 _0x2432=['idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2432,0x7a));var _0x2243=function(_0x3eb0a0,_0x3f5b6a){_0x3eb0a0=_0x3eb0a0-0x0;var _0x3f9d17=_0x2432[_0x3eb0a0];return _0x3f9d17;};'use strict';var _=require(_0x2243('0x0'));var util=require(_0x2243('0x1'));var logger=require(_0x2243('0x2'))(_0x2243('0x3'));var moment=require('moment');var BPromise=require(_0x2243('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2243('0x5'));var rimraf=require(_0x2243('0x6'));var config=require(_0x2243('0x7'));var attributes=require(_0x2243('0x8'));module[_0x2243('0x9')]=function(_0x41e1cb,_0x4208ac){return _0x41e1cb[_0x2243('0xa')](_0x2243('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x2243('0xc'),'fields':[_0x2243('0xd'),_0x2243('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb78e=['../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x35ed94,_0x3ececd){var _0x419993=function(_0x506ece){while(--_0x506ece){_0x35ed94['push'](_0x35ed94['shift']());}};_0x419993(++_0x3ececd);}(_0xb78e,0x1c9));var _0xeb78=function(_0x2fec37,_0x3990c6){_0x2fec37=_0x2fec37-0x0;var _0x45195c=_0xb78e[_0x2fec37];return _0x45195c;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[{'name':_0xeb78('0xd'),'fields':[_0xeb78('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 4f06b68..8de2593 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 _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0xbfa18c,_0x2d2482){var _0x3ce6ca=function(_0x36c67b){while(--_0x36c67b){_0xbfa18c['push'](_0xbfa18c['shift']());}};_0x3ce6ca(++_0x2d2482);}(_0xba34,0x119));var _0x4ba3=function(_0x31aca3,_0x4bab31){_0x31aca3=_0x31aca3-0x0;var _0x1f4c80=_0xba34[_0x31aca3];return _0x1f4c80;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file +var _0xe2fe=['then','info','FreshsalesField,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x14b0fa,_0x405582){var _0x1e7958=function(_0x4e71ea){while(--_0x4e71ea){_0x14b0fa['push'](_0x14b0fa['shift']());}};_0x1e7958(++_0x405582);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2e88d3b..3c60860 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(_0x17450b,_0x49ca01){var _0x17e54d=function(_0x17ca8f){while(--_0x17ca8f){_0x17450b['push'](_0x17450b['shift']());}};_0x17e54d(++_0x49ca01);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x3b21ae,_0x4a366f){var _0x41a148=function(_0x301970){while(--_0x301970){_0x3b21ae['push'](_0x3b21ae['shift']());}};_0x41a148(++_0x4a366f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 4d25395..af7c297 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 _0x14a0=['newTab','sequelize','exports','STRING','username','integrationTab'];(function(_0x433d10,_0x1990ee){var _0x4a4c1f=function(_0x437d49){while(--_0x437d49){_0x433d10['push'](_0x433d10['shift']());}};_0x4a4c1f(++_0x1990ee);}(_0x14a0,0x109));var _0x014a=function(_0x431a5e,_0x14cf5a){_0x431a5e=_0x431a5e-0x0;var _0x843d89=_0x14a0[_0x431a5e];return _0x843d89;};'use strict';var Sequelize=require(_0x014a('0x0'));module[_0x014a('0x1')]={'name':{'type':Sequelize[_0x014a('0x2')]},'description':{'type':Sequelize[_0x014a('0x2')]},'username':{'type':Sequelize[_0x014a('0x2')],'unique':_0x014a('0x3')},'remoteUri':{'type':Sequelize[_0x014a('0x2')]},'password':{'type':Sequelize[_0x014a('0x2')]},'clientId':{'type':Sequelize[_0x014a('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x014a('0x2')]},'serverUrl':{'type':Sequelize[_0x014a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x014a('0x4'),_0x014a('0x5')),'defaultValue':_0x014a('0x4')}}; \ No newline at end of file +var _0x3588=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0x1e9934,_0x4146e6){var _0x358df6=function(_0x35635b){while(--_0x35635b){_0x1e9934['push'](_0x1e9934['shift']());}};_0x358df6(++_0x4146e6);}(_0x3588,0x82));var _0x8358=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x3588[_0x391c55];return _0xa434e0;};'use strict';var Sequelize=require(_0x8358('0x0'));module[_0x8358('0x1')]={'name':{'type':Sequelize[_0x8358('0x2')]},'description':{'type':Sequelize[_0x8358('0x2')]},'username':{'type':Sequelize[_0x8358('0x2')],'unique':_0x8358('0x3')},'remoteUri':{'type':Sequelize[_0x8358('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x8358('0x2')]},'clientSecret':{'type':Sequelize[_0x8358('0x2')]},'securityToken':{'type':Sequelize[_0x8358('0x2')]},'serverUrl':{'type':Sequelize[_0x8358('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8358('0x4'),_0x8358('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index daf235c..6d20602 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 _0x248d=['Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','limit','offset','count','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','nolimit','AccountId','getSubjects','Descriptions','getDescriptions','channel','SalesforceField','Subjects','Task','remoteUri','clientSecret','username','securityToken','substring','lastIndexOf','Connection','clientId','login','password','concat','isNil','ticketType','describe','ActivityDate','IsReminderSet','Description','string','picklist','boolean','email','textarea','phone','remove','includes','picklistValues','label','True','true','false','statusCode','getFields'];(function(_0x544099,_0x372b30){var _0x20ab09=function(_0x149613){while(--_0x149613){_0x544099['push'](_0x544099['shift']());}};_0x20ab09(++_0x372b30);}(_0x248d,0x77));var _0xd248=function(_0x513e86,_0x5f27c0){_0x513e86=_0x513e86-0x0;var _0x198093=_0x248d[_0x513e86];return _0x198093;};'use strict';var emlformat=require(_0xd248('0x0'));var rimraf=require(_0xd248('0x1'));var zipdir=require(_0xd248('0x2'));var jsonpatch=require(_0xd248('0x3'));var rp=require(_0xd248('0x4'));var moment=require(_0xd248('0x5'));var BPromise=require(_0xd248('0x6'));var Mustache=require(_0xd248('0x7'));var util=require(_0xd248('0x8'));var path=require(_0xd248('0x9'));var sox=require(_0xd248('0xa'));var csv=require('to-csv');var ejs=require(_0xd248('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd248('0xc'));var squel=require(_0xd248('0xd'));var crypto=require('crypto');var jsforce=require(_0xd248('0xe'));var deskjs=require(_0xd248('0xf'));var toCsv=require(_0xd248('0x10'));var querystring=require(_0xd248('0x11'));var Papa=require('papaparse');var Redis=require(_0xd248('0x12'));var authService=require(_0xd248('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd248('0x14'))('api');var utils=require(_0xd248('0x15'));var config=require(_0xd248('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd248('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x391f67,_0x3bc355){_0x3bc355=_0x3bc355||0xcc;return function(_0x40f320){if(_0x40f320){return _0x391f67['sendStatus'](_0x3bc355);}return _0x391f67['status'](_0x3bc355)[_0xd248('0x18')]();};}function respondWithResult(_0x4255fe,_0x597a2d){_0x597a2d=_0x597a2d||0xc8;return function(_0x119926){if(_0x119926){return _0x4255fe[_0xd248('0x19')](_0x597a2d)[_0xd248('0x1a')](_0x119926);}};}function respondWithFilteredResult(_0xf8c11b,_0x23530e){return function(_0x198c30){if(_0x198c30){var _0x5a50be=typeof _0x23530e['offset']===_0xd248('0x1b')&&typeof _0x23530e[_0xd248('0x1c')]===_0xd248('0x1b');var _0x1c4b56=_0x198c30['count'];var _0x6fa1f6=_0x5a50be?0x0:_0x23530e[_0xd248('0x1d')];var _0x4f8439=_0x5a50be?_0x198c30[_0xd248('0x1e')]:_0x23530e[_0xd248('0x1d')]+_0x23530e[_0xd248('0x1c')];var _0x45ce60;if(_0x4f8439>=_0x1c4b56){_0x4f8439=_0x1c4b56;_0x45ce60=0xc8;}else{_0x45ce60=0xce;}_0xf8c11b['status'](_0x45ce60);return _0xf8c11b['set'](_0xd248('0x1f'),_0x6fa1f6+'-'+_0x4f8439+'/'+_0x1c4b56)[_0xd248('0x1a')](_0x198c30);}return null;};}function patchUpdates(_0x221766){return function(_0x4f56f6){try{jsonpatch['apply'](_0x4f56f6,_0x221766,!![]);}catch(_0x39dd33){return BPromise[_0xd248('0x20')](_0x39dd33);}return _0x4f56f6[_0xd248('0x21')]();};}function saveUpdates(_0xda77be,_0x4c12c1){return function(_0x3a19d7){if(_0x3a19d7){return _0x3a19d7[_0xd248('0x22')](_0xda77be)['then'](function(_0x446ee0){return _0x446ee0;});}return null;};}function removeEntity(_0x3c1ecf,_0x5756ff){return function(_0x5aa346){if(_0x5aa346){return _0x5aa346[_0xd248('0x23')]()[_0xd248('0x24')](function(){_0x3c1ecf[_0xd248('0x19')](0xcc)[_0xd248('0x18')]();});}};}function handleEntityNotFound(_0x520e36,_0xf9ed15){return function(_0x37eec5){if(!_0x37eec5){_0x520e36[_0xd248('0x25')](0x194);}return _0x37eec5;};}function handleError(_0x2d438f,_0x5ddc9d){_0x5ddc9d=_0x5ddc9d||0x1f4;return function(_0x4d82c3){logger[_0xd248('0x26')](_0x4d82c3[_0xd248('0x27')]);if(_0x4d82c3[_0xd248('0x28')]){delete _0x4d82c3[_0xd248('0x28')];}_0x2d438f[_0xd248('0x19')](_0x5ddc9d)[_0xd248('0x29')](_0x4d82c3);};}exports['index']=function(_0x5beafb,_0x251cce){var _0x1a99dc={},_0x3b1e56={},_0x5de50c={'count':0x0,'rows':[]};var _0x118382=_[_0xd248('0x2a')](db[_0xd248('0x2b')][_0xd248('0x2c')],function(_0x1ee8fe){return{'name':_0x1ee8fe[_0xd248('0x2d')],'type':_0x1ee8fe[_0xd248('0x2e')][_0xd248('0x2f')]};});_0x3b1e56[_0xd248('0x30')]=_['map'](_0x118382,_0xd248('0x28'));_0x3b1e56['query']=_[_0xd248('0x31')](_0x5beafb['query']);_0x3b1e56[_0xd248('0x32')]=_[_0xd248('0x33')](_0x3b1e56[_0xd248('0x30')],_0x3b1e56[_0xd248('0x34')]);_0x1a99dc[_0xd248('0x35')]=_[_0xd248('0x33')](_0x3b1e56[_0xd248('0x30')],qs[_0xd248('0x36')](_0x5beafb[_0xd248('0x34')][_0xd248('0x36')]));_0x1a99dc[_0xd248('0x35')]=_0x1a99dc['attributes'][_0xd248('0x37')]?_0x1a99dc[_0xd248('0x35')]:_0x3b1e56[_0xd248('0x30')];if(!_0x5beafb[_0xd248('0x34')][_0xd248('0x38')]('nolimit')){_0x1a99dc['limit']=qs[_0xd248('0x1c')](_0x5beafb['query'][_0xd248('0x1c')]);_0x1a99dc[_0xd248('0x1d')]=qs[_0xd248('0x1d')](_0x5beafb[_0xd248('0x34')][_0xd248('0x1d')]);}_0x1a99dc[_0xd248('0x39')]=qs[_0xd248('0x3a')](_0x5beafb[_0xd248('0x34')]['sort']);_0x1a99dc[_0xd248('0x3b')]=qs[_0xd248('0x32')](_['pick'](_0x5beafb['query'],_0x3b1e56[_0xd248('0x32')]),_0x118382);if(_0x5beafb[_0xd248('0x34')][_0xd248('0x3c')]){_0x1a99dc[_0xd248('0x3b')]=_['merge'](_0x1a99dc[_0xd248('0x3b')],{'$or':_[_0xd248('0x2a')](_0x118382,function(_0x59f0bb){if(_0x59f0bb['type']!=='VIRTUAL'){var _0x34618a={};_0x34618a[_0x59f0bb[_0xd248('0x28')]]={'$like':'%'+_0x5beafb[_0xd248('0x34')][_0xd248('0x3c')]+'%'};return _0x34618a;}})});}_0x1a99dc=_[_0xd248('0x3d')]({},_0x1a99dc,_0x5beafb[_0xd248('0x3e')]);var _0x32f440={'where':_0x1a99dc['where']};return db[_0xd248('0x2b')][_0xd248('0x1e')](_0x32f440)[_0xd248('0x24')](function(_0xa381ee){_0x5de50c['count']=_0xa381ee;if(_0x5beafb[_0xd248('0x34')][_0xd248('0x3f')]){_0x1a99dc[_0xd248('0x40')]=[{'all':!![]}];}return db[_0xd248('0x2b')][_0xd248('0x41')](_0x1a99dc);})[_0xd248('0x24')](function(_0x190e06){_0x5de50c[_0xd248('0x42')]=_0x190e06;return _0x5de50c;})[_0xd248('0x24')](respondWithFilteredResult(_0x251cce,_0x1a99dc))[_0xd248('0x43')](handleError(_0x251cce,null));};exports['show']=function(_0x371aa2,_0x317eac){var _0x26601a={'raw':![],'where':{'id':_0x371aa2[_0xd248('0x44')]['id']}},_0x2c4b6a={};_0x2c4b6a[_0xd248('0x30')]=_[_0xd248('0x31')](db[_0xd248('0x2b')][_0xd248('0x2c')]);_0x2c4b6a[_0xd248('0x34')]=_[_0xd248('0x31')](_0x371aa2[_0xd248('0x34')]);_0x2c4b6a['filters']=_[_0xd248('0x33')](_0x2c4b6a[_0xd248('0x30')],_0x2c4b6a[_0xd248('0x34')]);_0x26601a['attributes']=_[_0xd248('0x33')](_0x2c4b6a['model'],qs[_0xd248('0x36')](_0x371aa2[_0xd248('0x34')][_0xd248('0x36')]));_0x26601a[_0xd248('0x35')]=_0x26601a['attributes'][_0xd248('0x37')]?_0x26601a[_0xd248('0x35')]:_0x2c4b6a[_0xd248('0x30')];if(_0x371aa2['query'][_0xd248('0x3f')]){_0x26601a[_0xd248('0x40')]=[{'all':!![]}];}_0x26601a=_[_0xd248('0x3d')]({},_0x26601a,_0x371aa2['options']);return db[_0xd248('0x2b')][_0xd248('0x45')](_0x26601a)[_0xd248('0x24')](handleEntityNotFound(_0x317eac,null))['then'](respondWithResult(_0x317eac,null))[_0xd248('0x43')](handleError(_0x317eac,null));};exports['create']=function(_0x2fc5cb,_0x15a9bf){return db[_0xd248('0x2b')][_0xd248('0x46')](_0x2fc5cb[_0xd248('0x47')],{})[_0xd248('0x24')](respondWithResult(_0x15a9bf,0xc9))[_0xd248('0x43')](handleError(_0x15a9bf,null));};exports[_0xd248('0x22')]=function(_0x51875d,_0x5b38df){if(_0x51875d[_0xd248('0x47')]['id']){delete _0x51875d[_0xd248('0x47')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x51875d['params']['id']}})[_0xd248('0x24')](handleEntityNotFound(_0x5b38df,null))[_0xd248('0x24')](saveUpdates(_0x51875d[_0xd248('0x47')],null))[_0xd248('0x24')](respondWithResult(_0x5b38df,null))[_0xd248('0x43')](handleError(_0x5b38df,null));};exports[_0xd248('0x23')]=function(_0x1476ac,_0x5fe366){return db[_0xd248('0x2b')]['find']({'where':{'id':_0x1476ac[_0xd248('0x44')]['id']}})[_0xd248('0x24')](handleEntityNotFound(_0x5fe366,null))[_0xd248('0x24')](removeEntity(_0x5fe366,null))[_0xd248('0x43')](handleError(_0x5fe366,null));};exports[_0xd248('0x48')]=function(_0x1c3285,_0x3a5f2e,_0x161e54){var _0x33d2fd={};var _0x222018={};var _0x5acff8;var _0x1569fd;return db['SalesforceAccount'][_0xd248('0x49')]({'where':{'id':_0x1c3285['params']['id']}})[_0xd248('0x24')](handleEntityNotFound(_0x3a5f2e,null))[_0xd248('0x24')](function(_0x260f7d){if(_0x260f7d){_0x5acff8=_0x260f7d;_0x222018['model']=_[_0xd248('0x31')](db[_0xd248('0x4a')]['rawAttributes']);_0x222018[_0xd248('0x34')]=_[_0xd248('0x31')](_0x1c3285[_0xd248('0x34')]);_0x222018[_0xd248('0x32')]=_[_0xd248('0x33')](_0x222018[_0xd248('0x30')],_0x222018[_0xd248('0x34')]);_0x33d2fd[_0xd248('0x35')]=_[_0xd248('0x33')](_0x222018[_0xd248('0x30')],qs[_0xd248('0x36')](_0x1c3285[_0xd248('0x34')][_0xd248('0x36')]));_0x33d2fd['attributes']=_0x33d2fd[_0xd248('0x35')][_0xd248('0x37')]?_0x33d2fd['attributes']:_0x222018[_0xd248('0x30')];_0x33d2fd[_0xd248('0x39')]=qs[_0xd248('0x3a')](_0x1c3285[_0xd248('0x34')]['sort']);_0x33d2fd['where']=qs[_0xd248('0x32')](_[_0xd248('0x4b')](_0x1c3285[_0xd248('0x34')],_0x222018[_0xd248('0x32')]));if(_0x1c3285[_0xd248('0x34')][_0xd248('0x3c')]){_0x33d2fd[_0xd248('0x3b')]=_[_0xd248('0x3d')](_0x33d2fd[_0xd248('0x3b')],{'$or':_[_0xd248('0x2a')](_0x33d2fd[_0xd248('0x35')],function(_0x322498){var _0x2243a0={};_0x2243a0[_0x322498]={'$like':'%'+_0x1c3285[_0xd248('0x34')][_0xd248('0x3c')]+'%'};return _0x2243a0;})});}_0x33d2fd=_[_0xd248('0x3d')]({},_0x33d2fd,_0x1c3285[_0xd248('0x3e')]);return _0x5acff8[_0xd248('0x48')](_0x33d2fd);}})[_0xd248('0x24')](function(_0x3de23f){if(_0x3de23f){_0x1569fd=_0x3de23f[_0xd248('0x37')];if(!_0x1c3285[_0xd248('0x34')][_0xd248('0x38')](_0xd248('0x4c'))){_0x33d2fd[_0xd248('0x1c')]=qs[_0xd248('0x1c')](_0x1c3285[_0xd248('0x34')][_0xd248('0x1c')]);_0x33d2fd[_0xd248('0x1d')]=qs[_0xd248('0x1d')](_0x1c3285[_0xd248('0x34')][_0xd248('0x1d')]);}return _0x5acff8[_0xd248('0x48')](_0x33d2fd);}})[_0xd248('0x24')](function(_0x627643){if(_0x627643){return _0x627643?{'count':_0x1569fd,'rows':_0x627643}:null;}})[_0xd248('0x24')](respondWithResult(_0x3a5f2e,null))[_0xd248('0x43')](handleError(_0x3a5f2e,null));};exports['addConfiguration']=function(_0x52b41f,_0x4e8afd,_0x27f338){if(_0x52b41f[_0xd248('0x47')]['id']){delete _0x52b41f['body']['id'];}return db[_0xd248('0x2b')]['findOne']({'where':{'id':_0x52b41f[_0xd248('0x44')]['id']}})[_0xd248('0x24')](handleEntityNotFound(_0x4e8afd,null))[_0xd248('0x24')](function(_0x3c8028){if(_0x3c8028){_0x52b41f['body'][_0xd248('0x4d')]=_0x3c8028['id'];_0x52b41f[_0xd248('0x47')]['Subjects']=integrations[_0xd248('0x4e')](_0x52b41f[_0xd248('0x47')]['channel'],_0x52b41f['body'][_0xd248('0x2e')]);_0x52b41f[_0xd248('0x47')][_0xd248('0x4f')]=integrations[_0xd248('0x50')](_0x52b41f[_0xd248('0x47')][_0xd248('0x51')],_0x52b41f['body'][_0xd248('0x2e')]);return db[_0xd248('0x4a')]['create'](_0x52b41f['body'],{'include':[{'model':db[_0xd248('0x52')],'as':_0xd248('0x53')},{'model':db['SalesforceField'],'as':_0xd248('0x4f')}]});}return null;})[_0xd248('0x24')](respondWithResult(_0x4e8afd,null))[_0xd248('0x43')](handleError(_0x4e8afd,null));};exports['getFields']=function(_0x5d94ea,_0x134607,_0x1b71cc){var _0x31d83d;var _0xb0c23d='';var _0x5da8a6=_0xd248('0x54');return db['SalesforceAccount']['findOne']({'where':{'id':_0x5d94ea[_0xd248('0x44')]['id']},'attributes':['id',_0xd248('0x55'),'clientId',_0xd248('0x56'),_0xd248('0x57'),'password',_0xd248('0x58')]})[_0xd248('0x24')](handleEntityNotFound(_0x134607,null))[_0xd248('0x24')](function(_0x14707a){if(_0x14707a){_0xb0c23d=_0x14707a[_0xd248('0x55')];var _0x49f48e=_0xb0c23d['slice'](-0x1);if(_0x49f48e==='/'){_0xb0c23d=_0xb0c23d[_0xd248('0x59')](0x0,_0xb0c23d[_0xd248('0x5a')](_0x49f48e));}_0x31d83d=new jsforce[(_0xd248('0x5b'))]({'oauth2':{'loginUrl':_0xb0c23d,'clientId':_0x14707a[_0xd248('0x5c')],'clientSecret':_0x14707a['clientSecret']}});return _0x31d83d[_0xd248('0x5d')](_0x14707a[_0xd248('0x57')],_0x14707a[_0xd248('0x5e')][_0xd248('0x5f')](_0x14707a[_0xd248('0x58')]));}})['then'](function(_0x33da08){if(_0x33da08){if(!_[_0xd248('0x60')](_0x5d94ea[_0xd248('0x34')]['ticketType'])){_0x5da8a6=_0x5d94ea['query'][_0xd248('0x61')];}return _0x31d83d['sobject'](_0x5da8a6)[_0xd248('0x62')]();}})[_0xd248('0x24')](function(_0x1b6db5){var _0x612a2d=['OwnerId',_0xd248('0x63'),_0xd248('0x64'),'IsRecurrence','Subject',_0xd248('0x65')];var _0x3be0ee=[_0xd248('0x66'),'int',_0xd248('0x67'),_0xd248('0x68'),_0xd248('0x69'),_0xd248('0x6a'),_0xd248('0x6b')];if(_0x1b6db5){_[_0xd248('0x6c')](_0x1b6db5['fields'],function(_0x5dd611){return _0x612a2d['includes'](_0x5dd611[_0xd248('0x28')])||!_0x3be0ee[_0xd248('0x6d')](_0x5dd611[_0xd248('0x2e')]);});return{'count':_0x1b6db5[_0xd248('0x36')][_0xd248('0x37')],'rows':_[_0xd248('0x2a')](_0x1b6db5['fields'],function(_0x5bc18a){return{'id':_0x5bc18a[_0xd248('0x28')],'name':_0x5bc18a['label'],'custom':_0x5bc18a['custom'],'options':_0x5bc18a[_0xd248('0x6e')][_0xd248('0x37')]>0x0?_['map'](_0x5bc18a[_0xd248('0x6e')],function(_0x1eb0d7){return{'name':_0x1eb0d7[_0xd248('0x6f')],'value':_0x1eb0d7['value']};}):_0x5bc18a['type']==_0xd248('0x68')?[{'name':_0xd248('0x70'),'value':_0xd248('0x71')},{'name':'False','value':_0xd248('0x72')}]:[]};})};}})[_0xd248('0x24')](respondWithResult(_0x134607,null))[_0xd248('0x43')](function(_0x337e7d){var _0x12e0a1=_0x5d94ea['query']['test']?0x1f4:_0x337e7d[_0xd248('0x73')]||0x1f4;logger[_0xd248('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xd248('0x74'),_0x12e0a1,JSON['stringify'](_0x337e7d));delete _0x337e7d[_0xd248('0x28')];if(_0x12e0a1===0x191){_0x12e0a1=0x190;}_0x134607[_0xd248('0x19')](_0x12e0a1)['send'](_0x5d94ea[_0xd248('0x34')]['test']?{'message':_0xd248('0x75'),'statusCode':_0x337e7d[_0xd248('0x73')]}:_0x337e7d);});}; \ No newline at end of file +var _0xb344=['mustache','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceAccount','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','filter','include','findAll','catch','show','params','options','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','AccountId','Subjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','Subject','Description','int','picklist','email','textarea','phone','includes','custom','picklistValues','label','value','boolean','True','true','False','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','bluebird'];(function(_0x552dec,_0x27a96d){var _0xcd5ca6=function(_0x455e1f){while(--_0x455e1f){_0x552dec['push'](_0x552dec['shift']());}};_0xcd5ca6(++_0x27a96d);}(_0xb344,0x72));var _0x4b34=function(_0xa40219,_0x21027e){_0xa40219=_0xa40219-0x0;var _0x391974=_0xb344[_0xa40219];return _0x391974;};'use strict';var emlformat=require(_0x4b34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b34('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b34('0x2'));var moment=require(_0x4b34('0x3'));var BPromise=require(_0x4b34('0x4'));var Mustache=require(_0x4b34('0x5'));var util=require(_0x4b34('0x6'));var path=require('path');var sox=require(_0x4b34('0x7'));var csv=require('to-csv');var ejs=require(_0x4b34('0x8'));var fs=require('fs');var fs_extra=require(_0x4b34('0x9'));var _=require(_0x4b34('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b34('0xb'));var deskjs=require(_0x4b34('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b34('0xd'));var Redis=require(_0x4b34('0xe'));var authService=require(_0x4b34('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b34('0x10'))('api');var utils=require(_0x4b34('0x11'));var config=require(_0x4b34('0x12'));var licenseUtil=require(_0x4b34('0x13'));var db=require(_0x4b34('0x14'))['db'];var integrations=require(_0x4b34('0x15'));function respondWithStatusCode(_0x14b22a,_0xe317cc){_0xe317cc=_0xe317cc||0xcc;return function(_0x1b156b){if(_0x1b156b){return _0x14b22a['sendStatus'](_0xe317cc);}return _0x14b22a[_0x4b34('0x16')](_0xe317cc)[_0x4b34('0x17')]();};}function respondWithResult(_0x30aa74,_0x2d0a04){_0x2d0a04=_0x2d0a04||0xc8;return function(_0x1e8ed9){if(_0x1e8ed9){return _0x30aa74[_0x4b34('0x16')](_0x2d0a04)[_0x4b34('0x18')](_0x1e8ed9);}};}function respondWithFilteredResult(_0x3d30a3,_0x2da49a){return function(_0x19754d){if(_0x19754d){var _0x240d0d=typeof _0x2da49a[_0x4b34('0x19')]===_0x4b34('0x1a')&&typeof _0x2da49a['limit']==='undefined';var _0x1bcd8a=_0x19754d[_0x4b34('0x1b')];var _0x1f0e3b=_0x240d0d?0x0:_0x2da49a[_0x4b34('0x19')];var _0x21274f=_0x240d0d?_0x19754d[_0x4b34('0x1b')]:_0x2da49a[_0x4b34('0x19')]+_0x2da49a['limit'];var _0x42c10a;if(_0x21274f>=_0x1bcd8a){_0x21274f=_0x1bcd8a;_0x42c10a=0xc8;}else{_0x42c10a=0xce;}_0x3d30a3['status'](_0x42c10a);return _0x3d30a3[_0x4b34('0x1c')](_0x4b34('0x1d'),_0x1f0e3b+'-'+_0x21274f+'/'+_0x1bcd8a)[_0x4b34('0x18')](_0x19754d);}return null;};}function patchUpdates(_0x29164c){return function(_0x5e3a37){try{jsonpatch['apply'](_0x5e3a37,_0x29164c,!![]);}catch(_0x4fb28c){return BPromise[_0x4b34('0x1e')](_0x4fb28c);}return _0x5e3a37[_0x4b34('0x1f')]();};}function saveUpdates(_0x5aaf8c,_0x32ed9c){return function(_0x3162f2){if(_0x3162f2){return _0x3162f2[_0x4b34('0x20')](_0x5aaf8c)[_0x4b34('0x21')](function(_0x69ac84){return _0x69ac84;});}return null;};}function removeEntity(_0x393b18,_0x1ca6b6){return function(_0x10be65){if(_0x10be65){return _0x10be65[_0x4b34('0x22')]()[_0x4b34('0x21')](function(){_0x393b18[_0x4b34('0x16')](0xcc)[_0x4b34('0x17')]();});}};}function handleEntityNotFound(_0x1e9e36,_0x32a117){return function(_0x58b173){if(!_0x58b173){_0x1e9e36[_0x4b34('0x23')](0x194);}return _0x58b173;};}function handleError(_0x8f86cb,_0x2f0735){_0x2f0735=_0x2f0735||0x1f4;return function(_0xdba054){logger[_0x4b34('0x24')](_0xdba054[_0x4b34('0x25')]);if(_0xdba054[_0x4b34('0x26')]){delete _0xdba054[_0x4b34('0x26')];}_0x8f86cb[_0x4b34('0x16')](_0x2f0735)[_0x4b34('0x27')](_0xdba054);};}exports[_0x4b34('0x28')]=function(_0x28ca04,_0x21b128){var _0x48fda0={},_0x62aabb={},_0x2df832={'count':0x0,'rows':[]};var _0x110c30=_[_0x4b34('0x29')](db[_0x4b34('0x2a')]['rawAttributes'],function(_0x4694fa){return{'name':_0x4694fa[_0x4b34('0x2b')],'type':_0x4694fa[_0x4b34('0x2c')]['key']};});_0x62aabb[_0x4b34('0x2d')]=_[_0x4b34('0x29')](_0x110c30,_0x4b34('0x26'));_0x62aabb[_0x4b34('0x2e')]=_[_0x4b34('0x2f')](_0x28ca04['query']);_0x62aabb[_0x4b34('0x30')]=_[_0x4b34('0x31')](_0x62aabb[_0x4b34('0x2d')],_0x62aabb[_0x4b34('0x2e')]);_0x48fda0['attributes']=_[_0x4b34('0x31')](_0x62aabb[_0x4b34('0x2d')],qs['fields'](_0x28ca04[_0x4b34('0x2e')][_0x4b34('0x32')]));_0x48fda0[_0x4b34('0x33')]=_0x48fda0[_0x4b34('0x33')][_0x4b34('0x34')]?_0x48fda0[_0x4b34('0x33')]:_0x62aabb[_0x4b34('0x2d')];if(!_0x28ca04[_0x4b34('0x2e')][_0x4b34('0x35')](_0x4b34('0x36'))){_0x48fda0['limit']=qs[_0x4b34('0x37')](_0x28ca04[_0x4b34('0x2e')][_0x4b34('0x37')]);_0x48fda0[_0x4b34('0x19')]=qs['offset'](_0x28ca04[_0x4b34('0x2e')][_0x4b34('0x19')]);}_0x48fda0[_0x4b34('0x38')]=qs[_0x4b34('0x39')](_0x28ca04[_0x4b34('0x2e')]['sort']);_0x48fda0[_0x4b34('0x3a')]=qs[_0x4b34('0x30')](_['pick'](_0x28ca04[_0x4b34('0x2e')],_0x62aabb[_0x4b34('0x30')]),_0x110c30);if(_0x28ca04['query']['filter']){_0x48fda0[_0x4b34('0x3a')]=_[_0x4b34('0x3b')](_0x48fda0[_0x4b34('0x3a')],{'$or':_[_0x4b34('0x29')](_0x110c30,function(_0x3a140b){if(_0x3a140b[_0x4b34('0x2c')]!=='VIRTUAL'){var _0x3996ff={};_0x3996ff[_0x3a140b[_0x4b34('0x26')]]={'$like':'%'+_0x28ca04['query'][_0x4b34('0x3c')]+'%'};return _0x3996ff;}})});}_0x48fda0=_[_0x4b34('0x3b')]({},_0x48fda0,_0x28ca04['options']);var _0x573a66={'where':_0x48fda0[_0x4b34('0x3a')]};return db['SalesforceAccount']['count'](_0x573a66)[_0x4b34('0x21')](function(_0x37d194){_0x2df832[_0x4b34('0x1b')]=_0x37d194;if(_0x28ca04[_0x4b34('0x2e')]['includeAll']){_0x48fda0[_0x4b34('0x3d')]=[{'all':!![]}];}return db[_0x4b34('0x2a')][_0x4b34('0x3e')](_0x48fda0);})[_0x4b34('0x21')](function(_0x39ea5d){_0x2df832['rows']=_0x39ea5d;return _0x2df832;})['then'](respondWithFilteredResult(_0x21b128,_0x48fda0))[_0x4b34('0x3f')](handleError(_0x21b128,null));};exports[_0x4b34('0x40')]=function(_0x5f55b7,_0xe04d45){var _0x45c6f5={'raw':![],'where':{'id':_0x5f55b7[_0x4b34('0x41')]['id']}},_0xe731c1={};_0xe731c1['model']=_[_0x4b34('0x2f')](db[_0x4b34('0x2a')]['rawAttributes']);_0xe731c1[_0x4b34('0x2e')]=_[_0x4b34('0x2f')](_0x5f55b7[_0x4b34('0x2e')]);_0xe731c1[_0x4b34('0x30')]=_[_0x4b34('0x31')](_0xe731c1['model'],_0xe731c1[_0x4b34('0x2e')]);_0x45c6f5[_0x4b34('0x33')]=_['intersection'](_0xe731c1[_0x4b34('0x2d')],qs[_0x4b34('0x32')](_0x5f55b7[_0x4b34('0x2e')][_0x4b34('0x32')]));_0x45c6f5['attributes']=_0x45c6f5['attributes'][_0x4b34('0x34')]?_0x45c6f5[_0x4b34('0x33')]:_0xe731c1[_0x4b34('0x2d')];if(_0x5f55b7['query']['includeAll']){_0x45c6f5['include']=[{'all':!![]}];}_0x45c6f5=_['merge']({},_0x45c6f5,_0x5f55b7[_0x4b34('0x42')]);return db[_0x4b34('0x2a')][_0x4b34('0x43')](_0x45c6f5)['then'](handleEntityNotFound(_0xe04d45,null))[_0x4b34('0x21')](respondWithResult(_0xe04d45,null))[_0x4b34('0x3f')](handleError(_0xe04d45,null));};exports['create']=function(_0x46547d,_0x5ca825){return db[_0x4b34('0x2a')][_0x4b34('0x44')](_0x46547d[_0x4b34('0x45')],{})[_0x4b34('0x21')](respondWithResult(_0x5ca825,0xc9))['catch'](handleError(_0x5ca825,null));};exports[_0x4b34('0x20')]=function(_0xbc25de,_0x488f1f){if(_0xbc25de[_0x4b34('0x45')]['id']){delete _0xbc25de[_0x4b34('0x45')]['id'];}return db[_0x4b34('0x2a')][_0x4b34('0x43')]({'where':{'id':_0xbc25de[_0x4b34('0x41')]['id']}})[_0x4b34('0x21')](handleEntityNotFound(_0x488f1f,null))[_0x4b34('0x21')](saveUpdates(_0xbc25de[_0x4b34('0x45')],null))[_0x4b34('0x21')](respondWithResult(_0x488f1f,null))['catch'](handleError(_0x488f1f,null));};exports[_0x4b34('0x22')]=function(_0x377f09,_0xf9a48c){return db[_0x4b34('0x2a')][_0x4b34('0x43')]({'where':{'id':_0x377f09[_0x4b34('0x41')]['id']}})[_0x4b34('0x21')](handleEntityNotFound(_0xf9a48c,null))[_0x4b34('0x21')](removeEntity(_0xf9a48c,null))[_0x4b34('0x3f')](handleError(_0xf9a48c,null));};exports[_0x4b34('0x46')]=function(_0x23757e,_0x3079cb,_0x30c49c){var _0x559f02={};var _0x1e1c4b={};var _0x901402;var _0x45d206;return db[_0x4b34('0x2a')][_0x4b34('0x47')]({'where':{'id':_0x23757e[_0x4b34('0x41')]['id']}})[_0x4b34('0x21')](handleEntityNotFound(_0x3079cb,null))[_0x4b34('0x21')](function(_0x3f58dd){if(_0x3f58dd){_0x901402=_0x3f58dd;_0x1e1c4b[_0x4b34('0x2d')]=_[_0x4b34('0x2f')](db[_0x4b34('0x48')]['rawAttributes']);_0x1e1c4b[_0x4b34('0x2e')]=_['keys'](_0x23757e[_0x4b34('0x2e')]);_0x1e1c4b[_0x4b34('0x30')]=_[_0x4b34('0x31')](_0x1e1c4b[_0x4b34('0x2d')],_0x1e1c4b[_0x4b34('0x2e')]);_0x559f02[_0x4b34('0x33')]=_[_0x4b34('0x31')](_0x1e1c4b[_0x4b34('0x2d')],qs[_0x4b34('0x32')](_0x23757e[_0x4b34('0x2e')][_0x4b34('0x32')]));_0x559f02[_0x4b34('0x33')]=_0x559f02[_0x4b34('0x33')][_0x4b34('0x34')]?_0x559f02['attributes']:_0x1e1c4b[_0x4b34('0x2d')];_0x559f02[_0x4b34('0x38')]=qs[_0x4b34('0x39')](_0x23757e['query'][_0x4b34('0x39')]);_0x559f02[_0x4b34('0x3a')]=qs[_0x4b34('0x30')](_[_0x4b34('0x49')](_0x23757e[_0x4b34('0x2e')],_0x1e1c4b[_0x4b34('0x30')]));if(_0x23757e['query'][_0x4b34('0x3c')]){_0x559f02[_0x4b34('0x3a')]=_[_0x4b34('0x3b')](_0x559f02[_0x4b34('0x3a')],{'$or':_['map'](_0x559f02[_0x4b34('0x33')],function(_0x46fcb8){var _0x2c2770={};_0x2c2770[_0x46fcb8]={'$like':'%'+_0x23757e[_0x4b34('0x2e')][_0x4b34('0x3c')]+'%'};return _0x2c2770;})});}_0x559f02=_['merge']({},_0x559f02,_0x23757e[_0x4b34('0x42')]);return _0x901402[_0x4b34('0x46')](_0x559f02);}})[_0x4b34('0x21')](function(_0x101c81){if(_0x101c81){_0x45d206=_0x101c81[_0x4b34('0x34')];if(!_0x23757e[_0x4b34('0x2e')][_0x4b34('0x35')](_0x4b34('0x36'))){_0x559f02[_0x4b34('0x37')]=qs[_0x4b34('0x37')](_0x23757e[_0x4b34('0x2e')][_0x4b34('0x37')]);_0x559f02['offset']=qs['offset'](_0x23757e[_0x4b34('0x2e')]['offset']);}return _0x901402[_0x4b34('0x46')](_0x559f02);}})[_0x4b34('0x21')](function(_0x562ee9){if(_0x562ee9){return _0x562ee9?{'count':_0x45d206,'rows':_0x562ee9}:null;}})[_0x4b34('0x21')](respondWithResult(_0x3079cb,null))[_0x4b34('0x3f')](handleError(_0x3079cb,null));};exports['addConfiguration']=function(_0x10710f,_0x5bd2ad,_0x2c7aeb){if(_0x10710f[_0x4b34('0x45')]['id']){delete _0x10710f[_0x4b34('0x45')]['id'];}return db[_0x4b34('0x2a')][_0x4b34('0x47')]({'where':{'id':_0x10710f[_0x4b34('0x41')]['id']}})[_0x4b34('0x21')](handleEntityNotFound(_0x5bd2ad,null))[_0x4b34('0x21')](function(_0x344ad4){if(_0x344ad4){_0x10710f[_0x4b34('0x45')][_0x4b34('0x4a')]=_0x344ad4['id'];_0x10710f[_0x4b34('0x45')][_0x4b34('0x4b')]=integrations['getSubjects'](_0x10710f[_0x4b34('0x45')][_0x4b34('0x4c')],_0x10710f[_0x4b34('0x45')][_0x4b34('0x2c')]);_0x10710f[_0x4b34('0x45')][_0x4b34('0x4d')]=integrations['getDescriptions'](_0x10710f[_0x4b34('0x45')][_0x4b34('0x4c')],_0x10710f[_0x4b34('0x45')][_0x4b34('0x2c')]);return db[_0x4b34('0x48')][_0x4b34('0x44')](_0x10710f[_0x4b34('0x45')],{'include':[{'model':db[_0x4b34('0x4e')],'as':_0x4b34('0x4b')},{'model':db[_0x4b34('0x4e')],'as':_0x4b34('0x4d')}]});}return null;})[_0x4b34('0x21')](respondWithResult(_0x5bd2ad,null))['catch'](handleError(_0x5bd2ad,null));};exports[_0x4b34('0x4f')]=function(_0x40268b,_0x50c074,_0x486642){var _0x30acbc;var _0x334e91='';var _0x372a2f=_0x4b34('0x50');return db[_0x4b34('0x2a')][_0x4b34('0x47')]({'where':{'id':_0x40268b[_0x4b34('0x41')]['id']},'attributes':['id',_0x4b34('0x51'),_0x4b34('0x52'),_0x4b34('0x53'),_0x4b34('0x54'),_0x4b34('0x55'),_0x4b34('0x56')]})[_0x4b34('0x21')](handleEntityNotFound(_0x50c074,null))['then'](function(_0xd8730e){if(_0xd8730e){_0x334e91=_0xd8730e['remoteUri'];var _0x54f83c=_0x334e91['slice'](-0x1);if(_0x54f83c==='/'){_0x334e91=_0x334e91[_0x4b34('0x57')](0x0,_0x334e91[_0x4b34('0x58')](_0x54f83c));}_0x30acbc=new jsforce[(_0x4b34('0x59'))]({'oauth2':{'loginUrl':_0x334e91,'clientId':_0xd8730e['clientId'],'clientSecret':_0xd8730e[_0x4b34('0x53')]}});return _0x30acbc[_0x4b34('0x5a')](_0xd8730e['username'],_0xd8730e[_0x4b34('0x55')][_0x4b34('0x5b')](_0xd8730e[_0x4b34('0x56')]));}})[_0x4b34('0x21')](function(_0x163b74){if(_0x163b74){if(!_[_0x4b34('0x5c')](_0x40268b[_0x4b34('0x2e')][_0x4b34('0x5d')])){_0x372a2f=_0x40268b[_0x4b34('0x2e')][_0x4b34('0x5d')];}return _0x30acbc[_0x4b34('0x5e')](_0x372a2f)[_0x4b34('0x5f')]();}})['then'](function(_0x20bcd2){var _0x4fdc9f=['OwnerId',_0x4b34('0x60'),_0x4b34('0x61'),'IsRecurrence',_0x4b34('0x62'),_0x4b34('0x63')];var _0xa3ac6f=['string',_0x4b34('0x64'),_0x4b34('0x65'),'boolean',_0x4b34('0x66'),_0x4b34('0x67'),_0x4b34('0x68')];if(_0x20bcd2){_['remove'](_0x20bcd2[_0x4b34('0x32')],function(_0x5c3770){return _0x4fdc9f['includes'](_0x5c3770[_0x4b34('0x26')])||!_0xa3ac6f[_0x4b34('0x69')](_0x5c3770['type']);});return{'count':_0x20bcd2['fields'][_0x4b34('0x34')],'rows':_[_0x4b34('0x29')](_0x20bcd2[_0x4b34('0x32')],function(_0x3284ff){return{'id':_0x3284ff[_0x4b34('0x26')],'name':_0x3284ff['label'],'custom':_0x3284ff[_0x4b34('0x6a')],'options':_0x3284ff['picklistValues'][_0x4b34('0x34')]>0x0?_['map'](_0x3284ff[_0x4b34('0x6b')],function(_0x23690a){return{'name':_0x23690a[_0x4b34('0x6c')],'value':_0x23690a[_0x4b34('0x6d')]};}):_0x3284ff[_0x4b34('0x2c')]==_0x4b34('0x6e')?[{'name':_0x4b34('0x6f'),'value':_0x4b34('0x70')},{'name':_0x4b34('0x71'),'value':'false'}]:[]};})};}})[_0x4b34('0x21')](respondWithResult(_0x50c074,null))['catch'](function(_0x22726c){var _0xeb3d5f=_0x40268b[_0x4b34('0x2e')][_0x4b34('0x72')]?0x1f4:_0x22726c['statusCode']||0x1f4;logger[_0x4b34('0x24')](_0x4b34('0x73'),_0x4b34('0x4f'),_0xeb3d5f,JSON[_0x4b34('0x74')](_0x22726c));delete _0x22726c[_0x4b34('0x26')];if(_0xeb3d5f===0x191){_0xeb3d5f=0x190;}_0x50c074['status'](_0xeb3d5f)[_0x4b34('0x27')](_0x40268b['query'][_0x4b34('0x72')]?{'message':_0x4b34('0x75'),'statusCode':_0x22726c[_0x4b34('0x76')]}:_0x22726c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 78902eb..7a4d90b 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 _0xfe58=['./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xfe58,0x1cf));var _0x8fe5=function(_0x11fe63,_0x1273fd){_0x11fe63=_0x11fe63-0x0;var _0x7b823c=_0xfe58[_0x11fe63];return _0x7b823c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8fe5('0x0'))(_0x8fe5('0x1'));var moment=require(_0x8fe5('0x2'));var BPromise=require(_0x8fe5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fe5('0x4'));var rimraf=require(_0x8fe5('0x5'));var config=require(_0x8fe5('0x6'));var attributes=require(_0x8fe5('0x7'));var integrations=require(_0x8fe5('0x8'));module['exports']=function(_0x5efaad,_0xb2503){return _0x5efaad['define'](_0x8fe5('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2dae=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x5a4814,_0x281816){var _0x9f4ff3=function(_0x1c20e3){while(--_0x1c20e3){_0x5a4814['push'](_0x5a4814['shift']());}};_0x9f4ff3(++_0x281816);}(_0x2dae,0xc3));var _0xe2da=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x2dae[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var moment=require(_0xe2da('0x3'));var BPromise=require(_0xe2da('0x4'));var rp=require(_0xe2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var attributes=require(_0xe2da('0x8'));var integrations=require(_0xe2da('0x9'));module['exports']=function(_0x3e3e25,_0x89c70b){return _0x3e3e25[_0xe2da('0xa')](_0xe2da('0xb'),attributes,{'tableName':_0xe2da('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 0347e68..e920960 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 _0x4362=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','SalesforceAccount','options','raw','where','attributes','limit','map','include','model','then','GetSalesforceAccount','ShowSalesforceAccount','debug','lodash','util','moment'];(function(_0x4c82f2,_0x581330){var _0x4ac8f7=function(_0x53e1ee){while(--_0x53e1ee){_0x4c82f2['push'](_0x4c82f2['shift']());}};_0x4ac8f7(++_0x581330);}(_0x4362,0xdd));var _0x2436=function(_0x2af333,_0x54f43f){_0x2af333=_0x2af333-0x0;var _0x1f22a5=_0x4362[_0x2af333];return _0x1f22a5;};'use strict';var _=require(_0x2436('0x0'));var util=require(_0x2436('0x1'));var moment=require(_0x2436('0x2'));var BPromise=require(_0x2436('0x3'));var rs=require(_0x2436('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2436('0x5'));var logger=require(_0x2436('0x6'))(_0x2436('0x7'));var config=require(_0x2436('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2436('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1355de,_0x30c461,_0x1b6026){return new BPromise(function(_0x575d01,_0x3018bf){return client[_0x2436('0xa')](_0x1355de,_0x1b6026)['then'](function(_0x2a1cc3){logger['info'](_0x2436('0xb'),_0x30c461,_0x2436('0xc'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x30c461,_0x2436('0xc'),JSON[_0x2436('0xd')](_0x2a1cc3));if(_0x2a1cc3[_0x2436('0xe')]){if(_0x2a1cc3['error']['code']===0x1f4){logger[_0x2436('0xe')](_0x2436('0xb'),_0x30c461,_0x2a1cc3[_0x2436('0xe')][_0x2436('0xf')]);return _0x3018bf(_0x2a1cc3[_0x2436('0xe')]['message']);}logger[_0x2436('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x30c461,_0x2a1cc3['error']['message']);return _0x575d01(_0x2a1cc3[_0x2436('0xe')][_0x2436('0xf')]);}else{logger[_0x2436('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x30c461,_0x2436('0xc'));_0x575d01(_0x2a1cc3[_0x2436('0x11')][_0x2436('0xf')]);}})[_0x2436('0x12')](function(_0x32d607){logger['error'](_0x2436('0xb'),_0x30c461,_0x32d607);_0x3018bf(_0x32d607);});});}exports['GetSalesforceAccount']=function(_0xef44fe){var _0xcafa9a=this;return new Promise(function(_0x4dd9eb,_0x1241cd){return db[_0x2436('0x13')]['findAll']({'raw':_0xef44fe[_0x2436('0x14')]?_0xef44fe[_0x2436('0x14')][_0x2436('0x15')]===undefined?!![]:![]:!![],'where':_0xef44fe[_0x2436('0x14')]?_0xef44fe[_0x2436('0x14')][_0x2436('0x16')]||null:null,'attributes':_0xef44fe[_0x2436('0x14')]?_0xef44fe[_0x2436('0x14')][_0x2436('0x17')]||null:null,'limit':_0xef44fe[_0x2436('0x14')]?_0xef44fe[_0x2436('0x14')][_0x2436('0x18')]||null:null,'include':_0xef44fe[_0x2436('0x14')]?_0xef44fe[_0x2436('0x14')]['include']?_[_0x2436('0x19')](_0xef44fe[_0x2436('0x14')][_0x2436('0x1a')],function(_0x15569b){return{'model':db[_0x15569b[_0x2436('0x1b')]],'as':_0x15569b['as'],'attributes':_0x15569b[_0x2436('0x17')],'include':_0x15569b[_0x2436('0x1a')]?_[_0x2436('0x19')](_0x15569b['include'],function(_0x15b66a){return{'model':db[_0x15b66a[_0x2436('0x1b')]],'as':_0x15b66a['as'],'attributes':_0x15b66a['attributes'],'include':_0x15b66a['include']?_[_0x2436('0x19')](_0x15b66a['include'],function(_0x423967){return{'model':db[_0x423967['model']],'as':_0x423967['as'],'attributes':_0x423967['attributes']};}):[]};}):[]};}):[]:[]})[_0x2436('0x1c')](function(_0xc68d45){logger[_0x2436('0x10')](_0x2436('0x1d'),_0xef44fe);logger['debug'](_0x2436('0x1d'),_0xef44fe,JSON[_0x2436('0xd')](_0xc68d45));_0x4dd9eb(_0xc68d45);})[_0x2436('0x12')](function(_0x133be1){logger['error'](_0x2436('0x1d'),_0x133be1[_0x2436('0xf')],_0xef44fe);_0x1241cd(_0xcafa9a['error'](0x1f4,_0x133be1[_0x2436('0xf')]));});});};exports[_0x2436('0x1e')]=function(_0x588156){var _0x53c070=this;return new Promise(function(_0x247ca7,_0x69126b){return db[_0x2436('0x13')]['find']({'raw':_0x588156['options']?_0x588156[_0x2436('0x14')][_0x2436('0x15')]===undefined?!![]:![]:!![],'where':_0x588156[_0x2436('0x14')]?_0x588156[_0x2436('0x14')][_0x2436('0x16')]||null:null,'attributes':_0x588156['options']?_0x588156[_0x2436('0x14')][_0x2436('0x17')]||null:null,'include':_0x588156[_0x2436('0x14')]?_0x588156[_0x2436('0x14')][_0x2436('0x1a')]?_['map'](_0x588156[_0x2436('0x14')][_0x2436('0x1a')],function(_0x5769d3){return{'model':db[_0x5769d3[_0x2436('0x1b')]],'as':_0x5769d3['as'],'attributes':_0x5769d3['attributes'],'include':_0x5769d3[_0x2436('0x1a')]?_['map'](_0x5769d3[_0x2436('0x1a')],function(_0x2becb4){return{'model':db[_0x2becb4[_0x2436('0x1b')]],'as':_0x2becb4['as'],'attributes':_0x2becb4[_0x2436('0x17')],'include':_0x2becb4['include']?_[_0x2436('0x19')](_0x2becb4[_0x2436('0x1a')],function(_0x15c532){return{'model':db[_0x15c532[_0x2436('0x1b')]],'as':_0x15c532['as'],'attributes':_0x15c532[_0x2436('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2436('0x1c')](function(_0x23a5dc){logger['info'](_0x2436('0x1e'),_0x588156);logger[_0x2436('0x1f')]('ShowSalesforceAccount',_0x588156,JSON['stringify'](_0x23a5dc));_0x247ca7(_0x23a5dc);})[_0x2436('0x12')](function(_0x148ca1){logger[_0x2436('0xe')](_0x2436('0x1e'),_0x148ca1[_0x2436('0xf')],_0x588156);_0x69126b(_0x53c070[_0x2436('0xe')](0x1f4,_0x148ca1[_0x2436('0xf')]));});});}; \ No newline at end of file +var _0xce68=['jayson/promise','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model','info','ShowSalesforceAccount','find','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b1dcd,_0x3dc587){var _0x227a76=function(_0x2715e3){while(--_0x2715e3){_0x2b1dcd['push'](_0x2b1dcd['shift']());}};_0x227a76(++_0x3dc587);}(_0xce68,0x179));var _0x8ce6=function(_0x1a1922,_0xa5238d){_0x1a1922=_0x1a1922-0x0;var _0x1505c1=_0xce68[_0x1a1922];return _0x1505c1;};'use strict';var _=require(_0x8ce6('0x0'));var util=require(_0x8ce6('0x1'));var moment=require(_0x8ce6('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ce6('0x3'));var fs=require('fs');var Redis=require(_0x8ce6('0x4'));var db=require(_0x8ce6('0x5'))['db'];var utils=require(_0x8ce6('0x6'));var logger=require(_0x8ce6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8ce6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32a20b,_0x497a0f,_0x5ea196){return new BPromise(function(_0x43f44e,_0x16ee65){return client[_0x8ce6('0x9')](_0x32a20b,_0x5ea196)[_0x8ce6('0xa')](function(_0x58ea43){logger['info'](_0x8ce6('0xb'),_0x497a0f,_0x8ce6('0xc'));logger[_0x8ce6('0xd')](_0x8ce6('0xe'),_0x497a0f,_0x8ce6('0xc'),JSON[_0x8ce6('0xf')](_0x58ea43));if(_0x58ea43[_0x8ce6('0x10')]){if(_0x58ea43[_0x8ce6('0x10')][_0x8ce6('0x11')]===0x1f4){logger[_0x8ce6('0x10')](_0x8ce6('0xb'),_0x497a0f,_0x58ea43[_0x8ce6('0x10')]['message']);return _0x16ee65(_0x58ea43[_0x8ce6('0x10')][_0x8ce6('0x12')]);}logger[_0x8ce6('0x10')](_0x8ce6('0xb'),_0x497a0f,_0x58ea43[_0x8ce6('0x10')]['message']);return _0x43f44e(_0x58ea43[_0x8ce6('0x10')]['message']);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x497a0f,_0x8ce6('0xc'));_0x43f44e(_0x58ea43[_0x8ce6('0x13')][_0x8ce6('0x12')]);}})[_0x8ce6('0x14')](function(_0x2733ce){logger[_0x8ce6('0x10')](_0x8ce6('0xb'),_0x497a0f,_0x2733ce);_0x16ee65(_0x2733ce);});});}exports[_0x8ce6('0x15')]=function(_0x43f6a3){var _0x5eada4=this;return new Promise(function(_0x41961d,_0x2b982c){return db[_0x8ce6('0x16')][_0x8ce6('0x17')]({'raw':_0x43f6a3[_0x8ce6('0x18')]?_0x43f6a3[_0x8ce6('0x18')][_0x8ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x43f6a3[_0x8ce6('0x18')]?_0x43f6a3['options']['where']||null:null,'attributes':_0x43f6a3[_0x8ce6('0x18')]?_0x43f6a3[_0x8ce6('0x18')][_0x8ce6('0x1a')]||null:null,'limit':_0x43f6a3[_0x8ce6('0x18')]?_0x43f6a3['options'][_0x8ce6('0x1b')]||null:null,'include':_0x43f6a3[_0x8ce6('0x18')]?_0x43f6a3[_0x8ce6('0x18')][_0x8ce6('0x1c')]?_[_0x8ce6('0x1d')](_0x43f6a3['options'][_0x8ce6('0x1c')],function(_0x3ff11e){return{'model':db[_0x3ff11e['model']],'as':_0x3ff11e['as'],'attributes':_0x3ff11e[_0x8ce6('0x1a')],'include':_0x3ff11e[_0x8ce6('0x1c')]?_[_0x8ce6('0x1d')](_0x3ff11e['include'],function(_0x2bf383){return{'model':db[_0x2bf383[_0x8ce6('0x1e')]],'as':_0x2bf383['as'],'attributes':_0x2bf383[_0x8ce6('0x1a')],'include':_0x2bf383[_0x8ce6('0x1c')]?_[_0x8ce6('0x1d')](_0x2bf383['include'],function(_0x4096a6){return{'model':db[_0x4096a6[_0x8ce6('0x1e')]],'as':_0x4096a6['as'],'attributes':_0x4096a6[_0x8ce6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ce6('0xa')](function(_0xe47e88){logger[_0x8ce6('0x1f')](_0x8ce6('0x15'),_0x43f6a3);logger[_0x8ce6('0xd')]('GetSalesforceAccount',_0x43f6a3,JSON[_0x8ce6('0xf')](_0xe47e88));_0x41961d(_0xe47e88);})[_0x8ce6('0x14')](function(_0x10edf2){logger[_0x8ce6('0x10')](_0x8ce6('0x15'),_0x10edf2[_0x8ce6('0x12')],_0x43f6a3);_0x2b982c(_0x5eada4[_0x8ce6('0x10')](0x1f4,_0x10edf2[_0x8ce6('0x12')]));});});};exports[_0x8ce6('0x20')]=function(_0x4d928a){var _0x54159b=this;return new Promise(function(_0x31d041,_0x261e3a){return db[_0x8ce6('0x16')][_0x8ce6('0x21')]({'raw':_0x4d928a['options']?_0x4d928a[_0x8ce6('0x18')][_0x8ce6('0x19')]===undefined?!![]:![]:!![],'where':_0x4d928a[_0x8ce6('0x18')]?_0x4d928a[_0x8ce6('0x18')][_0x8ce6('0x22')]||null:null,'attributes':_0x4d928a[_0x8ce6('0x18')]?_0x4d928a[_0x8ce6('0x18')][_0x8ce6('0x1a')]||null:null,'include':_0x4d928a['options']?_0x4d928a[_0x8ce6('0x18')][_0x8ce6('0x1c')]?_[_0x8ce6('0x1d')](_0x4d928a[_0x8ce6('0x18')][_0x8ce6('0x1c')],function(_0x4e20d7){return{'model':db[_0x4e20d7[_0x8ce6('0x1e')]],'as':_0x4e20d7['as'],'attributes':_0x4e20d7[_0x8ce6('0x1a')],'include':_0x4e20d7['include']?_['map'](_0x4e20d7[_0x8ce6('0x1c')],function(_0x5157ac){return{'model':db[_0x5157ac[_0x8ce6('0x1e')]],'as':_0x5157ac['as'],'attributes':_0x5157ac[_0x8ce6('0x1a')],'include':_0x5157ac[_0x8ce6('0x1c')]?_[_0x8ce6('0x1d')](_0x5157ac[_0x8ce6('0x1c')],function(_0xd3ed61){return{'model':db[_0xd3ed61[_0x8ce6('0x1e')]],'as':_0xd3ed61['as'],'attributes':_0xd3ed61[_0x8ce6('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ce6('0xa')](function(_0x4470e3){logger['info'](_0x8ce6('0x20'),_0x4d928a);logger[_0x8ce6('0xd')](_0x8ce6('0x20'),_0x4d928a,JSON[_0x8ce6('0xf')](_0x4470e3));_0x31d041(_0x4470e3);})[_0x8ce6('0x14')](function(_0x525a6e){logger[_0x8ce6('0x10')](_0x8ce6('0x20'),_0x525a6e[_0x8ce6('0x12')],_0x4d928a);_0x261e3a(_0x54159b[_0x8ce6('0x10')](0x1f4,_0x525a6e['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 26b71f5..ffdbdf6 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xdb28,0x106));var _0x8db2=function(_0x24abc2,_0x2a6d6b){_0x24abc2=_0x24abc2-0x0;var _0x226750=_0xdb28[_0x24abc2];return _0x226750;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _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(_0x121e8d,_0xaf38aa){var _0x3b5905=function(_0x366887){while(--_0x366887){_0x121e8d['push'](_0x121e8d['shift']());}};_0x3b5905(++_0xaf38aa);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./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 d0a480d..8e5a81d 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 _0x682e=['contact_lead','contact','lead','account_contact_lead','nothing','account','sequelize','STRING','ENUM','Task','Case'];(function(_0xbd417f,_0x2f8a80){var _0x51f3c7=function(_0x7888e6){while(--_0x7888e6){_0xbd417f['push'](_0xbd417f['shift']());}};_0x51f3c7(++_0x2f8a80);}(_0x682e,0x119));var _0xe682=function(_0x123cd1,_0x48cb5a){_0x123cd1=_0x123cd1-0x0;var _0x4c13ee=_0x682e[_0x123cd1];return _0x4c13ee;};'use strict';var Sequelize=require(_0xe682('0x0'));module['exports']={'name':{'type':Sequelize[_0xe682('0x1')]},'description':{'type':Sequelize[_0xe682('0x1')]},'ticketType':{'type':Sequelize[_0xe682('0x2')](_0xe682('0x3'),_0xe682('0x4')),'defaultValue':_0xe682('0x3')},'moduleSearch':{'type':Sequelize[_0xe682('0x2')](_0xe682('0x5'),_0xe682('0x6'),_0xe682('0x7'),_0xe682('0x8'),'account'),'defaultValue':_0xe682('0x5')},'moduleCreate':{'type':Sequelize[_0xe682('0x2')](_0xe682('0x9'),_0xe682('0x6'),'lead',_0xe682('0xa')),'defaultValue':_0xe682('0x7')},'leadId':{'type':Sequelize[_0xe682('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xe682('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xe682('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xe682('0x1')]}}; \ No newline at end of file +var _0x1475=['sequelize','exports','STRING','Task','Case','contact_lead','contact','lead','account_contact_lead','account','ENUM','nothing'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x1475,0x144));var _0x5147=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x1475[_0xbec8e6];return _0x4aa6f2;};'use strict';var Sequelize=require(_0x5147('0x0'));module[_0x5147('0x1')]={'name':{'type':Sequelize[_0x5147('0x2')]},'description':{'type':Sequelize[_0x5147('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x5147('0x3'),_0x5147('0x4')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0x5147('0x5'),_0x5147('0x6'),_0x5147('0x7'),_0x5147('0x8'),_0x5147('0x9')),'defaultValue':_0x5147('0x5')},'moduleCreate':{'type':Sequelize[_0x5147('0xa')](_0x5147('0xb'),_0x5147('0x6'),_0x5147('0x7'),_0x5147('0x9')),'defaultValue':_0x5147('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x5147('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x5147('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x5147('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 96bd649..e9f6922 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 _0xb91a=['zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb91a,0xf4));var _0xab91=function(_0x354132,_0x1c02de){_0x354132=_0x354132-0x0;var _0x450777=_0xb91a[_0x354132];return _0x450777;};'use strict';var emlformat=require(_0xab91('0x0'));var rimraf=require(_0xab91('0x1'));var zipdir=require(_0xab91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab91('0x3'));var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require(_0xab91('0x6'));var path=require(_0xab91('0x7'));var sox=require(_0xab91('0x8'));var csv=require(_0xab91('0x9'));var ejs=require(_0xab91('0xa'));var fs=require('fs');var fs_extra=require(_0xab91('0xb'));var _=require(_0xab91('0xc'));var squel=require('squel');var crypto=require(_0xab91('0xd'));var jsforce=require(_0xab91('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab91('0xf'));var Redis=require(_0xab91('0x10'));var authService=require(_0xab91('0x11'));var qs=require(_0xab91('0x12'));var as=require(_0xab91('0x13'));var hardwareService=require(_0xab91('0x14'));var logger=require(_0xab91('0x15'))(_0xab91('0x16'));var utils=require(_0xab91('0x17'));var config=require(_0xab91('0x18'));var licenseUtil=require(_0xab91('0x19'));var db=require(_0xab91('0x1a'))['db'];function respondWithStatusCode(_0x283c91,_0x542d3f){_0x542d3f=_0x542d3f||0xcc;return function(_0x4f2af6){if(_0x4f2af6){return _0x283c91[_0xab91('0x1b')](_0x542d3f);}return _0x283c91[_0xab91('0x1c')](_0x542d3f)[_0xab91('0x1d')]();};}function respondWithResult(_0x14bded,_0x14b304){_0x14b304=_0x14b304||0xc8;return function(_0xaa6e77){if(_0xaa6e77){return _0x14bded['status'](_0x14b304)['json'](_0xaa6e77);}};}function respondWithFilteredResult(_0x3c102a,_0x3565c0){return function(_0x1b0d61){if(_0x1b0d61){var _0x2d2699=typeof _0x3565c0[_0xab91('0x1e')]===_0xab91('0x1f')&&typeof _0x3565c0[_0xab91('0x20')]===_0xab91('0x1f');var _0x499daf=_0x1b0d61['count'];var _0x1a0b66=_0x2d2699?0x0:_0x3565c0['offset'];var _0x609b8c=_0x2d2699?_0x1b0d61[_0xab91('0x21')]:_0x3565c0[_0xab91('0x1e')]+_0x3565c0['limit'];var _0xe80258;if(_0x609b8c>=_0x499daf){_0x609b8c=_0x499daf;_0xe80258=0xc8;}else{_0xe80258=0xce;}_0x3c102a['status'](_0xe80258);return _0x3c102a[_0xab91('0x22')]('Content-Range',_0x1a0b66+'-'+_0x609b8c+'/'+_0x499daf)['json'](_0x1b0d61);}return null;};}function patchUpdates(_0x13f065){return function(_0x4c5595){try{jsonpatch[_0xab91('0x23')](_0x4c5595,_0x13f065,!![]);}catch(_0x1f5def){return BPromise[_0xab91('0x24')](_0x1f5def);}return _0x4c5595['save']();};}function saveUpdates(_0x49f4d5,_0x40d29a){return function(_0xdedffe){if(_0xdedffe){return _0xdedffe[_0xab91('0x25')](_0x49f4d5)[_0xab91('0x26')](function(_0x1518e4){return _0x1518e4;});}return null;};}function removeEntity(_0xf8db06,_0x57a7e9){return function(_0x5eca53){if(_0x5eca53){return _0x5eca53[_0xab91('0x27')]()['then'](function(){_0xf8db06['status'](0xcc)[_0xab91('0x1d')]();});}};}function handleEntityNotFound(_0x1a0bc2,_0x5586cd){return function(_0x425d39){if(!_0x425d39){_0x1a0bc2['sendStatus'](0x194);}return _0x425d39;};}function handleError(_0x3fe2fc,_0x400134){_0x400134=_0x400134||0x1f4;return function(_0x5a3c05){logger[_0xab91('0x28')](_0x5a3c05[_0xab91('0x29')]);if(_0x5a3c05[_0xab91('0x2a')]){delete _0x5a3c05[_0xab91('0x2a')];}_0x3fe2fc[_0xab91('0x1c')](_0x400134)[_0xab91('0x2b')](_0x5a3c05);};}exports['index']=function(_0x281ede,_0x4c7a87){var _0x152c51={},_0x197d0c={},_0x1f7a4a={'count':0x0,'rows':[]};var _0x398fd3=_[_0xab91('0x2c')](db[_0xab91('0x2d')]['rawAttributes'],function(_0x29ef62){return{'name':_0x29ef62[_0xab91('0x2e')],'type':_0x29ef62[_0xab91('0x2f')][_0xab91('0x30')]};});_0x197d0c[_0xab91('0x31')]=_[_0xab91('0x2c')](_0x398fd3,'name');_0x197d0c[_0xab91('0x32')]=_[_0xab91('0x33')](_0x281ede[_0xab91('0x32')]);_0x197d0c[_0xab91('0x34')]=_['intersection'](_0x197d0c[_0xab91('0x31')],_0x197d0c[_0xab91('0x32')]);_0x152c51[_0xab91('0x35')]=_['intersection'](_0x197d0c[_0xab91('0x31')],qs['fields'](_0x281ede[_0xab91('0x32')][_0xab91('0x36')]));_0x152c51['attributes']=_0x152c51[_0xab91('0x35')][_0xab91('0x37')]?_0x152c51[_0xab91('0x35')]:_0x197d0c[_0xab91('0x31')];if(!_0x281ede[_0xab91('0x32')][_0xab91('0x38')](_0xab91('0x39'))){_0x152c51['limit']=qs['limit'](_0x281ede[_0xab91('0x32')][_0xab91('0x20')]);_0x152c51[_0xab91('0x1e')]=qs[_0xab91('0x1e')](_0x281ede[_0xab91('0x32')][_0xab91('0x1e')]);}_0x152c51[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_0x281ede['query'][_0xab91('0x3b')]);_0x152c51[_0xab91('0x3c')]=qs['filters'](_[_0xab91('0x3d')](_0x281ede['query'],_0x197d0c[_0xab91('0x34')]),_0x398fd3);if(_0x281ede[_0xab91('0x32')][_0xab91('0x3e')]){_0x152c51[_0xab91('0x3c')]=_['merge'](_0x152c51['where'],{'$or':_['map'](_0x398fd3,function(_0x427f27){if(_0x427f27[_0xab91('0x2f')]!=='VIRTUAL'){var _0x59c399={};_0x59c399[_0x427f27[_0xab91('0x2a')]]={'$like':'%'+_0x281ede[_0xab91('0x32')][_0xab91('0x3e')]+'%'};return _0x59c399;}})});}_0x152c51=_[_0xab91('0x3f')]({},_0x152c51,_0x281ede[_0xab91('0x40')]);var _0x303f91={'where':_0x152c51[_0xab91('0x3c')]};return db[_0xab91('0x2d')][_0xab91('0x21')](_0x303f91)[_0xab91('0x26')](function(_0x452c64){_0x1f7a4a['count']=_0x452c64;if(_0x281ede[_0xab91('0x32')][_0xab91('0x41')]){_0x152c51[_0xab91('0x42')]=[{'all':!![]}];}return db[_0xab91('0x2d')][_0xab91('0x43')](_0x152c51);})[_0xab91('0x26')](function(_0x5bf9f8){_0x1f7a4a[_0xab91('0x44')]=_0x5bf9f8;return _0x1f7a4a;})['then'](respondWithFilteredResult(_0x4c7a87,_0x152c51))[_0xab91('0x45')](handleError(_0x4c7a87,null));};exports[_0xab91('0x46')]=function(_0x1043ff,_0x742464){var _0x13d306={'raw':![],'where':{'id':_0x1043ff[_0xab91('0x47')]['id']}},_0x1305d2={};_0x1305d2[_0xab91('0x31')]=_[_0xab91('0x33')](db[_0xab91('0x2d')][_0xab91('0x48')]);_0x1305d2[_0xab91('0x32')]=_[_0xab91('0x33')](_0x1043ff[_0xab91('0x32')]);_0x1305d2[_0xab91('0x34')]=_[_0xab91('0x49')](_0x1305d2[_0xab91('0x31')],_0x1305d2['query']);_0x13d306[_0xab91('0x35')]=_[_0xab91('0x49')](_0x1305d2[_0xab91('0x31')],qs['fields'](_0x1043ff[_0xab91('0x32')][_0xab91('0x36')]));_0x13d306['attributes']=_0x13d306[_0xab91('0x35')][_0xab91('0x37')]?_0x13d306[_0xab91('0x35')]:_0x1305d2[_0xab91('0x31')];if(_0x1043ff['query'][_0xab91('0x41')]){_0x13d306['include']=[{'all':!![]}];}_0x13d306=_[_0xab91('0x3f')]({},_0x13d306,_0x1043ff['options']);return db[_0xab91('0x2d')][_0xab91('0x4a')](_0x13d306)[_0xab91('0x26')](handleEntityNotFound(_0x742464,null))[_0xab91('0x26')](respondWithResult(_0x742464,null))['catch'](handleError(_0x742464,null));};exports['create']=function(_0x39fcee,_0x5910ff){return db['SalesforceConfiguration'][_0xab91('0x4b')](_0x39fcee[_0xab91('0x4c')],{})[_0xab91('0x26')](respondWithResult(_0x5910ff,0xc9))['catch'](handleError(_0x5910ff,null));};exports[_0xab91('0x25')]=function(_0x4f0764,_0x5bf385){if(_0x4f0764[_0xab91('0x4c')]['id']){delete _0x4f0764[_0xab91('0x4c')]['id'];}return db['SalesforceConfiguration'][_0xab91('0x4a')]({'where':{'id':_0x4f0764['params']['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x5bf385,null))[_0xab91('0x26')](saveUpdates(_0x4f0764[_0xab91('0x4c')],null))['then'](respondWithResult(_0x5bf385,null))[_0xab91('0x45')](handleError(_0x5bf385,null));};exports[_0xab91('0x27')]=function(_0x2b88c4,_0xd408ed){return db[_0xab91('0x2d')][_0xab91('0x4a')]({'where':{'id':_0x2b88c4[_0xab91('0x47')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0xd408ed,null))[_0xab91('0x26')](removeEntity(_0xd408ed,null))[_0xab91('0x45')](handleError(_0xd408ed,null));};exports[_0xab91('0x4d')]=function(_0x14b0cc,_0x5325e0,_0x58ef3f){var _0x2eb0a3={};var _0x4b51f4={};var _0x32c0d5;var _0x222443;return db['SalesforceConfiguration'][_0xab91('0x4e')]({'where':{'id':_0x14b0cc[_0xab91('0x47')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x5325e0,null))[_0xab91('0x26')](function(_0x1bfc14){if(_0x1bfc14){_0x32c0d5=_0x1bfc14;_0x4b51f4[_0xab91('0x31')]=_[_0xab91('0x33')](db[_0xab91('0x4f')][_0xab91('0x48')]);_0x4b51f4[_0xab91('0x32')]=_[_0xab91('0x33')](_0x14b0cc[_0xab91('0x32')]);_0x4b51f4[_0xab91('0x34')]=_[_0xab91('0x49')](_0x4b51f4[_0xab91('0x31')],_0x4b51f4[_0xab91('0x32')]);_0x2eb0a3['attributes']=_[_0xab91('0x49')](_0x4b51f4[_0xab91('0x31')],qs[_0xab91('0x36')](_0x14b0cc[_0xab91('0x32')][_0xab91('0x36')]));_0x2eb0a3[_0xab91('0x35')]=_0x2eb0a3[_0xab91('0x35')]['length']?_0x2eb0a3[_0xab91('0x35')]:_0x4b51f4[_0xab91('0x31')];_0x2eb0a3[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_0x14b0cc[_0xab91('0x32')][_0xab91('0x3b')]);_0x2eb0a3[_0xab91('0x3c')]=qs[_0xab91('0x34')](_[_0xab91('0x3d')](_0x14b0cc[_0xab91('0x32')],_0x4b51f4[_0xab91('0x34')]));if(_0x14b0cc[_0xab91('0x32')][_0xab91('0x3e')]){_0x2eb0a3['where']=_[_0xab91('0x3f')](_0x2eb0a3[_0xab91('0x3c')],{'$or':_['map'](_0x2eb0a3[_0xab91('0x35')],function(_0x357e30){var _0x245c79={};_0x245c79[_0x357e30]={'$like':'%'+_0x14b0cc['query'][_0xab91('0x3e')]+'%'};return _0x245c79;})});}_0x2eb0a3=_['merge']({},_0x2eb0a3,_0x14b0cc['options']);return _0x32c0d5[_0xab91('0x4d')](_0x2eb0a3);}})[_0xab91('0x26')](function(_0x31b317){if(_0x31b317){_0x222443=_0x31b317[_0xab91('0x37')];if(!_0x14b0cc[_0xab91('0x32')]['hasOwnProperty'](_0xab91('0x39'))){_0x2eb0a3[_0xab91('0x20')]=qs['limit'](_0x14b0cc[_0xab91('0x32')][_0xab91('0x20')]);_0x2eb0a3[_0xab91('0x1e')]=qs[_0xab91('0x1e')](_0x14b0cc[_0xab91('0x32')][_0xab91('0x1e')]);}return _0x32c0d5[_0xab91('0x4d')](_0x2eb0a3);}})[_0xab91('0x26')](function(_0x221484){if(_0x221484){return _0x221484?{'count':_0x222443,'rows':_0x221484}:null;}})[_0xab91('0x26')](respondWithResult(_0x5325e0,null))[_0xab91('0x45')](handleError(_0x5325e0,null));};exports[_0xab91('0x50')]=function(_0x5dffed,_0x4ecae4,_0x396da5){var _0x5e7449={};var _0x650e98={};var _0x1ef756;var _0xcdf879;return db[_0xab91('0x2d')]['findOne']({'where':{'id':_0x5dffed[_0xab91('0x47')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x4ecae4,null))[_0xab91('0x26')](function(_0x148be0){if(_0x148be0){_0x1ef756=_0x148be0;_0x650e98[_0xab91('0x31')]=_[_0xab91('0x33')](db[_0xab91('0x4f')]['rawAttributes']);_0x650e98[_0xab91('0x32')]=_[_0xab91('0x33')](_0x5dffed[_0xab91('0x32')]);_0x650e98[_0xab91('0x34')]=_[_0xab91('0x49')](_0x650e98['model'],_0x650e98[_0xab91('0x32')]);_0x5e7449['attributes']=_[_0xab91('0x49')](_0x650e98[_0xab91('0x31')],qs['fields'](_0x5dffed['query']['fields']));_0x5e7449[_0xab91('0x35')]=_0x5e7449[_0xab91('0x35')][_0xab91('0x37')]?_0x5e7449['attributes']:_0x650e98[_0xab91('0x31')];_0x5e7449[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_0x5dffed[_0xab91('0x32')][_0xab91('0x3b')]);_0x5e7449[_0xab91('0x3c')]=qs['filters'](_['pick'](_0x5dffed[_0xab91('0x32')],_0x650e98['filters']));if(_0x5dffed['query'][_0xab91('0x3e')]){_0x5e7449[_0xab91('0x3c')]=_[_0xab91('0x3f')](_0x5e7449[_0xab91('0x3c')],{'$or':_[_0xab91('0x2c')](_0x5e7449['attributes'],function(_0x43d49d){var _0x18076a={};_0x18076a[_0x43d49d]={'$like':'%'+_0x5dffed[_0xab91('0x32')][_0xab91('0x3e')]+'%'};return _0x18076a;})});}_0x5e7449=_[_0xab91('0x3f')]({},_0x5e7449,_0x5dffed['options']);return _0x1ef756[_0xab91('0x50')](_0x5e7449);}})[_0xab91('0x26')](function(_0x3a1dd8){if(_0x3a1dd8){_0xcdf879=_0x3a1dd8[_0xab91('0x37')];if(!_0x5dffed[_0xab91('0x32')][_0xab91('0x38')](_0xab91('0x39'))){_0x5e7449[_0xab91('0x20')]=qs['limit'](_0x5dffed[_0xab91('0x32')][_0xab91('0x20')]);_0x5e7449[_0xab91('0x1e')]=qs[_0xab91('0x1e')](_0x5dffed[_0xab91('0x32')][_0xab91('0x1e')]);}return _0x1ef756[_0xab91('0x50')](_0x5e7449);}})[_0xab91('0x26')](function(_0x16350b){if(_0x16350b){return _0x16350b?{'count':_0xcdf879,'rows':_0x16350b}:null;}})['then'](respondWithResult(_0x4ecae4,null))[_0xab91('0x45')](handleError(_0x4ecae4,null));};exports[_0xab91('0x51')]=function(_0x4a9d5e,_0x5a2965,_0xe42401){var _0x3a4cda={};var _0xa951c2={};var _0x1668d3;var _0x294505;return db[_0xab91('0x2d')][_0xab91('0x4e')]({'where':{'id':_0x4a9d5e[_0xab91('0x47')]['id']}})[_0xab91('0x26')](handleEntityNotFound(_0x5a2965,null))[_0xab91('0x26')](function(_0x17ecf3){if(_0x17ecf3){_0x1668d3=_0x17ecf3;_0xa951c2[_0xab91('0x31')]=_[_0xab91('0x33')](db[_0xab91('0x4f')]['rawAttributes']);_0xa951c2[_0xab91('0x32')]=_[_0xab91('0x33')](_0x4a9d5e[_0xab91('0x32')]);_0xa951c2[_0xab91('0x34')]=_['intersection'](_0xa951c2[_0xab91('0x31')],_0xa951c2[_0xab91('0x32')]);_0x3a4cda[_0xab91('0x35')]=_[_0xab91('0x49')](_0xa951c2[_0xab91('0x31')],qs['fields'](_0x4a9d5e['query'][_0xab91('0x36')]));_0x3a4cda[_0xab91('0x35')]=_0x3a4cda[_0xab91('0x35')]['length']?_0x3a4cda[_0xab91('0x35')]:_0xa951c2[_0xab91('0x31')];_0x3a4cda[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_0x4a9d5e['query'][_0xab91('0x3b')]);_0x3a4cda[_0xab91('0x3c')]=qs[_0xab91('0x34')](_[_0xab91('0x3d')](_0x4a9d5e[_0xab91('0x32')],_0xa951c2[_0xab91('0x34')]));if(_0x4a9d5e[_0xab91('0x32')][_0xab91('0x3e')]){_0x3a4cda[_0xab91('0x3c')]=_[_0xab91('0x3f')](_0x3a4cda[_0xab91('0x3c')],{'$or':_['map'](_0x3a4cda[_0xab91('0x35')],function(_0x4ef3d7){var _0x1443fc={};_0x1443fc[_0x4ef3d7]={'$like':'%'+_0x4a9d5e[_0xab91('0x32')][_0xab91('0x3e')]+'%'};return _0x1443fc;})});}_0x3a4cda=_[_0xab91('0x3f')]({},_0x3a4cda,_0x4a9d5e[_0xab91('0x40')]);return _0x1668d3['getDescriptions'](_0x3a4cda);}})['then'](function(_0xea7b1b){if(_0xea7b1b){_0x294505=_0xea7b1b[_0xab91('0x37')];if(!_0x4a9d5e[_0xab91('0x32')]['hasOwnProperty'](_0xab91('0x39'))){_0x3a4cda['limit']=qs[_0xab91('0x20')](_0x4a9d5e[_0xab91('0x32')]['limit']);_0x3a4cda['offset']=qs[_0xab91('0x1e')](_0x4a9d5e[_0xab91('0x32')][_0xab91('0x1e')]);}return _0x1668d3[_0xab91('0x51')](_0x3a4cda);}})['then'](function(_0x50e137){if(_0x50e137){return _0x50e137?{'count':_0x294505,'rows':_0x50e137}:null;}})[_0xab91('0x26')](respondWithResult(_0x5a2965,null))[_0xab91('0x45')](handleError(_0x5a2965,null));}; \ No newline at end of file +var _0xfd69=['order','pick','filter','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','destroy','then','end','error','stack','name','index','SalesforceConfiguration','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','merge','map','VIRTUAL','options','includeAll','findAll','rows','keys','rawAttributes','find','catch','create','body','params','getFields','findOne','SalesforceField','nolimit','getSubjects'];(function(_0x363bea,_0x59e55d){var _0x49f6b5=function(_0xd5361){while(--_0xd5361){_0x363bea['push'](_0x363bea['shift']());}};_0x49f6b5(++_0x59e55d);}(_0xfd69,0xa4));var _0x9fd6=function(_0x21c269,_0x1c331b){_0x21c269=_0x21c269-0x0;var _0x5c1609=_0xfd69[_0x21c269];return _0x5c1609;};'use strict';var emlformat=require(_0x9fd6('0x0'));var rimraf=require(_0x9fd6('0x1'));var zipdir=require(_0x9fd6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9fd6('0x3'));var BPromise=require(_0x9fd6('0x4'));var Mustache=require(_0x9fd6('0x5'));var util=require(_0x9fd6('0x6'));var path=require(_0x9fd6('0x7'));var sox=require(_0x9fd6('0x8'));var csv=require(_0x9fd6('0x9'));var ejs=require(_0x9fd6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fd6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9fd6('0xc'));var deskjs=require(_0x9fd6('0xd'));var toCsv=require(_0x9fd6('0x9'));var querystring=require(_0x9fd6('0xe'));var Papa=require(_0x9fd6('0xf'));var Redis=require(_0x9fd6('0x10'));var authService=require(_0x9fd6('0x11'));var qs=require(_0x9fd6('0x12'));var as=require(_0x9fd6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9fd6('0x14'));var utils=require(_0x9fd6('0x15'));var config=require(_0x9fd6('0x16'));var licenseUtil=require(_0x9fd6('0x17'));var db=require(_0x9fd6('0x18'))['db'];function respondWithStatusCode(_0x210982,_0xc1c93a){_0xc1c93a=_0xc1c93a||0xcc;return function(_0x4cb167){if(_0x4cb167){return _0x210982[_0x9fd6('0x19')](_0xc1c93a);}return _0x210982[_0x9fd6('0x1a')](_0xc1c93a)['end']();};}function respondWithResult(_0xd2bdd,_0x26d302){_0x26d302=_0x26d302||0xc8;return function(_0x52e70a){if(_0x52e70a){return _0xd2bdd[_0x9fd6('0x1a')](_0x26d302)['json'](_0x52e70a);}};}function respondWithFilteredResult(_0xe97986,_0x1c57ef){return function(_0x4d9b39){if(_0x4d9b39){var _0x8dcfaf=typeof _0x1c57ef[_0x9fd6('0x1b')]==='undefined'&&typeof _0x1c57ef['limit']===_0x9fd6('0x1c');var _0x14d399=_0x4d9b39[_0x9fd6('0x1d')];var _0x2f981d=_0x8dcfaf?0x0:_0x1c57ef['offset'];var _0x901bf3=_0x8dcfaf?_0x4d9b39[_0x9fd6('0x1d')]:_0x1c57ef[_0x9fd6('0x1b')]+_0x1c57ef[_0x9fd6('0x1e')];var _0x5b9929;if(_0x901bf3>=_0x14d399){_0x901bf3=_0x14d399;_0x5b9929=0xc8;}else{_0x5b9929=0xce;}_0xe97986['status'](_0x5b9929);return _0xe97986[_0x9fd6('0x1f')]('Content-Range',_0x2f981d+'-'+_0x901bf3+'/'+_0x14d399)[_0x9fd6('0x20')](_0x4d9b39);}return null;};}function patchUpdates(_0x37ea64){return function(_0x45a1e1){try{jsonpatch[_0x9fd6('0x21')](_0x45a1e1,_0x37ea64,!![]);}catch(_0x3fb5a5){return BPromise[_0x9fd6('0x22')](_0x3fb5a5);}return _0x45a1e1['save']();};}function saveUpdates(_0x480172,_0x1433e4){return function(_0x430efb){if(_0x430efb){return _0x430efb[_0x9fd6('0x23')](_0x480172)['then'](function(_0x790b86){return _0x790b86;});}return null;};}function removeEntity(_0x1f2f32,_0x2475bb){return function(_0x363982){if(_0x363982){return _0x363982[_0x9fd6('0x24')]()[_0x9fd6('0x25')](function(){_0x1f2f32[_0x9fd6('0x1a')](0xcc)[_0x9fd6('0x26')]();});}};}function handleEntityNotFound(_0x53e50d,_0x423f42){return function(_0x7e7abe){if(!_0x7e7abe){_0x53e50d[_0x9fd6('0x19')](0x194);}return _0x7e7abe;};}function handleError(_0xc18ea4,_0x33d7b5){_0x33d7b5=_0x33d7b5||0x1f4;return function(_0x4d4ace){logger[_0x9fd6('0x27')](_0x4d4ace[_0x9fd6('0x28')]);if(_0x4d4ace[_0x9fd6('0x29')]){delete _0x4d4ace['name'];}_0xc18ea4[_0x9fd6('0x1a')](_0x33d7b5)['send'](_0x4d4ace);};}exports[_0x9fd6('0x2a')]=function(_0x244a56,_0x10a811){var _0x17c357={},_0x48c569={},_0x40d5b0={'count':0x0,'rows':[]};var _0x555dbb=_['map'](db[_0x9fd6('0x2b')]['rawAttributes'],function(_0x11c964){return{'name':_0x11c964[_0x9fd6('0x2c')],'type':_0x11c964[_0x9fd6('0x2d')][_0x9fd6('0x2e')]};});_0x48c569['model']=_['map'](_0x555dbb,'name');_0x48c569[_0x9fd6('0x2f')]=_['keys'](_0x244a56[_0x9fd6('0x2f')]);_0x48c569[_0x9fd6('0x30')]=_[_0x9fd6('0x31')](_0x48c569['model'],_0x48c569[_0x9fd6('0x2f')]);_0x17c357['attributes']=_[_0x9fd6('0x31')](_0x48c569[_0x9fd6('0x32')],qs[_0x9fd6('0x33')](_0x244a56[_0x9fd6('0x2f')]['fields']));_0x17c357[_0x9fd6('0x34')]=_0x17c357['attributes'][_0x9fd6('0x35')]?_0x17c357[_0x9fd6('0x34')]:_0x48c569[_0x9fd6('0x32')];if(!_0x244a56[_0x9fd6('0x2f')][_0x9fd6('0x36')]('nolimit')){_0x17c357[_0x9fd6('0x1e')]=qs[_0x9fd6('0x1e')](_0x244a56[_0x9fd6('0x2f')][_0x9fd6('0x1e')]);_0x17c357[_0x9fd6('0x1b')]=qs[_0x9fd6('0x1b')](_0x244a56['query']['offset']);}_0x17c357['order']=qs[_0x9fd6('0x37')](_0x244a56['query'][_0x9fd6('0x37')]);_0x17c357[_0x9fd6('0x38')]=qs[_0x9fd6('0x30')](_['pick'](_0x244a56['query'],_0x48c569[_0x9fd6('0x30')]),_0x555dbb);if(_0x244a56[_0x9fd6('0x2f')]['filter']){_0x17c357[_0x9fd6('0x38')]=_[_0x9fd6('0x39')](_0x17c357[_0x9fd6('0x38')],{'$or':_[_0x9fd6('0x3a')](_0x555dbb,function(_0x19e7d6){if(_0x19e7d6[_0x9fd6('0x2d')]!==_0x9fd6('0x3b')){var _0xa93654={};_0xa93654[_0x19e7d6[_0x9fd6('0x29')]]={'$like':'%'+_0x244a56['query']['filter']+'%'};return _0xa93654;}})});}_0x17c357=_[_0x9fd6('0x39')]({},_0x17c357,_0x244a56[_0x9fd6('0x3c')]);var _0x15fd80={'where':_0x17c357[_0x9fd6('0x38')]};return db[_0x9fd6('0x2b')][_0x9fd6('0x1d')](_0x15fd80)[_0x9fd6('0x25')](function(_0x344d12){_0x40d5b0['count']=_0x344d12;if(_0x244a56[_0x9fd6('0x2f')][_0x9fd6('0x3d')]){_0x17c357['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9fd6('0x3e')](_0x17c357);})[_0x9fd6('0x25')](function(_0x10af9a){_0x40d5b0[_0x9fd6('0x3f')]=_0x10af9a;return _0x40d5b0;})['then'](respondWithFilteredResult(_0x10a811,_0x17c357))['catch'](handleError(_0x10a811,null));};exports['show']=function(_0x205fd6,_0xe46ae3){var _0x13f2f1={'raw':![],'where':{'id':_0x205fd6['params']['id']}},_0x453b55={};_0x453b55['model']=_[_0x9fd6('0x40')](db[_0x9fd6('0x2b')][_0x9fd6('0x41')]);_0x453b55[_0x9fd6('0x2f')]=_[_0x9fd6('0x40')](_0x205fd6['query']);_0x453b55[_0x9fd6('0x30')]=_[_0x9fd6('0x31')](_0x453b55['model'],_0x453b55[_0x9fd6('0x2f')]);_0x13f2f1['attributes']=_[_0x9fd6('0x31')](_0x453b55[_0x9fd6('0x32')],qs['fields'](_0x205fd6[_0x9fd6('0x2f')]['fields']));_0x13f2f1['attributes']=_0x13f2f1[_0x9fd6('0x34')]['length']?_0x13f2f1[_0x9fd6('0x34')]:_0x453b55[_0x9fd6('0x32')];if(_0x205fd6['query'][_0x9fd6('0x3d')]){_0x13f2f1['include']=[{'all':!![]}];}_0x13f2f1=_['merge']({},_0x13f2f1,_0x205fd6['options']);return db[_0x9fd6('0x2b')][_0x9fd6('0x42')](_0x13f2f1)[_0x9fd6('0x25')](handleEntityNotFound(_0xe46ae3,null))['then'](respondWithResult(_0xe46ae3,null))[_0x9fd6('0x43')](handleError(_0xe46ae3,null));};exports[_0x9fd6('0x44')]=function(_0xc80a57,_0x4d16a0){return db[_0x9fd6('0x2b')][_0x9fd6('0x44')](_0xc80a57[_0x9fd6('0x45')],{})[_0x9fd6('0x25')](respondWithResult(_0x4d16a0,0xc9))['catch'](handleError(_0x4d16a0,null));};exports[_0x9fd6('0x23')]=function(_0x358467,_0x34b9de){if(_0x358467[_0x9fd6('0x45')]['id']){delete _0x358467[_0x9fd6('0x45')]['id'];}return db['SalesforceConfiguration'][_0x9fd6('0x42')]({'where':{'id':_0x358467['params']['id']}})[_0x9fd6('0x25')](handleEntityNotFound(_0x34b9de,null))[_0x9fd6('0x25')](saveUpdates(_0x358467[_0x9fd6('0x45')],null))[_0x9fd6('0x25')](respondWithResult(_0x34b9de,null))['catch'](handleError(_0x34b9de,null));};exports['destroy']=function(_0x23e2f6,_0x12988f){return db[_0x9fd6('0x2b')]['find']({'where':{'id':_0x23e2f6[_0x9fd6('0x46')]['id']}})[_0x9fd6('0x25')](handleEntityNotFound(_0x12988f,null))[_0x9fd6('0x25')](removeEntity(_0x12988f,null))[_0x9fd6('0x43')](handleError(_0x12988f,null));};exports[_0x9fd6('0x47')]=function(_0x10a382,_0x1452c0,_0xc5c0c7){var _0x2ecf4d={};var _0x19f124={};var _0x1c7348;var _0x7f9feb;return db['SalesforceConfiguration'][_0x9fd6('0x48')]({'where':{'id':_0x10a382[_0x9fd6('0x46')]['id']}})[_0x9fd6('0x25')](handleEntityNotFound(_0x1452c0,null))['then'](function(_0x303f7f){if(_0x303f7f){_0x1c7348=_0x303f7f;_0x19f124[_0x9fd6('0x32')]=_['keys'](db[_0x9fd6('0x49')][_0x9fd6('0x41')]);_0x19f124[_0x9fd6('0x2f')]=_[_0x9fd6('0x40')](_0x10a382[_0x9fd6('0x2f')]);_0x19f124['filters']=_[_0x9fd6('0x31')](_0x19f124[_0x9fd6('0x32')],_0x19f124[_0x9fd6('0x2f')]);_0x2ecf4d['attributes']=_['intersection'](_0x19f124['model'],qs['fields'](_0x10a382['query'][_0x9fd6('0x33')]));_0x2ecf4d[_0x9fd6('0x34')]=_0x2ecf4d[_0x9fd6('0x34')][_0x9fd6('0x35')]?_0x2ecf4d[_0x9fd6('0x34')]:_0x19f124[_0x9fd6('0x32')];_0x2ecf4d['order']=qs[_0x9fd6('0x37')](_0x10a382[_0x9fd6('0x2f')][_0x9fd6('0x37')]);_0x2ecf4d['where']=qs['filters'](_['pick'](_0x10a382['query'],_0x19f124[_0x9fd6('0x30')]));if(_0x10a382['query']['filter']){_0x2ecf4d[_0x9fd6('0x38')]=_['merge'](_0x2ecf4d['where'],{'$or':_[_0x9fd6('0x3a')](_0x2ecf4d[_0x9fd6('0x34')],function(_0x274199){var _0x880512={};_0x880512[_0x274199]={'$like':'%'+_0x10a382[_0x9fd6('0x2f')]['filter']+'%'};return _0x880512;})});}_0x2ecf4d=_[_0x9fd6('0x39')]({},_0x2ecf4d,_0x10a382['options']);return _0x1c7348[_0x9fd6('0x47')](_0x2ecf4d);}})[_0x9fd6('0x25')](function(_0x4761bd){if(_0x4761bd){_0x7f9feb=_0x4761bd[_0x9fd6('0x35')];if(!_0x10a382[_0x9fd6('0x2f')][_0x9fd6('0x36')](_0x9fd6('0x4a'))){_0x2ecf4d[_0x9fd6('0x1e')]=qs[_0x9fd6('0x1e')](_0x10a382[_0x9fd6('0x2f')][_0x9fd6('0x1e')]);_0x2ecf4d[_0x9fd6('0x1b')]=qs['offset'](_0x10a382['query'][_0x9fd6('0x1b')]);}return _0x1c7348[_0x9fd6('0x47')](_0x2ecf4d);}})['then'](function(_0xe67201){if(_0xe67201){return _0xe67201?{'count':_0x7f9feb,'rows':_0xe67201}:null;}})[_0x9fd6('0x25')](respondWithResult(_0x1452c0,null))[_0x9fd6('0x43')](handleError(_0x1452c0,null));};exports[_0x9fd6('0x4b')]=function(_0x457dad,_0xf2117,_0x1d852c){var _0x12e369={};var _0x370878={};var _0x1a8fbd;var _0x53caa7;return db[_0x9fd6('0x2b')][_0x9fd6('0x48')]({'where':{'id':_0x457dad['params']['id']}})['then'](handleEntityNotFound(_0xf2117,null))[_0x9fd6('0x25')](function(_0x21ff02){if(_0x21ff02){_0x1a8fbd=_0x21ff02;_0x370878[_0x9fd6('0x32')]=_[_0x9fd6('0x40')](db[_0x9fd6('0x49')][_0x9fd6('0x41')]);_0x370878[_0x9fd6('0x2f')]=_[_0x9fd6('0x40')](_0x457dad['query']);_0x370878['filters']=_[_0x9fd6('0x31')](_0x370878['model'],_0x370878[_0x9fd6('0x2f')]);_0x12e369[_0x9fd6('0x34')]=_[_0x9fd6('0x31')](_0x370878['model'],qs[_0x9fd6('0x33')](_0x457dad[_0x9fd6('0x2f')][_0x9fd6('0x33')]));_0x12e369[_0x9fd6('0x34')]=_0x12e369[_0x9fd6('0x34')][_0x9fd6('0x35')]?_0x12e369['attributes']:_0x370878[_0x9fd6('0x32')];_0x12e369[_0x9fd6('0x4c')]=qs['sort'](_0x457dad['query'][_0x9fd6('0x37')]);_0x12e369['where']=qs[_0x9fd6('0x30')](_[_0x9fd6('0x4d')](_0x457dad[_0x9fd6('0x2f')],_0x370878[_0x9fd6('0x30')]));if(_0x457dad['query'][_0x9fd6('0x4e')]){_0x12e369[_0x9fd6('0x38')]=_[_0x9fd6('0x39')](_0x12e369[_0x9fd6('0x38')],{'$or':_[_0x9fd6('0x3a')](_0x12e369[_0x9fd6('0x34')],function(_0x521388){var _0x19349b={};_0x19349b[_0x521388]={'$like':'%'+_0x457dad[_0x9fd6('0x2f')]['filter']+'%'};return _0x19349b;})});}_0x12e369=_[_0x9fd6('0x39')]({},_0x12e369,_0x457dad[_0x9fd6('0x3c')]);return _0x1a8fbd[_0x9fd6('0x4b')](_0x12e369);}})['then'](function(_0x2e8384){if(_0x2e8384){_0x53caa7=_0x2e8384[_0x9fd6('0x35')];if(!_0x457dad[_0x9fd6('0x2f')][_0x9fd6('0x36')]('nolimit')){_0x12e369[_0x9fd6('0x1e')]=qs[_0x9fd6('0x1e')](_0x457dad[_0x9fd6('0x2f')][_0x9fd6('0x1e')]);_0x12e369['offset']=qs[_0x9fd6('0x1b')](_0x457dad[_0x9fd6('0x2f')][_0x9fd6('0x1b')]);}return _0x1a8fbd['getSubjects'](_0x12e369);}})[_0x9fd6('0x25')](function(_0x37d01f){if(_0x37d01f){return _0x37d01f?{'count':_0x53caa7,'rows':_0x37d01f}:null;}})[_0x9fd6('0x25')](respondWithResult(_0xf2117,null))[_0x9fd6('0x43')](handleError(_0xf2117,null));};exports[_0x9fd6('0x4f')]=function(_0x1d79ff,_0x5888e6,_0x523412){var _0x12f453={};var _0x249b36={};var _0x355250;var _0x4e0e33;return db[_0x9fd6('0x2b')][_0x9fd6('0x48')]({'where':{'id':_0x1d79ff['params']['id']}})[_0x9fd6('0x25')](handleEntityNotFound(_0x5888e6,null))[_0x9fd6('0x25')](function(_0x52ffaf){if(_0x52ffaf){_0x355250=_0x52ffaf;_0x249b36[_0x9fd6('0x32')]=_[_0x9fd6('0x40')](db[_0x9fd6('0x49')][_0x9fd6('0x41')]);_0x249b36[_0x9fd6('0x2f')]=_[_0x9fd6('0x40')](_0x1d79ff[_0x9fd6('0x2f')]);_0x249b36[_0x9fd6('0x30')]=_[_0x9fd6('0x31')](_0x249b36[_0x9fd6('0x32')],_0x249b36['query']);_0x12f453['attributes']=_[_0x9fd6('0x31')](_0x249b36['model'],qs[_0x9fd6('0x33')](_0x1d79ff[_0x9fd6('0x2f')][_0x9fd6('0x33')]));_0x12f453[_0x9fd6('0x34')]=_0x12f453[_0x9fd6('0x34')][_0x9fd6('0x35')]?_0x12f453[_0x9fd6('0x34')]:_0x249b36['model'];_0x12f453[_0x9fd6('0x4c')]=qs[_0x9fd6('0x37')](_0x1d79ff[_0x9fd6('0x2f')]['sort']);_0x12f453[_0x9fd6('0x38')]=qs[_0x9fd6('0x30')](_[_0x9fd6('0x4d')](_0x1d79ff['query'],_0x249b36[_0x9fd6('0x30')]));if(_0x1d79ff['query'][_0x9fd6('0x4e')]){_0x12f453['where']=_[_0x9fd6('0x39')](_0x12f453['where'],{'$or':_[_0x9fd6('0x3a')](_0x12f453[_0x9fd6('0x34')],function(_0x3d59b2){var _0x19b4bc={};_0x19b4bc[_0x3d59b2]={'$like':'%'+_0x1d79ff['query']['filter']+'%'};return _0x19b4bc;})});}_0x12f453=_[_0x9fd6('0x39')]({},_0x12f453,_0x1d79ff[_0x9fd6('0x3c')]);return _0x355250[_0x9fd6('0x4f')](_0x12f453);}})[_0x9fd6('0x25')](function(_0x3ceaab){if(_0x3ceaab){_0x4e0e33=_0x3ceaab[_0x9fd6('0x35')];if(!_0x1d79ff[_0x9fd6('0x2f')]['hasOwnProperty'](_0x9fd6('0x4a'))){_0x12f453[_0x9fd6('0x1e')]=qs[_0x9fd6('0x1e')](_0x1d79ff[_0x9fd6('0x2f')][_0x9fd6('0x1e')]);_0x12f453['offset']=qs['offset'](_0x1d79ff[_0x9fd6('0x2f')][_0x9fd6('0x1b')]);}return _0x355250[_0x9fd6('0x4f')](_0x12f453);}})[_0x9fd6('0x25')](function(_0x4a3c99){if(_0x4a3c99){return _0x4a3c99?{'count':_0x4e0e33,'rows':_0x4a3c99}:null;}})[_0x9fd6('0x25')](respondWithResult(_0x5888e6,null))[_0x9fd6('0x43')](handleError(_0x5888e6,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 6367357..dcd6d20 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 _0x3d7a=['../../config/logger','moment','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x3d7a,0x132));var _0xa3d7=function(_0xee2e7a,_0x58354d){_0xee2e7a=_0xee2e7a-0x0;var _0x319dd3=_0x3d7a[_0xee2e7a];return _0x319dd3;};'use strict';var _=require(_0xa3d7('0x0'));var util=require(_0xa3d7('0x1'));var logger=require(_0xa3d7('0x2'))('api');var moment=require(_0xa3d7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3d7('0x4'));var rimraf=require(_0xa3d7('0x5'));var config=require('../../config/environment');var attributes=require(_0xa3d7('0x6'));module[_0xa3d7('0x7')]=function(_0x6b3f49,_0x1f3c04){return _0x6b3f49[_0xa3d7('0x8')](_0xa3d7('0x9'),attributes,{'tableName':_0xa3d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb042=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb042,0x9f));var _0x2b04=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xb042[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x2b04('0x0'));var util=require('util');var logger=require(_0x2b04('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2b04('0x2'));var rp=require(_0x2b04('0x3'));var fs=require('fs');var path=require(_0x2b04('0x4'));var rimraf=require(_0x2b04('0x5'));var config=require(_0x2b04('0x6'));var attributes=require(_0x2b04('0x7'));module['exports']=function(_0xbdd9fa,_0x43478d){return _0xbdd9fa['define'](_0x2b04('0x8'),attributes,{'tableName':_0x2b04('0x9'),'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 c9459b6..f0bf6d5 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 _0xbcd0=['ioredis','../../config/utils','../../config/environment','client','http','then','request\x20sent','debug','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0xbcd0,0x128));var _0x0bcd=function(_0x153f9f,_0x417002){_0x153f9f=_0x153f9f-0x0;var _0x11db3d=_0xbcd0[_0x153f9f];return _0x11db3d;};'use strict';var _=require(_0x0bcd('0x0'));var util=require('util');var moment=require(_0x0bcd('0x1'));var BPromise=require(_0x0bcd('0x2'));var rs=require(_0x0bcd('0x3'));var fs=require('fs');var Redis=require(_0x0bcd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bcd('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0bcd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0bcd('0x7')][_0x0bcd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4dc558,_0x53c27f,_0x38ed9f){return new BPromise(function(_0x169b53,_0x25866f){return client['request'](_0x4dc558,_0x38ed9f)[_0x0bcd('0x9')](function(_0x5c625b){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x53c27f,_0x0bcd('0xa'));logger[_0x0bcd('0xb')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x53c27f,'request\x20sent',JSON[_0x0bcd('0xc')](_0x5c625b));if(_0x5c625b[_0x0bcd('0xd')]){if(_0x5c625b[_0x0bcd('0xd')][_0x0bcd('0xe')]===0x1f4){logger[_0x0bcd('0xd')](_0x0bcd('0xf'),_0x53c27f,_0x5c625b['error']['message']);return _0x25866f(_0x5c625b[_0x0bcd('0xd')][_0x0bcd('0x10')]);}logger[_0x0bcd('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x53c27f,_0x5c625b['error'][_0x0bcd('0x10')]);return _0x169b53(_0x5c625b[_0x0bcd('0xd')][_0x0bcd('0x10')]);}else{logger[_0x0bcd('0x11')](_0x0bcd('0xf'),_0x53c27f,_0x0bcd('0xa'));_0x169b53(_0x5c625b[_0x0bcd('0x12')][_0x0bcd('0x10')]);}})[_0x0bcd('0x13')](function(_0xda25ab){logger[_0x0bcd('0xd')](_0x0bcd('0xf'),_0x53c27f,_0xda25ab);_0x25866f(_0xda25ab);});});} \ No newline at end of file +var _0x79e7=['jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x2f29d5,_0x52d3ed){var _0x20c83f=function(_0x4b953d){while(--_0x4b953d){_0x2f29d5['push'](_0x2f29d5['shift']());}};_0x20c83f(++_0x52d3ed);}(_0x79e7,0xfd));var _0x779e=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x79e7[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x779e('0x0'));var util=require(_0x779e('0x1'));var moment=require(_0x779e('0x2'));var BPromise=require('bluebird');var rs=require(_0x779e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x779e('0x4'));var logger=require(_0x779e('0x5'))(_0x779e('0x6'));var config=require('../../config/environment');var jayson=require(_0x779e('0x7'));var client=jayson['client'][_0x779e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x525fe1,_0x504941,_0x4a78b4){return new BPromise(function(_0x193d87,_0x268fe0){return client[_0x779e('0x9')](_0x525fe1,_0x4a78b4)[_0x779e('0xa')](function(_0x83c301){logger['info'](_0x779e('0xb'),_0x504941,_0x779e('0xc'));logger[_0x779e('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x504941,_0x779e('0xc'),JSON[_0x779e('0xe')](_0x83c301));if(_0x83c301['error']){if(_0x83c301[_0x779e('0xf')][_0x779e('0x10')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x504941,_0x83c301['error'][_0x779e('0x11')]);return _0x268fe0(_0x83c301['error']['message']);}logger[_0x779e('0xf')](_0x779e('0xb'),_0x504941,_0x83c301[_0x779e('0xf')][_0x779e('0x11')]);return _0x193d87(_0x83c301[_0x779e('0xf')]['message']);}else{logger[_0x779e('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x504941,_0x779e('0xc'));_0x193d87(_0x83c301['result'][_0x779e('0x11')]);}})[_0x779e('0x13')](function(_0x3de53e){logger['error'](_0x779e('0xb'),_0x504941,_0x3de53e);_0x268fe0(_0x3de53e);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index f4d8571..ad698a8 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 _0xc40d=['get','isAuthenticated','index','show','create','put','update','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intSalesforceField.controller'];(function(_0x52105c,_0x28934d){var _0x461b57=function(_0x5b8de2){while(--_0x5b8de2){_0x52105c['push'](_0x52105c['shift']());}};_0x461b57(++_0x28934d);}(_0xc40d,0x105));var _0xdc40=function(_0x3fc37b,_0x41d1b7){_0x3fc37b=_0x3fc37b-0x0;var _0x429df5=_0xc40d[_0x3fc37b];return _0x429df5;};'use strict';var multer=require(_0xdc40('0x0'));var util=require(_0xdc40('0x1'));var path=require(_0xdc40('0x2'));var timeout=require(_0xdc40('0x3'));var express=require(_0xdc40('0x4'));var router=express[_0xdc40('0x5')]();var fs_extra=require(_0xdc40('0x6'));var auth=require(_0xdc40('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdc40('0x8'));router[_0xdc40('0x9')]('/',auth[_0xdc40('0xa')](),controller[_0xdc40('0xb')]);router[_0xdc40('0x9')]('/:id',auth[_0xdc40('0xa')](),controller[_0xdc40('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdc40('0xd')]);router[_0xdc40('0xe')]('/:id',auth[_0xdc40('0xa')](),controller[_0xdc40('0xf')]);router['delete'](_0xdc40('0x10'),auth['isAuthenticated'](),controller[_0xdc40('0x11')]);module['exports']=router; \ No newline at end of file +var _0x0203=['../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy','exports','path','fs-extra','../../components/auth/service'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x0203,0x74));var _0x3020=function(_0xec54c4,_0x5497a6){_0xec54c4=_0xec54c4-0x0;var _0x4d3544=_0x0203[_0xec54c4];return _0x4d3544;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3020('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3020('0x1'));var auth=require(_0x3020('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x3020('0x3'));var controller=require(_0x3020('0x4'));router['get']('/',auth[_0x3020('0x5')](),controller[_0x3020('0x6')]);router[_0x3020('0x7')]('/:id',auth[_0x3020('0x5')](),controller[_0x3020('0x8')]);router[_0x3020('0x9')]('/',auth[_0x3020('0x5')](),controller[_0x3020('0xa')]);router[_0x3020('0xb')](_0x3020('0xc'),auth[_0x3020('0x5')](),controller[_0x3020('0xd')]);router[_0x3020('0xe')](_0x3020('0xc'),auth[_0x3020('0x5')](),controller[_0x3020('0xf')]);module[_0x3020('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 517398a..8546fd1 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 _0x2de4=['customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3b0656,_0x2c98ed){var _0x6352b2=function(_0x2deaa2){while(--_0x2deaa2){_0x3b0656['push'](_0x3b0656['shift']());}};_0x6352b2(++_0x2c98ed);}(_0x2de4,0x17e));var _0x42de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2de4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x42de('0x0'));module[_0x42de('0x1')]={'type':{'type':Sequelize[_0x42de('0x2')](_0x42de('0x3'),_0x42de('0x4'),_0x42de('0x5'),_0x42de('0x6'),_0x42de('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x42de('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x42de('0x2')](_0x42de('0x3'),'variable',_0x42de('0x5'))},'keyContent':{'type':Sequelize[_0x42de('0x8')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x42de('0x8')]}}; \ No newline at end of file +var _0x6aba=['customVariable','keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x69cd52,_0x25dfd2){var _0x1c2c66=function(_0x427cd0){while(--_0x427cd0){_0x69cd52['push'](_0x69cd52['shift']());}};_0x1c2c66(++_0x25dfd2);}(_0x6aba,0x7b));var _0xa6ab=function(_0x3616b8,_0x3601eb){_0x3616b8=_0x3616b8-0x0;var _0x268f80=_0x6aba[_0x3616b8];return _0x268f80;};'use strict';var Sequelize=require(_0xa6ab('0x0'));module[_0xa6ab('0x1')]={'type':{'type':Sequelize[_0xa6ab('0x2')](_0xa6ab('0x3'),_0xa6ab('0x4'),_0xa6ab('0x5'),_0xa6ab('0x6'),'picklist'),'defaultValue':_0xa6ab('0x3')},'content':{'type':Sequelize[_0xa6ab('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa6ab('0x2')](_0xa6ab('0x3'),_0xa6ab('0x4'),_0xa6ab('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa6ab('0x7')]},'variableName':{'type':Sequelize[_0xa6ab('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 0611455..1c073a6 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 _0x4ccc=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','includeAll','include','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','then','destroy','error','name','map','SalesforceField','rawAttributes','type','key','model','query'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x4ccc,0xa3));var _0xc4cc=function(_0x30de5b,_0x49babb){_0x30de5b=_0x30de5b-0x0;var _0x532561=_0x4ccc[_0x30de5b];return _0x532561;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4cc('0x0'));var zipdir=require(_0xc4cc('0x1'));var jsonpatch=require(_0xc4cc('0x2'));var rp=require('request-promise');var moment=require(_0xc4cc('0x3'));var BPromise=require(_0xc4cc('0x4'));var Mustache=require('mustache');var util=require(_0xc4cc('0x5'));var path=require(_0xc4cc('0x6'));var sox=require(_0xc4cc('0x7'));var csv=require('to-csv');var ejs=require(_0xc4cc('0x8'));var fs=require('fs');var fs_extra=require(_0xc4cc('0x9'));var _=require(_0xc4cc('0xa'));var squel=require(_0xc4cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xc4cc('0xc'));var deskjs=require(_0xc4cc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4cc('0xe'));var Papa=require('papaparse');var Redis=require(_0xc4cc('0xf'));var authService=require(_0xc4cc('0x10'));var qs=require(_0xc4cc('0x11'));var as=require(_0xc4cc('0x12'));var hardwareService=require(_0xc4cc('0x13'));var logger=require(_0xc4cc('0x14'))('api');var utils=require(_0xc4cc('0x15'));var config=require(_0xc4cc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x526a4b,_0x5c5375){_0x5c5375=_0x5c5375||0xcc;return function(_0x535b92){if(_0x535b92){return _0x526a4b[_0xc4cc('0x17')](_0x5c5375);}return _0x526a4b['status'](_0x5c5375)[_0xc4cc('0x18')]();};}function respondWithResult(_0x8b6454,_0x37dbe3){_0x37dbe3=_0x37dbe3||0xc8;return function(_0xc62b4f){if(_0xc62b4f){return _0x8b6454[_0xc4cc('0x19')](_0x37dbe3)[_0xc4cc('0x1a')](_0xc62b4f);}};}function respondWithFilteredResult(_0x50ceff,_0x42a1a2){return function(_0x21fb9a){if(_0x21fb9a){var _0x5d56ba=typeof _0x42a1a2['offset']==='undefined'&&typeof _0x42a1a2[_0xc4cc('0x1b')]===_0xc4cc('0x1c');var _0x4352b0=_0x21fb9a[_0xc4cc('0x1d')];var _0x2168bc=_0x5d56ba?0x0:_0x42a1a2[_0xc4cc('0x1e')];var _0x59b188=_0x5d56ba?_0x21fb9a[_0xc4cc('0x1d')]:_0x42a1a2[_0xc4cc('0x1e')]+_0x42a1a2[_0xc4cc('0x1b')];var _0x4c95d4;if(_0x59b188>=_0x4352b0){_0x59b188=_0x4352b0;_0x4c95d4=0xc8;}else{_0x4c95d4=0xce;}_0x50ceff[_0xc4cc('0x19')](_0x4c95d4);return _0x50ceff[_0xc4cc('0x1f')](_0xc4cc('0x20'),_0x2168bc+'-'+_0x59b188+'/'+_0x4352b0)[_0xc4cc('0x1a')](_0x21fb9a);}return null;};}function patchUpdates(_0x285064){return function(_0x541e19){try{jsonpatch['apply'](_0x541e19,_0x285064,!![]);}catch(_0x2d7b39){return BPromise['reject'](_0x2d7b39);}return _0x541e19['save']();};}function saveUpdates(_0x3f6120,_0x123e5d){return function(_0x339619){if(_0x339619){return _0x339619['update'](_0x3f6120)[_0xc4cc('0x21')](function(_0x327afa){return _0x327afa;});}return null;};}function removeEntity(_0x1a6696,_0x32f4d8){return function(_0x42f669){if(_0x42f669){return _0x42f669[_0xc4cc('0x22')]()[_0xc4cc('0x21')](function(){_0x1a6696['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26ae4e,_0x42d324){return function(_0x3763a3){if(!_0x3763a3){_0x26ae4e['sendStatus'](0x194);}return _0x3763a3;};}function handleError(_0x3fd9e2,_0xd0b619){_0xd0b619=_0xd0b619||0x1f4;return function(_0x140ba6){logger[_0xc4cc('0x23')](_0x140ba6['stack']);if(_0x140ba6[_0xc4cc('0x24')]){delete _0x140ba6[_0xc4cc('0x24')];}_0x3fd9e2['status'](_0xd0b619)['send'](_0x140ba6);};}exports['index']=function(_0x4cef6b,_0x2c0726){var _0x2dcb3d={},_0x557b71={},_0x1c5442={'count':0x0,'rows':[]};var _0x275f90=_[_0xc4cc('0x25')](db[_0xc4cc('0x26')][_0xc4cc('0x27')],function(_0x29bf47){return{'name':_0x29bf47['fieldName'],'type':_0x29bf47[_0xc4cc('0x28')][_0xc4cc('0x29')]};});_0x557b71[_0xc4cc('0x2a')]=_[_0xc4cc('0x25')](_0x275f90,'name');_0x557b71[_0xc4cc('0x2b')]=_[_0xc4cc('0x2c')](_0x4cef6b[_0xc4cc('0x2b')]);_0x557b71[_0xc4cc('0x2d')]=_[_0xc4cc('0x2e')](_0x557b71['model'],_0x557b71['query']);_0x2dcb3d[_0xc4cc('0x2f')]=_['intersection'](_0x557b71[_0xc4cc('0x2a')],qs[_0xc4cc('0x30')](_0x4cef6b['query'][_0xc4cc('0x30')]));_0x2dcb3d[_0xc4cc('0x2f')]=_0x2dcb3d['attributes'][_0xc4cc('0x31')]?_0x2dcb3d[_0xc4cc('0x2f')]:_0x557b71[_0xc4cc('0x2a')];if(!_0x4cef6b[_0xc4cc('0x2b')][_0xc4cc('0x32')](_0xc4cc('0x33'))){_0x2dcb3d[_0xc4cc('0x1b')]=qs['limit'](_0x4cef6b[_0xc4cc('0x2b')][_0xc4cc('0x1b')]);_0x2dcb3d[_0xc4cc('0x1e')]=qs[_0xc4cc('0x1e')](_0x4cef6b[_0xc4cc('0x2b')]['offset']);}_0x2dcb3d[_0xc4cc('0x34')]=qs[_0xc4cc('0x35')](_0x4cef6b[_0xc4cc('0x2b')][_0xc4cc('0x35')]);_0x2dcb3d[_0xc4cc('0x36')]=qs['filters'](_[_0xc4cc('0x37')](_0x4cef6b[_0xc4cc('0x2b')],_0x557b71['filters']),_0x275f90);if(_0x4cef6b[_0xc4cc('0x2b')][_0xc4cc('0x38')]){_0x2dcb3d['where']=_[_0xc4cc('0x39')](_0x2dcb3d['where'],{'$or':_[_0xc4cc('0x25')](_0x275f90,function(_0xde29c4){if(_0xde29c4[_0xc4cc('0x28')]!==_0xc4cc('0x3a')){var _0x3c8290={};_0x3c8290[_0xde29c4[_0xc4cc('0x24')]]={'$like':'%'+_0x4cef6b[_0xc4cc('0x2b')][_0xc4cc('0x38')]+'%'};return _0x3c8290;}})});}_0x2dcb3d=_['merge']({},_0x2dcb3d,_0x4cef6b[_0xc4cc('0x3b')]);var _0x2269a3={'where':_0x2dcb3d[_0xc4cc('0x36')]};return db[_0xc4cc('0x26')][_0xc4cc('0x1d')](_0x2269a3)[_0xc4cc('0x21')](function(_0x264937){_0x1c5442['count']=_0x264937;if(_0x4cef6b[_0xc4cc('0x2b')]['includeAll']){_0x2dcb3d['include']=[{'all':!![]}];}return db[_0xc4cc('0x26')][_0xc4cc('0x3c')](_0x2dcb3d);})[_0xc4cc('0x21')](function(_0x84390){_0x1c5442['rows']=_0x84390;return _0x1c5442;})[_0xc4cc('0x21')](respondWithFilteredResult(_0x2c0726,_0x2dcb3d))['catch'](handleError(_0x2c0726,null));};exports[_0xc4cc('0x3d')]=function(_0x2fe70a,_0x5d2c1f){var _0x376ab7={'raw':!![],'where':{'id':_0x2fe70a['params']['id']}},_0x315261={};_0x315261[_0xc4cc('0x2a')]=_[_0xc4cc('0x2c')](db[_0xc4cc('0x26')]['rawAttributes']);_0x315261[_0xc4cc('0x2b')]=_[_0xc4cc('0x2c')](_0x2fe70a[_0xc4cc('0x2b')]);_0x315261[_0xc4cc('0x2d')]=_[_0xc4cc('0x2e')](_0x315261['model'],_0x315261[_0xc4cc('0x2b')]);_0x376ab7[_0xc4cc('0x2f')]=_['intersection'](_0x315261['model'],qs['fields'](_0x2fe70a['query'][_0xc4cc('0x30')]));_0x376ab7[_0xc4cc('0x2f')]=_0x376ab7[_0xc4cc('0x2f')][_0xc4cc('0x31')]?_0x376ab7['attributes']:_0x315261['model'];if(_0x2fe70a[_0xc4cc('0x2b')][_0xc4cc('0x3e')]){_0x376ab7[_0xc4cc('0x3f')]=[{'all':!![]}];}_0x376ab7=_['merge']({},_0x376ab7,_0x2fe70a[_0xc4cc('0x3b')]);return db[_0xc4cc('0x26')]['find'](_0x376ab7)[_0xc4cc('0x21')](handleEntityNotFound(_0x5d2c1f,null))['then'](respondWithResult(_0x5d2c1f,null))[_0xc4cc('0x40')](handleError(_0x5d2c1f,null));};exports[_0xc4cc('0x41')]=function(_0x28e83d,_0x5c40b0){return db[_0xc4cc('0x26')]['create'](_0x28e83d[_0xc4cc('0x42')],{})[_0xc4cc('0x21')](respondWithResult(_0x5c40b0,0xc9))[_0xc4cc('0x40')](handleError(_0x5c40b0,null));};exports['update']=function(_0x351a2a,_0x596344){if(_0x351a2a[_0xc4cc('0x42')]['id']){delete _0x351a2a[_0xc4cc('0x42')]['id'];}return db[_0xc4cc('0x26')][_0xc4cc('0x43')]({'where':{'id':_0x351a2a[_0xc4cc('0x44')]['id']}})['then'](handleEntityNotFound(_0x596344,null))[_0xc4cc('0x21')](saveUpdates(_0x351a2a['body'],null))[_0xc4cc('0x21')](respondWithResult(_0x596344,null))[_0xc4cc('0x40')](handleError(_0x596344,null));};exports['destroy']=function(_0x46b402,_0x5dbcd8){return db['SalesforceField'][_0xc4cc('0x43')]({'where':{'id':_0x46b402[_0xc4cc('0x44')]['id']}})[_0xc4cc('0x21')](handleEntityNotFound(_0x5dbcd8,null))[_0xc4cc('0x21')](removeEntity(_0x5dbcd8,null))['catch'](handleError(_0x5dbcd8,null));}; \ No newline at end of file +var _0x2c59=['query','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','keys','rawAttributes','catch','create','body','find','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SalesforceField','fieldName','type','key','model'];(function(_0x28a192,_0xc56107){var _0x15b80f=function(_0x122486){while(--_0x122486){_0x28a192['push'](_0x28a192['shift']());}};_0x15b80f(++_0xc56107);}(_0x2c59,0xa9));var _0x92c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c59[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x92c5('0x0'));var rimraf=require(_0x92c5('0x1'));var zipdir=require(_0x92c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92c5('0x3'));var moment=require(_0x92c5('0x4'));var BPromise=require(_0x92c5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x92c5('0x6'));var sox=require(_0x92c5('0x7'));var csv=require(_0x92c5('0x8'));var ejs=require(_0x92c5('0x9'));var fs=require('fs');var fs_extra=require(_0x92c5('0xa'));var _=require(_0x92c5('0xb'));var squel=require(_0x92c5('0xc'));var crypto=require(_0x92c5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x92c5('0x8'));var querystring=require(_0x92c5('0xe'));var Papa=require(_0x92c5('0xf'));var Redis=require('ioredis');var authService=require(_0x92c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x92c5('0x11'));var hardwareService=require(_0x92c5('0x12'));var logger=require(_0x92c5('0x13'))(_0x92c5('0x14'));var utils=require('../../config/utils');var config=require(_0x92c5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x92c5('0x16'))['db'];function respondWithStatusCode(_0x5e8dff,_0x1e19eb){_0x1e19eb=_0x1e19eb||0xcc;return function(_0x11c70d){if(_0x11c70d){return _0x5e8dff[_0x92c5('0x17')](_0x1e19eb);}return _0x5e8dff[_0x92c5('0x18')](_0x1e19eb)[_0x92c5('0x19')]();};}function respondWithResult(_0x506568,_0x5215ec){_0x5215ec=_0x5215ec||0xc8;return function(_0xc1d5c0){if(_0xc1d5c0){return _0x506568[_0x92c5('0x18')](_0x5215ec)[_0x92c5('0x1a')](_0xc1d5c0);}};}function respondWithFilteredResult(_0x431eb9,_0xf166fa){return function(_0x1bc640){if(_0x1bc640){var _0x10a3ba=typeof _0xf166fa[_0x92c5('0x1b')]===_0x92c5('0x1c')&&typeof _0xf166fa[_0x92c5('0x1d')]===_0x92c5('0x1c');var _0x1e3ce6=_0x1bc640['count'];var _0x5ba9a5=_0x10a3ba?0x0:_0xf166fa['offset'];var _0x3dc4d5=_0x10a3ba?_0x1bc640[_0x92c5('0x1e')]:_0xf166fa[_0x92c5('0x1b')]+_0xf166fa[_0x92c5('0x1d')];var _0x414cd1;if(_0x3dc4d5>=_0x1e3ce6){_0x3dc4d5=_0x1e3ce6;_0x414cd1=0xc8;}else{_0x414cd1=0xce;}_0x431eb9[_0x92c5('0x18')](_0x414cd1);return _0x431eb9['set'](_0x92c5('0x1f'),_0x5ba9a5+'-'+_0x3dc4d5+'/'+_0x1e3ce6)[_0x92c5('0x1a')](_0x1bc640);}return null;};}function patchUpdates(_0x544d46){return function(_0x29b404){try{jsonpatch[_0x92c5('0x20')](_0x29b404,_0x544d46,!![]);}catch(_0x5f3aec){return BPromise['reject'](_0x5f3aec);}return _0x29b404[_0x92c5('0x21')]();};}function saveUpdates(_0x17ccc7,_0x3e964b){return function(_0x5a4f4a){if(_0x5a4f4a){return _0x5a4f4a[_0x92c5('0x22')](_0x17ccc7)[_0x92c5('0x23')](function(_0x5a6bcc){return _0x5a6bcc;});}return null;};}function removeEntity(_0x5ada0c,_0x5aa2a8){return function(_0x1a6c5b){if(_0x1a6c5b){return _0x1a6c5b[_0x92c5('0x24')]()['then'](function(){_0x5ada0c[_0x92c5('0x18')](0xcc)[_0x92c5('0x19')]();});}};}function handleEntityNotFound(_0x48d7ca,_0x19cb98){return function(_0x3244d0){if(!_0x3244d0){_0x48d7ca[_0x92c5('0x17')](0x194);}return _0x3244d0;};}function handleError(_0x2b9861,_0x1bf684){_0x1bf684=_0x1bf684||0x1f4;return function(_0x4912fb){logger[_0x92c5('0x25')](_0x4912fb[_0x92c5('0x26')]);if(_0x4912fb[_0x92c5('0x27')]){delete _0x4912fb[_0x92c5('0x27')];}_0x2b9861[_0x92c5('0x18')](_0x1bf684)['send'](_0x4912fb);};}exports[_0x92c5('0x28')]=function(_0x953cb8,_0x257dc4){var _0x4a8049={},_0x2e8be9={},_0x548cc8={'count':0x0,'rows':[]};var _0x35a297=_[_0x92c5('0x29')](db[_0x92c5('0x2a')]['rawAttributes'],function(_0x264008){return{'name':_0x264008[_0x92c5('0x2b')],'type':_0x264008[_0x92c5('0x2c')][_0x92c5('0x2d')]};});_0x2e8be9[_0x92c5('0x2e')]=_[_0x92c5('0x29')](_0x35a297,_0x92c5('0x27'));_0x2e8be9[_0x92c5('0x2f')]=_['keys'](_0x953cb8[_0x92c5('0x2f')]);_0x2e8be9['filters']=_[_0x92c5('0x30')](_0x2e8be9[_0x92c5('0x2e')],_0x2e8be9[_0x92c5('0x2f')]);_0x4a8049['attributes']=_['intersection'](_0x2e8be9['model'],qs[_0x92c5('0x31')](_0x953cb8[_0x92c5('0x2f')]['fields']));_0x4a8049[_0x92c5('0x32')]=_0x4a8049[_0x92c5('0x32')][_0x92c5('0x33')]?_0x4a8049[_0x92c5('0x32')]:_0x2e8be9['model'];if(!_0x953cb8[_0x92c5('0x2f')][_0x92c5('0x34')]('nolimit')){_0x4a8049[_0x92c5('0x1d')]=qs['limit'](_0x953cb8['query']['limit']);_0x4a8049['offset']=qs['offset'](_0x953cb8[_0x92c5('0x2f')][_0x92c5('0x1b')]);}_0x4a8049['order']=qs[_0x92c5('0x35')](_0x953cb8[_0x92c5('0x2f')][_0x92c5('0x35')]);_0x4a8049[_0x92c5('0x36')]=qs['filters'](_[_0x92c5('0x37')](_0x953cb8[_0x92c5('0x2f')],_0x2e8be9[_0x92c5('0x38')]),_0x35a297);if(_0x953cb8[_0x92c5('0x2f')][_0x92c5('0x39')]){_0x4a8049[_0x92c5('0x36')]=_['merge'](_0x4a8049[_0x92c5('0x36')],{'$or':_[_0x92c5('0x29')](_0x35a297,function(_0x4fbe48){if(_0x4fbe48[_0x92c5('0x2c')]!==_0x92c5('0x3a')){var _0x3b86a0={};_0x3b86a0[_0x4fbe48['name']]={'$like':'%'+_0x953cb8[_0x92c5('0x2f')]['filter']+'%'};return _0x3b86a0;}})});}_0x4a8049=_[_0x92c5('0x3b')]({},_0x4a8049,_0x953cb8[_0x92c5('0x3c')]);var _0x3bf31c={'where':_0x4a8049[_0x92c5('0x36')]};return db['SalesforceField'][_0x92c5('0x1e')](_0x3bf31c)['then'](function(_0x3ff5e9){_0x548cc8['count']=_0x3ff5e9;if(_0x953cb8[_0x92c5('0x2f')][_0x92c5('0x3d')]){_0x4a8049[_0x92c5('0x3e')]=[{'all':!![]}];}return db[_0x92c5('0x2a')][_0x92c5('0x3f')](_0x4a8049);})[_0x92c5('0x23')](function(_0x581aa1){_0x548cc8['rows']=_0x581aa1;return _0x548cc8;})[_0x92c5('0x23')](respondWithFilteredResult(_0x257dc4,_0x4a8049))['catch'](handleError(_0x257dc4,null));};exports[_0x92c5('0x40')]=function(_0x511843,_0xfad5d4){var _0x3c44c0={'raw':!![],'where':{'id':_0x511843['params']['id']}},_0x16c9ea={};_0x16c9ea[_0x92c5('0x2e')]=_[_0x92c5('0x41')](db[_0x92c5('0x2a')][_0x92c5('0x42')]);_0x16c9ea[_0x92c5('0x2f')]=_[_0x92c5('0x41')](_0x511843[_0x92c5('0x2f')]);_0x16c9ea[_0x92c5('0x38')]=_[_0x92c5('0x30')](_0x16c9ea[_0x92c5('0x2e')],_0x16c9ea[_0x92c5('0x2f')]);_0x3c44c0['attributes']=_[_0x92c5('0x30')](_0x16c9ea[_0x92c5('0x2e')],qs['fields'](_0x511843['query'][_0x92c5('0x31')]));_0x3c44c0[_0x92c5('0x32')]=_0x3c44c0['attributes']['length']?_0x3c44c0[_0x92c5('0x32')]:_0x16c9ea[_0x92c5('0x2e')];if(_0x511843[_0x92c5('0x2f')][_0x92c5('0x3d')]){_0x3c44c0[_0x92c5('0x3e')]=[{'all':!![]}];}_0x3c44c0=_[_0x92c5('0x3b')]({},_0x3c44c0,_0x511843[_0x92c5('0x3c')]);return db[_0x92c5('0x2a')]['find'](_0x3c44c0)[_0x92c5('0x23')](handleEntityNotFound(_0xfad5d4,null))[_0x92c5('0x23')](respondWithResult(_0xfad5d4,null))[_0x92c5('0x43')](handleError(_0xfad5d4,null));};exports['create']=function(_0x5ab11f,_0x4b093b){return db[_0x92c5('0x2a')][_0x92c5('0x44')](_0x5ab11f['body'],{})['then'](respondWithResult(_0x4b093b,0xc9))[_0x92c5('0x43')](handleError(_0x4b093b,null));};exports[_0x92c5('0x22')]=function(_0x146674,_0xade89c){if(_0x146674[_0x92c5('0x45')]['id']){delete _0x146674[_0x92c5('0x45')]['id'];}return db['SalesforceField'][_0x92c5('0x46')]({'where':{'id':_0x146674[_0x92c5('0x47')]['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0xade89c,null))[_0x92c5('0x23')](saveUpdates(_0x146674[_0x92c5('0x45')],null))[_0x92c5('0x23')](respondWithResult(_0xade89c,null))[_0x92c5('0x43')](handleError(_0xade89c,null));};exports['destroy']=function(_0x1c8a18,_0x2dfd9c){return db['SalesforceField']['find']({'where':{'id':_0x1c8a18[_0x92c5('0x47')]['id']}})[_0x92c5('0x23')](handleEntityNotFound(_0x2dfd9c,null))[_0x92c5('0x23')](removeEntity(_0x2dfd9c,null))[_0x92c5('0x43')](handleError(_0x2dfd9c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 25ccadf..27cdb9c 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 _0x058e=['idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','int_salesforce_fields','salesforce_unique_index'];(function(_0x915bdc,_0x8dbc09){var _0x2e61d8=function(_0x59679a){while(--_0x59679a){_0x915bdc['push'](_0x915bdc['shift']());}};_0x2e61d8(++_0x8dbc09);}(_0x058e,0xb6));var _0xe058=function(_0x427b6a,_0x5824a2){_0x427b6a=_0x427b6a-0x0;var _0x9f4edd=_0x058e[_0x427b6a];return _0x9f4edd;};'use strict';var _=require(_0xe058('0x0'));var util=require('util');var logger=require(_0xe058('0x1'))('api');var moment=require(_0xe058('0x2'));var BPromise=require(_0xe058('0x3'));var rp=require(_0xe058('0x4'));var fs=require('fs');var path=require(_0xe058('0x5'));var rimraf=require(_0xe058('0x6'));var config=require(_0xe058('0x7'));var attributes=require(_0xe058('0x8'));module[_0xe058('0x9')]=function(_0x111216,_0x5260e4){return _0x111216[_0xe058('0xa')]('SalesforceField',attributes,{'tableName':_0xe058('0xb'),'paranoid':![],'indexes':[{'name':_0xe058('0xc'),'fields':[_0xe058('0xd'),_0xe058('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc57e=['exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','../../config/logger','moment','request-promise','path','./intSalesforceField.attributes'];(function(_0x394ed2,_0x160fa8){var _0x5a9de1=function(_0x30ea17){while(--_0x30ea17){_0x394ed2['push'](_0x394ed2['shift']());}};_0x5a9de1(++_0x160fa8);}(_0xc57e,0xea));var _0xec57=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc57e[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xec57('0x0'));var logger=require(_0xec57('0x1'))('api');var moment=require(_0xec57('0x2'));var BPromise=require('bluebird');var rp=require(_0xec57('0x3'));var fs=require('fs');var path=require(_0xec57('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xec57('0x5'));module[_0xec57('0x6')]=function(_0x4986d9,_0x5a2fc7){return _0x4986d9[_0xec57('0x7')]('SalesforceField',attributes,{'tableName':_0xec57('0x8'),'paranoid':![],'indexes':[{'name':_0xec57('0x9'),'fields':[_0xec57('0xa'),_0xec57('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index f51ff18..e561aea 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 _0xdaa0=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x1fc6de,_0xa9d923){var _0x51711f=function(_0x12beab){while(--_0x12beab){_0x1fc6de['push'](_0x1fc6de['shift']());}};_0x51711f(++_0xa9d923);}(_0xdaa0,0xa2));var _0x0daa=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xdaa0[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x0daa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0daa('0x1'));var fs=require('fs');var Redis=require(_0x0daa('0x2'));var db=require(_0x0daa('0x3'))['db'];var utils=require(_0x0daa('0x4'));var logger=require(_0x0daa('0x5'))('rpc');var config=require(_0x0daa('0x6'));var jayson=require(_0x0daa('0x7'));var client=jayson[_0x0daa('0x8')][_0x0daa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16d10c,_0x239008,_0x19d3bb){return new BPromise(function(_0x238d3a,_0x155451){return client[_0x0daa('0xa')](_0x16d10c,_0x19d3bb)[_0x0daa('0xb')](function(_0x50c3fb){logger[_0x0daa('0xc')](_0x0daa('0xd'),_0x239008,_0x0daa('0xe'));logger[_0x0daa('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x239008,_0x0daa('0xe'),JSON['stringify'](_0x50c3fb));if(_0x50c3fb[_0x0daa('0x10')]){if(_0x50c3fb[_0x0daa('0x10')]['code']===0x1f4){logger[_0x0daa('0x10')](_0x0daa('0xd'),_0x239008,_0x50c3fb[_0x0daa('0x10')][_0x0daa('0x11')]);return _0x155451(_0x50c3fb['error'][_0x0daa('0x11')]);}logger['error'](_0x0daa('0xd'),_0x239008,_0x50c3fb['error'][_0x0daa('0x11')]);return _0x238d3a(_0x50c3fb[_0x0daa('0x10')][_0x0daa('0x11')]);}else{logger[_0x0daa('0xc')]('SalesforceField,\x20%s,\x20%s',_0x239008,_0x0daa('0xe'));_0x238d3a(_0x50c3fb['result'][_0x0daa('0x11')]);}})[_0x0daa('0x12')](function(_0x1473f1){logger[_0x0daa('0x10')](_0x0daa('0xd'),_0x239008,_0x1473f1);_0x155451(_0x1473f1);});});} \ No newline at end of file +var _0xd17a=['info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x11eb81,_0x105a3c){var _0x43b6ae=function(_0x1301fe){while(--_0x1301fe){_0x11eb81['push'](_0x11eb81['shift']());}};_0x43b6ae(++_0x105a3c);}(_0xd17a,0x1eb));var _0xad17=function(_0x48a73e,_0x39f1ac){_0x48a73e=_0x48a73e-0x0;var _0x390c0b=_0xd17a[_0x48a73e];return _0x390c0b;};'use strict';var _=require('lodash');var util=require(_0xad17('0x0'));var moment=require(_0xad17('0x1'));var BPromise=require(_0xad17('0x2'));var rs=require(_0xad17('0x3'));var fs=require('fs');var Redis=require(_0xad17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad17('0x5'));var logger=require(_0xad17('0x6'))(_0xad17('0x7'));var config=require(_0xad17('0x8'));var jayson=require(_0xad17('0x9'));var client=jayson[_0xad17('0xa')][_0xad17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13e05d,_0x14b5b6,_0xc96ae4){return new BPromise(function(_0x5cef62,_0x3cd01f){return client['request'](_0x13e05d,_0xc96ae4)[_0xad17('0xc')](function(_0x442bf9){logger[_0xad17('0xd')](_0xad17('0xe'),_0x14b5b6,_0xad17('0xf'));logger['debug'](_0xad17('0x10'),_0x14b5b6,_0xad17('0xf'),JSON[_0xad17('0x11')](_0x442bf9));if(_0x442bf9[_0xad17('0x12')]){if(_0x442bf9[_0xad17('0x12')]['code']===0x1f4){logger[_0xad17('0x12')](_0xad17('0xe'),_0x14b5b6,_0x442bf9['error']['message']);return _0x3cd01f(_0x442bf9[_0xad17('0x12')]['message']);}logger[_0xad17('0x12')](_0xad17('0xe'),_0x14b5b6,_0x442bf9[_0xad17('0x12')][_0xad17('0x13')]);return _0x5cef62(_0x442bf9[_0xad17('0x12')]['message']);}else{logger[_0xad17('0xd')](_0xad17('0xe'),_0x14b5b6,_0xad17('0xf'));_0x5cef62(_0x442bf9[_0xad17('0x14')][_0xad17('0x13')]);}})['catch'](function(_0x4f3984){logger[_0xad17('0x12')](_0xad17('0xe'),_0x14b5b6,_0x4f3984);_0x3cd01f(_0x4f3984);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index df5591b..605214e 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 _0x0ce2=['post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations'];(function(_0x2548e5,_0x32b72d){var _0x56e34d=function(_0x89308e){while(--_0x89308e){_0x2548e5['push'](_0x2548e5['shift']());}};_0x56e34d(++_0x32b72d);}(_0x0ce2,0xfd));var _0x20ce=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0ce2[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x20ce('0x0'));var util=require('util');var path=require(_0x20ce('0x1'));var timeout=require(_0x20ce('0x2'));var express=require(_0x20ce('0x3'));var router=express[_0x20ce('0x4')]();var fs_extra=require(_0x20ce('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x20ce('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x20ce('0x7')]('/',auth[_0x20ce('0x8')](),controller['index']);router['get'](_0x20ce('0x9'),auth[_0x20ce('0x8')](),controller[_0x20ce('0xa')]);router['get'](_0x20ce('0xb'),auth[_0x20ce('0x8')](),controller[_0x20ce('0xc')]);router[_0x20ce('0x7')]('/:id/fields',auth[_0x20ce('0x8')](),controller['getFields']);router[_0x20ce('0xd')]('/',auth[_0x20ce('0x8')](),controller['create']);router[_0x20ce('0xd')]('/:id/configurations',auth[_0x20ce('0x8')](),controller['addConfiguration']);router[_0x20ce('0xe')]('/:id',auth[_0x20ce('0x8')](),controller[_0x20ce('0xf')]);router[_0x20ce('0x10')](_0x20ce('0x9'),auth[_0x20ce('0x8')](),controller[_0x20ce('0x11')]);module[_0x20ce('0x12')]=router; \ No newline at end of file +var _0x0d3b=['get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x288632,_0x17317f){var _0xd9148b=function(_0xb89130){while(--_0xb89130){_0x288632['push'](_0x288632['shift']());}};_0xd9148b(++_0x17317f);}(_0x0d3b,0xf4));var _0xb0d3=function(_0x343cf2,_0x1ba74a){_0x343cf2=_0x343cf2-0x0;var _0x2f6a37=_0x0d3b[_0x343cf2];return _0x2f6a37;};'use strict';var multer=require(_0xb0d3('0x0'));var util=require(_0xb0d3('0x1'));var path=require(_0xb0d3('0x2'));var timeout=require(_0xb0d3('0x3'));var express=require(_0xb0d3('0x4'));var router=express['Router']();var fs_extra=require(_0xb0d3('0x5'));var auth=require(_0xb0d3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb0d3('0x7'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb0d3('0x8')](_0xb0d3('0x9'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xb')]);router['get'](_0xb0d3('0xc'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xd')]);router[_0xb0d3('0x8')](_0xb0d3('0xe'),auth[_0xb0d3('0xa')](),controller[_0xb0d3('0xf')]);router[_0xb0d3('0x10')]('/',auth[_0xb0d3('0xa')](),controller['create']);router[_0xb0d3('0x10')](_0xb0d3('0xc'),auth['isAuthenticated'](),controller[_0xb0d3('0x11')]);router[_0xb0d3('0x12')](_0xb0d3('0x9'),auth[_0xb0d3('0xa')](),controller['update']);router[_0xb0d3('0x13')](_0xb0d3('0x9'),auth['isAuthenticated'](),controller[_0xb0d3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f090796..e41b43d 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 _0x677e=['exports','STRING','username'];(function(_0x7f70ec,_0x82eb8b){var _0x397ff9=function(_0x51edf4){while(--_0x51edf4){_0x7f70ec['push'](_0x7f70ec['shift']());}};_0x397ff9(++_0x82eb8b);}(_0x677e,0x105));var _0xe677=function(_0x499238,_0x226523){_0x499238=_0x499238-0x0;var _0x5613f7=_0x677e[_0x499238];return _0x5613f7;};'use strict';var Sequelize=require('sequelize');module[_0xe677('0x0')]={'name':{'type':Sequelize[_0xe677('0x1')]},'description':{'type':Sequelize[_0xe677('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xe677('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe677('0x1')]},'remoteUri':{'type':Sequelize[_0xe677('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0481=['sequelize','exports','username','STRING','remoteUri'];(function(_0x42b04f,_0xa2aeda){var _0x3d8899=function(_0x5a85ef){while(--_0x5a85ef){_0x42b04f['push'](_0x42b04f['shift']());}};_0x3d8899(++_0xa2aeda);}(_0x0481,0x195));var _0x1048=function(_0x1e7f4d,_0x20acaa){_0x1e7f4d=_0x1e7f4d-0x0;var _0x5f0fd9=_0x0481[_0x1e7f4d];return _0x5f0fd9;};'use strict';var Sequelize=require(_0x1048('0x0'));module[_0x1048('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x1048('0x2')},'password':{'type':Sequelize[_0x1048('0x3')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1048('0x3')],'unique':_0x1048('0x4')},'serverUrl':{'type':Sequelize[_0x1048('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ce1fc90..44bbfed 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 _0xd0df=['findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','knowledge','subcategory','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_domain','state','calendar_stc','cmdb_ci','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','reopened_time','caller_id','short_description','close_code','correlation_display','delivery_task','assignment_group','business_stc','description','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','password','email','serverUrl','remoteUri','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','send','boolean','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','getConfigurations'];(function(_0x5a9764,_0x40deb9){var _0x2d7551=function(_0x497150){while(--_0x497150){_0x5a9764['push'](_0x5a9764['shift']());}};_0x2d7551(++_0x40deb9);}(_0xd0df,0x12b));var _0xfd0d=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xd0df[_0x31b5b2];return _0x364f13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfd0d('0x0'));var jsonpatch=require(_0xfd0d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfd0d('0x2'));var Mustache=require(_0xfd0d('0x3'));var util=require('util');var path=require('path');var sox=require(_0xfd0d('0x4'));var csv=require(_0xfd0d('0x5'));var ejs=require(_0xfd0d('0x6'));var fs=require('fs');var fs_extra=require(_0xfd0d('0x7'));var _=require('lodash');var squel=require(_0xfd0d('0x8'));var crypto=require(_0xfd0d('0x9'));var jsforce=require(_0xfd0d('0xa'));var deskjs=require(_0xfd0d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xfd0d('0xc'));var Papa=require(_0xfd0d('0xd'));var Redis=require(_0xfd0d('0xe'));var authService=require(_0xfd0d('0xf'));var qs=require(_0xfd0d('0x10'));var as=require(_0xfd0d('0x11'));var hardwareService=require(_0xfd0d('0x12'));var logger=require(_0xfd0d('0x13'))(_0xfd0d('0x14'));var utils=require(_0xfd0d('0x15'));var config=require(_0xfd0d('0x16'));var licenseUtil=require(_0xfd0d('0x17'));var db=require(_0xfd0d('0x18'))['db'];var integrations=require(_0xfd0d('0x19'));function respondWithStatusCode(_0x11972f,_0x39247a){_0x39247a=_0x39247a||0xcc;return function(_0x38b395){if(_0x38b395){return _0x11972f[_0xfd0d('0x1a')](_0x39247a);}return _0x11972f[_0xfd0d('0x1b')](_0x39247a)[_0xfd0d('0x1c')]();};}function respondWithResult(_0x5f8599,_0x46d7db){_0x46d7db=_0x46d7db||0xc8;return function(_0x2fdfad){if(_0x2fdfad){return _0x5f8599[_0xfd0d('0x1b')](_0x46d7db)[_0xfd0d('0x1d')](_0x2fdfad);}};}function respondWithFilteredResult(_0x362a7c,_0x34aa11){return function(_0x2ba082){if(_0x2ba082){var _0x10319a=typeof _0x34aa11[_0xfd0d('0x1e')]==='undefined'&&typeof _0x34aa11[_0xfd0d('0x1f')]===_0xfd0d('0x20');var _0x41465c=_0x2ba082['count'];var _0x361d3f=_0x10319a?0x0:_0x34aa11[_0xfd0d('0x1e')];var _0x2d9c39=_0x10319a?_0x2ba082[_0xfd0d('0x21')]:_0x34aa11[_0xfd0d('0x1e')]+_0x34aa11['limit'];var _0x1aede5;if(_0x2d9c39>=_0x41465c){_0x2d9c39=_0x41465c;_0x1aede5=0xc8;}else{_0x1aede5=0xce;}_0x362a7c[_0xfd0d('0x1b')](_0x1aede5);return _0x362a7c[_0xfd0d('0x22')](_0xfd0d('0x23'),_0x361d3f+'-'+_0x2d9c39+'/'+_0x41465c)['json'](_0x2ba082);}return null;};}function patchUpdates(_0x22c4bc){return function(_0x1c2985){try{jsonpatch[_0xfd0d('0x24')](_0x1c2985,_0x22c4bc,!![]);}catch(_0x7fa8c0){return BPromise[_0xfd0d('0x25')](_0x7fa8c0);}return _0x1c2985['save']();};}function saveUpdates(_0x1a6391,_0x56636a){return function(_0x217fb6){if(_0x217fb6){return _0x217fb6['update'](_0x1a6391)[_0xfd0d('0x26')](function(_0x5959f9){return _0x5959f9;});}return null;};}function removeEntity(_0x5a092e,_0x1f334a){return function(_0x43f642){if(_0x43f642){return _0x43f642[_0xfd0d('0x27')]()['then'](function(){_0x5a092e[_0xfd0d('0x1b')](0xcc)[_0xfd0d('0x1c')]();});}};}function handleEntityNotFound(_0x4ef2ff,_0x3ed9bb){return function(_0xcb937){if(!_0xcb937){_0x4ef2ff[_0xfd0d('0x1a')](0x194);}return _0xcb937;};}function handleError(_0x1569ca,_0x45686c){_0x45686c=_0x45686c||0x1f4;return function(_0x2572e7){logger[_0xfd0d('0x28')](_0x2572e7[_0xfd0d('0x29')]);if(_0x2572e7[_0xfd0d('0x2a')]){delete _0x2572e7[_0xfd0d('0x2a')];}_0x1569ca[_0xfd0d('0x1b')](_0x45686c)['send'](_0x2572e7);};}exports[_0xfd0d('0x2b')]=function(_0x27bab5,_0x37a3ec){var _0x1769cd={},_0x11c909={},_0x1f63b2={'count':0x0,'rows':[]};var _0x44db03=_[_0xfd0d('0x2c')](db[_0xfd0d('0x2d')][_0xfd0d('0x2e')],function(_0x18a70a){return{'name':_0x18a70a[_0xfd0d('0x2f')],'type':_0x18a70a['type'][_0xfd0d('0x30')]};});_0x11c909[_0xfd0d('0x31')]=_[_0xfd0d('0x2c')](_0x44db03,'name');_0x11c909['query']=_[_0xfd0d('0x32')](_0x27bab5[_0xfd0d('0x33')]);_0x11c909[_0xfd0d('0x34')]=_[_0xfd0d('0x35')](_0x11c909[_0xfd0d('0x31')],_0x11c909[_0xfd0d('0x33')]);_0x1769cd[_0xfd0d('0x36')]=_['intersection'](_0x11c909[_0xfd0d('0x31')],qs[_0xfd0d('0x37')](_0x27bab5[_0xfd0d('0x33')]['fields']));_0x1769cd['attributes']=_0x1769cd[_0xfd0d('0x36')][_0xfd0d('0x38')]?_0x1769cd['attributes']:_0x11c909['model'];if(!_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x39')](_0xfd0d('0x3a'))){_0x1769cd[_0xfd0d('0x1f')]=qs[_0xfd0d('0x1f')](_0x27bab5[_0xfd0d('0x33')]['limit']);_0x1769cd[_0xfd0d('0x1e')]=qs[_0xfd0d('0x1e')](_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x1e')]);}_0x1769cd['order']=qs[_0xfd0d('0x3b')](_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x3b')]);_0x1769cd[_0xfd0d('0x3c')]=qs['filters'](_[_0xfd0d('0x3d')](_0x27bab5[_0xfd0d('0x33')],_0x11c909['filters']),_0x44db03);if(_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x3e')]){_0x1769cd[_0xfd0d('0x3c')]=_[_0xfd0d('0x3f')](_0x1769cd[_0xfd0d('0x3c')],{'$or':_[_0xfd0d('0x2c')](_0x44db03,function(_0x517d67){if(_0x517d67[_0xfd0d('0x40')]!==_0xfd0d('0x41')){var _0x26179c={};_0x26179c[_0x517d67['name']]={'$like':'%'+_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x3e')]+'%'};return _0x26179c;}})});}_0x1769cd=_[_0xfd0d('0x3f')]({},_0x1769cd,_0x27bab5[_0xfd0d('0x42')]);var _0xf62e7d={'where':_0x1769cd['where']};return db[_0xfd0d('0x2d')][_0xfd0d('0x21')](_0xf62e7d)[_0xfd0d('0x26')](function(_0x530d9c){_0x1f63b2[_0xfd0d('0x21')]=_0x530d9c;if(_0x27bab5[_0xfd0d('0x33')][_0xfd0d('0x43')]){_0x1769cd[_0xfd0d('0x44')]=[{'all':!![]}];}return db[_0xfd0d('0x2d')][_0xfd0d('0x45')](_0x1769cd);})[_0xfd0d('0x26')](function(_0x28b1b0){_0x1f63b2['rows']=_0x28b1b0;return _0x1f63b2;})['then'](respondWithFilteredResult(_0x37a3ec,_0x1769cd))[_0xfd0d('0x46')](handleError(_0x37a3ec,null));};exports[_0xfd0d('0x47')]=function(_0x5d7d09,_0x40e590){var _0x34f4f3={'raw':![],'where':{'id':_0x5d7d09[_0xfd0d('0x48')]['id']}},_0x4e1a23={};_0x4e1a23[_0xfd0d('0x31')]=_[_0xfd0d('0x32')](db[_0xfd0d('0x2d')]['rawAttributes']);_0x4e1a23[_0xfd0d('0x33')]=_[_0xfd0d('0x32')](_0x5d7d09['query']);_0x4e1a23[_0xfd0d('0x34')]=_[_0xfd0d('0x35')](_0x4e1a23['model'],_0x4e1a23[_0xfd0d('0x33')]);_0x34f4f3[_0xfd0d('0x36')]=_[_0xfd0d('0x35')](_0x4e1a23[_0xfd0d('0x31')],qs[_0xfd0d('0x37')](_0x5d7d09[_0xfd0d('0x33')]['fields']));_0x34f4f3[_0xfd0d('0x36')]=_0x34f4f3[_0xfd0d('0x36')][_0xfd0d('0x38')]?_0x34f4f3['attributes']:_0x4e1a23[_0xfd0d('0x31')];if(_0x5d7d09[_0xfd0d('0x33')][_0xfd0d('0x43')]){_0x34f4f3[_0xfd0d('0x44')]=[{'all':!![]}];}_0x34f4f3=_[_0xfd0d('0x3f')]({},_0x34f4f3,_0x5d7d09['options']);return db[_0xfd0d('0x2d')][_0xfd0d('0x49')](_0x34f4f3)[_0xfd0d('0x26')](handleEntityNotFound(_0x40e590,null))['then'](respondWithResult(_0x40e590,null))[_0xfd0d('0x46')](handleError(_0x40e590,null));};exports[_0xfd0d('0x4a')]=function(_0x20f14e,_0x25202f){return db[_0xfd0d('0x2d')]['create'](_0x20f14e[_0xfd0d('0x4b')],{})[_0xfd0d('0x26')](respondWithResult(_0x25202f,0xc9))[_0xfd0d('0x46')](handleError(_0x25202f,null));};exports['update']=function(_0x218311,_0x12700e){if(_0x218311[_0xfd0d('0x4b')]['id']){delete _0x218311[_0xfd0d('0x4b')]['id'];}return db[_0xfd0d('0x2d')][_0xfd0d('0x49')]({'where':{'id':_0x218311[_0xfd0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x12700e,null))[_0xfd0d('0x26')](saveUpdates(_0x218311[_0xfd0d('0x4b')],null))[_0xfd0d('0x26')](respondWithResult(_0x12700e,null))[_0xfd0d('0x46')](handleError(_0x12700e,null));};exports[_0xfd0d('0x27')]=function(_0x1a5da9,_0x5bb869){return db[_0xfd0d('0x2d')][_0xfd0d('0x49')]({'where':{'id':_0x1a5da9[_0xfd0d('0x48')]['id']}})[_0xfd0d('0x26')](handleEntityNotFound(_0x5bb869,null))[_0xfd0d('0x26')](removeEntity(_0x5bb869,null))[_0xfd0d('0x46')](handleError(_0x5bb869,null));};exports[_0xfd0d('0x4c')]=function(_0x1bc95f,_0x4b4f46,_0x453054){var _0x2b9e45={};var _0xa525c6={};var _0x4aac71;var _0x398302;return db['ServicenowAccount'][_0xfd0d('0x4d')]({'where':{'id':_0x1bc95f[_0xfd0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b4f46,null))[_0xfd0d('0x26')](function(_0x290b58){if(_0x290b58){_0x4aac71=_0x290b58;_0xa525c6['model']=_['keys'](db['ServicenowConfiguration'][_0xfd0d('0x2e')]);_0xa525c6[_0xfd0d('0x33')]=_['keys'](_0x1bc95f['query']);_0xa525c6[_0xfd0d('0x34')]=_[_0xfd0d('0x35')](_0xa525c6['model'],_0xa525c6['query']);_0x2b9e45['attributes']=_['intersection'](_0xa525c6[_0xfd0d('0x31')],qs[_0xfd0d('0x37')](_0x1bc95f['query'][_0xfd0d('0x37')]));_0x2b9e45[_0xfd0d('0x36')]=_0x2b9e45[_0xfd0d('0x36')][_0xfd0d('0x38')]?_0x2b9e45[_0xfd0d('0x36')]:_0xa525c6['model'];_0x2b9e45[_0xfd0d('0x4e')]=qs['sort'](_0x1bc95f[_0xfd0d('0x33')][_0xfd0d('0x3b')]);_0x2b9e45[_0xfd0d('0x3c')]=qs[_0xfd0d('0x34')](_['pick'](_0x1bc95f[_0xfd0d('0x33')],_0xa525c6[_0xfd0d('0x34')]));if(_0x1bc95f['query'][_0xfd0d('0x3e')]){_0x2b9e45['where']=_[_0xfd0d('0x3f')](_0x2b9e45[_0xfd0d('0x3c')],{'$or':_[_0xfd0d('0x2c')](_0x2b9e45['attributes'],function(_0x3f6612){var _0x293118={};_0x293118[_0x3f6612]={'$like':'%'+_0x1bc95f['query'][_0xfd0d('0x3e')]+'%'};return _0x293118;})});}_0x2b9e45=_[_0xfd0d('0x3f')]({},_0x2b9e45,_0x1bc95f[_0xfd0d('0x42')]);return _0x4aac71[_0xfd0d('0x4c')](_0x2b9e45);}})[_0xfd0d('0x26')](function(_0x3973d1){if(_0x3973d1){_0x398302=_0x3973d1[_0xfd0d('0x38')];if(!_0x1bc95f['query'][_0xfd0d('0x39')](_0xfd0d('0x3a'))){_0x2b9e45['limit']=qs['limit'](_0x1bc95f['query'][_0xfd0d('0x1f')]);_0x2b9e45[_0xfd0d('0x1e')]=qs[_0xfd0d('0x1e')](_0x1bc95f['query'][_0xfd0d('0x1e')]);}return _0x4aac71[_0xfd0d('0x4c')](_0x2b9e45);}})[_0xfd0d('0x26')](function(_0x4509c8){if(_0x4509c8){return _0x4509c8?{'count':_0x398302,'rows':_0x4509c8}:null;}})[_0xfd0d('0x26')](respondWithResult(_0x4b4f46,null))[_0xfd0d('0x46')](handleError(_0x4b4f46,null));};exports[_0xfd0d('0x4f')]=function(_0x3a6008,_0x3cd4f1,_0x53ff24){if(_0x3a6008['body']['id']){delete _0x3a6008[_0xfd0d('0x4b')]['id'];}return db[_0xfd0d('0x2d')][_0xfd0d('0x4d')]({'where':{'id':_0x3a6008[_0xfd0d('0x48')]['id']}})[_0xfd0d('0x26')](handleEntityNotFound(_0x3cd4f1,null))[_0xfd0d('0x26')](function(_0x13b428){if(_0x13b428){_0x3a6008[_0xfd0d('0x4b')][_0xfd0d('0x50')]=_0x13b428['id'];_0x3a6008[_0xfd0d('0x4b')][_0xfd0d('0x51')]=integrations[_0xfd0d('0x52')](_0x3a6008[_0xfd0d('0x4b')][_0xfd0d('0x53')],_0x3a6008[_0xfd0d('0x4b')][_0xfd0d('0x40')]);_0x3a6008[_0xfd0d('0x4b')][_0xfd0d('0x54')]=integrations[_0xfd0d('0x55')](_0x3a6008['body']['channel'],_0x3a6008['body'][_0xfd0d('0x40')]);return db[_0xfd0d('0x56')][_0xfd0d('0x4a')](_0x3a6008[_0xfd0d('0x4b')],{'include':[{'model':db[_0xfd0d('0x57')],'as':_0xfd0d('0x51')},{'model':db[_0xfd0d('0x57')],'as':'Descriptions'}]});}return null;})[_0xfd0d('0x26')](respondWithResult(_0x3cd4f1,null))[_0xfd0d('0x46')](handleError(_0x3cd4f1,null));};exports[_0xfd0d('0x58')]=function(_0x31c877,_0x88511,_0x14fe3d){var _0x3fd38e=[_0xfd0d('0x59'),'hold_reason',_0xfd0d('0x5a'),_0xfd0d('0x5b'),'close_code','notify',_0xfd0d('0x5c'),_0xfd0d('0x5d'),_0xfd0d('0x5e')];var _0x2a91c6=[_0xfd0d('0x5f'),_0xfd0d('0x59'),_0xfd0d('0x60'),_0xfd0d('0x61'),_0xfd0d('0x62'),'sys_updated_on',_0xfd0d('0x63'),_0xfd0d('0x64'),_0xfd0d('0x65'),_0xfd0d('0x66'),'resolved_by','sys_updated_by',_0xfd0d('0x67'),_0xfd0d('0x68'),'sys_created_on',_0xfd0d('0x69'),_0xfd0d('0x6a'),'sys_created_by',_0xfd0d('0x5a'),_0xfd0d('0x4e'),_0xfd0d('0x6b'),'closed_at',_0xfd0d('0x6c'),'delivery_plan',_0xfd0d('0x6d'),_0xfd0d('0x6e'),_0xfd0d('0x6f'),'business_service',_0xfd0d('0x70'),_0xfd0d('0x71'),_0xfd0d('0x72'),_0xfd0d('0x73'),_0xfd0d('0x74'),_0xfd0d('0x75'),_0xfd0d('0x76'),_0xfd0d('0x77'),'work_end',_0xfd0d('0x78'),'resolved_at',_0xfd0d('0x79'),'approval_set','subcategory','work_notes',_0xfd0d('0x7a'),_0xfd0d('0x7b'),_0xfd0d('0x7c'),_0xfd0d('0x7d'),'work_start',_0xfd0d('0x7e'),_0xfd0d('0x7f'),'additional_assignee_list',_0xfd0d('0x80'),'calendar_duration',_0xfd0d('0x81'),_0xfd0d('0x82'),'close_notes',_0xfd0d('0x83'),'follow_up',_0xfd0d('0x84'),_0xfd0d('0x85'),_0xfd0d('0x86'),_0xfd0d('0x87'),_0xfd0d('0x5c'),_0xfd0d('0x88'),_0xfd0d('0x89'),_0xfd0d('0x8a'),_0xfd0d('0x8b'),_0xfd0d('0x8c'),_0xfd0d('0x8d'),_0xfd0d('0x5d'),_0xfd0d('0x8e'),'sla_due',_0xfd0d('0x8f'),_0xfd0d('0x90'),_0xfd0d('0x91'),_0xfd0d('0x92'),'reopen_count',_0xfd0d('0x93'),_0xfd0d('0x94'),_0xfd0d('0x95'),_0xfd0d('0x96'),_0xfd0d('0x97'),_0xfd0d('0x5e')];var _0x2008a1='';var _0x5e9305='';var _0x2ba1d5=[];var _0x3e9a80='';var _0x192c67='';var _0x2d5f80=[];var _0xd1d3f7='';var _0x19c635='';var _0xc87da9={};var _0x51be94='';return db['ServicenowAccount'][_0xfd0d('0x4d')]({'where':{'id':_0x31c877[_0xfd0d('0x48')]['id']},'attributes':['id','username',_0xfd0d('0x98'),_0xfd0d('0x99'),'remoteUri',_0xfd0d('0x9a')]})['then'](handleEntityNotFound(_0x88511,null))[_0xfd0d('0x26')](function(_0x1c5106){if(_0x1c5106){_0x51be94=_0x1c5106[_0xfd0d('0x9b')];var _0x22e223=_0x51be94['slice'](-0x1);if(_0x22e223==='/'){_0x51be94=_0x51be94[_0xfd0d('0x9c')](0x0,_0x51be94[_0xfd0d('0x9d')](_0x22e223));}_0x19c635=util[_0xfd0d('0x9e')](_0xfd0d('0x9f'),_0x51be94);_0xd1d3f7=util[_0xfd0d('0x9e')](_0xfd0d('0xa0'),_0x51be94);_0xc87da9={'user':_0x1c5106[_0xfd0d('0xa1')],'pass':_0x1c5106[_0xfd0d('0x98')]};var _0x3e02a6={'method':_0xfd0d('0xa2'),'uri':_0x19c635+_0xfd0d('0xa3'),'auth':_0xc87da9,'json':!![]};return rp(_0x3e02a6);}})['then'](function(_0x6bdda3){if(_0x6bdda3[_0xfd0d('0xa4')][_0xfd0d('0x38')]>0x0){_0x2008a1=_0x6bdda3[_0xfd0d('0xa4')];}console[_0xfd0d('0xa5')]('incident\x20table\x20objects',_0x2008a1);_0x2d5f80=[];_0x5e9305=Object[_0xfd0d('0xa6')]([],_0x2008a1);_[_0xfd0d('0xa7')](_0x5e9305,function(_0x57f579){return!_0x3fd38e[_0xfd0d('0xa8')](_0x57f579['name']);});_0x5e9305[_0xfd0d('0xa9')](function(_0x2b62d4){var _0xda7cbf=createFieldObject(_0xd1d3f7,_0xc87da9,_0x2b62d4[_0xfd0d('0xaa')],_0x2b62d4[_0xfd0d('0x2a')],_0x2b62d4[_0xfd0d('0xab')],![]);_0x2d5f80[_0xfd0d('0xac')](_0xda7cbf);});return Promise[_0xfd0d('0xad')](_0x2d5f80);})['then'](function(_0x587a41){_0x2ba1d5=_0x587a41;_0x3e9a80=Object[_0xfd0d('0xa6')]([],_0x2008a1);console[_0xfd0d('0xa5')](_0xfd0d('0xae'),_0x2008a1);_[_0xfd0d('0xa7')](_0x3e9a80,function(_0x2f913b){return _0x2a91c6[_0xfd0d('0xa8')](_0x2f913b['name']);});console[_0xfd0d('0xa5')](_0xfd0d('0xaf'),_0x3e9a80);_0x2d5f80=[];_0x3e9a80[_0xfd0d('0xa9')](function(_0x5748e2){var _0x21a840=createFieldObject(_0xd1d3f7,_0xc87da9,_0x5748e2['internalType'],_0x5748e2[_0xfd0d('0x2a')],_0x5748e2[_0xfd0d('0xab')],!![]);_0x2d5f80[_0xfd0d('0xac')](_0x21a840);});return Promise[_0xfd0d('0xad')](_0x2d5f80);})[_0xfd0d('0x26')](function(_0x4c4175){_0x192c67=_0x4c4175;var _0x5317c6=_0x2ba1d5[_0xfd0d('0xb0')](_0x192c67);return{'count':_0x5317c6['length'],'rows':_0x5317c6};})[_0xfd0d('0x26')](respondWithResult(_0x88511,null))['catch'](function(_0x1eac66){console[_0xfd0d('0xa5')](_0xfd0d('0xb1')+_0x1eac66);var _0x4a79dc=_0x31c877[_0xfd0d('0x33')][_0xfd0d('0xb2')]?0x1f4:_0x1eac66[_0xfd0d('0xb3')]||0x1f4;logger[_0xfd0d('0x28')](_0x1eac66[_0xfd0d('0x29')]);delete _0x1eac66[_0xfd0d('0x2a')];if(_0x4a79dc===0x191){_0x4a79dc=0x190;}_0x88511[_0xfd0d('0x1b')](_0x4a79dc)[_0xfd0d('0xb4')](_0x31c877[_0xfd0d('0x33')][_0xfd0d('0xb2')]?{'message':'Wrong\x20credentials','statusCode':_0x1eac66[_0xfd0d('0xb3')]}:_0x1eac66);});};function createFieldObject(_0xe757a8,_0x54e488,_0x8397d8,_0x2d86f4,_0x20635b,_0x3cf4c6){return new Promise(function(_0x43b4ad,_0x3312c8){var _0x7756a9={'id':_0x2d86f4,'name':_0x20635b,'custom':_0x3cf4c6};if(_0x8397d8===_0xfd0d('0xb5')){_0x7756a9[_0xfd0d('0x42')]=[{'name':'True','value':_0xfd0d('0xb6')},{'name':_0xfd0d('0xb7'),'value':'false'}];_0x43b4ad(_0x7756a9);}else{var _0x4f5c5e={'method':'GET','uri':_0xe757a8+_0xfd0d('0xb8')+_0x2d86f4,'auth':_0x54e488,'json':!![]};return rp(_0x4f5c5e)['then'](function(_0x421e46){var _0x50c945=[];if(_0x421e46[_0xfd0d('0xa4')]['length']>0x0){_0x421e46['result']['forEach'](function(_0xbfba1d){if(_0xbfba1d[_0xfd0d('0xb9')]===_0xfd0d('0xba')){var _0x3a9ce6={'name':_0xbfba1d[_0xfd0d('0xab')],'value':_0xbfba1d[_0xfd0d('0xbb')]};_0x50c945['push'](_0x3a9ce6);}});}_0x7756a9[_0xfd0d('0x42')]=_0x50c945;if(_0x7756a9[_0xfd0d('0x42')][_0xfd0d('0x38')]>0x0){_0x43b4ad(_0x7756a9);}else{if(_0x3cf4c6==![]){_0x43b4ad();}else{_0x43b4ad(_0x7756a9);}}});}});} \ No newline at end of file +var _0x1708=['end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','sendStatus','error','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','filters','length','include','catch','create','body','find','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','severity','category','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','calendar_stc','closed_at','delivery_plan','impact','business_service','priority','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','work_notes','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','assigned_to','comments','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','findOne','username','password','email','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','ServiceNow\x20error:\x20','test','stack','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status'];(function(_0x5844f9,_0x2e7323){var _0x2a9ec8=function(_0x262056){while(--_0x262056){_0x5844f9['push'](_0x5844f9['shift']());}};_0x2a9ec8(++_0x2e7323);}(_0x1708,0x157));var _0x8170=function(_0x1a6329,_0x6113fd){_0x1a6329=_0x1a6329-0x0;var _0x3d5d47=_0x1708[_0x1a6329];return _0x3d5d47;};'use strict';var emlformat=require(_0x8170('0x0'));var rimraf=require(_0x8170('0x1'));var zipdir=require(_0x8170('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8170('0x3'));var moment=require(_0x8170('0x4'));var BPromise=require(_0x8170('0x5'));var Mustache=require(_0x8170('0x6'));var util=require(_0x8170('0x7'));var path=require('path');var sox=require(_0x8170('0x8'));var csv=require(_0x8170('0x9'));var ejs=require(_0x8170('0xa'));var fs=require('fs');var fs_extra=require(_0x8170('0xb'));var _=require(_0x8170('0xc'));var squel=require(_0x8170('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8170('0xe'));var Redis=require(_0x8170('0xf'));var authService=require(_0x8170('0x10'));var qs=require(_0x8170('0x11'));var as=require(_0x8170('0x12'));var hardwareService=require(_0x8170('0x13'));var logger=require(_0x8170('0x14'))(_0x8170('0x15'));var utils=require('../../config/utils');var config=require(_0x8170('0x16'));var licenseUtil=require(_0x8170('0x17'));var db=require(_0x8170('0x18'))['db'];var integrations=require(_0x8170('0x19'));function respondWithStatusCode(_0x20ed1,_0x3b6395){_0x3b6395=_0x3b6395||0xcc;return function(_0x227adb){if(_0x227adb){return _0x20ed1['sendStatus'](_0x3b6395);}return _0x20ed1[_0x8170('0x1a')](_0x3b6395)[_0x8170('0x1b')]();};}function respondWithResult(_0x2478f3,_0x236c35){_0x236c35=_0x236c35||0xc8;return function(_0x40f428){if(_0x40f428){return _0x2478f3[_0x8170('0x1a')](_0x236c35)[_0x8170('0x1c')](_0x40f428);}};}function respondWithFilteredResult(_0x49c5a0,_0x2f653d){return function(_0x2e31ad){if(_0x2e31ad){var _0x3f2b55=typeof _0x2f653d[_0x8170('0x1d')]==='undefined'&&typeof _0x2f653d[_0x8170('0x1e')]===_0x8170('0x1f');var _0x48a64f=_0x2e31ad['count'];var _0x5b7528=_0x3f2b55?0x0:_0x2f653d[_0x8170('0x1d')];var _0x13ad43=_0x3f2b55?_0x2e31ad[_0x8170('0x20')]:_0x2f653d['offset']+_0x2f653d[_0x8170('0x1e')];var _0x24f026;if(_0x13ad43>=_0x48a64f){_0x13ad43=_0x48a64f;_0x24f026=0xc8;}else{_0x24f026=0xce;}_0x49c5a0[_0x8170('0x1a')](_0x24f026);return _0x49c5a0[_0x8170('0x21')](_0x8170('0x22'),_0x5b7528+'-'+_0x13ad43+'/'+_0x48a64f)[_0x8170('0x1c')](_0x2e31ad);}return null;};}function patchUpdates(_0xf25a05){return function(_0x300632){try{jsonpatch[_0x8170('0x23')](_0x300632,_0xf25a05,!![]);}catch(_0x919ce2){return BPromise['reject'](_0x919ce2);}return _0x300632['save']();};}function saveUpdates(_0x10e8fd,_0x2bcc46){return function(_0x526759){if(_0x526759){return _0x526759[_0x8170('0x24')](_0x10e8fd)[_0x8170('0x25')](function(_0x53fe1c){return _0x53fe1c;});}return null;};}function removeEntity(_0x30e2a9,_0x30f986){return function(_0x8ce626){if(_0x8ce626){return _0x8ce626['destroy']()[_0x8170('0x25')](function(){_0x30e2a9[_0x8170('0x1a')](0xcc)[_0x8170('0x1b')]();});}};}function handleEntityNotFound(_0x1d710b,_0x5003ce){return function(_0x5bfd9c){if(!_0x5bfd9c){_0x1d710b[_0x8170('0x26')](0x194);}return _0x5bfd9c;};}function handleError(_0x5ddb29,_0x5304ab){_0x5304ab=_0x5304ab||0x1f4;return function(_0x3655df){logger[_0x8170('0x27')](_0x3655df['stack']);if(_0x3655df['name']){delete _0x3655df[_0x8170('0x28')];}_0x5ddb29[_0x8170('0x1a')](_0x5304ab)[_0x8170('0x29')](_0x3655df);};}exports[_0x8170('0x2a')]=function(_0x3550b9,_0x563f67){var _0xeab397={},_0x4ad42a={},_0x4a145e={'count':0x0,'rows':[]};var _0x44abed=_[_0x8170('0x2b')](db[_0x8170('0x2c')][_0x8170('0x2d')],function(_0x2e41f4){return{'name':_0x2e41f4[_0x8170('0x2e')],'type':_0x2e41f4[_0x8170('0x2f')][_0x8170('0x30')]};});_0x4ad42a[_0x8170('0x31')]=_['map'](_0x44abed,_0x8170('0x28'));_0x4ad42a[_0x8170('0x32')]=_['keys'](_0x3550b9[_0x8170('0x32')]);_0x4ad42a['filters']=_[_0x8170('0x33')](_0x4ad42a[_0x8170('0x31')],_0x4ad42a['query']);_0xeab397['attributes']=_[_0x8170('0x33')](_0x4ad42a[_0x8170('0x31')],qs[_0x8170('0x34')](_0x3550b9[_0x8170('0x32')][_0x8170('0x34')]));_0xeab397[_0x8170('0x35')]=_0xeab397['attributes']['length']?_0xeab397['attributes']:_0x4ad42a[_0x8170('0x31')];if(!_0x3550b9['query']['hasOwnProperty'](_0x8170('0x36'))){_0xeab397[_0x8170('0x1e')]=qs['limit'](_0x3550b9[_0x8170('0x32')][_0x8170('0x1e')]);_0xeab397[_0x8170('0x1d')]=qs[_0x8170('0x1d')](_0x3550b9[_0x8170('0x32')][_0x8170('0x1d')]);}_0xeab397[_0x8170('0x37')]=qs[_0x8170('0x38')](_0x3550b9[_0x8170('0x32')][_0x8170('0x38')]);_0xeab397['where']=qs['filters'](_[_0x8170('0x39')](_0x3550b9[_0x8170('0x32')],_0x4ad42a['filters']),_0x44abed);if(_0x3550b9[_0x8170('0x32')][_0x8170('0x3a')]){_0xeab397[_0x8170('0x3b')]=_['merge'](_0xeab397[_0x8170('0x3b')],{'$or':_[_0x8170('0x2b')](_0x44abed,function(_0x4e0455){if(_0x4e0455[_0x8170('0x2f')]!==_0x8170('0x3c')){var _0x3f88eb={};_0x3f88eb[_0x4e0455[_0x8170('0x28')]]={'$like':'%'+_0x3550b9[_0x8170('0x32')][_0x8170('0x3a')]+'%'};return _0x3f88eb;}})});}_0xeab397=_[_0x8170('0x3d')]({},_0xeab397,_0x3550b9[_0x8170('0x3e')]);var _0xdad93c={'where':_0xeab397[_0x8170('0x3b')]};return db[_0x8170('0x2c')][_0x8170('0x20')](_0xdad93c)[_0x8170('0x25')](function(_0x1dee9d){_0x4a145e[_0x8170('0x20')]=_0x1dee9d;if(_0x3550b9[_0x8170('0x32')][_0x8170('0x3f')]){_0xeab397['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x8170('0x40')](_0xeab397);})[_0x8170('0x25')](function(_0x2b61dc){_0x4a145e[_0x8170('0x41')]=_0x2b61dc;return _0x4a145e;})[_0x8170('0x25')](respondWithFilteredResult(_0x563f67,_0xeab397))['catch'](handleError(_0x563f67,null));};exports[_0x8170('0x42')]=function(_0x11c115,_0x40cdba){var _0x9ff46f={'raw':![],'where':{'id':_0x11c115[_0x8170('0x43')]['id']}},_0x5d01a0={};_0x5d01a0[_0x8170('0x31')]=_[_0x8170('0x44')](db[_0x8170('0x2c')][_0x8170('0x2d')]);_0x5d01a0[_0x8170('0x32')]=_['keys'](_0x11c115[_0x8170('0x32')]);_0x5d01a0[_0x8170('0x45')]=_['intersection'](_0x5d01a0[_0x8170('0x31')],_0x5d01a0[_0x8170('0x32')]);_0x9ff46f[_0x8170('0x35')]=_[_0x8170('0x33')](_0x5d01a0[_0x8170('0x31')],qs[_0x8170('0x34')](_0x11c115[_0x8170('0x32')][_0x8170('0x34')]));_0x9ff46f[_0x8170('0x35')]=_0x9ff46f[_0x8170('0x35')][_0x8170('0x46')]?_0x9ff46f[_0x8170('0x35')]:_0x5d01a0[_0x8170('0x31')];if(_0x11c115[_0x8170('0x32')][_0x8170('0x3f')]){_0x9ff46f[_0x8170('0x47')]=[{'all':!![]}];}_0x9ff46f=_['merge']({},_0x9ff46f,_0x11c115[_0x8170('0x3e')]);return db[_0x8170('0x2c')]['find'](_0x9ff46f)[_0x8170('0x25')](handleEntityNotFound(_0x40cdba,null))['then'](respondWithResult(_0x40cdba,null))[_0x8170('0x48')](handleError(_0x40cdba,null));};exports[_0x8170('0x49')]=function(_0x44ef25,_0x49a408){return db['ServicenowAccount'][_0x8170('0x49')](_0x44ef25[_0x8170('0x4a')],{})['then'](respondWithResult(_0x49a408,0xc9))[_0x8170('0x48')](handleError(_0x49a408,null));};exports[_0x8170('0x24')]=function(_0x242242,_0x702a6e){if(_0x242242[_0x8170('0x4a')]['id']){delete _0x242242[_0x8170('0x4a')]['id'];}return db[_0x8170('0x2c')][_0x8170('0x4b')]({'where':{'id':_0x242242[_0x8170('0x43')]['id']}})[_0x8170('0x25')](handleEntityNotFound(_0x702a6e,null))['then'](saveUpdates(_0x242242[_0x8170('0x4a')],null))['then'](respondWithResult(_0x702a6e,null))[_0x8170('0x48')](handleError(_0x702a6e,null));};exports['destroy']=function(_0x5f36f3,_0xbbddb6){return db['ServicenowAccount'][_0x8170('0x4b')]({'where':{'id':_0x5f36f3[_0x8170('0x43')]['id']}})['then'](handleEntityNotFound(_0xbbddb6,null))[_0x8170('0x25')](removeEntity(_0xbbddb6,null))['catch'](handleError(_0xbbddb6,null));};exports[_0x8170('0x4c')]=function(_0x156375,_0x4b4170,_0x2b293b){var _0x1232db={};var _0x6cfe2={};var _0x333296;var _0x22bc37;return db[_0x8170('0x2c')]['findOne']({'where':{'id':_0x156375[_0x8170('0x43')]['id']}})[_0x8170('0x25')](handleEntityNotFound(_0x4b4170,null))[_0x8170('0x25')](function(_0x284e89){if(_0x284e89){_0x333296=_0x284e89;_0x6cfe2[_0x8170('0x31')]=_[_0x8170('0x44')](db['ServicenowConfiguration'][_0x8170('0x2d')]);_0x6cfe2['query']=_[_0x8170('0x44')](_0x156375['query']);_0x6cfe2['filters']=_[_0x8170('0x33')](_0x6cfe2[_0x8170('0x31')],_0x6cfe2['query']);_0x1232db[_0x8170('0x35')]=_[_0x8170('0x33')](_0x6cfe2[_0x8170('0x31')],qs['fields'](_0x156375[_0x8170('0x32')][_0x8170('0x34')]));_0x1232db[_0x8170('0x35')]=_0x1232db[_0x8170('0x35')][_0x8170('0x46')]?_0x1232db[_0x8170('0x35')]:_0x6cfe2[_0x8170('0x31')];_0x1232db[_0x8170('0x37')]=qs[_0x8170('0x38')](_0x156375[_0x8170('0x32')][_0x8170('0x38')]);_0x1232db[_0x8170('0x3b')]=qs[_0x8170('0x45')](_['pick'](_0x156375[_0x8170('0x32')],_0x6cfe2[_0x8170('0x45')]));if(_0x156375[_0x8170('0x32')][_0x8170('0x3a')]){_0x1232db[_0x8170('0x3b')]=_[_0x8170('0x3d')](_0x1232db[_0x8170('0x3b')],{'$or':_[_0x8170('0x2b')](_0x1232db[_0x8170('0x35')],function(_0x49e3d6){var _0x1fd2e4={};_0x1fd2e4[_0x49e3d6]={'$like':'%'+_0x156375[_0x8170('0x32')][_0x8170('0x3a')]+'%'};return _0x1fd2e4;})});}_0x1232db=_[_0x8170('0x3d')]({},_0x1232db,_0x156375[_0x8170('0x3e')]);return _0x333296[_0x8170('0x4c')](_0x1232db);}})[_0x8170('0x25')](function(_0x1a6f70){if(_0x1a6f70){_0x22bc37=_0x1a6f70[_0x8170('0x46')];if(!_0x156375[_0x8170('0x32')][_0x8170('0x4d')]('nolimit')){_0x1232db['limit']=qs[_0x8170('0x1e')](_0x156375[_0x8170('0x32')][_0x8170('0x1e')]);_0x1232db[_0x8170('0x1d')]=qs[_0x8170('0x1d')](_0x156375[_0x8170('0x32')][_0x8170('0x1d')]);}return _0x333296['getConfigurations'](_0x1232db);}})[_0x8170('0x25')](function(_0xc77b63){if(_0xc77b63){return _0xc77b63?{'count':_0x22bc37,'rows':_0xc77b63}:null;}})[_0x8170('0x25')](respondWithResult(_0x4b4170,null))['catch'](handleError(_0x4b4170,null));};exports[_0x8170('0x4e')]=function(_0x13781b,_0x4cdf6b,_0x9b4685){if(_0x13781b[_0x8170('0x4a')]['id']){delete _0x13781b[_0x8170('0x4a')]['id'];}return db[_0x8170('0x2c')]['findOne']({'where':{'id':_0x13781b[_0x8170('0x43')]['id']}})[_0x8170('0x25')](handleEntityNotFound(_0x4cdf6b,null))[_0x8170('0x25')](function(_0x2ed4ad){if(_0x2ed4ad){_0x13781b[_0x8170('0x4a')][_0x8170('0x4f')]=_0x2ed4ad['id'];_0x13781b['body'][_0x8170('0x50')]=integrations[_0x8170('0x51')](_0x13781b[_0x8170('0x4a')][_0x8170('0x52')],_0x13781b['body'][_0x8170('0x2f')]);_0x13781b['body'][_0x8170('0x53')]=integrations[_0x8170('0x54')](_0x13781b[_0x8170('0x4a')][_0x8170('0x52')],_0x13781b['body'][_0x8170('0x2f')]);return db[_0x8170('0x55')][_0x8170('0x49')](_0x13781b[_0x8170('0x4a')],{'include':[{'model':db[_0x8170('0x56')],'as':_0x8170('0x50')},{'model':db['ServicenowField'],'as':_0x8170('0x53')}]});}return null;})[_0x8170('0x25')](respondWithResult(_0x4cdf6b,null))['catch'](handleError(_0x4cdf6b,null));};exports[_0x8170('0x57')]=function(_0x4dd603,_0x3b7921,_0x517b0a){var _0x30b253=[_0x8170('0x58'),_0x8170('0x59'),'knowledge',_0x8170('0x5a'),_0x8170('0x5b'),_0x8170('0x5c'),'incident_state',_0x8170('0x5d'),_0x8170('0x5e')];var _0x27d5f8=['parent',_0x8170('0x58'),_0x8170('0x5f'),'watch_list',_0x8170('0x60'),_0x8170('0x61'),_0x8170('0x62'),_0x8170('0x59'),_0x8170('0x63'),_0x8170('0x64'),_0x8170('0x65'),_0x8170('0x66'),_0x8170('0x67'),_0x8170('0x68'),_0x8170('0x69'),'sys_domain',_0x8170('0x6a'),_0x8170('0x6b'),_0x8170('0x6c'),_0x8170('0x37'),_0x8170('0x6d'),_0x8170('0x6e'),'cmdb_ci',_0x8170('0x6f'),_0x8170('0x70'),'active','work_notes_list',_0x8170('0x71'),_0x8170('0x72'),'sys_domain_path','rfc',_0x8170('0x73'),_0x8170('0x74'),_0x8170('0x75'),_0x8170('0x76'),_0x8170('0x77'),_0x8170('0x78'),_0x8170('0x79'),_0x8170('0x7a'),'caller_id','approval_set',_0x8170('0x5a'),_0x8170('0x7b'),'short_description',_0x8170('0x5b'),_0x8170('0x7c'),_0x8170('0x7d'),_0x8170('0x7e'),_0x8170('0x7f'),_0x8170('0x80'),_0x8170('0x81'),_0x8170('0x82'),_0x8170('0x83'),'notify','sys_class_name',_0x8170('0x84'),_0x8170('0x85'),_0x8170('0x86'),_0x8170('0x87'),_0x8170('0x88'),_0x8170('0x89'),_0x8170('0x8a'),'incident_state',_0x8170('0x8b'),'problem_id',_0x8170('0x8c'),_0x8170('0x8d'),'activity_due',_0x8170('0x8e'),_0x8170('0x5d'),_0x8170('0x8f'),'sla_due','approval',_0x8170('0x90'),'due_date',_0x8170('0x91'),_0x8170('0x92'),_0x8170('0x93'),'escalation',_0x8170('0x94'),_0x8170('0x95'),'location',_0x8170('0x5e')];var _0x3781dc='';var _0x368c98='';var _0x31aeea=[];var _0x575521='';var _0xf811e='';var _0xcfea35=[];var _0x1c8367='';var _0x249208='';var _0x201e96={};var _0x3bca79='';return db[_0x8170('0x2c')][_0x8170('0x96')]({'where':{'id':_0x4dd603['params']['id']},'attributes':['id',_0x8170('0x97'),_0x8170('0x98'),_0x8170('0x99'),'remoteUri','serverUrl']})[_0x8170('0x25')](handleEntityNotFound(_0x3b7921,null))['then'](function(_0x191f33){if(_0x191f33){_0x3bca79=_0x191f33[_0x8170('0x9a')];var _0x49580d=_0x3bca79[_0x8170('0x9b')](-0x1);if(_0x49580d==='/'){_0x3bca79=_0x3bca79[_0x8170('0x9c')](0x0,_0x3bca79[_0x8170('0x9d')](_0x49580d));}_0x249208=util['format'](_0x8170('0x9e'),_0x3bca79);_0x1c8367=util['format'](_0x8170('0x9f'),_0x3bca79);_0x201e96={'user':_0x191f33[_0x8170('0x97')],'pass':_0x191f33[_0x8170('0x98')]};var _0x16828d={'method':_0x8170('0xa0'),'uri':_0x249208+_0x8170('0xa1'),'auth':_0x201e96,'json':!![]};return rp(_0x16828d);}})[_0x8170('0x25')](function(_0x40e918){if(_0x40e918['result'][_0x8170('0x46')]>0x0){_0x3781dc=_0x40e918[_0x8170('0xa2')];}console[_0x8170('0xa3')](_0x8170('0xa4'),_0x3781dc);_0xcfea35=[];_0x368c98=Object[_0x8170('0xa5')]([],_0x3781dc);_[_0x8170('0xa6')](_0x368c98,function(_0x4ab2a7){return!_0x30b253[_0x8170('0xa7')](_0x4ab2a7[_0x8170('0x28')]);});_0x368c98['forEach'](function(_0x4fe4e0){var _0x475808=createFieldObject(_0x1c8367,_0x201e96,_0x4fe4e0[_0x8170('0xa8')],_0x4fe4e0[_0x8170('0x28')],_0x4fe4e0[_0x8170('0xa9')],![]);_0xcfea35[_0x8170('0xaa')](_0x475808);});return Promise[_0x8170('0xab')](_0xcfea35);})['then'](function(_0x3d7b69){_0x31aeea=_0x3d7b69;_0x575521=Object[_0x8170('0xa5')]([],_0x3781dc);console[_0x8170('0xa3')]('TCL:\x20_object',_0x3781dc);_[_0x8170('0xa6')](_0x575521,function(_0x176513){return _0x27d5f8[_0x8170('0xa7')](_0x176513[_0x8170('0x28')]);});console[_0x8170('0xa3')](_0x8170('0xac'),_0x575521);_0xcfea35=[];_0x575521[_0x8170('0xad')](function(_0xb7d78){var _0x38cd32=createFieldObject(_0x1c8367,_0x201e96,_0xb7d78[_0x8170('0xa8')],_0xb7d78[_0x8170('0x28')],_0xb7d78[_0x8170('0xa9')],!![]);_0xcfea35[_0x8170('0xaa')](_0x38cd32);});return Promise[_0x8170('0xab')](_0xcfea35);})[_0x8170('0x25')](function(_0x4579cc){_0xf811e=_0x4579cc;var _0x523d34=_0x31aeea['concat'](_0xf811e);return{'count':_0x523d34[_0x8170('0x46')],'rows':_0x523d34};})[_0x8170('0x25')](respondWithResult(_0x3b7921,null))[_0x8170('0x48')](function(_0x4951c){console[_0x8170('0xa3')](_0x8170('0xae')+_0x4951c);var _0x11304f=_0x4dd603[_0x8170('0x32')][_0x8170('0xaf')]?0x1f4:_0x4951c['statusCode']||0x1f4;logger[_0x8170('0x27')](_0x4951c[_0x8170('0xb0')]);delete _0x4951c['name'];if(_0x11304f===0x191){_0x11304f=0x190;}_0x3b7921[_0x8170('0x1a')](_0x11304f)[_0x8170('0x29')](_0x4dd603[_0x8170('0x32')][_0x8170('0xaf')]?{'message':_0x8170('0xb1'),'statusCode':_0x4951c[_0x8170('0xb2')]}:_0x4951c);});};function createFieldObject(_0x5caa39,_0x54626b,_0x5f5cdc,_0x4423ca,_0x591de5,_0x4753c7){return new Promise(function(_0x1e5805,_0x2bbc29){var _0x57c636={'id':_0x4423ca,'name':_0x591de5,'custom':_0x4753c7};if(_0x5f5cdc===_0x8170('0xb3')){_0x57c636[_0x8170('0x3e')]=[{'name':_0x8170('0xb4'),'value':'true'},{'name':_0x8170('0xb5'),'value':_0x8170('0xb6')}];_0x1e5805(_0x57c636);}else{var _0x58998c={'method':_0x8170('0xa0'),'uri':_0x5caa39+_0x8170('0xb7')+_0x4423ca,'auth':_0x54626b,'json':!![]};return rp(_0x58998c)[_0x8170('0x25')](function(_0x3072c5){var _0x4cc11b=[];if(_0x3072c5[_0x8170('0xa2')][_0x8170('0x46')]>0x0){_0x3072c5[_0x8170('0xa2')][_0x8170('0xad')](function(_0x19eca7){if(_0x19eca7[_0x8170('0xb8')]===_0x8170('0xb6')){var _0x2cba1f={'name':_0x19eca7['label'],'value':_0x19eca7['value']};_0x4cc11b[_0x8170('0xaa')](_0x2cba1f);}});}_0x57c636[_0x8170('0x3e')]=_0x4cc11b;if(_0x57c636[_0x8170('0x3e')][_0x8170('0x46')]>0x0){_0x1e5805(_0x57c636);}else{if(_0x4753c7==![]){_0x1e5805();}else{_0x1e5805(_0x57c636);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 1443c01..a813238 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 _0x53ec=['path','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x53ec,0x192));var _0xc53e=function(_0x3ae8f4,_0x2920f4){_0x3ae8f4=_0x3ae8f4-0x0;var _0x367312=_0x53ec[_0x3ae8f4];return _0x367312;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc53e('0x9')]=function(_0x4f989b,_0x41a9e8){return _0x4f989b[_0xc53e('0xa')]('ServicenowAccount',attributes,{'tableName':_0xc53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc97=['request-promise','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash','util','../../config/logger','moment'];(function(_0x28c4e9,_0x503322){var _0x27e3b0=function(_0x3de2eb){while(--_0x3de2eb){_0x28c4e9['push'](_0x28c4e9['shift']());}};_0x27e3b0(++_0x503322);}(_0xdc97,0x13b));var _0x7dc9=function(_0x383418,_0x37bea2){_0x383418=_0x383418-0x0;var _0x1c254b=_0xdc97[_0x383418];return _0x1c254b;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));var integrations=require(_0x7dc9('0x8'));module[_0x7dc9('0x9')]=function(_0x589f02,_0x2636ef){return _0x589f02['define']('ServicenowAccount',attributes,{'tableName':_0x7dc9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 945df6a..5dd5b34 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 _0x223b=['attributes','GetServicenowAccount','stringify','ShowServicenowAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','findAll','options','where','limit','include','map','model'];(function(_0x34eabc,_0x51d411){var _0x43e72f=function(_0x5619e8){while(--_0x5619e8){_0x34eabc['push'](_0x34eabc['shift']());}};_0x43e72f(++_0x51d411);}(_0x223b,0x10e));var _0xb223=function(_0x1329ae,_0x28f239){_0x1329ae=_0x1329ae-0x0;var _0x1129cb=_0x223b[_0x1329ae];return _0x1129cb;};'use strict';var _=require(_0xb223('0x0'));var util=require('util');var moment=require(_0xb223('0x1'));var BPromise=require('bluebird');var rs=require(_0xb223('0x2'));var fs=require('fs');var Redis=require(_0xb223('0x3'));var db=require(_0xb223('0x4'))['db'];var utils=require(_0xb223('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb223('0x6'));var jayson=require(_0xb223('0x7'));var client=jayson['client'][_0xb223('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2833ae,_0x1c2c06,_0x208e27){return new BPromise(function(_0x2ee7e4,_0x2f257c){return client[_0xb223('0x9')](_0x2833ae,_0x208e27)[_0xb223('0xa')](function(_0x1760a8){logger[_0xb223('0xb')](_0xb223('0xc'),_0x1c2c06,_0xb223('0xd'));logger[_0xb223('0xe')](_0xb223('0xf'),_0x1c2c06,_0xb223('0xd'),JSON['stringify'](_0x1760a8));if(_0x1760a8[_0xb223('0x10')]){if(_0x1760a8['error']['code']===0x1f4){logger[_0xb223('0x10')](_0xb223('0xc'),_0x1c2c06,_0x1760a8[_0xb223('0x10')]['message']);return _0x2f257c(_0x1760a8[_0xb223('0x10')]['message']);}logger[_0xb223('0x10')](_0xb223('0xc'),_0x1c2c06,_0x1760a8[_0xb223('0x10')][_0xb223('0x11')]);return _0x2ee7e4(_0x1760a8[_0xb223('0x10')][_0xb223('0x11')]);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1c2c06,_0xb223('0xd'));_0x2ee7e4(_0x1760a8[_0xb223('0x12')]['message']);}})[_0xb223('0x13')](function(_0x1e3fe7){logger[_0xb223('0x10')](_0xb223('0xc'),_0x1c2c06,_0x1e3fe7);_0x2f257c(_0x1e3fe7);});});}exports['GetServicenowAccount']=function(_0x2d8f00){var _0x1a632b=this;return new Promise(function(_0x6de2f6,_0x1c3b37){return db['ServicenowAccount'][_0xb223('0x14')]({'raw':_0x2d8f00['options']?_0x2d8f00[_0xb223('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2d8f00[_0xb223('0x15')]?_0x2d8f00[_0xb223('0x15')][_0xb223('0x16')]||null:null,'attributes':_0x2d8f00[_0xb223('0x15')]?_0x2d8f00[_0xb223('0x15')]['attributes']||null:null,'limit':_0x2d8f00[_0xb223('0x15')]?_0x2d8f00[_0xb223('0x15')][_0xb223('0x17')]||null:null,'include':_0x2d8f00[_0xb223('0x15')]?_0x2d8f00[_0xb223('0x15')][_0xb223('0x18')]?_[_0xb223('0x19')](_0x2d8f00[_0xb223('0x15')][_0xb223('0x18')],function(_0x15cd17){return{'model':db[_0x15cd17[_0xb223('0x1a')]],'as':_0x15cd17['as'],'attributes':_0x15cd17['attributes'],'include':_0x15cd17['include']?_[_0xb223('0x19')](_0x15cd17[_0xb223('0x18')],function(_0x5a537e){return{'model':db[_0x5a537e[_0xb223('0x1a')]],'as':_0x5a537e['as'],'attributes':_0x5a537e[_0xb223('0x1b')],'include':_0x5a537e[_0xb223('0x18')]?_['map'](_0x5a537e[_0xb223('0x18')],function(_0x345006){return{'model':db[_0x345006[_0xb223('0x1a')]],'as':_0x345006['as'],'attributes':_0x345006[_0xb223('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb223('0xa')](function(_0x2db3ab){logger[_0xb223('0xb')](_0xb223('0x1c'),_0x2d8f00);logger[_0xb223('0xe')]('GetServicenowAccount',_0x2d8f00,JSON[_0xb223('0x1d')](_0x2db3ab));_0x6de2f6(_0x2db3ab);})[_0xb223('0x13')](function(_0x2daa7f){logger[_0xb223('0x10')](_0xb223('0x1c'),_0x2daa7f['message'],_0x2d8f00);_0x1c3b37(_0x1a632b['error'](0x1f4,_0x2daa7f['message']));});});};exports[_0xb223('0x1e')]=function(_0x2e81b0){var _0x57a42a=this;return new Promise(function(_0x2fce81,_0x268940){return db['ServicenowAccount'][_0xb223('0x1f')]({'raw':_0x2e81b0[_0xb223('0x15')]?_0x2e81b0[_0xb223('0x15')][_0xb223('0x20')]===undefined?!![]:![]:!![],'where':_0x2e81b0[_0xb223('0x15')]?_0x2e81b0[_0xb223('0x15')][_0xb223('0x16')]||null:null,'attributes':_0x2e81b0[_0xb223('0x15')]?_0x2e81b0[_0xb223('0x15')]['attributes']||null:null,'include':_0x2e81b0[_0xb223('0x15')]?_0x2e81b0[_0xb223('0x15')][_0xb223('0x18')]?_[_0xb223('0x19')](_0x2e81b0[_0xb223('0x15')]['include'],function(_0x3c149c){return{'model':db[_0x3c149c[_0xb223('0x1a')]],'as':_0x3c149c['as'],'attributes':_0x3c149c['attributes'],'include':_0x3c149c[_0xb223('0x18')]?_[_0xb223('0x19')](_0x3c149c[_0xb223('0x18')],function(_0x49adec){return{'model':db[_0x49adec[_0xb223('0x1a')]],'as':_0x49adec['as'],'attributes':_0x49adec[_0xb223('0x1b')],'include':_0x49adec[_0xb223('0x18')]?_[_0xb223('0x19')](_0x49adec[_0xb223('0x18')],function(_0x39469c){return{'model':db[_0x39469c['model']],'as':_0x39469c['as'],'attributes':_0x39469c[_0xb223('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb223('0xa')](function(_0x191776){logger[_0xb223('0xb')](_0xb223('0x1e'),_0x2e81b0);logger[_0xb223('0xe')](_0xb223('0x1e'),_0x2e81b0,JSON['stringify'](_0x191776));_0x2fce81(_0x191776);})[_0xb223('0x13')](function(_0x254995){logger['error']('ShowServicenowAccount',_0x254995[_0xb223('0x11')],_0x2e81b0);_0x268940(_0x57a42a[_0xb223('0x10')](0x1f4,_0x254995['message']));});});}; \ No newline at end of file +var _0x39c7=['options','raw','where','attributes','limit','map','include','model','ShowServicenowAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x4e170e,_0x207e58){var _0x338291=function(_0x4cb198){while(--_0x4cb198){_0x4e170e['push'](_0x4e170e['shift']());}};_0x338291(++_0x207e58);}(_0x39c7,0x172));var _0x739c=function(_0x55db7a,_0x5a4a6b){_0x55db7a=_0x55db7a-0x0;var _0x49110f=_0x39c7[_0x55db7a];return _0x49110f;};'use strict';var _=require(_0x739c('0x0'));var util=require(_0x739c('0x1'));var moment=require(_0x739c('0x2'));var BPromise=require('bluebird');var rs=require(_0x739c('0x3'));var fs=require('fs');var Redis=require(_0x739c('0x4'));var db=require(_0x739c('0x5'))['db'];var utils=require(_0x739c('0x6'));var logger=require(_0x739c('0x7'))('rpc');var config=require(_0x739c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x739c('0x9')][_0x739c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x563514,_0x15a950,_0x4e802c){return new BPromise(function(_0x2f1521,_0x27c4b2){return client[_0x739c('0xb')](_0x563514,_0x4e802c)[_0x739c('0xc')](function(_0x11b177){logger[_0x739c('0xd')](_0x739c('0xe'),_0x15a950,_0x739c('0xf'));logger[_0x739c('0x10')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x15a950,'request\x20sent',JSON[_0x739c('0x11')](_0x11b177));if(_0x11b177[_0x739c('0x12')]){if(_0x11b177[_0x739c('0x12')][_0x739c('0x13')]===0x1f4){logger['error'](_0x739c('0xe'),_0x15a950,_0x11b177[_0x739c('0x12')][_0x739c('0x14')]);return _0x27c4b2(_0x11b177[_0x739c('0x12')][_0x739c('0x14')]);}logger[_0x739c('0x12')](_0x739c('0xe'),_0x15a950,_0x11b177[_0x739c('0x12')][_0x739c('0x14')]);return _0x2f1521(_0x11b177['error'][_0x739c('0x14')]);}else{logger[_0x739c('0xd')](_0x739c('0xe'),_0x15a950,_0x739c('0xf'));_0x2f1521(_0x11b177[_0x739c('0x15')]['message']);}})[_0x739c('0x16')](function(_0x51f0b1){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x15a950,_0x51f0b1);_0x27c4b2(_0x51f0b1);});});}exports[_0x739c('0x17')]=function(_0x57dfd6){var _0x4335be=this;return new Promise(function(_0x1e338c,_0x1c00a6){return db[_0x739c('0x18')][_0x739c('0x19')]({'raw':_0x57dfd6[_0x739c('0x1a')]?_0x57dfd6[_0x739c('0x1a')][_0x739c('0x1b')]===undefined?!![]:![]:!![],'where':_0x57dfd6['options']?_0x57dfd6[_0x739c('0x1a')][_0x739c('0x1c')]||null:null,'attributes':_0x57dfd6[_0x739c('0x1a')]?_0x57dfd6[_0x739c('0x1a')][_0x739c('0x1d')]||null:null,'limit':_0x57dfd6['options']?_0x57dfd6[_0x739c('0x1a')][_0x739c('0x1e')]||null:null,'include':_0x57dfd6[_0x739c('0x1a')]?_0x57dfd6[_0x739c('0x1a')]['include']?_[_0x739c('0x1f')](_0x57dfd6['options'][_0x739c('0x20')],function(_0x3315e9){return{'model':db[_0x3315e9[_0x739c('0x21')]],'as':_0x3315e9['as'],'attributes':_0x3315e9[_0x739c('0x1d')],'include':_0x3315e9[_0x739c('0x20')]?_['map'](_0x3315e9[_0x739c('0x20')],function(_0x29f663){return{'model':db[_0x29f663[_0x739c('0x21')]],'as':_0x29f663['as'],'attributes':_0x29f663['attributes'],'include':_0x29f663[_0x739c('0x20')]?_[_0x739c('0x1f')](_0x29f663[_0x739c('0x20')],function(_0x55a3a2){return{'model':db[_0x55a3a2['model']],'as':_0x55a3a2['as'],'attributes':_0x55a3a2[_0x739c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x739c('0xc')](function(_0x369940){logger[_0x739c('0xd')](_0x739c('0x17'),_0x57dfd6);logger['debug'](_0x739c('0x17'),_0x57dfd6,JSON[_0x739c('0x11')](_0x369940));_0x1e338c(_0x369940);})[_0x739c('0x16')](function(_0x587adf){logger[_0x739c('0x12')](_0x739c('0x17'),_0x587adf[_0x739c('0x14')],_0x57dfd6);_0x1c00a6(_0x4335be[_0x739c('0x12')](0x1f4,_0x587adf[_0x739c('0x14')]));});});};exports[_0x739c('0x22')]=function(_0x5afdaf){var _0xd0b092=this;return new Promise(function(_0x4af7b1,_0xe2d6de){return db[_0x739c('0x18')][_0x739c('0x23')]({'raw':_0x5afdaf['options']?_0x5afdaf[_0x739c('0x1a')][_0x739c('0x1b')]===undefined?!![]:![]:!![],'where':_0x5afdaf[_0x739c('0x1a')]?_0x5afdaf[_0x739c('0x1a')][_0x739c('0x1c')]||null:null,'attributes':_0x5afdaf[_0x739c('0x1a')]?_0x5afdaf[_0x739c('0x1a')][_0x739c('0x1d')]||null:null,'include':_0x5afdaf['options']?_0x5afdaf[_0x739c('0x1a')][_0x739c('0x20')]?_[_0x739c('0x1f')](_0x5afdaf[_0x739c('0x1a')][_0x739c('0x20')],function(_0x1086e3){return{'model':db[_0x1086e3['model']],'as':_0x1086e3['as'],'attributes':_0x1086e3[_0x739c('0x1d')],'include':_0x1086e3[_0x739c('0x20')]?_[_0x739c('0x1f')](_0x1086e3[_0x739c('0x20')],function(_0x4255ba){return{'model':db[_0x4255ba[_0x739c('0x21')]],'as':_0x4255ba['as'],'attributes':_0x4255ba[_0x739c('0x1d')],'include':_0x4255ba[_0x739c('0x20')]?_[_0x739c('0x1f')](_0x4255ba[_0x739c('0x20')],function(_0xad4e02){return{'model':db[_0xad4e02['model']],'as':_0xad4e02['as'],'attributes':_0xad4e02['attributes']};}):[]};}):[]};}):[]:[]})[_0x739c('0xc')](function(_0xa8fbff){logger[_0x739c('0xd')](_0x739c('0x22'),_0x5afdaf);logger['debug'](_0x739c('0x22'),_0x5afdaf,JSON[_0x739c('0x11')](_0xa8fbff));_0x4af7b1(_0xa8fbff);})[_0x739c('0x16')](function(_0x2248ad){logger[_0x739c('0x12')](_0x739c('0x22'),_0x2248ad[_0x739c('0x14')],_0x5afdaf);_0xe2d6de(_0xd0b092[_0x739c('0x12')](0x1f4,_0x2248ad[_0x739c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 3fb5c61..aa1114a 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 _0xf5b3=['exports','multer','util','connect-timeout','express','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete'];(function(_0x196585,_0x39c976){var _0x5759e7=function(_0x5d417d){while(--_0x5d417d){_0x196585['push'](_0x196585['shift']());}};_0x5759e7(++_0x39c976);}(_0xf5b3,0x8d));var _0x3f5b=function(_0x2bbf4e,_0x21ddbc){_0x2bbf4e=_0x2bbf4e-0x0;var _0x39d499=_0xf5b3[_0x2bbf4e];return _0x39d499;};'use strict';var multer=require(_0x3f5b('0x0'));var util=require(_0x3f5b('0x1'));var path=require('path');var timeout=require(_0x3f5b('0x2'));var express=require(_0x3f5b('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('../../config/environment');var controller=require(_0x3f5b('0x4'));router[_0x3f5b('0x5')]('/',auth[_0x3f5b('0x6')](),controller[_0x3f5b('0x7')]);router['get'](_0x3f5b('0x8'),auth['isAuthenticated'](),controller[_0x3f5b('0x9')]);router[_0x3f5b('0x5')]('/:id/fields',auth[_0x3f5b('0x6')](),controller[_0x3f5b('0xa')]);router[_0x3f5b('0x5')](_0x3f5b('0xb'),auth[_0x3f5b('0x6')](),controller[_0x3f5b('0xc')]);router[_0x3f5b('0x5')]('/:id/descriptions',auth[_0x3f5b('0x6')](),controller[_0x3f5b('0xd')]);router[_0x3f5b('0xe')]('/',auth[_0x3f5b('0x6')](),controller[_0x3f5b('0xf')]);router[_0x3f5b('0x10')](_0x3f5b('0x8'),auth[_0x3f5b('0x6')](),controller[_0x3f5b('0x11')]);router[_0x3f5b('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3f5b('0x13')]=router; \ No newline at end of file +var _0x40ce=['put','/:id','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x33ac75,_0x4953e3){var _0x34d5f2=function(_0x4c2b4a){while(--_0x4c2b4a){_0x33ac75['push'](_0x33ac75['shift']());}};_0x34d5f2(++_0x4953e3);}(_0x40ce,0x79));var _0xe40c=function(_0x5c5b17,_0x3c4947){_0x5c5b17=_0x5c5b17-0x0;var _0x1c6282=_0x40ce[_0x5c5b17];return _0x1c6282;};'use strict';var multer=require(_0xe40c('0x0'));var util=require(_0xe40c('0x1'));var path=require(_0xe40c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe40c('0x3'));var auth=require(_0xe40c('0x4'));var interaction=require(_0xe40c('0x5'));var config=require(_0xe40c('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0xe40c('0x7')](),controller[_0xe40c('0x8')]);router[_0xe40c('0x9')]('/:id',auth[_0xe40c('0x7')](),controller[_0xe40c('0xa')]);router[_0xe40c('0x9')](_0xe40c('0xb'),auth[_0xe40c('0x7')](),controller[_0xe40c('0xc')]);router[_0xe40c('0x9')](_0xe40c('0xd'),auth[_0xe40c('0x7')](),controller[_0xe40c('0xe')]);router['get'](_0xe40c('0xf'),auth['isAuthenticated'](),controller[_0xe40c('0x10')]);router['post']('/',auth[_0xe40c('0x7')](),controller['create']);router[_0xe40c('0x11')](_0xe40c('0x12'),auth[_0xe40c('0x7')](),controller[_0xe40c('0x13')]);router[_0xe40c('0x14')](_0xe40c('0x12'),auth[_0xe40c('0x7')](),controller[_0xe40c('0x15')]);module[_0xe40c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 04979f2..7b43f62 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 _0x2453=['exports','STRING','sequelize'];(function(_0x28111f,_0x254934){var _0x5203e6=function(_0x2c639a){while(--_0x2c639a){_0x28111f['push'](_0x28111f['shift']());}};_0x5203e6(++_0x254934);}(_0x2453,0x98));var _0x3245=function(_0x372aa9,_0x578986){_0x372aa9=_0x372aa9-0x0;var _0x55b1c2=_0x2453[_0x372aa9];return _0x55b1c2;};'use strict';var Sequelize=require(_0x3245('0x0'));module[_0x3245('0x1')]={'name':{'type':Sequelize[_0x3245('0x2')]},'description':{'type':Sequelize[_0x3245('0x2')]}}; \ No newline at end of file +var _0xf4d2=['STRING','exports'];(function(_0x21d309,_0xb93829){var _0x2e64d2=function(_0x41b5a6){while(--_0x41b5a6){_0x21d309['push'](_0x21d309['shift']());}};_0x2e64d2(++_0xb93829);}(_0xf4d2,0x7f));var _0x2f4d=function(_0x1c5252,_0x3eef30){_0x1c5252=_0x1c5252-0x0;var _0x5d0197=_0xf4d2[_0x1c5252];return _0x5d0197;};'use strict';var Sequelize=require('sequelize');module[_0x2f4d('0x0')]={'name':{'type':Sequelize[_0x2f4d('0x1')]},'description':{'type':Sequelize[_0x2f4d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index dcfd8af..081d83e 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 _0xf123=['map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','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','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index'];(function(_0x310d40,_0x5e396e){var _0xd9a738=function(_0x4b10e0){while(--_0x4b10e0){_0x310d40['push'](_0x310d40['shift']());}};_0xd9a738(++_0x5e396e);}(_0xf123,0x1da));var _0x3f12=function(_0x311666,_0x17b07d){_0x311666=_0x311666-0x0;var _0x2bc692=_0xf123[_0x311666];return _0x2bc692;};'use strict';var emlformat=require(_0x3f12('0x0'));var rimraf=require(_0x3f12('0x1'));var zipdir=require(_0x3f12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f12('0x3'));var moment=require(_0x3f12('0x4'));var BPromise=require(_0x3f12('0x5'));var Mustache=require(_0x3f12('0x6'));var util=require(_0x3f12('0x7'));var path=require('path');var sox=require(_0x3f12('0x8'));var csv=require('to-csv');var ejs=require(_0x3f12('0x9'));var fs=require('fs');var fs_extra=require(_0x3f12('0xa'));var _=require(_0x3f12('0xb'));var squel=require(_0x3f12('0xc'));var crypto=require(_0x3f12('0xd'));var jsforce=require(_0x3f12('0xe'));var deskjs=require(_0x3f12('0xf'));var toCsv=require(_0x3f12('0x10'));var querystring=require('querystring');var Papa=require(_0x3f12('0x11'));var Redis=require(_0x3f12('0x12'));var authService=require(_0x3f12('0x13'));var qs=require(_0x3f12('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f12('0x15'));var logger=require(_0x3f12('0x16'))(_0x3f12('0x17'));var utils=require(_0x3f12('0x18'));var config=require(_0x3f12('0x19'));var licenseUtil=require(_0x3f12('0x1a'));var db=require(_0x3f12('0x1b'))['db'];function respondWithStatusCode(_0x4b122c,_0x29f3fe){_0x29f3fe=_0x29f3fe||0xcc;return function(_0x293af1){if(_0x293af1){return _0x4b122c[_0x3f12('0x1c')](_0x29f3fe);}return _0x4b122c[_0x3f12('0x1d')](_0x29f3fe)[_0x3f12('0x1e')]();};}function respondWithResult(_0x202156,_0x2508b6){_0x2508b6=_0x2508b6||0xc8;return function(_0x2821ac){if(_0x2821ac){return _0x202156['status'](_0x2508b6)[_0x3f12('0x1f')](_0x2821ac);}};}function respondWithFilteredResult(_0x6cb01d,_0x2d44d5){return function(_0x39a8db){if(_0x39a8db){var _0x32d69b=typeof _0x2d44d5[_0x3f12('0x20')]===_0x3f12('0x21')&&typeof _0x2d44d5['limit']===_0x3f12('0x21');var _0x2885fd=_0x39a8db['count'];var _0x2b5407=_0x32d69b?0x0:_0x2d44d5['offset'];var _0x2d5b64=_0x32d69b?_0x39a8db[_0x3f12('0x22')]:_0x2d44d5['offset']+_0x2d44d5[_0x3f12('0x23')];var _0x4c5dcc;if(_0x2d5b64>=_0x2885fd){_0x2d5b64=_0x2885fd;_0x4c5dcc=0xc8;}else{_0x4c5dcc=0xce;}_0x6cb01d[_0x3f12('0x1d')](_0x4c5dcc);return _0x6cb01d[_0x3f12('0x24')](_0x3f12('0x25'),_0x2b5407+'-'+_0x2d5b64+'/'+_0x2885fd)[_0x3f12('0x1f')](_0x39a8db);}return null;};}function patchUpdates(_0x471772){return function(_0x1f69db){try{jsonpatch[_0x3f12('0x26')](_0x1f69db,_0x471772,!![]);}catch(_0xfea348){return BPromise['reject'](_0xfea348);}return _0x1f69db[_0x3f12('0x27')]();};}function saveUpdates(_0x4b8d7c,_0x3b5ccb){return function(_0x5bcd34){if(_0x5bcd34){return _0x5bcd34[_0x3f12('0x28')](_0x4b8d7c)[_0x3f12('0x29')](function(_0x27820b){return _0x27820b;});}return null;};}function removeEntity(_0x2e5708,_0x1b9068){return function(_0x315d39){if(_0x315d39){return _0x315d39[_0x3f12('0x2a')]()['then'](function(){_0x2e5708['status'](0xcc)[_0x3f12('0x1e')]();});}};}function handleEntityNotFound(_0x3ca2b6,_0x2564a2){return function(_0xeec922){if(!_0xeec922){_0x3ca2b6[_0x3f12('0x1c')](0x194);}return _0xeec922;};}function handleError(_0x1cacdf,_0xd14d30){_0xd14d30=_0xd14d30||0x1f4;return function(_0x2ad7c6){logger[_0x3f12('0x2b')](_0x2ad7c6[_0x3f12('0x2c')]);if(_0x2ad7c6[_0x3f12('0x2d')]){delete _0x2ad7c6[_0x3f12('0x2d')];}_0x1cacdf[_0x3f12('0x1d')](_0xd14d30)[_0x3f12('0x2e')](_0x2ad7c6);};}exports[_0x3f12('0x2f')]=function(_0x485363,_0x2e7816){var _0x3dc7f2={},_0x4d92e0={},_0x25cac2={'count':0x0,'rows':[]};var _0xbeb5cb=_[_0x3f12('0x30')](db[_0x3f12('0x31')][_0x3f12('0x32')],function(_0x530fe2){return{'name':_0x530fe2[_0x3f12('0x33')],'type':_0x530fe2[_0x3f12('0x34')][_0x3f12('0x35')]};});_0x4d92e0[_0x3f12('0x36')]=_[_0x3f12('0x30')](_0xbeb5cb,'name');_0x4d92e0['query']=_[_0x3f12('0x37')](_0x485363[_0x3f12('0x38')]);_0x4d92e0[_0x3f12('0x39')]=_[_0x3f12('0x3a')](_0x4d92e0['model'],_0x4d92e0[_0x3f12('0x38')]);_0x3dc7f2['attributes']=_[_0x3f12('0x3a')](_0x4d92e0[_0x3f12('0x36')],qs['fields'](_0x485363[_0x3f12('0x38')][_0x3f12('0x3b')]));_0x3dc7f2[_0x3f12('0x3c')]=_0x3dc7f2['attributes'][_0x3f12('0x3d')]?_0x3dc7f2[_0x3f12('0x3c')]:_0x4d92e0[_0x3f12('0x36')];if(!_0x485363['query'][_0x3f12('0x3e')]('nolimit')){_0x3dc7f2[_0x3f12('0x23')]=qs['limit'](_0x485363['query'][_0x3f12('0x23')]);_0x3dc7f2[_0x3f12('0x20')]=qs[_0x3f12('0x20')](_0x485363[_0x3f12('0x38')]['offset']);}_0x3dc7f2[_0x3f12('0x3f')]=qs[_0x3f12('0x40')](_0x485363[_0x3f12('0x38')][_0x3f12('0x40')]);_0x3dc7f2[_0x3f12('0x41')]=qs[_0x3f12('0x39')](_[_0x3f12('0x42')](_0x485363[_0x3f12('0x38')],_0x4d92e0[_0x3f12('0x39')]),_0xbeb5cb);if(_0x485363[_0x3f12('0x38')][_0x3f12('0x43')]){_0x3dc7f2['where']=_[_0x3f12('0x44')](_0x3dc7f2[_0x3f12('0x41')],{'$or':_[_0x3f12('0x30')](_0xbeb5cb,function(_0x19bcb2){if(_0x19bcb2[_0x3f12('0x34')]!==_0x3f12('0x45')){var _0x50f515={};_0x50f515[_0x19bcb2[_0x3f12('0x2d')]]={'$like':'%'+_0x485363['query'][_0x3f12('0x43')]+'%'};return _0x50f515;}})});}_0x3dc7f2=_[_0x3f12('0x44')]({},_0x3dc7f2,_0x485363[_0x3f12('0x46')]);var _0x45718b={'where':_0x3dc7f2[_0x3f12('0x41')]};return db[_0x3f12('0x31')][_0x3f12('0x22')](_0x45718b)[_0x3f12('0x29')](function(_0x4ee2fc){_0x25cac2[_0x3f12('0x22')]=_0x4ee2fc;if(_0x485363[_0x3f12('0x38')]['includeAll']){_0x3dc7f2[_0x3f12('0x47')]=[{'all':!![]}];}return db[_0x3f12('0x31')][_0x3f12('0x48')](_0x3dc7f2);})['then'](function(_0x3e373f){_0x25cac2[_0x3f12('0x49')]=_0x3e373f;return _0x25cac2;})[_0x3f12('0x29')](respondWithFilteredResult(_0x2e7816,_0x3dc7f2))['catch'](handleError(_0x2e7816,null));};exports[_0x3f12('0x4a')]=function(_0xb5dde5,_0x39a630){var _0x208273={'raw':![],'where':{'id':_0xb5dde5[_0x3f12('0x4b')]['id']}},_0x4cd81d={};_0x4cd81d['model']=_[_0x3f12('0x37')](db['ServicenowConfiguration'][_0x3f12('0x32')]);_0x4cd81d[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0xb5dde5['query']);_0x4cd81d['filters']=_['intersection'](_0x4cd81d[_0x3f12('0x36')],_0x4cd81d[_0x3f12('0x38')]);_0x208273['attributes']=_[_0x3f12('0x3a')](_0x4cd81d['model'],qs[_0x3f12('0x3b')](_0xb5dde5[_0x3f12('0x38')][_0x3f12('0x3b')]));_0x208273[_0x3f12('0x3c')]=_0x208273[_0x3f12('0x3c')][_0x3f12('0x3d')]?_0x208273[_0x3f12('0x3c')]:_0x4cd81d['model'];if(_0xb5dde5['query'][_0x3f12('0x4c')]){_0x208273[_0x3f12('0x47')]=[{'all':!![]}];}_0x208273=_[_0x3f12('0x44')]({},_0x208273,_0xb5dde5['options']);return db[_0x3f12('0x31')]['find'](_0x208273)[_0x3f12('0x29')](handleEntityNotFound(_0x39a630,null))[_0x3f12('0x29')](respondWithResult(_0x39a630,null))[_0x3f12('0x4d')](handleError(_0x39a630,null));};exports[_0x3f12('0x4e')]=function(_0x18c82b,_0x43044e){return db[_0x3f12('0x31')][_0x3f12('0x4e')](_0x18c82b[_0x3f12('0x4f')],{})[_0x3f12('0x29')](respondWithResult(_0x43044e,0xc9))[_0x3f12('0x4d')](handleError(_0x43044e,null));};exports[_0x3f12('0x28')]=function(_0x2fcb84,_0x3d3bfe){if(_0x2fcb84[_0x3f12('0x4f')]['id']){delete _0x2fcb84['body']['id'];}return db['ServicenowConfiguration'][_0x3f12('0x50')]({'where':{'id':_0x2fcb84[_0x3f12('0x4b')]['id']}})[_0x3f12('0x29')](handleEntityNotFound(_0x3d3bfe,null))[_0x3f12('0x29')](saveUpdates(_0x2fcb84['body'],null))['then'](respondWithResult(_0x3d3bfe,null))[_0x3f12('0x4d')](handleError(_0x3d3bfe,null));};exports[_0x3f12('0x2a')]=function(_0xd2da5d,_0xca3f32){return db['ServicenowConfiguration'][_0x3f12('0x50')]({'where':{'id':_0xd2da5d[_0x3f12('0x4b')]['id']}})['then'](handleEntityNotFound(_0xca3f32,null))[_0x3f12('0x29')](removeEntity(_0xca3f32,null))['catch'](handleError(_0xca3f32,null));};exports[_0x3f12('0x51')]=function(_0x1f39df,_0x13b70b,_0x49601b){var _0x2cd915={};var _0x175243={};var _0x2e2bf9;var _0x257581;return db[_0x3f12('0x31')][_0x3f12('0x52')]({'where':{'id':_0x1f39df[_0x3f12('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13b70b,null))[_0x3f12('0x29')](function(_0x5e9a41){if(_0x5e9a41){_0x2e2bf9=_0x5e9a41;_0x175243[_0x3f12('0x36')]=_[_0x3f12('0x37')](db[_0x3f12('0x53')][_0x3f12('0x32')]);_0x175243[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x1f39df[_0x3f12('0x38')]);_0x175243[_0x3f12('0x39')]=_['intersection'](_0x175243[_0x3f12('0x36')],_0x175243[_0x3f12('0x38')]);_0x2cd915[_0x3f12('0x3c')]=_[_0x3f12('0x3a')](_0x175243[_0x3f12('0x36')],qs[_0x3f12('0x3b')](_0x1f39df[_0x3f12('0x38')][_0x3f12('0x3b')]));_0x2cd915[_0x3f12('0x3c')]=_0x2cd915[_0x3f12('0x3c')][_0x3f12('0x3d')]?_0x2cd915[_0x3f12('0x3c')]:_0x175243[_0x3f12('0x36')];_0x2cd915[_0x3f12('0x3f')]=qs[_0x3f12('0x40')](_0x1f39df[_0x3f12('0x38')][_0x3f12('0x40')]);_0x2cd915[_0x3f12('0x41')]=qs[_0x3f12('0x39')](_[_0x3f12('0x42')](_0x1f39df[_0x3f12('0x38')],_0x175243[_0x3f12('0x39')]));if(_0x1f39df[_0x3f12('0x38')][_0x3f12('0x43')]){_0x2cd915[_0x3f12('0x41')]=_['merge'](_0x2cd915[_0x3f12('0x41')],{'$or':_[_0x3f12('0x30')](_0x2cd915[_0x3f12('0x3c')],function(_0x541e63){var _0x231d0c={};_0x231d0c[_0x541e63]={'$like':'%'+_0x1f39df[_0x3f12('0x38')][_0x3f12('0x43')]+'%'};return _0x231d0c;})});}_0x2cd915=_[_0x3f12('0x44')]({},_0x2cd915,_0x1f39df[_0x3f12('0x46')]);return _0x2e2bf9['getFields'](_0x2cd915);}})[_0x3f12('0x29')](function(_0x34e625){if(_0x34e625){_0x257581=_0x34e625[_0x3f12('0x3d')];if(!_0x1f39df['query'][_0x3f12('0x3e')](_0x3f12('0x54'))){_0x2cd915['limit']=qs[_0x3f12('0x23')](_0x1f39df[_0x3f12('0x38')][_0x3f12('0x23')]);_0x2cd915[_0x3f12('0x20')]=qs[_0x3f12('0x20')](_0x1f39df[_0x3f12('0x38')][_0x3f12('0x20')]);}return _0x2e2bf9[_0x3f12('0x51')](_0x2cd915);}})[_0x3f12('0x29')](function(_0x43a69d){if(_0x43a69d){return _0x43a69d?{'count':_0x257581,'rows':_0x43a69d}:null;}})[_0x3f12('0x29')](respondWithResult(_0x13b70b,null))['catch'](handleError(_0x13b70b,null));};exports[_0x3f12('0x55')]=function(_0x491518,_0x21ac17,_0x3de91a){var _0x1129dd={};var _0x3df22a={};var _0x336c82;var _0x2fc687;return db['ServicenowConfiguration'][_0x3f12('0x52')]({'where':{'id':_0x491518[_0x3f12('0x4b')]['id']}})[_0x3f12('0x29')](handleEntityNotFound(_0x21ac17,null))[_0x3f12('0x29')](function(_0x597894){if(_0x597894){_0x336c82=_0x597894;_0x3df22a[_0x3f12('0x36')]=_[_0x3f12('0x37')](db[_0x3f12('0x53')][_0x3f12('0x32')]);_0x3df22a[_0x3f12('0x38')]=_[_0x3f12('0x37')](_0x491518['query']);_0x3df22a[_0x3f12('0x39')]=_['intersection'](_0x3df22a[_0x3f12('0x36')],_0x3df22a[_0x3f12('0x38')]);_0x1129dd[_0x3f12('0x3c')]=_['intersection'](_0x3df22a['model'],qs[_0x3f12('0x3b')](_0x491518[_0x3f12('0x38')]['fields']));_0x1129dd['attributes']=_0x1129dd[_0x3f12('0x3c')]['length']?_0x1129dd[_0x3f12('0x3c')]:_0x3df22a[_0x3f12('0x36')];_0x1129dd[_0x3f12('0x3f')]=qs[_0x3f12('0x40')](_0x491518['query'][_0x3f12('0x40')]);_0x1129dd[_0x3f12('0x41')]=qs['filters'](_[_0x3f12('0x42')](_0x491518[_0x3f12('0x38')],_0x3df22a[_0x3f12('0x39')]));if(_0x491518[_0x3f12('0x38')][_0x3f12('0x43')]){_0x1129dd[_0x3f12('0x41')]=_['merge'](_0x1129dd['where'],{'$or':_[_0x3f12('0x30')](_0x1129dd[_0x3f12('0x3c')],function(_0x5a3c5d){var _0x1f9f15={};_0x1f9f15[_0x5a3c5d]={'$like':'%'+_0x491518[_0x3f12('0x38')][_0x3f12('0x43')]+'%'};return _0x1f9f15;})});}_0x1129dd=_[_0x3f12('0x44')]({},_0x1129dd,_0x491518[_0x3f12('0x46')]);return _0x336c82[_0x3f12('0x55')](_0x1129dd);}})[_0x3f12('0x29')](function(_0x5e7c41){if(_0x5e7c41){_0x2fc687=_0x5e7c41[_0x3f12('0x3d')];if(!_0x491518[_0x3f12('0x38')]['hasOwnProperty']('nolimit')){_0x1129dd['limit']=qs[_0x3f12('0x23')](_0x491518['query']['limit']);_0x1129dd[_0x3f12('0x20')]=qs['offset'](_0x491518[_0x3f12('0x38')][_0x3f12('0x20')]);}return _0x336c82[_0x3f12('0x55')](_0x1129dd);}})[_0x3f12('0x29')](function(_0x1d137e){if(_0x1d137e){return _0x1d137e?{'count':_0x2fc687,'rows':_0x1d137e}:null;}})[_0x3f12('0x29')](respondWithResult(_0x21ac17,null))[_0x3f12('0x4d')](handleError(_0x21ac17,null));};exports[_0x3f12('0x56')]=function(_0x3d3522,_0xc7b6bf,_0x24b9d6){var _0xd86b3f={};var _0x355370={};var _0x22d8d4;var _0x55e2f0;return db[_0x3f12('0x31')][_0x3f12('0x52')]({'where':{'id':_0x3d3522[_0x3f12('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc7b6bf,null))[_0x3f12('0x29')](function(_0x220d45){if(_0x220d45){_0x22d8d4=_0x220d45;_0x355370[_0x3f12('0x36')]=_['keys'](db[_0x3f12('0x53')][_0x3f12('0x32')]);_0x355370[_0x3f12('0x38')]=_['keys'](_0x3d3522['query']);_0x355370[_0x3f12('0x39')]=_[_0x3f12('0x3a')](_0x355370[_0x3f12('0x36')],_0x355370[_0x3f12('0x38')]);_0xd86b3f[_0x3f12('0x3c')]=_[_0x3f12('0x3a')](_0x355370[_0x3f12('0x36')],qs[_0x3f12('0x3b')](_0x3d3522[_0x3f12('0x38')]['fields']));_0xd86b3f[_0x3f12('0x3c')]=_0xd86b3f[_0x3f12('0x3c')][_0x3f12('0x3d')]?_0xd86b3f[_0x3f12('0x3c')]:_0x355370[_0x3f12('0x36')];_0xd86b3f[_0x3f12('0x3f')]=qs[_0x3f12('0x40')](_0x3d3522[_0x3f12('0x38')][_0x3f12('0x40')]);_0xd86b3f['where']=qs[_0x3f12('0x39')](_[_0x3f12('0x42')](_0x3d3522[_0x3f12('0x38')],_0x355370['filters']));if(_0x3d3522[_0x3f12('0x38')][_0x3f12('0x43')]){_0xd86b3f[_0x3f12('0x41')]=_[_0x3f12('0x44')](_0xd86b3f['where'],{'$or':_[_0x3f12('0x30')](_0xd86b3f[_0x3f12('0x3c')],function(_0x4ab832){var _0x314fa7={};_0x314fa7[_0x4ab832]={'$like':'%'+_0x3d3522[_0x3f12('0x38')]['filter']+'%'};return _0x314fa7;})});}_0xd86b3f=_['merge']({},_0xd86b3f,_0x3d3522[_0x3f12('0x46')]);return _0x22d8d4[_0x3f12('0x56')](_0xd86b3f);}})[_0x3f12('0x29')](function(_0x451892){if(_0x451892){_0x55e2f0=_0x451892[_0x3f12('0x3d')];if(!_0x3d3522[_0x3f12('0x38')][_0x3f12('0x3e')](_0x3f12('0x54'))){_0xd86b3f[_0x3f12('0x23')]=qs[_0x3f12('0x23')](_0x3d3522[_0x3f12('0x38')][_0x3f12('0x23')]);_0xd86b3f[_0x3f12('0x20')]=qs[_0x3f12('0x20')](_0x3d3522[_0x3f12('0x38')][_0x3f12('0x20')]);}return _0x22d8d4['getDescriptions'](_0xd86b3f);}})[_0x3f12('0x29')](function(_0x37a02a){if(_0x37a02a){return _0x37a02a?{'count':_0x55e2f0,'rows':_0x37a02a}:null;}})[_0x3f12('0x29')](respondWithResult(_0xc7b6bf,null))[_0x3f12('0x4d')](handleError(_0xc7b6bf,null));}; \ No newline at end of file +var _0x1e73=['includeAll','rows','show','params','fields','catch','create','body','find','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x301075,_0x33b785){var _0x1a04c5=function(_0x8d5143){while(--_0x8d5143){_0x301075['push'](_0x301075['shift']());}};_0x1a04c5(++_0x33b785);}(_0x1e73,0x1e3));var _0x31e7=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0x1e73[_0x28578d];return _0x524826;};'use strict';var emlformat=require(_0x31e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x31e7('0x1'));var jsonpatch=require(_0x31e7('0x2'));var rp=require(_0x31e7('0x3'));var moment=require(_0x31e7('0x4'));var BPromise=require(_0x31e7('0x5'));var Mustache=require('mustache');var util=require(_0x31e7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x31e7('0x7'));var ejs=require(_0x31e7('0x8'));var fs=require('fs');var fs_extra=require(_0x31e7('0x9'));var _=require(_0x31e7('0xa'));var squel=require(_0x31e7('0xb'));var crypto=require(_0x31e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x31e7('0xd'));var toCsv=require(_0x31e7('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x31e7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x31e7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x31e7('0x10'))(_0x31e7('0x11'));var utils=require(_0x31e7('0x12'));var config=require(_0x31e7('0x13'));var licenseUtil=require(_0x31e7('0x14'));var db=require(_0x31e7('0x15'))['db'];function respondWithStatusCode(_0x68454a,_0x53ac1a){_0x53ac1a=_0x53ac1a||0xcc;return function(_0x180c43){if(_0x180c43){return _0x68454a[_0x31e7('0x16')](_0x53ac1a);}return _0x68454a[_0x31e7('0x17')](_0x53ac1a)[_0x31e7('0x18')]();};}function respondWithResult(_0x32744c,_0x2851d2){_0x2851d2=_0x2851d2||0xc8;return function(_0x48778b){if(_0x48778b){return _0x32744c[_0x31e7('0x17')](_0x2851d2)['json'](_0x48778b);}};}function respondWithFilteredResult(_0x4ded61,_0x195d74){return function(_0x3d4014){if(_0x3d4014){var _0x6f90d=typeof _0x195d74[_0x31e7('0x19')]===_0x31e7('0x1a')&&typeof _0x195d74['limit']===_0x31e7('0x1a');var _0xc67bb2=_0x3d4014[_0x31e7('0x1b')];var _0x4ec034=_0x6f90d?0x0:_0x195d74[_0x31e7('0x19')];var _0x31acb6=_0x6f90d?_0x3d4014['count']:_0x195d74[_0x31e7('0x19')]+_0x195d74[_0x31e7('0x1c')];var _0x501fca;if(_0x31acb6>=_0xc67bb2){_0x31acb6=_0xc67bb2;_0x501fca=0xc8;}else{_0x501fca=0xce;}_0x4ded61['status'](_0x501fca);return _0x4ded61['set'](_0x31e7('0x1d'),_0x4ec034+'-'+_0x31acb6+'/'+_0xc67bb2)[_0x31e7('0x1e')](_0x3d4014);}return null;};}function patchUpdates(_0x43db3a){return function(_0x349011){try{jsonpatch[_0x31e7('0x1f')](_0x349011,_0x43db3a,!![]);}catch(_0x217539){return BPromise[_0x31e7('0x20')](_0x217539);}return _0x349011[_0x31e7('0x21')]();};}function saveUpdates(_0x1a49ba,_0x42b4a6){return function(_0x3c7715){if(_0x3c7715){return _0x3c7715[_0x31e7('0x22')](_0x1a49ba)[_0x31e7('0x23')](function(_0x47c934){return _0x47c934;});}return null;};}function removeEntity(_0x3de8aa,_0x1d6bfe){return function(_0x26a12d){if(_0x26a12d){return _0x26a12d['destroy']()[_0x31e7('0x23')](function(){_0x3de8aa['status'](0xcc)[_0x31e7('0x18')]();});}};}function handleEntityNotFound(_0x634fa4,_0x4fc940){return function(_0x5571c6){if(!_0x5571c6){_0x634fa4[_0x31e7('0x16')](0x194);}return _0x5571c6;};}function handleError(_0x250e6e,_0x5b6cf0){_0x5b6cf0=_0x5b6cf0||0x1f4;return function(_0x52a7e0){logger['error'](_0x52a7e0[_0x31e7('0x24')]);if(_0x52a7e0[_0x31e7('0x25')]){delete _0x52a7e0[_0x31e7('0x25')];}_0x250e6e['status'](_0x5b6cf0)[_0x31e7('0x26')](_0x52a7e0);};}exports[_0x31e7('0x27')]=function(_0x480e72,_0x3c26ee){var _0x39d276={},_0x87bc48={},_0x571025={'count':0x0,'rows':[]};var _0x26f7c3=_[_0x31e7('0x28')](db[_0x31e7('0x29')][_0x31e7('0x2a')],function(_0x42cc09){return{'name':_0x42cc09[_0x31e7('0x2b')],'type':_0x42cc09[_0x31e7('0x2c')][_0x31e7('0x2d')]};});_0x87bc48[_0x31e7('0x2e')]=_['map'](_0x26f7c3,'name');_0x87bc48[_0x31e7('0x2f')]=_[_0x31e7('0x30')](_0x480e72[_0x31e7('0x2f')]);_0x87bc48[_0x31e7('0x31')]=_['intersection'](_0x87bc48['model'],_0x87bc48[_0x31e7('0x2f')]);_0x39d276[_0x31e7('0x32')]=_[_0x31e7('0x33')](_0x87bc48['model'],qs['fields'](_0x480e72[_0x31e7('0x2f')]['fields']));_0x39d276[_0x31e7('0x32')]=_0x39d276[_0x31e7('0x32')][_0x31e7('0x34')]?_0x39d276[_0x31e7('0x32')]:_0x87bc48[_0x31e7('0x2e')];if(!_0x480e72['query'][_0x31e7('0x35')](_0x31e7('0x36'))){_0x39d276[_0x31e7('0x1c')]=qs[_0x31e7('0x1c')](_0x480e72['query'][_0x31e7('0x1c')]);_0x39d276[_0x31e7('0x19')]=qs[_0x31e7('0x19')](_0x480e72['query'][_0x31e7('0x19')]);}_0x39d276[_0x31e7('0x37')]=qs['sort'](_0x480e72[_0x31e7('0x2f')][_0x31e7('0x38')]);_0x39d276[_0x31e7('0x39')]=qs[_0x31e7('0x31')](_[_0x31e7('0x3a')](_0x480e72[_0x31e7('0x2f')],_0x87bc48[_0x31e7('0x31')]),_0x26f7c3);if(_0x480e72[_0x31e7('0x2f')][_0x31e7('0x3b')]){_0x39d276[_0x31e7('0x39')]=_[_0x31e7('0x3c')](_0x39d276['where'],{'$or':_[_0x31e7('0x28')](_0x26f7c3,function(_0x3a27d9){if(_0x3a27d9[_0x31e7('0x2c')]!==_0x31e7('0x3d')){var _0x3aa0c5={};_0x3aa0c5[_0x3a27d9[_0x31e7('0x25')]]={'$like':'%'+_0x480e72['query'][_0x31e7('0x3b')]+'%'};return _0x3aa0c5;}})});}_0x39d276=_[_0x31e7('0x3c')]({},_0x39d276,_0x480e72[_0x31e7('0x3e')]);var _0x310af0={'where':_0x39d276[_0x31e7('0x39')]};return db[_0x31e7('0x29')][_0x31e7('0x1b')](_0x310af0)[_0x31e7('0x23')](function(_0x1689cf){_0x571025[_0x31e7('0x1b')]=_0x1689cf;if(_0x480e72[_0x31e7('0x2f')][_0x31e7('0x3f')]){_0x39d276['include']=[{'all':!![]}];}return db[_0x31e7('0x29')]['findAll'](_0x39d276);})[_0x31e7('0x23')](function(_0x5ec1dc){_0x571025[_0x31e7('0x40')]=_0x5ec1dc;return _0x571025;})['then'](respondWithFilteredResult(_0x3c26ee,_0x39d276))['catch'](handleError(_0x3c26ee,null));};exports[_0x31e7('0x41')]=function(_0x1fedd8,_0x498f12){var _0x345ae1={'raw':![],'where':{'id':_0x1fedd8[_0x31e7('0x42')]['id']}},_0x32986b={};_0x32986b[_0x31e7('0x2e')]=_[_0x31e7('0x30')](db[_0x31e7('0x29')][_0x31e7('0x2a')]);_0x32986b[_0x31e7('0x2f')]=_[_0x31e7('0x30')](_0x1fedd8[_0x31e7('0x2f')]);_0x32986b[_0x31e7('0x31')]=_[_0x31e7('0x33')](_0x32986b[_0x31e7('0x2e')],_0x32986b[_0x31e7('0x2f')]);_0x345ae1[_0x31e7('0x32')]=_['intersection'](_0x32986b[_0x31e7('0x2e')],qs[_0x31e7('0x43')](_0x1fedd8[_0x31e7('0x2f')][_0x31e7('0x43')]));_0x345ae1[_0x31e7('0x32')]=_0x345ae1[_0x31e7('0x32')][_0x31e7('0x34')]?_0x345ae1[_0x31e7('0x32')]:_0x32986b[_0x31e7('0x2e')];if(_0x1fedd8['query'][_0x31e7('0x3f')]){_0x345ae1['include']=[{'all':!![]}];}_0x345ae1=_[_0x31e7('0x3c')]({},_0x345ae1,_0x1fedd8['options']);return db[_0x31e7('0x29')]['find'](_0x345ae1)[_0x31e7('0x23')](handleEntityNotFound(_0x498f12,null))[_0x31e7('0x23')](respondWithResult(_0x498f12,null))[_0x31e7('0x44')](handleError(_0x498f12,null));};exports[_0x31e7('0x45')]=function(_0x41ab19,_0x35204d){return db['ServicenowConfiguration']['create'](_0x41ab19[_0x31e7('0x46')],{})['then'](respondWithResult(_0x35204d,0xc9))[_0x31e7('0x44')](handleError(_0x35204d,null));};exports['update']=function(_0x491277,_0x5d6692){if(_0x491277[_0x31e7('0x46')]['id']){delete _0x491277[_0x31e7('0x46')]['id'];}return db['ServicenowConfiguration'][_0x31e7('0x47')]({'where':{'id':_0x491277['params']['id']}})['then'](handleEntityNotFound(_0x5d6692,null))[_0x31e7('0x23')](saveUpdates(_0x491277[_0x31e7('0x46')],null))[_0x31e7('0x23')](respondWithResult(_0x5d6692,null))['catch'](handleError(_0x5d6692,null));};exports[_0x31e7('0x48')]=function(_0x2ff36a,_0x4d8c33){return db[_0x31e7('0x29')][_0x31e7('0x47')]({'where':{'id':_0x2ff36a[_0x31e7('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d8c33,null))[_0x31e7('0x23')](removeEntity(_0x4d8c33,null))[_0x31e7('0x44')](handleError(_0x4d8c33,null));};exports[_0x31e7('0x49')]=function(_0x2679b6,_0x3cacfa,_0x4f4e05){var _0x507a18={};var _0x1aa665={};var _0x4fb51c;var _0x282bc8;return db[_0x31e7('0x29')][_0x31e7('0x4a')]({'where':{'id':_0x2679b6[_0x31e7('0x42')]['id']}})[_0x31e7('0x23')](handleEntityNotFound(_0x3cacfa,null))['then'](function(_0x1a55f9){if(_0x1a55f9){_0x4fb51c=_0x1a55f9;_0x1aa665['model']=_[_0x31e7('0x30')](db[_0x31e7('0x4b')][_0x31e7('0x2a')]);_0x1aa665[_0x31e7('0x2f')]=_[_0x31e7('0x30')](_0x2679b6[_0x31e7('0x2f')]);_0x1aa665[_0x31e7('0x31')]=_[_0x31e7('0x33')](_0x1aa665[_0x31e7('0x2e')],_0x1aa665[_0x31e7('0x2f')]);_0x507a18[_0x31e7('0x32')]=_[_0x31e7('0x33')](_0x1aa665[_0x31e7('0x2e')],qs[_0x31e7('0x43')](_0x2679b6[_0x31e7('0x2f')][_0x31e7('0x43')]));_0x507a18[_0x31e7('0x32')]=_0x507a18['attributes'][_0x31e7('0x34')]?_0x507a18[_0x31e7('0x32')]:_0x1aa665[_0x31e7('0x2e')];_0x507a18[_0x31e7('0x37')]=qs[_0x31e7('0x38')](_0x2679b6[_0x31e7('0x2f')][_0x31e7('0x38')]);_0x507a18[_0x31e7('0x39')]=qs[_0x31e7('0x31')](_[_0x31e7('0x3a')](_0x2679b6['query'],_0x1aa665[_0x31e7('0x31')]));if(_0x2679b6['query'][_0x31e7('0x3b')]){_0x507a18[_0x31e7('0x39')]=_['merge'](_0x507a18[_0x31e7('0x39')],{'$or':_[_0x31e7('0x28')](_0x507a18[_0x31e7('0x32')],function(_0x3999aa){var _0x55d336={};_0x55d336[_0x3999aa]={'$like':'%'+_0x2679b6[_0x31e7('0x2f')][_0x31e7('0x3b')]+'%'};return _0x55d336;})});}_0x507a18=_[_0x31e7('0x3c')]({},_0x507a18,_0x2679b6['options']);return _0x4fb51c[_0x31e7('0x49')](_0x507a18);}})[_0x31e7('0x23')](function(_0x24b6f7){if(_0x24b6f7){_0x282bc8=_0x24b6f7[_0x31e7('0x34')];if(!_0x2679b6[_0x31e7('0x2f')][_0x31e7('0x35')]('nolimit')){_0x507a18[_0x31e7('0x1c')]=qs[_0x31e7('0x1c')](_0x2679b6[_0x31e7('0x2f')][_0x31e7('0x1c')]);_0x507a18['offset']=qs[_0x31e7('0x19')](_0x2679b6['query'][_0x31e7('0x19')]);}return _0x4fb51c[_0x31e7('0x49')](_0x507a18);}})[_0x31e7('0x23')](function(_0x2aceea){if(_0x2aceea){return _0x2aceea?{'count':_0x282bc8,'rows':_0x2aceea}:null;}})[_0x31e7('0x23')](respondWithResult(_0x3cacfa,null))[_0x31e7('0x44')](handleError(_0x3cacfa,null));};exports['getSubjects']=function(_0x339c26,_0x4ce15b,_0x2b8664){var _0x49023c={};var _0x488bce={};var _0x1fad6f;var _0x209f66;return db[_0x31e7('0x29')][_0x31e7('0x4a')]({'where':{'id':_0x339c26['params']['id']}})[_0x31e7('0x23')](handleEntityNotFound(_0x4ce15b,null))[_0x31e7('0x23')](function(_0x4bfc7e){if(_0x4bfc7e){_0x1fad6f=_0x4bfc7e;_0x488bce[_0x31e7('0x2e')]=_[_0x31e7('0x30')](db[_0x31e7('0x4b')]['rawAttributes']);_0x488bce[_0x31e7('0x2f')]=_[_0x31e7('0x30')](_0x339c26[_0x31e7('0x2f')]);_0x488bce['filters']=_[_0x31e7('0x33')](_0x488bce[_0x31e7('0x2e')],_0x488bce['query']);_0x49023c[_0x31e7('0x32')]=_['intersection'](_0x488bce[_0x31e7('0x2e')],qs[_0x31e7('0x43')](_0x339c26[_0x31e7('0x2f')][_0x31e7('0x43')]));_0x49023c[_0x31e7('0x32')]=_0x49023c[_0x31e7('0x32')][_0x31e7('0x34')]?_0x49023c[_0x31e7('0x32')]:_0x488bce['model'];_0x49023c[_0x31e7('0x37')]=qs[_0x31e7('0x38')](_0x339c26[_0x31e7('0x2f')][_0x31e7('0x38')]);_0x49023c['where']=qs[_0x31e7('0x31')](_[_0x31e7('0x3a')](_0x339c26[_0x31e7('0x2f')],_0x488bce[_0x31e7('0x31')]));if(_0x339c26[_0x31e7('0x2f')][_0x31e7('0x3b')]){_0x49023c[_0x31e7('0x39')]=_[_0x31e7('0x3c')](_0x49023c[_0x31e7('0x39')],{'$or':_[_0x31e7('0x28')](_0x49023c[_0x31e7('0x32')],function(_0x434008){var _0x557699={};_0x557699[_0x434008]={'$like':'%'+_0x339c26['query'][_0x31e7('0x3b')]+'%'};return _0x557699;})});}_0x49023c=_['merge']({},_0x49023c,_0x339c26['options']);return _0x1fad6f[_0x31e7('0x4c')](_0x49023c);}})[_0x31e7('0x23')](function(_0x411f34){if(_0x411f34){_0x209f66=_0x411f34[_0x31e7('0x34')];if(!_0x339c26[_0x31e7('0x2f')][_0x31e7('0x35')]('nolimit')){_0x49023c['limit']=qs[_0x31e7('0x1c')](_0x339c26['query'][_0x31e7('0x1c')]);_0x49023c[_0x31e7('0x19')]=qs[_0x31e7('0x19')](_0x339c26[_0x31e7('0x2f')]['offset']);}return _0x1fad6f[_0x31e7('0x4c')](_0x49023c);}})[_0x31e7('0x23')](function(_0x1b9a1f){if(_0x1b9a1f){return _0x1b9a1f?{'count':_0x209f66,'rows':_0x1b9a1f}:null;}})[_0x31e7('0x23')](respondWithResult(_0x4ce15b,null))[_0x31e7('0x44')](handleError(_0x4ce15b,null));};exports[_0x31e7('0x4d')]=function(_0x432bba,_0x23a843,_0x19df4d){var _0x35b533={};var _0xe339d3={};var _0x3401e5;var _0x1fe1f5;return db[_0x31e7('0x29')][_0x31e7('0x4a')]({'where':{'id':_0x432bba[_0x31e7('0x42')]['id']}})[_0x31e7('0x23')](handleEntityNotFound(_0x23a843,null))[_0x31e7('0x23')](function(_0x76aba9){if(_0x76aba9){_0x3401e5=_0x76aba9;_0xe339d3[_0x31e7('0x2e')]=_[_0x31e7('0x30')](db['ServicenowField'][_0x31e7('0x2a')]);_0xe339d3[_0x31e7('0x2f')]=_[_0x31e7('0x30')](_0x432bba[_0x31e7('0x2f')]);_0xe339d3['filters']=_[_0x31e7('0x33')](_0xe339d3[_0x31e7('0x2e')],_0xe339d3[_0x31e7('0x2f')]);_0x35b533[_0x31e7('0x32')]=_['intersection'](_0xe339d3[_0x31e7('0x2e')],qs['fields'](_0x432bba[_0x31e7('0x2f')]['fields']));_0x35b533[_0x31e7('0x32')]=_0x35b533[_0x31e7('0x32')][_0x31e7('0x34')]?_0x35b533[_0x31e7('0x32')]:_0xe339d3[_0x31e7('0x2e')];_0x35b533['order']=qs[_0x31e7('0x38')](_0x432bba[_0x31e7('0x2f')][_0x31e7('0x38')]);_0x35b533[_0x31e7('0x39')]=qs[_0x31e7('0x31')](_['pick'](_0x432bba[_0x31e7('0x2f')],_0xe339d3[_0x31e7('0x31')]));if(_0x432bba['query'][_0x31e7('0x3b')]){_0x35b533[_0x31e7('0x39')]=_[_0x31e7('0x3c')](_0x35b533['where'],{'$or':_[_0x31e7('0x28')](_0x35b533[_0x31e7('0x32')],function(_0x2b83d5){var _0x318724={};_0x318724[_0x2b83d5]={'$like':'%'+_0x432bba['query'][_0x31e7('0x3b')]+'%'};return _0x318724;})});}_0x35b533=_['merge']({},_0x35b533,_0x432bba[_0x31e7('0x3e')]);return _0x3401e5[_0x31e7('0x4d')](_0x35b533);}})[_0x31e7('0x23')](function(_0x4c4842){if(_0x4c4842){_0x1fe1f5=_0x4c4842[_0x31e7('0x34')];if(!_0x432bba[_0x31e7('0x2f')]['hasOwnProperty'](_0x31e7('0x36'))){_0x35b533['limit']=qs[_0x31e7('0x1c')](_0x432bba[_0x31e7('0x2f')]['limit']);_0x35b533[_0x31e7('0x19')]=qs[_0x31e7('0x19')](_0x432bba[_0x31e7('0x2f')][_0x31e7('0x19')]);}return _0x3401e5['getDescriptions'](_0x35b533);}})['then'](function(_0x237045){if(_0x237045){return _0x237045?{'count':_0x1fe1f5,'rows':_0x237045}:null;}})['then'](respondWithResult(_0x23a843,null))[_0x31e7('0x44')](handleError(_0x23a843,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 955060c..e49aa35 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 _0xe77c=['ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0xf88449,_0x58f4a6){var _0x22ee67=function(_0x98ee4c){while(--_0x98ee4c){_0xf88449['push'](_0xf88449['shift']());}};_0x22ee67(++_0x58f4a6);}(_0xe77c,0x176));var _0xce77=function(_0x13e04d,_0x40a506){_0x13e04d=_0x13e04d-0x0;var _0x2b0a95=_0xe77c[_0x13e04d];return _0x2b0a95;};'use strict';var _=require(_0xce77('0x0'));var util=require(_0xce77('0x1'));var logger=require(_0xce77('0x2'))('api');var moment=require(_0xce77('0x3'));var BPromise=require(_0xce77('0x4'));var rp=require(_0xce77('0x5'));var fs=require('fs');var path=require(_0xce77('0x6'));var rimraf=require(_0xce77('0x7'));var config=require(_0xce77('0x8'));var attributes=require(_0xce77('0x9'));module['exports']=function(_0x5aea39,_0xed47c5){return _0x5aea39['define'](_0xce77('0xa'),attributes,{'tableName':_0xce77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07a2=['../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x163289,_0x19a543){var _0x1ae854=function(_0x568a3a){while(--_0x568a3a){_0x163289['push'](_0x163289['shift']());}};_0x1ae854(++_0x19a543);}(_0x07a2,0x12c));var _0x207a=function(_0x7261e6,_0x3e3bf7){_0x7261e6=_0x7261e6-0x0;var _0x20d5ed=_0x07a2[_0x7261e6];return _0x20d5ed;};'use strict';var _=require(_0x207a('0x0'));var util=require(_0x207a('0x1'));var logger=require('../../config/logger')(_0x207a('0x2'));var moment=require(_0x207a('0x3'));var BPromise=require(_0x207a('0x4'));var rp=require(_0x207a('0x5'));var fs=require('fs');var path=require(_0x207a('0x6'));var rimraf=require(_0x207a('0x7'));var config=require(_0x207a('0x8'));var attributes=require(_0x207a('0x9'));module[_0x207a('0xa')]=function(_0x47dbbf,_0x5b1fa9){return _0x47dbbf[_0x207a('0xb')](_0x207a('0xc'),attributes,{'tableName':_0x207a('0xd'),'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 955dc27..cf7b2ec 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 _0xedc2=['request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0xb48248,_0x3f6bbc){var _0x316cab=function(_0xdaec9a){while(--_0xdaec9a){_0xb48248['push'](_0xb48248['shift']());}};_0x316cab(++_0x3f6bbc);}(_0xedc2,0x1db));var _0x2edc=function(_0x5c11c0,_0x51c62e){_0x5c11c0=_0x5c11c0-0x0;var _0x175abf=_0xedc2[_0x5c11c0];return _0x175abf;};'use strict';var _=require('lodash');var util=require(_0x2edc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2edc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2edc('0x2'))['db'];var utils=require(_0x2edc('0x3'));var logger=require('../../config/logger')(_0x2edc('0x4'));var config=require(_0x2edc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2edc('0x6')][_0x2edc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d27a0,_0x668f8b,_0x39c7f8){return new BPromise(function(_0x247f5b,_0x45435f){return client[_0x2edc('0x8')](_0x1d27a0,_0x39c7f8)[_0x2edc('0x9')](function(_0x376c83){logger[_0x2edc('0xa')](_0x2edc('0xb'),_0x668f8b,'request\x20sent');logger[_0x2edc('0xc')](_0x2edc('0xd'),_0x668f8b,_0x2edc('0xe'),JSON[_0x2edc('0xf')](_0x376c83));if(_0x376c83[_0x2edc('0x10')]){if(_0x376c83[_0x2edc('0x10')][_0x2edc('0x11')]===0x1f4){logger[_0x2edc('0x10')](_0x2edc('0xb'),_0x668f8b,_0x376c83[_0x2edc('0x10')][_0x2edc('0x12')]);return _0x45435f(_0x376c83[_0x2edc('0x10')][_0x2edc('0x12')]);}logger[_0x2edc('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x668f8b,_0x376c83[_0x2edc('0x10')][_0x2edc('0x12')]);return _0x247f5b(_0x376c83[_0x2edc('0x10')]['message']);}else{logger[_0x2edc('0xa')](_0x2edc('0xb'),_0x668f8b,_0x2edc('0xe'));_0x247f5b(_0x376c83[_0x2edc('0x13')][_0x2edc('0x12')]);}})[_0x2edc('0x14')](function(_0x55b7c3){logger[_0x2edc('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x668f8b,_0x55b7c3);_0x45435f(_0x55b7c3);});});} \ No newline at end of file +var _0x836f=['request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x836f,0x165));var _0xf836=function(_0x1a1797,_0x2bb0ca){_0x1a1797=_0x1a1797-0x0;var _0x11a0e5=_0x836f[_0x1a1797];return _0x11a0e5;};'use strict';var _=require(_0xf836('0x0'));var util=require('util');var moment=require(_0xf836('0x1'));var BPromise=require(_0xf836('0x2'));var rs=require(_0xf836('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf836('0x4'))['db'];var utils=require(_0xf836('0x5'));var logger=require(_0xf836('0x6'))(_0xf836('0x7'));var config=require(_0xf836('0x8'));var jayson=require(_0xf836('0x9'));var client=jayson[_0xf836('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x91b441,_0x37c563,_0x2e4cb9){return new BPromise(function(_0x4a0c6c,_0x38747e){return client[_0xf836('0xb')](_0x91b441,_0x2e4cb9)[_0xf836('0xc')](function(_0x36c0d0){logger[_0xf836('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x37c563,_0xf836('0xe'));logger[_0xf836('0xf')](_0xf836('0x10'),_0x37c563,_0xf836('0xe'),JSON[_0xf836('0x11')](_0x36c0d0));if(_0x36c0d0['error']){if(_0x36c0d0[_0xf836('0x12')]['code']===0x1f4){logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);return _0x38747e(_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);}logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x36c0d0[_0xf836('0x12')][_0xf836('0x14')]);return _0x4a0c6c(_0x36c0d0['error'][_0xf836('0x14')]);}else{logger[_0xf836('0xd')](_0xf836('0x13'),_0x37c563,_0xf836('0xe'));_0x4a0c6c(_0x36c0d0[_0xf836('0x15')][_0xf836('0x14')]);}})[_0xf836('0x16')](function(_0x35b04e){logger[_0xf836('0x12')](_0xf836('0x13'),_0x37c563,_0x35b04e);_0x38747e(_0x35b04e);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 5cc1f9b..1bdeabf 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 _0x661f=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x661f,0x85));var _0xf661=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x661f[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0xf661('0x0'));var util=require(_0xf661('0x1'));var path=require(_0xf661('0x2'));var timeout=require(_0xf661('0x3'));var express=require(_0xf661('0x4'));var router=express[_0xf661('0x5')]();var fs_extra=require(_0xf661('0x6'));var auth=require(_0xf661('0x7'));var interaction=require(_0xf661('0x8'));var config=require(_0xf661('0x9'));var controller=require('./intServicenowField.controller');router[_0xf661('0xa')]('/',auth['isAuthenticated'](),controller[_0xf661('0xb')]);router[_0xf661('0xa')](_0xf661('0xc'),auth[_0xf661('0xd')](),controller[_0xf661('0xe')]);router['post']('/',auth[_0xf661('0xd')](),controller[_0xf661('0xf')]);router[_0xf661('0x10')]('/:id',auth[_0xf661('0xd')](),controller[_0xf661('0x11')]);router[_0xf661('0x12')](_0xf661('0xc'),auth[_0xf661('0xd')](),controller[_0xf661('0x13')]);module[_0xf661('0x14')]=router; \ No newline at end of file +var _0xf9ab=['create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','show','post'];(function(_0x2a878c,_0x281ada){var _0x34a423=function(_0x4ebcf7){while(--_0x4ebcf7){_0x2a878c['push'](_0x2a878c['shift']());}};_0x34a423(++_0x281ada);}(_0xf9ab,0x1a9));var _0xbf9a=function(_0x50475e,_0x3657ab){_0x50475e=_0x50475e-0x0;var _0x3dc306=_0xf9ab[_0x50475e];return _0x3dc306;};'use strict';var multer=require('multer');var util=require(_0xbf9a('0x0'));var path=require(_0xbf9a('0x1'));var timeout=require(_0xbf9a('0x2'));var express=require(_0xbf9a('0x3'));var router=express[_0xbf9a('0x4')]();var fs_extra=require(_0xbf9a('0x5'));var auth=require(_0xbf9a('0x6'));var interaction=require(_0xbf9a('0x7'));var config=require(_0xbf9a('0x8'));var controller=require(_0xbf9a('0x9'));router[_0xbf9a('0xa')]('/',auth[_0xbf9a('0xb')](),controller[_0xbf9a('0xc')]);router[_0xbf9a('0xa')]('/:id',auth[_0xbf9a('0xb')](),controller[_0xbf9a('0xd')]);router[_0xbf9a('0xe')]('/',auth[_0xbf9a('0xb')](),controller[_0xbf9a('0xf')]);router[_0xbf9a('0x10')](_0xbf9a('0x11'),auth['isAuthenticated'](),controller[_0xbf9a('0x12')]);router[_0xbf9a('0x13')](_0xbf9a('0x11'),auth[_0xbf9a('0xb')](),controller[_0xbf9a('0x14')]);module[_0xbf9a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index a5610f6..75c999e 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 _0x335b=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0xeba5f6,_0x1cb0ab){var _0x5c5402=function(_0x1a405b){while(--_0x1a405b){_0xeba5f6['push'](_0xeba5f6['shift']());}};_0x5c5402(++_0x1cb0ab);}(_0x335b,0x136));var _0xb335=function(_0x3c6047,_0x1f4d1e){_0x3c6047=_0x3c6047-0x0;var _0x1957e2=_0x335b[_0x3c6047];return _0x1957e2;};'use strict';var Sequelize=require(_0xb335('0x0'));module[_0xb335('0x1')]={'type':{'type':Sequelize[_0xb335('0x2')](_0xb335('0x3'),_0xb335('0x4'),_0xb335('0x5'),'keyValue',_0xb335('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb335('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb335('0x3'),_0xb335('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xb335('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb335('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb335('0x7')]}}; \ No newline at end of file +var _0x62d3=['string','variable','keyValue','picklist','STRING','customVariable','sequelize','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62d3,0x1be));var _0x362d=function(_0x3bc966,_0x2cc8c0){_0x3bc966=_0x3bc966-0x0;var _0x10d0dd=_0x62d3[_0x3bc966];return _0x10d0dd;};'use strict';var Sequelize=require(_0x362d('0x0'));module['exports']={'type':{'type':Sequelize[_0x362d('0x1')](_0x362d('0x2'),_0x362d('0x3'),'customVariable',_0x362d('0x4'),_0x362d('0x5')),'defaultValue':_0x362d('0x2')},'content':{'type':Sequelize[_0x362d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x362d('0x1')]('string',_0x362d('0x3'),_0x362d('0x7'))},'keyContent':{'type':Sequelize[_0x362d('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x362d('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index b47ca97..37e85da 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 _0xc8bd=['destroy','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0xc8bd,0x72));var _0xdc8b=function(_0x5e6c33,_0x4f157a){_0x5e6c33=_0x5e6c33-0x0;var _0x142bc9=_0xc8bd[_0x5e6c33];return _0x142bc9;};'use strict';var emlformat=require(_0xdc8b('0x0'));var rimraf=require(_0xdc8b('0x1'));var zipdir=require(_0xdc8b('0x2'));var jsonpatch=require(_0xdc8b('0x3'));var rp=require(_0xdc8b('0x4'));var moment=require(_0xdc8b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc8b('0x6'));var util=require(_0xdc8b('0x7'));var path=require(_0xdc8b('0x8'));var sox=require('sox');var csv=require(_0xdc8b('0x9'));var ejs=require(_0xdc8b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc8b('0xb'));var squel=require(_0xdc8b('0xc'));var crypto=require(_0xdc8b('0xd'));var jsforce=require(_0xdc8b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdc8b('0x9'));var querystring=require(_0xdc8b('0xf'));var Papa=require(_0xdc8b('0x10'));var Redis=require(_0xdc8b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc8b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc8b('0x13'))(_0xdc8b('0x14'));var utils=require('../../config/utils');var config=require(_0xdc8b('0x15'));var licenseUtil=require(_0xdc8b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d4306,_0x4000aa){_0x4000aa=_0x4000aa||0xcc;return function(_0x1e9427){if(_0x1e9427){return _0x3d4306[_0xdc8b('0x17')](_0x4000aa);}return _0x3d4306['status'](_0x4000aa)['end']();};}function respondWithResult(_0x564d50,_0x546a2d){_0x546a2d=_0x546a2d||0xc8;return function(_0x38e28f){if(_0x38e28f){return _0x564d50[_0xdc8b('0x18')](_0x546a2d)[_0xdc8b('0x19')](_0x38e28f);}};}function respondWithFilteredResult(_0x3aeb16,_0x36d12c){return function(_0x54b6c5){if(_0x54b6c5){var _0x549f83=typeof _0x36d12c[_0xdc8b('0x1a')]===_0xdc8b('0x1b')&&typeof _0x36d12c[_0xdc8b('0x1c')]==='undefined';var _0x5f8331=_0x54b6c5[_0xdc8b('0x1d')];var _0x1d7453=_0x549f83?0x0:_0x36d12c[_0xdc8b('0x1a')];var _0x4dbaac=_0x549f83?_0x54b6c5[_0xdc8b('0x1d')]:_0x36d12c[_0xdc8b('0x1a')]+_0x36d12c[_0xdc8b('0x1c')];var _0x29cdd7;if(_0x4dbaac>=_0x5f8331){_0x4dbaac=_0x5f8331;_0x29cdd7=0xc8;}else{_0x29cdd7=0xce;}_0x3aeb16[_0xdc8b('0x18')](_0x29cdd7);return _0x3aeb16[_0xdc8b('0x1e')](_0xdc8b('0x1f'),_0x1d7453+'-'+_0x4dbaac+'/'+_0x5f8331)[_0xdc8b('0x19')](_0x54b6c5);}return null;};}function patchUpdates(_0x1d73bd){return function(_0x131353){try{jsonpatch[_0xdc8b('0x20')](_0x131353,_0x1d73bd,!![]);}catch(_0x287ef2){return BPromise['reject'](_0x287ef2);}return _0x131353[_0xdc8b('0x21')]();};}function saveUpdates(_0x26509b,_0x3efd82){return function(_0x369333){if(_0x369333){return _0x369333['update'](_0x26509b)['then'](function(_0x6291dc){return _0x6291dc;});}return null;};}function removeEntity(_0x39802f,_0x371d81){return function(_0x33daff){if(_0x33daff){return _0x33daff[_0xdc8b('0x22')]()['then'](function(){_0x39802f[_0xdc8b('0x18')](0xcc)[_0xdc8b('0x23')]();});}};}function handleEntityNotFound(_0x2151e5,_0x4d4e05){return function(_0x48d3c9){if(!_0x48d3c9){_0x2151e5[_0xdc8b('0x17')](0x194);}return _0x48d3c9;};}function handleError(_0x48680a,_0x55c9aa){_0x55c9aa=_0x55c9aa||0x1f4;return function(_0x3e2819){logger[_0xdc8b('0x24')](_0x3e2819[_0xdc8b('0x25')]);if(_0x3e2819[_0xdc8b('0x26')]){delete _0x3e2819[_0xdc8b('0x26')];}_0x48680a[_0xdc8b('0x18')](_0x55c9aa)[_0xdc8b('0x27')](_0x3e2819);};}exports[_0xdc8b('0x28')]=function(_0x87336d,_0x34707e){var _0x1ea6ee={},_0x49ce7e={},_0x2112aa={'count':0x0,'rows':[]};var _0x717a46=_[_0xdc8b('0x29')](db[_0xdc8b('0x2a')][_0xdc8b('0x2b')],function(_0x47ca92){return{'name':_0x47ca92[_0xdc8b('0x2c')],'type':_0x47ca92[_0xdc8b('0x2d')][_0xdc8b('0x2e')]};});_0x49ce7e[_0xdc8b('0x2f')]=_[_0xdc8b('0x29')](_0x717a46,_0xdc8b('0x26'));_0x49ce7e['query']=_[_0xdc8b('0x30')](_0x87336d[_0xdc8b('0x31')]);_0x49ce7e[_0xdc8b('0x32')]=_['intersection'](_0x49ce7e[_0xdc8b('0x2f')],_0x49ce7e[_0xdc8b('0x31')]);_0x1ea6ee[_0xdc8b('0x33')]=_[_0xdc8b('0x34')](_0x49ce7e[_0xdc8b('0x2f')],qs[_0xdc8b('0x35')](_0x87336d[_0xdc8b('0x31')][_0xdc8b('0x35')]));_0x1ea6ee['attributes']=_0x1ea6ee['attributes'][_0xdc8b('0x36')]?_0x1ea6ee[_0xdc8b('0x33')]:_0x49ce7e[_0xdc8b('0x2f')];if(!_0x87336d[_0xdc8b('0x31')][_0xdc8b('0x37')]('nolimit')){_0x1ea6ee[_0xdc8b('0x1c')]=qs[_0xdc8b('0x1c')](_0x87336d['query'][_0xdc8b('0x1c')]);_0x1ea6ee[_0xdc8b('0x1a')]=qs[_0xdc8b('0x1a')](_0x87336d[_0xdc8b('0x31')][_0xdc8b('0x1a')]);}_0x1ea6ee['order']=qs['sort'](_0x87336d['query'][_0xdc8b('0x38')]);_0x1ea6ee[_0xdc8b('0x39')]=qs[_0xdc8b('0x32')](_[_0xdc8b('0x3a')](_0x87336d[_0xdc8b('0x31')],_0x49ce7e[_0xdc8b('0x32')]),_0x717a46);if(_0x87336d['query'][_0xdc8b('0x3b')]){_0x1ea6ee[_0xdc8b('0x39')]=_[_0xdc8b('0x3c')](_0x1ea6ee['where'],{'$or':_[_0xdc8b('0x29')](_0x717a46,function(_0x55d144){if(_0x55d144[_0xdc8b('0x2d')]!==_0xdc8b('0x3d')){var _0x4d476b={};_0x4d476b[_0x55d144[_0xdc8b('0x26')]]={'$like':'%'+_0x87336d[_0xdc8b('0x31')][_0xdc8b('0x3b')]+'%'};return _0x4d476b;}})});}_0x1ea6ee=_[_0xdc8b('0x3c')]({},_0x1ea6ee,_0x87336d[_0xdc8b('0x3e')]);var _0x69bfc9={'where':_0x1ea6ee[_0xdc8b('0x39')]};return db[_0xdc8b('0x2a')][_0xdc8b('0x1d')](_0x69bfc9)[_0xdc8b('0x3f')](function(_0x4fd03f){_0x2112aa['count']=_0x4fd03f;if(_0x87336d[_0xdc8b('0x31')][_0xdc8b('0x40')]){_0x1ea6ee[_0xdc8b('0x41')]=[{'all':!![]}];}return db['ServicenowField'][_0xdc8b('0x42')](_0x1ea6ee);})[_0xdc8b('0x3f')](function(_0x4b0437){_0x2112aa[_0xdc8b('0x43')]=_0x4b0437;return _0x2112aa;})[_0xdc8b('0x3f')](respondWithFilteredResult(_0x34707e,_0x1ea6ee))[_0xdc8b('0x44')](handleError(_0x34707e,null));};exports['show']=function(_0x79ec3b,_0x106e02){var _0x36fb82={'raw':!![],'where':{'id':_0x79ec3b[_0xdc8b('0x45')]['id']}},_0x553bbd={};_0x553bbd[_0xdc8b('0x2f')]=_[_0xdc8b('0x30')](db['ServicenowField'][_0xdc8b('0x2b')]);_0x553bbd[_0xdc8b('0x31')]=_[_0xdc8b('0x30')](_0x79ec3b[_0xdc8b('0x31')]);_0x553bbd[_0xdc8b('0x32')]=_[_0xdc8b('0x34')](_0x553bbd[_0xdc8b('0x2f')],_0x553bbd[_0xdc8b('0x31')]);_0x36fb82['attributes']=_['intersection'](_0x553bbd[_0xdc8b('0x2f')],qs[_0xdc8b('0x35')](_0x79ec3b[_0xdc8b('0x31')][_0xdc8b('0x35')]));_0x36fb82['attributes']=_0x36fb82[_0xdc8b('0x33')][_0xdc8b('0x36')]?_0x36fb82['attributes']:_0x553bbd[_0xdc8b('0x2f')];if(_0x79ec3b[_0xdc8b('0x31')][_0xdc8b('0x40')]){_0x36fb82[_0xdc8b('0x41')]=[{'all':!![]}];}_0x36fb82=_[_0xdc8b('0x3c')]({},_0x36fb82,_0x79ec3b['options']);return db[_0xdc8b('0x2a')][_0xdc8b('0x46')](_0x36fb82)[_0xdc8b('0x3f')](handleEntityNotFound(_0x106e02,null))[_0xdc8b('0x3f')](respondWithResult(_0x106e02,null))[_0xdc8b('0x44')](handleError(_0x106e02,null));};exports[_0xdc8b('0x47')]=function(_0x341276,_0x45ed1f){return db[_0xdc8b('0x2a')][_0xdc8b('0x47')](_0x341276[_0xdc8b('0x48')],{})[_0xdc8b('0x3f')](respondWithResult(_0x45ed1f,0xc9))[_0xdc8b('0x44')](handleError(_0x45ed1f,null));};exports[_0xdc8b('0x49')]=function(_0x512c26,_0x1694ea){if(_0x512c26[_0xdc8b('0x48')]['id']){delete _0x512c26[_0xdc8b('0x48')]['id'];}return db[_0xdc8b('0x2a')][_0xdc8b('0x46')]({'where':{'id':_0x512c26[_0xdc8b('0x45')]['id']}})['then'](handleEntityNotFound(_0x1694ea,null))[_0xdc8b('0x3f')](saveUpdates(_0x512c26[_0xdc8b('0x48')],null))['then'](respondWithResult(_0x1694ea,null))[_0xdc8b('0x44')](handleError(_0x1694ea,null));};exports['destroy']=function(_0xa2a9c6,_0x385dab){return db[_0xdc8b('0x2a')]['find']({'where':{'id':_0xa2a9c6[_0xdc8b('0x45')]['id']}})[_0xdc8b('0x3f')](handleEntityNotFound(_0x385dab,null))['then'](removeEntity(_0x385dab,null))[_0xdc8b('0x44')](handleError(_0x385dab,null));}; \ No newline at end of file +var _0x8f81=['update','params','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','json','offset','limit','undefined','count','status','set','apply','save','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','ServicenowField','include','findAll','rows','show','includeAll','find','create','body','catch'];(function(_0x5ef7b8,_0x15cc07){var _0x2c7148=function(_0x398519){while(--_0x398519){_0x5ef7b8['push'](_0x5ef7b8['shift']());}};_0x2c7148(++_0x15cc07);}(_0x8f81,0x1e5));var _0x18f8=function(_0x7b958e,_0x52849d){_0x7b958e=_0x7b958e-0x0;var _0xf84814=_0x8f81[_0x7b958e];return _0xf84814;};'use strict';var emlformat=require(_0x18f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18f8('0x1'));var jsonpatch=require(_0x18f8('0x2'));var rp=require('request-promise');var moment=require(_0x18f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x18f8('0x4'));var util=require(_0x18f8('0x5'));var path=require('path');var sox=require(_0x18f8('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18f8('0x7'));var _=require(_0x18f8('0x8'));var squel=require(_0x18f8('0x9'));var crypto=require(_0x18f8('0xa'));var jsforce=require(_0x18f8('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x18f8('0xc'));var Papa=require(_0x18f8('0xd'));var Redis=require('ioredis');var authService=require(_0x18f8('0xe'));var qs=require(_0x18f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x18f8('0x10'))('api');var utils=require(_0x18f8('0x11'));var config=require(_0x18f8('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26dabe,_0x58c3cb){_0x58c3cb=_0x58c3cb||0xcc;return function(_0x1f361e){if(_0x1f361e){return _0x26dabe['sendStatus'](_0x58c3cb);}return _0x26dabe['status'](_0x58c3cb)['end']();};}function respondWithResult(_0x196233,_0xb083f9){_0xb083f9=_0xb083f9||0xc8;return function(_0x2d05fd){if(_0x2d05fd){return _0x196233['status'](_0xb083f9)[_0x18f8('0x13')](_0x2d05fd);}};}function respondWithFilteredResult(_0x52f1fe,_0x327fcb){return function(_0x5cda2a){if(_0x5cda2a){var _0x3659ef=typeof _0x327fcb[_0x18f8('0x14')]==='undefined'&&typeof _0x327fcb[_0x18f8('0x15')]===_0x18f8('0x16');var _0x484d30=_0x5cda2a['count'];var _0x92dae6=_0x3659ef?0x0:_0x327fcb[_0x18f8('0x14')];var _0x2f6b43=_0x3659ef?_0x5cda2a[_0x18f8('0x17')]:_0x327fcb[_0x18f8('0x14')]+_0x327fcb[_0x18f8('0x15')];var _0x420510;if(_0x2f6b43>=_0x484d30){_0x2f6b43=_0x484d30;_0x420510=0xc8;}else{_0x420510=0xce;}_0x52f1fe[_0x18f8('0x18')](_0x420510);return _0x52f1fe[_0x18f8('0x19')]('Content-Range',_0x92dae6+'-'+_0x2f6b43+'/'+_0x484d30)[_0x18f8('0x13')](_0x5cda2a);}return null;};}function patchUpdates(_0x34fa5b){return function(_0x3b883b){try{jsonpatch[_0x18f8('0x1a')](_0x3b883b,_0x34fa5b,!![]);}catch(_0x599ab3){return BPromise['reject'](_0x599ab3);}return _0x3b883b[_0x18f8('0x1b')]();};}function saveUpdates(_0x51d4f2,_0x109284){return function(_0x25c406){if(_0x25c406){return _0x25c406['update'](_0x51d4f2)[_0x18f8('0x1c')](function(_0x48e0a5){return _0x48e0a5;});}return null;};}function removeEntity(_0x29e1df,_0x23fa57){return function(_0x7a5919){if(_0x7a5919){return _0x7a5919[_0x18f8('0x1d')]()[_0x18f8('0x1c')](function(){_0x29e1df[_0x18f8('0x18')](0xcc)[_0x18f8('0x1e')]();});}};}function handleEntityNotFound(_0x5b69d2,_0x3bf1fe){return function(_0x5bf392){if(!_0x5bf392){_0x5b69d2['sendStatus'](0x194);}return _0x5bf392;};}function handleError(_0x572336,_0x366dab){_0x366dab=_0x366dab||0x1f4;return function(_0xb9982d){logger[_0x18f8('0x1f')](_0xb9982d[_0x18f8('0x20')]);if(_0xb9982d[_0x18f8('0x21')]){delete _0xb9982d[_0x18f8('0x21')];}_0x572336[_0x18f8('0x18')](_0x366dab)[_0x18f8('0x22')](_0xb9982d);};}exports['index']=function(_0x16ae08,_0x2fd0dc){var _0x1aa02a={},_0x319909={},_0x2ade9e={'count':0x0,'rows':[]};var _0x324ad5=_[_0x18f8('0x23')](db['ServicenowField'][_0x18f8('0x24')],function(_0x4b49e4){return{'name':_0x4b49e4[_0x18f8('0x25')],'type':_0x4b49e4['type'][_0x18f8('0x26')]};});_0x319909['model']=_[_0x18f8('0x23')](_0x324ad5,_0x18f8('0x21'));_0x319909[_0x18f8('0x27')]=_[_0x18f8('0x28')](_0x16ae08['query']);_0x319909[_0x18f8('0x29')]=_[_0x18f8('0x2a')](_0x319909[_0x18f8('0x2b')],_0x319909[_0x18f8('0x27')]);_0x1aa02a[_0x18f8('0x2c')]=_['intersection'](_0x319909['model'],qs[_0x18f8('0x2d')](_0x16ae08['query']['fields']));_0x1aa02a[_0x18f8('0x2c')]=_0x1aa02a[_0x18f8('0x2c')][_0x18f8('0x2e')]?_0x1aa02a[_0x18f8('0x2c')]:_0x319909[_0x18f8('0x2b')];if(!_0x16ae08['query'][_0x18f8('0x2f')](_0x18f8('0x30'))){_0x1aa02a[_0x18f8('0x15')]=qs[_0x18f8('0x15')](_0x16ae08[_0x18f8('0x27')][_0x18f8('0x15')]);_0x1aa02a['offset']=qs['offset'](_0x16ae08[_0x18f8('0x27')][_0x18f8('0x14')]);}_0x1aa02a[_0x18f8('0x31')]=qs[_0x18f8('0x32')](_0x16ae08[_0x18f8('0x27')][_0x18f8('0x32')]);_0x1aa02a[_0x18f8('0x33')]=qs[_0x18f8('0x29')](_[_0x18f8('0x34')](_0x16ae08['query'],_0x319909[_0x18f8('0x29')]),_0x324ad5);if(_0x16ae08[_0x18f8('0x27')]['filter']){_0x1aa02a[_0x18f8('0x33')]=_[_0x18f8('0x35')](_0x1aa02a['where'],{'$or':_['map'](_0x324ad5,function(_0x32b131){if(_0x32b131['type']!==_0x18f8('0x36')){var _0x36249a={};_0x36249a[_0x32b131[_0x18f8('0x21')]]={'$like':'%'+_0x16ae08[_0x18f8('0x27')][_0x18f8('0x37')]+'%'};return _0x36249a;}})});}_0x1aa02a=_[_0x18f8('0x35')]({},_0x1aa02a,_0x16ae08[_0x18f8('0x38')]);var _0x537f40={'where':_0x1aa02a['where']};return db[_0x18f8('0x39')][_0x18f8('0x17')](_0x537f40)[_0x18f8('0x1c')](function(_0x3d52d9){_0x2ade9e[_0x18f8('0x17')]=_0x3d52d9;if(_0x16ae08['query']['includeAll']){_0x1aa02a[_0x18f8('0x3a')]=[{'all':!![]}];}return db['ServicenowField'][_0x18f8('0x3b')](_0x1aa02a);})[_0x18f8('0x1c')](function(_0x2c6065){_0x2ade9e[_0x18f8('0x3c')]=_0x2c6065;return _0x2ade9e;})['then'](respondWithFilteredResult(_0x2fd0dc,_0x1aa02a))['catch'](handleError(_0x2fd0dc,null));};exports[_0x18f8('0x3d')]=function(_0x1f15e4,_0x505591){var _0x579235={'raw':!![],'where':{'id':_0x1f15e4['params']['id']}},_0x2ffaf1={};_0x2ffaf1[_0x18f8('0x2b')]=_[_0x18f8('0x28')](db[_0x18f8('0x39')]['rawAttributes']);_0x2ffaf1[_0x18f8('0x27')]=_[_0x18f8('0x28')](_0x1f15e4[_0x18f8('0x27')]);_0x2ffaf1[_0x18f8('0x29')]=_['intersection'](_0x2ffaf1['model'],_0x2ffaf1['query']);_0x579235['attributes']=_[_0x18f8('0x2a')](_0x2ffaf1[_0x18f8('0x2b')],qs[_0x18f8('0x2d')](_0x1f15e4[_0x18f8('0x27')][_0x18f8('0x2d')]));_0x579235['attributes']=_0x579235[_0x18f8('0x2c')][_0x18f8('0x2e')]?_0x579235[_0x18f8('0x2c')]:_0x2ffaf1[_0x18f8('0x2b')];if(_0x1f15e4['query'][_0x18f8('0x3e')]){_0x579235[_0x18f8('0x3a')]=[{'all':!![]}];}_0x579235=_['merge']({},_0x579235,_0x1f15e4[_0x18f8('0x38')]);return db[_0x18f8('0x39')][_0x18f8('0x3f')](_0x579235)[_0x18f8('0x1c')](handleEntityNotFound(_0x505591,null))['then'](respondWithResult(_0x505591,null))['catch'](handleError(_0x505591,null));};exports[_0x18f8('0x40')]=function(_0x20435b,_0x1627bf){return db[_0x18f8('0x39')][_0x18f8('0x40')](_0x20435b[_0x18f8('0x41')],{})[_0x18f8('0x1c')](respondWithResult(_0x1627bf,0xc9))[_0x18f8('0x42')](handleError(_0x1627bf,null));};exports[_0x18f8('0x43')]=function(_0x4b6466,_0x4ed1d9){if(_0x4b6466['body']['id']){delete _0x4b6466[_0x18f8('0x41')]['id'];}return db[_0x18f8('0x39')]['find']({'where':{'id':_0x4b6466['params']['id']}})[_0x18f8('0x1c')](handleEntityNotFound(_0x4ed1d9,null))[_0x18f8('0x1c')](saveUpdates(_0x4b6466[_0x18f8('0x41')],null))[_0x18f8('0x1c')](respondWithResult(_0x4ed1d9,null))[_0x18f8('0x42')](handleError(_0x4ed1d9,null));};exports[_0x18f8('0x1d')]=function(_0x44bb07,_0xcf95be){return db[_0x18f8('0x39')][_0x18f8('0x3f')]({'where':{'id':_0x44bb07[_0x18f8('0x44')]['id']}})[_0x18f8('0x1c')](handleEntityNotFound(_0xcf95be,null))[_0x18f8('0x1c')](removeEntity(_0xcf95be,null))['catch'](handleError(_0xcf95be,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index fa84a4f..5871ef6 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 _0x1c76=['int_servicenow_fields','servicenow_unique_index','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','define'];(function(_0x3a0953,_0x1b8f5d){var _0x585884=function(_0x16ac5c){while(--_0x16ac5c){_0x3a0953['push'](_0x3a0953['shift']());}};_0x585884(++_0x1b8f5d);}(_0x1c76,0x12b));var _0x61c7=function(_0x2eb1c9,_0x3220cd){_0x2eb1c9=_0x2eb1c9-0x0;var _0x241737=_0x1c76[_0x2eb1c9];return _0x241737;};'use strict';var _=require(_0x61c7('0x0'));var util=require('util');var logger=require(_0x61c7('0x1'))(_0x61c7('0x2'));var moment=require('moment');var BPromise=require(_0x61c7('0x3'));var rp=require(_0x61c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x61c7('0x5'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x39bda2,_0x498dbc){return _0x39bda2[_0x61c7('0x6')]('ServicenowField',attributes,{'tableName':_0x61c7('0x7'),'paranoid':![],'indexes':[{'name':_0x61c7('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf505=['moment','bluebird','request-promise','path','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','util','../../config/logger','api'];(function(_0x1a0875,_0x5596d3){var _0x1888f4=function(_0x3890c7){while(--_0x3890c7){_0x1a0875['push'](_0x1a0875['shift']());}};_0x1888f4(++_0x5596d3);}(_0xf505,0x1cb));var _0x5f50=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0xf505[_0x4bc428];return _0x3ca37f;};'use strict';var _=require('lodash');var util=require(_0x5f50('0x0'));var logger=require(_0x5f50('0x1'))(_0x5f50('0x2'));var moment=require(_0x5f50('0x3'));var BPromise=require(_0x5f50('0x4'));var rp=require(_0x5f50('0x5'));var fs=require('fs');var path=require(_0x5f50('0x6'));var rimraf=require('rimraf');var config=require(_0x5f50('0x7'));var attributes=require('./intServicenowField.attributes');module[_0x5f50('0x8')]=function(_0x59d6c6,_0xccfd54){return _0x59d6c6[_0x5f50('0x9')](_0x5f50('0xa'),attributes,{'tableName':_0x5f50('0xb'),'paranoid':![],'indexes':[{'name':_0x5f50('0xc'),'fields':[_0x5f50('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index d3c56c2..349eaa1 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x1ecbd5,_0xf05f7c){var _0x1be527=function(_0x6ca991){while(--_0x6ca991){_0x1ecbd5['push'](_0x1ecbd5['shift']());}};_0x1be527(++_0xf05f7c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1ffdcf,_0x41401e){_0x1ffdcf=_0x1ffdcf-0x0;var _0x256695=_0x9ffd[_0x1ffdcf];return _0x256695;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4f64c8,_0x1659c5){var _0x27e2c9=function(_0x2d1dfc){while(--_0x2d1dfc){_0x4f64c8['push'](_0x4f64c8['shift']());}};_0x27e2c9(++_0x1659c5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x587cdf,_0x51a977){_0x587cdf=_0x587cdf-0x0;var _0x5e3e53=_0xb43b[_0x587cdf];return _0x5e3e53;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f6aaf01..f65ab15 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(_0x276363,_0x293898){var _0x4d499f=function(_0x3c826d){while(--_0x3c826d){_0x276363['push'](_0x276363['shift']());}};_0x4d499f(++_0x293898);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2d5003,_0x11b38f){var _0x2256cf=function(_0x1806f8){while(--_0x1806f8){_0x2d5003['push'](_0x2d5003['shift']());}};_0x2256cf(++_0x11b38f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 9bc7c16..81b9691 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(_0x4d1758,_0x41ad92){var _0x32719b=function(_0x21c322){while(--_0x21c322){_0x4d1758['push'](_0x4d1758['shift']());}};_0x32719b(++_0x41ad92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x30a3b6,_0x5eb4aa){var _0x3da3e3=function(_0x21a2fb){while(--_0x21a2fb){_0x30a3b6['push'](_0x30a3b6['shift']());}};_0x3da3e3(++_0x5eb4aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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 216788f..23a4b50 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 _0x4e2c=['SugarcrmAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','catch','show','keys','merge','find','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x4f156a,_0x407883){var _0x1ec23d=function(_0x5a6b2d){while(--_0x5a6b2d){_0x4f156a['push'](_0x4f156a['shift']());}};_0x1ec23d(++_0x407883);}(_0x4e2c,0x143));var _0xc4e2=function(_0x438900,_0x4f668c){_0x438900=_0x438900-0x0;var _0xbcc06d=_0x4e2c[_0x438900];return _0xbcc06d;};'use strict';var emlformat=require(_0xc4e2('0x0'));var rimraf=require(_0xc4e2('0x1'));var zipdir=require(_0xc4e2('0x2'));var jsonpatch=require(_0xc4e2('0x3'));var rp=require('request-promise');var moment=require(_0xc4e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4e2('0x5'));var util=require(_0xc4e2('0x6'));var path=require('path');var sox=require(_0xc4e2('0x7'));var csv=require(_0xc4e2('0x8'));var ejs=require(_0xc4e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4e2('0xa'));var squel=require(_0xc4e2('0xb'));var crypto=require(_0xc4e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4e2('0xe'));var Papa=require(_0xc4e2('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e2('0x11'));var hardwareService=require(_0xc4e2('0x12'));var logger=require(_0xc4e2('0x13'))(_0xc4e2('0x14'));var utils=require(_0xc4e2('0x15'));var config=require(_0xc4e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4e2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42e7fa,_0x361c1c){_0x361c1c=_0x361c1c||0xcc;return function(_0x7e07c5){if(_0x7e07c5){return _0x42e7fa[_0xc4e2('0x18')](_0x361c1c);}return _0x42e7fa[_0xc4e2('0x19')](_0x361c1c)[_0xc4e2('0x1a')]();};}function respondWithResult(_0x5d42e0,_0xb18798){_0xb18798=_0xb18798||0xc8;return function(_0x39a791){if(_0x39a791){return _0x5d42e0['status'](_0xb18798)[_0xc4e2('0x1b')](_0x39a791);}};}function respondWithFilteredResult(_0x2403b3,_0x3ec9f3){return function(_0x5380b3){if(_0x5380b3){var _0xa26b65=typeof _0x3ec9f3[_0xc4e2('0x1c')]===_0xc4e2('0x1d')&&typeof _0x3ec9f3[_0xc4e2('0x1e')]===_0xc4e2('0x1d');var _0x199478=_0x5380b3['count'];var _0x420f28=_0xa26b65?0x0:_0x3ec9f3[_0xc4e2('0x1c')];var _0x3da520=_0xa26b65?_0x5380b3[_0xc4e2('0x1f')]:_0x3ec9f3[_0xc4e2('0x1c')]+_0x3ec9f3[_0xc4e2('0x1e')];var _0x5b257a;if(_0x3da520>=_0x199478){_0x3da520=_0x199478;_0x5b257a=0xc8;}else{_0x5b257a=0xce;}_0x2403b3[_0xc4e2('0x19')](_0x5b257a);return _0x2403b3['set']('Content-Range',_0x420f28+'-'+_0x3da520+'/'+_0x199478)[_0xc4e2('0x1b')](_0x5380b3);}return null;};}function patchUpdates(_0x5caaa3){return function(_0x1856b0){try{jsonpatch[_0xc4e2('0x20')](_0x1856b0,_0x5caaa3,!![]);}catch(_0x5d9fdf){return BPromise[_0xc4e2('0x21')](_0x5d9fdf);}return _0x1856b0[_0xc4e2('0x22')]();};}function saveUpdates(_0x3f18f6,_0x296449){return function(_0x17cb71){if(_0x17cb71){return _0x17cb71[_0xc4e2('0x23')](_0x3f18f6)[_0xc4e2('0x24')](function(_0x1ccd20){return _0x1ccd20;});}return null;};}function removeEntity(_0xa181ea,_0x37c1f4){return function(_0x5e057d){if(_0x5e057d){return _0x5e057d['destroy']()[_0xc4e2('0x24')](function(){_0xa181ea[_0xc4e2('0x19')](0xcc)[_0xc4e2('0x1a')]();});}};}function handleEntityNotFound(_0x6727f3,_0x107a5e){return function(_0x133749){if(!_0x133749){_0x6727f3[_0xc4e2('0x18')](0x194);}return _0x133749;};}function handleError(_0xd59df1,_0x3c6d40){_0x3c6d40=_0x3c6d40||0x1f4;return function(_0x2f5b55){logger[_0xc4e2('0x25')](_0x2f5b55[_0xc4e2('0x26')]);if(_0x2f5b55[_0xc4e2('0x27')]){delete _0x2f5b55[_0xc4e2('0x27')];}_0xd59df1[_0xc4e2('0x19')](_0x3c6d40)[_0xc4e2('0x28')](_0x2f5b55);};}exports[_0xc4e2('0x29')]=function(_0x24d5f3,_0x5f24a9){var _0x57e403={},_0x2a9b2a={},_0x4c788c={'count':0x0,'rows':[]};var _0x2eada5=_[_0xc4e2('0x2a')](db[_0xc4e2('0x2b')][_0xc4e2('0x2c')],function(_0x17b881){return{'name':_0x17b881[_0xc4e2('0x2d')],'type':_0x17b881[_0xc4e2('0x2e')]['key']};});_0x2a9b2a[_0xc4e2('0x2f')]=_[_0xc4e2('0x2a')](_0x2eada5,_0xc4e2('0x27'));_0x2a9b2a[_0xc4e2('0x30')]=_['keys'](_0x24d5f3['query']);_0x2a9b2a['filters']=_['intersection'](_0x2a9b2a[_0xc4e2('0x2f')],_0x2a9b2a[_0xc4e2('0x30')]);_0x57e403[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x2a9b2a[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x57e403[_0xc4e2('0x31')]=_0x57e403[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x57e403['attributes']:_0x2a9b2a['model'];if(!_0x24d5f3[_0xc4e2('0x30')]['hasOwnProperty'](_0xc4e2('0x35'))){_0x57e403[_0xc4e2('0x1e')]=qs[_0xc4e2('0x1e')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x57e403[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1c')]);}_0x57e403[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x24d5f3[_0xc4e2('0x30')]['sort']);_0x57e403[_0xc4e2('0x38')]=qs['filters'](_[_0xc4e2('0x39')](_0x24d5f3['query'],_0x2a9b2a[_0xc4e2('0x3a')]),_0x2eada5);if(_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x57e403['where']=_['merge'](_0x57e403[_0xc4e2('0x38')],{'$or':_[_0xc4e2('0x2a')](_0x2eada5,function(_0x70138b){if(_0x70138b['type']!=='VIRTUAL'){var _0x339745={};_0x339745[_0x70138b[_0xc4e2('0x27')]]={'$like':'%'+_0x24d5f3[_0xc4e2('0x30')]['filter']+'%'};return _0x339745;}})});}_0x57e403=_['merge']({},_0x57e403,_0x24d5f3[_0xc4e2('0x3c')]);var _0x18692f={'where':_0x57e403['where']};return db[_0xc4e2('0x2b')][_0xc4e2('0x1f')](_0x18692f)[_0xc4e2('0x24')](function(_0x3b6bb5){_0x4c788c['count']=_0x3b6bb5;if(_0x24d5f3['query'][_0xc4e2('0x3d')]){_0x57e403[_0xc4e2('0x3e')]=[{'all':!![]}];}return db[_0xc4e2('0x2b')][_0xc4e2('0x3f')](_0x57e403);})[_0xc4e2('0x24')](function(_0x4ec83f){_0x4c788c['rows']=_0x4ec83f;return _0x4c788c;})[_0xc4e2('0x24')](respondWithFilteredResult(_0x5f24a9,_0x57e403))[_0xc4e2('0x40')](handleError(_0x5f24a9,null));};exports[_0xc4e2('0x41')]=function(_0x5491a4,_0x4dc0cb){var _0x49c473={'raw':![],'where':{'id':_0x5491a4['params']['id']}},_0x543f65={};_0x543f65[_0xc4e2('0x2f')]=_['keys'](db[_0xc4e2('0x2b')]['rawAttributes']);_0x543f65['query']=_[_0xc4e2('0x42')](_0x5491a4['query']);_0x543f65[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x543f65[_0xc4e2('0x2f')],_0x543f65[_0xc4e2('0x30')]);_0x49c473['attributes']=_[_0xc4e2('0x32')](_0x543f65['model'],qs['fields'](_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x49c473[_0xc4e2('0x31')]=_0x49c473[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x49c473[_0xc4e2('0x31')]:_0x543f65['model'];if(_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x3d')]){_0x49c473[_0xc4e2('0x3e')]=[{'all':!![]}];}_0x49c473=_[_0xc4e2('0x43')]({},_0x49c473,_0x5491a4[_0xc4e2('0x3c')]);return db[_0xc4e2('0x2b')][_0xc4e2('0x44')](_0x49c473)['then'](handleEntityNotFound(_0x4dc0cb,null))[_0xc4e2('0x24')](respondWithResult(_0x4dc0cb,null))[_0xc4e2('0x40')](handleError(_0x4dc0cb,null));};exports[_0xc4e2('0x45')]=function(_0x483933,_0x140a2f){return db[_0xc4e2('0x2b')]['create'](_0x483933[_0xc4e2('0x46')],{})['then'](respondWithResult(_0x140a2f,0xc9))['catch'](handleError(_0x140a2f,null));};exports[_0xc4e2('0x23')]=function(_0x50ec22,_0xf9b83a){if(_0x50ec22[_0xc4e2('0x46')]['id']){delete _0x50ec22['body']['id'];}return db[_0xc4e2('0x2b')][_0xc4e2('0x44')]({'where':{'id':_0x50ec22[_0xc4e2('0x47')]['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0xf9b83a,null))[_0xc4e2('0x24')](saveUpdates(_0x50ec22['body'],null))[_0xc4e2('0x24')](respondWithResult(_0xf9b83a,null))['catch'](handleError(_0xf9b83a,null));};exports[_0xc4e2('0x48')]=function(_0x42975e,_0x1a9e65){return db['SugarcrmAccount']['find']({'where':{'id':_0x42975e[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9e65,null))[_0xc4e2('0x24')](removeEntity(_0x1a9e65,null))['catch'](handleError(_0x1a9e65,null));};exports[_0xc4e2('0x49')]=function(_0x4c0a0c,_0x335042,_0x469533){var _0x22e4cc={};var _0x3c80b2={};var _0x56ab58;var _0x247881;return db[_0xc4e2('0x2b')]['findOne']({'where':{'id':_0x4c0a0c[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x335042,null))[_0xc4e2('0x24')](function(_0x54a517){if(_0x54a517){_0x56ab58=_0x54a517;_0x3c80b2['model']=_['keys'](db[_0xc4e2('0x4a')][_0xc4e2('0x2c')]);_0x3c80b2['query']=_[_0xc4e2('0x42')](_0x4c0a0c[_0xc4e2('0x30')]);_0x3c80b2[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],_0x3c80b2[_0xc4e2('0x30')]);_0x22e4cc[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x4c0a0c['query']['fields']));_0x22e4cc[_0xc4e2('0x31')]=_0x22e4cc[_0xc4e2('0x31')]['length']?_0x22e4cc[_0xc4e2('0x31')]:_0x3c80b2[_0xc4e2('0x2f')];_0x22e4cc[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x4c0a0c['query'][_0xc4e2('0x37')]);_0x22e4cc[_0xc4e2('0x38')]=qs['filters'](_['pick'](_0x4c0a0c[_0xc4e2('0x30')],_0x3c80b2[_0xc4e2('0x3a')]));if(_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x22e4cc['where']=_[_0xc4e2('0x43')](_0x22e4cc[_0xc4e2('0x38')],{'$or':_['map'](_0x22e4cc[_0xc4e2('0x31')],function(_0xe2b534){var _0x2858fd={};_0x2858fd[_0xe2b534]={'$like':'%'+_0x4c0a0c['query'][_0xc4e2('0x3b')]+'%'};return _0x2858fd;})});}_0x22e4cc=_[_0xc4e2('0x43')]({},_0x22e4cc,_0x4c0a0c[_0xc4e2('0x3c')]);return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})['then'](function(_0x10a4c0){if(_0x10a4c0){_0x247881=_0x10a4c0[_0xc4e2('0x34')];if(!_0x4c0a0c['query'][_0xc4e2('0x4b')](_0xc4e2('0x35'))){_0x22e4cc[_0xc4e2('0x1e')]=qs['limit'](_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x22e4cc[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x4c0a0c[_0xc4e2('0x30')]['offset']);}return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})[_0xc4e2('0x24')](function(_0x16252e){if(_0x16252e){return _0x16252e?{'count':_0x247881,'rows':_0x16252e}:null;}})['then'](respondWithResult(_0x335042,null))['catch'](handleError(_0x335042,null));};exports[_0xc4e2('0x4c')]=function(_0xef3598,_0x3e0f78,_0x32d9b2){if(_0xef3598[_0xc4e2('0x46')]['id']){delete _0xef3598[_0xc4e2('0x46')]['id'];}return db['SugarcrmAccount'][_0xc4e2('0x4d')]({'where':{'id':_0xef3598['params']['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0x3e0f78,null))[_0xc4e2('0x24')](function(_0x578ee9){if(_0x578ee9){_0xef3598['body'][_0xc4e2('0x4e')]=_0x578ee9['id'];_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x4f')]=integrations[_0xc4e2('0x50')](_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x51')],_0xef3598['body'][_0xc4e2('0x2e')]);_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x52')]=integrations[_0xc4e2('0x53')](_0xef3598['body']['channel'],_0xef3598[_0xc4e2('0x46')]['type']);return db['SugarcrmConfiguration'][_0xc4e2('0x45')](_0xef3598['body'],{'include':[{'model':db[_0xc4e2('0x54')],'as':_0xc4e2('0x4f')},{'model':db[_0xc4e2('0x54')],'as':'Descriptions'}]});}return null;})[_0xc4e2('0x24')](respondWithResult(_0x3e0f78,null))[_0xc4e2('0x40')](handleError(_0x3e0f78,null));};exports['getFields']=function(_0x3d59f4,_0x5b6e16,_0x4c7206){var _0x58f0ba='';var _0x5366fd=['id','name',_0xc4e2('0x55'),_0xc4e2('0x56'),'description',_0xc4e2('0x57'),_0xc4e2('0x58'),_0xc4e2('0x59'),_0xc4e2('0x5a'),'parent_type',_0xc4e2('0x5b'),'direction'];return db[_0xc4e2('0x2b')][_0xc4e2('0x4d')]({'where':{'id':_0x3d59f4[_0xc4e2('0x47')]['id']},'attributes':['id',_0xc4e2('0x5c'),_0xc4e2('0x5d'),'remoteUri']})[_0xc4e2('0x24')](handleEntityNotFound(_0x5b6e16,null))[_0xc4e2('0x24')](function(_0xbb6638){if(_0xbb6638){_0x58f0ba=_0xbb6638[_0xc4e2('0x5e')];var _0xa1dc4b=_0x58f0ba[_0xc4e2('0x5f')](-0x1);if(_0xa1dc4b==='/'){_0x58f0ba=_0x58f0ba[_0xc4e2('0x60')](0x0,_0x58f0ba[_0xc4e2('0x61')](_0xa1dc4b));}return rp({'method':_0xc4e2('0x62'),'uri':util['format'](_0xc4e2('0x63'),_0x58f0ba,_0xc4e2('0x64')),'json':!![],'form':{'method':_0xc4e2('0x65'),'input_type':_0xc4e2('0x66'),'response_type':_0xc4e2('0x66'),'rest_data':JSON[_0xc4e2('0x67')]({'user_auth':{'user_name':_0xbb6638['username'],'password':_0xbb6638['password'],'encryption':_0xc4e2('0x68')},'application':_0xc4e2('0x69')})}});}})[_0xc4e2('0x24')](function(_0x307800){if(_0x307800&&_0x307800[_0xc4e2('0x27')]!==_0xc4e2('0x6a')&&_0x307800['name']!==_0xc4e2('0x6b')){return rp({'method':_0xc4e2('0x62'),'uri':util[_0xc4e2('0x6c')](_0xc4e2('0x63'),_0x58f0ba,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xc4e2('0x6d'),'input_type':_0xc4e2('0x66'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x307800['id'],'module_name':_0xc4e2('0x6e')})}})['then'](function(_0xb3ee62){if(_0xb3ee62){var _0x30a684=_[_0xc4e2('0x6f')](_0xb3ee62['module_fields']);_[_0xc4e2('0x70')](_0x30a684,function(_0x91924d){return _0x5366fd[_0xc4e2('0x71')](_0x91924d[_0xc4e2('0x27')]);});return{'count':_0x30a684[_0xc4e2('0x34')],'rows':_[_0xc4e2('0x2a')](_0x30a684,function(_0xa2c816){return{'id':_0xa2c816['name'],'name':_0xa2c816[_0xc4e2('0x72')],'custom':_[_0xc4e2('0x73')](_0xa2c816[_0xc4e2('0x27')],'_c')?!![]:![],'options':_0xa2c816[_0xc4e2('0x3c')]?_[_0xc4e2('0x2a')](_[_0xc4e2('0x6f')](_0xa2c816[_0xc4e2('0x3c')]),function(_0x363409){return{'name':_0x363409[_0xc4e2('0x74')],'value':_0x363409['name']};}):[]};})};}})[_0xc4e2('0x24')](respondWithResult(_0x5b6e16,null))[_0xc4e2('0x40')](function(_0x3011c2){var _0x5a7601=_0x3d59f4[_0xc4e2('0x30')]['test']?0x1f4:_0x3011c2[_0xc4e2('0x75')]||0x1f4;logger[_0xc4e2('0x25')](_0xc4e2('0x76'),_0xc4e2('0x77'),_0x5a7601,JSON[_0xc4e2('0x67')](_0x3011c2));delete _0x3011c2['name'];if(_0x5a7601===0x191){_0x5a7601=0x190;}_0x5b6e16[_0xc4e2('0x19')](_0x5a7601)[_0xc4e2('0x28')](_0x3d59f4[_0xc4e2('0x30')][_0xc4e2('0x78')]?{'message':_0xc4e2('0x79'),'statusCode':_0x3011c2[_0xc4e2('0x75')]}:_0x3011c2);});}else{var _0x21f835=0x1f4;_0x5b6e16[_0xc4e2('0x19')](_0x21f835)[_0xc4e2('0x28')]({'message':_0xc4e2('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x1ec8=['offset','set','Content-Range','reject','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','rows','catch','find','create','update','body','params','destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','getSubjects','getDescriptions','SugarcrmField','Subjects','Descriptions','assigned_user_id','created_by','description','duration_hours','duration_minutes','parent_id','username','password','remoteUri','slice','lastIndexOf','%s%s','/service/v4_1/rest.php','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','format','get_module_fields','values','module_fields','remove','includes','label','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x1ec8,0xc9));var _0x81ec=function(_0x24dc7c,_0x2e881e){_0x24dc7c=_0x24dc7c-0x0;var _0x4b7c22=_0x1ec8[_0x24dc7c];return _0x4b7c22;};'use strict';var emlformat=require(_0x81ec('0x0'));var rimraf=require(_0x81ec('0x1'));var zipdir=require(_0x81ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81ec('0x3'));var moment=require(_0x81ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x81ec('0x5'));var util=require(_0x81ec('0x6'));var path=require(_0x81ec('0x7'));var sox=require(_0x81ec('0x8'));var csv=require(_0x81ec('0x9'));var ejs=require(_0x81ec('0xa'));var fs=require('fs');var fs_extra=require(_0x81ec('0xb'));var _=require(_0x81ec('0xc'));var squel=require(_0x81ec('0xd'));var crypto=require(_0x81ec('0xe'));var jsforce=require(_0x81ec('0xf'));var deskjs=require(_0x81ec('0x10'));var toCsv=require(_0x81ec('0x9'));var querystring=require('querystring');var Papa=require(_0x81ec('0x11'));var Redis=require('ioredis');var authService=require(_0x81ec('0x12'));var qs=require(_0x81ec('0x13'));var as=require(_0x81ec('0x14'));var hardwareService=require(_0x81ec('0x15'));var logger=require(_0x81ec('0x16'))(_0x81ec('0x17'));var utils=require('../../config/utils');var config=require(_0x81ec('0x18'));var licenseUtil=require(_0x81ec('0x19'));var db=require(_0x81ec('0x1a'))['db'];var integrations=require(_0x81ec('0x1b'));function respondWithStatusCode(_0x17d4ba,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x59fc72){if(_0x59fc72){return _0x17d4ba[_0x81ec('0x1c')](_0x1bb794);}return _0x17d4ba[_0x81ec('0x1d')](_0x1bb794)[_0x81ec('0x1e')]();};}function respondWithResult(_0x2eb3aa,_0x118061){_0x118061=_0x118061||0xc8;return function(_0x9c8608){if(_0x9c8608){return _0x2eb3aa[_0x81ec('0x1d')](_0x118061)[_0x81ec('0x1f')](_0x9c8608);}};}function respondWithFilteredResult(_0x3925da,_0xcb7cb0){return function(_0x2bd512){if(_0x2bd512){var _0x4a05cc=typeof _0xcb7cb0['offset']==='undefined'&&typeof _0xcb7cb0[_0x81ec('0x20')]===_0x81ec('0x21');var _0x37ead9=_0x2bd512[_0x81ec('0x22')];var _0x288613=_0x4a05cc?0x0:_0xcb7cb0[_0x81ec('0x23')];var _0x26df89=_0x4a05cc?_0x2bd512[_0x81ec('0x22')]:_0xcb7cb0[_0x81ec('0x23')]+_0xcb7cb0['limit'];var _0x348798;if(_0x26df89>=_0x37ead9){_0x26df89=_0x37ead9;_0x348798=0xc8;}else{_0x348798=0xce;}_0x3925da['status'](_0x348798);return _0x3925da[_0x81ec('0x24')](_0x81ec('0x25'),_0x288613+'-'+_0x26df89+'/'+_0x37ead9)[_0x81ec('0x1f')](_0x2bd512);}return null;};}function patchUpdates(_0xe703c3){return function(_0x158a43){try{jsonpatch['apply'](_0x158a43,_0xe703c3,!![]);}catch(_0x188846){return BPromise[_0x81ec('0x26')](_0x188846);}return _0x158a43['save']();};}function saveUpdates(_0x286ca7,_0x211984){return function(_0x5332fe){if(_0x5332fe){return _0x5332fe['update'](_0x286ca7)[_0x81ec('0x27')](function(_0x132ab7){return _0x132ab7;});}return null;};}function removeEntity(_0x255ce0,_0x3dc6d6){return function(_0x5e071f){if(_0x5e071f){return _0x5e071f['destroy']()[_0x81ec('0x27')](function(){_0x255ce0[_0x81ec('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x373169,_0x2c467a){return function(_0x10417){if(!_0x10417){_0x373169[_0x81ec('0x1c')](0x194);}return _0x10417;};}function handleError(_0x10f9b8,_0x14022f){_0x14022f=_0x14022f||0x1f4;return function(_0x3597eb){logger[_0x81ec('0x28')](_0x3597eb[_0x81ec('0x29')]);if(_0x3597eb[_0x81ec('0x2a')]){delete _0x3597eb[_0x81ec('0x2a')];}_0x10f9b8[_0x81ec('0x1d')](_0x14022f)[_0x81ec('0x2b')](_0x3597eb);};}exports['index']=function(_0x52607d,_0x195e64){var _0x59e0fc={},_0x4e2c7c={},_0x525aa2={'count':0x0,'rows':[]};var _0x1fd4c8=_[_0x81ec('0x2c')](db['SugarcrmAccount'][_0x81ec('0x2d')],function(_0x5c33c2){return{'name':_0x5c33c2[_0x81ec('0x2e')],'type':_0x5c33c2[_0x81ec('0x2f')][_0x81ec('0x30')]};});_0x4e2c7c[_0x81ec('0x31')]=_['map'](_0x1fd4c8,'name');_0x4e2c7c[_0x81ec('0x32')]=_[_0x81ec('0x33')](_0x52607d[_0x81ec('0x32')]);_0x4e2c7c['filters']=_[_0x81ec('0x34')](_0x4e2c7c[_0x81ec('0x31')],_0x4e2c7c[_0x81ec('0x32')]);_0x59e0fc[_0x81ec('0x35')]=_[_0x81ec('0x34')](_0x4e2c7c[_0x81ec('0x31')],qs[_0x81ec('0x36')](_0x52607d[_0x81ec('0x32')][_0x81ec('0x36')]));_0x59e0fc[_0x81ec('0x35')]=_0x59e0fc['attributes'][_0x81ec('0x37')]?_0x59e0fc[_0x81ec('0x35')]:_0x4e2c7c[_0x81ec('0x31')];if(!_0x52607d[_0x81ec('0x32')][_0x81ec('0x38')](_0x81ec('0x39'))){_0x59e0fc[_0x81ec('0x20')]=qs['limit'](_0x52607d['query'][_0x81ec('0x20')]);_0x59e0fc['offset']=qs[_0x81ec('0x23')](_0x52607d[_0x81ec('0x32')]['offset']);}_0x59e0fc[_0x81ec('0x3a')]=qs[_0x81ec('0x3b')](_0x52607d[_0x81ec('0x32')][_0x81ec('0x3b')]);_0x59e0fc['where']=qs[_0x81ec('0x3c')](_['pick'](_0x52607d[_0x81ec('0x32')],_0x4e2c7c[_0x81ec('0x3c')]),_0x1fd4c8);if(_0x52607d[_0x81ec('0x32')][_0x81ec('0x3d')]){_0x59e0fc[_0x81ec('0x3e')]=_[_0x81ec('0x3f')](_0x59e0fc[_0x81ec('0x3e')],{'$or':_[_0x81ec('0x2c')](_0x1fd4c8,function(_0x4513dd){if(_0x4513dd[_0x81ec('0x2f')]!==_0x81ec('0x40')){var _0xe03c22={};_0xe03c22[_0x4513dd[_0x81ec('0x2a')]]={'$like':'%'+_0x52607d[_0x81ec('0x32')]['filter']+'%'};return _0xe03c22;}})});}_0x59e0fc=_[_0x81ec('0x3f')]({},_0x59e0fc,_0x52607d[_0x81ec('0x41')]);var _0x216a2b={'where':_0x59e0fc[_0x81ec('0x3e')]};return db[_0x81ec('0x42')][_0x81ec('0x22')](_0x216a2b)['then'](function(_0x5b0311){_0x525aa2[_0x81ec('0x22')]=_0x5b0311;if(_0x52607d['query'][_0x81ec('0x43')]){_0x59e0fc[_0x81ec('0x44')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x59e0fc);})[_0x81ec('0x27')](function(_0x418270){_0x525aa2[_0x81ec('0x45')]=_0x418270;return _0x525aa2;})['then'](respondWithFilteredResult(_0x195e64,_0x59e0fc))[_0x81ec('0x46')](handleError(_0x195e64,null));};exports['show']=function(_0x5cfb00,_0x49ff56){var _0x5cd3ce={'raw':![],'where':{'id':_0x5cfb00['params']['id']}},_0x45516c={};_0x45516c[_0x81ec('0x31')]=_[_0x81ec('0x33')](db[_0x81ec('0x42')][_0x81ec('0x2d')]);_0x45516c[_0x81ec('0x32')]=_[_0x81ec('0x33')](_0x5cfb00[_0x81ec('0x32')]);_0x45516c[_0x81ec('0x3c')]=_[_0x81ec('0x34')](_0x45516c[_0x81ec('0x31')],_0x45516c[_0x81ec('0x32')]);_0x5cd3ce[_0x81ec('0x35')]=_[_0x81ec('0x34')](_0x45516c[_0x81ec('0x31')],qs['fields'](_0x5cfb00['query'][_0x81ec('0x36')]));_0x5cd3ce[_0x81ec('0x35')]=_0x5cd3ce[_0x81ec('0x35')]['length']?_0x5cd3ce[_0x81ec('0x35')]:_0x45516c[_0x81ec('0x31')];if(_0x5cfb00[_0x81ec('0x32')][_0x81ec('0x43')]){_0x5cd3ce[_0x81ec('0x44')]=[{'all':!![]}];}_0x5cd3ce=_['merge']({},_0x5cd3ce,_0x5cfb00['options']);return db[_0x81ec('0x42')][_0x81ec('0x47')](_0x5cd3ce)[_0x81ec('0x27')](handleEntityNotFound(_0x49ff56,null))[_0x81ec('0x27')](respondWithResult(_0x49ff56,null))['catch'](handleError(_0x49ff56,null));};exports[_0x81ec('0x48')]=function(_0x111e48,_0x46a9a3){return db[_0x81ec('0x42')][_0x81ec('0x48')](_0x111e48['body'],{})[_0x81ec('0x27')](respondWithResult(_0x46a9a3,0xc9))['catch'](handleError(_0x46a9a3,null));};exports[_0x81ec('0x49')]=function(_0x2687df,_0x4d5c88){if(_0x2687df['body']['id']){delete _0x2687df[_0x81ec('0x4a')]['id'];}return db[_0x81ec('0x42')]['find']({'where':{'id':_0x2687df[_0x81ec('0x4b')]['id']}})[_0x81ec('0x27')](handleEntityNotFound(_0x4d5c88,null))['then'](saveUpdates(_0x2687df['body'],null))['then'](respondWithResult(_0x4d5c88,null))['catch'](handleError(_0x4d5c88,null));};exports[_0x81ec('0x4c')]=function(_0x453d1c,_0x50bcbc){return db[_0x81ec('0x42')]['find']({'where':{'id':_0x453d1c[_0x81ec('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50bcbc,null))['then'](removeEntity(_0x50bcbc,null))[_0x81ec('0x46')](handleError(_0x50bcbc,null));};exports[_0x81ec('0x4d')]=function(_0x47fdd4,_0x436055,_0x3a0645){var _0x527599={};var _0x4d311d={};var _0x2299aa;var _0x4b8d3e;return db['SugarcrmAccount'][_0x81ec('0x4e')]({'where':{'id':_0x47fdd4[_0x81ec('0x4b')]['id']}})['then'](handleEntityNotFound(_0x436055,null))[_0x81ec('0x27')](function(_0x11661c){if(_0x11661c){_0x2299aa=_0x11661c;_0x4d311d[_0x81ec('0x31')]=_[_0x81ec('0x33')](db[_0x81ec('0x4f')]['rawAttributes']);_0x4d311d[_0x81ec('0x32')]=_[_0x81ec('0x33')](_0x47fdd4[_0x81ec('0x32')]);_0x4d311d[_0x81ec('0x3c')]=_['intersection'](_0x4d311d['model'],_0x4d311d[_0x81ec('0x32')]);_0x527599[_0x81ec('0x35')]=_[_0x81ec('0x34')](_0x4d311d['model'],qs[_0x81ec('0x36')](_0x47fdd4['query'][_0x81ec('0x36')]));_0x527599['attributes']=_0x527599[_0x81ec('0x35')]['length']?_0x527599['attributes']:_0x4d311d[_0x81ec('0x31')];_0x527599[_0x81ec('0x3a')]=qs['sort'](_0x47fdd4[_0x81ec('0x32')][_0x81ec('0x3b')]);_0x527599['where']=qs['filters'](_['pick'](_0x47fdd4['query'],_0x4d311d[_0x81ec('0x3c')]));if(_0x47fdd4[_0x81ec('0x32')][_0x81ec('0x3d')]){_0x527599[_0x81ec('0x3e')]=_[_0x81ec('0x3f')](_0x527599[_0x81ec('0x3e')],{'$or':_[_0x81ec('0x2c')](_0x527599['attributes'],function(_0x5bdc2d){var _0x13900f={};_0x13900f[_0x5bdc2d]={'$like':'%'+_0x47fdd4['query'][_0x81ec('0x3d')]+'%'};return _0x13900f;})});}_0x527599=_[_0x81ec('0x3f')]({},_0x527599,_0x47fdd4[_0x81ec('0x41')]);return _0x2299aa[_0x81ec('0x4d')](_0x527599);}})[_0x81ec('0x27')](function(_0x3a5535){if(_0x3a5535){_0x4b8d3e=_0x3a5535['length'];if(!_0x47fdd4[_0x81ec('0x32')]['hasOwnProperty'](_0x81ec('0x39'))){_0x527599[_0x81ec('0x20')]=qs[_0x81ec('0x20')](_0x47fdd4[_0x81ec('0x32')][_0x81ec('0x20')]);_0x527599[_0x81ec('0x23')]=qs[_0x81ec('0x23')](_0x47fdd4['query'][_0x81ec('0x23')]);}return _0x2299aa[_0x81ec('0x4d')](_0x527599);}})[_0x81ec('0x27')](function(_0x351196){if(_0x351196){return _0x351196?{'count':_0x4b8d3e,'rows':_0x351196}:null;}})['then'](respondWithResult(_0x436055,null))[_0x81ec('0x46')](handleError(_0x436055,null));};exports[_0x81ec('0x50')]=function(_0x496ff1,_0x303d81,_0x2bed89){if(_0x496ff1[_0x81ec('0x4a')]['id']){delete _0x496ff1[_0x81ec('0x4a')]['id'];}return db[_0x81ec('0x42')][_0x81ec('0x4e')]({'where':{'id':_0x496ff1['params']['id']}})[_0x81ec('0x27')](handleEntityNotFound(_0x303d81,null))[_0x81ec('0x27')](function(_0x2717eb){if(_0x2717eb){_0x496ff1['body'][_0x81ec('0x51')]=_0x2717eb['id'];_0x496ff1[_0x81ec('0x4a')]['Subjects']=integrations[_0x81ec('0x52')](_0x496ff1[_0x81ec('0x4a')]['channel'],_0x496ff1['body'][_0x81ec('0x2f')]);_0x496ff1[_0x81ec('0x4a')]['Descriptions']=integrations[_0x81ec('0x53')](_0x496ff1[_0x81ec('0x4a')]['channel'],_0x496ff1[_0x81ec('0x4a')]['type']);return db[_0x81ec('0x4f')][_0x81ec('0x48')](_0x496ff1[_0x81ec('0x4a')],{'include':[{'model':db[_0x81ec('0x54')],'as':_0x81ec('0x55')},{'model':db[_0x81ec('0x54')],'as':_0x81ec('0x56')}]});}return null;})[_0x81ec('0x27')](respondWithResult(_0x303d81,null))[_0x81ec('0x46')](handleError(_0x303d81,null));};exports['getFields']=function(_0x2eceba,_0x19e387,_0x45089c){var _0x17730c='';var _0x18fca9=['id','name',_0x81ec('0x57'),_0x81ec('0x58'),_0x81ec('0x59'),'date_start',_0x81ec('0x5a'),_0x81ec('0x5b'),_0x81ec('0x5c'),'parent_type','parent_name','direction'];return db[_0x81ec('0x42')][_0x81ec('0x4e')]({'where':{'id':_0x2eceba[_0x81ec('0x4b')]['id']},'attributes':['id',_0x81ec('0x5d'),_0x81ec('0x5e'),_0x81ec('0x5f')]})['then'](handleEntityNotFound(_0x19e387,null))[_0x81ec('0x27')](function(_0x3010b7){if(_0x3010b7){_0x17730c=_0x3010b7['remoteUri'];var _0xc35550=_0x17730c[_0x81ec('0x60')](-0x1);if(_0xc35550==='/'){_0x17730c=_0x17730c['substring'](0x0,_0x17730c[_0x81ec('0x61')](_0xc35550));}return rp({'method':'POST','uri':util['format'](_0x81ec('0x62'),_0x17730c,_0x81ec('0x63')),'json':!![],'form':{'method':_0x81ec('0x64'),'input_type':_0x81ec('0x65'),'response_type':_0x81ec('0x65'),'rest_data':JSON[_0x81ec('0x66')]({'user_auth':{'user_name':_0x3010b7[_0x81ec('0x5d')],'password':_0x3010b7[_0x81ec('0x5e')],'encryption':'PLAIN'},'application':_0x81ec('0x67')})}});}})['then'](function(_0x41bd61){if(_0x41bd61&&_0x41bd61['name']!=='Invalid\x20Login'&&_0x41bd61[_0x81ec('0x2a')]!==_0x81ec('0x68')){return rp({'method':_0x81ec('0x69'),'uri':util[_0x81ec('0x6a')](_0x81ec('0x62'),_0x17730c,_0x81ec('0x63')),'json':!![],'form':{'method':_0x81ec('0x6b'),'input_type':_0x81ec('0x65'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x41bd61['id'],'module_name':'Calls'})}})[_0x81ec('0x27')](function(_0x15fec6){if(_0x15fec6){var _0x4532d6=_[_0x81ec('0x6c')](_0x15fec6[_0x81ec('0x6d')]);_[_0x81ec('0x6e')](_0x4532d6,function(_0x55edcc){return _0x18fca9[_0x81ec('0x6f')](_0x55edcc[_0x81ec('0x2a')]);});return{'count':_0x4532d6[_0x81ec('0x37')],'rows':_[_0x81ec('0x2c')](_0x4532d6,function(_0xe96662){return{'id':_0xe96662[_0x81ec('0x2a')],'name':_0xe96662[_0x81ec('0x70')],'custom':_['endsWith'](_0xe96662[_0x81ec('0x2a')],'_c')?!![]:![],'options':_0xe96662[_0x81ec('0x41')]?_['map'](_['values'](_0xe96662[_0x81ec('0x41')]),function(_0x74be4d){return{'name':_0x74be4d[_0x81ec('0x71')],'value':_0x74be4d[_0x81ec('0x2a')]};}):[]};})};}})[_0x81ec('0x27')](respondWithResult(_0x19e387,null))[_0x81ec('0x46')](function(_0x5097e0){var _0x2666cd=_0x2eceba['query'][_0x81ec('0x72')]?0x1f4:_0x5097e0[_0x81ec('0x73')]||0x1f4;logger[_0x81ec('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x81ec('0x74'),_0x2666cd,JSON['stringify'](_0x5097e0));delete _0x5097e0['name'];if(_0x2666cd===0x191){_0x2666cd=0x190;}_0x19e387[_0x81ec('0x1d')](_0x2666cd)[_0x81ec('0x2b')](_0x2eceba[_0x81ec('0x32')][_0x81ec('0x72')]?{'message':'Wrong\x20credentials','statusCode':_0x5097e0['statusCode']}:_0x5097e0);});}else{var _0x3badb5=0x1f4;_0x19e387['status'](_0x3badb5)[_0x81ec('0x2b')]({'message':_0x81ec('0x75'),'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 d106e61..6148c97 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 _0xba0e=['./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x27380a,_0x11b4db){var _0x49557d=function(_0x11984a){while(--_0x11984a){_0x27380a['push'](_0x27380a['shift']());}};_0x49557d(++_0x11b4db);}(_0xba0e,0x1b2));var _0xeba0=function(_0x510c12,_0x993d85){_0x510c12=_0x510c12-0x0;var _0x20700b=_0xba0e[_0x510c12];return _0x20700b;};'use strict';var _=require(_0xeba0('0x0'));var util=require('util');var logger=require(_0xeba0('0x1'))(_0xeba0('0x2'));var moment=require(_0xeba0('0x3'));var BPromise=require(_0xeba0('0x4'));var rp=require(_0xeba0('0x5'));var fs=require('fs');var path=require(_0xeba0('0x6'));var rimraf=require(_0xeba0('0x7'));var config=require('../../config/environment');var attributes=require(_0xeba0('0x8'));var integrations=require(_0xeba0('0x9'));module[_0xeba0('0xa')]=function(_0x60153c,_0x211be9){return _0x60153c[_0xeba0('0xb')](_0xeba0('0xc'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3289=['define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','exports'];(function(_0x1db8b0,_0x274c58){var _0xae66a=function(_0x5e5a23){while(--_0x5e5a23){_0x1db8b0['push'](_0x1db8b0['shift']());}};_0xae66a(++_0x274c58);}(_0x3289,0xcf));var _0x9328=function(_0x2ef173,_0x550274){_0x2ef173=_0x2ef173-0x0;var _0x2a30db=_0x3289[_0x2ef173];return _0x2a30db;};'use strict';var _=require('lodash');var util=require(_0x9328('0x0'));var logger=require(_0x9328('0x1'))(_0x9328('0x2'));var moment=require(_0x9328('0x3'));var BPromise=require('bluebird');var rp=require(_0x9328('0x4'));var fs=require('fs');var path=require(_0x9328('0x5'));var rimraf=require('rimraf');var config=require(_0x9328('0x6'));var attributes=require(_0x9328('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x9328('0x8')]=function(_0x1208fc,_0x1a5238){return _0x1208fc[_0x9328('0x9')](_0x9328('0xa'),attributes,{'tableName':_0x9328('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 59efbdd..cfa61ef 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 _0x6cf1=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','include','map','model','attributes','ShowSugarcrmAccount','find','moment','bluebird'];(function(_0x504e09,_0x166586){var _0x31264f=function(_0x1c436d){while(--_0x1c436d){_0x504e09['push'](_0x504e09['shift']());}};_0x31264f(++_0x166586);}(_0x6cf1,0x15e));var _0x16cf=function(_0x3926d6,_0x146405){_0x3926d6=_0x3926d6-0x0;var _0x38a15c=_0x6cf1[_0x3926d6];return _0x38a15c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x16cf('0x0'));var BPromise=require(_0x16cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16cf('0x2'));var db=require(_0x16cf('0x3'))['db'];var utils=require(_0x16cf('0x4'));var logger=require('../../config/logger')(_0x16cf('0x5'));var config=require(_0x16cf('0x6'));var jayson=require(_0x16cf('0x7'));var client=jayson[_0x16cf('0x8')][_0x16cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1993da,_0x17c8ca,_0x3b6051){return new BPromise(function(_0x1b4546,_0x5e1937){return client[_0x16cf('0xa')](_0x1993da,_0x3b6051)[_0x16cf('0xb')](function(_0x5eb9f6){logger['info'](_0x16cf('0xc'),_0x17c8ca,_0x16cf('0xd'));logger[_0x16cf('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x17c8ca,_0x16cf('0xd'),JSON[_0x16cf('0xf')](_0x5eb9f6));if(_0x5eb9f6[_0x16cf('0x10')]){if(_0x5eb9f6['error'][_0x16cf('0x11')]===0x1f4){logger[_0x16cf('0x10')](_0x16cf('0xc'),_0x17c8ca,_0x5eb9f6[_0x16cf('0x10')]['message']);return _0x5e1937(_0x5eb9f6[_0x16cf('0x10')][_0x16cf('0x12')]);}logger['error'](_0x16cf('0xc'),_0x17c8ca,_0x5eb9f6[_0x16cf('0x10')][_0x16cf('0x12')]);return _0x1b4546(_0x5eb9f6[_0x16cf('0x10')][_0x16cf('0x12')]);}else{logger[_0x16cf('0x13')](_0x16cf('0xc'),_0x17c8ca,'request\x20sent');_0x1b4546(_0x5eb9f6['result'][_0x16cf('0x12')]);}})[_0x16cf('0x14')](function(_0x4b76ad){logger[_0x16cf('0x10')](_0x16cf('0xc'),_0x17c8ca,_0x4b76ad);_0x5e1937(_0x4b76ad);});});}exports[_0x16cf('0x15')]=function(_0x3eb0a7){var _0x1b633a=this;return new Promise(function(_0x2a806e,_0x17b493){return db[_0x16cf('0x16')]['findAll']({'raw':_0x3eb0a7[_0x16cf('0x17')]?_0x3eb0a7[_0x16cf('0x17')][_0x16cf('0x18')]===undefined?!![]:![]:!![],'where':_0x3eb0a7[_0x16cf('0x17')]?_0x3eb0a7[_0x16cf('0x17')][_0x16cf('0x19')]||null:null,'attributes':_0x3eb0a7['options']?_0x3eb0a7['options']['attributes']||null:null,'limit':_0x3eb0a7[_0x16cf('0x17')]?_0x3eb0a7[_0x16cf('0x17')]['limit']||null:null,'include':_0x3eb0a7[_0x16cf('0x17')]?_0x3eb0a7[_0x16cf('0x17')][_0x16cf('0x1a')]?_[_0x16cf('0x1b')](_0x3eb0a7[_0x16cf('0x17')]['include'],function(_0x44eaca){return{'model':db[_0x44eaca[_0x16cf('0x1c')]],'as':_0x44eaca['as'],'attributes':_0x44eaca['attributes'],'include':_0x44eaca['include']?_['map'](_0x44eaca[_0x16cf('0x1a')],function(_0x4217a1){return{'model':db[_0x4217a1[_0x16cf('0x1c')]],'as':_0x4217a1['as'],'attributes':_0x4217a1[_0x16cf('0x1d')],'include':_0x4217a1[_0x16cf('0x1a')]?_[_0x16cf('0x1b')](_0x4217a1[_0x16cf('0x1a')],function(_0x251ff4){return{'model':db[_0x251ff4[_0x16cf('0x1c')]],'as':_0x251ff4['as'],'attributes':_0x251ff4[_0x16cf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x16cf('0xb')](function(_0x3283f9){logger[_0x16cf('0x13')]('GetSugarcrmAccount',_0x3eb0a7);logger[_0x16cf('0xe')](_0x16cf('0x15'),_0x3eb0a7,JSON['stringify'](_0x3283f9));_0x2a806e(_0x3283f9);})[_0x16cf('0x14')](function(_0x1500f9){logger[_0x16cf('0x10')](_0x16cf('0x15'),_0x1500f9[_0x16cf('0x12')],_0x3eb0a7);_0x17b493(_0x1b633a[_0x16cf('0x10')](0x1f4,_0x1500f9[_0x16cf('0x12')]));});});};exports[_0x16cf('0x1e')]=function(_0x5e35fe){var _0x59ae92=this;return new Promise(function(_0x1d9e57,_0x5be165){return db[_0x16cf('0x16')][_0x16cf('0x1f')]({'raw':_0x5e35fe[_0x16cf('0x17')]?_0x5e35fe[_0x16cf('0x17')][_0x16cf('0x18')]===undefined?!![]:![]:!![],'where':_0x5e35fe[_0x16cf('0x17')]?_0x5e35fe[_0x16cf('0x17')]['where']||null:null,'attributes':_0x5e35fe[_0x16cf('0x17')]?_0x5e35fe[_0x16cf('0x17')][_0x16cf('0x1d')]||null:null,'include':_0x5e35fe[_0x16cf('0x17')]?_0x5e35fe[_0x16cf('0x17')][_0x16cf('0x1a')]?_['map'](_0x5e35fe['options'][_0x16cf('0x1a')],function(_0x283488){return{'model':db[_0x283488['model']],'as':_0x283488['as'],'attributes':_0x283488[_0x16cf('0x1d')],'include':_0x283488[_0x16cf('0x1a')]?_['map'](_0x283488[_0x16cf('0x1a')],function(_0x23decb){return{'model':db[_0x23decb[_0x16cf('0x1c')]],'as':_0x23decb['as'],'attributes':_0x23decb[_0x16cf('0x1d')],'include':_0x23decb[_0x16cf('0x1a')]?_[_0x16cf('0x1b')](_0x23decb[_0x16cf('0x1a')],function(_0x2c1f2a){return{'model':db[_0x2c1f2a[_0x16cf('0x1c')]],'as':_0x2c1f2a['as'],'attributes':_0x2c1f2a[_0x16cf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x16cf('0xb')](function(_0x9009bc){logger[_0x16cf('0x13')](_0x16cf('0x1e'),_0x5e35fe);logger[_0x16cf('0xe')](_0x16cf('0x1e'),_0x5e35fe,JSON[_0x16cf('0xf')](_0x9009bc));_0x1d9e57(_0x9009bc);})[_0x16cf('0x14')](function(_0x255593){logger[_0x16cf('0x10')](_0x16cf('0x1e'),_0x255593[_0x16cf('0x12')],_0x5e35fe);_0x5be165(_0x59ae92[_0x16cf('0x10')](0x1f4,_0x255593[_0x16cf('0x12')]));});});}; \ No newline at end of file +var _0x0159=['map','model','ShowSugarcrmAccount','SugarcrmAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SugarcrmAccount,\x20%s,\x20%s','catch','GetSugarcrmAccount','options','raw','where','attributes','limit','include'];(function(_0x173088,_0x250821){var _0x5b35c9=function(_0x34f31b){while(--_0x34f31b){_0x173088['push'](_0x173088['shift']());}};_0x5b35c9(++_0x250821);}(_0x0159,0xe4));var _0x9015=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0159[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9015('0x0'));var util=require(_0x9015('0x1'));var moment=require(_0x9015('0x2'));var BPromise=require(_0x9015('0x3'));var rs=require(_0x9015('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9015('0x5'))['db'];var utils=require(_0x9015('0x6'));var logger=require(_0x9015('0x7'))(_0x9015('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9015('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30dcc1,_0x1ee0e0,_0x5a5d60){return new BPromise(function(_0x4c2f67,_0x1242a9){return client[_0x9015('0xa')](_0x30dcc1,_0x5a5d60)[_0x9015('0xb')](function(_0xbd6a22){logger[_0x9015('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0x1ee0e0,_0x9015('0xd'));logger[_0x9015('0xe')](_0x9015('0xf'),_0x1ee0e0,_0x9015('0xd'),JSON[_0x9015('0x10')](_0xbd6a22));if(_0xbd6a22[_0x9015('0x11')]){if(_0xbd6a22[_0x9015('0x11')]['code']===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x1ee0e0,_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);return _0x1242a9(_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);}logger['error'](_0x9015('0x13'),_0x1ee0e0,_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);return _0x4c2f67(_0xbd6a22[_0x9015('0x11')][_0x9015('0x12')]);}else{logger[_0x9015('0xc')](_0x9015('0x13'),_0x1ee0e0,_0x9015('0xd'));_0x4c2f67(_0xbd6a22['result'][_0x9015('0x12')]);}})[_0x9015('0x14')](function(_0x47450a){logger['error'](_0x9015('0x13'),_0x1ee0e0,_0x47450a);_0x1242a9(_0x47450a);});});}exports[_0x9015('0x15')]=function(_0x509103){var _0x362508=this;return new Promise(function(_0x5363eb,_0x12cbc5){return db['SugarcrmAccount']['findAll']({'raw':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x17')]===undefined?!![]:![]:!![],'where':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x18')]||null:null,'attributes':_0x509103[_0x9015('0x16')]?_0x509103['options'][_0x9015('0x19')]||null:null,'limit':_0x509103[_0x9015('0x16')]?_0x509103[_0x9015('0x16')][_0x9015('0x1a')]||null:null,'include':_0x509103['options']?_0x509103[_0x9015('0x16')][_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x509103[_0x9015('0x16')]['include'],function(_0x10b8b2){return{'model':db[_0x10b8b2[_0x9015('0x1d')]],'as':_0x10b8b2['as'],'attributes':_0x10b8b2['attributes'],'include':_0x10b8b2[_0x9015('0x1b')]?_['map'](_0x10b8b2[_0x9015('0x1b')],function(_0x41f0d5){return{'model':db[_0x41f0d5[_0x9015('0x1d')]],'as':_0x41f0d5['as'],'attributes':_0x41f0d5['attributes'],'include':_0x41f0d5[_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x41f0d5[_0x9015('0x1b')],function(_0xa81cbc){return{'model':db[_0xa81cbc[_0x9015('0x1d')]],'as':_0xa81cbc['as'],'attributes':_0xa81cbc[_0x9015('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9015('0xb')](function(_0x286fd9){logger['info'](_0x9015('0x15'),_0x509103);logger[_0x9015('0xe')](_0x9015('0x15'),_0x509103,JSON[_0x9015('0x10')](_0x286fd9));_0x5363eb(_0x286fd9);})[_0x9015('0x14')](function(_0x365127){logger['error']('GetSugarcrmAccount',_0x365127[_0x9015('0x12')],_0x509103);_0x12cbc5(_0x362508['error'](0x1f4,_0x365127[_0x9015('0x12')]));});});};exports[_0x9015('0x1e')]=function(_0x1d4401){var _0x3f6586=this;return new Promise(function(_0x2ba601,_0x7c66f1){return db[_0x9015('0x1f')]['find']({'raw':_0x1d4401[_0x9015('0x16')]?_0x1d4401['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d4401[_0x9015('0x16')]?_0x1d4401['options'][_0x9015('0x18')]||null:null,'attributes':_0x1d4401['options']?_0x1d4401[_0x9015('0x16')][_0x9015('0x19')]||null:null,'include':_0x1d4401[_0x9015('0x16')]?_0x1d4401[_0x9015('0x16')]['include']?_[_0x9015('0x1c')](_0x1d4401['options']['include'],function(_0x41d76e){return{'model':db[_0x41d76e[_0x9015('0x1d')]],'as':_0x41d76e['as'],'attributes':_0x41d76e[_0x9015('0x19')],'include':_0x41d76e[_0x9015('0x1b')]?_['map'](_0x41d76e['include'],function(_0x14638a){return{'model':db[_0x14638a[_0x9015('0x1d')]],'as':_0x14638a['as'],'attributes':_0x14638a[_0x9015('0x19')],'include':_0x14638a[_0x9015('0x1b')]?_[_0x9015('0x1c')](_0x14638a[_0x9015('0x1b')],function(_0x3c63b2){return{'model':db[_0x3c63b2[_0x9015('0x1d')]],'as':_0x3c63b2['as'],'attributes':_0x3c63b2[_0x9015('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9015('0xb')](function(_0x3dbad6){logger['info']('ShowSugarcrmAccount',_0x1d4401);logger[_0x9015('0xe')](_0x9015('0x1e'),_0x1d4401,JSON[_0x9015('0x10')](_0x3dbad6));_0x2ba601(_0x3dbad6);})[_0x9015('0x14')](function(_0x115245){logger[_0x9015('0x11')](_0x9015('0x1e'),_0x115245['message'],_0x1d4401);_0x7c66f1(_0x3f6586['error'](0x1f4,_0x115245[_0x9015('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8ac2941..d44b95e 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 _0x6452=['/:id/subjects','getSubjects','getDescriptions','post','create','/:id','update','delete','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x47aa39,_0x519353){var _0x470a51=function(_0x49a7a5){while(--_0x49a7a5){_0x47aa39['push'](_0x47aa39['shift']());}};_0x470a51(++_0x519353);}(_0x6452,0x148));var _0x2645=function(_0x44a3b0,_0x352810){_0x44a3b0=_0x44a3b0-0x0;var _0x39e6f6=_0x6452[_0x44a3b0];return _0x39e6f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2645('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2645('0x1')]();var fs_extra=require(_0x2645('0x2'));var auth=require(_0x2645('0x3'));var interaction=require(_0x2645('0x4'));var config=require(_0x2645('0x5'));var controller=require(_0x2645('0x6'));router[_0x2645('0x7')]('/',auth[_0x2645('0x8')](),controller[_0x2645('0x9')]);router['get']('/:id',auth[_0x2645('0x8')](),controller[_0x2645('0xa')]);router[_0x2645('0x7')](_0x2645('0xb'),auth[_0x2645('0x8')](),controller['getFields']);router[_0x2645('0x7')](_0x2645('0xc'),auth[_0x2645('0x8')](),controller[_0x2645('0xd')]);router[_0x2645('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2645('0xe')]);router[_0x2645('0xf')]('/',auth[_0x2645('0x8')](),controller[_0x2645('0x10')]);router['put'](_0x2645('0x11'),auth['isAuthenticated'](),controller[_0x2645('0x12')]);router[_0x2645('0x13')](_0x2645('0x11'),auth[_0x2645('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xda5f=['../../components/auth/service','get','index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','delete','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1476f9,_0x2a692){var _0x486826=function(_0x1ff12c){while(--_0x1ff12c){_0x1476f9['push'](_0x1476f9['shift']());}};_0x486826(++_0x2a692);}(_0xda5f,0xa2));var _0xfda5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda5f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfda5('0x0'));var util=require(_0xfda5('0x1'));var path=require('path');var timeout=require(_0xfda5('0x2'));var express=require(_0xfda5('0x3'));var router=express[_0xfda5('0x4')]();var fs_extra=require(_0xfda5('0x5'));var auth=require(_0xfda5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xfda5('0x7')]('/',auth['isAuthenticated'](),controller[_0xfda5('0x8')]);router[_0xfda5('0x7')]('/:id',auth[_0xfda5('0x9')](),controller[_0xfda5('0xa')]);router[_0xfda5('0x7')](_0xfda5('0xb'),auth[_0xfda5('0x9')](),controller[_0xfda5('0xc')]);router[_0xfda5('0x7')](_0xfda5('0xd'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xfda5('0x7')](_0xfda5('0xe'),auth[_0xfda5('0x9')](),controller[_0xfda5('0xf')]);router[_0xfda5('0x10')]('/',auth[_0xfda5('0x9')](),controller[_0xfda5('0x11')]);router[_0xfda5('0x12')](_0xfda5('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xfda5('0x14')](_0xfda5('0x13'),auth[_0xfda5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 974e9ce..12a7cd1 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 _0x4202=['STRING','sequelize','exports'];(function(_0x4f6ca4,_0x5c1b25){var _0x10e0b5=function(_0x2de60a){while(--_0x2de60a){_0x4f6ca4['push'](_0x4f6ca4['shift']());}};_0x10e0b5(++_0x5c1b25);}(_0x4202,0x12d));var _0x2420=function(_0x11162d,_0x3c7e4f){_0x11162d=_0x11162d-0x0;var _0x5f4aeb=_0x4202[_0x11162d];return _0x5f4aeb;};'use strict';var Sequelize=require(_0x2420('0x0'));module[_0x2420('0x1')]={'name':{'type':Sequelize[_0x2420('0x2')]},'description':{'type':Sequelize[_0x2420('0x2')]}}; \ No newline at end of file +var _0xa298=['sequelize','STRING'];(function(_0x3c12a1,_0x192488){var _0x3dd517=function(_0x41999a){while(--_0x41999a){_0x3c12a1['push'](_0x3c12a1['shift']());}};_0x3dd517(++_0x192488);}(_0xa298,0x90));var _0x8a29=function(_0x15d6da,_0x76d6e2){_0x15d6da=_0x15d6da-0x0;var _0x3a1c3f=_0xa298[_0x15d6da];return _0x3a1c3f;};'use strict';var Sequelize=require(_0x8a29('0x0'));module['exports']={'name':{'type':Sequelize[_0x8a29('0x1')]},'description':{'type':Sequelize[_0x8a29('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index aac78f6..7e1dd60 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 _0x8b69=['rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','includeAll','find','catch','create','body','getFields','findOne','SugarcrmField','sort','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration'];(function(_0x10ef85,_0x243891){var _0x3649e1=function(_0x7fddee){while(--_0x7fddee){_0x10ef85['push'](_0x10ef85['shift']());}};_0x3649e1(++_0x243891);}(_0x8b69,0xba));var _0x98b6=function(_0xffdfd8,_0x399c62){_0xffdfd8=_0xffdfd8-0x0;var _0x3698b7=_0x8b69[_0xffdfd8];return _0x3698b7;};'use strict';var emlformat=require(_0x98b6('0x0'));var rimraf=require(_0x98b6('0x1'));var zipdir=require(_0x98b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x98b6('0x3'));var BPromise=require(_0x98b6('0x4'));var Mustache=require(_0x98b6('0x5'));var util=require(_0x98b6('0x6'));var path=require(_0x98b6('0x7'));var sox=require('sox');var csv=require(_0x98b6('0x8'));var ejs=require(_0x98b6('0x9'));var fs=require('fs');var fs_extra=require(_0x98b6('0xa'));var _=require(_0x98b6('0xb'));var squel=require(_0x98b6('0xc'));var crypto=require(_0x98b6('0xd'));var jsforce=require(_0x98b6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x98b6('0x8'));var querystring=require(_0x98b6('0xf'));var Papa=require(_0x98b6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x98b6('0x11'));var as=require(_0x98b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98b6('0x13'))(_0x98b6('0x14'));var utils=require(_0x98b6('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4658af,_0x149c62){_0x149c62=_0x149c62||0xcc;return function(_0x27b70e){if(_0x27b70e){return _0x4658af['sendStatus'](_0x149c62);}return _0x4658af[_0x98b6('0x16')](_0x149c62)[_0x98b6('0x17')]();};}function respondWithResult(_0x2af0c9,_0x208ce1){_0x208ce1=_0x208ce1||0xc8;return function(_0x39d69c){if(_0x39d69c){return _0x2af0c9[_0x98b6('0x16')](_0x208ce1)[_0x98b6('0x18')](_0x39d69c);}};}function respondWithFilteredResult(_0x1b1ab8,_0x2d179e){return function(_0x5b5b4d){if(_0x5b5b4d){var _0xdbe97e=typeof _0x2d179e[_0x98b6('0x19')]==='undefined'&&typeof _0x2d179e[_0x98b6('0x1a')]===_0x98b6('0x1b');var _0x3e1936=_0x5b5b4d[_0x98b6('0x1c')];var _0x4f5575=_0xdbe97e?0x0:_0x2d179e[_0x98b6('0x19')];var _0x13a433=_0xdbe97e?_0x5b5b4d[_0x98b6('0x1c')]:_0x2d179e['offset']+_0x2d179e[_0x98b6('0x1a')];var _0x53378a;if(_0x13a433>=_0x3e1936){_0x13a433=_0x3e1936;_0x53378a=0xc8;}else{_0x53378a=0xce;}_0x1b1ab8[_0x98b6('0x16')](_0x53378a);return _0x1b1ab8[_0x98b6('0x1d')]('Content-Range',_0x4f5575+'-'+_0x13a433+'/'+_0x3e1936)[_0x98b6('0x18')](_0x5b5b4d);}return null;};}function patchUpdates(_0x4e8ea3){return function(_0x3593ba){try{jsonpatch[_0x98b6('0x1e')](_0x3593ba,_0x4e8ea3,!![]);}catch(_0x2edbeb){return BPromise['reject'](_0x2edbeb);}return _0x3593ba[_0x98b6('0x1f')]();};}function saveUpdates(_0x173139,_0x1e853c){return function(_0x1a1862){if(_0x1a1862){return _0x1a1862[_0x98b6('0x20')](_0x173139)[_0x98b6('0x21')](function(_0x329ff3){return _0x329ff3;});}return null;};}function removeEntity(_0x2888df,_0x42ed33){return function(_0x4c6b5c){if(_0x4c6b5c){return _0x4c6b5c[_0x98b6('0x22')]()['then'](function(){_0x2888df[_0x98b6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fa2c8,_0x4e1998){return function(_0x49e0a1){if(!_0x49e0a1){_0x1fa2c8['sendStatus'](0x194);}return _0x49e0a1;};}function handleError(_0x17fa1c,_0x55ee85){_0x55ee85=_0x55ee85||0x1f4;return function(_0x16da44){logger[_0x98b6('0x23')](_0x16da44[_0x98b6('0x24')]);if(_0x16da44[_0x98b6('0x25')]){delete _0x16da44['name'];}_0x17fa1c[_0x98b6('0x16')](_0x55ee85)[_0x98b6('0x26')](_0x16da44);};}exports[_0x98b6('0x27')]=function(_0x4acc82,_0x1b8b34){var _0x54b9da={},_0x53b71b={},_0x21dd5b={'count':0x0,'rows':[]};var _0x3a1765=_[_0x98b6('0x28')](db[_0x98b6('0x29')][_0x98b6('0x2a')],function(_0xca1669){return{'name':_0xca1669[_0x98b6('0x2b')],'type':_0xca1669[_0x98b6('0x2c')]['key']};});_0x53b71b[_0x98b6('0x2d')]=_[_0x98b6('0x28')](_0x3a1765,_0x98b6('0x25'));_0x53b71b['query']=_[_0x98b6('0x2e')](_0x4acc82[_0x98b6('0x2f')]);_0x53b71b['filters']=_[_0x98b6('0x30')](_0x53b71b[_0x98b6('0x2d')],_0x53b71b[_0x98b6('0x2f')]);_0x54b9da['attributes']=_[_0x98b6('0x30')](_0x53b71b[_0x98b6('0x2d')],qs[_0x98b6('0x31')](_0x4acc82['query'][_0x98b6('0x31')]));_0x54b9da[_0x98b6('0x32')]=_0x54b9da[_0x98b6('0x32')][_0x98b6('0x33')]?_0x54b9da[_0x98b6('0x32')]:_0x53b71b[_0x98b6('0x2d')];if(!_0x4acc82['query'][_0x98b6('0x34')](_0x98b6('0x35'))){_0x54b9da[_0x98b6('0x1a')]=qs[_0x98b6('0x1a')](_0x4acc82['query']['limit']);_0x54b9da['offset']=qs[_0x98b6('0x19')](_0x4acc82[_0x98b6('0x2f')][_0x98b6('0x19')]);}_0x54b9da[_0x98b6('0x36')]=qs['sort'](_0x4acc82[_0x98b6('0x2f')]['sort']);_0x54b9da[_0x98b6('0x37')]=qs[_0x98b6('0x38')](_[_0x98b6('0x39')](_0x4acc82[_0x98b6('0x2f')],_0x53b71b[_0x98b6('0x38')]),_0x3a1765);if(_0x4acc82['query'][_0x98b6('0x3a')]){_0x54b9da[_0x98b6('0x37')]=_[_0x98b6('0x3b')](_0x54b9da[_0x98b6('0x37')],{'$or':_['map'](_0x3a1765,function(_0x3bd338){if(_0x3bd338['type']!==_0x98b6('0x3c')){var _0x371757={};_0x371757[_0x3bd338['name']]={'$like':'%'+_0x4acc82[_0x98b6('0x2f')]['filter']+'%'};return _0x371757;}})});}_0x54b9da=_[_0x98b6('0x3b')]({},_0x54b9da,_0x4acc82[_0x98b6('0x3d')]);var _0x52181a={'where':_0x54b9da[_0x98b6('0x37')]};return db['SugarcrmConfiguration']['count'](_0x52181a)['then'](function(_0x298bae){_0x21dd5b['count']=_0x298bae;if(_0x4acc82[_0x98b6('0x2f')]['includeAll']){_0x54b9da[_0x98b6('0x3e')]=[{'all':!![]}];}return db[_0x98b6('0x29')]['findAll'](_0x54b9da);})[_0x98b6('0x21')](function(_0x4fd00d){_0x21dd5b[_0x98b6('0x3f')]=_0x4fd00d;return _0x21dd5b;})[_0x98b6('0x21')](respondWithFilteredResult(_0x1b8b34,_0x54b9da))['catch'](handleError(_0x1b8b34,null));};exports['show']=function(_0x1af218,_0x38fe47){var _0xb91071={'raw':![],'where':{'id':_0x1af218[_0x98b6('0x40')]['id']}},_0x3bd1ac={};_0x3bd1ac[_0x98b6('0x2d')]=_['keys'](db[_0x98b6('0x29')][_0x98b6('0x2a')]);_0x3bd1ac[_0x98b6('0x2f')]=_[_0x98b6('0x2e')](_0x1af218['query']);_0x3bd1ac[_0x98b6('0x38')]=_[_0x98b6('0x30')](_0x3bd1ac[_0x98b6('0x2d')],_0x3bd1ac[_0x98b6('0x2f')]);_0xb91071['attributes']=_['intersection'](_0x3bd1ac['model'],qs[_0x98b6('0x31')](_0x1af218[_0x98b6('0x2f')][_0x98b6('0x31')]));_0xb91071['attributes']=_0xb91071[_0x98b6('0x32')][_0x98b6('0x33')]?_0xb91071[_0x98b6('0x32')]:_0x3bd1ac['model'];if(_0x1af218[_0x98b6('0x2f')][_0x98b6('0x41')]){_0xb91071['include']=[{'all':!![]}];}_0xb91071=_[_0x98b6('0x3b')]({},_0xb91071,_0x1af218['options']);return db[_0x98b6('0x29')][_0x98b6('0x42')](_0xb91071)[_0x98b6('0x21')](handleEntityNotFound(_0x38fe47,null))[_0x98b6('0x21')](respondWithResult(_0x38fe47,null))[_0x98b6('0x43')](handleError(_0x38fe47,null));};exports[_0x98b6('0x44')]=function(_0xa8363d,_0x4acbdb){return db[_0x98b6('0x29')][_0x98b6('0x44')](_0xa8363d[_0x98b6('0x45')],{})['then'](respondWithResult(_0x4acbdb,0xc9))[_0x98b6('0x43')](handleError(_0x4acbdb,null));};exports[_0x98b6('0x20')]=function(_0x655939,_0x390605){if(_0x655939[_0x98b6('0x45')]['id']){delete _0x655939[_0x98b6('0x45')]['id'];}return db[_0x98b6('0x29')][_0x98b6('0x42')]({'where':{'id':_0x655939[_0x98b6('0x40')]['id']}})[_0x98b6('0x21')](handleEntityNotFound(_0x390605,null))['then'](saveUpdates(_0x655939[_0x98b6('0x45')],null))[_0x98b6('0x21')](respondWithResult(_0x390605,null))[_0x98b6('0x43')](handleError(_0x390605,null));};exports['destroy']=function(_0x279797,_0x203f1f){return db[_0x98b6('0x29')][_0x98b6('0x42')]({'where':{'id':_0x279797['params']['id']}})[_0x98b6('0x21')](handleEntityNotFound(_0x203f1f,null))[_0x98b6('0x21')](removeEntity(_0x203f1f,null))['catch'](handleError(_0x203f1f,null));};exports[_0x98b6('0x46')]=function(_0x55ff77,_0x2cc610,_0x51da99){var _0x1f65b4={};var _0xc8c548={};var _0x61f9ac;var _0x45df23;return db[_0x98b6('0x29')][_0x98b6('0x47')]({'where':{'id':_0x55ff77[_0x98b6('0x40')]['id']}})[_0x98b6('0x21')](handleEntityNotFound(_0x2cc610,null))['then'](function(_0x491eb0){if(_0x491eb0){_0x61f9ac=_0x491eb0;_0xc8c548[_0x98b6('0x2d')]=_[_0x98b6('0x2e')](db[_0x98b6('0x48')]['rawAttributes']);_0xc8c548[_0x98b6('0x2f')]=_['keys'](_0x55ff77[_0x98b6('0x2f')]);_0xc8c548[_0x98b6('0x38')]=_[_0x98b6('0x30')](_0xc8c548[_0x98b6('0x2d')],_0xc8c548[_0x98b6('0x2f')]);_0x1f65b4[_0x98b6('0x32')]=_[_0x98b6('0x30')](_0xc8c548[_0x98b6('0x2d')],qs['fields'](_0x55ff77['query'][_0x98b6('0x31')]));_0x1f65b4[_0x98b6('0x32')]=_0x1f65b4[_0x98b6('0x32')][_0x98b6('0x33')]?_0x1f65b4[_0x98b6('0x32')]:_0xc8c548[_0x98b6('0x2d')];_0x1f65b4[_0x98b6('0x36')]=qs[_0x98b6('0x49')](_0x55ff77['query'][_0x98b6('0x49')]);_0x1f65b4[_0x98b6('0x37')]=qs[_0x98b6('0x38')](_[_0x98b6('0x39')](_0x55ff77['query'],_0xc8c548[_0x98b6('0x38')]));if(_0x55ff77[_0x98b6('0x2f')][_0x98b6('0x3a')]){_0x1f65b4[_0x98b6('0x37')]=_[_0x98b6('0x3b')](_0x1f65b4[_0x98b6('0x37')],{'$or':_[_0x98b6('0x28')](_0x1f65b4[_0x98b6('0x32')],function(_0x53dd0a){var _0xeab3e9={};_0xeab3e9[_0x53dd0a]={'$like':'%'+_0x55ff77[_0x98b6('0x2f')]['filter']+'%'};return _0xeab3e9;})});}_0x1f65b4=_['merge']({},_0x1f65b4,_0x55ff77[_0x98b6('0x3d')]);return _0x61f9ac['getFields'](_0x1f65b4);}})[_0x98b6('0x21')](function(_0x29e65a){if(_0x29e65a){_0x45df23=_0x29e65a[_0x98b6('0x33')];if(!_0x55ff77[_0x98b6('0x2f')][_0x98b6('0x34')](_0x98b6('0x35'))){_0x1f65b4['limit']=qs[_0x98b6('0x1a')](_0x55ff77[_0x98b6('0x2f')][_0x98b6('0x1a')]);_0x1f65b4[_0x98b6('0x19')]=qs[_0x98b6('0x19')](_0x55ff77['query'][_0x98b6('0x19')]);}return _0x61f9ac[_0x98b6('0x46')](_0x1f65b4);}})[_0x98b6('0x21')](function(_0x46c153){if(_0x46c153){return _0x46c153?{'count':_0x45df23,'rows':_0x46c153}:null;}})['then'](respondWithResult(_0x2cc610,null))[_0x98b6('0x43')](handleError(_0x2cc610,null));};exports[_0x98b6('0x4a')]=function(_0x3f5b12,_0x3ad062,_0x3c6339){var _0x278386={};var _0x52909a={};var _0x512abf;var _0x5cf2f8;return db['SugarcrmConfiguration'][_0x98b6('0x47')]({'where':{'id':_0x3f5b12[_0x98b6('0x40')]['id']}})[_0x98b6('0x21')](handleEntityNotFound(_0x3ad062,null))['then'](function(_0x4631ad){if(_0x4631ad){_0x512abf=_0x4631ad;_0x52909a[_0x98b6('0x2d')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x52909a[_0x98b6('0x2f')]=_['keys'](_0x3f5b12[_0x98b6('0x2f')]);_0x52909a[_0x98b6('0x38')]=_['intersection'](_0x52909a[_0x98b6('0x2d')],_0x52909a[_0x98b6('0x2f')]);_0x278386[_0x98b6('0x32')]=_[_0x98b6('0x30')](_0x52909a[_0x98b6('0x2d')],qs[_0x98b6('0x31')](_0x3f5b12[_0x98b6('0x2f')][_0x98b6('0x31')]));_0x278386[_0x98b6('0x32')]=_0x278386['attributes'][_0x98b6('0x33')]?_0x278386[_0x98b6('0x32')]:_0x52909a[_0x98b6('0x2d')];_0x278386[_0x98b6('0x36')]=qs['sort'](_0x3f5b12[_0x98b6('0x2f')][_0x98b6('0x49')]);_0x278386['where']=qs[_0x98b6('0x38')](_[_0x98b6('0x39')](_0x3f5b12['query'],_0x52909a['filters']));if(_0x3f5b12[_0x98b6('0x2f')][_0x98b6('0x3a')]){_0x278386['where']=_[_0x98b6('0x3b')](_0x278386[_0x98b6('0x37')],{'$or':_[_0x98b6('0x28')](_0x278386[_0x98b6('0x32')],function(_0x27ca24){var _0x1746c0={};_0x1746c0[_0x27ca24]={'$like':'%'+_0x3f5b12[_0x98b6('0x2f')][_0x98b6('0x3a')]+'%'};return _0x1746c0;})});}_0x278386=_['merge']({},_0x278386,_0x3f5b12[_0x98b6('0x3d')]);return _0x512abf['getSubjects'](_0x278386);}})['then'](function(_0x1a84ba){if(_0x1a84ba){_0x5cf2f8=_0x1a84ba[_0x98b6('0x33')];if(!_0x3f5b12[_0x98b6('0x2f')]['hasOwnProperty'](_0x98b6('0x35'))){_0x278386['limit']=qs[_0x98b6('0x1a')](_0x3f5b12['query'][_0x98b6('0x1a')]);_0x278386[_0x98b6('0x19')]=qs[_0x98b6('0x19')](_0x3f5b12['query'][_0x98b6('0x19')]);}return _0x512abf['getSubjects'](_0x278386);}})[_0x98b6('0x21')](function(_0x2631e3){if(_0x2631e3){return _0x2631e3?{'count':_0x5cf2f8,'rows':_0x2631e3}:null;}})['then'](respondWithResult(_0x3ad062,null))[_0x98b6('0x43')](handleError(_0x3ad062,null));};exports[_0x98b6('0x4b')]=function(_0x27f577,_0x6a767c,_0x4131ab){var _0x158981={};var _0x303197={};var _0x22843c;var _0x1ea54f;return db[_0x98b6('0x29')]['findOne']({'where':{'id':_0x27f577[_0x98b6('0x40')]['id']}})[_0x98b6('0x21')](handleEntityNotFound(_0x6a767c,null))['then'](function(_0x4009bb){if(_0x4009bb){_0x22843c=_0x4009bb;_0x303197['model']=_['keys'](db[_0x98b6('0x48')][_0x98b6('0x2a')]);_0x303197['query']=_['keys'](_0x27f577['query']);_0x303197[_0x98b6('0x38')]=_[_0x98b6('0x30')](_0x303197['model'],_0x303197[_0x98b6('0x2f')]);_0x158981[_0x98b6('0x32')]=_[_0x98b6('0x30')](_0x303197[_0x98b6('0x2d')],qs['fields'](_0x27f577[_0x98b6('0x2f')][_0x98b6('0x31')]));_0x158981[_0x98b6('0x32')]=_0x158981[_0x98b6('0x32')][_0x98b6('0x33')]?_0x158981['attributes']:_0x303197[_0x98b6('0x2d')];_0x158981[_0x98b6('0x36')]=qs[_0x98b6('0x49')](_0x27f577[_0x98b6('0x2f')][_0x98b6('0x49')]);_0x158981[_0x98b6('0x37')]=qs['filters'](_['pick'](_0x27f577[_0x98b6('0x2f')],_0x303197[_0x98b6('0x38')]));if(_0x27f577[_0x98b6('0x2f')][_0x98b6('0x3a')]){_0x158981[_0x98b6('0x37')]=_[_0x98b6('0x3b')](_0x158981[_0x98b6('0x37')],{'$or':_[_0x98b6('0x28')](_0x158981[_0x98b6('0x32')],function(_0x5c49b7){var _0x5dbe1d={};_0x5dbe1d[_0x5c49b7]={'$like':'%'+_0x27f577[_0x98b6('0x2f')][_0x98b6('0x3a')]+'%'};return _0x5dbe1d;})});}_0x158981=_['merge']({},_0x158981,_0x27f577[_0x98b6('0x3d')]);return _0x22843c['getDescriptions'](_0x158981);}})[_0x98b6('0x21')](function(_0x3ee7de){if(_0x3ee7de){_0x1ea54f=_0x3ee7de[_0x98b6('0x33')];if(!_0x27f577[_0x98b6('0x2f')][_0x98b6('0x34')](_0x98b6('0x35'))){_0x158981[_0x98b6('0x1a')]=qs[_0x98b6('0x1a')](_0x27f577[_0x98b6('0x2f')]['limit']);_0x158981[_0x98b6('0x19')]=qs[_0x98b6('0x19')](_0x27f577[_0x98b6('0x2f')]['offset']);}return _0x22843c[_0x98b6('0x4b')](_0x158981);}})[_0x98b6('0x21')](function(_0x52a0ae){if(_0x52a0ae){return _0x52a0ae?{'count':_0x1ea54f,'rows':_0x52a0ae}:null;}})[_0x98b6('0x21')](respondWithResult(_0x6a767c,null))[_0x98b6('0x43')](handleError(_0x6a767c,null));}; \ No newline at end of file +var _0x4cf4=['pick','filter','merge','options','SugarcrmConfiguration','includeAll','include','findAll','catch','show','params','length','find','create','body','getFields','findOne','SugarcrmField','order','getSubjects','nolimit','getDescriptions','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x4cf4,0x64));var _0x44cf=function(_0x162d23,_0x7e479b){_0x162d23=_0x162d23-0x0;var _0x3c9914=_0x4cf4[_0x162d23];return _0x3c9914;};'use strict';var emlformat=require(_0x44cf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x44cf('0x1'));var moment=require(_0x44cf('0x2'));var BPromise=require(_0x44cf('0x3'));var Mustache=require('mustache');var util=require(_0x44cf('0x4'));var path=require(_0x44cf('0x5'));var sox=require(_0x44cf('0x6'));var csv=require(_0x44cf('0x7'));var ejs=require(_0x44cf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44cf('0x9'));var squel=require(_0x44cf('0xa'));var crypto=require(_0x44cf('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x44cf('0xc'));var toCsv=require('to-csv');var querystring=require(_0x44cf('0xd'));var Papa=require(_0x44cf('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44cf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cf('0x10'));var logger=require(_0x44cf('0x11'))(_0x44cf('0x12'));var utils=require(_0x44cf('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x44cf('0x14'))['db'];function respondWithStatusCode(_0x454e3a,_0xa8148c){_0xa8148c=_0xa8148c||0xcc;return function(_0xfe368f){if(_0xfe368f){return _0x454e3a[_0x44cf('0x15')](_0xa8148c);}return _0x454e3a[_0x44cf('0x16')](_0xa8148c)[_0x44cf('0x17')]();};}function respondWithResult(_0x1a1d4f,_0x2ff38f){_0x2ff38f=_0x2ff38f||0xc8;return function(_0x23e58c){if(_0x23e58c){return _0x1a1d4f['status'](_0x2ff38f)[_0x44cf('0x18')](_0x23e58c);}};}function respondWithFilteredResult(_0x4807b6,_0x564ada){return function(_0x340ff4){if(_0x340ff4){var _0x3ef8de=typeof _0x564ada['offset']===_0x44cf('0x19')&&typeof _0x564ada[_0x44cf('0x1a')]===_0x44cf('0x19');var _0x4d1ef4=_0x340ff4[_0x44cf('0x1b')];var _0x51099e=_0x3ef8de?0x0:_0x564ada[_0x44cf('0x1c')];var _0x4e1c05=_0x3ef8de?_0x340ff4['count']:_0x564ada['offset']+_0x564ada[_0x44cf('0x1a')];var _0x31835b;if(_0x4e1c05>=_0x4d1ef4){_0x4e1c05=_0x4d1ef4;_0x31835b=0xc8;}else{_0x31835b=0xce;}_0x4807b6['status'](_0x31835b);return _0x4807b6['set'](_0x44cf('0x1d'),_0x51099e+'-'+_0x4e1c05+'/'+_0x4d1ef4)['json'](_0x340ff4);}return null;};}function patchUpdates(_0x3fb123){return function(_0x228888){try{jsonpatch[_0x44cf('0x1e')](_0x228888,_0x3fb123,!![]);}catch(_0x326213){return BPromise[_0x44cf('0x1f')](_0x326213);}return _0x228888[_0x44cf('0x20')]();};}function saveUpdates(_0x2c4068,_0x444b33){return function(_0x221c79){if(_0x221c79){return _0x221c79[_0x44cf('0x21')](_0x2c4068)[_0x44cf('0x22')](function(_0x4faaa8){return _0x4faaa8;});}return null;};}function removeEntity(_0x17e848,_0x2fb074){return function(_0x2886d9){if(_0x2886d9){return _0x2886d9[_0x44cf('0x23')]()['then'](function(){_0x17e848[_0x44cf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c30db,_0x112604){return function(_0xf0d026){if(!_0xf0d026){_0x1c30db[_0x44cf('0x15')](0x194);}return _0xf0d026;};}function handleError(_0x1becc7,_0x50ef84){_0x50ef84=_0x50ef84||0x1f4;return function(_0x2befcd){logger[_0x44cf('0x24')](_0x2befcd[_0x44cf('0x25')]);if(_0x2befcd[_0x44cf('0x26')]){delete _0x2befcd['name'];}_0x1becc7[_0x44cf('0x16')](_0x50ef84)[_0x44cf('0x27')](_0x2befcd);};}exports[_0x44cf('0x28')]=function(_0x53d39a,_0x2fc4c9){var _0x1d5da9={},_0x428217={},_0x4e0e0e={'count':0x0,'rows':[]};var _0x288bbb=_[_0x44cf('0x29')](db['SugarcrmConfiguration'][_0x44cf('0x2a')],function(_0x293022){return{'name':_0x293022[_0x44cf('0x2b')],'type':_0x293022[_0x44cf('0x2c')][_0x44cf('0x2d')]};});_0x428217[_0x44cf('0x2e')]=_['map'](_0x288bbb,_0x44cf('0x26'));_0x428217[_0x44cf('0x2f')]=_[_0x44cf('0x30')](_0x53d39a[_0x44cf('0x2f')]);_0x428217[_0x44cf('0x31')]=_[_0x44cf('0x32')](_0x428217[_0x44cf('0x2e')],_0x428217[_0x44cf('0x2f')]);_0x1d5da9[_0x44cf('0x33')]=_['intersection'](_0x428217[_0x44cf('0x2e')],qs[_0x44cf('0x34')](_0x53d39a[_0x44cf('0x2f')][_0x44cf('0x34')]));_0x1d5da9['attributes']=_0x1d5da9[_0x44cf('0x33')]['length']?_0x1d5da9[_0x44cf('0x33')]:_0x428217[_0x44cf('0x2e')];if(!_0x53d39a[_0x44cf('0x2f')][_0x44cf('0x35')]('nolimit')){_0x1d5da9[_0x44cf('0x1a')]=qs['limit'](_0x53d39a['query'][_0x44cf('0x1a')]);_0x1d5da9['offset']=qs[_0x44cf('0x1c')](_0x53d39a['query']['offset']);}_0x1d5da9['order']=qs[_0x44cf('0x36')](_0x53d39a['query'][_0x44cf('0x36')]);_0x1d5da9[_0x44cf('0x37')]=qs['filters'](_[_0x44cf('0x38')](_0x53d39a['query'],_0x428217[_0x44cf('0x31')]),_0x288bbb);if(_0x53d39a[_0x44cf('0x2f')][_0x44cf('0x39')]){_0x1d5da9['where']=_[_0x44cf('0x3a')](_0x1d5da9[_0x44cf('0x37')],{'$or':_['map'](_0x288bbb,function(_0x653d7c){if(_0x653d7c[_0x44cf('0x2c')]!=='VIRTUAL'){var _0x3b3af0={};_0x3b3af0[_0x653d7c['name']]={'$like':'%'+_0x53d39a[_0x44cf('0x2f')][_0x44cf('0x39')]+'%'};return _0x3b3af0;}})});}_0x1d5da9=_[_0x44cf('0x3a')]({},_0x1d5da9,_0x53d39a[_0x44cf('0x3b')]);var _0x1e60e3={'where':_0x1d5da9['where']};return db[_0x44cf('0x3c')][_0x44cf('0x1b')](_0x1e60e3)[_0x44cf('0x22')](function(_0x1b93c8){_0x4e0e0e[_0x44cf('0x1b')]=_0x1b93c8;if(_0x53d39a[_0x44cf('0x2f')][_0x44cf('0x3d')]){_0x1d5da9[_0x44cf('0x3e')]=[{'all':!![]}];}return db[_0x44cf('0x3c')][_0x44cf('0x3f')](_0x1d5da9);})[_0x44cf('0x22')](function(_0x2df8ba){_0x4e0e0e['rows']=_0x2df8ba;return _0x4e0e0e;})[_0x44cf('0x22')](respondWithFilteredResult(_0x2fc4c9,_0x1d5da9))[_0x44cf('0x40')](handleError(_0x2fc4c9,null));};exports[_0x44cf('0x41')]=function(_0x1b2842,_0x1598ee){var _0x2a4cdf={'raw':![],'where':{'id':_0x1b2842[_0x44cf('0x42')]['id']}},_0x51fbe3={};_0x51fbe3[_0x44cf('0x2e')]=_[_0x44cf('0x30')](db['SugarcrmConfiguration'][_0x44cf('0x2a')]);_0x51fbe3[_0x44cf('0x2f')]=_[_0x44cf('0x30')](_0x1b2842[_0x44cf('0x2f')]);_0x51fbe3[_0x44cf('0x31')]=_[_0x44cf('0x32')](_0x51fbe3[_0x44cf('0x2e')],_0x51fbe3[_0x44cf('0x2f')]);_0x2a4cdf['attributes']=_[_0x44cf('0x32')](_0x51fbe3['model'],qs[_0x44cf('0x34')](_0x1b2842[_0x44cf('0x2f')][_0x44cf('0x34')]));_0x2a4cdf[_0x44cf('0x33')]=_0x2a4cdf[_0x44cf('0x33')][_0x44cf('0x43')]?_0x2a4cdf[_0x44cf('0x33')]:_0x51fbe3[_0x44cf('0x2e')];if(_0x1b2842['query'][_0x44cf('0x3d')]){_0x2a4cdf['include']=[{'all':!![]}];}_0x2a4cdf=_['merge']({},_0x2a4cdf,_0x1b2842[_0x44cf('0x3b')]);return db['SugarcrmConfiguration'][_0x44cf('0x44')](_0x2a4cdf)[_0x44cf('0x22')](handleEntityNotFound(_0x1598ee,null))['then'](respondWithResult(_0x1598ee,null))['catch'](handleError(_0x1598ee,null));};exports['create']=function(_0x1f2be4,_0x47981d){return db[_0x44cf('0x3c')][_0x44cf('0x45')](_0x1f2be4['body'],{})['then'](respondWithResult(_0x47981d,0xc9))[_0x44cf('0x40')](handleError(_0x47981d,null));};exports[_0x44cf('0x21')]=function(_0x253c45,_0x21df7a){if(_0x253c45['body']['id']){delete _0x253c45[_0x44cf('0x46')]['id'];}return db['SugarcrmConfiguration'][_0x44cf('0x44')]({'where':{'id':_0x253c45[_0x44cf('0x42')]['id']}})['then'](handleEntityNotFound(_0x21df7a,null))[_0x44cf('0x22')](saveUpdates(_0x253c45['body'],null))[_0x44cf('0x22')](respondWithResult(_0x21df7a,null))[_0x44cf('0x40')](handleError(_0x21df7a,null));};exports['destroy']=function(_0x50729d,_0x17f89b){return db[_0x44cf('0x3c')][_0x44cf('0x44')]({'where':{'id':_0x50729d[_0x44cf('0x42')]['id']}})[_0x44cf('0x22')](handleEntityNotFound(_0x17f89b,null))[_0x44cf('0x22')](removeEntity(_0x17f89b,null))['catch'](handleError(_0x17f89b,null));};exports[_0x44cf('0x47')]=function(_0x4fd320,_0x5ab3be,_0x47d078){var _0x892fe0={};var _0x3df704={};var _0x3ac206;var _0x41cf89;return db[_0x44cf('0x3c')][_0x44cf('0x48')]({'where':{'id':_0x4fd320['params']['id']}})[_0x44cf('0x22')](handleEntityNotFound(_0x5ab3be,null))['then'](function(_0x1b742f){if(_0x1b742f){_0x3ac206=_0x1b742f;_0x3df704[_0x44cf('0x2e')]=_[_0x44cf('0x30')](db[_0x44cf('0x49')][_0x44cf('0x2a')]);_0x3df704['query']=_['keys'](_0x4fd320[_0x44cf('0x2f')]);_0x3df704[_0x44cf('0x31')]=_[_0x44cf('0x32')](_0x3df704[_0x44cf('0x2e')],_0x3df704['query']);_0x892fe0[_0x44cf('0x33')]=_[_0x44cf('0x32')](_0x3df704['model'],qs[_0x44cf('0x34')](_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x34')]));_0x892fe0['attributes']=_0x892fe0[_0x44cf('0x33')][_0x44cf('0x43')]?_0x892fe0[_0x44cf('0x33')]:_0x3df704['model'];_0x892fe0[_0x44cf('0x4a')]=qs['sort'](_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x36')]);_0x892fe0['where']=qs[_0x44cf('0x31')](_[_0x44cf('0x38')](_0x4fd320[_0x44cf('0x2f')],_0x3df704[_0x44cf('0x31')]));if(_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x39')]){_0x892fe0[_0x44cf('0x37')]=_[_0x44cf('0x3a')](_0x892fe0['where'],{'$or':_[_0x44cf('0x29')](_0x892fe0[_0x44cf('0x33')],function(_0x55a107){var _0x365d97={};_0x365d97[_0x55a107]={'$like':'%'+_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x39')]+'%'};return _0x365d97;})});}_0x892fe0=_[_0x44cf('0x3a')]({},_0x892fe0,_0x4fd320['options']);return _0x3ac206[_0x44cf('0x47')](_0x892fe0);}})[_0x44cf('0x22')](function(_0x4382f2){if(_0x4382f2){_0x41cf89=_0x4382f2[_0x44cf('0x43')];if(!_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x35')]('nolimit')){_0x892fe0[_0x44cf('0x1a')]=qs[_0x44cf('0x1a')](_0x4fd320[_0x44cf('0x2f')]['limit']);_0x892fe0[_0x44cf('0x1c')]=qs[_0x44cf('0x1c')](_0x4fd320[_0x44cf('0x2f')][_0x44cf('0x1c')]);}return _0x3ac206['getFields'](_0x892fe0);}})[_0x44cf('0x22')](function(_0x3d70ca){if(_0x3d70ca){return _0x3d70ca?{'count':_0x41cf89,'rows':_0x3d70ca}:null;}})[_0x44cf('0x22')](respondWithResult(_0x5ab3be,null))[_0x44cf('0x40')](handleError(_0x5ab3be,null));};exports[_0x44cf('0x4b')]=function(_0x2fee93,_0x151b49,_0x15c304){var _0x299395={};var _0x4cbdac={};var _0x4daa36;var _0x1f67ff;return db[_0x44cf('0x3c')]['findOne']({'where':{'id':_0x2fee93[_0x44cf('0x42')]['id']}})[_0x44cf('0x22')](handleEntityNotFound(_0x151b49,null))[_0x44cf('0x22')](function(_0x2f1c83){if(_0x2f1c83){_0x4daa36=_0x2f1c83;_0x4cbdac[_0x44cf('0x2e')]=_['keys'](db[_0x44cf('0x49')][_0x44cf('0x2a')]);_0x4cbdac[_0x44cf('0x2f')]=_[_0x44cf('0x30')](_0x2fee93['query']);_0x4cbdac['filters']=_[_0x44cf('0x32')](_0x4cbdac['model'],_0x4cbdac[_0x44cf('0x2f')]);_0x299395['attributes']=_[_0x44cf('0x32')](_0x4cbdac[_0x44cf('0x2e')],qs[_0x44cf('0x34')](_0x2fee93[_0x44cf('0x2f')][_0x44cf('0x34')]));_0x299395['attributes']=_0x299395[_0x44cf('0x33')]['length']?_0x299395[_0x44cf('0x33')]:_0x4cbdac[_0x44cf('0x2e')];_0x299395[_0x44cf('0x4a')]=qs[_0x44cf('0x36')](_0x2fee93[_0x44cf('0x2f')][_0x44cf('0x36')]);_0x299395['where']=qs['filters'](_['pick'](_0x2fee93[_0x44cf('0x2f')],_0x4cbdac['filters']));if(_0x2fee93['query']['filter']){_0x299395[_0x44cf('0x37')]=_[_0x44cf('0x3a')](_0x299395[_0x44cf('0x37')],{'$or':_[_0x44cf('0x29')](_0x299395[_0x44cf('0x33')],function(_0x2a037d){var _0x230181={};_0x230181[_0x2a037d]={'$like':'%'+_0x2fee93[_0x44cf('0x2f')][_0x44cf('0x39')]+'%'};return _0x230181;})});}_0x299395=_[_0x44cf('0x3a')]({},_0x299395,_0x2fee93['options']);return _0x4daa36[_0x44cf('0x4b')](_0x299395);}})[_0x44cf('0x22')](function(_0x5238e9){if(_0x5238e9){_0x1f67ff=_0x5238e9['length'];if(!_0x2fee93[_0x44cf('0x2f')]['hasOwnProperty'](_0x44cf('0x4c'))){_0x299395['limit']=qs[_0x44cf('0x1a')](_0x2fee93[_0x44cf('0x2f')][_0x44cf('0x1a')]);_0x299395[_0x44cf('0x1c')]=qs[_0x44cf('0x1c')](_0x2fee93['query'][_0x44cf('0x1c')]);}return _0x4daa36[_0x44cf('0x4b')](_0x299395);}})[_0x44cf('0x22')](function(_0x181acc){if(_0x181acc){return _0x181acc?{'count':_0x1f67ff,'rows':_0x181acc}:null;}})['then'](respondWithResult(_0x151b49,null))[_0x44cf('0x40')](handleError(_0x151b49,null));};exports[_0x44cf('0x4d')]=function(_0x522c10,_0x45e7ec,_0x59227f){var _0x23a797={};var _0x3e73ea={};var _0x4ee21c;var _0x43b330;return db[_0x44cf('0x3c')]['findOne']({'where':{'id':_0x522c10['params']['id']}})[_0x44cf('0x22')](handleEntityNotFound(_0x45e7ec,null))[_0x44cf('0x22')](function(_0x465279){if(_0x465279){_0x4ee21c=_0x465279;_0x3e73ea[_0x44cf('0x2e')]=_[_0x44cf('0x30')](db[_0x44cf('0x49')][_0x44cf('0x2a')]);_0x3e73ea['query']=_[_0x44cf('0x30')](_0x522c10['query']);_0x3e73ea[_0x44cf('0x31')]=_[_0x44cf('0x32')](_0x3e73ea[_0x44cf('0x2e')],_0x3e73ea[_0x44cf('0x2f')]);_0x23a797[_0x44cf('0x33')]=_[_0x44cf('0x32')](_0x3e73ea[_0x44cf('0x2e')],qs[_0x44cf('0x34')](_0x522c10[_0x44cf('0x2f')]['fields']));_0x23a797[_0x44cf('0x33')]=_0x23a797['attributes'][_0x44cf('0x43')]?_0x23a797['attributes']:_0x3e73ea['model'];_0x23a797[_0x44cf('0x4a')]=qs[_0x44cf('0x36')](_0x522c10[_0x44cf('0x2f')][_0x44cf('0x36')]);_0x23a797[_0x44cf('0x37')]=qs[_0x44cf('0x31')](_[_0x44cf('0x38')](_0x522c10[_0x44cf('0x2f')],_0x3e73ea['filters']));if(_0x522c10[_0x44cf('0x2f')][_0x44cf('0x39')]){_0x23a797[_0x44cf('0x37')]=_[_0x44cf('0x3a')](_0x23a797[_0x44cf('0x37')],{'$or':_[_0x44cf('0x29')](_0x23a797[_0x44cf('0x33')],function(_0x5b091b){var _0x1aa49b={};_0x1aa49b[_0x5b091b]={'$like':'%'+_0x522c10[_0x44cf('0x2f')][_0x44cf('0x39')]+'%'};return _0x1aa49b;})});}_0x23a797=_[_0x44cf('0x3a')]({},_0x23a797,_0x522c10[_0x44cf('0x3b')]);return _0x4ee21c[_0x44cf('0x4d')](_0x23a797);}})['then'](function(_0x6ecaf6){if(_0x6ecaf6){_0x43b330=_0x6ecaf6[_0x44cf('0x43')];if(!_0x522c10[_0x44cf('0x2f')][_0x44cf('0x35')]('nolimit')){_0x23a797[_0x44cf('0x1a')]=qs[_0x44cf('0x1a')](_0x522c10[_0x44cf('0x2f')][_0x44cf('0x1a')]);_0x23a797['offset']=qs[_0x44cf('0x1c')](_0x522c10[_0x44cf('0x2f')][_0x44cf('0x1c')]);}return _0x4ee21c['getDescriptions'](_0x23a797);}})[_0x44cf('0x22')](function(_0x5d2945){if(_0x5d2945){return _0x5d2945?{'count':_0x43b330,'rows':_0x5d2945}:null;}})[_0x44cf('0x22')](respondWithResult(_0x45e7ec,null))['catch'](handleError(_0x45e7ec,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6d7840c..30d496e 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 _0xc376=['./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x14ec64,_0x43f87c){var _0x4ffa7d=function(_0x5850f0){while(--_0x5850f0){_0x14ec64['push'](_0x14ec64['shift']());}};_0x4ffa7d(++_0x43f87c);}(_0xc376,0xf3));var _0x6c37=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0xc376[_0xeff2c3];return _0x2cade6;};'use strict';var _=require(_0x6c37('0x0'));var util=require(_0x6c37('0x1'));var logger=require(_0x6c37('0x2'))(_0x6c37('0x3'));var moment=require(_0x6c37('0x4'));var BPromise=require(_0x6c37('0x5'));var rp=require(_0x6c37('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6c37('0x7'));var config=require(_0x6c37('0x8'));var attributes=require(_0x6c37('0x9'));module['exports']=function(_0xaf5fe7,_0x31b3f0){return _0xaf5fe7[_0x6c37('0xa')](_0x6c37('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd648=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd648,0x19d));var _0x8d64=function(_0x4586c1,_0x361fba){_0x4586c1=_0x4586c1-0x0;var _0x564cea=_0xd648[_0x4586c1];return _0x564cea;};'use strict';var _=require(_0x8d64('0x0'));var util=require(_0x8d64('0x1'));var logger=require(_0x8d64('0x2'))('api');var moment=require(_0x8d64('0x3'));var BPromise=require(_0x8d64('0x4'));var rp=require(_0x8d64('0x5'));var fs=require('fs');var path=require(_0x8d64('0x6'));var rimraf=require(_0x8d64('0x7'));var config=require(_0x8d64('0x8'));var attributes=require(_0x8d64('0x9'));module[_0x8d64('0xa')]=function(_0x5c17db,_0x1c62fc){return _0x5c17db['define']('SugarcrmConfiguration',attributes,{'tableName':_0x8d64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index e790ca7..8ede391 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 _0xd1ff=['then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x48d26f,_0x485d0c){var _0x27103b=function(_0x227932){while(--_0x227932){_0x48d26f['push'](_0x48d26f['shift']());}};_0x27103b(++_0x485d0c);}(_0xd1ff,0x79));var _0xfd1f=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xd1ff[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require(_0xfd1f('0x0'));var moment=require('moment');var BPromise=require(_0xfd1f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd1f('0x2'));var db=require(_0xfd1f('0x3'))['db'];var utils=require(_0xfd1f('0x4'));var logger=require(_0xfd1f('0x5'))('rpc');var config=require(_0xfd1f('0x6'));var jayson=require(_0xfd1f('0x7'));var client=jayson[_0xfd1f('0x8')][_0xfd1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33931b,_0x1906c5,_0x76fa2){return new BPromise(function(_0x33321c,_0x26db3c){return client[_0xfd1f('0xa')](_0x33931b,_0x76fa2)[_0xfd1f('0xb')](function(_0x13fc7a){logger[_0xfd1f('0xc')](_0xfd1f('0xd'),_0x1906c5,_0xfd1f('0xe'));logger[_0xfd1f('0xf')](_0xfd1f('0x10'),_0x1906c5,_0xfd1f('0xe'),JSON[_0xfd1f('0x11')](_0x13fc7a));if(_0x13fc7a[_0xfd1f('0x12')]){if(_0x13fc7a[_0xfd1f('0x12')]['code']===0x1f4){logger[_0xfd1f('0x12')](_0xfd1f('0xd'),_0x1906c5,_0x13fc7a[_0xfd1f('0x12')][_0xfd1f('0x13')]);return _0x26db3c(_0x13fc7a[_0xfd1f('0x12')][_0xfd1f('0x13')]);}logger[_0xfd1f('0x12')](_0xfd1f('0xd'),_0x1906c5,_0x13fc7a[_0xfd1f('0x12')][_0xfd1f('0x13')]);return _0x33321c(_0x13fc7a[_0xfd1f('0x12')][_0xfd1f('0x13')]);}else{logger['info'](_0xfd1f('0xd'),_0x1906c5,_0xfd1f('0xe'));_0x33321c(_0x13fc7a[_0xfd1f('0x14')][_0xfd1f('0x13')]);}})[_0xfd1f('0x15')](function(_0x2f96f2){logger[_0xfd1f('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1906c5,_0x2f96f2);_0x26db3c(_0x2f96f2);});});} \ No newline at end of file +var _0xa3f5=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','result','catch','lodash'];(function(_0x45a28a,_0x397fa1){var _0x5e6f7f=function(_0x42f6a6){while(--_0x42f6a6){_0x45a28a['push'](_0x45a28a['shift']());}};_0x5e6f7f(++_0x397fa1);}(_0xa3f5,0x1c7));var _0x5a3f=function(_0xc67d4,_0x1f3d6b){_0xc67d4=_0xc67d4-0x0;var _0x5434bf=_0xa3f5[_0xc67d4];return _0x5434bf;};'use strict';var _=require(_0x5a3f('0x0'));var util=require(_0x5a3f('0x1'));var moment=require(_0x5a3f('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a3f('0x3'));var fs=require('fs');var Redis=require(_0x5a3f('0x4'));var db=require(_0x5a3f('0x5'))['db'];var utils=require(_0x5a3f('0x6'));var logger=require('../../config/logger')(_0x5a3f('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a3f('0x8'));var client=jayson[_0x5a3f('0x9')][_0x5a3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f03c0,_0x161fb6,_0x5dc8eb){return new BPromise(function(_0x780245,_0x11b4c0){return client[_0x5a3f('0xb')](_0x7f03c0,_0x5dc8eb)[_0x5a3f('0xc')](function(_0x4bd5d7){logger[_0x5a3f('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x161fb6,'request\x20sent');logger[_0x5a3f('0xe')](_0x5a3f('0xf'),_0x161fb6,'request\x20sent',JSON[_0x5a3f('0x10')](_0x4bd5d7));if(_0x4bd5d7[_0x5a3f('0x11')]){if(_0x4bd5d7[_0x5a3f('0x11')][_0x5a3f('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x161fb6,_0x4bd5d7[_0x5a3f('0x11')][_0x5a3f('0x13')]);return _0x11b4c0(_0x4bd5d7[_0x5a3f('0x11')]['message']);}logger[_0x5a3f('0x11')](_0x5a3f('0x14'),_0x161fb6,_0x4bd5d7['error'][_0x5a3f('0x13')]);return _0x780245(_0x4bd5d7[_0x5a3f('0x11')][_0x5a3f('0x13')]);}else{logger[_0x5a3f('0xd')](_0x5a3f('0x14'),_0x161fb6,_0x5a3f('0x15'));_0x780245(_0x4bd5d7[_0x5a3f('0x16')][_0x5a3f('0x13')]);}})[_0x5a3f('0x17')](function(_0x22ccd3){logger[_0x5a3f('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x161fb6,_0x22ccd3);_0x11b4c0(_0x22ccd3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index f2577ea..08403fa 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 _0xf2ae=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xf2ae,0x1c6));var _0xef2a=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xf2ae[_0xbf8ebe];return _0x1e25e8;};'use strict';var multer=require(_0xef2a('0x0'));var util=require(_0xef2a('0x1'));var path=require('path');var timeout=require(_0xef2a('0x2'));var express=require(_0xef2a('0x3'));var router=express[_0xef2a('0x4')]();var fs_extra=require(_0xef2a('0x5'));var auth=require(_0xef2a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xef2a('0x7'));var controller=require(_0xef2a('0x8'));router[_0xef2a('0x9')]('/',auth[_0xef2a('0xa')](),controller[_0xef2a('0xb')]);router[_0xef2a('0x9')](_0xef2a('0xc'),auth[_0xef2a('0xa')](),controller[_0xef2a('0xd')]);router[_0xef2a('0xe')]('/',auth[_0xef2a('0xa')](),controller[_0xef2a('0xf')]);router['put'](_0xef2a('0xc'),auth[_0xef2a('0xa')](),controller[_0xef2a('0x10')]);router[_0xef2a('0x11')](_0xef2a('0xc'),auth[_0xef2a('0xa')](),controller[_0xef2a('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe9ca=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','show','/:id','update','delete','destroy','path','connect-timeout','express'];(function(_0x3feddd,_0x26d9f9){var _0x4ba65e=function(_0x51da13){while(--_0x51da13){_0x3feddd['push'](_0x3feddd['shift']());}};_0x4ba65e(++_0x26d9f9);}(_0xe9ca,0x173));var _0xae9c=function(_0x543f19,_0x2da3a4){_0x543f19=_0x543f19-0x0;var _0x339a18=_0xe9ca[_0x543f19];return _0x339a18;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae9c('0x0'));var timeout=require(_0xae9c('0x1'));var express=require(_0xae9c('0x2'));var router=express[_0xae9c('0x3')]();var fs_extra=require(_0xae9c('0x4'));var auth=require(_0xae9c('0x5'));var interaction=require(_0xae9c('0x6'));var config=require(_0xae9c('0x7'));var controller=require(_0xae9c('0x8'));router['get']('/',auth[_0xae9c('0x9')](),controller[_0xae9c('0xa')]);router[_0xae9c('0xb')]('/:id',auth[_0xae9c('0x9')](),controller[_0xae9c('0xc')]);router['post']('/',auth[_0xae9c('0x9')](),controller['create']);router['put'](_0xae9c('0xd'),auth[_0xae9c('0x9')](),controller[_0xae9c('0xe')]);router[_0xae9c('0xf')](_0xae9c('0xd'),auth[_0xae9c('0x9')](),controller[_0xae9c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 9ad36c7..ad3b909 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 _0xc13a=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x5d27d5,_0x208c48){var _0x3432be=function(_0x233752){while(--_0x233752){_0x5d27d5['push'](_0x5d27d5['shift']());}};_0x3432be(++_0x208c48);}(_0xc13a,0x77));var _0xac13=function(_0x2bd8cb,_0x29815b){_0x2bd8cb=_0x2bd8cb-0x0;var _0x245b03=_0xc13a[_0x2bd8cb];return _0x245b03;};'use strict';var Sequelize=require(_0xac13('0x0'));module[_0xac13('0x1')]={'type':{'type':Sequelize[_0xac13('0x2')]('string',_0xac13('0x3'),_0xac13('0x4'),_0xac13('0x5'),_0xac13('0x6')),'defaultValue':_0xac13('0x7')},'content':{'type':Sequelize[_0xac13('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xac13('0x8')]},'idField':{'type':Sequelize[_0xac13('0x8')]},'nameField':{'type':Sequelize[_0xac13('0x8')]},'customField':{'type':Sequelize[_0xac13('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xac13('0x8')]}}; \ No newline at end of file +var _0xe609=['string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0xa5fd5f,_0xfc31b0){var _0x1642fe=function(_0x1d2dca){while(--_0x1d2dca){_0xa5fd5f['push'](_0xa5fd5f['shift']());}};_0x1642fe(++_0xfc31b0);}(_0xe609,0x1db));var _0x9e60=function(_0x1ad577,_0x10aa69){_0x1ad577=_0x1ad577-0x0;var _0x13cf77=_0xe609[_0x1ad577];return _0x13cf77;};'use strict';var Sequelize=require(_0x9e60('0x0'));module[_0x9e60('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9e60('0x2'),_0x9e60('0x3'),_0x9e60('0x4'),'keyValue',_0x9e60('0x5')),'defaultValue':_0x9e60('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9e60('0x6')]},'keyType':{'type':Sequelize[_0x9e60('0x7')](_0x9e60('0x2'),_0x9e60('0x3'),_0x9e60('0x4'))},'keyContent':{'type':Sequelize[_0x9e60('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9e60('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c662516..cd7372f 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 _0x1fdc=['ioredis','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','send','map','type','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','model','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x13528c,_0x11b026){var _0x5e13ef=function(_0x4d8514){while(--_0x4d8514){_0x13528c['push'](_0x13528c['shift']());}};_0x5e13ef(++_0x11b026);}(_0x1fdc,0x159));var _0xc1fd=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x1fdc[_0x1943d9];return _0x4b4f3f;};'use strict';var emlformat=require(_0xc1fd('0x0'));var rimraf=require(_0xc1fd('0x1'));var zipdir=require(_0xc1fd('0x2'));var jsonpatch=require(_0xc1fd('0x3'));var rp=require(_0xc1fd('0x4'));var moment=require(_0xc1fd('0x5'));var BPromise=require(_0xc1fd('0x6'));var Mustache=require(_0xc1fd('0x7'));var util=require(_0xc1fd('0x8'));var path=require(_0xc1fd('0x9'));var sox=require(_0xc1fd('0xa'));var csv=require('to-csv');var ejs=require(_0xc1fd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1fd('0xc'));var squel=require(_0xc1fd('0xd'));var crypto=require(_0xc1fd('0xe'));var jsforce=require(_0xc1fd('0xf'));var deskjs=require(_0xc1fd('0x10'));var toCsv=require(_0xc1fd('0x11'));var querystring=require(_0xc1fd('0x12'));var Papa=require(_0xc1fd('0x13'));var Redis=require(_0xc1fd('0x14'));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(_0xc1fd('0x15'))(_0xc1fd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1fd('0x17'));var db=require(_0xc1fd('0x18'))['db'];function respondWithStatusCode(_0x49c090,_0x2a9853){_0x2a9853=_0x2a9853||0xcc;return function(_0x49f105){if(_0x49f105){return _0x49c090[_0xc1fd('0x19')](_0x2a9853);}return _0x49c090[_0xc1fd('0x1a')](_0x2a9853)[_0xc1fd('0x1b')]();};}function respondWithResult(_0x302e86,_0x136bd9){_0x136bd9=_0x136bd9||0xc8;return function(_0x1b9d34){if(_0x1b9d34){return _0x302e86[_0xc1fd('0x1a')](_0x136bd9)[_0xc1fd('0x1c')](_0x1b9d34);}};}function respondWithFilteredResult(_0x6d693f,_0x65b37c){return function(_0x2b17e5){if(_0x2b17e5){var _0x15fec2=typeof _0x65b37c[_0xc1fd('0x1d')]===_0xc1fd('0x1e')&&typeof _0x65b37c['limit']===_0xc1fd('0x1e');var _0x404926=_0x2b17e5[_0xc1fd('0x1f')];var _0x1a4f5e=_0x15fec2?0x0:_0x65b37c['offset'];var _0x4f6253=_0x15fec2?_0x2b17e5[_0xc1fd('0x1f')]:_0x65b37c['offset']+_0x65b37c[_0xc1fd('0x20')];var _0x4c61cc;if(_0x4f6253>=_0x404926){_0x4f6253=_0x404926;_0x4c61cc=0xc8;}else{_0x4c61cc=0xce;}_0x6d693f[_0xc1fd('0x1a')](_0x4c61cc);return _0x6d693f[_0xc1fd('0x21')](_0xc1fd('0x22'),_0x1a4f5e+'-'+_0x4f6253+'/'+_0x404926)[_0xc1fd('0x1c')](_0x2b17e5);}return null;};}function patchUpdates(_0x5e29c7){return function(_0x496403){try{jsonpatch[_0xc1fd('0x23')](_0x496403,_0x5e29c7,!![]);}catch(_0x12adee){return BPromise['reject'](_0x12adee);}return _0x496403[_0xc1fd('0x24')]();};}function saveUpdates(_0x5d2fd2,_0x3ff680){return function(_0x147d12){if(_0x147d12){return _0x147d12['update'](_0x5d2fd2)[_0xc1fd('0x25')](function(_0x2aa483){return _0x2aa483;});}return null;};}function removeEntity(_0x19e886,_0x9713f4){return function(_0x4b6021){if(_0x4b6021){return _0x4b6021[_0xc1fd('0x26')]()[_0xc1fd('0x25')](function(){_0x19e886[_0xc1fd('0x1a')](0xcc)[_0xc1fd('0x1b')]();});}};}function handleEntityNotFound(_0x4f294a,_0x591d64){return function(_0x4d9daf){if(!_0x4d9daf){_0x4f294a[_0xc1fd('0x19')](0x194);}return _0x4d9daf;};}function handleError(_0x28b43a,_0x4b68fd){_0x4b68fd=_0x4b68fd||0x1f4;return function(_0x4dc818){logger[_0xc1fd('0x27')](_0x4dc818['stack']);if(_0x4dc818['name']){delete _0x4dc818['name'];}_0x28b43a[_0xc1fd('0x1a')](_0x4b68fd)[_0xc1fd('0x28')](_0x4dc818);};}exports['index']=function(_0x1d1803,_0x1660a6){var _0x2bfb59={},_0xf7d376={},_0x32c0b6={'count':0x0,'rows':[]};var _0x51dc6e=_[_0xc1fd('0x29')](db['SugarcrmField']['rawAttributes'],function(_0x469564){return{'name':_0x469564['fieldName'],'type':_0x469564[_0xc1fd('0x2a')]['key']};});_0xf7d376['model']=_[_0xc1fd('0x29')](_0x51dc6e,'name');_0xf7d376[_0xc1fd('0x2b')]=_['keys'](_0x1d1803[_0xc1fd('0x2b')]);_0xf7d376[_0xc1fd('0x2c')]=_[_0xc1fd('0x2d')](_0xf7d376['model'],_0xf7d376[_0xc1fd('0x2b')]);_0x2bfb59[_0xc1fd('0x2e')]=_[_0xc1fd('0x2d')](_0xf7d376['model'],qs[_0xc1fd('0x2f')](_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x2f')]));_0x2bfb59[_0xc1fd('0x2e')]=_0x2bfb59['attributes'][_0xc1fd('0x30')]?_0x2bfb59['attributes']:_0xf7d376['model'];if(!_0x1d1803['query'][_0xc1fd('0x31')](_0xc1fd('0x32'))){_0x2bfb59[_0xc1fd('0x20')]=qs[_0xc1fd('0x20')](_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x20')]);_0x2bfb59[_0xc1fd('0x1d')]=qs[_0xc1fd('0x1d')](_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x1d')]);}_0x2bfb59[_0xc1fd('0x33')]=qs[_0xc1fd('0x34')](_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x34')]);_0x2bfb59[_0xc1fd('0x35')]=qs[_0xc1fd('0x2c')](_[_0xc1fd('0x36')](_0x1d1803[_0xc1fd('0x2b')],_0xf7d376[_0xc1fd('0x2c')]),_0x51dc6e);if(_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x37')]){_0x2bfb59[_0xc1fd('0x35')]=_[_0xc1fd('0x38')](_0x2bfb59[_0xc1fd('0x35')],{'$or':_[_0xc1fd('0x29')](_0x51dc6e,function(_0x417301){if(_0x417301[_0xc1fd('0x2a')]!==_0xc1fd('0x39')){var _0x580a8e={};_0x580a8e[_0x417301['name']]={'$like':'%'+_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x37')]+'%'};return _0x580a8e;}})});}_0x2bfb59=_[_0xc1fd('0x38')]({},_0x2bfb59,_0x1d1803[_0xc1fd('0x3a')]);var _0x4f7983={'where':_0x2bfb59[_0xc1fd('0x35')]};return db['SugarcrmField'][_0xc1fd('0x1f')](_0x4f7983)[_0xc1fd('0x25')](function(_0x3b9476){_0x32c0b6[_0xc1fd('0x1f')]=_0x3b9476;if(_0x1d1803[_0xc1fd('0x2b')][_0xc1fd('0x3b')]){_0x2bfb59[_0xc1fd('0x3c')]=[{'all':!![]}];}return db[_0xc1fd('0x3d')][_0xc1fd('0x3e')](_0x2bfb59);})['then'](function(_0x22e12c){_0x32c0b6[_0xc1fd('0x3f')]=_0x22e12c;return _0x32c0b6;})[_0xc1fd('0x25')](respondWithFilteredResult(_0x1660a6,_0x2bfb59))[_0xc1fd('0x40')](handleError(_0x1660a6,null));};exports[_0xc1fd('0x41')]=function(_0x5e0a1c,_0x101417){var _0x16b7fd={'raw':!![],'where':{'id':_0x5e0a1c[_0xc1fd('0x42')]['id']}},_0x2d9023={};_0x2d9023[_0xc1fd('0x43')]=_[_0xc1fd('0x44')](db[_0xc1fd('0x3d')][_0xc1fd('0x45')]);_0x2d9023[_0xc1fd('0x2b')]=_[_0xc1fd('0x44')](_0x5e0a1c[_0xc1fd('0x2b')]);_0x2d9023[_0xc1fd('0x2c')]=_[_0xc1fd('0x2d')](_0x2d9023[_0xc1fd('0x43')],_0x2d9023[_0xc1fd('0x2b')]);_0x16b7fd[_0xc1fd('0x2e')]=_['intersection'](_0x2d9023[_0xc1fd('0x43')],qs[_0xc1fd('0x2f')](_0x5e0a1c[_0xc1fd('0x2b')][_0xc1fd('0x2f')]));_0x16b7fd['attributes']=_0x16b7fd[_0xc1fd('0x2e')][_0xc1fd('0x30')]?_0x16b7fd[_0xc1fd('0x2e')]:_0x2d9023[_0xc1fd('0x43')];if(_0x5e0a1c[_0xc1fd('0x2b')][_0xc1fd('0x3b')]){_0x16b7fd['include']=[{'all':!![]}];}_0x16b7fd=_[_0xc1fd('0x38')]({},_0x16b7fd,_0x5e0a1c[_0xc1fd('0x3a')]);return db[_0xc1fd('0x3d')][_0xc1fd('0x46')](_0x16b7fd)[_0xc1fd('0x25')](handleEntityNotFound(_0x101417,null))[_0xc1fd('0x25')](respondWithResult(_0x101417,null))[_0xc1fd('0x40')](handleError(_0x101417,null));};exports[_0xc1fd('0x47')]=function(_0x5f0aeb,_0x156217){return db[_0xc1fd('0x3d')]['create'](_0x5f0aeb['body'],{})[_0xc1fd('0x25')](respondWithResult(_0x156217,0xc9))[_0xc1fd('0x40')](handleError(_0x156217,null));};exports['update']=function(_0x499144,_0x2a7fb0){if(_0x499144[_0xc1fd('0x48')]['id']){delete _0x499144['body']['id'];}return db[_0xc1fd('0x3d')][_0xc1fd('0x46')]({'where':{'id':_0x499144[_0xc1fd('0x42')]['id']}})[_0xc1fd('0x25')](handleEntityNotFound(_0x2a7fb0,null))['then'](saveUpdates(_0x499144['body'],null))[_0xc1fd('0x25')](respondWithResult(_0x2a7fb0,null))[_0xc1fd('0x40')](handleError(_0x2a7fb0,null));};exports[_0xc1fd('0x26')]=function(_0x9581c3,_0x4b05ee){return db[_0xc1fd('0x3d')][_0xc1fd('0x46')]({'where':{'id':_0x9581c3[_0xc1fd('0x42')]['id']}})[_0xc1fd('0x25')](handleEntityNotFound(_0x4b05ee,null))['then'](removeEntity(_0x4b05ee,null))[_0xc1fd('0x40')](handleError(_0x4b05ee,null));}; \ No newline at end of file +var _0x3130=['status','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','SugarcrmField','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x30bef2,_0x3d4186){var _0x567d67=function(_0x1acf17){while(--_0x1acf17){_0x30bef2['push'](_0x30bef2['shift']());}};_0x567d67(++_0x3d4186);}(_0x3130,0x10f));var _0x0313=function(_0x3ec96b,_0x40e146){_0x3ec96b=_0x3ec96b-0x0;var _0x27a6df=_0x3130[_0x3ec96b];return _0x27a6df;};'use strict';var emlformat=require(_0x0313('0x0'));var rimraf=require(_0x0313('0x1'));var zipdir=require(_0x0313('0x2'));var jsonpatch=require(_0x0313('0x3'));var rp=require('request-promise');var moment=require(_0x0313('0x4'));var BPromise=require(_0x0313('0x5'));var Mustache=require(_0x0313('0x6'));var util=require(_0x0313('0x7'));var path=require(_0x0313('0x8'));var sox=require(_0x0313('0x9'));var csv=require(_0x0313('0xa'));var ejs=require(_0x0313('0xb'));var fs=require('fs');var fs_extra=require(_0x0313('0xc'));var _=require('lodash');var squel=require(_0x0313('0xd'));var crypto=require(_0x0313('0xe'));var jsforce=require(_0x0313('0xf'));var deskjs=require(_0x0313('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0313('0x11'));var Papa=require(_0x0313('0x12'));var Redis=require('ioredis');var authService=require(_0x0313('0x13'));var qs=require(_0x0313('0x14'));var as=require(_0x0313('0x15'));var hardwareService=require(_0x0313('0x16'));var logger=require('../../config/logger')(_0x0313('0x17'));var utils=require(_0x0313('0x18'));var config=require(_0x0313('0x19'));var licenseUtil=require(_0x0313('0x1a'));var db=require(_0x0313('0x1b'))['db'];function respondWithStatusCode(_0x1a52bc,_0x4f2cc2){_0x4f2cc2=_0x4f2cc2||0xcc;return function(_0x3ab841){if(_0x3ab841){return _0x1a52bc[_0x0313('0x1c')](_0x4f2cc2);}return _0x1a52bc['status'](_0x4f2cc2)['end']();};}function respondWithResult(_0x5b8cf5,_0x131cc5){_0x131cc5=_0x131cc5||0xc8;return function(_0x370a04){if(_0x370a04){return _0x5b8cf5[_0x0313('0x1d')](_0x131cc5)['json'](_0x370a04);}};}function respondWithFilteredResult(_0x568e45,_0x5d592a){return function(_0x5adf06){if(_0x5adf06){var _0x2b59a5=typeof _0x5d592a[_0x0313('0x1e')]==='undefined'&&typeof _0x5d592a[_0x0313('0x1f')]===_0x0313('0x20');var _0x4ee908=_0x5adf06[_0x0313('0x21')];var _0x3b44a6=_0x2b59a5?0x0:_0x5d592a['offset'];var _0x67480e=_0x2b59a5?_0x5adf06[_0x0313('0x21')]:_0x5d592a[_0x0313('0x1e')]+_0x5d592a[_0x0313('0x1f')];var _0x24bc9c;if(_0x67480e>=_0x4ee908){_0x67480e=_0x4ee908;_0x24bc9c=0xc8;}else{_0x24bc9c=0xce;}_0x568e45[_0x0313('0x1d')](_0x24bc9c);return _0x568e45[_0x0313('0x22')](_0x0313('0x23'),_0x3b44a6+'-'+_0x67480e+'/'+_0x4ee908)['json'](_0x5adf06);}return null;};}function patchUpdates(_0x2330ff){return function(_0x52c426){try{jsonpatch[_0x0313('0x24')](_0x52c426,_0x2330ff,!![]);}catch(_0x255bce){return BPromise[_0x0313('0x25')](_0x255bce);}return _0x52c426[_0x0313('0x26')]();};}function saveUpdates(_0x38c853,_0x2df87d){return function(_0x15022d){if(_0x15022d){return _0x15022d['update'](_0x38c853)[_0x0313('0x27')](function(_0x532b9d){return _0x532b9d;});}return null;};}function removeEntity(_0x455aa7,_0x18df06){return function(_0x1ae0b3){if(_0x1ae0b3){return _0x1ae0b3['destroy']()[_0x0313('0x27')](function(){_0x455aa7['status'](0xcc)[_0x0313('0x28')]();});}};}function handleEntityNotFound(_0x1dbd3d,_0x301890){return function(_0x208a3a){if(!_0x208a3a){_0x1dbd3d['sendStatus'](0x194);}return _0x208a3a;};}function handleError(_0x52f561,_0x345cf4){_0x345cf4=_0x345cf4||0x1f4;return function(_0x5be91b){logger[_0x0313('0x29')](_0x5be91b[_0x0313('0x2a')]);if(_0x5be91b[_0x0313('0x2b')]){delete _0x5be91b[_0x0313('0x2b')];}_0x52f561[_0x0313('0x1d')](_0x345cf4)[_0x0313('0x2c')](_0x5be91b);};}exports[_0x0313('0x2d')]=function(_0x2495b0,_0x3f2b47){var _0x4bcb74={},_0x2e3e56={},_0x4b7e56={'count':0x0,'rows':[]};var _0x2d601a=_[_0x0313('0x2e')](db[_0x0313('0x2f')][_0x0313('0x30')],function(_0x250ea8){return{'name':_0x250ea8['fieldName'],'type':_0x250ea8[_0x0313('0x31')][_0x0313('0x32')]};});_0x2e3e56[_0x0313('0x33')]=_[_0x0313('0x2e')](_0x2d601a,_0x0313('0x2b'));_0x2e3e56[_0x0313('0x34')]=_['keys'](_0x2495b0['query']);_0x2e3e56[_0x0313('0x35')]=_['intersection'](_0x2e3e56[_0x0313('0x33')],_0x2e3e56[_0x0313('0x34')]);_0x4bcb74[_0x0313('0x36')]=_['intersection'](_0x2e3e56['model'],qs[_0x0313('0x37')](_0x2495b0[_0x0313('0x34')]['fields']));_0x4bcb74['attributes']=_0x4bcb74[_0x0313('0x36')]['length']?_0x4bcb74[_0x0313('0x36')]:_0x2e3e56[_0x0313('0x33')];if(!_0x2495b0['query'][_0x0313('0x38')]('nolimit')){_0x4bcb74[_0x0313('0x1f')]=qs['limit'](_0x2495b0['query'][_0x0313('0x1f')]);_0x4bcb74[_0x0313('0x1e')]=qs[_0x0313('0x1e')](_0x2495b0[_0x0313('0x34')][_0x0313('0x1e')]);}_0x4bcb74['order']=qs[_0x0313('0x39')](_0x2495b0[_0x0313('0x34')][_0x0313('0x39')]);_0x4bcb74['where']=qs['filters'](_[_0x0313('0x3a')](_0x2495b0[_0x0313('0x34')],_0x2e3e56['filters']),_0x2d601a);if(_0x2495b0[_0x0313('0x34')][_0x0313('0x3b')]){_0x4bcb74[_0x0313('0x3c')]=_[_0x0313('0x3d')](_0x4bcb74[_0x0313('0x3c')],{'$or':_[_0x0313('0x2e')](_0x2d601a,function(_0x2df4b2){if(_0x2df4b2[_0x0313('0x31')]!==_0x0313('0x3e')){var _0x397c39={};_0x397c39[_0x2df4b2[_0x0313('0x2b')]]={'$like':'%'+_0x2495b0['query']['filter']+'%'};return _0x397c39;}})});}_0x4bcb74=_[_0x0313('0x3d')]({},_0x4bcb74,_0x2495b0[_0x0313('0x3f')]);var _0x3600be={'where':_0x4bcb74[_0x0313('0x3c')]};return db[_0x0313('0x2f')]['count'](_0x3600be)[_0x0313('0x27')](function(_0x575928){_0x4b7e56[_0x0313('0x21')]=_0x575928;if(_0x2495b0['query'][_0x0313('0x40')]){_0x4bcb74['include']=[{'all':!![]}];}return db[_0x0313('0x2f')]['findAll'](_0x4bcb74);})[_0x0313('0x27')](function(_0x1a3793){_0x4b7e56[_0x0313('0x41')]=_0x1a3793;return _0x4b7e56;})[_0x0313('0x27')](respondWithFilteredResult(_0x3f2b47,_0x4bcb74))[_0x0313('0x42')](handleError(_0x3f2b47,null));};exports[_0x0313('0x43')]=function(_0x40b3a4,_0x262c93){var _0x431cd9={'raw':!![],'where':{'id':_0x40b3a4[_0x0313('0x44')]['id']}},_0x4dae53={};_0x4dae53[_0x0313('0x33')]=_['keys'](db['SugarcrmField'][_0x0313('0x30')]);_0x4dae53['query']=_['keys'](_0x40b3a4[_0x0313('0x34')]);_0x4dae53[_0x0313('0x35')]=_[_0x0313('0x45')](_0x4dae53['model'],_0x4dae53[_0x0313('0x34')]);_0x431cd9[_0x0313('0x36')]=_['intersection'](_0x4dae53[_0x0313('0x33')],qs[_0x0313('0x37')](_0x40b3a4[_0x0313('0x34')][_0x0313('0x37')]));_0x431cd9[_0x0313('0x36')]=_0x431cd9['attributes']['length']?_0x431cd9[_0x0313('0x36')]:_0x4dae53['model'];if(_0x40b3a4['query']['includeAll']){_0x431cd9[_0x0313('0x46')]=[{'all':!![]}];}_0x431cd9=_[_0x0313('0x3d')]({},_0x431cd9,_0x40b3a4['options']);return db['SugarcrmField'][_0x0313('0x47')](_0x431cd9)[_0x0313('0x27')](handleEntityNotFound(_0x262c93,null))[_0x0313('0x27')](respondWithResult(_0x262c93,null))[_0x0313('0x42')](handleError(_0x262c93,null));};exports['create']=function(_0x5f19fe,_0x7139b5){return db['SugarcrmField'][_0x0313('0x48')](_0x5f19fe[_0x0313('0x49')],{})[_0x0313('0x27')](respondWithResult(_0x7139b5,0xc9))['catch'](handleError(_0x7139b5,null));};exports['update']=function(_0x36fe86,_0x31653b){if(_0x36fe86[_0x0313('0x49')]['id']){delete _0x36fe86[_0x0313('0x49')]['id'];}return db[_0x0313('0x2f')]['find']({'where':{'id':_0x36fe86[_0x0313('0x44')]['id']}})['then'](handleEntityNotFound(_0x31653b,null))[_0x0313('0x27')](saveUpdates(_0x36fe86[_0x0313('0x49')],null))[_0x0313('0x27')](respondWithResult(_0x31653b,null))['catch'](handleError(_0x31653b,null));};exports[_0x0313('0x4a')]=function(_0x17d675,_0x2c1784){return db[_0x0313('0x2f')][_0x0313('0x47')]({'where':{'id':_0x17d675['params']['id']}})[_0x0313('0x27')](handleEntityNotFound(_0x2c1784,null))[_0x0313('0x27')](removeEntity(_0x2c1784,null))[_0x0313('0x42')](handleError(_0x2c1784,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a24e0bf..5b04e21 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 _0xb097=['path','rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb097,0x12e));var _0x7b09=function(_0x201a21,_0x1f9b4d){_0x201a21=_0x201a21-0x0;var _0x481a7f=_0xb097[_0x201a21];return _0x481a7f;};'use strict';var _=require('lodash');var util=require(_0x7b09('0x0'));var logger=require(_0x7b09('0x1'))(_0x7b09('0x2'));var moment=require(_0x7b09('0x3'));var BPromise=require(_0x7b09('0x4'));var rp=require(_0x7b09('0x5'));var fs=require('fs');var path=require(_0x7b09('0x6'));var rimraf=require(_0x7b09('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b09('0x8'));module[_0x7b09('0x9')]=function(_0x407113,_0x179395){return _0x407113['define'](_0x7b09('0xa'),attributes,{'tableName':_0x7b09('0xb'),'paranoid':![],'indexes':[{'name':_0x7b09('0xc'),'fields':[_0x7b09('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe0ed=['./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util','api','moment','path','rimraf'];(function(_0xbb0ce8,_0xb63549){var _0x1a1b17=function(_0x171af3){while(--_0x171af3){_0xbb0ce8['push'](_0xbb0ce8['shift']());}};_0x1a1b17(++_0xb63549);}(_0xe0ed,0xc0));var _0xde0e=function(_0x5291d9,_0x14f140){_0x5291d9=_0x5291d9-0x0;var _0x10e012=_0xe0ed[_0x5291d9];return _0x10e012;};'use strict';var _=require(_0xde0e('0x0'));var util=require(_0xde0e('0x1'));var logger=require('../../config/logger')(_0xde0e('0x2'));var moment=require(_0xde0e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xde0e('0x4'));var rimraf=require(_0xde0e('0x5'));var config=require('../../config/environment');var attributes=require(_0xde0e('0x6'));module['exports']=function(_0x500472,_0x8559da){return _0x500472[_0xde0e('0x7')]('SugarcrmField',attributes,{'tableName':_0xde0e('0x8'),'paranoid':![],'indexes':[{'name':_0xde0e('0x9'),'fields':[_0xde0e('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 20a7e1a..a2b4d74 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 _0xf984=['message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','debug','request\x20sent','error','code'];(function(_0x4145de,_0x57aeb0){var _0x474041=function(_0x4bb6cc){while(--_0x4bb6cc){_0x4145de['push'](_0x4145de['shift']());}};_0x474041(++_0x57aeb0);}(_0xf984,0x10c));var _0x4f98=function(_0xb77fe1,_0x39aa4d){_0xb77fe1=_0xb77fe1-0x0;var _0x350e00=_0xf984[_0xb77fe1];return _0x350e00;};'use strict';var _=require(_0x4f98('0x0'));var util=require(_0x4f98('0x1'));var moment=require(_0x4f98('0x2'));var BPromise=require(_0x4f98('0x3'));var rs=require(_0x4f98('0x4'));var fs=require('fs');var Redis=require(_0x4f98('0x5'));var db=require(_0x4f98('0x6'))['db'];var utils=require(_0x4f98('0x7'));var logger=require(_0x4f98('0x8'))(_0x4f98('0x9'));var config=require(_0x4f98('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4f98('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x202a7f,_0x544f7b,_0x3cc842){return new BPromise(function(_0x117cf6,_0x5e3814){return client[_0x4f98('0xc')](_0x202a7f,_0x3cc842)['then'](function(_0x1295bb){logger[_0x4f98('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x544f7b,'request\x20sent');logger[_0x4f98('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x544f7b,_0x4f98('0xf'),JSON['stringify'](_0x1295bb));if(_0x1295bb[_0x4f98('0x10')]){if(_0x1295bb[_0x4f98('0x10')][_0x4f98('0x11')]===0x1f4){logger[_0x4f98('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x544f7b,_0x1295bb[_0x4f98('0x10')][_0x4f98('0x12')]);return _0x5e3814(_0x1295bb[_0x4f98('0x10')][_0x4f98('0x12')]);}logger['error'](_0x4f98('0x13'),_0x544f7b,_0x1295bb[_0x4f98('0x10')][_0x4f98('0x12')]);return _0x117cf6(_0x1295bb[_0x4f98('0x10')][_0x4f98('0x12')]);}else{logger[_0x4f98('0xd')](_0x4f98('0x13'),_0x544f7b,_0x4f98('0xf'));_0x117cf6(_0x1295bb[_0x4f98('0x14')][_0x4f98('0x12')]);}})[_0x4f98('0x15')](function(_0x593ccf){logger[_0x4f98('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x544f7b,_0x593ccf);_0x5e3814(_0x593ccf);});});} \ No newline at end of file +var _0xc463=['../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc463,0x1da));var _0x3c46=function(_0x2ac32b,_0x134b81){_0x2ac32b=_0x2ac32b-0x0;var _0x298c2e=_0xc463[_0x2ac32b];return _0x298c2e;};'use strict';var _=require(_0x3c46('0x0'));var util=require(_0x3c46('0x1'));var moment=require(_0x3c46('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c46('0x3'));var db=require(_0x3c46('0x4'))['db'];var utils=require(_0x3c46('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c46('0x6'));var jayson=require(_0x3c46('0x7'));var client=jayson[_0x3c46('0x8')][_0x3c46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e6ce2,_0x2062a7,_0x475056){return new BPromise(function(_0x499842,_0x2777e1){return client[_0x3c46('0xa')](_0x1e6ce2,_0x475056)['then'](function(_0x5b8c50){logger[_0x3c46('0xb')](_0x3c46('0xc'),_0x2062a7,'request\x20sent');logger['debug'](_0x3c46('0xd'),_0x2062a7,_0x3c46('0xe'),JSON[_0x3c46('0xf')](_0x5b8c50));if(_0x5b8c50[_0x3c46('0x10')]){if(_0x5b8c50['error'][_0x3c46('0x11')]===0x1f4){logger[_0x3c46('0x10')](_0x3c46('0xc'),_0x2062a7,_0x5b8c50[_0x3c46('0x10')]['message']);return _0x2777e1(_0x5b8c50[_0x3c46('0x10')][_0x3c46('0x12')]);}logger[_0x3c46('0x10')](_0x3c46('0xc'),_0x2062a7,_0x5b8c50[_0x3c46('0x10')][_0x3c46('0x12')]);return _0x499842(_0x5b8c50[_0x3c46('0x10')][_0x3c46('0x12')]);}else{logger[_0x3c46('0xb')](_0x3c46('0xc'),_0x2062a7,'request\x20sent');_0x499842(_0x5b8c50['result']['message']);}})[_0x3c46('0x13')](function(_0x4c2eaa){logger[_0x3c46('0x10')](_0x3c46('0xc'),_0x2062a7,_0x4c2eaa);_0x2777e1(_0x4c2eaa);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index aa68a93..511de68 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 _0x2137=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports'];(function(_0x4c7dce,_0x4e1216){var _0x29473d=function(_0x3a2d5a){while(--_0x3a2d5a){_0x4c7dce['push'](_0x4c7dce['shift']());}};_0x29473d(++_0x4e1216);}(_0x2137,0x134));var _0x7213=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0x2137[_0x3e478c];return _0x29ef89;};'use strict';var multer=require(_0x7213('0x0'));var util=require(_0x7213('0x1'));var path=require(_0x7213('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7213('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7213('0x4'));var interaction=require(_0x7213('0x5'));var config=require(_0x7213('0x6'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x7213('0x7')]);router[_0x7213('0x8')]('/:id',auth[_0x7213('0x9')](),controller[_0x7213('0xa')]);router['get'](_0x7213('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x7213('0x8')]('/:id/fields',auth[_0x7213('0x9')](),controller[_0x7213('0xc')]);router[_0x7213('0xd')]('/',auth[_0x7213('0x9')](),controller[_0x7213('0xe')]);router[_0x7213('0xd')](_0x7213('0xb'),auth[_0x7213('0x9')](),controller[_0x7213('0xf')]);router[_0x7213('0x10')]('/:id',auth[_0x7213('0x9')](),controller[_0x7213('0x11')]);router[_0x7213('0x12')](_0x7213('0x13'),auth[_0x7213('0x9')](),controller[_0x7213('0x14')]);module[_0x7213('0x15')]=router; \ No newline at end of file +var _0x8a55=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x8a55,0x185));var _0x58a5=function(_0x44442a,_0x4eda43){_0x44442a=_0x44442a-0x0;var _0x208de5=_0x8a55[_0x44442a];return _0x208de5;};'use strict';var multer=require(_0x58a5('0x0'));var util=require(_0x58a5('0x1'));var path=require(_0x58a5('0x2'));var timeout=require(_0x58a5('0x3'));var express=require(_0x58a5('0x4'));var router=express[_0x58a5('0x5')]();var fs_extra=require(_0x58a5('0x6'));var auth=require(_0x58a5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x58a5('0x8'));var controller=require(_0x58a5('0x9'));router[_0x58a5('0xa')]('/',auth[_0x58a5('0xb')](),controller[_0x58a5('0xc')]);router[_0x58a5('0xa')](_0x58a5('0xd'),auth[_0x58a5('0xb')](),controller[_0x58a5('0xe')]);router['get'](_0x58a5('0xf'),auth[_0x58a5('0xb')](),controller[_0x58a5('0x10')]);router[_0x58a5('0xa')](_0x58a5('0x11'),auth[_0x58a5('0xb')](),controller[_0x58a5('0x12')]);router[_0x58a5('0x13')]('/',auth[_0x58a5('0xb')](),controller[_0x58a5('0x14')]);router[_0x58a5('0x13')](_0x58a5('0xf'),auth[_0x58a5('0xb')](),controller[_0x58a5('0x15')]);router['put'](_0x58a5('0xd'),auth[_0x58a5('0xb')](),controller[_0x58a5('0x16')]);router[_0x58a5('0x17')](_0x58a5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x58a5('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 71fc778..6fc7b94 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 _0xa039=['exports','STRING','HelpDesk','sequelize'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xa039,0x117));var _0x9a03=function(_0xdb0dfe,_0x191975){_0xdb0dfe=_0xdb0dfe-0x0;var _0x44edf4=_0xa039[_0xdb0dfe];return _0x44edf4;};'use strict';var Sequelize=require(_0x9a03('0x0'));module[_0x9a03('0x1')]={'name':{'type':Sequelize[_0x9a03('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9a03('0x2')]},'username':{'type':Sequelize[_0x9a03('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x9a03('0x2')],'allowNull':![],'defaultValue':_0x9a03('0x3')},'remoteUri':{'type':Sequelize[_0x9a03('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x9a03('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x478b=['STRING','sequelize'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x478b,0xe3));var _0xb478=function(_0xf740be,_0xf77e13){_0xf740be=_0xf740be-0x0;var _0x39748d=_0x478b[_0xf740be];return _0x39748d;};'use strict';var Sequelize=require(_0xb478('0x0'));module['exports']={'name':{'type':Sequelize[_0xb478('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb478('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb478('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb478('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb478('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xb478('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 e3b69cf..d99566f 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 _0x41e9=['offset','undefined','limit','count','set','json','reject','save','update','then','destroy','error','stack','index','map','VtigerAccount','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getConfigurations','VtigerConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','success','POST','login','result','token','describe','sessionName','reference','owner','remove','includes','editable','false','cf_','picklist','picklistValues','label','value','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','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/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x595113,_0x40b054){var _0x88ddda=function(_0xd72440){while(--_0xd72440){_0x595113['push'](_0x595113['shift']());}};_0x88ddda(++_0x40b054);}(_0x41e9,0x15d));var _0x941e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x41e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x941e('0x0'));var rimraf=require(_0x941e('0x1'));var zipdir=require(_0x941e('0x2'));var jsonpatch=require(_0x941e('0x3'));var rp=require(_0x941e('0x4'));var moment=require(_0x941e('0x5'));var BPromise=require(_0x941e('0x6'));var Mustache=require(_0x941e('0x7'));var util=require(_0x941e('0x8'));var path=require(_0x941e('0x9'));var sox=require(_0x941e('0xa'));var csv=require(_0x941e('0xb'));var ejs=require(_0x941e('0xc'));var fs=require('fs');var fs_extra=require(_0x941e('0xd'));var _=require(_0x941e('0xe'));var squel=require('squel');var crypto=require(_0x941e('0xf'));var jsforce=require(_0x941e('0x10'));var deskjs=require(_0x941e('0x11'));var toCsv=require(_0x941e('0xb'));var querystring=require(_0x941e('0x12'));var Papa=require(_0x941e('0x13'));var Redis=require(_0x941e('0x14'));var authService=require(_0x941e('0x15'));var qs=require(_0x941e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x941e('0x17'));var logger=require(_0x941e('0x18'))(_0x941e('0x19'));var utils=require(_0x941e('0x1a'));var config=require(_0x941e('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x941e('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x327ae9,_0x598792){_0x598792=_0x598792||0xcc;return function(_0x1051c3){if(_0x1051c3){return _0x327ae9[_0x941e('0x1d')](_0x598792);}return _0x327ae9[_0x941e('0x1e')](_0x598792)[_0x941e('0x1f')]();};}function respondWithResult(_0x508fcd,_0x52899f){_0x52899f=_0x52899f||0xc8;return function(_0x508fd0){if(_0x508fd0){return _0x508fcd[_0x941e('0x1e')](_0x52899f)['json'](_0x508fd0);}};}function respondWithFilteredResult(_0x235629,_0x42a709){return function(_0x32b3cb){if(_0x32b3cb){var _0x2c6217=typeof _0x42a709[_0x941e('0x20')]===_0x941e('0x21')&&typeof _0x42a709[_0x941e('0x22')]===_0x941e('0x21');var _0x23d8c0=_0x32b3cb[_0x941e('0x23')];var _0x3928d8=_0x2c6217?0x0:_0x42a709['offset'];var _0x1820c6=_0x2c6217?_0x32b3cb[_0x941e('0x23')]:_0x42a709['offset']+_0x42a709[_0x941e('0x22')];var _0x37aa2e;if(_0x1820c6>=_0x23d8c0){_0x1820c6=_0x23d8c0;_0x37aa2e=0xc8;}else{_0x37aa2e=0xce;}_0x235629[_0x941e('0x1e')](_0x37aa2e);return _0x235629[_0x941e('0x24')]('Content-Range',_0x3928d8+'-'+_0x1820c6+'/'+_0x23d8c0)[_0x941e('0x25')](_0x32b3cb);}return null;};}function patchUpdates(_0x102807){return function(_0x3ac472){try{jsonpatch['apply'](_0x3ac472,_0x102807,!![]);}catch(_0x26131b){return BPromise[_0x941e('0x26')](_0x26131b);}return _0x3ac472[_0x941e('0x27')]();};}function saveUpdates(_0x11409c,_0x5a7ab1){return function(_0x1e9620){if(_0x1e9620){return _0x1e9620[_0x941e('0x28')](_0x11409c)[_0x941e('0x29')](function(_0x257128){return _0x257128;});}return null;};}function removeEntity(_0x50a926,_0x1b3b36){return function(_0x1555ac){if(_0x1555ac){return _0x1555ac[_0x941e('0x2a')]()[_0x941e('0x29')](function(){_0x50a926[_0x941e('0x1e')](0xcc)[_0x941e('0x1f')]();});}};}function handleEntityNotFound(_0x449b09,_0x1c8022){return function(_0x38a231){if(!_0x38a231){_0x449b09[_0x941e('0x1d')](0x194);}return _0x38a231;};}function handleError(_0x4dbfc2,_0x1429dd){_0x1429dd=_0x1429dd||0x1f4;return function(_0x512da7){logger[_0x941e('0x2b')](_0x512da7[_0x941e('0x2c')]);if(_0x512da7['name']){delete _0x512da7['name'];}_0x4dbfc2[_0x941e('0x1e')](_0x1429dd)['send'](_0x512da7);};}exports[_0x941e('0x2d')]=function(_0x2275c2,_0x236b0a){var _0x332018={},_0x148845={},_0x32f282={'count':0x0,'rows':[]};var _0x5ea3ee=_[_0x941e('0x2e')](db[_0x941e('0x2f')][_0x941e('0x30')],function(_0x2cb55f){return{'name':_0x2cb55f[_0x941e('0x31')],'type':_0x2cb55f[_0x941e('0x32')]['key']};});_0x148845['model']=_[_0x941e('0x2e')](_0x5ea3ee,'name');_0x148845[_0x941e('0x33')]=_['keys'](_0x2275c2['query']);_0x148845[_0x941e('0x34')]=_[_0x941e('0x35')](_0x148845['model'],_0x148845[_0x941e('0x33')]);_0x332018[_0x941e('0x36')]=_['intersection'](_0x148845[_0x941e('0x37')],qs[_0x941e('0x38')](_0x2275c2[_0x941e('0x33')][_0x941e('0x38')]));_0x332018[_0x941e('0x36')]=_0x332018[_0x941e('0x36')][_0x941e('0x39')]?_0x332018[_0x941e('0x36')]:_0x148845[_0x941e('0x37')];if(!_0x2275c2[_0x941e('0x33')][_0x941e('0x3a')]('nolimit')){_0x332018[_0x941e('0x22')]=qs[_0x941e('0x22')](_0x2275c2[_0x941e('0x33')][_0x941e('0x22')]);_0x332018[_0x941e('0x20')]=qs[_0x941e('0x20')](_0x2275c2[_0x941e('0x33')][_0x941e('0x20')]);}_0x332018[_0x941e('0x3b')]=qs[_0x941e('0x3c')](_0x2275c2[_0x941e('0x33')]['sort']);_0x332018[_0x941e('0x3d')]=qs[_0x941e('0x34')](_['pick'](_0x2275c2[_0x941e('0x33')],_0x148845[_0x941e('0x34')]),_0x5ea3ee);if(_0x2275c2[_0x941e('0x33')][_0x941e('0x3e')]){_0x332018[_0x941e('0x3d')]=_[_0x941e('0x3f')](_0x332018[_0x941e('0x3d')],{'$or':_[_0x941e('0x2e')](_0x5ea3ee,function(_0x1da32a){if(_0x1da32a[_0x941e('0x32')]!==_0x941e('0x40')){var _0x4c7fa2={};_0x4c7fa2[_0x1da32a[_0x941e('0x41')]]={'$like':'%'+_0x2275c2[_0x941e('0x33')][_0x941e('0x3e')]+'%'};return _0x4c7fa2;}})});}_0x332018=_[_0x941e('0x3f')]({},_0x332018,_0x2275c2[_0x941e('0x42')]);var _0x3e2a6b={'where':_0x332018[_0x941e('0x3d')]};return db[_0x941e('0x2f')][_0x941e('0x23')](_0x3e2a6b)[_0x941e('0x29')](function(_0x1341fc){_0x32f282[_0x941e('0x23')]=_0x1341fc;if(_0x2275c2['query'][_0x941e('0x43')]){_0x332018[_0x941e('0x44')]=[{'all':!![]}];}return db[_0x941e('0x2f')][_0x941e('0x45')](_0x332018);})[_0x941e('0x29')](function(_0x24151a){_0x32f282[_0x941e('0x46')]=_0x24151a;return _0x32f282;})['then'](respondWithFilteredResult(_0x236b0a,_0x332018))[_0x941e('0x47')](handleError(_0x236b0a,null));};exports[_0x941e('0x48')]=function(_0x376c1d,_0x16d2b4){var _0x198c6a={'raw':![],'where':{'id':_0x376c1d[_0x941e('0x49')]['id']}},_0x5d7c7b={};_0x5d7c7b[_0x941e('0x37')]=_[_0x941e('0x4a')](db['VtigerAccount'][_0x941e('0x30')]);_0x5d7c7b[_0x941e('0x33')]=_[_0x941e('0x4a')](_0x376c1d[_0x941e('0x33')]);_0x5d7c7b[_0x941e('0x34')]=_[_0x941e('0x35')](_0x5d7c7b[_0x941e('0x37')],_0x5d7c7b[_0x941e('0x33')]);_0x198c6a['attributes']=_[_0x941e('0x35')](_0x5d7c7b[_0x941e('0x37')],qs[_0x941e('0x38')](_0x376c1d[_0x941e('0x33')]['fields']));_0x198c6a['attributes']=_0x198c6a['attributes'][_0x941e('0x39')]?_0x198c6a['attributes']:_0x5d7c7b[_0x941e('0x37')];if(_0x376c1d['query'][_0x941e('0x43')]){_0x198c6a[_0x941e('0x44')]=[{'all':!![]}];}_0x198c6a=_[_0x941e('0x3f')]({},_0x198c6a,_0x376c1d[_0x941e('0x42')]);return db[_0x941e('0x2f')]['find'](_0x198c6a)[_0x941e('0x29')](handleEntityNotFound(_0x16d2b4,null))[_0x941e('0x29')](respondWithResult(_0x16d2b4,null))[_0x941e('0x47')](handleError(_0x16d2b4,null));};exports['create']=function(_0x1c3828,_0xdc6045){return db[_0x941e('0x2f')][_0x941e('0x4b')](_0x1c3828['body'],{})['then'](respondWithResult(_0xdc6045,0xc9))[_0x941e('0x47')](handleError(_0xdc6045,null));};exports['update']=function(_0x53cb08,_0x3d2581){if(_0x53cb08[_0x941e('0x4c')]['id']){delete _0x53cb08[_0x941e('0x4c')]['id'];}return db[_0x941e('0x2f')][_0x941e('0x4d')]({'where':{'id':_0x53cb08[_0x941e('0x49')]['id']}})[_0x941e('0x29')](handleEntityNotFound(_0x3d2581,null))[_0x941e('0x29')](saveUpdates(_0x53cb08[_0x941e('0x4c')],null))['then'](respondWithResult(_0x3d2581,null))[_0x941e('0x47')](handleError(_0x3d2581,null));};exports[_0x941e('0x2a')]=function(_0x28497d,_0x17d3cf){return db['VtigerAccount'][_0x941e('0x4d')]({'where':{'id':_0x28497d['params']['id']}})[_0x941e('0x29')](handleEntityNotFound(_0x17d3cf,null))[_0x941e('0x29')](removeEntity(_0x17d3cf,null))[_0x941e('0x47')](handleError(_0x17d3cf,null));};exports[_0x941e('0x4e')]=function(_0x44e883,_0x16130c,_0x3b54e7){var _0x8cbe69={};var _0x1e24fe={};var _0x4650c2;var _0x63a5c8;return db[_0x941e('0x2f')]['findOne']({'where':{'id':_0x44e883[_0x941e('0x49')]['id']}})[_0x941e('0x29')](handleEntityNotFound(_0x16130c,null))['then'](function(_0x407e03){if(_0x407e03){_0x4650c2=_0x407e03;_0x1e24fe[_0x941e('0x37')]=_[_0x941e('0x4a')](db[_0x941e('0x4f')][_0x941e('0x30')]);_0x1e24fe['query']=_[_0x941e('0x4a')](_0x44e883[_0x941e('0x33')]);_0x1e24fe[_0x941e('0x34')]=_[_0x941e('0x35')](_0x1e24fe[_0x941e('0x37')],_0x1e24fe[_0x941e('0x33')]);_0x8cbe69['attributes']=_[_0x941e('0x35')](_0x1e24fe[_0x941e('0x37')],qs['fields'](_0x44e883[_0x941e('0x33')][_0x941e('0x38')]));_0x8cbe69[_0x941e('0x36')]=_0x8cbe69[_0x941e('0x36')]['length']?_0x8cbe69[_0x941e('0x36')]:_0x1e24fe['model'];_0x8cbe69['order']=qs['sort'](_0x44e883['query'][_0x941e('0x3c')]);_0x8cbe69[_0x941e('0x3d')]=qs[_0x941e('0x34')](_['pick'](_0x44e883[_0x941e('0x33')],_0x1e24fe[_0x941e('0x34')]));if(_0x44e883[_0x941e('0x33')][_0x941e('0x3e')]){_0x8cbe69[_0x941e('0x3d')]=_[_0x941e('0x3f')](_0x8cbe69[_0x941e('0x3d')],{'$or':_[_0x941e('0x2e')](_0x8cbe69[_0x941e('0x36')],function(_0x537def){var _0x564d6d={};_0x564d6d[_0x537def]={'$like':'%'+_0x44e883[_0x941e('0x33')]['filter']+'%'};return _0x564d6d;})});}_0x8cbe69=_[_0x941e('0x3f')]({},_0x8cbe69,_0x44e883[_0x941e('0x42')]);return _0x4650c2[_0x941e('0x4e')](_0x8cbe69);}})['then'](function(_0x8f1010){if(_0x8f1010){_0x63a5c8=_0x8f1010[_0x941e('0x39')];if(!_0x44e883['query'][_0x941e('0x3a')](_0x941e('0x50'))){_0x8cbe69[_0x941e('0x22')]=qs['limit'](_0x44e883[_0x941e('0x33')][_0x941e('0x22')]);_0x8cbe69['offset']=qs['offset'](_0x44e883[_0x941e('0x33')][_0x941e('0x20')]);}return _0x4650c2[_0x941e('0x4e')](_0x8cbe69);}})[_0x941e('0x29')](function(_0x2a8160){if(_0x2a8160){return _0x2a8160?{'count':_0x63a5c8,'rows':_0x2a8160}:null;}})[_0x941e('0x29')](respondWithResult(_0x16130c,null))[_0x941e('0x47')](handleError(_0x16130c,null));};exports[_0x941e('0x51')]=function(_0x2425f0,_0x442a17,_0x2656bb){if(_0x2425f0['body']['id']){delete _0x2425f0[_0x941e('0x4c')]['id'];}return db[_0x941e('0x2f')][_0x941e('0x52')]({'where':{'id':_0x2425f0[_0x941e('0x49')]['id']}})[_0x941e('0x29')](handleEntityNotFound(_0x442a17,null))[_0x941e('0x29')](function(_0x11ea08){if(_0x11ea08){_0x2425f0[_0x941e('0x4c')][_0x941e('0x53')]=_0x11ea08['id'];_0x2425f0[_0x941e('0x4c')][_0x941e('0x54')]=integrations[_0x941e('0x55')](_0x2425f0['body'][_0x941e('0x56')],_0x2425f0[_0x941e('0x4c')][_0x941e('0x32')]);_0x2425f0[_0x941e('0x4c')][_0x941e('0x57')]=integrations[_0x941e('0x58')](_0x2425f0[_0x941e('0x4c')]['channel'],_0x2425f0[_0x941e('0x4c')]['type']);return db['VtigerConfiguration']['create'](_0x2425f0[_0x941e('0x4c')],{'include':[{'model':db[_0x941e('0x59')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x941e('0x57')}]});}return null;})['then'](respondWithResult(_0x442a17,null))[_0x941e('0x47')](handleError(_0x442a17,null));};var md5=require(_0x941e('0x5a'));exports[_0x941e('0x5b')]=function(_0x1bb18b,_0xb0c195,_0x163b5f){var _0x2f2fc7=null;var _0x1eac56=null;var _0x4780ee=null;var _0x5da300=null;var _0x34a543='';return db['VtigerAccount'][_0x941e('0x52')]({'where':{'id':_0x1bb18b[_0x941e('0x49')]['id']},'attributes':['id',_0x941e('0x41'),_0x941e('0x5c'),_0x941e('0x5d'),_0x941e('0x5e'),_0x941e('0x5f'),_0x941e('0x60'),_0x941e('0x61')]})[_0x941e('0x29')](handleEntityNotFound(_0xb0c195,null))[_0x941e('0x29')](function(_0x18161b){if(_0x18161b){_0x2f2fc7=_0x18161b[_0x941e('0x5c')];_0x1eac56=_0x18161b[_0x941e('0x61')];_0x4780ee=_0x18161b[_0x941e('0x5e')];_0x34a543=_0x18161b[_0x941e('0x5f')];var _0x3005fa=_0x34a543[_0x941e('0x62')](-0x1);if(_0x3005fa==='/'){_0x34a543=_0x34a543[_0x941e('0x63')](0x0,_0x34a543[_0x941e('0x64')](_0x3005fa));}_0x5da300=util[_0x941e('0x65')]('%s/webservice.php',_0x34a543);var _0x2e6f48={'method':_0x941e('0x66'),'uri':_0x5da300,'qs':{'operation':'getchallenge','username':_0x18161b[_0x941e('0x5c')]},'json':!![]};return rp(_0x2e6f48);}})[_0x941e('0x29')](function(_0x7c67d5){if(_0x7c67d5[_0x941e('0x67')]){var _0x55d61c={'method':_0x941e('0x68'),'uri':_0x5da300,'form':{'operation':_0x941e('0x69'),'username':_0x2f2fc7,'accessKey':md5(_0x7c67d5[_0x941e('0x6a')][_0x941e('0x6b')]+_0x1eac56)},'json':!![]};return rp(_0x55d61c);}})['then'](function(_0x531d78){if(_0x531d78[_0x941e('0x67')]){var _0x21989a={'method':_0x941e('0x66'),'uri':_0x5da300,'qs':{'operation':_0x941e('0x6c'),'username':_0x2f2fc7,'sessionName':_0x531d78['result'][_0x941e('0x6d')],'elementType':_0x4780ee},'json':!![]};return rp(_0x21989a);}})[_0x941e('0x29')](function(_0x50b6aa){if(_0x50b6aa[_0x941e('0x67')]){var _0x560051=['autogenerated',_0x941e('0x6e'),_0x941e('0x6f')];_[_0x941e('0x70')](_0x50b6aa['result'][_0x941e('0x38')],function(_0x518144){return _0x560051[_0x941e('0x71')](_0x518144[_0x941e('0x32')][_0x941e('0x41')]);});_[_0x941e('0x70')](_0x50b6aa[_0x941e('0x6a')][_0x941e('0x38')],function(_0x38db93){return _0x38db93[_0x941e('0x72')]===_0x941e('0x73');});return{'count':_0x50b6aa[_0x941e('0x6a')][_0x941e('0x38')]['length'],'rows':_[_0x941e('0x2e')](_0x50b6aa[_0x941e('0x6a')]['fields'],function(_0x38c7cc){return{'id':_0x38c7cc[_0x941e('0x41')],'name':_0x38c7cc['label'],'custom':_['startsWith'](_0x38c7cc['name'],_0x941e('0x74'))?!![]:![],'options':_0x38c7cc[_0x941e('0x32')][_0x941e('0x41')]===_0x941e('0x75')&&_0x38c7cc['type']['picklistValues'][_0x941e('0x39')]>0x0?_[_0x941e('0x2e')](_0x38c7cc[_0x941e('0x32')][_0x941e('0x76')],function(_0x1b2198){return{'name':_0x1b2198[_0x941e('0x77')],'value':_0x1b2198[_0x941e('0x78')]};}):[]};})};}})[_0x941e('0x29')](respondWithResult(_0xb0c195,null))[_0x941e('0x47')](function(_0x5588b0){console['log'](_0x941e('0x79')+_0x5588b0);var _0x4f34ee=_0x1bb18b['query']['test']?0x1f4:_0x5588b0['statusCode']||0x1f4;logger['error'](_0x941e('0x7a'),_0x941e('0x5b'),_0x4f34ee,JSON[_0x941e('0x7b')](_0x5588b0));delete _0x5588b0[_0x941e('0x41')];if(_0x4f34ee===0x191){_0x4f34ee=0x190;}_0xb0c195['status'](_0x4f34ee)['send'](_0x1bb18b['query'][_0x941e('0x7c')]?{'message':_0x941e('0x7d'),'statusCode':_0x5588b0[_0x941e('0x7e')]}:_0x5588b0);});}; \ No newline at end of file +var _0x336b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','find','getConfigurations','findOne','VtigerConfiguration','length','pick','addConfiguration','AccountId','Subjects','channel','Descriptions','VtigerField','getFields','username','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','GET','success','POST','login','result','token','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','log','test','stringify','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','jsforce','desk.js','to-csv','papaparse'];(function(_0x41f59e,_0x5e916a){var _0x1d5e3=function(_0x11d7c9){while(--_0x11d7c9){_0x41f59e['push'](_0x41f59e['shift']());}};_0x1d5e3(++_0x5e916a);}(_0x336b,0xd7));var _0xb336=function(_0x46411b,_0x308493){_0x46411b=_0x46411b-0x0;var _0x11c0a6=_0x336b[_0x46411b];return _0x11c0a6;};'use strict';var emlformat=require(_0xb336('0x0'));var rimraf=require(_0xb336('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb336('0x2'));var rp=require(_0xb336('0x3'));var moment=require('moment');var BPromise=require(_0xb336('0x4'));var Mustache=require(_0xb336('0x5'));var util=require(_0xb336('0x6'));var path=require(_0xb336('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb336('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb336('0x9'));var deskjs=require(_0xb336('0xa'));var toCsv=require(_0xb336('0xb'));var querystring=require('querystring');var Papa=require(_0xb336('0xc'));var Redis=require(_0xb336('0xd'));var authService=require(_0xb336('0xe'));var qs=require(_0xb336('0xf'));var as=require(_0xb336('0x10'));var hardwareService=require(_0xb336('0x11'));var logger=require(_0xb336('0x12'))('api');var utils=require(_0xb336('0x13'));var config=require(_0xb336('0x14'));var licenseUtil=require(_0xb336('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb336('0x16'));function respondWithStatusCode(_0x5947b5,_0x28d2f9){_0x28d2f9=_0x28d2f9||0xcc;return function(_0x1a0fa8){if(_0x1a0fa8){return _0x5947b5[_0xb336('0x17')](_0x28d2f9);}return _0x5947b5['status'](_0x28d2f9)[_0xb336('0x18')]();};}function respondWithResult(_0x469ce9,_0x1cfe16){_0x1cfe16=_0x1cfe16||0xc8;return function(_0x3c02a5){if(_0x3c02a5){return _0x469ce9[_0xb336('0x19')](_0x1cfe16)[_0xb336('0x1a')](_0x3c02a5);}};}function respondWithFilteredResult(_0x4bd6b5,_0x1c95d7){return function(_0xff6efa){if(_0xff6efa){var _0x1ea172=typeof _0x1c95d7[_0xb336('0x1b')]===_0xb336('0x1c')&&typeof _0x1c95d7[_0xb336('0x1d')]===_0xb336('0x1c');var _0x474a7c=_0xff6efa[_0xb336('0x1e')];var _0x48eb34=_0x1ea172?0x0:_0x1c95d7[_0xb336('0x1b')];var _0xfd3ee4=_0x1ea172?_0xff6efa[_0xb336('0x1e')]:_0x1c95d7[_0xb336('0x1b')]+_0x1c95d7[_0xb336('0x1d')];var _0x3b58e4;if(_0xfd3ee4>=_0x474a7c){_0xfd3ee4=_0x474a7c;_0x3b58e4=0xc8;}else{_0x3b58e4=0xce;}_0x4bd6b5[_0xb336('0x19')](_0x3b58e4);return _0x4bd6b5[_0xb336('0x1f')]('Content-Range',_0x48eb34+'-'+_0xfd3ee4+'/'+_0x474a7c)['json'](_0xff6efa);}return null;};}function patchUpdates(_0x2af4f3){return function(_0x129d4f){try{jsonpatch[_0xb336('0x20')](_0x129d4f,_0x2af4f3,!![]);}catch(_0xf618ee){return BPromise['reject'](_0xf618ee);}return _0x129d4f[_0xb336('0x21')]();};}function saveUpdates(_0x3615e3,_0x5127ac){return function(_0x52f912){if(_0x52f912){return _0x52f912[_0xb336('0x22')](_0x3615e3)[_0xb336('0x23')](function(_0x5b716f){return _0x5b716f;});}return null;};}function removeEntity(_0x4c5b6d,_0x319c7e){return function(_0x2e74b5){if(_0x2e74b5){return _0x2e74b5['destroy']()[_0xb336('0x23')](function(){_0x4c5b6d['status'](0xcc)[_0xb336('0x18')]();});}};}function handleEntityNotFound(_0x56aa93,_0x270731){return function(_0x33c4dd){if(!_0x33c4dd){_0x56aa93[_0xb336('0x17')](0x194);}return _0x33c4dd;};}function handleError(_0x2d59bd,_0x5acdf6){_0x5acdf6=_0x5acdf6||0x1f4;return function(_0x415bcc){logger[_0xb336('0x24')](_0x415bcc[_0xb336('0x25')]);if(_0x415bcc[_0xb336('0x26')]){delete _0x415bcc[_0xb336('0x26')];}_0x2d59bd[_0xb336('0x19')](_0x5acdf6)[_0xb336('0x27')](_0x415bcc);};}exports[_0xb336('0x28')]=function(_0x1764e3,_0x527a90){var _0x114a33={},_0x256b40={},_0x3c30e3={'count':0x0,'rows':[]};var _0x2a5ea9=_[_0xb336('0x29')](db[_0xb336('0x2a')][_0xb336('0x2b')],function(_0x1ccd1f){return{'name':_0x1ccd1f[_0xb336('0x2c')],'type':_0x1ccd1f[_0xb336('0x2d')][_0xb336('0x2e')]};});_0x256b40[_0xb336('0x2f')]=_[_0xb336('0x29')](_0x2a5ea9,_0xb336('0x26'));_0x256b40[_0xb336('0x30')]=_[_0xb336('0x31')](_0x1764e3['query']);_0x256b40[_0xb336('0x32')]=_['intersection'](_0x256b40[_0xb336('0x2f')],_0x256b40['query']);_0x114a33[_0xb336('0x33')]=_[_0xb336('0x34')](_0x256b40[_0xb336('0x2f')],qs[_0xb336('0x35')](_0x1764e3[_0xb336('0x30')]['fields']));_0x114a33[_0xb336('0x33')]=_0x114a33['attributes']['length']?_0x114a33['attributes']:_0x256b40[_0xb336('0x2f')];if(!_0x1764e3['query'][_0xb336('0x36')](_0xb336('0x37'))){_0x114a33[_0xb336('0x1d')]=qs['limit'](_0x1764e3[_0xb336('0x30')][_0xb336('0x1d')]);_0x114a33['offset']=qs['offset'](_0x1764e3[_0xb336('0x30')]['offset']);}_0x114a33[_0xb336('0x38')]=qs[_0xb336('0x39')](_0x1764e3[_0xb336('0x30')][_0xb336('0x39')]);_0x114a33['where']=qs['filters'](_['pick'](_0x1764e3[_0xb336('0x30')],_0x256b40[_0xb336('0x32')]),_0x2a5ea9);if(_0x1764e3[_0xb336('0x30')][_0xb336('0x3a')]){_0x114a33[_0xb336('0x3b')]=_[_0xb336('0x3c')](_0x114a33[_0xb336('0x3b')],{'$or':_[_0xb336('0x29')](_0x2a5ea9,function(_0x4037b4){if(_0x4037b4[_0xb336('0x2d')]!==_0xb336('0x3d')){var _0x5b2bba={};_0x5b2bba[_0x4037b4[_0xb336('0x26')]]={'$like':'%'+_0x1764e3[_0xb336('0x30')][_0xb336('0x3a')]+'%'};return _0x5b2bba;}})});}_0x114a33=_[_0xb336('0x3c')]({},_0x114a33,_0x1764e3[_0xb336('0x3e')]);var _0x1e3aa6={'where':_0x114a33[_0xb336('0x3b')]};return db[_0xb336('0x2a')]['count'](_0x1e3aa6)[_0xb336('0x23')](function(_0x4e1563){_0x3c30e3[_0xb336('0x1e')]=_0x4e1563;if(_0x1764e3['query'][_0xb336('0x3f')]){_0x114a33['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xb336('0x40')](_0x114a33);})[_0xb336('0x23')](function(_0x2a7bfe){_0x3c30e3[_0xb336('0x41')]=_0x2a7bfe;return _0x3c30e3;})[_0xb336('0x23')](respondWithFilteredResult(_0x527a90,_0x114a33))[_0xb336('0x42')](handleError(_0x527a90,null));};exports[_0xb336('0x43')]=function(_0x48ee8e,_0x347336){var _0x311631={'raw':![],'where':{'id':_0x48ee8e[_0xb336('0x44')]['id']}},_0x201616={};_0x201616[_0xb336('0x2f')]=_['keys'](db[_0xb336('0x2a')][_0xb336('0x2b')]);_0x201616[_0xb336('0x30')]=_['keys'](_0x48ee8e[_0xb336('0x30')]);_0x201616['filters']=_['intersection'](_0x201616[_0xb336('0x2f')],_0x201616[_0xb336('0x30')]);_0x311631[_0xb336('0x33')]=_[_0xb336('0x34')](_0x201616[_0xb336('0x2f')],qs['fields'](_0x48ee8e[_0xb336('0x30')][_0xb336('0x35')]));_0x311631[_0xb336('0x33')]=_0x311631[_0xb336('0x33')]['length']?_0x311631['attributes']:_0x201616[_0xb336('0x2f')];if(_0x48ee8e[_0xb336('0x30')][_0xb336('0x3f')]){_0x311631[_0xb336('0x45')]=[{'all':!![]}];}_0x311631=_[_0xb336('0x3c')]({},_0x311631,_0x48ee8e[_0xb336('0x3e')]);return db[_0xb336('0x2a')]['find'](_0x311631)[_0xb336('0x23')](handleEntityNotFound(_0x347336,null))['then'](respondWithResult(_0x347336,null))[_0xb336('0x42')](handleError(_0x347336,null));};exports[_0xb336('0x46')]=function(_0x16d4ef,_0x1e022f){return db[_0xb336('0x2a')][_0xb336('0x46')](_0x16d4ef[_0xb336('0x47')],{})[_0xb336('0x23')](respondWithResult(_0x1e022f,0xc9))[_0xb336('0x42')](handleError(_0x1e022f,null));};exports[_0xb336('0x22')]=function(_0xbb8459,_0x16be6f){if(_0xbb8459[_0xb336('0x47')]['id']){delete _0xbb8459[_0xb336('0x47')]['id'];}return db[_0xb336('0x2a')]['find']({'where':{'id':_0xbb8459[_0xb336('0x44')]['id']}})[_0xb336('0x23')](handleEntityNotFound(_0x16be6f,null))['then'](saveUpdates(_0xbb8459['body'],null))[_0xb336('0x23')](respondWithResult(_0x16be6f,null))[_0xb336('0x42')](handleError(_0x16be6f,null));};exports[_0xb336('0x48')]=function(_0x3ac381,_0x33f38a){return db[_0xb336('0x2a')][_0xb336('0x49')]({'where':{'id':_0x3ac381['params']['id']}})[_0xb336('0x23')](handleEntityNotFound(_0x33f38a,null))[_0xb336('0x23')](removeEntity(_0x33f38a,null))[_0xb336('0x42')](handleError(_0x33f38a,null));};exports[_0xb336('0x4a')]=function(_0x7c638,_0x26ccfe,_0x52b993){var _0x20f4fa={};var _0x4a6479={};var _0xa2583;var _0x2ee694;return db[_0xb336('0x2a')][_0xb336('0x4b')]({'where':{'id':_0x7c638[_0xb336('0x44')]['id']}})[_0xb336('0x23')](handleEntityNotFound(_0x26ccfe,null))['then'](function(_0x213cf9){if(_0x213cf9){_0xa2583=_0x213cf9;_0x4a6479[_0xb336('0x2f')]=_['keys'](db[_0xb336('0x4c')][_0xb336('0x2b')]);_0x4a6479[_0xb336('0x30')]=_['keys'](_0x7c638[_0xb336('0x30')]);_0x4a6479[_0xb336('0x32')]=_[_0xb336('0x34')](_0x4a6479['model'],_0x4a6479[_0xb336('0x30')]);_0x20f4fa['attributes']=_[_0xb336('0x34')](_0x4a6479[_0xb336('0x2f')],qs[_0xb336('0x35')](_0x7c638[_0xb336('0x30')][_0xb336('0x35')]));_0x20f4fa[_0xb336('0x33')]=_0x20f4fa[_0xb336('0x33')][_0xb336('0x4d')]?_0x20f4fa[_0xb336('0x33')]:_0x4a6479[_0xb336('0x2f')];_0x20f4fa[_0xb336('0x38')]=qs[_0xb336('0x39')](_0x7c638[_0xb336('0x30')][_0xb336('0x39')]);_0x20f4fa[_0xb336('0x3b')]=qs['filters'](_[_0xb336('0x4e')](_0x7c638[_0xb336('0x30')],_0x4a6479['filters']));if(_0x7c638[_0xb336('0x30')][_0xb336('0x3a')]){_0x20f4fa[_0xb336('0x3b')]=_[_0xb336('0x3c')](_0x20f4fa[_0xb336('0x3b')],{'$or':_[_0xb336('0x29')](_0x20f4fa['attributes'],function(_0x4ce874){var _0x13542c={};_0x13542c[_0x4ce874]={'$like':'%'+_0x7c638[_0xb336('0x30')][_0xb336('0x3a')]+'%'};return _0x13542c;})});}_0x20f4fa=_[_0xb336('0x3c')]({},_0x20f4fa,_0x7c638[_0xb336('0x3e')]);return _0xa2583[_0xb336('0x4a')](_0x20f4fa);}})['then'](function(_0x4cb1cc){if(_0x4cb1cc){_0x2ee694=_0x4cb1cc[_0xb336('0x4d')];if(!_0x7c638[_0xb336('0x30')][_0xb336('0x36')](_0xb336('0x37'))){_0x20f4fa[_0xb336('0x1d')]=qs[_0xb336('0x1d')](_0x7c638[_0xb336('0x30')][_0xb336('0x1d')]);_0x20f4fa[_0xb336('0x1b')]=qs[_0xb336('0x1b')](_0x7c638['query']['offset']);}return _0xa2583[_0xb336('0x4a')](_0x20f4fa);}})[_0xb336('0x23')](function(_0x263b6e){if(_0x263b6e){return _0x263b6e?{'count':_0x2ee694,'rows':_0x263b6e}:null;}})[_0xb336('0x23')](respondWithResult(_0x26ccfe,null))['catch'](handleError(_0x26ccfe,null));};exports[_0xb336('0x4f')]=function(_0x5bdd4b,_0x5dc064,_0x4f04cb){if(_0x5bdd4b['body']['id']){delete _0x5bdd4b[_0xb336('0x47')]['id'];}return db[_0xb336('0x2a')][_0xb336('0x4b')]({'where':{'id':_0x5bdd4b[_0xb336('0x44')]['id']}})[_0xb336('0x23')](handleEntityNotFound(_0x5dc064,null))[_0xb336('0x23')](function(_0x486141){if(_0x486141){_0x5bdd4b[_0xb336('0x47')][_0xb336('0x50')]=_0x486141['id'];_0x5bdd4b[_0xb336('0x47')][_0xb336('0x51')]=integrations['getSubjects'](_0x5bdd4b['body'][_0xb336('0x52')],_0x5bdd4b[_0xb336('0x47')]['type']);_0x5bdd4b[_0xb336('0x47')][_0xb336('0x53')]=integrations['getDescriptions'](_0x5bdd4b[_0xb336('0x47')][_0xb336('0x52')],_0x5bdd4b['body'][_0xb336('0x2d')]);return db[_0xb336('0x4c')][_0xb336('0x46')](_0x5bdd4b['body'],{'include':[{'model':db[_0xb336('0x54')],'as':'Subjects'},{'model':db[_0xb336('0x54')],'as':'Descriptions'}]});}return null;})[_0xb336('0x23')](respondWithResult(_0x5dc064,null))['catch'](handleError(_0x5dc064,null));};var md5=require('md5');exports[_0xb336('0x55')]=function(_0x252738,_0x1c9e3a,_0x4f9034){var _0x4679ca=null;var _0x189731=null;var _0x34ff3c=null;var _0x4e3f68=null;var _0x589485='';return db[_0xb336('0x2a')][_0xb336('0x4b')]({'where':{'id':_0x252738[_0xb336('0x44')]['id']},'attributes':['id',_0xb336('0x26'),_0xb336('0x56'),'description',_0xb336('0x57'),_0xb336('0x58'),_0xb336('0x59'),_0xb336('0x5a')]})[_0xb336('0x23')](handleEntityNotFound(_0x1c9e3a,null))[_0xb336('0x23')](function(_0x1f998c){if(_0x1f998c){_0x4679ca=_0x1f998c['username'];_0x189731=_0x1f998c['accessKey'];_0x34ff3c=_0x1f998c[_0xb336('0x57')];_0x589485=_0x1f998c[_0xb336('0x58')];var _0x48e515=_0x589485['slice'](-0x1);if(_0x48e515==='/'){_0x589485=_0x589485[_0xb336('0x5b')](0x0,_0x589485[_0xb336('0x5c')](_0x48e515));}_0x4e3f68=util['format']('%s/webservice.php',_0x589485);var _0x863a91={'method':_0xb336('0x5d'),'uri':_0x4e3f68,'qs':{'operation':'getchallenge','username':_0x1f998c[_0xb336('0x56')]},'json':!![]};return rp(_0x863a91);}})[_0xb336('0x23')](function(_0x46c69a){if(_0x46c69a[_0xb336('0x5e')]){var _0x24a65f={'method':_0xb336('0x5f'),'uri':_0x4e3f68,'form':{'operation':_0xb336('0x60'),'username':_0x4679ca,'accessKey':md5(_0x46c69a[_0xb336('0x61')][_0xb336('0x62')]+_0x189731)},'json':!![]};return rp(_0x24a65f);}})[_0xb336('0x23')](function(_0x57a0bd){if(_0x57a0bd[_0xb336('0x5e')]){var _0x19930c={'method':_0xb336('0x5d'),'uri':_0x4e3f68,'qs':{'operation':'describe','username':_0x4679ca,'sessionName':_0x57a0bd[_0xb336('0x61')]['sessionName'],'elementType':_0x34ff3c},'json':!![]};return rp(_0x19930c);}})[_0xb336('0x23')](function(_0x4fa7a9){if(_0x4fa7a9[_0xb336('0x5e')]){var _0x1b6b54=[_0xb336('0x63'),_0xb336('0x64'),_0xb336('0x65')];_[_0xb336('0x66')](_0x4fa7a9[_0xb336('0x61')]['fields'],function(_0x4ec67b){return _0x1b6b54[_0xb336('0x67')](_0x4ec67b[_0xb336('0x2d')]['name']);});_[_0xb336('0x66')](_0x4fa7a9[_0xb336('0x61')][_0xb336('0x35')],function(_0x357286){return _0x357286[_0xb336('0x68')]==='false';});return{'count':_0x4fa7a9[_0xb336('0x61')][_0xb336('0x35')]['length'],'rows':_[_0xb336('0x29')](_0x4fa7a9['result']['fields'],function(_0x50fd90){return{'id':_0x50fd90[_0xb336('0x26')],'name':_0x50fd90[_0xb336('0x69')],'custom':_[_0xb336('0x6a')](_0x50fd90[_0xb336('0x26')],'cf_')?!![]:![],'options':_0x50fd90[_0xb336('0x2d')][_0xb336('0x26')]===_0xb336('0x6b')&&_0x50fd90[_0xb336('0x2d')][_0xb336('0x6c')][_0xb336('0x4d')]>0x0?_['map'](_0x50fd90[_0xb336('0x2d')][_0xb336('0x6c')],function(_0x238e40){return{'name':_0x238e40['label'],'value':_0x238e40[_0xb336('0x6d')]};}):[]};})};}})[_0xb336('0x23')](respondWithResult(_0x1c9e3a,null))['catch'](function(_0x18b2e0){console[_0xb336('0x6e')]('vTiger\x20error:\x20'+_0x18b2e0);var _0x1d5c0f=_0x252738[_0xb336('0x30')][_0xb336('0x6f')]?0x1f4:_0x18b2e0['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb336('0x55'),_0x1d5c0f,JSON[_0xb336('0x70')](_0x18b2e0));delete _0x18b2e0[_0xb336('0x26')];if(_0x1d5c0f===0x191){_0x1d5c0f=0x190;}_0x1c9e3a[_0xb336('0x19')](_0x1d5c0f)['send'](_0x252738['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x18b2e0[_0xb336('0x71')]}:_0x18b2e0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 253460f..1f278cd 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 _0xf39d=['api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts'];(function(_0x13dc10,_0x25d9e5){var _0x35a1bd=function(_0x2c675a){while(--_0x2c675a){_0x13dc10['push'](_0x13dc10['shift']());}};_0x35a1bd(++_0x25d9e5);}(_0xf39d,0x118));var _0xdf39=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xf39d[_0x8de54f];return _0x14cba4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdf39('0x0'));var moment=require(_0xdf39('0x1'));var BPromise=require(_0xdf39('0x2'));var rp=require(_0xdf39('0x3'));var fs=require('fs');var path=require(_0xdf39('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf39('0x5'));var integrations=require(_0xdf39('0x6'));module[_0xdf39('0x7')]=function(_0x53e741,_0x2b9013){return _0x53e741['define'](_0xdf39('0x8'),attributes,{'tableName':_0xdf39('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71c9=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','define','int_vtiger_accounts'];(function(_0x4bfaae,_0xbf482f){var _0x3d3a34=function(_0x312ea5){while(--_0x312ea5){_0x4bfaae['push'](_0x4bfaae['shift']());}};_0x3d3a34(++_0xbf482f);}(_0x71c9,0x181));var _0x971c=function(_0x21f1e3,_0x14524a){_0x21f1e3=_0x21f1e3-0x0;var _0x122bf0=_0x71c9[_0x21f1e3];return _0x122bf0;};'use strict';var _=require(_0x971c('0x0'));var util=require(_0x971c('0x1'));var logger=require('../../config/logger')(_0x971c('0x2'));var moment=require(_0x971c('0x3'));var BPromise=require(_0x971c('0x4'));var rp=require(_0x971c('0x5'));var fs=require('fs');var path=require(_0x971c('0x6'));var rimraf=require('rimraf');var config=require(_0x971c('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x971c('0x8'));module['exports']=function(_0x2f2c00,_0x12d8ed){return _0x2f2c00[_0x971c('0x9')]('VtigerAccount',attributes,{'tableName':_0x971c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1f1441f..c95fc5d 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 _0xdb94=['findAll','options','raw','attributes','limit','include','map','model','stringify','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','GetVtigerAccount','VtigerAccount'];(function(_0x26ef51,_0x3dfadc){var _0x397a90=function(_0x594635){while(--_0x594635){_0x26ef51['push'](_0x26ef51['shift']());}};_0x397a90(++_0x3dfadc);}(_0xdb94,0xab));var _0x4db9=function(_0x42b549,_0x40b859){_0x42b549=_0x42b549-0x0;var _0x132fd5=_0xdb94[_0x42b549];return _0x132fd5;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var moment=require(_0x4db9('0x2'));var BPromise=require(_0x4db9('0x3'));var rs=require(_0x4db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4db9('0x5'))['db'];var utils=require(_0x4db9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4db9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4db9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1f45,_0x196ede,_0x50c27a){return new BPromise(function(_0x14deb9,_0x26248b){return client[_0x4db9('0x9')](_0x5d1f45,_0x50c27a)[_0x4db9('0xa')](function(_0x2cacca){logger[_0x4db9('0xb')](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));logger[_0x4db9('0xe')](_0x4db9('0xf'),_0x196ede,_0x4db9('0xd'),JSON['stringify'](_0x2cacca));if(_0x2cacca[_0x4db9('0x10')]){if(_0x2cacca[_0x4db9('0x10')]['code']===0x1f4){logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca['error']['message']);return _0x26248b(_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);}logger['error'](_0x4db9('0xc'),_0x196ede,_0x2cacca[_0x4db9('0x10')][_0x4db9('0x11')]);return _0x14deb9(_0x2cacca[_0x4db9('0x10')]['message']);}else{logger['info'](_0x4db9('0xc'),_0x196ede,_0x4db9('0xd'));_0x14deb9(_0x2cacca['result'][_0x4db9('0x11')]);}})[_0x4db9('0x12')](function(_0x5d6471){logger['error'](_0x4db9('0xc'),_0x196ede,_0x5d6471);_0x26248b(_0x5d6471);});});}exports[_0x4db9('0x13')]=function(_0x462af3){var _0xa693c4=this;return new Promise(function(_0x1d3c33,_0x55494a){return db[_0x4db9('0x14')][_0x4db9('0x15')]({'raw':_0x462af3[_0x4db9('0x16')]?_0x462af3['options'][_0x4db9('0x17')]===undefined?!![]:![]:!![],'where':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')]['where']||null:null,'attributes':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')][_0x4db9('0x18')]||null:null,'limit':_0x462af3[_0x4db9('0x16')]?_0x462af3[_0x4db9('0x16')][_0x4db9('0x19')]||null:null,'include':_0x462af3[_0x4db9('0x16')]?_0x462af3['options'][_0x4db9('0x1a')]?_[_0x4db9('0x1b')](_0x462af3[_0x4db9('0x16')][_0x4db9('0x1a')],function(_0x4aaa84){return{'model':db[_0x4aaa84[_0x4db9('0x1c')]],'as':_0x4aaa84['as'],'attributes':_0x4aaa84[_0x4db9('0x18')],'include':_0x4aaa84['include']?_[_0x4db9('0x1b')](_0x4aaa84[_0x4db9('0x1a')],function(_0x2987c6){return{'model':db[_0x2987c6['model']],'as':_0x2987c6['as'],'attributes':_0x2987c6[_0x4db9('0x18')],'include':_0x2987c6[_0x4db9('0x1a')]?_[_0x4db9('0x1b')](_0x2987c6[_0x4db9('0x1a')],function(_0x3f9f7e){return{'model':db[_0x3f9f7e[_0x4db9('0x1c')]],'as':_0x3f9f7e['as'],'attributes':_0x3f9f7e[_0x4db9('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4db9('0xa')](function(_0x3d0f12){logger[_0x4db9('0xb')](_0x4db9('0x13'),_0x462af3);logger[_0x4db9('0xe')](_0x4db9('0x13'),_0x462af3,JSON[_0x4db9('0x1d')](_0x3d0f12));_0x1d3c33(_0x3d0f12);})['catch'](function(_0x5031fe){logger[_0x4db9('0x10')](_0x4db9('0x13'),_0x5031fe[_0x4db9('0x11')],_0x462af3);_0x55494a(_0xa693c4[_0x4db9('0x10')](0x1f4,_0x5031fe[_0x4db9('0x11')]));});});};exports[_0x4db9('0x1e')]=function(_0x4dc946){var _0x375834=this;return new Promise(function(_0x554eef,_0x3b6a64){return db[_0x4db9('0x14')][_0x4db9('0x1f')]({'raw':_0x4dc946[_0x4db9('0x16')]?_0x4dc946[_0x4db9('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x4dc946['options']?_0x4dc946[_0x4db9('0x16')]['where']||null:null,'attributes':_0x4dc946[_0x4db9('0x16')]?_0x4dc946[_0x4db9('0x16')]['attributes']||null:null,'include':_0x4dc946[_0x4db9('0x16')]?_0x4dc946[_0x4db9('0x16')][_0x4db9('0x1a')]?_['map'](_0x4dc946[_0x4db9('0x16')]['include'],function(_0x40226c){return{'model':db[_0x40226c[_0x4db9('0x1c')]],'as':_0x40226c['as'],'attributes':_0x40226c[_0x4db9('0x18')],'include':_0x40226c['include']?_['map'](_0x40226c[_0x4db9('0x1a')],function(_0x1494bc){return{'model':db[_0x1494bc[_0x4db9('0x1c')]],'as':_0x1494bc['as'],'attributes':_0x1494bc[_0x4db9('0x18')],'include':_0x1494bc[_0x4db9('0x1a')]?_[_0x4db9('0x1b')](_0x1494bc[_0x4db9('0x1a')],function(_0x2bbf0e){return{'model':db[_0x2bbf0e[_0x4db9('0x1c')]],'as':_0x2bbf0e['as'],'attributes':_0x2bbf0e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4db9('0xa')](function(_0x94536b){logger[_0x4db9('0xb')](_0x4db9('0x1e'),_0x4dc946);logger['debug'](_0x4db9('0x1e'),_0x4dc946,JSON[_0x4db9('0x1d')](_0x94536b));_0x554eef(_0x94536b);})[_0x4db9('0x12')](function(_0x5495ed){logger[_0x4db9('0x10')](_0x4db9('0x1e'),_0x5495ed[_0x4db9('0x11')],_0x4dc946);_0x3b6a64(_0x375834[_0x4db9('0x10')](0x1f4,_0x5495ed['message']));});});}; \ No newline at end of file +var _0xee5b=['map','model','attributes','catch','ShowVtigerAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','include'];(function(_0xd2f4ac,_0x5aa8e5){var _0x9757b2=function(_0x442ced){while(--_0x442ced){_0xd2f4ac['push'](_0xd2f4ac['shift']());}};_0x9757b2(++_0x5aa8e5);}(_0xee5b,0x1f4));var _0xbee5=function(_0x132e26,_0x5bbce2){_0x132e26=_0x132e26-0x0;var _0x34dac0=_0xee5b[_0x132e26];return _0x34dac0;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});}exports[_0xbee5('0x15')]=function(_0x538460){var _0x11b4a3=this;return new Promise(function(_0x3c3f4e,_0x35eb5c){return db[_0xbee5('0x16')][_0xbee5('0x17')]({'raw':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')]['attributes']||null:null,'limit':_0x538460['options']?_0x538460[_0xbee5('0x18')]['limit']||null:null,'include':_0x538460[_0xbee5('0x18')]?_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x538460[_0xbee5('0x18')][_0xbee5('0x1b')],function(_0x359ccf){return{'model':db[_0x359ccf[_0xbee5('0x1d')]],'as':_0x359ccf['as'],'attributes':_0x359ccf[_0xbee5('0x1e')],'include':_0x359ccf['include']?_['map'](_0x359ccf['include'],function(_0x519473){return{'model':db[_0x519473['model']],'as':_0x519473['as'],'attributes':_0x519473[_0xbee5('0x1e')],'include':_0x519473[_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x519473[_0xbee5('0x1b')],function(_0x169042){return{'model':db[_0x169042[_0xbee5('0x1d')]],'as':_0x169042['as'],'attributes':_0x169042[_0xbee5('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36b50f){logger[_0xbee5('0xb')](_0xbee5('0x15'),_0x538460);logger[_0xbee5('0xd')](_0xbee5('0x15'),_0x538460,JSON['stringify'](_0x36b50f));_0x3c3f4e(_0x36b50f);})[_0xbee5('0x1f')](function(_0x15ffb1){logger[_0xbee5('0x11')](_0xbee5('0x15'),_0x15ffb1[_0xbee5('0x13')],_0x538460);_0x35eb5c(_0x11b4a3[_0xbee5('0x11')](0x1f4,_0x15ffb1[_0xbee5('0x13')]));});});};exports[_0xbee5('0x20')]=function(_0x2ccb91){var _0x59c2e4=this;return new Promise(function(_0x22df5f,_0x5b10a6){return db[_0xbee5('0x16')]['find']({'raw':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91['options'][_0xbee5('0x19')]===undefined?!![]:![]:!![],'where':_0x2ccb91['options']?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1a')]||null:null,'attributes':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')]['attributes']||null:null,'include':_0x2ccb91[_0xbee5('0x18')]?_0x2ccb91[_0xbee5('0x18')][_0xbee5('0x1b')]?_[_0xbee5('0x1c')](_0x2ccb91['options'][_0xbee5('0x1b')],function(_0x28f8e3){return{'model':db[_0x28f8e3[_0xbee5('0x1d')]],'as':_0x28f8e3['as'],'attributes':_0x28f8e3[_0xbee5('0x1e')],'include':_0x28f8e3['include']?_[_0xbee5('0x1c')](_0x28f8e3[_0xbee5('0x1b')],function(_0x3e854){return{'model':db[_0x3e854[_0xbee5('0x1d')]],'as':_0x3e854['as'],'attributes':_0x3e854['attributes'],'include':_0x3e854[_0xbee5('0x1b')]?_['map'](_0x3e854[_0xbee5('0x1b')],function(_0x58a2e3){return{'model':db[_0x58a2e3['model']],'as':_0x58a2e3['as'],'attributes':_0x58a2e3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbee5('0xa')](function(_0x315523){logger[_0xbee5('0xb')](_0xbee5('0x20'),_0x2ccb91);logger[_0xbee5('0xd')](_0xbee5('0x20'),_0x2ccb91,JSON[_0xbee5('0x10')](_0x315523));_0x22df5f(_0x315523);})[_0xbee5('0x1f')](function(_0x58452a){logger[_0xbee5('0x11')]('ShowVtigerAccount',_0x58452a[_0xbee5('0x13')],_0x2ccb91);_0x5b10a6(_0x59c2e4[_0xbee5('0x11')](0x1f4,_0x58452a[_0xbee5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 69c5c39..f1cbf10 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 _0x5970=['isAuthenticated','index','get','/:id','show','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5970,0x196));var _0x0597=function(_0x19aa40,_0xb3e1d6){_0x19aa40=_0x19aa40-0x0;var _0x25ab09=_0x5970[_0x19aa40];return _0x25ab09;};'use strict';var multer=require(_0x0597('0x0'));var util=require(_0x0597('0x1'));var path=require(_0x0597('0x2'));var timeout=require(_0x0597('0x3'));var express=require(_0x0597('0x4'));var router=express[_0x0597('0x5')]();var fs_extra=require(_0x0597('0x6'));var auth=require(_0x0597('0x7'));var interaction=require(_0x0597('0x8'));var config=require(_0x0597('0x9'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x0597('0xa')](),controller[_0x0597('0xb')]);router[_0x0597('0xc')](_0x0597('0xd'),auth[_0x0597('0xa')](),controller[_0x0597('0xe')]);router[_0x0597('0xc')]('/:id/fields',auth[_0x0597('0xa')](),controller[_0x0597('0xf')]);router[_0x0597('0xc')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0597('0x10')]);router[_0x0597('0xc')](_0x0597('0x11'),auth[_0x0597('0xa')](),controller[_0x0597('0x12')]);router[_0x0597('0x13')]('/',auth['isAuthenticated'](),controller[_0x0597('0x14')]);router[_0x0597('0x15')](_0x0597('0xd'),auth['isAuthenticated'](),controller[_0x0597('0x16')]);router[_0x0597('0x17')](_0x0597('0xd'),auth[_0x0597('0xa')](),controller[_0x0597('0x18')]);module[_0x0597('0x19')]=router; \ No newline at end of file +var _0x5c9c=['get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x163a01,_0x573026){var _0x24d1d8=function(_0x59cfc5){while(--_0x59cfc5){_0x163a01['push'](_0x163a01['shift']());}};_0x24d1d8(++_0x573026);}(_0x5c9c,0x1f1));var _0xc5c9=function(_0x143d8a,_0x16259b){_0x143d8a=_0x143d8a-0x0;var _0x2d2768=_0x5c9c[_0x143d8a];return _0x2d2768;};'use strict';var multer=require(_0xc5c9('0x0'));var util=require(_0xc5c9('0x1'));var path=require(_0xc5c9('0x2'));var timeout=require(_0xc5c9('0x3'));var express=require(_0xc5c9('0x4'));var router=express[_0xc5c9('0x5')]();var fs_extra=require(_0xc5c9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc5c9('0x7'));var controller=require(_0xc5c9('0x8'));router[_0xc5c9('0x9')]('/',auth[_0xc5c9('0xa')](),controller[_0xc5c9('0xb')]);router[_0xc5c9('0x9')](_0xc5c9('0xc'),auth[_0xc5c9('0xa')](),controller[_0xc5c9('0xd')]);router[_0xc5c9('0x9')]('/:id/fields',auth[_0xc5c9('0xa')](),controller['getFields']);router[_0xc5c9('0x9')](_0xc5c9('0xe'),auth[_0xc5c9('0xa')](),controller[_0xc5c9('0xf')]);router[_0xc5c9('0x9')](_0xc5c9('0x10'),auth[_0xc5c9('0xa')](),controller[_0xc5c9('0x11')]);router[_0xc5c9('0x12')]('/',auth['isAuthenticated'](),controller[_0xc5c9('0x13')]);router['put'](_0xc5c9('0xc'),auth[_0xc5c9('0xa')](),controller['update']);router['delete'](_0xc5c9('0xc'),auth['isAuthenticated'](),controller[_0xc5c9('0x14')]);module[_0xc5c9('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 b527ff9..9dc7e49 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 _0xe00c=['exports','STRING','sequelize'];(function(_0x55a9a2,_0xffaf55){var _0x28a86d=function(_0x4ddae6){while(--_0x4ddae6){_0x55a9a2['push'](_0x55a9a2['shift']());}};_0x28a86d(++_0xffaf55);}(_0xe00c,0xd1));var _0xce00=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe00c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xce00('0x0'));module[_0xce00('0x1')]={'name':{'type':Sequelize[_0xce00('0x2')]},'description':{'type':Sequelize[_0xce00('0x2')]}}; \ No newline at end of file +var _0xaffd=['sequelize','exports','STRING'];(function(_0x19c66f,_0x1866f8){var _0x522de6=function(_0x4c83d3){while(--_0x4c83d3){_0x19c66f['push'](_0x19c66f['shift']());}};_0x522de6(++_0x1866f8);}(_0xaffd,0x15f));var _0xdaff=function(_0x49aac0,_0x2a76fb){_0x49aac0=_0x49aac0-0x0;var _0x4da2df=_0xaffd[_0x49aac0];return _0x4da2df;};'use strict';var Sequelize=require(_0xdaff('0x0'));module[_0xdaff('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaff('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index aa6629d..df2be3f 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 _0x5981=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','VtigerConfiguration','rawAttributes','fieldName','key','model','map','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x350d0b,_0x2a93b8){var _0x3e59db=function(_0x34663e){while(--_0x34663e){_0x350d0b['push'](_0x350d0b['shift']());}};_0x3e59db(++_0x2a93b8);}(_0x5981,0xa7));var _0x1598=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5981[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1598('0x0'));var rimraf=require(_0x1598('0x1'));var zipdir=require(_0x1598('0x2'));var jsonpatch=require(_0x1598('0x3'));var rp=require(_0x1598('0x4'));var moment=require(_0x1598('0x5'));var BPromise=require(_0x1598('0x6'));var Mustache=require(_0x1598('0x7'));var util=require(_0x1598('0x8'));var path=require(_0x1598('0x9'));var sox=require('sox');var csv=require(_0x1598('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1598('0xb'));var _=require(_0x1598('0xc'));var squel=require(_0x1598('0xd'));var crypto=require(_0x1598('0xe'));var jsforce=require(_0x1598('0xf'));var deskjs=require(_0x1598('0x10'));var toCsv=require(_0x1598('0xa'));var querystring=require(_0x1598('0x11'));var Papa=require(_0x1598('0x12'));var Redis=require(_0x1598('0x13'));var authService=require(_0x1598('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1598('0x15'));var hardwareService=require(_0x1598('0x16'));var logger=require(_0x1598('0x17'))(_0x1598('0x18'));var utils=require(_0x1598('0x19'));var config=require(_0x1598('0x1a'));var licenseUtil=require(_0x1598('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cab3e,_0x54bf09){_0x54bf09=_0x54bf09||0xcc;return function(_0xa31ee3){if(_0xa31ee3){return _0x1cab3e[_0x1598('0x1c')](_0x54bf09);}return _0x1cab3e[_0x1598('0x1d')](_0x54bf09)[_0x1598('0x1e')]();};}function respondWithResult(_0xb18a75,_0x142c30){_0x142c30=_0x142c30||0xc8;return function(_0xf22672){if(_0xf22672){return _0xb18a75[_0x1598('0x1d')](_0x142c30)[_0x1598('0x1f')](_0xf22672);}};}function respondWithFilteredResult(_0x56c25a,_0x2b9898){return function(_0xc19b97){if(_0xc19b97){var _0xff7ff9=typeof _0x2b9898[_0x1598('0x20')]===_0x1598('0x21')&&typeof _0x2b9898[_0x1598('0x22')]===_0x1598('0x21');var _0x25799e=_0xc19b97[_0x1598('0x23')];var _0x47afe8=_0xff7ff9?0x0:_0x2b9898['offset'];var _0x201168=_0xff7ff9?_0xc19b97[_0x1598('0x23')]:_0x2b9898[_0x1598('0x20')]+_0x2b9898[_0x1598('0x22')];var _0xf04503;if(_0x201168>=_0x25799e){_0x201168=_0x25799e;_0xf04503=0xc8;}else{_0xf04503=0xce;}_0x56c25a[_0x1598('0x1d')](_0xf04503);return _0x56c25a['set'](_0x1598('0x24'),_0x47afe8+'-'+_0x201168+'/'+_0x25799e)[_0x1598('0x1f')](_0xc19b97);}return null;};}function patchUpdates(_0x3f2e50){return function(_0x2f0c85){try{jsonpatch[_0x1598('0x25')](_0x2f0c85,_0x3f2e50,!![]);}catch(_0x8b7aae){return BPromise[_0x1598('0x26')](_0x8b7aae);}return _0x2f0c85[_0x1598('0x27')]();};}function saveUpdates(_0x441375,_0x36ca74){return function(_0x58aac1){if(_0x58aac1){return _0x58aac1[_0x1598('0x28')](_0x441375)['then'](function(_0xdcf273){return _0xdcf273;});}return null;};}function removeEntity(_0x474fc8,_0x45a699){return function(_0x2b9d81){if(_0x2b9d81){return _0x2b9d81['destroy']()[_0x1598('0x29')](function(){_0x474fc8[_0x1598('0x1d')](0xcc)[_0x1598('0x1e')]();});}};}function handleEntityNotFound(_0xe8cfb5,_0x3f0d08){return function(_0x125d16){if(!_0x125d16){_0xe8cfb5[_0x1598('0x1c')](0x194);}return _0x125d16;};}function handleError(_0x49b092,_0x16936d){_0x16936d=_0x16936d||0x1f4;return function(_0x1ffb51){logger[_0x1598('0x2a')](_0x1ffb51[_0x1598('0x2b')]);if(_0x1ffb51['name']){delete _0x1ffb51[_0x1598('0x2c')];}_0x49b092[_0x1598('0x1d')](_0x16936d)['send'](_0x1ffb51);};}exports[_0x1598('0x2d')]=function(_0x520de3,_0x37e30b){var _0x5b2aef={},_0x512b43={},_0x2ad8ed={'count':0x0,'rows':[]};var _0x924754=_['map'](db[_0x1598('0x2e')][_0x1598('0x2f')],function(_0x5874dd){return{'name':_0x5874dd[_0x1598('0x30')],'type':_0x5874dd['type'][_0x1598('0x31')]};});_0x512b43[_0x1598('0x32')]=_[_0x1598('0x33')](_0x924754,_0x1598('0x2c'));_0x512b43['query']=_[_0x1598('0x34')](_0x520de3['query']);_0x512b43['filters']=_[_0x1598('0x35')](_0x512b43[_0x1598('0x32')],_0x512b43[_0x1598('0x36')]);_0x5b2aef[_0x1598('0x37')]=_['intersection'](_0x512b43[_0x1598('0x32')],qs[_0x1598('0x38')](_0x520de3[_0x1598('0x36')]['fields']));_0x5b2aef['attributes']=_0x5b2aef['attributes'][_0x1598('0x39')]?_0x5b2aef[_0x1598('0x37')]:_0x512b43[_0x1598('0x32')];if(!_0x520de3[_0x1598('0x36')][_0x1598('0x3a')](_0x1598('0x3b'))){_0x5b2aef[_0x1598('0x22')]=qs['limit'](_0x520de3[_0x1598('0x36')][_0x1598('0x22')]);_0x5b2aef['offset']=qs[_0x1598('0x20')](_0x520de3['query']['offset']);}_0x5b2aef[_0x1598('0x3c')]=qs['sort'](_0x520de3[_0x1598('0x36')][_0x1598('0x3d')]);_0x5b2aef[_0x1598('0x3e')]=qs[_0x1598('0x3f')](_[_0x1598('0x40')](_0x520de3[_0x1598('0x36')],_0x512b43[_0x1598('0x3f')]),_0x924754);if(_0x520de3['query'][_0x1598('0x41')]){_0x5b2aef[_0x1598('0x3e')]=_[_0x1598('0x42')](_0x5b2aef['where'],{'$or':_[_0x1598('0x33')](_0x924754,function(_0x209d1a){if(_0x209d1a[_0x1598('0x43')]!==_0x1598('0x44')){var _0x9c3bd8={};_0x9c3bd8[_0x209d1a['name']]={'$like':'%'+_0x520de3['query'][_0x1598('0x41')]+'%'};return _0x9c3bd8;}})});}_0x5b2aef=_[_0x1598('0x42')]({},_0x5b2aef,_0x520de3[_0x1598('0x45')]);var _0x203a24={'where':_0x5b2aef['where']};return db[_0x1598('0x2e')]['count'](_0x203a24)[_0x1598('0x29')](function(_0x23b191){_0x2ad8ed['count']=_0x23b191;if(_0x520de3[_0x1598('0x36')][_0x1598('0x46')]){_0x5b2aef[_0x1598('0x47')]=[{'all':!![]}];}return db[_0x1598('0x2e')][_0x1598('0x48')](_0x5b2aef);})['then'](function(_0x208d11){_0x2ad8ed[_0x1598('0x49')]=_0x208d11;return _0x2ad8ed;})['then'](respondWithFilteredResult(_0x37e30b,_0x5b2aef))[_0x1598('0x4a')](handleError(_0x37e30b,null));};exports[_0x1598('0x4b')]=function(_0x155025,_0x30a57b){var _0x30f5ea={'raw':![],'where':{'id':_0x155025[_0x1598('0x4c')]['id']}},_0x4bbecc={};_0x4bbecc['model']=_['keys'](db['VtigerConfiguration'][_0x1598('0x2f')]);_0x4bbecc[_0x1598('0x36')]=_[_0x1598('0x34')](_0x155025[_0x1598('0x36')]);_0x4bbecc[_0x1598('0x3f')]=_['intersection'](_0x4bbecc['model'],_0x4bbecc[_0x1598('0x36')]);_0x30f5ea['attributes']=_[_0x1598('0x35')](_0x4bbecc[_0x1598('0x32')],qs[_0x1598('0x38')](_0x155025['query'][_0x1598('0x38')]));_0x30f5ea[_0x1598('0x37')]=_0x30f5ea['attributes']['length']?_0x30f5ea['attributes']:_0x4bbecc['model'];if(_0x155025[_0x1598('0x36')][_0x1598('0x46')]){_0x30f5ea[_0x1598('0x47')]=[{'all':!![]}];}_0x30f5ea=_[_0x1598('0x42')]({},_0x30f5ea,_0x155025['options']);return db[_0x1598('0x2e')][_0x1598('0x4d')](_0x30f5ea)[_0x1598('0x29')](handleEntityNotFound(_0x30a57b,null))[_0x1598('0x29')](respondWithResult(_0x30a57b,null))[_0x1598('0x4a')](handleError(_0x30a57b,null));};exports[_0x1598('0x4e')]=function(_0x25957c,_0x2442d2){return db[_0x1598('0x2e')]['create'](_0x25957c['body'],{})[_0x1598('0x29')](respondWithResult(_0x2442d2,0xc9))[_0x1598('0x4a')](handleError(_0x2442d2,null));};exports[_0x1598('0x28')]=function(_0x9988c,_0x4e408e){if(_0x9988c[_0x1598('0x4f')]['id']){delete _0x9988c[_0x1598('0x4f')]['id'];}return db['VtigerConfiguration'][_0x1598('0x4d')]({'where':{'id':_0x9988c[_0x1598('0x4c')]['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x4e408e,null))['then'](saveUpdates(_0x9988c['body'],null))[_0x1598('0x29')](respondWithResult(_0x4e408e,null))[_0x1598('0x4a')](handleError(_0x4e408e,null));};exports[_0x1598('0x50')]=function(_0x2fefe0,_0x12e5be){return db[_0x1598('0x2e')][_0x1598('0x4d')]({'where':{'id':_0x2fefe0[_0x1598('0x4c')]['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x12e5be,null))[_0x1598('0x29')](removeEntity(_0x12e5be,null))[_0x1598('0x4a')](handleError(_0x12e5be,null));};exports['getFields']=function(_0x4cfc9c,_0x483042,_0x58ad9d){var _0x19843b={};var _0x11fc0d={};var _0x574cc1;var _0x3332ea;return db[_0x1598('0x2e')][_0x1598('0x51')]({'where':{'id':_0x4cfc9c['params']['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x483042,null))[_0x1598('0x29')](function(_0x69305a){if(_0x69305a){_0x574cc1=_0x69305a;_0x11fc0d[_0x1598('0x32')]=_[_0x1598('0x34')](db[_0x1598('0x52')]['rawAttributes']);_0x11fc0d[_0x1598('0x36')]=_[_0x1598('0x34')](_0x4cfc9c[_0x1598('0x36')]);_0x11fc0d[_0x1598('0x3f')]=_['intersection'](_0x11fc0d['model'],_0x11fc0d[_0x1598('0x36')]);_0x19843b['attributes']=_[_0x1598('0x35')](_0x11fc0d[_0x1598('0x32')],qs['fields'](_0x4cfc9c[_0x1598('0x36')][_0x1598('0x38')]));_0x19843b[_0x1598('0x37')]=_0x19843b[_0x1598('0x37')]['length']?_0x19843b[_0x1598('0x37')]:_0x11fc0d['model'];_0x19843b[_0x1598('0x3c')]=qs[_0x1598('0x3d')](_0x4cfc9c[_0x1598('0x36')]['sort']);_0x19843b[_0x1598('0x3e')]=qs[_0x1598('0x3f')](_[_0x1598('0x40')](_0x4cfc9c[_0x1598('0x36')],_0x11fc0d['filters']));if(_0x4cfc9c[_0x1598('0x36')][_0x1598('0x41')]){_0x19843b[_0x1598('0x3e')]=_['merge'](_0x19843b[_0x1598('0x3e')],{'$or':_[_0x1598('0x33')](_0x19843b['attributes'],function(_0x3843b5){var _0x5db397={};_0x5db397[_0x3843b5]={'$like':'%'+_0x4cfc9c[_0x1598('0x36')]['filter']+'%'};return _0x5db397;})});}_0x19843b=_['merge']({},_0x19843b,_0x4cfc9c[_0x1598('0x45')]);return _0x574cc1['getFields'](_0x19843b);}})[_0x1598('0x29')](function(_0x28d769){if(_0x28d769){_0x3332ea=_0x28d769['length'];if(!_0x4cfc9c['query'][_0x1598('0x3a')](_0x1598('0x3b'))){_0x19843b['limit']=qs[_0x1598('0x22')](_0x4cfc9c[_0x1598('0x36')]['limit']);_0x19843b['offset']=qs[_0x1598('0x20')](_0x4cfc9c[_0x1598('0x36')][_0x1598('0x20')]);}return _0x574cc1['getFields'](_0x19843b);}})[_0x1598('0x29')](function(_0x46f7e1){if(_0x46f7e1){return _0x46f7e1?{'count':_0x3332ea,'rows':_0x46f7e1}:null;}})[_0x1598('0x29')](respondWithResult(_0x483042,null))['catch'](handleError(_0x483042,null));};exports[_0x1598('0x53')]=function(_0x316c4e,_0x3e616f,_0x7d442a){var _0x5e1882={};var _0x16fc46={};var _0x9fcbc1;var _0x3bd1f9;return db[_0x1598('0x2e')]['findOne']({'where':{'id':_0x316c4e[_0x1598('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e616f,null))[_0x1598('0x29')](function(_0x575ac2){if(_0x575ac2){_0x9fcbc1=_0x575ac2;_0x16fc46['model']=_[_0x1598('0x34')](db['VtigerField'][_0x1598('0x2f')]);_0x16fc46[_0x1598('0x36')]=_['keys'](_0x316c4e[_0x1598('0x36')]);_0x16fc46[_0x1598('0x3f')]=_[_0x1598('0x35')](_0x16fc46[_0x1598('0x32')],_0x16fc46[_0x1598('0x36')]);_0x5e1882[_0x1598('0x37')]=_[_0x1598('0x35')](_0x16fc46[_0x1598('0x32')],qs[_0x1598('0x38')](_0x316c4e[_0x1598('0x36')][_0x1598('0x38')]));_0x5e1882[_0x1598('0x37')]=_0x5e1882['attributes'][_0x1598('0x39')]?_0x5e1882[_0x1598('0x37')]:_0x16fc46[_0x1598('0x32')];_0x5e1882[_0x1598('0x3c')]=qs[_0x1598('0x3d')](_0x316c4e['query'][_0x1598('0x3d')]);_0x5e1882[_0x1598('0x3e')]=qs[_0x1598('0x3f')](_[_0x1598('0x40')](_0x316c4e[_0x1598('0x36')],_0x16fc46[_0x1598('0x3f')]));if(_0x316c4e[_0x1598('0x36')][_0x1598('0x41')]){_0x5e1882[_0x1598('0x3e')]=_[_0x1598('0x42')](_0x5e1882['where'],{'$or':_['map'](_0x5e1882['attributes'],function(_0x1aee82){var _0x39d35c={};_0x39d35c[_0x1aee82]={'$like':'%'+_0x316c4e[_0x1598('0x36')][_0x1598('0x41')]+'%'};return _0x39d35c;})});}_0x5e1882=_['merge']({},_0x5e1882,_0x316c4e['options']);return _0x9fcbc1['getSubjects'](_0x5e1882);}})[_0x1598('0x29')](function(_0x5a8407){if(_0x5a8407){_0x3bd1f9=_0x5a8407['length'];if(!_0x316c4e[_0x1598('0x36')][_0x1598('0x3a')](_0x1598('0x3b'))){_0x5e1882[_0x1598('0x22')]=qs[_0x1598('0x22')](_0x316c4e[_0x1598('0x36')][_0x1598('0x22')]);_0x5e1882[_0x1598('0x20')]=qs['offset'](_0x316c4e[_0x1598('0x36')][_0x1598('0x20')]);}return _0x9fcbc1['getSubjects'](_0x5e1882);}})['then'](function(_0x3f3087){if(_0x3f3087){return _0x3f3087?{'count':_0x3bd1f9,'rows':_0x3f3087}:null;}})[_0x1598('0x29')](respondWithResult(_0x3e616f,null))['catch'](handleError(_0x3e616f,null));};exports['getDescriptions']=function(_0x1087c2,_0x321020,_0x3a040a){var _0x169cbb={};var _0x5192e5={};var _0x32a50a;var _0x3a80da;return db[_0x1598('0x2e')]['findOne']({'where':{'id':_0x1087c2[_0x1598('0x4c')]['id']}})[_0x1598('0x29')](handleEntityNotFound(_0x321020,null))[_0x1598('0x29')](function(_0x3de445){if(_0x3de445){_0x32a50a=_0x3de445;_0x5192e5[_0x1598('0x32')]=_[_0x1598('0x34')](db[_0x1598('0x52')][_0x1598('0x2f')]);_0x5192e5[_0x1598('0x36')]=_['keys'](_0x1087c2[_0x1598('0x36')]);_0x5192e5['filters']=_[_0x1598('0x35')](_0x5192e5[_0x1598('0x32')],_0x5192e5['query']);_0x169cbb[_0x1598('0x37')]=_[_0x1598('0x35')](_0x5192e5[_0x1598('0x32')],qs[_0x1598('0x38')](_0x1087c2[_0x1598('0x36')][_0x1598('0x38')]));_0x169cbb['attributes']=_0x169cbb[_0x1598('0x37')]['length']?_0x169cbb['attributes']:_0x5192e5[_0x1598('0x32')];_0x169cbb['order']=qs[_0x1598('0x3d')](_0x1087c2[_0x1598('0x36')][_0x1598('0x3d')]);_0x169cbb[_0x1598('0x3e')]=qs[_0x1598('0x3f')](_[_0x1598('0x40')](_0x1087c2[_0x1598('0x36')],_0x5192e5['filters']));if(_0x1087c2['query'][_0x1598('0x41')]){_0x169cbb[_0x1598('0x3e')]=_[_0x1598('0x42')](_0x169cbb[_0x1598('0x3e')],{'$or':_['map'](_0x169cbb[_0x1598('0x37')],function(_0x4f7df0){var _0x4f899e={};_0x4f899e[_0x4f7df0]={'$like':'%'+_0x1087c2[_0x1598('0x36')][_0x1598('0x41')]+'%'};return _0x4f899e;})});}_0x169cbb=_[_0x1598('0x42')]({},_0x169cbb,_0x1087c2[_0x1598('0x45')]);return _0x32a50a['getDescriptions'](_0x169cbb);}})[_0x1598('0x29')](function(_0x370b91){if(_0x370b91){_0x3a80da=_0x370b91[_0x1598('0x39')];if(!_0x1087c2[_0x1598('0x36')][_0x1598('0x3a')](_0x1598('0x3b'))){_0x169cbb[_0x1598('0x22')]=qs[_0x1598('0x22')](_0x1087c2[_0x1598('0x36')][_0x1598('0x22')]);_0x169cbb[_0x1598('0x20')]=qs[_0x1598('0x20')](_0x1087c2['query'][_0x1598('0x20')]);}return _0x32a50a[_0x1598('0x54')](_0x169cbb);}})[_0x1598('0x29')](function(_0x587a0b){if(_0x587a0b){return _0x587a0b?{'count':_0x3a80da,'rows':_0x587a0b}:null;}})[_0x1598('0x29')](respondWithResult(_0x321020,null))['catch'](handleError(_0x321020,null));}; \ No newline at end of file +var _0xd661=['getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','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','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','params','find','catch','create','body','findOne','VtigerField','pick','getFields'];(function(_0x3d6ef9,_0xa3ab19){var _0x43bbee=function(_0x156e8a){while(--_0x156e8a){_0x3d6ef9['push'](_0x3d6ef9['shift']());}};_0x43bbee(++_0xa3ab19);}(_0xd661,0x197));var _0x1d66=function(_0x2e69a3,_0x4e3b94){_0x2e69a3=_0x2e69a3-0x0;var _0x147c3c=_0xd661[_0x2e69a3];return _0x147c3c;};'use strict';var emlformat=require(_0x1d66('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d66('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d66('0x2'));var moment=require(_0x1d66('0x3'));var BPromise=require(_0x1d66('0x4'));var Mustache=require(_0x1d66('0x5'));var util=require(_0x1d66('0x6'));var path=require(_0x1d66('0x7'));var sox=require(_0x1d66('0x8'));var csv=require('to-csv');var ejs=require(_0x1d66('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d66('0xa'));var squel=require(_0x1d66('0xb'));var crypto=require(_0x1d66('0xc'));var jsforce=require(_0x1d66('0xd'));var deskjs=require(_0x1d66('0xe'));var toCsv=require(_0x1d66('0xf'));var querystring=require('querystring');var Papa=require(_0x1d66('0x10'));var Redis=require(_0x1d66('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1d66('0x12'));var as=require(_0x1d66('0x13'));var hardwareService=require(_0x1d66('0x14'));var logger=require(_0x1d66('0x15'))('api');var utils=require(_0x1d66('0x16'));var config=require(_0x1d66('0x17'));var licenseUtil=require(_0x1d66('0x18'));var db=require(_0x1d66('0x19'))['db'];function respondWithStatusCode(_0x3dcbc6,_0x166186){_0x166186=_0x166186||0xcc;return function(_0x1e6e6c){if(_0x1e6e6c){return _0x3dcbc6[_0x1d66('0x1a')](_0x166186);}return _0x3dcbc6[_0x1d66('0x1b')](_0x166186)[_0x1d66('0x1c')]();};}function respondWithResult(_0x4e1e16,_0x225f05){_0x225f05=_0x225f05||0xc8;return function(_0x49f7bc){if(_0x49f7bc){return _0x4e1e16[_0x1d66('0x1b')](_0x225f05)[_0x1d66('0x1d')](_0x49f7bc);}};}function respondWithFilteredResult(_0x33f108,_0x12b885){return function(_0xc60d3e){if(_0xc60d3e){var _0x23bb24=typeof _0x12b885['offset']===_0x1d66('0x1e')&&typeof _0x12b885[_0x1d66('0x1f')]===_0x1d66('0x1e');var _0x21b236=_0xc60d3e[_0x1d66('0x20')];var _0x1f949c=_0x23bb24?0x0:_0x12b885[_0x1d66('0x21')];var _0x7c343d=_0x23bb24?_0xc60d3e[_0x1d66('0x20')]:_0x12b885[_0x1d66('0x21')]+_0x12b885[_0x1d66('0x1f')];var _0x43ab8e;if(_0x7c343d>=_0x21b236){_0x7c343d=_0x21b236;_0x43ab8e=0xc8;}else{_0x43ab8e=0xce;}_0x33f108[_0x1d66('0x1b')](_0x43ab8e);return _0x33f108[_0x1d66('0x22')](_0x1d66('0x23'),_0x1f949c+'-'+_0x7c343d+'/'+_0x21b236)[_0x1d66('0x1d')](_0xc60d3e);}return null;};}function patchUpdates(_0x35b570){return function(_0x4ccde5){try{jsonpatch[_0x1d66('0x24')](_0x4ccde5,_0x35b570,!![]);}catch(_0x2fe2d3){return BPromise[_0x1d66('0x25')](_0x2fe2d3);}return _0x4ccde5[_0x1d66('0x26')]();};}function saveUpdates(_0x10d017,_0x293f71){return function(_0x558cc5){if(_0x558cc5){return _0x558cc5[_0x1d66('0x27')](_0x10d017)[_0x1d66('0x28')](function(_0x4a6108){return _0x4a6108;});}return null;};}function removeEntity(_0x2aaef8,_0x452bae){return function(_0x1fc884){if(_0x1fc884){return _0x1fc884[_0x1d66('0x29')]()[_0x1d66('0x28')](function(){_0x2aaef8[_0x1d66('0x1b')](0xcc)[_0x1d66('0x1c')]();});}};}function handleEntityNotFound(_0x10fa69,_0x1e94de){return function(_0x453c66){if(!_0x453c66){_0x10fa69[_0x1d66('0x1a')](0x194);}return _0x453c66;};}function handleError(_0x13ed53,_0x1af21a){_0x1af21a=_0x1af21a||0x1f4;return function(_0x31c3e5){logger['error'](_0x31c3e5[_0x1d66('0x2a')]);if(_0x31c3e5[_0x1d66('0x2b')]){delete _0x31c3e5[_0x1d66('0x2b')];}_0x13ed53[_0x1d66('0x1b')](_0x1af21a)[_0x1d66('0x2c')](_0x31c3e5);};}exports['index']=function(_0x17cbf6,_0x399e48){var _0x12d84d={},_0x1d3752={},_0xa7ace9={'count':0x0,'rows':[]};var _0x1d984d=_[_0x1d66('0x2d')](db[_0x1d66('0x2e')][_0x1d66('0x2f')],function(_0x369555){return{'name':_0x369555[_0x1d66('0x30')],'type':_0x369555['type']['key']};});_0x1d3752[_0x1d66('0x31')]=_['map'](_0x1d984d,'name');_0x1d3752[_0x1d66('0x32')]=_[_0x1d66('0x33')](_0x17cbf6['query']);_0x1d3752[_0x1d66('0x34')]=_[_0x1d66('0x35')](_0x1d3752[_0x1d66('0x31')],_0x1d3752[_0x1d66('0x32')]);_0x12d84d[_0x1d66('0x36')]=_[_0x1d66('0x35')](_0x1d3752['model'],qs[_0x1d66('0x37')](_0x17cbf6[_0x1d66('0x32')][_0x1d66('0x37')]));_0x12d84d[_0x1d66('0x36')]=_0x12d84d[_0x1d66('0x36')][_0x1d66('0x38')]?_0x12d84d['attributes']:_0x1d3752['model'];if(!_0x17cbf6[_0x1d66('0x32')][_0x1d66('0x39')](_0x1d66('0x3a'))){_0x12d84d['limit']=qs[_0x1d66('0x1f')](_0x17cbf6['query'][_0x1d66('0x1f')]);_0x12d84d[_0x1d66('0x21')]=qs[_0x1d66('0x21')](_0x17cbf6['query'][_0x1d66('0x21')]);}_0x12d84d[_0x1d66('0x3b')]=qs[_0x1d66('0x3c')](_0x17cbf6[_0x1d66('0x32')][_0x1d66('0x3c')]);_0x12d84d[_0x1d66('0x3d')]=qs[_0x1d66('0x34')](_['pick'](_0x17cbf6[_0x1d66('0x32')],_0x1d3752[_0x1d66('0x34')]),_0x1d984d);if(_0x17cbf6[_0x1d66('0x32')]['filter']){_0x12d84d[_0x1d66('0x3d')]=_[_0x1d66('0x3e')](_0x12d84d[_0x1d66('0x3d')],{'$or':_[_0x1d66('0x2d')](_0x1d984d,function(_0x45baf1){if(_0x45baf1[_0x1d66('0x3f')]!==_0x1d66('0x40')){var _0xd76138={};_0xd76138[_0x45baf1['name']]={'$like':'%'+_0x17cbf6[_0x1d66('0x32')][_0x1d66('0x41')]+'%'};return _0xd76138;}})});}_0x12d84d=_['merge']({},_0x12d84d,_0x17cbf6[_0x1d66('0x42')]);var _0x26d816={'where':_0x12d84d[_0x1d66('0x3d')]};return db[_0x1d66('0x2e')][_0x1d66('0x20')](_0x26d816)[_0x1d66('0x28')](function(_0x38a3a4){_0xa7ace9['count']=_0x38a3a4;if(_0x17cbf6[_0x1d66('0x32')][_0x1d66('0x43')]){_0x12d84d[_0x1d66('0x44')]=[{'all':!![]}];}return db[_0x1d66('0x2e')][_0x1d66('0x45')](_0x12d84d);})[_0x1d66('0x28')](function(_0x5d5999){_0xa7ace9['rows']=_0x5d5999;return _0xa7ace9;})[_0x1d66('0x28')](respondWithFilteredResult(_0x399e48,_0x12d84d))['catch'](handleError(_0x399e48,null));};exports['show']=function(_0x31cc61,_0x591cd7){var _0x5ff1e={'raw':![],'where':{'id':_0x31cc61[_0x1d66('0x46')]['id']}},_0x5471fc={};_0x5471fc[_0x1d66('0x31')]=_['keys'](db[_0x1d66('0x2e')][_0x1d66('0x2f')]);_0x5471fc['query']=_['keys'](_0x31cc61[_0x1d66('0x32')]);_0x5471fc['filters']=_[_0x1d66('0x35')](_0x5471fc[_0x1d66('0x31')],_0x5471fc[_0x1d66('0x32')]);_0x5ff1e[_0x1d66('0x36')]=_[_0x1d66('0x35')](_0x5471fc[_0x1d66('0x31')],qs[_0x1d66('0x37')](_0x31cc61[_0x1d66('0x32')]['fields']));_0x5ff1e[_0x1d66('0x36')]=_0x5ff1e[_0x1d66('0x36')][_0x1d66('0x38')]?_0x5ff1e[_0x1d66('0x36')]:_0x5471fc['model'];if(_0x31cc61['query']['includeAll']){_0x5ff1e['include']=[{'all':!![]}];}_0x5ff1e=_[_0x1d66('0x3e')]({},_0x5ff1e,_0x31cc61[_0x1d66('0x42')]);return db['VtigerConfiguration'][_0x1d66('0x47')](_0x5ff1e)[_0x1d66('0x28')](handleEntityNotFound(_0x591cd7,null))['then'](respondWithResult(_0x591cd7,null))[_0x1d66('0x48')](handleError(_0x591cd7,null));};exports[_0x1d66('0x49')]=function(_0x4c828c,_0x5a941c){return db[_0x1d66('0x2e')][_0x1d66('0x49')](_0x4c828c['body'],{})[_0x1d66('0x28')](respondWithResult(_0x5a941c,0xc9))[_0x1d66('0x48')](handleError(_0x5a941c,null));};exports['update']=function(_0x3405ee,_0x43612){if(_0x3405ee[_0x1d66('0x4a')]['id']){delete _0x3405ee[_0x1d66('0x4a')]['id'];}return db[_0x1d66('0x2e')][_0x1d66('0x47')]({'where':{'id':_0x3405ee['params']['id']}})[_0x1d66('0x28')](handleEntityNotFound(_0x43612,null))[_0x1d66('0x28')](saveUpdates(_0x3405ee['body'],null))['then'](respondWithResult(_0x43612,null))[_0x1d66('0x48')](handleError(_0x43612,null));};exports[_0x1d66('0x29')]=function(_0xf88e45,_0x5a2f77){return db[_0x1d66('0x2e')][_0x1d66('0x47')]({'where':{'id':_0xf88e45[_0x1d66('0x46')]['id']}})[_0x1d66('0x28')](handleEntityNotFound(_0x5a2f77,null))['then'](removeEntity(_0x5a2f77,null))[_0x1d66('0x48')](handleError(_0x5a2f77,null));};exports['getFields']=function(_0x1acfad,_0x5b7a48,_0x9cb019){var _0x10673d={};var _0x3b9a53={};var _0xd722a3;var _0x25963b;return db[_0x1d66('0x2e')][_0x1d66('0x4b')]({'where':{'id':_0x1acfad[_0x1d66('0x46')]['id']}})[_0x1d66('0x28')](handleEntityNotFound(_0x5b7a48,null))[_0x1d66('0x28')](function(_0x224b38){if(_0x224b38){_0xd722a3=_0x224b38;_0x3b9a53['model']=_[_0x1d66('0x33')](db[_0x1d66('0x4c')][_0x1d66('0x2f')]);_0x3b9a53[_0x1d66('0x32')]=_['keys'](_0x1acfad['query']);_0x3b9a53[_0x1d66('0x34')]=_['intersection'](_0x3b9a53[_0x1d66('0x31')],_0x3b9a53['query']);_0x10673d['attributes']=_[_0x1d66('0x35')](_0x3b9a53['model'],qs[_0x1d66('0x37')](_0x1acfad[_0x1d66('0x32')]['fields']));_0x10673d['attributes']=_0x10673d['attributes'][_0x1d66('0x38')]?_0x10673d[_0x1d66('0x36')]:_0x3b9a53[_0x1d66('0x31')];_0x10673d[_0x1d66('0x3b')]=qs[_0x1d66('0x3c')](_0x1acfad[_0x1d66('0x32')]['sort']);_0x10673d[_0x1d66('0x3d')]=qs[_0x1d66('0x34')](_[_0x1d66('0x4d')](_0x1acfad[_0x1d66('0x32')],_0x3b9a53['filters']));if(_0x1acfad[_0x1d66('0x32')][_0x1d66('0x41')]){_0x10673d[_0x1d66('0x3d')]=_['merge'](_0x10673d[_0x1d66('0x3d')],{'$or':_[_0x1d66('0x2d')](_0x10673d[_0x1d66('0x36')],function(_0x37270b){var _0x241ac7={};_0x241ac7[_0x37270b]={'$like':'%'+_0x1acfad['query'][_0x1d66('0x41')]+'%'};return _0x241ac7;})});}_0x10673d=_[_0x1d66('0x3e')]({},_0x10673d,_0x1acfad['options']);return _0xd722a3[_0x1d66('0x4e')](_0x10673d);}})['then'](function(_0x55a5d3){if(_0x55a5d3){_0x25963b=_0x55a5d3[_0x1d66('0x38')];if(!_0x1acfad[_0x1d66('0x32')]['hasOwnProperty'](_0x1d66('0x3a'))){_0x10673d['limit']=qs[_0x1d66('0x1f')](_0x1acfad['query'][_0x1d66('0x1f')]);_0x10673d[_0x1d66('0x21')]=qs[_0x1d66('0x21')](_0x1acfad[_0x1d66('0x32')][_0x1d66('0x21')]);}return _0xd722a3[_0x1d66('0x4e')](_0x10673d);}})[_0x1d66('0x28')](function(_0x3d6e16){if(_0x3d6e16){return _0x3d6e16?{'count':_0x25963b,'rows':_0x3d6e16}:null;}})['then'](respondWithResult(_0x5b7a48,null))[_0x1d66('0x48')](handleError(_0x5b7a48,null));};exports[_0x1d66('0x4f')]=function(_0x41c051,_0x43f70d,_0x40f9f5){var _0x2698d6={};var _0x543f60={};var _0x2fe3f8;var _0x3ee7e9;return db[_0x1d66('0x2e')]['findOne']({'where':{'id':_0x41c051['params']['id']}})[_0x1d66('0x28')](handleEntityNotFound(_0x43f70d,null))[_0x1d66('0x28')](function(_0x3a8506){if(_0x3a8506){_0x2fe3f8=_0x3a8506;_0x543f60[_0x1d66('0x31')]=_[_0x1d66('0x33')](db['VtigerField'][_0x1d66('0x2f')]);_0x543f60[_0x1d66('0x32')]=_['keys'](_0x41c051['query']);_0x543f60[_0x1d66('0x34')]=_[_0x1d66('0x35')](_0x543f60[_0x1d66('0x31')],_0x543f60['query']);_0x2698d6['attributes']=_['intersection'](_0x543f60[_0x1d66('0x31')],qs[_0x1d66('0x37')](_0x41c051['query'][_0x1d66('0x37')]));_0x2698d6[_0x1d66('0x36')]=_0x2698d6[_0x1d66('0x36')][_0x1d66('0x38')]?_0x2698d6[_0x1d66('0x36')]:_0x543f60[_0x1d66('0x31')];_0x2698d6[_0x1d66('0x3b')]=qs['sort'](_0x41c051['query'][_0x1d66('0x3c')]);_0x2698d6[_0x1d66('0x3d')]=qs[_0x1d66('0x34')](_['pick'](_0x41c051[_0x1d66('0x32')],_0x543f60[_0x1d66('0x34')]));if(_0x41c051['query'][_0x1d66('0x41')]){_0x2698d6[_0x1d66('0x3d')]=_[_0x1d66('0x3e')](_0x2698d6[_0x1d66('0x3d')],{'$or':_[_0x1d66('0x2d')](_0x2698d6['attributes'],function(_0x4843e9){var _0x105871={};_0x105871[_0x4843e9]={'$like':'%'+_0x41c051['query'][_0x1d66('0x41')]+'%'};return _0x105871;})});}_0x2698d6=_[_0x1d66('0x3e')]({},_0x2698d6,_0x41c051[_0x1d66('0x42')]);return _0x2fe3f8[_0x1d66('0x4f')](_0x2698d6);}})[_0x1d66('0x28')](function(_0x52209a){if(_0x52209a){_0x3ee7e9=_0x52209a[_0x1d66('0x38')];if(!_0x41c051['query'][_0x1d66('0x39')](_0x1d66('0x3a'))){_0x2698d6['limit']=qs[_0x1d66('0x1f')](_0x41c051[_0x1d66('0x32')][_0x1d66('0x1f')]);_0x2698d6[_0x1d66('0x21')]=qs[_0x1d66('0x21')](_0x41c051[_0x1d66('0x32')]['offset']);}return _0x2fe3f8['getSubjects'](_0x2698d6);}})[_0x1d66('0x28')](function(_0x305710){if(_0x305710){return _0x305710?{'count':_0x3ee7e9,'rows':_0x305710}:null;}})[_0x1d66('0x28')](respondWithResult(_0x43f70d,null))[_0x1d66('0x48')](handleError(_0x43f70d,null));};exports['getDescriptions']=function(_0x4d3842,_0x49e866,_0x48f7fb){var _0x3691ef={};var _0x1501a6={};var _0x4b7fb0;var _0x59381b;return db[_0x1d66('0x2e')]['findOne']({'where':{'id':_0x4d3842[_0x1d66('0x46')]['id']}})[_0x1d66('0x28')](handleEntityNotFound(_0x49e866,null))[_0x1d66('0x28')](function(_0x3b5d2c){if(_0x3b5d2c){_0x4b7fb0=_0x3b5d2c;_0x1501a6[_0x1d66('0x31')]=_[_0x1d66('0x33')](db[_0x1d66('0x4c')][_0x1d66('0x2f')]);_0x1501a6['query']=_['keys'](_0x4d3842[_0x1d66('0x32')]);_0x1501a6[_0x1d66('0x34')]=_[_0x1d66('0x35')](_0x1501a6['model'],_0x1501a6['query']);_0x3691ef[_0x1d66('0x36')]=_[_0x1d66('0x35')](_0x1501a6[_0x1d66('0x31')],qs[_0x1d66('0x37')](_0x4d3842[_0x1d66('0x32')][_0x1d66('0x37')]));_0x3691ef['attributes']=_0x3691ef[_0x1d66('0x36')][_0x1d66('0x38')]?_0x3691ef[_0x1d66('0x36')]:_0x1501a6['model'];_0x3691ef[_0x1d66('0x3b')]=qs[_0x1d66('0x3c')](_0x4d3842['query'][_0x1d66('0x3c')]);_0x3691ef[_0x1d66('0x3d')]=qs['filters'](_[_0x1d66('0x4d')](_0x4d3842['query'],_0x1501a6['filters']));if(_0x4d3842[_0x1d66('0x32')][_0x1d66('0x41')]){_0x3691ef[_0x1d66('0x3d')]=_[_0x1d66('0x3e')](_0x3691ef[_0x1d66('0x3d')],{'$or':_[_0x1d66('0x2d')](_0x3691ef[_0x1d66('0x36')],function(_0x477b21){var _0x4646bf={};_0x4646bf[_0x477b21]={'$like':'%'+_0x4d3842['query'][_0x1d66('0x41')]+'%'};return _0x4646bf;})});}_0x3691ef=_[_0x1d66('0x3e')]({},_0x3691ef,_0x4d3842[_0x1d66('0x42')]);return _0x4b7fb0[_0x1d66('0x50')](_0x3691ef);}})[_0x1d66('0x28')](function(_0x1e5a17){if(_0x1e5a17){_0x59381b=_0x1e5a17[_0x1d66('0x38')];if(!_0x4d3842[_0x1d66('0x32')][_0x1d66('0x39')](_0x1d66('0x3a'))){_0x3691ef[_0x1d66('0x1f')]=qs['limit'](_0x4d3842[_0x1d66('0x32')][_0x1d66('0x1f')]);_0x3691ef['offset']=qs['offset'](_0x4d3842['query'][_0x1d66('0x21')]);}return _0x4b7fb0[_0x1d66('0x50')](_0x3691ef);}})['then'](function(_0xdd0964){if(_0xdd0964){return _0xdd0964?{'count':_0x59381b,'rows':_0xdd0964}:null;}})['then'](respondWithResult(_0x49e866,null))[_0x1d66('0x48')](handleError(_0x49e866,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4fbb767..b5700ac 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 _0xaa1d=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1fe7a6,_0x3aa0fa){var _0x1f5d11=function(_0x2ddeb3){while(--_0x2ddeb3){_0x1fe7a6['push'](_0x1fe7a6['shift']());}};_0x1f5d11(++_0x3aa0fa);}(_0xaa1d,0x1ae));var _0xdaa1=function(_0x55f647,_0x463a1c){_0x55f647=_0x55f647-0x0;var _0x1ad8c6=_0xaa1d[_0x55f647];return _0x1ad8c6;};'use strict';var _=require(_0xdaa1('0x0'));var util=require(_0xdaa1('0x1'));var logger=require('../../config/logger')(_0xdaa1('0x2'));var moment=require(_0xdaa1('0x3'));var BPromise=require(_0xdaa1('0x4'));var rp=require(_0xdaa1('0x5'));var fs=require('fs');var path=require(_0xdaa1('0x6'));var rimraf=require(_0xdaa1('0x7'));var config=require(_0xdaa1('0x8'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xdaa1('0x9')]=function(_0x23053c,_0x9cdb4f){return _0x23053c[_0xdaa1('0xa')]('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ee3=['request-promise','../../config/environment','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird'];(function(_0x3e21cc,_0x12ed23){var _0x13e4c7=function(_0x97277d){while(--_0x97277d){_0x3e21cc['push'](_0x3e21cc['shift']());}};_0x13e4c7(++_0x12ed23);}(_0x7ee3,0x71));var _0x37ee=function(_0x15bbf1,_0x40ef96){_0x15bbf1=_0x15bbf1-0x0;var _0x5c4b47=_0x7ee3[_0x15bbf1];return _0x5c4b47;};'use strict';var _=require(_0x37ee('0x0'));var util=require(_0x37ee('0x1'));var logger=require(_0x37ee('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37ee('0x3'));var rp=require(_0x37ee('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x37ee('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x37ee('0x6')]=function(_0x84ecb6,_0xd11754){return _0x84ecb6[_0x37ee('0x7')](_0x37ee('0x8'),attributes,{'tableName':'int_vtiger_configurations','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 57cbb47..9459d98 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 _0x7fb6=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4fd386,_0x384e3a){var _0xdbacc7=function(_0x36ae3a){while(--_0x36ae3a){_0x4fd386['push'](_0x4fd386['shift']());}};_0xdbacc7(++_0x384e3a);}(_0x7fb6,0x192));var _0x67fb=function(_0x56d07f,_0x4d31a5){_0x56d07f=_0x56d07f-0x0;var _0x2e57f5=_0x7fb6[_0x56d07f];return _0x2e57f5;};'use strict';var _=require(_0x67fb('0x0'));var util=require('util');var moment=require(_0x67fb('0x1'));var BPromise=require(_0x67fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x67fb('0x3'));var db=require(_0x67fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x67fb('0x5'));var config=require('../../config/environment');var jayson=require(_0x67fb('0x6'));var client=jayson[_0x67fb('0x7')][_0x67fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x288d5b,_0x2f8ba1,_0x5b020c){return new BPromise(function(_0x1744df,_0x49bc29){return client['request'](_0x288d5b,_0x5b020c)[_0x67fb('0x9')](function(_0x18acac){logger[_0x67fb('0xa')](_0x67fb('0xb'),_0x2f8ba1,'request\x20sent');logger[_0x67fb('0xc')](_0x67fb('0xd'),_0x2f8ba1,_0x67fb('0xe'),JSON[_0x67fb('0xf')](_0x18acac));if(_0x18acac['error']){if(_0x18acac[_0x67fb('0x10')][_0x67fb('0x11')]===0x1f4){logger['error'](_0x67fb('0xb'),_0x2f8ba1,_0x18acac[_0x67fb('0x10')][_0x67fb('0x12')]);return _0x49bc29(_0x18acac[_0x67fb('0x10')][_0x67fb('0x12')]);}logger[_0x67fb('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x2f8ba1,_0x18acac[_0x67fb('0x10')][_0x67fb('0x12')]);return _0x1744df(_0x18acac[_0x67fb('0x10')]['message']);}else{logger[_0x67fb('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x2f8ba1,_0x67fb('0xe'));_0x1744df(_0x18acac[_0x67fb('0x13')][_0x67fb('0x12')]);}})[_0x67fb('0x14')](function(_0x30192f){logger[_0x67fb('0x10')](_0x67fb('0xb'),_0x2f8ba1,_0x30192f);_0x49bc29(_0x30192f);});});} \ No newline at end of file +var _0xe49a=['request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x52ecb7,_0x2b6f6a){var _0x54b67b=function(_0xb5c391){while(--_0xb5c391){_0x52ecb7['push'](_0x52ecb7['shift']());}};_0x54b67b(++_0x2b6f6a);}(_0xe49a,0xde));var _0xae49=function(_0x40b003,_0x3ae3aa){_0x40b003=_0x40b003-0x0;var _0x3d0edc=_0xe49a[_0x40b003];return _0x3d0edc;};'use strict';var _=require(_0xae49('0x0'));var util=require('util');var moment=require(_0xae49('0x1'));var BPromise=require(_0xae49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae49('0x3'));var db=require(_0xae49('0x4'))['db'];var utils=require(_0xae49('0x5'));var logger=require('../../config/logger')(_0xae49('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae49('0x7')][_0xae49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31c9ff,_0x3574bd,_0x3db774){return new BPromise(function(_0x1cb1c7,_0x26d5e8){return client[_0xae49('0x9')](_0x31c9ff,_0x3db774)[_0xae49('0xa')](function(_0x2b8715){logger[_0xae49('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x3574bd,_0xae49('0xc'));logger[_0xae49('0xd')](_0xae49('0xe'),_0x3574bd,_0xae49('0xc'),JSON[_0xae49('0xf')](_0x2b8715));if(_0x2b8715[_0xae49('0x10')]){if(_0x2b8715[_0xae49('0x10')][_0xae49('0x11')]===0x1f4){logger['error'](_0xae49('0x12'),_0x3574bd,_0x2b8715[_0xae49('0x10')][_0xae49('0x13')]);return _0x26d5e8(_0x2b8715[_0xae49('0x10')][_0xae49('0x13')]);}logger[_0xae49('0x10')](_0xae49('0x12'),_0x3574bd,_0x2b8715[_0xae49('0x10')][_0xae49('0x13')]);return _0x1cb1c7(_0x2b8715[_0xae49('0x10')]['message']);}else{logger[_0xae49('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x3574bd,_0xae49('0xc'));_0x1cb1c7(_0x2b8715[_0xae49('0x14')]['message']);}})['catch'](function(_0x819ee2){logger['error'](_0xae49('0x12'),_0x3574bd,_0x819ee2);_0x26d5e8(_0x819ee2);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 968892d..b771427 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 _0x1494=['express','Router','fs-extra','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1a0d71,_0x5c8c8d){var _0x4f7f29=function(_0x35e495){while(--_0x35e495){_0x1a0d71['push'](_0x1a0d71['shift']());}};_0x4f7f29(++_0x5c8c8d);}(_0x1494,0x11c));var _0x4149=function(_0x3da6cf,_0x46cace){_0x3da6cf=_0x3da6cf-0x0;var _0x5b8176=_0x1494[_0x3da6cf];return _0x5b8176;};'use strict';var multer=require(_0x4149('0x0'));var util=require(_0x4149('0x1'));var path=require(_0x4149('0x2'));var timeout=require(_0x4149('0x3'));var express=require(_0x4149('0x4'));var router=express[_0x4149('0x5')]();var fs_extra=require(_0x4149('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4149('0x7'));var config=require('../../config/environment');var controller=require(_0x4149('0x8'));router['get']('/',auth[_0x4149('0x9')](),controller['index']);router[_0x4149('0xa')](_0x4149('0xb'),auth[_0x4149('0x9')](),controller[_0x4149('0xc')]);router[_0x4149('0xd')]('/',auth[_0x4149('0x9')](),controller['create']);router[_0x4149('0xe')]('/:id',auth[_0x4149('0x9')](),controller[_0x4149('0xf')]);router[_0x4149('0x10')](_0x4149('0xb'),auth['isAuthenticated'](),controller[_0x4149('0x11')]);module['exports']=router; \ No newline at end of file +var _0x7b28=['/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get'];(function(_0x227126,_0x3e97c8){var _0x556176=function(_0x466324){while(--_0x466324){_0x227126['push'](_0x227126['shift']());}};_0x556176(++_0x3e97c8);}(_0x7b28,0x1ad));var _0x87b2=function(_0x2164a8,_0x19eb50){_0x2164a8=_0x2164a8-0x0;var _0x4cee9c=_0x7b28[_0x2164a8];return _0x4cee9c;};'use strict';var multer=require(_0x87b2('0x0'));var util=require(_0x87b2('0x1'));var path=require(_0x87b2('0x2'));var timeout=require(_0x87b2('0x3'));var express=require(_0x87b2('0x4'));var router=express[_0x87b2('0x5')]();var fs_extra=require(_0x87b2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x87b2('0x7'));var config=require(_0x87b2('0x8'));var controller=require('./intVtigerField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x87b2('0x9')]);router[_0x87b2('0xa')](_0x87b2('0xb'),auth[_0x87b2('0xc')](),controller[_0x87b2('0xd')]);router[_0x87b2('0xe')]('/',auth[_0x87b2('0xc')](),controller[_0x87b2('0xf')]);router[_0x87b2('0x10')]('/:id',auth[_0x87b2('0xc')](),controller[_0x87b2('0x11')]);router[_0x87b2('0x12')](_0x87b2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x87b2('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index c6fbd8e..914e7c3 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 _0x3645=['variable','BOOLEAN','sequelize','exports','string','customVariable','keyValue','STRING'];(function(_0x2c08fa,_0xed43f7){var _0x3ae858=function(_0x41a4fd){while(--_0x41a4fd){_0x2c08fa['push'](_0x2c08fa['shift']());}};_0x3ae858(++_0xed43f7);}(_0x3645,0x162));var _0x5364=function(_0x3ff4a3,_0xa5bfa6){_0x3ff4a3=_0x3ff4a3-0x0;var _0x38676f=_0x3645[_0x3ff4a3];return _0x38676f;};'use strict';var Sequelize=require(_0x5364('0x0'));module[_0x5364('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5364('0x2'),'variable',_0x5364('0x3'),_0x5364('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x5364('0x5')]},'key':{'type':Sequelize[_0x5364('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x5364('0x2'),_0x5364('0x6'),_0x5364('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5364('0x5')]},'customField':{'type':Sequelize[_0x5364('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5364('0x5')]}}; \ No newline at end of file +var _0x20a2=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x214cc0,_0x4c6ea4){var _0x425256=function(_0x3049af){while(--_0x3049af){_0x214cc0['push'](_0x214cc0['shift']());}};_0x425256(++_0x4c6ea4);}(_0x20a2,0x16e));var _0x220a=function(_0x2730ad,_0x4d247d){_0x2730ad=_0x2730ad-0x0;var _0x1d4363=_0x20a2[_0x2730ad];return _0x1d4363;};'use strict';var Sequelize=require(_0x220a('0x0'));module[_0x220a('0x1')]={'type':{'type':Sequelize[_0x220a('0x2')](_0x220a('0x3'),_0x220a('0x4'),_0x220a('0x5'),_0x220a('0x6'),_0x220a('0x7')),'defaultValue':_0x220a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x220a('0x8')]},'keyType':{'type':Sequelize[_0x220a('0x2')](_0x220a('0x3'),_0x220a('0x4'),_0x220a('0x5'))},'keyContent':{'type':Sequelize[_0x220a('0x8')]},'idField':{'type':Sequelize[_0x220a('0x8')]},'nameField':{'type':Sequelize[_0x220a('0x8')]},'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 aab1ae0..c0aabc5 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 _0xc2ce=['catch','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','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','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','find','create','body'];(function(_0x3a6761,_0x36093){var _0x37f75c=function(_0x2cf687){while(--_0x2cf687){_0x3a6761['push'](_0x3a6761['shift']());}};_0x37f75c(++_0x36093);}(_0xc2ce,0x16f));var _0xec2c=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xc2ce[_0x37cc52];return _0x2b4a90;};'use strict';var emlformat=require(_0xec2c('0x0'));var rimraf=require(_0xec2c('0x1'));var zipdir=require(_0xec2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec2c('0x3'));var moment=require(_0xec2c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xec2c('0x5'));var util=require(_0xec2c('0x6'));var path=require(_0xec2c('0x7'));var sox=require(_0xec2c('0x8'));var csv=require(_0xec2c('0x9'));var ejs=require(_0xec2c('0xa'));var fs=require('fs');var fs_extra=require(_0xec2c('0xb'));var _=require(_0xec2c('0xc'));var squel=require('squel');var crypto=require(_0xec2c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xec2c('0xe'));var toCsv=require(_0xec2c('0x9'));var querystring=require(_0xec2c('0xf'));var Papa=require('papaparse');var Redis=require(_0xec2c('0x10'));var authService=require(_0xec2c('0x11'));var qs=require(_0xec2c('0x12'));var as=require(_0xec2c('0x13'));var hardwareService=require(_0xec2c('0x14'));var logger=require(_0xec2c('0x15'))(_0xec2c('0x16'));var utils=require(_0xec2c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xec2c('0x18'));var db=require(_0xec2c('0x19'))['db'];function respondWithStatusCode(_0x15c46b,_0x5569a6){_0x5569a6=_0x5569a6||0xcc;return function(_0x1e6dff){if(_0x1e6dff){return _0x15c46b[_0xec2c('0x1a')](_0x5569a6);}return _0x15c46b[_0xec2c('0x1b')](_0x5569a6)[_0xec2c('0x1c')]();};}function respondWithResult(_0x46958b,_0x17a153){_0x17a153=_0x17a153||0xc8;return function(_0xc5b76e){if(_0xc5b76e){return _0x46958b[_0xec2c('0x1b')](_0x17a153)[_0xec2c('0x1d')](_0xc5b76e);}};}function respondWithFilteredResult(_0x4ae898,_0x2ef1ad){return function(_0x5453f7){if(_0x5453f7){var _0x406be1=typeof _0x2ef1ad[_0xec2c('0x1e')]===_0xec2c('0x1f')&&typeof _0x2ef1ad['limit']===_0xec2c('0x1f');var _0x3c5ecd=_0x5453f7[_0xec2c('0x20')];var _0x54a2db=_0x406be1?0x0:_0x2ef1ad[_0xec2c('0x1e')];var _0x441b64=_0x406be1?_0x5453f7['count']:_0x2ef1ad['offset']+_0x2ef1ad['limit'];var _0x8a4491;if(_0x441b64>=_0x3c5ecd){_0x441b64=_0x3c5ecd;_0x8a4491=0xc8;}else{_0x8a4491=0xce;}_0x4ae898[_0xec2c('0x1b')](_0x8a4491);return _0x4ae898['set'](_0xec2c('0x21'),_0x54a2db+'-'+_0x441b64+'/'+_0x3c5ecd)[_0xec2c('0x1d')](_0x5453f7);}return null;};}function patchUpdates(_0xe16d3c){return function(_0x2b2f21){try{jsonpatch[_0xec2c('0x22')](_0x2b2f21,_0xe16d3c,!![]);}catch(_0x1fb11e){return BPromise[_0xec2c('0x23')](_0x1fb11e);}return _0x2b2f21['save']();};}function saveUpdates(_0x41cb6e,_0x321c60){return function(_0x40123d){if(_0x40123d){return _0x40123d[_0xec2c('0x24')](_0x41cb6e)[_0xec2c('0x25')](function(_0x4eea96){return _0x4eea96;});}return null;};}function removeEntity(_0x3efb44,_0x15e61b){return function(_0x645c15){if(_0x645c15){return _0x645c15[_0xec2c('0x26')]()[_0xec2c('0x25')](function(){_0x3efb44['status'](0xcc)[_0xec2c('0x1c')]();});}};}function handleEntityNotFound(_0x4091f1,_0x51df8d){return function(_0x48ec7c){if(!_0x48ec7c){_0x4091f1['sendStatus'](0x194);}return _0x48ec7c;};}function handleError(_0x5be91b,_0xaa7009){_0xaa7009=_0xaa7009||0x1f4;return function(_0x399b4c){logger[_0xec2c('0x27')](_0x399b4c['stack']);if(_0x399b4c[_0xec2c('0x28')]){delete _0x399b4c[_0xec2c('0x28')];}_0x5be91b[_0xec2c('0x1b')](_0xaa7009)[_0xec2c('0x29')](_0x399b4c);};}exports[_0xec2c('0x2a')]=function(_0x2631ee,_0x10193e){var _0x164b8d={},_0x3284ae={},_0x18c32c={'count':0x0,'rows':[]};var _0x6d0d5e=_[_0xec2c('0x2b')](db[_0xec2c('0x2c')][_0xec2c('0x2d')],function(_0x378fef){return{'name':_0x378fef[_0xec2c('0x2e')],'type':_0x378fef[_0xec2c('0x2f')][_0xec2c('0x30')]};});_0x3284ae[_0xec2c('0x31')]=_[_0xec2c('0x2b')](_0x6d0d5e,'name');_0x3284ae[_0xec2c('0x32')]=_['keys'](_0x2631ee['query']);_0x3284ae[_0xec2c('0x33')]=_[_0xec2c('0x34')](_0x3284ae[_0xec2c('0x31')],_0x3284ae[_0xec2c('0x32')]);_0x164b8d[_0xec2c('0x35')]=_['intersection'](_0x3284ae[_0xec2c('0x31')],qs['fields'](_0x2631ee[_0xec2c('0x32')][_0xec2c('0x36')]));_0x164b8d[_0xec2c('0x35')]=_0x164b8d[_0xec2c('0x35')][_0xec2c('0x37')]?_0x164b8d[_0xec2c('0x35')]:_0x3284ae['model'];if(!_0x2631ee[_0xec2c('0x32')][_0xec2c('0x38')]('nolimit')){_0x164b8d[_0xec2c('0x39')]=qs[_0xec2c('0x39')](_0x2631ee[_0xec2c('0x32')][_0xec2c('0x39')]);_0x164b8d[_0xec2c('0x1e')]=qs['offset'](_0x2631ee[_0xec2c('0x32')][_0xec2c('0x1e')]);}_0x164b8d[_0xec2c('0x3a')]=qs[_0xec2c('0x3b')](_0x2631ee[_0xec2c('0x32')]['sort']);_0x164b8d[_0xec2c('0x3c')]=qs[_0xec2c('0x33')](_[_0xec2c('0x3d')](_0x2631ee[_0xec2c('0x32')],_0x3284ae[_0xec2c('0x33')]),_0x6d0d5e);if(_0x2631ee[_0xec2c('0x32')][_0xec2c('0x3e')]){_0x164b8d['where']=_[_0xec2c('0x3f')](_0x164b8d[_0xec2c('0x3c')],{'$or':_['map'](_0x6d0d5e,function(_0x374501){if(_0x374501[_0xec2c('0x2f')]!==_0xec2c('0x40')){var _0x177553={};_0x177553[_0x374501['name']]={'$like':'%'+_0x2631ee[_0xec2c('0x32')][_0xec2c('0x3e')]+'%'};return _0x177553;}})});}_0x164b8d=_[_0xec2c('0x3f')]({},_0x164b8d,_0x2631ee[_0xec2c('0x41')]);var _0x1230d3={'where':_0x164b8d['where']};return db[_0xec2c('0x2c')][_0xec2c('0x20')](_0x1230d3)[_0xec2c('0x25')](function(_0x2856bd){_0x18c32c[_0xec2c('0x20')]=_0x2856bd;if(_0x2631ee['query']['includeAll']){_0x164b8d['include']=[{'all':!![]}];}return db[_0xec2c('0x2c')][_0xec2c('0x42')](_0x164b8d);})[_0xec2c('0x25')](function(_0x4db2f0){_0x18c32c[_0xec2c('0x43')]=_0x4db2f0;return _0x18c32c;})[_0xec2c('0x25')](respondWithFilteredResult(_0x10193e,_0x164b8d))['catch'](handleError(_0x10193e,null));};exports['show']=function(_0x447d07,_0x163e32){var _0x42a00a={'raw':!![],'where':{'id':_0x447d07['params']['id']}},_0xce7572={};_0xce7572[_0xec2c('0x31')]=_['keys'](db[_0xec2c('0x2c')][_0xec2c('0x2d')]);_0xce7572['query']=_['keys'](_0x447d07[_0xec2c('0x32')]);_0xce7572[_0xec2c('0x33')]=_[_0xec2c('0x34')](_0xce7572[_0xec2c('0x31')],_0xce7572[_0xec2c('0x32')]);_0x42a00a[_0xec2c('0x35')]=_['intersection'](_0xce7572['model'],qs['fields'](_0x447d07[_0xec2c('0x32')][_0xec2c('0x36')]));_0x42a00a[_0xec2c('0x35')]=_0x42a00a['attributes'][_0xec2c('0x37')]?_0x42a00a[_0xec2c('0x35')]:_0xce7572[_0xec2c('0x31')];if(_0x447d07['query']['includeAll']){_0x42a00a['include']=[{'all':!![]}];}_0x42a00a=_[_0xec2c('0x3f')]({},_0x42a00a,_0x447d07[_0xec2c('0x41')]);return db[_0xec2c('0x2c')][_0xec2c('0x44')](_0x42a00a)[_0xec2c('0x25')](handleEntityNotFound(_0x163e32,null))[_0xec2c('0x25')](respondWithResult(_0x163e32,null))['catch'](handleError(_0x163e32,null));};exports[_0xec2c('0x45')]=function(_0x53b50d,_0x522835){return db[_0xec2c('0x2c')][_0xec2c('0x45')](_0x53b50d[_0xec2c('0x46')],{})[_0xec2c('0x25')](respondWithResult(_0x522835,0xc9))[_0xec2c('0x47')](handleError(_0x522835,null));};exports[_0xec2c('0x24')]=function(_0x34d6c0,_0x50bbbd){if(_0x34d6c0['body']['id']){delete _0x34d6c0[_0xec2c('0x46')]['id'];}return db['VtigerField'][_0xec2c('0x44')]({'where':{'id':_0x34d6c0[_0xec2c('0x48')]['id']}})[_0xec2c('0x25')](handleEntityNotFound(_0x50bbbd,null))[_0xec2c('0x25')](saveUpdates(_0x34d6c0[_0xec2c('0x46')],null))[_0xec2c('0x25')](respondWithResult(_0x50bbbd,null))[_0xec2c('0x47')](handleError(_0x50bbbd,null));};exports[_0xec2c('0x26')]=function(_0x4cc8a2,_0x623597){return db[_0xec2c('0x2c')][_0xec2c('0x44')]({'where':{'id':_0x4cc8a2['params']['id']}})[_0xec2c('0x25')](handleEntityNotFound(_0x623597,null))['then'](removeEntity(_0x623597,null))[_0xec2c('0x47')](handleError(_0x623597,null));}; \ No newline at end of file +var _0x1912=['../../config/logger','api','../../config/environment','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','destroy','then','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','options','VtigerField','findAll','rows','catch','show','includeAll','include','merge','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1912,0x157));var _0x2191=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x1912[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x2191('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2191('0x1'));var jsonpatch=require(_0x2191('0x2'));var rp=require(_0x2191('0x3'));var moment=require(_0x2191('0x4'));var BPromise=require(_0x2191('0x5'));var Mustache=require(_0x2191('0x6'));var util=require(_0x2191('0x7'));var path=require(_0x2191('0x8'));var sox=require(_0x2191('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2191('0xa'));var _=require(_0x2191('0xb'));var squel=require(_0x2191('0xc'));var crypto=require(_0x2191('0xd'));var jsforce=require(_0x2191('0xe'));var deskjs=require(_0x2191('0xf'));var toCsv=require(_0x2191('0x10'));var querystring=require(_0x2191('0x11'));var Papa=require(_0x2191('0x12'));var Redis=require('ioredis');var authService=require(_0x2191('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2191('0x14'));var hardwareService=require(_0x2191('0x15'));var logger=require(_0x2191('0x16'))(_0x2191('0x17'));var utils=require('../../config/utils');var config=require(_0x2191('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e8af4,_0x45991f){_0x45991f=_0x45991f||0xcc;return function(_0x236fa7){if(_0x236fa7){return _0x2e8af4[_0x2191('0x19')](_0x45991f);}return _0x2e8af4['status'](_0x45991f)[_0x2191('0x1a')]();};}function respondWithResult(_0x34297b,_0x23e5d0){_0x23e5d0=_0x23e5d0||0xc8;return function(_0x1cdf7c){if(_0x1cdf7c){return _0x34297b['status'](_0x23e5d0)[_0x2191('0x1b')](_0x1cdf7c);}};}function respondWithFilteredResult(_0x2cf6a4,_0x29c13e){return function(_0x5804e6){if(_0x5804e6){var _0x1df507=typeof _0x29c13e[_0x2191('0x1c')]===_0x2191('0x1d')&&typeof _0x29c13e[_0x2191('0x1e')]==='undefined';var _0x3f4a86=_0x5804e6[_0x2191('0x1f')];var _0x4094f0=_0x1df507?0x0:_0x29c13e[_0x2191('0x1c')];var _0x4c5bbd=_0x1df507?_0x5804e6[_0x2191('0x1f')]:_0x29c13e[_0x2191('0x1c')]+_0x29c13e[_0x2191('0x1e')];var _0x8512ff;if(_0x4c5bbd>=_0x3f4a86){_0x4c5bbd=_0x3f4a86;_0x8512ff=0xc8;}else{_0x8512ff=0xce;}_0x2cf6a4[_0x2191('0x20')](_0x8512ff);return _0x2cf6a4[_0x2191('0x21')](_0x2191('0x22'),_0x4094f0+'-'+_0x4c5bbd+'/'+_0x3f4a86)[_0x2191('0x1b')](_0x5804e6);}return null;};}function patchUpdates(_0x53cdf9){return function(_0x169951){try{jsonpatch[_0x2191('0x23')](_0x169951,_0x53cdf9,!![]);}catch(_0x1a5af7){return BPromise[_0x2191('0x24')](_0x1a5af7);}return _0x169951['save']();};}function saveUpdates(_0x1599be,_0x3e4891){return function(_0x1a2a64){if(_0x1a2a64){return _0x1a2a64[_0x2191('0x25')](_0x1599be)['then'](function(_0x303ff0){return _0x303ff0;});}return null;};}function removeEntity(_0x36f12f,_0x73aacd){return function(_0x36a094){if(_0x36a094){return _0x36a094[_0x2191('0x26')]()[_0x2191('0x27')](function(){_0x36f12f[_0x2191('0x20')](0xcc)[_0x2191('0x1a')]();});}};}function handleEntityNotFound(_0x4a414f,_0x1dc4d2){return function(_0x1f5c69){if(!_0x1f5c69){_0x4a414f[_0x2191('0x19')](0x194);}return _0x1f5c69;};}function handleError(_0x38b6b2,_0x35b00e){_0x35b00e=_0x35b00e||0x1f4;return function(_0x342827){logger['error'](_0x342827['stack']);if(_0x342827[_0x2191('0x28')]){delete _0x342827[_0x2191('0x28')];}_0x38b6b2[_0x2191('0x20')](_0x35b00e)[_0x2191('0x29')](_0x342827);};}exports[_0x2191('0x2a')]=function(_0x5ade42,_0x21e8b2){var _0x403424={},_0x5c63c6={},_0x3bd92f={'count':0x0,'rows':[]};var _0x117d51=_[_0x2191('0x2b')](db['VtigerField'][_0x2191('0x2c')],function(_0x52679e){return{'name':_0x52679e[_0x2191('0x2d')],'type':_0x52679e['type'][_0x2191('0x2e')]};});_0x5c63c6[_0x2191('0x2f')]=_[_0x2191('0x2b')](_0x117d51,_0x2191('0x28'));_0x5c63c6['query']=_[_0x2191('0x30')](_0x5ade42[_0x2191('0x31')]);_0x5c63c6[_0x2191('0x32')]=_[_0x2191('0x33')](_0x5c63c6[_0x2191('0x2f')],_0x5c63c6[_0x2191('0x31')]);_0x403424[_0x2191('0x34')]=_['intersection'](_0x5c63c6[_0x2191('0x2f')],qs['fields'](_0x5ade42[_0x2191('0x31')][_0x2191('0x35')]));_0x403424['attributes']=_0x403424['attributes'][_0x2191('0x36')]?_0x403424['attributes']:_0x5c63c6[_0x2191('0x2f')];if(!_0x5ade42[_0x2191('0x31')][_0x2191('0x37')](_0x2191('0x38'))){_0x403424[_0x2191('0x1e')]=qs['limit'](_0x5ade42[_0x2191('0x31')][_0x2191('0x1e')]);_0x403424['offset']=qs[_0x2191('0x1c')](_0x5ade42[_0x2191('0x31')]['offset']);}_0x403424['order']=qs[_0x2191('0x39')](_0x5ade42[_0x2191('0x31')][_0x2191('0x39')]);_0x403424['where']=qs['filters'](_['pick'](_0x5ade42[_0x2191('0x31')],_0x5c63c6[_0x2191('0x32')]),_0x117d51);if(_0x5ade42[_0x2191('0x31')][_0x2191('0x3a')]){_0x403424[_0x2191('0x3b')]=_['merge'](_0x403424[_0x2191('0x3b')],{'$or':_[_0x2191('0x2b')](_0x117d51,function(_0xa8266c){if(_0xa8266c['type']!=='VIRTUAL'){var _0x8bbeae={};_0x8bbeae[_0xa8266c['name']]={'$like':'%'+_0x5ade42[_0x2191('0x31')]['filter']+'%'};return _0x8bbeae;}})});}_0x403424=_['merge']({},_0x403424,_0x5ade42[_0x2191('0x3c')]);var _0x4c6049={'where':_0x403424['where']};return db[_0x2191('0x3d')][_0x2191('0x1f')](_0x4c6049)[_0x2191('0x27')](function(_0x57c7d0){_0x3bd92f[_0x2191('0x1f')]=_0x57c7d0;if(_0x5ade42[_0x2191('0x31')]['includeAll']){_0x403424['include']=[{'all':!![]}];}return db['VtigerField'][_0x2191('0x3e')](_0x403424);})[_0x2191('0x27')](function(_0x2bf930){_0x3bd92f[_0x2191('0x3f')]=_0x2bf930;return _0x3bd92f;})[_0x2191('0x27')](respondWithFilteredResult(_0x21e8b2,_0x403424))[_0x2191('0x40')](handleError(_0x21e8b2,null));};exports[_0x2191('0x41')]=function(_0x1149cf,_0x1e5754){var _0x3ae78f={'raw':!![],'where':{'id':_0x1149cf['params']['id']}},_0x1bbb08={};_0x1bbb08[_0x2191('0x2f')]=_[_0x2191('0x30')](db['VtigerField'][_0x2191('0x2c')]);_0x1bbb08[_0x2191('0x31')]=_['keys'](_0x1149cf['query']);_0x1bbb08[_0x2191('0x32')]=_[_0x2191('0x33')](_0x1bbb08[_0x2191('0x2f')],_0x1bbb08[_0x2191('0x31')]);_0x3ae78f['attributes']=_[_0x2191('0x33')](_0x1bbb08['model'],qs[_0x2191('0x35')](_0x1149cf[_0x2191('0x31')][_0x2191('0x35')]));_0x3ae78f['attributes']=_0x3ae78f['attributes'][_0x2191('0x36')]?_0x3ae78f[_0x2191('0x34')]:_0x1bbb08[_0x2191('0x2f')];if(_0x1149cf[_0x2191('0x31')][_0x2191('0x42')]){_0x3ae78f[_0x2191('0x43')]=[{'all':!![]}];}_0x3ae78f=_[_0x2191('0x44')]({},_0x3ae78f,_0x1149cf[_0x2191('0x3c')]);return db[_0x2191('0x3d')][_0x2191('0x45')](_0x3ae78f)[_0x2191('0x27')](handleEntityNotFound(_0x1e5754,null))['then'](respondWithResult(_0x1e5754,null))[_0x2191('0x40')](handleError(_0x1e5754,null));};exports['create']=function(_0xa47588,_0x28fb3b){return db['VtigerField'][_0x2191('0x46')](_0xa47588['body'],{})[_0x2191('0x27')](respondWithResult(_0x28fb3b,0xc9))['catch'](handleError(_0x28fb3b,null));};exports[_0x2191('0x25')]=function(_0x3f83c3,_0x55f38d){if(_0x3f83c3[_0x2191('0x47')]['id']){delete _0x3f83c3[_0x2191('0x47')]['id'];}return db[_0x2191('0x3d')]['find']({'where':{'id':_0x3f83c3[_0x2191('0x48')]['id']}})[_0x2191('0x27')](handleEntityNotFound(_0x55f38d,null))[_0x2191('0x27')](saveUpdates(_0x3f83c3[_0x2191('0x47')],null))[_0x2191('0x27')](respondWithResult(_0x55f38d,null))['catch'](handleError(_0x55f38d,null));};exports['destroy']=function(_0x26afd0,_0x45d77a){return db[_0x2191('0x3d')]['find']({'where':{'id':_0x26afd0[_0x2191('0x48')]['id']}})[_0x2191('0x27')](handleEntityNotFound(_0x45d77a,null))['then'](removeEntity(_0x45d77a,null))[_0x2191('0x40')](handleError(_0x45d77a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index ffc3545..05fdf23 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 _0x48e2=['path','rimraf','./intVtigerField.attributes','exports','define','vtiger_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise'];(function(_0x5744ea,_0x397995){var _0x3330e4=function(_0x40e457){while(--_0x40e457){_0x5744ea['push'](_0x5744ea['shift']());}};_0x3330e4(++_0x397995);}(_0x48e2,0xdf));var _0x248e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x48e2[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x248e('0x0'));var util=require('util');var logger=require(_0x248e('0x1'))(_0x248e('0x2'));var moment=require(_0x248e('0x3'));var BPromise=require('bluebird');var rp=require(_0x248e('0x4'));var fs=require('fs');var path=require(_0x248e('0x5'));var rimraf=require(_0x248e('0x6'));var config=require('../../config/environment');var attributes=require(_0x248e('0x7'));module[_0x248e('0x8')]=function(_0x2de95a,_0x21c6b1){return _0x2de95a[_0x248e('0x9')]('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x248e('0xa'),'fields':['idField',_0x248e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa924=['vtiger_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0xa924,0x162));var _0x4a92=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xa924[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x4a92('0x0'));var util=require(_0x4a92('0x1'));var logger=require(_0x4a92('0x2'))(_0x4a92('0x3'));var moment=require(_0x4a92('0x4'));var BPromise=require(_0x4a92('0x5'));var rp=require(_0x4a92('0x6'));var fs=require('fs');var path=require(_0x4a92('0x7'));var rimraf=require(_0x4a92('0x8'));var config=require(_0x4a92('0x9'));var attributes=require(_0x4a92('0xa'));module['exports']=function(_0x2cb0b4,_0x12dec4){return _0x2cb0b4[_0x4a92('0xb')](_0x4a92('0xc'),attributes,{'tableName':_0x4a92('0xd'),'paranoid':![],'indexes':[{'name':_0x4a92('0xe'),'fields':['idField',_0x4a92('0xf')],'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 00e5494..2e484af 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 _0xeddd=['request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerField,\x20%s,\x20%s'];(function(_0x5734e1,_0x3e1d75){var _0x22c784=function(_0x4fe1eb){while(--_0x4fe1eb){_0x5734e1['push'](_0x5734e1['shift']());}};_0x22c784(++_0x3e1d75);}(_0xeddd,0x10f));var _0xdedd=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xeddd[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xdedd('0x0'));var util=require(_0xdedd('0x1'));var moment=require(_0xdedd('0x2'));var BPromise=require(_0xdedd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdedd('0x4'));var db=require(_0xdedd('0x5'))['db'];var utils=require(_0xdedd('0x6'));var logger=require(_0xdedd('0x7'))(_0xdedd('0x8'));var config=require(_0xdedd('0x9'));var jayson=require(_0xdedd('0xa'));var client=jayson[_0xdedd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5849d3,_0x1d88b0,_0x4bb90d){return new BPromise(function(_0x368311,_0x3e4c11){return client[_0xdedd('0xc')](_0x5849d3,_0x4bb90d)['then'](function(_0x10adba){logger[_0xdedd('0xd')](_0xdedd('0xe'),_0x1d88b0,_0xdedd('0xf'));logger['debug'](_0xdedd('0x10'),_0x1d88b0,_0xdedd('0xf'),JSON['stringify'](_0x10adba));if(_0x10adba['error']){if(_0x10adba[_0xdedd('0x11')][_0xdedd('0x12')]===0x1f4){logger['error'](_0xdedd('0xe'),_0x1d88b0,_0x10adba['error']['message']);return _0x3e4c11(_0x10adba[_0xdedd('0x11')]['message']);}logger['error'](_0xdedd('0xe'),_0x1d88b0,_0x10adba['error'][_0xdedd('0x13')]);return _0x368311(_0x10adba['error'][_0xdedd('0x13')]);}else{logger[_0xdedd('0xd')]('VtigerField,\x20%s,\x20%s',_0x1d88b0,'request\x20sent');_0x368311(_0x10adba[_0xdedd('0x14')][_0xdedd('0x13')]);}})[_0xdedd('0x15')](function(_0x352092){logger[_0xdedd('0x11')](_0xdedd('0xe'),_0x1d88b0,_0x352092);_0x3e4c11(_0x352092);});});} \ No newline at end of file +var _0x3b7c=['request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x26b80e,_0x5c9333){var _0x84a8a8=function(_0x2e5b4a){while(--_0x2e5b4a){_0x26b80e['push'](_0x26b80e['shift']());}};_0x84a8a8(++_0x5c9333);}(_0x3b7c,0x114));var _0xc3b7=function(_0x4d770d,_0x5af4ce){_0x4d770d=_0x4d770d-0x0;var _0x11dc7a=_0x3b7c[_0x4d770d];return _0x11dc7a;};'use strict';var _=require('lodash');var util=require(_0xc3b7('0x0'));var moment=require(_0xc3b7('0x1'));var BPromise=require(_0xc3b7('0x2'));var rs=require(_0xc3b7('0x3'));var fs=require('fs');var Redis=require(_0xc3b7('0x4'));var db=require(_0xc3b7('0x5'))['db'];var utils=require(_0xc3b7('0x6'));var logger=require('../../config/logger')(_0xc3b7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc3b7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab28fe,_0x3c8fc9,_0x5427e0){return new BPromise(function(_0x36f8f8,_0x460156){return client[_0xc3b7('0x9')](_0xab28fe,_0x5427e0)['then'](function(_0x3e47f1){logger[_0xc3b7('0xa')](_0xc3b7('0xb'),_0x3c8fc9,_0xc3b7('0xc'));logger[_0xc3b7('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3c8fc9,_0xc3b7('0xc'),JSON[_0xc3b7('0xe')](_0x3e47f1));if(_0x3e47f1[_0xc3b7('0xf')]){if(_0x3e47f1[_0xc3b7('0xf')][_0xc3b7('0x10')]===0x1f4){logger[_0xc3b7('0xf')](_0xc3b7('0xb'),_0x3c8fc9,_0x3e47f1[_0xc3b7('0xf')][_0xc3b7('0x11')]);return _0x460156(_0x3e47f1[_0xc3b7('0xf')][_0xc3b7('0x11')]);}logger[_0xc3b7('0xf')]('VtigerField,\x20%s,\x20%s',_0x3c8fc9,_0x3e47f1[_0xc3b7('0xf')]['message']);return _0x36f8f8(_0x3e47f1[_0xc3b7('0xf')][_0xc3b7('0x11')]);}else{logger['info'](_0xc3b7('0xb'),_0x3c8fc9,_0xc3b7('0xc'));_0x36f8f8(_0x3e47f1[_0xc3b7('0x12')]['message']);}})['catch'](function(_0x297bf2){logger[_0xc3b7('0xf')](_0xc3b7('0xb'),_0x3c8fc9,_0x297bf2);_0x460156(_0x297bf2);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 864e2b0..04e8bd2 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 _0x3618=['post','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x5e4333,_0xc8fe11){var _0x3fffe5=function(_0x3e79ec){while(--_0x3e79ec){_0x5e4333['push'](_0x5e4333['shift']());}};_0x3fffe5(++_0xc8fe11);}(_0x3618,0x10d));var _0x8361=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x3618[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require(_0x8361('0x0'));var util=require(_0x8361('0x1'));var path=require(_0x8361('0x2'));var timeout=require('connect-timeout');var express=require(_0x8361('0x3'));var router=express[_0x8361('0x4')]();var fs_extra=require(_0x8361('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8361('0x6'));var controller=require(_0x8361('0x7'));router[_0x8361('0x8')]('/',auth[_0x8361('0x9')](),controller[_0x8361('0xa')]);router['get'](_0x8361('0xb'),auth['isAuthenticated'](),controller[_0x8361('0xc')]);router[_0x8361('0x8')](_0x8361('0xd'),auth['isAuthenticated'](),controller[_0x8361('0xe')]);router[_0x8361('0x8')](_0x8361('0xf'),auth['isAuthenticated'](),controller[_0x8361('0x10')]);router[_0x8361('0x11')]('/',auth[_0x8361('0x9')](),controller['create']);router['post'](_0x8361('0xd'),auth[_0x8361('0x9')](),controller['addConfiguration']);router[_0x8361('0x12')](_0x8361('0xb'),auth[_0x8361('0x9')](),controller[_0x8361('0x13')]);router[_0x8361('0x14')]('/:id',auth[_0x8361('0x9')](),controller['destroy']);module[_0x8361('0x15')]=router; \ No newline at end of file +var _0x8993=['../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','get','/:id/fields','create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x96f74c,_0xfc30a4){var _0x379222=function(_0x1bbde9){while(--_0x1bbde9){_0x96f74c['push'](_0x96f74c['shift']());}};_0x379222(++_0xfc30a4);}(_0x8993,0x19f));var _0x3899=function(_0x48737d,_0xf68410){_0x48737d=_0x48737d-0x0;var _0x11e691=_0x8993[_0x48737d];return _0x11e691;};'use strict';var multer=require('multer');var util=require(_0x3899('0x0'));var path=require('path');var timeout=require(_0x3899('0x1'));var express=require('express');var router=express[_0x3899('0x2')]();var fs_extra=require(_0x3899('0x3'));var auth=require(_0x3899('0x4'));var interaction=require(_0x3899('0x5'));var config=require(_0x3899('0x6'));var controller=require(_0x3899('0x7'));router['get']('/',auth[_0x3899('0x8')](),controller[_0x3899('0x9')]);router['get'](_0x3899('0xa'),auth[_0x3899('0x8')](),controller['show']);router['get'](_0x3899('0xb'),auth['isAuthenticated'](),controller[_0x3899('0xc')]);router[_0x3899('0xd')](_0x3899('0xe'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x3899('0x8')](),controller[_0x3899('0xf')]);router['post']('/:id/configurations',auth[_0x3899('0x8')](),controller['addConfiguration']);router['put'](_0x3899('0xa'),auth[_0x3899('0x8')](),controller[_0x3899('0x10')]);router[_0x3899('0x11')](_0x3899('0xa'),auth[_0x3899('0x8')](),controller[_0x3899('0x12')]);module[_0x3899('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 96aed84..973e99e 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 _0xd101=['token','ENUM','integrationTab','newTab','sequelize','STRING','username','remoteUri','password'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0xd101,0xc1));var _0x1d10=function(_0x59e2a1,_0x37b2e7){_0x59e2a1=_0x59e2a1-0x0;var _0x383f36=_0xd101[_0x59e2a1];return _0x383f36;};'use strict';var Sequelize=require(_0x1d10('0x0'));module['exports']={'name':{'type':Sequelize[_0x1d10('0x1')]},'description':{'type':Sequelize[_0x1d10('0x1')]},'username':{'type':Sequelize[_0x1d10('0x1')],'unique':_0x1d10('0x2')},'password':{'type':Sequelize[_0x1d10('0x1')]},'token':{'type':Sequelize[_0x1d10('0x1')]},'remoteUri':{'type':Sequelize[_0x1d10('0x1')],'unique':_0x1d10('0x3')},'authType':{'type':Sequelize['ENUM'](_0x1d10('0x4'),_0x1d10('0x5')),'defaultValue':_0x1d10('0x4')},'serverUrl':{'type':Sequelize[_0x1d10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1d10('0x6')](_0x1d10('0x7'),_0x1d10('0x8')),'defaultValue':_0x1d10('0x7')}}; \ No newline at end of file +var _0x1267=['newTab','sequelize','exports','STRING','username','remoteUri','ENUM','token','password'];(function(_0x524554,_0x3ecb36){var _0x5a760f=function(_0x25de41){while(--_0x25de41){_0x524554['push'](_0x524554['shift']());}};_0x5a760f(++_0x3ecb36);}(_0x1267,0xb5));var _0x7126=function(_0x976f39,_0x49be81){_0x976f39=_0x976f39-0x0;var _0x396c0c=_0x1267[_0x976f39];return _0x396c0c;};'use strict';var Sequelize=require(_0x7126('0x0'));module[_0x7126('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7126('0x2')],'unique':_0x7126('0x3')},'password':{'type':Sequelize[_0x7126('0x2')]},'token':{'type':Sequelize[_0x7126('0x2')]},'remoteUri':{'type':Sequelize[_0x7126('0x2')],'unique':_0x7126('0x4')},'authType':{'type':Sequelize[_0x7126('0x5')]('password',_0x7126('0x6')),'defaultValue':_0x7126('0x7')},'serverUrl':{'type':Sequelize[_0x7126('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7126('0x5')]('integrationTab',_0x7126('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index d3146be..ecaaa12 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 _0xf4eb=['includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields','stringify','send','Wrong\x20credentials','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZendeskAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','order','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskConfiguration','ZendeskField','findOne','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','token','ValidationError','description','assignee','remove','ticket_fields'];(function(_0x30572d,_0x3d758a){var _0x55d63b=function(_0x4b2d7f){while(--_0x4b2d7f){_0x30572d['push'](_0x30572d['shift']());}};_0x55d63b(++_0x3d758a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x13074b,_0x574e0e){_0x13074b=_0x13074b-0x0;var _0x137f28=_0xf4eb[_0x13074b];return _0x137f28;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbf4e('0x13'));function respondWithStatusCode(_0x5a3035,_0x56d185){_0x56d185=_0x56d185||0xcc;return function(_0x209b25){if(_0x209b25){return _0x5a3035[_0xbf4e('0x14')](_0x56d185);}return _0x5a3035[_0xbf4e('0x15')](_0x56d185)[_0xbf4e('0x16')]();};}function respondWithResult(_0x3b74bd,_0x61bd54){_0x61bd54=_0x61bd54||0xc8;return function(_0x4984b4){if(_0x4984b4){return _0x3b74bd['status'](_0x61bd54)[_0xbf4e('0x17')](_0x4984b4);}};}function respondWithFilteredResult(_0x1735ae,_0x28fc6b){return function(_0x542909){if(_0x542909){var _0x14110b=typeof _0x28fc6b[_0xbf4e('0x18')]===_0xbf4e('0x19')&&typeof _0x28fc6b[_0xbf4e('0x1a')]==='undefined';var _0x247322=_0x542909['count'];var _0x5db03f=_0x14110b?0x0:_0x28fc6b['offset'];var _0x4f8762=_0x14110b?_0x542909[_0xbf4e('0x1b')]:_0x28fc6b[_0xbf4e('0x18')]+_0x28fc6b[_0xbf4e('0x1a')];var _0x4d9c2a;if(_0x4f8762>=_0x247322){_0x4f8762=_0x247322;_0x4d9c2a=0xc8;}else{_0x4d9c2a=0xce;}_0x1735ae['status'](_0x4d9c2a);return _0x1735ae[_0xbf4e('0x1c')](_0xbf4e('0x1d'),_0x5db03f+'-'+_0x4f8762+'/'+_0x247322)[_0xbf4e('0x17')](_0x542909);}return null;};}function patchUpdates(_0x3a875b){return function(_0x344727){try{jsonpatch[_0xbf4e('0x1e')](_0x344727,_0x3a875b,!![]);}catch(_0x415963){return BPromise[_0xbf4e('0x1f')](_0x415963);}return _0x344727[_0xbf4e('0x20')]();};}function saveUpdates(_0x376832,_0x30539b){return function(_0x59bd84){if(_0x59bd84){return _0x59bd84[_0xbf4e('0x21')](_0x376832)[_0xbf4e('0x22')](function(_0x51648c){return _0x51648c;});}return null;};}function removeEntity(_0x31e3f5,_0x30994d){return function(_0x114412){if(_0x114412){return _0x114412[_0xbf4e('0x23')]()[_0xbf4e('0x22')](function(){_0x31e3f5['status'](0xcc)[_0xbf4e('0x16')]();});}};}function handleEntityNotFound(_0x36688a,_0x3d6863){return function(_0x5766d4){if(!_0x5766d4){_0x36688a[_0xbf4e('0x14')](0x194);}return _0x5766d4;};}function handleError(_0x5e08b1,_0x5bcf71){_0x5bcf71=_0x5bcf71||0x1f4;return function(_0x2bfccf){logger['error'](_0x2bfccf[_0xbf4e('0x24')]);if(_0x2bfccf[_0xbf4e('0x25')]){delete _0x2bfccf[_0xbf4e('0x25')];}_0x5e08b1[_0xbf4e('0x15')](_0x5bcf71)['send'](_0x2bfccf);};}exports[_0xbf4e('0x26')]=function(_0x8e0ab5,_0x43879d){var _0x4cd4a1={},_0x681c3b={},_0x590c85={'count':0x0,'rows':[]};var _0x1dfa81=_[_0xbf4e('0x27')](db[_0xbf4e('0x28')]['rawAttributes'],function(_0x1d12e2){return{'name':_0x1d12e2[_0xbf4e('0x29')],'type':_0x1d12e2[_0xbf4e('0x2a')][_0xbf4e('0x2b')]};});_0x681c3b[_0xbf4e('0x2c')]=_[_0xbf4e('0x27')](_0x1dfa81,'name');_0x681c3b[_0xbf4e('0x2d')]=_[_0xbf4e('0x2e')](_0x8e0ab5['query']);_0x681c3b[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](_0x681c3b['model'],_0x681c3b[_0xbf4e('0x2d')]);_0x4cd4a1['attributes']=_[_0xbf4e('0x30')](_0x681c3b['model'],qs[_0xbf4e('0x31')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x31')]));_0x4cd4a1['attributes']=_0x4cd4a1[_0xbf4e('0x32')][_0xbf4e('0x33')]?_0x4cd4a1[_0xbf4e('0x32')]:_0x681c3b[_0xbf4e('0x2c')];if(!_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x34')]('nolimit')){_0x4cd4a1[_0xbf4e('0x1a')]=qs[_0xbf4e('0x1a')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x1a')]);_0x4cd4a1[_0xbf4e('0x18')]=qs['offset'](_0x8e0ab5['query']['offset']);}_0x4cd4a1['order']=qs[_0xbf4e('0x35')](_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x35')]);_0x4cd4a1[_0xbf4e('0x36')]=qs[_0xbf4e('0x2f')](_[_0xbf4e('0x37')](_0x8e0ab5[_0xbf4e('0x2d')],_0x681c3b[_0xbf4e('0x2f')]),_0x1dfa81);if(_0x8e0ab5[_0xbf4e('0x2d')]['filter']){_0x4cd4a1['where']=_[_0xbf4e('0x38')](_0x4cd4a1[_0xbf4e('0x36')],{'$or':_[_0xbf4e('0x27')](_0x1dfa81,function(_0x4ae676){if(_0x4ae676[_0xbf4e('0x2a')]!=='VIRTUAL'){var _0x370d90={};_0x370d90[_0x4ae676[_0xbf4e('0x25')]]={'$like':'%'+_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x39')]+'%'};return _0x370d90;}})});}_0x4cd4a1=_['merge']({},_0x4cd4a1,_0x8e0ab5[_0xbf4e('0x3a')]);var _0x78ab2d={'where':_0x4cd4a1[_0xbf4e('0x36')]};return db[_0xbf4e('0x28')]['count'](_0x78ab2d)[_0xbf4e('0x22')](function(_0x44e96b){_0x590c85[_0xbf4e('0x1b')]=_0x44e96b;if(_0x8e0ab5[_0xbf4e('0x2d')][_0xbf4e('0x3b')]){_0x4cd4a1[_0xbf4e('0x3c')]=[{'all':!![]}];}return db[_0xbf4e('0x28')]['findAll'](_0x4cd4a1);})[_0xbf4e('0x22')](function(_0x7b3a94){_0x590c85['rows']=_0x7b3a94;return _0x590c85;})['then'](respondWithFilteredResult(_0x43879d,_0x4cd4a1))[_0xbf4e('0x3d')](handleError(_0x43879d,null));};exports[_0xbf4e('0x3e')]=function(_0x495e53,_0x5bfc4d){var _0x2b1bf4={'raw':![],'where':{'id':_0x495e53[_0xbf4e('0x3f')]['id']}},_0x150224={};_0x150224[_0xbf4e('0x2c')]=_[_0xbf4e('0x2e')](db[_0xbf4e('0x28')]['rawAttributes']);_0x150224[_0xbf4e('0x2d')]=_[_0xbf4e('0x2e')](_0x495e53['query']);_0x150224['filters']=_['intersection'](_0x150224['model'],_0x150224[_0xbf4e('0x2d')]);_0x2b1bf4['attributes']=_[_0xbf4e('0x30')](_0x150224[_0xbf4e('0x2c')],qs['fields'](_0x495e53['query'][_0xbf4e('0x31')]));_0x2b1bf4[_0xbf4e('0x32')]=_0x2b1bf4[_0xbf4e('0x32')][_0xbf4e('0x33')]?_0x2b1bf4[_0xbf4e('0x32')]:_0x150224['model'];if(_0x495e53[_0xbf4e('0x2d')][_0xbf4e('0x3b')]){_0x2b1bf4[_0xbf4e('0x3c')]=[{'all':!![]}];}_0x2b1bf4=_[_0xbf4e('0x38')]({},_0x2b1bf4,_0x495e53[_0xbf4e('0x3a')]);return db[_0xbf4e('0x28')][_0xbf4e('0x40')](_0x2b1bf4)[_0xbf4e('0x22')](handleEntityNotFound(_0x5bfc4d,null))['then'](respondWithResult(_0x5bfc4d,null))[_0xbf4e('0x3d')](handleError(_0x5bfc4d,null));};exports[_0xbf4e('0x41')]=function(_0x1833c1,_0x32bed6){return db[_0xbf4e('0x28')][_0xbf4e('0x41')](_0x1833c1[_0xbf4e('0x42')],{})[_0xbf4e('0x22')](respondWithResult(_0x32bed6,0xc9))[_0xbf4e('0x3d')](handleError(_0x32bed6,null));};exports[_0xbf4e('0x21')]=function(_0x2fdba9,_0x6fd78d){if(_0x2fdba9[_0xbf4e('0x42')]['id']){delete _0x2fdba9[_0xbf4e('0x42')]['id'];}return db[_0xbf4e('0x28')][_0xbf4e('0x40')]({'where':{'id':_0x2fdba9[_0xbf4e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x6fd78d,null))[_0xbf4e('0x22')](saveUpdates(_0x2fdba9[_0xbf4e('0x42')],null))[_0xbf4e('0x22')](respondWithResult(_0x6fd78d,null))['catch'](handleError(_0x6fd78d,null));};exports[_0xbf4e('0x23')]=function(_0x5ed838,_0x4a050e){return db[_0xbf4e('0x28')][_0xbf4e('0x40')]({'where':{'id':_0x5ed838['params']['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x4a050e,null))[_0xbf4e('0x22')](removeEntity(_0x4a050e,null))[_0xbf4e('0x3d')](handleError(_0x4a050e,null));};exports[_0xbf4e('0x43')]=function(_0x42eef6,_0x2ac2c8,_0x419969){var _0x1cdd8c={};var _0x3cd61b={};var _0xc058e1;var _0x271ad2;return db['ZendeskAccount']['findOne']({'where':{'id':_0x42eef6[_0xbf4e('0x3f')]['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x2ac2c8,null))[_0xbf4e('0x22')](function(_0x586f5d){if(_0x586f5d){_0xc058e1=_0x586f5d;_0x3cd61b[_0xbf4e('0x2c')]=_[_0xbf4e('0x2e')](db['ZendeskConfiguration']['rawAttributes']);_0x3cd61b[_0xbf4e('0x2d')]=_['keys'](_0x42eef6['query']);_0x3cd61b[_0xbf4e('0x2f')]=_[_0xbf4e('0x30')](_0x3cd61b[_0xbf4e('0x2c')],_0x3cd61b[_0xbf4e('0x2d')]);_0x1cdd8c[_0xbf4e('0x32')]=_['intersection'](_0x3cd61b[_0xbf4e('0x2c')],qs['fields'](_0x42eef6[_0xbf4e('0x2d')]['fields']));_0x1cdd8c[_0xbf4e('0x32')]=_0x1cdd8c['attributes'][_0xbf4e('0x33')]?_0x1cdd8c[_0xbf4e('0x32')]:_0x3cd61b[_0xbf4e('0x2c')];_0x1cdd8c[_0xbf4e('0x44')]=qs[_0xbf4e('0x35')](_0x42eef6['query']['sort']);_0x1cdd8c['where']=qs['filters'](_[_0xbf4e('0x37')](_0x42eef6[_0xbf4e('0x2d')],_0x3cd61b['filters']));if(_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x39')]){_0x1cdd8c[_0xbf4e('0x36')]=_[_0xbf4e('0x38')](_0x1cdd8c[_0xbf4e('0x36')],{'$or':_[_0xbf4e('0x27')](_0x1cdd8c[_0xbf4e('0x32')],function(_0x48682c){var _0x25c254={};_0x25c254[_0x48682c]={'$like':'%'+_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x39')]+'%'};return _0x25c254;})});}_0x1cdd8c=_['merge']({},_0x1cdd8c,_0x42eef6['options']);return _0xc058e1[_0xbf4e('0x43')](_0x1cdd8c);}})[_0xbf4e('0x22')](function(_0x2e8a62){if(_0x2e8a62){_0x271ad2=_0x2e8a62['length'];if(!_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x34')](_0xbf4e('0x45'))){_0x1cdd8c[_0xbf4e('0x1a')]=qs[_0xbf4e('0x1a')](_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x1a')]);_0x1cdd8c[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x42eef6[_0xbf4e('0x2d')][_0xbf4e('0x18')]);}return _0xc058e1[_0xbf4e('0x43')](_0x1cdd8c);}})['then'](function(_0x21cbd2){if(_0x21cbd2){return _0x21cbd2?{'count':_0x271ad2,'rows':_0x21cbd2}:null;}})['then'](respondWithResult(_0x2ac2c8,null))[_0xbf4e('0x3d')](handleError(_0x2ac2c8,null));};exports[_0xbf4e('0x46')]=function(_0x400fa5,_0x180b13,_0x2080ec){if(_0x400fa5[_0xbf4e('0x42')]['id']){delete _0x400fa5[_0xbf4e('0x42')]['id'];}return db[_0xbf4e('0x28')]['findOne']({'where':{'id':_0x400fa5[_0xbf4e('0x3f')]['id']}})[_0xbf4e('0x22')](handleEntityNotFound(_0x180b13,null))[_0xbf4e('0x22')](function(_0x33f9c4){if(_0x33f9c4){_0x400fa5[_0xbf4e('0x42')]['AccountId']=_0x33f9c4['id'];_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x47')]=integrations[_0xbf4e('0x48')](_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x49')],_0x400fa5[_0xbf4e('0x42')]['type']);_0x400fa5[_0xbf4e('0x42')]['Descriptions']=integrations[_0xbf4e('0x4a')](_0x400fa5[_0xbf4e('0x42')][_0xbf4e('0x49')],_0x400fa5[_0xbf4e('0x42')]['type']);return db[_0xbf4e('0x4b')]['create'](_0x400fa5['body'],{'include':[{'model':db[_0xbf4e('0x4c')],'as':_0xbf4e('0x47')},{'model':db[_0xbf4e('0x4c')],'as':'Descriptions'}]});}return null;})[_0xbf4e('0x22')](respondWithResult(_0x180b13,null))[_0xbf4e('0x3d')](handleError(_0x180b13,null));};exports['getFields']=function(_0x19c5b4,_0x42df5f,_0x4405b9){var _0x137224='';return db[_0xbf4e('0x28')][_0xbf4e('0x4d')]({'where':{'id':_0x19c5b4[_0xbf4e('0x3f')]['id']},'attributes':['id',_0xbf4e('0x4e'),_0xbf4e('0x4f'),'token',_0xbf4e('0x50'),_0xbf4e('0x51')]})[_0xbf4e('0x22')](handleEntityNotFound(_0x42df5f,null))[_0xbf4e('0x22')](function(_0x54f450){if(_0x54f450){_0x137224=_0x54f450[_0xbf4e('0x51')];var _0x667836=_0x137224[_0xbf4e('0x52')](-0x1);if(_0x667836==='/'){_0x137224=_0x137224[_0xbf4e('0x53')](0x0,_0x137224[_0xbf4e('0x54')](_0x667836));}var _0x3448f5={'method':_0xbf4e('0x55'),'uri':util[_0xbf4e('0x56')](_0xbf4e('0x57'),_0x137224,'ticket_fields'),'json':!![]};switch(_0x54f450[_0xbf4e('0x50')]){case'password':_0x3448f5[_0xbf4e('0x58')]={'Authorization':util[_0xbf4e('0x56')](_0xbf4e('0x59'),new Buffer(util[_0xbf4e('0x56')](_0xbf4e('0x5a'),_0x54f450['username'],_0x54f450[_0xbf4e('0x4f')]))[_0xbf4e('0x5b')](_0xbf4e('0x5c')))};break;case'token':_0x3448f5[_0xbf4e('0x58')]={'Authorization':util[_0xbf4e('0x56')](_0xbf4e('0x59'),new Buffer(util['format'](_0xbf4e('0x5d'),_0x54f450[_0xbf4e('0x4e')],_0x54f450[_0xbf4e('0x5e')]))[_0xbf4e('0x5b')](_0xbf4e('0x5c')))};break;default:throw new db['Sequelize'][(_0xbf4e('0x5f'))]('Unknown\x20authentication\x20type');}return rp(_0x3448f5);}})[_0xbf4e('0x22')](function(_0x504723){if(_0x504723){var _0x19a7e9=['subject',_0xbf4e('0x60'),'group',_0xbf4e('0x61')];_[_0xbf4e('0x62')](_0x504723[_0xbf4e('0x63')],function(_0x23de82){return _0x19a7e9[_0xbf4e('0x64')](_0x23de82[_0xbf4e('0x2a')]);});return{'count':_0x504723[_0xbf4e('0x63')]['length'],'rows':_[_0xbf4e('0x27')](_0x504723[_0xbf4e('0x63')],function(_0x2a242b){return{'id':_0x2a242b['id'],'name':_0x2a242b[_0xbf4e('0x65')]>0x7?_0x2a242b[_0xbf4e('0x66')]:_0x2a242b[_0xbf4e('0x2a')],'custom':_0x2a242b['position']>0x7?!![]:![],'options':_0x2a242b[_0xbf4e('0x67')]?_0x2a242b[_0xbf4e('0x67')]:_0x2a242b['custom_field_options']?_0x2a242b[_0xbf4e('0x68')]:[]};})};}})[_0xbf4e('0x22')](respondWithResult(_0x42df5f,null))[_0xbf4e('0x3d')](function(_0xb6d122){var _0x19ec7e=_0x19c5b4[_0xbf4e('0x2d')][_0xbf4e('0x69')]?0x1f4:_0xb6d122[_0xbf4e('0x6a')]||0x1f4;logger[_0xbf4e('0x6b')]('getFields,\x20%s,\x20%s,\x20%s',_0xbf4e('0x6c'),_0x19ec7e,JSON[_0xbf4e('0x6d')](_0xb6d122));delete _0xb6d122[_0xbf4e('0x25')];if(_0x19ec7e===0x191){_0x19ec7e=0x190;}_0x42df5f['status'](_0x19ec7e)[_0xbf4e('0x6e')](_0x19c5b4[_0xbf4e('0x2d')]['test']?{'message':_0xbf4e('0x6f'),'statusCode':_0xb6d122[_0xbf4e('0x6a')]}:_0xb6d122);});}; \ No newline at end of file +var _0x13f6=['where','pick','filters','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','show','params','find','catch','create','body','order','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','group','remove','includes','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','send','test','statusCode','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort'];(function(_0x30af43,_0x7d4efa){var _0x44d646=function(_0x3f59d2){while(--_0x3f59d2){_0x30af43['push'](_0x30af43['shift']());}};_0x44d646(++_0x7d4efa);}(_0x13f6,0x124));var _0x613f=function(_0x3a4544,_0x410078){_0x3a4544=_0x3a4544-0x0;var _0x1da5a0=_0x13f6[_0x3a4544];return _0x1da5a0;};'use strict';var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x613f('0x2'));var moment=require(_0x613f('0x3'));var BPromise=require(_0x613f('0x4'));var Mustache=require('mustache');var util=require(_0x613f('0x5'));var path=require(_0x613f('0x6'));var sox=require(_0x613f('0x7'));var csv=require('to-csv');var ejs=require(_0x613f('0x8'));var fs=require('fs');var fs_extra=require(_0x613f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x613f('0xa'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0xc'));var Papa=require(_0x613f('0xd'));var Redis=require('ioredis');var authService=require(_0x613f('0xe'));var qs=require(_0x613f('0xf'));var as=require(_0x613f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x11'))(_0x613f('0x12'));var utils=require(_0x613f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x613f('0x14'));var db=require(_0x613f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c2a85,_0x517f57){_0x517f57=_0x517f57||0xcc;return function(_0x38d90a){if(_0x38d90a){return _0x4c2a85[_0x613f('0x16')](_0x517f57);}return _0x4c2a85[_0x613f('0x17')](_0x517f57)[_0x613f('0x18')]();};}function respondWithResult(_0x329fcf,_0x4a6fc){_0x4a6fc=_0x4a6fc||0xc8;return function(_0x305894){if(_0x305894){return _0x329fcf[_0x613f('0x17')](_0x4a6fc)[_0x613f('0x19')](_0x305894);}};}function respondWithFilteredResult(_0x1d68fd,_0x548218){return function(_0x3c9edf){if(_0x3c9edf){var _0x5d7c69=typeof _0x548218['offset']===_0x613f('0x1a')&&typeof _0x548218[_0x613f('0x1b')]==='undefined';var _0x39e417=_0x3c9edf['count'];var _0x62ebfe=_0x5d7c69?0x0:_0x548218[_0x613f('0x1c')];var _0x431266=_0x5d7c69?_0x3c9edf[_0x613f('0x1d')]:_0x548218[_0x613f('0x1c')]+_0x548218[_0x613f('0x1b')];var _0x4e412c;if(_0x431266>=_0x39e417){_0x431266=_0x39e417;_0x4e412c=0xc8;}else{_0x4e412c=0xce;}_0x1d68fd['status'](_0x4e412c);return _0x1d68fd[_0x613f('0x1e')]('Content-Range',_0x62ebfe+'-'+_0x431266+'/'+_0x39e417)['json'](_0x3c9edf);}return null;};}function patchUpdates(_0x3c9b58){return function(_0x446562){try{jsonpatch['apply'](_0x446562,_0x3c9b58,!![]);}catch(_0x19123f){return BPromise[_0x613f('0x1f')](_0x19123f);}return _0x446562[_0x613f('0x20')]();};}function saveUpdates(_0x48b28a,_0x5401c2){return function(_0x11f5f3){if(_0x11f5f3){return _0x11f5f3[_0x613f('0x21')](_0x48b28a)[_0x613f('0x22')](function(_0x51f376){return _0x51f376;});}return null;};}function removeEntity(_0x41104e,_0x33e0c6){return function(_0x30de90){if(_0x30de90){return _0x30de90[_0x613f('0x23')]()[_0x613f('0x22')](function(){_0x41104e['status'](0xcc)[_0x613f('0x18')]();});}};}function handleEntityNotFound(_0x204185,_0x51bba1){return function(_0x22035f){if(!_0x22035f){_0x204185[_0x613f('0x16')](0x194);}return _0x22035f;};}function handleError(_0x32e747,_0x4a878d){_0x4a878d=_0x4a878d||0x1f4;return function(_0x53e32b){logger['error'](_0x53e32b[_0x613f('0x24')]);if(_0x53e32b['name']){delete _0x53e32b[_0x613f('0x25')];}_0x32e747[_0x613f('0x17')](_0x4a878d)['send'](_0x53e32b);};}exports[_0x613f('0x26')]=function(_0x2551c1,_0x4c8aa1){var _0x4cff5d={},_0x4f892d={},_0x24be7c={'count':0x0,'rows':[]};var _0x7c1a94=_[_0x613f('0x27')](db['ZendeskAccount'][_0x613f('0x28')],function(_0x439478){return{'name':_0x439478[_0x613f('0x29')],'type':_0x439478[_0x613f('0x2a')]['key']};});_0x4f892d[_0x613f('0x2b')]=_[_0x613f('0x27')](_0x7c1a94,_0x613f('0x25'));_0x4f892d[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x2551c1[_0x613f('0x2c')]);_0x4f892d['filters']=_[_0x613f('0x2e')](_0x4f892d[_0x613f('0x2b')],_0x4f892d[_0x613f('0x2c')]);_0x4cff5d['attributes']=_[_0x613f('0x2e')](_0x4f892d['model'],qs[_0x613f('0x2f')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x2f')]));_0x4cff5d[_0x613f('0x30')]=_0x4cff5d[_0x613f('0x30')][_0x613f('0x31')]?_0x4cff5d['attributes']:_0x4f892d[_0x613f('0x2b')];if(!_0x2551c1[_0x613f('0x2c')][_0x613f('0x32')](_0x613f('0x33'))){_0x4cff5d[_0x613f('0x1b')]=qs['limit'](_0x2551c1['query']['limit']);_0x4cff5d[_0x613f('0x1c')]=qs[_0x613f('0x1c')](_0x2551c1[_0x613f('0x2c')][_0x613f('0x1c')]);}_0x4cff5d['order']=qs[_0x613f('0x34')](_0x2551c1[_0x613f('0x2c')]['sort']);_0x4cff5d[_0x613f('0x35')]=qs['filters'](_[_0x613f('0x36')](_0x2551c1['query'],_0x4f892d[_0x613f('0x37')]),_0x7c1a94);if(_0x2551c1['query'][_0x613f('0x38')]){_0x4cff5d[_0x613f('0x35')]=_[_0x613f('0x39')](_0x4cff5d['where'],{'$or':_[_0x613f('0x27')](_0x7c1a94,function(_0x2c6a0c){if(_0x2c6a0c[_0x613f('0x2a')]!==_0x613f('0x3a')){var _0x474432={};_0x474432[_0x2c6a0c[_0x613f('0x25')]]={'$like':'%'+_0x2551c1[_0x613f('0x2c')][_0x613f('0x38')]+'%'};return _0x474432;}})});}_0x4cff5d=_[_0x613f('0x39')]({},_0x4cff5d,_0x2551c1[_0x613f('0x3b')]);var _0x4da8d3={'where':_0x4cff5d[_0x613f('0x35')]};return db[_0x613f('0x3c')][_0x613f('0x1d')](_0x4da8d3)[_0x613f('0x22')](function(_0x301d33){_0x24be7c[_0x613f('0x1d')]=_0x301d33;if(_0x2551c1[_0x613f('0x2c')]['includeAll']){_0x4cff5d[_0x613f('0x3d')]=[{'all':!![]}];}return db[_0x613f('0x3c')][_0x613f('0x3e')](_0x4cff5d);})[_0x613f('0x22')](function(_0x59d34f){_0x24be7c[_0x613f('0x3f')]=_0x59d34f;return _0x24be7c;})[_0x613f('0x22')](respondWithFilteredResult(_0x4c8aa1,_0x4cff5d))['catch'](handleError(_0x4c8aa1,null));};exports[_0x613f('0x40')]=function(_0x18f427,_0x3bb605){var _0x2f584e={'raw':![],'where':{'id':_0x18f427[_0x613f('0x41')]['id']}},_0x3952c9={};_0x3952c9[_0x613f('0x2b')]=_[_0x613f('0x2d')](db[_0x613f('0x3c')][_0x613f('0x28')]);_0x3952c9[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x18f427[_0x613f('0x2c')]);_0x3952c9['filters']=_[_0x613f('0x2e')](_0x3952c9[_0x613f('0x2b')],_0x3952c9[_0x613f('0x2c')]);_0x2f584e[_0x613f('0x30')]=_['intersection'](_0x3952c9[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x18f427[_0x613f('0x2c')][_0x613f('0x2f')]));_0x2f584e[_0x613f('0x30')]=_0x2f584e[_0x613f('0x30')][_0x613f('0x31')]?_0x2f584e[_0x613f('0x30')]:_0x3952c9[_0x613f('0x2b')];if(_0x18f427[_0x613f('0x2c')]['includeAll']){_0x2f584e['include']=[{'all':!![]}];}_0x2f584e=_[_0x613f('0x39')]({},_0x2f584e,_0x18f427[_0x613f('0x3b')]);return db['ZendeskAccount'][_0x613f('0x42')](_0x2f584e)[_0x613f('0x22')](handleEntityNotFound(_0x3bb605,null))[_0x613f('0x22')](respondWithResult(_0x3bb605,null))[_0x613f('0x43')](handleError(_0x3bb605,null));};exports[_0x613f('0x44')]=function(_0x1c0b07,_0x412dd4){return db[_0x613f('0x3c')][_0x613f('0x44')](_0x1c0b07[_0x613f('0x45')],{})[_0x613f('0x22')](respondWithResult(_0x412dd4,0xc9))[_0x613f('0x43')](handleError(_0x412dd4,null));};exports[_0x613f('0x21')]=function(_0x17f8e5,_0x1fd46c){if(_0x17f8e5[_0x613f('0x45')]['id']){delete _0x17f8e5[_0x613f('0x45')]['id'];}return db[_0x613f('0x3c')]['find']({'where':{'id':_0x17f8e5['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x1fd46c,null))[_0x613f('0x22')](saveUpdates(_0x17f8e5['body'],null))['then'](respondWithResult(_0x1fd46c,null))[_0x613f('0x43')](handleError(_0x1fd46c,null));};exports['destroy']=function(_0x513bf1,_0x6e006b){return db[_0x613f('0x3c')][_0x613f('0x42')]({'where':{'id':_0x513bf1['params']['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x6e006b,null))[_0x613f('0x22')](removeEntity(_0x6e006b,null))['catch'](handleError(_0x6e006b,null));};exports['getConfigurations']=function(_0x1c0c8e,_0x30d7b1,_0x13b585){var _0x145009={};var _0x3f7ead={};var _0x395357;var _0x24d162;return db['ZendeskAccount']['findOne']({'where':{'id':_0x1c0c8e[_0x613f('0x41')]['id']}})['then'](handleEntityNotFound(_0x30d7b1,null))['then'](function(_0x387913){if(_0x387913){_0x395357=_0x387913;_0x3f7ead[_0x613f('0x2b')]=_[_0x613f('0x2d')](db['ZendeskConfiguration'][_0x613f('0x28')]);_0x3f7ead[_0x613f('0x2c')]=_[_0x613f('0x2d')](_0x1c0c8e[_0x613f('0x2c')]);_0x3f7ead[_0x613f('0x37')]=_[_0x613f('0x2e')](_0x3f7ead[_0x613f('0x2b')],_0x3f7ead['query']);_0x145009[_0x613f('0x30')]=_['intersection'](_0x3f7ead[_0x613f('0x2b')],qs[_0x613f('0x2f')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x2f')]));_0x145009[_0x613f('0x30')]=_0x145009[_0x613f('0x30')][_0x613f('0x31')]?_0x145009[_0x613f('0x30')]:_0x3f7ead[_0x613f('0x2b')];_0x145009[_0x613f('0x46')]=qs[_0x613f('0x34')](_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x34')]);_0x145009['where']=qs['filters'](_[_0x613f('0x36')](_0x1c0c8e['query'],_0x3f7ead[_0x613f('0x37')]));if(_0x1c0c8e[_0x613f('0x2c')][_0x613f('0x38')]){_0x145009[_0x613f('0x35')]=_[_0x613f('0x39')](_0x145009[_0x613f('0x35')],{'$or':_[_0x613f('0x27')](_0x145009[_0x613f('0x30')],function(_0x3ababc){var _0x29bb88={};_0x29bb88[_0x3ababc]={'$like':'%'+_0x1c0c8e[_0x613f('0x2c')]['filter']+'%'};return _0x29bb88;})});}_0x145009=_[_0x613f('0x39')]({},_0x145009,_0x1c0c8e[_0x613f('0x3b')]);return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5a3ea1){if(_0x5a3ea1){_0x24d162=_0x5a3ea1[_0x613f('0x31')];if(!_0x1c0c8e[_0x613f('0x2c')]['hasOwnProperty']('nolimit')){_0x145009[_0x613f('0x1b')]=qs['limit'](_0x1c0c8e['query']['limit']);_0x145009[_0x613f('0x1c')]=qs['offset'](_0x1c0c8e['query']['offset']);}return _0x395357[_0x613f('0x47')](_0x145009);}})[_0x613f('0x22')](function(_0x5bf4ce){if(_0x5bf4ce){return _0x5bf4ce?{'count':_0x24d162,'rows':_0x5bf4ce}:null;}})[_0x613f('0x22')](respondWithResult(_0x30d7b1,null))[_0x613f('0x43')](handleError(_0x30d7b1,null));};exports[_0x613f('0x48')]=function(_0x2a7ca7,_0x5b8712,_0x24f25c){if(_0x2a7ca7[_0x613f('0x45')]['id']){delete _0x2a7ca7['body']['id'];}return db[_0x613f('0x3c')][_0x613f('0x49')]({'where':{'id':_0x2a7ca7[_0x613f('0x41')]['id']}})[_0x613f('0x22')](handleEntityNotFound(_0x5b8712,null))[_0x613f('0x22')](function(_0xdf8993){if(_0xdf8993){_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4a')]=_0xdf8993['id'];_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4b')]=integrations[_0x613f('0x4c')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);_0x2a7ca7[_0x613f('0x45')][_0x613f('0x4d')]=integrations[_0x613f('0x4e')](_0x2a7ca7[_0x613f('0x45')]['channel'],_0x2a7ca7[_0x613f('0x45')][_0x613f('0x2a')]);return db[_0x613f('0x4f')][_0x613f('0x44')](_0x2a7ca7[_0x613f('0x45')],{'include':[{'model':db[_0x613f('0x50')],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x613f('0x4d')}]});}return null;})[_0x613f('0x22')](respondWithResult(_0x5b8712,null))[_0x613f('0x43')](handleError(_0x5b8712,null));};exports[_0x613f('0x51')]=function(_0x4f28c7,_0x11d2f4,_0x29e5c8){var _0x3d8777='';return db[_0x613f('0x3c')]['findOne']({'where':{'id':_0x4f28c7[_0x613f('0x41')]['id']},'attributes':['id',_0x613f('0x52'),_0x613f('0x53'),_0x613f('0x54'),_0x613f('0x55'),_0x613f('0x56')]})[_0x613f('0x22')](handleEntityNotFound(_0x11d2f4,null))[_0x613f('0x22')](function(_0x5dc81a){if(_0x5dc81a){_0x3d8777=_0x5dc81a[_0x613f('0x56')];var _0x792bf3=_0x3d8777[_0x613f('0x57')](-0x1);if(_0x792bf3==='/'){_0x3d8777=_0x3d8777[_0x613f('0x58')](0x0,_0x3d8777[_0x613f('0x59')](_0x792bf3));}var _0x15ef2d={'method':_0x613f('0x5a'),'uri':util[_0x613f('0x5b')](_0x613f('0x5c'),_0x3d8777,_0x613f('0x5d')),'json':!![]};switch(_0x5dc81a['authType']){case _0x613f('0x53'):_0x15ef2d[_0x613f('0x5e')]={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x60'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x53')]))[_0x613f('0x61')](_0x613f('0x62')))};break;case _0x613f('0x54'):_0x15ef2d['headers']={'Authorization':util[_0x613f('0x5b')](_0x613f('0x5f'),new Buffer(util[_0x613f('0x5b')](_0x613f('0x63'),_0x5dc81a[_0x613f('0x52')],_0x5dc81a[_0x613f('0x54')]))[_0x613f('0x61')](_0x613f('0x62')))};break;default:throw new db[(_0x613f('0x64'))][(_0x613f('0x65'))](_0x613f('0x66'));}return rp(_0x15ef2d);}})[_0x613f('0x22')](function(_0x5b8563){if(_0x5b8563){var _0x30c62f=[_0x613f('0x67'),'description',_0x613f('0x68'),'assignee'];_[_0x613f('0x69')](_0x5b8563['ticket_fields'],function(_0x49cb13){return _0x30c62f[_0x613f('0x6a')](_0x49cb13[_0x613f('0x2a')]);});return{'count':_0x5b8563[_0x613f('0x5d')][_0x613f('0x31')],'rows':_[_0x613f('0x27')](_0x5b8563[_0x613f('0x5d')],function(_0x622812){return{'id':_0x622812['id'],'name':_0x622812['position']>0x7?_0x622812[_0x613f('0x6b')]:_0x622812[_0x613f('0x2a')],'custom':_0x622812[_0x613f('0x6c')]>0x7?!![]:![],'options':_0x622812[_0x613f('0x6d')]?_0x622812[_0x613f('0x6d')]:_0x622812['custom_field_options']?_0x622812[_0x613f('0x6e')]:[]};})};}})[_0x613f('0x22')](respondWithResult(_0x11d2f4,null))['catch'](function(_0x188be6){var _0x8073b2=_0x4f28c7[_0x613f('0x2c')]['test']?0x1f4:_0x188be6['statusCode']||0x1f4;logger['error'](_0x613f('0x6f'),_0x613f('0x51'),_0x8073b2,JSON['stringify'](_0x188be6));delete _0x188be6[_0x613f('0x25')];if(_0x8073b2===0x191){_0x8073b2=0x190;}_0x11d2f4[_0x613f('0x17')](_0x8073b2)[_0x613f('0x70')](_0x4f28c7['query'][_0x613f('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x188be6[_0x613f('0x72')]}:_0x188be6);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e0c5a52..4a7345d 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 _0x4cc1=['bluebird','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','util','../../config/logger','api'];(function(_0x41bf0c,_0xbaa3f5){var _0x32cc9b=function(_0x33abda){while(--_0x33abda){_0x41bf0c['push'](_0x41bf0c['shift']());}};_0x32cc9b(++_0xbaa3f5);}(_0x4cc1,0x151));var _0x14cc=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x4cc1[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x14cc('0x0'));var util=require(_0x14cc('0x1'));var logger=require(_0x14cc('0x2'))(_0x14cc('0x3'));var moment=require('moment');var BPromise=require(_0x14cc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14cc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x14cc('0x6'));var integrations=require(_0x14cc('0x7'));module[_0x14cc('0x8')]=function(_0x59f072,_0x2ddcc5){return _0x59f072[_0x14cc('0x9')](_0x14cc('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3772=['ZendeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x325d17,_0x532acf){var _0x405ae7=function(_0x2dd6f7){while(--_0x2dd6f7){_0x325d17['push'](_0x325d17['shift']());}};_0x405ae7(++_0x532acf);}(_0x3772,0x1d5));var _0x2377=function(_0x2aed3,_0x5f9c05){_0x2aed3=_0x2aed3-0x0;var _0x160e00=_0x3772[_0x2aed3];return _0x160e00;};'use strict';var _=require(_0x2377('0x0'));var util=require(_0x2377('0x1'));var logger=require(_0x2377('0x2'))(_0x2377('0x3'));var moment=require(_0x2377('0x4'));var BPromise=require(_0x2377('0x5'));var rp=require(_0x2377('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2377('0x7'));var config=require('../../config/environment');var attributes=require(_0x2377('0x8'));var integrations=require(_0x2377('0x9'));module[_0x2377('0xa')]=function(_0x2be407,_0x1835c9){return _0x2be407['define'](_0x2377('0xb'),attributes,{'tableName':'int_zendesk_accounts','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 5bfbcc0..bda7643 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 _0xf354=['GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','find','ShowZendeskAccount','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x39bae4,_0xbe5663){var _0xbeb5b6=function(_0x4f378b){while(--_0x4f378b){_0x39bae4['push'](_0x39bae4['shift']());}};_0xbeb5b6(++_0xbe5663);}(_0xf354,0x9e));var _0x4f35=function(_0x337338,_0x478087){_0x337338=_0x337338-0x0;var _0x142bbf=_0xf354[_0x337338];return _0x142bbf;};'use strict';var _=require('lodash');var util=require(_0x4f35('0x0'));var moment=require(_0x4f35('0x1'));var BPromise=require('bluebird');var rs=require(_0x4f35('0x2'));var fs=require('fs');var Redis=require(_0x4f35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f35('0x4'));var logger=require('../../config/logger')(_0x4f35('0x5'));var config=require(_0x4f35('0x6'));var jayson=require(_0x4f35('0x7'));var client=jayson[_0x4f35('0x8')][_0x4f35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25419e,_0x13c14c,_0x470a0f){return new BPromise(function(_0x1e774e,_0x69553b){return client[_0x4f35('0xa')](_0x25419e,_0x470a0f)[_0x4f35('0xb')](function(_0x4addad){logger['info'](_0x4f35('0xc'),_0x13c14c,_0x4f35('0xd'));logger[_0x4f35('0xe')](_0x4f35('0xf'),_0x13c14c,'request\x20sent',JSON[_0x4f35('0x10')](_0x4addad));if(_0x4addad[_0x4f35('0x11')]){if(_0x4addad[_0x4f35('0x11')][_0x4f35('0x12')]===0x1f4){logger[_0x4f35('0x11')](_0x4f35('0xc'),_0x13c14c,_0x4addad[_0x4f35('0x11')]['message']);return _0x69553b(_0x4addad[_0x4f35('0x11')][_0x4f35('0x13')]);}logger[_0x4f35('0x11')](_0x4f35('0xc'),_0x13c14c,_0x4addad[_0x4f35('0x11')]['message']);return _0x1e774e(_0x4addad['error'][_0x4f35('0x13')]);}else{logger[_0x4f35('0x14')](_0x4f35('0xc'),_0x13c14c,_0x4f35('0xd'));_0x1e774e(_0x4addad[_0x4f35('0x15')]['message']);}})['catch'](function(_0x4cf2f8){logger[_0x4f35('0x11')](_0x4f35('0xc'),_0x13c14c,_0x4cf2f8);_0x69553b(_0x4cf2f8);});});}exports[_0x4f35('0x16')]=function(_0x8639d7){var _0x3e0d0c=this;return new Promise(function(_0x195401,_0x333874){return db[_0x4f35('0x17')][_0x4f35('0x18')]({'raw':_0x8639d7[_0x4f35('0x19')]?_0x8639d7['options'][_0x4f35('0x1a')]===undefined?!![]:![]:!![],'where':_0x8639d7[_0x4f35('0x19')]?_0x8639d7['options'][_0x4f35('0x1b')]||null:null,'attributes':_0x8639d7[_0x4f35('0x19')]?_0x8639d7[_0x4f35('0x19')]['attributes']||null:null,'limit':_0x8639d7['options']?_0x8639d7['options'][_0x4f35('0x1c')]||null:null,'include':_0x8639d7[_0x4f35('0x19')]?_0x8639d7[_0x4f35('0x19')][_0x4f35('0x1d')]?_[_0x4f35('0x1e')](_0x8639d7['options'][_0x4f35('0x1d')],function(_0x323e2f){return{'model':db[_0x323e2f['model']],'as':_0x323e2f['as'],'attributes':_0x323e2f['attributes'],'include':_0x323e2f[_0x4f35('0x1d')]?_[_0x4f35('0x1e')](_0x323e2f[_0x4f35('0x1d')],function(_0x451446){return{'model':db[_0x451446[_0x4f35('0x1f')]],'as':_0x451446['as'],'attributes':_0x451446[_0x4f35('0x20')],'include':_0x451446['include']?_[_0x4f35('0x1e')](_0x451446[_0x4f35('0x1d')],function(_0x12ec33){return{'model':db[_0x12ec33[_0x4f35('0x1f')]],'as':_0x12ec33['as'],'attributes':_0x12ec33[_0x4f35('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4f35('0xb')](function(_0x52620b){logger[_0x4f35('0x14')](_0x4f35('0x16'),_0x8639d7);logger['debug'](_0x4f35('0x16'),_0x8639d7,JSON[_0x4f35('0x10')](_0x52620b));_0x195401(_0x52620b);})[_0x4f35('0x21')](function(_0x30bf26){logger['error']('GetZendeskAccount',_0x30bf26['message'],_0x8639d7);_0x333874(_0x3e0d0c[_0x4f35('0x11')](0x1f4,_0x30bf26[_0x4f35('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x58136c){var _0x3b36c1=this;return new Promise(function(_0x3b1a87,_0x17b07e){return db[_0x4f35('0x17')][_0x4f35('0x22')]({'raw':_0x58136c['options']?_0x58136c['options'][_0x4f35('0x1a')]===undefined?!![]:![]:!![],'where':_0x58136c[_0x4f35('0x19')]?_0x58136c[_0x4f35('0x19')][_0x4f35('0x1b')]||null:null,'attributes':_0x58136c[_0x4f35('0x19')]?_0x58136c[_0x4f35('0x19')][_0x4f35('0x20')]||null:null,'include':_0x58136c[_0x4f35('0x19')]?_0x58136c[_0x4f35('0x19')][_0x4f35('0x1d')]?_[_0x4f35('0x1e')](_0x58136c[_0x4f35('0x19')][_0x4f35('0x1d')],function(_0x4dbf9c){return{'model':db[_0x4dbf9c[_0x4f35('0x1f')]],'as':_0x4dbf9c['as'],'attributes':_0x4dbf9c[_0x4f35('0x20')],'include':_0x4dbf9c[_0x4f35('0x1d')]?_[_0x4f35('0x1e')](_0x4dbf9c[_0x4f35('0x1d')],function(_0x31b880){return{'model':db[_0x31b880[_0x4f35('0x1f')]],'as':_0x31b880['as'],'attributes':_0x31b880[_0x4f35('0x20')],'include':_0x31b880[_0x4f35('0x1d')]?_['map'](_0x31b880[_0x4f35('0x1d')],function(_0x18ef42){return{'model':db[_0x18ef42[_0x4f35('0x1f')]],'as':_0x18ef42['as'],'attributes':_0x18ef42[_0x4f35('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3393a9){logger[_0x4f35('0x14')](_0x4f35('0x23'),_0x58136c);logger['debug'](_0x4f35('0x23'),_0x58136c,JSON[_0x4f35('0x10')](_0x3393a9));_0x3b1a87(_0x3393a9);})[_0x4f35('0x21')](function(_0x11524d){logger[_0x4f35('0x11')](_0x4f35('0x23'),_0x11524d[_0x4f35('0x13')],_0x58136c);_0x17b07e(_0x3b36c1[_0x4f35('0x11')](0x1f4,_0x11524d[_0x4f35('0x13')]));});});}; \ No newline at end of file +var _0x9b31=['code','message','ZendeskAccount','options','raw','where','attributes','include','map','model','GetZendeskAccount','debug','ShowZendeskAccount','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4f4dba,_0x47adc0){var _0x977418=function(_0x4a1e07){while(--_0x4a1e07){_0x4f4dba['push'](_0x4f4dba['shift']());}};_0x977418(++_0x47adc0);}(_0x9b31,0x104));var _0x19b3=function(_0x893d,_0x34779e){_0x893d=_0x893d-0x0;var _0x1a9158=_0x9b31[_0x893d];return _0x1a9158;};'use strict';var _=require(_0x19b3('0x0'));var util=require(_0x19b3('0x1'));var moment=require('moment');var BPromise=require(_0x19b3('0x2'));var rs=require(_0x19b3('0x3'));var fs=require('fs');var Redis=require(_0x19b3('0x4'));var db=require(_0x19b3('0x5'))['db'];var utils=require(_0x19b3('0x6'));var logger=require(_0x19b3('0x7'))(_0x19b3('0x8'));var config=require(_0x19b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x19b3('0xa')][_0x19b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1680f4,_0x1a4585,_0x480678){return new BPromise(function(_0xc1d4fe,_0x110d8d){return client[_0x19b3('0xc')](_0x1680f4,_0x480678)[_0x19b3('0xd')](function(_0x254bea){logger[_0x19b3('0xe')](_0x19b3('0xf'),_0x1a4585,_0x19b3('0x10'));logger['debug'](_0x19b3('0x11'),_0x1a4585,'request\x20sent',JSON[_0x19b3('0x12')](_0x254bea));if(_0x254bea[_0x19b3('0x13')]){if(_0x254bea[_0x19b3('0x13')][_0x19b3('0x14')]===0x1f4){logger[_0x19b3('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x1a4585,_0x254bea[_0x19b3('0x13')]['message']);return _0x110d8d(_0x254bea[_0x19b3('0x13')][_0x19b3('0x15')]);}logger[_0x19b3('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x1a4585,_0x254bea[_0x19b3('0x13')][_0x19b3('0x15')]);return _0xc1d4fe(_0x254bea['error'][_0x19b3('0x15')]);}else{logger[_0x19b3('0xe')](_0x19b3('0xf'),_0x1a4585,_0x19b3('0x10'));_0xc1d4fe(_0x254bea['result'][_0x19b3('0x15')]);}})['catch'](function(_0x1c95f6){logger['error'](_0x19b3('0xf'),_0x1a4585,_0x1c95f6);_0x110d8d(_0x1c95f6);});});}exports['GetZendeskAccount']=function(_0x2cb29d){var _0xb78a9b=this;return new Promise(function(_0x280bf7,_0x22e32c){return db[_0x19b3('0x16')]['findAll']({'raw':_0x2cb29d[_0x19b3('0x17')]?_0x2cb29d[_0x19b3('0x17')][_0x19b3('0x18')]===undefined?!![]:![]:!![],'where':_0x2cb29d[_0x19b3('0x17')]?_0x2cb29d[_0x19b3('0x17')][_0x19b3('0x19')]||null:null,'attributes':_0x2cb29d[_0x19b3('0x17')]?_0x2cb29d[_0x19b3('0x17')][_0x19b3('0x1a')]||null:null,'limit':_0x2cb29d[_0x19b3('0x17')]?_0x2cb29d['options']['limit']||null:null,'include':_0x2cb29d[_0x19b3('0x17')]?_0x2cb29d[_0x19b3('0x17')][_0x19b3('0x1b')]?_[_0x19b3('0x1c')](_0x2cb29d[_0x19b3('0x17')][_0x19b3('0x1b')],function(_0x112bcc){return{'model':db[_0x112bcc[_0x19b3('0x1d')]],'as':_0x112bcc['as'],'attributes':_0x112bcc['attributes'],'include':_0x112bcc[_0x19b3('0x1b')]?_[_0x19b3('0x1c')](_0x112bcc['include'],function(_0x48a6f9){return{'model':db[_0x48a6f9['model']],'as':_0x48a6f9['as'],'attributes':_0x48a6f9[_0x19b3('0x1a')],'include':_0x48a6f9[_0x19b3('0x1b')]?_[_0x19b3('0x1c')](_0x48a6f9['include'],function(_0x274868){return{'model':db[_0x274868[_0x19b3('0x1d')]],'as':_0x274868['as'],'attributes':_0x274868['attributes']};}):[]};}):[]};}):[]:[]})[_0x19b3('0xd')](function(_0x407dbc){logger[_0x19b3('0xe')](_0x19b3('0x1e'),_0x2cb29d);logger[_0x19b3('0x1f')]('GetZendeskAccount',_0x2cb29d,JSON[_0x19b3('0x12')](_0x407dbc));_0x280bf7(_0x407dbc);})['catch'](function(_0x57b489){logger[_0x19b3('0x13')]('GetZendeskAccount',_0x57b489[_0x19b3('0x15')],_0x2cb29d);_0x22e32c(_0xb78a9b[_0x19b3('0x13')](0x1f4,_0x57b489[_0x19b3('0x15')]));});});};exports[_0x19b3('0x20')]=function(_0x45511b){var _0x4a4f20=this;return new Promise(function(_0x28518d,_0x5b29dc){return db[_0x19b3('0x16')][_0x19b3('0x21')]({'raw':_0x45511b[_0x19b3('0x17')]?_0x45511b[_0x19b3('0x17')][_0x19b3('0x18')]===undefined?!![]:![]:!![],'where':_0x45511b[_0x19b3('0x17')]?_0x45511b[_0x19b3('0x17')][_0x19b3('0x19')]||null:null,'attributes':_0x45511b['options']?_0x45511b[_0x19b3('0x17')][_0x19b3('0x1a')]||null:null,'include':_0x45511b[_0x19b3('0x17')]?_0x45511b[_0x19b3('0x17')]['include']?_[_0x19b3('0x1c')](_0x45511b[_0x19b3('0x17')][_0x19b3('0x1b')],function(_0x160064){return{'model':db[_0x160064[_0x19b3('0x1d')]],'as':_0x160064['as'],'attributes':_0x160064['attributes'],'include':_0x160064['include']?_[_0x19b3('0x1c')](_0x160064['include'],function(_0x228286){return{'model':db[_0x228286['model']],'as':_0x228286['as'],'attributes':_0x228286[_0x19b3('0x1a')],'include':_0x228286[_0x19b3('0x1b')]?_[_0x19b3('0x1c')](_0x228286[_0x19b3('0x1b')],function(_0x2ac2ed){return{'model':db[_0x2ac2ed[_0x19b3('0x1d')]],'as':_0x2ac2ed['as'],'attributes':_0x2ac2ed[_0x19b3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x19b3('0xd')](function(_0x552b92){logger[_0x19b3('0xe')](_0x19b3('0x20'),_0x45511b);logger['debug']('ShowZendeskAccount',_0x45511b,JSON[_0x19b3('0x12')](_0x552b92));_0x28518d(_0x552b92);})[_0x19b3('0x22')](function(_0x2f41d3){logger[_0x19b3('0x13')]('ShowZendeskAccount',_0x2f41d3[_0x19b3('0x15')],_0x45511b);_0x5b29dc(_0x4a4f20[_0x19b3('0x13')](0x1f4,_0x2f41d3[_0x19b3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 16b4ab5..098db0a 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe81383,_0x254e68){var _0x4a7bb5=function(_0x59c061){while(--_0x59c061){_0xe81383['push'](_0xe81383['shift']());}};_0x4a7bb5(++_0x254e68);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xe5b5[_0x47a12a];return _0x30cd40;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router; \ No newline at end of file +var _0x087b=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x9660c3,_0x2695e5){var _0x3ef2d9=function(_0x332691){while(--_0x332691){_0x9660c3['push'](_0x9660c3['shift']());}};_0x3ef2d9(++_0x2695e5);}(_0x087b,0x11a));var _0xb087=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x087b[_0x525c7b];return _0x27b33e;};'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/subjects',auth[_0xb087('0x9')](),controller[_0xb087('0xf')]);router[_0xb087('0x8')](_0xb087('0x10'),auth[_0xb087('0x9')](),controller[_0xb087('0x11')]);router[_0xb087('0x8')]('/:id/tags',auth[_0xb087('0x9')](),controller[_0xb087('0x12')]);router[_0xb087('0x13')]('/',auth['isAuthenticated'](),controller[_0xb087('0x14')]);router[_0xb087('0x13')](_0xb087('0x15'),auth[_0xb087('0x9')](),controller[_0xb087('0x16')]);router[_0xb087('0x17')](_0xb087('0xb'),auth[_0xb087('0x9')](),controller[_0xb087('0x18')]);router[_0xb087('0x19')]('/:id',auth[_0xb087('0x9')](),controller[_0xb087('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 0c28e75..89216dc 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 _0xc4e7=['STRING'];(function(_0x33eaa2,_0x4cb56f){var _0x4cfc98=function(_0x33b532){while(--_0x33b532){_0x33eaa2['push'](_0x33eaa2['shift']());}};_0x4cfc98(++_0x4cb56f);}(_0xc4e7,0xfb));var _0x7c4e=function(_0x723166,_0x49aaf4){_0x723166=_0x723166-0x0;var _0x330e14=_0xc4e7[_0x723166];return _0x330e14;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7c4e('0x0')]},'description':{'type':Sequelize[_0x7c4e('0x0')]}}; \ No newline at end of file +var _0x8997=['STRING','sequelize','exports'];(function(_0x5e22fe,_0x277cae){var _0x36d0f8=function(_0x2fdb08){while(--_0x2fdb08){_0x5e22fe['push'](_0x5e22fe['shift']());}};_0x36d0f8(++_0x277cae);}(_0x8997,0x172));var _0x7899=function(_0x243ac9,_0x4223f8){_0x243ac9=_0x243ac9-0x0;var _0x2c5dbb=_0x8997[_0x243ac9];return _0x2c5dbb;};'use strict';var Sequelize=require(_0x7899('0x0'));module[_0x7899('0x1')]={'name':{'type':Sequelize[_0x7899('0x2')]},'description':{'type':Sequelize[_0x7899('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 03c04e1..afb1bc9 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 _0x1a82=['order','pick','getSubjects','getDescriptions','getTags','setTags','ids','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','create','body','params','find','getFields','findOne','ZendeskField'];(function(_0x3dfba8,_0x46bb95){var _0x64d3dc=function(_0x136ca8){while(--_0x136ca8){_0x3dfba8['push'](_0x3dfba8['shift']());}};_0x64d3dc(++_0x46bb95);}(_0x1a82,0xb3));var _0x21a8=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x1a82[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0x21a8('0x0'));var rimraf=require(_0x21a8('0x1'));var zipdir=require(_0x21a8('0x2'));var jsonpatch=require(_0x21a8('0x3'));var rp=require(_0x21a8('0x4'));var moment=require(_0x21a8('0x5'));var BPromise=require(_0x21a8('0x6'));var Mustache=require(_0x21a8('0x7'));var util=require(_0x21a8('0x8'));var path=require(_0x21a8('0x9'));var sox=require(_0x21a8('0xa'));var csv=require(_0x21a8('0xb'));var ejs=require(_0x21a8('0xc'));var fs=require('fs');var fs_extra=require(_0x21a8('0xd'));var _=require(_0x21a8('0xe'));var squel=require(_0x21a8('0xf'));var crypto=require(_0x21a8('0x10'));var jsforce=require(_0x21a8('0x11'));var deskjs=require(_0x21a8('0x12'));var toCsv=require('to-csv');var querystring=require(_0x21a8('0x13'));var Papa=require(_0x21a8('0x14'));var Redis=require('ioredis');var authService=require(_0x21a8('0x15'));var qs=require(_0x21a8('0x16'));var as=require(_0x21a8('0x17'));var hardwareService=require(_0x21a8('0x18'));var logger=require('../../config/logger')(_0x21a8('0x19'));var utils=require(_0x21a8('0x1a'));var config=require(_0x21a8('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x21a8('0x1c'))['db'];function respondWithStatusCode(_0x18e6df,_0x2ec459){_0x2ec459=_0x2ec459||0xcc;return function(_0x4281b8){if(_0x4281b8){return _0x18e6df[_0x21a8('0x1d')](_0x2ec459);}return _0x18e6df[_0x21a8('0x1e')](_0x2ec459)[_0x21a8('0x1f')]();};}function respondWithResult(_0x3320b5,_0x190684){_0x190684=_0x190684||0xc8;return function(_0x4135c4){if(_0x4135c4){return _0x3320b5[_0x21a8('0x1e')](_0x190684)[_0x21a8('0x20')](_0x4135c4);}};}function respondWithFilteredResult(_0x563ca9,_0xc0381d){return function(_0x162f1d){if(_0x162f1d){var _0x42d109=typeof _0xc0381d['offset']===_0x21a8('0x21')&&typeof _0xc0381d[_0x21a8('0x22')]==='undefined';var _0x3d2527=_0x162f1d[_0x21a8('0x23')];var _0x34ba31=_0x42d109?0x0:_0xc0381d[_0x21a8('0x24')];var _0x315472=_0x42d109?_0x162f1d[_0x21a8('0x23')]:_0xc0381d['offset']+_0xc0381d[_0x21a8('0x22')];var _0x582a26;if(_0x315472>=_0x3d2527){_0x315472=_0x3d2527;_0x582a26=0xc8;}else{_0x582a26=0xce;}_0x563ca9[_0x21a8('0x1e')](_0x582a26);return _0x563ca9['set'](_0x21a8('0x25'),_0x34ba31+'-'+_0x315472+'/'+_0x3d2527)['json'](_0x162f1d);}return null;};}function patchUpdates(_0x33b3dc){return function(_0x1c5efc){try{jsonpatch['apply'](_0x1c5efc,_0x33b3dc,!![]);}catch(_0x330eaf){return BPromise[_0x21a8('0x26')](_0x330eaf);}return _0x1c5efc['save']();};}function saveUpdates(_0x543ad7,_0x5f2322){return function(_0x519184){if(_0x519184){return _0x519184[_0x21a8('0x27')](_0x543ad7)[_0x21a8('0x28')](function(_0x3df8fd){return _0x3df8fd;});}return null;};}function removeEntity(_0x1b0dea,_0x5f47f7){return function(_0x347451){if(_0x347451){return _0x347451[_0x21a8('0x29')]()[_0x21a8('0x28')](function(){_0x1b0dea[_0x21a8('0x1e')](0xcc)[_0x21a8('0x1f')]();});}};}function handleEntityNotFound(_0x223f0e,_0x4ee0cd){return function(_0x239471){if(!_0x239471){_0x223f0e[_0x21a8('0x1d')](0x194);}return _0x239471;};}function handleError(_0x43f1d4,_0x85396b){_0x85396b=_0x85396b||0x1f4;return function(_0x422368){logger[_0x21a8('0x2a')](_0x422368[_0x21a8('0x2b')]);if(_0x422368[_0x21a8('0x2c')]){delete _0x422368['name'];}_0x43f1d4[_0x21a8('0x1e')](_0x85396b)[_0x21a8('0x2d')](_0x422368);};}exports[_0x21a8('0x2e')]=function(_0x17e882,_0x54163d){var _0x4678c9={},_0x175637={},_0x18c3c7={'count':0x0,'rows':[]};var _0x56adf5=_[_0x21a8('0x2f')](db[_0x21a8('0x30')][_0x21a8('0x31')],function(_0x268747){return{'name':_0x268747[_0x21a8('0x32')],'type':_0x268747['type'][_0x21a8('0x33')]};});_0x175637[_0x21a8('0x34')]=_[_0x21a8('0x2f')](_0x56adf5,'name');_0x175637[_0x21a8('0x35')]=_[_0x21a8('0x36')](_0x17e882[_0x21a8('0x35')]);_0x175637[_0x21a8('0x37')]=_[_0x21a8('0x38')](_0x175637[_0x21a8('0x34')],_0x175637[_0x21a8('0x35')]);_0x4678c9[_0x21a8('0x39')]=_['intersection'](_0x175637['model'],qs[_0x21a8('0x3a')](_0x17e882['query'][_0x21a8('0x3a')]));_0x4678c9[_0x21a8('0x39')]=_0x4678c9[_0x21a8('0x39')][_0x21a8('0x3b')]?_0x4678c9[_0x21a8('0x39')]:_0x175637['model'];if(!_0x17e882['query'][_0x21a8('0x3c')](_0x21a8('0x3d'))){_0x4678c9[_0x21a8('0x22')]=qs[_0x21a8('0x22')](_0x17e882['query'][_0x21a8('0x22')]);_0x4678c9[_0x21a8('0x24')]=qs[_0x21a8('0x24')](_0x17e882[_0x21a8('0x35')][_0x21a8('0x24')]);}_0x4678c9['order']=qs[_0x21a8('0x3e')](_0x17e882[_0x21a8('0x35')][_0x21a8('0x3e')]);_0x4678c9[_0x21a8('0x3f')]=qs[_0x21a8('0x37')](_['pick'](_0x17e882[_0x21a8('0x35')],_0x175637[_0x21a8('0x37')]),_0x56adf5);if(_0x17e882[_0x21a8('0x35')][_0x21a8('0x40')]){_0x4678c9[_0x21a8('0x3f')]=_[_0x21a8('0x41')](_0x4678c9[_0x21a8('0x3f')],{'$or':_['map'](_0x56adf5,function(_0x12fa28){if(_0x12fa28['type']!=='VIRTUAL'){var _0x5223bb={};_0x5223bb[_0x12fa28[_0x21a8('0x2c')]]={'$like':'%'+_0x17e882['query'][_0x21a8('0x40')]+'%'};return _0x5223bb;}})});}_0x4678c9=_[_0x21a8('0x41')]({},_0x4678c9,_0x17e882[_0x21a8('0x42')]);var _0x27b5fa={'where':_0x4678c9[_0x21a8('0x3f')]};return db[_0x21a8('0x30')]['count'](_0x27b5fa)[_0x21a8('0x28')](function(_0x3c0fde){_0x18c3c7[_0x21a8('0x23')]=_0x3c0fde;if(_0x17e882['query'][_0x21a8('0x43')]){_0x4678c9[_0x21a8('0x44')]=[{'all':!![]}];}return db[_0x21a8('0x30')][_0x21a8('0x45')](_0x4678c9);})[_0x21a8('0x28')](function(_0x16d0b4){_0x18c3c7[_0x21a8('0x46')]=_0x16d0b4;return _0x18c3c7;})['then'](respondWithFilteredResult(_0x54163d,_0x4678c9))[_0x21a8('0x47')](handleError(_0x54163d,null));};exports['show']=function(_0x16ecc8,_0xce833b){var _0x57797c={'raw':![],'where':{'id':_0x16ecc8['params']['id']}},_0x475de0={};_0x475de0[_0x21a8('0x34')]=_[_0x21a8('0x36')](db[_0x21a8('0x30')][_0x21a8('0x31')]);_0x475de0[_0x21a8('0x35')]=_[_0x21a8('0x36')](_0x16ecc8[_0x21a8('0x35')]);_0x475de0[_0x21a8('0x37')]=_['intersection'](_0x475de0[_0x21a8('0x34')],_0x475de0[_0x21a8('0x35')]);_0x57797c[_0x21a8('0x39')]=_[_0x21a8('0x38')](_0x475de0[_0x21a8('0x34')],qs['fields'](_0x16ecc8['query']['fields']));_0x57797c['attributes']=_0x57797c['attributes'][_0x21a8('0x3b')]?_0x57797c['attributes']:_0x475de0[_0x21a8('0x34')];if(_0x16ecc8[_0x21a8('0x35')][_0x21a8('0x43')]){_0x57797c[_0x21a8('0x44')]=[{'all':!![]}];}_0x57797c=_[_0x21a8('0x41')]({},_0x57797c,_0x16ecc8[_0x21a8('0x42')]);return db[_0x21a8('0x30')]['find'](_0x57797c)[_0x21a8('0x28')](handleEntityNotFound(_0xce833b,null))[_0x21a8('0x28')](respondWithResult(_0xce833b,null))[_0x21a8('0x47')](handleError(_0xce833b,null));};exports[_0x21a8('0x48')]=function(_0x377da1,_0x3235ca){return db['ZendeskConfiguration'][_0x21a8('0x48')](_0x377da1[_0x21a8('0x49')],{})[_0x21a8('0x28')](respondWithResult(_0x3235ca,0xc9))[_0x21a8('0x47')](handleError(_0x3235ca,null));};exports['update']=function(_0x82fbdc,_0x15de1b){if(_0x82fbdc[_0x21a8('0x49')]['id']){delete _0x82fbdc[_0x21a8('0x49')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x82fbdc[_0x21a8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15de1b,null))[_0x21a8('0x28')](saveUpdates(_0x82fbdc['body'],null))[_0x21a8('0x28')](respondWithResult(_0x15de1b,null))[_0x21a8('0x47')](handleError(_0x15de1b,null));};exports[_0x21a8('0x29')]=function(_0x566363,_0x3966dd){return db[_0x21a8('0x30')][_0x21a8('0x4b')]({'where':{'id':_0x566363[_0x21a8('0x4a')]['id']}})[_0x21a8('0x28')](handleEntityNotFound(_0x3966dd,null))[_0x21a8('0x28')](removeEntity(_0x3966dd,null))['catch'](handleError(_0x3966dd,null));};exports[_0x21a8('0x4c')]=function(_0x413196,_0x2f151d,_0x1c4516){var _0xbd105c={};var _0x2c87ba={};var _0x3ef43a;var _0xf1f762;return db[_0x21a8('0x30')][_0x21a8('0x4d')]({'where':{'id':_0x413196[_0x21a8('0x4a')]['id']}})[_0x21a8('0x28')](handleEntityNotFound(_0x2f151d,null))[_0x21a8('0x28')](function(_0x16de04){if(_0x16de04){_0x3ef43a=_0x16de04;_0x2c87ba[_0x21a8('0x34')]=_[_0x21a8('0x36')](db[_0x21a8('0x4e')][_0x21a8('0x31')]);_0x2c87ba[_0x21a8('0x35')]=_[_0x21a8('0x36')](_0x413196[_0x21a8('0x35')]);_0x2c87ba[_0x21a8('0x37')]=_[_0x21a8('0x38')](_0x2c87ba[_0x21a8('0x34')],_0x2c87ba[_0x21a8('0x35')]);_0xbd105c[_0x21a8('0x39')]=_['intersection'](_0x2c87ba[_0x21a8('0x34')],qs['fields'](_0x413196[_0x21a8('0x35')][_0x21a8('0x3a')]));_0xbd105c[_0x21a8('0x39')]=_0xbd105c['attributes'][_0x21a8('0x3b')]?_0xbd105c[_0x21a8('0x39')]:_0x2c87ba[_0x21a8('0x34')];_0xbd105c[_0x21a8('0x4f')]=qs[_0x21a8('0x3e')](_0x413196[_0x21a8('0x35')][_0x21a8('0x3e')]);_0xbd105c['where']=qs[_0x21a8('0x37')](_[_0x21a8('0x50')](_0x413196[_0x21a8('0x35')],_0x2c87ba[_0x21a8('0x37')]));if(_0x413196[_0x21a8('0x35')]['filter']){_0xbd105c[_0x21a8('0x3f')]=_[_0x21a8('0x41')](_0xbd105c[_0x21a8('0x3f')],{'$or':_[_0x21a8('0x2f')](_0xbd105c[_0x21a8('0x39')],function(_0x1b116f){var _0x37faf6={};_0x37faf6[_0x1b116f]={'$like':'%'+_0x413196[_0x21a8('0x35')][_0x21a8('0x40')]+'%'};return _0x37faf6;})});}_0xbd105c=_[_0x21a8('0x41')]({},_0xbd105c,_0x413196['options']);return _0x3ef43a['getFields'](_0xbd105c);}})[_0x21a8('0x28')](function(_0x54c2ef){if(_0x54c2ef){_0xf1f762=_0x54c2ef[_0x21a8('0x3b')];if(!_0x413196[_0x21a8('0x35')][_0x21a8('0x3c')](_0x21a8('0x3d'))){_0xbd105c[_0x21a8('0x22')]=qs[_0x21a8('0x22')](_0x413196[_0x21a8('0x35')][_0x21a8('0x22')]);_0xbd105c[_0x21a8('0x24')]=qs['offset'](_0x413196['query'][_0x21a8('0x24')]);}return _0x3ef43a[_0x21a8('0x4c')](_0xbd105c);}})['then'](function(_0x5501e9){if(_0x5501e9){return _0x5501e9?{'count':_0xf1f762,'rows':_0x5501e9}:null;}})[_0x21a8('0x28')](respondWithResult(_0x2f151d,null))['catch'](handleError(_0x2f151d,null));};exports[_0x21a8('0x51')]=function(_0xba50d9,_0x49b5cb,_0x66a80c){var _0x3bc017={};var _0x4ca4fb={};var _0x21dd3a;var _0x3375c4;return db[_0x21a8('0x30')][_0x21a8('0x4d')]({'where':{'id':_0xba50d9['params']['id']}})['then'](handleEntityNotFound(_0x49b5cb,null))[_0x21a8('0x28')](function(_0x34a990){if(_0x34a990){_0x21dd3a=_0x34a990;_0x4ca4fb['model']=_[_0x21a8('0x36')](db[_0x21a8('0x4e')][_0x21a8('0x31')]);_0x4ca4fb[_0x21a8('0x35')]=_[_0x21a8('0x36')](_0xba50d9[_0x21a8('0x35')]);_0x4ca4fb[_0x21a8('0x37')]=_['intersection'](_0x4ca4fb['model'],_0x4ca4fb[_0x21a8('0x35')]);_0x3bc017[_0x21a8('0x39')]=_['intersection'](_0x4ca4fb[_0x21a8('0x34')],qs[_0x21a8('0x3a')](_0xba50d9['query'][_0x21a8('0x3a')]));_0x3bc017['attributes']=_0x3bc017[_0x21a8('0x39')][_0x21a8('0x3b')]?_0x3bc017[_0x21a8('0x39')]:_0x4ca4fb[_0x21a8('0x34')];_0x3bc017[_0x21a8('0x4f')]=qs['sort'](_0xba50d9[_0x21a8('0x35')][_0x21a8('0x3e')]);_0x3bc017[_0x21a8('0x3f')]=qs[_0x21a8('0x37')](_[_0x21a8('0x50')](_0xba50d9[_0x21a8('0x35')],_0x4ca4fb['filters']));if(_0xba50d9[_0x21a8('0x35')][_0x21a8('0x40')]){_0x3bc017['where']=_[_0x21a8('0x41')](_0x3bc017['where'],{'$or':_[_0x21a8('0x2f')](_0x3bc017['attributes'],function(_0x1841c6){var _0x4a7ff7={};_0x4a7ff7[_0x1841c6]={'$like':'%'+_0xba50d9['query'][_0x21a8('0x40')]+'%'};return _0x4a7ff7;})});}_0x3bc017=_[_0x21a8('0x41')]({},_0x3bc017,_0xba50d9[_0x21a8('0x42')]);return _0x21dd3a['getSubjects'](_0x3bc017);}})[_0x21a8('0x28')](function(_0x12025d){if(_0x12025d){_0x3375c4=_0x12025d[_0x21a8('0x3b')];if(!_0xba50d9[_0x21a8('0x35')][_0x21a8('0x3c')]('nolimit')){_0x3bc017[_0x21a8('0x22')]=qs[_0x21a8('0x22')](_0xba50d9['query'][_0x21a8('0x22')]);_0x3bc017[_0x21a8('0x24')]=qs[_0x21a8('0x24')](_0xba50d9['query'][_0x21a8('0x24')]);}return _0x21dd3a[_0x21a8('0x51')](_0x3bc017);}})['then'](function(_0x21b3c3){if(_0x21b3c3){return _0x21b3c3?{'count':_0x3375c4,'rows':_0x21b3c3}:null;}})[_0x21a8('0x28')](respondWithResult(_0x49b5cb,null))[_0x21a8('0x47')](handleError(_0x49b5cb,null));};exports[_0x21a8('0x52')]=function(_0x3908f1,_0x1f90c2,_0x56df4a){var _0x3df59d={};var _0x1d2b3d={};var _0x35f3b4;var _0x400db7;return db['ZendeskConfiguration'][_0x21a8('0x4d')]({'where':{'id':_0x3908f1['params']['id']}})['then'](handleEntityNotFound(_0x1f90c2,null))[_0x21a8('0x28')](function(_0x244be3){if(_0x244be3){_0x35f3b4=_0x244be3;_0x1d2b3d[_0x21a8('0x34')]=_['keys'](db[_0x21a8('0x4e')][_0x21a8('0x31')]);_0x1d2b3d['query']=_[_0x21a8('0x36')](_0x3908f1[_0x21a8('0x35')]);_0x1d2b3d['filters']=_[_0x21a8('0x38')](_0x1d2b3d['model'],_0x1d2b3d[_0x21a8('0x35')]);_0x3df59d[_0x21a8('0x39')]=_[_0x21a8('0x38')](_0x1d2b3d['model'],qs[_0x21a8('0x3a')](_0x3908f1['query']['fields']));_0x3df59d['attributes']=_0x3df59d['attributes'][_0x21a8('0x3b')]?_0x3df59d[_0x21a8('0x39')]:_0x1d2b3d[_0x21a8('0x34')];_0x3df59d['order']=qs[_0x21a8('0x3e')](_0x3908f1[_0x21a8('0x35')][_0x21a8('0x3e')]);_0x3df59d[_0x21a8('0x3f')]=qs[_0x21a8('0x37')](_[_0x21a8('0x50')](_0x3908f1[_0x21a8('0x35')],_0x1d2b3d['filters']));if(_0x3908f1[_0x21a8('0x35')]['filter']){_0x3df59d[_0x21a8('0x3f')]=_[_0x21a8('0x41')](_0x3df59d[_0x21a8('0x3f')],{'$or':_[_0x21a8('0x2f')](_0x3df59d['attributes'],function(_0x24dd08){var _0x1c88ac={};_0x1c88ac[_0x24dd08]={'$like':'%'+_0x3908f1[_0x21a8('0x35')][_0x21a8('0x40')]+'%'};return _0x1c88ac;})});}_0x3df59d=_['merge']({},_0x3df59d,_0x3908f1[_0x21a8('0x42')]);return _0x35f3b4[_0x21a8('0x52')](_0x3df59d);}})[_0x21a8('0x28')](function(_0x4f036c){if(_0x4f036c){_0x400db7=_0x4f036c[_0x21a8('0x3b')];if(!_0x3908f1[_0x21a8('0x35')][_0x21a8('0x3c')]('nolimit')){_0x3df59d[_0x21a8('0x22')]=qs['limit'](_0x3908f1[_0x21a8('0x35')][_0x21a8('0x22')]);_0x3df59d['offset']=qs[_0x21a8('0x24')](_0x3908f1[_0x21a8('0x35')][_0x21a8('0x24')]);}return _0x35f3b4[_0x21a8('0x52')](_0x3df59d);}})['then'](function(_0x3846a9){if(_0x3846a9){return _0x3846a9?{'count':_0x400db7,'rows':_0x3846a9}:null;}})[_0x21a8('0x28')](respondWithResult(_0x1f90c2,null))[_0x21a8('0x47')](handleError(_0x1f90c2,null));};exports['getTags']=function(_0x1e816e,_0x171634,_0x2beeaa){var _0x716bf4={};var _0x312a3b={};var _0x4d2c13;var _0x2a22e6;return db[_0x21a8('0x30')][_0x21a8('0x4d')]({'where':{'id':_0x1e816e[_0x21a8('0x4a')]['id']}})[_0x21a8('0x28')](handleEntityNotFound(_0x171634,null))[_0x21a8('0x28')](function(_0x3b6182){if(_0x3b6182){_0x4d2c13=_0x3b6182;_0x312a3b[_0x21a8('0x34')]=_[_0x21a8('0x36')](db['Tag'][_0x21a8('0x31')]);_0x312a3b[_0x21a8('0x35')]=_[_0x21a8('0x36')](_0x1e816e['query']);_0x312a3b['filters']=_[_0x21a8('0x38')](_0x312a3b[_0x21a8('0x34')],_0x312a3b[_0x21a8('0x35')]);_0x716bf4[_0x21a8('0x39')]=_[_0x21a8('0x38')](_0x312a3b['model'],qs[_0x21a8('0x3a')](_0x1e816e[_0x21a8('0x35')]['fields']));_0x716bf4[_0x21a8('0x39')]=_0x716bf4[_0x21a8('0x39')][_0x21a8('0x3b')]?_0x716bf4[_0x21a8('0x39')]:_0x312a3b[_0x21a8('0x34')];_0x716bf4[_0x21a8('0x4f')]=qs[_0x21a8('0x3e')](_0x1e816e[_0x21a8('0x35')]['sort']);_0x716bf4[_0x21a8('0x3f')]=qs[_0x21a8('0x37')](_['pick'](_0x1e816e[_0x21a8('0x35')],_0x312a3b[_0x21a8('0x37')]));if(_0x1e816e[_0x21a8('0x35')][_0x21a8('0x40')]){_0x716bf4[_0x21a8('0x3f')]=_[_0x21a8('0x41')](_0x716bf4[_0x21a8('0x3f')],{'$or':_[_0x21a8('0x2f')](_0x716bf4[_0x21a8('0x39')],function(_0x32d0c8){var _0x3f72e2={};_0x3f72e2[_0x32d0c8]={'$like':'%'+_0x1e816e['query'][_0x21a8('0x40')]+'%'};return _0x3f72e2;})});}_0x716bf4=_[_0x21a8('0x41')]({},_0x716bf4,_0x1e816e[_0x21a8('0x42')]);return _0x4d2c13[_0x21a8('0x53')](_0x716bf4);}})[_0x21a8('0x28')](function(_0x1cbb4b){if(_0x1cbb4b){_0x2a22e6=_0x1cbb4b['length'];if(!_0x1e816e['query'][_0x21a8('0x3c')]('nolimit')){_0x716bf4[_0x21a8('0x22')]=qs[_0x21a8('0x22')](_0x1e816e[_0x21a8('0x35')]['limit']);_0x716bf4[_0x21a8('0x24')]=qs[_0x21a8('0x24')](_0x1e816e[_0x21a8('0x35')][_0x21a8('0x24')]);}return _0x4d2c13['getTags'](_0x716bf4);}})[_0x21a8('0x28')](function(_0x401ec3){if(_0x401ec3){return _0x401ec3?{'count':_0x2a22e6,'rows':_0x401ec3}:null;}})[_0x21a8('0x28')](respondWithResult(_0x171634,null))[_0x21a8('0x47')](handleError(_0x171634,null));};exports[_0x21a8('0x54')]=function(_0x9c4039,_0x5a342b,_0x54f9f9){if(_0x9c4039[_0x21a8('0x49')]['id']){delete _0x9c4039['body']['id'];}return db[_0x21a8('0x30')][_0x21a8('0x4d')]({'where':{'id':_0x9c4039[_0x21a8('0x4a')]['id']}})[_0x21a8('0x28')](handleEntityNotFound(_0x5a342b,null))[_0x21a8('0x28')](function(_0x5c639f){if(_0x5c639f){return _0x5c639f[_0x21a8('0x54')](_0x9c4039[_0x21a8('0x49')][_0x21a8('0x55')]||[]);}return null;})[_0x21a8('0x28')](respondWithResult(_0x5a342b,null))[_0x21a8('0x47')](handleError(_0x5a342b,null));}; \ No newline at end of file +var _0x9870=['undefined','limit','count','Content-Range','json','reject','update','then','destroy','error','stack','name','index','map','ZendeskConfiguration','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x33c1b7,_0x4cd7b0){var _0x41c206=function(_0x4806b4){while(--_0x4806b4){_0x33c1b7['push'](_0x33c1b7['shift']());}};_0x41c206(++_0x4cd7b0);}(_0x9870,0x17e));var _0x0987=function(_0x752c07,_0x5c8c0e){_0x752c07=_0x752c07-0x0;var _0x33925b=_0x9870[_0x752c07];return _0x33925b;};'use strict';var emlformat=require(_0x0987('0x0'));var rimraf=require(_0x0987('0x1'));var zipdir=require(_0x0987('0x2'));var jsonpatch=require(_0x0987('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0987('0x4'));var Mustache=require(_0x0987('0x5'));var util=require('util');var path=require(_0x0987('0x6'));var sox=require(_0x0987('0x7'));var csv=require(_0x0987('0x8'));var ejs=require(_0x0987('0x9'));var fs=require('fs');var fs_extra=require(_0x0987('0xa'));var _=require(_0x0987('0xb'));var squel=require(_0x0987('0xc'));var crypto=require(_0x0987('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0987('0xe'));var toCsv=require(_0x0987('0x8'));var querystring=require('querystring');var Papa=require(_0x0987('0xf'));var Redis=require(_0x0987('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0987('0x11'));var as=require(_0x0987('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0987('0x13'))(_0x0987('0x14'));var utils=require(_0x0987('0x15'));var config=require(_0x0987('0x16'));var licenseUtil=require(_0x0987('0x17'));var db=require(_0x0987('0x18'))['db'];function respondWithStatusCode(_0x1c2b6c,_0x160dcc){_0x160dcc=_0x160dcc||0xcc;return function(_0xb0c08){if(_0xb0c08){return _0x1c2b6c[_0x0987('0x19')](_0x160dcc);}return _0x1c2b6c['status'](_0x160dcc)[_0x0987('0x1a')]();};}function respondWithResult(_0x24b818,_0x124a69){_0x124a69=_0x124a69||0xc8;return function(_0x1df634){if(_0x1df634){return _0x24b818[_0x0987('0x1b')](_0x124a69)['json'](_0x1df634);}};}function respondWithFilteredResult(_0x4db415,_0x373dbb){return function(_0x58af6e){if(_0x58af6e){var _0x22588c=typeof _0x373dbb['offset']===_0x0987('0x1c')&&typeof _0x373dbb[_0x0987('0x1d')]===_0x0987('0x1c');var _0x1ee91f=_0x58af6e[_0x0987('0x1e')];var _0x337cfe=_0x22588c?0x0:_0x373dbb['offset'];var _0x2047a4=_0x22588c?_0x58af6e[_0x0987('0x1e')]:_0x373dbb['offset']+_0x373dbb['limit'];var _0x399199;if(_0x2047a4>=_0x1ee91f){_0x2047a4=_0x1ee91f;_0x399199=0xc8;}else{_0x399199=0xce;}_0x4db415[_0x0987('0x1b')](_0x399199);return _0x4db415['set'](_0x0987('0x1f'),_0x337cfe+'-'+_0x2047a4+'/'+_0x1ee91f)[_0x0987('0x20')](_0x58af6e);}return null;};}function patchUpdates(_0xf3e357){return function(_0x1b6b78){try{jsonpatch['apply'](_0x1b6b78,_0xf3e357,!![]);}catch(_0x59cae8){return BPromise[_0x0987('0x21')](_0x59cae8);}return _0x1b6b78['save']();};}function saveUpdates(_0x55b8f9,_0x4aa3a0){return function(_0x2f24f1){if(_0x2f24f1){return _0x2f24f1[_0x0987('0x22')](_0x55b8f9)[_0x0987('0x23')](function(_0x527a6f){return _0x527a6f;});}return null;};}function removeEntity(_0x2ccc31,_0x45cccc){return function(_0x4652ed){if(_0x4652ed){return _0x4652ed[_0x0987('0x24')]()[_0x0987('0x23')](function(){_0x2ccc31[_0x0987('0x1b')](0xcc)[_0x0987('0x1a')]();});}};}function handleEntityNotFound(_0x3fea7a,_0xc80763){return function(_0x5bd147){if(!_0x5bd147){_0x3fea7a['sendStatus'](0x194);}return _0x5bd147;};}function handleError(_0x2dd186,_0x484f5c){_0x484f5c=_0x484f5c||0x1f4;return function(_0x100a82){logger[_0x0987('0x25')](_0x100a82[_0x0987('0x26')]);if(_0x100a82[_0x0987('0x27')]){delete _0x100a82[_0x0987('0x27')];}_0x2dd186['status'](_0x484f5c)['send'](_0x100a82);};}exports[_0x0987('0x28')]=function(_0x976d9f,_0x5005fb){var _0x382252={},_0x3513b8={},_0x2846b8={'count':0x0,'rows':[]};var _0x194e9b=_[_0x0987('0x29')](db[_0x0987('0x2a')]['rawAttributes'],function(_0xc8ac30){return{'name':_0xc8ac30[_0x0987('0x2b')],'type':_0xc8ac30['type'][_0x0987('0x2c')]};});_0x3513b8[_0x0987('0x2d')]=_['map'](_0x194e9b,_0x0987('0x27'));_0x3513b8[_0x0987('0x2e')]=_[_0x0987('0x2f')](_0x976d9f[_0x0987('0x2e')]);_0x3513b8[_0x0987('0x30')]=_[_0x0987('0x31')](_0x3513b8[_0x0987('0x2d')],_0x3513b8['query']);_0x382252['attributes']=_['intersection'](_0x3513b8[_0x0987('0x2d')],qs[_0x0987('0x32')](_0x976d9f[_0x0987('0x2e')][_0x0987('0x32')]));_0x382252['attributes']=_0x382252[_0x0987('0x33')][_0x0987('0x34')]?_0x382252[_0x0987('0x33')]:_0x3513b8[_0x0987('0x2d')];if(!_0x976d9f['query'][_0x0987('0x35')](_0x0987('0x36'))){_0x382252['limit']=qs[_0x0987('0x1d')](_0x976d9f[_0x0987('0x2e')][_0x0987('0x1d')]);_0x382252[_0x0987('0x37')]=qs['offset'](_0x976d9f[_0x0987('0x2e')]['offset']);}_0x382252[_0x0987('0x38')]=qs[_0x0987('0x39')](_0x976d9f[_0x0987('0x2e')]['sort']);_0x382252[_0x0987('0x3a')]=qs[_0x0987('0x30')](_[_0x0987('0x3b')](_0x976d9f['query'],_0x3513b8['filters']),_0x194e9b);if(_0x976d9f[_0x0987('0x2e')][_0x0987('0x3c')]){_0x382252[_0x0987('0x3a')]=_['merge'](_0x382252['where'],{'$or':_[_0x0987('0x29')](_0x194e9b,function(_0x2a699d){if(_0x2a699d['type']!==_0x0987('0x3d')){var _0x48784b={};_0x48784b[_0x2a699d[_0x0987('0x27')]]={'$like':'%'+_0x976d9f[_0x0987('0x2e')]['filter']+'%'};return _0x48784b;}})});}_0x382252=_[_0x0987('0x3e')]({},_0x382252,_0x976d9f[_0x0987('0x3f')]);var _0x3a6ec1={'where':_0x382252[_0x0987('0x3a')]};return db['ZendeskConfiguration'][_0x0987('0x1e')](_0x3a6ec1)[_0x0987('0x23')](function(_0x58948b){_0x2846b8[_0x0987('0x1e')]=_0x58948b;if(_0x976d9f[_0x0987('0x2e')][_0x0987('0x40')]){_0x382252[_0x0987('0x41')]=[{'all':!![]}];}return db[_0x0987('0x2a')]['findAll'](_0x382252);})[_0x0987('0x23')](function(_0x1ffa93){_0x2846b8[_0x0987('0x42')]=_0x1ffa93;return _0x2846b8;})[_0x0987('0x23')](respondWithFilteredResult(_0x5005fb,_0x382252))[_0x0987('0x43')](handleError(_0x5005fb,null));};exports[_0x0987('0x44')]=function(_0x144f0a,_0x2c9271){var _0x4e6461={'raw':![],'where':{'id':_0x144f0a[_0x0987('0x45')]['id']}},_0x30f69a={};_0x30f69a[_0x0987('0x2d')]=_[_0x0987('0x2f')](db[_0x0987('0x2a')][_0x0987('0x46')]);_0x30f69a[_0x0987('0x2e')]=_['keys'](_0x144f0a['query']);_0x30f69a[_0x0987('0x30')]=_['intersection'](_0x30f69a[_0x0987('0x2d')],_0x30f69a['query']);_0x4e6461[_0x0987('0x33')]=_[_0x0987('0x31')](_0x30f69a[_0x0987('0x2d')],qs[_0x0987('0x32')](_0x144f0a[_0x0987('0x2e')][_0x0987('0x32')]));_0x4e6461[_0x0987('0x33')]=_0x4e6461['attributes'][_0x0987('0x34')]?_0x4e6461[_0x0987('0x33')]:_0x30f69a['model'];if(_0x144f0a['query'][_0x0987('0x40')]){_0x4e6461[_0x0987('0x41')]=[{'all':!![]}];}_0x4e6461=_['merge']({},_0x4e6461,_0x144f0a[_0x0987('0x3f')]);return db['ZendeskConfiguration']['find'](_0x4e6461)[_0x0987('0x23')](handleEntityNotFound(_0x2c9271,null))[_0x0987('0x23')](respondWithResult(_0x2c9271,null))[_0x0987('0x43')](handleError(_0x2c9271,null));};exports[_0x0987('0x47')]=function(_0x2d45cb,_0x4ce1cf){return db[_0x0987('0x2a')][_0x0987('0x47')](_0x2d45cb['body'],{})['then'](respondWithResult(_0x4ce1cf,0xc9))[_0x0987('0x43')](handleError(_0x4ce1cf,null));};exports[_0x0987('0x22')]=function(_0x2fd940,_0x5e1205){if(_0x2fd940[_0x0987('0x48')]['id']){delete _0x2fd940[_0x0987('0x48')]['id'];}return db[_0x0987('0x2a')][_0x0987('0x49')]({'where':{'id':_0x2fd940['params']['id']}})['then'](handleEntityNotFound(_0x5e1205,null))[_0x0987('0x23')](saveUpdates(_0x2fd940[_0x0987('0x48')],null))['then'](respondWithResult(_0x5e1205,null))[_0x0987('0x43')](handleError(_0x5e1205,null));};exports['destroy']=function(_0x62f94d,_0x2c56ce){return db[_0x0987('0x2a')]['find']({'where':{'id':_0x62f94d[_0x0987('0x45')]['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x2c56ce,null))['then'](removeEntity(_0x2c56ce,null))[_0x0987('0x43')](handleError(_0x2c56ce,null));};exports['getFields']=function(_0x3129d8,_0x12db52,_0x5f4f97){var _0x237df2={};var _0x279941={};var _0x330b4b;var _0x532ff5;return db[_0x0987('0x2a')][_0x0987('0x4a')]({'where':{'id':_0x3129d8[_0x0987('0x45')]['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x12db52,null))[_0x0987('0x23')](function(_0x204ccf){if(_0x204ccf){_0x330b4b=_0x204ccf;_0x279941['model']=_['keys'](db[_0x0987('0x4b')][_0x0987('0x46')]);_0x279941[_0x0987('0x2e')]=_[_0x0987('0x2f')](_0x3129d8['query']);_0x279941['filters']=_[_0x0987('0x31')](_0x279941['model'],_0x279941[_0x0987('0x2e')]);_0x237df2[_0x0987('0x33')]=_['intersection'](_0x279941['model'],qs['fields'](_0x3129d8[_0x0987('0x2e')][_0x0987('0x32')]));_0x237df2['attributes']=_0x237df2[_0x0987('0x33')][_0x0987('0x34')]?_0x237df2[_0x0987('0x33')]:_0x279941[_0x0987('0x2d')];_0x237df2[_0x0987('0x38')]=qs[_0x0987('0x39')](_0x3129d8[_0x0987('0x2e')][_0x0987('0x39')]);_0x237df2[_0x0987('0x3a')]=qs['filters'](_[_0x0987('0x3b')](_0x3129d8[_0x0987('0x2e')],_0x279941[_0x0987('0x30')]));if(_0x3129d8['query'][_0x0987('0x3c')]){_0x237df2[_0x0987('0x3a')]=_[_0x0987('0x3e')](_0x237df2[_0x0987('0x3a')],{'$or':_[_0x0987('0x29')](_0x237df2['attributes'],function(_0x30fd1b){var _0x198be0={};_0x198be0[_0x30fd1b]={'$like':'%'+_0x3129d8[_0x0987('0x2e')][_0x0987('0x3c')]+'%'};return _0x198be0;})});}_0x237df2=_[_0x0987('0x3e')]({},_0x237df2,_0x3129d8[_0x0987('0x3f')]);return _0x330b4b[_0x0987('0x4c')](_0x237df2);}})[_0x0987('0x23')](function(_0x36e778){if(_0x36e778){_0x532ff5=_0x36e778[_0x0987('0x34')];if(!_0x3129d8['query'][_0x0987('0x35')](_0x0987('0x36'))){_0x237df2[_0x0987('0x1d')]=qs[_0x0987('0x1d')](_0x3129d8[_0x0987('0x2e')]['limit']);_0x237df2['offset']=qs[_0x0987('0x37')](_0x3129d8[_0x0987('0x2e')][_0x0987('0x37')]);}return _0x330b4b[_0x0987('0x4c')](_0x237df2);}})['then'](function(_0x2226d0){if(_0x2226d0){return _0x2226d0?{'count':_0x532ff5,'rows':_0x2226d0}:null;}})[_0x0987('0x23')](respondWithResult(_0x12db52,null))[_0x0987('0x43')](handleError(_0x12db52,null));};exports['getSubjects']=function(_0xb710f6,_0x2d4726,_0x6d273f){var _0x94c114={};var _0x2a1a61={};var _0x2dce94;var _0x24a694;return db[_0x0987('0x2a')][_0x0987('0x4a')]({'where':{'id':_0xb710f6[_0x0987('0x45')]['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x2d4726,null))[_0x0987('0x23')](function(_0xd8e569){if(_0xd8e569){_0x2dce94=_0xd8e569;_0x2a1a61['model']=_[_0x0987('0x2f')](db[_0x0987('0x4b')][_0x0987('0x46')]);_0x2a1a61[_0x0987('0x2e')]=_['keys'](_0xb710f6['query']);_0x2a1a61[_0x0987('0x30')]=_[_0x0987('0x31')](_0x2a1a61['model'],_0x2a1a61[_0x0987('0x2e')]);_0x94c114['attributes']=_['intersection'](_0x2a1a61['model'],qs['fields'](_0xb710f6['query'][_0x0987('0x32')]));_0x94c114['attributes']=_0x94c114[_0x0987('0x33')][_0x0987('0x34')]?_0x94c114[_0x0987('0x33')]:_0x2a1a61['model'];_0x94c114[_0x0987('0x38')]=qs['sort'](_0xb710f6['query'][_0x0987('0x39')]);_0x94c114[_0x0987('0x3a')]=qs[_0x0987('0x30')](_['pick'](_0xb710f6['query'],_0x2a1a61[_0x0987('0x30')]));if(_0xb710f6[_0x0987('0x2e')]['filter']){_0x94c114[_0x0987('0x3a')]=_['merge'](_0x94c114['where'],{'$or':_[_0x0987('0x29')](_0x94c114[_0x0987('0x33')],function(_0x5b1b50){var _0x1dd1f2={};_0x1dd1f2[_0x5b1b50]={'$like':'%'+_0xb710f6['query']['filter']+'%'};return _0x1dd1f2;})});}_0x94c114=_[_0x0987('0x3e')]({},_0x94c114,_0xb710f6[_0x0987('0x3f')]);return _0x2dce94[_0x0987('0x4d')](_0x94c114);}})[_0x0987('0x23')](function(_0x5623f4){if(_0x5623f4){_0x24a694=_0x5623f4[_0x0987('0x34')];if(!_0xb710f6[_0x0987('0x2e')]['hasOwnProperty'](_0x0987('0x36'))){_0x94c114[_0x0987('0x1d')]=qs[_0x0987('0x1d')](_0xb710f6[_0x0987('0x2e')]['limit']);_0x94c114[_0x0987('0x37')]=qs[_0x0987('0x37')](_0xb710f6['query'][_0x0987('0x37')]);}return _0x2dce94[_0x0987('0x4d')](_0x94c114);}})[_0x0987('0x23')](function(_0x1f45c5){if(_0x1f45c5){return _0x1f45c5?{'count':_0x24a694,'rows':_0x1f45c5}:null;}})[_0x0987('0x23')](respondWithResult(_0x2d4726,null))[_0x0987('0x43')](handleError(_0x2d4726,null));};exports['getDescriptions']=function(_0x580e40,_0x1b6cd6,_0x3f6f0c){var _0x36ea01={};var _0x19bf0e={};var _0x5eaa4d;var _0x2489fe;return db[_0x0987('0x2a')]['findOne']({'where':{'id':_0x580e40['params']['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x1b6cd6,null))[_0x0987('0x23')](function(_0x1cc4a3){if(_0x1cc4a3){_0x5eaa4d=_0x1cc4a3;_0x19bf0e['model']=_['keys'](db[_0x0987('0x4b')][_0x0987('0x46')]);_0x19bf0e['query']=_[_0x0987('0x2f')](_0x580e40[_0x0987('0x2e')]);_0x19bf0e['filters']=_['intersection'](_0x19bf0e[_0x0987('0x2d')],_0x19bf0e[_0x0987('0x2e')]);_0x36ea01[_0x0987('0x33')]=_[_0x0987('0x31')](_0x19bf0e[_0x0987('0x2d')],qs[_0x0987('0x32')](_0x580e40[_0x0987('0x2e')][_0x0987('0x32')]));_0x36ea01[_0x0987('0x33')]=_0x36ea01[_0x0987('0x33')]['length']?_0x36ea01[_0x0987('0x33')]:_0x19bf0e[_0x0987('0x2d')];_0x36ea01[_0x0987('0x38')]=qs['sort'](_0x580e40[_0x0987('0x2e')][_0x0987('0x39')]);_0x36ea01[_0x0987('0x3a')]=qs[_0x0987('0x30')](_[_0x0987('0x3b')](_0x580e40[_0x0987('0x2e')],_0x19bf0e[_0x0987('0x30')]));if(_0x580e40[_0x0987('0x2e')]['filter']){_0x36ea01[_0x0987('0x3a')]=_[_0x0987('0x3e')](_0x36ea01['where'],{'$or':_[_0x0987('0x29')](_0x36ea01[_0x0987('0x33')],function(_0x3ca578){var _0x2d3456={};_0x2d3456[_0x3ca578]={'$like':'%'+_0x580e40[_0x0987('0x2e')]['filter']+'%'};return _0x2d3456;})});}_0x36ea01=_[_0x0987('0x3e')]({},_0x36ea01,_0x580e40[_0x0987('0x3f')]);return _0x5eaa4d[_0x0987('0x4e')](_0x36ea01);}})[_0x0987('0x23')](function(_0x36afc0){if(_0x36afc0){_0x2489fe=_0x36afc0[_0x0987('0x34')];if(!_0x580e40['query']['hasOwnProperty'](_0x0987('0x36'))){_0x36ea01[_0x0987('0x1d')]=qs['limit'](_0x580e40[_0x0987('0x2e')][_0x0987('0x1d')]);_0x36ea01[_0x0987('0x37')]=qs[_0x0987('0x37')](_0x580e40['query'][_0x0987('0x37')]);}return _0x5eaa4d[_0x0987('0x4e')](_0x36ea01);}})[_0x0987('0x23')](function(_0x104bf6){if(_0x104bf6){return _0x104bf6?{'count':_0x2489fe,'rows':_0x104bf6}:null;}})[_0x0987('0x23')](respondWithResult(_0x1b6cd6,null))[_0x0987('0x43')](handleError(_0x1b6cd6,null));};exports[_0x0987('0x4f')]=function(_0x190d43,_0x5d8ecd,_0x3f25ec){var _0x224f3c={};var _0xaea6cd={};var _0x133377;var _0x3c2293;return db[_0x0987('0x2a')]['findOne']({'where':{'id':_0x190d43[_0x0987('0x45')]['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x5d8ecd,null))[_0x0987('0x23')](function(_0x4c8d9d){if(_0x4c8d9d){_0x133377=_0x4c8d9d;_0xaea6cd[_0x0987('0x2d')]=_[_0x0987('0x2f')](db[_0x0987('0x50')][_0x0987('0x46')]);_0xaea6cd[_0x0987('0x2e')]=_['keys'](_0x190d43[_0x0987('0x2e')]);_0xaea6cd[_0x0987('0x30')]=_[_0x0987('0x31')](_0xaea6cd['model'],_0xaea6cd[_0x0987('0x2e')]);_0x224f3c[_0x0987('0x33')]=_['intersection'](_0xaea6cd[_0x0987('0x2d')],qs[_0x0987('0x32')](_0x190d43[_0x0987('0x2e')][_0x0987('0x32')]));_0x224f3c['attributes']=_0x224f3c[_0x0987('0x33')][_0x0987('0x34')]?_0x224f3c['attributes']:_0xaea6cd[_0x0987('0x2d')];_0x224f3c[_0x0987('0x38')]=qs['sort'](_0x190d43[_0x0987('0x2e')][_0x0987('0x39')]);_0x224f3c[_0x0987('0x3a')]=qs['filters'](_[_0x0987('0x3b')](_0x190d43['query'],_0xaea6cd[_0x0987('0x30')]));if(_0x190d43[_0x0987('0x2e')][_0x0987('0x3c')]){_0x224f3c['where']=_['merge'](_0x224f3c[_0x0987('0x3a')],{'$or':_[_0x0987('0x29')](_0x224f3c[_0x0987('0x33')],function(_0x4ae6ce){var _0x316537={};_0x316537[_0x4ae6ce]={'$like':'%'+_0x190d43[_0x0987('0x2e')]['filter']+'%'};return _0x316537;})});}_0x224f3c=_[_0x0987('0x3e')]({},_0x224f3c,_0x190d43[_0x0987('0x3f')]);return _0x133377['getTags'](_0x224f3c);}})[_0x0987('0x23')](function(_0x4f7ab8){if(_0x4f7ab8){_0x3c2293=_0x4f7ab8[_0x0987('0x34')];if(!_0x190d43['query']['hasOwnProperty'](_0x0987('0x36'))){_0x224f3c[_0x0987('0x1d')]=qs[_0x0987('0x1d')](_0x190d43[_0x0987('0x2e')][_0x0987('0x1d')]);_0x224f3c[_0x0987('0x37')]=qs[_0x0987('0x37')](_0x190d43[_0x0987('0x2e')][_0x0987('0x37')]);}return _0x133377[_0x0987('0x4f')](_0x224f3c);}})[_0x0987('0x23')](function(_0x8887dd){if(_0x8887dd){return _0x8887dd?{'count':_0x3c2293,'rows':_0x8887dd}:null;}})[_0x0987('0x23')](respondWithResult(_0x5d8ecd,null))[_0x0987('0x43')](handleError(_0x5d8ecd,null));};exports[_0x0987('0x51')]=function(_0x522fd1,_0x14b2f9,_0x21e743){if(_0x522fd1[_0x0987('0x48')]['id']){delete _0x522fd1[_0x0987('0x48')]['id'];}return db['ZendeskConfiguration'][_0x0987('0x4a')]({'where':{'id':_0x522fd1[_0x0987('0x45')]['id']}})[_0x0987('0x23')](handleEntityNotFound(_0x14b2f9,null))['then'](function(_0x35853d){if(_0x35853d){return _0x35853d[_0x0987('0x51')](_0x522fd1[_0x0987('0x48')]['ids']||[]);}return null;})[_0x0987('0x23')](respondWithResult(_0x14b2f9,null))[_0x0987('0x43')](handleError(_0x14b2f9,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5af7d5c..0552fa9 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 _0x0598=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','request-promise','path','exports'];(function(_0x20ebb5,_0x237d88){var _0x487182=function(_0xaa5491){while(--_0xaa5491){_0x20ebb5['push'](_0x20ebb5['shift']());}};_0x487182(++_0x237d88);}(_0x0598,0x92));var _0x8059=function(_0x4b66e5,_0x4860ea){_0x4b66e5=_0x4b66e5-0x0;var _0x5f22d9=_0x0598[_0x4b66e5];return _0x5f22d9;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var logger=require('../../config/logger')(_0x8059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8059('0x3'));var fs=require('fs');var path=require(_0x8059('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x8059('0x5')]=function(_0xa7d7c1,_0x512c0f){return _0xa7d7c1['define'](_0x8059('0x6'),attributes,{'tableName':_0x8059('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5204=['request-promise','path','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird'];(function(_0x1df3e5,_0x2d37f1){var _0x422d0c=function(_0x51d43f){while(--_0x51d43f){_0x1df3e5['push'](_0x1df3e5['shift']());}};_0x422d0c(++_0x2d37f1);}(_0x5204,0xdf));var _0x4520=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x5204[_0x34e752];return _0x7c6347;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var logger=require('../../config/logger')(_0x4520('0x2'));var moment=require(_0x4520('0x3'));var BPromise=require(_0x4520('0x4'));var rp=require(_0x4520('0x5'));var fs=require('fs');var path=require(_0x4520('0x6'));var rimraf=require('rimraf');var config=require(_0x4520('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x4520('0x8')]=function(_0x209381,_0xe0a256){return _0x209381[_0x4520('0x9')](_0x4520('0xa'),attributes,{'tableName':_0x4520('0xb'),'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 248d290..300b982 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 _0x1e97=['request\x20sent','stringify','error','code','message','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x5c3fc3,_0x3abe58){var _0x3301de=function(_0x420773){while(--_0x420773){_0x5c3fc3['push'](_0x5c3fc3['shift']());}};_0x3301de(++_0x3abe58);}(_0x1e97,0x16f));var _0x71e9=function(_0x26ca47,_0x1bb817){_0x26ca47=_0x26ca47-0x0;var _0xa4b530=_0x1e97[_0x26ca47];return _0xa4b530;};'use strict';var _=require('lodash');var util=require(_0x71e9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x71e9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71e9('0x2'))['db'];var utils=require(_0x71e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x71e9('0x4'));var jayson=require(_0x71e9('0x5'));var client=jayson['client'][_0x71e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5e9d23,_0x292cff,_0x380a48){return new BPromise(function(_0x35e67b,_0x5f2323){return client[_0x71e9('0x7')](_0x5e9d23,_0x380a48)[_0x71e9('0x8')](function(_0x3e915d){logger[_0x71e9('0x9')](_0x71e9('0xa'),_0x292cff,_0x71e9('0xb'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x292cff,_0x71e9('0xb'),JSON[_0x71e9('0xc')](_0x3e915d));if(_0x3e915d[_0x71e9('0xd')]){if(_0x3e915d[_0x71e9('0xd')][_0x71e9('0xe')]===0x1f4){logger[_0x71e9('0xd')](_0x71e9('0xa'),_0x292cff,_0x3e915d['error']['message']);return _0x5f2323(_0x3e915d[_0x71e9('0xd')][_0x71e9('0xf')]);}logger[_0x71e9('0xd')]('ZendeskConfiguration,\x20%s,\x20%s',_0x292cff,_0x3e915d[_0x71e9('0xd')][_0x71e9('0xf')]);return _0x35e67b(_0x3e915d['error'][_0x71e9('0xf')]);}else{logger['info'](_0x71e9('0xa'),_0x292cff,_0x71e9('0xb'));_0x35e67b(_0x3e915d[_0x71e9('0x10')][_0x71e9('0xf')]);}})[_0x71e9('0x11')](function(_0x1869de){logger[_0x71e9('0xd')](_0x71e9('0xa'),_0x292cff,_0x1869de);_0x5f2323(_0x1869de);});});} \ No newline at end of file +var _0x5108=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xe98508,_0x17f727){var _0x21f63e=function(_0x193865){while(--_0x193865){_0xe98508['push'](_0xe98508['shift']());}};_0x21f63e(++_0x17f727);}(_0x5108,0x1c6));var _0x8510=function(_0x13d09c,_0x562396){_0x13d09c=_0x13d09c-0x0;var _0x450046=_0x5108[_0x13d09c];return _0x450046;};'use strict';var _=require(_0x8510('0x0'));var util=require('util');var moment=require(_0x8510('0x1'));var BPromise=require(_0x8510('0x2'));var rs=require(_0x8510('0x3'));var fs=require('fs');var Redis=require(_0x8510('0x4'));var db=require(_0x8510('0x5'))['db'];var utils=require(_0x8510('0x6'));var logger=require('../../config/logger')(_0x8510('0x7'));var config=require(_0x8510('0x8'));var jayson=require(_0x8510('0x9'));var client=jayson[_0x8510('0xa')][_0x8510('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ecd8c,_0xee1cc8,_0x407a9e){return new BPromise(function(_0x2522e1,_0x9cf008){return client[_0x8510('0xc')](_0x3ecd8c,_0x407a9e)[_0x8510('0xd')](function(_0x4c38ed){logger[_0x8510('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0xee1cc8,_0x8510('0xf'));logger[_0x8510('0x10')](_0x8510('0x11'),_0xee1cc8,_0x8510('0xf'),JSON[_0x8510('0x12')](_0x4c38ed));if(_0x4c38ed[_0x8510('0x13')]){if(_0x4c38ed[_0x8510('0x13')]['code']===0x1f4){logger[_0x8510('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0xee1cc8,_0x4c38ed[_0x8510('0x13')][_0x8510('0x14')]);return _0x9cf008(_0x4c38ed[_0x8510('0x13')][_0x8510('0x14')]);}logger[_0x8510('0x13')](_0x8510('0x15'),_0xee1cc8,_0x4c38ed[_0x8510('0x13')]['message']);return _0x2522e1(_0x4c38ed[_0x8510('0x13')][_0x8510('0x14')]);}else{logger['info'](_0x8510('0x15'),_0xee1cc8,_0x8510('0xf'));_0x2522e1(_0x4c38ed['result'][_0x8510('0x14')]);}})[_0x8510('0x16')](function(_0x1f61aa){logger[_0x8510('0x13')](_0x8510('0x15'),_0xee1cc8,_0x1f61aa);_0x9cf008(_0x1f61aa);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index fdf35c5..531f9e7 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 _0x2be4=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id'];(function(_0x5a09a4,_0x13f171){var _0x5779a7=function(_0x1395b3){while(--_0x1395b3){_0x5a09a4['push'](_0x5a09a4['shift']());}};_0x5779a7(++_0x13f171);}(_0x2be4,0x120));var _0x42be=function(_0x562c78,_0x28ecb4){_0x562c78=_0x562c78-0x0;var _0x2709b7=_0x2be4[_0x562c78];return _0x2709b7;};'use strict';var multer=require(_0x42be('0x0'));var util=require(_0x42be('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x42be('0x2'));var router=express[_0x42be('0x3')]();var fs_extra=require(_0x42be('0x4'));var auth=require(_0x42be('0x5'));var interaction=require(_0x42be('0x6'));var config=require(_0x42be('0x7'));var controller=require(_0x42be('0x8'));router[_0x42be('0x9')]('/',auth[_0x42be('0xa')](),controller[_0x42be('0xb')]);router[_0x42be('0x9')]('/:id',auth[_0x42be('0xa')](),controller[_0x42be('0xc')]);router[_0x42be('0xd')]('/',auth['isAuthenticated'](),controller[_0x42be('0xe')]);router['put']('/:id',auth[_0x42be('0xa')](),controller[_0x42be('0xf')]);router[_0x42be('0x10')](_0x42be('0x11'),auth[_0x42be('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe2df=['express','Router','fs-extra','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe2df,0x1ad));var _0xfe2d=function(_0x365859,_0x49f629){_0x365859=_0x365859-0x0;var _0x32545e=_0xe2df[_0x365859];return _0x32545e;};'use strict';var multer=require(_0xfe2d('0x0'));var util=require(_0xfe2d('0x1'));var path=require(_0xfe2d('0x2'));var timeout=require('connect-timeout');var express=require(_0xfe2d('0x3'));var router=express[_0xfe2d('0x4')]();var fs_extra=require(_0xfe2d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfe2d('0x6'));var config=require('../../config/environment');var controller=require(_0xfe2d('0x7'));router[_0xfe2d('0x8')]('/',auth[_0xfe2d('0x9')](),controller[_0xfe2d('0xa')]);router[_0xfe2d('0x8')]('/:id',auth[_0xfe2d('0x9')](),controller[_0xfe2d('0xb')]);router['post']('/',auth[_0xfe2d('0x9')](),controller[_0xfe2d('0xc')]);router[_0xfe2d('0xd')](_0xfe2d('0xe'),auth[_0xfe2d('0x9')](),controller[_0xfe2d('0xf')]);router[_0xfe2d('0x10')](_0xfe2d('0xe'),auth[_0xfe2d('0x9')](),controller[_0xfe2d('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index d2f1629..f78edf9 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 _0x1da4=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1da4,0x1a5));var _0x41da=function(_0x4e23d6,_0x10b3bf){_0x4e23d6=_0x4e23d6-0x0;var _0x362b52=_0x1da4[_0x4e23d6];return _0x362b52;};'use strict';var Sequelize=require(_0x41da('0x0'));module[_0x41da('0x1')]={'type':{'type':Sequelize[_0x41da('0x2')](_0x41da('0x3'),_0x41da('0x4'),_0x41da('0x5'),_0x41da('0x6'),_0x41da('0x7')),'defaultValue':_0x41da('0x3')},'content':{'type':Sequelize[_0x41da('0x8')]},'key':{'type':Sequelize[_0x41da('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x41da('0x3'),_0x41da('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x41da('0x8')]},'idField':{'type':Sequelize[_0x41da('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x41da('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x41da('0x8')]}}; \ No newline at end of file +var _0x55ea=['customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x16fb63,_0x8efab5){var _0x52e1ec=function(_0x1befc5){while(--_0x1befc5){_0x16fb63['push'](_0x16fb63['shift']());}};_0x52e1ec(++_0x8efab5);}(_0x55ea,0x7b));var _0xa55e=function(_0x2f04a6,_0x2c7333){_0x2f04a6=_0x2f04a6-0x0;var _0x4f1e77=_0x55ea[_0x2f04a6];return _0x4f1e77;};'use strict';var Sequelize=require(_0xa55e('0x0'));module[_0xa55e('0x1')]={'type':{'type':Sequelize[_0xa55e('0x2')](_0xa55e('0x3'),_0xa55e('0x4'),_0xa55e('0x5'),'keyValue','picklist'),'defaultValue':_0xa55e('0x3')},'content':{'type':Sequelize[_0xa55e('0x6')]},'key':{'type':Sequelize[_0xa55e('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xa55e('0x4'),_0xa55e('0x5'))},'keyContent':{'type':Sequelize[_0xa55e('0x6')]},'idField':{'type':Sequelize[_0xa55e('0x6')]},'nameField':{'type':Sequelize[_0xa55e('0x6')]},'customField':{'type':Sequelize[_0xa55e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa55e('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index d1cb3ce..0ef56c7 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 _0x32c0=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','ZendeskField','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x24741a,_0x36a3f9){var _0x4d57ac=function(_0x3f79e2){while(--_0x3f79e2){_0x24741a['push'](_0x24741a['shift']());}};_0x4d57ac(++_0x36a3f9);}(_0x32c0,0x1f3));var _0x032c=function(_0x16d316,_0x23195e){_0x16d316=_0x16d316-0x0;var _0x2ac35e=_0x32c0[_0x16d316];return _0x2ac35e;};'use strict';var emlformat=require(_0x032c('0x0'));var rimraf=require(_0x032c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x032c('0x2'));var rp=require(_0x032c('0x3'));var moment=require('moment');var BPromise=require(_0x032c('0x4'));var Mustache=require(_0x032c('0x5'));var util=require(_0x032c('0x6'));var path=require(_0x032c('0x7'));var sox=require('sox');var csv=require(_0x032c('0x8'));var ejs=require(_0x032c('0x9'));var fs=require('fs');var fs_extra=require(_0x032c('0xa'));var _=require(_0x032c('0xb'));var squel=require('squel');var crypto=require(_0x032c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x032c('0xd'));var toCsv=require(_0x032c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x032c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x032c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x032c('0x10'));var logger=require(_0x032c('0x11'))(_0x032c('0x12'));var utils=require(_0x032c('0x13'));var config=require(_0x032c('0x14'));var licenseUtil=require(_0x032c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25af77,_0xc88e78){_0xc88e78=_0xc88e78||0xcc;return function(_0x364605){if(_0x364605){return _0x25af77[_0x032c('0x16')](_0xc88e78);}return _0x25af77['status'](_0xc88e78)[_0x032c('0x17')]();};}function respondWithResult(_0x2650d6,_0x1ec9d8){_0x1ec9d8=_0x1ec9d8||0xc8;return function(_0x216984){if(_0x216984){return _0x2650d6[_0x032c('0x18')](_0x1ec9d8)[_0x032c('0x19')](_0x216984);}};}function respondWithFilteredResult(_0x51266f,_0xb678d5){return function(_0x15ddb8){if(_0x15ddb8){var _0x3ebda8=typeof _0xb678d5[_0x032c('0x1a')]===_0x032c('0x1b')&&typeof _0xb678d5[_0x032c('0x1c')]==='undefined';var _0x1444bb=_0x15ddb8[_0x032c('0x1d')];var _0x4435ad=_0x3ebda8?0x0:_0xb678d5[_0x032c('0x1a')];var _0x2b2693=_0x3ebda8?_0x15ddb8[_0x032c('0x1d')]:_0xb678d5[_0x032c('0x1a')]+_0xb678d5[_0x032c('0x1c')];var _0x3a6f71;if(_0x2b2693>=_0x1444bb){_0x2b2693=_0x1444bb;_0x3a6f71=0xc8;}else{_0x3a6f71=0xce;}_0x51266f[_0x032c('0x18')](_0x3a6f71);return _0x51266f[_0x032c('0x1e')](_0x032c('0x1f'),_0x4435ad+'-'+_0x2b2693+'/'+_0x1444bb)[_0x032c('0x19')](_0x15ddb8);}return null;};}function patchUpdates(_0x515409){return function(_0x8a8f30){try{jsonpatch['apply'](_0x8a8f30,_0x515409,!![]);}catch(_0x5341e6){return BPromise['reject'](_0x5341e6);}return _0x8a8f30['save']();};}function saveUpdates(_0x2a24f7,_0x4c0c4b){return function(_0x2ce758){if(_0x2ce758){return _0x2ce758[_0x032c('0x20')](_0x2a24f7)[_0x032c('0x21')](function(_0x51ad8c){return _0x51ad8c;});}return null;};}function removeEntity(_0x135612,_0x16d40f){return function(_0x28ae24){if(_0x28ae24){return _0x28ae24[_0x032c('0x22')]()[_0x032c('0x21')](function(){_0x135612[_0x032c('0x18')](0xcc)[_0x032c('0x17')]();});}};}function handleEntityNotFound(_0x58894b,_0x16ed08){return function(_0x1a0881){if(!_0x1a0881){_0x58894b[_0x032c('0x16')](0x194);}return _0x1a0881;};}function handleError(_0x56d20d,_0x1350d1){_0x1350d1=_0x1350d1||0x1f4;return function(_0x19ed06){logger[_0x032c('0x23')](_0x19ed06[_0x032c('0x24')]);if(_0x19ed06['name']){delete _0x19ed06[_0x032c('0x25')];}_0x56d20d[_0x032c('0x18')](_0x1350d1)[_0x032c('0x26')](_0x19ed06);};}exports[_0x032c('0x27')]=function(_0x51d679,_0x119d8f){var _0x1de595={},_0x5cdd90={},_0x659bbf={'count':0x0,'rows':[]};var _0x306935=_[_0x032c('0x28')](db[_0x032c('0x29')]['rawAttributes'],function(_0x50a3f8){return{'name':_0x50a3f8[_0x032c('0x2a')],'type':_0x50a3f8['type'][_0x032c('0x2b')]};});_0x5cdd90[_0x032c('0x2c')]=_['map'](_0x306935,_0x032c('0x25'));_0x5cdd90[_0x032c('0x2d')]=_[_0x032c('0x2e')](_0x51d679[_0x032c('0x2d')]);_0x5cdd90['filters']=_[_0x032c('0x2f')](_0x5cdd90[_0x032c('0x2c')],_0x5cdd90['query']);_0x1de595[_0x032c('0x30')]=_[_0x032c('0x2f')](_0x5cdd90[_0x032c('0x2c')],qs[_0x032c('0x31')](_0x51d679[_0x032c('0x2d')]['fields']));_0x1de595[_0x032c('0x30')]=_0x1de595['attributes'][_0x032c('0x32')]?_0x1de595['attributes']:_0x5cdd90[_0x032c('0x2c')];if(!_0x51d679[_0x032c('0x2d')][_0x032c('0x33')](_0x032c('0x34'))){_0x1de595[_0x032c('0x1c')]=qs[_0x032c('0x1c')](_0x51d679['query'][_0x032c('0x1c')]);_0x1de595[_0x032c('0x1a')]=qs['offset'](_0x51d679[_0x032c('0x2d')][_0x032c('0x1a')]);}_0x1de595[_0x032c('0x35')]=qs['sort'](_0x51d679[_0x032c('0x2d')][_0x032c('0x36')]);_0x1de595[_0x032c('0x37')]=qs[_0x032c('0x38')](_[_0x032c('0x39')](_0x51d679[_0x032c('0x2d')],_0x5cdd90[_0x032c('0x38')]),_0x306935);if(_0x51d679['query'][_0x032c('0x3a')]){_0x1de595[_0x032c('0x37')]=_[_0x032c('0x3b')](_0x1de595[_0x032c('0x37')],{'$or':_[_0x032c('0x28')](_0x306935,function(_0xf27830){if(_0xf27830[_0x032c('0x3c')]!==_0x032c('0x3d')){var _0x4bba77={};_0x4bba77[_0xf27830[_0x032c('0x25')]]={'$like':'%'+_0x51d679['query'][_0x032c('0x3a')]+'%'};return _0x4bba77;}})});}_0x1de595=_['merge']({},_0x1de595,_0x51d679['options']);var _0x238291={'where':_0x1de595[_0x032c('0x37')]};return db['ZendeskField']['count'](_0x238291)[_0x032c('0x21')](function(_0x4c6c2b){_0x659bbf['count']=_0x4c6c2b;if(_0x51d679[_0x032c('0x2d')][_0x032c('0x3e')]){_0x1de595[_0x032c('0x3f')]=[{'all':!![]}];}return db[_0x032c('0x29')][_0x032c('0x40')](_0x1de595);})[_0x032c('0x21')](function(_0x49b83a){_0x659bbf[_0x032c('0x41')]=_0x49b83a;return _0x659bbf;})['then'](respondWithFilteredResult(_0x119d8f,_0x1de595))['catch'](handleError(_0x119d8f,null));};exports[_0x032c('0x42')]=function(_0x15ebeb,_0x2035d5){var _0x235ad6={'raw':!![],'where':{'id':_0x15ebeb['params']['id']}},_0x47360a={};_0x47360a['model']=_[_0x032c('0x2e')](db['ZendeskField'][_0x032c('0x43')]);_0x47360a[_0x032c('0x2d')]=_[_0x032c('0x2e')](_0x15ebeb[_0x032c('0x2d')]);_0x47360a[_0x032c('0x38')]=_[_0x032c('0x2f')](_0x47360a[_0x032c('0x2c')],_0x47360a[_0x032c('0x2d')]);_0x235ad6[_0x032c('0x30')]=_['intersection'](_0x47360a[_0x032c('0x2c')],qs['fields'](_0x15ebeb['query'][_0x032c('0x31')]));_0x235ad6[_0x032c('0x30')]=_0x235ad6[_0x032c('0x30')][_0x032c('0x32')]?_0x235ad6[_0x032c('0x30')]:_0x47360a['model'];if(_0x15ebeb['query']['includeAll']){_0x235ad6[_0x032c('0x3f')]=[{'all':!![]}];}_0x235ad6=_['merge']({},_0x235ad6,_0x15ebeb[_0x032c('0x44')]);return db[_0x032c('0x29')]['find'](_0x235ad6)[_0x032c('0x21')](handleEntityNotFound(_0x2035d5,null))[_0x032c('0x21')](respondWithResult(_0x2035d5,null))[_0x032c('0x45')](handleError(_0x2035d5,null));};exports[_0x032c('0x46')]=function(_0x3a877a,_0x26e988){return db[_0x032c('0x29')][_0x032c('0x46')](_0x3a877a[_0x032c('0x47')],{})['then'](respondWithResult(_0x26e988,0xc9))[_0x032c('0x45')](handleError(_0x26e988,null));};exports['update']=function(_0x367638,_0x13f1a7){if(_0x367638[_0x032c('0x47')]['id']){delete _0x367638[_0x032c('0x47')]['id'];}return db[_0x032c('0x29')][_0x032c('0x48')]({'where':{'id':_0x367638[_0x032c('0x49')]['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x13f1a7,null))[_0x032c('0x21')](saveUpdates(_0x367638['body'],null))[_0x032c('0x21')](respondWithResult(_0x13f1a7,null))['catch'](handleError(_0x13f1a7,null));};exports[_0x032c('0x22')]=function(_0x2f1032,_0x4e8fd6){return db[_0x032c('0x29')][_0x032c('0x48')]({'where':{'id':_0x2f1032['params']['id']}})[_0x032c('0x21')](handleEntityNotFound(_0x4e8fd6,null))[_0x032c('0x21')](removeEntity(_0x4e8fd6,null))[_0x032c('0x45')](handleError(_0x4e8fd6,null));}; \ No newline at end of file +var _0x1ca3=['apply','then','destroy','end','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','rows','catch','options','find','create','body','update','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1e698c,_0x45173f){var _0x3c22fb=function(_0x5d1b23){while(--_0x5d1b23){_0x1e698c['push'](_0x1e698c['shift']());}};_0x3c22fb(++_0x45173f);}(_0x1ca3,0x6e));var _0x31ca=function(_0x35830e,_0x1d456d){_0x35830e=_0x35830e-0x0;var _0x22b67c=_0x1ca3[_0x35830e];return _0x22b67c;};'use strict';var emlformat=require(_0x31ca('0x0'));var rimraf=require(_0x31ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x31ca('0x2'));var moment=require(_0x31ca('0x3'));var BPromise=require(_0x31ca('0x4'));var Mustache=require(_0x31ca('0x5'));var util=require(_0x31ca('0x6'));var path=require('path');var sox=require(_0x31ca('0x7'));var csv=require(_0x31ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x31ca('0x9'));var squel=require(_0x31ca('0xa'));var crypto=require('crypto');var jsforce=require(_0x31ca('0xb'));var deskjs=require(_0x31ca('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x31ca('0xd'));var Redis=require(_0x31ca('0xe'));var authService=require(_0x31ca('0xf'));var qs=require(_0x31ca('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31ca('0x11'));var logger=require(_0x31ca('0x12'))(_0x31ca('0x13'));var utils=require(_0x31ca('0x14'));var config=require(_0x31ca('0x15'));var licenseUtil=require(_0x31ca('0x16'));var db=require(_0x31ca('0x17'))['db'];function respondWithStatusCode(_0x494994,_0x249f37){_0x249f37=_0x249f37||0xcc;return function(_0x37794b){if(_0x37794b){return _0x494994[_0x31ca('0x18')](_0x249f37);}return _0x494994[_0x31ca('0x19')](_0x249f37)['end']();};}function respondWithResult(_0x3fbc55,_0x3c2165){_0x3c2165=_0x3c2165||0xc8;return function(_0x3d9d0c){if(_0x3d9d0c){return _0x3fbc55[_0x31ca('0x19')](_0x3c2165)[_0x31ca('0x1a')](_0x3d9d0c);}};}function respondWithFilteredResult(_0x3efdaa,_0x145dff){return function(_0x2f2d30){if(_0x2f2d30){var _0x2a542f=typeof _0x145dff[_0x31ca('0x1b')]===_0x31ca('0x1c')&&typeof _0x145dff[_0x31ca('0x1d')]===_0x31ca('0x1c');var _0xacc6bd=_0x2f2d30[_0x31ca('0x1e')];var _0x2f4a62=_0x2a542f?0x0:_0x145dff['offset'];var _0x485923=_0x2a542f?_0x2f2d30['count']:_0x145dff[_0x31ca('0x1b')]+_0x145dff['limit'];var _0x567ea2;if(_0x485923>=_0xacc6bd){_0x485923=_0xacc6bd;_0x567ea2=0xc8;}else{_0x567ea2=0xce;}_0x3efdaa[_0x31ca('0x19')](_0x567ea2);return _0x3efdaa[_0x31ca('0x1f')]('Content-Range',_0x2f4a62+'-'+_0x485923+'/'+_0xacc6bd)['json'](_0x2f2d30);}return null;};}function patchUpdates(_0x16f9bd){return function(_0x2189c0){try{jsonpatch[_0x31ca('0x20')](_0x2189c0,_0x16f9bd,!![]);}catch(_0x5ad521){return BPromise['reject'](_0x5ad521);}return _0x2189c0['save']();};}function saveUpdates(_0x312ebc,_0x20cc7c){return function(_0x2dc45d){if(_0x2dc45d){return _0x2dc45d['update'](_0x312ebc)[_0x31ca('0x21')](function(_0xc91d1a){return _0xc91d1a;});}return null;};}function removeEntity(_0x5ae6b3,_0x8ddb){return function(_0x2721b6){if(_0x2721b6){return _0x2721b6[_0x31ca('0x22')]()[_0x31ca('0x21')](function(){_0x5ae6b3[_0x31ca('0x19')](0xcc)[_0x31ca('0x23')]();});}};}function handleEntityNotFound(_0x4a97c3,_0x4f38a1){return function(_0x520193){if(!_0x520193){_0x4a97c3[_0x31ca('0x18')](0x194);}return _0x520193;};}function handleError(_0x26a568,_0x13af55){_0x13af55=_0x13af55||0x1f4;return function(_0x460151){logger['error'](_0x460151['stack']);if(_0x460151[_0x31ca('0x24')]){delete _0x460151[_0x31ca('0x24')];}_0x26a568[_0x31ca('0x19')](_0x13af55)[_0x31ca('0x25')](_0x460151);};}exports[_0x31ca('0x26')]=function(_0x508892,_0x16cc2a){var _0x410567={},_0x3312d3={},_0x4f1613={'count':0x0,'rows':[]};var _0x403293=_[_0x31ca('0x27')](db[_0x31ca('0x28')][_0x31ca('0x29')],function(_0x19a21b){return{'name':_0x19a21b[_0x31ca('0x2a')],'type':_0x19a21b[_0x31ca('0x2b')][_0x31ca('0x2c')]};});_0x3312d3[_0x31ca('0x2d')]=_[_0x31ca('0x27')](_0x403293,'name');_0x3312d3[_0x31ca('0x2e')]=_[_0x31ca('0x2f')](_0x508892[_0x31ca('0x2e')]);_0x3312d3['filters']=_[_0x31ca('0x30')](_0x3312d3[_0x31ca('0x2d')],_0x3312d3[_0x31ca('0x2e')]);_0x410567[_0x31ca('0x31')]=_[_0x31ca('0x30')](_0x3312d3[_0x31ca('0x2d')],qs['fields'](_0x508892['query'][_0x31ca('0x32')]));_0x410567[_0x31ca('0x31')]=_0x410567['attributes'][_0x31ca('0x33')]?_0x410567[_0x31ca('0x31')]:_0x3312d3[_0x31ca('0x2d')];if(!_0x508892[_0x31ca('0x2e')][_0x31ca('0x34')](_0x31ca('0x35'))){_0x410567['limit']=qs[_0x31ca('0x1d')](_0x508892[_0x31ca('0x2e')][_0x31ca('0x1d')]);_0x410567['offset']=qs[_0x31ca('0x1b')](_0x508892[_0x31ca('0x2e')][_0x31ca('0x1b')]);}_0x410567[_0x31ca('0x36')]=qs[_0x31ca('0x37')](_0x508892[_0x31ca('0x2e')][_0x31ca('0x37')]);_0x410567[_0x31ca('0x38')]=qs[_0x31ca('0x39')](_['pick'](_0x508892[_0x31ca('0x2e')],_0x3312d3[_0x31ca('0x39')]),_0x403293);if(_0x508892[_0x31ca('0x2e')]['filter']){_0x410567['where']=_[_0x31ca('0x3a')](_0x410567['where'],{'$or':_['map'](_0x403293,function(_0x37ec8b){if(_0x37ec8b[_0x31ca('0x2b')]!==_0x31ca('0x3b')){var _0x25b1a8={};_0x25b1a8[_0x37ec8b[_0x31ca('0x24')]]={'$like':'%'+_0x508892['query'][_0x31ca('0x3c')]+'%'};return _0x25b1a8;}})});}_0x410567=_[_0x31ca('0x3a')]({},_0x410567,_0x508892['options']);var _0xf7ed73={'where':_0x410567[_0x31ca('0x38')]};return db[_0x31ca('0x28')][_0x31ca('0x1e')](_0xf7ed73)['then'](function(_0x327006){_0x4f1613[_0x31ca('0x1e')]=_0x327006;if(_0x508892[_0x31ca('0x2e')][_0x31ca('0x3d')]){_0x410567[_0x31ca('0x3e')]=[{'all':!![]}];}return db[_0x31ca('0x28')]['findAll'](_0x410567);})['then'](function(_0x1d5455){_0x4f1613[_0x31ca('0x3f')]=_0x1d5455;return _0x4f1613;})[_0x31ca('0x21')](respondWithFilteredResult(_0x16cc2a,_0x410567))[_0x31ca('0x40')](handleError(_0x16cc2a,null));};exports['show']=function(_0x25e878,_0x2d112f){var _0x259ce0={'raw':!![],'where':{'id':_0x25e878['params']['id']}},_0x2f9559={};_0x2f9559[_0x31ca('0x2d')]=_[_0x31ca('0x2f')](db['ZendeskField'][_0x31ca('0x29')]);_0x2f9559['query']=_[_0x31ca('0x2f')](_0x25e878['query']);_0x2f9559[_0x31ca('0x39')]=_[_0x31ca('0x30')](_0x2f9559[_0x31ca('0x2d')],_0x2f9559['query']);_0x259ce0[_0x31ca('0x31')]=_[_0x31ca('0x30')](_0x2f9559[_0x31ca('0x2d')],qs[_0x31ca('0x32')](_0x25e878[_0x31ca('0x2e')][_0x31ca('0x32')]));_0x259ce0[_0x31ca('0x31')]=_0x259ce0[_0x31ca('0x31')]['length']?_0x259ce0['attributes']:_0x2f9559[_0x31ca('0x2d')];if(_0x25e878['query'][_0x31ca('0x3d')]){_0x259ce0[_0x31ca('0x3e')]=[{'all':!![]}];}_0x259ce0=_[_0x31ca('0x3a')]({},_0x259ce0,_0x25e878[_0x31ca('0x41')]);return db[_0x31ca('0x28')][_0x31ca('0x42')](_0x259ce0)['then'](handleEntityNotFound(_0x2d112f,null))['then'](respondWithResult(_0x2d112f,null))[_0x31ca('0x40')](handleError(_0x2d112f,null));};exports[_0x31ca('0x43')]=function(_0x2b44ec,_0x408065){return db[_0x31ca('0x28')]['create'](_0x2b44ec[_0x31ca('0x44')],{})['then'](respondWithResult(_0x408065,0xc9))['catch'](handleError(_0x408065,null));};exports[_0x31ca('0x45')]=function(_0x465aad,_0x4365dd){if(_0x465aad[_0x31ca('0x44')]['id']){delete _0x465aad[_0x31ca('0x44')]['id'];}return db[_0x31ca('0x28')][_0x31ca('0x42')]({'where':{'id':_0x465aad['params']['id']}})['then'](handleEntityNotFound(_0x4365dd,null))[_0x31ca('0x21')](saveUpdates(_0x465aad[_0x31ca('0x44')],null))['then'](respondWithResult(_0x4365dd,null))['catch'](handleError(_0x4365dd,null));};exports[_0x31ca('0x22')]=function(_0xaa31eb,_0x34d07e){return db[_0x31ca('0x28')]['find']({'where':{'id':_0xaa31eb[_0x31ca('0x46')]['id']}})['then'](handleEntityNotFound(_0x34d07e,null))[_0x31ca('0x21')](removeEntity(_0x34d07e,null))[_0x31ca('0x40')](handleError(_0x34d07e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5adec96..17e75c7 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 _0x415f=['lodash','util','api','moment','bluebird','../../config/environment','exports','ZendeskField','zendesk_unique_index'];(function(_0x236fec,_0x38a44a){var _0xbb1bc0=function(_0x4b5902){while(--_0x4b5902){_0x236fec['push'](_0x236fec['shift']());}};_0xbb1bc0(++_0x38a44a);}(_0x415f,0x7e));var _0xf415=function(_0x437586,_0x3c4186){_0x437586=_0x437586-0x0;var _0x87d575=_0x415f[_0x437586];return _0x87d575;};'use strict';var _=require(_0xf415('0x0'));var util=require(_0xf415('0x1'));var logger=require('../../config/logger')(_0xf415('0x2'));var moment=require(_0xf415('0x3'));var BPromise=require(_0xf415('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf415('0x5'));var attributes=require('./intZendeskField.attributes');module[_0xf415('0x6')]=function(_0x572f8e,_0x4329bf){return _0x572f8e['define'](_0xf415('0x7'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xf415('0x8'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e8d=['request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7e8d,0x10c));var _0xd7e8=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x7e8d[_0x324012];return _0x435cf2;};'use strict';var _=require(_0xd7e8('0x0'));var util=require('util');var logger=require(_0xd7e8('0x1'))('api');var moment=require(_0xd7e8('0x2'));var BPromise=require(_0xd7e8('0x3'));var rp=require(_0xd7e8('0x4'));var fs=require('fs');var path=require(_0xd7e8('0x5'));var rimraf=require(_0xd7e8('0x6'));var config=require(_0xd7e8('0x7'));var attributes=require(_0xd7e8('0x8'));module[_0xd7e8('0x9')]=function(_0x536205,_0x5ee463){return _0x536205[_0xd7e8('0xa')](_0xd7e8('0xb'),attributes,{'tableName':_0xd7e8('0xc'),'paranoid':![],'indexes':[{'name':_0xd7e8('0xd'),'fields':[_0xd7e8('0xe'),_0xd7e8('0xf')],'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 d5fbe57..ebf5055 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 _0x4969=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','info','result','catch','moment','randomstring','ioredis'];(function(_0x2ba740,_0x62a305){var _0x358bda=function(_0x16cc07){while(--_0x16cc07){_0x2ba740['push'](_0x2ba740['shift']());}};_0x358bda(++_0x62a305);}(_0x4969,0x1b5));var _0x9496=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x4969[_0x148c09];return _0x18e613;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9496('0x0'));var BPromise=require('bluebird');var rs=require(_0x9496('0x1'));var fs=require('fs');var Redis=require(_0x9496('0x2'));var db=require(_0x9496('0x3'))['db'];var utils=require(_0x9496('0x4'));var logger=require(_0x9496('0x5'))(_0x9496('0x6'));var config=require('../../config/environment');var jayson=require(_0x9496('0x7'));var client=jayson['client'][_0x9496('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x165d49,_0x1e736f,_0xade899){return new BPromise(function(_0x3630c2,_0x5116af){return client['request'](_0x165d49,_0xade899)[_0x9496('0x9')](function(_0x47a3fd){logger['info']('ZendeskField,\x20%s,\x20%s',_0x1e736f,_0x9496('0xa'));logger[_0x9496('0xb')](_0x9496('0xc'),_0x1e736f,_0x9496('0xa'),JSON['stringify'](_0x47a3fd));if(_0x47a3fd['error']){if(_0x47a3fd[_0x9496('0xd')][_0x9496('0xe')]===0x1f4){logger['error'](_0x9496('0xf'),_0x1e736f,_0x47a3fd[_0x9496('0xd')][_0x9496('0x10')]);return _0x5116af(_0x47a3fd[_0x9496('0xd')][_0x9496('0x10')]);}logger[_0x9496('0xd')]('ZendeskField,\x20%s,\x20%s',_0x1e736f,_0x47a3fd[_0x9496('0xd')]['message']);return _0x3630c2(_0x47a3fd[_0x9496('0xd')]['message']);}else{logger[_0x9496('0x11')]('ZendeskField,\x20%s,\x20%s',_0x1e736f,'request\x20sent');_0x3630c2(_0x47a3fd[_0x9496('0x12')][_0x9496('0x10')]);}})[_0x9496('0x13')](function(_0x3599f1){logger[_0x9496('0xd')](_0x9496('0xf'),_0x1e736f,_0x3599f1);_0x5116af(_0x3599f1);});});} \ No newline at end of file +var _0x6abb=['http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0x18dbd1,_0x59a048){var _0x2d10e2=function(_0x450e39){while(--_0x450e39){_0x18dbd1['push'](_0x18dbd1['shift']());}};_0x2d10e2(++_0x59a048);}(_0x6abb,0x9c));var _0xb6ab=function(_0x373409,_0x1e30f9){_0x373409=_0x373409-0x0;var _0x10612d=_0x6abb[_0x373409];return _0x10612d;};'use strict';var _=require('lodash');var util=require(_0xb6ab('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ab('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb6ab('0x2'))(_0xb6ab('0x3'));var config=require(_0xb6ab('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb6ab('0x5')][_0xb6ab('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x297db5,_0x1d7154,_0x31b9b7){return new BPromise(function(_0x5c3387,_0x574321){return client[_0xb6ab('0x7')](_0x297db5,_0x31b9b7)['then'](function(_0x44f00a){logger[_0xb6ab('0x8')](_0xb6ab('0x9'),_0x1d7154,_0xb6ab('0xa'));logger[_0xb6ab('0xb')](_0xb6ab('0xc'),_0x1d7154,_0xb6ab('0xa'),JSON['stringify'](_0x44f00a));if(_0x44f00a[_0xb6ab('0xd')]){if(_0x44f00a['error'][_0xb6ab('0xe')]===0x1f4){logger[_0xb6ab('0xd')](_0xb6ab('0x9'),_0x1d7154,_0x44f00a[_0xb6ab('0xd')][_0xb6ab('0xf')]);return _0x574321(_0x44f00a[_0xb6ab('0xd')]['message']);}logger[_0xb6ab('0xd')]('ZendeskField,\x20%s,\x20%s',_0x1d7154,_0x44f00a[_0xb6ab('0xd')]['message']);return _0x5c3387(_0x44f00a['error'][_0xb6ab('0xf')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x1d7154,_0xb6ab('0xa'));_0x5c3387(_0x44f00a[_0xb6ab('0x10')][_0xb6ab('0xf')]);}})[_0xb6ab('0x11')](function(_0x172808){logger['error']('ZendeskField,\x20%s,\x20%s',_0x1d7154,_0x172808);_0x574321(_0x172808);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 06109ab..ba3f24c 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 _0x25ca=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','/:id','show','get','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','update','delete','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x25ca,0xf0));var _0xa25c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x25ca[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xa25c('0x0'));var util=require(_0xa25c('0x1'));var path=require(_0xa25c('0x2'));var timeout=require(_0xa25c('0x3'));var express=require(_0xa25c('0x4'));var router=express[_0xa25c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa25c('0x6'));var interaction=require(_0xa25c('0x7'));var config=require(_0xa25c('0x8'));var controller=require(_0xa25c('0x9'));router['get']('/',auth[_0xa25c('0xa')](),controller['index']);router['get'](_0xa25c('0xb'),auth[_0xa25c('0xa')](),controller[_0xa25c('0xc')]);router[_0xa25c('0xd')](_0xa25c('0xe'),auth[_0xa25c('0xa')](),controller[_0xa25c('0xf')]);router[_0xa25c('0xd')](_0xa25c('0x10'),auth[_0xa25c('0xa')](),controller[_0xa25c('0x11')]);router['post']('/',auth[_0xa25c('0xa')](),controller[_0xa25c('0x12')]);router[_0xa25c('0x13')](_0xa25c('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa25c('0x14')](_0xa25c('0xb'),auth['isAuthenticated'](),controller[_0xa25c('0x15')]);router[_0xa25c('0x16')](_0xa25c('0xb'),auth[_0xa25c('0xa')](),controller['destroy']);module[_0xa25c('0x17')]=router; \ No newline at end of file +var _0x726c=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x4e4254,_0x2d552e){var _0x2e15db=function(_0x1e0517){while(--_0x1e0517){_0x4e4254['push'](_0x4e4254['shift']());}};_0x2e15db(++_0x2d552e);}(_0x726c,0xd4));var _0xc726=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x726c[_0x32f7d7];return _0x133d09;};'use strict';var multer=require(_0xc726('0x0'));var util=require(_0xc726('0x1'));var path=require(_0xc726('0x2'));var timeout=require(_0xc726('0x3'));var express=require(_0xc726('0x4'));var router=express['Router']();var fs_extra=require(_0xc726('0x5'));var auth=require(_0xc726('0x6'));var interaction=require(_0xc726('0x7'));var config=require(_0xc726('0x8'));var controller=require(_0xc726('0x9'));router[_0xc726('0xa')]('/',auth[_0xc726('0xb')](),controller[_0xc726('0xc')]);router[_0xc726('0xa')](_0xc726('0xd'),auth[_0xc726('0xb')](),controller['show']);router[_0xc726('0xa')](_0xc726('0xe'),auth[_0xc726('0xb')](),controller[_0xc726('0xf')]);router[_0xc726('0xa')](_0xc726('0x10'),auth[_0xc726('0xb')](),controller[_0xc726('0x11')]);router[_0xc726('0x12')]('/',auth[_0xc726('0xb')](),controller['create']);router[_0xc726('0x12')](_0xc726('0xe'),auth[_0xc726('0xb')](),controller[_0xc726('0x13')]);router[_0xc726('0x14')](_0xc726('0xd'),auth[_0xc726('0xb')](),controller[_0xc726('0x15')]);router[_0xc726('0x16')](_0xc726('0xd'),auth[_0xc726('0xb')](),controller[_0xc726('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index b7ce19b..b01163a 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 _0x0a9a=['STRING','exports'];(function(_0x273fb8,_0x4d257c){var _0x4762db=function(_0x278cfd){while(--_0x278cfd){_0x273fb8['push'](_0x273fb8['shift']());}};_0x4762db(++_0x4d257c);}(_0x0a9a,0x183));var _0xa0a9=function(_0x496522,_0x1dfbe1){_0x496522=_0x496522-0x0;var _0x14333b=_0x0a9a[_0x496522];return _0x14333b;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0a9('0x1')]},'host':{'type':Sequelize[_0xa0a9('0x1')]},'zone':{'type':Sequelize[_0xa0a9('0x1')]},'clientId':{'type':Sequelize[_0xa0a9('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa0a9('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x22fb=['STRING'];(function(_0x5e63a4,_0x373fc7){var _0x47d4d5=function(_0x1c4301){while(--_0x1c4301){_0x5e63a4['push'](_0x5e63a4['shift']());}};_0x47d4d5(++_0x373fc7);}(_0x22fb,0x192));var _0xb22f=function(_0x15061b,_0x2b7e0b){_0x15061b=_0x15061b-0x0;var _0x36e3ae=_0x22fb[_0x15061b];return _0x36e3ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index e7007f6..d885aa4 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 _0xc174=['code','zoho.eu','com','serverUrl','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','Description','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoAccount','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','Descriptions','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','zone','clientId','clientSecret'];(function(_0x76e166,_0x5a9e5a){var _0x4acae3=function(_0x16168d){while(--_0x16168d){_0x76e166['push'](_0x76e166['shift']());}};_0x4acae3(++_0x5a9e5a);}(_0xc174,0x119));var _0x4c17=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0xc174[_0x4a96d2];return _0x38af04;};'use strict';var emlformat=require(_0x4c17('0x0'));var rimraf=require(_0x4c17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c17('0x2'));var rp=require('request-promise');var moment=require(_0x4c17('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4c17('0x4'));var util=require(_0x4c17('0x5'));var path=require('path');var sox=require(_0x4c17('0x6'));var csv=require(_0x4c17('0x7'));var ejs=require(_0x4c17('0x8'));var fs=require('fs');var fs_extra=require(_0x4c17('0x9'));var _=require(_0x4c17('0xa'));var squel=require(_0x4c17('0xb'));var crypto=require(_0x4c17('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4c17('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c17('0xe'));var Redis=require(_0x4c17('0xf'));var authService=require(_0x4c17('0x10'));var qs=require(_0x4c17('0x11'));var as=require(_0x4c17('0x12'));var hardwareService=require(_0x4c17('0x13'));var logger=require(_0x4c17('0x14'))('api');var utils=require(_0x4c17('0x15'));var config=require(_0x4c17('0x16'));var licenseUtil=require(_0x4c17('0x17'));var db=require(_0x4c17('0x18'))['db'];var integrations=require(_0x4c17('0x19'));function respondWithStatusCode(_0x78cab1,_0x3abd4f){_0x3abd4f=_0x3abd4f||0xcc;return function(_0x3bc8c5){if(_0x3bc8c5){return _0x78cab1[_0x4c17('0x1a')](_0x3abd4f);}return _0x78cab1['status'](_0x3abd4f)['end']();};}function respondWithResult(_0x2effd8,_0x14f1a7){_0x14f1a7=_0x14f1a7||0xc8;return function(_0x5f0d50){if(_0x5f0d50){return _0x2effd8['status'](_0x14f1a7)[_0x4c17('0x1b')](_0x5f0d50);}};}function respondWithFilteredResult(_0x93ed9,_0x4d8cc8){return function(_0x5b1fc2){if(_0x5b1fc2){var _0x32d449=typeof _0x4d8cc8[_0x4c17('0x1c')]===_0x4c17('0x1d')&&typeof _0x4d8cc8[_0x4c17('0x1e')]===_0x4c17('0x1d');var _0x49efde=_0x5b1fc2[_0x4c17('0x1f')];var _0x1ed9f0=_0x32d449?0x0:_0x4d8cc8[_0x4c17('0x1c')];var _0x41a9b1=_0x32d449?_0x5b1fc2[_0x4c17('0x1f')]:_0x4d8cc8['offset']+_0x4d8cc8[_0x4c17('0x1e')];var _0x53e177;if(_0x41a9b1>=_0x49efde){_0x41a9b1=_0x49efde;_0x53e177=0xc8;}else{_0x53e177=0xce;}_0x93ed9[_0x4c17('0x20')](_0x53e177);return _0x93ed9[_0x4c17('0x21')]('Content-Range',_0x1ed9f0+'-'+_0x41a9b1+'/'+_0x49efde)['json'](_0x5b1fc2);}return null;};}function patchUpdates(_0x3fdeba){return function(_0x25797f){try{jsonpatch[_0x4c17('0x22')](_0x25797f,_0x3fdeba,!![]);}catch(_0x2b5749){return BPromise[_0x4c17('0x23')](_0x2b5749);}return _0x25797f[_0x4c17('0x24')]();};}function saveUpdates(_0x1c0efd,_0x267453){return function(_0x351b34){if(_0x351b34){return _0x351b34[_0x4c17('0x25')](_0x1c0efd)[_0x4c17('0x26')](function(_0x18964f){return _0x18964f;});}return null;};}function removeEntity(_0x144024,_0x387d4c){return function(_0x1dedf5){if(_0x1dedf5){return _0x1dedf5[_0x4c17('0x27')]()[_0x4c17('0x26')](function(){_0x144024['status'](0xcc)[_0x4c17('0x28')]();});}};}function handleEntityNotFound(_0x4a9d57,_0x4ed9b1){return function(_0x538adc){if(!_0x538adc){_0x4a9d57[_0x4c17('0x1a')](0x194);}return _0x538adc;};}function handleError(_0x5863f8,_0x1b4355){_0x1b4355=_0x1b4355||0x1f4;return function(_0x4535da){logger[_0x4c17('0x29')](_0x4535da[_0x4c17('0x2a')]);if(_0x4535da['name']){delete _0x4535da[_0x4c17('0x2b')];}_0x5863f8[_0x4c17('0x20')](_0x1b4355)[_0x4c17('0x2c')](_0x4535da);};}exports[_0x4c17('0x2d')]=function(_0x5a466c,_0x25742d){var _0x15fafb={},_0x13d18a={},_0x4a8429={'count':0x0,'rows':[]};var _0x302008=_[_0x4c17('0x2e')](db[_0x4c17('0x2f')][_0x4c17('0x30')],function(_0x36d020){return{'name':_0x36d020['fieldName'],'type':_0x36d020['type'][_0x4c17('0x31')]};});_0x13d18a['model']=_[_0x4c17('0x2e')](_0x302008,_0x4c17('0x2b'));_0x13d18a['query']=_[_0x4c17('0x32')](_0x5a466c[_0x4c17('0x33')]);_0x13d18a[_0x4c17('0x34')]=_[_0x4c17('0x35')](_0x13d18a['model'],_0x13d18a[_0x4c17('0x33')]);_0x15fafb[_0x4c17('0x36')]=_[_0x4c17('0x35')](_0x13d18a[_0x4c17('0x37')],qs[_0x4c17('0x38')](_0x5a466c[_0x4c17('0x33')]['fields']));_0x15fafb[_0x4c17('0x36')]=_0x15fafb[_0x4c17('0x36')][_0x4c17('0x39')]?_0x15fafb['attributes']:_0x13d18a[_0x4c17('0x37')];if(!_0x5a466c[_0x4c17('0x33')][_0x4c17('0x3a')](_0x4c17('0x3b'))){_0x15fafb[_0x4c17('0x1e')]=qs[_0x4c17('0x1e')](_0x5a466c[_0x4c17('0x33')][_0x4c17('0x1e')]);_0x15fafb[_0x4c17('0x1c')]=qs[_0x4c17('0x1c')](_0x5a466c[_0x4c17('0x33')][_0x4c17('0x1c')]);}_0x15fafb['order']=qs[_0x4c17('0x3c')](_0x5a466c[_0x4c17('0x33')][_0x4c17('0x3c')]);_0x15fafb['where']=qs[_0x4c17('0x34')](_[_0x4c17('0x3d')](_0x5a466c[_0x4c17('0x33')],_0x13d18a[_0x4c17('0x34')]),_0x302008);if(_0x5a466c[_0x4c17('0x33')][_0x4c17('0x3e')]){_0x15fafb['where']=_[_0x4c17('0x3f')](_0x15fafb[_0x4c17('0x40')],{'$or':_[_0x4c17('0x2e')](_0x302008,function(_0xf6e506){if(_0xf6e506[_0x4c17('0x41')]!==_0x4c17('0x42')){var _0x4372f5={};_0x4372f5[_0xf6e506[_0x4c17('0x2b')]]={'$like':'%'+_0x5a466c[_0x4c17('0x33')][_0x4c17('0x3e')]+'%'};return _0x4372f5;}})});}_0x15fafb=_[_0x4c17('0x3f')]({},_0x15fafb,_0x5a466c[_0x4c17('0x43')]);var _0x26f8c6={'where':_0x15fafb[_0x4c17('0x40')]};return db[_0x4c17('0x2f')][_0x4c17('0x1f')](_0x26f8c6)[_0x4c17('0x26')](function(_0x35e9a4){_0x4a8429[_0x4c17('0x1f')]=_0x35e9a4;if(_0x5a466c['query']['includeAll']){_0x15fafb[_0x4c17('0x44')]=[{'all':!![]}];}return db['ZohoAccount'][_0x4c17('0x45')](_0x15fafb);})['then'](function(_0x106975){_0x4a8429[_0x4c17('0x46')]=_0x106975;return _0x4a8429;})['then'](respondWithFilteredResult(_0x25742d,_0x15fafb))[_0x4c17('0x47')](handleError(_0x25742d,null));};exports[_0x4c17('0x48')]=function(_0x53f393,_0x977d29){var _0x5302d8={'raw':![],'where':{'id':_0x53f393[_0x4c17('0x49')]['id']}},_0x2a7efc={};_0x2a7efc[_0x4c17('0x37')]=_[_0x4c17('0x32')](db[_0x4c17('0x2f')]['rawAttributes']);_0x2a7efc[_0x4c17('0x33')]=_[_0x4c17('0x32')](_0x53f393[_0x4c17('0x33')]);_0x2a7efc[_0x4c17('0x34')]=_[_0x4c17('0x35')](_0x2a7efc[_0x4c17('0x37')],_0x2a7efc[_0x4c17('0x33')]);_0x5302d8['attributes']=_[_0x4c17('0x35')](_0x2a7efc[_0x4c17('0x37')],qs[_0x4c17('0x38')](_0x53f393['query']['fields']));_0x5302d8[_0x4c17('0x36')]=_0x5302d8[_0x4c17('0x36')][_0x4c17('0x39')]?_0x5302d8[_0x4c17('0x36')]:_0x2a7efc[_0x4c17('0x37')];if(_0x53f393[_0x4c17('0x33')][_0x4c17('0x4a')]){_0x5302d8[_0x4c17('0x44')]=[{'all':!![]}];}_0x5302d8=_[_0x4c17('0x3f')]({},_0x5302d8,_0x53f393[_0x4c17('0x43')]);return db[_0x4c17('0x2f')]['find'](_0x5302d8)[_0x4c17('0x26')](handleEntityNotFound(_0x977d29,null))[_0x4c17('0x26')](respondWithResult(_0x977d29,null))['catch'](handleError(_0x977d29,null));};exports[_0x4c17('0x4b')]=function(_0x4ad3c4,_0x2b053e){return db[_0x4c17('0x2f')]['create'](_0x4ad3c4[_0x4c17('0x4c')],{})[_0x4c17('0x26')](respondWithResult(_0x2b053e,0xc9))[_0x4c17('0x47')](handleError(_0x2b053e,null));};exports[_0x4c17('0x25')]=function(_0x4c6077,_0x5e73ca){if(_0x4c6077[_0x4c17('0x4c')]['id']){delete _0x4c6077['body']['id'];}return db[_0x4c17('0x2f')]['find']({'where':{'id':_0x4c6077['params']['id']}})['then'](handleEntityNotFound(_0x5e73ca,null))[_0x4c17('0x26')](saveUpdates(_0x4c6077[_0x4c17('0x4c')],null))[_0x4c17('0x26')](respondWithResult(_0x5e73ca,null))[_0x4c17('0x47')](handleError(_0x5e73ca,null));};exports[_0x4c17('0x27')]=function(_0x3a69a4,_0x1ade01){return db[_0x4c17('0x2f')][_0x4c17('0x4d')]({'where':{'id':_0x3a69a4[_0x4c17('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ade01,null))[_0x4c17('0x26')](removeEntity(_0x1ade01,null))[_0x4c17('0x47')](handleError(_0x1ade01,null));};exports[_0x4c17('0x4e')]=function(_0xda47a0,_0xd3db6b,_0x391e52){var _0x2aff35={};var _0x3e4298={};var _0xa1e0e3;var _0x3db1ca;return db[_0x4c17('0x2f')][_0x4c17('0x4f')]({'where':{'id':_0xda47a0['params']['id']}})['then'](handleEntityNotFound(_0xd3db6b,null))[_0x4c17('0x26')](function(_0x3f253e){if(_0x3f253e){_0xa1e0e3=_0x3f253e;_0x3e4298[_0x4c17('0x37')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x3e4298[_0x4c17('0x33')]=_['keys'](_0xda47a0[_0x4c17('0x33')]);_0x3e4298[_0x4c17('0x34')]=_[_0x4c17('0x35')](_0x3e4298[_0x4c17('0x37')],_0x3e4298[_0x4c17('0x33')]);_0x2aff35['attributes']=_[_0x4c17('0x35')](_0x3e4298[_0x4c17('0x37')],qs[_0x4c17('0x38')](_0xda47a0['query']['fields']));_0x2aff35[_0x4c17('0x36')]=_0x2aff35[_0x4c17('0x36')][_0x4c17('0x39')]?_0x2aff35['attributes']:_0x3e4298[_0x4c17('0x37')];_0x2aff35[_0x4c17('0x50')]=qs['sort'](_0xda47a0[_0x4c17('0x33')][_0x4c17('0x3c')]);_0x2aff35['where']=qs[_0x4c17('0x34')](_[_0x4c17('0x3d')](_0xda47a0[_0x4c17('0x33')],_0x3e4298['filters']));if(_0xda47a0['query'][_0x4c17('0x3e')]){_0x2aff35[_0x4c17('0x40')]=_['merge'](_0x2aff35[_0x4c17('0x40')],{'$or':_[_0x4c17('0x2e')](_0x2aff35[_0x4c17('0x36')],function(_0xd4d979){var _0x245b49={};_0x245b49[_0xd4d979]={'$like':'%'+_0xda47a0['query'][_0x4c17('0x3e')]+'%'};return _0x245b49;})});}_0x2aff35=_[_0x4c17('0x3f')]({},_0x2aff35,_0xda47a0['options']);return _0xa1e0e3[_0x4c17('0x4e')](_0x2aff35);}})[_0x4c17('0x26')](function(_0x347269){if(_0x347269){_0x3db1ca=_0x347269[_0x4c17('0x39')];if(!_0xda47a0[_0x4c17('0x33')][_0x4c17('0x3a')](_0x4c17('0x3b'))){_0x2aff35[_0x4c17('0x1e')]=qs[_0x4c17('0x1e')](_0xda47a0[_0x4c17('0x33')][_0x4c17('0x1e')]);_0x2aff35[_0x4c17('0x1c')]=qs[_0x4c17('0x1c')](_0xda47a0[_0x4c17('0x33')]['offset']);}return _0xa1e0e3[_0x4c17('0x4e')](_0x2aff35);}})[_0x4c17('0x26')](function(_0x50aa74){if(_0x50aa74){return _0x50aa74?{'count':_0x3db1ca,'rows':_0x50aa74}:null;}})[_0x4c17('0x26')](respondWithResult(_0xd3db6b,null))[_0x4c17('0x47')](handleError(_0xd3db6b,null));};exports[_0x4c17('0x51')]=function(_0x21b30f,_0x18bfdd,_0x48832f){if(_0x21b30f[_0x4c17('0x4c')]['id']){delete _0x21b30f[_0x4c17('0x4c')]['id'];}return db['ZohoAccount'][_0x4c17('0x4f')]({'where':{'id':_0x21b30f[_0x4c17('0x49')]['id']}})['then'](handleEntityNotFound(_0x18bfdd,null))[_0x4c17('0x26')](function(_0x1e5f31){if(_0x1e5f31){_0x21b30f[_0x4c17('0x4c')][_0x4c17('0x52')]=_0x1e5f31['id'];_0x21b30f[_0x4c17('0x4c')][_0x4c17('0x53')]=integrations[_0x4c17('0x54')](_0x21b30f[_0x4c17('0x4c')][_0x4c17('0x55')],_0x21b30f[_0x4c17('0x4c')]['type']);_0x21b30f['body']['Descriptions']=integrations[_0x4c17('0x56')](_0x21b30f[_0x4c17('0x4c')][_0x4c17('0x55')],_0x21b30f[_0x4c17('0x4c')][_0x4c17('0x41')]);return db[_0x4c17('0x57')][_0x4c17('0x4b')](_0x21b30f[_0x4c17('0x4c')],{'include':[{'model':db['ZohoField'],'as':_0x4c17('0x53')},{'model':db['ZohoField'],'as':_0x4c17('0x58')}]});}return null;})[_0x4c17('0x26')](respondWithResult(_0x18bfdd,null))[_0x4c17('0x47')](handleError(_0x18bfdd,null));};function getAccessToken(_0x592053){return new Promise(function(_0x265e4e,_0x46a27e){var _0x399a92;switch(_0x592053['zone']){case'US':_0x399a92=_0x4c17('0x59');break;case'AU':_0x399a92='https://accounts.zoho.com.au';break;case'EU':_0x399a92=_0x4c17('0x5a');break;case'IN':_0x399a92=_0x4c17('0x5b');break;case'CN':_0x399a92=_0x4c17('0x5c');break;default:_0x399a92='https://accounts.zoho.eu';break;}var _0x153d61={'method':_0x4c17('0x5d'),'uri':_0x399a92+'/oauth/v2/token','qs':{'refresh_token':_0x592053[_0x4c17('0x5e')],'client_id':_0x592053['clientId'],'client_secret':_0x592053['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x153d61)[_0x4c17('0x26')](function(_0x596486){if(_0x596486[_0x4c17('0x5f')]){_0x265e4e(_0x596486[_0x4c17('0x5f')]);}else{_0x46a27e(_0x4c17('0x60'));}})['catch'](function(_0x2c52c2){_0x46a27e(_0x2c52c2);});});}exports['getFields']=function(_0x2fd01f,_0xafcc9e,_0xd8989d){var _0x48eb03,_0xde884,_0x9c1a3,_0x3493f1,_0x574042;return db[_0x4c17('0x2f')][_0x4c17('0x4f')]({'where':{'id':_0x2fd01f[_0x4c17('0x49')]['id']},'attributes':['id','host',_0x4c17('0x61'),_0x4c17('0x62'),_0x4c17('0x63'),'serverUrl',_0x4c17('0x64'),_0x4c17('0x5e')]})[_0x4c17('0x26')](handleEntityNotFound(_0xafcc9e,null))[_0x4c17('0x26')](function(_0x4b2c78){_0x574042=_0x4b2c78;_0x48eb03=_0x574042['host'];_0xde884=_0x48eb03===_0x4c17('0x65')?'eu':_0x4c17('0x66');_0x9c1a3=_0x574042[_0x4c17('0x67')];var _0x4b9edf=_0x9c1a3['slice'](-0x1);if(_0x4b9edf==='/'||_0x4b9edf==='\x5c'||_0x4b9edf===':'){_0x9c1a3=_0x9c1a3[_0x4c17('0x68')](0x0,_0x9c1a3[_0x4c17('0x69')](_0x4b9edf));}if(!_0x574042[_0x4c17('0x5e')]){throw new Error(_0x4c17('0x6a'));}return getAccessToken(_0x574042);})[_0x4c17('0x26')](function(_0x53042c){if(_0x53042c){return rp({'method':_0x4c17('0x6b'),'uri':util['format'](_0x4c17('0x6c'),_0xde884),'qs':{'module':_0x4c17('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x53042c},'json':!![]});}})['then'](function(_0x449d66){if(_0x449d66){if(_0x449d66[_0x4c17('0x6e')]&&_0x449d66[_0x4c17('0x6e')][_0x4c17('0x29')]){throw new Error(_0x449d66[_0x4c17('0x6e')]['error'][_0x4c17('0x6f')]);}var _0x47da0f=[];var _0x13d185=[];var _0x49c006=[_0x4c17('0x70'),'Subject',_0x4c17('0x71'),'WhoId','Call_Duration','Call_Result','Call_Start_Time',_0x4c17('0x72')];_0x13d185=_[_0x4c17('0x73')](_0x449d66[_0x4c17('0x38')],function(_0x2642a3){return _0x49c006[_0x4c17('0x74')](_0x2642a3[_0x4c17('0x75')]);});for(var _0x489604=0x0;_0x489604<_0x13d185[_0x4c17('0x39')];_0x489604++){if(_0x13d185[_0x489604][_0x4c17('0x76')]===![]){_0x47da0f[_0x4c17('0x77')]({'id':_0x13d185[_0x489604]['id'],'name':_0x13d185[_0x489604][_0x4c17('0x78')],'custom':_0x13d185[_0x489604]['custom_field'],'options':_0x13d185[_0x489604][_0x4c17('0x79')]===_0x4c17('0x7a')&&_0x13d185[_0x489604]['pick_list_values']['length']>-0x1?_[_0x4c17('0x2e')](_0x13d185[_0x489604]['pick_list_values'],function(_0x17b724){return{'name':_0x17b724,'value':_0x17b724};}):[]});}}return{'count':_0x47da0f[_0x4c17('0x39')],'rows':_0x47da0f};}else{return{'count':0x0,'rows':[]};}})[_0x4c17('0x26')](respondWithResult(_0xafcc9e,null))[_0x4c17('0x47')](function(_0x4f0399){var _0x350777=_0x2fd01f[_0x4c17('0x33')]['test']?0x1f4:_0x4f0399['statusCode']||0x1f4;logger[_0x4c17('0x29')](_0x4c17('0x7b'),_0x4c17('0x7c'),_0x350777,JSON['stringify'](_0x4f0399));delete _0x4f0399['name'];if(_0x350777===0x191){_0x350777=0x190;}_0xafcc9e[_0x4c17('0x20')](_0x350777)[_0x4c17('0x2c')](_0x2fd01f['query']['test']?{'message':_0x4c17('0x7d'),'statusCode':_0x4f0399[_0x4c17('0x7e')]}:_0x4f0399);});}; \ No newline at end of file +var _0xae1c=['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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','error','stack','name','index','ZohoAccount','rawAttributes','type','model','map','filters','attributes','intersection','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','rows','catch','show','keys','include','options','create','body','update','find','params','getConfigurations','ZohoConfiguration','nolimit','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','WhoId','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1e6e99,_0xd3bb5f){var _0x6b6ca8=function(_0xa29245){while(--_0xa29245){_0x1e6e99['push'](_0x1e6e99['shift']());}};_0x6b6ca8(++_0xd3bb5f);}(_0xae1c,0x78));var _0xcae1=function(_0x3f96cd,_0x3070a9){_0x3f96cd=_0x3f96cd-0x0;var _0x5bc24a=_0xae1c[_0x3f96cd];return _0x5bc24a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcae1('0x0'));var jsonpatch=require(_0xcae1('0x1'));var rp=require(_0xcae1('0x2'));var moment=require('moment');var BPromise=require(_0xcae1('0x3'));var Mustache=require(_0xcae1('0x4'));var util=require(_0xcae1('0x5'));var path=require(_0xcae1('0x6'));var sox=require('sox');var csv=require(_0xcae1('0x7'));var ejs=require(_0xcae1('0x8'));var fs=require('fs');var fs_extra=require(_0xcae1('0x9'));var _=require(_0xcae1('0xa'));var squel=require(_0xcae1('0xb'));var crypto=require(_0xcae1('0xc'));var jsforce=require(_0xcae1('0xd'));var deskjs=require(_0xcae1('0xe'));var toCsv=require(_0xcae1('0x7'));var querystring=require(_0xcae1('0xf'));var Papa=require(_0xcae1('0x10'));var Redis=require(_0xcae1('0x11'));var authService=require(_0xcae1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcae1('0x13'));var hardwareService=require(_0xcae1('0x14'));var logger=require(_0xcae1('0x15'))(_0xcae1('0x16'));var utils=require(_0xcae1('0x17'));var config=require(_0xcae1('0x18'));var licenseUtil=require(_0xcae1('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xcae1('0x1a'));function respondWithStatusCode(_0x4c2f58,_0x1dddb0){_0x1dddb0=_0x1dddb0||0xcc;return function(_0x507ba3){if(_0x507ba3){return _0x4c2f58[_0xcae1('0x1b')](_0x1dddb0);}return _0x4c2f58[_0xcae1('0x1c')](_0x1dddb0)[_0xcae1('0x1d')]();};}function respondWithResult(_0x1d64a2,_0x3474d1){_0x3474d1=_0x3474d1||0xc8;return function(_0x58a4fd){if(_0x58a4fd){return _0x1d64a2[_0xcae1('0x1c')](_0x3474d1)['json'](_0x58a4fd);}};}function respondWithFilteredResult(_0x45dd74,_0x329e92){return function(_0x3fd2cf){if(_0x3fd2cf){var _0x122f1e=typeof _0x329e92[_0xcae1('0x1e')]===_0xcae1('0x1f')&&typeof _0x329e92['limit']===_0xcae1('0x1f');var _0x1f8172=_0x3fd2cf['count'];var _0x11008c=_0x122f1e?0x0:_0x329e92[_0xcae1('0x1e')];var _0x44f64f=_0x122f1e?_0x3fd2cf[_0xcae1('0x20')]:_0x329e92[_0xcae1('0x1e')]+_0x329e92[_0xcae1('0x21')];var _0x3e4910;if(_0x44f64f>=_0x1f8172){_0x44f64f=_0x1f8172;_0x3e4910=0xc8;}else{_0x3e4910=0xce;}_0x45dd74['status'](_0x3e4910);return _0x45dd74[_0xcae1('0x22')](_0xcae1('0x23'),_0x11008c+'-'+_0x44f64f+'/'+_0x1f8172)[_0xcae1('0x24')](_0x3fd2cf);}return null;};}function patchUpdates(_0x27c11c){return function(_0x90cca5){try{jsonpatch[_0xcae1('0x25')](_0x90cca5,_0x27c11c,!![]);}catch(_0x5d22e7){return BPromise[_0xcae1('0x26')](_0x5d22e7);}return _0x90cca5[_0xcae1('0x27')]();};}function saveUpdates(_0x42a1f7,_0x48b883){return function(_0x35c032){if(_0x35c032){return _0x35c032['update'](_0x42a1f7)['then'](function(_0x523819){return _0x523819;});}return null;};}function removeEntity(_0x1a255a,_0x2793ad){return function(_0x3f946f){if(_0x3f946f){return _0x3f946f[_0xcae1('0x28')]()['then'](function(){_0x1a255a[_0xcae1('0x1c')](0xcc)[_0xcae1('0x1d')]();});}};}function handleEntityNotFound(_0x4b7332,_0x50c1d9){return function(_0x3b598e){if(!_0x3b598e){_0x4b7332['sendStatus'](0x194);}return _0x3b598e;};}function handleError(_0x53c826,_0x11d921){_0x11d921=_0x11d921||0x1f4;return function(_0x226311){logger[_0xcae1('0x29')](_0x226311[_0xcae1('0x2a')]);if(_0x226311[_0xcae1('0x2b')]){delete _0x226311[_0xcae1('0x2b')];}_0x53c826[_0xcae1('0x1c')](_0x11d921)['send'](_0x226311);};}exports[_0xcae1('0x2c')]=function(_0xa578a2,_0x41b5d1){var _0x1846b5={},_0x30db97={},_0x372d37={'count':0x0,'rows':[]};var _0x16d155=_['map'](db[_0xcae1('0x2d')][_0xcae1('0x2e')],function(_0x5c04f3){return{'name':_0x5c04f3['fieldName'],'type':_0x5c04f3[_0xcae1('0x2f')]['key']};});_0x30db97[_0xcae1('0x30')]=_[_0xcae1('0x31')](_0x16d155,_0xcae1('0x2b'));_0x30db97['query']=_['keys'](_0xa578a2['query']);_0x30db97[_0xcae1('0x32')]=_['intersection'](_0x30db97['model'],_0x30db97['query']);_0x1846b5[_0xcae1('0x33')]=_[_0xcae1('0x34')](_0x30db97[_0xcae1('0x30')],qs[_0xcae1('0x35')](_0xa578a2[_0xcae1('0x36')][_0xcae1('0x35')]));_0x1846b5[_0xcae1('0x33')]=_0x1846b5[_0xcae1('0x33')][_0xcae1('0x37')]?_0x1846b5['attributes']:_0x30db97[_0xcae1('0x30')];if(!_0xa578a2[_0xcae1('0x36')][_0xcae1('0x38')]('nolimit')){_0x1846b5['limit']=qs['limit'](_0xa578a2[_0xcae1('0x36')][_0xcae1('0x21')]);_0x1846b5[_0xcae1('0x1e')]=qs[_0xcae1('0x1e')](_0xa578a2['query'][_0xcae1('0x1e')]);}_0x1846b5[_0xcae1('0x39')]=qs[_0xcae1('0x3a')](_0xa578a2[_0xcae1('0x36')][_0xcae1('0x3a')]);_0x1846b5['where']=qs['filters'](_[_0xcae1('0x3b')](_0xa578a2[_0xcae1('0x36')],_0x30db97[_0xcae1('0x32')]),_0x16d155);if(_0xa578a2[_0xcae1('0x36')][_0xcae1('0x3c')]){_0x1846b5[_0xcae1('0x3d')]=_[_0xcae1('0x3e')](_0x1846b5[_0xcae1('0x3d')],{'$or':_[_0xcae1('0x31')](_0x16d155,function(_0x2103c9){if(_0x2103c9[_0xcae1('0x2f')]!==_0xcae1('0x3f')){var _0x39dcb9={};_0x39dcb9[_0x2103c9[_0xcae1('0x2b')]]={'$like':'%'+_0xa578a2[_0xcae1('0x36')][_0xcae1('0x3c')]+'%'};return _0x39dcb9;}})});}_0x1846b5=_[_0xcae1('0x3e')]({},_0x1846b5,_0xa578a2['options']);var _0x26dbcf={'where':_0x1846b5[_0xcae1('0x3d')]};return db[_0xcae1('0x2d')][_0xcae1('0x20')](_0x26dbcf)[_0xcae1('0x40')](function(_0x10951c){_0x372d37['count']=_0x10951c;if(_0xa578a2[_0xcae1('0x36')][_0xcae1('0x41')]){_0x1846b5['include']=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x1846b5);})[_0xcae1('0x40')](function(_0x5826d6){_0x372d37[_0xcae1('0x42')]=_0x5826d6;return _0x372d37;})[_0xcae1('0x40')](respondWithFilteredResult(_0x41b5d1,_0x1846b5))[_0xcae1('0x43')](handleError(_0x41b5d1,null));};exports[_0xcae1('0x44')]=function(_0x1053ca,_0x1480d7){var _0x26dd5e={'raw':![],'where':{'id':_0x1053ca['params']['id']}},_0x4bcda8={};_0x4bcda8['model']=_[_0xcae1('0x45')](db[_0xcae1('0x2d')][_0xcae1('0x2e')]);_0x4bcda8[_0xcae1('0x36')]=_['keys'](_0x1053ca['query']);_0x4bcda8[_0xcae1('0x32')]=_[_0xcae1('0x34')](_0x4bcda8[_0xcae1('0x30')],_0x4bcda8[_0xcae1('0x36')]);_0x26dd5e['attributes']=_[_0xcae1('0x34')](_0x4bcda8[_0xcae1('0x30')],qs['fields'](_0x1053ca[_0xcae1('0x36')]['fields']));_0x26dd5e[_0xcae1('0x33')]=_0x26dd5e[_0xcae1('0x33')][_0xcae1('0x37')]?_0x26dd5e['attributes']:_0x4bcda8[_0xcae1('0x30')];if(_0x1053ca[_0xcae1('0x36')]['includeAll']){_0x26dd5e[_0xcae1('0x46')]=[{'all':!![]}];}_0x26dd5e=_[_0xcae1('0x3e')]({},_0x26dd5e,_0x1053ca[_0xcae1('0x47')]);return db[_0xcae1('0x2d')]['find'](_0x26dd5e)[_0xcae1('0x40')](handleEntityNotFound(_0x1480d7,null))[_0xcae1('0x40')](respondWithResult(_0x1480d7,null))[_0xcae1('0x43')](handleError(_0x1480d7,null));};exports[_0xcae1('0x48')]=function(_0x905a82,_0x2a5aa7){return db['ZohoAccount']['create'](_0x905a82[_0xcae1('0x49')],{})['then'](respondWithResult(_0x2a5aa7,0xc9))[_0xcae1('0x43')](handleError(_0x2a5aa7,null));};exports[_0xcae1('0x4a')]=function(_0x516cd0,_0x3e8e9b){if(_0x516cd0['body']['id']){delete _0x516cd0[_0xcae1('0x49')]['id'];}return db[_0xcae1('0x2d')][_0xcae1('0x4b')]({'where':{'id':_0x516cd0['params']['id']}})['then'](handleEntityNotFound(_0x3e8e9b,null))[_0xcae1('0x40')](saveUpdates(_0x516cd0[_0xcae1('0x49')],null))['then'](respondWithResult(_0x3e8e9b,null))[_0xcae1('0x43')](handleError(_0x3e8e9b,null));};exports['destroy']=function(_0x46d085,_0x54a091){return db[_0xcae1('0x2d')][_0xcae1('0x4b')]({'where':{'id':_0x46d085[_0xcae1('0x4c')]['id']}})[_0xcae1('0x40')](handleEntityNotFound(_0x54a091,null))[_0xcae1('0x40')](removeEntity(_0x54a091,null))['catch'](handleError(_0x54a091,null));};exports[_0xcae1('0x4d')]=function(_0x400f80,_0x1597d9,_0x5788db){var _0x552203={};var _0x2e1ca4={};var _0x3ccc96;var _0x3f51af;return db[_0xcae1('0x2d')]['findOne']({'where':{'id':_0x400f80[_0xcae1('0x4c')]['id']}})[_0xcae1('0x40')](handleEntityNotFound(_0x1597d9,null))['then'](function(_0x62dc43){if(_0x62dc43){_0x3ccc96=_0x62dc43;_0x2e1ca4[_0xcae1('0x30')]=_[_0xcae1('0x45')](db[_0xcae1('0x4e')][_0xcae1('0x2e')]);_0x2e1ca4[_0xcae1('0x36')]=_['keys'](_0x400f80['query']);_0x2e1ca4[_0xcae1('0x32')]=_[_0xcae1('0x34')](_0x2e1ca4[_0xcae1('0x30')],_0x2e1ca4[_0xcae1('0x36')]);_0x552203[_0xcae1('0x33')]=_[_0xcae1('0x34')](_0x2e1ca4[_0xcae1('0x30')],qs['fields'](_0x400f80[_0xcae1('0x36')][_0xcae1('0x35')]));_0x552203[_0xcae1('0x33')]=_0x552203[_0xcae1('0x33')][_0xcae1('0x37')]?_0x552203[_0xcae1('0x33')]:_0x2e1ca4['model'];_0x552203[_0xcae1('0x39')]=qs[_0xcae1('0x3a')](_0x400f80['query'][_0xcae1('0x3a')]);_0x552203[_0xcae1('0x3d')]=qs[_0xcae1('0x32')](_[_0xcae1('0x3b')](_0x400f80[_0xcae1('0x36')],_0x2e1ca4['filters']));if(_0x400f80[_0xcae1('0x36')][_0xcae1('0x3c')]){_0x552203[_0xcae1('0x3d')]=_[_0xcae1('0x3e')](_0x552203[_0xcae1('0x3d')],{'$or':_[_0xcae1('0x31')](_0x552203['attributes'],function(_0xf1209a){var _0x1253dc={};_0x1253dc[_0xf1209a]={'$like':'%'+_0x400f80[_0xcae1('0x36')][_0xcae1('0x3c')]+'%'};return _0x1253dc;})});}_0x552203=_[_0xcae1('0x3e')]({},_0x552203,_0x400f80[_0xcae1('0x47')]);return _0x3ccc96[_0xcae1('0x4d')](_0x552203);}})['then'](function(_0x315a9d){if(_0x315a9d){_0x3f51af=_0x315a9d['length'];if(!_0x400f80[_0xcae1('0x36')][_0xcae1('0x38')](_0xcae1('0x4f'))){_0x552203[_0xcae1('0x21')]=qs[_0xcae1('0x21')](_0x400f80[_0xcae1('0x36')][_0xcae1('0x21')]);_0x552203[_0xcae1('0x1e')]=qs[_0xcae1('0x1e')](_0x400f80['query'][_0xcae1('0x1e')]);}return _0x3ccc96[_0xcae1('0x4d')](_0x552203);}})[_0xcae1('0x40')](function(_0x5115d1){if(_0x5115d1){return _0x5115d1?{'count':_0x3f51af,'rows':_0x5115d1}:null;}})['then'](respondWithResult(_0x1597d9,null))[_0xcae1('0x43')](handleError(_0x1597d9,null));};exports[_0xcae1('0x50')]=function(_0x41ac75,_0xd3743e,_0xe4aaec){if(_0x41ac75[_0xcae1('0x49')]['id']){delete _0x41ac75['body']['id'];}return db[_0xcae1('0x2d')]['findOne']({'where':{'id':_0x41ac75[_0xcae1('0x4c')]['id']}})[_0xcae1('0x40')](handleEntityNotFound(_0xd3743e,null))[_0xcae1('0x40')](function(_0x3954f6){if(_0x3954f6){_0x41ac75[_0xcae1('0x49')][_0xcae1('0x51')]=_0x3954f6['id'];_0x41ac75[_0xcae1('0x49')][_0xcae1('0x52')]=integrations['getSubjects'](_0x41ac75[_0xcae1('0x49')][_0xcae1('0x53')],_0x41ac75[_0xcae1('0x49')]['type']);_0x41ac75[_0xcae1('0x49')]['Descriptions']=integrations[_0xcae1('0x54')](_0x41ac75[_0xcae1('0x49')][_0xcae1('0x53')],_0x41ac75[_0xcae1('0x49')][_0xcae1('0x2f')]);return db[_0xcae1('0x4e')][_0xcae1('0x48')](_0x41ac75[_0xcae1('0x49')],{'include':[{'model':db[_0xcae1('0x55')],'as':_0xcae1('0x52')},{'model':db[_0xcae1('0x55')],'as':_0xcae1('0x56')}]});}return null;})[_0xcae1('0x40')](respondWithResult(_0xd3743e,null))[_0xcae1('0x43')](handleError(_0xd3743e,null));};function getAccessToken(_0x38ba1f){return new Promise(function(_0x4bdcb6,_0x340b14){var _0x4305a5;switch(_0x38ba1f['zone']){case'US':_0x4305a5=_0xcae1('0x57');break;case'AU':_0x4305a5=_0xcae1('0x58');break;case'EU':_0x4305a5=_0xcae1('0x59');break;case'IN':_0x4305a5=_0xcae1('0x5a');break;case'CN':_0x4305a5=_0xcae1('0x5b');break;default:_0x4305a5='https://accounts.zoho.eu';break;}var _0x11f229={'method':_0xcae1('0x5c'),'uri':_0x4305a5+_0xcae1('0x5d'),'qs':{'refresh_token':_0x38ba1f[_0xcae1('0x5e')],'client_id':_0x38ba1f[_0xcae1('0x5f')],'client_secret':_0x38ba1f[_0xcae1('0x60')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x11f229)[_0xcae1('0x40')](function(_0x15f4b5){if(_0x15f4b5[_0xcae1('0x61')]){_0x4bdcb6(_0x15f4b5[_0xcae1('0x61')]);}else{_0x340b14(_0xcae1('0x62'));}})['catch'](function(_0x4c4520){_0x340b14(_0x4c4520);});});}exports[_0xcae1('0x63')]=function(_0x23cbf3,_0x29d4dc,_0x2816f0){var _0x2df958,_0x14b256,_0x48798b,_0x1bfca3,_0x251599;return db['ZohoAccount']['findOne']({'where':{'id':_0x23cbf3[_0xcae1('0x4c')]['id']},'attributes':['id',_0xcae1('0x64'),'zone',_0xcae1('0x5f'),_0xcae1('0x60'),_0xcae1('0x65'),'code',_0xcae1('0x5e')]})['then'](handleEntityNotFound(_0x29d4dc,null))[_0xcae1('0x40')](function(_0x18dcf8){_0x251599=_0x18dcf8;_0x2df958=_0x251599[_0xcae1('0x64')];_0x14b256=_0x2df958===_0xcae1('0x66')?'eu':_0xcae1('0x67');_0x48798b=_0x251599[_0xcae1('0x65')];var _0x37ac4b=_0x48798b[_0xcae1('0x68')](-0x1);if(_0x37ac4b==='/'||_0x37ac4b==='\x5c'||_0x37ac4b===':'){_0x48798b=_0x48798b[_0xcae1('0x69')](0x0,_0x48798b[_0xcae1('0x6a')](_0x37ac4b));}if(!_0x251599[_0xcae1('0x5e')]){throw new Error(_0xcae1('0x6b'));}return getAccessToken(_0x251599);})[_0xcae1('0x40')](function(_0x4f0972){if(_0x4f0972){return rp({'method':_0xcae1('0x6c'),'uri':util['format'](_0xcae1('0x6d'),_0x14b256),'qs':{'module':_0xcae1('0x6e')},'headers':{'Authorization':_0xcae1('0x6f')+_0x4f0972},'json':!![]});}})['then'](function(_0x33aaf3){if(_0x33aaf3){if(_0x33aaf3[_0xcae1('0x70')]&&_0x33aaf3[_0xcae1('0x70')][_0xcae1('0x29')]){throw new Error(_0x33aaf3[_0xcae1('0x70')][_0xcae1('0x29')][_0xcae1('0x71')]);}var _0x448226=[];var _0x48cb69=[];var _0x145004=[_0xcae1('0x72'),_0xcae1('0x73'),'Description',_0xcae1('0x74'),'Call_Duration','Call_Result',_0xcae1('0x75'),'Call_Type'];_0x48cb69=_[_0xcae1('0x76')](_0x33aaf3[_0xcae1('0x35')],function(_0x48d70c){return _0x145004[_0xcae1('0x77')](_0x48d70c[_0xcae1('0x78')]);});for(var _0x5e7766=0x0;_0x5e7766<_0x48cb69[_0xcae1('0x37')];_0x5e7766++){if(_0x48cb69[_0x5e7766][_0xcae1('0x79')]===![]){_0x448226[_0xcae1('0x7a')]({'id':_0x48cb69[_0x5e7766]['id'],'name':_0x48cb69[_0x5e7766][_0xcae1('0x7b')],'custom':_0x48cb69[_0x5e7766][_0xcae1('0x7c')],'options':_0x48cb69[_0x5e7766][_0xcae1('0x7d')]==='picklist'&&_0x48cb69[_0x5e7766][_0xcae1('0x7e')][_0xcae1('0x37')]>-0x1?_[_0xcae1('0x31')](_0x48cb69[_0x5e7766][_0xcae1('0x7e')],function(_0x91c2f5){return{'name':_0x91c2f5,'value':_0x91c2f5};}):[]});}}return{'count':_0x448226[_0xcae1('0x37')],'rows':_0x448226};}else{return{'count':0x0,'rows':[]};}})[_0xcae1('0x40')](respondWithResult(_0x29d4dc,null))[_0xcae1('0x43')](function(_0x588d85){var _0x2c04f7=_0x23cbf3[_0xcae1('0x36')][_0xcae1('0x7f')]?0x1f4:_0x588d85[_0xcae1('0x80')]||0x1f4;logger['error'](_0xcae1('0x81'),_0xcae1('0x63'),_0x2c04f7,JSON[_0xcae1('0x82')](_0x588d85));delete _0x588d85[_0xcae1('0x2b')];if(_0x2c04f7===0x191){_0x2c04f7=0x190;}_0x29d4dc[_0xcae1('0x1c')](_0x2c04f7)[_0xcae1('0x83')](_0x23cbf3[_0xcae1('0x36')][_0xcae1('0x7f')]?{'message':_0xcae1('0x84'),'statusCode':_0x588d85[_0xcae1('0x80')]}:_0x588d85);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f51d953..4296e1b 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 _0x5367=['refreshToken','info','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','https://accounts.zoho.com.cn','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token'];(function(_0x151e0e,_0x126c83){var _0x1fd348=function(_0x117865){while(--_0x117865){_0x151e0e['push'](_0x151e0e['shift']());}};_0x1fd348(++_0x126c83);}(_0x5367,0x19f));var _0x7536=function(_0x10b6b0,_0x2d26ad){_0x10b6b0=_0x10b6b0-0x0;var _0xb1ff29=_0x5367[_0x10b6b0];return _0xb1ff29;};'use strict';var _=require(_0x7536('0x0'));var util=require(_0x7536('0x1'));var logger=require(_0x7536('0x2'))(_0x7536('0x3'));var moment=require(_0x7536('0x4'));var BPromise=require(_0x7536('0x5'));var rp=require(_0x7536('0x6'));var fs=require('fs');var path=require(_0x7536('0x7'));var rimraf=require(_0x7536('0x8'));var config=require('../../config/environment');var attributes=require(_0x7536('0x9'));var integrations=require(_0x7536('0xa'));module[_0x7536('0xb')]=function(_0x47fd03,_0x56e2ec){return _0x47fd03[_0x7536('0xc')](_0x7536('0xd'),attributes,{'tableName':_0x7536('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3fd4b5,_0x34513f,_0x36cbd5){if(_0x3fd4b5[_0x7536('0xf')]('zone')||_0x3fd4b5['changed'](_0x7536('0x10'))||_0x3fd4b5[_0x7536('0xf')](_0x7536('0x11'))||_0x3fd4b5['changed'](_0x7536('0x12'))||_0x3fd4b5[_0x7536('0xf')]('code')||_0x3fd4b5['changed'](_0x7536('0x13'))){var _0xd3bfed,_0x25b696;_0xd3bfed=_0x3fd4b5[_0x7536('0x10')];var _0x2ad146=_0xd3bfed[_0x7536('0x14')](-0x1);if(_0x2ad146==='/'||_0x2ad146==='\x5c'||_0x2ad146===':'){_0xd3bfed=_0xd3bfed[_0x7536('0x15')](0x0,_0xd3bfed[_0x7536('0x16')](_0x2ad146));}switch(_0x3fd4b5[_0x7536('0x17')]){case'US':_0x25b696=_0x7536('0x18');break;case'AU':_0x25b696=_0x7536('0x19');break;case'IN':_0x25b696=_0x7536('0x1a');break;case'CN':_0x25b696='https://accounts.zoho.com.cn';break;default:_0x25b696=_0x7536('0x1b');break;}var _0x4bca2c={'method':'POST','uri':_0x25b696+_0x7536('0x1c'),'form':{'grant_type':_0x7536('0x1d'),'client_id':_0x3fd4b5[_0x7536('0x11')],'client_secret':_0x3fd4b5[_0x7536('0x12')],'redirect_uri':_0x3fd4b5[_0x7536('0x10')],'code':_0x3fd4b5[_0x7536('0x1e')]},'headers':{'Content-Type':_0x7536('0x1f')}};return rp(_0x4bca2c)[_0x7536('0x20')](function(_0xbe8e8c){var _0x2defee=JSON[_0x7536('0x21')](_0xbe8e8c);if(_0x2defee[_0x7536('0x22')]){_0x3fd4b5[_0x7536('0x23')]=_0x2defee['refresh_token'];logger[_0x7536('0x24')](util[_0x7536('0x25')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x3fd4b5[_0x7536('0x26')],_0x3fd4b5['id']));}else{logger['error'](util['format'](_0x7536('0x27'),_0x3fd4b5[_0x7536('0x26')],_0x3fd4b5['id']),util[_0x7536('0x28')](_0x2defee,{'showHidden':![],'depth':null}));}return _0x36cbd5(null,_0x34513f);})[_0x7536('0x29')](function(_0x37b718){logger[_0x7536('0x2a')](util[_0x7536('0x25')](_0x7536('0x27'),_0x3fd4b5[_0x7536('0x26')],_0x3fd4b5['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x36cbd5(_0x37b718);});}else{return _0x36cbd5(null,_0x34513f);}},'beforeUpdate':function(_0x2abf14,_0x41d768,_0x1e38b9){if(_0x2abf14[_0x7536('0xf')](_0x7536('0x17'))||_0x2abf14[_0x7536('0xf')](_0x7536('0x10'))||_0x2abf14[_0x7536('0xf')](_0x7536('0x11'))||_0x2abf14[_0x7536('0xf')]('clientSecret')||_0x2abf14[_0x7536('0xf')](_0x7536('0x1e'))||_0x2abf14[_0x7536('0xf')](_0x7536('0x13'))){var _0x12102a,_0x5b21f7;_0x12102a=_0x2abf14[_0x7536('0x10')];var _0x450fc5=_0x12102a[_0x7536('0x14')](-0x1);if(_0x450fc5==='/'||_0x450fc5==='\x5c'||_0x450fc5===':'){_0x12102a=_0x12102a[_0x7536('0x15')](0x0,_0x12102a[_0x7536('0x16')](_0x450fc5));}switch(_0x2abf14[_0x7536('0x17')]){case'US':_0x5b21f7=_0x7536('0x18');break;case'AU':_0x5b21f7=_0x7536('0x19');break;case'IN':_0x5b21f7='https://accounts.zoho.in';break;case'CN':_0x5b21f7=_0x7536('0x2b');break;default:_0x5b21f7=_0x7536('0x1b');break;}var _0x4620f8={'method':'POST','uri':_0x5b21f7+_0x7536('0x1c'),'form':{'grant_type':_0x7536('0x1d'),'client_id':_0x2abf14[_0x7536('0x11')],'client_secret':_0x2abf14[_0x7536('0x12')],'redirect_uri':_0x2abf14[_0x7536('0x10')],'code':_0x2abf14['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4620f8)[_0x7536('0x20')](function(_0x51a479){var _0x3527cf=JSON[_0x7536('0x21')](_0x51a479);if(_0x3527cf[_0x7536('0x22')]){_0x2abf14[_0x7536('0x23')]=_0x3527cf[_0x7536('0x22')];logger[_0x7536('0x24')](util[_0x7536('0x25')](_0x7536('0x2c'),_0x2abf14['name'],_0x2abf14['id']));}else{logger[_0x7536('0x2a')](util['format'](_0x7536('0x27'),_0x2abf14[_0x7536('0x26')],_0x2abf14['id']),util['inspect'](_0x3527cf,{'showHidden':![],'depth':null}));}return _0x1e38b9(null,_0x41d768);})['catch'](function(_0x33a223){logger[_0x7536('0x2a')](util['format'](_0x7536('0x27'),_0x2abf14[_0x7536('0x26')],_0x2abf14['id']),util[_0x7536('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e38b9(_0x33a223);});}else{return _0x1e38b9(null,_0x41d768);}}}});}; \ No newline at end of file +var _0x9f64=['ZohoAccount','zone','serverUrl','clientId','clientSecret','code','changed','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','catch','inspect','POST','authorization_code','parse','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','bluebird','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x9f64,0xc4));var _0x49f6=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x9f64[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x49f6('0x0'));var util=require(_0x49f6('0x1'));var logger=require(_0x49f6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x49f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49f6('0x4'));var rimraf=require(_0x49f6('0x5'));var config=require('../../config/environment');var attributes=require(_0x49f6('0x6'));var integrations=require(_0x49f6('0x7'));module[_0x49f6('0x8')]=function(_0x26d173,_0x58bb45){return _0x26d173['define'](_0x49f6('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x11cb51,_0x8f5c,_0x263d99){if(_0x11cb51['changed'](_0x49f6('0xa'))||_0x11cb51['changed'](_0x49f6('0xb'))||_0x11cb51['changed'](_0x49f6('0xc'))||_0x11cb51['changed'](_0x49f6('0xd'))||_0x11cb51['changed'](_0x49f6('0xe'))||_0x11cb51[_0x49f6('0xf')](_0x49f6('0x10'))){var _0x586ffd,_0x1d75d6;_0x586ffd=_0x11cb51[_0x49f6('0xb')];var _0x362269=_0x586ffd[_0x49f6('0x11')](-0x1);if(_0x362269==='/'||_0x362269==='\x5c'||_0x362269===':'){_0x586ffd=_0x586ffd[_0x49f6('0x12')](0x0,_0x586ffd[_0x49f6('0x13')](_0x362269));}switch(_0x11cb51[_0x49f6('0xa')]){case'US':_0x1d75d6=_0x49f6('0x14');break;case'AU':_0x1d75d6=_0x49f6('0x15');break;case'IN':_0x1d75d6=_0x49f6('0x16');break;case'CN':_0x1d75d6=_0x49f6('0x17');break;default:_0x1d75d6=_0x49f6('0x18');break;}var _0x5e4405={'method':'POST','uri':_0x1d75d6+_0x49f6('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x11cb51[_0x49f6('0xc')],'client_secret':_0x11cb51['clientSecret'],'redirect_uri':_0x11cb51[_0x49f6('0xb')],'code':_0x11cb51[_0x49f6('0xe')]},'headers':{'Content-Type':_0x49f6('0x1a')}};return rp(_0x5e4405)[_0x49f6('0x1b')](function(_0x8cc47d){var _0x206e44=JSON['parse'](_0x8cc47d);if(_0x206e44[_0x49f6('0x1c')]){_0x11cb51[_0x49f6('0x1d')]=_0x206e44[_0x49f6('0x1c')];logger[_0x49f6('0x1e')](util[_0x49f6('0x1f')](_0x49f6('0x20'),_0x11cb51[_0x49f6('0x21')],_0x11cb51['id']));}else{logger[_0x49f6('0x22')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x11cb51['name'],_0x11cb51['id']),util['inspect'](_0x206e44,{'showHidden':![],'depth':null}));}return _0x263d99(null,_0x8f5c);})[_0x49f6('0x23')](function(_0x35d17f){logger[_0x49f6('0x22')](util[_0x49f6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x11cb51[_0x49f6('0x21')],_0x11cb51['id']),util[_0x49f6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x263d99(_0x35d17f);});}else{return _0x263d99(null,_0x8f5c);}},'beforeUpdate':function(_0x248ce4,_0x400b76,_0x1cce82){if(_0x248ce4[_0x49f6('0xf')]('zone')||_0x248ce4['changed'](_0x49f6('0xb'))||_0x248ce4[_0x49f6('0xf')](_0x49f6('0xc'))||_0x248ce4[_0x49f6('0xf')](_0x49f6('0xd'))||_0x248ce4[_0x49f6('0xf')](_0x49f6('0xe'))||_0x248ce4[_0x49f6('0xf')](_0x49f6('0x10'))){var _0x966fab,_0x304282;_0x966fab=_0x248ce4['serverUrl'];var _0x5ea99e=_0x966fab[_0x49f6('0x11')](-0x1);if(_0x5ea99e==='/'||_0x5ea99e==='\x5c'||_0x5ea99e===':'){_0x966fab=_0x966fab[_0x49f6('0x12')](0x0,_0x966fab[_0x49f6('0x13')](_0x5ea99e));}switch(_0x248ce4[_0x49f6('0xa')]){case'US':_0x304282=_0x49f6('0x14');break;case'AU':_0x304282='https://accounts.zoho.com.au';break;case'IN':_0x304282=_0x49f6('0x16');break;case'CN':_0x304282=_0x49f6('0x17');break;default:_0x304282=_0x49f6('0x18');break;}var _0x184d12={'method':_0x49f6('0x25'),'uri':_0x304282+_0x49f6('0x19'),'form':{'grant_type':_0x49f6('0x26'),'client_id':_0x248ce4[_0x49f6('0xc')],'client_secret':_0x248ce4[_0x49f6('0xd')],'redirect_uri':_0x248ce4[_0x49f6('0xb')],'code':_0x248ce4[_0x49f6('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x184d12)[_0x49f6('0x1b')](function(_0xc98fb6){var _0xacb02=JSON[_0x49f6('0x27')](_0xc98fb6);if(_0xacb02[_0x49f6('0x1c')]){_0x248ce4[_0x49f6('0x1d')]=_0xacb02[_0x49f6('0x1c')];logger[_0x49f6('0x1e')](util[_0x49f6('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x248ce4['name'],_0x248ce4['id']));}else{logger[_0x49f6('0x22')](util[_0x49f6('0x1f')](_0x49f6('0x28'),_0x248ce4['name'],_0x248ce4['id']),util['inspect'](_0xacb02,{'showHidden':![],'depth':null}));}return _0x1cce82(null,_0x400b76);})[_0x49f6('0x23')](function(_0x2a7280){logger['error'](util[_0x49f6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x248ce4[_0x49f6('0x21')],_0x248ce4['id']),util[_0x49f6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1cce82(_0x2a7280);});}else{return _0x1cce82(null,_0x400b76);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 51ba1b3..2a3c7f7 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 _0xe34f=['ShowZohoAccount','stringify','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','message','result','ZohoAccount','findAll','options','raw','where','attributes','include','map','model','GetZohoAccount','debug','catch'];(function(_0x1aaa7c,_0x42a685){var _0x5b4c63=function(_0x4aaeb2){while(--_0x4aaeb2){_0x1aaa7c['push'](_0x1aaa7c['shift']());}};_0x5b4c63(++_0x42a685);}(_0xe34f,0xbc));var _0xfe34=function(_0x26d882,_0x3591d3){_0x26d882=_0x26d882-0x0;var _0x3eb499=_0xe34f[_0x26d882];return _0x3eb499;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfe34('0x0'));var fs=require('fs');var Redis=require(_0xfe34('0x1'));var db=require(_0xfe34('0x2'))['db'];var utils=require(_0xfe34('0x3'));var logger=require(_0xfe34('0x4'))(_0xfe34('0x5'));var config=require(_0xfe34('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x195bcd,_0x3fe816,_0x25f17a){return new BPromise(function(_0x4fa1cd,_0x5cdc7e){return client[_0xfe34('0x9')](_0x195bcd,_0x25f17a)[_0xfe34('0xa')](function(_0x252ec7){logger[_0xfe34('0xb')](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x3fe816,'request\x20sent',JSON['stringify'](_0x252ec7));if(_0x252ec7[_0xfe34('0xe')]){if(_0x252ec7[_0xfe34('0xe')]['code']===0x1f4){logger[_0xfe34('0xe')](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x5cdc7e(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}logger['error'](_0xfe34('0xc'),_0x3fe816,_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);return _0x4fa1cd(_0x252ec7[_0xfe34('0xe')][_0xfe34('0xf')]);}else{logger['info'](_0xfe34('0xc'),_0x3fe816,_0xfe34('0xd'));_0x4fa1cd(_0x252ec7[_0xfe34('0x10')][_0xfe34('0xf')]);}})['catch'](function(_0x53b469){logger['error'](_0xfe34('0xc'),_0x3fe816,_0x53b469);_0x5cdc7e(_0x53b469);});});}exports['GetZohoAccount']=function(_0x5c95f5){var _0x495b48=this;return new Promise(function(_0x3f7f60,_0x19f7e3){return db[_0xfe34('0x11')][_0xfe34('0x12')]({'raw':_0x5c95f5['options']?_0x5c95f5[_0xfe34('0x13')][_0xfe34('0x14')]===undefined?!![]:![]:!![],'where':_0x5c95f5[_0xfe34('0x13')]?_0x5c95f5[_0xfe34('0x13')][_0xfe34('0x15')]||null:null,'attributes':_0x5c95f5[_0xfe34('0x13')]?_0x5c95f5['options'][_0xfe34('0x16')]||null:null,'limit':_0x5c95f5[_0xfe34('0x13')]?_0x5c95f5[_0xfe34('0x13')]['limit']||null:null,'include':_0x5c95f5[_0xfe34('0x13')]?_0x5c95f5[_0xfe34('0x13')][_0xfe34('0x17')]?_[_0xfe34('0x18')](_0x5c95f5[_0xfe34('0x13')][_0xfe34('0x17')],function(_0x249ffc){return{'model':db[_0x249ffc[_0xfe34('0x19')]],'as':_0x249ffc['as'],'attributes':_0x249ffc[_0xfe34('0x16')],'include':_0x249ffc[_0xfe34('0x17')]?_['map'](_0x249ffc[_0xfe34('0x17')],function(_0x257c3c){return{'model':db[_0x257c3c['model']],'as':_0x257c3c['as'],'attributes':_0x257c3c[_0xfe34('0x16')],'include':_0x257c3c['include']?_['map'](_0x257c3c[_0xfe34('0x17')],function(_0x5221dc){return{'model':db[_0x5221dc['model']],'as':_0x5221dc['as'],'attributes':_0x5221dc[_0xfe34('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfe34('0xa')](function(_0x48a886){logger[_0xfe34('0xb')](_0xfe34('0x1a'),_0x5c95f5);logger[_0xfe34('0x1b')](_0xfe34('0x1a'),_0x5c95f5,JSON['stringify'](_0x48a886));_0x3f7f60(_0x48a886);})[_0xfe34('0x1c')](function(_0x59e06b){logger[_0xfe34('0xe')](_0xfe34('0x1a'),_0x59e06b[_0xfe34('0xf')],_0x5c95f5);_0x19f7e3(_0x495b48[_0xfe34('0xe')](0x1f4,_0x59e06b[_0xfe34('0xf')]));});});};exports[_0xfe34('0x1d')]=function(_0x44adf0){var _0x4b9b50=this;return new Promise(function(_0x345c00,_0x1a3cec){return db[_0xfe34('0x11')]['find']({'raw':_0x44adf0[_0xfe34('0x13')]?_0x44adf0[_0xfe34('0x13')][_0xfe34('0x14')]===undefined?!![]:![]:!![],'where':_0x44adf0[_0xfe34('0x13')]?_0x44adf0['options'][_0xfe34('0x15')]||null:null,'attributes':_0x44adf0[_0xfe34('0x13')]?_0x44adf0['options'][_0xfe34('0x16')]||null:null,'include':_0x44adf0[_0xfe34('0x13')]?_0x44adf0[_0xfe34('0x13')][_0xfe34('0x17')]?_[_0xfe34('0x18')](_0x44adf0['options']['include'],function(_0xa0a65a){return{'model':db[_0xa0a65a['model']],'as':_0xa0a65a['as'],'attributes':_0xa0a65a[_0xfe34('0x16')],'include':_0xa0a65a[_0xfe34('0x17')]?_[_0xfe34('0x18')](_0xa0a65a[_0xfe34('0x17')],function(_0x1c40c9){return{'model':db[_0x1c40c9[_0xfe34('0x19')]],'as':_0x1c40c9['as'],'attributes':_0x1c40c9['attributes'],'include':_0x1c40c9[_0xfe34('0x17')]?_[_0xfe34('0x18')](_0x1c40c9[_0xfe34('0x17')],function(_0x460911){return{'model':db[_0x460911[_0xfe34('0x19')]],'as':_0x460911['as'],'attributes':_0x460911[_0xfe34('0x16')]};}):[]};}):[]};}):[]:[]})[_0xfe34('0xa')](function(_0x3510a0){logger[_0xfe34('0xb')](_0xfe34('0x1d'),_0x44adf0);logger[_0xfe34('0x1b')](_0xfe34('0x1d'),_0x44adf0,JSON[_0xfe34('0x1e')](_0x3510a0));_0x345c00(_0x3510a0);})[_0xfe34('0x1c')](function(_0x1589f9){logger[_0xfe34('0xe')](_0xfe34('0x1d'),_0x1589f9[_0xfe34('0xf')],_0x44adf0);_0x1a3cec(_0x4b9b50[_0xfe34('0xe')](0x1f4,_0x1589f9['message']));});});}; \ No newline at end of file +var _0x32f4=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','model','map','find','ShowZohoAccount'];(function(_0xe71cf6,_0x120a90){var _0x1ffd42=function(_0x5b1ab5){while(--_0x5b1ab5){_0xe71cf6['push'](_0xe71cf6['shift']());}};_0x1ffd42(++_0x120a90);}(_0x32f4,0x154));var _0x432f=function(_0x3d427f,_0x3e2175){_0x3d427f=_0x3d427f-0x0;var _0x20a6e4=_0x32f4[_0x3d427f];return _0x20a6e4;};'use strict';var _=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var moment=require(_0x432f('0x2'));var BPromise=require(_0x432f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x432f('0x4'));var db=require(_0x432f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x432f('0x6'))(_0x432f('0x7'));var config=require(_0x432f('0x8'));var jayson=require(_0x432f('0x9'));var client=jayson[_0x432f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b5f08,_0x2f66fd,_0x32b062){return new BPromise(function(_0x4a5b56,_0x2a2ef6){return client['request'](_0x5b5f08,_0x32b062)[_0x432f('0xb')](function(_0x340fe9){logger[_0x432f('0xc')](_0x432f('0xd'),_0x2f66fd,_0x432f('0xe'));logger['debug'](_0x432f('0xf'),_0x2f66fd,'request\x20sent',JSON[_0x432f('0x10')](_0x340fe9));if(_0x340fe9['error']){if(_0x340fe9[_0x432f('0x11')][_0x432f('0x12')]===0x1f4){logger['error'](_0x432f('0xd'),_0x2f66fd,_0x340fe9[_0x432f('0x11')]['message']);return _0x2a2ef6(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2f66fd,_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);return _0x4a5b56(_0x340fe9[_0x432f('0x11')][_0x432f('0x13')]);}else{logger[_0x432f('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x2f66fd,_0x432f('0xe'));_0x4a5b56(_0x340fe9[_0x432f('0x14')][_0x432f('0x13')]);}})[_0x432f('0x15')](function(_0x5bae29){logger[_0x432f('0x11')](_0x432f('0xd'),_0x2f66fd,_0x5bae29);_0x2a2ef6(_0x5bae29);});});}exports[_0x432f('0x16')]=function(_0x243cf){var _0x3cd5da=this;return new Promise(function(_0x129582,_0x5ae24e){return db[_0x432f('0x17')]['findAll']({'raw':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1a')]||null:null,'attributes':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'limit':_0x243cf[_0x432f('0x18')]?_0x243cf[_0x432f('0x18')][_0x432f('0x1c')]||null:null,'include':_0x243cf['options']?_0x243cf['options'][_0x432f('0x1d')]?_['map'](_0x243cf[_0x432f('0x18')]['include'],function(_0x37f136){return{'model':db[_0x37f136[_0x432f('0x1e')]],'as':_0x37f136['as'],'attributes':_0x37f136[_0x432f('0x1b')],'include':_0x37f136[_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x37f136[_0x432f('0x1d')],function(_0x59f352){return{'model':db[_0x59f352[_0x432f('0x1e')]],'as':_0x59f352['as'],'attributes':_0x59f352[_0x432f('0x1b')],'include':_0x59f352['include']?_[_0x432f('0x1f')](_0x59f352[_0x432f('0x1d')],function(_0x2bcbb4){return{'model':db[_0x2bcbb4[_0x432f('0x1e')]],'as':_0x2bcbb4['as'],'attributes':_0x2bcbb4[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x138a6a){logger['info'](_0x432f('0x16'),_0x243cf);logger['debug'](_0x432f('0x16'),_0x243cf,JSON['stringify'](_0x138a6a));_0x129582(_0x138a6a);})[_0x432f('0x15')](function(_0x5a2c14){logger[_0x432f('0x11')]('GetZohoAccount',_0x5a2c14[_0x432f('0x13')],_0x243cf);_0x5ae24e(_0x3cd5da[_0x432f('0x11')](0x1f4,_0x5a2c14[_0x432f('0x13')]));});});};exports['ShowZohoAccount']=function(_0x6a116e){var _0x24406a=this;return new Promise(function(_0x48139b,_0x5ee0fa){return db[_0x432f('0x17')][_0x432f('0x20')]({'raw':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x19')]===undefined?!![]:![]:!![],'where':_0x6a116e[_0x432f('0x18')]?_0x6a116e['options']['where']||null:null,'attributes':_0x6a116e[_0x432f('0x18')]?_0x6a116e[_0x432f('0x18')][_0x432f('0x1b')]||null:null,'include':_0x6a116e['options']?_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')]?_[_0x432f('0x1f')](_0x6a116e[_0x432f('0x18')][_0x432f('0x1d')],function(_0x3ad632){return{'model':db[_0x3ad632[_0x432f('0x1e')]],'as':_0x3ad632['as'],'attributes':_0x3ad632[_0x432f('0x1b')],'include':_0x3ad632['include']?_['map'](_0x3ad632[_0x432f('0x1d')],function(_0xa5e0d){return{'model':db[_0xa5e0d['model']],'as':_0xa5e0d['as'],'attributes':_0xa5e0d['attributes'],'include':_0xa5e0d['include']?_[_0x432f('0x1f')](_0xa5e0d[_0x432f('0x1d')],function(_0x5648a7){return{'model':db[_0x5648a7[_0x432f('0x1e')]],'as':_0x5648a7['as'],'attributes':_0x5648a7[_0x432f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x432f('0xb')](function(_0x5903f6){logger[_0x432f('0xc')](_0x432f('0x21'),_0x6a116e);logger['debug'](_0x432f('0x21'),_0x6a116e,JSON[_0x432f('0x10')](_0x5903f6));_0x48139b(_0x5903f6);})['catch'](function(_0x28da2e){logger[_0x432f('0x11')](_0x432f('0x21'),_0x28da2e[_0x432f('0x13')],_0x6a116e);_0x5ee0fa(_0x24406a[_0x432f('0x11')](0x1f4,_0x28da2e[_0x432f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index feee8bd..689bcf7 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 _0xf602=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x558038,_0x22bab6){var _0xaf1437=function(_0x1b0617){while(--_0x1b0617){_0x558038['push'](_0x558038['shift']());}};_0xaf1437(++_0x22bab6);}(_0xf602,0x105));var _0x2f60=function(_0x169fbf,_0x38a0ce){_0x169fbf=_0x169fbf-0x0;var _0x3bbc39=_0xf602[_0x169fbf];return _0x3bbc39;};'use strict';var multer=require(_0x2f60('0x0'));var util=require(_0x2f60('0x1'));var path=require(_0x2f60('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f60('0x3'));var router=express[_0x2f60('0x4')]();var fs_extra=require(_0x2f60('0x5'));var auth=require(_0x2f60('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2f60('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x2f60('0x8')]('/',auth[_0x2f60('0x9')](),controller[_0x2f60('0xa')]);router[_0x2f60('0x8')]('/:id',auth[_0x2f60('0x9')](),controller[_0x2f60('0xb')]);router[_0x2f60('0x8')](_0x2f60('0xc'),auth[_0x2f60('0x9')](),controller[_0x2f60('0xd')]);router[_0x2f60('0x8')](_0x2f60('0xe'),auth[_0x2f60('0x9')](),controller[_0x2f60('0xf')]);router[_0x2f60('0x8')](_0x2f60('0x10'),auth[_0x2f60('0x9')](),controller[_0x2f60('0x11')]);router[_0x2f60('0x12')]('/',auth[_0x2f60('0x9')](),controller['create']);router[_0x2f60('0x13')](_0x2f60('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x2f60('0x15')](_0x2f60('0x14'),auth['isAuthenticated'](),controller[_0x2f60('0x16')]);module[_0x2f60('0x17')]=router; \ No newline at end of file +var _0x4be1=['getFields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','index','/:id/fields'];(function(_0x22f9b9,_0x2a627d){var _0x293501=function(_0x2e1080){while(--_0x2e1080){_0x22f9b9['push'](_0x22f9b9['shift']());}};_0x293501(++_0x2a627d);}(_0x4be1,0xcb));var _0x14be=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0x4be1[_0x3c6ae2];return _0x4edda;};'use strict';var multer=require(_0x14be('0x0'));var util=require(_0x14be('0x1'));var path=require(_0x14be('0x2'));var timeout=require(_0x14be('0x3'));var express=require(_0x14be('0x4'));var router=express['Router']();var fs_extra=require(_0x14be('0x5'));var auth=require(_0x14be('0x6'));var interaction=require(_0x14be('0x7'));var config=require(_0x14be('0x8'));var controller=require(_0x14be('0x9'));router['get']('/',auth[_0x14be('0xa')](),controller[_0x14be('0xb')]);router['get']('/:id',auth[_0x14be('0xa')](),controller['show']);router['get'](_0x14be('0xc'),auth[_0x14be('0xa')](),controller[_0x14be('0xd')]);router[_0x14be('0xe')](_0x14be('0xf'),auth[_0x14be('0xa')](),controller[_0x14be('0x10')]);router[_0x14be('0xe')](_0x14be('0x11'),auth[_0x14be('0xa')](),controller[_0x14be('0x12')]);router['post']('/',auth[_0x14be('0xa')](),controller[_0x14be('0x13')]);router[_0x14be('0x14')]('/:id',auth[_0x14be('0xa')](),controller['update']);router[_0x14be('0x15')]('/:id',auth[_0x14be('0xa')](),controller[_0x14be('0x16')]);module[_0x14be('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 55b9ae7..528839b 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 _0xd756=['contact','contact_lead','sequelize','STRING','ENUM','lead','nothing'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd756,0xa3));var _0x6d75=function(_0x1c17ca,_0x2bd89d){_0x1c17ca=_0x1c17ca-0x0;var _0x3a74d4=_0xd756[_0x1c17ca];return _0x3a74d4;};'use strict';var Sequelize=require(_0x6d75('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d75('0x1')]},'moduleCreate':{'type':Sequelize[_0x6d75('0x2')](_0x6d75('0x3'),'contact',_0x6d75('0x4')),'defaultValue':_0x6d75('0x3')},'moduleSearch':{'type':Sequelize[_0x6d75('0x2')]('contact_lead',_0x6d75('0x5'),'lead'),'defaultValue':_0x6d75('0x6')},'description':{'type':Sequelize[_0x6d75('0x1')]}}; \ No newline at end of file +var _0x2e3b=['lead','contact','nothing','exports','STRING','ENUM'];(function(_0x335e7f,_0x4808d8){var _0x5223db=function(_0x5ec1c9){while(--_0x5ec1c9){_0x335e7f['push'](_0x335e7f['shift']());}};_0x5223db(++_0x4808d8);}(_0x2e3b,0x81));var _0xb2e3=function(_0x296387,_0x1e5160){_0x296387=_0x296387-0x0;var _0x28afcf=_0x2e3b[_0x296387];return _0x28afcf;};'use strict';var Sequelize=require('sequelize');module[_0xb2e3('0x0')]={'name':{'type':Sequelize[_0xb2e3('0x1')]},'moduleCreate':{'type':Sequelize[_0xb2e3('0x2')](_0xb2e3('0x3'),_0xb2e3('0x4'),_0xb2e3('0x5')),'defaultValue':_0xb2e3('0x3')},'moduleSearch':{'type':Sequelize[_0xb2e3('0x2')]('contact_lead',_0xb2e3('0x4'),_0xb2e3('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xb2e3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 0aac445..0b6879d 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 _0x81c1=['status','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','body','getFields','ZohoField','findOne','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x4bf591,_0x48b450){var _0x18f0df=function(_0x4754ea){while(--_0x4754ea){_0x4bf591['push'](_0x4bf591['shift']());}};_0x18f0df(++_0x48b450);}(_0x81c1,0x178));var _0x181c=function(_0x5324b7,_0x3e81ac){_0x5324b7=_0x5324b7-0x0;var _0x47cadf=_0x81c1[_0x5324b7];return _0x47cadf;};'use strict';var emlformat=require(_0x181c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x181c('0x1'));var jsonpatch=require(_0x181c('0x2'));var rp=require(_0x181c('0x3'));var moment=require(_0x181c('0x4'));var BPromise=require(_0x181c('0x5'));var Mustache=require(_0x181c('0x6'));var util=require(_0x181c('0x7'));var path=require(_0x181c('0x8'));var sox=require(_0x181c('0x9'));var csv=require('to-csv');var ejs=require(_0x181c('0xa'));var fs=require('fs');var fs_extra=require(_0x181c('0xb'));var _=require(_0x181c('0xc'));var squel=require(_0x181c('0xd'));var crypto=require(_0x181c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x181c('0xf'));var toCsv=require(_0x181c('0x10'));var querystring=require(_0x181c('0x11'));var Papa=require(_0x181c('0x12'));var Redis=require(_0x181c('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x181c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x181c('0x15'));var logger=require('../../config/logger')(_0x181c('0x16'));var utils=require(_0x181c('0x17'));var config=require(_0x181c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x181c('0x19'))['db'];function respondWithStatusCode(_0x4080db,_0x558add){_0x558add=_0x558add||0xcc;return function(_0x512916){if(_0x512916){return _0x4080db[_0x181c('0x1a')](_0x558add);}return _0x4080db['status'](_0x558add)[_0x181c('0x1b')]();};}function respondWithResult(_0x3780b1,_0x27c29d){_0x27c29d=_0x27c29d||0xc8;return function(_0x3acef8){if(_0x3acef8){return _0x3780b1['status'](_0x27c29d)[_0x181c('0x1c')](_0x3acef8);}};}function respondWithFilteredResult(_0x1516ac,_0x9f8905){return function(_0x4cc1db){if(_0x4cc1db){var _0x591c50=typeof _0x9f8905[_0x181c('0x1d')]===_0x181c('0x1e')&&typeof _0x9f8905['limit']===_0x181c('0x1e');var _0x20ef99=_0x4cc1db[_0x181c('0x1f')];var _0x1830b3=_0x591c50?0x0:_0x9f8905[_0x181c('0x1d')];var _0x91d370=_0x591c50?_0x4cc1db[_0x181c('0x1f')]:_0x9f8905['offset']+_0x9f8905['limit'];var _0xaccfec;if(_0x91d370>=_0x20ef99){_0x91d370=_0x20ef99;_0xaccfec=0xc8;}else{_0xaccfec=0xce;}_0x1516ac['status'](_0xaccfec);return _0x1516ac[_0x181c('0x20')](_0x181c('0x21'),_0x1830b3+'-'+_0x91d370+'/'+_0x20ef99)[_0x181c('0x1c')](_0x4cc1db);}return null;};}function patchUpdates(_0x237bcd){return function(_0x39eb92){try{jsonpatch[_0x181c('0x22')](_0x39eb92,_0x237bcd,!![]);}catch(_0x523a26){return BPromise[_0x181c('0x23')](_0x523a26);}return _0x39eb92['save']();};}function saveUpdates(_0x3a7b33,_0x348eb0){return function(_0x56f983){if(_0x56f983){return _0x56f983[_0x181c('0x24')](_0x3a7b33)[_0x181c('0x25')](function(_0xc64557){return _0xc64557;});}return null;};}function removeEntity(_0x43bf9c,_0x4d717f){return function(_0x26e8d3){if(_0x26e8d3){return _0x26e8d3[_0x181c('0x26')]()[_0x181c('0x25')](function(){_0x43bf9c[_0x181c('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178a14,_0x2b448e){return function(_0x35a740){if(!_0x35a740){_0x178a14[_0x181c('0x1a')](0x194);}return _0x35a740;};}function handleError(_0x6a0814,_0x1657fb){_0x1657fb=_0x1657fb||0x1f4;return function(_0x2551b2){logger[_0x181c('0x28')](_0x2551b2[_0x181c('0x29')]);if(_0x2551b2[_0x181c('0x2a')]){delete _0x2551b2[_0x181c('0x2a')];}_0x6a0814[_0x181c('0x27')](_0x1657fb)[_0x181c('0x2b')](_0x2551b2);};}exports[_0x181c('0x2c')]=function(_0x20b2e7,_0x55ee74){var _0x34208d={},_0x1ee172={},_0x4dcbbe={'count':0x0,'rows':[]};var _0x4cc86f=_[_0x181c('0x2d')](db[_0x181c('0x2e')][_0x181c('0x2f')],function(_0x10e305){return{'name':_0x10e305[_0x181c('0x30')],'type':_0x10e305[_0x181c('0x31')][_0x181c('0x32')]};});_0x1ee172['model']=_['map'](_0x4cc86f,'name');_0x1ee172['query']=_[_0x181c('0x33')](_0x20b2e7[_0x181c('0x34')]);_0x1ee172[_0x181c('0x35')]=_[_0x181c('0x36')](_0x1ee172['model'],_0x1ee172['query']);_0x34208d[_0x181c('0x37')]=_['intersection'](_0x1ee172[_0x181c('0x38')],qs[_0x181c('0x39')](_0x20b2e7[_0x181c('0x34')][_0x181c('0x39')]));_0x34208d['attributes']=_0x34208d[_0x181c('0x37')][_0x181c('0x3a')]?_0x34208d[_0x181c('0x37')]:_0x1ee172[_0x181c('0x38')];if(!_0x20b2e7[_0x181c('0x34')][_0x181c('0x3b')](_0x181c('0x3c'))){_0x34208d[_0x181c('0x3d')]=qs[_0x181c('0x3d')](_0x20b2e7[_0x181c('0x34')][_0x181c('0x3d')]);_0x34208d[_0x181c('0x1d')]=qs[_0x181c('0x1d')](_0x20b2e7[_0x181c('0x34')][_0x181c('0x1d')]);}_0x34208d[_0x181c('0x3e')]=qs[_0x181c('0x3f')](_0x20b2e7[_0x181c('0x34')]['sort']);_0x34208d[_0x181c('0x40')]=qs[_0x181c('0x35')](_[_0x181c('0x41')](_0x20b2e7[_0x181c('0x34')],_0x1ee172[_0x181c('0x35')]),_0x4cc86f);if(_0x20b2e7['query'][_0x181c('0x42')]){_0x34208d[_0x181c('0x40')]=_[_0x181c('0x43')](_0x34208d[_0x181c('0x40')],{'$or':_['map'](_0x4cc86f,function(_0x501b35){if(_0x501b35[_0x181c('0x31')]!==_0x181c('0x44')){var _0x15f394={};_0x15f394[_0x501b35['name']]={'$like':'%'+_0x20b2e7[_0x181c('0x34')][_0x181c('0x42')]+'%'};return _0x15f394;}})});}_0x34208d=_[_0x181c('0x43')]({},_0x34208d,_0x20b2e7[_0x181c('0x45')]);var _0x4b3919={'where':_0x34208d[_0x181c('0x40')]};return db['ZohoConfiguration'][_0x181c('0x1f')](_0x4b3919)[_0x181c('0x25')](function(_0x16d81b){_0x4dcbbe[_0x181c('0x1f')]=_0x16d81b;if(_0x20b2e7[_0x181c('0x34')][_0x181c('0x46')]){_0x34208d['include']=[{'all':!![]}];}return db[_0x181c('0x2e')][_0x181c('0x47')](_0x34208d);})[_0x181c('0x25')](function(_0x1f65c2){_0x4dcbbe[_0x181c('0x48')]=_0x1f65c2;return _0x4dcbbe;})['then'](respondWithFilteredResult(_0x55ee74,_0x34208d))[_0x181c('0x49')](handleError(_0x55ee74,null));};exports['show']=function(_0x457d8e,_0x4e1007){var _0x598f9b={'raw':![],'where':{'id':_0x457d8e[_0x181c('0x4a')]['id']}},_0x273c87={};_0x273c87[_0x181c('0x38')]=_[_0x181c('0x33')](db['ZohoConfiguration'][_0x181c('0x2f')]);_0x273c87['query']=_[_0x181c('0x33')](_0x457d8e[_0x181c('0x34')]);_0x273c87[_0x181c('0x35')]=_['intersection'](_0x273c87[_0x181c('0x38')],_0x273c87['query']);_0x598f9b[_0x181c('0x37')]=_[_0x181c('0x36')](_0x273c87[_0x181c('0x38')],qs[_0x181c('0x39')](_0x457d8e[_0x181c('0x34')][_0x181c('0x39')]));_0x598f9b[_0x181c('0x37')]=_0x598f9b['attributes'][_0x181c('0x3a')]?_0x598f9b[_0x181c('0x37')]:_0x273c87[_0x181c('0x38')];if(_0x457d8e[_0x181c('0x34')][_0x181c('0x46')]){_0x598f9b['include']=[{'all':!![]}];}_0x598f9b=_[_0x181c('0x43')]({},_0x598f9b,_0x457d8e[_0x181c('0x45')]);return db['ZohoConfiguration'][_0x181c('0x4b')](_0x598f9b)[_0x181c('0x25')](handleEntityNotFound(_0x4e1007,null))[_0x181c('0x25')](respondWithResult(_0x4e1007,null))[_0x181c('0x49')](handleError(_0x4e1007,null));};exports[_0x181c('0x4c')]=function(_0x8009c2,_0x22d4cc){return db[_0x181c('0x2e')][_0x181c('0x4c')](_0x8009c2[_0x181c('0x4d')],{})['then'](respondWithResult(_0x22d4cc,0xc9))[_0x181c('0x49')](handleError(_0x22d4cc,null));};exports[_0x181c('0x24')]=function(_0x423f5c,_0x557ff5){if(_0x423f5c[_0x181c('0x4d')]['id']){delete _0x423f5c[_0x181c('0x4d')]['id'];}return db[_0x181c('0x2e')][_0x181c('0x4b')]({'where':{'id':_0x423f5c[_0x181c('0x4a')]['id']}})[_0x181c('0x25')](handleEntityNotFound(_0x557ff5,null))[_0x181c('0x25')](saveUpdates(_0x423f5c[_0x181c('0x4d')],null))[_0x181c('0x25')](respondWithResult(_0x557ff5,null))['catch'](handleError(_0x557ff5,null));};exports['destroy']=function(_0x5dacc8,_0x92fd4e){return db[_0x181c('0x2e')][_0x181c('0x4b')]({'where':{'id':_0x5dacc8['params']['id']}})[_0x181c('0x25')](handleEntityNotFound(_0x92fd4e,null))['then'](removeEntity(_0x92fd4e,null))[_0x181c('0x49')](handleError(_0x92fd4e,null));};exports[_0x181c('0x4e')]=function(_0xe5b3ba,_0x3fe523,_0x334929){var _0x4039c7={};var _0x1f4e9e={};var _0x288a43;var _0x137831;return db[_0x181c('0x2e')]['findOne']({'where':{'id':_0xe5b3ba['params']['id']}})[_0x181c('0x25')](handleEntityNotFound(_0x3fe523,null))[_0x181c('0x25')](function(_0x3bab45){if(_0x3bab45){_0x288a43=_0x3bab45;_0x1f4e9e['model']=_[_0x181c('0x33')](db[_0x181c('0x4f')][_0x181c('0x2f')]);_0x1f4e9e[_0x181c('0x34')]=_['keys'](_0xe5b3ba[_0x181c('0x34')]);_0x1f4e9e[_0x181c('0x35')]=_[_0x181c('0x36')](_0x1f4e9e[_0x181c('0x38')],_0x1f4e9e[_0x181c('0x34')]);_0x4039c7['attributes']=_['intersection'](_0x1f4e9e[_0x181c('0x38')],qs[_0x181c('0x39')](_0xe5b3ba['query']['fields']));_0x4039c7['attributes']=_0x4039c7[_0x181c('0x37')][_0x181c('0x3a')]?_0x4039c7['attributes']:_0x1f4e9e['model'];_0x4039c7[_0x181c('0x3e')]=qs['sort'](_0xe5b3ba[_0x181c('0x34')][_0x181c('0x3f')]);_0x4039c7[_0x181c('0x40')]=qs[_0x181c('0x35')](_[_0x181c('0x41')](_0xe5b3ba[_0x181c('0x34')],_0x1f4e9e[_0x181c('0x35')]));if(_0xe5b3ba['query'][_0x181c('0x42')]){_0x4039c7[_0x181c('0x40')]=_[_0x181c('0x43')](_0x4039c7[_0x181c('0x40')],{'$or':_['map'](_0x4039c7[_0x181c('0x37')],function(_0x4924fc){var _0x152163={};_0x152163[_0x4924fc]={'$like':'%'+_0xe5b3ba['query']['filter']+'%'};return _0x152163;})});}_0x4039c7=_['merge']({},_0x4039c7,_0xe5b3ba['options']);return _0x288a43[_0x181c('0x4e')](_0x4039c7);}})[_0x181c('0x25')](function(_0x4aaa60){if(_0x4aaa60){_0x137831=_0x4aaa60[_0x181c('0x3a')];if(!_0xe5b3ba[_0x181c('0x34')][_0x181c('0x3b')]('nolimit')){_0x4039c7['limit']=qs[_0x181c('0x3d')](_0xe5b3ba[_0x181c('0x34')]['limit']);_0x4039c7[_0x181c('0x1d')]=qs[_0x181c('0x1d')](_0xe5b3ba[_0x181c('0x34')][_0x181c('0x1d')]);}return _0x288a43['getFields'](_0x4039c7);}})['then'](function(_0x113a02){if(_0x113a02){return _0x113a02?{'count':_0x137831,'rows':_0x113a02}:null;}})[_0x181c('0x25')](respondWithResult(_0x3fe523,null))['catch'](handleError(_0x3fe523,null));};exports['getSubjects']=function(_0x85403c,_0x3d55eb,_0x48aea5){var _0x1b6b2e={};var _0x567a03={};var _0x5453d1;var _0x58f604;return db[_0x181c('0x2e')][_0x181c('0x50')]({'where':{'id':_0x85403c[_0x181c('0x4a')]['id']}})[_0x181c('0x25')](handleEntityNotFound(_0x3d55eb,null))[_0x181c('0x25')](function(_0x3e5791){if(_0x3e5791){_0x5453d1=_0x3e5791;_0x567a03[_0x181c('0x38')]=_[_0x181c('0x33')](db[_0x181c('0x4f')][_0x181c('0x2f')]);_0x567a03[_0x181c('0x34')]=_[_0x181c('0x33')](_0x85403c['query']);_0x567a03[_0x181c('0x35')]=_[_0x181c('0x36')](_0x567a03[_0x181c('0x38')],_0x567a03[_0x181c('0x34')]);_0x1b6b2e[_0x181c('0x37')]=_['intersection'](_0x567a03[_0x181c('0x38')],qs['fields'](_0x85403c['query'][_0x181c('0x39')]));_0x1b6b2e[_0x181c('0x37')]=_0x1b6b2e[_0x181c('0x37')][_0x181c('0x3a')]?_0x1b6b2e[_0x181c('0x37')]:_0x567a03[_0x181c('0x38')];_0x1b6b2e[_0x181c('0x3e')]=qs[_0x181c('0x3f')](_0x85403c[_0x181c('0x34')][_0x181c('0x3f')]);_0x1b6b2e['where']=qs[_0x181c('0x35')](_[_0x181c('0x41')](_0x85403c[_0x181c('0x34')],_0x567a03[_0x181c('0x35')]));if(_0x85403c['query']['filter']){_0x1b6b2e[_0x181c('0x40')]=_[_0x181c('0x43')](_0x1b6b2e[_0x181c('0x40')],{'$or':_[_0x181c('0x2d')](_0x1b6b2e[_0x181c('0x37')],function(_0x3ca630){var _0x1c4648={};_0x1c4648[_0x3ca630]={'$like':'%'+_0x85403c[_0x181c('0x34')]['filter']+'%'};return _0x1c4648;})});}_0x1b6b2e=_[_0x181c('0x43')]({},_0x1b6b2e,_0x85403c[_0x181c('0x45')]);return _0x5453d1['getSubjects'](_0x1b6b2e);}})['then'](function(_0x1328f4){if(_0x1328f4){_0x58f604=_0x1328f4[_0x181c('0x3a')];if(!_0x85403c[_0x181c('0x34')]['hasOwnProperty'](_0x181c('0x3c'))){_0x1b6b2e[_0x181c('0x3d')]=qs['limit'](_0x85403c[_0x181c('0x34')][_0x181c('0x3d')]);_0x1b6b2e['offset']=qs[_0x181c('0x1d')](_0x85403c[_0x181c('0x34')]['offset']);}return _0x5453d1[_0x181c('0x51')](_0x1b6b2e);}})['then'](function(_0x482a80){if(_0x482a80){return _0x482a80?{'count':_0x58f604,'rows':_0x482a80}:null;}})[_0x181c('0x25')](respondWithResult(_0x3d55eb,null))['catch'](handleError(_0x3d55eb,null));};exports[_0x181c('0x52')]=function(_0x38ac8f,_0x415d6e,_0x2daea4){var _0x501400={};var _0x514616={};var _0x2608bd;var _0xf9600b;return db[_0x181c('0x2e')]['findOne']({'where':{'id':_0x38ac8f[_0x181c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x415d6e,null))['then'](function(_0xec58bf){if(_0xec58bf){_0x2608bd=_0xec58bf;_0x514616[_0x181c('0x38')]=_[_0x181c('0x33')](db[_0x181c('0x4f')][_0x181c('0x2f')]);_0x514616[_0x181c('0x34')]=_['keys'](_0x38ac8f[_0x181c('0x34')]);_0x514616['filters']=_[_0x181c('0x36')](_0x514616[_0x181c('0x38')],_0x514616[_0x181c('0x34')]);_0x501400[_0x181c('0x37')]=_[_0x181c('0x36')](_0x514616['model'],qs[_0x181c('0x39')](_0x38ac8f[_0x181c('0x34')][_0x181c('0x39')]));_0x501400[_0x181c('0x37')]=_0x501400[_0x181c('0x37')][_0x181c('0x3a')]?_0x501400[_0x181c('0x37')]:_0x514616[_0x181c('0x38')];_0x501400[_0x181c('0x3e')]=qs[_0x181c('0x3f')](_0x38ac8f[_0x181c('0x34')][_0x181c('0x3f')]);_0x501400[_0x181c('0x40')]=qs['filters'](_[_0x181c('0x41')](_0x38ac8f[_0x181c('0x34')],_0x514616[_0x181c('0x35')]));if(_0x38ac8f['query'][_0x181c('0x42')]){_0x501400[_0x181c('0x40')]=_[_0x181c('0x43')](_0x501400['where'],{'$or':_[_0x181c('0x2d')](_0x501400['attributes'],function(_0x354b24){var _0x236cfc={};_0x236cfc[_0x354b24]={'$like':'%'+_0x38ac8f[_0x181c('0x34')][_0x181c('0x42')]+'%'};return _0x236cfc;})});}_0x501400=_[_0x181c('0x43')]({},_0x501400,_0x38ac8f[_0x181c('0x45')]);return _0x2608bd[_0x181c('0x52')](_0x501400);}})[_0x181c('0x25')](function(_0x92ad92){if(_0x92ad92){_0xf9600b=_0x92ad92['length'];if(!_0x38ac8f[_0x181c('0x34')][_0x181c('0x3b')](_0x181c('0x3c'))){_0x501400[_0x181c('0x3d')]=qs[_0x181c('0x3d')](_0x38ac8f[_0x181c('0x34')][_0x181c('0x3d')]);_0x501400[_0x181c('0x1d')]=qs['offset'](_0x38ac8f[_0x181c('0x34')][_0x181c('0x1d')]);}return _0x2608bd[_0x181c('0x52')](_0x501400);}})[_0x181c('0x25')](function(_0x5ad535){if(_0x5ad535){return _0x5ad535?{'count':_0xf9600b,'rows':_0x5ad535}:null;}})[_0x181c('0x25')](respondWithResult(_0x415d6e,null))[_0x181c('0x49')](handleError(_0x415d6e,null));}; \ No newline at end of file +var _0x47a2=['api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','reject','save','then','end','error','stack','name','index','map','ZohoConfiguration','key','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','options','find','create','body','destroy','findOne','ZohoField','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x213225,_0x57eb2d){var _0x1dfa14=function(_0x5dd79a){while(--_0x5dd79a){_0x213225['push'](_0x213225['shift']());}};_0x1dfa14(++_0x57eb2d);}(_0x47a2,0x128));var _0x247a=function(_0x5851d8,_0x4209cb){_0x5851d8=_0x5851d8-0x0;var _0x4032fb=_0x47a2[_0x5851d8];return _0x4032fb;};'use strict';var emlformat=require(_0x247a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x247a('0x1'));var jsonpatch=require(_0x247a('0x2'));var rp=require(_0x247a('0x3'));var moment=require(_0x247a('0x4'));var BPromise=require(_0x247a('0x5'));var Mustache=require(_0x247a('0x6'));var util=require(_0x247a('0x7'));var path=require('path');var sox=require(_0x247a('0x8'));var csv=require(_0x247a('0x9'));var ejs=require(_0x247a('0xa'));var fs=require('fs');var fs_extra=require(_0x247a('0xb'));var _=require(_0x247a('0xc'));var squel=require(_0x247a('0xd'));var crypto=require(_0x247a('0xe'));var jsforce=require(_0x247a('0xf'));var deskjs=require(_0x247a('0x10'));var toCsv=require(_0x247a('0x9'));var querystring=require(_0x247a('0x11'));var Papa=require(_0x247a('0x12'));var Redis=require(_0x247a('0x13'));var authService=require(_0x247a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x247a('0x15'));var hardwareService=require(_0x247a('0x16'));var logger=require(_0x247a('0x17'))(_0x247a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x247a('0x19'));var db=require(_0x247a('0x1a'))['db'];function respondWithStatusCode(_0x2c7b43,_0x408d2b){_0x408d2b=_0x408d2b||0xcc;return function(_0x2be2ca){if(_0x2be2ca){return _0x2c7b43[_0x247a('0x1b')](_0x408d2b);}return _0x2c7b43[_0x247a('0x1c')](_0x408d2b)['end']();};}function respondWithResult(_0x3227a9,_0x43989f){_0x43989f=_0x43989f||0xc8;return function(_0x377f3e){if(_0x377f3e){return _0x3227a9[_0x247a('0x1c')](_0x43989f)['json'](_0x377f3e);}};}function respondWithFilteredResult(_0x28996f,_0x2343b7){return function(_0x4cc484){if(_0x4cc484){var _0xe1d90=typeof _0x2343b7[_0x247a('0x1d')]===_0x247a('0x1e')&&typeof _0x2343b7[_0x247a('0x1f')]===_0x247a('0x1e');var _0x15a669=_0x4cc484[_0x247a('0x20')];var _0x35ad0a=_0xe1d90?0x0:_0x2343b7[_0x247a('0x1d')];var _0x5b7047=_0xe1d90?_0x4cc484[_0x247a('0x20')]:_0x2343b7[_0x247a('0x1d')]+_0x2343b7[_0x247a('0x1f')];var _0x28dbde;if(_0x5b7047>=_0x15a669){_0x5b7047=_0x15a669;_0x28dbde=0xc8;}else{_0x28dbde=0xce;}_0x28996f[_0x247a('0x1c')](_0x28dbde);return _0x28996f['set'](_0x247a('0x21'),_0x35ad0a+'-'+_0x5b7047+'/'+_0x15a669)['json'](_0x4cc484);}return null;};}function patchUpdates(_0xce0850){return function(_0xcfd032){try{jsonpatch['apply'](_0xcfd032,_0xce0850,!![]);}catch(_0x2c801e){return BPromise[_0x247a('0x22')](_0x2c801e);}return _0xcfd032[_0x247a('0x23')]();};}function saveUpdates(_0x1e8289,_0x2faf48){return function(_0x46c82a){if(_0x46c82a){return _0x46c82a['update'](_0x1e8289)['then'](function(_0x2282d0){return _0x2282d0;});}return null;};}function removeEntity(_0x33155c,_0x361f1c){return function(_0x2f1074){if(_0x2f1074){return _0x2f1074['destroy']()[_0x247a('0x24')](function(){_0x33155c[_0x247a('0x1c')](0xcc)[_0x247a('0x25')]();});}};}function handleEntityNotFound(_0xf4897e,_0x571751){return function(_0x3faba9){if(!_0x3faba9){_0xf4897e[_0x247a('0x1b')](0x194);}return _0x3faba9;};}function handleError(_0x28a368,_0x3b1f97){_0x3b1f97=_0x3b1f97||0x1f4;return function(_0x5b02ba){logger[_0x247a('0x26')](_0x5b02ba[_0x247a('0x27')]);if(_0x5b02ba[_0x247a('0x28')]){delete _0x5b02ba['name'];}_0x28a368[_0x247a('0x1c')](_0x3b1f97)['send'](_0x5b02ba);};}exports[_0x247a('0x29')]=function(_0x3fd9f6,_0xed46d){var _0x1c1639={},_0x397980={},_0x24ab49={'count':0x0,'rows':[]};var _0x5a063f=_[_0x247a('0x2a')](db[_0x247a('0x2b')]['rawAttributes'],function(_0x348bf0){return{'name':_0x348bf0['fieldName'],'type':_0x348bf0['type'][_0x247a('0x2c')]};});_0x397980[_0x247a('0x2d')]=_[_0x247a('0x2a')](_0x5a063f,_0x247a('0x28'));_0x397980['query']=_['keys'](_0x3fd9f6[_0x247a('0x2e')]);_0x397980['filters']=_[_0x247a('0x2f')](_0x397980[_0x247a('0x2d')],_0x397980[_0x247a('0x2e')]);_0x1c1639[_0x247a('0x30')]=_[_0x247a('0x2f')](_0x397980[_0x247a('0x2d')],qs[_0x247a('0x31')](_0x3fd9f6[_0x247a('0x2e')][_0x247a('0x31')]));_0x1c1639[_0x247a('0x30')]=_0x1c1639[_0x247a('0x30')]['length']?_0x1c1639[_0x247a('0x30')]:_0x397980[_0x247a('0x2d')];if(!_0x3fd9f6[_0x247a('0x2e')][_0x247a('0x32')]('nolimit')){_0x1c1639[_0x247a('0x1f')]=qs[_0x247a('0x1f')](_0x3fd9f6[_0x247a('0x2e')][_0x247a('0x1f')]);_0x1c1639[_0x247a('0x1d')]=qs['offset'](_0x3fd9f6['query'][_0x247a('0x1d')]);}_0x1c1639[_0x247a('0x33')]=qs[_0x247a('0x34')](_0x3fd9f6[_0x247a('0x2e')][_0x247a('0x34')]);_0x1c1639['where']=qs['filters'](_[_0x247a('0x35')](_0x3fd9f6[_0x247a('0x2e')],_0x397980[_0x247a('0x36')]),_0x5a063f);if(_0x3fd9f6[_0x247a('0x2e')][_0x247a('0x37')]){_0x1c1639[_0x247a('0x38')]=_[_0x247a('0x39')](_0x1c1639[_0x247a('0x38')],{'$or':_[_0x247a('0x2a')](_0x5a063f,function(_0x21c7fd){if(_0x21c7fd[_0x247a('0x3a')]!==_0x247a('0x3b')){var _0x18b541={};_0x18b541[_0x21c7fd[_0x247a('0x28')]]={'$like':'%'+_0x3fd9f6['query'][_0x247a('0x37')]+'%'};return _0x18b541;}})});}_0x1c1639=_[_0x247a('0x39')]({},_0x1c1639,_0x3fd9f6['options']);var _0x159831={'where':_0x1c1639[_0x247a('0x38')]};return db['ZohoConfiguration'][_0x247a('0x20')](_0x159831)['then'](function(_0x4c5d83){_0x24ab49[_0x247a('0x20')]=_0x4c5d83;if(_0x3fd9f6['query'][_0x247a('0x3c')]){_0x1c1639[_0x247a('0x3d')]=[{'all':!![]}];}return db[_0x247a('0x2b')][_0x247a('0x3e')](_0x1c1639);})[_0x247a('0x24')](function(_0x377271){_0x24ab49[_0x247a('0x3f')]=_0x377271;return _0x24ab49;})['then'](respondWithFilteredResult(_0xed46d,_0x1c1639))[_0x247a('0x40')](handleError(_0xed46d,null));};exports[_0x247a('0x41')]=function(_0x4be8c0,_0x352ab3){var _0x44d45d={'raw':![],'where':{'id':_0x4be8c0[_0x247a('0x42')]['id']}},_0x12f0b4={};_0x12f0b4[_0x247a('0x2d')]=_[_0x247a('0x43')](db['ZohoConfiguration'][_0x247a('0x44')]);_0x12f0b4[_0x247a('0x2e')]=_[_0x247a('0x43')](_0x4be8c0['query']);_0x12f0b4[_0x247a('0x36')]=_[_0x247a('0x2f')](_0x12f0b4[_0x247a('0x2d')],_0x12f0b4[_0x247a('0x2e')]);_0x44d45d[_0x247a('0x30')]=_[_0x247a('0x2f')](_0x12f0b4[_0x247a('0x2d')],qs[_0x247a('0x31')](_0x4be8c0[_0x247a('0x2e')][_0x247a('0x31')]));_0x44d45d['attributes']=_0x44d45d[_0x247a('0x30')][_0x247a('0x45')]?_0x44d45d[_0x247a('0x30')]:_0x12f0b4[_0x247a('0x2d')];if(_0x4be8c0[_0x247a('0x2e')][_0x247a('0x3c')]){_0x44d45d['include']=[{'all':!![]}];}_0x44d45d=_[_0x247a('0x39')]({},_0x44d45d,_0x4be8c0[_0x247a('0x46')]);return db[_0x247a('0x2b')][_0x247a('0x47')](_0x44d45d)[_0x247a('0x24')](handleEntityNotFound(_0x352ab3,null))[_0x247a('0x24')](respondWithResult(_0x352ab3,null))['catch'](handleError(_0x352ab3,null));};exports['create']=function(_0x2d2482,_0x5c794f){return db[_0x247a('0x2b')][_0x247a('0x48')](_0x2d2482[_0x247a('0x49')],{})[_0x247a('0x24')](respondWithResult(_0x5c794f,0xc9))[_0x247a('0x40')](handleError(_0x5c794f,null));};exports['update']=function(_0x1a8838,_0x4aae26){if(_0x1a8838[_0x247a('0x49')]['id']){delete _0x1a8838[_0x247a('0x49')]['id'];}return db['ZohoConfiguration'][_0x247a('0x47')]({'where':{'id':_0x1a8838[_0x247a('0x42')]['id']}})[_0x247a('0x24')](handleEntityNotFound(_0x4aae26,null))['then'](saveUpdates(_0x1a8838[_0x247a('0x49')],null))[_0x247a('0x24')](respondWithResult(_0x4aae26,null))[_0x247a('0x40')](handleError(_0x4aae26,null));};exports[_0x247a('0x4a')]=function(_0x47bfda,_0x5bc499){return db['ZohoConfiguration'][_0x247a('0x47')]({'where':{'id':_0x47bfda['params']['id']}})[_0x247a('0x24')](handleEntityNotFound(_0x5bc499,null))[_0x247a('0x24')](removeEntity(_0x5bc499,null))[_0x247a('0x40')](handleError(_0x5bc499,null));};exports['getFields']=function(_0x475c6f,_0x2de2d1,_0x1fb1cf){var _0x2f514b={};var _0x133ee3={};var _0x3cd418;var _0x4ba315;return db[_0x247a('0x2b')][_0x247a('0x4b')]({'where':{'id':_0x475c6f[_0x247a('0x42')]['id']}})[_0x247a('0x24')](handleEntityNotFound(_0x2de2d1,null))[_0x247a('0x24')](function(_0x32e6ce){if(_0x32e6ce){_0x3cd418=_0x32e6ce;_0x133ee3['model']=_[_0x247a('0x43')](db[_0x247a('0x4c')][_0x247a('0x44')]);_0x133ee3[_0x247a('0x2e')]=_[_0x247a('0x43')](_0x475c6f[_0x247a('0x2e')]);_0x133ee3[_0x247a('0x36')]=_['intersection'](_0x133ee3[_0x247a('0x2d')],_0x133ee3[_0x247a('0x2e')]);_0x2f514b[_0x247a('0x30')]=_[_0x247a('0x2f')](_0x133ee3[_0x247a('0x2d')],qs[_0x247a('0x31')](_0x475c6f[_0x247a('0x2e')][_0x247a('0x31')]));_0x2f514b[_0x247a('0x30')]=_0x2f514b[_0x247a('0x30')][_0x247a('0x45')]?_0x2f514b['attributes']:_0x133ee3[_0x247a('0x2d')];_0x2f514b['order']=qs[_0x247a('0x34')](_0x475c6f[_0x247a('0x2e')][_0x247a('0x34')]);_0x2f514b[_0x247a('0x38')]=qs[_0x247a('0x36')](_[_0x247a('0x35')](_0x475c6f[_0x247a('0x2e')],_0x133ee3[_0x247a('0x36')]));if(_0x475c6f[_0x247a('0x2e')]['filter']){_0x2f514b[_0x247a('0x38')]=_[_0x247a('0x39')](_0x2f514b[_0x247a('0x38')],{'$or':_[_0x247a('0x2a')](_0x2f514b[_0x247a('0x30')],function(_0x4a96b9){var _0x1817c3={};_0x1817c3[_0x4a96b9]={'$like':'%'+_0x475c6f[_0x247a('0x2e')][_0x247a('0x37')]+'%'};return _0x1817c3;})});}_0x2f514b=_[_0x247a('0x39')]({},_0x2f514b,_0x475c6f[_0x247a('0x46')]);return _0x3cd418['getFields'](_0x2f514b);}})[_0x247a('0x24')](function(_0x4fc47b){if(_0x4fc47b){_0x4ba315=_0x4fc47b[_0x247a('0x45')];if(!_0x475c6f[_0x247a('0x2e')]['hasOwnProperty'](_0x247a('0x4d'))){_0x2f514b['limit']=qs[_0x247a('0x1f')](_0x475c6f[_0x247a('0x2e')][_0x247a('0x1f')]);_0x2f514b[_0x247a('0x1d')]=qs[_0x247a('0x1d')](_0x475c6f[_0x247a('0x2e')][_0x247a('0x1d')]);}return _0x3cd418['getFields'](_0x2f514b);}})[_0x247a('0x24')](function(_0x455007){if(_0x455007){return _0x455007?{'count':_0x4ba315,'rows':_0x455007}:null;}})['then'](respondWithResult(_0x2de2d1,null))['catch'](handleError(_0x2de2d1,null));};exports[_0x247a('0x4e')]=function(_0x10831e,_0x148ccd,_0x472701){var _0x59acb7={};var _0x3fa3ce={};var _0x583f06;var _0x1da77b;return db[_0x247a('0x2b')]['findOne']({'where':{'id':_0x10831e[_0x247a('0x42')]['id']}})[_0x247a('0x24')](handleEntityNotFound(_0x148ccd,null))[_0x247a('0x24')](function(_0x253eef){if(_0x253eef){_0x583f06=_0x253eef;_0x3fa3ce['model']=_['keys'](db[_0x247a('0x4c')][_0x247a('0x44')]);_0x3fa3ce[_0x247a('0x2e')]=_['keys'](_0x10831e[_0x247a('0x2e')]);_0x3fa3ce[_0x247a('0x36')]=_[_0x247a('0x2f')](_0x3fa3ce[_0x247a('0x2d')],_0x3fa3ce['query']);_0x59acb7[_0x247a('0x30')]=_['intersection'](_0x3fa3ce[_0x247a('0x2d')],qs['fields'](_0x10831e['query'][_0x247a('0x31')]));_0x59acb7['attributes']=_0x59acb7[_0x247a('0x30')]['length']?_0x59acb7[_0x247a('0x30')]:_0x3fa3ce[_0x247a('0x2d')];_0x59acb7['order']=qs[_0x247a('0x34')](_0x10831e[_0x247a('0x2e')][_0x247a('0x34')]);_0x59acb7[_0x247a('0x38')]=qs[_0x247a('0x36')](_[_0x247a('0x35')](_0x10831e[_0x247a('0x2e')],_0x3fa3ce[_0x247a('0x36')]));if(_0x10831e[_0x247a('0x2e')]['filter']){_0x59acb7[_0x247a('0x38')]=_[_0x247a('0x39')](_0x59acb7[_0x247a('0x38')],{'$or':_[_0x247a('0x2a')](_0x59acb7[_0x247a('0x30')],function(_0x3e3815){var _0x2e641c={};_0x2e641c[_0x3e3815]={'$like':'%'+_0x10831e[_0x247a('0x2e')][_0x247a('0x37')]+'%'};return _0x2e641c;})});}_0x59acb7=_[_0x247a('0x39')]({},_0x59acb7,_0x10831e[_0x247a('0x46')]);return _0x583f06[_0x247a('0x4e')](_0x59acb7);}})['then'](function(_0x3cbbd2){if(_0x3cbbd2){_0x1da77b=_0x3cbbd2[_0x247a('0x45')];if(!_0x10831e[_0x247a('0x2e')][_0x247a('0x32')]('nolimit')){_0x59acb7[_0x247a('0x1f')]=qs[_0x247a('0x1f')](_0x10831e[_0x247a('0x2e')][_0x247a('0x1f')]);_0x59acb7['offset']=qs[_0x247a('0x1d')](_0x10831e[_0x247a('0x2e')][_0x247a('0x1d')]);}return _0x583f06['getSubjects'](_0x59acb7);}})[_0x247a('0x24')](function(_0x216dc9){if(_0x216dc9){return _0x216dc9?{'count':_0x1da77b,'rows':_0x216dc9}:null;}})['then'](respondWithResult(_0x148ccd,null))[_0x247a('0x40')](handleError(_0x148ccd,null));};exports[_0x247a('0x4f')]=function(_0x3d8e10,_0x413f55,_0x5cffbc){var _0x2b3e37={};var _0x45e5ac={};var _0x293403;var _0x3263bd;return db['ZohoConfiguration'][_0x247a('0x4b')]({'where':{'id':_0x3d8e10[_0x247a('0x42')]['id']}})['then'](handleEntityNotFound(_0x413f55,null))[_0x247a('0x24')](function(_0x26f425){if(_0x26f425){_0x293403=_0x26f425;_0x45e5ac[_0x247a('0x2d')]=_['keys'](db[_0x247a('0x4c')][_0x247a('0x44')]);_0x45e5ac['query']=_['keys'](_0x3d8e10[_0x247a('0x2e')]);_0x45e5ac['filters']=_[_0x247a('0x2f')](_0x45e5ac[_0x247a('0x2d')],_0x45e5ac['query']);_0x2b3e37['attributes']=_['intersection'](_0x45e5ac[_0x247a('0x2d')],qs[_0x247a('0x31')](_0x3d8e10['query'][_0x247a('0x31')]));_0x2b3e37[_0x247a('0x30')]=_0x2b3e37[_0x247a('0x30')][_0x247a('0x45')]?_0x2b3e37[_0x247a('0x30')]:_0x45e5ac['model'];_0x2b3e37[_0x247a('0x33')]=qs[_0x247a('0x34')](_0x3d8e10[_0x247a('0x2e')][_0x247a('0x34')]);_0x2b3e37[_0x247a('0x38')]=qs[_0x247a('0x36')](_[_0x247a('0x35')](_0x3d8e10[_0x247a('0x2e')],_0x45e5ac[_0x247a('0x36')]));if(_0x3d8e10['query'][_0x247a('0x37')]){_0x2b3e37[_0x247a('0x38')]=_[_0x247a('0x39')](_0x2b3e37[_0x247a('0x38')],{'$or':_[_0x247a('0x2a')](_0x2b3e37[_0x247a('0x30')],function(_0x757f7f){var _0x239d5e={};_0x239d5e[_0x757f7f]={'$like':'%'+_0x3d8e10[_0x247a('0x2e')][_0x247a('0x37')]+'%'};return _0x239d5e;})});}_0x2b3e37=_[_0x247a('0x39')]({},_0x2b3e37,_0x3d8e10[_0x247a('0x46')]);return _0x293403['getDescriptions'](_0x2b3e37);}})[_0x247a('0x24')](function(_0x3e1191){if(_0x3e1191){_0x3263bd=_0x3e1191[_0x247a('0x45')];if(!_0x3d8e10[_0x247a('0x2e')][_0x247a('0x32')](_0x247a('0x4d'))){_0x2b3e37[_0x247a('0x1f')]=qs[_0x247a('0x1f')](_0x3d8e10[_0x247a('0x2e')][_0x247a('0x1f')]);_0x2b3e37[_0x247a('0x1d')]=qs[_0x247a('0x1d')](_0x3d8e10[_0x247a('0x2e')][_0x247a('0x1d')]);}return _0x293403['getDescriptions'](_0x2b3e37);}})[_0x247a('0x24')](function(_0x204205){if(_0x204205){return _0x204205?{'count':_0x3263bd,'rows':_0x204205}:null;}})[_0x247a('0x24')](respondWithResult(_0x413f55,null))[_0x247a('0x40')](handleError(_0x413f55,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 10ddf72..cb2d27d 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 _0xf848=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x59d778,_0x6bbd00){var _0x21bef3=function(_0x1e96f0){while(--_0x1e96f0){_0x59d778['push'](_0x59d778['shift']());}};_0x21bef3(++_0x6bbd00);}(_0xf848,0x116));var _0x8f84=function(_0x404eab,_0x298d3b){_0x404eab=_0x404eab-0x0;var _0xddc262=_0xf848[_0x404eab];return _0xddc262;};'use strict';var _=require(_0x8f84('0x0'));var util=require(_0x8f84('0x1'));var logger=require(_0x8f84('0x2'))(_0x8f84('0x3'));var moment=require(_0x8f84('0x4'));var BPromise=require(_0x8f84('0x5'));var rp=require(_0x8f84('0x6'));var fs=require('fs');var path=require(_0x8f84('0x7'));var rimraf=require('rimraf');var config=require(_0x8f84('0x8'));var attributes=require(_0x8f84('0x9'));module[_0x8f84('0xa')]=function(_0x5be1fc,_0x5112b8){return _0x5be1fc[_0x8f84('0xb')](_0x8f84('0xc'),attributes,{'tableName':_0x8f84('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41b5=['request-promise','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','bluebird'];(function(_0x29131c,_0x16bf91){var _0x5418b9=function(_0x5c1032){while(--_0x5c1032){_0x29131c['push'](_0x29131c['shift']());}};_0x5418b9(++_0x16bf91);}(_0x41b5,0x148));var _0x541b=function(_0x192d96,_0x312f2f){_0x192d96=_0x192d96-0x0;var _0x24b76b=_0x41b5[_0x192d96];return _0x24b76b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x541b('0x0'))('api');var moment=require('moment');var BPromise=require(_0x541b('0x1'));var rp=require(_0x541b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x541b('0x3'));var config=require(_0x541b('0x4'));var attributes=require(_0x541b('0x5'));module[_0x541b('0x6')]=function(_0x4c36e4,_0x4f4f09){return _0x4c36e4[_0x541b('0x7')](_0x541b('0x8'),attributes,{'tableName':_0x541b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index cdd0378..cd3c38b 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 _0x08d8=['../../config/environment','jayson/promise','then','info','request\x20sent','stringify','error','message','ZohoConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08d8,0x1af));var _0x808d=function(_0x14c358,_0x522070){_0x14c358=_0x14c358-0x0;var _0x33b11d=_0x08d8[_0x14c358];return _0x33b11d;};'use strict';var _=require(_0x808d('0x0'));var util=require(_0x808d('0x1'));var moment=require(_0x808d('0x2'));var BPromise=require(_0x808d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x808d('0x4'));var db=require(_0x808d('0x5'))['db'];var utils=require(_0x808d('0x6'));var logger=require(_0x808d('0x7'))(_0x808d('0x8'));var config=require(_0x808d('0x9'));var jayson=require(_0x808d('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdd04e5,_0x2ec888,_0x5b9513){return new BPromise(function(_0x574fca,_0x4041af){return client['request'](_0xdd04e5,_0x5b9513)[_0x808d('0xb')](function(_0x15adc6){logger[_0x808d('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ec888,'request\x20sent');logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2ec888,_0x808d('0xd'),JSON[_0x808d('0xe')](_0x15adc6));if(_0x15adc6[_0x808d('0xf')]){if(_0x15adc6[_0x808d('0xf')]['code']===0x1f4){logger[_0x808d('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x2ec888,_0x15adc6[_0x808d('0xf')][_0x808d('0x10')]);return _0x4041af(_0x15adc6[_0x808d('0xf')][_0x808d('0x10')]);}logger[_0x808d('0xf')](_0x808d('0x11'),_0x2ec888,_0x15adc6['error']['message']);return _0x574fca(_0x15adc6[_0x808d('0xf')][_0x808d('0x10')]);}else{logger['info'](_0x808d('0x11'),_0x2ec888,_0x808d('0xd'));_0x574fca(_0x15adc6[_0x808d('0x12')][_0x808d('0x10')]);}})[_0x808d('0x13')](function(_0x10dc61){logger[_0x808d('0xf')](_0x808d('0x11'),_0x2ec888,_0x10dc61);_0x4041af(_0x10dc61);});});} \ No newline at end of file +var _0x2b57=['ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then'];(function(_0x4ca52a,_0x4b70a5){var _0x2841d7=function(_0x4ccf6a){while(--_0x4ccf6a){_0x4ca52a['push'](_0x4ca52a['shift']());}};_0x2841d7(++_0x4b70a5);}(_0x2b57,0x6d));var _0x72b5=function(_0x265329,_0x22064b){_0x265329=_0x265329-0x0;var _0x2f7f8c=_0x2b57[_0x265329];return _0x2f7f8c;};'use strict';var _=require('lodash');var util=require(_0x72b5('0x0'));var moment=require(_0x72b5('0x1'));var BPromise=require(_0x72b5('0x2'));var rs=require(_0x72b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b5('0x4'))['db'];var utils=require(_0x72b5('0x5'));var logger=require(_0x72b5('0x6'))(_0x72b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x72b5('0x8'));var client=jayson['client'][_0x72b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfd5c52,_0x3935ab,_0x5db14a){return new BPromise(function(_0x48aa2c,_0x19d9e6){return client['request'](_0xfd5c52,_0x5db14a)[_0x72b5('0xa')](function(_0x46e3ee){logger['info'](_0x72b5('0xb'),_0x3935ab,_0x72b5('0xc'));logger[_0x72b5('0xd')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3935ab,_0x72b5('0xc'),JSON[_0x72b5('0xe')](_0x46e3ee));if(_0x46e3ee['error']){if(_0x46e3ee['error'][_0x72b5('0xf')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3935ab,_0x46e3ee[_0x72b5('0x10')][_0x72b5('0x11')]);return _0x19d9e6(_0x46e3ee[_0x72b5('0x10')]['message']);}logger['error'](_0x72b5('0xb'),_0x3935ab,_0x46e3ee['error'][_0x72b5('0x11')]);return _0x48aa2c(_0x46e3ee[_0x72b5('0x10')][_0x72b5('0x11')]);}else{logger['info'](_0x72b5('0xb'),_0x3935ab,_0x72b5('0xc'));_0x48aa2c(_0x46e3ee[_0x72b5('0x12')][_0x72b5('0x11')]);}})[_0x72b5('0x13')](function(_0x5a11cd){logger['error'](_0x72b5('0xb'),_0x3935ab,_0x5a11cd);_0x19d9e6(_0x5a11cd);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 8f3dd2c..6d72a1c 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 _0x12c3=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoField.controller','get'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x12c3,0x173));var _0x312c=function(_0x164f59,_0x8ec228){_0x164f59=_0x164f59-0x0;var _0x4b0f18=_0x12c3[_0x164f59];return _0x4b0f18;};'use strict';var multer=require(_0x312c('0x0'));var util=require(_0x312c('0x1'));var path=require('path');var timeout=require(_0x312c('0x2'));var express=require(_0x312c('0x3'));var router=express[_0x312c('0x4')]();var fs_extra=require(_0x312c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x312c('0x6'));var config=require('../../config/environment');var controller=require(_0x312c('0x7'));router[_0x312c('0x8')]('/',auth[_0x312c('0x9')](),controller[_0x312c('0xa')]);router[_0x312c('0x8')](_0x312c('0xb'),auth['isAuthenticated'](),controller[_0x312c('0xc')]);router[_0x312c('0xd')]('/',auth[_0x312c('0x9')](),controller[_0x312c('0xe')]);router[_0x312c('0xf')](_0x312c('0xb'),auth['isAuthenticated'](),controller[_0x312c('0x10')]);router[_0x312c('0x11')](_0x312c('0xb'),auth[_0x312c('0x9')](),controller[_0x312c('0x12')]);module[_0x312c('0x13')]=router; \ No newline at end of file +var _0x111a=['isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x111a,0x118));var _0xa111=function(_0x216243,_0x3508f5){_0x216243=_0x216243-0x0;var _0x494c37=_0x111a[_0x216243];return _0x494c37;};'use strict';var multer=require(_0xa111('0x0'));var util=require('util');var path=require(_0xa111('0x1'));var timeout=require('connect-timeout');var express=require(_0xa111('0x2'));var router=express['Router']();var fs_extra=require(_0xa111('0x3'));var auth=require(_0xa111('0x4'));var interaction=require(_0xa111('0x5'));var config=require(_0xa111('0x6'));var controller=require(_0xa111('0x7'));router[_0xa111('0x8')]('/',auth[_0xa111('0x9')](),controller['index']);router[_0xa111('0x8')](_0xa111('0xa'),auth[_0xa111('0x9')](),controller[_0xa111('0xb')]);router['post']('/',auth[_0xa111('0x9')](),controller[_0xa111('0xc')]);router[_0xa111('0xd')](_0xa111('0xa'),auth['isAuthenticated'](),controller[_0xa111('0xe')]);router['delete']('/:id',auth[_0xa111('0x9')](),controller[_0xa111('0xf')]);module[_0xa111('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 8705501..8e598dc 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 _0xdb1c=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x520f86,_0x240cc0){var _0x4b6523=function(_0x2ec1d0){while(--_0x2ec1d0){_0x520f86['push'](_0x520f86['shift']());}};_0x4b6523(++_0x240cc0);}(_0xdb1c,0x164));var _0xcdb1=function(_0x2d2623,_0x1aaea0){_0x2d2623=_0x2d2623-0x0;var _0x28f6c1=_0xdb1c[_0x2d2623];return _0x28f6c1;};'use strict';var Sequelize=require(_0xcdb1('0x0'));module[_0xcdb1('0x1')]={'type':{'type':Sequelize[_0xcdb1('0x2')](_0xcdb1('0x3'),_0xcdb1('0x4'),_0xcdb1('0x5'),_0xcdb1('0x6'),_0xcdb1('0x7')),'defaultValue':_0xcdb1('0x3')},'content':{'type':Sequelize[_0xcdb1('0x8')]},'key':{'type':Sequelize[_0xcdb1('0x8')]},'keyType':{'type':Sequelize[_0xcdb1('0x2')](_0xcdb1('0x3'),_0xcdb1('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xcdb1('0x8')]},'nameField':{'type':Sequelize[_0xcdb1('0x8')]},'customField':{'type':Sequelize[_0xcdb1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcdb1('0x8')]}}; \ No newline at end of file +var _0x16ad=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x16ad,0x16f));var _0xd16a=function(_0xc9bd6,_0x17ff7e){_0xc9bd6=_0xc9bd6-0x0;var _0x249978=_0x16ad[_0xc9bd6];return _0x249978;};'use strict';var Sequelize=require(_0xd16a('0x0'));module[_0xd16a('0x1')]={'type':{'type':Sequelize[_0xd16a('0x2')](_0xd16a('0x3'),_0xd16a('0x4'),_0xd16a('0x5'),'keyValue',_0xd16a('0x6')),'defaultValue':_0xd16a('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xd16a('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd16a('0x3'),_0xd16a('0x4'),_0xd16a('0x5'))},'keyContent':{'type':Sequelize[_0xd16a('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd16a('0x7')]},'customField':{'type':Sequelize[_0xd16a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 9b1be16..eea458c 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 _0x41cf=['catch','show','params','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ZohoField','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x41cf,0x126));var _0xf41c=function(_0x37e307,_0x378e6c){_0x37e307=_0x37e307-0x0;var _0x44a38c=_0x41cf[_0x37e307];return _0x44a38c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf41c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf41c('0x1'));var rp=require(_0xf41c('0x2'));var moment=require(_0xf41c('0x3'));var BPromise=require(_0xf41c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf41c('0x5'));var sox=require(_0xf41c('0x6'));var csv=require(_0xf41c('0x7'));var ejs=require(_0xf41c('0x8'));var fs=require('fs');var fs_extra=require(_0xf41c('0x9'));var _=require(_0xf41c('0xa'));var squel=require(_0xf41c('0xb'));var crypto=require(_0xf41c('0xc'));var jsforce=require(_0xf41c('0xd'));var deskjs=require(_0xf41c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf41c('0xf'));var Papa=require('papaparse');var Redis=require(_0xf41c('0x10'));var authService=require(_0xf41c('0x11'));var qs=require(_0xf41c('0x12'));var as=require(_0xf41c('0x13'));var hardwareService=require(_0xf41c('0x14'));var logger=require(_0xf41c('0x15'))(_0xf41c('0x16'));var utils=require(_0xf41c('0x17'));var config=require(_0xf41c('0x18'));var licenseUtil=require(_0xf41c('0x19'));var db=require(_0xf41c('0x1a'))['db'];function respondWithStatusCode(_0x3a6006,_0x4cad3e){_0x4cad3e=_0x4cad3e||0xcc;return function(_0x4f30dc){if(_0x4f30dc){return _0x3a6006[_0xf41c('0x1b')](_0x4cad3e);}return _0x3a6006[_0xf41c('0x1c')](_0x4cad3e)[_0xf41c('0x1d')]();};}function respondWithResult(_0x1c7d22,_0x2343bb){_0x2343bb=_0x2343bb||0xc8;return function(_0x48c9e0){if(_0x48c9e0){return _0x1c7d22[_0xf41c('0x1c')](_0x2343bb)['json'](_0x48c9e0);}};}function respondWithFilteredResult(_0x1cb146,_0x301122){return function(_0x1edb9d){if(_0x1edb9d){var _0x2ddaeb=typeof _0x301122[_0xf41c('0x1e')]===_0xf41c('0x1f')&&typeof _0x301122[_0xf41c('0x20')]===_0xf41c('0x1f');var _0x4bed38=_0x1edb9d['count'];var _0x924783=_0x2ddaeb?0x0:_0x301122[_0xf41c('0x1e')];var _0x445392=_0x2ddaeb?_0x1edb9d[_0xf41c('0x21')]:_0x301122[_0xf41c('0x1e')]+_0x301122['limit'];var _0xdb4ef3;if(_0x445392>=_0x4bed38){_0x445392=_0x4bed38;_0xdb4ef3=0xc8;}else{_0xdb4ef3=0xce;}_0x1cb146[_0xf41c('0x1c')](_0xdb4ef3);return _0x1cb146['set'](_0xf41c('0x22'),_0x924783+'-'+_0x445392+'/'+_0x4bed38)['json'](_0x1edb9d);}return null;};}function patchUpdates(_0x49548d){return function(_0x511535){try{jsonpatch[_0xf41c('0x23')](_0x511535,_0x49548d,!![]);}catch(_0x1697d1){return BPromise[_0xf41c('0x24')](_0x1697d1);}return _0x511535['save']();};}function saveUpdates(_0x22030a,_0x5afc49){return function(_0x1e51e7){if(_0x1e51e7){return _0x1e51e7[_0xf41c('0x25')](_0x22030a)[_0xf41c('0x26')](function(_0x4a54c7){return _0x4a54c7;});}return null;};}function removeEntity(_0x25f3ef,_0x3e7ada){return function(_0x1f5365){if(_0x1f5365){return _0x1f5365[_0xf41c('0x27')]()['then'](function(){_0x25f3ef[_0xf41c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x83a9d8,_0x2a50bb){return function(_0x33bad9){if(!_0x33bad9){_0x83a9d8[_0xf41c('0x1b')](0x194);}return _0x33bad9;};}function handleError(_0x1742d3,_0x4f778){_0x4f778=_0x4f778||0x1f4;return function(_0x39c887){logger[_0xf41c('0x28')](_0x39c887[_0xf41c('0x29')]);if(_0x39c887[_0xf41c('0x2a')]){delete _0x39c887[_0xf41c('0x2a')];}_0x1742d3['status'](_0x4f778)['send'](_0x39c887);};}exports[_0xf41c('0x2b')]=function(_0x33e437,_0x194b3c){var _0x4e1f42={},_0x32df4a={},_0x4ca27b={'count':0x0,'rows':[]};var _0x36d90d=_[_0xf41c('0x2c')](db[_0xf41c('0x2d')][_0xf41c('0x2e')],function(_0x40b087){return{'name':_0x40b087['fieldName'],'type':_0x40b087['type'][_0xf41c('0x2f')]};});_0x32df4a[_0xf41c('0x30')]=_[_0xf41c('0x2c')](_0x36d90d,_0xf41c('0x2a'));_0x32df4a['query']=_[_0xf41c('0x31')](_0x33e437[_0xf41c('0x32')]);_0x32df4a[_0xf41c('0x33')]=_[_0xf41c('0x34')](_0x32df4a[_0xf41c('0x30')],_0x32df4a[_0xf41c('0x32')]);_0x4e1f42[_0xf41c('0x35')]=_[_0xf41c('0x34')](_0x32df4a[_0xf41c('0x30')],qs[_0xf41c('0x36')](_0x33e437[_0xf41c('0x32')][_0xf41c('0x36')]));_0x4e1f42[_0xf41c('0x35')]=_0x4e1f42[_0xf41c('0x35')]['length']?_0x4e1f42[_0xf41c('0x35')]:_0x32df4a[_0xf41c('0x30')];if(!_0x33e437[_0xf41c('0x32')][_0xf41c('0x37')]('nolimit')){_0x4e1f42[_0xf41c('0x20')]=qs[_0xf41c('0x20')](_0x33e437[_0xf41c('0x32')][_0xf41c('0x20')]);_0x4e1f42[_0xf41c('0x1e')]=qs[_0xf41c('0x1e')](_0x33e437[_0xf41c('0x32')][_0xf41c('0x1e')]);}_0x4e1f42['order']=qs[_0xf41c('0x38')](_0x33e437[_0xf41c('0x32')][_0xf41c('0x38')]);_0x4e1f42[_0xf41c('0x39')]=qs['filters'](_['pick'](_0x33e437[_0xf41c('0x32')],_0x32df4a[_0xf41c('0x33')]),_0x36d90d);if(_0x33e437[_0xf41c('0x32')][_0xf41c('0x3a')]){_0x4e1f42[_0xf41c('0x39')]=_['merge'](_0x4e1f42[_0xf41c('0x39')],{'$or':_[_0xf41c('0x2c')](_0x36d90d,function(_0x50cf21){if(_0x50cf21[_0xf41c('0x3b')]!==_0xf41c('0x3c')){var _0x1099a0={};_0x1099a0[_0x50cf21[_0xf41c('0x2a')]]={'$like':'%'+_0x33e437[_0xf41c('0x32')]['filter']+'%'};return _0x1099a0;}})});}_0x4e1f42=_[_0xf41c('0x3d')]({},_0x4e1f42,_0x33e437[_0xf41c('0x3e')]);var _0x2dc083={'where':_0x4e1f42['where']};return db[_0xf41c('0x2d')][_0xf41c('0x21')](_0x2dc083)['then'](function(_0x1fdbe1){_0x4ca27b[_0xf41c('0x21')]=_0x1fdbe1;if(_0x33e437[_0xf41c('0x32')][_0xf41c('0x3f')]){_0x4e1f42[_0xf41c('0x40')]=[{'all':!![]}];}return db[_0xf41c('0x2d')][_0xf41c('0x41')](_0x4e1f42);})[_0xf41c('0x26')](function(_0x4af70a){_0x4ca27b['rows']=_0x4af70a;return _0x4ca27b;})[_0xf41c('0x26')](respondWithFilteredResult(_0x194b3c,_0x4e1f42))[_0xf41c('0x42')](handleError(_0x194b3c,null));};exports[_0xf41c('0x43')]=function(_0x5b4f02,_0x3dce3c){var _0xe988ea={'raw':!![],'where':{'id':_0x5b4f02[_0xf41c('0x44')]['id']}},_0x2c6130={};_0x2c6130[_0xf41c('0x30')]=_['keys'](db[_0xf41c('0x2d')][_0xf41c('0x2e')]);_0x2c6130[_0xf41c('0x32')]=_[_0xf41c('0x31')](_0x5b4f02[_0xf41c('0x32')]);_0x2c6130[_0xf41c('0x33')]=_[_0xf41c('0x34')](_0x2c6130[_0xf41c('0x30')],_0x2c6130[_0xf41c('0x32')]);_0xe988ea['attributes']=_[_0xf41c('0x34')](_0x2c6130[_0xf41c('0x30')],qs[_0xf41c('0x36')](_0x5b4f02[_0xf41c('0x32')]['fields']));_0xe988ea[_0xf41c('0x35')]=_0xe988ea[_0xf41c('0x35')]['length']?_0xe988ea[_0xf41c('0x35')]:_0x2c6130['model'];if(_0x5b4f02['query'][_0xf41c('0x3f')]){_0xe988ea[_0xf41c('0x40')]=[{'all':!![]}];}_0xe988ea=_[_0xf41c('0x3d')]({},_0xe988ea,_0x5b4f02[_0xf41c('0x3e')]);return db[_0xf41c('0x2d')]['find'](_0xe988ea)[_0xf41c('0x26')](handleEntityNotFound(_0x3dce3c,null))['then'](respondWithResult(_0x3dce3c,null))[_0xf41c('0x42')](handleError(_0x3dce3c,null));};exports[_0xf41c('0x45')]=function(_0x5dbe67,_0x29ea30){return db[_0xf41c('0x2d')][_0xf41c('0x45')](_0x5dbe67[_0xf41c('0x46')],{})['then'](respondWithResult(_0x29ea30,0xc9))[_0xf41c('0x42')](handleError(_0x29ea30,null));};exports[_0xf41c('0x25')]=function(_0x4bc564,_0x2260b3){if(_0x4bc564[_0xf41c('0x46')]['id']){delete _0x4bc564['body']['id'];}return db[_0xf41c('0x2d')][_0xf41c('0x47')]({'where':{'id':_0x4bc564['params']['id']}})[_0xf41c('0x26')](handleEntityNotFound(_0x2260b3,null))[_0xf41c('0x26')](saveUpdates(_0x4bc564[_0xf41c('0x46')],null))['then'](respondWithResult(_0x2260b3,null))[_0xf41c('0x42')](handleError(_0x2260b3,null));};exports['destroy']=function(_0x142a09,_0x5cde9a){return db[_0xf41c('0x2d')][_0xf41c('0x47')]({'where':{'id':_0x142a09[_0xf41c('0x44')]['id']}})[_0xf41c('0x26')](handleEntityNotFound(_0x5cde9a,null))[_0xf41c('0x26')](removeEntity(_0x5cde9a,null))[_0xf41c('0x42')](handleError(_0x5cde9a,null));}; \ No newline at end of file +var _0x41d5=['Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','ZohoField','includeAll','include','findAll','rows','catch','show','params','keys','length','create','body','update','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x276468,_0x29685a){var _0x36dc3a=function(_0x291f0a){while(--_0x291f0a){_0x276468['push'](_0x276468['shift']());}};_0x36dc3a(++_0x29685a);}(_0x41d5,0x7e));var _0x541d=function(_0x39eff0,_0xd9ff6b){_0x39eff0=_0x39eff0-0x0;var _0x18a78d=_0x41d5[_0x39eff0];return _0x18a78d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x541d('0x0'));var jsonpatch=require(_0x541d('0x1'));var rp=require(_0x541d('0x2'));var moment=require(_0x541d('0x3'));var BPromise=require(_0x541d('0x4'));var Mustache=require(_0x541d('0x5'));var util=require(_0x541d('0x6'));var path=require(_0x541d('0x7'));var sox=require(_0x541d('0x8'));var csv=require(_0x541d('0x9'));var ejs=require(_0x541d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x541d('0xb'));var squel=require(_0x541d('0xc'));var crypto=require(_0x541d('0xd'));var jsforce=require(_0x541d('0xe'));var deskjs=require(_0x541d('0xf'));var toCsv=require(_0x541d('0x9'));var querystring=require(_0x541d('0x10'));var Papa=require(_0x541d('0x11'));var Redis=require(_0x541d('0x12'));var authService=require(_0x541d('0x13'));var qs=require(_0x541d('0x14'));var as=require(_0x541d('0x15'));var hardwareService=require(_0x541d('0x16'));var logger=require('../../config/logger')(_0x541d('0x17'));var utils=require(_0x541d('0x18'));var config=require(_0x541d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x541d('0x1a'))['db'];function respondWithStatusCode(_0x45e862,_0x4bbbf0){_0x4bbbf0=_0x4bbbf0||0xcc;return function(_0x41be0b){if(_0x41be0b){return _0x45e862[_0x541d('0x1b')](_0x4bbbf0);}return _0x45e862[_0x541d('0x1c')](_0x4bbbf0)[_0x541d('0x1d')]();};}function respondWithResult(_0x145952,_0x6ed7f){_0x6ed7f=_0x6ed7f||0xc8;return function(_0x19909f){if(_0x19909f){return _0x145952[_0x541d('0x1c')](_0x6ed7f)[_0x541d('0x1e')](_0x19909f);}};}function respondWithFilteredResult(_0x1b9e2b,_0x49bb56){return function(_0x2f73a2){if(_0x2f73a2){var _0x1e05b7=typeof _0x49bb56['offset']===_0x541d('0x1f')&&typeof _0x49bb56[_0x541d('0x20')]===_0x541d('0x1f');var _0x361353=_0x2f73a2[_0x541d('0x21')];var _0x282789=_0x1e05b7?0x0:_0x49bb56['offset'];var _0x4f3675=_0x1e05b7?_0x2f73a2[_0x541d('0x21')]:_0x49bb56[_0x541d('0x22')]+_0x49bb56[_0x541d('0x20')];var _0x127a0c;if(_0x4f3675>=_0x361353){_0x4f3675=_0x361353;_0x127a0c=0xc8;}else{_0x127a0c=0xce;}_0x1b9e2b[_0x541d('0x1c')](_0x127a0c);return _0x1b9e2b[_0x541d('0x23')](_0x541d('0x24'),_0x282789+'-'+_0x4f3675+'/'+_0x361353)['json'](_0x2f73a2);}return null;};}function patchUpdates(_0x20155d){return function(_0x1ad78c){try{jsonpatch['apply'](_0x1ad78c,_0x20155d,!![]);}catch(_0x5c39bb){return BPromise[_0x541d('0x25')](_0x5c39bb);}return _0x1ad78c[_0x541d('0x26')]();};}function saveUpdates(_0x40457c,_0x84d3cf){return function(_0x5b9bbc){if(_0x5b9bbc){return _0x5b9bbc['update'](_0x40457c)[_0x541d('0x27')](function(_0x49e607){return _0x49e607;});}return null;};}function removeEntity(_0x3ab97d,_0x5ef9d7){return function(_0x9c2fe){if(_0x9c2fe){return _0x9c2fe[_0x541d('0x28')]()[_0x541d('0x27')](function(){_0x3ab97d[_0x541d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c471,_0x4a3ee6){return function(_0x1e953f){if(!_0x1e953f){_0x33c471[_0x541d('0x1b')](0x194);}return _0x1e953f;};}function handleError(_0x40ac4d,_0x593bca){_0x593bca=_0x593bca||0x1f4;return function(_0x2d9a7c){logger[_0x541d('0x29')](_0x2d9a7c[_0x541d('0x2a')]);if(_0x2d9a7c['name']){delete _0x2d9a7c[_0x541d('0x2b')];}_0x40ac4d[_0x541d('0x1c')](_0x593bca)[_0x541d('0x2c')](_0x2d9a7c);};}exports[_0x541d('0x2d')]=function(_0x39f559,_0x266865){var _0x18ca98={},_0xdd030c={},_0x2edfe6={'count':0x0,'rows':[]};var _0x119e2a=_[_0x541d('0x2e')](db['ZohoField'][_0x541d('0x2f')],function(_0x2aa9d9){return{'name':_0x2aa9d9[_0x541d('0x30')],'type':_0x2aa9d9[_0x541d('0x31')][_0x541d('0x32')]};});_0xdd030c[_0x541d('0x33')]=_['map'](_0x119e2a,'name');_0xdd030c[_0x541d('0x34')]=_['keys'](_0x39f559['query']);_0xdd030c['filters']=_['intersection'](_0xdd030c['model'],_0xdd030c[_0x541d('0x34')]);_0x18ca98['attributes']=_[_0x541d('0x35')](_0xdd030c['model'],qs[_0x541d('0x36')](_0x39f559[_0x541d('0x34')][_0x541d('0x36')]));_0x18ca98[_0x541d('0x37')]=_0x18ca98[_0x541d('0x37')]['length']?_0x18ca98[_0x541d('0x37')]:_0xdd030c[_0x541d('0x33')];if(!_0x39f559[_0x541d('0x34')][_0x541d('0x38')](_0x541d('0x39'))){_0x18ca98[_0x541d('0x20')]=qs['limit'](_0x39f559['query'][_0x541d('0x20')]);_0x18ca98['offset']=qs[_0x541d('0x22')](_0x39f559[_0x541d('0x34')]['offset']);}_0x18ca98[_0x541d('0x3a')]=qs['sort'](_0x39f559[_0x541d('0x34')][_0x541d('0x3b')]);_0x18ca98[_0x541d('0x3c')]=qs['filters'](_[_0x541d('0x3d')](_0x39f559[_0x541d('0x34')],_0xdd030c[_0x541d('0x3e')]),_0x119e2a);if(_0x39f559[_0x541d('0x34')][_0x541d('0x3f')]){_0x18ca98[_0x541d('0x3c')]=_[_0x541d('0x40')](_0x18ca98[_0x541d('0x3c')],{'$or':_[_0x541d('0x2e')](_0x119e2a,function(_0x2265d3){if(_0x2265d3['type']!==_0x541d('0x41')){var _0x2e516a={};_0x2e516a[_0x2265d3[_0x541d('0x2b')]]={'$like':'%'+_0x39f559[_0x541d('0x34')][_0x541d('0x3f')]+'%'};return _0x2e516a;}})});}_0x18ca98=_['merge']({},_0x18ca98,_0x39f559[_0x541d('0x42')]);var _0x475b4b={'where':_0x18ca98[_0x541d('0x3c')]};return db[_0x541d('0x43')]['count'](_0x475b4b)[_0x541d('0x27')](function(_0x441409){_0x2edfe6[_0x541d('0x21')]=_0x441409;if(_0x39f559[_0x541d('0x34')][_0x541d('0x44')]){_0x18ca98[_0x541d('0x45')]=[{'all':!![]}];}return db['ZohoField'][_0x541d('0x46')](_0x18ca98);})[_0x541d('0x27')](function(_0x116e10){_0x2edfe6[_0x541d('0x47')]=_0x116e10;return _0x2edfe6;})['then'](respondWithFilteredResult(_0x266865,_0x18ca98))[_0x541d('0x48')](handleError(_0x266865,null));};exports[_0x541d('0x49')]=function(_0x3981e3,_0x18c2dc){var _0x219db8={'raw':!![],'where':{'id':_0x3981e3[_0x541d('0x4a')]['id']}},_0x4314f9={};_0x4314f9[_0x541d('0x33')]=_[_0x541d('0x4b')](db[_0x541d('0x43')][_0x541d('0x2f')]);_0x4314f9['query']=_[_0x541d('0x4b')](_0x3981e3[_0x541d('0x34')]);_0x4314f9[_0x541d('0x3e')]=_[_0x541d('0x35')](_0x4314f9['model'],_0x4314f9[_0x541d('0x34')]);_0x219db8['attributes']=_[_0x541d('0x35')](_0x4314f9['model'],qs[_0x541d('0x36')](_0x3981e3[_0x541d('0x34')][_0x541d('0x36')]));_0x219db8[_0x541d('0x37')]=_0x219db8[_0x541d('0x37')][_0x541d('0x4c')]?_0x219db8[_0x541d('0x37')]:_0x4314f9['model'];if(_0x3981e3['query'][_0x541d('0x44')]){_0x219db8[_0x541d('0x45')]=[{'all':!![]}];}_0x219db8=_[_0x541d('0x40')]({},_0x219db8,_0x3981e3[_0x541d('0x42')]);return db[_0x541d('0x43')]['find'](_0x219db8)['then'](handleEntityNotFound(_0x18c2dc,null))['then'](respondWithResult(_0x18c2dc,null))[_0x541d('0x48')](handleError(_0x18c2dc,null));};exports[_0x541d('0x4d')]=function(_0x47e5e8,_0x25a8cc){return db['ZohoField'][_0x541d('0x4d')](_0x47e5e8[_0x541d('0x4e')],{})[_0x541d('0x27')](respondWithResult(_0x25a8cc,0xc9))[_0x541d('0x48')](handleError(_0x25a8cc,null));};exports[_0x541d('0x4f')]=function(_0x3c448c,_0x3a296c){if(_0x3c448c[_0x541d('0x4e')]['id']){delete _0x3c448c['body']['id'];}return db[_0x541d('0x43')][_0x541d('0x50')]({'where':{'id':_0x3c448c[_0x541d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3a296c,null))[_0x541d('0x27')](saveUpdates(_0x3c448c[_0x541d('0x4e')],null))[_0x541d('0x27')](respondWithResult(_0x3a296c,null))[_0x541d('0x48')](handleError(_0x3a296c,null));};exports['destroy']=function(_0x59325d,_0x372125){return db[_0x541d('0x43')][_0x541d('0x50')]({'where':{'id':_0x59325d[_0x541d('0x4a')]['id']}})[_0x541d('0x27')](handleEntityNotFound(_0x372125,null))[_0x541d('0x27')](removeEntity(_0x372125,null))[_0x541d('0x48')](handleError(_0x372125,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index fb87174..452d508 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 _0x7278=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x4c6d42,_0x3a7455){var _0x5538c9=function(_0xaeafa3){while(--_0xaeafa3){_0x4c6d42['push'](_0x4c6d42['shift']());}};_0x5538c9(++_0x3a7455);}(_0x7278,0x161));var _0x8727=function(_0xdad064,_0x356de5){_0xdad064=_0xdad064-0x0;var _0x50b1cf=_0x7278[_0xdad064];return _0x50b1cf;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[{'name':_0x8727('0xe'),'fields':[_0x8727('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7046=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','exports','ZohoField','idField'];(function(_0x2827b2,_0x5d6792){var _0x324a49=function(_0x513f8b){while(--_0x513f8b){_0x2827b2['push'](_0x2827b2['shift']());}};_0x324a49(++_0x5d6792);}(_0x7046,0x144));var _0x6704=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7046[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x6704('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 6a8f578..42653f6 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 _0xf4c2=['jayson/promise','client','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0xf4c2,0x175));var _0x2f4c=function(_0x201e33,_0x36815b){_0x201e33=_0x201e33-0x0;var _0x37b4be=_0xf4c2[_0x201e33];return _0x37b4be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2f4c('0x0'));var BPromise=require(_0x2f4c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f4c('0x2'));var db=require(_0x2f4c('0x3'))['db'];var utils=require(_0x2f4c('0x4'));var logger=require(_0x2f4c('0x5'))(_0x2f4c('0x6'));var config=require('../../config/environment');var jayson=require(_0x2f4c('0x7'));var client=jayson[_0x2f4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x294ddf,_0x3709d1,_0x1d195a){return new BPromise(function(_0x5ab7dd,_0x556103){return client['request'](_0x294ddf,_0x1d195a)[_0x2f4c('0x9')](function(_0x262414){logger[_0x2f4c('0xa')](_0x2f4c('0xb'),_0x3709d1,_0x2f4c('0xc'));logger['debug'](_0x2f4c('0xd'),_0x3709d1,'request\x20sent',JSON[_0x2f4c('0xe')](_0x262414));if(_0x262414[_0x2f4c('0xf')]){if(_0x262414[_0x2f4c('0xf')][_0x2f4c('0x10')]===0x1f4){logger[_0x2f4c('0xf')]('ZohoField,\x20%s,\x20%s',_0x3709d1,_0x262414[_0x2f4c('0xf')][_0x2f4c('0x11')]);return _0x556103(_0x262414['error'][_0x2f4c('0x11')]);}logger[_0x2f4c('0xf')](_0x2f4c('0xb'),_0x3709d1,_0x262414[_0x2f4c('0xf')][_0x2f4c('0x11')]);return _0x5ab7dd(_0x262414['error'][_0x2f4c('0x11')]);}else{logger['info'](_0x2f4c('0xb'),_0x3709d1,_0x2f4c('0xc'));_0x5ab7dd(_0x262414[_0x2f4c('0x12')][_0x2f4c('0x11')]);}})[_0x2f4c('0x13')](function(_0x4b05e9){logger[_0x2f4c('0xf')](_0x2f4c('0xb'),_0x3709d1,_0x4b05e9);_0x556103(_0x4b05e9);});});} \ No newline at end of file +var _0xfdff=['rpc','request','then','info','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils'];(function(_0xaa6983,_0x5bc2f2){var _0x880b29=function(_0x3db859){while(--_0x3db859){_0xaa6983['push'](_0xaa6983['shift']());}};_0x880b29(++_0x5bc2f2);}(_0xfdff,0xf7));var _0xffdf=function(_0x455ee0,_0x1c6b3f){_0x455ee0=_0x455ee0-0x0;var _0x1602ab=_0xfdff[_0x455ee0];return _0x1602ab;};'use strict';var _=require(_0xffdf('0x0'));var util=require(_0xffdf('0x1'));var moment=require('moment');var BPromise=require(_0xffdf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xffdf('0x3'))['db'];var utils=require(_0xffdf('0x4'));var logger=require('../../config/logger')(_0xffdf('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x30b1ef,_0x10c87c,_0x4d173f){return new BPromise(function(_0x2671da,_0xd2b7c4){return client[_0xffdf('0x6')](_0x30b1ef,_0x4d173f)[_0xffdf('0x7')](function(_0x5f498e){logger[_0xffdf('0x8')]('ZohoField,\x20%s,\x20%s',_0x10c87c,'request\x20sent');logger['debug'](_0xffdf('0x9'),_0x10c87c,_0xffdf('0xa'),JSON[_0xffdf('0xb')](_0x5f498e));if(_0x5f498e[_0xffdf('0xc')]){if(_0x5f498e[_0xffdf('0xc')][_0xffdf('0xd')]===0x1f4){logger[_0xffdf('0xc')](_0xffdf('0xe'),_0x10c87c,_0x5f498e[_0xffdf('0xc')][_0xffdf('0xf')]);return _0xd2b7c4(_0x5f498e[_0xffdf('0xc')][_0xffdf('0xf')]);}logger['error'](_0xffdf('0xe'),_0x10c87c,_0x5f498e['error'][_0xffdf('0xf')]);return _0x2671da(_0x5f498e[_0xffdf('0xc')][_0xffdf('0xf')]);}else{logger[_0xffdf('0x8')](_0xffdf('0xe'),_0x10c87c,_0xffdf('0xa'));_0x2671da(_0x5f498e[_0xffdf('0x10')]['message']);}})[_0xffdf('0x11')](function(_0xfb4b4a){logger[_0xffdf('0xc')](_0xffdf('0xe'),_0x10c87c,_0xfb4b4a);_0xd2b7c4(_0xfb4b4a);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7e8d0fd..e17e5a1 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(_0x274ca3,_0x41c102){var _0xca93ba=function(_0x8f17fa){while(--_0x8f17fa){_0x274ca3['push'](_0x274ca3['shift']());}};_0xca93ba(++_0x41c102);}(_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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x55e324,_0x2ff827){var _0x372a3a=function(_0x9558f2){while(--_0x9558f2){_0x55e324['push'](_0x55e324['shift']());}};_0x372a3a(++_0x2ff827);}(_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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 09a3672..cfa44c3 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 _0x004d=['app.js','BOOLEAN','exports','unique_name_and_version','STRING'];(function(_0x2d556b,_0x4c792f){var _0x272b6c=function(_0x3b6497){while(--_0x3b6497){_0x2d556b['push'](_0x2d556b['shift']());}};_0x272b6c(++_0x4c792f);}(_0x004d,0x183));var _0xd004=function(_0x44db91,_0x51a388){_0x44db91=_0x44db91-0x0;var _0x3e48e6=_0x004d[_0x44db91];return _0x3e48e6;};'use strict';var Sequelize=require('sequelize');module[_0xd004('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd004('0x1')},'version':{'type':Sequelize[_0xd004('0x2')],'allowNull':![],'unique':_0xd004('0x1')},'main':{'type':Sequelize[_0xd004('0x2')],'defaultValue':_0xd004('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xd004('0x2')]},'type':{'type':Sequelize[_0xd004('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xd004('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xd004('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xd004('0x2')]},'title':{'type':Sequelize[_0xd004('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd004('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x12ae=['app.js','BOOLEAN','state','exports','STRING'];(function(_0x2ce6f4,_0x4165fb){var _0x7101f1=function(_0x2e19a0){while(--_0x2e19a0){_0x2ce6f4['push'](_0x2ce6f4['shift']());}};_0x7101f1(++_0x4165fb);}(_0x12ae,0x175));var _0xe12a=function(_0x50ab02,_0x564d80){_0x50ab02=_0x50ab02-0x0;var _0x183aee=_0x12ae[_0x50ab02];return _0x183aee;};'use strict';var Sequelize=require('sequelize');module[_0xe12a('0x0')]={'name':{'type':Sequelize[_0xe12a('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xe12a('0x1')],'defaultValue':_0xe12a('0x2')},'filename':{'type':Sequelize[_0xe12a('0x1')]},'path':{'type':Sequelize[_0xe12a('0x1')]},'type':{'type':Sequelize[_0xe12a('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xe12a('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0xe12a('0x1')]},'logo':{'type':Sequelize[_0xe12a('0x1')]},'state':{'type':Sequelize[_0xe12a('0x1')],'unique':_0xe12a('0x4')},'description':{'type':Sequelize[_0xe12a('0x1')]},'title':{'type':Sequelize[_0xe12a('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 133650f..e2d08eb 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 _0xd117=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','update','body','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','Integration','fieldName','type','map','keys','query','filters','model','intersection','fields','attributes','length'];(function(_0x3a4076,_0x327b21){var _0x2126f3=function(_0x5c95a4){while(--_0x5c95a4){_0x3a4076['push'](_0x3a4076['shift']());}};_0x2126f3(++_0x327b21);}(_0xd117,0x182));var _0x7d11=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0xd117[_0x55d7c2];return _0x1755ef;};'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['Integration'][_0x7d11('0x45')]({'where':{'id':_0x29207f[_0x7d11('0x42')]['id']}})[_0x7d11('0x22')](handleEntityNotFound(_0x553a03,null))['then'](removeEntity(_0x553a03,null))['catch'](handleError(_0x553a03,null));}; \ No newline at end of file +var _0xb016=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','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','apply','reject','save','then','destroy','end','error','name','send','index','map','Integration','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body'];(function(_0x1f1711,_0x659f97){var _0x4b1687=function(_0x506937){while(--_0x506937){_0x1f1711['push'](_0x1f1711['shift']());}};_0x4b1687(++_0x659f97);}(_0xb016,0x159));var _0x6b01=function(_0x336280,_0x12d397){_0x336280=_0x336280-0x0;var _0x322646=_0xb016[_0x336280];return _0x322646;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['Integration'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 5ffd52b..ace04b8 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 _0xc552=['exports','define','Integration','integrations','lodash','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0x58e774,_0xb20522){var _0x45f308=function(_0x4d94f3){while(--_0x4d94f3){_0x58e774['push'](_0x58e774['shift']());}};_0x45f308(++_0xb20522);}(_0xc552,0x124));var _0x2c55=function(_0x481ff7,_0x2b6ebb){_0x481ff7=_0x481ff7-0x0;var _0x1c1573=_0xc552[_0x481ff7];return _0x1c1573;};'use strict';var _=require(_0x2c55('0x0'));var util=require('util');var logger=require(_0x2c55('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2c55('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2c55('0x3'));var config=require(_0x2c55('0x4'));var attributes=require('./integration.attributes');module[_0x2c55('0x5')]=function(_0x24cb77,_0x965de6){return _0x24cb77[_0x2c55('0x6')](_0x2c55('0x7'),attributes,{'tableName':_0x2c55('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5482=['moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','lodash','../../config/logger','api'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x5482,0xe1));var _0x2548=function(_0x19a562,_0x4b669f){_0x19a562=_0x19a562-0x0;var _0x3bd3f3=_0x5482[_0x19a562];return _0x3bd3f3;};'use strict';var _=require(_0x2548('0x0'));var util=require('util');var logger=require(_0x2548('0x1'))(_0x2548('0x2'));var moment=require(_0x2548('0x3'));var BPromise=require(_0x2548('0x4'));var rp=require(_0x2548('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2548('0x6'));var config=require(_0x2548('0x7'));var attributes=require(_0x2548('0x8'));module[_0x2548('0x9')]=function(_0x20eadd,_0x3434d1){return _0x20eadd[_0x2548('0xa')](_0x2548('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 0e5d748..dcbc391 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x524e,0x15e));var _0xe524=function(_0x5de2db,_0x2bdded){_0x5de2db=_0x5de2db-0x0;var _0x44eb6f=_0x524e[_0x5de2db];return _0x44eb6f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file +var _0x524e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird'];(function(_0x43b08,_0x15f967){var _0x5e05f4=function(_0x4bb0cb){while(--_0x4bb0cb){_0x43b08['push'](_0x43b08['shift']());}};_0x5e05f4(++_0x15f967);}(_0x524e,0x15e));var _0xe524=function(_0x133128,_0x2bec6d){_0x133128=_0x133128-0x0;var _0x21894f=_0x524e[_0x133128];return _0x21894f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('Integration,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('Integration,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('Integration,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index a3a8308..c6fb46a 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 _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xda2d,0x102));var _0xdda2=function(_0x2af3e9,_0x29a97e){_0x2af3e9=_0x2af3e9-0x0;var _0x16a5aa=_0xda2d[_0x2af3e9];return _0x16a5aa;};'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('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5f66=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','create','put','update','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'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('./integrationReport.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['show']);router['post']('/',auth[_0x65f6('0x8')](),controller[_0x65f6('0xc')]);router[_0x65f6('0xd')](_0x65f6('0xb'),auth['isAuthenticated'](),controller[_0x65f6('0xe')]);router['delete']('/:id',auth[_0x65f6('0x8')](),controller['destroy']);module[_0x65f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index bdf8936..c192e04 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 _0xa4fd=['ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x3f8054,_0x2be309){var _0xeb2904=function(_0xfbeac2){while(--_0xfbeac2){_0x3f8054['push'](_0x3f8054['shift']());}};_0xeb2904(++_0x2be309);}(_0xa4fd,0x185));var _0xda4f=function(_0x247a75,_0x3ca769){_0x247a75=_0x247a75-0x0;var _0x82541f=_0xa4fd[_0x247a75];return _0x82541f;};'use strict';var Sequelize=require(_0xda4f('0x0'));module[_0xda4f('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xda4f('0x2')]},'exitStatus':{'type':Sequelize[_0xda4f('0x2')]},'ticketId':{'type':Sequelize[_0xda4f('0x2')]},'integrationId':{'type':Sequelize[_0xda4f('0x3')]},'contacts':{'type':Sequelize[_0xda4f('0x2')]},'uniqueid':{'type':Sequelize[_0xda4f('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xda4f('0x2')]},'queue':{'type':Sequelize[_0xda4f('0x2')]},'interface':{'type':Sequelize[_0xda4f('0x2')]},'membername':{'type':Sequelize[_0xda4f('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xda4f('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xda4f('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xda4f('0x4')]},'talktime':{'type':Sequelize[_0xda4f('0x3')]},'agentacw':{'type':Sequelize[_0xda4f('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xda4f('0x3')]},'reason':{'type':Sequelize[_0xda4f('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xda4f('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xda4f('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xda4f('0x2')]},'channel':{'type':Sequelize[_0xda4f('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xda4f('0x2')]},'connectedlinenum':{'type':Sequelize[_0xda4f('0x2')]},'connectedlinename':{'type':Sequelize[_0xda4f('0x2')]},'language':{'type':Sequelize[_0xda4f('0x2')]},'accountcode':{'type':Sequelize[_0xda4f('0x2')]},'context':{'type':Sequelize[_0xda4f('0x2')]},'exten':{'type':Sequelize[_0xda4f('0x2')]},'priority':{'type':Sequelize[_0xda4f('0x2')]},'destchannel':{'type':Sequelize[_0xda4f('0x2')]},'destchannelstate':{'type':Sequelize[_0xda4f('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xda4f('0x2')]},'destcalleridname':{'type':Sequelize[_0xda4f('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xda4f('0x2')]},'destlanguage':{'type':Sequelize[_0xda4f('0x2')]},'destaccountcode':{'type':Sequelize[_0xda4f('0x2')]},'destcontext':{'type':Sequelize[_0xda4f('0x2')]},'destexten':{'type':Sequelize[_0xda4f('0x2')]},'destpriority':{'type':Sequelize[_0xda4f('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xda4f('0x2')]},'from':{'type':Sequelize[_0xda4f('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xda4f('0x2')]},'attachment':{'type':Sequelize[_0xda4f('0x6')]},'html':{'type':Sequelize[_0xda4f('0x6')]},'text':{'type':Sequelize[_0xda4f('0x6')]},'status':{'type':Sequelize[_0xda4f('0x7')](_0xda4f('0x8'),_0xda4f('0x9'),_0xda4f('0xa'),_0xda4f('0xb'))},'url':{'type':Sequelize[_0xda4f('0x2')]},'app':{'type':Sequelize[_0xda4f('0x2')]},'appdata':{'type':Sequelize[_0xda4f('0x2')]},'projectId':{'type':Sequelize[_0xda4f('0x3')]}}; \ No newline at end of file +var _0x24a1=['INTEGER','BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','STRING','DATE'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x24a1,0x102));var _0x124a=function(_0x269c01,_0x302b4e){_0x269c01=_0x269c01-0x0;var _0x3c2a96=_0x24a1[_0x269c01];return _0x3c2a96;};'use strict';var Sequelize=require(_0x124a('0x0'));module['exports']={'integration':{'type':Sequelize[_0x124a('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x124a('0x1')]},'ticketId':{'type':Sequelize[_0x124a('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x124a('0x1')]},'uniqueid':{'type':Sequelize[_0x124a('0x1')]},'calleridnum':{'type':Sequelize[_0x124a('0x1')]},'calleridname':{'type':Sequelize[_0x124a('0x1')]},'queue':{'type':Sequelize[_0x124a('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x124a('0x1')]},'agentcalledAt':{'type':Sequelize[_0x124a('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x124a('0x3')]},'agentcomplete':{'type':Sequelize[_0x124a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x124a('0x2')]},'talktime':{'type':Sequelize[_0x124a('0x3')]},'agentacw':{'type':Sequelize[_0x124a('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x124a('0x3')]},'reason':{'type':Sequelize[_0x124a('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x124a('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x124a('0x2')]},'agentdump':{'type':Sequelize[_0x124a('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x124a('0x2')]},'lastevent':{'type':Sequelize[_0x124a('0x1')]},'channel':{'type':Sequelize[_0x124a('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x124a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x124a('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x124a('0x1')]},'accountcode':{'type':Sequelize[_0x124a('0x1')]},'context':{'type':Sequelize[_0x124a('0x1')]},'exten':{'type':Sequelize[_0x124a('0x1')]},'priority':{'type':Sequelize[_0x124a('0x1')]},'destchannel':{'type':Sequelize[_0x124a('0x1')]},'destchannelstate':{'type':Sequelize[_0x124a('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x124a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x124a('0x1')]},'destcalleridname':{'type':Sequelize[_0x124a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x124a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x124a('0x1')]},'destlanguage':{'type':Sequelize[_0x124a('0x1')]},'destaccountcode':{'type':Sequelize[_0x124a('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x124a('0x1')]},'destuniqueid':{'type':Sequelize[_0x124a('0x1')]},'messageId':{'type':Sequelize[_0x124a('0x1')]},'inReplyTo':{'type':Sequelize[_0x124a('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x124a('0x1')]},'to':{'type':Sequelize[_0x124a('0x1')]},'cc':{'type':Sequelize[_0x124a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x124a('0x5')]},'text':{'type':Sequelize[_0x124a('0x5')]},'status':{'type':Sequelize[_0x124a('0x6')](_0x124a('0x7'),'SENDING','RECEIVED',_0x124a('0x8'))},'url':{'type':Sequelize[_0x124a('0x1')]},'app':{'type':Sequelize[_0x124a('0x1')]},'appdata':{'type':Sequelize[_0x124a('0x1')]},'projectId':{'type':Sequelize[_0x124a('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index a15a934..3f97d08 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 _0x021f=['../../mysqldb','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','params','create','body','catch','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x434f68,_0x3098ae){var _0x53a899=function(_0x33de43){while(--_0x33de43){_0x434f68['push'](_0x434f68['shift']());}};_0x53a899(++_0x3098ae);}(_0x021f,0x193));var _0xf021=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x021f[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf021('0x0'));var jsonpatch=require(_0xf021('0x1'));var rp=require(_0xf021('0x2'));var moment=require(_0xf021('0x3'));var BPromise=require(_0xf021('0x4'));var Mustache=require(_0xf021('0x5'));var util=require('util');var path=require(_0xf021('0x6'));var sox=require(_0xf021('0x7'));var csv=require('to-csv');var ejs=require(_0xf021('0x8'));var fs=require('fs');var fs_extra=require(_0xf021('0x9'));var _=require(_0xf021('0xa'));var squel=require(_0xf021('0xb'));var crypto=require(_0xf021('0xc'));var jsforce=require(_0xf021('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf021('0xe'));var querystring=require('querystring');var Papa=require(_0xf021('0xf'));var Redis=require(_0xf021('0x10'));var authService=require(_0xf021('0x11'));var qs=require(_0xf021('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf021('0x13'));var logger=require('../../config/logger')(_0xf021('0x14'));var utils=require(_0xf021('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf021('0x16'));var db=require(_0xf021('0x17'))['db'];function respondWithStatusCode(_0x2e5a2f,_0x49b3ef){_0x49b3ef=_0x49b3ef||0xcc;return function(_0x1d530a){if(_0x1d530a){return _0x2e5a2f['sendStatus'](_0x49b3ef);}return _0x2e5a2f[_0xf021('0x18')](_0x49b3ef)[_0xf021('0x19')]();};}function respondWithResult(_0xa2b33b,_0x6d9863){_0x6d9863=_0x6d9863||0xc8;return function(_0x422367){if(_0x422367){return _0xa2b33b[_0xf021('0x18')](_0x6d9863)['json'](_0x422367);}};}function respondWithFilteredResult(_0x4fa2b6,_0x48ef6b){return function(_0x1c06b7){if(_0x1c06b7){var _0x2c64a4=typeof _0x48ef6b[_0xf021('0x1a')]==='undefined'&&typeof _0x48ef6b['limit']===_0xf021('0x1b');var _0x40563b=_0x1c06b7[_0xf021('0x1c')];var _0x4dcb31=_0x2c64a4?0x0:_0x48ef6b[_0xf021('0x1a')];var _0x25715f=_0x2c64a4?_0x1c06b7['count']:_0x48ef6b['offset']+_0x48ef6b['limit'];var _0x16395b;if(_0x25715f>=_0x40563b){_0x25715f=_0x40563b;_0x16395b=0xc8;}else{_0x16395b=0xce;}_0x4fa2b6[_0xf021('0x18')](_0x16395b);return _0x4fa2b6['set'](_0xf021('0x1d'),_0x4dcb31+'-'+_0x25715f+'/'+_0x40563b)[_0xf021('0x1e')](_0x1c06b7);}return null;};}function patchUpdates(_0x2ef923){return function(_0xf3df75){try{jsonpatch[_0xf021('0x1f')](_0xf3df75,_0x2ef923,!![]);}catch(_0x1a265a){return BPromise[_0xf021('0x20')](_0x1a265a);}return _0xf3df75[_0xf021('0x21')]();};}function saveUpdates(_0x10bdd1,_0x45b72c){return function(_0x587675){if(_0x587675){return _0x587675[_0xf021('0x22')](_0x10bdd1)[_0xf021('0x23')](function(_0x35c328){return _0x35c328;});}return null;};}function removeEntity(_0x1db948,_0x2f10eb){return function(_0x11add2){if(_0x11add2){return _0x11add2[_0xf021('0x24')]()[_0xf021('0x23')](function(){_0x1db948['status'](0xcc)[_0xf021('0x19')]();});}};}function handleEntityNotFound(_0x4e90a6,_0x184dd2){return function(_0xcb7aa){if(!_0xcb7aa){_0x4e90a6['sendStatus'](0x194);}return _0xcb7aa;};}function handleError(_0x5f03a8,_0x5d1e43){_0x5d1e43=_0x5d1e43||0x1f4;return function(_0x18567c){logger[_0xf021('0x25')](_0x18567c['stack']);if(_0x18567c[_0xf021('0x26')]){delete _0x18567c[_0xf021('0x26')];}_0x5f03a8['status'](_0x5d1e43)['send'](_0x18567c);};}exports[_0xf021('0x27')]=function(_0x3b2951,_0x46bcd2){var _0xf41d4f={},_0x53470d={},_0x46c464={'count':0x0,'rows':[]};var _0x1d42e2=_[_0xf021('0x28')](db[_0xf021('0x29')][_0xf021('0x2a')],function(_0xd33aaf){return{'name':_0xd33aaf[_0xf021('0x2b')],'type':_0xd33aaf[_0xf021('0x2c')][_0xf021('0x2d')]};});_0x53470d[_0xf021('0x2e')]=_['map'](_0x1d42e2,_0xf021('0x26'));_0x53470d['query']=_[_0xf021('0x2f')](_0x3b2951[_0xf021('0x30')]);_0x53470d[_0xf021('0x31')]=_['intersection'](_0x53470d[_0xf021('0x2e')],_0x53470d[_0xf021('0x30')]);_0xf41d4f[_0xf021('0x32')]=_[_0xf021('0x33')](_0x53470d[_0xf021('0x2e')],qs['fields'](_0x3b2951[_0xf021('0x30')][_0xf021('0x34')]));_0xf41d4f[_0xf021('0x32')]=_0xf41d4f[_0xf021('0x32')][_0xf021('0x35')]?_0xf41d4f[_0xf021('0x32')]:_0x53470d[_0xf021('0x2e')];if(!_0x3b2951[_0xf021('0x30')][_0xf021('0x36')](_0xf021('0x37'))){_0xf41d4f[_0xf021('0x38')]=qs[_0xf021('0x38')](_0x3b2951['query']['limit']);_0xf41d4f[_0xf021('0x1a')]=qs[_0xf021('0x1a')](_0x3b2951[_0xf021('0x30')][_0xf021('0x1a')]);}_0xf41d4f[_0xf021('0x39')]=qs[_0xf021('0x3a')](_0x3b2951[_0xf021('0x30')]['sort']);_0xf41d4f[_0xf021('0x3b')]=qs[_0xf021('0x31')](_['pick'](_0x3b2951[_0xf021('0x30')],_0x53470d[_0xf021('0x31')]),_0x1d42e2);if(_0x3b2951['query'][_0xf021('0x3c')]){_0xf41d4f[_0xf021('0x3b')]=_[_0xf021('0x3d')](_0xf41d4f['where'],{'$or':_[_0xf021('0x28')](_0x1d42e2,function(_0x5291e0){if(_0x5291e0[_0xf021('0x2c')]!==_0xf021('0x3e')){var _0x3f4905={};_0x3f4905[_0x5291e0[_0xf021('0x26')]]={'$like':'%'+_0x3b2951[_0xf021('0x30')]['filter']+'%'};return _0x3f4905;}})});}_0xf41d4f=_[_0xf021('0x3d')]({},_0xf41d4f,_0x3b2951[_0xf021('0x3f')]);var _0x371d47={'where':_0xf41d4f['where']};return db['IntegrationReport']['count'](_0x371d47)['then'](function(_0x17b3c2){_0x46c464[_0xf021('0x1c')]=_0x17b3c2;if(_0x3b2951[_0xf021('0x30')]['includeAll']){_0xf41d4f[_0xf021('0x40')]=[{'all':!![]}];}return db['IntegrationReport'][_0xf021('0x41')](_0xf41d4f);})[_0xf021('0x23')](function(_0x433cfb){_0x46c464['rows']=_0x433cfb;return _0x46c464;})[_0xf021('0x23')](respondWithFilteredResult(_0x46bcd2,_0xf41d4f))['catch'](handleError(_0x46bcd2,null));};exports['show']=function(_0x4fa3af,_0x5cd547){var _0x4b1b55={'raw':![],'where':{'id':_0x4fa3af[_0xf021('0x42')]['id']}},_0x457327={};_0x457327['model']=_[_0xf021('0x2f')](db[_0xf021('0x29')]['rawAttributes']);_0x457327[_0xf021('0x30')]=_['keys'](_0x4fa3af[_0xf021('0x30')]);_0x457327[_0xf021('0x31')]=_['intersection'](_0x457327[_0xf021('0x2e')],_0x457327[_0xf021('0x30')]);_0x4b1b55[_0xf021('0x32')]=_[_0xf021('0x33')](_0x457327[_0xf021('0x2e')],qs[_0xf021('0x34')](_0x4fa3af['query'][_0xf021('0x34')]));_0x4b1b55[_0xf021('0x32')]=_0x4b1b55[_0xf021('0x32')][_0xf021('0x35')]?_0x4b1b55[_0xf021('0x32')]:_0x457327[_0xf021('0x2e')];if(_0x4fa3af[_0xf021('0x30')]['includeAll']){_0x4b1b55[_0xf021('0x40')]=[{'all':!![]}];}_0x4b1b55=_['merge']({},_0x4b1b55,_0x4fa3af[_0xf021('0x3f')]);return db[_0xf021('0x29')]['find'](_0x4b1b55)['then'](handleEntityNotFound(_0x5cd547,null))[_0xf021('0x23')](respondWithResult(_0x5cd547,null))['catch'](handleError(_0x5cd547,null));};exports[_0xf021('0x43')]=function(_0x2cea53,_0x26d03a){return db[_0xf021('0x29')]['create'](_0x2cea53[_0xf021('0x44')],{})[_0xf021('0x23')](respondWithResult(_0x26d03a,0xc9))[_0xf021('0x45')](handleError(_0x26d03a,null));};exports[_0xf021('0x22')]=function(_0x49acaa,_0x4d44f0){if(_0x49acaa[_0xf021('0x44')]['id']){delete _0x49acaa['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x49acaa[_0xf021('0x42')]['id']}})[_0xf021('0x23')](handleEntityNotFound(_0x4d44f0,null))['then'](saveUpdates(_0x49acaa[_0xf021('0x44')],null))[_0xf021('0x23')](respondWithResult(_0x4d44f0,null))['catch'](handleError(_0x4d44f0,null));};exports[_0xf021('0x24')]=function(_0x1b1aa5,_0x291cb3){return db[_0xf021('0x29')]['find']({'where':{'id':_0x1b1aa5[_0xf021('0x42')]['id']}})[_0xf021('0x23')](handleEntityNotFound(_0x291cb3,null))[_0xf021('0x23')](removeEntity(_0x291cb3,null))['catch'](handleError(_0x291cb3,null));};exports[_0xf021('0x46')]=function(_0x495274,_0x67773c){return db[_0xf021('0x29')][_0xf021('0x46')]()['then'](respondWithResult(_0x67773c,null))[_0xf021('0x45')](handleError(_0x67773c,null));}; \ No newline at end of file +var _0xc4bc=['desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','IntegrationReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','update','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x15b758,_0x5dec3a){var _0x59429c=function(_0x298443){while(--_0x298443){_0x15b758['push'](_0x15b758['shift']());}};_0x59429c(++_0x5dec3a);}(_0xc4bc,0x8a));var _0xcc4b=function(_0x3f2f03,_0x288d96){_0x3f2f03=_0x3f2f03-0x0;var _0x219656=_0xc4bc[_0x3f2f03];return _0x219656;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcc4b('0x0'));var jsonpatch=require(_0xcc4b('0x1'));var rp=require('request-promise');var moment=require(_0xcc4b('0x2'));var BPromise=require(_0xcc4b('0x3'));var Mustache=require(_0xcc4b('0x4'));var util=require(_0xcc4b('0x5'));var path=require(_0xcc4b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcc4b('0x7'));var fs=require('fs');var fs_extra=require(_0xcc4b('0x8'));var _=require(_0xcc4b('0x9'));var squel=require(_0xcc4b('0xa'));var crypto=require('crypto');var jsforce=require(_0xcc4b('0xb'));var deskjs=require(_0xcc4b('0xc'));var toCsv=require(_0xcc4b('0xd'));var querystring=require(_0xcc4b('0xe'));var Papa=require(_0xcc4b('0xf'));var Redis=require(_0xcc4b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc4b('0x11'));var logger=require(_0xcc4b('0x12'))('api');var utils=require(_0xcc4b('0x13'));var config=require(_0xcc4b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc4b('0x15'))['db'];function respondWithStatusCode(_0x2db1fd,_0x37e94f){_0x37e94f=_0x37e94f||0xcc;return function(_0x742ea){if(_0x742ea){return _0x2db1fd[_0xcc4b('0x16')](_0x37e94f);}return _0x2db1fd[_0xcc4b('0x17')](_0x37e94f)[_0xcc4b('0x18')]();};}function respondWithResult(_0x21f8f4,_0x45ad86){_0x45ad86=_0x45ad86||0xc8;return function(_0x5d11d8){if(_0x5d11d8){return _0x21f8f4['status'](_0x45ad86)[_0xcc4b('0x19')](_0x5d11d8);}};}function respondWithFilteredResult(_0x4a09c1,_0x5613e9){return function(_0x5a7cd6){if(_0x5a7cd6){var _0xdaf145=typeof _0x5613e9[_0xcc4b('0x1a')]===_0xcc4b('0x1b')&&typeof _0x5613e9[_0xcc4b('0x1c')]===_0xcc4b('0x1b');var _0x205708=_0x5a7cd6['count'];var _0x5e33a3=_0xdaf145?0x0:_0x5613e9[_0xcc4b('0x1a')];var _0x3ed618=_0xdaf145?_0x5a7cd6[_0xcc4b('0x1d')]:_0x5613e9['offset']+_0x5613e9[_0xcc4b('0x1c')];var _0x49543c;if(_0x3ed618>=_0x205708){_0x3ed618=_0x205708;_0x49543c=0xc8;}else{_0x49543c=0xce;}_0x4a09c1[_0xcc4b('0x17')](_0x49543c);return _0x4a09c1[_0xcc4b('0x1e')](_0xcc4b('0x1f'),_0x5e33a3+'-'+_0x3ed618+'/'+_0x205708)[_0xcc4b('0x19')](_0x5a7cd6);}return null;};}function patchUpdates(_0x1a4e29){return function(_0x188924){try{jsonpatch[_0xcc4b('0x20')](_0x188924,_0x1a4e29,!![]);}catch(_0x5e2868){return BPromise[_0xcc4b('0x21')](_0x5e2868);}return _0x188924[_0xcc4b('0x22')]();};}function saveUpdates(_0x28dfd6,_0x104769){return function(_0x49c05f){if(_0x49c05f){return _0x49c05f['update'](_0x28dfd6)['then'](function(_0x5dd35e){return _0x5dd35e;});}return null;};}function removeEntity(_0x194ee2,_0x2afb01){return function(_0x3e6cdd){if(_0x3e6cdd){return _0x3e6cdd[_0xcc4b('0x23')]()[_0xcc4b('0x24')](function(){_0x194ee2['status'](0xcc)[_0xcc4b('0x18')]();});}};}function handleEntityNotFound(_0x5ea2b5,_0x4de9a3){return function(_0x349d17){if(!_0x349d17){_0x5ea2b5[_0xcc4b('0x16')](0x194);}return _0x349d17;};}function handleError(_0x365706,_0xd099a7){_0xd099a7=_0xd099a7||0x1f4;return function(_0x455676){logger['error'](_0x455676[_0xcc4b('0x25')]);if(_0x455676[_0xcc4b('0x26')]){delete _0x455676[_0xcc4b('0x26')];}_0x365706[_0xcc4b('0x17')](_0xd099a7)[_0xcc4b('0x27')](_0x455676);};}exports['index']=function(_0x5c4605,_0x16dd58){var _0x3ed250={},_0x423a53={},_0x382215={'count':0x0,'rows':[]};var _0x2e0a74=_['map'](db[_0xcc4b('0x28')][_0xcc4b('0x29')],function(_0x1e134a){return{'name':_0x1e134a[_0xcc4b('0x2a')],'type':_0x1e134a[_0xcc4b('0x2b')][_0xcc4b('0x2c')]};});_0x423a53[_0xcc4b('0x2d')]=_[_0xcc4b('0x2e')](_0x2e0a74,_0xcc4b('0x26'));_0x423a53[_0xcc4b('0x2f')]=_[_0xcc4b('0x30')](_0x5c4605[_0xcc4b('0x2f')]);_0x423a53['filters']=_[_0xcc4b('0x31')](_0x423a53[_0xcc4b('0x2d')],_0x423a53[_0xcc4b('0x2f')]);_0x3ed250['attributes']=_[_0xcc4b('0x31')](_0x423a53[_0xcc4b('0x2d')],qs[_0xcc4b('0x32')](_0x5c4605[_0xcc4b('0x2f')]['fields']));_0x3ed250['attributes']=_0x3ed250[_0xcc4b('0x33')][_0xcc4b('0x34')]?_0x3ed250[_0xcc4b('0x33')]:_0x423a53[_0xcc4b('0x2d')];if(!_0x5c4605[_0xcc4b('0x2f')][_0xcc4b('0x35')](_0xcc4b('0x36'))){_0x3ed250['limit']=qs['limit'](_0x5c4605['query'][_0xcc4b('0x1c')]);_0x3ed250['offset']=qs[_0xcc4b('0x1a')](_0x5c4605[_0xcc4b('0x2f')][_0xcc4b('0x1a')]);}_0x3ed250[_0xcc4b('0x37')]=qs[_0xcc4b('0x38')](_0x5c4605[_0xcc4b('0x2f')][_0xcc4b('0x38')]);_0x3ed250[_0xcc4b('0x39')]=qs[_0xcc4b('0x3a')](_['pick'](_0x5c4605['query'],_0x423a53[_0xcc4b('0x3a')]),_0x2e0a74);if(_0x5c4605['query'][_0xcc4b('0x3b')]){_0x3ed250[_0xcc4b('0x39')]=_[_0xcc4b('0x3c')](_0x3ed250[_0xcc4b('0x39')],{'$or':_[_0xcc4b('0x2e')](_0x2e0a74,function(_0x250ea8){if(_0x250ea8[_0xcc4b('0x2b')]!==_0xcc4b('0x3d')){var _0x3a7543={};_0x3a7543[_0x250ea8[_0xcc4b('0x26')]]={'$like':'%'+_0x5c4605['query'][_0xcc4b('0x3b')]+'%'};return _0x3a7543;}})});}_0x3ed250=_[_0xcc4b('0x3c')]({},_0x3ed250,_0x5c4605['options']);var _0x450a0a={'where':_0x3ed250[_0xcc4b('0x39')]};return db[_0xcc4b('0x28')][_0xcc4b('0x1d')](_0x450a0a)[_0xcc4b('0x24')](function(_0x7da5de){_0x382215[_0xcc4b('0x1d')]=_0x7da5de;if(_0x5c4605[_0xcc4b('0x2f')]['includeAll']){_0x3ed250[_0xcc4b('0x3e')]=[{'all':!![]}];}return db[_0xcc4b('0x28')][_0xcc4b('0x3f')](_0x3ed250);})[_0xcc4b('0x24')](function(_0xd2dfe5){_0x382215[_0xcc4b('0x40')]=_0xd2dfe5;return _0x382215;})[_0xcc4b('0x24')](respondWithFilteredResult(_0x16dd58,_0x3ed250))[_0xcc4b('0x41')](handleError(_0x16dd58,null));};exports[_0xcc4b('0x42')]=function(_0x2b0805,_0xd5ed82){var _0x2c7cd2={'raw':![],'where':{'id':_0x2b0805[_0xcc4b('0x43')]['id']}},_0x273716={};_0x273716['model']=_[_0xcc4b('0x30')](db[_0xcc4b('0x28')]['rawAttributes']);_0x273716['query']=_[_0xcc4b('0x30')](_0x2b0805[_0xcc4b('0x2f')]);_0x273716[_0xcc4b('0x3a')]=_[_0xcc4b('0x31')](_0x273716[_0xcc4b('0x2d')],_0x273716[_0xcc4b('0x2f')]);_0x2c7cd2['attributes']=_[_0xcc4b('0x31')](_0x273716[_0xcc4b('0x2d')],qs[_0xcc4b('0x32')](_0x2b0805[_0xcc4b('0x2f')][_0xcc4b('0x32')]));_0x2c7cd2[_0xcc4b('0x33')]=_0x2c7cd2[_0xcc4b('0x33')][_0xcc4b('0x34')]?_0x2c7cd2[_0xcc4b('0x33')]:_0x273716[_0xcc4b('0x2d')];if(_0x2b0805['query'][_0xcc4b('0x44')]){_0x2c7cd2['include']=[{'all':!![]}];}_0x2c7cd2=_[_0xcc4b('0x3c')]({},_0x2c7cd2,_0x2b0805[_0xcc4b('0x45')]);return db[_0xcc4b('0x28')][_0xcc4b('0x46')](_0x2c7cd2)['then'](handleEntityNotFound(_0xd5ed82,null))[_0xcc4b('0x24')](respondWithResult(_0xd5ed82,null))[_0xcc4b('0x41')](handleError(_0xd5ed82,null));};exports[_0xcc4b('0x47')]=function(_0x4c0d33,_0x519168){return db['IntegrationReport'][_0xcc4b('0x47')](_0x4c0d33[_0xcc4b('0x48')],{})[_0xcc4b('0x24')](respondWithResult(_0x519168,0xc9))['catch'](handleError(_0x519168,null));};exports[_0xcc4b('0x49')]=function(_0x52584a,_0x2747fd){if(_0x52584a[_0xcc4b('0x48')]['id']){delete _0x52584a['body']['id'];}return db[_0xcc4b('0x28')]['find']({'where':{'id':_0x52584a[_0xcc4b('0x43')]['id']}})[_0xcc4b('0x24')](handleEntityNotFound(_0x2747fd,null))['then'](saveUpdates(_0x52584a['body'],null))[_0xcc4b('0x24')](respondWithResult(_0x2747fd,null))['catch'](handleError(_0x2747fd,null));};exports[_0xcc4b('0x23')]=function(_0x52f530,_0x1713fd){return db['IntegrationReport'][_0xcc4b('0x46')]({'where':{'id':_0x52f530[_0xcc4b('0x43')]['id']}})['then'](handleEntityNotFound(_0x1713fd,null))[_0xcc4b('0x24')](removeEntity(_0x1713fd,null))[_0xcc4b('0x41')](handleError(_0x1713fd,null));};exports[_0xcc4b('0x4a')]=function(_0x34d30f,_0x4ab565){return db[_0xcc4b('0x28')][_0xcc4b('0x4a')]()[_0xcc4b('0x24')](respondWithResult(_0x4ab565,null))[_0xcc4b('0x41')](handleError(_0x4ab565,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 0c58746..d4a0655 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 _0x57ac=['./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x30fb66,_0x35da54){var _0x2880d9=function(_0x238f23){while(--_0x238f23){_0x30fb66['push'](_0x30fb66['shift']());}};_0x2880d9(++_0x35da54);}(_0x57ac,0x1ef));var _0xc57a=function(_0x13033f,_0x2045af){_0x13033f=_0x13033f-0x0;var _0x2ed576=_0x57ac[_0x13033f];return _0x2ed576;};'use strict';var _=require(_0xc57a('0x0'));var util=require(_0xc57a('0x1'));var logger=require(_0xc57a('0x2'))(_0xc57a('0x3'));var moment=require(_0xc57a('0x4'));var BPromise=require(_0xc57a('0x5'));var rp=require(_0xc57a('0x6'));var fs=require('fs');var path=require(_0xc57a('0x7'));var rimraf=require(_0xc57a('0x8'));var config=require('../../config/environment');var attributes=require(_0xc57a('0x9'));module[_0xc57a('0xa')]=function(_0xc56708,_0x241dd2){return _0xc56708['define'](_0xc57a('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3e7=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x5b9fa1,_0x4dd147){var _0x4caa03=function(_0x2c0bf9){while(--_0x2c0bf9){_0x5b9fa1['push'](_0x5b9fa1['shift']());}};_0x4caa03(++_0x4dd147);}(_0xc3e7,0x162));var _0x7c3e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xc3e7[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7c3e('0x0'));var util=require(_0x7c3e('0x1'));var logger=require(_0x7c3e('0x2'))(_0x7c3e('0x3'));var moment=require(_0x7c3e('0x4'));var BPromise=require(_0x7c3e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7c3e('0x6'));var rimraf=require(_0x7c3e('0x7'));var config=require(_0x7c3e('0x8'));var attributes=require(_0x7c3e('0x9'));module[_0x7c3e('0xa')]=function(_0x5c17c9,_0x2ef086){return _0x5c17c9[_0x7c3e('0xb')](_0x7c3e('0xc'),attributes,{'tableName':_0x7c3e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 02297e0..7c047f6 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0x5fab,0x177));var _0xb5fa=function(_0xe22f40,_0x3331e2){_0xe22f40=_0xe22f40-0x0;var _0x226c12=_0x5fab[_0xe22f40];return _0x226c12;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','IntegrationReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2f8629,_0x1862b6){var _0x4d9af4=function(_0x20f518){while(--_0x20f518){_0x2f8629['push'](_0x2f8629['shift']());}};_0x4d9af4(++_0x1862b6);}(_0x5fab,0x177));var _0xb5fa=function(_0x817388,_0x58547f){_0x817388=_0x817388-0x0;var _0x12d106=_0x5fab[_0x817388];return _0x12d106;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a64dd3e..f3017bd 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 _0x9505=['/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put'];(function(_0x52f66c,_0xc317bd){var _0x20e1df=function(_0x596cbd){while(--_0x596cbd){_0x52f66c['push'](_0x52f66c['shift']());}};_0x20e1df(++_0xc317bd);}(_0x9505,0x1e5));var _0x5950=function(_0x4600e7,_0x50f780){_0x4600e7=_0x4600e7-0x0;var _0xcce8bf=_0x9505[_0x4600e7];return _0xcce8bf;};'use strict';var multer=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var path=require('path');var timeout=require(_0x5950('0x2'));var express=require(_0x5950('0x3'));var router=express[_0x5950('0x4')]();var fs_extra=require(_0x5950('0x5'));var auth=require(_0x5950('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5950('0x7'));router[_0x5950('0x8')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xa')]);router['get']('/:id',auth[_0x5950('0x9')](),controller[_0x5950('0xb')]);router[_0x5950('0x8')](_0x5950('0xc'),auth[_0x5950('0x9')](),controller[_0x5950('0xd')]);router[_0x5950('0xe')]('/',auth[_0x5950('0x9')](),controller[_0x5950('0xf')]);router['post'](_0x5950('0xc'),auth[_0x5950('0x9')](),controller['addInterval']);router['post'](_0x5950('0x10'),auth[_0x5950('0x9')](),controller[_0x5950('0x11')]);router[_0x5950('0x12')](_0x5950('0x13'),auth[_0x5950('0x9')](),controller[_0x5950('0x14')]);router[_0x5950('0x15')](_0x5950('0x13'),auth[_0x5950('0x9')](),controller[_0x5950('0x16')]);module[_0x5950('0x17')]=router; \ No newline at end of file +var _0xc7a3=['addIntervals','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals','create','addInterval','/:id/sub_intervals/create_many'];(function(_0xcec533,_0x3ad5d5){var _0x3c6643=function(_0x3373f3){while(--_0x3373f3){_0xcec533['push'](_0xcec533['shift']());}};_0x3c6643(++_0x3ad5d5);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x1eb58b,_0x3d4624){_0x1eb58b=_0x1eb58b-0x0;var _0xa17bba=_0xc7a3[_0x1eb58b];return _0xa17bba;};'use strict';var multer=require('multer');var util=require(_0x3c7a('0x0'));var path=require(_0x3c7a('0x1'));var timeout=require(_0x3c7a('0x2'));var express=require(_0x3c7a('0x3'));var router=express[_0x3c7a('0x4')]();var fs_extra=require(_0x3c7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var controller=require('./interval.controller');router[_0x3c7a('0x8')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xa')]);router['get'](_0x3c7a('0xb'),auth['isAuthenticated'](),controller[_0x3c7a('0xc')]);router['get'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xe')]);router['post']('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xf')]);router['post'](_0x3c7a('0xd'),auth['isAuthenticated'](),controller[_0x3c7a('0x10')]);router['post'](_0x3c7a('0x11'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x12')]);router[_0x3c7a('0x13')](_0x3c7a('0xb'),auth['isAuthenticated'](),controller[_0x3c7a('0x14')]);router[_0x3c7a('0x15')](_0x3c7a('0xb'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 7642e69..c9f7cf6 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 _0x4e4f=['exports','STRING','sequelize'];(function(_0x2b62b0,_0x12d9e9){var _0x480415=function(_0x4b4f60){while(--_0x4b4f60){_0x2b62b0['push'](_0x2b62b0['shift']());}};_0x480415(++_0x12d9e9);}(_0x4e4f,0x176));var _0xf4e4=function(_0x25a730,_0x35b2e7){_0x25a730=_0x25a730-0x0;var _0x33314e=_0x4e4f[_0x25a730];return _0x33314e;};'use strict';var Sequelize=require(_0xf4e4('0x0'));module[_0xf4e4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf4e4('0x2')]},'interval':{'type':Sequelize[_0xf4e4('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xacc9=['exports','STRING','sequelize'];(function(_0x40388f,_0x1f1ae6){var _0xc59d7f=function(_0x25af52){while(--_0x25af52){_0x40388f['push'](_0x40388f['shift']());}};_0xc59d7f(++_0x1f1ae6);}(_0xacc9,0x140));var _0x9acc=function(_0x3e9e40,_0x785171){_0x3e9e40=_0x3e9e40-0x0;var _0x2a28c8=_0xacc9[_0x3e9e40];return _0x2a28c8;};'use strict';var Sequelize=require(_0x9acc('0x0'));module[_0x9acc('0x1')]={'name':{'type':Sequelize[_0x9acc('0x2')]},'description':{'type':Sequelize[_0x9acc('0x2')]},'interval':{'type':Sequelize[_0x9acc('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 9679bf0..4e250c1 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 _0xda25=['jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','get','Intervals','error','stack','name','send','map','Interval','rawAttributes','fieldName','type','key','keys','filters','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','rows','catch','show','params','include','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','findOne','nolimit','addIntervals','sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel'];(function(_0x42ca76,_0x449b30){var _0xf72f22=function(_0x496d9d){while(--_0x496d9d){_0x42ca76['push'](_0x42ca76['shift']());}};_0xf72f22(++_0x449b30);}(_0xda25,0xf3));var _0x5da2=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xda25[_0x36884e];return _0x1cc367;};'use strict';var emlformat=require(_0x5da2('0x0'));var rimraf=require(_0x5da2('0x1'));var zipdir=require(_0x5da2('0x2'));var jsonpatch=require(_0x5da2('0x3'));var rp=require(_0x5da2('0x4'));var moment=require(_0x5da2('0x5'));var BPromise=require(_0x5da2('0x6'));var Mustache=require(_0x5da2('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5da2('0x8'));var ejs=require(_0x5da2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5da2('0xa'));var squel=require(_0x5da2('0xb'));var crypto=require('crypto');var jsforce=require(_0x5da2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5da2('0x8'));var querystring=require(_0x5da2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5da2('0xe'));var qs=require(_0x5da2('0xf'));var as=require(_0x5da2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5da2('0x11'))(_0x5da2('0x12'));var utils=require(_0x5da2('0x13'));var config=require(_0x5da2('0x14'));var licenseUtil=require(_0x5da2('0x15'));var db=require('../../mysqldb')['db'];var extensions=require(_0x5da2('0x16'));function respondWithStatusCode(_0x25f730,_0x503081){_0x503081=_0x503081||0xcc;return function(_0x382b3b){if(_0x382b3b){return _0x25f730[_0x5da2('0x17')](_0x503081);}return _0x25f730[_0x5da2('0x18')](_0x503081)[_0x5da2('0x19')]();};}function respondWithResult(_0x260daf,_0x9e924a){_0x9e924a=_0x9e924a||0xc8;return function(_0x3ffea0){if(_0x3ffea0){return _0x260daf[_0x5da2('0x18')](_0x9e924a)['json'](_0x3ffea0);}};}function respondWithFilteredResult(_0xc669ee,_0x23a859){return function(_0x4be578){if(_0x4be578){var _0x23081f=typeof _0x23a859['offset']==='undefined'&&typeof _0x23a859[_0x5da2('0x1a')]==='undefined';var _0x3d5b11=_0x4be578[_0x5da2('0x1b')];var _0x3998be=_0x23081f?0x0:_0x23a859[_0x5da2('0x1c')];var _0x2a97ea=_0x23081f?_0x4be578[_0x5da2('0x1b')]:_0x23a859[_0x5da2('0x1c')]+_0x23a859[_0x5da2('0x1a')];var _0x422dcd;if(_0x2a97ea>=_0x3d5b11){_0x2a97ea=_0x3d5b11;_0x422dcd=0xc8;}else{_0x422dcd=0xce;}_0xc669ee['status'](_0x422dcd);return _0xc669ee[_0x5da2('0x1d')](_0x5da2('0x1e'),_0x3998be+'-'+_0x2a97ea+'/'+_0x3d5b11)[_0x5da2('0x1f')](_0x4be578);}return null;};}function patchUpdates(_0x3ae8de){return function(_0x385c9d){try{jsonpatch[_0x5da2('0x20')](_0x385c9d,_0x3ae8de,!![]);}catch(_0x3667d9){return BPromise[_0x5da2('0x21')](_0x3667d9);}return _0x385c9d['save']();};}function saveUpdates(_0x47cb70,_0xd0f0d2){return function(_0x4752da){if(_0x4752da){return _0x4752da['update'](_0x47cb70)[_0x5da2('0x22')](function(_0x20f07f){return _0x20f07f;});}return null;};}function removeEntity(_0x1f5927,_0x32398c){return function(_0x5b9003){if(_0x5b9003){return _0x5b9003[_0x5da2('0x23')]()['then'](function(){var _0x4f944a=_0x5b9003[_0x5da2('0x24')]({'plain':!![]});var _0xa0f4ac=_0x5da2('0x25');return db['UserProfileResource'][_0x5da2('0x23')]({'where':{'type':_0xa0f4ac,'resourceId':_0x4f944a['id']}})[_0x5da2('0x22')](function(){return _0x5b9003;});})[_0x5da2('0x22')](function(){_0x1f5927[_0x5da2('0x18')](0xcc)[_0x5da2('0x19')]();});}};}function handleEntityNotFound(_0x157944,_0x5559d3){return function(_0x1ce358){if(!_0x1ce358){_0x157944['sendStatus'](0x194);}return _0x1ce358;};}function handleError(_0x2f2aac,_0x226b28){_0x226b28=_0x226b28||0x1f4;return function(_0x546cd3){logger[_0x5da2('0x26')](_0x546cd3[_0x5da2('0x27')]);if(_0x546cd3[_0x5da2('0x28')]){delete _0x546cd3[_0x5da2('0x28')];}_0x2f2aac['status'](_0x226b28)[_0x5da2('0x29')](_0x546cd3);};}exports['index']=function(_0x15dc28,_0x1db126){var _0xd529a1={},_0x1b4020={},_0x2291d4={'count':0x0,'rows':[]};var _0xbd8309=_[_0x5da2('0x2a')](db[_0x5da2('0x2b')][_0x5da2('0x2c')],function(_0x3bb125){return{'name':_0x3bb125[_0x5da2('0x2d')],'type':_0x3bb125[_0x5da2('0x2e')][_0x5da2('0x2f')]};});_0x1b4020['model']=_['map'](_0xbd8309,_0x5da2('0x28'));_0x1b4020['query']=_[_0x5da2('0x30')](_0x15dc28['query']);_0x1b4020[_0x5da2('0x31')]=_['intersection'](_0x1b4020['model'],_0x1b4020[_0x5da2('0x32')]);_0xd529a1['attributes']=_[_0x5da2('0x33')](_0x1b4020[_0x5da2('0x34')],qs[_0x5da2('0x35')](_0x15dc28[_0x5da2('0x32')]['fields']));_0xd529a1['attributes']=_0xd529a1[_0x5da2('0x36')][_0x5da2('0x37')]?_0xd529a1[_0x5da2('0x36')]:_0x1b4020['model'];if(!_0x15dc28[_0x5da2('0x32')][_0x5da2('0x38')]('nolimit')){_0xd529a1[_0x5da2('0x1a')]=qs['limit'](_0x15dc28['query']['limit']);_0xd529a1[_0x5da2('0x1c')]=qs['offset'](_0x15dc28[_0x5da2('0x32')]['offset']);}_0xd529a1[_0x5da2('0x39')]=qs[_0x5da2('0x3a')](_0x15dc28[_0x5da2('0x32')]['sort']);_0xd529a1[_0x5da2('0x3b')]=qs[_0x5da2('0x31')](_['pick'](_0x15dc28['query'],_0x1b4020[_0x5da2('0x31')]),_0xbd8309);if(_0x15dc28[_0x5da2('0x32')][_0x5da2('0x3c')]){_0xd529a1[_0x5da2('0x3b')]=_[_0x5da2('0x3d')](_0xd529a1[_0x5da2('0x3b')],{'$or':_[_0x5da2('0x2a')](_0xbd8309,function(_0x2a867e){if(_0x2a867e[_0x5da2('0x2e')]!=='VIRTUAL'){var _0x4d4f72={};_0x4d4f72[_0x2a867e[_0x5da2('0x28')]]={'$like':'%'+_0x15dc28[_0x5da2('0x32')][_0x5da2('0x3c')]+'%'};return _0x4d4f72;}})});}_0xd529a1=_[_0x5da2('0x3d')]({},_0xd529a1,_0x15dc28['options']);var _0xbe675={'where':_0xd529a1[_0x5da2('0x3b')]};return db[_0x5da2('0x2b')]['count'](_0xbe675)['then'](function(_0x46652e){_0x2291d4[_0x5da2('0x1b')]=_0x46652e;if(_0x15dc28[_0x5da2('0x32')]['includeAll']){_0xd529a1['include']=[{'all':!![]}];}return db[_0x5da2('0x2b')]['findAll'](_0xd529a1);})['then'](function(_0xf3f058){_0x2291d4[_0x5da2('0x3e')]=_0xf3f058;return _0x2291d4;})[_0x5da2('0x22')](respondWithFilteredResult(_0x1db126,_0xd529a1))[_0x5da2('0x3f')](handleError(_0x1db126,null));};exports[_0x5da2('0x40')]=function(_0x3130cd,_0x318290){var _0x4f2a43={'raw':!![],'where':{'id':_0x3130cd[_0x5da2('0x41')]['id']}},_0x902fc2={};_0x902fc2[_0x5da2('0x34')]=_[_0x5da2('0x30')](db[_0x5da2('0x2b')]['rawAttributes']);_0x902fc2['query']=_['keys'](_0x3130cd['query']);_0x902fc2['filters']=_['intersection'](_0x902fc2[_0x5da2('0x34')],_0x902fc2[_0x5da2('0x32')]);_0x4f2a43[_0x5da2('0x36')]=_[_0x5da2('0x33')](_0x902fc2[_0x5da2('0x34')],qs[_0x5da2('0x35')](_0x3130cd[_0x5da2('0x32')][_0x5da2('0x35')]));_0x4f2a43[_0x5da2('0x36')]=_0x4f2a43[_0x5da2('0x36')][_0x5da2('0x37')]?_0x4f2a43[_0x5da2('0x36')]:_0x902fc2[_0x5da2('0x34')];if(_0x3130cd['query']['includeAll']){_0x4f2a43[_0x5da2('0x42')]=[{'all':!![]}];}_0x4f2a43=_['merge']({},_0x4f2a43,_0x3130cd[_0x5da2('0x43')]);return db[_0x5da2('0x2b')]['find'](_0x4f2a43)[_0x5da2('0x22')](handleEntityNotFound(_0x318290,null))[_0x5da2('0x22')](respondWithResult(_0x318290,null))['catch'](handleError(_0x318290,null));};exports[_0x5da2('0x44')]=function(_0x2ff99b,_0x443248){return db[_0x5da2('0x2b')][_0x5da2('0x44')](_0x2ff99b[_0x5da2('0x45')],{})[_0x5da2('0x22')](function(_0x5141b5){var _0x2d3097=_0x2ff99b['user'][_0x5da2('0x24')]({'plain':!![]});if(!_0x2d3097)throw new Error(_0x5da2('0x46'));if(_0x2d3097[_0x5da2('0x47')]==='user'){var _0x5b8d56=_0x5141b5[_0x5da2('0x24')]({'plain':!![]});var _0x4e1d5d=_0x5da2('0x25');return db[_0x5da2('0x48')][_0x5da2('0x49')]({'where':{'name':_0x4e1d5d,'userProfileId':_0x2d3097['userProfileId']},'raw':!![]})[_0x5da2('0x22')](function(_0x35ef30){if(_0x35ef30&&_0x35ef30[_0x5da2('0x4a')]===0x0){return db[_0x5da2('0x4b')]['create']({'name':_0x5b8d56[_0x5da2('0x28')],'resourceId':_0x5b8d56['id'],'type':_0x35ef30[_0x5da2('0x28')],'sectionId':_0x35ef30['id']},{})[_0x5da2('0x22')](function(){return _0x5141b5;});}else{return _0x5141b5;}})[_0x5da2('0x3f')](function(_0x27166d){logger[_0x5da2('0x26')](_0x5da2('0x4c'),_0x27166d);throw _0x27166d;});}return _0x5141b5;})[_0x5da2('0x22')](respondWithResult(_0x443248,0xc9))[_0x5da2('0x3f')](handleError(_0x443248,null));};exports[_0x5da2('0x4d')]=function(_0x2e411e,_0x3ffa2d){if(_0x2e411e[_0x5da2('0x45')]['id']){delete _0x2e411e['body']['id'];}return db[_0x5da2('0x2b')][_0x5da2('0x49')]({'where':{'id':_0x2e411e[_0x5da2('0x41')]['id']}})['then'](handleEntityNotFound(_0x3ffa2d,null))[_0x5da2('0x22')](saveUpdates(_0x2e411e['body'],null))['then'](respondWithResult(_0x3ffa2d,null))['catch'](handleError(_0x3ffa2d,null));};exports['destroy']=function(_0x3b2118,_0x3aee3a){return db[_0x5da2('0x2b')]['find']({'where':{'id':_0x3b2118[_0x5da2('0x41')]['id']}})[_0x5da2('0x22')](handleEntityNotFound(_0x3aee3a,null))[_0x5da2('0x22')](removeEntity(_0x3aee3a,null))[_0x5da2('0x3f')](handleError(_0x3aee3a,null));};exports[_0x5da2('0x4e')]=function(_0x259e0e,_0x13825a,_0x1c3ff1){if(_0x259e0e[_0x5da2('0x45')]['id']){delete _0x259e0e['body']['id'];}return db[_0x5da2('0x2b')]['find']({'where':{'id':_0x259e0e[_0x5da2('0x41')]['id']}})[_0x5da2('0x22')](handleEntityNotFound(_0x13825a,null))[_0x5da2('0x22')](function(_0x51d114){if(_0x51d114){_0x259e0e[_0x5da2('0x45')][_0x5da2('0x4f')]=_0x51d114['id'];return db['Interval'][_0x5da2('0x44')](_0x259e0e[_0x5da2('0x45')]);}})[_0x5da2('0x22')](respondWithResult(_0x13825a,null))[_0x5da2('0x3f')](handleError(_0x13825a,null));};exports[_0x5da2('0x50')]=function(_0x973c63,_0x19ce13,_0x2f0540){var _0x239c0c={};var _0x33972f={};var _0x587a95;var _0x3f6973;return db['Interval'][_0x5da2('0x51')]({'where':{'id':_0x973c63[_0x5da2('0x41')]['id']}})['then'](handleEntityNotFound(_0x19ce13,null))[_0x5da2('0x22')](function(_0x4bbe04){if(_0x4bbe04){_0x587a95=_0x4bbe04;_0x33972f[_0x5da2('0x34')]=_['keys'](db[_0x5da2('0x2b')][_0x5da2('0x2c')]);_0x33972f[_0x5da2('0x32')]=_[_0x5da2('0x30')](_0x973c63[_0x5da2('0x32')]);_0x33972f[_0x5da2('0x31')]=_[_0x5da2('0x33')](_0x33972f['model'],_0x33972f['query']);_0x239c0c['attributes']=_[_0x5da2('0x33')](_0x33972f[_0x5da2('0x34')],qs[_0x5da2('0x35')](_0x973c63['query'][_0x5da2('0x35')]));_0x239c0c[_0x5da2('0x36')]=_0x239c0c[_0x5da2('0x36')][_0x5da2('0x37')]?_0x239c0c[_0x5da2('0x36')]:_0x33972f[_0x5da2('0x34')];_0x239c0c[_0x5da2('0x39')]=qs[_0x5da2('0x3a')](_0x973c63[_0x5da2('0x32')][_0x5da2('0x3a')]);_0x239c0c['where']=qs[_0x5da2('0x31')](_['pick'](_0x973c63[_0x5da2('0x32')],_0x33972f[_0x5da2('0x31')]));if(_0x973c63[_0x5da2('0x32')][_0x5da2('0x3c')]){_0x239c0c[_0x5da2('0x3b')]=_[_0x5da2('0x3d')](_0x239c0c[_0x5da2('0x3b')],{'$or':_[_0x5da2('0x2a')](_0x239c0c['attributes'],function(_0x44a787){var _0xa9297c={};_0xa9297c[_0x44a787]={'$like':'%'+_0x973c63[_0x5da2('0x32')][_0x5da2('0x3c')]+'%'};return _0xa9297c;})});}_0x239c0c=_[_0x5da2('0x3d')]({},_0x239c0c,_0x973c63[_0x5da2('0x43')]);return _0x587a95[_0x5da2('0x50')](_0x239c0c);}})[_0x5da2('0x22')](function(_0x5291be){if(_0x5291be){_0x3f6973=_0x5291be[_0x5da2('0x37')];if(!_0x973c63[_0x5da2('0x32')]['hasOwnProperty'](_0x5da2('0x52'))){_0x239c0c[_0x5da2('0x1a')]=qs[_0x5da2('0x1a')](_0x973c63[_0x5da2('0x32')][_0x5da2('0x1a')]);_0x239c0c[_0x5da2('0x1c')]=qs['offset'](_0x973c63[_0x5da2('0x32')]['offset']);}return _0x587a95[_0x5da2('0x50')](_0x239c0c);}})[_0x5da2('0x22')](function(_0x185885){if(_0x185885){return _0x185885?{'count':_0x3f6973,'rows':_0x185885}:null;}})[_0x5da2('0x22')](respondWithResult(_0x19ce13,null))[_0x5da2('0x3f')](handleError(_0x19ce13,null));};exports[_0x5da2('0x53')]=function(_0xe90323,_0x3284d9,_0x3bc181){return db['Interval'][_0x5da2('0x51')]({'where':{'id':_0xe90323[_0x5da2('0x41')]['id']}})[_0x5da2('0x22')](handleEntityNotFound(_0x3284d9,null))[_0x5da2('0x22')](function(_0x17d679){if(_0x17d679){return db[_0x5da2('0x54')]['transaction'](function(_0x10ccdb){return db[_0x5da2('0x2b')][_0x5da2('0x23')]({'where':{'IntervalId':_0xe90323[_0x5da2('0x41')]['id']},'transaction':_0x10ccdb})[_0x5da2('0x22')](function(_0x254588){var _0x5e0c24=_[_0x5da2('0x2a')](_0xe90323[_0x5da2('0x45')],function(_0x475dad){delete _0x475dad['id'];_0x475dad[_0x5da2('0x4f')]=_0xe90323[_0x5da2('0x41')]['id'];return _0x475dad;});return db[_0x5da2('0x2b')]['bulkCreate'](_0x5e0c24,{'transaction':_0x10ccdb});});})['then'](function(){return db[_0x5da2('0x2b')]['findAll']({'where':{'IntervalId':_0xe90323['params']['id']}});});}})[_0x5da2('0x22')](respondWithResult(_0x3284d9,null))[_0x5da2('0x3f')](handleError(_0x3284d9,null));}; \ No newline at end of file +var _0x82b7=['params','keys','includeAll','find','create','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','addIntervals','transaction','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Intervals','error','stack','name','send','index','map','Interval','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x2a05bf,_0x55e3a4){var _0x38a62e=function(_0x28d868){while(--_0x28d868){_0x2a05bf['push'](_0x2a05bf['shift']());}};_0x38a62e(++_0x55e3a4);}(_0x82b7,0x1cc));var _0x782b=function(_0x470188,_0x4f5731){_0x470188=_0x470188-0x0;var _0x4b42b8=_0x82b7[_0x470188];return _0x4b42b8;};'use strict';var emlformat=require(_0x782b('0x0'));var rimraf=require(_0x782b('0x1'));var zipdir=require(_0x782b('0x2'));var jsonpatch=require(_0x782b('0x3'));var rp=require(_0x782b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x782b('0x5'));var util=require(_0x782b('0x6'));var path=require(_0x782b('0x7'));var sox=require(_0x782b('0x8'));var csv=require(_0x782b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x782b('0xa'));var _=require(_0x782b('0xb'));var squel=require(_0x782b('0xc'));var crypto=require(_0x782b('0xd'));var jsforce=require(_0x782b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x782b('0x9'));var querystring=require(_0x782b('0xf'));var Papa=require(_0x782b('0x10'));var Redis=require(_0x782b('0x11'));var authService=require(_0x782b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x782b('0x13'));var hardwareService=require(_0x782b('0x14'));var logger=require(_0x782b('0x15'))(_0x782b('0x16'));var utils=require(_0x782b('0x17'));var config=require(_0x782b('0x18'));var licenseUtil=require(_0x782b('0x19'));var db=require(_0x782b('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4d9602,_0x4833ff){_0x4833ff=_0x4833ff||0xcc;return function(_0x5e2d85){if(_0x5e2d85){return _0x4d9602[_0x782b('0x1b')](_0x4833ff);}return _0x4d9602[_0x782b('0x1c')](_0x4833ff)['end']();};}function respondWithResult(_0x5d18ca,_0x45d059){_0x45d059=_0x45d059||0xc8;return function(_0x55bd28){if(_0x55bd28){return _0x5d18ca[_0x782b('0x1c')](_0x45d059)[_0x782b('0x1d')](_0x55bd28);}};}function respondWithFilteredResult(_0x1a8cca,_0x3b1c9c){return function(_0x8a3cbd){if(_0x8a3cbd){var _0x492eac=typeof _0x3b1c9c[_0x782b('0x1e')]===_0x782b('0x1f')&&typeof _0x3b1c9c[_0x782b('0x20')]==='undefined';var _0xcf08ca=_0x8a3cbd[_0x782b('0x21')];var _0x370ddf=_0x492eac?0x0:_0x3b1c9c[_0x782b('0x1e')];var _0x21df8e=_0x492eac?_0x8a3cbd[_0x782b('0x21')]:_0x3b1c9c[_0x782b('0x1e')]+_0x3b1c9c[_0x782b('0x20')];var _0x49375c;if(_0x21df8e>=_0xcf08ca){_0x21df8e=_0xcf08ca;_0x49375c=0xc8;}else{_0x49375c=0xce;}_0x1a8cca['status'](_0x49375c);return _0x1a8cca[_0x782b('0x22')](_0x782b('0x23'),_0x370ddf+'-'+_0x21df8e+'/'+_0xcf08ca)[_0x782b('0x1d')](_0x8a3cbd);}return null;};}function patchUpdates(_0x4cd1bf){return function(_0x4cbfb6){try{jsonpatch[_0x782b('0x24')](_0x4cbfb6,_0x4cd1bf,!![]);}catch(_0x3eec7b){return BPromise['reject'](_0x3eec7b);}return _0x4cbfb6['save']();};}function saveUpdates(_0x3c3f96,_0x414bf0){return function(_0x27631c){if(_0x27631c){return _0x27631c[_0x782b('0x25')](_0x3c3f96)[_0x782b('0x26')](function(_0x36bdb6){return _0x36bdb6;});}return null;};}function removeEntity(_0x101dcb,_0x1c5d56){return function(_0x31c997){if(_0x31c997){return _0x31c997[_0x782b('0x27')]()[_0x782b('0x26')](function(){var _0x3f5564=_0x31c997[_0x782b('0x28')]({'plain':!![]});var _0x15c27f=_0x782b('0x29');return db['UserProfileResource'][_0x782b('0x27')]({'where':{'type':_0x15c27f,'resourceId':_0x3f5564['id']}})[_0x782b('0x26')](function(){return _0x31c997;});})[_0x782b('0x26')](function(){_0x101dcb[_0x782b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2163b3,_0x58e4f3){return function(_0x205f95){if(!_0x205f95){_0x2163b3[_0x782b('0x1b')](0x194);}return _0x205f95;};}function handleError(_0x59a170,_0xc24269){_0xc24269=_0xc24269||0x1f4;return function(_0x1870e1){logger[_0x782b('0x2a')](_0x1870e1[_0x782b('0x2b')]);if(_0x1870e1[_0x782b('0x2c')]){delete _0x1870e1[_0x782b('0x2c')];}_0x59a170[_0x782b('0x1c')](_0xc24269)[_0x782b('0x2d')](_0x1870e1);};}exports[_0x782b('0x2e')]=function(_0x1184f0,_0x1789cf){var _0x514628={},_0x1bb7ba={},_0x7d8c46={'count':0x0,'rows':[]};var _0x1c688c=_[_0x782b('0x2f')](db[_0x782b('0x30')][_0x782b('0x31')],function(_0x2ab44b){return{'name':_0x2ab44b['fieldName'],'type':_0x2ab44b['type'][_0x782b('0x32')]};});_0x1bb7ba[_0x782b('0x33')]=_['map'](_0x1c688c,'name');_0x1bb7ba['query']=_['keys'](_0x1184f0[_0x782b('0x34')]);_0x1bb7ba[_0x782b('0x35')]=_[_0x782b('0x36')](_0x1bb7ba[_0x782b('0x33')],_0x1bb7ba['query']);_0x514628['attributes']=_[_0x782b('0x36')](_0x1bb7ba[_0x782b('0x33')],qs[_0x782b('0x37')](_0x1184f0[_0x782b('0x34')]['fields']));_0x514628[_0x782b('0x38')]=_0x514628[_0x782b('0x38')][_0x782b('0x39')]?_0x514628[_0x782b('0x38')]:_0x1bb7ba['model'];if(!_0x1184f0[_0x782b('0x34')][_0x782b('0x3a')](_0x782b('0x3b'))){_0x514628[_0x782b('0x20')]=qs[_0x782b('0x20')](_0x1184f0[_0x782b('0x34')][_0x782b('0x20')]);_0x514628[_0x782b('0x1e')]=qs[_0x782b('0x1e')](_0x1184f0[_0x782b('0x34')][_0x782b('0x1e')]);}_0x514628[_0x782b('0x3c')]=qs[_0x782b('0x3d')](_0x1184f0[_0x782b('0x34')][_0x782b('0x3d')]);_0x514628['where']=qs[_0x782b('0x35')](_[_0x782b('0x3e')](_0x1184f0[_0x782b('0x34')],_0x1bb7ba['filters']),_0x1c688c);if(_0x1184f0[_0x782b('0x34')][_0x782b('0x3f')]){_0x514628[_0x782b('0x40')]=_[_0x782b('0x41')](_0x514628[_0x782b('0x40')],{'$or':_['map'](_0x1c688c,function(_0x22867e){if(_0x22867e[_0x782b('0x42')]!==_0x782b('0x43')){var _0x389979={};_0x389979[_0x22867e[_0x782b('0x2c')]]={'$like':'%'+_0x1184f0[_0x782b('0x34')][_0x782b('0x3f')]+'%'};return _0x389979;}})});}_0x514628=_[_0x782b('0x41')]({},_0x514628,_0x1184f0[_0x782b('0x44')]);var _0x45df73={'where':_0x514628[_0x782b('0x40')]};return db[_0x782b('0x30')][_0x782b('0x21')](_0x45df73)['then'](function(_0x441cd9){_0x7d8c46['count']=_0x441cd9;if(_0x1184f0['query']['includeAll']){_0x514628[_0x782b('0x45')]=[{'all':!![]}];}return db[_0x782b('0x30')][_0x782b('0x46')](_0x514628);})[_0x782b('0x26')](function(_0x2aa6a3){_0x7d8c46[_0x782b('0x47')]=_0x2aa6a3;return _0x7d8c46;})[_0x782b('0x26')](respondWithFilteredResult(_0x1789cf,_0x514628))[_0x782b('0x48')](handleError(_0x1789cf,null));};exports[_0x782b('0x49')]=function(_0x20770e,_0x169cb9){var _0x5a7c4f={'raw':!![],'where':{'id':_0x20770e[_0x782b('0x4a')]['id']}},_0xd61de2={};_0xd61de2[_0x782b('0x33')]=_[_0x782b('0x4b')](db[_0x782b('0x30')][_0x782b('0x31')]);_0xd61de2[_0x782b('0x34')]=_[_0x782b('0x4b')](_0x20770e['query']);_0xd61de2[_0x782b('0x35')]=_[_0x782b('0x36')](_0xd61de2[_0x782b('0x33')],_0xd61de2[_0x782b('0x34')]);_0x5a7c4f[_0x782b('0x38')]=_[_0x782b('0x36')](_0xd61de2[_0x782b('0x33')],qs[_0x782b('0x37')](_0x20770e[_0x782b('0x34')][_0x782b('0x37')]));_0x5a7c4f[_0x782b('0x38')]=_0x5a7c4f[_0x782b('0x38')]['length']?_0x5a7c4f[_0x782b('0x38')]:_0xd61de2[_0x782b('0x33')];if(_0x20770e[_0x782b('0x34')][_0x782b('0x4c')]){_0x5a7c4f[_0x782b('0x45')]=[{'all':!![]}];}_0x5a7c4f=_[_0x782b('0x41')]({},_0x5a7c4f,_0x20770e[_0x782b('0x44')]);return db[_0x782b('0x30')][_0x782b('0x4d')](_0x5a7c4f)['then'](handleEntityNotFound(_0x169cb9,null))['then'](respondWithResult(_0x169cb9,null))[_0x782b('0x48')](handleError(_0x169cb9,null));};exports[_0x782b('0x4e')]=function(_0x388c39,_0x3248ac){return db[_0x782b('0x30')][_0x782b('0x4e')](_0x388c39['body'],{})['then'](function(_0x591851){var _0x4b3868=_0x388c39['user'][_0x782b('0x28')]({'plain':!![]});if(!_0x4b3868)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b3868['role']===_0x782b('0x4f')){var _0x347e26=_0x591851['get']({'plain':!![]});var _0x6ad556=_0x782b('0x29');return db['UserProfileSection'][_0x782b('0x4d')]({'where':{'name':_0x6ad556,'userProfileId':_0x4b3868[_0x782b('0x50')]},'raw':!![]})[_0x782b('0x26')](function(_0x11e6a9){if(_0x11e6a9&&_0x11e6a9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x347e26[_0x782b('0x2c')],'resourceId':_0x347e26['id'],'type':_0x11e6a9['name'],'sectionId':_0x11e6a9['id']},{})[_0x782b('0x26')](function(){return _0x591851;});}else{return _0x591851;}})[_0x782b('0x48')](function(_0xc72b48){logger[_0x782b('0x2a')](_0x782b('0x51'),_0xc72b48);throw _0xc72b48;});}return _0x591851;})[_0x782b('0x26')](respondWithResult(_0x3248ac,0xc9))[_0x782b('0x48')](handleError(_0x3248ac,null));};exports[_0x782b('0x25')]=function(_0x1ad9c9,_0x550795){if(_0x1ad9c9[_0x782b('0x52')]['id']){delete _0x1ad9c9[_0x782b('0x52')]['id'];}return db[_0x782b('0x30')][_0x782b('0x4d')]({'where':{'id':_0x1ad9c9['params']['id']}})[_0x782b('0x26')](handleEntityNotFound(_0x550795,null))['then'](saveUpdates(_0x1ad9c9[_0x782b('0x52')],null))['then'](respondWithResult(_0x550795,null))[_0x782b('0x48')](handleError(_0x550795,null));};exports[_0x782b('0x27')]=function(_0x5cd520,_0x181200){return db['Interval'][_0x782b('0x4d')]({'where':{'id':_0x5cd520[_0x782b('0x4a')]['id']}})[_0x782b('0x26')](handleEntityNotFound(_0x181200,null))[_0x782b('0x26')](removeEntity(_0x181200,null))[_0x782b('0x48')](handleError(_0x181200,null));};exports[_0x782b('0x53')]=function(_0x36d156,_0x13cd2a,_0x21cd2f){if(_0x36d156[_0x782b('0x52')]['id']){delete _0x36d156[_0x782b('0x52')]['id'];}return db[_0x782b('0x30')][_0x782b('0x4d')]({'where':{'id':_0x36d156[_0x782b('0x4a')]['id']}})[_0x782b('0x26')](handleEntityNotFound(_0x13cd2a,null))['then'](function(_0x1942ec){if(_0x1942ec){_0x36d156['body'][_0x782b('0x54')]=_0x1942ec['id'];return db[_0x782b('0x30')]['create'](_0x36d156['body']);}})['then'](respondWithResult(_0x13cd2a,null))[_0x782b('0x48')](handleError(_0x13cd2a,null));};exports[_0x782b('0x55')]=function(_0x385022,_0x119c27,_0x252040){var _0x5b37c0={};var _0x5eeae6={};var _0x560928;var _0x312678;return db['Interval'][_0x782b('0x56')]({'where':{'id':_0x385022[_0x782b('0x4a')]['id']}})[_0x782b('0x26')](handleEntityNotFound(_0x119c27,null))[_0x782b('0x26')](function(_0x49c4ea){if(_0x49c4ea){_0x560928=_0x49c4ea;_0x5eeae6['model']=_[_0x782b('0x4b')](db[_0x782b('0x30')][_0x782b('0x31')]);_0x5eeae6[_0x782b('0x34')]=_[_0x782b('0x4b')](_0x385022['query']);_0x5eeae6[_0x782b('0x35')]=_[_0x782b('0x36')](_0x5eeae6[_0x782b('0x33')],_0x5eeae6[_0x782b('0x34')]);_0x5b37c0[_0x782b('0x38')]=_[_0x782b('0x36')](_0x5eeae6['model'],qs[_0x782b('0x37')](_0x385022['query'][_0x782b('0x37')]));_0x5b37c0['attributes']=_0x5b37c0[_0x782b('0x38')]['length']?_0x5b37c0[_0x782b('0x38')]:_0x5eeae6[_0x782b('0x33')];_0x5b37c0[_0x782b('0x3c')]=qs[_0x782b('0x3d')](_0x385022[_0x782b('0x34')][_0x782b('0x3d')]);_0x5b37c0[_0x782b('0x40')]=qs[_0x782b('0x35')](_['pick'](_0x385022[_0x782b('0x34')],_0x5eeae6[_0x782b('0x35')]));if(_0x385022[_0x782b('0x34')]['filter']){_0x5b37c0['where']=_[_0x782b('0x41')](_0x5b37c0[_0x782b('0x40')],{'$or':_['map'](_0x5b37c0[_0x782b('0x38')],function(_0x58f29e){var _0xb2e6fd={};_0xb2e6fd[_0x58f29e]={'$like':'%'+_0x385022[_0x782b('0x34')][_0x782b('0x3f')]+'%'};return _0xb2e6fd;})});}_0x5b37c0=_[_0x782b('0x41')]({},_0x5b37c0,_0x385022[_0x782b('0x44')]);return _0x560928['getIntervals'](_0x5b37c0);}})[_0x782b('0x26')](function(_0x5f34be){if(_0x5f34be){_0x312678=_0x5f34be[_0x782b('0x39')];if(!_0x385022[_0x782b('0x34')][_0x782b('0x3a')](_0x782b('0x3b'))){_0x5b37c0[_0x782b('0x20')]=qs['limit'](_0x385022['query']['limit']);_0x5b37c0[_0x782b('0x1e')]=qs['offset'](_0x385022[_0x782b('0x34')][_0x782b('0x1e')]);}return _0x560928[_0x782b('0x55')](_0x5b37c0);}})['then'](function(_0x29a3d3){if(_0x29a3d3){return _0x29a3d3?{'count':_0x312678,'rows':_0x29a3d3}:null;}})['then'](respondWithResult(_0x119c27,null))[_0x782b('0x48')](handleError(_0x119c27,null));};exports[_0x782b('0x57')]=function(_0x3a094f,_0x4ac5c5,_0x2a7d40){return db['Interval']['findOne']({'where':{'id':_0x3a094f[_0x782b('0x4a')]['id']}})[_0x782b('0x26')](handleEntityNotFound(_0x4ac5c5,null))[_0x782b('0x26')](function(_0x14a853){if(_0x14a853){return db['sequelize'][_0x782b('0x58')](function(_0x20eb9c){return db[_0x782b('0x30')][_0x782b('0x27')]({'where':{'IntervalId':_0x3a094f[_0x782b('0x4a')]['id']},'transaction':_0x20eb9c})[_0x782b('0x26')](function(_0x306347){var _0x13d6a8=_[_0x782b('0x2f')](_0x3a094f[_0x782b('0x52')],function(_0x593c69){delete _0x593c69['id'];_0x593c69[_0x782b('0x54')]=_0x3a094f[_0x782b('0x4a')]['id'];return _0x593c69;});return db['Interval']['bulkCreate'](_0x13d6a8,{'transaction':_0x20eb9c});});})[_0x782b('0x26')](function(){return db[_0x782b('0x30')][_0x782b('0x46')]({'where':{'IntervalId':_0x3a094f[_0x782b('0x4a')]['id']}});});}})[_0x782b('0x26')](respondWithResult(_0x4ac5c5,null))['catch'](handleError(_0x4ac5c5,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7cbcc08..fdcb27e 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 _0x3aea=['tools_intervals','rewrite','interval','getIntervals','map','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','Interval'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x3aea,0x158));var _0xa3ae=function(_0x2ba3cf,_0x5aece9){_0x2ba3cf=_0x2ba3cf-0x0;var _0x3f7b3d=_0x3aea[_0x2ba3cf];return _0x3f7b3d;};'use strict';var attributes=require(_0xa3ae('0x0'));var extensions=require(_0xa3ae('0x1'));var iftime=require(_0xa3ae('0x2'))[_0xa3ae('0x3')];module[_0xa3ae('0x4')]=function(_0x27bd95){return _0x27bd95[_0xa3ae('0x5')](_0xa3ae('0x6'),attributes,{'tableName':_0xa3ae('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d5c38){extensions[_0xa3ae('0x8')](_0x27bd95,_0x5d5c38);},'afterBulkCreate':function(_0x36780f,_0x568595,_0x36ad09){_0x36ad09();extensions[_0xa3ae('0x8')](_0x27bd95,_0x36780f[0x0]);},'afterUpdate':function(_0x17bfd3){extensions[_0xa3ae('0x8')](_0x27bd95,_0x17bfd3);},'afterDestroy':function(_0x51a4e4){extensions[_0xa3ae('0x8')](_0x27bd95,_0x51a4e4);}},'instanceMethods':{'ifTime':function(_0x55adc7=undefined,_0x33c298=new Date()){if(typeof this[_0xa3ae('0x9')]==='string'){return iftime(this['interval'],_0x55adc7,_0x33c298);}else{return this[_0xa3ae('0xa')]()['then'](function(_0x58e1d4){return Promise['all'](_0x58e1d4[_0xa3ae('0xb')](function(_0xdf0c6b){return _0xdf0c6b['ifTime'](_0x55adc7,_0x33c298);}));})['then'](function(_0x13d84e){return _0x13d84e[_0xa3ae('0xc')](function(_0x1f7fe6,_0x45902c){return _0x1f7fe6||_0x45902c;},![]);});}}}});}; \ No newline at end of file +var _0x67a9=['then','all','map','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','exports','define','tools_intervals','rewrite','string','interval'];(function(_0x1ad093,_0x3a0976){var _0x17ad77=function(_0x3cc267){while(--_0x3cc267){_0x1ad093['push'](_0x1ad093['shift']());}};_0x17ad77(++_0x3a0976);}(_0x67a9,0x1bd));var _0x967a=function(_0x380acf,_0x2f9541){_0x380acf=_0x380acf-0x0;var _0x15fd24=_0x67a9[_0x380acf];return _0x15fd24;};'use strict';var attributes=require(_0x967a('0x0'));var extensions=require(_0x967a('0x1'));var iftime=require(_0x967a('0x2'))[_0x967a('0x3')];module[_0x967a('0x4')]=function(_0x3de795){return _0x3de795[_0x967a('0x5')]('Interval',attributes,{'tableName':_0x967a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f5450){extensions['rewrite'](_0x3de795,_0x4f5450);},'afterBulkCreate':function(_0x5985c4,_0x47ac88,_0xd52f91){_0xd52f91();extensions['rewrite'](_0x3de795,_0x5985c4[0x0]);},'afterUpdate':function(_0x4e625c){extensions[_0x967a('0x7')](_0x3de795,_0x4e625c);},'afterDestroy':function(_0x5363e1){extensions[_0x967a('0x7')](_0x3de795,_0x5363e1);}},'instanceMethods':{'ifTime':function(_0x8b05cc=undefined,_0x451bc3=new Date()){if(typeof this['interval']===_0x967a('0x8')){return iftime(this[_0x967a('0x9')],_0x8b05cc,_0x451bc3);}else{return this['getIntervals']()[_0x967a('0xa')](function(_0xf36074){return Promise[_0x967a('0xb')](_0xf36074[_0x967a('0xc')](function(_0x17cbe0){return _0x17cbe0['ifTime'](_0x8b05cc,_0x451bc3);}));})[_0x967a('0xa')](function(_0x22e67a){return _0x22e67a['reduce'](function(_0x3d2a51,_0x354ac2){return _0x3d2a51||_0x354ac2;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index ecaca8e..bddda87 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 _0x4ced=['silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','limit','include','map','attributes','model','then','error','message','ShowInterval','find','raw','where','debug','catch','all','ifTime','reduce','format','name','join','info','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervals','string','timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime'];(function(_0x271d02,_0x5cd222){var _0x14112d=function(_0x43c775){while(--_0x43c775){_0x271d02['push'](_0x271d02['shift']());}};_0x14112d(++_0x5cd222);}(_0x4ced,0x17c));var _0xd4ce=function(_0x1fd8e9,_0x5ed781){_0x1fd8e9=_0x1fd8e9-0x0;var _0x242caf=_0x4ced[_0x1fd8e9];return _0x242caf;};'use strict';var _=require(_0xd4ce('0x0'));var util=require(_0xd4ce('0x1'));var db=require(_0xd4ce('0x2'))['db'];var iftime=require(_0xd4ce('0x3'))[_0xd4ce('0x4')];var logger=require(_0xd4ce('0x5'))(_0xd4ce('0x6'));exports[_0xd4ce('0x7')]=function(_0x138bef){var _0x33dfa3=this;return new Promise(function(_0x1abaef,_0x563413){return db[_0xd4ce('0x8')][_0xd4ce('0x9')]({'raw':_0x138bef[_0xd4ce('0xa')]?_0x138bef['options']['raw']===undefined?!![]:![]:!![],'where':_0x138bef['options']?_0x138bef['options']['where']||null:null,'attributes':_0x138bef[_0xd4ce('0xa')]?_0x138bef['options']['attributes']||null:null,'limit':_0x138bef[_0xd4ce('0xa')]?_0x138bef[_0xd4ce('0xa')][_0xd4ce('0xb')]||null:null,'include':_0x138bef[_0xd4ce('0xa')]?_0x138bef[_0xd4ce('0xa')][_0xd4ce('0xc')]?_[_0xd4ce('0xd')](_0x138bef['options']['include'],function(_0x16d877){return{'model':db[_0x16d877['model']],'as':_0x16d877['as'],'attributes':_0x16d877[_0xd4ce('0xe')],'include':_0x16d877[_0xd4ce('0xc')]?_['map'](_0x16d877['include'],function(_0x3f0127){return{'model':db[_0x3f0127[_0xd4ce('0xf')]],'as':_0x3f0127['as'],'attributes':_0x3f0127[_0xd4ce('0xe')],'include':_0x3f0127[_0xd4ce('0xc')]?_[_0xd4ce('0xd')](_0x3f0127[_0xd4ce('0xc')],function(_0x3348ad){return{'model':db[_0x3348ad[_0xd4ce('0xf')]],'as':_0x3348ad['as'],'attributes':_0x3348ad['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4ce('0x10')](function(_0x1c31ec){logger['info'](_0xd4ce('0x7'),_0x138bef);logger['debug']('GetInterval',_0x138bef,JSON['stringify'](_0x1c31ec));_0x1abaef(_0x1c31ec);})['catch'](function(_0xe65ab6){logger[_0xd4ce('0x11')](_0xd4ce('0x7'),_0xe65ab6['message'],_0x138bef);_0x563413(_0x33dfa3[_0xd4ce('0x11')](0x1f4,_0xe65ab6[_0xd4ce('0x12')]));});});};exports[_0xd4ce('0x13')]=function(_0x16f279){var _0x38c779=this;return new Promise(function(_0x32c4c6,_0x307706){return db[_0xd4ce('0x8')][_0xd4ce('0x14')]({'raw':_0x16f279[_0xd4ce('0xa')]?_0x16f279[_0xd4ce('0xa')][_0xd4ce('0x15')]===undefined?!![]:![]:!![],'where':_0x16f279['options']?_0x16f279[_0xd4ce('0xa')][_0xd4ce('0x16')]||null:null,'attributes':_0x16f279['options']?_0x16f279[_0xd4ce('0xa')][_0xd4ce('0xe')]||null:null,'include':_0x16f279[_0xd4ce('0xa')]?_0x16f279[_0xd4ce('0xa')][_0xd4ce('0xc')]?_[_0xd4ce('0xd')](_0x16f279[_0xd4ce('0xa')][_0xd4ce('0xc')],function(_0x440b4a){return{'model':db[_0x440b4a[_0xd4ce('0xf')]],'as':_0x440b4a['as'],'attributes':_0x440b4a[_0xd4ce('0xe')],'include':_0x440b4a[_0xd4ce('0xc')]?_[_0xd4ce('0xd')](_0x440b4a[_0xd4ce('0xc')],function(_0xa4ee59){return{'model':db[_0xa4ee59['model']],'as':_0xa4ee59['as'],'attributes':_0xa4ee59['attributes'],'include':_0xa4ee59[_0xd4ce('0xc')]?_[_0xd4ce('0xd')](_0xa4ee59[_0xd4ce('0xc')],function(_0x44e2c7){return{'model':db[_0x44e2c7[_0xd4ce('0xf')]],'as':_0x44e2c7['as'],'attributes':_0x44e2c7['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4ce('0x10')](function(_0x4049bd){logger['info']('ShowInterval',_0x16f279);logger[_0xd4ce('0x17')]('ShowInterval',_0x16f279,JSON['stringify'](_0x4049bd));_0x32c4c6(_0x4049bd);})[_0xd4ce('0x18')](function(_0x556e38){logger['error'](_0xd4ce('0x13'),_0x556e38['message'],_0x16f279);_0x307706(_0x38c779[_0xd4ce('0x11')](0x1f4,_0x556e38[_0xd4ce('0x12')]));});});};function checkArrayOfIntervals(_0x3c6d46,_0x2042d6){var _0x5d7676=[];return db[_0xd4ce('0x8')][_0xd4ce('0x9')]({'where':{'id':_0x3c6d46}})[_0xd4ce('0x10')](function(_0x27abfc){_0x5d7676=_0x27abfc;return Promise[_0xd4ce('0x19')](_0x5d7676[_0xd4ce('0xd')](function(_0x563185){return _0x563185[_0xd4ce('0x1a')](_0x2042d6);}));})[_0xd4ce('0x10')](function(_0x3c9538){var _0x59d521=_0x3c9538[_0xd4ce('0x1b')](function(_0xfc0e90,_0x1c9881){return _0xfc0e90||_0x1c9881;},![]);logger['info'](util[_0xd4ce('0x1c')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5d7676[_0xd4ce('0xd')](function(_0x3d80bc){return _0x3d80bc[_0xd4ce('0x1d')];})[_0xd4ce('0x1e')](',\x20'),_0x5d7676[_0xd4ce('0xd')](function(_0x4c7878){return _0x4c7878['id'];})[_0xd4ce('0x1e')](',\x20')));return _0x59d521;});}function checkSingleInterval(_0x5c2b17,_0x452328){return db[_0xd4ce('0x8')]['findById'](_0x5c2b17)[_0xd4ce('0x10')](function(_0x465c5a){if(_0x465c5a){logger[_0xd4ce('0x1f')](util[_0xd4ce('0x1c')](_0xd4ce('0x20'),_0x465c5a['name'],_0x465c5a['id']));return _0x465c5a[_0xd4ce('0x1a')](_0x452328);}});}exports[_0xd4ce('0x21')]=function(_0x4302c4){var _0x46de8a=_0x4302c4['intervalIds'];var _0x566a24=Array['isArray'](_0x4302c4[_0xd4ce('0x22')])?_0x4302c4[_0xd4ce('0x22')]:typeof _0x4302c4[_0xd4ce('0x22')]===_0xd4ce('0x23')?[_0x4302c4[_0xd4ce('0x22')]]:[];var _0x5da48c=_0x4302c4[_0xd4ce('0x24')]||undefined;var _0x11be13=![];if(_0x566a24['length']){logger['info'](util[_0xd4ce('0x1c')](_0xd4ce('0x25'),_0x566a24[_0xd4ce('0x1e')](';\x20')));}if(_0x5da48c){logger[_0xd4ce('0x1f')](util['format'](_0xd4ce('0x26'),_0x5da48c));}logger[_0xd4ce('0x17')](_0xd4ce('0x27'),_0x11be13);logger[_0xd4ce('0x28')](_0xd4ce('0x21'),_0x4302c4);return Promise[_0xd4ce('0x29')]()[_0xd4ce('0x10')](function(){if(Array['isArray'](_0x46de8a)){return checkArrayOfIntervals(_0x46de8a,_0x5da48c);}else if(_0x46de8a){return checkSingleInterval(_0x46de8a,_0x5da48c);}})[_0xd4ce('0x10')](function(_0x2d31b9){var _0x164f63=_0x566a24[_0xd4ce('0x1b')](function(_0x203785,_0x10bba3){return _0x203785||iftime(_0x10bba3,_0x5da48c);},![]);_0x11be13=_0x2d31b9||_0x164f63;return _0x11be13;})[_0xd4ce('0x18')](function(_0x367aac){logger['error'](_0xd4ce('0x21'),_0x4302c4,_0x367aac);throw this[_0xd4ce('0x11')](0x1f4,_0x367aac[_0xd4ce('0x12')]);});}; \ No newline at end of file +var _0xba61=['include','info','debug','stringify','catch','error','message','ShowInterval','find','then','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','ifTime','IntervalIftime','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','map','model'];(function(_0x5bcca2,_0x5d6105){var _0x1cfaf6=function(_0x97e5ae){while(--_0x97e5ae){_0x5bcca2['push'](_0x5bcca2['shift']());}};_0x1cfaf6(++_0x5d6105);}(_0xba61,0x17b));var _0x1ba6=function(_0x5f12df,_0xe8b0c4){_0x5f12df=_0x5f12df-0x0;var _0x3718dd=_0xba61[_0x5f12df];return _0x3718dd;};'use strict';var _=require(_0x1ba6('0x0'));var util=require(_0x1ba6('0x1'));var db=require(_0x1ba6('0x2'))['db'];var iftime=require(_0x1ba6('0x3'))[_0x1ba6('0x4')];var logger=require(_0x1ba6('0x5'))(_0x1ba6('0x6'));exports[_0x1ba6('0x7')]=function(_0x21e50d){var _0x376248=this;return new Promise(function(_0x302d7d,_0x510cc3){return db[_0x1ba6('0x8')][_0x1ba6('0x9')]({'raw':_0x21e50d[_0x1ba6('0xa')]?_0x21e50d[_0x1ba6('0xa')][_0x1ba6('0xb')]===undefined?!![]:![]:!![],'where':_0x21e50d[_0x1ba6('0xa')]?_0x21e50d[_0x1ba6('0xa')][_0x1ba6('0xc')]||null:null,'attributes':_0x21e50d[_0x1ba6('0xa')]?_0x21e50d[_0x1ba6('0xa')][_0x1ba6('0xd')]||null:null,'limit':_0x21e50d[_0x1ba6('0xa')]?_0x21e50d['options'][_0x1ba6('0xe')]||null:null,'include':_0x21e50d[_0x1ba6('0xa')]?_0x21e50d[_0x1ba6('0xa')]['include']?_[_0x1ba6('0xf')](_0x21e50d[_0x1ba6('0xa')]['include'],function(_0xba8db3){return{'model':db[_0xba8db3[_0x1ba6('0x10')]],'as':_0xba8db3['as'],'attributes':_0xba8db3[_0x1ba6('0xd')],'include':_0xba8db3[_0x1ba6('0x11')]?_[_0x1ba6('0xf')](_0xba8db3['include'],function(_0x55aa9b){return{'model':db[_0x55aa9b[_0x1ba6('0x10')]],'as':_0x55aa9b['as'],'attributes':_0x55aa9b[_0x1ba6('0xd')],'include':_0x55aa9b[_0x1ba6('0x11')]?_[_0x1ba6('0xf')](_0x55aa9b[_0x1ba6('0x11')],function(_0x513e20){return{'model':db[_0x513e20[_0x1ba6('0x10')]],'as':_0x513e20['as'],'attributes':_0x513e20[_0x1ba6('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35f94d){logger[_0x1ba6('0x12')](_0x1ba6('0x7'),_0x21e50d);logger[_0x1ba6('0x13')](_0x1ba6('0x7'),_0x21e50d,JSON[_0x1ba6('0x14')](_0x35f94d));_0x302d7d(_0x35f94d);})[_0x1ba6('0x15')](function(_0x527f3f){logger[_0x1ba6('0x16')](_0x1ba6('0x7'),_0x527f3f[_0x1ba6('0x17')],_0x21e50d);_0x510cc3(_0x376248['error'](0x1f4,_0x527f3f[_0x1ba6('0x17')]));});});};exports[_0x1ba6('0x18')]=function(_0x245683){var _0x3450c6=this;return new Promise(function(_0x3b0f06,_0x3076d4){return db[_0x1ba6('0x8')][_0x1ba6('0x19')]({'raw':_0x245683['options']?_0x245683[_0x1ba6('0xa')][_0x1ba6('0xb')]===undefined?!![]:![]:!![],'where':_0x245683[_0x1ba6('0xa')]?_0x245683[_0x1ba6('0xa')][_0x1ba6('0xc')]||null:null,'attributes':_0x245683['options']?_0x245683['options'][_0x1ba6('0xd')]||null:null,'include':_0x245683[_0x1ba6('0xa')]?_0x245683[_0x1ba6('0xa')]['include']?_[_0x1ba6('0xf')](_0x245683[_0x1ba6('0xa')][_0x1ba6('0x11')],function(_0x335d20){return{'model':db[_0x335d20['model']],'as':_0x335d20['as'],'attributes':_0x335d20[_0x1ba6('0xd')],'include':_0x335d20[_0x1ba6('0x11')]?_[_0x1ba6('0xf')](_0x335d20[_0x1ba6('0x11')],function(_0x402784){return{'model':db[_0x402784['model']],'as':_0x402784['as'],'attributes':_0x402784['attributes'],'include':_0x402784[_0x1ba6('0x11')]?_[_0x1ba6('0xf')](_0x402784['include'],function(_0x215396){return{'model':db[_0x215396[_0x1ba6('0x10')]],'as':_0x215396['as'],'attributes':_0x215396['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ba6('0x1a')](function(_0x1b7f5f){logger[_0x1ba6('0x12')]('ShowInterval',_0x245683);logger[_0x1ba6('0x13')]('ShowInterval',_0x245683,JSON['stringify'](_0x1b7f5f));_0x3b0f06(_0x1b7f5f);})[_0x1ba6('0x15')](function(_0x53cdf3){logger[_0x1ba6('0x16')](_0x1ba6('0x18'),_0x53cdf3[_0x1ba6('0x17')],_0x245683);_0x3076d4(_0x3450c6[_0x1ba6('0x16')](0x1f4,_0x53cdf3[_0x1ba6('0x17')]));});});};function checkArrayOfIntervals(_0x9f904f,_0x504bae){var _0x2f52ca=[];return db['Interval']['findAll']({'where':{'id':_0x9f904f}})[_0x1ba6('0x1a')](function(_0x396f58){_0x2f52ca=_0x396f58;return Promise[_0x1ba6('0x1b')](_0x2f52ca[_0x1ba6('0xf')](function(_0x2f15a1){return _0x2f15a1['ifTime'](_0x504bae);}));})[_0x1ba6('0x1a')](function(_0x1af368){var _0x18f983=_0x1af368[_0x1ba6('0x1c')](function(_0xbed18b,_0x6ce7d5){return _0xbed18b||_0x6ce7d5;},![]);logger[_0x1ba6('0x12')](util[_0x1ba6('0x1d')](_0x1ba6('0x1e'),_0x2f52ca[_0x1ba6('0xf')](function(_0x2b4da1){return _0x2b4da1[_0x1ba6('0x1f')];})[_0x1ba6('0x20')](',\x20'),_0x2f52ca['map'](function(_0x4fedd1){return _0x4fedd1['id'];})[_0x1ba6('0x20')](',\x20')));return _0x18f983;});}function checkSingleInterval(_0x357e04,_0x250ac0){return db[_0x1ba6('0x8')]['findById'](_0x357e04)['then'](function(_0x51347d){if(_0x51347d){logger[_0x1ba6('0x12')](util[_0x1ba6('0x1d')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x51347d[_0x1ba6('0x1f')],_0x51347d['id']));return _0x51347d[_0x1ba6('0x21')](_0x250ac0);}});}exports[_0x1ba6('0x22')]=function(_0x574819){var _0x541bc4=_0x574819['intervalIds'];var _0x2de783=Array[_0x1ba6('0x23')](_0x574819[_0x1ba6('0x24')])?_0x574819['intervals']:typeof _0x574819['intervals']===_0x1ba6('0x25')?[_0x574819[_0x1ba6('0x24')]]:[];var _0x1b7e60=_0x574819[_0x1ba6('0x26')]||undefined;var _0x145b04=![];if(_0x2de783[_0x1ba6('0x27')]){logger[_0x1ba6('0x12')](util['format'](_0x1ba6('0x28'),_0x2de783[_0x1ba6('0x20')](';\x20')));}if(_0x1b7e60){logger[_0x1ba6('0x12')](util[_0x1ba6('0x1d')](_0x1ba6('0x29'),_0x1b7e60));}logger[_0x1ba6('0x13')]('Iftime',_0x145b04);logger[_0x1ba6('0x2a')](_0x1ba6('0x22'),_0x574819);return Promise[_0x1ba6('0x2b')]()[_0x1ba6('0x1a')](function(){if(Array['isArray'](_0x541bc4)){return checkArrayOfIntervals(_0x541bc4,_0x1b7e60);}else if(_0x541bc4){return checkSingleInterval(_0x541bc4,_0x1b7e60);}})[_0x1ba6('0x1a')](function(_0x421eb7){var _0xd7741c=_0x2de783[_0x1ba6('0x1c')](function(_0x3a87e9,_0x230cbb){return _0x3a87e9||iftime(_0x230cbb,_0x1b7e60);},![]);_0x145b04=_0x421eb7||_0xd7741c;return _0x145b04;})[_0x1ba6('0x15')](function(_0x377e7a){logger['error'](_0x1ba6('0x22'),_0x574819,_0x377e7a);throw this[_0x1ba6('0x16')](0x1f4,_0x377e7a[_0x1ba6('0x17')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 951672c..e30612c 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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x466613,_0x56a7e3){var _0x13a954=function(_0x36f270){while(--_0x36f270){_0x466613['push'](_0x466613['shift']());}};_0x13a954(++_0x56a7e3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37f56a,_0xbc6767){_0x37f56a=_0x37f56a-0x0;var _0x5669ce=_0x5f2f[_0x37f56a];return _0x5669ce;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file +var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a34e690..15e3808 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 _0x0c6c=['error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','write','send','body','headers','x-forwarded-for','connection','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','Report','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','application/json','setEncoding','utf8','data','end','status'];(function(_0x193ed0,_0x739ca4){var _0x24bd99=function(_0xc78f79){while(--_0xc78f79){_0x193ed0['push'](_0x193ed0['shift']());}};_0x24bd99(++_0x739ca4);}(_0x0c6c,0x120));var _0xc0c6=function(_0x4ec863,_0x85080a){_0x4ec863=_0x4ec863-0x0;var _0x2071fc=_0x0c6c[_0x4ec863];return _0x2071fc;};'use strict';var BPromise=require(_0xc0c6('0x0'));var https=require(_0xc0c6('0x1'));var logger=require(_0xc0c6('0x2'))(_0xc0c6('0x3'));var USERNAME='support';var PASSWORD=_0xc0c6('0x4');function openIssue(_0x284024,_0x5e7c9e){var _0x476ec3={'fields':{'project':{'key':_0x284024[_0xc0c6('0x5')]||_0xc0c6('0x6')},'summary':(_0x284024['summary']||_0xc0c6('0x7'))+'\x20from\x20'+_0x284024['ip'],'description':_0x284024['description']||JSON[_0xc0c6('0x8')](_0x284024),'issuetype':{'name':_0x284024[_0xc0c6('0x9')]||_0xc0c6('0xa')}}};_0x476ec3[_0xc0c6('0xb')][_0xc0c6('0xc')]=_0x284024['email'];_0x476ec3[_0xc0c6('0xb')][_0xc0c6('0xd')]=_0x284024['oldToken'];_0x476ec3['fields'][_0xc0c6('0xe')]=_0x284024[_0xc0c6('0xf')];_0x476ec3[_0xc0c6('0xb')][_0xc0c6('0x10')]=_0x284024[_0xc0c6('0x11')];_0x476ec3[_0xc0c6('0xb')]['customfield_11504']=_0x284024['reason'];_0x476ec3[_0xc0c6('0xb')][_0xc0c6('0x12')]=_0x284024['ip'];var _0x3aea1d={'host':_0xc0c6('0x13'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xc0c6('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xc0c6('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x1b5139=JSON['stringify'](_0x476ec3);var _0x3d4764=https['request'](_0x3aea1d,function(_0x49d53a){_0x49d53a[_0xc0c6('0x16')](_0xc0c6('0x17'));var _0x43d747='';_0x49d53a['on'](_0xc0c6('0x18'),function(_0x226b2a){_0x43d747+=_0x226b2a;});_0x49d53a['on'](_0xc0c6('0x19'),function(){if(_0x5e7c9e){return _0x5e7c9e[_0xc0c6('0x1a')](_0x49d53a['statusCode'])['json'](JSON['parse'](_0x43d747));}});});_0x3d4764['on'](_0xc0c6('0x1b'),function(_0x2ae755){if(_0x5e7c9e){return _0x5e7c9e['status'](0x1f4)['json']({'errors':[{'message':_0xc0c6('0x1c'),'type':'api.jira'}]});}});_0x3d4764[_0xc0c6('0x1d')](_0x1b5139);_0x3d4764[_0xc0c6('0x19')]();}exports['openIssue']=openIssue;exports[_0xc0c6('0x1e')]=function(_0x54fb27,_0x1c94ba){_0x54fb27[_0xc0c6('0x1f')]['ip']=_0x54fb27[_0xc0c6('0x20')][_0xc0c6('0x21')]||_0x54fb27[_0xc0c6('0x22')]['remoteAddress']||_0x54fb27['socket']['remoteAddress']||_0x54fb27[_0xc0c6('0x22')]['socket']['remoteAddress'];return openIssue(_0x54fb27[_0xc0c6('0x1f')],_0x1c94ba);}; \ No newline at end of file +var _0x2a3c=['body','headers','x-forwarded-for','connection','remoteAddress','socket','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','base64','stringify','request','setEncoding','utf8','end','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x2a3c,0x81));var _0xc2a3=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x2a3c[_0x2cfb58];return _0xd99951;};'use strict';var BPromise=require('bluebird');var https=require(_0xc2a3('0x0'));var logger=require('../../config/logger')(_0xc2a3('0x1'));var USERNAME=_0xc2a3('0x2');var PASSWORD=_0xc2a3('0x3');function openIssue(_0x5cdd45,_0x21d1a3){var _0x2e4b7e={'fields':{'project':{'key':_0x5cdd45[_0xc2a3('0x4')]||_0xc2a3('0x5')},'summary':(_0x5cdd45[_0xc2a3('0x6')]||'Report')+_0xc2a3('0x7')+_0x5cdd45['ip'],'description':_0x5cdd45['description']||JSON['stringify'](_0x5cdd45),'issuetype':{'name':_0x5cdd45[_0xc2a3('0x8')]||'Bug'}}};_0x2e4b7e[_0xc2a3('0x9')][_0xc2a3('0xa')]=_0x5cdd45[_0xc2a3('0xb')];_0x2e4b7e['fields'][_0xc2a3('0xc')]=_0x5cdd45[_0xc2a3('0xd')];_0x2e4b7e['fields']['customfield_11502']=_0x5cdd45['newToken'];_0x2e4b7e[_0xc2a3('0x9')][_0xc2a3('0xe')]=_0x5cdd45[_0xc2a3('0xf')];_0x2e4b7e['fields']['customfield_11504']=_0x5cdd45[_0xc2a3('0x10')];_0x2e4b7e[_0xc2a3('0x9')][_0xc2a3('0x11')]=_0x5cdd45['ip'];var _0x534358={'host':_0xc2a3('0x12'),'port':0x1bb,'path':_0xc2a3('0x13'),'method':_0xc2a3('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xc2a3('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xc2a3('0x16'))}};var _0x3be424=JSON[_0xc2a3('0x17')](_0x2e4b7e);var _0x5c3ac3=https[_0xc2a3('0x18')](_0x534358,function(_0x45f760){_0x45f760[_0xc2a3('0x19')](_0xc2a3('0x1a'));var _0x97fa23='';_0x45f760['on']('data',function(_0x5aba78){_0x97fa23+=_0x5aba78;});_0x45f760['on'](_0xc2a3('0x1b'),function(){if(_0x21d1a3){return _0x21d1a3['status'](_0x45f760[_0xc2a3('0x1c')])[_0xc2a3('0x1d')](JSON[_0xc2a3('0x1e')](_0x97fa23));}});});_0x5c3ac3['on']('error',function(_0x45671){if(_0x21d1a3){return _0x21d1a3['status'](0x1f4)[_0xc2a3('0x1d')]({'errors':[{'message':_0xc2a3('0x1f'),'type':_0xc2a3('0x20')}]});}});_0x5c3ac3[_0xc2a3('0x21')](_0x3be424);_0x5c3ac3[_0xc2a3('0x1b')]();}exports[_0xc2a3('0x22')]=openIssue;exports['send']=function(_0x59d436,_0x50c81f){_0x59d436[_0xc2a3('0x23')]['ip']=_0x59d436[_0xc2a3('0x24')][_0xc2a3('0x25')]||_0x59d436[_0xc2a3('0x26')][_0xc2a3('0x27')]||_0x59d436[_0xc2a3('0x28')][_0xc2a3('0x27')]||_0x59d436[_0xc2a3('0x26')]['socket'][_0xc2a3('0x27')];return openIssue(_0x59d436[_0xc2a3('0x23')],_0x50c81f);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 5188781..07b1573 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 _0xcb91=['get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller'];(function(_0x1ac9e5,_0x462ef5){var _0x51d2f8=function(_0x5d6330){while(--_0x5d6330){_0x1ac9e5['push'](_0x1ac9e5['shift']());}};_0x51d2f8(++_0x462ef5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0xcb91[_0x137d1d];return _0x485108;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0x11496d,_0x137678){var _0x52706f=function(_0x207e86){while(--_0x207e86){_0x11496d['push'](_0x11496d['shift']());}};_0x52706f(++_0x137678);}(_0xf4eb,0xec));var _0xbf4e=function(_0x538f02,_0x46db16){_0x538f02=_0x538f02-0x0;var _0x4545b5=_0xf4eb[_0x538f02];return _0x4545b5;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 1d543ba..91a2bb7 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(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x7a54,0x106));var _0x47a5=function(_0x2c5bf8,_0x42e58a){_0x2c5bf8=_0x2c5bf8-0x0;var _0x15f89a=_0x7a54[_0x2c5bf8];return _0x15f89a;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7a54,0x106));var _0x47a5=function(_0xfc6c90,_0x29eaf2){_0xfc6c90=_0xfc6c90-0x0;var _0x51ac44=_0x7a54[_0xfc6c90];return _0x51ac44;};'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 20c7a3b..f7b8f14 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 _0xe181=['keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','findAll','rows','catch','show','params','fields','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x2cac50,_0x320bb5){var _0x1b7d73=function(_0x1bca86){while(--_0x1bca86){_0x2cac50['push'](_0x2cac50['shift']());}};_0x1b7d73(++_0x320bb5);}(_0xe181,0x68));var _0x1e18=function(_0x33f3db,_0x19a892){_0x33f3db=_0x33f3db-0x0;var _0x2f7cbb=_0xe181[_0x33f3db];return _0x2f7cbb;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e18('0x1'));var jsonpatch=require(_0x1e18('0x2'));var rp=require(_0x1e18('0x3'));var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require(_0x1e18('0x6'));var util=require(_0x1e18('0x7'));var path=require('path');var sox=require(_0x1e18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1e18('0x9'));var _=require(_0x1e18('0xa'));var squel=require(_0x1e18('0xb'));var crypto=require(_0x1e18('0xc'));var jsforce=require(_0x1e18('0xd'));var deskjs=require(_0x1e18('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e18('0xf'));var Papa=require(_0x1e18('0x10'));var Redis=require(_0x1e18('0x11'));var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e18('0x15'))(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require(_0x1e18('0x18'));var licenseUtil=require(_0x1e18('0x19'));var db=require(_0x1e18('0x1a'))['db'];function respondWithStatusCode(_0x1743c3,_0x33a98d){_0x33a98d=_0x33a98d||0xcc;return function(_0x531e1b){if(_0x531e1b){return _0x1743c3[_0x1e18('0x1b')](_0x33a98d);}return _0x1743c3['status'](_0x33a98d)[_0x1e18('0x1c')]();};}function respondWithResult(_0x563eff,_0x404b7f){_0x404b7f=_0x404b7f||0xc8;return function(_0x36b583){if(_0x36b583){return _0x563eff[_0x1e18('0x1d')](_0x404b7f)[_0x1e18('0x1e')](_0x36b583);}};}function respondWithFilteredResult(_0x1687ba,_0x1e1ce6){return function(_0x39bc56){if(_0x39bc56){var _0x33fea1=typeof _0x1e1ce6[_0x1e18('0x1f')]===_0x1e18('0x20')&&typeof _0x1e1ce6[_0x1e18('0x21')]===_0x1e18('0x20');var _0x349f3c=_0x39bc56[_0x1e18('0x22')];var _0x21b851=_0x33fea1?0x0:_0x1e1ce6['offset'];var _0x1c91d2=_0x33fea1?_0x39bc56[_0x1e18('0x22')]:_0x1e1ce6[_0x1e18('0x1f')]+_0x1e1ce6[_0x1e18('0x21')];var _0x2834ee;if(_0x1c91d2>=_0x349f3c){_0x1c91d2=_0x349f3c;_0x2834ee=0xc8;}else{_0x2834ee=0xce;}_0x1687ba[_0x1e18('0x1d')](_0x2834ee);return _0x1687ba[_0x1e18('0x23')](_0x1e18('0x24'),_0x21b851+'-'+_0x1c91d2+'/'+_0x349f3c)[_0x1e18('0x1e')](_0x39bc56);}return null;};}function patchUpdates(_0x22baca){return function(_0x2489c3){try{jsonpatch[_0x1e18('0x25')](_0x2489c3,_0x22baca,!![]);}catch(_0x3c4fdf){return BPromise[_0x1e18('0x26')](_0x3c4fdf);}return _0x2489c3[_0x1e18('0x27')]();};}function saveUpdates(_0x975df0,_0x3fd0a7){return function(_0x5eb6b4){if(_0x5eb6b4){return _0x5eb6b4[_0x1e18('0x28')](_0x975df0)[_0x1e18('0x29')](function(_0x3e9b2c){return _0x3e9b2c;});}return null;};}function removeEntity(_0x52d5e2,_0xf74622){return function(_0xdda2ce){if(_0xdda2ce){return _0xdda2ce[_0x1e18('0x2a')]()[_0x1e18('0x29')](function(){_0x52d5e2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6fa4db,_0x53f9d7){return function(_0x5bb03c){if(!_0x5bb03c){_0x6fa4db['sendStatus'](0x194);}return _0x5bb03c;};}function handleError(_0x32a196,_0x29cac0){_0x29cac0=_0x29cac0||0x1f4;return function(_0x41b67d){logger[_0x1e18('0x2b')](_0x41b67d[_0x1e18('0x2c')]);if(_0x41b67d[_0x1e18('0x2d')]){delete _0x41b67d[_0x1e18('0x2d')];}_0x32a196[_0x1e18('0x1d')](_0x29cac0)[_0x1e18('0x2e')](_0x41b67d);};}exports[_0x1e18('0x2f')]=function(_0x1015a3,_0x42c638){var _0x40d0af={},_0x1be225={},_0x558d01={'count':0x0,'rows':[]};var _0x57000b=_['map'](db[_0x1e18('0x30')][_0x1e18('0x31')],function(_0x1f75cd){return{'name':_0x1f75cd[_0x1e18('0x32')],'type':_0x1f75cd[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x1be225[_0x1e18('0x35')]=_[_0x1e18('0x36')](_0x57000b,'name');_0x1be225[_0x1e18('0x37')]=_[_0x1e18('0x38')](_0x1015a3['query']);_0x1be225[_0x1e18('0x39')]=_[_0x1e18('0x3a')](_0x1be225[_0x1e18('0x35')],_0x1be225['query']);_0x40d0af[_0x1e18('0x3b')]=_['intersection'](_0x1be225['model'],qs['fields'](_0x1015a3[_0x1e18('0x37')]['fields']));_0x40d0af[_0x1e18('0x3b')]=_0x40d0af[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x40d0af['attributes']:_0x1be225['model'];if(!_0x1015a3[_0x1e18('0x37')][_0x1e18('0x3d')](_0x1e18('0x3e'))){_0x40d0af[_0x1e18('0x21')]=qs[_0x1e18('0x21')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x21')]);_0x40d0af[_0x1e18('0x1f')]=qs[_0x1e18('0x1f')](_0x1015a3[_0x1e18('0x37')][_0x1e18('0x1f')]);}_0x40d0af[_0x1e18('0x3f')]=qs['sort'](_0x1015a3['query'][_0x1e18('0x40')]);_0x40d0af[_0x1e18('0x41')]=qs[_0x1e18('0x39')](_['pick'](_0x1015a3[_0x1e18('0x37')],_0x1be225['filters']),_0x57000b);if(_0x1015a3[_0x1e18('0x37')]['filter']){_0x40d0af['where']=_[_0x1e18('0x42')](_0x40d0af[_0x1e18('0x41')],{'$or':_[_0x1e18('0x36')](_0x57000b,function(_0x206b44){if(_0x206b44[_0x1e18('0x33')]!==_0x1e18('0x43')){var _0x4e2ca3={};_0x4e2ca3[_0x206b44[_0x1e18('0x2d')]]={'$like':'%'+_0x1015a3[_0x1e18('0x37')][_0x1e18('0x44')]+'%'};return _0x4e2ca3;}})});}_0x40d0af=_[_0x1e18('0x42')]({},_0x40d0af,_0x1015a3['options']);var _0x11f839={'where':_0x40d0af['where']};return db[_0x1e18('0x30')][_0x1e18('0x22')](_0x11f839)['then'](function(_0x41c2bd){_0x558d01[_0x1e18('0x22')]=_0x41c2bd;if(_0x1015a3['query']['includeAll']){_0x40d0af['include']=[{'all':!![]}];}return db[_0x1e18('0x30')][_0x1e18('0x45')](_0x40d0af);})[_0x1e18('0x29')](function(_0x602a85){_0x558d01[_0x1e18('0x46')]=_0x602a85;return _0x558d01;})[_0x1e18('0x29')](respondWithFilteredResult(_0x42c638,_0x40d0af))[_0x1e18('0x47')](handleError(_0x42c638,null));};exports[_0x1e18('0x48')]=function(_0x1cae7e,_0x354832){var _0x16ee40={'raw':!![],'where':{'id':_0x1cae7e[_0x1e18('0x49')]['id']}},_0x4821f9={};_0x4821f9['model']=_[_0x1e18('0x38')](db[_0x1e18('0x30')]['rawAttributes']);_0x4821f9['query']=_['keys'](_0x1cae7e[_0x1e18('0x37')]);_0x4821f9[_0x1e18('0x39')]=_['intersection'](_0x4821f9[_0x1e18('0x35')],_0x4821f9[_0x1e18('0x37')]);_0x16ee40['attributes']=_['intersection'](_0x4821f9[_0x1e18('0x35')],qs[_0x1e18('0x4a')](_0x1cae7e[_0x1e18('0x37')][_0x1e18('0x4a')]));_0x16ee40[_0x1e18('0x3b')]=_0x16ee40[_0x1e18('0x3b')][_0x1e18('0x3c')]?_0x16ee40[_0x1e18('0x3b')]:_0x4821f9[_0x1e18('0x35')];if(_0x1cae7e[_0x1e18('0x37')]['includeAll']){_0x16ee40['include']=[{'all':!![]}];}_0x16ee40=_[_0x1e18('0x42')]({},_0x16ee40,_0x1cae7e[_0x1e18('0x4b')]);return db[_0x1e18('0x30')][_0x1e18('0x4c')](_0x16ee40)[_0x1e18('0x29')](handleEntityNotFound(_0x354832,null))[_0x1e18('0x29')](respondWithResult(_0x354832,null))[_0x1e18('0x47')](handleError(_0x354832,null));};exports['create']=function(_0x54f69b,_0x54cd71){return db[_0x1e18('0x30')][_0x1e18('0x4d')](_0x54f69b[_0x1e18('0x4e')],{})[_0x1e18('0x29')](respondWithResult(_0x54cd71,0xc9))[_0x1e18('0x47')](handleError(_0x54cd71,null));};exports[_0x1e18('0x28')]=function(_0x191c18,_0x190af4){if(_0x191c18[_0x1e18('0x4e')]['id']){delete _0x191c18[_0x1e18('0x4e')]['id'];}return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x191c18[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x190af4,null))[_0x1e18('0x29')](saveUpdates(_0x191c18[_0x1e18('0x4e')],null))[_0x1e18('0x29')](respondWithResult(_0x190af4,null))[_0x1e18('0x47')](handleError(_0x190af4,null));};exports[_0x1e18('0x2a')]=function(_0x11d573,_0x5d4cbb){return db[_0x1e18('0x30')][_0x1e18('0x4c')]({'where':{'id':_0x11d573[_0x1e18('0x49')]['id']}})[_0x1e18('0x29')](handleEntityNotFound(_0x5d4cbb,null))[_0x1e18('0x29')](removeEntity(_0x5d4cbb,null))['catch'](handleError(_0x5d4cbb,null));};exports['describe']=function(_0x16b51a,_0x30dc06){return db['JscriptyAnswerReport'][_0x1e18('0x4f')]()[_0x1e18('0x29')](respondWithResult(_0x30dc06,null))[_0x1e18('0x47')](handleError(_0x30dc06,null));}; \ No newline at end of file +var _0x07d7=['undefined','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','JscriptyAnswerReport','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','offset'];(function(_0x2ac7e1,_0x4c6b41){var _0x291990=function(_0x1fa9ba){while(--_0x1fa9ba){_0x2ac7e1['push'](_0x2ac7e1['shift']());}};_0x291990(++_0x4c6b41);}(_0x07d7,0x85));var _0x707d=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0x07d7[_0x2962d5];return _0x273406;};'use strict';var emlformat=require(_0x707d('0x0'));var rimraf=require(_0x707d('0x1'));var zipdir=require(_0x707d('0x2'));var jsonpatch=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var moment=require(_0x707d('0x5'));var BPromise=require(_0x707d('0x6'));var Mustache=require(_0x707d('0x7'));var util=require(_0x707d('0x8'));var path=require(_0x707d('0x9'));var sox=require(_0x707d('0xa'));var csv=require(_0x707d('0xb'));var ejs=require(_0x707d('0xc'));var fs=require('fs');var fs_extra=require(_0x707d('0xd'));var _=require(_0x707d('0xe'));var squel=require(_0x707d('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x707d('0x10'));var toCsv=require(_0x707d('0xb'));var querystring=require(_0x707d('0x11'));var Papa=require(_0x707d('0x12'));var Redis=require(_0x707d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x707d('0x14'));var as=require(_0x707d('0x15'));var hardwareService=require(_0x707d('0x16'));var logger=require('../../config/logger')(_0x707d('0x17'));var utils=require(_0x707d('0x18'));var config=require(_0x707d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aabfe,_0x252e8c){_0x252e8c=_0x252e8c||0xcc;return function(_0x7cd32b){if(_0x7cd32b){return _0x5aabfe[_0x707d('0x1a')](_0x252e8c);}return _0x5aabfe['status'](_0x252e8c)[_0x707d('0x1b')]();};}function respondWithResult(_0x52c447,_0x1c18a6){_0x1c18a6=_0x1c18a6||0xc8;return function(_0x42e27f){if(_0x42e27f){return _0x52c447['status'](_0x1c18a6)['json'](_0x42e27f);}};}function respondWithFilteredResult(_0x30d583,_0x5b4700){return function(_0x2f993c){if(_0x2f993c){var _0x2c63c9=typeof _0x5b4700[_0x707d('0x1c')]===_0x707d('0x1d')&&typeof _0x5b4700[_0x707d('0x1e')]===_0x707d('0x1d');var _0x318251=_0x2f993c['count'];var _0x1d3fe6=_0x2c63c9?0x0:_0x5b4700[_0x707d('0x1c')];var _0x3617c3=_0x2c63c9?_0x2f993c['count']:_0x5b4700[_0x707d('0x1c')]+_0x5b4700[_0x707d('0x1e')];var _0xf5375f;if(_0x3617c3>=_0x318251){_0x3617c3=_0x318251;_0xf5375f=0xc8;}else{_0xf5375f=0xce;}_0x30d583[_0x707d('0x1f')](_0xf5375f);return _0x30d583[_0x707d('0x20')](_0x707d('0x21'),_0x1d3fe6+'-'+_0x3617c3+'/'+_0x318251)[_0x707d('0x22')](_0x2f993c);}return null;};}function patchUpdates(_0x446629){return function(_0x33a726){try{jsonpatch[_0x707d('0x23')](_0x33a726,_0x446629,!![]);}catch(_0x2da0c0){return BPromise[_0x707d('0x24')](_0x2da0c0);}return _0x33a726[_0x707d('0x25')]();};}function saveUpdates(_0x3dc9c9,_0xd97d6b){return function(_0x30d175){if(_0x30d175){return _0x30d175[_0x707d('0x26')](_0x3dc9c9)['then'](function(_0x24ba23){return _0x24ba23;});}return null;};}function removeEntity(_0x487a9c,_0xe548a4){return function(_0x139ad5){if(_0x139ad5){return _0x139ad5[_0x707d('0x27')]()[_0x707d('0x28')](function(){_0x487a9c[_0x707d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x115e5c,_0x5b2db7){return function(_0x3760bb){if(!_0x3760bb){_0x115e5c[_0x707d('0x1a')](0x194);}return _0x3760bb;};}function handleError(_0x2d8830,_0x26d4ee){_0x26d4ee=_0x26d4ee||0x1f4;return function(_0x40551d){logger[_0x707d('0x29')](_0x40551d[_0x707d('0x2a')]);if(_0x40551d[_0x707d('0x2b')]){delete _0x40551d[_0x707d('0x2b')];}_0x2d8830[_0x707d('0x1f')](_0x26d4ee)[_0x707d('0x2c')](_0x40551d);};}exports[_0x707d('0x2d')]=function(_0x38b44b,_0xeb85df){var _0x2102e6={},_0x309ded={},_0x599ba6={'count':0x0,'rows':[]};var _0x17bb4e=_[_0x707d('0x2e')](db[_0x707d('0x2f')]['rawAttributes'],function(_0x5e0ff9){return{'name':_0x5e0ff9['fieldName'],'type':_0x5e0ff9[_0x707d('0x30')][_0x707d('0x31')]};});_0x309ded[_0x707d('0x32')]=_[_0x707d('0x2e')](_0x17bb4e,_0x707d('0x2b'));_0x309ded[_0x707d('0x33')]=_[_0x707d('0x34')](_0x38b44b[_0x707d('0x33')]);_0x309ded[_0x707d('0x35')]=_[_0x707d('0x36')](_0x309ded[_0x707d('0x32')],_0x309ded[_0x707d('0x33')]);_0x2102e6['attributes']=_[_0x707d('0x36')](_0x309ded[_0x707d('0x32')],qs[_0x707d('0x37')](_0x38b44b[_0x707d('0x33')][_0x707d('0x37')]));_0x2102e6['attributes']=_0x2102e6[_0x707d('0x38')][_0x707d('0x39')]?_0x2102e6['attributes']:_0x309ded[_0x707d('0x32')];if(!_0x38b44b[_0x707d('0x33')][_0x707d('0x3a')](_0x707d('0x3b'))){_0x2102e6[_0x707d('0x1e')]=qs[_0x707d('0x1e')](_0x38b44b[_0x707d('0x33')][_0x707d('0x1e')]);_0x2102e6[_0x707d('0x1c')]=qs['offset'](_0x38b44b[_0x707d('0x33')][_0x707d('0x1c')]);}_0x2102e6[_0x707d('0x3c')]=qs[_0x707d('0x3d')](_0x38b44b[_0x707d('0x33')]['sort']);_0x2102e6[_0x707d('0x3e')]=qs[_0x707d('0x35')](_[_0x707d('0x3f')](_0x38b44b['query'],_0x309ded[_0x707d('0x35')]),_0x17bb4e);if(_0x38b44b['query'][_0x707d('0x40')]){_0x2102e6[_0x707d('0x3e')]=_[_0x707d('0x41')](_0x2102e6[_0x707d('0x3e')],{'$or':_['map'](_0x17bb4e,function(_0x5b3260){if(_0x5b3260[_0x707d('0x30')]!==_0x707d('0x42')){var _0x48d8e6={};_0x48d8e6[_0x5b3260['name']]={'$like':'%'+_0x38b44b[_0x707d('0x33')]['filter']+'%'};return _0x48d8e6;}})});}_0x2102e6=_['merge']({},_0x2102e6,_0x38b44b[_0x707d('0x43')]);var _0x35d3a0={'where':_0x2102e6[_0x707d('0x3e')]};return db[_0x707d('0x2f')][_0x707d('0x44')](_0x35d3a0)['then'](function(_0x59aba7){_0x599ba6[_0x707d('0x44')]=_0x59aba7;if(_0x38b44b[_0x707d('0x33')][_0x707d('0x45')]){_0x2102e6[_0x707d('0x46')]=[{'all':!![]}];}return db[_0x707d('0x2f')][_0x707d('0x47')](_0x2102e6);})[_0x707d('0x28')](function(_0x6553d2){_0x599ba6[_0x707d('0x48')]=_0x6553d2;return _0x599ba6;})[_0x707d('0x28')](respondWithFilteredResult(_0xeb85df,_0x2102e6))['catch'](handleError(_0xeb85df,null));};exports[_0x707d('0x49')]=function(_0x1b5acb,_0x483ecf){var _0xd27541={'raw':!![],'where':{'id':_0x1b5acb[_0x707d('0x4a')]['id']}},_0x186035={};_0x186035[_0x707d('0x32')]=_[_0x707d('0x34')](db['JscriptyAnswerReport'][_0x707d('0x4b')]);_0x186035[_0x707d('0x33')]=_[_0x707d('0x34')](_0x1b5acb[_0x707d('0x33')]);_0x186035[_0x707d('0x35')]=_[_0x707d('0x36')](_0x186035[_0x707d('0x32')],_0x186035[_0x707d('0x33')]);_0xd27541[_0x707d('0x38')]=_['intersection'](_0x186035[_0x707d('0x32')],qs['fields'](_0x1b5acb[_0x707d('0x33')][_0x707d('0x37')]));_0xd27541[_0x707d('0x38')]=_0xd27541[_0x707d('0x38')][_0x707d('0x39')]?_0xd27541[_0x707d('0x38')]:_0x186035[_0x707d('0x32')];if(_0x1b5acb[_0x707d('0x33')]['includeAll']){_0xd27541[_0x707d('0x46')]=[{'all':!![]}];}_0xd27541=_[_0x707d('0x41')]({},_0xd27541,_0x1b5acb[_0x707d('0x43')]);return db[_0x707d('0x2f')][_0x707d('0x4c')](_0xd27541)[_0x707d('0x28')](handleEntityNotFound(_0x483ecf,null))['then'](respondWithResult(_0x483ecf,null))[_0x707d('0x4d')](handleError(_0x483ecf,null));};exports[_0x707d('0x4e')]=function(_0x39843d,_0x3986d4){return db[_0x707d('0x2f')][_0x707d('0x4e')](_0x39843d['body'],{})['then'](respondWithResult(_0x3986d4,0xc9))[_0x707d('0x4d')](handleError(_0x3986d4,null));};exports[_0x707d('0x26')]=function(_0x5e1c34,_0x31ac73){if(_0x5e1c34[_0x707d('0x4f')]['id']){delete _0x5e1c34[_0x707d('0x4f')]['id'];}return db[_0x707d('0x2f')]['find']({'where':{'id':_0x5e1c34[_0x707d('0x4a')]['id']}})[_0x707d('0x28')](handleEntityNotFound(_0x31ac73,null))[_0x707d('0x28')](saveUpdates(_0x5e1c34['body'],null))[_0x707d('0x28')](respondWithResult(_0x31ac73,null))[_0x707d('0x4d')](handleError(_0x31ac73,null));};exports['destroy']=function(_0xe8a696,_0x4fa0f8){return db['JscriptyAnswerReport']['find']({'where':{'id':_0xe8a696[_0x707d('0x4a')]['id']}})[_0x707d('0x28')](handleEntityNotFound(_0x4fa0f8,null))[_0x707d('0x28')](removeEntity(_0x4fa0f8,null))[_0x707d('0x4d')](handleError(_0x4fa0f8,null));};exports[_0x707d('0x50')]=function(_0x19c741,_0x4d85a9){return db[_0x707d('0x2f')][_0x707d('0x50')]()['then'](respondWithResult(_0x4d85a9,null))['catch'](handleError(_0x4d85a9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 83a9057..fee1825 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 _0xdf8f=['JscriptyAnswerReport','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports'];(function(_0x37affd,_0x53e54d){var _0x5c385a=function(_0x246e90){while(--_0x246e90){_0x37affd['push'](_0x37affd['shift']());}};_0x5c385a(++_0x53e54d);}(_0xdf8f,0xdd));var _0xfdf8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xdf8f[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xfdf8('0x0'));var util=require(_0xfdf8('0x1'));var logger=require(_0xfdf8('0x2'))(_0xfdf8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfdf8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfdf8('0x5'));var config=require(_0xfdf8('0x6'));var attributes=require(_0xfdf8('0x7'));module[_0xfdf8('0x8')]=function(_0x50c57b,_0xc032aa){return _0x50c57b['define'](_0xfdf8('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd75=['moment','bluebird','request-promise','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api'];(function(_0x1ed22b,_0x1f3224){var _0x53802b=function(_0x21cb78){while(--_0x21cb78){_0x1ed22b['push'](_0x1ed22b['shift']());}};_0x53802b(++_0x1f3224);}(_0xfd75,0xf9));var _0x5fd7=function(_0x4a2fde,_0xfb92ae){_0x4a2fde=_0x4a2fde-0x0;var _0x1042c3=_0xfd75[_0x4a2fde];return _0x1042c3;};'use strict';var _=require(_0x5fd7('0x0'));var util=require(_0x5fd7('0x1'));var logger=require('../../config/logger')(_0x5fd7('0x2'));var moment=require(_0x5fd7('0x3'));var BPromise=require(_0x5fd7('0x4'));var rp=require(_0x5fd7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5fd7('0x6'));var config=require('../../config/environment');var attributes=require(_0x5fd7('0x7'));module[_0x5fd7('0x8')]=function(_0x5c2934,_0x2518fc){return _0x5c2934[_0x5fd7('0x9')](_0x5fd7('0xa'),attributes,{'tableName':_0x5fd7('0xb'),'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 2866d30..e60dcf8 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 _0x586e=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','JscriptyAnswerReport,\x20%s,\x20%s','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x235cb0,_0x503729){var _0x574c9f=function(_0x198de3){while(--_0x198de3){_0x235cb0['push'](_0x235cb0['shift']());}};_0x574c9f(++_0x503729);}(_0x586e,0x7f));var _0xe586=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0x586e[_0x212a37];return _0x5d0bf9;};'use strict';var _=require(_0xe586('0x0'));var util=require(_0xe586('0x1'));var moment=require(_0xe586('0x2'));var BPromise=require(_0xe586('0x3'));var rs=require(_0xe586('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe586('0x5'))['db'];var utils=require(_0xe586('0x6'));var logger=require(_0xe586('0x7'))(_0xe586('0x8'));var config=require('../../config/environment');var jayson=require(_0xe586('0x9'));var client=jayson[_0xe586('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee16e,_0x2b1293,_0x30dbe3){return new BPromise(function(_0x4cccca,_0x57c594){return client[_0xe586('0xb')](_0x3ee16e,_0x30dbe3)['then'](function(_0x4a4975){logger[_0xe586('0xc')](_0xe586('0xd'),_0x2b1293,'request\x20sent');logger['debug'](_0xe586('0xe'),_0x2b1293,_0xe586('0xf'),JSON[_0xe586('0x10')](_0x4a4975));if(_0x4a4975['error']){if(_0x4a4975[_0xe586('0x11')][_0xe586('0x12')]===0x1f4){logger[_0xe586('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x2b1293,_0x4a4975[_0xe586('0x11')]['message']);return _0x57c594(_0x4a4975[_0xe586('0x11')][_0xe586('0x13')]);}logger[_0xe586('0x11')](_0xe586('0xd'),_0x2b1293,_0x4a4975[_0xe586('0x11')][_0xe586('0x13')]);return _0x4cccca(_0x4a4975[_0xe586('0x11')]['message']);}else{logger[_0xe586('0xc')](_0xe586('0xd'),_0x2b1293,_0xe586('0xf'));_0x4cccca(_0x4a4975[_0xe586('0x14')][_0xe586('0x13')]);}})[_0xe586('0x15')](function(_0x1950ba){logger[_0xe586('0x11')](_0xe586('0xd'),_0x2b1293,_0x1950ba);_0x57c594(_0x1950ba);});});} \ No newline at end of file +var _0x4434=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3cdfb1,_0x32aefe){var _0x1ce4a0=function(_0x33a517){while(--_0x33a517){_0x3cdfb1['push'](_0x3cdfb1['shift']());}};_0x1ce4a0(++_0x32aefe);}(_0x4434,0xc9));var _0x4443=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x4434[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x4443('0x0'));var util=require(_0x4443('0x1'));var moment=require(_0x4443('0x2'));var BPromise=require(_0x4443('0x3'));var rs=require(_0x4443('0x4'));var fs=require('fs');var Redis=require(_0x4443('0x5'));var db=require(_0x4443('0x6'))['db'];var utils=require(_0x4443('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x4443('0x8'));var jayson=require(_0x4443('0x9'));var client=jayson['client'][_0x4443('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x211a24,_0x448b90,_0x19bea5){return new BPromise(function(_0xda0e40,_0x400f81){return client[_0x4443('0xb')](_0x211a24,_0x19bea5)[_0x4443('0xc')](function(_0x4fe3c0){logger[_0x4443('0xd')](_0x4443('0xe'),_0x448b90,'request\x20sent');logger[_0x4443('0xf')](_0x4443('0x10'),_0x448b90,_0x4443('0x11'),JSON['stringify'](_0x4fe3c0));if(_0x4fe3c0[_0x4443('0x12')]){if(_0x4fe3c0[_0x4443('0x12')]['code']===0x1f4){logger[_0x4443('0x12')](_0x4443('0xe'),_0x448b90,_0x4fe3c0['error'][_0x4443('0x13')]);return _0x400f81(_0x4fe3c0[_0x4443('0x12')][_0x4443('0x13')]);}logger[_0x4443('0x12')](_0x4443('0xe'),_0x448b90,_0x4fe3c0['error'][_0x4443('0x13')]);return _0xda0e40(_0x4fe3c0['error'][_0x4443('0x13')]);}else{logger[_0x4443('0xd')](_0x4443('0xe'),_0x448b90,_0x4443('0x11'));_0xda0e40(_0x4fe3c0[_0x4443('0x14')][_0x4443('0x13')]);}})[_0x4443('0x15')](function(_0x2208f1){logger[_0x4443('0x12')](_0x4443('0xe'),_0x448b90,_0x2208f1);_0x400f81(_0x2208f1);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index e197c27..7657134 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 _0x13e7=['30s','getSummary','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','get','/:id','show','getSessions','getAnswers'];(function(_0x493503,_0x351993){var _0x1986d0=function(_0x59a6a1){while(--_0x59a6a1){_0x493503['push'](_0x493503['shift']());}};_0x1986d0(++_0x351993);}(_0x13e7,0x182));var _0x713e=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x13e7[_0x492af5];return _0x59f529;};'use strict';var multer=require(_0x713e('0x0'));var util=require(_0x713e('0x1'));var path=require(_0x713e('0x2'));var timeout=require(_0x713e('0x3'));var express=require('express');var router=express[_0x713e('0x4')]();var fs_extra=require(_0x713e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x713e('0x6'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0x713e('0x7')](),controller['index']);router[_0x713e('0x8')](_0x713e('0x9'),auth[_0x713e('0x7')](),controller[_0x713e('0xa')]);router[_0x713e('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x713e('0xb')]);router[_0x713e('0x8')]('/:id/answers',auth[_0x713e('0x7')](),controller[_0x713e('0xc')]);router[_0x713e('0x8')]('/:id/summary',auth[_0x713e('0x7')](),timeout(_0x713e('0xd')),controller[_0x713e('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x713e('0xf')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller['clone']);router[_0x713e('0x10')](_0x713e('0x9'),auth[_0x713e('0x7')](),controller[_0x713e('0x11')]);router[_0x713e('0x12')]('/:id',auth[_0x713e('0x7')](),controller[_0x713e('0x13')]);module[_0x713e('0x14')]=router; \ No newline at end of file +var _0xeee0=['/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','clone','put','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index'];(function(_0x1e06c0,_0x3c8d32){var _0x20a073=function(_0x5e370f){while(--_0x5e370f){_0x1e06c0['push'](_0x1e06c0['shift']());}};_0x20a073(++_0x3c8d32);}(_0xeee0,0x1ec));var _0x0eee=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xeee0[_0x277721];return _0x286051;};'use strict';var multer=require(_0x0eee('0x0'));var util=require(_0x0eee('0x1'));var path=require('path');var timeout=require(_0x0eee('0x2'));var express=require(_0x0eee('0x3'));var router=express[_0x0eee('0x4')]();var fs_extra=require(_0x0eee('0x5'));var auth=require(_0x0eee('0x6'));var interaction=require(_0x0eee('0x7'));var config=require('../../config/environment');var controller=require(_0x0eee('0x8'));router[_0x0eee('0x9')]('/',auth[_0x0eee('0xa')](),controller[_0x0eee('0xb')]);router['get']('/:id',auth[_0x0eee('0xa')](),controller['show']);router[_0x0eee('0x9')](_0x0eee('0xc'),auth[_0x0eee('0xa')](),controller['getSessions']);router[_0x0eee('0x9')](_0x0eee('0xd'),auth[_0x0eee('0xa')](),controller[_0x0eee('0xe')]);router[_0x0eee('0x9')](_0x0eee('0xf'),auth[_0x0eee('0xa')](),timeout(_0x0eee('0x10')),controller['getSummary']);router[_0x0eee('0x11')]('/',auth[_0x0eee('0xa')](),controller[_0x0eee('0x12')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x0eee('0x13')]);router[_0x0eee('0x14')](_0x0eee('0x15'),auth[_0x0eee('0xa')](),controller[_0x0eee('0x16')]);router[_0x0eee('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 7f7442c..769f49e 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 _0xfc05=['isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','long','isObjectLike','setDataValue','formData'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfc05,0x76));var _0x5fc0=function(_0x1993bd,_0xe1994){_0x1993bd=_0x1993bd-0x0;var _0x2ed417=_0xfc05[_0x1993bd];return _0x2ed417;};'use strict';var Sequelize=require(_0x5fc0('0x0'));var _=require(_0x5fc0('0x1'));var util=require(_0x5fc0('0x2'));module[_0x5fc0('0x3')]={'name':{'type':Sequelize[_0x5fc0('0x4')],'unique':_0x5fc0('0x5')},'description':{'type':Sequelize[_0x5fc0('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x5fc0('0x6')),'set':function(_0x28e7e6){if(_[_0x5fc0('0x7')](_0x28e7e6)){this[_0x5fc0('0x8')](_0x5fc0('0x9'),JSON['stringify'](_0x28e7e6));}else if(_[_0x5fc0('0xa')](_0x28e7e6)){this['setDataValue'](_0x5fc0('0x9'),_0x28e7e6);}else{this[_0x5fc0('0x8')]('formData',util[_0x5fc0('0xb')](_0x5fc0('0xc'),this[_0x5fc0('0xd')](_0x5fc0('0x5'))||'',this['getDataValue'](_0x5fc0('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x5fc0('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x5fc0('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x260d=['stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','STRING','name','TEXT','setDataValue','formData'];(function(_0x3c07c7,_0x13d8f6){var _0x478c02=function(_0x2dd51a){while(--_0x2dd51a){_0x3c07c7['push'](_0x3c07c7['shift']());}};_0x478c02(++_0x13d8f6);}(_0x260d,0x165));var _0xd260=function(_0x164a8f,_0x1b38ae){_0x164a8f=_0x164a8f-0x0;var _0xb3e16=_0x260d[_0x164a8f];return _0xb3e16;};'use strict';var Sequelize=require(_0xd260('0x0'));var _=require('lodash');var util=require(_0xd260('0x1'));module['exports']={'name':{'type':Sequelize[_0xd260('0x2')],'unique':_0xd260('0x3')},'description':{'type':Sequelize[_0xd260('0x2')]},'formData':{'type':Sequelize[_0xd260('0x4')]('long'),'set':function(_0x4ce392){if(_['isObjectLike'](_0x4ce392)){this[_0xd260('0x5')](_0xd260('0x6'),JSON[_0xd260('0x7')](_0x4ce392));}else if(_[_0xd260('0x8')](_0x4ce392)){this['setDataValue']('formData',_0x4ce392);}else{this['setDataValue'](_0xd260('0x6'),util[_0xd260('0x9')](_0xd260('0xa'),this[_0xd260('0xb')](_0xd260('0x3'))||'',this[_0xd260('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd260('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd260('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 393e866..f48afd2 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 _0xbf77=['bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','JscriptyProject','includeAll','include','catch','show','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','body','role','userProfileId','getSessions','findOne','JscriptySessionReport','nolimit','order','findAll','getAnswers','ProjectId','JscriptyAnswerReport','rows','fromCharCode','toString','indexOf','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1b5ab2,_0x3b968c){var _0x259577=function(_0x39af1d){while(--_0x39af1d){_0x1b5ab2['push'](_0x1b5ab2['shift']());}};_0x259577(++_0x3b968c);}(_0xbf77,0xec));var _0x7bf7=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xbf77[_0x273c39];return _0x46d6b5;};'use strict';var emlformat=require(_0x7bf7('0x0'));var rimraf=require(_0x7bf7('0x1'));var zipdir=require(_0x7bf7('0x2'));var jsonpatch=require(_0x7bf7('0x3'));var rp=require(_0x7bf7('0x4'));var moment=require(_0x7bf7('0x5'));var BPromise=require(_0x7bf7('0x6'));var Mustache=require(_0x7bf7('0x7'));var util=require('util');var path=require(_0x7bf7('0x8'));var sox=require(_0x7bf7('0x9'));var csv=require(_0x7bf7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bf7('0xb'));var _=require(_0x7bf7('0xc'));var squel=require('squel');var crypto=require(_0x7bf7('0xd'));var jsforce=require(_0x7bf7('0xe'));var deskjs=require(_0x7bf7('0xf'));var toCsv=require(_0x7bf7('0xa'));var querystring=require('querystring');var Papa=require(_0x7bf7('0x10'));var Redis=require(_0x7bf7('0x11'));var authService=require(_0x7bf7('0x12'));var qs=require(_0x7bf7('0x13'));var as=require(_0x7bf7('0x14'));var hardwareService=require(_0x7bf7('0x15'));var logger=require(_0x7bf7('0x16'))(_0x7bf7('0x17'));var utils=require(_0x7bf7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7bf7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x358af0,_0x20b1e7){_0x20b1e7=_0x20b1e7||0xcc;return function(_0x4df560){if(_0x4df560){return _0x358af0[_0x7bf7('0x1a')](_0x20b1e7);}return _0x358af0[_0x7bf7('0x1b')](_0x20b1e7)[_0x7bf7('0x1c')]();};}function respondWithResult(_0x25417e,_0x3c204f){_0x3c204f=_0x3c204f||0xc8;return function(_0x16c12d){if(_0x16c12d){return _0x25417e[_0x7bf7('0x1b')](_0x3c204f)[_0x7bf7('0x1d')](_0x16c12d);}};}function respondWithFilteredResult(_0x22e730,_0x4f78f1){return function(_0x1f1ff4){if(_0x1f1ff4){var _0x1dba4d=typeof _0x4f78f1['offset']===_0x7bf7('0x1e')&&typeof _0x4f78f1[_0x7bf7('0x1f')]===_0x7bf7('0x1e');var _0x2bedd7=_0x1f1ff4[_0x7bf7('0x20')];var _0xd72252=_0x1dba4d?0x0:_0x4f78f1['offset'];var _0x41c0d1=_0x1dba4d?_0x1f1ff4[_0x7bf7('0x20')]:_0x4f78f1[_0x7bf7('0x21')]+_0x4f78f1[_0x7bf7('0x1f')];var _0x1bf1c1;if(_0x41c0d1>=_0x2bedd7){_0x41c0d1=_0x2bedd7;_0x1bf1c1=0xc8;}else{_0x1bf1c1=0xce;}_0x22e730[_0x7bf7('0x1b')](_0x1bf1c1);return _0x22e730[_0x7bf7('0x22')](_0x7bf7('0x23'),_0xd72252+'-'+_0x41c0d1+'/'+_0x2bedd7)[_0x7bf7('0x1d')](_0x1f1ff4);}return null;};}function patchUpdates(_0x4b164a){return function(_0x26aafc){try{jsonpatch[_0x7bf7('0x24')](_0x26aafc,_0x4b164a,!![]);}catch(_0x3ba286){return BPromise[_0x7bf7('0x25')](_0x3ba286);}return _0x26aafc[_0x7bf7('0x26')]();};}function saveUpdates(_0x28ee36,_0xf17450){return function(_0x21b02d){if(_0x21b02d){return _0x21b02d[_0x7bf7('0x27')](_0x28ee36)[_0x7bf7('0x28')](function(_0x14584){return _0x14584;});}return null;};}function removeEntity(_0xaca87e,_0x4a09eb){return function(_0x4584c4){if(_0x4584c4){return _0x4584c4[_0x7bf7('0x29')]()[_0x7bf7('0x28')](function(){var _0xf6dd77=_0x4584c4[_0x7bf7('0x2a')]({'plain':!![]});var _0x2d50d7=_0x7bf7('0x2b');return db[_0x7bf7('0x2c')]['destroy']({'where':{'type':_0x2d50d7,'resourceId':_0xf6dd77['id']}})['then'](function(){return _0x4584c4;});})[_0x7bf7('0x28')](function(){_0xaca87e[_0x7bf7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x303d84,_0x465664){return function(_0x30cd5d){if(!_0x30cd5d){_0x303d84[_0x7bf7('0x1a')](0x194);}return _0x30cd5d;};}function handleError(_0x111531,_0x58e36a){_0x58e36a=_0x58e36a||0x1f4;return function(_0x4be063){logger[_0x7bf7('0x2d')](_0x4be063[_0x7bf7('0x2e')]);if(_0x4be063[_0x7bf7('0x2f')]){delete _0x4be063[_0x7bf7('0x2f')];}_0x111531[_0x7bf7('0x1b')](_0x58e36a)[_0x7bf7('0x30')](_0x4be063);};}exports[_0x7bf7('0x31')]=function(_0xecc3cf,_0xaacc01){var _0x1549ef={},_0xa332ce={},_0x3f91be={'count':0x0,'rows':[]};var _0x337ab8=_[_0x7bf7('0x32')](db['JscriptyProject'][_0x7bf7('0x33')],function(_0x33c113){return{'name':_0x33c113['fieldName'],'type':_0x33c113[_0x7bf7('0x34')]['key']};});_0xa332ce[_0x7bf7('0x35')]=_['map'](_0x337ab8,'name');_0xa332ce[_0x7bf7('0x36')]=_[_0x7bf7('0x37')](_0xecc3cf['query']);_0xa332ce['filters']=_[_0x7bf7('0x38')](_0xa332ce[_0x7bf7('0x35')],_0xa332ce[_0x7bf7('0x36')]);_0x1549ef['attributes']=_[_0x7bf7('0x38')](_0xa332ce['model'],qs[_0x7bf7('0x39')](_0xecc3cf['query'][_0x7bf7('0x39')]));_0x1549ef[_0x7bf7('0x3a')]=_0x1549ef['attributes']['length']?_0x1549ef['attributes']:_0xa332ce[_0x7bf7('0x35')];if(!_0xecc3cf[_0x7bf7('0x36')][_0x7bf7('0x3b')]('nolimit')){_0x1549ef[_0x7bf7('0x1f')]=qs[_0x7bf7('0x1f')](_0xecc3cf[_0x7bf7('0x36')][_0x7bf7('0x1f')]);_0x1549ef[_0x7bf7('0x21')]=qs[_0x7bf7('0x21')](_0xecc3cf[_0x7bf7('0x36')]['offset']);}_0x1549ef['order']=qs[_0x7bf7('0x3c')](_0xecc3cf[_0x7bf7('0x36')][_0x7bf7('0x3c')]);_0x1549ef[_0x7bf7('0x3d')]=qs[_0x7bf7('0x3e')](_[_0x7bf7('0x3f')](_0xecc3cf[_0x7bf7('0x36')],_0xa332ce[_0x7bf7('0x3e')]),_0x337ab8);if(_0xecc3cf['query'][_0x7bf7('0x40')]){_0x1549ef[_0x7bf7('0x3d')]=_['merge'](_0x1549ef['where'],{'$or':_[_0x7bf7('0x32')](_0x337ab8,function(_0x4dca87){if(_0x4dca87[_0x7bf7('0x34')]!==_0x7bf7('0x41')){var _0x3f9587={};_0x3f9587[_0x4dca87[_0x7bf7('0x2f')]]={'$like':'%'+_0xecc3cf[_0x7bf7('0x36')][_0x7bf7('0x40')]+'%'};return _0x3f9587;}})});}_0x1549ef=_[_0x7bf7('0x42')]({},_0x1549ef,_0xecc3cf[_0x7bf7('0x43')]);var _0x2ca4f5={'where':_0x1549ef['where']};return db[_0x7bf7('0x44')]['count'](_0x2ca4f5)[_0x7bf7('0x28')](function(_0x53add7){_0x3f91be[_0x7bf7('0x20')]=_0x53add7;if(_0xecc3cf[_0x7bf7('0x36')][_0x7bf7('0x45')]){_0x1549ef[_0x7bf7('0x46')]=[{'all':!![]}];}return db[_0x7bf7('0x44')]['findAll'](_0x1549ef);})[_0x7bf7('0x28')](function(_0x46dd05){_0x3f91be['rows']=_0x46dd05;return _0x3f91be;})[_0x7bf7('0x28')](respondWithFilteredResult(_0xaacc01,_0x1549ef))[_0x7bf7('0x47')](handleError(_0xaacc01,null));};exports[_0x7bf7('0x48')]=function(_0x185175,_0x3470df){var _0x57ab9c={'raw':![],'where':{'id':_0x185175['params']['id']}},_0x494c6a={};_0x494c6a[_0x7bf7('0x35')]=_[_0x7bf7('0x37')](db[_0x7bf7('0x44')]['rawAttributes']);_0x494c6a[_0x7bf7('0x36')]=_[_0x7bf7('0x37')](_0x185175['query']);_0x494c6a[_0x7bf7('0x3e')]=_[_0x7bf7('0x38')](_0x494c6a[_0x7bf7('0x35')],_0x494c6a[_0x7bf7('0x36')]);_0x57ab9c['attributes']=_[_0x7bf7('0x38')](_0x494c6a[_0x7bf7('0x35')],qs[_0x7bf7('0x39')](_0x185175[_0x7bf7('0x36')][_0x7bf7('0x39')]));_0x57ab9c[_0x7bf7('0x3a')]=_0x57ab9c['attributes'][_0x7bf7('0x49')]?_0x57ab9c[_0x7bf7('0x3a')]:_0x494c6a['model'];if(_0x185175[_0x7bf7('0x36')][_0x7bf7('0x45')]){_0x57ab9c[_0x7bf7('0x46')]=[{'all':!![]}];}_0x57ab9c=_['merge']({},_0x57ab9c,_0x185175[_0x7bf7('0x43')]);return db['JscriptyProject'][_0x7bf7('0x4a')](_0x57ab9c)[_0x7bf7('0x28')](handleEntityNotFound(_0x3470df,null))[_0x7bf7('0x28')](respondWithResult(_0x3470df,null))[_0x7bf7('0x47')](handleError(_0x3470df,null));};exports[_0x7bf7('0x4b')]=function(_0x5edf0c,_0x4a7948){return db[_0x7bf7('0x44')][_0x7bf7('0x4b')](_0x5edf0c['body'],{})[_0x7bf7('0x28')](function(_0x4dae5c){var _0x47d2f1=_0x5edf0c[_0x7bf7('0x4c')][_0x7bf7('0x2a')]({'plain':!![]});if(!_0x47d2f1)throw new Error(_0x7bf7('0x4d'));if(_0x47d2f1['role']===_0x7bf7('0x4c')){var _0x569305=_0x4dae5c[_0x7bf7('0x2a')]({'plain':!![]});var _0x4a4fa0='Projects';return db[_0x7bf7('0x4e')][_0x7bf7('0x4a')]({'where':{'name':_0x4a4fa0,'userProfileId':_0x47d2f1['userProfileId']},'raw':!![]})[_0x7bf7('0x28')](function(_0x535573){if(_0x535573&&_0x535573['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x569305[_0x7bf7('0x2f')],'resourceId':_0x569305['id'],'type':_0x535573[_0x7bf7('0x2f')],'sectionId':_0x535573['id']},{})['then'](function(){return _0x4dae5c;});}else{return _0x4dae5c;}})['catch'](function(_0x45b156){logger[_0x7bf7('0x2d')](_0x7bf7('0x4f'),_0x45b156);throw _0x45b156;});}return _0x4dae5c;})[_0x7bf7('0x28')](respondWithResult(_0x4a7948,0xc9))[_0x7bf7('0x47')](handleError(_0x4a7948,null));};exports[_0x7bf7('0x50')]=function(_0x3f19a9,_0x309ce8){var _0x31371c={'where':{'id':_0x3f19a9[_0x7bf7('0x51')]['id']}},_0xd4d3fd={};_0xd4d3fd[_0x7bf7('0x35')]=_[_0x7bf7('0x37')](db[_0x7bf7('0x44')][_0x7bf7('0x33')]);_0x31371c['attributes']=_['intersection'](_0xd4d3fd['model'],qs[_0x7bf7('0x39')](_0x3f19a9[_0x7bf7('0x36')][_0x7bf7('0x39')]));_0x31371c[_0x7bf7('0x3a')]=_0x31371c[_0x7bf7('0x3a')][_0x7bf7('0x49')]?_0x31371c[_0x7bf7('0x3a')]:_0xd4d3fd[_0x7bf7('0x35')];if(_0x3f19a9['query'][_0x7bf7('0x45')]){_0x31371c[_0x7bf7('0x46')]=[{'all':!![]}];}_0x31371c=_[_0x7bf7('0x42')]({},_0x31371c,_0x3f19a9['options']);return db['JscriptyProject'][_0x7bf7('0x4a')](_0x31371c)[_0x7bf7('0x28')](handleEntityNotFound(_0x309ce8,null))['then'](function(_0x29f3ff){if(_0x29f3ff){var _0x230d83=_0x29f3ff[_0x7bf7('0x2a')]({'plain':!![]});_0x230d83=qs['omit'](_0x230d83,['id',_0x7bf7('0x52'),_0x7bf7('0x53')]);_0x3f19a9[_0x7bf7('0x54')]=_['omit'](_0x3f19a9[_0x7bf7('0x54')],['id',_0x7bf7('0x52'),'updatedAt']);return db[_0x7bf7('0x44')][_0x7bf7('0x4b')](_[_0x7bf7('0x42')](_0x230d83,_0x3f19a9[_0x7bf7('0x54')]),{'include':_0x3f19a9[_0x7bf7('0x36')][_0x7bf7('0x45')]?[{'all':!![]}]:undefined})[_0x7bf7('0x28')](function(_0x1e39d1){var _0x28e43f=_0x3f19a9[_0x7bf7('0x4c')][_0x7bf7('0x2a')]({'plain':!![]});if(!_0x28e43f)throw new Error(_0x7bf7('0x4d'));if(_0x28e43f[_0x7bf7('0x55')]===_0x7bf7('0x4c')){var _0x5e59e2=_0x1e39d1[_0x7bf7('0x2a')]({'plain':!![]});var _0x50e7c0=_0x7bf7('0x2b');return db[_0x7bf7('0x4e')][_0x7bf7('0x4a')]({'where':{'name':_0x50e7c0,'userProfileId':_0x28e43f[_0x7bf7('0x56')]},'raw':!![]})['then'](function(_0x20facb){if(_0x20facb&&_0x20facb['autoAssociation']===0x0){return db[_0x7bf7('0x2c')][_0x7bf7('0x4b')]({'name':_0x5e59e2['name'],'resourceId':_0x5e59e2['id'],'type':_0x20facb[_0x7bf7('0x2f')],'sectionId':_0x20facb['id']},{})[_0x7bf7('0x28')](function(){return _0x1e39d1;});}else{return _0x1e39d1;}})[_0x7bf7('0x47')](function(_0x40847a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40847a);throw _0x40847a;});}return _0x1e39d1;});}})[_0x7bf7('0x28')](respondWithResult(_0x309ce8,0xc9))[_0x7bf7('0x47')](handleError(_0x309ce8,null));};exports[_0x7bf7('0x27')]=function(_0x43497a,_0x3bd9b8){if(_0x43497a[_0x7bf7('0x54')]['id']){delete _0x43497a[_0x7bf7('0x54')]['id'];}return db[_0x7bf7('0x44')][_0x7bf7('0x4a')]({'where':{'id':_0x43497a[_0x7bf7('0x51')]['id']}})[_0x7bf7('0x28')](handleEntityNotFound(_0x3bd9b8,null))[_0x7bf7('0x28')](saveUpdates(_0x43497a[_0x7bf7('0x54')],null))[_0x7bf7('0x28')](respondWithResult(_0x3bd9b8,null))['catch'](handleError(_0x3bd9b8,null));};exports['destroy']=function(_0x5da573,_0x3edb7c){return db[_0x7bf7('0x44')][_0x7bf7('0x4a')]({'where':{'id':_0x5da573[_0x7bf7('0x51')]['id']}})[_0x7bf7('0x28')](handleEntityNotFound(_0x3edb7c,null))[_0x7bf7('0x28')](removeEntity(_0x3edb7c,null))['catch'](handleError(_0x3edb7c,null));};exports[_0x7bf7('0x57')]=function(_0x27b630,_0x51b10f,_0x3b93a0){var _0x3783e6={'raw':!![],'where':{}};var _0x2e874f={};var _0x3f1001={'count':0x0,'rows':[]};return db[_0x7bf7('0x44')][_0x7bf7('0x58')]({'where':{'id':_0x27b630[_0x7bf7('0x51')]['id']}})[_0x7bf7('0x28')](handleEntityNotFound(_0x51b10f,null))[_0x7bf7('0x28')](function(_0x4bf94a){if(_0x4bf94a){_0x2e874f['model']=_[_0x7bf7('0x37')](db[_0x7bf7('0x59')][_0x7bf7('0x33')]);_0x2e874f[_0x7bf7('0x36')]=_[_0x7bf7('0x37')](_0x27b630[_0x7bf7('0x36')]);_0x2e874f[_0x7bf7('0x3e')]=_[_0x7bf7('0x38')](_0x2e874f[_0x7bf7('0x35')],_0x2e874f[_0x7bf7('0x36')]);_0x3783e6[_0x7bf7('0x3a')]=_[_0x7bf7('0x38')](_0x2e874f['model'],qs[_0x7bf7('0x39')](_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x39')]));_0x3783e6[_0x7bf7('0x3a')]=_0x3783e6[_0x7bf7('0x3a')][_0x7bf7('0x49')]?_0x3783e6[_0x7bf7('0x3a')]:_0x2e874f[_0x7bf7('0x35')];if(!_0x27b630[_0x7bf7('0x36')]['hasOwnProperty'](_0x7bf7('0x5a'))){_0x3783e6['limit']=qs[_0x7bf7('0x1f')](_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x1f')]);_0x3783e6[_0x7bf7('0x21')]=qs[_0x7bf7('0x21')](_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x21')]);}_0x3783e6[_0x7bf7('0x5b')]=qs[_0x7bf7('0x3c')](_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x3c')]);_0x3783e6['where']=qs['filters'](_[_0x7bf7('0x3f')](_0x27b630['query'],_0x2e874f[_0x7bf7('0x3e')]));_0x3783e6[_0x7bf7('0x3d')]['ProjectId']=_0x4bf94a['id'];if(_0x27b630[_0x7bf7('0x36')]['filter']){_0x3783e6[_0x7bf7('0x3d')]=_[_0x7bf7('0x42')](_0x3783e6[_0x7bf7('0x3d')],{'$or':_[_0x7bf7('0x32')](_0x3783e6['attributes'],function(_0x383b8b){var _0x392c25={};_0x392c25[_0x383b8b]={'$like':'%'+_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x40')]+'%'};return _0x392c25;})});}_0x3783e6=_[_0x7bf7('0x42')]({},_0x3783e6,_0x27b630['options']);return db[_0x7bf7('0x59')][_0x7bf7('0x20')]({'where':_0x3783e6['where']})[_0x7bf7('0x28')](function(_0xcdd3b8){_0x3f1001[_0x7bf7('0x20')]=_0xcdd3b8;if(_0x27b630[_0x7bf7('0x36')][_0x7bf7('0x45')]){_0x3783e6[_0x7bf7('0x46')]=[{'all':!![]}];}return db[_0x7bf7('0x59')][_0x7bf7('0x5c')](_0x3783e6);})[_0x7bf7('0x28')](function(_0x2a24fe){_0x3f1001['rows']=_0x2a24fe;return _0x3f1001;});}})[_0x7bf7('0x28')](respondWithFilteredResult(_0x51b10f,_0x3783e6))[_0x7bf7('0x47')](handleError(_0x51b10f,null));};exports[_0x7bf7('0x5d')]=function(_0x2b8089,_0x218c52,_0x16458e){var _0x31575a={'raw':!![],'where':{}};var _0x3fd30f={};var _0x3d7429={'count':0x0,'rows':[]};return db[_0x7bf7('0x44')][_0x7bf7('0x58')]({'where':{'id':_0x2b8089[_0x7bf7('0x51')]['id']}})[_0x7bf7('0x28')](handleEntityNotFound(_0x218c52,null))['then'](function(_0x21092e){if(_0x21092e){_0x3fd30f[_0x7bf7('0x35')]=_[_0x7bf7('0x37')](db['JscriptyAnswerReport'][_0x7bf7('0x33')]);_0x3fd30f[_0x7bf7('0x36')]=_[_0x7bf7('0x37')](_0x2b8089[_0x7bf7('0x36')]);_0x3fd30f[_0x7bf7('0x3e')]=_[_0x7bf7('0x38')](_0x3fd30f[_0x7bf7('0x35')],_0x3fd30f[_0x7bf7('0x36')]);_0x31575a[_0x7bf7('0x3a')]=_[_0x7bf7('0x38')](_0x3fd30f[_0x7bf7('0x35')],qs[_0x7bf7('0x39')](_0x2b8089[_0x7bf7('0x36')][_0x7bf7('0x39')]));_0x31575a['attributes']=_0x31575a['attributes'][_0x7bf7('0x49')]?_0x31575a[_0x7bf7('0x3a')]:_0x3fd30f[_0x7bf7('0x35')];if(!_0x2b8089[_0x7bf7('0x36')][_0x7bf7('0x3b')](_0x7bf7('0x5a'))){_0x31575a[_0x7bf7('0x1f')]=qs[_0x7bf7('0x1f')](_0x2b8089[_0x7bf7('0x36')][_0x7bf7('0x1f')]);_0x31575a[_0x7bf7('0x21')]=qs['offset'](_0x2b8089[_0x7bf7('0x36')]['offset']);}_0x31575a[_0x7bf7('0x5b')]=qs['sort'](_0x2b8089['query'][_0x7bf7('0x3c')]);_0x31575a['where']=qs['filters'](_[_0x7bf7('0x3f')](_0x2b8089['query'],_0x3fd30f['filters']));_0x31575a['where'][_0x7bf7('0x5e')]=_0x21092e['id'];if(_0x2b8089[_0x7bf7('0x36')][_0x7bf7('0x40')]){_0x31575a[_0x7bf7('0x3d')]=_['merge'](_0x31575a[_0x7bf7('0x3d')],{'$or':_['map'](_0x31575a[_0x7bf7('0x3a')],function(_0xc339e8){var _0xd39363={};_0xd39363[_0xc339e8]={'$like':'%'+_0x2b8089['query'][_0x7bf7('0x40')]+'%'};return _0xd39363;})});}_0x31575a=_[_0x7bf7('0x42')]({},_0x31575a,_0x2b8089['options']);return db['JscriptyAnswerReport'][_0x7bf7('0x20')]({'where':_0x31575a['where']})['then'](function(_0x30a3b4){_0x3d7429[_0x7bf7('0x20')]=_0x30a3b4;if(_0x2b8089['query']['includeAll']){_0x31575a[_0x7bf7('0x46')]=[{'all':!![]}];}return db[_0x7bf7('0x5f')][_0x7bf7('0x5c')](_0x31575a);})['then'](function(_0x4a342f){_0x3d7429[_0x7bf7('0x60')]=_0x4a342f;return _0x3d7429;});}})[_0x7bf7('0x28')](respondWithFilteredResult(_0x218c52,_0x31575a))[_0x7bf7('0x47')](handleError(_0x218c52,null));};function char(_0x43855a){return'number'===typeof _0x43855a?String[_0x7bf7('0x61')]['apply'](null,arguments):_0x43855a;}function needsEncapsulation(_0x41e827){return!!_0x41e827&&(_0x41e827[_0x7bf7('0x62')]()['indexOf'](char(0xd))>=0x0||_0x41e827['toString']()[_0x7bf7('0x63')](char(0xa))>=0x0||_0x41e827[_0x7bf7('0x62')]()[_0x7bf7('0x63')](char(0x2c))>=0x0||_0x41e827[_0x7bf7('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5262e9){var _0x32a845=char(0x22),_0x23b164='\x5c'+char(0x22),_0x2844a3=_0x5262e9[_0x7bf7('0x62')]()['replace'](new RegExp(_0x32a845,'g'),_0x23b164);return _0x32a845+_0x2844a3+_0x32a845;}exports['getSummary']=function(_0x50a6a7,_0x26d339,_0x5485f0){var _0x348c1f,_0x27923b;var _0x20b6a9={'where':{'ProjectId':_0x50a6a7[_0x7bf7('0x51')]['id']}};if(_0x50a6a7[_0x7bf7('0x36')][_0x7bf7('0x64')]){_0x20b6a9['where']['starttime']=JSON[_0x7bf7('0x65')](_0x50a6a7[_0x7bf7('0x36')][_0x7bf7('0x64')]);}return db[_0x7bf7('0x59')]['findAll'](_0x20b6a9)[_0x7bf7('0x28')](handleEntityNotFound(_0x26d339,null))['then'](function(_0x51fb81){if(_0x51fb81){_0x348c1f=_0x51fb81;return db[_0x7bf7('0x66')][_0x7bf7('0x5c')]({'where':{'SessionId':{'$in':_['map'](_0x348c1f,'id')},'ProjectId':_0x50a6a7[_0x7bf7('0x51')]['id']},'order':_0x7bf7('0x67')});}})['then'](handleEntityNotFound(_0x26d339,null))[_0x7bf7('0x28')](function(_0x5264e3){if(_0x5264e3){_0x27923b=_0x5264e3;var _0x54f507={};for(var _0x59f25e=0x0,_0x54a3f0=_0x27923b[_0x7bf7('0x49')];_0x59f25e<_0x54a3f0;_0x59f25e++){if(!_0x54f507[_0x7bf7('0x3b')](_0x27923b[_0x59f25e][_0x7bf7('0x68')])){_0x54f507[_0x27923b[_0x59f25e][_0x7bf7('0x68')]]=needsEncapsulation(_0x27923b[_0x59f25e][_0x7bf7('0x69')])?encapsulate(_0x27923b[_0x59f25e][_0x7bf7('0x69')]):_0x27923b[_0x59f25e][_0x7bf7('0x69')];}}var _0x2cba56=[],_0xc7bda0={};for(var _0x32f119=0x0,_0x514a39=_0x348c1f[_0x7bf7('0x49')];_0x32f119<_0x514a39;_0x32f119++){_0xc7bda0={'ProjectId':_0x50a6a7[_0x7bf7('0x51')]['id'],'SessionId':_0x348c1f[_0x32f119]['id'],'StartTime':moment(_0x348c1f[_0x32f119][_0x7bf7('0x6a')])[_0x7bf7('0x6b')](_0x7bf7('0x6c'))};for(var _0x378dfc=0x0,_0x41de5a=_0x27923b[_0x7bf7('0x49')];_0x378dfc<_0x41de5a;_0x378dfc++){if(_0x27923b[_0x378dfc][_0x7bf7('0x6d')]==_0x348c1f[_0x32f119]['id']&&_0x54f507[_0x7bf7('0x3b')](_0x27923b[_0x378dfc]['questionId'])){_0xc7bda0[_0x54f507[_0x27923b[_0x378dfc][_0x7bf7('0x68')]]]=_0x27923b[_0x378dfc][_0x7bf7('0x6e')];}}for(var _0x14d245 in _0x54f507){if(!_0xc7bda0[_0x7bf7('0x3b')](_0x54f507[_0x14d245])){_0xc7bda0[_0x54f507[_0x14d245]]=null;}}_0x2cba56[_0x7bf7('0x6f')](_0xc7bda0);}return _0x2cba56;}})['then'](function(_0x4ee313){if(!_['isEmpty'](_0x4ee313)){var _0x341cc2=toCsv(_0x4ee313);var _0x564836=Date[_0x7bf7('0x70')]();fs[_0x7bf7('0x71')](util[_0x7bf7('0x6b')](_0x7bf7('0x72'),_0x50a6a7[_0x7bf7('0x51')]['id'],_0x564836),_0x341cc2);_0x26d339[_0x7bf7('0x73')](_0x7bf7('0x74'),_0x7bf7('0x75')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x50a6a7['params']['id'],_0x564836));_0x26d339['setHeader'](_0x7bf7('0x76'),_0x7bf7('0x77'));return _0x26d339[_0x7bf7('0x78')](util[_0x7bf7('0x6b')](_0x7bf7('0x72'),_0x50a6a7[_0x7bf7('0x51')]['id'],_0x564836));}else{return _0x26d339[_0x7bf7('0x1a')](0xcc);}})[_0x7bf7('0x47')](handleError(_0x26d339,null));}; \ No newline at end of file +var _0x6426=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','save','update','then','destroy','get','Projects','UserProfileResource','error','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','VIRTUAL','options','where','includeAll','include','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','pick','ProjectId','filter','findAll','rows','JscriptyAnswerReport','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','SessionId','answer','push','isEmpty','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format'];(function(_0x28cd05,_0x7f3476){var _0x2e4599=function(_0x4070d7){while(--_0x4070d7){_0x28cd05['push'](_0x28cd05['shift']());}};_0x2e4599(++_0x7f3476);}(_0x6426,0x15b));var _0x6642=function(_0x484ddc,_0x2179bc){_0x484ddc=_0x484ddc-0x0;var _0x528fb7=_0x6426[_0x484ddc];return _0x528fb7;};'use strict';var emlformat=require(_0x6642('0x0'));var rimraf=require(_0x6642('0x1'));var zipdir=require(_0x6642('0x2'));var jsonpatch=require(_0x6642('0x3'));var rp=require(_0x6642('0x4'));var moment=require('moment');var BPromise=require(_0x6642('0x5'));var Mustache=require(_0x6642('0x6'));var util=require('util');var path=require(_0x6642('0x7'));var sox=require(_0x6642('0x8'));var csv=require(_0x6642('0x9'));var ejs=require(_0x6642('0xa'));var fs=require('fs');var fs_extra=require(_0x6642('0xb'));var _=require(_0x6642('0xc'));var squel=require('squel');var crypto=require(_0x6642('0xd'));var jsforce=require(_0x6642('0xe'));var deskjs=require(_0x6642('0xf'));var toCsv=require(_0x6642('0x9'));var querystring=require(_0x6642('0x10'));var Papa=require(_0x6642('0x11'));var Redis=require(_0x6642('0x12'));var authService=require(_0x6642('0x13'));var qs=require(_0x6642('0x14'));var as=require(_0x6642('0x15'));var hardwareService=require(_0x6642('0x16'));var logger=require(_0x6642('0x17'))(_0x6642('0x18'));var utils=require('../../config/utils');var config=require(_0x6642('0x19'));var licenseUtil=require(_0x6642('0x1a'));var db=require(_0x6642('0x1b'))['db'];function respondWithStatusCode(_0x48e8e5,_0x5e4eb1){_0x5e4eb1=_0x5e4eb1||0xcc;return function(_0x36b925){if(_0x36b925){return _0x48e8e5[_0x6642('0x1c')](_0x5e4eb1);}return _0x48e8e5[_0x6642('0x1d')](_0x5e4eb1)[_0x6642('0x1e')]();};}function respondWithResult(_0xbefb67,_0x422f49){_0x422f49=_0x422f49||0xc8;return function(_0x5cd4fb){if(_0x5cd4fb){return _0xbefb67[_0x6642('0x1d')](_0x422f49)[_0x6642('0x1f')](_0x5cd4fb);}};}function respondWithFilteredResult(_0x40421f,_0x7371df){return function(_0x76ea55){if(_0x76ea55){var _0x4679e1=typeof _0x7371df['offset']===_0x6642('0x20')&&typeof _0x7371df[_0x6642('0x21')]===_0x6642('0x20');var _0x3a99cc=_0x76ea55['count'];var _0x440df7=_0x4679e1?0x0:_0x7371df['offset'];var _0x102379=_0x4679e1?_0x76ea55[_0x6642('0x22')]:_0x7371df[_0x6642('0x23')]+_0x7371df[_0x6642('0x21')];var _0x582276;if(_0x102379>=_0x3a99cc){_0x102379=_0x3a99cc;_0x582276=0xc8;}else{_0x582276=0xce;}_0x40421f[_0x6642('0x1d')](_0x582276);return _0x40421f['set']('Content-Range',_0x440df7+'-'+_0x102379+'/'+_0x3a99cc)[_0x6642('0x1f')](_0x76ea55);}return null;};}function patchUpdates(_0x49198c){return function(_0x5d3b71){try{jsonpatch['apply'](_0x5d3b71,_0x49198c,!![]);}catch(_0x543078){return BPromise['reject'](_0x543078);}return _0x5d3b71[_0x6642('0x24')]();};}function saveUpdates(_0x9a77c4,_0x475587){return function(_0x265455){if(_0x265455){return _0x265455[_0x6642('0x25')](_0x9a77c4)[_0x6642('0x26')](function(_0x4f3a45){return _0x4f3a45;});}return null;};}function removeEntity(_0x1b2a71,_0x2d8587){return function(_0x163fb1){if(_0x163fb1){return _0x163fb1[_0x6642('0x27')]()[_0x6642('0x26')](function(){var _0x4187c9=_0x163fb1[_0x6642('0x28')]({'plain':!![]});var _0x56298a=_0x6642('0x29');return db[_0x6642('0x2a')][_0x6642('0x27')]({'where':{'type':_0x56298a,'resourceId':_0x4187c9['id']}})[_0x6642('0x26')](function(){return _0x163fb1;});})['then'](function(){_0x1b2a71[_0x6642('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ff1fd,_0x4ecd4c){return function(_0x148914){if(!_0x148914){_0x1ff1fd[_0x6642('0x1c')](0x194);}return _0x148914;};}function handleError(_0x5b8a22,_0x16c096){_0x16c096=_0x16c096||0x1f4;return function(_0x54406c){logger[_0x6642('0x2b')](_0x54406c['stack']);if(_0x54406c[_0x6642('0x2c')]){delete _0x54406c[_0x6642('0x2c')];}_0x5b8a22[_0x6642('0x1d')](_0x16c096)['send'](_0x54406c);};}exports[_0x6642('0x2d')]=function(_0x5b3216,_0x4995f4){var _0x17b098={},_0x5df6bf={},_0x1ba6d4={'count':0x0,'rows':[]};var _0x100ddf=_[_0x6642('0x2e')](db[_0x6642('0x2f')][_0x6642('0x30')],function(_0xb7176e){return{'name':_0xb7176e[_0x6642('0x31')],'type':_0xb7176e[_0x6642('0x32')][_0x6642('0x33')]};});_0x5df6bf[_0x6642('0x34')]=_['map'](_0x100ddf,_0x6642('0x2c'));_0x5df6bf[_0x6642('0x35')]=_[_0x6642('0x36')](_0x5b3216[_0x6642('0x35')]);_0x5df6bf[_0x6642('0x37')]=_[_0x6642('0x38')](_0x5df6bf[_0x6642('0x34')],_0x5df6bf[_0x6642('0x35')]);_0x17b098[_0x6642('0x39')]=_[_0x6642('0x38')](_0x5df6bf[_0x6642('0x34')],qs[_0x6642('0x3a')](_0x5b3216[_0x6642('0x35')][_0x6642('0x3a')]));_0x17b098[_0x6642('0x39')]=_0x17b098['attributes'][_0x6642('0x3b')]?_0x17b098[_0x6642('0x39')]:_0x5df6bf[_0x6642('0x34')];if(!_0x5b3216['query'][_0x6642('0x3c')](_0x6642('0x3d'))){_0x17b098['limit']=qs[_0x6642('0x21')](_0x5b3216[_0x6642('0x35')]['limit']);_0x17b098[_0x6642('0x23')]=qs[_0x6642('0x23')](_0x5b3216[_0x6642('0x35')][_0x6642('0x23')]);}_0x17b098[_0x6642('0x3e')]=qs['sort'](_0x5b3216['query'][_0x6642('0x3f')]);_0x17b098['where']=qs[_0x6642('0x37')](_['pick'](_0x5b3216[_0x6642('0x35')],_0x5df6bf['filters']),_0x100ddf);if(_0x5b3216[_0x6642('0x35')]['filter']){_0x17b098['where']=_[_0x6642('0x40')](_0x17b098['where'],{'$or':_[_0x6642('0x2e')](_0x100ddf,function(_0x49efe6){if(_0x49efe6[_0x6642('0x32')]!==_0x6642('0x41')){var _0x108eb7={};_0x108eb7[_0x49efe6[_0x6642('0x2c')]]={'$like':'%'+_0x5b3216[_0x6642('0x35')]['filter']+'%'};return _0x108eb7;}})});}_0x17b098=_[_0x6642('0x40')]({},_0x17b098,_0x5b3216[_0x6642('0x42')]);var _0x3ac37f={'where':_0x17b098[_0x6642('0x43')]};return db[_0x6642('0x2f')]['count'](_0x3ac37f)[_0x6642('0x26')](function(_0x5cc346){_0x1ba6d4[_0x6642('0x22')]=_0x5cc346;if(_0x5b3216[_0x6642('0x35')][_0x6642('0x44')]){_0x17b098[_0x6642('0x45')]=[{'all':!![]}];}return db['JscriptyProject']['findAll'](_0x17b098);})[_0x6642('0x26')](function(_0x278776){_0x1ba6d4['rows']=_0x278776;return _0x1ba6d4;})[_0x6642('0x26')](respondWithFilteredResult(_0x4995f4,_0x17b098))['catch'](handleError(_0x4995f4,null));};exports[_0x6642('0x46')]=function(_0x33268c,_0x54b01e){var _0x30bd64={'raw':![],'where':{'id':_0x33268c[_0x6642('0x47')]['id']}},_0xb705e0={};_0xb705e0[_0x6642('0x34')]=_[_0x6642('0x36')](db['JscriptyProject'][_0x6642('0x30')]);_0xb705e0[_0x6642('0x35')]=_[_0x6642('0x36')](_0x33268c[_0x6642('0x35')]);_0xb705e0[_0x6642('0x37')]=_[_0x6642('0x38')](_0xb705e0['model'],_0xb705e0[_0x6642('0x35')]);_0x30bd64[_0x6642('0x39')]=_[_0x6642('0x38')](_0xb705e0['model'],qs[_0x6642('0x3a')](_0x33268c[_0x6642('0x35')][_0x6642('0x3a')]));_0x30bd64[_0x6642('0x39')]=_0x30bd64['attributes']['length']?_0x30bd64['attributes']:_0xb705e0[_0x6642('0x34')];if(_0x33268c[_0x6642('0x35')][_0x6642('0x44')]){_0x30bd64['include']=[{'all':!![]}];}_0x30bd64=_['merge']({},_0x30bd64,_0x33268c['options']);return db[_0x6642('0x2f')]['find'](_0x30bd64)[_0x6642('0x26')](handleEntityNotFound(_0x54b01e,null))['then'](respondWithResult(_0x54b01e,null))['catch'](handleError(_0x54b01e,null));};exports[_0x6642('0x48')]=function(_0x13ebc4,_0x36c06d){return db[_0x6642('0x2f')][_0x6642('0x48')](_0x13ebc4[_0x6642('0x49')],{})['then'](function(_0x373ab3){var _0x43777c=_0x13ebc4[_0x6642('0x4a')]['get']({'plain':!![]});if(!_0x43777c)throw new Error(_0x6642('0x4b'));if(_0x43777c[_0x6642('0x4c')]===_0x6642('0x4a')){var _0x190707=_0x373ab3[_0x6642('0x28')]({'plain':!![]});var _0x102972='Projects';return db[_0x6642('0x4d')][_0x6642('0x4e')]({'where':{'name':_0x102972,'userProfileId':_0x43777c[_0x6642('0x4f')]},'raw':!![]})['then'](function(_0x288e40){if(_0x288e40&&_0x288e40[_0x6642('0x50')]===0x0){return db[_0x6642('0x2a')][_0x6642('0x48')]({'name':_0x190707[_0x6642('0x2c')],'resourceId':_0x190707['id'],'type':_0x288e40[_0x6642('0x2c')],'sectionId':_0x288e40['id']},{})[_0x6642('0x26')](function(){return _0x373ab3;});}else{return _0x373ab3;}})[_0x6642('0x51')](function(_0x33bfec){logger[_0x6642('0x2b')](_0x6642('0x52'),_0x33bfec);throw _0x33bfec;});}return _0x373ab3;})[_0x6642('0x26')](respondWithResult(_0x36c06d,0xc9))[_0x6642('0x51')](handleError(_0x36c06d,null));};exports[_0x6642('0x53')]=function(_0x11af48,_0x302b95){var _0x1fd011={'where':{'id':_0x11af48[_0x6642('0x47')]['id']}},_0x3127c7={};_0x3127c7[_0x6642('0x34')]=_[_0x6642('0x36')](db[_0x6642('0x2f')][_0x6642('0x30')]);_0x1fd011[_0x6642('0x39')]=_['intersection'](_0x3127c7[_0x6642('0x34')],qs[_0x6642('0x3a')](_0x11af48[_0x6642('0x35')][_0x6642('0x3a')]));_0x1fd011[_0x6642('0x39')]=_0x1fd011[_0x6642('0x39')][_0x6642('0x3b')]?_0x1fd011[_0x6642('0x39')]:_0x3127c7['model'];if(_0x11af48['query']['includeAll']){_0x1fd011['include']=[{'all':!![]}];}_0x1fd011=_[_0x6642('0x40')]({},_0x1fd011,_0x11af48[_0x6642('0x42')]);return db['JscriptyProject'][_0x6642('0x4e')](_0x1fd011)[_0x6642('0x26')](handleEntityNotFound(_0x302b95,null))[_0x6642('0x26')](function(_0x44d629){if(_0x44d629){var _0x1761db=_0x44d629[_0x6642('0x28')]({'plain':!![]});_0x1761db=qs[_0x6642('0x54')](_0x1761db,['id',_0x6642('0x55'),_0x6642('0x56')]);_0x11af48[_0x6642('0x49')]=_['omit'](_0x11af48[_0x6642('0x49')],['id',_0x6642('0x55'),_0x6642('0x56')]);return db[_0x6642('0x2f')][_0x6642('0x48')](_['merge'](_0x1761db,_0x11af48['body']),{'include':_0x11af48[_0x6642('0x35')]['includeAll']?[{'all':!![]}]:undefined})[_0x6642('0x26')](function(_0x40f303){var _0x21bfe2=_0x11af48[_0x6642('0x4a')]['get']({'plain':!![]});if(!_0x21bfe2)throw new Error(_0x6642('0x4b'));if(_0x21bfe2[_0x6642('0x4c')]==='user'){var _0x11471f=_0x40f303[_0x6642('0x28')]({'plain':!![]});var _0x138bed=_0x6642('0x29');return db[_0x6642('0x4d')][_0x6642('0x4e')]({'where':{'name':_0x138bed,'userProfileId':_0x21bfe2[_0x6642('0x4f')]},'raw':!![]})[_0x6642('0x26')](function(_0x28e22b){if(_0x28e22b&&_0x28e22b[_0x6642('0x50')]===0x0){return db[_0x6642('0x2a')][_0x6642('0x48')]({'name':_0x11471f[_0x6642('0x2c')],'resourceId':_0x11471f['id'],'type':_0x28e22b[_0x6642('0x2c')],'sectionId':_0x28e22b['id']},{})[_0x6642('0x26')](function(){return _0x40f303;});}else{return _0x40f303;}})['catch'](function(_0x1215b6){logger[_0x6642('0x2b')](_0x6642('0x52'),_0x1215b6);throw _0x1215b6;});}return _0x40f303;});}})['then'](respondWithResult(_0x302b95,0xc9))[_0x6642('0x51')](handleError(_0x302b95,null));};exports[_0x6642('0x25')]=function(_0x24eca2,_0x500ae4){if(_0x24eca2[_0x6642('0x49')]['id']){delete _0x24eca2['body']['id'];}return db['JscriptyProject'][_0x6642('0x4e')]({'where':{'id':_0x24eca2[_0x6642('0x47')]['id']}})[_0x6642('0x26')](handleEntityNotFound(_0x500ae4,null))[_0x6642('0x26')](saveUpdates(_0x24eca2[_0x6642('0x49')],null))[_0x6642('0x26')](respondWithResult(_0x500ae4,null))[_0x6642('0x51')](handleError(_0x500ae4,null));};exports['destroy']=function(_0x17abbb,_0x4639d2){return db[_0x6642('0x2f')][_0x6642('0x4e')]({'where':{'id':_0x17abbb[_0x6642('0x47')]['id']}})[_0x6642('0x26')](handleEntityNotFound(_0x4639d2,null))[_0x6642('0x26')](removeEntity(_0x4639d2,null))['catch'](handleError(_0x4639d2,null));};exports[_0x6642('0x57')]=function(_0x36797c,_0x3df5e4,_0x3cc82d){var _0xd7be07={'raw':!![],'where':{}};var _0x25f181={};var _0x35e7e2={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6642('0x58')]({'where':{'id':_0x36797c[_0x6642('0x47')]['id']}})[_0x6642('0x26')](handleEntityNotFound(_0x3df5e4,null))['then'](function(_0x2bd50a){if(_0x2bd50a){_0x25f181[_0x6642('0x34')]=_[_0x6642('0x36')](db[_0x6642('0x59')]['rawAttributes']);_0x25f181[_0x6642('0x35')]=_[_0x6642('0x36')](_0x36797c[_0x6642('0x35')]);_0x25f181[_0x6642('0x37')]=_[_0x6642('0x38')](_0x25f181['model'],_0x25f181[_0x6642('0x35')]);_0xd7be07[_0x6642('0x39')]=_[_0x6642('0x38')](_0x25f181[_0x6642('0x34')],qs[_0x6642('0x3a')](_0x36797c[_0x6642('0x35')]['fields']));_0xd7be07[_0x6642('0x39')]=_0xd7be07['attributes'][_0x6642('0x3b')]?_0xd7be07['attributes']:_0x25f181[_0x6642('0x34')];if(!_0x36797c['query'][_0x6642('0x3c')]('nolimit')){_0xd7be07[_0x6642('0x21')]=qs[_0x6642('0x21')](_0x36797c[_0x6642('0x35')][_0x6642('0x21')]);_0xd7be07[_0x6642('0x23')]=qs[_0x6642('0x23')](_0x36797c[_0x6642('0x35')][_0x6642('0x23')]);}_0xd7be07[_0x6642('0x3e')]=qs[_0x6642('0x3f')](_0x36797c[_0x6642('0x35')][_0x6642('0x3f')]);_0xd7be07[_0x6642('0x43')]=qs[_0x6642('0x37')](_[_0x6642('0x5a')](_0x36797c[_0x6642('0x35')],_0x25f181[_0x6642('0x37')]));_0xd7be07[_0x6642('0x43')][_0x6642('0x5b')]=_0x2bd50a['id'];if(_0x36797c[_0x6642('0x35')][_0x6642('0x5c')]){_0xd7be07[_0x6642('0x43')]=_[_0x6642('0x40')](_0xd7be07[_0x6642('0x43')],{'$or':_[_0x6642('0x2e')](_0xd7be07['attributes'],function(_0x5879f2){var _0x29ae64={};_0x29ae64[_0x5879f2]={'$like':'%'+_0x36797c[_0x6642('0x35')][_0x6642('0x5c')]+'%'};return _0x29ae64;})});}_0xd7be07=_[_0x6642('0x40')]({},_0xd7be07,_0x36797c[_0x6642('0x42')]);return db[_0x6642('0x59')][_0x6642('0x22')]({'where':_0xd7be07[_0x6642('0x43')]})[_0x6642('0x26')](function(_0x34840d){_0x35e7e2[_0x6642('0x22')]=_0x34840d;if(_0x36797c[_0x6642('0x35')]['includeAll']){_0xd7be07[_0x6642('0x45')]=[{'all':!![]}];}return db[_0x6642('0x59')][_0x6642('0x5d')](_0xd7be07);})[_0x6642('0x26')](function(_0x5c469a){_0x35e7e2[_0x6642('0x5e')]=_0x5c469a;return _0x35e7e2;});}})[_0x6642('0x26')](respondWithFilteredResult(_0x3df5e4,_0xd7be07))[_0x6642('0x51')](handleError(_0x3df5e4,null));};exports['getAnswers']=function(_0x31d4c8,_0x1e311c,_0xbd5efa){var _0x14fca1={'raw':!![],'where':{}};var _0x403364={};var _0x528a4a={'count':0x0,'rows':[]};return db[_0x6642('0x2f')][_0x6642('0x58')]({'where':{'id':_0x31d4c8['params']['id']}})[_0x6642('0x26')](handleEntityNotFound(_0x1e311c,null))['then'](function(_0x451665){if(_0x451665){_0x403364[_0x6642('0x34')]=_[_0x6642('0x36')](db[_0x6642('0x5f')][_0x6642('0x30')]);_0x403364[_0x6642('0x35')]=_[_0x6642('0x36')](_0x31d4c8[_0x6642('0x35')]);_0x403364[_0x6642('0x37')]=_['intersection'](_0x403364[_0x6642('0x34')],_0x403364['query']);_0x14fca1[_0x6642('0x39')]=_[_0x6642('0x38')](_0x403364[_0x6642('0x34')],qs['fields'](_0x31d4c8[_0x6642('0x35')][_0x6642('0x3a')]));_0x14fca1[_0x6642('0x39')]=_0x14fca1[_0x6642('0x39')][_0x6642('0x3b')]?_0x14fca1[_0x6642('0x39')]:_0x403364[_0x6642('0x34')];if(!_0x31d4c8[_0x6642('0x35')]['hasOwnProperty']('nolimit')){_0x14fca1[_0x6642('0x21')]=qs[_0x6642('0x21')](_0x31d4c8[_0x6642('0x35')][_0x6642('0x21')]);_0x14fca1[_0x6642('0x23')]=qs[_0x6642('0x23')](_0x31d4c8[_0x6642('0x35')][_0x6642('0x23')]);}_0x14fca1['order']=qs[_0x6642('0x3f')](_0x31d4c8[_0x6642('0x35')]['sort']);_0x14fca1[_0x6642('0x43')]=qs[_0x6642('0x37')](_[_0x6642('0x5a')](_0x31d4c8[_0x6642('0x35')],_0x403364[_0x6642('0x37')]));_0x14fca1[_0x6642('0x43')][_0x6642('0x5b')]=_0x451665['id'];if(_0x31d4c8[_0x6642('0x35')][_0x6642('0x5c')]){_0x14fca1[_0x6642('0x43')]=_[_0x6642('0x40')](_0x14fca1['where'],{'$or':_[_0x6642('0x2e')](_0x14fca1['attributes'],function(_0x12eefc){var _0x48d1e2={};_0x48d1e2[_0x12eefc]={'$like':'%'+_0x31d4c8[_0x6642('0x35')]['filter']+'%'};return _0x48d1e2;})});}_0x14fca1=_['merge']({},_0x14fca1,_0x31d4c8['options']);return db['JscriptyAnswerReport']['count']({'where':_0x14fca1[_0x6642('0x43')]})[_0x6642('0x26')](function(_0x2ab297){_0x528a4a[_0x6642('0x22')]=_0x2ab297;if(_0x31d4c8[_0x6642('0x35')][_0x6642('0x44')]){_0x14fca1[_0x6642('0x45')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6642('0x5d')](_0x14fca1);})[_0x6642('0x26')](function(_0x355378){_0x528a4a[_0x6642('0x5e')]=_0x355378;return _0x528a4a;});}})['then'](respondWithFilteredResult(_0x1e311c,_0x14fca1))[_0x6642('0x51')](handleError(_0x1e311c,null));};function char(_0xcabe69){return'number'===typeof _0xcabe69?String['fromCharCode']['apply'](null,arguments):_0xcabe69;}function needsEncapsulation(_0x4215a7){return!!_0x4215a7&&(_0x4215a7[_0x6642('0x60')]()[_0x6642('0x61')](char(0xd))>=0x0||_0x4215a7[_0x6642('0x60')]()[_0x6642('0x61')](char(0xa))>=0x0||_0x4215a7[_0x6642('0x60')]()[_0x6642('0x61')](char(0x2c))>=0x0||_0x4215a7[_0x6642('0x60')]()[_0x6642('0x61')](char(0x22))>=0x0);}function encapsulate(_0x55b4ad){var _0x417f97=char(0x22),_0x3dc404='\x5c'+char(0x22),_0x1d9c4a=_0x55b4ad['toString']()[_0x6642('0x62')](new RegExp(_0x417f97,'g'),_0x3dc404);return _0x417f97+_0x1d9c4a+_0x417f97;}exports['getSummary']=function(_0x4777aa,_0x269a6c,_0x329964){var _0xdbba3,_0x58a73e;var _0x1cbf24={'where':{'ProjectId':_0x4777aa[_0x6642('0x47')]['id']}};if(_0x4777aa[_0x6642('0x35')][_0x6642('0x63')]){_0x1cbf24[_0x6642('0x43')][_0x6642('0x64')]=JSON['parse'](_0x4777aa['query'][_0x6642('0x63')]);}return db[_0x6642('0x59')][_0x6642('0x5d')](_0x1cbf24)[_0x6642('0x26')](handleEntityNotFound(_0x269a6c,null))[_0x6642('0x26')](function(_0x5c4ceb){if(_0x5c4ceb){_0xdbba3=_0x5c4ceb;return db[_0x6642('0x65')][_0x6642('0x5d')]({'where':{'SessionId':{'$in':_[_0x6642('0x2e')](_0xdbba3,'id')},'ProjectId':_0x4777aa[_0x6642('0x47')]['id']},'order':_0x6642('0x66')});}})[_0x6642('0x26')](handleEntityNotFound(_0x269a6c,null))['then'](function(_0x610e83){if(_0x610e83){_0x58a73e=_0x610e83;var _0x26de01={};for(var _0x20950f=0x0,_0x55a6a8=_0x58a73e[_0x6642('0x3b')];_0x20950f<_0x55a6a8;_0x20950f++){if(!_0x26de01[_0x6642('0x3c')](_0x58a73e[_0x20950f][_0x6642('0x67')])){_0x26de01[_0x58a73e[_0x20950f][_0x6642('0x67')]]=needsEncapsulation(_0x58a73e[_0x20950f]['question'])?encapsulate(_0x58a73e[_0x20950f]['question']):_0x58a73e[_0x20950f]['question'];}}var _0x298566=[],_0x10db83={};for(var _0x905827=0x0,_0x56ac5e=_0xdbba3[_0x6642('0x3b')];_0x905827<_0x56ac5e;_0x905827++){_0x10db83={'ProjectId':_0x4777aa[_0x6642('0x47')]['id'],'SessionId':_0xdbba3[_0x905827]['id'],'StartTime':moment(_0xdbba3[_0x905827][_0x6642('0x64')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4f46cb=0x0,_0x27dc20=_0x58a73e[_0x6642('0x3b')];_0x4f46cb<_0x27dc20;_0x4f46cb++){if(_0x58a73e[_0x4f46cb][_0x6642('0x68')]==_0xdbba3[_0x905827]['id']&&_0x26de01['hasOwnProperty'](_0x58a73e[_0x4f46cb][_0x6642('0x67')])){_0x10db83[_0x26de01[_0x58a73e[_0x4f46cb][_0x6642('0x67')]]]=_0x58a73e[_0x4f46cb][_0x6642('0x69')];}}for(var _0x4c98b7 in _0x26de01){if(!_0x10db83['hasOwnProperty'](_0x26de01[_0x4c98b7])){_0x10db83[_0x26de01[_0x4c98b7]]=null;}}_0x298566[_0x6642('0x6a')](_0x10db83);}return _0x298566;}})[_0x6642('0x26')](function(_0x5decaf){if(!_[_0x6642('0x6b')](_0x5decaf)){var _0x35095c=toCsv(_0x5decaf);var _0x287e4c=Date[_0x6642('0x6c')]();fs['writeFileSync'](util[_0x6642('0x6d')](_0x6642('0x6e'),_0x4777aa['params']['id'],_0x287e4c),_0x35095c);_0x269a6c[_0x6642('0x6f')](_0x6642('0x70'),'attachment;\x20filename='+util[_0x6642('0x6d')](_0x6642('0x71'),_0x4777aa['params']['id'],_0x287e4c));_0x269a6c['setHeader'](_0x6642('0x72'),_0x6642('0x73'));return _0x269a6c['download'](util[_0x6642('0x6d')](_0x6642('0x6e'),_0x4777aa[_0x6642('0x47')]['id'],_0x287e4c));}else{return _0x269a6c[_0x6642('0x1c')](0xcc);}})[_0x6642('0x51')](handleError(_0x269a6c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 0c0140d..c520afa 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 _0xaab2=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xaab2,0xca));var _0x2aab=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xaab2[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var logger=require(_0x2aab('0x1'))(_0x2aab('0x2'));var moment=require('moment');var BPromise=require(_0x2aab('0x3'));var rp=require(_0x2aab('0x4'));var fs=require('fs');var path=require(_0x2aab('0x5'));var rimraf=require(_0x2aab('0x6'));var config=require(_0x2aab('0x7'));var attributes=require('./jscriptyProject.attributes');module[_0x2aab('0x8')]=function(_0x5b35ec,_0x3af395){return _0x5b35ec[_0x2aab('0x9')](_0x2aab('0xa'),attributes,{'tableName':_0x2aab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c88=['./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x304aca,_0x4f8e0b){var _0x3b811c=function(_0x3f6c71){while(--_0x3f6c71){_0x304aca['push'](_0x304aca['shift']());}};_0x3b811c(++_0x4f8e0b);}(_0x1c88,0x1a9));var _0x81c8=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x1c88[_0x16e0c8];return _0xe4b5af;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var logger=require(_0x81c8('0x1'))(_0x81c8('0x2'));var moment=require(_0x81c8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x81c8('0x4'));var rimraf=require(_0x81c8('0x5'));var config=require(_0x81c8('0x6'));var attributes=require(_0x81c8('0x7'));module[_0x81c8('0x8')]=function(_0x3e5721,_0x3f4e27){return _0x3e5721[_0x81c8('0x9')](_0x81c8('0xa'),attributes,{'tableName':_0x81c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 5f35276..96c4c92 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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3bb39f,_0x387132){var _0x3a0a43=function(_0x1aee66){while(--_0x1aee66){_0x3bb39f['push'](_0x3bb39f['shift']());}};_0x3a0a43(++_0x387132);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x19c47f,_0x5e0ffa){var _0xa4e9f6=function(_0x3781e1){while(--_0x3781e1){_0x19c47f['push'](_0x19c47f['shift']());}};_0xa4e9f6(++_0x5e0ffa);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index be9347a..a239337 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 _0x3f21=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3f21,0x135));var _0x13f2=function(_0x228362,_0x59ef19){_0x228362=_0x228362-0x0;var _0x4aa1c1=_0x3f21[_0x228362];return _0x4aa1c1;};'use strict';var multer=require(_0x13f2('0x0'));var util=require(_0x13f2('0x1'));var path=require(_0x13f2('0x2'));var timeout=require(_0x13f2('0x3'));var express=require(_0x13f2('0x4'));var router=express['Router']();var fs_extra=require(_0x13f2('0x5'));var auth=require(_0x13f2('0x6'));var interaction=require(_0x13f2('0x7'));var config=require(_0x13f2('0x8'));var controller=require(_0x13f2('0x9'));router[_0x13f2('0xa')]('/',auth[_0x13f2('0xb')](),controller[_0x13f2('0xc')]);router[_0x13f2('0xa')](_0x13f2('0xd'),auth['isAuthenticated'](),controller[_0x13f2('0xe')]);router['get'](_0x13f2('0xf'),auth[_0x13f2('0xb')](),controller[_0x13f2('0x10')]);router[_0x13f2('0x11')]('/',auth[_0x13f2('0xb')](),controller[_0x13f2('0x12')]);router[_0x13f2('0x13')]('/:id',auth[_0x13f2('0xb')](),controller[_0x13f2('0x14')]);router['delete'](_0x13f2('0xf'),auth[_0x13f2('0xb')](),controller[_0x13f2('0x15')]);module[_0x13f2('0x16')]=router; \ No newline at end of file +var _0xd4ba=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','index','/describe','isAuthenticated','get','/:id','post','create','put','update','exports'];(function(_0x31cf1c,_0x2fa9b8){var _0xa769da=function(_0x1985e6){while(--_0x1985e6){_0x31cf1c['push'](_0x31cf1c['shift']());}};_0xa769da(++_0x2fa9b8);}(_0xd4ba,0x1c8));var _0xad4b=function(_0x45445f,_0x12f279){_0x45445f=_0x45445f-0x0;var _0x4ec2ac=_0xd4ba[_0x45445f];return _0x4ec2ac;};'use strict';var multer=require(_0xad4b('0x0'));var util=require(_0xad4b('0x1'));var path=require(_0xad4b('0x2'));var timeout=require(_0xad4b('0x3'));var express=require(_0xad4b('0x4'));var router=express[_0xad4b('0x5')]();var fs_extra=require(_0xad4b('0x6'));var auth=require(_0xad4b('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xad4b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xad4b('0x9')]);router['get'](_0xad4b('0xa'),auth[_0xad4b('0xb')](),controller['describe']);router[_0xad4b('0xc')](_0xad4b('0xd'),auth[_0xad4b('0xb')](),controller['show']);router[_0xad4b('0xe')]('/',auth['isAuthenticated'](),controller[_0xad4b('0xf')]);router[_0xad4b('0x10')](_0xad4b('0xd'),auth[_0xad4b('0xb')](),controller[_0xad4b('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xad4b('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index d31a36b..8d76a45 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(_0x15f75b,_0x6bd6b0){_0x15f75b=_0x15f75b-0x0;var _0x4b9a56=_0x7a54[_0x15f75b];return _0x4b9a56;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x446499,_0x23a41d){_0x446499=_0x446499-0x0;var _0x5c7482=_0x7a54[_0x446499];return _0x5c7482;};'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 16a5b6e..15cd63c 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 _0x61f0=['squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','save','update','then','destroy','end','error','stack','name','send','map','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','rawAttributes','length','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x61f0,0x175));var _0x061f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x61f0[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x061f('0x0'));var zipdir=require(_0x061f('0x1'));var jsonpatch=require(_0x061f('0x2'));var rp=require(_0x061f('0x3'));var moment=require(_0x061f('0x4'));var BPromise=require(_0x061f('0x5'));var Mustache=require(_0x061f('0x6'));var util=require(_0x061f('0x7'));var path=require(_0x061f('0x8'));var sox=require(_0x061f('0x9'));var csv=require('to-csv');var ejs=require(_0x061f('0xa'));var fs=require('fs');var fs_extra=require(_0x061f('0xb'));var _=require('lodash');var squel=require(_0x061f('0xc'));var crypto=require(_0x061f('0xd'));var jsforce=require(_0x061f('0xe'));var deskjs=require(_0x061f('0xf'));var toCsv=require(_0x061f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x061f('0x11'));var qs=require(_0x061f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x061f('0x13'));var logger=require(_0x061f('0x14'))(_0x061f('0x15'));var utils=require(_0x061f('0x16'));var config=require(_0x061f('0x17'));var licenseUtil=require(_0x061f('0x18'));var db=require(_0x061f('0x19'))['db'];function respondWithStatusCode(_0xecbfef,_0x3ea02b){_0x3ea02b=_0x3ea02b||0xcc;return function(_0x360ac7){if(_0x360ac7){return _0xecbfef[_0x061f('0x1a')](_0x3ea02b);}return _0xecbfef[_0x061f('0x1b')](_0x3ea02b)['end']();};}function respondWithResult(_0x1d4e18,_0x696a23){_0x696a23=_0x696a23||0xc8;return function(_0x4b5c83){if(_0x4b5c83){return _0x1d4e18[_0x061f('0x1b')](_0x696a23)[_0x061f('0x1c')](_0x4b5c83);}};}function respondWithFilteredResult(_0x5dc2aa,_0x1367db){return function(_0x2331b6){if(_0x2331b6){var _0x1a1a16=typeof _0x1367db[_0x061f('0x1d')]===_0x061f('0x1e')&&typeof _0x1367db['limit']===_0x061f('0x1e');var _0x2707b6=_0x2331b6[_0x061f('0x1f')];var _0x4cf780=_0x1a1a16?0x0:_0x1367db[_0x061f('0x1d')];var _0xddacfe=_0x1a1a16?_0x2331b6[_0x061f('0x1f')]:_0x1367db[_0x061f('0x1d')]+_0x1367db[_0x061f('0x20')];var _0x141430;if(_0xddacfe>=_0x2707b6){_0xddacfe=_0x2707b6;_0x141430=0xc8;}else{_0x141430=0xce;}_0x5dc2aa[_0x061f('0x1b')](_0x141430);return _0x5dc2aa[_0x061f('0x21')]('Content-Range',_0x4cf780+'-'+_0xddacfe+'/'+_0x2707b6)[_0x061f('0x1c')](_0x2331b6);}return null;};}function patchUpdates(_0x18711d){return function(_0xb8b63a){try{jsonpatch['apply'](_0xb8b63a,_0x18711d,!![]);}catch(_0x25a6d4){return BPromise['reject'](_0x25a6d4);}return _0xb8b63a[_0x061f('0x22')]();};}function saveUpdates(_0xff7960,_0xaaff68){return function(_0x2b0afc){if(_0x2b0afc){return _0x2b0afc[_0x061f('0x23')](_0xff7960)[_0x061f('0x24')](function(_0x263699){return _0x263699;});}return null;};}function removeEntity(_0x36d76e,_0x2cab2a){return function(_0x3ba430){if(_0x3ba430){return _0x3ba430[_0x061f('0x25')]()[_0x061f('0x24')](function(){_0x36d76e['status'](0xcc)[_0x061f('0x26')]();});}};}function handleEntityNotFound(_0x588f99,_0x253a7e){return function(_0x3dfefb){if(!_0x3dfefb){_0x588f99[_0x061f('0x1a')](0x194);}return _0x3dfefb;};}function handleError(_0xdefb14,_0x22e43f){_0x22e43f=_0x22e43f||0x1f4;return function(_0xb5d1a9){logger[_0x061f('0x27')](_0xb5d1a9[_0x061f('0x28')]);if(_0xb5d1a9[_0x061f('0x29')]){delete _0xb5d1a9[_0x061f('0x29')];}_0xdefb14[_0x061f('0x1b')](_0x22e43f)[_0x061f('0x2a')](_0xb5d1a9);};}exports['index']=function(_0x18fe69,_0xeab12c){var _0x3d9b90={},_0xe7c46b={},_0x2f91e5={'count':0x0,'rows':[]};var _0x5150d3=_[_0x061f('0x2b')](db['JscriptyQuestionReport']['rawAttributes'],function(_0xb658d1){return{'name':_0xb658d1['fieldName'],'type':_0xb658d1['type'][_0x061f('0x2c')]};});_0xe7c46b['model']=_[_0x061f('0x2b')](_0x5150d3,_0x061f('0x29'));_0xe7c46b['query']=_[_0x061f('0x2d')](_0x18fe69[_0x061f('0x2e')]);_0xe7c46b[_0x061f('0x2f')]=_[_0x061f('0x30')](_0xe7c46b[_0x061f('0x31')],_0xe7c46b[_0x061f('0x2e')]);_0x3d9b90[_0x061f('0x32')]=_[_0x061f('0x30')](_0xe7c46b[_0x061f('0x31')],qs[_0x061f('0x33')](_0x18fe69[_0x061f('0x2e')][_0x061f('0x33')]));_0x3d9b90['attributes']=_0x3d9b90[_0x061f('0x32')]['length']?_0x3d9b90[_0x061f('0x32')]:_0xe7c46b[_0x061f('0x31')];if(!_0x18fe69[_0x061f('0x2e')][_0x061f('0x34')](_0x061f('0x35'))){_0x3d9b90[_0x061f('0x20')]=qs[_0x061f('0x20')](_0x18fe69[_0x061f('0x2e')][_0x061f('0x20')]);_0x3d9b90['offset']=qs['offset'](_0x18fe69[_0x061f('0x2e')]['offset']);}_0x3d9b90[_0x061f('0x36')]=qs[_0x061f('0x37')](_0x18fe69[_0x061f('0x2e')][_0x061f('0x37')]);_0x3d9b90[_0x061f('0x38')]=qs[_0x061f('0x2f')](_[_0x061f('0x39')](_0x18fe69['query'],_0xe7c46b['filters']),_0x5150d3);if(_0x18fe69['query'][_0x061f('0x3a')]){_0x3d9b90['where']=_[_0x061f('0x3b')](_0x3d9b90['where'],{'$or':_[_0x061f('0x2b')](_0x5150d3,function(_0x20d012){if(_0x20d012[_0x061f('0x3c')]!==_0x061f('0x3d')){var _0x51b277={};_0x51b277[_0x20d012['name']]={'$like':'%'+_0x18fe69[_0x061f('0x2e')][_0x061f('0x3a')]+'%'};return _0x51b277;}})});}_0x3d9b90=_[_0x061f('0x3b')]({},_0x3d9b90,_0x18fe69[_0x061f('0x3e')]);var _0x57762b={'where':_0x3d9b90[_0x061f('0x38')]};return db[_0x061f('0x3f')]['count'](_0x57762b)['then'](function(_0xa16d92){_0x2f91e5['count']=_0xa16d92;if(_0x18fe69[_0x061f('0x2e')][_0x061f('0x40')]){_0x3d9b90[_0x061f('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x061f('0x42')](_0x3d9b90);})[_0x061f('0x24')](function(_0x39ef8b){_0x2f91e5[_0x061f('0x43')]=_0x39ef8b;return _0x2f91e5;})[_0x061f('0x24')](respondWithFilteredResult(_0xeab12c,_0x3d9b90))['catch'](handleError(_0xeab12c,null));};exports[_0x061f('0x44')]=function(_0x1623bf,_0x5e980b){var _0x3a8f2e={'raw':!![],'where':{'id':_0x1623bf['params']['id']}},_0x32bef6={};_0x32bef6[_0x061f('0x31')]=_['keys'](db[_0x061f('0x3f')][_0x061f('0x45')]);_0x32bef6[_0x061f('0x2e')]=_[_0x061f('0x2d')](_0x1623bf[_0x061f('0x2e')]);_0x32bef6[_0x061f('0x2f')]=_[_0x061f('0x30')](_0x32bef6[_0x061f('0x31')],_0x32bef6[_0x061f('0x2e')]);_0x3a8f2e[_0x061f('0x32')]=_['intersection'](_0x32bef6[_0x061f('0x31')],qs[_0x061f('0x33')](_0x1623bf[_0x061f('0x2e')][_0x061f('0x33')]));_0x3a8f2e['attributes']=_0x3a8f2e[_0x061f('0x32')][_0x061f('0x46')]?_0x3a8f2e[_0x061f('0x32')]:_0x32bef6[_0x061f('0x31')];if(_0x1623bf['query'][_0x061f('0x40')]){_0x3a8f2e['include']=[{'all':!![]}];}_0x3a8f2e=_[_0x061f('0x3b')]({},_0x3a8f2e,_0x1623bf[_0x061f('0x3e')]);return db[_0x061f('0x3f')][_0x061f('0x47')](_0x3a8f2e)[_0x061f('0x24')](handleEntityNotFound(_0x5e980b,null))['then'](respondWithResult(_0x5e980b,null))[_0x061f('0x48')](handleError(_0x5e980b,null));};exports[_0x061f('0x49')]=function(_0x40e82a,_0x4bb88c){return db[_0x061f('0x3f')]['create'](_0x40e82a[_0x061f('0x4a')],{})[_0x061f('0x24')](respondWithResult(_0x4bb88c,0xc9))[_0x061f('0x48')](handleError(_0x4bb88c,null));};exports['update']=function(_0x487837,_0xbb87bb){if(_0x487837['body']['id']){delete _0x487837[_0x061f('0x4a')]['id'];}return db[_0x061f('0x3f')]['find']({'where':{'id':_0x487837[_0x061f('0x4b')]['id']}})[_0x061f('0x24')](handleEntityNotFound(_0xbb87bb,null))[_0x061f('0x24')](saveUpdates(_0x487837[_0x061f('0x4a')],null))[_0x061f('0x24')](respondWithResult(_0xbb87bb,null))[_0x061f('0x48')](handleError(_0xbb87bb,null));};exports[_0x061f('0x25')]=function(_0x36f831,_0x49d15b){return db[_0x061f('0x3f')]['find']({'where':{'id':_0x36f831[_0x061f('0x4b')]['id']}})[_0x061f('0x24')](handleEntityNotFound(_0x49d15b,null))[_0x061f('0x24')](removeEntity(_0x49d15b,null))[_0x061f('0x48')](handleError(_0x49d15b,null));};exports['describe']=function(_0x44cd33,_0x2ddbf8){return db[_0x061f('0x3f')][_0x061f('0x4c')]()[_0x061f('0x24')](respondWithResult(_0x2ddbf8,null))[_0x061f('0x48')](handleError(_0x2ddbf8,null));}; \ No newline at end of file +var _0x8126=['error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','rows','catch','params','fields','merge','find','create','body','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','destroy','then'];(function(_0x3c2f05,_0x36e6d5){var _0x1f1049=function(_0x39174e){while(--_0x39174e){_0x3c2f05['push'](_0x3c2f05['shift']());}};_0x1f1049(++_0x36e6d5);}(_0x8126,0x1d6));var _0x6812=function(_0x5ebe34,_0x421337){_0x5ebe34=_0x5ebe34-0x0;var _0x36a3ee=_0x8126[_0x5ebe34];return _0x36a3ee;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6812('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6812('0x1'));var moment=require(_0x6812('0x2'));var BPromise=require(_0x6812('0x3'));var Mustache=require(_0x6812('0x4'));var util=require(_0x6812('0x5'));var path=require(_0x6812('0x6'));var sox=require(_0x6812('0x7'));var csv=require('to-csv');var ejs=require(_0x6812('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6812('0x9'));var crypto=require('crypto');var jsforce=require(_0x6812('0xa'));var deskjs=require(_0x6812('0xb'));var toCsv=require(_0x6812('0xc'));var querystring=require(_0x6812('0xd'));var Papa=require(_0x6812('0xe'));var Redis=require(_0x6812('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6812('0x10'));var hardwareService=require(_0x6812('0x11'));var logger=require('../../config/logger')(_0x6812('0x12'));var utils=require('../../config/utils');var config=require(_0x6812('0x13'));var licenseUtil=require(_0x6812('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8aa9e4,_0xff29d8){_0xff29d8=_0xff29d8||0xcc;return function(_0x435f9d){if(_0x435f9d){return _0x8aa9e4[_0x6812('0x15')](_0xff29d8);}return _0x8aa9e4[_0x6812('0x16')](_0xff29d8)[_0x6812('0x17')]();};}function respondWithResult(_0x3e9fa4,_0x22f059){_0x22f059=_0x22f059||0xc8;return function(_0xbc50de){if(_0xbc50de){return _0x3e9fa4['status'](_0x22f059)['json'](_0xbc50de);}};}function respondWithFilteredResult(_0x5cf790,_0x248b4f){return function(_0x17fdee){if(_0x17fdee){var _0x23d072=typeof _0x248b4f['offset']===_0x6812('0x18')&&typeof _0x248b4f[_0x6812('0x19')]===_0x6812('0x18');var _0x20d87c=_0x17fdee[_0x6812('0x1a')];var _0x58b60f=_0x23d072?0x0:_0x248b4f['offset'];var _0x402145=_0x23d072?_0x17fdee[_0x6812('0x1a')]:_0x248b4f[_0x6812('0x1b')]+_0x248b4f['limit'];var _0xd58b15;if(_0x402145>=_0x20d87c){_0x402145=_0x20d87c;_0xd58b15=0xc8;}else{_0xd58b15=0xce;}_0x5cf790['status'](_0xd58b15);return _0x5cf790['set'](_0x6812('0x1c'),_0x58b60f+'-'+_0x402145+'/'+_0x20d87c)[_0x6812('0x1d')](_0x17fdee);}return null;};}function patchUpdates(_0x49e227){return function(_0xdf3624){try{jsonpatch['apply'](_0xdf3624,_0x49e227,!![]);}catch(_0x273f44){return BPromise['reject'](_0x273f44);}return _0xdf3624[_0x6812('0x1e')]();};}function saveUpdates(_0x1ed084,_0x1b3168){return function(_0x13d4d5){if(_0x13d4d5){return _0x13d4d5[_0x6812('0x1f')](_0x1ed084)['then'](function(_0x1f62ae){return _0x1f62ae;});}return null;};}function removeEntity(_0x16c0ae,_0x4f21e7){return function(_0x334143){if(_0x334143){return _0x334143[_0x6812('0x20')]()[_0x6812('0x21')](function(){_0x16c0ae[_0x6812('0x16')](0xcc)[_0x6812('0x17')]();});}};}function handleEntityNotFound(_0x869fd6,_0x3f9ee9){return function(_0x545863){if(!_0x545863){_0x869fd6[_0x6812('0x15')](0x194);}return _0x545863;};}function handleError(_0x2634dd,_0x37ce61){_0x37ce61=_0x37ce61||0x1f4;return function(_0x15f94d){logger[_0x6812('0x22')](_0x15f94d[_0x6812('0x23')]);if(_0x15f94d[_0x6812('0x24')]){delete _0x15f94d['name'];}_0x2634dd['status'](_0x37ce61)[_0x6812('0x25')](_0x15f94d);};}exports[_0x6812('0x26')]=function(_0x2db9cf,_0x591668){var _0x578259={},_0x15bd38={},_0x3ec58d={'count':0x0,'rows':[]};var _0x3ce320=_['map'](db[_0x6812('0x27')][_0x6812('0x28')],function(_0x54460d){return{'name':_0x54460d[_0x6812('0x29')],'type':_0x54460d[_0x6812('0x2a')][_0x6812('0x2b')]};});_0x15bd38['model']=_['map'](_0x3ce320,_0x6812('0x24'));_0x15bd38[_0x6812('0x2c')]=_[_0x6812('0x2d')](_0x2db9cf['query']);_0x15bd38[_0x6812('0x2e')]=_['intersection'](_0x15bd38[_0x6812('0x2f')],_0x15bd38[_0x6812('0x2c')]);_0x578259[_0x6812('0x30')]=_[_0x6812('0x31')](_0x15bd38[_0x6812('0x2f')],qs['fields'](_0x2db9cf['query']['fields']));_0x578259[_0x6812('0x30')]=_0x578259['attributes'][_0x6812('0x32')]?_0x578259['attributes']:_0x15bd38[_0x6812('0x2f')];if(!_0x2db9cf[_0x6812('0x2c')][_0x6812('0x33')](_0x6812('0x34'))){_0x578259[_0x6812('0x19')]=qs[_0x6812('0x19')](_0x2db9cf[_0x6812('0x2c')][_0x6812('0x19')]);_0x578259[_0x6812('0x1b')]=qs['offset'](_0x2db9cf[_0x6812('0x2c')][_0x6812('0x1b')]);}_0x578259[_0x6812('0x35')]=qs[_0x6812('0x36')](_0x2db9cf[_0x6812('0x2c')][_0x6812('0x36')]);_0x578259[_0x6812('0x37')]=qs['filters'](_[_0x6812('0x38')](_0x2db9cf[_0x6812('0x2c')],_0x15bd38[_0x6812('0x2e')]),_0x3ce320);if(_0x2db9cf[_0x6812('0x2c')][_0x6812('0x39')]){_0x578259[_0x6812('0x37')]=_['merge'](_0x578259[_0x6812('0x37')],{'$or':_[_0x6812('0x3a')](_0x3ce320,function(_0x5e8836){if(_0x5e8836[_0x6812('0x2a')]!==_0x6812('0x3b')){var _0x34feb4={};_0x34feb4[_0x5e8836[_0x6812('0x24')]]={'$like':'%'+_0x2db9cf[_0x6812('0x2c')][_0x6812('0x39')]+'%'};return _0x34feb4;}})});}_0x578259=_['merge']({},_0x578259,_0x2db9cf[_0x6812('0x3c')]);var _0x4a4fd6={'where':_0x578259[_0x6812('0x37')]};return db[_0x6812('0x27')][_0x6812('0x1a')](_0x4a4fd6)[_0x6812('0x21')](function(_0x237291){_0x3ec58d[_0x6812('0x1a')]=_0x237291;if(_0x2db9cf[_0x6812('0x2c')][_0x6812('0x3d')]){_0x578259[_0x6812('0x3e')]=[{'all':!![]}];}return db[_0x6812('0x27')]['findAll'](_0x578259);})[_0x6812('0x21')](function(_0x5a6ae3){_0x3ec58d[_0x6812('0x3f')]=_0x5a6ae3;return _0x3ec58d;})['then'](respondWithFilteredResult(_0x591668,_0x578259))[_0x6812('0x40')](handleError(_0x591668,null));};exports['show']=function(_0x4ed964,_0x2cf926){var _0x207a03={'raw':!![],'where':{'id':_0x4ed964[_0x6812('0x41')]['id']}},_0x3d0dea={};_0x3d0dea['model']=_[_0x6812('0x2d')](db[_0x6812('0x27')][_0x6812('0x28')]);_0x3d0dea[_0x6812('0x2c')]=_[_0x6812('0x2d')](_0x4ed964[_0x6812('0x2c')]);_0x3d0dea[_0x6812('0x2e')]=_[_0x6812('0x31')](_0x3d0dea[_0x6812('0x2f')],_0x3d0dea['query']);_0x207a03[_0x6812('0x30')]=_['intersection'](_0x3d0dea['model'],qs[_0x6812('0x42')](_0x4ed964[_0x6812('0x2c')][_0x6812('0x42')]));_0x207a03[_0x6812('0x30')]=_0x207a03[_0x6812('0x30')][_0x6812('0x32')]?_0x207a03[_0x6812('0x30')]:_0x3d0dea['model'];if(_0x4ed964[_0x6812('0x2c')][_0x6812('0x3d')]){_0x207a03[_0x6812('0x3e')]=[{'all':!![]}];}_0x207a03=_[_0x6812('0x43')]({},_0x207a03,_0x4ed964[_0x6812('0x3c')]);return db[_0x6812('0x27')][_0x6812('0x44')](_0x207a03)[_0x6812('0x21')](handleEntityNotFound(_0x2cf926,null))['then'](respondWithResult(_0x2cf926,null))[_0x6812('0x40')](handleError(_0x2cf926,null));};exports[_0x6812('0x45')]=function(_0x52a805,_0x1f3098){return db['JscriptyQuestionReport'][_0x6812('0x45')](_0x52a805[_0x6812('0x46')],{})[_0x6812('0x21')](respondWithResult(_0x1f3098,0xc9))[_0x6812('0x40')](handleError(_0x1f3098,null));};exports[_0x6812('0x1f')]=function(_0x563215,_0x32ec07){if(_0x563215[_0x6812('0x46')]['id']){delete _0x563215[_0x6812('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x6812('0x44')]({'where':{'id':_0x563215[_0x6812('0x41')]['id']}})['then'](handleEntityNotFound(_0x32ec07,null))[_0x6812('0x21')](saveUpdates(_0x563215[_0x6812('0x46')],null))['then'](respondWithResult(_0x32ec07,null))[_0x6812('0x40')](handleError(_0x32ec07,null));};exports['destroy']=function(_0x5594fd,_0x4d7750){return db[_0x6812('0x27')]['find']({'where':{'id':_0x5594fd[_0x6812('0x41')]['id']}})[_0x6812('0x21')](handleEntityNotFound(_0x4d7750,null))[_0x6812('0x21')](removeEntity(_0x4d7750,null))[_0x6812('0x40')](handleError(_0x4d7750,null));};exports[_0x6812('0x47')]=function(_0x31597f,_0x43836f){return db[_0x6812('0x27')][_0x6812('0x47')]()[_0x6812('0x21')](respondWithResult(_0x43836f,null))[_0x6812('0x40')](handleError(_0x43836f,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 853f4b6..984cb93 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 _0xa52e=['api','moment','bluebird','request-promise','rimraf','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','lodash','../../config/logger'];(function(_0x449ca9,_0x4b190d){var _0xb9fe4=function(_0x1b3c50){while(--_0x1b3c50){_0x449ca9['push'](_0x449ca9['shift']());}};_0xb9fe4(++_0x4b190d);}(_0xa52e,0xda));var _0xea52=function(_0x19bec0,_0x32f29e){_0x19bec0=_0x19bec0-0x0;var _0x485d31=_0xa52e[_0x19bec0];return _0x485d31;};'use strict';var _=require(_0xea52('0x0'));var util=require('util');var logger=require(_0xea52('0x1'))(_0xea52('0x2'));var moment=require(_0xea52('0x3'));var BPromise=require(_0xea52('0x4'));var rp=require(_0xea52('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea52('0x6'));var config=require('../../config/environment');var attributes=require(_0xea52('0x7'));module['exports']=function(_0x4a1a46,_0x515594){return _0x4a1a46[_0xea52('0x8')](_0xea52('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb25e=['request-promise','path','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','util','api','moment'];(function(_0x28154e,_0x55e694){var _0x246fee=function(_0x74b611){while(--_0x74b611){_0x28154e['push'](_0x28154e['shift']());}};_0x246fee(++_0x55e694);}(_0xb25e,0x14d));var _0xeb25=function(_0x39194b,_0x275c2e){_0x39194b=_0x39194b-0x0;var _0x4b1b82=_0xb25e[_0x39194b];return _0x4b1b82;};'use strict';var _=require('lodash');var util=require(_0xeb25('0x0'));var logger=require('../../config/logger')(_0xeb25('0x1'));var moment=require(_0xeb25('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb25('0x3'));var fs=require('fs');var path=require(_0xeb25('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb25('0x5'));module[_0xeb25('0x6')]=function(_0x2e317a,_0x4131ff){return _0x2e317a['define'](_0xeb25('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index b3064b1..496cd93 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 _0xe9e9=['client','http','info','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x30ad00,_0x2fae7d){var _0x154116=function(_0x3525bd){while(--_0x3525bd){_0x30ad00['push'](_0x30ad00['shift']());}};_0x154116(++_0x2fae7d);}(_0xe9e9,0x138));var _0x9e9e=function(_0x3f89a3,_0x68f45e){_0x3f89a3=_0x3f89a3-0x0;var _0x5d5768=_0xe9e9[_0x3f89a3];return _0x5d5768;};'use strict';var _=require('lodash');var util=require(_0x9e9e('0x0'));var moment=require(_0x9e9e('0x1'));var BPromise=require(_0x9e9e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e9e('0x3'))['db'];var utils=require(_0x9e9e('0x4'));var logger=require('../../config/logger')(_0x9e9e('0x5'));var config=require(_0x9e9e('0x6'));var jayson=require(_0x9e9e('0x7'));var client=jayson[_0x9e9e('0x8')][_0x9e9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8979e6,_0x2d9b34,_0x4227ab){return new BPromise(function(_0x56b02b,_0x5b2b35){return client['request'](_0x8979e6,_0x4227ab)['then'](function(_0x181d78){logger[_0x9e9e('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d9b34,'request\x20sent');logger['debug'](_0x9e9e('0xb'),_0x2d9b34,'request\x20sent',JSON[_0x9e9e('0xc')](_0x181d78));if(_0x181d78[_0x9e9e('0xd')]){if(_0x181d78[_0x9e9e('0xd')][_0x9e9e('0xe')]===0x1f4){logger['error'](_0x9e9e('0xf'),_0x2d9b34,_0x181d78[_0x9e9e('0xd')][_0x9e9e('0x10')]);return _0x5b2b35(_0x181d78['error'][_0x9e9e('0x10')]);}logger[_0x9e9e('0xd')](_0x9e9e('0xf'),_0x2d9b34,_0x181d78[_0x9e9e('0xd')][_0x9e9e('0x10')]);return _0x56b02b(_0x181d78[_0x9e9e('0xd')]['message']);}else{logger[_0x9e9e('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d9b34,_0x9e9e('0x11'));_0x56b02b(_0x181d78[_0x9e9e('0x12')]['message']);}})[_0x9e9e('0x13')](function(_0x2a713e){logger[_0x9e9e('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2d9b34,_0x2a713e);_0x5b2b35(_0x2a713e);});});} \ No newline at end of file +var _0x3145=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment'];(function(_0x1f5b2b,_0x202932){var _0x4226bb=function(_0xd8a609){while(--_0xd8a609){_0x1f5b2b['push'](_0x1f5b2b['shift']());}};_0x4226bb(++_0x202932);}(_0x3145,0x1b6));var _0x5314=function(_0x2fd4ae,_0x257abe){_0x2fd4ae=_0x2fd4ae-0x0;var _0x3dd0a3=_0x3145[_0x2fd4ae];return _0x3dd0a3;};'use strict';var _=require(_0x5314('0x0'));var util=require(_0x5314('0x1'));var moment=require(_0x5314('0x2'));var BPromise=require(_0x5314('0x3'));var rs=require(_0x5314('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5314('0x5'));var logger=require(_0x5314('0x6'))('rpc');var config=require(_0x5314('0x7'));var jayson=require(_0x5314('0x8'));var client=jayson[_0x5314('0x9')][_0x5314('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xabfd4e,_0xb368e1,_0x5f0675){return new BPromise(function(_0x576b34,_0x42fc54){return client['request'](_0xabfd4e,_0x5f0675)[_0x5314('0xb')](function(_0x3a4be7){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xb368e1,_0x5314('0xc'));logger[_0x5314('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0xb368e1,'request\x20sent',JSON[_0x5314('0xe')](_0x3a4be7));if(_0x3a4be7[_0x5314('0xf')]){if(_0x3a4be7['error'][_0x5314('0x10')]===0x1f4){logger[_0x5314('0xf')](_0x5314('0x11'),_0xb368e1,_0x3a4be7[_0x5314('0xf')]['message']);return _0x42fc54(_0x3a4be7['error'][_0x5314('0x12')]);}logger[_0x5314('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xb368e1,_0x3a4be7[_0x5314('0xf')][_0x5314('0x12')]);return _0x576b34(_0x3a4be7[_0x5314('0xf')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xb368e1,_0x5314('0xc'));_0x576b34(_0x3a4be7[_0x5314('0x13')][_0x5314('0x12')]);}})[_0x5314('0x14')](function(_0x5be5d5){logger[_0x5314('0xf')](_0x5314('0x11'),_0xb368e1,_0x5be5d5);_0x42fc54(_0x5be5d5);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7144eb7..71806e9 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 _0xebeb=['create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','/:id/questions','post'];(function(_0x139454,_0x4ab4ba){var _0xa63cf8=function(_0x2b1641){while(--_0x2b1641){_0x139454['push'](_0x139454['shift']());}};_0xa63cf8(++_0x4ab4ba);}(_0xebeb,0x1d1));var _0xbebe=function(_0x54de51,_0x583dbd){_0x54de51=_0x54de51-0x0;var _0x4e7449=_0xebeb[_0x54de51];return _0x4e7449;};'use strict';var multer=require('multer');var util=require(_0xbebe('0x0'));var path=require('path');var timeout=require(_0xbebe('0x1'));var express=require(_0xbebe('0x2'));var router=express[_0xbebe('0x3')]();var fs_extra=require(_0xbebe('0x4'));var auth=require(_0xbebe('0x5'));var interaction=require(_0xbebe('0x6'));var config=require(_0xbebe('0x7'));var controller=require(_0xbebe('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbebe('0x9')]('/describe',auth[_0xbebe('0xa')](),controller[_0xbebe('0xb')]);router['get'](_0xbebe('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbebe('0x9')](_0xbebe('0xd'),auth[_0xbebe('0xa')](),controller['getQuestions']);router[_0xbebe('0xe')]('/',auth[_0xbebe('0xa')](),controller[_0xbebe('0xf')]);router[_0xbebe('0x10')]('/:id',auth[_0xbebe('0xa')](),controller[_0xbebe('0x11')]);router['delete'](_0xbebe('0xc'),auth[_0xbebe('0xa')](),controller[_0xbebe('0x12')]);module[_0xbebe('0x13')]=router; \ No newline at end of file +var _0xc563=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id/questions','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x487135,_0x438899){var _0x7872bc=function(_0x5830ba){while(--_0x5830ba){_0x487135['push'](_0x487135['shift']());}};_0x7872bc(++_0x438899);}(_0xc563,0x177));var _0x3c56=function(_0xdda532,_0x1d706c){_0xdda532=_0xdda532-0x0;var _0x2c169f=_0xc563[_0xdda532];return _0x2c169f;};'use strict';var multer=require('multer');var util=require(_0x3c56('0x0'));var path=require('path');var timeout=require(_0x3c56('0x1'));var express=require(_0x3c56('0x2'));var router=express['Router']();var fs_extra=require(_0x3c56('0x3'));var auth=require(_0x3c56('0x4'));var interaction=require(_0x3c56('0x5'));var config=require(_0x3c56('0x6'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x3c56('0x7')](),controller[_0x3c56('0x8')]);router['get'](_0x3c56('0x9'),auth[_0x3c56('0x7')](),controller[_0x3c56('0xa')]);router[_0x3c56('0xb')]('/:id',auth[_0x3c56('0x7')](),controller['show']);router['get'](_0x3c56('0xc'),auth[_0x3c56('0x7')](),controller['getQuestions']);router[_0x3c56('0xd')]('/',auth['isAuthenticated'](),controller[_0x3c56('0xe')]);router[_0x3c56('0xf')](_0x3c56('0x10'),auth[_0x3c56('0x7')](),controller[_0x3c56('0x11')]);router[_0x3c56('0x12')](_0x3c56('0x10'),auth[_0x3c56('0x7')](),controller[_0x3c56('0x13')]);module[_0x3c56('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index f73ba4e..d756c24 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 _0xd88c=['BOOLEAN','moment','sequelize','exports','DATE','setDataValue','endtime','STRING'];(function(_0x1bafb1,_0x3f4d43){var _0x1e9aa9=function(_0x34c867){while(--_0x34c867){_0x1bafb1['push'](_0x1bafb1['shift']());}};_0x1e9aa9(++_0x3f4d43);}(_0xd88c,0x1a9));var _0xcd88=function(_0x4a1853,_0x46dbf8){_0x4a1853=_0x4a1853-0x0;var _0x303c5b=_0xd88c[_0x4a1853];return _0x303c5b;};'use strict';var moment=require(_0xcd88('0x0'));var Sequelize=require(_0xcd88('0x1'));module[_0xcd88('0x2')]={'starttime':{'type':Sequelize[_0xcd88('0x3')],'set':function(_0x1bf9f3){this[_0xcd88('0x4')]('starttime',_0x1bf9f3);this[_0xcd88('0x4')](_0xcd88('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xcd88('0x6')]},'projectname':{'type':Sequelize[_0xcd88('0x6')]},'queue':{'type':Sequelize[_0xcd88('0x6')]},'uniqueid':{'type':Sequelize[_0xcd88('0x6')]},'calleridname':{'type':Sequelize[_0xcd88('0x6')]},'calleridnum':{'type':Sequelize[_0xcd88('0x6')]},'completed':{'type':Sequelize[_0xcd88('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x15a4=['STRING','BOOLEAN','moment','sequelize','exports','DATE','starttime','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x25f271,_0x4e67ed){var _0x104ab9=function(_0x3bf4f5){while(--_0x3bf4f5){_0x25f271['push'](_0x25f271['shift']());}};_0x104ab9(++_0x4e67ed);}(_0x15a4,0x178));var _0x415a=function(_0x4fafb8,_0x2888b1){_0x4fafb8=_0x4fafb8-0x0;var _0x597de4=_0x15a4[_0x4fafb8];return _0x597de4;};'use strict';var moment=require(_0x415a('0x0'));var Sequelize=require(_0x415a('0x1'));module[_0x415a('0x2')]={'starttime':{'type':Sequelize[_0x415a('0x3')],'set':function(_0x237062){this['setDataValue'](_0x415a('0x4'),_0x237062);this[_0x415a('0x5')](_0x415a('0x6'),moment()[_0x415a('0x7')](_0x415a('0x8')));}},'endtime':{'type':Sequelize[_0x415a('0x3')]},'membername':{'type':Sequelize[_0x415a('0x9')]},'projectname':{'type':Sequelize[_0x415a('0x9')]},'queue':{'type':Sequelize[_0x415a('0x9')]},'uniqueid':{'type':Sequelize[_0x415a('0x9')]},'calleridname':{'type':Sequelize[_0x415a('0x9')]},'calleridnum':{'type':Sequelize[_0x415a('0x9')]},'completed':{'type':Sequelize[_0x415a('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 79a18c4..b692bbc 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 _0x0b73=['to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','send','index','map','JscriptySessionReport','fieldName','key','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','describe','JscriptyQuestionReport','SessionId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x402c8f,_0x30cc1d){var _0x11e809=function(_0x4ccfa3){while(--_0x4ccfa3){_0x402c8f['push'](_0x402c8f['shift']());}};_0x11e809(++_0x30cc1d);}(_0x0b73,0x1bf));var _0x30b7=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x0b73[_0x3ea913];return _0x2b4f28;};'use strict';var emlformat=require(_0x30b7('0x0'));var rimraf=require(_0x30b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x30b7('0x2'));var rp=require(_0x30b7('0x3'));var moment=require(_0x30b7('0x4'));var BPromise=require(_0x30b7('0x5'));var Mustache=require(_0x30b7('0x6'));var util=require(_0x30b7('0x7'));var path=require(_0x30b7('0x8'));var sox=require('sox');var csv=require(_0x30b7('0x9'));var ejs=require(_0x30b7('0xa'));var fs=require('fs');var fs_extra=require(_0x30b7('0xb'));var _=require(_0x30b7('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x30b7('0xd'));var toCsv=require(_0x30b7('0x9'));var querystring=require(_0x30b7('0xe'));var Papa=require(_0x30b7('0xf'));var Redis=require(_0x30b7('0x10'));var authService=require(_0x30b7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30b7('0x12'));var logger=require(_0x30b7('0x13'))('api');var utils=require(_0x30b7('0x14'));var config=require(_0x30b7('0x15'));var licenseUtil=require(_0x30b7('0x16'));var db=require(_0x30b7('0x17'))['db'];function respondWithStatusCode(_0x286e78,_0x51c29e){_0x51c29e=_0x51c29e||0xcc;return function(_0x4d9684){if(_0x4d9684){return _0x286e78[_0x30b7('0x18')](_0x51c29e);}return _0x286e78[_0x30b7('0x19')](_0x51c29e)[_0x30b7('0x1a')]();};}function respondWithResult(_0x214b8f,_0x508f51){_0x508f51=_0x508f51||0xc8;return function(_0x2da6a3){if(_0x2da6a3){return _0x214b8f[_0x30b7('0x19')](_0x508f51)[_0x30b7('0x1b')](_0x2da6a3);}};}function respondWithFilteredResult(_0x7bf283,_0x238a29){return function(_0x62526d){if(_0x62526d){var _0x2a1704=typeof _0x238a29[_0x30b7('0x1c')]===_0x30b7('0x1d')&&typeof _0x238a29[_0x30b7('0x1e')]===_0x30b7('0x1d');var _0x1f306c=_0x62526d[_0x30b7('0x1f')];var _0x526825=_0x2a1704?0x0:_0x238a29[_0x30b7('0x1c')];var _0x2253e5=_0x2a1704?_0x62526d['count']:_0x238a29[_0x30b7('0x1c')]+_0x238a29[_0x30b7('0x1e')];var _0x3273a1;if(_0x2253e5>=_0x1f306c){_0x2253e5=_0x1f306c;_0x3273a1=0xc8;}else{_0x3273a1=0xce;}_0x7bf283['status'](_0x3273a1);return _0x7bf283['set'](_0x30b7('0x20'),_0x526825+'-'+_0x2253e5+'/'+_0x1f306c)[_0x30b7('0x1b')](_0x62526d);}return null;};}function patchUpdates(_0xae7692){return function(_0x295608){try{jsonpatch['apply'](_0x295608,_0xae7692,!![]);}catch(_0xbbbb84){return BPromise[_0x30b7('0x21')](_0xbbbb84);}return _0x295608['save']();};}function saveUpdates(_0x3ca61b,_0x18660b){return function(_0x46dfe1){if(_0x46dfe1){return _0x46dfe1[_0x30b7('0x22')](_0x3ca61b)[_0x30b7('0x23')](function(_0x308936){return _0x308936;});}return null;};}function removeEntity(_0x1bda6e,_0x4face0){return function(_0x26aa5d){if(_0x26aa5d){return _0x26aa5d[_0x30b7('0x24')]()['then'](function(){_0x1bda6e[_0x30b7('0x19')](0xcc)[_0x30b7('0x1a')]();});}};}function handleEntityNotFound(_0xa5f2c5,_0x4c23bf){return function(_0x1dd81f){if(!_0x1dd81f){_0xa5f2c5[_0x30b7('0x18')](0x194);}return _0x1dd81f;};}function handleError(_0x4748a0,_0x35c71a){_0x35c71a=_0x35c71a||0x1f4;return function(_0x1bc2d1){logger['error'](_0x1bc2d1[_0x30b7('0x25')]);if(_0x1bc2d1['name']){delete _0x1bc2d1['name'];}_0x4748a0[_0x30b7('0x19')](_0x35c71a)[_0x30b7('0x26')](_0x1bc2d1);};}exports[_0x30b7('0x27')]=function(_0x40e270,_0x450c73){var _0x5da68f={},_0x35aed8={},_0x27cd85={'count':0x0,'rows':[]};var _0x157f85=_[_0x30b7('0x28')](db[_0x30b7('0x29')]['rawAttributes'],function(_0x8874f4){return{'name':_0x8874f4[_0x30b7('0x2a')],'type':_0x8874f4['type'][_0x30b7('0x2b')]};});_0x35aed8['model']=_['map'](_0x157f85,_0x30b7('0x2c'));_0x35aed8[_0x30b7('0x2d')]=_[_0x30b7('0x2e')](_0x40e270[_0x30b7('0x2d')]);_0x35aed8['filters']=_[_0x30b7('0x2f')](_0x35aed8[_0x30b7('0x30')],_0x35aed8['query']);_0x5da68f['attributes']=_[_0x30b7('0x2f')](_0x35aed8[_0x30b7('0x30')],qs[_0x30b7('0x31')](_0x40e270[_0x30b7('0x2d')]['fields']));_0x5da68f[_0x30b7('0x32')]=_0x5da68f['attributes'][_0x30b7('0x33')]?_0x5da68f['attributes']:_0x35aed8[_0x30b7('0x30')];if(!_0x40e270[_0x30b7('0x2d')][_0x30b7('0x34')](_0x30b7('0x35'))){_0x5da68f[_0x30b7('0x1e')]=qs[_0x30b7('0x1e')](_0x40e270[_0x30b7('0x2d')][_0x30b7('0x1e')]);_0x5da68f[_0x30b7('0x1c')]=qs[_0x30b7('0x1c')](_0x40e270[_0x30b7('0x2d')]['offset']);}_0x5da68f[_0x30b7('0x36')]=qs[_0x30b7('0x37')](_0x40e270[_0x30b7('0x2d')][_0x30b7('0x37')]);_0x5da68f[_0x30b7('0x38')]=qs[_0x30b7('0x39')](_[_0x30b7('0x3a')](_0x40e270[_0x30b7('0x2d')],_0x35aed8[_0x30b7('0x39')]),_0x157f85);if(_0x40e270[_0x30b7('0x2d')][_0x30b7('0x3b')]){_0x5da68f[_0x30b7('0x38')]=_[_0x30b7('0x3c')](_0x5da68f[_0x30b7('0x38')],{'$or':_['map'](_0x157f85,function(_0x3300cc){if(_0x3300cc[_0x30b7('0x3d')]!==_0x30b7('0x3e')){var _0x2c8ac3={};_0x2c8ac3[_0x3300cc[_0x30b7('0x2c')]]={'$like':'%'+_0x40e270['query'][_0x30b7('0x3b')]+'%'};return _0x2c8ac3;}})});}_0x5da68f=_[_0x30b7('0x3c')]({},_0x5da68f,_0x40e270[_0x30b7('0x3f')]);var _0x211211={'where':_0x5da68f[_0x30b7('0x38')]};return db['JscriptySessionReport']['count'](_0x211211)[_0x30b7('0x23')](function(_0x34a11e){_0x27cd85['count']=_0x34a11e;if(_0x40e270[_0x30b7('0x2d')][_0x30b7('0x40')]){_0x5da68f[_0x30b7('0x41')]=[{'all':!![]}];}return db[_0x30b7('0x29')][_0x30b7('0x42')](_0x5da68f);})['then'](function(_0xc338b6){_0x27cd85['rows']=_0xc338b6;return _0x27cd85;})['then'](respondWithFilteredResult(_0x450c73,_0x5da68f))[_0x30b7('0x43')](handleError(_0x450c73,null));};exports['show']=function(_0x1fa121,_0x308fd3){var _0x679841={'raw':!![],'where':{'id':_0x1fa121[_0x30b7('0x44')]['id']}},_0x267538={};_0x267538[_0x30b7('0x30')]=_[_0x30b7('0x2e')](db['JscriptySessionReport'][_0x30b7('0x45')]);_0x267538[_0x30b7('0x2d')]=_[_0x30b7('0x2e')](_0x1fa121['query']);_0x267538[_0x30b7('0x39')]=_[_0x30b7('0x2f')](_0x267538[_0x30b7('0x30')],_0x267538['query']);_0x679841['attributes']=_[_0x30b7('0x2f')](_0x267538[_0x30b7('0x30')],qs[_0x30b7('0x31')](_0x1fa121[_0x30b7('0x2d')]['fields']));_0x679841[_0x30b7('0x32')]=_0x679841[_0x30b7('0x32')][_0x30b7('0x33')]?_0x679841[_0x30b7('0x32')]:_0x267538[_0x30b7('0x30')];if(_0x1fa121['query'][_0x30b7('0x40')]){_0x679841[_0x30b7('0x41')]=[{'all':!![]}];}_0x679841=_['merge']({},_0x679841,_0x1fa121[_0x30b7('0x3f')]);return db['JscriptySessionReport'][_0x30b7('0x46')](_0x679841)[_0x30b7('0x23')](handleEntityNotFound(_0x308fd3,null))['then'](respondWithResult(_0x308fd3,null))[_0x30b7('0x43')](handleError(_0x308fd3,null));};exports['create']=function(_0x42abad,_0x4f47c8){return db[_0x30b7('0x29')][_0x30b7('0x47')](_0x42abad[_0x30b7('0x48')],{})[_0x30b7('0x23')](respondWithResult(_0x4f47c8,0xc9))[_0x30b7('0x43')](handleError(_0x4f47c8,null));};exports[_0x30b7('0x22')]=function(_0x2576f9,_0x2a682c){if(_0x2576f9[_0x30b7('0x48')]['id']){delete _0x2576f9['body']['id'];}return db['JscriptySessionReport'][_0x30b7('0x46')]({'where':{'id':_0x2576f9[_0x30b7('0x44')]['id']}})[_0x30b7('0x23')](handleEntityNotFound(_0x2a682c,null))[_0x30b7('0x23')](saveUpdates(_0x2576f9[_0x30b7('0x48')],null))[_0x30b7('0x23')](respondWithResult(_0x2a682c,null))['catch'](handleError(_0x2a682c,null));};exports['destroy']=function(_0x41e87d,_0x2c3307){return db[_0x30b7('0x29')][_0x30b7('0x46')]({'where':{'id':_0x41e87d[_0x30b7('0x44')]['id']}})[_0x30b7('0x23')](handleEntityNotFound(_0x2c3307,null))['then'](removeEntity(_0x2c3307,null))[_0x30b7('0x43')](handleError(_0x2c3307,null));};exports['describe']=function(_0x348585,_0x397533){return db[_0x30b7('0x29')][_0x30b7('0x49')]()[_0x30b7('0x23')](respondWithResult(_0x397533,null))[_0x30b7('0x43')](handleError(_0x397533,null));};exports['getQuestions']=function(_0x503aef,_0x52b58e,_0x1ea04e){var _0x364c77={'raw':!![],'where':{}};var _0x42df2b={};var _0x74a01c={'count':0x0,'rows':[]};return db[_0x30b7('0x29')]['findOne']({'where':{'id':_0x503aef[_0x30b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x52b58e,null))['then'](function(_0x154e0e){if(_0x154e0e){_0x42df2b[_0x30b7('0x30')]=_['keys'](db[_0x30b7('0x4a')]['rawAttributes']);_0x42df2b[_0x30b7('0x2d')]=_['keys'](_0x503aef[_0x30b7('0x2d')]);_0x42df2b['filters']=_[_0x30b7('0x2f')](_0x42df2b['model'],_0x42df2b[_0x30b7('0x2d')]);_0x364c77[_0x30b7('0x32')]=_['intersection'](_0x42df2b['model'],qs[_0x30b7('0x31')](_0x503aef['query'][_0x30b7('0x31')]));_0x364c77[_0x30b7('0x32')]=_0x364c77[_0x30b7('0x32')][_0x30b7('0x33')]?_0x364c77[_0x30b7('0x32')]:_0x42df2b[_0x30b7('0x30')];if(!_0x503aef[_0x30b7('0x2d')][_0x30b7('0x34')](_0x30b7('0x35'))){_0x364c77[_0x30b7('0x1e')]=qs['limit'](_0x503aef['query'][_0x30b7('0x1e')]);_0x364c77['offset']=qs[_0x30b7('0x1c')](_0x503aef[_0x30b7('0x2d')]['offset']);}_0x364c77[_0x30b7('0x36')]=qs[_0x30b7('0x37')](_0x503aef[_0x30b7('0x2d')][_0x30b7('0x37')]);_0x364c77[_0x30b7('0x38')]=qs[_0x30b7('0x39')](_[_0x30b7('0x3a')](_0x503aef[_0x30b7('0x2d')],_0x42df2b[_0x30b7('0x39')]));_0x364c77[_0x30b7('0x38')][_0x30b7('0x4b')]=_0x154e0e['id'];if(_0x503aef['query'][_0x30b7('0x3b')]){_0x364c77['where']=_['merge'](_0x364c77[_0x30b7('0x38')],{'$or':_[_0x30b7('0x28')](_0x364c77['attributes'],function(_0x1ae2e9){var _0x32e38f={};_0x32e38f[_0x1ae2e9]={'$like':'%'+_0x503aef[_0x30b7('0x2d')]['filter']+'%'};return _0x32e38f;})});}_0x364c77=_[_0x30b7('0x3c')]({},_0x364c77,_0x503aef[_0x30b7('0x3f')]);return db[_0x30b7('0x4a')]['count']({'where':_0x364c77[_0x30b7('0x38')]})['then'](function(_0x105a32){_0x74a01c[_0x30b7('0x1f')]=_0x105a32;if(_0x503aef[_0x30b7('0x2d')][_0x30b7('0x40')]){_0x364c77[_0x30b7('0x41')]=[{'all':!![]}];}return db[_0x30b7('0x4a')]['findAll'](_0x364c77);})[_0x30b7('0x23')](function(_0x52fd6e){_0x74a01c['rows']=_0x52fd6e;return _0x74a01c;});}})['then'](respondWithFilteredResult(_0x52b58e,_0x364c77))[_0x30b7('0x43')](handleError(_0x52b58e,null));}; \ No newline at end of file +var _0x1cd1=['update','then','destroy','error','stack','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','catch','params','keys','options','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','rows','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save'];(function(_0x6c864e,_0x23f3bf){var _0x3a7d95=function(_0xbc764e){while(--_0xbc764e){_0x6c864e['push'](_0x6c864e['shift']());}};_0x3a7d95(++_0x23f3bf);}(_0x1cd1,0x17d));var _0x11cd=function(_0x3138ae,_0x131f7a){_0x3138ae=_0x3138ae-0x0;var _0x4b241d=_0x1cd1[_0x3138ae];return _0x4b241d;};'use strict';var emlformat=require(_0x11cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11cd('0x1'));var jsonpatch=require(_0x11cd('0x2'));var rp=require(_0x11cd('0x3'));var moment=require(_0x11cd('0x4'));var BPromise=require(_0x11cd('0x5'));var Mustache=require(_0x11cd('0x6'));var util=require(_0x11cd('0x7'));var path=require(_0x11cd('0x8'));var sox=require('sox');var csv=require(_0x11cd('0x9'));var ejs=require(_0x11cd('0xa'));var fs=require('fs');var fs_extra=require(_0x11cd('0xb'));var _=require(_0x11cd('0xc'));var squel=require(_0x11cd('0xd'));var crypto=require(_0x11cd('0xe'));var jsforce=require(_0x11cd('0xf'));var deskjs=require(_0x11cd('0x10'));var toCsv=require(_0x11cd('0x9'));var querystring=require(_0x11cd('0x11'));var Papa=require(_0x11cd('0x12'));var Redis=require(_0x11cd('0x13'));var authService=require(_0x11cd('0x14'));var qs=require(_0x11cd('0x15'));var as=require(_0x11cd('0x16'));var hardwareService=require(_0x11cd('0x17'));var logger=require(_0x11cd('0x18'))(_0x11cd('0x19'));var utils=require(_0x11cd('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x11cd('0x1b'));var db=require(_0x11cd('0x1c'))['db'];function respondWithStatusCode(_0x127eec,_0x2b8308){_0x2b8308=_0x2b8308||0xcc;return function(_0x444357){if(_0x444357){return _0x127eec[_0x11cd('0x1d')](_0x2b8308);}return _0x127eec[_0x11cd('0x1e')](_0x2b8308)[_0x11cd('0x1f')]();};}function respondWithResult(_0x55b583,_0x492558){_0x492558=_0x492558||0xc8;return function(_0x2f6bb3){if(_0x2f6bb3){return _0x55b583[_0x11cd('0x1e')](_0x492558)[_0x11cd('0x20')](_0x2f6bb3);}};}function respondWithFilteredResult(_0x1edbbc,_0x2ecd90){return function(_0x28507d){if(_0x28507d){var _0x290b42=typeof _0x2ecd90[_0x11cd('0x21')]===_0x11cd('0x22')&&typeof _0x2ecd90['limit']===_0x11cd('0x22');var _0x2dc0d6=_0x28507d[_0x11cd('0x23')];var _0x51e308=_0x290b42?0x0:_0x2ecd90[_0x11cd('0x21')];var _0x5622dd=_0x290b42?_0x28507d[_0x11cd('0x23')]:_0x2ecd90[_0x11cd('0x21')]+_0x2ecd90[_0x11cd('0x24')];var _0x4108dc;if(_0x5622dd>=_0x2dc0d6){_0x5622dd=_0x2dc0d6;_0x4108dc=0xc8;}else{_0x4108dc=0xce;}_0x1edbbc[_0x11cd('0x1e')](_0x4108dc);return _0x1edbbc['set']('Content-Range',_0x51e308+'-'+_0x5622dd+'/'+_0x2dc0d6)[_0x11cd('0x20')](_0x28507d);}return null;};}function patchUpdates(_0x67f926){return function(_0x56ef42){try{jsonpatch[_0x11cd('0x25')](_0x56ef42,_0x67f926,!![]);}catch(_0x1fd630){return BPromise['reject'](_0x1fd630);}return _0x56ef42[_0x11cd('0x26')]();};}function saveUpdates(_0x568e46,_0x2edbb4){return function(_0x386af1){if(_0x386af1){return _0x386af1[_0x11cd('0x27')](_0x568e46)[_0x11cd('0x28')](function(_0x50b762){return _0x50b762;});}return null;};}function removeEntity(_0x1ccb46,_0x4b5a59){return function(_0x5bc192){if(_0x5bc192){return _0x5bc192[_0x11cd('0x29')]()[_0x11cd('0x28')](function(){_0x1ccb46[_0x11cd('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebc3d,_0x5d06f9){return function(_0x30c2a6){if(!_0x30c2a6){_0x1ebc3d['sendStatus'](0x194);}return _0x30c2a6;};}function handleError(_0x5ee4f9,_0x2686fe){_0x2686fe=_0x2686fe||0x1f4;return function(_0x4a354e){logger[_0x11cd('0x2a')](_0x4a354e[_0x11cd('0x2b')]);if(_0x4a354e['name']){delete _0x4a354e['name'];}_0x5ee4f9[_0x11cd('0x1e')](_0x2686fe)[_0x11cd('0x2c')](_0x4a354e);};}exports[_0x11cd('0x2d')]=function(_0x32cde0,_0x43cb75){var _0xb3ed2f={},_0x4a6bec={},_0xf73319={'count':0x0,'rows':[]};var _0x2cdc36=_[_0x11cd('0x2e')](db[_0x11cd('0x2f')][_0x11cd('0x30')],function(_0x5f6bbd){return{'name':_0x5f6bbd[_0x11cd('0x31')],'type':_0x5f6bbd[_0x11cd('0x32')]['key']};});_0x4a6bec[_0x11cd('0x33')]=_['map'](_0x2cdc36,_0x11cd('0x34'));_0x4a6bec['query']=_['keys'](_0x32cde0[_0x11cd('0x35')]);_0x4a6bec['filters']=_[_0x11cd('0x36')](_0x4a6bec[_0x11cd('0x33')],_0x4a6bec[_0x11cd('0x35')]);_0xb3ed2f['attributes']=_[_0x11cd('0x36')](_0x4a6bec['model'],qs[_0x11cd('0x37')](_0x32cde0[_0x11cd('0x35')][_0x11cd('0x37')]));_0xb3ed2f[_0x11cd('0x38')]=_0xb3ed2f[_0x11cd('0x38')][_0x11cd('0x39')]?_0xb3ed2f[_0x11cd('0x38')]:_0x4a6bec[_0x11cd('0x33')];if(!_0x32cde0['query'][_0x11cd('0x3a')](_0x11cd('0x3b'))){_0xb3ed2f[_0x11cd('0x24')]=qs[_0x11cd('0x24')](_0x32cde0[_0x11cd('0x35')]['limit']);_0xb3ed2f[_0x11cd('0x21')]=qs[_0x11cd('0x21')](_0x32cde0[_0x11cd('0x35')][_0x11cd('0x21')]);}_0xb3ed2f[_0x11cd('0x3c')]=qs[_0x11cd('0x3d')](_0x32cde0[_0x11cd('0x35')][_0x11cd('0x3d')]);_0xb3ed2f[_0x11cd('0x3e')]=qs[_0x11cd('0x3f')](_[_0x11cd('0x40')](_0x32cde0[_0x11cd('0x35')],_0x4a6bec[_0x11cd('0x3f')]),_0x2cdc36);if(_0x32cde0[_0x11cd('0x35')][_0x11cd('0x41')]){_0xb3ed2f[_0x11cd('0x3e')]=_[_0x11cd('0x42')](_0xb3ed2f['where'],{'$or':_['map'](_0x2cdc36,function(_0x362275){if(_0x362275[_0x11cd('0x32')]!==_0x11cd('0x43')){var _0x399086={};_0x399086[_0x362275[_0x11cd('0x34')]]={'$like':'%'+_0x32cde0['query'][_0x11cd('0x41')]+'%'};return _0x399086;}})});}_0xb3ed2f=_[_0x11cd('0x42')]({},_0xb3ed2f,_0x32cde0['options']);var _0x25719a={'where':_0xb3ed2f[_0x11cd('0x3e')]};return db['JscriptySessionReport'][_0x11cd('0x23')](_0x25719a)[_0x11cd('0x28')](function(_0x1d128b){_0xf73319['count']=_0x1d128b;if(_0x32cde0[_0x11cd('0x35')][_0x11cd('0x44')]){_0xb3ed2f[_0x11cd('0x45')]=[{'all':!![]}];}return db[_0x11cd('0x2f')]['findAll'](_0xb3ed2f);})[_0x11cd('0x28')](function(_0x189f94){_0xf73319['rows']=_0x189f94;return _0xf73319;})[_0x11cd('0x28')](respondWithFilteredResult(_0x43cb75,_0xb3ed2f))[_0x11cd('0x46')](handleError(_0x43cb75,null));};exports['show']=function(_0x3691ed,_0x3efee8){var _0x9a98a6={'raw':!![],'where':{'id':_0x3691ed[_0x11cd('0x47')]['id']}},_0x149a7a={};_0x149a7a[_0x11cd('0x33')]=_[_0x11cd('0x48')](db[_0x11cd('0x2f')]['rawAttributes']);_0x149a7a[_0x11cd('0x35')]=_[_0x11cd('0x48')](_0x3691ed[_0x11cd('0x35')]);_0x149a7a[_0x11cd('0x3f')]=_[_0x11cd('0x36')](_0x149a7a[_0x11cd('0x33')],_0x149a7a[_0x11cd('0x35')]);_0x9a98a6[_0x11cd('0x38')]=_[_0x11cd('0x36')](_0x149a7a[_0x11cd('0x33')],qs['fields'](_0x3691ed['query'][_0x11cd('0x37')]));_0x9a98a6['attributes']=_0x9a98a6[_0x11cd('0x38')][_0x11cd('0x39')]?_0x9a98a6[_0x11cd('0x38')]:_0x149a7a['model'];if(_0x3691ed['query'][_0x11cd('0x44')]){_0x9a98a6[_0x11cd('0x45')]=[{'all':!![]}];}_0x9a98a6=_['merge']({},_0x9a98a6,_0x3691ed[_0x11cd('0x49')]);return db['JscriptySessionReport']['find'](_0x9a98a6)[_0x11cd('0x28')](handleEntityNotFound(_0x3efee8,null))[_0x11cd('0x28')](respondWithResult(_0x3efee8,null))[_0x11cd('0x46')](handleError(_0x3efee8,null));};exports['create']=function(_0x1acd06,_0x23e355){return db[_0x11cd('0x2f')][_0x11cd('0x4a')](_0x1acd06[_0x11cd('0x4b')],{})[_0x11cd('0x28')](respondWithResult(_0x23e355,0xc9))[_0x11cd('0x46')](handleError(_0x23e355,null));};exports[_0x11cd('0x27')]=function(_0x42c799,_0x292f12){if(_0x42c799[_0x11cd('0x4b')]['id']){delete _0x42c799['body']['id'];}return db[_0x11cd('0x2f')]['find']({'where':{'id':_0x42c799[_0x11cd('0x47')]['id']}})[_0x11cd('0x28')](handleEntityNotFound(_0x292f12,null))['then'](saveUpdates(_0x42c799[_0x11cd('0x4b')],null))[_0x11cd('0x28')](respondWithResult(_0x292f12,null))[_0x11cd('0x46')](handleError(_0x292f12,null));};exports['destroy']=function(_0x406f4a,_0x484cd9){return db[_0x11cd('0x2f')][_0x11cd('0x4c')]({'where':{'id':_0x406f4a[_0x11cd('0x47')]['id']}})[_0x11cd('0x28')](handleEntityNotFound(_0x484cd9,null))[_0x11cd('0x28')](removeEntity(_0x484cd9,null))[_0x11cd('0x46')](handleError(_0x484cd9,null));};exports['describe']=function(_0x17dc84,_0x741a3d){return db[_0x11cd('0x2f')][_0x11cd('0x4d')]()[_0x11cd('0x28')](respondWithResult(_0x741a3d,null))[_0x11cd('0x46')](handleError(_0x741a3d,null));};exports[_0x11cd('0x4e')]=function(_0x5a792b,_0x298bfc,_0xe9b5fc){var _0x2eef21={'raw':!![],'where':{}};var _0x19f297={};var _0x5cc05c={'count':0x0,'rows':[]};return db[_0x11cd('0x2f')][_0x11cd('0x4f')]({'where':{'id':_0x5a792b[_0x11cd('0x47')]['id']}})[_0x11cd('0x28')](handleEntityNotFound(_0x298bfc,null))[_0x11cd('0x28')](function(_0xa178c5){if(_0xa178c5){_0x19f297['model']=_[_0x11cd('0x48')](db[_0x11cd('0x50')][_0x11cd('0x30')]);_0x19f297[_0x11cd('0x35')]=_[_0x11cd('0x48')](_0x5a792b['query']);_0x19f297['filters']=_[_0x11cd('0x36')](_0x19f297[_0x11cd('0x33')],_0x19f297[_0x11cd('0x35')]);_0x2eef21[_0x11cd('0x38')]=_['intersection'](_0x19f297[_0x11cd('0x33')],qs[_0x11cd('0x37')](_0x5a792b[_0x11cd('0x35')]['fields']));_0x2eef21[_0x11cd('0x38')]=_0x2eef21[_0x11cd('0x38')][_0x11cd('0x39')]?_0x2eef21[_0x11cd('0x38')]:_0x19f297[_0x11cd('0x33')];if(!_0x5a792b[_0x11cd('0x35')][_0x11cd('0x3a')]('nolimit')){_0x2eef21[_0x11cd('0x24')]=qs[_0x11cd('0x24')](_0x5a792b[_0x11cd('0x35')][_0x11cd('0x24')]);_0x2eef21['offset']=qs[_0x11cd('0x21')](_0x5a792b[_0x11cd('0x35')][_0x11cd('0x21')]);}_0x2eef21[_0x11cd('0x3c')]=qs[_0x11cd('0x3d')](_0x5a792b['query']['sort']);_0x2eef21['where']=qs[_0x11cd('0x3f')](_[_0x11cd('0x40')](_0x5a792b[_0x11cd('0x35')],_0x19f297[_0x11cd('0x3f')]));_0x2eef21[_0x11cd('0x3e')][_0x11cd('0x51')]=_0xa178c5['id'];if(_0x5a792b[_0x11cd('0x35')][_0x11cd('0x41')]){_0x2eef21[_0x11cd('0x3e')]=_[_0x11cd('0x42')](_0x2eef21[_0x11cd('0x3e')],{'$or':_[_0x11cd('0x2e')](_0x2eef21[_0x11cd('0x38')],function(_0x15f2ee){var _0xa25270={};_0xa25270[_0x15f2ee]={'$like':'%'+_0x5a792b[_0x11cd('0x35')][_0x11cd('0x41')]+'%'};return _0xa25270;})});}_0x2eef21=_['merge']({},_0x2eef21,_0x5a792b['options']);return db[_0x11cd('0x50')][_0x11cd('0x23')]({'where':_0x2eef21[_0x11cd('0x3e')]})['then'](function(_0xd66682){_0x5cc05c['count']=_0xd66682;if(_0x5a792b['query'][_0x11cd('0x44')]){_0x2eef21[_0x11cd('0x45')]=[{'all':!![]}];}return db[_0x11cd('0x50')][_0x11cd('0x52')](_0x2eef21);})['then'](function(_0x145cc8){_0x5cc05c[_0x11cd('0x53')]=_0x145cc8;return _0x5cc05c;});}})['then'](respondWithFilteredResult(_0x298bfc,_0x2eef21))[_0x11cd('0x46')](handleError(_0x298bfc,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 6a211ff..3a6aaca 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 _0x1db9=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x5868e8,_0x52e7c3){var _0x24ac5=function(_0x55e12c){while(--_0x55e12c){_0x5868e8['push'](_0x5868e8['shift']());}};_0x24ac5(++_0x52e7c3);}(_0x1db9,0x176));var _0x91db=function(_0x403df9,_0x5aa841){_0x403df9=_0x403df9-0x0;var _0x16952b=_0x1db9[_0x403df9];return _0x16952b;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb66=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcb66,0x19f));var _0x6cb6=function(_0x2becba,_0x4ea656){_0x2becba=_0x2becba-0x0;var _0x90b5dd=_0xcb66[_0x2becba];return _0x90b5dd;};'use strict';var _=require('lodash');var util=require(_0x6cb6('0x0'));var logger=require(_0x6cb6('0x1'))(_0x6cb6('0x2'));var moment=require(_0x6cb6('0x3'));var BPromise=require(_0x6cb6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6cb6('0x5'));var rimraf=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var attributes=require(_0x6cb6('0x8'));module[_0x6cb6('0x9')]=function(_0x506d14,_0x53078d){return _0x506d14[_0x6cb6('0xa')](_0x6cb6('0xb'),attributes,{'tableName':_0x6cb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 0d2a957..6a52941 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 _0x82c4=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4369ef,_0x55cfbc){var _0x5b6913=function(_0x7a7436){while(--_0x7a7436){_0x4369ef['push'](_0x4369ef['shift']());}};_0x5b6913(++_0x55cfbc);}(_0x82c4,0x1ca));var _0x482c=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x82c4[_0x35af23];return _0x340506;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var moment=require(_0x482c('0x2'));var BPromise=require(_0x482c('0x3'));var rs=require(_0x482c('0x4'));var fs=require('fs');var Redis=require(_0x482c('0x5'));var db=require(_0x482c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x482c('0x7'))('rpc');var config=require(_0x482c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x482c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfdb92,_0x32a503,_0x35cdab){return new BPromise(function(_0x1c10f2,_0x3846d8){return client['request'](_0xfdb92,_0x35cdab)[_0x482c('0xa')](function(_0x135cc1){logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));logger[_0x482c('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x32a503,_0x482c('0xd'),JSON[_0x482c('0xf')](_0x135cc1));if(_0x135cc1[_0x482c('0x10')]){if(_0x135cc1['error'][_0x482c('0x11')]===0x1f4){logger[_0x482c('0x10')](_0x482c('0xc'),_0x32a503,_0x135cc1['error']['message']);return _0x3846d8(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x32a503,_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);return _0x1c10f2(_0x135cc1[_0x482c('0x10')][_0x482c('0x12')]);}else{logger[_0x482c('0xb')](_0x482c('0xc'),_0x32a503,_0x482c('0xd'));_0x1c10f2(_0x135cc1[_0x482c('0x13')][_0x482c('0x12')]);}})[_0x482c('0x14')](function(_0x363403){logger[_0x482c('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x32a503,_0x363403);_0x3846d8(_0x363403);});});} \ No newline at end of file +var _0x68b3=['rpc','jayson/promise','client','http','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42f4ad,_0x212b35){var _0x3901d6=function(_0x23849a){while(--_0x23849a){_0x42f4ad['push'](_0x42f4ad['shift']());}};_0x3901d6(++_0x212b35);}(_0x68b3,0x1d8));var _0x368b=function(_0x11e812,_0x4c4138){_0x11e812=_0x11e812-0x0;var _0x33f31d=_0x68b3[_0x11e812];return _0x33f31d;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23584a,_0x4406c8,_0x127c1e){return new BPromise(function(_0x2dec1c,_0x142d05){return client[_0x368b('0xc')](_0x23584a,_0x127c1e)[_0x368b('0xd')](function(_0x2a7b9f){logger['info'](_0x368b('0xe'),_0x4406c8,_0x368b('0xf'));logger[_0x368b('0x10')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x4406c8,_0x368b('0xf'),JSON[_0x368b('0x11')](_0x2a7b9f));if(_0x2a7b9f[_0x368b('0x12')]){if(_0x2a7b9f['error'][_0x368b('0x13')]===0x1f4){logger[_0x368b('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x142d05(_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);}logger[_0x368b('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x2dec1c(_0x2a7b9f['error'][_0x368b('0x14')]);}else{logger[_0x368b('0x15')](_0x368b('0xe'),_0x4406c8,'request\x20sent');_0x2dec1c(_0x2a7b9f[_0x368b('0x16')][_0x368b('0x14')]);}})[_0x368b('0x17')](function(_0x4d6d9d){logger[_0x368b('0x12')](_0x368b('0xe'),_0x4406c8,_0x4d6d9d);_0x142d05(_0x4d6d9d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index ff8fa7d..35533bb 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 _0x325f=['isAuthenticated','downloadLogFile','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id','update','/download_log_file'];(function(_0x51308d,_0x42cf02){var _0x37cde8=function(_0x527de4){while(--_0x527de4){_0x51308d['push'](_0x51308d['shift']());}};_0x37cde8(++_0x42cf02);}(_0x325f,0x18a));var _0xf325=function(_0x4f8ffb,_0x3c3bd0){_0x4f8ffb=_0x4f8ffb-0x0;var _0x5dacf8=_0x325f[_0x4f8ffb];return _0x5dacf8;};'use strict';var multer=require(_0xf325('0x0'));var util=require('util');var path=require(_0xf325('0x1'));var timeout=require(_0xf325('0x2'));var express=require('express');var router=express[_0xf325('0x3')]();var fs_extra=require(_0xf325('0x4'));var auth=require(_0xf325('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf325('0x6'));var controller=require(_0xf325('0x7'));router[_0xf325('0x8')]('/',controller[_0xf325('0x9')]);router[_0xf325('0xa')](_0xf325('0xb'),auth['isAuthenticated'](),controller[_0xf325('0xc')]);router[_0xf325('0x8')](_0xf325('0xd'),auth[_0xf325('0xe')](),controller[_0xf325('0xf')]);module[_0xf325('0x10')]=router; \ No newline at end of file +var _0xad2b=['downloadLogFile','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','isAuthenticated','get'];(function(_0x7d42c6,_0x400101){var _0x2b4d52=function(_0x3c1b0d){while(--_0x3c1b0d){_0x7d42c6['push'](_0x7d42c6['shift']());}};_0x2b4d52(++_0x400101);}(_0xad2b,0x16d));var _0xbad2=function(_0x1b78e5,_0x1b22a7){_0x1b78e5=_0x1b78e5-0x0;var _0x10b1e8=_0xad2b[_0x1b78e5];return _0x10b1e8;};'use strict';var multer=require(_0xbad2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbad2('0x1'));var express=require(_0xbad2('0x2'));var router=express[_0xbad2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbad2('0x4'));var interaction=require(_0xbad2('0x5'));var config=require(_0xbad2('0x6'));var controller=require(_0xbad2('0x7'));router['get']('/',controller[_0xbad2('0x8')]);router[_0xbad2('0x9')]('/:id',auth[_0xbad2('0xa')](),controller['update']);router[_0xbad2('0xb')]('/download_log_file',auth[_0xbad2('0xa')](),controller[_0xbad2('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index f6703c1..0999657 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 _0xfde6=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x2f3d73,_0x2e35ac){var _0x2b5fb7=function(_0x427d46){while(--_0x427d46){_0x2f3d73['push'](_0x2f3d73['shift']());}};_0x2b5fb7(++_0x2e35ac);}(_0xfde6,0x166));var _0x6fde=function(_0x1dde47,_0x587043){_0x1dde47=_0x1dde47-0x0;var _0x2814e4=_0xfde6[_0x1dde47];return _0x2814e4;};'use strict';var Sequelize=require(_0x6fde('0x0'));module[_0x6fde('0x1')]={'license':{'type':Sequelize[_0x6fde('0x2')]},'data1':{'type':Sequelize[_0x6fde('0x3')]},'data2':{'type':Sequelize[_0x6fde('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x6fde('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe20a=['TEXT','STRING','exports'];(function(_0x27380e,_0x4c5c6c){var _0x46eb19=function(_0x44b663){while(--_0x44b663){_0x27380e['push'](_0x27380e['shift']());}};_0x46eb19(++_0x4c5c6c);}(_0xe20a,0x7d));var _0xae20=function(_0x461521,_0x3950c8){_0x461521=_0x461521-0x0;var _0x14bb04=_0xe20a[_0x461521];return _0x14bb04;};'use strict';var Sequelize=require('sequelize');module[_0xae20('0x0')]={'license':{'type':Sequelize[_0xae20('0x1')]},'data1':{'type':Sequelize[_0xae20('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 985c466..bea5f6f 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 _0xa3db=['index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','checkLicense','downloadLogFile','license-info.log','join','/var','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','send'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xa3db,0x18f));var _0xba3d=function(_0x361f75,_0x5acb22){_0x361f75=_0x361f75-0x0;var _0x49a5e9=_0xa3db[_0x361f75];return _0x49a5e9;};'use strict';var emlformat=require(_0xba3d('0x0'));var rimraf=require(_0xba3d('0x1'));var zipdir=require(_0xba3d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba3d('0x3'));var moment=require(_0xba3d('0x4'));var BPromise=require(_0xba3d('0x5'));var Mustache=require(_0xba3d('0x6'));var util=require(_0xba3d('0x7'));var path=require('path');var sox=require(_0xba3d('0x8'));var csv=require(_0xba3d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xba3d('0xa'));var squel=require(_0xba3d('0xb'));var crypto=require(_0xba3d('0xc'));var jsforce=require(_0xba3d('0xd'));var deskjs=require(_0xba3d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xba3d('0xf'));var Papa=require(_0xba3d('0x10'));var Redis=require(_0xba3d('0x11'));var authService=require(_0xba3d('0x12'));var qs=require(_0xba3d('0x13'));var as=require(_0xba3d('0x14'));var hardwareService=require(_0xba3d('0x15'));var logger=require(_0xba3d('0x16'))(_0xba3d('0x17'));var utils=require(_0xba3d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xba3d('0x19'));var db=require(_0xba3d('0x1a'))['db'];function respondWithStatusCode(_0x58a9e8,_0x15134c){_0x15134c=_0x15134c||0xcc;return function(_0x10108f){if(_0x10108f){return _0x58a9e8['sendStatus'](_0x15134c);}return _0x58a9e8[_0xba3d('0x1b')](_0x15134c)[_0xba3d('0x1c')]();};}function respondWithResult(_0x43ab6e,_0x5f2c6c){_0x5f2c6c=_0x5f2c6c||0xc8;return function(_0x4950d5){if(_0x4950d5){return _0x43ab6e[_0xba3d('0x1b')](_0x5f2c6c)[_0xba3d('0x1d')](_0x4950d5);}};}function respondWithFilteredResult(_0x4685b5,_0x4258c3){return function(_0x5f0396){if(_0x5f0396){var _0x272e64=typeof _0x4258c3[_0xba3d('0x1e')]===_0xba3d('0x1f')&&typeof _0x4258c3[_0xba3d('0x20')]==='undefined';var _0x5685da=_0x5f0396[_0xba3d('0x21')];var _0x5a325f=_0x272e64?0x0:_0x4258c3[_0xba3d('0x1e')];var _0x4137a1=_0x272e64?_0x5f0396[_0xba3d('0x21')]:_0x4258c3[_0xba3d('0x1e')]+_0x4258c3[_0xba3d('0x20')];var _0x12debe;if(_0x4137a1>=_0x5685da){_0x4137a1=_0x5685da;_0x12debe=0xc8;}else{_0x12debe=0xce;}_0x4685b5[_0xba3d('0x1b')](_0x12debe);return _0x4685b5[_0xba3d('0x22')](_0xba3d('0x23'),_0x5a325f+'-'+_0x4137a1+'/'+_0x5685da)[_0xba3d('0x1d')](_0x5f0396);}return null;};}function patchUpdates(_0x4fcaf4){return function(_0x3c553e){try{jsonpatch[_0xba3d('0x24')](_0x3c553e,_0x4fcaf4,!![]);}catch(_0x4825b1){return BPromise[_0xba3d('0x25')](_0x4825b1);}return _0x3c553e[_0xba3d('0x26')]();};}function saveUpdates(_0x3c616c,_0x422a3d){return function(_0x18fa24){if(_0x18fa24){return _0x18fa24[_0xba3d('0x27')](_0x3c616c)[_0xba3d('0x28')](function(_0x5bbdbc){return _0x5bbdbc;});}return null;};}function removeEntity(_0x1a2c91,_0x17388a){return function(_0x3f7d02){if(_0x3f7d02){return _0x3f7d02[_0xba3d('0x29')]()['then'](function(){_0x1a2c91['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36aae7,_0x3f6c64){return function(_0x3ac939){if(!_0x3ac939){_0x36aae7[_0xba3d('0x2a')](0x194);}return _0x3ac939;};}function handleError(_0x20a9ee,_0x581af9){_0x581af9=_0x581af9||0x1f4;return function(_0x57d444){logger['error'](_0x57d444['stack']);if(_0x57d444[_0xba3d('0x2b')]){delete _0x57d444[_0xba3d('0x2b')];}_0x20a9ee[_0xba3d('0x1b')](_0x581af9)[_0xba3d('0x2c')](_0x57d444);};}var utilLicense=require(_0xba3d('0x19'));exports[_0xba3d('0x2d')]=function(_0x579ff1,_0x15bbe0){var _0x525cd4={'raw':!![],'where':{'id':0x1}},_0x405414={};_0x405414[_0xba3d('0x2e')]=_[_0xba3d('0x2f')](db['License'][_0xba3d('0x30')]);_0x405414['query']=_[_0xba3d('0x2f')](_0x579ff1[_0xba3d('0x31')]);_0x405414[_0xba3d('0x32')]=_[_0xba3d('0x33')](_0x405414[_0xba3d('0x2e')],_0x405414[_0xba3d('0x31')]);_0x525cd4['attributes']=_[_0xba3d('0x33')](_0x405414[_0xba3d('0x2e')],qs[_0xba3d('0x34')](_0x579ff1[_0xba3d('0x31')]['fields']));_0x525cd4[_0xba3d('0x35')]=_0x525cd4['attributes'][_0xba3d('0x36')]?_0x525cd4[_0xba3d('0x35')]:_0x405414[_0xba3d('0x2e')];_0x525cd4=_['merge']({},_0x525cd4,_0x579ff1[_0xba3d('0x37')]);return utilLicense[_0xba3d('0x38')](_0x525cd4)[_0xba3d('0x28')](respondWithResult(_0x15bbe0,null))[_0xba3d('0x39')](handleError(_0x15bbe0,null));};exports[_0xba3d('0x27')]=function(_0x3fe203,_0x2f9bd2){if(_0x3fe203['body']['id']){delete _0x3fe203[_0xba3d('0x3a')]['id'];}return db[_0xba3d('0x3b')][_0xba3d('0x3c')]({'where':{'id':_0x3fe203[_0xba3d('0x3d')]['id']}})[_0xba3d('0x28')](handleEntityNotFound(_0x2f9bd2,null))[_0xba3d('0x28')](function(_0x37616b){var _0x2515a4=_0x37616b[_0xba3d('0x3e')]({'plain':!![]});return utilLicense[_0xba3d('0x3f')](_0x2515a4,_0x3fe203['body']['key']);})[_0xba3d('0x28')](function(_0x16cd75){if(!_0x16cd75['demo']){return saveUpdates(_0x3fe203[_0xba3d('0x3a')],null);}return _0x16cd75;})[_0xba3d('0x28')](respondWithResult(_0x2f9bd2,null))[_0xba3d('0x39')](handleError(_0x2f9bd2,null));};exports[_0xba3d('0x40')]=function(_0x4eb28a,_0x549bb5){var _0x6ae403=_0xba3d('0x41');var _0x2555ab=path[_0xba3d('0x42')](_0xba3d('0x43'),'log',_0xba3d('0x44'),_0x6ae403);_0x549bb5[_0xba3d('0x45')](_0xba3d('0x46'),'attachment;\x20filename='+_0x6ae403);_0x549bb5[_0xba3d('0x22')](_0xba3d('0x47'),_0xba3d('0x48'));_0x549bb5[_0xba3d('0x49')](_0x2555ab);}; \ No newline at end of file +var _0xaab1=['undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','catch','update','body','find','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','text/plain','download','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','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','offset'];(function(_0x15d1a7,_0x3cde93){var _0xf2e425=function(_0x4535e6){while(--_0x4535e6){_0x15d1a7['push'](_0x15d1a7['shift']());}};_0xf2e425(++_0x3cde93);}(_0xaab1,0x1da));var _0x1aab=function(_0x337e4e,_0x543d40){_0x337e4e=_0x337e4e-0x0;var _0x1c4076=_0xaab1[_0x337e4e];return _0x1c4076;};'use strict';var emlformat=require(_0x1aab('0x0'));var rimraf=require(_0x1aab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1aab('0x2'));var rp=require(_0x1aab('0x3'));var moment=require(_0x1aab('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1aab('0x5'));var util=require(_0x1aab('0x6'));var path=require(_0x1aab('0x7'));var sox=require('sox');var csv=require(_0x1aab('0x8'));var ejs=require(_0x1aab('0x9'));var fs=require('fs');var fs_extra=require(_0x1aab('0xa'));var _=require(_0x1aab('0xb'));var squel=require(_0x1aab('0xc'));var crypto=require(_0x1aab('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1aab('0xe'));var toCsv=require(_0x1aab('0x8'));var querystring=require('querystring');var Papa=require(_0x1aab('0xf'));var Redis=require(_0x1aab('0x10'));var authService=require(_0x1aab('0x11'));var qs=require(_0x1aab('0x12'));var as=require(_0x1aab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aab('0x14'))(_0x1aab('0x15'));var utils=require(_0x1aab('0x16'));var config=require(_0x1aab('0x17'));var licenseUtil=require(_0x1aab('0x18'));var db=require(_0x1aab('0x19'))['db'];function respondWithStatusCode(_0x32f0e3,_0x168286){_0x168286=_0x168286||0xcc;return function(_0x4a03ee){if(_0x4a03ee){return _0x32f0e3[_0x1aab('0x1a')](_0x168286);}return _0x32f0e3[_0x1aab('0x1b')](_0x168286)[_0x1aab('0x1c')]();};}function respondWithResult(_0x301d30,_0x4d3457){_0x4d3457=_0x4d3457||0xc8;return function(_0x154a3f){if(_0x154a3f){return _0x301d30[_0x1aab('0x1b')](_0x4d3457)['json'](_0x154a3f);}};}function respondWithFilteredResult(_0x277cd2,_0x3250d0){return function(_0x1834c3){if(_0x1834c3){var _0x50cb79=typeof _0x3250d0[_0x1aab('0x1d')]===_0x1aab('0x1e')&&typeof _0x3250d0[_0x1aab('0x1f')]===_0x1aab('0x1e');var _0x1e2fd3=_0x1834c3[_0x1aab('0x20')];var _0x16721e=_0x50cb79?0x0:_0x3250d0[_0x1aab('0x1d')];var _0x1b5c49=_0x50cb79?_0x1834c3[_0x1aab('0x20')]:_0x3250d0[_0x1aab('0x1d')]+_0x3250d0['limit'];var _0x54e7d5;if(_0x1b5c49>=_0x1e2fd3){_0x1b5c49=_0x1e2fd3;_0x54e7d5=0xc8;}else{_0x54e7d5=0xce;}_0x277cd2[_0x1aab('0x1b')](_0x54e7d5);return _0x277cd2[_0x1aab('0x21')](_0x1aab('0x22'),_0x16721e+'-'+_0x1b5c49+'/'+_0x1e2fd3)['json'](_0x1834c3);}return null;};}function patchUpdates(_0x269f9d){return function(_0x40c4d9){try{jsonpatch[_0x1aab('0x23')](_0x40c4d9,_0x269f9d,!![]);}catch(_0x316fcc){return BPromise[_0x1aab('0x24')](_0x316fcc);}return _0x40c4d9[_0x1aab('0x25')]();};}function saveUpdates(_0x2611aa,_0x422b52){return function(_0x50478d){if(_0x50478d){return _0x50478d['update'](_0x2611aa)[_0x1aab('0x26')](function(_0x5262dd){return _0x5262dd;});}return null;};}function removeEntity(_0x1788a8,_0x4aca5e){return function(_0x1dc952){if(_0x1dc952){return _0x1dc952[_0x1aab('0x27')]()[_0x1aab('0x26')](function(){_0x1788a8[_0x1aab('0x1b')](0xcc)[_0x1aab('0x1c')]();});}};}function handleEntityNotFound(_0xac5d4b,_0x464f09){return function(_0x116b92){if(!_0x116b92){_0xac5d4b[_0x1aab('0x1a')](0x194);}return _0x116b92;};}function handleError(_0x3a4ff3,_0x3e6553){_0x3e6553=_0x3e6553||0x1f4;return function(_0x24eab2){logger[_0x1aab('0x28')](_0x24eab2['stack']);if(_0x24eab2[_0x1aab('0x29')]){delete _0x24eab2[_0x1aab('0x29')];}_0x3a4ff3[_0x1aab('0x1b')](_0x3e6553)['send'](_0x24eab2);};}var utilLicense=require(_0x1aab('0x18'));exports[_0x1aab('0x2a')]=function(_0x558a24,_0x149861){var _0x1e5702={'raw':!![],'where':{'id':0x1}},_0x57a63d={};_0x57a63d[_0x1aab('0x2b')]=_[_0x1aab('0x2c')](db[_0x1aab('0x2d')][_0x1aab('0x2e')]);_0x57a63d[_0x1aab('0x2f')]=_[_0x1aab('0x2c')](_0x558a24['query']);_0x57a63d[_0x1aab('0x30')]=_[_0x1aab('0x31')](_0x57a63d[_0x1aab('0x2b')],_0x57a63d['query']);_0x1e5702['attributes']=_[_0x1aab('0x31')](_0x57a63d[_0x1aab('0x2b')],qs[_0x1aab('0x32')](_0x558a24[_0x1aab('0x2f')][_0x1aab('0x32')]));_0x1e5702[_0x1aab('0x33')]=_0x1e5702['attributes'][_0x1aab('0x34')]?_0x1e5702[_0x1aab('0x33')]:_0x57a63d['model'];_0x1e5702=_[_0x1aab('0x35')]({},_0x1e5702,_0x558a24[_0x1aab('0x36')]);return utilLicense['getLicense'](_0x1e5702)[_0x1aab('0x26')](respondWithResult(_0x149861,null))[_0x1aab('0x37')](handleError(_0x149861,null));};exports[_0x1aab('0x38')]=function(_0x45a59d,_0x18f7b5){if(_0x45a59d[_0x1aab('0x39')]['id']){delete _0x45a59d[_0x1aab('0x39')]['id'];}return db['License'][_0x1aab('0x3a')]({'where':{'id':_0x45a59d[_0x1aab('0x3b')]['id']}})[_0x1aab('0x26')](handleEntityNotFound(_0x18f7b5,null))[_0x1aab('0x26')](function(_0xbfffac){var _0x5bdb34=_0xbfffac['get']({'plain':!![]});return utilLicense[_0x1aab('0x3c')](_0x5bdb34,_0x45a59d[_0x1aab('0x39')][_0x1aab('0x3d')]);})[_0x1aab('0x26')](function(_0x4a8f98){if(!_0x4a8f98[_0x1aab('0x3e')]){return saveUpdates(_0x45a59d['body'],null);}return _0x4a8f98;})[_0x1aab('0x26')](respondWithResult(_0x18f7b5,null))[_0x1aab('0x37')](handleError(_0x18f7b5,null));};exports[_0x1aab('0x3f')]=function(_0x247f20,_0xa2b639){var _0x2fe81c=_0x1aab('0x40');var _0x475490=path[_0x1aab('0x41')](_0x1aab('0x42'),_0x1aab('0x43'),_0x1aab('0x44'),_0x2fe81c);_0xa2b639[_0x1aab('0x45')]('Content-disposition','attachment;\x20filename='+_0x2fe81c);_0xa2b639[_0x1aab('0x21')]('Content-Type',_0x1aab('0x46'));_0xa2b639[_0x1aab('0x47')](_0x475490);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 0c58a48..32b0613 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 _0x7cfe=['rimraf','../../config/environment','exports','define','license','lodash','api','moment','bluebird','request-promise','path'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x7cfe,0x94));var _0xe7cf=function(_0xe17d71,_0x405a33){_0xe17d71=_0xe17d71-0x0;var _0x4fab0b=_0x7cfe[_0xe17d71];return _0x4fab0b;};'use strict';var _=require(_0xe7cf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe7cf('0x1'));var moment=require(_0xe7cf('0x2'));var BPromise=require(_0xe7cf('0x3'));var rp=require(_0xe7cf('0x4'));var fs=require('fs');var path=require(_0xe7cf('0x5'));var rimraf=require(_0xe7cf('0x6'));var config=require(_0xe7cf('0x7'));var attributes=require('./license.attributes');module[_0xe7cf('0x8')]=function(_0x430d41,_0x3a7764){return _0x430d41[_0xe7cf('0x9')]('License',attributes,{'tableName':_0xe7cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x773b=['define','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x2e85c6,_0x499b83){var _0x1dd485=function(_0x55ae72){while(--_0x55ae72){_0x2e85c6['push'](_0x2e85c6['shift']());}};_0x1dd485(++_0x499b83);}(_0x773b,0x111));var _0xb773=function(_0xc922f0,_0xb6f4fd){_0xc922f0=_0xc922f0-0x0;var _0x1a1237=_0x773b[_0xc922f0];return _0x1a1237;};'use strict';var _=require('lodash');var util=require(_0xb773('0x0'));var logger=require('../../config/logger')(_0xb773('0x1'));var moment=require(_0xb773('0x2'));var BPromise=require(_0xb773('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb773('0x4'));var rimraf=require(_0xb773('0x5'));var config=require(_0xb773('0x6'));var attributes=require('./license.attributes');module['exports']=function(_0x44c752,_0x3d4ed2){return _0x44c752[_0xb773('0x7')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 91fe42b..52cb212 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 _0xdb1b=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','client','http'];(function(_0x15e6b4,_0x319b38){var _0x3ea7a6=function(_0x23b913){while(--_0x23b913){_0x15e6b4['push'](_0x15e6b4['shift']());}};_0x3ea7a6(++_0x319b38);}(_0xdb1b,0x1da));var _0xbdb1=function(_0x4d55e1,_0x5ca3b0){_0x4d55e1=_0x4d55e1-0x0;var _0x269a71=_0xdb1b[_0x4d55e1];return _0x269a71;};'use strict';var _=require(_0xbdb1('0x0'));var util=require(_0xbdb1('0x1'));var moment=require(_0xbdb1('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdb1('0x3'));var fs=require('fs');var Redis=require(_0xbdb1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdb1('0x5'));var logger=require('../../config/logger')(_0xbdb1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdb1('0x7')][_0xbdb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xacf659,_0xfcb099,_0x1e6c16){return new BPromise(function(_0xe3b64f,_0x3530e8){return client[_0xbdb1('0x9')](_0xacf659,_0x1e6c16)[_0xbdb1('0xa')](function(_0x472c79){logger[_0xbdb1('0xb')](_0xbdb1('0xc'),_0xfcb099,_0xbdb1('0xd'));logger[_0xbdb1('0xe')]('License,\x20%s,\x20%s,\x20%s',_0xfcb099,_0xbdb1('0xd'),JSON[_0xbdb1('0xf')](_0x472c79));if(_0x472c79[_0xbdb1('0x10')]){if(_0x472c79[_0xbdb1('0x10')][_0xbdb1('0x11')]===0x1f4){logger[_0xbdb1('0x10')]('License,\x20%s,\x20%s',_0xfcb099,_0x472c79[_0xbdb1('0x10')]['message']);return _0x3530e8(_0x472c79[_0xbdb1('0x10')][_0xbdb1('0x12')]);}logger[_0xbdb1('0x10')]('License,\x20%s,\x20%s',_0xfcb099,_0x472c79['error']['message']);return _0xe3b64f(_0x472c79[_0xbdb1('0x10')][_0xbdb1('0x12')]);}else{logger[_0xbdb1('0xb')](_0xbdb1('0xc'),_0xfcb099,_0xbdb1('0xd'));_0xe3b64f(_0x472c79[_0xbdb1('0x13')][_0xbdb1('0x12')]);}})[_0xbdb1('0x14')](function(_0x179318){logger['error'](_0xbdb1('0xc'),_0xfcb099,_0x179318);_0x3530e8(_0x179318);});});} \ No newline at end of file +var _0x5d28=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5d28,0x11d));var _0x85d2=function(_0x1c972a,_0x5001cf){_0x1c972a=_0x1c972a-0x0;var _0x5c46e8=_0x5d28[_0x1c972a];return _0x5c46e8;};'use strict';var _=require(_0x85d2('0x0'));var util=require(_0x85d2('0x1'));var moment=require('moment');var BPromise=require(_0x85d2('0x2'));var rs=require(_0x85d2('0x3'));var fs=require('fs');var Redis=require(_0x85d2('0x4'));var db=require(_0x85d2('0x5'))['db'];var utils=require(_0x85d2('0x6'));var logger=require(_0x85d2('0x7'))(_0x85d2('0x8'));var config=require(_0x85d2('0x9'));var jayson=require(_0x85d2('0xa'));var client=jayson[_0x85d2('0xb')][_0x85d2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2193bd,_0x2a1b55,_0x4f19a1){return new BPromise(function(_0xdf68dc,_0x437f6a){return client['request'](_0x2193bd,_0x4f19a1)[_0x85d2('0xd')](function(_0x590549){logger[_0x85d2('0xe')](_0x85d2('0xf'),_0x2a1b55,'request\x20sent');logger[_0x85d2('0x10')](_0x85d2('0x11'),_0x2a1b55,_0x85d2('0x12'),JSON['stringify'](_0x590549));if(_0x590549[_0x85d2('0x13')]){if(_0x590549[_0x85d2('0x13')][_0x85d2('0x14')]===0x1f4){logger[_0x85d2('0x13')](_0x85d2('0xf'),_0x2a1b55,_0x590549[_0x85d2('0x13')][_0x85d2('0x15')]);return _0x437f6a(_0x590549['error'][_0x85d2('0x15')]);}logger[_0x85d2('0x13')](_0x85d2('0xf'),_0x2a1b55,_0x590549['error']['message']);return _0xdf68dc(_0x590549[_0x85d2('0x13')][_0x85d2('0x15')]);}else{logger['info'](_0x85d2('0xf'),_0x2a1b55,_0x85d2('0x12'));_0xdf68dc(_0x590549[_0x85d2('0x16')][_0x85d2('0x15')]);}})[_0x85d2('0x17')](function(_0xdf3222){logger[_0x85d2('0x13')](_0x85d2('0xf'),_0x2a1b55,_0xdf3222);_0x437f6a(_0xdf3222);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5621526..de2b687 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 _0x6b6c=['exports','multer','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/verify','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','addSmtp','addInteraction','addApplications','send','addAgents','update','delete','removeDispositions','removeAnswers','destroy'];(function(_0x11b537,_0x26a349){var _0x5285d0=function(_0x1fea06){while(--_0x1fea06){_0x11b537['push'](_0x11b537['shift']());}};_0x5285d0(++_0x26a349);}(_0x6b6c,0x99));var _0xc6b6=function(_0x50ad85,_0x440e3e){_0x50ad85=_0x50ad85-0x0;var _0x5b9e92=_0x6b6c[_0x50ad85];return _0x5b9e92;};'use strict';var multer=require(_0xc6b6('0x0'));var util=require('util');var path=require(_0xc6b6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc6b6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc6b6('0x3'));var config=require(_0xc6b6('0x4'));var controller=require('./mailAccount.controller');router[_0xc6b6('0x5')]('/',auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x7')]);router['get'](_0xc6b6('0x8'),auth['isAuthenticated'](),controller[_0xc6b6('0x9')]);router[_0xc6b6('0x5')](_0xc6b6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc6b6('0x5')]('/:id/dispositions',auth[_0xc6b6('0x6')](),controller[_0xc6b6('0xb')]);router['get'](_0xc6b6('0xc'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0xd')]);router[_0xc6b6('0x5')](_0xc6b6('0xe'),auth[_0xc6b6('0x6')](),controller['getImap']);router[_0xc6b6('0x5')](_0xc6b6('0xf'),auth[_0xc6b6('0x6')](),controller['getSmtp']);router['get'](_0xc6b6('0x10'),auth[_0xc6b6('0x6')](),controller['getInteractions']);router['get'](_0xc6b6('0x11'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x12')]);router['get'](_0xc6b6('0x13'),auth[_0xc6b6('0x6')](),controller['getMessages']);router[_0xc6b6('0x5')](_0xc6b6('0x14'),auth['isAuthenticated'](),controller['verifySmtp']);router['get'](_0xc6b6('0x15'),auth['isAuthenticated'](),controller[_0xc6b6('0x16')]);router[_0xc6b6('0x17')](_0xc6b6('0x18'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x19')]);router[_0xc6b6('0x17')](_0xc6b6('0xc'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x1a')]);router[_0xc6b6('0x17')]('/',auth[_0xc6b6('0x6')](),controller['create']);router[_0xc6b6('0x17')](_0xc6b6('0xe'),auth[_0xc6b6('0x6')](),controller['addImap']);router['post'](_0xc6b6('0xf'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x1b')]);router[_0xc6b6('0x17')](_0xc6b6('0x10'),auth['isAuthenticated'](),controller[_0xc6b6('0x1c')]);router[_0xc6b6('0x17')](_0xc6b6('0x11'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x1d')]);router[_0xc6b6('0x17')]('/:id/send',auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x1e')]);router[_0xc6b6('0x17')](_0xc6b6('0x15'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x1f')]);router['put'](_0xc6b6('0xa'),auth['isAuthenticated'](),controller[_0xc6b6('0x20')]);router[_0xc6b6('0x21')](_0xc6b6('0x18'),auth['isAuthenticated'](),controller[_0xc6b6('0x22')]);router['delete'](_0xc6b6('0xc'),auth['isAuthenticated'](),controller[_0xc6b6('0x23')]);router[_0xc6b6('0x21')](_0xc6b6('0xe'),auth[_0xc6b6('0x6')](),controller['removeImap']);router['delete'](_0xc6b6('0xf'),auth[_0xc6b6('0x6')](),controller['removeSmtp']);router[_0xc6b6('0x21')](_0xc6b6('0xa'),auth[_0xc6b6('0x6')](),controller[_0xc6b6('0x24')]);router[_0xc6b6('0x21')]('/:id/users',auth[_0xc6b6('0x6')](),controller['removeAgents']);module[_0xc6b6('0x25')]=router; \ No newline at end of file +var _0x68c8=['getDispositions','/:id/canned_answers','getImap','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','getAgents','post','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addInteraction','addApplications','/:id/send','send','/:id/users','addAgents','put','update','delete','removeImap','removeSmtp','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions'];(function(_0x1b2f71,_0x247013){var _0x4003a2=function(_0x47e4de){while(--_0x47e4de){_0x1b2f71['push'](_0x1b2f71['shift']());}};_0x4003a2(++_0x247013);}(_0x68c8,0xf4));var _0x868c=function(_0x1e91ae,_0x5d4de1){_0x1e91ae=_0x1e91ae-0x0;var _0x3150d6=_0x68c8[_0x1e91ae];return _0x3150d6;};'use strict';var multer=require('multer');var util=require(_0x868c('0x0'));var path=require(_0x868c('0x1'));var timeout=require(_0x868c('0x2'));var express=require(_0x868c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x868c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x868c('0x5'));var controller=require(_0x868c('0x6'));router['get']('/',auth[_0x868c('0x7')](),controller[_0x868c('0x8')]);router[_0x868c('0x9')]('/describe',auth[_0x868c('0x7')](),controller[_0x868c('0xa')]);router[_0x868c('0x9')](_0x868c('0xb'),auth[_0x868c('0x7')](),controller[_0x868c('0xc')]);router['get'](_0x868c('0xd'),auth[_0x868c('0x7')](),controller[_0x868c('0xe')]);router[_0x868c('0x9')](_0x868c('0xf'),auth[_0x868c('0x7')](),controller['getAnswers']);router[_0x868c('0x9')]('/:id/in_servers',auth[_0x868c('0x7')](),controller[_0x868c('0x10')]);router[_0x868c('0x9')]('/:id/out_servers',auth[_0x868c('0x7')](),controller['getSmtp']);router[_0x868c('0x9')](_0x868c('0x11'),auth[_0x868c('0x7')](),controller[_0x868c('0x12')]);router[_0x868c('0x9')](_0x868c('0x13'),auth[_0x868c('0x7')](),controller['getApplications']);router[_0x868c('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x868c('0x14')]);router[_0x868c('0x9')](_0x868c('0x15'),auth[_0x868c('0x7')](),controller[_0x868c('0x16')]);router[_0x868c('0x9')]('/:id/users',auth[_0x868c('0x7')](),controller[_0x868c('0x17')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x868c('0x18')](_0x868c('0xf'),auth[_0x868c('0x7')](),controller[_0x868c('0x19')]);router['post']('/',auth['isAuthenticated'](),controller[_0x868c('0x1a')]);router[_0x868c('0x18')](_0x868c('0x1b'),auth[_0x868c('0x7')](),controller[_0x868c('0x1c')]);router[_0x868c('0x18')](_0x868c('0x1d'),auth[_0x868c('0x7')](),controller['addSmtp']);router[_0x868c('0x18')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x868c('0x1e')]);router['post'](_0x868c('0x13'),auth[_0x868c('0x7')](),controller[_0x868c('0x1f')]);router[_0x868c('0x18')](_0x868c('0x20'),auth[_0x868c('0x7')](),controller[_0x868c('0x21')]);router[_0x868c('0x18')](_0x868c('0x22'),auth[_0x868c('0x7')](),controller[_0x868c('0x23')]);router[_0x868c('0x24')](_0x868c('0xb'),auth[_0x868c('0x7')](),controller[_0x868c('0x25')]);router[_0x868c('0x26')](_0x868c('0xd'),auth[_0x868c('0x7')](),controller['removeDispositions']);router[_0x868c('0x26')]('/:id/canned_answers',auth[_0x868c('0x7')](),controller['removeAnswers']);router[_0x868c('0x26')](_0x868c('0x1b'),auth[_0x868c('0x7')](),controller[_0x868c('0x27')]);router['delete'](_0x868c('0x1d'),auth[_0x868c('0x7')](),controller[_0x868c('0x28')]);router['delete'](_0x868c('0xb'),auth[_0x868c('0x7')](),controller['destroy']);router[_0x868c('0x26')](_0x868c('0x22'),auth[_0x868c('0x7')](),controller[_0x868c('0x29')]);module[_0x868c('0x2a')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index b2939db..fdb6100 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 _0x7e9e=['sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','outlook365','getDataValue','provider','custom'];(function(_0x109627,_0x36fb4c){var _0x143950=function(_0x2a6778){while(--_0x2a6778){_0x109627['push'](_0x109627['shift']());}};_0x143950(++_0x36fb4c);}(_0x7e9e,0x19e));var _0xe7e9=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x7e9e[_0x1d9163];return _0xb42197;};'use strict';var Sequelize=require(_0xe7e9('0x0'));module[_0xe7e9('0x1')]={'description':{'type':Sequelize[_0xe7e9('0x2')]},'name':{'type':Sequelize[_0xe7e9('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe7e9('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe7e9('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xe7e9('0x4')]},'markAsUnread':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe7e9('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xe7e9('0x5')](0x2)[_0xe7e9('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe7e9('0x4')],'defaultValue':function(){return _0xe7e9('0x7');}},'notificationSound':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xe7e9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe7e9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe7e9('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe7e9('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe7e9('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe7e9('0x9'),'set':function(_0x268817){if(!_0x268817)this[_0xe7e9('0xa')](_0xe7e9('0xb'),null);this[_0xe7e9('0xa')](_0xe7e9('0xc'),_0x268817);}},'provider':{'type':Sequelize['ENUM'](_0xe7e9('0xd'),'hotmail','yahoo',_0xe7e9('0xe')),'defaultValue':null,'get':function(){var _0x22c953=this[_0xe7e9('0xf')](_0xe7e9('0x10'));return _0x22c953||_0xe7e9('0x11');},'set':function(_0x1ce7af){if(_0x1ce7af===_0xe7e9('0x11')){_0x1ce7af=null;}return this[_0xe7e9('0xa')](_0xe7e9('0x10'),_0x1ce7af);}}}; \ No newline at end of file +var _0xf655=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','custom','provider','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x1545bc,_0x39ddbe){var _0x4d1858=function(_0x522e9b){while(--_0x522e9b){_0x1545bc['push'](_0x1545bc['shift']());}};_0x4d1858(++_0x39ddbe);}(_0xf655,0xe7));var _0x5f65=function(_0x11aee5,_0x27fa94){_0x11aee5=_0x11aee5-0x0;var _0x2e8c9d=_0xf655[_0x11aee5];return _0x2e8c9d;};'use strict';var Sequelize=require(_0x5f65('0x0'));module[_0x5f65('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x5f65('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5f65('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5f65('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5f65('0x4')]},'markAsUnread':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x5f65('0x5')](0x2)[_0x5f65('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5f65('0x4')],'defaultValue':function(){return _0x5f65('0x7');}},'notificationSound':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x5f65('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f65('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5f65('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x5f65('0x3')],'defaultValue':![],'comment':_0x5f65('0x9'),'set':function(_0x57a2c4){if(!_0x57a2c4)this[_0x5f65('0xa')](_0x5f65('0xb'),null);this[_0x5f65('0xa')](_0x5f65('0xc'),_0x57a2c4);}},'provider':{'type':Sequelize[_0x5f65('0xd')](_0x5f65('0xe'),_0x5f65('0xf'),'yahoo',_0x5f65('0x10')),'defaultValue':null,'get':function(){var _0x50e3d1=this[_0x5f65('0x11')]('provider');return _0x50e3d1||_0x5f65('0x12');},'set':function(_0x44e736){if(_0x44e736==='custom'){_0x44e736=null;}return this[_0x5f65('0xa')](_0x5f65('0x13'),_0x44e736);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4192c41..08e3e03 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 _0x5ea4=['show','MailServerOut','mandatoryDispositionPause','rawAttributes','length','find','body','provider','custom','params','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','filter','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','MailAccounts','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','pick','getMessages','$gte','split','format','MailMessage','inlineCss','true','CmList','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','%s\x20<%s>','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List','List\x20not\x20found','subject','out','messageId','YYYY-MM-DD\x20HH:mm:ss','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','util','path','lodash','juice','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','gmail','smtp.gmail.com','hotmail','smtp-mail.outlook.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','Pause','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','MailAccount','includeAll','include','rows'];(function(_0x417a41,_0x5aeb29){var _0x1a65b2=function(_0x184e1a){while(--_0x184e1a){_0x417a41['push'](_0x417a41['shift']());}};_0x1a65b2(++_0x5aeb29);}(_0x5ea4,0x6b));var _0x45ea=function(_0xc19448,_0x4ed671){_0xc19448=_0xc19448-0x0;var _0x917d25=_0x5ea4[_0xc19448];return _0x917d25;};'use strict';var moment=require(_0x45ea('0x0'));var BPromise=require('bluebird');var util=require(_0x45ea('0x1'));var path=require(_0x45ea('0x2'));var _=require(_0x45ea('0x3'));var juice=require(_0x45ea('0x4'));var Redis=require('ioredis');var qs=require(_0x45ea('0x5'));var logger=require(_0x45ea('0x6'))(_0x45ea('0x7'));var config=require('../../config/environment');var db=require(_0x45ea('0x8'))['db'];config['redis']=_['defaults'](config[_0x45ea('0x9')],{'host':_0x45ea('0xa'),'port':0x18eb});var socket=require(_0x45ea('0xb'))(new Redis(config[_0x45ea('0x9')]));require(_0x45ea('0xc'))[_0x45ea('0xd')](socket);var jayson=require(_0x45ea('0xe'));var client=jayson[_0x45ea('0xf')][_0x45ea('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x165cf5,_0x3750fb,_0xb0894,_0x2c136a){return new BPromise(function(_0x3b3f0b,_0x57f260){var _0x572ef0=_0x2c136a||client;return _0x572ef0[_0x45ea('0x11')](_0x165cf5,_0xb0894)['then'](function(_0x5091b0){logger[_0x45ea('0x12')]('MailAccount,\x20%s,\x20%s',_0x3750fb,'request\x20sent');logger[_0x45ea('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3750fb,_0x45ea('0x14'),JSON['stringify'](_0x5091b0));if(_0x5091b0['error']){if(_0x5091b0[_0x45ea('0x15')][_0x45ea('0x16')]===0x1f4){logger[_0x45ea('0x15')](_0x45ea('0x17'),_0x3750fb,_0x5091b0[_0x45ea('0x15')][_0x45ea('0x18')]);return _0x57f260(_0x5091b0[_0x45ea('0x15')]['message']);}logger[_0x45ea('0x15')](_0x45ea('0x17'),_0x3750fb,_0x5091b0[_0x45ea('0x15')]['message']);return _0x3b3f0b(_0x5091b0[_0x45ea('0x15')][_0x45ea('0x18')]);}else{logger[_0x45ea('0x12')](_0x45ea('0x17'),_0x3750fb,'request\x20sent');_0x3b3f0b(_0x5091b0[_0x45ea('0x19')][_0x45ea('0x18')]);}})[_0x45ea('0x1a')](function(_0x6c454d){logger[_0x45ea('0x15')](_0x45ea('0x17'),_0x3750fb,_0x6c454d);_0x57f260(_0x6c454d);});});}function respondWithStatusCode(_0x159ea8,_0x2b226e){_0x2b226e=_0x2b226e||0xcc;return function(_0x470f04){if(_0x470f04){return _0x159ea8[_0x45ea('0x1b')](_0x2b226e);}return _0x159ea8['status'](_0x2b226e)['end']();};}function respondWithResult(_0x4d5426,_0x326d4f){_0x326d4f=_0x326d4f||0xc8;return function(_0x53a9c9){if(_0x53a9c9){return _0x4d5426[_0x45ea('0x1c')](_0x326d4f)[_0x45ea('0x1d')](_0x53a9c9);}};}function respondWithFilteredResult(_0xa1aac6,_0x416f13){return function(_0x32587e){if(_0x32587e){var _0x59f7bf=typeof _0x416f13['offset']==='undefined'&&typeof _0x416f13['limit']===_0x45ea('0x1e');var _0x52d270=_0x32587e[_0x45ea('0x1f')];var _0x1c4baf=_0x59f7bf?0x0:_0x416f13[_0x45ea('0x20')];var _0x33bf3b=_0x59f7bf?_0x32587e[_0x45ea('0x1f')]:_0x416f13[_0x45ea('0x20')]+_0x416f13[_0x45ea('0x21')];var _0x158722;if(_0x33bf3b>=_0x52d270){_0x33bf3b=_0x52d270;_0x158722=0xc8;}else{_0x158722=0xce;}_0xa1aac6[_0x45ea('0x1c')](_0x158722);return _0xa1aac6[_0x45ea('0x22')](_0x45ea('0x23'),_0x1c4baf+'-'+_0x33bf3b+'/'+_0x52d270)[_0x45ea('0x1d')](_0x32587e);}return null;};}function saveUpdates(_0x1d6c70){return function(_0x5f3637){if(_0x5f3637){return _0x5f3637[_0x45ea('0x24')](_0x1d6c70)[_0x45ea('0x25')](function(_0x4bd8e8){return _0x4bd8e8;});}return null;};}function removeEntity(_0xed2f49){return function(_0x314e8e){if(_0x314e8e){return _0x314e8e[_0x45ea('0x26')]()[_0x45ea('0x25')](function(){var _0x3a9092=_0x314e8e['get']({'plain':!![]});var _0x45119d='MailAccounts';return db['UserProfileResource'][_0x45ea('0x26')]({'where':{'type':_0x45119d,'resourceId':_0x3a9092['id']}})['then'](function(){return _0x314e8e;});})[_0x45ea('0x25')](function(){_0xed2f49[_0x45ea('0x1c')](0xcc)[_0x45ea('0x27')]();});}};}function handleEntityNotFound(_0x44cc41){return function(_0x437935){if(!_0x437935){_0x44cc41[_0x45ea('0x1b')](0x194);}return _0x437935;};}function handleError(_0x51428b,_0x5d2e2b){_0x5d2e2b=_0x5d2e2b||0x1f4;return function(_0x36d32a){logger[_0x45ea('0x15')](_0x36d32a[_0x45ea('0x28')]);if(_0x36d32a[_0x45ea('0x29')]){delete _0x36d32a[_0x45ea('0x29')];}_0x51428b['status'](_0x5d2e2b)[_0x45ea('0x2a')](_0x36d32a);};}function getImapHost(_0xcd0f2e){switch(_0xcd0f2e){case'gmail':return _0x45ea('0x2b');case _0x45ea('0x2c'):return _0x45ea('0x2d');case'hotmail':return _0x45ea('0x2e');case _0x45ea('0x2f'):return _0x45ea('0x30');}throw new Error(_0x45ea('0x31'),_0xcd0f2e);}function getSmtpHost(_0x4342b6){switch(_0x4342b6){case _0x45ea('0x32'):return _0x45ea('0x33');case'yahoo':return'smtp.mail.yahoo.com';case _0x45ea('0x34'):return _0x45ea('0x35');case _0x45ea('0x2f'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x4342b6);}function getAuthenticationOptions(_0xa9f6c5,_0x5e2e76){var _0x5ae406={};var _0x32393a={};if(_0xa9f6c5){_0x5ae406[_0x45ea('0x36')]=_0x32393a[_0x45ea('0x36')]=_0x5e2e76[_0x45ea('0x37')];_0x5ae406[_0x45ea('0x38')]=_0x32393a['pass']=_0x5e2e76[_0x45ea('0x38')];if(_0x5e2e76[_0x45ea('0x39')]){_0x5ae406[_0x45ea('0x39')]=_0x32393a['modernAuthentication']=!![];_0x5ae406[_0x45ea('0x3a')]=_0x32393a['CloudProviderId']=_0x5e2e76[_0x45ea('0x3a')];_0x5ae406['password']=_0x32393a[_0x45ea('0x3b')]=null;}else{_0x5ae406[_0x45ea('0x3a')]=_0x32393a[_0x45ea('0x3a')]=null;}_0x5ae406[_0x45ea('0x3c')]=getImapHost(_0xa9f6c5);_0x5ae406[_0x45ea('0x3d')]=0x3e1;_0x32393a[_0x45ea('0x3c')]=getSmtpHost(_0xa9f6c5);_0x32393a[_0x45ea('0x3d')]=0x24b;_0x32393a[_0x45ea('0x3e')]=![];_0x5ae406['service']=_0x32393a[_0x45ea('0x3f')]=null;}else{if(_0x5e2e76[_0x45ea('0x40')]){_0x5ae406[_0x45ea('0x36')]=_0x32393a[_0x45ea('0x36')]=_0x5e2e76['username'];_0x5ae406[_0x45ea('0x38')]=_0x32393a[_0x45ea('0x3b')]=_0x5e2e76[_0x45ea('0x38')];}else{_0x5ae406[_0x45ea('0x40')]=_0x32393a[_0x45ea('0x40')]=![];_0x5ae406[_0x45ea('0x36')]=_0x32393a[_0x45ea('0x36')]=null;_0x5ae406[_0x45ea('0x38')]=_0x32393a['pass']=null;}_0x5ae406[_0x45ea('0x3c')]=_0x5e2e76[_0x45ea('0x41')][_0x45ea('0x3c')];_0x5ae406[_0x45ea('0x3d')]=_0x5e2e76[_0x45ea('0x41')]['port'];_0x32393a['host']=_0x5e2e76[_0x45ea('0x42')][_0x45ea('0x3c')];_0x32393a[_0x45ea('0x3d')]=_0x5e2e76['Smtp']['port'];}return{'Imap':_0x5ae406,'Smtp':_0x32393a};}exports[_0x45ea('0x43')]=function(_0x50b006,_0xac9bf){var _0x2a049b={'include':[{'model':db[_0x45ea('0x44')],'as':_0x45ea('0x41')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x45ea('0x45')],'as':'mandatoryDispositionPause'}]},_0x4dcdaa={},_0x428d30={'count':0x0,'rows':[]};var _0x2a3aa9=_[_0x45ea('0x46')](db['MailAccount']['rawAttributes'],function(_0x506fe4){return{'name':_0x506fe4[_0x45ea('0x47')],'type':_0x506fe4['type'][_0x45ea('0x48')]};});_0x4dcdaa['model']=_['map'](_0x2a3aa9,_0x45ea('0x29'));_0x4dcdaa[_0x45ea('0x49')]=_[_0x45ea('0x4a')](_0x50b006[_0x45ea('0x49')]);_0x4dcdaa[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x4dcdaa[_0x45ea('0x4d')],_0x4dcdaa['query']);_0x2a049b[_0x45ea('0x4e')]=_[_0x45ea('0x4c')](_0x4dcdaa[_0x45ea('0x4d')],qs[_0x45ea('0x4f')](_0x50b006[_0x45ea('0x49')]['fields']));_0x2a049b[_0x45ea('0x4e')]=_0x2a049b['attributes']['length']?_0x2a049b[_0x45ea('0x4e')]:_0x4dcdaa[_0x45ea('0x4d')];if(!_0x50b006[_0x45ea('0x49')][_0x45ea('0x50')](_0x45ea('0x51'))){_0x2a049b[_0x45ea('0x21')]=qs[_0x45ea('0x21')](_0x50b006[_0x45ea('0x49')][_0x45ea('0x21')]);_0x2a049b['offset']=qs['offset'](_0x50b006[_0x45ea('0x49')][_0x45ea('0x20')]);}_0x2a049b[_0x45ea('0x52')]=qs[_0x45ea('0x53')](_0x50b006['query'][_0x45ea('0x53')]);_0x2a049b[_0x45ea('0x54')]=qs['filters'](_['pick'](_0x50b006[_0x45ea('0x49')],_0x4dcdaa[_0x45ea('0x4b')]),_0x2a3aa9);if(_0x50b006[_0x45ea('0x49')]['filter']){_0x2a049b['where']=_[_0x45ea('0x55')](_0x2a049b['where'],{'$or':_[_0x45ea('0x46')](_0x2a3aa9,function(_0xc48f89){if(_0xc48f89[_0x45ea('0x56')]!==_0x45ea('0x57')){var _0x367da8={};_0x367da8[_0xc48f89[_0x45ea('0x29')]]={'$like':'%'+_0x50b006[_0x45ea('0x49')]['filter']+'%'};return _0x367da8;}})});}_0x2a049b=_[_0x45ea('0x55')]({},_0x2a049b,_0x50b006[_0x45ea('0x58')]);var _0x3ab6b9={'where':_0x2a049b[_0x45ea('0x54')]};return db[_0x45ea('0x59')][_0x45ea('0x1f')](_0x3ab6b9)[_0x45ea('0x25')](function(_0x1c77c0){_0x428d30[_0x45ea('0x1f')]=_0x1c77c0;if(_0x50b006['query'][_0x45ea('0x5a')]){_0x2a049b[_0x45ea('0x5b')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x2a049b);})[_0x45ea('0x25')](function(_0x375f7d){_0x428d30[_0x45ea('0x5c')]=_0x375f7d;return _0x428d30;})[_0x45ea('0x25')](respondWithFilteredResult(_0xac9bf,_0x2a049b))[_0x45ea('0x1a')](handleError(_0xac9bf,null));};exports[_0x45ea('0x5d')]=function(_0x5e8452,_0x16742f){var _0x53dce0={'raw':![],'where':{'id':_0x5e8452['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0x45ea('0x41')},{'model':db[_0x45ea('0x5e')],'as':_0x45ea('0x42')},{'model':db[_0x45ea('0x45')],'as':_0x45ea('0x5f')}]},_0x388a3a={};_0x388a3a[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db[_0x45ea('0x59')][_0x45ea('0x60')]);_0x388a3a[_0x45ea('0x49')]=_['keys'](_0x5e8452[_0x45ea('0x49')]);_0x388a3a[_0x45ea('0x4b')]=_['intersection'](_0x388a3a[_0x45ea('0x4d')],_0x388a3a[_0x45ea('0x49')]);_0x53dce0[_0x45ea('0x4e')]=_[_0x45ea('0x4c')](_0x388a3a['model'],qs['fields'](_0x5e8452['query'][_0x45ea('0x4f')]));_0x53dce0[_0x45ea('0x4e')]=_0x53dce0['attributes'][_0x45ea('0x61')]?_0x53dce0[_0x45ea('0x4e')]:_0x388a3a[_0x45ea('0x4d')];if(_0x5e8452[_0x45ea('0x49')][_0x45ea('0x5a')]){_0x53dce0[_0x45ea('0x5b')]=[{'all':!![]}];}_0x53dce0=_['merge']({},_0x53dce0,_0x5e8452[_0x45ea('0x58')]);return db[_0x45ea('0x59')][_0x45ea('0x62')](_0x53dce0)['then'](handleEntityNotFound(_0x16742f,null))['then'](respondWithResult(_0x16742f,null))[_0x45ea('0x1a')](handleError(_0x16742f,null));};exports[_0x45ea('0x24')]=function(_0x5aa06f,_0x1a0db3){if(_0x5aa06f[_0x45ea('0x63')]['id']){delete _0x5aa06f[_0x45ea('0x63')]['id'];}var _0x3abb5b=_0x5aa06f['body'][_0x45ea('0x64')]===_0x45ea('0x65')?null:_0x5aa06f[_0x45ea('0x63')][_0x45ea('0x64')];var _0x44eb10=_0x5aa06f['body']['Imap']||{};var _0x2e50d1=_0x5aa06f['body'][_0x45ea('0x42')]||{};if(_0x3abb5b){_0x44eb10[_0x45ea('0x3c')]=getImapHost(_0x3abb5b);_0x44eb10[_0x45ea('0x3d')]=0x3e1;_0x2e50d1[_0x45ea('0x3c')]=getSmtpHost(_0x3abb5b);_0x2e50d1[_0x45ea('0x3d')]=0x24b;_0x2e50d1[_0x45ea('0x3e')]=![];}if(_0x2e50d1[_0x45ea('0x39')]){_0x2e50d1[_0x45ea('0x3e')]=![];}else{_0x2e50d1[_0x45ea('0x3a')]=null;}if(!_0x44eb10['modernAuthentication'])_0x44eb10[_0x45ea('0x3a')]=null;_0x5aa06f[_0x45ea('0x63')][_0x45ea('0x41')]=_0x44eb10;_0x5aa06f[_0x45ea('0x63')]['Smtp']=_0x2e50d1;return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x5aa06f[_0x45ea('0x66')]['id']},'include':[{'model':db[_0x45ea('0x44')],'as':_0x45ea('0x41')},{'model':db[_0x45ea('0x5e')],'as':'Smtp'},{'model':db[_0x45ea('0x45')],'as':_0x45ea('0x5f')}]})[_0x45ea('0x25')](handleEntityNotFound(_0x1a0db3,null))['then'](function(_0x397d61){if(!_0x397d61)throw new Error(_0x45ea('0x67'));if(_0x397d61[_0x45ea('0x3f')])delete _0x5aa06f[_0x45ea('0x63')]['Imap'];return _0x397d61;})[_0x45ea('0x25')](saveUpdates(_0x5aa06f['body'],null))['then'](function(_0x58decb){if(!_0x5aa06f[_0x45ea('0x63')]['Imap'])return _0x58decb;return db['MailServerIn']['update'](_0x5aa06f[_0x45ea('0x63')][_0x45ea('0x41')],{'where':{'MailAccountId':_0x58decb['id']}})[_0x45ea('0x25')](function(){return _0x58decb;});})[_0x45ea('0x25')](function(_0xf5a199){if(!_0x5aa06f[_0x45ea('0x63')]['Smtp'])return _0xf5a199;return db[_0x45ea('0x5e')][_0x45ea('0x24')](_0x5aa06f[_0x45ea('0x63')][_0x45ea('0x42')],{'where':{'MailAccountId':_0xf5a199['id']}})[_0x45ea('0x25')](function(){return _0xf5a199;});})[_0x45ea('0x25')](respondWithResult(_0x1a0db3,null))[_0x45ea('0x1a')](handleError(_0x1a0db3,null));};exports['describe']=function(_0x58ea0f,_0x233aaa){return db[_0x45ea('0x59')][_0x45ea('0x68')]()['then'](respondWithResult(_0x233aaa,null))['catch'](handleError(_0x233aaa,null));};exports[_0x45ea('0x69')]=function(_0x15f90f,_0x551d87){if(_0x15f90f[_0x45ea('0x63')]['id']){delete _0x15f90f['body']['id'];}return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x15f90f[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x551d87,null))[_0x45ea('0x25')](function(_0x30037b){if(_0x30037b){_0x15f90f['body'][_0x45ea('0x6a')]=_0x30037b['id'];return db[_0x45ea('0x6b')][_0x45ea('0x6c')](_0x15f90f[_0x45ea('0x63')]);}})[_0x45ea('0x25')](respondWithResult(_0x551d87,null))[_0x45ea('0x1a')](handleError(_0x551d87,null));};exports[_0x45ea('0x6d')]=function(_0x480bd8,_0x2e6d12){var _0x25d215={'raw':![],'where':{}};var _0x4a5793={};var _0x5b1c36={'count':0x0,'rows':[]};return db[_0x45ea('0x59')]['findOne']({'where':{'id':_0x480bd8[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x2e6d12,null))[_0x45ea('0x25')](function(_0x36924d){if(_0x36924d){_0x4a5793[_0x45ea('0x4d')]=_['keys'](db[_0x45ea('0x6b')][_0x45ea('0x60')]);_0x4a5793[_0x45ea('0x49')]=_[_0x45ea('0x4a')](_0x480bd8['query']);_0x4a5793[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x4a5793[_0x45ea('0x4d')],_0x4a5793[_0x45ea('0x49')]);_0x25d215[_0x45ea('0x4e')]=_[_0x45ea('0x4c')](_0x4a5793['model'],qs[_0x45ea('0x4f')](_0x480bd8[_0x45ea('0x49')]['fields']));_0x25d215[_0x45ea('0x4e')]=_0x25d215['attributes'][_0x45ea('0x61')]?_0x25d215['attributes']:_0x4a5793['model'];if(!_0x480bd8[_0x45ea('0x49')][_0x45ea('0x50')](_0x45ea('0x51'))){_0x25d215[_0x45ea('0x21')]=qs['limit'](_0x480bd8[_0x45ea('0x49')][_0x45ea('0x21')]);_0x25d215[_0x45ea('0x20')]=qs[_0x45ea('0x20')](_0x480bd8['query'][_0x45ea('0x20')]);}_0x25d215[_0x45ea('0x52')]=qs['sort'](_0x480bd8[_0x45ea('0x49')][_0x45ea('0x53')]);_0x25d215[_0x45ea('0x54')]=qs[_0x45ea('0x4b')](_['pick'](_0x480bd8[_0x45ea('0x49')],_0x4a5793[_0x45ea('0x4b')]));_0x25d215['where'][_0x45ea('0x6a')]=_0x36924d['id'];if(_0x480bd8[_0x45ea('0x49')][_0x45ea('0x6e')]){_0x25d215[_0x45ea('0x54')]=_[_0x45ea('0x55')](_0x25d215[_0x45ea('0x54')],{'$or':_[_0x45ea('0x46')](_0x25d215[_0x45ea('0x4e')],function(_0x213c62){var _0x2aab54={};_0x2aab54[_0x213c62]={'$like':'%'+_0x480bd8['query'][_0x45ea('0x6e')]+'%'};return _0x2aab54;})});}_0x25d215=_[_0x45ea('0x55')]({},_0x25d215,_0x480bd8[_0x45ea('0x58')]);return db['Disposition'][_0x45ea('0x1f')]({'where':_0x25d215[_0x45ea('0x54')]})[_0x45ea('0x25')](function(_0x551ffa){_0x5b1c36['count']=_0x551ffa;if(_0x480bd8[_0x45ea('0x49')]['includeAll']){_0x25d215[_0x45ea('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0x45ea('0x6f')](_0x25d215);})['then'](function(_0x49665a){_0x5b1c36[_0x45ea('0x5c')]=_0x49665a;return _0x5b1c36;});}})[_0x45ea('0x25')](respondWithFilteredResult(_0x2e6d12,_0x25d215))['catch'](handleError(_0x2e6d12,null));};exports[_0x45ea('0x70')]=function(_0x26d17e,_0x477d8e){return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x26d17e[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x477d8e,null))['then'](function(_0x2658d5){if(_0x2658d5){return _0x2658d5[_0x45ea('0x70')](_0x26d17e[_0x45ea('0x49')][_0x45ea('0x71')]);}})[_0x45ea('0x25')](respondWithStatusCode(_0x477d8e,null))[_0x45ea('0x1a')](handleError(_0x477d8e,null));};exports[_0x45ea('0x72')]=function(_0x331036,_0x4e2fd1){if(_0x331036[_0x45ea('0x63')]['id']){delete _0x331036[_0x45ea('0x63')]['id'];}return db['MailAccount'][_0x45ea('0x62')]({'where':{'id':_0x331036[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x4e2fd1,null))[_0x45ea('0x25')](function(_0xd08751){if(_0xd08751){_0x331036[_0x45ea('0x63')]['MailAccountId']=_0xd08751['id'];return db[_0x45ea('0x73')][_0x45ea('0x6c')](_0x331036[_0x45ea('0x63')]);}})[_0x45ea('0x25')](respondWithResult(_0x4e2fd1,null))[_0x45ea('0x1a')](handleError(_0x4e2fd1,null));};exports['getAnswers']=function(_0x42680b,_0xe7bd80){var _0xdce25a={'raw':![],'where':{}};var _0x32bac7={};var _0x3937ff={'count':0x0,'rows':[]};return db['MailAccount'][_0x45ea('0x74')]({'where':{'id':_0x42680b[_0x45ea('0x66')]['id']}})['then'](handleEntityNotFound(_0xe7bd80,null))[_0x45ea('0x25')](function(_0x460a90){if(_0x460a90){_0x32bac7[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db[_0x45ea('0x73')][_0x45ea('0x60')]);_0x32bac7[_0x45ea('0x49')]=_[_0x45ea('0x4a')](_0x42680b['query']);_0x32bac7[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x32bac7[_0x45ea('0x4d')],_0x32bac7[_0x45ea('0x49')]);_0xdce25a[_0x45ea('0x4e')]=_[_0x45ea('0x4c')](_0x32bac7['model'],qs[_0x45ea('0x4f')](_0x42680b[_0x45ea('0x49')][_0x45ea('0x4f')]));_0xdce25a[_0x45ea('0x4e')]=_0xdce25a[_0x45ea('0x4e')][_0x45ea('0x61')]?_0xdce25a[_0x45ea('0x4e')]:_0x32bac7[_0x45ea('0x4d')];if(!_0x42680b[_0x45ea('0x49')][_0x45ea('0x50')](_0x45ea('0x51'))){_0xdce25a[_0x45ea('0x21')]=qs[_0x45ea('0x21')](_0x42680b[_0x45ea('0x49')]['limit']);_0xdce25a[_0x45ea('0x20')]=qs[_0x45ea('0x20')](_0x42680b['query']['offset']);}_0xdce25a['order']=qs['sort'](_0x42680b[_0x45ea('0x49')]['sort']);_0xdce25a[_0x45ea('0x54')]=qs[_0x45ea('0x4b')](_['pick'](_0x42680b[_0x45ea('0x49')],_0x32bac7[_0x45ea('0x4b')]));_0xdce25a[_0x45ea('0x54')][_0x45ea('0x6a')]=_0x460a90['id'];if(_0x42680b[_0x45ea('0x49')][_0x45ea('0x6e')]){_0xdce25a[_0x45ea('0x54')]=_['merge'](_0xdce25a['where'],{'$or':_['map'](_0xdce25a[_0x45ea('0x4e')],function(_0x271bb2){var _0x5469d8={};_0x5469d8[_0x271bb2]={'$like':'%'+_0x42680b[_0x45ea('0x49')][_0x45ea('0x6e')]+'%'};return _0x5469d8;})});}_0xdce25a=_[_0x45ea('0x55')]({},_0xdce25a,_0x42680b[_0x45ea('0x58')]);return db[_0x45ea('0x73')][_0x45ea('0x1f')]({'where':_0xdce25a[_0x45ea('0x54')]})[_0x45ea('0x25')](function(_0x3c9097){_0x3937ff[_0x45ea('0x1f')]=_0x3c9097;if(_0x42680b['query'][_0x45ea('0x5a')]){_0xdce25a[_0x45ea('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x45ea('0x6f')](_0xdce25a);})[_0x45ea('0x25')](function(_0x332d9a){_0x3937ff['rows']=_0x332d9a;return _0x3937ff;});}})['then'](respondWithFilteredResult(_0xe7bd80,_0xdce25a))['catch'](handleError(_0xe7bd80,null));};exports[_0x45ea('0x75')]=function(_0x439170,_0x4e0d09){return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x439170[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x4e0d09,null))[_0x45ea('0x25')](function(_0x5cd82c){if(_0x5cd82c){return _0x5cd82c['removeAnswers'](_0x439170[_0x45ea('0x49')][_0x45ea('0x71')]);}})[_0x45ea('0x25')](respondWithStatusCode(_0x4e0d09,null))[_0x45ea('0x1a')](handleError(_0x4e0d09,null));};exports[_0x45ea('0x6c')]=function(_0x471dbf,_0x5dfd14){var _0x5cbf2f={'name':_0x471dbf['body'][_0x45ea('0x29')],'key':_0x471dbf[_0x45ea('0x63')][_0x45ea('0x48')],'provider':_0x471dbf[_0x45ea('0x63')][_0x45ea('0x64')]===_0x45ea('0x65')?null:_0x471dbf[_0x45ea('0x63')]['provider'],'email':_0x471dbf[_0x45ea('0x63')][_0x45ea('0x76')],'ListId':_0x471dbf['body'][_0x45ea('0x77')],'active':!_[_0x45ea('0x78')](_0x471dbf[_0x45ea('0x63')][_0x45ea('0x79')])?_0x471dbf[_0x45ea('0x63')]['active']:!![],'description':_0x471dbf['body'][_0x45ea('0x7a')]||null};var _0x453392=getAuthenticationOptions(_0x5cbf2f[_0x45ea('0x64')],_0x471dbf[_0x45ea('0x63')]);_0x5cbf2f[_0x45ea('0x41')]=_0x453392[_0x45ea('0x41')];_0x5cbf2f[_0x45ea('0x42')]=_0x453392[_0x45ea('0x42')];return db['MailAccount']['create'](_0x5cbf2f,{'include':[{'model':db[_0x45ea('0x5e')],'as':_0x45ea('0x42')},{'model':db['MailServerIn'],'as':_0x45ea('0x41')}]})[_0x45ea('0x25')](function(_0x1fa572){var _0x16c783=_0x471dbf[_0x45ea('0x36')]['get']({'plain':!![]});if(!_0x16c783)throw new Error(_0x45ea('0x7b'));if(_0x16c783[_0x45ea('0x7c')]===_0x45ea('0x36')){var _0xc815d3=_0x1fa572[_0x45ea('0x7d')]({'plain':!![]});return db['UserProfileSection'][_0x45ea('0x62')]({'where':{'name':_0x45ea('0x7e'),'userProfileId':_0x16c783['userProfileId']},'raw':!![]})[_0x45ea('0x25')](function(_0x361fd2){if(_0x361fd2&&_0x361fd2[_0x45ea('0x7f')]===0x0){return db[_0x45ea('0x80')][_0x45ea('0x6c')]({'name':_0xc815d3[_0x45ea('0x29')],'resourceId':_0xc815d3['id'],'type':_0x361fd2[_0x45ea('0x29')],'sectionId':_0x361fd2['id']},{})['then'](function(){return _0x1fa572;});}else{return _0x1fa572;}})[_0x45ea('0x1a')](function(_0x528db8){logger[_0x45ea('0x15')](_0x45ea('0x81'),_0x528db8);throw _0x528db8;});}return _0x1fa572;})[_0x45ea('0x25')](respondWithResult(_0x5dfd14,0xc9))[_0x45ea('0x1a')](handleError(_0x5dfd14,null));};exports['getImap']=function(_0x7433ea,_0xf8e79c){return db['MailAccount'][_0x45ea('0x74')]({'where':{'id':_0x7433ea[_0x45ea('0x66')]['id']}})['then'](handleEntityNotFound(_0xf8e79c,null))[_0x45ea('0x25')](function(_0x2670c0){if(_0x2670c0){return _0x2670c0[_0x45ea('0x82')]();}return null;})[_0x45ea('0x25')](respondWithResult(_0xf8e79c,null))['catch'](handleError(_0xf8e79c,null));};exports[_0x45ea('0x83')]=function(_0x2c44af,_0x2865a2){if(_0x2c44af[_0x45ea('0x63')]['id']){delete _0x2c44af[_0x45ea('0x63')]['id'];}return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x2c44af[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x2865a2,null))[_0x45ea('0x25')](function(_0x324885){if(_0x324885){_0x2c44af[_0x45ea('0x63')]['MailAccountId']=_0x324885['id'];return db[_0x45ea('0x44')][_0x45ea('0x6c')](_0x2c44af['body']);}})['then'](respondWithResult(_0x2865a2,null))[_0x45ea('0x1a')](handleError(_0x2865a2,null));};exports[_0x45ea('0x84')]=function(_0x2ef6db,_0x98e84){return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0x2ef6db['params']['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x98e84,null))[_0x45ea('0x25')](function(_0x2d317a){if(_0x2d317a){return _0x2d317a[_0x45ea('0x85')](null);}return null;})[_0x45ea('0x25')](respondWithStatusCode(_0x98e84,null))['catch'](handleError(_0x98e84,null));};exports[_0x45ea('0x86')]=function(_0x4ca21b,_0x5cf7d2){return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0x4ca21b[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x5cf7d2,null))[_0x45ea('0x25')](function(_0x467466){if(_0x467466){return _0x467466[_0x45ea('0x86')]();}return null;})[_0x45ea('0x25')](respondWithResult(_0x5cf7d2,null))[_0x45ea('0x1a')](handleError(_0x5cf7d2,null));};exports['addSmtp']=function(_0x4dd622,_0x2f8372){if(_0x4dd622[_0x45ea('0x63')]['id']){delete _0x4dd622[_0x45ea('0x63')]['id'];}return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x4dd622[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x2f8372,null))[_0x45ea('0x25')](function(_0x7d1424){if(_0x7d1424){_0x4dd622[_0x45ea('0x63')][_0x45ea('0x6a')]=_0x7d1424['id'];return db[_0x45ea('0x5e')][_0x45ea('0x6c')](_0x4dd622[_0x45ea('0x63')]);}})[_0x45ea('0x25')](respondWithResult(_0x2f8372,null))[_0x45ea('0x1a')](handleError(_0x2f8372,null));};exports['removeSmtp']=function(_0xfb2d37,_0xf1db7b){return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0xfb2d37[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0xf1db7b,null))[_0x45ea('0x25')](function(_0x1aca8a){if(_0x1aca8a){return _0x1aca8a[_0x45ea('0x87')](null);}return null;})['then'](respondWithStatusCode(_0xf1db7b,null))['catch'](handleError(_0xf1db7b,null));};exports[_0x45ea('0x88')]=function(_0xf9ae14,_0x3793fa){return db['MailInteraction'][_0x45ea('0x62')]({'where':{'id':_0xf9ae14[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x3793fa,null))[_0x45ea('0x25')](function(_0x7885b6){if(_0x7885b6){return _0x7885b6[_0x45ea('0x88')](_0xf9ae14[_0x45ea('0x63')][_0x45ea('0x71')],_['omit'](_0xf9ae14[_0x45ea('0x63')],[_0x45ea('0x71'),'id'])||{});}})[_0x45ea('0x25')](respondWithResult(_0x3793fa,null))[_0x45ea('0x1a')](handleError(_0x3793fa,null));};exports[_0x45ea('0x89')]=function(_0x593ff4,_0x4005dc){var _0x3ff1a0={'raw':![],'where':{}};var _0x43f4d1={};var _0x443a70={'count':0x0,'rows':[]};return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0x593ff4[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x4005dc,null))['then'](function(_0x585e89){if(_0x585e89){_0x43f4d1[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db[_0x45ea('0x8a')][_0x45ea('0x60')]);_0x43f4d1['query']=_['keys'](_0x593ff4[_0x45ea('0x49')]);_0x43f4d1[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x43f4d1[_0x45ea('0x4d')],_0x43f4d1[_0x45ea('0x49')]);_0x3ff1a0[_0x45ea('0x4e')]=_['intersection'](_0x43f4d1['model'],qs[_0x45ea('0x4f')](_0x593ff4[_0x45ea('0x49')]['fields']));_0x3ff1a0[_0x45ea('0x4e')]=_0x3ff1a0['attributes'][_0x45ea('0x61')]?_0x3ff1a0[_0x45ea('0x4e')]:_0x43f4d1[_0x45ea('0x4d')];if(!_0x593ff4[_0x45ea('0x49')][_0x45ea('0x50')](_0x45ea('0x51'))){_0x3ff1a0['limit']=qs['limit'](_0x593ff4[_0x45ea('0x49')]['limit']);_0x3ff1a0[_0x45ea('0x20')]=qs['offset'](_0x593ff4['query']['offset']);}_0x3ff1a0[_0x45ea('0x52')]=qs[_0x45ea('0x53')](_0x593ff4[_0x45ea('0x49')]['sort']);_0x3ff1a0[_0x45ea('0x54')]=qs['filters'](_['pick'](_0x593ff4[_0x45ea('0x49')],_0x43f4d1[_0x45ea('0x4b')]));_0x3ff1a0[_0x45ea('0x54')]['MailAccountId']=_0x585e89['id'];if(_0x593ff4['query'][_0x45ea('0x6e')]){_0x3ff1a0[_0x45ea('0x54')]=_[_0x45ea('0x55')](_0x3ff1a0[_0x45ea('0x54')],{'$or':_['map'](_0x3ff1a0[_0x45ea('0x4e')],function(_0x5141aa){var _0x34b05a={};_0x34b05a[_0x5141aa]={'$like':'%'+_0x593ff4['query'][_0x45ea('0x6e')]+'%'};return _0x34b05a;})});}_0x3ff1a0=_[_0x45ea('0x55')]({},_0x3ff1a0,_0x593ff4['options']);return db[_0x45ea('0x8a')][_0x45ea('0x1f')]({'where':_0x3ff1a0[_0x45ea('0x54')]})['then'](function(_0x31d9cd){_0x443a70['count']=_0x31d9cd;if(_0x593ff4[_0x45ea('0x49')][_0x45ea('0x5a')]){_0x3ff1a0[_0x45ea('0x5b')]=[{'model':db['CmContact'],'as':_0x45ea('0x8b'),'required':![]},{'model':db[_0x45ea('0x8c')],'as':_0x45ea('0x8d'),'attributes':[_0x45ea('0x29'),'fullname',_0x45ea('0x8e')],'required':![]},{'model':db[_0x45ea('0x8f')],'as':_0x45ea('0x90'),'attributes':['id',_0x45ea('0x29'),_0x45ea('0x91')],'where':_0x593ff4['query'][_0x45ea('0x92')]?{'id':_0x593ff4['query'][_0x45ea('0x92')]}:undefined,'required':_0x593ff4[_0x45ea('0x49')][_0x45ea('0x92')]?!![]:![]}];}return db[_0x45ea('0x8a')]['findAll'](_0x3ff1a0);})['then'](function(_0x3782e2){_0x443a70['rows']=_0x3782e2;return _0x443a70;});}})[_0x45ea('0x25')](respondWithFilteredResult(_0x4005dc,_0x3ff1a0))['catch'](handleError(_0x4005dc,null));};exports['addApplications']=function addApplications(_0x143161,_0x1c64df){var _0x5d3d3a=_0x143161[_0x45ea('0x66')]['id'];var _0x3335f0=_0x143161[_0x45ea('0x63')];var _0xc0f808=0xc8;var _0x43f89d=null;return db[_0x45ea('0x93')][_0x45ea('0x94')]({'isolationLevel':db[_0x45ea('0x93')][_0x45ea('0x95')][_0x45ea('0x96')][_0x45ea('0x97')]},function(_0x2e4103){return db[_0x45ea('0x59')]['findOne']({'where':{'id':_0x5d3d3a},'transaction':_0x2e4103})[_0x45ea('0x25')](function(_0x454f1d){if(_0x454f1d){return db[_0x45ea('0x98')][_0x45ea('0x26')]({'where':{'MailAccountId':_0x5d3d3a},'transaction':_0x2e4103})['then'](function(){var _0x1580f2=_[_0x45ea('0x46')](_0x3335f0,function(_0x3618df){_0x3618df['MailAccountId']=_0x5d3d3a;return _0x3618df;});return db[_0x45ea('0x98')][_0x45ea('0x99')](_0x1580f2,{'transaction':_0x2e4103});});}else{_0xc0f808=0x194;_0x43f89d=[];}});})['then'](function(){if(_0xc0f808!==0x194){return db[_0x45ea('0x98')][_0x45ea('0x9a')]({'where':{'MailAccountId':_0x5d3d3a},'order':'priority'})[_0x45ea('0x25')](function(_0x2789e6){_0x43f89d=_0x2789e6;});}})['catch'](function(_0x248ca3){_0xc0f808=0x1f4;logger['error'](_0x248ca3[_0x45ea('0x28')]);if(_0x248ca3[_0x45ea('0x29')]){delete _0x248ca3[_0x45ea('0x29')];}_0x43f89d=_0x248ca3;})[_0x45ea('0x9b')](function(){if(_0x43f89d===null){_0x1c64df['sendStatus'](_0xc0f808);}else{if(_0xc0f808===0x1f4){_0x1c64df[_0x45ea('0x1c')](_0xc0f808)[_0x45ea('0x2a')](_0x43f89d);}else{_0x1c64df[_0x45ea('0x1c')](_0xc0f808)[_0x45ea('0x1d')](_0x43f89d);}}});};exports[_0x45ea('0x9c')]=function(_0x6283a3,_0x4e6f85){var _0x4e8f21={};var _0x2e382b={};var _0x3a4c3c;var _0x205654;return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0x6283a3[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x4e6f85,null))[_0x45ea('0x25')](function(_0x3ab08a){if(_0x3ab08a){_0x3a4c3c=_0x3ab08a;_0x2e382b[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db[_0x45ea('0x98')][_0x45ea('0x60')]);_0x2e382b[_0x45ea('0x49')]=_[_0x45ea('0x4a')](_0x6283a3[_0x45ea('0x49')]);_0x2e382b[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x2e382b[_0x45ea('0x4d')],_0x2e382b['query']);_0x4e8f21[_0x45ea('0x4e')]=_[_0x45ea('0x4c')](_0x2e382b[_0x45ea('0x4d')],qs[_0x45ea('0x4f')](_0x6283a3[_0x45ea('0x49')][_0x45ea('0x4f')]));_0x4e8f21[_0x45ea('0x4e')]=_0x4e8f21['attributes'][_0x45ea('0x61')]?_0x4e8f21[_0x45ea('0x4e')]:_0x2e382b[_0x45ea('0x4d')];_0x4e8f21[_0x45ea('0x52')]=qs[_0x45ea('0x53')](_0x6283a3[_0x45ea('0x49')][_0x45ea('0x53')]);_0x4e8f21[_0x45ea('0x54')]=qs[_0x45ea('0x4b')](_[_0x45ea('0x9d')](_0x6283a3[_0x45ea('0x49')],_0x2e382b[_0x45ea('0x4b')]));if(_0x6283a3['query'][_0x45ea('0x6e')]){_0x4e8f21[_0x45ea('0x54')]=_[_0x45ea('0x55')](_0x4e8f21[_0x45ea('0x54')],{'$or':_[_0x45ea('0x46')](_0x4e8f21['attributes'],function(_0x164a9c){var _0xd7e379={};_0xd7e379[_0x164a9c]={'$like':'%'+_0x6283a3['query'][_0x45ea('0x6e')]+'%'};return _0xd7e379;})});}_0x4e8f21=_[_0x45ea('0x55')]({},_0x4e8f21,_0x6283a3[_0x45ea('0x58')]);return _0x3a4c3c[_0x45ea('0x9c')](_0x4e8f21);}})[_0x45ea('0x25')](function(_0x483d84){if(_0x483d84){_0x205654=_0x483d84['length'];if(!_0x6283a3[_0x45ea('0x49')][_0x45ea('0x50')]('nolimit')){_0x4e8f21[_0x45ea('0x21')]=qs[_0x45ea('0x21')](_0x6283a3['query']['limit']);_0x4e8f21['offset']=qs[_0x45ea('0x20')](_0x6283a3[_0x45ea('0x49')][_0x45ea('0x20')]);}return _0x3a4c3c['getApplications'](_0x4e8f21);}})[_0x45ea('0x25')](function(_0x4c2340){if(_0x4c2340){return _0x4c2340?{'count':_0x205654,'rows':_0x4c2340}:null;}})['then'](respondWithResult(_0x4e6f85,null))['catch'](handleError(_0x4e6f85,null));};exports[_0x45ea('0x9e')]=function(_0x5e808c,_0x4e2469){var _0x35e5d0={'raw':!![],'where':{}};var _0x395d47={};var _0x24f474={'count':0x0,'rows':[]};return db[_0x45ea('0x59')][_0x45ea('0x74')]({'where':{'id':_0x5e808c[_0x45ea('0x66')]['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x4e2469,null))['then'](function(_0xe5b667){if(_0xe5b667){_0x395d47[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db['MailMessage'][_0x45ea('0x60')]);_0x395d47[_0x45ea('0x49')]=_[_0x45ea('0x4a')](_0x5e808c['query']);_0x395d47[_0x45ea('0x4b')]=_['intersection'](_0x395d47[_0x45ea('0x4d')],_0x395d47['query']);_0x35e5d0['attributes']=_[_0x45ea('0x4c')](_0x395d47[_0x45ea('0x4d')],qs[_0x45ea('0x4f')](_0x5e808c['query'][_0x45ea('0x4f')]));_0x35e5d0['attributes']=_0x35e5d0[_0x45ea('0x4e')][_0x45ea('0x61')]?_0x35e5d0[_0x45ea('0x4e')]:_0x395d47[_0x45ea('0x4d')];if(!_0x5e808c['query'][_0x45ea('0x50')](_0x45ea('0x51'))){_0x35e5d0[_0x45ea('0x21')]=qs[_0x45ea('0x21')](_0x5e808c[_0x45ea('0x49')][_0x45ea('0x21')]);_0x35e5d0[_0x45ea('0x20')]=qs['offset'](_0x5e808c['query'][_0x45ea('0x20')]);}_0x35e5d0[_0x45ea('0x52')]=qs['sort'](_0x5e808c[_0x45ea('0x49')][_0x45ea('0x53')]);_0x35e5d0[_0x45ea('0x54')]=qs[_0x45ea('0x4b')](_['pick'](_0x5e808c[_0x45ea('0x49')],_0x395d47[_0x45ea('0x4b')]));_0x35e5d0[_0x45ea('0x54')]['MailAccountId']=_0xe5b667['id'];if(_0x5e808c[_0x45ea('0x49')][_0x45ea('0x6e')]){_0x35e5d0[_0x45ea('0x54')]=_[_0x45ea('0x55')](_0x35e5d0[_0x45ea('0x54')],{'$or':_[_0x45ea('0x46')](_0x35e5d0['attributes'],function(_0x20bacf){var _0x1b4201={};_0x1b4201[_0x20bacf]={'$like':'%'+_0x5e808c[_0x45ea('0x49')][_0x45ea('0x6e')]+'%'};return _0x1b4201;})});}if(_0x5e808c['query'][_0x45ea('0x9f')]){var _0x4f9406=_0x5e808c[_0x45ea('0x49')][_0x45ea('0x9f')][_0x45ea('0xa0')](',');var _0x2f1a1f={};_0x2f1a1f[_0x4f9406[0x0]]={'$gte':moment(_0x4f9406[0x1])[_0x45ea('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x35e5d0[_0x45ea('0x54')]=_['merge'](_0x35e5d0[_0x45ea('0x54')],_0x2f1a1f);}_0x35e5d0=_[_0x45ea('0x55')]({},_0x35e5d0,_0x5e808c[_0x45ea('0x58')]);return db[_0x45ea('0xa2')]['count']({'where':_0x35e5d0[_0x45ea('0x54')]})['then'](function(_0x2980fd){_0x24f474[_0x45ea('0x1f')]=_0x2980fd;if(_0x5e808c['query']['includeAll']){_0x35e5d0[_0x45ea('0x5b')]=[{'all':!![]}];}return db[_0x45ea('0xa2')][_0x45ea('0x6f')](_0x35e5d0);})[_0x45ea('0x25')](function(_0x514e26){if(_0x5e808c['query'][_0x45ea('0xa3')]===_0x45ea('0xa4')){for(var _0x30b3dd=0x0;_0x30b3dd<_0x514e26[_0x45ea('0x61')];_0x30b3dd++){_0x514e26[_0x30b3dd][_0x45ea('0x63')]=juice(_0x514e26[_0x30b3dd][_0x45ea('0x63')]);}}_0x24f474[_0x45ea('0x5c')]=_0x514e26;return _0x24f474;});}})['then'](respondWithFilteredResult(_0x4e2469,_0x35e5d0))[_0x45ea('0x1a')](handleError(_0x4e2469,null));};exports[_0x45ea('0x2a')]=function(_0x5c84c1,_0x2f5fc0){var _0x277e47,_0x531a96={},_0x43a752;if(_0x5c84c1[_0x45ea('0x63')]['to']){_0x43a752=_0x5c84c1['body']['to'][_0x45ea('0xa0')](',')[0x0];}return db[_0x45ea('0x59')]['find']({'where':{'id':_0x5c84c1[_0x45ea('0x66')]['id']},'include':[{'model':db[_0x45ea('0xa5')],'as':'List','include':[{'model':db[_0x45ea('0xa6')],'as':_0x45ea('0xa7'),'where':{'email':_0x43a752},'limit':0x1,'order':[[_0x45ea('0xa8'),_0x45ea('0xa9')]]}]},{'model':db[_0x45ea('0x5e')],'as':_0x45ea('0x42'),'raw':!![],'include':[{'model':db[_0x45ea('0xaa')],'as':_0x45ea('0xaa'),'raw':!![]}]}]})[_0x45ea('0x25')](handleEntityNotFound(_0x2f5fc0,null))['then'](function(_0x3ed6c7){if(!_0x3ed6c7)return;_0x277e47=_0x3ed6c7;if(!_0x3ed6c7[_0x45ea('0x42')])throw new Error(_0x45ea('0xab'));if(_[_0x45ea('0x78')](_0x5c84c1[_0x45ea('0x63')]['from'])){_0x5c84c1[_0x45ea('0x63')]['from']=util[_0x45ea('0xa1')](_0x45ea('0xac'),_0x3ed6c7['name'],_0x3ed6c7[_0x45ea('0x76')]||_0x3ed6c7[_0x45ea('0x42')][_0x45ea('0x36')]);}if(_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xad')]&&_0x5c84c1['body'][_0x45ea('0xad')][_0x45ea('0x61')]){for(var _0x1fcf97=0x0;_0x1fcf97<_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xad')]['length'];_0x1fcf97+=0x1){_0x5c84c1[_0x45ea('0x63')]['attachments'][_0x1fcf97]={'filename':_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xad')][_0x1fcf97]['name'],'path':path[_0x45ea('0xae')](config[_0x45ea('0xaf')],_0x45ea('0xb0'),_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xad')][_0x1fcf97]['basename'])};}}var _0x5a5a43=_0x3ed6c7[_0x45ea('0xb1')]();return respondWithRpcPromise(_0x45ea('0xb2'),_0x45ea('0xb3'),{'account':_0x5a5a43,'message':_0x5c84c1[_0x45ea('0x63')]});})[_0x45ea('0x25')](function(_0x3c8e7f){if(!_0x3c8e7f)return;_0x531a96=_0x3c8e7f;if(!_0x277e47[_0x45ea('0xb4')])throw new Error(_0x45ea('0xb5'));if(_0x277e47['List'][_0x45ea('0xa7')][_0x45ea('0x61')])return _0x277e47['List'][_0x45ea('0xa7')][0x0];return db[_0x45ea('0xa6')][_0x45ea('0x6c')](_['defaults'](_0x5c84c1[_0x45ea('0x63')],{'firstName':_0x5c84c1['body']['to'],'email':_0x5c84c1[_0x45ea('0x63')]['to'],'phone':_0x5c84c1[_0x45ea('0x63')]['to'],'ListId':_0x277e47[_0x45ea('0x77')]}));})[_0x45ea('0x25')](function(_0x378920){if(!_0x378920)return;var _0xe4f6f0={'UserId':_0x5c84c1[_0x45ea('0x36')]['id'],'ContactId':_0x378920['id'],'MailAccountId':_0x277e47['id'],'inReplyTo':_0x531a96['messageId'],'to':_0x5c84c1[_0x45ea('0x63')]['from'],'cc':_0x5c84c1[_0x45ea('0x63')]['cc'],'subject':_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xb6')],'attach':_0x5c84c1[_0x45ea('0x63')]['attach'],'firstMsgDirection':_0x45ea('0xb7'),'lastMsgAt':moment()[_0x45ea('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x45ea('0xb7'),'Messages':[_[_0x45ea('0x55')](_0x5c84c1[_0x45ea('0x63')],{'messageId':_0x531a96[_0x45ea('0xb8')],'sentAt':moment()[_0x45ea('0xa1')](_0x45ea('0xb9')),'read':!![],'MailAccountId':_0x277e47['id'],'UserId':_0x5c84c1[_0x45ea('0x36')]['id'],'ContactId':_0x378920['id']})]};if(_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xba')]){_0xe4f6f0=_['merge'](_0xe4f6f0,_0x5c84c1[_0x45ea('0x63')][_0x45ea('0xba')]);}return db[_0x45ea('0x8a')][_0x45ea('0x6c')](_0xe4f6f0,{'include':[{'model':db[_0x45ea('0xa2')],'as':_0x45ea('0xbb')}]});})[_0x45ea('0x25')](respondWithResult(_0x2f5fc0,null))['catch'](handleError(_0x2f5fc0,null));};exports[_0x45ea('0xbc')]=function(_0x59130f,_0x1ccd96){return db['MailAccount'][_0x45ea('0x62')]({'where':{'id':_0x59130f[_0x45ea('0x66')]['id']},'include':[{'model':db[_0x45ea('0x5e')],'as':_0x45ea('0x42'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x45ea('0xaa'),'raw':!![]}]}]})[_0x45ea('0x25')](handleEntityNotFound(_0x1ccd96,null))['then'](function(_0x2a293d){if(!_0x2a293d[_0x45ea('0x42')])return;var _0x139f83=_0x2a293d['getSmtpOptions']();return respondWithRpcPromise(_0x45ea('0xbd'),_0x45ea('0xbc'),{'account':_0x139f83});})[_0x45ea('0x25')](respondWithResult(_0x1ccd96,null))['catch'](handleError(_0x1ccd96,null));};exports[_0x45ea('0x26')]=function(_0x59fba6,_0x2d7d74){return db[_0x45ea('0x59')][_0x45ea('0x62')]({'where':{'id':_0x59fba6[_0x45ea('0x66')]['id']}})['then'](handleEntityNotFound(_0x2d7d74,null))[_0x45ea('0x25')](function(_0x5d4cda){if(_0x5d4cda&&_0x5d4cda['service']){throw new db[(_0x45ea('0xbe'))][(_0x45ea('0xbf'))](_0x45ea('0xc0'));}return _0x5d4cda;})['then'](removeEntity(_0x2d7d74,null))[_0x45ea('0x1a')](handleError(_0x2d7d74,null));};exports['addAgents']=function(_0x3f5e67,_0x49cb14){return db[_0x45ea('0x59')]['find']({'where':{'id':_0x3f5e67['params']['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x49cb14,null))[_0x45ea('0x25')](function(_0xc3b0a2){if(_0xc3b0a2){return _0xc3b0a2[_0x45ea('0xc1')](_0x3f5e67[_0x45ea('0x63')][_0x45ea('0x71')],_[_0x45ea('0xc2')](_0x3f5e67[_0x45ea('0x63')],[_0x45ea('0x71'),'id'])||{})['spread'](function(_0x183c38){for(var _0x2e1cdf=0x0;_0x2e1cdf<_0x3f5e67[_0x45ea('0x63')][_0x45ea('0x71')]['length'];_0x2e1cdf+=0x1){socket[_0x45ea('0xc3')](_0x45ea('0xc4'),{'UserId':Number(_0x3f5e67[_0x45ea('0x63')][_0x45ea('0x71')][_0x2e1cdf]),'MailAccountId':Number(_0x3f5e67[_0x45ea('0x66')]['id'])});}return _0x183c38;});}})[_0x45ea('0x25')](respondWithResult(_0x49cb14,null))[_0x45ea('0x1a')](handleError(_0x49cb14,null));};exports[_0x45ea('0xc5')]=function(_0x212286,_0x27ca7a){return db[_0x45ea('0x59')]['find']({'where':{'id':_0x212286['params']['id']}})[_0x45ea('0x25')](handleEntityNotFound(_0x27ca7a,null))[_0x45ea('0x25')](function(_0x283f8f){if(_0x283f8f){return _0x283f8f['removeAgents'](_0x212286['query']['ids'])[_0x45ea('0x25')](function(){if(_['isArray'](_0x212286['query']['ids'])){for(var _0x537a10=0x0;_0x537a10<_0x212286[_0x45ea('0x49')][_0x45ea('0x71')][_0x45ea('0x61')];_0x537a10+=0x1){socket[_0x45ea('0xc3')]('userMailAccount:remove',{'UserId':Number(_0x212286[_0x45ea('0x49')]['ids'][_0x537a10]),'MailAccountId':Number(_0x212286[_0x45ea('0x66')]['id'])});}}else{socket[_0x45ea('0xc3')](_0x45ea('0xc6'),{'UserId':Number(_0x212286[_0x45ea('0x49')]['ids']),'MailAccountId':Number(_0x212286[_0x45ea('0x66')]['id'])});}});}})[_0x45ea('0x25')](respondWithStatusCode(_0x27ca7a,null))[_0x45ea('0x1a')](handleError(_0x27ca7a,null));};exports['getAgents']=function(_0x39c55b,_0x50ffcb){var _0x4faa09={};var _0x507e7c={};var _0x122f77;var _0x3a93e8;return db['MailAccount'][_0x45ea('0x74')]({'where':{'id':_0x39c55b[_0x45ea('0x66')]['id']}})['then'](handleEntityNotFound(_0x50ffcb,null))['then'](function(_0x270edc){if(_0x270edc){_0x122f77=_0x270edc;_0x507e7c[_0x45ea('0x4d')]=_[_0x45ea('0x4a')](db['User'][_0x45ea('0x60')]);_0x507e7c['query']=_[_0x45ea('0x4a')](_0x39c55b[_0x45ea('0x49')]);_0x507e7c[_0x45ea('0x4b')]=_[_0x45ea('0x4c')](_0x507e7c['model'],_0x507e7c[_0x45ea('0x49')]);_0x4faa09['attributes']=_[_0x45ea('0x4c')](_0x507e7c['model'],qs[_0x45ea('0x4f')](_0x39c55b[_0x45ea('0x49')][_0x45ea('0x4f')]));_0x4faa09['attributes']=_0x4faa09[_0x45ea('0x4e')][_0x45ea('0x61')]?_0x4faa09[_0x45ea('0x4e')]:_0x507e7c[_0x45ea('0x4d')];_0x4faa09[_0x45ea('0x52')]=qs[_0x45ea('0x53')](_0x39c55b[_0x45ea('0x49')][_0x45ea('0x53')]);_0x4faa09[_0x45ea('0x54')]=qs[_0x45ea('0x4b')](_[_0x45ea('0x9d')](_0x39c55b['query'],_0x507e7c[_0x45ea('0x4b')]));if(_0x39c55b[_0x45ea('0x49')][_0x45ea('0x6e')]){_0x4faa09['where']=_['merge'](_0x4faa09[_0x45ea('0x54')],{'$or':_[_0x45ea('0x46')](_0x4faa09[_0x45ea('0x4e')],function(_0x327766){var _0x351c4a={};_0x351c4a[_0x327766]={'$like':'%'+_0x39c55b[_0x45ea('0x49')]['filter']+'%'};return _0x351c4a;})});}_0x4faa09=_[_0x45ea('0x55')]({},_0x4faa09,_0x39c55b[_0x45ea('0x58')]);return _0x122f77[_0x45ea('0xc7')](_0x4faa09);}})['then'](function(_0x15a4a3){if(_0x15a4a3){_0x3a93e8=_0x15a4a3['length'];if(!_0x39c55b[_0x45ea('0x49')][_0x45ea('0x50')](_0x45ea('0x51'))){_0x4faa09[_0x45ea('0x21')]=qs[_0x45ea('0x21')](_0x39c55b[_0x45ea('0x49')][_0x45ea('0x21')]);_0x4faa09[_0x45ea('0x20')]=qs[_0x45ea('0x20')](_0x39c55b[_0x45ea('0x49')]['offset']);}return _0x122f77[_0x45ea('0xc7')](_0x4faa09);}})[_0x45ea('0x25')](function(_0x1bf252){if(_0x1bf252){return _0x1bf252?{'count':_0x3a93e8,'rows':_0x1bf252}:null;}})[_0x45ea('0x25')](respondWithResult(_0x50ffcb,null))[_0x45ea('0x1a')](handleError(_0x50ffcb,null));}; \ No newline at end of file +var _0x5e73=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','getInteractions','CmContact','Contact','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','send','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','CmList','Contacts','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','SendMail','sendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','verifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','util','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','UserProfileResource','sendStatus','name','gmail','imap.gmail.com','yahoo','outlook365','outlook.office365.com','smtp.gmail.com','hotmail','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerOut','map','MailAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','MailServerIn','mandatoryDispositionPause','find','body','custom','provider','secure','Pause','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailAccounts'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x5e73,0x1bc));var _0x35e7=function(_0x453b7b,_0x25f8af){_0x453b7b=_0x453b7b-0x0;var _0x410903=_0x5e73[_0x453b7b];return _0x410903;};'use strict';var moment=require(_0x35e7('0x0'));var BPromise=require('bluebird');var util=require(_0x35e7('0x1'));var path=require('path');var _=require(_0x35e7('0x2'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x35e7('0x3'));var logger=require(_0x35e7('0x4'))('api');var config=require(_0x35e7('0x5'));var db=require(_0x35e7('0x6'))['db'];config[_0x35e7('0x7')]=_[_0x35e7('0x8')](config['redis'],{'host':_0x35e7('0x9'),'port':0x18eb});var socket=require(_0x35e7('0xa'))(new Redis(config[_0x35e7('0x7')]));require(_0x35e7('0xb'))[_0x35e7('0xc')](socket);var jayson=require(_0x35e7('0xd'));var client=jayson['client'][_0x35e7('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x3cff55,_0x13daf4,_0x1f8650,_0x32b0c1){return new BPromise(function(_0xf0f996,_0x3e417c){var _0x1af621=_0x32b0c1||client;return _0x1af621['request'](_0x3cff55,_0x1f8650)[_0x35e7('0xf')](function(_0x10a365){logger[_0x35e7('0x10')](_0x35e7('0x11'),_0x13daf4,_0x35e7('0x12'));logger[_0x35e7('0x13')](_0x35e7('0x14'),_0x13daf4,_0x35e7('0x12'),JSON['stringify'](_0x10a365));if(_0x10a365[_0x35e7('0x15')]){if(_0x10a365[_0x35e7('0x15')][_0x35e7('0x16')]===0x1f4){logger[_0x35e7('0x15')](_0x35e7('0x11'),_0x13daf4,_0x10a365[_0x35e7('0x15')]['message']);return _0x3e417c(_0x10a365[_0x35e7('0x15')]['message']);}logger['error']('MailAccount,\x20%s,\x20%s',_0x13daf4,_0x10a365[_0x35e7('0x15')]['message']);return _0xf0f996(_0x10a365[_0x35e7('0x15')]['message']);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x13daf4,_0x35e7('0x12'));_0xf0f996(_0x10a365[_0x35e7('0x17')]['message']);}})[_0x35e7('0x18')](function(_0x3dedc7){logger[_0x35e7('0x15')](_0x35e7('0x11'),_0x13daf4,_0x3dedc7);_0x3e417c(_0x3dedc7);});});}function respondWithStatusCode(_0x9c2bf0,_0x1e493c){_0x1e493c=_0x1e493c||0xcc;return function(_0x3da611){if(_0x3da611){return _0x9c2bf0['sendStatus'](_0x1e493c);}return _0x9c2bf0[_0x35e7('0x19')](_0x1e493c)[_0x35e7('0x1a')]();};}function respondWithResult(_0xdb67ff,_0xb0c95c){_0xb0c95c=_0xb0c95c||0xc8;return function(_0x5d4554){if(_0x5d4554){return _0xdb67ff[_0x35e7('0x19')](_0xb0c95c)[_0x35e7('0x1b')](_0x5d4554);}};}function respondWithFilteredResult(_0x39613c,_0x1cf890){return function(_0x491522){if(_0x491522){var _0x63f2d3=typeof _0x1cf890[_0x35e7('0x1c')]==='undefined'&&typeof _0x1cf890[_0x35e7('0x1d')]===_0x35e7('0x1e');var _0xb9192=_0x491522['count'];var _0x19dbbf=_0x63f2d3?0x0:_0x1cf890['offset'];var _0x5c6a68=_0x63f2d3?_0x491522[_0x35e7('0x1f')]:_0x1cf890[_0x35e7('0x1c')]+_0x1cf890['limit'];var _0x13e39e;if(_0x5c6a68>=_0xb9192){_0x5c6a68=_0xb9192;_0x13e39e=0xc8;}else{_0x13e39e=0xce;}_0x39613c[_0x35e7('0x19')](_0x13e39e);return _0x39613c[_0x35e7('0x20')](_0x35e7('0x21'),_0x19dbbf+'-'+_0x5c6a68+'/'+_0xb9192)[_0x35e7('0x1b')](_0x491522);}return null;};}function saveUpdates(_0x4ad6e5){return function(_0x333771){if(_0x333771){return _0x333771[_0x35e7('0x22')](_0x4ad6e5)['then'](function(_0x4f4a29){return _0x4f4a29;});}return null;};}function removeEntity(_0x43ef8f){return function(_0x174bdb){if(_0x174bdb){return _0x174bdb[_0x35e7('0x23')]()[_0x35e7('0xf')](function(){var _0x517720=_0x174bdb[_0x35e7('0x24')]({'plain':!![]});var _0x5ee8e0='MailAccounts';return db[_0x35e7('0x25')][_0x35e7('0x23')]({'where':{'type':_0x5ee8e0,'resourceId':_0x517720['id']}})[_0x35e7('0xf')](function(){return _0x174bdb;});})[_0x35e7('0xf')](function(){_0x43ef8f['status'](0xcc)[_0x35e7('0x1a')]();});}};}function handleEntityNotFound(_0x1332d1){return function(_0x388b6c){if(!_0x388b6c){_0x1332d1[_0x35e7('0x26')](0x194);}return _0x388b6c;};}function handleError(_0x2bf5df,_0x188ec9){_0x188ec9=_0x188ec9||0x1f4;return function(_0x356117){logger[_0x35e7('0x15')](_0x356117['stack']);if(_0x356117[_0x35e7('0x27')]){delete _0x356117[_0x35e7('0x27')];}_0x2bf5df['status'](_0x188ec9)['send'](_0x356117);};}function getImapHost(_0xf23e66){switch(_0xf23e66){case _0x35e7('0x28'):return _0x35e7('0x29');case _0x35e7('0x2a'):return'imap.mail.yahoo.com';case'hotmail':return'imap-mail.outlook.com';case _0x35e7('0x2b'):return _0x35e7('0x2c');}throw new Error('Unknown\x20email\x20service\x20provider',_0xf23e66);}function getSmtpHost(_0x1daa20){switch(_0x1daa20){case _0x35e7('0x28'):return _0x35e7('0x2d');case'yahoo':return'smtp.mail.yahoo.com';case _0x35e7('0x2e'):return'smtp-mail.outlook.com';case _0x35e7('0x2b'):return _0x35e7('0x2f');}throw new Error(_0x35e7('0x30'),_0x1daa20);}function getAuthenticationOptions(_0x238083,_0x5da6fe){var _0x1bb5b9={};var _0x168fc0={};if(_0x238083){_0x1bb5b9[_0x35e7('0x31')]=_0x168fc0['user']=_0x5da6fe[_0x35e7('0x32')];_0x1bb5b9[_0x35e7('0x33')]=_0x168fc0[_0x35e7('0x34')]=_0x5da6fe['password'];if(_0x5da6fe[_0x35e7('0x35')]){_0x1bb5b9['modernAuthentication']=_0x168fc0[_0x35e7('0x35')]=!![];_0x1bb5b9[_0x35e7('0x36')]=_0x168fc0[_0x35e7('0x36')]=_0x5da6fe[_0x35e7('0x36')];_0x1bb5b9[_0x35e7('0x33')]=_0x168fc0['pass']=null;}else{_0x1bb5b9[_0x35e7('0x36')]=_0x168fc0[_0x35e7('0x36')]=null;}_0x1bb5b9[_0x35e7('0x37')]=getImapHost(_0x238083);_0x1bb5b9[_0x35e7('0x38')]=0x3e1;_0x168fc0[_0x35e7('0x37')]=getSmtpHost(_0x238083);_0x168fc0[_0x35e7('0x38')]=0x24b;_0x168fc0['secure']=![];_0x1bb5b9[_0x35e7('0x39')]=_0x168fc0['service']=null;}else{if(_0x5da6fe['authentication']){_0x1bb5b9[_0x35e7('0x31')]=_0x168fc0[_0x35e7('0x31')]=_0x5da6fe[_0x35e7('0x32')];_0x1bb5b9[_0x35e7('0x33')]=_0x168fc0[_0x35e7('0x34')]=_0x5da6fe[_0x35e7('0x33')];}else{_0x1bb5b9['authentication']=_0x168fc0[_0x35e7('0x3a')]=![];_0x1bb5b9['user']=_0x168fc0['user']=null;_0x1bb5b9[_0x35e7('0x33')]=_0x168fc0['pass']=null;}_0x1bb5b9[_0x35e7('0x37')]=_0x5da6fe[_0x35e7('0x3b')][_0x35e7('0x37')];_0x1bb5b9[_0x35e7('0x38')]=_0x5da6fe[_0x35e7('0x3b')][_0x35e7('0x38')];_0x168fc0[_0x35e7('0x37')]=_0x5da6fe[_0x35e7('0x3c')][_0x35e7('0x37')];_0x168fc0['port']=_0x5da6fe[_0x35e7('0x3c')]['port'];}return{'Imap':_0x1bb5b9,'Smtp':_0x168fc0};}exports[_0x35e7('0x3d')]=function(_0x4a6572,_0x5ab814){var _0xddf082={'include':[{'model':db['MailServerIn'],'as':_0x35e7('0x3b')},{'model':db[_0x35e7('0x3e')],'as':_0x35e7('0x3c')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2e6799={},_0x90d5ec={'count':0x0,'rows':[]};var _0x4bcc56=_[_0x35e7('0x3f')](db[_0x35e7('0x40')][_0x35e7('0x41')],function(_0xc856c2){return{'name':_0xc856c2[_0x35e7('0x42')],'type':_0xc856c2[_0x35e7('0x43')][_0x35e7('0x44')]};});_0x2e6799['model']=_[_0x35e7('0x3f')](_0x4bcc56,_0x35e7('0x27'));_0x2e6799[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x4a6572['query']);_0x2e6799[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x2e6799['model'],_0x2e6799[_0x35e7('0x45')]);_0xddf082[_0x35e7('0x49')]=_['intersection'](_0x2e6799[_0x35e7('0x4a')],qs[_0x35e7('0x4b')](_0x4a6572[_0x35e7('0x45')][_0x35e7('0x4b')]));_0xddf082[_0x35e7('0x49')]=_0xddf082[_0x35e7('0x49')][_0x35e7('0x4c')]?_0xddf082[_0x35e7('0x49')]:_0x2e6799[_0x35e7('0x4a')];if(!_0x4a6572[_0x35e7('0x45')][_0x35e7('0x4d')](_0x35e7('0x4e'))){_0xddf082[_0x35e7('0x1d')]=qs[_0x35e7('0x1d')](_0x4a6572['query'][_0x35e7('0x1d')]);_0xddf082[_0x35e7('0x1c')]=qs[_0x35e7('0x1c')](_0x4a6572[_0x35e7('0x45')]['offset']);}_0xddf082[_0x35e7('0x4f')]=qs[_0x35e7('0x50')](_0x4a6572[_0x35e7('0x45')][_0x35e7('0x50')]);_0xddf082[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x4a6572[_0x35e7('0x45')],_0x2e6799[_0x35e7('0x47')]),_0x4bcc56);if(_0x4a6572[_0x35e7('0x45')][_0x35e7('0x53')]){_0xddf082['where']=_[_0x35e7('0x54')](_0xddf082[_0x35e7('0x51')],{'$or':_[_0x35e7('0x3f')](_0x4bcc56,function(_0x46c4ff){if(_0x46c4ff[_0x35e7('0x43')]!=='VIRTUAL'){var _0x3921ff={};_0x3921ff[_0x46c4ff[_0x35e7('0x27')]]={'$like':'%'+_0x4a6572[_0x35e7('0x45')][_0x35e7('0x53')]+'%'};return _0x3921ff;}})});}_0xddf082=_[_0x35e7('0x54')]({},_0xddf082,_0x4a6572[_0x35e7('0x55')]);var _0x435912={'where':_0xddf082[_0x35e7('0x51')]};return db[_0x35e7('0x40')][_0x35e7('0x1f')](_0x435912)[_0x35e7('0xf')](function(_0x27db24){_0x90d5ec['count']=_0x27db24;if(_0x4a6572[_0x35e7('0x45')][_0x35e7('0x56')]){_0xddf082[_0x35e7('0x57')]=[{'all':!![]}];}return db['MailAccount'][_0x35e7('0x58')](_0xddf082);})[_0x35e7('0xf')](function(_0x29c425){_0x90d5ec['rows']=_0x29c425;return _0x90d5ec;})['then'](respondWithFilteredResult(_0x5ab814,_0xddf082))[_0x35e7('0x18')](handleError(_0x5ab814,null));};exports['show']=function(_0x55ade9,_0x1cdc1f){var _0x554ba6={'raw':![],'where':{'id':_0x55ade9[_0x35e7('0x59')]['id']},'include':[{'model':db[_0x35e7('0x5a')],'as':_0x35e7('0x3b')},{'model':db[_0x35e7('0x3e')],'as':_0x35e7('0x3c')},{'model':db['Pause'],'as':_0x35e7('0x5b')}]},_0x4cb21d={};_0x4cb21d[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db['MailAccount'][_0x35e7('0x41')]);_0x4cb21d[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x55ade9[_0x35e7('0x45')]);_0x4cb21d['filters']=_['intersection'](_0x4cb21d[_0x35e7('0x4a')],_0x4cb21d['query']);_0x554ba6[_0x35e7('0x49')]=_[_0x35e7('0x48')](_0x4cb21d[_0x35e7('0x4a')],qs[_0x35e7('0x4b')](_0x55ade9[_0x35e7('0x45')][_0x35e7('0x4b')]));_0x554ba6[_0x35e7('0x49')]=_0x554ba6[_0x35e7('0x49')][_0x35e7('0x4c')]?_0x554ba6[_0x35e7('0x49')]:_0x4cb21d[_0x35e7('0x4a')];if(_0x55ade9[_0x35e7('0x45')][_0x35e7('0x56')]){_0x554ba6[_0x35e7('0x57')]=[{'all':!![]}];}_0x554ba6=_[_0x35e7('0x54')]({},_0x554ba6,_0x55ade9[_0x35e7('0x55')]);return db[_0x35e7('0x40')][_0x35e7('0x5c')](_0x554ba6)['then'](handleEntityNotFound(_0x1cdc1f,null))['then'](respondWithResult(_0x1cdc1f,null))[_0x35e7('0x18')](handleError(_0x1cdc1f,null));};exports['update']=function(_0x48eda5,_0x3b003d){if(_0x48eda5['body']['id']){delete _0x48eda5['body']['id'];}var _0x16384c=_0x48eda5[_0x35e7('0x5d')]['provider']===_0x35e7('0x5e')?null:_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x5f')];var _0x1f0197=_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3b')]||{};var _0x501eb0=_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3c')]||{};if(_0x16384c){_0x1f0197[_0x35e7('0x37')]=getImapHost(_0x16384c);_0x1f0197[_0x35e7('0x38')]=0x3e1;_0x501eb0[_0x35e7('0x37')]=getSmtpHost(_0x16384c);_0x501eb0['port']=0x24b;_0x501eb0[_0x35e7('0x60')]=![];}if(_0x501eb0[_0x35e7('0x35')]){_0x501eb0['secure']=![];}else{_0x501eb0['CloudProviderId']=null;}if(!_0x1f0197['modernAuthentication'])_0x1f0197[_0x35e7('0x36')]=null;_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3b')]=_0x1f0197;_0x48eda5[_0x35e7('0x5d')]['Smtp']=_0x501eb0;return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x48eda5['params']['id']},'include':[{'model':db[_0x35e7('0x5a')],'as':_0x35e7('0x3b')},{'model':db[_0x35e7('0x3e')],'as':'Smtp'},{'model':db[_0x35e7('0x61')],'as':'mandatoryDispositionPause'}]})[_0x35e7('0xf')](handleEntityNotFound(_0x3b003d,null))[_0x35e7('0xf')](function(_0x284944){if(!_0x284944)throw new Error(_0x35e7('0x62'));if(_0x284944['service'])delete _0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3b')];return _0x284944;})[_0x35e7('0xf')](saveUpdates(_0x48eda5['body'],null))[_0x35e7('0xf')](function(_0x3364b2){if(!_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3b')])return _0x3364b2;return db[_0x35e7('0x5a')][_0x35e7('0x22')](_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3b')],{'where':{'MailAccountId':_0x3364b2['id']}})[_0x35e7('0xf')](function(){return _0x3364b2;});})[_0x35e7('0xf')](function(_0xa85284){if(!_0x48eda5['body'][_0x35e7('0x3c')])return _0xa85284;return db[_0x35e7('0x3e')]['update'](_0x48eda5[_0x35e7('0x5d')][_0x35e7('0x3c')],{'where':{'MailAccountId':_0xa85284['id']}})[_0x35e7('0xf')](function(){return _0xa85284;});})[_0x35e7('0xf')](respondWithResult(_0x3b003d,null))['catch'](handleError(_0x3b003d,null));};exports['describe']=function(_0x503092,_0xa175b1){return db[_0x35e7('0x40')][_0x35e7('0x63')]()['then'](respondWithResult(_0xa175b1,null))[_0x35e7('0x18')](handleError(_0xa175b1,null));};exports['addDisposition']=function(_0x58ac61,_0x350fc0){if(_0x58ac61[_0x35e7('0x5d')]['id']){delete _0x58ac61[_0x35e7('0x5d')]['id'];}return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x58ac61['params']['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x350fc0,null))['then'](function(_0x42b1f4){if(_0x42b1f4){_0x58ac61[_0x35e7('0x5d')][_0x35e7('0x64')]=_0x42b1f4['id'];return db[_0x35e7('0x65')][_0x35e7('0x66')](_0x58ac61[_0x35e7('0x5d')]);}})[_0x35e7('0xf')](respondWithResult(_0x350fc0,null))['catch'](handleError(_0x350fc0,null));};exports[_0x35e7('0x67')]=function(_0x12eb4f,_0x1463a7){var _0x1de238={'raw':![],'where':{}};var _0x473fa3={};var _0x5b814e={'count':0x0,'rows':[]};return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x12eb4f[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x1463a7,null))[_0x35e7('0xf')](function(_0x4a699f){if(_0x4a699f){_0x473fa3[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db[_0x35e7('0x65')]['rawAttributes']);_0x473fa3[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x12eb4f[_0x35e7('0x45')]);_0x473fa3[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x473fa3[_0x35e7('0x4a')],_0x473fa3[_0x35e7('0x45')]);_0x1de238[_0x35e7('0x49')]=_[_0x35e7('0x48')](_0x473fa3[_0x35e7('0x4a')],qs[_0x35e7('0x4b')](_0x12eb4f[_0x35e7('0x45')][_0x35e7('0x4b')]));_0x1de238[_0x35e7('0x49')]=_0x1de238['attributes'][_0x35e7('0x4c')]?_0x1de238['attributes']:_0x473fa3['model'];if(!_0x12eb4f[_0x35e7('0x45')]['hasOwnProperty'](_0x35e7('0x4e'))){_0x1de238[_0x35e7('0x1d')]=qs[_0x35e7('0x1d')](_0x12eb4f[_0x35e7('0x45')]['limit']);_0x1de238[_0x35e7('0x1c')]=qs['offset'](_0x12eb4f[_0x35e7('0x45')]['offset']);}_0x1de238[_0x35e7('0x4f')]=qs[_0x35e7('0x50')](_0x12eb4f[_0x35e7('0x45')]['sort']);_0x1de238['where']=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x12eb4f[_0x35e7('0x45')],_0x473fa3['filters']));_0x1de238['where']['MailAccountId']=_0x4a699f['id'];if(_0x12eb4f[_0x35e7('0x45')][_0x35e7('0x53')]){_0x1de238[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x1de238[_0x35e7('0x51')],{'$or':_[_0x35e7('0x3f')](_0x1de238[_0x35e7('0x49')],function(_0x530cc2){var _0x2f82fd={};_0x2f82fd[_0x530cc2]={'$like':'%'+_0x12eb4f['query'][_0x35e7('0x53')]+'%'};return _0x2f82fd;})});}_0x1de238=_[_0x35e7('0x54')]({},_0x1de238,_0x12eb4f[_0x35e7('0x55')]);return db[_0x35e7('0x65')][_0x35e7('0x1f')]({'where':_0x1de238[_0x35e7('0x51')]})[_0x35e7('0xf')](function(_0x38189a){_0x5b814e[_0x35e7('0x1f')]=_0x38189a;if(_0x12eb4f['query'][_0x35e7('0x56')]){_0x1de238[_0x35e7('0x57')]=[{'all':!![]}];}return db[_0x35e7('0x65')][_0x35e7('0x58')](_0x1de238);})['then'](function(_0xb33b46){_0x5b814e[_0x35e7('0x69')]=_0xb33b46;return _0x5b814e;});}})['then'](respondWithFilteredResult(_0x1463a7,_0x1de238))[_0x35e7('0x18')](handleError(_0x1463a7,null));};exports['removeDispositions']=function(_0x58da78,_0x3ab161){return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x58da78[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x3ab161,null))['then'](function(_0x5c13cd){if(_0x5c13cd){return _0x5c13cd[_0x35e7('0x6a')](_0x58da78[_0x35e7('0x45')][_0x35e7('0x6b')]);}})['then'](respondWithStatusCode(_0x3ab161,null))[_0x35e7('0x18')](handleError(_0x3ab161,null));};exports[_0x35e7('0x6c')]=function(_0x14917b,_0x2a3119){if(_0x14917b[_0x35e7('0x5d')]['id']){delete _0x14917b['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x14917b[_0x35e7('0x59')]['id']}})['then'](handleEntityNotFound(_0x2a3119,null))[_0x35e7('0xf')](function(_0x2125a6){if(_0x2125a6){_0x14917b[_0x35e7('0x5d')]['MailAccountId']=_0x2125a6['id'];return db[_0x35e7('0x6d')][_0x35e7('0x66')](_0x14917b[_0x35e7('0x5d')]);}})[_0x35e7('0xf')](respondWithResult(_0x2a3119,null))[_0x35e7('0x18')](handleError(_0x2a3119,null));};exports[_0x35e7('0x6e')]=function(_0x5a9a06,_0x41281a){var _0x52a1e3={'raw':![],'where':{}};var _0x1fea32={};var _0x4c6a9f={'count':0x0,'rows':[]};return db[_0x35e7('0x40')]['findOne']({'where':{'id':_0x5a9a06[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x41281a,null))['then'](function(_0xa3c49f){if(_0xa3c49f){_0x1fea32['model']=_[_0x35e7('0x46')](db['CannedAnswer'][_0x35e7('0x41')]);_0x1fea32[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x5a9a06[_0x35e7('0x45')]);_0x1fea32[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x1fea32[_0x35e7('0x4a')],_0x1fea32['query']);_0x52a1e3['attributes']=_[_0x35e7('0x48')](_0x1fea32['model'],qs[_0x35e7('0x4b')](_0x5a9a06['query']['fields']));_0x52a1e3[_0x35e7('0x49')]=_0x52a1e3[_0x35e7('0x49')][_0x35e7('0x4c')]?_0x52a1e3['attributes']:_0x1fea32['model'];if(!_0x5a9a06[_0x35e7('0x45')][_0x35e7('0x4d')](_0x35e7('0x4e'))){_0x52a1e3[_0x35e7('0x1d')]=qs['limit'](_0x5a9a06['query'][_0x35e7('0x1d')]);_0x52a1e3[_0x35e7('0x1c')]=qs[_0x35e7('0x1c')](_0x5a9a06[_0x35e7('0x45')]['offset']);}_0x52a1e3[_0x35e7('0x4f')]=qs[_0x35e7('0x50')](_0x5a9a06['query'][_0x35e7('0x50')]);_0x52a1e3[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x5a9a06[_0x35e7('0x45')],_0x1fea32[_0x35e7('0x47')]));_0x52a1e3[_0x35e7('0x51')][_0x35e7('0x64')]=_0xa3c49f['id'];if(_0x5a9a06[_0x35e7('0x45')][_0x35e7('0x53')]){_0x52a1e3[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x52a1e3[_0x35e7('0x51')],{'$or':_[_0x35e7('0x3f')](_0x52a1e3[_0x35e7('0x49')],function(_0x4e034c){var _0x4ed23c={};_0x4ed23c[_0x4e034c]={'$like':'%'+_0x5a9a06['query'][_0x35e7('0x53')]+'%'};return _0x4ed23c;})});}_0x52a1e3=_[_0x35e7('0x54')]({},_0x52a1e3,_0x5a9a06[_0x35e7('0x55')]);return db[_0x35e7('0x6d')]['count']({'where':_0x52a1e3[_0x35e7('0x51')]})[_0x35e7('0xf')](function(_0xca8bf0){_0x4c6a9f[_0x35e7('0x1f')]=_0xca8bf0;if(_0x5a9a06['query']['includeAll']){_0x52a1e3[_0x35e7('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x35e7('0x58')](_0x52a1e3);})[_0x35e7('0xf')](function(_0x34779c){_0x4c6a9f[_0x35e7('0x69')]=_0x34779c;return _0x4c6a9f;});}})[_0x35e7('0xf')](respondWithFilteredResult(_0x41281a,_0x52a1e3))[_0x35e7('0x18')](handleError(_0x41281a,null));};exports[_0x35e7('0x6f')]=function(_0x2f2d51,_0xa42de8){return db['MailAccount'][_0x35e7('0x5c')]({'where':{'id':_0x2f2d51[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0xa42de8,null))[_0x35e7('0xf')](function(_0x7cf4e4){if(_0x7cf4e4){return _0x7cf4e4['removeAnswers'](_0x2f2d51['query'][_0x35e7('0x6b')]);}})[_0x35e7('0xf')](respondWithStatusCode(_0xa42de8,null))['catch'](handleError(_0xa42de8,null));};exports[_0x35e7('0x66')]=function(_0xebc468,_0x4b1136){var _0x4bdbd0={'name':_0xebc468[_0x35e7('0x5d')]['name'],'key':_0xebc468[_0x35e7('0x5d')][_0x35e7('0x44')],'provider':_0xebc468[_0x35e7('0x5d')][_0x35e7('0x5f')]==='custom'?null:_0xebc468[_0x35e7('0x5d')][_0x35e7('0x5f')],'email':_0xebc468[_0x35e7('0x5d')][_0x35e7('0x70')],'ListId':_0xebc468[_0x35e7('0x5d')][_0x35e7('0x71')],'active':!_[_0x35e7('0x72')](_0xebc468[_0x35e7('0x5d')][_0x35e7('0x73')])?_0xebc468[_0x35e7('0x5d')][_0x35e7('0x73')]:!![],'description':_0xebc468[_0x35e7('0x5d')][_0x35e7('0x74')]||null};var _0x225184=getAuthenticationOptions(_0x4bdbd0[_0x35e7('0x5f')],_0xebc468[_0x35e7('0x5d')]);_0x4bdbd0[_0x35e7('0x3b')]=_0x225184[_0x35e7('0x3b')];_0x4bdbd0[_0x35e7('0x3c')]=_0x225184[_0x35e7('0x3c')];return db[_0x35e7('0x40')][_0x35e7('0x66')](_0x4bdbd0,{'include':[{'model':db[_0x35e7('0x3e')],'as':_0x35e7('0x3c')},{'model':db['MailServerIn'],'as':_0x35e7('0x3b')}]})[_0x35e7('0xf')](function(_0x22dc51){var _0x36b6a0=_0xebc468[_0x35e7('0x31')][_0x35e7('0x24')]({'plain':!![]});if(!_0x36b6a0)throw new Error(_0x35e7('0x75'));if(_0x36b6a0[_0x35e7('0x76')]===_0x35e7('0x31')){var _0x29f9fa=_0x22dc51[_0x35e7('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x35e7('0x5c')]({'where':{'name':_0x35e7('0x77'),'userProfileId':_0x36b6a0[_0x35e7('0x78')]},'raw':!![]})[_0x35e7('0xf')](function(_0x3a39ad){if(_0x3a39ad&&_0x3a39ad['autoAssociation']===0x0){return db[_0x35e7('0x25')][_0x35e7('0x66')]({'name':_0x29f9fa['name'],'resourceId':_0x29f9fa['id'],'type':_0x3a39ad[_0x35e7('0x27')],'sectionId':_0x3a39ad['id']},{})[_0x35e7('0xf')](function(){return _0x22dc51;});}else{return _0x22dc51;}})[_0x35e7('0x18')](function(_0x1a7909){logger[_0x35e7('0x15')](_0x35e7('0x79'),_0x1a7909);throw _0x1a7909;});}return _0x22dc51;})['then'](respondWithResult(_0x4b1136,0xc9))[_0x35e7('0x18')](handleError(_0x4b1136,null));};exports['getImap']=function(_0x3975bf,_0x5547bb){return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x3975bf[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x5547bb,null))[_0x35e7('0xf')](function(_0x58c000){if(_0x58c000){return _0x58c000[_0x35e7('0x7a')]();}return null;})[_0x35e7('0xf')](respondWithResult(_0x5547bb,null))['catch'](handleError(_0x5547bb,null));};exports[_0x35e7('0x7b')]=function(_0xa10afa,_0x350839){if(_0xa10afa[_0x35e7('0x5d')]['id']){delete _0xa10afa[_0x35e7('0x5d')]['id'];}return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0xa10afa[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x350839,null))['then'](function(_0x4a2ec7){if(_0x4a2ec7){_0xa10afa['body'][_0x35e7('0x64')]=_0x4a2ec7['id'];return db[_0x35e7('0x5a')][_0x35e7('0x66')](_0xa10afa[_0x35e7('0x5d')]);}})[_0x35e7('0xf')](respondWithResult(_0x350839,null))[_0x35e7('0x18')](handleError(_0x350839,null));};exports['removeImap']=function(_0x51679d,_0x32b789){return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x51679d[_0x35e7('0x59')]['id']}})['then'](handleEntityNotFound(_0x32b789,null))['then'](function(_0x354f6f){if(_0x354f6f){return _0x354f6f[_0x35e7('0x7c')](null);}return null;})['then'](respondWithStatusCode(_0x32b789,null))[_0x35e7('0x18')](handleError(_0x32b789,null));};exports[_0x35e7('0x7d')]=function(_0x29e7e1,_0x19cc27){return db[_0x35e7('0x40')]['findOne']({'where':{'id':_0x29e7e1[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x19cc27,null))[_0x35e7('0xf')](function(_0x5257d1){if(_0x5257d1){return _0x5257d1[_0x35e7('0x7d')]();}return null;})[_0x35e7('0xf')](respondWithResult(_0x19cc27,null))[_0x35e7('0x18')](handleError(_0x19cc27,null));};exports[_0x35e7('0x7e')]=function(_0x2a74af,_0x5211c0){if(_0x2a74af[_0x35e7('0x5d')]['id']){delete _0x2a74af[_0x35e7('0x5d')]['id'];}return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x2a74af['params']['id']}})['then'](handleEntityNotFound(_0x5211c0,null))[_0x35e7('0xf')](function(_0x15d4ce){if(_0x15d4ce){_0x2a74af[_0x35e7('0x5d')]['MailAccountId']=_0x15d4ce['id'];return db[_0x35e7('0x3e')][_0x35e7('0x66')](_0x2a74af[_0x35e7('0x5d')]);}})[_0x35e7('0xf')](respondWithResult(_0x5211c0,null))[_0x35e7('0x18')](handleError(_0x5211c0,null));};exports[_0x35e7('0x7f')]=function(_0x2f3ba8,_0x29baf1){return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x2f3ba8[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x29baf1,null))[_0x35e7('0xf')](function(_0x16fc03){if(_0x16fc03){return _0x16fc03[_0x35e7('0x80')](null);}return null;})[_0x35e7('0xf')](respondWithStatusCode(_0x29baf1,null))[_0x35e7('0x18')](handleError(_0x29baf1,null));};exports['addInteraction']=function(_0x3991cf,_0x3814aa){return db[_0x35e7('0x81')][_0x35e7('0x5c')]({'where':{'id':_0x3991cf[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x3814aa,null))[_0x35e7('0xf')](function(_0x5f45cf){if(_0x5f45cf){return _0x5f45cf['addInteraction'](_0x3991cf[_0x35e7('0x5d')]['ids'],_['omit'](_0x3991cf[_0x35e7('0x5d')],[_0x35e7('0x6b'),'id'])||{});}})[_0x35e7('0xf')](respondWithResult(_0x3814aa,null))['catch'](handleError(_0x3814aa,null));};exports[_0x35e7('0x82')]=function(_0x5c6052,_0x3e5c85){var _0x223d06={'raw':![],'where':{}};var _0x230cc6={};var _0x34ce6f={'count':0x0,'rows':[]};return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x5c6052[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x3e5c85,null))['then'](function(_0x7ee3cc){if(_0x7ee3cc){_0x230cc6[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db[_0x35e7('0x81')][_0x35e7('0x41')]);_0x230cc6['query']=_['keys'](_0x5c6052[_0x35e7('0x45')]);_0x230cc6[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x230cc6['model'],_0x230cc6[_0x35e7('0x45')]);_0x223d06['attributes']=_[_0x35e7('0x48')](_0x230cc6[_0x35e7('0x4a')],qs[_0x35e7('0x4b')](_0x5c6052[_0x35e7('0x45')][_0x35e7('0x4b')]));_0x223d06[_0x35e7('0x49')]=_0x223d06[_0x35e7('0x49')][_0x35e7('0x4c')]?_0x223d06[_0x35e7('0x49')]:_0x230cc6[_0x35e7('0x4a')];if(!_0x5c6052[_0x35e7('0x45')][_0x35e7('0x4d')](_0x35e7('0x4e'))){_0x223d06[_0x35e7('0x1d')]=qs[_0x35e7('0x1d')](_0x5c6052[_0x35e7('0x45')][_0x35e7('0x1d')]);_0x223d06[_0x35e7('0x1c')]=qs[_0x35e7('0x1c')](_0x5c6052['query'][_0x35e7('0x1c')]);}_0x223d06['order']=qs[_0x35e7('0x50')](_0x5c6052['query']['sort']);_0x223d06[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_['pick'](_0x5c6052[_0x35e7('0x45')],_0x230cc6[_0x35e7('0x47')]));_0x223d06[_0x35e7('0x51')][_0x35e7('0x64')]=_0x7ee3cc['id'];if(_0x5c6052[_0x35e7('0x45')][_0x35e7('0x53')]){_0x223d06[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x223d06['where'],{'$or':_['map'](_0x223d06[_0x35e7('0x49')],function(_0x3dfee5){var _0x1d8dd2={};_0x1d8dd2[_0x3dfee5]={'$like':'%'+_0x5c6052[_0x35e7('0x45')][_0x35e7('0x53')]+'%'};return _0x1d8dd2;})});}_0x223d06=_[_0x35e7('0x54')]({},_0x223d06,_0x5c6052['options']);return db[_0x35e7('0x81')]['count']({'where':_0x223d06['where']})[_0x35e7('0xf')](function(_0x263397){_0x34ce6f['count']=_0x263397;if(_0x5c6052[_0x35e7('0x45')][_0x35e7('0x56')]){_0x223d06['include']=[{'model':db[_0x35e7('0x83')],'as':_0x35e7('0x84'),'required':![]},{'model':db['User'],'as':_0x35e7('0x85'),'attributes':[_0x35e7('0x27'),'fullname',_0x35e7('0x86')],'required':![]},{'model':db[_0x35e7('0x87')],'as':_0x35e7('0x88'),'attributes':['id','name',_0x35e7('0x89')],'where':_0x5c6052[_0x35e7('0x45')][_0x35e7('0x8a')]?{'id':_0x5c6052[_0x35e7('0x45')][_0x35e7('0x8a')]}:undefined,'required':_0x5c6052[_0x35e7('0x45')][_0x35e7('0x8a')]?!![]:![]}];}return db[_0x35e7('0x81')][_0x35e7('0x58')](_0x223d06);})[_0x35e7('0xf')](function(_0x145a58){_0x34ce6f[_0x35e7('0x69')]=_0x145a58;return _0x34ce6f;});}})[_0x35e7('0xf')](respondWithFilteredResult(_0x3e5c85,_0x223d06))[_0x35e7('0x18')](handleError(_0x3e5c85,null));};exports[_0x35e7('0x8b')]=function addApplications(_0x39475b,_0xf690ce){var _0x365d04=_0x39475b[_0x35e7('0x59')]['id'];var _0x5a6fd4=_0x39475b['body'];var _0x3120a4=0xc8;var _0x5a19a0=null;return db[_0x35e7('0x8c')][_0x35e7('0x8d')]({'isolationLevel':db[_0x35e7('0x8c')]['Transaction']['ISOLATION_LEVELS'][_0x35e7('0x8e')]},function(_0x44efa1){return db[_0x35e7('0x40')]['findOne']({'where':{'id':_0x365d04},'transaction':_0x44efa1})[_0x35e7('0xf')](function(_0x2d6d5c){if(_0x2d6d5c){return db[_0x35e7('0x8f')][_0x35e7('0x23')]({'where':{'MailAccountId':_0x365d04},'transaction':_0x44efa1})[_0x35e7('0xf')](function(){var _0x47e845=_[_0x35e7('0x3f')](_0x5a6fd4,function(_0x42b9f7){_0x42b9f7[_0x35e7('0x64')]=_0x365d04;return _0x42b9f7;});return db[_0x35e7('0x8f')][_0x35e7('0x90')](_0x47e845,{'transaction':_0x44efa1});});}else{_0x3120a4=0x194;_0x5a19a0=[];}});})['then'](function(){if(_0x3120a4!==0x194){return db[_0x35e7('0x8f')][_0x35e7('0x91')]({'where':{'MailAccountId':_0x365d04},'order':_0x35e7('0x92')})[_0x35e7('0xf')](function(_0x1bf6bc){_0x5a19a0=_0x1bf6bc;});}})[_0x35e7('0x18')](function(_0x10bea4){_0x3120a4=0x1f4;logger[_0x35e7('0x15')](_0x10bea4['stack']);if(_0x10bea4[_0x35e7('0x27')]){delete _0x10bea4[_0x35e7('0x27')];}_0x5a19a0=_0x10bea4;})[_0x35e7('0x93')](function(){if(_0x5a19a0===null){_0xf690ce[_0x35e7('0x26')](_0x3120a4);}else{if(_0x3120a4===0x1f4){_0xf690ce[_0x35e7('0x19')](_0x3120a4)[_0x35e7('0x94')](_0x5a19a0);}else{_0xf690ce['status'](_0x3120a4)['json'](_0x5a19a0);}}});};exports[_0x35e7('0x95')]=function(_0x5796a6,_0x4801b5){var _0x5a1cd9={};var _0x3aa590={};var _0x2f2135;var _0x5ba861;return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x5796a6[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x4801b5,null))['then'](function(_0x20aa9c){if(_0x20aa9c){_0x2f2135=_0x20aa9c;_0x3aa590[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db[_0x35e7('0x8f')][_0x35e7('0x41')]);_0x3aa590[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x5796a6[_0x35e7('0x45')]);_0x3aa590[_0x35e7('0x47')]=_['intersection'](_0x3aa590['model'],_0x3aa590[_0x35e7('0x45')]);_0x5a1cd9[_0x35e7('0x49')]=_[_0x35e7('0x48')](_0x3aa590['model'],qs[_0x35e7('0x4b')](_0x5796a6[_0x35e7('0x45')][_0x35e7('0x4b')]));_0x5a1cd9[_0x35e7('0x49')]=_0x5a1cd9[_0x35e7('0x49')]['length']?_0x5a1cd9[_0x35e7('0x49')]:_0x3aa590[_0x35e7('0x4a')];_0x5a1cd9[_0x35e7('0x4f')]=qs['sort'](_0x5796a6[_0x35e7('0x45')]['sort']);_0x5a1cd9[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x5796a6[_0x35e7('0x45')],_0x3aa590['filters']));if(_0x5796a6[_0x35e7('0x45')][_0x35e7('0x53')]){_0x5a1cd9[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x5a1cd9[_0x35e7('0x51')],{'$or':_[_0x35e7('0x3f')](_0x5a1cd9['attributes'],function(_0x341945){var _0xd66828={};_0xd66828[_0x341945]={'$like':'%'+_0x5796a6['query'][_0x35e7('0x53')]+'%'};return _0xd66828;})});}_0x5a1cd9=_[_0x35e7('0x54')]({},_0x5a1cd9,_0x5796a6[_0x35e7('0x55')]);return _0x2f2135[_0x35e7('0x95')](_0x5a1cd9);}})[_0x35e7('0xf')](function(_0x2de311){if(_0x2de311){_0x5ba861=_0x2de311[_0x35e7('0x4c')];if(!_0x5796a6['query'][_0x35e7('0x4d')](_0x35e7('0x4e'))){_0x5a1cd9[_0x35e7('0x1d')]=qs[_0x35e7('0x1d')](_0x5796a6[_0x35e7('0x45')][_0x35e7('0x1d')]);_0x5a1cd9[_0x35e7('0x1c')]=qs[_0x35e7('0x1c')](_0x5796a6[_0x35e7('0x45')][_0x35e7('0x1c')]);}return _0x2f2135[_0x35e7('0x95')](_0x5a1cd9);}})[_0x35e7('0xf')](function(_0x5f15e0){if(_0x5f15e0){return _0x5f15e0?{'count':_0x5ba861,'rows':_0x5f15e0}:null;}})[_0x35e7('0xf')](respondWithResult(_0x4801b5,null))['catch'](handleError(_0x4801b5,null));};exports['getMessages']=function(_0x5e5b28,_0x1fe24c){var _0x12cb25={'raw':!![],'where':{}};var _0x549dba={};var _0x3613da={'count':0x0,'rows':[]};return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x5e5b28[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x1fe24c,null))[_0x35e7('0xf')](function(_0x1324c6){if(_0x1324c6){_0x549dba[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db[_0x35e7('0x96')][_0x35e7('0x41')]);_0x549dba[_0x35e7('0x45')]=_[_0x35e7('0x46')](_0x5e5b28[_0x35e7('0x45')]);_0x549dba[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x549dba[_0x35e7('0x4a')],_0x549dba[_0x35e7('0x45')]);_0x12cb25[_0x35e7('0x49')]=_[_0x35e7('0x48')](_0x549dba[_0x35e7('0x4a')],qs['fields'](_0x5e5b28[_0x35e7('0x45')][_0x35e7('0x4b')]));_0x12cb25[_0x35e7('0x49')]=_0x12cb25[_0x35e7('0x49')][_0x35e7('0x4c')]?_0x12cb25[_0x35e7('0x49')]:_0x549dba[_0x35e7('0x4a')];if(!_0x5e5b28['query']['hasOwnProperty']('nolimit')){_0x12cb25[_0x35e7('0x1d')]=qs[_0x35e7('0x1d')](_0x5e5b28[_0x35e7('0x45')][_0x35e7('0x1d')]);_0x12cb25['offset']=qs[_0x35e7('0x1c')](_0x5e5b28['query'][_0x35e7('0x1c')]);}_0x12cb25[_0x35e7('0x4f')]=qs[_0x35e7('0x50')](_0x5e5b28['query'][_0x35e7('0x50')]);_0x12cb25[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x5e5b28[_0x35e7('0x45')],_0x549dba[_0x35e7('0x47')]));_0x12cb25[_0x35e7('0x51')]['MailAccountId']=_0x1324c6['id'];if(_0x5e5b28['query'][_0x35e7('0x53')]){_0x12cb25['where']=_[_0x35e7('0x54')](_0x12cb25['where'],{'$or':_[_0x35e7('0x3f')](_0x12cb25[_0x35e7('0x49')],function(_0x141743){var _0x460a2a={};_0x460a2a[_0x141743]={'$like':'%'+_0x5e5b28[_0x35e7('0x45')]['filter']+'%'};return _0x460a2a;})});}if(_0x5e5b28[_0x35e7('0x45')][_0x35e7('0x97')]){var _0x2ecdc1=_0x5e5b28['query'][_0x35e7('0x97')]['split'](',');var _0x37e398={};_0x37e398[_0x2ecdc1[0x0]]={'$gte':moment(_0x2ecdc1[0x1])[_0x35e7('0x98')](_0x35e7('0x99'))};_0x12cb25[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x12cb25[_0x35e7('0x51')],_0x37e398);}_0x12cb25=_[_0x35e7('0x54')]({},_0x12cb25,_0x5e5b28[_0x35e7('0x55')]);return db['MailMessage'][_0x35e7('0x1f')]({'where':_0x12cb25[_0x35e7('0x51')]})[_0x35e7('0xf')](function(_0x382f5b){_0x3613da[_0x35e7('0x1f')]=_0x382f5b;if(_0x5e5b28[_0x35e7('0x45')]['includeAll']){_0x12cb25[_0x35e7('0x57')]=[{'all':!![]}];}return db['MailMessage'][_0x35e7('0x58')](_0x12cb25);})['then'](function(_0x4e65e1){if(_0x5e5b28[_0x35e7('0x45')][_0x35e7('0x9a')]==='true'){for(var _0x54e9f8=0x0;_0x54e9f8<_0x4e65e1['length'];_0x54e9f8++){_0x4e65e1[_0x54e9f8][_0x35e7('0x5d')]=juice(_0x4e65e1[_0x54e9f8][_0x35e7('0x5d')]);}}_0x3613da[_0x35e7('0x69')]=_0x4e65e1;return _0x3613da;});}})[_0x35e7('0xf')](respondWithFilteredResult(_0x1fe24c,_0x12cb25))[_0x35e7('0x18')](handleError(_0x1fe24c,null));};exports[_0x35e7('0x94')]=function(_0x5711e1,_0x30264e){var _0x53d177,_0x197dbe={},_0x49e40f;if(_0x5711e1['body']['to']){_0x49e40f=_0x5711e1[_0x35e7('0x5d')]['to'][_0x35e7('0x9b')](',')[0x0];}return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x5711e1[_0x35e7('0x59')]['id']},'include':[{'model':db[_0x35e7('0x9c')],'as':'List','include':[{'model':db[_0x35e7('0x83')],'as':_0x35e7('0x9d'),'where':{'email':_0x49e40f},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailServerOut'],'as':_0x35e7('0x3c'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x35e7('0x9e'),'raw':!![]}]}]})[_0x35e7('0xf')](handleEntityNotFound(_0x30264e,null))[_0x35e7('0xf')](function(_0x323bf6){if(!_0x323bf6)return;_0x53d177=_0x323bf6;if(!_0x323bf6[_0x35e7('0x3c')])throw new Error(_0x35e7('0x9f'));if(_[_0x35e7('0x72')](_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa0')])){_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa0')]=util[_0x35e7('0x98')](_0x35e7('0xa1'),_0x323bf6[_0x35e7('0x27')],_0x323bf6[_0x35e7('0x70')]||_0x323bf6['Smtp']['user']);}if(_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa2')]&&_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa2')][_0x35e7('0x4c')]){for(var _0x37a14a=0x0;_0x37a14a<_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa2')]['length'];_0x37a14a+=0x1){_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa2')][_0x37a14a]={'filename':_0x5711e1['body'][_0x35e7('0xa2')][_0x37a14a][_0x35e7('0x27')],'path':path[_0x35e7('0xa3')](config[_0x35e7('0xa4')],_0x35e7('0xa5'),_0x5711e1[_0x35e7('0x5d')]['attachments'][_0x37a14a]['basename'])};}}var _0x19fde2=_0x323bf6['getSmtpOptions']();return respondWithRpcPromise(_0x35e7('0xa6'),_0x35e7('0xa7'),{'account':_0x19fde2,'message':_0x5711e1[_0x35e7('0x5d')]});})[_0x35e7('0xf')](function(_0x10df7b){if(!_0x10df7b)return;_0x197dbe=_0x10df7b;if(!_0x53d177['List'])throw new Error(_0x35e7('0xa8'));if(_0x53d177[_0x35e7('0xa9')][_0x35e7('0x9d')][_0x35e7('0x4c')])return _0x53d177['List'][_0x35e7('0x9d')][0x0];return db[_0x35e7('0x83')][_0x35e7('0x66')](_[_0x35e7('0x8')](_0x5711e1[_0x35e7('0x5d')],{'firstName':_0x5711e1[_0x35e7('0x5d')]['to'],'email':_0x5711e1[_0x35e7('0x5d')]['to'],'phone':_0x5711e1[_0x35e7('0x5d')]['to'],'ListId':_0x53d177[_0x35e7('0x71')]}));})[_0x35e7('0xf')](function(_0x16ffa0){if(!_0x16ffa0)return;var _0x277d90={'UserId':_0x5711e1[_0x35e7('0x31')]['id'],'ContactId':_0x16ffa0['id'],'MailAccountId':_0x53d177['id'],'inReplyTo':_0x197dbe[_0x35e7('0xaa')],'to':_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xa0')],'cc':_0x5711e1['body']['cc'],'subject':_0x5711e1['body'][_0x35e7('0xab')],'attach':_0x5711e1[_0x35e7('0x5d')][_0x35e7('0xac')],'firstMsgDirection':_0x35e7('0xad'),'lastMsgAt':moment()['format'](_0x35e7('0x99')),'lastMsgDirection':_0x35e7('0xad'),'Messages':[_['merge'](_0x5711e1[_0x35e7('0x5d')],{'messageId':_0x197dbe[_0x35e7('0xaa')],'sentAt':moment()[_0x35e7('0x98')](_0x35e7('0x99')),'read':!![],'MailAccountId':_0x53d177['id'],'UserId':_0x5711e1['user']['id'],'ContactId':_0x16ffa0['id']})]};if(_0x5711e1['body'][_0x35e7('0xae')]){_0x277d90=_['merge'](_0x277d90,_0x5711e1['body'][_0x35e7('0xae')]);}return db[_0x35e7('0x81')][_0x35e7('0x66')](_0x277d90,{'include':[{'model':db[_0x35e7('0x96')],'as':_0x35e7('0xaf')}]});})[_0x35e7('0xf')](respondWithResult(_0x30264e,null))[_0x35e7('0x18')](handleError(_0x30264e,null));};exports[_0x35e7('0xb0')]=function(_0x129b14,_0x517a25){return db['MailAccount'][_0x35e7('0x5c')]({'where':{'id':_0x129b14[_0x35e7('0x59')]['id']},'include':[{'model':db[_0x35e7('0x3e')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x35e7('0x9e')],'as':_0x35e7('0x9e'),'raw':!![]}]}]})[_0x35e7('0xf')](handleEntityNotFound(_0x517a25,null))[_0x35e7('0xf')](function(_0x1c3413){if(!_0x1c3413[_0x35e7('0x3c')])return;var _0x4d9b4d=_0x1c3413['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x35e7('0xb0'),{'account':_0x4d9b4d});})['then'](respondWithResult(_0x517a25,null))[_0x35e7('0x18')](handleError(_0x517a25,null));};exports['destroy']=function(_0x34a9aa,_0x2811c5){return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x34a9aa[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x2811c5,null))[_0x35e7('0xf')](function(_0x1e48b8){if(_0x1e48b8&&_0x1e48b8[_0x35e7('0x39')]){throw new db[(_0x35e7('0xb1'))]['ValidationError'](_0x35e7('0xb2'));}return _0x1e48b8;})[_0x35e7('0xf')](removeEntity(_0x2811c5,null))['catch'](handleError(_0x2811c5,null));};exports[_0x35e7('0xb3')]=function(_0x32028d,_0x3795b0){return db[_0x35e7('0x40')]['find']({'where':{'id':_0x32028d[_0x35e7('0x59')]['id']}})['then'](handleEntityNotFound(_0x3795b0,null))[_0x35e7('0xf')](function(_0x3039d0){if(_0x3039d0){return _0x3039d0[_0x35e7('0xb3')](_0x32028d[_0x35e7('0x5d')]['ids'],_['omit'](_0x32028d['body'],[_0x35e7('0x6b'),'id'])||{})[_0x35e7('0xb4')](function(_0x449f3a){for(var _0x3f5942=0x0;_0x3f5942<_0x32028d[_0x35e7('0x5d')][_0x35e7('0x6b')]['length'];_0x3f5942+=0x1){socket[_0x35e7('0xb5')](_0x35e7('0xb6'),{'UserId':Number(_0x32028d[_0x35e7('0x5d')][_0x35e7('0x6b')][_0x3f5942]),'MailAccountId':Number(_0x32028d[_0x35e7('0x59')]['id'])});}return _0x449f3a;});}})[_0x35e7('0xf')](respondWithResult(_0x3795b0,null))['catch'](handleError(_0x3795b0,null));};exports['removeAgents']=function(_0x30ab7a,_0x48629b){return db[_0x35e7('0x40')][_0x35e7('0x5c')]({'where':{'id':_0x30ab7a[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x48629b,null))[_0x35e7('0xf')](function(_0x557b58){if(_0x557b58){return _0x557b58[_0x35e7('0xb7')](_0x30ab7a[_0x35e7('0x45')][_0x35e7('0x6b')])['then'](function(){if(_[_0x35e7('0xb8')](_0x30ab7a[_0x35e7('0x45')][_0x35e7('0x6b')])){for(var _0x56898a=0x0;_0x56898a<_0x30ab7a[_0x35e7('0x45')][_0x35e7('0x6b')][_0x35e7('0x4c')];_0x56898a+=0x1){socket['emit'](_0x35e7('0xb9'),{'UserId':Number(_0x30ab7a['query'][_0x35e7('0x6b')][_0x56898a]),'MailAccountId':Number(_0x30ab7a[_0x35e7('0x59')]['id'])});}}else{socket[_0x35e7('0xb5')](_0x35e7('0xb9'),{'UserId':Number(_0x30ab7a['query'][_0x35e7('0x6b')]),'MailAccountId':Number(_0x30ab7a[_0x35e7('0x59')]['id'])});}});}})[_0x35e7('0xf')](respondWithStatusCode(_0x48629b,null))[_0x35e7('0x18')](handleError(_0x48629b,null));};exports[_0x35e7('0xba')]=function(_0x582933,_0x2e7a63){var _0x490f0c={};var _0x4cf3ed={};var _0x2e2f9e;var _0x336c8f;return db[_0x35e7('0x40')][_0x35e7('0x68')]({'where':{'id':_0x582933[_0x35e7('0x59')]['id']}})[_0x35e7('0xf')](handleEntityNotFound(_0x2e7a63,null))[_0x35e7('0xf')](function(_0x256ab5){if(_0x256ab5){_0x2e2f9e=_0x256ab5;_0x4cf3ed[_0x35e7('0x4a')]=_[_0x35e7('0x46')](db[_0x35e7('0xbb')][_0x35e7('0x41')]);_0x4cf3ed['query']=_[_0x35e7('0x46')](_0x582933[_0x35e7('0x45')]);_0x4cf3ed[_0x35e7('0x47')]=_[_0x35e7('0x48')](_0x4cf3ed[_0x35e7('0x4a')],_0x4cf3ed[_0x35e7('0x45')]);_0x490f0c[_0x35e7('0x49')]=_['intersection'](_0x4cf3ed[_0x35e7('0x4a')],qs[_0x35e7('0x4b')](_0x582933['query']['fields']));_0x490f0c[_0x35e7('0x49')]=_0x490f0c[_0x35e7('0x49')][_0x35e7('0x4c')]?_0x490f0c['attributes']:_0x4cf3ed[_0x35e7('0x4a')];_0x490f0c[_0x35e7('0x4f')]=qs['sort'](_0x582933[_0x35e7('0x45')][_0x35e7('0x50')]);_0x490f0c[_0x35e7('0x51')]=qs[_0x35e7('0x47')](_[_0x35e7('0x52')](_0x582933[_0x35e7('0x45')],_0x4cf3ed['filters']));if(_0x582933[_0x35e7('0x45')][_0x35e7('0x53')]){_0x490f0c[_0x35e7('0x51')]=_[_0x35e7('0x54')](_0x490f0c[_0x35e7('0x51')],{'$or':_[_0x35e7('0x3f')](_0x490f0c['attributes'],function(_0x53e660){var _0x2e16c2={};_0x2e16c2[_0x53e660]={'$like':'%'+_0x582933[_0x35e7('0x45')][_0x35e7('0x53')]+'%'};return _0x2e16c2;})});}_0x490f0c=_[_0x35e7('0x54')]({},_0x490f0c,_0x582933['options']);return _0x2e2f9e[_0x35e7('0xba')](_0x490f0c);}})['then'](function(_0x2aedac){if(_0x2aedac){_0x336c8f=_0x2aedac[_0x35e7('0x4c')];if(!_0x582933[_0x35e7('0x45')][_0x35e7('0x4d')](_0x35e7('0x4e'))){_0x490f0c[_0x35e7('0x1d')]=qs['limit'](_0x582933[_0x35e7('0x45')][_0x35e7('0x1d')]);_0x490f0c[_0x35e7('0x1c')]=qs[_0x35e7('0x1c')](_0x582933[_0x35e7('0x45')][_0x35e7('0x1c')]);}return _0x2e2f9e[_0x35e7('0xba')](_0x490f0c);}})[_0x35e7('0xf')](function(_0x216769){if(_0x216769){return _0x216769?{'count':_0x336c8f,'rows':_0x216769}:null;}})['then'](respondWithResult(_0x2e7a63,null))[_0x35e7('0x18')](handleError(_0x2e7a63,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 7e1d94b..d5f9dae 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 _0x6dd4=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','hook','exports'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x6dd4,0x129));var _0x46dd=function(_0x24bfb1,_0x319a77){_0x24bfb1=_0x24bfb1-0x0;var _0x1fc3ea=_0x6dd4[_0x24bfb1];return _0x1fc3ea;};'use strict';var EventEmitter=require(_0x46dd('0x0'));var MailAccount=require(_0x46dd('0x1'))['db'][_0x46dd('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x46dd('0x3')](0x0);var events={'afterCreate':_0x46dd('0x4'),'afterUpdate':_0x46dd('0x5'),'afterDestroy':_0x46dd('0x6')};function emitEvent(_0x3e5426){return function(_0x328f16,_0x5a2220,_0x13d9bd){MailAccountEvents['emit'](_0x3e5426+':'+_0x328f16['id'],_0x328f16);MailAccountEvents['emit'](_0x3e5426,_0x328f16);_0x13d9bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x46dd('0x7')](e,emitEvent(event));}}module[_0x46dd('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x0fc9=['../../mysqldb','MailAccount','save','update','emit','hook','exports','events'];(function(_0x5a43ad,_0x36407d){var _0x1b72ee=function(_0x173474){while(--_0x173474){_0x5a43ad['push'](_0x5a43ad['shift']());}};_0x1b72ee(++_0x36407d);}(_0x0fc9,0x15f));var _0x90fc=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0fc9[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0x90fc('0x0'));var MailAccount=require(_0x90fc('0x1'))['db'][_0x90fc('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x90fc('0x3'),'afterUpdate':_0x90fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3799b9){return function(_0x379f42,_0x17929c,_0x9f16d5){MailAccountEvents[_0x90fc('0x5')](_0x3799b9+':'+_0x379f42['id'],_0x379f42);MailAccountEvents[_0x90fc('0x5')](_0x3799b9,_0x379f42);_0x9f16d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0x90fc('0x6')](e,emitEvent(event));}}module[_0x90fc('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index ba375d6..77bf37d 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 _0x70be=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','pass'];(function(_0x590995,_0xddd0e){var _0x5ce003=function(_0x4bb6e8){while(--_0x4bb6e8){_0x590995['push'](_0x590995['shift']());}};_0x5ce003(++_0xddd0e);}(_0x70be,0xc6));var _0xe70b=function(_0xf2cd1b,_0x3db301){_0xf2cd1b=_0xf2cd1b-0x0;var _0x31055a=_0x70be[_0xf2cd1b];return _0x31055a;};'use strict';var attributes=require(_0xe70b('0x0'));module[_0xe70b('0x1')]=function(_0x304a70){return _0x304a70[_0xe70b('0x2')](_0xe70b('0x3'),attributes,{'tableName':_0xe70b('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x105ea4=this;var _0x544101={'id':_0x105ea4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x105ea4[_0xe70b('0x5')]!==_0xe70b('0x6')){_0x544101[_0xe70b('0x7')]=_0x105ea4[_0xe70b('0x5')];}else{_0x544101[_0xe70b('0x8')]=_0x105ea4[_0xe70b('0x9')][_0xe70b('0x8')];_0x544101['port']=_0x105ea4[_0xe70b('0x9')][_0xe70b('0xa')];_0x544101[_0xe70b('0xb')]=_0x105ea4[_0xe70b('0x9')][_0xe70b('0xb')];}if(_0x105ea4[_0xe70b('0x9')][_0xe70b('0xc')]){if(_0x105ea4[_0xe70b('0x9')][_0xe70b('0xd')]){if(!_0x105ea4['Smtp'][_0xe70b('0xe')])throw new Error(_0xe70b('0xf'));_0x544101['auth']={'type':'OAuth2','user':_0x105ea4[_0xe70b('0x9')][_0xe70b('0x10')],'accessToken':_0x105ea4[_0xe70b('0x9')][_0xe70b('0xe')]['data5']};}else{_0x544101['auth']={'user':_0x105ea4[_0xe70b('0x9')][_0xe70b('0x10')],'pass':_0x105ea4[_0xe70b('0x9')][_0xe70b('0x11')]};}}return _0x544101;}}});}; \ No newline at end of file +var _0xa211=['host','Smtp','secure','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','CloudProvider','data5','auth','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa211,0x19a));var _0x1a21=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa211[_0x2c91e9];return _0x13f0ff;};'use strict';var attributes=require(_0x1a21('0x0'));module[_0x1a21('0x1')]=function(_0x45c153){return _0x45c153[_0x1a21('0x2')](_0x1a21('0x3'),attributes,{'tableName':_0x1a21('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x4aecb4=this;var _0xfd9b65={'id':_0x4aecb4['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4aecb4[_0x1a21('0x5')]!==_0x1a21('0x6')){_0xfd9b65[_0x1a21('0x7')]=_0x4aecb4['provider'];}else{_0xfd9b65[_0x1a21('0x8')]=_0x4aecb4[_0x1a21('0x9')][_0x1a21('0x8')];_0xfd9b65['port']=_0x4aecb4[_0x1a21('0x9')]['port'];_0xfd9b65['secure']=_0x4aecb4['Smtp'][_0x1a21('0xa')];}if(_0x4aecb4[_0x1a21('0x9')]['authentication']){if(_0x4aecb4['Smtp'][_0x1a21('0xb')]){if(!_0x4aecb4[_0x1a21('0x9')]['CloudProvider'])throw new Error(_0x1a21('0xc'));_0xfd9b65['auth']={'type':_0x1a21('0xd'),'user':_0x4aecb4[_0x1a21('0x9')][_0x1a21('0xe')],'accessToken':_0x4aecb4[_0x1a21('0x9')][_0x1a21('0xf')][_0x1a21('0x10')]};}else{_0xfd9b65[_0x1a21('0x11')]={'user':_0x4aecb4[_0x1a21('0x9')][_0x1a21('0xe')],'pass':_0x4aecb4[_0x1a21('0x9')][_0x1a21('0x12')]};}}return _0xfd9b65;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 099439f..488c548 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 _0xf69d=['redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','MailAccount','findAll','raw','options','attributes','limit','map','include','GetMailAccount','debug','catch','ShowMailAccount','find','where','model','setDataValue','smtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','asc','length','close','autoclose','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','update','format','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','*,*,*,*','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x20c159,_0x5e151a){var _0x3b48f7=function(_0x135700){while(--_0x135700){_0x20c159['push'](_0x20c159['shift']());}};_0x3b48f7(++_0x5e151a);}(_0xf69d,0xd3));var _0xdf69=function(_0x2ef16a,_0x444c9c){_0x2ef16a=_0x2ef16a-0x0;var _0x1a8940=_0xf69d[_0x2ef16a];return _0x1a8940;};'use strict';var _=require(_0xdf69('0x0'));var moment=require(_0xdf69('0x1'));var BPromise=require(_0xdf69('0x2'));var rs=require(_0xdf69('0x3'));var Redis=require(_0xdf69('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xdf69('0x5'))(_0xdf69('0x6'));var config=require(_0xdf69('0x7'));var jayson=require(_0xdf69('0x8'));var client=jayson[_0xdf69('0x9')][_0xdf69('0xa')]({'port':0x232c});config[_0xdf69('0xb')]=_[_0xdf69('0xc')](config[_0xdf69('0xb')],{'host':_0xdf69('0xd'),'port':0x18eb});var socket=require(_0xdf69('0xe'))(new Redis(config[_0xdf69('0xb')]));require(_0xdf69('0xf'))[_0xdf69('0x10')](socket);function respondWithRpcPromise(_0x40217f,_0x211ea9,_0x1e0e8d){return new BPromise(function(_0x4fcc93,_0x305726){return client[_0xdf69('0x11')](_0x40217f,_0x1e0e8d)[_0xdf69('0x12')](function(_0x21d8e0){logger[_0xdf69('0x13')](_0xdf69('0x14'),_0x211ea9,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x211ea9,'request\x20sent',JSON[_0xdf69('0x15')](_0x21d8e0));if(_0x21d8e0[_0xdf69('0x16')]){if(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x17')]===0x1f4){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x21d8e0['error'][_0xdf69('0x18')]);return _0x305726(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}logger[_0xdf69('0x16')]('MailAccount,\x20%s,\x20%s',_0x211ea9,_0x21d8e0[_0xdf69('0x16')]['message']);return _0x4fcc93(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}else{logger['info'](_0xdf69('0x14'),_0x211ea9,_0xdf69('0x19'));_0x4fcc93(_0x21d8e0[_0xdf69('0x1a')][_0xdf69('0x18')]);}})['catch'](function(_0x5ae237){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x5ae237);_0x305726(_0x5ae237);});});}exports['GetMailAccount']=function(_0x32cf65){var _0x259e90=this;return new Promise(function(_0x68fa80,_0x526cbc){return db[_0xdf69('0x1b')][_0xdf69('0x1c')]({'raw':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65[_0xdf69('0x1e')]['where']||null:null,'attributes':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1f')]||null:null,'limit':_0x32cf65['options']?_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x20')]||null:null,'include':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65['options']['include']?_[_0xdf69('0x21')](_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x22')],function(_0x3fd933){return{'model':db[_0x3fd933['model']],'as':_0x3fd933['as'],'attributes':_0x3fd933[_0xdf69('0x1f')],'include':_0x3fd933[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x3fd933['include'],function(_0x2da3df){return{'model':db[_0x2da3df['model']],'as':_0x2da3df['as'],'attributes':_0x2da3df['attributes'],'include':_0x2da3df['include']?_['map'](_0x2da3df[_0xdf69('0x22')],function(_0xe339ac){return{'model':db[_0xe339ac['model']],'as':_0xe339ac['as'],'attributes':_0xe339ac[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x19cf2d){logger[_0xdf69('0x13')](_0xdf69('0x23'),_0x32cf65);logger[_0xdf69('0x24')](_0xdf69('0x23'),_0x32cf65,JSON[_0xdf69('0x15')](_0x19cf2d));_0x68fa80(_0x19cf2d);})[_0xdf69('0x25')](function(_0x3b97df){logger[_0xdf69('0x16')](_0xdf69('0x23'),_0x3b97df[_0xdf69('0x18')],_0x32cf65);_0x526cbc(_0x259e90[_0xdf69('0x16')](0x1f4,_0x3b97df[_0xdf69('0x18')]));});});};exports[_0xdf69('0x26')]=function(_0x1f4602){var _0x5ade53=this;return new Promise(function(_0xf910a0,_0x2aab76){return db[_0xdf69('0x1b')][_0xdf69('0x27')]({'raw':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x28')]||null:null,'attributes':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')]['attributes']||null:null,'include':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x1f4602[_0xdf69('0x1e')]['include'],function(_0x175d5a){return{'model':db[_0x175d5a['model']],'as':_0x175d5a['as'],'attributes':_0x175d5a[_0xdf69('0x1f')],'include':_0x175d5a[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x175d5a[_0xdf69('0x22')],function(_0x5c38db){return{'model':db[_0x5c38db[_0xdf69('0x29')]],'as':_0x5c38db['as'],'attributes':_0x5c38db['attributes'],'include':_0x5c38db[_0xdf69('0x22')]?_['map'](_0x5c38db[_0xdf69('0x22')],function(_0x5d8e26){return{'model':db[_0x5d8e26[_0xdf69('0x29')]],'as':_0x5d8e26['as'],'attributes':_0x5d8e26[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x2b7628){if(_0x1f4602[_0xdf69('0x1e')]['smtp']===!![])_0x2b7628[_0xdf69('0x2a')](_0xdf69('0x2b'),_0x2b7628['getSmtpOptions']());logger['info']('ShowMailAccount',_0x1f4602);logger['debug'](_0xdf69('0x26'),_0x1f4602,JSON['stringify'](_0x2b7628));_0xf910a0(_0x2b7628);})[_0xdf69('0x25')](function(_0x1c45b1){logger[_0xdf69('0x16')](_0xdf69('0x26'),_0x1c45b1['message'],_0x1f4602);_0x2aab76(_0x5ade53[_0xdf69('0x16')](0x1f4,_0x1c45b1[_0xdf69('0x18')]));});});};exports[_0xdf69('0x2c')]=function(_0x4f3370){var _0x216f62=this;return new Promise(function(_0xdd919d,_0x34ab67){var _0x1101ad={'body':_0x4f3370[_0xdf69('0x2d')],'channel':_0xdf69('0x2e')};var _0x4094d7=_['difference'](_['keys'](db[_0xdf69('0x2f')][_0xdf69('0x30')]),[_0xdf69('0x31'),_0xdf69('0x32'),'CompanyId','ListId']);var _0x5980b1=![];if(_0x4f3370['body']['id']){delete _0x4f3370[_0xdf69('0x2d')]['id'];}if(_['isNil'](_0x4f3370[_0xdf69('0x2d')]['from'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x33')));}if(_[_0xdf69('0x34')](_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')])||_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')]===''){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x35')));}if(_['isNil'](_0x4f3370['body'][_0xdf69('0x36')])){return _0x34ab67(_0x216f62['error'](0x1f4,_0xdf69('0x37')+_0x4094d7));}if(!_[_0xdf69('0x38')](_0x4094d7,_0x4f3370[_0xdf69('0x2d')]['mapKey'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x39')+_0x4094d7));}var _0x4093e9={};_0x4093e9[_0x4f3370[_0xdf69('0x2d')]['mapKey']]=_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x3a')];return db['MailAccount']['find']({'where':{'id':_0x4f3370[_0xdf69('0x3b')]['id']},'include':[{'model':db[_0xdf69('0x3c')],'as':_0xdf69('0x3d'),'include':[{'model':db[_0xdf69('0x2f')],'as':_0xdf69('0x3e'),'where':_0x4093e9,'limit':0x1,'order':[[_0xdf69('0x32'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xdf69('0x3f')},{'model':db[_0xdf69('0x40')],'as':_0xdf69('0x41'),'include':[{'model':db[_0xdf69('0x42')],'as':'CloudProvider'}]}]})['then'](function(_0xb34f76){if(_0xb34f76&&_0xb34f76[_0xdf69('0x3d')]){var _0x3ee7a5=_0xb34f76[_0xdf69('0x43')]({'plain':!![]});_0x1101ad[_0xdf69('0x3b')]=_[_0xdf69('0x44')](_0x3ee7a5,[_0xdf69('0x3f'),_0xdf69('0x3d')]);_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x2b')]=_0xb34f76[_0xdf69('0x45')]();_0x1101ad[_0xdf69('0x46')]=_0x3ee7a5[_0xdf69('0x3f')];_0x1101ad[_0xdf69('0x47')]=_0x3ee7a5['List'];_0x1101ad[_0xdf69('0x46')]=_[_0xdf69('0x48')](_0x1101ad[_0xdf69('0x46')],['priority'],[_0xdf69('0x49')]);if(_0x1101ad[_0xdf69('0x3b')]&&_0x1101ad[_0xdf69('0x3b')]['autoclose']){_0x1101ad[_0xdf69('0x46')]['push']({'id':0x0,'priority':_0x1101ad[_0xdf69('0x46')][_0xdf69('0x4a')]+0x1,'app':_0xdf69('0x4b'),'appdata':_0xdf69('0x4c'),'interval':'*,*,*,*'});}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')];}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')];}if(_0x3ee7a5[_0xdf69('0x3d')]['Contacts'][_0xdf69('0x4a')]){return _0x3ee7a5[_0xdf69('0x3d')]['Contacts'][0x0];}var _0x44b011=_[_0xdf69('0xc')](_0x4f3370['body'],{'firstName':_0x4f3370['body'][_0xdf69('0x3a')],'ListId':_0x3ee7a5['ListId']});_0x44b011[_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x36')]]=_0x4f3370[_0xdf69('0x2d')]['from'];return db['CmContact'][_0xdf69('0x4d')](_0x44b011);}else{throw new Error(_0xdf69('0x4e'));}})[_0xdf69('0x12')](function(_0x45ed01){_0x1101ad[_0xdf69('0x4f')]=_0x45ed01;if(_0x45ed01){if(!_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')]){_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['messageId']=rs[_0xdf69('0x51')]()+'\x20'+_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')];}var _0x11ee6c={'ContactId':_0x45ed01['id'],'MailAccountId':_0x4f3370[_0xdf69('0x3b')]['id'],'inReplyTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xdf69('0x27')]({'where':{'closed':![],'MailAccountId':_0x4f3370['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xdf69('0x55'),'attributes':[_0xdf69('0x50')],'where':{'messageId':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x56')]}}]})[_0xdf69('0x12')](function(_0x29e6a3){if(_0x29e6a3){return[_0x29e6a3,![]];}return db[_0xdf69('0x57')][_0xdf69('0x4d')](_0x11ee6c)[_0xdf69('0x12')](function(_0x232a69){return[_0x232a69,!![]];});});}else{throw new Error(_0xdf69('0x58'));}})['spread'](function(_0x5cd512,_0x5a2c39){if(_0x5cd512){_0x5980b1=_0x5a2c39;if(!_0x5a2c39){return _0x5cd512[_0xdf69('0x59')]({'inReplyTo':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x5cd512[_0xdf69('0x53')]?_0x5cd512[_0xdf69('0x53')]:_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x53')],'substatus':null,'substatusAt':moment()[_0xdf69('0x5a')](_0xdf69('0x54')),'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'});}else{return _0x5cd512;}}})[_0xdf69('0x12')](function(_0x3914bf){_0x1101ad[_0xdf69('0x5b')]=_0x3914bf[_0xdf69('0x43')]({'plain':!![]});_0x1101ad['interaction']['created']=_0x5980b1;return db['MailMessage']['create']({'body':_0x4f3370['body'][_0xdf69('0x2d')],'MailAccountId':_0x4f3370['account']['id'],'MailInteractionId':_0x3914bf['id'],'direction':'in','ContactId':_0x1101ad['contact']['id'],'messageId':_0x4f3370['body']['message'][_0xdf69('0x50')],'from':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')],'to':_0x4f3370['body'][_0xdf69('0x18')]['to'],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'Attachments':_0x4f3370[_0xdf69('0x2d')]['message'][_0xdf69('0x5c')],'originTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5d')],'originCc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5e')],'bcc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5f')],'ChatWebsiteId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x60')]||null,'originChannel':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x61')]||'Email','ChatOfflineMessageId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xdf69('0x62')],'as':_0xdf69('0x63')}]});})[_0xdf69('0x12')](function(_0x3aa055){_0x1101ad[_0xdf69('0x18')]=_0x3aa055;if(!_0x1101ad[_0xdf69('0x5b')][_0xdf69('0x64')]){return;}return db[_0xdf69('0x65')]['find']({'attributes':['id','name'],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x64')]}});})[_0xdf69('0x12')](function(_0x4659b5){if(_0x4659b5){_0x1101ad['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4659b5[_0xdf69('0x66')]+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x1101ad['interaction'][_0xdf69('0x68')]){return;}return db[_0xdf69('0x69')][_0xdf69('0x27')]({'attributes':['id',_0xdf69('0x66')],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x68')]}});})[_0xdf69('0x12')](function(_0x5b6a69){if(_0x5b6a69){_0x1101ad['applications'][_0xdf69('0x6a')]({'id':0x0,'priority':0x1,'app':_0xdf69('0x6b'),'appdata':_0x5b6a69['name']+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x6c')]||0x12c),'interval':_0xdf69('0x6d')});}return respondWithRpcPromise('Start',_0xdf69('0x6e'),_0x1101ad);})['then'](function(_0x4ba3a0){_0xdd919d(_0x4ba3a0);})['catch'](function(_0x33f057){_0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0x33f057[_0xdf69('0x18')]));});});}; \ No newline at end of file +var _0x277c=['attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','queueId','Start','startRouting','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','register','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetMailAccount','findAll','options','raw','where','attributes','limit','include','model','map','debug','catch','ShowMailAccount','MailAccount','then','smtp','setDataValue','smtpOptions','getSmtpOptions','body','mail','difference','keys','CmContact','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','Contacts','updatedAt','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','account','omit','applications','list','asc','autoclose','length','*,*,*,*','defaults','create','List\x20not\x20found','messageId','generate','attach','format','MailMessage','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','spread','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','get','created'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x277c,0x153));var _0xc277=function(_0x11e0a4,_0x20b367){_0x11e0a4=_0x11e0a4-0x0;var _0x42a95d=_0x277c[_0x11e0a4];return _0x42a95d;};'use strict';var _=require(_0xc277('0x0'));var moment=require('moment');var BPromise=require(_0xc277('0x1'));var rs=require(_0xc277('0x2'));var Redis=require(_0xc277('0x3'));var db=require(_0xc277('0x4'))['db'];var logger=require(_0xc277('0x5'))(_0xc277('0x6'));var config=require(_0xc277('0x7'));var jayson=require(_0xc277('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xc277('0x9')]=_['defaults'](config[_0xc277('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc277('0xa'))(new Redis(config[_0xc277('0x9')]));require('./mailAccount.socket')[_0xc277('0xb')](socket);function respondWithRpcPromise(_0x30886d,_0xfdf694,_0x1b1db0){return new BPromise(function(_0x3f766f,_0x1e4087){return client['request'](_0x30886d,_0x1b1db0)['then'](function(_0x30a5dc){logger[_0xc277('0xc')](_0xc277('0xd'),_0xfdf694,_0xc277('0xe'));logger['debug'](_0xc277('0xf'),_0xfdf694,'request\x20sent',JSON[_0xc277('0x10')](_0x30a5dc));if(_0x30a5dc[_0xc277('0x11')]){if(_0x30a5dc[_0xc277('0x11')][_0xc277('0x12')]===0x1f4){logger['error'](_0xc277('0xd'),_0xfdf694,_0x30a5dc[_0xc277('0x11')][_0xc277('0x13')]);return _0x1e4087(_0x30a5dc['error']['message']);}logger[_0xc277('0x11')]('MailAccount,\x20%s,\x20%s',_0xfdf694,_0x30a5dc[_0xc277('0x11')]['message']);return _0x3f766f(_0x30a5dc[_0xc277('0x11')][_0xc277('0x13')]);}else{logger[_0xc277('0xc')]('MailAccount,\x20%s,\x20%s',_0xfdf694,'request\x20sent');_0x3f766f(_0x30a5dc[_0xc277('0x14')]['message']);}})['catch'](function(_0x1e1a9b){logger[_0xc277('0x11')](_0xc277('0xd'),_0xfdf694,_0x1e1a9b);_0x1e4087(_0x1e1a9b);});});}exports[_0xc277('0x15')]=function(_0xe2b7c1){var _0x355eee=this;return new Promise(function(_0x391cc3,_0x4a7a79){return db['MailAccount'][_0xc277('0x16')]({'raw':_0xe2b7c1[_0xc277('0x17')]?_0xe2b7c1[_0xc277('0x17')][_0xc277('0x18')]===undefined?!![]:![]:!![],'where':_0xe2b7c1[_0xc277('0x17')]?_0xe2b7c1[_0xc277('0x17')][_0xc277('0x19')]||null:null,'attributes':_0xe2b7c1[_0xc277('0x17')]?_0xe2b7c1[_0xc277('0x17')][_0xc277('0x1a')]||null:null,'limit':_0xe2b7c1[_0xc277('0x17')]?_0xe2b7c1['options'][_0xc277('0x1b')]||null:null,'include':_0xe2b7c1[_0xc277('0x17')]?_0xe2b7c1['options'][_0xc277('0x1c')]?_['map'](_0xe2b7c1['options'][_0xc277('0x1c')],function(_0x57b03){return{'model':db[_0x57b03[_0xc277('0x1d')]],'as':_0x57b03['as'],'attributes':_0x57b03[_0xc277('0x1a')],'include':_0x57b03[_0xc277('0x1c')]?_[_0xc277('0x1e')](_0x57b03[_0xc277('0x1c')],function(_0x9ad1c5){return{'model':db[_0x9ad1c5[_0xc277('0x1d')]],'as':_0x9ad1c5['as'],'attributes':_0x9ad1c5[_0xc277('0x1a')],'include':_0x9ad1c5[_0xc277('0x1c')]?_['map'](_0x9ad1c5['include'],function(_0x31b6d4){return{'model':db[_0x31b6d4[_0xc277('0x1d')]],'as':_0x31b6d4['as'],'attributes':_0x31b6d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x388717){logger[_0xc277('0xc')](_0xc277('0x15'),_0xe2b7c1);logger[_0xc277('0x1f')](_0xc277('0x15'),_0xe2b7c1,JSON['stringify'](_0x388717));_0x391cc3(_0x388717);})[_0xc277('0x20')](function(_0x5edf7e){logger[_0xc277('0x11')](_0xc277('0x15'),_0x5edf7e[_0xc277('0x13')],_0xe2b7c1);_0x4a7a79(_0x355eee[_0xc277('0x11')](0x1f4,_0x5edf7e['message']));});});};exports[_0xc277('0x21')]=function(_0x5a7bb6){var _0x211379=this;return new Promise(function(_0x288e42,_0xbc1a66){return db[_0xc277('0x22')]['find']({'raw':_0x5a7bb6[_0xc277('0x17')]?_0x5a7bb6[_0xc277('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5a7bb6[_0xc277('0x17')]?_0x5a7bb6['options'][_0xc277('0x19')]||null:null,'attributes':_0x5a7bb6[_0xc277('0x17')]?_0x5a7bb6[_0xc277('0x17')][_0xc277('0x1a')]||null:null,'include':_0x5a7bb6[_0xc277('0x17')]?_0x5a7bb6[_0xc277('0x17')][_0xc277('0x1c')]?_[_0xc277('0x1e')](_0x5a7bb6[_0xc277('0x17')][_0xc277('0x1c')],function(_0xdc94a1){return{'model':db[_0xdc94a1['model']],'as':_0xdc94a1['as'],'attributes':_0xdc94a1[_0xc277('0x1a')],'include':_0xdc94a1[_0xc277('0x1c')]?_[_0xc277('0x1e')](_0xdc94a1['include'],function(_0x380e45){return{'model':db[_0x380e45[_0xc277('0x1d')]],'as':_0x380e45['as'],'attributes':_0x380e45[_0xc277('0x1a')],'include':_0x380e45[_0xc277('0x1c')]?_[_0xc277('0x1e')](_0x380e45['include'],function(_0x4de270){return{'model':db[_0x4de270[_0xc277('0x1d')]],'as':_0x4de270['as'],'attributes':_0x4de270['attributes']};}):[]};}):[]};}):[]:[]})[_0xc277('0x23')](function(_0x469863){if(_0x5a7bb6[_0xc277('0x17')][_0xc277('0x24')]===!![])_0x469863[_0xc277('0x25')](_0xc277('0x26'),_0x469863[_0xc277('0x27')]());logger[_0xc277('0xc')](_0xc277('0x21'),_0x5a7bb6);logger[_0xc277('0x1f')](_0xc277('0x21'),_0x5a7bb6,JSON['stringify'](_0x469863));_0x288e42(_0x469863);})[_0xc277('0x20')](function(_0x43d17){logger[_0xc277('0x11')]('ShowMailAccount',_0x43d17[_0xc277('0x13')],_0x5a7bb6);_0xbc1a66(_0x211379[_0xc277('0x11')](0x1f4,_0x43d17['message']));});});};exports['NotifyMailAccount']=function(_0x2d2e5f){var _0x2dcb88=this;return new Promise(function(_0x22c5b3,_0x1ca33a){var _0x114eec={'body':_0x2d2e5f[_0xc277('0x28')],'channel':_0xc277('0x29')};var _0x5cd9a8=_[_0xc277('0x2a')](_[_0xc277('0x2b')](db[_0xc277('0x2c')]['rawAttributes']),['createdAt','updatedAt','CompanyId','ListId']);var _0x25723a=![];if(_0x2d2e5f['body']['id']){delete _0x2d2e5f[_0xc277('0x28')]['id'];}if(_[_0xc277('0x2d')](_0x2d2e5f[_0xc277('0x28')]['from'])){return _0x1ca33a(_0x2dcb88[_0xc277('0x11')](0x1f4,_0xc277('0x2e')));}if(_[_0xc277('0x2d')](_0x2d2e5f[_0xc277('0x28')]['body'])||_0x2d2e5f[_0xc277('0x28')][_0xc277('0x28')]===''){return _0x1ca33a(_0x2dcb88['error'](0x1f4,_0xc277('0x2f')));}if(_[_0xc277('0x2d')](_0x2d2e5f[_0xc277('0x28')][_0xc277('0x30')])){return _0x1ca33a(_0x2dcb88[_0xc277('0x11')](0x1f4,_0xc277('0x31')+_0x5cd9a8));}if(!_[_0xc277('0x32')](_0x5cd9a8,_0x2d2e5f[_0xc277('0x28')][_0xc277('0x30')])){return _0x1ca33a(_0x2dcb88[_0xc277('0x11')](0x1f4,_0xc277('0x33')+_0x5cd9a8));}var _0x55e691={};_0x55e691[_0x2d2e5f[_0xc277('0x28')][_0xc277('0x30')]]=_0x2d2e5f[_0xc277('0x28')][_0xc277('0x34')];return db['MailAccount'][_0xc277('0x35')]({'where':{'id':_0x2d2e5f['account']['id']},'include':[{'model':db[_0xc277('0x36')],'as':_0xc277('0x37'),'include':[{'model':db[_0xc277('0x2c')],'as':_0xc277('0x38'),'where':_0x55e691,'limit':0x1,'order':[[_0xc277('0x39'),'DESC']]}]},{'model':db[_0xc277('0x3a')],'as':_0xc277('0x3b')},{'model':db[_0xc277('0x3c')],'as':_0xc277('0x3d'),'include':[{'model':db['CloudProvider'],'as':_0xc277('0x3e')}]}]})[_0xc277('0x23')](function(_0x150876){if(_0x150876&&_0x150876['List']){var _0x20c085=_0x150876['get']({'plain':!![]});_0x114eec[_0xc277('0x3f')]=_[_0xc277('0x40')](_0x20c085,[_0xc277('0x3b'),_0xc277('0x37')]);_0x114eec[_0xc277('0x3f')][_0xc277('0x26')]=_0x150876[_0xc277('0x27')]();_0x114eec[_0xc277('0x41')]=_0x20c085[_0xc277('0x3b')];_0x114eec[_0xc277('0x42')]=_0x20c085[_0xc277('0x37')];_0x114eec[_0xc277('0x41')]=_['orderBy'](_0x114eec[_0xc277('0x41')],['priority'],[_0xc277('0x43')]);if(_0x114eec[_0xc277('0x3f')]&&_0x114eec[_0xc277('0x3f')][_0xc277('0x44')]){_0x114eec[_0xc277('0x41')]['push']({'id':0x0,'priority':_0x114eec[_0xc277('0x41')][_0xc277('0x45')]+0x1,'app':'close','appdata':'autoclose','interval':_0xc277('0x46')});}if(_0x114eec['account'][_0xc277('0x3b')]){delete _0x114eec[_0xc277('0x3f')][_0xc277('0x3b')];}if(_0x114eec[_0xc277('0x3f')][_0xc277('0x37')]){delete _0x114eec['account']['List'];}if(_0x20c085[_0xc277('0x37')][_0xc277('0x38')][_0xc277('0x45')]){return _0x20c085['List'][_0xc277('0x38')][0x0];}var _0x5db8f6=_[_0xc277('0x47')](_0x2d2e5f[_0xc277('0x28')],{'firstName':_0x2d2e5f[_0xc277('0x28')]['from'],'ListId':_0x20c085['ListId']});_0x5db8f6[_0x2d2e5f['body'][_0xc277('0x30')]]=_0x2d2e5f[_0xc277('0x28')]['from'];return db['CmContact'][_0xc277('0x48')](_0x5db8f6);}else{throw new Error(_0xc277('0x49'));}})[_0xc277('0x23')](function(_0x14582e){_0x114eec['contact']=_0x14582e;if(_0x14582e){if(!_0x2d2e5f['body']['message'][_0xc277('0x4a')]){_0x2d2e5f[_0xc277('0x28')]['message'][_0xc277('0x4a')]=rs[_0xc277('0x4b')]()+'\x20'+_0x2d2e5f['body']['message'][_0xc277('0x34')];}var _0x2f64ff={'ContactId':_0x14582e['id'],'MailAccountId':_0x2d2e5f[_0xc277('0x3f')]['id'],'inReplyTo':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x4a')],'to':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')]['from'],'cc':_0x2d2e5f[_0xc277('0x28')]['message']['cc'],'subject':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')]['subject'],'attach':_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x4c')],'lastMsgAt':moment()[_0xc277('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0xc277('0x35')]({'where':{'closed':![],'MailAccountId':_0x2d2e5f[_0xc277('0x3f')]['id']},'include':[{'model':db[_0xc277('0x4e')],'as':_0xc277('0x4f'),'attributes':[_0xc277('0x4a')],'where':{'messageId':_0x2d2e5f[_0xc277('0x28')]['message'][_0xc277('0x50')]}}]})[_0xc277('0x23')](function(_0x3fcf92){if(_0x3fcf92){return[_0x3fcf92,![]];}return db[_0xc277('0x51')][_0xc277('0x48')](_0x2f64ff)[_0xc277('0x23')](function(_0x427c6b){return[_0x427c6b,!![]];});});}else{throw new Error(_0xc277('0x52'));}})[_0xc277('0x53')](function(_0x152032,_0x24d9ab){if(_0x152032){_0x25723a=_0x24d9ab;if(!_0x24d9ab){return _0x152032['update']({'inReplyTo':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x4a')],'to':_0x2d2e5f[_0xc277('0x28')]['message'][_0xc277('0x34')],'cc':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')]['cc'],'subject':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x54')],'attach':_0x152032['attach']?_0x152032[_0xc277('0x4c')]:_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x4c')],'substatus':null,'substatusAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xc277('0x4d')](_0xc277('0x55')),'lastMsgDirection':'in'});}else{return _0x152032;}}})['then'](function(_0xaad68d){_0x114eec[_0xc277('0x56')]=_0xaad68d[_0xc277('0x57')]({'plain':!![]});_0x114eec[_0xc277('0x56')][_0xc277('0x58')]=_0x25723a;return db[_0xc277('0x4e')][_0xc277('0x48')]({'body':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x28')],'MailAccountId':_0x2d2e5f[_0xc277('0x3f')]['id'],'MailInteractionId':_0xaad68d['id'],'direction':'in','ContactId':_0x114eec['contact']['id'],'messageId':_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x4a')],'from':_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x34')],'to':_0x2d2e5f[_0xc277('0x28')]['message']['to'],'cc':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')]['cc'],'subject':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')]['subject'],'attach':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x4c')],'Attachments':_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x59')],'originTo':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x5a')],'originCc':_0x2d2e5f['body'][_0xc277('0x13')][_0xc277('0x5b')],'bcc':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x5c')],'ChatWebsiteId':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x5d')]||null,'originChannel':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x5e')]||_0xc277('0x5f'),'ChatOfflineMessageId':_0x2d2e5f[_0xc277('0x28')][_0xc277('0x13')][_0xc277('0x60')]||null},{'include':[{'model':db['Attachment'],'as':_0xc277('0x61')}]});})['then'](function(_0x4c2a2a){_0x114eec[_0xc277('0x13')]=_0x4c2a2a;if(!_0x114eec['interaction'][_0xc277('0x62')]){return;}return db[_0xc277('0x63')][_0xc277('0x35')]({'attributes':['id','name'],'where':{'id':_0x114eec[_0xc277('0x56')][_0xc277('0x62')]}});})[_0xc277('0x23')](function(_0x3ae5f4){if(_0x3ae5f4){_0x114eec[_0xc277('0x41')][_0xc277('0x64')]({'id':0x0,'priority':0x0,'app':_0xc277('0x65'),'appdata':_0x3ae5f4[_0xc277('0x66')]+','+(_0x114eec[_0xc277('0x3f')][_0xc277('0x67')]||0xa),'interval':_0xc277('0x46')});}if(!_0x114eec[_0xc277('0x56')][_0xc277('0x68')]){return;}return db['MailQueue'][_0xc277('0x35')]({'attributes':['id',_0xc277('0x66')],'where':{'id':_0x114eec['interaction'][_0xc277('0x68')]}});})[_0xc277('0x23')](function(_0x30db50){if(_0x30db50){_0x114eec[_0xc277('0x41')][_0xc277('0x64')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x30db50['name']+','+(_0x114eec[_0xc277('0x3f')]['waitForTheAssignedQueue']||0x12c),'interval':_0xc277('0x46')});}return respondWithRpcPromise(_0xc277('0x69'),_0xc277('0x6a'),_0x114eec);})['then'](function(_0x80f980){_0x22c5b3(_0x80f980);})[_0xc277('0x20')](function(_0x4399a6){_0x1ca33a(_0x2dcb88[_0xc277('0x11')](0x1f4,_0x4399a6[_0xc277('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 2c58c33..3cd2b84 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 _0x8e6d=['emit','register','./mailAccount.events','save','remove','update'];(function(_0x23d9fd,_0x5e2465){var _0x9974e8=function(_0x2e9692){while(--_0x2e9692){_0x23d9fd['push'](_0x23d9fd['shift']());}};_0x9974e8(++_0x5e2465);}(_0x8e6d,0x92));var _0xd8e6=function(_0x35ac08,_0x4935d4){_0x35ac08=_0x35ac08-0x0;var _0x421c22=_0x8e6d[_0x35ac08];return _0x421c22;};'use strict';var MailAccountEvents=require(_0xd8e6('0x0'));var events=[_0xd8e6('0x1'),_0xd8e6('0x2'),_0xd8e6('0x3')];function createListener(_0x1819f0,_0x19f031){return function(_0x39a44d){_0x19f031[_0xd8e6('0x4')](_0x1819f0,_0x39a44d);};}function removeListener(_0x3521ca,_0x504881){return function(){MailAccountEvents['removeListener'](_0x3521ca,_0x504881);};}exports[_0xd8e6('0x5')]=function(_0x55e2d1){for(var _0x3f6bbe=0x0,_0x22be37=events['length'];_0x3f6bbe<_0x22be37;_0x3f6bbe++){var _0x16dbd4=events[_0x3f6bbe];var _0x33fdb2=createListener('mailAccount:'+_0x16dbd4,_0x55e2d1);MailAccountEvents['on'](_0x16dbd4,_0x33fdb2);}}; \ No newline at end of file +var _0x1305=['mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x474357,_0x5dcd57){var _0x589fa4=function(_0x10070c){while(--_0x10070c){_0x474357['push'](_0x474357['shift']());}};_0x589fa4(++_0x5dcd57);}(_0x1305,0x172));var _0x5130=function(_0x470cdb,_0x409949){_0x470cdb=_0x470cdb-0x0;var _0x8181fd=_0x1305[_0x470cdb];return _0x8181fd;};'use strict';var MailAccountEvents=require(_0x5130('0x0'));var events=[_0x5130('0x1'),_0x5130('0x2'),_0x5130('0x3')];function createListener(_0x63c71,_0x20a655){return function(_0x435ba4){_0x20a655[_0x5130('0x4')](_0x63c71,_0x435ba4);};}function removeListener(_0xc8f376,_0x50a5fe){return function(){MailAccountEvents[_0x5130('0x5')](_0xc8f376,_0x50a5fe);};}exports[_0x5130('0x6')]=function(_0xf832f8){for(var _0x5a2618=0x0,_0x1e2779=events[_0x5130('0x7')];_0x5a2618<_0x1e2779;_0x5a2618++){var _0x49a883=events[_0x5a2618];var _0x43393d=createListener(_0x5130('0x8')+_0x49a883,_0xf832f8);MailAccountEvents['on'](_0x49a883,_0x43393d);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index ad88bca..181e0ea 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 _0x312c=['destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete'];(function(_0x4a0f76,_0x420532){var _0x147c09=function(_0x556662){while(--_0x556662){_0x4a0f76['push'](_0x4a0f76['shift']());}};_0x147c09(++_0x420532);}(_0x312c,0x1e1));var _0xc312=function(_0x413354,_0x4805e0){_0x413354=_0x413354-0x0;var _0x421f70=_0x312c[_0x413354];return _0x421f70;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xc312('0x0'));var express=require(_0xc312('0x1'));var router=express[_0xc312('0x2')]();var fs_extra=require(_0xc312('0x3'));var auth=require(_0xc312('0x4'));var interaction=require(_0xc312('0x5'));var config=require(_0xc312('0x6'));var controller=require(_0xc312('0x7'));router[_0xc312('0x8')](_0xc312('0x9'),auth[_0xc312('0xa')](),controller['show']);router[_0xc312('0xb')](_0xc312('0x9'),auth['isAuthenticated'](),controller[_0xc312('0xc')]);router[_0xc312('0xd')](_0xc312('0x9'),auth[_0xc312('0xa')](),controller[_0xc312('0xe')]);module['exports']=router; \ No newline at end of file +var _0x62ff=['isAuthenticated','show','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailApplication.controller','/:id'];(function(_0x1fa760,_0x1bf063){var _0xd8eda1=function(_0x4a21d6){while(--_0x4a21d6){_0x1fa760['push'](_0x1fa760['shift']());}};_0xd8eda1(++_0x1bf063);}(_0x62ff,0x1cb));var _0xf62f=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x62ff[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0xf62f('0x0'));var util=require(_0xf62f('0x1'));var path=require(_0xf62f('0x2'));var timeout=require(_0xf62f('0x3'));var express=require(_0xf62f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf62f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf62f('0x6'));var controller=require(_0xf62f('0x7'));router['get'](_0xf62f('0x8'),auth[_0xf62f('0x9')](),controller[_0xf62f('0xa')]);router['put'](_0xf62f('0x8'),auth['isAuthenticated'](),controller[_0xf62f('0xb')]);router['delete'](_0xf62f('0x8'),auth[_0xf62f('0x9')](),controller[_0xf62f('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index fb8a8eb..0237c13 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 _0x8aaf=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8aaf,0x19c));var _0xf8aa=function(_0x5cd5cc,_0x1b7a0b){_0x5cd5cc=_0x5cd5cc-0x0;var _0x463b72=_0x8aaf[_0x5cd5cc];return _0x463b72;};'use strict';var Sequelize=require(_0xf8aa('0x0'));module[_0xf8aa('0x1')]={'priority':{'type':Sequelize[_0xf8aa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xf8aa('0x3')],'allowNull':![],'defaultValue':_0xf8aa('0x4')},'appdata':{'type':Sequelize[_0xf8aa('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf8aa('0x3')],'defaultValue':_0xf8aa('0x6')}}; \ No newline at end of file +var _0x1938=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x27b39d,_0x178ff8){var _0x54a564=function(_0x49697e){while(--_0x49697e){_0x27b39d['push'](_0x27b39d['shift']());}};_0x54a564(++_0x178ff8);}(_0x1938,0x139));var _0x8193=function(_0x22e2ac,_0x25ef3e){_0x22e2ac=_0x22e2ac-0x0;var _0x44322=_0x1938[_0x22e2ac];return _0x44322;};'use strict';var Sequelize=require(_0x8193('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8193('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8193('0x2')],'allowNull':![],'defaultValue':_0x8193('0x3')},'appdata':{'type':Sequelize[_0x8193('0x4')]()},'description':{'type':Sequelize[_0x8193('0x2')]},'interval':{'type':Sequelize[_0x8193('0x2')],'defaultValue':_0x8193('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 380e78b..7d6ec12 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 _0xedd9=['query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','show','params','keys','MailApplication','rawAttributes'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xedd9,0xfc));var _0x9edd=function(_0x115caf,_0x437bbb){_0x115caf=_0x115caf-0x0;var _0x770e3e=_0xedd9[_0x115caf];return _0x770e3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={'raw':!![],'where':{'id':_0x52746a[_0x9edd('0x27')]['id']}},_0x2ae8dd={};_0x2ae8dd['model']=_[_0x9edd('0x28')](db[_0x9edd('0x29')][_0x9edd('0x2a')]);_0x2ae8dd[_0x9edd('0x2b')]=_[_0x9edd('0x28')](_0x52746a[_0x9edd('0x2b')]);_0x2ae8dd[_0x9edd('0x2c')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],_0x2ae8dd[_0x9edd('0x2b')]);_0x28cfae[_0x9edd('0x2f')]=_[_0x9edd('0x2d')](_0x2ae8dd[_0x9edd('0x2e')],qs[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2b')]['fields']));_0x28cfae[_0x9edd('0x2f')]=_0x28cfae[_0x9edd('0x2f')][_0x9edd('0x31')]?_0x28cfae['attributes']:_0x2ae8dd[_0x9edd('0x2e')];if(_0x52746a[_0x9edd('0x2b')][_0x9edd('0x32')]){_0x28cfae[_0x9edd('0x33')]=[{'all':!![]}];}_0x28cfae=_[_0x9edd('0x34')]({},_0x28cfae,_0x52746a[_0x9edd('0x35')]);return db[_0x9edd('0x29')][_0x9edd('0x36')](_0x28cfae)[_0x9edd('0x21')](handleEntityNotFound(_0x238b22,null))[_0x9edd('0x21')](respondWithResult(_0x238b22,null))[_0x9edd('0x37')](handleError(_0x238b22,null));};exports[_0x9edd('0x38')]=function(_0x27eb7e,_0x14f780){if(_0x27eb7e['body']['id']){delete _0x27eb7e[_0x9edd('0x39')]['id'];}return db['MailApplication'][_0x9edd('0x36')]({'where':{'id':_0x27eb7e[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x14f780,null))[_0x9edd('0x21')](saveUpdates(_0x27eb7e[_0x9edd('0x39')],null))['then'](respondWithResult(_0x14f780,null))[_0x9edd('0x37')](handleError(_0x14f780,null));};exports[_0x9edd('0x3a')]=function(_0x2b3469,_0x38e9be){return db[_0x9edd('0x29')][_0x9edd('0x36')]({'where':{'id':_0x2b3469[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x38e9be,null))[_0x9edd('0x21')](removeEntity(_0x38e9be,null))[_0x9edd('0x37')](handleError(_0x38e9be,null));}; \ No newline at end of file +var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x7e0c7a,_0x2e0fdb){var _0x53c44b=function(_0x1411ca){while(--_0x1411ca){_0x7e0c7a['push'](_0x7e0c7a['shift']());}};_0x53c44b(++_0x2e0fdb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xcb91[_0x344adc];return _0x4014b2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 54d3dc6..4dc59aa 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 _0x3585=['mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailApplication.attributes','define','MailApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3585,0x10d));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5358('0x0'));var logger=require(_0x5358('0x1'))(_0x5358('0x2'));var moment=require(_0x5358('0x3'));var BPromise=require(_0x5358('0x4'));var rp=require(_0x5358('0x5'));var fs=require('fs');var path=require(_0x5358('0x6'));var rimraf=require('rimraf');var config=require(_0x5358('0x7'));var attributes=require(_0x5358('0x8'));module['exports']=function(_0x481a78,_0x147758){return _0x481a78[_0x5358('0x9')](_0x5358('0xa'),attributes,{'tableName':_0x5358('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5358('0xc'),'collate':_0x5358('0xd')});}; \ No newline at end of file +var _0x8093=['util','../../config/logger','moment','bluebird','path','rimraf','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash'];(function(_0xeff2c3,_0x3a5a82){var _0x2cade6=function(_0x5a26a1){while(--_0x5a26a1){_0xeff2c3['push'](_0xeff2c3['shift']());}};_0x2cade6(++_0x3a5a82);}(_0x8093,0x1df));var _0x3809=function(_0x214642,_0xc9fac6){_0x214642=_0x214642-0x0;var _0x4ec937=_0x8093[_0x214642];return _0x4ec937;};'use strict';var _=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var logger=require(_0x3809('0x2'))('api');var moment=require(_0x3809('0x3'));var BPromise=require(_0x3809('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3809('0x5'));var rimraf=require(_0x3809('0x6'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x3809('0x7')]=function(_0x57745c,_0x298591){return _0x57745c[_0x3809('0x8')](_0x3809('0x9'),attributes,{'tableName':_0x3809('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3809('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d2d5e50..130b2da 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 _0x3d9f=['debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','MailApplication','update','body','options','raw','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s'];(function(_0x19c386,_0x5e4b53){var _0x4daf50=function(_0x44728e){while(--_0x44728e){_0x19c386['push'](_0x19c386['shift']());}};_0x4daf50(++_0x5e4b53);}(_0x3d9f,0x8c));var _0xf3d9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3d9f[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0xf3d9('0x0'));var util=require(_0xf3d9('0x1'));var moment=require(_0xf3d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xf3d9('0x3'));var fs=require('fs');var Redis=require(_0xf3d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3d9('0x5'));var logger=require(_0xf3d9('0x6'))(_0xf3d9('0x7'));var config=require(_0xf3d9('0x8'));var jayson=require(_0xf3d9('0x9'));var client=jayson[_0xf3d9('0xa')][_0xf3d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ef2d7,_0x2ab745,_0x105750){return new BPromise(function(_0x229a7d,_0x38def8){return client[_0xf3d9('0xc')](_0x3ef2d7,_0x105750)[_0xf3d9('0xd')](function(_0x5f5c19){logger['info'](_0xf3d9('0xe'),_0x2ab745,'request\x20sent');logger[_0xf3d9('0xf')](_0xf3d9('0x10'),_0x2ab745,_0xf3d9('0x11'),JSON[_0xf3d9('0x12')](_0x5f5c19));if(_0x5f5c19[_0xf3d9('0x13')]){if(_0x5f5c19[_0xf3d9('0x13')][_0xf3d9('0x14')]===0x1f4){logger[_0xf3d9('0x13')](_0xf3d9('0xe'),_0x2ab745,_0x5f5c19['error'][_0xf3d9('0x15')]);return _0x38def8(_0x5f5c19[_0xf3d9('0x13')][_0xf3d9('0x15')]);}logger[_0xf3d9('0x13')](_0xf3d9('0xe'),_0x2ab745,_0x5f5c19[_0xf3d9('0x13')][_0xf3d9('0x15')]);return _0x229a7d(_0x5f5c19[_0xf3d9('0x13')]['message']);}else{logger[_0xf3d9('0x16')](_0xf3d9('0xe'),_0x2ab745,_0xf3d9('0x11'));_0x229a7d(_0x5f5c19['result'][_0xf3d9('0x15')]);}})[_0xf3d9('0x17')](function(_0xd698b2){logger[_0xf3d9('0x13')]('MailApplication,\x20%s,\x20%s',_0x2ab745,_0xd698b2);_0x38def8(_0xd698b2);});});}exports['UpdateMailApplication']=function(_0x19c426){var _0x380448=this;return new Promise(function(_0x462d67,_0x1e759d){return db[_0xf3d9('0x18')][_0xf3d9('0x19')](_0x19c426[_0xf3d9('0x1a')],{'raw':_0x19c426[_0xf3d9('0x1b')]?_0x19c426['options'][_0xf3d9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19c426[_0xf3d9('0x1b')]?_0x19c426[_0xf3d9('0x1b')]['where']||null:null,'attributes':_0x19c426[_0xf3d9('0x1b')]?_0x19c426[_0xf3d9('0x1b')][_0xf3d9('0x1d')]||null:null,'limit':_0x19c426[_0xf3d9('0x1b')]?_0x19c426[_0xf3d9('0x1b')][_0xf3d9('0x1e')]||null:null})[_0xf3d9('0xd')](function(_0xf123b3){logger[_0xf3d9('0x16')]('UpdateMailApplication',_0x19c426);logger['debug']('UpdateMailApplication',_0x19c426,JSON['stringify'](_0xf123b3));_0x462d67(_0xf123b3);})['catch'](function(_0x195a8b){logger[_0xf3d9('0x13')]('UpdateMailApplication',_0x195a8b['message'],_0x19c426);_0x1e759d(_0x380448[_0xf3d9('0x13')](0x1f4,_0x195a8b[_0xf3d9('0x15')]));});});}; \ No newline at end of file +var _0x8d23=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','code','error','MailApplication,\x20%s,\x20%s','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','stringify','util','moment','bluebird'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8d23,0x133));var _0x38d2=function(_0x357ae0,_0x3a899b){_0x357ae0=_0x357ae0-0x0;var _0x51ce94=_0x8d23[_0x357ae0];return _0x51ce94;};'use strict';var _=require('lodash');var util=require(_0x38d2('0x0'));var moment=require(_0x38d2('0x1'));var BPromise=require(_0x38d2('0x2'));var rs=require(_0x38d2('0x3'));var fs=require('fs');var Redis=require(_0x38d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38d2('0x5'));var logger=require(_0x38d2('0x6'))(_0x38d2('0x7'));var config=require(_0x38d2('0x8'));var jayson=require(_0x38d2('0x9'));var client=jayson['client'][_0x38d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21cf9a,_0x2e7391,_0x412b7e){return new BPromise(function(_0x5317a6,_0x19cf29){return client[_0x38d2('0xb')](_0x21cf9a,_0x412b7e)[_0x38d2('0xc')](function(_0x54372a){logger[_0x38d2('0xd')]('MailApplication,\x20%s,\x20%s',_0x2e7391,_0x38d2('0xe'));logger[_0x38d2('0xf')](_0x38d2('0x10'),_0x2e7391,'request\x20sent',JSON['stringify'](_0x54372a));if(_0x54372a['error']){if(_0x54372a['error'][_0x38d2('0x11')]===0x1f4){logger[_0x38d2('0x12')](_0x38d2('0x13'),_0x2e7391,_0x54372a[_0x38d2('0x12')][_0x38d2('0x14')]);return _0x19cf29(_0x54372a['error']['message']);}logger[_0x38d2('0x12')]('MailApplication,\x20%s,\x20%s',_0x2e7391,_0x54372a[_0x38d2('0x12')]['message']);return _0x5317a6(_0x54372a[_0x38d2('0x12')][_0x38d2('0x14')]);}else{logger[_0x38d2('0xd')](_0x38d2('0x13'),_0x2e7391,'request\x20sent');_0x5317a6(_0x54372a['result']['message']);}})[_0x38d2('0x15')](function(_0x2bc86c){logger['error'](_0x38d2('0x13'),_0x2e7391,_0x2bc86c);_0x19cf29(_0x2bc86c);});});}exports[_0x38d2('0x16')]=function(_0x46e87b){var _0x79f3dd=this;return new Promise(function(_0x3041b7,_0x97a9c8){return db[_0x38d2('0x17')][_0x38d2('0x18')](_0x46e87b[_0x38d2('0x19')],{'raw':_0x46e87b[_0x38d2('0x1a')]?_0x46e87b[_0x38d2('0x1a')][_0x38d2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e87b['options']?_0x46e87b['options'][_0x38d2('0x1c')]||null:null,'attributes':_0x46e87b[_0x38d2('0x1a')]?_0x46e87b[_0x38d2('0x1a')]['attributes']||null:null,'limit':_0x46e87b[_0x38d2('0x1a')]?_0x46e87b[_0x38d2('0x1a')][_0x38d2('0x1d')]||null:null})[_0x38d2('0xc')](function(_0x47e0e5){logger[_0x38d2('0xd')]('UpdateMailApplication',_0x46e87b);logger['debug'](_0x38d2('0x16'),_0x46e87b,JSON[_0x38d2('0x1e')](_0x47e0e5));_0x3041b7(_0x47e0e5);})[_0x38d2('0x15')](function(_0x1b6a8f){logger[_0x38d2('0x12')](_0x38d2('0x16'),_0x1b6a8f[_0x38d2('0x14')],_0x46e87b);_0x97a9c8(_0x79f3dd[_0x38d2('0x12')](0x1f4,_0x1b6a8f[_0x38d2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 03c524b..7b113f5 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 _0xbcfa=['addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','removeTags','exports','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xbcfa,0xb1));var _0xabcf=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xbcfa[_0x49b207];return _0x2dc8fa;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xabcf('0x0'));var interaction=require(_0xabcf('0x1'));var controller=require(_0xabcf('0x2'));router[_0xabcf('0x3')]('/',auth[_0xabcf('0x4')](),controller['index']);router[_0xabcf('0x3')]('/describe',auth[_0xabcf('0x4')](),controller['describe']);router[_0xabcf('0x3')](_0xabcf('0x5'),auth[_0xabcf('0x4')](),controller['show']);router[_0xabcf('0x3')](_0xabcf('0x6'),auth['isAuthenticated'](),controller[_0xabcf('0x7')]);router[_0xabcf('0x3')](_0xabcf('0x8'),auth[_0xabcf('0x4')](),controller['download']);router[_0xabcf('0x9')]('/',auth[_0xabcf('0x4')](),controller[_0xabcf('0xa')]);router[_0xabcf('0x9')](_0xabcf('0x6'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0xabcf('0xb'),auth[_0xabcf('0x4')](),interaction[_0xabcf('0xc')](_0xabcf('0xd'),_0xabcf('0xe')),controller[_0xabcf('0xf')]);router[_0xabcf('0x10')]('/:id',auth[_0xabcf('0x4')](),interaction[_0xabcf('0xc')](_0xabcf('0xd'),_0xabcf('0x11')),controller[_0xabcf('0x12')]);router['delete'](_0xabcf('0x5'),auth[_0xabcf('0x4')](),interaction['tracked']('mail',_0xabcf('0x13')),controller[_0xabcf('0x14')]);router[_0xabcf('0x15')]('/:id/tags',auth[_0xabcf('0x4')](),controller[_0xabcf('0x16')]);module[_0xabcf('0x17')]=router; \ No newline at end of file +var _0xfdae=['/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','/:id','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','Router','../../components/auth/service','../../components/interaction/service','index','describe','get','isAuthenticated','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage'];(function(_0xb639a3,_0x57b5c9){var _0x4ff7ed=function(_0x5039f3){while(--_0x5039f3){_0xb639a3['push'](_0xb639a3['shift']());}};_0x4ff7ed(++_0x57b5c9);}(_0xfdae,0x1d7));var _0xefda=function(_0x94db7d,_0x351cfc){_0x94db7d=_0x94db7d-0x0;var _0x1ed377=_0xfdae[_0x94db7d];return _0x1ed377;};'use strict';var express=require('express');var router=express[_0xefda('0x0')]();var auth=require(_0xefda('0x1'));var interaction=require(_0xefda('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xefda('0x3')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xefda('0x4')]);router[_0xefda('0x5')]('/:id',auth[_0xefda('0x6')](),controller[_0xefda('0x7')]);router[_0xefda('0x5')](_0xefda('0x8'),auth[_0xefda('0x6')](),controller[_0xefda('0x9')]);router[_0xefda('0x5')](_0xefda('0xa'),auth['isAuthenticated'](),controller[_0xefda('0xb')]);router[_0xefda('0xc')]('/',auth[_0xefda('0x6')](),controller[_0xefda('0xd')]);router[_0xefda('0xc')](_0xefda('0x8'),auth[_0xefda('0x6')](),controller[_0xefda('0xe')]);router['post'](_0xefda('0xf'),auth[_0xefda('0x6')](),interaction[_0xefda('0x10')](_0xefda('0x11'),_0xefda('0x12')),controller[_0xefda('0x13')]);router[_0xefda('0x14')](_0xefda('0x15'),auth[_0xefda('0x6')](),interaction[_0xefda('0x10')](_0xefda('0x11'),_0xefda('0x16')),controller[_0xefda('0x17')]);router[_0xefda('0x18')](_0xefda('0x15'),auth[_0xefda('0x6')](),interaction[_0xefda('0x10')](_0xefda('0x11'),_0xefda('0x19')),controller['destroy']);router['delete'](_0xefda('0xf'),auth['isAuthenticated'](),controller[_0xefda('0x1a')]);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 3469546..ea20ebb 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 _0xc464=['DATE','STRING','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0x2e2b2e,_0x41347b){var _0x56b500=function(_0x1285d0){while(--_0x1285d0){_0x2e2b2e['push'](_0x2e2b2e['shift']());}};_0x56b500(++_0x41347b);}(_0xc464,0x11c));var _0x4c46=function(_0x24c3e3,_0x33e9fc){_0x24c3e3=_0x24c3e3-0x0;var _0xb499cc=_0xc464[_0x24c3e3];return _0xb499cc;};'use strict';var Sequelize=require(_0x4c46('0x0'));var iconv=require(_0x4c46('0x1'));module[_0x4c46('0x2')]={'closed':{'type':Sequelize[_0x4c46('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c46('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4c46('0x5')]},'thirdDisposition':{'type':Sequelize[_0x4c46('0x5')]},'note':{'type':Sequelize[_0x4c46('0x5')]},'inReplyTo':{'type':Sequelize[_0x4c46('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x4c46('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4c46('0x4')]},'substatus':{'type':Sequelize[_0x4c46('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x4c46('0x6')]('in',_0x4c46('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4c46('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4c46('0x6')]('in',_0x4c46('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4c46('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6ea5=['BOOLEAN','DATE','STRING','long','TEXT','ENUM','out','INTEGER','sequelize'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0x6ea5,0x74));var _0x56ea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ea5[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x56ea('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x56ea('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x56ea('0x2')]},'disposition':{'type':Sequelize[_0x56ea('0x3')]},'secondDisposition':{'type':Sequelize[_0x56ea('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x56ea('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x56ea('0x3')]},'cc':{'type':Sequelize['TEXT'](_0x56ea('0x4'))},'subject':{'type':Sequelize[_0x56ea('0x5')]()},'attach':{'type':Sequelize[_0x56ea('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x56ea('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x56ea('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x56ea('0x6')]('in',_0x56ea('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x56ea('0x6')]('in',_0x56ea('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x56ea('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x56ea('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index dcdcd2a..6717a0d 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 _0xce8f=['MailMessage','ids','omit','findOne','filters','hasOwnProperty','nolimit','sort','where','pick','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','inlineCss','true','rows','addTags','spread','color','emit','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','push','Attachment','Attachments','from','bcc','subject','mkdirSync','each','Messages','decode','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','util','lodash','juice','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','destroy','then','end','error','stack','name','index','map','MailInteraction','rawAttributes','fieldName','type','getOptions','mail','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','create','body','update','find','catch','describe'];(function(_0x11268b,_0x14acf0){var _0x2118c6=function(_0x4d5d48){while(--_0x4d5d48){_0x11268b['push'](_0x11268b['shift']());}};_0x2118c6(++_0x14acf0);}(_0xce8f,0x10a));var _0xfce8=function(_0x235cea,_0x4c3504){_0x235cea=_0x235cea-0x0;var _0x15ee93=_0xce8f[_0x235cea];return _0x15ee93;};'use strict';var emlformat=require(_0xfce8('0x0'));var rimraf=require(_0xfce8('0x1'));var zipdir=require(_0xfce8('0x2'));var moment=require(_0xfce8('0x3'));var BPromise=require(_0xfce8('0x4'));var util=require(_0xfce8('0x5'));var path=require('path');var fs=require('fs');var _=require(_0xfce8('0x6'));var juice=require(_0xfce8('0x7'));var Redis=require('ioredis');var interaction=require(_0xfce8('0x8'));var qs=require(_0xfce8('0x9'));var logger=require(_0xfce8('0xa'))(_0xfce8('0xb'));var config=require(_0xfce8('0xc'));var db=require(_0xfce8('0xd'))['db'];var htmlEntities=require(_0xfce8('0xe'));config[_0xfce8('0xf')]=_[_0xfce8('0x10')](config[_0xfce8('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xfce8('0x11'))(new Redis(config[_0xfce8('0xf')]));require(_0xfce8('0x12'))[_0xfce8('0x13')](socket);function respondWithStatusCode(_0x4839c4,_0x8b00ba){_0x8b00ba=_0x8b00ba||0xcc;return function(_0x149591){if(_0x149591){return _0x4839c4[_0xfce8('0x14')](_0x8b00ba);}return _0x4839c4['status'](_0x8b00ba)['end']();};}function respondWithResult(_0x203346,_0x1556cb){_0x1556cb=_0x1556cb||0xc8;return function(_0x470d59){if(_0x470d59){return _0x203346[_0xfce8('0x15')](_0x1556cb)[_0xfce8('0x16')](_0x470d59);}};}function respondWithFilteredResult(_0x5476ee,_0x247cd8){return function(_0x2293a9){if(_0x2293a9){var _0x1687bb=typeof _0x247cd8[_0xfce8('0x17')]===_0xfce8('0x18')&&typeof _0x247cd8[_0xfce8('0x19')]==='undefined';var _0x387bf7=_0x2293a9[_0xfce8('0x1a')];var _0x38805d=_0x1687bb?0x0:_0x247cd8[_0xfce8('0x17')];var _0x29c492=_0x1687bb?_0x2293a9['count']:_0x247cd8['offset']+_0x247cd8[_0xfce8('0x19')];var _0x1a5773;if(_0x29c492>=_0x387bf7){_0x29c492=_0x387bf7;_0x1a5773=0xc8;}else{_0x1a5773=0xce;}_0x5476ee[_0xfce8('0x15')](_0x1a5773);return _0x5476ee['set'](_0xfce8('0x1b'),_0x38805d+'-'+_0x29c492+'/'+_0x387bf7)[_0xfce8('0x16')](_0x2293a9);}return null;};}function saveUpdates(_0x594efd){return function(_0x18fc7d){if(_0x18fc7d){return _0x18fc7d['update'](_0x594efd)['then'](function(_0x521fef){return _0x521fef;});}return null;};}function removeEntity(_0x4f7e72){return function(_0x4740e9){if(_0x4740e9){return _0x4740e9[_0xfce8('0x1c')]()[_0xfce8('0x1d')](function(){_0x4f7e72[_0xfce8('0x15')](0xcc)[_0xfce8('0x1e')]();});}};}function handleEntityNotFound(_0x137c84){return function(_0x1f460f){if(!_0x1f460f){_0x137c84[_0xfce8('0x14')](0x194);}return _0x1f460f;};}function handleError(_0x421e0b,_0x12a1a7){_0x12a1a7=_0x12a1a7||0x1f4;return function(_0x5827dc){logger[_0xfce8('0x1f')](_0x5827dc[_0xfce8('0x20')]);if(_0x5827dc['name']){delete _0x5827dc[_0xfce8('0x21')];}_0x421e0b[_0xfce8('0x15')](_0x12a1a7)['send'](_0x5827dc);};}exports[_0xfce8('0x22')]=function(_0x3472b0,_0x49a078){var _0x3bc90d={};var _0x5f5701=_[_0xfce8('0x23')](db[_0xfce8('0x24')][_0xfce8('0x25')],function(_0x2d9002){return{'name':_0x2d9002[_0xfce8('0x26')],'type':_0x2d9002[_0xfce8('0x27')]['key']};});_0x3bc90d=qs[_0xfce8('0x28')](_0x5f5701,_0x3472b0);return interaction['findAll'](_0xfce8('0x29'),_0x3472b0[_0xfce8('0x2a')],_0x3472b0[_0xfce8('0x2b')],_0x3bc90d,_0x5f5701)[_0xfce8('0x1d')](respondWithFilteredResult(_0x49a078,_0x3bc90d))['catch'](handleError(_0x49a078,null));};exports[_0xfce8('0x2c')]=function(_0x2ce853,_0x3db8e8){var _0x2b3a70={'raw':![],'where':{'id':_0x2ce853[_0xfce8('0x2d')]['id']}},_0x58a731={};_0x58a731[_0xfce8('0x2e')]=_[_0xfce8('0x2f')](db[_0xfce8('0x24')][_0xfce8('0x25')]);_0x58a731[_0xfce8('0x2a')]=_[_0xfce8('0x2f')](_0x2ce853[_0xfce8('0x2a')]);_0x58a731['filters']=_[_0xfce8('0x30')](_0x58a731[_0xfce8('0x2e')],_0x58a731[_0xfce8('0x2a')]);_0x2b3a70[_0xfce8('0x31')]=_[_0xfce8('0x30')](_0x58a731['model'],qs[_0xfce8('0x32')](_0x2ce853['query'][_0xfce8('0x32')]));_0x2b3a70['attributes']=_0x2b3a70[_0xfce8('0x31')][_0xfce8('0x33')]?_0x2b3a70[_0xfce8('0x31')]:_0x58a731[_0xfce8('0x2e')];if(_0x2ce853[_0xfce8('0x2a')][_0xfce8('0x34')]){_0x2b3a70['include']=[{'all':!![]}];}_0x2b3a70=_[_0xfce8('0x35')]({},_0x2b3a70,_0x2ce853[_0xfce8('0x36')]);return db['MailInteraction']['find'](_0x2b3a70)['then'](handleEntityNotFound(_0x3db8e8,null))[_0xfce8('0x1d')](respondWithResult(_0x3db8e8,null))['catch'](handleError(_0x3db8e8,null));};exports[_0xfce8('0x37')]=function(_0x44f06a,_0x362887){return db[_0xfce8('0x24')]['create'](_0x44f06a[_0xfce8('0x38')],{})[_0xfce8('0x1d')](respondWithResult(_0x362887,0xc9))['catch'](handleError(_0x362887,null));};exports[_0xfce8('0x39')]=function(_0x4e43d8,_0x4f235f){if(_0x4e43d8[_0xfce8('0x38')]['id']){delete _0x4e43d8[_0xfce8('0x38')]['id'];}return db[_0xfce8('0x24')][_0xfce8('0x3a')]({'where':{'id':_0x4e43d8[_0xfce8('0x2d')]['id']}})[_0xfce8('0x1d')](handleEntityNotFound(_0x4f235f,null))['then'](saveUpdates(_0x4e43d8[_0xfce8('0x38')],null))['then'](respondWithResult(_0x4f235f,null))[_0xfce8('0x3b')](handleError(_0x4f235f,null));};exports[_0xfce8('0x1c')]=function(_0x548f1e,_0x40fcda){return db['MailInteraction']['find']({'where':{'id':_0x548f1e[_0xfce8('0x2d')]['id']}})[_0xfce8('0x1d')](handleEntityNotFound(_0x40fcda,null))[_0xfce8('0x1d')](removeEntity(_0x40fcda,null))[_0xfce8('0x3b')](handleError(_0x40fcda,null));};exports['describe']=function(_0x1bc59a,_0x154ce9){return db['MailInteraction'][_0xfce8('0x3c')]()[_0xfce8('0x1d')](respondWithResult(_0x154ce9,null))['catch'](handleError(_0x154ce9,null));};exports['addMessage']=function(_0x3989da,_0x5c2ad9){return db[_0xfce8('0x3d')][_0xfce8('0x3a')]({'where':{'id':_0x3989da[_0xfce8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5c2ad9,null))['then'](function(_0x1d2dc9){if(_0x1d2dc9){return _0x1d2dc9['addMessage'](_0x3989da[_0xfce8('0x38')][_0xfce8('0x3e')],_[_0xfce8('0x3f')](_0x3989da[_0xfce8('0x38')],[_0xfce8('0x3e'),'id'])||{});}})[_0xfce8('0x1d')](respondWithResult(_0x5c2ad9,null))[_0xfce8('0x3b')](handleError(_0x5c2ad9,null));};exports['getMessages']=function(_0x1831cc,_0x4884ac){var _0x7f8e43={'raw':![],'where':{}};var _0x9c7537={};var _0x133ae3={'count':0x0,'rows':[]};return db['MailInteraction'][_0xfce8('0x40')]({'where':{'id':_0x1831cc[_0xfce8('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4884ac,null))[_0xfce8('0x1d')](function(_0x416288){if(_0x416288){_0x9c7537[_0xfce8('0x2e')]=_[_0xfce8('0x2f')](db[_0xfce8('0x3d')][_0xfce8('0x25')]);_0x9c7537[_0xfce8('0x2a')]=_['keys'](_0x1831cc[_0xfce8('0x2a')]);_0x9c7537[_0xfce8('0x41')]=_[_0xfce8('0x30')](_0x9c7537[_0xfce8('0x2e')],_0x9c7537[_0xfce8('0x2a')]);_0x7f8e43[_0xfce8('0x31')]=_['intersection'](_0x9c7537[_0xfce8('0x2e')],qs['fields'](_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x32')]));_0x7f8e43[_0xfce8('0x31')]=_0x7f8e43[_0xfce8('0x31')][_0xfce8('0x33')]?_0x7f8e43['attributes']:_0x9c7537[_0xfce8('0x2e')];if(!_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x42')](_0xfce8('0x43'))){_0x7f8e43[_0xfce8('0x19')]=qs[_0xfce8('0x19')](_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x19')]);_0x7f8e43[_0xfce8('0x17')]=qs[_0xfce8('0x17')](_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x17')]);}_0x7f8e43['order']=qs[_0xfce8('0x44')](_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x44')]);_0x7f8e43[_0xfce8('0x45')]=qs['filters'](_[_0xfce8('0x46')](_0x1831cc[_0xfce8('0x2a')],_0x9c7537[_0xfce8('0x41')]));_0x7f8e43['where'][_0xfce8('0x47')]=_0x416288['id'];if(_0x1831cc['query'][_0xfce8('0x48')]){_0x7f8e43['where']=_[_0xfce8('0x35')](_0x7f8e43[_0xfce8('0x45')],{'$or':_[_0xfce8('0x23')](_0x7f8e43[_0xfce8('0x31')],function(_0x85b0f8){var _0x9de93e={};_0x9de93e[_0x85b0f8]={'$like':'%'+_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x48')]+'%'};return _0x9de93e;})});}if(_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x49')]){var _0x438a6d=_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x49')]['split'](',');var _0x48ed20={};_0x48ed20[_0x438a6d[0x0]]={'$gte':moment(_0x438a6d[0x1])[_0xfce8('0x4a')](_0xfce8('0x4b'))};_0x7f8e43[_0xfce8('0x45')]=_[_0xfce8('0x35')](_0x7f8e43[_0xfce8('0x45')],_0x48ed20);}_0x7f8e43=_['merge']({},_0x7f8e43,_0x1831cc[_0xfce8('0x36')]);return db[_0xfce8('0x3d')][_0xfce8('0x1a')]({'where':_0x7f8e43[_0xfce8('0x45')]})['then'](function(_0x5d8223){_0x133ae3['count']=_0x5d8223;if(_0x1831cc[_0xfce8('0x2a')]['includeAll']){_0x7f8e43[_0xfce8('0x4c')]=[{'all':!![]}];}return db['MailMessage'][_0xfce8('0x4d')](_0x7f8e43);})[_0xfce8('0x1d')](function(_0x132017){if(_0x1831cc[_0xfce8('0x2a')][_0xfce8('0x4e')]===_0xfce8('0x4f')){for(var _0x904429=0x0;_0x904429<_0x132017['length'];_0x904429++){_0x132017[_0x904429][_0xfce8('0x38')]=juice(_0x132017[_0x904429][_0xfce8('0x38')]);}}_0x133ae3[_0xfce8('0x50')]=_0x132017;return _0x133ae3;});}})[_0xfce8('0x1d')](respondWithFilteredResult(_0x4884ac,_0x7f8e43))[_0xfce8('0x3b')](handleError(_0x4884ac,null));};exports[_0xfce8('0x51')]=function(_0x90db6e,_0x4e0ea8){return db[_0xfce8('0x24')][_0xfce8('0x3a')]({'where':{'id':_0x90db6e[_0xfce8('0x2d')]['id']}})[_0xfce8('0x1d')](handleEntityNotFound(_0x4e0ea8,null))[_0xfce8('0x1d')](function(_0x446ae2){if(_0x446ae2){return _0x446ae2['setTags'](_0x90db6e['body'][_0xfce8('0x3e')],_[_0xfce8('0x3f')](_0x90db6e[_0xfce8('0x38')],[_0xfce8('0x3e'),'id'])||{})[_0xfce8('0x52')](function(){return db['Tag'][_0xfce8('0x4d')]({'attributes':['id',_0xfce8('0x21'),_0xfce8('0x53')],'where':{'id':_0x90db6e[_0xfce8('0x38')]['ids']}});})[_0xfce8('0x1d')](function(_0x2674f7){socket[_0xfce8('0x54')]('mailInteractionTags:save',{'id':Number(_0x90db6e['params']['id']),'tags':_0x2674f7||[]});return{'id':Number(_0x90db6e['params']['id']),'tags':_0x2674f7||[]};});}})[_0xfce8('0x1d')](respondWithResult(_0x4e0ea8,null))[_0xfce8('0x3b')](handleError(_0x4e0ea8,null));};exports[_0xfce8('0x55')]=function(_0x39232a,_0x44a9e7){return db[_0xfce8('0x24')][_0xfce8('0x3a')]({'where':{'id':_0x39232a[_0xfce8('0x2d')]['id']}})[_0xfce8('0x1d')](handleEntityNotFound(_0x44a9e7,null))['then'](function(_0x445514){if(_0x445514){return _0x445514[_0xfce8('0x55')](_0x39232a[_0xfce8('0x2a')][_0xfce8('0x3e')]);}})[_0xfce8('0x1d')](respondWithStatusCode(_0x44a9e7,null))[_0xfce8('0x3b')](handleError(_0x44a9e7,null));};exports[_0xfce8('0x56')]=function(_0x5efef7,_0x46bc05){var _0x2abe72=moment()[_0xfce8('0x57')]()[_0xfce8('0x58')]();var _0x370b43=path[_0xfce8('0x59')](config[_0xfce8('0x5a')],'server',_0xfce8('0x5b'),_0xfce8('0x5c'));var _0x4592db=path[_0xfce8('0x59')](config[_0xfce8('0x5a')],_0xfce8('0x5d'),_0xfce8('0x5b'),_0xfce8('0x5e'));var _0x5bb5d9=path[_0xfce8('0x59')](_0x370b43,_0x2abe72);var _0x32e6a2=util[_0xfce8('0x4a')]('transcript-%d-%s.zip',_0x5efef7[_0xfce8('0x2d')]['id'],_0x2abe72);var _0x501f4f=path[_0xfce8('0x59')](_0x370b43,_0x32e6a2);var _0x41081c=[];if(_0x5efef7['query'][_0xfce8('0x5e')]){_0x41081c[_0xfce8('0x5f')]({'model':db[_0xfce8('0x60')],'as':_0xfce8('0x61'),'raw':!![]});}var _0x216d4a=[{'model':db[_0xfce8('0x3d')],'as':'Messages','attributes':['id',_0xfce8('0x38'),_0xfce8('0x62'),'to','cc',_0xfce8('0x63'),_0xfce8('0x64'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x41081c}];return db[_0xfce8('0x24')][_0xfce8('0x3a')]({'where':{'id':_0x5efef7['params']['id']},'include':_0x216d4a})[_0xfce8('0x1d')](handleEntityNotFound(_0x46bc05,null))[_0xfce8('0x1d')](function(_0x5e2382){if(_0x5e2382&&_0x5e2382['Messages']){var _0x37983b=_0x5e2382['get']({'plain':!![]});fs[_0xfce8('0x65')](_0x5bb5d9);return BPromise[_0xfce8('0x66')](_0x37983b[_0xfce8('0x67')],function(_0x3f4e7f,_0x3eb22e){var _0x3a91e9={'from':_0x3f4e7f[_0xfce8('0x62')],'to':_0x3f4e7f['to']||'missing.recipient@your.company.com','subject':_0x3f4e7f[_0xfce8('0x64')],'html':htmlEntities[_0xfce8('0x68')](_0x3f4e7f[_0xfce8('0x38')]),'headers':{'Date':moment(_0x3f4e7f['createdAt'])[_0xfce8('0x4a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3f4e7f['cc']){_0x3a91e9['headers']['Cc']=_0x3f4e7f['cc'];}if(_0x3f4e7f[_0xfce8('0x63')]){_0x3a91e9['headers']['Bcc']=_0x3f4e7f[_0xfce8('0x63')];}return new BPromise(function(_0x3e427d,_0x19d05f){if(_0x3f4e7f['Attachments']){for(var _0x38b4b8=0x0;_0x38b4b8<_0x3f4e7f['Attachments'][_0xfce8('0x33')];_0x38b4b8++){var _0x59c89e=_0x3f4e7f[_0xfce8('0x61')][_0x38b4b8];var _0xb2dcf6=path[_0xfce8('0x59')](_0x4592db,_0x59c89e['basename']);if(fs['existsSync'](_0xb2dcf6)){_0x3a91e9[_0xfce8('0x5e')]['push']({'name':_0x59c89e[_0xfce8('0x21')],'contentType':_0x59c89e['type'],'data':fs[_0xfce8('0x69')](_0xb2dcf6)});}}}emlformat['build'](_0x3a91e9,function(_0x4b58c0,_0x4048de){if(_0x4b58c0)return _0x19d05f(_0x4b58c0);fs[_0xfce8('0x6a')](path[_0xfce8('0x59')](_0x5bb5d9,util[_0xfce8('0x4a')](_0xfce8('0x6b'),_0x3eb22e)),_0x4048de);return _0x3e427d(_0x4048de);});});})[_0xfce8('0x1d')](function(){return new BPromise(function(_0x5314b1,_0x30b0cf){zipdir(_0x5bb5d9,{'saveTo':_0x501f4f},function(_0x2c0add,_0x2607cd){if(_0x2c0add)return _0x30b0cf(_0x2c0add);return _0x5314b1(_0x2607cd);});})[_0xfce8('0x1d')](function(){return new BPromise(function(_0x2a1f04,_0xdd5989){rimraf(_0x5bb5d9,function(_0x166188){if(_0x166188)_0xdd5989(_0x166188);return _0x2a1f04();});});})['then'](function(){return _0x46bc05[_0xfce8('0x56')](_0x501f4f,_0x32e6a2,function(_0x18136c){if(!_0x18136c)fs[_0xfce8('0x6c')](_0x501f4f);});});});}else{return _0x46bc05['sendStatus'](0xc8);}})[_0xfce8('0x3b')](handleError(_0x46bc05,null));}; \ No newline at end of file +var _0xf33d=['inlineCss','true','addTags','spread','color','emit','mailInteractionTags:save','removeTags','download','toString','join','root','server','tmp','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','createdAt','sort','mkdirSync','subject','decode','Bcc','Attachments','basename','existsSync','build','unlinkSync','rimraf','moment','bluebird','util','lodash','juice','ioredis','../../components/interaction/service','html-entities','redis','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','set','then','destroy','end','error','name','send','index','map','MailInteraction','rawAttributes','fieldName','getOptions','findAll','mail','query','user','show','params','model','filters','intersection','fields','attributes','length','include','merge','options','find','catch','create','body','update','describe','MailMessage','addMessage','ids','omit','getMessages','keys','order','pick','MailInteractionId','filter','where','$gte','count','includeAll'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf33d,0x1a9));var _0xdf33=function(_0xbdd09,_0x2110ee){_0xbdd09=_0xbdd09-0x0;var _0x562cc5=_0xf33d[_0xbdd09];return _0x562cc5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf33('0x0'));var zipdir=require('zip-dir');var moment=require(_0xdf33('0x1'));var BPromise=require(_0xdf33('0x2'));var util=require(_0xdf33('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xdf33('0x4'));var juice=require(_0xdf33('0x5'));var Redis=require(_0xdf33('0x6'));var interaction=require(_0xdf33('0x7'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require(_0xdf33('0x8'));config[_0xdf33('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdf33('0xa'))(new Redis(config[_0xdf33('0x9')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x42a325,_0x425826){_0x425826=_0x425826||0xcc;return function(_0x3d1d55){if(_0x3d1d55){return _0x42a325[_0xdf33('0xb')](_0x425826);}return _0x42a325[_0xdf33('0xc')](_0x425826)['end']();};}function respondWithResult(_0x10a95f,_0x5c2b9d){_0x5c2b9d=_0x5c2b9d||0xc8;return function(_0xe2ff40){if(_0xe2ff40){return _0x10a95f[_0xdf33('0xc')](_0x5c2b9d)[_0xdf33('0xd')](_0xe2ff40);}};}function respondWithFilteredResult(_0x4becb1,_0x1b4aac){return function(_0x11e99e){if(_0x11e99e){var _0x4f6c82=typeof _0x1b4aac[_0xdf33('0xe')]===_0xdf33('0xf')&&typeof _0x1b4aac[_0xdf33('0x10')]==='undefined';var _0x31bd86=_0x11e99e['count'];var _0x11adbc=_0x4f6c82?0x0:_0x1b4aac['offset'];var _0x2aec35=_0x4f6c82?_0x11e99e['count']:_0x1b4aac[_0xdf33('0xe')]+_0x1b4aac[_0xdf33('0x10')];var _0x29d336;if(_0x2aec35>=_0x31bd86){_0x2aec35=_0x31bd86;_0x29d336=0xc8;}else{_0x29d336=0xce;}_0x4becb1['status'](_0x29d336);return _0x4becb1[_0xdf33('0x11')]('Content-Range',_0x11adbc+'-'+_0x2aec35+'/'+_0x31bd86)[_0xdf33('0xd')](_0x11e99e);}return null;};}function saveUpdates(_0x43d673){return function(_0x35a941){if(_0x35a941){return _0x35a941['update'](_0x43d673)[_0xdf33('0x12')](function(_0x2593bd){return _0x2593bd;});}return null;};}function removeEntity(_0x439426){return function(_0x69c2b3){if(_0x69c2b3){return _0x69c2b3[_0xdf33('0x13')]()['then'](function(){_0x439426[_0xdf33('0xc')](0xcc)[_0xdf33('0x14')]();});}};}function handleEntityNotFound(_0xc655c){return function(_0x233bd7){if(!_0x233bd7){_0xc655c['sendStatus'](0x194);}return _0x233bd7;};}function handleError(_0x20cbef,_0x2893a3){_0x2893a3=_0x2893a3||0x1f4;return function(_0x1a4e22){logger[_0xdf33('0x15')](_0x1a4e22['stack']);if(_0x1a4e22[_0xdf33('0x16')]){delete _0x1a4e22[_0xdf33('0x16')];}_0x20cbef[_0xdf33('0xc')](_0x2893a3)[_0xdf33('0x17')](_0x1a4e22);};}exports[_0xdf33('0x18')]=function(_0x124499,_0x5ccef3){var _0x572021={};var _0x2499a9=_[_0xdf33('0x19')](db[_0xdf33('0x1a')][_0xdf33('0x1b')],function(_0x1d5bc0){return{'name':_0x1d5bc0[_0xdf33('0x1c')],'type':_0x1d5bc0['type']['key']};});_0x572021=qs[_0xdf33('0x1d')](_0x2499a9,_0x124499);return interaction[_0xdf33('0x1e')](_0xdf33('0x1f'),_0x124499[_0xdf33('0x20')],_0x124499[_0xdf33('0x21')],_0x572021,_0x2499a9)[_0xdf33('0x12')](respondWithFilteredResult(_0x5ccef3,_0x572021))['catch'](handleError(_0x5ccef3,null));};exports[_0xdf33('0x22')]=function(_0x521fd1,_0x396644){var _0xfbffbb={'raw':![],'where':{'id':_0x521fd1[_0xdf33('0x23')]['id']}},_0xfca7b6={};_0xfca7b6[_0xdf33('0x24')]=_['keys'](db['MailInteraction'][_0xdf33('0x1b')]);_0xfca7b6[_0xdf33('0x20')]=_['keys'](_0x521fd1[_0xdf33('0x20')]);_0xfca7b6[_0xdf33('0x25')]=_[_0xdf33('0x26')](_0xfca7b6['model'],_0xfca7b6[_0xdf33('0x20')]);_0xfbffbb['attributes']=_[_0xdf33('0x26')](_0xfca7b6[_0xdf33('0x24')],qs[_0xdf33('0x27')](_0x521fd1['query'][_0xdf33('0x27')]));_0xfbffbb[_0xdf33('0x28')]=_0xfbffbb[_0xdf33('0x28')][_0xdf33('0x29')]?_0xfbffbb['attributes']:_0xfca7b6[_0xdf33('0x24')];if(_0x521fd1[_0xdf33('0x20')]['includeAll']){_0xfbffbb[_0xdf33('0x2a')]=[{'all':!![]}];}_0xfbffbb=_[_0xdf33('0x2b')]({},_0xfbffbb,_0x521fd1[_0xdf33('0x2c')]);return db[_0xdf33('0x1a')][_0xdf33('0x2d')](_0xfbffbb)[_0xdf33('0x12')](handleEntityNotFound(_0x396644,null))[_0xdf33('0x12')](respondWithResult(_0x396644,null))[_0xdf33('0x2e')](handleError(_0x396644,null));};exports[_0xdf33('0x2f')]=function(_0x5ab8d3,_0x26883a){return db[_0xdf33('0x1a')][_0xdf33('0x2f')](_0x5ab8d3[_0xdf33('0x30')],{})[_0xdf33('0x12')](respondWithResult(_0x26883a,0xc9))[_0xdf33('0x2e')](handleError(_0x26883a,null));};exports[_0xdf33('0x31')]=function(_0x5a63c9,_0x1010e0){if(_0x5a63c9['body']['id']){delete _0x5a63c9[_0xdf33('0x30')]['id'];}return db[_0xdf33('0x1a')]['find']({'where':{'id':_0x5a63c9[_0xdf33('0x23')]['id']}})[_0xdf33('0x12')](handleEntityNotFound(_0x1010e0,null))[_0xdf33('0x12')](saveUpdates(_0x5a63c9[_0xdf33('0x30')],null))['then'](respondWithResult(_0x1010e0,null))[_0xdf33('0x2e')](handleError(_0x1010e0,null));};exports[_0xdf33('0x13')]=function(_0x747907,_0x5b8759){return db[_0xdf33('0x1a')][_0xdf33('0x2d')]({'where':{'id':_0x747907[_0xdf33('0x23')]['id']}})['then'](handleEntityNotFound(_0x5b8759,null))['then'](removeEntity(_0x5b8759,null))[_0xdf33('0x2e')](handleError(_0x5b8759,null));};exports[_0xdf33('0x32')]=function(_0x14f374,_0xea1c1c){return db['MailInteraction'][_0xdf33('0x32')]()[_0xdf33('0x12')](respondWithResult(_0xea1c1c,null))[_0xdf33('0x2e')](handleError(_0xea1c1c,null));};exports['addMessage']=function(_0x19a4a2,_0x375608){return db[_0xdf33('0x33')]['find']({'where':{'id':_0x19a4a2[_0xdf33('0x23')]['id']}})[_0xdf33('0x12')](handleEntityNotFound(_0x375608,null))[_0xdf33('0x12')](function(_0x50ebe8){if(_0x50ebe8){return _0x50ebe8[_0xdf33('0x34')](_0x19a4a2[_0xdf33('0x30')][_0xdf33('0x35')],_[_0xdf33('0x36')](_0x19a4a2[_0xdf33('0x30')],[_0xdf33('0x35'),'id'])||{});}})[_0xdf33('0x12')](respondWithResult(_0x375608,null))['catch'](handleError(_0x375608,null));};exports[_0xdf33('0x37')]=function(_0x4c0e61,_0x3444d2){var _0x4e7108={'raw':![],'where':{}};var _0x3b0fa7={};var _0x51f37b={'count':0x0,'rows':[]};return db[_0xdf33('0x1a')]['findOne']({'where':{'id':_0x4c0e61[_0xdf33('0x23')]['id']}})[_0xdf33('0x12')](handleEntityNotFound(_0x3444d2,null))[_0xdf33('0x12')](function(_0x59f159){if(_0x59f159){_0x3b0fa7['model']=_[_0xdf33('0x38')](db[_0xdf33('0x33')][_0xdf33('0x1b')]);_0x3b0fa7['query']=_[_0xdf33('0x38')](_0x4c0e61[_0xdf33('0x20')]);_0x3b0fa7[_0xdf33('0x25')]=_[_0xdf33('0x26')](_0x3b0fa7[_0xdf33('0x24')],_0x3b0fa7[_0xdf33('0x20')]);_0x4e7108['attributes']=_[_0xdf33('0x26')](_0x3b0fa7[_0xdf33('0x24')],qs[_0xdf33('0x27')](_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x27')]));_0x4e7108[_0xdf33('0x28')]=_0x4e7108[_0xdf33('0x28')][_0xdf33('0x29')]?_0x4e7108[_0xdf33('0x28')]:_0x3b0fa7[_0xdf33('0x24')];if(!_0x4c0e61['query']['hasOwnProperty']('nolimit')){_0x4e7108[_0xdf33('0x10')]=qs['limit'](_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x10')]);_0x4e7108[_0xdf33('0xe')]=qs['offset'](_0x4c0e61[_0xdf33('0x20')][_0xdf33('0xe')]);}_0x4e7108[_0xdf33('0x39')]=qs['sort'](_0x4c0e61[_0xdf33('0x20')]['sort']);_0x4e7108['where']=qs[_0xdf33('0x25')](_[_0xdf33('0x3a')](_0x4c0e61[_0xdf33('0x20')],_0x3b0fa7[_0xdf33('0x25')]));_0x4e7108['where'][_0xdf33('0x3b')]=_0x59f159['id'];if(_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x3c')]){_0x4e7108[_0xdf33('0x3d')]=_[_0xdf33('0x2b')](_0x4e7108[_0xdf33('0x3d')],{'$or':_['map'](_0x4e7108[_0xdf33('0x28')],function(_0x589522){var _0x5de6a1={};_0x5de6a1[_0x589522]={'$like':'%'+_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x3c')]+'%'};return _0x5de6a1;})});}if(_0x4c0e61['query'][_0xdf33('0x3e')]){var _0xcabcea=_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x3e')]['split'](',');var _0x39e3a7={};_0x39e3a7[_0xcabcea[0x0]]={'$gte':moment(_0xcabcea[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4e7108[_0xdf33('0x3d')]=_[_0xdf33('0x2b')](_0x4e7108['where'],_0x39e3a7);}_0x4e7108=_[_0xdf33('0x2b')]({},_0x4e7108,_0x4c0e61[_0xdf33('0x2c')]);return db[_0xdf33('0x33')][_0xdf33('0x3f')]({'where':_0x4e7108[_0xdf33('0x3d')]})[_0xdf33('0x12')](function(_0x31aa56){_0x51f37b[_0xdf33('0x3f')]=_0x31aa56;if(_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x40')]){_0x4e7108[_0xdf33('0x2a')]=[{'all':!![]}];}return db[_0xdf33('0x33')][_0xdf33('0x1e')](_0x4e7108);})[_0xdf33('0x12')](function(_0x53c81a){if(_0x4c0e61[_0xdf33('0x20')][_0xdf33('0x41')]===_0xdf33('0x42')){for(var _0xb6d849=0x0;_0xb6d849<_0x53c81a['length'];_0xb6d849++){_0x53c81a[_0xb6d849][_0xdf33('0x30')]=juice(_0x53c81a[_0xb6d849][_0xdf33('0x30')]);}}_0x51f37b['rows']=_0x53c81a;return _0x51f37b;});}})['then'](respondWithFilteredResult(_0x3444d2,_0x4e7108))[_0xdf33('0x2e')](handleError(_0x3444d2,null));};exports[_0xdf33('0x43')]=function(_0x36ef01,_0x37c1e9){return db['MailInteraction'][_0xdf33('0x2d')]({'where':{'id':_0x36ef01[_0xdf33('0x23')]['id']}})[_0xdf33('0x12')](handleEntityNotFound(_0x37c1e9,null))[_0xdf33('0x12')](function(_0x36f092){if(_0x36f092){return _0x36f092['setTags'](_0x36ef01[_0xdf33('0x30')][_0xdf33('0x35')],_[_0xdf33('0x36')](_0x36ef01[_0xdf33('0x30')],[_0xdf33('0x35'),'id'])||{})[_0xdf33('0x44')](function(){return db['Tag'][_0xdf33('0x1e')]({'attributes':['id',_0xdf33('0x16'),_0xdf33('0x45')],'where':{'id':_0x36ef01['body'][_0xdf33('0x35')]}});})[_0xdf33('0x12')](function(_0x7882e){socket[_0xdf33('0x46')](_0xdf33('0x47'),{'id':Number(_0x36ef01[_0xdf33('0x23')]['id']),'tags':_0x7882e||[]});return{'id':Number(_0x36ef01[_0xdf33('0x23')]['id']),'tags':_0x7882e||[]};});}})['then'](respondWithResult(_0x37c1e9,null))[_0xdf33('0x2e')](handleError(_0x37c1e9,null));};exports['removeTags']=function(_0x4f5fce,_0x84a082){return db[_0xdf33('0x1a')][_0xdf33('0x2d')]({'where':{'id':_0x4f5fce[_0xdf33('0x23')]['id']}})[_0xdf33('0x12')](handleEntityNotFound(_0x84a082,null))[_0xdf33('0x12')](function(_0x4ed91f){if(_0x4ed91f){return _0x4ed91f[_0xdf33('0x48')](_0x4f5fce[_0xdf33('0x20')][_0xdf33('0x35')]);}})[_0xdf33('0x12')](respondWithStatusCode(_0x84a082,null))[_0xdf33('0x2e')](handleError(_0x84a082,null));};exports[_0xdf33('0x49')]=function(_0x213713,_0x405476){var _0x4b9b73=moment()['unix']()[_0xdf33('0x4a')]();var _0x250eed=path[_0xdf33('0x4b')](config[_0xdf33('0x4c')],_0xdf33('0x4d'),'files',_0xdf33('0x4e'));var _0x166bd9=path[_0xdf33('0x4b')](config[_0xdf33('0x4c')],_0xdf33('0x4d'),'files',_0xdf33('0x4f'));var _0xffcdd0=path[_0xdf33('0x4b')](_0x250eed,_0x4b9b73);var _0x28945a=util[_0xdf33('0x50')](_0xdf33('0x51'),_0x213713[_0xdf33('0x23')]['id'],_0x4b9b73);var _0x3457e5=path[_0xdf33('0x4b')](_0x250eed,_0x28945a);var _0x53d426=[];if(_0x213713[_0xdf33('0x20')]['attachments']){_0x53d426[_0xdf33('0x52')]({'model':db[_0xdf33('0x53')],'as':'Attachments','raw':!![]});}var _0x18a6bf=[{'model':db[_0xdf33('0x33')],'as':_0xdf33('0x54'),'attributes':['id',_0xdf33('0x30'),_0xdf33('0x55'),'to','cc',_0xdf33('0x56'),'subject',_0xdf33('0x57')],'where':{'secret':![]},'order':qs[_0xdf33('0x58')]('id'),'include':_0x53d426}];return db['MailInteraction'][_0xdf33('0x2d')]({'where':{'id':_0x213713['params']['id']},'include':_0x18a6bf})[_0xdf33('0x12')](handleEntityNotFound(_0x405476,null))[_0xdf33('0x12')](function(_0x5118c){if(_0x5118c&&_0x5118c[_0xdf33('0x54')]){var _0x3f6952=_0x5118c['get']({'plain':!![]});fs[_0xdf33('0x59')](_0xffcdd0);return BPromise['each'](_0x3f6952['Messages'],function(_0x1b0915,_0x22ea65){var _0x2af4b4={'from':_0x1b0915[_0xdf33('0x55')],'to':_0x1b0915['to']||'missing.recipient@your.company.com','subject':_0x1b0915[_0xdf33('0x5a')],'html':htmlEntities[_0xdf33('0x5b')](_0x1b0915[_0xdf33('0x30')]),'headers':{'Date':moment(_0x1b0915[_0xdf33('0x57')])[_0xdf33('0x50')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1b0915['cc']){_0x2af4b4['headers']['Cc']=_0x1b0915['cc'];}if(_0x1b0915['bcc']){_0x2af4b4['headers'][_0xdf33('0x5c')]=_0x1b0915[_0xdf33('0x56')];}return new BPromise(function(_0x44e217,_0x5a05fc){if(_0x1b0915[_0xdf33('0x5d')]){for(var _0x2f36e6=0x0;_0x2f36e6<_0x1b0915[_0xdf33('0x5d')]['length'];_0x2f36e6++){var _0x3b8a5f=_0x1b0915[_0xdf33('0x5d')][_0x2f36e6];var _0x9f730d=path[_0xdf33('0x4b')](_0x166bd9,_0x3b8a5f[_0xdf33('0x5e')]);if(fs[_0xdf33('0x5f')](_0x9f730d)){_0x2af4b4[_0xdf33('0x4f')]['push']({'name':_0x3b8a5f[_0xdf33('0x16')],'contentType':_0x3b8a5f['type'],'data':fs['readFileSync'](_0x9f730d)});}}}emlformat[_0xdf33('0x60')](_0x2af4b4,function(_0x128020,_0xba27be){if(_0x128020)return _0x5a05fc(_0x128020);fs['writeFileSync'](path[_0xdf33('0x4b')](_0xffcdd0,util[_0xdf33('0x50')]('message%d.eml',_0x22ea65)),_0xba27be);return _0x44e217(_0xba27be);});});})[_0xdf33('0x12')](function(){return new BPromise(function(_0xa8fc15,_0x10d345){zipdir(_0xffcdd0,{'saveTo':_0x3457e5},function(_0x5d5c52,_0x5aee2a){if(_0x5d5c52)return _0x10d345(_0x5d5c52);return _0xa8fc15(_0x5aee2a);});})[_0xdf33('0x12')](function(){return new BPromise(function(_0x598cdb,_0x50fbc8){rimraf(_0xffcdd0,function(_0x524983){if(_0x524983)_0x50fbc8(_0x524983);return _0x598cdb();});});})[_0xdf33('0x12')](function(){return _0x405476['download'](_0x3457e5,_0x28945a,function(_0x408c46){if(!_0x408c46)fs[_0xdf33('0x61')](_0x3457e5);});});});}else{return _0x405476['sendStatus'](0xc8);}})[_0xdf33('0x2e')](handleError(_0x405476,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 976a5eb..a8cd447 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 _0x1907=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','catch','hasOwnProperty','exports','events'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x1907,0xa9));var _0x7190=function(_0x4da2ff,_0x2eaa28){_0x4da2ff=_0x4da2ff-0x0;var _0x520cf2=_0x1907[_0x4da2ff];return _0x520cf2;};'use strict';var EventEmitter=require(_0x7190('0x0'));var MailInteraction=require(_0x7190('0x1'))['db'][_0x7190('0x2')];var MailMessage=require('../../mysqldb')['db'][_0x7190('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x7190('0x4')](0x0);var events={'afterCreate':_0x7190('0x5'),'afterUpdate':_0x7190('0x6'),'afterDestroy':'remove'};function emitEvent(_0x455262){return function(_0x140666,_0x3610f3,_0x1a5579){_0x140666[_0x7190('0x7')]({'attributes':['id'],'raw':!![]})[_0x7190('0x8')](function(_0x98e1e2){_0x140666[_0x7190('0x9')](_0x7190('0xa'),_0x98e1e2[_0x7190('0xb')](function(_0x368d2f){return{'id':_0x368d2f['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x140666['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7190('0x8')](function(_0x263176){_0x140666[_0x7190('0x9')](_0x7190('0xc'),_0x263176[_0x7190('0xd')]);MailInteractionEvents['emit'](_0x455262+':'+_0x140666['id'],_0x140666);MailInteractionEvents['emit'](_0x455262,_0x140666);_0x1a5579(null);})[_0x7190('0xe')](_0x1a5579(null));};}for(var e in events){if(events[_0x7190('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x7190('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xadc7=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailInteraction','MailMessage','save','update','remove','getUsers','then'];(function(_0x5e8337,_0x1a0c34){var _0x1f7710=function(_0x229f13){while(--_0x229f13){_0x5e8337['push'](_0x5e8337['shift']());}};_0x1f7710(++_0x1a0c34);}(_0xadc7,0x128));var _0x7adc=function(_0x4fa489,_0x4cba6b){_0x4fa489=_0x4fa489-0x0;var _0x41d2ce=_0xadc7[_0x4fa489];return _0x41d2ce;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x7adc('0x0'))['db'][_0x7adc('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x7adc('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7adc('0x3'),'afterUpdate':_0x7adc('0x4'),'afterDestroy':_0x7adc('0x5')};function emitEvent(_0x3f9b44){return function(_0x593c2d,_0x4589d6,_0x158691){_0x593c2d[_0x7adc('0x6')]({'attributes':['id'],'raw':!![]})[_0x7adc('0x7')](function(_0x5f044c){_0x593c2d[_0x7adc('0x8')](_0x7adc('0x9'),_0x5f044c[_0x7adc('0xa')](function(_0xa7f30b){return{'id':_0xa7f30b['id']};}));return MailMessage[_0x7adc('0xb')]({'where':{'MailInteractionId':_0x593c2d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7adc('0x7')](function(_0x1b27b5){_0x593c2d[_0x7adc('0x8')](_0x7adc('0xc'),_0x1b27b5[_0x7adc('0xd')]);MailInteractionEvents[_0x7adc('0xe')](_0x3f9b44+':'+_0x593c2d['id'],_0x593c2d);MailInteractionEvents[_0x7adc('0xe')](_0x3f9b44,_0x593c2d);_0x158691(null);})[_0x7adc('0xf')](_0x158691(null));};}for(var e in events){if(events[_0x7adc('0x10')](e)){var event=events[e];MailInteraction[_0x7adc('0x11')](e,emitEvent(event));}}module[_0x7adc('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c70a003..c97ab77 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 _0xb966=['subject','closed','format','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','substatusAt','closedAt','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions'];(function(_0x11f2ce,_0x8d62c9){var _0x49737b=function(_0x1426a2){while(--_0x1426a2){_0x11f2ce['push'](_0x11f2ce['shift']());}};_0x49737b(++_0x8d62c9);}(_0xb966,0x1e1));var _0x6b96=function(_0x3d2a1c,_0x782fdd){_0x3d2a1c=_0x3d2a1c-0x0;var _0x55a56d=_0xb966[_0x3d2a1c];return _0x55a56d;};'use strict';var _=require(_0x6b96('0x0'));var util=require(_0x6b96('0x1'));var logger=require(_0x6b96('0x2'))(_0x6b96('0x3'));var moment=require(_0x6b96('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b96('0x5'));var fs=require('fs');var path=require(_0x6b96('0x6'));var rimraf=require(_0x6b96('0x7'));var config=require(_0x6b96('0x8'));var attributes=require('./mailInteraction.attributes');module[_0x6b96('0x9')]=function(_0x276fac,_0x372daf){return _0x276fac[_0x6b96('0xa')](_0x6b96('0xb'),attributes,{'tableName':_0x6b96('0xc'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x6b96('0xd'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3361c5,_0x30ab7a,_0x191784){if(_0x3361c5['substatus']){_0x3361c5['substatusAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3361c5[_0x6b96('0xe')]){_0x3361c5['closedAt']=moment()[_0x6b96('0xf')](_0x6b96('0x10'));}_0x191784(null,_0x30ab7a);},'beforeUpdate':function(_0x170bb2,_0x48b82a,_0x6c5ce8){if(_0x170bb2[_0x6b96('0x11')](_0x6b96('0x12'))){_0x170bb2[_0x6b96('0x13')]=_0x170bb2[_0x6b96('0x12')]?moment()[_0x6b96('0xf')](_0x6b96('0x10')):null;}if(_0x170bb2[_0x6b96('0x11')](_0x6b96('0xe'))){_0x170bb2[_0x6b96('0x14')]=moment()[_0x6b96('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x170bb2[_0x6b96('0x12')]=null;_0x170bb2[_0x6b96('0x13')]=null;}_0x6c5ce8(null,_0x170bb2);},'afterUpdate':function(_0x1e18b5,_0x27a9ed,_0x1ec671){var _0x42ee15=_0x276fac['models'];var _0x4686be=_0x1e18b5['get']({'plain':!![]});if(_0x4686be[_0x6b96('0xe')]){return _0x42ee15['MailMessage'][_0x6b96('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x4686be['id']}})[_0x6b96('0x16')](function(){_0x1ec671();})[_0x6b96('0x17')](function(_0x15ab12){_0x1ec671(_0x15ab12);});}else{_0x1ec671();}}},'charset':_0x6b96('0x18'),'collate':_0x6b96('0x19')});}; \ No newline at end of file +var _0xb9d3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','update','then','utf8mb4_unicode_ci','lodash','util'];(function(_0x1f3893,_0x8b4b14){var _0x39d872=function(_0x3ffaaa){while(--_0x3ffaaa){_0x1f3893['push'](_0x1f3893['shift']());}};_0x39d872(++_0x8b4b14);}(_0xb9d3,0xbe));var _0x3b9d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb9d3[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x3b9d('0x0'));var util=require(_0x3b9d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3b9d('0x2'));var BPromise=require(_0x3b9d('0x3'));var rp=require(_0x3b9d('0x4'));var fs=require('fs');var path=require(_0x3b9d('0x5'));var rimraf=require(_0x3b9d('0x6'));var config=require(_0x3b9d('0x7'));var attributes=require(_0x3b9d('0x8'));module[_0x3b9d('0x9')]=function(_0x347b3e,_0x13f616){return _0x347b3e['define'](_0x3b9d('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x3b9d('0xb'),'to'],'type':_0x3b9d('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4d0e22,_0x226467,_0x1f5f1d){if(_0x4d0e22[_0x3b9d('0xd')]){_0x4d0e22[_0x3b9d('0xe')]=moment()[_0x3b9d('0xf')](_0x3b9d('0x10'));}if(_0x4d0e22[_0x3b9d('0x11')]){_0x4d0e22[_0x3b9d('0x12')]=moment()[_0x3b9d('0xf')](_0x3b9d('0x10'));}_0x1f5f1d(null,_0x226467);},'beforeUpdate':function(_0x391ff0,_0x3adf87,_0x399f3c){if(_0x391ff0[_0x3b9d('0x13')](_0x3b9d('0xd'))){_0x391ff0['substatusAt']=_0x391ff0['substatus']?moment()[_0x3b9d('0xf')](_0x3b9d('0x10')):null;}if(_0x391ff0[_0x3b9d('0x13')](_0x3b9d('0x11'))){_0x391ff0['closedAt']=moment()[_0x3b9d('0xf')](_0x3b9d('0x10'));_0x391ff0[_0x3b9d('0xd')]=null;_0x391ff0[_0x3b9d('0xe')]=null;}_0x399f3c(null,_0x391ff0);},'afterUpdate':function(_0x3101de,_0x5aacaf,_0x5c1b94){var _0x37046a=_0x347b3e[_0x3b9d('0x14')];var _0x31e761=_0x3101de['get']({'plain':!![]});if(_0x31e761[_0x3b9d('0x11')]){return _0x37046a['MailMessage'][_0x3b9d('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x31e761['id']}})[_0x3b9d('0x16')](function(){_0x5c1b94();})['catch'](function(_0x4cc988){_0x5c1b94(_0x4cc988);});}else{_0x5c1b94();}}},'charset':'utf8mb4','collate':_0x3b9d('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index c1eac2b..1ee195f 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 _0x19d1=['ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','where','debug','stringify','AddTagsToMailInteraction','addTags'];(function(_0x1c377f,_0x5d0f2d){var _0x13ce1d=function(_0x4f5551){while(--_0x4f5551){_0x1c377f['push'](_0x1c377f['shift']());}};_0x13ce1d(++_0x5d0f2d);}(_0x19d1,0x16c));var _0x119d=function(_0x33ff00,_0x1eff90){_0x33ff00=_0x33ff00-0x0;var _0x1d62cb=_0x19d1[_0x33ff00];return _0x1d62cb;};'use strict';var _=require(_0x119d('0x0'));var util=require(_0x119d('0x1'));var moment=require('moment');var BPromise=require(_0x119d('0x2'));var rs=require(_0x119d('0x3'));var fs=require('fs');var Redis=require(_0x119d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x119d('0x5'));var logger=require('../../config/logger')(_0x119d('0x6'));var config=require(_0x119d('0x7'));var jayson=require(_0x119d('0x8'));var client=jayson[_0x119d('0x9')][_0x119d('0xa')]({'port':0x232a});config[_0x119d('0xb')]=_[_0x119d('0xc')](config['redis'],{'host':_0x119d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailInteraction.socket')[_0x119d('0xe')](socket);function respondWithRpcPromise(_0x1f9a00,_0x29ec5a,_0x5be858){return new BPromise(function(_0x19f3d8,_0xb947f8){return client[_0x119d('0xf')](_0x1f9a00,_0x5be858)[_0x119d('0x10')](function(_0x85a4f9){logger['info']('MailInteraction,\x20%s,\x20%s',_0x29ec5a,_0x119d('0x11'));logger['debug'](_0x119d('0x12'),_0x29ec5a,_0x119d('0x11'),JSON['stringify'](_0x85a4f9));if(_0x85a4f9[_0x119d('0x13')]){if(_0x85a4f9[_0x119d('0x13')][_0x119d('0x14')]===0x1f4){logger[_0x119d('0x13')](_0x119d('0x15'),_0x29ec5a,_0x85a4f9[_0x119d('0x13')][_0x119d('0x16')]);return _0xb947f8(_0x85a4f9[_0x119d('0x13')][_0x119d('0x16')]);}logger[_0x119d('0x13')](_0x119d('0x15'),_0x29ec5a,_0x85a4f9[_0x119d('0x13')][_0x119d('0x16')]);return _0x19f3d8(_0x85a4f9['error']['message']);}else{logger[_0x119d('0x17')]('MailInteraction,\x20%s,\x20%s',_0x29ec5a,_0x119d('0x11'));_0x19f3d8(_0x85a4f9[_0x119d('0x18')][_0x119d('0x16')]);}})[_0x119d('0x19')](function(_0x38f410){logger['error'](_0x119d('0x15'),_0x29ec5a,_0x38f410);_0xb947f8(_0x38f410);});});}exports[_0x119d('0x1a')]=function(_0xd34b15){var _0x3bb6b6=this;return new Promise(function(_0x56d645,_0x13ebc2){return db[_0x119d('0x1b')][_0x119d('0x1c')](_0xd34b15[_0x119d('0x1d')],{'raw':_0xd34b15[_0x119d('0x1e')]?_0xd34b15[_0x119d('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd34b15[_0x119d('0x1e')]?_0xd34b15[_0x119d('0x1e')][_0x119d('0x1f')]||null:null,'attributes':_0xd34b15[_0x119d('0x1e')]?_0xd34b15[_0x119d('0x1e')]['attributes']||null:null,'limit':_0xd34b15[_0x119d('0x1e')]?_0xd34b15[_0x119d('0x1e')]['limit']||null:null})[_0x119d('0x10')](function(_0x4da004){logger['info'](_0x119d('0x1a'),_0xd34b15);logger[_0x119d('0x20')](_0x119d('0x1a'),_0xd34b15,JSON[_0x119d('0x21')](_0x4da004));_0x56d645(_0x4da004);})['catch'](function(_0x257935){logger[_0x119d('0x13')](_0x119d('0x1a'),_0x257935[_0x119d('0x16')],_0xd34b15);_0x13ebc2(_0x3bb6b6[_0x119d('0x13')](0x1f4,_0x257935[_0x119d('0x16')]));});});};exports[_0x119d('0x22')]=function(_0x2d7609){return new Promise(function(_0x3d0a3e,_0x4db9a8){return db[_0x119d('0x1b')]['find']({'where':_0x2d7609['options']?_0x2d7609[_0x119d('0x1e')][_0x119d('0x1f')]||null:null})[_0x119d('0x10')](function(_0x4aedcb){if(_0x4aedcb){return _0x4aedcb[_0x119d('0x23')](_0x2d7609[_0x119d('0x1d')][_0x119d('0x24')],_[_0x119d('0x25')](_0x2d7609['body'],[_0x119d('0x24'),'id'])||{});}})[_0x119d('0x26')](function(_0x3cca53){logger[_0x119d('0x17')]('AddTags',_0x2d7609);logger[_0x119d('0x20')]('AddTags',_0x2d7609,JSON[_0x119d('0x21')](_0x3cca53));_0x3d0a3e(_0x3cca53);})['catch'](function(_0x31a4e4){logger[_0x119d('0x13')](_0x119d('0x27'),_0x31a4e4[_0x119d('0x16')],_0x2d7609);_0x4db9a8(_this[_0x119d('0x13')](0x1f4,_0x31a4e4[_0x119d('0x16')]));});});}; \ No newline at end of file +var _0xd63e=['catch','where','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','attributes','limit','stringify'];(function(_0x30d38b,_0x17979b){var _0x54137e=function(_0x565033){while(--_0x565033){_0x30d38b['push'](_0x30d38b['shift']());}};_0x54137e(++_0x17979b);}(_0xd63e,0xaf));var _0xed63=function(_0x3ecd7a,_0x3ca4a8){_0x3ecd7a=_0x3ecd7a-0x0;var _0x46afe2=_0xd63e[_0x3ecd7a];return _0x46afe2;};'use strict';var _=require(_0xed63('0x0'));var util=require(_0xed63('0x1'));var moment=require(_0xed63('0x2'));var BPromise=require('bluebird');var rs=require(_0xed63('0x3'));var fs=require('fs');var Redis=require(_0xed63('0x4'));var db=require(_0xed63('0x5'))['db'];var utils=require(_0xed63('0x6'));var logger=require('../../config/logger')(_0xed63('0x7'));var config=require(_0xed63('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed63('0x9')]['http']({'port':0x232a});config[_0xed63('0xa')]=_[_0xed63('0xb')](config[_0xed63('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xed63('0xc'))(new Redis(config[_0xed63('0xa')]));require(_0xed63('0xd'))[_0xed63('0xe')](socket);function respondWithRpcPromise(_0x21c42a,_0xa378a0,_0x3e4663){return new BPromise(function(_0x273c63,_0x4a2701){return client[_0xed63('0xf')](_0x21c42a,_0x3e4663)[_0xed63('0x10')](function(_0x548d94){logger[_0xed63('0x11')](_0xed63('0x12'),_0xa378a0,_0xed63('0x13'));logger[_0xed63('0x14')](_0xed63('0x15'),_0xa378a0,_0xed63('0x13'),JSON['stringify'](_0x548d94));if(_0x548d94['error']){if(_0x548d94[_0xed63('0x16')][_0xed63('0x17')]===0x1f4){logger[_0xed63('0x16')](_0xed63('0x12'),_0xa378a0,_0x548d94['error'][_0xed63('0x18')]);return _0x4a2701(_0x548d94[_0xed63('0x16')]['message']);}logger[_0xed63('0x16')](_0xed63('0x12'),_0xa378a0,_0x548d94[_0xed63('0x16')][_0xed63('0x18')]);return _0x273c63(_0x548d94[_0xed63('0x16')][_0xed63('0x18')]);}else{logger[_0xed63('0x11')]('MailInteraction,\x20%s,\x20%s',_0xa378a0,_0xed63('0x13'));_0x273c63(_0x548d94[_0xed63('0x19')][_0xed63('0x18')]);}})['catch'](function(_0x4904db){logger[_0xed63('0x16')](_0xed63('0x12'),_0xa378a0,_0x4904db);_0x4a2701(_0x4904db);});});}exports[_0xed63('0x1a')]=function(_0x2642e8){var _0x34632d=this;return new Promise(function(_0x596e57,_0x139b4c){return db[_0xed63('0x1b')][_0xed63('0x1c')](_0x2642e8[_0xed63('0x1d')],{'raw':_0x2642e8[_0xed63('0x1e')]?_0x2642e8['options'][_0xed63('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2642e8[_0xed63('0x1e')]?_0x2642e8[_0xed63('0x1e')]['where']||null:null,'attributes':_0x2642e8[_0xed63('0x1e')]?_0x2642e8['options'][_0xed63('0x20')]||null:null,'limit':_0x2642e8[_0xed63('0x1e')]?_0x2642e8[_0xed63('0x1e')][_0xed63('0x21')]||null:null})[_0xed63('0x10')](function(_0x3ca964){logger[_0xed63('0x11')](_0xed63('0x1a'),_0x2642e8);logger[_0xed63('0x14')](_0xed63('0x1a'),_0x2642e8,JSON[_0xed63('0x22')](_0x3ca964));_0x596e57(_0x3ca964);})[_0xed63('0x23')](function(_0x513170){logger['error'](_0xed63('0x1a'),_0x513170[_0xed63('0x18')],_0x2642e8);_0x139b4c(_0x34632d['error'](0x1f4,_0x513170[_0xed63('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x13f27a){return new Promise(function(_0x51cd6b,_0x23a4e8){return db[_0xed63('0x1b')]['find']({'where':_0x13f27a[_0xed63('0x1e')]?_0x13f27a['options'][_0xed63('0x24')]||null:null})[_0xed63('0x10')](function(_0x252d27){if(_0x252d27){return _0x252d27[_0xed63('0x25')](_0x13f27a[_0xed63('0x1d')][_0xed63('0x26')],_[_0xed63('0x27')](_0x13f27a[_0xed63('0x1d')],[_0xed63('0x26'),'id'])||{});}})[_0xed63('0x28')](function(_0x48c89c){logger[_0xed63('0x11')](_0xed63('0x29'),_0x13f27a);logger[_0xed63('0x14')](_0xed63('0x29'),_0x13f27a,JSON[_0xed63('0x22')](_0x48c89c));_0x51cd6b(_0x48c89c);})['catch'](function(_0x55d832){logger[_0xed63('0x16')](_0xed63('0x29'),_0x55d832['message'],_0x13f27a);_0x23a4e8(_this[_0xed63('0x16')](0x1f4,_0x55d832[_0xed63('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 021309a..a1c0db0 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 _0x9924=['./mailInteraction.events','save','update','emit','length','mailInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9924,0x168));var _0x4992=function(_0x5df4f1,_0x80f80){_0x5df4f1=_0x5df4f1-0x0;var _0x30fa40=_0x9924[_0x5df4f1];return _0x30fa40;};'use strict';var MailInteractionEvents=require(_0x4992('0x0'));var events=[_0x4992('0x1'),'remove',_0x4992('0x2')];function createListener(_0x1de907,_0x2892f2){return function(_0x57b658){_0x2892f2[_0x4992('0x3')](_0x1de907,_0x57b658);};}function removeListener(_0x294987,_0x17cab3){return function(){MailInteractionEvents['removeListener'](_0x294987,_0x17cab3);};}exports['register']=function(_0x5a098e){for(var _0x5e875d=0x0,_0x4212c8=events[_0x4992('0x4')];_0x5e875d<_0x4212c8;_0x5e875d++){var _0x11050c=events[_0x5e875d];var _0x9ccf4d=createListener(_0x4992('0x5')+_0x11050c,_0x5a098e);MailInteractionEvents['on'](_0x11050c,_0x9ccf4d);}}; \ No newline at end of file +var _0x4f97=['remove','update','emit','mailInteraction:','./mailInteraction.events','save'];(function(_0x49fe83,_0x46f0ae){var _0xcb705f=function(_0x1a1bf2){while(--_0x1a1bf2){_0x49fe83['push'](_0x49fe83['shift']());}};_0xcb705f(++_0x46f0ae);}(_0x4f97,0x17e));var _0x74f9=function(_0x4c44bd,_0x15d786){_0x4c44bd=_0x4c44bd-0x0;var _0x16280a=_0x4f97[_0x4c44bd];return _0x16280a;};'use strict';var MailInteractionEvents=require(_0x74f9('0x0'));var events=[_0x74f9('0x1'),_0x74f9('0x2'),_0x74f9('0x3')];function createListener(_0x150506,_0x1df8cf){return function(_0x523dfc){_0x1df8cf[_0x74f9('0x4')](_0x150506,_0x523dfc);};}function removeListener(_0x5e0fb6,_0x2ce192){return function(){MailInteractionEvents['removeListener'](_0x5e0fb6,_0x2ce192);};}exports['register']=function(_0x490a42){for(var _0x1e62a0=0x0,_0x49a78d=events['length'];_0x1e62a0<_0x49a78d;_0x1e62a0++){var _0x246474=events[_0x1e62a0];var _0x2dc9d9=createListener(_0x74f9('0x5')+_0x246474,_0x490a42);MailInteractionEvents['on'](_0x246474,_0x2dc9d9);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 260f12c..c92f57c 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 _0x806b=['/describe','isAuthenticated','describe','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0xc56c46,_0x1e2816){var _0x5950cb=function(_0x1f6fbf){while(--_0x1f6fbf){_0xc56c46['push'](_0xc56c46['shift']());}};_0x5950cb(++_0x1e2816);}(_0x806b,0x163));var _0xb806=function(_0x470dfa,_0x20afae){_0x470dfa=_0x470dfa-0x0;var _0x3112f9=_0x806b[_0x470dfa];return _0x3112f9;};'use strict';var express=require(_0xb806('0x0'));var router=express[_0xb806('0x1')]();var auth=require(_0xb806('0x2'));var controller=require(_0xb806('0x3'));router[_0xb806('0x4')](_0xb806('0x5'),auth[_0xb806('0x6')](),controller[_0xb806('0x7')]);module['exports']=router; \ No newline at end of file +var _0x3e24=['isAuthenticated','describe','express','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x3e24,0x167));var _0x43e2=function(_0x56a0ea,_0x513e71){_0x56a0ea=_0x56a0ea-0x0;var _0x49dde5=_0x3e24[_0x56a0ea];return _0x49dde5;};'use strict';var express=require(_0x43e2('0x0'));var router=express[_0x43e2('0x1')]();var auth=require(_0x43e2('0x2'));var controller=require(_0x43e2('0x3'));router[_0x43e2('0x4')]('/describe',auth[_0x43e2('0x5')](),controller[_0x43e2('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index 819ff22..0891102 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(_0x3fb53b,_0x4d20ab){var _0x3dbbbf=function(_0x5a4de5){while(--_0x5a4de5){_0x3fb53b['push'](_0x3fb53b['shift']());}};_0x3dbbbf(++_0x4d20ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0xa32800,_0x1c5795){var _0x1ad9d3=function(_0x389521){while(--_0x389521){_0xa32800['push'](_0xa32800['shift']());}};_0x1ad9d3(++_0x1c5795);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 299ac73..080748b 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 _0xd458=['sequelize','exports'];(function(_0x56b0f0,_0x529649){var _0x1f8f53=function(_0x4e4287){while(--_0x4e4287){_0x56b0f0['push'](_0x56b0f0['shift']());}};_0x1f8f53(++_0x529649);}(_0xd458,0xf2));var _0x8d45=function(_0x5bde83,_0x15d0a1){_0x5bde83=_0x5bde83-0x0;var _0x9f0470=_0xd458[_0x5bde83];return _0x9f0470;};'use strict';var Sequelize=require(_0x8d45('0x0'));module[_0x8d45('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file +var _0xe017=['sequelize','exports'];(function(_0x59fe5c,_0x2ae68c){var _0x2b5118=function(_0x33ef83){while(--_0x33ef83){_0x59fe5c['push'](_0x59fe5c['shift']());}};_0x2b5118(++_0x2ae68c);}(_0xe017,0x1ec));var _0x7e01=function(_0x2184a6,_0x3354a7){_0x2184a6=_0x2184a6-0x0;var _0x4c8057=_0xe017[_0x2184a6];return _0x4c8057;};'use strict';var Sequelize=require(_0x7e01('0x0'));module[_0x7e01('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'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 1398e21..a48c760 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 _0xb3dd=['define','MailInteractionHasTag','mail_interaction_has_tags','./mailInteractionHasTag','exports'];(function(_0x1a73a6,_0x31120d){var _0x378bed=function(_0xaf93c7){while(--_0xaf93c7){_0x1a73a6['push'](_0x1a73a6['shift']());}};_0x378bed(++_0x31120d);}(_0xb3dd,0x184));var _0xdb3d=function(_0x4ba1cf,_0x2364d4){_0x4ba1cf=_0x4ba1cf-0x0;var _0x5e5d5a=_0xb3dd[_0x4ba1cf];return _0x5e5d5a;};'use strict';var attributes=require(_0xdb3d('0x0'));module[_0xdb3d('0x1')]=function(_0x668ffa){return _0x668ffa[_0xdb3d('0x2')](_0xdb3d('0x3'),attributes,{'tableName':_0xdb3d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf7eb=['./mailInteractionHasTag','exports','define','MailInteractionHasTag'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xf7eb,0x124));var _0xbf7e=function(_0xe6a948,_0x5a81f0){_0xe6a948=_0xe6a948-0x0;var _0x2cd895=_0xf7eb[_0xe6a948];return _0x2cd895;};'use strict';var attributes=require(_0xbf7e('0x0'));module[_0xbf7e('0x1')]=function(_0xa05fd3){return _0xa05fd3[_0xbf7e('0x2')](_0xbf7e('0x3'),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 8217510..b8bdd12 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 _0xa000=['create','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','show','download','post','tracked','mailmessage:create'];(function(_0xfe80f2,_0xc8454e){var _0x2b6c63=function(_0x5c8d87){while(--_0x5c8d87){_0xfe80f2['push'](_0xfe80f2['shift']());}};_0x2b6c63(++_0xc8454e);}(_0xa000,0x177));var _0x0a00=function(_0x57be10,_0x3032f0){_0x57be10=_0x57be10-0x0;var _0x41c96a=_0xa000[_0x57be10];return _0x41c96a;};'use strict';var multer=require(_0x0a00('0x0'));var util=require(_0x0a00('0x1'));var path=require('path');var timeout=require(_0x0a00('0x2'));var express=require('express');var router=express[_0x0a00('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a00('0x4'));var interaction=require(_0x0a00('0x5'));var config=require('../../config/environment');var controller=require(_0x0a00('0x6'));router[_0x0a00('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a00('0x8')]);router['get'](_0x0a00('0x9'),auth[_0x0a00('0xa')](),controller[_0x0a00('0xb')]);router[_0x0a00('0x7')]('/:id',auth[_0x0a00('0xa')](),controller[_0x0a00('0xc')]);router[_0x0a00('0x7')]('/:id/download',auth[_0x0a00('0xa')](),controller[_0x0a00('0xd')]);router[_0x0a00('0xe')]('/',auth['isAuthenticated'](),interaction[_0x0a00('0xf')]('mail',_0x0a00('0x10')),controller[_0x0a00('0x11')]);router['put'](_0x0a00('0x12'),auth[_0x0a00('0xa')](),controller[_0x0a00('0x13')]);router[_0x0a00('0x14')](_0x0a00('0x15'),auth[_0x0a00('0xa')](),controller[_0x0a00('0x16')]);router[_0x0a00('0x14')](_0x0a00('0x17'),auth['isAuthenticated'](),controller[_0x0a00('0x18')]);router[_0x0a00('0x19')](_0x0a00('0x12'),auth['isAuthenticated'](),controller[_0x0a00('0x1a')]);module[_0x0a00('0x1b')]=router; \ No newline at end of file +var _0xee11=['delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','mail','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x26299e,_0x394ad1){var _0x6c4f4a=function(_0x539ae9){while(--_0x539ae9){_0x26299e['push'](_0x26299e['shift']());}};_0x6c4f4a(++_0x394ad1);}(_0xee11,0x146));var _0x1ee1=function(_0x458dd7,_0xe5602b){_0x458dd7=_0x458dd7-0x0;var _0x2a12f3=_0xee11[_0x458dd7];return _0x2a12f3;};'use strict';var multer=require(_0x1ee1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ee1('0x1'));var express=require(_0x1ee1('0x2'));var router=express[_0x1ee1('0x3')]();var fs_extra=require(_0x1ee1('0x4'));var auth=require(_0x1ee1('0x5'));var interaction=require(_0x1ee1('0x6'));var config=require(_0x1ee1('0x7'));var controller=require(_0x1ee1('0x8'));router['get']('/',auth[_0x1ee1('0x9')](),controller[_0x1ee1('0xa')]);router[_0x1ee1('0xb')](_0x1ee1('0xc'),auth[_0x1ee1('0x9')](),controller['describe']);router['get'](_0x1ee1('0xd'),auth[_0x1ee1('0x9')](),controller[_0x1ee1('0xe')]);router[_0x1ee1('0xb')]('/:id/download',auth[_0x1ee1('0x9')](),controller['download']);router[_0x1ee1('0xf')]('/',auth[_0x1ee1('0x9')](),interaction[_0x1ee1('0x10')](_0x1ee1('0x11'),'mailmessage:create'),controller[_0x1ee1('0x12')]);router[_0x1ee1('0x13')]('/:id',auth[_0x1ee1('0x9')](),controller[_0x1ee1('0x14')]);router[_0x1ee1('0x13')](_0x1ee1('0x15'),auth[_0x1ee1('0x9')](),controller[_0x1ee1('0x16')]);router[_0x1ee1('0x13')](_0x1ee1('0x17'),auth[_0x1ee1('0x9')](),controller[_0x1ee1('0x18')]);router[_0x1ee1('0x19')](_0x1ee1('0xd'),auth[_0x1ee1('0x9')](),controller[_0x1ee1('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 02082f4..a399c91 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 _0x9215=['BOOLEAN','ENUM','out','STRING','INTEGER','DATE','Email','Chat','sequelize','lodash','exports','TEXT','long','medium'];(function(_0x29a76d,_0x20a668){var _0xd12ea=function(_0x348ab3){while(--_0x348ab3){_0x29a76d['push'](_0x29a76d['shift']());}};_0xd12ea(++_0x20a668);}(_0x9215,0xb0));var _0x5921=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x9215[_0x4baae2];return _0x1a2285;};'use strict';var Sequelize=require(_0x5921('0x0'));var _=require(_0x5921('0x1'));module[_0x5921('0x2')]={'body':{'type':Sequelize[_0x5921('0x3')](_0x5921('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x5921('0x5'))},'read':{'type':Sequelize[_0x5921('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5921('0x7')]('in',_0x5921('0x8')),'defaultValue':_0x5921('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5921('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x5921('0x4'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x5921('0x3')](_0x5921('0x4'))},'subject':{'type':Sequelize[_0x5921('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x5921('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5921('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x5921('0xb')]},'originTo':{'type':Sequelize[_0x5921('0x3')](_0x5921('0x4'))},'originCc':{'type':Sequelize[_0x5921('0x3')](_0x5921('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x5921('0xc'),_0x5921('0xd')),'defaultValue':_0x5921('0xc'),'allowNull':![]}}; \ No newline at end of file +var _0xa9b2=['BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','exports','long','TEXT','medium'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9b2,0x110));var _0x2a9b=function(_0x4b4ce5,_0x573d2d){_0x4b4ce5=_0x4b4ce5-0x0;var _0x6522f3=_0xa9b2[_0x4b4ce5];return _0x6522f3;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2a9b('0x0')]={'body':{'type':Sequelize['TEXT'](_0x2a9b('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2a9b('0x2')](_0x2a9b('0x3'))},'read':{'type':Sequelize[_0x2a9b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2a9b('0x5')]('in',_0x2a9b('0x6')),'defaultValue':_0x2a9b('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2a9b('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x2a9b('0x1'))},'cc':{'type':Sequelize[_0x2a9b('0x2')]('long')},'bcc':{'type':Sequelize[_0x2a9b('0x2')](_0x2a9b('0x1'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2a9b('0x8')]},'attach':{'type':Sequelize[_0x2a9b('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2a9b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2a9b('0x8')]},'originTo':{'type':Sequelize[_0x2a9b('0x2')](_0x2a9b('0x1'))},'originCc':{'type':Sequelize[_0x2a9b('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x2a9b('0xa'),_0x2a9b('0xb')),'defaultValue':_0x2a9b('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 f0fa8c7..e7d47d9 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 _0xb678=['MailMessage,\x20%s,\x20%s','message','result','catch','status','undefined','limit','count','offset','set','Content-Range','json','update','then','destroy','end','sendStatus','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','MailMessage','includeAll','include','findAll','show','params','rawAttributes','options','find','body','create','out','secret','split','MailAccount','MailAccountId','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','CloudProvider','attachments','server/files/attachments','ListId','SendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','user','agent','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','get','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','rejectmessage','download','unix','toString','join','root','server','tmp','files','message-%s.eml','bcc','subject','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e64d9,_0xb661e7){var _0x4305d2=function(_0x1f5923){while(--_0x1f5923){_0x3e64d9['push'](_0x3e64d9['shift']());}};_0x4305d2(++_0xb661e7);}(_0xb678,0x83));var _0x8b67=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xb678[_0x4f9b18];return _0x29f20c;};'use strict';var emlformat=require(_0x8b67('0x0'));var moment=require(_0x8b67('0x1'));var BPromise=require(_0x8b67('0x2'));var util=require(_0x8b67('0x3'));var path=require(_0x8b67('0x4'));var fs=require('fs');var _=require(_0x8b67('0x5'));var Redis=require(_0x8b67('0x6'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0x8b67('0x7'))(_0x8b67('0x8'));var interaction_log=require('../../config/logger')(_0x8b67('0x9'));var config=require(_0x8b67('0xa'));var db=require(_0x8b67('0xb'))['db'];config['redis']=_[_0x8b67('0xc')](config[_0x8b67('0xd')],{'host':_0x8b67('0xe'),'port':0x18eb});var socket=require(_0x8b67('0xf'))(new Redis(config[_0x8b67('0xd')]));var htmlEntities=require(_0x8b67('0x10'));require(_0x8b67('0x11'))['register'](socket);var jayson=require(_0x8b67('0x12'));var client=jayson[_0x8b67('0x13')][_0x8b67('0x14')]({'port':0x232c});var client9003=jayson['client'][_0x8b67('0x14')]({'port':0x232b});var client9002=jayson[_0x8b67('0x13')][_0x8b67('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x779ee3,_0x233e58,_0x5422f7,_0x218ed5){return new BPromise(function(_0x5e8ce7,_0x2487e1){var _0xce30e9=_0x218ed5||client;return _0xce30e9[_0x8b67('0x15')](_0x779ee3,_0x5422f7)['then'](function(_0x56982d){logger[_0x8b67('0x16')]('MailMessage,\x20%s,\x20%s',_0x233e58,_0x8b67('0x17'));logger[_0x8b67('0x18')](_0x8b67('0x19'),_0x233e58,_0x8b67('0x17'),JSON[_0x8b67('0x1a')](_0x56982d));if(_0x56982d[_0x8b67('0x1b')]){if(_0x56982d[_0x8b67('0x1b')][_0x8b67('0x1c')]===0x1f4){logger[_0x8b67('0x1b')](_0x8b67('0x1d'),_0x233e58,_0x56982d[_0x8b67('0x1b')][_0x8b67('0x1e')]);return _0x2487e1(_0x56982d[_0x8b67('0x1b')][_0x8b67('0x1e')]);}logger[_0x8b67('0x1b')](_0x8b67('0x1d'),_0x233e58,_0x56982d[_0x8b67('0x1b')]['message']);return _0x5e8ce7(_0x56982d[_0x8b67('0x1b')][_0x8b67('0x1e')]);}else{logger[_0x8b67('0x16')](_0x8b67('0x1d'),_0x233e58,_0x8b67('0x17'));_0x5e8ce7(_0x56982d[_0x8b67('0x1f')][_0x8b67('0x1e')]);}})[_0x8b67('0x20')](function(_0x523164){logger[_0x8b67('0x1b')](_0x8b67('0x1d'),_0x233e58,_0x523164);_0x2487e1(_0x523164);});});}function respondWithResult(_0x467ed5,_0x33464e){_0x33464e=_0x33464e||0xc8;return function(_0x2faaf7){if(_0x2faaf7){return _0x467ed5[_0x8b67('0x21')](_0x33464e)['json'](_0x2faaf7);}};}function respondWithFilteredResult(_0x470864,_0x56b7e9){return function(_0xab71b2){if(_0xab71b2){var _0x33275b=typeof _0x56b7e9['offset']===_0x8b67('0x22')&&typeof _0x56b7e9[_0x8b67('0x23')]===_0x8b67('0x22');var _0x348e70=_0xab71b2[_0x8b67('0x24')];var _0x54e89a=_0x33275b?0x0:_0x56b7e9[_0x8b67('0x25')];var _0x21c70c=_0x33275b?_0xab71b2[_0x8b67('0x24')]:_0x56b7e9[_0x8b67('0x25')]+_0x56b7e9[_0x8b67('0x23')];var _0x5d1f09;if(_0x21c70c>=_0x348e70){_0x21c70c=_0x348e70;_0x5d1f09=0xc8;}else{_0x5d1f09=0xce;}_0x470864[_0x8b67('0x21')](_0x5d1f09);return _0x470864[_0x8b67('0x26')](_0x8b67('0x27'),_0x54e89a+'-'+_0x21c70c+'/'+_0x348e70)[_0x8b67('0x28')](_0xab71b2);}return null;};}function saveUpdates(_0x330e05){return function(_0x2df221){if(_0x2df221){return _0x2df221[_0x8b67('0x29')](_0x330e05)[_0x8b67('0x2a')](function(_0x22d83c){return _0x22d83c;});}return null;};}function removeEntity(_0x109da2){return function(_0x515489){if(_0x515489){return _0x515489[_0x8b67('0x2b')]()[_0x8b67('0x2a')](function(){_0x109da2['status'](0xcc)[_0x8b67('0x2c')]();});}};}function handleEntityNotFound(_0x303e6d){return function(_0x21adbf){if(!_0x21adbf){_0x303e6d[_0x8b67('0x2d')](0x194);}return _0x21adbf;};}function handleError(_0x189179,_0x34ff09){_0x34ff09=_0x34ff09||0x1f4;return function(_0x490375){logger[_0x8b67('0x1b')](_0x490375[_0x8b67('0x2e')]);if(_0x490375[_0x8b67('0x2f')]){delete _0x490375[_0x8b67('0x2f')];}_0x189179['status'](_0x34ff09)[_0x8b67('0x30')](_0x490375);};}exports[_0x8b67('0x31')]=function(_0x45741f,_0x4993c4){var _0x2aaa45={},_0x50328b={},_0x5ce1a3={'count':0x0,'rows':[]};var _0x28da31=_[_0x8b67('0x32')](db['MailMessage']['rawAttributes'],function(_0x1ffb4e){return{'name':_0x1ffb4e['fieldName'],'type':_0x1ffb4e['type'][_0x8b67('0x33')]};});_0x50328b[_0x8b67('0x34')]=_[_0x8b67('0x32')](_0x28da31,'name');_0x50328b[_0x8b67('0x35')]=_[_0x8b67('0x36')](_0x45741f[_0x8b67('0x35')]);_0x50328b[_0x8b67('0x37')]=_[_0x8b67('0x38')](_0x50328b[_0x8b67('0x34')],_0x50328b[_0x8b67('0x35')]);_0x2aaa45[_0x8b67('0x39')]=_[_0x8b67('0x38')](_0x50328b[_0x8b67('0x34')],qs[_0x8b67('0x3a')](_0x45741f[_0x8b67('0x35')][_0x8b67('0x3a')]));_0x2aaa45[_0x8b67('0x39')]=_0x2aaa45[_0x8b67('0x39')][_0x8b67('0x3b')]?_0x2aaa45[_0x8b67('0x39')]:_0x50328b[_0x8b67('0x34')];if(!_0x45741f[_0x8b67('0x35')][_0x8b67('0x3c')]('nolimit')){_0x2aaa45[_0x8b67('0x23')]=qs['limit'](_0x45741f['query'][_0x8b67('0x23')]);_0x2aaa45[_0x8b67('0x25')]=qs[_0x8b67('0x25')](_0x45741f[_0x8b67('0x35')][_0x8b67('0x25')]);}_0x2aaa45['order']=qs[_0x8b67('0x3d')](_0x45741f[_0x8b67('0x35')][_0x8b67('0x3d')]);_0x2aaa45['where']=qs[_0x8b67('0x37')](_[_0x8b67('0x3e')](_0x45741f['query'],_0x50328b[_0x8b67('0x37')]),_0x28da31);if(_0x45741f[_0x8b67('0x35')][_0x8b67('0x3f')]){_0x2aaa45[_0x8b67('0x40')]=_[_0x8b67('0x41')](_0x2aaa45[_0x8b67('0x40')],{'$or':_[_0x8b67('0x32')](_0x28da31,function(_0x141040){if(_0x141040[_0x8b67('0x42')]!==_0x8b67('0x43')){var _0x4c5d27={};_0x4c5d27[_0x141040[_0x8b67('0x2f')]]={'$like':'%'+_0x45741f[_0x8b67('0x35')][_0x8b67('0x3f')]+'%'};return _0x4c5d27;}})});}_0x2aaa45=_['merge']({},_0x2aaa45,_0x45741f['options']);var _0x554da0={'where':_0x2aaa45[_0x8b67('0x40')]};return db[_0x8b67('0x44')][_0x8b67('0x24')](_0x554da0)['then'](function(_0x527fd4){_0x5ce1a3[_0x8b67('0x24')]=_0x527fd4;if(_0x45741f[_0x8b67('0x35')][_0x8b67('0x45')]){_0x2aaa45[_0x8b67('0x46')]=[{'all':!![]}];}return db[_0x8b67('0x44')][_0x8b67('0x47')](_0x2aaa45);})[_0x8b67('0x2a')](function(_0x197acc){_0x5ce1a3['rows']=_0x197acc;return _0x5ce1a3;})['then'](respondWithFilteredResult(_0x4993c4,_0x2aaa45))['catch'](handleError(_0x4993c4,null));};exports[_0x8b67('0x48')]=function(_0x5bdb79,_0x254d12){var _0x3dd3fe={'raw':!![],'where':{'id':_0x5bdb79[_0x8b67('0x49')]['id']}},_0x4037ba={};_0x4037ba[_0x8b67('0x34')]=_[_0x8b67('0x36')](db[_0x8b67('0x44')][_0x8b67('0x4a')]);_0x4037ba['query']=_[_0x8b67('0x36')](_0x5bdb79[_0x8b67('0x35')]);_0x4037ba[_0x8b67('0x37')]=_['intersection'](_0x4037ba['model'],_0x4037ba[_0x8b67('0x35')]);_0x3dd3fe[_0x8b67('0x39')]=_['intersection'](_0x4037ba[_0x8b67('0x34')],qs['fields'](_0x5bdb79[_0x8b67('0x35')]['fields']));_0x3dd3fe[_0x8b67('0x39')]=_0x3dd3fe[_0x8b67('0x39')]['length']?_0x3dd3fe[_0x8b67('0x39')]:_0x4037ba[_0x8b67('0x34')];if(_0x5bdb79[_0x8b67('0x35')][_0x8b67('0x45')]){_0x3dd3fe[_0x8b67('0x46')]=[{'all':!![]}];}_0x3dd3fe=_[_0x8b67('0x41')]({},_0x3dd3fe,_0x5bdb79[_0x8b67('0x4b')]);return db['MailMessage'][_0x8b67('0x4c')](_0x3dd3fe)['then'](handleEntityNotFound(_0x254d12,null))[_0x8b67('0x2a')](respondWithResult(_0x254d12,null))[_0x8b67('0x20')](handleError(_0x254d12,null));};exports[_0x8b67('0x29')]=function(_0x5541df,_0x5edfad){if(_0x5541df[_0x8b67('0x4d')]['id']){delete _0x5541df[_0x8b67('0x4d')]['id'];}return db[_0x8b67('0x44')][_0x8b67('0x4c')]({'where':{'id':_0x5541df[_0x8b67('0x49')]['id']}})[_0x8b67('0x2a')](handleEntityNotFound(_0x5edfad,null))[_0x8b67('0x2a')](saveUpdates(_0x5541df[_0x8b67('0x4d')],null))['then'](respondWithResult(_0x5edfad,null))['catch'](handleError(_0x5edfad,null));};exports[_0x8b67('0x2b')]=function(_0x3af6fc,_0x47f139){return db[_0x8b67('0x44')]['find']({'where':{'id':_0x3af6fc[_0x8b67('0x49')]['id']}})['then'](handleEntityNotFound(_0x47f139,null))['then'](removeEntity(_0x47f139,null))[_0x8b67('0x20')](handleError(_0x47f139,null));};exports['describe']=function(_0x5a1147,_0x2e1e3e){return db['MailMessage']['describe']()[_0x8b67('0x2a')](respondWithResult(_0x2e1e3e,null))[_0x8b67('0x20')](handleError(_0x2e1e3e,null));};exports['create']=function(_0xd7fb48,_0x188f5f){return db[_0x8b67('0x44')][_0x8b67('0x4e')](_0xd7fb48[_0x8b67('0x4d')])['then'](function(_0x2bffb2){if(_0x2bffb2){if(_0x2bffb2['direction']===_0x8b67('0x4f')&&!_0x2bffb2[_0x8b67('0x50')]){var _0x201864,_0x510f71,_0x217603;if(_0xd7fb48[_0x8b67('0x4d')]['to']){_0x510f71=_0xd7fb48[_0x8b67('0x4d')]['to'][_0x8b67('0x51')](',')[0x0];}return db[_0x8b67('0x52')]['findOne']({'where':{'id':_0x2bffb2[_0x8b67('0x53')]},'include':[{'model':db['CmList'],'as':_0x8b67('0x54'),'include':[{'model':db[_0x8b67('0x55')],'as':_0x8b67('0x56'),'where':{'email':_0x510f71},'limit':0x1,'order':[[_0x8b67('0x57'),'DESC']]}]},{'model':db[_0x8b67('0x58')],'as':_0x8b67('0x59'),'raw':!![],'include':[{'model':db[_0x8b67('0x5a')],'as':_0x8b67('0x5a'),'raw':!![]}]}]})[_0x8b67('0x2a')](function(_0x1462ec){_0x201864=_0x1462ec;if(!_0x201864||!_0x201864[_0x8b67('0x59')])return;var _0x1044bb=_0x201864['getSmtpOptions']();if(_0xd7fb48['body'][_0x8b67('0x5b')]&&_0xd7fb48['body'][_0x8b67('0x5b')][_0x8b67('0x3b')]){for(var _0x269a8a=0x0;_0x269a8a<_0xd7fb48[_0x8b67('0x4d')][_0x8b67('0x5b')]['length'];_0x269a8a+=0x1){_0xd7fb48[_0x8b67('0x4d')][_0x8b67('0x5b')][_0x269a8a]={'filename':_0xd7fb48['body'][_0x8b67('0x5b')][_0x269a8a][_0x8b67('0x2f')],'path':path['join'](config['root'],_0x8b67('0x5c'),_0xd7fb48[_0x8b67('0x4d')][_0x8b67('0x5b')][_0x269a8a]['basename'])};}}_0x217603={'account':_0x1044bb,'message':_0xd7fb48['body']};return;})[_0x8b67('0x2a')](function(){if(_0x201864['List']){if(_0x201864['List'][_0x8b67('0x56')][_0x8b67('0x3b')]){return _0x201864['List'][_0x8b67('0x56')][0x0];}else{return db['CmContact'][_0x8b67('0x4e')](_[_0x8b67('0xc')](_0xd7fb48[_0x8b67('0x4d')],{'firstName':_0xd7fb48['body']['to'],'email':_0xd7fb48[_0x8b67('0x4d')]['to'],'phone':_0xd7fb48[_0x8b67('0x4d')]['to'],'ListId':_0x201864[_0x8b67('0x5d')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x8b67('0x2a')](function(){if(_0x217603){return respondWithRpcPromise(_0x8b67('0x5e'),'sendMail',_0x217603,client9003)[_0x8b67('0x2a')](function(_0x30d071){return _0x2bffb2['update']({'read':!![],'messageId':_0x30d071['messageId'],'sentAt':moment()[_0x8b67('0x5f')](_0x8b67('0x60'))});})[_0x8b67('0x20')](function(_0x489b76){logger['error']('%s',JSON[_0x8b67('0x1a')](_0x489b76));return _0x2bffb2;});}return _0x2bffb2;});}return _0x2bffb2;}})[_0x8b67('0x2a')](respondWithResult(_0x188f5f,0xc9))[_0x8b67('0x20')](handleError(_0x188f5f,null));};exports[_0x8b67('0x61')]=function(_0xf36cc0,_0x51261f){var _0x350a0a={'agent':{},'channel':_0x8b67('0x62')};if(_0xf36cc0[_0x8b67('0x4d')]['id']){delete _0xf36cc0['body']['id'];}_0xf36cc0['body'][_0x8b67('0x63')]=!![];_0xf36cc0[_0x8b67('0x4d')][_0x8b67('0x64')]=moment()[_0x8b67('0x5f')](_0x8b67('0x60'));_0xf36cc0[_0x8b67('0x4d')][_0x8b67('0x65')]=_0xf36cc0['body'][_0x8b67('0x65')]||_0xf36cc0[_0x8b67('0x66')]['id'];_0x350a0a[_0x8b67('0x67')]['id']=_0xf36cc0[_0x8b67('0x4d')][_0x8b67('0x65')];return db[_0x8b67('0x44')][_0x8b67('0x4c')]({'where':{'id':_0xf36cc0[_0x8b67('0x49')]['id'],'UserId':null}})[_0x8b67('0x2a')](handleEntityNotFound(_0x51261f,null))[_0x8b67('0x2a')](saveUpdates(_0xf36cc0['body'],null))[_0x8b67('0x2a')](function(_0x4d16bf){if(_0x4d16bf){_0x350a0a['message']=_0x4d16bf['get']({'plain':!![]});return db[_0x8b67('0x68')][_0x8b67('0x4c')]({'where':{'id':_0x4d16bf[_0x8b67('0x69')]}});}return null;})[_0x8b67('0x2a')](handleEntityNotFound(_0x51261f,null))[_0x8b67('0x2a')](function(_0x512c07){if(_0x512c07){return _0x512c07[_0x8b67('0x29')]({'UserId':_0xf36cc0[_0x8b67('0x4d')][_0x8b67('0x65')],'read1stAt':_[_0x8b67('0x6a')](_0x512c07[_0x8b67('0x6b')])?moment()[_0x8b67('0x5f')](_0x8b67('0x60')):undefined});}return null;})[_0x8b67('0x2a')](function(_0x4f9d2d){if(_0x4f9d2d){_0x350a0a[_0x8b67('0x6c')]=_0x4f9d2d['get']({'plain':!![]});interaction_log[_0x8b67('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf36cc0[_0x8b67('0x66')]['id'],_0xf36cc0[_0x8b67('0x66')][_0x8b67('0x2f')],_0xf36cc0['user']['role'],_0x350a0a['interaction']['id'],_0xf36cc0[_0x8b67('0x4d')]?JSON[_0x8b67('0x1a')](_0xf36cc0['body']):_0x8b67('0x6d'));return respondWithRpcPromise(_0x8b67('0x6e'),_0x8b67('0x6f'),_0x350a0a);}return null;})['then'](function(_0x59208e){var _0x6379e9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x59208e[_0x8b67('0x1e')][_0x8b67('0x70')];return db['sequelize'][_0x8b67('0x35')](_0x6379e9,{'type':db['Sequelize'][_0x8b67('0x71')][_0x8b67('0x72')],'raw':!![]})[_0x8b67('0x2a')](function(_0xc9b9cc){return _0xc9b9cc;});})[_0x8b67('0x2a')](function(_0x5c96ba){if(_0x5c96ba){_0x350a0a['message'][_0x8b67('0x73')]=_0x5c96ba[0x0];if(!_0xf36cc0['body'][_0x8b67('0x65')])return;return db[_0x8b67('0x74')]['find']({'where':{'id':_0xf36cc0['body'][_0x8b67('0x65')],'role':_0x8b67('0x67')},'attributes':['id','name','fullname',_0x8b67('0x75'),_0x8b67('0x76')],'raw':!![]});}return null;})[_0x8b67('0x2a')](function(_0x1f9462){if(!_0x1f9462)return null;_0x350a0a[_0x8b67('0x1e')]['agent']=_0x1f9462;return _0x350a0a;})[_0x8b67('0x2a')](function(_0x890f1){if(_0x890f1){if(_0xf36cc0['body'][_0x8b67('0x77')]){_0x350a0a[_0x8b67('0x1e')][_0x8b67('0x78')]=util[_0x8b67('0x5f')](_0x8b67('0x79'),_0xf36cc0['user'][_0x8b67('0x2f')]);_0x350a0a[_0x8b67('0x1e')][_0x8b67('0x7a')]=_0x350a0a[_0x8b67('0x7a')];_0x350a0a['message'][_0x8b67('0x7b')]=_0x350a0a[_0x8b67('0x7a')];_0x350a0a['message'][_0x8b67('0x7c')]=_0x8b67('0x61');_0x350a0a[_0x8b67('0x1e')][_0x8b67('0x4d')]=htmlToText[_0x8b67('0x7d')](_0x350a0a[_0x8b67('0x1e')][_0x8b67('0x4d')]);return respondWithRpcPromise('EventManager',_0x8b67('0x7e'),{'event':_0x8b67('0x7f'),'message':_0x350a0a[_0x8b67('0x1e')]},client9002)[_0x8b67('0x2a')](function(){return _0x350a0a;});}return _0x350a0a;}return null;})[_0x8b67('0x2a')](respondWithResult(_0x51261f,null))[_0x8b67('0x20')](handleError(_0x51261f,null));};exports[_0x8b67('0x80')]=function(_0x2b1234,_0x397f57){var _0x455777={'agent':{},'channel':_0x8b67('0x62')};if(_0x2b1234['body']['id']){delete _0x2b1234[_0x8b67('0x4d')]['id'];}_0x2b1234[_0x8b67('0x4d')]['UserId']=_0x2b1234[_0x8b67('0x4d')][_0x8b67('0x65')]||_0x2b1234['user']['id'];_0x455777[_0x8b67('0x67')]['id']=_0x2b1234[_0x8b67('0x4d')]['UserId'];return db[_0x8b67('0x44')][_0x8b67('0x4c')]({'where':{'id':_0x2b1234[_0x8b67('0x49')]['id'],'UserId':null}})[_0x8b67('0x2a')](handleEntityNotFound(_0x397f57,null))['then'](function(_0x4cb751){if(_0x4cb751){_0x455777['message']=_0x4cb751[_0x8b67('0x81')]({'plain':!![]});return db['MailInteraction'][_0x8b67('0x4c')]({'where':{'id':_0x4cb751[_0x8b67('0x69')]}});}return null;})[_0x8b67('0x2a')](handleEntityNotFound(_0x397f57,null))[_0x8b67('0x2a')](function(_0x41a898){if(_0x41a898){_0x455777[_0x8b67('0x6c')]=_0x41a898[_0x8b67('0x81')]({'plain':!![]});interaction_log[_0x8b67('0x16')](_0x8b67('0x82'),_0x2b1234[_0x8b67('0x66')]['id'],_0x2b1234['user'][_0x8b67('0x2f')],_0x2b1234[_0x8b67('0x66')][_0x8b67('0x83')],_0x455777['interaction']['id'],_0x2b1234[_0x8b67('0x4d')]?JSON[_0x8b67('0x1a')](_0x2b1234[_0x8b67('0x4d')]):_0x8b67('0x6d'));return respondWithRpcPromise(_0x8b67('0x84'),'rejectMessage',_0x455777);}return null;})[_0x8b67('0x2a')](function(_0x1473ec){var _0x13a8c2=_0x8b67('0x85')+_0x1473ec[_0x8b67('0x1e')]['ContactId'];return db['sequelize'][_0x8b67('0x35')](_0x13a8c2,{'type':db[_0x8b67('0x86')]['QueryTypes'][_0x8b67('0x72')],'raw':!![]})[_0x8b67('0x2a')](function(_0x54bb0c){return _0x54bb0c;});})[_0x8b67('0x2a')](function(_0x1d8f96){if(_0x1d8f96){_0x455777['message'][_0x8b67('0x73')]=_0x1d8f96[0x0];if(!_0x2b1234[_0x8b67('0x4d')][_0x8b67('0x65')])return;return db[_0x8b67('0x74')][_0x8b67('0x4c')]({'where':{'id':_0x2b1234['body'][_0x8b67('0x65')],'role':_0x8b67('0x67')},'attributes':['id',_0x8b67('0x2f'),_0x8b67('0x87'),'email',_0x8b67('0x76')],'raw':!![]});}return null;})[_0x8b67('0x2a')](function(_0x4834f6){if(!_0x4834f6)return null;_0x455777[_0x8b67('0x1e')][_0x8b67('0x67')]=_0x4834f6;return _0x455777;})[_0x8b67('0x2a')](function(_0xafa35f){if(_0xafa35f){_0xafa35f[_0x8b67('0x1e')][_0x8b67('0x78')]=util[_0x8b67('0x5f')](_0x8b67('0x79'),_0x2b1234[_0x8b67('0x66')]['name']);_0xafa35f[_0x8b67('0x1e')]['channel']=_0x455777[_0x8b67('0x7a')];_0xafa35f[_0x8b67('0x1e')][_0x8b67('0x7b')]=_0x455777[_0x8b67('0x7a')];_0xafa35f[_0x8b67('0x1e')][_0x8b67('0x7c')]=_0x8b67('0x80');_0xafa35f[_0x8b67('0x1e')][_0x8b67('0x4d')]=htmlToText[_0x8b67('0x7d')](_0x455777[_0x8b67('0x1e')]['body']);respondWithRpcPromise(_0x8b67('0x7e'),_0x8b67('0x7e'),{'event':_0x8b67('0x88'),'message':_0xafa35f[_0x8b67('0x1e')]},client9002);return _0x455777;}return null;})['then'](respondWithResult(_0x397f57,null))[_0x8b67('0x20')](handleError(_0x397f57,null));};exports[_0x8b67('0x89')]=function(_0x33e580,_0x20d405){var _0x35a9ea=moment()[_0x8b67('0x8a')]()[_0x8b67('0x8b')]();var _0x5b75c5=path[_0x8b67('0x8c')](config[_0x8b67('0x8d')],_0x8b67('0x8e'),'files',_0x8b67('0x8f'));var _0x6b65e3=path['join'](config[_0x8b67('0x8d')],_0x8b67('0x8e'),_0x8b67('0x90'),_0x8b67('0x5b'));var _0x41182c=util[_0x8b67('0x5f')](_0x8b67('0x91'),_0x35a9ea);return db['MailMessage'][_0x8b67('0x4c')]({'where':{'id':_0x33e580[_0x8b67('0x49')]['id']},'attributes':['id',_0x8b67('0x4d'),'from','to','cc',_0x8b67('0x92'),_0x8b67('0x93'),'createdAt'],'include':_0x33e580[_0x8b67('0x35')][_0x8b67('0x5b')]?[{'model':db[_0x8b67('0x94')],'as':_0x8b67('0x95')}]:undefined})['then'](handleEntityNotFound(_0x20d405,null))['then'](function(_0x22ce83){if(_0x22ce83){var _0x4ebb37=_0x22ce83;var _0x459a28={'from':_0x4ebb37['from'],'to':_0x4ebb37['to'],'subject':_0x4ebb37[_0x8b67('0x93')],'html':htmlEntities[_0x8b67('0x96')](_0x4ebb37[_0x8b67('0x4d')]),'headers':{'Date':moment(_0x4ebb37['createdAt'])[_0x8b67('0x5f')](_0x8b67('0x97'))},'attachments':[]};if(_0x22ce83['cc']){_0x459a28[_0x8b67('0x98')]['Cc']=_0x22ce83['cc'];}if(_0x22ce83[_0x8b67('0x92')]){_0x459a28[_0x8b67('0x98')][_0x8b67('0x99')]=_0x22ce83[_0x8b67('0x92')];}return new BPromise(function(_0x5b6fcb,_0xbbdb5c){if(_0x22ce83[_0x8b67('0x95')]){for(var _0x529f47=0x0;_0x529f47<_0x22ce83['Attachments'][_0x8b67('0x3b')];_0x529f47++){var _0x4dfc7e=_0x22ce83[_0x8b67('0x95')][_0x529f47];var _0x211769=path[_0x8b67('0x8c')](_0x6b65e3,_0x4dfc7e[_0x8b67('0x9a')]);if(fs[_0x8b67('0x9b')](_0x211769)){_0x459a28[_0x8b67('0x5b')][_0x8b67('0x9c')]({'name':_0x4dfc7e[_0x8b67('0x2f')],'contentType':_0x4dfc7e[_0x8b67('0x42')],'data':fs['readFileSync'](_0x211769)});}}}emlformat[_0x8b67('0x9d')](_0x459a28,function(_0xbaae55,_0x5c12a7){if(_0xbaae55)return _0xbbdb5c(_0xbaae55);fs[_0x8b67('0x9e')](path[_0x8b67('0x8c')](_0x5b75c5,_0x41182c),_0x5c12a7);return _0x5b6fcb(_0x5c12a7);});});}})[_0x8b67('0x2a')](function(_0x5ba96e){if(_0x5ba96e){return _0x20d405[_0x8b67('0x89')](path['join'](_0x5b75c5,_0x41182c),_0x41182c,function(_0x55918c){if(!_0x55918c)fs[_0x8b67('0x9f')](path[_0x8b67('0x8c')](_0x5b75c5,_0x41182c));});}})['catch'](handleError(_0x20d405,null));}; \ No newline at end of file +var _0x0937=['MailMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','length','find','body','describe','create','direction','out','secret','MailAccount','findOne','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','messageId','mail','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','MailInteraction','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','fromString','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','contact','reject','EventManager','rejectmessage','unix','toString','server','files','message-%s.eml','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','readFileSync','unlinkSync','eml-format','bluebird','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','html-entities','./mailMessage.socket','jayson/promise','client','http','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','sendStatus','stack','name','index','map'];(function(_0x1a94c4,_0x539fc0){var _0x526bc9=function(_0x2dd1f5){while(--_0x2dd1f5){_0x1a94c4['push'](_0x1a94c4['shift']());}};_0x526bc9(++_0x539fc0);}(_0x0937,0xfe));var _0x7093=function(_0x2123c0,_0x33a464){_0x2123c0=_0x2123c0-0x0;var _0x5d666c=_0x0937[_0x2123c0];return _0x5d666c;};'use strict';var emlformat=require(_0x7093('0x0'));var moment=require('moment');var BPromise=require(_0x7093('0x1'));var util=require('util');var path=require(_0x7093('0x2'));var fs=require('fs');var _=require(_0x7093('0x3'));var Redis=require('ioredis');var htmlToText=require(_0x7093('0x4'));var qs=require(_0x7093('0x5'));var logger=require(_0x7093('0x6'))(_0x7093('0x7'));var interaction_log=require('../../config/logger')(_0x7093('0x8'));var config=require(_0x7093('0x9'));var db=require(_0x7093('0xa'))['db'];config[_0x7093('0xb')]=_['defaults'](config[_0x7093('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7093('0xb')]));var htmlEntities=require(_0x7093('0xc'));require(_0x7093('0xd'))['register'](socket);var jayson=require(_0x7093('0xe'));var client=jayson[_0x7093('0xf')][_0x7093('0x10')]({'port':0x232c});var client9003=jayson[_0x7093('0xf')][_0x7093('0x10')]({'port':0x232b});var client9002=jayson[_0x7093('0xf')][_0x7093('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x22bd09,_0x36e973,_0x402577,_0x1dc280){return new BPromise(function(_0xb92cb8,_0x426ede){var _0x2eec78=_0x1dc280||client;return _0x2eec78['request'](_0x22bd09,_0x402577)[_0x7093('0x11')](function(_0x16210d){logger[_0x7093('0x12')](_0x7093('0x13'),_0x36e973,'request\x20sent');logger[_0x7093('0x14')](_0x7093('0x15'),_0x36e973,_0x7093('0x16'),JSON[_0x7093('0x17')](_0x16210d));if(_0x16210d[_0x7093('0x18')]){if(_0x16210d[_0x7093('0x18')][_0x7093('0x19')]===0x1f4){logger[_0x7093('0x18')]('MailMessage,\x20%s,\x20%s',_0x36e973,_0x16210d[_0x7093('0x18')][_0x7093('0x1a')]);return _0x426ede(_0x16210d[_0x7093('0x18')][_0x7093('0x1a')]);}logger['error'](_0x7093('0x13'),_0x36e973,_0x16210d['error'][_0x7093('0x1a')]);return _0xb92cb8(_0x16210d['error']['message']);}else{logger[_0x7093('0x12')](_0x7093('0x13'),_0x36e973,_0x7093('0x16'));_0xb92cb8(_0x16210d[_0x7093('0x1b')][_0x7093('0x1a')]);}})[_0x7093('0x1c')](function(_0x577c8a){logger[_0x7093('0x18')](_0x7093('0x13'),_0x36e973,_0x577c8a);_0x426ede(_0x577c8a);});});}function respondWithResult(_0x42d229,_0x1c793c){_0x1c793c=_0x1c793c||0xc8;return function(_0x32c50e){if(_0x32c50e){return _0x42d229['status'](_0x1c793c)[_0x7093('0x1d')](_0x32c50e);}};}function respondWithFilteredResult(_0x46a923,_0x21fa5b){return function(_0x456eec){if(_0x456eec){var _0x1eb3a7=typeof _0x21fa5b[_0x7093('0x1e')]===_0x7093('0x1f')&&typeof _0x21fa5b[_0x7093('0x20')]===_0x7093('0x1f');var _0xefda61=_0x456eec[_0x7093('0x21')];var _0x4121f=_0x1eb3a7?0x0:_0x21fa5b[_0x7093('0x1e')];var _0x3afb70=_0x1eb3a7?_0x456eec['count']:_0x21fa5b['offset']+_0x21fa5b[_0x7093('0x20')];var _0x245fc9;if(_0x3afb70>=_0xefda61){_0x3afb70=_0xefda61;_0x245fc9=0xc8;}else{_0x245fc9=0xce;}_0x46a923[_0x7093('0x22')](_0x245fc9);return _0x46a923[_0x7093('0x23')](_0x7093('0x24'),_0x4121f+'-'+_0x3afb70+'/'+_0xefda61)[_0x7093('0x1d')](_0x456eec);}return null;};}function saveUpdates(_0xf71957){return function(_0x56f974){if(_0x56f974){return _0x56f974[_0x7093('0x25')](_0xf71957)[_0x7093('0x11')](function(_0x24ccb9){return _0x24ccb9;});}return null;};}function removeEntity(_0x128dff){return function(_0x36f1fa){if(_0x36f1fa){return _0x36f1fa[_0x7093('0x26')]()[_0x7093('0x11')](function(){_0x128dff['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x374f16){return function(_0x53c393){if(!_0x53c393){_0x374f16[_0x7093('0x27')](0x194);}return _0x53c393;};}function handleError(_0x31c47f,_0x63d8fd){_0x63d8fd=_0x63d8fd||0x1f4;return function(_0x4ddc02){logger[_0x7093('0x18')](_0x4ddc02[_0x7093('0x28')]);if(_0x4ddc02[_0x7093('0x29')]){delete _0x4ddc02[_0x7093('0x29')];}_0x31c47f[_0x7093('0x22')](_0x63d8fd)['send'](_0x4ddc02);};}exports[_0x7093('0x2a')]=function(_0x3fc804,_0x57cd9){var _0x44a5={},_0x591c4b={},_0x436078={'count':0x0,'rows':[]};var _0x35604b=_[_0x7093('0x2b')](db[_0x7093('0x2c')][_0x7093('0x2d')],function(_0x4af026){return{'name':_0x4af026[_0x7093('0x2e')],'type':_0x4af026[_0x7093('0x2f')][_0x7093('0x30')]};});_0x591c4b['model']=_[_0x7093('0x2b')](_0x35604b,_0x7093('0x29'));_0x591c4b[_0x7093('0x31')]=_['keys'](_0x3fc804[_0x7093('0x31')]);_0x591c4b[_0x7093('0x32')]=_[_0x7093('0x33')](_0x591c4b[_0x7093('0x34')],_0x591c4b[_0x7093('0x31')]);_0x44a5[_0x7093('0x35')]=_[_0x7093('0x33')](_0x591c4b['model'],qs[_0x7093('0x36')](_0x3fc804[_0x7093('0x31')][_0x7093('0x36')]));_0x44a5['attributes']=_0x44a5[_0x7093('0x35')]['length']?_0x44a5[_0x7093('0x35')]:_0x591c4b[_0x7093('0x34')];if(!_0x3fc804['query'][_0x7093('0x37')](_0x7093('0x38'))){_0x44a5['limit']=qs['limit'](_0x3fc804['query'][_0x7093('0x20')]);_0x44a5[_0x7093('0x1e')]=qs[_0x7093('0x1e')](_0x3fc804[_0x7093('0x31')][_0x7093('0x1e')]);}_0x44a5[_0x7093('0x39')]=qs[_0x7093('0x3a')](_0x3fc804[_0x7093('0x31')][_0x7093('0x3a')]);_0x44a5[_0x7093('0x3b')]=qs[_0x7093('0x32')](_[_0x7093('0x3c')](_0x3fc804[_0x7093('0x31')],_0x591c4b[_0x7093('0x32')]),_0x35604b);if(_0x3fc804['query'][_0x7093('0x3d')]){_0x44a5['where']=_[_0x7093('0x3e')](_0x44a5[_0x7093('0x3b')],{'$or':_[_0x7093('0x2b')](_0x35604b,function(_0x53745c){if(_0x53745c[_0x7093('0x2f')]!==_0x7093('0x3f')){var _0x2cb923={};_0x2cb923[_0x53745c[_0x7093('0x29')]]={'$like':'%'+_0x3fc804[_0x7093('0x31')][_0x7093('0x3d')]+'%'};return _0x2cb923;}})});}_0x44a5=_[_0x7093('0x3e')]({},_0x44a5,_0x3fc804[_0x7093('0x40')]);var _0x4a2859={'where':_0x44a5[_0x7093('0x3b')]};return db[_0x7093('0x2c')][_0x7093('0x21')](_0x4a2859)['then'](function(_0x3f4452){_0x436078[_0x7093('0x21')]=_0x3f4452;if(_0x3fc804[_0x7093('0x31')][_0x7093('0x41')]){_0x44a5[_0x7093('0x42')]=[{'all':!![]}];}return db[_0x7093('0x2c')][_0x7093('0x43')](_0x44a5);})['then'](function(_0x3c8ac4){_0x436078[_0x7093('0x44')]=_0x3c8ac4;return _0x436078;})[_0x7093('0x11')](respondWithFilteredResult(_0x57cd9,_0x44a5))[_0x7093('0x1c')](handleError(_0x57cd9,null));};exports['show']=function(_0x1ae3a9,_0x4bf4be){var _0x20cdd0={'raw':!![],'where':{'id':_0x1ae3a9[_0x7093('0x45')]['id']}},_0x3b9346={};_0x3b9346[_0x7093('0x34')]=_[_0x7093('0x46')](db[_0x7093('0x2c')]['rawAttributes']);_0x3b9346[_0x7093('0x31')]=_[_0x7093('0x46')](_0x1ae3a9['query']);_0x3b9346[_0x7093('0x32')]=_[_0x7093('0x33')](_0x3b9346[_0x7093('0x34')],_0x3b9346[_0x7093('0x31')]);_0x20cdd0[_0x7093('0x35')]=_[_0x7093('0x33')](_0x3b9346['model'],qs[_0x7093('0x36')](_0x1ae3a9[_0x7093('0x31')][_0x7093('0x36')]));_0x20cdd0[_0x7093('0x35')]=_0x20cdd0['attributes'][_0x7093('0x47')]?_0x20cdd0['attributes']:_0x3b9346[_0x7093('0x34')];if(_0x1ae3a9[_0x7093('0x31')][_0x7093('0x41')]){_0x20cdd0[_0x7093('0x42')]=[{'all':!![]}];}_0x20cdd0=_[_0x7093('0x3e')]({},_0x20cdd0,_0x1ae3a9[_0x7093('0x40')]);return db[_0x7093('0x2c')][_0x7093('0x48')](_0x20cdd0)['then'](handleEntityNotFound(_0x4bf4be,null))[_0x7093('0x11')](respondWithResult(_0x4bf4be,null))[_0x7093('0x1c')](handleError(_0x4bf4be,null));};exports[_0x7093('0x25')]=function(_0x45825d,_0x1eeb50){if(_0x45825d['body']['id']){delete _0x45825d['body']['id'];}return db[_0x7093('0x2c')][_0x7093('0x48')]({'where':{'id':_0x45825d[_0x7093('0x45')]['id']}})[_0x7093('0x11')](handleEntityNotFound(_0x1eeb50,null))['then'](saveUpdates(_0x45825d[_0x7093('0x49')],null))[_0x7093('0x11')](respondWithResult(_0x1eeb50,null))[_0x7093('0x1c')](handleError(_0x1eeb50,null));};exports[_0x7093('0x26')]=function(_0x1a8cf6,_0x1129f4){return db['MailMessage'][_0x7093('0x48')]({'where':{'id':_0x1a8cf6[_0x7093('0x45')]['id']}})['then'](handleEntityNotFound(_0x1129f4,null))[_0x7093('0x11')](removeEntity(_0x1129f4,null))[_0x7093('0x1c')](handleError(_0x1129f4,null));};exports[_0x7093('0x4a')]=function(_0x13c102,_0x555a23){return db[_0x7093('0x2c')]['describe']()[_0x7093('0x11')](respondWithResult(_0x555a23,null))['catch'](handleError(_0x555a23,null));};exports[_0x7093('0x4b')]=function(_0x3ba987,_0x425b04){return db[_0x7093('0x2c')][_0x7093('0x4b')](_0x3ba987[_0x7093('0x49')])[_0x7093('0x11')](function(_0x1e3929){if(_0x1e3929){if(_0x1e3929[_0x7093('0x4c')]===_0x7093('0x4d')&&!_0x1e3929[_0x7093('0x4e')]){var _0x3a759a,_0x729a87,_0x51694a;if(_0x3ba987[_0x7093('0x49')]['to']){_0x729a87=_0x3ba987[_0x7093('0x49')]['to']['split'](',')[0x0];}return db[_0x7093('0x4f')][_0x7093('0x50')]({'where':{'id':_0x1e3929['MailAccountId']},'include':[{'model':db[_0x7093('0x51')],'as':_0x7093('0x52'),'include':[{'model':db[_0x7093('0x53')],'as':_0x7093('0x54'),'where':{'email':_0x729a87},'limit':0x1,'order':[['updatedAt',_0x7093('0x55')]]}]},{'model':db[_0x7093('0x56')],'as':_0x7093('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x7093('0x11')](function(_0x2ef557){_0x3a759a=_0x2ef557;if(!_0x3a759a||!_0x3a759a['Smtp'])return;var _0x5bdf2e=_0x3a759a[_0x7093('0x58')]();if(_0x3ba987['body']['attachments']&&_0x3ba987['body'][_0x7093('0x59')][_0x7093('0x47')]){for(var _0x1ed274=0x0;_0x1ed274<_0x3ba987[_0x7093('0x49')][_0x7093('0x59')]['length'];_0x1ed274+=0x1){_0x3ba987['body'][_0x7093('0x59')][_0x1ed274]={'filename':_0x3ba987[_0x7093('0x49')][_0x7093('0x59')][_0x1ed274]['name'],'path':path[_0x7093('0x5a')](config[_0x7093('0x5b')],_0x7093('0x5c'),_0x3ba987[_0x7093('0x49')][_0x7093('0x59')][_0x1ed274][_0x7093('0x5d')])};}}_0x51694a={'account':_0x5bdf2e,'message':_0x3ba987[_0x7093('0x49')]};return;})[_0x7093('0x11')](function(){if(_0x3a759a[_0x7093('0x52')]){if(_0x3a759a[_0x7093('0x52')][_0x7093('0x54')][_0x7093('0x47')]){return _0x3a759a[_0x7093('0x52')]['Contacts'][0x0];}else{return db[_0x7093('0x53')][_0x7093('0x4b')](_['defaults'](_0x3ba987[_0x7093('0x49')],{'firstName':_0x3ba987['body']['to'],'email':_0x3ba987['body']['to'],'phone':_0x3ba987[_0x7093('0x49')]['to'],'ListId':_0x3a759a['ListId']}));}}else{throw new Error(_0x7093('0x5e'));}})[_0x7093('0x11')](function(){if(_0x51694a){return respondWithRpcPromise('SendMail','sendMail',_0x51694a,client9003)[_0x7093('0x11')](function(_0xac9723){return _0x1e3929[_0x7093('0x25')]({'read':!![],'messageId':_0xac9723[_0x7093('0x5f')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x12913e){logger[_0x7093('0x18')]('%s',JSON['stringify'](_0x12913e));return _0x1e3929;});}return _0x1e3929;});}return _0x1e3929;}})[_0x7093('0x11')](respondWithResult(_0x425b04,0xc9))['catch'](handleError(_0x425b04,null));};exports['accept']=function(_0x1afbf3,_0x1c79b3){var _0x51a758={'agent':{},'channel':_0x7093('0x60')};if(_0x1afbf3[_0x7093('0x49')]['id']){delete _0x1afbf3[_0x7093('0x49')]['id'];}_0x1afbf3[_0x7093('0x49')][_0x7093('0x61')]=!![];_0x1afbf3[_0x7093('0x49')]['readAt']=moment()[_0x7093('0x62')](_0x7093('0x63'));_0x1afbf3[_0x7093('0x49')]['UserId']=_0x1afbf3['body'][_0x7093('0x64')]||_0x1afbf3[_0x7093('0x65')]['id'];_0x51a758['agent']['id']=_0x1afbf3['body'][_0x7093('0x64')];return db[_0x7093('0x2c')][_0x7093('0x48')]({'where':{'id':_0x1afbf3[_0x7093('0x45')]['id'],'UserId':null}})[_0x7093('0x11')](handleEntityNotFound(_0x1c79b3,null))['then'](saveUpdates(_0x1afbf3[_0x7093('0x49')],null))[_0x7093('0x11')](function(_0x43e78c){if(_0x43e78c){_0x51a758['message']=_0x43e78c[_0x7093('0x66')]({'plain':!![]});return db[_0x7093('0x67')][_0x7093('0x48')]({'where':{'id':_0x43e78c['MailInteractionId']}});}return null;})[_0x7093('0x11')](handleEntityNotFound(_0x1c79b3,null))[_0x7093('0x11')](function(_0x491f86){if(_0x491f86){return _0x491f86['update']({'UserId':_0x1afbf3['body'][_0x7093('0x64')],'read1stAt':_['isNil'](_0x491f86['read1stAt'])?moment()[_0x7093('0x62')](_0x7093('0x63')):undefined});}return null;})['then'](function(_0x4a5113){if(_0x4a5113){_0x51a758[_0x7093('0x68')]=_0x4a5113[_0x7093('0x66')]({'plain':!![]});interaction_log[_0x7093('0x12')](_0x7093('0x69'),_0x1afbf3['user']['id'],_0x1afbf3['user'][_0x7093('0x29')],_0x1afbf3[_0x7093('0x65')]['role'],_0x51a758['interaction']['id'],_0x1afbf3[_0x7093('0x49')]?JSON[_0x7093('0x17')](_0x1afbf3[_0x7093('0x49')]):_0x7093('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x7093('0x6b'),_0x51a758);}return null;})['then'](function(_0xc154c0){var _0x5385c4=_0x7093('0x6c')+_0xc154c0[_0x7093('0x1a')][_0x7093('0x6d')];return db[_0x7093('0x6e')][_0x7093('0x31')](_0x5385c4,{'type':db[_0x7093('0x6f')][_0x7093('0x70')][_0x7093('0x71')],'raw':!![]})[_0x7093('0x11')](function(_0x2e1c9f){return _0x2e1c9f;});})[_0x7093('0x11')](function(_0x594b16){if(_0x594b16){_0x51a758[_0x7093('0x1a')]['contact']=_0x594b16[0x0];if(!_0x1afbf3[_0x7093('0x49')][_0x7093('0x64')])return;return db['User'][_0x7093('0x48')]({'where':{'id':_0x1afbf3[_0x7093('0x49')][_0x7093('0x64')],'role':_0x7093('0x72')},'attributes':['id',_0x7093('0x29'),_0x7093('0x73'),_0x7093('0x74'),_0x7093('0x75')],'raw':!![]});}return null;})[_0x7093('0x11')](function(_0xc4c9b1){if(!_0xc4c9b1)return null;_0x51a758['message'][_0x7093('0x72')]=_0xc4c9b1;return _0x51a758;})['then'](function(_0x5da2bf){if(_0x5da2bf){if(_0x1afbf3[_0x7093('0x49')]['manual']){_0x51a758[_0x7093('0x1a')][_0x7093('0x76')]=util[_0x7093('0x62')](_0x7093('0x77'),_0x1afbf3[_0x7093('0x65')][_0x7093('0x29')]);_0x51a758['message'][_0x7093('0x78')]=_0x51a758[_0x7093('0x78')];_0x51a758['message'][_0x7093('0x79')]=_0x51a758['channel'];_0x51a758[_0x7093('0x1a')][_0x7093('0x7a')]=_0x7093('0x7b');_0x51a758[_0x7093('0x1a')][_0x7093('0x49')]=htmlToText[_0x7093('0x7c')](_0x51a758['message'][_0x7093('0x49')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x7093('0x7d'),'message':_0x51a758[_0x7093('0x1a')]},client9002)[_0x7093('0x11')](function(){return _0x51a758;});}return _0x51a758;}return null;})[_0x7093('0x11')](respondWithResult(_0x1c79b3,null))[_0x7093('0x1c')](handleError(_0x1c79b3,null));};exports['reject']=function(_0x4f88f7,_0x593108){var _0x2d43a7={'agent':{},'channel':_0x7093('0x60')};if(_0x4f88f7['body']['id']){delete _0x4f88f7[_0x7093('0x49')]['id'];}_0x4f88f7['body']['UserId']=_0x4f88f7['body'][_0x7093('0x64')]||_0x4f88f7[_0x7093('0x65')]['id'];_0x2d43a7['agent']['id']=_0x4f88f7[_0x7093('0x49')]['UserId'];return db[_0x7093('0x2c')][_0x7093('0x48')]({'where':{'id':_0x4f88f7['params']['id'],'UserId':null}})[_0x7093('0x11')](handleEntityNotFound(_0x593108,null))[_0x7093('0x11')](function(_0x4bc36e){if(_0x4bc36e){_0x2d43a7['message']=_0x4bc36e[_0x7093('0x66')]({'plain':!![]});return db[_0x7093('0x67')][_0x7093('0x48')]({'where':{'id':_0x4bc36e['MailInteractionId']}});}return null;})[_0x7093('0x11')](handleEntityNotFound(_0x593108,null))[_0x7093('0x11')](function(_0x5d4534){if(_0x5d4534){_0x2d43a7[_0x7093('0x68')]=_0x5d4534['get']({'plain':!![]});interaction_log[_0x7093('0x12')](_0x7093('0x7e'),_0x4f88f7['user']['id'],_0x4f88f7[_0x7093('0x65')]['name'],_0x4f88f7[_0x7093('0x65')][_0x7093('0x7f')],_0x2d43a7[_0x7093('0x68')]['id'],_0x4f88f7['body']?JSON[_0x7093('0x17')](_0x4f88f7['body']):_0x7093('0x6a'));return respondWithRpcPromise(_0x7093('0x80'),'rejectMessage',_0x2d43a7);}return null;})['then'](function(_0x4931e9){var _0x2c05d8=_0x7093('0x6c')+_0x4931e9[_0x7093('0x1a')]['ContactId'];return db['sequelize']['query'](_0x2c05d8,{'type':db[_0x7093('0x6f')]['QueryTypes'][_0x7093('0x71')],'raw':!![]})[_0x7093('0x11')](function(_0x7baefe){return _0x7baefe;});})[_0x7093('0x11')](function(_0x49be0e){if(_0x49be0e){_0x2d43a7[_0x7093('0x1a')][_0x7093('0x81')]=_0x49be0e[0x0];if(!_0x4f88f7[_0x7093('0x49')][_0x7093('0x64')])return;return db['User'][_0x7093('0x48')]({'where':{'id':_0x4f88f7['body'][_0x7093('0x64')],'role':'agent'},'attributes':['id',_0x7093('0x29'),_0x7093('0x73'),_0x7093('0x74'),'internal'],'raw':!![]});}return null;})[_0x7093('0x11')](function(_0x22921c){if(!_0x22921c)return null;_0x2d43a7['message']['agent']=_0x22921c;return _0x2d43a7;})['then'](function(_0x2c05b6){if(_0x2c05b6){_0x2c05b6[_0x7093('0x1a')]['interface']=util[_0x7093('0x62')](_0x7093('0x77'),_0x4f88f7['user'][_0x7093('0x29')]);_0x2c05b6[_0x7093('0x1a')][_0x7093('0x78')]=_0x2d43a7[_0x7093('0x78')];_0x2c05b6['message']['motionChannel']=_0x2d43a7[_0x7093('0x78')];_0x2c05b6[_0x7093('0x1a')][_0x7093('0x7a')]=_0x7093('0x82');_0x2c05b6[_0x7093('0x1a')][_0x7093('0x49')]=htmlToText[_0x7093('0x7c')](_0x2d43a7[_0x7093('0x1a')][_0x7093('0x49')]);respondWithRpcPromise(_0x7093('0x83'),_0x7093('0x83'),{'event':_0x7093('0x84'),'message':_0x2c05b6['message']},client9002);return _0x2d43a7;}return null;})[_0x7093('0x11')](respondWithResult(_0x593108,null))[_0x7093('0x1c')](handleError(_0x593108,null));};exports['download']=function(_0x51e4e0,_0x306037){var _0x1b7b10=moment()[_0x7093('0x85')]()[_0x7093('0x86')]();var _0x1507f1=path['join'](config[_0x7093('0x5b')],_0x7093('0x87'),_0x7093('0x88'),'tmp');var _0x56f705=path[_0x7093('0x5a')](config[_0x7093('0x5b')],_0x7093('0x87'),'files',_0x7093('0x59'));var _0x45bc2d=util[_0x7093('0x62')](_0x7093('0x89'),_0x1b7b10);return db[_0x7093('0x2c')][_0x7093('0x48')]({'where':{'id':_0x51e4e0['params']['id']},'attributes':['id',_0x7093('0x49'),_0x7093('0x8a'),'to','cc',_0x7093('0x8b'),_0x7093('0x8c'),_0x7093('0x8d')],'include':_0x51e4e0[_0x7093('0x31')][_0x7093('0x59')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x7093('0x11')](handleEntityNotFound(_0x306037,null))[_0x7093('0x11')](function(_0x34e982){if(_0x34e982){var _0x47e3c9=_0x34e982;var _0xb7e240={'from':_0x47e3c9[_0x7093('0x8a')],'to':_0x47e3c9['to'],'subject':_0x47e3c9['subject'],'html':htmlEntities[_0x7093('0x8e')](_0x47e3c9['body']),'headers':{'Date':moment(_0x47e3c9[_0x7093('0x8d')])[_0x7093('0x62')](_0x7093('0x8f'))},'attachments':[]};if(_0x34e982['cc']){_0xb7e240['headers']['Cc']=_0x34e982['cc'];}if(_0x34e982[_0x7093('0x8b')]){_0xb7e240[_0x7093('0x90')]['Bcc']=_0x34e982[_0x7093('0x8b')];}return new BPromise(function(_0x131ee3,_0x4e3f98){if(_0x34e982['Attachments']){for(var _0xa5df95=0x0;_0xa5df95<_0x34e982['Attachments'][_0x7093('0x47')];_0xa5df95++){var _0x2679dc=_0x34e982[_0x7093('0x91')][_0xa5df95];var _0x978df5=path['join'](_0x56f705,_0x2679dc['basename']);if(fs[_0x7093('0x92')](_0x978df5)){_0xb7e240[_0x7093('0x59')]['push']({'name':_0x2679dc[_0x7093('0x29')],'contentType':_0x2679dc[_0x7093('0x2f')],'data':fs[_0x7093('0x93')](_0x978df5)});}}}emlformat['build'](_0xb7e240,function(_0x2ca597,_0x17092c){if(_0x2ca597)return _0x4e3f98(_0x2ca597);fs['writeFileSync'](path[_0x7093('0x5a')](_0x1507f1,_0x45bc2d),_0x17092c);return _0x131ee3(_0x17092c);});});}})[_0x7093('0x11')](function(_0x3406b4){if(_0x3406b4){return _0x306037['download'](path[_0x7093('0x5a')](_0x1507f1,_0x45bc2d),_0x45bc2d,function(_0x1b4e73){if(!_0x1b4e73)fs[_0x7093('0x94')](path[_0x7093('0x5a')](_0x1507f1,_0x45bc2d));});}})[_0x7093('0x1c')](handleError(_0x306037,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d76693a..9c30e00 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 _0xf05c=['../../mysqldb','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x241084,_0x5d58b3){var _0x46f41d=function(_0x5a6ae2){while(--_0x5a6ae2){_0x241084['push'](_0x241084['shift']());}};_0x46f41d(++_0x5d58b3);}(_0xf05c,0x12d));var _0xcf05=function(_0x58a3eb,_0x2599c0){_0x58a3eb=_0x58a3eb-0x0;var _0x3e581b=_0xf05c[_0x58a3eb];return _0x3e581b;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xcf05('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcf05('0x1'),'afterUpdate':'update','afterDestroy':_0xcf05('0x2')};function emitEvent(_0x5c7109){return function(_0x1de242,_0x1269dd,_0x56c844){MailMessageEvents[_0xcf05('0x3')](_0x5c7109+':'+_0x1de242['id'],_0x1de242);MailMessageEvents[_0xcf05('0x3')](_0x5c7109,_0x1de242);_0x56c844(null);};}for(var e in events){if(events[_0xcf05('0x4')](e)){var event=events[e];MailMessage[_0xcf05('0x5')](e,emitEvent(event));}}module[_0xcf05('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x0d98=['exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x411b5d,_0x31179f){var _0x3293df=function(_0xdc1e35){while(--_0xdc1e35){_0x411b5d['push'](_0x411b5d['shift']());}};_0x3293df(++_0x31179f);}(_0x0d98,0x161));var _0x80d9=function(_0x229dee,_0x3da064){_0x229dee=_0x229dee-0x0;var _0x317ddf=_0x0d98[_0x229dee];return _0x317ddf;};'use strict';var EventEmitter=require(_0x80d9('0x0'));var MailMessage=require(_0x80d9('0x1'))['db'][_0x80d9('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x80d9('0x3')](0x0);var events={'afterCreate':_0x80d9('0x4'),'afterUpdate':_0x80d9('0x5'),'afterDestroy':_0x80d9('0x6')};function emitEvent(_0x769ed){return function(_0xb1c845,_0x3bdb6b,_0x4069dd){MailMessageEvents[_0x80d9('0x7')](_0x769ed+':'+_0xb1c845['id'],_0xb1c845);MailMessageEvents[_0x80d9('0x7')](_0x769ed,_0xb1c845);_0x4069dd(null);};}for(var e in events){if(events[_0x80d9('0x8')](e)){var event=events[e];MailMessage[_0x80d9('0x9')](e,emitEvent(event));}}module[_0x80d9('0xa')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index d7d39e8..80f43e3 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 _0x945b=['mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','toLowerCase','direction','isNil','MailInteraction','findOne','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','exports','define','MailMessage'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x945b,0x12a));var _0xb945=function(_0x4db868,_0x2841d3){_0x4db868=_0x4db868-0x0;var _0x38df8a=_0x945b[_0x4db868];return _0x38df8a;};'use strict';var _=require('lodash');var util=require(_0xb945('0x0'));var logger=require(_0xb945('0x1'))(_0xb945('0x2'));var moment=require(_0xb945('0x3'));var BPromise=require(_0xb945('0x4'));var rp=require('request-promise');var htmlToText=require(_0xb945('0x5'));var fs=require('fs');var path=require(_0xb945('0x6'));var rimraf=require(_0xb945('0x7'));var config=require('../../config/environment');var attributes=require(_0xb945('0x8'));module[_0xb945('0x9')]=function(_0x2d09f9,_0xdcb0f1){return _0x2d09f9[_0xb945('0xa')](_0xb945('0xb'),attributes,{'tableName':_0xb945('0xc'),'paranoid':![],'indexes':[{'name':_0xb945('0xd'),'fields':[_0xb945('0xd')]},{'name':_0xb945('0xe'),'fields':[_0xb945('0xf'),_0xb945('0x10')],'type':_0xb945('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2970e3,_0x4f1246,_0x36a1c7){if(_0x2970e3[_0xb945('0x12')]){_0x2970e3[_0xb945('0xf')]=htmlToText[_0xb945('0x13')](_0x2970e3['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x36a1c7(null,_0x4f1246);},'afterCreate':function(_0x5bafcc,_0x1742cb,_0x23203b){var _0x1e2ade=_0x2d09f9[_0xb945('0x14')];var _0x26ec8c=_0x5bafcc[_0xb945('0x15')]({'plain':!![]});if(_0x26ec8c['direction'][_0xb945('0x16')]()==='in'||_0x26ec8c[_0xb945('0x17')][_0xb945('0x16')]()==='out'&&!_0x26ec8c['secret']&&!_[_0xb945('0x18')](_0x26ec8c['UserId'])){_0x1e2ade[_0xb945('0x19')][_0xb945('0x1a')]({'where':{'id':_0x26ec8c['MailInteractionId']}})['then'](function(_0x28e211){if(_0x28e211){_0x28e211['update']({'lastMsgAt':_0x26ec8c[_0xb945('0x1b')],'lastMsgDirection':_0x26ec8c[_0xb945('0x17')][_0xb945('0x16')]()});}})[_0xb945('0x1c')](function(_0x4dc8b8){console['error'](_0x4dc8b8);});}_0x23203b();}},'charset':_0xb945('0x1d'),'collate':_0xb945('0x1e')});}; \ No newline at end of file +var _0x26c6=['MailInteractionId','then','update','createdAt','error','utf8mb4','lodash','util','api','moment','path','rimraf','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','fromString','body','models','get','toLowerCase','direction','secret','isNil','UserId','MailInteraction'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x26c6,0x132));var _0x626c=function(_0x478a5b,_0x1c566f){_0x478a5b=_0x478a5b-0x0;var _0x2da27f=_0x26c6[_0x478a5b];return _0x2da27f;};'use strict';var _=require(_0x626c('0x0'));var util=require(_0x626c('0x1'));var logger=require('../../config/logger')(_0x626c('0x2'));var moment=require(_0x626c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x626c('0x4'));var rimraf=require(_0x626c('0x5'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x626c('0x6')]=function(_0x16e2a5,_0x129e9a){return _0x16e2a5[_0x626c('0x7')](_0x626c('0x8'),attributes,{'tableName':_0x626c('0x9'),'paranoid':![],'indexes':[{'name':_0x626c('0xa'),'fields':[_0x626c('0xa')]},{'name':_0x626c('0xb'),'fields':[_0x626c('0xc'),_0x626c('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3411c6,_0x9d69da,_0x2bcc84){if(_0x3411c6['body']){_0x3411c6[_0x626c('0xc')]=htmlToText[_0x626c('0xe')](_0x3411c6[_0x626c('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2bcc84(null,_0x9d69da);},'afterCreate':function(_0x1a9f11,_0x550d8d,_0x950088){var _0x506447=_0x16e2a5[_0x626c('0x10')];var _0x733b24=_0x1a9f11[_0x626c('0x11')]({'plain':!![]});if(_0x733b24['direction'][_0x626c('0x12')]()==='in'||_0x733b24[_0x626c('0x13')][_0x626c('0x12')]()==='out'&&!_0x733b24[_0x626c('0x14')]&&!_[_0x626c('0x15')](_0x733b24[_0x626c('0x16')])){_0x506447[_0x626c('0x17')]['findOne']({'where':{'id':_0x733b24[_0x626c('0x18')]}})[_0x626c('0x19')](function(_0xf77c80){if(_0xf77c80){_0xf77c80[_0x626c('0x1a')]({'lastMsgAt':_0x733b24[_0x626c('0x1b')],'lastMsgDirection':_0x733b24['direction'][_0x626c('0x12')]()});}})['catch'](function(_0x181860){console[_0x626c('0x1c')](_0x181860);});}_0x950088();}},'charset':_0x626c('0x1d'),'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 80ec8ba..d713e37 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 _0xc900=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','MailMessage','body','options','raw','debug','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0xc900,0xb3));var _0x0c90=function(_0xaf7f42,_0x2090bc){_0xaf7f42=_0xaf7f42-0x0;var _0x3adb4f=_0xc900[_0xaf7f42];return _0x3adb4f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});config[_0x0c90('0xa')]=_['defaults'](config[_0x0c90('0xa')],{'host':_0x0c90('0xb'),'port':0x18eb});var socket=require(_0x0c90('0xc'))(new Redis(config[_0x0c90('0xa')]));require(_0x0c90('0xd'))[_0x0c90('0xe')](socket);function respondWithRpcPromise(_0x313ce9,_0x18d9fd,_0x3e0df6){return new BPromise(function(_0x34456e,_0x10daeb){return client[_0x0c90('0xf')](_0x313ce9,_0x3e0df6)[_0x0c90('0x10')](function(_0x57917b){logger[_0x0c90('0x11')]('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x0c90('0x12'));logger['debug'](_0x0c90('0x13'),_0x18d9fd,_0x0c90('0x12'),JSON[_0x0c90('0x14')](_0x57917b));if(_0x57917b[_0x0c90('0x15')]){if(_0x57917b[_0x0c90('0x15')]['code']===0x1f4){logger[_0x0c90('0x15')](_0x0c90('0x16'),_0x18d9fd,_0x57917b['error'][_0x0c90('0x17')]);return _0x10daeb(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);return _0x34456e(_0x57917b[_0x0c90('0x15')][_0x0c90('0x17')]);}else{logger[_0x0c90('0x11')](_0x0c90('0x16'),_0x18d9fd,_0x0c90('0x12'));_0x34456e(_0x57917b['result'][_0x0c90('0x17')]);}})[_0x0c90('0x18')](function(_0x462d49){logger[_0x0c90('0x15')]('MailMessage,\x20%s,\x20%s',_0x18d9fd,_0x462d49);_0x10daeb(_0x462d49);});});}exports[_0x0c90('0x19')]=function(_0xd129ca){var _0x143047=this;return new Promise(function(_0x1241a9,_0x315932){return db[_0x0c90('0x1a')]['create'](_0xd129ca[_0x0c90('0x1b')],{'raw':_0xd129ca['options']?_0xd129ca[_0x0c90('0x1c')][_0x0c90('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2a053a){logger[_0x0c90('0x11')](_0x0c90('0x19'),_0xd129ca);logger[_0x0c90('0x1e')](_0x0c90('0x19'),_0xd129ca,JSON[_0x0c90('0x14')](_0x2a053a));_0x1241a9(_0x2a053a);})['catch'](function(_0x26f0a3){logger[_0x0c90('0x15')]('CreateMailMessage',_0x26f0a3['message'],_0xd129ca);_0x315932(_0x143047[_0x0c90('0x15')](0x1f4,_0x26f0a3[_0x0c90('0x17')]));});});}; \ No newline at end of file +var _0x25e7=['result','CreateMailMessage','MailMessage','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','register','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','MailMessage,\x20%s,\x20%s','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25e7,0x1d6));var _0x725e=function(_0x5bb488,_0x405570){_0x5bb488=_0x5bb488-0x0;var _0x3a541a=_0x25e7[_0x5bb488];return _0x3a541a;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});config['redis']=_[_0x725e('0xb')](config[_0x725e('0xc')],{'host':_0x725e('0xd'),'port':0x18eb});var socket=require(_0x725e('0xe'))(new Redis(config[_0x725e('0xc')]));require(_0x725e('0xf'))[_0x725e('0x10')](socket);function respondWithRpcPromise(_0x7c40ff,_0x22c189,_0x45cb68){return new BPromise(function(_0x441c29,_0xb297c7){return client['request'](_0x7c40ff,_0x45cb68)['then'](function(_0x40741b){logger[_0x725e('0x11')]('MailMessage,\x20%s,\x20%s',_0x22c189,'request\x20sent');logger[_0x725e('0x12')](_0x725e('0x13'),_0x22c189,'request\x20sent',JSON[_0x725e('0x14')](_0x40741b));if(_0x40741b[_0x725e('0x15')]){if(_0x40741b[_0x725e('0x15')]['code']===0x1f4){logger[_0x725e('0x15')](_0x725e('0x16'),_0x22c189,_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);return _0xb297c7(_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);}logger['error'](_0x725e('0x16'),_0x22c189,_0x40741b[_0x725e('0x15')][_0x725e('0x17')]);return _0x441c29(_0x40741b['error'][_0x725e('0x17')]);}else{logger[_0x725e('0x11')](_0x725e('0x16'),_0x22c189,_0x725e('0x18'));_0x441c29(_0x40741b[_0x725e('0x19')][_0x725e('0x17')]);}})['catch'](function(_0x22fba5){logger[_0x725e('0x15')](_0x725e('0x16'),_0x22c189,_0x22fba5);_0xb297c7(_0x22fba5);});});}exports[_0x725e('0x1a')]=function(_0x1a9ea6){var _0x3ad3d2=this;return new Promise(function(_0x540802,_0x2fc416){return db[_0x725e('0x1b')][_0x725e('0x1c')](_0x1a9ea6[_0x725e('0x1d')],{'raw':_0x1a9ea6[_0x725e('0x1e')]?_0x1a9ea6[_0x725e('0x1e')][_0x725e('0x1f')]===undefined?!![]:![]:!![]})[_0x725e('0x20')](function(_0x7d0792){logger['info'](_0x725e('0x1a'),_0x1a9ea6);logger[_0x725e('0x12')](_0x725e('0x1a'),_0x1a9ea6,JSON[_0x725e('0x14')](_0x7d0792));_0x540802(_0x7d0792);})['catch'](function(_0xffe474){logger['error']('CreateMailMessage',_0xffe474['message'],_0x1a9ea6);_0x2fc416(_0x3ad3d2[_0x725e('0x15')](0x1f4,_0xffe474[_0x725e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f98205b..bb72d07 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 _0xd1a2=['length','mailMessage:','./mailMessage.events','update','emit','removeListener','register'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd1a2,0xa3));var _0x2d1a=function(_0x1fa2a0,_0x57cfe4){_0x1fa2a0=_0x1fa2a0-0x0;var _0x4ddc81=_0xd1a2[_0x1fa2a0];return _0x4ddc81;};'use strict';var MailMessageEvents=require(_0x2d1a('0x0'));var events=['save','remove',_0x2d1a('0x1')];function createListener(_0x12ff45,_0x3da790){return function(_0x35e9f0){_0x3da790[_0x2d1a('0x2')](_0x12ff45,_0x35e9f0);};}function removeListener(_0x2ff7ec,_0x4e3c3f){return function(){MailMessageEvents[_0x2d1a('0x3')](_0x2ff7ec,_0x4e3c3f);};}exports[_0x2d1a('0x4')]=function(_0x5e356e){for(var _0x56b463=0x0,_0x1f9b89=events[_0x2d1a('0x5')];_0x56b463<_0x1f9b89;_0x56b463++){var _0x5f4419=events[_0x56b463];var _0xecfcad=createListener(_0x2d1a('0x6')+_0x5f4419,_0x5e356e);MailMessageEvents['on'](_0x5f4419,_0xecfcad);}}; \ No newline at end of file +var _0xc0d3=['length','./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xc0d3,0x191));var _0x3c0d=function(_0x47cb91,_0x1a2882){_0x47cb91=_0x47cb91-0x0;var _0x55fcad=_0xc0d3[_0x47cb91];return _0x55fcad;};'use strict';var MailMessageEvents=require(_0x3c0d('0x0'));var events=[_0x3c0d('0x1'),_0x3c0d('0x2'),_0x3c0d('0x3')];function createListener(_0x2cbee1,_0x343223){return function(_0x51611b){_0x343223[_0x3c0d('0x4')](_0x2cbee1,_0x51611b);};}function removeListener(_0x4d7672,_0x1aac06){return function(){MailMessageEvents[_0x3c0d('0x5')](_0x4d7672,_0x1aac06);};}exports[_0x3c0d('0x6')]=function(_0x35e8a8){for(var _0x1d8b2f=0x0,_0x4daf05=events[_0x3c0d('0x7')];_0x1d8b2f<_0x4daf05;_0x1d8b2f++){var _0x513f2a=events[_0x1d8b2f];var _0x4fec84=createListener('mailMessage:'+_0x513f2a,_0x35e8a8);MailMessageEvents['on'](_0x513f2a,_0x4fec84);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 6529834..208d933 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 _0xb2a4=['fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','/describe','describe','/:id','show','/:id/members','isAuthenticated','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xd25da3,_0x2a7b4f){var _0x531cab=function(_0x3f49b8){while(--_0x3f49b8){_0xd25da3['push'](_0xd25da3['shift']());}};_0x531cab(++_0x2a7b4f);}(_0xb2a4,0xae));var _0x4b2a=function(_0x44232e,_0x248c62){_0x44232e=_0x44232e-0x0;var _0x1f0ea5=_0xb2a4[_0x44232e];return _0x1f0ea5;};'use strict';var multer=require(_0x4b2a('0x0'));var util=require(_0x4b2a('0x1'));var path=require(_0x4b2a('0x2'));var timeout=require(_0x4b2a('0x3'));var express=require(_0x4b2a('0x4'));var router=express[_0x4b2a('0x5')]();var fs_extra=require(_0x4b2a('0x6'));var auth=require(_0x4b2a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4b2a('0x8'));var controller=require(_0x4b2a('0x9'));router[_0x4b2a('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4b2a('0xa')](_0x4b2a('0xb'),auth['isAuthenticated'](),controller[_0x4b2a('0xc')]);router['get'](_0x4b2a('0xd'),auth['isAuthenticated'](),controller[_0x4b2a('0xe')]);router[_0x4b2a('0xa')](_0x4b2a('0xf'),auth[_0x4b2a('0x10')](),controller['getMembers']);router[_0x4b2a('0xa')](_0x4b2a('0x11'),auth[_0x4b2a('0x10')](),controller[_0x4b2a('0x12')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x4b2a('0x13')]);router['post']('/',auth[_0x4b2a('0x10')](),controller['create']);router[_0x4b2a('0x14')](_0x4b2a('0x11'),auth[_0x4b2a('0x10')](),controller[_0x4b2a('0x15')]);router['post'](_0x4b2a('0x16'),auth[_0x4b2a('0x10')](),controller[_0x4b2a('0x17')]);router[_0x4b2a('0x18')](_0x4b2a('0xd'),auth[_0x4b2a('0x10')](),controller['update']);router[_0x4b2a('0x19')](_0x4b2a('0xd'),auth[_0x4b2a('0x10')](),controller[_0x4b2a('0x1a')]);router[_0x4b2a('0x19')]('/:id/teams',auth[_0x4b2a('0x10')](),controller[_0x4b2a('0x1b')]);router[_0x4b2a('0x19')](_0x4b2a('0x16'),auth['isAuthenticated'](),controller[_0x4b2a('0x1c')]);module[_0x4b2a('0x1d')]=router; \ No newline at end of file +var _0x94bc=['/:id/users','post','addTeams','addAgents','put','delete','destroy','removeAgents','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','getMembers','/:id/teams'];(function(_0x44fb7d,_0x862465){var _0x3dd8b3=function(_0x47d20e){while(--_0x47d20e){_0x44fb7d['push'](_0x44fb7d['shift']());}};_0x3dd8b3(++_0x862465);}(_0x94bc,0xf9));var _0xc94b=function(_0x962de1,_0x361057){_0x962de1=_0x962de1-0x0;var _0x14085a=_0x94bc[_0x962de1];return _0x14085a;};'use strict';var multer=require(_0xc94b('0x0'));var util=require(_0xc94b('0x1'));var path=require('path');var timeout=require(_0xc94b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc94b('0x3'));var interaction=require(_0xc94b('0x4'));var config=require(_0xc94b('0x5'));var controller=require(_0xc94b('0x6'));router[_0xc94b('0x7')]('/',auth['isAuthenticated'](),controller[_0xc94b('0x8')]);router[_0xc94b('0x7')](_0xc94b('0x9'),auth[_0xc94b('0xa')](),controller[_0xc94b('0xb')]);router['get'](_0xc94b('0xc'),auth[_0xc94b('0xa')](),controller['show']);router[_0xc94b('0x7')]('/:id/members',auth[_0xc94b('0xa')](),controller[_0xc94b('0xd')]);router[_0xc94b('0x7')](_0xc94b('0xe'),auth[_0xc94b('0xa')](),controller['getTeams']);router[_0xc94b('0x7')](_0xc94b('0xf'),auth[_0xc94b('0xa')](),controller['getAgents']);router[_0xc94b('0x10')]('/',auth[_0xc94b('0xa')](),controller['create']);router[_0xc94b('0x10')]('/:id/teams',auth[_0xc94b('0xa')](),controller[_0xc94b('0x11')]);router[_0xc94b('0x10')](_0xc94b('0xf'),auth[_0xc94b('0xa')](),controller[_0xc94b('0x12')]);router[_0xc94b('0x13')](_0xc94b('0xc'),auth[_0xc94b('0xa')](),controller['update']);router[_0xc94b('0x14')](_0xc94b('0xc'),auth[_0xc94b('0xa')](),controller[_0xc94b('0x15')]);router['delete'](_0xc94b('0xe'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xc94b('0x14')](_0xc94b('0xf'),auth[_0xc94b('0xa')](),controller[_0xc94b('0x16')]);module[_0xc94b('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 10a54e2..a1c3e88 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 _0xf795=['INTEGER','ENUM','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x1a828e,_0x55aa8d){var _0x4a03d9=function(_0x2e4ab7){while(--_0x2e4ab7){_0x1a828e['push'](_0x1a828e['shift']());}};_0x4a03d9(++_0x55aa8d);}(_0xf795,0x9c));var _0x5f79=function(_0x314350,_0x4433a0){_0x314350=_0x314350-0x0;var _0x2d9c1d=_0xf795[_0x314350];return _0x2d9c1d;};'use strict';var Sequelize=require(_0x5f79('0x0'));module[_0x5f79('0x1')]={'name':{'type':Sequelize[_0x5f79('0x2')],'unique':_0x5f79('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5f79('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5f79('0x5')]('rrmemory',_0x5f79('0x6'),_0x5f79('0x7'))}}; \ No newline at end of file +var _0xd37d=['sequelize','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x3b6b8e,_0x5d127a){var _0x5c40ed=function(_0x5b0fce){while(--_0x5b0fce){_0x3b6b8e['push'](_0x3b6b8e['shift']());}};_0x5c40ed(++_0x5d127a);}(_0xd37d,0x1e0));var _0xdd37=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0xd37d[_0x57975f];return _0x4793b8;};'use strict';var Sequelize=require(_0xdd37('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdd37('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdd37('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xdd37('0x3'),_0xdd37('0x4'),_0xdd37('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0468efd..8e086bb 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 _0xc022=['interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','Agents','select','field','from','team_has_mail_queues','join','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','SELECT','every','TeamId','union','value','isEmpty','emit','addAgents','spread','removeAgents','isArray','userMailQueue:remove','getAgents','nolimit','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','update','then','destroy','MailQueues','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','rows','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','limit','order','sort','pick','findAll','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','mailPause','getTeams','Team','filter','addTeams','ids','online','voicePause'];(function(_0x15f603,_0x3812a2){var _0x772880=function(_0x422361){while(--_0x422361){_0x15f603['push'](_0x15f603['shift']());}};_0x772880(++_0x3812a2);}(_0xc022,0x9b));var _0x2c02=function(_0xc971a4,_0x5b381c){_0xc971a4=_0xc971a4-0x0;var _0x4ebd6b=_0xc022[_0xc971a4];return _0x4ebd6b;};'use strict';var BPromise=require(_0x2c02('0x0'));var util=require('util');var _=require(_0x2c02('0x1'));var squel=require(_0x2c02('0x2'));var Redis=require(_0x2c02('0x3'));var qs=require(_0x2c02('0x4'));var logger=require(_0x2c02('0x5'))(_0x2c02('0x6'));var config=require(_0x2c02('0x7'));var db=require(_0x2c02('0x8'))['db'];config[_0x2c02('0x9')]=_['defaults'](config[_0x2c02('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c02('0xa'))(new Redis(config['redis']));require(_0x2c02('0xb'))['register'](socket);function respondWithStatusCode(_0x45e811,_0x170dcd){_0x170dcd=_0x170dcd||0xcc;return function(_0x2184be){if(_0x2184be){return _0x45e811[_0x2c02('0xc')](_0x170dcd);}return _0x45e811['status'](_0x170dcd)[_0x2c02('0xd')]();};}function respondWithResult(_0xa63f47,_0xd8305c){_0xd8305c=_0xd8305c||0xc8;return function(_0x4f5382){if(_0x4f5382){return _0xa63f47[_0x2c02('0xe')](_0xd8305c)[_0x2c02('0xf')](_0x4f5382);}};}function respondWithFilteredResult(_0x50761b,_0x3d084e){return function(_0x3221e6){if(_0x3221e6){var _0x3db11a=typeof _0x3d084e['offset']==='undefined'&&typeof _0x3d084e['limit']===_0x2c02('0x10');var _0x255122=_0x3221e6[_0x2c02('0x11')];var _0x31ef2c=_0x3db11a?0x0:_0x3d084e[_0x2c02('0x12')];var _0x2932ee=_0x3db11a?_0x3221e6[_0x2c02('0x11')]:_0x3d084e['offset']+_0x3d084e['limit'];var _0x2f24ed;if(_0x2932ee>=_0x255122){_0x2932ee=_0x255122;_0x2f24ed=0xc8;}else{_0x2f24ed=0xce;}_0x50761b[_0x2c02('0xe')](_0x2f24ed);return _0x50761b[_0x2c02('0x13')](_0x2c02('0x14'),_0x31ef2c+'-'+_0x2932ee+'/'+_0x255122)[_0x2c02('0xf')](_0x3221e6);}return null;};}function saveUpdates(_0x46f1dd){return function(_0x3cedd1){if(_0x3cedd1){return _0x3cedd1[_0x2c02('0x15')](_0x46f1dd)[_0x2c02('0x16')](function(_0x5f1c8a){return _0x5f1c8a;});}return null;};}function removeEntity(_0x4cc3a7){return function(_0x441b27){if(_0x441b27){return _0x441b27[_0x2c02('0x17')]()[_0x2c02('0x16')](function(){var _0x495448=_0x441b27['get']({'plain':!![]});var _0x1a0eec=_0x2c02('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a0eec,'resourceId':_0x495448['id']}})['then'](function(){return _0x441b27;});})['then'](function(){_0x4cc3a7[_0x2c02('0xe')](0xcc)[_0x2c02('0xd')]();});}};}function handleEntityNotFound(_0x426ce6){return function(_0x5ab095){if(!_0x5ab095){_0x426ce6['sendStatus'](0x194);}return _0x5ab095;};}function handleError(_0x2a30d6,_0x470b87){_0x470b87=_0x470b87||0x1f4;return function(_0x7907f1){logger[_0x2c02('0x19')](_0x7907f1[_0x2c02('0x1a')]);if(_0x7907f1[_0x2c02('0x1b')]){delete _0x7907f1[_0x2c02('0x1b')];}_0x2a30d6[_0x2c02('0xe')](_0x470b87)[_0x2c02('0x1c')](_0x7907f1);};}exports[_0x2c02('0x1d')]=function(_0x43b0fe,_0x2f6018){var _0x1b8522={};var _0x102e0b={'count':0x0,'rows':[]};var _0xf54ee=_[_0x2c02('0x1e')](db[_0x2c02('0x1f')][_0x2c02('0x20')],function(_0x2f1ec1){return{'name':_0x2f1ec1[_0x2c02('0x21')],'type':_0x2f1ec1[_0x2c02('0x22')][_0x2c02('0x23')]};});_0x1b8522=qs[_0x2c02('0x24')](_0xf54ee,_0x43b0fe);var _0xe974aa={'where':_0x1b8522[_0x2c02('0x25')]};return db[_0x2c02('0x1f')]['count'](_0xe974aa)[_0x2c02('0x16')](function(_0x832b3a){_0x102e0b[_0x2c02('0x11')]=_0x832b3a;_0x1b8522[_0x2c02('0x26')]=qs[_0x2c02('0x26')](_0x43b0fe['query']);return db['MailQueue']['findAll'](_0x1b8522);})[_0x2c02('0x16')](function(_0x9761f3){_0x102e0b[_0x2c02('0x27')]=_0x9761f3;return _0x102e0b;})[_0x2c02('0x16')](respondWithFilteredResult(_0x2f6018,_0x1b8522))['catch'](handleError(_0x2f6018,null));};exports[_0x2c02('0x28')]=function(_0x1c91bc,_0x1c8d32){var _0x360361={'raw':!![],'where':{'id':_0x1c91bc[_0x2c02('0x29')]['id']}},_0x1be9d3={};_0x1be9d3[_0x2c02('0x2a')]=_[_0x2c02('0x2b')](db['MailQueue'][_0x2c02('0x20')]);_0x1be9d3['query']=_['keys'](_0x1c91bc[_0x2c02('0x2c')]);_0x1be9d3[_0x2c02('0x2d')]=_[_0x2c02('0x2e')](_0x1be9d3[_0x2c02('0x2a')],_0x1be9d3[_0x2c02('0x2c')]);_0x360361[_0x2c02('0x2f')]=_[_0x2c02('0x2e')](_0x1be9d3[_0x2c02('0x2a')],qs[_0x2c02('0x30')](_0x1c91bc[_0x2c02('0x2c')]['fields']));_0x360361[_0x2c02('0x2f')]=_0x360361[_0x2c02('0x2f')][_0x2c02('0x31')]?_0x360361[_0x2c02('0x2f')]:_0x1be9d3[_0x2c02('0x2a')];if(_0x1c91bc[_0x2c02('0x2c')][_0x2c02('0x32')]){_0x360361[_0x2c02('0x26')]=[{'all':!![]}];}_0x360361=_[_0x2c02('0x33')]({},_0x360361,_0x1c91bc[_0x2c02('0x34')]);return db[_0x2c02('0x1f')][_0x2c02('0x35')](_0x360361)['then'](handleEntityNotFound(_0x1c8d32,null))[_0x2c02('0x16')](respondWithResult(_0x1c8d32,null))[_0x2c02('0x36')](handleError(_0x1c8d32,null));};exports[_0x2c02('0x37')]=function(_0x592adb,_0x5dff56){return db[_0x2c02('0x1f')]['create'](_0x592adb[_0x2c02('0x38')],{})['then'](function(_0x3f634d){var _0x4a77f3=_0x592adb[_0x2c02('0x39')][_0x2c02('0x3a')]({'plain':!![]});if(!_0x4a77f3)throw new Error(_0x2c02('0x3b'));if(_0x4a77f3[_0x2c02('0x3c')]===_0x2c02('0x39')){var _0x1c2ab9=_0x3f634d['get']({'plain':!![]});var _0x30b940=_0x2c02('0x18');return db['UserProfileSection'][_0x2c02('0x35')]({'where':{'name':_0x30b940,'userProfileId':_0x4a77f3[_0x2c02('0x3d')]},'raw':!![]})[_0x2c02('0x16')](function(_0x408ef1){if(_0x408ef1&&_0x408ef1[_0x2c02('0x3e')]===0x0){return db[_0x2c02('0x3f')][_0x2c02('0x37')]({'name':_0x1c2ab9[_0x2c02('0x1b')],'resourceId':_0x1c2ab9['id'],'type':_0x408ef1[_0x2c02('0x1b')],'sectionId':_0x408ef1['id']},{})[_0x2c02('0x16')](function(){return _0x3f634d;});}else{return _0x3f634d;}})[_0x2c02('0x36')](function(_0x348c55){logger['error'](_0x2c02('0x40'),_0x348c55);throw _0x348c55;});}return _0x3f634d;})[_0x2c02('0x16')](respondWithResult(_0x5dff56,0xc9))['catch'](handleError(_0x5dff56,null));};exports['update']=function(_0x22e05a,_0x571df7){if(_0x22e05a[_0x2c02('0x38')]['id']){delete _0x22e05a[_0x2c02('0x38')]['id'];}return db[_0x2c02('0x1f')]['find']({'where':{'id':_0x22e05a[_0x2c02('0x29')]['id']}})['then'](handleEntityNotFound(_0x571df7,null))[_0x2c02('0x16')](saveUpdates(_0x22e05a[_0x2c02('0x38')],null))[_0x2c02('0x16')](respondWithResult(_0x571df7,null))[_0x2c02('0x36')](handleError(_0x571df7,null));};exports['destroy']=function(_0x594422,_0x314da){return db['MailQueue'][_0x2c02('0x35')]({'where':{'id':_0x594422[_0x2c02('0x29')]['id']}})[_0x2c02('0x16')](handleEntityNotFound(_0x314da,null))[_0x2c02('0x16')](removeEntity(_0x314da,null))['catch'](handleError(_0x314da,null));};exports[_0x2c02('0x41')]=function(_0x20cdf1,_0x5d1b86){return db['MailQueue'][_0x2c02('0x41')]()['then'](respondWithResult(_0x5d1b86,null))[_0x2c02('0x36')](handleError(_0x5d1b86,null));};exports[_0x2c02('0x42')]=function(_0x4e1e82,_0x1c2e34){var _0x953a1c={'raw':!![],'where':{}},_0x32eb92={},_0x3d0e44;return db['MailQueue'][_0x2c02('0x43')]({'where':{'id':_0x4e1e82[_0x2c02('0x29')]['id']}})['then'](handleEntityNotFound(_0x1c2e34,null))[_0x2c02('0x16')](function(_0x27cc8a){if(_0x27cc8a){_0x3d0e44=_0x27cc8a[_0x2c02('0x3a')]({'plain':!![]});_0x32eb92[_0x2c02('0x2a')]=_[_0x2c02('0x2b')](db[_0x2c02('0x44')]['rawAttributes']);_0x32eb92['query']=_[_0x2c02('0x2b')](_0x4e1e82[_0x2c02('0x2c')]);_0x32eb92[_0x2c02('0x2d')]=_[_0x2c02('0x2e')](_0x32eb92[_0x2c02('0x2a')],_0x32eb92[_0x2c02('0x2c')]);_0x953a1c['attributes']=_[_0x2c02('0x2e')](_0x32eb92[_0x2c02('0x2a')],qs['fields'](_0x4e1e82[_0x2c02('0x2c')]['fields']));_0x953a1c[_0x2c02('0x2f')]=_0x953a1c[_0x2c02('0x2f')][_0x2c02('0x31')]?_0x953a1c[_0x2c02('0x2f')]:_0x32eb92[_0x2c02('0x2a')];if(!_0x4e1e82[_0x2c02('0x2c')][_0x2c02('0x45')]('nolimit')){_0x953a1c[_0x2c02('0x46')]=qs[_0x2c02('0x46')](_0x4e1e82[_0x2c02('0x2c')]['limit']);_0x953a1c['offset']=qs[_0x2c02('0x12')](_0x4e1e82[_0x2c02('0x2c')][_0x2c02('0x12')]);}_0x953a1c[_0x2c02('0x47')]=qs[_0x2c02('0x48')](_0x4e1e82[_0x2c02('0x2c')][_0x2c02('0x48')]);_0x953a1c[_0x2c02('0x25')]=qs[_0x2c02('0x2d')](_[_0x2c02('0x49')](_0x4e1e82[_0x2c02('0x2c')],_0x32eb92[_0x2c02('0x2d')]));_0x953a1c[_0x2c02('0x25')]['MailQueueId']=_0x27cc8a['id'];if(_0x4e1e82[_0x2c02('0x2c')]['filter']){_0x953a1c[_0x2c02('0x25')]=_[_0x2c02('0x33')](_0x953a1c[_0x2c02('0x25')],{'$or':_[_0x2c02('0x1e')](_0x953a1c[_0x2c02('0x2f')],function(_0x411148){var _0x1cf028={};_0x1cf028[_0x411148]={'$like':'%'+_0x4e1e82[_0x2c02('0x2c')]['filter']+'%'};return _0x1cf028;})});}_0x953a1c=_[_0x2c02('0x33')]({},_0x953a1c,_0x4e1e82['options']);return db[_0x2c02('0x44')][_0x2c02('0x4a')](_0x953a1c);}})[_0x2c02('0x16')](function(_0x52cb49){if(_0x52cb49){return db[_0x2c02('0x4b')][_0x2c02('0x4c')]({'where':{'id':_[_0x2c02('0x1e')](_0x52cb49,_0x2c02('0x4d')),'role':'agent'},'attributes':['id','name','mailPause',_0x2c02('0x4e'),_0x2c02('0x4f')]});}})['then'](function(_0x31fcd2){if(_0x31fcd2){return{'count':_0x31fcd2[_0x2c02('0x11')],'rows':_[_0x2c02('0x1e')](_0x31fcd2['rows'],function(_0x29fd7f){return{'membername':_0x29fd7f[_0x2c02('0x1b')],'UserId':_0x29fd7f['id'],'queue_name':_0x3d0e44[_0x2c02('0x1b')],'MailQueueId':_0x3d0e44['id'],'interface':util[_0x2c02('0x50')](_0x2c02('0x51'),_0x2c02('0x52'),_0x29fd7f['name']),'penalty':0x0,'paused':_0x29fd7f[_0x2c02('0x53')],'createdAt':_0x29fd7f[_0x2c02('0x4f')],'updatedAt':_0x29fd7f[_0x2c02('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2c02('0x16')](respondWithFilteredResult(_0x1c2e34,_0x953a1c))[_0x2c02('0x36')](handleError(_0x1c2e34,null));};exports[_0x2c02('0x54')]=function(_0x2a68e6,_0x45f1bc){var _0xb8d911={};var _0x43baa7={};var _0x3c13d6;var _0x41246c;return db[_0x2c02('0x1f')]['findOne']({'where':{'id':_0x2a68e6[_0x2c02('0x29')]['id']}})[_0x2c02('0x16')](handleEntityNotFound(_0x45f1bc,null))['then'](function(_0x13d749){if(_0x13d749){_0x3c13d6=_0x13d749;_0x43baa7[_0x2c02('0x2a')]=_[_0x2c02('0x2b')](db[_0x2c02('0x55')]['rawAttributes']);_0x43baa7[_0x2c02('0x2c')]=_[_0x2c02('0x2b')](_0x2a68e6[_0x2c02('0x2c')]);_0x43baa7[_0x2c02('0x2d')]=_[_0x2c02('0x2e')](_0x43baa7[_0x2c02('0x2a')],_0x43baa7[_0x2c02('0x2c')]);_0xb8d911[_0x2c02('0x2f')]=_[_0x2c02('0x2e')](_0x43baa7[_0x2c02('0x2a')],qs[_0x2c02('0x30')](_0x2a68e6[_0x2c02('0x2c')][_0x2c02('0x30')]));_0xb8d911[_0x2c02('0x2f')]=_0xb8d911[_0x2c02('0x2f')]['length']?_0xb8d911[_0x2c02('0x2f')]:_0x43baa7['model'];_0xb8d911[_0x2c02('0x47')]=qs[_0x2c02('0x48')](_0x2a68e6[_0x2c02('0x2c')][_0x2c02('0x48')]);_0xb8d911[_0x2c02('0x25')]=qs[_0x2c02('0x2d')](_[_0x2c02('0x49')](_0x2a68e6[_0x2c02('0x2c')],_0x43baa7['filters']));if(_0x2a68e6[_0x2c02('0x2c')][_0x2c02('0x56')]){_0xb8d911['where']=_['merge'](_0xb8d911[_0x2c02('0x25')],{'$or':_[_0x2c02('0x1e')](_0xb8d911[_0x2c02('0x2f')],function(_0x2bfa7b){var _0xc3e5f9={};_0xc3e5f9[_0x2bfa7b]={'$like':'%'+_0x2a68e6[_0x2c02('0x2c')][_0x2c02('0x56')]+'%'};return _0xc3e5f9;})});}_0xb8d911=_['merge']({},_0xb8d911,_0x2a68e6['options']);return _0x3c13d6[_0x2c02('0x54')](_0xb8d911);}})[_0x2c02('0x16')](function(_0x19035f){if(_0x19035f){_0x41246c=_0x19035f[_0x2c02('0x31')];if(!_0x2a68e6['query']['hasOwnProperty']('nolimit')){_0xb8d911['limit']=qs[_0x2c02('0x46')](_0x2a68e6['query']['limit']);_0xb8d911[_0x2c02('0x12')]=qs['offset'](_0x2a68e6[_0x2c02('0x2c')][_0x2c02('0x12')]);}return _0x3c13d6[_0x2c02('0x54')](_0xb8d911);}})[_0x2c02('0x16')](function(_0x37acbd){if(_0x37acbd){return _0x37acbd?{'count':_0x41246c,'rows':_0x37acbd}:null;}})[_0x2c02('0x16')](respondWithResult(_0x45f1bc,null))[_0x2c02('0x36')](handleError(_0x45f1bc,null));};exports[_0x2c02('0x57')]=function(_0x566bcf,_0x22faa7){var _0xe64927=_0x566bcf[_0x2c02('0x38')][_0x2c02('0x58')];return db['Team'][_0x2c02('0x4a')]({'where':{'id':_0xe64927},'attributes':['id'],'include':[{'model':db[_0x2c02('0x4b')],'as':'Agents','attributes':['id',_0x2c02('0x1b'),_0x2c02('0x59'),_0x2c02('0x5a'),_0x2c02('0x5b')],'raw':!![]}]})[_0x2c02('0x16')](function(_0x57986e){if(_0x57986e){var _0x471818=_[_0x2c02('0x5c')](_0x57986e,function(_0x53815a){var _0x5ae1ac=_0x53815a[_0x2c02('0x3a')]({'plain':!![]});return _0x5ae1ac['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x566bcf['params']['id']}})[_0x2c02('0x16')](function(_0x5b5fa3){return db[_0x2c02('0x5d')][_0x2c02('0x5e')](function(_0x1c9733){return _0x5b5fa3[_0x2c02('0x57')](_0xe64927,{'transaction':_0x1c9733})['then'](function(){return BPromise[_0x2c02('0x5f')](_0x471818,function(_0x8c8c08){return db[_0x2c02('0x44')][_0x2c02('0x60')]({'where':{'UserId':_0x8c8c08['id'],'MailQueueId':_0x566bcf['params']['id']},'transaction':_0x1c9733});});})[_0x2c02('0x16')](function(){_0x471818[_0x2c02('0x61')](function(_0x1bb1c2){socket['emit'](_0x2c02('0x62'),{'UserId':_0x1bb1c2['id'],'MailQueueId':_0x5b5fa3['id']});});});});});}})['then'](respondWithStatusCode(_0x22faa7,null))[_0x2c02('0x36')](handleError(_0x22faa7,null));};exports[_0x2c02('0x63')]=function(_0x546ac7,_0x1592a5){return db[_0x2c02('0x55')][_0x2c02('0x4a')]({'where':{'id':_0x546ac7['query'][_0x2c02('0x58')]},'attributes':['id'],'include':[{'model':db[_0x2c02('0x4b')],'as':_0x2c02('0x64'),'attributes':['id'],'raw':!![]}]})[_0x2c02('0x16')](handleEntityNotFound(_0x1592a5,null))[_0x2c02('0x16')](function(_0x6934a9){var _0x4a8a6d=_[_0x2c02('0x1e')](_0x6934a9,'id');var _0xcc46d8=[];var _0x29bcd9=[];var _0x13d073=squel[_0x2c02('0x65')]();_0x13d073[_0x2c02('0x66')]('tq.TeamId')[_0x2c02('0x67')](_0x2c02('0x68'),'tq')[_0x2c02('0x69')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2c02('0x25')](_0x2c02('0x6a'),_0x546ac7[_0x2c02('0x29')]['id']);for(var _0x259ff1=0x0;_0x259ff1<_0x6934a9['length'];_0x259ff1+=0x1){let _0x3b2674=_0x6934a9[_0x259ff1];for(var _0x5b1e70=0x0;_0x5b1e70<_0x3b2674[_0x2c02('0x64')][_0x2c02('0x31')];_0x5b1e70+=0x1){let _0x48e15a=_0x3b2674[_0x2c02('0x64')][_0x5b1e70];var _0x3208de=_0x13d073[_0x2c02('0x6b')]();_0x3208de[_0x2c02('0x25')](_0x2c02('0x6c'),_0x48e15a['id']);_0x29bcd9['push'](db[_0x2c02('0x5d')]['query'](_0x3208de['toString'](),{'type':db['sequelize']['QueryTypes'][_0x2c02('0x6d')]})['then'](function(_0x36ed20){if(_0x36ed20[_0x2c02('0x31')]===0x1){return _0x48e15a['id'];}else{var _0x2808ae=_[_0x2c02('0x6e')](_[_0x2c02('0x1e')](_0x36ed20,_0x2c02('0x6f')),function(_0x4413d3){return _['includes'](_0x4a8a6d,_0x4413d3);});if(_0x2808ae){return _0x48e15a['id'];}}}));}}return BPromise['all'](_0x29bcd9)[_0x2c02('0x16')](function(_0x589109){_0xcc46d8=_(_0xcc46d8)[_0x2c02('0x70')](_0x589109)['compact']()[_0x2c02('0x71')]();return db[_0x2c02('0x1f')][_0x2c02('0x35')]({'where':{'id':_0x546ac7[_0x2c02('0x29')]['id']}})[_0x2c02('0x16')](function(_0x53462a){return db['sequelize']['transaction'](function(_0x456ead){return _0x53462a['removeTeams'](_0x546ac7[_0x2c02('0x2c')]['ids'],{'transaction':_0x456ead})['then'](function(){if(!_[_0x2c02('0x72')](_0xcc46d8)){return _0x53462a['removeAgents'](_0xcc46d8,{'transaction':_0x456ead});}})[_0x2c02('0x16')](function(){_0xcc46d8[_0x2c02('0x61')](function(_0x15f66f){socket[_0x2c02('0x73')]('userMailQueue:remove',{'UserId':_0x15f66f,'MailQueueId':_0x53462a['id']});});});});});});})[_0x2c02('0x16')](respondWithStatusCode(_0x1592a5,null))[_0x2c02('0x36')](handleError(_0x1592a5,null));};exports[_0x2c02('0x74')]=function(_0x372852,_0x4a5f50){return db[_0x2c02('0x1f')][_0x2c02('0x35')]({'where':{'id':_0x372852[_0x2c02('0x29')]['id']}})['then'](handleEntityNotFound(_0x4a5f50,null))[_0x2c02('0x16')](function(_0x5bfc00){if(_0x5bfc00){return _0x5bfc00[_0x2c02('0x74')](_0x372852[_0x2c02('0x38')]['ids'],_['omit'](_0x372852[_0x2c02('0x38')],[_0x2c02('0x58'),'id'])||{})[_0x2c02('0x75')](function(_0x52f0b0){for(var _0x1240c0=0x0;_0x1240c0<_0x372852[_0x2c02('0x38')][_0x2c02('0x58')]['length'];_0x1240c0+=0x1){socket['emit'](_0x2c02('0x62'),{'UserId':Number(_0x372852[_0x2c02('0x38')][_0x2c02('0x58')][_0x1240c0]),'MailQueueId':Number(_0x372852['params']['id'])});}return _0x52f0b0;});}})['then'](respondWithResult(_0x4a5f50,null))['catch'](handleError(_0x4a5f50,null));};exports['removeAgents']=function(_0x563aa9,_0x2a419c){return db['MailQueue'][_0x2c02('0x35')]({'where':{'id':_0x563aa9['params']['id']}})['then'](handleEntityNotFound(_0x2a419c,null))[_0x2c02('0x16')](function(_0x2bb2e3){if(_0x2bb2e3){return _0x2bb2e3[_0x2c02('0x76')](_0x563aa9[_0x2c02('0x2c')][_0x2c02('0x58')])['then'](function(){if(_[_0x2c02('0x77')](_0x563aa9[_0x2c02('0x2c')][_0x2c02('0x58')])){for(var _0x5c78ee=0x0;_0x5c78ee<_0x563aa9['query'][_0x2c02('0x58')][_0x2c02('0x31')];_0x5c78ee+=0x1){socket[_0x2c02('0x73')](_0x2c02('0x78'),{'UserId':Number(_0x563aa9[_0x2c02('0x2c')][_0x2c02('0x58')][_0x5c78ee]),'MailQueueId':Number(_0x563aa9[_0x2c02('0x29')]['id'])});}}else{socket[_0x2c02('0x73')](_0x2c02('0x78'),{'UserId':Number(_0x563aa9[_0x2c02('0x2c')][_0x2c02('0x58')]),'MailQueueId':Number(_0x563aa9['params']['id'])});}});}})[_0x2c02('0x16')](respondWithStatusCode(_0x2a419c,null))[_0x2c02('0x36')](handleError(_0x2a419c,null));};exports[_0x2c02('0x79')]=function(_0x44b336,_0xa5c6d4){var _0x2e3174={};var _0x2acce8={};var _0x5a3091;var _0x4809ac;return db[_0x2c02('0x1f')][_0x2c02('0x43')]({'where':{'id':_0x44b336[_0x2c02('0x29')]['id']}})[_0x2c02('0x16')](handleEntityNotFound(_0xa5c6d4,null))[_0x2c02('0x16')](function(_0x135920){if(_0x135920){_0x5a3091=_0x135920;_0x2acce8['model']=_['keys'](db[_0x2c02('0x4b')][_0x2c02('0x20')]);_0x2acce8[_0x2c02('0x2c')]=_['keys'](_0x44b336[_0x2c02('0x2c')]);_0x2acce8[_0x2c02('0x2d')]=_[_0x2c02('0x2e')](_0x2acce8[_0x2c02('0x2a')],_0x2acce8['query']);_0x2e3174[_0x2c02('0x2f')]=_[_0x2c02('0x2e')](_0x2acce8[_0x2c02('0x2a')],qs['fields'](_0x44b336[_0x2c02('0x2c')][_0x2c02('0x30')]));_0x2e3174[_0x2c02('0x2f')]=_0x2e3174['attributes'][_0x2c02('0x31')]?_0x2e3174[_0x2c02('0x2f')]:_0x2acce8[_0x2c02('0x2a')];_0x2e3174[_0x2c02('0x47')]=qs[_0x2c02('0x48')](_0x44b336[_0x2c02('0x2c')][_0x2c02('0x48')]);_0x2e3174[_0x2c02('0x25')]=qs['filters'](_[_0x2c02('0x49')](_0x44b336['query'],_0x2acce8[_0x2c02('0x2d')]));if(_0x44b336[_0x2c02('0x2c')][_0x2c02('0x56')]){_0x2e3174[_0x2c02('0x25')]=_[_0x2c02('0x33')](_0x2e3174['where'],{'$or':_[_0x2c02('0x1e')](_0x2e3174[_0x2c02('0x2f')],function(_0x4cf59a){var _0x922863={};_0x922863[_0x4cf59a]={'$like':'%'+_0x44b336[_0x2c02('0x2c')]['filter']+'%'};return _0x922863;})});}_0x2e3174=_[_0x2c02('0x33')]({},_0x2e3174,_0x44b336[_0x2c02('0x34')]);return _0x5a3091['getAgents'](_0x2e3174);}})[_0x2c02('0x16')](function(_0x4540ad){if(_0x4540ad){_0x4809ac=_0x4540ad[_0x2c02('0x31')];if(!_0x44b336['query'][_0x2c02('0x45')](_0x2c02('0x7a'))){_0x2e3174[_0x2c02('0x46')]=qs[_0x2c02('0x46')](_0x44b336['query']['limit']);_0x2e3174[_0x2c02('0x12')]=qs[_0x2c02('0x12')](_0x44b336[_0x2c02('0x2c')]['offset']);}return _0x5a3091[_0x2c02('0x79')](_0x2e3174);}})['then'](function(_0x2d605e){if(_0x2d605e){return _0x2d605e?{'count':_0x4809ac,'rows':_0x2d605e}:null;}})[_0x2c02('0x16')](respondWithResult(_0xa5c6d4,null))['catch'](handleError(_0xa5c6d4,null));}; \ No newline at end of file +var _0xeebd=['sendStatus','error','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','rows','catch','show','params','model','keys','filters','intersection','attributes','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','hasOwnProperty','nolimit','order','sort','MailQueueId','filter','merge','findAndCountAll','UserId','updatedAt','format','%s/%s','mailPause','createdAt','getTeams','pick','addTeams','ids','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','findAll','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource'];(function(_0x2af9f4,_0x3121c0){var _0xc69f8=function(_0x4695df){while(--_0x4695df){_0x2af9f4['push'](_0x2af9f4['shift']());}};_0xc69f8(++_0x3121c0);}(_0xeebd,0x15b));var _0xdeeb=function(_0x159798,_0x489359){_0x159798=_0x159798-0x0;var _0x13a8da=_0xeebd[_0x159798];return _0x13a8da;};'use strict';var BPromise=require(_0xdeeb('0x0'));var util=require(_0xdeeb('0x1'));var _=require(_0xdeeb('0x2'));var squel=require(_0xdeeb('0x3'));var Redis=require(_0xdeeb('0x4'));var qs=require(_0xdeeb('0x5'));var logger=require(_0xdeeb('0x6'))(_0xdeeb('0x7'));var config=require(_0xdeeb('0x8'));var db=require(_0xdeeb('0x9'))['db'];config[_0xdeeb('0xa')]=_[_0xdeeb('0xb')](config[_0xdeeb('0xa')],{'host':_0xdeeb('0xc'),'port':0x18eb});var socket=require(_0xdeeb('0xd'))(new Redis(config[_0xdeeb('0xa')]));require(_0xdeeb('0xe'))[_0xdeeb('0xf')](socket);function respondWithStatusCode(_0xe9a7ab,_0x42320a){_0x42320a=_0x42320a||0xcc;return function(_0x246b36){if(_0x246b36){return _0xe9a7ab['sendStatus'](_0x42320a);}return _0xe9a7ab[_0xdeeb('0x10')](_0x42320a)[_0xdeeb('0x11')]();};}function respondWithResult(_0x4db49e,_0x2aaa18){_0x2aaa18=_0x2aaa18||0xc8;return function(_0x5148cb){if(_0x5148cb){return _0x4db49e[_0xdeeb('0x10')](_0x2aaa18)[_0xdeeb('0x12')](_0x5148cb);}};}function respondWithFilteredResult(_0x3ec3ab,_0x415ed5){return function(_0x226d80){if(_0x226d80){var _0x3cf145=typeof _0x415ed5['offset']===_0xdeeb('0x13')&&typeof _0x415ed5[_0xdeeb('0x14')]===_0xdeeb('0x13');var _0x287a51=_0x226d80[_0xdeeb('0x15')];var _0x5dbbbf=_0x3cf145?0x0:_0x415ed5[_0xdeeb('0x16')];var _0x35b09c=_0x3cf145?_0x226d80[_0xdeeb('0x15')]:_0x415ed5[_0xdeeb('0x16')]+_0x415ed5[_0xdeeb('0x14')];var _0x36c736;if(_0x35b09c>=_0x287a51){_0x35b09c=_0x287a51;_0x36c736=0xc8;}else{_0x36c736=0xce;}_0x3ec3ab[_0xdeeb('0x10')](_0x36c736);return _0x3ec3ab[_0xdeeb('0x17')](_0xdeeb('0x18'),_0x5dbbbf+'-'+_0x35b09c+'/'+_0x287a51)[_0xdeeb('0x12')](_0x226d80);}return null;};}function saveUpdates(_0x1f087f){return function(_0x176549){if(_0x176549){return _0x176549[_0xdeeb('0x19')](_0x1f087f)[_0xdeeb('0x1a')](function(_0x4b874d){return _0x4b874d;});}return null;};}function removeEntity(_0x5d3d69){return function(_0x19b570){if(_0x19b570){return _0x19b570[_0xdeeb('0x1b')]()[_0xdeeb('0x1a')](function(){var _0x46ba1a=_0x19b570[_0xdeeb('0x1c')]({'plain':!![]});var _0x401d21=_0xdeeb('0x1d');return db[_0xdeeb('0x1e')]['destroy']({'where':{'type':_0x401d21,'resourceId':_0x46ba1a['id']}})[_0xdeeb('0x1a')](function(){return _0x19b570;});})[_0xdeeb('0x1a')](function(){_0x5d3d69[_0xdeeb('0x10')](0xcc)[_0xdeeb('0x11')]();});}};}function handleEntityNotFound(_0x265ef8){return function(_0x3d9c5f){if(!_0x3d9c5f){_0x265ef8[_0xdeeb('0x1f')](0x194);}return _0x3d9c5f;};}function handleError(_0x1e9836,_0x10853d){_0x10853d=_0x10853d||0x1f4;return function(_0x16ef0e){logger[_0xdeeb('0x20')](_0x16ef0e['stack']);if(_0x16ef0e[_0xdeeb('0x21')]){delete _0x16ef0e[_0xdeeb('0x21')];}_0x1e9836['status'](_0x10853d)[_0xdeeb('0x22')](_0x16ef0e);};}exports[_0xdeeb('0x23')]=function(_0x3cf4b9,_0xf446bf){var _0x456913={};var _0x24b768={'count':0x0,'rows':[]};var _0x9b1749=_[_0xdeeb('0x24')](db[_0xdeeb('0x25')][_0xdeeb('0x26')],function(_0x2243fd){return{'name':_0x2243fd[_0xdeeb('0x27')],'type':_0x2243fd[_0xdeeb('0x28')][_0xdeeb('0x29')]};});_0x456913=qs[_0xdeeb('0x2a')](_0x9b1749,_0x3cf4b9);var _0x2a11de={'where':_0x456913[_0xdeeb('0x2b')]};return db[_0xdeeb('0x25')][_0xdeeb('0x15')](_0x2a11de)[_0xdeeb('0x1a')](function(_0x4b0b39){_0x24b768[_0xdeeb('0x15')]=_0x4b0b39;_0x456913['include']=qs[_0xdeeb('0x2c')](_0x3cf4b9[_0xdeeb('0x2d')]);return db[_0xdeeb('0x25')]['findAll'](_0x456913);})[_0xdeeb('0x1a')](function(_0x3a9530){_0x24b768[_0xdeeb('0x2e')]=_0x3a9530;return _0x24b768;})[_0xdeeb('0x1a')](respondWithFilteredResult(_0xf446bf,_0x456913))[_0xdeeb('0x2f')](handleError(_0xf446bf,null));};exports[_0xdeeb('0x30')]=function(_0x1f6f58,_0x5d8db6){var _0xf14fe7={'raw':!![],'where':{'id':_0x1f6f58[_0xdeeb('0x31')]['id']}},_0x5e6c56={};_0x5e6c56[_0xdeeb('0x32')]=_[_0xdeeb('0x33')](db[_0xdeeb('0x25')][_0xdeeb('0x26')]);_0x5e6c56['query']=_[_0xdeeb('0x33')](_0x1f6f58[_0xdeeb('0x2d')]);_0x5e6c56[_0xdeeb('0x34')]=_[_0xdeeb('0x35')](_0x5e6c56[_0xdeeb('0x32')],_0x5e6c56['query']);_0xf14fe7[_0xdeeb('0x36')]=_[_0xdeeb('0x35')](_0x5e6c56[_0xdeeb('0x32')],qs['fields'](_0x1f6f58[_0xdeeb('0x2d')][_0xdeeb('0x37')]));_0xf14fe7[_0xdeeb('0x36')]=_0xf14fe7[_0xdeeb('0x36')]['length']?_0xf14fe7['attributes']:_0x5e6c56[_0xdeeb('0x32')];if(_0x1f6f58[_0xdeeb('0x2d')]['includeAll']){_0xf14fe7[_0xdeeb('0x2c')]=[{'all':!![]}];}_0xf14fe7=_['merge']({},_0xf14fe7,_0x1f6f58[_0xdeeb('0x38')]);return db[_0xdeeb('0x25')]['find'](_0xf14fe7)[_0xdeeb('0x1a')](handleEntityNotFound(_0x5d8db6,null))['then'](respondWithResult(_0x5d8db6,null))['catch'](handleError(_0x5d8db6,null));};exports[_0xdeeb('0x39')]=function(_0xe1eb2e,_0x213739){return db[_0xdeeb('0x25')][_0xdeeb('0x39')](_0xe1eb2e[_0xdeeb('0x3a')],{})['then'](function(_0x4a49a6){var _0x2281f6=_0xe1eb2e[_0xdeeb('0x3b')][_0xdeeb('0x1c')]({'plain':!![]});if(!_0x2281f6)throw new Error(_0xdeeb('0x3c'));if(_0x2281f6['role']==='user'){var _0x55e8ba=_0x4a49a6[_0xdeeb('0x1c')]({'plain':!![]});var _0x58ae39='MailQueues';return db[_0xdeeb('0x3d')][_0xdeeb('0x3e')]({'where':{'name':_0x58ae39,'userProfileId':_0x2281f6[_0xdeeb('0x3f')]},'raw':!![]})['then'](function(_0x1676f3){if(_0x1676f3&&_0x1676f3[_0xdeeb('0x40')]===0x0){return db[_0xdeeb('0x1e')][_0xdeeb('0x39')]({'name':_0x55e8ba[_0xdeeb('0x21')],'resourceId':_0x55e8ba['id'],'type':_0x1676f3['name'],'sectionId':_0x1676f3['id']},{})[_0xdeeb('0x1a')](function(){return _0x4a49a6;});}else{return _0x4a49a6;}})[_0xdeeb('0x2f')](function(_0x2607f5){logger['error'](_0xdeeb('0x41'),_0x2607f5);throw _0x2607f5;});}return _0x4a49a6;})[_0xdeeb('0x1a')](respondWithResult(_0x213739,0xc9))[_0xdeeb('0x2f')](handleError(_0x213739,null));};exports[_0xdeeb('0x19')]=function(_0x9b3dd,_0x3f3522){if(_0x9b3dd['body']['id']){delete _0x9b3dd[_0xdeeb('0x3a')]['id'];}return db[_0xdeeb('0x25')]['find']({'where':{'id':_0x9b3dd[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x3f3522,null))[_0xdeeb('0x1a')](saveUpdates(_0x9b3dd[_0xdeeb('0x3a')],null))[_0xdeeb('0x1a')](respondWithResult(_0x3f3522,null))[_0xdeeb('0x2f')](handleError(_0x3f3522,null));};exports['destroy']=function(_0x2369c0,_0x42e795){return db[_0xdeeb('0x25')][_0xdeeb('0x3e')]({'where':{'id':_0x2369c0[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x42e795,null))[_0xdeeb('0x1a')](removeEntity(_0x42e795,null))[_0xdeeb('0x2f')](handleError(_0x42e795,null));};exports[_0xdeeb('0x42')]=function(_0x4c0b07,_0x51b8b1){return db[_0xdeeb('0x25')][_0xdeeb('0x42')]()[_0xdeeb('0x1a')](respondWithResult(_0x51b8b1,null))[_0xdeeb('0x2f')](handleError(_0x51b8b1,null));};exports[_0xdeeb('0x43')]=function(_0x33bc92,_0x4a367f){var _0x398df5={'raw':!![],'where':{}},_0x11debf={},_0x5ac08a;return db['MailQueue'][_0xdeeb('0x44')]({'where':{'id':_0x33bc92[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x4a367f,null))[_0xdeeb('0x1a')](function(_0x3ff940){if(_0x3ff940){_0x5ac08a=_0x3ff940['get']({'plain':!![]});_0x11debf['model']=_['keys'](db[_0xdeeb('0x45')]['rawAttributes']);_0x11debf['query']=_[_0xdeeb('0x33')](_0x33bc92[_0xdeeb('0x2d')]);_0x11debf[_0xdeeb('0x34')]=_[_0xdeeb('0x35')](_0x11debf['model'],_0x11debf[_0xdeeb('0x2d')]);_0x398df5['attributes']=_[_0xdeeb('0x35')](_0x11debf[_0xdeeb('0x32')],qs[_0xdeeb('0x37')](_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x37')]));_0x398df5['attributes']=_0x398df5[_0xdeeb('0x36')][_0xdeeb('0x46')]?_0x398df5['attributes']:_0x11debf[_0xdeeb('0x32')];if(!_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x47')](_0xdeeb('0x48'))){_0x398df5[_0xdeeb('0x14')]=qs[_0xdeeb('0x14')](_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x14')]);_0x398df5[_0xdeeb('0x16')]=qs[_0xdeeb('0x16')](_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x16')]);}_0x398df5[_0xdeeb('0x49')]=qs[_0xdeeb('0x4a')](_0x33bc92['query'][_0xdeeb('0x4a')]);_0x398df5[_0xdeeb('0x2b')]=qs[_0xdeeb('0x34')](_['pick'](_0x33bc92[_0xdeeb('0x2d')],_0x11debf['filters']));_0x398df5[_0xdeeb('0x2b')][_0xdeeb('0x4b')]=_0x3ff940['id'];if(_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x4c')]){_0x398df5['where']=_[_0xdeeb('0x4d')](_0x398df5[_0xdeeb('0x2b')],{'$or':_[_0xdeeb('0x24')](_0x398df5['attributes'],function(_0x10e985){var _0x4d1fe4={};_0x4d1fe4[_0x10e985]={'$like':'%'+_0x33bc92[_0xdeeb('0x2d')][_0xdeeb('0x4c')]+'%'};return _0x4d1fe4;})});}_0x398df5=_[_0xdeeb('0x4d')]({},_0x398df5,_0x33bc92['options']);return db['UserMailQueue']['findAll'](_0x398df5);}})[_0xdeeb('0x1a')](function(_0x34aba7){if(_0x34aba7){return db['User'][_0xdeeb('0x4e')]({'where':{'id':_[_0xdeeb('0x24')](_0x34aba7,_0xdeeb('0x4f')),'role':'agent'},'attributes':['id',_0xdeeb('0x21'),'mailPause',_0xdeeb('0x50'),'createdAt']});}})[_0xdeeb('0x1a')](function(_0x18275d){if(_0x18275d){return{'count':_0x18275d['count'],'rows':_[_0xdeeb('0x24')](_0x18275d[_0xdeeb('0x2e')],function(_0x1b9a9e){return{'membername':_0x1b9a9e['name'],'UserId':_0x1b9a9e['id'],'queue_name':_0x5ac08a[_0xdeeb('0x21')],'MailQueueId':_0x5ac08a['id'],'interface':util[_0xdeeb('0x51')](_0xdeeb('0x52'),'SIP',_0x1b9a9e['name']),'penalty':0x0,'paused':_0x1b9a9e[_0xdeeb('0x53')],'createdAt':_0x1b9a9e[_0xdeeb('0x54')],'updatedAt':_0x1b9a9e[_0xdeeb('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdeeb('0x1a')](respondWithFilteredResult(_0x4a367f,_0x398df5))['catch'](handleError(_0x4a367f,null));};exports[_0xdeeb('0x55')]=function(_0x5ad0f1,_0x2d59bb){var _0x2b473={};var _0x4d9778={};var _0x1eac37;var _0x1fb3fe;return db['MailQueue']['findOne']({'where':{'id':_0x5ad0f1[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x2d59bb,null))[_0xdeeb('0x1a')](function(_0x1a0257){if(_0x1a0257){_0x1eac37=_0x1a0257;_0x4d9778[_0xdeeb('0x32')]=_['keys'](db['Team'][_0xdeeb('0x26')]);_0x4d9778[_0xdeeb('0x2d')]=_[_0xdeeb('0x33')](_0x5ad0f1[_0xdeeb('0x2d')]);_0x4d9778[_0xdeeb('0x34')]=_[_0xdeeb('0x35')](_0x4d9778[_0xdeeb('0x32')],_0x4d9778[_0xdeeb('0x2d')]);_0x2b473[_0xdeeb('0x36')]=_['intersection'](_0x4d9778[_0xdeeb('0x32')],qs['fields'](_0x5ad0f1[_0xdeeb('0x2d')][_0xdeeb('0x37')]));_0x2b473[_0xdeeb('0x36')]=_0x2b473[_0xdeeb('0x36')][_0xdeeb('0x46')]?_0x2b473[_0xdeeb('0x36')]:_0x4d9778[_0xdeeb('0x32')];_0x2b473[_0xdeeb('0x49')]=qs[_0xdeeb('0x4a')](_0x5ad0f1[_0xdeeb('0x2d')][_0xdeeb('0x4a')]);_0x2b473['where']=qs[_0xdeeb('0x34')](_[_0xdeeb('0x56')](_0x5ad0f1['query'],_0x4d9778['filters']));if(_0x5ad0f1['query'][_0xdeeb('0x4c')]){_0x2b473['where']=_['merge'](_0x2b473[_0xdeeb('0x2b')],{'$or':_['map'](_0x2b473[_0xdeeb('0x36')],function(_0x21ecc9){var _0x4fbf21={};_0x4fbf21[_0x21ecc9]={'$like':'%'+_0x5ad0f1[_0xdeeb('0x2d')][_0xdeeb('0x4c')]+'%'};return _0x4fbf21;})});}_0x2b473=_[_0xdeeb('0x4d')]({},_0x2b473,_0x5ad0f1[_0xdeeb('0x38')]);return _0x1eac37[_0xdeeb('0x55')](_0x2b473);}})['then'](function(_0x14c49a){if(_0x14c49a){_0x1fb3fe=_0x14c49a['length'];if(!_0x5ad0f1[_0xdeeb('0x2d')][_0xdeeb('0x47')](_0xdeeb('0x48'))){_0x2b473[_0xdeeb('0x14')]=qs[_0xdeeb('0x14')](_0x5ad0f1[_0xdeeb('0x2d')]['limit']);_0x2b473['offset']=qs[_0xdeeb('0x16')](_0x5ad0f1[_0xdeeb('0x2d')][_0xdeeb('0x16')]);}return _0x1eac37[_0xdeeb('0x55')](_0x2b473);}})[_0xdeeb('0x1a')](function(_0x5deb37){if(_0x5deb37){return _0x5deb37?{'count':_0x1fb3fe,'rows':_0x5deb37}:null;}})[_0xdeeb('0x1a')](respondWithResult(_0x2d59bb,null))[_0xdeeb('0x2f')](handleError(_0x2d59bb,null));};exports[_0xdeeb('0x57')]=function(_0x595504,_0x588171){var _0x1c806a=_0x595504['body'][_0xdeeb('0x58')];return db[_0xdeeb('0x59')]['findAll']({'where':{'id':_0x1c806a},'attributes':['id'],'include':[{'model':db[_0xdeeb('0x5a')],'as':_0xdeeb('0x5b'),'attributes':['id','name',_0xdeeb('0x5c'),_0xdeeb('0x5d'),_0xdeeb('0x5e')],'raw':!![]}]})[_0xdeeb('0x1a')](function(_0x3aebda){if(_0x3aebda){var _0x295ba9=_[_0xdeeb('0x5f')](_0x3aebda,function(_0x41ecd1){var _0x269e09=_0x41ecd1[_0xdeeb('0x1c')]({'plain':!![]});return _0x269e09['Agents'];});return db[_0xdeeb('0x25')][_0xdeeb('0x3e')]({'where':{'id':_0x595504[_0xdeeb('0x31')]['id']}})['then'](function(_0x4fbf7c){return db[_0xdeeb('0x60')][_0xdeeb('0x61')](function(_0x52681b){return _0x4fbf7c['addTeams'](_0x1c806a,{'transaction':_0x52681b})[_0xdeeb('0x1a')](function(){return BPromise['each'](_0x295ba9,function(_0x88cb1a){return db[_0xdeeb('0x45')][_0xdeeb('0x62')]({'where':{'UserId':_0x88cb1a['id'],'MailQueueId':_0x595504[_0xdeeb('0x31')]['id']},'transaction':_0x52681b});});})[_0xdeeb('0x1a')](function(){_0x295ba9[_0xdeeb('0x63')](function(_0x4b9ced){socket[_0xdeeb('0x64')](_0xdeeb('0x65'),{'UserId':_0x4b9ced['id'],'MailQueueId':_0x4fbf7c['id']});});});});});}})['then'](respondWithStatusCode(_0x588171,null))[_0xdeeb('0x2f')](handleError(_0x588171,null));};exports[_0xdeeb('0x66')]=function(_0x45b882,_0x20b463){return db[_0xdeeb('0x59')][_0xdeeb('0x67')]({'where':{'id':_0x45b882[_0xdeeb('0x2d')][_0xdeeb('0x58')]},'attributes':['id'],'include':[{'model':db[_0xdeeb('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdeeb('0x1a')](handleEntityNotFound(_0x20b463,null))[_0xdeeb('0x1a')](function(_0x5050e8){var _0x2c6a65=_['map'](_0x5050e8,'id');var _0x238ee7=[];var _0x377896=[];var _0x50c5a8=squel[_0xdeeb('0x68')]();_0x50c5a8[_0xdeeb('0x69')](_0xdeeb('0x6a'))[_0xdeeb('0x6b')](_0xdeeb('0x6c'),'tq')[_0xdeeb('0x6d')](_0xdeeb('0x6e'),'ut',_0xdeeb('0x6f'))[_0xdeeb('0x2b')]('MailQueueId\x20=\x20?',_0x45b882[_0xdeeb('0x31')]['id']);for(var _0x86b091=0x0;_0x86b091<_0x5050e8[_0xdeeb('0x46')];_0x86b091+=0x1){let _0x2402f5=_0x5050e8[_0x86b091];for(var _0x10caca=0x0;_0x10caca<_0x2402f5[_0xdeeb('0x5b')][_0xdeeb('0x46')];_0x10caca+=0x1){let _0x34de1=_0x2402f5['Agents'][_0x10caca];var _0x4f45d4=_0x50c5a8['clone']();_0x4f45d4[_0xdeeb('0x2b')]('ut.UserId\x20=\x20?',_0x34de1['id']);_0x377896['push'](db['sequelize']['query'](_0x4f45d4[_0xdeeb('0x70')](),{'type':db[_0xdeeb('0x60')][_0xdeeb('0x71')][_0xdeeb('0x72')]})[_0xdeeb('0x1a')](function(_0x21450c){if(_0x21450c[_0xdeeb('0x46')]===0x1){return _0x34de1['id'];}else{var _0x592733=_[_0xdeeb('0x73')](_[_0xdeeb('0x24')](_0x21450c,_0xdeeb('0x74')),function(_0x290502){return _['includes'](_0x2c6a65,_0x290502);});if(_0x592733){return _0x34de1['id'];}}}));}}return BPromise[_0xdeeb('0x75')](_0x377896)['then'](function(_0x14f1ac){_0x238ee7=_(_0x238ee7)[_0xdeeb('0x76')](_0x14f1ac)['compact']()['value']();return db[_0xdeeb('0x25')]['find']({'where':{'id':_0x45b882[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](function(_0x2ac16b){return db[_0xdeeb('0x60')]['transaction'](function(_0x268376){return _0x2ac16b[_0xdeeb('0x66')](_0x45b882[_0xdeeb('0x2d')][_0xdeeb('0x58')],{'transaction':_0x268376})['then'](function(){if(!_[_0xdeeb('0x77')](_0x238ee7)){return _0x2ac16b[_0xdeeb('0x78')](_0x238ee7,{'transaction':_0x268376});}})[_0xdeeb('0x1a')](function(){_0x238ee7[_0xdeeb('0x63')](function(_0xb8ec5){socket[_0xdeeb('0x64')](_0xdeeb('0x79'),{'UserId':_0xb8ec5,'MailQueueId':_0x2ac16b['id']});});});});});});})[_0xdeeb('0x1a')](respondWithStatusCode(_0x20b463,null))[_0xdeeb('0x2f')](handleError(_0x20b463,null));};exports[_0xdeeb('0x7a')]=function(_0x1ddaee,_0x1e6fff){return db[_0xdeeb('0x25')][_0xdeeb('0x3e')]({'where':{'id':_0x1ddaee[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x1e6fff,null))['then'](function(_0x5ea101){if(_0x5ea101){return _0x5ea101['addAgents'](_0x1ddaee[_0xdeeb('0x3a')]['ids'],_[_0xdeeb('0x7b')](_0x1ddaee[_0xdeeb('0x3a')],[_0xdeeb('0x58'),'id'])||{})['spread'](function(_0x50cf45){for(var _0xb8c2f5=0x0;_0xb8c2f5<_0x1ddaee[_0xdeeb('0x3a')][_0xdeeb('0x58')][_0xdeeb('0x46')];_0xb8c2f5+=0x1){socket[_0xdeeb('0x64')](_0xdeeb('0x65'),{'UserId':Number(_0x1ddaee['body'][_0xdeeb('0x58')][_0xb8c2f5]),'MailQueueId':Number(_0x1ddaee[_0xdeeb('0x31')]['id'])});}return _0x50cf45;});}})['then'](respondWithResult(_0x1e6fff,null))['catch'](handleError(_0x1e6fff,null));};exports[_0xdeeb('0x78')]=function(_0x5dac4a,_0x3f5eed){return db['MailQueue'][_0xdeeb('0x3e')]({'where':{'id':_0x5dac4a[_0xdeeb('0x31')]['id']}})[_0xdeeb('0x1a')](handleEntityNotFound(_0x3f5eed,null))[_0xdeeb('0x1a')](function(_0xecc48d){if(_0xecc48d){return _0xecc48d[_0xdeeb('0x78')](_0x5dac4a[_0xdeeb('0x2d')]['ids'])[_0xdeeb('0x1a')](function(){if(_[_0xdeeb('0x7c')](_0x5dac4a['query'][_0xdeeb('0x58')])){for(var _0x584012=0x0;_0x584012<_0x5dac4a['query'][_0xdeeb('0x58')]['length'];_0x584012+=0x1){socket['emit'](_0xdeeb('0x79'),{'UserId':Number(_0x5dac4a['query'][_0xdeeb('0x58')][_0x584012]),'MailQueueId':Number(_0x5dac4a[_0xdeeb('0x31')]['id'])});}}else{socket[_0xdeeb('0x64')](_0xdeeb('0x79'),{'UserId':Number(_0x5dac4a['query'][_0xdeeb('0x58')]),'MailQueueId':Number(_0x5dac4a[_0xdeeb('0x31')]['id'])});}});}})[_0xdeeb('0x1a')](respondWithStatusCode(_0x3f5eed,null))[_0xdeeb('0x2f')](handleError(_0x3f5eed,null));};exports['getAgents']=function(_0x45f328,_0x16abb1){var _0x5a40a8={};var _0x270e6e={};var _0x127faa;var _0x33ad66;return db[_0xdeeb('0x25')][_0xdeeb('0x44')]({'where':{'id':_0x45f328[_0xdeeb('0x31')]['id']}})['then'](handleEntityNotFound(_0x16abb1,null))[_0xdeeb('0x1a')](function(_0x3c030b){if(_0x3c030b){_0x127faa=_0x3c030b;_0x270e6e[_0xdeeb('0x32')]=_[_0xdeeb('0x33')](db[_0xdeeb('0x5a')][_0xdeeb('0x26')]);_0x270e6e[_0xdeeb('0x2d')]=_[_0xdeeb('0x33')](_0x45f328['query']);_0x270e6e[_0xdeeb('0x34')]=_[_0xdeeb('0x35')](_0x270e6e[_0xdeeb('0x32')],_0x270e6e[_0xdeeb('0x2d')]);_0x5a40a8[_0xdeeb('0x36')]=_['intersection'](_0x270e6e[_0xdeeb('0x32')],qs['fields'](_0x45f328['query']['fields']));_0x5a40a8[_0xdeeb('0x36')]=_0x5a40a8[_0xdeeb('0x36')][_0xdeeb('0x46')]?_0x5a40a8[_0xdeeb('0x36')]:_0x270e6e[_0xdeeb('0x32')];_0x5a40a8[_0xdeeb('0x49')]=qs[_0xdeeb('0x4a')](_0x45f328[_0xdeeb('0x2d')]['sort']);_0x5a40a8['where']=qs[_0xdeeb('0x34')](_['pick'](_0x45f328[_0xdeeb('0x2d')],_0x270e6e['filters']));if(_0x45f328['query'][_0xdeeb('0x4c')]){_0x5a40a8['where']=_[_0xdeeb('0x4d')](_0x5a40a8[_0xdeeb('0x2b')],{'$or':_[_0xdeeb('0x24')](_0x5a40a8['attributes'],function(_0x5e7139){var _0x10841c={};_0x10841c[_0x5e7139]={'$like':'%'+_0x45f328[_0xdeeb('0x2d')][_0xdeeb('0x4c')]+'%'};return _0x10841c;})});}_0x5a40a8=_['merge']({},_0x5a40a8,_0x45f328['options']);return _0x127faa['getAgents'](_0x5a40a8);}})[_0xdeeb('0x1a')](function(_0x2eba4e){if(_0x2eba4e){_0x33ad66=_0x2eba4e['length'];if(!_0x45f328[_0xdeeb('0x2d')]['hasOwnProperty'](_0xdeeb('0x48'))){_0x5a40a8[_0xdeeb('0x14')]=qs[_0xdeeb('0x14')](_0x45f328['query'][_0xdeeb('0x14')]);_0x5a40a8['offset']=qs['offset'](_0x45f328['query'][_0xdeeb('0x16')]);}return _0x127faa[_0xdeeb('0x7d')](_0x5a40a8);}})[_0xdeeb('0x1a')](function(_0x20bb45){if(_0x20bb45){return _0x20bb45?{'count':_0x33ad66,'rows':_0x20bb45}:null;}})[_0xdeeb('0x1a')](respondWithResult(_0x16abb1,null))['catch'](handleError(_0x16abb1,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 9a559d2..627418d 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 _0x3ab2=['hook','exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x484254,_0x69d9d7){var _0x28f6d8=function(_0x2d3d98){while(--_0x2d3d98){_0x484254['push'](_0x484254['shift']());}};_0x28f6d8(++_0x69d9d7);}(_0x3ab2,0xb6));var _0x23ab=function(_0xdbdb4f,_0x2d4d65){_0xdbdb4f=_0xdbdb4f-0x0;var _0x41c64b=_0x3ab2[_0xdbdb4f];return _0x41c64b;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x23ab('0x0'))['db'][_0x23ab('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x23ab('0x2')](0x0);var events={'afterCreate':_0x23ab('0x3'),'afterUpdate':_0x23ab('0x4'),'afterDestroy':_0x23ab('0x5')};function emitEvent(_0x8d80a1){return function(_0x49774c,_0x4831be,_0x40ef19){MailQueueEvents[_0x23ab('0x6')](_0x8d80a1+':'+_0x49774c['id'],_0x49774c);MailQueueEvents[_0x23ab('0x6')](_0x8d80a1,_0x49774c);_0x40ef19(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x23ab('0x7')](e,emitEvent(event));}}module[_0x23ab('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xfbb8=['hook','exports','events','../../mysqldb','MailQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x37aaaf,_0x2c50e5){var _0x2b53c8=function(_0x1a337a){while(--_0x1a337a){_0x37aaaf['push'](_0x37aaaf['shift']());}};_0x2b53c8(++_0x2c50e5);}(_0xfbb8,0x98));var _0x8fbb=function(_0x456904,_0x4cb25c){_0x456904=_0x456904-0x0;var _0x4b0063=_0xfbb8[_0x456904];return _0x4b0063;};'use strict';var EventEmitter=require(_0x8fbb('0x0'));var MailQueue=require(_0x8fbb('0x1'))['db'][_0x8fbb('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8fbb('0x3'),'afterUpdate':_0x8fbb('0x4'),'afterDestroy':_0x8fbb('0x5')};function emitEvent(_0x2de8e7){return function(_0x22f84f,_0x1e520e,_0x2ae7dd){MailQueueEvents[_0x8fbb('0x6')](_0x2de8e7+':'+_0x22f84f['id'],_0x22f84f);MailQueueEvents['emit'](_0x2de8e7,_0x22f84f);_0x2ae7dd(null);};}for(var e in events){if(events[_0x8fbb('0x7')](e)){var event=events[e];MailQueue[_0x8fbb('0x8')](e,emitEvent(event));}}module[_0x8fbb('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 5b72ade..6a10155 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 _0xb24d=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','MailQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x44fe61,_0x4f17c4){var _0x33ba90=function(_0x56a3c4){while(--_0x56a3c4){_0x44fe61['push'](_0x44fe61['shift']());}};_0x33ba90(++_0x4f17c4);}(_0xb24d,0x7f));var _0xdb24=function(_0x252de2,_0x27e622){_0x252de2=_0x252de2-0x0;var _0x51e55c=_0xb24d[_0x252de2];return _0x51e55c;};'use strict';var _=require(_0xdb24('0x0'));var util=require('util');var logger=require(_0xdb24('0x1'))(_0xdb24('0x2'));var moment=require(_0xdb24('0x3'));var BPromise=require(_0xdb24('0x4'));var rp=require(_0xdb24('0x5'));var fs=require('fs');var path=require(_0xdb24('0x6'));var rimraf=require(_0xdb24('0x7'));var config=require(_0xdb24('0x8'));var attributes=require(_0xdb24('0x9'));module['exports']=function(_0x3df485,_0x141bb2){return _0x3df485['define'](_0xdb24('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe523=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe523,0x1b6));var _0x3e52=function(_0x575827,_0x1380ba){_0x575827=_0x575827-0x0;var _0x21acfb=_0xe523[_0x575827];return _0x21acfb;};'use strict';var _=require(_0x3e52('0x0'));var util=require(_0x3e52('0x1'));var logger=require(_0x3e52('0x2'))(_0x3e52('0x3'));var moment=require(_0x3e52('0x4'));var BPromise=require(_0x3e52('0x5'));var rp=require(_0x3e52('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e52('0x7'));var config=require(_0x3e52('0x8'));var attributes=require('./mailQueue.attributes');module[_0x3e52('0x9')]=function(_0x174bc0,_0x70f012){return _0x174bc0[_0x3e52('0xa')](_0x3e52('0xb'),attributes,{'tableName':_0x3e52('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 1d0cd58..72d2823 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 _0x98d9=['findAll','options','raw','attributes','include','map','model','GetMailQueue','MailQueue','find','where','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x1830fc,_0x193e0d){var _0x310a6c=function(_0x157c99){while(--_0x157c99){_0x1830fc['push'](_0x1830fc['shift']());}};_0x310a6c(++_0x193e0d);}(_0x98d9,0x12b));var _0x998d=function(_0x467fef,_0x5daa29){_0x467fef=_0x467fef-0x0;var _0x2d8f76=_0x98d9[_0x467fef];return _0x2d8f76;};'use strict';var _=require(_0x998d('0x0'));var util=require(_0x998d('0x1'));var moment=require(_0x998d('0x2'));var BPromise=require(_0x998d('0x3'));var rs=require(_0x998d('0x4'));var fs=require('fs');var Redis=require(_0x998d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x998d('0x6'));var logger=require(_0x998d('0x7'))(_0x998d('0x8'));var config=require(_0x998d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x998d('0xa')][_0x998d('0xb')]({'port':0x232a});config['redis']=_[_0x998d('0xc')](config[_0x998d('0xd')],{'host':_0x998d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x998d('0xd')]));require(_0x998d('0xf'))[_0x998d('0x10')](socket);function respondWithRpcPromise(_0x4c37a4,_0x2b828e,_0x3ee301){return new BPromise(function(_0x5ae244,_0x8c88c2){return client[_0x998d('0x11')](_0x4c37a4,_0x3ee301)[_0x998d('0x12')](function(_0x4f04bc){logger[_0x998d('0x13')](_0x998d('0x14'),_0x2b828e,_0x998d('0x15'));logger[_0x998d('0x16')](_0x998d('0x17'),_0x2b828e,'request\x20sent',JSON[_0x998d('0x18')](_0x4f04bc));if(_0x4f04bc[_0x998d('0x19')]){if(_0x4f04bc[_0x998d('0x19')]['code']===0x1f4){logger[_0x998d('0x19')]('MailQueue,\x20%s,\x20%s',_0x2b828e,_0x4f04bc[_0x998d('0x19')][_0x998d('0x1a')]);return _0x8c88c2(_0x4f04bc['error']['message']);}logger[_0x998d('0x19')](_0x998d('0x14'),_0x2b828e,_0x4f04bc[_0x998d('0x19')][_0x998d('0x1a')]);return _0x5ae244(_0x4f04bc['error'][_0x998d('0x1a')]);}else{logger[_0x998d('0x13')]('MailQueue,\x20%s,\x20%s',_0x2b828e,'request\x20sent');_0x5ae244(_0x4f04bc[_0x998d('0x1b')][_0x998d('0x1a')]);}})[_0x998d('0x1c')](function(_0x52443e){logger[_0x998d('0x19')](_0x998d('0x14'),_0x2b828e,_0x52443e);_0x8c88c2(_0x52443e);});});}exports['GetMailQueue']=function(_0x46ec1d){var _0x4818cb=this;return new Promise(function(_0x3a6425,_0x39fc8e){return db['MailQueue'][_0x998d('0x1d')]({'raw':_0x46ec1d[_0x998d('0x1e')]?_0x46ec1d['options'][_0x998d('0x1f')]===undefined?!![]:![]:!![],'where':_0x46ec1d[_0x998d('0x1e')]?_0x46ec1d[_0x998d('0x1e')]['where']||null:null,'attributes':_0x46ec1d[_0x998d('0x1e')]?_0x46ec1d['options'][_0x998d('0x20')]||null:null,'limit':_0x46ec1d['options']?_0x46ec1d['options']['limit']||null:null,'include':_0x46ec1d[_0x998d('0x1e')]?_0x46ec1d[_0x998d('0x1e')][_0x998d('0x21')]?_[_0x998d('0x22')](_0x46ec1d[_0x998d('0x1e')][_0x998d('0x21')],function(_0x37b159){return{'model':db[_0x37b159[_0x998d('0x23')]],'as':_0x37b159['as'],'attributes':_0x37b159[_0x998d('0x20')],'include':_0x37b159['include']?_[_0x998d('0x22')](_0x37b159['include'],function(_0x590d11){return{'model':db[_0x590d11[_0x998d('0x23')]],'as':_0x590d11['as'],'attributes':_0x590d11[_0x998d('0x20')],'include':_0x590d11['include']?_[_0x998d('0x22')](_0x590d11[_0x998d('0x21')],function(_0xd6fdec){return{'model':db[_0xd6fdec[_0x998d('0x23')]],'as':_0xd6fdec['as'],'attributes':_0xd6fdec[_0x998d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x998d('0x12')](function(_0x278bae){logger[_0x998d('0x13')](_0x998d('0x24'),_0x46ec1d);logger['debug']('GetMailQueue',_0x46ec1d,JSON[_0x998d('0x18')](_0x278bae));_0x3a6425(_0x278bae);})['catch'](function(_0x1b444a){logger['error'](_0x998d('0x24'),_0x1b444a[_0x998d('0x1a')],_0x46ec1d);_0x39fc8e(_0x4818cb['error'](0x1f4,_0x1b444a[_0x998d('0x1a')]));});});};exports['ShowMailQueue']=function(_0x2cb798){var _0x482707=this;return new Promise(function(_0x572458,_0x30151f){return db[_0x998d('0x25')][_0x998d('0x26')]({'raw':_0x2cb798[_0x998d('0x1e')]?_0x2cb798['options'][_0x998d('0x1f')]===undefined?!![]:![]:!![],'where':_0x2cb798['options']?_0x2cb798[_0x998d('0x1e')][_0x998d('0x27')]||null:null,'attributes':_0x2cb798[_0x998d('0x1e')]?_0x2cb798[_0x998d('0x1e')][_0x998d('0x20')]||null:null,'include':_0x2cb798[_0x998d('0x1e')]?_0x2cb798[_0x998d('0x1e')][_0x998d('0x21')]?_[_0x998d('0x22')](_0x2cb798['options']['include'],function(_0x3c0670){return{'model':db[_0x3c0670[_0x998d('0x23')]],'as':_0x3c0670['as'],'attributes':_0x3c0670['attributes'],'include':_0x3c0670[_0x998d('0x21')]?_[_0x998d('0x22')](_0x3c0670[_0x998d('0x21')],function(_0x14789b){return{'model':db[_0x14789b[_0x998d('0x23')]],'as':_0x14789b['as'],'attributes':_0x14789b[_0x998d('0x20')],'include':_0x14789b[_0x998d('0x21')]?_[_0x998d('0x22')](_0x14789b[_0x998d('0x21')],function(_0xe9f933){return{'model':db[_0xe9f933[_0x998d('0x23')]],'as':_0xe9f933['as'],'attributes':_0xe9f933[_0x998d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x998d('0x12')](function(_0x5761f1){logger['info'](_0x998d('0x28'),_0x2cb798);logger[_0x998d('0x16')]('ShowMailQueue',_0x2cb798,JSON[_0x998d('0x18')](_0x5761f1));_0x572458(_0x5761f1);})[_0x998d('0x1c')](function(_0x47b2ac){logger[_0x998d('0x19')]('ShowMailQueue',_0x47b2ac['message'],_0x2cb798);_0x30151f(_0x482707['error'](0x1f4,_0x47b2ac['message']));});});}; \ No newline at end of file +var _0x280f=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','include','map','model','ShowMailQueue','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x94b853,_0x28399b){var _0x17a9c0=function(_0x5ba347){while(--_0x5ba347){_0x94b853['push'](_0x94b853['shift']());}};_0x17a9c0(++_0x28399b);}(_0x280f,0xe2));var _0xf280=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x280f[_0x20589d];return _0x422de9;};'use strict';var _=require(_0xf280('0x0'));var util=require('util');var moment=require(_0xf280('0x1'));var BPromise=require(_0xf280('0x2'));var rs=require(_0xf280('0x3'));var fs=require('fs');var Redis=require(_0xf280('0x4'));var db=require(_0xf280('0x5'))['db'];var utils=require(_0xf280('0x6'));var logger=require(_0xf280('0x7'))('rpc');var config=require(_0xf280('0x8'));var jayson=require(_0xf280('0x9'));var client=jayson[_0xf280('0xa')][_0xf280('0xb')]({'port':0x232a});config[_0xf280('0xc')]=_['defaults'](config[_0xf280('0xc')],{'host':_0xf280('0xd'),'port':0x18eb});var socket=require(_0xf280('0xe'))(new Redis(config[_0xf280('0xc')]));require(_0xf280('0xf'))[_0xf280('0x10')](socket);function respondWithRpcPromise(_0x5360c3,_0x2447c6,_0x3d13c5){return new BPromise(function(_0x1f580a,_0x3e58af){return client[_0xf280('0x11')](_0x5360c3,_0x3d13c5)[_0xf280('0x12')](function(_0x10ccbe){logger[_0xf280('0x13')](_0xf280('0x14'),_0x2447c6,_0xf280('0x15'));logger[_0xf280('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x2447c6,_0xf280('0x15'),JSON[_0xf280('0x17')](_0x10ccbe));if(_0x10ccbe[_0xf280('0x18')]){if(_0x10ccbe[_0xf280('0x18')][_0xf280('0x19')]===0x1f4){logger[_0xf280('0x18')]('MailQueue,\x20%s,\x20%s',_0x2447c6,_0x10ccbe[_0xf280('0x18')][_0xf280('0x1a')]);return _0x3e58af(_0x10ccbe[_0xf280('0x18')][_0xf280('0x1a')]);}logger[_0xf280('0x18')](_0xf280('0x14'),_0x2447c6,_0x10ccbe[_0xf280('0x18')]['message']);return _0x1f580a(_0x10ccbe['error']['message']);}else{logger[_0xf280('0x13')]('MailQueue,\x20%s,\x20%s',_0x2447c6,_0xf280('0x15'));_0x1f580a(_0x10ccbe['result'][_0xf280('0x1a')]);}})[_0xf280('0x1b')](function(_0x5328ae){logger[_0xf280('0x18')]('MailQueue,\x20%s,\x20%s',_0x2447c6,_0x5328ae);_0x3e58af(_0x5328ae);});});}exports[_0xf280('0x1c')]=function(_0x26c705){var _0x114364=this;return new Promise(function(_0x21e99b,_0x11db7d){return db[_0xf280('0x1d')][_0xf280('0x1e')]({'raw':_0x26c705[_0xf280('0x1f')]?_0x26c705[_0xf280('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x26c705[_0xf280('0x1f')]?_0x26c705[_0xf280('0x1f')][_0xf280('0x20')]||null:null,'attributes':_0x26c705[_0xf280('0x1f')]?_0x26c705[_0xf280('0x1f')][_0xf280('0x21')]||null:null,'limit':_0x26c705[_0xf280('0x1f')]?_0x26c705[_0xf280('0x1f')]['limit']||null:null,'include':_0x26c705[_0xf280('0x1f')]?_0x26c705[_0xf280('0x1f')][_0xf280('0x22')]?_[_0xf280('0x23')](_0x26c705[_0xf280('0x1f')][_0xf280('0x22')],function(_0x4509c1){return{'model':db[_0x4509c1[_0xf280('0x24')]],'as':_0x4509c1['as'],'attributes':_0x4509c1['attributes'],'include':_0x4509c1[_0xf280('0x22')]?_[_0xf280('0x23')](_0x4509c1[_0xf280('0x22')],function(_0xf9ac1c){return{'model':db[_0xf9ac1c['model']],'as':_0xf9ac1c['as'],'attributes':_0xf9ac1c['attributes'],'include':_0xf9ac1c['include']?_['map'](_0xf9ac1c['include'],function(_0x3da40e){return{'model':db[_0x3da40e[_0xf280('0x24')]],'as':_0x3da40e['as'],'attributes':_0x3da40e[_0xf280('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf280('0x12')](function(_0x545ccf){logger[_0xf280('0x13')]('GetMailQueue',_0x26c705);logger[_0xf280('0x16')](_0xf280('0x1c'),_0x26c705,JSON['stringify'](_0x545ccf));_0x21e99b(_0x545ccf);})[_0xf280('0x1b')](function(_0x7bbbd){logger[_0xf280('0x18')](_0xf280('0x1c'),_0x7bbbd['message'],_0x26c705);_0x11db7d(_0x114364[_0xf280('0x18')](0x1f4,_0x7bbbd[_0xf280('0x1a')]));});});};exports[_0xf280('0x25')]=function(_0x20aee4){var _0x9e9dc2=this;return new Promise(function(_0xa6e2ca,_0x45a2cf){return db[_0xf280('0x1d')]['find']({'raw':_0x20aee4[_0xf280('0x1f')]?_0x20aee4[_0xf280('0x1f')][_0xf280('0x26')]===undefined?!![]:![]:!![],'where':_0x20aee4[_0xf280('0x1f')]?_0x20aee4['options']['where']||null:null,'attributes':_0x20aee4[_0xf280('0x1f')]?_0x20aee4['options'][_0xf280('0x21')]||null:null,'include':_0x20aee4[_0xf280('0x1f')]?_0x20aee4[_0xf280('0x1f')][_0xf280('0x22')]?_[_0xf280('0x23')](_0x20aee4['options']['include'],function(_0x5c34a3){return{'model':db[_0x5c34a3[_0xf280('0x24')]],'as':_0x5c34a3['as'],'attributes':_0x5c34a3['attributes'],'include':_0x5c34a3[_0xf280('0x22')]?_[_0xf280('0x23')](_0x5c34a3['include'],function(_0x36a914){return{'model':db[_0x36a914[_0xf280('0x24')]],'as':_0x36a914['as'],'attributes':_0x36a914[_0xf280('0x21')],'include':_0x36a914[_0xf280('0x22')]?_[_0xf280('0x23')](_0x36a914[_0xf280('0x22')],function(_0x286b48){return{'model':db[_0x286b48[_0xf280('0x24')]],'as':_0x286b48['as'],'attributes':_0x286b48[_0xf280('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf280('0x12')](function(_0x4ddd4a){logger[_0xf280('0x13')](_0xf280('0x25'),_0x20aee4);logger[_0xf280('0x16')](_0xf280('0x25'),_0x20aee4,JSON[_0xf280('0x17')](_0x4ddd4a));_0xa6e2ca(_0x4ddd4a);})['catch'](function(_0x1c85b4){logger[_0xf280('0x18')]('ShowMailQueue',_0x1c85b4[_0xf280('0x1a')],_0x20aee4);_0x45a2cf(_0x9e9dc2[_0xf280('0x18')](0x1f4,_0x1c85b4[_0xf280('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 11d8646..4037f41 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 _0x8dae=['remove','update','emit','register','length','./mailQueue.events'];(function(_0x2f7892,_0x1c26c5){var _0x2f9e9c=function(_0x2755ba){while(--_0x2755ba){_0x2f7892['push'](_0x2f7892['shift']());}};_0x2f9e9c(++_0x1c26c5);}(_0x8dae,0xa7));var _0xe8da=function(_0x1c97b0,_0x3ea73e){_0x1c97b0=_0x1c97b0-0x0;var _0x396fb0=_0x8dae[_0x1c97b0];return _0x396fb0;};'use strict';var MailQueueEvents=require(_0xe8da('0x0'));var events=['save',_0xe8da('0x1'),_0xe8da('0x2')];function createListener(_0x241164,_0x5dcfdf){return function(_0x49bba9){_0x5dcfdf[_0xe8da('0x3')](_0x241164,_0x49bba9);};}function removeListener(_0x3feb44,_0x2b9705){return function(){MailQueueEvents['removeListener'](_0x3feb44,_0x2b9705);};}exports[_0xe8da('0x4')]=function(_0x373844){for(var _0x20e7ef=0x0,_0x12d640=events[_0xe8da('0x5')];_0x20e7ef<_0x12d640;_0x20e7ef++){var _0x4604d0=events[_0x20e7ef];var _0x116061=createListener('mailQueue:'+_0x4604d0,_0x373844);MailQueueEvents['on'](_0x4604d0,_0x116061);}}; \ No newline at end of file +var _0x165b=['emit','length','mailQueue:','./mailQueue.events','save'];(function(_0x555459,_0x298b1a){var _0x570a6f=function(_0x2b57ba){while(--_0x2b57ba){_0x555459['push'](_0x555459['shift']());}};_0x570a6f(++_0x298b1a);}(_0x165b,0x1ed));var _0xb165=function(_0x2d9f40,_0x5e9be4){_0x2d9f40=_0x2d9f40-0x0;var _0x2d7561=_0x165b[_0x2d9f40];return _0x2d7561;};'use strict';var MailQueueEvents=require(_0xb165('0x0'));var events=[_0xb165('0x1'),'remove','update'];function createListener(_0x2e4b66,_0x2dc349){return function(_0x862f00){_0x2dc349[_0xb165('0x2')](_0x2e4b66,_0x862f00);};}function removeListener(_0x3b680f,_0x1defa7){return function(){MailQueueEvents['removeListener'](_0x3b680f,_0x1defa7);};}exports['register']=function(_0x415ebd){for(var _0x214b99=0x0,_0x15b638=events[_0xb165('0x3')];_0x214b99<_0x15b638;_0x214b99++){var _0x4a59e9=events[_0x214b99];var _0x4173f6=createListener(_0xb165('0x4')+_0x4a59e9,_0x415ebd);MailQueueEvents['on'](_0x4a59e9,_0x4173f6);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 47f5cf2..deb07bb 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 _0x123e=['../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','/:id','show','create','update','delete','destroy','util','connect-timeout','express','Router'];(function(_0x4e82a1,_0x114f19){var _0x208d96=function(_0x577d7a){while(--_0x577d7a){_0x4e82a1['push'](_0x4e82a1['shift']());}};_0x208d96(++_0x114f19);}(_0x123e,0x10a));var _0xe123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x123e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe123('0x0'));var path=require('path');var timeout=require(_0xe123('0x1'));var express=require(_0xe123('0x2'));var router=express[_0xe123('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe123('0x4'));var config=require(_0xe123('0x5'));var controller=require('./mailQueueReport.controller');router[_0xe123('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe123('0x6')](_0xe123('0x7'),auth[_0xe123('0x8')](),controller['describe']);router['get'](_0xe123('0x9'),auth[_0xe123('0x8')](),controller[_0xe123('0xa')]);router['post']('/',auth[_0xe123('0x8')](),controller[_0xe123('0xb')]);router['put'](_0xe123('0x9'),auth['isAuthenticated'](),controller[_0xe123('0xc')]);router[_0xe123('0xd')](_0xe123('0x9'),auth[_0xe123('0x8')](),controller[_0xe123('0xe')]);module['exports']=router; \ No newline at end of file +var _0x2606=['../../config/environment','get','isAuthenticated','index','describe','/:id','post','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x39f023,_0x40eb0b){var _0x56e418=function(_0x221aaf){while(--_0x221aaf){_0x39f023['push'](_0x39f023['shift']());}};_0x56e418(++_0x40eb0b);}(_0x2606,0x14c));var _0x6260=function(_0x28cda9,_0x52e9d1){_0x28cda9=_0x28cda9-0x0;var _0x5019fb=_0x2606[_0x28cda9];return _0x5019fb;};'use strict';var multer=require(_0x6260('0x0'));var util=require(_0x6260('0x1'));var path=require(_0x6260('0x2'));var timeout=require(_0x6260('0x3'));var express=require(_0x6260('0x4'));var router=express['Router']();var fs_extra=require(_0x6260('0x5'));var auth=require(_0x6260('0x6'));var interaction=require(_0x6260('0x7'));var config=require(_0x6260('0x8'));var controller=require('./mailQueueReport.controller');router[_0x6260('0x9')]('/',auth[_0x6260('0xa')](),controller[_0x6260('0xb')]);router[_0x6260('0x9')]('/describe',auth[_0x6260('0xa')](),controller[_0x6260('0xc')]);router['get'](_0x6260('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x6260('0xe')]('/',auth[_0x6260('0xa')](),controller['create']);router['put'](_0x6260('0xd'),auth['isAuthenticated'](),controller[_0x6260('0xf')]);router['delete'](_0x6260('0xd'),auth[_0x6260('0xa')](),controller['destroy']);module[_0x6260('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 2230cc0..7f4a318 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 _0x4507=['DATE','moment','sequelize','exports','STRING'];(function(_0x12abbf,_0x318121){var _0x425c75=function(_0xb28d5e){while(--_0xb28d5e){_0x12abbf['push'](_0x12abbf['shift']());}};_0x425c75(++_0x318121);}(_0x4507,0x15a));var _0x7450=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4507[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0x7450('0x0'));var Sequelize=require(_0x7450('0x1'));module[_0x7450('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x7450('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7450('0x4')]},'exitAt':{'type':Sequelize[_0x7450('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xed3a=['moment','sequelize','exports','STRING','DATE'];(function(_0x12af37,_0x9033bd){var _0x28a1dd=function(_0xec61ca){while(--_0xec61ca){_0x12af37['push'](_0x12af37['shift']());}};_0x28a1dd(++_0x9033bd);}(_0xed3a,0x1ef));var _0xaed3=function(_0x3f91cf,_0x5483ca){_0x3f91cf=_0x3f91cf-0x0;var _0x53bdd5=_0xed3a[_0x3f91cf];return _0x53bdd5;};'use strict';var moment=require(_0xaed3('0x0'));var Sequelize=require(_0xaed3('0x1'));module[_0xaed3('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaed3('0x3')]},'joinAt':{'type':Sequelize[_0xaed3('0x4')]},'leaveAt':{'type':Sequelize[_0xaed3('0x4')]},'acceptAt':{'type':Sequelize[_0xaed3('0x4')]},'exitAt':{'type':Sequelize[_0xaed3('0x4')]},'reason':{'type':Sequelize[_0xaed3('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b3e99aa..5a6e3da 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 _0x2da6=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','intersection','find','catch','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox'];(function(_0x32b6c6,_0x547dc9){var _0x2e9117=function(_0x4b56ab){while(--_0x4b56ab){_0x32b6c6['push'](_0x32b6c6['shift']());}};_0x2e9117(++_0x547dc9);}(_0x2da6,0x1dd));var _0x62da=function(_0x2471f2,_0x2afaa7){_0x2471f2=_0x2471f2-0x0;var _0x7d933a=_0x2da6[_0x2471f2];return _0x7d933a;};'use strict';var emlformat=require(_0x62da('0x0'));var rimraf=require(_0x62da('0x1'));var zipdir=require(_0x62da('0x2'));var jsonpatch=require(_0x62da('0x3'));var rp=require(_0x62da('0x4'));var moment=require(_0x62da('0x5'));var BPromise=require(_0x62da('0x6'));var Mustache=require(_0x62da('0x7'));var util=require('util');var path=require('path');var sox=require(_0x62da('0x8'));var csv=require(_0x62da('0x9'));var ejs=require(_0x62da('0xa'));var fs=require('fs');var fs_extra=require(_0x62da('0xb'));var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x62da('0x1a'));var db=require(_0x62da('0x1b'))['db'];function respondWithStatusCode(_0xd27693,_0x362eeb){_0x362eeb=_0x362eeb||0xcc;return function(_0x37ba2e){if(_0x37ba2e){return _0xd27693['sendStatus'](_0x362eeb);}return _0xd27693['status'](_0x362eeb)[_0x62da('0x1c')]();};}function respondWithResult(_0x27a000,_0x1bd7f9){_0x1bd7f9=_0x1bd7f9||0xc8;return function(_0x191ed5){if(_0x191ed5){return _0x27a000[_0x62da('0x1d')](_0x1bd7f9)[_0x62da('0x1e')](_0x191ed5);}};}function respondWithFilteredResult(_0x3c6498,_0x624a1c){return function(_0x2cbdf6){if(_0x2cbdf6){var _0xcc1a25=typeof _0x624a1c[_0x62da('0x1f')]===_0x62da('0x20')&&typeof _0x624a1c[_0x62da('0x21')]===_0x62da('0x20');var _0x4bdab9=_0x2cbdf6['count'];var _0xa7050b=_0xcc1a25?0x0:_0x624a1c['offset'];var _0x4d6482=_0xcc1a25?_0x2cbdf6[_0x62da('0x22')]:_0x624a1c[_0x62da('0x1f')]+_0x624a1c['limit'];var _0x29191b;if(_0x4d6482>=_0x4bdab9){_0x4d6482=_0x4bdab9;_0x29191b=0xc8;}else{_0x29191b=0xce;}_0x3c6498['status'](_0x29191b);return _0x3c6498[_0x62da('0x23')](_0x62da('0x24'),_0xa7050b+'-'+_0x4d6482+'/'+_0x4bdab9)[_0x62da('0x1e')](_0x2cbdf6);}return null;};}function patchUpdates(_0x2f7b01){return function(_0x3d015f){try{jsonpatch[_0x62da('0x25')](_0x3d015f,_0x2f7b01,!![]);}catch(_0x183033){return BPromise[_0x62da('0x26')](_0x183033);}return _0x3d015f[_0x62da('0x27')]();};}function saveUpdates(_0x583fc0,_0x13bf6d){return function(_0x866a76){if(_0x866a76){return _0x866a76[_0x62da('0x28')](_0x583fc0)[_0x62da('0x29')](function(_0x35f687){return _0x35f687;});}return null;};}function removeEntity(_0x54b936,_0x24298a){return function(_0x50ed6b){if(_0x50ed6b){return _0x50ed6b['destroy']()['then'](function(){_0x54b936[_0x62da('0x1d')](0xcc)[_0x62da('0x1c')]();});}};}function handleEntityNotFound(_0x14897c,_0x3f6fc9){return function(_0x4b1237){if(!_0x4b1237){_0x14897c[_0x62da('0x2a')](0x194);}return _0x4b1237;};}function handleError(_0x3b9c06,_0x5f0a9c){_0x5f0a9c=_0x5f0a9c||0x1f4;return function(_0x3ccf96){logger[_0x62da('0x2b')](_0x3ccf96[_0x62da('0x2c')]);if(_0x3ccf96['name']){delete _0x3ccf96[_0x62da('0x2d')];}_0x3b9c06[_0x62da('0x1d')](_0x5f0a9c)[_0x62da('0x2e')](_0x3ccf96);};}exports['index']=function(_0x4f5657,_0x3c6274){var _0x301e3d={},_0x220ffc={},_0x594c5a={'count':0x0,'rows':[]};var _0x45f67a=_[_0x62da('0x2f')](db[_0x62da('0x30')][_0x62da('0x31')],function(_0xd8cf3b){return{'name':_0xd8cf3b[_0x62da('0x32')],'type':_0xd8cf3b['type'][_0x62da('0x33')]};});_0x220ffc['model']=_[_0x62da('0x2f')](_0x45f67a,_0x62da('0x2d'));_0x220ffc[_0x62da('0x34')]=_[_0x62da('0x35')](_0x4f5657[_0x62da('0x34')]);_0x220ffc[_0x62da('0x36')]=_['intersection'](_0x220ffc[_0x62da('0x37')],_0x220ffc[_0x62da('0x34')]);_0x301e3d[_0x62da('0x38')]=_['intersection'](_0x220ffc[_0x62da('0x37')],qs[_0x62da('0x39')](_0x4f5657[_0x62da('0x34')]['fields']));_0x301e3d[_0x62da('0x38')]=_0x301e3d[_0x62da('0x38')]['length']?_0x301e3d[_0x62da('0x38')]:_0x220ffc[_0x62da('0x37')];if(!_0x4f5657['query'][_0x62da('0x3a')](_0x62da('0x3b'))){_0x301e3d[_0x62da('0x21')]=qs[_0x62da('0x21')](_0x4f5657[_0x62da('0x34')][_0x62da('0x21')]);_0x301e3d[_0x62da('0x1f')]=qs[_0x62da('0x1f')](_0x4f5657[_0x62da('0x34')][_0x62da('0x1f')]);}_0x301e3d[_0x62da('0x3c')]=qs[_0x62da('0x3d')](_0x4f5657[_0x62da('0x34')][_0x62da('0x3d')]);_0x301e3d[_0x62da('0x3e')]=qs[_0x62da('0x36')](_[_0x62da('0x3f')](_0x4f5657['query'],_0x220ffc[_0x62da('0x36')]),_0x45f67a);if(_0x4f5657['query'][_0x62da('0x40')]){_0x301e3d[_0x62da('0x3e')]=_[_0x62da('0x41')](_0x301e3d['where'],{'$or':_[_0x62da('0x2f')](_0x45f67a,function(_0xecf52d){if(_0xecf52d[_0x62da('0x42')]!==_0x62da('0x43')){var _0x5093c1={};_0x5093c1[_0xecf52d[_0x62da('0x2d')]]={'$like':'%'+_0x4f5657[_0x62da('0x34')][_0x62da('0x40')]+'%'};return _0x5093c1;}})});}_0x301e3d=_[_0x62da('0x41')]({},_0x301e3d,_0x4f5657[_0x62da('0x44')]);var _0x203815={'where':_0x301e3d[_0x62da('0x3e')]};return db[_0x62da('0x30')][_0x62da('0x22')](_0x203815)['then'](function(_0x29d2c2){_0x594c5a[_0x62da('0x22')]=_0x29d2c2;if(_0x4f5657['query'][_0x62da('0x45')]){_0x301e3d[_0x62da('0x46')]=[{'all':!![]}];}return db[_0x62da('0x30')][_0x62da('0x47')](_0x301e3d);})[_0x62da('0x29')](function(_0xde827d){_0x594c5a[_0x62da('0x48')]=_0xde827d;return _0x594c5a;})[_0x62da('0x29')](respondWithFilteredResult(_0x3c6274,_0x301e3d))['catch'](handleError(_0x3c6274,null));};exports['show']=function(_0x4bd1b8,_0x40d0af){var _0x54b49c={'raw':!![],'where':{'id':_0x4bd1b8['params']['id']}},_0x86f5a8={};_0x86f5a8['model']=_['keys'](db[_0x62da('0x30')][_0x62da('0x31')]);_0x86f5a8['query']=_[_0x62da('0x35')](_0x4bd1b8['query']);_0x86f5a8[_0x62da('0x36')]=_['intersection'](_0x86f5a8['model'],_0x86f5a8[_0x62da('0x34')]);_0x54b49c[_0x62da('0x38')]=_[_0x62da('0x49')](_0x86f5a8['model'],qs[_0x62da('0x39')](_0x4bd1b8[_0x62da('0x34')][_0x62da('0x39')]));_0x54b49c[_0x62da('0x38')]=_0x54b49c[_0x62da('0x38')]['length']?_0x54b49c['attributes']:_0x86f5a8[_0x62da('0x37')];if(_0x4bd1b8[_0x62da('0x34')][_0x62da('0x45')]){_0x54b49c[_0x62da('0x46')]=[{'all':!![]}];}_0x54b49c=_[_0x62da('0x41')]({},_0x54b49c,_0x4bd1b8['options']);return db['MailQueueReport'][_0x62da('0x4a')](_0x54b49c)[_0x62da('0x29')](handleEntityNotFound(_0x40d0af,null))['then'](respondWithResult(_0x40d0af,null))[_0x62da('0x4b')](handleError(_0x40d0af,null));};exports[_0x62da('0x4c')]=function(_0x454cc0,_0x29153f){return db[_0x62da('0x30')]['create'](_0x454cc0[_0x62da('0x4d')],{})[_0x62da('0x29')](respondWithResult(_0x29153f,0xc9))[_0x62da('0x4b')](handleError(_0x29153f,null));};exports[_0x62da('0x28')]=function(_0x4d3ec0,_0x1f2ab5){if(_0x4d3ec0[_0x62da('0x4d')]['id']){delete _0x4d3ec0[_0x62da('0x4d')]['id'];}return db[_0x62da('0x30')]['find']({'where':{'id':_0x4d3ec0[_0x62da('0x4e')]['id']}})[_0x62da('0x29')](handleEntityNotFound(_0x1f2ab5,null))['then'](saveUpdates(_0x4d3ec0['body'],null))['then'](respondWithResult(_0x1f2ab5,null))[_0x62da('0x4b')](handleError(_0x1f2ab5,null));};exports[_0x62da('0x4f')]=function(_0x33fbfc,_0x5cd1a9){return db[_0x62da('0x30')][_0x62da('0x4a')]({'where':{'id':_0x33fbfc[_0x62da('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5cd1a9,null))[_0x62da('0x29')](removeEntity(_0x5cd1a9,null))[_0x62da('0x4b')](handleError(_0x5cd1a9,null));};exports[_0x62da('0x50')]=function(_0x420697,_0x4bb439){return db[_0x62da('0x30')][_0x62da('0x50')]()[_0x62da('0x29')](respondWithResult(_0x4bb439,null))[_0x62da('0x4b')](handleError(_0x4bb439,null));}; \ No newline at end of file +var _0x430c=['status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x430c,0x1a1));var _0xc430=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x430c[_0x454e6d];return _0x4bc294;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['create']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')](_0x10db27[_0xc430('0x45')],{})['then'](respondWithResult(_0x4eafae,0xc9))[_0xc430('0x40')](handleError(_0x4eafae,null));};exports[_0xc430('0x46')]=function(_0x19e563,_0x549400){if(_0x19e563[_0xc430('0x45')]['id']){delete _0x19e563[_0xc430('0x45')]['id'];}return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x19e563[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x549400,null))[_0xc430('0x1e')](saveUpdates(_0x19e563['body'],null))[_0xc430('0x1e')](respondWithResult(_0x549400,null))[_0xc430('0x40')](handleError(_0x549400,null));};exports[_0xc430('0x1f')]=function(_0x4e9aff,_0x23cb41){return db[_0xc430('0x25')][_0xc430('0x47')]({'where':{'id':_0x4e9aff[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x23cb41,null))[_0xc430('0x1e')](removeEntity(_0x23cb41,null))['catch'](handleError(_0x23cb41,null));};exports[_0xc430('0x48')]=function(_0x214954,_0x2a5143){return db[_0xc430('0x25')][_0xc430('0x48')]()[_0xc430('0x1e')](respondWithResult(_0x2a5143,null))['catch'](handleError(_0x2a5143,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 7655bb0..101d885 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 _0xfe73=['api','request-promise','path','./mailQueueReport.attributes','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xfe73,0x12f));var _0x3fe7=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xfe73[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var logger=require(_0x3fe7('0x2'))(_0x3fe7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3fe7('0x4'));var fs=require('fs');var path=require(_0x3fe7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3fe7('0x6'));module['exports']=function(_0x5be0d9,_0x528e3a){return _0x5be0d9['define'](_0x3fe7('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x3fe7('0x8'),'fields':[_0x3fe7('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2481=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','report_mail_queue'];(function(_0x40b66c,_0x578758){var _0x2fd22b=function(_0x3b721b){while(--_0x3b721b){_0x40b66c['push'](_0x40b66c['shift']());}};_0x2fd22b(++_0x578758);}(_0x2481,0x119));var _0x1248=function(_0x1a2b84,_0x58b89f){_0x1a2b84=_0x1a2b84-0x0;var _0x278524=_0x2481[_0x1a2b84];return _0x278524;};'use strict';var _=require(_0x1248('0x0'));var util=require(_0x1248('0x1'));var logger=require(_0x1248('0x2'))(_0x1248('0x3'));var moment=require(_0x1248('0x4'));var BPromise=require(_0x1248('0x5'));var rp=require(_0x1248('0x6'));var fs=require('fs');var path=require(_0x1248('0x7'));var rimraf=require('rimraf');var config=require(_0x1248('0x8'));var attributes=require(_0x1248('0x9'));module[_0x1248('0xa')]=function(_0x4edbf6,_0x453dd3){return _0x4edbf6[_0x1248('0xb')]('MailQueueReport',attributes,{'tableName':_0x1248('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1248('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index e052269..48b9df0 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 _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x96d27c,_0x71e2de){var _0x23d60b=function(_0x1f8730){while(--_0x1f8730){_0x96d27c['push'](_0x96d27c['shift']());}};_0x23d60b(++_0x71e2de);}(_0x326f,0xd1));var _0xf326=function(_0x481422,_0x46be57){_0x481422=_0x481422-0x0;var _0x18616e=_0x326f[_0x481422];return _0x18616e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x16a496,_0x2380e2){var _0x5d2c35=function(_0x26fd43){while(--_0x26fd43){_0x16a496['push'](_0x16a496['shift']());}};_0x5d2c35(++_0x2380e2);}(_0x2ef3,0xba));var _0x32ef=function(_0x2d4848,_0x28058e){_0x2d4848=_0x2d4848-0x0;var _0x3a14a4=_0x2ef3[_0x2d4848];return _0x3a14a4;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 597aaf0..f37ec10 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2b4776,_0x4045af){var _0x3b7904=function(_0x287cf4){while(--_0x287cf4){_0x2b4776['push'](_0x2b4776['shift']());}};_0x3b7904(++_0x4045af);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x31db21,_0x78c1d7){var _0x3360c4=function(_0x16adda){while(--_0x16adda){_0x31db21['push'](_0x31db21['shift']());}};_0x3360c4(++_0x78c1d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c34c6d8..8659a20 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 _0x2313=['INBOX','sequelize','exports','BOOLEAN','STRING','INTEGER'];(function(_0x47b41f,_0x20cdc5){var _0x50e1d7=function(_0x365d82){while(--_0x365d82){_0x47b41f['push'](_0x47b41f['shift']());}};_0x50e1d7(++_0x20cdc5);}(_0x2313,0x145));var _0x3231=function(_0x8461ca,_0x59f912){_0x8461ca=_0x8461ca-0x0;var _0x502095=_0x2313[_0x8461ca];return _0x502095;};'use strict';var Sequelize=require(_0x3231('0x0'));module[_0x3231('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3231('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x3231('0x3')]},'port':{'type':Sequelize[_0x3231('0x4')]},'tls':{'type':Sequelize[_0x3231('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3231('0x3')],'defaultValue':_0x3231('0x5')},'connTimeout':{'type':Sequelize[_0x3231('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3231('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x3231('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x1a86=['exports','STRING','INTEGER','INBOX','BOOLEAN','sequelize'];(function(_0x1f28ba,_0x558f8b){var _0x9af2c4=function(_0x40f638){while(--_0x40f638){_0x1f28ba['push'](_0x1f28ba['shift']());}};_0x9af2c4(++_0x558f8b);}(_0x1a86,0x7d));var _0x61a8=function(_0x2664a1,_0x309f75){_0x2664a1=_0x2664a1-0x0;var _0x59ebb8=_0x1a86[_0x2664a1];return _0x59ebb8;};'use strict';var Sequelize=require(_0x61a8('0x0'));module[_0x61a8('0x1')]={'description':{'type':Sequelize[_0x61a8('0x2')]},'host':{'type':Sequelize[_0x61a8('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x61a8('0x2')]},'password':{'type':Sequelize[_0x61a8('0x2')]},'port':{'type':Sequelize[_0x61a8('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x61a8('0x2')],'defaultValue':_0x61a8('0x4')},'connTimeout':{'type':Sequelize[_0x61a8('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x61a8('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x61a8('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 338a1ae..dc280b5 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 _0x52ae=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0x43937e,_0x3e6e3a){var _0x1a620f=function(_0x244df3){while(--_0x244df3){_0x43937e['push'](_0x43937e['shift']());}};_0x1a620f(++_0x3e6e3a);}(_0x52ae,0xbb));var _0xe52a=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0x52ae[_0x1a1b6e];return _0x571e2c;};'use strict';var _=require(_0xe52a('0x0'));var util=require(_0xe52a('0x1'));var logger=require(_0xe52a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe52a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe52a('0x4'));var rimraf=require(_0xe52a('0x5'));var config=require(_0xe52a('0x6'));var attributes=require(_0xe52a('0x7'));module[_0xe52a('0x8')]=function(_0x2b5c65,_0x1592ff){return _0x2b5c65[_0xe52a('0x9')](_0xe52a('0xa'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb074=['bluebird','request-promise','path','rimraf','../../config/environment','define','mail_servers_in','util','api','moment'];(function(_0x4b1eda,_0x1ca265){var _0x520e6b=function(_0x3f2272){while(--_0x3f2272){_0x4b1eda['push'](_0x4b1eda['shift']());}};_0x520e6b(++_0x1ca265);}(_0xb074,0x7f));var _0x4b07=function(_0x1c688b,_0x4df102){_0x1c688b=_0x1c688b-0x0;var _0x4d4577=_0xb074[_0x1c688b];return _0x4d4577;};'use strict';var _=require('lodash');var util=require(_0x4b07('0x0'));var logger=require('../../config/logger')(_0x4b07('0x1'));var moment=require(_0x4b07('0x2'));var BPromise=require(_0x4b07('0x3'));var rp=require(_0x4b07('0x4'));var fs=require('fs');var path=require(_0x4b07('0x5'));var rimraf=require(_0x4b07('0x6'));var config=require(_0x4b07('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x33def1,_0x2964c4){return _0x33def1[_0x4b07('0x8')]('MailServerIn',attributes,{'tableName':_0x4b07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index b96b398..0bd70d3 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 _0xb1db=['GetMailServerIn','options','raw','where','attributes','limit','include','map','model','then','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x38d1d8,_0x2398a1){var _0x2e0995=function(_0xe6fb0b){while(--_0xe6fb0b){_0x38d1d8['push'](_0x38d1d8['shift']());}};_0x2e0995(++_0x2398a1);}(_0xb1db,0x1be));var _0xbb1d=function(_0x1b5b3b,_0x5ac3f9){_0x1b5b3b=_0x1b5b3b-0x0;var _0x3a9e59=_0xb1db[_0x1b5b3b];return _0x3a9e59;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xbb1d('0x0'));var rs=require(_0xbb1d('0x1'));var fs=require('fs');var Redis=require(_0xbb1d('0x2'));var db=require(_0xbb1d('0x3'))['db'];var utils=require(_0xbb1d('0x4'));var logger=require(_0xbb1d('0x5'))(_0xbb1d('0x6'));var config=require(_0xbb1d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x217f31,_0x5cf703,_0x2e8562){return new BPromise(function(_0x5f1f0e,_0x443270){return client['request'](_0x217f31,_0x2e8562)['then'](function(_0x1dfb05){logger[_0xbb1d('0x8')](_0xbb1d('0x9'),_0x5cf703,_0xbb1d('0xa'));logger[_0xbb1d('0xb')](_0xbb1d('0xc'),_0x5cf703,_0xbb1d('0xa'),JSON['stringify'](_0x1dfb05));if(_0x1dfb05[_0xbb1d('0xd')]){if(_0x1dfb05[_0xbb1d('0xd')][_0xbb1d('0xe')]===0x1f4){logger[_0xbb1d('0xd')](_0xbb1d('0x9'),_0x5cf703,_0x1dfb05['error'][_0xbb1d('0xf')]);return _0x443270(_0x1dfb05['error'][_0xbb1d('0xf')]);}logger[_0xbb1d('0xd')]('MailServerIn,\x20%s,\x20%s',_0x5cf703,_0x1dfb05[_0xbb1d('0xd')][_0xbb1d('0xf')]);return _0x5f1f0e(_0x1dfb05['error'][_0xbb1d('0xf')]);}else{logger[_0xbb1d('0x8')](_0xbb1d('0x9'),_0x5cf703,'request\x20sent');_0x5f1f0e(_0x1dfb05[_0xbb1d('0x10')][_0xbb1d('0xf')]);}})[_0xbb1d('0x11')](function(_0x4f4ea4){logger[_0xbb1d('0xd')](_0xbb1d('0x9'),_0x5cf703,_0x4f4ea4);_0x443270(_0x4f4ea4);});});}exports[_0xbb1d('0x12')]=function(_0x3454a0){var _0x5c4728=this;return new Promise(function(_0x2305a7,_0x2dcc59){return db['MailServerIn']['findAll']({'raw':_0x3454a0[_0xbb1d('0x13')]?_0x3454a0[_0xbb1d('0x13')][_0xbb1d('0x14')]===undefined?!![]:![]:!![],'where':_0x3454a0[_0xbb1d('0x13')]?_0x3454a0[_0xbb1d('0x13')][_0xbb1d('0x15')]||null:null,'attributes':_0x3454a0[_0xbb1d('0x13')]?_0x3454a0['options'][_0xbb1d('0x16')]||null:null,'limit':_0x3454a0['options']?_0x3454a0['options'][_0xbb1d('0x17')]||null:null,'include':_0x3454a0[_0xbb1d('0x13')]?_0x3454a0[_0xbb1d('0x13')][_0xbb1d('0x18')]?_[_0xbb1d('0x19')](_0x3454a0[_0xbb1d('0x13')][_0xbb1d('0x18')],function(_0xe9f35a){return{'model':db[_0xe9f35a['model']],'as':_0xe9f35a['as'],'attributes':_0xe9f35a[_0xbb1d('0x16')],'include':_0xe9f35a[_0xbb1d('0x18')]?_[_0xbb1d('0x19')](_0xe9f35a[_0xbb1d('0x18')],function(_0x86e9ec){return{'model':db[_0x86e9ec[_0xbb1d('0x1a')]],'as':_0x86e9ec['as'],'attributes':_0x86e9ec[_0xbb1d('0x16')],'include':_0x86e9ec['include']?_[_0xbb1d('0x19')](_0x86e9ec['include'],function(_0x42e3ea){return{'model':db[_0x42e3ea[_0xbb1d('0x1a')]],'as':_0x42e3ea['as'],'attributes':_0x42e3ea[_0xbb1d('0x16')]};}):[]};}):[]};}):[]:[]})[_0xbb1d('0x1b')](function(_0x1360af){logger[_0xbb1d('0x8')](_0xbb1d('0x12'),_0x3454a0);logger[_0xbb1d('0xb')](_0xbb1d('0x12'),_0x3454a0,JSON[_0xbb1d('0x1c')](_0x1360af));_0x2305a7(_0x1360af);})[_0xbb1d('0x11')](function(_0x1bc70c){logger[_0xbb1d('0xd')](_0xbb1d('0x12'),_0x1bc70c[_0xbb1d('0xf')],_0x3454a0);_0x2dcc59(_0x5c4728[_0xbb1d('0xd')](0x1f4,_0x1bc70c[_0xbb1d('0xf')]));});});}; \ No newline at end of file +var _0xffaa=['limit','map','model','attributes','include','then','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','catch','GetMailServerIn','MailServerIn','options','raw','where'];(function(_0x160ff1,_0x1d26f8){var _0x5325f6=function(_0x316b1e){while(--_0x316b1e){_0x160ff1['push'](_0x160ff1['shift']());}};_0x5325f6(++_0x1d26f8);}(_0xffaa,0x130));var _0xaffa=function(_0x3aa77b,_0x262489){_0x3aa77b=_0x3aa77b-0x0;var _0x587745=_0xffaa[_0x3aa77b];return _0x587745;};'use strict';var _=require(_0xaffa('0x0'));var util=require(_0xaffa('0x1'));var moment=require(_0xaffa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaffa('0x3'));var db=require(_0xaffa('0x4'))['db'];var utils=require(_0xaffa('0x5'));var logger=require(_0xaffa('0x6'))(_0xaffa('0x7'));var config=require(_0xaffa('0x8'));var jayson=require(_0xaffa('0x9'));var client=jayson[_0xaffa('0xa')][_0xaffa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x281191,_0x48320d,_0xa081be){return new BPromise(function(_0x7c018f,_0x10be9f){return client[_0xaffa('0xc')](_0x281191,_0xa081be)['then'](function(_0x32eeca){logger['info'](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));logger[_0xaffa('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x48320d,_0xaffa('0xe'),JSON['stringify'](_0x32eeca));if(_0x32eeca['error']){if(_0x32eeca['error'][_0xaffa('0x10')]===0x1f4){logger[_0xaffa('0x11')](_0xaffa('0xd'),_0x48320d,_0x32eeca['error'][_0xaffa('0x12')]);return _0x10be9f(_0x32eeca['error'][_0xaffa('0x12')]);}logger['error'](_0xaffa('0xd'),_0x48320d,_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);return _0x7c018f(_0x32eeca[_0xaffa('0x11')][_0xaffa('0x12')]);}else{logger[_0xaffa('0x13')](_0xaffa('0xd'),_0x48320d,_0xaffa('0xe'));_0x7c018f(_0x32eeca['result'][_0xaffa('0x12')]);}})[_0xaffa('0x14')](function(_0x4b7d89){logger[_0xaffa('0x11')]('MailServerIn,\x20%s,\x20%s',_0x48320d,_0x4b7d89);_0x10be9f(_0x4b7d89);});});}exports[_0xaffa('0x15')]=function(_0x2d57ab){var _0x217114=this;return new Promise(function(_0x398968,_0x28b5c8){return db[_0xaffa('0x16')]['findAll']({'raw':_0x2d57ab[_0xaffa('0x17')]?_0x2d57ab[_0xaffa('0x17')][_0xaffa('0x18')]===undefined?!![]:![]:!![],'where':_0x2d57ab[_0xaffa('0x17')]?_0x2d57ab[_0xaffa('0x17')][_0xaffa('0x19')]||null:null,'attributes':_0x2d57ab[_0xaffa('0x17')]?_0x2d57ab['options']['attributes']||null:null,'limit':_0x2d57ab[_0xaffa('0x17')]?_0x2d57ab[_0xaffa('0x17')][_0xaffa('0x1a')]||null:null,'include':_0x2d57ab[_0xaffa('0x17')]?_0x2d57ab['options']['include']?_[_0xaffa('0x1b')](_0x2d57ab[_0xaffa('0x17')]['include'],function(_0x2a5bb8){return{'model':db[_0x2a5bb8[_0xaffa('0x1c')]],'as':_0x2a5bb8['as'],'attributes':_0x2a5bb8[_0xaffa('0x1d')],'include':_0x2a5bb8[_0xaffa('0x1e')]?_[_0xaffa('0x1b')](_0x2a5bb8[_0xaffa('0x1e')],function(_0x492b82){return{'model':db[_0x492b82[_0xaffa('0x1c')]],'as':_0x492b82['as'],'attributes':_0x492b82[_0xaffa('0x1d')],'include':_0x492b82['include']?_['map'](_0x492b82[_0xaffa('0x1e')],function(_0x46ac99){return{'model':db[_0x46ac99[_0xaffa('0x1c')]],'as':_0x46ac99['as'],'attributes':_0x46ac99[_0xaffa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaffa('0x1f')](function(_0x411448){logger[_0xaffa('0x13')](_0xaffa('0x15'),_0x2d57ab);logger[_0xaffa('0xf')](_0xaffa('0x15'),_0x2d57ab,JSON[_0xaffa('0x20')](_0x411448));_0x398968(_0x411448);})[_0xaffa('0x14')](function(_0x560dfb){logger['error'](_0xaffa('0x15'),_0x560dfb[_0xaffa('0x12')],_0x2d57ab);_0x28b5c8(_0x217114['error'](0x1f4,_0x560dfb['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index ee010e9..9a2c702 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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x3cbf6a,_0x1bfb69){_0x3cbf6a=_0x3cbf6a-0x0;var _0x217697=_0x7a54[_0x3cbf6a];return _0x217697;};'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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x53f4fd,_0x411523){_0x53f4fd=_0x53f4fd-0x0;var _0x54309e=_0x7a54[_0x53f4fd];return _0x54309e;};'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 8b18b0b..202d852 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 _0x0102=['exports','STRING','BOOLEAN'];(function(_0x31c6ca,_0x5b37b3){var _0x1b5088=function(_0x3c840b){while(--_0x3c840b){_0x31c6ca['push'](_0x31c6ca['shift']());}};_0x1b5088(++_0x5b37b3);}(_0x0102,0x186));var _0x2010=function(_0x370a22,_0x31230e){_0x370a22=_0x370a22-0x0;var _0x3b6e70=_0x0102[_0x370a22];return _0x3b6e70;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'description':{'type':Sequelize[_0x2010('0x1')]},'host':{'type':Sequelize[_0x2010('0x1')]},'user':{'type':Sequelize[_0x2010('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x2010('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x13f6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x4df05c,_0x38af70){var _0x319541=function(_0x2d138a){while(--_0x2d138a){_0x4df05c['push'](_0x4df05c['shift']());}};_0x319541(++_0x38af70);}(_0x13f6,0x124));var _0x613f=function(_0x29a228,_0x1c3219){_0x29a228=_0x29a228-0x0;var _0x4d5dac=_0x13f6[_0x29a228];return _0x4d5dac;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x613f('0x2')]},'pass':{'type':Sequelize[_0x613f('0x2')]},'port':{'type':Sequelize[_0x613f('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x613f('0x2')]},'authentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index c271ab3..be8b314 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 _0x8742=['../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','moment','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','api'];(function(_0x124298,_0x542004){var _0x35ac24=function(_0x49afe8){while(--_0x49afe8){_0x124298['push'](_0x124298['shift']());}};_0x35ac24(++_0x542004);}(_0x8742,0x80));var _0x2874=function(_0x480b3f,_0x2121a6){_0x480b3f=_0x480b3f-0x0;var _0x48e6d7=_0x8742[_0x480b3f];return _0x48e6d7;};'use strict';var emlformat=require(_0x2874('0x0'));var rimraf=require(_0x2874('0x1'));var zipdir=require(_0x2874('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2874('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2874('0x4'));var util=require(_0x2874('0x5'));var path=require('path');var sox=require(_0x2874('0x6'));var csv=require(_0x2874('0x7'));var ejs=require(_0x2874('0x8'));var fs=require('fs');var fs_extra=require(_0x2874('0x9'));var _=require(_0x2874('0xa'));var squel=require('squel');var crypto=require(_0x2874('0xb'));var jsforce=require(_0x2874('0xc'));var deskjs=require(_0x2874('0xd'));var toCsv=require(_0x2874('0x7'));var querystring=require(_0x2874('0xe'));var Papa=require(_0x2874('0xf'));var Redis=require(_0x2874('0x10'));var authService=require(_0x2874('0x11'));var qs=require(_0x2874('0x12'));var as=require(_0x2874('0x13'));var hardwareService=require(_0x2874('0x14'));var logger=require('../../config/logger')(_0x2874('0x15'));var utils=require('../../config/utils');var config=require(_0x2874('0x16'));var licenseUtil=require(_0x2874('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x194f6b,_0x4c76f0){_0x4c76f0=_0x4c76f0||0xcc;return function(_0x5c16ad){if(_0x5c16ad){return _0x194f6b[_0x2874('0x18')](_0x4c76f0);}return _0x194f6b['status'](_0x4c76f0)[_0x2874('0x19')]();};}function respondWithResult(_0x1c070d,_0x385b32){_0x385b32=_0x385b32||0xc8;return function(_0x102e20){if(_0x102e20){return _0x1c070d['status'](_0x385b32)[_0x2874('0x1a')](_0x102e20);}};}function respondWithFilteredResult(_0x4680e3,_0x49c7d1){return function(_0x4672d3){if(_0x4672d3){var _0x45e98f=typeof _0x49c7d1[_0x2874('0x1b')]==='undefined'&&typeof _0x49c7d1[_0x2874('0x1c')]===_0x2874('0x1d');var _0x36383a=_0x4672d3['count'];var _0x2db312=_0x45e98f?0x0:_0x49c7d1[_0x2874('0x1b')];var _0x3065fe=_0x45e98f?_0x4672d3[_0x2874('0x1e')]:_0x49c7d1['offset']+_0x49c7d1[_0x2874('0x1c')];var _0x584c49;if(_0x3065fe>=_0x36383a){_0x3065fe=_0x36383a;_0x584c49=0xc8;}else{_0x584c49=0xce;}_0x4680e3[_0x2874('0x1f')](_0x584c49);return _0x4680e3[_0x2874('0x20')](_0x2874('0x21'),_0x2db312+'-'+_0x3065fe+'/'+_0x36383a)[_0x2874('0x1a')](_0x4672d3);}return null;};}function patchUpdates(_0x1f8a4e){return function(_0x48676f){try{jsonpatch[_0x2874('0x22')](_0x48676f,_0x1f8a4e,!![]);}catch(_0x2cb9b2){return BPromise['reject'](_0x2cb9b2);}return _0x48676f[_0x2874('0x23')]();};}function saveUpdates(_0x166735,_0x5bd92d){return function(_0x4108d1){if(_0x4108d1){return _0x4108d1[_0x2874('0x24')](_0x166735)['then'](function(_0x4850f2){return _0x4850f2;});}return null;};}function removeEntity(_0x124dcf,_0x410648){return function(_0x31e6b9){if(_0x31e6b9){return _0x31e6b9[_0x2874('0x25')]()[_0x2874('0x26')](function(){_0x124dcf['status'](0xcc)[_0x2874('0x19')]();});}};}function handleEntityNotFound(_0xedd812,_0x5c06ed){return function(_0x5b23ca){if(!_0x5b23ca){_0xedd812[_0x2874('0x18')](0x194);}return _0x5b23ca;};}function handleError(_0x6284ff,_0x51c2b7){_0x51c2b7=_0x51c2b7||0x1f4;return function(_0x1528e2){logger[_0x2874('0x27')](_0x1528e2[_0x2874('0x28')]);if(_0x1528e2[_0x2874('0x29')]){delete _0x1528e2[_0x2874('0x29')];}_0x6284ff[_0x2874('0x1f')](_0x51c2b7)[_0x2874('0x2a')](_0x1528e2);};}exports[_0x2874('0x2b')]=function(_0x2c46bf,_0x548bf5){var _0x3589fa={},_0x3afa25={},_0x5b39b8={'count':0x0,'rows':[]};var _0x4d47ca=_['map'](db[_0x2874('0x2c')][_0x2874('0x2d')],function(_0x12bd10){return{'name':_0x12bd10[_0x2874('0x2e')],'type':_0x12bd10[_0x2874('0x2f')][_0x2874('0x30')]};});_0x3afa25[_0x2874('0x31')]=_['map'](_0x4d47ca,_0x2874('0x29'));_0x3afa25[_0x2874('0x32')]=_[_0x2874('0x33')](_0x2c46bf[_0x2874('0x32')]);_0x3afa25['filters']=_[_0x2874('0x34')](_0x3afa25[_0x2874('0x31')],_0x3afa25[_0x2874('0x32')]);_0x3589fa['attributes']=_[_0x2874('0x34')](_0x3afa25[_0x2874('0x31')],qs['fields'](_0x2c46bf[_0x2874('0x32')][_0x2874('0x35')]));_0x3589fa['attributes']=_0x3589fa[_0x2874('0x36')][_0x2874('0x37')]?_0x3589fa['attributes']:_0x3afa25[_0x2874('0x31')];if(!_0x2c46bf[_0x2874('0x32')]['hasOwnProperty'](_0x2874('0x38'))){_0x3589fa[_0x2874('0x1c')]=qs[_0x2874('0x1c')](_0x2c46bf[_0x2874('0x32')][_0x2874('0x1c')]);_0x3589fa[_0x2874('0x1b')]=qs['offset'](_0x2c46bf['query']['offset']);}_0x3589fa[_0x2874('0x39')]=qs['sort'](_0x2c46bf[_0x2874('0x32')]['sort']);_0x3589fa[_0x2874('0x3a')]=qs[_0x2874('0x3b')](_[_0x2874('0x3c')](_0x2c46bf[_0x2874('0x32')],_0x3afa25[_0x2874('0x3b')]),_0x4d47ca);if(_0x2c46bf[_0x2874('0x32')][_0x2874('0x3d')]){_0x3589fa[_0x2874('0x3a')]=_[_0x2874('0x3e')](_0x3589fa['where'],{'$or':_[_0x2874('0x3f')](_0x4d47ca,function(_0x2d7b43){if(_0x2d7b43[_0x2874('0x2f')]!=='VIRTUAL'){var _0x2535b0={};_0x2535b0[_0x2d7b43[_0x2874('0x29')]]={'$like':'%'+_0x2c46bf[_0x2874('0x32')][_0x2874('0x3d')]+'%'};return _0x2535b0;}})});}_0x3589fa=_[_0x2874('0x3e')]({},_0x3589fa,_0x2c46bf[_0x2874('0x40')]);var _0x384cac={'where':_0x3589fa[_0x2874('0x3a')]};return db[_0x2874('0x2c')][_0x2874('0x1e')](_0x384cac)[_0x2874('0x26')](function(_0x3fa972){_0x5b39b8[_0x2874('0x1e')]=_0x3fa972;if(_0x2c46bf['query'][_0x2874('0x41')]){_0x3589fa[_0x2874('0x42')]=[{'all':!![]}];}return db['MailServerOut'][_0x2874('0x43')](_0x3589fa);})['then'](function(_0x209892){_0x5b39b8[_0x2874('0x44')]=_0x209892;return _0x5b39b8;})[_0x2874('0x26')](respondWithFilteredResult(_0x548bf5,_0x3589fa))[_0x2874('0x45')](handleError(_0x548bf5,null));};exports[_0x2874('0x46')]=function(_0x3bc786,_0x2bae81){var _0x306e6b={'raw':!![],'where':{'id':_0x3bc786[_0x2874('0x47')]['id']}},_0x1308c4={};_0x1308c4['model']=_[_0x2874('0x33')](db[_0x2874('0x2c')][_0x2874('0x2d')]);_0x1308c4[_0x2874('0x32')]=_[_0x2874('0x33')](_0x3bc786['query']);_0x1308c4[_0x2874('0x3b')]=_['intersection'](_0x1308c4['model'],_0x1308c4[_0x2874('0x32')]);_0x306e6b[_0x2874('0x36')]=_[_0x2874('0x34')](_0x1308c4['model'],qs[_0x2874('0x35')](_0x3bc786[_0x2874('0x32')][_0x2874('0x35')]));_0x306e6b['attributes']=_0x306e6b[_0x2874('0x36')][_0x2874('0x37')]?_0x306e6b[_0x2874('0x36')]:_0x1308c4['model'];if(_0x3bc786['query'][_0x2874('0x41')]){_0x306e6b[_0x2874('0x42')]=[{'all':!![]}];}_0x306e6b=_['merge']({},_0x306e6b,_0x3bc786[_0x2874('0x40')]);return db[_0x2874('0x2c')][_0x2874('0x48')](_0x306e6b)[_0x2874('0x26')](handleEntityNotFound(_0x2bae81,null))[_0x2874('0x26')](respondWithResult(_0x2bae81,null))[_0x2874('0x45')](handleError(_0x2bae81,null));};exports['create']=function(_0x5056d1,_0x4a58a7){return db[_0x2874('0x2c')][_0x2874('0x49')](_0x5056d1[_0x2874('0x4a')],{})['then'](respondWithResult(_0x4a58a7,0xc9))[_0x2874('0x45')](handleError(_0x4a58a7,null));};exports['update']=function(_0x3bf4d4,_0x352835){if(_0x3bf4d4[_0x2874('0x4a')]['id']){delete _0x3bf4d4[_0x2874('0x4a')]['id'];}return db[_0x2874('0x2c')]['find']({'where':{'id':_0x3bf4d4[_0x2874('0x47')]['id']}})[_0x2874('0x26')](handleEntityNotFound(_0x352835,null))[_0x2874('0x26')](saveUpdates(_0x3bf4d4[_0x2874('0x4a')],null))[_0x2874('0x26')](respondWithResult(_0x352835,null))['catch'](handleError(_0x352835,null));};exports[_0x2874('0x25')]=function(_0x11fda6,_0x17982d){return db[_0x2874('0x2c')]['find']({'where':{'id':_0x11fda6[_0x2874('0x47')]['id']}})[_0x2874('0x26')](handleEntityNotFound(_0x17982d,null))['then'](removeEntity(_0x17982d,null))[_0x2874('0x45')](handleError(_0x17982d,null));}; \ No newline at end of file +var _0xda52=['limit','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','keys','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset'];(function(_0x966a50,_0x565d1a){var _0x45281d=function(_0x487ab3){while(--_0x487ab3){_0x966a50['push'](_0x966a50['shift']());}};_0x45281d(++_0x565d1a);}(_0xda52,0xb6));var _0x2da5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2da5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2da5('0x1'));var jsonpatch=require(_0x2da5('0x2'));var rp=require(_0x2da5('0x3'));var moment=require(_0x2da5('0x4'));var BPromise=require(_0x2da5('0x5'));var Mustache=require(_0x2da5('0x6'));var util=require(_0x2da5('0x7'));var path=require('path');var sox=require(_0x2da5('0x8'));var csv=require(_0x2da5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2da5('0xa'));var squel=require(_0x2da5('0xb'));var crypto=require('crypto');var jsforce=require(_0x2da5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2da5('0x9'));var querystring=require(_0x2da5('0xd'));var Papa=require('papaparse');var Redis=require(_0x2da5('0xe'));var authService=require(_0x2da5('0xf'));var qs=require(_0x2da5('0x10'));var as=require(_0x2da5('0x11'));var hardwareService=require(_0x2da5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2da5('0x13'));var config=require(_0x2da5('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b34b1,_0x11938e){_0x11938e=_0x11938e||0xcc;return function(_0x2f3a7d){if(_0x2f3a7d){return _0x1b34b1[_0x2da5('0x15')](_0x11938e);}return _0x1b34b1[_0x2da5('0x16')](_0x11938e)[_0x2da5('0x17')]();};}function respondWithResult(_0x1120f5,_0x2514ea){_0x2514ea=_0x2514ea||0xc8;return function(_0x21673c){if(_0x21673c){return _0x1120f5[_0x2da5('0x16')](_0x2514ea)[_0x2da5('0x18')](_0x21673c);}};}function respondWithFilteredResult(_0x45ad5c,_0x134ed6){return function(_0x2545c6){if(_0x2545c6){var _0x1b9a87=typeof _0x134ed6['offset']===_0x2da5('0x19')&&typeof _0x134ed6['limit']===_0x2da5('0x19');var _0x226582=_0x2545c6[_0x2da5('0x1a')];var _0x5867c4=_0x1b9a87?0x0:_0x134ed6[_0x2da5('0x1b')];var _0x31607d=_0x1b9a87?_0x2545c6[_0x2da5('0x1a')]:_0x134ed6['offset']+_0x134ed6[_0x2da5('0x1c')];var _0x274858;if(_0x31607d>=_0x226582){_0x31607d=_0x226582;_0x274858=0xc8;}else{_0x274858=0xce;}_0x45ad5c[_0x2da5('0x16')](_0x274858);return _0x45ad5c['set'](_0x2da5('0x1d'),_0x5867c4+'-'+_0x31607d+'/'+_0x226582)['json'](_0x2545c6);}return null;};}function patchUpdates(_0x49dc57){return function(_0x52a07d){try{jsonpatch[_0x2da5('0x1e')](_0x52a07d,_0x49dc57,!![]);}catch(_0x1610e2){return BPromise[_0x2da5('0x1f')](_0x1610e2);}return _0x52a07d[_0x2da5('0x20')]();};}function saveUpdates(_0x5c0e81,_0x42c923){return function(_0x2dfe21){if(_0x2dfe21){return _0x2dfe21[_0x2da5('0x21')](_0x5c0e81)['then'](function(_0x371045){return _0x371045;});}return null;};}function removeEntity(_0x22a339,_0x451524){return function(_0x471abc){if(_0x471abc){return _0x471abc[_0x2da5('0x22')]()[_0x2da5('0x23')](function(){_0x22a339[_0x2da5('0x16')](0xcc)[_0x2da5('0x17')]();});}};}function handleEntityNotFound(_0x40634d,_0x5a21b8){return function(_0x4213d8){if(!_0x4213d8){_0x40634d[_0x2da5('0x15')](0x194);}return _0x4213d8;};}function handleError(_0x3021de,_0x444bb6){_0x444bb6=_0x444bb6||0x1f4;return function(_0xe94955){logger['error'](_0xe94955[_0x2da5('0x24')]);if(_0xe94955['name']){delete _0xe94955[_0x2da5('0x25')];}_0x3021de[_0x2da5('0x16')](_0x444bb6)[_0x2da5('0x26')](_0xe94955);};}exports[_0x2da5('0x27')]=function(_0x2e3682,_0x3dac95){var _0x54a5e4={},_0x27d2fe={},_0x186455={'count':0x0,'rows':[]};var _0x3e1892=_[_0x2da5('0x28')](db[_0x2da5('0x29')][_0x2da5('0x2a')],function(_0x4665ec){return{'name':_0x4665ec[_0x2da5('0x2b')],'type':_0x4665ec[_0x2da5('0x2c')][_0x2da5('0x2d')]};});_0x27d2fe[_0x2da5('0x2e')]=_[_0x2da5('0x28')](_0x3e1892,'name');_0x27d2fe[_0x2da5('0x2f')]=_['keys'](_0x2e3682[_0x2da5('0x2f')]);_0x27d2fe[_0x2da5('0x30')]=_[_0x2da5('0x31')](_0x27d2fe['model'],_0x27d2fe[_0x2da5('0x2f')]);_0x54a5e4[_0x2da5('0x32')]=_['intersection'](_0x27d2fe[_0x2da5('0x2e')],qs[_0x2da5('0x33')](_0x2e3682['query'][_0x2da5('0x33')]));_0x54a5e4[_0x2da5('0x32')]=_0x54a5e4['attributes'][_0x2da5('0x34')]?_0x54a5e4[_0x2da5('0x32')]:_0x27d2fe['model'];if(!_0x2e3682[_0x2da5('0x2f')][_0x2da5('0x35')](_0x2da5('0x36'))){_0x54a5e4[_0x2da5('0x1c')]=qs[_0x2da5('0x1c')](_0x2e3682[_0x2da5('0x2f')][_0x2da5('0x1c')]);_0x54a5e4[_0x2da5('0x1b')]=qs[_0x2da5('0x1b')](_0x2e3682['query'][_0x2da5('0x1b')]);}_0x54a5e4[_0x2da5('0x37')]=qs['sort'](_0x2e3682[_0x2da5('0x2f')]['sort']);_0x54a5e4[_0x2da5('0x38')]=qs['filters'](_[_0x2da5('0x39')](_0x2e3682[_0x2da5('0x2f')],_0x27d2fe[_0x2da5('0x30')]),_0x3e1892);if(_0x2e3682['query'][_0x2da5('0x3a')]){_0x54a5e4['where']=_[_0x2da5('0x3b')](_0x54a5e4[_0x2da5('0x38')],{'$or':_[_0x2da5('0x28')](_0x3e1892,function(_0x65589f){if(_0x65589f['type']!==_0x2da5('0x3c')){var _0x384dc3={};_0x384dc3[_0x65589f['name']]={'$like':'%'+_0x2e3682[_0x2da5('0x2f')][_0x2da5('0x3a')]+'%'};return _0x384dc3;}})});}_0x54a5e4=_[_0x2da5('0x3b')]({},_0x54a5e4,_0x2e3682['options']);var _0x4db8a7={'where':_0x54a5e4[_0x2da5('0x38')]};return db[_0x2da5('0x29')][_0x2da5('0x1a')](_0x4db8a7)['then'](function(_0x727145){_0x186455['count']=_0x727145;if(_0x2e3682[_0x2da5('0x2f')][_0x2da5('0x3d')]){_0x54a5e4[_0x2da5('0x3e')]=[{'all':!![]}];}return db[_0x2da5('0x29')]['findAll'](_0x54a5e4);})[_0x2da5('0x23')](function(_0x48999b){_0x186455[_0x2da5('0x3f')]=_0x48999b;return _0x186455;})[_0x2da5('0x23')](respondWithFilteredResult(_0x3dac95,_0x54a5e4))[_0x2da5('0x40')](handleError(_0x3dac95,null));};exports['show']=function(_0x980bdc,_0x1dbe38){var _0x5721b9={'raw':!![],'where':{'id':_0x980bdc['params']['id']}},_0x4fa069={};_0x4fa069[_0x2da5('0x2e')]=_[_0x2da5('0x41')](db[_0x2da5('0x29')]['rawAttributes']);_0x4fa069['query']=_[_0x2da5('0x41')](_0x980bdc[_0x2da5('0x2f')]);_0x4fa069['filters']=_[_0x2da5('0x31')](_0x4fa069[_0x2da5('0x2e')],_0x4fa069[_0x2da5('0x2f')]);_0x5721b9[_0x2da5('0x32')]=_[_0x2da5('0x31')](_0x4fa069[_0x2da5('0x2e')],qs[_0x2da5('0x33')](_0x980bdc[_0x2da5('0x2f')][_0x2da5('0x33')]));_0x5721b9['attributes']=_0x5721b9[_0x2da5('0x32')][_0x2da5('0x34')]?_0x5721b9[_0x2da5('0x32')]:_0x4fa069[_0x2da5('0x2e')];if(_0x980bdc[_0x2da5('0x2f')]['includeAll']){_0x5721b9['include']=[{'all':!![]}];}_0x5721b9=_['merge']({},_0x5721b9,_0x980bdc['options']);return db['MailServerOut'][_0x2da5('0x42')](_0x5721b9)[_0x2da5('0x23')](handleEntityNotFound(_0x1dbe38,null))[_0x2da5('0x23')](respondWithResult(_0x1dbe38,null))[_0x2da5('0x40')](handleError(_0x1dbe38,null));};exports[_0x2da5('0x43')]=function(_0x1f7fb6,_0x3ab1c2){return db[_0x2da5('0x29')][_0x2da5('0x43')](_0x1f7fb6[_0x2da5('0x44')],{})[_0x2da5('0x23')](respondWithResult(_0x3ab1c2,0xc9))[_0x2da5('0x40')](handleError(_0x3ab1c2,null));};exports[_0x2da5('0x21')]=function(_0x232a30,_0x467d5d){if(_0x232a30[_0x2da5('0x44')]['id']){delete _0x232a30[_0x2da5('0x44')]['id'];}return db[_0x2da5('0x29')][_0x2da5('0x42')]({'where':{'id':_0x232a30[_0x2da5('0x45')]['id']}})[_0x2da5('0x23')](handleEntityNotFound(_0x467d5d,null))['then'](saveUpdates(_0x232a30[_0x2da5('0x44')],null))[_0x2da5('0x23')](respondWithResult(_0x467d5d,null))['catch'](handleError(_0x467d5d,null));};exports['destroy']=function(_0x3da5ba,_0x1916eb){return db['MailServerOut']['find']({'where':{'id':_0x3da5ba[_0x2da5('0x45')]['id']}})['then'](handleEntityNotFound(_0x1916eb,null))[_0x2da5('0x23')](removeEntity(_0x1916eb,null))[_0x2da5('0x40')](handleError(_0x1916eb,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e2e4397..90360a9 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 _0xe093=['request-promise','rimraf','../../config/environment','exports','define','mail_servers_out','util','../../config/logger','api','moment','bluebird'];(function(_0x2cf2b8,_0x220a71){var _0x274fa7=function(_0xd57098){while(--_0xd57098){_0x2cf2b8['push'](_0x2cf2b8['shift']());}};_0x274fa7(++_0x220a71);}(_0xe093,0x1ea));var _0x3e09=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xe093[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x3e09('0x0'));var logger=require(_0x3e09('0x1'))(_0x3e09('0x2'));var moment=require(_0x3e09('0x3'));var BPromise=require(_0x3e09('0x4'));var rp=require(_0x3e09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e09('0x6'));var config=require(_0x3e09('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x3e09('0x8')]=function(_0x186161,_0x5bcc4e){return _0x186161[_0x3e09('0x9')]('MailServerOut',attributes,{'tableName':_0x3e09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2a8=['util','api','bluebird','request-promise','path','./mailServerOut.attributes','exports','MailServerOut','lodash'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xd2a8,0xb3));var _0x8d2a=function(_0x2f7c43,_0x5ca843){_0x2f7c43=_0x2f7c43-0x0;var _0x3da68f=_0xd2a8[_0x2f7c43];return _0x3da68f;};'use strict';var _=require(_0x8d2a('0x0'));var util=require(_0x8d2a('0x1'));var logger=require('../../config/logger')(_0x8d2a('0x2'));var moment=require('moment');var BPromise=require(_0x8d2a('0x3'));var rp=require(_0x8d2a('0x4'));var fs=require('fs');var path=require(_0x8d2a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8d2a('0x6'));module[_0x8d2a('0x7')]=function(_0x1ccf7e,_0x37a7ef){return _0x1ccf7e['define'](_0x8d2a('0x8'),attributes,{'tableName':'mail_servers_out','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 80d0b3a..b3fbd3c 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x173ec4,_0xe637e){var _0xf86865=function(_0x4f2033){while(--_0x4f2033){_0x173ec4['push'](_0x173ec4['shift']());}};_0xf86865(++_0xe637e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x22bd20,_0x11e153){var _0x4741d2=function(_0x59e294){while(--_0x59e294){_0x22bd20['push'](_0x22bd20['shift']());}};_0x4741d2(++_0x11e153);}(_0xdb28,0x106));var _0x8db2=function(_0x1aaecf,_0x3b137f){_0x1aaecf=_0x1aaecf-0x0;var _0x5d29bf=_0xdb28[_0x1aaecf];return _0x5d29bf;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 60a6d26..554e169 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 _0xf58f=['update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xf58f,0x6c));var _0xff58=function(_0x2e3adc,_0x349adc){_0x2e3adc=_0x2e3adc-0x0;var _0x5a464c=_0xf58f[_0x2e3adc];return _0x5a464c;};'use strict';var multer=require(_0xff58('0x0'));var util=require('util');var path=require(_0xff58('0x1'));var timeout=require(_0xff58('0x2'));var express=require(_0xff58('0x3'));var router=express[_0xff58('0x4')]();var fs_extra=require(_0xff58('0x5'));var auth=require(_0xff58('0x6'));var interaction=require(_0xff58('0x7'));var config=require(_0xff58('0x8'));var controller=require(_0xff58('0x9'));router[_0xff58('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xff58('0xb'),auth['isAuthenticated'](),controller[_0xff58('0xc')]);router[_0xff58('0xa')](_0xff58('0xd'),auth[_0xff58('0xe')](),controller[_0xff58('0xf')]);router[_0xff58('0x10')]('/',auth[_0xff58('0xe')](),controller['create']);router[_0xff58('0x11')](_0xff58('0xd'),auth[_0xff58('0xe')](),controller[_0xff58('0x12')]);router[_0xff58('0x13')]('/:id',auth[_0xff58('0xe')](),controller[_0xff58('0x14')]);module['exports']=router; \ No newline at end of file +var _0x08f5=['../../components/interaction/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x47c39d,_0x3eea90){var _0xd41416=function(_0x24d049){while(--_0x24d049){_0x47c39d['push'](_0x47c39d['shift']());}};_0xd41416(++_0x3eea90);}(_0x08f5,0x185));var _0x508f=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x08f5[_0x5d6e30];return _0x3d3f3b;};'use strict';var multer=require('multer');var util=require(_0x508f('0x0'));var path=require(_0x508f('0x1'));var timeout=require(_0x508f('0x2'));var express=require(_0x508f('0x3'));var router=express[_0x508f('0x4')]();var fs_extra=require(_0x508f('0x5'));var auth=require(_0x508f('0x6'));var interaction=require(_0x508f('0x7'));var config=require('../../config/environment');var controller=require(_0x508f('0x8'));router['get']('/',auth[_0x508f('0x9')](),controller[_0x508f('0xa')]);router[_0x508f('0xb')](_0x508f('0xc'),auth[_0x508f('0x9')](),controller[_0x508f('0xd')]);router[_0x508f('0xb')]('/:id',auth[_0x508f('0x9')](),controller[_0x508f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x508f('0xf')]);router[_0x508f('0x10')](_0x508f('0x11'),auth[_0x508f('0x9')](),controller[_0x508f('0x12')]);router[_0x508f('0x13')](_0x508f('0x11'),auth[_0x508f('0x9')](),controller[_0x508f('0x14')]);module[_0x508f('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index b87c966..255e2ee 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 _0x1224=['name','sequelize','exports','STRING'];(function(_0x26890f,_0x3d4d08){var _0x247400=function(_0xf490df){while(--_0xf490df){_0x26890f['push'](_0x26890f['shift']());}};_0x247400(++_0x3d4d08);}(_0x1224,0x10d));var _0x4122=function(_0x5423a0,_0xc480ba){_0x5423a0=_0x5423a0-0x0;var _0x1b6dd0=_0x1224[_0x5423a0];return _0x1b6dd0;};'use strict';var Sequelize=require(_0x4122('0x0'));module[_0x4122('0x1')]={'name':{'type':Sequelize[_0x4122('0x2')],'unique':_0x4122('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4122('0x2')]}}; \ No newline at end of file +var _0x01d9=['sequelize','exports','STRING','name'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_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')],'unique':_0x901d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 734ab96..4ae1cca 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 _0xddb5=['MailSubstatus','findAll','show','keys','options','find','catch','create','body','params','describe','rimraf','zip-dir','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','filter','includeAll','include'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0xddb5,0x187));var _0x5ddb=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xddb5[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ddb('0x0'));var zipdir=require(_0x5ddb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ddb('0x2'));var BPromise=require(_0x5ddb('0x3'));var Mustache=require('mustache');var util=require(_0x5ddb('0x4'));var path=require(_0x5ddb('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5ddb('0x6'));var fs=require('fs');var fs_extra=require(_0x5ddb('0x7'));var _=require(_0x5ddb('0x8'));var squel=require(_0x5ddb('0x9'));var crypto=require(_0x5ddb('0xa'));var jsforce=require(_0x5ddb('0xb'));var deskjs=require(_0x5ddb('0xc'));var toCsv=require(_0x5ddb('0xd'));var querystring=require('querystring');var Papa=require(_0x5ddb('0xe'));var Redis=require(_0x5ddb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ddb('0x10'));var as=require(_0x5ddb('0x11'));var hardwareService=require(_0x5ddb('0x12'));var logger=require(_0x5ddb('0x13'))('api');var utils=require(_0x5ddb('0x14'));var config=require(_0x5ddb('0x15'));var licenseUtil=require(_0x5ddb('0x16'));var db=require(_0x5ddb('0x17'))['db'];function respondWithStatusCode(_0x5cbbc6,_0x1722ea){_0x1722ea=_0x1722ea||0xcc;return function(_0x1442ad){if(_0x1442ad){return _0x5cbbc6[_0x5ddb('0x18')](_0x1722ea);}return _0x5cbbc6['status'](_0x1722ea)['end']();};}function respondWithResult(_0x3fcda8,_0x597b45){_0x597b45=_0x597b45||0xc8;return function(_0x2c7d56){if(_0x2c7d56){return _0x3fcda8[_0x5ddb('0x19')](_0x597b45)[_0x5ddb('0x1a')](_0x2c7d56);}};}function respondWithFilteredResult(_0x44bdaa,_0xb36beb){return function(_0x39449b){if(_0x39449b){var _0x349d5a=typeof _0xb36beb['offset']===_0x5ddb('0x1b')&&typeof _0xb36beb[_0x5ddb('0x1c')]===_0x5ddb('0x1b');var _0x33255c=_0x39449b[_0x5ddb('0x1d')];var _0x4c722e=_0x349d5a?0x0:_0xb36beb['offset'];var _0x33d68f=_0x349d5a?_0x39449b[_0x5ddb('0x1d')]:_0xb36beb['offset']+_0xb36beb['limit'];var _0x3af5f4;if(_0x33d68f>=_0x33255c){_0x33d68f=_0x33255c;_0x3af5f4=0xc8;}else{_0x3af5f4=0xce;}_0x44bdaa[_0x5ddb('0x19')](_0x3af5f4);return _0x44bdaa['set'](_0x5ddb('0x1e'),_0x4c722e+'-'+_0x33d68f+'/'+_0x33255c)[_0x5ddb('0x1a')](_0x39449b);}return null;};}function patchUpdates(_0x1f2bb0){return function(_0x473826){try{jsonpatch[_0x5ddb('0x1f')](_0x473826,_0x1f2bb0,!![]);}catch(_0x147d5e){return BPromise[_0x5ddb('0x20')](_0x147d5e);}return _0x473826[_0x5ddb('0x21')]();};}function saveUpdates(_0x37fb6a,_0x28ec8a){return function(_0xdc339d){if(_0xdc339d){return _0xdc339d[_0x5ddb('0x22')](_0x37fb6a)[_0x5ddb('0x23')](function(_0x236309){return _0x236309;});}return null;};}function removeEntity(_0x160f6a,_0x5e583f){return function(_0x33a2e6){if(_0x33a2e6){return _0x33a2e6[_0x5ddb('0x24')]()[_0x5ddb('0x23')](function(){_0x160f6a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6f12,_0x318561){return function(_0x574b9a){if(!_0x574b9a){_0x1c6f12[_0x5ddb('0x18')](0x194);}return _0x574b9a;};}function handleError(_0xe1d304,_0x4498c3){_0x4498c3=_0x4498c3||0x1f4;return function(_0x3d7010){logger[_0x5ddb('0x25')](_0x3d7010[_0x5ddb('0x26')]);if(_0x3d7010[_0x5ddb('0x27')]){delete _0x3d7010['name'];}_0xe1d304[_0x5ddb('0x19')](_0x4498c3)[_0x5ddb('0x28')](_0x3d7010);};}exports[_0x5ddb('0x29')]=function(_0x1852f3,_0x2bcd9b){var _0x14895a={},_0x5c0439={},_0x5c1696={'count':0x0,'rows':[]};var _0x66c9d=_['map'](db['MailSubstatus'][_0x5ddb('0x2a')],function(_0x3db07a){return{'name':_0x3db07a[_0x5ddb('0x2b')],'type':_0x3db07a[_0x5ddb('0x2c')][_0x5ddb('0x2d')]};});_0x5c0439[_0x5ddb('0x2e')]=_[_0x5ddb('0x2f')](_0x66c9d,'name');_0x5c0439[_0x5ddb('0x30')]=_['keys'](_0x1852f3[_0x5ddb('0x30')]);_0x5c0439[_0x5ddb('0x31')]=_[_0x5ddb('0x32')](_0x5c0439[_0x5ddb('0x2e')],_0x5c0439[_0x5ddb('0x30')]);_0x14895a[_0x5ddb('0x33')]=_['intersection'](_0x5c0439['model'],qs['fields'](_0x1852f3[_0x5ddb('0x30')][_0x5ddb('0x34')]));_0x14895a[_0x5ddb('0x33')]=_0x14895a[_0x5ddb('0x33')][_0x5ddb('0x35')]?_0x14895a[_0x5ddb('0x33')]:_0x5c0439[_0x5ddb('0x2e')];if(!_0x1852f3['query'][_0x5ddb('0x36')](_0x5ddb('0x37'))){_0x14895a[_0x5ddb('0x1c')]=qs[_0x5ddb('0x1c')](_0x1852f3['query'][_0x5ddb('0x1c')]);_0x14895a['offset']=qs['offset'](_0x1852f3[_0x5ddb('0x30')][_0x5ddb('0x38')]);}_0x14895a[_0x5ddb('0x39')]=qs[_0x5ddb('0x3a')](_0x1852f3[_0x5ddb('0x30')][_0x5ddb('0x3a')]);_0x14895a['where']=qs[_0x5ddb('0x31')](_[_0x5ddb('0x3b')](_0x1852f3['query'],_0x5c0439[_0x5ddb('0x31')]),_0x66c9d);if(_0x1852f3[_0x5ddb('0x30')]['filter']){_0x14895a[_0x5ddb('0x3c')]=_[_0x5ddb('0x3d')](_0x14895a[_0x5ddb('0x3c')],{'$or':_['map'](_0x66c9d,function(_0x2cee7d){if(_0x2cee7d[_0x5ddb('0x2c')]!=='VIRTUAL'){var _0xc5537={};_0xc5537[_0x2cee7d[_0x5ddb('0x27')]]={'$like':'%'+_0x1852f3[_0x5ddb('0x30')][_0x5ddb('0x3e')]+'%'};return _0xc5537;}})});}_0x14895a=_[_0x5ddb('0x3d')]({},_0x14895a,_0x1852f3['options']);var _0x1d9e06={'where':_0x14895a[_0x5ddb('0x3c')]};return db['MailSubstatus'][_0x5ddb('0x1d')](_0x1d9e06)[_0x5ddb('0x23')](function(_0x4b15af){_0x5c1696[_0x5ddb('0x1d')]=_0x4b15af;if(_0x1852f3[_0x5ddb('0x30')][_0x5ddb('0x3f')]){_0x14895a[_0x5ddb('0x40')]=[{'all':!![]}];}return db[_0x5ddb('0x41')][_0x5ddb('0x42')](_0x14895a);})[_0x5ddb('0x23')](function(_0x5a49b3){_0x5c1696['rows']=_0x5a49b3;return _0x5c1696;})[_0x5ddb('0x23')](respondWithFilteredResult(_0x2bcd9b,_0x14895a))['catch'](handleError(_0x2bcd9b,null));};exports[_0x5ddb('0x43')]=function(_0xead506,_0x589dfd){var _0x3c0c0d={'raw':!![],'where':{'id':_0xead506['params']['id']}},_0x4f6608={};_0x4f6608[_0x5ddb('0x2e')]=_[_0x5ddb('0x44')](db['MailSubstatus']['rawAttributes']);_0x4f6608[_0x5ddb('0x30')]=_[_0x5ddb('0x44')](_0xead506[_0x5ddb('0x30')]);_0x4f6608['filters']=_[_0x5ddb('0x32')](_0x4f6608[_0x5ddb('0x2e')],_0x4f6608[_0x5ddb('0x30')]);_0x3c0c0d[_0x5ddb('0x33')]=_[_0x5ddb('0x32')](_0x4f6608['model'],qs[_0x5ddb('0x34')](_0xead506[_0x5ddb('0x30')][_0x5ddb('0x34')]));_0x3c0c0d['attributes']=_0x3c0c0d[_0x5ddb('0x33')][_0x5ddb('0x35')]?_0x3c0c0d[_0x5ddb('0x33')]:_0x4f6608[_0x5ddb('0x2e')];if(_0xead506[_0x5ddb('0x30')][_0x5ddb('0x3f')]){_0x3c0c0d[_0x5ddb('0x40')]=[{'all':!![]}];}_0x3c0c0d=_['merge']({},_0x3c0c0d,_0xead506[_0x5ddb('0x45')]);return db[_0x5ddb('0x41')][_0x5ddb('0x46')](_0x3c0c0d)['then'](handleEntityNotFound(_0x589dfd,null))['then'](respondWithResult(_0x589dfd,null))[_0x5ddb('0x47')](handleError(_0x589dfd,null));};exports[_0x5ddb('0x48')]=function(_0xd9822c,_0x3f6525){return db[_0x5ddb('0x41')][_0x5ddb('0x48')](_0xd9822c[_0x5ddb('0x49')],{})['then'](respondWithResult(_0x3f6525,0xc9))[_0x5ddb('0x47')](handleError(_0x3f6525,null));};exports[_0x5ddb('0x22')]=function(_0x1da717,_0x4165d1){if(_0x1da717[_0x5ddb('0x49')]['id']){delete _0x1da717[_0x5ddb('0x49')]['id'];}return db['MailSubstatus'][_0x5ddb('0x46')]({'where':{'id':_0x1da717['params']['id']}})[_0x5ddb('0x23')](handleEntityNotFound(_0x4165d1,null))[_0x5ddb('0x23')](saveUpdates(_0x1da717['body'],null))['then'](respondWithResult(_0x4165d1,null))[_0x5ddb('0x47')](handleError(_0x4165d1,null));};exports['destroy']=function(_0x527848,_0x13a4a7){return db[_0x5ddb('0x41')][_0x5ddb('0x46')]({'where':{'id':_0x527848[_0x5ddb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x13a4a7,null))[_0x5ddb('0x23')](removeEntity(_0x13a4a7,null))[_0x5ddb('0x47')](handleError(_0x13a4a7,null));};exports[_0x5ddb('0x4b')]=function(_0x42ff12,_0x1b9708){return db[_0x5ddb('0x41')]['describe']()[_0x5ddb('0x23')](respondWithResult(_0x1b9708,null))['catch'](handleError(_0x1b9708,null));}; \ No newline at end of file +var _0x44aa=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','send','index','map','MailSubstatus','fieldName','type','key','model','name','keys','query'];(function(_0x33cacf,_0x14b7e9){var _0x216882=function(_0x2e0d09){while(--_0x2e0d09){_0x33cacf['push'](_0x33cacf['shift']());}};_0x216882(++_0x14b7e9);}(_0x44aa,0x1ca));var _0xa44a=function(_0x6fc282,_0xed83a0){_0x6fc282=_0x6fc282-0x0;var _0x11d36e=_0x44aa[_0x6fc282];return _0x11d36e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa44a('0x0'));var zipdir=require(_0xa44a('0x1'));var jsonpatch=require(_0xa44a('0x2'));var rp=require(_0xa44a('0x3'));var moment=require(_0xa44a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa44a('0x5'));var util=require(_0xa44a('0x6'));var path=require(_0xa44a('0x7'));var sox=require(_0xa44a('0x8'));var csv=require(_0xa44a('0x9'));var ejs=require(_0xa44a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa44a('0xb'));var squel=require(_0xa44a('0xc'));var crypto=require('crypto');var jsforce=require(_0xa44a('0xd'));var deskjs=require(_0xa44a('0xe'));var toCsv=require(_0xa44a('0x9'));var querystring=require(_0xa44a('0xf'));var Papa=require(_0xa44a('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(_0xa44a('0x11'));var logger=require('../../config/logger')(_0xa44a('0x12'));var utils=require(_0xa44a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa44a('0x14'))['db'];function respondWithStatusCode(_0x33a09d,_0x58587b){_0x58587b=_0x58587b||0xcc;return function(_0x56b912){if(_0x56b912){return _0x33a09d[_0xa44a('0x15')](_0x58587b);}return _0x33a09d[_0xa44a('0x16')](_0x58587b)[_0xa44a('0x17')]();};}function respondWithResult(_0x5e039a,_0x5a6beb){_0x5a6beb=_0x5a6beb||0xc8;return function(_0x132ef7){if(_0x132ef7){return _0x5e039a[_0xa44a('0x16')](_0x5a6beb)[_0xa44a('0x18')](_0x132ef7);}};}function respondWithFilteredResult(_0x21746f,_0x52a94a){return function(_0x3cf493){if(_0x3cf493){var _0x5daa25=typeof _0x52a94a[_0xa44a('0x19')]===_0xa44a('0x1a')&&typeof _0x52a94a[_0xa44a('0x1b')]===_0xa44a('0x1a');var _0x5e3ca1=_0x3cf493['count'];var _0x1a0339=_0x5daa25?0x0:_0x52a94a[_0xa44a('0x19')];var _0x5a8f63=_0x5daa25?_0x3cf493[_0xa44a('0x1c')]:_0x52a94a[_0xa44a('0x19')]+_0x52a94a[_0xa44a('0x1b')];var _0x3db0c7;if(_0x5a8f63>=_0x5e3ca1){_0x5a8f63=_0x5e3ca1;_0x3db0c7=0xc8;}else{_0x3db0c7=0xce;}_0x21746f[_0xa44a('0x16')](_0x3db0c7);return _0x21746f['set'](_0xa44a('0x1d'),_0x1a0339+'-'+_0x5a8f63+'/'+_0x5e3ca1)['json'](_0x3cf493);}return null;};}function patchUpdates(_0x420016){return function(_0x2c908c){try{jsonpatch[_0xa44a('0x1e')](_0x2c908c,_0x420016,!![]);}catch(_0x4aa75e){return BPromise['reject'](_0x4aa75e);}return _0x2c908c[_0xa44a('0x1f')]();};}function saveUpdates(_0x55c9e8,_0x191ce8){return function(_0x44a204){if(_0x44a204){return _0x44a204[_0xa44a('0x20')](_0x55c9e8)['then'](function(_0x204d81){return _0x204d81;});}return null;};}function removeEntity(_0x63933f,_0x4e3750){return function(_0xd6b511){if(_0xd6b511){return _0xd6b511[_0xa44a('0x21')]()[_0xa44a('0x22')](function(){_0x63933f[_0xa44a('0x16')](0xcc)[_0xa44a('0x17')]();});}};}function handleEntityNotFound(_0x30e2c9,_0x59a53a){return function(_0x41e9e6){if(!_0x41e9e6){_0x30e2c9[_0xa44a('0x15')](0x194);}return _0x41e9e6;};}function handleError(_0x4606d6,_0x54bcdd){_0x54bcdd=_0x54bcdd||0x1f4;return function(_0x2e117b){logger['error'](_0x2e117b['stack']);if(_0x2e117b['name']){delete _0x2e117b['name'];}_0x4606d6[_0xa44a('0x16')](_0x54bcdd)[_0xa44a('0x23')](_0x2e117b);};}exports[_0xa44a('0x24')]=function(_0x2318b2,_0x267753){var _0x51a1af={},_0x1ef304={},_0x192b93={'count':0x0,'rows':[]};var _0x207329=_[_0xa44a('0x25')](db[_0xa44a('0x26')]['rawAttributes'],function(_0x4a152b){return{'name':_0x4a152b[_0xa44a('0x27')],'type':_0x4a152b[_0xa44a('0x28')][_0xa44a('0x29')]};});_0x1ef304[_0xa44a('0x2a')]=_[_0xa44a('0x25')](_0x207329,_0xa44a('0x2b'));_0x1ef304['query']=_[_0xa44a('0x2c')](_0x2318b2[_0xa44a('0x2d')]);_0x1ef304[_0xa44a('0x2e')]=_[_0xa44a('0x2f')](_0x1ef304[_0xa44a('0x2a')],_0x1ef304[_0xa44a('0x2d')]);_0x51a1af[_0xa44a('0x30')]=_['intersection'](_0x1ef304[_0xa44a('0x2a')],qs[_0xa44a('0x31')](_0x2318b2[_0xa44a('0x2d')][_0xa44a('0x31')]));_0x51a1af[_0xa44a('0x30')]=_0x51a1af[_0xa44a('0x30')][_0xa44a('0x32')]?_0x51a1af[_0xa44a('0x30')]:_0x1ef304[_0xa44a('0x2a')];if(!_0x2318b2[_0xa44a('0x2d')][_0xa44a('0x33')](_0xa44a('0x34'))){_0x51a1af[_0xa44a('0x1b')]=qs['limit'](_0x2318b2[_0xa44a('0x2d')]['limit']);_0x51a1af['offset']=qs[_0xa44a('0x19')](_0x2318b2[_0xa44a('0x2d')]['offset']);}_0x51a1af[_0xa44a('0x35')]=qs[_0xa44a('0x36')](_0x2318b2['query'][_0xa44a('0x36')]);_0x51a1af[_0xa44a('0x37')]=qs[_0xa44a('0x2e')](_[_0xa44a('0x38')](_0x2318b2[_0xa44a('0x2d')],_0x1ef304[_0xa44a('0x2e')]),_0x207329);if(_0x2318b2[_0xa44a('0x2d')][_0xa44a('0x39')]){_0x51a1af[_0xa44a('0x37')]=_['merge'](_0x51a1af[_0xa44a('0x37')],{'$or':_['map'](_0x207329,function(_0x360260){if(_0x360260[_0xa44a('0x28')]!==_0xa44a('0x3a')){var _0xdc6173={};_0xdc6173[_0x360260[_0xa44a('0x2b')]]={'$like':'%'+_0x2318b2[_0xa44a('0x2d')][_0xa44a('0x39')]+'%'};return _0xdc6173;}})});}_0x51a1af=_[_0xa44a('0x3b')]({},_0x51a1af,_0x2318b2[_0xa44a('0x3c')]);var _0x3e092f={'where':_0x51a1af['where']};return db['MailSubstatus'][_0xa44a('0x1c')](_0x3e092f)[_0xa44a('0x22')](function(_0x1e85c8){_0x192b93[_0xa44a('0x1c')]=_0x1e85c8;if(_0x2318b2[_0xa44a('0x2d')][_0xa44a('0x3d')]){_0x51a1af[_0xa44a('0x3e')]=[{'all':!![]}];}return db[_0xa44a('0x26')][_0xa44a('0x3f')](_0x51a1af);})[_0xa44a('0x22')](function(_0x1a2604){_0x192b93['rows']=_0x1a2604;return _0x192b93;})[_0xa44a('0x22')](respondWithFilteredResult(_0x267753,_0x51a1af))[_0xa44a('0x40')](handleError(_0x267753,null));};exports[_0xa44a('0x41')]=function(_0x4b3cd7,_0x344fdc){var _0x4a82aa={'raw':!![],'where':{'id':_0x4b3cd7[_0xa44a('0x42')]['id']}},_0x1f97e0={};_0x1f97e0[_0xa44a('0x2a')]=_[_0xa44a('0x2c')](db[_0xa44a('0x26')][_0xa44a('0x43')]);_0x1f97e0[_0xa44a('0x2d')]=_[_0xa44a('0x2c')](_0x4b3cd7['query']);_0x1f97e0[_0xa44a('0x2e')]=_[_0xa44a('0x2f')](_0x1f97e0[_0xa44a('0x2a')],_0x1f97e0[_0xa44a('0x2d')]);_0x4a82aa['attributes']=_[_0xa44a('0x2f')](_0x1f97e0[_0xa44a('0x2a')],qs[_0xa44a('0x31')](_0x4b3cd7[_0xa44a('0x2d')]['fields']));_0x4a82aa[_0xa44a('0x30')]=_0x4a82aa[_0xa44a('0x30')][_0xa44a('0x32')]?_0x4a82aa[_0xa44a('0x30')]:_0x1f97e0[_0xa44a('0x2a')];if(_0x4b3cd7[_0xa44a('0x2d')][_0xa44a('0x3d')]){_0x4a82aa[_0xa44a('0x3e')]=[{'all':!![]}];}_0x4a82aa=_['merge']({},_0x4a82aa,_0x4b3cd7[_0xa44a('0x3c')]);return db['MailSubstatus'][_0xa44a('0x44')](_0x4a82aa)['then'](handleEntityNotFound(_0x344fdc,null))['then'](respondWithResult(_0x344fdc,null))[_0xa44a('0x40')](handleError(_0x344fdc,null));};exports[_0xa44a('0x45')]=function(_0x524e7b,_0x2990ba){return db['MailSubstatus'][_0xa44a('0x45')](_0x524e7b[_0xa44a('0x46')],{})[_0xa44a('0x22')](respondWithResult(_0x2990ba,0xc9))[_0xa44a('0x40')](handleError(_0x2990ba,null));};exports[_0xa44a('0x20')]=function(_0x32bcf1,_0xd0e43c){if(_0x32bcf1[_0xa44a('0x46')]['id']){delete _0x32bcf1[_0xa44a('0x46')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x32bcf1[_0xa44a('0x42')]['id']}})[_0xa44a('0x22')](handleEntityNotFound(_0xd0e43c,null))[_0xa44a('0x22')](saveUpdates(_0x32bcf1[_0xa44a('0x46')],null))[_0xa44a('0x22')](respondWithResult(_0xd0e43c,null))[_0xa44a('0x40')](handleError(_0xd0e43c,null));};exports[_0xa44a('0x21')]=function(_0x166fe8,_0x3c9763){return db[_0xa44a('0x26')]['find']({'where':{'id':_0x166fe8[_0xa44a('0x42')]['id']}})[_0xa44a('0x22')](handleEntityNotFound(_0x3c9763,null))[_0xa44a('0x22')](removeEntity(_0x3c9763,null))[_0xa44a('0x40')](handleError(_0x3c9763,null));};exports[_0xa44a('0x47')]=function(_0x29990e,_0x49fcd7){return db[_0xa44a('0x26')][_0xa44a('0x47')]()[_0xa44a('0x22')](respondWithResult(_0x49fcd7,null))[_0xa44a('0x40')](handleError(_0x49fcd7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a80b88c..2ee5961 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 _0x6d12=['hook','exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4f2b8c,_0x4012c8){var _0x1226ae=function(_0x495689){while(--_0x495689){_0x4f2b8c['push'](_0x4f2b8c['shift']());}};_0x1226ae(++_0x4012c8);}(_0x6d12,0x13a));var _0x26d1=function(_0x618bc2,_0x57686f){_0x618bc2=_0x618bc2-0x0;var _0x2fbb1e=_0x6d12[_0x618bc2];return _0x2fbb1e;};'use strict';var EventEmitter=require(_0x26d1('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x26d1('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x26d1('0x2')](0x0);var events={'afterUpdate':_0x26d1('0x3')};function emitEvent(_0x40201a){return function(_0x43f1e1,_0x46d409,_0x207342){MailSubstatusEvents[_0x26d1('0x4')](_0x40201a+':'+_0x43f1e1['id'],_0x43f1e1);MailSubstatusEvents[_0x26d1('0x4')](_0x40201a,_0x43f1e1);_0x207342(null);};}for(var e in events){if(events[_0x26d1('0x5')](e)){var event=events[e];MailSubstatus[_0x26d1('0x6')](e,emitEvent(event));}}module[_0x26d1('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0x64f7=['hook','exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x8ce18a,_0x3db36d){var _0xde4b5d=function(_0x9a9352){while(--_0x9a9352){_0x8ce18a['push'](_0x8ce18a['shift']());}};_0xde4b5d(++_0x3db36d);}(_0x64f7,0x6a));var _0x764f=function(_0x3f3489,_0x182c5b){_0x3f3489=_0x3f3489-0x0;var _0x5a7358=_0x64f7[_0x3f3489];return _0x5a7358;};'use strict';var EventEmitter=require(_0x764f('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x764f('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x764f('0x2')](0x0);var events={'afterUpdate':_0x764f('0x3')};function emitEvent(_0x28f470){return function(_0x4aac62,_0x3697d7,_0x4981f3){MailSubstatusEvents[_0x764f('0x4')](_0x28f470+':'+_0x4aac62['id'],_0x4aac62);MailSubstatusEvents[_0x764f('0x4')](_0x28f470,_0x4aac62);_0x4981f3(null);};}for(var e in events){if(events[_0x764f('0x5')](e)){var event=events[e];MailSubstatus[_0x764f('0x6')](e,emitEvent(event));}}module[_0x764f('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 cbf3b74..8a03f5d 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 _0xb5ee=['mail_substatuses','update','name','mailSubstatus','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0xb5ee,0xeb));var _0xeb5e=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xb5ee[_0x13f980];return _0x27153c;};'use strict';var attributes=require(_0xeb5e('0x0'));module[_0xeb5e('0x1')]=function(_0x5872b7){var _0x4bcc81=_0x5872b7[_0xeb5e('0x2')];return _0x5872b7[_0xeb5e('0x3')](_0xeb5e('0x4'),attributes,{'tableName':_0xeb5e('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5dd817,_0x43a3f3,_0x1a5f2c){return _0x4bcc81['Condition'][_0xeb5e('0x6')]({'value':_0x5dd817[_0xeb5e('0x7')]},{'where':{'field':_0xeb5e('0x8'),'value':_0x5dd817['_previousDataValues'][_0xeb5e('0x7')]}})['then'](function(){_0x1a5f2c();})[_0xeb5e('0x9')](function(_0x8150d7){_0x1a5f2c(_0x8150d7);});}}});}; \ No newline at end of file +var _0x66c8=['update','name','mailSubstatus','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','MailSubstatus','mail_substatuses'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x66c8,0xec));var _0x866c=function(_0x12b13a,_0x425b77){_0x12b13a=_0x12b13a-0x0;var _0x4f3c4a=_0x66c8[_0x12b13a];return _0x4f3c4a;};'use strict';var attributes=require(_0x866c('0x0'));module[_0x866c('0x1')]=function(_0x4be028){var _0x3f70aa=_0x4be028['models'];return _0x4be028['define'](_0x866c('0x2'),attributes,{'tableName':_0x866c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x528e7e,_0x50167b,_0x3480ec){return _0x3f70aa['Condition'][_0x866c('0x4')]({'value':_0x528e7e[_0x866c('0x5')]},{'where':{'field':_0x866c('0x6'),'value':_0x528e7e[_0x866c('0x7')][_0x866c('0x5')]}})[_0x866c('0x8')](function(){_0x3480ec();})[_0x866c('0x9')](function(_0x19283f){_0x3480ec(_0x19283f);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index b764606..58c58a4 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 _0x313a=['MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','MailSubstatus,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x350160,_0x4e245c){var _0x2fdcbd=function(_0x249c6a){while(--_0x249c6a){_0x350160['push'](_0x350160['shift']());}};_0x2fdcbd(++_0x4e245c);}(_0x313a,0x1d9));var _0xa313=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0x313a[_0x35b195];return _0x2433bf;};'use strict';var _=require(_0xa313('0x0'));var util=require(_0xa313('0x1'));var moment=require(_0xa313('0x2'));var BPromise=require(_0xa313('0x3'));var rs=require(_0xa313('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa313('0x5'));var jayson=require(_0xa313('0x6'));var client=jayson['client'][_0xa313('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1fc0fe,_0x5dd232,_0x3a8c5a){return new BPromise(function(_0xe8852b,_0x22a328){return client[_0xa313('0x8')](_0x1fc0fe,_0x3a8c5a)[_0xa313('0x9')](function(_0x239dfd){logger[_0xa313('0xa')]('MailSubstatus,\x20%s,\x20%s',_0x5dd232,_0xa313('0xb'));logger[_0xa313('0xc')](_0xa313('0xd'),_0x5dd232,_0xa313('0xb'),JSON['stringify'](_0x239dfd));if(_0x239dfd[_0xa313('0xe')]){if(_0x239dfd['error'][_0xa313('0xf')]===0x1f4){logger['error'](_0xa313('0x10'),_0x5dd232,_0x239dfd[_0xa313('0xe')][_0xa313('0x11')]);return _0x22a328(_0x239dfd[_0xa313('0xe')][_0xa313('0x11')]);}logger['error'](_0xa313('0x10'),_0x5dd232,_0x239dfd[_0xa313('0xe')]['message']);return _0xe8852b(_0x239dfd[_0xa313('0xe')]['message']);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5dd232,_0xa313('0xb'));_0xe8852b(_0x239dfd['result'][_0xa313('0x11')]);}})['catch'](function(_0xb3a0ec){logger[_0xa313('0xe')](_0xa313('0x10'),_0x5dd232,_0xb3a0ec);_0x22a328(_0xb3a0ec);});});} \ No newline at end of file +var _0x1207=['stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x1207,0x1d5));var _0x7120=function(_0x5d58ad,_0x40ce8a){_0x5d58ad=_0x5d58ad-0x0;var _0x31aaac=_0x1207[_0x5d58ad];return _0x31aaac;};'use strict';var _=require(_0x7120('0x0'));var util=require(_0x7120('0x1'));var moment=require(_0x7120('0x2'));var BPromise=require(_0x7120('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7120('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7120('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7120('0x6'));var jayson=require(_0x7120('0x7'));var client=jayson[_0x7120('0x8')][_0x7120('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a171f,_0x10be57,_0x524e56){return new BPromise(function(_0x39f701,_0x5bfe8b){return client[_0x7120('0xa')](_0x2a171f,_0x524e56)['then'](function(_0x3717e7){logger[_0x7120('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x10be57,_0x7120('0xc'));logger[_0x7120('0xd')](_0x7120('0xe'),_0x10be57,_0x7120('0xc'),JSON[_0x7120('0xf')](_0x3717e7));if(_0x3717e7[_0x7120('0x10')]){if(_0x3717e7[_0x7120('0x10')][_0x7120('0x11')]===0x1f4){logger['error'](_0x7120('0x12'),_0x10be57,_0x3717e7[_0x7120('0x10')]['message']);return _0x5bfe8b(_0x3717e7[_0x7120('0x10')][_0x7120('0x13')]);}logger[_0x7120('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x10be57,_0x3717e7[_0x7120('0x10')][_0x7120('0x13')]);return _0x39f701(_0x3717e7[_0x7120('0x10')][_0x7120('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x10be57,'request\x20sent');_0x39f701(_0x3717e7[_0x7120('0x14')]['message']);}})[_0x7120('0x15')](function(_0x1b7033){logger[_0x7120('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x10be57,_0x1b7033);_0x5bfe8b(_0x1b7033);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2d9305d..1f6920d 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 _0x759c=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','update','delete','/:id','destroy','exports','multer','util'];(function(_0x5cb77d,_0xe98bcd){var _0x4dcecf=function(_0x2e99a0){while(--_0x2e99a0){_0x5cb77d['push'](_0x5cb77d['shift']());}};_0x4dcecf(++_0xe98bcd);}(_0x759c,0x1a2));var _0xc759=function(_0x4fce1b,_0x2b0fb3){_0x4fce1b=_0x4fce1b-0x0;var _0x4c9c5f=_0x759c[_0x4fce1b];return _0x4c9c5f;};'use strict';var multer=require(_0xc759('0x0'));var util=require(_0xc759('0x1'));var path=require('path');var timeout=require(_0xc759('0x2'));var express=require('express');var router=express[_0xc759('0x3')]();var fs_extra=require(_0xc759('0x4'));var auth=require(_0xc759('0x5'));var interaction=require(_0xc759('0x6'));var config=require(_0xc759('0x7'));var controller=require('./mailTransferReport.controller');router[_0xc759('0x8')]('/',auth[_0xc759('0x9')](),controller[_0xc759('0xa')]);router[_0xc759('0x8')](_0xc759('0xb'),auth[_0xc759('0x9')](),controller[_0xc759('0xc')]);router[_0xc759('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc759('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc759('0xe')]);router['put']('/:id',auth[_0xc759('0x9')](),controller[_0xc759('0xf')]);router[_0xc759('0x10')](_0xc759('0x11'),auth[_0xc759('0x9')](),controller[_0xc759('0x12')]);module[_0xc759('0x13')]=router; \ No newline at end of file +var _0xaf5e=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','util','path'];(function(_0x24487f,_0x9b3ea0){var _0x456456=function(_0x2ba373){while(--_0x2ba373){_0x24487f['push'](_0x24487f['shift']());}};_0x456456(++_0x9b3ea0);}(_0xaf5e,0xbb));var _0xeaf5=function(_0x82925f,_0x1dcc50){_0x82925f=_0x82925f-0x0;var _0x34cb4f=_0xaf5e[_0x82925f];return _0x34cb4f;};'use strict';var multer=require('multer');var util=require(_0xeaf5('0x0'));var path=require(_0xeaf5('0x1'));var timeout=require(_0xeaf5('0x2'));var express=require(_0xeaf5('0x3'));var router=express['Router']();var fs_extra=require(_0xeaf5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeaf5('0x5'));var config=require(_0xeaf5('0x6'));var controller=require(_0xeaf5('0x7'));router[_0xeaf5('0x8')]('/',auth[_0xeaf5('0x9')](),controller[_0xeaf5('0xa')]);router['get'](_0xeaf5('0xb'),auth[_0xeaf5('0x9')](),controller[_0xeaf5('0xc')]);router[_0xeaf5('0x8')](_0xeaf5('0xd'),auth['isAuthenticated'](),controller[_0xeaf5('0xe')]);router[_0xeaf5('0xf')]('/',auth['isAuthenticated'](),controller[_0xeaf5('0x10')]);router[_0xeaf5('0x11')](_0xeaf5('0xd'),auth['isAuthenticated'](),controller[_0xeaf5('0x12')]);router[_0xeaf5('0x13')]('/:id',auth[_0xeaf5('0x9')](),controller['destroy']);module[_0xeaf5('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 3077e88..e3a41a8 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5afe0f,_0x4d6fae){var _0x43e9d7=function(_0x240ae9){while(--_0x240ae9){_0x5afe0f['push'](_0x5afe0f['shift']());}};_0x43e9d7(++_0x4d6fae);}(_0xaa88,0x137));var _0x8aa8=function(_0x16051a,_0x5e4326){_0x16051a=_0x16051a-0x0;var _0x35d20d=_0xaa88[_0x16051a];return _0x35d20d;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1755a9,_0x1b0e63){var _0x307035=function(_0x487e09){while(--_0x487e09){_0x1755a9['push'](_0x1755a9['shift']());}};_0x307035(++_0x1b0e63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e4fdc56..67270c6 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 _0x4b87=['keys','include','find','catch','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','MailTransferReport','rawAttributes','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show'];(function(_0x412af1,_0x1b0434){var _0x44d9cf=function(_0x28f71b){while(--_0x28f71b){_0x412af1['push'](_0x412af1['shift']());}};_0x44d9cf(++_0x1b0434);}(_0x4b87,0xee));var _0x74b8=function(_0x2324c5,_0x53b7b0){_0x2324c5=_0x2324c5-0x0;var _0x199446=_0x4b87[_0x2324c5];return _0x199446;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b8('0x0'));var zipdir=require(_0x74b8('0x1'));var jsonpatch=require(_0x74b8('0x2'));var rp=require('request-promise');var moment=require(_0x74b8('0x3'));var BPromise=require(_0x74b8('0x4'));var Mustache=require(_0x74b8('0x5'));var util=require(_0x74b8('0x6'));var path=require(_0x74b8('0x7'));var sox=require(_0x74b8('0x8'));var csv=require(_0x74b8('0x9'));var ejs=require(_0x74b8('0xa'));var fs=require('fs');var fs_extra=require(_0x74b8('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x74b8('0xc'));var jsforce=require(_0x74b8('0xd'));var deskjs=require(_0x74b8('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x74b8('0xf'));var Redis=require(_0x74b8('0x10'));var authService=require(_0x74b8('0x11'));var qs=require(_0x74b8('0x12'));var as=require(_0x74b8('0x13'));var hardwareService=require(_0x74b8('0x14'));var logger=require(_0x74b8('0x15'))(_0x74b8('0x16'));var utils=require(_0x74b8('0x17'));var config=require(_0x74b8('0x18'));var licenseUtil=require(_0x74b8('0x19'));var db=require(_0x74b8('0x1a'))['db'];function respondWithStatusCode(_0x1a6082,_0x25899b){_0x25899b=_0x25899b||0xcc;return function(_0xcecf20){if(_0xcecf20){return _0x1a6082[_0x74b8('0x1b')](_0x25899b);}return _0x1a6082['status'](_0x25899b)['end']();};}function respondWithResult(_0x3d5b2d,_0x416c18){_0x416c18=_0x416c18||0xc8;return function(_0x2f40e8){if(_0x2f40e8){return _0x3d5b2d[_0x74b8('0x1c')](_0x416c18)[_0x74b8('0x1d')](_0x2f40e8);}};}function respondWithFilteredResult(_0x2f6162,_0x6d4d1f){return function(_0x38818c){if(_0x38818c){var _0xbfbb22=typeof _0x6d4d1f[_0x74b8('0x1e')]===_0x74b8('0x1f')&&typeof _0x6d4d1f[_0x74b8('0x20')]===_0x74b8('0x1f');var _0x304771=_0x38818c[_0x74b8('0x21')];var _0x2b17b2=_0xbfbb22?0x0:_0x6d4d1f[_0x74b8('0x1e')];var _0x3de420=_0xbfbb22?_0x38818c[_0x74b8('0x21')]:_0x6d4d1f[_0x74b8('0x1e')]+_0x6d4d1f[_0x74b8('0x20')];var _0x327561;if(_0x3de420>=_0x304771){_0x3de420=_0x304771;_0x327561=0xc8;}else{_0x327561=0xce;}_0x2f6162['status'](_0x327561);return _0x2f6162[_0x74b8('0x22')]('Content-Range',_0x2b17b2+'-'+_0x3de420+'/'+_0x304771)[_0x74b8('0x1d')](_0x38818c);}return null;};}function patchUpdates(_0x202ab9){return function(_0x164813){try{jsonpatch[_0x74b8('0x23')](_0x164813,_0x202ab9,!![]);}catch(_0x3241b9){return BPromise[_0x74b8('0x24')](_0x3241b9);}return _0x164813[_0x74b8('0x25')]();};}function saveUpdates(_0x7d6065,_0x3b379d){return function(_0xa89727){if(_0xa89727){return _0xa89727[_0x74b8('0x26')](_0x7d6065)[_0x74b8('0x27')](function(_0x4f76e7){return _0x4f76e7;});}return null;};}function removeEntity(_0x25fc1e,_0x2c9391){return function(_0x1a44a9){if(_0x1a44a9){return _0x1a44a9[_0x74b8('0x28')]()[_0x74b8('0x27')](function(){_0x25fc1e[_0x74b8('0x1c')](0xcc)[_0x74b8('0x29')]();});}};}function handleEntityNotFound(_0x346a92,_0x205d0c){return function(_0x447e40){if(!_0x447e40){_0x346a92[_0x74b8('0x1b')](0x194);}return _0x447e40;};}function handleError(_0x3dfc5c,_0xce8ba8){_0xce8ba8=_0xce8ba8||0x1f4;return function(_0x478427){logger['error'](_0x478427[_0x74b8('0x2a')]);if(_0x478427[_0x74b8('0x2b')]){delete _0x478427['name'];}_0x3dfc5c[_0x74b8('0x1c')](_0xce8ba8)[_0x74b8('0x2c')](_0x478427);};}exports[_0x74b8('0x2d')]=function(_0x29ec27,_0x18e084){var _0x18e0b1={},_0x5098c4={},_0xf45fd3={'count':0x0,'rows':[]};var _0x4a44b7=_[_0x74b8('0x2e')](db[_0x74b8('0x2f')][_0x74b8('0x30')],function(_0x3b26bc){return{'name':_0x3b26bc['fieldName'],'type':_0x3b26bc['type'][_0x74b8('0x31')]};});_0x5098c4['model']=_[_0x74b8('0x2e')](_0x4a44b7,_0x74b8('0x2b'));_0x5098c4[_0x74b8('0x32')]=_['keys'](_0x29ec27['query']);_0x5098c4[_0x74b8('0x33')]=_['intersection'](_0x5098c4[_0x74b8('0x34')],_0x5098c4[_0x74b8('0x32')]);_0x18e0b1['attributes']=_[_0x74b8('0x35')](_0x5098c4[_0x74b8('0x34')],qs[_0x74b8('0x36')](_0x29ec27[_0x74b8('0x32')]['fields']));_0x18e0b1[_0x74b8('0x37')]=_0x18e0b1[_0x74b8('0x37')][_0x74b8('0x38')]?_0x18e0b1[_0x74b8('0x37')]:_0x5098c4['model'];if(!_0x29ec27[_0x74b8('0x32')][_0x74b8('0x39')]('nolimit')){_0x18e0b1['limit']=qs[_0x74b8('0x20')](_0x29ec27['query']['limit']);_0x18e0b1[_0x74b8('0x1e')]=qs[_0x74b8('0x1e')](_0x29ec27[_0x74b8('0x32')]['offset']);}_0x18e0b1[_0x74b8('0x3a')]=qs['sort'](_0x29ec27[_0x74b8('0x32')][_0x74b8('0x3b')]);_0x18e0b1[_0x74b8('0x3c')]=qs[_0x74b8('0x33')](_[_0x74b8('0x3d')](_0x29ec27[_0x74b8('0x32')],_0x5098c4[_0x74b8('0x33')]),_0x4a44b7);if(_0x29ec27[_0x74b8('0x32')]['filter']){_0x18e0b1[_0x74b8('0x3c')]=_[_0x74b8('0x3e')](_0x18e0b1[_0x74b8('0x3c')],{'$or':_[_0x74b8('0x2e')](_0x4a44b7,function(_0x3ff1c9){if(_0x3ff1c9['type']!==_0x74b8('0x3f')){var _0x4d9694={};_0x4d9694[_0x3ff1c9[_0x74b8('0x2b')]]={'$like':'%'+_0x29ec27[_0x74b8('0x32')][_0x74b8('0x40')]+'%'};return _0x4d9694;}})});}_0x18e0b1=_[_0x74b8('0x3e')]({},_0x18e0b1,_0x29ec27[_0x74b8('0x41')]);var _0x1b74f6={'where':_0x18e0b1[_0x74b8('0x3c')]};return db['MailTransferReport'][_0x74b8('0x21')](_0x1b74f6)[_0x74b8('0x27')](function(_0x1e6005){_0xf45fd3[_0x74b8('0x21')]=_0x1e6005;if(_0x29ec27[_0x74b8('0x32')][_0x74b8('0x42')]){_0x18e0b1['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x74b8('0x43')](_0x18e0b1);})[_0x74b8('0x27')](function(_0x309e78){_0xf45fd3[_0x74b8('0x44')]=_0x309e78;return _0xf45fd3;})[_0x74b8('0x27')](respondWithFilteredResult(_0x18e084,_0x18e0b1))['catch'](handleError(_0x18e084,null));};exports[_0x74b8('0x45')]=function(_0x2d1afb,_0x36daec){var _0x17b1cd={'raw':!![],'where':{'id':_0x2d1afb['params']['id']}},_0x45513e={};_0x45513e[_0x74b8('0x34')]=_[_0x74b8('0x46')](db[_0x74b8('0x2f')][_0x74b8('0x30')]);_0x45513e[_0x74b8('0x32')]=_['keys'](_0x2d1afb['query']);_0x45513e[_0x74b8('0x33')]=_['intersection'](_0x45513e[_0x74b8('0x34')],_0x45513e[_0x74b8('0x32')]);_0x17b1cd[_0x74b8('0x37')]=_['intersection'](_0x45513e[_0x74b8('0x34')],qs[_0x74b8('0x36')](_0x2d1afb[_0x74b8('0x32')][_0x74b8('0x36')]));_0x17b1cd[_0x74b8('0x37')]=_0x17b1cd[_0x74b8('0x37')][_0x74b8('0x38')]?_0x17b1cd[_0x74b8('0x37')]:_0x45513e[_0x74b8('0x34')];if(_0x2d1afb[_0x74b8('0x32')][_0x74b8('0x42')]){_0x17b1cd[_0x74b8('0x47')]=[{'all':!![]}];}_0x17b1cd=_[_0x74b8('0x3e')]({},_0x17b1cd,_0x2d1afb[_0x74b8('0x41')]);return db['MailTransferReport'][_0x74b8('0x48')](_0x17b1cd)[_0x74b8('0x27')](handleEntityNotFound(_0x36daec,null))['then'](respondWithResult(_0x36daec,null))[_0x74b8('0x49')](handleError(_0x36daec,null));};exports['create']=function(_0x467db9,_0x52ca78){return db['MailTransferReport']['create'](_0x467db9[_0x74b8('0x4a')],{})[_0x74b8('0x27')](respondWithResult(_0x52ca78,0xc9))['catch'](handleError(_0x52ca78,null));};exports[_0x74b8('0x26')]=function(_0x53875f,_0x369aba){if(_0x53875f['body']['id']){delete _0x53875f[_0x74b8('0x4a')]['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x53875f[_0x74b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x369aba,null))['then'](saveUpdates(_0x53875f[_0x74b8('0x4a')],null))[_0x74b8('0x27')](respondWithResult(_0x369aba,null))[_0x74b8('0x49')](handleError(_0x369aba,null));};exports[_0x74b8('0x28')]=function(_0x88d7da,_0x76eb9a){return db[_0x74b8('0x2f')][_0x74b8('0x48')]({'where':{'id':_0x88d7da[_0x74b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x76eb9a,null))[_0x74b8('0x27')](removeEntity(_0x76eb9a,null))[_0x74b8('0x49')](handleError(_0x76eb9a,null));};exports[_0x74b8('0x4c')]=function(_0x5291df,_0xfa0ec7){return db[_0x74b8('0x2f')]['describe']()[_0x74b8('0x27')](respondWithResult(_0xfa0ec7,null))[_0x74b8('0x49')](handleError(_0xfa0ec7,null));}; \ No newline at end of file +var _0x45ca=['where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','MailTransferReport','fieldName','type','model','map','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order','sort','pick','filter'];(function(_0x110e9b,_0x7b22be){var _0x434cd7=function(_0x4dd4cd){while(--_0x4dd4cd){_0x110e9b['push'](_0x110e9b['shift']());}};_0x434cd7(++_0x7b22be);}(_0x45ca,0xa6));var _0xa45c=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x45ca[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa45c('0x0'));var zipdir=require(_0xa45c('0x1'));var jsonpatch=require(_0xa45c('0x2'));var rp=require(_0xa45c('0x3'));var moment=require(_0xa45c('0x4'));var BPromise=require(_0xa45c('0x5'));var Mustache=require(_0xa45c('0x6'));var util=require('util');var path=require(_0xa45c('0x7'));var sox=require(_0xa45c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa45c('0x9'));var _=require(_0xa45c('0xa'));var squel=require(_0xa45c('0xb'));var crypto=require(_0xa45c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa45c('0xd'));var toCsv=require(_0xa45c('0xe'));var querystring=require(_0xa45c('0xf'));var Papa=require(_0xa45c('0x10'));var Redis=require(_0xa45c('0x11'));var authService=require(_0xa45c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa45c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa45c('0x14'));var utils=require(_0xa45c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa45c('0x16'));var db=require(_0xa45c('0x17'))['db'];function respondWithStatusCode(_0x43c85d,_0x386806){_0x386806=_0x386806||0xcc;return function(_0x3302f7){if(_0x3302f7){return _0x43c85d[_0xa45c('0x18')](_0x386806);}return _0x43c85d[_0xa45c('0x19')](_0x386806)['end']();};}function respondWithResult(_0x170ab7,_0x23f722){_0x23f722=_0x23f722||0xc8;return function(_0x2826fa){if(_0x2826fa){return _0x170ab7[_0xa45c('0x19')](_0x23f722)[_0xa45c('0x1a')](_0x2826fa);}};}function respondWithFilteredResult(_0x37a411,_0x145a77){return function(_0x24b90f){if(_0x24b90f){var _0x4fabd6=typeof _0x145a77[_0xa45c('0x1b')]===_0xa45c('0x1c')&&typeof _0x145a77[_0xa45c('0x1d')]===_0xa45c('0x1c');var _0x5ac410=_0x24b90f['count'];var _0x30fc04=_0x4fabd6?0x0:_0x145a77[_0xa45c('0x1b')];var _0x390d1a=_0x4fabd6?_0x24b90f['count']:_0x145a77['offset']+_0x145a77['limit'];var _0x4a52e9;if(_0x390d1a>=_0x5ac410){_0x390d1a=_0x5ac410;_0x4a52e9=0xc8;}else{_0x4a52e9=0xce;}_0x37a411[_0xa45c('0x19')](_0x4a52e9);return _0x37a411[_0xa45c('0x1e')](_0xa45c('0x1f'),_0x30fc04+'-'+_0x390d1a+'/'+_0x5ac410)[_0xa45c('0x1a')](_0x24b90f);}return null;};}function patchUpdates(_0x2d8583){return function(_0x5a8b20){try{jsonpatch['apply'](_0x5a8b20,_0x2d8583,!![]);}catch(_0x4281ff){return BPromise['reject'](_0x4281ff);}return _0x5a8b20[_0xa45c('0x20')]();};}function saveUpdates(_0x1b537a,_0x5ecf14){return function(_0x26afea){if(_0x26afea){return _0x26afea[_0xa45c('0x21')](_0x1b537a)['then'](function(_0x8e9d4e){return _0x8e9d4e;});}return null;};}function removeEntity(_0x4bb657,_0x82bc4e){return function(_0x3b4019){if(_0x3b4019){return _0x3b4019[_0xa45c('0x22')]()[_0xa45c('0x23')](function(){_0x4bb657[_0xa45c('0x19')](0xcc)[_0xa45c('0x24')]();});}};}function handleEntityNotFound(_0x53b1f3,_0x446449){return function(_0x4d7d5a){if(!_0x4d7d5a){_0x53b1f3[_0xa45c('0x18')](0x194);}return _0x4d7d5a;};}function handleError(_0x3fb762,_0x5bf7ce){_0x5bf7ce=_0x5bf7ce||0x1f4;return function(_0x59c91e){logger[_0xa45c('0x25')](_0x59c91e[_0xa45c('0x26')]);if(_0x59c91e[_0xa45c('0x27')]){delete _0x59c91e['name'];}_0x3fb762['status'](_0x5bf7ce)[_0xa45c('0x28')](_0x59c91e);};}exports['index']=function(_0x506417,_0x4e894c){var _0x3db067={},_0x451fc1={},_0x3b362f={'count':0x0,'rows':[]};var _0x350a2f=_['map'](db[_0xa45c('0x29')]['rawAttributes'],function(_0x4c3bd7){return{'name':_0x4c3bd7[_0xa45c('0x2a')],'type':_0x4c3bd7[_0xa45c('0x2b')]['key']};});_0x451fc1[_0xa45c('0x2c')]=_[_0xa45c('0x2d')](_0x350a2f,_0xa45c('0x27'));_0x451fc1['query']=_[_0xa45c('0x2e')](_0x506417['query']);_0x451fc1[_0xa45c('0x2f')]=_[_0xa45c('0x30')](_0x451fc1[_0xa45c('0x2c')],_0x451fc1['query']);_0x3db067[_0xa45c('0x31')]=_[_0xa45c('0x30')](_0x451fc1[_0xa45c('0x2c')],qs[_0xa45c('0x32')](_0x506417['query']['fields']));_0x3db067[_0xa45c('0x31')]=_0x3db067[_0xa45c('0x31')][_0xa45c('0x33')]?_0x3db067[_0xa45c('0x31')]:_0x451fc1['model'];if(!_0x506417['query'][_0xa45c('0x34')](_0xa45c('0x35'))){_0x3db067['limit']=qs[_0xa45c('0x1d')](_0x506417[_0xa45c('0x36')][_0xa45c('0x1d')]);_0x3db067[_0xa45c('0x1b')]=qs[_0xa45c('0x1b')](_0x506417[_0xa45c('0x36')][_0xa45c('0x1b')]);}_0x3db067[_0xa45c('0x37')]=qs[_0xa45c('0x38')](_0x506417[_0xa45c('0x36')][_0xa45c('0x38')]);_0x3db067['where']=qs['filters'](_[_0xa45c('0x39')](_0x506417[_0xa45c('0x36')],_0x451fc1[_0xa45c('0x2f')]),_0x350a2f);if(_0x506417['query'][_0xa45c('0x3a')]){_0x3db067[_0xa45c('0x3b')]=_['merge'](_0x3db067[_0xa45c('0x3b')],{'$or':_['map'](_0x350a2f,function(_0x5e4466){if(_0x5e4466[_0xa45c('0x2b')]!==_0xa45c('0x3c')){var _0x33c356={};_0x33c356[_0x5e4466[_0xa45c('0x27')]]={'$like':'%'+_0x506417[_0xa45c('0x36')][_0xa45c('0x3a')]+'%'};return _0x33c356;}})});}_0x3db067=_[_0xa45c('0x3d')]({},_0x3db067,_0x506417[_0xa45c('0x3e')]);var _0x387c49={'where':_0x3db067['where']};return db[_0xa45c('0x29')][_0xa45c('0x3f')](_0x387c49)[_0xa45c('0x23')](function(_0x43df0f){_0x3b362f[_0xa45c('0x3f')]=_0x43df0f;if(_0x506417[_0xa45c('0x36')][_0xa45c('0x40')]){_0x3db067[_0xa45c('0x41')]=[{'all':!![]}];}return db[_0xa45c('0x29')][_0xa45c('0x42')](_0x3db067);})[_0xa45c('0x23')](function(_0xe0c9e7){_0x3b362f[_0xa45c('0x43')]=_0xe0c9e7;return _0x3b362f;})[_0xa45c('0x23')](respondWithFilteredResult(_0x4e894c,_0x3db067))[_0xa45c('0x44')](handleError(_0x4e894c,null));};exports[_0xa45c('0x45')]=function(_0x588c2c,_0x23bb5b){var _0x1d65f0={'raw':!![],'where':{'id':_0x588c2c[_0xa45c('0x46')]['id']}},_0x29fcd1={};_0x29fcd1[_0xa45c('0x2c')]=_[_0xa45c('0x2e')](db[_0xa45c('0x29')]['rawAttributes']);_0x29fcd1[_0xa45c('0x36')]=_['keys'](_0x588c2c[_0xa45c('0x36')]);_0x29fcd1[_0xa45c('0x2f')]=_[_0xa45c('0x30')](_0x29fcd1[_0xa45c('0x2c')],_0x29fcd1['query']);_0x1d65f0[_0xa45c('0x31')]=_[_0xa45c('0x30')](_0x29fcd1[_0xa45c('0x2c')],qs[_0xa45c('0x32')](_0x588c2c[_0xa45c('0x36')][_0xa45c('0x32')]));_0x1d65f0[_0xa45c('0x31')]=_0x1d65f0[_0xa45c('0x31')][_0xa45c('0x33')]?_0x1d65f0[_0xa45c('0x31')]:_0x29fcd1[_0xa45c('0x2c')];if(_0x588c2c['query']['includeAll']){_0x1d65f0[_0xa45c('0x41')]=[{'all':!![]}];}_0x1d65f0=_[_0xa45c('0x3d')]({},_0x1d65f0,_0x588c2c[_0xa45c('0x3e')]);return db[_0xa45c('0x29')][_0xa45c('0x47')](_0x1d65f0)['then'](handleEntityNotFound(_0x23bb5b,null))[_0xa45c('0x23')](respondWithResult(_0x23bb5b,null))[_0xa45c('0x44')](handleError(_0x23bb5b,null));};exports[_0xa45c('0x48')]=function(_0x511609,_0x5872e3){return db[_0xa45c('0x29')][_0xa45c('0x48')](_0x511609[_0xa45c('0x49')],{})[_0xa45c('0x23')](respondWithResult(_0x5872e3,0xc9))[_0xa45c('0x44')](handleError(_0x5872e3,null));};exports[_0xa45c('0x21')]=function(_0x257450,_0x3c2664){if(_0x257450[_0xa45c('0x49')]['id']){delete _0x257450[_0xa45c('0x49')]['id'];}return db[_0xa45c('0x29')]['find']({'where':{'id':_0x257450[_0xa45c('0x46')]['id']}})[_0xa45c('0x23')](handleEntityNotFound(_0x3c2664,null))[_0xa45c('0x23')](saveUpdates(_0x257450[_0xa45c('0x49')],null))[_0xa45c('0x23')](respondWithResult(_0x3c2664,null))[_0xa45c('0x44')](handleError(_0x3c2664,null));};exports[_0xa45c('0x22')]=function(_0x39a54c,_0x33b7dd){return db[_0xa45c('0x29')][_0xa45c('0x47')]({'where':{'id':_0x39a54c['params']['id']}})[_0xa45c('0x23')](handleEntityNotFound(_0x33b7dd,null))[_0xa45c('0x23')](removeEntity(_0x33b7dd,null))[_0xa45c('0x44')](handleError(_0x33b7dd,null));};exports['describe']=function(_0x193044,_0x548220){return db['MailTransferReport'][_0xa45c('0x4a')]()[_0xa45c('0x23')](respondWithResult(_0x548220,null))['catch'](handleError(_0x548220,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 34365b3..f59b75b 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 _0x170f=['exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','path','./mailTransferReport.attributes'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0x170f,0x65));var _0xf170=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x170f[_0x422be2];return _0x1b820e;};'use strict';var _=require(_0xf170('0x0'));var util=require(_0xf170('0x1'));var logger=require(_0xf170('0x2'))(_0xf170('0x3'));var moment=require(_0xf170('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf170('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf170('0x6'));module[_0xf170('0x7')]=function(_0xa54cc,_0x356b1c){return _0xa54cc[_0xf170('0x8')](_0xf170('0x9'),attributes,{'tableName':_0xf170('0xa'),'paranoid':![],'indexes':[{'name':_0xf170('0xb'),'fields':[_0xf170('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c02=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','uniqueid'];(function(_0x4610f6,_0x5fe8c3){var _0x422a4d=function(_0x31f4c8){while(--_0x31f4c8){_0x4610f6['push'](_0x4610f6['shift']());}};_0x422a4d(++_0x5fe8c3);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var logger=require(_0x20c0('0x1'))('api');var moment=require(_0x20c0('0x2'));var BPromise=require(_0x20c0('0x3'));var rp=require(_0x20c0('0x4'));var fs=require('fs');var path=require(_0x20c0('0x5'));var rimraf=require(_0x20c0('0x6'));var config=require(_0x20c0('0x7'));var attributes=require(_0x20c0('0x8'));module[_0x20c0('0x9')]=function(_0x13312d,_0xd25ee8){return _0x13312d['define']('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x20c0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 64268cb..100bc89 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 _0x009e=['ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x37dfab,_0x3ac8f2){var _0x4d23e6=function(_0x300eeb){while(--_0x300eeb){_0x37dfab['push'](_0x37dfab['shift']());}};_0x4d23e6(++_0x3ac8f2);}(_0x009e,0x100));var _0xe009=function(_0xc92947,_0x3799ad){_0xc92947=_0xc92947-0x0;var _0x3c7b5d=_0x009e[_0xc92947];return _0x3c7b5d;};'use strict';var _=require(_0xe009('0x0'));var util=require(_0xe009('0x1'));var moment=require(_0xe009('0x2'));var BPromise=require('bluebird');var rs=require(_0xe009('0x3'));var fs=require('fs');var Redis=require(_0xe009('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe009('0x5'));var logger=require(_0xe009('0x6'))('rpc');var config=require(_0xe009('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe009('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13de8e,_0x38d83e,_0x18c023){return new BPromise(function(_0x58e3ae,_0x51fb5f){return client[_0xe009('0x9')](_0x13de8e,_0x18c023)['then'](function(_0xf37863){logger[_0xe009('0xa')](_0xe009('0xb'),_0x38d83e,'request\x20sent');logger[_0xe009('0xc')](_0xe009('0xd'),_0x38d83e,_0xe009('0xe'),JSON['stringify'](_0xf37863));if(_0xf37863[_0xe009('0xf')]){if(_0xf37863[_0xe009('0xf')][_0xe009('0x10')]===0x1f4){logger[_0xe009('0xf')](_0xe009('0xb'),_0x38d83e,_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);return _0x51fb5f(_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);}logger[_0xe009('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x38d83e,_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);return _0x58e3ae(_0xf37863[_0xe009('0xf')][_0xe009('0x11')]);}else{logger[_0xe009('0xa')](_0xe009('0xb'),_0x38d83e,_0xe009('0xe'));_0x58e3ae(_0xf37863[_0xe009('0x12')][_0xe009('0x11')]);}})[_0xe009('0x13')](function(_0x5608e2){logger['error'](_0xe009('0xb'),_0x38d83e,_0x5608e2);_0x51fb5f(_0x5608e2);});});} \ No newline at end of file +var _0xf873=['message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x28b236,_0x503107){var _0x1a3593=function(_0x1656a0){while(--_0x1656a0){_0x28b236['push'](_0x28b236['shift']());}};_0x1a3593(++_0x503107);}(_0xf873,0x178));var _0x3f87=function(_0x42da1c,_0x3bccac){_0x42da1c=_0x42da1c-0x0;var _0x1936ca=_0xf873[_0x42da1c];return _0x1936ca;};'use strict';var _=require(_0x3f87('0x0'));var util=require('util');var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f87('0x4'))['db'];var utils=require(_0x3f87('0x5'));var logger=require(_0x3f87('0x6'))(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var jayson=require(_0x3f87('0x9'));var client=jayson['client'][_0x3f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532a9f,_0xc53474,_0x14590b){return new BPromise(function(_0x5c6cfd,_0x2b582d){return client[_0x3f87('0xb')](_0x532a9f,_0x14590b)[_0x3f87('0xc')](function(_0x5f0577){logger[_0x3f87('0xd')](_0x3f87('0xe'),_0xc53474,_0x3f87('0xf'));logger[_0x3f87('0x10')](_0x3f87('0x11'),_0xc53474,'request\x20sent',JSON['stringify'](_0x5f0577));if(_0x5f0577[_0x3f87('0x12')]){if(_0x5f0577[_0x3f87('0x12')][_0x3f87('0x13')]===0x1f4){logger[_0x3f87('0x12')](_0x3f87('0xe'),_0xc53474,_0x5f0577['error'][_0x3f87('0x14')]);return _0x2b582d(_0x5f0577[_0x3f87('0x12')][_0x3f87('0x14')]);}logger[_0x3f87('0x12')]('MailTransferReport,\x20%s,\x20%s',_0xc53474,_0x5f0577[_0x3f87('0x12')]['message']);return _0x5c6cfd(_0x5f0577[_0x3f87('0x12')][_0x3f87('0x14')]);}else{logger[_0x3f87('0xd')](_0x3f87('0xe'),_0xc53474,_0x3f87('0xf'));_0x5c6cfd(_0x5f0577['result'][_0x3f87('0x14')]);}})[_0x3f87('0x15')](function(_0x1058fb){logger['error'](_0x3f87('0xe'),_0xc53474,_0x1058fb);_0x2b582d(_0x1058fb);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index c84ea26..8735e7e 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 _0xba25=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xba25,0x14e));var _0x5ba2=function(_0x54edb3,_0x2d1a07){_0x54edb3=_0x54edb3-0x0;var _0x2418b0=_0xba25[_0x54edb3];return _0x2418b0;};'use strict';var multer=require(_0x5ba2('0x0'));var util=require('util');var path=require(_0x5ba2('0x1'));var timeout=require(_0x5ba2('0x2'));var express=require(_0x5ba2('0x3'));var router=express[_0x5ba2('0x4')]();var fs_extra=require(_0x5ba2('0x5'));var auth=require(_0x5ba2('0x6'));var interaction=require(_0x5ba2('0x7'));var config=require(_0x5ba2('0x8'));var controller=require(_0x5ba2('0x9'));router[_0x5ba2('0xa')]('/',auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xc')]);router[_0x5ba2('0xa')](_0x5ba2('0xd'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0xe')]);router[_0x5ba2('0xa')](_0x5ba2('0xf'),auth['isAuthenticated'](),controller[_0x5ba2('0x10')]);router[_0x5ba2('0x11')]('/',auth['isAuthenticated'](),controller[_0x5ba2('0x12')]);router[_0x5ba2('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5ba2('0x14')]);router[_0x5ba2('0x15')](_0x5ba2('0xf'),auth[_0x5ba2('0xb')](),controller[_0x5ba2('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3a7f=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x3a7f,0x100));var _0xf3a7=function(_0x5d5d1b,_0x526518){_0x5d5d1b=_0x5d5d1b-0x0;var _0x3e29dd=_0x3a7f[_0x5d5d1b];return _0x3e29dd;};'use strict';var multer=require('multer');var util=require(_0xf3a7('0x0'));var path=require(_0xf3a7('0x1'));var timeout=require(_0xf3a7('0x2'));var express=require('express');var router=express[_0xf3a7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf3a7('0x4'));var interaction=require(_0xf3a7('0x5'));var config=require('../../config/environment');var controller=require(_0xf3a7('0x6'));router[_0xf3a7('0x7')]('/',auth[_0xf3a7('0x8')](),controller['index']);router[_0xf3a7('0x7')](_0xf3a7('0x9'),auth[_0xf3a7('0x8')](),controller['describe']);router[_0xf3a7('0x7')](_0xf3a7('0xa'),auth[_0xf3a7('0x8')](),controller[_0xf3a7('0xb')]);router[_0xf3a7('0xc')]('/',auth[_0xf3a7('0x8')](),controller[_0xf3a7('0xd')]);router['put']('/:id',auth[_0xf3a7('0x8')](),controller[_0xf3a7('0xe')]);router[_0xf3a7('0xf')](_0xf3a7('0xa'),auth[_0xf3a7('0x8')](),controller[_0xf3a7('0x10')]);module[_0xf3a7('0x11')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 2407d6e..8d1e40e 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 _0x7365=['sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]'];(function(_0x2f0030,_0x3e847c){var _0x3a2279=function(_0x4fcc95){while(--_0x4fcc95){_0x2f0030['push'](_0x2f0030['shift']());}};_0x3a2279(++_0x3e847c);}(_0x7365,0xc0));var _0x5736=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x7365[_0x10e840];return _0x405caa;};'use strict';var Sequelize=require(_0x5736('0x0'));var moment=require('moment');module[_0x5736('0x1')]={'channel':{'type':Sequelize[_0x5736('0x2')]},'membername':{'type':Sequelize[_0x5736('0x2')]},'interface':{'type':Sequelize[_0x5736('0x2')]},'type':{'type':Sequelize[_0x5736('0x2')],'defaultValue':_0x5736('0x3'),'comment':_0x5736('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x5736('0x5')],'set':function(_0x2575df){var _0x341286=moment(_0x2575df);var _0x2ef6c5=moment(this[_0x5736('0x6')]('enterAt'));var _0x5630ea=_0x341286[_0x5736('0x7')](_0x2ef6c5,_0x5736('0x8'));this[_0x5736('0x9')](_0x5736('0xa'),_0x2575df);this[_0x5736('0x9')](_0x5736('0xb'),_0x5630ea>=0x0?_0x5630ea:null);}},'data1':{'type':Sequelize[_0x5736('0x2')],'comment':_0x5736('0xc')},'data2':{'type':Sequelize['STRING'],'comment':_0x5736('0xd')},'data3':{'type':Sequelize[_0x5736('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x5736('0x2')],'comment':_0x5736('0xe')},'data5':{'type':Sequelize[_0x5736('0x2')],'comment':_0x5736('0xf')},'role':{'type':Sequelize[_0x5736('0x2')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x5736('0x2')]}}; \ No newline at end of file +var _0xa2b1=['exitAt','talk:[start]','talk:[queue]','sequelize','moment','exports','STRING','INTEGER','DATE','enterAt','diff','seconds','setDataValue'];(function(_0x5450f4,_0x35e379){var _0x350bec=function(_0x299d8e){while(--_0x299d8e){_0x5450f4['push'](_0x5450f4['shift']());}};_0x350bec(++_0x35e379);}(_0xa2b1,0x1ca));var _0x1a2b=function(_0x17345c,_0x513597){_0x17345c=_0x17345c-0x0;var _0x459170=_0xa2b1[_0x17345c];return _0x459170;};'use strict';var Sequelize=require(_0x1a2b('0x0'));var moment=require(_0x1a2b('0x1'));module[_0x1a2b('0x2')]={'channel':{'type':Sequelize[_0x1a2b('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x1a2b('0x3')]},'type':{'type':Sequelize[_0x1a2b('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x1a2b('0x4')]},'enterAt':{'type':Sequelize[_0x1a2b('0x5')]},'exitAt':{'type':Sequelize[_0x1a2b('0x5')],'set':function(_0x5bb83f){var _0x3fc1b1=moment(_0x5bb83f);var _0x401277=moment(this['getDataValue'](_0x1a2b('0x6')));var _0x3154ce=_0x3fc1b1[_0x1a2b('0x7')](_0x401277,_0x1a2b('0x8'));this[_0x1a2b('0x9')](_0x1a2b('0xa'),_0x5bb83f);this[_0x1a2b('0x9')]('duration',_0x3154ce>=0x0?_0x3154ce:null);}},'data1':{'type':Sequelize[_0x1a2b('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0x1a2b('0xb')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x1a2b('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x1a2b('0xc')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1fa1ae0..86bc7e7 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(_0x256455,_0x386945){var _0x4b3825=function(_0x1699ea){while(--_0x1699ea){_0x256455['push'](_0x256455['shift']());}};_0x4b3825(++_0x386945);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 _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(_0x3d309c,_0x242f4c){var _0x241187=function(_0x594990){while(--_0x594990){_0x3d309c['push'](_0x3d309c['shift']());}};_0x241187(++_0x242f4c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 5d4f335..04f94a3 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 _0x4677=['exports','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes'];(function(_0x2950c3,_0x395e2c){var _0x1f190f=function(_0x150abd){while(--_0x150abd){_0x2950c3['push'](_0x2950c3['shift']());}};_0x1f190f(++_0x395e2c);}(_0x4677,0x105));var _0x7467=function(_0x13c30e,_0x549e78){_0x13c30e=_0x13c30e-0x0;var _0xbefca5=_0x4677[_0x13c30e];return _0xbefca5;};'use strict';var _=require(_0x7467('0x0'));var util=require(_0x7467('0x1'));var logger=require(_0x7467('0x2'))(_0x7467('0x3'));var moment=require(_0x7467('0x4'));var BPromise=require(_0x7467('0x5'));var rp=require(_0x7467('0x6'));var fs=require('fs');var path=require(_0x7467('0x7'));var rimraf=require(_0x7467('0x8'));var config=require(_0x7467('0x9'));var attributes=require(_0x7467('0xa'));module[_0x7467('0xb')]=function(_0x22af71,_0xf8b5c0){return _0x22af71['define'](_0x7467('0xc'),attributes,{'tableName':_0x7467('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x7467('0xe'),_0x7467('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8be8=['define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes'];(function(_0x429a91,_0x32d073){var _0x2d7238=function(_0x10e1ed){while(--_0x10e1ed){_0x429a91['push'](_0x429a91['shift']());}};_0x2d7238(++_0x32d073);}(_0x8be8,0xf6));var _0x88be=function(_0x2d2856,_0xc3a061){_0x2d2856=_0x2d2856-0x0;var _0x15d911=_0x8be8[_0x2d2856];return _0x15d911;};'use strict';var _=require(_0x88be('0x0'));var util=require(_0x88be('0x1'));var logger=require(_0x88be('0x2'))(_0x88be('0x3'));var moment=require(_0x88be('0x4'));var BPromise=require(_0x88be('0x5'));var rp=require(_0x88be('0x6'));var fs=require('fs');var path=require(_0x88be('0x7'));var rimraf=require(_0x88be('0x8'));var config=require('../../config/environment');var attributes=require(_0x88be('0x9'));module['exports']=function(_0xc7c5,_0x57da87){return _0xc7c5[_0x88be('0xa')](_0x88be('0xb'),attributes,{'tableName':_0x88be('0xc'),'paranoid':![],'indexes':[{'name':_0x88be('0xd'),'fields':[_0x88be('0xe'),_0x88be('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 29606ce..f407aea 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 _0xaaee=['then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MemberReport','findAll','options','raw','where','include','map','model','attributes','GetMemberReport','create','CreateMemberReport','UpdateMemberReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x389d67,_0x593234){var _0x3bafb2=function(_0x25e87b){while(--_0x25e87b){_0x389d67['push'](_0x389d67['shift']());}};_0x3bafb2(++_0x593234);}(_0xaaee,0x132));var _0xeaae=function(_0xd32417,_0x2f2725){_0xd32417=_0xd32417-0x0;var _0xd9e691=_0xaaee[_0xd32417];return _0xd9e691;};'use strict';var _=require(_0xeaae('0x0'));var util=require(_0xeaae('0x1'));var moment=require(_0xeaae('0x2'));var BPromise=require(_0xeaae('0x3'));var rs=require(_0xeaae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaae('0x5'))['db'];var utils=require(_0xeaae('0x6'));var logger=require(_0xeaae('0x7'))(_0xeaae('0x8'));var config=require(_0xeaae('0x9'));var jayson=require(_0xeaae('0xa'));var client=jayson[_0xeaae('0xb')][_0xeaae('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x113fa9,_0x13023a,_0x33afb9){return new BPromise(function(_0x1ad467,_0x5072b9){return client[_0xeaae('0xd')](_0x113fa9,_0x33afb9)[_0xeaae('0xe')](function(_0x58f501){logger[_0xeaae('0xf')](_0xeaae('0x10'),_0x13023a,_0xeaae('0x11'));logger[_0xeaae('0x12')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x13023a,'request\x20sent',JSON[_0xeaae('0x13')](_0x58f501));if(_0x58f501[_0xeaae('0x14')]){if(_0x58f501['error'][_0xeaae('0x15')]===0x1f4){logger[_0xeaae('0x14')](_0xeaae('0x10'),_0x13023a,_0x58f501[_0xeaae('0x14')]['message']);return _0x5072b9(_0x58f501[_0xeaae('0x14')]['message']);}logger[_0xeaae('0x14')](_0xeaae('0x10'),_0x13023a,_0x58f501[_0xeaae('0x14')][_0xeaae('0x16')]);return _0x1ad467(_0x58f501[_0xeaae('0x14')][_0xeaae('0x16')]);}else{logger[_0xeaae('0xf')](_0xeaae('0x10'),_0x13023a,_0xeaae('0x11'));_0x1ad467(_0x58f501[_0xeaae('0x17')][_0xeaae('0x16')]);}})[_0xeaae('0x18')](function(_0x8bc041){logger['error'](_0xeaae('0x10'),_0x13023a,_0x8bc041);_0x5072b9(_0x8bc041);});});}exports['GetMemberReport']=function(_0x3ace1f){var _0x10b6bf=this;return new Promise(function(_0x2b4fd3,_0x3220c0){return db[_0xeaae('0x19')][_0xeaae('0x1a')]({'raw':_0x3ace1f[_0xeaae('0x1b')]?_0x3ace1f['options'][_0xeaae('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ace1f[_0xeaae('0x1b')]?_0x3ace1f[_0xeaae('0x1b')][_0xeaae('0x1d')]||null:null,'attributes':_0x3ace1f[_0xeaae('0x1b')]?_0x3ace1f[_0xeaae('0x1b')]['attributes']||null:null,'limit':_0x3ace1f[_0xeaae('0x1b')]?_0x3ace1f[_0xeaae('0x1b')]['limit']||null:null,'include':_0x3ace1f[_0xeaae('0x1b')]?_0x3ace1f['options'][_0xeaae('0x1e')]?_[_0xeaae('0x1f')](_0x3ace1f[_0xeaae('0x1b')][_0xeaae('0x1e')],function(_0x5970df){return{'model':db[_0x5970df[_0xeaae('0x20')]],'as':_0x5970df['as'],'attributes':_0x5970df[_0xeaae('0x21')],'include':_0x5970df[_0xeaae('0x1e')]?_['map'](_0x5970df['include'],function(_0x4129ed){return{'model':db[_0x4129ed[_0xeaae('0x20')]],'as':_0x4129ed['as'],'attributes':_0x4129ed[_0xeaae('0x21')],'include':_0x4129ed[_0xeaae('0x1e')]?_[_0xeaae('0x1f')](_0x4129ed['include'],function(_0x162311){return{'model':db[_0x162311[_0xeaae('0x20')]],'as':_0x162311['as'],'attributes':_0x162311['attributes']};}):[]};}):[]};}):[]:[]})[_0xeaae('0xe')](function(_0x3bd47a){logger[_0xeaae('0xf')](_0xeaae('0x22'),_0x3ace1f);logger['debug'](_0xeaae('0x22'),_0x3ace1f,JSON[_0xeaae('0x13')](_0x3bd47a));_0x2b4fd3(_0x3bd47a);})[_0xeaae('0x18')](function(_0x4db82c){logger[_0xeaae('0x14')](_0xeaae('0x22'),_0x4db82c[_0xeaae('0x16')],_0x3ace1f);_0x3220c0(_0x10b6bf[_0xeaae('0x14')](0x1f4,_0x4db82c[_0xeaae('0x16')]));});});};exports['CreateMemberReport']=function(_0x1a9967){var _0x3b73fa=this;return new Promise(function(_0x516289,_0x2f23c2){return db['MemberReport'][_0xeaae('0x23')](_0x1a9967['body'],{'raw':_0x1a9967[_0xeaae('0x1b')]?_0x1a9967[_0xeaae('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xeaae('0xe')](function(_0x2bd911){logger[_0xeaae('0xf')](_0xeaae('0x24'),_0x1a9967);logger['debug'](_0xeaae('0x24'),_0x1a9967,JSON[_0xeaae('0x13')](_0x2bd911));_0x516289(_0x2bd911);})['catch'](function(_0x58846b){logger[_0xeaae('0x14')](_0xeaae('0x24'),_0x58846b[_0xeaae('0x16')],_0x1a9967);_0x2f23c2(_0x3b73fa['error'](0x1f4,_0x58846b[_0xeaae('0x16')]));});});};exports[_0xeaae('0x25')]=function(_0x221bd4){var _0x2827a6=this;return new Promise(function(_0x436a94,_0x26f417){return db['MemberReport'][_0xeaae('0x26')](_0x221bd4['body'],{'raw':_0x221bd4[_0xeaae('0x1b')]?_0x221bd4[_0xeaae('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x221bd4[_0xeaae('0x1b')]?_0x221bd4[_0xeaae('0x1b')][_0xeaae('0x1d')]||null:null,'attributes':_0x221bd4['options']?_0x221bd4[_0xeaae('0x1b')][_0xeaae('0x21')]||null:null,'limit':_0x221bd4[_0xeaae('0x1b')]?_0x221bd4[_0xeaae('0x1b')][_0xeaae('0x27')]||null:null})[_0xeaae('0xe')](function(_0x460da9){logger['info'](_0xeaae('0x25'),_0x221bd4);logger[_0xeaae('0x12')](_0xeaae('0x25'),_0x221bd4,JSON[_0xeaae('0x13')](_0x460da9));_0x436a94(_0x460da9);})[_0xeaae('0x18')](function(_0x390055){logger['error']('UpdateMemberReport',_0x390055[_0xeaae('0x16')],_0x221bd4);_0x26f417(_0x2827a6[_0xeaae('0x14')](0x1f4,_0x390055[_0xeaae('0x16')]));});});}; \ No newline at end of file +var _0x3714=['rpc','jayson/promise','http','request','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','then','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2af303,_0x13de4d){var _0x363b73=function(_0x166b2e){while(--_0x166b2e){_0x2af303['push'](_0x2af303['shift']());}};_0x363b73(++_0x13de4d);}(_0x3714,0x95));var _0x4371=function(_0x56a8a3,_0x2ce5fc){_0x56a8a3=_0x56a8a3-0x0;var _0x29264c=_0x3714[_0x56a8a3];return _0x29264c;};'use strict';var _=require(_0x4371('0x0'));var util=require(_0x4371('0x1'));var moment=require('moment');var BPromise=require(_0x4371('0x2'));var rs=require(_0x4371('0x3'));var fs=require('fs');var Redis=require(_0x4371('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4371('0x5'));var logger=require(_0x4371('0x6'))(_0x4371('0x7'));var config=require('../../config/environment');var jayson=require(_0x4371('0x8'));var client=jayson['client'][_0x4371('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2280c1,_0x49778e,_0x31a32f){return new BPromise(function(_0x37af33,_0x43a2b4){return client[_0x4371('0xa')](_0x2280c1,_0x31a32f)['then'](function(_0x21fad3){logger['info'](_0x4371('0xb'),_0x49778e,_0x4371('0xc'));logger[_0x4371('0xd')](_0x4371('0xe'),_0x49778e,'request\x20sent',JSON[_0x4371('0xf')](_0x21fad3));if(_0x21fad3[_0x4371('0x10')]){if(_0x21fad3['error'][_0x4371('0x11')]===0x1f4){logger[_0x4371('0x10')](_0x4371('0xb'),_0x49778e,_0x21fad3[_0x4371('0x10')][_0x4371('0x12')]);return _0x43a2b4(_0x21fad3[_0x4371('0x10')][_0x4371('0x12')]);}logger[_0x4371('0x10')](_0x4371('0xb'),_0x49778e,_0x21fad3[_0x4371('0x10')][_0x4371('0x12')]);return _0x37af33(_0x21fad3['error'][_0x4371('0x12')]);}else{logger[_0x4371('0x13')](_0x4371('0xb'),_0x49778e,'request\x20sent');_0x37af33(_0x21fad3[_0x4371('0x14')][_0x4371('0x12')]);}})[_0x4371('0x15')](function(_0xa229c4){logger[_0x4371('0x10')](_0x4371('0xb'),_0x49778e,_0xa229c4);_0x43a2b4(_0xa229c4);});});}exports[_0x4371('0x16')]=function(_0x12dc62){var _0x305242=this;return new Promise(function(_0x278bb3,_0x28680a){return db[_0x4371('0x17')][_0x4371('0x18')]({'raw':_0x12dc62['options']?_0x12dc62[_0x4371('0x19')][_0x4371('0x1a')]===undefined?!![]:![]:!![],'where':_0x12dc62[_0x4371('0x19')]?_0x12dc62[_0x4371('0x19')][_0x4371('0x1b')]||null:null,'attributes':_0x12dc62['options']?_0x12dc62['options']['attributes']||null:null,'limit':_0x12dc62[_0x4371('0x19')]?_0x12dc62['options'][_0x4371('0x1c')]||null:null,'include':_0x12dc62[_0x4371('0x19')]?_0x12dc62[_0x4371('0x19')][_0x4371('0x1d')]?_[_0x4371('0x1e')](_0x12dc62[_0x4371('0x19')][_0x4371('0x1d')],function(_0x345d87){return{'model':db[_0x345d87[_0x4371('0x1f')]],'as':_0x345d87['as'],'attributes':_0x345d87[_0x4371('0x20')],'include':_0x345d87[_0x4371('0x1d')]?_[_0x4371('0x1e')](_0x345d87[_0x4371('0x1d')],function(_0x3819d0){return{'model':db[_0x3819d0[_0x4371('0x1f')]],'as':_0x3819d0['as'],'attributes':_0x3819d0['attributes'],'include':_0x3819d0[_0x4371('0x1d')]?_['map'](_0x3819d0[_0x4371('0x1d')],function(_0x2ab6c8){return{'model':db[_0x2ab6c8[_0x4371('0x1f')]],'as':_0x2ab6c8['as'],'attributes':_0x2ab6c8[_0x4371('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4371('0x21')](function(_0x342133){logger['info']('GetMemberReport',_0x12dc62);logger[_0x4371('0xd')](_0x4371('0x16'),_0x12dc62,JSON['stringify'](_0x342133));_0x278bb3(_0x342133);})[_0x4371('0x15')](function(_0x3fad2c){logger[_0x4371('0x10')](_0x4371('0x16'),_0x3fad2c[_0x4371('0x12')],_0x12dc62);_0x28680a(_0x305242[_0x4371('0x10')](0x1f4,_0x3fad2c[_0x4371('0x12')]));});});};exports[_0x4371('0x22')]=function(_0x33700b){var _0x1e2563=this;return new Promise(function(_0x41d6b7,_0x85e9c7){return db['MemberReport'][_0x4371('0x23')](_0x33700b[_0x4371('0x24')],{'raw':_0x33700b[_0x4371('0x19')]?_0x33700b['options']['raw']===undefined?!![]:![]:!![]})[_0x4371('0x21')](function(_0x5d6d9d){logger[_0x4371('0x13')](_0x4371('0x22'),_0x33700b);logger[_0x4371('0xd')](_0x4371('0x22'),_0x33700b,JSON[_0x4371('0xf')](_0x5d6d9d));_0x41d6b7(_0x5d6d9d);})[_0x4371('0x15')](function(_0x373530){logger[_0x4371('0x10')]('CreateMemberReport',_0x373530[_0x4371('0x12')],_0x33700b);_0x85e9c7(_0x1e2563[_0x4371('0x10')](0x1f4,_0x373530[_0x4371('0x12')]));});});};exports[_0x4371('0x25')]=function(_0x5079ad){var _0x332178=this;return new Promise(function(_0x514e68,_0x43cea1){return db[_0x4371('0x17')][_0x4371('0x26')](_0x5079ad['body'],{'raw':_0x5079ad[_0x4371('0x19')]?_0x5079ad['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5079ad['options']?_0x5079ad[_0x4371('0x19')][_0x4371('0x1b')]||null:null,'attributes':_0x5079ad['options']?_0x5079ad[_0x4371('0x19')][_0x4371('0x20')]||null:null,'limit':_0x5079ad['options']?_0x5079ad[_0x4371('0x19')]['limit']||null:null})[_0x4371('0x21')](function(_0x3ed88d){logger['info'](_0x4371('0x25'),_0x5079ad);logger[_0x4371('0xd')](_0x4371('0x25'),_0x5079ad,JSON[_0x4371('0xf')](_0x3ed88d));_0x514e68(_0x3ed88d);})[_0x4371('0x15')](function(_0x1ce699){logger['error'](_0x4371('0x25'),_0x1ce699[_0x4371('0x12')],_0x5079ad);_0x43cea1(_0x332178[_0x4371('0x10')](0x1f4,_0x1ce699[_0x4371('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d23b3d0..d4d19a9 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 _0xa75b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','index','path'];(function(_0x1c35b4,_0x3d2d9e){var _0x58f7a8=function(_0x2b0acd){while(--_0x2b0acd){_0x1c35b4['push'](_0x1c35b4['shift']());}};_0x58f7a8(++_0x3d2d9e);}(_0xa75b,0x1c1));var _0xba75=function(_0xcf313c,_0x5f1dfc){_0xcf313c=_0xcf313c-0x0;var _0x3a3e10=_0xa75b[_0xcf313c];return _0x3a3e10;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xba75('0x0'));var timeout=require(_0xba75('0x1'));var express=require('express');var router=express[_0xba75('0x2')]();var fs_extra=require(_0xba75('0x3'));var auth=require(_0xba75('0x4'));var interaction=require(_0xba75('0x5'));var config=require('../../config/environment');var controller=require(_0xba75('0x6'));router[_0xba75('0x7')]('/',controller[_0xba75('0x8')]);module['exports']=router; \ No newline at end of file +var _0x3a29=['./migration.controller','get','index','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3a2d20,_0x5e9ef5){var _0x38cd15=function(_0x4c7265){while(--_0x4c7265){_0x3a2d20['push'](_0x3a2d20['shift']());}};_0x38cd15(++_0x5e9ef5);}(_0x3a29,0x101));var _0x93a2=function(_0x18247f,_0xc44592){_0x18247f=_0x18247f-0x0;var _0x3ce1c2=_0x3a29[_0x18247f];return _0x3ce1c2;};'use strict';var multer=require(_0x93a2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x93a2('0x1'));var express=require(_0x93a2('0x2'));var router=express[_0x93a2('0x3')]();var fs_extra=require(_0x93a2('0x4'));var auth=require(_0x93a2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x93a2('0x6'));var controller=require(_0x93a2('0x7'));router[_0x93a2('0x8')]('/',controller[_0x93a2('0x9')]);module[_0x93a2('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index e8c78ce..9d17e1d 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 _0x8d41=['STRING','version','sequelize','exports'];(function(_0x22bb8b,_0x1c8a4d){var _0x46aac7=function(_0x3a1f9b){while(--_0x3a1f9b){_0x22bb8b['push'](_0x22bb8b['shift']());}};_0x46aac7(++_0x1c8a4d);}(_0x8d41,0xfe));var _0x18d4=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x8d41[_0x35c97a];return _0x388917;};'use strict';var Sequelize=require(_0x18d4('0x0'));module[_0x18d4('0x1')]={'version':{'type':Sequelize[_0x18d4('0x2')],'unique':_0x18d4('0x3')}}; \ No newline at end of file +var _0x99ce=['version','exports','STRING'];(function(_0x5ed5b8,_0x102ba2){var _0xf6d271=function(_0x14cde4){while(--_0x14cde4){_0x5ed5b8['push'](_0x5ed5b8['shift']());}};_0xf6d271(++_0x102ba2);}(_0x99ce,0x1e1));var _0xe99c=function(_0x20cc1e,_0x326ed6){_0x20cc1e=_0x20cc1e-0x0;var _0x3c967b=_0x99ce[_0x20cc1e];return _0x3c967b;};'use strict';var Sequelize=require('sequelize');module[_0xe99c('0x0')]={'version':{'type':Sequelize[_0xe99c('0x1')],'unique':_0xe99c('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index c11cac3..d7caa00 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 _0x0a5c=['../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','Migration','rows','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x66dd2a,_0x3a7420){var _0x3924ec=function(_0x74d620){while(--_0x74d620){_0x66dd2a['push'](_0x66dd2a['shift']());}};_0x3924ec(++_0x3a7420);}(_0x0a5c,0x1b3));var _0xc0a5=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x0a5c[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0xc0a5('0x0'));var rimraf=require(_0xc0a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc0a5('0x2'));var rp=require('request-promise');var moment=require(_0xc0a5('0x3'));var BPromise=require(_0xc0a5('0x4'));var Mustache=require('mustache');var util=require(_0xc0a5('0x5'));var path=require(_0xc0a5('0x6'));var sox=require('sox');var csv=require(_0xc0a5('0x7'));var ejs=require(_0xc0a5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0a5('0x9'));var squel=require(_0xc0a5('0xa'));var crypto=require('crypto');var jsforce=require(_0xc0a5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc0a5('0x7'));var querystring=require(_0xc0a5('0xc'));var Papa=require(_0xc0a5('0xd'));var Redis=require(_0xc0a5('0xe'));var authService=require(_0xc0a5('0xf'));var qs=require(_0xc0a5('0x10'));var as=require(_0xc0a5('0x11'));var hardwareService=require(_0xc0a5('0x12'));var logger=require('../../config/logger')(_0xc0a5('0x13'));var utils=require('../../config/utils');var config=require(_0xc0a5('0x14'));var licenseUtil=require(_0xc0a5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bd551,_0x48a61a){_0x48a61a=_0x48a61a||0xcc;return function(_0x91d4ec){if(_0x91d4ec){return _0x1bd551[_0xc0a5('0x16')](_0x48a61a);}return _0x1bd551[_0xc0a5('0x17')](_0x48a61a)[_0xc0a5('0x18')]();};}function respondWithResult(_0x100505,_0x1005ee){_0x1005ee=_0x1005ee||0xc8;return function(_0x546eaf){if(_0x546eaf){return _0x100505[_0xc0a5('0x17')](_0x1005ee)[_0xc0a5('0x19')](_0x546eaf);}};}function respondWithFilteredResult(_0x3690b4,_0x31a047){return function(_0x329dfb){if(_0x329dfb){var _0x896024=typeof _0x31a047[_0xc0a5('0x1a')]===_0xc0a5('0x1b')&&typeof _0x31a047['limit']===_0xc0a5('0x1b');var _0x2e8a06=_0x329dfb[_0xc0a5('0x1c')];var _0x9754a5=_0x896024?0x0:_0x31a047['offset'];var _0x26a8c7=_0x896024?_0x329dfb[_0xc0a5('0x1c')]:_0x31a047['offset']+_0x31a047[_0xc0a5('0x1d')];var _0x420d67;if(_0x26a8c7>=_0x2e8a06){_0x26a8c7=_0x2e8a06;_0x420d67=0xc8;}else{_0x420d67=0xce;}_0x3690b4[_0xc0a5('0x17')](_0x420d67);return _0x3690b4[_0xc0a5('0x1e')](_0xc0a5('0x1f'),_0x9754a5+'-'+_0x26a8c7+'/'+_0x2e8a06)[_0xc0a5('0x19')](_0x329dfb);}return null;};}function patchUpdates(_0x1d50b3){return function(_0x471f11){try{jsonpatch['apply'](_0x471f11,_0x1d50b3,!![]);}catch(_0x329c1f){return BPromise[_0xc0a5('0x20')](_0x329c1f);}return _0x471f11['save']();};}function saveUpdates(_0x16e1fd,_0x222e06){return function(_0x2fef1a){if(_0x2fef1a){return _0x2fef1a['update'](_0x16e1fd)[_0xc0a5('0x21')](function(_0x58fd15){return _0x58fd15;});}return null;};}function removeEntity(_0x289578,_0x117219){return function(_0x5905af){if(_0x5905af){return _0x5905af[_0xc0a5('0x22')]()[_0xc0a5('0x21')](function(){_0x289578['status'](0xcc)[_0xc0a5('0x18')]();});}};}function handleEntityNotFound(_0x51f927,_0x41be0a){return function(_0x3599a2){if(!_0x3599a2){_0x51f927[_0xc0a5('0x16')](0x194);}return _0x3599a2;};}function handleError(_0x253f7b,_0x4b5586){_0x4b5586=_0x4b5586||0x1f4;return function(_0x61007){logger[_0xc0a5('0x23')](_0x61007[_0xc0a5('0x24')]);if(_0x61007[_0xc0a5('0x25')]){delete _0x61007[_0xc0a5('0x25')];}_0x253f7b['status'](_0x4b5586)[_0xc0a5('0x26')](_0x61007);};}exports[_0xc0a5('0x27')]=function(_0x512b6b,_0x3e13c2){var _0x31ef91={},_0x1c7f67={},_0x32ba67={'count':0x0,'rows':[]};var _0xeaaff5=_[_0xc0a5('0x28')](db['Migration'][_0xc0a5('0x29')],function(_0xf3888){return{'name':_0xf3888['fieldName'],'type':_0xf3888[_0xc0a5('0x2a')][_0xc0a5('0x2b')]};});_0x1c7f67[_0xc0a5('0x2c')]=_[_0xc0a5('0x28')](_0xeaaff5,_0xc0a5('0x25'));_0x1c7f67[_0xc0a5('0x2d')]=_['keys'](_0x512b6b[_0xc0a5('0x2d')]);_0x1c7f67['filters']=_[_0xc0a5('0x2e')](_0x1c7f67[_0xc0a5('0x2c')],_0x1c7f67[_0xc0a5('0x2d')]);_0x31ef91['attributes']=_[_0xc0a5('0x2e')](_0x1c7f67[_0xc0a5('0x2c')],qs[_0xc0a5('0x2f')](_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x2f')]));_0x31ef91[_0xc0a5('0x30')]=_0x31ef91[_0xc0a5('0x30')][_0xc0a5('0x31')]?_0x31ef91[_0xc0a5('0x30')]:_0x1c7f67[_0xc0a5('0x2c')];if(!_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x32')]('nolimit')){_0x31ef91[_0xc0a5('0x1d')]=qs[_0xc0a5('0x1d')](_0x512b6b['query'][_0xc0a5('0x1d')]);_0x31ef91[_0xc0a5('0x1a')]=qs[_0xc0a5('0x1a')](_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x1a')]);}_0x31ef91[_0xc0a5('0x33')]=qs[_0xc0a5('0x34')](_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x34')]);_0x31ef91[_0xc0a5('0x35')]=qs[_0xc0a5('0x36')](_[_0xc0a5('0x37')](_0x512b6b[_0xc0a5('0x2d')],_0x1c7f67[_0xc0a5('0x36')]),_0xeaaff5);if(_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x38')]){_0x31ef91['where']=_[_0xc0a5('0x39')](_0x31ef91['where'],{'$or':_['map'](_0xeaaff5,function(_0x496203){if(_0x496203[_0xc0a5('0x2a')]!==_0xc0a5('0x3a')){var _0x1a1d43={};_0x1a1d43[_0x496203[_0xc0a5('0x25')]]={'$like':'%'+_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x38')]+'%'};return _0x1a1d43;}})});}_0x31ef91=_[_0xc0a5('0x39')]({},_0x31ef91,_0x512b6b[_0xc0a5('0x3b')]);var _0x5dc31e={'where':_0x31ef91['where']};return db['Migration'][_0xc0a5('0x1c')](_0x5dc31e)[_0xc0a5('0x21')](function(_0x4ed364){_0x32ba67[_0xc0a5('0x1c')]=_0x4ed364;if(_0x512b6b[_0xc0a5('0x2d')][_0xc0a5('0x3c')]){_0x31ef91[_0xc0a5('0x3d')]=[{'all':!![]}];}return db[_0xc0a5('0x3e')]['findAll'](_0x31ef91);})[_0xc0a5('0x21')](function(_0x5b80e9){_0x32ba67[_0xc0a5('0x3f')]=_0x5b80e9;return _0x32ba67;})[_0xc0a5('0x21')](respondWithFilteredResult(_0x3e13c2,_0x31ef91))[_0xc0a5('0x40')](handleError(_0x3e13c2,null));}; \ No newline at end of file +var _0x011c=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','update','then','destroy','stack','name','index','map','Migration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils'];(function(_0x2845d7,_0xd09cb1){var _0x147181=function(_0x5c3b4a){while(--_0x5c3b4a){_0x2845d7['push'](_0x2845d7['shift']());}};_0x147181(++_0xd09cb1);}(_0x011c,0xea));var _0xc011=function(_0x36a723,_0x309f5f){_0x36a723=_0x36a723-0x0;var _0x40257a=_0x011c[_0x36a723];return _0x40257a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc011('0x0'));var zipdir=require(_0xc011('0x1'));var jsonpatch=require(_0xc011('0x2'));var rp=require(_0xc011('0x3'));var moment=require(_0xc011('0x4'));var BPromise=require(_0xc011('0x5'));var Mustache=require(_0xc011('0x6'));var util=require(_0xc011('0x7'));var path=require(_0xc011('0x8'));var sox=require(_0xc011('0x9'));var csv=require(_0xc011('0xa'));var ejs=require(_0xc011('0xb'));var fs=require('fs');var fs_extra=require(_0xc011('0xc'));var _=require(_0xc011('0xd'));var squel=require(_0xc011('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc011('0xa'));var querystring=require(_0xc011('0xf'));var Papa=require(_0xc011('0x10'));var Redis=require(_0xc011('0x11'));var authService=require(_0xc011('0x12'));var qs=require(_0xc011('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc011('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc011('0x15'));var config=require(_0xc011('0x16'));var licenseUtil=require(_0xc011('0x17'));var db=require(_0xc011('0x18'))['db'];function respondWithStatusCode(_0x1e17fa,_0x4b02fa){_0x4b02fa=_0x4b02fa||0xcc;return function(_0xf65a1){if(_0xf65a1){return _0x1e17fa[_0xc011('0x19')](_0x4b02fa);}return _0x1e17fa[_0xc011('0x1a')](_0x4b02fa)[_0xc011('0x1b')]();};}function respondWithResult(_0x571bc9,_0x3cc3b9){_0x3cc3b9=_0x3cc3b9||0xc8;return function(_0x3c735b){if(_0x3c735b){return _0x571bc9[_0xc011('0x1a')](_0x3cc3b9)['json'](_0x3c735b);}};}function respondWithFilteredResult(_0x322eed,_0x12e8ca){return function(_0x354434){if(_0x354434){var _0x45bc13=typeof _0x12e8ca['offset']==='undefined'&&typeof _0x12e8ca['limit']==='undefined';var _0x12973f=_0x354434[_0xc011('0x1c')];var _0x5041ec=_0x45bc13?0x0:_0x12e8ca[_0xc011('0x1d')];var _0x295d1c=_0x45bc13?_0x354434[_0xc011('0x1c')]:_0x12e8ca[_0xc011('0x1d')]+_0x12e8ca[_0xc011('0x1e')];var _0x22d7a6;if(_0x295d1c>=_0x12973f){_0x295d1c=_0x12973f;_0x22d7a6=0xc8;}else{_0x22d7a6=0xce;}_0x322eed[_0xc011('0x1a')](_0x22d7a6);return _0x322eed['set'](_0xc011('0x1f'),_0x5041ec+'-'+_0x295d1c+'/'+_0x12973f)[_0xc011('0x20')](_0x354434);}return null;};}function patchUpdates(_0x374ff5){return function(_0x26a864){try{jsonpatch['apply'](_0x26a864,_0x374ff5,!![]);}catch(_0x2f2f87){return BPromise[_0xc011('0x21')](_0x2f2f87);}return _0x26a864['save']();};}function saveUpdates(_0x3751e6,_0x14d7d8){return function(_0x16acfa){if(_0x16acfa){return _0x16acfa[_0xc011('0x22')](_0x3751e6)[_0xc011('0x23')](function(_0x364a18){return _0x364a18;});}return null;};}function removeEntity(_0x4f3637,_0x3108af){return function(_0x3fcb4e){if(_0x3fcb4e){return _0x3fcb4e[_0xc011('0x24')]()[_0xc011('0x23')](function(){_0x4f3637[_0xc011('0x1a')](0xcc)[_0xc011('0x1b')]();});}};}function handleEntityNotFound(_0x4a58a4,_0x59a159){return function(_0x104dad){if(!_0x104dad){_0x4a58a4[_0xc011('0x19')](0x194);}return _0x104dad;};}function handleError(_0x665c2c,_0x485f9f){_0x485f9f=_0x485f9f||0x1f4;return function(_0x40a5df){logger['error'](_0x40a5df[_0xc011('0x25')]);if(_0x40a5df[_0xc011('0x26')]){delete _0x40a5df[_0xc011('0x26')];}_0x665c2c[_0xc011('0x1a')](_0x485f9f)['send'](_0x40a5df);};}exports[_0xc011('0x27')]=function(_0x41032a,_0x36d91b){var _0x15cf3d={},_0x58485a={},_0xc97a5b={'count':0x0,'rows':[]};var _0x104bf9=_[_0xc011('0x28')](db[_0xc011('0x29')]['rawAttributes'],function(_0x281c2d){return{'name':_0x281c2d[_0xc011('0x2a')],'type':_0x281c2d[_0xc011('0x2b')][_0xc011('0x2c')]};});_0x58485a[_0xc011('0x2d')]=_[_0xc011('0x28')](_0x104bf9,_0xc011('0x26'));_0x58485a[_0xc011('0x2e')]=_['keys'](_0x41032a[_0xc011('0x2e')]);_0x58485a[_0xc011('0x2f')]=_[_0xc011('0x30')](_0x58485a[_0xc011('0x2d')],_0x58485a[_0xc011('0x2e')]);_0x15cf3d[_0xc011('0x31')]=_['intersection'](_0x58485a[_0xc011('0x2d')],qs[_0xc011('0x32')](_0x41032a[_0xc011('0x2e')]['fields']));_0x15cf3d[_0xc011('0x31')]=_0x15cf3d['attributes'][_0xc011('0x33')]?_0x15cf3d[_0xc011('0x31')]:_0x58485a[_0xc011('0x2d')];if(!_0x41032a[_0xc011('0x2e')][_0xc011('0x34')](_0xc011('0x35'))){_0x15cf3d[_0xc011('0x1e')]=qs[_0xc011('0x1e')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1e')]);_0x15cf3d[_0xc011('0x1d')]=qs[_0xc011('0x1d')](_0x41032a[_0xc011('0x2e')][_0xc011('0x1d')]);}_0x15cf3d[_0xc011('0x36')]=qs[_0xc011('0x37')](_0x41032a['query'][_0xc011('0x37')]);_0x15cf3d[_0xc011('0x38')]=qs[_0xc011('0x2f')](_[_0xc011('0x39')](_0x41032a[_0xc011('0x2e')],_0x58485a['filters']),_0x104bf9);if(_0x41032a['query'][_0xc011('0x3a')]){_0x15cf3d[_0xc011('0x38')]=_['merge'](_0x15cf3d[_0xc011('0x38')],{'$or':_['map'](_0x104bf9,function(_0x4026df){if(_0x4026df['type']!==_0xc011('0x3b')){var _0x1f3098={};_0x1f3098[_0x4026df['name']]={'$like':'%'+_0x41032a['query'][_0xc011('0x3a')]+'%'};return _0x1f3098;}})});}_0x15cf3d=_['merge']({},_0x15cf3d,_0x41032a[_0xc011('0x3c')]);var _0x2e6ae4={'where':_0x15cf3d[_0xc011('0x38')]};return db[_0xc011('0x29')][_0xc011('0x1c')](_0x2e6ae4)[_0xc011('0x23')](function(_0x5ba39c){_0xc97a5b[_0xc011('0x1c')]=_0x5ba39c;if(_0x41032a[_0xc011('0x2e')][_0xc011('0x3d')]){_0x15cf3d['include']=[{'all':!![]}];}return db[_0xc011('0x29')]['findAll'](_0x15cf3d);})[_0xc011('0x23')](function(_0x51132b){_0xc97a5b[_0xc011('0x3e')]=_0x51132b;return _0xc97a5b;})['then'](respondWithFilteredResult(_0x36d91b,_0x15cf3d))[_0xc011('0x3f')](handleError(_0x36d91b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7193d97..a252ae4 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 _0x499a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Migration','migrations','lodash','util'];(function(_0x46e35b,_0x4e4a13){var _0x2398c2=function(_0x59fae3){while(--_0x59fae3){_0x46e35b['push'](_0x46e35b['shift']());}};_0x2398c2(++_0x4e4a13);}(_0x499a,0x1ae));var _0xa499=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x499a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa499('0x0'));var util=require(_0xa499('0x1'));var logger=require(_0xa499('0x2'))(_0xa499('0x3'));var moment=require(_0xa499('0x4'));var BPromise=require(_0xa499('0x5'));var rp=require(_0xa499('0x6'));var fs=require('fs');var path=require(_0xa499('0x7'));var rimraf=require(_0xa499('0x8'));var config=require(_0xa499('0x9'));var attributes=require('./migration.attributes');module['exports']=function(_0x45229d,_0x1b846a){return _0x45229d['define'](_0xa499('0xa'),attributes,{'tableName':_0xa499('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x735f=['define','Migration','migrations','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./migration.attributes','exports'];(function(_0x1b3c8b,_0xdd998c){var _0xc56c53=function(_0x222bfb){while(--_0x222bfb){_0x1b3c8b['push'](_0x1b3c8b['shift']());}};_0xc56c53(++_0xdd998c);}(_0x735f,0x114));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf735('0x0'));var logger=require(_0xf735('0x1'))(_0xf735('0x2'));var moment=require(_0xf735('0x3'));var BPromise=require(_0xf735('0x4'));var rp=require(_0xf735('0x5'));var fs=require('fs');var path=require(_0xf735('0x6'));var rimraf=require('rimraf');var config=require(_0xf735('0x7'));var attributes=require(_0xf735('0x8'));module[_0xf735('0x9')]=function(_0xb9b0b6,_0xe57bbb){return _0xb9b0b6[_0xf735('0xa')](_0xf735('0xb'),attributes,{'tableName':_0xf735('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index e7e7f90..419a6b8 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 _0x3ae9=['then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x308421,_0x3246fc){var _0x13ecf4=function(_0x251c4c){while(--_0x251c4c){_0x308421['push'](_0x308421['shift']());}};_0x13ecf4(++_0x3246fc);}(_0x3ae9,0xdb));var _0x93ae=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x3ae9[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x93ae('0x0'));var BPromise=require(_0x93ae('0x1'));var rs=require(_0x93ae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93ae('0x3'))['db'];var utils=require(_0x93ae('0x4'));var logger=require(_0x93ae('0x5'))(_0x93ae('0x6'));var config=require('../../config/environment');var jayson=require(_0x93ae('0x7'));var client=jayson['client'][_0x93ae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32564c,_0x2a0972,_0x36e141){return new BPromise(function(_0x22761c,_0x354bf9){return client['request'](_0x32564c,_0x36e141)[_0x93ae('0x9')](function(_0x4ac4b0){logger['info']('Migration,\x20%s,\x20%s',_0x2a0972,_0x93ae('0xa'));logger[_0x93ae('0xb')](_0x93ae('0xc'),_0x2a0972,_0x93ae('0xa'),JSON[_0x93ae('0xd')](_0x4ac4b0));if(_0x4ac4b0[_0x93ae('0xe')]){if(_0x4ac4b0['error']['code']===0x1f4){logger[_0x93ae('0xe')](_0x93ae('0xf'),_0x2a0972,_0x4ac4b0['error']['message']);return _0x354bf9(_0x4ac4b0[_0x93ae('0xe')]['message']);}logger[_0x93ae('0xe')](_0x93ae('0xf'),_0x2a0972,_0x4ac4b0['error'][_0x93ae('0x10')]);return _0x22761c(_0x4ac4b0[_0x93ae('0xe')][_0x93ae('0x10')]);}else{logger[_0x93ae('0x11')](_0x93ae('0xf'),_0x2a0972,_0x93ae('0xa'));_0x22761c(_0x4ac4b0['result'][_0x93ae('0x10')]);}})[_0x93ae('0x12')](function(_0x129e44){logger['error'](_0x93ae('0xf'),_0x2a0972,_0x129e44);_0x354bf9(_0x129e44);});});} \ No newline at end of file +var _0x4ded=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','Migration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4ded,0x116));var _0xd4de=function(_0x5c5ba6,_0x1fdbb5){_0x5c5ba6=_0x5c5ba6-0x0;var _0x557437=_0x4ded[_0x5c5ba6];return _0x557437;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('Migration,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index ded9238..33fe082 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 _0x0760=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','multer'];(function(_0x530b32,_0x3ca298){var _0x590341=function(_0x15a94e){while(--_0x15a94e){_0x530b32['push'](_0x530b32['shift']());}};_0x590341(++_0x3ca298);}(_0x0760,0xa9));var _0x0076=function(_0x199b0c,_0x43d568){_0x199b0c=_0x199b0c-0x0;var _0x5cc3f1=_0x0760[_0x199b0c];return _0x5cc3f1;};'use strict';var multer=require(_0x0076('0x0'));var util=require('util');var path=require(_0x0076('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0076('0x2'));var auth=require(_0x0076('0x3'));var interaction=require(_0x0076('0x4'));var config=require(_0x0076('0x5'));var controller=require(_0x0076('0x6'));router['get']('/',auth[_0x0076('0x7')](),controller[_0x0076('0x8')]);router[_0x0076('0x9')](_0x0076('0xa'),auth[_0x0076('0x7')](),controller['show']);router[_0x0076('0xb')]('/',auth['isAuthenticated'](),controller[_0x0076('0xc')]);router[_0x0076('0xd')]('/:id',auth[_0x0076('0x7')](),controller[_0x0076('0xe')]);router[_0x0076('0xf')](_0x0076('0xa'),auth[_0x0076('0x7')](),controller[_0x0076('0x10')]);module['exports']=router; \ No newline at end of file +var _0x85e6=['show','post','create','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','isAuthenticated','index','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85e6,0x1a5));var _0x685e=function(_0x13593d,_0x42b0fe){_0x13593d=_0x13593d-0x0;var _0x40af36=_0x85e6[_0x13593d];return _0x40af36;};'use strict';var multer=require(_0x685e('0x0'));var util=require(_0x685e('0x1'));var path=require('path');var timeout=require(_0x685e('0x2'));var express=require(_0x685e('0x3'));var router=express['Router']();var fs_extra=require(_0x685e('0x4'));var auth=require(_0x685e('0x5'));var interaction=require(_0x685e('0x6'));var config=require('../../config/environment');var controller=require(_0x685e('0x7'));router['get']('/',auth[_0x685e('0x8')](),controller[_0x685e('0x9')]);router[_0x685e('0xa')]('/:id',auth[_0x685e('0x8')](),controller[_0x685e('0xb')]);router[_0x685e('0xc')]('/',auth[_0x685e('0x8')](),controller[_0x685e('0xd')]);router['put'](_0x685e('0xe'),auth['isAuthenticated'](),controller[_0x685e('0xf')]);router['delete'](_0x685e('0xe'),auth[_0x685e('0x8')](),controller[_0x685e('0x10')]);module[_0x685e('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d405b33..f3a37e0 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 _0x07ae=['turn','STRING','sequelize','ENUM','localnet','externip','stun'];(function(_0xafa957,_0x4982c9){var _0x4187da=function(_0x4bc6d0){while(--_0x4bc6d0){_0xafa957['push'](_0xafa957['shift']());}};_0x4187da(++_0x4982c9);}(_0x07ae,0x16e));var _0xe07a=function(_0x34f1c9,_0x30bf3d){_0x34f1c9=_0x34f1c9-0x0;var _0x4e6f4d=_0x07ae[_0x34f1c9];return _0x4e6f4d;};'use strict';var Sequelize=require(_0xe07a('0x0'));module['exports']={'type':{'type':Sequelize[_0xe07a('0x1')](_0xe07a('0x2'),_0xe07a('0x3'),_0xe07a('0x4'),_0xe07a('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe07a('0x6')]},'password':{'type':Sequelize[_0xe07a('0x6')]}}; \ No newline at end of file +var _0x07cc=['STRING','exports','localnet','turn'];(function(_0x919b14,_0x11a65f){var _0xea5cba=function(_0x38de40){while(--_0x38de40){_0x919b14['push'](_0x919b14['shift']());}};_0xea5cba(++_0x11a65f);}(_0x07cc,0x1dd));var _0xc07c=function(_0x3da50e,_0x5e8943){_0x3da50e=_0x3da50e-0x0;var _0x100723=_0x07cc[_0x3da50e];return _0x100723;};'use strict';var Sequelize=require('sequelize');module[_0xc07c('0x0')]={'type':{'type':Sequelize['ENUM'](_0xc07c('0x1'),'externip','stun',_0xc07c('0x2'))},'value':{'type':Sequelize[_0xc07c('0x3')]},'username':{'type':Sequelize[_0xc07c('0x3')]},'password':{'type':Sequelize[_0xc07c('0x3')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 28c76a9..002c350 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 _0xbac3=['name','send','index','map','Network','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','includeAll','options','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','res_stun_monitor.so','TURN','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','Reload','chan_sip.so','params','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','/etc/asterisk/stun_xcally.conf','util','path','ejs','lodash','../../config/logger','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','status','json','offset','undefined','count','limit','set','update','destroy','end','stack'];(function(_0x4f5914,_0x3a3b23){var _0xf2243e=function(_0x3664fa){while(--_0x3664fa){_0x4f5914['push'](_0x4f5914['shift']());}};_0xf2243e(++_0x3a3b23);}(_0xbac3,0x131));var _0x3bac=function(_0x2110bb,_0x5bf49e){_0x2110bb=_0x2110bb-0x0;var _0x5cf87c=_0xbac3[_0x2110bb];return _0x5cf87c;};'use strict';var util=require(_0x3bac('0x0'));var path=require(_0x3bac('0x1'));var ejs=require(_0x3bac('0x2'));var fs=require('fs');var _=require(_0x3bac('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0x3bac('0x4'))('api');var config=require('../../config/environment');var db=require(_0x3bac('0x5'))['db'];var jayson=require(_0x3bac('0x6'));var client=jayson[_0x3bac('0x7')][_0x3bac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ae63c,_0x5978fc,_0x9e65ef,_0x2c3737){return new Promise(function(_0x6d3ea3,_0x57321f){var _0x22e4ff=_0x2c3737||client;return _0x22e4ff[_0x3bac('0x9')](_0x4ae63c,_0x9e65ef)[_0x3bac('0xa')](function(_0x1a1ac2){logger[_0x3bac('0xb')](_0x3bac('0xc'),_0x5978fc,'request\x20sent');logger[_0x3bac('0xd')](_0x3bac('0xe'),_0x5978fc,'request\x20sent',JSON['stringify'](_0x1a1ac2));if(_0x1a1ac2[_0x3bac('0xf')]){if(_0x1a1ac2['error'][_0x3bac('0x10')]===0x1f4){logger[_0x3bac('0xf')](_0x3bac('0xc'),_0x5978fc,_0x1a1ac2[_0x3bac('0xf')][_0x3bac('0x11')]);return _0x57321f(_0x1a1ac2['error'][_0x3bac('0x11')]);}logger[_0x3bac('0xf')](_0x3bac('0xc'),_0x5978fc,_0x1a1ac2['error'][_0x3bac('0x11')]);return _0x6d3ea3(_0x1a1ac2['error']['message']);}else{logger[_0x3bac('0xb')](_0x3bac('0xc'),_0x5978fc,_0x3bac('0x12'));_0x6d3ea3(_0x1a1ac2['result']['message']);}})[_0x3bac('0x13')](function(_0x31bb07){logger[_0x3bac('0xf')]('Network,\x20%s,\x20%s',_0x5978fc,_0x31bb07);_0x57321f(_0x31bb07);});});}function respondWithResult(_0x3a385e,_0x1c5dae){_0x1c5dae=_0x1c5dae||0xc8;return function(_0x566431){if(_0x566431){return _0x3a385e[_0x3bac('0x14')](_0x1c5dae)[_0x3bac('0x15')](_0x566431);}};}function respondWithFilteredResult(_0x2e876d,_0x2e9bd3){return function(_0x59af40){if(_0x59af40){var _0x259c64=typeof _0x2e9bd3[_0x3bac('0x16')]===_0x3bac('0x17')&&typeof _0x2e9bd3['limit']==='undefined';var _0x1943f2=_0x59af40[_0x3bac('0x18')];var _0xf98d9b=_0x259c64?0x0:_0x2e9bd3[_0x3bac('0x16')];var _0x4fcea3=_0x259c64?_0x59af40[_0x3bac('0x18')]:_0x2e9bd3[_0x3bac('0x16')]+_0x2e9bd3[_0x3bac('0x19')];var _0xef9770;if(_0x4fcea3>=_0x1943f2){_0x4fcea3=_0x1943f2;_0xef9770=0xc8;}else{_0xef9770=0xce;}_0x2e876d[_0x3bac('0x14')](_0xef9770);return _0x2e876d[_0x3bac('0x1a')]('Content-Range',_0xf98d9b+'-'+_0x4fcea3+'/'+_0x1943f2)['json'](_0x59af40);}return null;};}function saveUpdates(_0x1bd8b3){return function(_0xf0249){if(_0xf0249){return _0xf0249[_0x3bac('0x1b')](_0x1bd8b3)[_0x3bac('0xa')](function(_0x33cb8e){return _0x33cb8e;});}return null;};}function removeEntity(_0x2d9bdf){return function(_0x4845c4){if(_0x4845c4){return _0x4845c4[_0x3bac('0x1c')]()[_0x3bac('0xa')](function(){_0x2d9bdf['status'](0xcc)[_0x3bac('0x1d')]();});}};}function handleEntityNotFound(_0x208eb1){return function(_0x31d0b1){if(!_0x31d0b1){_0x208eb1['sendStatus'](0x194);}return _0x31d0b1;};}function handleError(_0x265f4a,_0x237537){_0x237537=_0x237537||0x1f4;return function(_0x5dc9d0){logger[_0x3bac('0xf')](_0x5dc9d0[_0x3bac('0x1e')]);if(_0x5dc9d0[_0x3bac('0x1f')]){delete _0x5dc9d0['name'];}_0x265f4a[_0x3bac('0x14')](_0x237537)[_0x3bac('0x20')](_0x5dc9d0);};}exports[_0x3bac('0x21')]=function(_0x7ed11a,_0x28c42e){var _0xce1074={},_0x57d102={},_0xa8d42f={'count':0x0,'rows':[]};var _0x2d536a=_[_0x3bac('0x22')](db[_0x3bac('0x23')][_0x3bac('0x24')],function(_0x52f843){return{'name':_0x52f843['fieldName'],'type':_0x52f843[_0x3bac('0x25')][_0x3bac('0x26')]};});_0x57d102[_0x3bac('0x27')]=_[_0x3bac('0x22')](_0x2d536a,_0x3bac('0x1f'));_0x57d102[_0x3bac('0x28')]=_[_0x3bac('0x29')](_0x7ed11a[_0x3bac('0x28')]);_0x57d102[_0x3bac('0x2a')]=_[_0x3bac('0x2b')](_0x57d102[_0x3bac('0x27')],_0x57d102['query']);_0xce1074[_0x3bac('0x2c')]=_[_0x3bac('0x2b')](_0x57d102[_0x3bac('0x27')],qs[_0x3bac('0x2d')](_0x7ed11a[_0x3bac('0x28')]['fields']));_0xce1074[_0x3bac('0x2c')]=_0xce1074[_0x3bac('0x2c')][_0x3bac('0x2e')]?_0xce1074[_0x3bac('0x2c')]:_0x57d102['model'];if(!_0x7ed11a[_0x3bac('0x28')][_0x3bac('0x2f')](_0x3bac('0x30'))){_0xce1074[_0x3bac('0x19')]=qs[_0x3bac('0x19')](_0x7ed11a[_0x3bac('0x28')][_0x3bac('0x19')]);_0xce1074[_0x3bac('0x16')]=qs[_0x3bac('0x16')](_0x7ed11a[_0x3bac('0x28')]['offset']);}_0xce1074[_0x3bac('0x31')]=qs['sort'](_0x7ed11a[_0x3bac('0x28')][_0x3bac('0x32')]);_0xce1074[_0x3bac('0x33')]=qs[_0x3bac('0x2a')](_[_0x3bac('0x34')](_0x7ed11a[_0x3bac('0x28')],_0x57d102['filters']),_0x2d536a);if(_0x7ed11a[_0x3bac('0x28')][_0x3bac('0x35')]){_0xce1074['where']=_[_0x3bac('0x36')](_0xce1074[_0x3bac('0x33')],{'$or':_['map'](_0x2d536a,function(_0x36393d){if(_0x36393d['type']!==_0x3bac('0x37')){var _0x57f6e7={};_0x57f6e7[_0x36393d[_0x3bac('0x1f')]]={'$like':'%'+_0x7ed11a[_0x3bac('0x28')][_0x3bac('0x35')]+'%'};return _0x57f6e7;}})});}_0xce1074=_[_0x3bac('0x36')]({},_0xce1074,_0x7ed11a['options']);var _0x2c196a={'where':_0xce1074[_0x3bac('0x33')]};return db[_0x3bac('0x23')][_0x3bac('0x18')](_0x2c196a)[_0x3bac('0xa')](function(_0x4f787f){_0xa8d42f[_0x3bac('0x18')]=_0x4f787f;if(_0x7ed11a[_0x3bac('0x28')]['includeAll']){_0xce1074[_0x3bac('0x38')]=[{'all':!![]}];}return db[_0x3bac('0x23')][_0x3bac('0x39')](_0xce1074);})[_0x3bac('0xa')](function(_0x43a765){_0xa8d42f['rows']=_0x43a765;return _0xa8d42f;})[_0x3bac('0xa')](respondWithFilteredResult(_0x28c42e,_0xce1074))[_0x3bac('0x13')](handleError(_0x28c42e,null));};exports[_0x3bac('0x3a')]=function(_0x3af718,_0x562d45){var _0x2962d8={'raw':!![],'where':{'id':_0x3af718['params']['id']}},_0x586bbf={};_0x586bbf[_0x3bac('0x27')]=_[_0x3bac('0x29')](db[_0x3bac('0x23')][_0x3bac('0x24')]);_0x586bbf[_0x3bac('0x28')]=_['keys'](_0x3af718[_0x3bac('0x28')]);_0x586bbf['filters']=_[_0x3bac('0x2b')](_0x586bbf[_0x3bac('0x27')],_0x586bbf['query']);_0x2962d8[_0x3bac('0x2c')]=_[_0x3bac('0x2b')](_0x586bbf[_0x3bac('0x27')],qs['fields'](_0x3af718[_0x3bac('0x28')][_0x3bac('0x2d')]));_0x2962d8[_0x3bac('0x2c')]=_0x2962d8[_0x3bac('0x2c')]['length']?_0x2962d8[_0x3bac('0x2c')]:_0x586bbf['model'];if(_0x3af718[_0x3bac('0x28')][_0x3bac('0x3b')]){_0x2962d8[_0x3bac('0x38')]=[{'all':!![]}];}_0x2962d8=_['merge']({},_0x2962d8,_0x3af718[_0x3bac('0x3c')]);return db['Network'][_0x3bac('0x3d')](_0x2962d8)[_0x3bac('0xa')](handleEntityNotFound(_0x562d45,null))['then'](respondWithResult(_0x562d45,null))[_0x3bac('0x13')](handleError(_0x562d45,null));};exports['create']=function(_0x4d4493,_0x3c3def){var _0x1c3085;return db['Network'][_0x3bac('0x3e')](_0x4d4493[_0x3bac('0x3f')],{'raw':!![]})[_0x3bac('0xa')](function(_0x12c302){_0x1c3085=_0x12c302;return db[_0x3bac('0x23')][_0x3bac('0x39')]({'where':{'type':_0x4d4493[_0x3bac('0x3f')][_0x3bac('0x25')]},'raw':!![]});})[_0x3bac('0xa')](function(_0x4392cd){if(_0x1c3085[_0x3bac('0x25')][_0x3bac('0x40')]()==_0x3bac('0x41')){var _0x56e1bc=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x45')),_0x3bac('0x46'));var _0x1e06a9=ejs[_0x3bac('0x47')](_0x56e1bc,{'networks':_0x4392cd||[]});fs[_0x3bac('0x48')]('/etc/asterisk/stun_xcally.conf',_0x1e06a9);return respondWithRpcPromise('Reload',_0x3bac('0x3e'),{'module':_0x3bac('0x49')});}else if(_0x1c3085['type'][_0x3bac('0x40')]()==_0x3bac('0x4a')){var _0x1944f8=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],'server/files/templates/turn_multiple.ejs'),_0x3bac('0x46'));var _0x54c048=ejs[_0x3bac('0x47')](_0x1944f8,{'networks':_0x4392cd||[]});fs[_0x3bac('0x48')](_0x3bac('0x4b'),_0x54c048);return respondWithRpcPromise('Reload',_0x3bac('0x3e'),{'module':_0x3bac('0x49')});}else{var _0x470e18=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x4c')),_0x3bac('0x46'));var _0x499f9b=ejs['render'](_0x470e18,{'networks':_0x4392cd||[]});fs[_0x3bac('0x48')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4d4493[_0x3bac('0x3f')]['type']['toLowerCase']()),_0x499f9b);return respondWithRpcPromise(_0x3bac('0x4d'),_0x3bac('0x3e'),{'module':_0x3bac('0x4e')});}})[_0x3bac('0xa')](function(){return _0x1c3085;})[_0x3bac('0xa')](respondWithResult(_0x3c3def,0xc9))['catch'](handleError(_0x3c3def,null));};exports[_0x3bac('0x1b')]=function(_0x1b6e48,_0x5090cf){var _0x38c62d;return db[_0x3bac('0x23')][_0x3bac('0x3d')]({'where':{'id':_0x1b6e48[_0x3bac('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5090cf,null))[_0x3bac('0xa')](saveUpdates(_0x1b6e48[_0x3bac('0x3f')],null))[_0x3bac('0xa')](function(_0x8edb9d){if(_0x8edb9d){_0x38c62d=_0x8edb9d;return db[_0x3bac('0x23')]['findAll']({'where':{'type':_0x38c62d[_0x3bac('0x25')]},'raw':!![]});}return null;})[_0x3bac('0xa')](function(_0x502fa0){if(_0x38c62d['type']['toUpperCase']()==_0x3bac('0x41')){var _0x8bfeea=fs['readFileSync'](path['join'](config[_0x3bac('0x44')],_0x3bac('0x45')),_0x3bac('0x46'));var _0x46fe2b=ejs[_0x3bac('0x47')](_0x8bfeea,{'networks':_0x502fa0||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x46fe2b);return respondWithRpcPromise(_0x3bac('0x4d'),_0x3bac('0x1b'),{'module':'res_stun_monitor.so'});}else if(_0x38c62d[_0x3bac('0x25')][_0x3bac('0x40')]()==_0x3bac('0x4a')){var _0xd5099c=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x50')),_0x3bac('0x46'));var _0x2e0d76=ejs[_0x3bac('0x47')](_0xd5099c,{'networks':_0x502fa0||[]});fs[_0x3bac('0x48')](_0x3bac('0x4b'),_0x2e0d76);return respondWithRpcPromise(_0x3bac('0x4d'),_0x3bac('0x1b'),{'module':_0x3bac('0x49')});}else{var _0x13a3a5=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config['root'],_0x3bac('0x4c')),'utf8');var _0x5ca768=ejs[_0x3bac('0x47')](_0x13a3a5,{'networks':_0x502fa0||[]});fs[_0x3bac('0x48')](util['format'](_0x3bac('0x51'),_0x1b6e48[_0x3bac('0x3f')]['type'][_0x3bac('0x52')]()),_0x5ca768);return respondWithRpcPromise('Reload',_0x3bac('0x1b'),{'module':'chan_sip.so'});}})[_0x3bac('0xa')](function(_0x57cbde){if(_0x57cbde){return _0x38c62d;}return null;})[_0x3bac('0xa')](respondWithResult(_0x5090cf,null))['catch'](handleError(_0x5090cf,null));};exports[_0x3bac('0x1c')]=function(_0x16fdf4,_0x4f9c1a){var _0x1b4705;return db[_0x3bac('0x23')]['find']({'where':{'id':_0x16fdf4[_0x3bac('0x4f')]['id']}})[_0x3bac('0xa')](function(_0x5cb779){_0x1b4705=_0x5cb779;return _0x5cb779;})[_0x3bac('0xa')](handleEntityNotFound(_0x4f9c1a,null))[_0x3bac('0xa')](removeEntity(_0x4f9c1a,null))['then'](function(){if(_0x1b4705){return db[_0x3bac('0x23')][_0x3bac('0x39')]({'where':{'type':_0x1b4705['type']},'raw':!![]});}})['then'](function(_0x3f5143){if(_0x1b4705[_0x3bac('0x25')]['toUpperCase']()==_0x3bac('0x41')){var _0x15bbd6=fs['readFileSync'](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x45')),'utf8');var _0x3fe897=ejs[_0x3bac('0x47')](_0x15bbd6,{'networks':_0x3f5143||[]});fs[_0x3bac('0x48')](_0x3bac('0x53'),_0x3fe897);return respondWithRpcPromise(_0x3bac('0x4d'),_0x3bac('0x1c'),{'module':_0x3bac('0x49')});}else if(_0x1b4705[_0x3bac('0x25')][_0x3bac('0x40')]()==_0x3bac('0x4a')){var _0xe5c952=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x50')),_0x3bac('0x46'));var _0x491218=ejs[_0x3bac('0x47')](_0xe5c952,{'networks':_0x3f5143||[]});fs[_0x3bac('0x48')](_0x3bac('0x4b'),_0x491218);return respondWithRpcPromise(_0x3bac('0x4d'),_0x3bac('0x1c'),{'module':'res_stun_monitor.so'});}else{var _0x522ab5=fs[_0x3bac('0x42')](path[_0x3bac('0x43')](config[_0x3bac('0x44')],_0x3bac('0x4c')),'utf8');var _0x2752f8=ejs[_0x3bac('0x47')](_0x522ab5,{'networks':_0x3f5143||[]});fs[_0x3bac('0x48')](util['format'](_0x3bac('0x51'),_0x1b4705[_0x3bac('0x25')][_0x3bac('0x52')]()),_0x2752f8);return respondWithRpcPromise('Reload',_0x3bac('0x1c'),{'module':_0x3bac('0x4e')});}})[_0x3bac('0x13')](handleError(_0x4f9c1a,null));}; \ No newline at end of file +var _0x0b0f=['writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','server/files/templates/stun_multiple.ejs','server/files/templates/turn_multiple.ejs','chan_sip.so','util','path','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','limit','undefined','count','status','set','update','destroy','end','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','intersection','find','create','body','toUpperCase','STUN','join','root','utf8','render'];(function(_0x47c62d,_0x3a167d){var _0x2ee89f=function(_0x52c50a){while(--_0x52c50a){_0x47c62d['push'](_0x47c62d['shift']());}};_0x2ee89f(++_0x3a167d);}(_0x0b0f,0x68));var _0xf0b0=function(_0x5c5736,_0x186975){_0x5c5736=_0x5c5736-0x0;var _0x422b68=_0x0b0f[_0x5c5736];return _0x422b68;};'use strict';var util=require(_0xf0b0('0x0'));var path=require(_0xf0b0('0x1'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf0b0('0x2'));var qs=require(_0xf0b0('0x3'));var logger=require(_0xf0b0('0x4'))('api');var config=require(_0xf0b0('0x5'));var db=require(_0xf0b0('0x6'))['db'];var jayson=require(_0xf0b0('0x7'));var client=jayson[_0xf0b0('0x8')][_0xf0b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14323c,_0x4ea266,_0x5a5bc4,_0x23b520){return new Promise(function(_0x1e5956,_0x499534){var _0x2fd743=_0x23b520||client;return _0x2fd743[_0xf0b0('0xa')](_0x14323c,_0x5a5bc4)[_0xf0b0('0xb')](function(_0x1ef105){logger[_0xf0b0('0xc')](_0xf0b0('0xd'),_0x4ea266,_0xf0b0('0xe'));logger[_0xf0b0('0xf')](_0xf0b0('0x10'),_0x4ea266,_0xf0b0('0xe'),JSON[_0xf0b0('0x11')](_0x1ef105));if(_0x1ef105[_0xf0b0('0x12')]){if(_0x1ef105[_0xf0b0('0x12')][_0xf0b0('0x13')]===0x1f4){logger[_0xf0b0('0x12')](_0xf0b0('0xd'),_0x4ea266,_0x1ef105['error']['message']);return _0x499534(_0x1ef105['error'][_0xf0b0('0x14')]);}logger[_0xf0b0('0x12')](_0xf0b0('0xd'),_0x4ea266,_0x1ef105[_0xf0b0('0x12')][_0xf0b0('0x14')]);return _0x1e5956(_0x1ef105[_0xf0b0('0x12')][_0xf0b0('0x14')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x4ea266,_0xf0b0('0xe'));_0x1e5956(_0x1ef105[_0xf0b0('0x15')][_0xf0b0('0x14')]);}})[_0xf0b0('0x16')](function(_0x230cd2){logger[_0xf0b0('0x12')](_0xf0b0('0xd'),_0x4ea266,_0x230cd2);_0x499534(_0x230cd2);});});}function respondWithResult(_0x1e791b,_0x2cacf4){_0x2cacf4=_0x2cacf4||0xc8;return function(_0x376efa){if(_0x376efa){return _0x1e791b['status'](_0x2cacf4)[_0xf0b0('0x17')](_0x376efa);}};}function respondWithFilteredResult(_0x36a8c8,_0x1385f9){return function(_0x5b1d21){if(_0x5b1d21){var _0x593ff6=typeof _0x1385f9[_0xf0b0('0x18')]==='undefined'&&typeof _0x1385f9[_0xf0b0('0x19')]===_0xf0b0('0x1a');var _0x5a3b6a=_0x5b1d21[_0xf0b0('0x1b')];var _0x47fc24=_0x593ff6?0x0:_0x1385f9[_0xf0b0('0x18')];var _0x1a10e1=_0x593ff6?_0x5b1d21[_0xf0b0('0x1b')]:_0x1385f9['offset']+_0x1385f9[_0xf0b0('0x19')];var _0x456dbc;if(_0x1a10e1>=_0x5a3b6a){_0x1a10e1=_0x5a3b6a;_0x456dbc=0xc8;}else{_0x456dbc=0xce;}_0x36a8c8[_0xf0b0('0x1c')](_0x456dbc);return _0x36a8c8[_0xf0b0('0x1d')]('Content-Range',_0x47fc24+'-'+_0x1a10e1+'/'+_0x5a3b6a)['json'](_0x5b1d21);}return null;};}function saveUpdates(_0x9b7648){return function(_0x58b2b4){if(_0x58b2b4){return _0x58b2b4[_0xf0b0('0x1e')](_0x9b7648)['then'](function(_0x41ff6f){return _0x41ff6f;});}return null;};}function removeEntity(_0x324224){return function(_0x177e37){if(_0x177e37){return _0x177e37[_0xf0b0('0x1f')]()[_0xf0b0('0xb')](function(){_0x324224[_0xf0b0('0x1c')](0xcc)[_0xf0b0('0x20')]();});}};}function handleEntityNotFound(_0x21d9e7){return function(_0x581d43){if(!_0x581d43){_0x21d9e7[_0xf0b0('0x21')](0x194);}return _0x581d43;};}function handleError(_0x4877b4,_0x360b35){_0x360b35=_0x360b35||0x1f4;return function(_0x18aa4d){logger[_0xf0b0('0x12')](_0x18aa4d[_0xf0b0('0x22')]);if(_0x18aa4d[_0xf0b0('0x23')]){delete _0x18aa4d[_0xf0b0('0x23')];}_0x4877b4[_0xf0b0('0x1c')](_0x360b35)[_0xf0b0('0x24')](_0x18aa4d);};}exports[_0xf0b0('0x25')]=function(_0x54a155,_0x359c34){var _0x2a55a4={},_0x329455={},_0x5193e5={'count':0x0,'rows':[]};var _0x5b6755=_['map'](db[_0xf0b0('0x26')][_0xf0b0('0x27')],function(_0x24d52e){return{'name':_0x24d52e[_0xf0b0('0x28')],'type':_0x24d52e[_0xf0b0('0x29')][_0xf0b0('0x2a')]};});_0x329455[_0xf0b0('0x2b')]=_[_0xf0b0('0x2c')](_0x5b6755,_0xf0b0('0x23'));_0x329455[_0xf0b0('0x2d')]=_[_0xf0b0('0x2e')](_0x54a155['query']);_0x329455['filters']=_['intersection'](_0x329455[_0xf0b0('0x2b')],_0x329455[_0xf0b0('0x2d')]);_0x2a55a4[_0xf0b0('0x2f')]=_['intersection'](_0x329455[_0xf0b0('0x2b')],qs[_0xf0b0('0x30')](_0x54a155[_0xf0b0('0x2d')]['fields']));_0x2a55a4[_0xf0b0('0x2f')]=_0x2a55a4['attributes'][_0xf0b0('0x31')]?_0x2a55a4['attributes']:_0x329455[_0xf0b0('0x2b')];if(!_0x54a155['query'][_0xf0b0('0x32')](_0xf0b0('0x33'))){_0x2a55a4[_0xf0b0('0x19')]=qs[_0xf0b0('0x19')](_0x54a155['query'][_0xf0b0('0x19')]);_0x2a55a4[_0xf0b0('0x18')]=qs[_0xf0b0('0x18')](_0x54a155[_0xf0b0('0x2d')][_0xf0b0('0x18')]);}_0x2a55a4[_0xf0b0('0x34')]=qs['sort'](_0x54a155[_0xf0b0('0x2d')][_0xf0b0('0x35')]);_0x2a55a4[_0xf0b0('0x36')]=qs['filters'](_['pick'](_0x54a155[_0xf0b0('0x2d')],_0x329455['filters']),_0x5b6755);if(_0x54a155[_0xf0b0('0x2d')][_0xf0b0('0x37')]){_0x2a55a4[_0xf0b0('0x36')]=_[_0xf0b0('0x38')](_0x2a55a4[_0xf0b0('0x36')],{'$or':_[_0xf0b0('0x2c')](_0x5b6755,function(_0x4fdf7b){if(_0x4fdf7b[_0xf0b0('0x29')]!==_0xf0b0('0x39')){var _0x4cb0c0={};_0x4cb0c0[_0x4fdf7b[_0xf0b0('0x23')]]={'$like':'%'+_0x54a155[_0xf0b0('0x2d')][_0xf0b0('0x37')]+'%'};return _0x4cb0c0;}})});}_0x2a55a4=_[_0xf0b0('0x38')]({},_0x2a55a4,_0x54a155[_0xf0b0('0x3a')]);var _0x45cdde={'where':_0x2a55a4['where']};return db[_0xf0b0('0x26')][_0xf0b0('0x1b')](_0x45cdde)[_0xf0b0('0xb')](function(_0x5733cf){_0x5193e5[_0xf0b0('0x1b')]=_0x5733cf;if(_0x54a155['query'][_0xf0b0('0x3b')]){_0x2a55a4[_0xf0b0('0x3c')]=[{'all':!![]}];}return db[_0xf0b0('0x26')][_0xf0b0('0x3d')](_0x2a55a4);})['then'](function(_0x723635){_0x5193e5[_0xf0b0('0x3e')]=_0x723635;return _0x5193e5;})[_0xf0b0('0xb')](respondWithFilteredResult(_0x359c34,_0x2a55a4))['catch'](handleError(_0x359c34,null));};exports[_0xf0b0('0x3f')]=function(_0x4d12f4,_0x34156f){var _0x403d04={'raw':!![],'where':{'id':_0x4d12f4[_0xf0b0('0x40')]['id']}},_0xe11c9b={};_0xe11c9b[_0xf0b0('0x2b')]=_[_0xf0b0('0x2e')](db[_0xf0b0('0x26')]['rawAttributes']);_0xe11c9b['query']=_[_0xf0b0('0x2e')](_0x4d12f4['query']);_0xe11c9b[_0xf0b0('0x41')]=_[_0xf0b0('0x42')](_0xe11c9b[_0xf0b0('0x2b')],_0xe11c9b['query']);_0x403d04['attributes']=_[_0xf0b0('0x42')](_0xe11c9b[_0xf0b0('0x2b')],qs[_0xf0b0('0x30')](_0x4d12f4['query'][_0xf0b0('0x30')]));_0x403d04[_0xf0b0('0x2f')]=_0x403d04['attributes'][_0xf0b0('0x31')]?_0x403d04[_0xf0b0('0x2f')]:_0xe11c9b[_0xf0b0('0x2b')];if(_0x4d12f4['query'][_0xf0b0('0x3b')]){_0x403d04[_0xf0b0('0x3c')]=[{'all':!![]}];}_0x403d04=_[_0xf0b0('0x38')]({},_0x403d04,_0x4d12f4['options']);return db[_0xf0b0('0x26')][_0xf0b0('0x43')](_0x403d04)['then'](handleEntityNotFound(_0x34156f,null))[_0xf0b0('0xb')](respondWithResult(_0x34156f,null))[_0xf0b0('0x16')](handleError(_0x34156f,null));};exports[_0xf0b0('0x44')]=function(_0x2ae7cd,_0x15dc17){var _0x523021;return db[_0xf0b0('0x26')][_0xf0b0('0x44')](_0x2ae7cd['body'],{'raw':!![]})[_0xf0b0('0xb')](function(_0x104c95){_0x523021=_0x104c95;return db[_0xf0b0('0x26')][_0xf0b0('0x3d')]({'where':{'type':_0x2ae7cd[_0xf0b0('0x45')]['type']},'raw':!![]});})[_0xf0b0('0xb')](function(_0x1a16f4){if(_0x523021[_0xf0b0('0x29')][_0xf0b0('0x46')]()==_0xf0b0('0x47')){var _0x1de28f=fs['readFileSync'](path[_0xf0b0('0x48')](config[_0xf0b0('0x49')],'server/files/templates/stun_multiple.ejs'),_0xf0b0('0x4a'));var _0x36e4b0=ejs[_0xf0b0('0x4b')](_0x1de28f,{'networks':_0x1a16f4||[]});fs[_0xf0b0('0x4c')](_0xf0b0('0x4d'),_0x36e4b0);return respondWithRpcPromise(_0xf0b0('0x4e'),_0xf0b0('0x44'),{'module':_0xf0b0('0x4f')});}else if(_0x523021[_0xf0b0('0x29')][_0xf0b0('0x46')]()==_0xf0b0('0x50')){var _0x30caac=fs[_0xf0b0('0x51')](path[_0xf0b0('0x48')](config[_0xf0b0('0x49')],'server/files/templates/turn_multiple.ejs'),_0xf0b0('0x4a'));var _0x28856a=ejs[_0xf0b0('0x4b')](_0x30caac,{'networks':_0x1a16f4||[]});fs['writeFileSync'](_0xf0b0('0x52'),_0x28856a);return respondWithRpcPromise(_0xf0b0('0x4e'),_0xf0b0('0x44'),{'module':_0xf0b0('0x4f')});}else{var _0x2372bf=fs[_0xf0b0('0x51')](path[_0xf0b0('0x48')](config[_0xf0b0('0x49')],_0xf0b0('0x53')),_0xf0b0('0x4a'));var _0xbb7153=ejs['render'](_0x2372bf,{'networks':_0x1a16f4||[]});fs[_0xf0b0('0x4c')](util[_0xf0b0('0x54')](_0xf0b0('0x55'),_0x2ae7cd[_0xf0b0('0x45')][_0xf0b0('0x29')][_0xf0b0('0x56')]()),_0xbb7153);return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});}})[_0xf0b0('0xb')](function(){return _0x523021;})[_0xf0b0('0xb')](respondWithResult(_0x15dc17,0xc9))[_0xf0b0('0x16')](handleError(_0x15dc17,null));};exports[_0xf0b0('0x1e')]=function(_0x123e0a,_0x586eb8){var _0x1891ac;return db[_0xf0b0('0x26')][_0xf0b0('0x43')]({'where':{'id':_0x123e0a['params']['id']}})[_0xf0b0('0xb')](handleEntityNotFound(_0x586eb8,null))[_0xf0b0('0xb')](saveUpdates(_0x123e0a['body'],null))[_0xf0b0('0xb')](function(_0x3ca5b){if(_0x3ca5b){_0x1891ac=_0x3ca5b;return db[_0xf0b0('0x26')][_0xf0b0('0x3d')]({'where':{'type':_0x1891ac['type']},'raw':!![]});}return null;})[_0xf0b0('0xb')](function(_0xe58972){if(_0x1891ac[_0xf0b0('0x29')][_0xf0b0('0x46')]()==_0xf0b0('0x47')){var _0x5870d9=fs[_0xf0b0('0x51')](path[_0xf0b0('0x48')](config[_0xf0b0('0x49')],_0xf0b0('0x57')),_0xf0b0('0x4a'));var _0x50089d=ejs[_0xf0b0('0x4b')](_0x5870d9,{'networks':_0xe58972||[]});fs[_0xf0b0('0x4c')](_0xf0b0('0x4d'),_0x50089d);return respondWithRpcPromise(_0xf0b0('0x4e'),'update',{'module':_0xf0b0('0x4f')});}else if(_0x1891ac['type']['toUpperCase']()==_0xf0b0('0x50')){var _0xa288e=fs[_0xf0b0('0x51')](path['join'](config[_0xf0b0('0x49')],_0xf0b0('0x58')),_0xf0b0('0x4a'));var _0x1ab42f=ejs[_0xf0b0('0x4b')](_0xa288e,{'networks':_0xe58972||[]});fs['writeFileSync'](_0xf0b0('0x52'),_0x1ab42f);return respondWithRpcPromise(_0xf0b0('0x4e'),_0xf0b0('0x1e'),{'module':'res_stun_monitor.so'});}else{var _0x57e566=fs[_0xf0b0('0x51')](path['join'](config[_0xf0b0('0x49')],_0xf0b0('0x53')),_0xf0b0('0x4a'));var _0x306aa1=ejs[_0xf0b0('0x4b')](_0x57e566,{'networks':_0xe58972||[]});fs['writeFileSync'](util[_0xf0b0('0x54')](_0xf0b0('0x55'),_0x123e0a['body'][_0xf0b0('0x29')][_0xf0b0('0x56')]()),_0x306aa1);return respondWithRpcPromise('Reload',_0xf0b0('0x1e'),{'module':_0xf0b0('0x59')});}})[_0xf0b0('0xb')](function(_0x3b2188){if(_0x3b2188){return _0x1891ac;}return null;})['then'](respondWithResult(_0x586eb8,null))[_0xf0b0('0x16')](handleError(_0x586eb8,null));};exports['destroy']=function(_0x44ac0c,_0x4147c6){var _0x5427b8;return db['Network'][_0xf0b0('0x43')]({'where':{'id':_0x44ac0c[_0xf0b0('0x40')]['id']}})[_0xf0b0('0xb')](function(_0x389f3d){_0x5427b8=_0x389f3d;return _0x389f3d;})[_0xf0b0('0xb')](handleEntityNotFound(_0x4147c6,null))[_0xf0b0('0xb')](removeEntity(_0x4147c6,null))[_0xf0b0('0xb')](function(){if(_0x5427b8){return db[_0xf0b0('0x26')][_0xf0b0('0x3d')]({'where':{'type':_0x5427b8[_0xf0b0('0x29')]},'raw':!![]});}})[_0xf0b0('0xb')](function(_0x499874){if(_0x5427b8[_0xf0b0('0x29')][_0xf0b0('0x46')]()=='STUN'){var _0x1ad92a=fs[_0xf0b0('0x51')](path['join'](config[_0xf0b0('0x49')],_0xf0b0('0x57')),_0xf0b0('0x4a'));var _0x50a5f8=ejs['render'](_0x1ad92a,{'networks':_0x499874||[]});fs[_0xf0b0('0x4c')](_0xf0b0('0x4d'),_0x50a5f8);return respondWithRpcPromise('Reload',_0xf0b0('0x1f'),{'module':_0xf0b0('0x4f')});}else if(_0x5427b8[_0xf0b0('0x29')][_0xf0b0('0x46')]()==_0xf0b0('0x50')){var _0x2c1a25=fs[_0xf0b0('0x51')](path[_0xf0b0('0x48')](config[_0xf0b0('0x49')],'server/files/templates/turn_multiple.ejs'),_0xf0b0('0x4a'));var _0x4f67d2=ejs[_0xf0b0('0x4b')](_0x2c1a25,{'networks':_0x499874||[]});fs[_0xf0b0('0x4c')](_0xf0b0('0x52'),_0x4f67d2);return respondWithRpcPromise(_0xf0b0('0x4e'),_0xf0b0('0x1f'),{'module':'res_stun_monitor.so'});}else{var _0x2ffd8d=fs[_0xf0b0('0x51')](path[_0xf0b0('0x48')](config['root'],'server/files/templates/network.ejs'),_0xf0b0('0x4a'));var _0x4f4424=ejs[_0xf0b0('0x4b')](_0x2ffd8d,{'networks':_0x499874||[]});fs['writeFileSync'](util[_0xf0b0('0x54')]('/etc/asterisk/sip_xcally_%s.conf',_0x5427b8[_0xf0b0('0x29')][_0xf0b0('0x56')]()),_0x4f4424);return respondWithRpcPromise('Reload',_0xf0b0('0x1f'),{'module':_0xf0b0('0x59')});}})['catch'](handleError(_0x4147c6,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 5731fd4..c9cdf63 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 _0xa9e0=['../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x571224,_0x2f2c00){var _0x439e1b=function(_0xb4bf97){while(--_0xb4bf97){_0x571224['push'](_0x571224['shift']());}};_0x439e1b(++_0x2f2c00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f8=['Network','network','util','../../config/logger','api','moment','request-promise','define'];(function(_0x5c7214,_0x1a60f4){var _0x331a52=function(_0x122d4b){while(--_0x122d4b){_0x5c7214['push'](_0x5c7214['shift']());}};_0x331a52(++_0x1a60f4);}(_0x37f8,0xd2));var _0x837f=function(_0x5ca438,_0xdd0d22){_0x5ca438=_0x5ca438-0x0;var _0x356eca=_0x37f8[_0x5ca438];return _0x356eca;};'use strict';var _=require('lodash');var util=require(_0x837f('0x0'));var logger=require(_0x837f('0x1'))(_0x837f('0x2'));var moment=require(_0x837f('0x3'));var BPromise=require('bluebird');var rp=require(_0x837f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./network.attributes');module['exports']=function(_0x19c939,_0x42986f){return _0x19c939[_0x837f('0x5')](_0x837f('0x6'),attributes,{'tableName':_0x837f('0x7'),'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 d30c768..610428a 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x157482,_0x2dd53f){_0x157482=_0x157482-0x0;var _0xd295a8=_0x7a54[_0x157482];return _0xd295a8;};'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(_0x5e6633,_0x36233a){var _0x17c757=function(_0x681019){while(--_0x681019){_0x5e6633['push'](_0x5e6633['shift']());}};_0x17c757(++_0x36233a);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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 414af8b..5aeaea4 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 _0xb145=['addAnswer','/:id/applications','addApplications','send','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition'];(function(_0x12a3fb,_0x52e497){var _0x39b60b=function(_0x421c98){while(--_0x421c98){_0x12a3fb['push'](_0x12a3fb['shift']());}};_0x39b60b(++_0x52e497);}(_0xb145,0xa3));var _0x5b14=function(_0x40362b,_0x44cfd2){_0x40362b=_0x40362b-0x0;var _0x38a130=_0xb145[_0x40362b];return _0x38a130;};'use strict';var multer=require('multer');var util=require(_0x5b14('0x0'));var path=require(_0x5b14('0x1'));var timeout=require(_0x5b14('0x2'));var express=require(_0x5b14('0x3'));var router=express[_0x5b14('0x4')]();var fs_extra=require(_0x5b14('0x5'));var auth=require(_0x5b14('0x6'));var interaction=require(_0x5b14('0x7'));var config=require('../../config/environment');var controller=require(_0x5b14('0x8'));router[_0x5b14('0x9')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0xb')]);router['get'](_0x5b14('0xc'),auth[_0x5b14('0xa')](),controller[_0x5b14('0xd')]);router[_0x5b14('0x9')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0xf')]);router[_0x5b14('0x9')]('/:id/dispositions',auth[_0x5b14('0xa')](),controller[_0x5b14('0x10')]);router[_0x5b14('0x9')](_0x5b14('0x11'),auth[_0x5b14('0xa')](),controller['getAnswers']);router[_0x5b14('0x9')]('/:id/applications',auth[_0x5b14('0xa')](),controller[_0x5b14('0x12')]);router[_0x5b14('0x9')](_0x5b14('0x13'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x14')]);router['get'](_0x5b14('0x15'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x16')]);router[_0x5b14('0x17')]('/',auth[_0x5b14('0xa')](),controller[_0x5b14('0x18')]);router[_0x5b14('0x17')](_0x5b14('0x19'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x1a')]);router[_0x5b14('0x17')](_0x5b14('0x11'),auth['isAuthenticated'](),controller[_0x5b14('0x1b')]);router['post']('/:id/notify',controller['notify']);router[_0x5b14('0x17')](_0x5b14('0x1c'),auth[_0x5b14('0xa')](),controller[_0x5b14('0x1d')]);router[_0x5b14('0x17')](_0x5b14('0x15'),auth[_0x5b14('0xa')](),controller['addAgents']);router['post']('/:id/send',auth[_0x5b14('0xa')](),controller[_0x5b14('0x1e')]);router[_0x5b14('0x1f')](_0x5b14('0xe'),auth['isAuthenticated'](),controller[_0x5b14('0x20')]);router[_0x5b14('0x21')]('/:id',auth[_0x5b14('0xa')](),controller[_0x5b14('0x22')]);router['delete'](_0x5b14('0x19'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x5b14('0xa')](),controller[_0x5b14('0x23')]);router[_0x5b14('0x21')]('/:id/users',auth[_0x5b14('0xa')](),controller[_0x5b14('0x24')]);module[_0x5b14('0x25')]=router; \ No newline at end of file +var _0x4325=['getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions'];(function(_0x1c14ae,_0x25ecce){var _0x24c7cf=function(_0x167c24){while(--_0x167c24){_0x1c14ae['push'](_0x1c14ae['shift']());}};_0x24c7cf(++_0x25ecce);}(_0x4325,0x1da));var _0x5432=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4325[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var controller=require(_0x5432('0x7'));router['get']('/',auth[_0x5432('0x8')](),controller[_0x5432('0x9')]);router['get'](_0x5432('0xa'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0xe')]);router['get'](_0x5432('0xf'),auth['isAuthenticated'](),controller[_0x5432('0x10')]);router[_0x5432('0xc')](_0x5432('0x11'),auth[_0x5432('0x8')](),controller['getAnswers']);router['get'](_0x5432('0x12'),auth[_0x5432('0x8')](),controller['getApplications']);router[_0x5432('0xc')](_0x5432('0x13'),auth[_0x5432('0x8')](),controller[_0x5432('0x14')]);router[_0x5432('0xc')](_0x5432('0x15'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5432('0x16')]('/',auth[_0x5432('0x8')](),controller[_0x5432('0x17')]);router[_0x5432('0x16')](_0x5432('0xf'),auth[_0x5432('0x8')](),controller['addDisposition']);router[_0x5432('0x16')]('/:id/canned_answers',auth[_0x5432('0x8')](),controller[_0x5432('0x18')]);router[_0x5432('0x16')](_0x5432('0x19'),controller[_0x5432('0x1a')]);router['post'](_0x5432('0x12'),auth[_0x5432('0x8')](),controller[_0x5432('0x1b')]);router[_0x5432('0x16')](_0x5432('0x15'),auth[_0x5432('0x8')](),controller[_0x5432('0x1c')]);router['post'](_0x5432('0x1d'),auth[_0x5432('0x8')](),controller[_0x5432('0x1e')]);router[_0x5432('0x1f')](_0x5432('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0x20')]);router[_0x5432('0x21')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5432('0x22')]);router[_0x5432('0x21')]('/:id/canned_answers',auth[_0x5432('0x8')](),controller[_0x5432('0x23')]);router[_0x5432('0x21')]('/:id/users',auth[_0x5432('0x8')](),controller[_0x5432('0x24')]);module[_0x5432('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 7321e55..092b7f5 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 _0x39ba=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39ba,0xff));var _0xa39b=function(_0xb70e50,_0xc52786){_0xb70e50=_0xb70e50-0x0;var _0x459f25=_0x39ba[_0xb70e50];return _0x459f25;};'use strict';var Sequelize=require(_0xa39b('0x0'));var rs=require(_0xa39b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa39b('0x2')],'unique':_0xa39b('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa39b('0x2')],'defaultValue':function(){return rs[_0xa39b('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa39b('0x5')],'defaultValue':function(){return _0xa39b('0x6');}},'notificationSound':{'type':Sequelize[_0xa39b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa39b('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa39b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xa39b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa39b('0x2')]},'queueTransfer':{'type':Sequelize[_0xa39b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa39b('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa39b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa39b('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xa39b('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa39b('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x55c3d1){if(!_0x55c3d1)this['setDataValue'](_0xa39b('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x55c3d1);}}}; \ No newline at end of file +var _0xa88f=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xa88f,0x1e6));var _0xfa88=function(_0x40170e,_0x75512e){_0x40170e=_0x40170e-0x0;var _0x464b8a=_0xa88f[_0x40170e];return _0x464b8a;};'use strict';var Sequelize=require(_0xfa88('0x0'));var rs=require(_0xfa88('0x1'));module[_0xfa88('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfa88('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xfa88('0x4')]},'token':{'type':Sequelize[_0xfa88('0x4')],'defaultValue':function(){return rs[_0xfa88('0x5')]();}},'replyUri':{'type':Sequelize[_0xfa88('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfa88('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xfa88('0x6');}},'notificationSound':{'type':Sequelize[_0xfa88('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfa88('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfa88('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfa88('0x4')]},'queueTransfer':{'type':Sequelize[_0xfa88('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfa88('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfa88('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfa88('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xfa88('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfa88('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2a1864){if(!_0x2a1864)this[_0xfa88('0xa')](_0xfa88('0xb'),null);this[_0xfa88('0xa')](_0xfa88('0xc'),_0x2a1864);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 8c0ae4e..c58b0a3 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 _0x2687=['update','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','OpenchannelAccount','include','rows','params','length','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','nolimit','Disposition','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','priority','asc','account','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','push','close','unmanaged','AttachmentId','User','UserId','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','unshift','waitForTheAssignedQueue','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save'];(function(_0x58c81c,_0x1cad7d){var _0x846ea=function(_0x29df93){while(--_0x29df93){_0x58c81c['push'](_0x58c81c['shift']());}};_0x846ea(++_0x1cad7d);}(_0x2687,0x8f));var _0x7268=function(_0x1530bf,_0x14bd16){_0x1530bf=_0x1530bf-0x0;var _0x1da684=_0x2687[_0x1530bf];return _0x1da684;};'use strict';var emlformat=require(_0x7268('0x0'));var rimraf=require(_0x7268('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7268('0x2'));var rp=require(_0x7268('0x3'));var moment=require(_0x7268('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7268('0x5'));var util=require(_0x7268('0x6'));var path=require(_0x7268('0x7'));var sox=require('sox');var csv=require(_0x7268('0x8'));var ejs=require(_0x7268('0x9'));var fs=require('fs');var fs_extra=require(_0x7268('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7268('0xb'));var jsforce=require(_0x7268('0xc'));var deskjs=require(_0x7268('0xd'));var toCsv=require(_0x7268('0x8'));var querystring=require(_0x7268('0xe'));var Papa=require(_0x7268('0xf'));var Redis=require(_0x7268('0x10'));var authService=require(_0x7268('0x11'));var qs=require(_0x7268('0x12'));var as=require(_0x7268('0x13'));var hardwareService=require(_0x7268('0x14'));var logger=require(_0x7268('0x15'))(_0x7268('0x16'));var utils=require(_0x7268('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7268('0x18'));var db=require(_0x7268('0x19'))['db'];config[_0x7268('0x1a')]=_[_0x7268('0x1b')](config[_0x7268('0x1a')],{'host':_0x7268('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelAccount.socket')[_0x7268('0x1d')](socket);var jayson=require(_0x7268('0x1e'));var client=jayson[_0x7268('0x1f')][_0x7268('0x20')]({'port':0x232c});var client9002=jayson[_0x7268('0x1f')][_0x7268('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x8abe85,_0x3e4131,_0x4ce3b4,_0x17a1f6){return new BPromise(function(_0x5717d3,_0x1f99de){var _0x44b1c6=_0x17a1f6||client;return _0x44b1c6['request'](_0x8abe85,_0x4ce3b4)[_0x7268('0x21')](function(_0xd10e9c){logger['info'](_0x7268('0x22'),_0x3e4131,'request\x20sent');logger[_0x7268('0x23')](_0x7268('0x24'),_0x3e4131,'request\x20sent',JSON[_0x7268('0x25')](_0xd10e9c));if(_0xd10e9c['error']){if(_0xd10e9c[_0x7268('0x26')][_0x7268('0x27')]===0x1f4){logger[_0x7268('0x26')](_0x7268('0x22'),_0x3e4131,_0xd10e9c['error'][_0x7268('0x28')]);return _0x1f99de(_0xd10e9c[_0x7268('0x26')][_0x7268('0x28')]);}logger[_0x7268('0x26')](_0x7268('0x22'),_0x3e4131,_0xd10e9c[_0x7268('0x26')]['message']);return _0x5717d3(_0xd10e9c[_0x7268('0x26')][_0x7268('0x28')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x3e4131,'request\x20sent');_0x5717d3(_0xd10e9c[_0x7268('0x29')][_0x7268('0x28')]);}})[_0x7268('0x2a')](function(_0xf48160){logger[_0x7268('0x26')](_0x7268('0x22'),_0x3e4131,_0xf48160);_0x1f99de(_0xf48160);});});}function respondWithStatusCode(_0x5fe695,_0x56ec74){_0x56ec74=_0x56ec74||0xcc;return function(_0x4726f4){if(_0x4726f4){return _0x5fe695[_0x7268('0x2b')](_0x56ec74);}return _0x5fe695[_0x7268('0x2c')](_0x56ec74)[_0x7268('0x2d')]();};}function respondWithResult(_0x34a505,_0x31de72){_0x31de72=_0x31de72||0xc8;return function(_0x45e5ea){if(_0x45e5ea){return _0x34a505[_0x7268('0x2c')](_0x31de72)[_0x7268('0x2e')](_0x45e5ea);}};}function respondWithFilteredResult(_0x2aeb79,_0x3ba6a1){return function(_0x2cef22){if(_0x2cef22){var _0x159adb=typeof _0x3ba6a1[_0x7268('0x2f')]===_0x7268('0x30')&&typeof _0x3ba6a1[_0x7268('0x31')]===_0x7268('0x30');var _0x30daf8=_0x2cef22[_0x7268('0x32')];var _0xe67808=_0x159adb?0x0:_0x3ba6a1[_0x7268('0x2f')];var _0x18fb34=_0x159adb?_0x2cef22[_0x7268('0x32')]:_0x3ba6a1[_0x7268('0x2f')]+_0x3ba6a1['limit'];var _0x5df0a7;if(_0x18fb34>=_0x30daf8){_0x18fb34=_0x30daf8;_0x5df0a7=0xc8;}else{_0x5df0a7=0xce;}_0x2aeb79['status'](_0x5df0a7);return _0x2aeb79[_0x7268('0x33')](_0x7268('0x34'),_0xe67808+'-'+_0x18fb34+'/'+_0x30daf8)[_0x7268('0x2e')](_0x2cef22);}return null;};}function patchUpdates(_0x411b13){return function(_0x566c94){try{jsonpatch['apply'](_0x566c94,_0x411b13,!![]);}catch(_0x50cbe4){return BPromise['reject'](_0x50cbe4);}return _0x566c94[_0x7268('0x35')]();};}function saveUpdates(_0x5e1ffe,_0x239ea2){return function(_0x5c29c9){if(_0x5c29c9){return _0x5c29c9[_0x7268('0x36')](_0x5e1ffe)['then'](function(_0x25bf4b){return _0x25bf4b;});}return null;};}function removeEntity(_0x345ae2,_0x4dcdd7){return function(_0x29be36){if(_0x29be36){return _0x29be36[_0x7268('0x37')]()[_0x7268('0x21')](function(){var _0x54eea3=_0x29be36[_0x7268('0x38')]({'plain':!![]});var _0x2a45ff=_0x7268('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x2a45ff,'resourceId':_0x54eea3['id']}})[_0x7268('0x21')](function(){return _0x29be36;});})['then'](function(){_0x345ae2[_0x7268('0x2c')](0xcc)[_0x7268('0x2d')]();});}};}function handleEntityNotFound(_0x55f37e,_0x4cf14d){return function(_0x1e5cee){if(!_0x1e5cee){_0x55f37e[_0x7268('0x2b')](0x194);}return _0x1e5cee;};}function handleError(_0xccba4d,_0x5b5d19){_0x5b5d19=_0x5b5d19||0x1f4;return function(_0x4373c4){logger[_0x7268('0x26')](_0x4373c4[_0x7268('0x3a')]);if(_0x4373c4['name']){delete _0x4373c4[_0x7268('0x3b')];}_0xccba4d['status'](_0x5b5d19)[_0x7268('0x3c')](_0x4373c4);};}exports[_0x7268('0x3d')]=function(_0x32eb3d,_0xcd8697){var _0x5111dd={'include':[{'model':db[_0x7268('0x3e')],'as':_0x7268('0x3f')}]},_0x29310a={},_0x2e01da={'count':0x0,'rows':[]};var _0x483c54=_[_0x7268('0x40')](db['OpenchannelAccount'][_0x7268('0x41')],function(_0x45f113){return{'name':_0x45f113[_0x7268('0x42')],'type':_0x45f113[_0x7268('0x43')][_0x7268('0x44')]};});_0x29310a[_0x7268('0x45')]=_[_0x7268('0x40')](_0x483c54,_0x7268('0x3b'));_0x29310a['query']=_[_0x7268('0x46')](_0x32eb3d[_0x7268('0x47')]);_0x29310a[_0x7268('0x48')]=_[_0x7268('0x49')](_0x29310a['model'],_0x29310a[_0x7268('0x47')]);_0x5111dd[_0x7268('0x4a')]=_[_0x7268('0x49')](_0x29310a['model'],qs['fields'](_0x32eb3d[_0x7268('0x47')][_0x7268('0x4b')]));_0x5111dd[_0x7268('0x4a')]=_0x5111dd[_0x7268('0x4a')]['length']?_0x5111dd[_0x7268('0x4a')]:_0x29310a[_0x7268('0x45')];if(!_0x32eb3d[_0x7268('0x47')][_0x7268('0x4c')]('nolimit')){_0x5111dd['limit']=qs[_0x7268('0x31')](_0x32eb3d['query'][_0x7268('0x31')]);_0x5111dd[_0x7268('0x2f')]=qs[_0x7268('0x2f')](_0x32eb3d[_0x7268('0x47')][_0x7268('0x2f')]);}_0x5111dd[_0x7268('0x4d')]=qs[_0x7268('0x4e')](_0x32eb3d[_0x7268('0x47')]['sort']);_0x5111dd['where']=qs['filters'](_[_0x7268('0x4f')](_0x32eb3d[_0x7268('0x47')],_0x29310a[_0x7268('0x48')]),_0x483c54);if(_0x32eb3d['query']['filter']){_0x5111dd['where']=_['merge'](_0x5111dd[_0x7268('0x50')],{'$or':_[_0x7268('0x40')](_0x483c54,function(_0x1e4a39){if(_0x1e4a39[_0x7268('0x43')]!==_0x7268('0x51')){var _0x532673={};_0x532673[_0x1e4a39[_0x7268('0x3b')]]={'$like':'%'+_0x32eb3d[_0x7268('0x47')][_0x7268('0x52')]+'%'};return _0x532673;}})});}_0x5111dd=_[_0x7268('0x53')]({},_0x5111dd,_0x32eb3d[_0x7268('0x54')]);var _0x2db0dd={'where':_0x5111dd['where']};return db[_0x7268('0x55')][_0x7268('0x32')](_0x2db0dd)[_0x7268('0x21')](function(_0x296282){_0x2e01da['count']=_0x296282;if(_0x32eb3d[_0x7268('0x47')]['includeAll']){_0x5111dd[_0x7268('0x56')]=[{'all':!![]}];}return db[_0x7268('0x55')]['findAll'](_0x5111dd);})[_0x7268('0x21')](function(_0x1112cc){_0x2e01da[_0x7268('0x57')]=_0x1112cc;return _0x2e01da;})[_0x7268('0x21')](respondWithFilteredResult(_0xcd8697,_0x5111dd))['catch'](handleError(_0xcd8697,null));};exports['show']=function(_0x46341a,_0x1ae0f6){var _0x56e26b={'raw':![],'where':{'id':_0x46341a[_0x7268('0x58')]['id']},'include':[{'model':db[_0x7268('0x3e')],'as':_0x7268('0x3f')}]},_0x554db5={};_0x554db5[_0x7268('0x45')]=_[_0x7268('0x46')](db['OpenchannelAccount'][_0x7268('0x41')]);_0x554db5[_0x7268('0x47')]=_[_0x7268('0x46')](_0x46341a['query']);_0x554db5[_0x7268('0x48')]=_[_0x7268('0x49')](_0x554db5['model'],_0x554db5['query']);_0x56e26b[_0x7268('0x4a')]=_[_0x7268('0x49')](_0x554db5[_0x7268('0x45')],qs[_0x7268('0x4b')](_0x46341a['query']['fields']));_0x56e26b['attributes']=_0x56e26b['attributes'][_0x7268('0x59')]?_0x56e26b[_0x7268('0x4a')]:_0x554db5[_0x7268('0x45')];if(_0x46341a[_0x7268('0x47')][_0x7268('0x5a')]){_0x56e26b['include']=[{'all':!![]}];}_0x56e26b=_['merge']({},_0x56e26b,_0x46341a[_0x7268('0x54')]);return db[_0x7268('0x55')][_0x7268('0x5b')](_0x56e26b)[_0x7268('0x21')](handleEntityNotFound(_0x1ae0f6,null))[_0x7268('0x21')](respondWithResult(_0x1ae0f6,null))['catch'](handleError(_0x1ae0f6,null));};exports[_0x7268('0x5c')]=function(_0x53ca2a,_0x421a32){return db[_0x7268('0x55')]['create'](_0x53ca2a[_0x7268('0x5d')],{})[_0x7268('0x21')](function(_0x48dfe8){var _0x3b0049=_0x53ca2a[_0x7268('0x5e')][_0x7268('0x38')]({'plain':!![]});if(!_0x3b0049)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b0049[_0x7268('0x5f')]==='user'){var _0x5d6d68=_0x48dfe8['get']({'plain':!![]});var _0x2f7edf=_0x7268('0x39');return db[_0x7268('0x60')]['find']({'where':{'name':_0x2f7edf,'userProfileId':_0x3b0049[_0x7268('0x61')]},'raw':!![]})['then'](function(_0x6199ed){if(_0x6199ed&&_0x6199ed['autoAssociation']===0x0){return db['UserProfileResource'][_0x7268('0x5c')]({'name':_0x5d6d68[_0x7268('0x3b')],'resourceId':_0x5d6d68['id'],'type':_0x6199ed['name'],'sectionId':_0x6199ed['id']},{})['then'](function(){return _0x48dfe8;});}else{return _0x48dfe8;}})[_0x7268('0x2a')](function(_0x116e01){logger[_0x7268('0x26')](_0x7268('0x62'),_0x116e01);throw _0x116e01;});}return _0x48dfe8;})[_0x7268('0x21')](respondWithResult(_0x421a32,0xc9))[_0x7268('0x2a')](handleError(_0x421a32,null));};exports[_0x7268('0x36')]=function(_0x29b887,_0x269002){if(_0x29b887[_0x7268('0x5d')]['id']){delete _0x29b887[_0x7268('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x29b887['params']['id']},'include':[{'model':db['Pause'],'as':_0x7268('0x3f')}]})[_0x7268('0x21')](handleEntityNotFound(_0x269002,null))['then'](saveUpdates(_0x29b887[_0x7268('0x5d')],null))[_0x7268('0x21')](respondWithResult(_0x269002,null))[_0x7268('0x2a')](handleError(_0x269002,null));};exports['destroy']=function(_0x395fdb,_0x447e84){return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x395fdb[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x447e84,null))[_0x7268('0x21')](removeEntity(_0x447e84,null))[_0x7268('0x2a')](handleError(_0x447e84,null));};exports[_0x7268('0x63')]=function(_0xd6368e,_0x2d3c05){return db['OpenchannelAccount'][_0x7268('0x63')]()[_0x7268('0x21')](respondWithResult(_0x2d3c05,null))[_0x7268('0x2a')](handleError(_0x2d3c05,null));};exports[_0x7268('0x64')]=function(_0x3c1608,_0x31bd1f,_0x22c753){if(_0x3c1608[_0x7268('0x5d')]['id']){delete _0x3c1608[_0x7268('0x5d')]['id'];}return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x3c1608[_0x7268('0x58')]['id']}})['then'](handleEntityNotFound(_0x31bd1f,null))[_0x7268('0x21')](function(_0x19a341){if(_0x19a341){_0x3c1608[_0x7268('0x5d')][_0x7268('0x65')]=_0x19a341['id'];return db['Disposition']['create'](_0x3c1608['body']);}})[_0x7268('0x21')](respondWithResult(_0x31bd1f,null))[_0x7268('0x2a')](handleError(_0x31bd1f,null));};exports[_0x7268('0x66')]=function(_0x51665b,_0x392d04,_0x2a8e5f){var _0xa84ce2={'raw':![],'where':{}};var _0xa91ae5={};var _0x547389={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x51665b['params']['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x392d04,null))[_0x7268('0x21')](function(_0x2619be){if(_0x2619be){_0xa91ae5[_0x7268('0x45')]=_[_0x7268('0x46')](db['Disposition'][_0x7268('0x41')]);_0xa91ae5[_0x7268('0x47')]=_[_0x7268('0x46')](_0x51665b[_0x7268('0x47')]);_0xa91ae5[_0x7268('0x48')]=_[_0x7268('0x49')](_0xa91ae5[_0x7268('0x45')],_0xa91ae5[_0x7268('0x47')]);_0xa84ce2[_0x7268('0x4a')]=_['intersection'](_0xa91ae5[_0x7268('0x45')],qs[_0x7268('0x4b')](_0x51665b[_0x7268('0x47')]['fields']));_0xa84ce2['attributes']=_0xa84ce2[_0x7268('0x4a')][_0x7268('0x59')]?_0xa84ce2['attributes']:_0xa91ae5[_0x7268('0x45')];if(!_0x51665b[_0x7268('0x47')][_0x7268('0x4c')](_0x7268('0x67'))){_0xa84ce2['limit']=qs[_0x7268('0x31')](_0x51665b['query']['limit']);_0xa84ce2['offset']=qs[_0x7268('0x2f')](_0x51665b[_0x7268('0x47')]['offset']);}_0xa84ce2[_0x7268('0x4d')]=qs[_0x7268('0x4e')](_0x51665b[_0x7268('0x47')][_0x7268('0x4e')]);_0xa84ce2[_0x7268('0x50')]=qs[_0x7268('0x48')](_[_0x7268('0x4f')](_0x51665b[_0x7268('0x47')],_0xa91ae5[_0x7268('0x48')]));_0xa84ce2['where']['OpenchannelAccountId']=_0x2619be['id'];if(_0x51665b[_0x7268('0x47')][_0x7268('0x52')]){_0xa84ce2[_0x7268('0x50')]=_['merge'](_0xa84ce2[_0x7268('0x50')],{'$or':_['map'](_0xa84ce2[_0x7268('0x4a')],function(_0x1f868b){var _0x1b8fa1={};_0x1b8fa1[_0x1f868b]={'$like':'%'+_0x51665b[_0x7268('0x47')][_0x7268('0x52')]+'%'};return _0x1b8fa1;})});}_0xa84ce2=_[_0x7268('0x53')]({},_0xa84ce2,_0x51665b['options']);return db[_0x7268('0x68')][_0x7268('0x32')]({'where':_0xa84ce2[_0x7268('0x50')]})[_0x7268('0x21')](function(_0x3d1654){_0x547389[_0x7268('0x32')]=_0x3d1654;if(_0x51665b[_0x7268('0x47')][_0x7268('0x5a')]){_0xa84ce2[_0x7268('0x56')]=[{'all':!![]}];}return db[_0x7268('0x68')][_0x7268('0x69')](_0xa84ce2);})['then'](function(_0x2c17e1){_0x547389[_0x7268('0x57')]=_0x2c17e1;return _0x547389;});}})['then'](respondWithFilteredResult(_0x392d04,_0xa84ce2))[_0x7268('0x2a')](handleError(_0x392d04,null));};exports['removeDispositions']=function(_0x3ea3d8,_0x1b26ca,_0x113940){return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x3ea3d8[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x1b26ca,null))[_0x7268('0x21')](function(_0x2209f9){if(_0x2209f9){return _0x2209f9[_0x7268('0x6a')](_0x3ea3d8[_0x7268('0x47')]['ids']);}})[_0x7268('0x21')](respondWithStatusCode(_0x1b26ca,null))[_0x7268('0x2a')](handleError(_0x1b26ca,null));};exports[_0x7268('0x6b')]=function(_0x3eabb2,_0x4ab0e4,_0xea6f5f){if(_0x3eabb2[_0x7268('0x5d')]['id']){delete _0x3eabb2['body']['id'];}return db[_0x7268('0x55')]['find']({'where':{'id':_0x3eabb2[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x4ab0e4,null))[_0x7268('0x21')](function(_0x593a7c){if(_0x593a7c){_0x3eabb2[_0x7268('0x5d')][_0x7268('0x65')]=_0x593a7c['id'];return db[_0x7268('0x6c')]['create'](_0x3eabb2[_0x7268('0x5d')]);}})[_0x7268('0x21')](respondWithResult(_0x4ab0e4,null))[_0x7268('0x2a')](handleError(_0x4ab0e4,null));};exports[_0x7268('0x6d')]=function(_0x46f301,_0x43cb3c,_0x22d91c){var _0xa3aa12={'raw':![],'where':{}};var _0xf49dbe={};var _0xfe024f={'count':0x0,'rows':[]};return db[_0x7268('0x55')][_0x7268('0x6e')]({'where':{'id':_0x46f301[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x43cb3c,null))[_0x7268('0x21')](function(_0xdf7ac0){if(_0xdf7ac0){_0xf49dbe[_0x7268('0x45')]=_[_0x7268('0x46')](db[_0x7268('0x6c')][_0x7268('0x41')]);_0xf49dbe[_0x7268('0x47')]=_[_0x7268('0x46')](_0x46f301[_0x7268('0x47')]);_0xf49dbe[_0x7268('0x48')]=_[_0x7268('0x49')](_0xf49dbe[_0x7268('0x45')],_0xf49dbe[_0x7268('0x47')]);_0xa3aa12[_0x7268('0x4a')]=_[_0x7268('0x49')](_0xf49dbe['model'],qs[_0x7268('0x4b')](_0x46f301[_0x7268('0x47')]['fields']));_0xa3aa12[_0x7268('0x4a')]=_0xa3aa12['attributes'][_0x7268('0x59')]?_0xa3aa12[_0x7268('0x4a')]:_0xf49dbe[_0x7268('0x45')];if(!_0x46f301[_0x7268('0x47')]['hasOwnProperty']('nolimit')){_0xa3aa12[_0x7268('0x31')]=qs[_0x7268('0x31')](_0x46f301['query'][_0x7268('0x31')]);_0xa3aa12['offset']=qs[_0x7268('0x2f')](_0x46f301[_0x7268('0x47')][_0x7268('0x2f')]);}_0xa3aa12[_0x7268('0x4d')]=qs[_0x7268('0x4e')](_0x46f301[_0x7268('0x47')][_0x7268('0x4e')]);_0xa3aa12[_0x7268('0x50')]=qs[_0x7268('0x48')](_[_0x7268('0x4f')](_0x46f301['query'],_0xf49dbe['filters']));_0xa3aa12[_0x7268('0x50')][_0x7268('0x65')]=_0xdf7ac0['id'];if(_0x46f301[_0x7268('0x47')][_0x7268('0x52')]){_0xa3aa12[_0x7268('0x50')]=_[_0x7268('0x53')](_0xa3aa12['where'],{'$or':_[_0x7268('0x40')](_0xa3aa12['attributes'],function(_0x2a5c2b){var _0x44d5b3={};_0x44d5b3[_0x2a5c2b]={'$like':'%'+_0x46f301[_0x7268('0x47')][_0x7268('0x52')]+'%'};return _0x44d5b3;})});}_0xa3aa12=_[_0x7268('0x53')]({},_0xa3aa12,_0x46f301['options']);return db[_0x7268('0x6c')][_0x7268('0x32')]({'where':_0xa3aa12[_0x7268('0x50')]})[_0x7268('0x21')](function(_0x38684d){_0xfe024f[_0x7268('0x32')]=_0x38684d;if(_0x46f301[_0x7268('0x47')][_0x7268('0x5a')]){_0xa3aa12[_0x7268('0x56')]=[{'all':!![]}];}return db[_0x7268('0x6c')][_0x7268('0x69')](_0xa3aa12);})[_0x7268('0x21')](function(_0x12dea){_0xfe024f['rows']=_0x12dea;return _0xfe024f;});}})[_0x7268('0x21')](respondWithFilteredResult(_0x43cb3c,_0xa3aa12))['catch'](handleError(_0x43cb3c,null));};exports[_0x7268('0x6f')]=function(_0x2810c0,_0x5c8611,_0x15ba98){return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x2810c0[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x5c8611,null))['then'](function(_0x2f9763){if(_0x2f9763){return _0x2f9763[_0x7268('0x6f')](_0x2810c0['query'][_0x7268('0x70')]);}})[_0x7268('0x21')](respondWithStatusCode(_0x5c8611,null))[_0x7268('0x2a')](handleError(_0x5c8611,null));};exports[_0x7268('0x71')]=function(_0x346521,_0x48efa8,_0x3b9f20){var _0x105bd5={'body':_0x346521[_0x7268('0x5d')],'channel':_0x7268('0x72')};var _0x482edc=[];var _0x325324=[];var _0x5ad68d={};var _0x35ac60=![];return db[_0x7268('0x73')]['describe']()[_0x7268('0x21')](function(_0xf76ad2){if(!_0xf76ad2){throw new db['Sequelize'][(_0x7268('0x74'))](_0x7268('0x75'));}_0x482edc=_[_0x7268('0x76')](_[_0x7268('0x46')](_0xf76ad2),[_0x7268('0x77'),'updatedAt']);_0x325324=_[_0x7268('0x76')](_[_0x7268('0x46')](_0xf76ad2),[_0x7268('0x77'),_0x7268('0x78'),_0x7268('0x79'),_0x7268('0x7a')]);if(_0x346521[_0x7268('0x5d')]['id']){delete _0x346521[_0x7268('0x5d')]['id'];}if(_[_0x7268('0x7b')](_0x346521['body'][_0x7268('0x7c')])){throw new db[(_0x7268('0x7d'))][(_0x7268('0x74'))](_0x7268('0x7e'));}if(_[_0x7268('0x7b')](_0x346521[_0x7268('0x5d')][_0x7268('0x5d')])||_0x346521['body']['body']===''){throw new db['Sequelize'][(_0x7268('0x74'))](_0x7268('0x7f'));}if(_['isNil'](_0x346521['body'][_0x7268('0x80')])){throw new db[(_0x7268('0x7d'))][(_0x7268('0x74'))](_0x7268('0x81')+_0x325324);}if(!_['includes'](_0x325324,_0x346521[_0x7268('0x5d')]['mapKey'])){throw new db[(_0x7268('0x7d'))][(_0x7268('0x74'))](_0x7268('0x82')+_0x325324);}_0x5ad68d[_0x346521[_0x7268('0x5d')][_0x7268('0x80')]]=_0x346521[_0x7268('0x5d')]['from'];})['then'](function(){return db[_0x7268('0x55')]['find']({'where':{'id':_0x346521[_0x7268('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x7268('0x83'),'include':[{'model':db[_0x7268('0x73')],'as':_0x7268('0x84'),'where':_0x5ad68d,'limit':0x1,'order':[[_0x7268('0x78'),_0x7268('0x85')]]}]},{'model':db[_0x7268('0x86')],'as':_0x7268('0x87')}]});})[_0x7268('0x21')](handleEntityNotFound(_0x48efa8,null))[_0x7268('0x21')](function(_0x289c04){if(_0x289c04&&_0x289c04[_0x7268('0x83')]){_0x105bd5['account']=_0x289c04;_0x105bd5[_0x7268('0x88')]=_0x289c04[_0x7268('0x87')];_0x105bd5[_0x7268('0x89')]=_0x289c04[_0x7268('0x83')];_0x105bd5[_0x7268('0x88')]=_['orderBy'](_0x105bd5['applications'],[_0x7268('0x8a')],[_0x7268('0x8b')]);if(_0x105bd5[_0x7268('0x8c')]['Applications']){delete _0x105bd5[_0x7268('0x8c')][_0x7268('0x87')];}if(_0x105bd5[_0x7268('0x8c')][_0x7268('0x83')]&&_0x105bd5[_0x7268('0x8c')][_0x7268('0x83')][_0x7268('0x84')][_0x7268('0x59')]){return _0x105bd5['account'][_0x7268('0x83')]['Contacts'][0x0];}var _0x475907=_['defaults'](_0x346521[_0x7268('0x5d')],{'firstName':_0x346521[_0x7268('0x5d')][_0x7268('0x7c')],'ListId':_0x289c04[_0x7268('0x7a')]});_0x475907[_0x346521[_0x7268('0x5d')][_0x7268('0x80')]]=_0x346521[_0x7268('0x5d')]['from'];return db[_0x7268('0x73')]['create'](_0x475907,{'fields':_0x482edc,'raw':!![]});}})[_0x7268('0x21')](handleEntityNotFound(_0x48efa8,null))[_0x7268('0x21')](function(_0x4b2c3b){_0x105bd5['contact']=_0x4b2c3b;if(_0x4b2c3b){var _0x1a7f7b={'ContactId':_0x4b2c3b['id'],'OpenchannelAccountId':_0x346521[_0x7268('0x58')]['id'],'from':(_0x4b2c3b[_0x7268('0x8d')]||'')+'\x20'+(_0x4b2c3b[_0x7268('0x8e')]||'')};var _0x2dae50={'OpenchannelAccountId':_0x346521[_0x7268('0x58')]['id'],'closed':![]};if(_0x346521[_0x7268('0x5d')][_0x7268('0x8f')]){_0x2dae50[_0x7268('0x8f')]=_0x346521[_0x7268('0x5d')][_0x7268('0x8f')];return db[_0x7268('0x90')][_0x7268('0x5b')]({'where':_0x2dae50})['then'](function(_0x11ea6e){if(_0x11ea6e){return[_0x11ea6e,![]];}_0x1a7f7b[_0x7268('0x8f')]=_0x346521[_0x7268('0x5d')][_0x7268('0x8f')];_0x1a7f7b[_0x7268('0x91')]=_0x346521['body'][_0x7268('0x91')];return db['OpenchannelInteraction'][_0x7268('0x5c')](_0x1a7f7b)[_0x7268('0x21')](function(_0x4cc5c7){return[_0x4cc5c7,!![]];});});}else{_0x2dae50[_0x7268('0x8f')]=null;}_0x2dae50[_0x7268('0x92')]=_0x4b2c3b['id'];return db[_0x7268('0x90')][_0x7268('0x5b')]({'where':_0x2dae50})[_0x7268('0x21')](function(_0x5ee4e0){if(_0x5ee4e0){return[_0x5ee4e0,![]];}return db[_0x7268('0x90')][_0x7268('0x5c')](_0x1a7f7b)[_0x7268('0x21')](function(_0x1d251e){return[_0x1d251e,!![]];});});}})[_0x7268('0x93')](function(_0x351be7,_0x5f1eb7){if(_0x351be7){_0x35ac60=_0x5f1eb7;if(!_0x5f1eb7){var _0x3588bc={'from':(_0x105bd5[_0x7268('0x94')][_0x7268('0x8d')]||'')+'\x20'+(_0x105bd5[_0x7268('0x94')][_0x7268('0x8e')]||'')};if(_0x346521['body'][_0x7268('0x8f')]&&_0x346521[_0x7268('0x5d')][_0x7268('0x95')]&&_0x346521[_0x7268('0x5d')]['threadId']!=_0x346521[_0x7268('0x5d')][_0x7268('0x95')]){_0x3588bc[_0x7268('0x8f')]=_0x346521[_0x7268('0x5d')][_0x7268('0x95')];}return _0x351be7['update'](_0x3588bc);}else{return _0x351be7;}}})[_0x7268('0x21')](function(_0xe9fe1b){_0x105bd5[_0x7268('0x96')]=_0xe9fe1b[_0x7268('0x38')]({'plain':!![]});_0x105bd5[_0x7268('0x96')][_0x7268('0x97')]=_0x35ac60;if(_0x105bd5[_0x7268('0x96')][_0x7268('0x97')]){if(_0x105bd5[_0x7268('0x8c')]['autoclose']){_0x105bd5[_0x7268('0x88')][_0x7268('0x98')]({'id':0x0,'priority':_0x105bd5[_0x7268('0x88')][_0x7268('0x59')]+0x1,'app':_0x7268('0x99'),'appdata':_0x7268('0x9a'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage'][_0x7268('0x5c')]({'body':_0x346521[_0x7268('0x5d')][_0x7268('0x5d')],'OpenchannelAccountId':_0x346521[_0x7268('0x58')]['id'],'OpenchannelInteractionId':_0xe9fe1b['id'],'direction':'in','ContactId':_0x105bd5[_0x7268('0x94')]['id'],'AttachmentId':_0x346521['body'][_0x7268('0x9b')]});})[_0x7268('0x21')](function(_0xaf6280){_0x105bd5[_0x7268('0x28')]=_0xaf6280;if(!_0x105bd5[_0x7268('0x96')]['UserId'])return;return db[_0x7268('0x9c')][_0x7268('0x5b')]({'attributes':['id','name'],'where':{'id':_0x105bd5[_0x7268('0x96')][_0x7268('0x9d')]}});})[_0x7268('0x21')](function(_0x4d6a1d){if(_0x4d6a1d){_0x105bd5[_0x7268('0x88')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7268('0x9e'),'appdata':_0x4d6a1d['name']+','+(_0x105bd5['account'][_0x7268('0x9f')]||0xa),'interval':'*,*,*,*'});}if(!_0x105bd5[_0x7268('0x96')][_0x7268('0xa0')])return;return db[_0x7268('0xa1')]['find']({'attributes':['id',_0x7268('0x3b')],'where':{'id':_0x105bd5[_0x7268('0x96')]['queueId']}});})[_0x7268('0x21')](function(_0x540ef5){if(_0x540ef5){_0x105bd5[_0x7268('0x88')][_0x7268('0xa2')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x540ef5['name']+','+(_0x105bd5[_0x7268('0x8c')][_0x7268('0xa3')]||0x12c),'interval':_0x7268('0xa4')});}return respondWithRpcPromise(_0x7268('0xa5'),_0x7268('0xa6'),_0x105bd5);})[_0x7268('0x21')](function(_0x26000a){respondWithRpcPromise(_0x7268('0xa7'),_0x7268('0xa7'),{'event':_0x7268('0x71'),'message':_0x26000a},client9002);return _0x26000a;})[_0x7268('0x21')](respondWithResult(_0x48efa8,null))[_0x7268('0x2a')](handleError(_0x48efa8,null));};exports[_0x7268('0xa8')]=function(_0x2b4a42,_0x105f92){var _0x1cfee3=_0x2b4a42['params']['id'];var _0x3e29ee=_0x2b4a42[_0x7268('0x5d')];var _0x4807ba=0xc8;var _0x19a3a7=null;return db[_0x7268('0xa9')][_0x7268('0xaa')]({'isolationLevel':db[_0x7268('0xa9')][_0x7268('0xab')][_0x7268('0xac')][_0x7268('0xad')]},function(_0x1f6d5c){return db[_0x7268('0x55')]['findOne']({'where':{'id':_0x1cfee3},'transaction':_0x1f6d5c})['then'](function(_0x16ae43){if(_0x16ae43){return db[_0x7268('0x86')][_0x7268('0x37')]({'where':{'OpenchannelAccountId':_0x1cfee3},'transaction':_0x1f6d5c})[_0x7268('0x21')](function(){var _0x5cb820=_[_0x7268('0x40')](_0x3e29ee,function(_0x13c608){_0x13c608[_0x7268('0x65')]=_0x1cfee3;return _0x13c608;});return db[_0x7268('0x86')][_0x7268('0xae')](_0x5cb820,{'transaction':_0x1f6d5c});});}else{_0x4807ba=0x194;_0x19a3a7=[];}});})[_0x7268('0x21')](function(){if(_0x4807ba!==0x194){return db[_0x7268('0x86')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x1cfee3},'order':_0x7268('0x8a')})[_0x7268('0x21')](function(_0x3bb176){_0x19a3a7=_0x3bb176;});}})['catch'](function(_0x2eded8){_0x4807ba=0x1f4;logger[_0x7268('0x26')](_0x2eded8[_0x7268('0x3a')]);if(_0x2eded8[_0x7268('0x3b')]){delete _0x2eded8[_0x7268('0x3b')];}_0x19a3a7=_0x2eded8;})[_0x7268('0xaf')](function(){if(_0x19a3a7===null){_0x105f92[_0x7268('0x2b')](_0x4807ba);}else{if(_0x4807ba===0x1f4){_0x105f92['status'](_0x4807ba)['send'](_0x19a3a7);}else{_0x105f92[_0x7268('0x2c')](_0x4807ba)[_0x7268('0x2e')](_0x19a3a7);}}});};exports[_0x7268('0xb0')]=function(_0x134e8e,_0x1abd7f,_0xabac1c){var _0x13c2b1={};var _0x124702={};var _0x3960f3;var _0x2390ea;return db[_0x7268('0x55')]['findOne']({'where':{'id':_0x134e8e[_0x7268('0x58')]['id']}})['then'](handleEntityNotFound(_0x1abd7f,null))[_0x7268('0x21')](function(_0xa36492){if(_0xa36492){_0x3960f3=_0xa36492;_0x124702['model']=_[_0x7268('0x46')](db[_0x7268('0x86')]['rawAttributes']);_0x124702[_0x7268('0x47')]=_[_0x7268('0x46')](_0x134e8e[_0x7268('0x47')]);_0x124702['filters']=_[_0x7268('0x49')](_0x124702[_0x7268('0x45')],_0x124702[_0x7268('0x47')]);_0x13c2b1[_0x7268('0x4a')]=_[_0x7268('0x49')](_0x124702[_0x7268('0x45')],qs['fields'](_0x134e8e[_0x7268('0x47')][_0x7268('0x4b')]));_0x13c2b1[_0x7268('0x4a')]=_0x13c2b1[_0x7268('0x4a')][_0x7268('0x59')]?_0x13c2b1[_0x7268('0x4a')]:_0x124702[_0x7268('0x45')];_0x13c2b1['order']=qs['sort'](_0x134e8e[_0x7268('0x47')][_0x7268('0x4e')]);_0x13c2b1['where']=qs[_0x7268('0x48')](_['pick'](_0x134e8e[_0x7268('0x47')],_0x124702[_0x7268('0x48')]));if(_0x134e8e[_0x7268('0x47')][_0x7268('0x52')]){_0x13c2b1['where']=_[_0x7268('0x53')](_0x13c2b1['where'],{'$or':_[_0x7268('0x40')](_0x13c2b1[_0x7268('0x4a')],function(_0x4d54f4){var _0x4c1121={};_0x4c1121[_0x4d54f4]={'$like':'%'+_0x134e8e[_0x7268('0x47')][_0x7268('0x52')]+'%'};return _0x4c1121;})});}_0x13c2b1=_[_0x7268('0x53')]({},_0x13c2b1,_0x134e8e[_0x7268('0x54')]);return _0x3960f3[_0x7268('0xb0')](_0x13c2b1);}})[_0x7268('0x21')](function(_0x1679de){if(_0x1679de){_0x2390ea=_0x1679de[_0x7268('0x59')];if(!_0x134e8e[_0x7268('0x47')]['hasOwnProperty'](_0x7268('0x67'))){_0x13c2b1[_0x7268('0x31')]=qs[_0x7268('0x31')](_0x134e8e['query']['limit']);_0x13c2b1[_0x7268('0x2f')]=qs[_0x7268('0x2f')](_0x134e8e[_0x7268('0x47')][_0x7268('0x2f')]);}return _0x3960f3[_0x7268('0xb0')](_0x13c2b1);}})['then'](function(_0x4c137b){if(_0x4c137b){return _0x4c137b?{'count':_0x2390ea,'rows':_0x4c137b}:null;}})['then'](respondWithResult(_0x1abd7f,null))[_0x7268('0x2a')](handleError(_0x1abd7f,null));};exports[_0x7268('0xb1')]=function(_0x237d6a,_0x16a481,_0x237f9f){var _0x20a586={'raw':![],'where':{}};var _0x21413e={};var _0x1e0a58={'count':0x0,'rows':[]};return db[_0x7268('0x55')]['findOne']({'where':{'id':_0x237d6a['params']['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x16a481,null))[_0x7268('0x21')](function(_0x1e7c8b){if(_0x1e7c8b){_0x21413e['model']=_[_0x7268('0x46')](db[_0x7268('0x90')]['rawAttributes']);_0x21413e[_0x7268('0x47')]=_[_0x7268('0x46')](_0x237d6a[_0x7268('0x47')]);_0x21413e[_0x7268('0x48')]=_[_0x7268('0x49')](_0x21413e['model'],_0x21413e['query']);_0x20a586[_0x7268('0x4a')]=_['intersection'](_0x21413e['model'],qs['fields'](_0x237d6a[_0x7268('0x47')][_0x7268('0x4b')]));_0x20a586[_0x7268('0x4a')]=_0x20a586[_0x7268('0x4a')]['length']?_0x20a586[_0x7268('0x4a')]:_0x21413e['model'];if(!_0x237d6a[_0x7268('0x47')][_0x7268('0x4c')]('nolimit')){_0x20a586[_0x7268('0x31')]=qs[_0x7268('0x31')](_0x237d6a[_0x7268('0x47')][_0x7268('0x31')]);_0x20a586[_0x7268('0x2f')]=qs['offset'](_0x237d6a[_0x7268('0x47')][_0x7268('0x2f')]);}_0x20a586[_0x7268('0x4d')]=qs[_0x7268('0x4e')](_0x237d6a['query'][_0x7268('0x4e')]);_0x20a586[_0x7268('0x50')]=qs[_0x7268('0x48')](_[_0x7268('0x4f')](_0x237d6a[_0x7268('0x47')],_0x21413e['filters']));_0x20a586['where'][_0x7268('0x65')]=_0x1e7c8b['id'];if(_0x237d6a['query']['filter']){_0x20a586[_0x7268('0x50')]=_[_0x7268('0x53')](_0x20a586['where'],{'$or':_['map'](_0x20a586[_0x7268('0x4a')],function(_0x107e3e){var _0x54b8ac={};_0x54b8ac[_0x107e3e]={'$like':'%'+_0x237d6a[_0x7268('0x47')]['filter']+'%'};return _0x54b8ac;})});}_0x20a586=_['merge']({},_0x20a586,_0x237d6a[_0x7268('0x54')]);return db[_0x7268('0x90')][_0x7268('0x32')]({'where':_0x20a586[_0x7268('0x50')]})['then'](function(_0x1c29d3){_0x1e0a58[_0x7268('0x32')]=_0x1c29d3;if(_0x237d6a[_0x7268('0x47')][_0x7268('0x5a')]){_0x20a586[_0x7268('0x56')]=[{'model':db[_0x7268('0x73')],'as':_0x7268('0xb2'),'required':![]},{'model':db[_0x7268('0x9c')],'as':'Owner','attributes':[_0x7268('0x3b'),_0x7268('0xb3'),_0x7268('0xb4')],'required':![]},{'model':db[_0x7268('0xb5')],'as':_0x7268('0xb6'),'attributes':['id',_0x7268('0x3b'),_0x7268('0xb7')],'where':_0x237d6a[_0x7268('0x47')]['tag']?{'id':_0x237d6a[_0x7268('0x47')][_0x7268('0xb8')]}:undefined,'required':_0x237d6a[_0x7268('0x47')][_0x7268('0xb8')]?!![]:![]}];}return db[_0x7268('0x90')]['findAll'](_0x20a586);})[_0x7268('0x21')](function(_0x5917b1){_0x1e0a58[_0x7268('0x57')]=_0x5917b1;return _0x1e0a58;});}})[_0x7268('0x21')](respondWithFilteredResult(_0x16a481,_0x20a586))[_0x7268('0x2a')](handleError(_0x16a481,null));};exports[_0x7268('0xb9')]=function(_0x3b1450,_0x11aade,_0xec968){return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x3b1450[_0x7268('0x58')]['id']}})['then'](handleEntityNotFound(_0x11aade,null))[_0x7268('0x21')](function(_0x58d0ca){if(_0x58d0ca){return _0x58d0ca[_0x7268('0xb9')](_0x3b1450[_0x7268('0x5d')][_0x7268('0x70')],_[_0x7268('0xba')](_0x3b1450[_0x7268('0x5d')],[_0x7268('0x70'),'id'])||{})[_0x7268('0x93')](function(_0x292491){for(var _0x324651=0x0;_0x324651<_0x3b1450[_0x7268('0x5d')][_0x7268('0x70')][_0x7268('0x59')];_0x324651+=0x1){socket[_0x7268('0xbb')](_0x7268('0xbc'),{'UserId':Number(_0x3b1450[_0x7268('0x5d')][_0x7268('0x70')][_0x324651]),'OpenchannelAccountId':Number(_0x3b1450[_0x7268('0x58')]['id'])});}return _0x292491;});}})[_0x7268('0x21')](respondWithResult(_0x11aade,null))[_0x7268('0x2a')](handleError(_0x11aade,null));};exports['removeAgents']=function(_0xab06fd,_0x481ded,_0x225fae){return db[_0x7268('0x55')]['find']({'where':{'id':_0xab06fd['params']['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x481ded,null))[_0x7268('0x21')](function(_0x5d8578){if(_0x5d8578){return _0x5d8578[_0x7268('0xbd')](_0xab06fd[_0x7268('0x47')][_0x7268('0x70')])[_0x7268('0x21')](function(){if(_[_0x7268('0xbe')](_0xab06fd[_0x7268('0x47')][_0x7268('0x70')])){for(var _0x29011f=0x0;_0x29011f<_0xab06fd['query'][_0x7268('0x70')][_0x7268('0x59')];_0x29011f+=0x1){socket[_0x7268('0xbb')](_0x7268('0xbf'),{'UserId':Number(_0xab06fd[_0x7268('0x47')][_0x7268('0x70')][_0x29011f]),'OpenchannelAccountId':Number(_0xab06fd[_0x7268('0x58')]['id'])});}}else{socket[_0x7268('0xbb')](_0x7268('0xbf'),{'UserId':Number(_0xab06fd[_0x7268('0x47')]['ids']),'OpenchannelAccountId':Number(_0xab06fd[_0x7268('0x58')]['id'])});}});}})[_0x7268('0x21')](respondWithStatusCode(_0x481ded,null))[_0x7268('0x2a')](handleError(_0x481ded,null));};exports[_0x7268('0xc0')]=function(_0x14d80c,_0x245038,_0x15bb73){var _0xf4a93b={};var _0x36c842={};var _0x203f57;var _0x152aed;return db['OpenchannelAccount'][_0x7268('0x6e')]({'where':{'id':_0x14d80c[_0x7268('0x58')]['id']}})[_0x7268('0x21')](handleEntityNotFound(_0x245038,null))[_0x7268('0x21')](function(_0x58de18){if(_0x58de18){_0x203f57=_0x58de18;_0x36c842['model']=_[_0x7268('0x46')](db[_0x7268('0x9c')][_0x7268('0x41')]);_0x36c842[_0x7268('0x47')]=_['keys'](_0x14d80c[_0x7268('0x47')]);_0x36c842[_0x7268('0x48')]=_['intersection'](_0x36c842[_0x7268('0x45')],_0x36c842[_0x7268('0x47')]);_0xf4a93b[_0x7268('0x4a')]=_[_0x7268('0x49')](_0x36c842['model'],qs['fields'](_0x14d80c[_0x7268('0x47')][_0x7268('0x4b')]));_0xf4a93b[_0x7268('0x4a')]=_0xf4a93b[_0x7268('0x4a')][_0x7268('0x59')]?_0xf4a93b['attributes']:_0x36c842[_0x7268('0x45')];_0xf4a93b[_0x7268('0x4d')]=qs[_0x7268('0x4e')](_0x14d80c['query']['sort']);_0xf4a93b[_0x7268('0x50')]=qs[_0x7268('0x48')](_[_0x7268('0x4f')](_0x14d80c[_0x7268('0x47')],_0x36c842['filters']));if(_0x14d80c[_0x7268('0x47')][_0x7268('0x52')]){_0xf4a93b[_0x7268('0x50')]=_[_0x7268('0x53')](_0xf4a93b[_0x7268('0x50')],{'$or':_[_0x7268('0x40')](_0xf4a93b[_0x7268('0x4a')],function(_0x58cb30){var _0xd3af6b={};_0xd3af6b[_0x58cb30]={'$like':'%'+_0x14d80c['query'][_0x7268('0x52')]+'%'};return _0xd3af6b;})});}_0xf4a93b=_[_0x7268('0x53')]({},_0xf4a93b,_0x14d80c[_0x7268('0x54')]);return _0x203f57[_0x7268('0xc0')](_0xf4a93b);}})[_0x7268('0x21')](function(_0x3d4503){if(_0x3d4503){_0x152aed=_0x3d4503[_0x7268('0x59')];if(!_0x14d80c[_0x7268('0x47')][_0x7268('0x4c')](_0x7268('0x67'))){_0xf4a93b[_0x7268('0x31')]=qs['limit'](_0x14d80c[_0x7268('0x47')]['limit']);_0xf4a93b[_0x7268('0x2f')]=qs['offset'](_0x14d80c[_0x7268('0x47')][_0x7268('0x2f')]);}return _0x203f57[_0x7268('0xc0')](_0xf4a93b);}})[_0x7268('0x21')](function(_0x93f660){if(_0x93f660){return _0x93f660?{'count':_0x152aed,'rows':_0x93f660}:null;}})['then'](respondWithResult(_0x245038,null))[_0x7268('0x2a')](handleError(_0x245038,null));};exports[_0x7268('0x3c')]=function(_0x5bcaec,_0x2dc90d,_0x50cdef){var _0x38d92a,_0x5ca7ec,_0x285b32;if(_[_0x7268('0x7b')](_0x5bcaec[_0x7268('0x5d')]['body'])||_0x5bcaec['body'][_0x7268('0x5d')]===''){throw new db[(_0x7268('0x7d'))][(_0x7268('0x74'))](_0x7268('0x7f'));}if(_[_0x7268('0x7b')](_0x5bcaec[_0x7268('0x5d')]['to'])){}_0x38d92a=_0x5bcaec[_0x7268('0x5d')]['to'];return db[_0x7268('0x55')][_0x7268('0x6e')]({'where':{'id':_0x5bcaec['params']['id']}})['then'](handleEntityNotFound(_0x2dc90d,null))[_0x7268('0x21')](function(_0x1ed326){if(_0x1ed326){return db[_0x7268('0x55')][_0x7268('0x5b')]({'where':{'id':_0x1ed326['id']},'include':[{'model':db['CmList'],'as':_0x7268('0x83'),'include':[{'model':db[_0x7268('0x73')],'as':_0x7268('0x84'),'where':{[_0x1ed326[_0x7268('0x80')]]:_0x38d92a},'limit':0x1,'order':[[_0x7268('0x78'),_0x7268('0x85')]]}]}]})['then'](handleEntityNotFound(_0x2dc90d,null))[_0x7268('0x21')](function(_0x20e8cb){if(_0x20e8cb&&_0x20e8cb['List']){_0x5ca7ec=_0x20e8cb[_0x7268('0x38')]({'plain':!![]});if(_0x5ca7ec[_0x7268('0x83')]&&_0x5ca7ec[_0x7268('0x83')][_0x7268('0x84')][_0x7268('0x59')]){return _0x5ca7ec[_0x7268('0x83')]['Contacts'][0x0];}return db[_0x7268('0x73')][_0x7268('0x5c')](_[_0x7268('0x1b')](_0x5bcaec[_0x7268('0x5d')],{'firstName':_0x38d92a,[_0x20e8cb['mapKey']]:_0x38d92a,'phone':_0x38d92a,'ListId':_0x5ca7ec[_0x7268('0x7a')]}));}})['then'](handleEntityNotFound(_0x2dc90d,null))[_0x7268('0x21')](function(_0xb7f6f3){if(_0xb7f6f3){_0x285b32=_0xb7f6f3;return db[_0x7268('0x90')][_0x7268('0x5b')]({'where':{'ContactId':_0x285b32['id'],'closed':![],'OpenchannelAccountId':_0x5ca7ec['id']}})[_0x7268('0x21')](function(_0x10a7da){if(_0x10a7da){return[_0x10a7da,![]];}return db['OpenchannelInteraction'][_0x7268('0x5c')]({'UserId':_0x5bcaec['user']['id'],'ContactId':_0x285b32['id'],'OpenchannelAccountId':_0x5ca7ec['id'],'lastMsgDirection':_0x7268('0xc1'),'firstMsgDirection':_0x7268('0xc1'),'Messages':[_[_0x7268('0x53')](_0x5bcaec[_0x7268('0x5d')],{'read':![],'body':_0x5bcaec[_0x7268('0x5d')][_0x7268('0x5d')],'OpenchannelAccountId':_0x5ca7ec['id'],'UserId':_0x5bcaec[_0x7268('0x5e')]['id'],'ContactId':_0x285b32['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0x7268('0x21')](function(_0x105686){return[_0x105686,!![]];});});}})['spread'](function(_0x2469a0,_0x42aa39){if(_0x42aa39){return _0x2469a0;}return db[_0x7268('0xc2')][_0x7268('0x5c')](_[_0x7268('0x53')](_0x5bcaec[_0x7268('0x5d')],{'read':![],'body':_0x5bcaec[_0x7268('0x5d')][_0x7268('0x5d')],'OpenchannelAccountId':_0x5ca7ec['id'],'OpenchannelInteractionId':_0x2469a0['id'],'UserId':_0x5bcaec[_0x7268('0x5e')]['id'],'ContactId':_0x285b32['id']}))[_0x7268('0x21')](function(_0x45b283){_0x2469a0[_0x7268('0xc3')][_0x7268('0xc4')]=[];_0x2469a0['dataValues'][_0x7268('0xc4')][_0x7268('0x98')](_0x45b283[_0x7268('0xc3')]);return _0x2469a0;});});}})[_0x7268('0x21')](respondWithResult(_0x2dc90d,null))[_0x7268('0x2a')](handleError(_0x2dc90d,null));}; \ No newline at end of file +var _0x58dc=['omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','defaults','out','Messages','dataValues','push','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelAccounts','end','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','from','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','asc','Contacts','contact','threadId','OpenchannelInteraction','externalUrl','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','priority','stack','finally','send','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','addAgents'];(function(_0xcffae0,_0x1f70ca){var _0x24f329=function(_0x228238){while(--_0x228238){_0xcffae0['push'](_0xcffae0['shift']());}};_0x24f329(++_0x1f70ca);}(_0x58dc,0x199));var _0xc58d=function(_0x4ebaab,_0x2a8c15){_0x4ebaab=_0x4ebaab-0x0;var _0x4cbfdb=_0x58dc[_0x4ebaab];return _0x4cbfdb;};'use strict';var emlformat=require(_0xc58d('0x0'));var rimraf=require(_0xc58d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc58d('0x2'));var rp=require(_0xc58d('0x3'));var moment=require(_0xc58d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc58d('0x5'));var util=require(_0xc58d('0x6'));var path=require(_0xc58d('0x7'));var sox=require(_0xc58d('0x8'));var csv=require(_0xc58d('0x9'));var ejs=require(_0xc58d('0xa'));var fs=require('fs');var fs_extra=require(_0xc58d('0xb'));var _=require(_0xc58d('0xc'));var squel=require('squel');var crypto=require(_0xc58d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc58d('0xe'));var toCsv=require(_0xc58d('0x9'));var querystring=require(_0xc58d('0xf'));var Papa=require(_0xc58d('0x10'));var Redis=require(_0xc58d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc58d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc58d('0x13'))('api');var utils=require(_0xc58d('0x14'));var config=require(_0xc58d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc58d('0x16'))['db'];config[_0xc58d('0x17')]=_['defaults'](config[_0xc58d('0x17')],{'host':_0xc58d('0x18'),'port':0x18eb});var socket=require(_0xc58d('0x19'))(new Redis(config[_0xc58d('0x17')]));require(_0xc58d('0x1a'))[_0xc58d('0x1b')](socket);var jayson=require(_0xc58d('0x1c'));var client=jayson[_0xc58d('0x1d')][_0xc58d('0x1e')]({'port':0x232c});var client9002=jayson[_0xc58d('0x1d')][_0xc58d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x25619f,_0x157440,_0x132d54,_0x1e4e86){return new BPromise(function(_0x4d721e,_0xe0af4f){var _0x5352f9=_0x1e4e86||client;return _0x5352f9['request'](_0x25619f,_0x132d54)['then'](function(_0x590b7b){logger[_0xc58d('0x1f')](_0xc58d('0x20'),_0x157440,_0xc58d('0x21'));logger[_0xc58d('0x22')](_0xc58d('0x23'),_0x157440,_0xc58d('0x21'),JSON[_0xc58d('0x24')](_0x590b7b));if(_0x590b7b[_0xc58d('0x25')]){if(_0x590b7b[_0xc58d('0x25')][_0xc58d('0x26')]===0x1f4){logger[_0xc58d('0x25')](_0xc58d('0x20'),_0x157440,_0x590b7b[_0xc58d('0x25')]['message']);return _0xe0af4f(_0x590b7b['error'][_0xc58d('0x27')]);}logger[_0xc58d('0x25')](_0xc58d('0x20'),_0x157440,_0x590b7b[_0xc58d('0x25')][_0xc58d('0x27')]);return _0x4d721e(_0x590b7b[_0xc58d('0x25')][_0xc58d('0x27')]);}else{logger[_0xc58d('0x1f')](_0xc58d('0x20'),_0x157440,_0xc58d('0x21'));_0x4d721e(_0x590b7b[_0xc58d('0x28')][_0xc58d('0x27')]);}})[_0xc58d('0x29')](function(_0x33f653){logger[_0xc58d('0x25')](_0xc58d('0x20'),_0x157440,_0x33f653);_0xe0af4f(_0x33f653);});});}function respondWithStatusCode(_0x5b56f0,_0x231497){_0x231497=_0x231497||0xcc;return function(_0x3a295a){if(_0x3a295a){return _0x5b56f0[_0xc58d('0x2a')](_0x231497);}return _0x5b56f0[_0xc58d('0x2b')](_0x231497)['end']();};}function respondWithResult(_0x3cfb02,_0x12db2a){_0x12db2a=_0x12db2a||0xc8;return function(_0x2ad109){if(_0x2ad109){return _0x3cfb02['status'](_0x12db2a)[_0xc58d('0x2c')](_0x2ad109);}};}function respondWithFilteredResult(_0x58638c,_0x2b5c9b){return function(_0xaf2907){if(_0xaf2907){var _0xbaebaa=typeof _0x2b5c9b[_0xc58d('0x2d')]===_0xc58d('0x2e')&&typeof _0x2b5c9b[_0xc58d('0x2f')]===_0xc58d('0x2e');var _0x54e745=_0xaf2907['count'];var _0x31c5b4=_0xbaebaa?0x0:_0x2b5c9b[_0xc58d('0x2d')];var _0x2c11ad=_0xbaebaa?_0xaf2907['count']:_0x2b5c9b[_0xc58d('0x2d')]+_0x2b5c9b[_0xc58d('0x2f')];var _0x5e2c20;if(_0x2c11ad>=_0x54e745){_0x2c11ad=_0x54e745;_0x5e2c20=0xc8;}else{_0x5e2c20=0xce;}_0x58638c[_0xc58d('0x2b')](_0x5e2c20);return _0x58638c[_0xc58d('0x30')](_0xc58d('0x31'),_0x31c5b4+'-'+_0x2c11ad+'/'+_0x54e745)[_0xc58d('0x2c')](_0xaf2907);}return null;};}function patchUpdates(_0x507f11){return function(_0x115abe){try{jsonpatch[_0xc58d('0x32')](_0x115abe,_0x507f11,!![]);}catch(_0x46f218){return BPromise[_0xc58d('0x33')](_0x46f218);}return _0x115abe[_0xc58d('0x34')]();};}function saveUpdates(_0xde57ee,_0x59c6ef){return function(_0x9216b9){if(_0x9216b9){return _0x9216b9[_0xc58d('0x35')](_0xde57ee)[_0xc58d('0x36')](function(_0x39c706){return _0x39c706;});}return null;};}function removeEntity(_0x14b32d,_0x1a357c){return function(_0x382807){if(_0x382807){return _0x382807[_0xc58d('0x37')]()[_0xc58d('0x36')](function(){var _0x172130=_0x382807[_0xc58d('0x38')]({'plain':!![]});var _0x3500aa=_0xc58d('0x39');return db['UserProfileResource'][_0xc58d('0x37')]({'where':{'type':_0x3500aa,'resourceId':_0x172130['id']}})[_0xc58d('0x36')](function(){return _0x382807;});})[_0xc58d('0x36')](function(){_0x14b32d['status'](0xcc)[_0xc58d('0x3a')]();});}};}function handleEntityNotFound(_0x258540,_0x1e3cb9){return function(_0x1122bc){if(!_0x1122bc){_0x258540[_0xc58d('0x2a')](0x194);}return _0x1122bc;};}function handleError(_0x45b7be,_0x4fa707){_0x4fa707=_0x4fa707||0x1f4;return function(_0x38fcac){logger['error'](_0x38fcac['stack']);if(_0x38fcac['name']){delete _0x38fcac[_0xc58d('0x3b')];}_0x45b7be[_0xc58d('0x2b')](_0x4fa707)['send'](_0x38fcac);};}exports[_0xc58d('0x3c')]=function(_0x3f7d2c,_0x4dea89){var _0x1d041b={'include':[{'model':db[_0xc58d('0x3d')],'as':_0xc58d('0x3e')}]},_0x1820db={},_0x24c1ee={'count':0x0,'rows':[]};var _0x503933=_[_0xc58d('0x3f')](db[_0xc58d('0x40')][_0xc58d('0x41')],function(_0x5b93a9){return{'name':_0x5b93a9['fieldName'],'type':_0x5b93a9[_0xc58d('0x42')][_0xc58d('0x43')]};});_0x1820db[_0xc58d('0x44')]=_['map'](_0x503933,_0xc58d('0x3b'));_0x1820db[_0xc58d('0x45')]=_[_0xc58d('0x46')](_0x3f7d2c[_0xc58d('0x45')]);_0x1820db[_0xc58d('0x47')]=_[_0xc58d('0x48')](_0x1820db[_0xc58d('0x44')],_0x1820db[_0xc58d('0x45')]);_0x1d041b[_0xc58d('0x49')]=_['intersection'](_0x1820db['model'],qs[_0xc58d('0x4a')](_0x3f7d2c[_0xc58d('0x45')]['fields']));_0x1d041b[_0xc58d('0x49')]=_0x1d041b[_0xc58d('0x49')][_0xc58d('0x4b')]?_0x1d041b[_0xc58d('0x49')]:_0x1820db[_0xc58d('0x44')];if(!_0x3f7d2c[_0xc58d('0x45')][_0xc58d('0x4c')](_0xc58d('0x4d'))){_0x1d041b[_0xc58d('0x2f')]=qs[_0xc58d('0x2f')](_0x3f7d2c[_0xc58d('0x45')][_0xc58d('0x2f')]);_0x1d041b[_0xc58d('0x2d')]=qs[_0xc58d('0x2d')](_0x3f7d2c[_0xc58d('0x45')]['offset']);}_0x1d041b[_0xc58d('0x4e')]=qs['sort'](_0x3f7d2c[_0xc58d('0x45')][_0xc58d('0x4f')]);_0x1d041b['where']=qs[_0xc58d('0x47')](_[_0xc58d('0x50')](_0x3f7d2c[_0xc58d('0x45')],_0x1820db[_0xc58d('0x47')]),_0x503933);if(_0x3f7d2c['query']['filter']){_0x1d041b[_0xc58d('0x51')]=_[_0xc58d('0x52')](_0x1d041b[_0xc58d('0x51')],{'$or':_[_0xc58d('0x3f')](_0x503933,function(_0xf924b8){if(_0xf924b8[_0xc58d('0x42')]!==_0xc58d('0x53')){var _0x2d08dd={};_0x2d08dd[_0xf924b8['name']]={'$like':'%'+_0x3f7d2c[_0xc58d('0x45')][_0xc58d('0x54')]+'%'};return _0x2d08dd;}})});}_0x1d041b=_[_0xc58d('0x52')]({},_0x1d041b,_0x3f7d2c['options']);var _0x33c378={'where':_0x1d041b[_0xc58d('0x51')]};return db[_0xc58d('0x40')][_0xc58d('0x55')](_0x33c378)[_0xc58d('0x36')](function(_0xbe6883){_0x24c1ee[_0xc58d('0x55')]=_0xbe6883;if(_0x3f7d2c[_0xc58d('0x45')][_0xc58d('0x56')]){_0x1d041b[_0xc58d('0x57')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0xc58d('0x58')](_0x1d041b);})[_0xc58d('0x36')](function(_0x2f1190){_0x24c1ee[_0xc58d('0x59')]=_0x2f1190;return _0x24c1ee;})[_0xc58d('0x36')](respondWithFilteredResult(_0x4dea89,_0x1d041b))[_0xc58d('0x29')](handleError(_0x4dea89,null));};exports[_0xc58d('0x5a')]=function(_0x4585d0,_0x488b5f){var _0x4aabb6={'raw':![],'where':{'id':_0x4585d0[_0xc58d('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0xc58d('0x3e')}]},_0x6463a3={};_0x6463a3[_0xc58d('0x44')]=_[_0xc58d('0x46')](db[_0xc58d('0x40')][_0xc58d('0x41')]);_0x6463a3[_0xc58d('0x45')]=_[_0xc58d('0x46')](_0x4585d0[_0xc58d('0x45')]);_0x6463a3[_0xc58d('0x47')]=_[_0xc58d('0x48')](_0x6463a3[_0xc58d('0x44')],_0x6463a3[_0xc58d('0x45')]);_0x4aabb6[_0xc58d('0x49')]=_[_0xc58d('0x48')](_0x6463a3[_0xc58d('0x44')],qs[_0xc58d('0x4a')](_0x4585d0['query'][_0xc58d('0x4a')]));_0x4aabb6['attributes']=_0x4aabb6[_0xc58d('0x49')][_0xc58d('0x4b')]?_0x4aabb6['attributes']:_0x6463a3[_0xc58d('0x44')];if(_0x4585d0[_0xc58d('0x45')][_0xc58d('0x56')]){_0x4aabb6['include']=[{'all':!![]}];}_0x4aabb6=_[_0xc58d('0x52')]({},_0x4aabb6,_0x4585d0['options']);return db['OpenchannelAccount'][_0xc58d('0x5c')](_0x4aabb6)[_0xc58d('0x36')](handleEntityNotFound(_0x488b5f,null))[_0xc58d('0x36')](respondWithResult(_0x488b5f,null))[_0xc58d('0x29')](handleError(_0x488b5f,null));};exports[_0xc58d('0x5d')]=function(_0xdda6d5,_0x2cb5d7){return db[_0xc58d('0x40')][_0xc58d('0x5d')](_0xdda6d5[_0xc58d('0x5e')],{})[_0xc58d('0x36')](function(_0xcbfc0e){var _0x52a857=_0xdda6d5[_0xc58d('0x5f')]['get']({'plain':!![]});if(!_0x52a857)throw new Error(_0xc58d('0x60'));if(_0x52a857[_0xc58d('0x61')]==='user'){var _0x15c361=_0xcbfc0e[_0xc58d('0x38')]({'plain':!![]});var _0x522699=_0xc58d('0x39');return db[_0xc58d('0x62')][_0xc58d('0x5c')]({'where':{'name':_0x522699,'userProfileId':_0x52a857['userProfileId']},'raw':!![]})[_0xc58d('0x36')](function(_0x233475){if(_0x233475&&_0x233475[_0xc58d('0x63')]===0x0){return db[_0xc58d('0x64')]['create']({'name':_0x15c361['name'],'resourceId':_0x15c361['id'],'type':_0x233475['name'],'sectionId':_0x233475['id']},{})[_0xc58d('0x36')](function(){return _0xcbfc0e;});}else{return _0xcbfc0e;}})[_0xc58d('0x29')](function(_0x2260cd){logger[_0xc58d('0x25')](_0xc58d('0x65'),_0x2260cd);throw _0x2260cd;});}return _0xcbfc0e;})[_0xc58d('0x36')](respondWithResult(_0x2cb5d7,0xc9))['catch'](handleError(_0x2cb5d7,null));};exports['update']=function(_0x3b600d,_0x1c6510){if(_0x3b600d[_0xc58d('0x5e')]['id']){delete _0x3b600d[_0xc58d('0x5e')]['id'];}return db[_0xc58d('0x40')]['find']({'where':{'id':_0x3b600d[_0xc58d('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xc58d('0x36')](handleEntityNotFound(_0x1c6510,null))[_0xc58d('0x36')](saveUpdates(_0x3b600d[_0xc58d('0x5e')],null))[_0xc58d('0x36')](respondWithResult(_0x1c6510,null))['catch'](handleError(_0x1c6510,null));};exports[_0xc58d('0x37')]=function(_0x56f0dd,_0x4b726c){return db['OpenchannelAccount'][_0xc58d('0x5c')]({'where':{'id':_0x56f0dd['params']['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x4b726c,null))[_0xc58d('0x36')](removeEntity(_0x4b726c,null))['catch'](handleError(_0x4b726c,null));};exports[_0xc58d('0x66')]=function(_0x5a05dc,_0x36eb3a){return db[_0xc58d('0x40')][_0xc58d('0x66')]()['then'](respondWithResult(_0x36eb3a,null))[_0xc58d('0x29')](handleError(_0x36eb3a,null));};exports['addDisposition']=function(_0x52ef15,_0x162dc1,_0x50f222){if(_0x52ef15[_0xc58d('0x5e')]['id']){delete _0x52ef15[_0xc58d('0x5e')]['id'];}return db[_0xc58d('0x40')][_0xc58d('0x5c')]({'where':{'id':_0x52ef15[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x162dc1,null))[_0xc58d('0x36')](function(_0x15fa4d){if(_0x15fa4d){_0x52ef15['body'][_0xc58d('0x67')]=_0x15fa4d['id'];return db[_0xc58d('0x68')][_0xc58d('0x5d')](_0x52ef15[_0xc58d('0x5e')]);}})[_0xc58d('0x36')](respondWithResult(_0x162dc1,null))[_0xc58d('0x29')](handleError(_0x162dc1,null));};exports[_0xc58d('0x69')]=function(_0x2c6086,_0x500250,_0x2f33cb){var _0x13ab73={'raw':![],'where':{}};var _0x2e6b6e={};var _0x8d189a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc58d('0x6a')]({'where':{'id':_0x2c6086[_0xc58d('0x5b')]['id']}})['then'](handleEntityNotFound(_0x500250,null))[_0xc58d('0x36')](function(_0x55dc04){if(_0x55dc04){_0x2e6b6e['model']=_['keys'](db[_0xc58d('0x68')][_0xc58d('0x41')]);_0x2e6b6e['query']=_['keys'](_0x2c6086[_0xc58d('0x45')]);_0x2e6b6e[_0xc58d('0x47')]=_[_0xc58d('0x48')](_0x2e6b6e[_0xc58d('0x44')],_0x2e6b6e['query']);_0x13ab73[_0xc58d('0x49')]=_[_0xc58d('0x48')](_0x2e6b6e[_0xc58d('0x44')],qs[_0xc58d('0x4a')](_0x2c6086[_0xc58d('0x45')]['fields']));_0x13ab73[_0xc58d('0x49')]=_0x13ab73[_0xc58d('0x49')][_0xc58d('0x4b')]?_0x13ab73['attributes']:_0x2e6b6e['model'];if(!_0x2c6086['query'][_0xc58d('0x4c')](_0xc58d('0x4d'))){_0x13ab73[_0xc58d('0x2f')]=qs[_0xc58d('0x2f')](_0x2c6086[_0xc58d('0x45')][_0xc58d('0x2f')]);_0x13ab73['offset']=qs[_0xc58d('0x2d')](_0x2c6086[_0xc58d('0x45')]['offset']);}_0x13ab73[_0xc58d('0x4e')]=qs[_0xc58d('0x4f')](_0x2c6086[_0xc58d('0x45')]['sort']);_0x13ab73[_0xc58d('0x51')]=qs['filters'](_[_0xc58d('0x50')](_0x2c6086[_0xc58d('0x45')],_0x2e6b6e[_0xc58d('0x47')]));_0x13ab73['where']['OpenchannelAccountId']=_0x55dc04['id'];if(_0x2c6086[_0xc58d('0x45')][_0xc58d('0x54')]){_0x13ab73['where']=_[_0xc58d('0x52')](_0x13ab73[_0xc58d('0x51')],{'$or':_[_0xc58d('0x3f')](_0x13ab73[_0xc58d('0x49')],function(_0x573dbc){var _0x451572={};_0x451572[_0x573dbc]={'$like':'%'+_0x2c6086[_0xc58d('0x45')][_0xc58d('0x54')]+'%'};return _0x451572;})});}_0x13ab73=_['merge']({},_0x13ab73,_0x2c6086[_0xc58d('0x6b')]);return db[_0xc58d('0x68')]['count']({'where':_0x13ab73[_0xc58d('0x51')]})[_0xc58d('0x36')](function(_0x27ec9e){_0x8d189a[_0xc58d('0x55')]=_0x27ec9e;if(_0x2c6086[_0xc58d('0x45')][_0xc58d('0x56')]){_0x13ab73[_0xc58d('0x57')]=[{'all':!![]}];}return db['Disposition'][_0xc58d('0x58')](_0x13ab73);})[_0xc58d('0x36')](function(_0x462873){_0x8d189a[_0xc58d('0x59')]=_0x462873;return _0x8d189a;});}})[_0xc58d('0x36')](respondWithFilteredResult(_0x500250,_0x13ab73))['catch'](handleError(_0x500250,null));};exports['removeDispositions']=function(_0x5e5e3a,_0x5145b0,_0x7cd60){return db[_0xc58d('0x40')]['find']({'where':{'id':_0x5e5e3a[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x5145b0,null))['then'](function(_0x772330){if(_0x772330){return _0x772330[_0xc58d('0x6c')](_0x5e5e3a[_0xc58d('0x45')][_0xc58d('0x6d')]);}})[_0xc58d('0x36')](respondWithStatusCode(_0x5145b0,null))[_0xc58d('0x29')](handleError(_0x5145b0,null));};exports[_0xc58d('0x6e')]=function(_0x3c6561,_0x39e0c2,_0x445478){if(_0x3c6561[_0xc58d('0x5e')]['id']){delete _0x3c6561[_0xc58d('0x5e')]['id'];}return db[_0xc58d('0x40')][_0xc58d('0x5c')]({'where':{'id':_0x3c6561[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x39e0c2,null))['then'](function(_0x33ae1b){if(_0x33ae1b){_0x3c6561[_0xc58d('0x5e')]['OpenchannelAccountId']=_0x33ae1b['id'];return db['CannedAnswer'][_0xc58d('0x5d')](_0x3c6561[_0xc58d('0x5e')]);}})[_0xc58d('0x36')](respondWithResult(_0x39e0c2,null))[_0xc58d('0x29')](handleError(_0x39e0c2,null));};exports['getAnswers']=function(_0x79235d,_0x25c29e,_0x583a60){var _0x469e04={'raw':![],'where':{}};var _0x4aa7c8={};var _0x18fc33={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xc58d('0x6a')]({'where':{'id':_0x79235d[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x25c29e,null))[_0xc58d('0x36')](function(_0x18a31e){if(_0x18a31e){_0x4aa7c8[_0xc58d('0x44')]=_[_0xc58d('0x46')](db['CannedAnswer'][_0xc58d('0x41')]);_0x4aa7c8[_0xc58d('0x45')]=_[_0xc58d('0x46')](_0x79235d[_0xc58d('0x45')]);_0x4aa7c8['filters']=_[_0xc58d('0x48')](_0x4aa7c8[_0xc58d('0x44')],_0x4aa7c8[_0xc58d('0x45')]);_0x469e04[_0xc58d('0x49')]=_[_0xc58d('0x48')](_0x4aa7c8[_0xc58d('0x44')],qs[_0xc58d('0x4a')](_0x79235d[_0xc58d('0x45')][_0xc58d('0x4a')]));_0x469e04['attributes']=_0x469e04[_0xc58d('0x49')]['length']?_0x469e04[_0xc58d('0x49')]:_0x4aa7c8[_0xc58d('0x44')];if(!_0x79235d[_0xc58d('0x45')][_0xc58d('0x4c')](_0xc58d('0x4d'))){_0x469e04[_0xc58d('0x2f')]=qs['limit'](_0x79235d['query'][_0xc58d('0x2f')]);_0x469e04[_0xc58d('0x2d')]=qs[_0xc58d('0x2d')](_0x79235d[_0xc58d('0x45')][_0xc58d('0x2d')]);}_0x469e04[_0xc58d('0x4e')]=qs[_0xc58d('0x4f')](_0x79235d[_0xc58d('0x45')][_0xc58d('0x4f')]);_0x469e04[_0xc58d('0x51')]=qs[_0xc58d('0x47')](_['pick'](_0x79235d[_0xc58d('0x45')],_0x4aa7c8[_0xc58d('0x47')]));_0x469e04[_0xc58d('0x51')][_0xc58d('0x67')]=_0x18a31e['id'];if(_0x79235d[_0xc58d('0x45')][_0xc58d('0x54')]){_0x469e04[_0xc58d('0x51')]=_[_0xc58d('0x52')](_0x469e04[_0xc58d('0x51')],{'$or':_[_0xc58d('0x3f')](_0x469e04[_0xc58d('0x49')],function(_0x5ebba3){var _0x22abc9={};_0x22abc9[_0x5ebba3]={'$like':'%'+_0x79235d[_0xc58d('0x45')][_0xc58d('0x54')]+'%'};return _0x22abc9;})});}_0x469e04=_[_0xc58d('0x52')]({},_0x469e04,_0x79235d[_0xc58d('0x6b')]);return db['CannedAnswer']['count']({'where':_0x469e04[_0xc58d('0x51')]})[_0xc58d('0x36')](function(_0x3d0ae){_0x18fc33[_0xc58d('0x55')]=_0x3d0ae;if(_0x79235d['query'][_0xc58d('0x56')]){_0x469e04[_0xc58d('0x57')]=[{'all':!![]}];}return db[_0xc58d('0x6f')][_0xc58d('0x58')](_0x469e04);})[_0xc58d('0x36')](function(_0x465b6f){_0x18fc33[_0xc58d('0x59')]=_0x465b6f;return _0x18fc33;});}})[_0xc58d('0x36')](respondWithFilteredResult(_0x25c29e,_0x469e04))[_0xc58d('0x29')](handleError(_0x25c29e,null));};exports[_0xc58d('0x70')]=function(_0x586676,_0x86d6ff,_0xf22847){return db[_0xc58d('0x40')][_0xc58d('0x5c')]({'where':{'id':_0x586676['params']['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x86d6ff,null))[_0xc58d('0x36')](function(_0x3e063a){if(_0x3e063a){return _0x3e063a[_0xc58d('0x70')](_0x586676[_0xc58d('0x45')]['ids']);}})[_0xc58d('0x36')](respondWithStatusCode(_0x86d6ff,null))[_0xc58d('0x29')](handleError(_0x86d6ff,null));};exports['notify']=function(_0x4b99b0,_0x5d019c,_0x4e718e){var _0x32a97e={'body':_0x4b99b0[_0xc58d('0x5e')],'channel':_0xc58d('0x71')};var _0x27beca=[];var _0x2029ae=[];var _0x298461={};var _0x5a4e05=![];return db[_0xc58d('0x72')][_0xc58d('0x66')]()[_0xc58d('0x36')](function(_0x525333){if(!_0x525333){throw new db[(_0xc58d('0x73'))]['ValidationError'](_0xc58d('0x74'));}_0x27beca=_[_0xc58d('0x75')](_[_0xc58d('0x46')](_0x525333),['createdAt',_0xc58d('0x76')]);_0x2029ae=_[_0xc58d('0x75')](_[_0xc58d('0x46')](_0x525333),[_0xc58d('0x77'),_0xc58d('0x76'),_0xc58d('0x78'),_0xc58d('0x79')]);if(_0x4b99b0[_0xc58d('0x5e')]['id']){delete _0x4b99b0[_0xc58d('0x5e')]['id'];}if(_[_0xc58d('0x7a')](_0x4b99b0[_0xc58d('0x5e')]['from'])){throw new db[(_0xc58d('0x73'))][(_0xc58d('0x7b'))](_0xc58d('0x7c'));}if(_[_0xc58d('0x7a')](_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x5e')])||_0x4b99b0['body'][_0xc58d('0x5e')]===''){throw new db['Sequelize'][(_0xc58d('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4b99b0[_0xc58d('0x5e')]['mapKey'])){throw new db[(_0xc58d('0x73'))][(_0xc58d('0x7b'))](_0xc58d('0x7d')+_0x2029ae);}if(!_[_0xc58d('0x7e')](_0x2029ae,_0x4b99b0[_0xc58d('0x5e')]['mapKey'])){throw new db['Sequelize'][(_0xc58d('0x7b'))](_0xc58d('0x7f')+_0x2029ae);}_0x298461[_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x80')]]=_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x81')];})[_0xc58d('0x36')](function(){return db[_0xc58d('0x40')][_0xc58d('0x5c')]({'where':{'id':_0x4b99b0['params']['id']},'include':[{'model':db[_0xc58d('0x82')],'as':_0xc58d('0x83'),'include':[{'model':db[_0xc58d('0x72')],'as':'Contacts','where':_0x298461,'limit':0x1,'order':[['updatedAt',_0xc58d('0x84')]]}]},{'model':db[_0xc58d('0x85')],'as':_0xc58d('0x86')}]});})[_0xc58d('0x36')](handleEntityNotFound(_0x5d019c,null))[_0xc58d('0x36')](function(_0x57ca89){if(_0x57ca89&&_0x57ca89[_0xc58d('0x83')]){_0x32a97e[_0xc58d('0x87')]=_0x57ca89;_0x32a97e[_0xc58d('0x88')]=_0x57ca89[_0xc58d('0x86')];_0x32a97e[_0xc58d('0x89')]=_0x57ca89[_0xc58d('0x83')];_0x32a97e['applications']=_[_0xc58d('0x8a')](_0x32a97e[_0xc58d('0x88')],['priority'],[_0xc58d('0x8b')]);if(_0x32a97e[_0xc58d('0x87')][_0xc58d('0x86')]){delete _0x32a97e['account'][_0xc58d('0x86')];}if(_0x32a97e[_0xc58d('0x87')][_0xc58d('0x83')]&&_0x32a97e[_0xc58d('0x87')][_0xc58d('0x83')][_0xc58d('0x8c')]['length']){return _0x32a97e['account']['List']['Contacts'][0x0];}var _0x59b32f=_['defaults'](_0x4b99b0[_0xc58d('0x5e')],{'firstName':_0x4b99b0['body'][_0xc58d('0x81')],'ListId':_0x57ca89['ListId']});_0x59b32f[_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x80')]]=_0x4b99b0[_0xc58d('0x5e')]['from'];return db[_0xc58d('0x72')][_0xc58d('0x5d')](_0x59b32f,{'fields':_0x27beca,'raw':!![]});}})[_0xc58d('0x36')](handleEntityNotFound(_0x5d019c,null))[_0xc58d('0x36')](function(_0x3557bb){_0x32a97e[_0xc58d('0x8d')]=_0x3557bb;if(_0x3557bb){var _0x1fa2bc={'ContactId':_0x3557bb['id'],'OpenchannelAccountId':_0x4b99b0[_0xc58d('0x5b')]['id'],'from':(_0x3557bb['firstName']||'')+'\x20'+(_0x3557bb['lastName']||'')};var _0x1e2d5d={'OpenchannelAccountId':_0x4b99b0['params']['id'],'closed':![]};if(_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x8e')]){_0x1e2d5d[_0xc58d('0x8e')]=_0x4b99b0['body']['threadId'];return db[_0xc58d('0x8f')]['find']({'where':_0x1e2d5d})[_0xc58d('0x36')](function(_0x41d7f9){if(_0x41d7f9){return[_0x41d7f9,![]];}_0x1fa2bc[_0xc58d('0x8e')]=_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x8e')];_0x1fa2bc[_0xc58d('0x90')]=_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x90')];return db[_0xc58d('0x8f')][_0xc58d('0x5d')](_0x1fa2bc)[_0xc58d('0x36')](function(_0x3df4c9){return[_0x3df4c9,!![]];});});}else{_0x1e2d5d[_0xc58d('0x8e')]=null;}_0x1e2d5d['ContactId']=_0x3557bb['id'];return db[_0xc58d('0x8f')][_0xc58d('0x5c')]({'where':_0x1e2d5d})['then'](function(_0x1ac778){if(_0x1ac778){return[_0x1ac778,![]];}return db[_0xc58d('0x8f')][_0xc58d('0x5d')](_0x1fa2bc)[_0xc58d('0x36')](function(_0x46f0b6){return[_0x46f0b6,!![]];});});}})[_0xc58d('0x91')](function(_0x44e2ef,_0x1e281d){if(_0x44e2ef){_0x5a4e05=_0x1e281d;if(!_0x1e281d){var _0x95d5ff={'from':(_0x32a97e[_0xc58d('0x8d')]['firstName']||'')+'\x20'+(_0x32a97e[_0xc58d('0x8d')]['lastName']||'')};if(_0x4b99b0[_0xc58d('0x5e')]['threadId']&&_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x92')]&&_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x8e')]!=_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x92')]){_0x95d5ff['threadId']=_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x92')];}return _0x44e2ef[_0xc58d('0x35')](_0x95d5ff);}else{return _0x44e2ef;}}})[_0xc58d('0x36')](function(_0x20e443){_0x32a97e[_0xc58d('0x93')]=_0x20e443['get']({'plain':!![]});_0x32a97e['interaction'][_0xc58d('0x94')]=_0x5a4e05;if(_0x32a97e[_0xc58d('0x93')]['created']){if(_0x32a97e[_0xc58d('0x87')][_0xc58d('0x95')]){_0x32a97e[_0xc58d('0x88')]['push']({'id':0x0,'priority':_0x32a97e[_0xc58d('0x88')]['length']+0x1,'app':_0xc58d('0x96'),'appdata':_0xc58d('0x97'),'interval':_0xc58d('0x98')});}}return db[_0xc58d('0x99')]['create']({'body':_0x4b99b0['body']['body'],'OpenchannelAccountId':_0x4b99b0[_0xc58d('0x5b')]['id'],'OpenchannelInteractionId':_0x20e443['id'],'direction':'in','ContactId':_0x32a97e[_0xc58d('0x8d')]['id'],'AttachmentId':_0x4b99b0[_0xc58d('0x5e')][_0xc58d('0x9a')]});})[_0xc58d('0x36')](function(_0x3ac23f){_0x32a97e[_0xc58d('0x27')]=_0x3ac23f;if(!_0x32a97e[_0xc58d('0x93')][_0xc58d('0x9b')])return;return db[_0xc58d('0x9c')][_0xc58d('0x5c')]({'attributes':['id',_0xc58d('0x3b')],'where':{'id':_0x32a97e[_0xc58d('0x93')]['UserId']}});})[_0xc58d('0x36')](function(_0x2d8112){if(_0x2d8112){_0x32a97e[_0xc58d('0x88')][_0xc58d('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d8112[_0xc58d('0x3b')]+','+(_0x32a97e[_0xc58d('0x87')][_0xc58d('0x9e')]||0xa),'interval':_0xc58d('0x98')});}if(!_0x32a97e[_0xc58d('0x93')][_0xc58d('0x9f')])return;return db[_0xc58d('0xa0')][_0xc58d('0x5c')]({'attributes':['id','name'],'where':{'id':_0x32a97e[_0xc58d('0x93')][_0xc58d('0x9f')]}});})[_0xc58d('0x36')](function(_0x267c9b){if(_0x267c9b){_0x32a97e[_0xc58d('0x88')][_0xc58d('0x9d')]({'id':0x0,'priority':0x1,'app':_0xc58d('0xa1'),'appdata':_0x267c9b[_0xc58d('0x3b')]+','+(_0x32a97e['account'][_0xc58d('0xa2')]||0x12c),'interval':_0xc58d('0x98')});}return respondWithRpcPromise(_0xc58d('0xa3'),_0xc58d('0xa4'),_0x32a97e);})[_0xc58d('0x36')](function(_0x55582b){respondWithRpcPromise(_0xc58d('0xa5'),_0xc58d('0xa5'),{'event':_0xc58d('0xa6'),'message':_0x55582b},client9002);return _0x55582b;})[_0xc58d('0x36')](respondWithResult(_0x5d019c,null))[_0xc58d('0x29')](handleError(_0x5d019c,null));};exports[_0xc58d('0xa7')]=function(_0x1a47e8,_0x43ab91){var _0x258671=_0x1a47e8[_0xc58d('0x5b')]['id'];var _0x2d3f75=_0x1a47e8[_0xc58d('0x5e')];var _0x1dc8d4=0xc8;var _0x2996f6=null;return db[_0xc58d('0xa8')][_0xc58d('0xa9')]({'isolationLevel':db[_0xc58d('0xa8')][_0xc58d('0xaa')][_0xc58d('0xab')][_0xc58d('0xac')]},function(_0x49c06a){return db['OpenchannelAccount'][_0xc58d('0x6a')]({'where':{'id':_0x258671},'transaction':_0x49c06a})[_0xc58d('0x36')](function(_0x5263f4){if(_0x5263f4){return db[_0xc58d('0x85')][_0xc58d('0x37')]({'where':{'OpenchannelAccountId':_0x258671},'transaction':_0x49c06a})[_0xc58d('0x36')](function(){var _0x23d1cc=_[_0xc58d('0x3f')](_0x2d3f75,function(_0x372d78){_0x372d78[_0xc58d('0x67')]=_0x258671;return _0x372d78;});return db[_0xc58d('0x85')][_0xc58d('0xad')](_0x23d1cc,{'transaction':_0x49c06a});});}else{_0x1dc8d4=0x194;_0x2996f6=[];}});})[_0xc58d('0x36')](function(){if(_0x1dc8d4!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x258671},'order':_0xc58d('0xae')})[_0xc58d('0x36')](function(_0xbdb037){_0x2996f6=_0xbdb037;});}})[_0xc58d('0x29')](function(_0x262b19){_0x1dc8d4=0x1f4;logger[_0xc58d('0x25')](_0x262b19[_0xc58d('0xaf')]);if(_0x262b19[_0xc58d('0x3b')]){delete _0x262b19['name'];}_0x2996f6=_0x262b19;})[_0xc58d('0xb0')](function(){if(_0x2996f6===null){_0x43ab91[_0xc58d('0x2a')](_0x1dc8d4);}else{if(_0x1dc8d4===0x1f4){_0x43ab91[_0xc58d('0x2b')](_0x1dc8d4)[_0xc58d('0xb1')](_0x2996f6);}else{_0x43ab91[_0xc58d('0x2b')](_0x1dc8d4)[_0xc58d('0x2c')](_0x2996f6);}}});};exports['getApplications']=function(_0x124312,_0xc12940,_0x43ff0b){var _0x3593a4={};var _0x1cf073={};var _0x572f89;var _0x4103f4;return db['OpenchannelAccount'][_0xc58d('0x6a')]({'where':{'id':_0x124312[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0xc12940,null))[_0xc58d('0x36')](function(_0x32d0b2){if(_0x32d0b2){_0x572f89=_0x32d0b2;_0x1cf073[_0xc58d('0x44')]=_['keys'](db[_0xc58d('0x85')][_0xc58d('0x41')]);_0x1cf073[_0xc58d('0x45')]=_['keys'](_0x124312[_0xc58d('0x45')]);_0x1cf073[_0xc58d('0x47')]=_[_0xc58d('0x48')](_0x1cf073['model'],_0x1cf073['query']);_0x3593a4[_0xc58d('0x49')]=_['intersection'](_0x1cf073[_0xc58d('0x44')],qs['fields'](_0x124312[_0xc58d('0x45')]['fields']));_0x3593a4[_0xc58d('0x49')]=_0x3593a4[_0xc58d('0x49')]['length']?_0x3593a4[_0xc58d('0x49')]:_0x1cf073[_0xc58d('0x44')];_0x3593a4[_0xc58d('0x4e')]=qs[_0xc58d('0x4f')](_0x124312[_0xc58d('0x45')][_0xc58d('0x4f')]);_0x3593a4['where']=qs[_0xc58d('0x47')](_[_0xc58d('0x50')](_0x124312['query'],_0x1cf073[_0xc58d('0x47')]));if(_0x124312['query'][_0xc58d('0x54')]){_0x3593a4['where']=_['merge'](_0x3593a4[_0xc58d('0x51')],{'$or':_[_0xc58d('0x3f')](_0x3593a4[_0xc58d('0x49')],function(_0x20c41f){var _0x3b1e47={};_0x3b1e47[_0x20c41f]={'$like':'%'+_0x124312[_0xc58d('0x45')][_0xc58d('0x54')]+'%'};return _0x3b1e47;})});}_0x3593a4=_[_0xc58d('0x52')]({},_0x3593a4,_0x124312[_0xc58d('0x6b')]);return _0x572f89[_0xc58d('0xb2')](_0x3593a4);}})['then'](function(_0x54d11c){if(_0x54d11c){_0x4103f4=_0x54d11c[_0xc58d('0x4b')];if(!_0x124312['query'][_0xc58d('0x4c')]('nolimit')){_0x3593a4['limit']=qs[_0xc58d('0x2f')](_0x124312[_0xc58d('0x45')][_0xc58d('0x2f')]);_0x3593a4[_0xc58d('0x2d')]=qs[_0xc58d('0x2d')](_0x124312[_0xc58d('0x45')][_0xc58d('0x2d')]);}return _0x572f89['getApplications'](_0x3593a4);}})[_0xc58d('0x36')](function(_0x88ff2f){if(_0x88ff2f){return _0x88ff2f?{'count':_0x4103f4,'rows':_0x88ff2f}:null;}})['then'](respondWithResult(_0xc12940,null))[_0xc58d('0x29')](handleError(_0xc12940,null));};exports[_0xc58d('0xb3')]=function(_0x2492c5,_0x39f143,_0x2e0c2b){var _0x5e1cd1={'raw':![],'where':{}};var _0x356336={};var _0x55b53e={'count':0x0,'rows':[]};return db[_0xc58d('0x40')][_0xc58d('0x6a')]({'where':{'id':_0x2492c5[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x39f143,null))[_0xc58d('0x36')](function(_0x5c57e5){if(_0x5c57e5){_0x356336[_0xc58d('0x44')]=_['keys'](db[_0xc58d('0x8f')][_0xc58d('0x41')]);_0x356336['query']=_[_0xc58d('0x46')](_0x2492c5[_0xc58d('0x45')]);_0x356336['filters']=_[_0xc58d('0x48')](_0x356336[_0xc58d('0x44')],_0x356336[_0xc58d('0x45')]);_0x5e1cd1[_0xc58d('0x49')]=_[_0xc58d('0x48')](_0x356336[_0xc58d('0x44')],qs[_0xc58d('0x4a')](_0x2492c5[_0xc58d('0x45')][_0xc58d('0x4a')]));_0x5e1cd1[_0xc58d('0x49')]=_0x5e1cd1[_0xc58d('0x49')][_0xc58d('0x4b')]?_0x5e1cd1[_0xc58d('0x49')]:_0x356336[_0xc58d('0x44')];if(!_0x2492c5['query'][_0xc58d('0x4c')]('nolimit')){_0x5e1cd1[_0xc58d('0x2f')]=qs[_0xc58d('0x2f')](_0x2492c5['query']['limit']);_0x5e1cd1['offset']=qs['offset'](_0x2492c5['query'][_0xc58d('0x2d')]);}_0x5e1cd1[_0xc58d('0x4e')]=qs[_0xc58d('0x4f')](_0x2492c5['query'][_0xc58d('0x4f')]);_0x5e1cd1['where']=qs['filters'](_['pick'](_0x2492c5[_0xc58d('0x45')],_0x356336[_0xc58d('0x47')]));_0x5e1cd1[_0xc58d('0x51')]['OpenchannelAccountId']=_0x5c57e5['id'];if(_0x2492c5[_0xc58d('0x45')][_0xc58d('0x54')]){_0x5e1cd1['where']=_[_0xc58d('0x52')](_0x5e1cd1[_0xc58d('0x51')],{'$or':_[_0xc58d('0x3f')](_0x5e1cd1[_0xc58d('0x49')],function(_0x4946f9){var _0x3999fd={};_0x3999fd[_0x4946f9]={'$like':'%'+_0x2492c5[_0xc58d('0x45')][_0xc58d('0x54')]+'%'};return _0x3999fd;})});}_0x5e1cd1=_['merge']({},_0x5e1cd1,_0x2492c5[_0xc58d('0x6b')]);return db['OpenchannelInteraction']['count']({'where':_0x5e1cd1[_0xc58d('0x51')]})[_0xc58d('0x36')](function(_0x362ba2){_0x55b53e['count']=_0x362ba2;if(_0x2492c5[_0xc58d('0x45')][_0xc58d('0x56')]){_0x5e1cd1[_0xc58d('0x57')]=[{'model':db[_0xc58d('0x72')],'as':_0xc58d('0xb4'),'required':![]},{'model':db[_0xc58d('0x9c')],'as':_0xc58d('0xb5'),'attributes':[_0xc58d('0x3b'),'fullname',_0xc58d('0xb6')],'required':![]},{'model':db[_0xc58d('0xb7')],'as':_0xc58d('0xb8'),'attributes':['id',_0xc58d('0x3b'),_0xc58d('0xb9')],'where':_0x2492c5[_0xc58d('0x45')]['tag']?{'id':_0x2492c5[_0xc58d('0x45')][_0xc58d('0xba')]}:undefined,'required':_0x2492c5[_0xc58d('0x45')][_0xc58d('0xba')]?!![]:![]}];}return db[_0xc58d('0x8f')][_0xc58d('0x58')](_0x5e1cd1);})[_0xc58d('0x36')](function(_0x28b69f){_0x55b53e[_0xc58d('0x59')]=_0x28b69f;return _0x55b53e;});}})['then'](respondWithFilteredResult(_0x39f143,_0x5e1cd1))[_0xc58d('0x29')](handleError(_0x39f143,null));};exports[_0xc58d('0xbb')]=function(_0x479991,_0x5b9d68,_0x3221ac){return db[_0xc58d('0x40')]['find']({'where':{'id':_0x479991['params']['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x5b9d68,null))[_0xc58d('0x36')](function(_0x262c10){if(_0x262c10){return _0x262c10[_0xc58d('0xbb')](_0x479991[_0xc58d('0x5e')][_0xc58d('0x6d')],_[_0xc58d('0xbc')](_0x479991[_0xc58d('0x5e')],[_0xc58d('0x6d'),'id'])||{})['spread'](function(_0x2aae70){for(var _0x5dae26=0x0;_0x5dae26<_0x479991[_0xc58d('0x5e')][_0xc58d('0x6d')][_0xc58d('0x4b')];_0x5dae26+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x479991[_0xc58d('0x5e')][_0xc58d('0x6d')][_0x5dae26]),'OpenchannelAccountId':Number(_0x479991['params']['id'])});}return _0x2aae70;});}})[_0xc58d('0x36')](respondWithResult(_0x5b9d68,null))[_0xc58d('0x29')](handleError(_0x5b9d68,null));};exports['removeAgents']=function(_0x167d9b,_0x3bbdd3,_0xc9b9eb){return db[_0xc58d('0x40')][_0xc58d('0x5c')]({'where':{'id':_0x167d9b[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x3bbdd3,null))['then'](function(_0x4eead9){if(_0x4eead9){return _0x4eead9[_0xc58d('0xbd')](_0x167d9b[_0xc58d('0x45')][_0xc58d('0x6d')])[_0xc58d('0x36')](function(){if(_['isArray'](_0x167d9b['query'][_0xc58d('0x6d')])){for(var _0x166751=0x0;_0x166751<_0x167d9b[_0xc58d('0x45')][_0xc58d('0x6d')][_0xc58d('0x4b')];_0x166751+=0x1){socket[_0xc58d('0xbe')](_0xc58d('0xbf'),{'UserId':Number(_0x167d9b[_0xc58d('0x45')][_0xc58d('0x6d')][_0x166751]),'OpenchannelAccountId':Number(_0x167d9b['params']['id'])});}}else{socket[_0xc58d('0xbe')]('userOpenchannelAccount:remove',{'UserId':Number(_0x167d9b[_0xc58d('0x45')][_0xc58d('0x6d')]),'OpenchannelAccountId':Number(_0x167d9b[_0xc58d('0x5b')]['id'])});}});}})[_0xc58d('0x36')](respondWithStatusCode(_0x3bbdd3,null))[_0xc58d('0x29')](handleError(_0x3bbdd3,null));};exports[_0xc58d('0xc0')]=function(_0x43b2c3,_0x38a099,_0x1a8506){var _0xa0f75={};var _0x2d408d={};var _0x32d180;var _0x23544a;return db[_0xc58d('0x40')]['findOne']({'where':{'id':_0x43b2c3['params']['id']}})['then'](handleEntityNotFound(_0x38a099,null))['then'](function(_0x522197){if(_0x522197){_0x32d180=_0x522197;_0x2d408d[_0xc58d('0x44')]=_['keys'](db[_0xc58d('0x9c')]['rawAttributes']);_0x2d408d[_0xc58d('0x45')]=_[_0xc58d('0x46')](_0x43b2c3['query']);_0x2d408d[_0xc58d('0x47')]=_[_0xc58d('0x48')](_0x2d408d[_0xc58d('0x44')],_0x2d408d[_0xc58d('0x45')]);_0xa0f75[_0xc58d('0x49')]=_[_0xc58d('0x48')](_0x2d408d[_0xc58d('0x44')],qs[_0xc58d('0x4a')](_0x43b2c3[_0xc58d('0x45')][_0xc58d('0x4a')]));_0xa0f75[_0xc58d('0x49')]=_0xa0f75[_0xc58d('0x49')][_0xc58d('0x4b')]?_0xa0f75[_0xc58d('0x49')]:_0x2d408d[_0xc58d('0x44')];_0xa0f75[_0xc58d('0x4e')]=qs[_0xc58d('0x4f')](_0x43b2c3['query']['sort']);_0xa0f75[_0xc58d('0x51')]=qs[_0xc58d('0x47')](_[_0xc58d('0x50')](_0x43b2c3[_0xc58d('0x45')],_0x2d408d[_0xc58d('0x47')]));if(_0x43b2c3[_0xc58d('0x45')]['filter']){_0xa0f75['where']=_[_0xc58d('0x52')](_0xa0f75[_0xc58d('0x51')],{'$or':_['map'](_0xa0f75[_0xc58d('0x49')],function(_0x3cabda){var _0x1bcf72={};_0x1bcf72[_0x3cabda]={'$like':'%'+_0x43b2c3['query'][_0xc58d('0x54')]+'%'};return _0x1bcf72;})});}_0xa0f75=_['merge']({},_0xa0f75,_0x43b2c3[_0xc58d('0x6b')]);return _0x32d180[_0xc58d('0xc0')](_0xa0f75);}})[_0xc58d('0x36')](function(_0x292ae4){if(_0x292ae4){_0x23544a=_0x292ae4[_0xc58d('0x4b')];if(!_0x43b2c3['query'][_0xc58d('0x4c')](_0xc58d('0x4d'))){_0xa0f75[_0xc58d('0x2f')]=qs['limit'](_0x43b2c3['query'][_0xc58d('0x2f')]);_0xa0f75[_0xc58d('0x2d')]=qs['offset'](_0x43b2c3[_0xc58d('0x45')][_0xc58d('0x2d')]);}return _0x32d180[_0xc58d('0xc0')](_0xa0f75);}})[_0xc58d('0x36')](function(_0x4a40f7){if(_0x4a40f7){return _0x4a40f7?{'count':_0x23544a,'rows':_0x4a40f7}:null;}})[_0xc58d('0x36')](respondWithResult(_0x38a099,null))[_0xc58d('0x29')](handleError(_0x38a099,null));};exports[_0xc58d('0xb1')]=function(_0x2313ee,_0x4175e4,_0x4bda12){var _0xd27148,_0x3dd789,_0x3cdee7;if(_['isNil'](_0x2313ee[_0xc58d('0x5e')][_0xc58d('0x5e')])||_0x2313ee['body']['body']===''){throw new db[(_0xc58d('0x73'))][(_0xc58d('0x7b'))](_0xc58d('0xc1'));}if(_[_0xc58d('0x7a')](_0x2313ee[_0xc58d('0x5e')]['to'])){}_0xd27148=_0x2313ee[_0xc58d('0x5e')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2313ee[_0xc58d('0x5b')]['id']}})[_0xc58d('0x36')](handleEntityNotFound(_0x4175e4,null))[_0xc58d('0x36')](function(_0x4315f5){if(_0x4315f5){return db[_0xc58d('0x40')]['find']({'where':{'id':_0x4315f5['id']},'include':[{'model':db[_0xc58d('0x82')],'as':_0xc58d('0x83'),'include':[{'model':db[_0xc58d('0x72')],'as':_0xc58d('0x8c'),'where':{[_0x4315f5[_0xc58d('0x80')]]:_0xd27148},'limit':0x1,'order':[[_0xc58d('0x76'),'DESC']]}]}]})[_0xc58d('0x36')](handleEntityNotFound(_0x4175e4,null))[_0xc58d('0x36')](function(_0x478a4b){if(_0x478a4b&&_0x478a4b[_0xc58d('0x83')]){_0x3dd789=_0x478a4b['get']({'plain':!![]});if(_0x3dd789[_0xc58d('0x83')]&&_0x3dd789[_0xc58d('0x83')][_0xc58d('0x8c')][_0xc58d('0x4b')]){return _0x3dd789['List'][_0xc58d('0x8c')][0x0];}return db[_0xc58d('0x72')][_0xc58d('0x5d')](_[_0xc58d('0xc2')](_0x2313ee[_0xc58d('0x5e')],{'firstName':_0xd27148,[_0x478a4b[_0xc58d('0x80')]]:_0xd27148,'phone':_0xd27148,'ListId':_0x3dd789[_0xc58d('0x79')]}));}})[_0xc58d('0x36')](handleEntityNotFound(_0x4175e4,null))[_0xc58d('0x36')](function(_0x359e36){if(_0x359e36){_0x3cdee7=_0x359e36;return db['OpenchannelInteraction'][_0xc58d('0x5c')]({'where':{'ContactId':_0x3cdee7['id'],'closed':![],'OpenchannelAccountId':_0x3dd789['id']}})['then'](function(_0x581690){if(_0x581690){return[_0x581690,![]];}return db[_0xc58d('0x8f')][_0xc58d('0x5d')]({'UserId':_0x2313ee[_0xc58d('0x5f')]['id'],'ContactId':_0x3cdee7['id'],'OpenchannelAccountId':_0x3dd789['id'],'lastMsgDirection':_0xc58d('0xc3'),'firstMsgDirection':_0xc58d('0xc3'),'Messages':[_[_0xc58d('0x52')](_0x2313ee[_0xc58d('0x5e')],{'read':![],'body':_0x2313ee[_0xc58d('0x5e')][_0xc58d('0x5e')],'OpenchannelAccountId':_0x3dd789['id'],'UserId':_0x2313ee['user']['id'],'ContactId':_0x3cdee7['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xc58d('0xc4')}]})[_0xc58d('0x36')](function(_0x3e8ea3){return[_0x3e8ea3,!![]];});});}})['spread'](function(_0x309843,_0xeac9b0){if(_0xeac9b0){return _0x309843;}return db[_0xc58d('0x99')]['create'](_[_0xc58d('0x52')](_0x2313ee['body'],{'read':![],'body':_0x2313ee[_0xc58d('0x5e')][_0xc58d('0x5e')],'OpenchannelAccountId':_0x3dd789['id'],'OpenchannelInteractionId':_0x309843['id'],'UserId':_0x2313ee[_0xc58d('0x5f')]['id'],'ContactId':_0x3cdee7['id']}))['then'](function(_0x2e83af){_0x309843[_0xc58d('0xc5')]['Messages']=[];_0x309843[_0xc58d('0xc5')]['Messages'][_0xc58d('0xc6')](_0x2e83af[_0xc58d('0xc5')]);return _0x309843;});});}})[_0xc58d('0x36')](respondWithResult(_0x4175e4,null))[_0xc58d('0x29')](handleError(_0x4175e4,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index ed70b85..568496e 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 _0xac4a=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','events'];(function(_0x59d4d0,_0x1a31de){var _0x174c7a=function(_0x4b188b){while(--_0x4b188b){_0x59d4d0['push'](_0x59d4d0['shift']());}};_0x174c7a(++_0x1a31de);}(_0xac4a,0x13f));var _0xaac4=function(_0x389902,_0x3f6540){_0x389902=_0x389902-0x0;var _0x3c6d51=_0xac4a[_0x389902];return _0x3c6d51;};'use strict';var EventEmitter=require(_0xaac4('0x0'));var OpenchannelAccount=require(_0xaac4('0x1'))['db'][_0xaac4('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xaac4('0x3')](0x0);var events={'afterCreate':_0xaac4('0x4'),'afterUpdate':_0xaac4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x58626e){return function(_0x2af0f6,_0x2a5762,_0x32d34c){OpenchannelAccountEvents['emit'](_0x58626e+':'+_0x2af0f6['id'],_0x2af0f6);OpenchannelAccountEvents[_0xaac4('0x6')](_0x58626e,_0x2af0f6);_0x32d34c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xaac4('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x4fc4e7,_0x16bfc4){var _0x297133=function(_0x5d1eb6){while(--_0x5d1eb6){_0x4fc4e7['push'](_0x4fc4e7['shift']());}};_0x297133(++_0x16bfc4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5dd794,_0x1cfc9d){_0x5dd794=_0x5dd794-0x0;var _0x29f77f=_0x9bde[_0x5dd794];return _0x29f77f;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 7222ac1..848ea2e 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(_0x525947,_0x287324){var _0x31488d=function(_0x3d427c){while(--_0x3d427c){_0x525947['push'](_0x525947['shift']());}};_0x31488d(++_0x287324);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xe006f6,_0x5477ee){var _0x121529=function(_0x53ee4b){while(--_0x53ee4b){_0xe006f6['push'](_0xe006f6['shift']());}};_0x121529(++_0x5477ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 7456e9c..57cb548 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 _0x9354=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','catch'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9354,0x96));var _0x4935=function(_0x49aab7,_0x1d6397){_0x49aab7=_0x49aab7-0x0;var _0x587b6f=_0x9354[_0x49aab7];return _0x587b6f;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var moment=require(_0x4935('0x1'));var BPromise=require('bluebird');var rs=require(_0x4935('0x2'));var fs=require('fs');var Redis=require(_0x4935('0x3'));var db=require(_0x4935('0x4'))['db'];var utils=require(_0x4935('0x5'));var logger=require('../../config/logger')(_0x4935('0x6'));var config=require(_0x4935('0x7'));var jayson=require(_0x4935('0x8'));var client=jayson[_0x4935('0x9')][_0x4935('0xa')]({'port':0x232a});config[_0x4935('0xb')]=_[_0x4935('0xc')](config[_0x4935('0xb')],{'host':_0x4935('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4935('0xb')]));require('./openchannelAccount.socket')[_0x4935('0xe')](socket);function respondWithRpcPromise(_0x38de96,_0xd5b117,_0x22a83f){return new BPromise(function(_0x261462,_0x319b72){return client['request'](_0x38de96,_0x22a83f)['then'](function(_0x2ebd4c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0xd5b117,_0x4935('0xf'));logger[_0x4935('0x10')](_0x4935('0x11'),_0xd5b117,_0x4935('0xf'),JSON[_0x4935('0x12')](_0x2ebd4c));if(_0x2ebd4c[_0x4935('0x13')]){if(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x14')]===0x1f4){logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);return _0x319b72(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);}logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x2ebd4c['error'][_0x4935('0x16')]);return _0x261462(_0x2ebd4c[_0x4935('0x13')][_0x4935('0x16')]);}else{logger[_0x4935('0x17')](_0x4935('0x15'),_0xd5b117,_0x4935('0xf'));_0x261462(_0x2ebd4c['result'][_0x4935('0x16')]);}})[_0x4935('0x18')](function(_0x4fe356){logger[_0x4935('0x13')](_0x4935('0x15'),_0xd5b117,_0x4fe356);_0x319b72(_0x4fe356);});});} \ No newline at end of file +var _0xd64b=['http','redis','defaults','localhost','socket.io-emitter','request','then','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x51aa5b,_0x512fc0){var _0x5066d8=function(_0x2bdda9){while(--_0x2bdda9){_0x51aa5b['push'](_0x51aa5b['shift']());}};_0x5066d8(++_0x512fc0);}(_0xd64b,0xc1));var _0xbd64=function(_0x1b3fb9,_0x3f4d2c){_0x1b3fb9=_0x1b3fb9-0x0;var _0x506898=_0xd64b[_0x1b3fb9];return _0x506898;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});config[_0xbd64('0x8')]=_[_0xbd64('0x9')](config[_0xbd64('0x8')],{'host':_0xbd64('0xa'),'port':0x18eb});var socket=require(_0xbd64('0xb'))(new Redis(config[_0xbd64('0x8')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x40919e,_0xde7cc8,_0x1250be){return new BPromise(function(_0x4e1adb,_0xc80599){return client[_0xbd64('0xc')](_0x40919e,_0x1250be)[_0xbd64('0xd')](function(_0x18bde8){logger['info'](_0xbd64('0xe'),_0xde7cc8,'request\x20sent');logger[_0xbd64('0xf')](_0xbd64('0x10'),_0xde7cc8,_0xbd64('0x11'),JSON[_0xbd64('0x12')](_0x18bde8));if(_0x18bde8[_0xbd64('0x13')]){if(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x14')]===0x1f4){logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0xc80599(_0x18bde8[_0xbd64('0x13')][_0xbd64('0x15')]);}logger[_0xbd64('0x13')](_0xbd64('0xe'),_0xde7cc8,_0x18bde8['error'][_0xbd64('0x15')]);return _0x4e1adb(_0x18bde8['error'][_0xbd64('0x15')]);}else{logger[_0xbd64('0x16')](_0xbd64('0xe'),_0xde7cc8,_0xbd64('0x11'));_0x4e1adb(_0x18bde8[_0xbd64('0x17')][_0xbd64('0x15')]);}})[_0xbd64('0x18')](function(_0x32c4c7){logger['error'](_0xbd64('0xe'),_0xde7cc8,_0x32c4c7);_0xc80599(_0x32c4c7);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 057f189..3ad1b8d 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 _0x5a8c=['./openchannelAccount.events','save','update','register','length','openchannelAccount:'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x44f7eb,_0x29a2d4){_0x44f7eb=_0x44f7eb-0x0;var _0x5a36cb=_0x5a8c[_0x44f7eb];return _0x5a36cb;};'use strict';var OpenchannelAccountEvents=require(_0xc5a8('0x0'));var events=[_0xc5a8('0x1'),'remove',_0xc5a8('0x2')];function createListener(_0x3325ec,_0x1e03e6){return function(_0x185f20){_0x1e03e6['emit'](_0x3325ec,_0x185f20);};}function removeListener(_0x2d862c,_0x4310e4){return function(){OpenchannelAccountEvents['removeListener'](_0x2d862c,_0x4310e4);};}exports[_0xc5a8('0x3')]=function(_0x3c8f1e){for(var _0x373d40=0x0,_0x20e700=events[_0xc5a8('0x4')];_0x373d40<_0x20e700;_0x373d40++){var _0x2eb2a5=events[_0x373d40];var _0x414555=createListener(_0xc5a8('0x5')+_0x2eb2a5,_0x3c8f1e);OpenchannelAccountEvents['on'](_0x2eb2a5,_0x414555);}}; \ No newline at end of file +var _0x2bdb=['openchannelAccount:','./openchannelAccount.events','remove','removeListener','register'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x2bdb,0x105));var _0xb2bd=function(_0x1968c4,_0x4ce2bb){_0x1968c4=_0x1968c4-0x0;var _0x153766=_0x2bdb[_0x1968c4];return _0x153766;};'use strict';var OpenchannelAccountEvents=require(_0xb2bd('0x0'));var events=['save',_0xb2bd('0x1'),'update'];function createListener(_0x3b40de,_0x1d3ddb){return function(_0xab9a35){_0x1d3ddb['emit'](_0x3b40de,_0xab9a35);};}function removeListener(_0x438ced,_0x2be356){return function(){OpenchannelAccountEvents[_0xb2bd('0x2')](_0x438ced,_0x2be356);};}exports[_0xb2bd('0x3')]=function(_0x461137){for(var _0x2ef40b=0x0,_0x3bff5b=events['length'];_0x2ef40b<_0x3bff5b;_0x2ef40b++){var _0x21462b=events[_0x2ef40b];var _0x4d9d3f=createListener(_0xb2bd('0x4')+_0x21462b,_0x461137);OpenchannelAccountEvents['on'](_0x21462b,_0x4d9d3f);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index fdab977..f575570 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 _0x7330=['./openchannelApplication.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1964ed,_0x42ef04){var _0x44d3e6=function(_0x423d31){while(--_0x423d31){_0x1964ed['push'](_0x1964ed['shift']());}};_0x44d3e6(++_0x42ef04);}(_0x7330,0xe9));var _0x0733=function(_0x2ad5e5,_0x4da8fe){_0x2ad5e5=_0x2ad5e5-0x0;var _0x197cd8=_0x7330[_0x2ad5e5];return _0x197cd8;};'use strict';var multer=require(_0x0733('0x0'));var util=require(_0x0733('0x1'));var path=require(_0x0733('0x2'));var timeout=require(_0x0733('0x3'));var express=require(_0x0733('0x4'));var router=express[_0x0733('0x5')]();var fs_extra=require(_0x0733('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0733('0x7'));router[_0x0733('0x8')]('/',auth[_0x0733('0x9')](),controller['index']);router[_0x0733('0x8')](_0x0733('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0733('0xb')]('/',auth[_0x0733('0x9')](),controller['create']);router[_0x0733('0xc')]('/:id',auth[_0x0733('0x9')](),controller[_0x0733('0xd')]);router[_0x0733('0xe')](_0x0733('0xa'),auth[_0x0733('0x9')](),controller['destroy']);module[_0x0733('0xf')]=router; \ No newline at end of file +var _0x41f0=['./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','put','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x41f0,0x1dd));var _0x041f=function(_0xa5dec7,_0x4b3242){_0xa5dec7=_0xa5dec7-0x0;var _0x786080=_0x41f0[_0xa5dec7];return _0x786080;};'use strict';var multer=require(_0x041f('0x0'));var util=require(_0x041f('0x1'));var path=require(_0x041f('0x2'));var timeout=require(_0x041f('0x3'));var express=require(_0x041f('0x4'));var router=express[_0x041f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x041f('0x6'));var interaction=require(_0x041f('0x7'));var config=require(_0x041f('0x8'));var controller=require(_0x041f('0x9'));router[_0x041f('0xa')]('/',auth[_0x041f('0xb')](),controller[_0x041f('0xc')]);router[_0x041f('0xa')](_0x041f('0xd'),auth[_0x041f('0xb')](),controller[_0x041f('0xe')]);router[_0x041f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x041f('0x10')](_0x041f('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x041f('0xb')](),controller[_0x041f('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c047879..2b3c79f 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 _0x5d75=['sequelize','exports','noop','TEXT','STRING','*,*,*,*'];(function(_0x358b40,_0x3e04d){var _0x49b81a=function(_0x495574){while(--_0x495574){_0x358b40['push'](_0x358b40['shift']());}};_0x49b81a(++_0x3e04d);}(_0x5d75,0x1c2));var _0x55d7=function(_0x583ce0,_0x1df797){_0x583ce0=_0x583ce0-0x0;var _0x1a39f3=_0x5d75[_0x583ce0];return _0x1a39f3;};'use strict';var Sequelize=require(_0x55d7('0x0'));module[_0x55d7('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x55d7('0x2')},'appdata':{'type':Sequelize[_0x55d7('0x3')]()},'description':{'type':Sequelize[_0x55d7('0x4')]},'interval':{'type':Sequelize[_0x55d7('0x4')],'defaultValue':_0x55d7('0x5')}}; \ No newline at end of file +var _0xa318=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x3aab3d,_0x53239e){var _0x148cdf=function(_0x24289c){while(--_0x24289c){_0x3aab3d['push'](_0x3aab3d['shift']());}};_0x148cdf(++_0x53239e);}(_0xa318,0x120));var _0x8a31=function(_0x1a1f6f,_0x284fca){_0x1a1f6f=_0x1a1f6f-0x0;var _0x451e1a=_0xa318[_0x1a1f6f];return _0x451e1a;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x8a31('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x8a31('0x1')],'allowNull':![],'defaultValue':_0x8a31('0x2')},'appdata':{'type':Sequelize[_0x8a31('0x3')]()},'description':{'type':Sequelize[_0x8a31('0x1')]},'interval':{'type':Sequelize[_0x8a31('0x1')],'defaultValue':_0x8a31('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index bd15ef6..08b7e53 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 _0x62c4=['ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','error','stack','name','index','OpenchannelApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','merge','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv'];(function(_0x5347d9,_0x5c42d2){var _0x3194a7=function(_0x93f556){while(--_0x93f556){_0x5347d9['push'](_0x5347d9['shift']());}};_0x3194a7(++_0x5c42d2);}(_0x62c4,0x8a));var _0x462c=function(_0x8d5f01,_0x4aff17){_0x8d5f01=_0x8d5f01-0x0;var _0x14baec=_0x62c4[_0x8d5f01];return _0x14baec;};'use strict';var emlformat=require(_0x462c('0x0'));var rimraf=require(_0x462c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x462c('0x2'));var rp=require(_0x462c('0x3'));var moment=require(_0x462c('0x4'));var BPromise=require(_0x462c('0x5'));var Mustache=require('mustache');var util=require(_0x462c('0x6'));var path=require(_0x462c('0x7'));var sox=require(_0x462c('0x8'));var csv=require(_0x462c('0x9'));var ejs=require(_0x462c('0xa'));var fs=require('fs');var fs_extra=require(_0x462c('0xb'));var _=require(_0x462c('0xc'));var squel=require(_0x462c('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x462c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x462c('0xf'));var Papa=require(_0x462c('0x10'));var Redis=require('ioredis');var authService=require(_0x462c('0x11'));var qs=require(_0x462c('0x12'));var as=require(_0x462c('0x13'));var hardwareService=require(_0x462c('0x14'));var logger=require('../../config/logger')(_0x462c('0x15'));var utils=require(_0x462c('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x462c('0x17'))['db'];function respondWithStatusCode(_0x25c826,_0x4d5d05){_0x4d5d05=_0x4d5d05||0xcc;return function(_0x134808){if(_0x134808){return _0x25c826[_0x462c('0x18')](_0x4d5d05);}return _0x25c826[_0x462c('0x19')](_0x4d5d05)[_0x462c('0x1a')]();};}function respondWithResult(_0x532095,_0x3ea49d){_0x3ea49d=_0x3ea49d||0xc8;return function(_0x341f77){if(_0x341f77){return _0x532095[_0x462c('0x19')](_0x3ea49d)[_0x462c('0x1b')](_0x341f77);}};}function respondWithFilteredResult(_0x57717f,_0x1100fe){return function(_0x2bfbea){if(_0x2bfbea){var _0x4bd422=typeof _0x1100fe[_0x462c('0x1c')]===_0x462c('0x1d')&&typeof _0x1100fe[_0x462c('0x1e')]==='undefined';var _0x2944b4=_0x2bfbea[_0x462c('0x1f')];var _0x2c0f72=_0x4bd422?0x0:_0x1100fe[_0x462c('0x1c')];var _0x1da2ba=_0x4bd422?_0x2bfbea[_0x462c('0x1f')]:_0x1100fe[_0x462c('0x1c')]+_0x1100fe['limit'];var _0x389c6e;if(_0x1da2ba>=_0x2944b4){_0x1da2ba=_0x2944b4;_0x389c6e=0xc8;}else{_0x389c6e=0xce;}_0x57717f[_0x462c('0x19')](_0x389c6e);return _0x57717f[_0x462c('0x20')]('Content-Range',_0x2c0f72+'-'+_0x1da2ba+'/'+_0x2944b4)[_0x462c('0x1b')](_0x2bfbea);}return null;};}function patchUpdates(_0x3b2567){return function(_0x113805){try{jsonpatch['apply'](_0x113805,_0x3b2567,!![]);}catch(_0x17d347){return BPromise[_0x462c('0x21')](_0x17d347);}return _0x113805[_0x462c('0x22')]();};}function saveUpdates(_0x2081e9,_0x2b546a){return function(_0xfb8eb3){if(_0xfb8eb3){return _0xfb8eb3[_0x462c('0x23')](_0x2081e9)[_0x462c('0x24')](function(_0x19fe37){return _0x19fe37;});}return null;};}function removeEntity(_0x108553,_0x4ea245){return function(_0x3c8260){if(_0x3c8260){return _0x3c8260[_0x462c('0x25')]()[_0x462c('0x24')](function(){_0x108553[_0x462c('0x19')](0xcc)[_0x462c('0x1a')]();});}};}function handleEntityNotFound(_0x3bb6a7,_0x4a0adb){return function(_0x308374){if(!_0x308374){_0x3bb6a7[_0x462c('0x18')](0x194);}return _0x308374;};}function handleError(_0x2c916e,_0x428372){_0x428372=_0x428372||0x1f4;return function(_0x13e545){logger[_0x462c('0x26')](_0x13e545[_0x462c('0x27')]);if(_0x13e545[_0x462c('0x28')]){delete _0x13e545['name'];}_0x2c916e[_0x462c('0x19')](_0x428372)['send'](_0x13e545);};}exports[_0x462c('0x29')]=function(_0x3313eb,_0x45f5f5){var _0x47bfbc={},_0x578d35={},_0x1691ed={'count':0x0,'rows':[]};var _0x46c766=_['map'](db[_0x462c('0x2a')]['rawAttributes'],function(_0x4cfff0){return{'name':_0x4cfff0[_0x462c('0x2b')],'type':_0x4cfff0[_0x462c('0x2c')][_0x462c('0x2d')]};});_0x578d35[_0x462c('0x2e')]=_[_0x462c('0x2f')](_0x46c766,'name');_0x578d35[_0x462c('0x30')]=_[_0x462c('0x31')](_0x3313eb[_0x462c('0x30')]);_0x578d35[_0x462c('0x32')]=_[_0x462c('0x33')](_0x578d35[_0x462c('0x2e')],_0x578d35['query']);_0x47bfbc[_0x462c('0x34')]=_[_0x462c('0x33')](_0x578d35[_0x462c('0x2e')],qs[_0x462c('0x35')](_0x3313eb[_0x462c('0x30')][_0x462c('0x35')]));_0x47bfbc[_0x462c('0x34')]=_0x47bfbc[_0x462c('0x34')][_0x462c('0x36')]?_0x47bfbc[_0x462c('0x34')]:_0x578d35[_0x462c('0x2e')];if(!_0x3313eb[_0x462c('0x30')][_0x462c('0x37')](_0x462c('0x38'))){_0x47bfbc[_0x462c('0x1e')]=qs[_0x462c('0x1e')](_0x3313eb[_0x462c('0x30')][_0x462c('0x1e')]);_0x47bfbc['offset']=qs[_0x462c('0x1c')](_0x3313eb['query'][_0x462c('0x1c')]);}_0x47bfbc[_0x462c('0x39')]=qs[_0x462c('0x3a')](_0x3313eb[_0x462c('0x30')][_0x462c('0x3a')]);_0x47bfbc[_0x462c('0x3b')]=qs[_0x462c('0x32')](_[_0x462c('0x3c')](_0x3313eb[_0x462c('0x30')],_0x578d35[_0x462c('0x32')]),_0x46c766);if(_0x3313eb[_0x462c('0x30')][_0x462c('0x3d')]){_0x47bfbc['where']=_['merge'](_0x47bfbc[_0x462c('0x3b')],{'$or':_[_0x462c('0x2f')](_0x46c766,function(_0x1d89a7){if(_0x1d89a7[_0x462c('0x2c')]!=='VIRTUAL'){var _0x3a0672={};_0x3a0672[_0x1d89a7[_0x462c('0x28')]]={'$like':'%'+_0x3313eb[_0x462c('0x30')][_0x462c('0x3d')]+'%'};return _0x3a0672;}})});}_0x47bfbc=_['merge']({},_0x47bfbc,_0x3313eb[_0x462c('0x3e')]);var _0x3975e7={'where':_0x47bfbc[_0x462c('0x3b')]};return db[_0x462c('0x2a')]['count'](_0x3975e7)[_0x462c('0x24')](function(_0x188a01){_0x1691ed[_0x462c('0x1f')]=_0x188a01;if(_0x3313eb[_0x462c('0x30')]['includeAll']){_0x47bfbc[_0x462c('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x462c('0x40')](_0x47bfbc);})[_0x462c('0x24')](function(_0x5c5c2c){_0x1691ed[_0x462c('0x41')]=_0x5c5c2c;return _0x1691ed;})[_0x462c('0x24')](respondWithFilteredResult(_0x45f5f5,_0x47bfbc))[_0x462c('0x42')](handleError(_0x45f5f5,null));};exports[_0x462c('0x43')]=function(_0x5e63b6,_0x25a3f9){var _0x31c134={'raw':!![],'where':{'id':_0x5e63b6[_0x462c('0x44')]['id']}},_0x8277ca={};_0x8277ca['model']=_['keys'](db[_0x462c('0x2a')][_0x462c('0x45')]);_0x8277ca[_0x462c('0x30')]=_[_0x462c('0x31')](_0x5e63b6[_0x462c('0x30')]);_0x8277ca[_0x462c('0x32')]=_[_0x462c('0x33')](_0x8277ca['model'],_0x8277ca[_0x462c('0x30')]);_0x31c134[_0x462c('0x34')]=_['intersection'](_0x8277ca[_0x462c('0x2e')],qs['fields'](_0x5e63b6['query'][_0x462c('0x35')]));_0x31c134[_0x462c('0x34')]=_0x31c134['attributes'][_0x462c('0x36')]?_0x31c134['attributes']:_0x8277ca[_0x462c('0x2e')];if(_0x5e63b6[_0x462c('0x30')][_0x462c('0x46')]){_0x31c134['include']=[{'all':!![]}];}_0x31c134=_[_0x462c('0x47')]({},_0x31c134,_0x5e63b6[_0x462c('0x3e')]);return db[_0x462c('0x2a')]['find'](_0x31c134)[_0x462c('0x24')](handleEntityNotFound(_0x25a3f9,null))[_0x462c('0x24')](respondWithResult(_0x25a3f9,null))['catch'](handleError(_0x25a3f9,null));};exports['create']=function(_0x2cec09,_0x1ac78e){return db[_0x462c('0x2a')][_0x462c('0x48')](_0x2cec09[_0x462c('0x49')],{})[_0x462c('0x24')](respondWithResult(_0x1ac78e,0xc9))['catch'](handleError(_0x1ac78e,null));};exports[_0x462c('0x23')]=function(_0x4a8fe3,_0x521b60){if(_0x4a8fe3['body']['id']){delete _0x4a8fe3['body']['id'];}return db[_0x462c('0x2a')]['find']({'where':{'id':_0x4a8fe3[_0x462c('0x44')]['id']}})['then'](handleEntityNotFound(_0x521b60,null))[_0x462c('0x24')](saveUpdates(_0x4a8fe3[_0x462c('0x49')],null))[_0x462c('0x24')](respondWithResult(_0x521b60,null))['catch'](handleError(_0x521b60,null));};exports[_0x462c('0x25')]=function(_0x4bce45,_0x14f053){return db[_0x462c('0x2a')]['find']({'where':{'id':_0x4bce45[_0x462c('0x44')]['id']}})[_0x462c('0x24')](handleEntityNotFound(_0x14f053,null))[_0x462c('0x24')](removeEntity(_0x14f053,null))[_0x462c('0x42')](handleError(_0x14f053,null));}; \ No newline at end of file +var _0xbd29=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','OpenchannelApplication','includeAll','include','findAll','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xbd29,0x1a4));var _0x9bd2=function(_0x129894,_0x5d7eec){_0x129894=_0x129894-0x0;var _0x4aeeab=_0xbd29[_0x129894];return _0x4aeeab;};'use strict';var emlformat=require(_0x9bd2('0x0'));var rimraf=require(_0x9bd2('0x1'));var zipdir=require(_0x9bd2('0x2'));var jsonpatch=require(_0x9bd2('0x3'));var rp=require(_0x9bd2('0x4'));var moment=require(_0x9bd2('0x5'));var BPromise=require(_0x9bd2('0x6'));var Mustache=require('mustache');var util=require(_0x9bd2('0x7'));var path=require(_0x9bd2('0x8'));var sox=require('sox');var csv=require(_0x9bd2('0x9'));var ejs=require(_0x9bd2('0xa'));var fs=require('fs');var fs_extra=require(_0x9bd2('0xb'));var _=require(_0x9bd2('0xc'));var squel=require(_0x9bd2('0xd'));var crypto=require(_0x9bd2('0xe'));var jsforce=require(_0x9bd2('0xf'));var deskjs=require(_0x9bd2('0x10'));var toCsv=require(_0x9bd2('0x9'));var querystring=require('querystring');var Papa=require(_0x9bd2('0x11'));var Redis=require(_0x9bd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9bd2('0x13'));var as=require(_0x9bd2('0x14'));var hardwareService=require(_0x9bd2('0x15'));var logger=require('../../config/logger')(_0x9bd2('0x16'));var utils=require('../../config/utils');var config=require(_0x9bd2('0x17'));var licenseUtil=require(_0x9bd2('0x18'));var db=require(_0x9bd2('0x19'))['db'];function respondWithStatusCode(_0x2198ac,_0x3ae902){_0x3ae902=_0x3ae902||0xcc;return function(_0x134448){if(_0x134448){return _0x2198ac[_0x9bd2('0x1a')](_0x3ae902);}return _0x2198ac[_0x9bd2('0x1b')](_0x3ae902)[_0x9bd2('0x1c')]();};}function respondWithResult(_0x51112c,_0xd4d9a4){_0xd4d9a4=_0xd4d9a4||0xc8;return function(_0x3b0e72){if(_0x3b0e72){return _0x51112c[_0x9bd2('0x1b')](_0xd4d9a4)[_0x9bd2('0x1d')](_0x3b0e72);}};}function respondWithFilteredResult(_0x360b85,_0x7d9629){return function(_0x266259){if(_0x266259){var _0xcc46d5=typeof _0x7d9629[_0x9bd2('0x1e')]===_0x9bd2('0x1f')&&typeof _0x7d9629[_0x9bd2('0x20')]==='undefined';var _0x436949=_0x266259[_0x9bd2('0x21')];var _0x33761c=_0xcc46d5?0x0:_0x7d9629[_0x9bd2('0x1e')];var _0x286824=_0xcc46d5?_0x266259['count']:_0x7d9629[_0x9bd2('0x1e')]+_0x7d9629[_0x9bd2('0x20')];var _0x15b1c;if(_0x286824>=_0x436949){_0x286824=_0x436949;_0x15b1c=0xc8;}else{_0x15b1c=0xce;}_0x360b85[_0x9bd2('0x1b')](_0x15b1c);return _0x360b85['set'](_0x9bd2('0x22'),_0x33761c+'-'+_0x286824+'/'+_0x436949)[_0x9bd2('0x1d')](_0x266259);}return null;};}function patchUpdates(_0x10cbe1){return function(_0x28308b){try{jsonpatch[_0x9bd2('0x23')](_0x28308b,_0x10cbe1,!![]);}catch(_0x30c757){return BPromise[_0x9bd2('0x24')](_0x30c757);}return _0x28308b[_0x9bd2('0x25')]();};}function saveUpdates(_0x3e9810,_0x1dd455){return function(_0x351dd1){if(_0x351dd1){return _0x351dd1[_0x9bd2('0x26')](_0x3e9810)[_0x9bd2('0x27')](function(_0x43c484){return _0x43c484;});}return null;};}function removeEntity(_0x360d15,_0x4cfd55){return function(_0x47fd7d){if(_0x47fd7d){return _0x47fd7d[_0x9bd2('0x28')]()['then'](function(){_0x360d15[_0x9bd2('0x1b')](0xcc)[_0x9bd2('0x1c')]();});}};}function handleEntityNotFound(_0x2d4b75,_0x4679a4){return function(_0x4667f3){if(!_0x4667f3){_0x2d4b75[_0x9bd2('0x1a')](0x194);}return _0x4667f3;};}function handleError(_0x11e6d4,_0x1a875c){_0x1a875c=_0x1a875c||0x1f4;return function(_0x5cd5b6){logger[_0x9bd2('0x29')](_0x5cd5b6[_0x9bd2('0x2a')]);if(_0x5cd5b6['name']){delete _0x5cd5b6[_0x9bd2('0x2b')];}_0x11e6d4['status'](_0x1a875c)[_0x9bd2('0x2c')](_0x5cd5b6);};}exports[_0x9bd2('0x2d')]=function(_0x4d4b01,_0x338771){var _0xe9f95b={},_0x4e7e4c={},_0x4c4272={'count':0x0,'rows':[]};var _0x1b7267=_[_0x9bd2('0x2e')](db['OpenchannelApplication'][_0x9bd2('0x2f')],function(_0x4d9765){return{'name':_0x4d9765['fieldName'],'type':_0x4d9765[_0x9bd2('0x30')]['key']};});_0x4e7e4c[_0x9bd2('0x31')]=_[_0x9bd2('0x2e')](_0x1b7267,_0x9bd2('0x2b'));_0x4e7e4c[_0x9bd2('0x32')]=_['keys'](_0x4d4b01[_0x9bd2('0x32')]);_0x4e7e4c[_0x9bd2('0x33')]=_[_0x9bd2('0x34')](_0x4e7e4c[_0x9bd2('0x31')],_0x4e7e4c[_0x9bd2('0x32')]);_0xe9f95b['attributes']=_[_0x9bd2('0x34')](_0x4e7e4c[_0x9bd2('0x31')],qs[_0x9bd2('0x35')](_0x4d4b01[_0x9bd2('0x32')]['fields']));_0xe9f95b[_0x9bd2('0x36')]=_0xe9f95b[_0x9bd2('0x36')][_0x9bd2('0x37')]?_0xe9f95b['attributes']:_0x4e7e4c[_0x9bd2('0x31')];if(!_0x4d4b01['query'][_0x9bd2('0x38')](_0x9bd2('0x39'))){_0xe9f95b['limit']=qs[_0x9bd2('0x20')](_0x4d4b01['query']['limit']);_0xe9f95b[_0x9bd2('0x1e')]=qs[_0x9bd2('0x1e')](_0x4d4b01[_0x9bd2('0x32')][_0x9bd2('0x1e')]);}_0xe9f95b[_0x9bd2('0x3a')]=qs['sort'](_0x4d4b01[_0x9bd2('0x32')][_0x9bd2('0x3b')]);_0xe9f95b[_0x9bd2('0x3c')]=qs[_0x9bd2('0x33')](_['pick'](_0x4d4b01['query'],_0x4e7e4c[_0x9bd2('0x33')]),_0x1b7267);if(_0x4d4b01[_0x9bd2('0x32')][_0x9bd2('0x3d')]){_0xe9f95b[_0x9bd2('0x3c')]=_[_0x9bd2('0x3e')](_0xe9f95b[_0x9bd2('0x3c')],{'$or':_[_0x9bd2('0x2e')](_0x1b7267,function(_0x5f5142){if(_0x5f5142[_0x9bd2('0x30')]!=='VIRTUAL'){var _0x2abfc1={};_0x2abfc1[_0x5f5142[_0x9bd2('0x2b')]]={'$like':'%'+_0x4d4b01[_0x9bd2('0x32')][_0x9bd2('0x3d')]+'%'};return _0x2abfc1;}})});}_0xe9f95b=_[_0x9bd2('0x3e')]({},_0xe9f95b,_0x4d4b01[_0x9bd2('0x3f')]);var _0x28027d={'where':_0xe9f95b['where']};return db[_0x9bd2('0x40')][_0x9bd2('0x21')](_0x28027d)['then'](function(_0x23c9ea){_0x4c4272[_0x9bd2('0x21')]=_0x23c9ea;if(_0x4d4b01['query'][_0x9bd2('0x41')]){_0xe9f95b[_0x9bd2('0x42')]=[{'all':!![]}];}return db[_0x9bd2('0x40')][_0x9bd2('0x43')](_0xe9f95b);})[_0x9bd2('0x27')](function(_0x84666f){_0x4c4272['rows']=_0x84666f;return _0x4c4272;})[_0x9bd2('0x27')](respondWithFilteredResult(_0x338771,_0xe9f95b))[_0x9bd2('0x44')](handleError(_0x338771,null));};exports[_0x9bd2('0x45')]=function(_0x3fc330,_0x59a76c){var _0x4b0fd8={'raw':!![],'where':{'id':_0x3fc330[_0x9bd2('0x46')]['id']}},_0x56c130={};_0x56c130[_0x9bd2('0x31')]=_['keys'](db[_0x9bd2('0x40')][_0x9bd2('0x2f')]);_0x56c130[_0x9bd2('0x32')]=_[_0x9bd2('0x47')](_0x3fc330[_0x9bd2('0x32')]);_0x56c130['filters']=_[_0x9bd2('0x34')](_0x56c130[_0x9bd2('0x31')],_0x56c130['query']);_0x4b0fd8[_0x9bd2('0x36')]=_[_0x9bd2('0x34')](_0x56c130[_0x9bd2('0x31')],qs[_0x9bd2('0x35')](_0x3fc330[_0x9bd2('0x32')]['fields']));_0x4b0fd8[_0x9bd2('0x36')]=_0x4b0fd8[_0x9bd2('0x36')][_0x9bd2('0x37')]?_0x4b0fd8[_0x9bd2('0x36')]:_0x56c130[_0x9bd2('0x31')];if(_0x3fc330[_0x9bd2('0x32')]['includeAll']){_0x4b0fd8['include']=[{'all':!![]}];}_0x4b0fd8=_['merge']({},_0x4b0fd8,_0x3fc330['options']);return db['OpenchannelApplication'][_0x9bd2('0x48')](_0x4b0fd8)[_0x9bd2('0x27')](handleEntityNotFound(_0x59a76c,null))['then'](respondWithResult(_0x59a76c,null))[_0x9bd2('0x44')](handleError(_0x59a76c,null));};exports[_0x9bd2('0x49')]=function(_0x48e923,_0x28733f){return db['OpenchannelApplication'][_0x9bd2('0x49')](_0x48e923[_0x9bd2('0x4a')],{})['then'](respondWithResult(_0x28733f,0xc9))[_0x9bd2('0x44')](handleError(_0x28733f,null));};exports[_0x9bd2('0x26')]=function(_0x59cd34,_0x2192ac){if(_0x59cd34['body']['id']){delete _0x59cd34['body']['id'];}return db['OpenchannelApplication'][_0x9bd2('0x48')]({'where':{'id':_0x59cd34[_0x9bd2('0x46')]['id']}})[_0x9bd2('0x27')](handleEntityNotFound(_0x2192ac,null))[_0x9bd2('0x27')](saveUpdates(_0x59cd34[_0x9bd2('0x4a')],null))[_0x9bd2('0x27')](respondWithResult(_0x2192ac,null))['catch'](handleError(_0x2192ac,null));};exports[_0x9bd2('0x28')]=function(_0x26d30f,_0xcf65e4){return db[_0x9bd2('0x40')][_0x9bd2('0x48')]({'where':{'id':_0x26d30f['params']['id']}})['then'](handleEntityNotFound(_0xcf65e4,null))[_0x9bd2('0x27')](removeEntity(_0xcf65e4,null))[_0x9bd2('0x44')](handleError(_0xcf65e4,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1eaf417..e1d06ca 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 _0x2b1f=['bluebird','request-promise','rimraf','./openchannelApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b1f,0x1db));var _0xf2b1=function(_0xded542,_0x26e749){_0xded542=_0xded542-0x0;var _0x3a0416=_0x2b1f[_0xded542];return _0x3a0416;};'use strict';var _=require(_0xf2b1('0x0'));var util=require(_0xf2b1('0x1'));var logger=require(_0xf2b1('0x2'))(_0xf2b1('0x3'));var moment=require(_0xf2b1('0x4'));var BPromise=require(_0xf2b1('0x5'));var rp=require(_0xf2b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2b1('0x7'));var config=require('../../config/environment');var attributes=require(_0xf2b1('0x8'));module[_0xf2b1('0x9')]=function(_0x396eae,_0x9197d){return _0x396eae['define']('OpenchannelApplication',attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2b1('0xa'),'collate':_0xf2b1('0xb')});}; \ No newline at end of file +var _0x8b13=['define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0x294e86,_0x58c949){var _0x5b6130=function(_0x2de99f){while(--_0x2de99f){_0x294e86['push'](_0x294e86['shift']());}};_0x5b6130(++_0x58c949);}(_0x8b13,0xa0));var _0x38b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b13[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x38b1('0x0'));var util=require('util');var logger=require(_0x38b1('0x1'))('api');var moment=require(_0x38b1('0x2'));var BPromise=require(_0x38b1('0x3'));var rp=require(_0x38b1('0x4'));var fs=require('fs');var path=require(_0x38b1('0x5'));var rimraf=require(_0x38b1('0x6'));var config=require(_0x38b1('0x7'));var attributes=require(_0x38b1('0x8'));module['exports']=function(_0x139ce9,_0x3ab824){return _0x139ce9[_0x38b1('0x9')](_0x38b1('0xa'),attributes,{'tableName':_0x38b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x38b1('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index ee20d61..02e71d1 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 _0x0d4d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','options','raw','attributes','limit','debug','util','randomstring'];(function(_0xeee5a9,_0x31fa6a){var _0x4668ea=function(_0x2e43d8){while(--_0x2e43d8){_0xeee5a9['push'](_0xeee5a9['shift']());}};_0x4668ea(++_0x31fa6a);}(_0x0d4d,0x1a2));var _0xd0d4=function(_0x284c97,_0x1ce09c){_0x284c97=_0x284c97-0x0;var _0x5d45e0=_0x0d4d[_0x284c97];return _0x5d45e0;};'use strict';var _=require('lodash');var util=require(_0xd0d4('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd0d4('0x1'));var fs=require('fs');var Redis=require(_0xd0d4('0x2'));var db=require(_0xd0d4('0x3'))['db'];var utils=require(_0xd0d4('0x4'));var logger=require(_0xd0d4('0x5'))(_0xd0d4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0d4('0x7')][_0xd0d4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6f7d94,_0x470375,_0x10c32f){return new BPromise(function(_0x5580b5,_0x5e2183){return client[_0xd0d4('0x9')](_0x6f7d94,_0x10c32f)[_0xd0d4('0xa')](function(_0x1fae0b){logger[_0xd0d4('0xb')](_0xd0d4('0xc'),_0x470375,_0xd0d4('0xd'));logger['debug'](_0xd0d4('0xe'),_0x470375,_0xd0d4('0xd'),JSON[_0xd0d4('0xf')](_0x1fae0b));if(_0x1fae0b[_0xd0d4('0x10')]){if(_0x1fae0b[_0xd0d4('0x10')][_0xd0d4('0x11')]===0x1f4){logger[_0xd0d4('0x10')](_0xd0d4('0xc'),_0x470375,_0x1fae0b['error'][_0xd0d4('0x12')]);return _0x5e2183(_0x1fae0b[_0xd0d4('0x10')]['message']);}logger['error'](_0xd0d4('0xc'),_0x470375,_0x1fae0b['error'][_0xd0d4('0x12')]);return _0x5580b5(_0x1fae0b['error']['message']);}else{logger[_0xd0d4('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x470375,_0xd0d4('0xd'));_0x5580b5(_0x1fae0b[_0xd0d4('0x13')]['message']);}})[_0xd0d4('0x14')](function(_0x691701){logger[_0xd0d4('0x10')](_0xd0d4('0xc'),_0x470375,_0x691701);_0x5e2183(_0x691701);});});}exports[_0xd0d4('0x15')]=function(_0x5982d8){var _0x871748=this;return new Promise(function(_0x3fe802,_0x5235c5){return db['OpenchannelApplication'][_0xd0d4('0x16')](_0x5982d8['body'],{'raw':_0x5982d8['options']?_0x5982d8[_0xd0d4('0x17')][_0xd0d4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5982d8[_0xd0d4('0x17')]?_0x5982d8['options']['where']||null:null,'attributes':_0x5982d8[_0xd0d4('0x17')]?_0x5982d8[_0xd0d4('0x17')][_0xd0d4('0x19')]||null:null,'limit':_0x5982d8[_0xd0d4('0x17')]?_0x5982d8[_0xd0d4('0x17')][_0xd0d4('0x1a')]||null:null})[_0xd0d4('0xa')](function(_0x317d58){logger[_0xd0d4('0xb')](_0xd0d4('0x15'),_0x5982d8);logger[_0xd0d4('0x1b')](_0xd0d4('0x15'),_0x5982d8,JSON[_0xd0d4('0xf')](_0x317d58));_0x3fe802(_0x317d58);})[_0xd0d4('0x14')](function(_0x546f06){logger[_0xd0d4('0x10')](_0xd0d4('0x15'),_0x546f06[_0xd0d4('0x12')],_0x5982d8);_0x5235c5(_0x871748[_0xd0d4('0x10')](0x1f4,_0x546f06[_0xd0d4('0x12')]));});});}; \ No newline at end of file +var _0xfdc5=['info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelApplication,\x20%s,\x20%s','result','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x44a1a9,_0x35e7e7){var _0xc759aa=function(_0x1d0dae){while(--_0x1d0dae){_0x44a1a9['push'](_0x44a1a9['shift']());}};_0xc759aa(++_0x35e7e7);}(_0xfdc5,0x1f3));var _0x5fdc=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xfdc5[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5fdc('0x0'));var BPromise=require(_0x5fdc('0x1'));var rs=require(_0x5fdc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5fdc('0x3'));var logger=require(_0x5fdc('0x4'))(_0x5fdc('0x5'));var config=require(_0x5fdc('0x6'));var jayson=require(_0x5fdc('0x7'));var client=jayson[_0x5fdc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49ca0c,_0x55c7af,_0x518c37){return new BPromise(function(_0x321f2f,_0x301cf1){return client[_0x5fdc('0x9')](_0x49ca0c,_0x518c37)[_0x5fdc('0xa')](function(_0x3eb7c6){logger[_0x5fdc('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x55c7af,_0x5fdc('0xc'));logger[_0x5fdc('0xd')](_0x5fdc('0xe'),_0x55c7af,_0x5fdc('0xc'),JSON[_0x5fdc('0xf')](_0x3eb7c6));if(_0x3eb7c6[_0x5fdc('0x10')]){if(_0x3eb7c6[_0x5fdc('0x10')]['code']===0x1f4){logger[_0x5fdc('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x55c7af,_0x3eb7c6[_0x5fdc('0x10')][_0x5fdc('0x11')]);return _0x301cf1(_0x3eb7c6[_0x5fdc('0x10')]['message']);}logger[_0x5fdc('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x55c7af,_0x3eb7c6[_0x5fdc('0x10')][_0x5fdc('0x11')]);return _0x321f2f(_0x3eb7c6[_0x5fdc('0x10')][_0x5fdc('0x11')]);}else{logger[_0x5fdc('0xb')](_0x5fdc('0x12'),_0x55c7af,_0x5fdc('0xc'));_0x321f2f(_0x3eb7c6[_0x5fdc('0x13')][_0x5fdc('0x11')]);}})[_0x5fdc('0x14')](function(_0x1780e1){logger[_0x5fdc('0x10')](_0x5fdc('0x12'),_0x55c7af,_0x1780e1);_0x301cf1(_0x1780e1);});});}exports['UpdateOpenchannelApplication']=function(_0x415619){var _0x2fef2b=this;return new Promise(function(_0x1dd7b7,_0x3171f9){return db[_0x5fdc('0x15')][_0x5fdc('0x16')](_0x415619[_0x5fdc('0x17')],{'raw':_0x415619['options']?_0x415619[_0x5fdc('0x18')][_0x5fdc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x415619[_0x5fdc('0x18')]?_0x415619[_0x5fdc('0x18')][_0x5fdc('0x1a')]||null:null,'attributes':_0x415619[_0x5fdc('0x18')]?_0x415619['options'][_0x5fdc('0x1b')]||null:null,'limit':_0x415619[_0x5fdc('0x18')]?_0x415619[_0x5fdc('0x18')][_0x5fdc('0x1c')]||null:null})['then'](function(_0x197f67){logger['info']('UpdateOpenchannelApplication',_0x415619);logger[_0x5fdc('0xd')](_0x5fdc('0x1d'),_0x415619,JSON[_0x5fdc('0xf')](_0x197f67));_0x1dd7b7(_0x197f67);})[_0x5fdc('0x14')](function(_0x4ff370){logger['error']('UpdateOpenchannelApplication',_0x4ff370[_0x5fdc('0x11')],_0x415619);_0x3171f9(_0x2fef2b[_0x5fdc('0x10')](0x1f4,_0x4ff370['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 6172bab..d509c49 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 _0xce9c=['/:id/messages','/:id/download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','delete','openchannelinteraction:destroy','destroy','/:id/tags','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x5be047,_0x2c48e2){var _0x515643=function(_0x296db0){while(--_0x296db0){_0x5be047['push'](_0x5be047['shift']());}};_0x515643(++_0x2c48e2);}(_0xce9c,0x188));var _0xcce9=function(_0x251267,_0x39c4eb){_0x251267=_0x251267-0x0;var _0x3f297b=_0xce9c[_0x251267];return _0x3f297b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xcce9('0x0'));var express=require(_0xcce9('0x1'));var router=express[_0xcce9('0x2')]();var fs_extra=require(_0xcce9('0x3'));var auth=require(_0xcce9('0x4'));var interaction=require(_0xcce9('0x5'));var config=require(_0xcce9('0x6'));var controller=require(_0xcce9('0x7'));router[_0xcce9('0x8')]('/',auth[_0xcce9('0x9')](),controller['index']);router['get'](_0xcce9('0xa'),auth[_0xcce9('0x9')](),controller[_0xcce9('0xb')]);router['get'](_0xcce9('0xc'),auth[_0xcce9('0x9')](),controller[_0xcce9('0xd')]);router[_0xcce9('0x8')](_0xcce9('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0xcce9('0x8')](_0xcce9('0xf'),auth[_0xcce9('0x9')](),controller['download']);router[_0xcce9('0x10')]('/',auth['isAuthenticated'](),controller[_0xcce9('0x11')]);router[_0xcce9('0x10')](_0xcce9('0xe'),auth[_0xcce9('0x9')](),controller[_0xcce9('0x12')]);router['post']('/:id/tags',auth[_0xcce9('0x9')](),interaction[_0xcce9('0x13')](_0xcce9('0x14'),_0xcce9('0x15')),controller[_0xcce9('0x16')]);router[_0xcce9('0x17')]('/:id',auth[_0xcce9('0x9')](),interaction[_0xcce9('0x13')](_0xcce9('0x14'),'openchannelinteraction:update'),controller['update']);router[_0xcce9('0x18')](_0xcce9('0xc'),auth[_0xcce9('0x9')](),interaction['tracked'](_0xcce9('0x14'),_0xcce9('0x19')),controller[_0xcce9('0x1a')]);router['delete'](_0xcce9('0x1b'),auth[_0xcce9('0x9')](),controller['removeTags']);module[_0xcce9('0x1c')]=router; \ No newline at end of file +var _0x6573=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x568cf0,_0x1a44cb){var _0x360f81=function(_0x414953){while(--_0x414953){_0x568cf0['push'](_0x568cf0['shift']());}};_0x360f81(++_0x1a44cb);}(_0x6573,0xf9));var _0x3657=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6573[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x3657('0x0'));var util=require('util');var path=require(_0x3657('0x1'));var timeout=require(_0x3657('0x2'));var express=require(_0x3657('0x3'));var router=express['Router']();var fs_extra=require(_0x3657('0x4'));var auth=require(_0x3657('0x5'));var interaction=require(_0x3657('0x6'));var config=require(_0x3657('0x7'));var controller=require(_0x3657('0x8'));router[_0x3657('0x9')]('/',auth[_0x3657('0xa')](),controller['index']);router[_0x3657('0x9')]('/describe',auth[_0x3657('0xa')](),controller[_0x3657('0xb')]);router[_0x3657('0x9')]('/:id',auth[_0x3657('0xa')](),controller[_0x3657('0xc')]);router[_0x3657('0x9')](_0x3657('0xd'),auth[_0x3657('0xa')](),controller[_0x3657('0xe')]);router['get'](_0x3657('0xf'),auth[_0x3657('0xa')](),controller[_0x3657('0x10')]);router[_0x3657('0x11')]('/',auth[_0x3657('0xa')](),controller['create']);router[_0x3657('0x11')](_0x3657('0xd'),auth[_0x3657('0xa')](),controller[_0x3657('0x12')]);router['post'](_0x3657('0x13'),auth['isAuthenticated'](),interaction[_0x3657('0x14')](_0x3657('0x15'),_0x3657('0x16')),controller['addTags']);router[_0x3657('0x17')](_0x3657('0x18'),auth[_0x3657('0xa')](),interaction[_0x3657('0x14')](_0x3657('0x15'),_0x3657('0x19')),controller[_0x3657('0x1a')]);router['delete'](_0x3657('0x18'),auth['isAuthenticated'](),interaction[_0x3657('0x14')](_0x3657('0x15'),_0x3657('0x1b')),controller[_0x3657('0x1c')]);router[_0x3657('0x1d')](_0x3657('0x13'),auth['isAuthenticated'](),controller[_0x3657('0x1e')]);module[_0x3657('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 6bcc25d..65cc5bf 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 _0x1477=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x2dc53c,_0x4a29ce){var _0x32ea88=function(_0x159135){while(--_0x159135){_0x2dc53c['push'](_0x2dc53c['shift']());}};_0x32ea88(++_0x4a29ce);}(_0x1477,0x122));var _0x7147=function(_0x2aeaa7,_0x3560f5){_0x2aeaa7=_0x2aeaa7-0x0;var _0x15666a=_0x1477[_0x2aeaa7];return _0x15666a;};'use strict';var Sequelize=require(_0x7147('0x0'));module[_0x7147('0x1')]={'closed':{'type':Sequelize[_0x7147('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7147('0x3')]},'disposition':{'type':Sequelize[_0x7147('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7147('0x4')]},'note':{'type':Sequelize[_0x7147('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x7147('0x4')]},'externalUrl':{'type':Sequelize[_0x7147('0x4')]},'lastMsgAt':{'type':Sequelize[_0x7147('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7147('0x5')]('in',_0x7147('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x7147('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xdd1d=['out','INTEGER','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xdd1d,0xb2));var _0xddd1=function(_0x41ed37,_0xbcd1d4){_0x41ed37=_0x41ed37-0x0;var _0x13f7ea=_0xdd1d[_0x41ed37];return _0x13f7ea;};'use strict';var Sequelize=require(_0xddd1('0x0'));module[_0xddd1('0x1')]={'closed':{'type':Sequelize[_0xddd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xddd1('0x3')]},'disposition':{'type':Sequelize[_0xddd1('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xddd1('0x4')]},'note':{'type':Sequelize[_0xddd1('0x4')]},'read1stAt':{'type':Sequelize[_0xddd1('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xddd1('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xddd1('0x5')]('in',_0xddd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xddd1('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xddd1('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xddd1('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 72201be..14db465 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 _0xfdf0=['name','send','map','OpenchannelInteraction','rawAttributes','key','getOptions','findAll','openchannel','user','catch','show','type','query','from','params','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','sort','pick','OpenchannelInteractionId','filter','where','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','firstName','Attachment','Messages','secret','read','Owner','mkdirSync','Openchannel','createdAt','closed','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','Contact','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','util','path','ejs','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack'];(function(_0x7af046,_0x20e4c5){var _0x3580a=function(_0x186c7e){while(--_0x186c7e){_0x7af046['push'](_0x7af046['shift']());}};_0x3580a(++_0x20e4c5);}(_0xfdf0,0x1e4));var _0x0fdf=function(_0x3e478c,_0x152670){_0x3e478c=_0x3e478c-0x0;var _0x29ef89=_0xfdf0[_0x3e478c];return _0x29ef89;};'use strict';var rimraf=require(_0x0fdf('0x0'));var zipdir=require(_0x0fdf('0x1'));var moment=require(_0x0fdf('0x2'));var util=require(_0x0fdf('0x3'));var path=require(_0x0fdf('0x4'));var ejs=require(_0x0fdf('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0fdf('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x0fdf('0x7'));var pdf=require(_0x0fdf('0x8'));var logger=require('../../config/logger')('api');var config=require(_0x0fdf('0x9'));var db=require(_0x0fdf('0xa'))['db'];config[_0x0fdf('0xb')]=_[_0x0fdf('0xc')](config[_0x0fdf('0xb')],{'host':_0x0fdf('0xd'),'port':0x18eb});var socket=require(_0x0fdf('0xe'))(new Redis(config[_0x0fdf('0xb')]));require(_0x0fdf('0xf'))[_0x0fdf('0x10')](socket);function respondWithStatusCode(_0x21cb03,_0x457f77){_0x457f77=_0x457f77||0xcc;return function(_0x34f932){if(_0x34f932){return _0x21cb03[_0x0fdf('0x11')](_0x457f77);}return _0x21cb03['status'](_0x457f77)[_0x0fdf('0x12')]();};}function respondWithResult(_0x5669f6,_0x49142c){_0x49142c=_0x49142c||0xc8;return function(_0x4b9d80){if(_0x4b9d80){return _0x5669f6[_0x0fdf('0x13')](_0x49142c)[_0x0fdf('0x14')](_0x4b9d80);}};}function respondWithFilteredResult(_0x5ce619,_0x5520c9){return function(_0x4b34dc){if(_0x4b34dc){var _0x3e930b=typeof _0x5520c9[_0x0fdf('0x15')]===_0x0fdf('0x16')&&typeof _0x5520c9[_0x0fdf('0x17')]==='undefined';var _0x3321f3=_0x4b34dc[_0x0fdf('0x18')];var _0xc49d83=_0x3e930b?0x0:_0x5520c9[_0x0fdf('0x15')];var _0x4b5cb9=_0x3e930b?_0x4b34dc[_0x0fdf('0x18')]:_0x5520c9[_0x0fdf('0x15')]+_0x5520c9[_0x0fdf('0x17')];var _0x312a31;if(_0x4b5cb9>=_0x3321f3){_0x4b5cb9=_0x3321f3;_0x312a31=0xc8;}else{_0x312a31=0xce;}_0x5ce619[_0x0fdf('0x13')](_0x312a31);return _0x5ce619[_0x0fdf('0x19')](_0x0fdf('0x1a'),_0xc49d83+'-'+_0x4b5cb9+'/'+_0x3321f3)[_0x0fdf('0x14')](_0x4b34dc);}return null;};}function saveUpdates(_0x5e3bce){return function(_0x11a6d6){if(_0x11a6d6){return _0x11a6d6[_0x0fdf('0x1b')](_0x5e3bce)[_0x0fdf('0x1c')](function(_0x43ecb1){return _0x43ecb1;});}return null;};}function removeEntity(_0x10c2c3){return function(_0x3842f1){if(_0x3842f1){return _0x3842f1[_0x0fdf('0x1d')]()[_0x0fdf('0x1c')](function(){_0x10c2c3[_0x0fdf('0x13')](0xcc)[_0x0fdf('0x12')]();});}};}function handleEntityNotFound(_0x9c9c07){return function(_0x5efac4){if(!_0x5efac4){_0x9c9c07[_0x0fdf('0x11')](0x194);}return _0x5efac4;};}function handleError(_0x31088b,_0x257aa4){_0x257aa4=_0x257aa4||0x1f4;return function(_0x47c0fa){logger[_0x0fdf('0x1e')](_0x47c0fa[_0x0fdf('0x1f')]);if(_0x47c0fa[_0x0fdf('0x20')]){delete _0x47c0fa[_0x0fdf('0x20')];}_0x31088b[_0x0fdf('0x13')](_0x257aa4)[_0x0fdf('0x21')](_0x47c0fa);};}exports['index']=function(_0x413c40,_0x1de73d){var _0x4df922={};var _0xe02516=_[_0x0fdf('0x22')](db[_0x0fdf('0x23')][_0x0fdf('0x24')],function(_0x456e3b){return{'name':_0x456e3b['fieldName'],'type':_0x456e3b['type'][_0x0fdf('0x25')]};});_0x4df922=qs[_0x0fdf('0x26')](_0xe02516,_0x413c40);return interaction[_0x0fdf('0x27')](_0x0fdf('0x28'),_0x413c40['query'],_0x413c40[_0x0fdf('0x29')],_0x4df922,_0xe02516)[_0x0fdf('0x1c')](respondWithFilteredResult(_0x1de73d,_0x4df922))[_0x0fdf('0x2a')](handleError(_0x1de73d,null));};exports[_0x0fdf('0x2b')]=function(_0x22f790,_0x4f55ac){var _0x428b4f={};if(_0x22f790['query'][_0x0fdf('0x2c')]&&_0x22f790[_0x0fdf('0x2d')][_0x0fdf('0x2c')]===_0x0fdf('0x2e')){_0x428b4f[_0x0fdf('0x2e')]=_0x22f790[_0x0fdf('0x2f')]['id'];}else{_0x428b4f['id']=_0x22f790['params']['id'];}var _0x316460={'raw':![],'where':_0x428b4f},_0x381d5a={};_0x381d5a[_0x0fdf('0x30')]=_[_0x0fdf('0x31')](db['OpenchannelInteraction'][_0x0fdf('0x24')]);_0x381d5a['query']=_['keys'](_0x22f790['query']);_0x381d5a[_0x0fdf('0x32')]=_[_0x0fdf('0x33')](_0x381d5a[_0x0fdf('0x30')],_0x381d5a['query']);_0x316460[_0x0fdf('0x34')]=_[_0x0fdf('0x33')](_0x381d5a[_0x0fdf('0x30')],qs[_0x0fdf('0x35')](_0x22f790['query'][_0x0fdf('0x35')]));_0x316460[_0x0fdf('0x34')]=_0x316460[_0x0fdf('0x34')]['length']?_0x316460[_0x0fdf('0x34')]:_0x381d5a[_0x0fdf('0x30')];if(_0x22f790[_0x0fdf('0x2d')][_0x0fdf('0x36')]){_0x316460[_0x0fdf('0x37')]=[{'all':!![]}];}_0x316460=_[_0x0fdf('0x38')]({},_0x316460,_0x22f790[_0x0fdf('0x39')]);return db[_0x0fdf('0x23')][_0x0fdf('0x3a')](_0x316460)[_0x0fdf('0x1c')](handleEntityNotFound(_0x4f55ac,null))['then'](respondWithResult(_0x4f55ac,null))[_0x0fdf('0x2a')](handleError(_0x4f55ac,null));};exports[_0x0fdf('0x3b')]=function(_0x275897,_0x320255){return db['OpenchannelInteraction'][_0x0fdf('0x3b')](_0x275897[_0x0fdf('0x3c')],{})[_0x0fdf('0x1c')](respondWithResult(_0x320255,0xc9))[_0x0fdf('0x2a')](handleError(_0x320255,null));};exports[_0x0fdf('0x1b')]=function(_0xb7b3f0,_0x2ed3e7){if(_0xb7b3f0[_0x0fdf('0x3c')]['id']){delete _0xb7b3f0['body']['id'];}return db[_0x0fdf('0x23')][_0x0fdf('0x3a')]({'where':{'id':_0xb7b3f0[_0x0fdf('0x2f')]['id']}})[_0x0fdf('0x1c')](handleEntityNotFound(_0x2ed3e7,null))[_0x0fdf('0x1c')](saveUpdates(_0xb7b3f0[_0x0fdf('0x3c')],null))[_0x0fdf('0x1c')](respondWithResult(_0x2ed3e7,null))[_0x0fdf('0x2a')](handleError(_0x2ed3e7,null));};exports['destroy']=function(_0x2e7b6f,_0x282082){return db[_0x0fdf('0x23')]['find']({'where':{'id':_0x2e7b6f['params']['id']}})[_0x0fdf('0x1c')](handleEntityNotFound(_0x282082,null))[_0x0fdf('0x1c')](removeEntity(_0x282082,null))[_0x0fdf('0x2a')](handleError(_0x282082,null));};exports[_0x0fdf('0x3d')]=function(_0x4bc5bd,_0x5bedba){return db[_0x0fdf('0x23')][_0x0fdf('0x3d')]()[_0x0fdf('0x1c')](respondWithResult(_0x5bedba,null))[_0x0fdf('0x2a')](handleError(_0x5bedba,null));};exports[_0x0fdf('0x3e')]=function(_0x5ab7c7,_0x57c4eb){return db[_0x0fdf('0x3f')][_0x0fdf('0x3a')]({'where':{'id':_0x5ab7c7['params']['id']}})[_0x0fdf('0x1c')](handleEntityNotFound(_0x57c4eb,null))[_0x0fdf('0x1c')](function(_0x3484c8){if(_0x3484c8){return _0x3484c8[_0x0fdf('0x3e')](_0x5ab7c7[_0x0fdf('0x3c')][_0x0fdf('0x40')],_[_0x0fdf('0x41')](_0x5ab7c7[_0x0fdf('0x3c')],[_0x0fdf('0x40'),'id'])||{});}})['then'](respondWithResult(_0x57c4eb,null))[_0x0fdf('0x2a')](handleError(_0x57c4eb,null));};exports[_0x0fdf('0x42')]=function(_0x5e57fd,_0x3f2694){var _0x592da1={'raw':![],'where':{}};var _0x3d0089={};var _0x23afb6={'count':0x0,'rows':[]};return db[_0x0fdf('0x23')]['findOne']({'where':{'id':_0x5e57fd[_0x0fdf('0x2f')]['id']}})['then'](handleEntityNotFound(_0x3f2694,null))[_0x0fdf('0x1c')](function(_0x1b466c){if(_0x1b466c){_0x3d0089['model']=_[_0x0fdf('0x31')](db[_0x0fdf('0x3f')][_0x0fdf('0x24')]);_0x3d0089[_0x0fdf('0x2d')]=_[_0x0fdf('0x31')](_0x5e57fd[_0x0fdf('0x2d')]);_0x3d0089['filters']=_[_0x0fdf('0x33')](_0x3d0089[_0x0fdf('0x30')],_0x3d0089[_0x0fdf('0x2d')]);_0x592da1[_0x0fdf('0x34')]=_[_0x0fdf('0x33')](_0x3d0089[_0x0fdf('0x30')],qs['fields'](_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x35')]));_0x592da1[_0x0fdf('0x34')]=_0x592da1[_0x0fdf('0x34')][_0x0fdf('0x43')]?_0x592da1[_0x0fdf('0x34')]:_0x3d0089['model'];if(!_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x44')](_0x0fdf('0x45'))){_0x592da1['limit']=qs['limit'](_0x5e57fd[_0x0fdf('0x2d')]['limit']);_0x592da1[_0x0fdf('0x15')]=qs[_0x0fdf('0x15')](_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x15')]);}_0x592da1['order']=qs[_0x0fdf('0x46')](_0x5e57fd['query'][_0x0fdf('0x46')]);_0x592da1['where']=qs[_0x0fdf('0x32')](_[_0x0fdf('0x47')](_0x5e57fd[_0x0fdf('0x2d')],_0x3d0089[_0x0fdf('0x32')]));_0x592da1['where'][_0x0fdf('0x48')]=_0x1b466c['id'];if(_0x5e57fd['query'][_0x0fdf('0x49')]){_0x592da1[_0x0fdf('0x4a')]=_['merge'](_0x592da1[_0x0fdf('0x4a')],{'$or':_[_0x0fdf('0x22')](_0x592da1[_0x0fdf('0x34')],function(_0x908a5e){var _0x3e9e38={};_0x3e9e38[_0x908a5e]={'$like':'%'+_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x49')]+'%'};return _0x3e9e38;})});}if(_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x4b')]){var _0x3cb90c=_0x5e57fd[_0x0fdf('0x2d')][_0x0fdf('0x4b')][_0x0fdf('0x4c')](',');var _0x468add={};_0x468add[_0x3cb90c[0x0]]={'$gte':moment(_0x3cb90c[0x1])[_0x0fdf('0x4d')](_0x0fdf('0x4e'))};_0x592da1[_0x0fdf('0x4a')]=_[_0x0fdf('0x38')](_0x592da1[_0x0fdf('0x4a')],_0x468add);}_0x592da1=_[_0x0fdf('0x38')]({},_0x592da1,_0x5e57fd[_0x0fdf('0x39')]);return db[_0x0fdf('0x3f')][_0x0fdf('0x18')]({'where':_0x592da1[_0x0fdf('0x4a')]})[_0x0fdf('0x1c')](function(_0x339a26){_0x23afb6[_0x0fdf('0x18')]=_0x339a26;if(_0x5e57fd['query'][_0x0fdf('0x36')]){_0x592da1['include']=[{'all':!![]}];}return db[_0x0fdf('0x3f')][_0x0fdf('0x27')](_0x592da1);})[_0x0fdf('0x1c')](function(_0x27cec1){_0x23afb6[_0x0fdf('0x4f')]=_0x27cec1;return _0x23afb6;});}})[_0x0fdf('0x1c')](respondWithFilteredResult(_0x3f2694,_0x592da1))['catch'](handleError(_0x3f2694,null));};exports[_0x0fdf('0x50')]=function(_0x2df184,_0x753a96){return db[_0x0fdf('0x23')][_0x0fdf('0x3a')]({'where':{'id':_0x2df184[_0x0fdf('0x2f')]['id']}})[_0x0fdf('0x1c')](handleEntityNotFound(_0x753a96,null))[_0x0fdf('0x1c')](function(_0x884bd1){if(_0x884bd1){return _0x884bd1[_0x0fdf('0x51')](_0x2df184[_0x0fdf('0x3c')][_0x0fdf('0x40')],_[_0x0fdf('0x41')](_0x2df184[_0x0fdf('0x3c')],[_0x0fdf('0x40'),'id'])||{})[_0x0fdf('0x52')](function(){return db[_0x0fdf('0x53')]['findAll']({'attributes':['id',_0x0fdf('0x20'),_0x0fdf('0x54')],'where':{'id':_0x2df184[_0x0fdf('0x3c')]['ids']}});})['then'](function(_0x3b467c){socket[_0x0fdf('0x55')]('openchannelInteractionTags:save',{'id':Number(_0x2df184['params']['id']),'tags':_0x3b467c||[]});return{'id':Number(_0x2df184[_0x0fdf('0x2f')]['id']),'tags':_0x3b467c||[]};});}})[_0x0fdf('0x1c')](respondWithResult(_0x753a96,null))[_0x0fdf('0x2a')](handleError(_0x753a96,null));};exports[_0x0fdf('0x56')]=function(_0x28066c,_0x513878){return db[_0x0fdf('0x23')][_0x0fdf('0x3a')]({'where':{'id':_0x28066c['params']['id']}})[_0x0fdf('0x1c')](handleEntityNotFound(_0x513878,null))['then'](function(_0x18feff){if(_0x18feff){return _0x18feff[_0x0fdf('0x56')](_0x28066c[_0x0fdf('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x513878,null))[_0x0fdf('0x2a')](handleError(_0x513878,null));};exports[_0x0fdf('0x57')]=function(_0x364300,_0x3dd26a){var _0x40023d=moment()[_0x0fdf('0x58')]()[_0x0fdf('0x59')]();var _0x30bba3=path[_0x0fdf('0x5a')](config[_0x0fdf('0x5b')],_0x0fdf('0x5c'),'files',_0x0fdf('0x5d'));var _0xf22936=path['join'](config[_0x0fdf('0x5b')],_0x0fdf('0x5c'),_0x0fdf('0x5e'),_0x0fdf('0x5f'));var _0x49833b=path['join'](_0x30bba3,_0x40023d);var _0x48006f=util[_0x0fdf('0x4d')](_0x0fdf('0x60'),_0x364300[_0x0fdf('0x2f')]['id'],_0x40023d);var _0xa796ee=path[_0x0fdf('0x5a')](_0x30bba3,_0x48006f);var _0x47a7ef=[];_0x47a7ef[_0x0fdf('0x61')]({'model':db[_0x0fdf('0x62')],'as':_0x0fdf('0x62'),'attributes':['id',_0x0fdf('0x63')],'raw':!![]});_0x47a7ef[_0x0fdf('0x61')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x0fdf('0x64'),'lastName'],'raw':!![]});if(_0x364300['query']['attachments']){_0x47a7ef[_0x0fdf('0x61')]({'model':db[_0x0fdf('0x65')],'as':_0x0fdf('0x65'),'raw':!![]});}var _0x5bab55=[{'model':db[_0x0fdf('0x3f')],'as':_0x0fdf('0x66'),'attributes':['id','body','createdAt','direction',_0x0fdf('0x67'),_0x0fdf('0x68')],'include':_0x47a7ef}];_0x5bab55[_0x0fdf('0x61')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0x0fdf('0x20')]});_0x5bab55[_0x0fdf('0x61')]({'model':db[_0x0fdf('0x62')],'as':_0x0fdf('0x69'),'attributes':['id',_0x0fdf('0x63')]});return db['OpenchannelInteraction'][_0x0fdf('0x3a')]({'where':{'id':_0x364300[_0x0fdf('0x2f')]['id']},'include':_0x5bab55})[_0x0fdf('0x1c')](handleEntityNotFound(_0x3dd26a,null))['then'](function(_0x446ce8){if(_0x446ce8){var _0x2c7bf1=_0x446ce8['get']({'plain':!![]});fs[_0x0fdf('0x6a')](_0x49833b);var _0x5dd112={'channel':_0x0fdf('0x6b'),'account':_0x2c7bf1['Account'][_0x0fdf('0x20')],'agent':_0x2c7bf1[_0x0fdf('0x69')]?_0x2c7bf1[_0x0fdf('0x69')][_0x0fdf('0x63')]:'N.A.','createdAt':moment(_0x2c7bf1[_0x0fdf('0x6c')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x0fdf('0x59')](),'closedAt':_0x2c7bf1[_0x0fdf('0x6d')]?moment(_0x2c7bf1['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2c7bf1[_0x0fdf('0x6e')],'visibility':_0x2c7bf1[_0x0fdf('0x6f')]?_0x0fdf('0x70'):_0x0fdf('0x71'),'messages':_(_0x2c7bf1[_0x0fdf('0x66')])[_0x0fdf('0x49')]({'secret':![]})[_0x0fdf('0x22')](function(_0x5ede17){if(_0x5ede17[_0x0fdf('0x65')]){var _0x3d108f=path[_0x0fdf('0x5a')](_0xf22936,_0x5ede17[_0x0fdf('0x65')][_0x0fdf('0x72')]);if(fs[_0x0fdf('0x73')](_0x3d108f)){fs[_0x0fdf('0x74')](_0x3d108f)[_0x0fdf('0x75')](fs[_0x0fdf('0x76')](path[_0x0fdf('0x5a')](_0x49833b,_0x5ede17[_0x0fdf('0x65')][_0x0fdf('0x72')])));}}return{'date':moment(_0x5ede17[_0x0fdf('0x6c')])[_0x0fdf('0x4d')](_0x0fdf('0x4e'))[_0x0fdf('0x59')](),'sender':_0x5ede17[_0x0fdf('0x77')]===_0x0fdf('0x78')?_0x5ede17[_0x0fdf('0x62')]?_0x5ede17['User'][_0x0fdf('0x63')]:_0x0fdf('0x79'):_0x5ede17[_0x0fdf('0x7a')][_0x0fdf('0x64')]+(_0x5ede17['Contact']['lastName']?'\x20'+_0x5ede17[_0x0fdf('0x7a')]['lastName']:''),'body':_0x5ede17[_0x0fdf('0x65')]?_0x5ede17[_0x0fdf('0x65')][_0x0fdf('0x72')]:_0x5ede17['body'],'direction':_0x5ede17[_0x0fdf('0x77')]===_0x0fdf('0x78')?'A':'C','secret':_0x5ede17[_0x0fdf('0x67')],'read':_0x5ede17['read'],'attachment':_0x5ede17[_0x0fdf('0x65')]};})['value']()};return ejs[_0x0fdf('0x7b')](path['join'](config[_0x0fdf('0x5b')],_0x0fdf('0x5c'),'views',_0x0fdf('0x7c')),{'interaction':_0x5dd112})[_0x0fdf('0x1c')](function(_0x3eda25){var _0x140dc1=path[_0x0fdf('0x5a')](_0x49833b,_0x0fdf('0x7d')+_0x2c7bf1['id']+'-'+_0x40023d+_0x0fdf('0x7e'));var _0x45d0b4={'path':_0x140dc1,'channel':_0x0fdf('0x6b'),'interactionId':_0x2c7bf1['id']};return pdf[_0x0fdf('0x7f')](_0x3eda25,_0x45d0b4);})[_0x0fdf('0x1c')](function(){return new Promise(function(_0x142fdf,_0xbfca7b){zipdir(_0x49833b,{'saveTo':_0xa796ee},function(_0x291dfd,_0x157092){if(_0x291dfd)return _0xbfca7b(_0x291dfd);return _0x142fdf(_0x157092);});})['then'](function(){return new Promise(function(_0x5d31a6,_0x591bf4){rimraf(_0x49833b,function(_0x10dafa){if(_0x10dafa)_0x591bf4(_0x10dafa);return _0x5d31a6();});});})[_0x0fdf('0x1c')](function(){return _0x3dd26a[_0x0fdf('0x57')](_0xa796ee,_0x48006f,function(_0x23b1a1){if(_0x23b1a1){logger[_0x0fdf('0x1e')](_0x0fdf('0x80'),_0x23b1a1);}else{fs['unlinkSync'](_0xa796ee);}});});});}else{return _0x3dd26a['sendStatus'](0xc8);}})[_0x0fdf('0x2a')](handleError(_0x3dd26a,null));}; \ No newline at end of file +var _0x0439=['includeAll','addTags','setTags','name','openchannelInteractionTags:save','removeTags','download','join','root','server','files','format','push','User','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','fullname','mkdirSync','Openchannel','Owner','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','Private','map','basename','existsSync','createReadStream','pipe','createWriteStream','Contact','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','moment','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','set','update','then','error','stack','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','query','catch','show','from','params','model','keys','intersection','fields','attributes','length','include','options','create','body','find','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','filters','hasOwnProperty','nolimit','limit','order','sort','where','OpenchannelInteractionId','filter','merge','$gte','split','count'];(function(_0x3a795c,_0x25739f){var _0x5e8bf7=function(_0x599714){while(--_0x599714){_0x3a795c['push'](_0x3a795c['shift']());}};_0x5e8bf7(++_0x25739f);}(_0x0439,0x123));var _0x9043=function(_0x4b3d88,_0x49a095){_0x4b3d88=_0x4b3d88-0x0;var _0x11dbf5=_0x0439[_0x4b3d88];return _0x11dbf5;};'use strict';var rimraf=require(_0x9043('0x0'));var zipdir=require('zip-dir');var moment=require(_0x9043('0x1'));var util=require(_0x9043('0x2'));var path=require('path');var ejs=require(_0x9043('0x3'));var fs=require('fs');var _=require(_0x9043('0x4'));var Redis=require('ioredis');var interaction=require(_0x9043('0x5'));var qs=require(_0x9043('0x6'));var pdf=require(_0x9043('0x7'));var logger=require('../../config/logger')(_0x9043('0x8'));var config=require(_0x9043('0x9'));var db=require(_0x9043('0xa'))['db'];config['redis']=_['defaults'](config[_0x9043('0xb')],{'host':_0x9043('0xc'),'port':0x18eb});var socket=require(_0x9043('0xd'))(new Redis(config[_0x9043('0xb')]));require('./openchannelInteraction.socket')[_0x9043('0xe')](socket);function respondWithStatusCode(_0xeb2056,_0x4a24ff){_0x4a24ff=_0x4a24ff||0xcc;return function(_0x3a6a01){if(_0x3a6a01){return _0xeb2056[_0x9043('0xf')](_0x4a24ff);}return _0xeb2056[_0x9043('0x10')](_0x4a24ff)[_0x9043('0x11')]();};}function respondWithResult(_0x1714fb,_0x30b7ba){_0x30b7ba=_0x30b7ba||0xc8;return function(_0xeb8d07){if(_0xeb8d07){return _0x1714fb['status'](_0x30b7ba)['json'](_0xeb8d07);}};}function respondWithFilteredResult(_0x3d8e97,_0x2f1a82){return function(_0x4f5a69){if(_0x4f5a69){var _0xa87f48=typeof _0x2f1a82[_0x9043('0x12')]===_0x9043('0x13')&&typeof _0x2f1a82['limit']===_0x9043('0x13');var _0x24f128=_0x4f5a69['count'];var _0x19b1a7=_0xa87f48?0x0:_0x2f1a82[_0x9043('0x12')];var _0x387cc6=_0xa87f48?_0x4f5a69['count']:_0x2f1a82[_0x9043('0x12')]+_0x2f1a82['limit'];var _0x2c31b0;if(_0x387cc6>=_0x24f128){_0x387cc6=_0x24f128;_0x2c31b0=0xc8;}else{_0x2c31b0=0xce;}_0x3d8e97[_0x9043('0x10')](_0x2c31b0);return _0x3d8e97[_0x9043('0x14')]('Content-Range',_0x19b1a7+'-'+_0x387cc6+'/'+_0x24f128)['json'](_0x4f5a69);}return null;};}function saveUpdates(_0x1f538f){return function(_0x43dfb5){if(_0x43dfb5){return _0x43dfb5[_0x9043('0x15')](_0x1f538f)[_0x9043('0x16')](function(_0x2e1b7a){return _0x2e1b7a;});}return null;};}function removeEntity(_0x19591f){return function(_0xa4deee){if(_0xa4deee){return _0xa4deee['destroy']()[_0x9043('0x16')](function(){_0x19591f[_0x9043('0x10')](0xcc)[_0x9043('0x11')]();});}};}function handleEntityNotFound(_0x125030){return function(_0x1944df){if(!_0x1944df){_0x125030[_0x9043('0xf')](0x194);}return _0x1944df;};}function handleError(_0x4fbfc5,_0x200b93){_0x200b93=_0x200b93||0x1f4;return function(_0x23b0c3){logger[_0x9043('0x17')](_0x23b0c3[_0x9043('0x18')]);if(_0x23b0c3['name']){delete _0x23b0c3['name'];}_0x4fbfc5[_0x9043('0x10')](_0x200b93)[_0x9043('0x19')](_0x23b0c3);};}exports[_0x9043('0x1a')]=function(_0x3cca6f,_0x194a4a){var _0x442aad={};var _0x35c6ec=_['map'](db[_0x9043('0x1b')][_0x9043('0x1c')],function(_0x4f39a5){return{'name':_0x4f39a5[_0x9043('0x1d')],'type':_0x4f39a5[_0x9043('0x1e')][_0x9043('0x1f')]};});_0x442aad=qs['getOptions'](_0x35c6ec,_0x3cca6f);return interaction[_0x9043('0x20')]('openchannel',_0x3cca6f[_0x9043('0x21')],_0x3cca6f['user'],_0x442aad,_0x35c6ec)[_0x9043('0x16')](respondWithFilteredResult(_0x194a4a,_0x442aad))[_0x9043('0x22')](handleError(_0x194a4a,null));};exports[_0x9043('0x23')]=function(_0x4ae048,_0x2a468c){var _0x61be27={};if(_0x4ae048[_0x9043('0x21')][_0x9043('0x1e')]&&_0x4ae048[_0x9043('0x21')][_0x9043('0x1e')]==='from'){_0x61be27[_0x9043('0x24')]=_0x4ae048[_0x9043('0x25')]['id'];}else{_0x61be27['id']=_0x4ae048[_0x9043('0x25')]['id'];}var _0x3c0085={'raw':![],'where':_0x61be27},_0x410a3b={};_0x410a3b[_0x9043('0x26')]=_[_0x9043('0x27')](db['OpenchannelInteraction'][_0x9043('0x1c')]);_0x410a3b['query']=_[_0x9043('0x27')](_0x4ae048['query']);_0x410a3b['filters']=_['intersection'](_0x410a3b['model'],_0x410a3b[_0x9043('0x21')]);_0x3c0085['attributes']=_[_0x9043('0x28')](_0x410a3b[_0x9043('0x26')],qs[_0x9043('0x29')](_0x4ae048[_0x9043('0x21')][_0x9043('0x29')]));_0x3c0085[_0x9043('0x2a')]=_0x3c0085[_0x9043('0x2a')][_0x9043('0x2b')]?_0x3c0085[_0x9043('0x2a')]:_0x410a3b[_0x9043('0x26')];if(_0x4ae048['query']['includeAll']){_0x3c0085[_0x9043('0x2c')]=[{'all':!![]}];}_0x3c0085=_['merge']({},_0x3c0085,_0x4ae048[_0x9043('0x2d')]);return db[_0x9043('0x1b')]['find'](_0x3c0085)[_0x9043('0x16')](handleEntityNotFound(_0x2a468c,null))[_0x9043('0x16')](respondWithResult(_0x2a468c,null))[_0x9043('0x22')](handleError(_0x2a468c,null));};exports[_0x9043('0x2e')]=function(_0x32d775,_0x2a5f96){return db['OpenchannelInteraction'][_0x9043('0x2e')](_0x32d775[_0x9043('0x2f')],{})['then'](respondWithResult(_0x2a5f96,0xc9))['catch'](handleError(_0x2a5f96,null));};exports[_0x9043('0x15')]=function(_0x105607,_0x20e6b4){if(_0x105607[_0x9043('0x2f')]['id']){delete _0x105607[_0x9043('0x2f')]['id'];}return db[_0x9043('0x1b')]['find']({'where':{'id':_0x105607[_0x9043('0x25')]['id']}})[_0x9043('0x16')](handleEntityNotFound(_0x20e6b4,null))['then'](saveUpdates(_0x105607[_0x9043('0x2f')],null))['then'](respondWithResult(_0x20e6b4,null))[_0x9043('0x22')](handleError(_0x20e6b4,null));};exports['destroy']=function(_0x1fa7e4,_0x5f4c7d){return db[_0x9043('0x1b')][_0x9043('0x30')]({'where':{'id':_0x1fa7e4[_0x9043('0x25')]['id']}})[_0x9043('0x16')](handleEntityNotFound(_0x5f4c7d,null))[_0x9043('0x16')](removeEntity(_0x5f4c7d,null))[_0x9043('0x22')](handleError(_0x5f4c7d,null));};exports['describe']=function(_0x73b35,_0x26791b){return db[_0x9043('0x1b')][_0x9043('0x31')]()[_0x9043('0x16')](respondWithResult(_0x26791b,null))[_0x9043('0x22')](handleError(_0x26791b,null));};exports[_0x9043('0x32')]=function(_0x1ca02c,_0x538d9c){return db[_0x9043('0x33')][_0x9043('0x30')]({'where':{'id':_0x1ca02c[_0x9043('0x25')]['id']}})['then'](handleEntityNotFound(_0x538d9c,null))[_0x9043('0x16')](function(_0x381ae1){if(_0x381ae1){return _0x381ae1['addMessage'](_0x1ca02c[_0x9043('0x2f')]['ids'],_[_0x9043('0x34')](_0x1ca02c[_0x9043('0x2f')],[_0x9043('0x35'),'id'])||{});}})[_0x9043('0x16')](respondWithResult(_0x538d9c,null))[_0x9043('0x22')](handleError(_0x538d9c,null));};exports[_0x9043('0x36')]=function(_0x3f17f5,_0xbc34e9){var _0x5201a1={'raw':![],'where':{}};var _0x57a6d2={};var _0x2a9f84={'count':0x0,'rows':[]};return db[_0x9043('0x1b')][_0x9043('0x37')]({'where':{'id':_0x3f17f5[_0x9043('0x25')]['id']}})[_0x9043('0x16')](handleEntityNotFound(_0xbc34e9,null))[_0x9043('0x16')](function(_0x56d7a2){if(_0x56d7a2){_0x57a6d2[_0x9043('0x26')]=_['keys'](db[_0x9043('0x33')]['rawAttributes']);_0x57a6d2[_0x9043('0x21')]=_['keys'](_0x3f17f5[_0x9043('0x21')]);_0x57a6d2[_0x9043('0x38')]=_[_0x9043('0x28')](_0x57a6d2[_0x9043('0x26')],_0x57a6d2[_0x9043('0x21')]);_0x5201a1[_0x9043('0x2a')]=_[_0x9043('0x28')](_0x57a6d2[_0x9043('0x26')],qs[_0x9043('0x29')](_0x3f17f5[_0x9043('0x21')][_0x9043('0x29')]));_0x5201a1[_0x9043('0x2a')]=_0x5201a1[_0x9043('0x2a')][_0x9043('0x2b')]?_0x5201a1[_0x9043('0x2a')]:_0x57a6d2[_0x9043('0x26')];if(!_0x3f17f5[_0x9043('0x21')][_0x9043('0x39')](_0x9043('0x3a'))){_0x5201a1[_0x9043('0x3b')]=qs[_0x9043('0x3b')](_0x3f17f5[_0x9043('0x21')][_0x9043('0x3b')]);_0x5201a1[_0x9043('0x12')]=qs[_0x9043('0x12')](_0x3f17f5['query'][_0x9043('0x12')]);}_0x5201a1[_0x9043('0x3c')]=qs[_0x9043('0x3d')](_0x3f17f5[_0x9043('0x21')]['sort']);_0x5201a1[_0x9043('0x3e')]=qs[_0x9043('0x38')](_['pick'](_0x3f17f5[_0x9043('0x21')],_0x57a6d2['filters']));_0x5201a1[_0x9043('0x3e')][_0x9043('0x3f')]=_0x56d7a2['id'];if(_0x3f17f5[_0x9043('0x21')][_0x9043('0x40')]){_0x5201a1['where']=_[_0x9043('0x41')](_0x5201a1[_0x9043('0x3e')],{'$or':_['map'](_0x5201a1['attributes'],function(_0x2fc0d6){var _0x314d94={};_0x314d94[_0x2fc0d6]={'$like':'%'+_0x3f17f5[_0x9043('0x21')][_0x9043('0x40')]+'%'};return _0x314d94;})});}if(_0x3f17f5[_0x9043('0x21')][_0x9043('0x42')]){var _0x295242=_0x3f17f5['query'][_0x9043('0x42')][_0x9043('0x43')](',');var _0x453d80={};_0x453d80[_0x295242[0x0]]={'$gte':moment(_0x295242[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x5201a1['where']=_[_0x9043('0x41')](_0x5201a1[_0x9043('0x3e')],_0x453d80);}_0x5201a1=_[_0x9043('0x41')]({},_0x5201a1,_0x3f17f5['options']);return db[_0x9043('0x33')][_0x9043('0x44')]({'where':_0x5201a1[_0x9043('0x3e')]})['then'](function(_0x186125){_0x2a9f84['count']=_0x186125;if(_0x3f17f5[_0x9043('0x21')][_0x9043('0x45')]){_0x5201a1[_0x9043('0x2c')]=[{'all':!![]}];}return db[_0x9043('0x33')][_0x9043('0x20')](_0x5201a1);})[_0x9043('0x16')](function(_0x21594c){_0x2a9f84['rows']=_0x21594c;return _0x2a9f84;});}})[_0x9043('0x16')](respondWithFilteredResult(_0xbc34e9,_0x5201a1))['catch'](handleError(_0xbc34e9,null));};exports[_0x9043('0x46')]=function(_0x28e6d2,_0x369cbe){return db['OpenchannelInteraction'][_0x9043('0x30')]({'where':{'id':_0x28e6d2[_0x9043('0x25')]['id']}})[_0x9043('0x16')](handleEntityNotFound(_0x369cbe,null))['then'](function(_0x1fa11e){if(_0x1fa11e){return _0x1fa11e[_0x9043('0x47')](_0x28e6d2[_0x9043('0x2f')][_0x9043('0x35')],_[_0x9043('0x34')](_0x28e6d2[_0x9043('0x2f')],['ids','id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x9043('0x48'),'color'],'where':{'id':_0x28e6d2[_0x9043('0x2f')]['ids']}});})[_0x9043('0x16')](function(_0x92564f){socket['emit'](_0x9043('0x49'),{'id':Number(_0x28e6d2['params']['id']),'tags':_0x92564f||[]});return{'id':Number(_0x28e6d2[_0x9043('0x25')]['id']),'tags':_0x92564f||[]};});}})[_0x9043('0x16')](respondWithResult(_0x369cbe,null))[_0x9043('0x22')](handleError(_0x369cbe,null));};exports[_0x9043('0x4a')]=function(_0x366c78,_0xe61df9){return db['OpenchannelInteraction'][_0x9043('0x30')]({'where':{'id':_0x366c78[_0x9043('0x25')]['id']}})[_0x9043('0x16')](handleEntityNotFound(_0xe61df9,null))[_0x9043('0x16')](function(_0x5e6059){if(_0x5e6059){return _0x5e6059['removeTags'](_0x366c78['query'][_0x9043('0x35')]);}})[_0x9043('0x16')](respondWithStatusCode(_0xe61df9,null))[_0x9043('0x22')](handleError(_0xe61df9,null));};exports[_0x9043('0x4b')]=function(_0x286896,_0x27a5ef){var _0x5379f4=moment()['unix']()['toString']();var _0x144ca0=path[_0x9043('0x4c')](config[_0x9043('0x4d')],_0x9043('0x4e'),_0x9043('0x4f'),'tmp');var _0x51f839=path[_0x9043('0x4c')](config[_0x9043('0x4d')],_0x9043('0x4e'),_0x9043('0x4f'),'attachments');var _0x28efaf=path['join'](_0x144ca0,_0x5379f4);var _0xf96db3=util[_0x9043('0x50')]('transcript-%d-%s.zip',_0x286896[_0x9043('0x25')]['id'],_0x5379f4);var _0x12351d=path[_0x9043('0x4c')](_0x144ca0,_0xf96db3);var _0x553e46=[];_0x553e46[_0x9043('0x51')]({'model':db[_0x9043('0x52')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x553e46[_0x9043('0x51')]({'model':db[_0x9043('0x53')],'as':'Contact','attributes':['id',_0x9043('0x54'),_0x9043('0x55')],'raw':!![]});if(_0x286896[_0x9043('0x21')][_0x9043('0x56')]){_0x553e46[_0x9043('0x51')]({'model':db[_0x9043('0x57')],'as':_0x9043('0x57'),'raw':!![]});}var _0x206427=[{'model':db['OpenchannelMessage'],'as':_0x9043('0x58'),'attributes':['id',_0x9043('0x2f'),_0x9043('0x59'),_0x9043('0x5a'),_0x9043('0x5b'),_0x9043('0x5c')],'include':_0x553e46}];_0x206427[_0x9043('0x51')]({'model':db[_0x9043('0x5d')],'as':_0x9043('0x5e'),'attributes':['id',_0x9043('0x48')]});_0x206427[_0x9043('0x51')]({'model':db['User'],'as':'Owner','attributes':['id',_0x9043('0x5f')]});return db[_0x9043('0x1b')][_0x9043('0x30')]({'where':{'id':_0x286896[_0x9043('0x25')]['id']},'include':_0x206427})[_0x9043('0x16')](handleEntityNotFound(_0x27a5ef,null))[_0x9043('0x16')](function(_0xadfdce){if(_0xadfdce){var _0x3f9fa8=_0xadfdce['get']({'plain':!![]});fs[_0x9043('0x60')](_0x28efaf);var _0x10fc88={'channel':_0x9043('0x61'),'account':_0x3f9fa8[_0x9043('0x5e')][_0x9043('0x48')],'agent':_0x3f9fa8[_0x9043('0x62')]?_0x3f9fa8[_0x9043('0x62')][_0x9043('0x5f')]:'N.A.','createdAt':moment(_0x3f9fa8['createdAt'])[_0x9043('0x50')](_0x9043('0x63'))[_0x9043('0x64')](),'closedAt':_0x3f9fa8[_0x9043('0x65')]?moment(_0x3f9fa8[_0x9043('0x66')])[_0x9043('0x50')](_0x9043('0x63'))[_0x9043('0x64')]():'','disposition':_0x3f9fa8[_0x9043('0x67')],'visibility':_0x3f9fa8['threadId']?'Public':_0x9043('0x68'),'messages':_(_0x3f9fa8[_0x9043('0x58')])[_0x9043('0x40')]({'secret':![]})[_0x9043('0x69')](function(_0x312697){if(_0x312697['Attachment']){var _0x4aec96=path[_0x9043('0x4c')](_0x51f839,_0x312697[_0x9043('0x57')][_0x9043('0x6a')]);if(fs[_0x9043('0x6b')](_0x4aec96)){fs[_0x9043('0x6c')](_0x4aec96)[_0x9043('0x6d')](fs[_0x9043('0x6e')](path[_0x9043('0x4c')](_0x28efaf,_0x312697[_0x9043('0x57')][_0x9043('0x6a')])));}}return{'date':moment(_0x312697[_0x9043('0x59')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x312697[_0x9043('0x5a')]==='out'?_0x312697['User']?_0x312697['User'][_0x9043('0x5f')]:'System':_0x312697[_0x9043('0x6f')]['firstName']+(_0x312697[_0x9043('0x6f')][_0x9043('0x55')]?'\x20'+_0x312697[_0x9043('0x6f')][_0x9043('0x55')]:''),'body':_0x312697[_0x9043('0x57')]?_0x312697['Attachment'][_0x9043('0x6a')]:_0x312697['body'],'direction':_0x312697[_0x9043('0x5a')]==='out'?'A':'C','secret':_0x312697[_0x9043('0x5b')],'read':_0x312697[_0x9043('0x5c')],'attachment':_0x312697[_0x9043('0x57')]};})[_0x9043('0x70')]()};return ejs[_0x9043('0x71')](path[_0x9043('0x4c')](config[_0x9043('0x4d')],_0x9043('0x4e'),_0x9043('0x72'),_0x9043('0x73')),{'interaction':_0x10fc88})[_0x9043('0x16')](function(_0x1e9ce8){var _0x4118e4=path[_0x9043('0x4c')](_0x28efaf,_0x9043('0x74')+_0x3f9fa8['id']+'-'+_0x5379f4+'.pdf');var _0x430c38={'path':_0x4118e4,'channel':_0x9043('0x61'),'interactionId':_0x3f9fa8['id']};return pdf[_0x9043('0x75')](_0x1e9ce8,_0x430c38);})[_0x9043('0x16')](function(){return new Promise(function(_0x427774,_0x4d7a3e){zipdir(_0x28efaf,{'saveTo':_0x12351d},function(_0x28f92c,_0xc737ba){if(_0x28f92c)return _0x4d7a3e(_0x28f92c);return _0x427774(_0xc737ba);});})[_0x9043('0x16')](function(){return new Promise(function(_0x4fb3f2,_0x1c075b){rimraf(_0x28efaf,function(_0x47f0f9){if(_0x47f0f9)_0x1c075b(_0x47f0f9);return _0x4fb3f2();});});})[_0x9043('0x16')](function(){return _0x27a5ef[_0x9043('0x4b')](_0x12351d,_0xf96db3,function(_0x727994){if(_0x727994){logger['error'](_0x9043('0x76'),_0x727994);}else{fs[_0x9043('0x77')](_0x12351d);}});});});}else{return _0x27a5ef[_0x9043('0xf')](0xc8);}})[_0x9043('0x22')](handleError(_0x27a5ef,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 607c05f..edf7a1b 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 _0x1a60=['map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x53fee7,_0x4006c7){var _0x5c0699=function(_0x4d9cfe){while(--_0x4d9cfe){_0x53fee7['push'](_0x53fee7['shift']());}};_0x5c0699(++_0x4006c7);}(_0x1a60,0x196));var _0x01a6=function(_0x4809e7,_0x137d75){_0x4809e7=_0x4809e7-0x0;var _0x2b48f1=_0x1a60[_0x4809e7];return _0x2b48f1;};'use strict';var EventEmitter=require(_0x01a6('0x0'));var OpenchannelInteraction=require(_0x01a6('0x1'))['db'][_0x01a6('0x2')];var OpenchannelMessage=require(_0x01a6('0x1'))['db'][_0x01a6('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x01a6('0x4')](0x0);var events={'afterCreate':_0x01a6('0x5'),'afterUpdate':_0x01a6('0x6'),'afterDestroy':_0x01a6('0x7')};function emitEvent(_0x37f094){return function(_0x554504,_0x43c9b2,_0x57d7a5){_0x554504[_0x01a6('0x8')]({'attributes':['id'],'raw':!![]})[_0x01a6('0x9')](function(_0x51ab67){_0x554504[_0x01a6('0xa')](_0x01a6('0xb'),_0x51ab67[_0x01a6('0xc')](function(_0x4711a6){return{'id':_0x4711a6['id']};}));return OpenchannelMessage[_0x01a6('0xd')]({'where':{'OpenchannelInteractionId':_0x554504['id'],'direction':'in','read':![]},'raw':!![]});})[_0x01a6('0x9')](function(_0x3527ec){_0x554504[_0x01a6('0xa')](_0x01a6('0xe'),_0x3527ec['length']);OpenchannelInteractionEvents[_0x01a6('0xf')](_0x37f094+':'+_0x554504['id'],_0x554504);OpenchannelInteractionEvents['emit'](_0x37f094,_0x554504);_0x57d7a5(null);})[_0x01a6('0x10')](_0x57d7a5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x01a6('0x11')](e,emitEvent(event));}}module[_0x01a6('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbd88=['events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbd88,0xfc));var _0x8bd8=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbd88[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x8bd8('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x8bd8('0x1')];var OpenchannelMessage=require(_0x8bd8('0x2'))['db'][_0x8bd8('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x8bd8('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8bd8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x581365){return function(_0x2c8c68,_0x280d3b,_0x1c4520){_0x2c8c68[_0x8bd8('0x6')]({'attributes':['id'],'raw':!![]})[_0x8bd8('0x7')](function(_0x570308){_0x2c8c68[_0x8bd8('0x8')](_0x8bd8('0x9'),_0x570308[_0x8bd8('0xa')](function(_0x135b34){return{'id':_0x135b34['id']};}));return OpenchannelMessage[_0x8bd8('0xb')]({'where':{'OpenchannelInteractionId':_0x2c8c68['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8bd8('0x7')](function(_0x2fb47b){_0x2c8c68[_0x8bd8('0x8')](_0x8bd8('0xc'),_0x2fb47b[_0x8bd8('0xd')]);OpenchannelInteractionEvents['emit'](_0x581365+':'+_0x2c8c68['id'],_0x2c8c68);OpenchannelInteractionEvents[_0x8bd8('0xe')](_0x581365,_0x2c8c68);_0x1c4520(null);})['catch'](_0x1c4520(null));};}for(var e in events){if(events[_0x8bd8('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x8bd8('0x10')](e,emitEvent(event));}}module[_0x8bd8('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 35c0640..055bf48 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 _0xb68e=['path','./openchannelInteraction.attributes','define','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','lodash','util','api','moment'];(function(_0x4f6371,_0x56f889){var _0x38651f=function(_0x27be99){while(--_0x27be99){_0x4f6371['push'](_0x4f6371['shift']());}};_0x38651f(++_0x56f889);}(_0xb68e,0x80));var _0xeb68=function(_0x44f28c,_0x3d123d){_0x44f28c=_0x44f28c-0x0;var _0x329c3c=_0xb68e[_0x44f28c];return _0x329c3c;};'use strict';var _=require(_0xeb68('0x0'));var util=require(_0xeb68('0x1'));var logger=require('../../config/logger')(_0xeb68('0x2'));var moment=require(_0xeb68('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb68('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeb68('0x5'));module['exports']=function(_0x1d8606,_0x1daf67){return _0x1d8606[_0xeb68('0x6')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb68('0x7'),'collate':_0xeb68('0x8'),'hooks':{'beforeUpdate':function(_0x38293f,_0x274689,_0x35e824){if(_0x38293f[_0xeb68('0x9')]('closed')){_0x38293f[_0xeb68('0xa')]=moment()[_0xeb68('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x35e824(null,_0x38293f);}}});}; \ No newline at end of file +var _0x8ae9=['define','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','rimraf','./openchannelInteraction.attributes','exports'];(function(_0x84bf0a,_0x1f4a00){var _0x46d7b3=function(_0xf6a006){while(--_0xf6a006){_0x84bf0a['push'](_0x84bf0a['shift']());}};_0x46d7b3(++_0x1f4a00);}(_0x8ae9,0x1c2));var _0x98ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ae9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x98ae('0x0'));var util=require(_0x98ae('0x1'));var logger=require('../../config/logger')(_0x98ae('0x2'));var moment=require(_0x98ae('0x3'));var BPromise=require(_0x98ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98ae('0x5'));var rimraf=require(_0x98ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x98ae('0x7'));module[_0x98ae('0x8')]=function(_0x43322d,_0x767128){return _0x43322d[_0x98ae('0x9')]('OpenchannelInteraction',attributes,{'tableName':_0x98ae('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98ae('0xb'),'collate':_0x98ae('0xc'),'hooks':{'beforeUpdate':function(_0x3a3855,_0x2907c2,_0x234472){if(_0x3a3855[_0x98ae('0xd')](_0x98ae('0xe'))){_0x3a3855[_0x98ae('0xf')]=moment()['format'](_0x98ae('0x10'));}_0x234472(null,_0x3a3855);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d4920ad..d4eb44a 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 _0x557f=['OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','result','UpdateOpenchannelInteraction','update','options','OpenchannelInteraction','find','where','addTags','body','ids','omit','spread','AddTags','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','request\x20sent','debug'];(function(_0x1a0184,_0x3d4bcf){var _0x17a88a=function(_0x724b3a){while(--_0x724b3a){_0x1a0184['push'](_0x1a0184['shift']());}};_0x17a88a(++_0x3d4bcf);}(_0x557f,0x64));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf557('0x0'));var util=require('util');var moment=require(_0xf557('0x1'));var BPromise=require(_0xf557('0x2'));var rs=require(_0xf557('0x3'));var fs=require('fs');var Redis=require(_0xf557('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf557('0x5'));var logger=require(_0xf557('0x6'))('rpc');var config=require(_0xf557('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf557('0x8')][_0xf557('0x9')]({'port':0x232a});config[_0xf557('0xa')]=_['defaults'](config[_0xf557('0xa')],{'host':_0xf557('0xb'),'port':0x18eb});var socket=require(_0xf557('0xc'))(new Redis(config['redis']));require(_0xf557('0xd'))[_0xf557('0xe')](socket);function respondWithRpcPromise(_0x159eb3,_0x36c131,_0x1d4294){return new BPromise(function(_0x10d0fd,_0x5ed68a){return client[_0xf557('0xf')](_0x159eb3,_0x1d4294)[_0xf557('0x10')](function(_0x4ddcd5){logger[_0xf557('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x36c131,_0xf557('0x12'));logger[_0xf557('0x13')](_0xf557('0x14'),_0x36c131,_0xf557('0x12'),JSON[_0xf557('0x15')](_0x4ddcd5));if(_0x4ddcd5[_0xf557('0x16')]){if(_0x4ddcd5['error'][_0xf557('0x17')]===0x1f4){logger[_0xf557('0x16')](_0xf557('0x18'),_0x36c131,_0x4ddcd5[_0xf557('0x16')]['message']);return _0x5ed68a(_0x4ddcd5[_0xf557('0x16')][_0xf557('0x19')]);}logger[_0xf557('0x16')](_0xf557('0x18'),_0x36c131,_0x4ddcd5['error'][_0xf557('0x19')]);return _0x10d0fd(_0x4ddcd5[_0xf557('0x16')][_0xf557('0x19')]);}else{logger['info'](_0xf557('0x18'),_0x36c131,'request\x20sent');_0x10d0fd(_0x4ddcd5[_0xf557('0x1a')][_0xf557('0x19')]);}})['catch'](function(_0x20e351){logger[_0xf557('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x36c131,_0x20e351);_0x5ed68a(_0x20e351);});});}exports[_0xf557('0x1b')]=function(_0x3a1ab7){var _0x134f07=this;return new Promise(function(_0x1397dd,_0x548805){return db['OpenchannelInteraction'][_0xf557('0x1c')](_0x3a1ab7['body'],{'raw':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7[_0xf557('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7[_0xf557('0x1d')]['where']||null:null,'attributes':_0x3a1ab7[_0xf557('0x1d')]?_0x3a1ab7['options']['attributes']||null:null,'limit':_0x3a1ab7['options']?_0x3a1ab7[_0xf557('0x1d')]['limit']||null:null})['then'](function(_0x38f290){logger[_0xf557('0x11')](_0xf557('0x1b'),_0x3a1ab7);logger['debug']('UpdateOpenchannelInteraction',_0x3a1ab7,JSON[_0xf557('0x15')](_0x38f290));_0x1397dd(_0x38f290);})['catch'](function(_0x2a5fca){logger[_0xf557('0x16')](_0xf557('0x1b'),_0x2a5fca['message'],_0x3a1ab7);_0x548805(_0x134f07[_0xf557('0x16')](0x1f4,_0x2a5fca[_0xf557('0x19')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x305e63){return new Promise(function(_0x1b185a,_0x8d8db8){return db[_0xf557('0x1e')][_0xf557('0x1f')]({'where':_0x305e63[_0xf557('0x1d')]?_0x305e63[_0xf557('0x1d')][_0xf557('0x20')]||null:null})[_0xf557('0x10')](function(_0x418af7){if(_0x418af7){return _0x418af7[_0xf557('0x21')](_0x305e63[_0xf557('0x22')][_0xf557('0x23')],_[_0xf557('0x24')](_0x305e63[_0xf557('0x22')],[_0xf557('0x23'),'id'])||{});}})[_0xf557('0x25')](function(_0x340391){logger[_0xf557('0x11')](_0xf557('0x26'),_0x305e63);logger[_0xf557('0x13')](_0xf557('0x26'),_0x305e63,JSON[_0xf557('0x15')](_0x340391));_0x1b185a(_0x340391);})[_0xf557('0x27')](function(_0x21b0d4){logger[_0xf557('0x16')](_0xf557('0x26'),_0x21b0d4[_0xf557('0x19')],_0x305e63);_0x8d8db8(_this[_0xf557('0x16')](0x1f4,_0x21b0d4[_0xf557('0x19')]));});});}; \ No newline at end of file +var _0x34c9=['defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','limit','catch','AddTagsToOpenchannelInteraction','find','addTags','body','ids','AddTags','debug','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x1f0964,_0x5ae58b){var _0x2b106d=function(_0x1a966e){while(--_0x1a966e){_0x1f0964['push'](_0x1f0964['shift']());}};_0x2b106d(++_0x5ae58b);}(_0x34c9,0x1ca));var _0x934c=function(_0x2fb67b,_0x1ab284){_0x2fb67b=_0x2fb67b-0x0;var _0x17b752=_0x34c9[_0x2fb67b];return _0x17b752;};'use strict';var _=require(_0x934c('0x0'));var util=require('util');var moment=require(_0x934c('0x1'));var BPromise=require(_0x934c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x934c('0x3'));var logger=require(_0x934c('0x4'))(_0x934c('0x5'));var config=require(_0x934c('0x6'));var jayson=require(_0x934c('0x7'));var client=jayson[_0x934c('0x8')]['http']({'port':0x232a});config[_0x934c('0x9')]=_[_0x934c('0xa')](config['redis'],{'host':_0x934c('0xb'),'port':0x18eb});var socket=require(_0x934c('0xc'))(new Redis(config[_0x934c('0x9')]));require(_0x934c('0xd'))['register'](socket);function respondWithRpcPromise(_0x17b615,_0xbb2940,_0x27bb2e){return new BPromise(function(_0x207e63,_0x53779a){return client[_0x934c('0xe')](_0x17b615,_0x27bb2e)[_0x934c('0xf')](function(_0x29835b){logger[_0x934c('0x10')](_0x934c('0x11'),_0xbb2940,_0x934c('0x12'));logger['debug'](_0x934c('0x13'),_0xbb2940,'request\x20sent',JSON[_0x934c('0x14')](_0x29835b));if(_0x29835b['error']){if(_0x29835b[_0x934c('0x15')][_0x934c('0x16')]===0x1f4){logger['error'](_0x934c('0x11'),_0xbb2940,_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);return _0x53779a(_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);}logger[_0x934c('0x15')](_0x934c('0x11'),_0xbb2940,_0x29835b['error'][_0x934c('0x17')]);return _0x207e63(_0x29835b[_0x934c('0x15')][_0x934c('0x17')]);}else{logger['info'](_0x934c('0x11'),_0xbb2940,_0x934c('0x12'));_0x207e63(_0x29835b[_0x934c('0x18')]['message']);}})['catch'](function(_0x2e3b8e){logger[_0x934c('0x15')](_0x934c('0x11'),_0xbb2940,_0x2e3b8e);_0x53779a(_0x2e3b8e);});});}exports[_0x934c('0x19')]=function(_0x4226bf){var _0x21b868=this;return new Promise(function(_0x450efb,_0x476b19){return db[_0x934c('0x1a')]['update'](_0x4226bf['body'],{'raw':_0x4226bf[_0x934c('0x1b')]?_0x4226bf[_0x934c('0x1b')][_0x934c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4226bf['options']?_0x4226bf[_0x934c('0x1b')][_0x934c('0x1d')]||null:null,'attributes':_0x4226bf['options']?_0x4226bf[_0x934c('0x1b')]['attributes']||null:null,'limit':_0x4226bf['options']?_0x4226bf['options'][_0x934c('0x1e')]||null:null})[_0x934c('0xf')](function(_0x2d01c0){logger[_0x934c('0x10')]('UpdateOpenchannelInteraction',_0x4226bf);logger['debug'](_0x934c('0x19'),_0x4226bf,JSON[_0x934c('0x14')](_0x2d01c0));_0x450efb(_0x2d01c0);})[_0x934c('0x1f')](function(_0x240d47){logger[_0x934c('0x15')](_0x934c('0x19'),_0x240d47['message'],_0x4226bf);_0x476b19(_0x21b868[_0x934c('0x15')](0x1f4,_0x240d47[_0x934c('0x17')]));});});};exports[_0x934c('0x20')]=function(_0xa79ef7){return new Promise(function(_0x4977ad,_0x425e61){return db['OpenchannelInteraction'][_0x934c('0x21')]({'where':_0xa79ef7['options']?_0xa79ef7[_0x934c('0x1b')]['where']||null:null})['then'](function(_0x38f9){if(_0x38f9){return _0x38f9[_0x934c('0x22')](_0xa79ef7[_0x934c('0x23')][_0x934c('0x24')],_['omit'](_0xa79ef7[_0x934c('0x23')],[_0x934c('0x24'),'id'])||{});}})['spread'](function(_0x3e4cbb){logger['info'](_0x934c('0x25'),_0xa79ef7);logger[_0x934c('0x26')](_0x934c('0x25'),_0xa79ef7,JSON['stringify'](_0x3e4cbb));_0x4977ad(_0x3e4cbb);})[_0x934c('0x1f')](function(_0x418551){logger[_0x934c('0x15')](_0x934c('0x25'),_0x418551[_0x934c('0x17')],_0xa79ef7);_0x425e61(_this['error'](0x1f4,_0x418551[_0x934c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 51e3fe6..f49c0e6 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 _0x30bb=['./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x5a19fc,_0x58f9f4){var _0x34b413=function(_0x344feb){while(--_0x344feb){_0x5a19fc['push'](_0x5a19fc['shift']());}};_0x34b413(++_0x58f9f4);}(_0x30bb,0x13e));var _0xb30b=function(_0xf0e16a,_0x158871){_0xf0e16a=_0xf0e16a-0x0;var _0x105892=_0x30bb[_0xf0e16a];return _0x105892;};'use strict';var OpenchannelInteractionEvents=require(_0xb30b('0x0'));var events=['save',_0xb30b('0x1'),_0xb30b('0x2')];function createListener(_0x4dc49d,_0x3d1428){return function(_0x4165a3){_0x3d1428[_0xb30b('0x3')](_0x4dc49d,_0x4165a3);};}function removeListener(_0x1ea54e,_0x4c867e){return function(){OpenchannelInteractionEvents[_0xb30b('0x4')](_0x1ea54e,_0x4c867e);};}exports[_0xb30b('0x5')]=function(_0x526a44){for(var _0x1d31ac=0x0,_0x1a6b9a=events['length'];_0x1d31ac<_0x1a6b9a;_0x1d31ac++){var _0x6014fb=events[_0x1d31ac];var _0xe92476=createListener('openchannelInteraction:'+_0x6014fb,_0x526a44);OpenchannelInteractionEvents['on'](_0x6014fb,_0xe92476);}}; \ No newline at end of file +var _0x88be=['remove','update','emit','removeListener','register','./openchannelInteraction.events'];(function(_0x823638,_0x231386){var _0x13d32e=function(_0x4f71a1){while(--_0x4f71a1){_0x823638['push'](_0x823638['shift']());}};_0x13d32e(++_0x231386);}(_0x88be,0x137));var _0xe88b=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x88be[_0x373dee];return _0x46798f;};'use strict';var OpenchannelInteractionEvents=require(_0xe88b('0x0'));var events=['save',_0xe88b('0x1'),_0xe88b('0x2')];function createListener(_0x2f0eef,_0x3f14ec){return function(_0x159991){_0x3f14ec[_0xe88b('0x3')](_0x2f0eef,_0x159991);};}function removeListener(_0x44a6bd,_0x13775c){return function(){OpenchannelInteractionEvents[_0xe88b('0x4')](_0x44a6bd,_0x13775c);};}exports[_0xe88b('0x5')]=function(_0x114d26){for(var _0x42d5d4=0x0,_0x2a6fc6=events['length'];_0x42d5d4<_0x2a6fc6;_0x42d5d4++){var _0x181bd8=events[_0x42d5d4];var _0xa974e=createListener('openchannelInteraction:'+_0x181bd8,_0x114d26);OpenchannelInteractionEvents['on'](_0x181bd8,_0xa974e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 5727c01..2cddda6 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 _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(_0x268a71,_0x320096){var _0xd456b3=function(_0x200e01){while(--_0x200e01){_0x268a71['push'](_0x268a71['shift']());}};_0xd456b3(++_0x320096);}(_0xe706,0xa3));var _0x6e70=function(_0x8ae836,_0x5735d7){_0x8ae836=_0x8ae836-0x0;var _0x2f9136=_0xe706[_0x8ae836];return _0x2f9136;};'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 +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0xf10840,_0xad3916){var _0x1fdf7e=function(_0x463be3){while(--_0x463be3){_0xf10840['push'](_0xf10840['shift']());}};_0x1fdf7e(++_0xad3916);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0xcb91[_0x35fabd];return _0x61a8ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 0432eb9..d17fca0 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 _0xfe9d=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x52850c,_0x249dc8){var _0x113595=function(_0x4a6be5){while(--_0x4a6be5){_0x52850c['push'](_0x52850c['shift']());}};_0x113595(++_0x249dc8);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x37a6da,_0x10c691){_0x37a6da=_0x37a6da-0x0;var _0x55e44f=_0xfe9d[_0x37a6da];return _0x55e44f;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'body':{'type':Sequelize[_0xdfe9('0x2')](_0xdfe9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xdfe9('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdfe9('0x5')]('in','out'),'defaultValue':_0xdfe9('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xdfe9('0x7')]},'providerName':{'type':Sequelize[_0xdfe9('0x8')]},'providerResponse':{'type':Sequelize[_0xdfe9('0x2')]}}; \ No newline at end of file +var _0x0102=['exports','TEXT','medium','BOOLEAN','STRING'];(function(_0x3d1ea7,_0x44e0bf){var _0x3add40=function(_0x4b5d50){while(--_0x4b5d50){_0x3d1ea7['push'](_0x3d1ea7['shift']());}};_0x3add40(++_0x44e0bf);}(_0x0102,0x186));var _0x2010=function(_0xb3fe1a,_0x43ecc5){_0xb3fe1a=_0xb3fe1a-0x0;var _0x26550f=_0x0102[_0xb3fe1a];return _0x26550f;};'use strict';var Sequelize=require('sequelize');module[_0x2010('0x0')]={'body':{'type':Sequelize[_0x2010('0x1')](_0x2010('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2010('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x2010('0x4')]},'providerResponse':{'type':Sequelize[_0x2010('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 7300a23..16f9d8d 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 _0xf569=['User','email','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','create','body','destroy','describe','openchannel','readAt','format','UserId','user','agent','get','OpenchannelInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','openchannel-interactions','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId'];(function(_0x31a1f4,_0x6c51d4){var _0x1eb1cc=function(_0x4e3153){while(--_0x4e3153){_0x31a1f4['push'](_0x31a1f4['shift']());}};_0x1eb1cc(++_0x6c51d4);}(_0xf569,0x86));var _0x9f56=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xf569[_0x2d2c16];return _0x53f2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f56('0x0'));var zipdir=require(_0x9f56('0x1'));var jsonpatch=require(_0x9f56('0x2'));var rp=require(_0x9f56('0x3'));var moment=require(_0x9f56('0x4'));var BPromise=require(_0x9f56('0x5'));var Mustache=require(_0x9f56('0x6'));var util=require('util');var path=require(_0x9f56('0x7'));var sox=require(_0x9f56('0x8'));var csv=require(_0x9f56('0x9'));var ejs=require(_0x9f56('0xa'));var fs=require('fs');var fs_extra=require(_0x9f56('0xb'));var _=require(_0x9f56('0xc'));var squel=require(_0x9f56('0xd'));var crypto=require(_0x9f56('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9f56('0xf'));var toCsv=require(_0x9f56('0x9'));var querystring=require('querystring');var Papa=require(_0x9f56('0x10'));var Redis=require(_0x9f56('0x11'));var authService=require(_0x9f56('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f56('0x13'));var logger=require(_0x9f56('0x14'))(_0x9f56('0x15'));var utils=require(_0x9f56('0x16'));var config=require(_0x9f56('0x17'));var licenseUtil=require(_0x9f56('0x18'));var db=require('../../mysqldb')['db'];config[_0x9f56('0x19')]=_[_0x9f56('0x1a')](config[_0x9f56('0x19')],{'host':_0x9f56('0x1b'),'port':0x18eb});var socket=require(_0x9f56('0x1c'))(new Redis(config[_0x9f56('0x19')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x9f56('0x1d'));var client=jayson[_0x9f56('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x9f56('0x1e')][_0x9f56('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x241fb9,_0x27f26d,_0x2c3b1b,_0x4b8d0d){return new BPromise(function(_0x17db0b,_0x3eee97){var _0x224866=_0x4b8d0d||client;return _0x224866[_0x9f56('0x20')](_0x241fb9,_0x2c3b1b)[_0x9f56('0x21')](function(_0x213619){logger[_0x9f56('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x27f26d,_0x9f56('0x23'));logger[_0x9f56('0x24')](_0x9f56('0x25'),_0x27f26d,_0x9f56('0x23'),JSON['stringify'](_0x213619));if(_0x213619[_0x9f56('0x26')]){if(_0x213619[_0x9f56('0x26')]['code']===0x1f4){logger[_0x9f56('0x26')](_0x9f56('0x27'),_0x27f26d,_0x213619['error']['message']);return _0x3eee97(_0x213619[_0x9f56('0x26')]['message']);}logger[_0x9f56('0x26')](_0x9f56('0x27'),_0x27f26d,_0x213619[_0x9f56('0x26')]['message']);return _0x17db0b(_0x213619['error'][_0x9f56('0x28')]);}else{logger[_0x9f56('0x22')](_0x9f56('0x27'),_0x27f26d,_0x9f56('0x23'));_0x17db0b(_0x213619[_0x9f56('0x29')][_0x9f56('0x28')]);}})[_0x9f56('0x2a')](function(_0x203e42){logger[_0x9f56('0x26')](_0x9f56('0x27'),_0x27f26d,_0x203e42);_0x3eee97(_0x203e42);});});}function respondWithStatusCode(_0xa52525,_0x241c45){_0x241c45=_0x241c45||0xcc;return function(_0x505608){if(_0x505608){return _0xa52525[_0x9f56('0x2b')](_0x241c45);}return _0xa52525[_0x9f56('0x2c')](_0x241c45)[_0x9f56('0x2d')]();};}function respondWithResult(_0x268d00,_0x90e4cb){_0x90e4cb=_0x90e4cb||0xc8;return function(_0x238f1b){if(_0x238f1b){return _0x268d00[_0x9f56('0x2c')](_0x90e4cb)[_0x9f56('0x2e')](_0x238f1b);}};}function respondWithFilteredResult(_0x5bf440,_0x213f1e){return function(_0x28915a){if(_0x28915a){var _0x1ffa49=typeof _0x213f1e[_0x9f56('0x2f')]===_0x9f56('0x30')&&typeof _0x213f1e[_0x9f56('0x31')]===_0x9f56('0x30');var _0x216587=_0x28915a[_0x9f56('0x32')];var _0x2432ca=_0x1ffa49?0x0:_0x213f1e[_0x9f56('0x2f')];var _0x4bca9a=_0x1ffa49?_0x28915a[_0x9f56('0x32')]:_0x213f1e[_0x9f56('0x2f')]+_0x213f1e[_0x9f56('0x31')];var _0x23d9af;if(_0x4bca9a>=_0x216587){_0x4bca9a=_0x216587;_0x23d9af=0xc8;}else{_0x23d9af=0xce;}_0x5bf440['status'](_0x23d9af);return _0x5bf440[_0x9f56('0x33')](_0x9f56('0x34'),_0x2432ca+'-'+_0x4bca9a+'/'+_0x216587)[_0x9f56('0x2e')](_0x28915a);}return null;};}function patchUpdates(_0x5e5a54){return function(_0x386838){try{jsonpatch[_0x9f56('0x35')](_0x386838,_0x5e5a54,!![]);}catch(_0xf47806){return BPromise[_0x9f56('0x36')](_0xf47806);}return _0x386838[_0x9f56('0x37')]();};}function saveUpdates(_0x3914d1,_0x4a82d6){return function(_0x22b69c){if(_0x22b69c){return _0x22b69c[_0x9f56('0x38')](_0x3914d1)[_0x9f56('0x21')](function(_0x497692){return _0x497692;});}return null;};}function removeEntity(_0x90bdb6,_0x59ece1){return function(_0x35eabe){if(_0x35eabe){return _0x35eabe['destroy']()['then'](function(){_0x90bdb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a73ce,_0x1aaf65){return function(_0x429ef2){if(!_0x429ef2){_0x2a73ce[_0x9f56('0x2b')](0x194);}return _0x429ef2;};}function handleError(_0x200529,_0xff2bb4){_0xff2bb4=_0xff2bb4||0x1f4;return function(_0xc36c41){logger[_0x9f56('0x26')](_0xc36c41[_0x9f56('0x39')]);if(_0xc36c41[_0x9f56('0x3a')]){delete _0xc36c41[_0x9f56('0x3a')];}_0x200529[_0x9f56('0x2c')](_0xff2bb4)[_0x9f56('0x3b')](_0xc36c41);};}exports[_0x9f56('0x3c')]=function(_0x43a5d2,_0x44d699){var _0x4d3bf9={},_0x2599c6={},_0x317a78={'count':0x0,'rows':[]};var _0x41a28c=_[_0x9f56('0x3d')](db[_0x9f56('0x3e')][_0x9f56('0x3f')],function(_0x5b31e1){return{'name':_0x5b31e1[_0x9f56('0x40')],'type':_0x5b31e1[_0x9f56('0x41')]['key']};});_0x2599c6[_0x9f56('0x42')]=_[_0x9f56('0x3d')](_0x41a28c,_0x9f56('0x3a'));_0x2599c6[_0x9f56('0x43')]=_[_0x9f56('0x44')](_0x43a5d2[_0x9f56('0x43')]);_0x2599c6['filters']=_[_0x9f56('0x45')](_0x2599c6[_0x9f56('0x42')],_0x2599c6['query']);_0x4d3bf9[_0x9f56('0x46')]=_[_0x9f56('0x45')](_0x2599c6[_0x9f56('0x42')],qs[_0x9f56('0x47')](_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x47')]));_0x4d3bf9[_0x9f56('0x46')]=_0x4d3bf9[_0x9f56('0x46')][_0x9f56('0x48')]?_0x4d3bf9[_0x9f56('0x46')]:_0x2599c6['model'];if(!_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x49')](_0x9f56('0x4a'))){_0x4d3bf9[_0x9f56('0x31')]=qs[_0x9f56('0x31')](_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x31')]);_0x4d3bf9[_0x9f56('0x2f')]=qs[_0x9f56('0x2f')](_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x2f')]);}_0x4d3bf9[_0x9f56('0x4b')]=qs['sort'](_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x4c')]);_0x4d3bf9[_0x9f56('0x4d')]=qs[_0x9f56('0x4e')](_[_0x9f56('0x4f')](_0x43a5d2[_0x9f56('0x43')],_0x2599c6[_0x9f56('0x4e')]),_0x41a28c);if(_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x50')]){_0x4d3bf9[_0x9f56('0x4d')]=_[_0x9f56('0x51')](_0x4d3bf9['where'],{'$or':_['map'](_0x41a28c,function(_0x2c0ee2){if(_0x2c0ee2[_0x9f56('0x41')]!==_0x9f56('0x52')){var _0x52a46b={};_0x52a46b[_0x2c0ee2[_0x9f56('0x3a')]]={'$like':'%'+_0x43a5d2[_0x9f56('0x43')][_0x9f56('0x50')]+'%'};return _0x52a46b;}})});}_0x4d3bf9=_[_0x9f56('0x51')]({},_0x4d3bf9,_0x43a5d2[_0x9f56('0x53')]);var _0x5c1c1b={'where':_0x4d3bf9[_0x9f56('0x4d')]};return db[_0x9f56('0x3e')][_0x9f56('0x32')](_0x5c1c1b)[_0x9f56('0x21')](function(_0x248653){_0x317a78[_0x9f56('0x32')]=_0x248653;if(_0x43a5d2['query']['includeAll']){_0x4d3bf9[_0x9f56('0x54')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x9f56('0x55')](_0x4d3bf9);})[_0x9f56('0x21')](function(_0x21c454){_0x317a78[_0x9f56('0x56')]=_0x21c454;return _0x317a78;})[_0x9f56('0x21')](respondWithFilteredResult(_0x44d699,_0x4d3bf9))[_0x9f56('0x2a')](handleError(_0x44d699,null));};exports[_0x9f56('0x57')]=function(_0x31db8f,_0x1f0d6d){var _0x13d131={'raw':!![],'where':{'id':_0x31db8f[_0x9f56('0x58')]['id']}},_0x107332={};_0x107332[_0x9f56('0x42')]=_[_0x9f56('0x44')](db['OpenchannelMessage'][_0x9f56('0x3f')]);_0x107332[_0x9f56('0x43')]=_['keys'](_0x31db8f[_0x9f56('0x43')]);_0x107332['filters']=_[_0x9f56('0x45')](_0x107332['model'],_0x107332['query']);_0x13d131['attributes']=_[_0x9f56('0x45')](_0x107332['model'],qs[_0x9f56('0x47')](_0x31db8f[_0x9f56('0x43')][_0x9f56('0x47')]));_0x13d131[_0x9f56('0x46')]=_0x13d131['attributes']['length']?_0x13d131[_0x9f56('0x46')]:_0x107332['model'];if(_0x31db8f[_0x9f56('0x43')][_0x9f56('0x59')]){_0x13d131[_0x9f56('0x54')]=[{'all':!![]}];}_0x13d131=_[_0x9f56('0x51')]({},_0x13d131,_0x31db8f['options']);return db[_0x9f56('0x3e')][_0x9f56('0x5a')](_0x13d131)[_0x9f56('0x21')](handleEntityNotFound(_0x1f0d6d,null))[_0x9f56('0x21')](respondWithResult(_0x1f0d6d,null))[_0x9f56('0x2a')](handleError(_0x1f0d6d,null));};exports['create']=function(_0xc96f55,_0x5a9864){return db[_0x9f56('0x3e')][_0x9f56('0x5b')](_0xc96f55[_0x9f56('0x5c')],{})[_0x9f56('0x21')](respondWithResult(_0x5a9864,0xc9))['catch'](handleError(_0x5a9864,null));};exports[_0x9f56('0x38')]=function(_0x25249c,_0x44277a){if(_0x25249c[_0x9f56('0x5c')]['id']){delete _0x25249c[_0x9f56('0x5c')]['id'];}return db[_0x9f56('0x3e')][_0x9f56('0x5a')]({'where':{'id':_0x25249c[_0x9f56('0x58')]['id']}})[_0x9f56('0x21')](handleEntityNotFound(_0x44277a,null))[_0x9f56('0x21')](saveUpdates(_0x25249c[_0x9f56('0x5c')],null))[_0x9f56('0x21')](respondWithResult(_0x44277a,null))[_0x9f56('0x2a')](handleError(_0x44277a,null));};exports[_0x9f56('0x5d')]=function(_0x487e5b,_0x185e4c){return db['OpenchannelMessage'][_0x9f56('0x5a')]({'where':{'id':_0x487e5b[_0x9f56('0x58')]['id']}})[_0x9f56('0x21')](handleEntityNotFound(_0x185e4c,null))[_0x9f56('0x21')](removeEntity(_0x185e4c,null))[_0x9f56('0x2a')](handleError(_0x185e4c,null));};exports[_0x9f56('0x5e')]=function(_0x2d3c10,_0xbf90cc){return db['OpenchannelMessage'][_0x9f56('0x5e')]()[_0x9f56('0x21')](respondWithResult(_0xbf90cc,null))[_0x9f56('0x2a')](handleError(_0xbf90cc,null));};var interaction_log=require(_0x9f56('0x14'))('openchannel-interactions');exports['accept']=function(_0x4cfb84,_0x589592,_0x4fbdea){var _0x1890c2={'agent':{},'channel':_0x9f56('0x5f')};if(_0x4cfb84[_0x9f56('0x5c')]['id']){delete _0x4cfb84[_0x9f56('0x5c')]['id'];}_0x4cfb84[_0x9f56('0x5c')]['read']=!![];_0x4cfb84[_0x9f56('0x5c')][_0x9f56('0x60')]=moment()[_0x9f56('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x4cfb84['body']['UserId']=_0x4cfb84['body'][_0x9f56('0x62')]||_0x4cfb84[_0x9f56('0x63')]['id'];_0x1890c2[_0x9f56('0x64')]['id']=_0x4cfb84[_0x9f56('0x5c')]['UserId'];return db[_0x9f56('0x3e')][_0x9f56('0x5a')]({'where':{'id':_0x4cfb84['params']['id'],'UserId':null}})[_0x9f56('0x21')](handleEntityNotFound(_0x589592,null))['then'](saveUpdates(_0x4cfb84[_0x9f56('0x5c')],null))[_0x9f56('0x21')](function(_0x76c3a6){if(_0x76c3a6){_0x1890c2['message']=_0x76c3a6[_0x9f56('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x9f56('0x5a')]({'where':{'id':_0x76c3a6[_0x9f56('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x589592,null))[_0x9f56('0x21')](function(_0x3a807e){if(_0x3a807e){return _0x3a807e['update']({'UserId':_0x4cfb84['body'][_0x9f56('0x62')],'read1stAt':_[_0x9f56('0x67')](_0x3a807e['read1stAt'])?moment()[_0x9f56('0x61')](_0x9f56('0x68')):undefined});}return null;})[_0x9f56('0x21')](function(_0x41875e){if(_0x41875e){_0x1890c2['interaction']=_0x41875e[_0x9f56('0x65')]({'plain':!![]});interaction_log['info'](_0x9f56('0x69'),_0x4cfb84[_0x9f56('0x63')]['id'],_0x4cfb84[_0x9f56('0x63')]['name'],_0x4cfb84[_0x9f56('0x63')][_0x9f56('0x6a')],_0x1890c2[_0x9f56('0x6b')]['id'],_0x4cfb84['body']?JSON['stringify'](_0x4cfb84[_0x9f56('0x5c')]):_0x9f56('0x6c'));return respondWithRpcPromise(_0x9f56('0x6d'),'acceptMessage',_0x1890c2);}return null;})[_0x9f56('0x21')](function(_0x55f63d){var _0x54a6d9=_0x9f56('0x6e')+_0x55f63d[_0x9f56('0x28')]['ContactId'];return db[_0x9f56('0x6f')]['query'](_0x54a6d9,{'type':db[_0x9f56('0x70')]['QueryTypes'][_0x9f56('0x71')],'raw':!![]})[_0x9f56('0x21')](function(_0x4af038){return _0x4af038;});})['then'](function(_0x20a53f){if(_0x20a53f){_0x1890c2[_0x9f56('0x28')][_0x9f56('0x72')]=_0x20a53f[0x0];if(!_0x4cfb84[_0x9f56('0x5c')]['UserId'])return;return db['User'][_0x9f56('0x5a')]({'where':{'id':_0x4cfb84[_0x9f56('0x5c')][_0x9f56('0x62')],'role':_0x9f56('0x64')},'attributes':['id',_0x9f56('0x3a'),_0x9f56('0x73'),'email',_0x9f56('0x74')],'raw':!![]});}return null;})['then'](function(_0x694372){if(!_0x694372)return null;_0x1890c2[_0x9f56('0x28')]['agent']=_0x694372;return _0x1890c2;})['then'](function(_0xd6a919){if(_0xd6a919){if(_0x4cfb84[_0x9f56('0x5c')][_0x9f56('0x75')]){_0x1890c2[_0x9f56('0x28')][_0x9f56('0x76')]=util[_0x9f56('0x61')](_0x9f56('0x77'),_0x4cfb84[_0x9f56('0x63')][_0x9f56('0x3a')]);_0x1890c2[_0x9f56('0x28')]['channel']=_0x1890c2[_0x9f56('0x78')];_0x1890c2['message'][_0x9f56('0x79')]=_0x1890c2['channel'];_0x1890c2['message'][_0x9f56('0x7a')]=_0x9f56('0x7b');return respondWithRpcPromise(_0x9f56('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x1890c2['message']},client9002)['then'](function(){return _0x1890c2;});}return _0x1890c2;}return null;})['then'](respondWithResult(_0x589592,null))[_0x9f56('0x2a')](handleError(_0x589592,null));};var interaction_log=require(_0x9f56('0x14'))(_0x9f56('0x7d'));exports[_0x9f56('0x36')]=function(_0x3fe15f,_0x187ea2,_0x5cb8ca){var _0x22d79d={'agent':{},'channel':_0x9f56('0x5f')};if(_0x3fe15f[_0x9f56('0x5c')]['id']){delete _0x3fe15f[_0x9f56('0x5c')]['id'];}_0x3fe15f[_0x9f56('0x5c')][_0x9f56('0x62')]=_0x3fe15f[_0x9f56('0x5c')][_0x9f56('0x62')]||_0x3fe15f['user']['id'];_0x22d79d[_0x9f56('0x64')]['id']=_0x3fe15f[_0x9f56('0x5c')][_0x9f56('0x62')];return db[_0x9f56('0x3e')][_0x9f56('0x5a')]({'where':{'id':_0x3fe15f['params']['id'],'UserId':null}})[_0x9f56('0x21')](handleEntityNotFound(_0x187ea2,null))[_0x9f56('0x21')](function(_0x55b29f){if(_0x55b29f){_0x22d79d[_0x9f56('0x28')]=_0x55b29f[_0x9f56('0x65')]({'plain':!![]});return db[_0x9f56('0x7e')][_0x9f56('0x5a')]({'where':{'id':_0x55b29f['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x187ea2,null))[_0x9f56('0x21')](function(_0x26ed8e){if(_0x26ed8e){_0x22d79d[_0x9f56('0x6b')]=_0x26ed8e[_0x9f56('0x65')]({'plain':!![]});interaction_log[_0x9f56('0x22')](_0x9f56('0x7f'),_0x3fe15f[_0x9f56('0x63')]['id'],_0x3fe15f['user'][_0x9f56('0x3a')],_0x3fe15f[_0x9f56('0x63')]['role'],_0x22d79d[_0x9f56('0x6b')]['id'],_0x3fe15f[_0x9f56('0x5c')]?JSON['stringify'](_0x3fe15f[_0x9f56('0x5c')]):_0x9f56('0x6c'));return respondWithRpcPromise(_0x9f56('0x80'),'rejectMessage',_0x22d79d);}return null;})[_0x9f56('0x21')](function(_0x53f076){var _0x35082d=_0x9f56('0x6e')+_0x53f076[_0x9f56('0x28')][_0x9f56('0x81')];return db[_0x9f56('0x6f')][_0x9f56('0x43')](_0x35082d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x9f56('0x21')](function(_0x514d49){return _0x514d49;});})[_0x9f56('0x21')](function(_0x56017c){if(_0x56017c){_0x22d79d['message']['contact']=_0x56017c[0x0];if(!_0x3fe15f[_0x9f56('0x5c')]['UserId'])return;return db[_0x9f56('0x82')]['find']({'where':{'id':_0x3fe15f['body'][_0x9f56('0x62')],'role':'agent'},'attributes':['id','name',_0x9f56('0x73'),_0x9f56('0x83'),_0x9f56('0x74')],'raw':!![]});}return null;})[_0x9f56('0x21')](function(_0x50f41b){if(!_0x50f41b)return null;_0x22d79d[_0x9f56('0x28')][_0x9f56('0x64')]=_0x50f41b;return _0x22d79d;})[_0x9f56('0x21')](function(_0x1f26cd){if(_0x1f26cd){_0x1f26cd[_0x9f56('0x28')][_0x9f56('0x76')]=util[_0x9f56('0x61')](_0x9f56('0x77'),_0x3fe15f['user'][_0x9f56('0x3a')]);_0x1f26cd[_0x9f56('0x28')][_0x9f56('0x78')]=_0x22d79d[_0x9f56('0x78')];_0x1f26cd[_0x9f56('0x28')]['motionChannel']=_0x22d79d[_0x9f56('0x78')];_0x1f26cd[_0x9f56('0x28')][_0x9f56('0x7a')]=_0x9f56('0x36');respondWithRpcPromise('EventManager',_0x9f56('0x7c'),{'event':'rejectmessage','message':_0x1f26cd[_0x9f56('0x28')]},client9002);return _0x22d79d;}return null;})['then'](respondWithResult(_0x187ea2,null))['catch'](handleError(_0x187ea2,null));}; \ No newline at end of file +var _0x5da0=['hasOwnProperty','nolimit','sort','pick','filter','where','map','VIRTUAL','merge','options','includeAll','include','rows','params','length','find','create','body','destroy','describe','../../config/logger','openchannel-interactions','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','agent','email','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','fullname','internal','SIP/%s','rejectmessage','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','defaults','redis','socket.io-emitter','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','end','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5da0,0x1be));var _0x05da=function(_0x439a1c,_0x65a729){_0x439a1c=_0x439a1c-0x0;var _0x3185ef=_0x5da0[_0x439a1c];return _0x3185ef;};'use strict';var emlformat=require(_0x05da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05da('0x1'));var jsonpatch=require(_0x05da('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x05da('0x3'));var Mustache=require(_0x05da('0x4'));var util=require(_0x05da('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x05da('0x6'));var ejs=require(_0x05da('0x7'));var fs=require('fs');var fs_extra=require(_0x05da('0x8'));var _=require('lodash');var squel=require(_0x05da('0x9'));var crypto=require(_0x05da('0xa'));var jsforce=require(_0x05da('0xb'));var deskjs=require(_0x05da('0xc'));var toCsv=require(_0x05da('0x6'));var querystring=require(_0x05da('0xd'));var Papa=require(_0x05da('0xe'));var Redis=require(_0x05da('0xf'));var authService=require(_0x05da('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x05da('0x11'));var hardwareService=require(_0x05da('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x05da('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x05da('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x05da('0x15')](config[_0x05da('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x05da('0x17'))(new Redis(config[_0x05da('0x16')]));require('./openchannelMessage.socket')[_0x05da('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x05da('0x19')][_0x05da('0x1a')]({'port':0x232c});var client9002=jayson[_0x05da('0x19')][_0x05da('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4be144,_0x3cf9a0,_0x12cb21,_0x4c4944){return new BPromise(function(_0x4adcd0,_0xb5f26){var _0x590b65=_0x4c4944||client;return _0x590b65['request'](_0x4be144,_0x12cb21)[_0x05da('0x1b')](function(_0x19e6e1){logger[_0x05da('0x1c')](_0x05da('0x1d'),_0x3cf9a0,_0x05da('0x1e'));logger[_0x05da('0x1f')](_0x05da('0x20'),_0x3cf9a0,'request\x20sent',JSON['stringify'](_0x19e6e1));if(_0x19e6e1[_0x05da('0x21')]){if(_0x19e6e1[_0x05da('0x21')][_0x05da('0x22')]===0x1f4){logger[_0x05da('0x21')](_0x05da('0x1d'),_0x3cf9a0,_0x19e6e1['error'][_0x05da('0x23')]);return _0xb5f26(_0x19e6e1[_0x05da('0x21')]['message']);}logger[_0x05da('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x3cf9a0,_0x19e6e1['error'][_0x05da('0x23')]);return _0x4adcd0(_0x19e6e1[_0x05da('0x21')][_0x05da('0x23')]);}else{logger[_0x05da('0x1c')](_0x05da('0x1d'),_0x3cf9a0,_0x05da('0x1e'));_0x4adcd0(_0x19e6e1[_0x05da('0x24')][_0x05da('0x23')]);}})[_0x05da('0x25')](function(_0x1fd43d){logger[_0x05da('0x21')](_0x05da('0x1d'),_0x3cf9a0,_0x1fd43d);_0xb5f26(_0x1fd43d);});});}function respondWithStatusCode(_0x140ae7,_0x4ced0f){_0x4ced0f=_0x4ced0f||0xcc;return function(_0x3554be){if(_0x3554be){return _0x140ae7['sendStatus'](_0x4ced0f);}return _0x140ae7['status'](_0x4ced0f)['end']();};}function respondWithResult(_0x561e5f,_0x50bff1){_0x50bff1=_0x50bff1||0xc8;return function(_0x31342a){if(_0x31342a){return _0x561e5f[_0x05da('0x26')](_0x50bff1)[_0x05da('0x27')](_0x31342a);}};}function respondWithFilteredResult(_0x226f2b,_0x1d9cba){return function(_0x3b61e5){if(_0x3b61e5){var _0x7409ff=typeof _0x1d9cba['offset']===_0x05da('0x28')&&typeof _0x1d9cba[_0x05da('0x29')]===_0x05da('0x28');var _0x18dc93=_0x3b61e5[_0x05da('0x2a')];var _0xf8ccbc=_0x7409ff?0x0:_0x1d9cba['offset'];var _0x43a993=_0x7409ff?_0x3b61e5['count']:_0x1d9cba[_0x05da('0x2b')]+_0x1d9cba[_0x05da('0x29')];var _0x551688;if(_0x43a993>=_0x18dc93){_0x43a993=_0x18dc93;_0x551688=0xc8;}else{_0x551688=0xce;}_0x226f2b['status'](_0x551688);return _0x226f2b[_0x05da('0x2c')](_0x05da('0x2d'),_0xf8ccbc+'-'+_0x43a993+'/'+_0x18dc93)[_0x05da('0x27')](_0x3b61e5);}return null;};}function patchUpdates(_0x1f39c5){return function(_0x3b0ae8){try{jsonpatch[_0x05da('0x2e')](_0x3b0ae8,_0x1f39c5,!![]);}catch(_0x2ca9d5){return BPromise[_0x05da('0x2f')](_0x2ca9d5);}return _0x3b0ae8['save']();};}function saveUpdates(_0x4b3f1d,_0x10e685){return function(_0x3eafdb){if(_0x3eafdb){return _0x3eafdb[_0x05da('0x30')](_0x4b3f1d)['then'](function(_0x3dabd5){return _0x3dabd5;});}return null;};}function removeEntity(_0x580e4c,_0x3aa171){return function(_0xdf238){if(_0xdf238){return _0xdf238['destroy']()[_0x05da('0x1b')](function(){_0x580e4c['status'](0xcc)[_0x05da('0x31')]();});}};}function handleEntityNotFound(_0x2c89ae,_0x33e1dc){return function(_0x577889){if(!_0x577889){_0x2c89ae['sendStatus'](0x194);}return _0x577889;};}function handleError(_0x5a15c6,_0x220332){_0x220332=_0x220332||0x1f4;return function(_0x411b75){logger['error'](_0x411b75[_0x05da('0x32')]);if(_0x411b75[_0x05da('0x33')]){delete _0x411b75[_0x05da('0x33')];}_0x5a15c6['status'](_0x220332)[_0x05da('0x34')](_0x411b75);};}exports[_0x05da('0x35')]=function(_0x2d0731,_0x3046b7){var _0x381827={},_0x157d57={},_0x2fac1c={'count':0x0,'rows':[]};var _0x5d4871=_['map'](db[_0x05da('0x36')][_0x05da('0x37')],function(_0x275a08){return{'name':_0x275a08[_0x05da('0x38')],'type':_0x275a08[_0x05da('0x39')][_0x05da('0x3a')]};});_0x157d57[_0x05da('0x3b')]=_['map'](_0x5d4871,'name');_0x157d57['query']=_[_0x05da('0x3c')](_0x2d0731[_0x05da('0x3d')]);_0x157d57[_0x05da('0x3e')]=_[_0x05da('0x3f')](_0x157d57['model'],_0x157d57[_0x05da('0x3d')]);_0x381827[_0x05da('0x40')]=_['intersection'](_0x157d57[_0x05da('0x3b')],qs['fields'](_0x2d0731[_0x05da('0x3d')][_0x05da('0x41')]));_0x381827[_0x05da('0x40')]=_0x381827[_0x05da('0x40')]['length']?_0x381827[_0x05da('0x40')]:_0x157d57['model'];if(!_0x2d0731[_0x05da('0x3d')][_0x05da('0x42')](_0x05da('0x43'))){_0x381827[_0x05da('0x29')]=qs[_0x05da('0x29')](_0x2d0731[_0x05da('0x3d')][_0x05da('0x29')]);_0x381827[_0x05da('0x2b')]=qs['offset'](_0x2d0731['query'][_0x05da('0x2b')]);}_0x381827['order']=qs['sort'](_0x2d0731[_0x05da('0x3d')][_0x05da('0x44')]);_0x381827['where']=qs['filters'](_[_0x05da('0x45')](_0x2d0731['query'],_0x157d57[_0x05da('0x3e')]),_0x5d4871);if(_0x2d0731[_0x05da('0x3d')][_0x05da('0x46')]){_0x381827['where']=_['merge'](_0x381827[_0x05da('0x47')],{'$or':_[_0x05da('0x48')](_0x5d4871,function(_0x3bf25d){if(_0x3bf25d[_0x05da('0x39')]!==_0x05da('0x49')){var _0x23bc21={};_0x23bc21[_0x3bf25d[_0x05da('0x33')]]={'$like':'%'+_0x2d0731[_0x05da('0x3d')]['filter']+'%'};return _0x23bc21;}})});}_0x381827=_[_0x05da('0x4a')]({},_0x381827,_0x2d0731[_0x05da('0x4b')]);var _0x1c62d2={'where':_0x381827[_0x05da('0x47')]};return db['OpenchannelMessage'][_0x05da('0x2a')](_0x1c62d2)[_0x05da('0x1b')](function(_0x24238a){_0x2fac1c[_0x05da('0x2a')]=_0x24238a;if(_0x2d0731[_0x05da('0x3d')][_0x05da('0x4c')]){_0x381827[_0x05da('0x4d')]=[{'all':!![]}];}return db[_0x05da('0x36')]['findAll'](_0x381827);})[_0x05da('0x1b')](function(_0x1ea733){_0x2fac1c[_0x05da('0x4e')]=_0x1ea733;return _0x2fac1c;})[_0x05da('0x1b')](respondWithFilteredResult(_0x3046b7,_0x381827))['catch'](handleError(_0x3046b7,null));};exports['show']=function(_0x46f4e2,_0x7d56e7){var _0x425039={'raw':!![],'where':{'id':_0x46f4e2[_0x05da('0x4f')]['id']}},_0x3d8922={};_0x3d8922[_0x05da('0x3b')]=_[_0x05da('0x3c')](db[_0x05da('0x36')]['rawAttributes']);_0x3d8922[_0x05da('0x3d')]=_[_0x05da('0x3c')](_0x46f4e2[_0x05da('0x3d')]);_0x3d8922[_0x05da('0x3e')]=_[_0x05da('0x3f')](_0x3d8922[_0x05da('0x3b')],_0x3d8922[_0x05da('0x3d')]);_0x425039[_0x05da('0x40')]=_[_0x05da('0x3f')](_0x3d8922[_0x05da('0x3b')],qs['fields'](_0x46f4e2[_0x05da('0x3d')][_0x05da('0x41')]));_0x425039[_0x05da('0x40')]=_0x425039['attributes'][_0x05da('0x50')]?_0x425039[_0x05da('0x40')]:_0x3d8922[_0x05da('0x3b')];if(_0x46f4e2[_0x05da('0x3d')][_0x05da('0x4c')]){_0x425039[_0x05da('0x4d')]=[{'all':!![]}];}_0x425039=_['merge']({},_0x425039,_0x46f4e2['options']);return db[_0x05da('0x36')][_0x05da('0x51')](_0x425039)['then'](handleEntityNotFound(_0x7d56e7,null))[_0x05da('0x1b')](respondWithResult(_0x7d56e7,null))[_0x05da('0x25')](handleError(_0x7d56e7,null));};exports[_0x05da('0x52')]=function(_0x4d33dc,_0x834759){return db['OpenchannelMessage']['create'](_0x4d33dc[_0x05da('0x53')],{})[_0x05da('0x1b')](respondWithResult(_0x834759,0xc9))[_0x05da('0x25')](handleError(_0x834759,null));};exports[_0x05da('0x30')]=function(_0x146310,_0x3bce9a){if(_0x146310[_0x05da('0x53')]['id']){delete _0x146310[_0x05da('0x53')]['id'];}return db[_0x05da('0x36')]['find']({'where':{'id':_0x146310[_0x05da('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3bce9a,null))['then'](saveUpdates(_0x146310['body'],null))[_0x05da('0x1b')](respondWithResult(_0x3bce9a,null))[_0x05da('0x25')](handleError(_0x3bce9a,null));};exports[_0x05da('0x54')]=function(_0x31ca4e,_0x44be95){return db[_0x05da('0x36')][_0x05da('0x51')]({'where':{'id':_0x31ca4e['params']['id']}})['then'](handleEntityNotFound(_0x44be95,null))['then'](removeEntity(_0x44be95,null))[_0x05da('0x25')](handleError(_0x44be95,null));};exports['describe']=function(_0x125ba8,_0x11efb3){return db['OpenchannelMessage'][_0x05da('0x55')]()[_0x05da('0x1b')](respondWithResult(_0x11efb3,null))[_0x05da('0x25')](handleError(_0x11efb3,null));};var interaction_log=require(_0x05da('0x56'))(_0x05da('0x57'));exports['accept']=function(_0x145239,_0x2ee47e,_0x143af9){var _0x5a5187={'agent':{},'channel':_0x05da('0x58')};if(_0x145239[_0x05da('0x53')]['id']){delete _0x145239[_0x05da('0x53')]['id'];}_0x145239[_0x05da('0x53')][_0x05da('0x59')]=!![];_0x145239[_0x05da('0x53')][_0x05da('0x5a')]=moment()['format'](_0x05da('0x5b'));_0x145239[_0x05da('0x53')][_0x05da('0x5c')]=_0x145239[_0x05da('0x53')][_0x05da('0x5c')]||_0x145239[_0x05da('0x5d')]['id'];_0x5a5187['agent']['id']=_0x145239[_0x05da('0x53')]['UserId'];return db[_0x05da('0x36')][_0x05da('0x51')]({'where':{'id':_0x145239[_0x05da('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ee47e,null))[_0x05da('0x1b')](saveUpdates(_0x145239[_0x05da('0x53')],null))['then'](function(_0x154ec9){if(_0x154ec9){_0x5a5187[_0x05da('0x23')]=_0x154ec9[_0x05da('0x5e')]({'plain':!![]});return db[_0x05da('0x5f')][_0x05da('0x51')]({'where':{'id':_0x154ec9[_0x05da('0x60')]}});}return null;})[_0x05da('0x1b')](handleEntityNotFound(_0x2ee47e,null))[_0x05da('0x1b')](function(_0x43bb22){if(_0x43bb22){return _0x43bb22[_0x05da('0x30')]({'UserId':_0x145239[_0x05da('0x53')][_0x05da('0x5c')],'read1stAt':_[_0x05da('0x61')](_0x43bb22[_0x05da('0x62')])?moment()[_0x05da('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x05da('0x1b')](function(_0x3e9c73){if(_0x3e9c73){_0x5a5187[_0x05da('0x64')]=_0x3e9c73[_0x05da('0x5e')]({'plain':!![]});interaction_log['info'](_0x05da('0x65'),_0x145239[_0x05da('0x5d')]['id'],_0x145239['user']['name'],_0x145239[_0x05da('0x5d')][_0x05da('0x66')],_0x5a5187[_0x05da('0x64')]['id'],_0x145239[_0x05da('0x53')]?JSON[_0x05da('0x67')](_0x145239[_0x05da('0x53')]):_0x05da('0x68'));return respondWithRpcPromise(_0x05da('0x69'),_0x05da('0x6a'),_0x5a5187);}return null;})[_0x05da('0x1b')](function(_0x4f4cd7){var _0x4b81c0=_0x05da('0x6b')+_0x4f4cd7[_0x05da('0x23')][_0x05da('0x6c')];return db[_0x05da('0x6d')][_0x05da('0x3d')](_0x4b81c0,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x05da('0x1b')](function(_0x36196c){return _0x36196c;});})['then'](function(_0x21ab0f){if(_0x21ab0f){_0x5a5187[_0x05da('0x23')][_0x05da('0x6e')]=_0x21ab0f[0x0];if(!_0x145239['body']['UserId'])return;return db[_0x05da('0x6f')][_0x05da('0x51')]({'where':{'id':_0x145239[_0x05da('0x53')][_0x05da('0x5c')],'role':_0x05da('0x70')},'attributes':['id',_0x05da('0x33'),'fullname',_0x05da('0x71'),'internal'],'raw':!![]});}return null;})[_0x05da('0x1b')](function(_0x3763f6){if(!_0x3763f6)return null;_0x5a5187[_0x05da('0x23')][_0x05da('0x70')]=_0x3763f6;return _0x5a5187;})['then'](function(_0x31b6a5){if(_0x31b6a5){if(_0x145239['body']['manual']){_0x5a5187[_0x05da('0x23')]['interface']=util[_0x05da('0x63')]('SIP/%s',_0x145239[_0x05da('0x5d')]['name']);_0x5a5187[_0x05da('0x23')]['channel']=_0x5a5187[_0x05da('0x72')];_0x5a5187['message'][_0x05da('0x73')]=_0x5a5187[_0x05da('0x72')];_0x5a5187[_0x05da('0x23')][_0x05da('0x74')]=_0x05da('0x75');return respondWithRpcPromise(_0x05da('0x76'),'EventManager',{'event':_0x05da('0x77'),'message':_0x5a5187['message']},client9002)[_0x05da('0x1b')](function(){return _0x5a5187;});}return _0x5a5187;}return null;})[_0x05da('0x1b')](respondWithResult(_0x2ee47e,null))[_0x05da('0x25')](handleError(_0x2ee47e,null));};var interaction_log=require(_0x05da('0x56'))(_0x05da('0x57'));exports[_0x05da('0x2f')]=function(_0x1ddba6,_0x292105,_0x4896d3){var _0x26ff76={'agent':{},'channel':'openchannel'};if(_0x1ddba6[_0x05da('0x53')]['id']){delete _0x1ddba6[_0x05da('0x53')]['id'];}_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')]=_0x1ddba6['body'][_0x05da('0x5c')]||_0x1ddba6['user']['id'];_0x26ff76['agent']['id']=_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')];return db[_0x05da('0x36')]['find']({'where':{'id':_0x1ddba6[_0x05da('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x292105,null))[_0x05da('0x1b')](function(_0x207f30){if(_0x207f30){_0x26ff76[_0x05da('0x23')]=_0x207f30[_0x05da('0x5e')]({'plain':!![]});return db[_0x05da('0x5f')]['find']({'where':{'id':_0x207f30[_0x05da('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x292105,null))[_0x05da('0x1b')](function(_0x29f8c0){if(_0x29f8c0){_0x26ff76['interaction']=_0x29f8c0['get']({'plain':!![]});interaction_log[_0x05da('0x1c')](_0x05da('0x78'),_0x1ddba6[_0x05da('0x5d')]['id'],_0x1ddba6[_0x05da('0x5d')][_0x05da('0x33')],_0x1ddba6[_0x05da('0x5d')][_0x05da('0x66')],_0x26ff76[_0x05da('0x64')]['id'],_0x1ddba6[_0x05da('0x53')]?JSON[_0x05da('0x67')](_0x1ddba6[_0x05da('0x53')]):'null');return respondWithRpcPromise(_0x05da('0x79'),_0x05da('0x7a'),_0x26ff76);}return null;})[_0x05da('0x1b')](function(_0x5129a2){var _0x5b25df=_0x05da('0x6b')+_0x5129a2[_0x05da('0x23')][_0x05da('0x6c')];return db[_0x05da('0x6d')][_0x05da('0x3d')](_0x5b25df,{'type':db['Sequelize']['QueryTypes'][_0x05da('0x7b')],'raw':!![]})['then'](function(_0x4109b7){return _0x4109b7;});})[_0x05da('0x1b')](function(_0x43fa75){if(_0x43fa75){_0x26ff76[_0x05da('0x23')][_0x05da('0x6e')]=_0x43fa75[0x0];if(!_0x1ddba6[_0x05da('0x53')]['UserId'])return;return db['User'][_0x05da('0x51')]({'where':{'id':_0x1ddba6[_0x05da('0x53')][_0x05da('0x5c')],'role':'agent'},'attributes':['id',_0x05da('0x33'),_0x05da('0x7c'),'email',_0x05da('0x7d')],'raw':!![]});}return null;})[_0x05da('0x1b')](function(_0x168f64){if(!_0x168f64)return null;_0x26ff76[_0x05da('0x23')][_0x05da('0x70')]=_0x168f64;return _0x26ff76;})['then'](function(_0x5c0ce5){if(_0x5c0ce5){_0x5c0ce5['message']['interface']=util['format'](_0x05da('0x7e'),_0x1ddba6[_0x05da('0x5d')][_0x05da('0x33')]);_0x5c0ce5['message'][_0x05da('0x72')]=_0x26ff76[_0x05da('0x72')];_0x5c0ce5[_0x05da('0x23')]['motionChannel']=_0x26ff76[_0x05da('0x72')];_0x5c0ce5['message'][_0x05da('0x74')]=_0x05da('0x2f');respondWithRpcPromise(_0x05da('0x76'),_0x05da('0x76'),{'event':_0x05da('0x7f'),'message':_0x5c0ce5[_0x05da('0x23')]},client9002);return _0x26ff76;}return null;})['then'](respondWithResult(_0x292105,null))[_0x05da('0x25')](handleError(_0x292105,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fdb4150..63a3abd 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 _0x227b=['save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xa02057,_0xa65785){var _0x46a3e3=function(_0x5cd464){while(--_0x5cd464){_0xa02057['push'](_0xa02057['shift']());}};_0x46a3e3(++_0xa65785);}(_0x227b,0x16f));var _0xb227=function(_0x2c38d6,_0x3d3a69){_0x2c38d6=_0x2c38d6-0x0;var _0x1c8e58=_0x227b[_0x2c38d6];return _0x1c8e58;};'use strict';var EventEmitter=require(_0xb227('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb227('0x1'),'afterUpdate':_0xb227('0x2'),'afterDestroy':_0xb227('0x3')};function emitEvent(_0x175a88){return function(_0x2a9b7f,_0x5b2925,_0x17936b){OpenchannelMessageEvents[_0xb227('0x4')](_0x175a88+':'+_0x2a9b7f['id'],_0x2a9b7f);OpenchannelMessageEvents['emit'](_0x175a88,_0x2a9b7f);_0x17936b(null);};}for(var e in events){if(events[_0xb227('0x5')](e)){var event=events[e];OpenchannelMessage[_0xb227('0x6')](e,emitEvent(event));}}module[_0xb227('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x4309=['hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x25d860,_0xdd59a6){var _0xa93a30=function(_0xe0ed86){while(--_0xe0ed86){_0x25d860['push'](_0x25d860['shift']());}};_0xa93a30(++_0xdd59a6);}(_0x4309,0x70));var _0x9430=function(_0x45b4a8,_0x413531){_0x45b4a8=_0x45b4a8-0x0;var _0x1b8265=_0x4309[_0x45b4a8];return _0x1b8265;};'use strict';var EventEmitter=require(_0x9430('0x0'));var OpenchannelMessage=require(_0x9430('0x1'))['db'][_0x9430('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9430('0x3')](0x0);var events={'afterCreate':_0x9430('0x4'),'afterUpdate':_0x9430('0x5'),'afterDestroy':_0x9430('0x6')};function emitEvent(_0x50ebd6){return function(_0x156226,_0x5f549c,_0x4e65e8){OpenchannelMessageEvents['emit'](_0x50ebd6+':'+_0x156226['id'],_0x156226);OpenchannelMessageEvents[_0x9430('0x7')](_0x50ebd6,_0x156226);_0x4e65e8(null);};}for(var e in events){if(events[_0x9430('0x8')](e)){var event=events[e];OpenchannelMessage[_0x9430('0x9')](e,emitEvent(event));}}module[_0x9430('0xa')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index edcde37..caec69b 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 _0x832a=['error','inspect','finally','utf8mb4','../../config/logger','api','moment','bluebird','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','direction','toLowerCase','out','secret','UserId','findOne','OpenchannelInteractionId','update','createdAt','CmContact','describe','then','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch'];(function(_0x17188b,_0x857a6d){var _0x19e980=function(_0x235fe4){while(--_0x235fe4){_0x17188b['push'](_0x17188b['shift']());}};_0x19e980(++_0x857a6d);}(_0x832a,0x18c));var _0xa832=function(_0xb03c3,_0x46c612){_0xb03c3=_0xb03c3-0x0;var _0x21501f=_0x832a[_0xb03c3];return _0x21501f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa832('0x0'))(_0xa832('0x1'));var moment=require(_0xa832('0x2'));var BPromise=require(_0xa832('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa832('0x4'));var config=require('../../config/environment');var attributes=require(_0xa832('0x5'));module[_0xa832('0x6')]=function(_0x17f2df,_0x27b3e3){return _0x17f2df[_0xa832('0x7')](_0xa832('0x8'),attributes,{'tableName':_0xa832('0x9'),'paranoid':![],'indexes':[{'name':_0xa832('0xa'),'fields':[_0xa832('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xd24b98,_0x3ba69c,_0x1bbbd3){var _0x398b6f=_0x17f2df[_0xa832('0xc')];var _0x316871=_0xd24b98['get']({'plain':!![]});if(_0x316871[_0xa832('0xd')]['toLowerCase']()==='in'||_0x316871[_0xa832('0xd')][_0xa832('0xe')]()===_0xa832('0xf')&&!_0x316871[_0xa832('0x10')]&&!_['isNil'](_0x316871[_0xa832('0x11')])){_0x398b6f['OpenchannelInteraction'][_0xa832('0x12')]({'where':{'id':_0x316871[_0xa832('0x13')]}})['then'](function(_0x4fb314){if(_0x4fb314){_0x4fb314[_0xa832('0x14')]({'lastMsgAt':_0x316871[_0xa832('0x15')],'lastMsgDirection':_0x316871[_0xa832('0xd')]['toLowerCase']()});}})['catch'](function(_0x24afe1){console['error'](_0x24afe1);});}if(_0x316871[_0xa832('0xd')]===_0xa832('0xf')&&!_0x316871['secret']){var _0xf38073;_0x398b6f[_0xa832('0x16')][_0xa832('0x17')]()[_0xa832('0x18')](function(_0x126169){return _0x398b6f['OpenchannelAccount'][_0xa832('0x19')]({'where':{'id':_0x316871[_0xa832('0x1a')]},'include':[{'model':_0x398b6f[_0xa832('0x1b')],'as':_0xa832('0x1c'),'where':{'id':_0x316871[_0xa832('0x13')]},'limit':0x1,'include':[{'model':_0x398b6f[_0xa832('0x16')],'as':_0xa832('0x1d'),'attributes':_['keys'](_0x126169)}]}]});})[_0xa832('0x18')](function(_0x5ece23){_0xf38073=_0x5ece23[_0xa832('0x1e')]({'plain':!![]});if(_0xf38073&&_0xf38073[_0xa832('0x1f')]){logger[_0xa832('0x20')](_0xa832('0x21'),_0xa832('0x22'),util[_0xa832('0x23')](_0xa832('0x24'),_0x316871['id'],_0xf38073['replyUri']));if(_0xf38073[_0xa832('0x1c')]&&_0xf38073[_0xa832('0x1c')][_0xa832('0x25')]){_0x316871[_0xa832('0x26')]=_[_0xa832('0x27')](_0xf38073[_0xa832('0x1c')][0x0],_0xa832('0x1d'));_0x316871[_0xa832('0x1d')]=_0xf38073[_0xa832('0x1c')][0x0][_0xa832('0x1d')];}var _0x3ba69c={'method':'POST','uri':encodeURI(_0xf38073['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3ba69c[_0xa832('0x28')]){case _0xa832('0x29'):_0x3ba69c['qs']=_0x316871;break;case'POST':_0x3ba69c['body']=_0x316871;break;}return rp(_0x3ba69c)[_0xa832('0x18')](function(_0xcef22e){logger[_0xa832('0x20')](_0xa832('0x21'),_0xa832('0x22'),util['format'](_0xa832('0x2a'),_0x316871['id'],_0xf38073[_0xa832('0x1f')]));if(_0xcef22e['body'][_0xa832('0x2b')]&&_0xcef22e[_0xa832('0xb')]['threadId']!=_0x316871[_0xa832('0x26')][_0xa832('0x2b')]){return _0x398b6f[_0xa832('0x1b')][_0xa832('0x14')]({'threadId':_0xcef22e[_0xa832('0xb')][_0xa832('0x2b')]},{'where':{'id':_0x316871[_0xa832('0x26')]['id']}});}else{return;}})[_0xa832('0x18')](function(){return _0xd24b98[_0xa832('0x14')]({'read':!![]});})[_0xa832('0x2c')](function(_0x4d559b){logger[_0xa832('0x2d')](_0xa832('0x21'),_0xa832('0x22'),util[_0xa832('0x2e')](_0x4d559b,{'showHidden':![],'depth':null}));_0x1bbbd3();});}else{_0x1bbbd3();}})[_0xa832('0x2f')](function(){_0x1bbbd3();});}else{_0x1bbbd3();}}},'charset':_0xa832('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x92b0=['Interaction','omit','Contact','method','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird','path','../../config/environment','exports','define','fti_openchannel_messages','FULLTEXT','models','get','direction','out','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','secret','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length'];(function(_0x4b7798,_0x4a3be7){var _0x5c71ca=function(_0x495581){while(--_0x495581){_0x4b7798['push'](_0x4b7798['shift']());}};_0x5c71ca(++_0x4a3be7);}(_0x92b0,0x12b));var _0x092b=function(_0x42f9a6,_0x3d6739){_0x42f9a6=_0x42f9a6-0x0;var _0x39e97b=_0x92b0[_0x42f9a6];return _0x39e97b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x092b('0x0'));var moment=require(_0x092b('0x1'));var BPromise=require(_0x092b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x092b('0x3'));var rimraf=require('rimraf');var config=require(_0x092b('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0x092b('0x5')]=function(_0x4327f7,_0x1ec86f){return _0x4327f7[_0x092b('0x6')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x092b('0x7'),'fields':['body'],'type':_0x092b('0x8')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x13d9cd,_0x1e3366,_0x2ba73d){var _0x1266e1=_0x4327f7[_0x092b('0x9')];var _0x57ca60=_0x13d9cd[_0x092b('0xa')]({'plain':!![]});if(_0x57ca60[_0x092b('0xb')]['toLowerCase']()==='in'||_0x57ca60['direction']['toLowerCase']()===_0x092b('0xc')&&!_0x57ca60['secret']&&!_[_0x092b('0xd')](_0x57ca60[_0x092b('0xe')])){_0x1266e1['OpenchannelInteraction'][_0x092b('0xf')]({'where':{'id':_0x57ca60[_0x092b('0x10')]}})[_0x092b('0x11')](function(_0x17de52){if(_0x17de52){_0x17de52[_0x092b('0x12')]({'lastMsgAt':_0x57ca60[_0x092b('0x13')],'lastMsgDirection':_0x57ca60[_0x092b('0xb')][_0x092b('0x14')]()});}})[_0x092b('0x15')](function(_0x3c66aa){console[_0x092b('0x16')](_0x3c66aa);});}if(_0x57ca60['direction']===_0x092b('0xc')&&!_0x57ca60[_0x092b('0x17')]){var _0x88a0f5;_0x1266e1[_0x092b('0x18')][_0x092b('0x19')]()[_0x092b('0x11')](function(_0x2521da){return _0x1266e1[_0x092b('0x1a')]['find']({'where':{'id':_0x57ca60[_0x092b('0x1b')]},'include':[{'model':_0x1266e1['OpenchannelInteraction'],'as':_0x092b('0x1c'),'where':{'id':_0x57ca60['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x1266e1[_0x092b('0x18')],'as':'Contact','attributes':_[_0x092b('0x1d')](_0x2521da)}]}]});})[_0x092b('0x11')](function(_0x2ec468){_0x88a0f5=_0x2ec468[_0x092b('0xa')]({'plain':!![]});if(_0x88a0f5&&_0x88a0f5[_0x092b('0x1e')]){logger[_0x092b('0x1f')](_0x092b('0x20'),_0x092b('0x21'),util[_0x092b('0x22')](_0x092b('0x23'),_0x57ca60['id'],_0x88a0f5[_0x092b('0x1e')]));if(_0x88a0f5[_0x092b('0x1c')]&&_0x88a0f5['Interactions'][_0x092b('0x24')]){_0x57ca60[_0x092b('0x25')]=_[_0x092b('0x26')](_0x88a0f5[_0x092b('0x1c')][0x0],'Contact');_0x57ca60[_0x092b('0x27')]=_0x88a0f5[_0x092b('0x1c')][0x0][_0x092b('0x27')];}var _0x1e3366={'method':'POST','uri':encodeURI(_0x88a0f5[_0x092b('0x1e')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1e3366[_0x092b('0x28')]){case _0x092b('0x29'):_0x1e3366['qs']=_0x57ca60;break;case'POST':_0x1e3366[_0x092b('0x2a')]=_0x57ca60;break;}return rp(_0x1e3366)['then'](function(_0x114124){logger['info'](_0x092b('0x20'),_0x092b('0x21'),util[_0x092b('0x22')](_0x092b('0x2b'),_0x57ca60['id'],_0x88a0f5[_0x092b('0x1e')]));if(_0x114124['body']['threadId']&&_0x114124['body'][_0x092b('0x2c')]!=_0x57ca60[_0x092b('0x25')][_0x092b('0x2c')]){return _0x1266e1[_0x092b('0x2d')][_0x092b('0x12')]({'threadId':_0x114124[_0x092b('0x2a')]['threadId']},{'where':{'id':_0x57ca60['Interaction']['id']}});}else{return;}})[_0x092b('0x11')](function(){return _0x13d9cd[_0x092b('0x12')]({'read':!![]});})[_0x092b('0x15')](function(_0xf05e72){logger[_0x092b('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x092b('0x21'),util['inspect'](_0xf05e72,{'showHidden':![],'depth':null}));_0x2ba73d();});}else{_0x2ba73d();}})['finally'](function(){_0x2ba73d();});}else{_0x2ba73d();}}},'charset':_0x092b('0x2e'),'collate':_0x092b('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index eaccc1f..055162e 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x211770,_0x24df4){var _0x3c0dc6=function(_0x186986){while(--_0x186986){_0x211770['push'](_0x211770['shift']());}};_0x3c0dc6(++_0x24df4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0x0b0e[_0x623e7];return _0x121131;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x386342,_0x20b499){var _0x5963e9=function(_0x23de24){while(--_0x23de24){_0x386342['push'](_0x386342['shift']());}};_0x5963e9(++_0x20b499);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10e80a,_0x37bc49){_0x10e80a=_0x10e80a-0x0;var _0xc600ee=_0x5f2f[_0x10e80a];return _0xc600ee;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 2cfe47d..fb9e976 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 _0x21a0=['removeListener','register','save','remove','emit'];(function(_0x4cc257,_0x556a80){var _0x136f37=function(_0x237670){while(--_0x237670){_0x4cc257['push'](_0x4cc257['shift']());}};_0x136f37(++_0x556a80);}(_0x21a0,0x10b));var _0x021a=function(_0xd67d54,_0x2f769a){_0xd67d54=_0xd67d54-0x0;var _0x256097=_0x21a0[_0xd67d54];return _0x256097;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x021a('0x0'),_0x021a('0x1'),'update'];function createListener(_0x5f1634,_0x5be291){return function(_0x58db65){_0x5be291[_0x021a('0x2')](_0x5f1634,_0x58db65);};}function removeListener(_0x52b89d,_0x2ed83d){return function(){OpenchannelMessageEvents[_0x021a('0x3')](_0x52b89d,_0x2ed83d);};}exports[_0x021a('0x4')]=function(_0x49f95c){for(var _0x378771=0x0,_0x4b0f31=events['length'];_0x378771<_0x4b0f31;_0x378771++){var _0x595fbe=events[_0x378771];var _0x173e4d=createListener('openchannelMessage:'+_0x595fbe,_0x49f95c);OpenchannelMessageEvents['on'](_0x595fbe,_0x173e4d);}}; \ No newline at end of file +var _0x5581=['emit','removeListener','length','openchannelMessage:','./openchannelMessage.events','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5581,0x115));var _0x1558=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x5581[_0x9c2427];return _0x51984f;};'use strict';var OpenchannelMessageEvents=require(_0x1558('0x0'));var events=['save',_0x1558('0x1'),_0x1558('0x2')];function createListener(_0x24a5be,_0x3d5727){return function(_0x1e903f){_0x3d5727[_0x1558('0x3')](_0x24a5be,_0x1e903f);};}function removeListener(_0x48c6fa,_0x113434){return function(){OpenchannelMessageEvents[_0x1558('0x4')](_0x48c6fa,_0x113434);};}exports['register']=function(_0x24c333){for(var _0xcaef09=0x0,_0x5043c0=events[_0x1558('0x5')];_0xcaef09<_0x5043c0;_0xcaef09++){var _0x15c3f2=events[_0xcaef09];var _0x10082c=createListener(_0x1558('0x6')+_0x15c3f2,_0x24c333);OpenchannelMessageEvents['on'](_0x15c3f2,_0x10082c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index f3198ba..0db0c26 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 _0x70be=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x70be,0x78));var _0xe70b=function(_0x4b100c,_0x5cf456){_0x4b100c=_0x4b100c-0x0;var _0x2249c9=_0x70be[_0x4b100c];return _0x2249c9;};'use strict';var multer=require(_0xe70b('0x0'));var util=require(_0xe70b('0x1'));var path=require(_0xe70b('0x2'));var timeout=require(_0xe70b('0x3'));var express=require(_0xe70b('0x4'));var router=express[_0xe70b('0x5')]();var fs_extra=require(_0xe70b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe70b('0x7'));var config=require(_0xe70b('0x8'));var controller=require(_0xe70b('0x9'));router[_0xe70b('0xa')]('/',auth[_0xe70b('0xb')](),controller[_0xe70b('0xc')]);router[_0xe70b('0xa')](_0xe70b('0xd'),auth['isAuthenticated'](),controller[_0xe70b('0xe')]);router[_0xe70b('0xa')](_0xe70b('0xf'),auth[_0xe70b('0xb')](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0xe70b('0x10')]);router[_0xe70b('0xa')](_0xe70b('0x11'),auth['isAuthenticated'](),controller[_0xe70b('0x12')]);router[_0xe70b('0xa')](_0xe70b('0x13'),auth[_0xe70b('0xb')](),controller[_0xe70b('0x14')]);router[_0xe70b('0x15')]('/',auth[_0xe70b('0xb')](),controller[_0xe70b('0x16')]);router['post'](_0xe70b('0x11'),auth[_0xe70b('0xb')](),controller[_0xe70b('0x17')]);router['post'](_0xe70b('0x13'),auth[_0xe70b('0xb')](),controller['addAgents']);router[_0xe70b('0x18')]('/:id',auth[_0xe70b('0xb')](),controller['update']);router[_0xe70b('0x19')](_0xe70b('0xf'),auth['isAuthenticated'](),controller[_0xe70b('0x1a')]);router['delete'](_0xe70b('0x11'),auth[_0xe70b('0xb')](),controller[_0xe70b('0x1b')]);router[_0xe70b('0x19')](_0xe70b('0x13'),auth[_0xe70b('0xb')](),controller[_0xe70b('0x1c')]);module[_0xe70b('0x1d')]=router; \ No newline at end of file +var _0x2a48=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','delete','removeTeams','removeAgents','exports','multer'];(function(_0x535eaa,_0x3a0d06){var _0x4fb3b7=function(_0x2eb86f){while(--_0x2eb86f){_0x535eaa['push'](_0x535eaa['shift']());}};_0x4fb3b7(++_0x3a0d06);}(_0x2a48,0x133));var _0x82a4=function(_0xd7527f,_0x1a10d2){_0xd7527f=_0xd7527f-0x0;var _0x4d3788=_0x2a48[_0xd7527f];return _0x4d3788;};'use strict';var multer=require(_0x82a4('0x0'));var util=require(_0x82a4('0x1'));var path=require(_0x82a4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x82a4('0x3')]();var fs_extra=require(_0x82a4('0x4'));var auth=require(_0x82a4('0x5'));var interaction=require(_0x82a4('0x6'));var config=require(_0x82a4('0x7'));var controller=require(_0x82a4('0x8'));router['get']('/',auth[_0x82a4('0x9')](),controller['index']);router[_0x82a4('0xa')](_0x82a4('0xb'),auth['isAuthenticated'](),controller[_0x82a4('0xc')]);router['get'](_0x82a4('0xd'),auth[_0x82a4('0x9')](),controller[_0x82a4('0xe')]);router[_0x82a4('0xa')](_0x82a4('0xf'),auth['isAuthenticated'](),controller[_0x82a4('0x10')]);router[_0x82a4('0xa')](_0x82a4('0x11'),auth[_0x82a4('0x9')](),controller['getTeams']);router[_0x82a4('0xa')]('/:id/users',auth[_0x82a4('0x9')](),controller[_0x82a4('0x12')]);router[_0x82a4('0x13')]('/',auth[_0x82a4('0x9')](),controller[_0x82a4('0x14')]);router[_0x82a4('0x13')](_0x82a4('0x11'),auth['isAuthenticated'](),controller[_0x82a4('0x15')]);router['post'](_0x82a4('0x16'),auth[_0x82a4('0x9')](),controller[_0x82a4('0x17')]);router['put']('/:id',auth[_0x82a4('0x9')](),controller['update']);router[_0x82a4('0x18')]('/:id',auth[_0x82a4('0x9')](),controller['destroy']);router[_0x82a4('0x18')]('/:id/teams',auth[_0x82a4('0x9')](),controller[_0x82a4('0x19')]);router[_0x82a4('0x18')](_0x82a4('0x16'),auth[_0x82a4('0x9')](),controller[_0x82a4('0x1a')]);module[_0x82a4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 7210510..5e4278f 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 _0x998d=['INTEGER','ENUM','rrmemory','beepall','exports','STRING','name'];(function(_0x23fc68,_0x538f0c){var _0x3f162e=function(_0x86b208){while(--_0x86b208){_0x23fc68['push'](_0x23fc68['shift']());}};_0x3f162e(++_0x538f0c);}(_0x998d,0x19a));var _0xd998=function(_0x5c6160,_0x5e68a8){_0x5c6160=_0x5c6160-0x0;var _0x5312f2=_0x998d[_0x5c6160];return _0x5312f2;};'use strict';var Sequelize=require('sequelize');module[_0xd998('0x0')]={'name':{'type':Sequelize[_0xd998('0x1')],'unique':_0xd998('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd998('0x1')]},'timeout':{'type':Sequelize[_0xd998('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd998('0x4')](_0xd998('0x5'),_0xd998('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xe753=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x5181f4,_0x3e7316){var _0x2eb504=function(_0x4daf66){while(--_0x4daf66){_0x5181f4['push'](_0x5181f4['shift']());}};_0x2eb504(++_0x3e7316);}(_0xe753,0x180));var _0x3e75=function(_0x2890af,_0xf87541){_0x2890af=_0x2890af-0x0;var _0x4e8077=_0xe753[_0x2890af];return _0x4e8077;};'use strict';var Sequelize=require(_0x3e75('0x0'));module[_0x3e75('0x1')]={'name':{'type':Sequelize[_0x3e75('0x2')],'unique':_0x3e75('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3e75('0x2')]},'timeout':{'type':Sequelize[_0x3e75('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3e75('0x5')](_0x3e75('0x6'),_0x3e75('0x7'),_0x3e75('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 895044a..a1dff20 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 _0xe681=['sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','then','get','UserProfileResource','error','stack','name','index','map','fieldName','type','key','getOptions','where','OpenchannelQueue','include','findAll','rows','catch','params','keys','rawAttributes','query','filters','intersection','attributes','model','fields','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','nolimit','order','sort','pick','OpenchannelQueueId','filter','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','Agents','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','compact','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0xde77c8,_0x1e2dfa){var _0x409659=function(_0x56e853){while(--_0x56e853){_0xde77c8['push'](_0xde77c8['shift']());}};_0x409659(++_0x1e2dfa);}(_0xe681,0xec));var _0x1e68=function(_0x5d83c6,_0x253a6f){_0x5d83c6=_0x5d83c6-0x0;var _0x9eaac5=_0xe681[_0x5d83c6];return _0x9eaac5;};'use strict';var BPromise=require(_0x1e68('0x0'));var util=require(_0x1e68('0x1'));var _=require(_0x1e68('0x2'));var squel=require(_0x1e68('0x3'));var Redis=require(_0x1e68('0x4'));var qs=require(_0x1e68('0x5'));var logger=require('../../config/logger')(_0x1e68('0x6'));var config=require(_0x1e68('0x7'));var db=require(_0x1e68('0x8'))['db'];config[_0x1e68('0x9')]=_['defaults'](config[_0x1e68('0x9')],{'host':_0x1e68('0xa'),'port':0x18eb});var socket=require(_0x1e68('0xb'))(new Redis(config[_0x1e68('0x9')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x4b375f,_0x142b63){_0x142b63=_0x142b63||0xcc;return function(_0x3724bf){if(_0x3724bf){return _0x4b375f[_0x1e68('0xc')](_0x142b63);}return _0x4b375f[_0x1e68('0xd')](_0x142b63)['end']();};}function respondWithResult(_0x234272,_0xfb4de4){_0xfb4de4=_0xfb4de4||0xc8;return function(_0x6fdfee){if(_0x6fdfee){return _0x234272[_0x1e68('0xd')](_0xfb4de4)['json'](_0x6fdfee);}};}function respondWithFilteredResult(_0x5a7e08,_0x307c00){return function(_0x4aca12){if(_0x4aca12){var _0x199cb6=typeof _0x307c00[_0x1e68('0xe')]===_0x1e68('0xf')&&typeof _0x307c00[_0x1e68('0x10')]===_0x1e68('0xf');var _0x5dae8c=_0x4aca12[_0x1e68('0x11')];var _0x438f23=_0x199cb6?0x0:_0x307c00[_0x1e68('0xe')];var _0x1ca667=_0x199cb6?_0x4aca12['count']:_0x307c00['offset']+_0x307c00[_0x1e68('0x10')];var _0x1cce5c;if(_0x1ca667>=_0x5dae8c){_0x1ca667=_0x5dae8c;_0x1cce5c=0xc8;}else{_0x1cce5c=0xce;}_0x5a7e08[_0x1e68('0xd')](_0x1cce5c);return _0x5a7e08[_0x1e68('0x12')](_0x1e68('0x13'),_0x438f23+'-'+_0x1ca667+'/'+_0x5dae8c)[_0x1e68('0x14')](_0x4aca12);}return null;};}function saveUpdates(_0x136143){return function(_0x4de8fe){if(_0x4de8fe){return _0x4de8fe['update'](_0x136143)[_0x1e68('0x15')](function(_0x275f45){return _0x275f45;});}return null;};}function removeEntity(_0x4bdf2f){return function(_0x125d71){if(_0x125d71){return _0x125d71['destroy']()[_0x1e68('0x15')](function(){var _0x33a71c=_0x125d71[_0x1e68('0x16')]({'plain':!![]});var _0x3d5957='OpenchannelQueues';return db[_0x1e68('0x17')]['destroy']({'where':{'type':_0x3d5957,'resourceId':_0x33a71c['id']}})[_0x1e68('0x15')](function(){return _0x125d71;});})[_0x1e68('0x15')](function(){_0x4bdf2f[_0x1e68('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24385e){return function(_0x282ed8){if(!_0x282ed8){_0x24385e[_0x1e68('0xc')](0x194);}return _0x282ed8;};}function handleError(_0x34e51e,_0x148e11){_0x148e11=_0x148e11||0x1f4;return function(_0x223939){logger[_0x1e68('0x18')](_0x223939[_0x1e68('0x19')]);if(_0x223939[_0x1e68('0x1a')]){delete _0x223939[_0x1e68('0x1a')];}_0x34e51e[_0x1e68('0xd')](_0x148e11)['send'](_0x223939);};}exports[_0x1e68('0x1b')]=function(_0x98391e,_0x538c87){var _0xe13574={};var _0x3484d6={'count':0x0,'rows':[]};var _0x47ce38=_[_0x1e68('0x1c')](db['OpenchannelQueue']['rawAttributes'],function(_0x3f3cfe){return{'name':_0x3f3cfe[_0x1e68('0x1d')],'type':_0x3f3cfe[_0x1e68('0x1e')][_0x1e68('0x1f')]};});_0xe13574=qs[_0x1e68('0x20')](_0x47ce38,_0x98391e);var _0x393eaf={'where':_0xe13574[_0x1e68('0x21')]};return db[_0x1e68('0x22')][_0x1e68('0x11')](_0x393eaf)[_0x1e68('0x15')](function(_0x4651e4){_0x3484d6[_0x1e68('0x11')]=_0x4651e4;_0xe13574['include']=qs[_0x1e68('0x23')](_0x98391e['query']);return db['OpenchannelQueue'][_0x1e68('0x24')](_0xe13574);})['then'](function(_0xfa9bee){_0x3484d6[_0x1e68('0x25')]=_0xfa9bee;return _0x3484d6;})['then'](respondWithFilteredResult(_0x538c87,_0xe13574))[_0x1e68('0x26')](handleError(_0x538c87,null));};exports['show']=function(_0x560361,_0x224522){var _0x49f48a={'raw':!![],'where':{'id':_0x560361[_0x1e68('0x27')]['id']}},_0x577e35={};_0x577e35['model']=_[_0x1e68('0x28')](db[_0x1e68('0x22')][_0x1e68('0x29')]);_0x577e35[_0x1e68('0x2a')]=_[_0x1e68('0x28')](_0x560361[_0x1e68('0x2a')]);_0x577e35[_0x1e68('0x2b')]=_[_0x1e68('0x2c')](_0x577e35['model'],_0x577e35['query']);_0x49f48a[_0x1e68('0x2d')]=_[_0x1e68('0x2c')](_0x577e35[_0x1e68('0x2e')],qs[_0x1e68('0x2f')](_0x560361['query'][_0x1e68('0x2f')]));_0x49f48a[_0x1e68('0x2d')]=_0x49f48a[_0x1e68('0x2d')][_0x1e68('0x30')]?_0x49f48a['attributes']:_0x577e35[_0x1e68('0x2e')];if(_0x560361['query']['includeAll']){_0x49f48a[_0x1e68('0x23')]=[{'all':!![]}];}_0x49f48a=_[_0x1e68('0x31')]({},_0x49f48a,_0x560361[_0x1e68('0x32')]);return db[_0x1e68('0x22')][_0x1e68('0x33')](_0x49f48a)[_0x1e68('0x15')](handleEntityNotFound(_0x224522,null))[_0x1e68('0x15')](respondWithResult(_0x224522,null))[_0x1e68('0x26')](handleError(_0x224522,null));};exports[_0x1e68('0x34')]=function(_0x3ee426,_0x4cf80f){return db[_0x1e68('0x22')][_0x1e68('0x34')](_0x3ee426[_0x1e68('0x35')],{})['then'](function(_0x3fd236){var _0x147365=_0x3ee426[_0x1e68('0x36')][_0x1e68('0x16')]({'plain':!![]});if(!_0x147365)throw new Error(_0x1e68('0x37'));if(_0x147365[_0x1e68('0x38')]===_0x1e68('0x36')){var _0x2ac279=_0x3fd236[_0x1e68('0x16')]({'plain':!![]});var _0x4573b1='OpenchannelQueues';return db[_0x1e68('0x39')][_0x1e68('0x33')]({'where':{'name':_0x4573b1,'userProfileId':_0x147365['userProfileId']},'raw':!![]})['then'](function(_0x52edd9){if(_0x52edd9&&_0x52edd9[_0x1e68('0x3a')]===0x0){return db[_0x1e68('0x17')][_0x1e68('0x34')]({'name':_0x2ac279[_0x1e68('0x1a')],'resourceId':_0x2ac279['id'],'type':_0x52edd9[_0x1e68('0x1a')],'sectionId':_0x52edd9['id']},{})[_0x1e68('0x15')](function(){return _0x3fd236;});}else{return _0x3fd236;}})[_0x1e68('0x26')](function(_0x95e7d4){logger['error'](_0x1e68('0x3b'),_0x95e7d4);throw _0x95e7d4;});}return _0x3fd236;})[_0x1e68('0x15')](respondWithResult(_0x4cf80f,0xc9))[_0x1e68('0x26')](handleError(_0x4cf80f,null));};exports[_0x1e68('0x3c')]=function(_0x4d87ee,_0x3149b6){if(_0x4d87ee['body']['id']){delete _0x4d87ee[_0x1e68('0x35')]['id'];}return db[_0x1e68('0x22')]['find']({'where':{'id':_0x4d87ee[_0x1e68('0x27')]['id']}})[_0x1e68('0x15')](handleEntityNotFound(_0x3149b6,null))[_0x1e68('0x15')](saveUpdates(_0x4d87ee[_0x1e68('0x35')],null))[_0x1e68('0x15')](respondWithResult(_0x3149b6,null))['catch'](handleError(_0x3149b6,null));};exports[_0x1e68('0x3d')]=function(_0x318b26,_0x462fd9){return db[_0x1e68('0x22')]['find']({'where':{'id':_0x318b26['params']['id']}})[_0x1e68('0x15')](handleEntityNotFound(_0x462fd9,null))[_0x1e68('0x15')](removeEntity(_0x462fd9,null))[_0x1e68('0x26')](handleError(_0x462fd9,null));};exports[_0x1e68('0x3e')]=function(_0x51dd95,_0x541f71){return db['OpenchannelQueue'][_0x1e68('0x3e')]()[_0x1e68('0x15')](respondWithResult(_0x541f71,null))['catch'](handleError(_0x541f71,null));};exports[_0x1e68('0x3f')]=function(_0x3e2a71,_0xfca218){var _0xac237a={'raw':!![],'where':{}},_0x2f20b1={},_0x3364cd;return db['OpenchannelQueue'][_0x1e68('0x40')]({'where':{'id':_0x3e2a71['params']['id']}})['then'](handleEntityNotFound(_0xfca218,null))[_0x1e68('0x15')](function(_0x334567){if(_0x334567){_0x3364cd=_0x334567[_0x1e68('0x16')]({'plain':!![]});_0x2f20b1[_0x1e68('0x2e')]=_[_0x1e68('0x28')](db[_0x1e68('0x41')]['rawAttributes']);_0x2f20b1[_0x1e68('0x2a')]=_[_0x1e68('0x28')](_0x3e2a71[_0x1e68('0x2a')]);_0x2f20b1['filters']=_['intersection'](_0x2f20b1[_0x1e68('0x2e')],_0x2f20b1[_0x1e68('0x2a')]);_0xac237a['attributes']=_[_0x1e68('0x2c')](_0x2f20b1['model'],qs[_0x1e68('0x2f')](_0x3e2a71[_0x1e68('0x2a')][_0x1e68('0x2f')]));_0xac237a['attributes']=_0xac237a['attributes'][_0x1e68('0x30')]?_0xac237a[_0x1e68('0x2d')]:_0x2f20b1[_0x1e68('0x2e')];if(!_0x3e2a71[_0x1e68('0x2a')][_0x1e68('0x42')](_0x1e68('0x43'))){_0xac237a[_0x1e68('0x10')]=qs[_0x1e68('0x10')](_0x3e2a71[_0x1e68('0x2a')]['limit']);_0xac237a[_0x1e68('0xe')]=qs[_0x1e68('0xe')](_0x3e2a71[_0x1e68('0x2a')]['offset']);}_0xac237a[_0x1e68('0x44')]=qs[_0x1e68('0x45')](_0x3e2a71[_0x1e68('0x2a')]['sort']);_0xac237a[_0x1e68('0x21')]=qs['filters'](_[_0x1e68('0x46')](_0x3e2a71[_0x1e68('0x2a')],_0x2f20b1[_0x1e68('0x2b')]));_0xac237a[_0x1e68('0x21')][_0x1e68('0x47')]=_0x334567['id'];if(_0x3e2a71[_0x1e68('0x2a')][_0x1e68('0x48')]){_0xac237a[_0x1e68('0x21')]=_[_0x1e68('0x31')](_0xac237a['where'],{'$or':_[_0x1e68('0x1c')](_0xac237a[_0x1e68('0x2d')],function(_0x36dfc9){var _0x1b6123={};_0x1b6123[_0x36dfc9]={'$like':'%'+_0x3e2a71[_0x1e68('0x2a')]['filter']+'%'};return _0x1b6123;})});}_0xac237a=_[_0x1e68('0x31')]({},_0xac237a,_0x3e2a71[_0x1e68('0x32')]);return db['UserOpenchannelQueue'][_0x1e68('0x24')](_0xac237a);}})[_0x1e68('0x15')](function(_0x511fd0){if(_0x511fd0){return db[_0x1e68('0x49')][_0x1e68('0x4a')]({'where':{'id':_[_0x1e68('0x1c')](_0x511fd0,_0x1e68('0x4b')),'role':_0x1e68('0x4c')},'attributes':['id','name',_0x1e68('0x4d'),_0x1e68('0x4e'),_0x1e68('0x4f')]});}})[_0x1e68('0x15')](function(_0x4e1c39){if(_0x4e1c39){return{'count':_0x4e1c39['count'],'rows':_['map'](_0x4e1c39[_0x1e68('0x25')],function(_0x2fcdaf){return{'membername':_0x2fcdaf[_0x1e68('0x1a')],'UserId':_0x2fcdaf['id'],'queue_name':_0x3364cd[_0x1e68('0x1a')],'OpenchannelQueueId':_0x3364cd['id'],'interface':util[_0x1e68('0x50')](_0x1e68('0x51'),_0x1e68('0x52'),_0x2fcdaf[_0x1e68('0x1a')]),'penalty':0x0,'paused':_0x2fcdaf[_0x1e68('0x4d')],'createdAt':_0x2fcdaf[_0x1e68('0x4f')],'updatedAt':_0x2fcdaf[_0x1e68('0x4e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1e68('0x15')](respondWithFilteredResult(_0xfca218,_0xac237a))[_0x1e68('0x26')](handleError(_0xfca218,null));};exports[_0x1e68('0x53')]=function(_0x500595,_0x20522d){var _0x26a06e={};var _0x171466={};var _0x3532aa;var _0x166390;return db[_0x1e68('0x22')]['findOne']({'where':{'id':_0x500595['params']['id']}})[_0x1e68('0x15')](handleEntityNotFound(_0x20522d,null))[_0x1e68('0x15')](function(_0x30087f){if(_0x30087f){_0x3532aa=_0x30087f;_0x171466[_0x1e68('0x2e')]=_[_0x1e68('0x28')](db[_0x1e68('0x54')][_0x1e68('0x29')]);_0x171466[_0x1e68('0x2a')]=_[_0x1e68('0x28')](_0x500595[_0x1e68('0x2a')]);_0x171466[_0x1e68('0x2b')]=_['intersection'](_0x171466[_0x1e68('0x2e')],_0x171466[_0x1e68('0x2a')]);_0x26a06e[_0x1e68('0x2d')]=_[_0x1e68('0x2c')](_0x171466['model'],qs['fields'](_0x500595[_0x1e68('0x2a')][_0x1e68('0x2f')]));_0x26a06e[_0x1e68('0x2d')]=_0x26a06e[_0x1e68('0x2d')][_0x1e68('0x30')]?_0x26a06e[_0x1e68('0x2d')]:_0x171466[_0x1e68('0x2e')];_0x26a06e[_0x1e68('0x44')]=qs[_0x1e68('0x45')](_0x500595['query'][_0x1e68('0x45')]);_0x26a06e['where']=qs[_0x1e68('0x2b')](_['pick'](_0x500595[_0x1e68('0x2a')],_0x171466[_0x1e68('0x2b')]));if(_0x500595['query']['filter']){_0x26a06e['where']=_['merge'](_0x26a06e[_0x1e68('0x21')],{'$or':_['map'](_0x26a06e[_0x1e68('0x2d')],function(_0x552827){var _0xb492f5={};_0xb492f5[_0x552827]={'$like':'%'+_0x500595[_0x1e68('0x2a')][_0x1e68('0x48')]+'%'};return _0xb492f5;})});}_0x26a06e=_[_0x1e68('0x31')]({},_0x26a06e,_0x500595['options']);return _0x3532aa[_0x1e68('0x53')](_0x26a06e);}})[_0x1e68('0x15')](function(_0x35d31a){if(_0x35d31a){_0x166390=_0x35d31a[_0x1e68('0x30')];if(!_0x500595[_0x1e68('0x2a')][_0x1e68('0x42')](_0x1e68('0x43'))){_0x26a06e[_0x1e68('0x10')]=qs[_0x1e68('0x10')](_0x500595['query'][_0x1e68('0x10')]);_0x26a06e[_0x1e68('0xe')]=qs['offset'](_0x500595[_0x1e68('0x2a')]['offset']);}return _0x3532aa[_0x1e68('0x53')](_0x26a06e);}})[_0x1e68('0x15')](function(_0x3a1e2a){if(_0x3a1e2a){return _0x3a1e2a?{'count':_0x166390,'rows':_0x3a1e2a}:null;}})[_0x1e68('0x15')](respondWithResult(_0x20522d,null))[_0x1e68('0x26')](handleError(_0x20522d,null));};exports['addTeams']=function(_0x475136,_0x1eff0a){var _0x32acc5=_0x475136['body'][_0x1e68('0x55')];return db[_0x1e68('0x54')]['findAll']({'where':{'id':_0x32acc5},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1e68('0x1a'),_0x1e68('0x56'),_0x1e68('0x57'),_0x1e68('0x58')],'raw':!![]}]})[_0x1e68('0x15')](function(_0x2f8f8f){if(_0x2f8f8f){var _0x2a058e=_['flatMap'](_0x2f8f8f,function(_0x34d5c2){var _0x48c4b2=_0x34d5c2[_0x1e68('0x16')]({'plain':!![]});return _0x48c4b2['Agents'];});return db[_0x1e68('0x22')][_0x1e68('0x33')]({'where':{'id':_0x475136[_0x1e68('0x27')]['id']}})[_0x1e68('0x15')](function(_0x2c0ca1){return db['sequelize'][_0x1e68('0x59')](function(_0x1f7fe2){return _0x2c0ca1['addTeams'](_0x32acc5,{'transaction':_0x1f7fe2})[_0x1e68('0x15')](function(){return BPromise['each'](_0x2a058e,function(_0x49b4c1){return db['UserOpenchannelQueue'][_0x1e68('0x5a')]({'where':{'UserId':_0x49b4c1['id'],'OpenchannelQueueId':_0x475136[_0x1e68('0x27')]['id']},'transaction':_0x1f7fe2});});})[_0x1e68('0x15')](function(){_0x2a058e[_0x1e68('0x5b')](function(_0x126aa){socket[_0x1e68('0x5c')](_0x1e68('0x5d'),{'UserId':_0x126aa['id'],'OpenchannelQueueId':_0x2c0ca1['id']});});});});});}})['then'](respondWithStatusCode(_0x1eff0a,null))[_0x1e68('0x26')](handleError(_0x1eff0a,null));};exports['removeTeams']=function(_0xff45fe,_0x351178){return db[_0x1e68('0x54')][_0x1e68('0x24')]({'where':{'id':_0xff45fe[_0x1e68('0x2a')][_0x1e68('0x55')]},'attributes':['id'],'include':[{'model':db[_0x1e68('0x49')],'as':_0x1e68('0x5e'),'attributes':['id'],'raw':!![]}]})[_0x1e68('0x15')](handleEntityNotFound(_0x351178,null))['then'](function(_0x4902b2){var _0x4288e9=_['map'](_0x4902b2,'id');var _0x5a18b4=[];var _0xc3e018=[];var _0x2803c3=squel[_0x1e68('0x5f')]();_0x2803c3[_0x1e68('0x60')](_0x1e68('0x61'))[_0x1e68('0x62')](_0x1e68('0x63'),'tq')[_0x1e68('0x64')](_0x1e68('0x65'),'ut',_0x1e68('0x66'))[_0x1e68('0x21')](_0x1e68('0x67'),_0xff45fe[_0x1e68('0x27')]['id']);for(var _0x2e14e1=0x0;_0x2e14e1<_0x4902b2[_0x1e68('0x30')];_0x2e14e1+=0x1){let _0x472f86=_0x4902b2[_0x2e14e1];for(var _0x1ef6aa=0x0;_0x1ef6aa<_0x472f86[_0x1e68('0x5e')][_0x1e68('0x30')];_0x1ef6aa+=0x1){let _0x37ce70=_0x472f86[_0x1e68('0x5e')][_0x1ef6aa];var _0x27d526=_0x2803c3[_0x1e68('0x68')]();_0x27d526[_0x1e68('0x21')](_0x1e68('0x69'),_0x37ce70['id']);_0xc3e018[_0x1e68('0x6a')](db[_0x1e68('0x6b')][_0x1e68('0x2a')](_0x27d526[_0x1e68('0x6c')](),{'type':db['sequelize'][_0x1e68('0x6d')][_0x1e68('0x6e')]})[_0x1e68('0x15')](function(_0xddd61c){if(_0xddd61c[_0x1e68('0x30')]===0x1){return _0x37ce70['id'];}else{var _0x164ed1=_[_0x1e68('0x6f')](_['map'](_0xddd61c,_0x1e68('0x70')),function(_0x7134ce){return _['includes'](_0x4288e9,_0x7134ce);});if(_0x164ed1){return _0x37ce70['id'];}}}));}}return BPromise['all'](_0xc3e018)[_0x1e68('0x15')](function(_0x27c741){_0x5a18b4=_(_0x5a18b4)[_0x1e68('0x71')](_0x27c741)[_0x1e68('0x72')]()[_0x1e68('0x73')]();return db['OpenchannelQueue'][_0x1e68('0x33')]({'where':{'id':_0xff45fe[_0x1e68('0x27')]['id']}})[_0x1e68('0x15')](function(_0x9a9078){return db[_0x1e68('0x6b')][_0x1e68('0x59')](function(_0x5d6ef2){return _0x9a9078[_0x1e68('0x74')](_0xff45fe[_0x1e68('0x2a')][_0x1e68('0x55')],{'transaction':_0x5d6ef2})[_0x1e68('0x15')](function(){if(!_[_0x1e68('0x75')](_0x5a18b4)){return _0x9a9078[_0x1e68('0x76')](_0x5a18b4,{'transaction':_0x5d6ef2});}})[_0x1e68('0x15')](function(){_0x5a18b4[_0x1e68('0x5b')](function(_0xfd12b1){socket[_0x1e68('0x5c')](_0x1e68('0x77'),{'UserId':_0xfd12b1,'OpenchannelQueueId':_0x9a9078['id']});});});});});});})[_0x1e68('0x15')](respondWithStatusCode(_0x351178,null))[_0x1e68('0x26')](handleError(_0x351178,null));};exports[_0x1e68('0x78')]=function(_0x314791,_0x144ebb){return db[_0x1e68('0x22')][_0x1e68('0x33')]({'where':{'id':_0x314791[_0x1e68('0x27')]['id']}})[_0x1e68('0x15')](handleEntityNotFound(_0x144ebb,null))['then'](function(_0x55bab7){if(_0x55bab7){return _0x55bab7[_0x1e68('0x78')](_0x314791[_0x1e68('0x35')][_0x1e68('0x55')],_[_0x1e68('0x79')](_0x314791[_0x1e68('0x35')],[_0x1e68('0x55'),'id'])||{})[_0x1e68('0x7a')](function(_0x4bb739){for(var _0x3f8f0c=0x0;_0x3f8f0c<_0x314791[_0x1e68('0x35')][_0x1e68('0x55')][_0x1e68('0x30')];_0x3f8f0c+=0x1){socket[_0x1e68('0x5c')](_0x1e68('0x5d'),{'UserId':Number(_0x314791['body']['ids'][_0x3f8f0c]),'OpenchannelQueueId':Number(_0x314791[_0x1e68('0x27')]['id'])});}return _0x4bb739;});}})['then'](respondWithResult(_0x144ebb,null))[_0x1e68('0x26')](handleError(_0x144ebb,null));};exports['removeAgents']=function(_0x3e3fd7,_0x239c63){return db[_0x1e68('0x22')][_0x1e68('0x33')]({'where':{'id':_0x3e3fd7[_0x1e68('0x27')]['id']}})['then'](handleEntityNotFound(_0x239c63,null))[_0x1e68('0x15')](function(_0x5cccb5){if(_0x5cccb5){return _0x5cccb5['removeAgents'](_0x3e3fd7[_0x1e68('0x2a')]['ids'])[_0x1e68('0x15')](function(){if(_['isArray'](_0x3e3fd7[_0x1e68('0x2a')][_0x1e68('0x55')])){for(var _0xbd72cb=0x0;_0xbd72cb<_0x3e3fd7[_0x1e68('0x2a')]['ids'][_0x1e68('0x30')];_0xbd72cb+=0x1){socket['emit'](_0x1e68('0x77'),{'UserId':Number(_0x3e3fd7['query'][_0x1e68('0x55')][_0xbd72cb]),'OpenchannelQueueId':Number(_0x3e3fd7[_0x1e68('0x27')]['id'])});}}else{socket['emit'](_0x1e68('0x77'),{'UserId':Number(_0x3e3fd7[_0x1e68('0x2a')][_0x1e68('0x55')]),'OpenchannelQueueId':Number(_0x3e3fd7['params']['id'])});}});}})[_0x1e68('0x15')](respondWithStatusCode(_0x239c63,null))['catch'](handleError(_0x239c63,null));};exports[_0x1e68('0x7b')]=function(_0x46b9ba,_0x1d6249){var _0x4865d8={};var _0x4cde15={};var _0x461c4a;var _0x53bd60;return db[_0x1e68('0x22')][_0x1e68('0x40')]({'where':{'id':_0x46b9ba[_0x1e68('0x27')]['id']}})[_0x1e68('0x15')](handleEntityNotFound(_0x1d6249,null))[_0x1e68('0x15')](function(_0x2d4f0b){if(_0x2d4f0b){_0x461c4a=_0x2d4f0b;_0x4cde15[_0x1e68('0x2e')]=_['keys'](db['User'][_0x1e68('0x29')]);_0x4cde15['query']=_['keys'](_0x46b9ba[_0x1e68('0x2a')]);_0x4cde15[_0x1e68('0x2b')]=_['intersection'](_0x4cde15['model'],_0x4cde15[_0x1e68('0x2a')]);_0x4865d8['attributes']=_[_0x1e68('0x2c')](_0x4cde15[_0x1e68('0x2e')],qs[_0x1e68('0x2f')](_0x46b9ba[_0x1e68('0x2a')][_0x1e68('0x2f')]));_0x4865d8[_0x1e68('0x2d')]=_0x4865d8['attributes'][_0x1e68('0x30')]?_0x4865d8[_0x1e68('0x2d')]:_0x4cde15[_0x1e68('0x2e')];_0x4865d8[_0x1e68('0x44')]=qs[_0x1e68('0x45')](_0x46b9ba[_0x1e68('0x2a')][_0x1e68('0x45')]);_0x4865d8[_0x1e68('0x21')]=qs[_0x1e68('0x2b')](_[_0x1e68('0x46')](_0x46b9ba['query'],_0x4cde15[_0x1e68('0x2b')]));if(_0x46b9ba[_0x1e68('0x2a')][_0x1e68('0x48')]){_0x4865d8['where']=_[_0x1e68('0x31')](_0x4865d8[_0x1e68('0x21')],{'$or':_[_0x1e68('0x1c')](_0x4865d8['attributes'],function(_0x413cc2){var _0x5c7bd2={};_0x5c7bd2[_0x413cc2]={'$like':'%'+_0x46b9ba['query'][_0x1e68('0x48')]+'%'};return _0x5c7bd2;})});}_0x4865d8=_[_0x1e68('0x31')]({},_0x4865d8,_0x46b9ba[_0x1e68('0x32')]);return _0x461c4a[_0x1e68('0x7b')](_0x4865d8);}})[_0x1e68('0x15')](function(_0x2f66ea){if(_0x2f66ea){_0x53bd60=_0x2f66ea[_0x1e68('0x30')];if(!_0x46b9ba[_0x1e68('0x2a')]['hasOwnProperty'](_0x1e68('0x43'))){_0x4865d8['limit']=qs[_0x1e68('0x10')](_0x46b9ba['query']['limit']);_0x4865d8[_0x1e68('0xe')]=qs[_0x1e68('0xe')](_0x46b9ba[_0x1e68('0x2a')]['offset']);}return _0x461c4a['getAgents'](_0x4865d8);}})[_0x1e68('0x15')](function(_0x2f3e85){if(_0x2f3e85){return _0x2f3e85?{'count':_0x53bd60,'rows':_0x2f3e85}:null;}})[_0x1e68('0x15')](respondWithResult(_0x1d6249,null))[_0x1e68('0x26')](handleError(_0x1d6249,null));}; \ No newline at end of file +var _0x5675=['updatedAt','getTeams','sort','hasOwnProperty','nolimit','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','transaction','findOrCreate','forEach','emit','select','field','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','compact','value','removeTeams','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','order','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','include','query','findAll','rows','catch','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','where','pick','OpenchannelQueueId','filter','User','UserId','agent','openchannelPause','createdAt','%s/%s','SIP'];(function(_0x527de0,_0x2c060f){var _0x56107c=function(_0x5dd248){while(--_0x5dd248){_0x527de0['push'](_0x527de0['shift']());}};_0x56107c(++_0x2c060f);}(_0x5675,0xa5));var _0x5567=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5675[_0x3ff085];return _0x2b68c3;};'use strict';var BPromise=require('bluebird');var util=require(_0x5567('0x0'));var _=require(_0x5567('0x1'));var squel=require(_0x5567('0x2'));var Redis=require(_0x5567('0x3'));var qs=require(_0x5567('0x4'));var logger=require(_0x5567('0x5'))(_0x5567('0x6'));var config=require(_0x5567('0x7'));var db=require(_0x5567('0x8'))['db'];config['redis']=_[_0x5567('0x9')](config[_0x5567('0xa')],{'host':_0x5567('0xb'),'port':0x18eb});var socket=require(_0x5567('0xc'))(new Redis(config[_0x5567('0xa')]));require(_0x5567('0xd'))[_0x5567('0xe')](socket);function respondWithStatusCode(_0x35ac2b,_0x3e6529){_0x3e6529=_0x3e6529||0xcc;return function(_0x58ff71){if(_0x58ff71){return _0x35ac2b[_0x5567('0xf')](_0x3e6529);}return _0x35ac2b['status'](_0x3e6529)['end']();};}function respondWithResult(_0x114edd,_0x4fddd7){_0x4fddd7=_0x4fddd7||0xc8;return function(_0x2da156){if(_0x2da156){return _0x114edd[_0x5567('0x10')](_0x4fddd7)[_0x5567('0x11')](_0x2da156);}};}function respondWithFilteredResult(_0x39855e,_0x5df8ca){return function(_0x2c2a9e){if(_0x2c2a9e){var _0x239d4e=typeof _0x5df8ca[_0x5567('0x12')]===_0x5567('0x13')&&typeof _0x5df8ca[_0x5567('0x14')]===_0x5567('0x13');var _0x2825ff=_0x2c2a9e[_0x5567('0x15')];var _0x55ce79=_0x239d4e?0x0:_0x5df8ca['offset'];var _0x26f6fb=_0x239d4e?_0x2c2a9e[_0x5567('0x15')]:_0x5df8ca[_0x5567('0x12')]+_0x5df8ca[_0x5567('0x14')];var _0x517aa9;if(_0x26f6fb>=_0x2825ff){_0x26f6fb=_0x2825ff;_0x517aa9=0xc8;}else{_0x517aa9=0xce;}_0x39855e[_0x5567('0x10')](_0x517aa9);return _0x39855e[_0x5567('0x16')](_0x5567('0x17'),_0x55ce79+'-'+_0x26f6fb+'/'+_0x2825ff)[_0x5567('0x11')](_0x2c2a9e);}return null;};}function saveUpdates(_0x4548c8){return function(_0x3dc502){if(_0x3dc502){return _0x3dc502[_0x5567('0x18')](_0x4548c8)[_0x5567('0x19')](function(_0x4e1c69){return _0x4e1c69;});}return null;};}function removeEntity(_0x273429){return function(_0x2779dd){if(_0x2779dd){return _0x2779dd[_0x5567('0x1a')]()[_0x5567('0x19')](function(){var _0x47de6b=_0x2779dd['get']({'plain':!![]});var _0x54945e='OpenchannelQueues';return db[_0x5567('0x1b')][_0x5567('0x1a')]({'where':{'type':_0x54945e,'resourceId':_0x47de6b['id']}})[_0x5567('0x19')](function(){return _0x2779dd;});})['then'](function(){_0x273429[_0x5567('0x10')](0xcc)[_0x5567('0x1c')]();});}};}function handleEntityNotFound(_0x28503b){return function(_0xfd1646){if(!_0xfd1646){_0x28503b[_0x5567('0xf')](0x194);}return _0xfd1646;};}function handleError(_0xd13ea4,_0x4a1e1c){_0x4a1e1c=_0x4a1e1c||0x1f4;return function(_0x429782){logger[_0x5567('0x1d')](_0x429782[_0x5567('0x1e')]);if(_0x429782[_0x5567('0x1f')]){delete _0x429782['name'];}_0xd13ea4[_0x5567('0x10')](_0x4a1e1c)[_0x5567('0x20')](_0x429782);};}exports[_0x5567('0x21')]=function(_0x3e8c5e,_0x30a867){var _0x43e599={};var _0x369df6={'count':0x0,'rows':[]};var _0x2ab27c=_[_0x5567('0x22')](db[_0x5567('0x23')][_0x5567('0x24')],function(_0x2072b){return{'name':_0x2072b['fieldName'],'type':_0x2072b[_0x5567('0x25')]['key']};});_0x43e599=qs['getOptions'](_0x2ab27c,_0x3e8c5e);var _0x41495a={'where':_0x43e599['where']};return db['OpenchannelQueue'][_0x5567('0x15')](_0x41495a)[_0x5567('0x19')](function(_0x4eaabb){_0x369df6[_0x5567('0x15')]=_0x4eaabb;_0x43e599['include']=qs[_0x5567('0x26')](_0x3e8c5e[_0x5567('0x27')]);return db[_0x5567('0x23')][_0x5567('0x28')](_0x43e599);})[_0x5567('0x19')](function(_0x37ae60){_0x369df6[_0x5567('0x29')]=_0x37ae60;return _0x369df6;})['then'](respondWithFilteredResult(_0x30a867,_0x43e599))[_0x5567('0x2a')](handleError(_0x30a867,null));};exports['show']=function(_0x49c176,_0x119719){var _0x33b5c5={'raw':!![],'where':{'id':_0x49c176['params']['id']}},_0x4fab5f={};_0x4fab5f[_0x5567('0x2b')]=_['keys'](db[_0x5567('0x23')][_0x5567('0x24')]);_0x4fab5f[_0x5567('0x27')]=_[_0x5567('0x2c')](_0x49c176[_0x5567('0x27')]);_0x4fab5f[_0x5567('0x2d')]=_[_0x5567('0x2e')](_0x4fab5f[_0x5567('0x2b')],_0x4fab5f[_0x5567('0x27')]);_0x33b5c5[_0x5567('0x2f')]=_[_0x5567('0x2e')](_0x4fab5f[_0x5567('0x2b')],qs[_0x5567('0x30')](_0x49c176[_0x5567('0x27')][_0x5567('0x30')]));_0x33b5c5[_0x5567('0x2f')]=_0x33b5c5[_0x5567('0x2f')][_0x5567('0x31')]?_0x33b5c5[_0x5567('0x2f')]:_0x4fab5f[_0x5567('0x2b')];if(_0x49c176[_0x5567('0x27')][_0x5567('0x32')]){_0x33b5c5[_0x5567('0x26')]=[{'all':!![]}];}_0x33b5c5=_[_0x5567('0x33')]({},_0x33b5c5,_0x49c176[_0x5567('0x34')]);return db['OpenchannelQueue'][_0x5567('0x35')](_0x33b5c5)[_0x5567('0x19')](handleEntityNotFound(_0x119719,null))[_0x5567('0x19')](respondWithResult(_0x119719,null))['catch'](handleError(_0x119719,null));};exports[_0x5567('0x36')]=function(_0x64623e,_0x322cd4){return db[_0x5567('0x23')][_0x5567('0x36')](_0x64623e[_0x5567('0x37')],{})[_0x5567('0x19')](function(_0xb436f8){var _0xb4ea23=_0x64623e[_0x5567('0x38')]['get']({'plain':!![]});if(!_0xb4ea23)throw new Error(_0x5567('0x39'));if(_0xb4ea23['role']==='user'){var _0x3ab1d7=_0xb436f8['get']({'plain':!![]});var _0x46b372=_0x5567('0x3a');return db['UserProfileSection'][_0x5567('0x35')]({'where':{'name':_0x46b372,'userProfileId':_0xb4ea23['userProfileId']},'raw':!![]})[_0x5567('0x19')](function(_0x15aa89){if(_0x15aa89&&_0x15aa89[_0x5567('0x3b')]===0x0){return db['UserProfileResource'][_0x5567('0x36')]({'name':_0x3ab1d7[_0x5567('0x1f')],'resourceId':_0x3ab1d7['id'],'type':_0x15aa89[_0x5567('0x1f')],'sectionId':_0x15aa89['id']},{})[_0x5567('0x19')](function(){return _0xb436f8;});}else{return _0xb436f8;}})[_0x5567('0x2a')](function(_0x19b619){logger['error'](_0x5567('0x3c'),_0x19b619);throw _0x19b619;});}return _0xb436f8;})[_0x5567('0x19')](respondWithResult(_0x322cd4,0xc9))[_0x5567('0x2a')](handleError(_0x322cd4,null));};exports[_0x5567('0x18')]=function(_0x24b449,_0x562db2){if(_0x24b449['body']['id']){delete _0x24b449[_0x5567('0x37')]['id'];}return db[_0x5567('0x23')][_0x5567('0x35')]({'where':{'id':_0x24b449[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](handleEntityNotFound(_0x562db2,null))[_0x5567('0x19')](saveUpdates(_0x24b449[_0x5567('0x37')],null))['then'](respondWithResult(_0x562db2,null))['catch'](handleError(_0x562db2,null));};exports[_0x5567('0x1a')]=function(_0x5acead,_0x1aec15){return db[_0x5567('0x23')][_0x5567('0x35')]({'where':{'id':_0x5acead[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](handleEntityNotFound(_0x1aec15,null))[_0x5567('0x19')](removeEntity(_0x1aec15,null))['catch'](handleError(_0x1aec15,null));};exports[_0x5567('0x3e')]=function(_0x37a1dc,_0xefa5a0){return db[_0x5567('0x23')]['describe']()[_0x5567('0x19')](respondWithResult(_0xefa5a0,null))[_0x5567('0x2a')](handleError(_0xefa5a0,null));};exports[_0x5567('0x3f')]=function(_0x361807,_0x1ffda6){var _0x5c0f81={'raw':!![],'where':{}},_0x14bea9={},_0x146947;return db[_0x5567('0x23')][_0x5567('0x40')]({'where':{'id':_0x361807[_0x5567('0x3d')]['id']}})['then'](handleEntityNotFound(_0x1ffda6,null))[_0x5567('0x19')](function(_0x11a470){if(_0x11a470){_0x146947=_0x11a470['get']({'plain':!![]});_0x14bea9[_0x5567('0x2b')]=_[_0x5567('0x2c')](db[_0x5567('0x41')]['rawAttributes']);_0x14bea9['query']=_[_0x5567('0x2c')](_0x361807['query']);_0x14bea9[_0x5567('0x2d')]=_[_0x5567('0x2e')](_0x14bea9[_0x5567('0x2b')],_0x14bea9[_0x5567('0x27')]);_0x5c0f81[_0x5567('0x2f')]=_[_0x5567('0x2e')](_0x14bea9[_0x5567('0x2b')],qs['fields'](_0x361807[_0x5567('0x27')][_0x5567('0x30')]));_0x5c0f81[_0x5567('0x2f')]=_0x5c0f81[_0x5567('0x2f')][_0x5567('0x31')]?_0x5c0f81[_0x5567('0x2f')]:_0x14bea9[_0x5567('0x2b')];if(!_0x361807[_0x5567('0x27')]['hasOwnProperty']('nolimit')){_0x5c0f81[_0x5567('0x14')]=qs[_0x5567('0x14')](_0x361807[_0x5567('0x27')][_0x5567('0x14')]);_0x5c0f81[_0x5567('0x12')]=qs['offset'](_0x361807[_0x5567('0x27')][_0x5567('0x12')]);}_0x5c0f81['order']=qs['sort'](_0x361807[_0x5567('0x27')]['sort']);_0x5c0f81[_0x5567('0x42')]=qs[_0x5567('0x2d')](_[_0x5567('0x43')](_0x361807[_0x5567('0x27')],_0x14bea9[_0x5567('0x2d')]));_0x5c0f81[_0x5567('0x42')][_0x5567('0x44')]=_0x11a470['id'];if(_0x361807[_0x5567('0x27')]['filter']){_0x5c0f81[_0x5567('0x42')]=_[_0x5567('0x33')](_0x5c0f81['where'],{'$or':_[_0x5567('0x22')](_0x5c0f81[_0x5567('0x2f')],function(_0x538d54){var _0xab794a={};_0xab794a[_0x538d54]={'$like':'%'+_0x361807['query'][_0x5567('0x45')]+'%'};return _0xab794a;})});}_0x5c0f81=_['merge']({},_0x5c0f81,_0x361807[_0x5567('0x34')]);return db[_0x5567('0x41')][_0x5567('0x28')](_0x5c0f81);}})[_0x5567('0x19')](function(_0x37956a){if(_0x37956a){return db[_0x5567('0x46')]['findAndCountAll']({'where':{'id':_[_0x5567('0x22')](_0x37956a,_0x5567('0x47')),'role':_0x5567('0x48')},'attributes':['id',_0x5567('0x1f'),_0x5567('0x49'),'updatedAt',_0x5567('0x4a')]});}})[_0x5567('0x19')](function(_0x5ea055){if(_0x5ea055){return{'count':_0x5ea055[_0x5567('0x15')],'rows':_[_0x5567('0x22')](_0x5ea055[_0x5567('0x29')],function(_0x5534b2){return{'membername':_0x5534b2[_0x5567('0x1f')],'UserId':_0x5534b2['id'],'queue_name':_0x146947['name'],'OpenchannelQueueId':_0x146947['id'],'interface':util['format'](_0x5567('0x4b'),_0x5567('0x4c'),_0x5534b2[_0x5567('0x1f')]),'penalty':0x0,'paused':_0x5534b2[_0x5567('0x49')],'createdAt':_0x5534b2[_0x5567('0x4a')],'updatedAt':_0x5534b2[_0x5567('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5567('0x19')](respondWithFilteredResult(_0x1ffda6,_0x5c0f81))[_0x5567('0x2a')](handleError(_0x1ffda6,null));};exports[_0x5567('0x4e')]=function(_0x285f79,_0x3654ab){var _0x5627c7={};var _0x3f033c={};var _0x3c630d;var _0x4c564d;return db[_0x5567('0x23')][_0x5567('0x40')]({'where':{'id':_0x285f79[_0x5567('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3654ab,null))[_0x5567('0x19')](function(_0x263a93){if(_0x263a93){_0x3c630d=_0x263a93;_0x3f033c[_0x5567('0x2b')]=_[_0x5567('0x2c')](db['Team'][_0x5567('0x24')]);_0x3f033c[_0x5567('0x27')]=_[_0x5567('0x2c')](_0x285f79[_0x5567('0x27')]);_0x3f033c[_0x5567('0x2d')]=_[_0x5567('0x2e')](_0x3f033c[_0x5567('0x2b')],_0x3f033c['query']);_0x5627c7[_0x5567('0x2f')]=_[_0x5567('0x2e')](_0x3f033c['model'],qs[_0x5567('0x30')](_0x285f79[_0x5567('0x27')][_0x5567('0x30')]));_0x5627c7[_0x5567('0x2f')]=_0x5627c7[_0x5567('0x2f')][_0x5567('0x31')]?_0x5627c7[_0x5567('0x2f')]:_0x3f033c[_0x5567('0x2b')];_0x5627c7['order']=qs[_0x5567('0x4f')](_0x285f79[_0x5567('0x27')][_0x5567('0x4f')]);_0x5627c7[_0x5567('0x42')]=qs[_0x5567('0x2d')](_['pick'](_0x285f79[_0x5567('0x27')],_0x3f033c['filters']));if(_0x285f79[_0x5567('0x27')][_0x5567('0x45')]){_0x5627c7[_0x5567('0x42')]=_[_0x5567('0x33')](_0x5627c7[_0x5567('0x42')],{'$or':_[_0x5567('0x22')](_0x5627c7[_0x5567('0x2f')],function(_0x2540d6){var _0x18edcd={};_0x18edcd[_0x2540d6]={'$like':'%'+_0x285f79[_0x5567('0x27')][_0x5567('0x45')]+'%'};return _0x18edcd;})});}_0x5627c7=_[_0x5567('0x33')]({},_0x5627c7,_0x285f79[_0x5567('0x34')]);return _0x3c630d['getTeams'](_0x5627c7);}})[_0x5567('0x19')](function(_0x1c05da){if(_0x1c05da){_0x4c564d=_0x1c05da[_0x5567('0x31')];if(!_0x285f79['query'][_0x5567('0x50')](_0x5567('0x51'))){_0x5627c7[_0x5567('0x14')]=qs[_0x5567('0x14')](_0x285f79['query'][_0x5567('0x14')]);_0x5627c7[_0x5567('0x12')]=qs[_0x5567('0x12')](_0x285f79['query'][_0x5567('0x12')]);}return _0x3c630d['getTeams'](_0x5627c7);}})['then'](function(_0x5dc5b4){if(_0x5dc5b4){return _0x5dc5b4?{'count':_0x4c564d,'rows':_0x5dc5b4}:null;}})[_0x5567('0x19')](respondWithResult(_0x3654ab,null))[_0x5567('0x2a')](handleError(_0x3654ab,null));};exports[_0x5567('0x52')]=function(_0x4f06a2,_0x5136bf){var _0x8219d3=_0x4f06a2[_0x5567('0x37')][_0x5567('0x53')];return db[_0x5567('0x54')][_0x5567('0x28')]({'where':{'id':_0x8219d3},'attributes':['id'],'include':[{'model':db[_0x5567('0x46')],'as':_0x5567('0x55'),'attributes':['id',_0x5567('0x1f'),_0x5567('0x56'),_0x5567('0x57'),_0x5567('0x58')],'raw':!![]}]})['then'](function(_0x32ddd3){if(_0x32ddd3){var _0x5aea61=_['flatMap'](_0x32ddd3,function(_0x6cfab1){var _0x3560d7=_0x6cfab1['get']({'plain':!![]});return _0x3560d7['Agents'];});return db['OpenchannelQueue'][_0x5567('0x35')]({'where':{'id':_0x4f06a2[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](function(_0xa4ddbe){return db[_0x5567('0x59')][_0x5567('0x5a')](function(_0x13206b){return _0xa4ddbe[_0x5567('0x52')](_0x8219d3,{'transaction':_0x13206b})[_0x5567('0x19')](function(){return BPromise['each'](_0x5aea61,function(_0x2338ea){return db[_0x5567('0x41')][_0x5567('0x5b')]({'where':{'UserId':_0x2338ea['id'],'OpenchannelQueueId':_0x4f06a2[_0x5567('0x3d')]['id']},'transaction':_0x13206b});});})['then'](function(){_0x5aea61[_0x5567('0x5c')](function(_0x5421d8){socket[_0x5567('0x5d')]('userOpenchannelQueue:save',{'UserId':_0x5421d8['id'],'OpenchannelQueueId':_0xa4ddbe['id']});});});});});}})[_0x5567('0x19')](respondWithStatusCode(_0x5136bf,null))['catch'](handleError(_0x5136bf,null));};exports['removeTeams']=function(_0x543716,_0x6a63aa){return db[_0x5567('0x54')][_0x5567('0x28')]({'where':{'id':_0x543716[_0x5567('0x27')][_0x5567('0x53')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5567('0x55'),'attributes':['id'],'raw':!![]}]})[_0x5567('0x19')](handleEntityNotFound(_0x6a63aa,null))[_0x5567('0x19')](function(_0x429436){var _0x2d6823=_['map'](_0x429436,'id');var _0x12ddc=[];var _0x38b70c=[];var _0x458a70=squel[_0x5567('0x5e')]();_0x458a70[_0x5567('0x5f')]('tq.TeamId')[_0x5567('0x60')](_0x5567('0x61'),'tq')['join'](_0x5567('0x62'),'ut',_0x5567('0x63'))[_0x5567('0x42')](_0x5567('0x64'),_0x543716[_0x5567('0x3d')]['id']);for(var _0x46da34=0x0;_0x46da34<_0x429436[_0x5567('0x31')];_0x46da34+=0x1){let _0x34ddfc=_0x429436[_0x46da34];for(var _0x376935=0x0;_0x376935<_0x34ddfc[_0x5567('0x55')][_0x5567('0x31')];_0x376935+=0x1){let _0x4e9a23=_0x34ddfc[_0x5567('0x55')][_0x376935];var _0x18aaa9=_0x458a70[_0x5567('0x65')]();_0x18aaa9[_0x5567('0x42')](_0x5567('0x66'),_0x4e9a23['id']);_0x38b70c['push'](db[_0x5567('0x59')][_0x5567('0x27')](_0x18aaa9[_0x5567('0x67')](),{'type':db[_0x5567('0x59')][_0x5567('0x68')][_0x5567('0x69')]})[_0x5567('0x19')](function(_0x2a6f3a){if(_0x2a6f3a['length']===0x1){return _0x4e9a23['id'];}else{var _0x47c734=_[_0x5567('0x6a')](_[_0x5567('0x22')](_0x2a6f3a,'TeamId'),function(_0x25ac20){return _['includes'](_0x2d6823,_0x25ac20);});if(_0x47c734){return _0x4e9a23['id'];}}}));}}return BPromise[_0x5567('0x6b')](_0x38b70c)[_0x5567('0x19')](function(_0x112aad){_0x12ddc=_(_0x12ddc)['union'](_0x112aad)[_0x5567('0x6c')]()[_0x5567('0x6d')]();return db[_0x5567('0x23')][_0x5567('0x35')]({'where':{'id':_0x543716[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](function(_0xf2a02d){return db[_0x5567('0x59')][_0x5567('0x5a')](function(_0x5195d7){return _0xf2a02d[_0x5567('0x6e')](_0x543716[_0x5567('0x27')]['ids'],{'transaction':_0x5195d7})[_0x5567('0x19')](function(){if(!_[_0x5567('0x6f')](_0x12ddc)){return _0xf2a02d[_0x5567('0x70')](_0x12ddc,{'transaction':_0x5195d7});}})[_0x5567('0x19')](function(){_0x12ddc[_0x5567('0x5c')](function(_0x1c1420){socket[_0x5567('0x5d')](_0x5567('0x71'),{'UserId':_0x1c1420,'OpenchannelQueueId':_0xf2a02d['id']});});});});});});})[_0x5567('0x19')](respondWithStatusCode(_0x6a63aa,null))['catch'](handleError(_0x6a63aa,null));};exports[_0x5567('0x72')]=function(_0x201498,_0xa10441){return db[_0x5567('0x23')]['find']({'where':{'id':_0x201498[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](handleEntityNotFound(_0xa10441,null))['then'](function(_0x3acf95){if(_0x3acf95){return _0x3acf95[_0x5567('0x72')](_0x201498[_0x5567('0x37')]['ids'],_[_0x5567('0x73')](_0x201498[_0x5567('0x37')],[_0x5567('0x53'),'id'])||{})[_0x5567('0x74')](function(_0x1f3aae){for(var _0x191d45=0x0;_0x191d45<_0x201498[_0x5567('0x37')]['ids'][_0x5567('0x31')];_0x191d45+=0x1){socket[_0x5567('0x5d')](_0x5567('0x75'),{'UserId':Number(_0x201498[_0x5567('0x37')][_0x5567('0x53')][_0x191d45]),'OpenchannelQueueId':Number(_0x201498[_0x5567('0x3d')]['id'])});}return _0x1f3aae;});}})[_0x5567('0x19')](respondWithResult(_0xa10441,null))['catch'](handleError(_0xa10441,null));};exports[_0x5567('0x70')]=function(_0x201221,_0x187ca9){return db[_0x5567('0x23')][_0x5567('0x35')]({'where':{'id':_0x201221[_0x5567('0x3d')]['id']}})['then'](handleEntityNotFound(_0x187ca9,null))['then'](function(_0x4aee57){if(_0x4aee57){return _0x4aee57[_0x5567('0x70')](_0x201221[_0x5567('0x27')]['ids'])[_0x5567('0x19')](function(){if(_[_0x5567('0x76')](_0x201221[_0x5567('0x27')][_0x5567('0x53')])){for(var _0x1ac454=0x0;_0x1ac454<_0x201221[_0x5567('0x27')][_0x5567('0x53')][_0x5567('0x31')];_0x1ac454+=0x1){socket[_0x5567('0x5d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x201221[_0x5567('0x27')]['ids'][_0x1ac454]),'OpenchannelQueueId':Number(_0x201221['params']['id'])});}}else{socket[_0x5567('0x5d')](_0x5567('0x71'),{'UserId':Number(_0x201221[_0x5567('0x27')][_0x5567('0x53')]),'OpenchannelQueueId':Number(_0x201221[_0x5567('0x3d')]['id'])});}});}})['then'](respondWithStatusCode(_0x187ca9,null))[_0x5567('0x2a')](handleError(_0x187ca9,null));};exports['getAgents']=function(_0x1582b0,_0x4897aa){var _0x99c519={};var _0x7d87aa={};var _0x238857;var _0x524dad;return db[_0x5567('0x23')][_0x5567('0x40')]({'where':{'id':_0x1582b0[_0x5567('0x3d')]['id']}})[_0x5567('0x19')](handleEntityNotFound(_0x4897aa,null))[_0x5567('0x19')](function(_0x37fd7b){if(_0x37fd7b){_0x238857=_0x37fd7b;_0x7d87aa['model']=_[_0x5567('0x2c')](db[_0x5567('0x46')]['rawAttributes']);_0x7d87aa[_0x5567('0x27')]=_[_0x5567('0x2c')](_0x1582b0[_0x5567('0x27')]);_0x7d87aa[_0x5567('0x2d')]=_[_0x5567('0x2e')](_0x7d87aa[_0x5567('0x2b')],_0x7d87aa[_0x5567('0x27')]);_0x99c519[_0x5567('0x2f')]=_['intersection'](_0x7d87aa['model'],qs['fields'](_0x1582b0[_0x5567('0x27')]['fields']));_0x99c519[_0x5567('0x2f')]=_0x99c519['attributes']['length']?_0x99c519[_0x5567('0x2f')]:_0x7d87aa[_0x5567('0x2b')];_0x99c519[_0x5567('0x77')]=qs['sort'](_0x1582b0[_0x5567('0x27')][_0x5567('0x4f')]);_0x99c519[_0x5567('0x42')]=qs['filters'](_['pick'](_0x1582b0[_0x5567('0x27')],_0x7d87aa[_0x5567('0x2d')]));if(_0x1582b0['query'][_0x5567('0x45')]){_0x99c519[_0x5567('0x42')]=_['merge'](_0x99c519['where'],{'$or':_[_0x5567('0x22')](_0x99c519[_0x5567('0x2f')],function(_0xf83a1f){var _0x422be1={};_0x422be1[_0xf83a1f]={'$like':'%'+_0x1582b0[_0x5567('0x27')][_0x5567('0x45')]+'%'};return _0x422be1;})});}_0x99c519=_[_0x5567('0x33')]({},_0x99c519,_0x1582b0[_0x5567('0x34')]);return _0x238857['getAgents'](_0x99c519);}})[_0x5567('0x19')](function(_0x1ac618){if(_0x1ac618){_0x524dad=_0x1ac618[_0x5567('0x31')];if(!_0x1582b0['query'][_0x5567('0x50')]('nolimit')){_0x99c519['limit']=qs[_0x5567('0x14')](_0x1582b0[_0x5567('0x27')]['limit']);_0x99c519[_0x5567('0x12')]=qs[_0x5567('0x12')](_0x1582b0[_0x5567('0x27')]['offset']);}return _0x238857[_0x5567('0x78')](_0x99c519);}})[_0x5567('0x19')](function(_0x5833e7){if(_0x5833e7){return _0x5833e7?{'count':_0x524dad,'rows':_0x5833e7}:null;}})[_0x5567('0x19')](respondWithResult(_0x4897aa,null))[_0x5567('0x2a')](handleError(_0x4897aa,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 5bc93fb..178e81d 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 _0x3f84=['events','setMaxListeners','save','update','remove','hook','exports'];(function(_0x4b3b89,_0xba1fc7){var _0x54ca72=function(_0xda865f){while(--_0xda865f){_0x4b3b89['push'](_0x4b3b89['shift']());}};_0x54ca72(++_0xba1fc7);}(_0x3f84,0x1c0));var _0x43f8=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x3f84[_0x5e3a45];return _0x13419f;};'use strict';var EventEmitter=require(_0x43f8('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x43f8('0x1')](0x0);var events={'afterCreate':_0x43f8('0x2'),'afterUpdate':_0x43f8('0x3'),'afterDestroy':_0x43f8('0x4')};function emitEvent(_0x2f9f37){return function(_0x4a235c,_0x2ca016,_0x563ae6){OpenchannelQueueEvents['emit'](_0x2f9f37+':'+_0x4a235c['id'],_0x4a235c);OpenchannelQueueEvents['emit'](_0x2f9f37,_0x4a235c);_0x563ae6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x43f8('0x5')](e,emitEvent(event));}}module[_0x43f8('0x6')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x412d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x385253,_0x8729a8){var _0x2bb66e=function(_0x353aad){while(--_0x353aad){_0x385253['push'](_0x385253['shift']());}};_0x2bb66e(++_0x8729a8);}(_0x412d,0xff));var _0xd412=function(_0x1f9b90,_0x210055){_0x1f9b90=_0x1f9b90-0x0;var _0x271792=_0x412d[_0x1f9b90];return _0x271792;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xd412('0x0'))['db'][_0xd412('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd412('0x2')](0x0);var events={'afterCreate':_0xd412('0x3'),'afterUpdate':_0xd412('0x4'),'afterDestroy':_0xd412('0x5')};function emitEvent(_0x33303f){return function(_0x28eb18,_0x290340,_0xdafa35){OpenchannelQueueEvents[_0xd412('0x6')](_0x33303f+':'+_0x28eb18['id'],_0x28eb18);OpenchannelQueueEvents['emit'](_0x33303f,_0x28eb18);_0xdafa35(null);};}for(var e in events){if(events[_0xd412('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd412('0x8')](e,emitEvent(event));}}module[_0xd412('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c6450cb..7cd4d66 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 _0x6243=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger'];(function(_0x129480,_0x1fba3b){var _0x571cb5=function(_0x363d78){while(--_0x363d78){_0x129480['push'](_0x129480['shift']());}};_0x571cb5(++_0x1fba3b);}(_0x6243,0xf9));var _0x3624=function(_0x3afb7b,_0x5861e9){_0x3afb7b=_0x3afb7b-0x0;var _0x5676b0=_0x6243[_0x3afb7b];return _0x5676b0;};'use strict';var _=require(_0x3624('0x0'));var util=require(_0x3624('0x1'));var logger=require(_0x3624('0x2'))(_0x3624('0x3'));var moment=require(_0x3624('0x4'));var BPromise=require(_0x3624('0x5'));var rp=require(_0x3624('0x6'));var fs=require('fs');var path=require(_0x3624('0x7'));var rimraf=require(_0x3624('0x8'));var config=require(_0x3624('0x9'));var attributes=require(_0x3624('0xa'));module[_0x3624('0xb')]=function(_0x591dc1,_0x38122d){return _0x591dc1[_0x3624('0xc')]('OpenchannelQueue',attributes,{'tableName':_0x3624('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe605=['moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0x6fc70,_0x223772){var _0x2ebf94=function(_0x2e83c4){while(--_0x2e83c4){_0x6fc70['push'](_0x6fc70['shift']());}};_0x2ebf94(++_0x223772);}(_0xe605,0x188));var _0x5e60=function(_0x10fdc4,_0x326c74){_0x10fdc4=_0x10fdc4-0x0;var _0x561d99=_0xe605[_0x10fdc4];return _0x561d99;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var logger=require(_0x5e60('0x2'))(_0x5e60('0x3'));var moment=require(_0x5e60('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e60('0x5'));var rimraf=require(_0x5e60('0x6'));var config=require(_0x5e60('0x7'));var attributes=require(_0x5e60('0x8'));module[_0x5e60('0x9')]=function(_0x122a0a,_0x47afed){return _0x122a0a['define'](_0x5e60('0xa'),attributes,{'tableName':_0x5e60('0xb'),'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 a64db1d..0258f2b 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 _0x8039=['include','map','model','then','GetOpenchannelQueue','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','error','message','request\x20sent','catch','OpenchannelQueue','findAll','options','raw','where','attributes','limit'];(function(_0x102ca6,_0x1c8991){var _0x180166=function(_0x382a11){while(--_0x382a11){_0x102ca6['push'](_0x102ca6['shift']());}};_0x180166(++_0x1c8991);}(_0x8039,0x140));var _0x9803=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x8039[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0x9803('0x0'));var util=require(_0x9803('0x1'));var moment=require(_0x9803('0x2'));var BPromise=require(_0x9803('0x3'));var rs=require(_0x9803('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9803('0x5'))('rpc');var config=require(_0x9803('0x6'));var jayson=require(_0x9803('0x7'));var client=jayson[_0x9803('0x8')][_0x9803('0x9')]({'port':0x232a});config[_0x9803('0xa')]=_[_0x9803('0xb')](config[_0x9803('0xa')],{'host':_0x9803('0xc'),'port':0x18eb});var socket=require(_0x9803('0xd'))(new Redis(config['redis']));require(_0x9803('0xe'))[_0x9803('0xf')](socket);function respondWithRpcPromise(_0x36e84b,_0xe7efaf,_0x582343){return new BPromise(function(_0x282d13,_0xc1787){return client[_0x9803('0x10')](_0x36e84b,_0x582343)['then'](function(_0x3e9ae8){logger[_0x9803('0x11')](_0x9803('0x12'),_0xe7efaf,'request\x20sent');logger[_0x9803('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xe7efaf,'request\x20sent',JSON['stringify'](_0x3e9ae8));if(_0x3e9ae8[_0x9803('0x14')]){if(_0x3e9ae8[_0x9803('0x14')]['code']===0x1f4){logger[_0x9803('0x14')](_0x9803('0x12'),_0xe7efaf,_0x3e9ae8['error'][_0x9803('0x15')]);return _0xc1787(_0x3e9ae8[_0x9803('0x14')][_0x9803('0x15')]);}logger['error'](_0x9803('0x12'),_0xe7efaf,_0x3e9ae8['error'][_0x9803('0x15')]);return _0x282d13(_0x3e9ae8[_0x9803('0x14')][_0x9803('0x15')]);}else{logger[_0x9803('0x11')](_0x9803('0x12'),_0xe7efaf,_0x9803('0x16'));_0x282d13(_0x3e9ae8['result']['message']);}})[_0x9803('0x17')](function(_0xae0d0f){logger[_0x9803('0x14')](_0x9803('0x12'),_0xe7efaf,_0xae0d0f);_0xc1787(_0xae0d0f);});});}exports['GetOpenchannelQueue']=function(_0x4b04fe){var _0xdef3f=this;return new Promise(function(_0x1be032,_0xe71781){return db[_0x9803('0x18')][_0x9803('0x19')]({'raw':_0x4b04fe[_0x9803('0x1a')]?_0x4b04fe[_0x9803('0x1a')][_0x9803('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b04fe[_0x9803('0x1a')]?_0x4b04fe[_0x9803('0x1a')][_0x9803('0x1c')]||null:null,'attributes':_0x4b04fe[_0x9803('0x1a')]?_0x4b04fe[_0x9803('0x1a')][_0x9803('0x1d')]||null:null,'limit':_0x4b04fe[_0x9803('0x1a')]?_0x4b04fe[_0x9803('0x1a')][_0x9803('0x1e')]||null:null,'include':_0x4b04fe[_0x9803('0x1a')]?_0x4b04fe[_0x9803('0x1a')][_0x9803('0x1f')]?_[_0x9803('0x20')](_0x4b04fe['options']['include'],function(_0x5e0538){return{'model':db[_0x5e0538['model']],'as':_0x5e0538['as'],'attributes':_0x5e0538[_0x9803('0x1d')],'include':_0x5e0538[_0x9803('0x1f')]?_[_0x9803('0x20')](_0x5e0538[_0x9803('0x1f')],function(_0x3cd150){return{'model':db[_0x3cd150['model']],'as':_0x3cd150['as'],'attributes':_0x3cd150[_0x9803('0x1d')],'include':_0x3cd150[_0x9803('0x1f')]?_[_0x9803('0x20')](_0x3cd150[_0x9803('0x1f')],function(_0x240a5b){return{'model':db[_0x240a5b[_0x9803('0x21')]],'as':_0x240a5b['as'],'attributes':_0x240a5b[_0x9803('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9803('0x22')](function(_0x2b5a59){logger[_0x9803('0x11')](_0x9803('0x23'),_0x4b04fe);logger[_0x9803('0x13')](_0x9803('0x23'),_0x4b04fe,JSON[_0x9803('0x24')](_0x2b5a59));_0x1be032(_0x2b5a59);})[_0x9803('0x17')](function(_0x1ff318){logger[_0x9803('0x14')]('GetOpenchannelQueue',_0x1ff318['message'],_0x4b04fe);_0xe71781(_0xdef3f['error'](0x1f4,_0x1ff318['message']));});});};exports['ShowOpenchannelQueue']=function(_0x48458c){var _0x286e43=this;return new Promise(function(_0x252f6c,_0x126c4e){return db['OpenchannelQueue'][_0x9803('0x25')]({'raw':_0x48458c['options']?_0x48458c[_0x9803('0x1a')][_0x9803('0x1b')]===undefined?!![]:![]:!![],'where':_0x48458c[_0x9803('0x1a')]?_0x48458c[_0x9803('0x1a')][_0x9803('0x1c')]||null:null,'attributes':_0x48458c[_0x9803('0x1a')]?_0x48458c[_0x9803('0x1a')][_0x9803('0x1d')]||null:null,'include':_0x48458c['options']?_0x48458c['options'][_0x9803('0x1f')]?_[_0x9803('0x20')](_0x48458c[_0x9803('0x1a')][_0x9803('0x1f')],function(_0xa88e61){return{'model':db[_0xa88e61[_0x9803('0x21')]],'as':_0xa88e61['as'],'attributes':_0xa88e61[_0x9803('0x1d')],'include':_0xa88e61[_0x9803('0x1f')]?_['map'](_0xa88e61[_0x9803('0x1f')],function(_0x2779f3){return{'model':db[_0x2779f3[_0x9803('0x21')]],'as':_0x2779f3['as'],'attributes':_0x2779f3['attributes'],'include':_0x2779f3[_0x9803('0x1f')]?_[_0x9803('0x20')](_0x2779f3['include'],function(_0x8a7102){return{'model':db[_0x8a7102[_0x9803('0x21')]],'as':_0x8a7102['as'],'attributes':_0x8a7102[_0x9803('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9803('0x22')](function(_0x3e98eb){logger[_0x9803('0x11')](_0x9803('0x26'),_0x48458c);logger[_0x9803('0x13')](_0x9803('0x26'),_0x48458c,JSON['stringify'](_0x3e98eb));_0x252f6c(_0x3e98eb);})[_0x9803('0x17')](function(_0x3844cd){logger[_0x9803('0x14')]('ShowOpenchannelQueue',_0x3844cd['message'],_0x48458c);_0x126c4e(_0x286e43[_0x9803('0x14')](0x1f4,_0x3844cd[_0x9803('0x15')]));});});}; \ No newline at end of file +var _0x350e=['raw','where','limit','include','model','attributes','map','then','debug','stringify','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../config/utils','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x350e,0x1df));var _0xe350=function(_0x421c50,_0x2eea2b){_0x421c50=_0x421c50-0x0;var _0x43b3f0=_0x350e[_0x421c50];return _0x43b3f0;};'use strict';var _=require(_0xe350('0x0'));var util=require(_0xe350('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe350('0x2'));var fs=require('fs');var Redis=require(_0xe350('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe350('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xe350('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xe350('0x6')]=_[_0xe350('0x7')](config[_0xe350('0x6')],{'host':_0xe350('0x8'),'port':0x18eb});var socket=require(_0xe350('0x9'))(new Redis(config[_0xe350('0x6')]));require(_0xe350('0xa'))[_0xe350('0xb')](socket);function respondWithRpcPromise(_0x51f0c6,_0x4289c4,_0x843652){return new BPromise(function(_0x1cc5e3,_0x145a19){return client['request'](_0x51f0c6,_0x843652)['then'](function(_0x5ee3fb){logger[_0xe350('0xc')](_0xe350('0xd'),_0x4289c4,_0xe350('0xe'));logger['debug'](_0xe350('0xf'),_0x4289c4,'request\x20sent',JSON['stringify'](_0x5ee3fb));if(_0x5ee3fb[_0xe350('0x10')]){if(_0x5ee3fb[_0xe350('0x10')][_0xe350('0x11')]===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4289c4,_0x5ee3fb['error'][_0xe350('0x12')]);return _0x145a19(_0x5ee3fb[_0xe350('0x10')]['message']);}logger['error'](_0xe350('0xd'),_0x4289c4,_0x5ee3fb[_0xe350('0x10')][_0xe350('0x12')]);return _0x1cc5e3(_0x5ee3fb['error'][_0xe350('0x12')]);}else{logger[_0xe350('0xc')](_0xe350('0xd'),_0x4289c4,'request\x20sent');_0x1cc5e3(_0x5ee3fb[_0xe350('0x13')][_0xe350('0x12')]);}})[_0xe350('0x14')](function(_0x2addab){logger[_0xe350('0x10')](_0xe350('0xd'),_0x4289c4,_0x2addab);_0x145a19(_0x2addab);});});}exports[_0xe350('0x15')]=function(_0x331fe5){var _0x53b42d=this;return new Promise(function(_0x71bcf9,_0x3ac123){return db[_0xe350('0x16')][_0xe350('0x17')]({'raw':_0x331fe5['options']?_0x331fe5[_0xe350('0x18')][_0xe350('0x19')]===undefined?!![]:![]:!![],'where':_0x331fe5[_0xe350('0x18')]?_0x331fe5[_0xe350('0x18')][_0xe350('0x1a')]||null:null,'attributes':_0x331fe5[_0xe350('0x18')]?_0x331fe5[_0xe350('0x18')]['attributes']||null:null,'limit':_0x331fe5[_0xe350('0x18')]?_0x331fe5['options'][_0xe350('0x1b')]||null:null,'include':_0x331fe5[_0xe350('0x18')]?_0x331fe5[_0xe350('0x18')][_0xe350('0x1c')]?_['map'](_0x331fe5['options'][_0xe350('0x1c')],function(_0x93d6c5){return{'model':db[_0x93d6c5[_0xe350('0x1d')]],'as':_0x93d6c5['as'],'attributes':_0x93d6c5[_0xe350('0x1e')],'include':_0x93d6c5[_0xe350('0x1c')]?_[_0xe350('0x1f')](_0x93d6c5[_0xe350('0x1c')],function(_0x420fc0){return{'model':db[_0x420fc0[_0xe350('0x1d')]],'as':_0x420fc0['as'],'attributes':_0x420fc0[_0xe350('0x1e')],'include':_0x420fc0['include']?_[_0xe350('0x1f')](_0x420fc0[_0xe350('0x1c')],function(_0x2fc935){return{'model':db[_0x2fc935[_0xe350('0x1d')]],'as':_0x2fc935['as'],'attributes':_0x2fc935['attributes']};}):[]};}):[]};}):[]:[]})[_0xe350('0x20')](function(_0x5efcf7){logger[_0xe350('0xc')](_0xe350('0x15'),_0x331fe5);logger[_0xe350('0x21')](_0xe350('0x15'),_0x331fe5,JSON[_0xe350('0x22')](_0x5efcf7));_0x71bcf9(_0x5efcf7);})['catch'](function(_0x59da9e){logger[_0xe350('0x10')](_0xe350('0x15'),_0x59da9e[_0xe350('0x12')],_0x331fe5);_0x3ac123(_0x53b42d[_0xe350('0x10')](0x1f4,_0x59da9e['message']));});});};exports[_0xe350('0x23')]=function(_0x1b2f26){var _0x2a5c75=this;return new Promise(function(_0x1e0196,_0x5ec0e9){return db[_0xe350('0x16')]['find']({'raw':_0x1b2f26[_0xe350('0x18')]?_0x1b2f26[_0xe350('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1b2f26['options']?_0x1b2f26['options']['where']||null:null,'attributes':_0x1b2f26[_0xe350('0x18')]?_0x1b2f26[_0xe350('0x18')][_0xe350('0x1e')]||null:null,'include':_0x1b2f26[_0xe350('0x18')]?_0x1b2f26['options'][_0xe350('0x1c')]?_['map'](_0x1b2f26[_0xe350('0x18')][_0xe350('0x1c')],function(_0x22be30){return{'model':db[_0x22be30[_0xe350('0x1d')]],'as':_0x22be30['as'],'attributes':_0x22be30[_0xe350('0x1e')],'include':_0x22be30[_0xe350('0x1c')]?_[_0xe350('0x1f')](_0x22be30[_0xe350('0x1c')],function(_0x10246e){return{'model':db[_0x10246e[_0xe350('0x1d')]],'as':_0x10246e['as'],'attributes':_0x10246e['attributes'],'include':_0x10246e[_0xe350('0x1c')]?_['map'](_0x10246e[_0xe350('0x1c')],function(_0x591340){return{'model':db[_0x591340[_0xe350('0x1d')]],'as':_0x591340['as'],'attributes':_0x591340[_0xe350('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe350('0x20')](function(_0x312d1b){logger['info'](_0xe350('0x23'),_0x1b2f26);logger[_0xe350('0x21')](_0xe350('0x23'),_0x1b2f26,JSON[_0xe350('0x22')](_0x312d1b));_0x1e0196(_0x312d1b);})[_0xe350('0x14')](function(_0x599c69){logger['error'](_0xe350('0x23'),_0x599c69[_0xe350('0x12')],_0x1b2f26);_0x5ec0e9(_0x2a5c75[_0xe350('0x10')](0x1f4,_0x599c69[_0xe350('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 8d600ac..096b860 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 _0xdb97=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3c5a42,_0x47056e){var _0x22c44f=function(_0x4531e3){while(--_0x4531e3){_0x3c5a42['push'](_0x3c5a42['shift']());}};_0x22c44f(++_0x47056e);}(_0xdb97,0xfe));var _0x7db9=function(_0x14c811,_0x480998){_0x14c811=_0x14c811-0x0;var _0x41e935=_0xdb97[_0x14c811];return _0x41e935;};'use strict';var OpenchannelQueueEvents=require(_0x7db9('0x0'));var events=[_0x7db9('0x1'),_0x7db9('0x2'),_0x7db9('0x3')];function createListener(_0x47e94e,_0x30ce71){return function(_0x4ee1fc){_0x30ce71[_0x7db9('0x4')](_0x47e94e,_0x4ee1fc);};}function removeListener(_0x40c3a5,_0xf707f4){return function(){OpenchannelQueueEvents[_0x7db9('0x5')](_0x40c3a5,_0xf707f4);};}exports[_0x7db9('0x6')]=function(_0x28d967){for(var _0x1a9640=0x0,_0x2cc2aa=events[_0x7db9('0x7')];_0x1a9640<_0x2cc2aa;_0x1a9640++){var _0x366355=events[_0x1a9640];var _0x40a037=createListener(_0x7db9('0x8')+_0x366355,_0x28d967);OpenchannelQueueEvents['on'](_0x366355,_0x40a037);}}; \ No newline at end of file +var _0xe8b1=['openchannelQueue:','./openchannelQueue.events','remove','update','removeListener','register'];(function(_0x4d03d6,_0x438a06){var _0x22752e=function(_0x1b2894){while(--_0x1b2894){_0x4d03d6['push'](_0x4d03d6['shift']());}};_0x22752e(++_0x438a06);}(_0xe8b1,0xf7));var _0x1e8b=function(_0x1b664d,_0x1d8695){_0x1b664d=_0x1b664d-0x0;var _0x43af6b=_0xe8b1[_0x1b664d];return _0x43af6b;};'use strict';var OpenchannelQueueEvents=require(_0x1e8b('0x0'));var events=['save',_0x1e8b('0x1'),_0x1e8b('0x2')];function createListener(_0x1beb47,_0x11abae){return function(_0x385e30){_0x11abae['emit'](_0x1beb47,_0x385e30);};}function removeListener(_0x5d3b90,_0x5c2c9f){return function(){OpenchannelQueueEvents[_0x1e8b('0x3')](_0x5d3b90,_0x5c2c9f);};}exports[_0x1e8b('0x4')]=function(_0x5cc2b7){for(var _0x4c57d1=0x0,_0xa0a000=events['length'];_0x4c57d1<_0xa0a000;_0x4c57d1++){var _0x165b61=events[_0x4c57d1];var _0x54e7cd=createListener(_0x1e8b('0x5')+_0x165b61,_0x5cc2b7);OpenchannelQueueEvents['on'](_0x165b61,_0x54e7cd);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 8edcd86..62baefc 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 _0x705c=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x705c,0xae));var _0xc705=function(_0x10994f,_0x5a90b0){_0x10994f=_0x10994f-0x0;var _0x41362f=_0x705c[_0x10994f];return _0x41362f;};'use strict';var multer=require('multer');var util=require(_0xc705('0x0'));var path=require(_0xc705('0x1'));var timeout=require(_0xc705('0x2'));var express=require(_0xc705('0x3'));var router=express[_0xc705('0x4')]();var fs_extra=require(_0xc705('0x5'));var auth=require(_0xc705('0x6'));var interaction=require(_0xc705('0x7'));var config=require(_0xc705('0x8'));var controller=require(_0xc705('0x9'));router[_0xc705('0xa')]('/',auth[_0xc705('0xb')](),controller['index']);router[_0xc705('0xa')](_0xc705('0xc'),auth[_0xc705('0xb')](),controller[_0xc705('0xd')]);router[_0xc705('0xa')](_0xc705('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xc705('0xf')]('/',auth[_0xc705('0xb')](),controller[_0xc705('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xc705('0x11')](_0xc705('0xe'),auth[_0xc705('0xb')](),controller[_0xc705('0x12')]);module[_0xc705('0x13')]=router; \ No newline at end of file +var _0x81e9=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','show','post','put','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x4e3843,_0x571529){var _0x2537db=function(_0x853ee9){while(--_0x853ee9){_0x4e3843['push'](_0x4e3843['shift']());}};_0x2537db(++_0x571529);}(_0x81e9,0x1f4));var _0x981e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x81e9[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x981e('0x0'));var util=require('util');var path=require(_0x981e('0x1'));var timeout=require(_0x981e('0x2'));var express=require('express');var router=express[_0x981e('0x3')]();var fs_extra=require(_0x981e('0x4'));var auth=require(_0x981e('0x5'));var interaction=require(_0x981e('0x6'));var config=require(_0x981e('0x7'));var controller=require(_0x981e('0x8'));router[_0x981e('0x9')]('/',auth[_0x981e('0xa')](),controller[_0x981e('0xb')]);router[_0x981e('0x9')](_0x981e('0xc'),auth[_0x981e('0xa')](),controller['describe']);router[_0x981e('0x9')]('/:id',auth[_0x981e('0xa')](),controller[_0x981e('0xd')]);router[_0x981e('0xe')]('/',auth[_0x981e('0xa')](),controller['create']);router[_0x981e('0xf')]('/:id',auth[_0x981e('0xa')](),controller['update']);router[_0x981e('0x10')]('/:id',auth[_0x981e('0xa')](),controller[_0x981e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index cabe6dc..8595f11 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 _0x8edf=['exports','STRING','DATE','moment'];(function(_0xdc2b14,_0x45a49c){var _0x5549e5=function(_0x58210d){while(--_0x58210d){_0xdc2b14['push'](_0xdc2b14['shift']());}};_0x5549e5(++_0x45a49c);}(_0x8edf,0xa3));var _0xf8ed=function(_0x31906e,_0x3bcb9d){_0x31906e=_0x31906e-0x0;var _0xd7353=_0x8edf[_0x31906e];return _0xd7353;};'use strict';var moment=require(_0xf8ed('0x0'));var Sequelize=require('sequelize');module[_0xf8ed('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xf8ed('0x2')]},'joinAt':{'type':Sequelize[_0xf8ed('0x3')]},'leaveAt':{'type':Sequelize[_0xf8ed('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf8ed('0x3')]},'reason':{'type':Sequelize[_0xf8ed('0x2')]}}; \ No newline at end of file +var _0x4012=['STRING','DATE','moment','sequelize','exports'];(function(_0x426de4,_0x4950be){var _0x2d19cd=function(_0x17e8a7){while(--_0x17e8a7){_0x426de4['push'](_0x426de4['shift']());}};_0x2d19cd(++_0x4950be);}(_0x4012,0x16a));var _0x2401=function(_0x5c06d8,_0x3c3db3){_0x5c06d8=_0x5c06d8-0x0;var _0x7c83d7=_0x4012[_0x5c06d8];return _0x7c83d7;};'use strict';var moment=require(_0x2401('0x0'));var Sequelize=require(_0x2401('0x1'));module[_0x2401('0x2')]={'uniqueid':{'type':Sequelize[_0x2401('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2401('0x3')]},'joinAt':{'type':Sequelize[_0x2401('0x4')]},'leaveAt':{'type':Sequelize[_0x2401('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x2401('0x4')]},'reason':{'type':Sequelize[_0x2401('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1f29523..0a4fa31 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 _0x0c8a=['Content-Range','json','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x0c8a,0xbb));var _0xa0c8=function(_0x56f4c7,_0x165359){_0x56f4c7=_0x56f4c7-0x0;var _0x42e589=_0x0c8a[_0x56f4c7];return _0x42e589;};'use strict';var emlformat=require(_0xa0c8('0x0'));var rimraf=require(_0xa0c8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa0c8('0x2'));var BPromise=require(_0xa0c8('0x3'));var Mustache=require(_0xa0c8('0x4'));var util=require(_0xa0c8('0x5'));var path=require(_0xa0c8('0x6'));var sox=require(_0xa0c8('0x7'));var csv=require(_0xa0c8('0x8'));var ejs=require(_0xa0c8('0x9'));var fs=require('fs');var fs_extra=require(_0xa0c8('0xa'));var _=require(_0xa0c8('0xb'));var squel=require(_0xa0c8('0xc'));var crypto=require(_0xa0c8('0xd'));var jsforce=require(_0xa0c8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa0c8('0x8'));var querystring=require(_0xa0c8('0xf'));var Papa=require(_0xa0c8('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('../../config/license/hardware');var logger=require(_0xa0c8('0x11'))(_0xa0c8('0x12'));var utils=require(_0xa0c8('0x13'));var config=require(_0xa0c8('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3424b1,_0xda522){_0xda522=_0xda522||0xcc;return function(_0x162744){if(_0x162744){return _0x3424b1[_0xa0c8('0x15')](_0xda522);}return _0x3424b1[_0xa0c8('0x16')](_0xda522)[_0xa0c8('0x17')]();};}function respondWithResult(_0x25d62d,_0x1d88e8){_0x1d88e8=_0x1d88e8||0xc8;return function(_0x180bc1){if(_0x180bc1){return _0x25d62d['status'](_0x1d88e8)['json'](_0x180bc1);}};}function respondWithFilteredResult(_0x52163f,_0x37ed76){return function(_0x4d109d){if(_0x4d109d){var _0x35e343=typeof _0x37ed76[_0xa0c8('0x18')]==='undefined'&&typeof _0x37ed76[_0xa0c8('0x19')]===_0xa0c8('0x1a');var _0x38ddb1=_0x4d109d[_0xa0c8('0x1b')];var _0x12adc2=_0x35e343?0x0:_0x37ed76[_0xa0c8('0x18')];var _0xf9ec95=_0x35e343?_0x4d109d[_0xa0c8('0x1b')]:_0x37ed76[_0xa0c8('0x18')]+_0x37ed76[_0xa0c8('0x19')];var _0x4b4041;if(_0xf9ec95>=_0x38ddb1){_0xf9ec95=_0x38ddb1;_0x4b4041=0xc8;}else{_0x4b4041=0xce;}_0x52163f[_0xa0c8('0x16')](_0x4b4041);return _0x52163f[_0xa0c8('0x1c')](_0xa0c8('0x1d'),_0x12adc2+'-'+_0xf9ec95+'/'+_0x38ddb1)[_0xa0c8('0x1e')](_0x4d109d);}return null;};}function patchUpdates(_0x8812d4){return function(_0xa4893c){try{jsonpatch['apply'](_0xa4893c,_0x8812d4,!![]);}catch(_0x4b50bb){return BPromise[_0xa0c8('0x1f')](_0x4b50bb);}return _0xa4893c[_0xa0c8('0x20')]();};}function saveUpdates(_0x2fe101,_0x280575){return function(_0xad9528){if(_0xad9528){return _0xad9528[_0xa0c8('0x21')](_0x2fe101)[_0xa0c8('0x22')](function(_0x579a62){return _0x579a62;});}return null;};}function removeEntity(_0x4e30ab,_0x555318){return function(_0x2ce312){if(_0x2ce312){return _0x2ce312[_0xa0c8('0x23')]()[_0xa0c8('0x22')](function(){_0x4e30ab[_0xa0c8('0x16')](0xcc)[_0xa0c8('0x17')]();});}};}function handleEntityNotFound(_0x1ea90a,_0x4bd2f4){return function(_0xf2c28f){if(!_0xf2c28f){_0x1ea90a[_0xa0c8('0x15')](0x194);}return _0xf2c28f;};}function handleError(_0x150de5,_0x1fccda){_0x1fccda=_0x1fccda||0x1f4;return function(_0x5cd99b){logger['error'](_0x5cd99b['stack']);if(_0x5cd99b[_0xa0c8('0x24')]){delete _0x5cd99b[_0xa0c8('0x24')];}_0x150de5[_0xa0c8('0x16')](_0x1fccda)[_0xa0c8('0x25')](_0x5cd99b);};}exports[_0xa0c8('0x26')]=function(_0x6563e1,_0x16ba42){var _0x172535={},_0x442cce={},_0x26ebec={'count':0x0,'rows':[]};var _0x23acdf=_[_0xa0c8('0x27')](db['OpenchannelQueueReport'][_0xa0c8('0x28')],function(_0x5c73fd){return{'name':_0x5c73fd[_0xa0c8('0x29')],'type':_0x5c73fd['type'][_0xa0c8('0x2a')]};});_0x442cce[_0xa0c8('0x2b')]=_[_0xa0c8('0x27')](_0x23acdf,'name');_0x442cce['query']=_[_0xa0c8('0x2c')](_0x6563e1['query']);_0x442cce[_0xa0c8('0x2d')]=_[_0xa0c8('0x2e')](_0x442cce[_0xa0c8('0x2b')],_0x442cce[_0xa0c8('0x2f')]);_0x172535[_0xa0c8('0x30')]=_[_0xa0c8('0x2e')](_0x442cce[_0xa0c8('0x2b')],qs[_0xa0c8('0x31')](_0x6563e1[_0xa0c8('0x2f')]['fields']));_0x172535[_0xa0c8('0x30')]=_0x172535[_0xa0c8('0x30')][_0xa0c8('0x32')]?_0x172535[_0xa0c8('0x30')]:_0x442cce[_0xa0c8('0x2b')];if(!_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x33')]('nolimit')){_0x172535[_0xa0c8('0x19')]=qs[_0xa0c8('0x19')](_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x19')]);_0x172535[_0xa0c8('0x18')]=qs[_0xa0c8('0x18')](_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x18')]);}_0x172535[_0xa0c8('0x34')]=qs[_0xa0c8('0x35')](_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x35')]);_0x172535['where']=qs[_0xa0c8('0x2d')](_['pick'](_0x6563e1['query'],_0x442cce[_0xa0c8('0x2d')]),_0x23acdf);if(_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x36')]){_0x172535[_0xa0c8('0x37')]=_[_0xa0c8('0x38')](_0x172535[_0xa0c8('0x37')],{'$or':_[_0xa0c8('0x27')](_0x23acdf,function(_0x12b1fe){if(_0x12b1fe[_0xa0c8('0x39')]!==_0xa0c8('0x3a')){var _0x223132={};_0x223132[_0x12b1fe['name']]={'$like':'%'+_0x6563e1[_0xa0c8('0x2f')]['filter']+'%'};return _0x223132;}})});}_0x172535=_[_0xa0c8('0x38')]({},_0x172535,_0x6563e1[_0xa0c8('0x3b')]);var _0x71bbbf={'where':_0x172535['where']};return db[_0xa0c8('0x3c')][_0xa0c8('0x1b')](_0x71bbbf)['then'](function(_0x2f9f7b){_0x26ebec[_0xa0c8('0x1b')]=_0x2f9f7b;if(_0x6563e1[_0xa0c8('0x2f')][_0xa0c8('0x3d')]){_0x172535[_0xa0c8('0x3e')]=[{'all':!![]}];}return db[_0xa0c8('0x3c')][_0xa0c8('0x3f')](_0x172535);})[_0xa0c8('0x22')](function(_0x2b3ab8){_0x26ebec[_0xa0c8('0x40')]=_0x2b3ab8;return _0x26ebec;})[_0xa0c8('0x22')](respondWithFilteredResult(_0x16ba42,_0x172535))['catch'](handleError(_0x16ba42,null));};exports[_0xa0c8('0x41')]=function(_0x5c3a08,_0x128102){var _0xe9f424={'raw':!![],'where':{'id':_0x5c3a08[_0xa0c8('0x42')]['id']}},_0x1bb405={};_0x1bb405[_0xa0c8('0x2b')]=_[_0xa0c8('0x2c')](db['OpenchannelQueueReport']['rawAttributes']);_0x1bb405[_0xa0c8('0x2f')]=_[_0xa0c8('0x2c')](_0x5c3a08[_0xa0c8('0x2f')]);_0x1bb405[_0xa0c8('0x2d')]=_[_0xa0c8('0x2e')](_0x1bb405['model'],_0x1bb405[_0xa0c8('0x2f')]);_0xe9f424[_0xa0c8('0x30')]=_[_0xa0c8('0x2e')](_0x1bb405['model'],qs[_0xa0c8('0x31')](_0x5c3a08[_0xa0c8('0x2f')][_0xa0c8('0x31')]));_0xe9f424[_0xa0c8('0x30')]=_0xe9f424[_0xa0c8('0x30')][_0xa0c8('0x32')]?_0xe9f424[_0xa0c8('0x30')]:_0x1bb405[_0xa0c8('0x2b')];if(_0x5c3a08[_0xa0c8('0x2f')][_0xa0c8('0x3d')]){_0xe9f424[_0xa0c8('0x3e')]=[{'all':!![]}];}_0xe9f424=_[_0xa0c8('0x38')]({},_0xe9f424,_0x5c3a08[_0xa0c8('0x3b')]);return db['OpenchannelQueueReport'][_0xa0c8('0x43')](_0xe9f424)[_0xa0c8('0x22')](handleEntityNotFound(_0x128102,null))[_0xa0c8('0x22')](respondWithResult(_0x128102,null))['catch'](handleError(_0x128102,null));};exports[_0xa0c8('0x44')]=function(_0x1ed288,_0xb02541){return db['OpenchannelQueueReport'][_0xa0c8('0x44')](_0x1ed288[_0xa0c8('0x45')],{})[_0xa0c8('0x22')](respondWithResult(_0xb02541,0xc9))['catch'](handleError(_0xb02541,null));};exports[_0xa0c8('0x21')]=function(_0x226de1,_0x413212){if(_0x226de1['body']['id']){delete _0x226de1['body']['id'];}return db[_0xa0c8('0x3c')][_0xa0c8('0x43')]({'where':{'id':_0x226de1[_0xa0c8('0x42')]['id']}})[_0xa0c8('0x22')](handleEntityNotFound(_0x413212,null))['then'](saveUpdates(_0x226de1['body'],null))[_0xa0c8('0x22')](respondWithResult(_0x413212,null))[_0xa0c8('0x46')](handleError(_0x413212,null));};exports[_0xa0c8('0x23')]=function(_0x521111,_0x299017){return db['OpenchannelQueueReport'][_0xa0c8('0x43')]({'where':{'id':_0x521111[_0xa0c8('0x42')]['id']}})[_0xa0c8('0x22')](handleEntityNotFound(_0x299017,null))[_0xa0c8('0x22')](removeEntity(_0x299017,null))[_0xa0c8('0x46')](handleError(_0x299017,null));};exports[_0xa0c8('0x47')]=function(_0x582f24,_0x35e6a0){return db[_0xa0c8('0x3c')][_0xa0c8('0x47')]()[_0xa0c8('0x22')](respondWithResult(_0x35e6a0,null))[_0xa0c8('0x46')](handleError(_0x35e6a0,null));}; \ No newline at end of file +var _0xd5af=['then','destroy','error','stack','name','send','index','OpenchannelQueueReport','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','catch','params','keys','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update'];(function(_0x295853,_0x4da325){var _0x366e01=function(_0x4aee76){while(--_0x4aee76){_0x295853['push'](_0x295853['shift']());}};_0x366e01(++_0x4da325);}(_0xd5af,0x76));var _0xfd5a=function(_0x491a9c,_0x4fbb21){_0x491a9c=_0x491a9c-0x0;var _0x5e1fc4=_0xd5af[_0x491a9c];return _0x5e1fc4;};'use strict';var emlformat=require(_0xfd5a('0x0'));var rimraf=require(_0xfd5a('0x1'));var zipdir=require(_0xfd5a('0x2'));var jsonpatch=require(_0xfd5a('0x3'));var rp=require(_0xfd5a('0x4'));var moment=require(_0xfd5a('0x5'));var BPromise=require(_0xfd5a('0x6'));var Mustache=require(_0xfd5a('0x7'));var util=require('util');var path=require(_0xfd5a('0x8'));var sox=require(_0xfd5a('0x9'));var csv=require('to-csv');var ejs=require(_0xfd5a('0xa'));var fs=require('fs');var fs_extra=require(_0xfd5a('0xb'));var _=require(_0xfd5a('0xc'));var squel=require(_0xfd5a('0xd'));var crypto=require(_0xfd5a('0xe'));var jsforce=require(_0xfd5a('0xf'));var deskjs=require(_0xfd5a('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfd5a('0x11'));var Papa=require(_0xfd5a('0x12'));var Redis=require(_0xfd5a('0x13'));var authService=require(_0xfd5a('0x14'));var qs=require(_0xfd5a('0x15'));var as=require(_0xfd5a('0x16'));var hardwareService=require(_0xfd5a('0x17'));var logger=require(_0xfd5a('0x18'))(_0xfd5a('0x19'));var utils=require(_0xfd5a('0x1a'));var config=require(_0xfd5a('0x1b'));var licenseUtil=require(_0xfd5a('0x1c'));var db=require(_0xfd5a('0x1d'))['db'];function respondWithStatusCode(_0x59cedb,_0x3fdd6b){_0x3fdd6b=_0x3fdd6b||0xcc;return function(_0x3365c4){if(_0x3365c4){return _0x59cedb[_0xfd5a('0x1e')](_0x3fdd6b);}return _0x59cedb[_0xfd5a('0x1f')](_0x3fdd6b)[_0xfd5a('0x20')]();};}function respondWithResult(_0x370cce,_0x81fb04){_0x81fb04=_0x81fb04||0xc8;return function(_0x49b85a){if(_0x49b85a){return _0x370cce[_0xfd5a('0x1f')](_0x81fb04)[_0xfd5a('0x21')](_0x49b85a);}};}function respondWithFilteredResult(_0x177c10,_0x350e41){return function(_0x255672){if(_0x255672){var _0x7d6a55=typeof _0x350e41[_0xfd5a('0x22')]===_0xfd5a('0x23')&&typeof _0x350e41['limit']===_0xfd5a('0x23');var _0x555077=_0x255672[_0xfd5a('0x24')];var _0x24cd96=_0x7d6a55?0x0:_0x350e41[_0xfd5a('0x22')];var _0x38b150=_0x7d6a55?_0x255672[_0xfd5a('0x24')]:_0x350e41['offset']+_0x350e41[_0xfd5a('0x25')];var _0x3b4c0a;if(_0x38b150>=_0x555077){_0x38b150=_0x555077;_0x3b4c0a=0xc8;}else{_0x3b4c0a=0xce;}_0x177c10[_0xfd5a('0x1f')](_0x3b4c0a);return _0x177c10['set']('Content-Range',_0x24cd96+'-'+_0x38b150+'/'+_0x555077)[_0xfd5a('0x21')](_0x255672);}return null;};}function patchUpdates(_0x512096){return function(_0x30dab8){try{jsonpatch[_0xfd5a('0x26')](_0x30dab8,_0x512096,!![]);}catch(_0x23114d){return BPromise[_0xfd5a('0x27')](_0x23114d);}return _0x30dab8[_0xfd5a('0x28')]();};}function saveUpdates(_0x1b7858,_0x38a8df){return function(_0x35230a){if(_0x35230a){return _0x35230a[_0xfd5a('0x29')](_0x1b7858)[_0xfd5a('0x2a')](function(_0x391f11){return _0x391f11;});}return null;};}function removeEntity(_0x1fbd58,_0x3f4545){return function(_0x59db07){if(_0x59db07){return _0x59db07[_0xfd5a('0x2b')]()[_0xfd5a('0x2a')](function(){_0x1fbd58[_0xfd5a('0x1f')](0xcc)[_0xfd5a('0x20')]();});}};}function handleEntityNotFound(_0x4d93c3,_0x41483d){return function(_0xf2c646){if(!_0xf2c646){_0x4d93c3[_0xfd5a('0x1e')](0x194);}return _0xf2c646;};}function handleError(_0x3e1eef,_0x156a87){_0x156a87=_0x156a87||0x1f4;return function(_0x19ced8){logger[_0xfd5a('0x2c')](_0x19ced8[_0xfd5a('0x2d')]);if(_0x19ced8[_0xfd5a('0x2e')]){delete _0x19ced8[_0xfd5a('0x2e')];}_0x3e1eef[_0xfd5a('0x1f')](_0x156a87)[_0xfd5a('0x2f')](_0x19ced8);};}exports[_0xfd5a('0x30')]=function(_0xff7b8d,_0x5f0c0f){var _0x5a43d2={},_0x133116={},_0x277521={'count':0x0,'rows':[]};var _0x44e98a=_['map'](db[_0xfd5a('0x31')]['rawAttributes'],function(_0x377c49){return{'name':_0x377c49[_0xfd5a('0x32')],'type':_0x377c49['type'][_0xfd5a('0x33')]};});_0x133116[_0xfd5a('0x34')]=_[_0xfd5a('0x35')](_0x44e98a,'name');_0x133116[_0xfd5a('0x36')]=_['keys'](_0xff7b8d['query']);_0x133116[_0xfd5a('0x37')]=_[_0xfd5a('0x38')](_0x133116[_0xfd5a('0x34')],_0x133116['query']);_0x5a43d2[_0xfd5a('0x39')]=_[_0xfd5a('0x38')](_0x133116[_0xfd5a('0x34')],qs[_0xfd5a('0x3a')](_0xff7b8d[_0xfd5a('0x36')][_0xfd5a('0x3a')]));_0x5a43d2[_0xfd5a('0x39')]=_0x5a43d2[_0xfd5a('0x39')][_0xfd5a('0x3b')]?_0x5a43d2[_0xfd5a('0x39')]:_0x133116[_0xfd5a('0x34')];if(!_0xff7b8d['query'][_0xfd5a('0x3c')]('nolimit')){_0x5a43d2[_0xfd5a('0x25')]=qs[_0xfd5a('0x25')](_0xff7b8d['query']['limit']);_0x5a43d2['offset']=qs[_0xfd5a('0x22')](_0xff7b8d[_0xfd5a('0x36')]['offset']);}_0x5a43d2[_0xfd5a('0x3d')]=qs[_0xfd5a('0x3e')](_0xff7b8d['query'][_0xfd5a('0x3e')]);_0x5a43d2[_0xfd5a('0x3f')]=qs[_0xfd5a('0x37')](_[_0xfd5a('0x40')](_0xff7b8d['query'],_0x133116[_0xfd5a('0x37')]),_0x44e98a);if(_0xff7b8d[_0xfd5a('0x36')][_0xfd5a('0x41')]){_0x5a43d2[_0xfd5a('0x3f')]=_['merge'](_0x5a43d2[_0xfd5a('0x3f')],{'$or':_[_0xfd5a('0x35')](_0x44e98a,function(_0x40cd7f){if(_0x40cd7f[_0xfd5a('0x42')]!==_0xfd5a('0x43')){var _0x60a16e={};_0x60a16e[_0x40cd7f['name']]={'$like':'%'+_0xff7b8d[_0xfd5a('0x36')]['filter']+'%'};return _0x60a16e;}})});}_0x5a43d2=_['merge']({},_0x5a43d2,_0xff7b8d['options']);var _0x5dded5={'where':_0x5a43d2[_0xfd5a('0x3f')]};return db['OpenchannelQueueReport'][_0xfd5a('0x24')](_0x5dded5)[_0xfd5a('0x2a')](function(_0x41445c){_0x277521[_0xfd5a('0x24')]=_0x41445c;if(_0xff7b8d['query'][_0xfd5a('0x44')]){_0x5a43d2[_0xfd5a('0x45')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xfd5a('0x46')](_0x5a43d2);})[_0xfd5a('0x2a')](function(_0x55a219){_0x277521['rows']=_0x55a219;return _0x277521;})[_0xfd5a('0x2a')](respondWithFilteredResult(_0x5f0c0f,_0x5a43d2))[_0xfd5a('0x47')](handleError(_0x5f0c0f,null));};exports['show']=function(_0x138436,_0xaf57d3){var _0x7fb67e={'raw':!![],'where':{'id':_0x138436[_0xfd5a('0x48')]['id']}},_0x18da96={};_0x18da96[_0xfd5a('0x34')]=_[_0xfd5a('0x49')](db['OpenchannelQueueReport']['rawAttributes']);_0x18da96[_0xfd5a('0x36')]=_[_0xfd5a('0x49')](_0x138436[_0xfd5a('0x36')]);_0x18da96[_0xfd5a('0x37')]=_[_0xfd5a('0x38')](_0x18da96[_0xfd5a('0x34')],_0x18da96[_0xfd5a('0x36')]);_0x7fb67e[_0xfd5a('0x39')]=_[_0xfd5a('0x38')](_0x18da96[_0xfd5a('0x34')],qs['fields'](_0x138436[_0xfd5a('0x36')]['fields']));_0x7fb67e[_0xfd5a('0x39')]=_0x7fb67e[_0xfd5a('0x39')][_0xfd5a('0x3b')]?_0x7fb67e[_0xfd5a('0x39')]:_0x18da96['model'];if(_0x138436['query'][_0xfd5a('0x44')]){_0x7fb67e[_0xfd5a('0x45')]=[{'all':!![]}];}_0x7fb67e=_[_0xfd5a('0x4a')]({},_0x7fb67e,_0x138436[_0xfd5a('0x4b')]);return db[_0xfd5a('0x31')][_0xfd5a('0x4c')](_0x7fb67e)[_0xfd5a('0x2a')](handleEntityNotFound(_0xaf57d3,null))['then'](respondWithResult(_0xaf57d3,null))['catch'](handleError(_0xaf57d3,null));};exports[_0xfd5a('0x4d')]=function(_0x1a00d6,_0x1418da){return db[_0xfd5a('0x31')][_0xfd5a('0x4d')](_0x1a00d6['body'],{})['then'](respondWithResult(_0x1418da,0xc9))[_0xfd5a('0x47')](handleError(_0x1418da,null));};exports[_0xfd5a('0x29')]=function(_0x43414a,_0x19e489){if(_0x43414a[_0xfd5a('0x4e')]['id']){delete _0x43414a[_0xfd5a('0x4e')]['id'];}return db[_0xfd5a('0x31')][_0xfd5a('0x4c')]({'where':{'id':_0x43414a[_0xfd5a('0x48')]['id']}})[_0xfd5a('0x2a')](handleEntityNotFound(_0x19e489,null))[_0xfd5a('0x2a')](saveUpdates(_0x43414a[_0xfd5a('0x4e')],null))['then'](respondWithResult(_0x19e489,null))[_0xfd5a('0x47')](handleError(_0x19e489,null));};exports[_0xfd5a('0x2b')]=function(_0x380e96,_0x4b1274){return db[_0xfd5a('0x31')][_0xfd5a('0x4c')]({'where':{'id':_0x380e96['params']['id']}})[_0xfd5a('0x2a')](handleEntityNotFound(_0x4b1274,null))['then'](removeEntity(_0x4b1274,null))['catch'](handleError(_0x4b1274,null));};exports[_0xfd5a('0x4f')]=function(_0x33d642,_0x530801){return db[_0xfd5a('0x31')][_0xfd5a('0x4f')]()[_0xfd5a('0x2a')](respondWithResult(_0x530801,null))[_0xfd5a('0x47')](handleError(_0x530801,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ac1a6ff..ad80cae 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(_0x1eabbe,_0x522289){var _0x37c405=function(_0x4566b3){while(--_0x4566b3){_0x1eabbe['push'](_0x1eabbe['shift']());}};_0x37c405(++_0x522289);}(_0x1261,0x144));var _0x1126=function(_0x4583f5,_0x48986e){_0x4583f5=_0x4583f5-0x0;var _0x16513b=_0x1261[_0x4583f5];return _0x16513b;};'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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x1152f6,_0x1432ee){var _0x55bb45=function(_0x182f08){while(--_0x182f08){_0x1152f6['push'](_0x1152f6['shift']());}};_0x55bb45(++_0x1432ee);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f79617b..cf5efcc 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 _0x373d=['error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','result','catch','body','options','raw','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','stringify'];(function(_0x353efa,_0x3681ad){var _0x42552e=function(_0x2024b5){while(--_0x2024b5){_0x353efa['push'](_0x353efa['shift']());}};_0x42552e(++_0x3681ad);}(_0x373d,0x1e2));var _0xd373=function(_0x273b7e,_0x1b642f){_0x273b7e=_0x273b7e-0x0;var _0x5df145=_0x373d[_0x273b7e];return _0x5df145;};'use strict';var _=require(_0xd373('0x0'));var util=require('util');var moment=require(_0xd373('0x1'));var BPromise=require(_0xd373('0x2'));var rs=require(_0xd373('0x3'));var fs=require('fs');var Redis=require(_0xd373('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd373('0x5'));var logger=require(_0xd373('0x6'))(_0xd373('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd373('0x8')][_0xd373('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x446be6,_0x4008c5,_0x48d977){return new BPromise(function(_0xe79819,_0x51c074){return client['request'](_0x446be6,_0x48d977)['then'](function(_0x14472a){logger[_0xd373('0xa')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x4008c5,_0xd373('0xb'));logger[_0xd373('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x4008c5,'request\x20sent',JSON[_0xd373('0xd')](_0x14472a));if(_0x14472a[_0xd373('0xe')]){if(_0x14472a[_0xd373('0xe')][_0xd373('0xf')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x4008c5,_0x14472a['error'][_0xd373('0x10')]);return _0x51c074(_0x14472a[_0xd373('0xe')]['message']);}logger[_0xd373('0xe')](_0xd373('0x11'),_0x4008c5,_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);return _0xe79819(_0x14472a[_0xd373('0xe')][_0xd373('0x10')]);}else{logger[_0xd373('0xa')](_0xd373('0x11'),_0x4008c5,_0xd373('0xb'));_0xe79819(_0x14472a[_0xd373('0x12')][_0xd373('0x10')]);}})[_0xd373('0x13')](function(_0x1921dd){logger['error'](_0xd373('0x11'),_0x4008c5,_0x1921dd);_0x51c074(_0x1921dd);});});}exports['CreateOpenchannelQueueReport']=function(_0x460259){var _0x36d47a=this;return new Promise(function(_0x55c5c7,_0x1bbdbd){return db['OpenchannelQueueReport']['create'](_0x460259[_0xd373('0x14')],{'raw':_0x460259[_0xd373('0x15')]?_0x460259[_0xd373('0x15')][_0xd373('0x16')]===undefined?!![]:![]:!![]})[_0xd373('0x17')](function(_0x181eb2){logger['info'](_0xd373('0x18'),_0x460259);logger[_0xd373('0xc')](_0xd373('0x18'),_0x460259,JSON[_0xd373('0xd')](_0x181eb2));_0x55c5c7(_0x181eb2);})[_0xd373('0x13')](function(_0x3aa1c5){logger['error'](_0xd373('0x18'),_0x3aa1c5[_0xd373('0x10')],_0x460259);_0x1bbdbd(_0x36d47a[_0xd373('0xe')](0x1f4,_0x3aa1c5[_0xd373('0x10')]));});});};exports[_0xd373('0x19')]=function(_0x238ffd){var _0x466a03=this;return new Promise(function(_0x109e4c,_0x1ab540){return db[_0xd373('0x1a')][_0xd373('0x1b')](_0x238ffd[_0xd373('0x14')],{'raw':_0x238ffd[_0xd373('0x15')]?_0x238ffd[_0xd373('0x15')][_0xd373('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238ffd[_0xd373('0x15')]?_0x238ffd[_0xd373('0x15')][_0xd373('0x1c')]||null:null,'attributes':_0x238ffd[_0xd373('0x15')]?_0x238ffd[_0xd373('0x15')][_0xd373('0x1d')]||null:null,'limit':_0x238ffd[_0xd373('0x15')]?_0x238ffd[_0xd373('0x15')][_0xd373('0x1e')]||null:null})[_0xd373('0x17')](function(_0x2869e5){logger[_0xd373('0xa')](_0xd373('0x19'),_0x238ffd);logger[_0xd373('0xc')](_0xd373('0x19'),_0x238ffd,JSON['stringify'](_0x2869e5));_0x109e4c(_0x2869e5);})[_0xd373('0x13')](function(_0x490842){logger['error'](_0xd373('0x19'),_0x490842[_0xd373('0x10')],_0x238ffd);_0x1ab540(_0x466a03[_0xd373('0xe')](0x1f4,_0x490842[_0xd373('0x10')]));});});}; \ No newline at end of file +var _0xbb59=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateOpenchannelQueueReport','body','options','catch','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0xbb59,0xec));var _0x9bb5=function(_0x2729d3,_0x19fc09){_0x2729d3=_0x2729d3-0x0;var _0x12185e=_0xbb59[_0x2729d3];return _0x12185e;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});}exports[_0x9bb5('0x17')]=function(_0xba8392){var _0x19d1e9=this;return new Promise(function(_0x162815,_0xe44bdd){return db['OpenchannelQueueReport']['create'](_0xba8392[_0x9bb5('0x18')],{'raw':_0xba8392[_0x9bb5('0x19')]?_0xba8392['options']['raw']===undefined?!![]:![]:!![]})[_0x9bb5('0xc')](function(_0x182966){logger[_0x9bb5('0xd')]('CreateOpenchannelQueueReport',_0xba8392);logger[_0x9bb5('0xf')](_0x9bb5('0x17'),_0xba8392,JSON[_0x9bb5('0x12')](_0x182966));_0x162815(_0x182966);})[_0x9bb5('0x1a')](function(_0x51fa34){logger[_0x9bb5('0x13')](_0x9bb5('0x17'),_0x51fa34['message'],_0xba8392);_0xe44bdd(_0x19d1e9[_0x9bb5('0x13')](0x1f4,_0x51fa34['message']));});});};exports[_0x9bb5('0x1b')]=function(_0x5357e9){var _0x4be52b=this;return new Promise(function(_0x1d7195,_0x16db23){return db['OpenchannelQueueReport'][_0x9bb5('0x1c')](_0x5357e9[_0x9bb5('0x18')],{'raw':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1d')]||null:null,'attributes':_0x5357e9['options']?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1e')]||null:null,'limit':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['limit']||null:null})['then'](function(_0x1ad67b){logger[_0x9bb5('0xd')](_0x9bb5('0x1b'),_0x5357e9);logger[_0x9bb5('0xf')](_0x9bb5('0x1b'),_0x5357e9,JSON['stringify'](_0x1ad67b));_0x1d7195(_0x1ad67b);})['catch'](function(_0x59ef00){logger[_0x9bb5('0x13')](_0x9bb5('0x1b'),_0x59ef00[_0x9bb5('0x15')],_0x5357e9);_0x16db23(_0x4be52b['error'](0x1f4,_0x59ef00['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 2166d3b..9c94cb7 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 _0xa7cf=['delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id'];(function(_0x4a724f,_0x5b001a){var _0x35adab=function(_0x56298f){while(--_0x56298f){_0x4a724f['push'](_0x4a724f['shift']());}};_0x35adab(++_0x5b001a);}(_0xa7cf,0x191));var _0xfa7c=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xa7cf[_0x507ac5];return _0x12c1bc;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require('path');var timeout=require(_0xfa7c('0x2'));var express=require(_0xfa7c('0x3'));var router=express[_0xfa7c('0x4')]();var fs_extra=require(_0xfa7c('0x5'));var auth=require(_0xfa7c('0x6'));var interaction=require(_0xfa7c('0x7'));var config=require(_0xfa7c('0x8'));var controller=require(_0xfa7c('0x9'));router[_0xfa7c('0xa')]('/',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0xc')]);router[_0xfa7c('0xa')](_0xfa7c('0xd'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0xe')]);router[_0xfa7c('0xa')]('/:id',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0xf')]);router['post']('/',auth[_0xfa7c('0xb')](),controller['create']);router['put'](_0xfa7c('0x10'),auth[_0xfa7c('0xb')](),controller['update']);router[_0xfa7c('0x11')](_0xfa7c('0x10'),auth['isAuthenticated'](),controller[_0xfa7c('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdae7=['/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelTransferReport.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdae7,0x6f));var _0x7dae=function(_0x3015f9,_0x6eeb0d){_0x3015f9=_0x3015f9-0x0;var _0x3390b6=_0xdae7[_0x3015f9];return _0x3390b6;};'use strict';var multer=require(_0x7dae('0x0'));var util=require(_0x7dae('0x1'));var path=require(_0x7dae('0x2'));var timeout=require(_0x7dae('0x3'));var express=require(_0x7dae('0x4'));var router=express[_0x7dae('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7dae('0x6'));var config=require('../../config/environment');var controller=require(_0x7dae('0x7'));router[_0x7dae('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7dae('0x8')](_0x7dae('0x9'),auth[_0x7dae('0xa')](),controller[_0x7dae('0xb')]);router[_0x7dae('0x8')](_0x7dae('0xc'),auth[_0x7dae('0xa')](),controller[_0x7dae('0xd')]);router[_0x7dae('0xe')]('/',auth['isAuthenticated'](),controller[_0x7dae('0xf')]);router['put'](_0x7dae('0xc'),auth['isAuthenticated'](),controller[_0x7dae('0x10')]);router[_0x7dae('0x11')](_0x7dae('0xc'),auth['isAuthenticated'](),controller[_0x7dae('0x12')]);module[_0x7dae('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index cde1820..5aa6925 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xe79b71,_0xd95b4){var _0x1d43a3=function(_0x10c23e){while(--_0x10c23e){_0xe79b71['push'](_0xe79b71['shift']());}};_0x1d43a3(++_0xd95b4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0xf3cd[_0x3522c8];return _0x22f498;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x498577,_0x4b8af0){var _0x56f79a=function(_0x125774){while(--_0x125774){_0x498577['push'](_0x498577['shift']());}};_0x56f79a(++_0x4b8af0);}(_0x008c,0x188));var _0xc008=function(_0x46baa3,_0x286bc8){_0x46baa3=_0x46baa3-0x0;var _0x44731a=_0x008c[_0x46baa3];return _0x44731a;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 21894d5..08ddc6c 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 _0xe78a=['merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','fields','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','fieldName','type','key','query','attributes','intersection','model','length','hasOwnProperty','nolimit','order','sort','where','filters','filter'];(function(_0xdd7a7b,_0x254b3a){var _0x40ca7d=function(_0x4c2744){while(--_0x4c2744){_0xdd7a7b['push'](_0xdd7a7b['shift']());}};_0x40ca7d(++_0x254b3a);}(_0xe78a,0x1d9));var _0xae78=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe78a[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xae78('0x0'));var rimraf=require(_0xae78('0x1'));var zipdir=require(_0xae78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xae78('0x3'));var moment=require('moment');var BPromise=require(_0xae78('0x4'));var Mustache=require('mustache');var util=require(_0xae78('0x5'));var path=require(_0xae78('0x6'));var sox=require(_0xae78('0x7'));var csv=require(_0xae78('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xae78('0x9'));var _=require(_0xae78('0xa'));var squel=require(_0xae78('0xb'));var crypto=require(_0xae78('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xae78('0x8'));var querystring=require(_0xae78('0xd'));var Papa=require(_0xae78('0xe'));var Redis=require(_0xae78('0xf'));var authService=require(_0xae78('0x10'));var qs=require(_0xae78('0x11'));var as=require(_0xae78('0x12'));var hardwareService=require(_0xae78('0x13'));var logger=require(_0xae78('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xae78('0x15'));var licenseUtil=require(_0xae78('0x16'));var db=require(_0xae78('0x17'))['db'];function respondWithStatusCode(_0x30cd1e,_0x34a282){_0x34a282=_0x34a282||0xcc;return function(_0x3aafb1){if(_0x3aafb1){return _0x30cd1e[_0xae78('0x18')](_0x34a282);}return _0x30cd1e['status'](_0x34a282)[_0xae78('0x19')]();};}function respondWithResult(_0x1627c5,_0x22bf07){_0x22bf07=_0x22bf07||0xc8;return function(_0x56fd29){if(_0x56fd29){return _0x1627c5[_0xae78('0x1a')](_0x22bf07)['json'](_0x56fd29);}};}function respondWithFilteredResult(_0x2cdb0c,_0x26a7f7){return function(_0x545a9c){if(_0x545a9c){var _0x3844bd=typeof _0x26a7f7['offset']===_0xae78('0x1b')&&typeof _0x26a7f7[_0xae78('0x1c')]===_0xae78('0x1b');var _0x15f488=_0x545a9c['count'];var _0x2ecb39=_0x3844bd?0x0:_0x26a7f7[_0xae78('0x1d')];var _0x170dd9=_0x3844bd?_0x545a9c[_0xae78('0x1e')]:_0x26a7f7['offset']+_0x26a7f7[_0xae78('0x1c')];var _0x32d039;if(_0x170dd9>=_0x15f488){_0x170dd9=_0x15f488;_0x32d039=0xc8;}else{_0x32d039=0xce;}_0x2cdb0c[_0xae78('0x1a')](_0x32d039);return _0x2cdb0c[_0xae78('0x1f')](_0xae78('0x20'),_0x2ecb39+'-'+_0x170dd9+'/'+_0x15f488)[_0xae78('0x21')](_0x545a9c);}return null;};}function patchUpdates(_0x48116f){return function(_0x2cd25d){try{jsonpatch[_0xae78('0x22')](_0x2cd25d,_0x48116f,!![]);}catch(_0x229f6e){return BPromise[_0xae78('0x23')](_0x229f6e);}return _0x2cd25d[_0xae78('0x24')]();};}function saveUpdates(_0x1f8474,_0x2cc7c3){return function(_0x527859){if(_0x527859){return _0x527859[_0xae78('0x25')](_0x1f8474)[_0xae78('0x26')](function(_0x543db7){return _0x543db7;});}return null;};}function removeEntity(_0xbaabc5,_0x35689b){return function(_0xfedf0e){if(_0xfedf0e){return _0xfedf0e[_0xae78('0x27')]()['then'](function(){_0xbaabc5[_0xae78('0x1a')](0xcc)[_0xae78('0x19')]();});}};}function handleEntityNotFound(_0x33bbb8,_0x4feef5){return function(_0x367285){if(!_0x367285){_0x33bbb8['sendStatus'](0x194);}return _0x367285;};}function handleError(_0x1d3074,_0x2d2605){_0x2d2605=_0x2d2605||0x1f4;return function(_0x55e074){logger['error'](_0x55e074[_0xae78('0x28')]);if(_0x55e074[_0xae78('0x29')]){delete _0x55e074[_0xae78('0x29')];}_0x1d3074[_0xae78('0x1a')](_0x2d2605)[_0xae78('0x2a')](_0x55e074);};}exports['index']=function(_0x480553,_0x45e9c6){var _0x55af90={},_0x5b094a={},_0x354e0f={'count':0x0,'rows':[]};var _0x6c2218=_[_0xae78('0x2b')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x41c5d8){return{'name':_0x41c5d8[_0xae78('0x2c')],'type':_0x41c5d8[_0xae78('0x2d')][_0xae78('0x2e')]};});_0x5b094a['model']=_[_0xae78('0x2b')](_0x6c2218,_0xae78('0x29'));_0x5b094a[_0xae78('0x2f')]=_['keys'](_0x480553['query']);_0x5b094a['filters']=_['intersection'](_0x5b094a['model'],_0x5b094a[_0xae78('0x2f')]);_0x55af90[_0xae78('0x30')]=_[_0xae78('0x31')](_0x5b094a[_0xae78('0x32')],qs['fields'](_0x480553['query']['fields']));_0x55af90['attributes']=_0x55af90[_0xae78('0x30')][_0xae78('0x33')]?_0x55af90[_0xae78('0x30')]:_0x5b094a[_0xae78('0x32')];if(!_0x480553[_0xae78('0x2f')][_0xae78('0x34')](_0xae78('0x35'))){_0x55af90['limit']=qs['limit'](_0x480553[_0xae78('0x2f')]['limit']);_0x55af90[_0xae78('0x1d')]=qs['offset'](_0x480553[_0xae78('0x2f')][_0xae78('0x1d')]);}_0x55af90[_0xae78('0x36')]=qs[_0xae78('0x37')](_0x480553[_0xae78('0x2f')][_0xae78('0x37')]);_0x55af90[_0xae78('0x38')]=qs[_0xae78('0x39')](_['pick'](_0x480553['query'],_0x5b094a[_0xae78('0x39')]),_0x6c2218);if(_0x480553[_0xae78('0x2f')][_0xae78('0x3a')]){_0x55af90[_0xae78('0x38')]=_[_0xae78('0x3b')](_0x55af90['where'],{'$or':_['map'](_0x6c2218,function(_0x51b0c1){if(_0x51b0c1[_0xae78('0x2d')]!==_0xae78('0x3c')){var _0x57fdfb={};_0x57fdfb[_0x51b0c1['name']]={'$like':'%'+_0x480553[_0xae78('0x2f')]['filter']+'%'};return _0x57fdfb;}})});}_0x55af90=_[_0xae78('0x3b')]({},_0x55af90,_0x480553[_0xae78('0x3d')]);var _0x1539f0={'where':_0x55af90[_0xae78('0x38')]};return db[_0xae78('0x3e')][_0xae78('0x1e')](_0x1539f0)[_0xae78('0x26')](function(_0x52b40a){_0x354e0f[_0xae78('0x1e')]=_0x52b40a;if(_0x480553[_0xae78('0x2f')][_0xae78('0x3f')]){_0x55af90[_0xae78('0x40')]=[{'all':!![]}];}return db[_0xae78('0x3e')][_0xae78('0x41')](_0x55af90);})[_0xae78('0x26')](function(_0x2d7334){_0x354e0f['rows']=_0x2d7334;return _0x354e0f;})[_0xae78('0x26')](respondWithFilteredResult(_0x45e9c6,_0x55af90))[_0xae78('0x42')](handleError(_0x45e9c6,null));};exports[_0xae78('0x43')]=function(_0x54bcd4,_0xa690cc){var _0x4f28ad={'raw':!![],'where':{'id':_0x54bcd4[_0xae78('0x44')]['id']}},_0x36d821={};_0x36d821[_0xae78('0x32')]=_[_0xae78('0x45')](db[_0xae78('0x3e')][_0xae78('0x46')]);_0x36d821[_0xae78('0x2f')]=_[_0xae78('0x45')](_0x54bcd4[_0xae78('0x2f')]);_0x36d821[_0xae78('0x39')]=_[_0xae78('0x31')](_0x36d821[_0xae78('0x32')],_0x36d821['query']);_0x4f28ad[_0xae78('0x30')]=_['intersection'](_0x36d821[_0xae78('0x32')],qs[_0xae78('0x47')](_0x54bcd4['query']['fields']));_0x4f28ad[_0xae78('0x30')]=_0x4f28ad['attributes'][_0xae78('0x33')]?_0x4f28ad[_0xae78('0x30')]:_0x36d821[_0xae78('0x32')];if(_0x54bcd4['query'][_0xae78('0x3f')]){_0x4f28ad[_0xae78('0x40')]=[{'all':!![]}];}_0x4f28ad=_[_0xae78('0x3b')]({},_0x4f28ad,_0x54bcd4[_0xae78('0x3d')]);return db[_0xae78('0x3e')]['find'](_0x4f28ad)[_0xae78('0x26')](handleEntityNotFound(_0xa690cc,null))[_0xae78('0x26')](respondWithResult(_0xa690cc,null))['catch'](handleError(_0xa690cc,null));};exports[_0xae78('0x48')]=function(_0x4a9ade,_0x17cf5c){return db[_0xae78('0x3e')][_0xae78('0x48')](_0x4a9ade[_0xae78('0x49')],{})[_0xae78('0x26')](respondWithResult(_0x17cf5c,0xc9))['catch'](handleError(_0x17cf5c,null));};exports[_0xae78('0x25')]=function(_0x281d8c,_0x5aa457){if(_0x281d8c['body']['id']){delete _0x281d8c[_0xae78('0x49')]['id'];}return db[_0xae78('0x3e')][_0xae78('0x4a')]({'where':{'id':_0x281d8c['params']['id']}})['then'](handleEntityNotFound(_0x5aa457,null))[_0xae78('0x26')](saveUpdates(_0x281d8c[_0xae78('0x49')],null))[_0xae78('0x26')](respondWithResult(_0x5aa457,null))[_0xae78('0x42')](handleError(_0x5aa457,null));};exports['destroy']=function(_0x6e1430,_0x4e643f){return db['OpenchannelTransferReport'][_0xae78('0x4a')]({'where':{'id':_0x6e1430[_0xae78('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e643f,null))['then'](removeEntity(_0x4e643f,null))['catch'](handleError(_0x4e643f,null));};exports[_0xae78('0x4b')]=function(_0x46578f,_0x5d6472){return db[_0xae78('0x3e')][_0xae78('0x4b')]()[_0xae78('0x26')](respondWithResult(_0x5d6472,null))[_0xae78('0x42')](handleError(_0x5d6472,null));}; \ No newline at end of file +var _0xc9ff=['model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../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','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key'];(function(_0x18c146,_0x45a27e){var _0x48d9e9=function(_0x58c7bb){while(--_0x58c7bb){_0x18c146['push'](_0x18c146['shift']());}};_0x48d9e9(++_0x45a27e);}(_0xc9ff,0xb2));var _0xfc9f=function(_0x3b029f,_0x454a6e){_0x3b029f=_0x3b029f-0x0;var _0x21c32d=_0xc9ff[_0x3b029f];return _0x21c32d;};'use strict';var emlformat=require(_0xfc9f('0x0'));var rimraf=require(_0xfc9f('0x1'));var zipdir=require(_0xfc9f('0x2'));var jsonpatch=require(_0xfc9f('0x3'));var rp=require(_0xfc9f('0x4'));var moment=require(_0xfc9f('0x5'));var BPromise=require(_0xfc9f('0x6'));var Mustache=require(_0xfc9f('0x7'));var util=require(_0xfc9f('0x8'));var path=require(_0xfc9f('0x9'));var sox=require(_0xfc9f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc9f('0xb'));var _=require(_0xfc9f('0xc'));var squel=require(_0xfc9f('0xd'));var crypto=require(_0xfc9f('0xe'));var jsforce=require(_0xfc9f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfc9f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfc9f('0x11'));var as=require(_0xfc9f('0x12'));var hardwareService=require(_0xfc9f('0x13'));var logger=require(_0xfc9f('0x14'))(_0xfc9f('0x15'));var utils=require('../../config/utils');var config=require(_0xfc9f('0x16'));var licenseUtil=require(_0xfc9f('0x17'));var db=require(_0xfc9f('0x18'))['db'];function respondWithStatusCode(_0x3085d5,_0x58a96f){_0x58a96f=_0x58a96f||0xcc;return function(_0x278e88){if(_0x278e88){return _0x3085d5[_0xfc9f('0x19')](_0x58a96f);}return _0x3085d5[_0xfc9f('0x1a')](_0x58a96f)[_0xfc9f('0x1b')]();};}function respondWithResult(_0x305af4,_0x35209d){_0x35209d=_0x35209d||0xc8;return function(_0x518f77){if(_0x518f77){return _0x305af4['status'](_0x35209d)[_0xfc9f('0x1c')](_0x518f77);}};}function respondWithFilteredResult(_0x16436d,_0x2a5606){return function(_0x3fffeb){if(_0x3fffeb){var _0x3de915=typeof _0x2a5606[_0xfc9f('0x1d')]===_0xfc9f('0x1e')&&typeof _0x2a5606[_0xfc9f('0x1f')]===_0xfc9f('0x1e');var _0xd6361c=_0x3fffeb[_0xfc9f('0x20')];var _0x14aa13=_0x3de915?0x0:_0x2a5606[_0xfc9f('0x1d')];var _0x216793=_0x3de915?_0x3fffeb[_0xfc9f('0x20')]:_0x2a5606[_0xfc9f('0x1d')]+_0x2a5606[_0xfc9f('0x1f')];var _0x402b49;if(_0x216793>=_0xd6361c){_0x216793=_0xd6361c;_0x402b49=0xc8;}else{_0x402b49=0xce;}_0x16436d[_0xfc9f('0x1a')](_0x402b49);return _0x16436d[_0xfc9f('0x21')](_0xfc9f('0x22'),_0x14aa13+'-'+_0x216793+'/'+_0xd6361c)[_0xfc9f('0x1c')](_0x3fffeb);}return null;};}function patchUpdates(_0x2ea9e9){return function(_0xc846b9){try{jsonpatch[_0xfc9f('0x23')](_0xc846b9,_0x2ea9e9,!![]);}catch(_0x1437c0){return BPromise[_0xfc9f('0x24')](_0x1437c0);}return _0xc846b9[_0xfc9f('0x25')]();};}function saveUpdates(_0x4d9296,_0x2b3118){return function(_0x570592){if(_0x570592){return _0x570592['update'](_0x4d9296)[_0xfc9f('0x26')](function(_0x764025){return _0x764025;});}return null;};}function removeEntity(_0x48d7ae,_0x3b44be){return function(_0x3cfabe){if(_0x3cfabe){return _0x3cfabe[_0xfc9f('0x27')]()[_0xfc9f('0x26')](function(){_0x48d7ae[_0xfc9f('0x1a')](0xcc)[_0xfc9f('0x1b')]();});}};}function handleEntityNotFound(_0x25fb14,_0x5520cd){return function(_0x4b2b00){if(!_0x4b2b00){_0x25fb14[_0xfc9f('0x19')](0x194);}return _0x4b2b00;};}function handleError(_0x22749d,_0x252da5){_0x252da5=_0x252da5||0x1f4;return function(_0x294d22){logger[_0xfc9f('0x28')](_0x294d22[_0xfc9f('0x29')]);if(_0x294d22[_0xfc9f('0x2a')]){delete _0x294d22[_0xfc9f('0x2a')];}_0x22749d[_0xfc9f('0x1a')](_0x252da5)[_0xfc9f('0x2b')](_0x294d22);};}exports[_0xfc9f('0x2c')]=function(_0x1de9f7,_0x3d577e){var _0x5aec21={},_0x549413={},_0x25f66b={'count':0x0,'rows':[]};var _0x15707d=_[_0xfc9f('0x2d')](db[_0xfc9f('0x2e')][_0xfc9f('0x2f')],function(_0x4e67dc){return{'name':_0x4e67dc['fieldName'],'type':_0x4e67dc[_0xfc9f('0x30')][_0xfc9f('0x31')]};});_0x549413[_0xfc9f('0x32')]=_['map'](_0x15707d,_0xfc9f('0x2a'));_0x549413[_0xfc9f('0x33')]=_['keys'](_0x1de9f7[_0xfc9f('0x33')]);_0x549413[_0xfc9f('0x34')]=_[_0xfc9f('0x35')](_0x549413[_0xfc9f('0x32')],_0x549413[_0xfc9f('0x33')]);_0x5aec21[_0xfc9f('0x36')]=_[_0xfc9f('0x35')](_0x549413[_0xfc9f('0x32')],qs[_0xfc9f('0x37')](_0x1de9f7[_0xfc9f('0x33')]['fields']));_0x5aec21['attributes']=_0x5aec21['attributes']['length']?_0x5aec21[_0xfc9f('0x36')]:_0x549413[_0xfc9f('0x32')];if(!_0x1de9f7[_0xfc9f('0x33')]['hasOwnProperty']('nolimit')){_0x5aec21[_0xfc9f('0x1f')]=qs[_0xfc9f('0x1f')](_0x1de9f7[_0xfc9f('0x33')][_0xfc9f('0x1f')]);_0x5aec21[_0xfc9f('0x1d')]=qs['offset'](_0x1de9f7['query'][_0xfc9f('0x1d')]);}_0x5aec21[_0xfc9f('0x38')]=qs[_0xfc9f('0x39')](_0x1de9f7[_0xfc9f('0x33')][_0xfc9f('0x39')]);_0x5aec21[_0xfc9f('0x3a')]=qs['filters'](_[_0xfc9f('0x3b')](_0x1de9f7[_0xfc9f('0x33')],_0x549413['filters']),_0x15707d);if(_0x1de9f7[_0xfc9f('0x33')][_0xfc9f('0x3c')]){_0x5aec21[_0xfc9f('0x3a')]=_[_0xfc9f('0x3d')](_0x5aec21[_0xfc9f('0x3a')],{'$or':_[_0xfc9f('0x2d')](_0x15707d,function(_0x4374ff){if(_0x4374ff[_0xfc9f('0x30')]!==_0xfc9f('0x3e')){var _0x60d57b={};_0x60d57b[_0x4374ff[_0xfc9f('0x2a')]]={'$like':'%'+_0x1de9f7[_0xfc9f('0x33')]['filter']+'%'};return _0x60d57b;}})});}_0x5aec21=_[_0xfc9f('0x3d')]({},_0x5aec21,_0x1de9f7['options']);var _0x4a5488={'where':_0x5aec21['where']};return db['OpenchannelTransferReport'][_0xfc9f('0x20')](_0x4a5488)[_0xfc9f('0x26')](function(_0x33d309){_0x25f66b['count']=_0x33d309;if(_0x1de9f7['query'][_0xfc9f('0x3f')]){_0x5aec21[_0xfc9f('0x40')]=[{'all':!![]}];}return db[_0xfc9f('0x2e')][_0xfc9f('0x41')](_0x5aec21);})[_0xfc9f('0x26')](function(_0x141ec5){_0x25f66b[_0xfc9f('0x42')]=_0x141ec5;return _0x25f66b;})[_0xfc9f('0x26')](respondWithFilteredResult(_0x3d577e,_0x5aec21))[_0xfc9f('0x43')](handleError(_0x3d577e,null));};exports[_0xfc9f('0x44')]=function(_0x37b5fb,_0x39ad57){var _0x37d4c2={'raw':!![],'where':{'id':_0x37b5fb[_0xfc9f('0x45')]['id']}},_0x36eee9={};_0x36eee9['model']=_[_0xfc9f('0x46')](db[_0xfc9f('0x2e')][_0xfc9f('0x2f')]);_0x36eee9[_0xfc9f('0x33')]=_[_0xfc9f('0x46')](_0x37b5fb[_0xfc9f('0x33')]);_0x36eee9['filters']=_['intersection'](_0x36eee9[_0xfc9f('0x32')],_0x36eee9[_0xfc9f('0x33')]);_0x37d4c2['attributes']=_[_0xfc9f('0x35')](_0x36eee9[_0xfc9f('0x32')],qs[_0xfc9f('0x37')](_0x37b5fb[_0xfc9f('0x33')][_0xfc9f('0x37')]));_0x37d4c2[_0xfc9f('0x36')]=_0x37d4c2[_0xfc9f('0x36')][_0xfc9f('0x47')]?_0x37d4c2[_0xfc9f('0x36')]:_0x36eee9[_0xfc9f('0x32')];if(_0x37b5fb[_0xfc9f('0x33')]['includeAll']){_0x37d4c2[_0xfc9f('0x40')]=[{'all':!![]}];}_0x37d4c2=_[_0xfc9f('0x3d')]({},_0x37d4c2,_0x37b5fb['options']);return db[_0xfc9f('0x2e')][_0xfc9f('0x48')](_0x37d4c2)[_0xfc9f('0x26')](handleEntityNotFound(_0x39ad57,null))[_0xfc9f('0x26')](respondWithResult(_0x39ad57,null))[_0xfc9f('0x43')](handleError(_0x39ad57,null));};exports['create']=function(_0x253c99,_0x47522f){return db['OpenchannelTransferReport'][_0xfc9f('0x49')](_0x253c99[_0xfc9f('0x4a')],{})['then'](respondWithResult(_0x47522f,0xc9))['catch'](handleError(_0x47522f,null));};exports['update']=function(_0x278c45,_0x5315fb){if(_0x278c45[_0xfc9f('0x4a')]['id']){delete _0x278c45[_0xfc9f('0x4a')]['id'];}return db[_0xfc9f('0x2e')][_0xfc9f('0x48')]({'where':{'id':_0x278c45[_0xfc9f('0x45')]['id']}})['then'](handleEntityNotFound(_0x5315fb,null))[_0xfc9f('0x26')](saveUpdates(_0x278c45[_0xfc9f('0x4a')],null))[_0xfc9f('0x26')](respondWithResult(_0x5315fb,null))[_0xfc9f('0x43')](handleError(_0x5315fb,null));};exports[_0xfc9f('0x27')]=function(_0x5ce402,_0x411ab4){return db[_0xfc9f('0x2e')]['find']({'where':{'id':_0x5ce402['params']['id']}})['then'](handleEntityNotFound(_0x411ab4,null))[_0xfc9f('0x26')](removeEntity(_0x411ab4,null))[_0xfc9f('0x43')](handleError(_0x411ab4,null));};exports[_0xfc9f('0x4b')]=function(_0xedf941,_0x4ca1fe){return db[_0xfc9f('0x2e')][_0xfc9f('0x4b')]()[_0xfc9f('0x26')](respondWithResult(_0x4ca1fe,null))[_0xfc9f('0x43')](handleError(_0x4ca1fe,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a19006c..41fc715 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 _0x3598=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','bluebird','request-promise','path'];(function(_0x2e1b3f,_0x5bbe92){var _0x202a55=function(_0x32c677){while(--_0x32c677){_0x2e1b3f['push'](_0x2e1b3f['shift']());}};_0x202a55(++_0x5bbe92);}(_0x3598,0x193));var _0x8359=function(_0x5f4c31,_0x482e0f){_0x5f4c31=_0x5f4c31-0x0;var _0x20a3bb=_0x3598[_0x5f4c31];return _0x20a3bb;};'use strict';var _=require(_0x8359('0x0'));var util=require(_0x8359('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8359('0x2'));var rp=require(_0x8359('0x3'));var fs=require('fs');var path=require(_0x8359('0x4'));var rimraf=require(_0x8359('0x5'));var config=require(_0x8359('0x6'));var attributes=require(_0x8359('0x7'));module[_0x8359('0x8')]=function(_0x585012,_0x1be0ca){return _0x585012[_0x8359('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x8359('0xa'),'paranoid':![],'indexes':[{'name':_0x8359('0xb'),'fields':[_0x8359('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc1e2=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xc264ed,_0x656596){var _0x2b723a=function(_0xf7b686){while(--_0xf7b686){_0xc264ed['push'](_0xc264ed['shift']());}};_0x2b723a(++_0x656596);}(_0xc1e2,0xf0));var _0x2c1e=function(_0x1e91a3,_0x1f8a78){_0x1e91a3=_0x1e91a3-0x0;var _0x2c4dff=_0xc1e2[_0x1e91a3];return _0x2c4dff;};'use strict';var _=require(_0x2c1e('0x0'));var util=require('util');var logger=require(_0x2c1e('0x1'))(_0x2c1e('0x2'));var moment=require(_0x2c1e('0x3'));var BPromise=require(_0x2c1e('0x4'));var rp=require(_0x2c1e('0x5'));var fs=require('fs');var path=require(_0x2c1e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2c1e('0x7'));module[_0x2c1e('0x8')]=function(_0x5f54cf,_0x1a5bf0){return _0x5f54cf[_0x2c1e('0x9')](_0x2c1e('0xa'),attributes,{'tableName':_0x2c1e('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2c1e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 6da73b3..c257c5a 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 _0x83d3=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result'];(function(_0x282836,_0x5bfa82){var _0x3df823=function(_0x4998a6){while(--_0x4998a6){_0x282836['push'](_0x282836['shift']());}};_0x3df823(++_0x5bfa82);}(_0x83d3,0x17c));var _0x383d=function(_0x58bec1,_0x42c53f){_0x58bec1=_0x58bec1-0x0;var _0x16439f=_0x83d3[_0x58bec1];return _0x16439f;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require(_0x383d('0x2'));var BPromise=require(_0x383d('0x3'));var rs=require(_0x383d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x383d('0x5'))['db'];var utils=require(_0x383d('0x6'));var logger=require(_0x383d('0x7'))(_0x383d('0x8'));var config=require('../../config/environment');var jayson=require(_0x383d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc074b,_0x2c3cab,_0x360bee){return new BPromise(function(_0x5641df,_0x303c1d){return client['request'](_0xbc074b,_0x360bee)['then'](function(_0x221079){logger[_0x383d('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));logger[_0x383d('0xc')](_0x383d('0xd'),_0x2c3cab,_0x383d('0xb'),JSON[_0x383d('0xe')](_0x221079));if(_0x221079[_0x383d('0xf')]){if(_0x221079['error']['code']===0x1f4){logger['error'](_0x383d('0x10'),_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x303c1d(_0x221079[_0x383d('0xf')][_0x383d('0x11')]);}logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x5641df(_0x221079['error'][_0x383d('0x11')]);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));_0x5641df(_0x221079[_0x383d('0x12')]['message']);}})['catch'](function(_0x11c1f9){logger[_0x383d('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2c3cab,_0x11c1f9);_0x303c1d(_0x11c1f9);});});} \ No newline at end of file +var _0xea1c=['client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xb28758,_0xefcfad){var _0x13d9a0=function(_0x1bace9){while(--_0x1bace9){_0xb28758['push'](_0xb28758['shift']());}};_0x13d9a0(++_0xefcfad);}(_0xea1c,0x117));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcea1('0x0'));var BPromise=require(_0xcea1('0x1'));var rs=require(_0xcea1('0x2'));var fs=require('fs');var Redis=require(_0xcea1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea1('0x4'));var logger=require(_0xcea1('0x5'))(_0xcea1('0x6'));var config=require(_0xcea1('0x7'));var jayson=require(_0xcea1('0x8'));var client=jayson[_0xcea1('0x9')][_0xcea1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec7a9f,_0x93dfa5,_0x1441c6){return new BPromise(function(_0x295e4c,_0x49554b){return client[_0xcea1('0xb')](_0xec7a9f,_0x1441c6)[_0xcea1('0xc')](function(_0xbc67f9){logger['info'](_0xcea1('0xd'),_0x93dfa5,_0xcea1('0xe'));logger[_0xcea1('0xf')](_0xcea1('0x10'),_0x93dfa5,_0xcea1('0xe'),JSON[_0xcea1('0x11')](_0xbc67f9));if(_0xbc67f9[_0xcea1('0x12')]){if(_0xbc67f9[_0xcea1('0x12')][_0xcea1('0x13')]===0x1f4){logger[_0xcea1('0x12')](_0xcea1('0xd'),_0x93dfa5,_0xbc67f9['error'][_0xcea1('0x14')]);return _0x49554b(_0xbc67f9['error'][_0xcea1('0x14')]);}logger[_0xcea1('0x12')](_0xcea1('0xd'),_0x93dfa5,_0xbc67f9['error']['message']);return _0x295e4c(_0xbc67f9[_0xcea1('0x12')][_0xcea1('0x14')]);}else{logger[_0xcea1('0x15')](_0xcea1('0xd'),_0x93dfa5,_0xcea1('0xe'));_0x295e4c(_0xbc67f9[_0xcea1('0x16')][_0xcea1('0x14')]);}})[_0xcea1('0x17')](function(_0x29accd){logger[_0xcea1('0x12')](_0xcea1('0xd'),_0x93dfa5,_0x29accd);_0x49554b(_0x29accd);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index cef09ab..260a6f6 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 _0x6b3f=['put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x51a85c,_0x2660a3){var _0x55001f=function(_0x39ec46){while(--_0x39ec46){_0x51a85c['push'](_0x51a85c['shift']());}};_0x55001f(++_0x2660a3);}(_0x6b3f,0x1b4));var _0xf6b3=function(_0x3b2aff,_0x239bab){_0x3b2aff=_0x3b2aff-0x0;var _0x37298d=_0x6b3f[_0x3b2aff];return _0x37298d;};'use strict';var multer=require('multer');var util=require(_0xf6b3('0x0'));var path=require(_0xf6b3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6b3('0x2'));var router=express[_0xf6b3('0x3')]();var fs_extra=require(_0xf6b3('0x4'));var auth=require(_0xf6b3('0x5'));var interaction=require(_0xf6b3('0x6'));var config=require('../../config/environment');var controller=require(_0xf6b3('0x7'));router[_0xf6b3('0x8')]('/',auth[_0xf6b3('0x9')](),controller[_0xf6b3('0xa')]);router[_0xf6b3('0x8')](_0xf6b3('0xb'),auth[_0xf6b3('0x9')](),controller[_0xf6b3('0xc')]);router['post']('/',auth[_0xf6b3('0x9')](),controller[_0xf6b3('0xd')]);router[_0xf6b3('0xe')]('/:id',auth[_0xf6b3('0x9')](),controller[_0xf6b3('0xf')]);router[_0xf6b3('0x10')](_0xf6b3('0xb'),auth[_0xf6b3('0x9')](),controller[_0xf6b3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x5e65=['destroy','exports','multer','connect-timeout','Router','../../components/auth/service','./pause.controller','get','isAuthenticated','index','create','put','/:id','delete'];(function(_0x2ee7bc,_0x25d371){var _0x577727=function(_0xf5c091){while(--_0xf5c091){_0x2ee7bc['push'](_0x2ee7bc['shift']());}};_0x577727(++_0x25d371);}(_0x5e65,0x152));var _0x55e6=function(_0x56be7a,_0x21d261){_0x56be7a=_0x56be7a-0x0;var _0x52db00=_0x5e65[_0x56be7a];return _0x52db00;};'use strict';var multer=require(_0x55e6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55e6('0x1'));var express=require('express');var router=express[_0x55e6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x55e6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x55e6('0x4'));router[_0x55e6('0x5')]('/',auth[_0x55e6('0x6')](),controller[_0x55e6('0x7')]);router[_0x55e6('0x5')]('/:id',auth[_0x55e6('0x6')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x55e6('0x8')]);router[_0x55e6('0x9')](_0x55e6('0xa'),auth[_0x55e6('0x6')](),controller['update']);router[_0x55e6('0xb')](_0x55e6('0xa'),auth[_0x55e6('0x6')](),controller[_0x55e6('0xc')]);module[_0x55e6('0xd')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index e668df2..8b0ca0b 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 _0xc9e0=['exports','STRING','name','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9e0,0xfb));var _0x0c9e=function(_0x317698,_0x26b571){_0x317698=_0x317698-0x0;var _0x1b028e=_0xc9e0[_0x317698];return _0x1b028e;};'use strict';var Sequelize=require(_0x0c9e('0x0'));module[_0x0c9e('0x1')]={'name':{'type':Sequelize[_0x0c9e('0x2')],'unique':_0x0c9e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0c9e('0x2')]}}; \ No newline at end of file +var _0xe0bc=['name','sequelize','exports','STRING'];(function(_0x309879,_0x29f94a){var _0x480e63=function(_0x8ec1b0){while(--_0x8ec1b0){_0x309879['push'](_0x309879['shift']());}};_0x480e63(++_0x29f94a);}(_0xe0bc,0x10d));var _0xce0b=function(_0x381625,_0xccbb1a){_0x381625=_0x381625-0x0;var _0x19f06a=_0xe0bc[_0x381625];return _0x19f06a;};'use strict';var Sequelize=require(_0xce0b('0x0'));module[_0xce0b('0x1')]={'name':{'type':Sequelize[_0xce0b('0x2')],'unique':_0xce0b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xce0b('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 25a7586..d4e5faa 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 _0x1dd0=['UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','destroy','then','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','find','create','user','role','get'];(function(_0xba96b0,_0x36e8f8){var _0xdad969=function(_0x5226b4){while(--_0x5226b4){_0xba96b0['push'](_0xba96b0['shift']());}};_0xdad969(++_0x36e8f8);}(_0x1dd0,0x19b));var _0x01dd=function(_0xf7d769,_0x2dc400){_0xf7d769=_0xf7d769-0x0;var _0x237a24=_0x1dd0[_0xf7d769];return _0x237a24;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01dd('0x0'));var zipdir=require(_0x01dd('0x1'));var jsonpatch=require(_0x01dd('0x2'));var rp=require(_0x01dd('0x3'));var moment=require('moment');var BPromise=require(_0x01dd('0x4'));var Mustache=require(_0x01dd('0x5'));var util=require('util');var path=require(_0x01dd('0x6'));var sox=require('sox');var csv=require(_0x01dd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x01dd('0x8'));var _=require(_0x01dd('0x9'));var squel=require('squel');var crypto=require(_0x01dd('0xa'));var jsforce=require(_0x01dd('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01dd('0xc'));var Redis=require(_0x01dd('0xd'));var authService=require(_0x01dd('0xe'));var qs=require(_0x01dd('0xf'));var as=require(_0x01dd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01dd('0x11'))(_0x01dd('0x12'));var utils=require(_0x01dd('0x13'));var config=require(_0x01dd('0x14'));var licenseUtil=require(_0x01dd('0x15'));var db=require(_0x01dd('0x16'))['db'];function respondWithStatusCode(_0x19685e,_0x58cbf1){_0x58cbf1=_0x58cbf1||0xcc;return function(_0xe1cd42){if(_0xe1cd42){return _0x19685e[_0x01dd('0x17')](_0x58cbf1);}return _0x19685e[_0x01dd('0x18')](_0x58cbf1)[_0x01dd('0x19')]();};}function respondWithResult(_0x444f95,_0x2ebe3e){_0x2ebe3e=_0x2ebe3e||0xc8;return function(_0x28a664){if(_0x28a664){return _0x444f95[_0x01dd('0x18')](_0x2ebe3e)['json'](_0x28a664);}};}function respondWithFilteredResult(_0x5899b2,_0x14a93f){return function(_0x158a9e){if(_0x158a9e){var _0x59b1b7=typeof _0x14a93f[_0x01dd('0x1a')]==='undefined'&&typeof _0x14a93f[_0x01dd('0x1b')]===_0x01dd('0x1c');var _0x1acea2=_0x158a9e[_0x01dd('0x1d')];var _0x22a950=_0x59b1b7?0x0:_0x14a93f[_0x01dd('0x1a')];var _0x58862e=_0x59b1b7?_0x158a9e[_0x01dd('0x1d')]:_0x14a93f[_0x01dd('0x1a')]+_0x14a93f['limit'];var _0x337e77;if(_0x58862e>=_0x1acea2){_0x58862e=_0x1acea2;_0x337e77=0xc8;}else{_0x337e77=0xce;}_0x5899b2[_0x01dd('0x18')](_0x337e77);return _0x5899b2['set']('Content-Range',_0x22a950+'-'+_0x58862e+'/'+_0x1acea2)[_0x01dd('0x1e')](_0x158a9e);}return null;};}function patchUpdates(_0x515aac){return function(_0x3bb9c8){try{jsonpatch[_0x01dd('0x1f')](_0x3bb9c8,_0x515aac,!![]);}catch(_0x2425b6){return BPromise[_0x01dd('0x20')](_0x2425b6);}return _0x3bb9c8['save']();};}function saveUpdates(_0x3e841b,_0x543212){return function(_0x5224be){if(_0x5224be){return _0x5224be['update'](_0x3e841b)['then'](function(_0x5aa505){return _0x5aa505;});}return null;};}function removeEntity(_0x5304e3,_0x4663d6){return function(_0xc58319){if(_0xc58319){return _0xc58319[_0x01dd('0x21')]()[_0x01dd('0x22')](function(){var _0x7b5534=_0xc58319['get']({'plain':!![]});var _0x16e3b6=_0x01dd('0x23');return db[_0x01dd('0x24')][_0x01dd('0x21')]({'where':{'type':_0x16e3b6,'resourceId':_0x7b5534['id']}})[_0x01dd('0x22')](function(){return _0xc58319;});})[_0x01dd('0x22')](function(){_0x5304e3[_0x01dd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x251076,_0x2a96c7){return function(_0x138ac0){if(!_0x138ac0){_0x251076[_0x01dd('0x17')](0x194);}return _0x138ac0;};}function handleError(_0x962f4d,_0x39622c){_0x39622c=_0x39622c||0x1f4;return function(_0x187148){logger[_0x01dd('0x25')](_0x187148[_0x01dd('0x26')]);if(_0x187148[_0x01dd('0x27')]){delete _0x187148[_0x01dd('0x27')];}_0x962f4d[_0x01dd('0x18')](_0x39622c)[_0x01dd('0x28')](_0x187148);};}exports[_0x01dd('0x29')]=function(_0x5b23e5,_0x568e38){var _0x36e171={},_0x28eb1b={},_0x5039d5={'count':0x0,'rows':[]};var _0x547822=_[_0x01dd('0x2a')](db[_0x01dd('0x2b')][_0x01dd('0x2c')],function(_0x2b0c64){return{'name':_0x2b0c64[_0x01dd('0x2d')],'type':_0x2b0c64['type'][_0x01dd('0x2e')]};});_0x28eb1b[_0x01dd('0x2f')]=_['map'](_0x547822,_0x01dd('0x27'));_0x28eb1b[_0x01dd('0x30')]=_['keys'](_0x5b23e5[_0x01dd('0x30')]);_0x28eb1b[_0x01dd('0x31')]=_['intersection'](_0x28eb1b[_0x01dd('0x2f')],_0x28eb1b[_0x01dd('0x30')]);_0x36e171['attributes']=_[_0x01dd('0x32')](_0x28eb1b[_0x01dd('0x2f')],qs['fields'](_0x5b23e5[_0x01dd('0x30')][_0x01dd('0x33')]));_0x36e171[_0x01dd('0x34')]=_0x36e171[_0x01dd('0x34')][_0x01dd('0x35')]?_0x36e171['attributes']:_0x28eb1b['model'];if(!_0x5b23e5['query'][_0x01dd('0x36')](_0x01dd('0x37'))){_0x36e171[_0x01dd('0x1b')]=qs[_0x01dd('0x1b')](_0x5b23e5[_0x01dd('0x30')][_0x01dd('0x1b')]);_0x36e171[_0x01dd('0x1a')]=qs[_0x01dd('0x1a')](_0x5b23e5[_0x01dd('0x30')][_0x01dd('0x1a')]);}_0x36e171['order']=qs[_0x01dd('0x38')](_0x5b23e5[_0x01dd('0x30')]['sort']);_0x36e171[_0x01dd('0x39')]=qs[_0x01dd('0x31')](_[_0x01dd('0x3a')](_0x5b23e5[_0x01dd('0x30')],_0x28eb1b[_0x01dd('0x31')]),_0x547822);if(_0x5b23e5[_0x01dd('0x30')][_0x01dd('0x3b')]){_0x36e171[_0x01dd('0x39')]=_[_0x01dd('0x3c')](_0x36e171['where'],{'$or':_[_0x01dd('0x2a')](_0x547822,function(_0x282724){if(_0x282724[_0x01dd('0x3d')]!==_0x01dd('0x3e')){var _0x339808={};_0x339808[_0x282724['name']]={'$like':'%'+_0x5b23e5[_0x01dd('0x30')]['filter']+'%'};return _0x339808;}})});}_0x36e171=_['merge']({},_0x36e171,_0x5b23e5[_0x01dd('0x3f')]);var _0xd65260={'where':_0x36e171[_0x01dd('0x39')]};return db[_0x01dd('0x2b')][_0x01dd('0x1d')](_0xd65260)[_0x01dd('0x22')](function(_0x5614f4){_0x5039d5['count']=_0x5614f4;if(_0x5b23e5[_0x01dd('0x30')][_0x01dd('0x40')]){_0x36e171['include']=[{'all':!![]}];}return db['Pause'][_0x01dd('0x41')](_0x36e171);})[_0x01dd('0x22')](function(_0x2384dd){_0x5039d5[_0x01dd('0x42')]=_0x2384dd;return _0x5039d5;})[_0x01dd('0x22')](respondWithFilteredResult(_0x568e38,_0x36e171))[_0x01dd('0x43')](handleError(_0x568e38,null));};exports['show']=function(_0xd3bac4,_0x6da7ca){var _0x548fce={'raw':!![],'where':{'id':_0xd3bac4[_0x01dd('0x44')]['id']}},_0xa54a33={};_0xa54a33[_0x01dd('0x2f')]=_['keys'](db[_0x01dd('0x2b')][_0x01dd('0x2c')]);_0xa54a33[_0x01dd('0x30')]=_[_0x01dd('0x45')](_0xd3bac4[_0x01dd('0x30')]);_0xa54a33[_0x01dd('0x31')]=_[_0x01dd('0x32')](_0xa54a33[_0x01dd('0x2f')],_0xa54a33[_0x01dd('0x30')]);_0x548fce['attributes']=_[_0x01dd('0x32')](_0xa54a33[_0x01dd('0x2f')],qs[_0x01dd('0x33')](_0xd3bac4[_0x01dd('0x30')][_0x01dd('0x33')]));_0x548fce['attributes']=_0x548fce[_0x01dd('0x34')][_0x01dd('0x35')]?_0x548fce['attributes']:_0xa54a33[_0x01dd('0x2f')];if(_0xd3bac4[_0x01dd('0x30')][_0x01dd('0x40')]){_0x548fce['include']=[{'all':!![]}];}_0x548fce=_[_0x01dd('0x3c')]({},_0x548fce,_0xd3bac4['options']);return db[_0x01dd('0x2b')][_0x01dd('0x46')](_0x548fce)[_0x01dd('0x22')](handleEntityNotFound(_0x6da7ca,null))[_0x01dd('0x22')](respondWithResult(_0x6da7ca,null))[_0x01dd('0x43')](handleError(_0x6da7ca,null));};exports[_0x01dd('0x47')]=function(_0x36ff3f,_0x5a8ba2){return db[_0x01dd('0x2b')]['create'](_0x36ff3f['body'],{})['then'](function(_0x5f5c2d){var _0xa5b506=_0x36ff3f[_0x01dd('0x48')]['get']({'plain':!![]});if(!_0xa5b506)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa5b506[_0x01dd('0x49')]===_0x01dd('0x48')){var _0x634712=_0x5f5c2d[_0x01dd('0x4a')]({'plain':!![]});var _0x3617d8='Pauses';return db[_0x01dd('0x4b')]['find']({'where':{'name':_0x3617d8,'userProfileId':_0xa5b506[_0x01dd('0x4c')]},'raw':!![]})['then'](function(_0x1d9d3a){if(_0x1d9d3a&&_0x1d9d3a[_0x01dd('0x4d')]===0x0){return db['UserProfileResource'][_0x01dd('0x47')]({'name':_0x634712[_0x01dd('0x27')],'resourceId':_0x634712['id'],'type':_0x1d9d3a['name'],'sectionId':_0x1d9d3a['id']},{})[_0x01dd('0x22')](function(){return _0x5f5c2d;});}else{return _0x5f5c2d;}})[_0x01dd('0x43')](function(_0x62f5f7){logger[_0x01dd('0x25')](_0x01dd('0x4e'),_0x62f5f7);throw _0x62f5f7;});}return _0x5f5c2d;})[_0x01dd('0x22')](respondWithResult(_0x5a8ba2,0xc9))[_0x01dd('0x43')](handleError(_0x5a8ba2,null));};exports[_0x01dd('0x4f')]=function(_0x5a8460,_0x191ec8){if(_0x5a8460[_0x01dd('0x50')]['id']){delete _0x5a8460[_0x01dd('0x50')]['id'];}return db[_0x01dd('0x2b')]['find']({'where':{'id':_0x5a8460[_0x01dd('0x44')]['id']}})[_0x01dd('0x22')](handleEntityNotFound(_0x191ec8,null))[_0x01dd('0x22')](saveUpdates(_0x5a8460[_0x01dd('0x50')],null))['then'](respondWithResult(_0x191ec8,null))[_0x01dd('0x43')](handleError(_0x191ec8,null));};exports[_0x01dd('0x21')]=function(_0x4d6b0c,_0x4d4def){return db['Pause'][_0x01dd('0x46')]({'where':{'id':_0x4d6b0c[_0x01dd('0x44')]['id']}})[_0x01dd('0x22')](handleEntityNotFound(_0x4d4def,null))[_0x01dd('0x22')](removeEntity(_0x4d4def,null))['catch'](handleError(_0x4d4def,null));}; \ No newline at end of file +var _0x4d04=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','type','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','get','Pauses','destroy','error','stack','name','index','map','Pause','key'];(function(_0x37dd56,_0x2063df){var _0x5890be=function(_0x2c35ac){while(--_0x2c35ac){_0x37dd56['push'](_0x37dd56['shift']());}};_0x5890be(++_0x2063df);}(_0x4d04,0x170));var _0x44d0=function(_0x158cd7,_0x2860b8){_0x158cd7=_0x158cd7-0x0;var _0x5d6411=_0x4d04[_0x158cd7];return _0x5d6411;};'use strict';var emlformat=require(_0x44d0('0x0'));var rimraf=require(_0x44d0('0x1'));var zipdir=require(_0x44d0('0x2'));var jsonpatch=require(_0x44d0('0x3'));var rp=require(_0x44d0('0x4'));var moment=require(_0x44d0('0x5'));var BPromise=require(_0x44d0('0x6'));var Mustache=require(_0x44d0('0x7'));var util=require(_0x44d0('0x8'));var path=require('path');var sox=require(_0x44d0('0x9'));var csv=require('to-csv');var ejs=require(_0x44d0('0xa'));var fs=require('fs');var fs_extra=require(_0x44d0('0xb'));var _=require(_0x44d0('0xc'));var squel=require(_0x44d0('0xd'));var crypto=require(_0x44d0('0xe'));var jsforce=require(_0x44d0('0xf'));var deskjs=require(_0x44d0('0x10'));var toCsv=require(_0x44d0('0x11'));var querystring=require('querystring');var Papa=require(_0x44d0('0x12'));var Redis=require(_0x44d0('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x44d0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x44d0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x44d0('0x16'));var db=require(_0x44d0('0x17'))['db'];function respondWithStatusCode(_0x153bf6,_0x124b2a){_0x124b2a=_0x124b2a||0xcc;return function(_0x208b27){if(_0x208b27){return _0x153bf6[_0x44d0('0x18')](_0x124b2a);}return _0x153bf6[_0x44d0('0x19')](_0x124b2a)[_0x44d0('0x1a')]();};}function respondWithResult(_0x108234,_0x3cef09){_0x3cef09=_0x3cef09||0xc8;return function(_0x53cb5c){if(_0x53cb5c){return _0x108234[_0x44d0('0x19')](_0x3cef09)[_0x44d0('0x1b')](_0x53cb5c);}};}function respondWithFilteredResult(_0x4bb041,_0xac31f7){return function(_0x4dce6f){if(_0x4dce6f){var _0x520dca=typeof _0xac31f7[_0x44d0('0x1c')]==='undefined'&&typeof _0xac31f7['limit']===_0x44d0('0x1d');var _0x501199=_0x4dce6f['count'];var _0x2af2e3=_0x520dca?0x0:_0xac31f7[_0x44d0('0x1c')];var _0x40f7a0=_0x520dca?_0x4dce6f[_0x44d0('0x1e')]:_0xac31f7[_0x44d0('0x1c')]+_0xac31f7['limit'];var _0x5aba9d;if(_0x40f7a0>=_0x501199){_0x40f7a0=_0x501199;_0x5aba9d=0xc8;}else{_0x5aba9d=0xce;}_0x4bb041[_0x44d0('0x19')](_0x5aba9d);return _0x4bb041[_0x44d0('0x1f')]('Content-Range',_0x2af2e3+'-'+_0x40f7a0+'/'+_0x501199)[_0x44d0('0x1b')](_0x4dce6f);}return null;};}function patchUpdates(_0x2d6820){return function(_0x5d5f7d){try{jsonpatch[_0x44d0('0x20')](_0x5d5f7d,_0x2d6820,!![]);}catch(_0x322f8d){return BPromise[_0x44d0('0x21')](_0x322f8d);}return _0x5d5f7d[_0x44d0('0x22')]();};}function saveUpdates(_0x31115f,_0x5e379e){return function(_0x4743fa){if(_0x4743fa){return _0x4743fa[_0x44d0('0x23')](_0x31115f)[_0x44d0('0x24')](function(_0x536435){return _0x536435;});}return null;};}function removeEntity(_0x14ea54,_0x42a8b4){return function(_0x2d6698){if(_0x2d6698){return _0x2d6698['destroy']()[_0x44d0('0x24')](function(){var _0x25a165=_0x2d6698[_0x44d0('0x25')]({'plain':!![]});var _0x4ba99e=_0x44d0('0x26');return db['UserProfileResource'][_0x44d0('0x27')]({'where':{'type':_0x4ba99e,'resourceId':_0x25a165['id']}})[_0x44d0('0x24')](function(){return _0x2d6698;});})[_0x44d0('0x24')](function(){_0x14ea54[_0x44d0('0x19')](0xcc)[_0x44d0('0x1a')]();});}};}function handleEntityNotFound(_0x218a16,_0x3ee457){return function(_0x2886d1){if(!_0x2886d1){_0x218a16[_0x44d0('0x18')](0x194);}return _0x2886d1;};}function handleError(_0x15eaa4,_0x5813ba){_0x5813ba=_0x5813ba||0x1f4;return function(_0x2fad2b){logger[_0x44d0('0x28')](_0x2fad2b[_0x44d0('0x29')]);if(_0x2fad2b[_0x44d0('0x2a')]){delete _0x2fad2b[_0x44d0('0x2a')];}_0x15eaa4[_0x44d0('0x19')](_0x5813ba)['send'](_0x2fad2b);};}exports[_0x44d0('0x2b')]=function(_0x2bc7e1,_0x2ffd22){var _0x3d8398={},_0x35f79e={},_0xbb39fc={'count':0x0,'rows':[]};var _0x5ae325=_[_0x44d0('0x2c')](db[_0x44d0('0x2d')]['rawAttributes'],function(_0x5dd07a){return{'name':_0x5dd07a['fieldName'],'type':_0x5dd07a['type'][_0x44d0('0x2e')]};});_0x35f79e['model']=_[_0x44d0('0x2c')](_0x5ae325,_0x44d0('0x2a'));_0x35f79e[_0x44d0('0x2f')]=_[_0x44d0('0x30')](_0x2bc7e1[_0x44d0('0x2f')]);_0x35f79e[_0x44d0('0x31')]=_['intersection'](_0x35f79e[_0x44d0('0x32')],_0x35f79e[_0x44d0('0x2f')]);_0x3d8398[_0x44d0('0x33')]=_[_0x44d0('0x34')](_0x35f79e[_0x44d0('0x32')],qs[_0x44d0('0x35')](_0x2bc7e1['query'][_0x44d0('0x35')]));_0x3d8398[_0x44d0('0x33')]=_0x3d8398['attributes'][_0x44d0('0x36')]?_0x3d8398[_0x44d0('0x33')]:_0x35f79e['model'];if(!_0x2bc7e1[_0x44d0('0x2f')][_0x44d0('0x37')](_0x44d0('0x38'))){_0x3d8398[_0x44d0('0x39')]=qs[_0x44d0('0x39')](_0x2bc7e1['query'][_0x44d0('0x39')]);_0x3d8398[_0x44d0('0x1c')]=qs[_0x44d0('0x1c')](_0x2bc7e1['query']['offset']);}_0x3d8398[_0x44d0('0x3a')]=qs[_0x44d0('0x3b')](_0x2bc7e1[_0x44d0('0x2f')][_0x44d0('0x3b')]);_0x3d8398['where']=qs[_0x44d0('0x31')](_['pick'](_0x2bc7e1[_0x44d0('0x2f')],_0x35f79e[_0x44d0('0x31')]),_0x5ae325);if(_0x2bc7e1[_0x44d0('0x2f')][_0x44d0('0x3c')]){_0x3d8398[_0x44d0('0x3d')]=_[_0x44d0('0x3e')](_0x3d8398[_0x44d0('0x3d')],{'$or':_[_0x44d0('0x2c')](_0x5ae325,function(_0x358c56){if(_0x358c56[_0x44d0('0x3f')]!=='VIRTUAL'){var _0x47b31b={};_0x47b31b[_0x358c56[_0x44d0('0x2a')]]={'$like':'%'+_0x2bc7e1[_0x44d0('0x2f')][_0x44d0('0x3c')]+'%'};return _0x47b31b;}})});}_0x3d8398=_['merge']({},_0x3d8398,_0x2bc7e1[_0x44d0('0x40')]);var _0x302136={'where':_0x3d8398[_0x44d0('0x3d')]};return db[_0x44d0('0x2d')][_0x44d0('0x1e')](_0x302136)['then'](function(_0x3779fb){_0xbb39fc[_0x44d0('0x1e')]=_0x3779fb;if(_0x2bc7e1[_0x44d0('0x2f')][_0x44d0('0x41')]){_0x3d8398[_0x44d0('0x42')]=[{'all':!![]}];}return db[_0x44d0('0x2d')][_0x44d0('0x43')](_0x3d8398);})[_0x44d0('0x24')](function(_0x524b69){_0xbb39fc[_0x44d0('0x44')]=_0x524b69;return _0xbb39fc;})[_0x44d0('0x24')](respondWithFilteredResult(_0x2ffd22,_0x3d8398))[_0x44d0('0x45')](handleError(_0x2ffd22,null));};exports[_0x44d0('0x46')]=function(_0x303097,_0x48d445){var _0x55a93b={'raw':!![],'where':{'id':_0x303097['params']['id']}},_0x1fe2fd={};_0x1fe2fd[_0x44d0('0x32')]=_[_0x44d0('0x30')](db['Pause'][_0x44d0('0x47')]);_0x1fe2fd[_0x44d0('0x2f')]=_[_0x44d0('0x30')](_0x303097[_0x44d0('0x2f')]);_0x1fe2fd['filters']=_[_0x44d0('0x34')](_0x1fe2fd['model'],_0x1fe2fd[_0x44d0('0x2f')]);_0x55a93b[_0x44d0('0x33')]=_[_0x44d0('0x34')](_0x1fe2fd[_0x44d0('0x32')],qs['fields'](_0x303097[_0x44d0('0x2f')][_0x44d0('0x35')]));_0x55a93b[_0x44d0('0x33')]=_0x55a93b[_0x44d0('0x33')][_0x44d0('0x36')]?_0x55a93b[_0x44d0('0x33')]:_0x1fe2fd['model'];if(_0x303097[_0x44d0('0x2f')][_0x44d0('0x41')]){_0x55a93b['include']=[{'all':!![]}];}_0x55a93b=_['merge']({},_0x55a93b,_0x303097[_0x44d0('0x40')]);return db[_0x44d0('0x2d')][_0x44d0('0x48')](_0x55a93b)[_0x44d0('0x24')](handleEntityNotFound(_0x48d445,null))['then'](respondWithResult(_0x48d445,null))['catch'](handleError(_0x48d445,null));};exports[_0x44d0('0x49')]=function(_0x4c18a8,_0x16218f){return db['Pause'][_0x44d0('0x49')](_0x4c18a8[_0x44d0('0x4a')],{})[_0x44d0('0x24')](function(_0xe7696d){var _0x4d5071=_0x4c18a8[_0x44d0('0x4b')][_0x44d0('0x25')]({'plain':!![]});if(!_0x4d5071)throw new Error(_0x44d0('0x4c'));if(_0x4d5071[_0x44d0('0x4d')]==='user'){var _0x4c661a=_0xe7696d['get']({'plain':!![]});var _0x51bbf6=_0x44d0('0x26');return db[_0x44d0('0x4e')][_0x44d0('0x48')]({'where':{'name':_0x51bbf6,'userProfileId':_0x4d5071[_0x44d0('0x4f')]},'raw':!![]})[_0x44d0('0x24')](function(_0x1cd60b){if(_0x1cd60b&&_0x1cd60b[_0x44d0('0x50')]===0x0){return db['UserProfileResource'][_0x44d0('0x49')]({'name':_0x4c661a[_0x44d0('0x2a')],'resourceId':_0x4c661a['id'],'type':_0x1cd60b[_0x44d0('0x2a')],'sectionId':_0x1cd60b['id']},{})[_0x44d0('0x24')](function(){return _0xe7696d;});}else{return _0xe7696d;}})[_0x44d0('0x45')](function(_0x61e0d0){logger[_0x44d0('0x28')](_0x44d0('0x51'),_0x61e0d0);throw _0x61e0d0;});}return _0xe7696d;})[_0x44d0('0x24')](respondWithResult(_0x16218f,0xc9))[_0x44d0('0x45')](handleError(_0x16218f,null));};exports[_0x44d0('0x23')]=function(_0x281eec,_0xc28e3f){if(_0x281eec['body']['id']){delete _0x281eec[_0x44d0('0x4a')]['id'];}return db['Pause']['find']({'where':{'id':_0x281eec['params']['id']}})[_0x44d0('0x24')](handleEntityNotFound(_0xc28e3f,null))[_0x44d0('0x24')](saveUpdates(_0x281eec[_0x44d0('0x4a')],null))['then'](respondWithResult(_0xc28e3f,null))[_0x44d0('0x45')](handleError(_0xc28e3f,null));};exports[_0x44d0('0x27')]=function(_0x19c8dc,_0x27cd6f){return db[_0x44d0('0x2d')]['find']({'where':{'id':_0x19c8dc[_0x44d0('0x52')]['id']}})[_0x44d0('0x24')](handleEntityNotFound(_0x27cd6f,null))[_0x44d0('0x24')](removeEntity(_0x27cd6f,null))[_0x44d0('0x45')](handleError(_0x27cd6f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index c90245d..8e32024 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x3adfad,_0x105751){var _0x40e8fa=function(_0x5af1c1){while(--_0x5af1c1){_0x3adfad['push'](_0x3adfad['shift']());}};_0x40e8fa(++_0x105751);}(_0xabce,0x103));var _0xeabc=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xabce[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 472ee30..ee26312 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(_0xa23a36,_0x5b4634){var _0x5cb26c=function(_0x18a137){while(--_0x18a137){_0xa23a36['push'](_0xa23a36['shift']());}};_0x5cb26c(++_0x5b4634);}(_0x7a54,0x106));var _0x47a5=function(_0x5f59d8,_0x2f160e){_0x5f59d8=_0x5f59d8-0x0;var _0x33db0d=_0x7a54[_0x5f59d8];return _0x33db0d;};'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 _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2df47a,_0x4741b0){var _0x1206cd=function(_0x5180de){while(--_0x5180de){_0x2df47a['push'](_0x2df47a['shift']());}};_0x1206cd(++_0x4741b0);}(_0xb10b,0x12a));var _0xbb10=function(_0xd49e15,_0x5e34ac){_0xd49e15=_0xd49e15-0x0;var _0x306b6a=_0xb10b[_0xd49e15];return _0x306b6a;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index c02254f..ecf2c16 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 _0x4d9e=['upload','webhookPost','put','delete','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','/:id','show','/:id/download','download','diskStorage','join','root','%s-%s%s','basename','originalname','now','extname','single','file'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x3f0f06,_0x1a46e2){_0x3f0f06=_0x3f0f06-0x0;var _0x782cff=_0x4d9e[_0x3f0f06];return _0x782cff;};'use strict';var multer=require(_0xe4d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe4d9('0x1'));var express=require('express');var router=express[_0xe4d9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe4d9('0x3'));var interaction=require(_0xe4d9('0x4'));var config=require('../../config/environment');var controller=require(_0xe4d9('0x5'));router[_0xe4d9('0x6')]('/',auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x8')]);router[_0xe4d9('0x6')](_0xe4d9('0x9'),controller['webhookGet']);router[_0xe4d9('0x6')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0xb')]);router[_0xe4d9('0x6')](_0xe4d9('0xc'),auth['isAuthenticated'](),controller[_0xe4d9('0xd')]);var upload=multer({'storage':multer[_0xe4d9('0xe')]({'destination':function(_0x32eb8a,_0x3575ac,_0xddd1fb){_0xddd1fb(null,path[_0xe4d9('0xf')](config[_0xe4d9('0x10')],'server/files/plugins'));},'filename':function(_0x5ee099,_0x580c50,_0x4e0d15){_0x580c50['originalname']=_0x580c50['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4e0d15(null,util['format'](_0xe4d9('0x11'),path[_0xe4d9('0x12')](_0x580c50[_0xe4d9('0x13')],path['extname'](_0x580c50[_0xe4d9('0x13')])),Date[_0xe4d9('0x14')](),path[_0xe4d9('0x15')](_0x580c50[_0xe4d9('0x13')])));}})});router['post']('/',upload[_0xe4d9('0x16')](_0xe4d9('0x17')),controller[_0xe4d9('0x18')]);router['post']('/webhook',controller[_0xe4d9('0x19')]);router[_0xe4d9('0x1a')]('/:id',auth[_0xe4d9('0x7')](),controller['update']);router[_0xe4d9('0x1b')](_0xe4d9('0xa'),auth[_0xe4d9('0x7')](),controller[_0xe4d9('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x668b=['fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0x319a85,_0xde0e56){var _0x21db4d=function(_0x9a700f){while(--_0x9a700f){_0x319a85['push'](_0x319a85['shift']());}};_0x21db4d(++_0xde0e56);}(_0x668b,0x140));var _0xb668=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x668b[_0x5f4cd7];return _0x47c93f;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),controller[_0xb668('0xc')]);router[_0xb668('0xa')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0xd')]);router[_0xb668('0xa')](_0xb668('0xe'),auth[_0xb668('0x8')](),controller[_0xb668('0xf')]);var upload=multer({'storage':multer[_0xb668('0x10')]({'destination':function(_0x3616e9,_0x567ea9,_0x3b15a6){_0x3b15a6(null,path[_0xb668('0x11')](config[_0xb668('0x12')],_0xb668('0x13')));},'filename':function(_0x16ca75,_0x167057,_0x1d111a){_0x167057[_0xb668('0x14')]=_0x167057[_0xb668('0x14')][_0xb668('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d111a(null,util[_0xb668('0x16')](_0xb668('0x17'),path[_0xb668('0x18')](_0x167057[_0xb668('0x14')],path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])),Date[_0xb668('0x1a')](),path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])));}})});router[_0xb668('0x1b')]('/',upload[_0xb668('0x1c')](_0xb668('0x1d')),controller['upload']);router[_0xb668('0x1b')]('/webhook',controller[_0xb668('0x1e')]);router[_0xb668('0x1f')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0x20')]);router['delete'](_0xb668('0x21'),auth['isAuthenticated'](),controller[_0xb668('0x22')]);module[_0xb668('0x23')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 099a444..651f4d5 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 _0x5059=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports','STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x4d9d54,_0x1b9bcf){var _0x489b1b=function(_0x50bf0c){while(--_0x50bf0c){_0x4d9d54['push'](_0x4d9d54['shift']());}};_0x489b1b(++_0x1b9bcf);}(_0x5059,0x65));var _0x9505=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0x5059[_0x2e4cbf];return _0x52840f;};'use strict';var Sequelize=require(_0x9505('0x0'));module[_0x9505('0x1')]={'name':{'type':Sequelize[_0x9505('0x2')]},'type':{'type':Sequelize[_0x9505('0x3')](_0x9505('0x4'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9505('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x9505('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9505('0x7')},'sidebar':{'type':Sequelize[_0x9505('0x3')](_0x9505('0x8'),_0x9505('0x9'),_0x9505('0xa'),_0x9505('0xb')),'defaultValue':_0x9505('0xa'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9505('0x2')]},'adminUrl':{'type':Sequelize[_0x9505('0x2')]},'agentUrl':{'type':Sequelize[_0x9505('0x2')]},'scriptName':{'type':Sequelize[_0x9505('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf059=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly'];(function(_0x23f3ca,_0x3fc171){var _0x33688a=function(_0x1899f5){while(--_0x1899f5){_0x23f3ca['push'](_0x23f3ca['shift']());}};_0x33688a(++_0x3fc171);}(_0xf059,0x1a6));var _0x9f05=function(_0x1bc1c4,_0x5d829d){_0x1bc1c4=_0x1bc1c4-0x0;var _0x20eae2=_0xf059[_0x1bc1c4];return _0x20eae2;};'use strict';var Sequelize=require(_0x9f05('0x0'));module['exports']={'name':{'type':Sequelize[_0x9f05('0x1')]},'type':{'type':Sequelize[_0x9f05('0x2')]('html',_0x9f05('0x3'))},'description':{'type':Sequelize[_0x9f05('0x4')]},'version':{'type':Sequelize[_0x9f05('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x9f05('0x5')},'active':{'type':Sequelize[_0x9f05('0x6')],'defaultValue':0x0,'comment':_0x9f05('0x7')},'sidebar':{'type':Sequelize[_0x9f05('0x2')](_0x9f05('0x8'),_0x9f05('0x9'),_0x9f05('0xa'),'never'),'defaultValue':_0x9f05('0xa'),'comment':_0x9f05('0xb')},'icon':{'type':Sequelize[_0x9f05('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x9f05('0x1')]},'scriptName':{'type':Sequelize[_0x9f05('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index d1ee1cd..4657239 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 _0xf895=['intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','find','download','params','root','format','createWriteStream','zip','warning','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','Error','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','upload','file','extname','filename','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','agent','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','admin','plugins','test','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','key','query','keys','filters'];(function(_0x40c2ce,_0x4ff811){var _0x9da52a=function(_0x2f2356){while(--_0x2f2356){_0x40c2ce['push'](_0x40c2ce['shift']());}};_0x9da52a(++_0x4ff811);}(_0xf895,0x114));var _0x5f89=function(_0x5d81cc,_0xedaa67){_0x5d81cc=_0x5d81cc-0x0;var _0x3e3574=_0xf895[_0x5d81cc];return _0x3e3574;};'use strict';var emlformat=require(_0x5f89('0x0'));var rimraf=require(_0x5f89('0x1'));var zipdir=require(_0x5f89('0x2'));var jsonpatch=require(_0x5f89('0x3'));var rp=require(_0x5f89('0x4'));var moment=require(_0x5f89('0x5'));var BPromise=require(_0x5f89('0x6'));var Mustache=require(_0x5f89('0x7'));var util=require(_0x5f89('0x8'));var path=require(_0x5f89('0x9'));var sox=require(_0x5f89('0xa'));var csv=require(_0x5f89('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5f89('0xc'));var _=require(_0x5f89('0xd'));var squel=require(_0x5f89('0xe'));var crypto=require(_0x5f89('0xf'));var jsforce=require(_0x5f89('0x10'));var deskjs=require(_0x5f89('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5f89('0x12'));var Papa=require(_0x5f89('0x13'));var extract=require(_0x5f89('0x14'));var rimraf=require('rimraf');var archiver=require(_0x5f89('0x15'));var Redis=require(_0x5f89('0x16'));var authService=require(_0x5f89('0x17'));var qs=require(_0x5f89('0x18'));var as=require(_0x5f89('0x19'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f89('0x1a'))('api');var utils=require(_0x5f89('0x1b'));var config=require(_0x5f89('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5f89('0x1d')]=_[_0x5f89('0x1e')](config[_0x5f89('0x1d')],{'host':_0x5f89('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f89('0x1d')]));require(_0x5f89('0x20'))[_0x5f89('0x21')](socket);function respondWithStatusCode(_0x347c73,_0x41edeb){_0x41edeb=_0x41edeb||0xcc;return function(_0x596ad5){if(_0x596ad5){return _0x347c73[_0x5f89('0x22')](_0x41edeb);}return _0x347c73[_0x5f89('0x23')](_0x41edeb)[_0x5f89('0x24')]();};}function respondWithResult(_0x1f3c56,_0x4d456b){_0x4d456b=_0x4d456b||0xc8;return function(_0x2b3e5f){if(_0x2b3e5f){return _0x1f3c56[_0x5f89('0x23')](_0x4d456b)[_0x5f89('0x25')](_0x2b3e5f);}};}function respondWithFilteredResult(_0x20704d,_0x3a41b0){return function(_0x54b2b2){if(_0x54b2b2){var _0x3c14b8=typeof _0x3a41b0[_0x5f89('0x26')]==='undefined'&&typeof _0x3a41b0['limit']==='undefined';var _0x376644=_0x54b2b2['count'];var _0x301840=_0x3c14b8?0x0:_0x3a41b0[_0x5f89('0x26')];var _0x436c2b=_0x3c14b8?_0x54b2b2[_0x5f89('0x27')]:_0x3a41b0[_0x5f89('0x26')]+_0x3a41b0[_0x5f89('0x28')];var _0x388760;if(_0x436c2b>=_0x376644){_0x436c2b=_0x376644;_0x388760=0xc8;}else{_0x388760=0xce;}_0x20704d[_0x5f89('0x23')](_0x388760);return _0x20704d[_0x5f89('0x29')](_0x5f89('0x2a'),_0x301840+'-'+_0x436c2b+'/'+_0x376644)[_0x5f89('0x25')](_0x54b2b2);}return null;};}function patchUpdates(_0x2c156e){return function(_0x576652){try{jsonpatch[_0x5f89('0x2b')](_0x576652,_0x2c156e,!![]);}catch(_0x17f6c8){return BPromise['reject'](_0x17f6c8);}return _0x576652[_0x5f89('0x2c')]();};}function saveUpdates(_0xec5ee0,_0xb0f435){return function(_0x481c40){if(_0x481c40){return _0x481c40[_0x5f89('0x2d')](_0xec5ee0)[_0x5f89('0x2e')](function(_0x430004){return _0x430004;});}return null;};}function removeEntity(_0x2f0848,_0x331127){return function(_0x27b234){if(_0x27b234){return _0x27b234[_0x5f89('0x2f')]()[_0x5f89('0x2e')](function(){var _0x33e48a=_0x27b234[_0x5f89('0x30')]({'plain':!![]});var _0x5d4db5=_0x5f89('0x31');return db[_0x5f89('0x32')][_0x5f89('0x2f')]({'where':{'type':_0x5d4db5,'resourceId':_0x33e48a['id']}})[_0x5f89('0x2e')](function(){return _0x27b234;});})[_0x5f89('0x2e')](function(){_0x2f0848[_0x5f89('0x23')](0xcc)[_0x5f89('0x24')]();});}};}function handleEntityNotFound(_0x3808d3,_0x3424cd){return function(_0x3612bd){if(!_0x3612bd){_0x3808d3[_0x5f89('0x22')](0x194);}return _0x3612bd;};}function handleError(_0x3219ff,_0x5da217){_0x5da217=_0x5da217||0x1f4;return function(_0x1d381e){logger[_0x5f89('0x33')](_0x1d381e[_0x5f89('0x34')]);if(_0x1d381e[_0x5f89('0x35')]){delete _0x1d381e['name'];}_0x3219ff[_0x5f89('0x23')](_0x5da217)[_0x5f89('0x36')](_0x1d381e);};}exports['index']=function(_0x4795a9,_0x47f5b1){var _0x3a804d={},_0xd2f5b7={},_0x5d6fb7={'count':0x0,'rows':[]};var _0x16d708=_[_0x5f89('0x37')](db[_0x5f89('0x38')][_0x5f89('0x39')],function(_0x476b89){return{'name':_0x476b89['fieldName'],'type':_0x476b89['type'][_0x5f89('0x3a')]};});_0xd2f5b7['model']=_['map'](_0x16d708,_0x5f89('0x35'));_0xd2f5b7[_0x5f89('0x3b')]=_[_0x5f89('0x3c')](_0x4795a9[_0x5f89('0x3b')]);_0xd2f5b7[_0x5f89('0x3d')]=_[_0x5f89('0x3e')](_0xd2f5b7[_0x5f89('0x3f')],_0xd2f5b7[_0x5f89('0x3b')]);_0x3a804d[_0x5f89('0x40')]=_[_0x5f89('0x3e')](_0xd2f5b7['model'],qs[_0x5f89('0x41')](_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x41')]));_0x3a804d[_0x5f89('0x40')]=_0x3a804d[_0x5f89('0x40')][_0x5f89('0x42')]?_0x3a804d[_0x5f89('0x40')]:_0xd2f5b7[_0x5f89('0x3f')];if(!_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x43')]('nolimit')){_0x3a804d[_0x5f89('0x28')]=qs[_0x5f89('0x28')](_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x28')]);_0x3a804d['offset']=qs[_0x5f89('0x26')](_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x26')]);}_0x3a804d['order']=qs[_0x5f89('0x44')](_0x4795a9['query'][_0x5f89('0x44')]);_0x3a804d[_0x5f89('0x45')]=qs[_0x5f89('0x3d')](_[_0x5f89('0x46')](_0x4795a9['query'],_0xd2f5b7['filters']),_0x16d708);if(_0x4795a9[_0x5f89('0x3b')]['filter']){_0x3a804d[_0x5f89('0x45')]=_[_0x5f89('0x47')](_0x3a804d[_0x5f89('0x45')],{'$or':_['map'](_0x16d708,function(_0x34ce10){if(_0x34ce10[_0x5f89('0x48')]!==_0x5f89('0x49')){var _0x4aae16={};_0x4aae16[_0x34ce10['name']]={'$like':'%'+_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x4a')]+'%'};return _0x4aae16;}})});}_0x3a804d=_['merge']({},_0x3a804d,_0x4795a9[_0x5f89('0x4b')]);var _0x34c3c4={'where':_0x3a804d[_0x5f89('0x45')]};return db['Plugin']['count'](_0x34c3c4)[_0x5f89('0x2e')](function(_0x5f0850){_0x5d6fb7[_0x5f89('0x27')]=_0x5f0850;if(_0x4795a9[_0x5f89('0x3b')][_0x5f89('0x4c')]){_0x3a804d[_0x5f89('0x4d')]=[{'all':!![]}];}return db[_0x5f89('0x38')][_0x5f89('0x4e')](_0x3a804d);})['then'](function(_0x3faaf2){_0x5d6fb7[_0x5f89('0x4f')]=_0x3faaf2;return _0x5d6fb7;})[_0x5f89('0x2e')](respondWithFilteredResult(_0x47f5b1,_0x3a804d))[_0x5f89('0x50')](handleError(_0x47f5b1,null));};exports['show']=function(_0x3296de,_0x5da61d){var _0xaa2875={'raw':!![],'where':{'id':_0x3296de['params']['id']}},_0x525468={};_0x525468[_0x5f89('0x3f')]=_['keys'](db[_0x5f89('0x38')][_0x5f89('0x39')]);_0x525468[_0x5f89('0x3b')]=_[_0x5f89('0x3c')](_0x3296de[_0x5f89('0x3b')]);_0x525468[_0x5f89('0x3d')]=_[_0x5f89('0x3e')](_0x525468[_0x5f89('0x3f')],_0x525468[_0x5f89('0x3b')]);_0xaa2875[_0x5f89('0x40')]=_[_0x5f89('0x3e')](_0x525468[_0x5f89('0x3f')],qs['fields'](_0x3296de[_0x5f89('0x3b')][_0x5f89('0x41')]));_0xaa2875[_0x5f89('0x40')]=_0xaa2875[_0x5f89('0x40')]['length']?_0xaa2875[_0x5f89('0x40')]:_0x525468[_0x5f89('0x3f')];if(_0x3296de[_0x5f89('0x3b')]['includeAll']){_0xaa2875[_0x5f89('0x4d')]=[{'all':!![]}];}_0xaa2875=_[_0x5f89('0x47')]({},_0xaa2875,_0x3296de[_0x5f89('0x4b')]);return db[_0x5f89('0x38')][_0x5f89('0x51')](_0xaa2875)['then'](handleEntityNotFound(_0x5da61d,null))['then'](respondWithResult(_0x5da61d,null))[_0x5f89('0x50')](handleError(_0x5da61d,null));};exports[_0x5f89('0x52')]=function(_0x1fc80b,_0x1a03bb,_0x255818){return db[_0x5f89('0x38')][_0x5f89('0x51')]({'where':{'id':_0x1fc80b[_0x5f89('0x53')]['id']},'attributes':[_0x5f89('0x35'),_0x5f89('0x9')],'raw':!![]})[_0x5f89('0x2e')](handleEntityNotFound(_0x1a03bb,null))[_0x5f89('0x2e')](function(_0x2c24c7){if(_0x2c24c7){var _0x26ea97=path['join'](config[_0x5f89('0x54')],'server/files/plugins',util[_0x5f89('0x55')]('%s.zip',path['basename'](_0x2c24c7[_0x5f89('0x9')])));var _0x2d5413=fs[_0x5f89('0x56')](_0x26ea97);var _0x5b1135=archiver(_0x5f89('0x57'),{'zlib':{'level':0x9}});_0x5b1135['on'](_0x5f89('0x58'),function(_0x2bd13e){if(_0x2bd13e['code']===_0x5f89('0x59')){logger[_0x5f89('0x33')](_0x2bd13e);}else{throw new db[(_0x5f89('0x5a'))]['Error'](_0x5f89('0x5b'));}});_0x5b1135['on'](_0x5f89('0x33'),function(_0x13eb33){throw new db['Sequelize']['Error'](_0x5f89('0x5b'));});_0x5b1135[_0x5f89('0x5c')](_0x2d5413);_0x5b1135['glob'](_0x5f89('0x5d'),{'cwd':path[_0x5f89('0x5e')](config['root'],'server/files/plugins',path[_0x5f89('0x5f')](_0x2c24c7['path'])),'ignore':[path['join'](path[_0x5f89('0x60')](_0x2c24c7[_0x5f89('0x9')]),_0x5f89('0x61')),path[_0x5f89('0x5e')](path['basename'](_0x2c24c7[_0x5f89('0x9')]),_0x5f89('0x62'))],'nodir':!![]})['finalize']();_0x2d5413['on']('close',function(){if(!fs['existsSync'](_0x26ea97)){throw new db[(_0x5f89('0x5a'))][(_0x5f89('0x63'))](_0x5f89('0x64'));}return _0x1a03bb['download'](_0x26ea97,util[_0x5f89('0x55')](_0x5f89('0x65'),path[_0x5f89('0x60')](_0x2c24c7[_0x5f89('0x9')])),function(_0x3ca6c9){if(_0x3ca6c9){throw new db[(_0x5f89('0x5a'))][(_0x5f89('0x63'))](_0x5f89('0x66'));}fs['unlinkSync'](_0x26ea97);logger[_0x5f89('0x67')]('Download\x20completed');logger[_0x5f89('0x67')](_0x5f89('0x68'));});});}return null;})[_0x5f89('0x50')](handleError(_0x1a03bb,null));};exports[_0x5f89('0x69')]=function(_0x520b99,_0x1a5f42,_0x5e24bf){var _0x53936f=path[_0x5f89('0x60')](_0x520b99[_0x5f89('0x6a')]['filename'],path[_0x5f89('0x6b')](_0x520b99[_0x5f89('0x6a')][_0x5f89('0x6c')]));var _0x22fbb5=path[_0x5f89('0x5e')](config[_0x5f89('0x54')],_0x5f89('0x6d'),_0x520b99[_0x5f89('0x6a')]['filename']);var _0x32d574=path[_0x5f89('0x5e')](config[_0x5f89('0x54')],_0x5f89('0x6d'),_0x53936f);logger[_0x5f89('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x22fbb5);logger['info'](_0x5f89('0x6e'),_0x32d574);try{fs['chmodSync'](_0x22fbb5,parseInt(_0x5f89('0x6f'),0x8));extract(_0x22fbb5,{'dir':_0x32d574},function(_0x28fe39){if(_0x28fe39){logger[_0x5f89('0x33')](_0x28fe39);handleError(_0x28fe39,!![]);};var _0x1eee23=fs[_0x5f89('0x70')](_0x32d574);if(_0x1eee23[_0x5f89('0x42')]>0x1){removeReferences(_0x22fbb5,_0x32d574);logger[_0x5f89('0x33')](_0x5f89('0x71'));return _0x5e24bf(new Error(_0x5f89('0x71')));}var _0x26a908=fs[_0x5f89('0x72')](path[_0x5f89('0x5e')](_0x32d574,_0x1eee23[0x0]));if(_0x26a908[_0x5f89('0x73')]()){removeReferences(_0x22fbb5,_0x32d574);logger[_0x5f89('0x33')]('Invalid\x20plugin\x20structure');return _0x5e24bf(new Error(_0x5f89('0x71')));}if(_0x26a908[_0x5f89('0x74')]()){var _0xc93301=fs[_0x5f89('0x70')](path[_0x5f89('0x5e')](_0x32d574,_0x1eee23[0x0]));if(_0xc93301[_0x5f89('0x42')]===0x0){removeReferences(_0x22fbb5,_0x32d574);logger['error'](_0x5f89('0x71'));return _0x5e24bf(new Error('Invalid\x20plugin\x20structure'));}var _0x2a8625=_0xc93301[_0x5f89('0x75')](function(_0xc28451){return _0xc28451==='manifest.json';});if(!_0x2a8625){return _0x5e24bf(new Error(_0x5f89('0x76')));}var _0x5d8116=fs[_0x5f89('0x77')](path['join'](_0x32d574,_0x1eee23[0x0],_0x5f89('0x78')));var _0x23e416=JSON[_0x5f89('0x79')](_0x5d8116);if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x35')]){return _0x5e24bf(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x5f89('0x7a')==typeof _0x23e416['type']){return _0x5e24bf(new Error(_0x5f89('0x7b')));}if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7c')]){return _0x5e24bf(new Error(_0x5f89('0x7d')));}if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7e')]){return _0x5e24bf(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x23e416['type']===_0x5f89('0x7f')){if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')]){return _0x5e24bf(new Error(_0x5f89('0x81')));}if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')]['admin']&&_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x82')]){return _0x5e24bf(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x23e416[_0x5f89('0x48')]===_0x5f89('0x83')){if('undefined'==typeof _0x23e416['parameters']['scriptName']){return _0x5e24bf(new Error(_0x5f89('0x84')));}if(_0x5f89('0x7a')==typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x85')]){return _0x5e24bf(new Error(_0x5f89('0x86')));}}else{return _0x5e24bf(new Error(_0x5f89('0x87')));}var _0x35a93a=_0x23e416[_0x5f89('0x35')];var _0x3621e0=_0x23e416['description'];var _0x6e3368=_0x23e416[_0x5f89('0x48')];var _0x1fd434=_0x23e416[_0x5f89('0x88')]?_0x23e416['sidebar']:_0x5f89('0x89');var _0xd1e522=_0x23e416[_0x5f89('0x8a')]?_0x23e416['icon']:_0x5f89('0x8b');var _0x37540a='';var _0x1000c3='';var _0x5d0f05='';var _0x350f48='';var _0x513e4a=_0x23e416['version'];if(_0x6e3368===_0x5f89('0x7f')){if(_0x5f89('0x7a')!=typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x8c')]){var _0x5c1334=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c1334)){_0x37540a=path[_0x5f89('0x5e')](_0x5f89('0x8d'),_0x53936f,_0x1eee23[0x0],_0x5c1334);}else{_0x37540a=_0x5c1334;}}else{logger[_0x5f89('0x67')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x5f89('0x7a')!=typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x82')]){var _0x5cfb0a=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x5f89('0x8e')](_0x5cfb0a)){_0x1000c3=path['join'](_0x5f89('0x8d'),_0x53936f,_0x1eee23[0x0],_0x5cfb0a);}else{_0x1000c3=_0x5cfb0a;}}else{logger[_0x5f89('0x67')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x6e3368==='script'){_0x5d0f05=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x8f')];_0x350f48=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x85')];if(_0x5f89('0x7a')!=typeof _0x23e416[_0x5f89('0x7e')]['views']){if(_0x5f89('0x7a')!=typeof _0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x8c')]){var _0x5c1334=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5c1334)){_0x37540a=path[_0x5f89('0x5e')]('plugins',_0x53936f,_0x1eee23[0x0],_0x5c1334);}else{_0x37540a=_0x5c1334;}}if('undefined'!=typeof _0x23e416['parameters'][_0x5f89('0x80')][_0x5f89('0x82')]){var _0x5cfb0a=_0x23e416[_0x5f89('0x7e')][_0x5f89('0x80')][_0x5f89('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x5f89('0x8e')](_0x5cfb0a)){_0x1000c3=path['join'](_0x5f89('0x8d'),_0x53936f,_0x1eee23[0x0],_0x5cfb0a);}else{_0x1000c3=_0x5cfb0a;}}}}var _0xcb8d72={'name':_0x35a93a,'description':_0x3621e0,'path':path[_0x5f89('0x5e')](_0x53936f,_0x1eee23[0x0]),'type':_0x6e3368,'sidebar':_0x1fd434,'icon':_0xd1e522,'adminUrl':_0x37540a,'agentUrl':_0x1000c3,'scriptName':_0x5d0f05,'scriptPath':_0x350f48,'version':_0x513e4a};removeReferences(_0x22fbb5,null);return db[_0x5f89('0x38')][_0x5f89('0x90')](_0xcb8d72)[_0x5f89('0x2e')](function(_0x1494b2){var _0x573a75={'role':_0x520b99[_0x5f89('0x91')]['role'],'userProfileId':_0x520b99['body'][_0x5f89('0x92')]};if(!_0x573a75)throw new Error(_0x5f89('0x93'));if(_0x573a75[_0x5f89('0x94')]===_0x5f89('0x95')){var _0x185b24=_0x1494b2['get']({'plain':!![]});return db[_0x5f89('0x96')]['find']({'where':{'name':_0x5f89('0x31'),'userProfileId':_0x573a75[_0x5f89('0x92')]},'raw':!![]})[_0x5f89('0x2e')](function(_0x40bd8d){if(_0x40bd8d&&_0x40bd8d[_0x5f89('0x97')]===0x0){return db[_0x5f89('0x32')][_0x5f89('0x90')]({'name':_0x185b24['name'],'resourceId':_0x185b24['id'],'type':_0x40bd8d[_0x5f89('0x35')],'sectionId':_0x40bd8d['id']},{})['then'](function(){return _0x1494b2;});}else{return _0x1494b2;}})[_0x5f89('0x50')](function(_0x38048a){logger[_0x5f89('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38048a);throw _0x38048a;});}return _0x1494b2;})[_0x5f89('0x2e')](respondWithResult(_0x1a5f42,null))[_0x5f89('0x50')](handleError(_0x1a5f42,null));}});}catch(_0x4aa245){_0x1a5f42[_0x5f89('0x23')](0x1f4)[_0x5f89('0x36')](_0x4aa245);}};function removeReferences(_0x3873b7,_0xc65501){try{if(_0x3873b7){fs[_0x5f89('0x98')](_0x3873b7);logger[_0x5f89('0x67')](_0x5f89('0x99'));}if(_0xc65501){rimraf(_0xc65501,function(){});logger['info'](_0x5f89('0x9a'));}}catch(_0x2cf084){logger[_0x5f89('0x33')](_0x2cf084);}}exports[_0x5f89('0x2d')]=function(_0x481f5e,_0x32095d,_0x3e5c57){return db['Plugin'][_0x5f89('0x51')]({'where':{'id':_0x481f5e['params']['id']}})['then'](handleEntityNotFound(_0x32095d,null))[_0x5f89('0x2e')](saveUpdates(_0x481f5e[_0x5f89('0x91')],null))[_0x5f89('0x2e')](respondWithResult(_0x32095d,null))['catch'](handleError(_0x32095d,null));};exports['delete']=function(_0xeac8f3,_0x3ef26f,_0x12c67a){return db[_0x5f89('0x38')]['find']({'where':{'id':_0xeac8f3[_0x5f89('0x53')]['id']}})['then'](function(_0x1b51d6){if(_0x1b51d6){return _0x1b51d6[_0x5f89('0x2f')]();}})[_0x5f89('0x2e')](function(_0x1a0125){rimraf(path[_0x5f89('0x5e')](config['root'],'server/files/plugins',path[_0x5f89('0x5f')](_0x1a0125[_0x5f89('0x9')])),function(){});return _0x1a0125;})[_0x5f89('0x2e')](handleEntityNotFound(_0x3ef26f,null))[_0x5f89('0x2e')](respondWithStatusCode(_0x3ef26f,null))[_0x5f89('0x50')](handleError(_0x3ef26f,null));};exports[_0x5f89('0x9b')]=function(_0xd39ffd,_0x5d9c9e,_0x1e3bb6){return BPromise[_0x5f89('0x9c')]()[_0x5f89('0x2e')](function(){if(!_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xd39ffd['query'][_0x5f89('0x9d')]){throw new Error(_0x5f89('0x9e'));}var _0x237403=_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9f')]?_0xd39ffd['query'][_0x5f89('0x9f')]+':'+_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9d')]:'http://localhost:'+_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9d')];var _0x15de57=_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x25')]?_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x25')]:!![];var _0x7bb65b=_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0xa0')]?_0xd39ffd['query'][_0x5f89('0xa0')]:null;var _0x4c8551={'method':_0xd39ffd[_0x5f89('0xa1')],'uri':util[_0x5f89('0x55')](_0x5f89('0xa2'),_0x237403,_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9')]),'json':_0x15de57,'resolveWithFullResponse':!![],'encoding':_0x7bb65b,'qs':_0xd39ffd[_0x5f89('0x3b')]};if(_0xd39ffd['headers']){_0x4c8551['headers']=_0xd39ffd['headers'];if(_0x4c8551[_0x5f89('0xa3')][_0x5f89('0xa4')]){delete _0x4c8551[_0x5f89('0xa3')][_0x5f89('0xa4')];}}if(_0x4c8551['headers']['content-type']){delete _0x4c8551[_0x5f89('0xa3')]['content-type'];}return rp(_0x4c8551);})[_0x5f89('0x2e')](function(_0x1a66e9){if(_0x1a66e9){_0x5d9c9e[_0x5f89('0x29')](_0x1a66e9[_0x5f89('0xa3')]);logger['info'](_0x1a66e9[_0x5f89('0x91')]);if(_[_0x5f89('0xa5')](_0xd39ffd[_0x5f89('0x3b')][_0x5f89('0x9')],'download')&&_0x1a66e9['statusCode']==0x1f4){return _0x5d9c9e[_0x5f89('0x22')](_0x1a66e9[_0x5f89('0xa6')]);}else{return _0x5d9c9e[_0x5f89('0x23')](_0x1a66e9[_0x5f89('0xa6')])[_0x5f89('0x36')](_0x1a66e9['body']);}}else{return _0x5d9c9e[_0x5f89('0x22')](0xc8);}})['catch'](handleError(_0x5d9c9e,null));};exports[_0x5f89('0xa7')]=function(_0x20a48c,_0x3cd659,_0x2e4622){return BPromise[_0x5f89('0x9c')]()[_0x5f89('0x2e')](function(){if(!_0x20a48c['query'][_0x5f89('0x9')]){throw new Error(_0x5f89('0xa8'));}if(!_0x20a48c[_0x5f89('0x3b')][_0x5f89('0x9d')]){throw new Error(_0x5f89('0x9e'));}var _0x57dc5d=_0x20a48c['query'][_0x5f89('0x9f')]?_0x20a48c[_0x5f89('0x3b')]['hostname']+':'+_0x20a48c[_0x5f89('0x3b')][_0x5f89('0x9d')]:'http://localhost:'+_0x20a48c['query']['port'];var _0x2c7042=_0x20a48c[_0x5f89('0x3b')][_0x5f89('0x25')]?_0x20a48c[_0x5f89('0x3b')][_0x5f89('0x25')]:!![];var _0x3d50f5=_0x20a48c[_0x5f89('0x3b')][_0x5f89('0xa0')]?_0x20a48c[_0x5f89('0x3b')]['encoding']:null;var _0x4a7b37={'method':_0x20a48c[_0x5f89('0xa1')],'uri':util[_0x5f89('0x55')](_0x5f89('0xa2'),_0x57dc5d,_0x20a48c[_0x5f89('0x3b')][_0x5f89('0x9')]),'json':_0x2c7042,'resolveWithFullResponse':!![],'encoding':_0x3d50f5,'body':_0x20a48c[_0x5f89('0x91')]};if(_0x20a48c[_0x5f89('0xa3')]){_0x4a7b37['headers']=_0x20a48c[_0x5f89('0xa3')];if(_0x4a7b37[_0x5f89('0xa3')][_0x5f89('0xa4')]){delete _0x4a7b37[_0x5f89('0xa3')][_0x5f89('0xa4')];}}if(_0x4a7b37['headers']['content-type']){delete _0x4a7b37[_0x5f89('0xa3')]['content-type'];}return rp(_0x4a7b37);})['then'](function(_0x569305){if(_0x569305){_0x3cd659[_0x5f89('0x29')](_0x569305[_0x5f89('0xa3')]);logger[_0x5f89('0x67')](_0x569305['body']);return _0x3cd659[_0x5f89('0x23')](_0x569305[_0x5f89('0xa6')])[_0x5f89('0x36')](_0x569305[_0x5f89('0x91')]);}else{return _0x3cd659[_0x5f89('0x22')](0xc8);}})[_0x5f89('0x50')](handleError(_0x3cd659,null));}; \ No newline at end of file +var _0x1f32=['update','then','get','Plugins','UserProfileResource','destroy','name','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','Plugin','count','includeAll','findAll','rows','catch','include','find','download','params','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','join','node_modules/**/*','attachments/**/*','close','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','parameters','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','delete','dirname','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x1f32,0x13a));var _0x21f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1f32[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x21f3('0x0'));var rimraf=require(_0x21f3('0x1'));var zipdir=require(_0x21f3('0x2'));var jsonpatch=require(_0x21f3('0x3'));var rp=require(_0x21f3('0x4'));var moment=require(_0x21f3('0x5'));var BPromise=require(_0x21f3('0x6'));var Mustache=require(_0x21f3('0x7'));var util=require(_0x21f3('0x8'));var path=require(_0x21f3('0x9'));var sox=require(_0x21f3('0xa'));var csv=require('to-csv');var ejs=require(_0x21f3('0xb'));var fs=require('fs');var fs_extra=require(_0x21f3('0xc'));var _=require('lodash');var squel=require(_0x21f3('0xd'));var crypto=require(_0x21f3('0xe'));var jsforce=require(_0x21f3('0xf'));var deskjs=require(_0x21f3('0x10'));var toCsv=require(_0x21f3('0x11'));var querystring=require(_0x21f3('0x12'));var Papa=require(_0x21f3('0x13'));var extract=require(_0x21f3('0x14'));var rimraf=require(_0x21f3('0x1'));var archiver=require(_0x21f3('0x15'));var Redis=require(_0x21f3('0x16'));var authService=require(_0x21f3('0x17'));var qs=require(_0x21f3('0x18'));var as=require(_0x21f3('0x19'));var hardwareService=require(_0x21f3('0x1a'));var logger=require(_0x21f3('0x1b'))(_0x21f3('0x1c'));var utils=require(_0x21f3('0x1d'));var config=require(_0x21f3('0x1e'));var licenseUtil=require(_0x21f3('0x1f'));var db=require(_0x21f3('0x20'))['db'];config[_0x21f3('0x21')]=_[_0x21f3('0x22')](config[_0x21f3('0x21')],{'host':_0x21f3('0x23'),'port':0x18eb});var socket=require(_0x21f3('0x24'))(new Redis(config[_0x21f3('0x21')]));require(_0x21f3('0x25'))[_0x21f3('0x26')](socket);function respondWithStatusCode(_0x3b23f6,_0x472502){_0x472502=_0x472502||0xcc;return function(_0x3187e){if(_0x3187e){return _0x3b23f6[_0x21f3('0x27')](_0x472502);}return _0x3b23f6['status'](_0x472502)[_0x21f3('0x28')]();};}function respondWithResult(_0x4246bc,_0x5bb4a3){_0x5bb4a3=_0x5bb4a3||0xc8;return function(_0x4b9b66){if(_0x4b9b66){return _0x4246bc[_0x21f3('0x29')](_0x5bb4a3)[_0x21f3('0x2a')](_0x4b9b66);}};}function respondWithFilteredResult(_0x5737fe,_0x409178){return function(_0x4c68d1){if(_0x4c68d1){var _0x60f3a3=typeof _0x409178[_0x21f3('0x2b')]===_0x21f3('0x2c')&&typeof _0x409178[_0x21f3('0x2d')]===_0x21f3('0x2c');var _0x106649=_0x4c68d1['count'];var _0x5d1912=_0x60f3a3?0x0:_0x409178[_0x21f3('0x2b')];var _0x5a846f=_0x60f3a3?_0x4c68d1['count']:_0x409178[_0x21f3('0x2b')]+_0x409178['limit'];var _0x16ff24;if(_0x5a846f>=_0x106649){_0x5a846f=_0x106649;_0x16ff24=0xc8;}else{_0x16ff24=0xce;}_0x5737fe[_0x21f3('0x29')](_0x16ff24);return _0x5737fe[_0x21f3('0x2e')](_0x21f3('0x2f'),_0x5d1912+'-'+_0x5a846f+'/'+_0x106649)[_0x21f3('0x2a')](_0x4c68d1);}return null;};}function patchUpdates(_0xddb959){return function(_0x46f976){try{jsonpatch[_0x21f3('0x30')](_0x46f976,_0xddb959,!![]);}catch(_0x309537){return BPromise['reject'](_0x309537);}return _0x46f976[_0x21f3('0x31')]();};}function saveUpdates(_0x2f3d13,_0x42a655){return function(_0x23c82f){if(_0x23c82f){return _0x23c82f[_0x21f3('0x32')](_0x2f3d13)[_0x21f3('0x33')](function(_0x26d531){return _0x26d531;});}return null;};}function removeEntity(_0xa1c179,_0x57a465){return function(_0x1e6015){if(_0x1e6015){return _0x1e6015['destroy']()[_0x21f3('0x33')](function(){var _0x345284=_0x1e6015[_0x21f3('0x34')]({'plain':!![]});var _0x5659ff=_0x21f3('0x35');return db[_0x21f3('0x36')][_0x21f3('0x37')]({'where':{'type':_0x5659ff,'resourceId':_0x345284['id']}})[_0x21f3('0x33')](function(){return _0x1e6015;});})[_0x21f3('0x33')](function(){_0xa1c179['status'](0xcc)[_0x21f3('0x28')]();});}};}function handleEntityNotFound(_0x2f6673,_0x12b7d2){return function(_0x291809){if(!_0x291809){_0x2f6673[_0x21f3('0x27')](0x194);}return _0x291809;};}function handleError(_0x4bf7fe,_0x16c42d){_0x16c42d=_0x16c42d||0x1f4;return function(_0x1d41a0){logger['error'](_0x1d41a0['stack']);if(_0x1d41a0['name']){delete _0x1d41a0[_0x21f3('0x38')];}_0x4bf7fe[_0x21f3('0x29')](_0x16c42d)['send'](_0x1d41a0);};}exports[_0x21f3('0x39')]=function(_0xaa0916,_0x46a007){var _0x20e03b={},_0x1fadfb={},_0x4b8a1f={'count':0x0,'rows':[]};var _0x1e67c1=_[_0x21f3('0x3a')](db['Plugin'][_0x21f3('0x3b')],function(_0x52304a){return{'name':_0x52304a[_0x21f3('0x3c')],'type':_0x52304a['type'][_0x21f3('0x3d')]};});_0x1fadfb['model']=_[_0x21f3('0x3a')](_0x1e67c1,'name');_0x1fadfb[_0x21f3('0x3e')]=_[_0x21f3('0x3f')](_0xaa0916['query']);_0x1fadfb[_0x21f3('0x40')]=_['intersection'](_0x1fadfb[_0x21f3('0x41')],_0x1fadfb['query']);_0x20e03b[_0x21f3('0x42')]=_[_0x21f3('0x43')](_0x1fadfb['model'],qs[_0x21f3('0x44')](_0xaa0916['query']['fields']));_0x20e03b[_0x21f3('0x42')]=_0x20e03b['attributes'][_0x21f3('0x45')]?_0x20e03b[_0x21f3('0x42')]:_0x1fadfb[_0x21f3('0x41')];if(!_0xaa0916[_0x21f3('0x3e')]['hasOwnProperty'](_0x21f3('0x46'))){_0x20e03b[_0x21f3('0x2d')]=qs['limit'](_0xaa0916[_0x21f3('0x3e')][_0x21f3('0x2d')]);_0x20e03b['offset']=qs[_0x21f3('0x2b')](_0xaa0916[_0x21f3('0x3e')][_0x21f3('0x2b')]);}_0x20e03b[_0x21f3('0x47')]=qs['sort'](_0xaa0916[_0x21f3('0x3e')][_0x21f3('0x48')]);_0x20e03b['where']=qs['filters'](_['pick'](_0xaa0916[_0x21f3('0x3e')],_0x1fadfb['filters']),_0x1e67c1);if(_0xaa0916['query'][_0x21f3('0x49')]){_0x20e03b[_0x21f3('0x4a')]=_[_0x21f3('0x4b')](_0x20e03b[_0x21f3('0x4a')],{'$or':_[_0x21f3('0x3a')](_0x1e67c1,function(_0x1a8cdf){if(_0x1a8cdf[_0x21f3('0x4c')]!==_0x21f3('0x4d')){var _0x49fd4b={};_0x49fd4b[_0x1a8cdf[_0x21f3('0x38')]]={'$like':'%'+_0xaa0916[_0x21f3('0x3e')]['filter']+'%'};return _0x49fd4b;}})});}_0x20e03b=_[_0x21f3('0x4b')]({},_0x20e03b,_0xaa0916[_0x21f3('0x4e')]);var _0x13c1ff={'where':_0x20e03b[_0x21f3('0x4a')]};return db[_0x21f3('0x4f')][_0x21f3('0x50')](_0x13c1ff)[_0x21f3('0x33')](function(_0x48f30e){_0x4b8a1f[_0x21f3('0x50')]=_0x48f30e;if(_0xaa0916[_0x21f3('0x3e')][_0x21f3('0x51')]){_0x20e03b['include']=[{'all':!![]}];}return db[_0x21f3('0x4f')][_0x21f3('0x52')](_0x20e03b);})[_0x21f3('0x33')](function(_0x392e81){_0x4b8a1f[_0x21f3('0x53')]=_0x392e81;return _0x4b8a1f;})[_0x21f3('0x33')](respondWithFilteredResult(_0x46a007,_0x20e03b))[_0x21f3('0x54')](handleError(_0x46a007,null));};exports['show']=function(_0x5c7a95,_0x5d394d){var _0x10884f={'raw':!![],'where':{'id':_0x5c7a95['params']['id']}},_0x4c7800={};_0x4c7800[_0x21f3('0x41')]=_['keys'](db[_0x21f3('0x4f')][_0x21f3('0x3b')]);_0x4c7800[_0x21f3('0x3e')]=_[_0x21f3('0x3f')](_0x5c7a95[_0x21f3('0x3e')]);_0x4c7800[_0x21f3('0x40')]=_[_0x21f3('0x43')](_0x4c7800['model'],_0x4c7800[_0x21f3('0x3e')]);_0x10884f[_0x21f3('0x42')]=_[_0x21f3('0x43')](_0x4c7800['model'],qs[_0x21f3('0x44')](_0x5c7a95['query'][_0x21f3('0x44')]));_0x10884f[_0x21f3('0x42')]=_0x10884f['attributes'][_0x21f3('0x45')]?_0x10884f[_0x21f3('0x42')]:_0x4c7800[_0x21f3('0x41')];if(_0x5c7a95['query'][_0x21f3('0x51')]){_0x10884f[_0x21f3('0x55')]=[{'all':!![]}];}_0x10884f=_['merge']({},_0x10884f,_0x5c7a95['options']);return db[_0x21f3('0x4f')][_0x21f3('0x56')](_0x10884f)[_0x21f3('0x33')](handleEntityNotFound(_0x5d394d,null))[_0x21f3('0x33')](respondWithResult(_0x5d394d,null))['catch'](handleError(_0x5d394d,null));};exports[_0x21f3('0x57')]=function(_0x1cf14d,_0xf13ccd,_0x3df420){return db[_0x21f3('0x4f')][_0x21f3('0x56')]({'where':{'id':_0x1cf14d[_0x21f3('0x58')]['id']},'attributes':[_0x21f3('0x38'),_0x21f3('0x9')],'raw':!![]})[_0x21f3('0x33')](handleEntityNotFound(_0xf13ccd,null))[_0x21f3('0x33')](function(_0x118cbb){if(_0x118cbb){var _0x26d6d2=path['join'](config['root'],_0x21f3('0x59'),util[_0x21f3('0x5a')](_0x21f3('0x5b'),path[_0x21f3('0x5c')](_0x118cbb[_0x21f3('0x9')])));var _0x40bee6=fs[_0x21f3('0x5d')](_0x26d6d2);var _0x127dda=archiver(_0x21f3('0x5e'),{'zlib':{'level':0x9}});_0x127dda['on'](_0x21f3('0x5f'),function(_0x29a66c){if(_0x29a66c[_0x21f3('0x60')]===_0x21f3('0x61')){logger[_0x21f3('0x62')](_0x29a66c);}else{throw new db['Sequelize'][(_0x21f3('0x63'))](_0x21f3('0x64'));}});_0x127dda['on'](_0x21f3('0x62'),function(_0x506df2){throw new db[(_0x21f3('0x65'))][(_0x21f3('0x63'))](_0x21f3('0x64'));});_0x127dda[_0x21f3('0x66')](_0x40bee6);_0x127dda[_0x21f3('0x67')](_0x21f3('0x68'),{'cwd':path[_0x21f3('0x69')](config['root'],_0x21f3('0x59'),path['dirname'](_0x118cbb[_0x21f3('0x9')])),'ignore':[path['join'](path['basename'](_0x118cbb[_0x21f3('0x9')]),_0x21f3('0x6a')),path[_0x21f3('0x69')](path[_0x21f3('0x5c')](_0x118cbb[_0x21f3('0x9')]),_0x21f3('0x6b'))],'nodir':!![]})['finalize']();_0x40bee6['on'](_0x21f3('0x6c'),function(){if(!fs['existsSync'](_0x26d6d2)){throw new db[(_0x21f3('0x65'))]['Error']('Plugin\x20not\x20found');}return _0xf13ccd[_0x21f3('0x57')](_0x26d6d2,util['format'](_0x21f3('0x5b'),path[_0x21f3('0x5c')](_0x118cbb[_0x21f3('0x9')])),function(_0x4451b9){if(_0x4451b9){throw new db[(_0x21f3('0x65'))][(_0x21f3('0x63'))](_0x21f3('0x6d'));}fs[_0x21f3('0x6e')](_0x26d6d2);logger[_0x21f3('0x6f')](_0x21f3('0x70'));logger[_0x21f3('0x6f')](_0x21f3('0x71'));});});}return null;})['catch'](handleError(_0xf13ccd,null));};exports[_0x21f3('0x72')]=function(_0x556fb7,_0x12d9b6,_0x20c360){var _0x4dbd1e=path[_0x21f3('0x5c')](_0x556fb7[_0x21f3('0x73')][_0x21f3('0x74')],path[_0x21f3('0x75')](_0x556fb7[_0x21f3('0x73')][_0x21f3('0x74')]));var _0x231cc0=path[_0x21f3('0x69')](config['root'],_0x21f3('0x59'),_0x556fb7[_0x21f3('0x73')]['filename']);var _0x17904c=path['join'](config['root'],_0x21f3('0x59'),_0x4dbd1e);logger[_0x21f3('0x6f')](_0x21f3('0x76'),_0x231cc0);logger[_0x21f3('0x6f')]('Plugin\x20upload\x20destination:\x20%s',_0x17904c);try{fs[_0x21f3('0x77')](_0x231cc0,parseInt(_0x21f3('0x78'),0x8));extract(_0x231cc0,{'dir':_0x17904c},function(_0xf5c4c3){if(_0xf5c4c3){logger[_0x21f3('0x62')](_0xf5c4c3);handleError(_0xf5c4c3,!![]);};var _0x124540=fs['readdirSync'](_0x17904c);if(_0x124540[_0x21f3('0x45')]>0x1){removeReferences(_0x231cc0,_0x17904c);logger[_0x21f3('0x62')](_0x21f3('0x79'));return _0x20c360(new Error(_0x21f3('0x79')));}var _0x173063=fs[_0x21f3('0x7a')](path[_0x21f3('0x69')](_0x17904c,_0x124540[0x0]));if(_0x173063[_0x21f3('0x7b')]()){removeReferences(_0x231cc0,_0x17904c);logger[_0x21f3('0x62')](_0x21f3('0x79'));return _0x20c360(new Error(_0x21f3('0x79')));}if(_0x173063[_0x21f3('0x7c')]()){var _0x9a6fc8=fs[_0x21f3('0x7d')](path[_0x21f3('0x69')](_0x17904c,_0x124540[0x0]));if(_0x9a6fc8['length']===0x0){removeReferences(_0x231cc0,_0x17904c);logger['error'](_0x21f3('0x79'));return _0x20c360(new Error('Invalid\x20plugin\x20structure'));}var _0xeaa327=_0x9a6fc8[_0x21f3('0x7e')](function(_0x287a11){return _0x287a11===_0x21f3('0x7f');});if(!_0xeaa327){return _0x20c360(new Error(_0x21f3('0x80')));}var _0x4e3e56=fs['readFileSync'](path[_0x21f3('0x69')](_0x17904c,_0x124540[0x0],_0x21f3('0x7f')));var _0x396ce6=JSON[_0x21f3('0x81')](_0x4e3e56);if(_0x21f3('0x2c')==typeof _0x396ce6[_0x21f3('0x38')]){return _0x20c360(new Error(_0x21f3('0x82')));}if(_0x21f3('0x2c')==typeof _0x396ce6[_0x21f3('0x4c')]){return _0x20c360(new Error(_0x21f3('0x83')));}if(_0x21f3('0x2c')==typeof _0x396ce6[_0x21f3('0x84')]){return _0x20c360(new Error(_0x21f3('0x85')));}if(_0x21f3('0x2c')==typeof _0x396ce6['parameters']){return _0x20c360(new Error(_0x21f3('0x86')));}if(_0x396ce6[_0x21f3('0x4c')]===_0x21f3('0x87')){if(_0x21f3('0x2c')==typeof _0x396ce6['parameters'][_0x21f3('0x88')]){return _0x20c360(new Error(_0x21f3('0x89')));}if(_0x21f3('0x2c')==typeof _0x396ce6[_0x21f3('0x8a')][_0x21f3('0x88')][_0x21f3('0x8b')]&&'undefined'==typeof _0x396ce6['parameters'][_0x21f3('0x88')][_0x21f3('0x8c')]){return _0x20c360(new Error(_0x21f3('0x8d')));}}else if(_0x396ce6[_0x21f3('0x4c')]===_0x21f3('0x8e')){if(_0x21f3('0x2c')==typeof _0x396ce6['parameters'][_0x21f3('0x8f')]){return _0x20c360(new Error(_0x21f3('0x90')));}if('undefined'==typeof _0x396ce6['parameters'][_0x21f3('0x91')]){return _0x20c360(new Error(_0x21f3('0x92')));}}else{return _0x20c360(new Error(_0x21f3('0x93')));}var _0x11bacf=_0x396ce6[_0x21f3('0x38')];var _0xf165a7=_0x396ce6[_0x21f3('0x94')];var _0x200a4e=_0x396ce6[_0x21f3('0x4c')];var _0x27200b=_0x396ce6[_0x21f3('0x95')]?_0x396ce6[_0x21f3('0x95')]:'always';var _0x46c170=_0x396ce6['icon']?_0x396ce6['icon']:_0x21f3('0x96');var _0x4995c7='';var _0x263fd3='';var _0x51c982='';var _0x172dcb='';var _0x3f4412=_0x396ce6[_0x21f3('0x84')];if(_0x200a4e==='html'){if(_0x21f3('0x2c')!=typeof _0x396ce6['parameters'][_0x21f3('0x88')][_0x21f3('0x8b')]){var _0x14ff25=_0x396ce6[_0x21f3('0x8a')][_0x21f3('0x88')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x21f3('0x97')](_0x14ff25)){_0x4995c7=path[_0x21f3('0x69')]('plugins',_0x4dbd1e,_0x124540[0x0],_0x14ff25);}else{_0x4995c7=_0x14ff25;}}else{logger[_0x21f3('0x6f')](_0x21f3('0x98'));}if('undefined'!=typeof _0x396ce6[_0x21f3('0x8a')][_0x21f3('0x88')][_0x21f3('0x8c')]){var _0x1650d9=_0x396ce6['parameters'][_0x21f3('0x88')][_0x21f3('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x21f3('0x97')](_0x1650d9)){_0x263fd3=path[_0x21f3('0x69')](_0x21f3('0x99'),_0x4dbd1e,_0x124540[0x0],_0x1650d9);}else{_0x263fd3=_0x1650d9;}}else{logger['info'](_0x21f3('0x9a'));}}else if(_0x200a4e===_0x21f3('0x8e')){_0x51c982=_0x396ce6['parameters']['scriptName'];_0x172dcb=_0x396ce6[_0x21f3('0x8a')]['scriptPath'];if('undefined'!=typeof _0x396ce6[_0x21f3('0x8a')][_0x21f3('0x88')]){if(_0x21f3('0x2c')!=typeof _0x396ce6['parameters']['views'][_0x21f3('0x8b')]){var _0x14ff25=_0x396ce6[_0x21f3('0x8a')]['views'][_0x21f3('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0x21f3('0x97')](_0x14ff25)){_0x4995c7=path['join'](_0x21f3('0x99'),_0x4dbd1e,_0x124540[0x0],_0x14ff25);}else{_0x4995c7=_0x14ff25;}}if(_0x21f3('0x2c')!=typeof _0x396ce6[_0x21f3('0x8a')]['views']['agent']){var _0x1650d9=_0x396ce6[_0x21f3('0x8a')]['views'][_0x21f3('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x21f3('0x97')](_0x1650d9)){_0x263fd3=path[_0x21f3('0x69')](_0x21f3('0x99'),_0x4dbd1e,_0x124540[0x0],_0x1650d9);}else{_0x263fd3=_0x1650d9;}}}}var _0x27c18f={'name':_0x11bacf,'description':_0xf165a7,'path':path[_0x21f3('0x69')](_0x4dbd1e,_0x124540[0x0]),'type':_0x200a4e,'sidebar':_0x27200b,'icon':_0x46c170,'adminUrl':_0x4995c7,'agentUrl':_0x263fd3,'scriptName':_0x51c982,'scriptPath':_0x172dcb,'version':_0x3f4412};removeReferences(_0x231cc0,null);return db[_0x21f3('0x4f')][_0x21f3('0x9b')](_0x27c18f)[_0x21f3('0x33')](function(_0x30ce5e){var _0x498769={'role':_0x556fb7['body']['role'],'userProfileId':_0x556fb7[_0x21f3('0x9c')]['userProfileId']};if(!_0x498769)throw new Error(_0x21f3('0x9d'));if(_0x498769[_0x21f3('0x9e')]===_0x21f3('0x9f')){var _0x554376=_0x30ce5e[_0x21f3('0x34')]({'plain':!![]});return db[_0x21f3('0xa0')][_0x21f3('0x56')]({'where':{'name':_0x21f3('0x35'),'userProfileId':_0x498769[_0x21f3('0xa1')]},'raw':!![]})[_0x21f3('0x33')](function(_0x169400){if(_0x169400&&_0x169400[_0x21f3('0xa2')]===0x0){return db[_0x21f3('0x36')]['create']({'name':_0x554376[_0x21f3('0x38')],'resourceId':_0x554376['id'],'type':_0x169400[_0x21f3('0x38')],'sectionId':_0x169400['id']},{})['then'](function(){return _0x30ce5e;});}else{return _0x30ce5e;}})[_0x21f3('0x54')](function(_0x4dc9f3){logger[_0x21f3('0x62')](_0x21f3('0xa3'),_0x4dc9f3);throw _0x4dc9f3;});}return _0x30ce5e;})[_0x21f3('0x33')](respondWithResult(_0x12d9b6,null))['catch'](handleError(_0x12d9b6,null));}});}catch(_0x49d610){_0x12d9b6['status'](0x1f4)[_0x21f3('0xa4')](_0x49d610);}};function removeReferences(_0x2882dd,_0x1228b3){try{if(_0x2882dd){fs[_0x21f3('0x6e')](_0x2882dd);logger[_0x21f3('0x6f')](_0x21f3('0xa5'));}if(_0x1228b3){rimraf(_0x1228b3,function(){});logger[_0x21f3('0x6f')]('Extracted\x20folder\x20removed');}}catch(_0x5b7195){logger['error'](_0x5b7195);}}exports[_0x21f3('0x32')]=function(_0x13dbed,_0x3a656f,_0x5be38b){return db[_0x21f3('0x4f')][_0x21f3('0x56')]({'where':{'id':_0x13dbed[_0x21f3('0x58')]['id']}})['then'](handleEntityNotFound(_0x3a656f,null))['then'](saveUpdates(_0x13dbed[_0x21f3('0x9c')],null))[_0x21f3('0x33')](respondWithResult(_0x3a656f,null))[_0x21f3('0x54')](handleError(_0x3a656f,null));};exports[_0x21f3('0xa6')]=function(_0xc6ad3e,_0x12a9df,_0x24bdf3){return db[_0x21f3('0x4f')][_0x21f3('0x56')]({'where':{'id':_0xc6ad3e[_0x21f3('0x58')]['id']}})['then'](function(_0x400885){if(_0x400885){return _0x400885[_0x21f3('0x37')]();}})['then'](function(_0x474d45){rimraf(path['join'](config['root'],_0x21f3('0x59'),path[_0x21f3('0xa7')](_0x474d45[_0x21f3('0x9')])),function(){});return _0x474d45;})['then'](handleEntityNotFound(_0x12a9df,null))['then'](respondWithStatusCode(_0x12a9df,null))[_0x21f3('0x54')](handleError(_0x12a9df,null));};exports[_0x21f3('0xa8')]=function(_0x369467,_0x11cd70,_0x586c91){return BPromise[_0x21f3('0xa9')]()[_0x21f3('0x33')](function(){if(!_0x369467[_0x21f3('0x3e')]['path']){throw new Error(_0x21f3('0xaa'));}if(!_0x369467[_0x21f3('0x3e')][_0x21f3('0xab')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x135db7=_0x369467[_0x21f3('0x3e')][_0x21f3('0xac')]?_0x369467[_0x21f3('0x3e')][_0x21f3('0xac')]+':'+_0x369467[_0x21f3('0x3e')]['port']:_0x21f3('0xad')+_0x369467[_0x21f3('0x3e')][_0x21f3('0xab')];var _0x55d67d=_0x369467[_0x21f3('0x3e')][_0x21f3('0x2a')]?_0x369467[_0x21f3('0x3e')][_0x21f3('0x2a')]:!![];var _0x5029a2=_0x369467[_0x21f3('0x3e')][_0x21f3('0xae')]?_0x369467[_0x21f3('0x3e')]['encoding']:null;var _0x43c857={'method':_0x369467[_0x21f3('0xaf')],'uri':util['format'](_0x21f3('0xb0'),_0x135db7,_0x369467['query']['path']),'json':_0x55d67d,'resolveWithFullResponse':!![],'encoding':_0x5029a2,'qs':_0x369467[_0x21f3('0x3e')]};if(_0x369467[_0x21f3('0xb1')]){_0x43c857[_0x21f3('0xb1')]=_0x369467[_0x21f3('0xb1')];if(_0x43c857[_0x21f3('0xb1')]['content-length']){delete _0x43c857[_0x21f3('0xb1')][_0x21f3('0xb2')];}}if(_0x43c857[_0x21f3('0xb1')][_0x21f3('0xb3')]){delete _0x43c857[_0x21f3('0xb1')][_0x21f3('0xb3')];}return rp(_0x43c857);})['then'](function(_0x57c53b){if(_0x57c53b){_0x11cd70['set'](_0x57c53b['headers']);logger['info'](_0x57c53b[_0x21f3('0x9c')]);if(_['endsWith'](_0x369467[_0x21f3('0x3e')]['path'],_0x21f3('0x57'))&&_0x57c53b['statusCode']==0x1f4){return _0x11cd70[_0x21f3('0x27')](_0x57c53b[_0x21f3('0xb4')]);}else{return _0x11cd70['status'](_0x57c53b[_0x21f3('0xb4')])[_0x21f3('0xa4')](_0x57c53b[_0x21f3('0x9c')]);}}else{return _0x11cd70[_0x21f3('0x27')](0xc8);}})[_0x21f3('0x54')](handleError(_0x11cd70,null));};exports['webhookPost']=function(_0x4e5c04,_0x2ea53f,_0x483981){return BPromise[_0x21f3('0xa9')]()['then'](function(){if(!_0x4e5c04[_0x21f3('0x3e')][_0x21f3('0x9')]){throw new Error(_0x21f3('0xaa'));}if(!_0x4e5c04[_0x21f3('0x3e')]['port']){throw new Error(_0x21f3('0xb5'));}var _0x261981=_0x4e5c04[_0x21f3('0x3e')][_0x21f3('0xac')]?_0x4e5c04[_0x21f3('0x3e')]['hostname']+':'+_0x4e5c04[_0x21f3('0x3e')]['port']:_0x21f3('0xad')+_0x4e5c04[_0x21f3('0x3e')][_0x21f3('0xab')];var _0x3328d0=_0x4e5c04[_0x21f3('0x3e')][_0x21f3('0x2a')]?_0x4e5c04[_0x21f3('0x3e')]['json']:!![];var _0x3a2a7a=_0x4e5c04['query'][_0x21f3('0xae')]?_0x4e5c04['query'][_0x21f3('0xae')]:null;var _0x4e5c01={'method':_0x4e5c04['method'],'uri':util['format']('%s%s',_0x261981,_0x4e5c04[_0x21f3('0x3e')][_0x21f3('0x9')]),'json':_0x3328d0,'resolveWithFullResponse':!![],'encoding':_0x3a2a7a,'body':_0x4e5c04['body']};if(_0x4e5c04[_0x21f3('0xb1')]){_0x4e5c01['headers']=_0x4e5c04[_0x21f3('0xb1')];if(_0x4e5c01[_0x21f3('0xb1')]['content-length']){delete _0x4e5c01['headers'][_0x21f3('0xb2')];}}if(_0x4e5c01[_0x21f3('0xb1')][_0x21f3('0xb3')]){delete _0x4e5c01[_0x21f3('0xb1')][_0x21f3('0xb3')];}return rp(_0x4e5c01);})[_0x21f3('0x33')](function(_0x18c6f7){if(_0x18c6f7){_0x2ea53f['set'](_0x18c6f7[_0x21f3('0xb1')]);logger[_0x21f3('0x6f')](_0x18c6f7[_0x21f3('0x9c')]);return _0x2ea53f['status'](_0x18c6f7['statusCode'])[_0x21f3('0xa4')](_0x18c6f7[_0x21f3('0x9c')]);}else{return _0x2ea53f[_0x21f3('0x27')](0xc8);}})[_0x21f3('0x54')](handleError(_0x2ea53f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 74b1990..6804bf7 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 _0x7fd6=['Plugin','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0x40c9c0,_0x496923){var _0x11c0d4=function(_0x2cdaed){while(--_0x2cdaed){_0x40c9c0['push'](_0x40c9c0['shift']());}};_0x11c0d4(++_0x496923);}(_0x7fd6,0x157));var _0x67fd=function(_0x5deedb,_0x4ee620){_0x5deedb=_0x5deedb-0x0;var _0x1365f9=_0x7fd6[_0x5deedb];return _0x1365f9;};'use strict';var EventEmitter=require(_0x67fd('0x0'));var Plugin=require('../../mysqldb')['db'][_0x67fd('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x67fd('0x2')](0x0);var events={'afterCreate':_0x67fd('0x3'),'afterUpdate':_0x67fd('0x4'),'afterDestroy':_0x67fd('0x5')};function emitEvent(_0xbdd0c0){return function(_0x4f52bc,_0x187f3e,_0x50238d){PluginEvents['emit'](_0xbdd0c0+':'+_0x4f52bc['id'],_0x4f52bc);PluginEvents['emit'](_0xbdd0c0,_0x4f52bc);_0x50238d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x67fd('0x6')](e,emitEvent(event));}}module[_0x67fd('0x7')]=PluginEvents; \ No newline at end of file +var _0xfa9f=['../../mysqldb','Plugin','setMaxListeners','save','update','emit','exports'];(function(_0x346dba,_0x4301dd){var _0x3fafe1=function(_0x27bc63){while(--_0x27bc63){_0x346dba['push'](_0x346dba['shift']());}};_0x3fafe1(++_0x4301dd);}(_0xfa9f,0x93));var _0xffa9=function(_0x5fe7ce,_0x1a0d39){_0x5fe7ce=_0x5fe7ce-0x0;var _0x3b5793=_0xfa9f[_0x5fe7ce];return _0x3b5793;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xffa9('0x0'))['db'][_0xffa9('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xffa9('0x2')](0x0);var events={'afterCreate':_0xffa9('0x3'),'afterUpdate':_0xffa9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x200b31){return function(_0x5bed37,_0x2f8db9,_0x242026){PluginEvents['emit'](_0x200b31+':'+_0x5bed37['id'],_0x5bed37);PluginEvents[_0xffa9('0x5')](_0x200b31,_0x5bed37);_0x242026(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xffa9('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 829c911..6744403 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 _0xb9a0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','api'];(function(_0x5d9154,_0x2ed1b7){var _0xd9c7d6=function(_0x40f8bc){while(--_0x40f8bc){_0x5d9154['push'](_0x5d9154['shift']());}};_0xd9c7d6(++_0x2ed1b7);}(_0xb9a0,0x146));var _0x0b9a=function(_0x2374bd,_0x2ce8d8){_0x2374bd=_0x2374bd-0x0;var _0x3eb688=_0xb9a0[_0x2374bd];return _0x3eb688;};'use strict';var _=require(_0x0b9a('0x0'));var util=require(_0x0b9a('0x1'));var logger=require(_0x0b9a('0x2'))(_0x0b9a('0x3'));var moment=require(_0x0b9a('0x4'));var BPromise=require(_0x0b9a('0x5'));var rp=require(_0x0b9a('0x6'));var fs=require('fs');var path=require(_0x0b9a('0x7'));var rimraf=require(_0x0b9a('0x8'));var config=require(_0x0b9a('0x9'));var attributes=require(_0x0b9a('0xa'));module[_0x0b9a('0xb')]=function(_0xdc3e9b,_0x2bb51a){return _0xdc3e9b[_0x0b9a('0xc')](_0x0b9a('0xd'),attributes,{'tableName':_0x0b9a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8733=['path','rimraf','../../config/environment','exports','Plugin','plugins','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4f8d4b,_0x1b739d){var _0x19c786=function(_0xfb0b8a){while(--_0xfb0b8a){_0x4f8d4b['push'](_0x4f8d4b['shift']());}};_0x19c786(++_0x1b739d);}(_0x8733,0xd7));var _0x3873=function(_0x587577,_0x53a237){_0x587577=_0x587577-0x0;var _0x75d167=_0x8733[_0x587577];return _0x75d167;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3873('0x0'))(_0x3873('0x1'));var moment=require(_0x3873('0x2'));var BPromise=require(_0x3873('0x3'));var rp=require(_0x3873('0x4'));var fs=require('fs');var path=require(_0x3873('0x5'));var rimraf=require(_0x3873('0x6'));var config=require(_0x3873('0x7'));var attributes=require('./plugin.attributes');module[_0x3873('0x8')]=function(_0x3a53b1,_0x380983){return _0x3a53b1['define'](_0x3873('0x9'),attributes,{'tableName':_0x3873('0xa'),'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 44a1b40..5f4a087 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 _0xd0f9=['info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','Plugin,\x20%s,\x20%s','CreatePlugin','Plugin','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0xd0f9,0x9b));var _0x9d0f=function(_0x119280,_0x439c3e){_0x119280=_0x119280-0x0;var _0x481797=_0xd0f9[_0x119280];return _0x481797;};'use strict';var _=require(_0x9d0f('0x0'));var util=require(_0x9d0f('0x1'));var moment=require(_0x9d0f('0x2'));var BPromise=require(_0x9d0f('0x3'));var rs=require(_0x9d0f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d0f('0x5'))['db'];var utils=require(_0x9d0f('0x6'));var logger=require(_0x9d0f('0x7'))(_0x9d0f('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d0f('0x9'));var client=jayson[_0x9d0f('0xa')][_0x9d0f('0xb')]({'port':0x232a});config[_0x9d0f('0xc')]=_[_0x9d0f('0xd')](config['redis'],{'host':_0x9d0f('0xe'),'port':0x18eb});var socket=require(_0x9d0f('0xf'))(new Redis(config[_0x9d0f('0xc')]));require(_0x9d0f('0x10'))[_0x9d0f('0x11')](socket);function respondWithRpcPromise(_0x365d32,_0x237887,_0x36a5ac){return new BPromise(function(_0x159900,_0x18e0bd){return client[_0x9d0f('0x12')](_0x365d32,_0x36a5ac)[_0x9d0f('0x13')](function(_0x302547){logger[_0x9d0f('0x14')]('Plugin,\x20%s,\x20%s',_0x237887,_0x9d0f('0x15'));logger[_0x9d0f('0x16')](_0x9d0f('0x17'),_0x237887,_0x9d0f('0x15'),JSON[_0x9d0f('0x18')](_0x302547));if(_0x302547[_0x9d0f('0x19')]){if(_0x302547[_0x9d0f('0x19')]['code']===0x1f4){logger[_0x9d0f('0x19')]('Plugin,\x20%s,\x20%s',_0x237887,_0x302547[_0x9d0f('0x19')][_0x9d0f('0x1a')]);return _0x18e0bd(_0x302547[_0x9d0f('0x19')][_0x9d0f('0x1a')]);}logger[_0x9d0f('0x19')](_0x9d0f('0x1b'),_0x237887,_0x302547[_0x9d0f('0x19')][_0x9d0f('0x1a')]);return _0x159900(_0x302547['error']['message']);}else{logger[_0x9d0f('0x14')](_0x9d0f('0x1b'),_0x237887,'request\x20sent');_0x159900(_0x302547['result'][_0x9d0f('0x1a')]);}})['catch'](function(_0x47bf57){logger[_0x9d0f('0x19')](_0x9d0f('0x1b'),_0x237887,_0x47bf57);_0x18e0bd(_0x47bf57);});});}exports[_0x9d0f('0x1c')]=function(_0x5927be){var _0x386287=this;return new Promise(function(_0x5ba83e,_0x1f07e4){return db[_0x9d0f('0x1d')][_0x9d0f('0x1e')](_0x5927be[_0x9d0f('0x1f')],{'raw':_0x5927be[_0x9d0f('0x20')]?_0x5927be['options'][_0x9d0f('0x21')]===undefined?!![]:![]:!![]})[_0x9d0f('0x13')](function(_0xcdc029){logger['info'](_0x9d0f('0x1c'),_0x5927be);logger[_0x9d0f('0x16')](_0x9d0f('0x1c'),_0x5927be,JSON[_0x9d0f('0x18')](_0xcdc029));_0x5ba83e(_0xcdc029);})[_0x9d0f('0x22')](function(_0x207c03){logger[_0x9d0f('0x19')](_0x9d0f('0x1c'),_0x207c03[_0x9d0f('0x1a')],_0x5927be);_0x1f07e4(_0x386287[_0x9d0f('0x19')](0x1f4,_0x207c03[_0x9d0f('0x1a')]));});});}; \ No newline at end of file +var _0xbc20=['catch','CreatePlugin','Plugin','create','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xbc20,0x1c7));var _0x0bc2=function(_0x4ec072,_0x43eb7a){_0x4ec072=_0x4ec072-0x0;var _0x25a1a5=_0xbc20[_0x4ec072];return _0x25a1a5;};'use strict';var _=require(_0x0bc2('0x0'));var util=require(_0x0bc2('0x1'));var moment=require(_0x0bc2('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bc2('0x3'));var fs=require('fs');var Redis=require(_0x0bc2('0x4'));var db=require(_0x0bc2('0x5'))['db'];var utils=require(_0x0bc2('0x6'));var logger=require('../../config/logger')(_0x0bc2('0x7'));var config=require(_0x0bc2('0x8'));var jayson=require(_0x0bc2('0x9'));var client=jayson[_0x0bc2('0xa')][_0x0bc2('0xb')]({'port':0x232a});config[_0x0bc2('0xc')]=_['defaults'](config[_0x0bc2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0bc2('0xd'))(new Redis(config[_0x0bc2('0xc')]));require('./plugin.socket')[_0x0bc2('0xe')](socket);function respondWithRpcPromise(_0x48b4f1,_0x357bf9,_0x1d5234){return new BPromise(function(_0x2d14b0,_0x2a1900){return client[_0x0bc2('0xf')](_0x48b4f1,_0x1d5234)['then'](function(_0xc56a3b){logger[_0x0bc2('0x10')](_0x0bc2('0x11'),_0x357bf9,_0x0bc2('0x12'));logger[_0x0bc2('0x13')](_0x0bc2('0x14'),_0x357bf9,_0x0bc2('0x12'),JSON[_0x0bc2('0x15')](_0xc56a3b));if(_0xc56a3b[_0x0bc2('0x16')]){if(_0xc56a3b['error']['code']===0x1f4){logger['error'](_0x0bc2('0x11'),_0x357bf9,_0xc56a3b[_0x0bc2('0x16')][_0x0bc2('0x17')]);return _0x2a1900(_0xc56a3b[_0x0bc2('0x16')][_0x0bc2('0x17')]);}logger['error'](_0x0bc2('0x11'),_0x357bf9,_0xc56a3b[_0x0bc2('0x16')][_0x0bc2('0x17')]);return _0x2d14b0(_0xc56a3b['error'][_0x0bc2('0x17')]);}else{logger[_0x0bc2('0x10')](_0x0bc2('0x11'),_0x357bf9,_0x0bc2('0x12'));_0x2d14b0(_0xc56a3b[_0x0bc2('0x18')]['message']);}})[_0x0bc2('0x19')](function(_0x38c4ad){logger[_0x0bc2('0x16')](_0x0bc2('0x11'),_0x357bf9,_0x38c4ad);_0x2a1900(_0x38c4ad);});});}exports[_0x0bc2('0x1a')]=function(_0x402436){var _0x248ee0=this;return new Promise(function(_0x3fb876,_0x3ca2f2){return db[_0x0bc2('0x1b')][_0x0bc2('0x1c')](_0x402436['body'],{'raw':_0x402436[_0x0bc2('0x1d')]?_0x402436[_0x0bc2('0x1d')][_0x0bc2('0x1e')]===undefined?!![]:![]:!![]})[_0x0bc2('0x1f')](function(_0x60e956){logger[_0x0bc2('0x10')]('CreatePlugin',_0x402436);logger['debug']('CreatePlugin',_0x402436,JSON['stringify'](_0x60e956));_0x3fb876(_0x60e956);})[_0x0bc2('0x19')](function(_0x4d5e78){logger[_0x0bc2('0x16')](_0x0bc2('0x1a'),_0x4d5e78['message'],_0x402436);_0x3ca2f2(_0x248ee0['error'](0x1f4,_0x4d5e78[_0x0bc2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 9863f0d..0e9328e 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 _0x47bc=['./plugin.events','update','emit','register','length'];(function(_0xbf60f9,_0x524070){var _0x2d2bf5=function(_0x285a0f){while(--_0x285a0f){_0xbf60f9['push'](_0xbf60f9['shift']());}};_0x2d2bf5(++_0x524070);}(_0x47bc,0x1e5));var _0xc47b=function(_0x1ecc7a,_0x11a03d){_0x1ecc7a=_0x1ecc7a-0x0;var _0x4420ee=_0x47bc[_0x1ecc7a];return _0x4420ee;};'use strict';var PluginEvents=require(_0xc47b('0x0'));var events=['save','remove',_0xc47b('0x1')];function createListener(_0x275e6d,_0x56ec3b){return function(_0x1acade){_0x56ec3b[_0xc47b('0x2')](_0x275e6d,_0x1acade);};}function removeListener(_0x262cb8,_0x8dd0d7){return function(){PluginEvents['removeListener'](_0x262cb8,_0x8dd0d7);};}exports[_0xc47b('0x3')]=function(_0x1a3d23){for(var _0x3dd8a5=0x0,_0xdec855=events[_0xc47b('0x4')];_0x3dd8a5<_0xdec855;_0x3dd8a5++){var _0x3ab4ae=events[_0x3dd8a5];var _0x229447=createListener('plugin:'+_0x3ab4ae,_0x1a3d23);PluginEvents['on'](_0x3ab4ae,_0x229447);}}; \ No newline at end of file +var _0x272c=['register','plugin:','./plugin.events','save','update','emit'];(function(_0x424405,_0x16a218){var _0x30c5d7=function(_0x94ad68){while(--_0x94ad68){_0x424405['push'](_0x424405['shift']());}};_0x30c5d7(++_0x16a218);}(_0x272c,0x19a));var _0xc272=function(_0x5b299b,_0x5a0fad){_0x5b299b=_0x5b299b-0x0;var _0x46dedf=_0x272c[_0x5b299b];return _0x46dedf;};'use strict';var PluginEvents=require(_0xc272('0x0'));var events=[_0xc272('0x1'),'remove',_0xc272('0x2')];function createListener(_0x5d0f24,_0x23b0e4){return function(_0x1e19d6){_0x23b0e4[_0xc272('0x3')](_0x5d0f24,_0x1e19d6);};}function removeListener(_0x2a78f1,_0x12fa0c){return function(){PluginEvents['removeListener'](_0x2a78f1,_0x12fa0c);};}exports[_0xc272('0x4')]=function(_0x3c1f22){for(var _0x59d38d=0x0,_0x5b9d=events['length'];_0x59d38d<_0x5b9d;_0x59d38d++){var _0x33fd62=events[_0x59d38d];var _0x2bdc94=createListener(_0xc272('0x5')+_0x33fd62,_0x3c1f22);PluginEvents['on'](_0x33fd62,_0x2bdc94);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 41b7b15..42b2eef 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(_0x3b0f98,_0x5f437c){var _0x325c2a=function(_0x22706a){while(--_0x22706a){_0x3b0f98['push'](_0x3b0f98['shift']());}};_0x325c2a(++_0x5f437c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0x5bf96a,_0x392c5a){var _0x5177b5=function(_0x898c1f){while(--_0x898c1f){_0x5bf96a['push'](_0x5bf96a['shift']());}};_0x5177b5(++_0x392c5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 cb96327..c1fdd30 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 _0x39cb=['create','body','join','../../files/plugins','cwd','chdir','start','send','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','../../config/pm2','../../config/logger','path','child_process','bluebird','sendStatus','status','json','error','stack','name','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params'];(function(_0x2daaf2,_0x2c4101){var _0x5654db=function(_0x56a1b8){while(--_0x56a1b8){_0x2daaf2['push'](_0x2daaf2['shift']());}};_0x5654db(++_0x2c4101);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var pm2=require(_0xb39c('0x0'));var logger=require(_0xb39c('0x1'))('api');var path=require(_0xb39c('0x2'));var exec=require(_0xb39c('0x3'))['exec'];var BPromise=require(_0xb39c('0x4'));function handleEntityNotFound(_0x285eca,_0x398d07){return function(_0x2bca14){if(!_0x2bca14){_0x285eca[_0xb39c('0x5')](0x194);;}return _0x2bca14;};}function respondWithResult(_0x4ae4cf,_0x32cdcd){_0x32cdcd=_0x32cdcd||0xc8;return function(_0x2fc868){if(_0x2fc868){return _0x4ae4cf[_0xb39c('0x6')](_0x32cdcd)[_0xb39c('0x7')](_0x2fc868);}return null;};}function handleError(_0x47d6d7,_0x5ae14a){_0x5ae14a=_0x5ae14a||0x1f4;return function(_0x41557b){logger[_0xb39c('0x8')](_0x41557b[_0xb39c('0x9')]);if(_0x41557b[_0xb39c('0xa')]){delete _0x41557b['name'];}_0x47d6d7['status'](_0x5ae14a)['send'](_0x41557b);};}function execChildProcess(){return new BPromise(function(_0x1de94f,_0x497ffc){exec(_0xb39c('0xb'),function(_0x1088ee,_0x433ee8,_0x340622){logger[_0xb39c('0xc')](_0x433ee8);logger[_0xb39c('0xc')](_0x340622);if(_0x1088ee){logger['error'](_0x1088ee);return _0x497ffc(_0x1088ee);}return _0x1de94f(_0x433ee8);});});}exports[_0xb39c('0xd')]=function(_0x468995,_0x2620cd){return pm2['list']()[_0xb39c('0xe')](function(_0x40a6d3){if(_0x40a6d3){var _0x42a203=_[_0xb39c('0xf')](_0x40a6d3,function(_0x469fa9){return _0x469fa9[_0xb39c('0xa')]===_0xb39c('0x10')||_0x469fa9['name']===_0xb39c('0x11');});return{'rows':_0x42a203,'count':_0x42a203[_0xb39c('0x12')]};}return null;})[_0xb39c('0xe')](respondWithResult(_0x2620cd,null))[_0xb39c('0x13')](handleError(_0x2620cd,null));};exports[_0xb39c('0x14')]=function(_0x3b7fad,_0x1a2f48){return pm2[_0xb39c('0x15')](_0x3b7fad[_0xb39c('0x16')]['id'])[_0xb39c('0xe')](respondWithResult(_0x1a2f48,null))['then'](handleEntityNotFound(_0x1a2f48,null))[_0xb39c('0x13')](handleError(_0x1a2f48,null));};exports[_0xb39c('0x17')]=function(_0x28bbe1,_0x447352){if(_0x28bbe1['body'][_0xb39c('0xa')]&&_0x28bbe1[_0xb39c('0x18')]['script']){var _0x2d8e93=path[_0xb39c('0x19')](__dirname,_0xb39c('0x1a'),_0x28bbe1['body']['script']);var _0x2789fd=process[_0xb39c('0x1b')]();process[_0xb39c('0x1c')](path['dirname'](_0x2d8e93));return execChildProcess()[_0xb39c('0xe')](function(_0x438207){process[_0xb39c('0x1c')](_0x2789fd);return pm2[_0xb39c('0x1d')]({'name':_0x28bbe1[_0xb39c('0x18')]['name'],'script':_0x2d8e93});})[_0xb39c('0xe')](function(_0xbeab7e){pm2['dump']();return _0xbeab7e[0x0];})[_0xb39c('0xe')](respondWithResult(_0x447352,0xc9))[_0xb39c('0x13')](handleError(_0x447352,null));}else{return _0x447352[_0xb39c('0x6')](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x1f')});}};exports['update']=function(_0x23a2f1,_0x299c27){if(_0x23a2f1[_0xb39c('0x18')]['id']){delete _0x23a2f1['body']['id'];}var _0x41fff2={'online':_0xb39c('0x20'),'stopped':'stop'};if(_0x41fff2[_0xb39c('0x21')](_0x23a2f1[_0xb39c('0x18')][_0xb39c('0x6')])){return pm2[_0x41fff2[_0x23a2f1['body'][_0xb39c('0x6')]]](_0x23a2f1[_0xb39c('0x16')]['id'])['then'](respondWithResult(_0x299c27,0xc8))[_0xb39c('0x13')](handleError(_0x299c27,null));}else{return _0x299c27['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x22')});}};exports[_0xb39c('0x23')]=function(_0x7339b4,_0x17eb7b){if(_0x7339b4['body']['id']){delete _0x7339b4[_0xb39c('0x18')]['id'];}if(_0x7339b4['params']['id']){return pm2[_0xb39c('0x24')](_0x7339b4['params']['id'])[_0xb39c('0xe')](function(_0xe2111a){pm2[_0xb39c('0x25')]();return _0xe2111a[0x0];})[_0xb39c('0xe')](respondWithResult(_0x17eb7b,null))['catch'](handleError(_0x17eb7b,null));}else{return _0x17eb7b['status'](0x1f4)[_0xb39c('0x1e')]({'message':_0xb39c('0x26')});}}; \ No newline at end of file +var _0x7072=['update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','sendStatus','status','json','name','send','npm\x20install','info','error','list','then','reject','express','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump'];(function(_0x281cc7,_0xc9b333){var _0x305e0b=function(_0x224d8e){while(--_0x224d8e){_0x281cc7['push'](_0x281cc7['shift']());}};_0x305e0b(++_0xc9b333);}(_0x7072,0x138));var _0x2707=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x7072[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var pm2=require(_0x2707('0x0'));var logger=require(_0x2707('0x1'))(_0x2707('0x2'));var path=require(_0x2707('0x3'));var exec=require(_0x2707('0x4'))['exec'];var BPromise=require('bluebird');function handleEntityNotFound(_0xfdfa7a,_0x5f3c1c){return function(_0xd36287){if(!_0xd36287){_0xfdfa7a[_0x2707('0x5')](0x194);;}return _0xd36287;};}function respondWithResult(_0x1e86f2,_0x194132){_0x194132=_0x194132||0xc8;return function(_0x2fd8ff){if(_0x2fd8ff){return _0x1e86f2[_0x2707('0x6')](_0x194132)[_0x2707('0x7')](_0x2fd8ff);}return null;};}function handleError(_0x745cfd,_0x4062b6){_0x4062b6=_0x4062b6||0x1f4;return function(_0x2820ef){logger['error'](_0x2820ef['stack']);if(_0x2820ef[_0x2707('0x8')]){delete _0x2820ef[_0x2707('0x8')];}_0x745cfd[_0x2707('0x6')](_0x4062b6)[_0x2707('0x9')](_0x2820ef);};}function execChildProcess(){return new BPromise(function(_0x30090e,_0x2e1a46){exec(_0x2707('0xa'),function(_0x19881c,_0x115535,_0x478717){logger[_0x2707('0xb')](_0x115535);logger[_0x2707('0xb')](_0x478717);if(_0x19881c){logger[_0x2707('0xc')](_0x19881c);return _0x2e1a46(_0x19881c);}return _0x30090e(_0x115535);});});}exports['index']=function(_0x44c1d7,_0x590152){return pm2[_0x2707('0xd')]()[_0x2707('0xe')](function(_0xfe975c){if(_0xfe975c){var _0x3a67f2=_[_0x2707('0xf')](_0xfe975c,function(_0x4e52a3){return _0x4e52a3[_0x2707('0x8')]===_0x2707('0x10')||_0x4e52a3[_0x2707('0x8')]==='motion2';});return{'rows':_0x3a67f2,'count':_0x3a67f2[_0x2707('0x11')]};}return null;})[_0x2707('0xe')](respondWithResult(_0x590152,null))[_0x2707('0x12')](handleError(_0x590152,null));};exports[_0x2707('0x13')]=function(_0x7ed037,_0x27a3ea){return pm2['describe'](_0x7ed037[_0x2707('0x14')]['id'])[_0x2707('0xe')](respondWithResult(_0x27a3ea,null))[_0x2707('0xe')](handleEntityNotFound(_0x27a3ea,null))['catch'](handleError(_0x27a3ea,null));};exports['create']=function(_0x58a4ee,_0x1da4a6){if(_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')]&&_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]){var _0x3c2935=path[_0x2707('0x17')](__dirname,_0x2707('0x18'),_0x58a4ee[_0x2707('0x15')][_0x2707('0x16')]);var _0x37c475=process[_0x2707('0x19')]();process[_0x2707('0x1a')](path[_0x2707('0x1b')](_0x3c2935));return execChildProcess()['then'](function(_0x1acf22){process[_0x2707('0x1a')](_0x37c475);return pm2[_0x2707('0x1c')]({'name':_0x58a4ee[_0x2707('0x15')][_0x2707('0x8')],'script':_0x3c2935});})[_0x2707('0xe')](function(_0x4831ed){pm2[_0x2707('0x1d')]();return _0x4831ed[0x0];})[_0x2707('0xe')](respondWithResult(_0x1da4a6,0xc9))[_0x2707('0x12')](handleError(_0x1da4a6,null));}else{return _0x1da4a6[_0x2707('0x6')](0x1f4)[_0x2707('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x2707('0x1e')]=function(_0x4ca05d,_0x29dad2){if(_0x4ca05d[_0x2707('0x15')]['id']){delete _0x4ca05d[_0x2707('0x15')]['id'];}var _0x57da26={'online':_0x2707('0x1f'),'stopped':_0x2707('0x20')};if(_0x57da26[_0x2707('0x21')](_0x4ca05d['body'][_0x2707('0x6')])){return pm2[_0x57da26[_0x4ca05d[_0x2707('0x15')]['status']]](_0x4ca05d[_0x2707('0x14')]['id'])['then'](respondWithResult(_0x29dad2,0xc8))['catch'](handleError(_0x29dad2,null));}else{return _0x29dad2[_0x2707('0x6')](0x1f4)['send']({'message':_0x2707('0x22')});}};exports[_0x2707('0x23')]=function(_0x417a97,_0x36b2e9){if(_0x417a97['body']['id']){delete _0x417a97[_0x2707('0x15')]['id'];}if(_0x417a97[_0x2707('0x14')]['id']){return pm2[_0x2707('0x24')](_0x417a97[_0x2707('0x14')]['id'])[_0x2707('0xe')](function(_0x341e14){pm2[_0x2707('0x1d')]();return _0x341e14[0x0];})[_0x2707('0xe')](respondWithResult(_0x36b2e9,null))[_0x2707('0x12')](handleError(_0x36b2e9,null));}else{return _0x36b2e9['status'](0x1f4)[_0x2707('0x9')]({'message':_0x2707('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 0c06ea7..3f37a16 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 _0x4a1a=['Router','isAuthenticated','get','exports','express'];(function(_0x14babf,_0x32615b){var _0x29f4a5=function(_0x52cf22){while(--_0x52cf22){_0x14babf['push'](_0x14babf['shift']());}};_0x29f4a5(++_0x32615b);}(_0x4a1a,0x68));var _0xa4a1=function(_0x71b5d9,_0x14cb2a){_0x71b5d9=_0x71b5d9-0x0;var _0x3d1cb2=_0x4a1a[_0x71b5d9];return _0x3d1cb2;};'use strict';var express=require(_0xa4a1('0x0'));var router=express[_0xa4a1('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get']('/agents',auth[_0xa4a1('0x2')](),controller['getAgents']);router[_0xa4a1('0x3')]('/queues',auth[_0xa4a1('0x2')](),controller['getQueues']);module[_0xa4a1('0x4')]=router; \ No newline at end of file +var _0x2f6d=['../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated','getAgents','/queues','getQueues','express'];(function(_0x27336c,_0x40a9fc){var _0x6ade80=function(_0x3c298e){while(--_0x3c298e){_0x27336c['push'](_0x27336c['shift']());}};_0x6ade80(++_0x40a9fc);}(_0x2f6d,0x155));var _0xd2f6=function(_0x2c5f47,_0xc7b9be){_0x2c5f47=_0x2c5f47-0x0;var _0x8edd6f=_0x2f6d[_0x2c5f47];return _0x8edd6f;};'use strict';var express=require(_0xd2f6('0x0'));var router=express['Router']();var auth=require(_0xd2f6('0x1'));var controller=require(_0xd2f6('0x2'));router[_0xd2f6('0x3')](_0xd2f6('0x4'),auth[_0xd2f6('0x5')](),controller[_0xd2f6('0x6')]);router[_0xd2f6('0x3')](_0xd2f6('0x7'),auth[_0xd2f6('0x5')](),controller[_0xd2f6('0x8')]);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 63401be..fd1ec85 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 _0x4083=['sequelize','literal','forEach','Pause','where','merge','user','userProfileId','Agents','online','extraQueryConditions','assign','omit','UserProfile','getResources','User','findAndCountAll','rows','filterAgentAttributes','getAgentStatus','includes','voice','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','catch','getQueues','startCase','Queue','key','name','outbound','dialActive','dialMethod','fields','getOptions','Queues','filter','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','limit','count','status','Content-Range','json','getAgents','getChannels','query','pauseTypeFilter','pause','*pause','resolve','isValidChannel','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','then','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','rawAttributes','fieldName','type','agent','raw','push'];(function(_0x42f86c,_0x5c5a99){var _0x16aec5=function(_0x58ed75){while(--_0x58ed75){_0x42f86c['push'](_0x42f86c['shift']());}};_0x16aec5(++_0x5c5a99);}(_0x4083,0x135));var _0x3408=function(_0x2d030f,_0x461089){_0x2d030f=_0x2d030f-0x0;var _0x33f864=_0x4083[_0x2d030f];return _0x33f864;};'use strict';var _=require(_0x3408('0x0'));var util=require(_0x3408('0x1'));var rta=require(_0x3408('0x2'));var rtq=require(_0x3408('0x3'));var qs=require(_0x3408('0x4'));var utils=require('../../config/utils');var db=require(_0x3408('0x5'))['db'];var APIBadRequestError=require(_0x3408('0x6'))[_0x3408('0x7')];var APIHandleError=require('../../errors/api')[_0x3408('0x8')];function respondWithFilteredResult(_0x579744,_0x4b61c8){return function(_0x3b10e9){if(_0x3b10e9){var _0xfbbe5=typeof _0x4b61c8[_0x3408('0x9')]===_0x3408('0xa')&&typeof _0x4b61c8[_0x3408('0xb')]===_0x3408('0xa');var _0x52eb20=_0x3b10e9[_0x3408('0xc')];var _0x22f8b4=_0xfbbe5?0x0:_0x4b61c8[_0x3408('0x9')];var _0x2d7f8d=_0xfbbe5?_0x3b10e9[_0x3408('0xc')]:_0x4b61c8[_0x3408('0x9')]+_0x4b61c8['limit'];var _0x5ec280;if(_0x2d7f8d>=_0x52eb20){_0x2d7f8d=_0x52eb20;_0x5ec280=0xc8;}else{_0x5ec280=0xce;}_0x579744[_0x3408('0xd')](_0x5ec280);return _0x579744['set'](_0x3408('0xe'),_0x22f8b4+'-'+_0x2d7f8d+'/'+_0x52eb20)[_0x3408('0xf')](_0x3b10e9);}return null;};}exports[_0x3408('0x10')]=function(_0x533d8a,_0x5c3733){var _0x3e2ff8={'count':0x0,'rows':[]};var _0x336bb9={};var _0x7344b4;var _0x524fc4=utils[_0x3408('0x11')]();var _0x3f880c;var _0x511782;var _0x37501e=_0x533d8a['query']['globalQueueFilter'];var _0x20d877=_0x533d8a[_0x3408('0x12')]['globalStatusFilter'];var _0x3448cc=_0x533d8a[_0x3408('0x12')][_0x3408('0x13')];var _0x2c63f9=_0x20d877===_0x3408('0x14')||_0x20d877===_0x3408('0x15')?!![]:![];var _0x122881=[];var _0x7e7294;var _0x50ab17;Promise[_0x3408('0x16')]()['then'](function(){if(_0x533d8a[_0x3408('0x12')]['channel']){if(!utils[_0x3408('0x17')](_0x533d8a[_0x3408('0x12')][_0x3408('0x18')])){throw new APIBadRequestError(util[_0x3408('0x19')](_0x3408('0x1a'),_0x533d8a[_0x3408('0x12')][_0x3408('0x18')]));}_0x7344b4=_0x533d8a['query']['channel'][_0x3408('0x1b')]();}if(!_0x533d8a[_0x3408('0x12')][_0x3408('0x1c')]||!_0x533d8a[_0x3408('0x12')][_0x3408('0x1c')]['includes'](_0x3408('0x1d'))){_0x533d8a[_0x3408('0x12')][_0x3408('0x1c')]=rta[_0x3408('0x1e')](_0x533d8a[_0x3408('0x12')]['sort']);return;}var _0x145dad=rta[_0x3408('0x1f')](_0x533d8a['query']['sort']);_0x533d8a[_0x3408('0x12')][_0x3408('0x1c')]=_0x145dad['fields'][_0x3408('0x20')](',');_0x7e7294=_0x145dad[_0x3408('0x21')];})['then'](function(){if(!_0x37501e){return[];}return rta[_0x3408('0x22')](_0x37501e,_0x7344b4);})[_0x3408('0x23')](function(_0x6898de){_0x122881=_0x6898de;return rta[_0x3408('0x24')]();})[_0x3408('0x23')](function(_0x35d250){_0x511782=_0x35d250['rows'];if((!_0x20d877||_0x2c63f9)&&!_0x7e7294){return _0x122881;}if(_0x7e7294&&!_0x20d877){return rta[_0x3408('0x25')](_0x511782,_0x122881,_0x7e7294);}else{return rta[_0x3408('0x26')](_0x511782,_0x122881,_0x20d877);}})[_0x3408('0x23')](function(_0x3f9303){_0x122881=_0x3f9303;var _0x31ba5a=![];if(_0x122881[_0x3408('0x27')]===0x0){if(_0x37501e||_0x20d877){_0x31ba5a=!![];}if(_0x2c63f9){_0x31ba5a=![];}}if(_0x31ba5a){return _0x3e2ff8;}var _0x429fd1=_[_0x3408('0x28')](db['User'][_0x3408('0x29')],function(_0x17eb0e){return{'name':_0x17eb0e[_0x3408('0x2a')],'type':_0x17eb0e[_0x3408('0x2b')]['key']};});_0x533d8a[_0x3408('0x12')]['role']=_0x3408('0x2c');_0x336bb9=qs['getOptions'](_0x429fd1,_0x533d8a);_0x336bb9[_0x3408('0x2d')]=!![];var _0x35e51e=[];if(_0x122881[_0x3408('0x27')]>0x0){_0x35e51e[_0x3408('0x2e')]({'id':{'$in':_0x122881}});if(_0x7e7294&&!_0x20d877){_0x50ab17=[db[_0x3408('0x2f')][_0x3408('0x30')]('FIELD(id,'+_0x122881+')')];_0x336bb9['order']=_0x50ab17;}}if(_0x2c63f9){_0x524fc4[_0x3408('0x31')](function(_0x50a52c){var _0xbbd43e=!![];if(_0x20d877===_0x3408('0x15')&&_0x7344b4!==_0x50a52c){_0xbbd43e=![];}_0x35e51e['push']({[_0x50a52c+_0x3408('0x32')]:_0xbbd43e});});if(_0x3448cc){_0x35e51e[_0x3408('0x2e')]({'pauseType':_0x3448cc});}}else if(_0x20d877){_0x524fc4[_0x3408('0x31')](function(_0x2daf88){_0x35e51e['push']({[_0x2daf88+_0x3408('0x32')]:![]});});}_0x336bb9[_0x3408('0x33')]=_[_0x3408('0x34')](_0x336bb9[_0x3408('0x33')],{'$and':_0x35e51e});if(_0x533d8a[_0x3408('0x35')]['role']===_0x3408('0x35')){var _0x3ce9b3={'params':{'id':_0x533d8a[_0x3408('0x35')][_0x3408('0x36')]},'query':{'section':_0x3408('0x37'),'role':_0x3408('0x2c'),'raw':!![],'ids':_0x122881,'customSorting':_0x50ab17}};if(_0x533d8a[_0x3408('0x12')][_0x3408('0x38')]){_0x3ce9b3[_0x3408('0x12')][_0x3408('0x38')]=!![];}if(_0x2c63f9){_0x3ce9b3[_0x3408('0x12')][_0x3408('0x39')]=_0x35e51e;}_0x3ce9b3[_0x3408('0x12')]=Object[_0x3408('0x3a')](_0x3ce9b3[_0x3408('0x12')],_[_0x3408('0x3b')](_0x533d8a['query'],'id'));return db[_0x3408('0x3c')][_0x3408('0x3d')](_0x3ce9b3);}return db[_0x3408('0x3e')][_0x3408('0x3f')](_0x336bb9);})[_0x3408('0x23')](function(_0x212763){_0x3e2ff8['count']=_0x212763['count'];_0x3f880c=_0x212763[_0x3408('0x40')];return _0x3f880c['map'](function(_0x37de96){var _0x5cacee=_['find'](_0x511782,['id',_0x37de96['id']]);if(_0x5cacee){var _0x362004=rta[_0x3408('0x41')](_0x5cacee);_[_0x3408('0x34')](_0x37de96,_0x362004);}_0x37de96[_0x3408('0x1d')]=rta[_0x3408('0x42')](_0x37de96);if(_0x37de96[_0x3408('0x1d')][_0x3408('0x43')]('pause')){_0x524fc4[_0x3408('0x31')](function(_0xf97103){if(_0x37de96[_0xf97103+_0x3408('0x32')]){if(_0xf97103===_0x3408('0x44')){if(_0x37de96[_0x3408('0x45')]!=='talking'){_0x37de96[_0x3408('0x45')]=_0x3408('0x14');}}else{_0x37de96[_0xf97103+_0x3408('0x46')]=_0x3408('0x14');}}});}return _0x37de96;});})[_0x3408('0x23')](function(_0x1efc27){if(!_0x7e7294||_0x50ab17){return _0x1efc27;}return rta[_0x3408('0x47')](_0x1efc27,_0x7e7294);})['then'](function(_0x401394){var _0x3d3b65=rta[_0x3408('0x48')]();_0x3e2ff8[_0x3408('0x40')]=_0x401394['map'](function(_0x138fc5){return _[_0x3408('0x49')](_0x138fc5,_0x3d3b65);});return _0x3e2ff8;})[_0x3408('0x23')](respondWithFilteredResult(_0x5c3733,_0x336bb9))[_0x3408('0x4a')](APIHandleError(_0x5c3733));};exports[_0x3408('0x4b')]=function(_0x13f6d7,_0x25f75b){var _0x31ed54={'count':0x0,'rows':[]};var _0x589a67={};var _0x29301e;var _0xb6c62;var _0x43b4ee;Promise[_0x3408('0x16')]()[_0x3408('0x23')](function(){if(_0x13f6d7['query']['channel']){if(!utils[_0x3408('0x17')](_0x13f6d7[_0x3408('0x12')][_0x3408('0x18')])){throw new APIBadRequestError(util['format'](_0x3408('0x1a'),_0x13f6d7[_0x3408('0x12')]['channel']));}_0x29301e=_0x13f6d7[_0x3408('0x12')][_0x3408('0x18')][_0x3408('0x1b')]();}var _0x3f9ab2=_[_0x3408('0x4c')](_0x29301e)+_0x3408('0x4d');var _0x19ff67=_[_0x3408('0x28')](db[_0x3f9ab2][_0x3408('0x29')],function(_0x22a0c0){return{'name':_0x22a0c0[_0x3408('0x2a')],'type':_0x22a0c0[_0x3408('0x2b')][_0x3408('0x4e')]};});if(!_0x13f6d7[_0x3408('0x12')]['fields']){var _0x3c9d8a=['id',_0x3408('0x4f')];if(_0x29301e===_0x3408('0x44')){_0x3c9d8a[_0x3408('0x2e')](_0x3408('0x2b'));if(_0x13f6d7['query'][_0x3408('0x2b')]===_0x3408('0x50')){_0x3c9d8a['push']([_0x3408('0x51'),_0x3408('0x52')]);}}_0x13f6d7['query'][_0x3408('0x53')]=_0x3c9d8a['join'](',');}_0x589a67=qs[_0x3408('0x54')](_0x19ff67,_0x13f6d7);if(_0x13f6d7[_0x3408('0x35')]['role']===_0x3408('0x35')){var _0x5d9417={'params':{'id':_0x13f6d7[_0x3408('0x35')][_0x3408('0x36')]},'query':{'section':_0x29301e==='voice'&&_0x13f6d7['query']['type']===_0x3408('0x50')?'QueueCampaigns':_[_0x3408('0x4c')](_0x29301e)+_0x3408('0x55'),'type':_0x13f6d7[_0x3408('0x12')][_0x3408('0x2b')],'nolimit':!![],'sort':_0x3408('0x4f'),'filter':_0x13f6d7[_0x3408('0x12')][_0x3408('0x56')]}};_0x5d9417[_0x3408('0x12')]=Object['assign'](_0x5d9417[_0x3408('0x12')],_0x13f6d7[_0x3408('0x12')]);delete _0x5d9417[_0x3408('0x12')]['id'];return db['UserProfile'][_0x3408('0x3d')](_0x5d9417);}return db[_0x3f9ab2][_0x3408('0x3f')](_0x589a67);})['then'](function(_0x4ecfa1){_0x31ed54[_0x3408('0xc')]=_0x4ecfa1[_0x3408('0xc')];_0xb6c62=_0x4ecfa1[_0x3408('0x40')];return rtq[_0x3408('0x57')](_0x13f6d7,_0x29301e);})['then'](function(_0xef4017){_0x43b4ee=_0xef4017[_0x3408('0x40')];return rtq[_0x3408('0x58')](_0xb6c62,_0x43b4ee,_0x29301e,_0x13f6d7[_0x3408('0x12')][_0x3408('0x2b')]);})['then'](function(_0x47d81b){_0x31ed54['rows']=_0x47d81b;return _0x31ed54;})[_0x3408('0x23')](respondWithFilteredResult(_0x25f75b,_0x589a67))[_0x3408('0x4a')](APIHandleError(_0x25f75b));}; \ No newline at end of file +var _0xdc89=['forEach','where','user','userProfileId','Agents','online','extraQueryConditions','assign','omit','UserProfile','findAndCountAll','find','filterAgentAttributes','merge','globalStatus','voice','talking','voiceStatus','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','isValidChannel','Queue','fields','name','dialActive','dialMethod','outbound','QueueCampaigns','startCase','Queues','filter','getResources','initializeQueues','lodash','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','limit','status','set','Content-Range','json','query','pauseTypeFilter','pause','*pause','resolve','then','channel','format','toLowerCase','sort','includes','getUpdatedSortOptions','join','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','push','sequelize','literal','order','Pause'];(function(_0x46aa43,_0x470135){var _0x410ac9=function(_0x1b8e07){while(--_0x1b8e07){_0x46aa43['push'](_0x46aa43['shift']());}};_0x410ac9(++_0x470135);}(_0xdc89,0x1c7));var _0x9dc8=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0xdc89[_0x34b5ca];return _0x2d72c0;};'use strict';var _=require(_0x9dc8('0x0'));var util=require(_0x9dc8('0x1'));var rta=require(_0x9dc8('0x2'));var rtq=require('../../components/realtime/queues');var qs=require(_0x9dc8('0x3'));var utils=require(_0x9dc8('0x4'));var db=require(_0x9dc8('0x5'))['db'];var APIBadRequestError=require(_0x9dc8('0x6'))[_0x9dc8('0x7')];var APIHandleError=require(_0x9dc8('0x6'))[_0x9dc8('0x8')];function respondWithFilteredResult(_0x17e781,_0xffaa4e){return function(_0xbd4c13){if(_0xbd4c13){var _0x488148=typeof _0xffaa4e[_0x9dc8('0x9')]===_0x9dc8('0xa')&&typeof _0xffaa4e['limit']===_0x9dc8('0xa');var _0x36d946=_0xbd4c13[_0x9dc8('0xb')];var _0x3a8ce5=_0x488148?0x0:_0xffaa4e[_0x9dc8('0x9')];var _0x1503a8=_0x488148?_0xbd4c13[_0x9dc8('0xb')]:_0xffaa4e[_0x9dc8('0x9')]+_0xffaa4e[_0x9dc8('0xc')];var _0xc100d8;if(_0x1503a8>=_0x36d946){_0x1503a8=_0x36d946;_0xc100d8=0xc8;}else{_0xc100d8=0xce;}_0x17e781[_0x9dc8('0xd')](_0xc100d8);return _0x17e781[_0x9dc8('0xe')](_0x9dc8('0xf'),_0x3a8ce5+'-'+_0x1503a8+'/'+_0x36d946)[_0x9dc8('0x10')](_0xbd4c13);}return null;};}exports['getAgents']=function(_0x504ffb,_0xa01dda){var _0x4a3200={'count':0x0,'rows':[]};var _0x1c4489={};var _0x3ca3df;var _0x1b9c05=utils['getChannels']();var _0x32dd4b;var _0x33d83c;var _0x405b31=_0x504ffb[_0x9dc8('0x11')]['globalQueueFilter'];var _0x16eb55=_0x504ffb[_0x9dc8('0x11')]['globalStatusFilter'];var _0x1cdbf5=_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x12')];var _0x1c66e1=_0x16eb55===_0x9dc8('0x13')||_0x16eb55===_0x9dc8('0x14')?!![]:![];var _0x10c0d3=[];var _0x581558;var _0x576256;Promise[_0x9dc8('0x15')]()[_0x9dc8('0x16')](function(){if(_0x504ffb['query'][_0x9dc8('0x17')]){if(!utils['isValidChannel'](_0x504ffb['query'][_0x9dc8('0x17')])){throw new APIBadRequestError(util[_0x9dc8('0x18')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x17')]));}_0x3ca3df=_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x17')][_0x9dc8('0x19')]();}if(!_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x1a')]||!_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x1a')][_0x9dc8('0x1b')]('globalStatus')){_0x504ffb[_0x9dc8('0x11')]['sort']=rta['validateSortParameter'](_0x504ffb['query']['sort']);return;}var _0x5889a5=rta[_0x9dc8('0x1c')](_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x1a')]);_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x1a')]=_0x5889a5['fields'][_0x9dc8('0x1d')](',');_0x581558=_0x5889a5['order'];})[_0x9dc8('0x16')](function(){if(!_0x405b31){return[];}return rta['getAgentIdsByQueues'](_0x405b31,_0x3ca3df);})[_0x9dc8('0x16')](function(_0x41905b){_0x10c0d3=_0x41905b;return rta[_0x9dc8('0x1e')]();})['then'](function(_0xdffd3){_0x33d83c=_0xdffd3[_0x9dc8('0x1f')];if((!_0x16eb55||_0x1c66e1)&&!_0x581558){return _0x10c0d3;}if(_0x581558&&!_0x16eb55){return rta[_0x9dc8('0x20')](_0x33d83c,_0x10c0d3,_0x581558);}else{return rta[_0x9dc8('0x21')](_0x33d83c,_0x10c0d3,_0x16eb55);}})[_0x9dc8('0x16')](function(_0x4339de){_0x10c0d3=_0x4339de;var _0x5c75e2=![];if(_0x10c0d3[_0x9dc8('0x22')]===0x0){if(_0x405b31||_0x16eb55){_0x5c75e2=!![];}if(_0x1c66e1){_0x5c75e2=![];}}if(_0x5c75e2){return _0x4a3200;}var _0x2faaca=_[_0x9dc8('0x23')](db[_0x9dc8('0x24')][_0x9dc8('0x25')],function(_0x569782){return{'name':_0x569782[_0x9dc8('0x26')],'type':_0x569782[_0x9dc8('0x27')][_0x9dc8('0x28')]};});_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x29')]=_0x9dc8('0x2a');_0x1c4489=qs[_0x9dc8('0x2b')](_0x2faaca,_0x504ffb);_0x1c4489['raw']=!![];var _0x470995=[];if(_0x10c0d3['length']>0x0){_0x470995[_0x9dc8('0x2c')]({'id':{'$in':_0x10c0d3}});if(_0x581558&&!_0x16eb55){_0x576256=[db[_0x9dc8('0x2d')][_0x9dc8('0x2e')]('FIELD(id,'+_0x10c0d3+')')];_0x1c4489[_0x9dc8('0x2f')]=_0x576256;}}if(_0x1c66e1){_0x1b9c05['forEach'](function(_0x3f0710){var _0x4d958c=!![];if(_0x16eb55===_0x9dc8('0x14')&&_0x3ca3df!==_0x3f0710){_0x4d958c=![];}_0x470995[_0x9dc8('0x2c')]({[_0x3f0710+_0x9dc8('0x30')]:_0x4d958c});});if(_0x1cdbf5){_0x470995['push']({'pauseType':_0x1cdbf5});}}else if(_0x16eb55){_0x1b9c05[_0x9dc8('0x31')](function(_0x1262bf){_0x470995[_0x9dc8('0x2c')]({[_0x1262bf+'Pause']:![]});});}_0x1c4489[_0x9dc8('0x32')]=_['merge'](_0x1c4489[_0x9dc8('0x32')],{'$and':_0x470995});if(_0x504ffb['user'][_0x9dc8('0x29')]==='user'){var _0x3d1b79={'params':{'id':_0x504ffb[_0x9dc8('0x33')][_0x9dc8('0x34')]},'query':{'section':_0x9dc8('0x35'),'role':'agent','raw':!![],'ids':_0x10c0d3,'customSorting':_0x576256}};if(_0x504ffb[_0x9dc8('0x11')][_0x9dc8('0x36')]){_0x3d1b79[_0x9dc8('0x11')]['online']=!![];}if(_0x1c66e1){_0x3d1b79[_0x9dc8('0x11')][_0x9dc8('0x37')]=_0x470995;}_0x3d1b79[_0x9dc8('0x11')]=Object[_0x9dc8('0x38')](_0x3d1b79[_0x9dc8('0x11')],_[_0x9dc8('0x39')](_0x504ffb[_0x9dc8('0x11')],'id'));return db[_0x9dc8('0x3a')]['getResources'](_0x3d1b79);}return db[_0x9dc8('0x24')][_0x9dc8('0x3b')](_0x1c4489);})['then'](function(_0x2b816a){_0x4a3200[_0x9dc8('0xb')]=_0x2b816a[_0x9dc8('0xb')];_0x32dd4b=_0x2b816a['rows'];return _0x32dd4b[_0x9dc8('0x23')](function(_0x3d1f66){var _0x49054f=_[_0x9dc8('0x3c')](_0x33d83c,['id',_0x3d1f66['id']]);if(_0x49054f){var _0x23177c=rta[_0x9dc8('0x3d')](_0x49054f);_[_0x9dc8('0x3e')](_0x3d1f66,_0x23177c);}_0x3d1f66[_0x9dc8('0x3f')]=rta['getAgentStatus'](_0x3d1f66);if(_0x3d1f66[_0x9dc8('0x3f')][_0x9dc8('0x1b')]('pause')){_0x1b9c05['forEach'](function(_0x1fd3e1){if(_0x3d1f66[_0x1fd3e1+_0x9dc8('0x30')]){if(_0x1fd3e1===_0x9dc8('0x40')){if(_0x3d1f66['voiceStatus']!==_0x9dc8('0x41')){_0x3d1f66[_0x9dc8('0x42')]=_0x9dc8('0x13');}}else{_0x3d1f66[_0x1fd3e1+_0x9dc8('0x43')]=_0x9dc8('0x13');}}});}return _0x3d1f66;});})[_0x9dc8('0x16')](function(_0x2a6d59){if(!_0x581558||_0x576256){return _0x2a6d59;}return rta[_0x9dc8('0x44')](_0x2a6d59,_0x581558);})[_0x9dc8('0x16')](function(_0x5a14ca){var _0x4622c8=rta[_0x9dc8('0x45')]();_0x4a3200[_0x9dc8('0x1f')]=_0x5a14ca[_0x9dc8('0x23')](function(_0x272d49){return _['pick'](_0x272d49,_0x4622c8);});return _0x4a3200;})[_0x9dc8('0x16')](respondWithFilteredResult(_0xa01dda,_0x1c4489))[_0x9dc8('0x46')](APIHandleError(_0xa01dda));};exports['getQueues']=function(_0x317324,_0x28925c){var _0x11e784={'count':0x0,'rows':[]};var _0x3091d8={};var _0x2db673;var _0xfaa554;var _0x9fd9aa;Promise[_0x9dc8('0x15')]()['then'](function(){if(_0x317324['query'][_0x9dc8('0x17')]){if(!utils[_0x9dc8('0x47')](_0x317324['query'][_0x9dc8('0x17')])){throw new APIBadRequestError(util[_0x9dc8('0x18')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x317324[_0x9dc8('0x11')][_0x9dc8('0x17')]));}_0x2db673=_0x317324[_0x9dc8('0x11')]['channel'][_0x9dc8('0x19')]();}var _0x3215af=_['startCase'](_0x2db673)+_0x9dc8('0x48');var _0x1f13d8=_['map'](db[_0x3215af]['rawAttributes'],function(_0x22fee8){return{'name':_0x22fee8[_0x9dc8('0x26')],'type':_0x22fee8['type'][_0x9dc8('0x28')]};});if(!_0x317324['query'][_0x9dc8('0x49')]){var _0x1691f4=['id',_0x9dc8('0x4a')];if(_0x2db673==='voice'){_0x1691f4['push'](_0x9dc8('0x27'));if(_0x317324['query'][_0x9dc8('0x27')]==='outbound'){_0x1691f4['push']([_0x9dc8('0x4b'),_0x9dc8('0x4c')]);}}_0x317324[_0x9dc8('0x11')]['fields']=_0x1691f4[_0x9dc8('0x1d')](',');}_0x3091d8=qs[_0x9dc8('0x2b')](_0x1f13d8,_0x317324);if(_0x317324[_0x9dc8('0x33')]['role']===_0x9dc8('0x33')){var _0x367aeb={'params':{'id':_0x317324[_0x9dc8('0x33')][_0x9dc8('0x34')]},'query':{'section':_0x2db673===_0x9dc8('0x40')&&_0x317324[_0x9dc8('0x11')][_0x9dc8('0x27')]===_0x9dc8('0x4d')?_0x9dc8('0x4e'):_[_0x9dc8('0x4f')](_0x2db673)+_0x9dc8('0x50'),'type':_0x317324['query'][_0x9dc8('0x27')],'nolimit':!![],'sort':_0x9dc8('0x4a'),'filter':_0x317324[_0x9dc8('0x11')][_0x9dc8('0x51')]}};_0x367aeb['query']=Object[_0x9dc8('0x38')](_0x367aeb[_0x9dc8('0x11')],_0x317324[_0x9dc8('0x11')]);delete _0x367aeb['query']['id'];return db['UserProfile'][_0x9dc8('0x52')](_0x367aeb);}return db[_0x3215af][_0x9dc8('0x3b')](_0x3091d8);})[_0x9dc8('0x16')](function(_0x2befe1){_0x11e784[_0x9dc8('0xb')]=_0x2befe1[_0x9dc8('0xb')];_0xfaa554=_0x2befe1[_0x9dc8('0x1f')];return rtq['getRealtimeQueues'](_0x317324,_0x2db673);})[_0x9dc8('0x16')](function(_0x7d9f5a){_0x9fd9aa=_0x7d9f5a[_0x9dc8('0x1f')];return rtq[_0x9dc8('0x53')](_0xfaa554,_0x9fd9aa,_0x2db673,_0x317324[_0x9dc8('0x11')][_0x9dc8('0x27')]);})[_0x9dc8('0x16')](function(_0x2a31a6){_0x11e784[_0x9dc8('0x1f')]=_0x2a31a6;return _0x11e784;})[_0x9dc8('0x16')](respondWithFilteredResult(_0x28925c,_0x3091d8))['catch'](APIHandleError(_0x28925c));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 416f8ab..26404e3 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(_0x445969,_0x4d2621){var _0x446cd7=function(_0x55d4b3){while(--_0x55d4b3){_0x445969['push'](_0x445969['shift']());}};_0x446cd7(++_0x4d2621);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0xcb91[_0x3c4dad];return _0x1a4f49;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x9d04d8,_0x309e20){var _0x4f7582=function(_0x40c04c){while(--_0x40c04c){_0x9d04d8['push'](_0x9d04d8['shift']());}};_0x4f7582(++_0x309e20);}(_0xe706,0xa3));var _0x6e70=function(_0x526074,_0x5e5d09){_0x526074=_0x526074-0x0;var _0x83c6c8=_0xe706[_0x526074];return _0x83c6c8;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 245599a..1d4d5c0 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 _0x1a28=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x260941,_0x244df5){var _0x40a169=function(_0x5a5bc2){while(--_0x5a5bc2){_0x260941['push'](_0x260941['shift']());}};_0x40a169(++_0x244df5);}(_0x1a28,0x10e));var _0x81a2=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x1a28[_0x36de10];return _0x58100f;};'use strict';var Sequelize=require(_0x81a2('0x0'));module[_0x81a2('0x1')]={'state':{'type':Sequelize[_0x81a2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x81a2('0x3')]},'scheduledat':{'type':Sequelize[_0x81a2('0x4')]},'uniqueid':{'type':Sequelize[_0x81a2('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x81a2('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x81a2('0x3')]},'campaigntype':{'type':Sequelize[_0x81a2('0x3')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcde7=['STRING','DATE','INTEGER'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0xcde7,0x65));var _0x7cde=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcde7[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x7cde('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x7cde('0x1')]},'scheduledat':{'type':Sequelize[_0x7cde('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7cde('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7cde('0x1')]},'campaigntype':{'type':Sequelize[_0x7cde('0x1')]},'membername':{'type':Sequelize[_0x7cde('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 4c25633..f137632 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 _0xb931=['../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x484a60,_0x63e920){var _0x18217b=function(_0x15ff9a){while(--_0x15ff9a){_0x484a60['push'](_0x484a60['shift']());}};_0x18217b(++_0x63e920);}(_0xb931,0x15f));var _0x1b93=function(_0x4d0e7c,_0x28e9a0){_0x4d0e7c=_0x4d0e7c-0x0;var _0x2a6489=_0xb931[_0x4d0e7c];return _0x2a6489;};'use strict';var _=require(_0x1b93('0x0'));var util=require(_0x1b93('0x1'));var logger=require(_0x1b93('0x2'))(_0x1b93('0x3'));var moment=require(_0x1b93('0x4'));var BPromise=require(_0x1b93('0x5'));var rp=require(_0x1b93('0x6'));var fs=require('fs');var path=require(_0x1b93('0x7'));var rimraf=require(_0x1b93('0x8'));var config=require(_0x1b93('0x9'));var attributes=require(_0x1b93('0xa'));module[_0x1b93('0xb')]=function(_0x2f55a2,_0x23735c){return _0x2f55a2[_0x1b93('0xc')](_0x1b93('0xd'),attributes,{'tableName':_0x1b93('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7883=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define'];(function(_0x54eac3,_0x27555f){var _0x19a219=function(_0x2cbe6a){while(--_0x2cbe6a){_0x54eac3['push'](_0x54eac3['shift']());}};_0x19a219(++_0x27555f);}(_0x7883,0x1c9));var _0x3788=function(_0x5b0adf,_0x354a37){_0x5b0adf=_0x5b0adf-0x0;var _0x4a7869=_0x7883[_0x5b0adf];return _0x4a7869;};'use strict';var _=require(_0x3788('0x0'));var util=require(_0x3788('0x1'));var logger=require(_0x3788('0x2'))(_0x3788('0x3'));var moment=require(_0x3788('0x4'));var BPromise=require('bluebird');var rp=require(_0x3788('0x5'));var fs=require('fs');var path=require(_0x3788('0x6'));var rimraf=require(_0x3788('0x7'));var config=require('../../config/environment');var attributes=require(_0x3788('0x8'));module[_0x3788('0x9')]=function(_0x1818f,_0x546b41){return _0x1818f[_0x3788('0xa')](_0x3788('0xb'),attributes,{'tableName':_0x3788('0xc'),'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 5dd3e9b..b1365c6 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 _0xd3fa=['stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x44d9b2,_0x410a9b){var _0x25acb7=function(_0x543789){while(--_0x543789){_0x44d9b2['push'](_0x44d9b2['shift']());}};_0x25acb7(++_0x410a9b);}(_0xd3fa,0x180));var _0xad3f=function(_0x43a7ed,_0x35b733){_0x43a7ed=_0x43a7ed-0x0;var _0x1b3dcd=_0xd3fa[_0x43a7ed];return _0x1b3dcd;};'use strict';var _=require(_0xad3f('0x0'));var util=require(_0xad3f('0x1'));var moment=require(_0xad3f('0x2'));var BPromise=require(_0xad3f('0x3'));var rs=require(_0xad3f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad3f('0x5'))['db'];var utils=require(_0xad3f('0x6'));var logger=require(_0xad3f('0x7'))(_0xad3f('0x8'));var config=require('../../config/environment');var jayson=require(_0xad3f('0x9'));var client=jayson[_0xad3f('0xa')][_0xad3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aef33,_0x2afd8a,_0x21585e){return new BPromise(function(_0x53d0d9,_0x4422ff){return client[_0xad3f('0xc')](_0x4aef33,_0x21585e)[_0xad3f('0xd')](function(_0x131989){logger[_0xad3f('0xe')](_0xad3f('0xf'),_0x2afd8a,'request\x20sent');logger[_0xad3f('0x10')](_0xad3f('0x11'),_0x2afd8a,_0xad3f('0x12'),JSON[_0xad3f('0x13')](_0x131989));if(_0x131989[_0xad3f('0x14')]){if(_0x131989[_0xad3f('0x14')][_0xad3f('0x15')]===0x1f4){logger[_0xad3f('0x14')](_0xad3f('0xf'),_0x2afd8a,_0x131989[_0xad3f('0x14')][_0xad3f('0x16')]);return _0x4422ff(_0x131989['error'][_0xad3f('0x16')]);}logger[_0xad3f('0x14')](_0xad3f('0xf'),_0x2afd8a,_0x131989[_0xad3f('0x14')][_0xad3f('0x16')]);return _0x53d0d9(_0x131989[_0xad3f('0x14')]['message']);}else{logger[_0xad3f('0xe')](_0xad3f('0xf'),_0x2afd8a,_0xad3f('0x12'));_0x53d0d9(_0x131989[_0xad3f('0x17')][_0xad3f('0x16')]);}})[_0xad3f('0x18')](function(_0x2dcbcf){logger[_0xad3f('0x14')](_0xad3f('0xf'),_0x2afd8a,_0x2dcbcf);_0x4422ff(_0x2dcbcf);});});}exports[_0xad3f('0x19')]=function(_0x1d28ff){var _0x593dc5=this;return new Promise(function(_0x54b579,_0x545b1a){return db[_0xad3f('0x1a')][_0xad3f('0x1b')](_0x1d28ff[_0xad3f('0x1c')],{'raw':_0x1d28ff[_0xad3f('0x1d')]?_0x1d28ff[_0xad3f('0x1d')][_0xad3f('0x1e')]===undefined?!![]:![]:!![]})[_0xad3f('0xd')](function(_0x2ea580){logger[_0xad3f('0xe')](_0xad3f('0x19'),_0x1d28ff);logger[_0xad3f('0x10')](_0xad3f('0x19'),_0x1d28ff,JSON['stringify'](_0x2ea580));_0x54b579(_0x2ea580);})[_0xad3f('0x18')](function(_0x47eada){logger[_0xad3f('0x14')](_0xad3f('0x19'),_0x47eada[_0xad3f('0x16')],_0x1d28ff);_0x545b1a(_0x593dc5[_0xad3f('0x14')](0x1f4,_0x47eada[_0xad3f('0x16')]));});});}; \ No newline at end of file +var _0x19f1=['create','body','options','raw','debug','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateReportAgentPreview','ReportAgentPreview'];(function(_0xfcdda0,_0x32479b){var _0x17ebe3=function(_0x5bfaa3){while(--_0x5bfaa3){_0xfcdda0['push'](_0xfcdda0['shift']());}};_0x17ebe3(++_0x32479b);}(_0x19f1,0x162));var _0x119f=function(_0x215f36,_0x34524a){_0x215f36=_0x215f36-0x0;var _0xa5a395=_0x19f1[_0x215f36];return _0xa5a395;};'use strict';var _=require(_0x119f('0x0'));var util=require(_0x119f('0x1'));var moment=require(_0x119f('0x2'));var BPromise=require(_0x119f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x119f('0x4'));var logger=require('../../config/logger')(_0x119f('0x5'));var config=require(_0x119f('0x6'));var jayson=require(_0x119f('0x7'));var client=jayson[_0x119f('0x8')][_0x119f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ecce3,_0x3ba53c,_0x186b45){return new BPromise(function(_0x5207e4,_0x10aad2){return client[_0x119f('0xa')](_0x5ecce3,_0x186b45)[_0x119f('0xb')](function(_0x403413){logger[_0x119f('0xc')](_0x119f('0xd'),_0x3ba53c,_0x119f('0xe'));logger['debug'](_0x119f('0xf'),_0x3ba53c,_0x119f('0xe'),JSON[_0x119f('0x10')](_0x403413));if(_0x403413[_0x119f('0x11')]){if(_0x403413[_0x119f('0x11')][_0x119f('0x12')]===0x1f4){logger[_0x119f('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3ba53c,_0x403413[_0x119f('0x11')][_0x119f('0x13')]);return _0x10aad2(_0x403413['error'][_0x119f('0x13')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3ba53c,_0x403413['error'][_0x119f('0x13')]);return _0x5207e4(_0x403413[_0x119f('0x11')][_0x119f('0x13')]);}else{logger['info'](_0x119f('0xd'),_0x3ba53c,'request\x20sent');_0x5207e4(_0x403413[_0x119f('0x14')][_0x119f('0x13')]);}})['catch'](function(_0x163070){logger['error'](_0x119f('0xd'),_0x3ba53c,_0x163070);_0x10aad2(_0x163070);});});}exports[_0x119f('0x15')]=function(_0x5f177e){var _0x321341=this;return new Promise(function(_0x419253,_0xd3131c){return db[_0x119f('0x16')][_0x119f('0x17')](_0x5f177e[_0x119f('0x18')],{'raw':_0x5f177e[_0x119f('0x19')]?_0x5f177e[_0x119f('0x19')][_0x119f('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4482bf){logger[_0x119f('0xc')]('CreateReportAgentPreview',_0x5f177e);logger[_0x119f('0x1b')](_0x119f('0x15'),_0x5f177e,JSON[_0x119f('0x10')](_0x4482bf));_0x419253(_0x4482bf);})[_0x119f('0x1c')](function(_0x48cfc6){logger[_0x119f('0x11')](_0x119f('0x15'),_0x48cfc6[_0x119f('0x13')],_0x5f177e);_0xd3131c(_0x321341[_0x119f('0x11')](0x1f4,_0x48cfc6[_0x119f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 713b199..b24f1ce 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 _0x3b4f=['/voice/queues/:id','showVoiceQueues','put','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect'];(function(_0x417179,_0x274be4){var _0x2b3424=function(_0x42843e){while(--_0x42843e){_0x417179['push'](_0x417179['shift']());}};_0x2b3424(++_0x274be4);}(_0x3b4f,0x176));var _0xf3b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b4f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xf3b4('0x0'));var path=require(_0xf3b4('0x1'));var express=require(_0xf3b4('0x2'));var router=express[_0xf3b4('0x3')]();var auth=require(_0xf3b4('0x4'));var controller=require(_0xf3b4('0x5'));router[_0xf3b4('0x6')](_0xf3b4('0x7'),auth[_0xf3b4('0x8')](),controller['voiceChannels']);router[_0xf3b4('0x6')](_0xf3b4('0x9'),auth['isAuthenticated'](),controller[_0xf3b4('0xa')]);router[_0xf3b4('0x6')](_0xf3b4('0xb'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0xc')]);router[_0xf3b4('0x6')](_0xf3b4('0xd'),auth[_0xf3b4('0x8')](),controller['voiceQueues']);router['get']('/chat/queues',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0xe')]);router[_0xf3b4('0x6')]('/mail/queues',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0xf')]);router[_0xf3b4('0x6')]('/mail/accounts',auth['isAuthenticated'](),controller[_0xf3b4('0x10')]);router[_0xf3b4('0x6')](_0xf3b4('0x11'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x12')]);router[_0xf3b4('0x6')]('/sms/queues',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x13')]);router[_0xf3b4('0x6')](_0xf3b4('0x14'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0xf3b4('0x6')](_0xf3b4('0x15'),auth[_0xf3b4('0x8')](),controller['faxQueues']);router[_0xf3b4('0x6')]('/voice/queues/preview/:id',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x16')]);router[_0xf3b4('0x6')](_0xf3b4('0x17'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x18')]);router['get'](_0xf3b4('0x19'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x1a')]);router[_0xf3b4('0x6')](_0xf3b4('0x1b'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x1c')]);router[_0xf3b4('0x6')](_0xf3b4('0x1d'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x1e')]);router[_0xf3b4('0x6')](_0xf3b4('0x1f'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x20')]);router[_0xf3b4('0x21')](_0xf3b4('0x1f'),auth[_0xf3b4('0x8')](),controller['updateVoiceQueue']);router[_0xf3b4('0x6')](_0xf3b4('0x22'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x23')]);router[_0xf3b4('0x6')](_0xf3b4('0x24'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x25')]);router[_0xf3b4('0x6')](_0xf3b4('0x26'),auth['isAuthenticated'](),controller['agents']);router[_0xf3b4('0x21')]('/agents/:id/capacity',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x27')]);router[_0xf3b4('0x6')](_0xf3b4('0x28'),auth['isAuthenticated'](),controller[_0xf3b4('0x29')]);router[_0xf3b4('0x6')]('/trunks',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x2a')]);router[_0xf3b4('0x6')](_0xf3b4('0x2b'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x2c')]);router[_0xf3b4('0x6')](_0xf3b4('0x2d'),auth['isAuthenticated'](),controller[_0xf3b4('0x2e')]);router['get']('/chat/queues/waitinginteractions',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x2f')]);router[_0xf3b4('0x6')](_0xf3b4('0x30'),auth['isAuthenticated'](),controller[_0xf3b4('0x31')]);router[_0xf3b4('0x6')](_0xf3b4('0x32'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x33')]);router[_0xf3b4('0x6')](_0xf3b4('0x34'),auth['isAuthenticated'](),controller[_0xf3b4('0x35')]);router[_0xf3b4('0x6')](_0xf3b4('0x36'),auth[_0xf3b4('0x8')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xf3b4('0x37'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xf3b4('0x38'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x39')]);router[_0xf3b4('0x3a')](_0xf3b4('0x3b'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x3c')](_0xf3b4('0x3d')));router[_0xf3b4('0x6')](_0xf3b4('0x3e'),auth[_0xf3b4('0x8')](),controller['showMailQueues']);router[_0xf3b4('0x3a')](_0xf3b4('0x3f'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x3c')]('chat'));router['get'](_0xf3b4('0x40'),auth[_0xf3b4('0x8')](),controller['showChatQueues']);router[_0xf3b4('0x3a')](_0xf3b4('0x41'),auth[_0xf3b4('0x8')](),controller['queueNotify']('fax'));router[_0xf3b4('0x6')](_0xf3b4('0x42'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x43')]);router['post'](_0xf3b4('0x44'),auth['isAuthenticated'](),controller['queueNotify'](_0xf3b4('0x45')));router[_0xf3b4('0x6')]('/openchannel/queues/:id',auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x46')]);router[_0xf3b4('0x3a')](_0xf3b4('0x47'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x3c')](_0xf3b4('0x48')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0xf3b4('0x3c')](_0xf3b4('0x49')));router[_0xf3b4('0x6')](_0xf3b4('0x4a'),auth['isAuthenticated'](),controller[_0xf3b4('0x4b')]);router[_0xf3b4('0x6')](_0xf3b4('0x4c'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x4d')]);router[_0xf3b4('0x3a')](_0xf3b4('0x4e'),auth[_0xf3b4('0x8')](),controller[_0xf3b4('0x4f')]);module[_0xf3b4('0x50')]=router; \ No newline at end of file +var _0x0e02=['/mail/queues','mailQueues','/mail/accounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues'];(function(_0x5d0b88,_0x1d6660){var _0x4fda02=function(_0x9e84f7){while(--_0x9e84f7){_0x5d0b88['push'](_0x5d0b88['shift']());}};_0x4fda02(++_0x1d6660);}(_0x0e02,0x1cf));var _0x20e0=function(_0x49a844,_0x3854e1){_0x49a844=_0x49a844-0x0;var _0x5b3cf2=_0x0e02[_0x49a844];return _0x5b3cf2;};'use strict';var multer=require(_0x20e0('0x0'));var util=require(_0x20e0('0x1'));var path=require(_0x20e0('0x2'));var express=require(_0x20e0('0x3'));var router=express[_0x20e0('0x4')]();var auth=require(_0x20e0('0x5'));var controller=require(_0x20e0('0x6'));router[_0x20e0('0x7')](_0x20e0('0x8'),auth['isAuthenticated'](),controller[_0x20e0('0x9')]);router[_0x20e0('0x7')](_0x20e0('0xa'),auth[_0x20e0('0xb')](),controller[_0x20e0('0xc')]);router[_0x20e0('0x7')](_0x20e0('0xd'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x20e0('0x7')](_0x20e0('0xe'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x20e0('0x7')](_0x20e0('0xf'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x10')]);router[_0x20e0('0x7')](_0x20e0('0x11'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x12')]);router[_0x20e0('0x7')](_0x20e0('0x13'),auth[_0x20e0('0xb')](),controller['mailAccounts']);router['get']('/openchannel/queues',auth[_0x20e0('0xb')](),controller['openchannelQueues']);router[_0x20e0('0x7')](_0x20e0('0x14'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x15')]);router[_0x20e0('0x7')](_0x20e0('0x16'),auth['isAuthenticated'](),controller[_0x20e0('0x17')]);router[_0x20e0('0x7')](_0x20e0('0x18'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x19')]);router[_0x20e0('0x7')](_0x20e0('0x1a'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x1b')]);router[_0x20e0('0x7')](_0x20e0('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x20e0('0x7')](_0x20e0('0x1d'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x1e')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth['isAuthenticated'](),controller[_0x20e0('0x1f')]);router[_0x20e0('0x7')](_0x20e0('0x20'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x20e0('0x7')](_0x20e0('0x21'),auth[_0x20e0('0xb')](),controller['showVoiceQueues']);router[_0x20e0('0x22')](_0x20e0('0x21'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x23')]);router[_0x20e0('0x7')](_0x20e0('0x24'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x25')]);router[_0x20e0('0x7')](_0x20e0('0x26'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x27')]);router[_0x20e0('0x7')](_0x20e0('0x28'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x29')]);router[_0x20e0('0x22')]('/agents/:id/capacity',auth[_0x20e0('0xb')](),controller['agentCapacity']);router[_0x20e0('0x7')](_0x20e0('0x2a'),auth[_0x20e0('0xb')](),controller['telephones']);router[_0x20e0('0x7')](_0x20e0('0x2b'),auth[_0x20e0('0xb')](),controller['trunks']);router['get'](_0x20e0('0x2c'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x2d')]);router[_0x20e0('0x7')](_0x20e0('0x2e'),auth['isAuthenticated'](),controller[_0x20e0('0x2f')]);router[_0x20e0('0x7')](_0x20e0('0x30'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x31')]);router[_0x20e0('0x7')]('/mail/queues/waitinginteractions',auth[_0x20e0('0xb')](),controller['mailQueuesWaitingInteractions']);router[_0x20e0('0x7')](_0x20e0('0x32'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x33')]);router[_0x20e0('0x7')](_0x20e0('0x34'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x35')]);router['get'](_0x20e0('0x36'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x37')]);router['get'](_0x20e0('0x38'),auth['isAuthenticated'](),controller[_0x20e0('0x39')]);router[_0x20e0('0x7')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x20e0('0x3a')]);router[_0x20e0('0x3b')](_0x20e0('0x3c'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x3d')](_0x20e0('0x3e')));router[_0x20e0('0x7')]('/mail/queues/:id',auth[_0x20e0('0xb')](),controller['showMailQueues']);router[_0x20e0('0x3b')](_0x20e0('0x3f'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x3d')](_0x20e0('0x40')));router[_0x20e0('0x7')](_0x20e0('0x41'),auth[_0x20e0('0xb')](),controller['showChatQueues']);router[_0x20e0('0x3b')](_0x20e0('0x42'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x3d')](_0x20e0('0x43')));router[_0x20e0('0x7')]('/fax/queues/:id',auth[_0x20e0('0xb')](),controller['showFaxQueues']);router['post'](_0x20e0('0x44'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x3d')](_0x20e0('0x45')));router[_0x20e0('0x7')](_0x20e0('0x46'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x47')]);router[_0x20e0('0x3b')](_0x20e0('0x48'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x3d')](_0x20e0('0x49')));router[_0x20e0('0x3b')](_0x20e0('0x4a'),auth['isAuthenticated'](),controller[_0x20e0('0x3d')](_0x20e0('0x4b')));router[_0x20e0('0x7')]('/sms/queues/:id',auth[_0x20e0('0xb')](),controller['showSmsQueues']);router[_0x20e0('0x7')](_0x20e0('0x4c'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x20e0('0x3b')](_0x20e0('0x4d'),auth[_0x20e0('0xb')](),controller[_0x20e0('0x4e')]);module[_0x20e0('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6a4eb6a..9396348 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 _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file +var _0xb10b=['showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','*,*,*,*','agentNotify','channel','chat','User','Agent\x20not\x20found','Start','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','then','error','message','result','status','json','stack','name','send','isNil','rows','find','voiceChannels','query','catch','voiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','MemberReport','findOrCreate','SIP/%s','interface','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues'];(function(_0x1cd23d,_0xec4ea5){var _0x5e8ad5=function(_0x1603d8){while(--_0x1603d8){_0x1cd23d['push'](_0x1cd23d['shift']());}};_0x5e8ad5(++_0xec4ea5);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fae14,_0x4ef118){_0x4fae14=_0x4fae14-0x0;var _0x305e46=_0xb10b[_0x4fae14];return _0x305e46;};'use strict';var BPromise=require(_0xbb10('0x0'));var moment=require('moment');var _=require(_0xbb10('0x1'));var util=require(_0xbb10('0x2'));var db=require(_0xbb10('0x3'))['db'];var logger=require('../../config/logger')(_0xbb10('0x4'));var jayson=require(_0xbb10('0x5'));var amiClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232a});var mailClient=jayson[_0xbb10('0x6')][_0xbb10('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0xbb10('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){var _0x1c3ee5=_0x1b9e94?_0x1b9e94:amiClient;return _0x1c3ee5[_0xbb10('0x8')](_0x3cdd53,_0x513741)[_0xbb10('0x9')](function(_0x229887){if(_0x229887[_0xbb10('0xa')]){if(_0x229887['error']['code']===0x1f4){return _0x21370f(_0x229887[_0xbb10('0xa')][_0xbb10('0xb')]);}return _0x3fb675(_0x229887[_0xbb10('0xa')]['message']);}else{_0x3fb675(_0x229887[_0xbb10('0xc')]);}})['catch'](function(_0x44fb19){_0x21370f(_0x44fb19);});});}function respondWithResult(_0x916a32,_0x285009){_0x285009=_0x285009||0xc8;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0xd')](_0x285009)[_0xbb10('0xe')](_0x193a27);}return _0x916a32['sendStatus'](0x194);};}function handleError(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0x1f4;return function(_0x45b9d6){logger[_0xbb10('0xa')](_0x45b9d6[_0xbb10('0xf')]);if(_0x45b9d6[_0xbb10('0x10')]){delete _0x45b9d6[_0xbb10('0x10')];}_0x26e021[_0xbb10('0xd')](_0x42d7e4)[_0xbb10('0x11')](_0x45b9d6);};}function findById(_0x2b184e){return function(_0x4a2bfc){if(!_[_0xbb10('0x12')](_0x2b184e)&&!_[_0xbb10('0x12')](_0x4a2bfc)&&!_[_0xbb10('0x12')](_0x4a2bfc[_0xbb10('0x13')])){return _[_0xbb10('0x14')](_0x4a2bfc[_0xbb10('0x13')],function(_0x575cca){return _0x575cca['id']==_0x2b184e;});}return null;};}exports[_0xbb10('0x15')]=function(_0xbf2906,_0xe1c665){return respondWithRpcPromise('VoiceChannels',_0xbf2906[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0xe1c665,null))[_0xbb10('0x17')](handleError(_0xe1c665,null));};exports[_0xbb10('0x18')]=function(_0xdf237d,_0x44e563){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xbb10('0x19')](_0xdf237d[_0xbb10('0x16')],_0xdf237d['params']))['then'](respondWithResult(_0x44e563,null))[_0xbb10('0x17')](handleError(_0x44e563,null));};exports[_0xbb10('0x1a')]=function(_0x2e911d,_0x317da4){return respondWithRpcPromise(_0xbb10('0x1b'),_[_0xbb10('0x19')](_0x2e911d[_0xbb10('0x16')],_0x2e911d[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x317da4,null))[_0xbb10('0x17')](handleError(_0x317da4,null));};exports[_0xbb10('0x1d')]=function(_0x26ad93,_0x537898){return respondWithRpcPromise('VoiceQueues',_0x26ad93['query'])[_0xbb10('0x9')](respondWithResult(_0x537898,null))[_0xbb10('0x17')](handleError(_0x537898,null));};exports[_0xbb10('0x1e')]=function(_0x4e25ff,_0x2fdde9){return respondWithRpcPromise(_0xbb10('0x1f'),_0x4e25ff[_0xbb10('0x16')])[_0xbb10('0x9')](findById(_0x4e25ff[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x2fdde9,null))[_0xbb10('0x17')](handleError(_0x2fdde9,null));};exports['updateVoiceQueue']=function(_0x3796c7,_0x21ac54){return respondWithRpcPromise(_0xbb10('0x20'),_[_0xbb10('0x19')](_0x3796c7[_0xbb10('0x21')],_0x3796c7[_0xbb10('0x1c')]))['then'](respondWithResult(_0x21ac54,null))[_0xbb10('0x17')](handleError(_0x21ac54,null));};exports['voiceQueuesPreview']=function(_0x448d5c,_0x56f2da){return respondWithRpcPromise(_0xbb10('0x22'),_[_0xbb10('0x19')](_0x448d5c[_0xbb10('0x16')],_0x448d5c['params']))['then'](respondWithResult(_0x56f2da,null))[_0xbb10('0x17')](handleError(_0x56f2da,null));};exports[_0xbb10('0x23')]=function(_0x4f590d,_0x359ad4){return respondWithRpcPromise(_0xbb10('0x24'),_0x4f590d[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x359ad4,null))[_0xbb10('0x17')](handleError(_0x359ad4,null));};exports[_0xbb10('0x25')]=function(_0xf85197,_0x4975f5){return respondWithRpcPromise(_0xbb10('0x26'),_[_0xbb10('0x19')](_0xf85197[_0xbb10('0x16')],_0xf85197[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4975f5,null))[_0xbb10('0x17')](handleError(_0x4975f5,null));};exports[_0xbb10('0x27')]=function(_0x10202c,_0x3c8d7d){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xbb10('0x19')](_0x10202c[_0xbb10('0x16')],_0x10202c[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x3c8d7d,null))['catch'](handleError(_0x3c8d7d,null));};exports[_0xbb10('0x28')]=function(_0x5de37b,_0x4e2754){return respondWithRpcPromise(_0xbb10('0x29'),_[_0xbb10('0x19')](_0x5de37b[_0xbb10('0x16')],_0x5de37b[_0xbb10('0x1c')]))[_0xbb10('0x9')](respondWithResult(_0x4e2754,null))[_0xbb10('0x17')](handleError(_0x4e2754,null));};exports['outbound']=function(_0x1e5bbd,_0x25d72f){return respondWithRpcPromise('Outbound',_0x1e5bbd['query'])['then'](respondWithResult(_0x25d72f,null))[_0xbb10('0x17')](handleError(_0x25d72f,null));};exports[_0xbb10('0x2a')]=function(_0x2b658a,_0x4d5a9b){return respondWithRpcPromise(_0xbb10('0x2b'),_0x2b658a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4d5a9b,null))['catch'](handleError(_0x4d5a9b,null));};exports[_0xbb10('0x2c')]=function(_0x12238a,_0x1dcd38){var _0x446f49;return respondWithRpcPromise('Agents',_0x12238a[_0xbb10('0x16')])[_0xbb10('0x9')](function(_0x5835fd){_0x446f49=_0x5835fd;return respondWithRpcPromise(_0xbb10('0x2d'),_0x12238a[_0xbb10('0x16')],routingClient);})[_0xbb10('0x9')](function(_0x3a9934){return _[_0xbb10('0x19')]({},_0x3a9934,_0x446f49);})[_0xbb10('0x9')](respondWithResult(_0x1dcd38,null))['catch'](handleError(_0x1dcd38,null));};exports[_0xbb10('0x2e')]=function(_0x1c7fae,_0x3e7b4c){if(_0x1c7fae[_0xbb10('0x21')]&&_0x1c7fae['body'][_0xbb10('0x2f')]&&_0x1c7fae[_0xbb10('0x30')]&&_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]){for(var _0x5e2cfa in _0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')]){if(_0x1c7fae['body']['interaction'][_0xbb10('0x31')](_0x5e2cfa)){db['MemberReport'][_0xbb10('0x32')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')]['name'],'type':_0xbb10('0x33'),'exitAt':null,'uniqueid':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]&&_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0xbb10('0x34')]?{'$notIn':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x2f')][_0x5e2cfa]}:{'$ne':null}}})[_0xbb10('0x9')](function(_0x19f94d){var _0x190781=moment()[_0xbb10('0x35')](_0xbb10('0x36'));for(var _0x43b948=0x0,_0x197871=_0x19f94d[_0xbb10('0x34')];_0x43b948<_0x197871;_0x43b948+=0x1){_0x19f94d[_0x43b948]['updateAttributes']({'exitAt':_0x190781});}});for(var _0x426b95=0x0;_0x426b95<_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0xbb10('0x34')];_0x426b95+=0x1){db[_0xbb10('0x37')][_0xbb10('0x38')]({'where':{'channel':_0x5e2cfa,'membername':_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')],'type':_0xbb10('0x33'),'uniqueid':_0x1c7fae[_0xbb10('0x21')]['interaction'][_0x5e2cfa][_0x426b95],'exitAt':null},'defaults':{'channel':_0x5e2cfa,'membername':_0x1c7fae['user'][_0xbb10('0x10')],'interface':_[_0xbb10('0x12')](_0x1c7fae[_0xbb10('0x30')]['interface'])?util['format'](_0xbb10('0x39'),_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x10')]):_0x1c7fae[_0xbb10('0x30')][_0xbb10('0x3a')],'type':_0xbb10('0x33'),'enterAt':moment()[_0xbb10('0x35')](_0xbb10('0x36')),'role':_0xbb10('0x3b'),'internal':_0x1c7fae[_0xbb10('0x30')]['internal'],'uniqueid':_0x1c7fae['body'][_0xbb10('0x2f')][_0x5e2cfa][_0x426b95]}});}}}}return respondWithRpcPromise(_0xbb10('0x3c'),{'id':_0x1c7fae[_0xbb10('0x1c')]['id'],'capacity':_0x1c7fae[_0xbb10('0x21')][_0xbb10('0x3d')]},routingClient)[_0xbb10('0x9')](respondWithResult(_0x3e7b4c,null))[_0xbb10('0x17')](handleError(_0x3e7b4c,null));};exports[_0xbb10('0x3e')]=function(_0x1c0d8f,_0x1214f7){return respondWithRpcPromise(_0xbb10('0x3f'),_0x1c0d8f[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x1214f7,null))[_0xbb10('0x17')](handleError(_0x1214f7,null));};exports[_0xbb10('0x40')]=function(_0x547a7a,_0x124052){return respondWithRpcPromise('Trunks',_0x547a7a[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x124052,null))[_0xbb10('0x17')](handleError(_0x124052,null));};exports[_0xbb10('0x41')]=function(_0x26e66e,_0x32d8e9){return respondWithRpcPromise(_0xbb10('0x42'),_0x26e66e[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x32d8e9,null))[_0xbb10('0x17')](handleError(_0x32d8e9,null));};exports[_0xbb10('0x43')]=function(_0x1c2dce,_0x1d49e1){return respondWithRpcPromise(_0xbb10('0x44'),_0x1c2dce[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d49e1,null))[_0xbb10('0x17')](handleError(_0x1d49e1,null));};exports[_0xbb10('0x45')]=function(_0x1b83a9,_0x4ce8e7){return respondWithRpcPromise(_0xbb10('0x44'),_0x1b83a9[_0xbb10('0x16')],routingClient)['then'](findById(_0x1b83a9[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x4ce8e7,null))[_0xbb10('0x17')](handleError(_0x4ce8e7,null));};exports[_0xbb10('0x46')]=function(_0x432728,_0x22de7f){return respondWithRpcPromise(_0xbb10('0x47'),_0x432728[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x22de7f,null))[_0xbb10('0x17')](handleError(_0x22de7f,null));};exports[_0xbb10('0x48')]=function(_0x2a1ce1,_0x16932f){return respondWithRpcPromise('MailQueues',_0x2a1ce1['query'],routingClient)[_0xbb10('0x9')](findById(_0x2a1ce1[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x16932f,null))[_0xbb10('0x17')](handleError(_0x16932f,null));};exports['mailAccounts']=function(_0x506498,_0x79411e){return respondWithRpcPromise(_0xbb10('0x49'),_0x506498[_0xbb10('0x16')],mailClient)[_0xbb10('0x9')](respondWithResult(_0x79411e,null))[_0xbb10('0x17')](handleError(_0x79411e,null));};exports[_0xbb10('0x4a')]=function(_0x45c0dc,_0x4a5fb9){return respondWithRpcPromise(_0xbb10('0x4b'),_0x45c0dc[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x4a5fb9,null))['catch'](handleError(_0x4a5fb9,null));};exports['showOpenchannelQueues']=function(_0x32c1e8,_0x31c727){return respondWithRpcPromise(_0xbb10('0x4b'),_0x32c1e8['query'],routingClient)['then'](findById(_0x32c1e8['params']['id']))[_0xbb10('0x9')](respondWithResult(_0x31c727,null))[_0xbb10('0x17')](handleError(_0x31c727,null));};exports[_0xbb10('0x4c')]=function(_0x4e9fbd,_0xa1bbd9){return respondWithRpcPromise(_0xbb10('0x4d'),_0x4e9fbd['query'],routingClient)['then'](respondWithResult(_0xa1bbd9,null))[_0xbb10('0x17')](handleError(_0xa1bbd9,null));};exports[_0xbb10('0x4e')]=function(_0xd77753,_0x237246){return respondWithRpcPromise('SmsQueues',_0xd77753[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](findById(_0xd77753[_0xbb10('0x1c')]['id']))['then'](respondWithResult(_0x237246,null))[_0xbb10('0x17')](handleError(_0x237246,null));};exports[_0xbb10('0x4f')]=function(_0x3e3617,_0x5b2bd4){return respondWithRpcPromise(_0xbb10('0x50'),_0x3e3617[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x5b2bd4,null))[_0xbb10('0x17')](handleError(_0x5b2bd4,null));};exports['showWhatsappQueues']=function(_0x251417,_0x258e55){return respondWithRpcPromise(_0xbb10('0x50'),_0x251417[_0xbb10('0x16')],routingClient)['then'](findById(_0x251417[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x258e55,null))[_0xbb10('0x17')](handleError(_0x258e55,null));};exports[_0xbb10('0x51')]=function(_0x12f750,_0x17807e){return respondWithRpcPromise(_0xbb10('0x52'),_0x12f750['query'],routingClient)['then'](respondWithResult(_0x17807e,null))['catch'](handleError(_0x17807e,null));};exports[_0xbb10('0x53')]=function(_0x9c672d,_0x3eda96){return respondWithRpcPromise('FaxQueues',_0x9c672d['query'],routingClient)[_0xbb10('0x9')](findById(_0x9c672d[_0xbb10('0x1c')]['id']))[_0xbb10('0x9')](respondWithResult(_0x3eda96,null))[_0xbb10('0x17')](handleError(_0x3eda96,null));};exports[_0xbb10('0x54')]=function(_0x1ad2ed,_0x4cf2f3){return respondWithRpcPromise(_0xbb10('0x55'),_0x1ad2ed[_0xbb10('0x16')])[_0xbb10('0x9')](respondWithResult(_0x4cf2f3,null))[_0xbb10('0x17')](handleError(_0x4cf2f3,null));};exports[_0xbb10('0x56')]=function(_0x5bfc68,_0x56094a){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5bfc68[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x56094a,null))[_0xbb10('0x17')](handleError(_0x56094a,null));};exports[_0xbb10('0x57')]=function(_0x2f7d2a,_0x1d40b8){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2f7d2a[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x1d40b8,null))['catch'](handleError(_0x1d40b8,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xdf634f,_0x13040d){return respondWithRpcPromise(_0xbb10('0x58'),_0xdf634f[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x13040d,null))[_0xbb10('0x17')](handleError(_0x13040d,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x576179,_0x165fe9){return respondWithRpcPromise(_0xbb10('0x58'),_0x576179[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](function(_0xfa3c7c){if(_0x576179['query'][_0xbb10('0x59')]!==undefined){var _0x19fcec=_(_0xfa3c7c[_0xbb10('0x13')])[_0xbb10('0x5a')]([_0x576179[_0xbb10('0x16')][_0xbb10('0x59')],_0x576179[_0xbb10('0x1c')]['id']])['map'](_0xbb10('0x5b'))[_0xbb10('0x5c')]()[_0xbb10('0x5d')]();return _0xfa3c7c[_0xbb10('0x13')][_0xbb10('0x5a')](function(_0x172be3){return _0x19fcec[_0xbb10('0x5e')](_0x172be3[_0xbb10('0x5b')])>-0x1;});}else{return _0xfa3c7c['rows'][_0xbb10('0x5a')](function(_0x218690){return _0x218690[_0xbb10('0x5b')]===parseInt(_0x576179['params']['id']);});}})['then'](respondWithResult(_0x165fe9,null))['catch'](handleError(_0x165fe9,null));};exports[_0xbb10('0x5f')]=function(_0x5a3c44,_0x4e3d6a){return respondWithRpcPromise(_0xbb10('0x60'),_0x5a3c44[_0xbb10('0x16')],routingClient)[_0xbb10('0x9')](respondWithResult(_0x4e3d6a,null))[_0xbb10('0x17')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x61')]=function(_0x24dca6,_0x33116){return respondWithRpcPromise(_0xbb10('0x62'),_0x24dca6[_0xbb10('0x16')],routingClient)['then'](respondWithResult(_0x33116,null))[_0xbb10('0x17')](handleError(_0x33116,null));};exports[_0xbb10('0x63')]=function(_0x46b6d2,_0x35b811){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x46b6d2['query'],routingClient)[_0xbb10('0x9')](respondWithResult(_0x35b811,null))[_0xbb10('0x17')](handleError(_0x35b811,null));};exports[_0xbb10('0x64')]=function(_0x32bb25){return function(_0x5ee705,_0x17d596){var _0x275bce,_0x3f0d74;var _0xf7b3e1=_[_0xbb10('0x65')](_0x32bb25);var _0x517185=_0x32bb25==='chat'?_0xbb10('0x66'):_0xbb10('0x67');return db[_0xf7b3e1+_0xbb10('0x68')]['findOne']({'raw':!![],'where':{'id':_0x5ee705[_0xbb10('0x1c')]['id']}})[_0xbb10('0x9')](function(_0x50bcc9){if(_['isNil'](_0x50bcc9)){throw new Error(_0xf7b3e1+_0xbb10('0x69'));}_0x275bce=_0x50bcc9;return db[_0xf7b3e1+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x5ee705['body'][_0xbb10('0x6c')]},'include':[{'model':db[_0xf7b3e1+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xf7b3e1+_0x517185],'as':_0xbb10('0x67')}]});})[_0xbb10('0x9')](function(_0x5de006){if(_[_0xbb10('0x12')](_0x5de006)){throw new Error(_0xf7b3e1+_0xbb10('0x6e'));}_0x3f0d74=_0x5de006;return _0x5de006[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3367d4={'uniqueid':_0x32bb25+'.'+_0x3f0d74['id']+'.'+_0x3f0d74[_0xbb10('0x6d')]['id'],'FromUserId':_0x5ee705[_0xbb10('0x30')]['id'],'type':_0xbb10('0x70')};_0x3367d4[_0xf7b3e1+_0xbb10('0x71')]=_0x3f0d74['id'];_0x3367d4[_0xf7b3e1+_0xbb10('0x72')]=_0x3f0d74[_0xbb10('0x6d')]['id'];_0x3367d4[_0xbb10('0x73')+_0xf7b3e1+_0x517185+'Id']=_0x3f0d74[_0xbb10('0x67')]['id'];_0x3367d4['To'+_0xf7b3e1+_0xbb10('0x74')]=_0x275bce['id'];return db[_0xf7b3e1+_0xbb10('0x75')][_0xbb10('0x76')](_0x3367d4);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x32bb25,'interaction':_0x3f0d74[_0xbb10('0x6d')],'message':_0x3f0d74,'account':_0x3f0d74[_0xbb10('0x67')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x70'),'appdata':_0x275bce[_0xbb10('0x10')]+','+(_0x3f0d74[_0xbb10('0x67')]['queueTransferTimeout']||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x17d596,null))[_0xbb10('0x17')](handleError(_0x17d596,null));};};exports[_0xbb10('0x78')]=function(_0x19694d,_0x379d49){var _0x546db5,_0xb25e71;if(_[_0xbb10('0x12')](_0x19694d['body'][_0xbb10('0x79')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0xc53c87=_0x19694d[_0xbb10('0x21')][_0xbb10('0x79')];var _0xa99bf5=_[_0xbb10('0x65')](_0xc53c87);var _0x556d7b=_0xc53c87===_0xbb10('0x7a')?'Website':_0xbb10('0x67');return db[_0xbb10('0x7b')]['findOne']({'raw':!![],'where':{'id':_0x19694d['params']['id'],'role':_0xbb10('0x3b')}})[_0xbb10('0x9')](function(_0x1b77c2){if(_[_0xbb10('0x12')](_0x1b77c2)){throw new Error(_0xbb10('0x7c'));}_0x546db5=_0x1b77c2;return db[_0xa99bf5+_0xbb10('0x6a')][_0xbb10('0x6b')]({'where':{'id':_0x19694d[_0xbb10('0x21')][_0xbb10('0x6c')]},'include':[{'model':db[_0xa99bf5+_0xbb10('0x6d')],'as':_0xbb10('0x6d')},{'model':db[_0xa99bf5+_0x556d7b],'as':'Account'}]});})[_0xbb10('0x9')](function(_0x3eeceb){if(_[_0xbb10('0x12')](_0x3eeceb)){throw new Error(_0xa99bf5+_0xbb10('0x6e'));}_0xb25e71=_0x3eeceb;return _0x3eeceb[_0xbb10('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbb10('0x9')](function(){var _0xfefa17={'uniqueid':_0xc53c87+'.'+_0xb25e71['id']+'.'+_0xb25e71[_0xbb10('0x6d')]['id'],'FromUserId':_0x19694d[_0xbb10('0x30')]['id'],'type':_0xbb10('0x3b'),'ToUserId':_0x546db5['id']};_0xfefa17[_0xa99bf5+_0xbb10('0x71')]=_0xb25e71['id'];_0xfefa17[_0xa99bf5+_0xbb10('0x72')]=_0xb25e71['Interaction']['id'];_0xfefa17[_0xbb10('0x73')+_0xa99bf5+_0x556d7b+'Id']=_0xb25e71['Account']['id'];return db[_0xa99bf5+_0xbb10('0x75')][_0xbb10('0x76')](_0xfefa17);})[_0xbb10('0x9')](function(){return respondWithRpcPromise(_0xbb10('0x7d'),{'channel':_0xc53c87,'interaction':_0xb25e71[_0xbb10('0x6d')],'message':_0xb25e71,'account':_0xb25e71['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xbb10('0x3b'),'appdata':_0x546db5[_0xbb10('0x10')]+','+(_0xb25e71[_0xbb10('0x67')][_0xbb10('0x7e')]||0x12c),'interval':_0xbb10('0x77')}],'transfer':!![]},routingClient);})[_0xbb10('0x9')](respondWithResult(_0x379d49,null))['catch'](handleError(_0x379d49,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5737c94..0d5c230 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 _0x78b7=['put','/:id','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','show','/:id/run','run','post'];(function(_0x35acf5,_0x4577af){var _0x3ffed3=function(_0x58d47c){while(--_0x58d47c){_0x35acf5['push'](_0x35acf5['shift']());}};_0x3ffed3(++_0x4577af);}(_0x78b7,0x109));var _0x778b=function(_0x298fca,_0x501450){_0x298fca=_0x298fca-0x0;var _0x34ca1c=_0x78b7[_0x298fca];return _0x34ca1c;};'use strict';var multer=require(_0x778b('0x0'));var util=require('util');var path=require(_0x778b('0x1'));var timeout=require(_0x778b('0x2'));var express=require('express');var router=express[_0x778b('0x3')]();var fs_extra=require(_0x778b('0x4'));var auth=require(_0x778b('0x5'));var interaction=require(_0x778b('0x6'));var config=require(_0x778b('0x7'));var controller=require(_0x778b('0x8'));router[_0x778b('0x9')]('/',auth[_0x778b('0xa')](),controller['index']);router[_0x778b('0x9')]('/:id',auth[_0x778b('0xa')](),controller[_0x778b('0xb')]);router[_0x778b('0x9')](_0x778b('0xc'),auth['isAuthenticated'](),controller[_0x778b('0xd')]);router[_0x778b('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x778b('0xf')](_0x778b('0x10'),auth[_0x778b('0xa')](),controller[_0x778b('0x11')]);router[_0x778b('0x12')](_0x778b('0x10'),auth[_0x778b('0xa')](),controller[_0x778b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9c69=['fs-extra','../../components/auth/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','put','destroy','exports','util','path','connect-timeout','Router'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x9c69,0x15c));var _0x99c6=function(_0x56a4f1,_0x40fb30){_0x56a4f1=_0x56a4f1-0x0;var _0x5b65b9=_0x9c69[_0x56a4f1];return _0x5b65b9;};'use strict';var multer=require('multer');var util=require(_0x99c6('0x0'));var path=require(_0x99c6('0x1'));var timeout=require(_0x99c6('0x2'));var express=require('express');var router=express[_0x99c6('0x3')]();var fs_extra=require(_0x99c6('0x4'));var auth=require(_0x99c6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x99c6('0x6'));router[_0x99c6('0x7')]('/',auth[_0x99c6('0x8')](),controller[_0x99c6('0x9')]);router[_0x99c6('0x7')](_0x99c6('0xa'),auth[_0x99c6('0x8')](),controller[_0x99c6('0xb')]);router[_0x99c6('0x7')](_0x99c6('0xc'),auth[_0x99c6('0x8')](),controller['run']);router['post']('/',auth[_0x99c6('0x8')](),controller['create']);router[_0x99c6('0xd')](_0x99c6('0xa'),auth[_0x99c6('0x8')](),controller['update']);router['delete'](_0x99c6('0xa'),auth[_0x99c6('0x8')](),controller[_0x99c6('0xe')]);module[_0x99c6('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0985b0f..832d602 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 _0xf93d=['INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv','pdf','xlsx','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE'];(function(_0x447a2c,_0x3d76e2){var _0x562acc=function(_0x531a12){while(--_0x531a12){_0x447a2c['push'](_0x447a2c['shift']());}};_0x562acc(++_0x3d76e2);}(_0xf93d,0x199));var _0xdf93=function(_0x4ba296,_0x5a5660){_0x4ba296=_0x4ba296-0x0;var _0x2e80ac=_0xf93d[_0x4ba296];return _0x2e80ac;};'use strict';var Sequelize=require(_0xdf93('0x0'));module[_0xdf93('0x1')]={'name':{'type':Sequelize[_0xdf93('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xdf93('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdf93('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xdf93('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xdf93('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdf93('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xdf93('0x6')](_0xdf93('0x7'),_0xdf93('0x8'),_0xdf93('0x9'),_0xdf93('0xa'),_0xdf93('0xb'),_0xdf93('0xc'),'minutes'),'allowNull':![],'defaultValue':_0xdf93('0xb')},'output':{'type':Sequelize[_0xdf93('0x6')](_0xdf93('0xd'),_0xdf93('0xe'),_0xdf93('0xf')),'allowNull':![],'defaultValue':_0xdf93('0xd')},'type':{'type':Sequelize[_0xdf93('0x6')](_0xdf93('0x10'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xdf93('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xdf93('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xdf93('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbffa=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','years','quarters','months','weeks','days','hours','minutes','ENUM','pdf','xlsx','csv'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xbffa,0x143));var _0xabff=function(_0xccc266,_0x15f159){_0xccc266=_0xccc266-0x0;var _0x36bb77=_0xbffa[_0xccc266];return _0x36bb77;};'use strict';var Sequelize=require(_0xabff('0x0'));module[_0xabff('0x1')]={'name':{'type':Sequelize[_0xabff('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xabff('0x2')]},'active':{'type':Sequelize[_0xabff('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xabff('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xabff('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xabff('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xabff('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0xabff('0x6'),_0xabff('0x7'),_0xabff('0x8'),_0xabff('0x9'),_0xabff('0xa'),_0xabff('0xb'),_0xabff('0xc')),'allowNull':![],'defaultValue':_0xabff('0xa')},'output':{'type':Sequelize[_0xabff('0xd')]('csv',_0xabff('0xe'),_0xabff('0xf')),'allowNull':![],'defaultValue':_0xabff('0x10')},'type':{'type':Sequelize[_0xabff('0xd')](_0xabff('0x11'),_0xabff('0x12')),'allowNull':![],'defaultValue':_0xabff('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xabff('0x13')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xabff('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 2b0a2c1..11438a1 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 _0x9e3e=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','update','then','destroy','Scheduler','UserProfileResource','stack','name','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','run','../../config/schedule','eml-format'];(function(_0x14949c,_0x145e20){var _0xef690=function(_0x5b6be4){while(--_0x5b6be4){_0x14949c['push'](_0x14949c['shift']());}};_0xef690(++_0x145e20);}(_0x9e3e,0xe6));var _0xe9e3=function(_0x2089fe,_0x1a95c6){_0x2089fe=_0x2089fe-0x0;var _0x5eb20b=_0x9e3e[_0x2089fe];return _0x5eb20b;};'use strict';var emlformat=require(_0xe9e3('0x0'));var rimraf=require(_0xe9e3('0x1'));var zipdir=require(_0xe9e3('0x2'));var jsonpatch=require(_0xe9e3('0x3'));var rp=require(_0xe9e3('0x4'));var moment=require('moment');var BPromise=require(_0xe9e3('0x5'));var Mustache=require('mustache');var util=require(_0xe9e3('0x6'));var path=require(_0xe9e3('0x7'));var sox=require(_0xe9e3('0x8'));var csv=require(_0xe9e3('0x9'));var ejs=require(_0xe9e3('0xa'));var fs=require('fs');var fs_extra=require(_0xe9e3('0xb'));var _=require(_0xe9e3('0xc'));var squel=require(_0xe9e3('0xd'));var crypto=require(_0xe9e3('0xe'));var jsforce=require(_0xe9e3('0xf'));var deskjs=require(_0xe9e3('0x10'));var toCsv=require(_0xe9e3('0x9'));var querystring=require(_0xe9e3('0x11'));var Papa=require('papaparse');var Redis=require(_0xe9e3('0x12'));var authService=require(_0xe9e3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9e3('0x14'));var utils=require('../../config/utils');var config=require(_0xe9e3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9e3('0x16'))['db'];function respondWithStatusCode(_0x40a53a,_0x3c72e7){_0x3c72e7=_0x3c72e7||0xcc;return function(_0x14dbc7){if(_0x14dbc7){return _0x40a53a[_0xe9e3('0x17')](_0x3c72e7);}return _0x40a53a['status'](_0x3c72e7)[_0xe9e3('0x18')]();};}function respondWithResult(_0x2e3503,_0x124125){_0x124125=_0x124125||0xc8;return function(_0x26a0fd){if(_0x26a0fd){return _0x2e3503[_0xe9e3('0x19')](_0x124125)[_0xe9e3('0x1a')](_0x26a0fd);}};}function respondWithFilteredResult(_0x3581f4,_0x2bd2f2){return function(_0x4c28c6){if(_0x4c28c6){var _0x136c2f=typeof _0x2bd2f2[_0xe9e3('0x1b')]===_0xe9e3('0x1c')&&typeof _0x2bd2f2[_0xe9e3('0x1d')]===_0xe9e3('0x1c');var _0x23c147=_0x4c28c6[_0xe9e3('0x1e')];var _0x119e96=_0x136c2f?0x0:_0x2bd2f2[_0xe9e3('0x1b')];var _0x1cf872=_0x136c2f?_0x4c28c6[_0xe9e3('0x1e')]:_0x2bd2f2[_0xe9e3('0x1b')]+_0x2bd2f2['limit'];var _0x213ce3;if(_0x1cf872>=_0x23c147){_0x1cf872=_0x23c147;_0x213ce3=0xc8;}else{_0x213ce3=0xce;}_0x3581f4[_0xe9e3('0x19')](_0x213ce3);return _0x3581f4['set']('Content-Range',_0x119e96+'-'+_0x1cf872+'/'+_0x23c147)['json'](_0x4c28c6);}return null;};}function patchUpdates(_0x14bd0b){return function(_0x1a5edc){try{jsonpatch[_0xe9e3('0x1f')](_0x1a5edc,_0x14bd0b,!![]);}catch(_0x474e43){return BPromise['reject'](_0x474e43);}return _0x1a5edc['save']();};}function saveUpdates(_0x209e8d,_0x371de7){return function(_0x1ebe70){if(_0x1ebe70){return _0x1ebe70[_0xe9e3('0x20')](_0x209e8d)[_0xe9e3('0x21')](function(_0x172784){return _0x172784;});}return null;};}function removeEntity(_0x248daa,_0x542176){return function(_0x136fab){if(_0x136fab){return _0x136fab[_0xe9e3('0x22')]()[_0xe9e3('0x21')](function(){var _0x10783d=_0x136fab['get']({'plain':!![]});var _0x3012e=_0xe9e3('0x23');return db[_0xe9e3('0x24')][_0xe9e3('0x22')]({'where':{'type':_0x3012e,'resourceId':_0x10783d['id']}})[_0xe9e3('0x21')](function(){return _0x136fab;});})[_0xe9e3('0x21')](function(){_0x248daa[_0xe9e3('0x19')](0xcc)[_0xe9e3('0x18')]();});}};}function handleEntityNotFound(_0x3f7488,_0x4fd494){return function(_0x2ce38d){if(!_0x2ce38d){_0x3f7488['sendStatus'](0x194);}return _0x2ce38d;};}function handleError(_0x1f09b7,_0x107e19){_0x107e19=_0x107e19||0x1f4;return function(_0x47f90c){logger['error'](_0x47f90c[_0xe9e3('0x25')]);if(_0x47f90c['name']){delete _0x47f90c[_0xe9e3('0x26')];}_0x1f09b7[_0xe9e3('0x19')](_0x107e19)['send'](_0x47f90c);};}exports[_0xe9e3('0x27')]=function(_0x4130c5,_0x2c55fe){var _0x4446df={},_0x3e7e34={},_0x48af4e={'count':0x0,'rows':[]};var _0x4cefef=_[_0xe9e3('0x28')](db[_0xe9e3('0x29')][_0xe9e3('0x2a')],function(_0x589095){return{'name':_0x589095[_0xe9e3('0x2b')],'type':_0x589095[_0xe9e3('0x2c')][_0xe9e3('0x2d')]};});_0x3e7e34[_0xe9e3('0x2e')]=_[_0xe9e3('0x28')](_0x4cefef,_0xe9e3('0x26'));_0x3e7e34[_0xe9e3('0x2f')]=_[_0xe9e3('0x30')](_0x4130c5[_0xe9e3('0x2f')]);_0x3e7e34['filters']=_[_0xe9e3('0x31')](_0x3e7e34[_0xe9e3('0x2e')],_0x3e7e34['query']);_0x4446df[_0xe9e3('0x32')]=_[_0xe9e3('0x31')](_0x3e7e34[_0xe9e3('0x2e')],qs[_0xe9e3('0x33')](_0x4130c5['query'][_0xe9e3('0x33')]));_0x4446df[_0xe9e3('0x32')]=_0x4446df[_0xe9e3('0x32')]['length']?_0x4446df[_0xe9e3('0x32')]:_0x3e7e34[_0xe9e3('0x2e')];if(!_0x4130c5[_0xe9e3('0x2f')][_0xe9e3('0x34')]('nolimit')){_0x4446df[_0xe9e3('0x1d')]=qs[_0xe9e3('0x1d')](_0x4130c5['query'][_0xe9e3('0x1d')]);_0x4446df[_0xe9e3('0x1b')]=qs['offset'](_0x4130c5[_0xe9e3('0x2f')][_0xe9e3('0x1b')]);}_0x4446df['order']=qs[_0xe9e3('0x35')](_0x4130c5[_0xe9e3('0x2f')]['sort']);_0x4446df[_0xe9e3('0x36')]=qs[_0xe9e3('0x37')](_['pick'](_0x4130c5[_0xe9e3('0x2f')],_0x3e7e34[_0xe9e3('0x37')]),_0x4cefef);if(_0x4130c5[_0xe9e3('0x2f')][_0xe9e3('0x38')]){_0x4446df[_0xe9e3('0x36')]=_[_0xe9e3('0x39')](_0x4446df[_0xe9e3('0x36')],{'$or':_[_0xe9e3('0x28')](_0x4cefef,function(_0x4ba126){if(_0x4ba126['type']!==_0xe9e3('0x3a')){var _0x2bce37={};_0x2bce37[_0x4ba126[_0xe9e3('0x26')]]={'$like':'%'+_0x4130c5[_0xe9e3('0x2f')][_0xe9e3('0x38')]+'%'};return _0x2bce37;}})});}_0x4446df=_[_0xe9e3('0x39')]({},_0x4446df,_0x4130c5[_0xe9e3('0x3b')]);var _0x1175bc={'where':_0x4446df[_0xe9e3('0x36')]};return db[_0xe9e3('0x29')][_0xe9e3('0x1e')](_0x1175bc)['then'](function(_0x171e1b){_0x48af4e[_0xe9e3('0x1e')]=_0x171e1b;if(_0x4130c5[_0xe9e3('0x2f')]['includeAll']){_0x4446df[_0xe9e3('0x3c')]=[{'all':!![]}];}return db[_0xe9e3('0x29')][_0xe9e3('0x3d')](_0x4446df);})[_0xe9e3('0x21')](function(_0x503d3e){_0x48af4e['rows']=_0x503d3e;return _0x48af4e;})['then'](respondWithFilteredResult(_0x2c55fe,_0x4446df))[_0xe9e3('0x3e')](handleError(_0x2c55fe,null));};exports[_0xe9e3('0x3f')]=function(_0x19bd4c,_0x23418b){var _0xb1e141={'raw':![],'where':{'id':_0x19bd4c[_0xe9e3('0x40')]['id']}},_0x258f24={};_0x258f24[_0xe9e3('0x2e')]=_[_0xe9e3('0x30')](db[_0xe9e3('0x29')][_0xe9e3('0x2a')]);_0x258f24[_0xe9e3('0x2f')]=_['keys'](_0x19bd4c[_0xe9e3('0x2f')]);_0x258f24['filters']=_[_0xe9e3('0x31')](_0x258f24[_0xe9e3('0x2e')],_0x258f24[_0xe9e3('0x2f')]);_0xb1e141['attributes']=_[_0xe9e3('0x31')](_0x258f24[_0xe9e3('0x2e')],qs[_0xe9e3('0x33')](_0x19bd4c[_0xe9e3('0x2f')][_0xe9e3('0x33')]));_0xb1e141[_0xe9e3('0x32')]=_0xb1e141[_0xe9e3('0x32')][_0xe9e3('0x41')]?_0xb1e141[_0xe9e3('0x32')]:_0x258f24['model'];if(_0x19bd4c[_0xe9e3('0x2f')][_0xe9e3('0x42')]){_0xb1e141[_0xe9e3('0x3c')]=[{'all':!![]}];}_0xb1e141=_[_0xe9e3('0x39')]({},_0xb1e141,_0x19bd4c[_0xe9e3('0x3b')]);return db[_0xe9e3('0x29')][_0xe9e3('0x43')](_0xb1e141)[_0xe9e3('0x21')](handleEntityNotFound(_0x23418b,null))[_0xe9e3('0x21')](respondWithResult(_0x23418b,null))[_0xe9e3('0x3e')](handleError(_0x23418b,null));};exports['create']=function(_0x1bc1c9,_0x24bdfe){return db['Schedule'][_0xe9e3('0x44')](_0x1bc1c9[_0xe9e3('0x45')],{})['then'](function(_0x4acffd){var _0x7dcebb=_0x1bc1c9[_0xe9e3('0x46')][_0xe9e3('0x47')]({'plain':!![]});if(!_0x7dcebb)throw new Error(_0xe9e3('0x48'));if(_0x7dcebb['role']===_0xe9e3('0x46')){var _0x1acd16=_0x4acffd[_0xe9e3('0x47')]({'plain':!![]});var _0x275383='Scheduler';return db['UserProfileSection'][_0xe9e3('0x43')]({'where':{'name':_0x275383,'userProfileId':_0x7dcebb['userProfileId']},'raw':!![]})[_0xe9e3('0x21')](function(_0x3475d5){if(_0x3475d5&&_0x3475d5[_0xe9e3('0x49')]===0x0){return db[_0xe9e3('0x24')][_0xe9e3('0x44')]({'name':_0x1acd16['name'],'resourceId':_0x1acd16['id'],'type':_0x3475d5['name'],'sectionId':_0x3475d5['id']},{})['then'](function(){return _0x4acffd;});}else{return _0x4acffd;}})[_0xe9e3('0x3e')](function(_0x5d819a){logger[_0xe9e3('0x4a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d819a);throw _0x5d819a;});}return _0x4acffd;})[_0xe9e3('0x21')](respondWithResult(_0x24bdfe,0xc9))['catch'](handleError(_0x24bdfe,null));};exports[_0xe9e3('0x20')]=function(_0x129379,_0x32370c){if(_0x129379[_0xe9e3('0x45')]['id']){delete _0x129379['body']['id'];}return db['Schedule'][_0xe9e3('0x43')]({'where':{'id':_0x129379['params']['id']}})['then'](handleEntityNotFound(_0x32370c,null))[_0xe9e3('0x21')](saveUpdates(_0x129379[_0xe9e3('0x45')],null))[_0xe9e3('0x21')](respondWithResult(_0x32370c,null))[_0xe9e3('0x3e')](handleError(_0x32370c,null));};exports[_0xe9e3('0x22')]=function(_0xfb6913,_0x3f44e5){return db[_0xe9e3('0x29')][_0xe9e3('0x43')]({'where':{'id':_0xfb6913['params']['id']}})[_0xe9e3('0x21')](handleEntityNotFound(_0x3f44e5,null))[_0xe9e3('0x21')](removeEntity(_0x3f44e5,null))[_0xe9e3('0x3e')](handleError(_0x3f44e5,null));};exports[_0xe9e3('0x4b')]=function(_0x1ab2da,_0x1678fe,_0x567ad8){var _0x3c9dab=require(_0xe9e3('0x4c'));return db['Schedule'][_0xe9e3('0x43')]({'where':{'id':_0x1ab2da[_0xe9e3('0x40')]['id']},'raw':!![]})[_0xe9e3('0x21')](handleEntityNotFound(_0x1678fe,null))[_0xe9e3('0x21')](function(){_0x3c9dab['run'](_0x1ab2da[_0xe9e3('0x40')]['id']);})['then'](respondWithStatusCode(_0x1678fe,null))[_0xe9e3('0x3e')](handleError(_0x1678fe,null));}; \ No newline at end of file +var _0xd706=['model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','params','run','../../config/schedule','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x3226a0,_0x3ed7ae){var _0x22dae6=function(_0xdb3fca){while(--_0xdb3fca){_0x3226a0['push'](_0x3226a0['shift']());}};_0x22dae6(++_0x3ed7ae);}(_0xd706,0x173));var _0x6d70=function(_0xbdcab8,_0x30e065){_0xbdcab8=_0xbdcab8-0x0;var _0x3c897d=_0xd706[_0xbdcab8];return _0x3c897d;};'use strict';var emlformat=require(_0x6d70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6d70('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d70('0x2'));var moment=require('moment');var BPromise=require(_0x6d70('0x3'));var Mustache=require(_0x6d70('0x4'));var util=require(_0x6d70('0x5'));var path=require(_0x6d70('0x6'));var sox=require(_0x6d70('0x7'));var csv=require(_0x6d70('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d70('0x9'));var _=require(_0x6d70('0xa'));var squel=require(_0x6d70('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d70('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d70('0x8'));var querystring=require(_0x6d70('0xd'));var Papa=require(_0x6d70('0xe'));var Redis=require(_0x6d70('0xf'));var authService=require(_0x6d70('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6d70('0x11'));var hardwareService=require(_0x6d70('0x12'));var logger=require(_0x6d70('0x13'))(_0x6d70('0x14'));var utils=require('../../config/utils');var config=require(_0x6d70('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d70('0x16'))['db'];function respondWithStatusCode(_0x31ea46,_0x37110f){_0x37110f=_0x37110f||0xcc;return function(_0x3f800a){if(_0x3f800a){return _0x31ea46['sendStatus'](_0x37110f);}return _0x31ea46[_0x6d70('0x17')](_0x37110f)[_0x6d70('0x18')]();};}function respondWithResult(_0x1e762b,_0x44d096){_0x44d096=_0x44d096||0xc8;return function(_0xfab84c){if(_0xfab84c){return _0x1e762b[_0x6d70('0x17')](_0x44d096)[_0x6d70('0x19')](_0xfab84c);}};}function respondWithFilteredResult(_0x29b407,_0x32653c){return function(_0x40e7a4){if(_0x40e7a4){var _0x1ffecc=typeof _0x32653c[_0x6d70('0x1a')]===_0x6d70('0x1b')&&typeof _0x32653c[_0x6d70('0x1c')]==='undefined';var _0x1b613f=_0x40e7a4[_0x6d70('0x1d')];var _0x511f31=_0x1ffecc?0x0:_0x32653c[_0x6d70('0x1a')];var _0xe2a18b=_0x1ffecc?_0x40e7a4[_0x6d70('0x1d')]:_0x32653c[_0x6d70('0x1a')]+_0x32653c[_0x6d70('0x1c')];var _0x173618;if(_0xe2a18b>=_0x1b613f){_0xe2a18b=_0x1b613f;_0x173618=0xc8;}else{_0x173618=0xce;}_0x29b407['status'](_0x173618);return _0x29b407['set']('Content-Range',_0x511f31+'-'+_0xe2a18b+'/'+_0x1b613f)['json'](_0x40e7a4);}return null;};}function patchUpdates(_0xc8e061){return function(_0x22c263){try{jsonpatch[_0x6d70('0x1e')](_0x22c263,_0xc8e061,!![]);}catch(_0x50df00){return BPromise[_0x6d70('0x1f')](_0x50df00);}return _0x22c263[_0x6d70('0x20')]();};}function saveUpdates(_0x2aff9c,_0x1c721d){return function(_0x46f17a){if(_0x46f17a){return _0x46f17a[_0x6d70('0x21')](_0x2aff9c)[_0x6d70('0x22')](function(_0x20c191){return _0x20c191;});}return null;};}function removeEntity(_0x14dba3,_0x135b7e){return function(_0x591a45){if(_0x591a45){return _0x591a45[_0x6d70('0x23')]()[_0x6d70('0x22')](function(){var _0x535234=_0x591a45[_0x6d70('0x24')]({'plain':!![]});var _0x4c9b8b=_0x6d70('0x25');return db[_0x6d70('0x26')][_0x6d70('0x23')]({'where':{'type':_0x4c9b8b,'resourceId':_0x535234['id']}})[_0x6d70('0x22')](function(){return _0x591a45;});})[_0x6d70('0x22')](function(){_0x14dba3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11583b,_0x198613){return function(_0x2a00a1){if(!_0x2a00a1){_0x11583b['sendStatus'](0x194);}return _0x2a00a1;};}function handleError(_0x48c9a6,_0x348a09){_0x348a09=_0x348a09||0x1f4;return function(_0x367c46){logger[_0x6d70('0x27')](_0x367c46[_0x6d70('0x28')]);if(_0x367c46[_0x6d70('0x29')]){delete _0x367c46[_0x6d70('0x29')];}_0x48c9a6['status'](_0x348a09)[_0x6d70('0x2a')](_0x367c46);};}exports[_0x6d70('0x2b')]=function(_0x344ccc,_0x379e90){var _0x5129f6={},_0x5cb219={},_0x18a6d1={'count':0x0,'rows':[]};var _0x1785e8=_[_0x6d70('0x2c')](db[_0x6d70('0x2d')][_0x6d70('0x2e')],function(_0x3a876e){return{'name':_0x3a876e[_0x6d70('0x2f')],'type':_0x3a876e[_0x6d70('0x30')][_0x6d70('0x31')]};});_0x5cb219['model']=_[_0x6d70('0x2c')](_0x1785e8,_0x6d70('0x29'));_0x5cb219[_0x6d70('0x32')]=_[_0x6d70('0x33')](_0x344ccc[_0x6d70('0x32')]);_0x5cb219[_0x6d70('0x34')]=_[_0x6d70('0x35')](_0x5cb219[_0x6d70('0x36')],_0x5cb219['query']);_0x5129f6[_0x6d70('0x37')]=_[_0x6d70('0x35')](_0x5cb219['model'],qs['fields'](_0x344ccc[_0x6d70('0x32')][_0x6d70('0x38')]));_0x5129f6['attributes']=_0x5129f6[_0x6d70('0x37')]['length']?_0x5129f6['attributes']:_0x5cb219['model'];if(!_0x344ccc[_0x6d70('0x32')][_0x6d70('0x39')](_0x6d70('0x3a'))){_0x5129f6[_0x6d70('0x1c')]=qs['limit'](_0x344ccc[_0x6d70('0x32')][_0x6d70('0x1c')]);_0x5129f6['offset']=qs['offset'](_0x344ccc[_0x6d70('0x32')][_0x6d70('0x1a')]);}_0x5129f6[_0x6d70('0x3b')]=qs['sort'](_0x344ccc['query'][_0x6d70('0x3c')]);_0x5129f6[_0x6d70('0x3d')]=qs['filters'](_[_0x6d70('0x3e')](_0x344ccc[_0x6d70('0x32')],_0x5cb219[_0x6d70('0x34')]),_0x1785e8);if(_0x344ccc['query'][_0x6d70('0x3f')]){_0x5129f6[_0x6d70('0x3d')]=_['merge'](_0x5129f6[_0x6d70('0x3d')],{'$or':_[_0x6d70('0x2c')](_0x1785e8,function(_0x32c6c7){if(_0x32c6c7['type']!==_0x6d70('0x40')){var _0x4e27e1={};_0x4e27e1[_0x32c6c7[_0x6d70('0x29')]]={'$like':'%'+_0x344ccc[_0x6d70('0x32')]['filter']+'%'};return _0x4e27e1;}})});}_0x5129f6=_[_0x6d70('0x41')]({},_0x5129f6,_0x344ccc[_0x6d70('0x42')]);var _0xd47244={'where':_0x5129f6[_0x6d70('0x3d')]};return db[_0x6d70('0x2d')][_0x6d70('0x1d')](_0xd47244)[_0x6d70('0x22')](function(_0x18976a){_0x18a6d1[_0x6d70('0x1d')]=_0x18976a;if(_0x344ccc[_0x6d70('0x32')][_0x6d70('0x43')]){_0x5129f6[_0x6d70('0x44')]=[{'all':!![]}];}return db[_0x6d70('0x2d')]['findAll'](_0x5129f6);})[_0x6d70('0x22')](function(_0x17a080){_0x18a6d1[_0x6d70('0x45')]=_0x17a080;return _0x18a6d1;})[_0x6d70('0x22')](respondWithFilteredResult(_0x379e90,_0x5129f6))['catch'](handleError(_0x379e90,null));};exports[_0x6d70('0x46')]=function(_0x299e60,_0x3357ea){var _0xf204d0={'raw':![],'where':{'id':_0x299e60['params']['id']}},_0x38ce8b={};_0x38ce8b[_0x6d70('0x36')]=_[_0x6d70('0x33')](db['Schedule']['rawAttributes']);_0x38ce8b['query']=_[_0x6d70('0x33')](_0x299e60[_0x6d70('0x32')]);_0x38ce8b[_0x6d70('0x34')]=_['intersection'](_0x38ce8b['model'],_0x38ce8b[_0x6d70('0x32')]);_0xf204d0['attributes']=_[_0x6d70('0x35')](_0x38ce8b[_0x6d70('0x36')],qs[_0x6d70('0x38')](_0x299e60[_0x6d70('0x32')][_0x6d70('0x38')]));_0xf204d0[_0x6d70('0x37')]=_0xf204d0[_0x6d70('0x37')][_0x6d70('0x47')]?_0xf204d0['attributes']:_0x38ce8b[_0x6d70('0x36')];if(_0x299e60[_0x6d70('0x32')][_0x6d70('0x43')]){_0xf204d0[_0x6d70('0x44')]=[{'all':!![]}];}_0xf204d0=_[_0x6d70('0x41')]({},_0xf204d0,_0x299e60[_0x6d70('0x42')]);return db[_0x6d70('0x2d')][_0x6d70('0x48')](_0xf204d0)['then'](handleEntityNotFound(_0x3357ea,null))[_0x6d70('0x22')](respondWithResult(_0x3357ea,null))['catch'](handleError(_0x3357ea,null));};exports[_0x6d70('0x49')]=function(_0xa280ad,_0x470c42){return db['Schedule']['create'](_0xa280ad[_0x6d70('0x4a')],{})['then'](function(_0x19cb50){var _0x499973=_0xa280ad[_0x6d70('0x4b')][_0x6d70('0x24')]({'plain':!![]});if(!_0x499973)throw new Error(_0x6d70('0x4c'));if(_0x499973[_0x6d70('0x4d')]==='user'){var _0x3d1048=_0x19cb50['get']({'plain':!![]});var _0x324b9d=_0x6d70('0x25');return db[_0x6d70('0x4e')][_0x6d70('0x48')]({'where':{'name':_0x324b9d,'userProfileId':_0x499973[_0x6d70('0x4f')]},'raw':!![]})[_0x6d70('0x22')](function(_0x5c04a3){if(_0x5c04a3&&_0x5c04a3[_0x6d70('0x50')]===0x0){return db['UserProfileResource'][_0x6d70('0x49')]({'name':_0x3d1048['name'],'resourceId':_0x3d1048['id'],'type':_0x5c04a3[_0x6d70('0x29')],'sectionId':_0x5c04a3['id']},{})[_0x6d70('0x22')](function(){return _0x19cb50;});}else{return _0x19cb50;}})[_0x6d70('0x51')](function(_0x3e99cf){logger[_0x6d70('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e99cf);throw _0x3e99cf;});}return _0x19cb50;})[_0x6d70('0x22')](respondWithResult(_0x470c42,0xc9))[_0x6d70('0x51')](handleError(_0x470c42,null));};exports[_0x6d70('0x21')]=function(_0x5b3bd9,_0x54f8d9){if(_0x5b3bd9[_0x6d70('0x4a')]['id']){delete _0x5b3bd9[_0x6d70('0x4a')]['id'];}return db[_0x6d70('0x2d')][_0x6d70('0x48')]({'where':{'id':_0x5b3bd9[_0x6d70('0x52')]['id']}})[_0x6d70('0x22')](handleEntityNotFound(_0x54f8d9,null))[_0x6d70('0x22')](saveUpdates(_0x5b3bd9[_0x6d70('0x4a')],null))['then'](respondWithResult(_0x54f8d9,null))['catch'](handleError(_0x54f8d9,null));};exports[_0x6d70('0x23')]=function(_0x589c74,_0xc7a47a){return db[_0x6d70('0x2d')]['find']({'where':{'id':_0x589c74['params']['id']}})['then'](handleEntityNotFound(_0xc7a47a,null))[_0x6d70('0x22')](removeEntity(_0xc7a47a,null))[_0x6d70('0x51')](handleError(_0xc7a47a,null));};exports[_0x6d70('0x53')]=function(_0x1cea03,_0x5a6452,_0x14d799){var _0x318e6e=require(_0x6d70('0x54'));return db['Schedule'][_0x6d70('0x48')]({'where':{'id':_0x1cea03['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5a6452,null))['then'](function(){_0x318e6e[_0x6d70('0x53')](_0x1cea03[_0x6d70('0x52')]['id']);})[_0x6d70('0x22')](respondWithStatusCode(_0x5a6452,null))[_0x6d70('0x51')](handleError(_0x5a6452,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index baced06..fe1d7b9 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 _0x64ea=['rimraf','../../config/environment','./schedule.attributes','exports','Schedule','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4c63fe,_0x14aca7){var _0x27a280=function(_0x75ba8a){while(--_0x75ba8a){_0x4c63fe['push'](_0x4c63fe['shift']());}};_0x27a280(++_0x14aca7);}(_0x64ea,0x12e));var _0xa64e=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x64ea[_0x454165];return _0x56db53;};'use strict';var _=require(_0xa64e('0x0'));var util=require('util');var logger=require(_0xa64e('0x1'))(_0xa64e('0x2'));var moment=require(_0xa64e('0x3'));var BPromise=require(_0xa64e('0x4'));var rp=require(_0xa64e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa64e('0x6'));var config=require(_0xa64e('0x7'));var attributes=require(_0xa64e('0x8'));module[_0xa64e('0x9')]=function(_0x24b044,_0x2540b1){return _0x24b044['define'](_0xa64e('0xa'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92aa=['bluebird','path','rimraf','./schedule.attributes','exports','define','tools_schedules','lodash','util','api','moment'];(function(_0x13cab2,_0x148058){var _0x292c90=function(_0x495f78){while(--_0x495f78){_0x13cab2['push'](_0x13cab2['shift']());}};_0x292c90(++_0x148058);}(_0x92aa,0x10f));var _0xa92a=function(_0x445ae8,_0x1c550b){_0x445ae8=_0x445ae8-0x0;var _0x1cd428=_0x92aa[_0x445ae8];return _0x1cd428;};'use strict';var _=require(_0xa92a('0x0'));var util=require(_0xa92a('0x1'));var logger=require('../../config/logger')(_0xa92a('0x2'));var moment=require(_0xa92a('0x3'));var BPromise=require(_0xa92a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa92a('0x5'));var rimraf=require(_0xa92a('0x6'));var config=require('../../config/environment');var attributes=require(_0xa92a('0x7'));module[_0xa92a('0x8')]=function(_0x5c9cc1,_0x5fc060){return _0x5c9cc1[_0xa92a('0x9')]('Schedule',attributes,{'tableName':_0xa92a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index e10c0de..6138c55 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 _0x1c2e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Schedule,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','util','bluebird','ioredis','../../mysqldb'];(function(_0x399584,_0x86b788){var _0x1d68fa=function(_0x1717ab){while(--_0x1717ab){_0x399584['push'](_0x399584['shift']());}};_0x1d68fa(++_0x86b788);}(_0x1c2e,0x68));var _0xe1c2=function(_0x5667fb,_0x3d050a){_0x5667fb=_0x5667fb-0x0;var _0x97f71f=_0x1c2e[_0x5667fb];return _0x97f71f;};'use strict';var _=require('lodash');var util=require(_0xe1c2('0x0'));var moment=require('moment');var BPromise=require(_0xe1c2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe1c2('0x2'));var db=require(_0xe1c2('0x3'))['db'];var utils=require(_0xe1c2('0x4'));var logger=require(_0xe1c2('0x5'))(_0xe1c2('0x6'));var config=require(_0xe1c2('0x7'));var jayson=require(_0xe1c2('0x8'));var client=jayson['client'][_0xe1c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x357c35,_0x293616,_0x37e3a4){return new BPromise(function(_0x3dde53,_0x1947dc){return client['request'](_0x357c35,_0x37e3a4)['then'](function(_0x3dcdca){logger[_0xe1c2('0xa')](_0xe1c2('0xb'),_0x293616,'request\x20sent');logger[_0xe1c2('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x293616,_0xe1c2('0xd'),JSON[_0xe1c2('0xe')](_0x3dcdca));if(_0x3dcdca['error']){if(_0x3dcdca[_0xe1c2('0xf')]['code']===0x1f4){logger[_0xe1c2('0xf')](_0xe1c2('0xb'),_0x293616,_0x3dcdca[_0xe1c2('0xf')][_0xe1c2('0x10')]);return _0x1947dc(_0x3dcdca[_0xe1c2('0xf')][_0xe1c2('0x10')]);}logger[_0xe1c2('0xf')](_0xe1c2('0xb'),_0x293616,_0x3dcdca[_0xe1c2('0xf')]['message']);return _0x3dde53(_0x3dcdca['error'][_0xe1c2('0x10')]);}else{logger[_0xe1c2('0xa')](_0xe1c2('0xb'),_0x293616,_0xe1c2('0xd'));_0x3dde53(_0x3dcdca['result']['message']);}})[_0xe1c2('0x11')](function(_0x2c8454){logger[_0xe1c2('0xf')](_0xe1c2('0xb'),_0x293616,_0x2c8454);_0x1947dc(_0x2c8454);});});} \ No newline at end of file +var _0x0164=['Schedule,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3c6ced,_0x36ec79){var _0x4fdd06=function(_0x14157b){while(--_0x14157b){_0x3c6ced['push'](_0x3c6ced['shift']());}};_0x4fdd06(++_0x36ec79);}(_0x0164,0xb6));var _0x4016=function(_0xb725be,_0x45bd01){_0xb725be=_0xb725be-0x0;var _0x2f2424=_0x0164[_0xb725be];return _0x2f2424;};'use strict';var _=require(_0x4016('0x0'));var util=require(_0x4016('0x1'));var moment=require(_0x4016('0x2'));var BPromise=require(_0x4016('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4016('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4016('0x5'));var logger=require('../../config/logger')(_0x4016('0x6'));var config=require(_0x4016('0x7'));var jayson=require(_0x4016('0x8'));var client=jayson['client'][_0x4016('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcfb407,_0x108c20,_0x4c0d66){return new BPromise(function(_0x28a62f,_0xbccc97){return client[_0x4016('0xa')](_0xcfb407,_0x4c0d66)['then'](function(_0x726628){logger[_0x4016('0xb')]('Schedule,\x20%s,\x20%s',_0x108c20,_0x4016('0xc'));logger[_0x4016('0xd')](_0x4016('0xe'),_0x108c20,'request\x20sent',JSON[_0x4016('0xf')](_0x726628));if(_0x726628['error']){if(_0x726628[_0x4016('0x10')][_0x4016('0x11')]===0x1f4){logger[_0x4016('0x10')](_0x4016('0x12'),_0x108c20,_0x726628['error'][_0x4016('0x13')]);return _0xbccc97(_0x726628['error'][_0x4016('0x13')]);}logger[_0x4016('0x10')](_0x4016('0x12'),_0x108c20,_0x726628['error'][_0x4016('0x13')]);return _0x28a62f(_0x726628['error'][_0x4016('0x13')]);}else{logger[_0x4016('0xb')]('Schedule,\x20%s,\x20%s',_0x108c20,_0x4016('0xc'));_0x28a62f(_0x726628['result'][_0x4016('0x13')]);}})['catch'](function(_0x4842d2){logger['error'](_0x4016('0x12'),_0x108c20,_0x4842d2);_0xbccc97(_0x4842d2);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 4da2aca..5b6491d 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 _0x79d2=['update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','post','create','put'];(function(_0x22d743,_0x5f25f6){var _0x564278=function(_0x4adb6b){while(--_0x4adb6b){_0x22d743['push'](_0x22d743['shift']());}};_0x564278(++_0x5f25f6);}(_0x79d2,0xd6));var _0x279d=function(_0x240c03,_0x132524){_0x240c03=_0x240c03-0x0;var _0x455f30=_0x79d2[_0x240c03];return _0x455f30;};'use strict';var multer=require('multer');var util=require(_0x279d('0x0'));var path=require(_0x279d('0x1'));var timeout=require('connect-timeout');var express=require(_0x279d('0x2'));var router=express['Router']();var fs_extra=require(_0x279d('0x3'));var auth=require(_0x279d('0x4'));var interaction=require(_0x279d('0x5'));var config=require(_0x279d('0x6'));var controller=require(_0x279d('0x7'));router[_0x279d('0x8')]('/',auth[_0x279d('0x9')](),controller[_0x279d('0xa')]);router[_0x279d('0x8')]('/describe',auth[_0x279d('0x9')](),controller[_0x279d('0xb')]);router[_0x279d('0x8')](_0x279d('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x279d('0xd'),auth[_0x279d('0x9')](),controller['download']);router[_0x279d('0xe')]('/',auth[_0x279d('0x9')](),controller[_0x279d('0xf')]);router[_0x279d('0x10')](_0x279d('0xc'),auth[_0x279d('0x9')](),controller[_0x279d('0x11')]);router[_0x279d('0x12')](_0x279d('0xc'),auth[_0x279d('0x9')](),controller[_0x279d('0x13')]);module[_0x279d('0x14')]=router; \ No newline at end of file +var _0x2b80=['/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put'];(function(_0x4dbba7,_0x34d6d1){var _0x43ef83=function(_0x27acf1){while(--_0x27acf1){_0x4dbba7['push'](_0x4dbba7['shift']());}};_0x43ef83(++_0x34d6d1);}(_0x2b80,0x1a6));var _0x02b8=function(_0x470252,_0x457603){_0x470252=_0x470252-0x0;var _0xeec8b4=_0x2b80[_0x470252];return _0xeec8b4;};'use strict';var multer=require(_0x02b8('0x0'));var util=require('util');var path=require(_0x02b8('0x1'));var timeout=require(_0x02b8('0x2'));var express=require(_0x02b8('0x3'));var router=express[_0x02b8('0x4')]();var fs_extra=require(_0x02b8('0x5'));var auth=require(_0x02b8('0x6'));var interaction=require(_0x02b8('0x7'));var config=require(_0x02b8('0x8'));var controller=require('./screenRecording.controller');router[_0x02b8('0x9')]('/',auth[_0x02b8('0xa')](),controller[_0x02b8('0xb')]);router[_0x02b8('0x9')](_0x02b8('0xc'),auth['isAuthenticated'](),controller[_0x02b8('0xd')]);router[_0x02b8('0x9')]('/:id',auth[_0x02b8('0xa')](),controller[_0x02b8('0xe')]);router['get']('/:id/download',auth[_0x02b8('0xa')](),controller['download']);router[_0x02b8('0xf')]('/',auth['isAuthenticated'](),controller[_0x02b8('0x10')]);router[_0x02b8('0x11')](_0x02b8('0x12'),auth[_0x02b8('0xa')](),controller[_0x02b8('0x13')]);router['delete'](_0x02b8('0x12'),auth[_0x02b8('0xa')](),controller[_0x02b8('0x14')]);module[_0x02b8('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 12e0c18..c1cb8ac 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 _0xcb9c=['moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize'];(function(_0x408cd3,_0x4c5e74){var _0x51563e=function(_0x38dbb1){while(--_0x38dbb1){_0x408cd3['push'](_0x408cd3['shift']());}};_0x51563e(++_0x4c5e74);}(_0xcb9c,0x110));var _0xccb9=function(_0x41f60f,_0x1aa53b){_0x41f60f=_0x41f60f-0x0;var _0xb27e59=_0xcb9c[_0x41f60f];return _0xb27e59;};'use strict';var Sequelize=require(_0xccb9('0x0'));var moment=require(_0xccb9('0x1'));var path=require(_0xccb9('0x2'));var config=require(_0xccb9('0x3'));module[_0xccb9('0x4')]={'format':{'type':Sequelize[_0xccb9('0x5')],'get':function(){return this[_0xccb9('0x6')](_0xccb9('0x7'))?path['extname'](this[_0xccb9('0x6')](_0xccb9('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xccb9('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xccb9('0x8')],'set':function(_0x114fa3){var _0x1d807e=_0x114fa3['replace'](/\\/g,'/');this[_0xccb9('0x9')](_0xccb9('0x7'),_0x1d807e);}},'rating':{'type':Sequelize[_0xccb9('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xccb9('0xa')],'set':function(_0x47889f){this[_0xccb9('0x9')](_0xccb9('0xb'),moment()[_0xccb9('0xc')](_0x47889f,'ms'));this[_0xccb9('0x9')](_0xccb9('0xd'),moment());this['setDataValue'](_0xccb9('0xe'),_0x47889f);}},'startedAt':{'type':Sequelize[_0xccb9('0xf')],'get':function(){return moment(this[_0xccb9('0x6')]('startedAt'))[_0xccb9('0x10')](_0xccb9('0x11'))[_0xccb9('0x12')]();}},'closedAt':{'type':Sequelize[_0xccb9('0xf')],'get':function(){return moment(this['getDataValue'](_0xccb9('0xd')))[_0xccb9('0x10')](_0xccb9('0x11'))[_0xccb9('0x12')]();}},'createdAt':{'type':Sequelize[_0xccb9('0xf')],'get':function(){return moment(this[_0xccb9('0x6')](_0xccb9('0x13')))[_0xccb9('0x10')](_0xccb9('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xccb9('0xf')],'get':function(){return moment(this[_0xccb9('0x6')](_0xccb9('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0xccb9('0x12')]();}}}; \ No newline at end of file +var _0xd5f9=['extname','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','../../config/environment','VIRTUAL','getDataValue','value'];(function(_0x5f044e,_0x14d25b){var _0x457607=function(_0x3f7b42){while(--_0x3f7b42){_0x5f044e['push'](_0x5f044e['shift']());}};_0x457607(++_0x14d25b);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x5545f7,_0x570414){_0x5545f7=_0x5545f7-0x0;var _0x52a979=_0xd5f9[_0x5545f7];return _0x52a979;};'use strict';var Sequelize=require(_0x9d5f('0x0'));var moment=require(_0x9d5f('0x1'));var path=require(_0x9d5f('0x2'));var config=require(_0x9d5f('0x3'));module['exports']={'format':{'type':Sequelize[_0x9d5f('0x4')],'get':function(){return this[_0x9d5f('0x5')](_0x9d5f('0x6'))?path[_0x9d5f('0x7')](this[_0x9d5f('0x5')](_0x9d5f('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x1dca4b){var _0x2e1c4e=_0x1dca4b['replace'](/\\/g,'/');this[_0x9d5f('0x8')](_0x9d5f('0x6'),_0x2e1c4e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x9d5f('0x9')],'set':function(_0x241166){this['setDataValue'](_0x9d5f('0xa'),moment()['subtract'](_0x241166,'ms'));this[_0x9d5f('0x8')](_0x9d5f('0xb'),moment());this[_0x9d5f('0x8')](_0x9d5f('0xc'),_0x241166);}},'startedAt':{'type':Sequelize[_0x9d5f('0xd')],'get':function(){return moment(this['getDataValue'](_0x9d5f('0xa')))[_0x9d5f('0xe')](_0x9d5f('0xf'))[_0x9d5f('0x10')]();}},'closedAt':{'type':Sequelize[_0x9d5f('0xd')],'get':function(){return moment(this[_0x9d5f('0x5')](_0x9d5f('0xb')))[_0x9d5f('0xe')](_0x9d5f('0xf'))['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x9d5f('0xe')](_0x9d5f('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x9d5f('0xd')],'get':function(){return moment(this[_0x9d5f('0x5')](_0x9d5f('0x11')))[_0x9d5f('0xe')](_0x9d5f('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6c81fc1..1e5fafd 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 _0xb138=['format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','merge','options','findAll','rows','catch','params','keys','includeAll','include','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model'];(function(_0x575d37,_0x48033b){var _0x8046bd=function(_0x6039a8){while(--_0x6039a8){_0x575d37['push'](_0x575d37['shift']());}};_0x8046bd(++_0x48033b);}(_0xb138,0x1dd));var _0x8b13=function(_0x2d4e5d,_0x1e790c){_0x2d4e5d=_0x2d4e5d-0x0;var _0x4f5eec=_0xb138[_0x2d4e5d];return _0x4f5eec;};'use strict';var emlformat=require(_0x8b13('0x0'));var rimraf=require(_0x8b13('0x1'));var zipdir=require(_0x8b13('0x2'));var jsonpatch=require(_0x8b13('0x3'));var rp=require(_0x8b13('0x4'));var moment=require(_0x8b13('0x5'));var BPromise=require(_0x8b13('0x6'));var Mustache=require('mustache');var util=require(_0x8b13('0x7'));var path=require(_0x8b13('0x8'));var sox=require(_0x8b13('0x9'));var csv=require('to-csv');var ejs=require(_0x8b13('0xa'));var fs=require('fs');var fs_extra=require(_0x8b13('0xb'));var _=require('lodash');var squel=require(_0x8b13('0xc'));var crypto=require(_0x8b13('0xd'));var jsforce=require(_0x8b13('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b13('0xf'));var querystring=require(_0x8b13('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b13('0x11'));var qs=require(_0x8b13('0x12'));var as=require(_0x8b13('0x13'));var hardwareService=require(_0x8b13('0x14'));var logger=require(_0x8b13('0x15'))('api');var utils=require(_0x8b13('0x16'));var config=require(_0x8b13('0x17'));var licenseUtil=require(_0x8b13('0x18'));var db=require(_0x8b13('0x19'))['db'];function respondWithStatusCode(_0xb227e0,_0x1893b1){_0x1893b1=_0x1893b1||0xcc;return function(_0x58f97e){if(_0x58f97e){return _0xb227e0['sendStatus'](_0x1893b1);}return _0xb227e0[_0x8b13('0x1a')](_0x1893b1)[_0x8b13('0x1b')]();};}function respondWithResult(_0x5f12b5,_0x51a935){_0x51a935=_0x51a935||0xc8;return function(_0x479773){if(_0x479773){return _0x5f12b5[_0x8b13('0x1a')](_0x51a935)[_0x8b13('0x1c')](_0x479773);}};}function respondWithFilteredResult(_0xf29086,_0x2c615a){return function(_0x13f956){if(_0x13f956){var _0x542357=typeof _0x2c615a[_0x8b13('0x1d')]===_0x8b13('0x1e')&&typeof _0x2c615a[_0x8b13('0x1f')]===_0x8b13('0x1e');var _0x3eed21=_0x13f956[_0x8b13('0x20')];var _0x10fbde=_0x542357?0x0:_0x2c615a[_0x8b13('0x1d')];var _0x4989d3=_0x542357?_0x13f956['count']:_0x2c615a[_0x8b13('0x1d')]+_0x2c615a[_0x8b13('0x1f')];var _0x14a8ac;if(_0x4989d3>=_0x3eed21){_0x4989d3=_0x3eed21;_0x14a8ac=0xc8;}else{_0x14a8ac=0xce;}_0xf29086[_0x8b13('0x1a')](_0x14a8ac);return _0xf29086[_0x8b13('0x21')](_0x8b13('0x22'),_0x10fbde+'-'+_0x4989d3+'/'+_0x3eed21)['json'](_0x13f956);}return null;};}function patchUpdates(_0x1e8a48){return function(_0x3c4d4f){try{jsonpatch[_0x8b13('0x23')](_0x3c4d4f,_0x1e8a48,!![]);}catch(_0x54a309){return BPromise['reject'](_0x54a309);}return _0x3c4d4f[_0x8b13('0x24')]();};}function saveUpdates(_0xcb7621,_0x4f9902){return function(_0x3187ed){if(_0x3187ed){return _0x3187ed[_0x8b13('0x25')](_0xcb7621)[_0x8b13('0x26')](function(_0x213280){return _0x213280;});}return null;};}function removeEntity(_0xc05d5c,_0x583639){return function(_0x339271){if(_0x339271){return _0x339271[_0x8b13('0x27')]()['then'](function(){_0xc05d5c[_0x8b13('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x420772,_0x325d68){return function(_0x54786a){if(!_0x54786a){_0x420772[_0x8b13('0x28')](0x194);}return _0x54786a;};}function handleError(_0x3223d8,_0x4f8e58){_0x4f8e58=_0x4f8e58||0x1f4;return function(_0x134c5e){logger[_0x8b13('0x29')](_0x134c5e[_0x8b13('0x2a')]);if(_0x134c5e[_0x8b13('0x2b')]){delete _0x134c5e[_0x8b13('0x2b')];}_0x3223d8['status'](_0x4f8e58)[_0x8b13('0x2c')](_0x134c5e);};}exports[_0x8b13('0x2d')]=function(_0x3475d8,_0x1511bf){var _0x114b01={},_0x2bb51d={},_0x5ab161={'count':0x0,'rows':[]};var _0x35fdca=_[_0x8b13('0x2e')](db[_0x8b13('0x2f')][_0x8b13('0x30')],function(_0x23fde7){return{'name':_0x23fde7[_0x8b13('0x31')],'type':_0x23fde7[_0x8b13('0x32')][_0x8b13('0x33')]};});_0x2bb51d[_0x8b13('0x34')]=_['differenceBy'](_[_0x8b13('0x2e')](_0x35fdca,_0x8b13('0x2b')),[_0x8b13('0x35')]);_0x2bb51d[_0x8b13('0x36')]=_['keys'](_0x3475d8['query']);_0x2bb51d[_0x8b13('0x37')]=_['intersection'](_0x2bb51d['model'],_0x2bb51d[_0x8b13('0x36')]);_0x114b01['attributes']=_[_0x8b13('0x38')](_0x2bb51d[_0x8b13('0x34')],qs[_0x8b13('0x39')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x39')]));_0x114b01[_0x8b13('0x3a')]=_0x114b01[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x114b01[_0x8b13('0x3a')]:_0x2bb51d[_0x8b13('0x34')];if(!_0x3475d8['query'][_0x8b13('0x3c')](_0x8b13('0x3d'))){_0x114b01[_0x8b13('0x1f')]=qs[_0x8b13('0x1f')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x1f')]);_0x114b01[_0x8b13('0x1d')]=qs[_0x8b13('0x1d')](_0x3475d8['query'][_0x8b13('0x1d')]);}_0x114b01['order']=qs[_0x8b13('0x3e')](_0x3475d8[_0x8b13('0x36')][_0x8b13('0x3e')]);_0x114b01[_0x8b13('0x3f')]=qs[_0x8b13('0x37')](_[_0x8b13('0x40')](_0x3475d8['query'],_0x2bb51d['filters']),_0x35fdca);if(_0x3475d8[_0x8b13('0x36')]['filter']){_0x114b01[_0x8b13('0x3f')]=_['merge'](_0x114b01[_0x8b13('0x3f')],{'$or':_[_0x8b13('0x2e')](_0x35fdca,function(_0x29a359){if(_0x29a359[_0x8b13('0x32')]!==_0x8b13('0x41')){var _0x4e16e7={};_0x4e16e7[_0x29a359['name']]={'$like':'%'+_0x3475d8[_0x8b13('0x36')]['filter']+'%'};return _0x4e16e7;}})});}_0x114b01=_[_0x8b13('0x42')]({},_0x114b01,_0x3475d8[_0x8b13('0x43')]);var _0x4dc268={'where':_0x114b01[_0x8b13('0x3f')]};return db[_0x8b13('0x2f')][_0x8b13('0x20')](_0x4dc268)[_0x8b13('0x26')](function(_0x2f4e7f){_0x5ab161[_0x8b13('0x20')]=_0x2f4e7f;if(_0x3475d8[_0x8b13('0x36')]['includeAll']){_0x114b01['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x8b13('0x44')](_0x114b01);})[_0x8b13('0x26')](function(_0x27cfe5){_0x5ab161[_0x8b13('0x45')]=_0x27cfe5;return _0x5ab161;})[_0x8b13('0x26')](respondWithFilteredResult(_0x1511bf,_0x114b01))[_0x8b13('0x46')](handleError(_0x1511bf,null));};exports['show']=function(_0x4342db,_0x50e535){var _0x13d0ef={'raw':![],'where':{'id':_0x4342db[_0x8b13('0x47')]['id']}},_0x5ce9c8={};_0x5ce9c8[_0x8b13('0x34')]=_[_0x8b13('0x48')](db[_0x8b13('0x2f')][_0x8b13('0x30')]);_0x5ce9c8[_0x8b13('0x36')]=_[_0x8b13('0x48')](_0x4342db['query']);_0x5ce9c8['filters']=_['intersection'](_0x5ce9c8[_0x8b13('0x34')],_0x5ce9c8[_0x8b13('0x36')]);_0x13d0ef[_0x8b13('0x3a')]=_[_0x8b13('0x38')](_0x5ce9c8['model'],qs['fields'](_0x4342db[_0x8b13('0x36')]['fields']));_0x13d0ef[_0x8b13('0x3a')]=_0x13d0ef[_0x8b13('0x3a')][_0x8b13('0x3b')]?_0x13d0ef[_0x8b13('0x3a')]:_0x5ce9c8[_0x8b13('0x34')];if(_0x4342db['query'][_0x8b13('0x49')]){_0x13d0ef[_0x8b13('0x4a')]=[{'all':!![]}];}_0x13d0ef=_[_0x8b13('0x42')]({},_0x13d0ef,_0x4342db[_0x8b13('0x43')]);return db[_0x8b13('0x2f')][_0x8b13('0x4b')](_0x13d0ef)[_0x8b13('0x26')](handleEntityNotFound(_0x50e535,null))[_0x8b13('0x26')](respondWithResult(_0x50e535,null))[_0x8b13('0x46')](handleError(_0x50e535,null));};exports['create']=function(_0x46d096,_0x59d863){return db[_0x8b13('0x2f')][_0x8b13('0x4c')](_0x46d096[_0x8b13('0x4d')],{})['then'](respondWithResult(_0x59d863,0xc9))[_0x8b13('0x46')](handleError(_0x59d863,null));};exports[_0x8b13('0x25')]=function(_0x257107,_0x4129c0){if(_0x257107[_0x8b13('0x4d')]['id']){delete _0x257107[_0x8b13('0x4d')]['id'];}delete _0x257107[_0x8b13('0x4d')]['duration'];delete _0x257107[_0x8b13('0x4d')]['createdAt'];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4e')];delete _0x257107[_0x8b13('0x4d')][_0x8b13('0x4f')];return db[_0x8b13('0x2f')][_0x8b13('0x4b')]({'where':{'id':_0x257107[_0x8b13('0x47')]['id']}})[_0x8b13('0x26')](handleEntityNotFound(_0x4129c0,null))[_0x8b13('0x26')](saveUpdates(_0x257107[_0x8b13('0x4d')],null))[_0x8b13('0x26')](respondWithResult(_0x4129c0,null))[_0x8b13('0x46')](handleError(_0x4129c0,null));};exports[_0x8b13('0x50')]=function(_0x2bdfae,_0x42c29d){return db[_0x8b13('0x2f')][_0x8b13('0x50')]()['then'](respondWithResult(_0x42c29d,null))[_0x8b13('0x46')](handleError(_0x42c29d,null));};exports[_0x8b13('0x51')]=function(_0x4c19f6,_0x342fff,_0x328373){var _0x2fc00c=require(_0x8b13('0x52'));var _0x25cb45=![];var _0x12549b={};if(_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]&&_0x4c19f6[_0x8b13('0x36')][_0x8b13('0x32')]===_0x8b13('0x53')){_0x12549b[_0x8b13('0x53')]=_0x4c19f6[_0x8b13('0x47')]['id'];}else{_0x12549b['id']=_0x4c19f6[_0x8b13('0x47')]['id'];}return db[_0x8b13('0x2f')]['find']({'where':_0x12549b,'attributes':['id',_0x8b13('0x4f')],'raw':!![]})[_0x8b13('0x26')](handleEntityNotFound(_0x342fff,null))['then'](function(_0x11e8af){if(_0x11e8af){var _0x73aba5=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x11e8af['value']);var _0x1fd105=util[_0x8b13('0x35')](_0x8b13('0x57'),_0x73aba5);if(fs['existsSync'](_0x1fd105)){_0x25cb45=!![];return _0x2fc00c[_0x8b13('0x58')](_0x1fd105,_0x73aba5,config[_0x8b13('0x59')]['recording'])[_0x8b13('0x26')](function(){return _0x11e8af;});}return _0x11e8af;}})[_0x8b13('0x26')](function(_0x475c8d){if(_0x475c8d){var _0xd29067=path['join'](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x475c8d['value']);if(!fs[_0x8b13('0x5a')](_0xd29067)){throw new db[(_0x8b13('0x5b'))][(_0x8b13('0x5c'))](_0x8b13('0x5d'));}if(_0x475c8d['filename']){return _0x342fff[_0x8b13('0x51')](_0xd29067,_0x475c8d[_0x8b13('0x5e')]+path[_0x8b13('0x5f')](_0xd29067),function(){if(_0x25cb45){fs[_0x8b13('0x60')](_0xd29067);}});}else{return _0x342fff[_0x8b13('0x51')](_0xd29067,function(_0x2fff4e){if(_0x25cb45){fs['unlink'](_0xd29067);}});}}})[_0x8b13('0x46')](function(_0x1082d9){if(_0x1082d9[_0x8b13('0x61')]==='ScreenRecording\x20not\x20found'){_0x342fff[_0x8b13('0x1a')](0x194)[_0x8b13('0x2c')](_0x8b13('0x62'));}else{return handleError(_0x342fff,null);}});};exports[_0x8b13('0x27')]=function(_0x4d8f23,_0x59a6b3){return db['ScreenRecording']['find']({'where':{'id':_0x4d8f23['params']['id']}})[_0x8b13('0x26')](function(_0x1bc936){if(_['isNil'](_0x1bc936)){throw new ReferenceError(_0x8b13('0x63'));}return _0x1bc936;})['then'](function(_0x274bad){var _0x2d2fa3=path[_0x8b13('0x54')](config[_0x8b13('0x55')],_0x8b13('0x56'),_0x274bad[_0x8b13('0x4f')]);logger[_0x8b13('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x2d2fa3);if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger[_0x8b13('0x64')](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}_0x2d2fa3=_0x2d2fa3+_0x8b13('0x69');if(!_[_0x8b13('0x65')](_0x274bad['value'])&&fs[_0x8b13('0x5a')](_0x2d2fa3)){logger['info'](_0x8b13('0x66')+_0x2d2fa3+_0x8b13('0x67'));fs[_0x8b13('0x68')](_0x2d2fa3);}return _0x274bad;})[_0x8b13('0x26')](function(_0x177a64){if(!_0x177a64)throw new InternalError();return _0x177a64['destroy']();})['then'](function(){_0x59a6b3[_0x8b13('0x1a')](0xcc)[_0x8b13('0x1b')]();})['catch'](handleError(_0x59a6b3,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(_0x49ebd8,_0x52d0f){var _0x2c85a2=function(_0x5c969f){while(--_0x5c969f){_0x49ebd8['push'](_0x49ebd8['shift']());}};_0x2c85a2(++_0x52d0f);}(_0x207c,0x1e8));var _0xc207=function(_0x1d2195,_0x4b8096){_0x1d2195=_0x1d2195-0x0;var _0x4962cd=_0x207c[_0x1d2195];return _0x4962cd;};'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 f40a22b..aef9c4b 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 _0x30aa=['../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x539318,_0x153875){var _0x170288=function(_0x454437){while(--_0x454437){_0x539318['push'](_0x539318['shift']());}};_0x170288(++_0x153875);}(_0x30aa,0x96));var _0xa30a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x30aa[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0xa30a('0x0'));var logger=require('../../config/logger')(_0xa30a('0x1'));var moment=require(_0xa30a('0x2'));var BPromise=require(_0xa30a('0x3'));var rp=require(_0xa30a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa30a('0x5'));var config=require(_0xa30a('0x6'));var attributes=require(_0xa30a('0x7'));module[_0xa30a('0x8')]=function(_0x7d245c,_0x1ee45a){return _0x7d245c[_0xa30a('0x9')](_0xa30a('0xa'),attributes,{'tableName':_0xa30a('0xb'),'paranoid':![],'indexes':[{'name':_0xa30a('0xc'),'fields':[_0xa30a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33ef=['moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x33ef,0xc1));var _0xf33e=function(_0x16e224,_0x2776cc){_0x16e224=_0x16e224-0x0;var _0x1c75b1=_0x33ef[_0x16e224];return _0x1c75b1;};'use strict';var _=require(_0xf33e('0x0'));var util=require(_0xf33e('0x1'));var logger=require('../../config/logger')(_0xf33e('0x2'));var moment=require(_0xf33e('0x3'));var BPromise=require(_0xf33e('0x4'));var rp=require(_0xf33e('0x5'));var fs=require('fs');var path=require(_0xf33e('0x6'));var rimraf=require('rimraf');var config=require(_0xf33e('0x7'));var attributes=require(_0xf33e('0x8'));module[_0xf33e('0x9')]=function(_0xfd78fb,_0x28192f){return _0xfd78fb[_0xf33e('0xa')](_0xf33e('0xb'),attributes,{'tableName':_0xf33e('0xc'),'paranoid':![],'indexes':[{'name':_0xf33e('0xd'),'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 6275399..f8675ed 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 _0xc383=['ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','ScreenRecording,\x20%s,\x20%s','debug'];(function(_0x482764,_0x4e0b5e){var _0x5b4bba=function(_0x39f5dc){while(--_0x39f5dc){_0x482764['push'](_0x482764['shift']());}};_0x5b4bba(++_0x4e0b5e);}(_0xc383,0xd8));var _0x3c38=function(_0x2d6375,_0x149216){_0x2d6375=_0x2d6375-0x0;var _0x29186f=_0xc383[_0x2d6375];return _0x29186f;};'use strict';var _=require(_0x3c38('0x0'));var util=require(_0x3c38('0x1'));var moment=require(_0x3c38('0x2'));var BPromise=require(_0x3c38('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c38('0x4'))['db'];var utils=require(_0x3c38('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c38('0x6'));var jayson=require(_0x3c38('0x7'));var client=jayson['client'][_0x3c38('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dfb94,_0x4396e2,_0x35b633){return new BPromise(function(_0x119257,_0x186165){return client['request'](_0x2dfb94,_0x35b633)[_0x3c38('0x9')](function(_0xe2be3a){logger['info'](_0x3c38('0xa'),_0x4396e2,'request\x20sent');logger[_0x3c38('0xb')](_0x3c38('0xc'),_0x4396e2,_0x3c38('0xd'),JSON[_0x3c38('0xe')](_0xe2be3a));if(_0xe2be3a[_0x3c38('0xf')]){if(_0xe2be3a[_0x3c38('0xf')][_0x3c38('0x10')]===0x1f4){logger['error'](_0x3c38('0xa'),_0x4396e2,_0xe2be3a[_0x3c38('0xf')][_0x3c38('0x11')]);return _0x186165(_0xe2be3a[_0x3c38('0xf')][_0x3c38('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x4396e2,_0xe2be3a[_0x3c38('0xf')][_0x3c38('0x11')]);return _0x119257(_0xe2be3a[_0x3c38('0xf')][_0x3c38('0x11')]);}else{logger['info'](_0x3c38('0xa'),_0x4396e2,_0x3c38('0xd'));_0x119257(_0xe2be3a['result'][_0x3c38('0x11')]);}})[_0x3c38('0x12')](function(_0x23e70d){logger[_0x3c38('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x4396e2,_0x23e70d);_0x186165(_0x23e70d);});});} \ No newline at end of file +var _0x5882=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x15fe6b,_0x2b47dc){var _0x2b6c58=function(_0x26f321){while(--_0x26f321){_0x15fe6b['push'](_0x15fe6b['shift']());}};_0x2b6c58(++_0x2b47dc);}(_0x5882,0x103));var _0x2588=function(_0x341366,_0x9deb50){_0x341366=_0x341366-0x0;var _0x4037fa=_0x5882[_0x341366];return _0x4037fa;};'use strict';var _=require(_0x2588('0x0'));var util=require('util');var moment=require(_0x2588('0x1'));var BPromise=require(_0x2588('0x2'));var rs=require(_0x2588('0x3'));var fs=require('fs');var Redis=require(_0x2588('0x4'));var db=require(_0x2588('0x5'))['db'];var utils=require(_0x2588('0x6'));var logger=require(_0x2588('0x7'))(_0x2588('0x8'));var config=require(_0x2588('0x9'));var jayson=require(_0x2588('0xa'));var client=jayson[_0x2588('0xb')][_0x2588('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc53558,_0xd2d810,_0x171a6b){return new BPromise(function(_0x4e57d4,_0x299a37){return client[_0x2588('0xd')](_0xc53558,_0x171a6b)['then'](function(_0x4b06de){logger[_0x2588('0xe')](_0x2588('0xf'),_0xd2d810,_0x2588('0x10'));logger[_0x2588('0x11')](_0x2588('0x12'),_0xd2d810,'request\x20sent',JSON[_0x2588('0x13')](_0x4b06de));if(_0x4b06de[_0x2588('0x14')]){if(_0x4b06de[_0x2588('0x14')]['code']===0x1f4){logger[_0x2588('0x14')](_0x2588('0xf'),_0xd2d810,_0x4b06de[_0x2588('0x14')][_0x2588('0x15')]);return _0x299a37(_0x4b06de[_0x2588('0x14')][_0x2588('0x15')]);}logger['error'](_0x2588('0xf'),_0xd2d810,_0x4b06de[_0x2588('0x14')][_0x2588('0x15')]);return _0x4e57d4(_0x4b06de[_0x2588('0x14')][_0x2588('0x15')]);}else{logger[_0x2588('0xe')]('ScreenRecording,\x20%s,\x20%s',_0xd2d810,_0x2588('0x10'));_0x4e57d4(_0x4b06de['result'][_0x2588('0x15')]);}})[_0x2588('0x16')](function(_0x2403c0){logger[_0x2588('0x14')](_0x2588('0xf'),_0xd2d810,_0x2403c0);_0x299a37(_0x2403c0);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3c1c120..cd88818 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 _0x7aba=['/:id/preferred','addPreferred','favicon','put','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','logologin','single','addLogoLogin','preferred'];(function(_0x123f7f,_0x4e52bf){var _0x303d60=function(_0x385d2b){while(--_0x385d2b){_0x123f7f['push'](_0x123f7f['shift']());}};_0x303d60(++_0x4e52bf);}(_0x7aba,0x19b));var _0xa7ab=function(_0x396d08,_0xb9b783){_0x396d08=_0x396d08-0x0;var _0xbb28dc=_0x7aba[_0x396d08];return _0xbb28dc;};'use strict';var multer=require(_0xa7ab('0x0'));var util=require(_0xa7ab('0x1'));var path=require(_0xa7ab('0x2'));var timeout=require(_0xa7ab('0x3'));var express=require(_0xa7ab('0x4'));var router=express[_0xa7ab('0x5')]();var fs_extra=require(_0xa7ab('0x6'));var auth=require(_0xa7ab('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa7ab('0x8'));var controller=require('./setting.controller');router[_0xa7ab('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa7ab('0xa'),controller[_0xa7ab('0xb')]);router[_0xa7ab('0x9')](_0xa7ab('0xc'),controller[_0xa7ab('0xd')]);router[_0xa7ab('0x9')](_0xa7ab('0xe'),controller[_0xa7ab('0xf')]);router['get'](_0xa7ab('0x10'),controller[_0xa7ab('0x11')]);router[_0xa7ab('0x9')](_0xa7ab('0x12'),controller[_0xa7ab('0x13')]);router[_0xa7ab('0x9')]('/:id/preferred',controller[_0xa7ab('0x14')]);router[_0xa7ab('0x9')](_0xa7ab('0x15'),controller[_0xa7ab('0x16')]);var upload=multer({'storage':multer[_0xa7ab('0x17')]({'destination':function(_0x52dffa,_0xced766,_0x19dfc4){_0x19dfc4(null,path[_0xa7ab('0x18')](config[_0xa7ab('0x19')],_0xa7ab('0x1a')));},'filename':function(_0x317c26,_0x3b6d87,_0x1a5b8c){_0x1a5b8c(null,util[_0xa7ab('0x1b')](_0xa7ab('0x1c'),_0xa7ab('0x1d'),path[_0xa7ab('0x1e')](_0x3b6d87[_0xa7ab('0x1f')])));}})});router[_0xa7ab('0x20')](_0xa7ab('0xe'),upload['single'](_0xa7ab('0x21')),controller[_0xa7ab('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x170d31,_0xc5cbc8,_0x124deb){_0x124deb(null,path[_0xa7ab('0x18')](config[_0xa7ab('0x19')],_0xa7ab('0x1a')));},'filename':function(_0x4e4db8,_0x30bc64,_0x23e986){_0x23e986(null,util[_0xa7ab('0x1b')](_0xa7ab('0x1c'),_0xa7ab('0x23'),path[_0xa7ab('0x1e')](_0x30bc64['originalname'])));}})});router[_0xa7ab('0x20')]('/:id/logo_login',upload[_0xa7ab('0x24')]('file'),controller[_0xa7ab('0x25')]);var upload=multer({'storage':multer[_0xa7ab('0x17')]({'destination':function(_0x1dfa43,_0x4c738f,_0x9929b3){_0x9929b3(null,path[_0xa7ab('0x18')](config[_0xa7ab('0x19')],'server/files/images/logos/'));},'filename':function(_0x5a71e0,_0x185ba7,_0x1813a1){_0x1813a1(null,util[_0xa7ab('0x1b')](_0xa7ab('0x1c'),_0xa7ab('0x26'),path[_0xa7ab('0x1e')](_0x185ba7['originalname'])));}})});router[_0xa7ab('0x20')](_0xa7ab('0x27'),upload[_0xa7ab('0x24')](_0xa7ab('0x21')),controller[_0xa7ab('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a93d4,_0x28804f,_0x575829){_0x575829(null,path[_0xa7ab('0x18')](config['root'],_0xa7ab('0x1a')));},'filename':function(_0x2aa025,_0x3761f6,_0x4cd679){_0x4cd679(null,util['format'](_0xa7ab('0x1c'),_0xa7ab('0x29'),path['extname'](_0x3761f6['originalname'])));}})});router[_0xa7ab('0x20')](_0xa7ab('0x15'),upload[_0xa7ab('0x24')](_0xa7ab('0x21')),controller['addFavicon']);router[_0xa7ab('0x2a')](_0xa7ab('0xc'),auth[_0xa7ab('0x2b')](),controller['update']);module[_0xa7ab('0x2c')]=router; \ No newline at end of file +var _0x84a5=['/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','%s%s','preferred','addPreferred','favicon','put','update','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x102a91,_0x4fa93e){var _0xfcc98c=function(_0x35ea36){while(--_0x35ea36){_0x102a91['push'](_0x102a91['shift']());}};_0xfcc98c(++_0x4fa93e);}(_0x84a5,0x90));var _0x584a=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x84a5[_0x4b7895];return _0x264180;};'use strict';var multer=require('multer');var util=require(_0x584a('0x0'));var path=require(_0x584a('0x1'));var timeout=require(_0x584a('0x2'));var express=require('express');var router=express[_0x584a('0x3')]();var fs_extra=require(_0x584a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x584a('0x5'));var config=require(_0x584a('0x6'));var controller=require(_0x584a('0x7'));router[_0x584a('0x8')]('/',auth[_0x584a('0x9')](),controller[_0x584a('0xa')]);router[_0x584a('0x8')](_0x584a('0xb'),controller[_0x584a('0xc')]);router[_0x584a('0x8')](_0x584a('0xd'),controller[_0x584a('0xe')]);router[_0x584a('0x8')](_0x584a('0xf'),controller['getLogo']);router[_0x584a('0x8')](_0x584a('0x10'),controller['getLogoLogin']);router['get'](_0x584a('0x11'),controller[_0x584a('0x12')]);router[_0x584a('0x8')](_0x584a('0x13'),controller['getPreferred']);router[_0x584a('0x8')](_0x584a('0x14'),controller[_0x584a('0x15')]);var upload=multer({'storage':multer[_0x584a('0x16')]({'destination':function(_0x3b93ce,_0x3dc222,_0xf92e6a){_0xf92e6a(null,path[_0x584a('0x17')](config[_0x584a('0x18')],_0x584a('0x19')));},'filename':function(_0x59c856,_0x69d6c3,_0x41103e){_0x41103e(null,util[_0x584a('0x1a')]('%s%s','logo',path[_0x584a('0x1b')](_0x69d6c3[_0x584a('0x1c')])));}})});router[_0x584a('0x1d')](_0x584a('0xf'),upload[_0x584a('0x1e')](_0x584a('0x1f')),controller[_0x584a('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a9e51,_0x20b0df,_0x4448e5){_0x4448e5(null,path[_0x584a('0x17')](config[_0x584a('0x18')],_0x584a('0x19')));},'filename':function(_0x436f8d,_0x1e2ee1,_0x4fefd8){_0x4fefd8(null,util[_0x584a('0x1a')]('%s%s',_0x584a('0x21'),path['extname'](_0x1e2ee1['originalname'])));}})});router[_0x584a('0x1d')]('/:id/logo_login',upload['single'](_0x584a('0x1f')),controller[_0x584a('0x22')]);var upload=multer({'storage':multer[_0x584a('0x16')]({'destination':function(_0x5b0d21,_0x148886,_0x26e50f){_0x26e50f(null,path['join'](config[_0x584a('0x18')],_0x584a('0x19')));},'filename':function(_0x52fd36,_0x2ad9bf,_0x100f0c){_0x100f0c(null,util['format'](_0x584a('0x23'),_0x584a('0x24'),path[_0x584a('0x1b')](_0x2ad9bf[_0x584a('0x1c')])));}})});router[_0x584a('0x1d')]('/:id/preferred',upload[_0x584a('0x1e')](_0x584a('0x1f')),controller[_0x584a('0x25')]);var upload=multer({'storage':multer[_0x584a('0x16')]({'destination':function(_0x38b519,_0xb3a8b4,_0x13f29f){_0x13f29f(null,path[_0x584a('0x17')](config[_0x584a('0x18')],_0x584a('0x19')));},'filename':function(_0x9bc0ca,_0x39cd31,_0x346782){_0x346782(null,util[_0x584a('0x1a')](_0x584a('0x23'),_0x584a('0x26'),path[_0x584a('0x1b')](_0x39cd31['originalname'])));}})});router[_0x584a('0x1d')](_0x584a('0x14'),upload[_0x584a('0x1e')](_0x584a('0x1f')),controller['addFavicon']);router[_0x584a('0x27')](_0x584a('0xd'),auth[_0x584a('0x9')](),controller[_0x584a('0x28')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4118d98..a6a4360 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 _0x92d8=['INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x92d8,0xa7));var _0x892d=function(_0x392d1b,_0x414c68){_0x392d1b=_0x392d1b-0x0;var _0x589c32=_0x92d8[_0x392d1b];return _0x589c32;};'use strict';var Sequelize=require(_0x892d('0x0'));module[_0x892d('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x892d('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x892d('0x3')](0xb),'unique':_0x892d('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x892d('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x892d('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x892d('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x892d('0x5')]},'turnaddr':{'type':Sequelize[_0x892d('0x5')]},'turnusername':{'type':Sequelize[_0x892d('0x5')]},'turnpassword':{'type':Sequelize[_0x892d('0x5')]},'pageTitle':{'type':Sequelize[_0x892d('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x892d('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x892d('0x7')},'enableEmailPreview':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x892d('0x5')],'defaultValue':_0x892d('0x8')},'chatTimeout':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x892d('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x892d('0x3')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x892d('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x892d('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0x892d('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x892d('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x892d('0x3')](0x2)[_0x892d('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x892d('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x892d('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x892d('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0x510a=['min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER'];(function(_0x291d3e,_0x18f15b){var _0xce2a11=function(_0x248663){while(--_0x248663){_0x291d3e['push'](_0x291d3e['shift']());}};_0xce2a11(++_0x18f15b);}(_0x510a,0x1bf));var _0xa510=function(_0x32cbb7,_0x42a7fb){_0x32cbb7=_0x32cbb7-0x0;var _0x59cb23=_0x510a[_0x32cbb7];return _0x59cb23;};'use strict';var Sequelize=require(_0xa510('0x0'));module[_0xa510('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xa510('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xa510('0x3')](0xb),'unique':_0xa510('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xa510('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xa510('0x5')],'defaultValue':_0xa510('0x6')},'logo':{'type':Sequelize[_0xa510('0x5')]},'defaultLogo':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xa510('0x5')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xa510('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xa510('0x5')]},'turnaddr':{'type':Sequelize[_0xa510('0x5')]},'turnusername':{'type':Sequelize[_0xa510('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xa510('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xa510('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xa510('0x5')],'defaultValue':_0xa510('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xa510('0x5')],'defaultValue':_0xa510('0x9')},'chatTimeout':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xa510('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xa510('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xa510('0x3')]},'transcribeRegion':{'type':Sequelize[_0xa510('0x5')]},'sentiment':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xa510('0x3')]},'sentimentRegion':{'type':Sequelize[_0xa510('0x5')]},'language':{'type':Sequelize[_0xa510('0x5')]},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xa510('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)[_0xa510('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xa510('0x3')](0x2)[_0xa510('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0xa510('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xa510('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xa510('0x3')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xa510('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index edcf823..b080d40 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 _0x0e0d=['upperFirst','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','default_loginLogo.svg','custom','gdpr','securePassword','addPreferred','getPreferred','default','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','info','catch','sendStatus','status','end','json','limit','offset','count','set','apply','save','update','destroy','stack','name','send','index','map','Setting','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','rawAttributes','includeAll','include','find','body','params','addLogo','file','filename','addLogoLogin','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','existsSync','join','root','toLower','default_logo.svg'];(function(_0x355157,_0x351e82){var _0xf9525e=function(_0x37e6ac){while(--_0x37e6ac){_0x355157['push'](_0x355157['shift']());}};_0xf9525e(++_0x351e82);}(_0x0e0d,0x100));var _0xd0e0=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0e0d[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xd0e0('0x0'));var rimraf=require(_0xd0e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0e0('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd0e0('0x3'));var util=require(_0xd0e0('0x4'));var path=require(_0xd0e0('0x5'));var sox=require(_0xd0e0('0x6'));var csv=require(_0xd0e0('0x7'));var ejs=require(_0xd0e0('0x8'));var fs=require('fs');var fs_extra=require(_0xd0e0('0x9'));var _=require(_0xd0e0('0xa'));var squel=require('squel');var crypto=require(_0xd0e0('0xb'));var jsforce=require(_0xd0e0('0xc'));var deskjs=require(_0xd0e0('0xd'));var toCsv=require(_0xd0e0('0x7'));var querystring=require(_0xd0e0('0xe'));var Papa=require(_0xd0e0('0xf'));var Redis=require('ioredis');var authService=require(_0xd0e0('0x10'));var qs=require(_0xd0e0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd0e0('0x12'));var utils=require(_0xd0e0('0x13'));var config=require(_0xd0e0('0x14'));var licenseUtil=require(_0xd0e0('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd0e0('0x16'));var client=jayson[_0xd0e0('0x17')][_0xd0e0('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3473cc,_0x1e19b1,_0x194b99,_0x1af4cb){return new BPromise(function(_0x205180,_0x5cfd89){var _0x5bd63d=_0x1af4cb||client;return _0x5bd63d[_0xd0e0('0x19')](_0x3473cc,_0x194b99)[_0xd0e0('0x1a')](function(_0x4b21e5){logger['info']('Setting,\x20%s,\x20%s',_0x1e19b1,_0xd0e0('0x1b'));logger[_0xd0e0('0x1c')](_0xd0e0('0x1d'),_0x1e19b1,_0xd0e0('0x1b'),JSON[_0xd0e0('0x1e')](_0x4b21e5));if(_0x4b21e5['error']){if(_0x4b21e5[_0xd0e0('0x1f')][_0xd0e0('0x20')]===0x1f4){logger['error'](_0xd0e0('0x21'),_0x1e19b1,_0x4b21e5['error']['message']);return _0x5cfd89(_0x4b21e5[_0xd0e0('0x1f')]['message']);}logger[_0xd0e0('0x1f')](_0xd0e0('0x21'),_0x1e19b1,_0x4b21e5[_0xd0e0('0x1f')][_0xd0e0('0x22')]);return _0x205180(_0x4b21e5[_0xd0e0('0x1f')][_0xd0e0('0x22')]);}else{logger[_0xd0e0('0x23')](_0xd0e0('0x21'),_0x1e19b1,_0xd0e0('0x1b'));_0x205180(_0x4b21e5['result']['message']);}})[_0xd0e0('0x24')](function(_0x4fe93d){logger[_0xd0e0('0x1f')]('Setting,\x20%s,\x20%s',_0x1e19b1,_0x4fe93d);_0x5cfd89(_0x4fe93d);});});}function respondWithStatusCode(_0x994480,_0xfc6a02){_0xfc6a02=_0xfc6a02||0xcc;return function(_0x482834){if(_0x482834){return _0x994480[_0xd0e0('0x25')](_0xfc6a02);}return _0x994480[_0xd0e0('0x26')](_0xfc6a02)[_0xd0e0('0x27')]();};}function respondWithResult(_0x39f515,_0x43c545){_0x43c545=_0x43c545||0xc8;return function(_0x1c45d3){if(_0x1c45d3){return _0x39f515['status'](_0x43c545)[_0xd0e0('0x28')](_0x1c45d3);}};}function respondWithFilteredResult(_0x37b3f5,_0x40fff8){return function(_0x3fb0da){if(_0x3fb0da){var _0x40a464=typeof _0x40fff8['offset']==='undefined'&&typeof _0x40fff8[_0xd0e0('0x29')]==='undefined';var _0x3e2af7=_0x3fb0da['count'];var _0x3c48ea=_0x40a464?0x0:_0x40fff8[_0xd0e0('0x2a')];var _0x845a9a=_0x40a464?_0x3fb0da[_0xd0e0('0x2b')]:_0x40fff8[_0xd0e0('0x2a')]+_0x40fff8['limit'];var _0x30efdd;if(_0x845a9a>=_0x3e2af7){_0x845a9a=_0x3e2af7;_0x30efdd=0xc8;}else{_0x30efdd=0xce;}_0x37b3f5[_0xd0e0('0x26')](_0x30efdd);return _0x37b3f5[_0xd0e0('0x2c')]('Content-Range',_0x3c48ea+'-'+_0x845a9a+'/'+_0x3e2af7)[_0xd0e0('0x28')](_0x3fb0da);}return null;};}function patchUpdates(_0x35ce91){return function(_0x256832){try{jsonpatch[_0xd0e0('0x2d')](_0x256832,_0x35ce91,!![]);}catch(_0x5572f6){return BPromise['reject'](_0x5572f6);}return _0x256832[_0xd0e0('0x2e')]();};}function saveUpdates(_0x36045e,_0x18d072){return function(_0xbe8f21){if(_0xbe8f21){return _0xbe8f21[_0xd0e0('0x2f')](_0x36045e)[_0xd0e0('0x1a')](function(_0x5363f4){return _0x5363f4;});}return null;};}function removeEntity(_0x49732b,_0x26c601){return function(_0x521f7c){if(_0x521f7c){return _0x521f7c[_0xd0e0('0x30')]()[_0xd0e0('0x1a')](function(){_0x49732b['status'](0xcc)[_0xd0e0('0x27')]();});}};}function handleEntityNotFound(_0x19101e,_0x5da2d4){return function(_0x3616d3){if(!_0x3616d3){_0x19101e[_0xd0e0('0x25')](0x194);}return _0x3616d3;};}function handleError(_0x4fb391,_0x352786){_0x352786=_0x352786||0x1f4;return function(_0x15c54c){logger['error'](_0x15c54c[_0xd0e0('0x31')]);if(_0x15c54c[_0xd0e0('0x32')]){delete _0x15c54c[_0xd0e0('0x32')];}_0x4fb391[_0xd0e0('0x26')](_0x352786)[_0xd0e0('0x33')](_0x15c54c);};}exports[_0xd0e0('0x34')]=function(_0x3c0db3,_0x8861bd){var _0x568d89={},_0x359a9c={},_0x5d0e9a={'count':0x0,'rows':[]};var _0x3b2181=_[_0xd0e0('0x35')](db[_0xd0e0('0x36')]['rawAttributes'],function(_0x580627){return{'name':_0x580627[_0xd0e0('0x37')],'type':_0x580627['type']['key']};});_0x359a9c[_0xd0e0('0x38')]=_[_0xd0e0('0x35')](_0x3b2181,_0xd0e0('0x32'));_0x359a9c['query']=_[_0xd0e0('0x39')](_0x3c0db3[_0xd0e0('0x3a')]);_0x359a9c[_0xd0e0('0x3b')]=_[_0xd0e0('0x3c')](_0x359a9c[_0xd0e0('0x38')],_0x359a9c[_0xd0e0('0x3a')]);_0x568d89['attributes']=_['intersection'](_0x359a9c[_0xd0e0('0x38')],qs['fields'](_0x3c0db3[_0xd0e0('0x3a')][_0xd0e0('0x3d')]));_0x568d89[_0xd0e0('0x3e')]=_0x568d89[_0xd0e0('0x3e')][_0xd0e0('0x3f')]?_0x568d89['attributes']:_0x359a9c[_0xd0e0('0x38')];if(!_0x3c0db3['query'][_0xd0e0('0x40')]('nolimit')){_0x568d89[_0xd0e0('0x29')]=qs['limit'](_0x3c0db3[_0xd0e0('0x3a')]['limit']);_0x568d89['offset']=qs[_0xd0e0('0x2a')](_0x3c0db3[_0xd0e0('0x3a')][_0xd0e0('0x2a')]);}_0x568d89['order']=qs[_0xd0e0('0x41')](_0x3c0db3['query'][_0xd0e0('0x41')]);_0x568d89[_0xd0e0('0x42')]=qs[_0xd0e0('0x3b')](_[_0xd0e0('0x43')](_0x3c0db3[_0xd0e0('0x3a')],_0x359a9c[_0xd0e0('0x3b')]),_0x3b2181);if(_0x3c0db3[_0xd0e0('0x3a')][_0xd0e0('0x44')]){_0x568d89[_0xd0e0('0x42')]=_[_0xd0e0('0x45')](_0x568d89[_0xd0e0('0x42')],{'$or':_['map'](_0x3b2181,function(_0x527a5f){if(_0x527a5f[_0xd0e0('0x46')]!==_0xd0e0('0x47')){var _0x20ad5f={};_0x20ad5f[_0x527a5f['name']]={'$like':'%'+_0x3c0db3[_0xd0e0('0x3a')]['filter']+'%'};return _0x20ad5f;}})});}_0x568d89=_[_0xd0e0('0x45')]({},_0x568d89,_0x3c0db3[_0xd0e0('0x48')]);var _0xd2eaeb={'where':_0x568d89[_0xd0e0('0x42')]};return db[_0xd0e0('0x36')]['count'](_0xd2eaeb)[_0xd0e0('0x1a')](function(_0x5c3338){_0x5d0e9a[_0xd0e0('0x2b')]=_0x5c3338;if(_0x3c0db3[_0xd0e0('0x3a')]['includeAll']){_0x568d89['include']=[{'all':!![]}];}return db[_0xd0e0('0x36')][_0xd0e0('0x49')](_0x568d89);})[_0xd0e0('0x1a')](function(_0x229d15){_0x5d0e9a['rows']=_0x229d15;return _0x5d0e9a;})[_0xd0e0('0x1a')](respondWithFilteredResult(_0x8861bd,_0x568d89))[_0xd0e0('0x24')](handleError(_0x8861bd,null));};exports['show']=function(_0x549640,_0x52989a){var _0x17a49d={'raw':![],'where':{'id':_0x549640['params']['id']}},_0xbed19d={};_0xbed19d['model']=_['keys'](db[_0xd0e0('0x36')][_0xd0e0('0x4a')]);_0xbed19d[_0xd0e0('0x3a')]=_[_0xd0e0('0x39')](_0x549640['query']);_0xbed19d['filters']=_['intersection'](_0xbed19d[_0xd0e0('0x38')],_0xbed19d[_0xd0e0('0x3a')]);_0x17a49d[_0xd0e0('0x3e')]=_[_0xd0e0('0x3c')](_0xbed19d[_0xd0e0('0x38')],qs['fields'](_0x549640['query'][_0xd0e0('0x3d')]));_0x17a49d['attributes']=_0x17a49d['attributes'][_0xd0e0('0x3f')]?_0x17a49d['attributes']:_0xbed19d[_0xd0e0('0x38')];if(_0x549640[_0xd0e0('0x3a')][_0xd0e0('0x4b')]){_0x17a49d[_0xd0e0('0x4c')]=[{'all':!![]}];}_0x17a49d=_[_0xd0e0('0x45')]({},_0x17a49d,_0x549640[_0xd0e0('0x48')]);return db[_0xd0e0('0x36')][_0xd0e0('0x4d')](_0x17a49d)[_0xd0e0('0x1a')](handleEntityNotFound(_0x52989a,null))[_0xd0e0('0x1a')](respondWithResult(_0x52989a,null))[_0xd0e0('0x24')](handleError(_0x52989a,null));};exports[_0xd0e0('0x2f')]=function(_0xa56d5a,_0x356b02){if(_0xa56d5a[_0xd0e0('0x4e')]['id']){delete _0xa56d5a[_0xd0e0('0x4e')]['id'];}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0xa56d5a[_0xd0e0('0x4f')]['id']}})[_0xd0e0('0x1a')](handleEntityNotFound(_0x356b02,null))[_0xd0e0('0x1a')](saveUpdates(_0xa56d5a[_0xd0e0('0x4e')],null))[_0xd0e0('0x1a')](respondWithResult(_0x356b02,null))[_0xd0e0('0x24')](handleError(_0x356b02,null));};exports[_0xd0e0('0x50')]=function(_0x34ebd8,_0x307a44,_0x3acd4a){if(_0x34ebd8[_0xd0e0('0x51')]&&_0x34ebd8[_0xd0e0('0x51')][_0xd0e0('0x52')]){_0x34ebd8['body']['logo']=_0x34ebd8[_0xd0e0('0x51')][_0xd0e0('0x52')];}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0x34ebd8['params']['id']}})['then'](handleEntityNotFound(_0x307a44,null))[_0xd0e0('0x1a')](saveUpdates(_0x34ebd8['body'],null))[_0xd0e0('0x1a')](respondWithResult(_0x307a44,null))['catch'](handleError(_0x307a44,null));};exports[_0xd0e0('0x53')]=function(_0x174a90,_0x18fe8f,_0x3a9abf){if(_0x174a90['file']&&_0x174a90['file']['filename']){_0x174a90['body'][_0xd0e0('0x54')]=_0x174a90['file'][_0xd0e0('0x52')];}return db['Setting'][_0xd0e0('0x4d')]({'where':{'id':_0x174a90[_0xd0e0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18fe8f,null))[_0xd0e0('0x1a')](saveUpdates(_0x174a90['body'],null))[_0xd0e0('0x1a')](respondWithResult(_0x18fe8f,null))['catch'](handleError(_0x18fe8f,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x11e39e,_0x17f450,_0x3d3cf8){var _0x4681c9=_0xd0e0('0x55');var _0x3f96ac={'custom':![]};return utilLicense['getLicense']()[_0xd0e0('0x1a')](function(_0x460dbe){if(_0x460dbe){_0x3f96ac=_0x460dbe;}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0x11e39e[_0xd0e0('0x4f')]['id']},'attributes':['logo','loginLogo',_0xd0e0('0x56'),_0xd0e0('0x57'),_0xd0e0('0x58'),_0xd0e0('0x59'),_0xd0e0('0x5a'),_0xd0e0('0x5b')],'raw':!![]});})[_0xd0e0('0x1a')](handleEntityNotFound(_0x17f450,null))[_0xd0e0('0x1a')](function(_0x4ebf16){if(_0x4ebf16){var _0x12714d=_0x4ebf16[_0xd0e0('0x5c')]&&fs[_0xd0e0('0x5d')](path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x4681c9,_[_0xd0e0('0x60')](_0x4ebf16[_0xd0e0('0x5c')])))?path[_0xd0e0('0x5e')](config['root'],_0x4681c9,_[_0xd0e0('0x60')](_0x4ebf16['logo'])):path['join'](config[_0xd0e0('0x5f')],_0x4681c9,_[_0xd0e0('0x60')](_0xd0e0('0x61')));var _0xd9f74f='default'+_[_0xd0e0('0x62')](_0xd0e0('0x5c'));if(_0x4ebf16[_0xd9f74f]||!_0x3f96ac['custom']){_0x12714d=path['join'](config[_0xd0e0('0x5f')],_0x4681c9,_['toLower'](_0xd0e0('0x61')));}if(!fs['existsSync'](_0x12714d)){throw new db[(_0xd0e0('0x63'))][(_0xd0e0('0x64'))](_[_0xd0e0('0x62')](_0xd0e0('0x5c'))+_0xd0e0('0x65'));}return _0x17f450[_0xd0e0('0x66')](_0x12714d);}})[_0xd0e0('0x24')](handleError(_0x17f450,null));};var utilLicense=require(_0xd0e0('0x15'));exports[_0xd0e0('0x67')]=function(_0x5c6caf,_0x31aa00,_0x54b7fe){var _0x5a48f1='server/files/images/logos';var _0x2cf8db={'custom':![]};return utilLicense[_0xd0e0('0x68')]()[_0xd0e0('0x1a')](function(_0x4f0138){if(_0x4f0138){_0x2cf8db=_0x4f0138;}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0x5c6caf[_0xd0e0('0x4f')]['id']},'attributes':[_0xd0e0('0x5c'),_0xd0e0('0x54'),_0xd0e0('0x56'),_0xd0e0('0x57'),'defaultLogo',_0xd0e0('0x59'),_0xd0e0('0x5a'),_0xd0e0('0x5b')],'raw':!![]});})[_0xd0e0('0x1a')](handleEntityNotFound(_0x31aa00,null))[_0xd0e0('0x1a')](function(_0x5e2c3d){if(_0x5e2c3d){var _0x17e311=_0x5e2c3d[_0xd0e0('0x54')]&&fs['existsSync'](path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x5a48f1,_[_0xd0e0('0x60')](_0x5e2c3d[_0xd0e0('0x54')])))?path[_0xd0e0('0x5e')](config['root'],_0x5a48f1,_[_0xd0e0('0x60')](_0x5e2c3d[_0xd0e0('0x54')])):path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x5a48f1,_[_0xd0e0('0x60')](_0xd0e0('0x69')));var _0x2f27e9='default'+_[_0xd0e0('0x62')](_0xd0e0('0x54'));if(_0x5e2c3d[_0x2f27e9]||!_0x2cf8db[_0xd0e0('0x6a')]){_0x17e311=path['join'](config[_0xd0e0('0x5f')],_0x5a48f1,_[_0xd0e0('0x60')](_0xd0e0('0x69')));}if(!fs[_0xd0e0('0x5d')](_0x17e311)){throw new db[(_0xd0e0('0x63'))][(_0xd0e0('0x64'))](_[_0xd0e0('0x62')](_0xd0e0('0x54'))+_0xd0e0('0x65'));}return _0x31aa00[_0xd0e0('0x66')](_0x17e311);}})[_0xd0e0('0x24')](handleError(_0x31aa00,null));};exports[_0xd0e0('0x6b')]=function(_0x57b738,_0x12a69c){return db[_0xd0e0('0x36')]['find']({'where':{'id':_0x57b738[_0xd0e0('0x4f')]['id']},'attributes':[_0xd0e0('0x6c')]})['then'](respondWithResult(_0x12a69c,null))[_0xd0e0('0x24')](handleError(_0x12a69c,null));};exports[_0xd0e0('0x6d')]=function(_0x242f13,_0x251182,_0x6c02f9){if(_0x242f13[_0xd0e0('0x51')]&&_0x242f13[_0xd0e0('0x51')][_0xd0e0('0x52')]){_0x242f13[_0xd0e0('0x4e')]['preferred']=_0x242f13[_0xd0e0('0x51')][_0xd0e0('0x52')];}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0x242f13[_0xd0e0('0x4f')]['id']}})[_0xd0e0('0x1a')](handleEntityNotFound(_0x251182,null))[_0xd0e0('0x1a')](saveUpdates(_0x242f13[_0xd0e0('0x4e')],null))['then'](respondWithResult(_0x251182,null))['catch'](handleError(_0x251182,null));};var utilLicense=require('../../config/license/util');exports[_0xd0e0('0x6e')]=function(_0x49592b,_0x614c63,_0x42ba3a){var _0x569ab0='server/files/images/logos';var _0x2c609b={'custom':![]};return utilLicense[_0xd0e0('0x68')]()['then'](function(_0x476f32){if(_0x476f32){_0x2c609b=_0x476f32;}return db['Setting'][_0xd0e0('0x4d')]({'where':{'id':_0x49592b['params']['id']},'attributes':[_0xd0e0('0x5c'),_0xd0e0('0x54'),_0xd0e0('0x56'),_0xd0e0('0x57'),_0xd0e0('0x58'),_0xd0e0('0x59'),_0xd0e0('0x5a'),_0xd0e0('0x5b')],'raw':!![]});})['then'](handleEntityNotFound(_0x614c63,null))[_0xd0e0('0x1a')](function(_0x3733d6){if(_0x3733d6){var _0x54620e=_0x3733d6[_0xd0e0('0x56')]&&fs[_0xd0e0('0x5d')](path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x569ab0,_[_0xd0e0('0x60')](_0x3733d6[_0xd0e0('0x56')])))?path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x569ab0,_[_0xd0e0('0x60')](_0x3733d6[_0xd0e0('0x56')])):path[_0xd0e0('0x5e')](config['root'],_0x569ab0,_[_0xd0e0('0x60')]('default_preferred.png'));var _0x1a033f=_0xd0e0('0x6f')+_[_0xd0e0('0x62')](_0xd0e0('0x56'));if(_0x3733d6[_0x1a033f]||!_0x2c609b['custom']||!_0x2c609b[_0xd0e0('0x56')]){_0x54620e=path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x569ab0,_[_0xd0e0('0x60')]('default_preferred.png'));}if(!fs[_0xd0e0('0x5d')](_0x54620e)){throw new db[(_0xd0e0('0x63'))][(_0xd0e0('0x64'))](_['upperFirst'](_0xd0e0('0x56'))+_0xd0e0('0x65'));}return _0x614c63[_0xd0e0('0x66')](_0x54620e);}})[_0xd0e0('0x24')](handleError(_0x614c63,null));};exports[_0xd0e0('0x70')]=function(_0x4c63f1,_0x2d28c9,_0x171187){if(_0x4c63f1[_0xd0e0('0x51')]&&_0x4c63f1[_0xd0e0('0x51')]['filename']){_0x4c63f1[_0xd0e0('0x4e')][_0xd0e0('0x57')]=_0x4c63f1['file'][_0xd0e0('0x52')];}return db['Setting']['find']({'where':{'id':_0x4c63f1[_0xd0e0('0x4f')]['id']}})[_0xd0e0('0x1a')](handleEntityNotFound(_0x2d28c9,null))[_0xd0e0('0x1a')](saveUpdates(_0x4c63f1[_0xd0e0('0x4e')],null))[_0xd0e0('0x1a')](respondWithResult(_0x2d28c9,null))[_0xd0e0('0x24')](handleError(_0x2d28c9,null));};var utilLicense=require(_0xd0e0('0x15'));exports[_0xd0e0('0x71')]=function(_0x41b2f0,_0x503309,_0x32d9ae){var _0x3970a0=_0xd0e0('0x55');var _0x413796={'custom':![]};return utilLicense[_0xd0e0('0x68')]()[_0xd0e0('0x1a')](function(_0x3685e4){if(_0x3685e4){_0x413796=_0x3685e4;}return db[_0xd0e0('0x36')][_0xd0e0('0x4d')]({'where':{'id':_0x41b2f0[_0xd0e0('0x4f')]['id']},'attributes':[_0xd0e0('0x5c'),_0xd0e0('0x54'),_0xd0e0('0x56'),_0xd0e0('0x57'),_0xd0e0('0x58'),'defaultLoginLogo',_0xd0e0('0x5a'),_0xd0e0('0x5b')],'raw':!![]});})[_0xd0e0('0x1a')](handleEntityNotFound(_0x503309,null))[_0xd0e0('0x1a')](function(_0x4ea831){if(_0x4ea831){var _0x44e389=_0x4ea831['favicon']&&fs[_0xd0e0('0x5d')](path[_0xd0e0('0x5e')](config['root'],_0x3970a0,_[_0xd0e0('0x60')](_0x4ea831[_0xd0e0('0x57')])))?path[_0xd0e0('0x5e')](config[_0xd0e0('0x5f')],_0x3970a0,_[_0xd0e0('0x60')](_0x4ea831[_0xd0e0('0x57')])):path[_0xd0e0('0x5e')](config['root'],_0x3970a0,_[_0xd0e0('0x60')](_0xd0e0('0x72')));var _0x179504=_0xd0e0('0x6f')+_[_0xd0e0('0x62')]('favicon');if(_0x4ea831[_0x179504]||!_0x413796['custom']){_0x44e389=path['join'](config[_0xd0e0('0x5f')],_0x3970a0,_[_0xd0e0('0x60')](_0xd0e0('0x72')));}if(!fs['existsSync'](_0x44e389)){throw new db[(_0xd0e0('0x63'))]['ValidationError'](_[_0xd0e0('0x62')](_0xd0e0('0x57'))+'\x20not\x20found');}return _0x503309[_0xd0e0('0x66')](_0x44e389);}})[_0xd0e0('0x24')](handleError(_0x503309,null));};exports[_0xd0e0('0x73')]=function(_0x5a4aea,_0x279c0e){var _0x4ef0bb={'offset':moment()['utcOffset']()};_0x4ef0bb['now']=moment()[_0xd0e0('0x74')](_0x4ef0bb[_0xd0e0('0x2a')])['format'](_0xd0e0('0x75'));return _0x279c0e[_0xd0e0('0x26')](0xc8)[_0xd0e0('0x33')](_0x4ef0bb);}; \ No newline at end of file +var _0xabd8=['model','attributes','intersection','fields','length','nolimit','sort','where','filters','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','merge','options','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','logo','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','download','getLicense','defaultPreferred','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','fast-json-patch','request-promise','moment','mustache','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/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','Setting','fieldName','type','key','query','keys'];(function(_0x2179e3,_0x3f7767){var _0x3a350b=function(_0x1a4975){while(--_0x1a4975){_0x2179e3['push'](_0x2179e3['shift']());}};_0x3a350b(++_0x3f7767);}(_0xabd8,0x142));var _0x8abd=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0xabd8[_0x5ecadc];return _0x565037;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8abd('0x0'));var rp=require(_0x8abd('0x1'));var moment=require(_0x8abd('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8abd('0x3'));var util=require(_0x8abd('0x4'));var path=require(_0x8abd('0x5'));var sox=require(_0x8abd('0x6'));var csv=require(_0x8abd('0x7'));var ejs=require(_0x8abd('0x8'));var fs=require('fs');var fs_extra=require(_0x8abd('0x9'));var _=require(_0x8abd('0xa'));var squel=require(_0x8abd('0xb'));var crypto=require(_0x8abd('0xc'));var jsforce=require(_0x8abd('0xd'));var deskjs=require(_0x8abd('0xe'));var toCsv=require(_0x8abd('0x7'));var querystring=require('querystring');var Papa=require(_0x8abd('0xf'));var Redis=require(_0x8abd('0x10'));var authService=require(_0x8abd('0x11'));var qs=require(_0x8abd('0x12'));var as=require(_0x8abd('0x13'));var hardwareService=require(_0x8abd('0x14'));var logger=require(_0x8abd('0x15'))(_0x8abd('0x16'));var utils=require(_0x8abd('0x17'));var config=require(_0x8abd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8abd('0x19'))['db'];var jayson=require(_0x8abd('0x1a'));var client=jayson[_0x8abd('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x208df8,_0xba05a4,_0x32f6fc,_0x767f76){return new BPromise(function(_0x10915d,_0x7da358){var _0xaa39c0=_0x767f76||client;return _0xaa39c0[_0x8abd('0x1c')](_0x208df8,_0x32f6fc)['then'](function(_0x4942c2){logger[_0x8abd('0x1d')](_0x8abd('0x1e'),_0xba05a4,_0x8abd('0x1f'));logger[_0x8abd('0x20')](_0x8abd('0x21'),_0xba05a4,_0x8abd('0x1f'),JSON[_0x8abd('0x22')](_0x4942c2));if(_0x4942c2['error']){if(_0x4942c2[_0x8abd('0x23')][_0x8abd('0x24')]===0x1f4){logger[_0x8abd('0x23')](_0x8abd('0x1e'),_0xba05a4,_0x4942c2[_0x8abd('0x23')][_0x8abd('0x25')]);return _0x7da358(_0x4942c2[_0x8abd('0x23')]['message']);}logger['error'](_0x8abd('0x1e'),_0xba05a4,_0x4942c2[_0x8abd('0x23')][_0x8abd('0x25')]);return _0x10915d(_0x4942c2['error'][_0x8abd('0x25')]);}else{logger[_0x8abd('0x1d')]('Setting,\x20%s,\x20%s',_0xba05a4,_0x8abd('0x1f'));_0x10915d(_0x4942c2[_0x8abd('0x26')][_0x8abd('0x25')]);}})[_0x8abd('0x27')](function(_0x4d74a6){logger[_0x8abd('0x23')](_0x8abd('0x1e'),_0xba05a4,_0x4d74a6);_0x7da358(_0x4d74a6);});});}function respondWithStatusCode(_0xf9f6a6,_0x17e649){_0x17e649=_0x17e649||0xcc;return function(_0x597aec){if(_0x597aec){return _0xf9f6a6['sendStatus'](_0x17e649);}return _0xf9f6a6[_0x8abd('0x28')](_0x17e649)[_0x8abd('0x29')]();};}function respondWithResult(_0x34013b,_0x14a5b7){_0x14a5b7=_0x14a5b7||0xc8;return function(_0x5d64ea){if(_0x5d64ea){return _0x34013b[_0x8abd('0x28')](_0x14a5b7)[_0x8abd('0x2a')](_0x5d64ea);}};}function respondWithFilteredResult(_0x5799dc,_0x25b372){return function(_0x2f4a39){if(_0x2f4a39){var _0x4d07f6=typeof _0x25b372[_0x8abd('0x2b')]==='undefined'&&typeof _0x25b372[_0x8abd('0x2c')]===_0x8abd('0x2d');var _0x2e9918=_0x2f4a39[_0x8abd('0x2e')];var _0xc2ae7b=_0x4d07f6?0x0:_0x25b372[_0x8abd('0x2b')];var _0x10c5ea=_0x4d07f6?_0x2f4a39[_0x8abd('0x2e')]:_0x25b372[_0x8abd('0x2b')]+_0x25b372['limit'];var _0x51acfe;if(_0x10c5ea>=_0x2e9918){_0x10c5ea=_0x2e9918;_0x51acfe=0xc8;}else{_0x51acfe=0xce;}_0x5799dc['status'](_0x51acfe);return _0x5799dc[_0x8abd('0x2f')](_0x8abd('0x30'),_0xc2ae7b+'-'+_0x10c5ea+'/'+_0x2e9918)[_0x8abd('0x2a')](_0x2f4a39);}return null;};}function patchUpdates(_0x51f718){return function(_0x2211a6){try{jsonpatch[_0x8abd('0x31')](_0x2211a6,_0x51f718,!![]);}catch(_0x55528c){return BPromise[_0x8abd('0x32')](_0x55528c);}return _0x2211a6['save']();};}function saveUpdates(_0x23420e,_0x45b2b1){return function(_0x568088){if(_0x568088){return _0x568088['update'](_0x23420e)[_0x8abd('0x33')](function(_0x2ff17){return _0x2ff17;});}return null;};}function removeEntity(_0x4e9d1a,_0x3153df){return function(_0x2556d1){if(_0x2556d1){return _0x2556d1[_0x8abd('0x34')]()[_0x8abd('0x33')](function(){_0x4e9d1a['status'](0xcc)[_0x8abd('0x29')]();});}};}function handleEntityNotFound(_0x48c1a8,_0x5938ac){return function(_0x16c76e){if(!_0x16c76e){_0x48c1a8[_0x8abd('0x35')](0x194);}return _0x16c76e;};}function handleError(_0xb3cf2b,_0x496dbe){_0x496dbe=_0x496dbe||0x1f4;return function(_0x489e2f){logger['error'](_0x489e2f[_0x8abd('0x36')]);if(_0x489e2f['name']){delete _0x489e2f[_0x8abd('0x37')];}_0xb3cf2b['status'](_0x496dbe)[_0x8abd('0x38')](_0x489e2f);};}exports[_0x8abd('0x39')]=function(_0xee15c2,_0x51aa52){var _0x4111e0={},_0x17dd6b={},_0x14969e={'count':0x0,'rows':[]};var _0x591607=_[_0x8abd('0x3a')](db[_0x8abd('0x3b')]['rawAttributes'],function(_0x4b7f88){return{'name':_0x4b7f88[_0x8abd('0x3c')],'type':_0x4b7f88[_0x8abd('0x3d')][_0x8abd('0x3e')]};});_0x17dd6b['model']=_[_0x8abd('0x3a')](_0x591607,_0x8abd('0x37'));_0x17dd6b[_0x8abd('0x3f')]=_[_0x8abd('0x40')](_0xee15c2[_0x8abd('0x3f')]);_0x17dd6b['filters']=_['intersection'](_0x17dd6b[_0x8abd('0x41')],_0x17dd6b['query']);_0x4111e0[_0x8abd('0x42')]=_[_0x8abd('0x43')](_0x17dd6b[_0x8abd('0x41')],qs[_0x8abd('0x44')](_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x44')]));_0x4111e0['attributes']=_0x4111e0[_0x8abd('0x42')][_0x8abd('0x45')]?_0x4111e0['attributes']:_0x17dd6b['model'];if(!_0xee15c2['query']['hasOwnProperty'](_0x8abd('0x46'))){_0x4111e0[_0x8abd('0x2c')]=qs[_0x8abd('0x2c')](_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x2c')]);_0x4111e0['offset']=qs[_0x8abd('0x2b')](_0xee15c2['query']['offset']);}_0x4111e0['order']=qs[_0x8abd('0x47')](_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x47')]);_0x4111e0[_0x8abd('0x48')]=qs[_0x8abd('0x49')](_['pick'](_0xee15c2[_0x8abd('0x3f')],_0x17dd6b[_0x8abd('0x49')]),_0x591607);if(_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x4a')]){_0x4111e0['where']=_['merge'](_0x4111e0[_0x8abd('0x48')],{'$or':_[_0x8abd('0x3a')](_0x591607,function(_0x5a0845){if(_0x5a0845[_0x8abd('0x3d')]!==_0x8abd('0x4b')){var _0x1014a4={};_0x1014a4[_0x5a0845[_0x8abd('0x37')]]={'$like':'%'+_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x4a')]+'%'};return _0x1014a4;}})});}_0x4111e0=_['merge']({},_0x4111e0,_0xee15c2['options']);var _0x22511e={'where':_0x4111e0[_0x8abd('0x48')]};return db['Setting'][_0x8abd('0x2e')](_0x22511e)[_0x8abd('0x33')](function(_0x44253b){_0x14969e[_0x8abd('0x2e')]=_0x44253b;if(_0xee15c2[_0x8abd('0x3f')][_0x8abd('0x4c')]){_0x4111e0[_0x8abd('0x4d')]=[{'all':!![]}];}return db[_0x8abd('0x3b')][_0x8abd('0x4e')](_0x4111e0);})['then'](function(_0x4362f8){_0x14969e[_0x8abd('0x4f')]=_0x4362f8;return _0x14969e;})[_0x8abd('0x33')](respondWithFilteredResult(_0x51aa52,_0x4111e0))['catch'](handleError(_0x51aa52,null));};exports[_0x8abd('0x50')]=function(_0x16c89a,_0x3222d4){var _0x42a17e={'raw':![],'where':{'id':_0x16c89a[_0x8abd('0x51')]['id']}},_0x4f6133={};_0x4f6133[_0x8abd('0x41')]=_[_0x8abd('0x40')](db[_0x8abd('0x3b')][_0x8abd('0x52')]);_0x4f6133[_0x8abd('0x3f')]=_[_0x8abd('0x40')](_0x16c89a[_0x8abd('0x3f')]);_0x4f6133[_0x8abd('0x49')]=_[_0x8abd('0x43')](_0x4f6133[_0x8abd('0x41')],_0x4f6133['query']);_0x42a17e[_0x8abd('0x42')]=_[_0x8abd('0x43')](_0x4f6133[_0x8abd('0x41')],qs[_0x8abd('0x44')](_0x16c89a[_0x8abd('0x3f')]['fields']));_0x42a17e[_0x8abd('0x42')]=_0x42a17e[_0x8abd('0x42')]['length']?_0x42a17e[_0x8abd('0x42')]:_0x4f6133[_0x8abd('0x41')];if(_0x16c89a['query']['includeAll']){_0x42a17e[_0x8abd('0x4d')]=[{'all':!![]}];}_0x42a17e=_[_0x8abd('0x53')]({},_0x42a17e,_0x16c89a[_0x8abd('0x54')]);return db['Setting'][_0x8abd('0x55')](_0x42a17e)[_0x8abd('0x33')](handleEntityNotFound(_0x3222d4,null))[_0x8abd('0x33')](respondWithResult(_0x3222d4,null))[_0x8abd('0x27')](handleError(_0x3222d4,null));};exports[_0x8abd('0x56')]=function(_0x2e6cd4,_0x421bf7){if(_0x2e6cd4['body']['id']){delete _0x2e6cd4[_0x8abd('0x57')]['id'];}return db['Setting'][_0x8abd('0x55')]({'where':{'id':_0x2e6cd4[_0x8abd('0x51')]['id']}})['then'](handleEntityNotFound(_0x421bf7,null))['then'](saveUpdates(_0x2e6cd4[_0x8abd('0x57')],null))[_0x8abd('0x33')](respondWithResult(_0x421bf7,null))[_0x8abd('0x27')](handleError(_0x421bf7,null));};exports[_0x8abd('0x58')]=function(_0x2b8abe,_0x31b477,_0x502131){if(_0x2b8abe[_0x8abd('0x59')]&&_0x2b8abe[_0x8abd('0x59')]['filename']){_0x2b8abe[_0x8abd('0x57')]['logo']=_0x2b8abe[_0x8abd('0x59')][_0x8abd('0x5a')];}return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0x2b8abe[_0x8abd('0x51')]['id']}})[_0x8abd('0x33')](handleEntityNotFound(_0x31b477,null))[_0x8abd('0x33')](saveUpdates(_0x2b8abe[_0x8abd('0x57')],null))[_0x8abd('0x33')](respondWithResult(_0x31b477,null))[_0x8abd('0x27')](handleError(_0x31b477,null));};exports[_0x8abd('0x5b')]=function(_0x26c077,_0x11dbcf,_0x32c7bc){if(_0x26c077['file']&&_0x26c077[_0x8abd('0x59')][_0x8abd('0x5a')]){_0x26c077[_0x8abd('0x57')][_0x8abd('0x5c')]=_0x26c077[_0x8abd('0x59')][_0x8abd('0x5a')];}return db['Setting'][_0x8abd('0x55')]({'where':{'id':_0x26c077[_0x8abd('0x51')]['id']}})[_0x8abd('0x33')](handleEntityNotFound(_0x11dbcf,null))[_0x8abd('0x33')](saveUpdates(_0x26c077[_0x8abd('0x57')],null))['then'](respondWithResult(_0x11dbcf,null))[_0x8abd('0x27')](handleError(_0x11dbcf,null));};var utilLicense=require(_0x8abd('0x5d'));exports[_0x8abd('0x5e')]=function(_0x3c3271,_0x2fe240,_0xb046f){var _0x575558=_0x8abd('0x5f');var _0x33dea7={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1bab48){if(_0x1bab48){_0x33dea7=_0x1bab48;}return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0x3c3271['params']['id']},'attributes':['logo',_0x8abd('0x5c'),_0x8abd('0x60'),_0x8abd('0x61'),_0x8abd('0x62'),_0x8abd('0x63'),'defaultPreferred',_0x8abd('0x64')],'raw':!![]});})[_0x8abd('0x33')](handleEntityNotFound(_0x2fe240,null))['then'](function(_0xb309b3){if(_0xb309b3){var _0x1da591=_0xb309b3[_0x8abd('0x65')]&&fs[_0x8abd('0x66')](path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x575558,_[_0x8abd('0x69')](_0xb309b3[_0x8abd('0x65')])))?path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x575558,_[_0x8abd('0x69')](_0xb309b3[_0x8abd('0x65')])):path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x575558,_[_0x8abd('0x69')]('default_logo.svg'));var _0x7b0216=_0x8abd('0x6a')+_[_0x8abd('0x6b')](_0x8abd('0x65'));if(_0xb309b3[_0x7b0216]||!_0x33dea7[_0x8abd('0x6c')]){_0x1da591=path['join'](config[_0x8abd('0x68')],_0x575558,_[_0x8abd('0x69')](_0x8abd('0x6d')));}if(!fs[_0x8abd('0x66')](_0x1da591)){throw new db[(_0x8abd('0x6e'))][(_0x8abd('0x6f'))](_[_0x8abd('0x6b')](_0x8abd('0x65'))+'\x20not\x20found');}return _0x2fe240[_0x8abd('0x70')](_0x1da591);}})[_0x8abd('0x27')](handleError(_0x2fe240,null));};var utilLicense=require(_0x8abd('0x5d'));exports['getLogoLogin']=function(_0x48106e,_0x28ec52,_0x5a727d){var _0x3c0b0e=_0x8abd('0x5f');var _0x3640bf={'custom':![]};return utilLicense[_0x8abd('0x71')]()[_0x8abd('0x33')](function(_0x5443e6){if(_0x5443e6){_0x3640bf=_0x5443e6;}return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0x48106e[_0x8abd('0x51')]['id']},'attributes':['logo',_0x8abd('0x5c'),'preferred',_0x8abd('0x61'),_0x8abd('0x62'),_0x8abd('0x63'),_0x8abd('0x72'),'defaultFavicon'],'raw':!![]});})[_0x8abd('0x33')](handleEntityNotFound(_0x28ec52,null))[_0x8abd('0x33')](function(_0x5dfc78){if(_0x5dfc78){var _0x5c0b20=_0x5dfc78[_0x8abd('0x5c')]&&fs['existsSync'](path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x3c0b0e,_[_0x8abd('0x69')](_0x5dfc78[_0x8abd('0x5c')])))?path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x3c0b0e,_[_0x8abd('0x69')](_0x5dfc78['loginLogo'])):path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x3c0b0e,_[_0x8abd('0x69')]('default_loginLogo.svg'));var _0x3119ff='default'+_[_0x8abd('0x6b')](_0x8abd('0x5c'));if(_0x5dfc78[_0x3119ff]||!_0x3640bf[_0x8abd('0x6c')]){_0x5c0b20=path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x3c0b0e,_[_0x8abd('0x69')](_0x8abd('0x73')));}if(!fs[_0x8abd('0x66')](_0x5c0b20)){throw new db[(_0x8abd('0x6e'))][(_0x8abd('0x6f'))](_[_0x8abd('0x6b')]('loginLogo')+'\x20not\x20found');}return _0x28ec52['download'](_0x5c0b20);}})['catch'](handleError(_0x28ec52,null));};exports[_0x8abd('0x74')]=function(_0xdaf606,_0x25397d){return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0xdaf606['params']['id']},'attributes':[_0x8abd('0x75')]})['then'](respondWithResult(_0x25397d,null))[_0x8abd('0x27')](handleError(_0x25397d,null));};exports[_0x8abd('0x76')]=function(_0x252ebc,_0x344176,_0x12775f){if(_0x252ebc[_0x8abd('0x59')]&&_0x252ebc[_0x8abd('0x59')][_0x8abd('0x5a')]){_0x252ebc[_0x8abd('0x57')][_0x8abd('0x60')]=_0x252ebc[_0x8abd('0x59')]['filename'];}return db['Setting'][_0x8abd('0x55')]({'where':{'id':_0x252ebc[_0x8abd('0x51')]['id']}})['then'](handleEntityNotFound(_0x344176,null))[_0x8abd('0x33')](saveUpdates(_0x252ebc[_0x8abd('0x57')],null))[_0x8abd('0x33')](respondWithResult(_0x344176,null))['catch'](handleError(_0x344176,null));};var utilLicense=require(_0x8abd('0x5d'));exports[_0x8abd('0x77')]=function(_0x177f6b,_0x16a9ba,_0x334781){var _0x28ed63=_0x8abd('0x5f');var _0x13e392={'custom':![]};return utilLicense[_0x8abd('0x71')]()['then'](function(_0x2912bc){if(_0x2912bc){_0x13e392=_0x2912bc;}return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0x177f6b['params']['id']},'attributes':[_0x8abd('0x65'),'loginLogo',_0x8abd('0x60'),_0x8abd('0x61'),_0x8abd('0x62'),'defaultLoginLogo',_0x8abd('0x72'),_0x8abd('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x16a9ba,null))[_0x8abd('0x33')](function(_0x797ce5){if(_0x797ce5){var _0x28ec50=_0x797ce5[_0x8abd('0x60')]&&fs['existsSync'](path['join'](config[_0x8abd('0x68')],_0x28ed63,_['toLower'](_0x797ce5['preferred'])))?path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x28ed63,_[_0x8abd('0x69')](_0x797ce5[_0x8abd('0x60')])):path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x28ed63,_[_0x8abd('0x69')](_0x8abd('0x78')));var _0x5e3897=_0x8abd('0x6a')+_[_0x8abd('0x6b')]('preferred');if(_0x797ce5[_0x5e3897]||!_0x13e392[_0x8abd('0x6c')]||!_0x13e392[_0x8abd('0x60')]){_0x28ec50=path['join'](config[_0x8abd('0x68')],_0x28ed63,_['toLower'](_0x8abd('0x78')));}if(!fs[_0x8abd('0x66')](_0x28ec50)){throw new db['Sequelize'][(_0x8abd('0x6f'))](_[_0x8abd('0x6b')](_0x8abd('0x60'))+_0x8abd('0x79'));}return _0x16a9ba[_0x8abd('0x70')](_0x28ec50);}})[_0x8abd('0x27')](handleError(_0x16a9ba,null));};exports[_0x8abd('0x7a')]=function(_0x4be18f,_0x220541,_0x2c2cd5){if(_0x4be18f[_0x8abd('0x59')]&&_0x4be18f[_0x8abd('0x59')][_0x8abd('0x5a')]){_0x4be18f[_0x8abd('0x57')]['favicon']=_0x4be18f[_0x8abd('0x59')][_0x8abd('0x5a')];}return db['Setting'][_0x8abd('0x55')]({'where':{'id':_0x4be18f[_0x8abd('0x51')]['id']}})[_0x8abd('0x33')](handleEntityNotFound(_0x220541,null))['then'](saveUpdates(_0x4be18f[_0x8abd('0x57')],null))[_0x8abd('0x33')](respondWithResult(_0x220541,null))[_0x8abd('0x27')](handleError(_0x220541,null));};var utilLicense=require(_0x8abd('0x5d'));exports[_0x8abd('0x7b')]=function(_0x5a7d66,_0x274025,_0x4aa2f5){var _0x1bea0d=_0x8abd('0x5f');var _0xce3423={'custom':![]};return utilLicense[_0x8abd('0x71')]()[_0x8abd('0x33')](function(_0xa83f1e){if(_0xa83f1e){_0xce3423=_0xa83f1e;}return db[_0x8abd('0x3b')][_0x8abd('0x55')]({'where':{'id':_0x5a7d66[_0x8abd('0x51')]['id']},'attributes':[_0x8abd('0x65'),_0x8abd('0x5c'),'preferred',_0x8abd('0x61'),_0x8abd('0x62'),_0x8abd('0x63'),_0x8abd('0x72'),_0x8abd('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x274025,null))[_0x8abd('0x33')](function(_0x410dd3){if(_0x410dd3){var _0x1ce561=_0x410dd3['favicon']&&fs[_0x8abd('0x66')](path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x1bea0d,_['toLower'](_0x410dd3[_0x8abd('0x61')])))?path[_0x8abd('0x67')](config['root'],_0x1bea0d,_['toLower'](_0x410dd3[_0x8abd('0x61')])):path['join'](config['root'],_0x1bea0d,_['toLower'](_0x8abd('0x7c')));var _0x1f6c0e='default'+_[_0x8abd('0x6b')](_0x8abd('0x61'));if(_0x410dd3[_0x1f6c0e]||!_0xce3423[_0x8abd('0x6c')]){_0x1ce561=path[_0x8abd('0x67')](config[_0x8abd('0x68')],_0x1bea0d,_['toLower']('default_favicon.ico'));}if(!fs[_0x8abd('0x66')](_0x1ce561)){throw new db[(_0x8abd('0x6e'))][(_0x8abd('0x6f'))](_['upperFirst'](_0x8abd('0x61'))+_0x8abd('0x79'));}return _0x274025[_0x8abd('0x70')](_0x1ce561);}})[_0x8abd('0x27')](handleError(_0x274025,null));};exports[_0x8abd('0x7d')]=function(_0x44d9aa,_0x4fa8fb){var _0x4ed29c={'offset':moment()[_0x8abd('0x7e')]()};_0x4ed29c[_0x8abd('0x7f')]=moment()[_0x8abd('0x7e')](_0x4ed29c[_0x8abd('0x2b')])['format'](_0x8abd('0x80'));return _0x4fa8fb['status'](0xc8)[_0x8abd('0x38')](_0x4ed29c);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b4cdba5..cce3e92 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 _0x34e8=['settings','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports','Setting'];(function(_0x3766f3,_0x1bb93d){var _0x100f70=function(_0x1cbcce){while(--_0x1cbcce){_0x3766f3['push'](_0x3766f3['shift']());}};_0x100f70(++_0x1bb93d);}(_0x34e8,0x12c));var _0x834e=function(_0x5b6d43,_0x306ed4){_0x5b6d43=_0x5b6d43-0x0;var _0x15ea9c=_0x34e8[_0x5b6d43];return _0x15ea9c;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x45a85e,_0x292dd7){var _0x4c85b7=function(_0x10059f){while(--_0x10059f){_0x45a85e['push'](_0x45a85e['shift']());}};_0x4c85b7(++_0x292dd7);}(_0x008c,0x188));var _0xc008=function(_0x18a01c,_0xd1a13a){_0x18a01c=_0x18a01c-0x0;var _0x2b0cd6=_0x008c[_0x18a01c];return _0x2b0cd6;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 62f4d94..f881711 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 _0x2c7c=['debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Setting,\x20%s,\x20%s','message','catch','ShowSetting','find','options','raw','attributes','include','map','model','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2c7c,0xe8));var _0xc2c7=function(_0x14e894,_0x2924cf){_0x14e894=_0x14e894-0x0;var _0x3c3d72=_0x2c7c[_0x14e894];return _0x3c3d72;};'use strict';var _=require(_0xc2c7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc2c7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc2c7('0x2'));var db=require(_0xc2c7('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc2c7('0x4'));var config=require(_0xc2c7('0x5'));var jayson=require(_0xc2c7('0x6'));var client=jayson[_0xc2c7('0x7')][_0xc2c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbb24cd,_0x184566,_0x56676f){return new BPromise(function(_0x56c1da,_0x5493d6){return client['request'](_0xbb24cd,_0x56676f)[_0xc2c7('0x9')](function(_0x1af4aa){logger[_0xc2c7('0xa')]('Setting,\x20%s,\x20%s',_0x184566,'request\x20sent');logger[_0xc2c7('0xb')](_0xc2c7('0xc'),_0x184566,_0xc2c7('0xd'),JSON['stringify'](_0x1af4aa));if(_0x1af4aa['error']){if(_0x1af4aa[_0xc2c7('0xe')][_0xc2c7('0xf')]===0x1f4){logger['error'](_0xc2c7('0x10'),_0x184566,_0x1af4aa[_0xc2c7('0xe')][_0xc2c7('0x11')]);return _0x5493d6(_0x1af4aa['error'][_0xc2c7('0x11')]);}logger[_0xc2c7('0xe')]('Setting,\x20%s,\x20%s',_0x184566,_0x1af4aa[_0xc2c7('0xe')][_0xc2c7('0x11')]);return _0x56c1da(_0x1af4aa['error'][_0xc2c7('0x11')]);}else{logger['info'](_0xc2c7('0x10'),_0x184566,'request\x20sent');_0x56c1da(_0x1af4aa['result'][_0xc2c7('0x11')]);}})[_0xc2c7('0x12')](function(_0x3546c6){logger[_0xc2c7('0xe')](_0xc2c7('0x10'),_0x184566,_0x3546c6);_0x5493d6(_0x3546c6);});});}exports[_0xc2c7('0x13')]=function(_0x15c785){var _0x404956=this;return new Promise(function(_0x19f1b5,_0x5b1152){return db['Setting'][_0xc2c7('0x14')]({'raw':_0x15c785[_0xc2c7('0x15')]?_0x15c785[_0xc2c7('0x15')][_0xc2c7('0x16')]===undefined?!![]:![]:!![],'where':_0x15c785['options']?_0x15c785[_0xc2c7('0x15')]['where']||null:null,'attributes':_0x15c785[_0xc2c7('0x15')]?_0x15c785[_0xc2c7('0x15')][_0xc2c7('0x17')]||null:null,'include':_0x15c785['options']?_0x15c785[_0xc2c7('0x15')][_0xc2c7('0x18')]?_[_0xc2c7('0x19')](_0x15c785[_0xc2c7('0x15')][_0xc2c7('0x18')],function(_0x1eb4e4){return{'model':db[_0x1eb4e4[_0xc2c7('0x1a')]],'as':_0x1eb4e4['as'],'attributes':_0x1eb4e4[_0xc2c7('0x17')],'include':_0x1eb4e4[_0xc2c7('0x18')]?_[_0xc2c7('0x19')](_0x1eb4e4[_0xc2c7('0x18')],function(_0x4423ef){return{'model':db[_0x4423ef[_0xc2c7('0x1a')]],'as':_0x4423ef['as'],'attributes':_0x4423ef[_0xc2c7('0x17')],'include':_0x4423ef['include']?_[_0xc2c7('0x19')](_0x4423ef['include'],function(_0x2ec59b){return{'model':db[_0x2ec59b[_0xc2c7('0x1a')]],'as':_0x2ec59b['as'],'attributes':_0x2ec59b[_0xc2c7('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc2c7('0x9')](function(_0xef3744){logger['info'](_0xc2c7('0x13'),_0x15c785);logger[_0xc2c7('0xb')](_0xc2c7('0x13'),_0x15c785,JSON['stringify'](_0xef3744));_0x19f1b5(_0xef3744);})[_0xc2c7('0x12')](function(_0x1d1f8f){logger[_0xc2c7('0xe')](_0xc2c7('0x13'),_0x1d1f8f[_0xc2c7('0x11')],_0x15c785);_0x5b1152(_0x404956[_0xc2c7('0xe')](0x1f4,_0x1d1f8f['message']));});});}; \ No newline at end of file +var _0x6cc7=['Setting','find','options','raw','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSetting'];(function(_0x41cd47,_0x2e4c86){var _0x2ad6ba=function(_0x2097c2){while(--_0x2097c2){_0x41cd47['push'](_0x41cd47['shift']());}};_0x2ad6ba(++_0x2e4c86);}(_0x6cc7,0x168));var _0x76cc=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x6cc7[_0x101a17];return _0x3b76ee;};'use strict';var _=require(_0x76cc('0x0'));var util=require(_0x76cc('0x1'));var moment=require(_0x76cc('0x2'));var BPromise=require(_0x76cc('0x3'));var rs=require(_0x76cc('0x4'));var fs=require('fs');var Redis=require(_0x76cc('0x5'));var db=require(_0x76cc('0x6'))['db'];var utils=require(_0x76cc('0x7'));var logger=require(_0x76cc('0x8'))(_0x76cc('0x9'));var config=require(_0x76cc('0xa'));var jayson=require(_0x76cc('0xb'));var client=jayson['client'][_0x76cc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b4484,_0x51e6c0,_0x240670){return new BPromise(function(_0x149765,_0x3365c2){return client['request'](_0x1b4484,_0x240670)['then'](function(_0x4263bf){logger[_0x76cc('0xd')](_0x76cc('0xe'),_0x51e6c0,_0x76cc('0xf'));logger[_0x76cc('0x10')](_0x76cc('0x11'),_0x51e6c0,_0x76cc('0xf'),JSON['stringify'](_0x4263bf));if(_0x4263bf['error']){if(_0x4263bf[_0x76cc('0x12')][_0x76cc('0x13')]===0x1f4){logger['error'](_0x76cc('0xe'),_0x51e6c0,_0x4263bf[_0x76cc('0x12')]['message']);return _0x3365c2(_0x4263bf['error'][_0x76cc('0x14')]);}logger['error'](_0x76cc('0xe'),_0x51e6c0,_0x4263bf[_0x76cc('0x12')][_0x76cc('0x14')]);return _0x149765(_0x4263bf[_0x76cc('0x12')][_0x76cc('0x14')]);}else{logger[_0x76cc('0xd')]('Setting,\x20%s,\x20%s',_0x51e6c0,_0x76cc('0xf'));_0x149765(_0x4263bf[_0x76cc('0x15')][_0x76cc('0x14')]);}})[_0x76cc('0x16')](function(_0x507d80){logger[_0x76cc('0x12')](_0x76cc('0xe'),_0x51e6c0,_0x507d80);_0x3365c2(_0x507d80);});});}exports[_0x76cc('0x17')]=function(_0x457317){var _0x2b5e67=this;return new Promise(function(_0x5079d0,_0x468198){return db[_0x76cc('0x18')][_0x76cc('0x19')]({'raw':_0x457317[_0x76cc('0x1a')]?_0x457317[_0x76cc('0x1a')][_0x76cc('0x1b')]===undefined?!![]:![]:!![],'where':_0x457317[_0x76cc('0x1a')]?_0x457317[_0x76cc('0x1a')]['where']||null:null,'attributes':_0x457317[_0x76cc('0x1a')]?_0x457317['options'][_0x76cc('0x1c')]||null:null,'include':_0x457317[_0x76cc('0x1a')]?_0x457317[_0x76cc('0x1a')]['include']?_[_0x76cc('0x1d')](_0x457317['options'][_0x76cc('0x1e')],function(_0xb71894){return{'model':db[_0xb71894[_0x76cc('0x1f')]],'as':_0xb71894['as'],'attributes':_0xb71894[_0x76cc('0x1c')],'include':_0xb71894[_0x76cc('0x1e')]?_[_0x76cc('0x1d')](_0xb71894[_0x76cc('0x1e')],function(_0x2139cf){return{'model':db[_0x2139cf['model']],'as':_0x2139cf['as'],'attributes':_0x2139cf[_0x76cc('0x1c')],'include':_0x2139cf[_0x76cc('0x1e')]?_[_0x76cc('0x1d')](_0x2139cf['include'],function(_0x2744f7){return{'model':db[_0x2744f7[_0x76cc('0x1f')]],'as':_0x2744f7['as'],'attributes':_0x2744f7[_0x76cc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e51ad){logger[_0x76cc('0xd')](_0x76cc('0x17'),_0x457317);logger[_0x76cc('0x10')](_0x76cc('0x17'),_0x457317,JSON['stringify'](_0x3e51ad));_0x5079d0(_0x3e51ad);})['catch'](function(_0x31c22f){logger[_0x76cc('0x12')](_0x76cc('0x17'),_0x31c22f[_0x76cc('0x14')],_0x457317);_0x468198(_0x2b5e67[_0x76cc('0x12')](0x1f4,_0x31c22f[_0x76cc('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index eedd57b..f863d8e 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(_0x13bfed,_0x3dce7d){var _0x1caef7=function(_0x7cf704){while(--_0x7cf704){_0x13bfed['push'](_0x13bfed['shift']());}};_0x1caef7(++_0x3dce7d);}(_0x7a54,0x106));var _0x47a5=function(_0x35287f,_0x1bcc14){_0x35287f=_0x35287f-0x0;var _0x1d37c6=_0x7a54[_0x35287f];return _0x1d37c6;};'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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x5498b8,_0x3fd10c){var _0x13c31c=function(_0x1ecf6f){while(--_0x1ecf6f){_0x5498b8['push'](_0x5498b8['shift']());}};_0x13c31c(++_0x3fd10c);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 6048b72..1d5381a 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 _0x9ca2=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','ENUM','twilio','skebby','connectel','clicksend','plivo','bandwidth','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0x9ca2,0x81));var _0x29ca=function(_0x2d221f,_0x3d02fd){_0x2d221f=_0x2d221f-0x0;var _0x13f219=_0x9ca2[_0x2d221f];return _0x13f219;};'use strict';var Sequelize=require(_0x29ca('0x0'));var rs=require(_0x29ca('0x1'));module[_0x29ca('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x29ca('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x29ca('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x29ca('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x29ca('0x4')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x29ca('0x4')]},'type':{'type':Sequelize[_0x29ca('0x5')](_0x29ca('0x6'),_0x29ca('0x7'),_0x29ca('0x8'),_0x29ca('0x9'),_0x29ca('0xa'),'clickatell',_0x29ca('0xb'),_0x29ca('0xc'),'infobip',_0x29ca('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x29ca('0x4')]},'authToken':{'type':Sequelize[_0x29ca('0x4')]},'smsMethod':{'type':Sequelize[_0x29ca('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0x29ca('0x4')]},'senderString':{'type':Sequelize[_0x29ca('0x4')]},'deliveryReport':{'type':Sequelize[_0x29ca('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x29ca('0x4')]},'notificationTemplate':{'type':Sequelize[_0x29ca('0xf')],'defaultValue':function(){return _0x29ca('0x10');}},'notificationSound':{'type':Sequelize[_0x29ca('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x29ca('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x29ca('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x29ca('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x29ca('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x29ca('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x29ca('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x29ca('0xe')],'defaultValue':![],'comment':_0x29ca('0x12'),'set':function(_0x5516a2){if(!_0x5516a2)this['setDataValue'](_0x29ca('0x13'),null);this['setDataValue'](_0x29ca('0x14'),_0x5516a2);}}}; \ No newline at end of file +var _0xe983=['mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio','clicksend','plivo','clickatell','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x12fec1,_0x20be9c){var _0x26c3af=function(_0xedc7c6){while(--_0xedc7c6){_0x12fec1['push'](_0x12fec1['shift']());}};_0x26c3af(++_0x20be9c);}(_0xe983,0x9a));var _0x3e98=function(_0x4812e9,_0x4a9129){_0x4812e9=_0x4812e9-0x0;var _0x126354=_0xe983[_0x4812e9];return _0x126354;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3e98('0x0'));module[_0x3e98('0x1')]={'name':{'type':Sequelize[_0x3e98('0x2')],'unique':_0x3e98('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3e98('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3e98('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3e98('0x2')],'defaultValue':function(){return rs[_0x3e98('0x4')]();}},'phone':{'type':Sequelize[_0x3e98('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3e98('0x5'),'skebby','connectel',_0x3e98('0x6'),_0x3e98('0x7'),_0x3e98('0x8'),'bandwidth',_0x3e98('0x9'),_0x3e98('0xa'),_0x3e98('0xb'))},'accountSid':{'type':Sequelize[_0x3e98('0x2')]},'authId':{'type':Sequelize[_0x3e98('0x2')]},'authToken':{'type':Sequelize[_0x3e98('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x3e98('0x2')]},'password':{'type':Sequelize[_0x3e98('0x2')]},'apiKey':{'type':Sequelize[_0x3e98('0x2')]},'applicationId':{'type':Sequelize[_0x3e98('0x2')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x3e98('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3e98('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3e98('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3e98('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3e98('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3e98('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3e98('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3e98('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3e98('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3e98('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3e98('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x3e98('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3e98('0xe')],'comment':_0x3e98('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x3e98('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x280753){if(!_0x280753)this[_0x3e98('0x10')](_0x3e98('0x11'),null);this[_0x3e98('0x10')](_0x3e98('0x12'),_0x280753);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 729f2ec..0e4ec93 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 _0x5d1e=['code','message','SmsAccount,\x20%s,\x20%s','info','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','count','includeAll','include','findAll','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','notify','sms','SmsApplication','Applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','sender','text','connectel','clicksend','message_id','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','omit','Contacts','SmsInteraction','spread','interaction','created','autoclose','applications','push','close','*,*,*,*','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','queueId','SmsQueue','unshift','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','send','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','CmList','DESC','List','out','dataValues','Messages','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','error_code','DELIVERED','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x504d70,_0x143d63){var _0x102fe8=function(_0x5ef594){while(--_0x5ef594){_0x504d70['push'](_0x504d70['shift']());}};_0x102fe8(++_0x143d63);}(_0x5d1e,0xc0));var _0xe5d1=function(_0xd90cdf,_0x1bc824){_0xd90cdf=_0xd90cdf-0x0;var _0x40df86=_0x5d1e[_0xd90cdf];return _0x40df86;};'use strict';var emlformat=require(_0xe5d1('0x0'));var rimraf=require(_0xe5d1('0x1'));var zipdir=require(_0xe5d1('0x2'));var jsonpatch=require(_0xe5d1('0x3'));var rp=require(_0xe5d1('0x4'));var moment=require('moment');var BPromise=require(_0xe5d1('0x5'));var Mustache=require(_0xe5d1('0x6'));var util=require(_0xe5d1('0x7'));var path=require(_0xe5d1('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe5d1('0x9'));var _=require(_0xe5d1('0xa'));var squel=require(_0xe5d1('0xb'));var crypto=require(_0xe5d1('0xc'));var jsforce=require(_0xe5d1('0xd'));var deskjs=require(_0xe5d1('0xe'));var toCsv=require(_0xe5d1('0xf'));var querystring=require(_0xe5d1('0x10'));var Papa=require('papaparse');var Redis=require(_0xe5d1('0x11'));var authService=require(_0xe5d1('0x12'));var qs=require(_0xe5d1('0x13'));var as=require(_0xe5d1('0x14'));var hardwareService=require(_0xe5d1('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe5d1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe5d1('0x17'))['db'];config[_0xe5d1('0x18')]=_[_0xe5d1('0x19')](config[_0xe5d1('0x18')],{'host':_0xe5d1('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5d1('0x18')]));require(_0xe5d1('0x1b'))[_0xe5d1('0x1c')](socket);var jayson=require(_0xe5d1('0x1d'));var client=jayson[_0xe5d1('0x1e')][_0xe5d1('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x417404,_0x5a8dbc,_0xda5231,_0x5b0689){return new BPromise(function(_0x2d3667,_0x430232){var _0x9ef2fa=_0x5b0689||client;return _0x9ef2fa[_0xe5d1('0x20')](_0x417404,_0xda5231)[_0xe5d1('0x21')](function(_0x1f38fc){logger['info']('SmsAccount,\x20%s,\x20%s',_0x5a8dbc,'request\x20sent');logger[_0xe5d1('0x22')](_0xe5d1('0x23'),_0x5a8dbc,_0xe5d1('0x24'),JSON[_0xe5d1('0x25')](_0x1f38fc));if(_0x1f38fc[_0xe5d1('0x26')]){if(_0x1f38fc['error'][_0xe5d1('0x27')]===0x1f4){logger[_0xe5d1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5a8dbc,_0x1f38fc['error'][_0xe5d1('0x28')]);return _0x430232(_0x1f38fc[_0xe5d1('0x26')][_0xe5d1('0x28')]);}logger['error'](_0xe5d1('0x29'),_0x5a8dbc,_0x1f38fc[_0xe5d1('0x26')][_0xe5d1('0x28')]);return _0x2d3667(_0x1f38fc[_0xe5d1('0x26')][_0xe5d1('0x28')]);}else{logger[_0xe5d1('0x2a')](_0xe5d1('0x29'),_0x5a8dbc,'request\x20sent');_0x2d3667(_0x1f38fc['result']['message']);}})[_0xe5d1('0x2b')](function(_0x267697){logger[_0xe5d1('0x26')]('SmsAccount,\x20%s,\x20%s',_0x5a8dbc,_0x267697);_0x430232(_0x267697);});});}function respondWithStatusCode(_0x24569f,_0x1014fc){_0x1014fc=_0x1014fc||0xcc;return function(_0x20852b){if(_0x20852b){return _0x24569f[_0xe5d1('0x2c')](_0x1014fc);}return _0x24569f[_0xe5d1('0x2d')](_0x1014fc)[_0xe5d1('0x2e')]();};}function respondWithResult(_0x1c08c1,_0x17f2b6){_0x17f2b6=_0x17f2b6||0xc8;return function(_0x669ddf){if(_0x669ddf){return _0x1c08c1[_0xe5d1('0x2d')](_0x17f2b6)[_0xe5d1('0x2f')](_0x669ddf);}};}function respondWithFilteredResult(_0x7b3c2d,_0x4da6dc){return function(_0x25bca3){if(_0x25bca3){var _0x365a44=typeof _0x4da6dc[_0xe5d1('0x30')]===_0xe5d1('0x31')&&typeof _0x4da6dc[_0xe5d1('0x32')]==='undefined';var _0x5c061c=_0x25bca3['count'];var _0x3933db=_0x365a44?0x0:_0x4da6dc[_0xe5d1('0x30')];var _0x12480d=_0x365a44?_0x25bca3['count']:_0x4da6dc[_0xe5d1('0x30')]+_0x4da6dc['limit'];var _0x287efd;if(_0x12480d>=_0x5c061c){_0x12480d=_0x5c061c;_0x287efd=0xc8;}else{_0x287efd=0xce;}_0x7b3c2d['status'](_0x287efd);return _0x7b3c2d[_0xe5d1('0x33')](_0xe5d1('0x34'),_0x3933db+'-'+_0x12480d+'/'+_0x5c061c)[_0xe5d1('0x2f')](_0x25bca3);}return null;};}function patchUpdates(_0x5e4f93){return function(_0x44cbc5){try{jsonpatch[_0xe5d1('0x35')](_0x44cbc5,_0x5e4f93,!![]);}catch(_0x200947){return BPromise[_0xe5d1('0x36')](_0x200947);}return _0x44cbc5[_0xe5d1('0x37')]();};}function saveUpdates(_0x504961,_0x306acf){return function(_0x280509){if(_0x280509){return _0x280509[_0xe5d1('0x38')](_0x504961)[_0xe5d1('0x21')](function(_0x5c691e){return _0x5c691e;});}return null;};}function removeEntity(_0x2ef517,_0x498f06){return function(_0x5256ae){if(_0x5256ae){return _0x5256ae[_0xe5d1('0x39')]()[_0xe5d1('0x21')](function(){var _0x3f75d9=_0x5256ae[_0xe5d1('0x3a')]({'plain':!![]});var _0x525a3b=_0xe5d1('0x3b');return db[_0xe5d1('0x3c')][_0xe5d1('0x39')]({'where':{'type':_0x525a3b,'resourceId':_0x3f75d9['id']}})[_0xe5d1('0x21')](function(){return _0x5256ae;});})['then'](function(){_0x2ef517[_0xe5d1('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a2de0,_0x553bb8){return function(_0x52e92e){if(!_0x52e92e){_0x4a2de0[_0xe5d1('0x2c')](0x194);}return _0x52e92e;};}function handleError(_0x807981,_0x26c363){_0x26c363=_0x26c363||0x1f4;return function(_0x37e4f1){logger[_0xe5d1('0x26')](_0x37e4f1[_0xe5d1('0x3d')]);if(_0x37e4f1[_0xe5d1('0x3e')]){delete _0x37e4f1[_0xe5d1('0x3e')];}_0x807981[_0xe5d1('0x2d')](_0x26c363)['send'](_0x37e4f1);};}exports['index']=function(_0x361b6c,_0x558a05){var _0x2d3fe7={'include':[{'model':db[_0xe5d1('0x3f')],'as':_0xe5d1('0x40')}]},_0x10691f={},_0x25b9fc={'count':0x0,'rows':[]};var _0xad33d0=_[_0xe5d1('0x41')](db[_0xe5d1('0x42')][_0xe5d1('0x43')],function(_0x4b6fa7){return{'name':_0x4b6fa7[_0xe5d1('0x44')],'type':_0x4b6fa7[_0xe5d1('0x45')][_0xe5d1('0x46')]};});_0x10691f[_0xe5d1('0x47')]=_[_0xe5d1('0x41')](_0xad33d0,'name');_0x10691f['query']=_[_0xe5d1('0x48')](_0x361b6c[_0xe5d1('0x49')]);_0x10691f[_0xe5d1('0x4a')]=_[_0xe5d1('0x4b')](_0x10691f[_0xe5d1('0x47')],_0x10691f[_0xe5d1('0x49')]);_0x2d3fe7[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x10691f[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0x2d3fe7[_0xe5d1('0x4c')]=_0x2d3fe7[_0xe5d1('0x4c')][_0xe5d1('0x4e')]?_0x2d3fe7[_0xe5d1('0x4c')]:_0x10691f[_0xe5d1('0x47')];if(!_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x4f')](_0xe5d1('0x50'))){_0x2d3fe7['limit']=qs[_0xe5d1('0x32')](_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x32')]);_0x2d3fe7[_0xe5d1('0x30')]=qs[_0xe5d1('0x30')](_0x361b6c['query']['offset']);}_0x2d3fe7[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x52')]);_0x2d3fe7['where']=qs[_0xe5d1('0x4a')](_[_0xe5d1('0x53')](_0x361b6c[_0xe5d1('0x49')],_0x10691f[_0xe5d1('0x4a')]),_0xad33d0);if(_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x54')]){_0x2d3fe7[_0xe5d1('0x55')]=_['merge'](_0x2d3fe7[_0xe5d1('0x55')],{'$or':_['map'](_0xad33d0,function(_0x4bbe9a){if(_0x4bbe9a[_0xe5d1('0x45')]!==_0xe5d1('0x56')){var _0x206ed3={};_0x206ed3[_0x4bbe9a['name']]={'$like':'%'+_0x361b6c[_0xe5d1('0x49')][_0xe5d1('0x54')]+'%'};return _0x206ed3;}})});}_0x2d3fe7=_[_0xe5d1('0x57')]({},_0x2d3fe7,_0x361b6c['options']);var _0x3650d8={'where':_0x2d3fe7[_0xe5d1('0x55')]};return db[_0xe5d1('0x42')]['count'](_0x3650d8)[_0xe5d1('0x21')](function(_0x4ef3f1){_0x25b9fc[_0xe5d1('0x58')]=_0x4ef3f1;if(_0x361b6c['query'][_0xe5d1('0x59')]){_0x2d3fe7[_0xe5d1('0x5a')]=[{'all':!![]}];}return db[_0xe5d1('0x42')][_0xe5d1('0x5b')](_0x2d3fe7);})['then'](function(_0x252da9){_0x25b9fc[_0xe5d1('0x5c')]=_0x252da9;return _0x25b9fc;})[_0xe5d1('0x21')](respondWithFilteredResult(_0x558a05,_0x2d3fe7))[_0xe5d1('0x2b')](handleError(_0x558a05,null));};exports['show']=function(_0x48bb1c,_0x9582f6){var _0x57add1={'raw':![],'where':{'id':_0x48bb1c[_0xe5d1('0x5d')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x592187={};_0x592187['model']=_[_0xe5d1('0x48')](db[_0xe5d1('0x42')][_0xe5d1('0x43')]);_0x592187['query']=_[_0xe5d1('0x48')](_0x48bb1c['query']);_0x592187[_0xe5d1('0x4a')]=_[_0xe5d1('0x4b')](_0x592187[_0xe5d1('0x47')],_0x592187[_0xe5d1('0x49')]);_0x57add1[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x592187[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x48bb1c['query']['fields']));_0x57add1[_0xe5d1('0x4c')]=_0x57add1[_0xe5d1('0x4c')]['length']?_0x57add1[_0xe5d1('0x4c')]:_0x592187['model'];if(_0x48bb1c[_0xe5d1('0x49')][_0xe5d1('0x59')]){_0x57add1[_0xe5d1('0x5a')]=[{'all':!![]}];}_0x57add1=_[_0xe5d1('0x57')]({},_0x57add1,_0x48bb1c[_0xe5d1('0x5e')]);return db[_0xe5d1('0x42')][_0xe5d1('0x5f')](_0x57add1)['then'](handleEntityNotFound(_0x9582f6,null))[_0xe5d1('0x21')](respondWithResult(_0x9582f6,null))[_0xe5d1('0x2b')](handleError(_0x9582f6,null));};exports[_0xe5d1('0x60')]=function(_0x57a1ca,_0x149d1d){return db[_0xe5d1('0x42')][_0xe5d1('0x60')](_0x57a1ca[_0xe5d1('0x61')],{})['then'](function(_0xc76db0){var _0x5910ac=_0x57a1ca[_0xe5d1('0x62')][_0xe5d1('0x3a')]({'plain':!![]});if(!_0x5910ac)throw new Error(_0xe5d1('0x63'));if(_0x5910ac[_0xe5d1('0x64')]===_0xe5d1('0x62')){var _0x3fa39e=_0xc76db0['get']({'plain':!![]});var _0x4cb658='SmsAccounts';return db[_0xe5d1('0x65')][_0xe5d1('0x5f')]({'where':{'name':_0x4cb658,'userProfileId':_0x5910ac['userProfileId']},'raw':!![]})[_0xe5d1('0x21')](function(_0x38cd46){if(_0x38cd46&&_0x38cd46[_0xe5d1('0x66')]===0x0){return db['UserProfileResource']['create']({'name':_0x3fa39e[_0xe5d1('0x3e')],'resourceId':_0x3fa39e['id'],'type':_0x38cd46[_0xe5d1('0x3e')],'sectionId':_0x38cd46['id']},{})['then'](function(){return _0xc76db0;});}else{return _0xc76db0;}})[_0xe5d1('0x2b')](function(_0x446eca){logger[_0xe5d1('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446eca);throw _0x446eca;});}return _0xc76db0;})[_0xe5d1('0x21')](respondWithResult(_0x149d1d,0xc9))[_0xe5d1('0x2b')](handleError(_0x149d1d,null));};exports[_0xe5d1('0x38')]=function(_0xe11d9a,_0x44b6f8){if(_0xe11d9a[_0xe5d1('0x61')]['id']){delete _0xe11d9a['body']['id'];}return db['SmsAccount'][_0xe5d1('0x5f')]({'where':{'id':_0xe11d9a['params']['id']},'include':[{'model':db[_0xe5d1('0x3f')],'as':_0xe5d1('0x40')}]})[_0xe5d1('0x21')](handleEntityNotFound(_0x44b6f8,null))[_0xe5d1('0x21')](saveUpdates(_0xe11d9a[_0xe5d1('0x61')],null))[_0xe5d1('0x21')](respondWithResult(_0x44b6f8,null))[_0xe5d1('0x2b')](handleError(_0x44b6f8,null));};exports[_0xe5d1('0x39')]=function(_0x54c340,_0x2fcb96){return db['SmsAccount']['find']({'where':{'id':_0x54c340[_0xe5d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x2fcb96,null))[_0xe5d1('0x21')](removeEntity(_0x2fcb96,null))[_0xe5d1('0x2b')](handleError(_0x2fcb96,null));};exports[_0xe5d1('0x67')]=function(_0xc16b52,_0x4029ba){return db[_0xe5d1('0x42')][_0xe5d1('0x67')]()[_0xe5d1('0x21')](respondWithResult(_0x4029ba,null))[_0xe5d1('0x2b')](handleError(_0x4029ba,null));};exports[_0xe5d1('0x68')]=function(_0x46a9d8,_0x2b9b30,_0x211c7d){if(_0x46a9d8[_0xe5d1('0x61')]['id']){delete _0x46a9d8[_0xe5d1('0x61')]['id'];}return db['SmsAccount'][_0xe5d1('0x5f')]({'where':{'id':_0x46a9d8[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x2b9b30,null))['then'](function(_0x4c2f05){if(_0x4c2f05){_0x46a9d8[_0xe5d1('0x61')][_0xe5d1('0x69')]=_0x4c2f05['id'];return db['Disposition'][_0xe5d1('0x60')](_0x46a9d8['body']);}})[_0xe5d1('0x21')](respondWithResult(_0x2b9b30,null))['catch'](handleError(_0x2b9b30,null));};exports[_0xe5d1('0x6a')]=function(_0x12587c,_0x336f18,_0x35cb98){var _0xc48b1b={'raw':![],'where':{}};var _0x571d65={};var _0xe09dd5={'count':0x0,'rows':[]};return db[_0xe5d1('0x42')][_0xe5d1('0x6b')]({'where':{'id':_0x12587c[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x336f18,null))[_0xe5d1('0x21')](function(_0x2928cc){if(_0x2928cc){_0x571d65[_0xe5d1('0x47')]=_[_0xe5d1('0x48')](db[_0xe5d1('0x6c')][_0xe5d1('0x43')]);_0x571d65[_0xe5d1('0x49')]=_[_0xe5d1('0x48')](_0x12587c[_0xe5d1('0x49')]);_0x571d65['filters']=_[_0xe5d1('0x4b')](_0x571d65[_0xe5d1('0x47')],_0x571d65[_0xe5d1('0x49')]);_0xc48b1b[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x571d65[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x12587c[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0xc48b1b[_0xe5d1('0x4c')]=_0xc48b1b[_0xe5d1('0x4c')][_0xe5d1('0x4e')]?_0xc48b1b[_0xe5d1('0x4c')]:_0x571d65[_0xe5d1('0x47')];if(!_0x12587c[_0xe5d1('0x49')][_0xe5d1('0x4f')](_0xe5d1('0x50'))){_0xc48b1b['limit']=qs[_0xe5d1('0x32')](_0x12587c[_0xe5d1('0x49')]['limit']);_0xc48b1b[_0xe5d1('0x30')]=qs['offset'](_0x12587c[_0xe5d1('0x49')][_0xe5d1('0x30')]);}_0xc48b1b[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0x12587c[_0xe5d1('0x49')]['sort']);_0xc48b1b[_0xe5d1('0x55')]=qs[_0xe5d1('0x4a')](_[_0xe5d1('0x53')](_0x12587c[_0xe5d1('0x49')],_0x571d65[_0xe5d1('0x4a')]));_0xc48b1b[_0xe5d1('0x55')][_0xe5d1('0x69')]=_0x2928cc['id'];if(_0x12587c['query'][_0xe5d1('0x54')]){_0xc48b1b[_0xe5d1('0x55')]=_['merge'](_0xc48b1b[_0xe5d1('0x55')],{'$or':_['map'](_0xc48b1b[_0xe5d1('0x4c')],function(_0x4fc6eb){var _0x48c68d={};_0x48c68d[_0x4fc6eb]={'$like':'%'+_0x12587c[_0xe5d1('0x49')][_0xe5d1('0x54')]+'%'};return _0x48c68d;})});}_0xc48b1b=_[_0xe5d1('0x57')]({},_0xc48b1b,_0x12587c['options']);return db[_0xe5d1('0x6c')][_0xe5d1('0x58')]({'where':_0xc48b1b[_0xe5d1('0x55')]})[_0xe5d1('0x21')](function(_0x326e3a){_0xe09dd5[_0xe5d1('0x58')]=_0x326e3a;if(_0x12587c[_0xe5d1('0x49')][_0xe5d1('0x59')]){_0xc48b1b['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0xc48b1b);})[_0xe5d1('0x21')](function(_0xbd6e1){_0xe09dd5['rows']=_0xbd6e1;return _0xe09dd5;});}})[_0xe5d1('0x21')](respondWithFilteredResult(_0x336f18,_0xc48b1b))[_0xe5d1('0x2b')](handleError(_0x336f18,null));};exports[_0xe5d1('0x6d')]=function(_0x3a56b9,_0x6327b3,_0x7c0762){return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x3a56b9[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x6327b3,null))[_0xe5d1('0x21')](function(_0x5b4d8f){if(_0x5b4d8f){return _0x5b4d8f[_0xe5d1('0x6d')](_0x3a56b9[_0xe5d1('0x49')][_0xe5d1('0x6e')]);}})[_0xe5d1('0x21')](respondWithStatusCode(_0x6327b3,null))[_0xe5d1('0x2b')](handleError(_0x6327b3,null));};exports[_0xe5d1('0x6f')]=function(_0x14df3d,_0xa81fdd,_0x304d7d){if(_0x14df3d[_0xe5d1('0x61')]['id']){delete _0x14df3d[_0xe5d1('0x61')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x14df3d[_0xe5d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0xa81fdd,null))['then'](function(_0x1dd688){if(_0x1dd688){_0x14df3d[_0xe5d1('0x61')][_0xe5d1('0x69')]=_0x1dd688['id'];return db['CannedAnswer']['create'](_0x14df3d[_0xe5d1('0x61')]);}})[_0xe5d1('0x21')](respondWithResult(_0xa81fdd,null))[_0xe5d1('0x2b')](handleError(_0xa81fdd,null));};exports['getAnswers']=function(_0xa1b497,_0xebbb5c,_0x3c53cf){var _0x34e2e5={'raw':![],'where':{}};var _0x1ad15b={};var _0x4b44e1={'count':0x0,'rows':[]};return db[_0xe5d1('0x42')]['findOne']({'where':{'id':_0xa1b497[_0xe5d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0xebbb5c,null))['then'](function(_0x281165){if(_0x281165){_0x1ad15b[_0xe5d1('0x47')]=_[_0xe5d1('0x48')](db[_0xe5d1('0x70')][_0xe5d1('0x43')]);_0x1ad15b[_0xe5d1('0x49')]=_[_0xe5d1('0x48')](_0xa1b497[_0xe5d1('0x49')]);_0x1ad15b[_0xe5d1('0x4a')]=_[_0xe5d1('0x4b')](_0x1ad15b[_0xe5d1('0x47')],_0x1ad15b['query']);_0x34e2e5['attributes']=_['intersection'](_0x1ad15b[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0x34e2e5[_0xe5d1('0x4c')]=_0x34e2e5[_0xe5d1('0x4c')][_0xe5d1('0x4e')]?_0x34e2e5['attributes']:_0x1ad15b[_0xe5d1('0x47')];if(!_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x4f')](_0xe5d1('0x50'))){_0x34e2e5['limit']=qs[_0xe5d1('0x32')](_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x32')]);_0x34e2e5[_0xe5d1('0x30')]=qs['offset'](_0xa1b497['query'][_0xe5d1('0x30')]);}_0x34e2e5[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x52')]);_0x34e2e5['where']=qs[_0xe5d1('0x4a')](_[_0xe5d1('0x53')](_0xa1b497[_0xe5d1('0x49')],_0x1ad15b['filters']));_0x34e2e5[_0xe5d1('0x55')][_0xe5d1('0x69')]=_0x281165['id'];if(_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x54')]){_0x34e2e5[_0xe5d1('0x55')]=_[_0xe5d1('0x57')](_0x34e2e5['where'],{'$or':_[_0xe5d1('0x41')](_0x34e2e5['attributes'],function(_0x22939a){var _0x33b739={};_0x33b739[_0x22939a]={'$like':'%'+_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x54')]+'%'};return _0x33b739;})});}_0x34e2e5=_[_0xe5d1('0x57')]({},_0x34e2e5,_0xa1b497[_0xe5d1('0x5e')]);return db[_0xe5d1('0x70')][_0xe5d1('0x58')]({'where':_0x34e2e5[_0xe5d1('0x55')]})[_0xe5d1('0x21')](function(_0x49bb35){_0x4b44e1[_0xe5d1('0x58')]=_0x49bb35;if(_0xa1b497[_0xe5d1('0x49')][_0xe5d1('0x59')]){_0x34e2e5[_0xe5d1('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe5d1('0x5b')](_0x34e2e5);})[_0xe5d1('0x21')](function(_0x563c9b){_0x4b44e1[_0xe5d1('0x5c')]=_0x563c9b;return _0x4b44e1;});}})[_0xe5d1('0x21')](respondWithFilteredResult(_0xebbb5c,_0x34e2e5))[_0xe5d1('0x2b')](handleError(_0xebbb5c,null));};exports[_0xe5d1('0x71')]=function(_0x79dde7,_0x4a7063,_0x45dc83){return db[_0xe5d1('0x42')]['find']({'where':{'id':_0x79dde7[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x4a7063,null))['then'](function(_0x5aba9a){if(_0x5aba9a){return _0x5aba9a['removeAnswers'](_0x79dde7[_0xe5d1('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x4a7063,null))[_0xe5d1('0x2b')](handleError(_0x4a7063,null));};exports[_0xe5d1('0x72')]=function(_0x58eb88,_0x18c69d,_0x195a80){var _0x1099bc={'channel':_0xe5d1('0x73')};var _0x4fde26=[];var _0x2bbf9c=[];var _0x1f3372={};return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x58eb88[_0xe5d1('0x5d')]['id']},'include':[{'model':db[_0xe5d1('0x74')],'as':_0xe5d1('0x75')}]})[_0xe5d1('0x21')](handleEntityNotFound(_0x18c69d,null))[_0xe5d1('0x21')](function(_0x195199){_0x1099bc['account']=_0x195199;_0x1099bc['applications']=_[_0xe5d1('0x76')](_0x195199[_0xe5d1('0x75')],[_0xe5d1('0x77')],[_0xe5d1('0x78')]);if(_0x1099bc[_0xe5d1('0x79')]['Applications']){delete _0x1099bc['account'][_0xe5d1('0x75')];}return db[_0xe5d1('0x7a')][_0xe5d1('0x67')]();})[_0xe5d1('0x21')](function(_0x1048a2){if(!_0x1048a2){throw new db[(_0xe5d1('0x7b'))][(_0xe5d1('0x7c'))]('no\x20available\x20attributes');}_0x4fde26=_[_0xe5d1('0x7d')](_[_0xe5d1('0x48')](_0x1048a2),[_0xe5d1('0x7e'),_0xe5d1('0x7f')]);_0x2bbf9c=_[_0xe5d1('0x7d')](_['keys'](_0x1048a2),['createdAt',_0xe5d1('0x7f'),_0xe5d1('0x80'),_0xe5d1('0x81')]);_0x1099bc[_0xe5d1('0x61')]={'mapKey':_0xe5d1('0x82')};if(_0x1099bc[_0xe5d1('0x79')]['type']){switch(_0x1099bc[_0xe5d1('0x79')][_0xe5d1('0x45')]){case _0xe5d1('0x83'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x85')];_0x1099bc['body'][_0xe5d1('0x61')]=_0x58eb88['body'][_0xe5d1('0x86')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x87')]=_0x58eb88[_0xe5d1('0x61')]['MessageSid'];break;case'skebby':_0x1099bc[_0xe5d1('0x61')]['from']='+'+_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x88')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88['body'][_0xe5d1('0x89')];break;case _0xe5d1('0x8a'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')]['from'];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x28')];break;case _0xe5d1('0x8b'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]=_0x58eb88['body'][_0xe5d1('0x84')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x61')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x87')]=_0x58eb88['body'][_0xe5d1('0x8c')];break;case'plivo':_0x1099bc['body'][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')]['From'];_0x1099bc['body']['body']=_0x58eb88['body'][_0xe5d1('0x8d')];_0x1099bc['body'][_0xe5d1('0x87')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x8e')];break;case _0xe5d1('0x8f'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]='+'+_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x90')][0x0][_0xe5d1('0x84')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88['body']['results'][0x0][_0xe5d1('0x89')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x87')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x90')][0x0][_0xe5d1('0x87')];break;case _0xe5d1('0x91'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')]['originatingAddress'];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x92')][_0xe5d1('0x28')];break;case _0xe5d1('0x93'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')]=_0x58eb88['body'][_0xe5d1('0x94')];_0x1099bc['body'][_0xe5d1('0x61')]=_0x58eb88['body'][_0xe5d1('0x89')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x87')]=_0x58eb88['body']['replyMessageId'];break;case _0xe5d1('0x95'):_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x87')]=_0x58eb88[_0xe5d1('0x61')][0x0][_0xe5d1('0x28')]['id'];_0x1099bc['body'][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')][0x0]['message'][_0xe5d1('0x84')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88['body'][0x0]['message'][_0xe5d1('0x89')];break;case _0xe5d1('0x96'):_0x1099bc['body'][_0xe5d1('0x84')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x84')];_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')]=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x28')];_0x1099bc[_0xe5d1('0x61')]['messageId']=_0x58eb88[_0xe5d1('0x61')][_0xe5d1('0x97')];break;}}if(_0x1099bc[_0xe5d1('0x61')]['id']){delete _0x1099bc[_0xe5d1('0x61')]['id'];}if(_[_0xe5d1('0x98')](_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')])){throw new db[(_0xe5d1('0x7b'))][(_0xe5d1('0x7c'))](_0xe5d1('0x99'));}if(_[_0xe5d1('0x98')](_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')])||_0x1099bc[_0xe5d1('0x61')]['body']===''){throw new db['Sequelize'][(_0xe5d1('0x7c'))](_0xe5d1('0x9a'));}if(_['isNil'](_0x1099bc[_0xe5d1('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bbf9c);}if(!_[_0xe5d1('0x9b')](_0x2bbf9c,_0x1099bc[_0xe5d1('0x61')]['mapKey'])){throw new db[(_0xe5d1('0x7b'))][(_0xe5d1('0x7c'))](_0xe5d1('0x9c')+_0x2bbf9c);}_0x1f3372[_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x9d')]]=_0x1099bc[_0xe5d1('0x61')]['from'];return db['CmList'][_0xe5d1('0x5f')]({'where':{'id':_0x1099bc[_0xe5d1('0x79')][_0xe5d1('0x81')]},'include':[{'model':db[_0xe5d1('0x7a')],'as':'Contacts','where':_0x1f3372,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x18c69d,null))[_0xe5d1('0x21')](function(_0x32466a){if(_0x32466a){_0x1099bc['list']=_[_0xe5d1('0x9e')](_0x32466a,[_0xe5d1('0x9f')]);if(_0x32466a[_0xe5d1('0x9f')]['length']){return _0x32466a[_0xe5d1('0x9f')][0x0];}var _0x5a5eba=_[_0xe5d1('0x19')](_0x1099bc[_0xe5d1('0x61')],{'firstName':_0x1099bc['body'][_0xe5d1('0x84')],'ListId':_0x32466a['id']});_0x5a5eba[_0x1099bc['body'][_0xe5d1('0x9d')]]=_0x1099bc['body'][_0xe5d1('0x84')];return db[_0xe5d1('0x7a')][_0xe5d1('0x60')](_0x5a5eba,{'fields':_0x4fde26,'raw':!![]});}})[_0xe5d1('0x21')](handleEntityNotFound(_0x18c69d,null))[_0xe5d1('0x21')](function(_0x2b6fec){if(_0x2b6fec){_0x1099bc['contact']=_0x2b6fec;var _0x5067f4={'ContactId':_0x2b6fec['id'],'phone':_0x1099bc[_0xe5d1('0x61')]['from'],'SmsAccountId':_0x58eb88[_0xe5d1('0x5d')]['id']};var _0x3705f6={'ContactId':_0x2b6fec['id'],'SmsAccountId':_0x58eb88[_0xe5d1('0x5d')]['id'],'closed':![]};return db[_0xe5d1('0xa0')][_0xe5d1('0x5f')]({'where':_0x3705f6})[_0xe5d1('0x21')](function(_0x4a8290){if(_0x4a8290){return[_0x4a8290,![]];}return db[_0xe5d1('0xa0')][_0xe5d1('0x60')](_0x5067f4)['then'](function(_0x232a1d){return[_0x232a1d,!![]];});});}})[_0xe5d1('0xa1')](function(_0x181e93,_0x2a8e23){_0x1099bc[_0xe5d1('0xa2')]=_0x181e93[_0xe5d1('0x3a')]({'plain':!![]});_0x1099bc[_0xe5d1('0xa2')][_0xe5d1('0xa3')]=![];if(_0x2a8e23){if(_0x1099bc[_0xe5d1('0x79')][_0xe5d1('0xa4')]){_0x1099bc[_0xe5d1('0xa5')][_0xe5d1('0xa6')]({'id':0x0,'priority':_0x1099bc['applications'][_0xe5d1('0x4e')]+0x1,'app':_0xe5d1('0xa7'),'appdata':'unmanaged','interval':_0xe5d1('0xa8')});}_0x1099bc['interaction']['created']=!![];}return db[_0xe5d1('0xa9')][_0xe5d1('0x60')]({'phone':_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x84')],'messageId':_0x1099bc[_0xe5d1('0x61')]['messageId'],'body':_0x1099bc[_0xe5d1('0x61')][_0xe5d1('0x61')],'SmsAccountId':_0x58eb88[_0xe5d1('0x5d')]['id'],'SmsInteractionId':_0x181e93['id'],'direction':'in','ContactId':_0x181e93[_0xe5d1('0xaa')],'AttachmentId':_0x1099bc[_0xe5d1('0x61')]['AttachmentId']});})['then'](function(_0x4dcf4d){_0x1099bc[_0xe5d1('0x28')]=_0x4dcf4d;if(!_0x1099bc[_0xe5d1('0xa2')][_0xe5d1('0xab')])return;return db[_0xe5d1('0xac')][_0xe5d1('0x5f')]({'attributes':['id',_0xe5d1('0x3e')],'where':{'id':_0x1099bc[_0xe5d1('0xa2')][_0xe5d1('0xab')]}});})[_0xe5d1('0x21')](function(_0x16e043){if(_0x16e043){_0x1099bc[_0xe5d1('0xa5')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe5d1('0xad'),'appdata':_0x16e043[_0xe5d1('0x3e')]+','+(_0x1099bc[_0xe5d1('0x79')][_0xe5d1('0xae')]||0xa),'interval':_0xe5d1('0xa8')});}if(!_0x1099bc[_0xe5d1('0xa2')][_0xe5d1('0xaf')])return;return db[_0xe5d1('0xb0')][_0xe5d1('0x5f')]({'attributes':['id',_0xe5d1('0x3e')],'where':{'id':_0x1099bc[_0xe5d1('0xa2')]['queueId']}});})['then'](function(_0x5a029d){if(_0x5a029d){_0x1099bc[_0xe5d1('0xa5')][_0xe5d1('0xb1')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5a029d[_0xe5d1('0x3e')]+','+(_0x1099bc['account'][_0xe5d1('0xb2')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xe5d1('0xb3'),_0xe5d1('0xb4'),_0x1099bc);})[_0xe5d1('0x21')](function(_0xe58949){if(_0xe58949){var _0x1f24dc=0xc8;var _0x37de3e=_0xe5d1('0xb5');logger['info'](_0xe5d1('0x23'),_0x37de3e,_0x1f24dc,_0xe5d1('0xb6'));logger[_0xe5d1('0x22')](_0xe5d1('0xb7'),_0x37de3e,_0x1f24dc,_0xe5d1('0xb6'),JSON['stringify'](_0xe58949));if(_0x1099bc['account'][_0xe5d1('0x45')]==='twilio'){return _0x18c69d[_0xe5d1('0x2d')](_0x1f24dc)[_0xe5d1('0x33')](_0xe5d1('0xb8'),'text/xml')['send']('\x0a');}else{return _0x18c69d[_0xe5d1('0x2d')](_0x1f24dc)[_0xe5d1('0x2f')](_0xe58949);}}})[_0xe5d1('0x2b')](handleError(_0x18c69d,null));};exports['addApplications']=function(_0x2d8445,_0x496f3d){var _0x14fc02=_0x2d8445[_0xe5d1('0x5d')]['id'];var _0x5bc967=_0x2d8445[_0xe5d1('0x61')];var _0x564041=0xc8;var _0x496398=null;return db[_0xe5d1('0xb9')][_0xe5d1('0xba')]({'isolationLevel':db[_0xe5d1('0xb9')][_0xe5d1('0xbb')][_0xe5d1('0xbc')][_0xe5d1('0xbd')]},function(_0x7dcb55){return db[_0xe5d1('0x42')][_0xe5d1('0x6b')]({'where':{'id':_0x14fc02},'transaction':_0x7dcb55})[_0xe5d1('0x21')](function(_0x54d2e7){if(_0x54d2e7){return db[_0xe5d1('0x74')][_0xe5d1('0x39')]({'where':{'SmsAccountId':_0x14fc02},'transaction':_0x7dcb55})[_0xe5d1('0x21')](function(){var _0x1368e5=_[_0xe5d1('0x41')](_0x5bc967,function(_0x3f1971){_0x3f1971[_0xe5d1('0x69')]=_0x14fc02;return _0x3f1971;});return db[_0xe5d1('0x74')][_0xe5d1('0xbe')](_0x1368e5,{'transaction':_0x7dcb55});});}else{_0x564041=0x194;_0x496398=[];}});})[_0xe5d1('0x21')](function(){if(_0x564041!==0x194){return db[_0xe5d1('0x74')][_0xe5d1('0xbf')]({'where':{'SmsAccountId':_0x14fc02},'order':_0xe5d1('0x77')})[_0xe5d1('0x21')](function(_0x2c0e08){_0x496398=_0x2c0e08;});}})[_0xe5d1('0x2b')](function(_0x5af690){_0x564041=0x1f4;logger['error'](_0x5af690[_0xe5d1('0x3d')]);if(_0x5af690[_0xe5d1('0x3e')]){delete _0x5af690[_0xe5d1('0x3e')];}_0x496398=_0x5af690;})[_0xe5d1('0xc0')](function(){if(_0x496398===null){_0x496f3d[_0xe5d1('0x2c')](_0x564041);}else{if(_0x564041===0x1f4){_0x496f3d[_0xe5d1('0x2d')](_0x564041)[_0xe5d1('0xc1')](_0x496398);}else{_0x496f3d['status'](_0x564041)[_0xe5d1('0x2f')](_0x496398);}}});};exports['getApplications']=function(_0x50b0d5,_0x11fbf0,_0x34b98a){var _0x7b45bc={};var _0x9c0821={};var _0x2a0bad;var _0x5c09f0;return db[_0xe5d1('0x42')][_0xe5d1('0x6b')]({'where':{'id':_0x50b0d5['params']['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x11fbf0,null))[_0xe5d1('0x21')](function(_0x40ba49){if(_0x40ba49){_0x2a0bad=_0x40ba49;_0x9c0821['model']=_[_0xe5d1('0x48')](db[_0xe5d1('0x74')][_0xe5d1('0x43')]);_0x9c0821['query']=_[_0xe5d1('0x48')](_0x50b0d5[_0xe5d1('0x49')]);_0x9c0821[_0xe5d1('0x4a')]=_[_0xe5d1('0x4b')](_0x9c0821['model'],_0x9c0821[_0xe5d1('0x49')]);_0x7b45bc[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x9c0821[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x50b0d5[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0x7b45bc[_0xe5d1('0x4c')]=_0x7b45bc['attributes'][_0xe5d1('0x4e')]?_0x7b45bc[_0xe5d1('0x4c')]:_0x9c0821[_0xe5d1('0x47')];_0x7b45bc[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0x50b0d5[_0xe5d1('0x49')][_0xe5d1('0x52')]);_0x7b45bc['where']=qs[_0xe5d1('0x4a')](_['pick'](_0x50b0d5['query'],_0x9c0821['filters']));if(_0x50b0d5[_0xe5d1('0x49')][_0xe5d1('0x54')]){_0x7b45bc[_0xe5d1('0x55')]=_[_0xe5d1('0x57')](_0x7b45bc[_0xe5d1('0x55')],{'$or':_['map'](_0x7b45bc[_0xe5d1('0x4c')],function(_0x1b3d8b){var _0x5952bf={};_0x5952bf[_0x1b3d8b]={'$like':'%'+_0x50b0d5[_0xe5d1('0x49')][_0xe5d1('0x54')]+'%'};return _0x5952bf;})});}_0x7b45bc=_[_0xe5d1('0x57')]({},_0x7b45bc,_0x50b0d5['options']);return _0x2a0bad['getApplications'](_0x7b45bc);}})[_0xe5d1('0x21')](function(_0x630437){if(_0x630437){_0x5c09f0=_0x630437[_0xe5d1('0x4e')];if(!_0x50b0d5[_0xe5d1('0x49')]['hasOwnProperty']('nolimit')){_0x7b45bc[_0xe5d1('0x32')]=qs[_0xe5d1('0x32')](_0x50b0d5[_0xe5d1('0x49')][_0xe5d1('0x32')]);_0x7b45bc[_0xe5d1('0x30')]=qs[_0xe5d1('0x30')](_0x50b0d5['query'][_0xe5d1('0x30')]);}return _0x2a0bad['getApplications'](_0x7b45bc);}})[_0xe5d1('0x21')](function(_0x4acff0){if(_0x4acff0){return _0x4acff0?{'count':_0x5c09f0,'rows':_0x4acff0}:null;}})[_0xe5d1('0x21')](respondWithResult(_0x11fbf0,null))[_0xe5d1('0x2b')](handleError(_0x11fbf0,null));};exports[_0xe5d1('0xc2')]=function(_0x54245c,_0x1374ac,_0x333b7b){var _0x207648={'raw':![],'where':{}};var _0x175658={};var _0x43a7e6={'count':0x0,'rows':[]};return db[_0xe5d1('0x42')][_0xe5d1('0x6b')]({'where':{'id':_0x54245c['params']['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x1374ac,null))[_0xe5d1('0x21')](function(_0x5ee939){if(_0x5ee939){_0x175658[_0xe5d1('0x47')]=_[_0xe5d1('0x48')](db[_0xe5d1('0xa0')]['rawAttributes']);_0x175658['query']=_[_0xe5d1('0x48')](_0x54245c[_0xe5d1('0x49')]);_0x175658['filters']=_[_0xe5d1('0x4b')](_0x175658['model'],_0x175658[_0xe5d1('0x49')]);_0x207648[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x175658[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x54245c[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0x207648[_0xe5d1('0x4c')]=_0x207648['attributes'][_0xe5d1('0x4e')]?_0x207648[_0xe5d1('0x4c')]:_0x175658[_0xe5d1('0x47')];if(!_0x54245c[_0xe5d1('0x49')][_0xe5d1('0x4f')](_0xe5d1('0x50'))){_0x207648['limit']=qs[_0xe5d1('0x32')](_0x54245c[_0xe5d1('0x49')]['limit']);_0x207648['offset']=qs[_0xe5d1('0x30')](_0x54245c['query'][_0xe5d1('0x30')]);}_0x207648[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0x54245c[_0xe5d1('0x49')][_0xe5d1('0x52')]);_0x207648[_0xe5d1('0x55')]=qs[_0xe5d1('0x4a')](_[_0xe5d1('0x53')](_0x54245c[_0xe5d1('0x49')],_0x175658[_0xe5d1('0x4a')]));_0x207648['where'][_0xe5d1('0x69')]=_0x5ee939['id'];if(_0x54245c['query'][_0xe5d1('0x54')]){_0x207648[_0xe5d1('0x55')]=_[_0xe5d1('0x57')](_0x207648['where'],{'$or':_[_0xe5d1('0x41')](_0x207648[_0xe5d1('0x4c')],function(_0xe75366){var _0x95cb31={};_0x95cb31[_0xe75366]={'$like':'%'+_0x54245c['query'][_0xe5d1('0x54')]+'%'};return _0x95cb31;})});}_0x207648=_[_0xe5d1('0x57')]({},_0x207648,_0x54245c[_0xe5d1('0x5e')]);return db['SmsInteraction'][_0xe5d1('0x58')]({'where':_0x207648[_0xe5d1('0x55')]})['then'](function(_0x33837b){_0x43a7e6[_0xe5d1('0x58')]=_0x33837b;if(_0x54245c[_0xe5d1('0x49')][_0xe5d1('0x59')]){_0x207648[_0xe5d1('0x5a')]=[{'model':db[_0xe5d1('0x7a')],'as':_0xe5d1('0xc3'),'required':![]},{'model':db[_0xe5d1('0xac')],'as':_0xe5d1('0xc4'),'attributes':[_0xe5d1('0x3e'),_0xe5d1('0xc5'),'internal'],'required':![]},{'model':db[_0xe5d1('0xc6')],'as':_0xe5d1('0xc7'),'attributes':['id',_0xe5d1('0x3e'),_0xe5d1('0xc8')],'where':_0x54245c[_0xe5d1('0x49')][_0xe5d1('0xc9')]?{'id':_0x54245c[_0xe5d1('0x49')][_0xe5d1('0xc9')]}:undefined,'required':_0x54245c[_0xe5d1('0x49')][_0xe5d1('0xc9')]?!![]:![]}];}return db[_0xe5d1('0xa0')][_0xe5d1('0x5b')](_0x207648);})[_0xe5d1('0x21')](function(_0x3e8f39){_0x43a7e6[_0xe5d1('0x5c')]=_0x3e8f39;return _0x43a7e6;});}})['then'](respondWithFilteredResult(_0x1374ac,_0x207648))[_0xe5d1('0x2b')](handleError(_0x1374ac,null));};exports['send']=function(_0x1adeec,_0x10f986,_0x2a0c91){var _0xc17d7a,_0x2826c6,_0x446269;if(_[_0xe5d1('0x98')](_0x1adeec[_0xe5d1('0x61')][_0xe5d1('0x61')])||_0x1adeec['body'][_0xe5d1('0x61')]===''){throw new db[(_0xe5d1('0x7b'))][(_0xe5d1('0x7c'))](_0xe5d1('0x9a'));}if(_[_0xe5d1('0x98')](_0x1adeec['body']['to'])){throw new db[(_0xe5d1('0x7b'))][(_0xe5d1('0x7c'))](_0xe5d1('0xca'));}_0xc17d7a=_0x1adeec[_0xe5d1('0x61')]['to'];return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x1adeec['params']['id']},'include':[{'model':db[_0xe5d1('0xcb')],'as':'List','include':[{'model':db[_0xe5d1('0x7a')],'as':'Contacts','where':{'mobile':_0xc17d7a},'limit':0x1,'order':[[_0xe5d1('0x7f'),_0xe5d1('0xcc')]]}]}]})[_0xe5d1('0x21')](handleEntityNotFound(_0x10f986,null))['then'](function(_0x255b76){if(_0x255b76&&_0x255b76[_0xe5d1('0xcd')]){_0x2826c6=_0x255b76[_0xe5d1('0x3a')]({'plain':!![]});if(_0x2826c6['List']&&_0x2826c6[_0xe5d1('0xcd')][_0xe5d1('0x9f')][_0xe5d1('0x4e')]){return _0x2826c6[_0xe5d1('0xcd')][_0xe5d1('0x9f')][0x0];}return db[_0xe5d1('0x7a')]['create'](_[_0xe5d1('0x19')](_0x1adeec[_0xe5d1('0x61')],{'firstName':_0xc17d7a,'mobile':_0xc17d7a,'phone':_0xc17d7a,'ListId':_0x2826c6[_0xe5d1('0x81')]}));}})[_0xe5d1('0x21')](handleEntityNotFound(_0x10f986,null))[_0xe5d1('0x21')](function(_0x1cac1a){if(_0x1cac1a){_0x446269=_0x1cac1a;return db[_0xe5d1('0xa0')][_0xe5d1('0x5f')]({'where':{'ContactId':_0x446269['id'],'closed':![],'SmsAccountId':_0x2826c6['id']}})[_0xe5d1('0x21')](function(_0x5e943f){if(_0x5e943f){return[_0x5e943f,![]];}return db[_0xe5d1('0xa0')][_0xe5d1('0x60')]({'UserId':_0x1adeec[_0xe5d1('0x62')]['id'],'ContactId':_0x446269['id'],'SmsAccountId':_0x2826c6['id'],'phone':_0xc17d7a,'firstMsgDirection':_0xe5d1('0xce'),'Messages':[_[_0xe5d1('0x57')](_0x1adeec[_0xe5d1('0x61')],{'read':![],'body':_0x1adeec[_0xe5d1('0x61')][_0xe5d1('0x61')],'phone':_0xc17d7a,'SmsAccountId':_0x2826c6['id'],'UserId':_0x1adeec[_0xe5d1('0x62')]['id'],'ContactId':_0x446269['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0xe5d1('0x21')](function(_0x5b3b17){return[_0x5b3b17,!![]];});});}})['spread'](function(_0xefa135,_0x159a23){if(_0x159a23){return _0xefa135;}return db['SmsMessage']['create'](_[_0xe5d1('0x57')](_0x1adeec['body'],{'read':![],'body':_0x1adeec[_0xe5d1('0x61')][_0xe5d1('0x61')],'phone':_0xc17d7a,'SmsAccountId':_0x2826c6['id'],'SmsInteractionId':_0xefa135['id'],'UserId':_0x1adeec[_0xe5d1('0x62')]['id'],'ContactId':_0x446269['id']}))[_0xe5d1('0x21')](function(_0x38c548){_0xefa135[_0xe5d1('0xcf')][_0xe5d1('0xd0')]=[];_0xefa135[_0xe5d1('0xcf')]['Messages'][_0xe5d1('0xa6')](_0x38c548[_0xe5d1('0xcf')]);return _0xefa135;});})[_0xe5d1('0x21')](respondWithResult(_0x10f986,null))['catch'](handleError(_0x10f986,null));};exports[_0xe5d1('0x2d')]=function(_0x5aa8cc,_0x3efec3,_0x312d0a){if(_0x5aa8cc['body']['id']){delete _0x5aa8cc['body']['id'];}var _0x5be0e6,_0x9dcd3a,_0x486643;return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x5aa8cc['params']['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x3efec3,null))['then'](function(_0x2e2ef7){if(_0x2e2ef7){_0x486643=_0x2e2ef7;logger[_0xe5d1('0x22')](_0xe5d1('0x23'),'status','received\x20delivery\x20report\x20from',_0x2e2ef7[_0xe5d1('0x45')],util[_0xe5d1('0xd1')](_0x5aa8cc['body'],{'showHidden':![],'depth':null}));switch(_0x2e2ef7[_0xe5d1('0x45')]){case _0xe5d1('0xd2'):if(_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd3')]&&_0x5aa8cc['body'][_0xe5d1('0x2d')]){_0x9dcd3a=_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x2d')];return db[_0xe5d1('0xa9')][_0xe5d1('0x5f')]({'where':{'messageId':_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd3')]}});}break;case _0xe5d1('0x8a'):if(_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd4')]&&_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd5')]){_0x9dcd3a=_0x5aa8cc['body']['statusInt'];return db[_0xe5d1('0xa9')][_0xe5d1('0x5f')]({'where':{'messageId':_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd4')]}});}break;case'clicksend':if(_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x8c')]&&_0x5aa8cc['body']['status_code']){_0x9dcd3a=_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd6')];return db[_0xe5d1('0xa9')]['find']({'where':{'messageId':_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x8c')]}});}break;case _0xe5d1('0x8f'):var _0x4f0ed0=_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x90')][0x0];if(_0x4f0ed0[_0xe5d1('0x87')]&&_0x4f0ed0['status'][_0xe5d1('0xd7')]==='DELIVERED'){_0x9dcd3a=_0x4f0ed0[_0xe5d1('0x2d')][_0xe5d1('0xd7')];return db[_0xe5d1('0xa9')]['find']({'where':{'messageId':_0x4f0ed0[_0xe5d1('0x87')]}});}break;case _0xe5d1('0x93'):if(_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x87')]&&_0x5aa8cc[_0xe5d1('0x61')]['status']){_0x9dcd3a=_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x2d')];return db['SmsMessage'][_0xe5d1('0x5f')]({'where':{'messageId':_0x5aa8cc['body'][_0xe5d1('0x87')]}});}break;case'bandwidth':if(_0x5aa8cc[_0xe5d1('0x61')][0x0]['message']['id']){_0x9dcd3a=_0x5aa8cc[_0xe5d1('0x61')][0x0]['type'];return db[_0xe5d1('0xa9')][_0xe5d1('0x5f')]({'where':{'messageId':_0x5aa8cc[_0xe5d1('0x61')][0x0][_0xe5d1('0x28')]['id']}});}break;case _0xe5d1('0x96'):if(_0x5aa8cc[_0xe5d1('0x61')]['redif']&&_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x2d')]){_0x9dcd3a=_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0x2d')];return db[_0xe5d1('0xa9')]['find']({'where':{'messageId':_0x5aa8cc[_0xe5d1('0x61')]['redif']}});}break;}}})[_0xe5d1('0x21')](handleEntityNotFound(_0x3efec3,null))[_0xe5d1('0x21')](function(_0x166450){if(_0x166450){_0x5be0e6=_0x166450;switch(_0x486643[_0xe5d1('0x45')]){case _0xe5d1('0xd2'):if(_0x9dcd3a==='DELIVERED'){return _0x5be0e6['update']({'read':!![]});}else{logger['error'](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0xd2'),util[_0xe5d1('0xd1')](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x8a'):if(_0x9dcd3a==='1'){return _0x5be0e6['update']({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0xd2'),util['inspect'](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x8b'):if(!_0x5aa8cc[_0xe5d1('0x61')][_0xe5d1('0xd8')]&&_0x9dcd3a>=0xc8&&_0x9dcd3a<=0xce){return _0x5be0e6[_0xe5d1('0x38')]({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0x8b'),util['inspect'](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x8f'):var _0x4fb536=_0x5aa8cc['body'][_0xe5d1('0x90')][0x0];if(_0x4fb536['status'][_0xe5d1('0xd7')]===_0xe5d1('0xd9')){return _0x5be0e6[_0xe5d1('0x38')]({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0x8f'),util[_0xe5d1('0xd1')](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x93'):if(_0x9dcd3a==_0xe5d1('0xda')||_0x9dcd3a==_0xe5d1('0xdb')){return _0x5be0e6[_0xe5d1('0x38')]({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),'status','clickatell',util['inspect'](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x95'):if(_0x9dcd3a==_0xe5d1('0xdc')){return _0x5be0e6['update']({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0x95'),util[_0xe5d1('0xd1')](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;case _0xe5d1('0x96'):if(_0x9dcd3a===_0xe5d1('0xdd')||_0x9dcd3a==='ACCEPTD'){return _0x5be0e6['update']({'read':!![]});}else{logger[_0xe5d1('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe5d1('0x2d'),_0xe5d1('0x96'),util[_0xe5d1('0xd1')](_0x5aa8cc[_0xe5d1('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x5be0e6;}})['then'](respondWithResult(_0x3efec3,null))[_0xe5d1('0x2b')](handleError(_0x3efec3,null));};exports[_0xe5d1('0xde')]=function(_0x48fa02,_0x3cbe66,_0x5aa1ba){var _0x476608,_0x5d5e45,_0x293662;return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x48fa02[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x3cbe66,null))[_0xe5d1('0x21')](function(_0x534ccc){if(_0x534ccc){_0x293662=_0x534ccc;logger[_0xe5d1('0x22')](_0xe5d1('0x23'),_0xe5d1('0x2d'),'received\x20delivery\x20report\x20from',_0x534ccc[_0xe5d1('0x45')],util['inspect'](_0x48fa02[_0xe5d1('0x49')],{'showHidden':![],'depth':null}));switch(_0x534ccc[_0xe5d1('0x45')]){case _0xe5d1('0x91'):if(_0x48fa02['query'][_0xe5d1('0xdf')]&&_0x48fa02[_0xe5d1('0x49')][_0xe5d1('0xe0')]){_0x5d5e45=_0x48fa02['query'][_0xe5d1('0xe0')];return db[_0xe5d1('0xa9')]['find']({'where':{'messageId':_0x48fa02[_0xe5d1('0x49')][_0xe5d1('0xdf')]}});}break;}}})[_0xe5d1('0x21')](handleEntityNotFound(_0x3cbe66,null))[_0xe5d1('0x21')](function(_0x4af7b3){if(_0x4af7b3){_0x476608=_0x4af7b3;switch(_0x293662['type']){case _0xe5d1('0x91'):if(_0x5d5e45==='2'||_0x5d5e45==='6'){return _0x476608[_0xe5d1('0x38')]({'read':!![]});}else{logger[_0xe5d1('0x26')](_0xe5d1('0x23'),_0xe5d1('0x2d'),_0xe5d1('0x91'),util[_0xe5d1('0xd1')](_0x48fa02['query'],{'showHidden':![],'depth':null}));};break;}return _0x476608;}})[_0xe5d1('0x21')](respondWithResult(_0x3cbe66,null))[_0xe5d1('0x2b')](handleError(_0x3cbe66,null));};exports[_0xe5d1('0xe1')]=function(_0x252eb9,_0x586ae6,_0xf54be2){return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x252eb9[_0xe5d1('0x5d')]['id']}})[_0xe5d1('0x21')](handleEntityNotFound(_0x586ae6,null))[_0xe5d1('0x21')](function(_0x4a34e0){if(_0x4a34e0){return _0x4a34e0[_0xe5d1('0xe1')](_0x252eb9[_0xe5d1('0x61')][_0xe5d1('0x6e')],_[_0xe5d1('0x9e')](_0x252eb9['body'],[_0xe5d1('0x6e'),'id'])||{})[_0xe5d1('0xa1')](function(_0x3e05b1){for(var _0x376290=0x0;_0x376290<_0x252eb9[_0xe5d1('0x61')]['ids'][_0xe5d1('0x4e')];_0x376290+=0x1){socket[_0xe5d1('0xe2')](_0xe5d1('0xe3'),{'UserId':Number(_0x252eb9[_0xe5d1('0x61')][_0xe5d1('0x6e')][_0x376290]),'SmsAccountId':Number(_0x252eb9[_0xe5d1('0x5d')]['id'])});}return _0x3e05b1;});}})[_0xe5d1('0x21')](respondWithResult(_0x586ae6,null))[_0xe5d1('0x2b')](handleError(_0x586ae6,null));};exports[_0xe5d1('0xe4')]=function(_0x2b3d0b,_0x4c5e4a,_0x5c5f4b){return db[_0xe5d1('0x42')][_0xe5d1('0x5f')]({'where':{'id':_0x2b3d0b[_0xe5d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4c5e4a,null))[_0xe5d1('0x21')](function(_0x38ed51){if(_0x38ed51){return _0x38ed51[_0xe5d1('0xe4')](_0x2b3d0b['query'][_0xe5d1('0x6e')])[_0xe5d1('0x21')](function(){if(_['isArray'](_0x2b3d0b[_0xe5d1('0x49')][_0xe5d1('0x6e')])){for(var _0x719326=0x0;_0x719326<_0x2b3d0b[_0xe5d1('0x49')][_0xe5d1('0x6e')][_0xe5d1('0x4e')];_0x719326+=0x1){socket[_0xe5d1('0xe2')](_0xe5d1('0xe5'),{'UserId':Number(_0x2b3d0b['query'][_0xe5d1('0x6e')][_0x719326]),'SmsAccountId':Number(_0x2b3d0b[_0xe5d1('0x5d')]['id'])});}}else{socket['emit'](_0xe5d1('0xe5'),{'UserId':Number(_0x2b3d0b[_0xe5d1('0x49')][_0xe5d1('0x6e')]),'SmsAccountId':Number(_0x2b3d0b[_0xe5d1('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x4c5e4a,null))[_0xe5d1('0x2b')](handleError(_0x4c5e4a,null));};exports[_0xe5d1('0xe6')]=function(_0x24bd76,_0x39e45f,_0x562853){var _0x5ee82c={};var _0x17fae3={};var _0x39f9c0;var _0x345569;return db[_0xe5d1('0x42')][_0xe5d1('0x6b')]({'where':{'id':_0x24bd76[_0xe5d1('0x5d')]['id']}})['then'](handleEntityNotFound(_0x39e45f,null))[_0xe5d1('0x21')](function(_0x1a796c){if(_0x1a796c){_0x39f9c0=_0x1a796c;_0x17fae3[_0xe5d1('0x47')]=_[_0xe5d1('0x48')](db[_0xe5d1('0xac')][_0xe5d1('0x43')]);_0x17fae3[_0xe5d1('0x49')]=_[_0xe5d1('0x48')](_0x24bd76[_0xe5d1('0x49')]);_0x17fae3[_0xe5d1('0x4a')]=_[_0xe5d1('0x4b')](_0x17fae3['model'],_0x17fae3[_0xe5d1('0x49')]);_0x5ee82c[_0xe5d1('0x4c')]=_[_0xe5d1('0x4b')](_0x17fae3[_0xe5d1('0x47')],qs[_0xe5d1('0x4d')](_0x24bd76[_0xe5d1('0x49')][_0xe5d1('0x4d')]));_0x5ee82c[_0xe5d1('0x4c')]=_0x5ee82c[_0xe5d1('0x4c')][_0xe5d1('0x4e')]?_0x5ee82c[_0xe5d1('0x4c')]:_0x17fae3[_0xe5d1('0x47')];_0x5ee82c[_0xe5d1('0x51')]=qs[_0xe5d1('0x52')](_0x24bd76['query'][_0xe5d1('0x52')]);_0x5ee82c[_0xe5d1('0x55')]=qs[_0xe5d1('0x4a')](_[_0xe5d1('0x53')](_0x24bd76['query'],_0x17fae3[_0xe5d1('0x4a')]));if(_0x24bd76['query'][_0xe5d1('0x54')]){_0x5ee82c[_0xe5d1('0x55')]=_['merge'](_0x5ee82c[_0xe5d1('0x55')],{'$or':_[_0xe5d1('0x41')](_0x5ee82c[_0xe5d1('0x4c')],function(_0x18c50f){var _0x2324a2={};_0x2324a2[_0x18c50f]={'$like':'%'+_0x24bd76[_0xe5d1('0x49')][_0xe5d1('0x54')]+'%'};return _0x2324a2;})});}_0x5ee82c=_[_0xe5d1('0x57')]({},_0x5ee82c,_0x24bd76[_0xe5d1('0x5e')]);return _0x39f9c0[_0xe5d1('0xe6')](_0x5ee82c);}})[_0xe5d1('0x21')](function(_0x25b020){if(_0x25b020){_0x345569=_0x25b020[_0xe5d1('0x4e')];if(!_0x24bd76[_0xe5d1('0x49')][_0xe5d1('0x4f')](_0xe5d1('0x50'))){_0x5ee82c['limit']=qs['limit'](_0x24bd76[_0xe5d1('0x49')]['limit']);_0x5ee82c[_0xe5d1('0x30')]=qs['offset'](_0x24bd76[_0xe5d1('0x49')][_0xe5d1('0x30')]);}return _0x39f9c0[_0xe5d1('0xe6')](_0x5ee82c);}})[_0xe5d1('0x21')](function(_0xba8b31){if(_0xba8b31){return _0xba8b31?{'count':_0x345569,'rows':_0xba8b31}:null;}})[_0xe5d1('0x21')](respondWithResult(_0x39e45f,null))[_0xe5d1('0x2b')](handleError(_0x39e45f,null));}; \ No newline at end of file +var _0x9018=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','rows','show','include','merge','options','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','params','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','count','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','notify','sms','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','Body','messageId','skebby','from','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','segmentedMessage','fromNumber','bandwidth','intelepeer','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','omit','contact','SmsInteraction','interaction','created','autoclose','push','*,*,*,*','ContactId','UserId','User','unshift','agent','queueId','waitForTheAssignedQueue','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','findAndCountAll','priority','stack','finally','getApplications','Contact','Owner','fullname','internal','Tags','color','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','redif','inspect','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','sendStatus','name','index','SmsAccount','rawAttributes','fieldName','type','key','map'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9018,0xa0));var _0x8901=function(_0x2d4c26,_0x1ca900){_0x2d4c26=_0x2d4c26-0x0;var _0x173487=_0x9018[_0x2d4c26];return _0x173487;};'use strict';var emlformat=require(_0x8901('0x0'));var rimraf=require(_0x8901('0x1'));var zipdir=require(_0x8901('0x2'));var jsonpatch=require(_0x8901('0x3'));var rp=require(_0x8901('0x4'));var moment=require(_0x8901('0x5'));var BPromise=require(_0x8901('0x6'));var Mustache=require(_0x8901('0x7'));var util=require(_0x8901('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8901('0x9'));var ejs=require(_0x8901('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8901('0xb'));var squel=require(_0x8901('0xc'));var crypto=require(_0x8901('0xd'));var jsforce=require(_0x8901('0xe'));var deskjs=require(_0x8901('0xf'));var toCsv=require(_0x8901('0x9'));var querystring=require(_0x8901('0x10'));var Papa=require(_0x8901('0x11'));var Redis=require('ioredis');var authService=require(_0x8901('0x12'));var qs=require(_0x8901('0x13'));var as=require(_0x8901('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8901('0x15'));var utils=require(_0x8901('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8901('0x17'))['db'];config[_0x8901('0x18')]=_[_0x8901('0x19')](config[_0x8901('0x18')],{'host':_0x8901('0x1a'),'port':0x18eb});var socket=require(_0x8901('0x1b'))(new Redis(config[_0x8901('0x18')]));require(_0x8901('0x1c'))[_0x8901('0x1d')](socket);var jayson=require(_0x8901('0x1e'));var client=jayson[_0x8901('0x1f')][_0x8901('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3d967e,_0x497b68,_0x16417e,_0x5d56a0){return new BPromise(function(_0x45d244,_0xaf3b4c){var _0x4a1bfd=_0x5d56a0||client;return _0x4a1bfd[_0x8901('0x21')](_0x3d967e,_0x16417e)['then'](function(_0x2bfb08){logger[_0x8901('0x22')](_0x8901('0x23'),_0x497b68,_0x8901('0x24'));logger[_0x8901('0x25')](_0x8901('0x26'),_0x497b68,_0x8901('0x24'),JSON[_0x8901('0x27')](_0x2bfb08));if(_0x2bfb08[_0x8901('0x28')]){if(_0x2bfb08['error'][_0x8901('0x29')]===0x1f4){logger[_0x8901('0x28')](_0x8901('0x23'),_0x497b68,_0x2bfb08[_0x8901('0x28')][_0x8901('0x2a')]);return _0xaf3b4c(_0x2bfb08['error']['message']);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x497b68,_0x2bfb08[_0x8901('0x28')]['message']);return _0x45d244(_0x2bfb08[_0x8901('0x28')]['message']);}else{logger[_0x8901('0x22')](_0x8901('0x23'),_0x497b68,_0x8901('0x24'));_0x45d244(_0x2bfb08[_0x8901('0x2b')][_0x8901('0x2a')]);}})[_0x8901('0x2c')](function(_0x55baa5){logger[_0x8901('0x28')](_0x8901('0x23'),_0x497b68,_0x55baa5);_0xaf3b4c(_0x55baa5);});});}function respondWithStatusCode(_0x380a07,_0x3abb12){_0x3abb12=_0x3abb12||0xcc;return function(_0x418896){if(_0x418896){return _0x380a07['sendStatus'](_0x3abb12);}return _0x380a07[_0x8901('0x2d')](_0x3abb12)[_0x8901('0x2e')]();};}function respondWithResult(_0x3f9f08,_0x1927c9){_0x1927c9=_0x1927c9||0xc8;return function(_0x51af10){if(_0x51af10){return _0x3f9f08[_0x8901('0x2d')](_0x1927c9)[_0x8901('0x2f')](_0x51af10);}};}function respondWithFilteredResult(_0x190a70,_0x274819){return function(_0x38a7af){if(_0x38a7af){var _0x275d58=typeof _0x274819[_0x8901('0x30')]===_0x8901('0x31')&&typeof _0x274819[_0x8901('0x32')]==='undefined';var _0x35b8bc=_0x38a7af['count'];var _0x453ec9=_0x275d58?0x0:_0x274819[_0x8901('0x30')];var _0x5d35c1=_0x275d58?_0x38a7af['count']:_0x274819[_0x8901('0x30')]+_0x274819[_0x8901('0x32')];var _0x2767a2;if(_0x5d35c1>=_0x35b8bc){_0x5d35c1=_0x35b8bc;_0x2767a2=0xc8;}else{_0x2767a2=0xce;}_0x190a70[_0x8901('0x2d')](_0x2767a2);return _0x190a70[_0x8901('0x33')](_0x8901('0x34'),_0x453ec9+'-'+_0x5d35c1+'/'+_0x35b8bc)[_0x8901('0x2f')](_0x38a7af);}return null;};}function patchUpdates(_0x512146){return function(_0x2bbf1a){try{jsonpatch[_0x8901('0x35')](_0x2bbf1a,_0x512146,!![]);}catch(_0x5aba79){return BPromise[_0x8901('0x36')](_0x5aba79);}return _0x2bbf1a[_0x8901('0x37')]();};}function saveUpdates(_0x5f322d,_0x1eb385){return function(_0x1db390){if(_0x1db390){return _0x1db390[_0x8901('0x38')](_0x5f322d)[_0x8901('0x39')](function(_0x1ec7b7){return _0x1ec7b7;});}return null;};}function removeEntity(_0x4a3589,_0x312688){return function(_0x9754b7){if(_0x9754b7){return _0x9754b7[_0x8901('0x3a')]()[_0x8901('0x39')](function(){var _0x4985d3=_0x9754b7[_0x8901('0x3b')]({'plain':!![]});var _0x45b886=_0x8901('0x3c');return db[_0x8901('0x3d')][_0x8901('0x3a')]({'where':{'type':_0x45b886,'resourceId':_0x4985d3['id']}})[_0x8901('0x39')](function(){return _0x9754b7;});})[_0x8901('0x39')](function(){_0x4a3589[_0x8901('0x2d')](0xcc)[_0x8901('0x2e')]();});}};}function handleEntityNotFound(_0x3bd735,_0x196a6b){return function(_0x239645){if(!_0x239645){_0x3bd735[_0x8901('0x3e')](0x194);}return _0x239645;};}function handleError(_0x13c934,_0x1e4670){_0x1e4670=_0x1e4670||0x1f4;return function(_0x249795){logger[_0x8901('0x28')](_0x249795['stack']);if(_0x249795[_0x8901('0x3f')]){delete _0x249795[_0x8901('0x3f')];}_0x13c934[_0x8901('0x2d')](_0x1e4670)['send'](_0x249795);};}exports[_0x8901('0x40')]=function(_0x834eee,_0xb80ed0){var _0x338f32={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3f68fe={},_0x3f2f82={'count':0x0,'rows':[]};var _0x4ff90e=_['map'](db[_0x8901('0x41')][_0x8901('0x42')],function(_0x4d2b71){return{'name':_0x4d2b71[_0x8901('0x43')],'type':_0x4d2b71[_0x8901('0x44')][_0x8901('0x45')]};});_0x3f68fe['model']=_[_0x8901('0x46')](_0x4ff90e,'name');_0x3f68fe[_0x8901('0x47')]=_[_0x8901('0x48')](_0x834eee[_0x8901('0x47')]);_0x3f68fe[_0x8901('0x49')]=_['intersection'](_0x3f68fe[_0x8901('0x4a')],_0x3f68fe[_0x8901('0x47')]);_0x338f32[_0x8901('0x4b')]=_[_0x8901('0x4c')](_0x3f68fe[_0x8901('0x4a')],qs[_0x8901('0x4d')](_0x834eee[_0x8901('0x47')][_0x8901('0x4d')]));_0x338f32['attributes']=_0x338f32[_0x8901('0x4b')][_0x8901('0x4e')]?_0x338f32[_0x8901('0x4b')]:_0x3f68fe[_0x8901('0x4a')];if(!_0x834eee[_0x8901('0x47')][_0x8901('0x4f')](_0x8901('0x50'))){_0x338f32[_0x8901('0x32')]=qs['limit'](_0x834eee[_0x8901('0x47')][_0x8901('0x32')]);_0x338f32[_0x8901('0x30')]=qs['offset'](_0x834eee[_0x8901('0x47')][_0x8901('0x30')]);}_0x338f32[_0x8901('0x51')]=qs[_0x8901('0x52')](_0x834eee[_0x8901('0x47')][_0x8901('0x52')]);_0x338f32[_0x8901('0x53')]=qs[_0x8901('0x49')](_[_0x8901('0x54')](_0x834eee[_0x8901('0x47')],_0x3f68fe[_0x8901('0x49')]),_0x4ff90e);if(_0x834eee[_0x8901('0x47')][_0x8901('0x55')]){_0x338f32[_0x8901('0x53')]=_['merge'](_0x338f32[_0x8901('0x53')],{'$or':_['map'](_0x4ff90e,function(_0x31431c){if(_0x31431c['type']!==_0x8901('0x56')){var _0x3bdcd2={};_0x3bdcd2[_0x31431c[_0x8901('0x3f')]]={'$like':'%'+_0x834eee['query']['filter']+'%'};return _0x3bdcd2;}})});}_0x338f32=_['merge']({},_0x338f32,_0x834eee['options']);var _0x5d1efe={'where':_0x338f32['where']};return db['SmsAccount']['count'](_0x5d1efe)[_0x8901('0x39')](function(_0x1b6836){_0x3f2f82['count']=_0x1b6836;if(_0x834eee[_0x8901('0x47')][_0x8901('0x57')]){_0x338f32['include']=[{'all':!![]}];}return db[_0x8901('0x41')]['findAll'](_0x338f32);})['then'](function(_0x503dcf){_0x3f2f82[_0x8901('0x58')]=_0x503dcf;return _0x3f2f82;})[_0x8901('0x39')](respondWithFilteredResult(_0xb80ed0,_0x338f32))['catch'](handleError(_0xb80ed0,null));};exports[_0x8901('0x59')]=function(_0x181f97,_0x5bfbb9){var _0x44fbdc={'raw':![],'where':{'id':_0x181f97['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x20ee34={};_0x20ee34[_0x8901('0x4a')]=_[_0x8901('0x48')](db[_0x8901('0x41')][_0x8901('0x42')]);_0x20ee34[_0x8901('0x47')]=_[_0x8901('0x48')](_0x181f97[_0x8901('0x47')]);_0x20ee34[_0x8901('0x49')]=_[_0x8901('0x4c')](_0x20ee34[_0x8901('0x4a')],_0x20ee34['query']);_0x44fbdc[_0x8901('0x4b')]=_['intersection'](_0x20ee34[_0x8901('0x4a')],qs[_0x8901('0x4d')](_0x181f97[_0x8901('0x47')]['fields']));_0x44fbdc[_0x8901('0x4b')]=_0x44fbdc[_0x8901('0x4b')][_0x8901('0x4e')]?_0x44fbdc[_0x8901('0x4b')]:_0x20ee34[_0x8901('0x4a')];if(_0x181f97[_0x8901('0x47')]['includeAll']){_0x44fbdc[_0x8901('0x5a')]=[{'all':!![]}];}_0x44fbdc=_[_0x8901('0x5b')]({},_0x44fbdc,_0x181f97[_0x8901('0x5c')]);return db[_0x8901('0x41')][_0x8901('0x5d')](_0x44fbdc)[_0x8901('0x39')](handleEntityNotFound(_0x5bfbb9,null))[_0x8901('0x39')](respondWithResult(_0x5bfbb9,null))[_0x8901('0x2c')](handleError(_0x5bfbb9,null));};exports[_0x8901('0x5e')]=function(_0x4bdd7f,_0x31411f){return db['SmsAccount']['create'](_0x4bdd7f['body'],{})[_0x8901('0x39')](function(_0x5bd7e2){var _0x5e59f8=_0x4bdd7f[_0x8901('0x5f')][_0x8901('0x3b')]({'plain':!![]});if(!_0x5e59f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e59f8[_0x8901('0x60')]===_0x8901('0x5f')){var _0x2da222=_0x5bd7e2[_0x8901('0x3b')]({'plain':!![]});var _0xa1651b='SmsAccounts';return db[_0x8901('0x61')][_0x8901('0x5d')]({'where':{'name':_0xa1651b,'userProfileId':_0x5e59f8['userProfileId']},'raw':!![]})['then'](function(_0x56427f){if(_0x56427f&&_0x56427f[_0x8901('0x62')]===0x0){return db[_0x8901('0x3d')][_0x8901('0x5e')]({'name':_0x2da222[_0x8901('0x3f')],'resourceId':_0x2da222['id'],'type':_0x56427f[_0x8901('0x3f')],'sectionId':_0x56427f['id']},{})[_0x8901('0x39')](function(){return _0x5bd7e2;});}else{return _0x5bd7e2;}})['catch'](function(_0x4f80f7){logger[_0x8901('0x28')](_0x8901('0x63'),_0x4f80f7);throw _0x4f80f7;});}return _0x5bd7e2;})[_0x8901('0x39')](respondWithResult(_0x31411f,0xc9))['catch'](handleError(_0x31411f,null));};exports[_0x8901('0x38')]=function(_0x15ad73,_0x389fdf){if(_0x15ad73[_0x8901('0x64')]['id']){delete _0x15ad73[_0x8901('0x64')]['id'];}return db[_0x8901('0x41')]['find']({'where':{'id':_0x15ad73['params']['id']},'include':[{'model':db[_0x8901('0x65')],'as':'mandatoryDispositionPause'}]})[_0x8901('0x39')](handleEntityNotFound(_0x389fdf,null))[_0x8901('0x39')](saveUpdates(_0x15ad73[_0x8901('0x64')],null))[_0x8901('0x39')](respondWithResult(_0x389fdf,null))[_0x8901('0x2c')](handleError(_0x389fdf,null));};exports[_0x8901('0x3a')]=function(_0x5b2f64,_0x3b89d0){return db['SmsAccount'][_0x8901('0x5d')]({'where':{'id':_0x5b2f64[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x3b89d0,null))['then'](removeEntity(_0x3b89d0,null))[_0x8901('0x2c')](handleError(_0x3b89d0,null));};exports[_0x8901('0x67')]=function(_0x1aea96,_0x8d2a8a){return db[_0x8901('0x41')][_0x8901('0x67')]()['then'](respondWithResult(_0x8d2a8a,null))[_0x8901('0x2c')](handleError(_0x8d2a8a,null));};exports[_0x8901('0x68')]=function(_0x1bd2cf,_0x22a5bb,_0x61019e){if(_0x1bd2cf[_0x8901('0x64')]['id']){delete _0x1bd2cf[_0x8901('0x64')]['id'];}return db[_0x8901('0x41')]['find']({'where':{'id':_0x1bd2cf[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x22a5bb,null))['then'](function(_0x941530){if(_0x941530){_0x1bd2cf[_0x8901('0x64')][_0x8901('0x69')]=_0x941530['id'];return db['Disposition'][_0x8901('0x5e')](_0x1bd2cf[_0x8901('0x64')]);}})[_0x8901('0x39')](respondWithResult(_0x22a5bb,null))[_0x8901('0x2c')](handleError(_0x22a5bb,null));};exports[_0x8901('0x6a')]=function(_0xc83792,_0x123c02,_0x23b17d){var _0x3af116={'raw':![],'where':{}};var _0x33637b={};var _0x1e4a73={'count':0x0,'rows':[]};return db[_0x8901('0x41')][_0x8901('0x6b')]({'where':{'id':_0xc83792[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x123c02,null))[_0x8901('0x39')](function(_0x5ef65a){if(_0x5ef65a){_0x33637b[_0x8901('0x4a')]=_[_0x8901('0x48')](db[_0x8901('0x6c')][_0x8901('0x42')]);_0x33637b[_0x8901('0x47')]=_[_0x8901('0x48')](_0xc83792[_0x8901('0x47')]);_0x33637b[_0x8901('0x49')]=_['intersection'](_0x33637b['model'],_0x33637b[_0x8901('0x47')]);_0x3af116[_0x8901('0x4b')]=_['intersection'](_0x33637b[_0x8901('0x4a')],qs['fields'](_0xc83792['query'][_0x8901('0x4d')]));_0x3af116[_0x8901('0x4b')]=_0x3af116['attributes'][_0x8901('0x4e')]?_0x3af116[_0x8901('0x4b')]:_0x33637b[_0x8901('0x4a')];if(!_0xc83792[_0x8901('0x47')]['hasOwnProperty']('nolimit')){_0x3af116[_0x8901('0x32')]=qs[_0x8901('0x32')](_0xc83792[_0x8901('0x47')][_0x8901('0x32')]);_0x3af116['offset']=qs[_0x8901('0x30')](_0xc83792[_0x8901('0x47')][_0x8901('0x30')]);}_0x3af116[_0x8901('0x51')]=qs['sort'](_0xc83792[_0x8901('0x47')][_0x8901('0x52')]);_0x3af116[_0x8901('0x53')]=qs['filters'](_[_0x8901('0x54')](_0xc83792[_0x8901('0x47')],_0x33637b[_0x8901('0x49')]));_0x3af116[_0x8901('0x53')][_0x8901('0x69')]=_0x5ef65a['id'];if(_0xc83792[_0x8901('0x47')][_0x8901('0x55')]){_0x3af116[_0x8901('0x53')]=_[_0x8901('0x5b')](_0x3af116[_0x8901('0x53')],{'$or':_[_0x8901('0x46')](_0x3af116[_0x8901('0x4b')],function(_0x473df8){var _0x5f3040={};_0x5f3040[_0x473df8]={'$like':'%'+_0xc83792[_0x8901('0x47')][_0x8901('0x55')]+'%'};return _0x5f3040;})});}_0x3af116=_[_0x8901('0x5b')]({},_0x3af116,_0xc83792[_0x8901('0x5c')]);return db[_0x8901('0x6c')][_0x8901('0x6d')]({'where':_0x3af116[_0x8901('0x53')]})[_0x8901('0x39')](function(_0x4a4bc3){_0x1e4a73[_0x8901('0x6d')]=_0x4a4bc3;if(_0xc83792[_0x8901('0x47')]['includeAll']){_0x3af116['include']=[{'all':!![]}];}return db[_0x8901('0x6c')]['findAll'](_0x3af116);})[_0x8901('0x39')](function(_0x4b1c74){_0x1e4a73['rows']=_0x4b1c74;return _0x1e4a73;});}})[_0x8901('0x39')](respondWithFilteredResult(_0x123c02,_0x3af116))[_0x8901('0x2c')](handleError(_0x123c02,null));};exports[_0x8901('0x6e')]=function(_0x288502,_0xcfc7ac,_0x449335){return db['SmsAccount']['find']({'where':{'id':_0x288502[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0xcfc7ac,null))[_0x8901('0x39')](function(_0x41a98a){if(_0x41a98a){return _0x41a98a['removeDispositions'](_0x288502[_0x8901('0x47')][_0x8901('0x6f')]);}})[_0x8901('0x39')](respondWithStatusCode(_0xcfc7ac,null))[_0x8901('0x2c')](handleError(_0xcfc7ac,null));};exports[_0x8901('0x70')]=function(_0x40c4a9,_0x333e1d,_0x263236){if(_0x40c4a9[_0x8901('0x64')]['id']){delete _0x40c4a9['body']['id'];}return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x40c4a9[_0x8901('0x66')]['id']}})['then'](handleEntityNotFound(_0x333e1d,null))[_0x8901('0x39')](function(_0xd0725){if(_0xd0725){_0x40c4a9[_0x8901('0x64')][_0x8901('0x69')]=_0xd0725['id'];return db[_0x8901('0x71')][_0x8901('0x5e')](_0x40c4a9[_0x8901('0x64')]);}})['then'](respondWithResult(_0x333e1d,null))[_0x8901('0x2c')](handleError(_0x333e1d,null));};exports[_0x8901('0x72')]=function(_0x49b4c7,_0x180a60,_0x2eb7e7){var _0x42d0e7={'raw':![],'where':{}};var _0x428db5={};var _0x58daae={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8901('0x6b')]({'where':{'id':_0x49b4c7['params']['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x180a60,null))[_0x8901('0x39')](function(_0x5cbd14){if(_0x5cbd14){_0x428db5['model']=_[_0x8901('0x48')](db[_0x8901('0x71')][_0x8901('0x42')]);_0x428db5['query']=_[_0x8901('0x48')](_0x49b4c7['query']);_0x428db5[_0x8901('0x49')]=_['intersection'](_0x428db5['model'],_0x428db5[_0x8901('0x47')]);_0x42d0e7[_0x8901('0x4b')]=_[_0x8901('0x4c')](_0x428db5[_0x8901('0x4a')],qs[_0x8901('0x4d')](_0x49b4c7['query'][_0x8901('0x4d')]));_0x42d0e7[_0x8901('0x4b')]=_0x42d0e7['attributes'][_0x8901('0x4e')]?_0x42d0e7[_0x8901('0x4b')]:_0x428db5[_0x8901('0x4a')];if(!_0x49b4c7['query'][_0x8901('0x4f')](_0x8901('0x50'))){_0x42d0e7['limit']=qs[_0x8901('0x32')](_0x49b4c7[_0x8901('0x47')][_0x8901('0x32')]);_0x42d0e7[_0x8901('0x30')]=qs[_0x8901('0x30')](_0x49b4c7['query'][_0x8901('0x30')]);}_0x42d0e7[_0x8901('0x51')]=qs[_0x8901('0x52')](_0x49b4c7[_0x8901('0x47')][_0x8901('0x52')]);_0x42d0e7[_0x8901('0x53')]=qs['filters'](_[_0x8901('0x54')](_0x49b4c7[_0x8901('0x47')],_0x428db5[_0x8901('0x49')]));_0x42d0e7['where'][_0x8901('0x69')]=_0x5cbd14['id'];if(_0x49b4c7[_0x8901('0x47')][_0x8901('0x55')]){_0x42d0e7['where']=_[_0x8901('0x5b')](_0x42d0e7['where'],{'$or':_['map'](_0x42d0e7['attributes'],function(_0x32d483){var _0xd1b4ee={};_0xd1b4ee[_0x32d483]={'$like':'%'+_0x49b4c7[_0x8901('0x47')][_0x8901('0x55')]+'%'};return _0xd1b4ee;})});}_0x42d0e7=_[_0x8901('0x5b')]({},_0x42d0e7,_0x49b4c7[_0x8901('0x5c')]);return db[_0x8901('0x71')][_0x8901('0x6d')]({'where':_0x42d0e7[_0x8901('0x53')]})[_0x8901('0x39')](function(_0x485a41){_0x58daae[_0x8901('0x6d')]=_0x485a41;if(_0x49b4c7[_0x8901('0x47')][_0x8901('0x57')]){_0x42d0e7['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8901('0x73')](_0x42d0e7);})[_0x8901('0x39')](function(_0x3ec185){_0x58daae['rows']=_0x3ec185;return _0x58daae;});}})[_0x8901('0x39')](respondWithFilteredResult(_0x180a60,_0x42d0e7))[_0x8901('0x2c')](handleError(_0x180a60,null));};exports[_0x8901('0x74')]=function(_0x1237bd,_0x16e149,_0x1dea6b){return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x1237bd[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x16e149,null))[_0x8901('0x39')](function(_0x5c4037){if(_0x5c4037){return _0x5c4037[_0x8901('0x74')](_0x1237bd[_0x8901('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x16e149,null))[_0x8901('0x2c')](handleError(_0x16e149,null));};exports[_0x8901('0x75')]=function(_0x26b3ad,_0x58711b,_0x555836){var _0x4e22f1={'channel':_0x8901('0x76')};var _0x328b48=[];var _0x3384d3=[];var _0x3398f1={};return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x26b3ad[_0x8901('0x66')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x8901('0x77')}]})[_0x8901('0x39')](handleEntityNotFound(_0x58711b,null))['then'](function(_0x3de848){_0x4e22f1[_0x8901('0x78')]=_0x3de848;_0x4e22f1[_0x8901('0x79')]=_['orderBy'](_0x3de848[_0x8901('0x77')],['priority'],[_0x8901('0x7a')]);if(_0x4e22f1[_0x8901('0x78')][_0x8901('0x77')]){delete _0x4e22f1[_0x8901('0x78')]['Applications'];}return db[_0x8901('0x7b')][_0x8901('0x67')]();})['then'](function(_0x22daeb){if(!_0x22daeb){throw new db[(_0x8901('0x7c'))][(_0x8901('0x7d'))]('no\x20available\x20attributes');}_0x328b48=_[_0x8901('0x7e')](_[_0x8901('0x48')](_0x22daeb),[_0x8901('0x7f'),_0x8901('0x80')]);_0x3384d3=_[_0x8901('0x7e')](_[_0x8901('0x48')](_0x22daeb),[_0x8901('0x7f'),'updatedAt',_0x8901('0x81'),_0x8901('0x82')]);_0x4e22f1['body']={'mapKey':'mobile'};if(_0x4e22f1[_0x8901('0x78')][_0x8901('0x44')]){switch(_0x4e22f1[_0x8901('0x78')][_0x8901('0x44')]){case _0x8901('0x83'):_0x4e22f1[_0x8901('0x64')]['from']=_0x26b3ad[_0x8901('0x64')][_0x8901('0x84')];_0x4e22f1['body'][_0x8901('0x64')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x85')];_0x4e22f1[_0x8901('0x64')][_0x8901('0x86')]=_0x26b3ad[_0x8901('0x64')]['MessageSid'];break;case _0x8901('0x87'):_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')]='+'+_0x26b3ad[_0x8901('0x64')][_0x8901('0x89')];_0x4e22f1['body'][_0x8901('0x64')]=_0x26b3ad['body'][_0x8901('0x8a')];break;case _0x8901('0x8b'):_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x88')];_0x4e22f1[_0x8901('0x64')]['body']=_0x26b3ad['body'][_0x8901('0x2a')];break;case _0x8901('0x8c'):_0x4e22f1['body'][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')]['from'];_0x4e22f1[_0x8901('0x64')][_0x8901('0x64')]=_0x26b3ad[_0x8901('0x64')]['body'];_0x4e22f1[_0x8901('0x64')][_0x8901('0x86')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x8d')];break;case _0x8901('0x8e'):_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x84')];_0x4e22f1[_0x8901('0x64')]['body']=_0x26b3ad['body']['Text'];_0x4e22f1['body'][_0x8901('0x86')]=_0x26b3ad['body'][_0x8901('0x8f')];break;case _0x8901('0x90'):_0x4e22f1['body'][_0x8901('0x88')]='+'+_0x26b3ad[_0x8901('0x64')][_0x8901('0x91')][0x0][_0x8901('0x88')];_0x4e22f1[_0x8901('0x64')][_0x8901('0x64')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x91')][0x0][_0x8901('0x8a')];_0x4e22f1[_0x8901('0x64')][_0x8901('0x86')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x91')][0x0][_0x8901('0x86')];break;case _0x8901('0x92'):_0x4e22f1[_0x8901('0x64')]['from']=_0x26b3ad['body']['originatingAddress'];_0x4e22f1['body'][_0x8901('0x64')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x93')][_0x8901('0x2a')];break;case'clickatell':_0x4e22f1['body'][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x94')];_0x4e22f1['body'][_0x8901('0x64')]=_0x26b3ad['body'][_0x8901('0x8a')];_0x4e22f1[_0x8901('0x64')][_0x8901('0x86')]=_0x26b3ad[_0x8901('0x64')]['replyMessageId'];break;case _0x8901('0x95'):_0x4e22f1[_0x8901('0x64')]['messageId']=_0x26b3ad[_0x8901('0x64')][0x0][_0x8901('0x2a')]['id'];_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')][0x0]['message'][_0x8901('0x88')];_0x4e22f1['body'][_0x8901('0x64')]=_0x26b3ad['body'][0x0]['message'][_0x8901('0x8a')];break;case _0x8901('0x96'):_0x4e22f1['body'][_0x8901('0x88')]=_0x26b3ad[_0x8901('0x64')][_0x8901('0x88')];_0x4e22f1[_0x8901('0x64')][_0x8901('0x64')]=_0x26b3ad[_0x8901('0x64')]['message'];_0x4e22f1['body']['messageId']=_0x26b3ad[_0x8901('0x64')][_0x8901('0x97')];break;}}if(_0x4e22f1[_0x8901('0x64')]['id']){delete _0x4e22f1[_0x8901('0x64')]['id'];}if(_[_0x8901('0x98')](_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0x8901('0x98')](_0x4e22f1[_0x8901('0x64')][_0x8901('0x64')])||_0x4e22f1[_0x8901('0x64')]['body']===''){throw new db['Sequelize'][(_0x8901('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8901('0x98')](_0x4e22f1['body'][_0x8901('0x99')])){throw new db[(_0x8901('0x7c'))]['ValidationError'](_0x8901('0x9a')+_0x3384d3);}if(!_[_0x8901('0x9b')](_0x3384d3,_0x4e22f1[_0x8901('0x64')][_0x8901('0x99')])){throw new db[(_0x8901('0x7c'))][(_0x8901('0x7d'))](_0x8901('0x9c')+_0x3384d3);}_0x3398f1[_0x4e22f1[_0x8901('0x64')][_0x8901('0x99')]]=_0x4e22f1[_0x8901('0x64')]['from'];return db['CmList'][_0x8901('0x5d')]({'where':{'id':_0x4e22f1[_0x8901('0x78')][_0x8901('0x82')]},'include':[{'model':db[_0x8901('0x7b')],'as':_0x8901('0x9d'),'where':_0x3398f1,'limit':0x1,'order':[[_0x8901('0x80'),_0x8901('0x9e')]]}]});})[_0x8901('0x39')](handleEntityNotFound(_0x58711b,null))['then'](function(_0x427179){if(_0x427179){_0x4e22f1['list']=_[_0x8901('0x9f')](_0x427179,[_0x8901('0x9d')]);if(_0x427179[_0x8901('0x9d')]['length']){return _0x427179['Contacts'][0x0];}var _0x53ce18=_['defaults'](_0x4e22f1[_0x8901('0x64')],{'firstName':_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')],'ListId':_0x427179['id']});_0x53ce18[_0x4e22f1['body']['mapKey']]=_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')];return db[_0x8901('0x7b')][_0x8901('0x5e')](_0x53ce18,{'fields':_0x328b48,'raw':!![]});}})[_0x8901('0x39')](handleEntityNotFound(_0x58711b,null))['then'](function(_0x1440aa){if(_0x1440aa){_0x4e22f1[_0x8901('0xa0')]=_0x1440aa;var _0xb666f0={'ContactId':_0x1440aa['id'],'phone':_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')],'SmsAccountId':_0x26b3ad['params']['id']};var _0x4f78fc={'ContactId':_0x1440aa['id'],'SmsAccountId':_0x26b3ad[_0x8901('0x66')]['id'],'closed':![]};return db[_0x8901('0xa1')][_0x8901('0x5d')]({'where':_0x4f78fc})['then'](function(_0x3e568b){if(_0x3e568b){return[_0x3e568b,![]];}return db[_0x8901('0xa1')][_0x8901('0x5e')](_0xb666f0)['then'](function(_0x4cb45f){return[_0x4cb45f,!![]];});});}})['spread'](function(_0x8c9319,_0x254464){_0x4e22f1[_0x8901('0xa2')]=_0x8c9319[_0x8901('0x3b')]({'plain':!![]});_0x4e22f1[_0x8901('0xa2')][_0x8901('0xa3')]=![];if(_0x254464){if(_0x4e22f1[_0x8901('0x78')][_0x8901('0xa4')]){_0x4e22f1[_0x8901('0x79')][_0x8901('0xa5')]({'id':0x0,'priority':_0x4e22f1[_0x8901('0x79')][_0x8901('0x4e')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x8901('0xa6')});}_0x4e22f1['interaction']['created']=!![];}return db['SmsMessage'][_0x8901('0x5e')]({'phone':_0x4e22f1[_0x8901('0x64')][_0x8901('0x88')],'messageId':_0x4e22f1[_0x8901('0x64')][_0x8901('0x86')],'body':_0x4e22f1['body'][_0x8901('0x64')],'SmsAccountId':_0x26b3ad['params']['id'],'SmsInteractionId':_0x8c9319['id'],'direction':'in','ContactId':_0x8c9319[_0x8901('0xa7')],'AttachmentId':_0x4e22f1['body']['AttachmentId']});})[_0x8901('0x39')](function(_0x33d2de){_0x4e22f1[_0x8901('0x2a')]=_0x33d2de;if(!_0x4e22f1[_0x8901('0xa2')][_0x8901('0xa8')])return;return db[_0x8901('0xa9')]['find']({'attributes':['id','name'],'where':{'id':_0x4e22f1['interaction'][_0x8901('0xa8')]}});})['then'](function(_0x68c674){if(_0x68c674){_0x4e22f1['applications'][_0x8901('0xaa')]({'id':0x0,'priority':0x0,'app':_0x8901('0xab'),'appdata':_0x68c674[_0x8901('0x3f')]+','+(_0x4e22f1[_0x8901('0x78')]['waitForTheAssignedAgent']||0xa),'interval':_0x8901('0xa6')});}if(!_0x4e22f1['interaction'][_0x8901('0xac')])return;return db['SmsQueue'][_0x8901('0x5d')]({'attributes':['id','name'],'where':{'id':_0x4e22f1[_0x8901('0xa2')][_0x8901('0xac')]}});})['then'](function(_0x287f59){if(_0x287f59){_0x4e22f1[_0x8901('0x79')][_0x8901('0xaa')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x287f59['name']+','+(_0x4e22f1[_0x8901('0x78')][_0x8901('0xad')]||0x12c),'interval':_0x8901('0xa6')});}return respondWithRpcPromise(_0x8901('0xae'),_0x8901('0xaf'),_0x4e22f1);})[_0x8901('0x39')](function(_0x5d2908){if(_0x5d2908){var _0x4eab11=0xc8;var _0x57baa5='receiveMessage';logger[_0x8901('0x22')](_0x8901('0x26'),_0x57baa5,_0x4eab11,_0x8901('0xb0'));logger[_0x8901('0x25')](_0x8901('0xb1'),_0x57baa5,_0x4eab11,_0x8901('0xb0'),JSON['stringify'](_0x5d2908));if(_0x4e22f1['account'][_0x8901('0x44')]===_0x8901('0x83')){return _0x58711b[_0x8901('0x2d')](_0x4eab11)['set'](_0x8901('0xb2'),_0x8901('0xb3'))[_0x8901('0xb4')](_0x8901('0xb5'));}else{return _0x58711b[_0x8901('0x2d')](_0x4eab11)[_0x8901('0x2f')](_0x5d2908);}}})[_0x8901('0x2c')](handleError(_0x58711b,null));};exports[_0x8901('0xb6')]=function(_0x5a134f,_0x29c9b2){var _0x22ad1c=_0x5a134f['params']['id'];var _0x31731e=_0x5a134f[_0x8901('0x64')];var _0x2f8da9=0xc8;var _0x1e54ea=null;return db[_0x8901('0xb7')][_0x8901('0xb8')]({'isolationLevel':db[_0x8901('0xb7')][_0x8901('0xb9')]['ISOLATION_LEVELS'][_0x8901('0xba')]},function(_0x2a511f){return db[_0x8901('0x41')][_0x8901('0x6b')]({'where':{'id':_0x22ad1c},'transaction':_0x2a511f})[_0x8901('0x39')](function(_0x31cfbf){if(_0x31cfbf){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x22ad1c},'transaction':_0x2a511f})[_0x8901('0x39')](function(){var _0x3e7cfd=_[_0x8901('0x46')](_0x31731e,function(_0xbd0fad){_0xbd0fad[_0x8901('0x69')]=_0x22ad1c;return _0xbd0fad;});return db[_0x8901('0xbb')]['bulkCreate'](_0x3e7cfd,{'transaction':_0x2a511f});});}else{_0x2f8da9=0x194;_0x1e54ea=[];}});})[_0x8901('0x39')](function(){if(_0x2f8da9!==0x194){return db[_0x8901('0xbb')][_0x8901('0xbc')]({'where':{'SmsAccountId':_0x22ad1c},'order':_0x8901('0xbd')})['then'](function(_0x39ec26){_0x1e54ea=_0x39ec26;});}})['catch'](function(_0x405445){_0x2f8da9=0x1f4;logger['error'](_0x405445[_0x8901('0xbe')]);if(_0x405445[_0x8901('0x3f')]){delete _0x405445[_0x8901('0x3f')];}_0x1e54ea=_0x405445;})[_0x8901('0xbf')](function(){if(_0x1e54ea===null){_0x29c9b2[_0x8901('0x3e')](_0x2f8da9);}else{if(_0x2f8da9===0x1f4){_0x29c9b2[_0x8901('0x2d')](_0x2f8da9)[_0x8901('0xb4')](_0x1e54ea);}else{_0x29c9b2['status'](_0x2f8da9)[_0x8901('0x2f')](_0x1e54ea);}}});};exports[_0x8901('0xc0')]=function(_0x157026,_0x46056a,_0x120536){var _0x27750b={};var _0x1966d0={};var _0x1b4468;var _0x1890d4;return db['SmsAccount'][_0x8901('0x6b')]({'where':{'id':_0x157026[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x46056a,null))[_0x8901('0x39')](function(_0x33582f){if(_0x33582f){_0x1b4468=_0x33582f;_0x1966d0[_0x8901('0x4a')]=_[_0x8901('0x48')](db['SmsApplication'][_0x8901('0x42')]);_0x1966d0[_0x8901('0x47')]=_['keys'](_0x157026['query']);_0x1966d0[_0x8901('0x49')]=_[_0x8901('0x4c')](_0x1966d0['model'],_0x1966d0[_0x8901('0x47')]);_0x27750b[_0x8901('0x4b')]=_[_0x8901('0x4c')](_0x1966d0['model'],qs[_0x8901('0x4d')](_0x157026[_0x8901('0x47')][_0x8901('0x4d')]));_0x27750b[_0x8901('0x4b')]=_0x27750b[_0x8901('0x4b')][_0x8901('0x4e')]?_0x27750b[_0x8901('0x4b')]:_0x1966d0[_0x8901('0x4a')];_0x27750b[_0x8901('0x51')]=qs['sort'](_0x157026[_0x8901('0x47')][_0x8901('0x52')]);_0x27750b[_0x8901('0x53')]=qs['filters'](_[_0x8901('0x54')](_0x157026[_0x8901('0x47')],_0x1966d0[_0x8901('0x49')]));if(_0x157026[_0x8901('0x47')][_0x8901('0x55')]){_0x27750b[_0x8901('0x53')]=_['merge'](_0x27750b[_0x8901('0x53')],{'$or':_[_0x8901('0x46')](_0x27750b['attributes'],function(_0x2429d1){var _0x418e98={};_0x418e98[_0x2429d1]={'$like':'%'+_0x157026[_0x8901('0x47')][_0x8901('0x55')]+'%'};return _0x418e98;})});}_0x27750b=_[_0x8901('0x5b')]({},_0x27750b,_0x157026[_0x8901('0x5c')]);return _0x1b4468[_0x8901('0xc0')](_0x27750b);}})[_0x8901('0x39')](function(_0x478e5a){if(_0x478e5a){_0x1890d4=_0x478e5a[_0x8901('0x4e')];if(!_0x157026['query'][_0x8901('0x4f')](_0x8901('0x50'))){_0x27750b['limit']=qs[_0x8901('0x32')](_0x157026[_0x8901('0x47')][_0x8901('0x32')]);_0x27750b[_0x8901('0x30')]=qs['offset'](_0x157026[_0x8901('0x47')][_0x8901('0x30')]);}return _0x1b4468[_0x8901('0xc0')](_0x27750b);}})['then'](function(_0x1fc245){if(_0x1fc245){return _0x1fc245?{'count':_0x1890d4,'rows':_0x1fc245}:null;}})[_0x8901('0x39')](respondWithResult(_0x46056a,null))['catch'](handleError(_0x46056a,null));};exports['getInteractions']=function(_0x2052e7,_0x40a4c3,_0x4a84c6){var _0x44d7d0={'raw':![],'where':{}};var _0x3acc79={};var _0x3d85ac={'count':0x0,'rows':[]};return db[_0x8901('0x41')]['findOne']({'where':{'id':_0x2052e7[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x40a4c3,null))[_0x8901('0x39')](function(_0x2cd75b){if(_0x2cd75b){_0x3acc79[_0x8901('0x4a')]=_[_0x8901('0x48')](db[_0x8901('0xa1')][_0x8901('0x42')]);_0x3acc79[_0x8901('0x47')]=_['keys'](_0x2052e7[_0x8901('0x47')]);_0x3acc79[_0x8901('0x49')]=_[_0x8901('0x4c')](_0x3acc79['model'],_0x3acc79['query']);_0x44d7d0[_0x8901('0x4b')]=_[_0x8901('0x4c')](_0x3acc79['model'],qs['fields'](_0x2052e7[_0x8901('0x47')][_0x8901('0x4d')]));_0x44d7d0[_0x8901('0x4b')]=_0x44d7d0[_0x8901('0x4b')][_0x8901('0x4e')]?_0x44d7d0[_0x8901('0x4b')]:_0x3acc79[_0x8901('0x4a')];if(!_0x2052e7[_0x8901('0x47')]['hasOwnProperty'](_0x8901('0x50'))){_0x44d7d0[_0x8901('0x32')]=qs[_0x8901('0x32')](_0x2052e7[_0x8901('0x47')][_0x8901('0x32')]);_0x44d7d0[_0x8901('0x30')]=qs[_0x8901('0x30')](_0x2052e7[_0x8901('0x47')][_0x8901('0x30')]);}_0x44d7d0[_0x8901('0x51')]=qs[_0x8901('0x52')](_0x2052e7['query'][_0x8901('0x52')]);_0x44d7d0[_0x8901('0x53')]=qs['filters'](_[_0x8901('0x54')](_0x2052e7[_0x8901('0x47')],_0x3acc79[_0x8901('0x49')]));_0x44d7d0[_0x8901('0x53')][_0x8901('0x69')]=_0x2cd75b['id'];if(_0x2052e7['query']['filter']){_0x44d7d0[_0x8901('0x53')]=_[_0x8901('0x5b')](_0x44d7d0[_0x8901('0x53')],{'$or':_[_0x8901('0x46')](_0x44d7d0[_0x8901('0x4b')],function(_0x1574b9){var _0x277485={};_0x277485[_0x1574b9]={'$like':'%'+_0x2052e7[_0x8901('0x47')][_0x8901('0x55')]+'%'};return _0x277485;})});}_0x44d7d0=_['merge']({},_0x44d7d0,_0x2052e7[_0x8901('0x5c')]);return db[_0x8901('0xa1')]['count']({'where':_0x44d7d0[_0x8901('0x53')]})[_0x8901('0x39')](function(_0x5e94a4){_0x3d85ac['count']=_0x5e94a4;if(_0x2052e7[_0x8901('0x47')]['includeAll']){_0x44d7d0[_0x8901('0x5a')]=[{'model':db[_0x8901('0x7b')],'as':_0x8901('0xc1'),'required':![]},{'model':db[_0x8901('0xa9')],'as':_0x8901('0xc2'),'attributes':[_0x8901('0x3f'),_0x8901('0xc3'),_0x8901('0xc4')],'required':![]},{'model':db['Tag'],'as':_0x8901('0xc5'),'attributes':['id',_0x8901('0x3f'),_0x8901('0xc6')],'where':_0x2052e7[_0x8901('0x47')]['tag']?{'id':_0x2052e7[_0x8901('0x47')]['tag']}:undefined,'required':_0x2052e7[_0x8901('0x47')]['tag']?!![]:![]}];}return db[_0x8901('0xa1')][_0x8901('0x73')](_0x44d7d0);})['then'](function(_0x95996b){_0x3d85ac[_0x8901('0x58')]=_0x95996b;return _0x3d85ac;});}})[_0x8901('0x39')](respondWithFilteredResult(_0x40a4c3,_0x44d7d0))[_0x8901('0x2c')](handleError(_0x40a4c3,null));};exports[_0x8901('0xb4')]=function(_0x14cc87,_0x305b6d,_0x3bd339){var _0x576474,_0xecce28,_0x1b9f3e;if(_[_0x8901('0x98')](_0x14cc87[_0x8901('0x64')][_0x8901('0x64')])||_0x14cc87[_0x8901('0x64')]['body']===''){throw new db[(_0x8901('0x7c'))][(_0x8901('0x7d'))](_0x8901('0xc7'));}if(_['isNil'](_0x14cc87['body']['to'])){throw new db[(_0x8901('0x7c'))][(_0x8901('0x7d'))](_0x8901('0xc8'));}_0x576474=_0x14cc87['body']['to'];return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x14cc87[_0x8901('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0x8901('0xc9'),'include':[{'model':db[_0x8901('0x7b')],'as':'Contacts','where':{'mobile':_0x576474},'limit':0x1,'order':[[_0x8901('0x80'),_0x8901('0x9e')]]}]}]})[_0x8901('0x39')](handleEntityNotFound(_0x305b6d,null))[_0x8901('0x39')](function(_0x231d47){if(_0x231d47&&_0x231d47['List']){_0xecce28=_0x231d47['get']({'plain':!![]});if(_0xecce28['List']&&_0xecce28[_0x8901('0xc9')][_0x8901('0x9d')]['length']){return _0xecce28[_0x8901('0xc9')][_0x8901('0x9d')][0x0];}return db['CmContact']['create'](_['defaults'](_0x14cc87[_0x8901('0x64')],{'firstName':_0x576474,'mobile':_0x576474,'phone':_0x576474,'ListId':_0xecce28[_0x8901('0x82')]}));}})['then'](handleEntityNotFound(_0x305b6d,null))['then'](function(_0x12e158){if(_0x12e158){_0x1b9f3e=_0x12e158;return db[_0x8901('0xa1')][_0x8901('0x5d')]({'where':{'ContactId':_0x1b9f3e['id'],'closed':![],'SmsAccountId':_0xecce28['id']}})[_0x8901('0x39')](function(_0xbdef9f){if(_0xbdef9f){return[_0xbdef9f,![]];}return db[_0x8901('0xa1')][_0x8901('0x5e')]({'UserId':_0x14cc87[_0x8901('0x5f')]['id'],'ContactId':_0x1b9f3e['id'],'SmsAccountId':_0xecce28['id'],'phone':_0x576474,'firstMsgDirection':'out','Messages':[_[_0x8901('0x5b')](_0x14cc87[_0x8901('0x64')],{'read':![],'body':_0x14cc87[_0x8901('0x64')][_0x8901('0x64')],'phone':_0x576474,'SmsAccountId':_0xecce28['id'],'UserId':_0x14cc87[_0x8901('0x5f')]['id'],'ContactId':_0x1b9f3e['id']})]},{'include':[{'model':db[_0x8901('0xca')],'as':_0x8901('0xcb')}]})[_0x8901('0x39')](function(_0x123e1c){return[_0x123e1c,!![]];});});}})[_0x8901('0xcc')](function(_0x394ef6,_0x16a9b9){if(_0x16a9b9){return _0x394ef6;}return db['SmsMessage'][_0x8901('0x5e')](_['merge'](_0x14cc87[_0x8901('0x64')],{'read':![],'body':_0x14cc87[_0x8901('0x64')][_0x8901('0x64')],'phone':_0x576474,'SmsAccountId':_0xecce28['id'],'SmsInteractionId':_0x394ef6['id'],'UserId':_0x14cc87[_0x8901('0x5f')]['id'],'ContactId':_0x1b9f3e['id']}))[_0x8901('0x39')](function(_0x66364e){_0x394ef6['dataValues']['Messages']=[];_0x394ef6[_0x8901('0xcd')][_0x8901('0xcb')]['push'](_0x66364e[_0x8901('0xcd')]);return _0x394ef6;});})['then'](respondWithResult(_0x305b6d,null))[_0x8901('0x2c')](handleError(_0x305b6d,null));};exports['status']=function(_0x48669f,_0x3a9a8,_0x998cff){if(_0x48669f[_0x8901('0x64')]['id']){delete _0x48669f[_0x8901('0x64')]['id'];}var _0x1f2341,_0x3c1656,_0xc27066;return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x48669f[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x3a9a8,null))[_0x8901('0x39')](function(_0xf4173){if(_0xf4173){_0xc27066=_0xf4173;logger[_0x8901('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x8901('0xce'),_0xf4173[_0x8901('0x44')],util['inspect'](_0x48669f[_0x8901('0x64')],{'showHidden':![],'depth':null}));switch(_0xf4173[_0x8901('0x44')]){case'skebby':if(_0x48669f[_0x8901('0x64')][_0x8901('0xcf')]&&_0x48669f['body'][_0x8901('0x2d')]){_0x3c1656=_0x48669f[_0x8901('0x64')][_0x8901('0x2d')];return db[_0x8901('0xca')]['find']({'where':{'messageId':_0x48669f[_0x8901('0x64')][_0x8901('0xcf')]}});}break;case _0x8901('0x8b'):if(_0x48669f[_0x8901('0x64')][_0x8901('0xd0')]&&_0x48669f[_0x8901('0x64')][_0x8901('0xd1')]){_0x3c1656=_0x48669f[_0x8901('0x64')][_0x8901('0xd1')];return db['SmsMessage'][_0x8901('0x5d')]({'where':{'messageId':_0x48669f[_0x8901('0x64')]['requestid']}});}break;case _0x8901('0x8c'):if(_0x48669f[_0x8901('0x64')]['message_id']&&_0x48669f[_0x8901('0x64')][_0x8901('0xd2')]){_0x3c1656=_0x48669f['body'][_0x8901('0xd2')];return db[_0x8901('0xca')][_0x8901('0x5d')]({'where':{'messageId':_0x48669f[_0x8901('0x64')]['message_id']}});}break;case _0x8901('0x90'):var _0x575e79=_0x48669f[_0x8901('0x64')][_0x8901('0x91')][0x0];if(_0x575e79['messageId']&&_0x575e79[_0x8901('0x2d')][_0x8901('0xd3')]===_0x8901('0xd4')){_0x3c1656=_0x575e79[_0x8901('0x2d')][_0x8901('0xd3')];return db[_0x8901('0xca')][_0x8901('0x5d')]({'where':{'messageId':_0x575e79[_0x8901('0x86')]}});}break;case _0x8901('0xd5'):if(_0x48669f[_0x8901('0x64')]['messageId']&&_0x48669f[_0x8901('0x64')]['status']){_0x3c1656=_0x48669f[_0x8901('0x64')][_0x8901('0x2d')];return db[_0x8901('0xca')][_0x8901('0x5d')]({'where':{'messageId':_0x48669f['body'][_0x8901('0x86')]}});}break;case _0x8901('0x95'):if(_0x48669f[_0x8901('0x64')][0x0][_0x8901('0x2a')]['id']){_0x3c1656=_0x48669f[_0x8901('0x64')][0x0][_0x8901('0x44')];return db[_0x8901('0xca')][_0x8901('0x5d')]({'where':{'messageId':_0x48669f['body'][0x0]['message']['id']}});}break;case _0x8901('0x96'):if(_0x48669f[_0x8901('0x64')][_0x8901('0xd6')]&&_0x48669f[_0x8901('0x64')][_0x8901('0x2d')]){_0x3c1656=_0x48669f[_0x8901('0x64')][_0x8901('0x2d')];return db[_0x8901('0xca')]['find']({'where':{'messageId':_0x48669f[_0x8901('0x64')][_0x8901('0xd6')]}});}break;}}})['then'](handleEntityNotFound(_0x3a9a8,null))[_0x8901('0x39')](function(_0x41145f){if(_0x41145f){_0x1f2341=_0x41145f;switch(_0xc27066['type']){case _0x8901('0x87'):if(_0x3c1656==='DELIVERED'){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8901('0x2d'),_0x8901('0x87'),util[_0x8901('0xd7')](_0x48669f[_0x8901('0x64')],{'showHidden':![],'depth':null}));}break;case _0x8901('0x8b'):if(_0x3c1656==='1'){return _0x1f2341['update']({'read':!![]});}else{logger[_0x8901('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8901('0x2d'),'skebby',util[_0x8901('0xd7')](_0x48669f[_0x8901('0x64')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x48669f[_0x8901('0x64')][_0x8901('0xd8')]&&_0x3c1656>=0xc8&&_0x3c1656<=0xce){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger[_0x8901('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8901('0x2d'),_0x8901('0x8c'),util[_0x8901('0xd7')](_0x48669f['body'],{'showHidden':![],'depth':null}));}break;case _0x8901('0x90'):var _0xcd825e=_0x48669f[_0x8901('0x64')]['results'][0x0];if(_0xcd825e[_0x8901('0x2d')][_0x8901('0xd3')]===_0x8901('0xd4')){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger[_0x8901('0x28')](_0x8901('0x26'),_0x8901('0x2d'),'infobip',util[_0x8901('0xd7')](_0x48669f[_0x8901('0x64')],{'showHidden':![],'depth':null}));}break;case _0x8901('0xd5'):if(_0x3c1656=='DELIVERED_TO_GATEWAY'||_0x3c1656==_0x8901('0xd9')){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8901('0x2d'),'clickatell',util[_0x8901('0xd7')](_0x48669f['body'],{'showHidden':![],'depth':null}));}break;case _0x8901('0x95'):if(_0x3c1656==_0x8901('0xda')){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger[_0x8901('0x28')](_0x8901('0x26'),_0x8901('0x2d'),_0x8901('0x95'),util['inspect'](_0x48669f[_0x8901('0x64')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3c1656===_0x8901('0xdb')||_0x3c1656===_0x8901('0xdc')){return _0x1f2341[_0x8901('0x38')]({'read':!![]});}else{logger[_0x8901('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util[_0x8901('0xd7')](_0x48669f['body'],{'showHidden':![],'depth':null}));}break;}return _0x1f2341;}})[_0x8901('0x39')](respondWithResult(_0x3a9a8,null))[_0x8901('0x2c')](handleError(_0x3a9a8,null));};exports[_0x8901('0xdd')]=function(_0x19e057,_0x50c464,_0xfc118e){var _0x36d172,_0x3ad582,_0x1a9553;return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x19e057[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x50c464,null))['then'](function(_0x501e6c){if(_0x501e6c){_0x1a9553=_0x501e6c;logger['debug'](_0x8901('0x26'),_0x8901('0x2d'),_0x8901('0xce'),_0x501e6c['type'],util[_0x8901('0xd7')](_0x19e057['query'],{'showHidden':![],'depth':null}));switch(_0x501e6c[_0x8901('0x44')]){case _0x8901('0x92'):if(_0x19e057[_0x8901('0x47')][_0x8901('0xde')]&&_0x19e057[_0x8901('0x47')][_0x8901('0xdf')]){_0x3ad582=_0x19e057[_0x8901('0x47')][_0x8901('0xdf')];return db[_0x8901('0xca')]['find']({'where':{'messageId':_0x19e057['query'][_0x8901('0xde')]}});}break;}}})[_0x8901('0x39')](handleEntityNotFound(_0x50c464,null))['then'](function(_0x352d43){if(_0x352d43){_0x36d172=_0x352d43;switch(_0x1a9553['type']){case _0x8901('0x92'):if(_0x3ad582==='2'||_0x3ad582==='6'){return _0x36d172[_0x8901('0x38')]({'read':!![]});}else{logger[_0x8901('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8901('0x2d'),_0x8901('0x92'),util[_0x8901('0xd7')](_0x19e057[_0x8901('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x36d172;}})[_0x8901('0x39')](respondWithResult(_0x50c464,null))[_0x8901('0x2c')](handleError(_0x50c464,null));};exports[_0x8901('0xe0')]=function(_0x43a81f,_0x4de42f,_0x4a7aad){return db[_0x8901('0x41')][_0x8901('0x5d')]({'where':{'id':_0x43a81f[_0x8901('0x66')]['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x4de42f,null))[_0x8901('0x39')](function(_0x4b8f9f){if(_0x4b8f9f){return _0x4b8f9f[_0x8901('0xe0')](_0x43a81f['body'][_0x8901('0x6f')],_['omit'](_0x43a81f[_0x8901('0x64')],[_0x8901('0x6f'),'id'])||{})['spread'](function(_0x1dc132){for(var _0x280c88=0x0;_0x280c88<_0x43a81f[_0x8901('0x64')]['ids'][_0x8901('0x4e')];_0x280c88+=0x1){socket[_0x8901('0xe1')](_0x8901('0xe2'),{'UserId':Number(_0x43a81f['body'][_0x8901('0x6f')][_0x280c88]),'SmsAccountId':Number(_0x43a81f['params']['id'])});}return _0x1dc132;});}})[_0x8901('0x39')](respondWithResult(_0x4de42f,null))['catch'](handleError(_0x4de42f,null));};exports[_0x8901('0xe3')]=function(_0x591960,_0x4cfb27,_0x12b3cb){return db['SmsAccount'][_0x8901('0x5d')]({'where':{'id':_0x591960['params']['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x4cfb27,null))[_0x8901('0x39')](function(_0x4cdeb9){if(_0x4cdeb9){return _0x4cdeb9[_0x8901('0xe3')](_0x591960[_0x8901('0x47')][_0x8901('0x6f')])[_0x8901('0x39')](function(){if(_[_0x8901('0xe4')](_0x591960[_0x8901('0x47')][_0x8901('0x6f')])){for(var _0x362c0b=0x0;_0x362c0b<_0x591960[_0x8901('0x47')][_0x8901('0x6f')]['length'];_0x362c0b+=0x1){socket['emit'](_0x8901('0xe5'),{'UserId':Number(_0x591960['query'][_0x8901('0x6f')][_0x362c0b]),'SmsAccountId':Number(_0x591960[_0x8901('0x66')]['id'])});}}else{socket[_0x8901('0xe1')]('userSmsAccount:remove',{'UserId':Number(_0x591960['query'][_0x8901('0x6f')]),'SmsAccountId':Number(_0x591960[_0x8901('0x66')]['id'])});}});}})[_0x8901('0x39')](respondWithStatusCode(_0x4cfb27,null))['catch'](handleError(_0x4cfb27,null));};exports[_0x8901('0xe6')]=function(_0x438720,_0x2a25b5,_0x117fa8){var _0x697ee7={};var _0x43c2d7={};var _0x4df447;var _0x21d567;return db[_0x8901('0x41')][_0x8901('0x6b')]({'where':{'id':_0x438720['params']['id']}})[_0x8901('0x39')](handleEntityNotFound(_0x2a25b5,null))[_0x8901('0x39')](function(_0x35dff){if(_0x35dff){_0x4df447=_0x35dff;_0x43c2d7['model']=_['keys'](db['User'][_0x8901('0x42')]);_0x43c2d7[_0x8901('0x47')]=_[_0x8901('0x48')](_0x438720[_0x8901('0x47')]);_0x43c2d7[_0x8901('0x49')]=_[_0x8901('0x4c')](_0x43c2d7[_0x8901('0x4a')],_0x43c2d7['query']);_0x697ee7[_0x8901('0x4b')]=_[_0x8901('0x4c')](_0x43c2d7[_0x8901('0x4a')],qs[_0x8901('0x4d')](_0x438720['query'][_0x8901('0x4d')]));_0x697ee7[_0x8901('0x4b')]=_0x697ee7[_0x8901('0x4b')]['length']?_0x697ee7[_0x8901('0x4b')]:_0x43c2d7['model'];_0x697ee7[_0x8901('0x51')]=qs[_0x8901('0x52')](_0x438720[_0x8901('0x47')][_0x8901('0x52')]);_0x697ee7['where']=qs[_0x8901('0x49')](_[_0x8901('0x54')](_0x438720[_0x8901('0x47')],_0x43c2d7['filters']));if(_0x438720['query'][_0x8901('0x55')]){_0x697ee7['where']=_[_0x8901('0x5b')](_0x697ee7[_0x8901('0x53')],{'$or':_['map'](_0x697ee7[_0x8901('0x4b')],function(_0x7f054){var _0x461fcd={};_0x461fcd[_0x7f054]={'$like':'%'+_0x438720[_0x8901('0x47')][_0x8901('0x55')]+'%'};return _0x461fcd;})});}_0x697ee7=_['merge']({},_0x697ee7,_0x438720[_0x8901('0x5c')]);return _0x4df447['getAgents'](_0x697ee7);}})[_0x8901('0x39')](function(_0x43847d){if(_0x43847d){_0x21d567=_0x43847d[_0x8901('0x4e')];if(!_0x438720['query'][_0x8901('0x4f')](_0x8901('0x50'))){_0x697ee7['limit']=qs['limit'](_0x438720[_0x8901('0x47')][_0x8901('0x32')]);_0x697ee7[_0x8901('0x30')]=qs[_0x8901('0x30')](_0x438720[_0x8901('0x47')][_0x8901('0x30')]);}return _0x4df447[_0x8901('0xe6')](_0x697ee7);}})[_0x8901('0x39')](function(_0xbe22ad){if(_0xbe22ad){return _0xbe22ad?{'count':_0x21d567,'rows':_0xbe22ad}:null;}})[_0x8901('0x39')](respondWithResult(_0x2a25b5,null))[_0x8901('0x2c')](handleError(_0x2a25b5,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ea48d07..47cf1ab 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 _0x429e=['hasOwnProperty','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit'];(function(_0x38bf88,_0xb638df){var _0x3e6888=function(_0x4b306e){while(--_0x4b306e){_0x38bf88['push'](_0x38bf88['shift']());}};_0x3e6888(++_0xb638df);}(_0x429e,0x127));var _0xe429=function(_0xfd4a1e,_0x2b25c3){_0xfd4a1e=_0xfd4a1e-0x0;var _0x104daa=_0x429e[_0xfd4a1e];return _0x104daa;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xe429('0x0'))['db'][_0xe429('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe429('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe429('0x3'),'afterDestroy':_0xe429('0x4')};function emitEvent(_0x1c0bee){return function(_0x5c98b5,_0x41de9d,_0x5486e1){SmsAccountEvents[_0xe429('0x5')](_0x1c0bee+':'+_0x5c98b5['id'],_0x5c98b5);SmsAccountEvents[_0xe429('0x5')](_0x1c0bee,_0x5c98b5);_0x5486e1(null);};}for(var e in events){if(events[_0xe429('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0xad81=['setMaxListeners','update','emit','hasOwnProperty','events','../../mysqldb','SmsAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad81,0xcf));var _0x1ad8=function(_0x139f50,_0x18b9cf){_0x139f50=_0x139f50-0x0;var _0xb5efa9=_0xad81[_0x139f50];return _0xb5efa9;};'use strict';var EventEmitter=require(_0x1ad8('0x0'));var SmsAccount=require(_0x1ad8('0x1'))['db'][_0x1ad8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1ad8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ad8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e9c2e){return function(_0x4b4026,_0x2dfac5,_0x23c8f4){SmsAccountEvents['emit'](_0x5e9c2e+':'+_0x4b4026['id'],_0x4b4026);SmsAccountEvents[_0x1ad8('0x5')](_0x5e9c2e,_0x4b4026);_0x23c8f4(null);};}for(var e in events){if(events[_0x1ad8('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index dfb39d9..976ddf8 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 _0xeb2c=['define','SmsAccount','sms_accounts','util','../../config/logger','moment','rimraf','../../config/environment','exports'];(function(_0x26a69a,_0x212aa4){var _0x1105c9=function(_0x2fe606){while(--_0x2fe606){_0x26a69a['push'](_0x26a69a['shift']());}};_0x1105c9(++_0x212aa4);}(_0xeb2c,0x108));var _0xceb2=function(_0x26c6c7,_0x2f4b04){_0x26c6c7=_0x26c6c7-0x0;var _0x5656f7=_0xeb2c[_0x26c6c7];return _0x5656f7;};'use strict';var _=require('lodash');var util=require(_0xceb2('0x0'));var logger=require(_0xceb2('0x1'))('api');var moment=require(_0xceb2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xceb2('0x3'));var config=require(_0xceb2('0x4'));var attributes=require('./smsAccount.attributes');module[_0xceb2('0x5')]=function(_0x5a06e6,_0x5c1482){return _0x5a06e6[_0xceb2('0x6')](_0xceb2('0x7'),attributes,{'tableName':_0xceb2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5e4=['define','SmsAccount','sms_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x35e032,_0x53e760){var _0x4a50c8=function(_0x417236){while(--_0x417236){_0x35e032['push'](_0x35e032['shift']());}};_0x4a50c8(++_0x53e760);}(_0xe5e4,0x19b));var _0x4e5e=function(_0x2396c7,_0x307db6){_0x2396c7=_0x2396c7-0x0;var _0x2f2bcb=_0xe5e4[_0x2396c7];return _0x2f2bcb;};'use strict';var _=require(_0x4e5e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4e5e('0x1'));var moment=require(_0x4e5e('0x2'));var BPromise=require(_0x4e5e('0x3'));var rp=require(_0x4e5e('0x4'));var fs=require('fs');var path=require(_0x4e5e('0x5'));var rimraf=require(_0x4e5e('0x6'));var config=require('../../config/environment');var attributes=require(_0x4e5e('0x7'));module[_0x4e5e('0x8')]=function(_0x10267d,_0x3e9462){return _0x10267d[_0x4e5e('0x9')](_0x4e5e('0xa'),attributes,{'tableName':_0x4e5e('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 7209197..ed0777e 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 _0xb8b0=['../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x62ad3f,_0x4a0bb8){var _0x3c8830=function(_0x3f4453){while(--_0x3f4453){_0x62ad3f['push'](_0x62ad3f['shift']());}};_0x3c8830(++_0x4a0bb8);}(_0xb8b0,0x16a));var _0x0b8b=function(_0x24ec92,_0x34a45e){_0x24ec92=_0x24ec92-0x0;var _0x49fec3=_0xb8b0[_0x24ec92];return _0x49fec3;};'use strict';var _=require(_0x0b8b('0x0'));var util=require(_0x0b8b('0x1'));var moment=require(_0x0b8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0b8b('0x3'));var fs=require('fs');var Redis=require(_0x0b8b('0x4'));var db=require(_0x0b8b('0x5'))['db'];var utils=require(_0x0b8b('0x6'));var logger=require('../../config/logger')(_0x0b8b('0x7'));var config=require(_0x0b8b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0b8b('0x9')][_0x0b8b('0xa')]({'port':0x232a});config[_0x0b8b('0xb')]=_['defaults'](config['redis'],{'host':_0x0b8b('0xc'),'port':0x18eb});var socket=require(_0x0b8b('0xd'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x0b8b('0xe')](socket);function respondWithRpcPromise(_0x3163a9,_0x3edc73,_0x3310e0){return new BPromise(function(_0x467df1,_0x4ce2b1){return client[_0x0b8b('0xf')](_0x3163a9,_0x3310e0)['then'](function(_0xb8b37c){logger['info'](_0x0b8b('0x10'),_0x3edc73,_0x0b8b('0x11'));logger[_0x0b8b('0x12')](_0x0b8b('0x13'),_0x3edc73,_0x0b8b('0x11'),JSON[_0x0b8b('0x14')](_0xb8b37c));if(_0xb8b37c[_0x0b8b('0x15')]){if(_0xb8b37c[_0x0b8b('0x15')][_0x0b8b('0x16')]===0x1f4){logger[_0x0b8b('0x15')](_0x0b8b('0x10'),_0x3edc73,_0xb8b37c[_0x0b8b('0x15')]['message']);return _0x4ce2b1(_0xb8b37c['error'][_0x0b8b('0x17')]);}logger[_0x0b8b('0x15')](_0x0b8b('0x10'),_0x3edc73,_0xb8b37c[_0x0b8b('0x15')][_0x0b8b('0x17')]);return _0x467df1(_0xb8b37c[_0x0b8b('0x15')][_0x0b8b('0x17')]);}else{logger[_0x0b8b('0x18')](_0x0b8b('0x10'),_0x3edc73,'request\x20sent');_0x467df1(_0xb8b37c[_0x0b8b('0x19')][_0x0b8b('0x17')]);}})[_0x0b8b('0x1a')](function(_0x37a1c3){logger['error'](_0x0b8b('0x10'),_0x3edc73,_0x37a1c3);_0x4ce2b1(_0x37a1c3);});});}exports[_0x0b8b('0x1b')]=function(_0xaed624){var _0x336129=this;return new Promise(function(_0x1bdc46,_0x4b3aba){return db[_0x0b8b('0x1c')][_0x0b8b('0x1d')]({'raw':_0xaed624[_0x0b8b('0x1e')]?_0xaed624[_0x0b8b('0x1e')][_0x0b8b('0x1f')]===undefined?!![]:![]:!![],'where':_0xaed624[_0x0b8b('0x1e')]?_0xaed624[_0x0b8b('0x1e')][_0x0b8b('0x20')]||null:null,'attributes':_0xaed624[_0x0b8b('0x1e')]?_0xaed624[_0x0b8b('0x1e')][_0x0b8b('0x21')]||null:null,'include':_0xaed624['options']?_0xaed624[_0x0b8b('0x1e')][_0x0b8b('0x22')]?_[_0x0b8b('0x23')](_0xaed624[_0x0b8b('0x1e')]['include'],function(_0x26a29b){return{'model':db[_0x26a29b[_0x0b8b('0x24')]],'as':_0x26a29b['as'],'attributes':_0x26a29b[_0x0b8b('0x21')],'include':_0x26a29b[_0x0b8b('0x22')]?_['map'](_0x26a29b[_0x0b8b('0x22')],function(_0x29f811){return{'model':db[_0x29f811['model']],'as':_0x29f811['as'],'attributes':_0x29f811[_0x0b8b('0x21')],'include':_0x29f811[_0x0b8b('0x22')]?_[_0x0b8b('0x23')](_0x29f811[_0x0b8b('0x22')],function(_0x464755){return{'model':db[_0x464755[_0x0b8b('0x24')]],'as':_0x464755['as'],'attributes':_0x464755[_0x0b8b('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x196d7b){logger['info'](_0x0b8b('0x1b'),_0xaed624);logger[_0x0b8b('0x12')]('ShowSmsAccount',_0xaed624,JSON[_0x0b8b('0x14')](_0x196d7b));_0x1bdc46(_0x196d7b);})[_0x0b8b('0x1a')](function(_0x473cd2){logger[_0x0b8b('0x15')](_0x0b8b('0x1b'),_0x473cd2[_0x0b8b('0x17')],_0xaed624);_0x4b3aba(_0x336129[_0x0b8b('0x15')](0x1f4,_0x473cd2[_0x0b8b('0x17')]));});});}; \ No newline at end of file +var _0xa3d4=['localhost','socket.io-emitter','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSmsAccount','find','options','raw','where','attributes','include','map','model','then','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x1f2654,_0x5c2bab){var _0x42fa5e=function(_0x1eeeab){while(--_0x1eeeab){_0x1f2654['push'](_0x1f2654['shift']());}};_0x42fa5e(++_0x5c2bab);}(_0xa3d4,0x152));var _0x4a3d=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xa3d4[_0x4fde08];return _0x12e725;};'use strict';var _=require(_0x4a3d('0x0'));var util=require('util');var moment=require(_0x4a3d('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a3d('0x2'));var fs=require('fs');var Redis=require(_0x4a3d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4a3d('0x4'))(_0x4a3d('0x5'));var config=require(_0x4a3d('0x6'));var jayson=require(_0x4a3d('0x7'));var client=jayson[_0x4a3d('0x8')][_0x4a3d('0x9')]({'port':0x232a});config[_0x4a3d('0xa')]=_[_0x4a3d('0xb')](config['redis'],{'host':_0x4a3d('0xc'),'port':0x18eb});var socket=require(_0x4a3d('0xd'))(new Redis(config[_0x4a3d('0xa')]));require(_0x4a3d('0xe'))[_0x4a3d('0xf')](socket);function respondWithRpcPromise(_0x288f95,_0x18dfab,_0x79b655){return new BPromise(function(_0x31dfee,_0x34b602){return client['request'](_0x288f95,_0x79b655)['then'](function(_0x3a5f68){logger[_0x4a3d('0x10')](_0x4a3d('0x11'),_0x18dfab,_0x4a3d('0x12'));logger['debug'](_0x4a3d('0x13'),_0x18dfab,_0x4a3d('0x12'),JSON[_0x4a3d('0x14')](_0x3a5f68));if(_0x3a5f68[_0x4a3d('0x15')]){if(_0x3a5f68[_0x4a3d('0x15')]['code']===0x1f4){logger[_0x4a3d('0x15')](_0x4a3d('0x11'),_0x18dfab,_0x3a5f68[_0x4a3d('0x15')][_0x4a3d('0x16')]);return _0x34b602(_0x3a5f68['error']['message']);}logger[_0x4a3d('0x15')](_0x4a3d('0x11'),_0x18dfab,_0x3a5f68['error'][_0x4a3d('0x16')]);return _0x31dfee(_0x3a5f68['error'][_0x4a3d('0x16')]);}else{logger['info'](_0x4a3d('0x11'),_0x18dfab,_0x4a3d('0x12'));_0x31dfee(_0x3a5f68[_0x4a3d('0x17')][_0x4a3d('0x16')]);}})[_0x4a3d('0x18')](function(_0x55ac44){logger[_0x4a3d('0x15')](_0x4a3d('0x11'),_0x18dfab,_0x55ac44);_0x34b602(_0x55ac44);});});}exports[_0x4a3d('0x19')]=function(_0x2bfbee){var _0xdc30cd=this;return new Promise(function(_0x3fac24,_0x11c52d){return db['SmsAccount'][_0x4a3d('0x1a')]({'raw':_0x2bfbee['options']?_0x2bfbee[_0x4a3d('0x1b')][_0x4a3d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2bfbee[_0x4a3d('0x1b')]?_0x2bfbee[_0x4a3d('0x1b')][_0x4a3d('0x1d')]||null:null,'attributes':_0x2bfbee[_0x4a3d('0x1b')]?_0x2bfbee['options'][_0x4a3d('0x1e')]||null:null,'include':_0x2bfbee[_0x4a3d('0x1b')]?_0x2bfbee['options'][_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x2bfbee[_0x4a3d('0x1b')][_0x4a3d('0x1f')],function(_0x200de2){return{'model':db[_0x200de2['model']],'as':_0x200de2['as'],'attributes':_0x200de2[_0x4a3d('0x1e')],'include':_0x200de2[_0x4a3d('0x1f')]?_['map'](_0x200de2['include'],function(_0x18810e){return{'model':db[_0x18810e[_0x4a3d('0x21')]],'as':_0x18810e['as'],'attributes':_0x18810e['attributes'],'include':_0x18810e[_0x4a3d('0x1f')]?_[_0x4a3d('0x20')](_0x18810e[_0x4a3d('0x1f')],function(_0x3107c0){return{'model':db[_0x3107c0[_0x4a3d('0x21')]],'as':_0x3107c0['as'],'attributes':_0x3107c0[_0x4a3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a3d('0x22')](function(_0x48018c){logger[_0x4a3d('0x10')](_0x4a3d('0x19'),_0x2bfbee);logger['debug'](_0x4a3d('0x19'),_0x2bfbee,JSON[_0x4a3d('0x14')](_0x48018c));_0x3fac24(_0x48018c);})['catch'](function(_0x235612){logger['error'](_0x4a3d('0x19'),_0x235612[_0x4a3d('0x16')],_0x2bfbee);_0x11c52d(_0xdc30cd['error'](0x1f4,_0x235612[_0x4a3d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1af465e..990c47e 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(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 0bec6b7..e07e0a7 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 _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0x3e74,0x175));var _0x43e7=function(_0x6fe67a,_0x2c0139){_0x6fe67a=_0x6fe67a-0x0;var _0x5c9d81=_0x3e74[_0x6fe67a];return _0x5c9d81;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x524b27,_0x45dbdf){var _0x24e32c=function(_0x13856a){while(--_0x13856a){_0x524b27['push'](_0x524b27['shift']());}};_0x24e32c(++_0x45dbdf);}(_0x008c,0x188));var _0xc008=function(_0x179b68,_0x339d82){_0x179b68=_0x179b68-0x0;var _0x5e6d69=_0x008c[_0x179b68];return _0x5e6d69;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 9d56da3..ff5274d 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 _0xa6ec=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xa6ec,0xa0));var _0xca6e=function(_0x539c74,_0x11bb6c){_0x539c74=_0x539c74-0x0;var _0x200758=_0xa6ec[_0x539c74];return _0x200758;};'use strict';var Sequelize=require(_0xca6e('0x0'));module['exports']={'priority':{'type':Sequelize[_0xca6e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xca6e('0x2')],'allowNull':![],'defaultValue':_0xca6e('0x3')},'appdata':{'type':Sequelize[_0xca6e('0x4')]()},'description':{'type':Sequelize[_0xca6e('0x2')]},'interval':{'type':Sequelize[_0xca6e('0x2')],'defaultValue':_0xca6e('0x5')}}; \ No newline at end of file +var _0x6467=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x46891a,_0x3e3051){var _0x4c578d=function(_0x3cf400){while(--_0x3cf400){_0x46891a['push'](_0x46891a['shift']());}};_0x4c578d(++_0x3e3051);}(_0x6467,0x87));var _0x7646=function(_0x4618ba,_0x4acda8){_0x4618ba=_0x4618ba-0x0;var _0x13f122=_0x6467[_0x4618ba];return _0x13f122;};'use strict';var Sequelize=require(_0x7646('0x0'));module[_0x7646('0x1')]={'priority':{'type':Sequelize[_0x7646('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7646('0x3')],'allowNull':![],'defaultValue':_0x7646('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7646('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7646('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4611b54..62b529a 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 _0xadf7=['filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x405765,_0x30c473){var _0x5de8d2=function(_0x32322d){while(--_0x32322d){_0x405765['push'](_0x405765['shift']());}};_0x5de8d2(++_0x30c473);}(_0xadf7,0x9f));var _0x7adf=function(_0x408fa7,_0x303486){_0x408fa7=_0x408fa7-0x0;var _0x1bceea=_0xadf7[_0x408fa7];return _0x1bceea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7adf('0x0'));var zipdir=require(_0x7adf('0x1'));var jsonpatch=require(_0x7adf('0x2'));var rp=require(_0x7adf('0x3'));var moment=require('moment');var BPromise=require(_0x7adf('0x4'));var Mustache=require(_0x7adf('0x5'));var util=require('util');var path=require(_0x7adf('0x6'));var sox=require(_0x7adf('0x7'));var csv=require('to-csv');var ejs=require(_0x7adf('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7adf('0x9'));var jsforce=require(_0x7adf('0xa'));var deskjs=require(_0x7adf('0xb'));var toCsv=require(_0x7adf('0xc'));var querystring=require(_0x7adf('0xd'));var Papa=require(_0x7adf('0xe'));var Redis=require(_0x7adf('0xf'));var authService=require(_0x7adf('0x10'));var qs=require(_0x7adf('0x11'));var as=require(_0x7adf('0x12'));var hardwareService=require(_0x7adf('0x13'));var logger=require(_0x7adf('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7adf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x334725,_0x1e703d){_0x1e703d=_0x1e703d||0xcc;return function(_0xc1d527){if(_0xc1d527){return _0x334725[_0x7adf('0x16')](_0x1e703d);}return _0x334725[_0x7adf('0x17')](_0x1e703d)['end']();};}function respondWithResult(_0x1fa94d,_0x1a8972){_0x1a8972=_0x1a8972||0xc8;return function(_0x2f8d3a){if(_0x2f8d3a){return _0x1fa94d[_0x7adf('0x17')](_0x1a8972)[_0x7adf('0x18')](_0x2f8d3a);}};}function respondWithFilteredResult(_0x58cffa,_0x2cbca3){return function(_0x3fee70){if(_0x3fee70){var _0x27d4a0=typeof _0x2cbca3['offset']===_0x7adf('0x19')&&typeof _0x2cbca3[_0x7adf('0x1a')]==='undefined';var _0x596410=_0x3fee70[_0x7adf('0x1b')];var _0x1a6a78=_0x27d4a0?0x0:_0x2cbca3[_0x7adf('0x1c')];var _0x4c38af=_0x27d4a0?_0x3fee70[_0x7adf('0x1b')]:_0x2cbca3[_0x7adf('0x1c')]+_0x2cbca3[_0x7adf('0x1a')];var _0x47ff34;if(_0x4c38af>=_0x596410){_0x4c38af=_0x596410;_0x47ff34=0xc8;}else{_0x47ff34=0xce;}_0x58cffa[_0x7adf('0x17')](_0x47ff34);return _0x58cffa[_0x7adf('0x1d')](_0x7adf('0x1e'),_0x1a6a78+'-'+_0x4c38af+'/'+_0x596410)[_0x7adf('0x18')](_0x3fee70);}return null;};}function patchUpdates(_0x153a27){return function(_0x2b43d6){try{jsonpatch[_0x7adf('0x1f')](_0x2b43d6,_0x153a27,!![]);}catch(_0x225c4c){return BPromise['reject'](_0x225c4c);}return _0x2b43d6[_0x7adf('0x20')]();};}function saveUpdates(_0x328f88,_0x15d177){return function(_0x5a7b7d){if(_0x5a7b7d){return _0x5a7b7d[_0x7adf('0x21')](_0x328f88)['then'](function(_0x5a746a){return _0x5a746a;});}return null;};}function removeEntity(_0x3b2e13,_0x1acf59){return function(_0x1ff6b8){if(_0x1ff6b8){return _0x1ff6b8[_0x7adf('0x22')]()[_0x7adf('0x23')](function(){_0x3b2e13[_0x7adf('0x17')](0xcc)[_0x7adf('0x24')]();});}};}function handleEntityNotFound(_0x2a31ad,_0x2fdc70){return function(_0x2a1634){if(!_0x2a1634){_0x2a31ad[_0x7adf('0x16')](0x194);}return _0x2a1634;};}function handleError(_0x3c88b1,_0x5ab99c){_0x5ab99c=_0x5ab99c||0x1f4;return function(_0x20db3a){logger[_0x7adf('0x25')](_0x20db3a[_0x7adf('0x26')]);if(_0x20db3a[_0x7adf('0x27')]){delete _0x20db3a[_0x7adf('0x27')];}_0x3c88b1[_0x7adf('0x17')](_0x5ab99c)['send'](_0x20db3a);};}exports[_0x7adf('0x28')]=function(_0x453f0a,_0x4193ef){var _0x39c6dd={},_0x419bef={},_0x4ebc19={'count':0x0,'rows':[]};var _0x421c6b=_[_0x7adf('0x29')](db[_0x7adf('0x2a')][_0x7adf('0x2b')],function(_0x365b84){return{'name':_0x365b84[_0x7adf('0x2c')],'type':_0x365b84[_0x7adf('0x2d')][_0x7adf('0x2e')]};});_0x419bef['model']=_[_0x7adf('0x29')](_0x421c6b,_0x7adf('0x27'));_0x419bef[_0x7adf('0x2f')]=_[_0x7adf('0x30')](_0x453f0a[_0x7adf('0x2f')]);_0x419bef[_0x7adf('0x31')]=_[_0x7adf('0x32')](_0x419bef[_0x7adf('0x33')],_0x419bef[_0x7adf('0x2f')]);_0x39c6dd['attributes']=_[_0x7adf('0x32')](_0x419bef[_0x7adf('0x33')],qs[_0x7adf('0x34')](_0x453f0a['query']['fields']));_0x39c6dd[_0x7adf('0x35')]=_0x39c6dd[_0x7adf('0x35')][_0x7adf('0x36')]?_0x39c6dd[_0x7adf('0x35')]:_0x419bef['model'];if(!_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x37')](_0x7adf('0x38'))){_0x39c6dd['limit']=qs[_0x7adf('0x1a')](_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x1a')]);_0x39c6dd[_0x7adf('0x1c')]=qs[_0x7adf('0x1c')](_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x1c')]);}_0x39c6dd['order']=qs[_0x7adf('0x39')](_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x39')]);_0x39c6dd[_0x7adf('0x3a')]=qs[_0x7adf('0x31')](_[_0x7adf('0x3b')](_0x453f0a['query'],_0x419bef[_0x7adf('0x31')]),_0x421c6b);if(_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x3c')]){_0x39c6dd['where']=_[_0x7adf('0x3d')](_0x39c6dd[_0x7adf('0x3a')],{'$or':_['map'](_0x421c6b,function(_0x4a0e2e){if(_0x4a0e2e[_0x7adf('0x2d')]!=='VIRTUAL'){var _0x165699={};_0x165699[_0x4a0e2e[_0x7adf('0x27')]]={'$like':'%'+_0x453f0a[_0x7adf('0x2f')]['filter']+'%'};return _0x165699;}})});}_0x39c6dd=_[_0x7adf('0x3d')]({},_0x39c6dd,_0x453f0a[_0x7adf('0x3e')]);var _0x194a49={'where':_0x39c6dd[_0x7adf('0x3a')]};return db['SmsApplication'][_0x7adf('0x1b')](_0x194a49)[_0x7adf('0x23')](function(_0xfd8819){_0x4ebc19[_0x7adf('0x1b')]=_0xfd8819;if(_0x453f0a[_0x7adf('0x2f')][_0x7adf('0x3f')]){_0x39c6dd[_0x7adf('0x40')]=[{'all':!![]}];}return db['SmsApplication'][_0x7adf('0x41')](_0x39c6dd);})[_0x7adf('0x23')](function(_0x40d768){_0x4ebc19[_0x7adf('0x42')]=_0x40d768;return _0x4ebc19;})['then'](respondWithFilteredResult(_0x4193ef,_0x39c6dd))[_0x7adf('0x43')](handleError(_0x4193ef,null));};exports[_0x7adf('0x44')]=function(_0x27bcfd,_0x4fd0b7){var _0xefcbfe={'raw':!![],'where':{'id':_0x27bcfd[_0x7adf('0x45')]['id']}},_0x2b63b8={};_0x2b63b8[_0x7adf('0x33')]=_[_0x7adf('0x30')](db['SmsApplication'][_0x7adf('0x2b')]);_0x2b63b8[_0x7adf('0x2f')]=_[_0x7adf('0x30')](_0x27bcfd[_0x7adf('0x2f')]);_0x2b63b8[_0x7adf('0x31')]=_[_0x7adf('0x32')](_0x2b63b8['model'],_0x2b63b8[_0x7adf('0x2f')]);_0xefcbfe['attributes']=_[_0x7adf('0x32')](_0x2b63b8['model'],qs[_0x7adf('0x34')](_0x27bcfd[_0x7adf('0x2f')][_0x7adf('0x34')]));_0xefcbfe[_0x7adf('0x35')]=_0xefcbfe['attributes'][_0x7adf('0x36')]?_0xefcbfe['attributes']:_0x2b63b8['model'];if(_0x27bcfd[_0x7adf('0x2f')][_0x7adf('0x3f')]){_0xefcbfe[_0x7adf('0x40')]=[{'all':!![]}];}_0xefcbfe=_[_0x7adf('0x3d')]({},_0xefcbfe,_0x27bcfd[_0x7adf('0x3e')]);return db[_0x7adf('0x2a')][_0x7adf('0x46')](_0xefcbfe)[_0x7adf('0x23')](handleEntityNotFound(_0x4fd0b7,null))['then'](respondWithResult(_0x4fd0b7,null))[_0x7adf('0x43')](handleError(_0x4fd0b7,null));};exports[_0x7adf('0x47')]=function(_0x162c94,_0x358036){return db['SmsApplication'][_0x7adf('0x47')](_0x162c94[_0x7adf('0x48')],{})[_0x7adf('0x23')](respondWithResult(_0x358036,0xc9))[_0x7adf('0x43')](handleError(_0x358036,null));};exports[_0x7adf('0x21')]=function(_0x5999bc,_0x4d0e54){if(_0x5999bc[_0x7adf('0x48')]['id']){delete _0x5999bc[_0x7adf('0x48')]['id'];}return db[_0x7adf('0x2a')][_0x7adf('0x46')]({'where':{'id':_0x5999bc[_0x7adf('0x45')]['id']}})[_0x7adf('0x23')](handleEntityNotFound(_0x4d0e54,null))[_0x7adf('0x23')](saveUpdates(_0x5999bc[_0x7adf('0x48')],null))[_0x7adf('0x23')](respondWithResult(_0x4d0e54,null))[_0x7adf('0x43')](handleError(_0x4d0e54,null));};exports[_0x7adf('0x22')]=function(_0x2ee177,_0x1f676d){return db[_0x7adf('0x2a')][_0x7adf('0x46')]({'where':{'id':_0x2ee177['params']['id']}})[_0x7adf('0x23')](handleEntityNotFound(_0x1f676d,null))[_0x7adf('0x23')](removeEntity(_0x1f676d,null))['catch'](handleError(_0x1f676d,null));}; \ No newline at end of file +var _0x0b7b=['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','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto'];(function(_0x81acf9,_0x2c6669){var _0x2fac31=function(_0x53a994){while(--_0x53a994){_0x81acf9['push'](_0x81acf9['shift']());}};_0x2fac31(++_0x2c6669);}(_0x0b7b,0x115));var _0xb0b7=function(_0x421c11,_0xcf7560){_0x421c11=_0x421c11-0x0;var _0x317709=_0x0b7b[_0x421c11];return _0x317709;};'use strict';var emlformat=require(_0xb0b7('0x0'));var rimraf=require(_0xb0b7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb0b7('0x2'));var rp=require(_0xb0b7('0x3'));var moment=require('moment');var BPromise=require(_0xb0b7('0x4'));var Mustache=require(_0xb0b7('0x5'));var util=require(_0xb0b7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb0b7('0x7'));var ejs=require(_0xb0b7('0x8'));var fs=require('fs');var fs_extra=require(_0xb0b7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb0b7('0xa'));var jsforce=require(_0xb0b7('0xb'));var deskjs=require(_0xb0b7('0xc'));var toCsv=require(_0xb0b7('0x7'));var querystring=require('querystring');var Papa=require(_0xb0b7('0xd'));var Redis=require(_0xb0b7('0xe'));var authService=require(_0xb0b7('0xf'));var qs=require(_0xb0b7('0x10'));var as=require(_0xb0b7('0x11'));var hardwareService=require(_0xb0b7('0x12'));var logger=require(_0xb0b7('0x13'))(_0xb0b7('0x14'));var utils=require(_0xb0b7('0x15'));var config=require(_0xb0b7('0x16'));var licenseUtil=require(_0xb0b7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16cfb1,_0x1217e4){_0x1217e4=_0x1217e4||0xcc;return function(_0x7a74cf){if(_0x7a74cf){return _0x16cfb1[_0xb0b7('0x18')](_0x1217e4);}return _0x16cfb1[_0xb0b7('0x19')](_0x1217e4)[_0xb0b7('0x1a')]();};}function respondWithResult(_0x58c894,_0x4b14a7){_0x4b14a7=_0x4b14a7||0xc8;return function(_0x4e5619){if(_0x4e5619){return _0x58c894[_0xb0b7('0x19')](_0x4b14a7)[_0xb0b7('0x1b')](_0x4e5619);}};}function respondWithFilteredResult(_0x585dd5,_0x475969){return function(_0x5a8a2f){if(_0x5a8a2f){var _0x47d9a4=typeof _0x475969[_0xb0b7('0x1c')]===_0xb0b7('0x1d')&&typeof _0x475969[_0xb0b7('0x1e')]==='undefined';var _0x44aaa2=_0x5a8a2f[_0xb0b7('0x1f')];var _0x3f7463=_0x47d9a4?0x0:_0x475969[_0xb0b7('0x1c')];var _0x2506cb=_0x47d9a4?_0x5a8a2f['count']:_0x475969[_0xb0b7('0x1c')]+_0x475969[_0xb0b7('0x1e')];var _0x4f791c;if(_0x2506cb>=_0x44aaa2){_0x2506cb=_0x44aaa2;_0x4f791c=0xc8;}else{_0x4f791c=0xce;}_0x585dd5[_0xb0b7('0x19')](_0x4f791c);return _0x585dd5[_0xb0b7('0x20')]('Content-Range',_0x3f7463+'-'+_0x2506cb+'/'+_0x44aaa2)[_0xb0b7('0x1b')](_0x5a8a2f);}return null;};}function patchUpdates(_0x181db3){return function(_0xa21062){try{jsonpatch[_0xb0b7('0x21')](_0xa21062,_0x181db3,!![]);}catch(_0x2e0ec5){return BPromise[_0xb0b7('0x22')](_0x2e0ec5);}return _0xa21062[_0xb0b7('0x23')]();};}function saveUpdates(_0x52f4cd,_0x484a15){return function(_0x14a97e){if(_0x14a97e){return _0x14a97e[_0xb0b7('0x24')](_0x52f4cd)[_0xb0b7('0x25')](function(_0x9fda36){return _0x9fda36;});}return null;};}function removeEntity(_0x1378b8,_0x2d0d1){return function(_0x5c08a6){if(_0x5c08a6){return _0x5c08a6[_0xb0b7('0x26')]()[_0xb0b7('0x25')](function(){_0x1378b8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1797c5,_0x206dd6){return function(_0x1d63d4){if(!_0x1d63d4){_0x1797c5[_0xb0b7('0x18')](0x194);}return _0x1d63d4;};}function handleError(_0x1d2955,_0x26920e){_0x26920e=_0x26920e||0x1f4;return function(_0xe77dd1){logger[_0xb0b7('0x27')](_0xe77dd1['stack']);if(_0xe77dd1[_0xb0b7('0x28')]){delete _0xe77dd1[_0xb0b7('0x28')];}_0x1d2955[_0xb0b7('0x19')](_0x26920e)[_0xb0b7('0x29')](_0xe77dd1);};}exports[_0xb0b7('0x2a')]=function(_0x57788b,_0x1e71d5){var _0x52fddd={},_0x41a071={},_0x2d7ec3={'count':0x0,'rows':[]};var _0x266ecc=_[_0xb0b7('0x2b')](db[_0xb0b7('0x2c')][_0xb0b7('0x2d')],function(_0x57000a){return{'name':_0x57000a[_0xb0b7('0x2e')],'type':_0x57000a[_0xb0b7('0x2f')]['key']};});_0x41a071[_0xb0b7('0x30')]=_[_0xb0b7('0x2b')](_0x266ecc,_0xb0b7('0x28'));_0x41a071['query']=_[_0xb0b7('0x31')](_0x57788b['query']);_0x41a071[_0xb0b7('0x32')]=_[_0xb0b7('0x33')](_0x41a071[_0xb0b7('0x30')],_0x41a071[_0xb0b7('0x34')]);_0x52fddd[_0xb0b7('0x35')]=_[_0xb0b7('0x33')](_0x41a071[_0xb0b7('0x30')],qs[_0xb0b7('0x36')](_0x57788b[_0xb0b7('0x34')][_0xb0b7('0x36')]));_0x52fddd[_0xb0b7('0x35')]=_0x52fddd[_0xb0b7('0x35')][_0xb0b7('0x37')]?_0x52fddd[_0xb0b7('0x35')]:_0x41a071[_0xb0b7('0x30')];if(!_0x57788b[_0xb0b7('0x34')]['hasOwnProperty']('nolimit')){_0x52fddd[_0xb0b7('0x1e')]=qs['limit'](_0x57788b[_0xb0b7('0x34')][_0xb0b7('0x1e')]);_0x52fddd[_0xb0b7('0x1c')]=qs[_0xb0b7('0x1c')](_0x57788b[_0xb0b7('0x34')][_0xb0b7('0x1c')]);}_0x52fddd[_0xb0b7('0x38')]=qs[_0xb0b7('0x39')](_0x57788b[_0xb0b7('0x34')][_0xb0b7('0x39')]);_0x52fddd[_0xb0b7('0x3a')]=qs[_0xb0b7('0x32')](_['pick'](_0x57788b[_0xb0b7('0x34')],_0x41a071[_0xb0b7('0x32')]),_0x266ecc);if(_0x57788b[_0xb0b7('0x34')]['filter']){_0x52fddd['where']=_[_0xb0b7('0x3b')](_0x52fddd['where'],{'$or':_[_0xb0b7('0x2b')](_0x266ecc,function(_0x10250a){if(_0x10250a[_0xb0b7('0x2f')]!==_0xb0b7('0x3c')){var _0x17a91b={};_0x17a91b[_0x10250a['name']]={'$like':'%'+_0x57788b['query'][_0xb0b7('0x3d')]+'%'};return _0x17a91b;}})});}_0x52fddd=_[_0xb0b7('0x3b')]({},_0x52fddd,_0x57788b[_0xb0b7('0x3e')]);var _0x41ddd4={'where':_0x52fddd['where']};return db[_0xb0b7('0x2c')][_0xb0b7('0x1f')](_0x41ddd4)[_0xb0b7('0x25')](function(_0x529b8d){_0x2d7ec3[_0xb0b7('0x1f')]=_0x529b8d;if(_0x57788b[_0xb0b7('0x34')][_0xb0b7('0x3f')]){_0x52fddd['include']=[{'all':!![]}];}return db[_0xb0b7('0x2c')][_0xb0b7('0x40')](_0x52fddd);})['then'](function(_0x25c57e){_0x2d7ec3[_0xb0b7('0x41')]=_0x25c57e;return _0x2d7ec3;})[_0xb0b7('0x25')](respondWithFilteredResult(_0x1e71d5,_0x52fddd))['catch'](handleError(_0x1e71d5,null));};exports[_0xb0b7('0x42')]=function(_0x37e7ed,_0x1c2645){var _0x2cb90f={'raw':!![],'where':{'id':_0x37e7ed[_0xb0b7('0x43')]['id']}},_0x3b4b41={};_0x3b4b41[_0xb0b7('0x30')]=_[_0xb0b7('0x31')](db[_0xb0b7('0x2c')][_0xb0b7('0x2d')]);_0x3b4b41[_0xb0b7('0x34')]=_['keys'](_0x37e7ed['query']);_0x3b4b41[_0xb0b7('0x32')]=_[_0xb0b7('0x33')](_0x3b4b41[_0xb0b7('0x30')],_0x3b4b41['query']);_0x2cb90f[_0xb0b7('0x35')]=_[_0xb0b7('0x33')](_0x3b4b41['model'],qs[_0xb0b7('0x36')](_0x37e7ed[_0xb0b7('0x34')][_0xb0b7('0x36')]));_0x2cb90f[_0xb0b7('0x35')]=_0x2cb90f[_0xb0b7('0x35')][_0xb0b7('0x37')]?_0x2cb90f[_0xb0b7('0x35')]:_0x3b4b41[_0xb0b7('0x30')];if(_0x37e7ed['query'][_0xb0b7('0x3f')]){_0x2cb90f['include']=[{'all':!![]}];}_0x2cb90f=_[_0xb0b7('0x3b')]({},_0x2cb90f,_0x37e7ed[_0xb0b7('0x3e')]);return db[_0xb0b7('0x2c')][_0xb0b7('0x44')](_0x2cb90f)['then'](handleEntityNotFound(_0x1c2645,null))[_0xb0b7('0x25')](respondWithResult(_0x1c2645,null))['catch'](handleError(_0x1c2645,null));};exports[_0xb0b7('0x45')]=function(_0x4400e4,_0x418a75){return db[_0xb0b7('0x2c')][_0xb0b7('0x45')](_0x4400e4[_0xb0b7('0x46')],{})[_0xb0b7('0x25')](respondWithResult(_0x418a75,0xc9))[_0xb0b7('0x47')](handleError(_0x418a75,null));};exports[_0xb0b7('0x24')]=function(_0x368241,_0x4efe1a){if(_0x368241[_0xb0b7('0x46')]['id']){delete _0x368241[_0xb0b7('0x46')]['id'];}return db[_0xb0b7('0x2c')][_0xb0b7('0x44')]({'where':{'id':_0x368241[_0xb0b7('0x43')]['id']}})[_0xb0b7('0x25')](handleEntityNotFound(_0x4efe1a,null))[_0xb0b7('0x25')](saveUpdates(_0x368241['body'],null))[_0xb0b7('0x25')](respondWithResult(_0x4efe1a,null))['catch'](handleError(_0x4efe1a,null));};exports['destroy']=function(_0xfba504,_0x3ed862){return db[_0xb0b7('0x2c')]['find']({'where':{'id':_0xfba504['params']['id']}})['then'](handleEntityNotFound(_0x3ed862,null))[_0xb0b7('0x25')](removeEntity(_0x3ed862,null))['catch'](handleError(_0x3ed862,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1ed9c5b..5cf2706 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 _0x3e61=['SmsApplication','sms_applications','utf8mb4','lodash','moment','bluebird','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x8ffa23,_0x1e05bd){var _0x50d181=function(_0x8d259e){while(--_0x8d259e){_0x8ffa23['push'](_0x8ffa23['shift']());}};_0x50d181(++_0x1e05bd);}(_0x3e61,0x1ef));var _0x13e6=function(_0x52092b,_0x487131){_0x52092b=_0x52092b-0x0;var _0x5b0cfc=_0x3e61[_0x52092b];return _0x5b0cfc;};'use strict';var _=require(_0x13e6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x13e6('0x1'));var BPromise=require(_0x13e6('0x2'));var rp=require(_0x13e6('0x3'));var fs=require('fs');var path=require(_0x13e6('0x4'));var rimraf=require('rimraf');var config=require(_0x13e6('0x5'));var attributes=require(_0x13e6('0x6'));module[_0x13e6('0x7')]=function(_0x48141a,_0x17f178){return _0x48141a[_0x13e6('0x8')](_0x13e6('0x9'),attributes,{'tableName':_0x13e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x13e6('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x070f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x52cc68,_0x440163){var _0x572cd4=function(_0xdd8786){while(--_0xdd8786){_0x52cc68['push'](_0x52cc68['shift']());}};_0x572cd4(++_0x440163);}(_0x070f,0x9c));var _0xf070=function(_0x21865e,_0x25a03a){_0x21865e=_0x21865e-0x0;var _0x31f792=_0x070f[_0x21865e];return _0x31f792;};'use strict';var _=require(_0xf070('0x0'));var util=require(_0xf070('0x1'));var logger=require(_0xf070('0x2'))(_0xf070('0x3'));var moment=require(_0xf070('0x4'));var BPromise=require(_0xf070('0x5'));var rp=require(_0xf070('0x6'));var fs=require('fs');var path=require(_0xf070('0x7'));var rimraf=require(_0xf070('0x8'));var config=require(_0xf070('0x9'));var attributes=require(_0xf070('0xa'));module[_0xf070('0xb')]=function(_0x45a389,_0x382492){return _0x45a389['define'](_0xf070('0xc'),attributes,{'tableName':_0xf070('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf070('0xe'),'collate':_0xf070('0xf')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 117d8bb..f8aa2da 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 _0xf1f9=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x14eed8,_0x20d923){var _0x236294=function(_0x15178d){while(--_0x15178d){_0x14eed8['push'](_0x14eed8['shift']());}};_0x236294(++_0x20d923);}(_0xf1f9,0x1cd));var _0x9f1f=function(_0x5a6a36,_0x4d2abe){_0x5a6a36=_0x5a6a36-0x0;var _0x16ef41=_0xf1f9[_0x5a6a36];return _0x16ef41;};'use strict';var _=require(_0x9f1f('0x0'));var util=require(_0x9f1f('0x1'));var moment=require(_0x9f1f('0x2'));var BPromise=require(_0x9f1f('0x3'));var rs=require(_0x9f1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f1f('0x5'))['db'];var utils=require(_0x9f1f('0x6'));var logger=require(_0x9f1f('0x7'))(_0x9f1f('0x8'));var config=require(_0x9f1f('0x9'));var jayson=require(_0x9f1f('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x363d26,_0x373b98,_0x117fa5){return new BPromise(function(_0x12309e,_0x4e6054){return client[_0x9f1f('0xb')](_0x363d26,_0x117fa5)[_0x9f1f('0xc')](function(_0x3efac2){logger[_0x9f1f('0xd')](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));logger[_0x9f1f('0x10')](_0x9f1f('0x11'),_0x373b98,'request\x20sent',JSON[_0x9f1f('0x12')](_0x3efac2));if(_0x3efac2[_0x9f1f('0x13')]){if(_0x3efac2[_0x9f1f('0x13')]['code']===0x1f4){logger['error'](_0x9f1f('0xe'),_0x373b98,_0x3efac2['error'][_0x9f1f('0x14')]);return _0x4e6054(_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);}logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x3efac2[_0x9f1f('0x13')][_0x9f1f('0x14')]);return _0x12309e(_0x3efac2['error'][_0x9f1f('0x14')]);}else{logger['info'](_0x9f1f('0xe'),_0x373b98,_0x9f1f('0xf'));_0x12309e(_0x3efac2[_0x9f1f('0x15')][_0x9f1f('0x14')]);}})[_0x9f1f('0x16')](function(_0x5645fc){logger[_0x9f1f('0x13')](_0x9f1f('0xe'),_0x373b98,_0x5645fc);_0x4e6054(_0x5645fc);});});} \ No newline at end of file +var _0x9563=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9563,0x1e7));var _0x3956=function(_0x4b6d92,_0x5389a8){_0x4b6d92=_0x4b6d92-0x0;var _0x3752ef=_0x9563[_0x4b6d92];return _0x3752ef;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var moment=require('moment');var BPromise=require(_0x3956('0x2'));var rs=require(_0x3956('0x3'));var fs=require('fs');var Redis=require(_0x3956('0x4'));var db=require(_0x3956('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3956('0x6'));var config=require('../../config/environment');var jayson=require(_0x3956('0x7'));var client=jayson[_0x3956('0x8')][_0x3956('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba3e4b,_0x47bdbc,_0x234e06){return new BPromise(function(_0xf1e100,_0x2863cd){return client[_0x3956('0xa')](_0xba3e4b,_0x234e06)[_0x3956('0xb')](function(_0x4dd27f){logger['info'](_0x3956('0xc'),_0x47bdbc,_0x3956('0xd'));logger[_0x3956('0xe')](_0x3956('0xf'),_0x47bdbc,'request\x20sent',JSON[_0x3956('0x10')](_0x4dd27f));if(_0x4dd27f[_0x3956('0x11')]){if(_0x4dd27f[_0x3956('0x11')][_0x3956('0x12')]===0x1f4){logger[_0x3956('0x11')](_0x3956('0xc'),_0x47bdbc,_0x4dd27f[_0x3956('0x11')][_0x3956('0x13')]);return _0x2863cd(_0x4dd27f[_0x3956('0x11')]['message']);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x47bdbc,_0x4dd27f[_0x3956('0x11')][_0x3956('0x13')]);return _0xf1e100(_0x4dd27f['error'][_0x3956('0x13')]);}else{logger[_0x3956('0x14')](_0x3956('0xc'),_0x47bdbc,_0x3956('0xd'));_0xf1e100(_0x4dd27f[_0x3956('0x15')][_0x3956('0x13')]);}})[_0x3956('0x16')](function(_0x458b4a){logger[_0x3956('0x11')](_0x3956('0xc'),_0x47bdbc,_0x458b4a);_0x2863cd(_0x458b4a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e25a43c..85e863e 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 _0x4213=['download','post','create','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4213,0x77));var _0x3421=function(_0x477d68,_0x155e8b){_0x477d68=_0x477d68-0x0;var _0x3f845e=_0x4213[_0x477d68];return _0x3f845e;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/messages',auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x13')]);router['post'](_0x3421('0x14'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router[_0x3421('0x12')](_0x3421('0x16'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')]('sms',_0x3421('0x18')),controller['addTags']);router[_0x3421('0x19')](_0x3421('0xe'),auth['isAuthenticated'](),interaction[_0x3421('0x17')]('sms',_0x3421('0x1a')),controller[_0x3421('0x1b')]);router['delete'](_0x3421('0xe'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')](_0x3421('0x1c'),_0x3421('0x1d')),controller[_0x3421('0x1e')]);router[_0x3421('0x1f')](_0x3421('0x16'),auth[_0x3421('0xa')](),controller[_0x3421('0x20')]);module[_0x3421('0x21')]=router; \ No newline at end of file +var _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0xe18861,_0x4043e2){var _0x302524=function(_0x347416){while(--_0x347416){_0xe18861['push'](_0xe18861['shift']());}};_0x302524(++_0x4043e2);}(_0x4fc2,0x111));var _0x24fc=function(_0x2a1e2d,_0x195473){_0x2a1e2d=_0x2a1e2d-0x0;var _0x32b8cc=_0x4fc2[_0x2a1e2d];return _0x32b8cc;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index bb347b7..45739c3 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 _0x8aad=['BOOLEAN','STRING','out','DATE','ENUM','INTEGER','sequelize','moment'];(function(_0x2be303,_0x1052ba){var _0xc7dd26=function(_0x845a88){while(--_0x845a88){_0x2be303['push'](_0x2be303['shift']());}};_0xc7dd26(++_0x1052ba);}(_0x8aad,0x146));var _0xd8aa=function(_0xd6df4d,_0x221cf1){_0xd6df4d=_0xd6df4d-0x0;var _0x10a0a9=_0x8aad[_0xd6df4d];return _0x10a0a9;};'use strict';var Sequelize=require(_0xd8aa('0x0'));var moment=require(_0xd8aa('0x1'));module['exports']={'closed':{'type':Sequelize[_0xd8aa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xd8aa('0x3')]},'secondDisposition':{'type':Sequelize[_0xd8aa('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xd8aa('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xd8aa('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd8aa('0x5')]},'lastMsgDirection':{'type':Sequelize[_0xd8aa('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd8aa('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xd8aa('0x7')]}}; \ No newline at end of file +var _0x7cdc=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','INTEGER'];(function(_0xb75fba,_0x3c94e9){var _0x2345b9=function(_0x3ed241){while(--_0x3ed241){_0xb75fba['push'](_0xb75fba['shift']());}};_0x2345b9(++_0x3c94e9);}(_0x7cdc,0x190));var _0xc7cd=function(_0x437493,_0x3b5ef2){_0x437493=_0x437493-0x0;var _0x20bf91=_0x7cdc[_0x437493];return _0x20bf91;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc7cd('0x0'));module[_0xc7cd('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc7cd('0x2')]},'disposition':{'type':Sequelize[_0xc7cd('0x3')]},'secondDisposition':{'type':Sequelize[_0xc7cd('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc7cd('0x3')]},'phone':{'type':Sequelize[_0xc7cd('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xc7cd('0x4')]('in',_0xc7cd('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc7cd('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xc7cd('0x4')]('in',_0xc7cd('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc7cd('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xc7cd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 74f2d17..406a7c8 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 _0x27e1=['keys','filters','intersection','attributes','length','includeAll','include','merge','options','create','body','find','addMessage','SmsMessage','ids','getMessages','fields','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','Tag','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','push','User','fullname','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','SmsAccount','Owner','get','mkdirSync','Account','N.A.','closed','closedAt','disposition','Messages','out','System','value','views','downloadInteraction.ejs','transcript-','.pdf','Sms','download','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','update','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','query','user','then','catch','show','params','model'];(function(_0x4285d6,_0x227dc6){var _0x59cdd4=function(_0x4c9239){while(--_0x4c9239){_0x4285d6['push'](_0x4285d6['shift']());}};_0x59cdd4(++_0x227dc6);}(_0x27e1,0x137));var _0x127e=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x27e1[_0x4b73a2];return _0x383c66;};'use strict';var rimraf=require(_0x127e('0x0'));var zipdir=require(_0x127e('0x1'));var moment=require(_0x127e('0x2'));var BPromise=require(_0x127e('0x3'));var util=require(_0x127e('0x4'));var path=require('path');var ejs=require(_0x127e('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x127e('0x6'));var logger=require(_0x127e('0x7'))(_0x127e('0x8'));var config=require(_0x127e('0x9'));var db=require(_0x127e('0xa'))['db'];config[_0x127e('0xb')]=_['defaults'](config['redis'],{'host':_0x127e('0xc'),'port':0x18eb});var socket=require(_0x127e('0xd'))(new Redis(config['redis']));require(_0x127e('0xe'))['register'](socket);function respondWithStatusCode(_0x41f34f,_0xdacb47){_0xdacb47=_0xdacb47||0xcc;return function(_0x34f90b){if(_0x34f90b){return _0x41f34f[_0x127e('0xf')](_0xdacb47);}return _0x41f34f['status'](_0xdacb47)[_0x127e('0x10')]();};}function respondWithResult(_0x329df1,_0xeec4da){_0xeec4da=_0xeec4da||0xc8;return function(_0x2d39cd){if(_0x2d39cd){return _0x329df1['status'](_0xeec4da)[_0x127e('0x11')](_0x2d39cd);}};}function respondWithFilteredResult(_0x527ad2,_0x55f609){return function(_0x1acb5d){if(_0x1acb5d){var _0x1faf8d=typeof _0x55f609['offset']===_0x127e('0x12')&&typeof _0x55f609[_0x127e('0x13')]==='undefined';var _0x745e2=_0x1acb5d[_0x127e('0x14')];var _0x45cd7b=_0x1faf8d?0x0:_0x55f609[_0x127e('0x15')];var _0x411c25=_0x1faf8d?_0x1acb5d[_0x127e('0x14')]:_0x55f609[_0x127e('0x15')]+_0x55f609['limit'];var _0xd518ab;if(_0x411c25>=_0x745e2){_0x411c25=_0x745e2;_0xd518ab=0xc8;}else{_0xd518ab=0xce;}_0x527ad2[_0x127e('0x16')](_0xd518ab);return _0x527ad2[_0x127e('0x17')](_0x127e('0x18'),_0x45cd7b+'-'+_0x411c25+'/'+_0x745e2)[_0x127e('0x11')](_0x1acb5d);}return null;};}function saveUpdates(_0x174ee1){return function(_0x356679){if(_0x356679){return _0x356679[_0x127e('0x19')](_0x174ee1)['then'](function(_0x362fe5){return _0x362fe5;});}return null;};}function removeEntity(_0xdfac46){return function(_0x1eeb72){if(_0x1eeb72){return _0x1eeb72[_0x127e('0x1a')]()['then'](function(){_0xdfac46[_0x127e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3904b7){return function(_0x2695cb){if(!_0x2695cb){_0x3904b7[_0x127e('0xf')](0x194);}return _0x2695cb;};}function handleError(_0xf980be,_0xcf81f9){_0xcf81f9=_0xcf81f9||0x1f4;return function(_0x23a11f){logger[_0x127e('0x1b')](_0x23a11f[_0x127e('0x1c')]);if(_0x23a11f[_0x127e('0x1d')]){delete _0x23a11f[_0x127e('0x1d')];}_0xf980be[_0x127e('0x16')](_0xcf81f9)[_0x127e('0x1e')](_0x23a11f);};}exports[_0x127e('0x1f')]=function(_0x2fa57e,_0x1fe81d){var _0x1ebcc9={};var _0x449655=_[_0x127e('0x20')](db[_0x127e('0x21')][_0x127e('0x22')],function(_0x33dba4){return{'name':_0x33dba4[_0x127e('0x23')],'type':_0x33dba4[_0x127e('0x24')][_0x127e('0x25')]};});_0x1ebcc9=qs[_0x127e('0x26')](_0x449655,_0x2fa57e);return interaction['findAll']('sms',_0x2fa57e[_0x127e('0x27')],_0x2fa57e[_0x127e('0x28')],_0x1ebcc9,_0x449655)[_0x127e('0x29')](respondWithFilteredResult(_0x1fe81d,_0x1ebcc9))[_0x127e('0x2a')](handleError(_0x1fe81d,null));};exports[_0x127e('0x2b')]=function(_0x19f0c2,_0x2271f2){var _0x33fd54={'raw':![],'where':{'id':_0x19f0c2[_0x127e('0x2c')]['id']}},_0x5b5d78={};_0x5b5d78[_0x127e('0x2d')]=_[_0x127e('0x2e')](db[_0x127e('0x21')]['rawAttributes']);_0x5b5d78[_0x127e('0x27')]=_['keys'](_0x19f0c2['query']);_0x5b5d78[_0x127e('0x2f')]=_[_0x127e('0x30')](_0x5b5d78['model'],_0x5b5d78['query']);_0x33fd54[_0x127e('0x31')]=_['intersection'](_0x5b5d78['model'],qs['fields'](_0x19f0c2[_0x127e('0x27')]['fields']));_0x33fd54[_0x127e('0x31')]=_0x33fd54[_0x127e('0x31')][_0x127e('0x32')]?_0x33fd54[_0x127e('0x31')]:_0x5b5d78[_0x127e('0x2d')];if(_0x19f0c2['query'][_0x127e('0x33')]){_0x33fd54[_0x127e('0x34')]=[{'all':!![]}];}_0x33fd54=_[_0x127e('0x35')]({},_0x33fd54,_0x19f0c2[_0x127e('0x36')]);return db['SmsInteraction']['find'](_0x33fd54)[_0x127e('0x29')](handleEntityNotFound(_0x2271f2,null))[_0x127e('0x29')](respondWithResult(_0x2271f2,null))[_0x127e('0x2a')](handleError(_0x2271f2,null));};exports[_0x127e('0x37')]=function(_0x45a5fa,_0x4c5f42){return db['SmsInteraction'][_0x127e('0x37')](_0x45a5fa['body'],{})[_0x127e('0x29')](respondWithResult(_0x4c5f42,0xc9))[_0x127e('0x2a')](handleError(_0x4c5f42,null));};exports['update']=function(_0x1a70c4,_0x4c101c){if(_0x1a70c4[_0x127e('0x38')]['id']){delete _0x1a70c4['body']['id'];}return db[_0x127e('0x21')][_0x127e('0x39')]({'where':{'id':_0x1a70c4[_0x127e('0x2c')]['id']}})[_0x127e('0x29')](handleEntityNotFound(_0x4c101c,null))[_0x127e('0x29')](saveUpdates(_0x1a70c4[_0x127e('0x38')],null))[_0x127e('0x29')](respondWithResult(_0x4c101c,null))[_0x127e('0x2a')](handleError(_0x4c101c,null));};exports[_0x127e('0x1a')]=function(_0x3279c0,_0xcc2f86){return db['SmsInteraction'][_0x127e('0x39')]({'where':{'id':_0x3279c0[_0x127e('0x2c')]['id']}})['then'](handleEntityNotFound(_0xcc2f86,null))[_0x127e('0x29')](removeEntity(_0xcc2f86,null))[_0x127e('0x2a')](handleError(_0xcc2f86,null));};exports['describe']=function(_0x2b7441,_0x3be342){return db[_0x127e('0x21')]['describe']()[_0x127e('0x29')](respondWithResult(_0x3be342,null))[_0x127e('0x2a')](handleError(_0x3be342,null));};exports[_0x127e('0x3a')]=function(_0x56b797,_0x247fac){return db[_0x127e('0x3b')]['find']({'where':{'id':_0x56b797['params']['id']}})['then'](handleEntityNotFound(_0x247fac,null))[_0x127e('0x29')](function(_0x4ec286){if(_0x4ec286){return _0x4ec286['addMessage'](_0x56b797[_0x127e('0x38')][_0x127e('0x3c')],_['omit'](_0x56b797[_0x127e('0x38')],[_0x127e('0x3c'),'id'])||{});}})[_0x127e('0x29')](respondWithResult(_0x247fac,null))[_0x127e('0x2a')](handleError(_0x247fac,null));};exports[_0x127e('0x3d')]=function(_0x1c735d,_0x1fc8cd){var _0x53558c={'raw':![],'where':{}};var _0x4f0664={};var _0x15ff26={'count':0x0,'rows':[]};return db[_0x127e('0x21')]['findOne']({'where':{'id':_0x1c735d[_0x127e('0x2c')]['id']}})[_0x127e('0x29')](handleEntityNotFound(_0x1fc8cd,null))['then'](function(_0x4272ea){if(_0x4272ea){_0x4f0664[_0x127e('0x2d')]=_[_0x127e('0x2e')](db[_0x127e('0x3b')][_0x127e('0x22')]);_0x4f0664['query']=_[_0x127e('0x2e')](_0x1c735d[_0x127e('0x27')]);_0x4f0664['filters']=_[_0x127e('0x30')](_0x4f0664[_0x127e('0x2d')],_0x4f0664[_0x127e('0x27')]);_0x53558c['attributes']=_['intersection'](_0x4f0664[_0x127e('0x2d')],qs[_0x127e('0x3e')](_0x1c735d['query']['fields']));_0x53558c[_0x127e('0x31')]=_0x53558c[_0x127e('0x31')]['length']?_0x53558c[_0x127e('0x31')]:_0x4f0664[_0x127e('0x2d')];if(!_0x1c735d[_0x127e('0x27')]['hasOwnProperty'](_0x127e('0x3f'))){_0x53558c[_0x127e('0x13')]=qs['limit'](_0x1c735d[_0x127e('0x27')][_0x127e('0x13')]);_0x53558c[_0x127e('0x15')]=qs[_0x127e('0x15')](_0x1c735d[_0x127e('0x27')]['offset']);}_0x53558c[_0x127e('0x40')]=qs[_0x127e('0x41')](_0x1c735d[_0x127e('0x27')][_0x127e('0x41')]);_0x53558c[_0x127e('0x42')]=qs[_0x127e('0x2f')](_[_0x127e('0x43')](_0x1c735d[_0x127e('0x27')],_0x4f0664[_0x127e('0x2f')]));_0x53558c[_0x127e('0x42')][_0x127e('0x44')]=_0x4272ea['id'];if(_0x1c735d[_0x127e('0x27')][_0x127e('0x45')]){_0x53558c['where']=_[_0x127e('0x35')](_0x53558c[_0x127e('0x42')],{'$or':_[_0x127e('0x20')](_0x53558c[_0x127e('0x31')],function(_0x59d945){var _0x7ad32b={};_0x7ad32b[_0x59d945]={'$like':'%'+_0x1c735d[_0x127e('0x27')]['filter']+'%'};return _0x7ad32b;})});}if(_0x1c735d['query']['$gte']){var _0x2b0d03=_0x1c735d[_0x127e('0x27')][_0x127e('0x46')]['split'](',');var _0x395fcc={};_0x395fcc[_0x2b0d03[0x0]]={'$gte':moment(_0x2b0d03[0x1])[_0x127e('0x47')](_0x127e('0x48'))};_0x53558c[_0x127e('0x42')]=_[_0x127e('0x35')](_0x53558c[_0x127e('0x42')],_0x395fcc);}_0x53558c=_['merge']({},_0x53558c,_0x1c735d[_0x127e('0x36')]);return db[_0x127e('0x3b')]['count']({'where':_0x53558c['where']})['then'](function(_0x3999cd){_0x15ff26[_0x127e('0x14')]=_0x3999cd;if(_0x1c735d[_0x127e('0x27')][_0x127e('0x33')]){_0x53558c['include']=[{'all':!![]}];}return db[_0x127e('0x3b')]['findAll'](_0x53558c);})['then'](function(_0x579bcc){_0x15ff26[_0x127e('0x49')]=_0x579bcc;return _0x15ff26;});}})[_0x127e('0x29')](respondWithFilteredResult(_0x1fc8cd,_0x53558c))[_0x127e('0x2a')](handleError(_0x1fc8cd,null));};exports['addTags']=function(_0x3068aa,_0x5a2991){return db[_0x127e('0x21')]['find']({'where':{'id':_0x3068aa[_0x127e('0x2c')]['id']}})[_0x127e('0x29')](handleEntityNotFound(_0x5a2991,null))[_0x127e('0x29')](function(_0x5a96c0){if(_0x5a96c0){return _0x5a96c0[_0x127e('0x4a')](_0x3068aa['body'][_0x127e('0x3c')],_[_0x127e('0x4b')](_0x3068aa[_0x127e('0x38')],[_0x127e('0x3c'),'id'])||{})['spread'](function(){return db[_0x127e('0x4c')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x3068aa[_0x127e('0x38')]['ids']}});})[_0x127e('0x29')](function(_0xf73113){socket[_0x127e('0x4d')](_0x127e('0x4e'),{'id':Number(_0x3068aa[_0x127e('0x2c')]['id']),'tags':_0xf73113||[]});return{'id':Number(_0x3068aa[_0x127e('0x2c')]['id']),'tags':_0xf73113||[]};});}})[_0x127e('0x29')](respondWithResult(_0x5a2991,null))['catch'](handleError(_0x5a2991,null));};exports[_0x127e('0x4f')]=function(_0x5642cd,_0x178692){return db[_0x127e('0x21')]['find']({'where':{'id':_0x5642cd['params']['id']}})['then'](handleEntityNotFound(_0x178692,null))[_0x127e('0x29')](function(_0x1e13da){if(_0x1e13da){return _0x1e13da[_0x127e('0x4f')](_0x5642cd[_0x127e('0x27')][_0x127e('0x3c')]);}})[_0x127e('0x29')](respondWithStatusCode(_0x178692,null))[_0x127e('0x2a')](handleError(_0x178692,null));};exports['download']=function(_0x157d34,_0x21c733){var _0x512a13=moment()[_0x127e('0x50')]()[_0x127e('0x51')]();var _0x1c6477=path[_0x127e('0x52')](config[_0x127e('0x53')],_0x127e('0x54'),_0x127e('0x55'),_0x127e('0x56'));var _0x2365c3=path[_0x127e('0x52')](_0x1c6477,_0x512a13);var _0x4872ef=util[_0x127e('0x47')]('transcript-%d-%s.zip',_0x157d34[_0x127e('0x2c')]['id'],_0x512a13);var _0x508fb3=path[_0x127e('0x52')](_0x1c6477,_0x4872ef);var _0x47c2e4=[];_0x47c2e4[_0x127e('0x57')]({'model':db['User'],'as':_0x127e('0x58'),'attributes':['id',_0x127e('0x59')],'raw':!![]});_0x47c2e4['push']({'model':db[_0x127e('0x5a')],'as':_0x127e('0x5b'),'attributes':['id',_0x127e('0x5c'),_0x127e('0x5d')],'raw':!![]});var _0x25da12=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x127e('0x38'),_0x127e('0x5e'),_0x127e('0x5f'),_0x127e('0x60'),_0x127e('0x61')],'include':_0x47c2e4}];_0x25da12[_0x127e('0x57')]({'model':db[_0x127e('0x62')],'as':'Account','attributes':['id',_0x127e('0x1d')]});_0x25da12[_0x127e('0x57')]({'model':db[_0x127e('0x58')],'as':_0x127e('0x63'),'attributes':['id',_0x127e('0x59')]});return db['SmsInteraction'][_0x127e('0x39')]({'where':{'id':_0x157d34[_0x127e('0x2c')]['id']},'include':_0x25da12})[_0x127e('0x29')](handleEntityNotFound(_0x21c733,null))[_0x127e('0x29')](function(_0x25f565){if(_0x25f565){var _0x1d717f=_0x25f565[_0x127e('0x64')]({'plain':!![]});fs[_0x127e('0x65')](_0x2365c3);var _0x17d875={'channel':'Sms','account':_0x1d717f[_0x127e('0x66')][_0x127e('0x1d')],'agent':_0x1d717f[_0x127e('0x63')]?_0x1d717f['Owner'][_0x127e('0x59')]:_0x127e('0x67'),'createdAt':moment(_0x1d717f['createdAt'])['format'](_0x127e('0x48'))['toString'](),'closedAt':_0x1d717f[_0x127e('0x68')]?moment(_0x1d717f[_0x127e('0x69')])[_0x127e('0x47')](_0x127e('0x48'))[_0x127e('0x51')]():'','disposition':_0x1d717f[_0x127e('0x6a')],'messages':_(_0x1d717f[_0x127e('0x6b')])['filter']({'secret':![]})['map'](function(_0x325d0c){return{'date':moment(_0x325d0c[_0x127e('0x5e')])[_0x127e('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x325d0c[_0x127e('0x5f')]===_0x127e('0x6c')?_0x325d0c[_0x127e('0x58')]?_0x325d0c['User']['fullname']:_0x127e('0x6d'):_0x325d0c['Contact'][_0x127e('0x5c')]+(_0x325d0c[_0x127e('0x5b')]['lastName']?'\x20'+_0x325d0c[_0x127e('0x5b')][_0x127e('0x5d')]:''),'body':_0x325d0c[_0x127e('0x38')],'direction':_0x325d0c[_0x127e('0x5f')]===_0x127e('0x6c')?'A':'C','secret':_0x325d0c[_0x127e('0x60')],'read':_0x325d0c[_0x127e('0x61')]};})[_0x127e('0x6e')]()};return ejs['renderFile'](path['join'](config[_0x127e('0x53')],_0x127e('0x54'),_0x127e('0x6f'),_0x127e('0x70')),{'interaction':_0x17d875})['then'](function(_0x23b31e){var _0x36a905=path[_0x127e('0x52')](_0x2365c3,_0x127e('0x71')+_0x1d717f['id']+'-'+_0x512a13+_0x127e('0x72'));var _0x261dd6={'path':_0x36a905,'channel':_0x127e('0x73'),'interactionId':_0x1d717f['id']};return pdf['createPdfFromHTML'](_0x23b31e,_0x261dd6);})[_0x127e('0x29')](function(){return new BPromise(function(_0x2b581c,_0x4bcfcc){zipdir(_0x2365c3,{'saveTo':_0x508fb3},function(_0x1dde45,_0x231ce2){if(_0x1dde45)return _0x4bcfcc(_0x1dde45);return _0x2b581c(_0x231ce2);});})[_0x127e('0x29')](function(){return new BPromise(function(_0x2afe17,_0x1fe4a9){rimraf(_0x2365c3,function(_0x1e2b71){if(_0x1e2b71)_0x1fe4a9(_0x1e2b71);return _0x2afe17();});});})[_0x127e('0x29')](function(){return _0x21c733[_0x127e('0x74')](_0x508fb3,_0x4872ef,function(_0x17a611){if(_0x17a611){console['log'](_0x127e('0x75'),_0x17a611);}else{fs[_0x127e('0x76')](_0x508fb3);}});});});}else{return _0x21c733[_0x127e('0xf')](0xc8);}})[_0x127e('0x2a')](handleError(_0x21c733,null));}; \ No newline at end of file +var _0x932e=['unix','toString','join','root','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Messages','createdAt','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','closed','closedAt','disposition','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','path','ejs','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','undefined','count','offset','Content-Range','update','then','destroy','error','stack','name','send','index','fieldName','type','key','getOptions','findAll','sms','query','user','catch','show','model','keys','SmsInteraction','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','params','describe','addMessage','SmsMessage','omit','getMessages','findOne','hasOwnProperty','nolimit','limit','sort','where','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','ids','spread','color','removeTags','download'];(function(_0x5e1cfe,_0x3e1a15){var _0x59b74f=function(_0x256b78){while(--_0x256b78){_0x5e1cfe['push'](_0x5e1cfe['shift']());}};_0x59b74f(++_0x3e1a15);}(_0x932e,0x9e));var _0xe932=function(_0x263c23,_0xf3e464){_0x263c23=_0x263c23-0x0;var _0xa822e3=_0x932e[_0x263c23];return _0xa822e3;};'use strict';var rimraf=require(_0xe932('0x0'));var zipdir=require(_0xe932('0x1'));var moment=require('moment');var BPromise=require(_0xe932('0x2'));var util=require('util');var path=require(_0xe932('0x3'));var ejs=require(_0xe932('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xe932('0x5'));var qs=require(_0xe932('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xe932('0x7'));var config=require(_0xe932('0x8'));var db=require(_0xe932('0x9'))['db'];config[_0xe932('0xa')]=_['defaults'](config[_0xe932('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xe932('0xb'))(new Redis(config[_0xe932('0xa')]));require(_0xe932('0xc'))[_0xe932('0xd')](socket);function respondWithStatusCode(_0x542420,_0xd13974){_0xd13974=_0xd13974||0xcc;return function(_0x2294ff){if(_0x2294ff){return _0x542420[_0xe932('0xe')](_0xd13974);}return _0x542420[_0xe932('0xf')](_0xd13974)[_0xe932('0x10')]();};}function respondWithResult(_0x17f0a6,_0x5976ea){_0x5976ea=_0x5976ea||0xc8;return function(_0x4e7de1){if(_0x4e7de1){return _0x17f0a6[_0xe932('0xf')](_0x5976ea)['json'](_0x4e7de1);}};}function respondWithFilteredResult(_0x3d83d8,_0x49f94f){return function(_0x87d0f1){if(_0x87d0f1){var _0xa852fa=typeof _0x49f94f['offset']===_0xe932('0x11')&&typeof _0x49f94f['limit']==='undefined';var _0x5319d3=_0x87d0f1[_0xe932('0x12')];var _0x22acec=_0xa852fa?0x0:_0x49f94f[_0xe932('0x13')];var _0x5a4115=_0xa852fa?_0x87d0f1[_0xe932('0x12')]:_0x49f94f[_0xe932('0x13')]+_0x49f94f['limit'];var _0x4f7597;if(_0x5a4115>=_0x5319d3){_0x5a4115=_0x5319d3;_0x4f7597=0xc8;}else{_0x4f7597=0xce;}_0x3d83d8['status'](_0x4f7597);return _0x3d83d8['set'](_0xe932('0x14'),_0x22acec+'-'+_0x5a4115+'/'+_0x5319d3)['json'](_0x87d0f1);}return null;};}function saveUpdates(_0x47ad41){return function(_0x2932c7){if(_0x2932c7){return _0x2932c7[_0xe932('0x15')](_0x47ad41)[_0xe932('0x16')](function(_0x5ceadc){return _0x5ceadc;});}return null;};}function removeEntity(_0x548a3b){return function(_0x340f9d){if(_0x340f9d){return _0x340f9d[_0xe932('0x17')]()['then'](function(){_0x548a3b[_0xe932('0xf')](0xcc)[_0xe932('0x10')]();});}};}function handleEntityNotFound(_0x4bbfa8){return function(_0x57b3b9){if(!_0x57b3b9){_0x4bbfa8[_0xe932('0xe')](0x194);}return _0x57b3b9;};}function handleError(_0x3441eb,_0x2e2f26){_0x2e2f26=_0x2e2f26||0x1f4;return function(_0xaac952){logger[_0xe932('0x18')](_0xaac952[_0xe932('0x19')]);if(_0xaac952[_0xe932('0x1a')]){delete _0xaac952['name'];}_0x3441eb[_0xe932('0xf')](_0x2e2f26)[_0xe932('0x1b')](_0xaac952);};}exports[_0xe932('0x1c')]=function(_0x94e943,_0x2cb22b){var _0x1a4a8b={};var _0xf1b66f=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x5bb397){return{'name':_0x5bb397[_0xe932('0x1d')],'type':_0x5bb397[_0xe932('0x1e')][_0xe932('0x1f')]};});_0x1a4a8b=qs[_0xe932('0x20')](_0xf1b66f,_0x94e943);return interaction[_0xe932('0x21')](_0xe932('0x22'),_0x94e943[_0xe932('0x23')],_0x94e943[_0xe932('0x24')],_0x1a4a8b,_0xf1b66f)[_0xe932('0x16')](respondWithFilteredResult(_0x2cb22b,_0x1a4a8b))[_0xe932('0x25')](handleError(_0x2cb22b,null));};exports[_0xe932('0x26')]=function(_0x2571ac,_0x2fa42a){var _0x29f7e6={'raw':![],'where':{'id':_0x2571ac['params']['id']}},_0x22e93b={};_0x22e93b[_0xe932('0x27')]=_[_0xe932('0x28')](db[_0xe932('0x29')][_0xe932('0x2a')]);_0x22e93b[_0xe932('0x23')]=_[_0xe932('0x28')](_0x2571ac[_0xe932('0x23')]);_0x22e93b[_0xe932('0x2b')]=_[_0xe932('0x2c')](_0x22e93b['model'],_0x22e93b[_0xe932('0x23')]);_0x29f7e6[_0xe932('0x2d')]=_[_0xe932('0x2c')](_0x22e93b['model'],qs['fields'](_0x2571ac[_0xe932('0x23')][_0xe932('0x2e')]));_0x29f7e6[_0xe932('0x2d')]=_0x29f7e6[_0xe932('0x2d')][_0xe932('0x2f')]?_0x29f7e6[_0xe932('0x2d')]:_0x22e93b[_0xe932('0x27')];if(_0x2571ac[_0xe932('0x23')][_0xe932('0x30')]){_0x29f7e6[_0xe932('0x31')]=[{'all':!![]}];}_0x29f7e6=_['merge']({},_0x29f7e6,_0x2571ac[_0xe932('0x32')]);return db[_0xe932('0x29')][_0xe932('0x33')](_0x29f7e6)[_0xe932('0x16')](handleEntityNotFound(_0x2fa42a,null))['then'](respondWithResult(_0x2fa42a,null))[_0xe932('0x25')](handleError(_0x2fa42a,null));};exports[_0xe932('0x34')]=function(_0x443360,_0x25d579){return db[_0xe932('0x29')][_0xe932('0x34')](_0x443360['body'],{})[_0xe932('0x16')](respondWithResult(_0x25d579,0xc9))[_0xe932('0x25')](handleError(_0x25d579,null));};exports['update']=function(_0x234519,_0x3ee97f){if(_0x234519[_0xe932('0x35')]['id']){delete _0x234519['body']['id'];}return db[_0xe932('0x29')][_0xe932('0x33')]({'where':{'id':_0x234519['params']['id']}})[_0xe932('0x16')](handleEntityNotFound(_0x3ee97f,null))[_0xe932('0x16')](saveUpdates(_0x234519[_0xe932('0x35')],null))[_0xe932('0x16')](respondWithResult(_0x3ee97f,null))[_0xe932('0x25')](handleError(_0x3ee97f,null));};exports[_0xe932('0x17')]=function(_0x55253a,_0x361fea){return db[_0xe932('0x29')][_0xe932('0x33')]({'where':{'id':_0x55253a[_0xe932('0x36')]['id']}})[_0xe932('0x16')](handleEntityNotFound(_0x361fea,null))[_0xe932('0x16')](removeEntity(_0x361fea,null))[_0xe932('0x25')](handleError(_0x361fea,null));};exports[_0xe932('0x37')]=function(_0x286b07,_0x297a42){return db[_0xe932('0x29')]['describe']()['then'](respondWithResult(_0x297a42,null))[_0xe932('0x25')](handleError(_0x297a42,null));};exports[_0xe932('0x38')]=function(_0xb02b00,_0x5ebe80){return db[_0xe932('0x39')][_0xe932('0x33')]({'where':{'id':_0xb02b00[_0xe932('0x36')]['id']}})['then'](handleEntityNotFound(_0x5ebe80,null))[_0xe932('0x16')](function(_0x52adaf){if(_0x52adaf){return _0x52adaf[_0xe932('0x38')](_0xb02b00[_0xe932('0x35')]['ids'],_[_0xe932('0x3a')](_0xb02b00[_0xe932('0x35')],['ids','id'])||{});}})['then'](respondWithResult(_0x5ebe80,null))[_0xe932('0x25')](handleError(_0x5ebe80,null));};exports[_0xe932('0x3b')]=function(_0x2a6f77,_0x23d4e4){var _0x22c127={'raw':![],'where':{}};var _0x57aa7e={};var _0x5185e2={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xe932('0x3c')]({'where':{'id':_0x2a6f77[_0xe932('0x36')]['id']}})['then'](handleEntityNotFound(_0x23d4e4,null))[_0xe932('0x16')](function(_0x29056d){if(_0x29056d){_0x57aa7e[_0xe932('0x27')]=_[_0xe932('0x28')](db['SmsMessage'][_0xe932('0x2a')]);_0x57aa7e[_0xe932('0x23')]=_[_0xe932('0x28')](_0x2a6f77['query']);_0x57aa7e['filters']=_[_0xe932('0x2c')](_0x57aa7e['model'],_0x57aa7e[_0xe932('0x23')]);_0x22c127[_0xe932('0x2d')]=_[_0xe932('0x2c')](_0x57aa7e[_0xe932('0x27')],qs[_0xe932('0x2e')](_0x2a6f77[_0xe932('0x23')]['fields']));_0x22c127[_0xe932('0x2d')]=_0x22c127[_0xe932('0x2d')]['length']?_0x22c127[_0xe932('0x2d')]:_0x57aa7e[_0xe932('0x27')];if(!_0x2a6f77['query'][_0xe932('0x3d')](_0xe932('0x3e'))){_0x22c127[_0xe932('0x3f')]=qs[_0xe932('0x3f')](_0x2a6f77[_0xe932('0x23')][_0xe932('0x3f')]);_0x22c127[_0xe932('0x13')]=qs[_0xe932('0x13')](_0x2a6f77[_0xe932('0x23')][_0xe932('0x13')]);}_0x22c127['order']=qs[_0xe932('0x40')](_0x2a6f77[_0xe932('0x23')][_0xe932('0x40')]);_0x22c127[_0xe932('0x41')]=qs[_0xe932('0x2b')](_['pick'](_0x2a6f77[_0xe932('0x23')],_0x57aa7e[_0xe932('0x2b')]));_0x22c127[_0xe932('0x41')]['SmsInteractionId']=_0x29056d['id'];if(_0x2a6f77[_0xe932('0x23')][_0xe932('0x42')]){_0x22c127[_0xe932('0x41')]=_[_0xe932('0x43')](_0x22c127[_0xe932('0x41')],{'$or':_[_0xe932('0x44')](_0x22c127['attributes'],function(_0x47c5c7){var _0x289486={};_0x289486[_0x47c5c7]={'$like':'%'+_0x2a6f77[_0xe932('0x23')][_0xe932('0x42')]+'%'};return _0x289486;})});}if(_0x2a6f77[_0xe932('0x23')][_0xe932('0x45')]){var _0x406ce2=_0x2a6f77[_0xe932('0x23')][_0xe932('0x45')][_0xe932('0x46')](',');var _0xfa9baf={};_0xfa9baf[_0x406ce2[0x0]]={'$gte':moment(_0x406ce2[0x1])[_0xe932('0x47')](_0xe932('0x48'))};_0x22c127[_0xe932('0x41')]=_[_0xe932('0x43')](_0x22c127[_0xe932('0x41')],_0xfa9baf);}_0x22c127=_[_0xe932('0x43')]({},_0x22c127,_0x2a6f77['options']);return db[_0xe932('0x39')][_0xe932('0x12')]({'where':_0x22c127[_0xe932('0x41')]})[_0xe932('0x16')](function(_0x21f51b){_0x5185e2[_0xe932('0x12')]=_0x21f51b;if(_0x2a6f77[_0xe932('0x23')]['includeAll']){_0x22c127[_0xe932('0x31')]=[{'all':!![]}];}return db[_0xe932('0x39')]['findAll'](_0x22c127);})[_0xe932('0x16')](function(_0x4f6472){_0x5185e2[_0xe932('0x49')]=_0x4f6472;return _0x5185e2;});}})[_0xe932('0x16')](respondWithFilteredResult(_0x23d4e4,_0x22c127))[_0xe932('0x25')](handleError(_0x23d4e4,null));};exports[_0xe932('0x4a')]=function(_0xd31cda,_0x2368b3){return db[_0xe932('0x29')][_0xe932('0x33')]({'where':{'id':_0xd31cda['params']['id']}})[_0xe932('0x16')](handleEntityNotFound(_0x2368b3,null))[_0xe932('0x16')](function(_0x278a85){if(_0x278a85){return _0x278a85['setTags'](_0xd31cda[_0xe932('0x35')][_0xe932('0x4b')],_[_0xe932('0x3a')](_0xd31cda[_0xe932('0x35')],['ids','id'])||{})[_0xe932('0x4c')](function(){return db['Tag'][_0xe932('0x21')]({'attributes':['id',_0xe932('0x1a'),_0xe932('0x4d')],'where':{'id':_0xd31cda[_0xe932('0x35')][_0xe932('0x4b')]}});})[_0xe932('0x16')](function(_0x141672){socket['emit']('smsInteractionTags:save',{'id':Number(_0xd31cda['params']['id']),'tags':_0x141672||[]});return{'id':Number(_0xd31cda['params']['id']),'tags':_0x141672||[]};});}})[_0xe932('0x16')](respondWithResult(_0x2368b3,null))[_0xe932('0x25')](handleError(_0x2368b3,null));};exports[_0xe932('0x4e')]=function(_0x23436c,_0x2d401f){return db[_0xe932('0x29')][_0xe932('0x33')]({'where':{'id':_0x23436c['params']['id']}})['then'](handleEntityNotFound(_0x2d401f,null))[_0xe932('0x16')](function(_0x5305fd){if(_0x5305fd){return _0x5305fd[_0xe932('0x4e')](_0x23436c[_0xe932('0x23')]['ids']);}})[_0xe932('0x16')](respondWithStatusCode(_0x2d401f,null))[_0xe932('0x25')](handleError(_0x2d401f,null));};exports[_0xe932('0x4f')]=function(_0x11e8f3,_0x18ecb8){var _0x4cfe49=moment()[_0xe932('0x50')]()[_0xe932('0x51')]();var _0x41cfa4=path[_0xe932('0x52')](config[_0xe932('0x53')],_0xe932('0x54'),'files',_0xe932('0x55'));var _0xdf4f=path[_0xe932('0x52')](_0x41cfa4,_0x4cfe49);var _0x59ba9f=util[_0xe932('0x47')](_0xe932('0x56'),_0x11e8f3[_0xe932('0x36')]['id'],_0x4cfe49);var _0x12cbfc=path[_0xe932('0x52')](_0x41cfa4,_0x59ba9f);var _0x3c126e=[];_0x3c126e[_0xe932('0x57')]({'model':db[_0xe932('0x58')],'as':'User','attributes':['id',_0xe932('0x59')],'raw':!![]});_0x3c126e[_0xe932('0x57')]({'model':db[_0xe932('0x5a')],'as':_0xe932('0x5b'),'attributes':['id',_0xe932('0x5c'),'lastName'],'raw':!![]});var _0xc512ee=[{'model':db[_0xe932('0x39')],'as':_0xe932('0x5d'),'attributes':['id','body',_0xe932('0x5e'),_0xe932('0x5f'),_0xe932('0x60'),_0xe932('0x61')],'include':_0x3c126e}];_0xc512ee[_0xe932('0x57')]({'model':db[_0xe932('0x62')],'as':_0xe932('0x63'),'attributes':['id',_0xe932('0x1a')]});_0xc512ee[_0xe932('0x57')]({'model':db[_0xe932('0x58')],'as':_0xe932('0x64'),'attributes':['id','fullname']});return db[_0xe932('0x29')][_0xe932('0x33')]({'where':{'id':_0x11e8f3[_0xe932('0x36')]['id']},'include':_0xc512ee})[_0xe932('0x16')](handleEntityNotFound(_0x18ecb8,null))['then'](function(_0x371b2d){if(_0x371b2d){var _0x52efae=_0x371b2d[_0xe932('0x65')]({'plain':!![]});fs[_0xe932('0x66')](_0xdf4f);var _0x46b7e0={'channel':_0xe932('0x67'),'account':_0x52efae[_0xe932('0x63')][_0xe932('0x1a')],'agent':_0x52efae[_0xe932('0x64')]?_0x52efae[_0xe932('0x64')][_0xe932('0x59')]:_0xe932('0x68'),'createdAt':moment(_0x52efae[_0xe932('0x5e')])[_0xe932('0x47')](_0xe932('0x48'))[_0xe932('0x51')](),'closedAt':_0x52efae[_0xe932('0x69')]?moment(_0x52efae[_0xe932('0x6a')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe932('0x51')]():'','disposition':_0x52efae[_0xe932('0x6b')],'messages':_(_0x52efae['Messages'])[_0xe932('0x42')]({'secret':![]})[_0xe932('0x44')](function(_0x335fb8){return{'date':moment(_0x335fb8[_0xe932('0x5e')])[_0xe932('0x47')](_0xe932('0x48'))[_0xe932('0x51')](),'sender':_0x335fb8[_0xe932('0x5f')]===_0xe932('0x6c')?_0x335fb8['User']?_0x335fb8[_0xe932('0x58')][_0xe932('0x59')]:_0xe932('0x6d'):_0x335fb8[_0xe932('0x5b')][_0xe932('0x5c')]+(_0x335fb8[_0xe932('0x5b')]['lastName']?'\x20'+_0x335fb8[_0xe932('0x5b')][_0xe932('0x6e')]:''),'body':_0x335fb8['body'],'direction':_0x335fb8[_0xe932('0x5f')]===_0xe932('0x6c')?'A':'C','secret':_0x335fb8[_0xe932('0x60')],'read':_0x335fb8['read']};})['value']()};return ejs[_0xe932('0x6f')](path['join'](config[_0xe932('0x53')],'server',_0xe932('0x70'),_0xe932('0x71')),{'interaction':_0x46b7e0})[_0xe932('0x16')](function(_0x31e315){var _0x2b4b18=path[_0xe932('0x52')](_0xdf4f,_0xe932('0x72')+_0x52efae['id']+'-'+_0x4cfe49+'.pdf');var _0x19e2cb={'path':_0x2b4b18,'channel':'Sms','interactionId':_0x52efae['id']};return pdf[_0xe932('0x73')](_0x31e315,_0x19e2cb);})[_0xe932('0x16')](function(){return new BPromise(function(_0x5b9e60,_0x49af7a){zipdir(_0xdf4f,{'saveTo':_0x12cbfc},function(_0x4545ec,_0x22b38f){if(_0x4545ec)return _0x49af7a(_0x4545ec);return _0x5b9e60(_0x22b38f);});})['then'](function(){return new BPromise(function(_0x57869e,_0x49383b){rimraf(_0xdf4f,function(_0x24494a){if(_0x24494a)_0x49383b(_0x24494a);return _0x57869e();});});})[_0xe932('0x16')](function(){return _0x18ecb8[_0xe932('0x4f')](_0x12cbfc,_0x59ba9f,function(_0x269e42){if(_0x269e42){console[_0xe932('0x74')](_0xe932('0x75'),_0x269e42);}else{fs[_0xe932('0x76')](_0x12cbfc);}});});});}else{return _0x18ecb8[_0xe932('0xe')](0xc8);}})['catch'](handleError(_0x18ecb8,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 1dec359..50ed948 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 _0x2272=['findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2227('0x0'));var SmsInteraction=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var SmsMessage=require(_0x2227('0x1'))['db'][_0x2227('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':_0x2227('0x5'),'afterDestroy':_0x2227('0x6')};function emitEvent(_0x4c17c2){return function(_0x4ebde3,_0x1e5a8a,_0x3b8661){_0x4ebde3[_0x2227('0x7')]({'attributes':['id'],'raw':!![]})[_0x2227('0x8')](function(_0xaec623){_0x4ebde3[_0x2227('0x9')](_0x2227('0xa'),_0xaec623[_0x2227('0xb')](function(_0x18094d){return{'id':_0x18094d['id']};}));return SmsMessage[_0x2227('0xc')]({'where':{'SmsInteractionId':_0x4ebde3['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x799370){_0x4ebde3['setDataValue'](_0x2227('0xd'),_0x799370[_0x2227('0xe')]);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2+':'+_0x4ebde3['id'],_0x4ebde3);SmsInteractionEvents[_0x2227('0xf')](_0x4c17c2,_0x4ebde3);_0x3b8661(null);})[_0x2227('0x10')](_0x3b8661(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2227('0x11')](e,emitEvent(event));}}module[_0x2227('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x5464=['SmsMessage','save','remove','setDataValue','Users','map','findAll','then','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction'];(function(_0x9446b5,_0x5c971b){var _0x2fb09a=function(_0x576726){while(--_0x576726){_0x9446b5['push'](_0x9446b5['shift']());}};_0x2fb09a(++_0x5c971b);}(_0x5464,0x15d));var _0x4546=function(_0x2300f6,_0x40ddde){_0x2300f6=_0x2300f6-0x0;var _0x4f7aeb=_0x5464[_0x2300f6];return _0x4f7aeb;};'use strict';var EventEmitter=require(_0x4546('0x0'));var SmsInteraction=require(_0x4546('0x1'))['db'][_0x4546('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x4546('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4546('0x4'),'afterUpdate':'update','afterDestroy':_0x4546('0x5')};function emitEvent(_0x396a1d){return function(_0xcc9def,_0x2b1a9b,_0x54228a){_0xcc9def['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x224c7c){_0xcc9def[_0x4546('0x6')](_0x4546('0x7'),_0x224c7c[_0x4546('0x8')](function(_0x2f0376){return{'id':_0x2f0376['id']};}));return SmsMessage[_0x4546('0x9')]({'where':{'SmsInteractionId':_0xcc9def['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4546('0xa')](function(_0x430b2e){_0xcc9def[_0x4546('0x6')]('unreadMessages',_0x430b2e[_0x4546('0xb')]);SmsInteractionEvents[_0x4546('0xc')](_0x396a1d+':'+_0xcc9def['id'],_0xcc9def);SmsInteractionEvents[_0x4546('0xc')](_0x396a1d,_0xcc9def);_0x54228a(null);})['catch'](_0x54228a(null));};}for(var e in events){if(events[_0x4546('0xd')](e)){var event=events[e];SmsInteraction[_0x4546('0xe')](e,emitEvent(event));}}module[_0x4546('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index a89ff6a..304cc8a 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 _0xd9e3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','lodash','util'];(function(_0x482580,_0x1514f3){var _0x3bdaca=function(_0x4423d7){while(--_0x4423d7){_0x482580['push'](_0x482580['shift']());}};_0x3bdaca(++_0x1514f3);}(_0xd9e3,0x80));var _0x3d9e=function(_0x379926,_0x427226){_0x379926=_0x379926-0x0;var _0x22e506=_0xd9e3[_0x379926];return _0x22e506;};'use strict';var _=require(_0x3d9e('0x0'));var util=require(_0x3d9e('0x1'));var logger=require('../../config/logger')(_0x3d9e('0x2'));var moment=require(_0x3d9e('0x3'));var BPromise=require(_0x3d9e('0x4'));var rp=require(_0x3d9e('0x5'));var fs=require('fs');var path=require(_0x3d9e('0x6'));var rimraf=require(_0x3d9e('0x7'));var config=require(_0x3d9e('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x3d9e('0x9')]=function(_0x1e59a9,_0x3b640e){return _0x1e59a9['define'](_0x3d9e('0xa'),attributes,{'tableName':_0x3d9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b1abf,_0x455a5b,_0x5130ab){if(_0x5b1abf[_0x3d9e('0xc')]('closed')){_0x5b1abf['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5130ab(null,_0x5b1abf);}}});}; \ No newline at end of file +var _0x5140=['util','api','moment','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x354bd6,_0x4a7c74){var _0x39bf52=function(_0x585791){while(--_0x585791){_0x354bd6['push'](_0x354bd6['shift']());}};_0x39bf52(++_0x4a7c74);}(_0x5140,0x137));var _0x0514=function(_0x1ce855,_0x2f677f){_0x1ce855=_0x1ce855-0x0;var _0x246566=_0x5140[_0x1ce855];return _0x246566;};'use strict';var _=require(_0x0514('0x0'));var util=require(_0x0514('0x1'));var logger=require('../../config/logger')(_0x0514('0x2'));var moment=require(_0x0514('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0514('0x4'));var config=require(_0x0514('0x5'));var attributes=require('./smsInteraction.attributes');module[_0x0514('0x6')]=function(_0x2c8dd3,_0xfcb4ef){return _0x2c8dd3[_0x0514('0x7')](_0x0514('0x8'),attributes,{'tableName':_0x0514('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x397ff8,_0x3d256d,_0x2e817a){if(_0x397ff8[_0x0514('0xa')](_0x0514('0xb'))){_0x397ff8['closedAt']=moment()['format'](_0x0514('0xc'));}_0x2e817a(null,_0x397ff8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a397549..c5e50c1 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 _0x8dce=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','SmsInteraction','body','options','raw','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x4d08b8,_0x289e25){var _0x37f4e0=function(_0x1714b4){while(--_0x1714b4){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x37f4e0(++_0x289e25);}(_0x8dce,0x9b));var _0xe8dc=function(_0xca85de,_0x15abc5){_0xca85de=_0xca85de-0x0;var _0x11d51b=_0x8dce[_0xca85de];return _0x11d51b;};'use strict';var _=require(_0xe8dc('0x0'));var util=require(_0xe8dc('0x1'));var moment=require(_0xe8dc('0x2'));var BPromise=require(_0xe8dc('0x3'));var rs=require(_0xe8dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8dc('0x6'))(_0xe8dc('0x7'));var config=require(_0xe8dc('0x8'));var jayson=require(_0xe8dc('0x9'));var client=jayson[_0xe8dc('0xa')][_0xe8dc('0xb')]({'port':0x232a});config[_0xe8dc('0xc')]=_[_0xe8dc('0xd')](config['redis'],{'host':_0xe8dc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8dc('0xc')]));require(_0xe8dc('0xf'))[_0xe8dc('0x10')](socket);function respondWithRpcPromise(_0x1d3e36,_0x60f056,_0x1da71a){return new BPromise(function(_0xd83854,_0x18fb82){return client['request'](_0x1d3e36,_0x1da71a)[_0xe8dc('0x11')](function(_0x3df0ae){logger[_0xe8dc('0x12')](_0xe8dc('0x13'),_0x60f056,_0xe8dc('0x14'));logger[_0xe8dc('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x60f056,_0xe8dc('0x14'),JSON[_0xe8dc('0x16')](_0x3df0ae));if(_0x3df0ae[_0xe8dc('0x17')]){if(_0x3df0ae[_0xe8dc('0x17')]['code']===0x1f4){logger[_0xe8dc('0x17')](_0xe8dc('0x13'),_0x60f056,_0x3df0ae[_0xe8dc('0x17')][_0xe8dc('0x18')]);return _0x18fb82(_0x3df0ae[_0xe8dc('0x17')][_0xe8dc('0x18')]);}logger[_0xe8dc('0x17')](_0xe8dc('0x13'),_0x60f056,_0x3df0ae['error'][_0xe8dc('0x18')]);return _0xd83854(_0x3df0ae['error'][_0xe8dc('0x18')]);}else{logger[_0xe8dc('0x12')](_0xe8dc('0x13'),_0x60f056,_0xe8dc('0x14'));_0xd83854(_0x3df0ae['result'][_0xe8dc('0x18')]);}})[_0xe8dc('0x19')](function(_0x107948){logger[_0xe8dc('0x17')](_0xe8dc('0x13'),_0x60f056,_0x107948);_0x18fb82(_0x107948);});});}exports['UpdateSmsInteraction']=function(_0x158e57){var _0x4ff2a6=this;return new Promise(function(_0x1127c6,_0x8f2729){return db[_0xe8dc('0x1a')]['update'](_0x158e57[_0xe8dc('0x1b')],{'raw':_0x158e57[_0xe8dc('0x1c')]?_0x158e57[_0xe8dc('0x1c')][_0xe8dc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x158e57[_0xe8dc('0x1c')]?_0x158e57['options']['where']||null:null,'attributes':_0x158e57[_0xe8dc('0x1c')]?_0x158e57[_0xe8dc('0x1c')][_0xe8dc('0x1e')]||null:null,'limit':_0x158e57[_0xe8dc('0x1c')]?_0x158e57['options'][_0xe8dc('0x1f')]||null:null})[_0xe8dc('0x11')](function(_0x13ac0){logger[_0xe8dc('0x12')](_0xe8dc('0x20'),_0x158e57);logger['debug']('UpdateSmsInteraction',_0x158e57,JSON[_0xe8dc('0x16')](_0x13ac0));_0x1127c6(_0x13ac0);})['catch'](function(_0x2e4cbb){logger[_0xe8dc('0x17')]('UpdateSmsInteraction',_0x2e4cbb['message'],_0x158e57);_0x8f2729(_0x4ff2a6[_0xe8dc('0x17')](0x1f4,_0x2e4cbb['message']));});});};exports[_0xe8dc('0x21')]=function(_0xab73f){return new Promise(function(_0x50c626,_0x50ad4b){return db[_0xe8dc('0x1a')][_0xe8dc('0x22')]({'where':_0xab73f['options']?_0xab73f[_0xe8dc('0x1c')][_0xe8dc('0x23')]||null:null})[_0xe8dc('0x11')](function(_0x2f19f7){if(_0x2f19f7){return _0x2f19f7[_0xe8dc('0x24')](_0xab73f[_0xe8dc('0x1b')][_0xe8dc('0x25')],_[_0xe8dc('0x26')](_0xab73f[_0xe8dc('0x1b')],[_0xe8dc('0x25'),'id'])||{});}})['spread'](function(_0xab49f){logger[_0xe8dc('0x12')](_0xe8dc('0x27'),_0xab73f);logger['debug'](_0xe8dc('0x27'),_0xab73f,JSON[_0xe8dc('0x16')](_0xab49f));_0x50c626(_0xab49f);})[_0xe8dc('0x19')](function(_0x1db5ea){logger[_0xe8dc('0x17')]('AddTags',_0x1db5ea[_0xe8dc('0x18')],_0xab73f);_0x50ad4b(_this['error'](0x1f4,_0x1db5ea[_0xe8dc('0x18')]));});});}; \ No newline at end of file +var _0xbb1a=['addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','debug','AddTagsToSmsInteraction'];(function(_0x1b7cb4,_0x2d6452){var _0x47cb0b=function(_0x521db1){while(--_0x521db1){_0x1b7cb4['push'](_0x1b7cb4['shift']());}};_0x47cb0b(++_0x2d6452);}(_0xbb1a,0x14c));var _0xabb1=function(_0xe9f236,_0x1e157c){_0xe9f236=_0xe9f236-0x0;var _0x353a2b=_0xbb1a[_0xe9f236];return _0x353a2b;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var moment=require(_0xabb1('0x2'));var BPromise=require(_0xabb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabb1('0x4'));var db=require(_0xabb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabb1('0x6'))(_0xabb1('0x7'));var config=require(_0xabb1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabb1('0x9')][_0xabb1('0xa')]({'port':0x232a});config[_0xabb1('0xb')]=_[_0xabb1('0xc')](config[_0xabb1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xabb1('0xd'))(new Redis(config[_0xabb1('0xb')]));require(_0xabb1('0xe'))[_0xabb1('0xf')](socket);function respondWithRpcPromise(_0x56bc59,_0xb6717e,_0x4020d2){return new BPromise(function(_0x34fe33,_0x5c883d){return client[_0xabb1('0x10')](_0x56bc59,_0x4020d2)[_0xabb1('0x11')](function(_0x1ddd01){logger[_0xabb1('0x12')](_0xabb1('0x13'),_0xb6717e,_0xabb1('0x14'));logger['debug'](_0xabb1('0x15'),_0xb6717e,_0xabb1('0x14'),JSON[_0xabb1('0x16')](_0x1ddd01));if(_0x1ddd01[_0xabb1('0x17')]){if(_0x1ddd01[_0xabb1('0x17')]['code']===0x1f4){logger[_0xabb1('0x17')](_0xabb1('0x13'),_0xb6717e,_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);return _0x5c883d(_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);}logger[_0xabb1('0x17')](_0xabb1('0x13'),_0xb6717e,_0x1ddd01[_0xabb1('0x17')]['message']);return _0x34fe33(_0x1ddd01[_0xabb1('0x17')][_0xabb1('0x18')]);}else{logger[_0xabb1('0x12')](_0xabb1('0x13'),_0xb6717e,'request\x20sent');_0x34fe33(_0x1ddd01[_0xabb1('0x19')][_0xabb1('0x18')]);}})[_0xabb1('0x1a')](function(_0x1bb74f){logger['error'](_0xabb1('0x13'),_0xb6717e,_0x1bb74f);_0x5c883d(_0x1bb74f);});});}exports[_0xabb1('0x1b')]=function(_0x937d2f){var _0xaaa8f5=this;return new Promise(function(_0x31bd8f,_0x3a3734){return db[_0xabb1('0x1c')][_0xabb1('0x1d')](_0x937d2f[_0xabb1('0x1e')],{'raw':_0x937d2f[_0xabb1('0x1f')]?_0x937d2f['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x937d2f[_0xabb1('0x1f')]?_0x937d2f[_0xabb1('0x1f')][_0xabb1('0x20')]||null:null,'attributes':_0x937d2f[_0xabb1('0x1f')]?_0x937d2f[_0xabb1('0x1f')][_0xabb1('0x21')]||null:null,'limit':_0x937d2f[_0xabb1('0x1f')]?_0x937d2f[_0xabb1('0x1f')][_0xabb1('0x22')]||null:null})[_0xabb1('0x11')](function(_0x2d130b){logger['info'](_0xabb1('0x1b'),_0x937d2f);logger[_0xabb1('0x23')](_0xabb1('0x1b'),_0x937d2f,JSON[_0xabb1('0x16')](_0x2d130b));_0x31bd8f(_0x2d130b);})[_0xabb1('0x1a')](function(_0x39cf3f){logger[_0xabb1('0x17')]('UpdateSmsInteraction',_0x39cf3f[_0xabb1('0x18')],_0x937d2f);_0x3a3734(_0xaaa8f5[_0xabb1('0x17')](0x1f4,_0x39cf3f[_0xabb1('0x18')]));});});};exports[_0xabb1('0x24')]=function(_0x23baa4){return new Promise(function(_0x9c4c4c,_0x5d2560){return db[_0xabb1('0x1c')]['find']({'where':_0x23baa4['options']?_0x23baa4[_0xabb1('0x1f')][_0xabb1('0x20')]||null:null})[_0xabb1('0x11')](function(_0x1aa8ea){if(_0x1aa8ea){return _0x1aa8ea[_0xabb1('0x25')](_0x23baa4['body'][_0xabb1('0x26')],_[_0xabb1('0x27')](_0x23baa4[_0xabb1('0x1e')],[_0xabb1('0x26'),'id'])||{});}})['spread'](function(_0x391a63){logger[_0xabb1('0x12')](_0xabb1('0x28'),_0x23baa4);logger[_0xabb1('0x23')](_0xabb1('0x28'),_0x23baa4,JSON[_0xabb1('0x16')](_0x391a63));_0x9c4c4c(_0x391a63);})[_0xabb1('0x1a')](function(_0x4e27a7){logger[_0xabb1('0x17')](_0xabb1('0x28'),_0x4e27a7[_0xabb1('0x18')],_0x23baa4);_0x5d2560(_this[_0xabb1('0x17')](0x1f4,_0x4e27a7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 9337885..756830e 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 _0x966a=['save','remove','update','emit','register','length','smsInteraction:','./smsInteraction.events'];(function(_0x2b3fb1,_0x2bc41f){var _0x55191e=function(_0x2c0e71){while(--_0x2c0e71){_0x2b3fb1['push'](_0x2b3fb1['shift']());}};_0x55191e(++_0x2bc41f);}(_0x966a,0x167));var _0xa966=function(_0x2de551,_0x19e90f){_0x2de551=_0x2de551-0x0;var _0x1511c8=_0x966a[_0x2de551];return _0x1511c8;};'use strict';var SmsInteractionEvents=require(_0xa966('0x0'));var events=[_0xa966('0x1'),_0xa966('0x2'),_0xa966('0x3')];function createListener(_0x48674f,_0x274613){return function(_0x11eb17){_0x274613[_0xa966('0x4')](_0x48674f,_0x11eb17);};}function removeListener(_0x316059,_0x28ad97){return function(){SmsInteractionEvents['removeListener'](_0x316059,_0x28ad97);};}exports[_0xa966('0x5')]=function(_0xbb9ad7){for(var _0x42b802=0x0,_0x59e1ba=events[_0xa966('0x6')];_0x42b802<_0x59e1ba;_0x42b802++){var _0x2b5ff6=events[_0x42b802];var _0x4fa31e=createListener(_0xa966('0x7')+_0x2b5ff6,_0xbb9ad7);SmsInteractionEvents['on'](_0x2b5ff6,_0x4fa31e);}}; \ No newline at end of file +var _0x1c8d=['smsInteraction:','save','remove','emit','register','length'];(function(_0x22494e,_0x388624){var _0x30f243=function(_0x318c2b){while(--_0x318c2b){_0x22494e['push'](_0x22494e['shift']());}};_0x30f243(++_0x388624);}(_0x1c8d,0xaf));var _0xd1c8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1c8d[_0x14add3];return _0x4a174f;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xd1c8('0x0'),_0xd1c8('0x1'),'update'];function createListener(_0x2a6186,_0x221735){return function(_0x1ccbe7){_0x221735[_0xd1c8('0x2')](_0x2a6186,_0x1ccbe7);};}function removeListener(_0xc2f81d,_0x47ec66){return function(){SmsInteractionEvents['removeListener'](_0xc2f81d,_0x47ec66);};}exports[_0xd1c8('0x3')]=function(_0xa23dfb){for(var _0x1e44ca=0x0,_0xa8cb87=events[_0xd1c8('0x4')];_0x1e44ca<_0xa8cb87;_0x1e44ca++){var _0x261197=events[_0x1e44ca];var _0x40b237=createListener(_0xd1c8('0x5')+_0x261197,_0xa23dfb);SmsInteractionEvents['on'](_0x261197,_0x40b237);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a3b922e..4ff65b1 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 _0xfde3=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x4bf941,_0x373801){var _0x4a58f1=function(_0x5f5825){while(--_0x5f5825){_0x4bf941['push'](_0x4bf941['shift']());}};_0x4a58f1(++_0x373801);}(_0xfde3,0x19f));var _0x3fde=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfde3[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x3fde('0x0'));var util=require(_0x3fde('0x1'));var path=require(_0x3fde('0x2'));var timeout=require(_0x3fde('0x3'));var express=require('express');var router=express[_0x3fde('0x4')]();var fs_extra=require(_0x3fde('0x5'));var auth=require(_0x3fde('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3fde('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x3fde('0x8')](),controller[_0x3fde('0x9')]);router['get'](_0x3fde('0xa'),auth[_0x3fde('0x8')](),controller[_0x3fde('0xb')]);router[_0x3fde('0xc')](_0x3fde('0xd'),auth[_0x3fde('0x8')](),controller[_0x3fde('0xe')]);router[_0x3fde('0xf')]('/',auth[_0x3fde('0x8')](),interaction[_0x3fde('0x10')](_0x3fde('0x11'),_0x3fde('0x12')),controller[_0x3fde('0x13')]);router[_0x3fde('0xf')](_0x3fde('0x14'),controller['status']);router[_0x3fde('0x15')]('/:id',auth[_0x3fde('0x8')](),controller[_0x3fde('0x16')]);router['put'](_0x3fde('0x17'),auth[_0x3fde('0x8')](),controller[_0x3fde('0x18')]);router['put'](_0x3fde('0x19'),auth[_0x3fde('0x8')](),controller[_0x3fde('0x1a')]);router[_0x3fde('0x1b')](_0x3fde('0xd'),auth['isAuthenticated'](),controller[_0x3fde('0x1c')]);module[_0x3fde('0x1d')]=router; \ No newline at end of file +var _0x4273=['/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','fs-extra','get','isAuthenticated','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update'];(function(_0xc4f39f,_0xa5296b){var _0x30d690=function(_0x48491d){while(--_0x48491d){_0xc4f39f['push'](_0xc4f39f['shift']());}};_0x30d690(++_0xa5296b);}(_0x4273,0xc5));var _0x3427=function(_0x3b88be,_0x488a39){_0x3b88be=_0x3b88be-0x0;var _0x5901c9=_0x4273[_0x3b88be];return _0x5901c9;};'use strict';var multer=require(_0x3427('0x0'));var util=require(_0x3427('0x1'));var path=require(_0x3427('0x2'));var timeout=require('connect-timeout');var express=require(_0x3427('0x3'));var router=express[_0x3427('0x4')]();var fs_extra=require(_0x3427('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x3427('0x6')]('/',auth[_0x3427('0x7')](),controller['index']);router[_0x3427('0x6')]('/describe',auth[_0x3427('0x7')](),controller[_0x3427('0x8')]);router['get'](_0x3427('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x3427('0xa')]('/',auth[_0x3427('0x7')](),interaction[_0x3427('0xb')](_0x3427('0xc'),_0x3427('0xd')),controller[_0x3427('0xe')]);router[_0x3427('0xa')](_0x3427('0xf'),controller[_0x3427('0x10')]);router[_0x3427('0x11')](_0x3427('0x9'),auth[_0x3427('0x7')](),controller[_0x3427('0x12')]);router[_0x3427('0x11')]('/:id/accept',auth[_0x3427('0x7')](),controller['accept']);router['put'](_0x3427('0x13'),auth[_0x3427('0x7')](),controller[_0x3427('0x14')]);router[_0x3427('0x15')]('/:id',auth[_0x3427('0x7')](),controller[_0x3427('0x16')]);module[_0x3427('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index dc76dba..84d6733 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 _0xd2bc=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x2c9ac7,_0x5b9648){var _0x39f90c=function(_0x4531a2){while(--_0x4531a2){_0x2c9ac7['push'](_0x2c9ac7['shift']());}};_0x39f90c(++_0x5b9648);}(_0xd2bc,0x1ec));var _0xcd2b=function(_0x247062,_0x27d5a5){_0x247062=_0x247062-0x0;var _0x14309b=_0xd2bc[_0x247062];return _0x14309b;};'use strict';var Sequelize=require(_0xcd2b('0x0'));module[_0xcd2b('0x1')]={'body':{'type':Sequelize[_0xcd2b('0x2')](_0xcd2b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcd2b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xcd2b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcd2b('0x6')]},'readAt':{'type':Sequelize[_0xcd2b('0x7')]},'secret':{'type':Sequelize[_0xcd2b('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcd2b('0x6')]},'providerResponse':{'type':Sequelize[_0xcd2b('0x2')]}}; \ No newline at end of file +var _0xf0c2=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x433439,_0x2483b5){var _0x4e8348=function(_0x1218d5){while(--_0x1218d5){_0x433439['push'](_0x433439['shift']());}};_0x4e8348(++_0x2483b5);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x15b5d4,_0x5556b7){_0x15b5d4=_0x15b5d4-0x0;var _0x4c713d=_0xf0c2[_0x15b5d4];return _0x4c713d;};'use strict';var Sequelize=require('sequelize');module[_0x2f0c('0x0')]={'body':{'type':Sequelize[_0x2f0c('0x1')](_0x2f0c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2f0c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2f0c('0x4')]('in',_0x2f0c('0x5')),'defaultValue':_0x2f0c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2f0c('0x6')](0xbe)},'phone':{'type':Sequelize[_0x2f0c('0x6')]},'readAt':{'type':Sequelize[_0x2f0c('0x7')]},'secret':{'type':Sequelize[_0x2f0c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x2f0c('0x6')]},'providerResponse':{'type':Sequelize[_0x2f0c('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 3d49628..9f4e91c 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 _0x26c2=['MessageSid','messageId','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','index','SmsMessage','rawAttributes','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','format','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','ContactId','QueryTypes','contact','User','agent','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','RejectMessage','rejectMessage','sequelize','Sequelize','SELECT','fullname','email','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio'];(function(_0x25e607,_0x12ebef){var _0x2d355f=function(_0x4cf6dd){while(--_0x4cf6dd){_0x25e607['push'](_0x25e607['shift']());}};_0x2d355f(++_0x12ebef);}(_0x26c2,0x1d6));var _0x226c=function(_0x162a3a,_0x31176f){_0x162a3a=_0x162a3a-0x0;var _0x357d5e=_0x26c2[_0x162a3a];return _0x357d5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x226c('0x0'));var zipdir=require(_0x226c('0x1'));var jsonpatch=require(_0x226c('0x2'));var rp=require(_0x226c('0x3'));var moment=require('moment');var BPromise=require(_0x226c('0x4'));var Mustache=require('mustache');var util=require(_0x226c('0x5'));var path=require(_0x226c('0x6'));var sox=require(_0x226c('0x7'));var csv=require(_0x226c('0x8'));var ejs=require(_0x226c('0x9'));var fs=require('fs');var fs_extra=require(_0x226c('0xa'));var _=require(_0x226c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x226c('0xc'));var toCsv=require(_0x226c('0x8'));var querystring=require('querystring');var Papa=require(_0x226c('0xd'));var Redis=require(_0x226c('0xe'));var authService=require(_0x226c('0xf'));var qs=require(_0x226c('0x10'));var as=require(_0x226c('0x11'));var hardwareService=require(_0x226c('0x12'));var logger=require(_0x226c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x226c('0x14'));var licenseUtil=require(_0x226c('0x15'));var db=require(_0x226c('0x16'))['db'];config[_0x226c('0x17')]=_['defaults'](config['redis'],{'host':_0x226c('0x18'),'port':0x18eb});var socket=require(_0x226c('0x19'))(new Redis(config[_0x226c('0x17')]));require(_0x226c('0x1a'))[_0x226c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x226c('0x1c')][_0x226c('0x1d')]({'port':0x232c});var client9002=jayson[_0x226c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19d62d,_0x34489a,_0x2e9c5f,_0x1421ce){return new BPromise(function(_0x3b6d9a,_0x6bbc58){var _0x35d7d7=_0x1421ce||client;return _0x35d7d7[_0x226c('0x1e')](_0x19d62d,_0x2e9c5f)[_0x226c('0x1f')](function(_0x181529){logger[_0x226c('0x20')](_0x226c('0x21'),_0x34489a,_0x226c('0x22'));logger['debug'](_0x226c('0x23'),_0x34489a,_0x226c('0x22'),JSON[_0x226c('0x24')](_0x181529));if(_0x181529['error']){if(_0x181529[_0x226c('0x25')][_0x226c('0x26')]===0x1f4){logger['error'](_0x226c('0x21'),_0x34489a,_0x181529[_0x226c('0x25')][_0x226c('0x27')]);return _0x6bbc58(_0x181529[_0x226c('0x25')][_0x226c('0x27')]);}logger[_0x226c('0x25')]('SmsMessage,\x20%s,\x20%s',_0x34489a,_0x181529[_0x226c('0x25')][_0x226c('0x27')]);return _0x3b6d9a(_0x181529[_0x226c('0x25')][_0x226c('0x27')]);}else{logger[_0x226c('0x20')](_0x226c('0x21'),_0x34489a,'request\x20sent');_0x3b6d9a(_0x181529[_0x226c('0x28')][_0x226c('0x27')]);}})[_0x226c('0x29')](function(_0x4a371f){logger[_0x226c('0x25')]('SmsMessage,\x20%s,\x20%s',_0x34489a,_0x4a371f);_0x6bbc58(_0x4a371f);});});}function respondWithStatusCode(_0x2a1967,_0x1d5259){_0x1d5259=_0x1d5259||0xcc;return function(_0x1a9454){if(_0x1a9454){return _0x2a1967[_0x226c('0x2a')](_0x1d5259);}return _0x2a1967['status'](_0x1d5259)['end']();};}function respondWithResult(_0x513c2e,_0x57e4a5){_0x57e4a5=_0x57e4a5||0xc8;return function(_0x52d2aa){if(_0x52d2aa){return _0x513c2e[_0x226c('0x2b')](_0x57e4a5)[_0x226c('0x2c')](_0x52d2aa);}};}function respondWithFilteredResult(_0x58b2c9,_0x8c67bc){return function(_0x92415b){if(_0x92415b){var _0x1bec1a=typeof _0x8c67bc[_0x226c('0x2d')]===_0x226c('0x2e')&&typeof _0x8c67bc['limit']===_0x226c('0x2e');var _0x164632=_0x92415b['count'];var _0x260bb5=_0x1bec1a?0x0:_0x8c67bc[_0x226c('0x2d')];var _0x3632ae=_0x1bec1a?_0x92415b['count']:_0x8c67bc[_0x226c('0x2d')]+_0x8c67bc[_0x226c('0x2f')];var _0x3d6b4e;if(_0x3632ae>=_0x164632){_0x3632ae=_0x164632;_0x3d6b4e=0xc8;}else{_0x3d6b4e=0xce;}_0x58b2c9[_0x226c('0x2b')](_0x3d6b4e);return _0x58b2c9[_0x226c('0x30')](_0x226c('0x31'),_0x260bb5+'-'+_0x3632ae+'/'+_0x164632)[_0x226c('0x2c')](_0x92415b);}return null;};}function patchUpdates(_0x5d7c95){return function(_0x421af9){try{jsonpatch[_0x226c('0x32')](_0x421af9,_0x5d7c95,!![]);}catch(_0x1d35f6){return BPromise['reject'](_0x1d35f6);}return _0x421af9[_0x226c('0x33')]();};}function saveUpdates(_0x223259,_0x18d09c){return function(_0x22c26b){if(_0x22c26b){return _0x22c26b[_0x226c('0x34')](_0x223259)[_0x226c('0x1f')](function(_0x193261){return _0x193261;});}return null;};}function removeEntity(_0x938cf2,_0x5a4ee5){return function(_0x75e30d){if(_0x75e30d){return _0x75e30d[_0x226c('0x35')]()[_0x226c('0x1f')](function(){_0x938cf2[_0x226c('0x2b')](0xcc)[_0x226c('0x36')]();});}};}function handleEntityNotFound(_0x496c9c,_0x49ccb4){return function(_0x5eb654){if(!_0x5eb654){_0x496c9c[_0x226c('0x2a')](0x194);}return _0x5eb654;};}function handleError(_0x1456e3,_0x5ba5bf){_0x5ba5bf=_0x5ba5bf||0x1f4;return function(_0x5daf69){logger[_0x226c('0x25')](_0x5daf69[_0x226c('0x37')]);if(_0x5daf69[_0x226c('0x38')]){delete _0x5daf69['name'];}_0x1456e3[_0x226c('0x2b')](_0x5ba5bf)['send'](_0x5daf69);};}exports[_0x226c('0x39')]=function(_0x596f14,_0xbcaf60){var _0x6e9799={},_0x3d6cb3={},_0x49876c={'count':0x0,'rows':[]};var _0x23fbef=_['map'](db[_0x226c('0x3a')][_0x226c('0x3b')],function(_0x23986e){return{'name':_0x23986e['fieldName'],'type':_0x23986e[_0x226c('0x3c')]['key']};});_0x3d6cb3[_0x226c('0x3d')]=_[_0x226c('0x3e')](_0x23fbef,_0x226c('0x38'));_0x3d6cb3[_0x226c('0x3f')]=_[_0x226c('0x40')](_0x596f14['query']);_0x3d6cb3[_0x226c('0x41')]=_['intersection'](_0x3d6cb3[_0x226c('0x3d')],_0x3d6cb3[_0x226c('0x3f')]);_0x6e9799[_0x226c('0x42')]=_[_0x226c('0x43')](_0x3d6cb3['model'],qs['fields'](_0x596f14['query'][_0x226c('0x44')]));_0x6e9799['attributes']=_0x6e9799['attributes'][_0x226c('0x45')]?_0x6e9799[_0x226c('0x42')]:_0x3d6cb3[_0x226c('0x3d')];if(!_0x596f14[_0x226c('0x3f')][_0x226c('0x46')](_0x226c('0x47'))){_0x6e9799[_0x226c('0x2f')]=qs['limit'](_0x596f14[_0x226c('0x3f')][_0x226c('0x2f')]);_0x6e9799[_0x226c('0x2d')]=qs['offset'](_0x596f14[_0x226c('0x3f')][_0x226c('0x2d')]);}_0x6e9799[_0x226c('0x48')]=qs[_0x226c('0x49')](_0x596f14[_0x226c('0x3f')][_0x226c('0x49')]);_0x6e9799['where']=qs[_0x226c('0x41')](_[_0x226c('0x4a')](_0x596f14[_0x226c('0x3f')],_0x3d6cb3[_0x226c('0x41')]),_0x23fbef);if(_0x596f14[_0x226c('0x3f')][_0x226c('0x4b')]){_0x6e9799[_0x226c('0x4c')]=_['merge'](_0x6e9799['where'],{'$or':_[_0x226c('0x3e')](_0x23fbef,function(_0xe03086){if(_0xe03086[_0x226c('0x3c')]!=='VIRTUAL'){var _0x5149ac={};_0x5149ac[_0xe03086[_0x226c('0x38')]]={'$like':'%'+_0x596f14[_0x226c('0x3f')][_0x226c('0x4b')]+'%'};return _0x5149ac;}})});}_0x6e9799=_[_0x226c('0x4d')]({},_0x6e9799,_0x596f14[_0x226c('0x4e')]);var _0x1318d3={'where':_0x6e9799[_0x226c('0x4c')]};return db[_0x226c('0x3a')][_0x226c('0x4f')](_0x1318d3)[_0x226c('0x1f')](function(_0x147380){_0x49876c['count']=_0x147380;if(_0x596f14['query'][_0x226c('0x50')]){_0x6e9799[_0x226c('0x51')]=[{'all':!![]}];}return db[_0x226c('0x3a')][_0x226c('0x52')](_0x6e9799);})[_0x226c('0x1f')](function(_0x1508be){_0x49876c[_0x226c('0x53')]=_0x1508be;return _0x49876c;})[_0x226c('0x1f')](respondWithFilteredResult(_0xbcaf60,_0x6e9799))[_0x226c('0x29')](handleError(_0xbcaf60,null));};exports[_0x226c('0x54')]=function(_0xf6066d,_0x3abee6){var _0x139901={'raw':!![],'where':{'id':_0xf6066d[_0x226c('0x55')]['id']}},_0xa52a81={};_0xa52a81['model']=_['keys'](db[_0x226c('0x3a')][_0x226c('0x3b')]);_0xa52a81['query']=_[_0x226c('0x40')](_0xf6066d[_0x226c('0x3f')]);_0xa52a81[_0x226c('0x41')]=_['intersection'](_0xa52a81['model'],_0xa52a81[_0x226c('0x3f')]);_0x139901['attributes']=_[_0x226c('0x43')](_0xa52a81[_0x226c('0x3d')],qs['fields'](_0xf6066d[_0x226c('0x3f')][_0x226c('0x44')]));_0x139901['attributes']=_0x139901[_0x226c('0x42')][_0x226c('0x45')]?_0x139901[_0x226c('0x42')]:_0xa52a81['model'];if(_0xf6066d['query'][_0x226c('0x50')]){_0x139901[_0x226c('0x51')]=[{'all':!![]}];}_0x139901=_['merge']({},_0x139901,_0xf6066d['options']);return db[_0x226c('0x3a')][_0x226c('0x56')](_0x139901)['then'](handleEntityNotFound(_0x3abee6,null))[_0x226c('0x1f')](respondWithResult(_0x3abee6,null))[_0x226c('0x29')](handleError(_0x3abee6,null));};exports['create']=function(_0x3b7340,_0x24dab1){return db['SmsMessage'][_0x226c('0x57')](_0x3b7340[_0x226c('0x58')],{})[_0x226c('0x1f')](respondWithResult(_0x24dab1,0xc9))[_0x226c('0x29')](handleError(_0x24dab1,null));};exports[_0x226c('0x34')]=function(_0x471b46,_0x14421f){if(_0x471b46[_0x226c('0x58')]['id']){delete _0x471b46[_0x226c('0x58')]['id'];}return db[_0x226c('0x3a')][_0x226c('0x56')]({'where':{'id':_0x471b46[_0x226c('0x55')]['id']}})[_0x226c('0x1f')](handleEntityNotFound(_0x14421f,null))['then'](saveUpdates(_0x471b46[_0x226c('0x58')],null))[_0x226c('0x1f')](respondWithResult(_0x14421f,null))[_0x226c('0x29')](handleError(_0x14421f,null));};exports['destroy']=function(_0x38f066,_0x3639d9){return db['SmsMessage'][_0x226c('0x56')]({'where':{'id':_0x38f066[_0x226c('0x55')]['id']}})[_0x226c('0x1f')](handleEntityNotFound(_0x3639d9,null))['then'](removeEntity(_0x3639d9,null))[_0x226c('0x29')](handleError(_0x3639d9,null));};exports['describe']=function(_0x52c46d,_0x4d41cc){return db[_0x226c('0x3a')][_0x226c('0x59')]()['then'](respondWithResult(_0x4d41cc,null))[_0x226c('0x29')](handleError(_0x4d41cc,null));};var interaction_log=require(_0x226c('0x13'))(_0x226c('0x5a'));exports[_0x226c('0x5b')]=function(_0x1e68ae,_0x9c1231,_0x5b81bc){var _0x335860={'agent':{},'channel':_0x226c('0x5c')};if(_0x1e68ae[_0x226c('0x58')]['id']){delete _0x1e68ae[_0x226c('0x58')]['id'];}_0x1e68ae['body'][_0x226c('0x5d')]=!![];_0x1e68ae[_0x226c('0x58')][_0x226c('0x5e')]=moment()['format'](_0x226c('0x5f'));_0x1e68ae[_0x226c('0x58')][_0x226c('0x60')]=_0x1e68ae[_0x226c('0x58')][_0x226c('0x60')]||_0x1e68ae[_0x226c('0x61')]['id'];_0x335860['agent']['id']=_0x1e68ae[_0x226c('0x58')]['UserId'];return db[_0x226c('0x3a')][_0x226c('0x56')]({'where':{'id':_0x1e68ae['params']['id'],'UserId':null}})[_0x226c('0x1f')](handleEntityNotFound(_0x9c1231,null))[_0x226c('0x1f')](saveUpdates(_0x1e68ae['body'],null))['then'](function(_0x134744){if(_0x134744){_0x335860[_0x226c('0x27')]=_0x134744[_0x226c('0x62')]({'plain':!![]});return db[_0x226c('0x63')]['find']({'where':{'id':_0x134744[_0x226c('0x64')]}});}return null;})[_0x226c('0x1f')](handleEntityNotFound(_0x9c1231,null))[_0x226c('0x1f')](function(_0x64998){if(_0x64998){return _0x64998['update']({'UserId':_0x1e68ae['body'][_0x226c('0x60')],'read1stAt':_[_0x226c('0x65')](_0x64998[_0x226c('0x66')])?moment()[_0x226c('0x67')](_0x226c('0x5f')):undefined});}return null;})[_0x226c('0x1f')](function(_0xfec795){if(_0xfec795){_0x335860[_0x226c('0x68')]=_0xfec795[_0x226c('0x62')]({'plain':!![]});interaction_log[_0x226c('0x20')](_0x226c('0x69'),_0x1e68ae[_0x226c('0x61')]['id'],_0x1e68ae[_0x226c('0x61')][_0x226c('0x38')],_0x1e68ae[_0x226c('0x61')][_0x226c('0x6a')],_0x335860[_0x226c('0x68')]['id'],_0x1e68ae['body']?JSON['stringify'](_0x1e68ae[_0x226c('0x58')]):_0x226c('0x6b'));return respondWithRpcPromise(_0x226c('0x6c'),_0x226c('0x6d'),_0x335860);}return null;})[_0x226c('0x1f')](function(_0x5dfcbb){var _0x2d784f=_0x226c('0x6e')+_0x5dfcbb['message'][_0x226c('0x6f')];return db['sequelize'][_0x226c('0x3f')](_0x2d784f,{'type':db['Sequelize'][_0x226c('0x70')]['SELECT'],'raw':!![]})[_0x226c('0x1f')](function(_0x5a34ce){return _0x5a34ce;});})[_0x226c('0x1f')](function(_0x568ac5){if(_0x568ac5){_0x335860[_0x226c('0x27')][_0x226c('0x71')]=_0x568ac5[0x0];if(!_0x1e68ae[_0x226c('0x58')][_0x226c('0x60')])return;return db[_0x226c('0x72')][_0x226c('0x56')]({'where':{'id':_0x1e68ae[_0x226c('0x58')][_0x226c('0x60')],'role':_0x226c('0x73')},'attributes':['id','name','fullname','email',_0x226c('0x74')],'raw':!![]});}return null;})[_0x226c('0x1f')](function(_0x286119){if(!_0x286119)return null;_0x335860['message'][_0x226c('0x73')]=_0x286119;return _0x335860;})[_0x226c('0x1f')](function(_0x3c376a){if(_0x3c376a){if(_0x1e68ae[_0x226c('0x58')][_0x226c('0x75')]){_0x335860[_0x226c('0x27')][_0x226c('0x76')]=util[_0x226c('0x67')](_0x226c('0x77'),_0x1e68ae['user'][_0x226c('0x38')]);_0x335860[_0x226c('0x27')][_0x226c('0x78')]=_0x335860[_0x226c('0x78')];_0x335860[_0x226c('0x27')][_0x226c('0x79')]=_0x335860['channel'];_0x335860[_0x226c('0x27')][_0x226c('0x7a')]='accept';return respondWithRpcPromise(_0x226c('0x7b'),_0x226c('0x7b'),{'event':'acceptmessage','message':_0x335860['message']},client9002)[_0x226c('0x1f')](function(){return _0x335860;});}return _0x335860;}return null;})[_0x226c('0x1f')](respondWithResult(_0x9c1231,null))[_0x226c('0x29')](handleError(_0x9c1231,null));};var interaction_log=require(_0x226c('0x13'))('sms-interactions');exports[_0x226c('0x7c')]=function(_0x5bf465,_0x364ed1,_0x1042b2){var _0x6de9c3={'agent':{},'channel':_0x226c('0x5c')};if(_0x5bf465['body']['id']){delete _0x5bf465[_0x226c('0x58')]['id'];}_0x5bf465[_0x226c('0x58')]['UserId']=_0x5bf465[_0x226c('0x58')][_0x226c('0x60')]||_0x5bf465[_0x226c('0x61')]['id'];_0x6de9c3[_0x226c('0x73')]['id']=_0x5bf465[_0x226c('0x58')][_0x226c('0x60')];return db[_0x226c('0x3a')][_0x226c('0x56')]({'where':{'id':_0x5bf465[_0x226c('0x55')]['id'],'UserId':null}})[_0x226c('0x1f')](handleEntityNotFound(_0x364ed1,null))[_0x226c('0x1f')](function(_0x54c668){if(_0x54c668){_0x6de9c3[_0x226c('0x27')]=_0x54c668[_0x226c('0x62')]({'plain':!![]});return db[_0x226c('0x63')][_0x226c('0x56')]({'where':{'id':_0x54c668[_0x226c('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x364ed1,null))[_0x226c('0x1f')](function(_0x426408){if(_0x426408){_0x6de9c3['interaction']=_0x426408[_0x226c('0x62')]({'plain':!![]});interaction_log[_0x226c('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5bf465[_0x226c('0x61')]['id'],_0x5bf465[_0x226c('0x61')][_0x226c('0x38')],_0x5bf465[_0x226c('0x61')]['role'],_0x6de9c3[_0x226c('0x68')]['id'],_0x5bf465['body']?JSON[_0x226c('0x24')](_0x5bf465[_0x226c('0x58')]):_0x226c('0x6b'));return respondWithRpcPromise(_0x226c('0x7d'),_0x226c('0x7e'),_0x6de9c3);}return null;})[_0x226c('0x1f')](function(_0x48f7ae){var _0x4e63f3=_0x226c('0x6e')+_0x48f7ae[_0x226c('0x27')][_0x226c('0x6f')];return db[_0x226c('0x7f')][_0x226c('0x3f')](_0x4e63f3,{'type':db[_0x226c('0x80')][_0x226c('0x70')][_0x226c('0x81')],'raw':!![]})[_0x226c('0x1f')](function(_0x4d2674){return _0x4d2674;});})[_0x226c('0x1f')](function(_0x4bc3fd){if(_0x4bc3fd){_0x6de9c3[_0x226c('0x27')]['contact']=_0x4bc3fd[0x0];if(!_0x5bf465[_0x226c('0x58')][_0x226c('0x60')])return;return db[_0x226c('0x72')][_0x226c('0x56')]({'where':{'id':_0x5bf465[_0x226c('0x58')][_0x226c('0x60')],'role':_0x226c('0x73')},'attributes':['id',_0x226c('0x38'),_0x226c('0x82'),_0x226c('0x83'),_0x226c('0x74')],'raw':!![]});}return null;})[_0x226c('0x1f')](function(_0x5ccead){if(!_0x5ccead)return null;_0x6de9c3[_0x226c('0x27')][_0x226c('0x73')]=_0x5ccead;return _0x6de9c3;})[_0x226c('0x1f')](function(_0x540767){if(_0x540767){_0x540767['message']['interface']=util[_0x226c('0x67')](_0x226c('0x77'),_0x5bf465[_0x226c('0x61')][_0x226c('0x38')]);_0x540767[_0x226c('0x27')][_0x226c('0x78')]=_0x6de9c3[_0x226c('0x78')];_0x540767[_0x226c('0x27')][_0x226c('0x79')]=_0x6de9c3[_0x226c('0x78')];_0x540767['message'][_0x226c('0x7a')]=_0x226c('0x7c');respondWithRpcPromise('EventManager','EventManager',{'event':_0x226c('0x84'),'message':_0x540767['message']},client9002);return _0x6de9c3;}return null;})[_0x226c('0x1f')](respondWithResult(_0x364ed1,null))[_0x226c('0x29')](handleError(_0x364ed1,null));};exports[_0x226c('0x2b')]=function(_0x783c56,_0x527222,_0x7dafdb){if(_0x783c56[_0x226c('0x58')]['id']){delete _0x783c56[_0x226c('0x58')]['id'];}var _0xe7d9a8;return db['SmsMessage'][_0x226c('0x56')]({'where':{'id':_0x783c56[_0x226c('0x55')]['id']}})['then'](handleEntityNotFound(_0x527222,null))[_0x226c('0x1f')](function(_0x4e4072){if(_0x4e4072){_0xe7d9a8=_0x4e4072;return db[_0x226c('0x85')][_0x226c('0x56')]({'where':{'id':_0x4e4072[_0x226c('0x86')]}});}})[_0x226c('0x1f')](handleEntityNotFound(_0x527222,null))['then'](function(_0x5c6b19){if(_0x5c6b19){logger['debug'](_0x226c('0x23'),'status',_0x226c('0x87'),_0x5c6b19[_0x226c('0x3c')],util[_0x226c('0x88')](_0x783c56[_0x226c('0x58')],{'showHidden':![],'depth':null}));switch(_0x5c6b19['type']){case _0x226c('0x89'):if(_0x783c56[_0x226c('0x58')][_0x226c('0x8a')]&&_0x783c56['body'][_0x226c('0x8a')]===_0xe7d9a8[_0x226c('0x8b')]){return _0xe7d9a8[_0x226c('0x34')]({'read':!![]});}else{logger[_0x226c('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x226c('0x2b'),_0x226c('0x89'),util[_0x226c('0x88')](_0x783c56[_0x226c('0x58')],{'showHidden':![],'depth':null}));}break;case _0x226c('0x8c'):if(_0x783c56[_0x226c('0x58')][_0x226c('0x8d')]&&_0x783c56[_0x226c('0x58')][_0x226c('0x8d')]===_0xe7d9a8[_0x226c('0x8b')]&&_[_0x226c('0x8e')]([_0x226c('0x8f'),_0x226c('0x90')],_0x783c56['body'][_0x226c('0x91')])>=0x0){return _0xe7d9a8['update']({'read':!![]});}else{logger['error'](_0x226c('0x92'),_0x226c('0x2b'),_0x226c('0x93'),util[_0x226c('0x88')](_0x783c56[_0x226c('0x58')],{'showHidden':![],'depth':null}));}break;case _0x226c('0x94'):var _0x5a6f02=_0x783c56[_0x226c('0x58')][_0x226c('0x95')][0x0];if(_0x5a6f02[_0x226c('0x2b')][_0x226c('0x96')]===_0x226c('0x97')){return _0xe7d9a8[_0x226c('0x34')]({'read':!![]});}else{logger[_0x226c('0x25')](_0x226c('0x92'),'status',_0x226c('0x94'),util[_0x226c('0x88')](_0x783c56[_0x226c('0x58')],{'showHidden':![],'depth':null}));}break;}return _0xe7d9a8;}})[_0x226c('0x1f')](respondWithResult(_0x527222,null))[_0x226c('0x29')](handleError(_0x527222,null));}; \ No newline at end of file +var _0xf7d9=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','message','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','catch','show','keys','fields','includeAll','include','find','create','body','params','describe','sms-interactions','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','format','channel','motionChannel','event','accept','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','fullname','SIP/%s','rejectmessage','SmsAccount','debug','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs'];(function(_0x5445f5,_0x46fffb){var _0x20dcdf=function(_0x3a4f0f){while(--_0x3a4f0f){_0x5445f5['push'](_0x5445f5['shift']());}};_0x20dcdf(++_0x46fffb);}(_0xf7d9,0x122));var _0x9f7d=function(_0x5d1813,_0x546944){_0x5d1813=_0x5d1813-0x0;var _0x4f6c64=_0xf7d9[_0x5d1813];return _0x4f6c64;};'use strict';var emlformat=require(_0x9f7d('0x0'));var rimraf=require(_0x9f7d('0x1'));var zipdir=require(_0x9f7d('0x2'));var jsonpatch=require(_0x9f7d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9f7d('0x4'));var Mustache=require('mustache');var util=require(_0x9f7d('0x5'));var path=require(_0x9f7d('0x6'));var sox=require(_0x9f7d('0x7'));var csv=require(_0x9f7d('0x8'));var ejs=require(_0x9f7d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9f7d('0xa'));var crypto=require(_0x9f7d('0xb'));var jsforce=require(_0x9f7d('0xc'));var deskjs=require(_0x9f7d('0xd'));var toCsv=require(_0x9f7d('0x8'));var querystring=require(_0x9f7d('0xe'));var Papa=require('papaparse');var Redis=require(_0x9f7d('0xf'));var authService=require(_0x9f7d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9f7d('0x11'));var hardwareService=require(_0x9f7d('0x12'));var logger=require(_0x9f7d('0x13'))('api');var utils=require(_0x9f7d('0x14'));var config=require(_0x9f7d('0x15'));var licenseUtil=require(_0x9f7d('0x16'));var db=require(_0x9f7d('0x17'))['db'];config[_0x9f7d('0x18')]=_[_0x9f7d('0x19')](config['redis'],{'host':_0x9f7d('0x1a'),'port':0x18eb});var socket=require(_0x9f7d('0x1b'))(new Redis(config[_0x9f7d('0x18')]));require(_0x9f7d('0x1c'))['register'](socket);var jayson=require(_0x9f7d('0x1d'));var client=jayson[_0x9f7d('0x1e')][_0x9f7d('0x1f')]({'port':0x232c});var client9002=jayson[_0x9f7d('0x1e')][_0x9f7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2b1ad4,_0xd3449d,_0x513cf5,_0x587718){return new BPromise(function(_0x402609,_0x39cdb1){var _0x4cbe0b=_0x587718||client;return _0x4cbe0b[_0x9f7d('0x20')](_0x2b1ad4,_0x513cf5)[_0x9f7d('0x21')](function(_0x11d958){logger[_0x9f7d('0x22')](_0x9f7d('0x23'),_0xd3449d,_0x9f7d('0x24'));logger['debug'](_0x9f7d('0x25'),_0xd3449d,_0x9f7d('0x24'),JSON['stringify'](_0x11d958));if(_0x11d958['error']){if(_0x11d958['error'][_0x9f7d('0x26')]===0x1f4){logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x11d958['error']['message']);return _0x39cdb1(_0x11d958[_0x9f7d('0x27')][_0x9f7d('0x28')]);}logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x11d958[_0x9f7d('0x27')][_0x9f7d('0x28')]);return _0x402609(_0x11d958['error'][_0x9f7d('0x28')]);}else{logger['info'](_0x9f7d('0x23'),_0xd3449d,'request\x20sent');_0x402609(_0x11d958['result'][_0x9f7d('0x28')]);}})['catch'](function(_0x4bcfd0){logger[_0x9f7d('0x27')](_0x9f7d('0x23'),_0xd3449d,_0x4bcfd0);_0x39cdb1(_0x4bcfd0);});});}function respondWithStatusCode(_0xe5836d,_0x3600d4){_0x3600d4=_0x3600d4||0xcc;return function(_0x59191e){if(_0x59191e){return _0xe5836d['sendStatus'](_0x3600d4);}return _0xe5836d[_0x9f7d('0x29')](_0x3600d4)[_0x9f7d('0x2a')]();};}function respondWithResult(_0x21f0fd,_0x290ef9){_0x290ef9=_0x290ef9||0xc8;return function(_0x4f3550){if(_0x4f3550){return _0x21f0fd[_0x9f7d('0x29')](_0x290ef9)[_0x9f7d('0x2b')](_0x4f3550);}};}function respondWithFilteredResult(_0x8c6833,_0x2e61a3){return function(_0x4673bc){if(_0x4673bc){var _0x120169=typeof _0x2e61a3[_0x9f7d('0x2c')]===_0x9f7d('0x2d')&&typeof _0x2e61a3['limit']==='undefined';var _0x15fa20=_0x4673bc[_0x9f7d('0x2e')];var _0x1ca5cb=_0x120169?0x0:_0x2e61a3[_0x9f7d('0x2c')];var _0x1c9116=_0x120169?_0x4673bc[_0x9f7d('0x2e')]:_0x2e61a3[_0x9f7d('0x2c')]+_0x2e61a3[_0x9f7d('0x2f')];var _0x4c024f;if(_0x1c9116>=_0x15fa20){_0x1c9116=_0x15fa20;_0x4c024f=0xc8;}else{_0x4c024f=0xce;}_0x8c6833[_0x9f7d('0x29')](_0x4c024f);return _0x8c6833[_0x9f7d('0x30')](_0x9f7d('0x31'),_0x1ca5cb+'-'+_0x1c9116+'/'+_0x15fa20)['json'](_0x4673bc);}return null;};}function patchUpdates(_0x2c27fd){return function(_0x34170e){try{jsonpatch[_0x9f7d('0x32')](_0x34170e,_0x2c27fd,!![]);}catch(_0x5a37e3){return BPromise[_0x9f7d('0x33')](_0x5a37e3);}return _0x34170e[_0x9f7d('0x34')]();};}function saveUpdates(_0x5ae101,_0x14fcf0){return function(_0x3fe022){if(_0x3fe022){return _0x3fe022[_0x9f7d('0x35')](_0x5ae101)['then'](function(_0x54ddf7){return _0x54ddf7;});}return null;};}function removeEntity(_0x49bb98,_0xf9e13a){return function(_0x35b845){if(_0x35b845){return _0x35b845[_0x9f7d('0x36')]()[_0x9f7d('0x21')](function(){_0x49bb98[_0x9f7d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5d1b,_0x578222){return function(_0x4b52d3){if(!_0x4b52d3){_0x4b5d1b['sendStatus'](0x194);}return _0x4b52d3;};}function handleError(_0x33c070,_0x2dd9ff){_0x2dd9ff=_0x2dd9ff||0x1f4;return function(_0x133c4c){logger[_0x9f7d('0x27')](_0x133c4c['stack']);if(_0x133c4c[_0x9f7d('0x37')]){delete _0x133c4c['name'];}_0x33c070[_0x9f7d('0x29')](_0x2dd9ff)[_0x9f7d('0x38')](_0x133c4c);};}exports[_0x9f7d('0x39')]=function(_0x3ef0ba,_0x4bb270){var _0x328ac9={},_0x250fe5={},_0x46009c={'count':0x0,'rows':[]};var _0x8fee1c=_['map'](db[_0x9f7d('0x3a')][_0x9f7d('0x3b')],function(_0xb6167a){return{'name':_0xb6167a[_0x9f7d('0x3c')],'type':_0xb6167a[_0x9f7d('0x3d')][_0x9f7d('0x3e')]};});_0x250fe5[_0x9f7d('0x3f')]=_[_0x9f7d('0x40')](_0x8fee1c,_0x9f7d('0x37'));_0x250fe5[_0x9f7d('0x41')]=_['keys'](_0x3ef0ba[_0x9f7d('0x41')]);_0x250fe5['filters']=_['intersection'](_0x250fe5[_0x9f7d('0x3f')],_0x250fe5[_0x9f7d('0x41')]);_0x328ac9['attributes']=_[_0x9f7d('0x42')](_0x250fe5[_0x9f7d('0x3f')],qs['fields'](_0x3ef0ba[_0x9f7d('0x41')]['fields']));_0x328ac9['attributes']=_0x328ac9[_0x9f7d('0x43')][_0x9f7d('0x44')]?_0x328ac9[_0x9f7d('0x43')]:_0x250fe5[_0x9f7d('0x3f')];if(!_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x45')]('nolimit')){_0x328ac9[_0x9f7d('0x2f')]=qs[_0x9f7d('0x2f')](_0x3ef0ba[_0x9f7d('0x41')]['limit']);_0x328ac9['offset']=qs[_0x9f7d('0x2c')](_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x2c')]);}_0x328ac9[_0x9f7d('0x46')]=qs[_0x9f7d('0x47')](_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x47')]);_0x328ac9[_0x9f7d('0x48')]=qs['filters'](_[_0x9f7d('0x49')](_0x3ef0ba[_0x9f7d('0x41')],_0x250fe5[_0x9f7d('0x4a')]),_0x8fee1c);if(_0x3ef0ba[_0x9f7d('0x41')][_0x9f7d('0x4b')]){_0x328ac9[_0x9f7d('0x48')]=_[_0x9f7d('0x4c')](_0x328ac9['where'],{'$or':_[_0x9f7d('0x40')](_0x8fee1c,function(_0x590204){if(_0x590204[_0x9f7d('0x3d')]!==_0x9f7d('0x4d')){var _0x18d346={};_0x18d346[_0x590204['name']]={'$like':'%'+_0x3ef0ba[_0x9f7d('0x41')]['filter']+'%'};return _0x18d346;}})});}_0x328ac9=_[_0x9f7d('0x4c')]({},_0x328ac9,_0x3ef0ba[_0x9f7d('0x4e')]);var _0x2350a0={'where':_0x328ac9[_0x9f7d('0x48')]};return db[_0x9f7d('0x3a')][_0x9f7d('0x2e')](_0x2350a0)['then'](function(_0x5e0bb6){_0x46009c[_0x9f7d('0x2e')]=_0x5e0bb6;if(_0x3ef0ba[_0x9f7d('0x41')]['includeAll']){_0x328ac9['include']=[{'all':!![]}];}return db[_0x9f7d('0x3a')][_0x9f7d('0x4f')](_0x328ac9);})['then'](function(_0x3fb8ba){_0x46009c['rows']=_0x3fb8ba;return _0x46009c;})[_0x9f7d('0x21')](respondWithFilteredResult(_0x4bb270,_0x328ac9))[_0x9f7d('0x50')](handleError(_0x4bb270,null));};exports[_0x9f7d('0x51')]=function(_0x4437bc,_0x2855b6){var _0x54de21={'raw':!![],'where':{'id':_0x4437bc['params']['id']}},_0x2e0478={};_0x2e0478[_0x9f7d('0x3f')]=_[_0x9f7d('0x52')](db[_0x9f7d('0x3a')][_0x9f7d('0x3b')]);_0x2e0478[_0x9f7d('0x41')]=_[_0x9f7d('0x52')](_0x4437bc[_0x9f7d('0x41')]);_0x2e0478[_0x9f7d('0x4a')]=_[_0x9f7d('0x42')](_0x2e0478['model'],_0x2e0478[_0x9f7d('0x41')]);_0x54de21['attributes']=_[_0x9f7d('0x42')](_0x2e0478[_0x9f7d('0x3f')],qs['fields'](_0x4437bc[_0x9f7d('0x41')][_0x9f7d('0x53')]));_0x54de21[_0x9f7d('0x43')]=_0x54de21[_0x9f7d('0x43')][_0x9f7d('0x44')]?_0x54de21[_0x9f7d('0x43')]:_0x2e0478[_0x9f7d('0x3f')];if(_0x4437bc[_0x9f7d('0x41')][_0x9f7d('0x54')]){_0x54de21[_0x9f7d('0x55')]=[{'all':!![]}];}_0x54de21=_[_0x9f7d('0x4c')]({},_0x54de21,_0x4437bc[_0x9f7d('0x4e')]);return db[_0x9f7d('0x3a')][_0x9f7d('0x56')](_0x54de21)['then'](handleEntityNotFound(_0x2855b6,null))[_0x9f7d('0x21')](respondWithResult(_0x2855b6,null))[_0x9f7d('0x50')](handleError(_0x2855b6,null));};exports[_0x9f7d('0x57')]=function(_0x188321,_0x5df522){return db[_0x9f7d('0x3a')][_0x9f7d('0x57')](_0x188321[_0x9f7d('0x58')],{})[_0x9f7d('0x21')](respondWithResult(_0x5df522,0xc9))[_0x9f7d('0x50')](handleError(_0x5df522,null));};exports[_0x9f7d('0x35')]=function(_0x410be3,_0x554079){if(_0x410be3[_0x9f7d('0x58')]['id']){delete _0x410be3[_0x9f7d('0x58')]['id'];}return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x410be3['params']['id']}})[_0x9f7d('0x21')](handleEntityNotFound(_0x554079,null))['then'](saveUpdates(_0x410be3['body'],null))[_0x9f7d('0x21')](respondWithResult(_0x554079,null))['catch'](handleError(_0x554079,null));};exports[_0x9f7d('0x36')]=function(_0x295f0d,_0x254def){return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x295f0d[_0x9f7d('0x59')]['id']}})[_0x9f7d('0x21')](handleEntityNotFound(_0x254def,null))['then'](removeEntity(_0x254def,null))[_0x9f7d('0x50')](handleError(_0x254def,null));};exports[_0x9f7d('0x5a')]=function(_0x5e6eba,_0x2cc44c){return db[_0x9f7d('0x3a')][_0x9f7d('0x5a')]()[_0x9f7d('0x21')](respondWithResult(_0x2cc44c,null))[_0x9f7d('0x50')](handleError(_0x2cc44c,null));};var interaction_log=require('../../config/logger')(_0x9f7d('0x5b'));exports['accept']=function(_0x3c874e,_0x117535,_0x29792a){var _0x2bb6da={'agent':{},'channel':_0x9f7d('0x5c')};if(_0x3c874e[_0x9f7d('0x58')]['id']){delete _0x3c874e['body']['id'];}_0x3c874e[_0x9f7d('0x58')]['read']=!![];_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5d')]=moment()['format'](_0x9f7d('0x5e'));_0x3c874e['body'][_0x9f7d('0x5f')]=_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')]||_0x3c874e[_0x9f7d('0x60')]['id'];_0x2bb6da[_0x9f7d('0x61')]['id']=_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')];return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x3c874e[_0x9f7d('0x59')]['id'],'UserId':null}})[_0x9f7d('0x21')](handleEntityNotFound(_0x117535,null))[_0x9f7d('0x21')](saveUpdates(_0x3c874e['body'],null))[_0x9f7d('0x21')](function(_0x2af20a){if(_0x2af20a){_0x2bb6da[_0x9f7d('0x28')]=_0x2af20a[_0x9f7d('0x62')]({'plain':!![]});return db['SmsInteraction'][_0x9f7d('0x56')]({'where':{'id':_0x2af20a['SmsInteractionId']}});}return null;})[_0x9f7d('0x21')](handleEntityNotFound(_0x117535,null))[_0x9f7d('0x21')](function(_0x506454){if(_0x506454){return _0x506454['update']({'UserId':_0x3c874e['body'][_0x9f7d('0x5f')],'read1stAt':_[_0x9f7d('0x63')](_0x506454[_0x9f7d('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9f7d('0x21')](function(_0xe13d9f){if(_0xe13d9f){_0x2bb6da[_0x9f7d('0x65')]=_0xe13d9f['get']({'plain':!![]});interaction_log[_0x9f7d('0x22')](_0x9f7d('0x66'),_0x3c874e['user']['id'],_0x3c874e['user'][_0x9f7d('0x37')],_0x3c874e[_0x9f7d('0x60')][_0x9f7d('0x67')],_0x2bb6da[_0x9f7d('0x65')]['id'],_0x3c874e[_0x9f7d('0x58')]?JSON[_0x9f7d('0x68')](_0x3c874e[_0x9f7d('0x58')]):_0x9f7d('0x69'));return respondWithRpcPromise(_0x9f7d('0x6a'),_0x9f7d('0x6b'),_0x2bb6da);}return null;})['then'](function(_0xa33403){var _0x355844='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa33403[_0x9f7d('0x28')][_0x9f7d('0x6c')];return db[_0x9f7d('0x6d')]['query'](_0x355844,{'type':db['Sequelize'][_0x9f7d('0x6e')][_0x9f7d('0x6f')],'raw':!![]})[_0x9f7d('0x21')](function(_0x217acb){return _0x217acb;});})[_0x9f7d('0x21')](function(_0x2d39d6){if(_0x2d39d6){_0x2bb6da['message'][_0x9f7d('0x70')]=_0x2d39d6[0x0];if(!_0x3c874e[_0x9f7d('0x58')]['UserId'])return;return db[_0x9f7d('0x71')]['find']({'where':{'id':_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x5f')],'role':'agent'},'attributes':['id',_0x9f7d('0x37'),'fullname',_0x9f7d('0x72'),_0x9f7d('0x73')],'raw':!![]});}return null;})[_0x9f7d('0x21')](function(_0x23652b){if(!_0x23652b)return null;_0x2bb6da[_0x9f7d('0x28')]['agent']=_0x23652b;return _0x2bb6da;})['then'](function(_0x4d98b1){if(_0x4d98b1){if(_0x3c874e[_0x9f7d('0x58')][_0x9f7d('0x74')]){_0x2bb6da['message'][_0x9f7d('0x75')]=util[_0x9f7d('0x76')]('SIP/%s',_0x3c874e[_0x9f7d('0x60')]['name']);_0x2bb6da[_0x9f7d('0x28')]['channel']=_0x2bb6da[_0x9f7d('0x77')];_0x2bb6da['message'][_0x9f7d('0x78')]=_0x2bb6da[_0x9f7d('0x77')];_0x2bb6da[_0x9f7d('0x28')][_0x9f7d('0x79')]=_0x9f7d('0x7a');return respondWithRpcPromise(_0x9f7d('0x7b'),'EventManager',{'event':_0x9f7d('0x7c'),'message':_0x2bb6da[_0x9f7d('0x28')]},client9002)[_0x9f7d('0x21')](function(){return _0x2bb6da;});}return _0x2bb6da;}return null;})[_0x9f7d('0x21')](respondWithResult(_0x117535,null))['catch'](handleError(_0x117535,null));};var interaction_log=require('../../config/logger')(_0x9f7d('0x5b'));exports[_0x9f7d('0x33')]=function(_0x553682,_0x510fc0,_0x2ca92e){var _0x58c293={'agent':{},'channel':_0x9f7d('0x5c')};if(_0x553682['body']['id']){delete _0x553682[_0x9f7d('0x58')]['id'];}_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')]=_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')]||_0x553682[_0x9f7d('0x60')]['id'];_0x58c293['agent']['id']=_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')];return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0x553682[_0x9f7d('0x59')]['id'],'UserId':null}})[_0x9f7d('0x21')](handleEntityNotFound(_0x510fc0,null))[_0x9f7d('0x21')](function(_0x2b15f5){if(_0x2b15f5){_0x58c293['message']=_0x2b15f5[_0x9f7d('0x62')]({'plain':!![]});return db[_0x9f7d('0x7d')][_0x9f7d('0x56')]({'where':{'id':_0x2b15f5['SmsInteractionId']}});}return null;})[_0x9f7d('0x21')](handleEntityNotFound(_0x510fc0,null))['then'](function(_0x3d78e5){if(_0x3d78e5){_0x58c293['interaction']=_0x3d78e5['get']({'plain':!![]});interaction_log[_0x9f7d('0x22')](_0x9f7d('0x7e'),_0x553682['user']['id'],_0x553682[_0x9f7d('0x60')][_0x9f7d('0x37')],_0x553682['user'][_0x9f7d('0x67')],_0x58c293[_0x9f7d('0x65')]['id'],_0x553682[_0x9f7d('0x58')]?JSON[_0x9f7d('0x68')](_0x553682[_0x9f7d('0x58')]):_0x9f7d('0x69'));return respondWithRpcPromise('RejectMessage',_0x9f7d('0x7f'),_0x58c293);}return null;})[_0x9f7d('0x21')](function(_0x1dbb30){var _0x27f596=_0x9f7d('0x80')+_0x1dbb30[_0x9f7d('0x28')]['ContactId'];return db[_0x9f7d('0x6d')][_0x9f7d('0x41')](_0x27f596,{'type':db[_0x9f7d('0x81')][_0x9f7d('0x6e')][_0x9f7d('0x6f')],'raw':!![]})['then'](function(_0x599ee5){return _0x599ee5;});})[_0x9f7d('0x21')](function(_0x1ac404){if(_0x1ac404){_0x58c293['message']['contact']=_0x1ac404[0x0];if(!_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')])return;return db[_0x9f7d('0x71')]['find']({'where':{'id':_0x553682[_0x9f7d('0x58')][_0x9f7d('0x5f')],'role':_0x9f7d('0x61')},'attributes':['id',_0x9f7d('0x37'),_0x9f7d('0x82'),_0x9f7d('0x72'),_0x9f7d('0x73')],'raw':!![]});}return null;})[_0x9f7d('0x21')](function(_0x18781e){if(!_0x18781e)return null;_0x58c293[_0x9f7d('0x28')]['agent']=_0x18781e;return _0x58c293;})[_0x9f7d('0x21')](function(_0xe0695){if(_0xe0695){_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x75')]=util[_0x9f7d('0x76')](_0x9f7d('0x83'),_0x553682[_0x9f7d('0x60')]['name']);_0xe0695['message'][_0x9f7d('0x77')]=_0x58c293[_0x9f7d('0x77')];_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x78')]=_0x58c293[_0x9f7d('0x77')];_0xe0695[_0x9f7d('0x28')][_0x9f7d('0x79')]=_0x9f7d('0x33');respondWithRpcPromise(_0x9f7d('0x7b'),_0x9f7d('0x7b'),{'event':_0x9f7d('0x84'),'message':_0xe0695[_0x9f7d('0x28')]},client9002);return _0x58c293;}return null;})[_0x9f7d('0x21')](respondWithResult(_0x510fc0,null))[_0x9f7d('0x50')](handleError(_0x510fc0,null));};exports[_0x9f7d('0x29')]=function(_0xd42acc,_0x235fd2,_0x559a6f){if(_0xd42acc['body']['id']){delete _0xd42acc[_0x9f7d('0x58')]['id'];}var _0x2a8e66;return db[_0x9f7d('0x3a')][_0x9f7d('0x56')]({'where':{'id':_0xd42acc[_0x9f7d('0x59')]['id']}})['then'](handleEntityNotFound(_0x235fd2,null))[_0x9f7d('0x21')](function(_0x423343){if(_0x423343){_0x2a8e66=_0x423343;return db[_0x9f7d('0x85')][_0x9f7d('0x56')]({'where':{'id':_0x423343['SmsAccountId']}});}})[_0x9f7d('0x21')](handleEntityNotFound(_0x235fd2,null))['then'](function(_0x51252a){if(_0x51252a){logger[_0x9f7d('0x86')](_0x9f7d('0x25'),_0x9f7d('0x29'),'received\x20delivery\x20report\x20from',_0x51252a['type'],util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));switch(_0x51252a[_0x9f7d('0x3d')]){case'twilio':if(_0xd42acc[_0x9f7d('0x58')][_0x9f7d('0x88')]&&_0xd42acc[_0x9f7d('0x58')]['MessageSid']===_0x2a8e66[_0x9f7d('0x89')]){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger[_0x9f7d('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9f7d('0x29'),_0x9f7d('0x8a'),util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x9f7d('0x8b'):if(_0xd42acc['body'][_0x9f7d('0x8c')]&&_0xd42acc['body'][_0x9f7d('0x8c')]===_0x2a8e66[_0x9f7d('0x89')]&&_[_0x9f7d('0x8d')]([_0x9f7d('0x8e'),_0x9f7d('0x8f')],_0xd42acc[_0x9f7d('0x58')][_0x9f7d('0x90')])>=0x0){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger[_0x9f7d('0x27')](_0x9f7d('0x91'),_0x9f7d('0x29'),_0x9f7d('0x92'),util[_0x9f7d('0x87')](_0xd42acc[_0x9f7d('0x58')],{'showHidden':![],'depth':null}));}break;case _0x9f7d('0x93'):var _0x16bd6a=_0xd42acc['body']['results'][0x0];if(_0x16bd6a[_0x9f7d('0x29')][_0x9f7d('0x94')]===_0x9f7d('0x95')){return _0x2a8e66[_0x9f7d('0x35')]({'read':!![]});}else{logger['error'](_0x9f7d('0x91'),_0x9f7d('0x29'),'infobip',util[_0x9f7d('0x87')](_0xd42acc['body'],{'showHidden':![],'depth':null}));}break;}return _0x2a8e66;}})[_0x9f7d('0x21')](respondWithResult(_0x235fd2,null))[_0x9f7d('0x50')](handleError(_0x235fd2,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 600bc78..60115a2 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 _0x106a=['SmsMessage','setMaxListeners','save','hasOwnProperty','exports','events'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0x106a,0x12b));var _0xa106=function(_0x582ae6,_0x57aa08){_0x582ae6=_0x582ae6-0x0;var _0x303447=_0x106a[_0x582ae6];return _0x303447;};'use strict';var EventEmitter=require(_0xa106('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xa106('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa106('0x2')](0x0);var events={'afterCreate':_0xa106('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x8f661e){return function(_0x2340ec,_0x3387be,_0x56c2d3){SmsMessageEvents['emit'](_0x8f661e+':'+_0x2340ec['id'],_0x2340ec);SmsMessageEvents['emit'](_0x8f661e,_0x2340ec);_0x56c2d3(null);};}for(var e in events){if(events[_0xa106('0x4')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xa106('0x5')]=SmsMessageEvents; \ No newline at end of file +var _0xf202=['emit','hook','events','SmsMessage','setMaxListeners'];(function(_0x4b1f8b,_0x249bd9){var _0x1a310e=function(_0xc2b8cc){while(--_0xc2b8cc){_0x4b1f8b['push'](_0x4b1f8b['shift']());}};_0x1a310e(++_0x249bd9);}(_0xf202,0xe3));var _0x2f20=function(_0x5d3a6a,_0x416cb4){_0x5d3a6a=_0x5d3a6a-0x0;var _0x129063=_0xf202[_0x5d3a6a];return _0x129063;};'use strict';var EventEmitter=require(_0x2f20('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x2f20('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x2f20('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a67aa){return function(_0xf124cd,_0xa9fb45,_0xe964c3){SmsMessageEvents['emit'](_0x5a67aa+':'+_0xf124cd['id'],_0xf124cd);SmsMessageEvents[_0x2f20('0x3')](_0x5a67aa,_0xf124cd);_0xe964c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x2f20('0x4')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 05ae91f..b0099ef 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 _0x1101=['authId','token','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','accountId','applicationId','bandwidth','intelepeer','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','message_id','clickSend','plivo'];(function(_0x407f78,_0x390898){var _0x2d9102=function(_0x36c857){while(--_0x36c857){_0x407f78['push'](_0x407f78['shift']());}};_0x2d9102(++_0x390898);}(_0x1101,0x126));var _0x1110=function(_0x187c21,_0x19888c){_0x187c21=_0x187c21-0x0;var _0x3ffa95=_0x1101[_0x187c21];return _0x3ffa95;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1110('0x0'))(_0x1110('0x1'));var moment=require(_0x1110('0x2'));var BPromise=require(_0x1110('0x3'));var rp=require(_0x1110('0x4'));var fs=require('fs');var path=require(_0x1110('0x5'));var rimraf=require(_0x1110('0x6'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x1110('0x7')]=function(_0x2e9e1,_0x446d4d){return _0x2e9e1[_0x1110('0x8')](_0x1110('0x9'),attributes,{'tableName':_0x1110('0xa'),'paranoid':![],'indexes':[{'name':_0x1110('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x1110('0xc')],'type':_0x1110('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4d6569,_0xe2101c,_0x1f50dc){var _0x1fb4e4=_0x2e9e1[_0x1110('0xe')];var _0x4db292=_0x4d6569[_0x1110('0xf')]({'plain':!![]});if(_0x4db292['direction'][_0x1110('0x10')]()==='in'||_0x4db292[_0x1110('0x11')][_0x1110('0x10')]()===_0x1110('0x12')&&!_0x4db292[_0x1110('0x13')]&&!_[_0x1110('0x14')](_0x4db292['UserId'])&&!_[_0x1110('0x14')](_0x4db292[_0x1110('0x15')])){_0x1fb4e4[_0x1110('0x16')][_0x1110('0x17')]({'where':{'id':_0x4db292['SmsInteractionId']}})[_0x1110('0x18')](function(_0x15b9b6){if(_0x15b9b6){_0x15b9b6[_0x1110('0x19')]({'lastMsgAt':_0x4db292['createdAt'],'lastMsgDirection':_0x4db292[_0x1110('0x11')]['toLowerCase']()});}})[_0x1110('0x1a')](function(_0x495fbf){console[_0x1110('0x1b')](_0x495fbf);});}if(_0x4db292[_0x1110('0x11')]===_0x1110('0x12')&&!_0x4db292[_0x1110('0x13')]){var _0x31df36;_0x1fb4e4[_0x1110('0x1c')][_0x1110('0x1d')]({'where':{'id':_0x4db292[_0x1110('0x1e')]},'raw':!![]})['then'](function(_0x1c5446){_0x31df36=_0x1c5446;if(_0x31df36&&_0x31df36[_0x1110('0x1f')]){switch(_0x31df36[_0x1110('0x1f')]){case'twilio':var _0x40eea8=require(_0x1110('0x20'));if(_0x31df36[_0x1110('0x21')]&&_0x31df36[_0x1110('0x22')]&&_0x31df36[_0x1110('0x23')]){var _0x5ef5f8=new _0x40eea8(_0x31df36['accountSid'],_0x31df36['authToken']);_0x5ef5f8['messages'][_0x1110('0x24')]({'body':_0x4db292[_0x1110('0xc')],'to':_0x4db292[_0x1110('0x23')],'from':_0x31df36[_0x1110('0x23')],'statusCallback':_0x31df36[_0x1110('0x25')]+_0x1110('0x26')+_0x4db292['id']+_0x1110('0x27')+_0x31df36['token']})[_0x1110('0x18')](function(_0x5e9ddb){if(_0x5e9ddb[_0x1110('0x28')]){return _0x4d6569['update']({'messageId':_0x5e9ddb[_0x1110('0x28')]});}})['catch'](function(_0x39ba25){logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),'twilio',util[_0x1110('0x2b')](_0x39ba25,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')](_0x1110('0x29'),'afterCreate',_0x1110('0x20'),_0x1110('0x2c'));}break;case _0x1110('0x2d'):var _0x2df6c8=_0x1110('0x2e');if(_0x31df36[_0x1110('0x2f')]&&_0x31df36[_0x1110('0x30')]){var _0x470f5f={'recipient':[_0x4db292['phone']],'message':_0x4db292[_0x1110('0xc')],'message_type':_0x31df36[_0x1110('0x31')]};if(_0x31df36[_0x1110('0x31')]&&_0x31df36[_0x1110('0x31')]!=='SI'){_0x470f5f[_0x1110('0x32')]=_0x31df36[_0x1110('0x23')];}var _0x396375={'url':_0x2df6c8+'login?username='+_0x31df36[_0x1110('0x2f')]+_0x1110('0x33')+_0x31df36[_0x1110('0x30')],'method':_0x1110('0x34')};rp(_0x396375)['then'](function(_0x1711ac){var _0xc8f72=_0x1711ac['split'](';');var _0x901c9d={'user_key':_0xc8f72[0x0],'session_key':_0xc8f72[0x1]};_0x396375={'url':_0x2df6c8+_0x1110('0x35'),'method':_0x1110('0x36'),'headers':{'user_key':_0x901c9d[_0x1110('0x37')],'Session_key':_0x901c9d[_0x1110('0x38')]},'json':!![],'body':_0x470f5f};return rp(_0x396375);})[_0x1110('0x18')](function(_0x43bdc7){if(_0x43bdc7[_0x1110('0x39')]>=0x1){var _0x579b2a={'messageId':_0x43bdc7[_0x1110('0x3a')]};if(_0x31df36[_0x1110('0x31')]!=='GP'||!_0x31df36[_0x1110('0x3b')]){_0x579b2a[_0x1110('0x3c')]=!![];}return _0x4d6569[_0x1110('0x19')](_0x579b2a);}else{return logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x2d'),util[_0x1110('0x2b')](_0x43bdc7,{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x390ee0){return logger['error'](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x2d'),util[_0x1110('0x2b')](_0x390ee0,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),_0x1110('0x2d'),_0x1110('0x3d'));}break;case _0x1110('0x3e'):if(_0x31df36[_0x1110('0x22')]){var _0x387376={'recipient':_0x4db292[_0x1110('0x23')],'message':_0x4db292[_0x1110('0xc')],'sender':_0x31df36[_0x1110('0x3f')]||_0x31df36['phone'],'authorization':_0x31df36['authToken']};var _0xe2101c={'method':_0x1110('0x36'),'uri':_0x1110('0x40'),'body':_0x387376,'json':!![]};rp(_0xe2101c)[_0x1110('0x18')](function(_0x196f5a){var _0x15dfc7={'messageId':_0x196f5a[_0x1110('0x41')]};if(!_0x31df36[_0x1110('0x3b')]){_0x15dfc7[_0x1110('0x3c')]=!![];}return _0x4d6569[_0x1110('0x19')](_0x15dfc7);})[_0x1110('0x1a')](function(_0x41b471){logger[_0x1110('0x1b')](_0x1110('0x29'),'afterCreate','connectel',util[_0x1110('0x2b')](_0x41b471,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),_0x1110('0x3e'),_0x1110('0x42'));}break;case _0x1110('0x43'):if(_0x31df36['username']&&_0x31df36[_0x1110('0x30')]){var _0x387376={'messages':[{'source':_0x1110('0x44'),'to':_0x4db292[_0x1110('0x23')],'body':_0x4db292[_0x1110('0xc')],'from':_0x31df36[_0x1110('0x3f')]||_0x31df36[_0x1110('0x23')]}]};var _0x3784cf=util[_0x1110('0x45')](_0x1110('0x46'),_0x31df36[_0x1110('0x2f')],_0x31df36[_0x1110('0x30')]);var _0xe2101c={'method':_0x1110('0x36'),'uri':_0x1110('0x47'),'body':_0x387376,'headers':{'Authorization':util['format'](_0x1110('0x48'),new Buffer(_0x3784cf)[_0x1110('0x49')]('base64'))},'json':!![]};rp(_0xe2101c)['then'](function(_0x45b6c1){if(_0x45b6c1[_0x1110('0x4a')]>=0xc8&&_0x45b6c1['http_code']<=0xce){if(_0x45b6c1['data']&&_0x45b6c1[_0x1110('0x4b')][_0x1110('0x4c')]>0x0){var _0x455689=_[_0x1110('0x4d')](_0x45b6c1[_0x1110('0x4b')]['messages']);var _0x16f809={'messageId':_0x455689[_0x1110('0x4e')]};if(!_0x31df36[_0x1110('0x3b')]){_0x16f809['read']=!![];}return _0x4d6569[_0x1110('0x19')](_0x16f809);}else{logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x4f'),util[_0x1110('0x2b')](_0x45b6c1,{'showHidden':![],'depth':null}));}}else{logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x4f'),util[_0x1110('0x2b')](_0x45b6c1,{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x9f567){logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),'clickSend',util[_0x1110('0x2b')](_0x9f567,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1110('0x50'):if(_0x31df36[_0x1110('0x51')]&&_0x31df36[_0x1110('0x22')]){var _0x387376={'dst':_0x4db292['phone'],'text':_0x4db292[_0x1110('0xc')],'src':_0x31df36['senderString']||_0x31df36[_0x1110('0x23')],'url':_0x31df36[_0x1110('0x25')]+'/api/sms/messages/'+_0x4db292['id']+_0x1110('0x27')+_0x31df36[_0x1110('0x52')]};var _0x3784cf=util[_0x1110('0x45')](_0x1110('0x46'),_0x31df36[_0x1110('0x51')],_0x31df36[_0x1110('0x22')]);var _0xe2101c={'method':_0x1110('0x36'),'uri':util[_0x1110('0x45')](_0x1110('0x53'),_0x31df36[_0x1110('0x51')]),'body':_0x387376,'headers':{'Authorization':util[_0x1110('0x45')](_0x1110('0x48'),new Buffer(_0x3784cf)[_0x1110('0x49')](_0x1110('0x54')))},'json':!![]};rp(_0xe2101c)[_0x1110('0x18')](function(_0x51b47b){var _0x52dda9={'messageId':_0x51b47b[_0x1110('0x55')][0x0]};return _0x4d6569[_0x1110('0x19')](_0x52dda9);})[_0x1110('0x1a')](function(_0xb8280f){logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x50'),util[_0x1110('0x2b')](_0xb8280f,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x50'),_0x1110('0x56'));}break;case _0x1110('0x57'):if(_0x31df36[_0x1110('0x2f')]&&_0x31df36[_0x1110('0x30')]){if(_0x31df36[_0x1110('0x58')]){var _0x314cd9={'method':'POST','uri':_0x31df36['baseUrl']+_0x1110('0x59'),'body':{'username':_0x31df36['username'],'password':_0x31df36['password']},'json':!![]};return rp(_0x314cd9)[_0x1110('0x18')](function(_0x387add){var _0x5ca170={'method':_0x1110('0x36'),'uri':_0x31df36['baseUrl']+_0x1110('0x5a'),'body':{'messages':[{'from':_0x31df36['phone'],'destinations':[{'to':_0x4db292[_0x1110('0x23')]}],'text':_0x4db292[_0x1110('0xc')],'notifyUrl':_0x31df36[_0x1110('0x25')]+_0x1110('0x26')+_0x4db292['id']+_0x1110('0x27')+_0x31df36[_0x1110('0x52')],'notifyContentType':_0x1110('0x5b'),'callbackData':_0x31df36[_0x1110('0x23')]+';'+_0x4db292[_0x1110('0xc')]}]},'headers':{'Authorization':_0x1110('0x5c')+_0x387add[_0x1110('0x52')]},'json':!![]};return rp(_0x5ca170)[_0x1110('0x18')](function(_0x497685){if(_0x497685[_0x1110('0x5d')]){var _0x3ef583={'messageId':_0x497685[_0x1110('0x5d')][0x0][_0x1110('0xb')]};if(!_0x31df36[_0x1110('0x3b')]){_0x3ef583[_0x1110('0x3c')]=!![];}return _0x4d6569[_0x1110('0x19')](_0x3ef583);}else{return logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x57'),util['inspect'](_0x497685,{'showHidden':![],'depth':null}));}});})[_0x1110('0x1a')](function(_0x19a1ba){return logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),'infobip',util[_0x1110('0x2b')](_0x19a1ba,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x57'),_0x1110('0x5e'));}}else{logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1110('0x5f'):var _0x5e53b2=require(_0x1110('0x60'));if(_0x31df36[_0x1110('0x61')]){var _0x49adb2={};_0x49adb2[_0x1110('0x62')]=_0x31df36['username'];_0x49adb2[_0x1110('0x23')]=_0x4db292[_0x1110('0x23')];_0x49adb2['sender']=_0x31df36[_0x1110('0x23')];_0x49adb2[_0x1110('0x63')]=_0x4db292[_0x1110('0xc')];_0x49adb2['timestamp']=+new Date();var _0x3c5567='';var _0x22cc97='';var _0x5c6b06=Object[_0x1110('0x64')](_0x49adb2);_0x5c6b06[_0x1110('0x65')]();for(var _0x547b0a=0x0;_0x547b0a<_0x5c6b06[_0x1110('0x66')];_0x547b0a++){if(_0x3c5567!=''){_0x3c5567+='&';}_0x3c5567+=_0x5c6b06[_0x547b0a]+'='+encodeURIComponent(_0x49adb2[_0x5c6b06[_0x547b0a]]);_0x22cc97+=_0x49adb2[_0x5c6b06[_0x547b0a]];}_0x22cc97+=_0x31df36['apiKey'];_0x22cc97=_0x5e53b2[_0x1110('0x67')](_0x1110('0x68'))[_0x1110('0x19')](_0x22cc97)[_0x1110('0x69')](_0x1110('0x6a'));if(_0x3c5567!==''){_0x3c5567+='&';}_0x3c5567+=_0x1110('0x6b')+_0x22cc97;var _0x396375={'method':_0x1110('0x34'),'uri':_0x31df36[_0x1110('0x58')]+_0x1110('0x6c')+_0x3c5567,'json':!![]};return rp(_0x396375)['then'](function(_0x477eec){var _0x327764=Object['keys'](_0x477eec);if(_0x477eec[_0x327764[0x0]][_0x1110('0x1b')]&&parseInt(_0x477eec[_0x327764[0x0]][_0x1110('0x1b')])===0x0){var _0x2adcea={'messageId':_0x477eec[_0x327764[0x0]][_0x1110('0x6d')]};if(!_0x31df36[_0x1110('0x3b')]){_0x2adcea[_0x1110('0x3c')]=!![];}return _0x4d6569[_0x1110('0x19')](_0x2adcea);}else{return logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x5f'),util[_0x1110('0x2b')](_0x477eec['error'],{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x58b088){return logger[_0x1110('0x1b')](_0x1110('0x29'),'afterCreate',_0x1110('0x5f'),util['inspect'](_0x58b088,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),_0x1110('0x5f'),_0x1110('0x6e'));}break;case _0x1110('0x6f'):if(_0x31df36[_0x1110('0x61')]){var _0x35e644={'method':_0x1110('0x36'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x31df36[_0x1110('0x61')]},'body':{'content':_0x4db292[_0x1110('0xc')],'to':[_0x4db292['phone']],'from':_0x31df36[_0x1110('0x23')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x35e644)['then'](function(_0x361b27){if(!_0x361b27['error']){var _0x439dce={'messageId':_0x361b27[_0x1110('0x5d')][0x0]['apiMessageId']};if(!_0x31df36['deliveryReport']){_0x439dce['read']=!![];}return _0x4d6569[_0x1110('0x19')](_0x439dce);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),'clickatell',util[_0x1110('0x2b')](_0x361b27[_0x1110('0x1b')],{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x5a4ef4){return logger['error'](_0x1110('0x29'),'afterCreate',_0x1110('0x6f'),util[_0x1110('0x2b')](_0x5a4ef4,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')](_0x1110('0x29'),'afterCreate',_0x1110('0x6f'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x31df36[_0x1110('0x2f')]&&_0x31df36[_0x1110('0x30')]){var _0x3784cf=util[_0x1110('0x45')](_0x1110('0x46'),_0x31df36[_0x1110('0x2f')],_0x31df36[_0x1110('0x30')]);var _0xe2101c={'method':_0x1110('0x36'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x31df36[_0x1110('0x70')]+'/messages','body':{'to':[_0x4db292[_0x1110('0x23')]],'text':_0x4db292['body'],'from':_0x31df36[_0x1110('0x23')],'applicationId':_0x31df36[_0x1110('0x71')]},'headers':{'Authorization':util[_0x1110('0x45')](_0x1110('0x48'),new Buffer(_0x3784cf)[_0x1110('0x49')]('base64'))},'json':!![]};rp(_0xe2101c)['then'](function(_0x22637b){if(_0x22637b['id']){var _0x27ec37={'messageId':_0x22637b['id']};return _0x4d6569[_0x1110('0x19')](_0x27ec37);}else{logger[_0x1110('0x1b')](_0x1110('0x29'),'afterCreate','bandwidth',util['inspect'](_0x22637b,{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x5823b1){logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),_0x1110('0x72'),util[_0x1110('0x2b')](_0x5823b1,{'showHidden':![],'depth':null}));});}else{logger[_0x1110('0x1b')](_0x1110('0x29'),_0x1110('0x2a'),_0x1110('0x72'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x1110('0x73'):if(_0x31df36[_0x1110('0x61')]){var _0x5fa74a={};var _0x396375={'method':_0x1110('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x1110('0x74')+_0x31df36[_0x1110('0x61')],'Content-Type':_0x1110('0x5b')},'body':{'from':_0x31df36[_0x1110('0x23')],'to':_0x4db292['phone'],'text':_0x4db292[_0x1110('0xc')]},'json':!![]};return rp(_0x396375)[_0x1110('0x18')](function(_0x11cfef){if(_0x11cfef[_0x1110('0x75')]==0xca){_0x5fa74a['message']=_0x11cfef;var _0x1290f1={'method':'POST','uri':_0x1110('0x76'),'headers':{'Authorization':_0x1110('0x74')+_0x31df36['apiKey'],'Content-Type':_0x1110('0x5b')},'body':{'refid':_0x5fa74a[_0x1110('0x77')][_0x1110('0x78')]},'json':!![]};return rp(_0x1290f1)[_0x1110('0x18')](function(_0x609b52){_0x5fa74a[_0x1110('0x79')]=_0x609b52;var _0x1197f2={'messageId':_0x5fa74a[_0x1110('0x77')][_0x1110('0x78')],'read':!![]};return _0x4d6569[_0x1110('0x19')](_0x1197f2);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),_0x1110('0x73'),util['inspect'](_0x11cfef,{'showHidden':![],'depth':null}));}})[_0x1110('0x1a')](function(_0x151c76){return logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),'intelepeer',util[_0x1110('0x2b')](_0x151c76,{'showHidden':![],'depth':null}));});}else{return logger[_0x1110('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1110('0x2a'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x1110('0x7a')](function(){_0x1f50dc();});}else{_0x1f50dc();}}},'charset':_0x1110('0x7b'),'collate':_0x1110('0x7c')});}; \ No newline at end of file +var _0xd1b4=['sort','length','md5','digest','hex','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','UserId','isNil','SmsInteractionId','findOne','then','catch','error','find','type','twilio','accountSid','authToken','messages','create','phone','/status?token=','token','update','sid','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','user_key','session_key','total_sent','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys'];(function(_0x40b3f2,_0x2c4f5f){var _0x4ce90c=function(_0x516f31){while(--_0x516f31){_0x40b3f2['push'](_0x40b3f2['shift']());}};_0x4ce90c(++_0x2c4f5f);}(_0xd1b4,0x197));var _0x4d1b=function(_0x1be6b5,_0x2a029b){_0x1be6b5=_0x1be6b5-0x0;var _0x1f9bc6=_0xd1b4[_0x1be6b5];return _0x1f9bc6;};'use strict';var _=require(_0x4d1b('0x0'));var util=require('util');var logger=require(_0x4d1b('0x1'))(_0x4d1b('0x2'));var moment=require(_0x4d1b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d1b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d1b('0x5'));var config=require(_0x4d1b('0x6'));var attributes=require(_0x4d1b('0x7'));module[_0x4d1b('0x8')]=function(_0x53e2a6,_0xc53eae){return _0x53e2a6['define'](_0x4d1b('0x9'),attributes,{'tableName':_0x4d1b('0xa'),'paranoid':![],'indexes':[{'name':_0x4d1b('0xb'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x4d1b('0xc')],'type':_0x4d1b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7b0a6,_0x1a25f8,_0x1fe90e){var _0x13e758=_0x53e2a6[_0x4d1b('0xe')];var _0x518812=_0x7b0a6[_0x4d1b('0xf')]({'plain':!![]});if(_0x518812['direction'][_0x4d1b('0x10')]()==='in'||_0x518812[_0x4d1b('0x11')][_0x4d1b('0x10')]()===_0x4d1b('0x12')&&!_0x518812[_0x4d1b('0x13')]&&!_['isNil'](_0x518812[_0x4d1b('0x14')])&&!_[_0x4d1b('0x15')](_0x518812[_0x4d1b('0x16')])){_0x13e758['SmsInteraction'][_0x4d1b('0x17')]({'where':{'id':_0x518812[_0x4d1b('0x16')]}})[_0x4d1b('0x18')](function(_0x20a281){if(_0x20a281){_0x20a281['update']({'lastMsgAt':_0x518812['createdAt'],'lastMsgDirection':_0x518812[_0x4d1b('0x11')][_0x4d1b('0x10')]()});}})[_0x4d1b('0x19')](function(_0x1bc64a){console[_0x4d1b('0x1a')](_0x1bc64a);});}if(_0x518812[_0x4d1b('0x11')]==='out'&&!_0x518812[_0x4d1b('0x13')]){var _0x377074;_0x13e758['SmsAccount'][_0x4d1b('0x1b')]({'where':{'id':_0x518812['SmsAccountId']},'raw':!![]})['then'](function(_0x2532c1){_0x377074=_0x2532c1;if(_0x377074&&_0x377074[_0x4d1b('0x1c')]){switch(_0x377074[_0x4d1b('0x1c')]){case _0x4d1b('0x1d'):var _0x52c782=require(_0x4d1b('0x1d'));if(_0x377074[_0x4d1b('0x1e')]&&_0x377074[_0x4d1b('0x1f')]&&_0x377074['phone']){var _0x43ad8d=new _0x52c782(_0x377074[_0x4d1b('0x1e')],_0x377074[_0x4d1b('0x1f')]);_0x43ad8d[_0x4d1b('0x20')][_0x4d1b('0x21')]({'body':_0x518812[_0x4d1b('0xc')],'to':_0x518812['phone'],'from':_0x377074[_0x4d1b('0x22')],'statusCallback':_0x377074['remote']+'/api/sms/messages/'+_0x518812['id']+_0x4d1b('0x23')+_0x377074[_0x4d1b('0x24')]})['then'](function(_0x5e225d){if(_0x5e225d['sid']){return _0x7b0a6[_0x4d1b('0x25')]({'messageId':_0x5e225d[_0x4d1b('0x26')]});}})[_0x4d1b('0x19')](function(_0x197d69){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),_0x4d1b('0x1d'),util[_0x4d1b('0x28')](_0x197d69,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),'twilio',_0x4d1b('0x2a'));}break;case'skebby':var _0x3a6519=_0x4d1b('0x2b');if(_0x377074[_0x4d1b('0x2c')]&&_0x377074[_0x4d1b('0x2d')]){var _0x57bdef={'recipient':[_0x518812[_0x4d1b('0x22')]],'message':_0x518812['body'],'message_type':_0x377074['smsMethod']};if(_0x377074[_0x4d1b('0x2e')]&&_0x377074[_0x4d1b('0x2e')]!=='SI'){_0x57bdef[_0x4d1b('0x2f')]=_0x377074[_0x4d1b('0x22')];}var _0xc3ee9f={'url':_0x3a6519+_0x4d1b('0x30')+_0x377074[_0x4d1b('0x2c')]+'&password='+_0x377074[_0x4d1b('0x2d')],'method':_0x4d1b('0x31')};rp(_0xc3ee9f)[_0x4d1b('0x18')](function(_0x444ae4){var _0x12f8e0=_0x444ae4[_0x4d1b('0x32')](';');var _0x516296={'user_key':_0x12f8e0[0x0],'session_key':_0x12f8e0[0x1]};_0xc3ee9f={'url':_0x3a6519+_0x4d1b('0x33'),'method':_0x4d1b('0x34'),'headers':{'user_key':_0x516296[_0x4d1b('0x35')],'Session_key':_0x516296[_0x4d1b('0x36')]},'json':!![],'body':_0x57bdef};return rp(_0xc3ee9f);})[_0x4d1b('0x18')](function(_0x4337b4){if(_0x4337b4[_0x4d1b('0x37')]>=0x1){var _0xb94d1c={'messageId':_0x4337b4['internal_order_id']};if(_0x377074['smsMethod']!=='GP'||!_0x377074[_0x4d1b('0x38')]){_0xb94d1c[_0x4d1b('0x39')]=!![];}return _0x7b0a6[_0x4d1b('0x25')](_0xb94d1c);}else{return logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x3a'),util[_0x4d1b('0x28')](_0x4337b4,{'showHidden':![],'depth':null}));}})[_0x4d1b('0x19')](function(_0x3776fc){return logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),'afterCreate',_0x4d1b('0x3a'),util[_0x4d1b('0x28')](_0x3776fc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d1b('0x29'),'afterCreate',_0x4d1b('0x3a'),_0x4d1b('0x3b'));}break;case _0x4d1b('0x3c'):if(_0x377074['authToken']){var _0x2d37e8={'recipient':_0x518812[_0x4d1b('0x22')],'message':_0x518812[_0x4d1b('0xc')],'sender':_0x377074[_0x4d1b('0x3d')]||_0x377074[_0x4d1b('0x22')],'authorization':_0x377074['authToken']};var _0x1a25f8={'method':_0x4d1b('0x34'),'uri':_0x4d1b('0x3e'),'body':_0x2d37e8,'json':!![]};rp(_0x1a25f8)[_0x4d1b('0x18')](function(_0x1e7e91){var _0x3b8862={'messageId':_0x1e7e91['requestid']};if(!_0x377074[_0x4d1b('0x38')]){_0x3b8862[_0x4d1b('0x39')]=!![];}return _0x7b0a6[_0x4d1b('0x25')](_0x3b8862);})[_0x4d1b('0x19')](function(_0x491e46){logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),'afterCreate',_0x4d1b('0x3c'),util[_0x4d1b('0x28')](_0x491e46,{'showHidden':![],'depth':null}));});}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),'afterCreate',_0x4d1b('0x3c'),_0x4d1b('0x3f'));}break;case _0x4d1b('0x40'):if(_0x377074[_0x4d1b('0x2c')]&&_0x377074[_0x4d1b('0x2d')]){var _0x2d37e8={'messages':[{'source':_0x4d1b('0x41'),'to':_0x518812[_0x4d1b('0x22')],'body':_0x518812[_0x4d1b('0xc')],'from':_0x377074[_0x4d1b('0x3d')]||_0x377074[_0x4d1b('0x22')]}]};var _0x3de816=util[_0x4d1b('0x42')](_0x4d1b('0x43'),_0x377074[_0x4d1b('0x2c')],_0x377074['password']);var _0x1a25f8={'method':'POST','uri':_0x4d1b('0x44'),'body':_0x2d37e8,'headers':{'Authorization':util[_0x4d1b('0x42')](_0x4d1b('0x45'),new Buffer(_0x3de816)[_0x4d1b('0x46')](_0x4d1b('0x47')))},'json':!![]};rp(_0x1a25f8)[_0x4d1b('0x18')](function(_0x2661f2){if(_0x2661f2[_0x4d1b('0x48')]>=0xc8&&_0x2661f2[_0x4d1b('0x48')]<=0xce){if(_0x2661f2[_0x4d1b('0x49')]&&_0x2661f2[_0x4d1b('0x49')]['queued_count']>0x0){var _0x5daae9=_[_0x4d1b('0x4a')](_0x2661f2[_0x4d1b('0x49')]['messages']);var _0x32f1c2={'messageId':_0x5daae9[_0x4d1b('0x4b')]};if(!_0x377074[_0x4d1b('0x38')]){_0x32f1c2[_0x4d1b('0x39')]=!![];}return _0x7b0a6['update'](_0x32f1c2);}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x4c'),util['inspect'](_0x2661f2,{'showHidden':![],'depth':null}));}}else{logger[_0x4d1b('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),_0x4d1b('0x4c'),util[_0x4d1b('0x28')](_0x2661f2,{'showHidden':![],'depth':null}));}})[_0x4d1b('0x19')](function(_0x294e13){logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x4c'),util[_0x4d1b('0x28')](_0x294e13,{'showHidden':![],'depth':null}));});}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),'afterCreate',_0x4d1b('0x4c'),_0x4d1b('0x3b'));}break;case _0x4d1b('0x4d'):if(_0x377074[_0x4d1b('0x4e')]&&_0x377074[_0x4d1b('0x1f')]){var _0x2d37e8={'dst':_0x518812[_0x4d1b('0x22')],'text':_0x518812[_0x4d1b('0xc')],'src':_0x377074['senderString']||_0x377074['phone'],'url':_0x377074[_0x4d1b('0x4f')]+_0x4d1b('0x50')+_0x518812['id']+_0x4d1b('0x23')+_0x377074['token']};var _0x3de816=util[_0x4d1b('0x42')]('%s:%s',_0x377074['authId'],_0x377074[_0x4d1b('0x1f')]);var _0x1a25f8={'method':_0x4d1b('0x34'),'uri':util[_0x4d1b('0x42')](_0x4d1b('0x51'),_0x377074['authId']),'body':_0x2d37e8,'headers':{'Authorization':util[_0x4d1b('0x42')](_0x4d1b('0x45'),new Buffer(_0x3de816)[_0x4d1b('0x46')](_0x4d1b('0x47')))},'json':!![]};rp(_0x1a25f8)['then'](function(_0x469566){var _0x4b2c3e={'messageId':_0x469566[_0x4d1b('0x52')][0x0]};return _0x7b0a6['update'](_0x4b2c3e);})[_0x4d1b('0x19')](function(_0xb5fc74){logger[_0x4d1b('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),_0x4d1b('0x4d'),util[_0x4d1b('0x28')](_0xb5fc74,{'showHidden':![],'depth':null}));});}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x4d'),_0x4d1b('0x53'));}break;case'infobip':if(_0x377074[_0x4d1b('0x2c')]&&_0x377074[_0x4d1b('0x2d')]){if(_0x377074[_0x4d1b('0x54')]){var _0x1c7b35={'method':_0x4d1b('0x34'),'uri':_0x377074[_0x4d1b('0x54')]+_0x4d1b('0x55'),'body':{'username':_0x377074[_0x4d1b('0x2c')],'password':_0x377074[_0x4d1b('0x2d')]},'json':!![]};return rp(_0x1c7b35)[_0x4d1b('0x18')](function(_0x22597d){var _0x28e348={'method':'POST','uri':_0x377074[_0x4d1b('0x54')]+_0x4d1b('0x56'),'body':{'messages':[{'from':_0x377074[_0x4d1b('0x22')],'destinations':[{'to':_0x518812[_0x4d1b('0x22')]}],'text':_0x518812[_0x4d1b('0xc')],'notifyUrl':_0x377074['remote']+'/api/sms/messages/'+_0x518812['id']+_0x4d1b('0x23')+_0x377074[_0x4d1b('0x24')],'notifyContentType':_0x4d1b('0x57'),'callbackData':_0x377074[_0x4d1b('0x22')]+';'+_0x518812[_0x4d1b('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x22597d[_0x4d1b('0x24')]},'json':!![]};return rp(_0x28e348)[_0x4d1b('0x18')](function(_0x27e53a){if(_0x27e53a[_0x4d1b('0x20')]){var _0x2fe50e={'messageId':_0x27e53a[_0x4d1b('0x20')][0x0][_0x4d1b('0xb')]};if(!_0x377074[_0x4d1b('0x38')]){_0x2fe50e['read']=!![];}return _0x7b0a6[_0x4d1b('0x25')](_0x2fe50e);}else{return logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),'infobip',util[_0x4d1b('0x28')](_0x27e53a,{'showHidden':![],'depth':null}));}});})[_0x4d1b('0x19')](function(_0x3073dd){return logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x58'),util[_0x4d1b('0x28')](_0x3073dd,{'showHidden':![],'depth':null}));});}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x58'),_0x4d1b('0x59'));}}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x58'),_0x4d1b('0x3b'));}break;case _0x4d1b('0x5a'):var _0x2d821b=require(_0x4d1b('0x5b'));if(_0x377074[_0x4d1b('0x5c')]){var _0x182286={};_0x182286[_0x4d1b('0x5d')]=_0x377074[_0x4d1b('0x2c')];_0x182286[_0x4d1b('0x22')]=_0x518812['phone'];_0x182286[_0x4d1b('0x2f')]=_0x377074[_0x4d1b('0x22')];_0x182286[_0x4d1b('0x5e')]=_0x518812['body'];_0x182286[_0x4d1b('0x5f')]=+new Date();var _0x1d9332='';var _0x2c8fc9='';var _0x3de4a2=Object[_0x4d1b('0x60')](_0x182286);_0x3de4a2[_0x4d1b('0x61')]();for(var _0x181754=0x0;_0x181754<_0x3de4a2[_0x4d1b('0x62')];_0x181754++){if(_0x1d9332!=''){_0x1d9332+='&';}_0x1d9332+=_0x3de4a2[_0x181754]+'='+encodeURIComponent(_0x182286[_0x3de4a2[_0x181754]]);_0x2c8fc9+=_0x182286[_0x3de4a2[_0x181754]];}_0x2c8fc9+=_0x377074[_0x4d1b('0x5c')];_0x2c8fc9=_0x2d821b['createHash'](_0x4d1b('0x63'))[_0x4d1b('0x25')](_0x2c8fc9)[_0x4d1b('0x64')](_0x4d1b('0x65'));if(_0x1d9332!==''){_0x1d9332+='&';}_0x1d9332+='signature='+_0x2c8fc9;var _0xc3ee9f={'method':_0x4d1b('0x31'),'uri':_0x377074[_0x4d1b('0x54')]+_0x4d1b('0x66')+_0x1d9332,'json':!![]};return rp(_0xc3ee9f)['then'](function(_0x14ea4c){var _0x3b5e95=Object['keys'](_0x14ea4c);if(_0x14ea4c[_0x3b5e95[0x0]][_0x4d1b('0x1a')]&&parseInt(_0x14ea4c[_0x3b5e95[0x0]][_0x4d1b('0x1a')])===0x0){var _0x208930={'messageId':_0x14ea4c[_0x3b5e95[0x0]][_0x4d1b('0x67')]};if(!_0x377074[_0x4d1b('0x38')]){_0x208930[_0x4d1b('0x39')]=!![];}return _0x7b0a6[_0x4d1b('0x25')](_0x208930);}else{return logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x5a'),util[_0x4d1b('0x28')](_0x14ea4c[_0x4d1b('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4d1b('0x19')](function(_0x38b3be){return logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x5a'),util[_0x4d1b('0x28')](_0x38b3be,{'showHidden':![],'depth':null}));});}else{logger[_0x4d1b('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4d1b('0x5a'),'Missing\x20parameters:\x20apiKey');}break;case _0x4d1b('0x68'):if(_0x377074[_0x4d1b('0x5c')]){var _0x402880={'method':_0x4d1b('0x34'),'uri':_0x4d1b('0x69'),'headers':{'Authorization':_0x377074[_0x4d1b('0x5c')]},'body':{'content':_0x518812[_0x4d1b('0xc')],'to':[_0x518812['phone']],'from':_0x377074[_0x4d1b('0x22')],'binary':![],'clientMessageId':_0x4d1b('0x6a'),'charset':_0x4d1b('0x6b')},'json':!![]};rp(_0x402880)[_0x4d1b('0x18')](function(_0x30f3cf){if(!_0x30f3cf[_0x4d1b('0x1a')]){var _0x1a5593={'messageId':_0x30f3cf[_0x4d1b('0x20')][0x0][_0x4d1b('0x6c')]};if(!_0x377074[_0x4d1b('0x38')]){_0x1a5593[_0x4d1b('0x39')]=!![];}return _0x7b0a6['update'](_0x1a5593);}else{return logger[_0x4d1b('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),_0x4d1b('0x68'),util[_0x4d1b('0x28')](_0x30f3cf[_0x4d1b('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4d1b('0x19')](function(_0x183634){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),'clickatell',util['inspect'](_0x183634,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),'clickatell',_0x4d1b('0x6d'));}break;case _0x4d1b('0x6e'):if(_0x377074[_0x4d1b('0x2c')]&&_0x377074[_0x4d1b('0x2d')]){var _0x3de816=util[_0x4d1b('0x42')](_0x4d1b('0x43'),_0x377074[_0x4d1b('0x2c')],_0x377074['password']);var _0x1a25f8={'method':_0x4d1b('0x34'),'uri':_0x4d1b('0x6f')+_0x377074[_0x4d1b('0x70')]+_0x4d1b('0x71'),'body':{'to':[_0x518812['phone']],'text':_0x518812[_0x4d1b('0xc')],'from':_0x377074[_0x4d1b('0x22')],'applicationId':_0x377074[_0x4d1b('0x72')]},'headers':{'Authorization':util[_0x4d1b('0x42')](_0x4d1b('0x45'),new Buffer(_0x3de816)[_0x4d1b('0x46')]('base64'))},'json':!![]};rp(_0x1a25f8)[_0x4d1b('0x18')](function(_0x26a086){if(_0x26a086['id']){var _0x1084eb={'messageId':_0x26a086['id']};return _0x7b0a6[_0x4d1b('0x25')](_0x1084eb);}else{logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),'bandwidth',util[_0x4d1b('0x28')](_0x26a086,{'showHidden':![],'depth':null}));}})['catch'](function(_0x49adbf){logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),'bandwidth',util[_0x4d1b('0x28')](_0x49adbf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x6e'),_0x4d1b('0x3b'));}break;case _0x4d1b('0x73'):if(_0x377074[_0x4d1b('0x5c')]){var _0x374129={};var _0xc3ee9f={'method':_0x4d1b('0x34'),'uri':_0x4d1b('0x74'),'headers':{'Authorization':_0x4d1b('0x75')+_0x377074[_0x4d1b('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x377074[_0x4d1b('0x22')],'to':_0x518812['phone'],'text':_0x518812['body']},'json':!![]};return rp(_0xc3ee9f)['then'](function(_0x2483e5){if(_0x2483e5[_0x4d1b('0x76')]==0xca){_0x374129['message']=_0x2483e5;var _0x903967={'method':_0x4d1b('0x34'),'uri':_0x4d1b('0x77'),'headers':{'Authorization':'Bearer\x20'+_0x377074['apiKey'],'Content-Type':_0x4d1b('0x57')},'body':{'refid':_0x374129[_0x4d1b('0x78')][_0x4d1b('0x79')]},'json':!![]};return rp(_0x903967)['then'](function(_0x15077c){_0x374129[_0x4d1b('0x7a')]=_0x15077c;var _0x4dfb45={'messageId':_0x374129[_0x4d1b('0x78')][_0x4d1b('0x79')],'read':!![]};return _0x7b0a6[_0x4d1b('0x25')](_0x4dfb45);});}else{return logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),_0x4d1b('0x73'),util[_0x4d1b('0x28')](_0x2483e5,{'showHidden':![],'depth':null}));}})[_0x4d1b('0x19')](function(_0x272d22){return logger[_0x4d1b('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d1b('0x27'),_0x4d1b('0x73'),util[_0x4d1b('0x28')](_0x272d22,{'showHidden':![],'depth':null}));});}else{return logger[_0x4d1b('0x1a')](_0x4d1b('0x29'),_0x4d1b('0x27'),'intelepeer',_0x4d1b('0x7b'));}break;}}})[_0x4d1b('0x7c')](function(){_0x1fe90e();});}else{_0x1fe90e();}}},'charset':_0x4d1b('0x7d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index c1c425a..627916c 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 _0x5646=['body','options','raw','debug','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','localhost','socket.io-emitter','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateSmsMessage','create'];(function(_0x1a8caa,_0x195483){var _0x9021fe=function(_0x2eef64){while(--_0x2eef64){_0x1a8caa['push'](_0x1a8caa['shift']());}};_0x9021fe(++_0x195483);}(_0x5646,0x113));var _0x6564=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0x5646[_0x424357];return _0x29c68e;};'use strict';var _=require(_0x6564('0x0'));var util=require('util');var moment=require(_0x6564('0x1'));var BPromise=require(_0x6564('0x2'));var rs=require(_0x6564('0x3'));var fs=require('fs');var Redis=require(_0x6564('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6564('0x5'));var logger=require(_0x6564('0x6'))(_0x6564('0x7'));var config=require('../../config/environment');var jayson=require(_0x6564('0x8'));var client=jayson[_0x6564('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6564('0xa'),'port':0x18eb});var socket=require(_0x6564('0xb'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4a394c,_0x1bae75,_0x592e2f){return new BPromise(function(_0x44f8b6,_0x40cec9){return client[_0x6564('0xc')](_0x4a394c,_0x592e2f)[_0x6564('0xd')](function(_0x59f832){logger['info'](_0x6564('0xe'),_0x1bae75,_0x6564('0xf'));logger['debug'](_0x6564('0x10'),_0x1bae75,_0x6564('0xf'),JSON[_0x6564('0x11')](_0x59f832));if(_0x59f832[_0x6564('0x12')]){if(_0x59f832[_0x6564('0x12')][_0x6564('0x13')]===0x1f4){logger[_0x6564('0x12')](_0x6564('0xe'),_0x1bae75,_0x59f832[_0x6564('0x12')]['message']);return _0x40cec9(_0x59f832[_0x6564('0x12')][_0x6564('0x14')]);}logger[_0x6564('0x12')]('SmsMessage,\x20%s,\x20%s',_0x1bae75,_0x59f832[_0x6564('0x12')][_0x6564('0x14')]);return _0x44f8b6(_0x59f832[_0x6564('0x12')][_0x6564('0x14')]);}else{logger[_0x6564('0x15')]('SmsMessage,\x20%s,\x20%s',_0x1bae75,_0x6564('0xf'));_0x44f8b6(_0x59f832[_0x6564('0x16')][_0x6564('0x14')]);}})['catch'](function(_0x3b9205){logger[_0x6564('0x12')](_0x6564('0xe'),_0x1bae75,_0x3b9205);_0x40cec9(_0x3b9205);});});}exports[_0x6564('0x17')]=function(_0x1a2984){var _0x4a5e4e=this;return new Promise(function(_0x5f3e6d,_0x4a462c){return db['SmsMessage'][_0x6564('0x18')](_0x1a2984[_0x6564('0x19')],{'raw':_0x1a2984[_0x6564('0x1a')]?_0x1a2984[_0x6564('0x1a')][_0x6564('0x1b')]===undefined?!![]:![]:!![]})[_0x6564('0xd')](function(_0x10001b){logger['info']('CreateSmsMessage',_0x1a2984);logger[_0x6564('0x1c')](_0x6564('0x17'),_0x1a2984,JSON[_0x6564('0x11')](_0x10001b));_0x5f3e6d(_0x10001b);})[_0x6564('0x1d')](function(_0x4e5241){logger['error'](_0x6564('0x17'),_0x4e5241['message'],_0x1a2984);_0x4a462c(_0x4a5e4e[_0x6564('0x12')](0x1f4,_0x4e5241[_0x6564('0x14')]));});});}; \ No newline at end of file +var _0xb7b1=['localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','stringify','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x1183eb,_0x33551b){var _0x287f8f=function(_0x4778ba){while(--_0x4778ba){_0x1183eb['push'](_0x1183eb['shift']());}};_0x287f8f(++_0x33551b);}(_0xb7b1,0xaf));var _0x1b7b=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xb7b1[_0x1a7846];return _0x48049;};'use strict';var _=require('lodash');var util=require(_0x1b7b('0x0'));var moment=require(_0x1b7b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b7b('0x2'));var db=require(_0x1b7b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b7b('0x4'))(_0x1b7b('0x5'));var config=require(_0x1b7b('0x6'));var jayson=require(_0x1b7b('0x7'));var client=jayson['client'][_0x1b7b('0x8')]({'port':0x232a});config[_0x1b7b('0x9')]=_[_0x1b7b('0xa')](config[_0x1b7b('0x9')],{'host':_0x1b7b('0xb'),'port':0x18eb});var socket=require(_0x1b7b('0xc'))(new Redis(config[_0x1b7b('0x9')]));require('./smsMessage.socket')[_0x1b7b('0xd')](socket);function respondWithRpcPromise(_0x8224bc,_0x3384cf,_0x34506a){return new BPromise(function(_0x2025cc,_0x16ab93){return client[_0x1b7b('0xe')](_0x8224bc,_0x34506a)[_0x1b7b('0xf')](function(_0x33d2c1){logger[_0x1b7b('0x10')](_0x1b7b('0x11'),_0x3384cf,_0x1b7b('0x12'));logger[_0x1b7b('0x13')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3384cf,_0x1b7b('0x12'),JSON['stringify'](_0x33d2c1));if(_0x33d2c1[_0x1b7b('0x14')]){if(_0x33d2c1[_0x1b7b('0x14')]['code']===0x1f4){logger[_0x1b7b('0x14')](_0x1b7b('0x11'),_0x3384cf,_0x33d2c1[_0x1b7b('0x14')][_0x1b7b('0x15')]);return _0x16ab93(_0x33d2c1[_0x1b7b('0x14')][_0x1b7b('0x15')]);}logger[_0x1b7b('0x14')](_0x1b7b('0x11'),_0x3384cf,_0x33d2c1['error']['message']);return _0x2025cc(_0x33d2c1[_0x1b7b('0x14')][_0x1b7b('0x15')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x3384cf,_0x1b7b('0x12'));_0x2025cc(_0x33d2c1[_0x1b7b('0x16')][_0x1b7b('0x15')]);}})[_0x1b7b('0x17')](function(_0x181f16){logger['error'](_0x1b7b('0x11'),_0x3384cf,_0x181f16);_0x16ab93(_0x181f16);});});}exports['CreateSmsMessage']=function(_0x5b6e3d){var _0x5556ea=this;return new Promise(function(_0x231d08,_0x336f00){return db[_0x1b7b('0x18')][_0x1b7b('0x19')](_0x5b6e3d[_0x1b7b('0x1a')],{'raw':_0x5b6e3d[_0x1b7b('0x1b')]?_0x5b6e3d[_0x1b7b('0x1b')][_0x1b7b('0x1c')]===undefined?!![]:![]:!![]})[_0x1b7b('0xf')](function(_0x2fe51b){logger[_0x1b7b('0x10')]('CreateSmsMessage',_0x5b6e3d);logger[_0x1b7b('0x13')](_0x1b7b('0x1d'),_0x5b6e3d,JSON[_0x1b7b('0x1e')](_0x2fe51b));_0x231d08(_0x2fe51b);})[_0x1b7b('0x17')](function(_0x2c48af){logger[_0x1b7b('0x14')](_0x1b7b('0x1d'),_0x2c48af[_0x1b7b('0x15')],_0x5b6e3d);_0x336f00(_0x5556ea[_0x1b7b('0x14')](0x1f4,_0x2c48af[_0x1b7b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 105b118..da8bf32 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 _0xe5b3=['remove','update','register','length','smsMessage:','save'];(function(_0xa30766,_0x6f613e){var _0x24e780=function(_0x3d58fb){while(--_0x3d58fb){_0xa30766['push'](_0xa30766['shift']());}};_0x24e780(++_0x6f613e);}(_0xe5b3,0x191));var _0x3e5b=function(_0x1abf5d,_0x13d485){_0x1abf5d=_0x1abf5d-0x0;var _0x1800bc=_0xe5b3[_0x1abf5d];return _0x1800bc;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x3e5b('0x0'),_0x3e5b('0x1'),_0x3e5b('0x2')];function createListener(_0x55e4c3,_0x13307e){return function(_0xe3a9e4){_0x13307e['emit'](_0x55e4c3,_0xe3a9e4);};}function removeListener(_0x522fd9,_0xf28968){return function(){SmsMessageEvents['removeListener'](_0x522fd9,_0xf28968);};}exports[_0x3e5b('0x3')]=function(_0x2241c6){for(var _0x1ee66e=0x0,_0x586d7e=events[_0x3e5b('0x4')];_0x1ee66e<_0x586d7e;_0x1ee66e++){var _0x1e235c=events[_0x1ee66e];var _0x385162=createListener(_0x3e5b('0x5')+_0x1e235c,_0x2241c6);SmsMessageEvents['on'](_0x1e235c,_0x385162);}}; \ No newline at end of file +var _0x5a35=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x408dca,_0x3bbf24){var _0x52922a=function(_0xc6ff03){while(--_0xc6ff03){_0x408dca['push'](_0x408dca['shift']());}};_0x52922a(++_0x3bbf24);}(_0x5a35,0x1c7));var _0x55a3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a35[_0x321bb2];return _0x9c12ed;};'use strict';var SmsMessageEvents=require(_0x55a3('0x0'));var events=['save',_0x55a3('0x1'),_0x55a3('0x2')];function createListener(_0x57805f,_0x131656){return function(_0x2077f3){_0x131656[_0x55a3('0x3')](_0x57805f,_0x2077f3);};}function removeListener(_0x489e53,_0x28437f){return function(){SmsMessageEvents[_0x55a3('0x4')](_0x489e53,_0x28437f);};}exports[_0x55a3('0x5')]=function(_0x30fcc7){for(var _0x360b45=0x0,_0x313167=events[_0x55a3('0x6')];_0x360b45<_0x313167;_0x360b45++){var _0x44955d=events[_0x360b45];var _0x5d4cdc=createListener(_0x55a3('0x7')+_0x44955d,_0x30fcc7);SmsMessageEvents['on'](_0x44955d,_0x5d4cdc);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index b5f2bb2..cff1afb 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 _0xa28b=['Router','fs-extra','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','/:id/users','getAgents','post','create','destroy','delete','removeAgents','multer','util','path','connect-timeout'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0xa28b,0x1dc));var _0xba28=function(_0x38be70,_0x1b6859){_0x38be70=_0x38be70-0x0;var _0x2871d6=_0xa28b[_0x38be70];return _0x2871d6;};'use strict';var multer=require(_0xba28('0x0'));var util=require(_0xba28('0x1'));var path=require(_0xba28('0x2'));var timeout=require(_0xba28('0x3'));var express=require('express');var router=express[_0xba28('0x4')]();var fs_extra=require(_0xba28('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba28('0x6'));var controller=require(_0xba28('0x7'));router[_0xba28('0x8')]('/',auth[_0xba28('0x9')](),controller[_0xba28('0xa')]);router['get'](_0xba28('0xb'),auth['isAuthenticated'](),controller[_0xba28('0xc')]);router['get'](_0xba28('0xd'),auth['isAuthenticated'](),controller[_0xba28('0xe')]);router[_0xba28('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0xba28('0xf')]);router[_0xba28('0x8')](_0xba28('0x10'),auth[_0xba28('0x9')](),controller['getTeams']);router[_0xba28('0x8')](_0xba28('0x11'),auth['isAuthenticated'](),controller[_0xba28('0x12')]);router[_0xba28('0x13')]('/',auth['isAuthenticated'](),controller[_0xba28('0x14')]);router[_0xba28('0x13')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0xba28('0x13')](_0xba28('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xba28('0xd'),auth[_0xba28('0x9')](),controller['update']);router['delete']('/:id',auth[_0xba28('0x9')](),controller[_0xba28('0x15')]);router[_0xba28('0x16')](_0xba28('0x10'),auth[_0xba28('0x9')](),controller['removeTeams']);router[_0xba28('0x16')](_0xba28('0x11'),auth[_0xba28('0x9')](),controller[_0xba28('0x17')]);module['exports']=router; \ No newline at end of file +var _0xb879=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0xb879,0x15d));var _0x9b87=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xb879[_0x422905];return _0x33dc6c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b87('0x0'));var timeout=require(_0x9b87('0x1'));var express=require(_0x9b87('0x2'));var router=express[_0x9b87('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b87('0x4'));var interaction=require(_0x9b87('0x5'));var config=require(_0x9b87('0x6'));var controller=require(_0x9b87('0x7'));router['get']('/',auth[_0x9b87('0x8')](),controller[_0x9b87('0x9')]);router[_0x9b87('0xa')](_0x9b87('0xb'),auth[_0x9b87('0x8')](),controller[_0x9b87('0xc')]);router['get'](_0x9b87('0xd'),auth[_0x9b87('0x8')](),controller[_0x9b87('0xe')]);router[_0x9b87('0xa')]('/:id/members',auth[_0x9b87('0x8')](),controller[_0x9b87('0xf')]);router[_0x9b87('0xa')](_0x9b87('0x10'),auth[_0x9b87('0x8')](),controller[_0x9b87('0x11')]);router[_0x9b87('0xa')](_0x9b87('0x12'),auth[_0x9b87('0x8')](),controller[_0x9b87('0x13')]);router[_0x9b87('0x14')]('/',auth['isAuthenticated'](),controller[_0x9b87('0x15')]);router[_0x9b87('0x14')](_0x9b87('0x10'),auth['isAuthenticated'](),controller[_0x9b87('0x16')]);router[_0x9b87('0x14')](_0x9b87('0x12'),auth['isAuthenticated'](),controller[_0x9b87('0x17')]);router['put'](_0x9b87('0xd'),auth['isAuthenticated'](),controller[_0x9b87('0x18')]);router[_0x9b87('0x19')](_0x9b87('0xd'),auth[_0x9b87('0x8')](),controller['destroy']);router[_0x9b87('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x9b87('0x1a')]);router[_0x9b87('0x19')]('/:id/users',auth[_0x9b87('0x8')](),controller[_0x9b87('0x1b')]);module[_0x9b87('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 52bf7d5..6d95549 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 _0x8508=['INTEGER','ENUM','rrmemory','sequelize','exports','STRING','name'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x8508,0xc7));var _0x8850=function(_0x1135fe,_0x2405de){_0x1135fe=_0x1135fe-0x0;var _0xfe6ab=_0x8508[_0x1135fe];return _0xfe6ab;};'use strict';var Sequelize=require(_0x8850('0x0'));module[_0x8850('0x1')]={'name':{'type':Sequelize[_0x8850('0x2')],'unique':_0x8850('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8850('0x2')]},'timeout':{'type':Sequelize[_0x8850('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8850('0x5')](_0x8850('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0xc2c2=['sequelize','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x11309c,_0xe18a74){var _0x3fea9c=function(_0xeb11c3){while(--_0xeb11c3){_0x11309c['push'](_0x11309c['shift']());}};_0x3fea9c(++_0xe18a74);}(_0xc2c2,0x198));var _0x2c2c=function(_0x2f0a6a,_0xe1e4d7){_0x2f0a6a=_0x2f0a6a-0x0;var _0xbacf5c=_0xc2c2[_0x2f0a6a];return _0xbacf5c;};'use strict';var Sequelize=require(_0x2c2c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2c2c('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2c2c('0x1')]},'timeout':{'type':Sequelize[_0x2c2c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2c2c('0x3')](_0x2c2c('0x4'),_0x2c2c('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index da63474..b405682 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 _0x2032=['offset','limit','set','Content-Range','json','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','show','keys','filters','intersection','attributes','model','fields','options','find','catch','body','user','UserProfileSection','autoAssociation','params','describe','findOne','UserSmsQueue','hasOwnProperty','order','sort','SmsQueueId','filter','merge','findAll','User','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','length','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','emit','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','count'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x2032,0xd9));var _0x2203=function(_0x473a62,_0x3f2d4d){_0x473a62=_0x473a62-0x0;var _0x367777=_0x2032[_0x473a62];return _0x367777;};'use strict';var BPromise=require('bluebird');var util=require(_0x2203('0x0'));var _=require(_0x2203('0x1'));var squel=require(_0x2203('0x2'));var Redis=require('ioredis');var qs=require(_0x2203('0x3'));var logger=require(_0x2203('0x4'))('api');var config=require(_0x2203('0x5'));var db=require(_0x2203('0x6'))['db'];config[_0x2203('0x7')]=_[_0x2203('0x8')](config[_0x2203('0x7')],{'host':_0x2203('0x9'),'port':0x18eb});var socket=require(_0x2203('0xa'))(new Redis(config[_0x2203('0x7')]));require(_0x2203('0xb'))[_0x2203('0xc')](socket);function respondWithStatusCode(_0x2999ed,_0x5ecf9e){_0x5ecf9e=_0x5ecf9e||0xcc;return function(_0x526ae0){if(_0x526ae0){return _0x2999ed[_0x2203('0xd')](_0x5ecf9e);}return _0x2999ed['status'](_0x5ecf9e)[_0x2203('0xe')]();};}function respondWithResult(_0x2972f3,_0x6339c4){_0x6339c4=_0x6339c4||0xc8;return function(_0x5b19df){if(_0x5b19df){return _0x2972f3[_0x2203('0xf')](_0x6339c4)['json'](_0x5b19df);}};}function respondWithFilteredResult(_0x3f690a,_0x4b73be){return function(_0x297459){if(_0x297459){var _0x1abb51=typeof _0x4b73be['offset']==='undefined'&&typeof _0x4b73be['limit']==='undefined';var _0x4bad7c=_0x297459[_0x2203('0x10')];var _0x538b30=_0x1abb51?0x0:_0x4b73be['offset'];var _0x21a3af=_0x1abb51?_0x297459[_0x2203('0x10')]:_0x4b73be[_0x2203('0x11')]+_0x4b73be[_0x2203('0x12')];var _0x226209;if(_0x21a3af>=_0x4bad7c){_0x21a3af=_0x4bad7c;_0x226209=0xc8;}else{_0x226209=0xce;}_0x3f690a[_0x2203('0xf')](_0x226209);return _0x3f690a[_0x2203('0x13')](_0x2203('0x14'),_0x538b30+'-'+_0x21a3af+'/'+_0x4bad7c)[_0x2203('0x15')](_0x297459);}return null;};}function saveUpdates(_0x3053f3){return function(_0x5129fb){if(_0x5129fb){return _0x5129fb[_0x2203('0x16')](_0x3053f3)[_0x2203('0x17')](function(_0x4893ff){return _0x4893ff;});}return null;};}function removeEntity(_0x3f9ef6){return function(_0x8906e1){if(_0x8906e1){return _0x8906e1['destroy']()[_0x2203('0x17')](function(){var _0x5ee83c=_0x8906e1[_0x2203('0x18')]({'plain':!![]});var _0x310b8c=_0x2203('0x19');return db[_0x2203('0x1a')][_0x2203('0x1b')]({'where':{'type':_0x310b8c,'resourceId':_0x5ee83c['id']}})[_0x2203('0x17')](function(){return _0x8906e1;});})['then'](function(){_0x3f9ef6[_0x2203('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac866){return function(_0x15f543){if(!_0x15f543){_0x5ac866['sendStatus'](0x194);}return _0x15f543;};}function handleError(_0x3b8ef9,_0x5bfe61){_0x5bfe61=_0x5bfe61||0x1f4;return function(_0x5d4c4e){logger[_0x2203('0x1c')](_0x5d4c4e['stack']);if(_0x5d4c4e['name']){delete _0x5d4c4e[_0x2203('0x1d')];}_0x3b8ef9[_0x2203('0xf')](_0x5bfe61)[_0x2203('0x1e')](_0x5d4c4e);};}exports[_0x2203('0x1f')]=function(_0x1244f4,_0x3114ef){var _0x49c12={};var _0x250349={'count':0x0,'rows':[]};var _0x576378=_[_0x2203('0x20')](db[_0x2203('0x21')][_0x2203('0x22')],function(_0x5f11bf){return{'name':_0x5f11bf[_0x2203('0x23')],'type':_0x5f11bf[_0x2203('0x24')]['key']};});_0x49c12=qs[_0x2203('0x25')](_0x576378,_0x1244f4);var _0xd91f5d={'where':_0x49c12[_0x2203('0x26')]};return db[_0x2203('0x21')][_0x2203('0x10')](_0xd91f5d)[_0x2203('0x17')](function(_0x9c53f){_0x250349['count']=_0x9c53f;_0x49c12[_0x2203('0x27')]=qs[_0x2203('0x27')](_0x1244f4[_0x2203('0x28')]);return db[_0x2203('0x21')]['findAll'](_0x49c12);})[_0x2203('0x17')](function(_0x21ff0d){_0x250349[_0x2203('0x29')]=_0x21ff0d;return _0x250349;})[_0x2203('0x17')](respondWithFilteredResult(_0x3114ef,_0x49c12))['catch'](handleError(_0x3114ef,null));};exports[_0x2203('0x2a')]=function(_0x50aa17,_0x5e6560){var _0x5c0157={'raw':!![],'where':{'id':_0x50aa17['params']['id']}},_0x1d5f74={};_0x1d5f74['model']=_[_0x2203('0x2b')](db[_0x2203('0x21')][_0x2203('0x22')]);_0x1d5f74[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x50aa17['query']);_0x1d5f74[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x1d5f74['model'],_0x1d5f74[_0x2203('0x28')]);_0x5c0157[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0x1d5f74[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x50aa17[_0x2203('0x28')][_0x2203('0x30')]));_0x5c0157[_0x2203('0x2e')]=_0x5c0157[_0x2203('0x2e')]['length']?_0x5c0157[_0x2203('0x2e')]:_0x1d5f74[_0x2203('0x2f')];if(_0x50aa17['query']['includeAll']){_0x5c0157[_0x2203('0x27')]=[{'all':!![]}];}_0x5c0157=_['merge']({},_0x5c0157,_0x50aa17[_0x2203('0x31')]);return db[_0x2203('0x21')][_0x2203('0x32')](_0x5c0157)['then'](handleEntityNotFound(_0x5e6560,null))['then'](respondWithResult(_0x5e6560,null))[_0x2203('0x33')](handleError(_0x5e6560,null));};exports['create']=function(_0x2d0365,_0x5cfe5e){return db[_0x2203('0x21')]['create'](_0x2d0365[_0x2203('0x34')],{})[_0x2203('0x17')](function(_0x4311d1){var _0x40a793=_0x2d0365[_0x2203('0x35')]['get']({'plain':!![]});if(!_0x40a793)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a793['role']===_0x2203('0x35')){var _0x25a2dc=_0x4311d1[_0x2203('0x18')]({'plain':!![]});var _0x3b0c7a=_0x2203('0x19');return db[_0x2203('0x36')][_0x2203('0x32')]({'where':{'name':_0x3b0c7a,'userProfileId':_0x40a793['userProfileId']},'raw':!![]})[_0x2203('0x17')](function(_0x1b12c3){if(_0x1b12c3&&_0x1b12c3[_0x2203('0x37')]===0x0){return db[_0x2203('0x1a')]['create']({'name':_0x25a2dc['name'],'resourceId':_0x25a2dc['id'],'type':_0x1b12c3[_0x2203('0x1d')],'sectionId':_0x1b12c3['id']},{})['then'](function(){return _0x4311d1;});}else{return _0x4311d1;}})[_0x2203('0x33')](function(_0x446209){logger[_0x2203('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446209);throw _0x446209;});}return _0x4311d1;})['then'](respondWithResult(_0x5cfe5e,0xc9))[_0x2203('0x33')](handleError(_0x5cfe5e,null));};exports[_0x2203('0x16')]=function(_0x368444,_0x1e09f3){if(_0x368444[_0x2203('0x34')]['id']){delete _0x368444[_0x2203('0x34')]['id'];}return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x368444[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e09f3,null))[_0x2203('0x17')](saveUpdates(_0x368444[_0x2203('0x34')],null))[_0x2203('0x17')](respondWithResult(_0x1e09f3,null))[_0x2203('0x33')](handleError(_0x1e09f3,null));};exports[_0x2203('0x1b')]=function(_0x36b8e4,_0x1e34a0){return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x36b8e4[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e34a0,null))[_0x2203('0x17')](removeEntity(_0x1e34a0,null))['catch'](handleError(_0x1e34a0,null));};exports['describe']=function(_0x1c6661,_0x48129c){return db[_0x2203('0x21')][_0x2203('0x39')]()[_0x2203('0x17')](respondWithResult(_0x48129c,null))[_0x2203('0x33')](handleError(_0x48129c,null));};exports['getMembers']=function(_0x289146,_0x102803){var _0x5cd8c6={'raw':!![],'where':{}},_0x29bd91={},_0x381b3e;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x289146['params']['id']}})['then'](handleEntityNotFound(_0x102803,null))[_0x2203('0x17')](function(_0x5707c8){if(_0x5707c8){_0x381b3e=_0x5707c8['get']({'plain':!![]});_0x29bd91[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x3b')]['rawAttributes']);_0x29bd91['query']=_[_0x2203('0x2b')](_0x289146[_0x2203('0x28')]);_0x29bd91[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x29bd91[_0x2203('0x2f')],_0x29bd91[_0x2203('0x28')]);_0x5cd8c6['attributes']=_[_0x2203('0x2d')](_0x29bd91['model'],qs[_0x2203('0x30')](_0x289146[_0x2203('0x28')][_0x2203('0x30')]));_0x5cd8c6[_0x2203('0x2e')]=_0x5cd8c6['attributes']['length']?_0x5cd8c6[_0x2203('0x2e')]:_0x29bd91[_0x2203('0x2f')];if(!_0x289146[_0x2203('0x28')][_0x2203('0x3c')]('nolimit')){_0x5cd8c6['limit']=qs['limit'](_0x289146[_0x2203('0x28')][_0x2203('0x12')]);_0x5cd8c6['offset']=qs[_0x2203('0x11')](_0x289146[_0x2203('0x28')]['offset']);}_0x5cd8c6[_0x2203('0x3d')]=qs[_0x2203('0x3e')](_0x289146[_0x2203('0x28')][_0x2203('0x3e')]);_0x5cd8c6['where']=qs[_0x2203('0x2c')](_['pick'](_0x289146[_0x2203('0x28')],_0x29bd91[_0x2203('0x2c')]));_0x5cd8c6['where'][_0x2203('0x3f')]=_0x5707c8['id'];if(_0x289146[_0x2203('0x28')][_0x2203('0x40')]){_0x5cd8c6[_0x2203('0x26')]=_[_0x2203('0x41')](_0x5cd8c6[_0x2203('0x26')],{'$or':_['map'](_0x5cd8c6['attributes'],function(_0x2f2537){var _0x524356={};_0x524356[_0x2f2537]={'$like':'%'+_0x289146['query'][_0x2203('0x40')]+'%'};return _0x524356;})});}_0x5cd8c6=_[_0x2203('0x41')]({},_0x5cd8c6,_0x289146[_0x2203('0x31')]);return db['UserSmsQueue'][_0x2203('0x42')](_0x5cd8c6);}})['then'](function(_0x5ddf9e){if(_0x5ddf9e){return db[_0x2203('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x5ddf9e,'UserId'),'role':_0x2203('0x44')},'attributes':['id',_0x2203('0x1d'),_0x2203('0x45'),_0x2203('0x46'),_0x2203('0x47')]});}})[_0x2203('0x17')](function(_0x2baea2){if(_0x2baea2){return{'count':_0x2baea2[_0x2203('0x10')],'rows':_[_0x2203('0x20')](_0x2baea2[_0x2203('0x29')],function(_0x384a59){return{'membername':_0x384a59[_0x2203('0x1d')],'UserId':_0x384a59['id'],'queue_name':_0x381b3e['name'],'SmsQueueId':_0x381b3e['id'],'interface':util['format'](_0x2203('0x48'),_0x2203('0x49'),_0x384a59[_0x2203('0x1d')]),'penalty':0x0,'paused':_0x384a59[_0x2203('0x45')],'createdAt':_0x384a59[_0x2203('0x47')],'updatedAt':_0x384a59[_0x2203('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x102803,_0x5cd8c6))['catch'](handleError(_0x102803,null));};exports[_0x2203('0x4a')]=function(_0x34358e,_0x21ee59){var _0x1e6d21={};var _0xcab922={};var _0x7b0b9c;var _0x133d22;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x34358e[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x21ee59,null))['then'](function(_0x1ea97a){if(_0x1ea97a){_0x7b0b9c=_0x1ea97a;_0xcab922[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x4b')][_0x2203('0x22')]);_0xcab922[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x34358e[_0x2203('0x28')]);_0xcab922[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],_0xcab922[_0x2203('0x28')]);_0x1e6d21[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x34358e[_0x2203('0x28')][_0x2203('0x30')]));_0x1e6d21[_0x2203('0x2e')]=_0x1e6d21[_0x2203('0x2e')]['length']?_0x1e6d21[_0x2203('0x2e')]:_0xcab922[_0x2203('0x2f')];_0x1e6d21[_0x2203('0x3d')]=qs['sort'](_0x34358e[_0x2203('0x28')][_0x2203('0x3e')]);_0x1e6d21[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x34358e['query'],_0xcab922[_0x2203('0x2c')]));if(_0x34358e[_0x2203('0x28')][_0x2203('0x40')]){_0x1e6d21['where']=_['merge'](_0x1e6d21['where'],{'$or':_['map'](_0x1e6d21['attributes'],function(_0x418d48){var _0xbc9f88={};_0xbc9f88[_0x418d48]={'$like':'%'+_0x34358e[_0x2203('0x28')][_0x2203('0x40')]+'%'};return _0xbc9f88;})});}_0x1e6d21=_[_0x2203('0x41')]({},_0x1e6d21,_0x34358e[_0x2203('0x31')]);return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0x56dcbe){if(_0x56dcbe){_0x133d22=_0x56dcbe['length'];if(!_0x34358e[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x1e6d21[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x34358e[_0x2203('0x28')][_0x2203('0x12')]);_0x1e6d21[_0x2203('0x11')]=qs[_0x2203('0x11')](_0x34358e[_0x2203('0x28')][_0x2203('0x11')]);}return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0xae45a5){if(_0xae45a5){return _0xae45a5?{'count':_0x133d22,'rows':_0xae45a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x21ee59,null))[_0x2203('0x33')](handleError(_0x21ee59,null));};exports[_0x2203('0x4e')]=function(_0x173ac1,_0xa15021){var _0x4b2e4f=_0x173ac1[_0x2203('0x34')]['ids'];return db[_0x2203('0x4b')]['findAll']({'where':{'id':_0x4b2e4f},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':_0x2203('0x4f'),'attributes':['id',_0x2203('0x1d'),_0x2203('0x50'),_0x2203('0x51'),_0x2203('0x52')],'raw':!![]}]})[_0x2203('0x17')](function(_0x2eab08){if(_0x2eab08){var _0x4e9a01=_['flatMap'](_0x2eab08,function(_0x38903b){var _0x34593a=_0x38903b[_0x2203('0x18')]({'plain':!![]});return _0x34593a['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x173ac1[_0x2203('0x38')]['id']}})[_0x2203('0x17')](function(_0x20385b){return db[_0x2203('0x53')]['transaction'](function(_0x2f7850){return _0x20385b['addTeams'](_0x4b2e4f,{'transaction':_0x2f7850})[_0x2203('0x17')](function(){return BPromise[_0x2203('0x54')](_0x4e9a01,function(_0xe3bee5){return db[_0x2203('0x3b')][_0x2203('0x55')]({'where':{'UserId':_0xe3bee5['id'],'SmsQueueId':_0x173ac1['params']['id']},'transaction':_0x2f7850});});})[_0x2203('0x17')](function(){_0x4e9a01[_0x2203('0x56')](function(_0x18663f){socket['emit'](_0x2203('0x57'),{'UserId':_0x18663f['id'],'SmsQueueId':_0x20385b['id']});});});});});}})[_0x2203('0x17')](respondWithStatusCode(_0xa15021,null))[_0x2203('0x33')](handleError(_0xa15021,null));};exports[_0x2203('0x58')]=function(_0x1c65f9,_0x4356fe){return db[_0x2203('0x4b')][_0x2203('0x42')]({'where':{'id':_0x1c65f9[_0x2203('0x28')][_0x2203('0x59')]},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2203('0x17')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x17')](function(_0x21b755){var _0x2da37c=_[_0x2203('0x20')](_0x21b755,'id');var _0x52c35e=[];var _0x23f7b1=[];var _0x2a5a4b=squel[_0x2203('0x5a')]();_0x2a5a4b[_0x2203('0x5b')](_0x2203('0x5c'))[_0x2203('0x5d')]('team_has_sms_queues','tq')['join'](_0x2203('0x5e'),'ut',_0x2203('0x5f'))[_0x2203('0x26')](_0x2203('0x60'),_0x1c65f9[_0x2203('0x38')]['id']);for(var _0x4fd029=0x0;_0x4fd029<_0x21b755[_0x2203('0x61')];_0x4fd029+=0x1){let _0x3cb792=_0x21b755[_0x4fd029];for(var _0x4e539b=0x0;_0x4e539b<_0x3cb792['Agents']['length'];_0x4e539b+=0x1){let _0x4fc51a=_0x3cb792['Agents'][_0x4e539b];var _0x2952fc=_0x2a5a4b[_0x2203('0x62')]();_0x2952fc[_0x2203('0x26')]('ut.UserId\x20=\x20?',_0x4fc51a['id']);_0x23f7b1['push'](db['sequelize'][_0x2203('0x28')](_0x2952fc[_0x2203('0x63')](),{'type':db[_0x2203('0x53')][_0x2203('0x64')][_0x2203('0x65')]})[_0x2203('0x17')](function(_0x3d1797){if(_0x3d1797['length']===0x1){return _0x4fc51a['id'];}else{var _0x3bf2c9=_[_0x2203('0x66')](_[_0x2203('0x20')](_0x3d1797,_0x2203('0x67')),function(_0x35ff6b){return _[_0x2203('0x68')](_0x2da37c,_0x35ff6b);});if(_0x3bf2c9){return _0x4fc51a['id'];}}}));}}return BPromise[_0x2203('0x69')](_0x23f7b1)['then'](function(_0x188722){_0x52c35e=_(_0x52c35e)['union'](_0x188722)['compact']()[_0x2203('0x6a')]();return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x1c65f9[_0x2203('0x38')]['id']}})['then'](function(_0x29d545){return db[_0x2203('0x53')][_0x2203('0x6b')](function(_0x461f90){return _0x29d545[_0x2203('0x58')](_0x1c65f9[_0x2203('0x28')]['ids'],{'transaction':_0x461f90})[_0x2203('0x17')](function(){if(!_[_0x2203('0x6c')](_0x52c35e)){return _0x29d545['removeAgents'](_0x52c35e,{'transaction':_0x461f90});}})['then'](function(){_0x52c35e[_0x2203('0x56')](function(_0x3fe71b){socket[_0x2203('0x6d')](_0x2203('0x6e'),{'UserId':_0x3fe71b,'SmsQueueId':_0x29d545['id']});});});});});});})[_0x2203('0x17')](respondWithStatusCode(_0x4356fe,null))[_0x2203('0x33')](handleError(_0x4356fe,null));};exports[_0x2203('0x6f')]=function(_0x3c41bf,_0x4749df){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x3c41bf[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x4749df,null))[_0x2203('0x17')](function(_0x7589a7){if(_0x7589a7){return _0x7589a7[_0x2203('0x6f')](_0x3c41bf['body']['ids'],_[_0x2203('0x70')](_0x3c41bf[_0x2203('0x34')],['ids','id'])||{})[_0x2203('0x71')](function(_0x447a95){for(var _0x5b5e95=0x0;_0x5b5e95<_0x3c41bf[_0x2203('0x34')][_0x2203('0x59')]['length'];_0x5b5e95+=0x1){socket[_0x2203('0x6d')](_0x2203('0x57'),{'UserId':Number(_0x3c41bf['body'][_0x2203('0x59')][_0x5b5e95]),'SmsQueueId':Number(_0x3c41bf[_0x2203('0x38')]['id'])});}return _0x447a95;});}})[_0x2203('0x17')](respondWithResult(_0x4749df,null))[_0x2203('0x33')](handleError(_0x4749df,null));};exports['removeAgents']=function(_0x511c66,_0x2df837){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x511c66['params']['id']}})['then'](handleEntityNotFound(_0x2df837,null))[_0x2203('0x17')](function(_0x199bec){if(_0x199bec){return _0x199bec[_0x2203('0x72')](_0x511c66['query']['ids'])[_0x2203('0x17')](function(){if(_[_0x2203('0x73')](_0x511c66['query'][_0x2203('0x59')])){for(var _0x2de64d=0x0;_0x2de64d<_0x511c66['query'][_0x2203('0x59')]['length'];_0x2de64d+=0x1){socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66['query']['ids'][_0x2de64d]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}}else{socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66[_0x2203('0x28')][_0x2203('0x59')]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x2df837,null))[_0x2203('0x33')](handleError(_0x2df837,null));};exports['getAgents']=function(_0x3f31e0,_0x3edb38){var _0x486563={};var _0x4358c1={};var _0x4096f4;var _0x5bd4e4;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x3f31e0[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x3edb38,null))[_0x2203('0x17')](function(_0x5d73a7){if(_0x5d73a7){_0x4096f4=_0x5d73a7;_0x4358c1[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x43')][_0x2203('0x22')]);_0x4358c1[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x3f31e0['query']);_0x4358c1[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x4358c1['model'],_0x4358c1[_0x2203('0x28')]);_0x486563['attributes']=_[_0x2203('0x2d')](_0x4358c1[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x3f31e0['query'][_0x2203('0x30')]));_0x486563[_0x2203('0x2e')]=_0x486563[_0x2203('0x2e')][_0x2203('0x61')]?_0x486563[_0x2203('0x2e')]:_0x4358c1[_0x2203('0x2f')];_0x486563[_0x2203('0x3d')]=qs['sort'](_0x3f31e0['query'][_0x2203('0x3e')]);_0x486563[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x3f31e0[_0x2203('0x28')],_0x4358c1[_0x2203('0x2c')]));if(_0x3f31e0[_0x2203('0x28')]['filter']){_0x486563[_0x2203('0x26')]=_[_0x2203('0x41')](_0x486563['where'],{'$or':_[_0x2203('0x20')](_0x486563['attributes'],function(_0xc3dac5){var _0xbd1866={};_0xbd1866[_0xc3dac5]={'$like':'%'+_0x3f31e0['query'][_0x2203('0x40')]+'%'};return _0xbd1866;})});}_0x486563=_[_0x2203('0x41')]({},_0x486563,_0x3f31e0[_0x2203('0x31')]);return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x36ab7f){if(_0x36ab7f){_0x5bd4e4=_0x36ab7f[_0x2203('0x61')];if(!_0x3f31e0[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x486563[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x3f31e0['query'][_0x2203('0x12')]);_0x486563['offset']=qs[_0x2203('0x11')](_0x3f31e0[_0x2203('0x28')][_0x2203('0x11')]);}return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x2159a5){if(_0x2159a5){return _0x2159a5?{'count':_0x5bd4e4,'rows':_0x2159a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x3edb38,null))[_0x2203('0x33')](handleError(_0x3edb38,null));}; \ No newline at end of file +var _0x2032=['offset','limit','set','Content-Range','json','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','show','keys','filters','intersection','attributes','model','fields','options','find','catch','body','user','UserProfileSection','autoAssociation','params','describe','findOne','UserSmsQueue','hasOwnProperty','order','sort','SmsQueueId','filter','merge','findAll','User','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','length','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','emit','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','count'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x2032,0xd9));var _0x2203=function(_0x12578e,_0x2d64ce){_0x12578e=_0x12578e-0x0;var _0x55d094=_0x2032[_0x12578e];return _0x55d094;};'use strict';var BPromise=require('bluebird');var util=require(_0x2203('0x0'));var _=require(_0x2203('0x1'));var squel=require(_0x2203('0x2'));var Redis=require('ioredis');var qs=require(_0x2203('0x3'));var logger=require(_0x2203('0x4'))('api');var config=require(_0x2203('0x5'));var db=require(_0x2203('0x6'))['db'];config[_0x2203('0x7')]=_[_0x2203('0x8')](config[_0x2203('0x7')],{'host':_0x2203('0x9'),'port':0x18eb});var socket=require(_0x2203('0xa'))(new Redis(config[_0x2203('0x7')]));require(_0x2203('0xb'))[_0x2203('0xc')](socket);function respondWithStatusCode(_0x2999ed,_0x5ecf9e){_0x5ecf9e=_0x5ecf9e||0xcc;return function(_0x526ae0){if(_0x526ae0){return _0x2999ed[_0x2203('0xd')](_0x5ecf9e);}return _0x2999ed['status'](_0x5ecf9e)[_0x2203('0xe')]();};}function respondWithResult(_0x2972f3,_0x6339c4){_0x6339c4=_0x6339c4||0xc8;return function(_0x5b19df){if(_0x5b19df){return _0x2972f3[_0x2203('0xf')](_0x6339c4)['json'](_0x5b19df);}};}function respondWithFilteredResult(_0x3f690a,_0x4b73be){return function(_0x297459){if(_0x297459){var _0x1abb51=typeof _0x4b73be['offset']==='undefined'&&typeof _0x4b73be['limit']==='undefined';var _0x4bad7c=_0x297459[_0x2203('0x10')];var _0x538b30=_0x1abb51?0x0:_0x4b73be['offset'];var _0x21a3af=_0x1abb51?_0x297459[_0x2203('0x10')]:_0x4b73be[_0x2203('0x11')]+_0x4b73be[_0x2203('0x12')];var _0x226209;if(_0x21a3af>=_0x4bad7c){_0x21a3af=_0x4bad7c;_0x226209=0xc8;}else{_0x226209=0xce;}_0x3f690a[_0x2203('0xf')](_0x226209);return _0x3f690a[_0x2203('0x13')](_0x2203('0x14'),_0x538b30+'-'+_0x21a3af+'/'+_0x4bad7c)[_0x2203('0x15')](_0x297459);}return null;};}function saveUpdates(_0x3053f3){return function(_0x5129fb){if(_0x5129fb){return _0x5129fb[_0x2203('0x16')](_0x3053f3)[_0x2203('0x17')](function(_0x4893ff){return _0x4893ff;});}return null;};}function removeEntity(_0x3f9ef6){return function(_0x8906e1){if(_0x8906e1){return _0x8906e1['destroy']()[_0x2203('0x17')](function(){var _0x5ee83c=_0x8906e1[_0x2203('0x18')]({'plain':!![]});var _0x310b8c=_0x2203('0x19');return db[_0x2203('0x1a')][_0x2203('0x1b')]({'where':{'type':_0x310b8c,'resourceId':_0x5ee83c['id']}})[_0x2203('0x17')](function(){return _0x8906e1;});})['then'](function(){_0x3f9ef6[_0x2203('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac866){return function(_0x15f543){if(!_0x15f543){_0x5ac866['sendStatus'](0x194);}return _0x15f543;};}function handleError(_0x3b8ef9,_0x5bfe61){_0x5bfe61=_0x5bfe61||0x1f4;return function(_0x5d4c4e){logger[_0x2203('0x1c')](_0x5d4c4e['stack']);if(_0x5d4c4e['name']){delete _0x5d4c4e[_0x2203('0x1d')];}_0x3b8ef9[_0x2203('0xf')](_0x5bfe61)[_0x2203('0x1e')](_0x5d4c4e);};}exports[_0x2203('0x1f')]=function(_0x1244f4,_0x3114ef){var _0x49c12={};var _0x250349={'count':0x0,'rows':[]};var _0x576378=_[_0x2203('0x20')](db[_0x2203('0x21')][_0x2203('0x22')],function(_0x5f11bf){return{'name':_0x5f11bf[_0x2203('0x23')],'type':_0x5f11bf[_0x2203('0x24')]['key']};});_0x49c12=qs[_0x2203('0x25')](_0x576378,_0x1244f4);var _0xd91f5d={'where':_0x49c12[_0x2203('0x26')]};return db[_0x2203('0x21')][_0x2203('0x10')](_0xd91f5d)[_0x2203('0x17')](function(_0x9c53f){_0x250349['count']=_0x9c53f;_0x49c12[_0x2203('0x27')]=qs[_0x2203('0x27')](_0x1244f4[_0x2203('0x28')]);return db[_0x2203('0x21')]['findAll'](_0x49c12);})[_0x2203('0x17')](function(_0x21ff0d){_0x250349[_0x2203('0x29')]=_0x21ff0d;return _0x250349;})[_0x2203('0x17')](respondWithFilteredResult(_0x3114ef,_0x49c12))['catch'](handleError(_0x3114ef,null));};exports[_0x2203('0x2a')]=function(_0x50aa17,_0x5e6560){var _0x5c0157={'raw':!![],'where':{'id':_0x50aa17['params']['id']}},_0x1d5f74={};_0x1d5f74['model']=_[_0x2203('0x2b')](db[_0x2203('0x21')][_0x2203('0x22')]);_0x1d5f74[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x50aa17['query']);_0x1d5f74[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x1d5f74['model'],_0x1d5f74[_0x2203('0x28')]);_0x5c0157[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0x1d5f74[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x50aa17[_0x2203('0x28')][_0x2203('0x30')]));_0x5c0157[_0x2203('0x2e')]=_0x5c0157[_0x2203('0x2e')]['length']?_0x5c0157[_0x2203('0x2e')]:_0x1d5f74[_0x2203('0x2f')];if(_0x50aa17['query']['includeAll']){_0x5c0157[_0x2203('0x27')]=[{'all':!![]}];}_0x5c0157=_['merge']({},_0x5c0157,_0x50aa17[_0x2203('0x31')]);return db[_0x2203('0x21')][_0x2203('0x32')](_0x5c0157)['then'](handleEntityNotFound(_0x5e6560,null))['then'](respondWithResult(_0x5e6560,null))[_0x2203('0x33')](handleError(_0x5e6560,null));};exports['create']=function(_0x2d0365,_0x5cfe5e){return db[_0x2203('0x21')]['create'](_0x2d0365[_0x2203('0x34')],{})[_0x2203('0x17')](function(_0x4311d1){var _0x40a793=_0x2d0365[_0x2203('0x35')]['get']({'plain':!![]});if(!_0x40a793)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a793['role']===_0x2203('0x35')){var _0x25a2dc=_0x4311d1[_0x2203('0x18')]({'plain':!![]});var _0x3b0c7a=_0x2203('0x19');return db[_0x2203('0x36')][_0x2203('0x32')]({'where':{'name':_0x3b0c7a,'userProfileId':_0x40a793['userProfileId']},'raw':!![]})[_0x2203('0x17')](function(_0x1b12c3){if(_0x1b12c3&&_0x1b12c3[_0x2203('0x37')]===0x0){return db[_0x2203('0x1a')]['create']({'name':_0x25a2dc['name'],'resourceId':_0x25a2dc['id'],'type':_0x1b12c3[_0x2203('0x1d')],'sectionId':_0x1b12c3['id']},{})['then'](function(){return _0x4311d1;});}else{return _0x4311d1;}})[_0x2203('0x33')](function(_0x446209){logger[_0x2203('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446209);throw _0x446209;});}return _0x4311d1;})['then'](respondWithResult(_0x5cfe5e,0xc9))[_0x2203('0x33')](handleError(_0x5cfe5e,null));};exports[_0x2203('0x16')]=function(_0x368444,_0x1e09f3){if(_0x368444[_0x2203('0x34')]['id']){delete _0x368444[_0x2203('0x34')]['id'];}return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x368444[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e09f3,null))[_0x2203('0x17')](saveUpdates(_0x368444[_0x2203('0x34')],null))[_0x2203('0x17')](respondWithResult(_0x1e09f3,null))[_0x2203('0x33')](handleError(_0x1e09f3,null));};exports[_0x2203('0x1b')]=function(_0x36b8e4,_0x1e34a0){return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x36b8e4[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e34a0,null))[_0x2203('0x17')](removeEntity(_0x1e34a0,null))['catch'](handleError(_0x1e34a0,null));};exports['describe']=function(_0x1c6661,_0x48129c){return db[_0x2203('0x21')][_0x2203('0x39')]()[_0x2203('0x17')](respondWithResult(_0x48129c,null))[_0x2203('0x33')](handleError(_0x48129c,null));};exports['getMembers']=function(_0x289146,_0x102803){var _0x5cd8c6={'raw':!![],'where':{}},_0x29bd91={},_0x381b3e;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x289146['params']['id']}})['then'](handleEntityNotFound(_0x102803,null))[_0x2203('0x17')](function(_0x5707c8){if(_0x5707c8){_0x381b3e=_0x5707c8['get']({'plain':!![]});_0x29bd91[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x3b')]['rawAttributes']);_0x29bd91['query']=_[_0x2203('0x2b')](_0x289146[_0x2203('0x28')]);_0x29bd91[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x29bd91[_0x2203('0x2f')],_0x29bd91[_0x2203('0x28')]);_0x5cd8c6['attributes']=_[_0x2203('0x2d')](_0x29bd91['model'],qs[_0x2203('0x30')](_0x289146[_0x2203('0x28')][_0x2203('0x30')]));_0x5cd8c6[_0x2203('0x2e')]=_0x5cd8c6['attributes']['length']?_0x5cd8c6[_0x2203('0x2e')]:_0x29bd91[_0x2203('0x2f')];if(!_0x289146[_0x2203('0x28')][_0x2203('0x3c')]('nolimit')){_0x5cd8c6['limit']=qs['limit'](_0x289146[_0x2203('0x28')][_0x2203('0x12')]);_0x5cd8c6['offset']=qs[_0x2203('0x11')](_0x289146[_0x2203('0x28')]['offset']);}_0x5cd8c6[_0x2203('0x3d')]=qs[_0x2203('0x3e')](_0x289146[_0x2203('0x28')][_0x2203('0x3e')]);_0x5cd8c6['where']=qs[_0x2203('0x2c')](_['pick'](_0x289146[_0x2203('0x28')],_0x29bd91[_0x2203('0x2c')]));_0x5cd8c6['where'][_0x2203('0x3f')]=_0x5707c8['id'];if(_0x289146[_0x2203('0x28')][_0x2203('0x40')]){_0x5cd8c6[_0x2203('0x26')]=_[_0x2203('0x41')](_0x5cd8c6[_0x2203('0x26')],{'$or':_['map'](_0x5cd8c6['attributes'],function(_0x2f2537){var _0x524356={};_0x524356[_0x2f2537]={'$like':'%'+_0x289146['query'][_0x2203('0x40')]+'%'};return _0x524356;})});}_0x5cd8c6=_[_0x2203('0x41')]({},_0x5cd8c6,_0x289146[_0x2203('0x31')]);return db['UserSmsQueue'][_0x2203('0x42')](_0x5cd8c6);}})['then'](function(_0x5ddf9e){if(_0x5ddf9e){return db[_0x2203('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x5ddf9e,'UserId'),'role':_0x2203('0x44')},'attributes':['id',_0x2203('0x1d'),_0x2203('0x45'),_0x2203('0x46'),_0x2203('0x47')]});}})[_0x2203('0x17')](function(_0x2baea2){if(_0x2baea2){return{'count':_0x2baea2[_0x2203('0x10')],'rows':_[_0x2203('0x20')](_0x2baea2[_0x2203('0x29')],function(_0x384a59){return{'membername':_0x384a59[_0x2203('0x1d')],'UserId':_0x384a59['id'],'queue_name':_0x381b3e['name'],'SmsQueueId':_0x381b3e['id'],'interface':util['format'](_0x2203('0x48'),_0x2203('0x49'),_0x384a59[_0x2203('0x1d')]),'penalty':0x0,'paused':_0x384a59[_0x2203('0x45')],'createdAt':_0x384a59[_0x2203('0x47')],'updatedAt':_0x384a59[_0x2203('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x102803,_0x5cd8c6))['catch'](handleError(_0x102803,null));};exports[_0x2203('0x4a')]=function(_0x34358e,_0x21ee59){var _0x1e6d21={};var _0xcab922={};var _0x7b0b9c;var _0x133d22;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x34358e[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x21ee59,null))['then'](function(_0x1ea97a){if(_0x1ea97a){_0x7b0b9c=_0x1ea97a;_0xcab922[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x4b')][_0x2203('0x22')]);_0xcab922[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x34358e[_0x2203('0x28')]);_0xcab922[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],_0xcab922[_0x2203('0x28')]);_0x1e6d21[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x34358e[_0x2203('0x28')][_0x2203('0x30')]));_0x1e6d21[_0x2203('0x2e')]=_0x1e6d21[_0x2203('0x2e')]['length']?_0x1e6d21[_0x2203('0x2e')]:_0xcab922[_0x2203('0x2f')];_0x1e6d21[_0x2203('0x3d')]=qs['sort'](_0x34358e[_0x2203('0x28')][_0x2203('0x3e')]);_0x1e6d21[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x34358e['query'],_0xcab922[_0x2203('0x2c')]));if(_0x34358e[_0x2203('0x28')][_0x2203('0x40')]){_0x1e6d21['where']=_['merge'](_0x1e6d21['where'],{'$or':_['map'](_0x1e6d21['attributes'],function(_0x418d48){var _0xbc9f88={};_0xbc9f88[_0x418d48]={'$like':'%'+_0x34358e[_0x2203('0x28')][_0x2203('0x40')]+'%'};return _0xbc9f88;})});}_0x1e6d21=_[_0x2203('0x41')]({},_0x1e6d21,_0x34358e[_0x2203('0x31')]);return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0x56dcbe){if(_0x56dcbe){_0x133d22=_0x56dcbe['length'];if(!_0x34358e[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x1e6d21[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x34358e[_0x2203('0x28')][_0x2203('0x12')]);_0x1e6d21[_0x2203('0x11')]=qs[_0x2203('0x11')](_0x34358e[_0x2203('0x28')][_0x2203('0x11')]);}return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0xae45a5){if(_0xae45a5){return _0xae45a5?{'count':_0x133d22,'rows':_0xae45a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x21ee59,null))[_0x2203('0x33')](handleError(_0x21ee59,null));};exports[_0x2203('0x4e')]=function(_0x173ac1,_0xa15021){var _0x4b2e4f=_0x173ac1[_0x2203('0x34')]['ids'];return db[_0x2203('0x4b')]['findAll']({'where':{'id':_0x4b2e4f},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':_0x2203('0x4f'),'attributes':['id',_0x2203('0x1d'),_0x2203('0x50'),_0x2203('0x51'),_0x2203('0x52')],'raw':!![]}]})[_0x2203('0x17')](function(_0x2eab08){if(_0x2eab08){var _0x4e9a01=_['flatMap'](_0x2eab08,function(_0x38903b){var _0x34593a=_0x38903b[_0x2203('0x18')]({'plain':!![]});return _0x34593a['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x173ac1[_0x2203('0x38')]['id']}})[_0x2203('0x17')](function(_0x20385b){return db[_0x2203('0x53')]['transaction'](function(_0x2f7850){return _0x20385b['addTeams'](_0x4b2e4f,{'transaction':_0x2f7850})[_0x2203('0x17')](function(){return BPromise[_0x2203('0x54')](_0x4e9a01,function(_0xe3bee5){return db[_0x2203('0x3b')][_0x2203('0x55')]({'where':{'UserId':_0xe3bee5['id'],'SmsQueueId':_0x173ac1['params']['id']},'transaction':_0x2f7850});});})[_0x2203('0x17')](function(){_0x4e9a01[_0x2203('0x56')](function(_0x18663f){socket['emit'](_0x2203('0x57'),{'UserId':_0x18663f['id'],'SmsQueueId':_0x20385b['id']});});});});});}})[_0x2203('0x17')](respondWithStatusCode(_0xa15021,null))[_0x2203('0x33')](handleError(_0xa15021,null));};exports[_0x2203('0x58')]=function(_0x1c65f9,_0x4356fe){return db[_0x2203('0x4b')][_0x2203('0x42')]({'where':{'id':_0x1c65f9[_0x2203('0x28')][_0x2203('0x59')]},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2203('0x17')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x17')](function(_0x21b755){var _0x2da37c=_[_0x2203('0x20')](_0x21b755,'id');var _0x52c35e=[];var _0x23f7b1=[];var _0x2a5a4b=squel[_0x2203('0x5a')]();_0x2a5a4b[_0x2203('0x5b')](_0x2203('0x5c'))[_0x2203('0x5d')]('team_has_sms_queues','tq')['join'](_0x2203('0x5e'),'ut',_0x2203('0x5f'))[_0x2203('0x26')](_0x2203('0x60'),_0x1c65f9[_0x2203('0x38')]['id']);for(var _0x4fd029=0x0;_0x4fd029<_0x21b755[_0x2203('0x61')];_0x4fd029+=0x1){let _0x3cb792=_0x21b755[_0x4fd029];for(var _0x4e539b=0x0;_0x4e539b<_0x3cb792['Agents']['length'];_0x4e539b+=0x1){let _0x4fc51a=_0x3cb792['Agents'][_0x4e539b];var _0x2952fc=_0x2a5a4b[_0x2203('0x62')]();_0x2952fc[_0x2203('0x26')]('ut.UserId\x20=\x20?',_0x4fc51a['id']);_0x23f7b1['push'](db['sequelize'][_0x2203('0x28')](_0x2952fc[_0x2203('0x63')](),{'type':db[_0x2203('0x53')][_0x2203('0x64')][_0x2203('0x65')]})[_0x2203('0x17')](function(_0x3d1797){if(_0x3d1797['length']===0x1){return _0x4fc51a['id'];}else{var _0x3bf2c9=_[_0x2203('0x66')](_[_0x2203('0x20')](_0x3d1797,_0x2203('0x67')),function(_0x35ff6b){return _[_0x2203('0x68')](_0x2da37c,_0x35ff6b);});if(_0x3bf2c9){return _0x4fc51a['id'];}}}));}}return BPromise[_0x2203('0x69')](_0x23f7b1)['then'](function(_0x188722){_0x52c35e=_(_0x52c35e)['union'](_0x188722)['compact']()[_0x2203('0x6a')]();return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x1c65f9[_0x2203('0x38')]['id']}})['then'](function(_0x29d545){return db[_0x2203('0x53')][_0x2203('0x6b')](function(_0x461f90){return _0x29d545[_0x2203('0x58')](_0x1c65f9[_0x2203('0x28')]['ids'],{'transaction':_0x461f90})[_0x2203('0x17')](function(){if(!_[_0x2203('0x6c')](_0x52c35e)){return _0x29d545['removeAgents'](_0x52c35e,{'transaction':_0x461f90});}})['then'](function(){_0x52c35e[_0x2203('0x56')](function(_0x3fe71b){socket[_0x2203('0x6d')](_0x2203('0x6e'),{'UserId':_0x3fe71b,'SmsQueueId':_0x29d545['id']});});});});});});})[_0x2203('0x17')](respondWithStatusCode(_0x4356fe,null))[_0x2203('0x33')](handleError(_0x4356fe,null));};exports[_0x2203('0x6f')]=function(_0x3c41bf,_0x4749df){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x3c41bf[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x4749df,null))[_0x2203('0x17')](function(_0x7589a7){if(_0x7589a7){return _0x7589a7[_0x2203('0x6f')](_0x3c41bf['body']['ids'],_[_0x2203('0x70')](_0x3c41bf[_0x2203('0x34')],['ids','id'])||{})[_0x2203('0x71')](function(_0x447a95){for(var _0x5b5e95=0x0;_0x5b5e95<_0x3c41bf[_0x2203('0x34')][_0x2203('0x59')]['length'];_0x5b5e95+=0x1){socket[_0x2203('0x6d')](_0x2203('0x57'),{'UserId':Number(_0x3c41bf['body'][_0x2203('0x59')][_0x5b5e95]),'SmsQueueId':Number(_0x3c41bf[_0x2203('0x38')]['id'])});}return _0x447a95;});}})[_0x2203('0x17')](respondWithResult(_0x4749df,null))[_0x2203('0x33')](handleError(_0x4749df,null));};exports['removeAgents']=function(_0x511c66,_0x2df837){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x511c66['params']['id']}})['then'](handleEntityNotFound(_0x2df837,null))[_0x2203('0x17')](function(_0x199bec){if(_0x199bec){return _0x199bec[_0x2203('0x72')](_0x511c66['query']['ids'])[_0x2203('0x17')](function(){if(_[_0x2203('0x73')](_0x511c66['query'][_0x2203('0x59')])){for(var _0x2de64d=0x0;_0x2de64d<_0x511c66['query'][_0x2203('0x59')]['length'];_0x2de64d+=0x1){socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66['query']['ids'][_0x2de64d]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}}else{socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66[_0x2203('0x28')][_0x2203('0x59')]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x2df837,null))[_0x2203('0x33')](handleError(_0x2df837,null));};exports['getAgents']=function(_0x3f31e0,_0x3edb38){var _0x486563={};var _0x4358c1={};var _0x4096f4;var _0x5bd4e4;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x3f31e0[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x3edb38,null))[_0x2203('0x17')](function(_0x5d73a7){if(_0x5d73a7){_0x4096f4=_0x5d73a7;_0x4358c1[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x43')][_0x2203('0x22')]);_0x4358c1[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x3f31e0['query']);_0x4358c1[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x4358c1['model'],_0x4358c1[_0x2203('0x28')]);_0x486563['attributes']=_[_0x2203('0x2d')](_0x4358c1[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x3f31e0['query'][_0x2203('0x30')]));_0x486563[_0x2203('0x2e')]=_0x486563[_0x2203('0x2e')][_0x2203('0x61')]?_0x486563[_0x2203('0x2e')]:_0x4358c1[_0x2203('0x2f')];_0x486563[_0x2203('0x3d')]=qs['sort'](_0x3f31e0['query'][_0x2203('0x3e')]);_0x486563[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x3f31e0[_0x2203('0x28')],_0x4358c1[_0x2203('0x2c')]));if(_0x3f31e0[_0x2203('0x28')]['filter']){_0x486563[_0x2203('0x26')]=_[_0x2203('0x41')](_0x486563['where'],{'$or':_[_0x2203('0x20')](_0x486563['attributes'],function(_0xc3dac5){var _0xbd1866={};_0xbd1866[_0xc3dac5]={'$like':'%'+_0x3f31e0['query'][_0x2203('0x40')]+'%'};return _0xbd1866;})});}_0x486563=_[_0x2203('0x41')]({},_0x486563,_0x3f31e0[_0x2203('0x31')]);return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x36ab7f){if(_0x36ab7f){_0x5bd4e4=_0x36ab7f[_0x2203('0x61')];if(!_0x3f31e0[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x486563[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x3f31e0['query'][_0x2203('0x12')]);_0x486563['offset']=qs[_0x2203('0x11')](_0x3f31e0[_0x2203('0x28')][_0x2203('0x11')]);}return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x2159a5){if(_0x2159a5){return _0x2159a5?{'count':_0x5bd4e4,'rows':_0x2159a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x3edb38,null))[_0x2203('0x33')](handleError(_0x3edb38,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8d12169..77eb54a 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 _0xd81e=['events','SmsQueue','setMaxListeners','save','remove','emit','exports'];(function(_0x33159c,_0x3bada6){var _0x346ecb=function(_0x5f3ee8){while(--_0x5f3ee8){_0x33159c['push'](_0x33159c['shift']());}};_0x346ecb(++_0x3bada6);}(_0xd81e,0xf5));var _0xed81=function(_0x12460b,_0x438f19){_0x12460b=_0x12460b-0x0;var _0x5a155a=_0xd81e[_0x12460b];return _0x5a155a;};'use strict';var EventEmitter=require(_0xed81('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xed81('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xed81('0x2')](0x0);var events={'afterCreate':_0xed81('0x3'),'afterUpdate':'update','afterDestroy':_0xed81('0x4')};function emitEvent(_0x5089ed){return function(_0x45984d,_0x105c6f,_0x45cbff){SmsQueueEvents[_0xed81('0x5')](_0x5089ed+':'+_0x45984d['id'],_0x45984d);SmsQueueEvents[_0xed81('0x5')](_0x5089ed,_0x45984d);_0x45cbff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xed81('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0xe274=['emit','hasOwnProperty','exports','events','../../mysqldb','save','remove'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xe274,0x14c));var _0x4e27=function(_0x3a7309,_0x23f742){_0x3a7309=_0x3a7309-0x0;var _0x40ecf8=_0xe274[_0x3a7309];return _0x40ecf8;};'use strict';var EventEmitter=require(_0x4e27('0x0'));var SmsQueue=require(_0x4e27('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4e27('0x2'),'afterUpdate':'update','afterDestroy':_0x4e27('0x3')};function emitEvent(_0x539e3b){return function(_0x317f6f,_0x43f5c0,_0x2f7aa1){SmsQueueEvents[_0x4e27('0x4')](_0x539e3b+':'+_0x317f6f['id'],_0x317f6f);SmsQueueEvents[_0x4e27('0x4')](_0x539e3b,_0x317f6f);_0x2f7aa1(null);};}for(var e in events){if(events[_0x4e27('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x4e27('0x6')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1002c74..fd2eed5 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 _0xcc11=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','lodash'];(function(_0x492d8a,_0x2dcfef){var _0x1a7577=function(_0x2e6b30){while(--_0x2e6b30){_0x492d8a['push'](_0x492d8a['shift']());}};_0x1a7577(++_0x2dcfef);}(_0xcc11,0xdb));var _0x1cc1=function(_0x3e5608,_0x8b6979){_0x3e5608=_0x3e5608-0x0;var _0x4128d3=_0xcc11[_0x3e5608];return _0x4128d3;};'use strict';var _=require(_0x1cc1('0x0'));var util=require(_0x1cc1('0x1'));var logger=require('../../config/logger')(_0x1cc1('0x2'));var moment=require(_0x1cc1('0x3'));var BPromise=require(_0x1cc1('0x4'));var rp=require(_0x1cc1('0x5'));var fs=require('fs');var path=require(_0x1cc1('0x6'));var rimraf=require(_0x1cc1('0x7'));var config=require(_0x1cc1('0x8'));var attributes=require('./smsQueue.attributes');module[_0x1cc1('0x9')]=function(_0x507135,_0x334ddb){return _0x507135['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a89=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0x3a89,0x114));var _0x93a8=function(_0x4cfe90,_0x416cef){_0x4cfe90=_0x4cfe90-0x0;var _0x1471c7=_0x3a89[_0x4cfe90];return _0x1471c7;};'use strict';var _=require(_0x93a8('0x0'));var util=require(_0x93a8('0x1'));var logger=require(_0x93a8('0x2'))(_0x93a8('0x3'));var moment=require(_0x93a8('0x4'));var BPromise=require('bluebird');var rp=require(_0x93a8('0x5'));var fs=require('fs');var path=require(_0x93a8('0x6'));var rimraf=require(_0x93a8('0x7'));var config=require('../../config/environment');var attributes=require(_0x93a8('0x8'));module[_0x93a8('0x9')]=function(_0x288906,_0x3b722a){return _0x288906[_0x93a8('0xa')](_0x93a8('0xb'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index c68b497..667f39a 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 _0x9b60=['error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','then','debug','catch','ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','request\x20sent','stringify'];(function(_0x57778b,_0x492e6b){var _0x43d412=function(_0x32bd26){while(--_0x32bd26){_0x57778b['push'](_0x57778b['shift']());}};_0x43d412(++_0x492e6b);}(_0x9b60,0x104));var _0x09b6=function(_0x8e5b3e,_0x2e9000){_0x8e5b3e=_0x8e5b3e-0x0;var _0x49bc1d=_0x9b60[_0x8e5b3e];return _0x49bc1d;};'use strict';var _=require(_0x09b6('0x0'));var util=require(_0x09b6('0x1'));var moment=require(_0x09b6('0x2'));var BPromise=require(_0x09b6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x09b6('0x5'));var logger=require('../../config/logger')(_0x09b6('0x6'));var config=require(_0x09b6('0x7'));var jayson=require(_0x09b6('0x8'));var client=jayson['client'][_0x09b6('0x9')]({'port':0x232a});config[_0x09b6('0xa')]=_[_0x09b6('0xb')](config[_0x09b6('0xa')],{'host':_0x09b6('0xc'),'port':0x18eb});var socket=require(_0x09b6('0xd'))(new Redis(config[_0x09b6('0xa')]));require(_0x09b6('0xe'))[_0x09b6('0xf')](socket);function respondWithRpcPromise(_0x3506d8,_0x40a5b3,_0x1fee7c){return new BPromise(function(_0x1c471b,_0x2bd87f){return client[_0x09b6('0x10')](_0x3506d8,_0x1fee7c)['then'](function(_0x1f39e2){logger[_0x09b6('0x11')]('SmsQueue,\x20%s,\x20%s',_0x40a5b3,_0x09b6('0x12'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x40a5b3,_0x09b6('0x12'),JSON[_0x09b6('0x13')](_0x1f39e2));if(_0x1f39e2[_0x09b6('0x14')]){if(_0x1f39e2[_0x09b6('0x14')][_0x09b6('0x15')]===0x1f4){logger[_0x09b6('0x14')](_0x09b6('0x16'),_0x40a5b3,_0x1f39e2[_0x09b6('0x14')]['message']);return _0x2bd87f(_0x1f39e2[_0x09b6('0x14')][_0x09b6('0x17')]);}logger[_0x09b6('0x14')](_0x09b6('0x16'),_0x40a5b3,_0x1f39e2[_0x09b6('0x14')][_0x09b6('0x17')]);return _0x1c471b(_0x1f39e2[_0x09b6('0x14')][_0x09b6('0x17')]);}else{logger['info'](_0x09b6('0x16'),_0x40a5b3,'request\x20sent');_0x1c471b(_0x1f39e2[_0x09b6('0x18')][_0x09b6('0x17')]);}})['catch'](function(_0x1c4f40){logger[_0x09b6('0x14')](_0x09b6('0x16'),_0x40a5b3,_0x1c4f40);_0x2bd87f(_0x1c4f40);});});}exports[_0x09b6('0x19')]=function(_0x55b98a){var _0x3bc3aa=this;return new Promise(function(_0x460508,_0x232a78){return db[_0x09b6('0x1a')]['findAll']({'raw':_0x55b98a[_0x09b6('0x1b')]?_0x55b98a[_0x09b6('0x1b')][_0x09b6('0x1c')]===undefined?!![]:![]:!![],'where':_0x55b98a[_0x09b6('0x1b')]?_0x55b98a['options'][_0x09b6('0x1d')]||null:null,'attributes':_0x55b98a['options']?_0x55b98a[_0x09b6('0x1b')][_0x09b6('0x1e')]||null:null,'limit':_0x55b98a[_0x09b6('0x1b')]?_0x55b98a[_0x09b6('0x1b')][_0x09b6('0x1f')]||null:null,'include':_0x55b98a['options']?_0x55b98a[_0x09b6('0x1b')][_0x09b6('0x20')]?_[_0x09b6('0x21')](_0x55b98a[_0x09b6('0x1b')]['include'],function(_0x55c90b){return{'model':db[_0x55c90b[_0x09b6('0x22')]],'as':_0x55c90b['as'],'attributes':_0x55c90b[_0x09b6('0x1e')],'include':_0x55c90b[_0x09b6('0x20')]?_[_0x09b6('0x21')](_0x55c90b['include'],function(_0x1fbe1d){return{'model':db[_0x1fbe1d['model']],'as':_0x1fbe1d['as'],'attributes':_0x1fbe1d[_0x09b6('0x1e')],'include':_0x1fbe1d[_0x09b6('0x20')]?_[_0x09b6('0x21')](_0x1fbe1d['include'],function(_0x2e542e){return{'model':db[_0x2e542e['model']],'as':_0x2e542e['as'],'attributes':_0x2e542e[_0x09b6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x09b6('0x23')](function(_0x244398){logger[_0x09b6('0x11')](_0x09b6('0x19'),_0x55b98a);logger[_0x09b6('0x24')]('GetSmsQueue',_0x55b98a,JSON['stringify'](_0x244398));_0x460508(_0x244398);})[_0x09b6('0x25')](function(_0x37e2f1){logger['error'](_0x09b6('0x19'),_0x37e2f1['message'],_0x55b98a);_0x232a78(_0x3bc3aa[_0x09b6('0x14')](0x1f4,_0x37e2f1[_0x09b6('0x17')]));});});};exports[_0x09b6('0x26')]=function(_0x45ce26){var _0x245595=this;return new Promise(function(_0x4ee67f,_0x1420ab){return db[_0x09b6('0x1a')][_0x09b6('0x27')]({'raw':_0x45ce26[_0x09b6('0x1b')]?_0x45ce26[_0x09b6('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x45ce26['options']?_0x45ce26['options']['where']||null:null,'attributes':_0x45ce26[_0x09b6('0x1b')]?_0x45ce26[_0x09b6('0x1b')][_0x09b6('0x1e')]||null:null,'include':_0x45ce26[_0x09b6('0x1b')]?_0x45ce26[_0x09b6('0x1b')][_0x09b6('0x20')]?_[_0x09b6('0x21')](_0x45ce26[_0x09b6('0x1b')][_0x09b6('0x20')],function(_0x1e0d5a){return{'model':db[_0x1e0d5a[_0x09b6('0x22')]],'as':_0x1e0d5a['as'],'attributes':_0x1e0d5a[_0x09b6('0x1e')],'include':_0x1e0d5a[_0x09b6('0x20')]?_['map'](_0x1e0d5a[_0x09b6('0x20')],function(_0x14f4eb){return{'model':db[_0x14f4eb[_0x09b6('0x22')]],'as':_0x14f4eb['as'],'attributes':_0x14f4eb[_0x09b6('0x1e')],'include':_0x14f4eb['include']?_[_0x09b6('0x21')](_0x14f4eb[_0x09b6('0x20')],function(_0x12da67){return{'model':db[_0x12da67[_0x09b6('0x22')]],'as':_0x12da67['as'],'attributes':_0x12da67['attributes']};}):[]};}):[]};}):[]:[]})[_0x09b6('0x23')](function(_0x3d1a9d){logger[_0x09b6('0x11')](_0x09b6('0x26'),_0x45ce26);logger[_0x09b6('0x24')](_0x09b6('0x26'),_0x45ce26,JSON[_0x09b6('0x13')](_0x3d1a9d));_0x4ee67f(_0x3d1a9d);})[_0x09b6('0x25')](function(_0x3f34f8){logger[_0x09b6('0x14')]('ShowSmsQueue',_0x3f34f8['message'],_0x45ce26);_0x1420ab(_0x245595[_0x09b6('0x14')](0x1f4,_0x3f34f8[_0x09b6('0x17')]));});});}; \ No newline at end of file +var _0x5eb2=['include','map','model','GetSmsQueue','debug','SmsQueue','find','raw','ShowSmsQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','options','where','attributes','limit'];(function(_0x217fa1,_0x40aeee){var _0x49e96b=function(_0x2eeeef){while(--_0x2eeeef){_0x217fa1['push'](_0x217fa1['shift']());}};_0x49e96b(++_0x40aeee);}(_0x5eb2,0xa9));var _0x25eb=function(_0x41e507,_0x694b79){_0x41e507=_0x41e507-0x0;var _0x3bbe37=_0x5eb2[_0x41e507];return _0x3bbe37;};'use strict';var _=require(_0x25eb('0x0'));var util=require(_0x25eb('0x1'));var moment=require('moment');var BPromise=require(_0x25eb('0x2'));var rs=require(_0x25eb('0x3'));var fs=require('fs');var Redis=require(_0x25eb('0x4'));var db=require(_0x25eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x25eb('0x6'))(_0x25eb('0x7'));var config=require(_0x25eb('0x8'));var jayson=require(_0x25eb('0x9'));var client=jayson['client'][_0x25eb('0xa')]({'port':0x232a});config[_0x25eb('0xb')]=_['defaults'](config[_0x25eb('0xb')],{'host':_0x25eb('0xc'),'port':0x18eb});var socket=require(_0x25eb('0xd'))(new Redis(config[_0x25eb('0xb')]));require(_0x25eb('0xe'))[_0x25eb('0xf')](socket);function respondWithRpcPromise(_0x3a3e7a,_0x2a4610,_0x4ad194){return new BPromise(function(_0x575d0d,_0x23112c){return client[_0x25eb('0x10')](_0x3a3e7a,_0x4ad194)[_0x25eb('0x11')](function(_0x1f9ad9){logger[_0x25eb('0x12')](_0x25eb('0x13'),_0x2a4610,'request\x20sent');logger['debug'](_0x25eb('0x14'),_0x2a4610,'request\x20sent',JSON[_0x25eb('0x15')](_0x1f9ad9));if(_0x1f9ad9['error']){if(_0x1f9ad9[_0x25eb('0x16')][_0x25eb('0x17')]===0x1f4){logger[_0x25eb('0x16')](_0x25eb('0x13'),_0x2a4610,_0x1f9ad9[_0x25eb('0x16')][_0x25eb('0x18')]);return _0x23112c(_0x1f9ad9[_0x25eb('0x16')][_0x25eb('0x18')]);}logger[_0x25eb('0x16')](_0x25eb('0x13'),_0x2a4610,_0x1f9ad9[_0x25eb('0x16')]['message']);return _0x575d0d(_0x1f9ad9[_0x25eb('0x16')][_0x25eb('0x18')]);}else{logger[_0x25eb('0x12')]('SmsQueue,\x20%s,\x20%s',_0x2a4610,_0x25eb('0x19'));_0x575d0d(_0x1f9ad9['result'][_0x25eb('0x18')]);}})[_0x25eb('0x1a')](function(_0x4e24d8){logger[_0x25eb('0x16')](_0x25eb('0x13'),_0x2a4610,_0x4e24d8);_0x23112c(_0x4e24d8);});});}exports['GetSmsQueue']=function(_0x5cf79a){var _0x53990f=this;return new Promise(function(_0x51e9c9,_0x2d6ee3){return db['SmsQueue']['findAll']({'raw':_0x5cf79a['options']?_0x5cf79a['options']['raw']===undefined?!![]:![]:!![],'where':_0x5cf79a[_0x25eb('0x1b')]?_0x5cf79a[_0x25eb('0x1b')][_0x25eb('0x1c')]||null:null,'attributes':_0x5cf79a[_0x25eb('0x1b')]?_0x5cf79a[_0x25eb('0x1b')][_0x25eb('0x1d')]||null:null,'limit':_0x5cf79a['options']?_0x5cf79a['options'][_0x25eb('0x1e')]||null:null,'include':_0x5cf79a[_0x25eb('0x1b')]?_0x5cf79a[_0x25eb('0x1b')][_0x25eb('0x1f')]?_[_0x25eb('0x20')](_0x5cf79a[_0x25eb('0x1b')][_0x25eb('0x1f')],function(_0x12cb23){return{'model':db[_0x12cb23[_0x25eb('0x21')]],'as':_0x12cb23['as'],'attributes':_0x12cb23[_0x25eb('0x1d')],'include':_0x12cb23['include']?_[_0x25eb('0x20')](_0x12cb23['include'],function(_0xfc840c){return{'model':db[_0xfc840c[_0x25eb('0x21')]],'as':_0xfc840c['as'],'attributes':_0xfc840c['attributes'],'include':_0xfc840c['include']?_['map'](_0xfc840c[_0x25eb('0x1f')],function(_0x5f0b12){return{'model':db[_0x5f0b12['model']],'as':_0x5f0b12['as'],'attributes':_0x5f0b12[_0x25eb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x25eb('0x11')](function(_0x5d9b98){logger[_0x25eb('0x12')](_0x25eb('0x22'),_0x5cf79a);logger[_0x25eb('0x23')]('GetSmsQueue',_0x5cf79a,JSON['stringify'](_0x5d9b98));_0x51e9c9(_0x5d9b98);})[_0x25eb('0x1a')](function(_0x2e9a74){logger['error'](_0x25eb('0x22'),_0x2e9a74['message'],_0x5cf79a);_0x2d6ee3(_0x53990f['error'](0x1f4,_0x2e9a74[_0x25eb('0x18')]));});});};exports['ShowSmsQueue']=function(_0x53270c){var _0x4b57c7=this;return new Promise(function(_0x3cc439,_0x9c7603){return db[_0x25eb('0x24')][_0x25eb('0x25')]({'raw':_0x53270c['options']?_0x53270c[_0x25eb('0x1b')][_0x25eb('0x26')]===undefined?!![]:![]:!![],'where':_0x53270c[_0x25eb('0x1b')]?_0x53270c[_0x25eb('0x1b')][_0x25eb('0x1c')]||null:null,'attributes':_0x53270c[_0x25eb('0x1b')]?_0x53270c['options'][_0x25eb('0x1d')]||null:null,'include':_0x53270c[_0x25eb('0x1b')]?_0x53270c[_0x25eb('0x1b')][_0x25eb('0x1f')]?_[_0x25eb('0x20')](_0x53270c[_0x25eb('0x1b')][_0x25eb('0x1f')],function(_0x31cadb){return{'model':db[_0x31cadb[_0x25eb('0x21')]],'as':_0x31cadb['as'],'attributes':_0x31cadb['attributes'],'include':_0x31cadb[_0x25eb('0x1f')]?_[_0x25eb('0x20')](_0x31cadb[_0x25eb('0x1f')],function(_0x4daa0d){return{'model':db[_0x4daa0d[_0x25eb('0x21')]],'as':_0x4daa0d['as'],'attributes':_0x4daa0d[_0x25eb('0x1d')],'include':_0x4daa0d[_0x25eb('0x1f')]?_['map'](_0x4daa0d[_0x25eb('0x1f')],function(_0x2d43e4){return{'model':db[_0x2d43e4[_0x25eb('0x21')]],'as':_0x2d43e4['as'],'attributes':_0x2d43e4[_0x25eb('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x576917){logger['info'](_0x25eb('0x27'),_0x53270c);logger[_0x25eb('0x23')](_0x25eb('0x27'),_0x53270c,JSON[_0x25eb('0x15')](_0x576917));_0x3cc439(_0x576917);})['catch'](function(_0x2bd6e0){logger[_0x25eb('0x16')](_0x25eb('0x27'),_0x2bd6e0[_0x25eb('0x18')],_0x53270c);_0x9c7603(_0x4b57c7[_0x25eb('0x16')](0x1f4,_0x2bd6e0[_0x25eb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0f09efa..98d618d 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 _0xd9bc=['smsQueue:','save','remove','update','emit','removeListener','register'];(function(_0x223902,_0x4601c1){var _0x289a2a=function(_0x1806fb){while(--_0x1806fb){_0x223902['push'](_0x223902['shift']());}};_0x289a2a(++_0x4601c1);}(_0xd9bc,0x158));var _0xcd9b=function(_0x37dd18,_0x2a6b05){_0x37dd18=_0x37dd18-0x0;var _0x911ad5=_0xd9bc[_0x37dd18];return _0x911ad5;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xcd9b('0x0'),_0xcd9b('0x1'),_0xcd9b('0x2')];function createListener(_0x319c18,_0x57a976){return function(_0x196efc){_0x57a976[_0xcd9b('0x3')](_0x319c18,_0x196efc);};}function removeListener(_0x133a08,_0x2f2cbb){return function(){SmsQueueEvents[_0xcd9b('0x4')](_0x133a08,_0x2f2cbb);};}exports[_0xcd9b('0x5')]=function(_0x21a9f8){for(var _0x42e065=0x0,_0x2763a8=events['length'];_0x42e065<_0x2763a8;_0x42e065++){var _0x23875a=events[_0x42e065];var _0x4cc772=createListener(_0xcd9b('0x6')+_0x23875a,_0x21a9f8);SmsQueueEvents['on'](_0x23875a,_0x4cc772);}}; \ No newline at end of file +var _0x7e0d=['./smsQueue.events','save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x1d0925,_0x1ed1ba){var _0x1d4055=function(_0x2318a6){while(--_0x2318a6){_0x1d0925['push'](_0x1d0925['shift']());}};_0x1d4055(++_0x1ed1ba);}(_0x7e0d,0x18c));var _0xd7e0=function(_0x51ec4b,_0x383664){_0x51ec4b=_0x51ec4b-0x0;var _0x2e1202=_0x7e0d[_0x51ec4b];return _0x2e1202;};'use strict';var SmsQueueEvents=require(_0xd7e0('0x0'));var events=[_0xd7e0('0x1'),_0xd7e0('0x2'),_0xd7e0('0x3')];function createListener(_0xd482e6,_0x84f3fc){return function(_0x51bb77){_0x84f3fc[_0xd7e0('0x4')](_0xd482e6,_0x51bb77);};}function removeListener(_0x5a0cf2,_0x150fb8){return function(){SmsQueueEvents[_0xd7e0('0x5')](_0x5a0cf2,_0x150fb8);};}exports[_0xd7e0('0x6')]=function(_0x2e5a22){for(var _0x46661f=0x0,_0x4eb4ea=events[_0xd7e0('0x7')];_0x46661f<_0x4eb4ea;_0x46661f++){var _0x51b201=events[_0x46661f];var _0x455cf0=createListener(_0xd7e0('0x8')+_0x51b201,_0x2e5a22);SmsQueueEvents['on'](_0x51b201,_0x455cf0);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 43f64b9..114f4ba 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 _0x0eea=['create','put','update','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5d81d6,_0x3655f6){var _0x2f9b4a=function(_0x843d1c){while(--_0x843d1c){_0x5d81d6['push'](_0x5d81d6['shift']());}};_0x2f9b4a(++_0x3655f6);}(_0x0eea,0xdc));var _0xa0ee=function(_0xb42fe8,_0x5502f6){_0xb42fe8=_0xb42fe8-0x0;var _0x47e0b1=_0x0eea[_0xb42fe8];return _0x47e0b1;};'use strict';var multer=require('multer');var util=require(_0xa0ee('0x0'));var path=require(_0xa0ee('0x1'));var timeout=require(_0xa0ee('0x2'));var express=require(_0xa0ee('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa0ee('0x4'));var interaction=require(_0xa0ee('0x5'));var config=require(_0xa0ee('0x6'));var controller=require(_0xa0ee('0x7'));router[_0xa0ee('0x8')]('/',auth[_0xa0ee('0x9')](),controller[_0xa0ee('0xa')]);router['get']('/describe',auth[_0xa0ee('0x9')](),controller['describe']);router[_0xa0ee('0x8')](_0xa0ee('0xb'),auth['isAuthenticated'](),controller[_0xa0ee('0xc')]);router[_0xa0ee('0xd')]('/',auth[_0xa0ee('0x9')](),controller[_0xa0ee('0xe')]);router[_0xa0ee('0xf')](_0xa0ee('0xb'),auth[_0xa0ee('0x9')](),controller[_0xa0ee('0x10')]);router['delete'](_0xa0ee('0xb'),auth[_0xa0ee('0x9')](),controller[_0xa0ee('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf987=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','delete','destroy','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2db4aa,_0x115ac7){var _0x5a3b51=function(_0x420f7e){while(--_0x420f7e){_0x2db4aa['push'](_0x2db4aa['shift']());}};_0x5a3b51(++_0x115ac7);}(_0xf987,0x18a));var _0x7f98=function(_0xf33ace,_0x4cc926){_0xf33ace=_0xf33ace-0x0;var _0x258667=_0xf987[_0xf33ace];return _0x258667;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f98('0x0'));var timeout=require(_0x7f98('0x1'));var express=require('express');var router=express[_0x7f98('0x2')]();var fs_extra=require(_0x7f98('0x3'));var auth=require(_0x7f98('0x4'));var interaction=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var controller=require(_0x7f98('0x7'));router[_0x7f98('0x8')]('/',auth[_0x7f98('0x9')](),controller[_0x7f98('0xa')]);router[_0x7f98('0x8')](_0x7f98('0xb'),auth[_0x7f98('0x9')](),controller['describe']);router[_0x7f98('0x8')](_0x7f98('0xc'),auth[_0x7f98('0x9')](),controller[_0x7f98('0xd')]);router[_0x7f98('0xe')]('/',auth['isAuthenticated'](),controller[_0x7f98('0xf')]);router['put']('/:id',auth[_0x7f98('0x9')](),controller[_0x7f98('0x10')]);router[_0x7f98('0x11')](_0x7f98('0xc'),auth['isAuthenticated'](),controller[_0x7f98('0x12')]);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 e45deeb..816c8e6 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 _0xdc00=['STRING','DATE','moment','exports'];(function(_0x53d92c,_0x29a7f7){var _0x273b23=function(_0x3c7aef){while(--_0x3c7aef){_0x53d92c['push'](_0x53d92c['shift']());}};_0x273b23(++_0x29a7f7);}(_0xdc00,0xfe));var _0x0dc0=function(_0xfc3ace,_0x5e27c7){_0xfc3ace=_0xfc3ace-0x0;var _0x233e2b=_0xdc00[_0xfc3ace];return _0x233e2b;};'use strict';var moment=require(_0x0dc0('0x0'));var Sequelize=require('sequelize');module[_0x0dc0('0x1')]={'uniqueid':{'type':Sequelize[_0x0dc0('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0dc0('0x2')]},'joinAt':{'type':Sequelize[_0x0dc0('0x3')]},'leaveAt':{'type':Sequelize[_0x0dc0('0x3')]},'acceptAt':{'type':Sequelize[_0x0dc0('0x3')]},'exitAt':{'type':Sequelize[_0x0dc0('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7301=['STRING','DATE','sequelize'];(function(_0x2e476a,_0x1c655d){var _0x188142=function(_0x4936ef){while(--_0x4936ef){_0x2e476a['push'](_0x2e476a['shift']());}};_0x188142(++_0x1c655d);}(_0x7301,0x6e));var _0x1730=function(_0x3804d5,_0xe918b){_0x3804d5=_0x3804d5-0x0;var _0x1fb201=_0x7301[_0x3804d5];return _0x1fb201;};'use strict';var moment=require('moment');var Sequelize=require(_0x1730('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1730('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1730('0x1')]},'joinAt':{'type':Sequelize[_0x1730('0x2')]},'leaveAt':{'type':Sequelize[_0x1730('0x2')]},'acceptAt':{'type':Sequelize[_0x1730('0x2')]},'exitAt':{'type':Sequelize[_0x1730('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 195dfee..4dd75d9 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 _0x4964=['save','update','then','destroy','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x4e7163,_0x85dd90){var _0x454f66=function(_0x2033a7){while(--_0x2033a7){_0x4e7163['push'](_0x4e7163['shift']());}};_0x454f66(++_0x85dd90);}(_0x4964,0x73));var _0x4496=function(_0x7ee72c,_0x10590a){_0x7ee72c=_0x7ee72c-0x0;var _0x6f9894=_0x4964[_0x7ee72c];return _0x6f9894;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4496('0x0'));var zipdir=require(_0x4496('0x1'));var jsonpatch=require(_0x4496('0x2'));var rp=require(_0x4496('0x3'));var moment=require(_0x4496('0x4'));var BPromise=require(_0x4496('0x5'));var Mustache=require('mustache');var util=require(_0x4496('0x6'));var path=require('path');var sox=require(_0x4496('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4496('0x8'));var _=require('lodash');var squel=require(_0x4496('0x9'));var crypto=require(_0x4496('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4496('0xb'));var toCsv=require(_0x4496('0xc'));var querystring=require(_0x4496('0xd'));var Papa=require(_0x4496('0xe'));var Redis=require(_0x4496('0xf'));var authService=require(_0x4496('0x10'));var qs=require(_0x4496('0x11'));var as=require(_0x4496('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4496('0x13'));var utils=require('../../config/utils');var config=require(_0x4496('0x14'));var licenseUtil=require(_0x4496('0x15'));var db=require(_0x4496('0x16'))['db'];function respondWithStatusCode(_0xdffb48,_0x51eee5){_0x51eee5=_0x51eee5||0xcc;return function(_0x2e8887){if(_0x2e8887){return _0xdffb48[_0x4496('0x17')](_0x51eee5);}return _0xdffb48['status'](_0x51eee5)[_0x4496('0x18')]();};}function respondWithResult(_0x8780df,_0x9230ac){_0x9230ac=_0x9230ac||0xc8;return function(_0x26af69){if(_0x26af69){return _0x8780df[_0x4496('0x19')](_0x9230ac)[_0x4496('0x1a')](_0x26af69);}};}function respondWithFilteredResult(_0x517515,_0x392c3a){return function(_0x1fd502){if(_0x1fd502){var _0x28c0fb=typeof _0x392c3a[_0x4496('0x1b')]===_0x4496('0x1c')&&typeof _0x392c3a[_0x4496('0x1d')]==='undefined';var _0x1a5326=_0x1fd502[_0x4496('0x1e')];var _0x31bab9=_0x28c0fb?0x0:_0x392c3a['offset'];var _0x17071e=_0x28c0fb?_0x1fd502[_0x4496('0x1e')]:_0x392c3a[_0x4496('0x1b')]+_0x392c3a[_0x4496('0x1d')];var _0x22a177;if(_0x17071e>=_0x1a5326){_0x17071e=_0x1a5326;_0x22a177=0xc8;}else{_0x22a177=0xce;}_0x517515[_0x4496('0x19')](_0x22a177);return _0x517515[_0x4496('0x1f')](_0x4496('0x20'),_0x31bab9+'-'+_0x17071e+'/'+_0x1a5326)[_0x4496('0x1a')](_0x1fd502);}return null;};}function patchUpdates(_0x2efd9c){return function(_0xae0224){try{jsonpatch['apply'](_0xae0224,_0x2efd9c,!![]);}catch(_0x14fcab){return BPromise['reject'](_0x14fcab);}return _0xae0224[_0x4496('0x21')]();};}function saveUpdates(_0x10129f,_0x2863ed){return function(_0x1dbdc4){if(_0x1dbdc4){return _0x1dbdc4[_0x4496('0x22')](_0x10129f)[_0x4496('0x23')](function(_0x132fb3){return _0x132fb3;});}return null;};}function removeEntity(_0x30014a,_0x5e3312){return function(_0x436d70){if(_0x436d70){return _0x436d70[_0x4496('0x24')]()[_0x4496('0x23')](function(){_0x30014a[_0x4496('0x19')](0xcc)[_0x4496('0x18')]();});}};}function handleEntityNotFound(_0x3cafa4,_0x257286){return function(_0x1cb763){if(!_0x1cb763){_0x3cafa4[_0x4496('0x17')](0x194);}return _0x1cb763;};}function handleError(_0xbb5a01,_0x4b1ff7){_0x4b1ff7=_0x4b1ff7||0x1f4;return function(_0x4e23d8){logger['error'](_0x4e23d8['stack']);if(_0x4e23d8[_0x4496('0x25')]){delete _0x4e23d8[_0x4496('0x25')];}_0xbb5a01[_0x4496('0x19')](_0x4b1ff7)[_0x4496('0x26')](_0x4e23d8);};}exports[_0x4496('0x27')]=function(_0x4e8e47,_0x32823a){var _0x567ed6={},_0x5e3507={},_0x24559a={'count':0x0,'rows':[]};var _0x5da9f8=_[_0x4496('0x28')](db[_0x4496('0x29')][_0x4496('0x2a')],function(_0x26d87b){return{'name':_0x26d87b[_0x4496('0x2b')],'type':_0x26d87b[_0x4496('0x2c')][_0x4496('0x2d')]};});_0x5e3507['model']=_[_0x4496('0x28')](_0x5da9f8,_0x4496('0x25'));_0x5e3507[_0x4496('0x2e')]=_[_0x4496('0x2f')](_0x4e8e47[_0x4496('0x2e')]);_0x5e3507[_0x4496('0x30')]=_[_0x4496('0x31')](_0x5e3507[_0x4496('0x32')],_0x5e3507[_0x4496('0x2e')]);_0x567ed6[_0x4496('0x33')]=_['intersection'](_0x5e3507[_0x4496('0x32')],qs[_0x4496('0x34')](_0x4e8e47[_0x4496('0x2e')][_0x4496('0x34')]));_0x567ed6['attributes']=_0x567ed6[_0x4496('0x33')][_0x4496('0x35')]?_0x567ed6['attributes']:_0x5e3507[_0x4496('0x32')];if(!_0x4e8e47[_0x4496('0x2e')][_0x4496('0x36')](_0x4496('0x37'))){_0x567ed6[_0x4496('0x1d')]=qs[_0x4496('0x1d')](_0x4e8e47[_0x4496('0x2e')][_0x4496('0x1d')]);_0x567ed6['offset']=qs[_0x4496('0x1b')](_0x4e8e47[_0x4496('0x2e')][_0x4496('0x1b')]);}_0x567ed6[_0x4496('0x38')]=qs[_0x4496('0x39')](_0x4e8e47[_0x4496('0x2e')]['sort']);_0x567ed6[_0x4496('0x3a')]=qs['filters'](_['pick'](_0x4e8e47['query'],_0x5e3507['filters']),_0x5da9f8);if(_0x4e8e47[_0x4496('0x2e')][_0x4496('0x3b')]){_0x567ed6['where']=_['merge'](_0x567ed6[_0x4496('0x3a')],{'$or':_[_0x4496('0x28')](_0x5da9f8,function(_0x5dd363){if(_0x5dd363[_0x4496('0x2c')]!==_0x4496('0x3c')){var _0x51a926={};_0x51a926[_0x5dd363[_0x4496('0x25')]]={'$like':'%'+_0x4e8e47[_0x4496('0x2e')]['filter']+'%'};return _0x51a926;}})});}_0x567ed6=_['merge']({},_0x567ed6,_0x4e8e47[_0x4496('0x3d')]);var _0x5b5055={'where':_0x567ed6[_0x4496('0x3a')]};return db[_0x4496('0x29')]['count'](_0x5b5055)[_0x4496('0x23')](function(_0x75c100){_0x24559a[_0x4496('0x1e')]=_0x75c100;if(_0x4e8e47['query']['includeAll']){_0x567ed6[_0x4496('0x3e')]=[{'all':!![]}];}return db[_0x4496('0x29')][_0x4496('0x3f')](_0x567ed6);})[_0x4496('0x23')](function(_0x50efab){_0x24559a[_0x4496('0x40')]=_0x50efab;return _0x24559a;})[_0x4496('0x23')](respondWithFilteredResult(_0x32823a,_0x567ed6))['catch'](handleError(_0x32823a,null));};exports[_0x4496('0x41')]=function(_0x53f0e9,_0x1ded55){var _0x1979a7={'raw':!![],'where':{'id':_0x53f0e9[_0x4496('0x42')]['id']}},_0x4d57fd={};_0x4d57fd[_0x4496('0x32')]=_[_0x4496('0x2f')](db[_0x4496('0x29')][_0x4496('0x2a')]);_0x4d57fd[_0x4496('0x2e')]=_[_0x4496('0x2f')](_0x53f0e9['query']);_0x4d57fd[_0x4496('0x30')]=_[_0x4496('0x31')](_0x4d57fd['model'],_0x4d57fd[_0x4496('0x2e')]);_0x1979a7['attributes']=_[_0x4496('0x31')](_0x4d57fd[_0x4496('0x32')],qs[_0x4496('0x34')](_0x53f0e9[_0x4496('0x2e')][_0x4496('0x34')]));_0x1979a7[_0x4496('0x33')]=_0x1979a7[_0x4496('0x33')][_0x4496('0x35')]?_0x1979a7['attributes']:_0x4d57fd['model'];if(_0x53f0e9[_0x4496('0x2e')][_0x4496('0x43')]){_0x1979a7[_0x4496('0x3e')]=[{'all':!![]}];}_0x1979a7=_[_0x4496('0x44')]({},_0x1979a7,_0x53f0e9[_0x4496('0x3d')]);return db['SmsQueueReport'][_0x4496('0x45')](_0x1979a7)['then'](handleEntityNotFound(_0x1ded55,null))['then'](respondWithResult(_0x1ded55,null))[_0x4496('0x46')](handleError(_0x1ded55,null));};exports[_0x4496('0x47')]=function(_0x5ce54e,_0x27b25c){return db[_0x4496('0x29')][_0x4496('0x47')](_0x5ce54e[_0x4496('0x48')],{})[_0x4496('0x23')](respondWithResult(_0x27b25c,0xc9))[_0x4496('0x46')](handleError(_0x27b25c,null));};exports[_0x4496('0x22')]=function(_0x1d2184,_0x1053c4){if(_0x1d2184[_0x4496('0x48')]['id']){delete _0x1d2184[_0x4496('0x48')]['id'];}return db[_0x4496('0x29')]['find']({'where':{'id':_0x1d2184[_0x4496('0x42')]['id']}})['then'](handleEntityNotFound(_0x1053c4,null))[_0x4496('0x23')](saveUpdates(_0x1d2184[_0x4496('0x48')],null))['then'](respondWithResult(_0x1053c4,null))[_0x4496('0x46')](handleError(_0x1053c4,null));};exports['destroy']=function(_0x562f7,_0x4256c0){return db['SmsQueueReport'][_0x4496('0x45')]({'where':{'id':_0x562f7[_0x4496('0x42')]['id']}})[_0x4496('0x23')](handleEntityNotFound(_0x4256c0,null))[_0x4496('0x23')](removeEntity(_0x4256c0,null))['catch'](handleError(_0x4256c0,null));};exports[_0x4496('0x49')]=function(_0x41efa7,_0x365af4){return db[_0x4496('0x29')][_0x4496('0x49')]()[_0x4496('0x23')](respondWithResult(_0x365af4,null))['catch'](handleError(_0x365af4,null));}; \ No newline at end of file +var _0x8623=['create','body','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','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','save','update','then','destroy','error','name','send','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','length','options','find'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x8623,0x1f3));var _0x3862=function(_0x3a1638,_0x572300){_0x3a1638=_0x3a1638-0x0;var _0x38d646=_0x8623[_0x3a1638];return _0x38d646;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3862('0x0'));var zipdir=require(_0x3862('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3862('0x2'));var BPromise=require(_0x3862('0x3'));var Mustache=require(_0x3862('0x4'));var util=require(_0x3862('0x5'));var path=require(_0x3862('0x6'));var sox=require('sox');var csv=require(_0x3862('0x7'));var ejs=require(_0x3862('0x8'));var fs=require('fs');var fs_extra=require(_0x3862('0x9'));var _=require(_0x3862('0xa'));var squel=require(_0x3862('0xb'));var crypto=require(_0x3862('0xc'));var jsforce=require(_0x3862('0xd'));var deskjs=require(_0x3862('0xe'));var toCsv=require(_0x3862('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3862('0xf'));var authService=require(_0x3862('0x10'));var qs=require(_0x3862('0x11'));var as=require(_0x3862('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3862('0x13'));var utils=require(_0x3862('0x14'));var config=require(_0x3862('0x15'));var licenseUtil=require(_0x3862('0x16'));var db=require(_0x3862('0x17'))['db'];function respondWithStatusCode(_0x1d814e,_0x1042ad){_0x1042ad=_0x1042ad||0xcc;return function(_0xc4d2bd){if(_0xc4d2bd){return _0x1d814e[_0x3862('0x18')](_0x1042ad);}return _0x1d814e[_0x3862('0x19')](_0x1042ad)[_0x3862('0x1a')]();};}function respondWithResult(_0x327f97,_0x1717a7){_0x1717a7=_0x1717a7||0xc8;return function(_0xae50c9){if(_0xae50c9){return _0x327f97[_0x3862('0x19')](_0x1717a7)[_0x3862('0x1b')](_0xae50c9);}};}function respondWithFilteredResult(_0x381f5d,_0x25bc28){return function(_0x5026f8){if(_0x5026f8){var _0xbaabfc=typeof _0x25bc28[_0x3862('0x1c')]===_0x3862('0x1d')&&typeof _0x25bc28[_0x3862('0x1e')]===_0x3862('0x1d');var _0x5393ca=_0x5026f8[_0x3862('0x1f')];var _0x2d4a9d=_0xbaabfc?0x0:_0x25bc28[_0x3862('0x1c')];var _0x1b32e0=_0xbaabfc?_0x5026f8[_0x3862('0x1f')]:_0x25bc28[_0x3862('0x1c')]+_0x25bc28[_0x3862('0x1e')];var _0x13b457;if(_0x1b32e0>=_0x5393ca){_0x1b32e0=_0x5393ca;_0x13b457=0xc8;}else{_0x13b457=0xce;}_0x381f5d[_0x3862('0x19')](_0x13b457);return _0x381f5d['set'](_0x3862('0x20'),_0x2d4a9d+'-'+_0x1b32e0+'/'+_0x5393ca)[_0x3862('0x1b')](_0x5026f8);}return null;};}function patchUpdates(_0x2d89d2){return function(_0x4578d9){try{jsonpatch[_0x3862('0x21')](_0x4578d9,_0x2d89d2,!![]);}catch(_0x5d2495){return BPromise['reject'](_0x5d2495);}return _0x4578d9[_0x3862('0x22')]();};}function saveUpdates(_0x1de8e4,_0x251a2c){return function(_0x3f19d7){if(_0x3f19d7){return _0x3f19d7[_0x3862('0x23')](_0x1de8e4)[_0x3862('0x24')](function(_0x703a65){return _0x703a65;});}return null;};}function removeEntity(_0x182280,_0x1c0eec){return function(_0x20a5c8){if(_0x20a5c8){return _0x20a5c8[_0x3862('0x25')]()['then'](function(){_0x182280['status'](0xcc)[_0x3862('0x1a')]();});}};}function handleEntityNotFound(_0xe6a220,_0x3f8ef0){return function(_0x1667de){if(!_0x1667de){_0xe6a220[_0x3862('0x18')](0x194);}return _0x1667de;};}function handleError(_0x4c7e72,_0x4d8075){_0x4d8075=_0x4d8075||0x1f4;return function(_0x2531a5){logger[_0x3862('0x26')](_0x2531a5['stack']);if(_0x2531a5[_0x3862('0x27')]){delete _0x2531a5[_0x3862('0x27')];}_0x4c7e72['status'](_0x4d8075)[_0x3862('0x28')](_0x2531a5);};}exports['index']=function(_0x1f11cc,_0x103f5f){var _0xb5f557={},_0xb73f0={},_0x341398={'count':0x0,'rows':[]};var _0x20c515=_['map'](db[_0x3862('0x29')][_0x3862('0x2a')],function(_0x2776a3){return{'name':_0x2776a3[_0x3862('0x2b')],'type':_0x2776a3[_0x3862('0x2c')][_0x3862('0x2d')]};});_0xb73f0[_0x3862('0x2e')]=_['map'](_0x20c515,_0x3862('0x27'));_0xb73f0[_0x3862('0x2f')]=_[_0x3862('0x30')](_0x1f11cc['query']);_0xb73f0[_0x3862('0x31')]=_[_0x3862('0x32')](_0xb73f0[_0x3862('0x2e')],_0xb73f0[_0x3862('0x2f')]);_0xb5f557[_0x3862('0x33')]=_[_0x3862('0x32')](_0xb73f0['model'],qs[_0x3862('0x34')](_0x1f11cc[_0x3862('0x2f')][_0x3862('0x34')]));_0xb5f557['attributes']=_0xb5f557[_0x3862('0x33')]['length']?_0xb5f557[_0x3862('0x33')]:_0xb73f0['model'];if(!_0x1f11cc[_0x3862('0x2f')]['hasOwnProperty'](_0x3862('0x35'))){_0xb5f557[_0x3862('0x1e')]=qs[_0x3862('0x1e')](_0x1f11cc[_0x3862('0x2f')][_0x3862('0x1e')]);_0xb5f557[_0x3862('0x1c')]=qs[_0x3862('0x1c')](_0x1f11cc[_0x3862('0x2f')][_0x3862('0x1c')]);}_0xb5f557[_0x3862('0x36')]=qs[_0x3862('0x37')](_0x1f11cc[_0x3862('0x2f')][_0x3862('0x37')]);_0xb5f557[_0x3862('0x38')]=qs[_0x3862('0x31')](_['pick'](_0x1f11cc[_0x3862('0x2f')],_0xb73f0['filters']),_0x20c515);if(_0x1f11cc['query'][_0x3862('0x39')]){_0xb5f557[_0x3862('0x38')]=_[_0x3862('0x3a')](_0xb5f557[_0x3862('0x38')],{'$or':_['map'](_0x20c515,function(_0x5b1393){if(_0x5b1393[_0x3862('0x2c')]!==_0x3862('0x3b')){var _0x3e9096={};_0x3e9096[_0x5b1393[_0x3862('0x27')]]={'$like':'%'+_0x1f11cc[_0x3862('0x2f')][_0x3862('0x39')]+'%'};return _0x3e9096;}})});}_0xb5f557=_[_0x3862('0x3a')]({},_0xb5f557,_0x1f11cc['options']);var _0x57ce39={'where':_0xb5f557[_0x3862('0x38')]};return db[_0x3862('0x29')][_0x3862('0x1f')](_0x57ce39)[_0x3862('0x24')](function(_0x57d23f){_0x341398[_0x3862('0x1f')]=_0x57d23f;if(_0x1f11cc['query'][_0x3862('0x3c')]){_0xb5f557[_0x3862('0x3d')]=[{'all':!![]}];}return db[_0x3862('0x29')][_0x3862('0x3e')](_0xb5f557);})['then'](function(_0x1557de){_0x341398[_0x3862('0x3f')]=_0x1557de;return _0x341398;})['then'](respondWithFilteredResult(_0x103f5f,_0xb5f557))[_0x3862('0x40')](handleError(_0x103f5f,null));};exports['show']=function(_0x6676aa,_0x1df049){var _0x4f1f96={'raw':!![],'where':{'id':_0x6676aa[_0x3862('0x41')]['id']}},_0x46e282={};_0x46e282[_0x3862('0x2e')]=_[_0x3862('0x30')](db[_0x3862('0x29')][_0x3862('0x2a')]);_0x46e282[_0x3862('0x2f')]=_[_0x3862('0x30')](_0x6676aa['query']);_0x46e282[_0x3862('0x31')]=_[_0x3862('0x32')](_0x46e282[_0x3862('0x2e')],_0x46e282[_0x3862('0x2f')]);_0x4f1f96['attributes']=_[_0x3862('0x32')](_0x46e282['model'],qs[_0x3862('0x34')](_0x6676aa[_0x3862('0x2f')][_0x3862('0x34')]));_0x4f1f96['attributes']=_0x4f1f96[_0x3862('0x33')][_0x3862('0x42')]?_0x4f1f96[_0x3862('0x33')]:_0x46e282['model'];if(_0x6676aa[_0x3862('0x2f')][_0x3862('0x3c')]){_0x4f1f96[_0x3862('0x3d')]=[{'all':!![]}];}_0x4f1f96=_[_0x3862('0x3a')]({},_0x4f1f96,_0x6676aa[_0x3862('0x43')]);return db[_0x3862('0x29')][_0x3862('0x44')](_0x4f1f96)[_0x3862('0x24')](handleEntityNotFound(_0x1df049,null))[_0x3862('0x24')](respondWithResult(_0x1df049,null))[_0x3862('0x40')](handleError(_0x1df049,null));};exports[_0x3862('0x45')]=function(_0x4c57c9,_0x2d2039){return db[_0x3862('0x29')][_0x3862('0x45')](_0x4c57c9['body'],{})[_0x3862('0x24')](respondWithResult(_0x2d2039,0xc9))[_0x3862('0x40')](handleError(_0x2d2039,null));};exports[_0x3862('0x23')]=function(_0x5b5e1c,_0x5cda74){if(_0x5b5e1c['body']['id']){delete _0x5b5e1c[_0x3862('0x46')]['id'];}return db[_0x3862('0x29')][_0x3862('0x44')]({'where':{'id':_0x5b5e1c[_0x3862('0x41')]['id']}})['then'](handleEntityNotFound(_0x5cda74,null))[_0x3862('0x24')](saveUpdates(_0x5b5e1c[_0x3862('0x46')],null))['then'](respondWithResult(_0x5cda74,null))[_0x3862('0x40')](handleError(_0x5cda74,null));};exports[_0x3862('0x25')]=function(_0x2a2737,_0x558c09){return db[_0x3862('0x29')][_0x3862('0x44')]({'where':{'id':_0x2a2737[_0x3862('0x41')]['id']}})[_0x3862('0x24')](handleEntityNotFound(_0x558c09,null))[_0x3862('0x24')](removeEntity(_0x558c09,null))[_0x3862('0x40')](handleError(_0x558c09,null));};exports['describe']=function(_0x205c29,_0x21749a){return db[_0x3862('0x29')]['describe']()[_0x3862('0x24')](respondWithResult(_0x21749a,null))['catch'](handleError(_0x21749a,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 0f65259..2b1a9ec 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x18e70f,_0x2194dd){var _0xf3da50=function(_0x391b9f){while(--_0x391b9f){_0x18e70f['push'](_0x18e70f['shift']());}};_0xf3da50(++_0x2194dd);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x352b49,_0x16a4ee){var _0x2e314a=function(_0x339d73){while(--_0x339d73){_0x352b49['push'](_0x352b49['shift']());}};_0x2e314a(++_0x16a4ee);}(_0xe706,0xa3));var _0x6e70=function(_0x4b49cc,_0x24c7f5){_0x4b49cc=_0x4b49cc-0x0;var _0x3e60aa=_0xe706[_0x4b49cc];return _0x3e60aa;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b2dd098..59c31bd 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 _0xe0d4=['then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','attributes','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0xe0d4,0xec));var _0x4e0d=function(_0x5b948b,_0x196286){_0x5b948b=_0x5b948b-0x0;var _0x100865=_0xe0d4[_0x5b948b];return _0x100865;};'use strict';var _=require('lodash');var util=require(_0x4e0d('0x0'));var moment=require(_0x4e0d('0x1'));var BPromise=require(_0x4e0d('0x2'));var rs=require(_0x4e0d('0x3'));var fs=require('fs');var Redis=require(_0x4e0d('0x4'));var db=require(_0x4e0d('0x5'))['db'];var utils=require(_0x4e0d('0x6'));var logger=require(_0x4e0d('0x7'))('rpc');var config=require(_0x4e0d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4e0d('0x9')][_0x4e0d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bdf52,_0x2bd246,_0x23207a){return new BPromise(function(_0x2d6fc0,_0x4c98b4){return client[_0x4e0d('0xb')](_0x5bdf52,_0x23207a)[_0x4e0d('0xc')](function(_0x25b3a9){logger[_0x4e0d('0xd')](_0x4e0d('0xe'),_0x2bd246,'request\x20sent');logger[_0x4e0d('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2bd246,_0x4e0d('0x10'),JSON['stringify'](_0x25b3a9));if(_0x25b3a9[_0x4e0d('0x11')]){if(_0x25b3a9['error'][_0x4e0d('0x12')]===0x1f4){logger[_0x4e0d('0x11')](_0x4e0d('0xe'),_0x2bd246,_0x25b3a9[_0x4e0d('0x11')][_0x4e0d('0x13')]);return _0x4c98b4(_0x25b3a9['error'][_0x4e0d('0x13')]);}logger[_0x4e0d('0x11')](_0x4e0d('0xe'),_0x2bd246,_0x25b3a9[_0x4e0d('0x11')][_0x4e0d('0x13')]);return _0x2d6fc0(_0x25b3a9[_0x4e0d('0x11')][_0x4e0d('0x13')]);}else{logger[_0x4e0d('0xd')](_0x4e0d('0xe'),_0x2bd246,_0x4e0d('0x10'));_0x2d6fc0(_0x25b3a9[_0x4e0d('0x14')]['message']);}})[_0x4e0d('0x15')](function(_0x48336){logger[_0x4e0d('0x11')](_0x4e0d('0xe'),_0x2bd246,_0x48336);_0x4c98b4(_0x48336);});});}exports['CreateSmsQueueReport']=function(_0x4aa7de){var _0x4b8fe4=this;return new Promise(function(_0x360494,_0x111748){return db[_0x4e0d('0x16')][_0x4e0d('0x17')](_0x4aa7de[_0x4e0d('0x18')],{'raw':_0x4aa7de[_0x4e0d('0x19')]?_0x4aa7de[_0x4e0d('0x19')][_0x4e0d('0x1a')]===undefined?!![]:![]:!![]})[_0x4e0d('0xc')](function(_0x345b01){logger[_0x4e0d('0xd')](_0x4e0d('0x1b'),_0x4aa7de);logger[_0x4e0d('0xf')](_0x4e0d('0x1b'),_0x4aa7de,JSON['stringify'](_0x345b01));_0x360494(_0x345b01);})[_0x4e0d('0x15')](function(_0x44704b){logger[_0x4e0d('0x11')]('CreateSmsQueueReport',_0x44704b[_0x4e0d('0x13')],_0x4aa7de);_0x111748(_0x4b8fe4[_0x4e0d('0x11')](0x1f4,_0x44704b[_0x4e0d('0x13')]));});});};exports[_0x4e0d('0x1c')]=function(_0x3235d7){var _0x31b4e6=this;return new Promise(function(_0x460216,_0x592cab){return db['SmsQueueReport']['update'](_0x3235d7[_0x4e0d('0x18')],{'raw':_0x3235d7['options']?_0x3235d7['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3235d7[_0x4e0d('0x19')]?_0x3235d7['options']['where']||null:null,'attributes':_0x3235d7[_0x4e0d('0x19')]?_0x3235d7['options'][_0x4e0d('0x1d')]||null:null,'limit':_0x3235d7['options']?_0x3235d7['options']['limit']||null:null})[_0x4e0d('0xc')](function(_0x4a826e){logger[_0x4e0d('0xd')](_0x4e0d('0x1c'),_0x3235d7);logger[_0x4e0d('0xf')](_0x4e0d('0x1c'),_0x3235d7,JSON[_0x4e0d('0x1e')](_0x4a826e));_0x460216(_0x4a826e);})['catch'](function(_0x8d16d4){logger[_0x4e0d('0x11')](_0x4e0d('0x1c'),_0x8d16d4[_0x4e0d('0x13')],_0x3235d7);_0x592cab(_0x31b4e6[_0x4e0d('0x11')](0x1f4,_0x8d16d4[_0x4e0d('0x13')]));});});}; \ No newline at end of file +var _0x31f9=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch','SmsQueueReport','create','body','options','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','raw','where','attributes','limit','lodash','util'];(function(_0x5e1f24,_0x442000){var _0x53823d=function(_0x44f343){while(--_0x44f343){_0x5e1f24['push'](_0x5e1f24['shift']());}};_0x53823d(++_0x442000);}(_0x31f9,0x18a));var _0x931f=function(_0x7134b9,_0x377d33){_0x7134b9=_0x7134b9-0x0;var _0x2b44fd=_0x31f9[_0x7134b9];return _0x2b44fd;};'use strict';var _=require(_0x931f('0x0'));var util=require(_0x931f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x931f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x931f('0x3'));var logger=require(_0x931f('0x4'))(_0x931f('0x5'));var config=require(_0x931f('0x6'));var jayson=require(_0x931f('0x7'));var client=jayson['client'][_0x931f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5b6852,_0x4ce373,_0x404dc9){return new BPromise(function(_0x5a7103,_0x556177){return client[_0x931f('0x9')](_0x5b6852,_0x404dc9)[_0x931f('0xa')](function(_0x21afe1){logger[_0x931f('0xb')]('SmsQueueReport,\x20%s,\x20%s',_0x4ce373,'request\x20sent');logger[_0x931f('0xc')](_0x931f('0xd'),_0x4ce373,_0x931f('0xe'),JSON['stringify'](_0x21afe1));if(_0x21afe1['error']){if(_0x21afe1[_0x931f('0xf')][_0x931f('0x10')]===0x1f4){logger[_0x931f('0xf')](_0x931f('0x11'),_0x4ce373,_0x21afe1[_0x931f('0xf')][_0x931f('0x12')]);return _0x556177(_0x21afe1[_0x931f('0xf')][_0x931f('0x12')]);}logger['error'](_0x931f('0x11'),_0x4ce373,_0x21afe1[_0x931f('0xf')][_0x931f('0x12')]);return _0x5a7103(_0x21afe1['error'][_0x931f('0x12')]);}else{logger[_0x931f('0xb')](_0x931f('0x11'),_0x4ce373,_0x931f('0xe'));_0x5a7103(_0x21afe1[_0x931f('0x13')][_0x931f('0x12')]);}})[_0x931f('0x14')](function(_0x1a35c0){logger[_0x931f('0xf')](_0x931f('0x11'),_0x4ce373,_0x1a35c0);_0x556177(_0x1a35c0);});});}exports['CreateSmsQueueReport']=function(_0x515b0a){var _0x19649c=this;return new Promise(function(_0xd618fb,_0x13dfc0){return db[_0x931f('0x15')][_0x931f('0x16')](_0x515b0a[_0x931f('0x17')],{'raw':_0x515b0a[_0x931f('0x18')]?_0x515b0a[_0x931f('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x931f('0xa')](function(_0x56e453){logger[_0x931f('0xb')](_0x931f('0x19'),_0x515b0a);logger[_0x931f('0xc')]('CreateSmsQueueReport',_0x515b0a,JSON[_0x931f('0x1a')](_0x56e453));_0xd618fb(_0x56e453);})['catch'](function(_0x2d5492){logger['error'](_0x931f('0x19'),_0x2d5492[_0x931f('0x12')],_0x515b0a);_0x13dfc0(_0x19649c[_0x931f('0xf')](0x1f4,_0x2d5492[_0x931f('0x12')]));});});};exports[_0x931f('0x1b')]=function(_0x507e48){var _0x41680e=this;return new Promise(function(_0x59ef7c,_0x1e1449){return db['SmsQueueReport'][_0x931f('0x1c')](_0x507e48[_0x931f('0x17')],{'raw':_0x507e48[_0x931f('0x18')]?_0x507e48[_0x931f('0x18')][_0x931f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x507e48[_0x931f('0x18')]?_0x507e48[_0x931f('0x18')][_0x931f('0x1e')]||null:null,'attributes':_0x507e48[_0x931f('0x18')]?_0x507e48[_0x931f('0x18')][_0x931f('0x1f')]||null:null,'limit':_0x507e48[_0x931f('0x18')]?_0x507e48['options'][_0x931f('0x20')]||null:null})['then'](function(_0x5505d2){logger['info'](_0x931f('0x1b'),_0x507e48);logger[_0x931f('0xc')](_0x931f('0x1b'),_0x507e48,JSON['stringify'](_0x5505d2));_0x59ef7c(_0x5505d2);})[_0x931f('0x14')](function(_0x7e37ce){logger[_0x931f('0xf')]('UpdateSmsQueueReport',_0x7e37ce[_0x931f('0x12')],_0x507e48);_0x1e1449(_0x41680e[_0x931f('0xf')](0x1f4,_0x7e37ce[_0x931f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 08282a3..f7fae34 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 _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(_0x2da516,_0x325e0c){var _0x3a5f8a=function(_0x2945ce){while(--_0x2945ce){_0x2da516['push'](_0x2da516['shift']());}};_0x3a5f8a(++_0x325e0c);}(_0x5636,0x102));var _0x6563=function(_0xda0962,_0x5eee41){_0xda0962=_0xda0962-0x0;var _0x42440e=_0x5636[_0xda0962];return _0x42440e;};'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 +var _0xa990=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','update','delete','destroy'];(function(_0x5f3989,_0x45f395){var _0x4d677d=function(_0x22a839){while(--_0x22a839){_0x5f3989['push'](_0x5f3989['shift']());}};_0x4d677d(++_0x45f395);}(_0xa990,0xc9));var _0x0a99=function(_0x2e16ca,_0x5afbfc){_0x2e16ca=_0x2e16ca-0x0;var _0x492f9d=_0xa990[_0x2e16ca];return _0x492f9d;};'use strict';var multer=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var path=require(_0x0a99('0x2'));var timeout=require(_0x0a99('0x3'));var express=require(_0x0a99('0x4'));var router=express[_0x0a99('0x5')]();var fs_extra=require(_0x0a99('0x6'));var auth=require(_0x0a99('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a99('0x8'));router[_0x0a99('0x9')]('/',auth[_0x0a99('0xa')](),controller[_0x0a99('0xb')]);router[_0x0a99('0x9')](_0x0a99('0xc'),auth[_0x0a99('0xa')](),controller[_0x0a99('0xd')]);router[_0x0a99('0x9')](_0x0a99('0xe'),auth[_0x0a99('0xa')](),controller['show']);router[_0x0a99('0xf')]('/',auth[_0x0a99('0xa')](),controller['create']);router['put'](_0x0a99('0xe'),auth[_0x0a99('0xa')](),controller[_0x0a99('0x10')]);router[_0x0a99('0x11')](_0x0a99('0xe'),auth['isAuthenticated'](),controller[_0x0a99('0x12')]);module[_0x0a99('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index ffabbb3..861086a 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0xb43b,0x1b2));var _0xbb43=function(_0x45c88e,_0xf74a8){_0x45c88e=_0x45c88e-0x0;var _0x3f638e=_0xb43b[_0x45c88e];return _0x3f638e;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x338367,_0xc2ed00){var _0x5ee2b4=function(_0x34968f){while(--_0x34968f){_0x338367['push'](_0x338367['shift']());}};_0x5ee2b4(++_0xc2ed00);}(_0x34e8,0x12c));var _0x834e=function(_0x20d54b,_0x5e6664){_0x20d54b=_0x20d54b-0x0;var _0x5ed31d=_0x34e8[_0x20d54b];return _0x5ed31d;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 878c03b..9de1a4b 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 _0x843e=['SmsTransferReport','includeAll','include','findAll','rows','catch','params','find','update','body','describe','eml-format','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','destroy','name','index','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x378882,_0x8120f1){var _0x356dc8=function(_0x26bc0f){while(--_0x26bc0f){_0x378882['push'](_0x378882['shift']());}};_0x356dc8(++_0x8120f1);}(_0x843e,0x1af));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe843('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe843('0x1'));var jsonpatch=require(_0xe843('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe843('0x3'));var util=require(_0xe843('0x4'));var path=require('path');var sox=require(_0xe843('0x5'));var csv=require(_0xe843('0x6'));var ejs=require(_0xe843('0x7'));var fs=require('fs');var fs_extra=require(_0xe843('0x8'));var _=require('lodash');var squel=require(_0xe843('0x9'));var crypto=require(_0xe843('0xa'));var jsforce=require(_0xe843('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe843('0xc'));var Papa=require(_0xe843('0xd'));var Redis=require(_0xe843('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe843('0xf'));var hardwareService=require(_0xe843('0x10'));var logger=require(_0xe843('0x11'))('api');var utils=require(_0xe843('0x12'));var config=require(_0xe843('0x13'));var licenseUtil=require(_0xe843('0x14'));var db=require(_0xe843('0x15'))['db'];function respondWithStatusCode(_0x6ce1bd,_0x137660){_0x137660=_0x137660||0xcc;return function(_0x300e63){if(_0x300e63){return _0x6ce1bd[_0xe843('0x16')](_0x137660);}return _0x6ce1bd[_0xe843('0x17')](_0x137660)[_0xe843('0x18')]();};}function respondWithResult(_0xacbadd,_0x53246d){_0x53246d=_0x53246d||0xc8;return function(_0x5c3ae7){if(_0x5c3ae7){return _0xacbadd[_0xe843('0x17')](_0x53246d)[_0xe843('0x19')](_0x5c3ae7);}};}function respondWithFilteredResult(_0x56bac8,_0x4fa861){return function(_0x268bfd){if(_0x268bfd){var _0x1765f6=typeof _0x4fa861[_0xe843('0x1a')]===_0xe843('0x1b')&&typeof _0x4fa861['limit']===_0xe843('0x1b');var _0x496862=_0x268bfd['count'];var _0x2accd6=_0x1765f6?0x0:_0x4fa861[_0xe843('0x1a')];var _0xf67995=_0x1765f6?_0x268bfd[_0xe843('0x1c')]:_0x4fa861[_0xe843('0x1a')]+_0x4fa861['limit'];var _0x3d3501;if(_0xf67995>=_0x496862){_0xf67995=_0x496862;_0x3d3501=0xc8;}else{_0x3d3501=0xce;}_0x56bac8['status'](_0x3d3501);return _0x56bac8[_0xe843('0x1d')](_0xe843('0x1e'),_0x2accd6+'-'+_0xf67995+'/'+_0x496862)['json'](_0x268bfd);}return null;};}function patchUpdates(_0x508e09){return function(_0x1b254b){try{jsonpatch[_0xe843('0x1f')](_0x1b254b,_0x508e09,!![]);}catch(_0x3fba4d){return BPromise[_0xe843('0x20')](_0x3fba4d);}return _0x1b254b[_0xe843('0x21')]();};}function saveUpdates(_0x2fe6b4,_0x47ac18){return function(_0x26093e){if(_0x26093e){return _0x26093e['update'](_0x2fe6b4)[_0xe843('0x22')](function(_0x337996){return _0x337996;});}return null;};}function removeEntity(_0x15caf7,_0x1801f6){return function(_0x29be7f){if(_0x29be7f){return _0x29be7f[_0xe843('0x23')]()[_0xe843('0x22')](function(){_0x15caf7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x142a81,_0x456bea){return function(_0x324ef7){if(!_0x324ef7){_0x142a81[_0xe843('0x16')](0x194);}return _0x324ef7;};}function handleError(_0x41ebaf,_0x21265c){_0x21265c=_0x21265c||0x1f4;return function(_0x3e1ca1){logger['error'](_0x3e1ca1['stack']);if(_0x3e1ca1[_0xe843('0x24')]){delete _0x3e1ca1['name'];}_0x41ebaf[_0xe843('0x17')](_0x21265c)['send'](_0x3e1ca1);};}exports[_0xe843('0x25')]=function(_0x9a3c89,_0x4b88a7){var _0x525ccd={},_0x5bc83a={},_0xaca19a={'count':0x0,'rows':[]};var _0x2c6f5b=_['map'](db['SmsTransferReport'][_0xe843('0x26')],function(_0x581b15){return{'name':_0x581b15[_0xe843('0x27')],'type':_0x581b15[_0xe843('0x28')]['key']};});_0x5bc83a[_0xe843('0x29')]=_[_0xe843('0x2a')](_0x2c6f5b,_0xe843('0x24'));_0x5bc83a['query']=_[_0xe843('0x2b')](_0x9a3c89['query']);_0x5bc83a[_0xe843('0x2c')]=_[_0xe843('0x2d')](_0x5bc83a[_0xe843('0x29')],_0x5bc83a[_0xe843('0x2e')]);_0x525ccd[_0xe843('0x2f')]=_[_0xe843('0x2d')](_0x5bc83a[_0xe843('0x29')],qs[_0xe843('0x30')](_0x9a3c89['query']['fields']));_0x525ccd[_0xe843('0x2f')]=_0x525ccd[_0xe843('0x2f')][_0xe843('0x31')]?_0x525ccd['attributes']:_0x5bc83a[_0xe843('0x29')];if(!_0x9a3c89[_0xe843('0x2e')]['hasOwnProperty']('nolimit')){_0x525ccd['limit']=qs[_0xe843('0x32')](_0x9a3c89[_0xe843('0x2e')][_0xe843('0x32')]);_0x525ccd[_0xe843('0x1a')]=qs[_0xe843('0x1a')](_0x9a3c89[_0xe843('0x2e')]['offset']);}_0x525ccd[_0xe843('0x33')]=qs['sort'](_0x9a3c89[_0xe843('0x2e')][_0xe843('0x34')]);_0x525ccd[_0xe843('0x35')]=qs[_0xe843('0x2c')](_[_0xe843('0x36')](_0x9a3c89[_0xe843('0x2e')],_0x5bc83a[_0xe843('0x2c')]),_0x2c6f5b);if(_0x9a3c89[_0xe843('0x2e')][_0xe843('0x37')]){_0x525ccd['where']=_[_0xe843('0x38')](_0x525ccd['where'],{'$or':_[_0xe843('0x2a')](_0x2c6f5b,function(_0xfa5356){if(_0xfa5356[_0xe843('0x28')]!==_0xe843('0x39')){var _0x2bcba8={};_0x2bcba8[_0xfa5356[_0xe843('0x24')]]={'$like':'%'+_0x9a3c89[_0xe843('0x2e')][_0xe843('0x37')]+'%'};return _0x2bcba8;}})});}_0x525ccd=_[_0xe843('0x38')]({},_0x525ccd,_0x9a3c89[_0xe843('0x3a')]);var _0x21db58={'where':_0x525ccd['where']};return db[_0xe843('0x3b')][_0xe843('0x1c')](_0x21db58)[_0xe843('0x22')](function(_0x565236){_0xaca19a[_0xe843('0x1c')]=_0x565236;if(_0x9a3c89['query'][_0xe843('0x3c')]){_0x525ccd[_0xe843('0x3d')]=[{'all':!![]}];}return db[_0xe843('0x3b')][_0xe843('0x3e')](_0x525ccd);})[_0xe843('0x22')](function(_0x390209){_0xaca19a[_0xe843('0x3f')]=_0x390209;return _0xaca19a;})[_0xe843('0x22')](respondWithFilteredResult(_0x4b88a7,_0x525ccd))[_0xe843('0x40')](handleError(_0x4b88a7,null));};exports['show']=function(_0x56e259,_0x432d6f){var _0x37d676={'raw':!![],'where':{'id':_0x56e259[_0xe843('0x41')]['id']}},_0x58e06e={};_0x58e06e[_0xe843('0x29')]=_[_0xe843('0x2b')](db[_0xe843('0x3b')][_0xe843('0x26')]);_0x58e06e['query']=_[_0xe843('0x2b')](_0x56e259[_0xe843('0x2e')]);_0x58e06e['filters']=_[_0xe843('0x2d')](_0x58e06e[_0xe843('0x29')],_0x58e06e[_0xe843('0x2e')]);_0x37d676[_0xe843('0x2f')]=_[_0xe843('0x2d')](_0x58e06e['model'],qs[_0xe843('0x30')](_0x56e259[_0xe843('0x2e')][_0xe843('0x30')]));_0x37d676[_0xe843('0x2f')]=_0x37d676['attributes'][_0xe843('0x31')]?_0x37d676[_0xe843('0x2f')]:_0x58e06e[_0xe843('0x29')];if(_0x56e259['query'][_0xe843('0x3c')]){_0x37d676[_0xe843('0x3d')]=[{'all':!![]}];}_0x37d676=_['merge']({},_0x37d676,_0x56e259[_0xe843('0x3a')]);return db[_0xe843('0x3b')][_0xe843('0x42')](_0x37d676)[_0xe843('0x22')](handleEntityNotFound(_0x432d6f,null))[_0xe843('0x22')](respondWithResult(_0x432d6f,null))['catch'](handleError(_0x432d6f,null));};exports['create']=function(_0x22cd48,_0x41e826){return db['SmsTransferReport']['create'](_0x22cd48['body'],{})[_0xe843('0x22')](respondWithResult(_0x41e826,0xc9))[_0xe843('0x40')](handleError(_0x41e826,null));};exports[_0xe843('0x43')]=function(_0x4f1393,_0x28045d){if(_0x4f1393['body']['id']){delete _0x4f1393['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x4f1393[_0xe843('0x41')]['id']}})[_0xe843('0x22')](handleEntityNotFound(_0x28045d,null))[_0xe843('0x22')](saveUpdates(_0x4f1393[_0xe843('0x44')],null))[_0xe843('0x22')](respondWithResult(_0x28045d,null))[_0xe843('0x40')](handleError(_0x28045d,null));};exports['destroy']=function(_0x34503b,_0x394eb0){return db[_0xe843('0x3b')]['find']({'where':{'id':_0x34503b[_0xe843('0x41')]['id']}})[_0xe843('0x22')](handleEntityNotFound(_0x394eb0,null))[_0xe843('0x22')](removeEntity(_0x394eb0,null))[_0xe843('0x40')](handleError(_0x394eb0,null));};exports[_0xe843('0x45')]=function(_0x3893ac,_0x37616b){return db[_0xe843('0x3b')][_0xe843('0x45')]()[_0xe843('0x22')](respondWithResult(_0x37616b,null))[_0xe843('0x40')](handleError(_0x37616b,null));}; \ No newline at end of file +var _0x196e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SmsTransferReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','type','VIRTUAL','filter','include','findAll','catch','show','params','includeAll','merge','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x196e,0x16a));var _0xe196=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x196e[_0x13ce0c];return _0x4388fb;};'use strict';var emlformat=require(_0xe196('0x0'));var rimraf=require(_0xe196('0x1'));var zipdir=require(_0xe196('0x2'));var jsonpatch=require(_0xe196('0x3'));var rp=require(_0xe196('0x4'));var moment=require('moment');var BPromise=require(_0xe196('0x5'));var Mustache=require(_0xe196('0x6'));var util=require('util');var path=require(_0xe196('0x7'));var sox=require(_0xe196('0x8'));var csv=require('to-csv');var ejs=require(_0xe196('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe196('0xa'));var squel=require(_0xe196('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe196('0xc'));var toCsv=require(_0xe196('0xd'));var querystring=require(_0xe196('0xe'));var Papa=require(_0xe196('0xf'));var Redis=require(_0xe196('0x10'));var authService=require(_0xe196('0x11'));var qs=require(_0xe196('0x12'));var as=require(_0xe196('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe196('0x14'))(_0xe196('0x15'));var utils=require(_0xe196('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe196('0x17'))['db'];function respondWithStatusCode(_0x50a208,_0x17e7af){_0x17e7af=_0x17e7af||0xcc;return function(_0x13a6b4){if(_0x13a6b4){return _0x50a208[_0xe196('0x18')](_0x17e7af);}return _0x50a208[_0xe196('0x19')](_0x17e7af)[_0xe196('0x1a')]();};}function respondWithResult(_0x167a87,_0xa50ad3){_0xa50ad3=_0xa50ad3||0xc8;return function(_0x40b8dd){if(_0x40b8dd){return _0x167a87[_0xe196('0x19')](_0xa50ad3)[_0xe196('0x1b')](_0x40b8dd);}};}function respondWithFilteredResult(_0x264af2,_0xfed08d){return function(_0x284349){if(_0x284349){var _0x55a4f2=typeof _0xfed08d[_0xe196('0x1c')]===_0xe196('0x1d')&&typeof _0xfed08d['limit']==='undefined';var _0x2d9edd=_0x284349[_0xe196('0x1e')];var _0x64bb0f=_0x55a4f2?0x0:_0xfed08d['offset'];var _0x5bcf5b=_0x55a4f2?_0x284349[_0xe196('0x1e')]:_0xfed08d[_0xe196('0x1c')]+_0xfed08d['limit'];var _0x2dcc20;if(_0x5bcf5b>=_0x2d9edd){_0x5bcf5b=_0x2d9edd;_0x2dcc20=0xc8;}else{_0x2dcc20=0xce;}_0x264af2['status'](_0x2dcc20);return _0x264af2[_0xe196('0x1f')](_0xe196('0x20'),_0x64bb0f+'-'+_0x5bcf5b+'/'+_0x2d9edd)[_0xe196('0x1b')](_0x284349);}return null;};}function patchUpdates(_0x2e92df){return function(_0x4f0131){try{jsonpatch[_0xe196('0x21')](_0x4f0131,_0x2e92df,!![]);}catch(_0x5f2f15){return BPromise[_0xe196('0x22')](_0x5f2f15);}return _0x4f0131[_0xe196('0x23')]();};}function saveUpdates(_0x27a16b,_0x2f8fc4){return function(_0x30e414){if(_0x30e414){return _0x30e414[_0xe196('0x24')](_0x27a16b)[_0xe196('0x25')](function(_0x5ca215){return _0x5ca215;});}return null;};}function removeEntity(_0x1277d7,_0x94db07){return function(_0x1274a9){if(_0x1274a9){return _0x1274a9[_0xe196('0x26')]()[_0xe196('0x25')](function(){_0x1277d7[_0xe196('0x19')](0xcc)[_0xe196('0x1a')]();});}};}function handleEntityNotFound(_0x56acb6,_0x16a2e9){return function(_0x3ccfdb){if(!_0x3ccfdb){_0x56acb6['sendStatus'](0x194);}return _0x3ccfdb;};}function handleError(_0x14d9d6,_0x1f4aaf){_0x1f4aaf=_0x1f4aaf||0x1f4;return function(_0x4b1eb4){logger[_0xe196('0x27')](_0x4b1eb4[_0xe196('0x28')]);if(_0x4b1eb4[_0xe196('0x29')]){delete _0x4b1eb4[_0xe196('0x29')];}_0x14d9d6[_0xe196('0x19')](_0x1f4aaf)[_0xe196('0x2a')](_0x4b1eb4);};}exports['index']=function(_0x2c930d,_0x2a4c8d){var _0x1a6aa8={},_0x596542={},_0x572aea={'count':0x0,'rows':[]};var _0x5388b0=_['map'](db[_0xe196('0x2b')][_0xe196('0x2c')],function(_0x7ca6b9){return{'name':_0x7ca6b9[_0xe196('0x2d')],'type':_0x7ca6b9['type'][_0xe196('0x2e')]};});_0x596542[_0xe196('0x2f')]=_[_0xe196('0x30')](_0x5388b0,_0xe196('0x29'));_0x596542['query']=_[_0xe196('0x31')](_0x2c930d[_0xe196('0x32')]);_0x596542[_0xe196('0x33')]=_[_0xe196('0x34')](_0x596542[_0xe196('0x2f')],_0x596542['query']);_0x1a6aa8[_0xe196('0x35')]=_[_0xe196('0x34')](_0x596542[_0xe196('0x2f')],qs[_0xe196('0x36')](_0x2c930d[_0xe196('0x32')]['fields']));_0x1a6aa8[_0xe196('0x35')]=_0x1a6aa8[_0xe196('0x35')][_0xe196('0x37')]?_0x1a6aa8[_0xe196('0x35')]:_0x596542['model'];if(!_0x2c930d[_0xe196('0x32')][_0xe196('0x38')]('nolimit')){_0x1a6aa8['limit']=qs[_0xe196('0x39')](_0x2c930d[_0xe196('0x32')]['limit']);_0x1a6aa8[_0xe196('0x1c')]=qs['offset'](_0x2c930d[_0xe196('0x32')]['offset']);}_0x1a6aa8['order']=qs['sort'](_0x2c930d['query'][_0xe196('0x3a')]);_0x1a6aa8[_0xe196('0x3b')]=qs[_0xe196('0x33')](_[_0xe196('0x3c')](_0x2c930d['query'],_0x596542[_0xe196('0x33')]),_0x5388b0);if(_0x2c930d['query']['filter']){_0x1a6aa8[_0xe196('0x3b')]=_['merge'](_0x1a6aa8['where'],{'$or':_['map'](_0x5388b0,function(_0x48e495){if(_0x48e495[_0xe196('0x3d')]!==_0xe196('0x3e')){var _0x4a37d9={};_0x4a37d9[_0x48e495[_0xe196('0x29')]]={'$like':'%'+_0x2c930d['query'][_0xe196('0x3f')]+'%'};return _0x4a37d9;}})});}_0x1a6aa8=_['merge']({},_0x1a6aa8,_0x2c930d['options']);var _0x3dd8e3={'where':_0x1a6aa8['where']};return db[_0xe196('0x2b')][_0xe196('0x1e')](_0x3dd8e3)[_0xe196('0x25')](function(_0xf49e36){_0x572aea[_0xe196('0x1e')]=_0xf49e36;if(_0x2c930d[_0xe196('0x32')]['includeAll']){_0x1a6aa8[_0xe196('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xe196('0x41')](_0x1a6aa8);})[_0xe196('0x25')](function(_0xd0f63c){_0x572aea['rows']=_0xd0f63c;return _0x572aea;})['then'](respondWithFilteredResult(_0x2a4c8d,_0x1a6aa8))[_0xe196('0x42')](handleError(_0x2a4c8d,null));};exports[_0xe196('0x43')]=function(_0x35719c,_0x199db6){var _0x376e1c={'raw':!![],'where':{'id':_0x35719c[_0xe196('0x44')]['id']}},_0x337776={};_0x337776[_0xe196('0x2f')]=_['keys'](db[_0xe196('0x2b')][_0xe196('0x2c')]);_0x337776[_0xe196('0x32')]=_[_0xe196('0x31')](_0x35719c[_0xe196('0x32')]);_0x337776[_0xe196('0x33')]=_[_0xe196('0x34')](_0x337776[_0xe196('0x2f')],_0x337776[_0xe196('0x32')]);_0x376e1c[_0xe196('0x35')]=_[_0xe196('0x34')](_0x337776[_0xe196('0x2f')],qs['fields'](_0x35719c[_0xe196('0x32')][_0xe196('0x36')]));_0x376e1c[_0xe196('0x35')]=_0x376e1c[_0xe196('0x35')]['length']?_0x376e1c['attributes']:_0x337776[_0xe196('0x2f')];if(_0x35719c[_0xe196('0x32')][_0xe196('0x45')]){_0x376e1c[_0xe196('0x40')]=[{'all':!![]}];}_0x376e1c=_[_0xe196('0x46')]({},_0x376e1c,_0x35719c[_0xe196('0x47')]);return db[_0xe196('0x2b')][_0xe196('0x48')](_0x376e1c)['then'](handleEntityNotFound(_0x199db6,null))[_0xe196('0x25')](respondWithResult(_0x199db6,null))[_0xe196('0x42')](handleError(_0x199db6,null));};exports[_0xe196('0x49')]=function(_0x1aca16,_0x4a738b){return db[_0xe196('0x2b')][_0xe196('0x49')](_0x1aca16[_0xe196('0x4a')],{})[_0xe196('0x25')](respondWithResult(_0x4a738b,0xc9))['catch'](handleError(_0x4a738b,null));};exports[_0xe196('0x24')]=function(_0x4a2ab7,_0x3913d4){if(_0x4a2ab7['body']['id']){delete _0x4a2ab7['body']['id'];}return db[_0xe196('0x2b')][_0xe196('0x48')]({'where':{'id':_0x4a2ab7[_0xe196('0x44')]['id']}})[_0xe196('0x25')](handleEntityNotFound(_0x3913d4,null))[_0xe196('0x25')](saveUpdates(_0x4a2ab7['body'],null))[_0xe196('0x25')](respondWithResult(_0x3913d4,null))[_0xe196('0x42')](handleError(_0x3913d4,null));};exports[_0xe196('0x26')]=function(_0x5f4ed3,_0x45e3a7){return db[_0xe196('0x2b')]['find']({'where':{'id':_0x5f4ed3['params']['id']}})['then'](handleEntityNotFound(_0x45e3a7,null))[_0xe196('0x25')](removeEntity(_0x45e3a7,null))[_0xe196('0x42')](handleError(_0x45e3a7,null));};exports['describe']=function(_0x49f709,_0x1d3749){return db[_0xe196('0x2b')][_0xe196('0x4b')]()[_0xe196('0x25')](respondWithResult(_0x1d3749,null))[_0xe196('0x42')](handleError(_0x1d3749,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4b4c7e2..7a9648c 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 _0xc8fd=['report_sms_transfer','uniqueid','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x597e38,_0x551ac2){var _0x5305d2=function(_0x47dc5e){while(--_0x47dc5e){_0x597e38['push'](_0x597e38['shift']());}};_0x5305d2(++_0x551ac2);}(_0xc8fd,0x162));var _0xdc8f=function(_0x3e7028,_0x490a7f){_0x3e7028=_0x3e7028-0x0;var _0x303c8f=_0xc8fd[_0x3e7028];return _0x303c8f;};'use strict';var _=require('lodash');var util=require(_0xdc8f('0x0'));var logger=require(_0xdc8f('0x1'))('api');var moment=require(_0xdc8f('0x2'));var BPromise=require('bluebird');var rp=require(_0xdc8f('0x3'));var fs=require('fs');var path=require(_0xdc8f('0x4'));var rimraf=require(_0xdc8f('0x5'));var config=require(_0xdc8f('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xdc8f('0x7')]=function(_0x14a4e5,_0x5a47bf){return _0x14a4e5[_0xdc8f('0x8')]('SmsTransferReport',attributes,{'tableName':_0xdc8f('0x9'),'paranoid':![],'indexes':[{'name':_0xdc8f('0xa'),'fields':[_0xdc8f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72b1=['path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x72b1,0x16e));var _0x172b=function(_0x310c01,_0x4f1b1f){_0x310c01=_0x310c01-0x0;var _0x1aac69=_0x72b1[_0x310c01];return _0x1aac69;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x172b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index f22708a..7ddb8cb 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 _0x295f=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x4f37e3,_0x4806af){var _0x3f9d69=function(_0x25c78d){while(--_0x25c78d){_0x4f37e3['push'](_0x4f37e3['shift']());}};_0x3f9d69(++_0x4806af);}(_0x295f,0x168));var _0xf295=function(_0x251b4b,_0x1aa223){_0x251b4b=_0x251b4b-0x0;var _0xacaa3=_0x295f[_0x251b4b];return _0xacaa3;};'use strict';var _=require('lodash');var util=require(_0xf295('0x0'));var moment=require(_0xf295('0x1'));var BPromise=require(_0xf295('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf295('0x3'));var db=require(_0xf295('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf295('0x5'));var config=require(_0xf295('0x6'));var jayson=require(_0xf295('0x7'));var client=jayson[_0xf295('0x8')][_0xf295('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50a890,_0x2b302f,_0x44e292){return new BPromise(function(_0x1f3320,_0x4041d5){return client[_0xf295('0xa')](_0x50a890,_0x44e292)[_0xf295('0xb')](function(_0xaf1853){logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));logger[_0xf295('0xf')](_0xf295('0x10'),_0x2b302f,'request\x20sent',JSON[_0xf295('0x11')](_0xaf1853));if(_0xaf1853[_0xf295('0x12')]){if(_0xaf1853['error'][_0xf295('0x13')]===0x1f4){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x4041d5(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);return _0x1f3320(_0xaf1853[_0xf295('0x12')][_0xf295('0x14')]);}else{logger[_0xf295('0xc')](_0xf295('0xd'),_0x2b302f,_0xf295('0xe'));_0x1f3320(_0xaf1853[_0xf295('0x15')][_0xf295('0x14')]);}})['catch'](function(_0x57e1bc){logger[_0xf295('0x12')](_0xf295('0xd'),_0x2b302f,_0x57e1bc);_0x4041d5(_0x57e1bc);});});} \ No newline at end of file +var _0x0b78=['request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info'];(function(_0x4b608b,_0x32d3e7){var _0x502cac=function(_0x149a3d){while(--_0x149a3d){_0x4b608b['push'](_0x4b608b['shift']());}};_0x502cac(++_0x32d3e7);}(_0x0b78,0x1ad));var _0x80b7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0b78[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x584401,_0x5e19ef,_0x122ebe){return new BPromise(function(_0x3c248d,_0x445c23){return client['request'](_0x584401,_0x122ebe)[_0x80b7('0x9')](function(_0x25a015){logger[_0x80b7('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x5e19ef,_0x80b7('0xb'));logger['debug'](_0x80b7('0xc'),_0x5e19ef,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x25a015));if(_0x25a015[_0x80b7('0xe')]){if(_0x25a015[_0x80b7('0xe')][_0x80b7('0xf')]===0x1f4){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015[_0x80b7('0xe')][_0x80b7('0x11')]);return _0x445c23(_0x25a015[_0x80b7('0xe')]['message']);}logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x25a015['error'][_0x80b7('0x11')]);return _0x3c248d(_0x25a015[_0x80b7('0xe')]['message']);}else{logger[_0x80b7('0xa')](_0x80b7('0x10'),_0x5e19ef,_0x80b7('0xb'));_0x3c248d(_0x25a015[_0x80b7('0x12')][_0x80b7('0x11')]);}})[_0x80b7('0x13')](function(_0x1e3d1c){logger[_0x80b7('0xe')](_0x80b7('0x10'),_0x5e19ef,_0x1e3d1c);_0x445c23(_0x1e3d1c);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index a94623c..19af74d 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 _0xaf3e=['%s-%s%s','basename','extname','file','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./sound.controller','isAuthenticated','index','/:id','show','/:id/download','download','join','root','originalname','replace','format'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xaf3e,0x13c));var _0xeaf3=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0xaf3e[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require(_0xeaf3('0x0'));var util=require(_0xeaf3('0x1'));var path=require(_0xeaf3('0x2'));var timeout=require(_0xeaf3('0x3'));var express=require(_0xeaf3('0x4'));var router=express[_0xeaf3('0x5')]();var fs_extra=require(_0xeaf3('0x6'));var auth=require(_0xeaf3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeaf3('0x8'));router['get']('/',auth[_0xeaf3('0x9')](),controller[_0xeaf3('0xa')]);router['get'](_0xeaf3('0xb'),auth['isAuthenticated'](),controller[_0xeaf3('0xc')]);router['get'](_0xeaf3('0xd'),auth[_0xeaf3('0x9')](),controller[_0xeaf3('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a7e24,_0x414a23,_0x2ba83f){_0x2ba83f(null,path[_0xeaf3('0xf')](config[_0xeaf3('0x10')],'server/files/sounds/original/'));},'filename':function(_0xb9773c,_0x3a71cd,_0x873a96){_0x3a71cd[_0xeaf3('0x11')]=_0x3a71cd[_0xeaf3('0x11')][_0xeaf3('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x873a96(null,util[_0xeaf3('0x13')](_0xeaf3('0x14'),path[_0xeaf3('0x15')](_0x3a71cd[_0xeaf3('0x11')],path[_0xeaf3('0x16')](_0x3a71cd[_0xeaf3('0x11')])),Date['now'](),path[_0xeaf3('0x16')](_0x3a71cd[_0xeaf3('0x11')])));}})});router['post']('/',upload['single'](_0xeaf3('0x17')),controller['create']);router[_0xeaf3('0x18')]('/:id',auth[_0xeaf3('0x9')](),controller[_0xeaf3('0x19')]);router[_0xeaf3('0x1a')](_0xeaf3('0xb'),auth['isAuthenticated'](),controller[_0xeaf3('0x1a')]);module[_0xeaf3('0x1b')]=router; \ No newline at end of file +var _0xab0f=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','show','get','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','file','put','/:id','update','delete','exports'];(function(_0x258b4f,_0x337bef){var _0xe878ed=function(_0x5b7558){while(--_0x5b7558){_0x258b4f['push'](_0x258b4f['shift']());}};_0xe878ed(++_0x337bef);}(_0xab0f,0xb4));var _0xfab0=function(_0x4a050f,_0x1596d0){_0x4a050f=_0x4a050f-0x0;var _0x3fa1dc=_0xab0f[_0x4a050f];return _0x3fa1dc;};'use strict';var multer=require(_0xfab0('0x0'));var util=require(_0xfab0('0x1'));var path=require(_0xfab0('0x2'));var timeout=require('connect-timeout');var express=require(_0xfab0('0x3'));var router=express[_0xfab0('0x4')]();var fs_extra=require(_0xfab0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfab0('0x6'));var config=require(_0xfab0('0x7'));var controller=require(_0xfab0('0x8'));router['get']('/',auth[_0xfab0('0x9')](),controller['index']);router['get']('/:id',auth[_0xfab0('0x9')](),controller[_0xfab0('0xa')]);router[_0xfab0('0xb')]('/:id/download',auth[_0xfab0('0x9')](),controller[_0xfab0('0xc')]);var upload=multer({'storage':multer[_0xfab0('0xd')]({'destination':function(_0x2c9528,_0x52459e,_0x2b6cfa){_0x2b6cfa(null,path[_0xfab0('0xe')](config[_0xfab0('0xf')],_0xfab0('0x10')));},'filename':function(_0x307d7c,_0x68fec,_0x1592c3){_0x68fec[_0xfab0('0x11')]=_0x68fec[_0xfab0('0x11')][_0xfab0('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1592c3(null,util['format'](_0xfab0('0x13'),path[_0xfab0('0x14')](_0x68fec[_0xfab0('0x11')],path[_0xfab0('0x15')](_0x68fec[_0xfab0('0x11')])),Date[_0xfab0('0x16')](),path[_0xfab0('0x15')](_0x68fec[_0xfab0('0x11')])));}})});router[_0xfab0('0x17')]('/',upload['single'](_0xfab0('0x18')),controller['create']);router[_0xfab0('0x19')](_0xfab0('0x1a'),auth[_0xfab0('0x9')](),controller[_0xfab0('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xfab0('0x1c')]);module[_0xfab0('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index f9f3046..f525cfa 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 _0x341b=['STRING','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x4b87a3,_0x3a698c){var _0x334112=function(_0x3e8fb0){while(--_0x3e8fb0){_0x4b87a3['push'](_0x4b87a3['shift']());}};_0x334112(++_0x3a698c);}(_0x341b,0xb8));var _0xb341=function(_0x2f3bee,_0x3a3770){_0x2f3bee=_0x2f3bee-0x0;var _0x5cbf32=_0x341b[_0x2f3bee];return _0x5cbf32;};'use strict';var Sequelize=require(_0xb341('0x0'));module[_0xb341('0x1')]={'name':{'type':Sequelize[_0xb341('0x2')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xb341('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xb341('0x2')]},'original_format':{'type':Sequelize[_0xb341('0x2')]},'original_duration':{'type':Sequelize[_0xb341('0x3')]},'original_sampleCount':{'type':Sequelize[_0xb341('0x4')]},'original_channelCount':{'type':Sequelize[_0xb341('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xb341('0x5')]},'converted_format':{'type':Sequelize[_0xb341('0x2')]},'converted_duration':{'type':Sequelize[_0xb341('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xb341('0x5')]},'converted_bitRate':{'type':Sequelize[_0xb341('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x877f=['sequelize','exports','STRING','name','BIGINT','INTEGER','FLOAT'];(function(_0x528b54,_0x2dc9ac){var _0x1e9cb6=function(_0x421d6c){while(--_0x421d6c){_0x528b54['push'](_0x528b54['shift']());}};_0x1e9cb6(++_0x2dc9ac);}(_0x877f,0x12d));var _0xf877=function(_0x4f5310,_0x44b95d){_0x4f5310=_0x4f5310-0x0;var _0x3f2eb7=_0x877f[_0x4f5310];return _0x3f2eb7;};'use strict';var Sequelize=require(_0xf877('0x0'));module[_0xf877('0x1')]={'name':{'type':Sequelize[_0xf877('0x2')],'unique':_0xf877('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf877('0x2')]},'display_name':{'type':Sequelize[_0xf877('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf877('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0xf877('0x4')]},'original_channelCount':{'type':Sequelize[_0xf877('0x5')]},'original_bitRate':{'type':Sequelize[_0xf877('0x4')]},'original_sampleRate':{'type':Sequelize[_0xf877('0x5')]},'converted_format':{'type':Sequelize[_0xf877('0x2')]},'converted_duration':{'type':Sequelize[_0xf877('0x6')]},'converted_sampleCount':{'type':Sequelize[_0xf877('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xf877('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d4a462a..6e7eb3d 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 _0xd4d6=['rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','download','params','save_name','converted_format','existsSync','root','server/files/sounds/converted','Sequelize','format','create','basename','file','originalname','extname','filename','substring','wav','join','%s.%s','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','error','unlinkSync','send','original_duration','duration','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','delete','server/files/sounds/original','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','get','Sounds','UserProfileResource','name','index','map','Sound'];(function(_0x135202,_0x388e76){var _0xf93bdc=function(_0x4e36ce){while(--_0x4e36ce){_0x135202['push'](_0x135202['shift']());}};_0xf93bdc(++_0x388e76);}(_0xd4d6,0x1b6));var _0x6d4d=function(_0x54292d,_0x49b8b9){_0x54292d=_0x54292d-0x0;var _0x44d414=_0xd4d6[_0x54292d];return _0x44d414;};'use strict';var emlformat=require(_0x6d4d('0x0'));var rimraf=require(_0x6d4d('0x1'));var zipdir=require(_0x6d4d('0x2'));var jsonpatch=require(_0x6d4d('0x3'));var rp=require(_0x6d4d('0x4'));var moment=require('moment');var BPromise=require(_0x6d4d('0x5'));var Mustache=require(_0x6d4d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6d4d('0x7'));var csv=require(_0x6d4d('0x8'));var ejs=require(_0x6d4d('0x9'));var fs=require('fs');var fs_extra=require(_0x6d4d('0xa'));var _=require('lodash');var squel=require(_0x6d4d('0xb'));var crypto=require(_0x6d4d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6d4d('0x8'));var querystring=require('querystring');var Papa=require(_0x6d4d('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d4d('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d4d('0xf'));var logger=require(_0x6d4d('0x10'))(_0x6d4d('0x11'));var utils=require(_0x6d4d('0x12'));var config=require(_0x6d4d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d4d('0x14'))['db'];function respondWithStatusCode(_0x33908b,_0x491a84){_0x491a84=_0x491a84||0xcc;return function(_0x387c7b){if(_0x387c7b){return _0x33908b[_0x6d4d('0x15')](_0x491a84);}return _0x33908b['status'](_0x491a84)[_0x6d4d('0x16')]();};}function respondWithResult(_0x4af983,_0x535bfd){_0x535bfd=_0x535bfd||0xc8;return function(_0x272689){if(_0x272689){return _0x4af983[_0x6d4d('0x17')](_0x535bfd)['json'](_0x272689);}};}function respondWithFilteredResult(_0x56afe9,_0x2ada71){return function(_0x5234f5){if(_0x5234f5){var _0x439c53=typeof _0x2ada71[_0x6d4d('0x18')]===_0x6d4d('0x19')&&typeof _0x2ada71[_0x6d4d('0x1a')]===_0x6d4d('0x19');var _0x5ad1f9=_0x5234f5[_0x6d4d('0x1b')];var _0x5f18cc=_0x439c53?0x0:_0x2ada71[_0x6d4d('0x18')];var _0x49312a=_0x439c53?_0x5234f5[_0x6d4d('0x1b')]:_0x2ada71[_0x6d4d('0x18')]+_0x2ada71[_0x6d4d('0x1a')];var _0x5de10e;if(_0x49312a>=_0x5ad1f9){_0x49312a=_0x5ad1f9;_0x5de10e=0xc8;}else{_0x5de10e=0xce;}_0x56afe9[_0x6d4d('0x17')](_0x5de10e);return _0x56afe9[_0x6d4d('0x1c')](_0x6d4d('0x1d'),_0x5f18cc+'-'+_0x49312a+'/'+_0x5ad1f9)[_0x6d4d('0x1e')](_0x5234f5);}return null;};}function patchUpdates(_0x1fd060){return function(_0x42de86){try{jsonpatch[_0x6d4d('0x1f')](_0x42de86,_0x1fd060,!![]);}catch(_0x3b5ce3){return BPromise['reject'](_0x3b5ce3);}return _0x42de86[_0x6d4d('0x20')]();};}function saveUpdates(_0x488fe6,_0x62066f){return function(_0x10c35d){if(_0x10c35d){return _0x10c35d['update'](_0x488fe6)[_0x6d4d('0x21')](function(_0x318188){return _0x318188;});}return null;};}function removeEntity(_0x436eba,_0x594315){return function(_0x44e6d8){if(_0x44e6d8){return _0x44e6d8[_0x6d4d('0x22')]()['then'](function(){var _0xb3514a=_0x44e6d8[_0x6d4d('0x23')]({'plain':!![]});var _0x15751b=_0x6d4d('0x24');return db[_0x6d4d('0x25')][_0x6d4d('0x22')]({'where':{'type':_0x15751b,'resourceId':_0xb3514a['id']}})[_0x6d4d('0x21')](function(){return _0x44e6d8;});})[_0x6d4d('0x21')](function(){_0x436eba[_0x6d4d('0x17')](0xcc)[_0x6d4d('0x16')]();});}};}function handleEntityNotFound(_0x524533,_0x29b6bd){return function(_0x1a9acb){if(!_0x1a9acb){_0x524533[_0x6d4d('0x15')](0x194);}return _0x1a9acb;};}function handleError(_0x467127,_0x47e8a8){_0x47e8a8=_0x47e8a8||0x1f4;return function(_0x2367c4){logger['error'](_0x2367c4['stack']);if(_0x2367c4[_0x6d4d('0x26')]){delete _0x2367c4['name'];}_0x467127['status'](_0x47e8a8)['send'](_0x2367c4);};}exports[_0x6d4d('0x27')]=function(_0x3ec79a,_0x3c67a2){var _0x278e4c={},_0x41ceef={},_0x47c1af={'count':0x0,'rows':[]};var _0x2bd6a0=_[_0x6d4d('0x28')](db[_0x6d4d('0x29')][_0x6d4d('0x2a')],function(_0x4717a1){return{'name':_0x4717a1[_0x6d4d('0x2b')],'type':_0x4717a1[_0x6d4d('0x2c')][_0x6d4d('0x2d')]};});_0x41ceef[_0x6d4d('0x2e')]=_[_0x6d4d('0x28')](_0x2bd6a0,_0x6d4d('0x26'));_0x41ceef['query']=_[_0x6d4d('0x2f')](_0x3ec79a[_0x6d4d('0x30')]);_0x41ceef[_0x6d4d('0x31')]=_[_0x6d4d('0x32')](_0x41ceef[_0x6d4d('0x2e')],_0x41ceef[_0x6d4d('0x30')]);_0x278e4c[_0x6d4d('0x33')]=_['intersection'](_0x41ceef['model'],qs[_0x6d4d('0x34')](_0x3ec79a[_0x6d4d('0x30')][_0x6d4d('0x34')]));_0x278e4c['attributes']=_0x278e4c[_0x6d4d('0x33')]['length']?_0x278e4c[_0x6d4d('0x33')]:_0x41ceef[_0x6d4d('0x2e')];if(!_0x3ec79a['query'][_0x6d4d('0x35')](_0x6d4d('0x36'))){_0x278e4c[_0x6d4d('0x1a')]=qs[_0x6d4d('0x1a')](_0x3ec79a[_0x6d4d('0x30')]['limit']);_0x278e4c[_0x6d4d('0x18')]=qs['offset'](_0x3ec79a[_0x6d4d('0x30')][_0x6d4d('0x18')]);}_0x278e4c['order']=qs[_0x6d4d('0x37')](_0x3ec79a[_0x6d4d('0x30')][_0x6d4d('0x37')]);_0x278e4c[_0x6d4d('0x38')]=qs[_0x6d4d('0x31')](_[_0x6d4d('0x39')](_0x3ec79a['query'],_0x41ceef['filters']),_0x2bd6a0);if(_0x3ec79a[_0x6d4d('0x30')]['filter']){_0x278e4c[_0x6d4d('0x38')]=_['merge'](_0x278e4c[_0x6d4d('0x38')],{'$or':_['map'](_0x2bd6a0,function(_0x29c3f6){if(_0x29c3f6[_0x6d4d('0x2c')]!==_0x6d4d('0x3a')){var _0x537da7={};_0x537da7[_0x29c3f6['name']]={'$like':'%'+_0x3ec79a[_0x6d4d('0x30')][_0x6d4d('0x3b')]+'%'};return _0x537da7;}})});}_0x278e4c=_[_0x6d4d('0x3c')]({},_0x278e4c,_0x3ec79a[_0x6d4d('0x3d')]);var _0xffe9cf={'where':_0x278e4c[_0x6d4d('0x38')]};return db[_0x6d4d('0x29')][_0x6d4d('0x1b')](_0xffe9cf)[_0x6d4d('0x21')](function(_0x1b0b48){_0x47c1af[_0x6d4d('0x1b')]=_0x1b0b48;if(_0x3ec79a[_0x6d4d('0x30')][_0x6d4d('0x3e')]){_0x278e4c[_0x6d4d('0x3f')]=[{'all':!![]}];}return db['Sound'][_0x6d4d('0x40')](_0x278e4c);})[_0x6d4d('0x21')](function(_0x5388ea){_0x47c1af[_0x6d4d('0x41')]=_0x5388ea;return _0x47c1af;})[_0x6d4d('0x21')](respondWithFilteredResult(_0x3c67a2,_0x278e4c))[_0x6d4d('0x42')](handleError(_0x3c67a2,null));};exports[_0x6d4d('0x43')]=function(_0x37b588,_0x5c0799){var _0x3cab4c={'raw':!![],'where':{'id':_0x37b588['params']['id']}},_0x393f49={};_0x393f49[_0x6d4d('0x2e')]=_[_0x6d4d('0x2f')](db[_0x6d4d('0x29')][_0x6d4d('0x2a')]);_0x393f49[_0x6d4d('0x30')]=_[_0x6d4d('0x2f')](_0x37b588[_0x6d4d('0x30')]);_0x393f49[_0x6d4d('0x31')]=_[_0x6d4d('0x32')](_0x393f49[_0x6d4d('0x2e')],_0x393f49['query']);_0x3cab4c[_0x6d4d('0x33')]=_[_0x6d4d('0x32')](_0x393f49[_0x6d4d('0x2e')],qs['fields'](_0x37b588[_0x6d4d('0x30')]['fields']));_0x3cab4c[_0x6d4d('0x33')]=_0x3cab4c[_0x6d4d('0x33')][_0x6d4d('0x44')]?_0x3cab4c[_0x6d4d('0x33')]:_0x393f49[_0x6d4d('0x2e')];if(_0x37b588[_0x6d4d('0x30')]['includeAll']){_0x3cab4c[_0x6d4d('0x3f')]=[{'all':!![]}];}_0x3cab4c=_[_0x6d4d('0x3c')]({},_0x3cab4c,_0x37b588[_0x6d4d('0x3d')]);return db['Sound'][_0x6d4d('0x45')](_0x3cab4c)[_0x6d4d('0x21')](handleEntityNotFound(_0x5c0799,null))[_0x6d4d('0x21')](respondWithResult(_0x5c0799,null))['catch'](handleError(_0x5c0799,null));};exports[_0x6d4d('0x46')]=function(_0x17b265,_0x32aeac,_0x25ff78){return db[_0x6d4d('0x29')]['find']({'where':{'id':_0x17b265[_0x6d4d('0x47')]['id']},'attributes':[_0x6d4d('0x26'),_0x6d4d('0x48'),_0x6d4d('0x49')],'raw':!![]})[_0x6d4d('0x21')](handleEntityNotFound(_0x32aeac,null))[_0x6d4d('0x21')](function(_0x1fc6bc){if(_0x1fc6bc){if(!fs[_0x6d4d('0x4a')](path['join'](config[_0x6d4d('0x4b')],_0x6d4d('0x4c'),_0x1fc6bc['save_name']+'.'+_0x1fc6bc['converted_format']))){throw new db[(_0x6d4d('0x4d'))]['ValidationError']('Sound\x20not\x20found');}return _0x32aeac[_0x6d4d('0x46')](path['join'](config[_0x6d4d('0x4b')],_0x6d4d('0x4c'),util[_0x6d4d('0x4e')]('%s.%s',_0x1fc6bc[_0x6d4d('0x48')],_0x1fc6bc[_0x6d4d('0x49')])),util['format']('%s.%s',_0x1fc6bc['name'],_0x1fc6bc[_0x6d4d('0x49')]));}return null;})[_0x6d4d('0x42')](handleError(_0x32aeac,null));};exports[_0x6d4d('0x4f')]=function(_0x29a08c,_0x3676cd,_0x341982){var _0xb38abb={'name':path[_0x6d4d('0x50')](_0x29a08c[_0x6d4d('0x51')][_0x6d4d('0x52')],path[_0x6d4d('0x53')](_0x29a08c[_0x6d4d('0x51')][_0x6d4d('0x52')])),'save_name':path[_0x6d4d('0x50')](_0x29a08c[_0x6d4d('0x51')][_0x6d4d('0x54')],path['extname'](_0x29a08c['file'][_0x6d4d('0x54')])),'original_format':path['extname'](_0x29a08c[_0x6d4d('0x51')][_0x6d4d('0x52')])[_0x6d4d('0x55')](0x1),'converted_format':_0x6d4d('0x56')};var _0x1eaaf9=path['join'](config['root'],'server/files/sounds/original',_0x29a08c['file']['filename']);var _0x3d86e5=path[_0x6d4d('0x57')](config['root'],_0x6d4d('0x4c'),util[_0x6d4d('0x4e')](_0x6d4d('0x58'),path[_0x6d4d('0x50')](_0x29a08c[_0x6d4d('0x51')][_0x6d4d('0x54')],path[_0x6d4d('0x53')](_0x29a08c['file']['filename'])),_0xb38abb[_0x6d4d('0x49')]));logger[_0x6d4d('0x59')](_0x6d4d('0x5a'),_0x1eaaf9);logger[_0x6d4d('0x59')](_0x6d4d('0x5b'),_0x3d86e5);try{fs['chmodSync'](_0x1eaaf9,parseInt(_0x6d4d('0x5c'),0x8));var _0x3dba20=sox[_0x6d4d('0x5d')](_0x1eaaf9,_0x3d86e5,{'sampleRate':0x1f40,'format':_0x6d4d('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dba20['on'](_0x6d4d('0x5e'),function(_0x4f93b2){fs[_0x6d4d('0x5f')](_0x1eaaf9);_0x3676cd['status'](0x1f4)[_0x6d4d('0x60')](_0x4f93b2);});_0x3dba20['on']('src',function(_0x22515f){_0xb38abb[_0x6d4d('0x61')]=isNaN(_0x22515f[_0x6d4d('0x62')])?null:_0x22515f[_0x6d4d('0x62')]*0x3e8;_0xb38abb['original_sampleCount']=isNaN(_0x22515f[_0x6d4d('0x63')])?null:_0x22515f[_0x6d4d('0x63')];_0xb38abb['original_channelCount']=isNaN(_0x22515f[_0x6d4d('0x64')])?null:_0x22515f[_0x6d4d('0x64')];_0xb38abb[_0x6d4d('0x65')]=isNaN(_0x22515f['bitRate'])?null:_0x22515f[_0x6d4d('0x66')];_0xb38abb[_0x6d4d('0x67')]=isNaN(_0x22515f[_0x6d4d('0x68')])?null:_0x22515f[_0x6d4d('0x68')];});_0x3dba20['on'](_0x6d4d('0x69'),function(_0x5913d5){_0xb38abb[_0x6d4d('0x6a')]=isNaN(_0x5913d5[_0x6d4d('0x62')])?null:_0x5913d5['duration']*0x3e8;_0xb38abb[_0x6d4d('0x6b')]=isNaN(_0x5913d5[_0x6d4d('0x63')])?null:_0x5913d5[_0x6d4d('0x63')];_0xb38abb['converted_channelCount']=isNaN(_0x5913d5[_0x6d4d('0x64')])?null:_0x5913d5[_0x6d4d('0x64')];_0xb38abb[_0x6d4d('0x6c')]=isNaN(_0x5913d5[_0x6d4d('0x66')])?null:_0x5913d5[_0x6d4d('0x66')];_0xb38abb['converted_sampleRate']=isNaN(_0x5913d5[_0x6d4d('0x68')])?null:_0x5913d5[_0x6d4d('0x68')];});_0x3dba20['on'](_0x6d4d('0x16'),function(){fs['chmodSync'](_0x3d86e5,parseInt(_0x6d4d('0x5c'),0x8));return db[_0x6d4d('0x29')]['create'](_0xb38abb)[_0x6d4d('0x21')](function(_0x32ca55){var _0x22e933={'role':_0x29a08c[_0x6d4d('0x6d')]['role'],'userProfileId':_0x29a08c[_0x6d4d('0x6d')][_0x6d4d('0x6e')]};if(!_0x22e933)throw new Error(_0x6d4d('0x6f'));if(_0x22e933[_0x6d4d('0x70')]===_0x6d4d('0x71')){var _0x1e1356=_0x32ca55[_0x6d4d('0x23')]({'plain':!![]});return db[_0x6d4d('0x72')][_0x6d4d('0x45')]({'where':{'name':'Sounds','userProfileId':_0x22e933[_0x6d4d('0x6e')]},'raw':!![]})[_0x6d4d('0x21')](function(_0x2aff41){if(_0x2aff41&&_0x2aff41['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1e1356['name'],'resourceId':_0x1e1356['id'],'type':_0x2aff41[_0x6d4d('0x26')],'sectionId':_0x2aff41['id']},{})['then'](function(){return _0x32ca55;});}else{return _0x32ca55;}})[_0x6d4d('0x42')](function(_0x267d8d){logger[_0x6d4d('0x5e')](_0x6d4d('0x73'),_0x267d8d);throw _0x267d8d;});}return _0x32ca55;})[_0x6d4d('0x21')](respondWithResult(_0x3676cd,null))[_0x6d4d('0x42')](handleError(_0x3676cd,null));});_0x3dba20['start']();}catch(_0x447e62){_0x3676cd[_0x6d4d('0x17')](0x1f4)[_0x6d4d('0x60')](_0x447e62);}};exports[_0x6d4d('0x74')]=function(_0x4964fe,_0x205968,_0x1a8986){return db['Sound']['find']({'where':{'id':_0x4964fe[_0x6d4d('0x47')]['id']}})['then'](handleEntityNotFound(_0x205968,null))[_0x6d4d('0x21')](saveUpdates(_[_0x6d4d('0x39')](_0x4964fe[_0x6d4d('0x6d')],['name',_0x6d4d('0x75')]),null))['then'](respondWithResult(_0x205968,null))[_0x6d4d('0x42')](handleError(_0x205968,null));};exports[_0x6d4d('0x76')]=function(_0x22c8e1,_0x55a84b,_0x58b271){return db['Sound']['find']({'where':{'id':_0x22c8e1[_0x6d4d('0x47')]['id']}})[_0x6d4d('0x21')](function(_0x9280b1){if(_0x9280b1){return _0x9280b1['destroy']();}})[_0x6d4d('0x21')](function(_0x3b064e){var _0x580664=path[_0x6d4d('0x57')](config[_0x6d4d('0x4b')],_0x6d4d('0x77'),util['format']('%s.%s',_0x3b064e['save_name'],_0x3b064e['original_format']));var _0x5eebc1=path[_0x6d4d('0x57')](config[_0x6d4d('0x4b')],_0x6d4d('0x4c'),util[_0x6d4d('0x4e')](_0x6d4d('0x58'),_0x3b064e[_0x6d4d('0x48')],_0x3b064e['converted_format']));fs[_0x6d4d('0x5f')](_0x580664);fs[_0x6d4d('0x5f')](_0x5eebc1);return _0x3b064e;})[_0x6d4d('0x21')](function(_0x4de128){if(_0x4de128){return _0x55a84b[_0x6d4d('0x17')](0xcc)[_0x6d4d('0x16')]();}})['then'](handleEntityNotFound(_0x55a84b,null))[_0x6d4d('0x42')](handleError(_0x55a84b,null));}; \ No newline at end of file +var _0x899a=['original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','server/files/sounds/original','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','find','params','existsSync','join','root','server/files/sounds/converted','save_name','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','originalname','extname','file','filename','substring','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src'];(function(_0x59e704,_0x463602){var _0x1c06a4=function(_0x3ddd68){while(--_0x3ddd68){_0x59e704['push'](_0x59e704['shift']());}};_0x1c06a4(++_0x463602);}(_0x899a,0x97));var _0xa899=function(_0x19e48a,_0x1f2770){_0x19e48a=_0x19e48a-0x0;var _0x37c6fe=_0x899a[_0x19e48a];return _0x37c6fe;};'use strict';var emlformat=require(_0xa899('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa899('0x1'));var jsonpatch=require(_0xa899('0x2'));var rp=require(_0xa899('0x3'));var moment=require(_0xa899('0x4'));var BPromise=require(_0xa899('0x5'));var Mustache=require(_0xa899('0x6'));var util=require('util');var path=require(_0xa899('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa899('0x8'));var fs=require('fs');var fs_extra=require(_0xa899('0x9'));var _=require(_0xa899('0xa'));var squel=require('squel');var crypto=require(_0xa899('0xb'));var jsforce=require(_0xa899('0xc'));var deskjs=require(_0xa899('0xd'));var toCsv=require(_0xa899('0xe'));var querystring=require(_0xa899('0xf'));var Papa=require(_0xa899('0x10'));var Redis=require(_0xa899('0x11'));var authService=require(_0xa899('0x12'));var qs=require(_0xa899('0x13'));var as=require(_0xa899('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa899('0x15'));var utils=require(_0xa899('0x16'));var config=require(_0xa899('0x17'));var licenseUtil=require(_0xa899('0x18'));var db=require(_0xa899('0x19'))['db'];function respondWithStatusCode(_0x49aedc,_0x5804a0){_0x5804a0=_0x5804a0||0xcc;return function(_0xea9d2d){if(_0xea9d2d){return _0x49aedc[_0xa899('0x1a')](_0x5804a0);}return _0x49aedc[_0xa899('0x1b')](_0x5804a0)[_0xa899('0x1c')]();};}function respondWithResult(_0x5e5065,_0x48217d){_0x48217d=_0x48217d||0xc8;return function(_0x5653d4){if(_0x5653d4){return _0x5e5065[_0xa899('0x1b')](_0x48217d)[_0xa899('0x1d')](_0x5653d4);}};}function respondWithFilteredResult(_0x5c8266,_0x1b5e95){return function(_0x20ac1f){if(_0x20ac1f){var _0x2ee18e=typeof _0x1b5e95[_0xa899('0x1e')]==='undefined'&&typeof _0x1b5e95[_0xa899('0x1f')]===_0xa899('0x20');var _0x48e529=_0x20ac1f[_0xa899('0x21')];var _0x3a0112=_0x2ee18e?0x0:_0x1b5e95[_0xa899('0x1e')];var _0x5a81a0=_0x2ee18e?_0x20ac1f[_0xa899('0x21')]:_0x1b5e95[_0xa899('0x1e')]+_0x1b5e95[_0xa899('0x1f')];var _0x2405e6;if(_0x5a81a0>=_0x48e529){_0x5a81a0=_0x48e529;_0x2405e6=0xc8;}else{_0x2405e6=0xce;}_0x5c8266['status'](_0x2405e6);return _0x5c8266[_0xa899('0x22')](_0xa899('0x23'),_0x3a0112+'-'+_0x5a81a0+'/'+_0x48e529)[_0xa899('0x1d')](_0x20ac1f);}return null;};}function patchUpdates(_0x34c9f8){return function(_0x57c68b){try{jsonpatch[_0xa899('0x24')](_0x57c68b,_0x34c9f8,!![]);}catch(_0x25d3a9){return BPromise[_0xa899('0x25')](_0x25d3a9);}return _0x57c68b['save']();};}function saveUpdates(_0x4e0736,_0x5b63b6){return function(_0x15256c){if(_0x15256c){return _0x15256c[_0xa899('0x26')](_0x4e0736)[_0xa899('0x27')](function(_0x50d97e){return _0x50d97e;});}return null;};}function removeEntity(_0x48386a,_0x146a29){return function(_0x330dfc){if(_0x330dfc){return _0x330dfc[_0xa899('0x28')]()[_0xa899('0x27')](function(){var _0xb58d45=_0x330dfc[_0xa899('0x29')]({'plain':!![]});var _0x4762ce=_0xa899('0x2a');return db['UserProfileResource'][_0xa899('0x28')]({'where':{'type':_0x4762ce,'resourceId':_0xb58d45['id']}})[_0xa899('0x27')](function(){return _0x330dfc;});})[_0xa899('0x27')](function(){_0x48386a[_0xa899('0x1b')](0xcc)[_0xa899('0x1c')]();});}};}function handleEntityNotFound(_0x4da841,_0x42f747){return function(_0x515208){if(!_0x515208){_0x4da841[_0xa899('0x1a')](0x194);}return _0x515208;};}function handleError(_0x1e38c0,_0x510a25){_0x510a25=_0x510a25||0x1f4;return function(_0x41415e){logger[_0xa899('0x2b')](_0x41415e[_0xa899('0x2c')]);if(_0x41415e[_0xa899('0x2d')]){delete _0x41415e[_0xa899('0x2d')];}_0x1e38c0['status'](_0x510a25)[_0xa899('0x2e')](_0x41415e);};}exports['index']=function(_0xb60b12,_0x1981c5){var _0x462e70={},_0x144af4={},_0xc2ff03={'count':0x0,'rows':[]};var _0x17a5a2=_[_0xa899('0x2f')](db[_0xa899('0x30')][_0xa899('0x31')],function(_0x4ed5c2){return{'name':_0x4ed5c2[_0xa899('0x32')],'type':_0x4ed5c2[_0xa899('0x33')][_0xa899('0x34')]};});_0x144af4[_0xa899('0x35')]=_['map'](_0x17a5a2,_0xa899('0x2d'));_0x144af4[_0xa899('0x36')]=_[_0xa899('0x37')](_0xb60b12[_0xa899('0x36')]);_0x144af4['filters']=_[_0xa899('0x38')](_0x144af4[_0xa899('0x35')],_0x144af4[_0xa899('0x36')]);_0x462e70[_0xa899('0x39')]=_['intersection'](_0x144af4[_0xa899('0x35')],qs[_0xa899('0x3a')](_0xb60b12[_0xa899('0x36')][_0xa899('0x3a')]));_0x462e70['attributes']=_0x462e70[_0xa899('0x39')][_0xa899('0x3b')]?_0x462e70[_0xa899('0x39')]:_0x144af4[_0xa899('0x35')];if(!_0xb60b12[_0xa899('0x36')][_0xa899('0x3c')]('nolimit')){_0x462e70[_0xa899('0x1f')]=qs[_0xa899('0x1f')](_0xb60b12[_0xa899('0x36')][_0xa899('0x1f')]);_0x462e70[_0xa899('0x1e')]=qs[_0xa899('0x1e')](_0xb60b12[_0xa899('0x36')][_0xa899('0x1e')]);}_0x462e70[_0xa899('0x3d')]=qs[_0xa899('0x3e')](_0xb60b12[_0xa899('0x36')][_0xa899('0x3e')]);_0x462e70[_0xa899('0x3f')]=qs[_0xa899('0x40')](_['pick'](_0xb60b12[_0xa899('0x36')],_0x144af4[_0xa899('0x40')]),_0x17a5a2);if(_0xb60b12[_0xa899('0x36')][_0xa899('0x41')]){_0x462e70[_0xa899('0x3f')]=_['merge'](_0x462e70['where'],{'$or':_[_0xa899('0x2f')](_0x17a5a2,function(_0x180804){if(_0x180804[_0xa899('0x33')]!==_0xa899('0x42')){var _0x342f36={};_0x342f36[_0x180804[_0xa899('0x2d')]]={'$like':'%'+_0xb60b12[_0xa899('0x36')][_0xa899('0x41')]+'%'};return _0x342f36;}})});}_0x462e70=_[_0xa899('0x43')]({},_0x462e70,_0xb60b12[_0xa899('0x44')]);var _0x22ffd9={'where':_0x462e70['where']};return db['Sound'][_0xa899('0x21')](_0x22ffd9)['then'](function(_0x3c41ce){_0xc2ff03[_0xa899('0x21')]=_0x3c41ce;if(_0xb60b12[_0xa899('0x36')][_0xa899('0x45')]){_0x462e70[_0xa899('0x46')]=[{'all':!![]}];}return db[_0xa899('0x30')]['findAll'](_0x462e70);})[_0xa899('0x27')](function(_0x491762){_0xc2ff03[_0xa899('0x47')]=_0x491762;return _0xc2ff03;})[_0xa899('0x27')](respondWithFilteredResult(_0x1981c5,_0x462e70))[_0xa899('0x48')](handleError(_0x1981c5,null));};exports['show']=function(_0x373bcf,_0x18b592){var _0x2c27c1={'raw':!![],'where':{'id':_0x373bcf['params']['id']}},_0x506665={};_0x506665[_0xa899('0x35')]=_[_0xa899('0x37')](db['Sound']['rawAttributes']);_0x506665[_0xa899('0x36')]=_[_0xa899('0x37')](_0x373bcf[_0xa899('0x36')]);_0x506665[_0xa899('0x40')]=_[_0xa899('0x38')](_0x506665[_0xa899('0x35')],_0x506665['query']);_0x2c27c1[_0xa899('0x39')]=_['intersection'](_0x506665['model'],qs[_0xa899('0x3a')](_0x373bcf[_0xa899('0x36')][_0xa899('0x3a')]));_0x2c27c1[_0xa899('0x39')]=_0x2c27c1[_0xa899('0x39')][_0xa899('0x3b')]?_0x2c27c1[_0xa899('0x39')]:_0x506665['model'];if(_0x373bcf[_0xa899('0x36')][_0xa899('0x45')]){_0x2c27c1[_0xa899('0x46')]=[{'all':!![]}];}_0x2c27c1=_['merge']({},_0x2c27c1,_0x373bcf[_0xa899('0x44')]);return db[_0xa899('0x30')][_0xa899('0x49')](_0x2c27c1)[_0xa899('0x27')](handleEntityNotFound(_0x18b592,null))[_0xa899('0x27')](respondWithResult(_0x18b592,null))[_0xa899('0x48')](handleError(_0x18b592,null));};exports['download']=function(_0x5dbc7e,_0x516b48,_0x303761){return db[_0xa899('0x30')]['find']({'where':{'id':_0x5dbc7e[_0xa899('0x4a')]['id']},'attributes':[_0xa899('0x2d'),'save_name','converted_format'],'raw':!![]})[_0xa899('0x27')](handleEntityNotFound(_0x516b48,null))[_0xa899('0x27')](function(_0x327925){if(_0x327925){if(!fs[_0xa899('0x4b')](path[_0xa899('0x4c')](config[_0xa899('0x4d')],_0xa899('0x4e'),_0x327925[_0xa899('0x4f')]+'.'+_0x327925[_0xa899('0x50')]))){throw new db[(_0xa899('0x51'))][(_0xa899('0x52'))](_0xa899('0x53'));}return _0x516b48[_0xa899('0x54')](path[_0xa899('0x4c')](config[_0xa899('0x4d')],_0xa899('0x4e'),util[_0xa899('0x55')]('%s.%s',_0x327925['save_name'],_0x327925[_0xa899('0x50')])),util[_0xa899('0x55')](_0xa899('0x56'),_0x327925['name'],_0x327925['converted_format']));}return null;})['catch'](handleError(_0x516b48,null));};exports[_0xa899('0x57')]=function(_0x309f4d,_0x59f8cb,_0x4db501){var _0x9a1937={'name':path[_0xa899('0x58')](_0x309f4d['file'][_0xa899('0x59')],path[_0xa899('0x5a')](_0x309f4d[_0xa899('0x5b')][_0xa899('0x59')])),'save_name':path['basename'](_0x309f4d['file'][_0xa899('0x5c')],path[_0xa899('0x5a')](_0x309f4d[_0xa899('0x5b')][_0xa899('0x5c')])),'original_format':path['extname'](_0x309f4d[_0xa899('0x5b')][_0xa899('0x59')])[_0xa899('0x5d')](0x1),'converted_format':_0xa899('0x5e')};var _0x2d0f40=path[_0xa899('0x4c')](config[_0xa899('0x4d')],'server/files/sounds/original',_0x309f4d[_0xa899('0x5b')][_0xa899('0x5c')]);var _0x178eeb=path['join'](config['root'],_0xa899('0x4e'),util[_0xa899('0x55')]('%s.%s',path[_0xa899('0x58')](_0x309f4d[_0xa899('0x5b')][_0xa899('0x5c')],path[_0xa899('0x5a')](_0x309f4d['file'][_0xa899('0x5c')])),_0x9a1937[_0xa899('0x50')]));logger[_0xa899('0x5f')](_0xa899('0x60'),_0x2d0f40);logger['info'](_0xa899('0x61'),_0x178eeb);try{fs[_0xa899('0x62')](_0x2d0f40,parseInt(_0xa899('0x63'),0x8));var _0x1294cc=sox[_0xa899('0x64')](_0x2d0f40,_0x178eeb,{'sampleRate':0x1f40,'format':_0xa899('0x5e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1294cc['on'](_0xa899('0x2b'),function(_0x555a11){fs[_0xa899('0x65')](_0x2d0f40);_0x59f8cb[_0xa899('0x1b')](0x1f4)[_0xa899('0x2e')](_0x555a11);});_0x1294cc['on'](_0xa899('0x66'),function(_0x1116a6){_0x9a1937[_0xa899('0x67')]=isNaN(_0x1116a6[_0xa899('0x68')])?null:_0x1116a6[_0xa899('0x68')]*0x3e8;_0x9a1937[_0xa899('0x69')]=isNaN(_0x1116a6['sampleCount'])?null:_0x1116a6[_0xa899('0x6a')];_0x9a1937[_0xa899('0x6b')]=isNaN(_0x1116a6[_0xa899('0x6c')])?null:_0x1116a6[_0xa899('0x6c')];_0x9a1937[_0xa899('0x6d')]=isNaN(_0x1116a6[_0xa899('0x6e')])?null:_0x1116a6[_0xa899('0x6e')];_0x9a1937[_0xa899('0x6f')]=isNaN(_0x1116a6[_0xa899('0x70')])?null:_0x1116a6[_0xa899('0x70')];});_0x1294cc['on'](_0xa899('0x71'),function(_0x5d6010){_0x9a1937[_0xa899('0x72')]=isNaN(_0x5d6010[_0xa899('0x68')])?null:_0x5d6010[_0xa899('0x68')]*0x3e8;_0x9a1937[_0xa899('0x73')]=isNaN(_0x5d6010[_0xa899('0x6a')])?null:_0x5d6010[_0xa899('0x6a')];_0x9a1937[_0xa899('0x74')]=isNaN(_0x5d6010['channelCount'])?null:_0x5d6010[_0xa899('0x6c')];_0x9a1937['converted_bitRate']=isNaN(_0x5d6010[_0xa899('0x6e')])?null:_0x5d6010[_0xa899('0x6e')];_0x9a1937[_0xa899('0x75')]=isNaN(_0x5d6010[_0xa899('0x70')])?null:_0x5d6010[_0xa899('0x70')];});_0x1294cc['on']('end',function(){fs[_0xa899('0x62')](_0x178eeb,parseInt('0777',0x8));return db[_0xa899('0x30')][_0xa899('0x57')](_0x9a1937)[_0xa899('0x27')](function(_0x5af26e){var _0x3c614e={'role':_0x309f4d[_0xa899('0x76')][_0xa899('0x77')],'userProfileId':_0x309f4d['body']['userProfileId']};if(!_0x3c614e)throw new Error(_0xa899('0x78'));if(_0x3c614e['role']===_0xa899('0x79')){var _0x3cdea4=_0x5af26e[_0xa899('0x29')]({'plain':!![]});return db['UserProfileSection'][_0xa899('0x49')]({'where':{'name':_0xa899('0x2a'),'userProfileId':_0x3c614e['userProfileId']},'raw':!![]})[_0xa899('0x27')](function(_0x2d8ac5){if(_0x2d8ac5&&_0x2d8ac5[_0xa899('0x7a')]===0x0){return db['UserProfileResource'][_0xa899('0x57')]({'name':_0x3cdea4[_0xa899('0x2d')],'resourceId':_0x3cdea4['id'],'type':_0x2d8ac5[_0xa899('0x2d')],'sectionId':_0x2d8ac5['id']},{})[_0xa899('0x27')](function(){return _0x5af26e;});}else{return _0x5af26e;}})[_0xa899('0x48')](function(_0x5178ba){logger[_0xa899('0x2b')](_0xa899('0x7b'),_0x5178ba);throw _0x5178ba;});}return _0x5af26e;})['then'](respondWithResult(_0x59f8cb,null))[_0xa899('0x48')](handleError(_0x59f8cb,null));});_0x1294cc[_0xa899('0x7c')]();}catch(_0x4e8e93){_0x59f8cb[_0xa899('0x1b')](0x1f4)[_0xa899('0x2e')](_0x4e8e93);}};exports[_0xa899('0x26')]=function(_0x5e56fa,_0x2f0094,_0x883290){return db[_0xa899('0x30')]['find']({'where':{'id':_0x5e56fa[_0xa899('0x4a')]['id']}})[_0xa899('0x27')](handleEntityNotFound(_0x2f0094,null))[_0xa899('0x27')](saveUpdates(_[_0xa899('0x7d')](_0x5e56fa[_0xa899('0x76')],[_0xa899('0x2d'),'description']),null))['then'](respondWithResult(_0x2f0094,null))['catch'](handleError(_0x2f0094,null));};exports['delete']=function(_0x4150c2,_0xc93ff6,_0x162396){return db[_0xa899('0x30')]['find']({'where':{'id':_0x4150c2[_0xa899('0x4a')]['id']}})['then'](function(_0x464393){if(_0x464393){return _0x464393[_0xa899('0x28')]();}})[_0xa899('0x27')](function(_0xd8d08e){var _0x370ce6=path[_0xa899('0x4c')](config[_0xa899('0x4d')],_0xa899('0x7e'),util[_0xa899('0x55')]('%s.%s',_0xd8d08e[_0xa899('0x4f')],_0xd8d08e['original_format']));var _0x4c0615=path[_0xa899('0x4c')](config[_0xa899('0x4d')],_0xa899('0x4e'),util[_0xa899('0x55')](_0xa899('0x56'),_0xd8d08e[_0xa899('0x4f')],_0xd8d08e[_0xa899('0x50')]));fs[_0xa899('0x65')](_0x370ce6);fs[_0xa899('0x65')](_0x4c0615);return _0xd8d08e;})[_0xa899('0x27')](function(_0x16e4e8){if(_0x16e4e8){return _0xc93ff6[_0xa899('0x1b')](0xcc)[_0xa899('0x1c')]();}})[_0xa899('0x27')](handleEntityNotFound(_0xc93ff6,null))[_0xa899('0x48')](handleError(_0xc93ff6,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 9007a9a..c4369bb 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 _0xf94f=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','Sound','tools_sounds'];(function(_0x2b216a,_0x5ebea4){var _0x39ab62=function(_0x37b9bd){while(--_0x37b9bd){_0x2b216a['push'](_0x2b216a['shift']());}};_0x39ab62(++_0x5ebea4);}(_0xf94f,0x198));var _0xff94=function(_0x8fa9b,_0x51a645){_0x8fa9b=_0x8fa9b-0x0;var _0x428925=_0xf94f[_0x8fa9b];return _0x428925;};'use strict';var _=require(_0xff94('0x0'));var util=require(_0xff94('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xff94('0x2'));var BPromise=require(_0xff94('0x3'));var rp=require(_0xff94('0x4'));var fs=require('fs');var path=require(_0xff94('0x5'));var rimraf=require(_0xff94('0x6'));var config=require(_0xff94('0x7'));var attributes=require(_0xff94('0x8'));module[_0xff94('0x9')]=function(_0x5a8c51,_0x81a3d0){return _0x5a8c51['define'](_0xff94('0xa'),attributes,{'tableName':_0xff94('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6898=['tools_sounds','../../config/logger','moment','request-promise','path','../../config/environment','./sound.attributes','define','Sound'];(function(_0xba716c,_0x4e4ef7){var _0x106889=function(_0x5739a3){while(--_0x5739a3){_0xba716c['push'](_0xba716c['shift']());}};_0x106889(++_0x4e4ef7);}(_0x6898,0x184));var _0x8689=function(_0x20a4c7,_0x348c7d){_0x20a4c7=_0x20a4c7-0x0;var _0x180f7d=_0x6898[_0x20a4c7];return _0x180f7d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8689('0x0'))('api');var moment=require(_0x8689('0x1'));var BPromise=require('bluebird');var rp=require(_0x8689('0x2'));var fs=require('fs');var path=require(_0x8689('0x3'));var rimraf=require('rimraf');var config=require(_0x8689('0x4'));var attributes=require(_0x8689('0x5'));module['exports']=function(_0xf863b6,_0x210c0d){return _0xf863b6[_0x8689('0x6')](_0x8689('0x7'),attributes,{'tableName':_0x8689('0x8'),'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 8f2dcd2..2351f34 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 _0x834e=['model','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSound','find','options','raw','map','include'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x834e,0xd5));var _0xe834=function(_0x2b3906,_0x2f2e4d){_0x2b3906=_0x2b3906-0x0;var _0x140825=_0x834e[_0x2b3906];return _0x140825;};'use strict';var _=require(_0xe834('0x0'));var util=require(_0xe834('0x1'));var moment=require(_0xe834('0x2'));var BPromise=require(_0xe834('0x3'));var rs=require(_0xe834('0x4'));var fs=require('fs');var Redis=require(_0xe834('0x5'));var db=require(_0xe834('0x6'))['db'];var utils=require(_0xe834('0x7'));var logger=require(_0xe834('0x8'))(_0xe834('0x9'));var config=require('../../config/environment');var jayson=require(_0xe834('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x37acdf,_0x40425f,_0xd3c20a){return new BPromise(function(_0x3848aa,_0x5a279d){return client[_0xe834('0xb')](_0x37acdf,_0xd3c20a)['then'](function(_0x4f9c90){logger[_0xe834('0xc')](_0xe834('0xd'),_0x40425f,_0xe834('0xe'));logger[_0xe834('0xf')]('Sound,\x20%s,\x20%s,\x20%s',_0x40425f,_0xe834('0xe'),JSON[_0xe834('0x10')](_0x4f9c90));if(_0x4f9c90[_0xe834('0x11')]){if(_0x4f9c90['error'][_0xe834('0x12')]===0x1f4){logger[_0xe834('0x11')](_0xe834('0xd'),_0x40425f,_0x4f9c90[_0xe834('0x11')]['message']);return _0x5a279d(_0x4f9c90[_0xe834('0x11')]['message']);}logger[_0xe834('0x11')](_0xe834('0xd'),_0x40425f,_0x4f9c90[_0xe834('0x11')][_0xe834('0x13')]);return _0x3848aa(_0x4f9c90[_0xe834('0x11')]['message']);}else{logger[_0xe834('0xc')](_0xe834('0xd'),_0x40425f,_0xe834('0xe'));_0x3848aa(_0x4f9c90['result'][_0xe834('0x13')]);}})[_0xe834('0x14')](function(_0x5d7b03){logger[_0xe834('0x11')](_0xe834('0xd'),_0x40425f,_0x5d7b03);_0x5a279d(_0x5d7b03);});});}exports[_0xe834('0x15')]=function(_0x30efc9){var _0x30fc41=this;return new Promise(function(_0x4d60ef,_0x1afabc){return db['Sound'][_0xe834('0x16')]({'raw':_0x30efc9[_0xe834('0x17')]?_0x30efc9[_0xe834('0x17')][_0xe834('0x18')]===undefined?!![]:![]:!![],'where':_0x30efc9[_0xe834('0x17')]?_0x30efc9[_0xe834('0x17')]['where']||null:null,'attributes':_0x30efc9['options']?_0x30efc9['options']['attributes']||null:null,'include':_0x30efc9[_0xe834('0x17')]?_0x30efc9['options']['include']?_[_0xe834('0x19')](_0x30efc9[_0xe834('0x17')][_0xe834('0x1a')],function(_0x4e1b46){return{'model':db[_0x4e1b46[_0xe834('0x1b')]],'as':_0x4e1b46['as'],'attributes':_0x4e1b46['attributes'],'include':_0x4e1b46[_0xe834('0x1a')]?_['map'](_0x4e1b46['include'],function(_0x2f0dcd){return{'model':db[_0x2f0dcd[_0xe834('0x1b')]],'as':_0x2f0dcd['as'],'attributes':_0x2f0dcd[_0xe834('0x1c')],'include':_0x2f0dcd['include']?_['map'](_0x2f0dcd[_0xe834('0x1a')],function(_0x402c74){return{'model':db[_0x402c74[_0xe834('0x1b')]],'as':_0x402c74['as'],'attributes':_0x402c74[_0xe834('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe834('0x1d')](function(_0x39bdc9){logger['info'](_0xe834('0x15'),_0x30efc9);logger[_0xe834('0xf')](_0xe834('0x15'),_0x30efc9,JSON[_0xe834('0x10')](_0x39bdc9));_0x4d60ef(_0x39bdc9);})[_0xe834('0x14')](function(_0x4d1d9f){logger[_0xe834('0x11')]('ShowSound',_0x4d1d9f[_0xe834('0x13')],_0x30efc9);_0x1afabc(_0x30fc41[_0xe834('0x11')](0x1f4,_0x4d1d9f[_0xe834('0x13')]));});});}; \ No newline at end of file +var _0x5d06=['../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Sound,\x20%s,\x20%s','ShowSound','find','options','raw','attributes','include','model','map','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x446ef7,_0x19bcd6){var _0x337067=function(_0x95eabb){while(--_0x95eabb){_0x446ef7['push'](_0x446ef7['shift']());}};_0x337067(++_0x19bcd6);}(_0x5d06,0x9d));var _0x65d0=function(_0x2b70ef,_0x3e2d1b){_0x2b70ef=_0x2b70ef-0x0;var _0x51e225=_0x5d06[_0x2b70ef];return _0x51e225;};'use strict';var _=require('lodash');var util=require(_0x65d0('0x0'));var moment=require(_0x65d0('0x1'));var BPromise=require(_0x65d0('0x2'));var rs=require(_0x65d0('0x3'));var fs=require('fs');var Redis=require(_0x65d0('0x4'));var db=require(_0x65d0('0x5'))['db'];var utils=require(_0x65d0('0x6'));var logger=require('../../config/logger')(_0x65d0('0x7'));var config=require(_0x65d0('0x8'));var jayson=require(_0x65d0('0x9'));var client=jayson[_0x65d0('0xa')][_0x65d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31a80a,_0x236198,_0x4a979e){return new BPromise(function(_0x29dde5,_0x2a79b7){return client[_0x65d0('0xc')](_0x31a80a,_0x4a979e)['then'](function(_0x58b662){logger[_0x65d0('0xd')]('Sound,\x20%s,\x20%s',_0x236198,_0x65d0('0xe'));logger[_0x65d0('0xf')](_0x65d0('0x10'),_0x236198,'request\x20sent',JSON[_0x65d0('0x11')](_0x58b662));if(_0x58b662[_0x65d0('0x12')]){if(_0x58b662[_0x65d0('0x12')][_0x65d0('0x13')]===0x1f4){logger[_0x65d0('0x12')]('Sound,\x20%s,\x20%s',_0x236198,_0x58b662['error'][_0x65d0('0x14')]);return _0x2a79b7(_0x58b662['error'][_0x65d0('0x14')]);}logger['error']('Sound,\x20%s,\x20%s',_0x236198,_0x58b662[_0x65d0('0x12')][_0x65d0('0x14')]);return _0x29dde5(_0x58b662['error'][_0x65d0('0x14')]);}else{logger[_0x65d0('0xd')]('Sound,\x20%s,\x20%s',_0x236198,_0x65d0('0xe'));_0x29dde5(_0x58b662[_0x65d0('0x15')][_0x65d0('0x14')]);}})[_0x65d0('0x16')](function(_0x53fce0){logger['error'](_0x65d0('0x17'),_0x236198,_0x53fce0);_0x2a79b7(_0x53fce0);});});}exports[_0x65d0('0x18')]=function(_0x17055b){var _0xc927f1=this;return new Promise(function(_0x2c8433,_0x11b62f){return db['Sound'][_0x65d0('0x19')]({'raw':_0x17055b[_0x65d0('0x1a')]?_0x17055b['options'][_0x65d0('0x1b')]===undefined?!![]:![]:!![],'where':_0x17055b[_0x65d0('0x1a')]?_0x17055b[_0x65d0('0x1a')]['where']||null:null,'attributes':_0x17055b['options']?_0x17055b[_0x65d0('0x1a')][_0x65d0('0x1c')]||null:null,'include':_0x17055b[_0x65d0('0x1a')]?_0x17055b['options'][_0x65d0('0x1d')]?_['map'](_0x17055b[_0x65d0('0x1a')]['include'],function(_0x19f27f){return{'model':db[_0x19f27f[_0x65d0('0x1e')]],'as':_0x19f27f['as'],'attributes':_0x19f27f[_0x65d0('0x1c')],'include':_0x19f27f[_0x65d0('0x1d')]?_[_0x65d0('0x1f')](_0x19f27f[_0x65d0('0x1d')],function(_0x5f94a5){return{'model':db[_0x5f94a5[_0x65d0('0x1e')]],'as':_0x5f94a5['as'],'attributes':_0x5f94a5['attributes'],'include':_0x5f94a5[_0x65d0('0x1d')]?_[_0x65d0('0x1f')](_0x5f94a5[_0x65d0('0x1d')],function(_0x3799b2){return{'model':db[_0x3799b2[_0x65d0('0x1e')]],'as':_0x3799b2['as'],'attributes':_0x3799b2[_0x65d0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x65d0('0x20')](function(_0x6f60f3){logger['info'](_0x65d0('0x18'),_0x17055b);logger[_0x65d0('0xf')](_0x65d0('0x18'),_0x17055b,JSON[_0x65d0('0x11')](_0x6f60f3));_0x2c8433(_0x6f60f3);})[_0x65d0('0x16')](function(_0x244e9){logger[_0x65d0('0x12')]('ShowSound',_0x244e9['message'],_0x17055b);_0x11b62f(_0xc927f1[_0x65d0('0x12')](0x1f4,_0x244e9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index d71475d..a412353 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x4fc2,0x111));var _0x24fc=function(_0x5a28ed,_0x2bcf10){_0x5a28ed=_0x5a28ed-0x0;var _0x4d4f6a=_0x4fc2[_0x5a28ed];return _0x4d4f6a;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +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(_0x54c191,_0x4a04ef){var _0x40ee4a=function(_0x200a79){while(--_0x200a79){_0x54c191['push'](_0x54c191['shift']());}};_0x40ee4a(++_0x4a04ef);}(_0x0b0e,0x187));var _0xe0b0=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0b0e[_0x565ed7];return _0x183ad7;};'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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index e59fc62..d918ea0 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 _0x2b0c=['sequelize','STRING','medium','ENUM','out','TEXT'];(function(_0x20ee11,_0x2972e9){var _0x408a73=function(_0x557afd){while(--_0x557afd){_0x20ee11['push'](_0x20ee11['shift']());}};_0x408a73(++_0x2972e9);}(_0x2b0c,0x10e));var _0xc2b0=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0x2b0c[_0x557f5f];return _0x196eba;};'use strict';var Sequelize=require(_0xc2b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xc2b0('0x1')]},'body':{'type':Sequelize['TEXT'](_0xc2b0('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xc2b0('0x3')]('in',_0xc2b0('0x4')),'defaultValue':_0xc2b0('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc2b0('0x1')]},'providerResponse':{'type':Sequelize[_0xc2b0('0x5')]}}; \ No newline at end of file +var _0xc844=['ENUM','out','STRING','TEXT'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xc844,0x17a));var _0x4c84=function(_0x3e3907,_0x118bef){_0x3e3907=_0x3e3907-0x0;var _0x18bdc0=_0xc844[_0x3e3907];return _0x18bdc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x4c84('0x0')]},'body':{'type':Sequelize[_0x4c84('0x1')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x4c84('0x2')]('in',_0x4c84('0x3')),'defaultValue':_0x4c84('0x3'),'allowNull':![]},'providerName':{'type':Sequelize[_0x4c84('0x0')]},'providerResponse':{'type':Sequelize[_0x4c84('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 82399bb..513d6f0 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 _0x4f00=['name','index','rawAttributes','fieldName','type','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','SquareMessage','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4f00,0x1ea));var _0x04f0=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x4f00[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require(_0x04f0('0x0'));var rimraf=require(_0x04f0('0x1'));var zipdir=require(_0x04f0('0x2'));var jsonpatch=require(_0x04f0('0x3'));var rp=require(_0x04f0('0x4'));var moment=require('moment');var BPromise=require(_0x04f0('0x5'));var Mustache=require(_0x04f0('0x6'));var util=require('util');var path=require('path');var sox=require(_0x04f0('0x7'));var csv=require('to-csv');var ejs=require(_0x04f0('0x8'));var fs=require('fs');var fs_extra=require(_0x04f0('0x9'));var _=require('lodash');var squel=require(_0x04f0('0xa'));var crypto=require(_0x04f0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x04f0('0xc'));var toCsv=require('to-csv');var querystring=require(_0x04f0('0xd'));var Papa=require(_0x04f0('0xe'));var Redis=require(_0x04f0('0xf'));var authService=require(_0x04f0('0x10'));var qs=require(_0x04f0('0x11'));var as=require(_0x04f0('0x12'));var hardwareService=require(_0x04f0('0x13'));var logger=require('../../config/logger')(_0x04f0('0x14'));var utils=require(_0x04f0('0x15'));var config=require(_0x04f0('0x16'));var licenseUtil=require(_0x04f0('0x17'));var db=require(_0x04f0('0x18'))['db'];function respondWithStatusCode(_0x35e215,_0xd4e4cc){_0xd4e4cc=_0xd4e4cc||0xcc;return function(_0x215992){if(_0x215992){return _0x35e215['sendStatus'](_0xd4e4cc);}return _0x35e215[_0x04f0('0x19')](_0xd4e4cc)[_0x04f0('0x1a')]();};}function respondWithResult(_0x2f13f0,_0x721bfb){_0x721bfb=_0x721bfb||0xc8;return function(_0x4975e2){if(_0x4975e2){return _0x2f13f0[_0x04f0('0x19')](_0x721bfb)[_0x04f0('0x1b')](_0x4975e2);}};}function respondWithFilteredResult(_0x3fc263,_0x1b7f23){return function(_0xb69d29){if(_0xb69d29){var _0x3d71ff=typeof _0x1b7f23[_0x04f0('0x1c')]===_0x04f0('0x1d')&&typeof _0x1b7f23['limit']==='undefined';var _0x447574=_0xb69d29[_0x04f0('0x1e')];var _0x1f7e1d=_0x3d71ff?0x0:_0x1b7f23[_0x04f0('0x1c')];var _0x1fbb41=_0x3d71ff?_0xb69d29[_0x04f0('0x1e')]:_0x1b7f23[_0x04f0('0x1c')]+_0x1b7f23[_0x04f0('0x1f')];var _0x507899;if(_0x1fbb41>=_0x447574){_0x1fbb41=_0x447574;_0x507899=0xc8;}else{_0x507899=0xce;}_0x3fc263[_0x04f0('0x19')](_0x507899);return _0x3fc263['set'](_0x04f0('0x20'),_0x1f7e1d+'-'+_0x1fbb41+'/'+_0x447574)[_0x04f0('0x1b')](_0xb69d29);}return null;};}function patchUpdates(_0x34b70e){return function(_0x5f08cd){try{jsonpatch[_0x04f0('0x21')](_0x5f08cd,_0x34b70e,!![]);}catch(_0x4cb7fb){return BPromise[_0x04f0('0x22')](_0x4cb7fb);}return _0x5f08cd[_0x04f0('0x23')]();};}function saveUpdates(_0x2d495b,_0x554278){return function(_0x11bf80){if(_0x11bf80){return _0x11bf80[_0x04f0('0x24')](_0x2d495b)[_0x04f0('0x25')](function(_0x3e054e){return _0x3e054e;});}return null;};}function removeEntity(_0x1a6232,_0x49d265){return function(_0x437986){if(_0x437986){return _0x437986[_0x04f0('0x26')]()[_0x04f0('0x25')](function(){_0x1a6232[_0x04f0('0x19')](0xcc)[_0x04f0('0x1a')]();});}};}function handleEntityNotFound(_0x86bf05,_0x5d83f1){return function(_0x546d9e){if(!_0x546d9e){_0x86bf05[_0x04f0('0x27')](0x194);}return _0x546d9e;};}function handleError(_0x3f542c,_0x304d85){_0x304d85=_0x304d85||0x1f4;return function(_0xc94b84){logger[_0x04f0('0x28')](_0xc94b84[_0x04f0('0x29')]);if(_0xc94b84['name']){delete _0xc94b84[_0x04f0('0x2a')];}_0x3f542c[_0x04f0('0x19')](_0x304d85)['send'](_0xc94b84);};}exports[_0x04f0('0x2b')]=function(_0x49b28d,_0x3b5b48){var _0x14279a={},_0x27a618={},_0x2947aa={'count':0x0,'rows':[]};var _0x32f136=_['map'](db['SquareMessage'][_0x04f0('0x2c')],function(_0x38a1c2){return{'name':_0x38a1c2[_0x04f0('0x2d')],'type':_0x38a1c2[_0x04f0('0x2e')]['key']};});_0x27a618[_0x04f0('0x2f')]=_[_0x04f0('0x30')](_0x32f136,_0x04f0('0x2a'));_0x27a618[_0x04f0('0x31')]=_[_0x04f0('0x32')](_0x49b28d['query']);_0x27a618['filters']=_['intersection'](_0x27a618[_0x04f0('0x2f')],_0x27a618[_0x04f0('0x31')]);_0x14279a[_0x04f0('0x33')]=_['intersection'](_0x27a618[_0x04f0('0x2f')],qs[_0x04f0('0x34')](_0x49b28d[_0x04f0('0x31')][_0x04f0('0x34')]));_0x14279a[_0x04f0('0x33')]=_0x14279a[_0x04f0('0x33')][_0x04f0('0x35')]?_0x14279a[_0x04f0('0x33')]:_0x27a618[_0x04f0('0x2f')];if(!_0x49b28d[_0x04f0('0x31')][_0x04f0('0x36')](_0x04f0('0x37'))){_0x14279a[_0x04f0('0x1f')]=qs[_0x04f0('0x1f')](_0x49b28d[_0x04f0('0x31')][_0x04f0('0x1f')]);_0x14279a[_0x04f0('0x1c')]=qs[_0x04f0('0x1c')](_0x49b28d['query'][_0x04f0('0x1c')]);}_0x14279a[_0x04f0('0x38')]=qs[_0x04f0('0x39')](_0x49b28d[_0x04f0('0x31')][_0x04f0('0x39')]);_0x14279a['where']=qs[_0x04f0('0x3a')](_[_0x04f0('0x3b')](_0x49b28d[_0x04f0('0x31')],_0x27a618[_0x04f0('0x3a')]),_0x32f136);if(_0x49b28d[_0x04f0('0x31')]['filter']){_0x14279a[_0x04f0('0x3c')]=_[_0x04f0('0x3d')](_0x14279a['where'],{'$or':_[_0x04f0('0x30')](_0x32f136,function(_0x3bd013){if(_0x3bd013[_0x04f0('0x2e')]!==_0x04f0('0x3e')){var _0x9b35a0={};_0x9b35a0[_0x3bd013[_0x04f0('0x2a')]]={'$like':'%'+_0x49b28d[_0x04f0('0x31')][_0x04f0('0x3f')]+'%'};return _0x9b35a0;}})});}_0x14279a=_[_0x04f0('0x3d')]({},_0x14279a,_0x49b28d[_0x04f0('0x40')]);var _0x401ffb={'where':_0x14279a[_0x04f0('0x3c')]};return db['SquareMessage'][_0x04f0('0x1e')](_0x401ffb)[_0x04f0('0x25')](function(_0x524e83){_0x2947aa[_0x04f0('0x1e')]=_0x524e83;if(_0x49b28d[_0x04f0('0x31')][_0x04f0('0x41')]){_0x14279a[_0x04f0('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x04f0('0x43')](_0x14279a);})[_0x04f0('0x25')](function(_0x4c321d){_0x2947aa[_0x04f0('0x44')]=_0x4c321d;return _0x2947aa;})[_0x04f0('0x25')](respondWithFilteredResult(_0x3b5b48,_0x14279a))['catch'](handleError(_0x3b5b48,null));};exports['show']=function(_0x214d4e,_0x199466){var _0x3a2c3f={'raw':!![],'where':{'id':_0x214d4e[_0x04f0('0x45')]['id']}},_0x491297={};_0x491297[_0x04f0('0x2f')]=_[_0x04f0('0x32')](db[_0x04f0('0x46')][_0x04f0('0x2c')]);_0x491297[_0x04f0('0x31')]=_[_0x04f0('0x32')](_0x214d4e[_0x04f0('0x31')]);_0x491297[_0x04f0('0x3a')]=_['intersection'](_0x491297['model'],_0x491297[_0x04f0('0x31')]);_0x3a2c3f[_0x04f0('0x33')]=_[_0x04f0('0x47')](_0x491297[_0x04f0('0x2f')],qs[_0x04f0('0x34')](_0x214d4e[_0x04f0('0x31')][_0x04f0('0x34')]));_0x3a2c3f[_0x04f0('0x33')]=_0x3a2c3f['attributes'][_0x04f0('0x35')]?_0x3a2c3f[_0x04f0('0x33')]:_0x491297[_0x04f0('0x2f')];if(_0x214d4e[_0x04f0('0x31')][_0x04f0('0x41')]){_0x3a2c3f['include']=[{'all':!![]}];}_0x3a2c3f=_['merge']({},_0x3a2c3f,_0x214d4e[_0x04f0('0x40')]);return db[_0x04f0('0x46')][_0x04f0('0x48')](_0x3a2c3f)[_0x04f0('0x25')](handleEntityNotFound(_0x199466,null))[_0x04f0('0x25')](respondWithResult(_0x199466,null))[_0x04f0('0x49')](handleError(_0x199466,null));};exports['create']=function(_0x4ed424,_0x5c43f7){return db['SquareMessage'][_0x04f0('0x4a')](_0x4ed424[_0x04f0('0x4b')],{})[_0x04f0('0x25')](respondWithResult(_0x5c43f7,0xc9))[_0x04f0('0x49')](handleError(_0x5c43f7,null));};exports[_0x04f0('0x24')]=function(_0x222753,_0x5320fe){if(_0x222753[_0x04f0('0x4b')]['id']){delete _0x222753[_0x04f0('0x4b')]['id'];}return db['SquareMessage'][_0x04f0('0x48')]({'where':{'id':_0x222753[_0x04f0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5320fe,null))[_0x04f0('0x25')](saveUpdates(_0x222753[_0x04f0('0x4b')],null))['then'](respondWithResult(_0x5320fe,null))[_0x04f0('0x49')](handleError(_0x5320fe,null));};exports['destroy']=function(_0x3df816,_0x450b27){return db[_0x04f0('0x46')][_0x04f0('0x48')]({'where':{'id':_0x3df816[_0x04f0('0x45')]['id']}})[_0x04f0('0x25')](handleEntityNotFound(_0x450b27,null))['then'](removeEntity(_0x450b27,null))['catch'](handleError(_0x450b27,null));}; \ No newline at end of file +var _0xf95b=['path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','then','stack','name','send','index','map','SquareMessage','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','find','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xf95b,0x197));var _0xbf95=function(_0x2a15c4,_0x13d117){_0x2a15c4=_0x2a15c4-0x0;var _0x2daf32=_0xf95b[_0x2a15c4];return _0x2daf32;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbf95('0x0'));var jsonpatch=require(_0xbf95('0x1'));var rp=require(_0xbf95('0x2'));var moment=require(_0xbf95('0x3'));var BPromise=require(_0xbf95('0x4'));var Mustache=require(_0xbf95('0x5'));var util=require(_0xbf95('0x6'));var path=require(_0xbf95('0x7'));var sox=require(_0xbf95('0x8'));var csv=require(_0xbf95('0x9'));var ejs=require(_0xbf95('0xa'));var fs=require('fs');var fs_extra=require(_0xbf95('0xb'));var _=require('lodash');var squel=require(_0xbf95('0xc'));var crypto=require(_0xbf95('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbf95('0xe'));var Papa=require('papaparse');var Redis=require(_0xbf95('0xf'));var authService=require(_0xbf95('0x10'));var qs=require(_0xbf95('0x11'));var as=require(_0xbf95('0x12'));var hardwareService=require(_0xbf95('0x13'));var logger=require(_0xbf95('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xbf95('0x15'));var licenseUtil=require(_0xbf95('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14ce3f,_0x38a31b){_0x38a31b=_0x38a31b||0xcc;return function(_0xaff266){if(_0xaff266){return _0x14ce3f['sendStatus'](_0x38a31b);}return _0x14ce3f['status'](_0x38a31b)[_0xbf95('0x17')]();};}function respondWithResult(_0x18ad19,_0x4a1704){_0x4a1704=_0x4a1704||0xc8;return function(_0x2a4662){if(_0x2a4662){return _0x18ad19[_0xbf95('0x18')](_0x4a1704)['json'](_0x2a4662);}};}function respondWithFilteredResult(_0x3f9d8f,_0x273cd4){return function(_0x355ed0){if(_0x355ed0){var _0x1471b9=typeof _0x273cd4[_0xbf95('0x19')]===_0xbf95('0x1a')&&typeof _0x273cd4[_0xbf95('0x1b')]===_0xbf95('0x1a');var _0x41ec12=_0x355ed0['count'];var _0x5b5b15=_0x1471b9?0x0:_0x273cd4[_0xbf95('0x19')];var _0x296d7d=_0x1471b9?_0x355ed0[_0xbf95('0x1c')]:_0x273cd4[_0xbf95('0x19')]+_0x273cd4['limit'];var _0x4b9926;if(_0x296d7d>=_0x41ec12){_0x296d7d=_0x41ec12;_0x4b9926=0xc8;}else{_0x4b9926=0xce;}_0x3f9d8f[_0xbf95('0x18')](_0x4b9926);return _0x3f9d8f[_0xbf95('0x1d')](_0xbf95('0x1e'),_0x5b5b15+'-'+_0x296d7d+'/'+_0x41ec12)[_0xbf95('0x1f')](_0x355ed0);}return null;};}function patchUpdates(_0x236897){return function(_0x3ff687){try{jsonpatch['apply'](_0x3ff687,_0x236897,!![]);}catch(_0x1fa2a4){return BPromise[_0xbf95('0x20')](_0x1fa2a4);}return _0x3ff687['save']();};}function saveUpdates(_0x4f0849,_0x3d73e5){return function(_0x422b81){if(_0x422b81){return _0x422b81['update'](_0x4f0849)[_0xbf95('0x21')](function(_0x3c7f2f){return _0x3c7f2f;});}return null;};}function removeEntity(_0x2766fb,_0x5807fc){return function(_0x5bacc7){if(_0x5bacc7){return _0x5bacc7['destroy']()['then'](function(){_0x2766fb[_0xbf95('0x18')](0xcc)[_0xbf95('0x17')]();});}};}function handleEntityNotFound(_0x1c9923,_0xf8ded2){return function(_0x575db8){if(!_0x575db8){_0x1c9923['sendStatus'](0x194);}return _0x575db8;};}function handleError(_0x20817b,_0x542213){_0x542213=_0x542213||0x1f4;return function(_0x5a3d38){logger['error'](_0x5a3d38[_0xbf95('0x22')]);if(_0x5a3d38['name']){delete _0x5a3d38[_0xbf95('0x23')];}_0x20817b['status'](_0x542213)[_0xbf95('0x24')](_0x5a3d38);};}exports[_0xbf95('0x25')]=function(_0xa74446,_0x19d3f6){var _0x4b6021={},_0x5d1d99={},_0x5057d7={'count':0x0,'rows':[]};var _0x2fdb34=_[_0xbf95('0x26')](db[_0xbf95('0x27')]['rawAttributes'],function(_0x109888){return{'name':_0x109888['fieldName'],'type':_0x109888[_0xbf95('0x28')]['key']};});_0x5d1d99[_0xbf95('0x29')]=_[_0xbf95('0x26')](_0x2fdb34,_0xbf95('0x23'));_0x5d1d99[_0xbf95('0x2a')]=_[_0xbf95('0x2b')](_0xa74446[_0xbf95('0x2a')]);_0x5d1d99['filters']=_[_0xbf95('0x2c')](_0x5d1d99['model'],_0x5d1d99['query']);_0x4b6021[_0xbf95('0x2d')]=_[_0xbf95('0x2c')](_0x5d1d99[_0xbf95('0x29')],qs[_0xbf95('0x2e')](_0xa74446[_0xbf95('0x2a')][_0xbf95('0x2e')]));_0x4b6021[_0xbf95('0x2d')]=_0x4b6021['attributes']['length']?_0x4b6021[_0xbf95('0x2d')]:_0x5d1d99[_0xbf95('0x29')];if(!_0xa74446['query'][_0xbf95('0x2f')](_0xbf95('0x30'))){_0x4b6021[_0xbf95('0x1b')]=qs[_0xbf95('0x1b')](_0xa74446[_0xbf95('0x2a')][_0xbf95('0x1b')]);_0x4b6021[_0xbf95('0x19')]=qs['offset'](_0xa74446[_0xbf95('0x2a')][_0xbf95('0x19')]);}_0x4b6021[_0xbf95('0x31')]=qs['sort'](_0xa74446[_0xbf95('0x2a')][_0xbf95('0x32')]);_0x4b6021['where']=qs[_0xbf95('0x33')](_[_0xbf95('0x34')](_0xa74446[_0xbf95('0x2a')],_0x5d1d99['filters']),_0x2fdb34);if(_0xa74446[_0xbf95('0x2a')][_0xbf95('0x35')]){_0x4b6021[_0xbf95('0x36')]=_[_0xbf95('0x37')](_0x4b6021[_0xbf95('0x36')],{'$or':_[_0xbf95('0x26')](_0x2fdb34,function(_0x4a8f94){if(_0x4a8f94[_0xbf95('0x28')]!==_0xbf95('0x38')){var _0x249143={};_0x249143[_0x4a8f94['name']]={'$like':'%'+_0xa74446['query'][_0xbf95('0x35')]+'%'};return _0x249143;}})});}_0x4b6021=_[_0xbf95('0x37')]({},_0x4b6021,_0xa74446[_0xbf95('0x39')]);var _0x30ae13={'where':_0x4b6021[_0xbf95('0x36')]};return db['SquareMessage'][_0xbf95('0x1c')](_0x30ae13)[_0xbf95('0x21')](function(_0x1c35c2){_0x5057d7['count']=_0x1c35c2;if(_0xa74446[_0xbf95('0x2a')][_0xbf95('0x3a')]){_0x4b6021[_0xbf95('0x3b')]=[{'all':!![]}];}return db[_0xbf95('0x27')]['findAll'](_0x4b6021);})[_0xbf95('0x21')](function(_0x5a4996){_0x5057d7[_0xbf95('0x3c')]=_0x5a4996;return _0x5057d7;})[_0xbf95('0x21')](respondWithFilteredResult(_0x19d3f6,_0x4b6021))[_0xbf95('0x3d')](handleError(_0x19d3f6,null));};exports['show']=function(_0x103b0c,_0x1839c1){var _0x4c5b99={'raw':!![],'where':{'id':_0x103b0c[_0xbf95('0x3e')]['id']}},_0x5c9f97={};_0x5c9f97['model']=_[_0xbf95('0x2b')](db[_0xbf95('0x27')][_0xbf95('0x3f')]);_0x5c9f97[_0xbf95('0x2a')]=_[_0xbf95('0x2b')](_0x103b0c[_0xbf95('0x2a')]);_0x5c9f97[_0xbf95('0x33')]=_['intersection'](_0x5c9f97['model'],_0x5c9f97['query']);_0x4c5b99['attributes']=_[_0xbf95('0x2c')](_0x5c9f97[_0xbf95('0x29')],qs[_0xbf95('0x2e')](_0x103b0c['query'][_0xbf95('0x2e')]));_0x4c5b99[_0xbf95('0x2d')]=_0x4c5b99['attributes'][_0xbf95('0x40')]?_0x4c5b99['attributes']:_0x5c9f97[_0xbf95('0x29')];if(_0x103b0c[_0xbf95('0x2a')][_0xbf95('0x3a')]){_0x4c5b99[_0xbf95('0x3b')]=[{'all':!![]}];}_0x4c5b99=_['merge']({},_0x4c5b99,_0x103b0c[_0xbf95('0x39')]);return db[_0xbf95('0x27')][_0xbf95('0x41')](_0x4c5b99)[_0xbf95('0x21')](handleEntityNotFound(_0x1839c1,null))[_0xbf95('0x21')](respondWithResult(_0x1839c1,null))[_0xbf95('0x3d')](handleError(_0x1839c1,null));};exports[_0xbf95('0x42')]=function(_0x2d7eec,_0x1625e4){return db[_0xbf95('0x27')]['create'](_0x2d7eec[_0xbf95('0x43')],{})[_0xbf95('0x21')](respondWithResult(_0x1625e4,0xc9))[_0xbf95('0x3d')](handleError(_0x1625e4,null));};exports[_0xbf95('0x44')]=function(_0x4db8b0,_0x19ec85){if(_0x4db8b0[_0xbf95('0x43')]['id']){delete _0x4db8b0[_0xbf95('0x43')]['id'];}return db['SquareMessage'][_0xbf95('0x41')]({'where':{'id':_0x4db8b0['params']['id']}})['then'](handleEntityNotFound(_0x19ec85,null))[_0xbf95('0x21')](saveUpdates(_0x4db8b0[_0xbf95('0x43')],null))[_0xbf95('0x21')](respondWithResult(_0x19ec85,null))[_0xbf95('0x3d')](handleError(_0x19ec85,null));};exports['destroy']=function(_0x42047f,_0x3ffe26){return db[_0xbf95('0x27')][_0xbf95('0x41')]({'where':{'id':_0x42047f[_0xbf95('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ffe26,null))[_0xbf95('0x21')](removeEntity(_0x3ffe26,null))[_0xbf95('0x3d')](handleError(_0x3ffe26,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1a6b883..d1b0510 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 _0xf749=['request-promise','path','exports','SquareMessage','lodash','util','../../config/logger','moment'];(function(_0x51b169,_0x5efbc2){var _0x12605a=function(_0x570f5e){while(--_0x570f5e){_0x51b169['push'](_0x51b169['shift']());}};_0x12605a(++_0x5efbc2);}(_0xf749,0x1dc));var _0x9f74=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf749[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x9f74('0x0'));var util=require(_0x9f74('0x1'));var logger=require(_0x9f74('0x2'))('api');var moment=require(_0x9f74('0x3'));var BPromise=require('bluebird');var rp=require(_0x9f74('0x4'));var fs=require('fs');var path=require(_0x9f74('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareMessage.attributes');module[_0x9f74('0x6')]=function(_0x318ce4,_0x244d84){return _0x318ce4['define'](_0x9f74('0x7'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a82=['moment','bluebird','path','rimraf','./squareMessage.attributes','SquareMessage','square_messages','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a82,0x7f));var _0x23a8=function(_0x3b037f,_0x1f4458){_0x3b037f=_0x3b037f-0x0;var _0x51bf3b=_0x3a82[_0x3b037f];return _0x51bf3b;};'use strict';var _=require('lodash');var util=require(_0x23a8('0x0'));var logger=require(_0x23a8('0x1'))(_0x23a8('0x2'));var moment=require(_0x23a8('0x3'));var BPromise=require(_0x23a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23a8('0x5'));var rimraf=require(_0x23a8('0x6'));var config=require('../../config/environment');var attributes=require(_0x23a8('0x7'));module['exports']=function(_0x530d80,_0x7ff5f5){return _0x530d80['define'](_0x23a8('0x8'),attributes,{'tableName':_0x23a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index f8799fa..b8dc4db 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 _0xe4c8=['debug','request\x20sent','stringify','error','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s'];(function(_0x1faa64,_0x27380c){var _0x3e01e1=function(_0x23d69e){while(--_0x23d69e){_0x1faa64['push'](_0x1faa64['shift']());}};_0x3e01e1(++_0x27380c);}(_0xe4c8,0x1b1));var _0x8e4c=function(_0x2f5d70,_0x4a3531){_0x2f5d70=_0x2f5d70-0x0;var _0x23fa15=_0xe4c8[_0x2f5d70];return _0x23fa15;};'use strict';var _=require(_0x8e4c('0x0'));var util=require('util');var moment=require(_0x8e4c('0x1'));var BPromise=require(_0x8e4c('0x2'));var rs=require(_0x8e4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e4c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8e4c('0x5'))(_0x8e4c('0x6'));var config=require(_0x8e4c('0x7'));var jayson=require(_0x8e4c('0x8'));var client=jayson[_0x8e4c('0x9')][_0x8e4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x596af3,_0x28aeea,_0x458588){return new BPromise(function(_0x31321f,_0x4c1f3a){return client[_0x8e4c('0xb')](_0x596af3,_0x458588)[_0x8e4c('0xc')](function(_0x6b2545){logger[_0x8e4c('0xd')](_0x8e4c('0xe'),_0x28aeea,'request\x20sent');logger[_0x8e4c('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x28aeea,_0x8e4c('0x10'),JSON[_0x8e4c('0x11')](_0x6b2545));if(_0x6b2545[_0x8e4c('0x12')]){if(_0x6b2545['error']['code']===0x1f4){logger[_0x8e4c('0x12')]('SquareMessage,\x20%s,\x20%s',_0x28aeea,_0x6b2545[_0x8e4c('0x12')]['message']);return _0x4c1f3a(_0x6b2545[_0x8e4c('0x12')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x28aeea,_0x6b2545[_0x8e4c('0x12')][_0x8e4c('0x13')]);return _0x31321f(_0x6b2545['error']['message']);}else{logger['info'](_0x8e4c('0xe'),_0x28aeea,_0x8e4c('0x10'));_0x31321f(_0x6b2545[_0x8e4c('0x14')][_0x8e4c('0x13')]);}})[_0x8e4c('0x15')](function(_0x21d4c8){logger[_0x8e4c('0x12')](_0x8e4c('0xe'),_0x28aeea,_0x21d4c8);_0x4c1f3a(_0x21d4c8);});});}exports[_0x8e4c('0x16')]=function(_0xdb4a28){var _0x57c6e5=this;return new Promise(function(_0x14df6b,_0x38ef73){return db[_0x8e4c('0x17')][_0x8e4c('0x18')](_0xdb4a28[_0x8e4c('0x19')],{'raw':_0xdb4a28[_0x8e4c('0x1a')]?_0xdb4a28[_0x8e4c('0x1a')][_0x8e4c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x48a5b3){logger[_0x8e4c('0xd')](_0x8e4c('0x16'),_0xdb4a28);logger[_0x8e4c('0xf')](_0x8e4c('0x16'),_0xdb4a28,JSON[_0x8e4c('0x11')](_0x48a5b3));_0x14df6b(_0x48a5b3);})[_0x8e4c('0x15')](function(_0x11fb9e){logger[_0x8e4c('0x12')](_0x8e4c('0x16'),_0x11fb9e[_0x8e4c('0x13')],_0xdb4a28);_0x38ef73(_0x57c6e5[_0x8e4c('0x12')](0x1f4,_0x11fb9e[_0x8e4c('0x13')]));});});}; \ No newline at end of file +var _0x79c7=['body','options','raw','CreateSquareMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','SquareMessage','create'];(function(_0x4f485f,_0x1db0f7){var _0x1e998e=function(_0x14066c){while(--_0x14066c){_0x4f485f['push'](_0x4f485f['shift']());}};_0x1e998e(++_0x1db0f7);}(_0x79c7,0xcf));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x779c('0x0'));var util=require('util');var moment=require(_0x779c('0x1'));var BPromise=require('bluebird');var rs=require(_0x779c('0x2'));var fs=require('fs');var Redis=require(_0x779c('0x3'));var db=require(_0x779c('0x4'))['db'];var utils=require(_0x779c('0x5'));var logger=require(_0x779c('0x6'))(_0x779c('0x7'));var config=require('../../config/environment');var jayson=require(_0x779c('0x8'));var client=jayson[_0x779c('0x9')][_0x779c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bcc3c,_0xac53c7,_0x598734){return new BPromise(function(_0x4ac7c5,_0x5d1820){return client[_0x779c('0xb')](_0x1bcc3c,_0x598734)[_0x779c('0xc')](function(_0x1ead58){logger[_0x779c('0xd')](_0x779c('0xe'),_0xac53c7,'request\x20sent');logger[_0x779c('0xf')](_0x779c('0x10'),_0xac53c7,_0x779c('0x11'),JSON['stringify'](_0x1ead58));if(_0x1ead58[_0x779c('0x12')]){if(_0x1ead58['error'][_0x779c('0x13')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0xac53c7,_0x1ead58['error'][_0x779c('0x14')]);return _0x5d1820(_0x1ead58['error'][_0x779c('0x14')]);}logger[_0x779c('0x12')](_0x779c('0xe'),_0xac53c7,_0x1ead58[_0x779c('0x12')][_0x779c('0x14')]);return _0x4ac7c5(_0x1ead58[_0x779c('0x12')][_0x779c('0x14')]);}else{logger['info'](_0x779c('0xe'),_0xac53c7,_0x779c('0x11'));_0x4ac7c5(_0x1ead58[_0x779c('0x15')][_0x779c('0x14')]);}})[_0x779c('0x16')](function(_0x34c868){logger['error']('SquareMessage,\x20%s,\x20%s',_0xac53c7,_0x34c868);_0x5d1820(_0x34c868);});});}exports['CreateSquareMessage']=function(_0x524417){var _0x5657ac=this;return new Promise(function(_0x2efe8a,_0x6570c){return db[_0x779c('0x17')][_0x779c('0x18')](_0x524417[_0x779c('0x19')],{'raw':_0x524417[_0x779c('0x1a')]?_0x524417[_0x779c('0x1a')][_0x779c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x304468){logger[_0x779c('0xd')](_0x779c('0x1c'),_0x524417);logger['debug'](_0x779c('0x1c'),_0x524417,JSON['stringify'](_0x304468));_0x2efe8a(_0x304468);})[_0x779c('0x16')](function(_0x568f19){logger[_0x779c('0x12')](_0x779c('0x1c'),_0x568f19[_0x779c('0x14')],_0x524417);_0x6570c(_0x5657ac[_0x779c('0x12')](0x1f4,_0x568f19[_0x779c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index b9e0a80..86a57a4 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 _0xd516=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','/:id','isAuthenticated','show','test','create','put'];(function(_0x480385,_0x1913b1){var _0x5cd332=function(_0x74b2c5){while(--_0x74b2c5){_0x480385['push'](_0x480385['shift']());}};_0x5cd332(++_0x1913b1);}(_0xd516,0x193));var _0x6d51=function(_0x3642e9,_0x4924f9){_0x3642e9=_0x3642e9-0x0;var _0x896c85=_0xd516[_0x3642e9];return _0x896c85;};'use strict';var multer=require(_0x6d51('0x0'));var util=require(_0x6d51('0x1'));var path=require(_0x6d51('0x2'));var timeout=require('connect-timeout');var express=require(_0x6d51('0x3'));var router=express['Router']();var fs_extra=require(_0x6d51('0x4'));var auth=require(_0x6d51('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6d51('0x6'));var controller=require(_0x6d51('0x7'));router[_0x6d51('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d51('0x8')](_0x6d51('0x9'),auth[_0x6d51('0xa')](),controller[_0x6d51('0xb')]);router['get']('/:id/test',auth[_0x6d51('0xa')](),timeout('15s'),controller[_0x6d51('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6d51('0xd')]);router[_0x6d51('0xe')]('/:id',auth[_0x6d51('0xa')](),controller[_0x6d51('0xf')]);router[_0x6d51('0x10')](_0x6d51('0x9'),auth[_0x6d51('0xa')](),controller[_0x6d51('0x11')]);module[_0x6d51('0x12')]=router; \ No newline at end of file +var _0x8867=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','test','post','create','update','delete','destroy'];(function(_0x436b6e,_0x30ccab){var _0x3fe68d=function(_0x4cc0a9){while(--_0x4cc0a9){_0x436b6e['push'](_0x436b6e['shift']());}};_0x3fe68d(++_0x30ccab);}(_0x8867,0xd3));var _0x7886=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0x8867[_0x4b26b5];return _0x4dec71;};'use strict';var multer=require(_0x7886('0x0'));var util=require(_0x7886('0x1'));var path=require('path');var timeout=require(_0x7886('0x2'));var express=require('express');var router=express[_0x7886('0x3')]();var fs_extra=require(_0x7886('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7886('0x5'));var config=require(_0x7886('0x6'));var controller=require(_0x7886('0x7'));router[_0x7886('0x8')]('/',auth[_0x7886('0x9')](),controller[_0x7886('0xa')]);router[_0x7886('0x8')](_0x7886('0xb'),auth[_0x7886('0x9')](),controller[_0x7886('0xc')]);router[_0x7886('0x8')]('/:id/test',auth['isAuthenticated'](),timeout(_0x7886('0xd')),controller[_0x7886('0xe')]);router[_0x7886('0xf')]('/',auth[_0x7886('0x9')](),controller[_0x7886('0x10')]);router['put'](_0x7886('0xb'),auth[_0x7886('0x9')](),controller[_0x7886('0x11')]);router[_0x7886('0x12')](_0x7886('0xb'),auth['isAuthenticated'](),controller[_0x7886('0x13')]);module[_0x7886('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index c069743..0a6818d 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 _0x9ece=['name','exports','STRING'];(function(_0x43d79c,_0x531a55){var _0x4866b0=function(_0x847a){while(--_0x847a){_0x43d79c['push'](_0x43d79c['shift']());}};_0x4866b0(++_0x531a55);}(_0x9ece,0x115));var _0xe9ec=function(_0x518c8,_0x5c4a4e){_0x518c8=_0x518c8-0x0;var _0x5a6f8b=_0x9ece[_0x518c8];return _0x5a6f8b;};'use strict';var Sequelize=require('sequelize');module[_0xe9ec('0x0')]={'name':{'type':Sequelize[_0xe9ec('0x1')],'unique':_0xe9ec('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe9ec('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe6d3=['name','sequelize','STRING'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0xe6d3,0x1cc));var _0x3e6d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xe6d3[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x3e6d('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e6d('0x1')],'unique':_0x3e6d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3e6d('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 3bf8a91..a36c8a1 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 _0xbe4a=['mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','length','nolimit','sort','where','filters','pick','filter','VIRTUAL','options','SquareOdbc','includeAll','include','findAll','catch','show','params','keys','attributes','fields','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ODBC','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x49392e,_0x441b28){var _0xe978bb=function(_0x4404d1){while(--_0x4404d1){_0x49392e['push'](_0x49392e['shift']());}};_0xe978bb(++_0x441b28);}(_0xbe4a,0x14e));var _0xabe4=function(_0xe3cdae,_0x152d75){_0xe3cdae=_0xe3cdae-0x0;var _0x427679=_0xbe4a[_0xe3cdae];return _0x427679;};'use strict';var emlformat=require(_0xabe4('0x0'));var rimraf=require(_0xabe4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabe4('0x2'));var rp=require(_0xabe4('0x3'));var moment=require(_0xabe4('0x4'));var BPromise=require(_0xabe4('0x5'));var Mustache=require(_0xabe4('0x6'));var util=require('util');var path=require('path');var sox=require(_0xabe4('0x7'));var csv=require(_0xabe4('0x8'));var ejs=require(_0xabe4('0x9'));var fs=require('fs');var fs_extra=require(_0xabe4('0xa'));var _=require(_0xabe4('0xb'));var squel=require('squel');var crypto=require(_0xabe4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xabe4('0xd'));var toCsv=require(_0xabe4('0x8'));var querystring=require(_0xabe4('0xe'));var Papa=require(_0xabe4('0xf'));var Redis=require('ioredis');var authService=require(_0xabe4('0x10'));var qs=require(_0xabe4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabe4('0x12'));var logger=require(_0xabe4('0x13'))(_0xabe4('0x14'));var utils=require(_0xabe4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xabe4('0x16'))['db'];function respondWithStatusCode(_0x5a97c8,_0x2eaac2){_0x2eaac2=_0x2eaac2||0xcc;return function(_0x4a6c92){if(_0x4a6c92){return _0x5a97c8['sendStatus'](_0x2eaac2);}return _0x5a97c8[_0xabe4('0x17')](_0x2eaac2)['end']();};}function respondWithResult(_0x42a930,_0x48a1ee){_0x48a1ee=_0x48a1ee||0xc8;return function(_0x136a36){if(_0x136a36){return _0x42a930[_0xabe4('0x17')](_0x48a1ee)[_0xabe4('0x18')](_0x136a36);}};}function respondWithFilteredResult(_0x12250f,_0x751083){return function(_0x382b14){if(_0x382b14){var _0x1d637a=typeof _0x751083['offset']===_0xabe4('0x19')&&typeof _0x751083['limit']===_0xabe4('0x19');var _0x274575=_0x382b14[_0xabe4('0x1a')];var _0x84da34=_0x1d637a?0x0:_0x751083[_0xabe4('0x1b')];var _0x5f4e1b=_0x1d637a?_0x382b14['count']:_0x751083[_0xabe4('0x1b')]+_0x751083[_0xabe4('0x1c')];var _0x2cfebe;if(_0x5f4e1b>=_0x274575){_0x5f4e1b=_0x274575;_0x2cfebe=0xc8;}else{_0x2cfebe=0xce;}_0x12250f['status'](_0x2cfebe);return _0x12250f[_0xabe4('0x1d')](_0xabe4('0x1e'),_0x84da34+'-'+_0x5f4e1b+'/'+_0x274575)[_0xabe4('0x18')](_0x382b14);}return null;};}function patchUpdates(_0x472c7d){return function(_0x498850){try{jsonpatch[_0xabe4('0x1f')](_0x498850,_0x472c7d,!![]);}catch(_0x1dd181){return BPromise[_0xabe4('0x20')](_0x1dd181);}return _0x498850[_0xabe4('0x21')]();};}function saveUpdates(_0x247f66,_0x56d261){return function(_0x15fda2){if(_0x15fda2){return _0x15fda2[_0xabe4('0x22')](_0x247f66)[_0xabe4('0x23')](function(_0x1c3c51){return _0x1c3c51;});}return null;};}function removeEntity(_0x42b314,_0x3a4e6b){return function(_0x14466b){if(_0x14466b){return _0x14466b[_0xabe4('0x24')]()['then'](function(){var _0x3ff3fc=_0x14466b[_0xabe4('0x25')]({'plain':!![]});var _0x1305b5='ODBC';return db[_0xabe4('0x26')][_0xabe4('0x24')]({'where':{'type':_0x1305b5,'resourceId':_0x3ff3fc['id']}})[_0xabe4('0x23')](function(){return _0x14466b;});})['then'](function(){_0x42b314[_0xabe4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc47336,_0x4d49ea){return function(_0x5e4df1){if(!_0x5e4df1){_0xc47336[_0xabe4('0x27')](0x194);}return _0x5e4df1;};}function handleError(_0x445c1b,_0x2f36c1){_0x2f36c1=_0x2f36c1||0x1f4;return function(_0x19e2c8){logger['error'](_0x19e2c8[_0xabe4('0x28')]);if(_0x19e2c8[_0xabe4('0x29')]){delete _0x19e2c8['name'];}_0x445c1b['status'](_0x2f36c1)[_0xabe4('0x2a')](_0x19e2c8);};}exports[_0xabe4('0x2b')]=function(_0x1ac88d,_0x4f96ec){var _0x2adf85={},_0x28ba7f={},_0x29f4c4={'count':0x0,'rows':[]};var _0x418312=_[_0xabe4('0x2c')](db['SquareOdbc'][_0xabe4('0x2d')],function(_0x59f3c1){return{'name':_0x59f3c1[_0xabe4('0x2e')],'type':_0x59f3c1[_0xabe4('0x2f')][_0xabe4('0x30')]};});_0x28ba7f[_0xabe4('0x31')]=_[_0xabe4('0x2c')](_0x418312,_0xabe4('0x29'));_0x28ba7f['query']=_['keys'](_0x1ac88d[_0xabe4('0x32')]);_0x28ba7f['filters']=_[_0xabe4('0x33')](_0x28ba7f[_0xabe4('0x31')],_0x28ba7f[_0xabe4('0x32')]);_0x2adf85['attributes']=_[_0xabe4('0x33')](_0x28ba7f[_0xabe4('0x31')],qs['fields'](_0x1ac88d[_0xabe4('0x32')]['fields']));_0x2adf85['attributes']=_0x2adf85['attributes'][_0xabe4('0x34')]?_0x2adf85['attributes']:_0x28ba7f[_0xabe4('0x31')];if(!_0x1ac88d[_0xabe4('0x32')]['hasOwnProperty'](_0xabe4('0x35'))){_0x2adf85['limit']=qs['limit'](_0x1ac88d[_0xabe4('0x32')][_0xabe4('0x1c')]);_0x2adf85['offset']=qs[_0xabe4('0x1b')](_0x1ac88d[_0xabe4('0x32')][_0xabe4('0x1b')]);}_0x2adf85['order']=qs[_0xabe4('0x36')](_0x1ac88d[_0xabe4('0x32')][_0xabe4('0x36')]);_0x2adf85[_0xabe4('0x37')]=qs[_0xabe4('0x38')](_[_0xabe4('0x39')](_0x1ac88d['query'],_0x28ba7f[_0xabe4('0x38')]),_0x418312);if(_0x1ac88d[_0xabe4('0x32')][_0xabe4('0x3a')]){_0x2adf85[_0xabe4('0x37')]=_['merge'](_0x2adf85[_0xabe4('0x37')],{'$or':_['map'](_0x418312,function(_0xef77f0){if(_0xef77f0[_0xabe4('0x2f')]!==_0xabe4('0x3b')){var _0x211ca9={};_0x211ca9[_0xef77f0[_0xabe4('0x29')]]={'$like':'%'+_0x1ac88d[_0xabe4('0x32')]['filter']+'%'};return _0x211ca9;}})});}_0x2adf85=_['merge']({},_0x2adf85,_0x1ac88d[_0xabe4('0x3c')]);var _0x1eba83={'where':_0x2adf85[_0xabe4('0x37')]};return db[_0xabe4('0x3d')][_0xabe4('0x1a')](_0x1eba83)['then'](function(_0x7b0d99){_0x29f4c4[_0xabe4('0x1a')]=_0x7b0d99;if(_0x1ac88d[_0xabe4('0x32')][_0xabe4('0x3e')]){_0x2adf85[_0xabe4('0x3f')]=[{'all':!![]}];}return db[_0xabe4('0x3d')][_0xabe4('0x40')](_0x2adf85);})['then'](function(_0x4dac4c){_0x29f4c4['rows']=_0x4dac4c;return _0x29f4c4;})['then'](respondWithFilteredResult(_0x4f96ec,_0x2adf85))[_0xabe4('0x41')](handleError(_0x4f96ec,null));};exports[_0xabe4('0x42')]=function(_0xe675e6,_0x1f6397){var _0x3a2b26={'raw':!![],'where':{'id':_0xe675e6[_0xabe4('0x43')]['id']}},_0x10abb2={};_0x10abb2[_0xabe4('0x31')]=_[_0xabe4('0x44')](db[_0xabe4('0x3d')]['rawAttributes']);_0x10abb2[_0xabe4('0x32')]=_[_0xabe4('0x44')](_0xe675e6[_0xabe4('0x32')]);_0x10abb2[_0xabe4('0x38')]=_[_0xabe4('0x33')](_0x10abb2[_0xabe4('0x31')],_0x10abb2[_0xabe4('0x32')]);_0x3a2b26[_0xabe4('0x45')]=_[_0xabe4('0x33')](_0x10abb2['model'],qs['fields'](_0xe675e6[_0xabe4('0x32')][_0xabe4('0x46')]));_0x3a2b26[_0xabe4('0x45')]=_0x3a2b26['attributes'][_0xabe4('0x34')]?_0x3a2b26[_0xabe4('0x45')]:_0x10abb2[_0xabe4('0x31')];if(_0xe675e6[_0xabe4('0x32')][_0xabe4('0x3e')]){_0x3a2b26[_0xabe4('0x3f')]=[{'all':!![]}];}_0x3a2b26=_[_0xabe4('0x47')]({},_0x3a2b26,_0xe675e6[_0xabe4('0x3c')]);return db['SquareOdbc'][_0xabe4('0x48')](_0x3a2b26)[_0xabe4('0x23')](handleEntityNotFound(_0x1f6397,null))[_0xabe4('0x23')](respondWithResult(_0x1f6397,null))[_0xabe4('0x41')](handleError(_0x1f6397,null));};exports[_0xabe4('0x49')]=function(_0x3ae8bc,_0x3a858b){return db[_0xabe4('0x3d')][_0xabe4('0x49')](_0x3ae8bc['body'],{})[_0xabe4('0x23')](function(_0x22de39){var _0x3b945b=_0x3ae8bc[_0xabe4('0x4a')][_0xabe4('0x25')]({'plain':!![]});if(!_0x3b945b)throw new Error(_0xabe4('0x4b'));if(_0x3b945b['role']===_0xabe4('0x4a')){var _0x1ca82b=_0x22de39[_0xabe4('0x25')]({'plain':!![]});var _0x411807=_0xabe4('0x4c');return db[_0xabe4('0x4d')]['find']({'where':{'name':_0x411807,'userProfileId':_0x3b945b[_0xabe4('0x4e')]},'raw':!![]})[_0xabe4('0x23')](function(_0x448543){if(_0x448543&&_0x448543[_0xabe4('0x4f')]===0x0){return db[_0xabe4('0x26')][_0xabe4('0x49')]({'name':_0x1ca82b[_0xabe4('0x29')],'resourceId':_0x1ca82b['id'],'type':_0x448543['name'],'sectionId':_0x448543['id']},{})[_0xabe4('0x23')](function(){return _0x22de39;});}else{return _0x22de39;}})[_0xabe4('0x41')](function(_0x2f699d){logger[_0xabe4('0x50')](_0xabe4('0x51'),_0x2f699d);throw _0x2f699d;});}return _0x22de39;})[_0xabe4('0x23')](respondWithResult(_0x3a858b,0xc9))[_0xabe4('0x41')](handleError(_0x3a858b,null));};exports[_0xabe4('0x22')]=function(_0x5b190c,_0x290a7b){if(_0x5b190c[_0xabe4('0x52')]['id']){delete _0x5b190c[_0xabe4('0x52')]['id'];}return db['SquareOdbc'][_0xabe4('0x48')]({'where':{'id':_0x5b190c[_0xabe4('0x43')]['id']}})['then'](handleEntityNotFound(_0x290a7b,null))[_0xabe4('0x23')](saveUpdates(_0x5b190c[_0xabe4('0x52')],null))[_0xabe4('0x23')](respondWithResult(_0x290a7b,null))[_0xabe4('0x41')](handleError(_0x290a7b,null));};exports[_0xabe4('0x24')]=function(_0x2dddf3,_0x517a90){return db['SquareOdbc'][_0xabe4('0x48')]({'where':{'id':_0x2dddf3[_0xabe4('0x43')]['id']}})[_0xabe4('0x23')](handleEntityNotFound(_0x517a90,null))['then'](removeEntity(_0x517a90,null))[_0xabe4('0x41')](handleError(_0x517a90,null));};exports[_0xabe4('0x53')]=function(_0x3f09ab,_0x5bafb2,_0x3e936e){var _0x1b90da;return db[_0xabe4('0x3d')]['find']({'where':{'id':_0x3f09ab['params']['id']},'attributes':['id',_0xabe4('0x54')]})[_0xabe4('0x23')](handleEntityNotFound(_0x5bafb2,null))['then'](function(_0x49f16b){if(_0x49f16b){var _0xa7925d=require('odbc')();_0xa7925d['openSync'](_0x49f16b[_0xabe4('0x54')]);_0xa7925d['closeSync']();return _0x49f16b;}})[_0xabe4('0x23')](respondWithResult(_0x5bafb2,null))[_0xabe4('0x41')](handleError(_0x5bafb2,null));}; \ No newline at end of file +var _0x444d=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4e7af4,_0x758572){var _0x2548f1=function(_0xa849c){while(--_0xa849c){_0x4e7af4['push'](_0x4e7af4['shift']());}};_0x2548f1(++_0x758572);}(_0x444d,0x19b));var _0xd444=function(_0x4a318f,_0x29da2e){_0x4a318f=_0x4a318f-0x0;var _0x43088b=_0x444d[_0x4a318f];return _0x43088b;};'use strict';var emlformat=require(_0xd444('0x0'));var rimraf=require(_0xd444('0x1'));var zipdir=require(_0xd444('0x2'));var jsonpatch=require(_0xd444('0x3'));var rp=require(_0xd444('0x4'));var moment=require('moment');var BPromise=require(_0xd444('0x5'));var Mustache=require('mustache');var util=require(_0xd444('0x6'));var path=require(_0xd444('0x7'));var sox=require(_0xd444('0x8'));var csv=require(_0xd444('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd444('0xa'));var _=require(_0xd444('0xb'));var squel=require('squel');var crypto=require(_0xd444('0xc'));var jsforce=require(_0xd444('0xd'));var deskjs=require(_0xd444('0xe'));var toCsv=require(_0xd444('0x9'));var querystring=require(_0xd444('0xf'));var Papa=require(_0xd444('0x10'));var Redis=require(_0xd444('0x11'));var authService=require(_0xd444('0x12'));var qs=require(_0xd444('0x13'));var as=require(_0xd444('0x14'));var hardwareService=require(_0xd444('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xd444('0x16'));var config=require(_0xd444('0x17'));var licenseUtil=require(_0xd444('0x18'));var db=require(_0xd444('0x19'))['db'];function respondWithStatusCode(_0x4e5b30,_0x451f35){_0x451f35=_0x451f35||0xcc;return function(_0x542cbb){if(_0x542cbb){return _0x4e5b30[_0xd444('0x1a')](_0x451f35);}return _0x4e5b30[_0xd444('0x1b')](_0x451f35)[_0xd444('0x1c')]();};}function respondWithResult(_0x3f52db,_0x31d0f0){_0x31d0f0=_0x31d0f0||0xc8;return function(_0x559683){if(_0x559683){return _0x3f52db[_0xd444('0x1b')](_0x31d0f0)[_0xd444('0x1d')](_0x559683);}};}function respondWithFilteredResult(_0x14d7fa,_0x5ef95c){return function(_0x5de40c){if(_0x5de40c){var _0x55411c=typeof _0x5ef95c[_0xd444('0x1e')]===_0xd444('0x1f')&&typeof _0x5ef95c[_0xd444('0x20')]===_0xd444('0x1f');var _0x353915=_0x5de40c[_0xd444('0x21')];var _0x13b223=_0x55411c?0x0:_0x5ef95c[_0xd444('0x1e')];var _0x2c99f3=_0x55411c?_0x5de40c[_0xd444('0x21')]:_0x5ef95c[_0xd444('0x1e')]+_0x5ef95c['limit'];var _0x11070b;if(_0x2c99f3>=_0x353915){_0x2c99f3=_0x353915;_0x11070b=0xc8;}else{_0x11070b=0xce;}_0x14d7fa['status'](_0x11070b);return _0x14d7fa[_0xd444('0x22')](_0xd444('0x23'),_0x13b223+'-'+_0x2c99f3+'/'+_0x353915)[_0xd444('0x1d')](_0x5de40c);}return null;};}function patchUpdates(_0x4d5dec){return function(_0xb4440d){try{jsonpatch['apply'](_0xb4440d,_0x4d5dec,!![]);}catch(_0x1c3925){return BPromise[_0xd444('0x24')](_0x1c3925);}return _0xb4440d['save']();};}function saveUpdates(_0x45cdb0,_0x2b985e){return function(_0x1118d0){if(_0x1118d0){return _0x1118d0[_0xd444('0x25')](_0x45cdb0)[_0xd444('0x26')](function(_0x4f104a){return _0x4f104a;});}return null;};}function removeEntity(_0x3ec8d9,_0x2660c8){return function(_0x478705){if(_0x478705){return _0x478705[_0xd444('0x27')]()['then'](function(){var _0x498e05=_0x478705[_0xd444('0x28')]({'plain':!![]});var _0x5a379e=_0xd444('0x29');return db[_0xd444('0x2a')][_0xd444('0x27')]({'where':{'type':_0x5a379e,'resourceId':_0x498e05['id']}})['then'](function(){return _0x478705;});})[_0xd444('0x26')](function(){_0x3ec8d9[_0xd444('0x1b')](0xcc)[_0xd444('0x1c')]();});}};}function handleEntityNotFound(_0x56a70e,_0x573550){return function(_0x212b53){if(!_0x212b53){_0x56a70e[_0xd444('0x1a')](0x194);}return _0x212b53;};}function handleError(_0x589c6b,_0x2f090a){_0x2f090a=_0x2f090a||0x1f4;return function(_0x4638de){logger[_0xd444('0x2b')](_0x4638de[_0xd444('0x2c')]);if(_0x4638de[_0xd444('0x2d')]){delete _0x4638de[_0xd444('0x2d')];}_0x589c6b['status'](_0x2f090a)[_0xd444('0x2e')](_0x4638de);};}exports[_0xd444('0x2f')]=function(_0x126aee,_0x18defe){var _0xb9c262={},_0x3caa7a={},_0x2d7dfd={'count':0x0,'rows':[]};var _0x43cd9a=_[_0xd444('0x30')](db[_0xd444('0x31')][_0xd444('0x32')],function(_0x374875){return{'name':_0x374875['fieldName'],'type':_0x374875[_0xd444('0x33')]['key']};});_0x3caa7a[_0xd444('0x34')]=_['map'](_0x43cd9a,_0xd444('0x2d'));_0x3caa7a[_0xd444('0x35')]=_[_0xd444('0x36')](_0x126aee['query']);_0x3caa7a[_0xd444('0x37')]=_[_0xd444('0x38')](_0x3caa7a[_0xd444('0x34')],_0x3caa7a['query']);_0xb9c262['attributes']=_[_0xd444('0x38')](_0x3caa7a['model'],qs[_0xd444('0x39')](_0x126aee[_0xd444('0x35')][_0xd444('0x39')]));_0xb9c262[_0xd444('0x3a')]=_0xb9c262[_0xd444('0x3a')][_0xd444('0x3b')]?_0xb9c262[_0xd444('0x3a')]:_0x3caa7a[_0xd444('0x34')];if(!_0x126aee['query'][_0xd444('0x3c')]('nolimit')){_0xb9c262[_0xd444('0x20')]=qs[_0xd444('0x20')](_0x126aee[_0xd444('0x35')][_0xd444('0x20')]);_0xb9c262['offset']=qs['offset'](_0x126aee[_0xd444('0x35')]['offset']);}_0xb9c262[_0xd444('0x3d')]=qs[_0xd444('0x3e')](_0x126aee[_0xd444('0x35')]['sort']);_0xb9c262['where']=qs[_0xd444('0x37')](_[_0xd444('0x3f')](_0x126aee[_0xd444('0x35')],_0x3caa7a[_0xd444('0x37')]),_0x43cd9a);if(_0x126aee[_0xd444('0x35')][_0xd444('0x40')]){_0xb9c262[_0xd444('0x41')]=_[_0xd444('0x42')](_0xb9c262[_0xd444('0x41')],{'$or':_[_0xd444('0x30')](_0x43cd9a,function(_0x11f157){if(_0x11f157[_0xd444('0x33')]!=='VIRTUAL'){var _0x498dc9={};_0x498dc9[_0x11f157[_0xd444('0x2d')]]={'$like':'%'+_0x126aee[_0xd444('0x35')]['filter']+'%'};return _0x498dc9;}})});}_0xb9c262=_[_0xd444('0x42')]({},_0xb9c262,_0x126aee['options']);var _0x23160f={'where':_0xb9c262['where']};return db[_0xd444('0x31')]['count'](_0x23160f)[_0xd444('0x26')](function(_0x2b9d1d){_0x2d7dfd[_0xd444('0x21')]=_0x2b9d1d;if(_0x126aee[_0xd444('0x35')][_0xd444('0x43')]){_0xb9c262[_0xd444('0x44')]=[{'all':!![]}];}return db[_0xd444('0x31')][_0xd444('0x45')](_0xb9c262);})[_0xd444('0x26')](function(_0x37e734){_0x2d7dfd[_0xd444('0x46')]=_0x37e734;return _0x2d7dfd;})[_0xd444('0x26')](respondWithFilteredResult(_0x18defe,_0xb9c262))['catch'](handleError(_0x18defe,null));};exports[_0xd444('0x47')]=function(_0x5e3f78,_0x1180e9){var _0x535d4b={'raw':!![],'where':{'id':_0x5e3f78[_0xd444('0x48')]['id']}},_0x32ce52={};_0x32ce52[_0xd444('0x34')]=_[_0xd444('0x36')](db[_0xd444('0x31')][_0xd444('0x32')]);_0x32ce52[_0xd444('0x35')]=_['keys'](_0x5e3f78['query']);_0x32ce52['filters']=_[_0xd444('0x38')](_0x32ce52[_0xd444('0x34')],_0x32ce52[_0xd444('0x35')]);_0x535d4b['attributes']=_[_0xd444('0x38')](_0x32ce52[_0xd444('0x34')],qs['fields'](_0x5e3f78[_0xd444('0x35')][_0xd444('0x39')]));_0x535d4b[_0xd444('0x3a')]=_0x535d4b[_0xd444('0x3a')]['length']?_0x535d4b[_0xd444('0x3a')]:_0x32ce52[_0xd444('0x34')];if(_0x5e3f78[_0xd444('0x35')][_0xd444('0x43')]){_0x535d4b[_0xd444('0x44')]=[{'all':!![]}];}_0x535d4b=_[_0xd444('0x42')]({},_0x535d4b,_0x5e3f78[_0xd444('0x49')]);return db[_0xd444('0x31')][_0xd444('0x4a')](_0x535d4b)[_0xd444('0x26')](handleEntityNotFound(_0x1180e9,null))[_0xd444('0x26')](respondWithResult(_0x1180e9,null))[_0xd444('0x4b')](handleError(_0x1180e9,null));};exports[_0xd444('0x4c')]=function(_0x39bb92,_0x3b79a5){return db[_0xd444('0x31')][_0xd444('0x4c')](_0x39bb92[_0xd444('0x4d')],{})[_0xd444('0x26')](function(_0x4f7d54){var _0x1c6b0c=_0x39bb92[_0xd444('0x4e')][_0xd444('0x28')]({'plain':!![]});if(!_0x1c6b0c)throw new Error(_0xd444('0x4f'));if(_0x1c6b0c[_0xd444('0x50')]==='user'){var _0x5674f6=_0x4f7d54[_0xd444('0x28')]({'plain':!![]});var _0x8096b0=_0xd444('0x29');return db['UserProfileSection'][_0xd444('0x4a')]({'where':{'name':_0x8096b0,'userProfileId':_0x1c6b0c[_0xd444('0x51')]},'raw':!![]})[_0xd444('0x26')](function(_0x5e9706){if(_0x5e9706&&_0x5e9706['autoAssociation']===0x0){return db['UserProfileResource'][_0xd444('0x4c')]({'name':_0x5674f6['name'],'resourceId':_0x5674f6['id'],'type':_0x5e9706[_0xd444('0x2d')],'sectionId':_0x5e9706['id']},{})['then'](function(){return _0x4f7d54;});}else{return _0x4f7d54;}})[_0xd444('0x4b')](function(_0x252ec8){logger['error'](_0xd444('0x52'),_0x252ec8);throw _0x252ec8;});}return _0x4f7d54;})[_0xd444('0x26')](respondWithResult(_0x3b79a5,0xc9))[_0xd444('0x4b')](handleError(_0x3b79a5,null));};exports[_0xd444('0x25')]=function(_0x5206b8,_0x43e07d){if(_0x5206b8['body']['id']){delete _0x5206b8[_0xd444('0x4d')]['id'];}return db[_0xd444('0x31')][_0xd444('0x4a')]({'where':{'id':_0x5206b8[_0xd444('0x48')]['id']}})[_0xd444('0x26')](handleEntityNotFound(_0x43e07d,null))[_0xd444('0x26')](saveUpdates(_0x5206b8['body'],null))[_0xd444('0x26')](respondWithResult(_0x43e07d,null))[_0xd444('0x4b')](handleError(_0x43e07d,null));};exports[_0xd444('0x27')]=function(_0x31a6ca,_0x3cbbd0){return db[_0xd444('0x31')][_0xd444('0x4a')]({'where':{'id':_0x31a6ca[_0xd444('0x48')]['id']}})[_0xd444('0x26')](handleEntityNotFound(_0x3cbbd0,null))[_0xd444('0x26')](removeEntity(_0x3cbbd0,null))[_0xd444('0x4b')](handleError(_0x3cbbd0,null));};exports['test']=function(_0x5d83ca,_0x3ae3c6,_0x578a99){var _0x44d155;return db[_0xd444('0x31')][_0xd444('0x4a')]({'where':{'id':_0x5d83ca[_0xd444('0x48')]['id']},'attributes':['id',_0xd444('0x53')]})[_0xd444('0x26')](handleEntityNotFound(_0x3ae3c6,null))[_0xd444('0x26')](function(_0x3569f6){if(_0x3569f6){var _0x557de9=require(_0xd444('0x54'))();_0x557de9[_0xd444('0x55')](_0x3569f6[_0xd444('0x53')]);_0x557de9[_0xd444('0x56')]();return _0x3569f6;}})[_0xd444('0x26')](respondWithResult(_0x3ae3c6,null))[_0xd444('0x4b')](handleError(_0x3ae3c6,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 86508d8..6476bb1 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 _0x6689=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','lodash','util','../../config/logger','api'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0x6689,0x146));var _0x9668=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6689[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9668('0x0'));var util=require(_0x9668('0x1'));var logger=require(_0x9668('0x2'))(_0x9668('0x3'));var moment=require(_0x9668('0x4'));var BPromise=require(_0x9668('0x5'));var rp=require(_0x9668('0x6'));var fs=require('fs');var path=require(_0x9668('0x7'));var rimraf=require(_0x9668('0x8'));var config=require(_0x9668('0x9'));var attributes=require(_0x9668('0xa'));module['exports']=function(_0x349833,_0x4f0572){return _0x349833['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae20=['exports','define','square_odbc','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xae20,0x1ed));var _0x0ae2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xae20[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0ae2('0x0'));var util=require(_0x0ae2('0x1'));var logger=require(_0x0ae2('0x2'))('api');var moment=require(_0x0ae2('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ae2('0x4'));var fs=require('fs');var path=require(_0x0ae2('0x5'));var rimraf=require(_0x0ae2('0x6'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x0ae2('0x7')]=function(_0x17cafa,_0x3567c2){return _0x17cafa[_0x0ae2('0x8')]('SquareOdbc',attributes,{'tableName':_0x0ae2('0x9'),'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 07b7283..f07799b 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 _0xce0f=['catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','map','model','include','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result'];(function(_0x18d8fd,_0x1e86d1){var _0x1c7ba7=function(_0x2690e7){while(--_0x2690e7){_0x18d8fd['push'](_0x18d8fd['shift']());}};_0x1c7ba7(++_0x1e86d1);}(_0xce0f,0x15f));var _0xfce0=function(_0x8e8e6a,_0x5080ea){_0x8e8e6a=_0x8e8e6a-0x0;var _0x2a6d8a=_0xce0f[_0x8e8e6a];return _0x2a6d8a;};'use strict';var _=require(_0xfce0('0x0'));var util=require(_0xfce0('0x1'));var moment=require(_0xfce0('0x2'));var BPromise=require('bluebird');var rs=require(_0xfce0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfce0('0x4'))['db'];var utils=require(_0xfce0('0x5'));var logger=require(_0xfce0('0x6'))(_0xfce0('0x7'));var config=require(_0xfce0('0x8'));var jayson=require(_0xfce0('0x9'));var client=jayson[_0xfce0('0xa')][_0xfce0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x286a01,_0x131714,_0x2ff7e4){return new BPromise(function(_0x1ae9e3,_0x2477b9){return client[_0xfce0('0xc')](_0x286a01,_0x2ff7e4)[_0xfce0('0xd')](function(_0x570ff3){logger[_0xfce0('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x131714,_0xfce0('0xf'));logger['debug'](_0xfce0('0x10'),_0x131714,'request\x20sent',JSON[_0xfce0('0x11')](_0x570ff3));if(_0x570ff3[_0xfce0('0x12')]){if(_0x570ff3['error'][_0xfce0('0x13')]===0x1f4){logger[_0xfce0('0x12')](_0xfce0('0x14'),_0x131714,_0x570ff3[_0xfce0('0x12')][_0xfce0('0x15')]);return _0x2477b9(_0x570ff3[_0xfce0('0x12')]['message']);}logger[_0xfce0('0x12')](_0xfce0('0x14'),_0x131714,_0x570ff3[_0xfce0('0x12')][_0xfce0('0x15')]);return _0x1ae9e3(_0x570ff3[_0xfce0('0x12')]['message']);}else{logger['info'](_0xfce0('0x14'),_0x131714,'request\x20sent');_0x1ae9e3(_0x570ff3[_0xfce0('0x16')]['message']);}})[_0xfce0('0x17')](function(_0x1fb181){logger[_0xfce0('0x12')](_0xfce0('0x14'),_0x131714,_0x1fb181);_0x2477b9(_0x1fb181);});});}exports[_0xfce0('0x18')]=function(_0x359147){var _0x588215=this;return new Promise(function(_0x272954,_0x8e8cee){return db[_0xfce0('0x19')]['find']({'raw':_0x359147[_0xfce0('0x1a')]?_0x359147[_0xfce0('0x1a')][_0xfce0('0x1b')]===undefined?!![]:![]:!![],'where':_0x359147[_0xfce0('0x1a')]?_0x359147[_0xfce0('0x1a')][_0xfce0('0x1c')]||null:null,'attributes':_0x359147['options']?_0x359147[_0xfce0('0x1a')][_0xfce0('0x1d')]||null:null,'include':_0x359147['options']?_0x359147[_0xfce0('0x1a')]['include']?_[_0xfce0('0x1e')](_0x359147[_0xfce0('0x1a')]['include'],function(_0x4642d0){return{'model':db[_0x4642d0[_0xfce0('0x1f')]],'as':_0x4642d0['as'],'attributes':_0x4642d0[_0xfce0('0x1d')],'include':_0x4642d0[_0xfce0('0x20')]?_[_0xfce0('0x1e')](_0x4642d0['include'],function(_0x3714f2){return{'model':db[_0x3714f2['model']],'as':_0x3714f2['as'],'attributes':_0x3714f2['attributes'],'include':_0x3714f2[_0xfce0('0x20')]?_[_0xfce0('0x1e')](_0x3714f2['include'],function(_0x437e98){return{'model':db[_0x437e98[_0xfce0('0x1f')]],'as':_0x437e98['as'],'attributes':_0x437e98[_0xfce0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfce0('0xd')](function(_0x1cefa3){logger[_0xfce0('0xe')]('ShowSquareOdbc',_0x359147);logger[_0xfce0('0x21')](_0xfce0('0x18'),_0x359147,JSON['stringify'](_0x1cefa3));_0x272954(_0x1cefa3);})['catch'](function(_0x316504){logger[_0xfce0('0x12')]('ShowSquareOdbc',_0x316504[_0xfce0('0x15')],_0x359147);_0x8e8cee(_0x588215['error'](0x1f4,_0x316504[_0xfce0('0x15')]));});});}; \ No newline at end of file +var _0x76bb=['message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','model','map','debug','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4fcbd2,_0x42b88c){var _0x596ed3=function(_0x466fc){while(--_0x466fc){_0x4fcbd2['push'](_0x4fcbd2['shift']());}};_0x596ed3(++_0x42b88c);}(_0x76bb,0xb8));var _0xb76b=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x76bb[_0xe51596];return _0x22c705;};'use strict';var _=require('lodash');var util=require(_0xb76b('0x0'));var moment=require(_0xb76b('0x1'));var BPromise=require(_0xb76b('0x2'));var rs=require(_0xb76b('0x3'));var fs=require('fs');var Redis=require(_0xb76b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb76b('0x5'));var logger=require(_0xb76b('0x6'))(_0xb76b('0x7'));var config=require(_0xb76b('0x8'));var jayson=require(_0xb76b('0x9'));var client=jayson[_0xb76b('0xa')][_0xb76b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35f53f,_0x58a49c,_0x24b9cd){return new BPromise(function(_0x309b9b,_0xf9067c){return client[_0xb76b('0xc')](_0x35f53f,_0x24b9cd)['then'](function(_0x203404){logger[_0xb76b('0xd')](_0xb76b('0xe'),_0x58a49c,'request\x20sent');logger['debug'](_0xb76b('0xf'),_0x58a49c,_0xb76b('0x10'),JSON[_0xb76b('0x11')](_0x203404));if(_0x203404[_0xb76b('0x12')]){if(_0x203404[_0xb76b('0x12')][_0xb76b('0x13')]===0x1f4){logger[_0xb76b('0x12')](_0xb76b('0xe'),_0x58a49c,_0x203404[_0xb76b('0x12')][_0xb76b('0x14')]);return _0xf9067c(_0x203404[_0xb76b('0x12')][_0xb76b('0x14')]);}logger[_0xb76b('0x12')](_0xb76b('0xe'),_0x58a49c,_0x203404[_0xb76b('0x12')]['message']);return _0x309b9b(_0x203404[_0xb76b('0x12')][_0xb76b('0x14')]);}else{logger[_0xb76b('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x58a49c,'request\x20sent');_0x309b9b(_0x203404[_0xb76b('0x15')][_0xb76b('0x14')]);}})['catch'](function(_0x4a69da){logger[_0xb76b('0x12')](_0xb76b('0xe'),_0x58a49c,_0x4a69da);_0xf9067c(_0x4a69da);});});}exports[_0xb76b('0x16')]=function(_0x4d6a33){var _0x1bfb28=this;return new Promise(function(_0x34001e,_0x5a9e6d){return db[_0xb76b('0x17')][_0xb76b('0x18')]({'raw':_0x4d6a33[_0xb76b('0x19')]?_0x4d6a33[_0xb76b('0x19')][_0xb76b('0x1a')]===undefined?!![]:![]:!![],'where':_0x4d6a33['options']?_0x4d6a33[_0xb76b('0x19')][_0xb76b('0x1b')]||null:null,'attributes':_0x4d6a33[_0xb76b('0x19')]?_0x4d6a33[_0xb76b('0x19')][_0xb76b('0x1c')]||null:null,'include':_0x4d6a33[_0xb76b('0x19')]?_0x4d6a33['options'][_0xb76b('0x1d')]?_['map'](_0x4d6a33[_0xb76b('0x19')][_0xb76b('0x1d')],function(_0x13f087){return{'model':db[_0x13f087[_0xb76b('0x1e')]],'as':_0x13f087['as'],'attributes':_0x13f087[_0xb76b('0x1c')],'include':_0x13f087[_0xb76b('0x1d')]?_['map'](_0x13f087[_0xb76b('0x1d')],function(_0x3aa765){return{'model':db[_0x3aa765[_0xb76b('0x1e')]],'as':_0x3aa765['as'],'attributes':_0x3aa765[_0xb76b('0x1c')],'include':_0x3aa765[_0xb76b('0x1d')]?_[_0xb76b('0x1f')](_0x3aa765[_0xb76b('0x1d')],function(_0x1de803){return{'model':db[_0x1de803[_0xb76b('0x1e')]],'as':_0x1de803['as'],'attributes':_0x1de803[_0xb76b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5574ed){logger[_0xb76b('0xd')](_0xb76b('0x16'),_0x4d6a33);logger[_0xb76b('0x20')]('ShowSquareOdbc',_0x4d6a33,JSON[_0xb76b('0x11')](_0x5574ed));_0x34001e(_0x5574ed);})[_0xb76b('0x21')](function(_0x49eacc){logger[_0xb76b('0x12')]('ShowSquareOdbc',_0x49eacc['message'],_0x4d6a33);_0x5a9e6d(_0x1bfb28[_0xb76b('0x12')](0x1f4,_0x49eacc[_0xb76b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3c9de4f..aaa8b6f 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 _0xac7b=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports','multer','util','path'];(function(_0x1265cc,_0x17de77){var _0x49edb6=function(_0x51f635){while(--_0x51f635){_0x1265cc['push'](_0x1265cc['shift']());}};_0x49edb6(++_0x17de77);}(_0xac7b,0x1b2));var _0xbac7=function(_0x3931c1,_0x106bf4){_0x3931c1=_0x3931c1-0x0;var _0xf126a7=_0xac7b[_0x3931c1];return _0xf126a7;};'use strict';var multer=require(_0xbac7('0x0'));var util=require(_0xbac7('0x1'));var path=require(_0xbac7('0x2'));var timeout=require(_0xbac7('0x3'));var express=require(_0xbac7('0x4'));var router=express[_0xbac7('0x5')]();var fs_extra=require(_0xbac7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbac7('0x7'));var config=require(_0xbac7('0x8'));var controller=require('./squareProject.controller');router[_0xbac7('0x9')]('/',auth['isAuthenticated'](),controller[_0xbac7('0xa')]);router[_0xbac7('0x9')](_0xbac7('0xb'),auth[_0xbac7('0xc')](),controller[_0xbac7('0xd')]);router['post']('/',auth[_0xbac7('0xc')](),controller[_0xbac7('0xe')]);router[_0xbac7('0xf')](_0xbac7('0xb'),auth[_0xbac7('0xc')](),controller['update']);router[_0xbac7('0x10')](_0xbac7('0xb'),auth[_0xbac7('0xc')](),controller[_0xbac7('0x11')]);module[_0xbac7('0x12')]=router; \ No newline at end of file +var _0x79ef=['put','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post'];(function(_0x35c1db,_0xd75c15){var _0x4173ff=function(_0x5d6901){while(--_0x5d6901){_0x35c1db['push'](_0x35c1db['shift']());}};_0x4173ff(++_0xd75c15);}(_0x79ef,0xd1));var _0xf79e=function(_0x6d0143,_0x3d7c30){_0x6d0143=_0x6d0143-0x0;var _0x29cb75=_0x79ef[_0x6d0143];return _0x29cb75;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf79e('0x0'));var timeout=require(_0xf79e('0x1'));var express=require(_0xf79e('0x2'));var router=express[_0xf79e('0x3')]();var fs_extra=require(_0xf79e('0x4'));var auth=require(_0xf79e('0x5'));var interaction=require(_0xf79e('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xf79e('0x7')]('/',auth[_0xf79e('0x8')](),controller[_0xf79e('0x9')]);router['get']('/:id',auth[_0xf79e('0x8')](),controller[_0xf79e('0xa')]);router[_0xf79e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf79e('0xc')](_0xf79e('0xd'),auth[_0xf79e('0x8')](),controller[_0xf79e('0xe')]);router[_0xf79e('0xf')](_0xf79e('0xd'),auth[_0xf79e('0x8')](),controller['destroy']);module[_0xf79e('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2e8411d..a65224b 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 _0x8cc2=['utf8','getDataValue','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','preproduction','toString'];(function(_0x597aac,_0x1b0246){var _0x369dde=function(_0x51df3d){while(--_0x51df3d){_0x597aac['push'](_0x597aac['shift']());}};_0x369dde(++_0x1b0246);}(_0x8cc2,0x1d8));var _0x28cc=function(_0x336230,_0x3f330b){_0x336230=_0x336230-0x0;var _0x566b22=_0x8cc2[_0x336230];return _0x566b22;};'use strict';var Sequelize=require(_0x28cc('0x0'));module[_0x28cc('0x1')]={'name':{'type':Sequelize[_0x28cc('0x2')],'unique':_0x28cc('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x28cc('0x2')]},'notes':{'type':Sequelize[_0x28cc('0x4')]},'preproduction':{'type':Sequelize[_0x28cc('0x5')](_0x28cc('0x6')),'get':function(){if(this['getDataValue'](_0x28cc('0x7'))){return this['getDataValue'](_0x28cc('0x7'))[_0x28cc('0x8')](_0x28cc('0x9'));}}},'production':{'type':Sequelize[_0x28cc('0x5')](_0x28cc('0x6')),'get':function(){if(this[_0x28cc('0xa')](_0x28cc('0xb'))){return this['getDataValue']('production')['toString'](_0x28cc('0x9'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x28cc('0xc')]}}; \ No newline at end of file +var _0xa2a5=['production','DATE','sequelize','exports','STRING','name','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long'];(function(_0x2a3b4d,_0x151237){var _0x3b875d=function(_0x3e39a4){while(--_0x3e39a4){_0x2a3b4d['push'](_0x2a3b4d['shift']());}};_0x3b875d(++_0x151237);}(_0xa2a5,0x84));var _0x5a2a=function(_0x4f2730,_0x371cb2){_0x4f2730=_0x4f2730-0x0;var _0x1a0970=_0xa2a5[_0x4f2730];return _0x1a0970;};'use strict';var Sequelize=require(_0x5a2a('0x0'));module[_0x5a2a('0x1')]={'name':{'type':Sequelize[_0x5a2a('0x2')],'unique':_0x5a2a('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5a2a('0x2')]},'notes':{'type':Sequelize[_0x5a2a('0x4')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x5a2a('0x5')](_0x5a2a('0x6'))){return this[_0x5a2a('0x5')](_0x5a2a('0x6'))[_0x5a2a('0x7')](_0x5a2a('0x8'));}}},'production':{'type':Sequelize[_0x5a2a('0x9')](_0x5a2a('0xa')),'get':function(){if(this['getDataValue'](_0x5a2a('0xb'))){return this['getDataValue']('production')[_0x5a2a('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x5a2a('0xc')]},'publishedAt':{'type':Sequelize[_0x5a2a('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 63c61bf..ab04005 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 _0xe9f4=['stringify','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','SquareProject','includeAll','include','findAll','catch','params','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','publish','agi','production','lodash','ioredis','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./squareProject.socket','register','json','offset','undefined','limit','count','status','set','update','then','get','SquareProjects','UserProfileResource','destroy'];(function(_0x16d96d,_0x50e6b2){var _0x94a79a=function(_0x19489e){while(--_0x19489e){_0x16d96d['push'](_0x16d96d['shift']());}};_0x94a79a(++_0x50e6b2);}(_0xe9f4,0xb5));var _0x4e9f=function(_0x3bfc36,_0x1fea3c){_0x3bfc36=_0x3bfc36-0x0;var _0x39b3c2=_0xe9f4[_0x3bfc36];return _0x39b3c2;};'use strict';var _=require(_0x4e9f('0x0'));var Redis=require(_0x4e9f('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x4e9f('0x2'));var config=require(_0x4e9f('0x3'));var db=require(_0x4e9f('0x4'))['db'];config['redis']=_[_0x4e9f('0x5')](config[_0x4e9f('0x6')],{'host':_0x4e9f('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e9f('0x6')]));require(_0x4e9f('0x8'))[_0x4e9f('0x9')](socket);function respondWithResult(_0x1644d1,_0x2a3ab5){_0x2a3ab5=_0x2a3ab5||0xc8;return function(_0xdb2468){if(_0xdb2468){return _0x1644d1['status'](_0x2a3ab5)[_0x4e9f('0xa')](_0xdb2468);}};}function respondWithFilteredResult(_0x26e7d4,_0x2397f9){return function(_0x5dda2f){if(_0x5dda2f){var _0x20dce9=typeof _0x2397f9[_0x4e9f('0xb')]===_0x4e9f('0xc')&&typeof _0x2397f9[_0x4e9f('0xd')]===_0x4e9f('0xc');var _0x1a6a22=_0x5dda2f[_0x4e9f('0xe')];var _0x358583=_0x20dce9?0x0:_0x2397f9['offset'];var _0xed7617=_0x20dce9?_0x5dda2f[_0x4e9f('0xe')]:_0x2397f9[_0x4e9f('0xb')]+_0x2397f9['limit'];var _0x296a2b;if(_0xed7617>=_0x1a6a22){_0xed7617=_0x1a6a22;_0x296a2b=0xc8;}else{_0x296a2b=0xce;}_0x26e7d4[_0x4e9f('0xf')](_0x296a2b);return _0x26e7d4[_0x4e9f('0x10')]('Content-Range',_0x358583+'-'+_0xed7617+'/'+_0x1a6a22)[_0x4e9f('0xa')](_0x5dda2f);}return null;};}function saveUpdates(_0x223664){return function(_0x40f980){if(_0x40f980){return _0x40f980[_0x4e9f('0x11')](_0x223664)[_0x4e9f('0x12')](function(_0x3bd013){return _0x3bd013;});}return null;};}function removeEntity(_0x5d41f2){return function(_0x4d53d0){if(_0x4d53d0){return _0x4d53d0['destroy']()['then'](function(){var _0x946538=_0x4d53d0[_0x4e9f('0x13')]({'plain':!![]});var _0x54a7f6=_0x4e9f('0x14');return db[_0x4e9f('0x15')][_0x4e9f('0x16')]({'where':{'type':_0x54a7f6,'resourceId':_0x946538['id']}})[_0x4e9f('0x12')](function(){return _0x4d53d0;});})['then'](function(){var _0x356393=new Redis(config['redis']);_0x356393['publish']('agi',JSON[_0x4e9f('0x17')]({'id':_0x4d53d0['id'],'deleted':!![]}));})['then'](function(){_0x5d41f2[_0x4e9f('0xf')](0xcc)[_0x4e9f('0x18')]();});}};}function handleEntityNotFound(_0x3f03c6){return function(_0x7fb621){if(!_0x7fb621){_0x3f03c6[_0x4e9f('0x19')](0x194);}return _0x7fb621;};}function handleError(_0x4843d3,_0x14db44){_0x14db44=_0x14db44||0x1f4;return function(_0x2c278c){logger[_0x4e9f('0x1a')](_0x2c278c[_0x4e9f('0x1b')]);if(_0x2c278c[_0x4e9f('0x1c')]){delete _0x2c278c[_0x4e9f('0x1c')];}_0x4843d3[_0x4e9f('0xf')](_0x14db44)[_0x4e9f('0x1d')](_0x2c278c);};}exports[_0x4e9f('0x1e')]=function(_0x4adfe8,_0x15d3e3){var _0x5aa405={},_0x167115={},_0x37ba68={'count':0x0,'rows':[]};var _0x386f9d=_[_0x4e9f('0x1f')](db['SquareProject'][_0x4e9f('0x20')],function(_0x49099d){return{'name':_0x49099d[_0x4e9f('0x21')],'type':_0x49099d['type']['key']};});_0x167115[_0x4e9f('0x22')]=_['map'](_0x386f9d,'name');_0x167115[_0x4e9f('0x23')]=_[_0x4e9f('0x24')](_0x4adfe8['query']);_0x167115[_0x4e9f('0x25')]=_[_0x4e9f('0x26')](_0x167115[_0x4e9f('0x22')],_0x167115[_0x4e9f('0x23')]);_0x5aa405[_0x4e9f('0x27')]=_['intersection'](_0x167115['model'],qs[_0x4e9f('0x28')](_0x4adfe8['query'][_0x4e9f('0x28')]));_0x5aa405['attributes']=_0x5aa405[_0x4e9f('0x27')]['length']?_0x5aa405[_0x4e9f('0x27')]:_0x167115[_0x4e9f('0x22')];if(!_0x4adfe8['query'][_0x4e9f('0x29')](_0x4e9f('0x2a'))){_0x5aa405[_0x4e9f('0xd')]=qs[_0x4e9f('0xd')](_0x4adfe8[_0x4e9f('0x23')][_0x4e9f('0xd')]);_0x5aa405[_0x4e9f('0xb')]=qs[_0x4e9f('0xb')](_0x4adfe8[_0x4e9f('0x23')][_0x4e9f('0xb')]);}_0x5aa405[_0x4e9f('0x2b')]=qs['sort'](_0x4adfe8[_0x4e9f('0x23')]['sort']);_0x5aa405[_0x4e9f('0x2c')]=qs[_0x4e9f('0x25')](_[_0x4e9f('0x2d')](_0x4adfe8[_0x4e9f('0x23')],_0x167115[_0x4e9f('0x25')]),_0x386f9d);if(_0x4adfe8['query']['filter']){_0x5aa405[_0x4e9f('0x2c')]=_['merge'](_0x5aa405['where'],{'$or':_[_0x4e9f('0x1f')](_0x386f9d,function(_0x29c9c5){if(_0x29c9c5[_0x4e9f('0x2e')]!==_0x4e9f('0x2f')){var _0x924254={};_0x924254[_0x29c9c5[_0x4e9f('0x1c')]]={'$like':'%'+_0x4adfe8[_0x4e9f('0x23')][_0x4e9f('0x30')]+'%'};return _0x924254;}})});}_0x5aa405=_[_0x4e9f('0x31')]({},_0x5aa405,_0x4adfe8['options']);var _0x5d80dd={'where':_0x5aa405[_0x4e9f('0x2c')]};return db[_0x4e9f('0x32')][_0x4e9f('0xe')](_0x5d80dd)['then'](function(_0x3fe581){_0x37ba68[_0x4e9f('0xe')]=_0x3fe581;if(_0x4adfe8[_0x4e9f('0x23')][_0x4e9f('0x33')]){_0x5aa405[_0x4e9f('0x34')]=[{'all':!![]}];}return db['SquareProject'][_0x4e9f('0x35')](_0x5aa405);})['then'](function(_0xcc7503){_0x37ba68['rows']=_0xcc7503;return _0x37ba68;})[_0x4e9f('0x12')](respondWithFilteredResult(_0x15d3e3,_0x5aa405))[_0x4e9f('0x36')](handleError(_0x15d3e3,null));};exports['show']=function(_0x3e94ea,_0x3c2aa3){var _0x45507b={'raw':![],'where':{'id':_0x3e94ea[_0x4e9f('0x37')]['id']}},_0x2a415c={};_0x2a415c[_0x4e9f('0x22')]=_['keys'](db[_0x4e9f('0x32')][_0x4e9f('0x20')]);_0x2a415c[_0x4e9f('0x23')]=_[_0x4e9f('0x24')](_0x3e94ea[_0x4e9f('0x23')]);_0x2a415c[_0x4e9f('0x25')]=_[_0x4e9f('0x26')](_0x2a415c[_0x4e9f('0x22')],_0x2a415c[_0x4e9f('0x23')]);_0x45507b[_0x4e9f('0x27')]=_[_0x4e9f('0x26')](_0x2a415c[_0x4e9f('0x22')],qs[_0x4e9f('0x28')](_0x3e94ea[_0x4e9f('0x23')][_0x4e9f('0x28')]));_0x45507b[_0x4e9f('0x27')]=_0x45507b['attributes']['length']?_0x45507b['attributes']:_0x2a415c[_0x4e9f('0x22')];if(_0x3e94ea[_0x4e9f('0x23')][_0x4e9f('0x33')]){_0x45507b[_0x4e9f('0x34')]=[{'all':!![]}];}_0x45507b=_[_0x4e9f('0x31')]({},_0x45507b,_0x3e94ea[_0x4e9f('0x38')]);return db[_0x4e9f('0x32')][_0x4e9f('0x39')](_0x45507b)[_0x4e9f('0x12')](handleEntityNotFound(_0x3c2aa3,null))[_0x4e9f('0x12')](respondWithResult(_0x3c2aa3,null))['catch'](handleError(_0x3c2aa3,null));};exports[_0x4e9f('0x3a')]=function(_0x1fc863,_0x495787){return db['SquareProject'][_0x4e9f('0x3a')](_0x1fc863['body'],{})[_0x4e9f('0x12')](function(_0x5d5e57){var _0x272e0c=_0x1fc863[_0x4e9f('0x3b')][_0x4e9f('0x13')]({'plain':!![]});if(!_0x272e0c)throw new Error(_0x4e9f('0x3c'));if(_0x272e0c['role']==='user'){var _0x3b5351=_0x5d5e57['get']({'plain':!![]});var _0x5757b7='SquareProjects';return db[_0x4e9f('0x3d')][_0x4e9f('0x39')]({'where':{'name':_0x5757b7,'userProfileId':_0x272e0c[_0x4e9f('0x3e')]},'raw':!![]})['then'](function(_0x480f77){if(_0x480f77&&_0x480f77['autoAssociation']===0x0){return db[_0x4e9f('0x15')][_0x4e9f('0x3a')]({'name':_0x3b5351['name'],'resourceId':_0x3b5351['id'],'type':_0x480f77[_0x4e9f('0x1c')],'sectionId':_0x480f77['id']},{})[_0x4e9f('0x12')](function(){return _0x5d5e57;});}else{return _0x5d5e57;}})[_0x4e9f('0x36')](function(_0x52d0e3){logger[_0x4e9f('0x1a')](_0x4e9f('0x3f'),_0x52d0e3);throw _0x52d0e3;});}return _0x5d5e57;})[_0x4e9f('0x12')](respondWithResult(_0x495787,0xc9))[_0x4e9f('0x36')](handleError(_0x495787,null));};exports['update']=function(_0x483db4,_0x12dcc9){if(_0x483db4[_0x4e9f('0x40')]['id']){delete _0x483db4[_0x4e9f('0x40')]['id'];}return db[_0x4e9f('0x32')][_0x4e9f('0x39')]({'where':{'id':_0x483db4[_0x4e9f('0x37')]['id']}})['then'](handleEntityNotFound(_0x12dcc9,null))[_0x4e9f('0x12')](saveUpdates(_0x483db4[_0x4e9f('0x40')],null))[_0x4e9f('0x12')](function(_0x257afb){if(!_0x257afb)return;var _0x396a1e=_0x257afb[_0x4e9f('0x13')]({'plain':!![]});return _0x396a1e;})['then'](function(_0x335f7f){var _0x235965=new Redis(config[_0x4e9f('0x6')]);_0x235965[_0x4e9f('0x41')](_0x4e9f('0x42'),JSON[_0x4e9f('0x17')](_[_0x4e9f('0x2d')](_0x335f7f,['id',_0x4e9f('0x1c'),_0x4e9f('0x43')])));return _0x335f7f;})['then'](respondWithResult(_0x12dcc9,null))[_0x4e9f('0x36')](handleError(_0x12dcc9,null));};exports[_0x4e9f('0x16')]=function(_0x3978e6,_0x1aa772){return db[_0x4e9f('0x32')][_0x4e9f('0x39')]({'where':{'id':_0x3978e6[_0x4e9f('0x37')]['id']}})[_0x4e9f('0x12')](handleEntityNotFound(_0x1aa772,null))[_0x4e9f('0x12')](removeEntity(_0x1aa772,null))[_0x4e9f('0x36')](handleError(_0x1aa772,null));}; \ No newline at end of file +var _0xbfea=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','agi','stringify','production','lodash','ioredis','../../components/parsers/qs','../../mysqldb','redis','defaults','localhost','./squareProject.socket','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','SquareProjects','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','map','SquareProject','fieldName','type','key','query','filters','intersection','model','fields','length','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','keys','options','find','create'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xbfea,0xe2));var _0xabfe=function(_0x123c72,_0x5673c7){_0x123c72=_0x123c72-0x0;var _0x37c905=_0xbfea[_0x123c72];return _0x37c905;};'use strict';var _=require(_0xabfe('0x0'));var Redis=require(_0xabfe('0x1'));var qs=require(_0xabfe('0x2'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xabfe('0x3'))['db'];config[_0xabfe('0x4')]=_[_0xabfe('0x5')](config['redis'],{'host':_0xabfe('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xabfe('0x7'))['register'](socket);function respondWithResult(_0xc900a5,_0x37acb6){_0x37acb6=_0x37acb6||0xc8;return function(_0x1c8ccc){if(_0x1c8ccc){return _0xc900a5[_0xabfe('0x8')](_0x37acb6)['json'](_0x1c8ccc);}};}function respondWithFilteredResult(_0x5ed9a5,_0xc7a306){return function(_0xf2ab5b){if(_0xf2ab5b){var _0x3546d7=typeof _0xc7a306[_0xabfe('0x9')]===_0xabfe('0xa')&&typeof _0xc7a306[_0xabfe('0xb')]===_0xabfe('0xa');var _0x509998=_0xf2ab5b['count'];var _0x3e96ca=_0x3546d7?0x0:_0xc7a306[_0xabfe('0x9')];var _0x532d6e=_0x3546d7?_0xf2ab5b[_0xabfe('0xc')]:_0xc7a306[_0xabfe('0x9')]+_0xc7a306[_0xabfe('0xb')];var _0x580677;if(_0x532d6e>=_0x509998){_0x532d6e=_0x509998;_0x580677=0xc8;}else{_0x580677=0xce;}_0x5ed9a5[_0xabfe('0x8')](_0x580677);return _0x5ed9a5[_0xabfe('0xd')](_0xabfe('0xe'),_0x3e96ca+'-'+_0x532d6e+'/'+_0x509998)[_0xabfe('0xf')](_0xf2ab5b);}return null;};}function saveUpdates(_0x4483db){return function(_0x11ccd0){if(_0x11ccd0){return _0x11ccd0[_0xabfe('0x10')](_0x4483db)['then'](function(_0x1a01fa){return _0x1a01fa;});}return null;};}function removeEntity(_0xbd193c){return function(_0x3edfcf){if(_0x3edfcf){return _0x3edfcf[_0xabfe('0x11')]()['then'](function(){var _0x44cb99=_0x3edfcf['get']({'plain':!![]});var _0xd1da6e=_0xabfe('0x12');return db[_0xabfe('0x13')][_0xabfe('0x11')]({'where':{'type':_0xd1da6e,'resourceId':_0x44cb99['id']}})['then'](function(){return _0x3edfcf;});})[_0xabfe('0x14')](function(){var _0x5c4915=new Redis(config[_0xabfe('0x4')]);_0x5c4915['publish']('agi',JSON['stringify']({'id':_0x3edfcf['id'],'deleted':!![]}));})[_0xabfe('0x14')](function(){_0xbd193c[_0xabfe('0x8')](0xcc)[_0xabfe('0x15')]();});}};}function handleEntityNotFound(_0x38b54a){return function(_0x1d9b13){if(!_0x1d9b13){_0x38b54a[_0xabfe('0x16')](0x194);}return _0x1d9b13;};}function handleError(_0x24936a,_0x3affcb){_0x3affcb=_0x3affcb||0x1f4;return function(_0x235114){logger[_0xabfe('0x17')](_0x235114[_0xabfe('0x18')]);if(_0x235114[_0xabfe('0x19')]){delete _0x235114[_0xabfe('0x19')];}_0x24936a[_0xabfe('0x8')](_0x3affcb)[_0xabfe('0x1a')](_0x235114);};}exports[_0xabfe('0x1b')]=function(_0x4c98cf,_0x293be6){var _0x181657={},_0x396984={},_0x5b3b71={'count':0x0,'rows':[]};var _0xedfdc6=_[_0xabfe('0x1c')](db[_0xabfe('0x1d')]['rawAttributes'],function(_0x2e3264){return{'name':_0x2e3264[_0xabfe('0x1e')],'type':_0x2e3264[_0xabfe('0x1f')][_0xabfe('0x20')]};});_0x396984['model']=_['map'](_0xedfdc6,_0xabfe('0x19'));_0x396984[_0xabfe('0x21')]=_['keys'](_0x4c98cf[_0xabfe('0x21')]);_0x396984[_0xabfe('0x22')]=_[_0xabfe('0x23')](_0x396984[_0xabfe('0x24')],_0x396984['query']);_0x181657['attributes']=_[_0xabfe('0x23')](_0x396984['model'],qs['fields'](_0x4c98cf[_0xabfe('0x21')][_0xabfe('0x25')]));_0x181657['attributes']=_0x181657['attributes'][_0xabfe('0x26')]?_0x181657[_0xabfe('0x27')]:_0x396984[_0xabfe('0x24')];if(!_0x4c98cf[_0xabfe('0x21')]['hasOwnProperty'](_0xabfe('0x28'))){_0x181657[_0xabfe('0xb')]=qs['limit'](_0x4c98cf[_0xabfe('0x21')]['limit']);_0x181657['offset']=qs[_0xabfe('0x9')](_0x4c98cf[_0xabfe('0x21')][_0xabfe('0x9')]);}_0x181657[_0xabfe('0x29')]=qs[_0xabfe('0x2a')](_0x4c98cf[_0xabfe('0x21')][_0xabfe('0x2a')]);_0x181657[_0xabfe('0x2b')]=qs[_0xabfe('0x22')](_[_0xabfe('0x2c')](_0x4c98cf[_0xabfe('0x21')],_0x396984[_0xabfe('0x22')]),_0xedfdc6);if(_0x4c98cf[_0xabfe('0x21')][_0xabfe('0x2d')]){_0x181657['where']=_[_0xabfe('0x2e')](_0x181657[_0xabfe('0x2b')],{'$or':_[_0xabfe('0x1c')](_0xedfdc6,function(_0x378c7c){if(_0x378c7c[_0xabfe('0x1f')]!==_0xabfe('0x2f')){var _0x27ba2d={};_0x27ba2d[_0x378c7c[_0xabfe('0x19')]]={'$like':'%'+_0x4c98cf['query'][_0xabfe('0x2d')]+'%'};return _0x27ba2d;}})});}_0x181657=_['merge']({},_0x181657,_0x4c98cf['options']);var _0xeca04d={'where':_0x181657[_0xabfe('0x2b')]};return db['SquareProject'][_0xabfe('0xc')](_0xeca04d)[_0xabfe('0x14')](function(_0x19d16d){_0x5b3b71['count']=_0x19d16d;if(_0x4c98cf[_0xabfe('0x21')][_0xabfe('0x30')]){_0x181657[_0xabfe('0x31')]=[{'all':!![]}];}return db['SquareProject'][_0xabfe('0x32')](_0x181657);})['then'](function(_0x558837){_0x5b3b71[_0xabfe('0x33')]=_0x558837;return _0x5b3b71;})[_0xabfe('0x14')](respondWithFilteredResult(_0x293be6,_0x181657))[_0xabfe('0x34')](handleError(_0x293be6,null));};exports['show']=function(_0x2cdf19,_0x35a642){var _0x2ee5cc={'raw':![],'where':{'id':_0x2cdf19['params']['id']}},_0x5d90e8={};_0x5d90e8[_0xabfe('0x24')]=_['keys'](db[_0xabfe('0x1d')][_0xabfe('0x35')]);_0x5d90e8[_0xabfe('0x21')]=_[_0xabfe('0x36')](_0x2cdf19[_0xabfe('0x21')]);_0x5d90e8['filters']=_[_0xabfe('0x23')](_0x5d90e8[_0xabfe('0x24')],_0x5d90e8[_0xabfe('0x21')]);_0x2ee5cc[_0xabfe('0x27')]=_[_0xabfe('0x23')](_0x5d90e8[_0xabfe('0x24')],qs[_0xabfe('0x25')](_0x2cdf19[_0xabfe('0x21')][_0xabfe('0x25')]));_0x2ee5cc['attributes']=_0x2ee5cc[_0xabfe('0x27')]['length']?_0x2ee5cc['attributes']:_0x5d90e8[_0xabfe('0x24')];if(_0x2cdf19[_0xabfe('0x21')][_0xabfe('0x30')]){_0x2ee5cc[_0xabfe('0x31')]=[{'all':!![]}];}_0x2ee5cc=_[_0xabfe('0x2e')]({},_0x2ee5cc,_0x2cdf19[_0xabfe('0x37')]);return db['SquareProject'][_0xabfe('0x38')](_0x2ee5cc)[_0xabfe('0x14')](handleEntityNotFound(_0x35a642,null))[_0xabfe('0x14')](respondWithResult(_0x35a642,null))[_0xabfe('0x34')](handleError(_0x35a642,null));};exports[_0xabfe('0x39')]=function(_0x48ea47,_0x199dcf){return db[_0xabfe('0x1d')]['create'](_0x48ea47['body'],{})[_0xabfe('0x14')](function(_0x499ce4){var _0x358dbf=_0x48ea47[_0xabfe('0x3a')][_0xabfe('0x3b')]({'plain':!![]});if(!_0x358dbf)throw new Error(_0xabfe('0x3c'));if(_0x358dbf[_0xabfe('0x3d')]===_0xabfe('0x3a')){var _0x49b0f5=_0x499ce4['get']({'plain':!![]});var _0x512119=_0xabfe('0x12');return db[_0xabfe('0x3e')][_0xabfe('0x38')]({'where':{'name':_0x512119,'userProfileId':_0x358dbf[_0xabfe('0x3f')]},'raw':!![]})[_0xabfe('0x14')](function(_0x4bb023){if(_0x4bb023&&_0x4bb023[_0xabfe('0x40')]===0x0){return db['UserProfileResource'][_0xabfe('0x39')]({'name':_0x49b0f5[_0xabfe('0x19')],'resourceId':_0x49b0f5['id'],'type':_0x4bb023[_0xabfe('0x19')],'sectionId':_0x4bb023['id']},{})[_0xabfe('0x14')](function(){return _0x499ce4;});}else{return _0x499ce4;}})['catch'](function(_0x509f3b){logger['error'](_0xabfe('0x41'),_0x509f3b);throw _0x509f3b;});}return _0x499ce4;})['then'](respondWithResult(_0x199dcf,0xc9))[_0xabfe('0x34')](handleError(_0x199dcf,null));};exports[_0xabfe('0x10')]=function(_0x57c1c6,_0x2279e9){if(_0x57c1c6['body']['id']){delete _0x57c1c6['body']['id'];}return db['SquareProject'][_0xabfe('0x38')]({'where':{'id':_0x57c1c6[_0xabfe('0x42')]['id']}})[_0xabfe('0x14')](handleEntityNotFound(_0x2279e9,null))[_0xabfe('0x14')](saveUpdates(_0x57c1c6[_0xabfe('0x43')],null))[_0xabfe('0x14')](function(_0xcc8351){if(!_0xcc8351)return;var _0x356c2a=_0xcc8351['get']({'plain':!![]});return _0x356c2a;})[_0xabfe('0x14')](function(_0x99255a){var _0x463007=new Redis(config[_0xabfe('0x4')]);_0x463007['publish'](_0xabfe('0x44'),JSON[_0xabfe('0x45')](_[_0xabfe('0x2c')](_0x99255a,['id',_0xabfe('0x19'),_0xabfe('0x46')])));return _0x99255a;})[_0xabfe('0x14')](respondWithResult(_0x2279e9,null))['catch'](handleError(_0x2279e9,null));};exports[_0xabfe('0x11')]=function(_0x37e0f2,_0x58de36){return db[_0xabfe('0x1d')][_0xabfe('0x38')]({'where':{'id':_0x37e0f2['params']['id']}})[_0xabfe('0x14')](handleEntityNotFound(_0x58de36,null))[_0xabfe('0x14')](removeEntity(_0x58de36,null))['catch'](handleError(_0x58de36,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 005824c..b0ef813 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 _0x7850=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x46126a,_0x1224fa){var _0xbf348e=function(_0x3ca237){while(--_0x3ca237){_0x46126a['push'](_0x46126a['shift']());}};_0xbf348e(++_0x1224fa);}(_0x7850,0xb6));var _0x0785=function(_0x4e7ae6,_0x5087ab){_0x4e7ae6=_0x4e7ae6-0x0;var _0x3471bf=_0x7850[_0x4e7ae6];return _0x3471bf;};'use strict';var EventEmitter=require(_0x0785('0x0'));var SquareProject=require(_0x0785('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0785('0x2')](0x0);var events={'afterCreate':_0x0785('0x3'),'afterUpdate':_0x0785('0x4'),'afterDestroy':_0x0785('0x5')};function emitEvent(_0x180a77){return function(_0x40b0c3,_0x49244d,_0x4618b8){SquareProjectEvents[_0x0785('0x6')](_0x180a77+':'+_0x40b0c3['id'],_0x40b0c3);SquareProjectEvents[_0x0785('0x6')](_0x180a77,_0x40b0c3);_0x4618b8(null);};}for(var e in events){if(events[_0x0785('0x7')](e)){var event=events[e];SquareProject[_0x0785('0x8')](e,emitEvent(event));}}module[_0x0785('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x45c7=['../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2601b4,_0x315e78){var _0x3e3661=function(_0x13b45b){while(--_0x13b45b){_0x2601b4['push'](_0x2601b4['shift']());}};_0x3e3661(++_0x315e78);}(_0x45c7,0xfc));var _0x745c=function(_0x394620,_0x504d6c){_0x394620=_0x394620-0x0;var _0x1e8f8e=_0x45c7[_0x394620];return _0x1e8f8e;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x745c('0x0'))['db'][_0x745c('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x745c('0x2')](0x0);var events={'afterCreate':_0x745c('0x3'),'afterUpdate':_0x745c('0x4'),'afterDestroy':_0x745c('0x5')};function emitEvent(_0x21ad67){return function(_0x464658,_0x564c03,_0x3c4442){SquareProjectEvents[_0x745c('0x6')](_0x21ad67+':'+_0x464658['id'],_0x464658);SquareProjectEvents[_0x745c('0x6')](_0x21ad67,_0x464658);_0x3c4442(null);};}for(var e in events){if(events[_0x745c('0x7')](e)){var event=events[e];SquareProject[_0x745c('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 5141b40..d2defe7 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 _0xbc78=['square_projects','preproduction','savedAt','format','changed','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports'];(function(_0x3ddfe4,_0x1f3abb){var _0x2ea9c5=function(_0x3d5ced){while(--_0x3d5ced){_0x3ddfe4['push'](_0x3ddfe4['shift']());}};_0x2ea9c5(++_0x1f3abb);}(_0xbc78,0x1ed));var _0x8bc7=function(_0x111642,_0x5265fb){_0x111642=_0x111642-0x0;var _0x36441e=_0xbc78[_0x111642];return _0x36441e;};'use strict';var _=require('lodash');var util=require(_0x8bc7('0x0'));var logger=require(_0x8bc7('0x1'))(_0x8bc7('0x2'));var moment=require(_0x8bc7('0x3'));var BPromise=require(_0x8bc7('0x4'));var rp=require(_0x8bc7('0x5'));var fs=require('fs');var path=require(_0x8bc7('0x6'));var rimraf=require(_0x8bc7('0x7'));var config=require(_0x8bc7('0x8'));var attributes=require(_0x8bc7('0x9'));module[_0x8bc7('0xa')]=function(_0x194df0,_0x54b43c){return _0x194df0['define']('SquareProject',attributes,{'tableName':_0x8bc7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2eb086,_0x20f9f0,_0x3fc840){if(_0x2eb086['changed'](_0x8bc7('0xc'))){_0x2eb086[_0x8bc7('0xd')]=moment()[_0x8bc7('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2eb086[_0x8bc7('0xf')]('production')){_0x2eb086[_0x8bc7('0x10')]=moment()[_0x8bc7('0xe')](_0x8bc7('0x11'));}_0x3fc840(null,_0x2eb086);}}});}; \ No newline at end of file +var _0x8897=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','moment','bluebird'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0x8897,0x14f));var _0x7889=function(_0x5a6883,_0x581b45){_0x5a6883=_0x5a6883-0x0;var _0x2b9d42=_0x8897[_0x5a6883];return _0x2b9d42;};'use strict';var _=require('lodash');var util=require(_0x7889('0x0'));var logger=require(_0x7889('0x1'))(_0x7889('0x2'));var moment=require(_0x7889('0x3'));var BPromise=require(_0x7889('0x4'));var rp=require(_0x7889('0x5'));var fs=require('fs');var path=require(_0x7889('0x6'));var rimraf=require(_0x7889('0x7'));var config=require(_0x7889('0x8'));var attributes=require(_0x7889('0x9'));module[_0x7889('0xa')]=function(_0x25fe87,_0x13e890){return _0x25fe87[_0x7889('0xb')](_0x7889('0xc'),attributes,{'tableName':_0x7889('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f5c86,_0x499946,_0x2a539e){if(_0x2f5c86['changed'](_0x7889('0xe'))){_0x2f5c86[_0x7889('0xf')]=moment()[_0x7889('0x10')](_0x7889('0x11'));}if(_0x2f5c86['changed'](_0x7889('0x12'))){_0x2f5c86[_0x7889('0x13')]=moment()['format'](_0x7889('0x11'));}_0x2a539e(null,_0x2f5c86);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 0b89a40..990b7e9 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 _0x5c07=['map','model','then','info','debug','stringify','catch','message','error','ShowSquareProject','find','ioredis','../../mysqldb','../../config/logger','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include'];(function(_0x7e2bd9,_0x3cf3d5){var _0x3ddb95=function(_0x4d73a5){while(--_0x4d73a5){_0x7e2bd9['push'](_0x7e2bd9['shift']());}};_0x3ddb95(++_0x3cf3d5);}(_0x5c07,0x1e7));var _0x75c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c07[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Redis=require(_0x75c0('0x0'));var db=require(_0x75c0('0x1'))['db'];var logger=require(_0x75c0('0x2'))('rpc');var config=require('../../config/environment');config[_0x75c0('0x3')]=_['defaults'](config['redis'],{'host':_0x75c0('0x4'),'port':0x18eb});var socket=require(_0x75c0('0x5'))(new Redis(config[_0x75c0('0x3')]));require(_0x75c0('0x6'))[_0x75c0('0x7')](socket);exports[_0x75c0('0x8')]=function(_0x47633b){var _0x32c604=this;return new Promise(function(_0x184f37,_0x58c3a6){return db[_0x75c0('0x9')][_0x75c0('0xa')]({'raw':_0x47633b[_0x75c0('0xb')]?_0x47633b['options'][_0x75c0('0xc')]===undefined?!![]:![]:!![],'where':_0x47633b[_0x75c0('0xb')]?_0x47633b[_0x75c0('0xb')][_0x75c0('0xd')]||null:null,'attributes':_0x47633b['options']?_0x47633b['options'][_0x75c0('0xe')]||null:null,'limit':_0x47633b[_0x75c0('0xb')]?_0x47633b[_0x75c0('0xb')][_0x75c0('0xf')]||null:null,'include':_0x47633b[_0x75c0('0xb')]?_0x47633b[_0x75c0('0xb')][_0x75c0('0x10')]?_[_0x75c0('0x11')](_0x47633b['options'][_0x75c0('0x10')],function(_0x1411d7){return{'model':db[_0x1411d7[_0x75c0('0x12')]],'as':_0x1411d7['as'],'attributes':_0x1411d7[_0x75c0('0xe')],'include':_0x1411d7[_0x75c0('0x10')]?_[_0x75c0('0x11')](_0x1411d7[_0x75c0('0x10')],function(_0x207074){return{'model':db[_0x207074[_0x75c0('0x12')]],'as':_0x207074['as'],'attributes':_0x207074[_0x75c0('0xe')],'include':_0x207074[_0x75c0('0x10')]?_[_0x75c0('0x11')](_0x207074['include'],function(_0x2ef4e4){return{'model':db[_0x2ef4e4[_0x75c0('0x12')]],'as':_0x2ef4e4['as'],'attributes':_0x2ef4e4[_0x75c0('0xe')]};}):[]};}):[]};}):[]:[]})[_0x75c0('0x13')](function(_0x1d9421){logger[_0x75c0('0x14')](_0x75c0('0x8'),_0x47633b);logger[_0x75c0('0x15')](_0x75c0('0x8'),_0x47633b,JSON[_0x75c0('0x16')](_0x1d9421));_0x184f37(_0x1d9421);})[_0x75c0('0x17')](function(_0x593516){logger['error'](_0x75c0('0x8'),_0x593516[_0x75c0('0x18')],_0x47633b);_0x58c3a6(_0x32c604[_0x75c0('0x19')](0x1f4,_0x593516[_0x75c0('0x18')]));});});};exports[_0x75c0('0x1a')]=function(_0x288835){var _0x4e8a22=this;return new Promise(function(_0x2ed579,_0x248f76){return db[_0x75c0('0x9')][_0x75c0('0x1b')]({'raw':_0x288835[_0x75c0('0xb')]?_0x288835[_0x75c0('0xb')][_0x75c0('0xc')]===undefined?!![]:![]:!![],'where':_0x288835[_0x75c0('0xb')]?_0x288835[_0x75c0('0xb')][_0x75c0('0xd')]||null:null,'attributes':_0x288835[_0x75c0('0xb')]?_0x288835['options']['attributes']||null:null,'include':_0x288835['options']?_0x288835[_0x75c0('0xb')]['include']?_['map'](_0x288835[_0x75c0('0xb')][_0x75c0('0x10')],function(_0x285f88){return{'model':db[_0x285f88[_0x75c0('0x12')]],'as':_0x285f88['as'],'attributes':_0x285f88[_0x75c0('0xe')],'include':_0x285f88[_0x75c0('0x10')]?_['map'](_0x285f88[_0x75c0('0x10')],function(_0x14fa4f){return{'model':db[_0x14fa4f[_0x75c0('0x12')]],'as':_0x14fa4f['as'],'attributes':_0x14fa4f[_0x75c0('0xe')],'include':_0x14fa4f[_0x75c0('0x10')]?_[_0x75c0('0x11')](_0x14fa4f[_0x75c0('0x10')],function(_0x50045b){return{'model':db[_0x50045b[_0x75c0('0x12')]],'as':_0x50045b['as'],'attributes':_0x50045b[_0x75c0('0xe')]};}):[]};}):[]};}):[]:[]})[_0x75c0('0x13')](function(_0x457240){logger[_0x75c0('0x14')]('ShowSquareProject',_0x288835);logger[_0x75c0('0x15')]('ShowSquareProject',_0x288835,JSON[_0x75c0('0x16')](_0x457240));_0x2ed579(_0x457240);})['catch'](function(_0x13fe73){logger[_0x75c0('0x19')]('ShowSquareProject',_0x13fe73[_0x75c0('0x18')],_0x288835);_0x248f76(_0x4e8a22[_0x75c0('0x19')](0x1f4,_0x13fe73[_0x75c0('0x18')]));});});}; \ No newline at end of file +var _0xdf4f=['debug','lodash','../../mysqldb','../../config/logger','rpc','redis','defaults','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','where','attributes','include','map','model','then','info','stringify','catch','message','error','ShowSquareProject','find','raw'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xdf4f,0x11f));var _0xfdf4=function(_0x43247a,_0x5e881b){_0x43247a=_0x43247a-0x0;var _0x2fbc7b=_0xdf4f[_0x43247a];return _0x2fbc7b;};'use strict';var _=require(_0xfdf4('0x0'));var Redis=require('ioredis');var db=require(_0xfdf4('0x1'))['db'];var logger=require(_0xfdf4('0x2'))(_0xfdf4('0x3'));var config=require('../../config/environment');config[_0xfdf4('0x4')]=_[_0xfdf4('0x5')](config[_0xfdf4('0x4')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdf4('0x4')]));require(_0xfdf4('0x6'))['register'](socket);exports[_0xfdf4('0x7')]=function(_0xe869e0){var _0x1c2a06=this;return new Promise(function(_0x45f03a,_0x30383c){return db[_0xfdf4('0x8')][_0xfdf4('0x9')]({'raw':_0xe869e0[_0xfdf4('0xa')]?_0xe869e0[_0xfdf4('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0xe869e0[_0xfdf4('0xa')]?_0xe869e0[_0xfdf4('0xa')][_0xfdf4('0xb')]||null:null,'attributes':_0xe869e0[_0xfdf4('0xa')]?_0xe869e0[_0xfdf4('0xa')][_0xfdf4('0xc')]||null:null,'limit':_0xe869e0[_0xfdf4('0xa')]?_0xe869e0[_0xfdf4('0xa')]['limit']||null:null,'include':_0xe869e0[_0xfdf4('0xa')]?_0xe869e0[_0xfdf4('0xa')][_0xfdf4('0xd')]?_[_0xfdf4('0xe')](_0xe869e0[_0xfdf4('0xa')]['include'],function(_0x3175d3){return{'model':db[_0x3175d3[_0xfdf4('0xf')]],'as':_0x3175d3['as'],'attributes':_0x3175d3[_0xfdf4('0xc')],'include':_0x3175d3[_0xfdf4('0xd')]?_[_0xfdf4('0xe')](_0x3175d3[_0xfdf4('0xd')],function(_0x440f40){return{'model':db[_0x440f40[_0xfdf4('0xf')]],'as':_0x440f40['as'],'attributes':_0x440f40[_0xfdf4('0xc')],'include':_0x440f40['include']?_[_0xfdf4('0xe')](_0x440f40[_0xfdf4('0xd')],function(_0x16a229){return{'model':db[_0x16a229[_0xfdf4('0xf')]],'as':_0x16a229['as'],'attributes':_0x16a229['attributes']};}):[]};}):[]};}):[]:[]})[_0xfdf4('0x10')](function(_0x243ee8){logger[_0xfdf4('0x11')](_0xfdf4('0x7'),_0xe869e0);logger['debug'](_0xfdf4('0x7'),_0xe869e0,JSON[_0xfdf4('0x12')](_0x243ee8));_0x45f03a(_0x243ee8);})[_0xfdf4('0x13')](function(_0x3acc27){logger['error'](_0xfdf4('0x7'),_0x3acc27[_0xfdf4('0x14')],_0xe869e0);_0x30383c(_0x1c2a06[_0xfdf4('0x15')](0x1f4,_0x3acc27[_0xfdf4('0x14')]));});});};exports[_0xfdf4('0x16')]=function(_0x160f9d){var _0x340ead=this;return new Promise(function(_0x54893a,_0x2a9490){return db[_0xfdf4('0x8')][_0xfdf4('0x17')]({'raw':_0x160f9d[_0xfdf4('0xa')]?_0x160f9d[_0xfdf4('0xa')][_0xfdf4('0x18')]===undefined?!![]:![]:!![],'where':_0x160f9d[_0xfdf4('0xa')]?_0x160f9d[_0xfdf4('0xa')][_0xfdf4('0xb')]||null:null,'attributes':_0x160f9d[_0xfdf4('0xa')]?_0x160f9d['options'][_0xfdf4('0xc')]||null:null,'include':_0x160f9d[_0xfdf4('0xa')]?_0x160f9d[_0xfdf4('0xa')][_0xfdf4('0xd')]?_['map'](_0x160f9d['options'][_0xfdf4('0xd')],function(_0x3ebb8a){return{'model':db[_0x3ebb8a[_0xfdf4('0xf')]],'as':_0x3ebb8a['as'],'attributes':_0x3ebb8a[_0xfdf4('0xc')],'include':_0x3ebb8a['include']?_['map'](_0x3ebb8a[_0xfdf4('0xd')],function(_0x31f147){return{'model':db[_0x31f147[_0xfdf4('0xf')]],'as':_0x31f147['as'],'attributes':_0x31f147[_0xfdf4('0xc')],'include':_0x31f147[_0xfdf4('0xd')]?_[_0xfdf4('0xe')](_0x31f147['include'],function(_0x261683){return{'model':db[_0x261683['model']],'as':_0x261683['as'],'attributes':_0x261683['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4964d9){logger[_0xfdf4('0x11')](_0xfdf4('0x16'),_0x160f9d);logger[_0xfdf4('0x19')](_0xfdf4('0x16'),_0x160f9d,JSON[_0xfdf4('0x12')](_0x4964d9));_0x54893a(_0x4964d9);})[_0xfdf4('0x13')](function(_0x24a972){logger[_0xfdf4('0x15')]('ShowSquareProject',_0x24a972[_0xfdf4('0x14')],_0x160f9d);_0x2a9490(_0x340ead['error'](0x1f4,_0x24a972[_0xfdf4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d96dc19..e6f7a3c 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 _0xcb87=['save','remove','update','emit','register','squareProject:','./squareProject.events'];(function(_0x46d022,_0x4547da){var _0x1daab4=function(_0x1f0708){while(--_0x1f0708){_0x46d022['push'](_0x46d022['shift']());}};_0x1daab4(++_0x4547da);}(_0xcb87,0x76));var _0x7cb8=function(_0x14fad0,_0x278d75){_0x14fad0=_0x14fad0-0x0;var _0x5c665f=_0xcb87[_0x14fad0];return _0x5c665f;};'use strict';var SquareProjectEvents=require(_0x7cb8('0x0'));var events=[_0x7cb8('0x1'),_0x7cb8('0x2'),_0x7cb8('0x3')];function createListener(_0x330aea,_0x4add80){return function(_0x4f01cf){_0x4add80[_0x7cb8('0x4')](_0x330aea,_0x4f01cf);};}function removeListener(_0x32e560,_0x5848ed){return function(){SquareProjectEvents['removeListener'](_0x32e560,_0x5848ed);};}exports[_0x7cb8('0x5')]=function(_0x1e74cb){for(var _0x157eda=0x0,_0x10badc=events['length'];_0x157eda<_0x10badc;_0x157eda++){var _0x222e5f=events[_0x157eda];var _0x2e17c1=createListener(_0x7cb8('0x6')+_0x222e5f,_0x1e74cb);SquareProjectEvents['on'](_0x222e5f,_0x2e17c1);}}; \ No newline at end of file +var _0x6a58=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x45e18e,_0x47cc4d){var _0x175e61=function(_0x23d6c4){while(--_0x23d6c4){_0x45e18e['push'](_0x45e18e['shift']());}};_0x175e61(++_0x47cc4d);}(_0x6a58,0xeb));var _0x86a5=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x6a58[_0x1e4f2f];return _0xccea89;};'use strict';var SquareProjectEvents=require(_0x86a5('0x0'));var events=[_0x86a5('0x1'),_0x86a5('0x2'),_0x86a5('0x3')];function createListener(_0x4809bd,_0x2f72f2){return function(_0x2b01ee){_0x2f72f2[_0x86a5('0x4')](_0x4809bd,_0x2b01ee);};}function removeListener(_0x14a913,_0x4bed9c){return function(){SquareProjectEvents[_0x86a5('0x5')](_0x14a913,_0x4bed9c);};}exports[_0x86a5('0x6')]=function(_0x4972d3){for(var _0x33912e=0x0,_0x5e180f=events[_0x86a5('0x7')];_0x33912e<_0x5e180f;_0x33912e++){var _0x1a0e1f=events[_0x33912e];var _0x518989=createListener(_0x86a5('0x8')+_0x1a0e1f,_0x4972d3);SquareProjectEvents['on'](_0x1a0e1f,_0x518989);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 90e51b4..205fa20 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1dfdfa,_0x2fcefa){var _0x153898=function(_0x33943d){while(--_0x33943d){_0x1dfdfa['push'](_0x1dfdfa['shift']());}};_0x153898(++_0x2fcefa);}(_0x4975,0x86));var _0x5497=function(_0x4c4124,_0x761d56){_0x4c4124=_0x4c4124-0x0;var _0x4e7bc9=_0x4975[_0x4c4124];return _0x4e7bc9;};'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('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0xdeb2d,_0x15ba2b){var _0x1bc627=function(_0x2d32fc){while(--_0x2d32fc){_0xdeb2d['push'](_0xdeb2d['shift']());}};_0x1bc627(++_0x15ba2b);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 706c45a..c243870 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 _0x7dfd=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','savePath'];(function(_0x3b0973,_0x7840c9){var _0x599f9e=function(_0x529222){while(--_0x529222){_0x3b0973['push'](_0x3b0973['shift']());}};_0x599f9e(++_0x7840c9);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'callerid':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'extension':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'dnid':{'type':Sequelize[_0xd7df('0x2')]},'projectName':{'type':Sequelize[_0xd7df('0x2')]},'saveName':{'type':Sequelize[_0xd7df('0x2')]},'filename':{'type':Sequelize[_0xd7df('0x2')]},'savePath':{'type':Sequelize[_0xd7df('0x2')]},'format':{'type':Sequelize[_0xd7df('0x3')],'get':function(){var _0x16e50='';var _0x2c48a4=this['getDataValue'](_0xd7df('0x4'));if(_0x2c48a4){_0x16e50=_0x2c48a4[_0xd7df('0x5')](_0x2c48a4[_0xd7df('0x6')]('.'));}return _0x16e50;}}}; \ No newline at end of file +var _0xac9d=['VIRTUAL','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x904b47,_0x4bbb98){var _0x3eae0e=function(_0x56f22f){while(--_0x56f22f){_0x904b47['push'](_0x904b47['shift']());}};_0x3eae0e(++_0x4bbb98);}(_0xac9d,0x14d));var _0xdac9=function(_0x11fbaa,_0x52dc16){_0x11fbaa=_0x11fbaa-0x0;var _0x1831fd=_0xac9d[_0x11fbaa];return _0x1831fd;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'uniqueid':{'type':Sequelize[_0xdac9('0x2')]},'callerid':{'type':Sequelize[_0xdac9('0x2')]},'calleridname':{'type':Sequelize[_0xdac9('0x2')]},'context':{'type':Sequelize[_0xdac9('0x2')]},'extension':{'type':Sequelize[_0xdac9('0x2')]},'priority':{'type':Sequelize[_0xdac9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xdac9('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xdac9('0x2')]},'filename':{'type':Sequelize[_0xdac9('0x2')]},'savePath':{'type':Sequelize[_0xdac9('0x2')]},'format':{'type':Sequelize[_0xdac9('0x3')],'get':function(){var _0x1c78c5='';var _0x39f560=this['getDataValue'](_0xdac9('0x4'));if(_0x39f560){_0x1c78c5=_0x39f560['substring'](_0x39f560[_0xdac9('0x5')]('.'));}return _0x1c78c5;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index b083aa6..4686c5f 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 _0xbac6=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','catch','create','body','../../components/encryptor','uniqueid','find','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','message','Not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','end','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xbac6,0x124));var _0x6bac=function(_0x1646d5,_0x4c15fd){_0x1646d5=_0x1646d5-0x0;var _0x11361f=_0xbac6[_0x1646d5];return _0x11361f;};'use strict';var emlformat=require(_0x6bac('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bac('0x1'));var jsonpatch=require(_0x6bac('0x2'));var rp=require(_0x6bac('0x3'));var moment=require(_0x6bac('0x4'));var BPromise=require(_0x6bac('0x5'));var Mustache=require(_0x6bac('0x6'));var util=require(_0x6bac('0x7'));var path=require(_0x6bac('0x8'));var sox=require(_0x6bac('0x9'));var csv=require(_0x6bac('0xa'));var ejs=require(_0x6bac('0xb'));var fs=require('fs');var fs_extra=require(_0x6bac('0xc'));var _=require(_0x6bac('0xd'));var squel=require(_0x6bac('0xe'));var crypto=require(_0x6bac('0xf'));var jsforce=require(_0x6bac('0x10'));var deskjs=require(_0x6bac('0x11'));var toCsv=require(_0x6bac('0xa'));var querystring=require(_0x6bac('0x12'));var Papa=require(_0x6bac('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6bac('0x14'));var as=require(_0x6bac('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bac('0x16'))('api');var utils=require(_0x6bac('0x17'));var config=require(_0x6bac('0x18'));var licenseUtil=require(_0x6bac('0x19'));var db=require(_0x6bac('0x1a'))['db'];function respondWithStatusCode(_0x391106,_0x28fc0f){_0x28fc0f=_0x28fc0f||0xcc;return function(_0x50c0cd){if(_0x50c0cd){return _0x391106[_0x6bac('0x1b')](_0x28fc0f);}return _0x391106[_0x6bac('0x1c')](_0x28fc0f)['end']();};}function respondWithResult(_0x2c8506,_0x1cc63f){_0x1cc63f=_0x1cc63f||0xc8;return function(_0x2d9d50){if(_0x2d9d50){return _0x2c8506['status'](_0x1cc63f)[_0x6bac('0x1d')](_0x2d9d50);}};}function respondWithFilteredResult(_0x5dcc21,_0x4f0e6f){return function(_0x21c4f4){if(_0x21c4f4){var _0x5ac474=typeof _0x4f0e6f[_0x6bac('0x1e')]===_0x6bac('0x1f')&&typeof _0x4f0e6f[_0x6bac('0x20')]===_0x6bac('0x1f');var _0x4af620=_0x21c4f4['count'];var _0x2140fc=_0x5ac474?0x0:_0x4f0e6f[_0x6bac('0x1e')];var _0x307342=_0x5ac474?_0x21c4f4[_0x6bac('0x21')]:_0x4f0e6f[_0x6bac('0x1e')]+_0x4f0e6f[_0x6bac('0x20')];var _0x55a845;if(_0x307342>=_0x4af620){_0x307342=_0x4af620;_0x55a845=0xc8;}else{_0x55a845=0xce;}_0x5dcc21[_0x6bac('0x1c')](_0x55a845);return _0x5dcc21[_0x6bac('0x22')](_0x6bac('0x23'),_0x2140fc+'-'+_0x307342+'/'+_0x4af620)[_0x6bac('0x1d')](_0x21c4f4);}return null;};}function patchUpdates(_0x579a96){return function(_0x4472e5){try{jsonpatch[_0x6bac('0x24')](_0x4472e5,_0x579a96,!![]);}catch(_0x2ec6aa){return BPromise['reject'](_0x2ec6aa);}return _0x4472e5[_0x6bac('0x25')]();};}function saveUpdates(_0x334e7f,_0x2399b6){return function(_0x43a91a){if(_0x43a91a){return _0x43a91a[_0x6bac('0x26')](_0x334e7f)[_0x6bac('0x27')](function(_0x54bcbc){return _0x54bcbc;});}return null;};}function removeEntity(_0x3dfdb1,_0x2dc574){return function(_0x2657b9){if(_0x2657b9){return _0x2657b9['destroy']()[_0x6bac('0x27')](function(){_0x3dfdb1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x425b73,_0x29bc82){return function(_0x49bf11){if(!_0x49bf11){_0x425b73[_0x6bac('0x1b')](0x194);}return _0x49bf11;};}function handleError(_0x47689d,_0x167b17){_0x167b17=_0x167b17||0x1f4;return function(_0x2fc404){logger[_0x6bac('0x28')](_0x2fc404['stack']);if(_0x2fc404[_0x6bac('0x29')]){delete _0x2fc404['name'];}_0x47689d['status'](_0x167b17)[_0x6bac('0x2a')](_0x2fc404);};}exports[_0x6bac('0x2b')]=function(_0x5b7a25,_0x39e86d){var _0x38e920={},_0x4c99ec={},_0x303f9a={'count':0x0,'rows':[]};var _0x277a7c=_[_0x6bac('0x2c')](db[_0x6bac('0x2d')][_0x6bac('0x2e')],function(_0x426946){return{'name':_0x426946[_0x6bac('0x2f')],'type':_0x426946[_0x6bac('0x30')][_0x6bac('0x31')]};});_0x4c99ec[_0x6bac('0x32')]=_[_0x6bac('0x2c')](_0x277a7c,_0x6bac('0x29'));_0x4c99ec[_0x6bac('0x33')]=_[_0x6bac('0x34')](_0x5b7a25[_0x6bac('0x33')]);_0x4c99ec[_0x6bac('0x35')]=_[_0x6bac('0x36')](_0x4c99ec[_0x6bac('0x32')],_0x4c99ec[_0x6bac('0x33')]);_0x38e920[_0x6bac('0x37')]=_['intersection'](_0x4c99ec[_0x6bac('0x32')],qs[_0x6bac('0x38')](_0x5b7a25[_0x6bac('0x33')][_0x6bac('0x38')]));_0x38e920[_0x6bac('0x37')]=_0x38e920[_0x6bac('0x37')][_0x6bac('0x39')]?_0x38e920[_0x6bac('0x37')]:_0x4c99ec[_0x6bac('0x32')];if(!_0x5b7a25[_0x6bac('0x33')]['hasOwnProperty'](_0x6bac('0x3a'))){_0x38e920[_0x6bac('0x20')]=qs[_0x6bac('0x20')](_0x5b7a25[_0x6bac('0x33')][_0x6bac('0x20')]);_0x38e920[_0x6bac('0x1e')]=qs[_0x6bac('0x1e')](_0x5b7a25[_0x6bac('0x33')]['offset']);}_0x38e920[_0x6bac('0x3b')]=qs[_0x6bac('0x3c')](_0x5b7a25['query'][_0x6bac('0x3c')]);_0x38e920[_0x6bac('0x3d')]=qs[_0x6bac('0x35')](_[_0x6bac('0x3e')](_0x5b7a25[_0x6bac('0x33')],_0x4c99ec[_0x6bac('0x35')]),_0x277a7c);if(_0x5b7a25['query'][_0x6bac('0x3f')]){_0x38e920[_0x6bac('0x3d')]=_['merge'](_0x38e920['where'],{'$or':_[_0x6bac('0x2c')](_0x277a7c,function(_0x1e9918){if(_0x1e9918[_0x6bac('0x30')]!==_0x6bac('0x40')){var _0xcf3b27={};_0xcf3b27[_0x1e9918[_0x6bac('0x29')]]={'$like':'%'+_0x5b7a25['query'][_0x6bac('0x3f')]+'%'};return _0xcf3b27;}})});}_0x38e920=_[_0x6bac('0x41')]({},_0x38e920,_0x5b7a25['options']);var _0x6d3be3={'where':_0x38e920[_0x6bac('0x3d')]};return db[_0x6bac('0x2d')]['count'](_0x6d3be3)[_0x6bac('0x27')](function(_0x40e31f){_0x303f9a[_0x6bac('0x21')]=_0x40e31f;if(_0x5b7a25[_0x6bac('0x33')][_0x6bac('0x42')]){_0x38e920[_0x6bac('0x43')]=[{'all':!![]}];}return db[_0x6bac('0x2d')][_0x6bac('0x44')](_0x38e920);})[_0x6bac('0x27')](function(_0x13c316){_0x303f9a[_0x6bac('0x45')]=_0x13c316;return _0x303f9a;})[_0x6bac('0x27')](respondWithFilteredResult(_0x39e86d,_0x38e920))['catch'](handleError(_0x39e86d,null));};exports[_0x6bac('0x46')]=function(_0x9a3867,_0x3fe9c7){var _0x5603c7={'raw':!![],'where':{'id':_0x9a3867[_0x6bac('0x47')]['id']}},_0x3db370={};_0x3db370[_0x6bac('0x32')]=_[_0x6bac('0x34')](db[_0x6bac('0x2d')][_0x6bac('0x2e')]);_0x3db370[_0x6bac('0x33')]=_[_0x6bac('0x34')](_0x9a3867[_0x6bac('0x33')]);_0x3db370['filters']=_['intersection'](_0x3db370[_0x6bac('0x32')],_0x3db370[_0x6bac('0x33')]);_0x5603c7[_0x6bac('0x37')]=_[_0x6bac('0x36')](_0x3db370['model'],qs[_0x6bac('0x38')](_0x9a3867['query']['fields']));_0x5603c7[_0x6bac('0x37')]=_0x5603c7[_0x6bac('0x37')][_0x6bac('0x39')]?_0x5603c7['attributes']:_0x3db370[_0x6bac('0x32')];if(_0x9a3867[_0x6bac('0x33')]['includeAll']){_0x5603c7[_0x6bac('0x43')]=[{'all':!![]}];}_0x5603c7=_[_0x6bac('0x41')]({},_0x5603c7,_0x9a3867[_0x6bac('0x48')]);return db[_0x6bac('0x2d')]['find'](_0x5603c7)[_0x6bac('0x27')](handleEntityNotFound(_0x3fe9c7,null))[_0x6bac('0x27')](respondWithResult(_0x3fe9c7,null))[_0x6bac('0x49')](handleError(_0x3fe9c7,null));};exports[_0x6bac('0x4a')]=function(_0x59290f,_0x3a1083){return db[_0x6bac('0x2d')][_0x6bac('0x4a')](_0x59290f['body'],{})[_0x6bac('0x27')](respondWithResult(_0x3a1083,0xc9))[_0x6bac('0x49')](handleError(_0x3a1083,null));};exports[_0x6bac('0x26')]=function(_0x13ccd2,_0x3ed0cd){if(_0x13ccd2[_0x6bac('0x4b')]['id']){delete _0x13ccd2[_0x6bac('0x4b')]['id'];}return db[_0x6bac('0x2d')]['find']({'where':{'id':_0x13ccd2[_0x6bac('0x47')]['id']}})[_0x6bac('0x27')](handleEntityNotFound(_0x3ed0cd,null))[_0x6bac('0x27')](saveUpdates(_0x13ccd2['body'],null))['then'](respondWithResult(_0x3ed0cd,null))[_0x6bac('0x49')](handleError(_0x3ed0cd,null));};exports['download']=function(_0xf9fc84,_0x38dd93,_0x5235bd){var _0x1d819e=require(_0x6bac('0x4c'));var _0x473393=![];var _0x5acd9b={};if(_0xf9fc84['query'][_0x6bac('0x30')]&&_0xf9fc84['query'][_0x6bac('0x30')]==='uniqueid'){_0x5acd9b[_0x6bac('0x4d')]=_0xf9fc84[_0x6bac('0x47')]['id'];}else{_0x5acd9b['id']=_0xf9fc84[_0x6bac('0x47')]['id'];}return db[_0x6bac('0x2d')][_0x6bac('0x4e')]({'where':_0x5acd9b,'attributes':['id',_0x6bac('0x4f'),_0x6bac('0x50')],'raw':!![]})[_0x6bac('0x27')](handleEntityNotFound(_0x38dd93,null))[_0x6bac('0x27')](function(_0x216d25){if(_0x216d25){var _0x1e42b5=_0x216d25[_0x6bac('0x4f')];var _0x3a5ce7=util[_0x6bac('0x51')](_0x6bac('0x52'),_0x1e42b5);if(fs[_0x6bac('0x53')](_0x3a5ce7)){_0x473393=!![];return _0x1d819e[_0x6bac('0x54')](_0x3a5ce7,_0x1e42b5,config[_0x6bac('0x55')][_0x6bac('0x56')])['then'](function(){return _0x216d25;});}return _0x216d25;}})[_0x6bac('0x27')](function(_0x3e1d7e){if(_0x3e1d7e){var _0x3486dc=_0x3e1d7e[_0x6bac('0x4f')];if(!fs[_0x6bac('0x53')](_0x3486dc)){throw new db[(_0x6bac('0x57'))][(_0x6bac('0x58'))](_0x6bac('0x59'));}if(_0x3e1d7e[_0x6bac('0x50')]){return _0x38dd93[_0x6bac('0x5a')](_0x3486dc,_0x3e1d7e['filename']+path['extname'](_0x3486dc),function(){if(_0x473393){fs['unlink'](_0x3486dc);}});}else{return _0x38dd93[_0x6bac('0x5a')](_0x3486dc,function(_0x5ad12d){if(_0x473393){fs['unlink'](_0x3486dc);}});}}})[_0x6bac('0x49')](function(_0x425b82){if(_0x425b82[_0x6bac('0x5b')]==='SquareRecording\x20not\x20found'){_0x38dd93[_0x6bac('0x1c')](0x194)[_0x6bac('0x2a')](_0x6bac('0x5c'));}else{return handleError(_0x38dd93,null);}});};exports[_0x6bac('0x5d')]=function(_0x3598d8,_0x220570){return db[_0x6bac('0x2d')]['find']({'where':{'id':_0x3598d8[_0x6bac('0x47')]['id']}})[_0x6bac('0x27')](function(_0x4954ae){if(_['isNil'](_0x4954ae)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4954ae;})[_0x6bac('0x27')](function(_0x486ebf){var _0x4cd670=_0x486ebf[_0x6bac('0x4f')];logger[_0x6bac('0x5e')](_0x6bac('0x5f'),_0x4cd670);if(!_[_0x6bac('0x60')](_0x486ebf[_0x6bac('0x4f')])&&fs[_0x6bac('0x53')](_0x4cd670)){logger[_0x6bac('0x5e')](_0x6bac('0x61')+_0x4cd670+_0x6bac('0x62'));fs['unlinkSync'](_0x4cd670);}_0x4cd670=_0x4cd670+_0x6bac('0x63');if(!_[_0x6bac('0x60')](_0x486ebf[_0x6bac('0x4f')])&&fs[_0x6bac('0x53')](_0x4cd670)){logger[_0x6bac('0x5e')]('File:\x20\x22'+_0x4cd670+_0x6bac('0x62'));fs[_0x6bac('0x64')](_0x4cd670);}return _0x486ebf;})[_0x6bac('0x27')](function(_0x543297){if(!_0x543297)throw new InternalError();return _0x543297['destroy']();})[_0x6bac('0x27')](function(){_0x220570[_0x6bac('0x1c')](0xcc)[_0x6bac('0x65')]();})[_0x6bac('0x49')](handleError(_0x220570,null));}; \ No newline at end of file +var _0xab35=['catch','show','params','find','create','body','update','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xab35,0x143));var _0x5ab3=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0xab35[_0x204ad4];return _0x50675f;};'use strict';var emlformat=require(_0x5ab3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5ab3('0x1'));var jsonpatch=require(_0x5ab3('0x2'));var rp=require('request-promise');var moment=require(_0x5ab3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x5ab3('0x4'));var csv=require('to-csv');var ejs=require(_0x5ab3('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5ab3('0x6'));var squel=require(_0x5ab3('0x7'));var crypto=require(_0x5ab3('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x5ab3('0x9'));var toCsv=require('to-csv');var querystring=require(_0x5ab3('0xa'));var Papa=require(_0x5ab3('0xb'));var Redis=require(_0x5ab3('0xc'));var authService=require(_0x5ab3('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5ab3('0xe'));var hardwareService=require(_0x5ab3('0xf'));var logger=require(_0x5ab3('0x10'))('api');var utils=require(_0x5ab3('0x11'));var config=require(_0x5ab3('0x12'));var licenseUtil=require(_0x5ab3('0x13'));var db=require(_0x5ab3('0x14'))['db'];function respondWithStatusCode(_0x51d8f7,_0x15c453){_0x15c453=_0x15c453||0xcc;return function(_0x4a8bb6){if(_0x4a8bb6){return _0x51d8f7[_0x5ab3('0x15')](_0x15c453);}return _0x51d8f7[_0x5ab3('0x16')](_0x15c453)[_0x5ab3('0x17')]();};}function respondWithResult(_0x175ea9,_0x321d8d){_0x321d8d=_0x321d8d||0xc8;return function(_0x25acbb){if(_0x25acbb){return _0x175ea9[_0x5ab3('0x16')](_0x321d8d)[_0x5ab3('0x18')](_0x25acbb);}};}function respondWithFilteredResult(_0x12cd5a,_0x10022e){return function(_0x415f95){if(_0x415f95){var _0x48f2e0=typeof _0x10022e['offset']===_0x5ab3('0x19')&&typeof _0x10022e[_0x5ab3('0x1a')]==='undefined';var _0x388714=_0x415f95[_0x5ab3('0x1b')];var _0x1cad3d=_0x48f2e0?0x0:_0x10022e[_0x5ab3('0x1c')];var _0x1127e2=_0x48f2e0?_0x415f95[_0x5ab3('0x1b')]:_0x10022e[_0x5ab3('0x1c')]+_0x10022e[_0x5ab3('0x1a')];var _0x441670;if(_0x1127e2>=_0x388714){_0x1127e2=_0x388714;_0x441670=0xc8;}else{_0x441670=0xce;}_0x12cd5a[_0x5ab3('0x16')](_0x441670);return _0x12cd5a[_0x5ab3('0x1d')](_0x5ab3('0x1e'),_0x1cad3d+'-'+_0x1127e2+'/'+_0x388714)['json'](_0x415f95);}return null;};}function patchUpdates(_0x140ac3){return function(_0x17366b){try{jsonpatch[_0x5ab3('0x1f')](_0x17366b,_0x140ac3,!![]);}catch(_0x44f4a5){return BPromise[_0x5ab3('0x20')](_0x44f4a5);}return _0x17366b[_0x5ab3('0x21')]();};}function saveUpdates(_0x497cf5,_0x8c5581){return function(_0x518d71){if(_0x518d71){return _0x518d71['update'](_0x497cf5)[_0x5ab3('0x22')](function(_0x45c81a){return _0x45c81a;});}return null;};}function removeEntity(_0xa5b09b,_0x1b8d15){return function(_0x48ab45){if(_0x48ab45){return _0x48ab45[_0x5ab3('0x23')]()[_0x5ab3('0x22')](function(){_0xa5b09b[_0x5ab3('0x16')](0xcc)[_0x5ab3('0x17')]();});}};}function handleEntityNotFound(_0x1a0b36,_0x492182){return function(_0x38def7){if(!_0x38def7){_0x1a0b36['sendStatus'](0x194);}return _0x38def7;};}function handleError(_0x577767,_0x4fefe1){_0x4fefe1=_0x4fefe1||0x1f4;return function(_0x451262){logger[_0x5ab3('0x24')](_0x451262[_0x5ab3('0x25')]);if(_0x451262[_0x5ab3('0x26')]){delete _0x451262[_0x5ab3('0x26')];}_0x577767['status'](_0x4fefe1)[_0x5ab3('0x27')](_0x451262);};}exports['index']=function(_0x4bfa94,_0x3bfcd2){var _0x5c6768={},_0x30ff0a={},_0x2cf925={'count':0x0,'rows':[]};var _0x342d8b=_[_0x5ab3('0x28')](db[_0x5ab3('0x29')][_0x5ab3('0x2a')],function(_0x411d19){return{'name':_0x411d19[_0x5ab3('0x2b')],'type':_0x411d19['type']['key']};});_0x30ff0a[_0x5ab3('0x2c')]=_[_0x5ab3('0x28')](_0x342d8b,_0x5ab3('0x26'));_0x30ff0a['query']=_[_0x5ab3('0x2d')](_0x4bfa94[_0x5ab3('0x2e')]);_0x30ff0a[_0x5ab3('0x2f')]=_[_0x5ab3('0x30')](_0x30ff0a[_0x5ab3('0x2c')],_0x30ff0a[_0x5ab3('0x2e')]);_0x5c6768[_0x5ab3('0x31')]=_[_0x5ab3('0x30')](_0x30ff0a[_0x5ab3('0x2c')],qs[_0x5ab3('0x32')](_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x32')]));_0x5c6768[_0x5ab3('0x31')]=_0x5c6768[_0x5ab3('0x31')][_0x5ab3('0x33')]?_0x5c6768[_0x5ab3('0x31')]:_0x30ff0a[_0x5ab3('0x2c')];if(!_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x34')](_0x5ab3('0x35'))){_0x5c6768[_0x5ab3('0x1a')]=qs[_0x5ab3('0x1a')](_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x1a')]);_0x5c6768[_0x5ab3('0x1c')]=qs[_0x5ab3('0x1c')](_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x1c')]);}_0x5c6768[_0x5ab3('0x36')]=qs[_0x5ab3('0x37')](_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x37')]);_0x5c6768['where']=qs['filters'](_['pick'](_0x4bfa94[_0x5ab3('0x2e')],_0x30ff0a[_0x5ab3('0x2f')]),_0x342d8b);if(_0x4bfa94[_0x5ab3('0x2e')][_0x5ab3('0x38')]){_0x5c6768['where']=_[_0x5ab3('0x39')](_0x5c6768[_0x5ab3('0x3a')],{'$or':_[_0x5ab3('0x28')](_0x342d8b,function(_0x2b68dd){if(_0x2b68dd['type']!==_0x5ab3('0x3b')){var _0x1709d8={};_0x1709d8[_0x2b68dd[_0x5ab3('0x26')]]={'$like':'%'+_0x4bfa94[_0x5ab3('0x2e')]['filter']+'%'};return _0x1709d8;}})});}_0x5c6768=_['merge']({},_0x5c6768,_0x4bfa94[_0x5ab3('0x3c')]);var _0x571203={'where':_0x5c6768[_0x5ab3('0x3a')]};return db[_0x5ab3('0x29')][_0x5ab3('0x1b')](_0x571203)[_0x5ab3('0x22')](function(_0x3fe184){_0x2cf925[_0x5ab3('0x1b')]=_0x3fe184;if(_0x4bfa94['query'][_0x5ab3('0x3d')]){_0x5c6768[_0x5ab3('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x5ab3('0x3f')](_0x5c6768);})[_0x5ab3('0x22')](function(_0x434eb1){_0x2cf925[_0x5ab3('0x40')]=_0x434eb1;return _0x2cf925;})['then'](respondWithFilteredResult(_0x3bfcd2,_0x5c6768))[_0x5ab3('0x41')](handleError(_0x3bfcd2,null));};exports[_0x5ab3('0x42')]=function(_0x258d19,_0x35bd01){var _0x2fc345={'raw':!![],'where':{'id':_0x258d19[_0x5ab3('0x43')]['id']}},_0x30e7df={};_0x30e7df['model']=_[_0x5ab3('0x2d')](db['SquareRecording'][_0x5ab3('0x2a')]);_0x30e7df[_0x5ab3('0x2e')]=_['keys'](_0x258d19[_0x5ab3('0x2e')]);_0x30e7df['filters']=_[_0x5ab3('0x30')](_0x30e7df[_0x5ab3('0x2c')],_0x30e7df[_0x5ab3('0x2e')]);_0x2fc345[_0x5ab3('0x31')]=_[_0x5ab3('0x30')](_0x30e7df[_0x5ab3('0x2c')],qs[_0x5ab3('0x32')](_0x258d19[_0x5ab3('0x2e')]['fields']));_0x2fc345[_0x5ab3('0x31')]=_0x2fc345[_0x5ab3('0x31')][_0x5ab3('0x33')]?_0x2fc345[_0x5ab3('0x31')]:_0x30e7df[_0x5ab3('0x2c')];if(_0x258d19['query'][_0x5ab3('0x3d')]){_0x2fc345[_0x5ab3('0x3e')]=[{'all':!![]}];}_0x2fc345=_['merge']({},_0x2fc345,_0x258d19[_0x5ab3('0x3c')]);return db[_0x5ab3('0x29')][_0x5ab3('0x44')](_0x2fc345)[_0x5ab3('0x22')](handleEntityNotFound(_0x35bd01,null))[_0x5ab3('0x22')](respondWithResult(_0x35bd01,null))[_0x5ab3('0x41')](handleError(_0x35bd01,null));};exports[_0x5ab3('0x45')]=function(_0x16e257,_0x3707ef){return db[_0x5ab3('0x29')][_0x5ab3('0x45')](_0x16e257[_0x5ab3('0x46')],{})[_0x5ab3('0x22')](respondWithResult(_0x3707ef,0xc9))[_0x5ab3('0x41')](handleError(_0x3707ef,null));};exports[_0x5ab3('0x47')]=function(_0x394ffb,_0x33efcd){if(_0x394ffb[_0x5ab3('0x46')]['id']){delete _0x394ffb[_0x5ab3('0x46')]['id'];}return db[_0x5ab3('0x29')][_0x5ab3('0x44')]({'where':{'id':_0x394ffb[_0x5ab3('0x43')]['id']}})['then'](handleEntityNotFound(_0x33efcd,null))['then'](saveUpdates(_0x394ffb[_0x5ab3('0x46')],null))[_0x5ab3('0x22')](respondWithResult(_0x33efcd,null))[_0x5ab3('0x41')](handleError(_0x33efcd,null));};exports[_0x5ab3('0x48')]=function(_0x19419c,_0x3a4b61,_0x455f7d){var _0xbb11b3=require(_0x5ab3('0x49'));var _0x21035a=![];var _0x3ec495={};if(_0x19419c[_0x5ab3('0x2e')]['type']&&_0x19419c[_0x5ab3('0x2e')]['type']===_0x5ab3('0x4a')){_0x3ec495[_0x5ab3('0x4a')]=_0x19419c[_0x5ab3('0x43')]['id'];}else{_0x3ec495['id']=_0x19419c[_0x5ab3('0x43')]['id'];}return db[_0x5ab3('0x29')][_0x5ab3('0x44')]({'where':_0x3ec495,'attributes':['id','savePath','filename'],'raw':!![]})['then'](handleEntityNotFound(_0x3a4b61,null))[_0x5ab3('0x22')](function(_0xd571cf){if(_0xd571cf){var _0x2fd746=_0xd571cf['savePath'];var _0x4b8352=util['format'](_0x5ab3('0x4b'),_0x2fd746);if(fs[_0x5ab3('0x4c')](_0x4b8352)){_0x21035a=!![];return _0xbb11b3[_0x5ab3('0x4d')](_0x4b8352,_0x2fd746,config[_0x5ab3('0x4e')][_0x5ab3('0x4f')])[_0x5ab3('0x22')](function(){return _0xd571cf;});}return _0xd571cf;}})[_0x5ab3('0x22')](function(_0x84c93f){if(_0x84c93f){var _0x26501c=_0x84c93f[_0x5ab3('0x50')];if(!fs[_0x5ab3('0x4c')](_0x26501c)){throw new db[(_0x5ab3('0x51'))][(_0x5ab3('0x52'))](_0x5ab3('0x53'));}if(_0x84c93f[_0x5ab3('0x54')]){return _0x3a4b61[_0x5ab3('0x48')](_0x26501c,_0x84c93f[_0x5ab3('0x54')]+path[_0x5ab3('0x55')](_0x26501c),function(){if(_0x21035a){fs[_0x5ab3('0x56')](_0x26501c);}});}else{return _0x3a4b61['download'](_0x26501c,function(_0x1f371c){if(_0x21035a){fs[_0x5ab3('0x56')](_0x26501c);}});}}})[_0x5ab3('0x41')](function(_0x1c724b){if(_0x1c724b[_0x5ab3('0x57')]===_0x5ab3('0x53')){_0x3a4b61[_0x5ab3('0x16')](0x194)[_0x5ab3('0x27')](_0x5ab3('0x58'));}else{return handleError(_0x3a4b61,null);}});};exports['destroy']=function(_0x44c758,_0x2c518c){return db['SquareRecording'][_0x5ab3('0x44')]({'where':{'id':_0x44c758[_0x5ab3('0x43')]['id']}})[_0x5ab3('0x22')](function(_0x6e64b4){if(_[_0x5ab3('0x59')](_0x6e64b4)){throw new ReferenceError(_0x5ab3('0x5a'));}return _0x6e64b4;})[_0x5ab3('0x22')](function(_0x53d768){var _0x3cfcec=_0x53d768[_0x5ab3('0x50')];logger[_0x5ab3('0x5b')](_0x5ab3('0x5c'),_0x3cfcec);if(!_[_0x5ab3('0x59')](_0x53d768[_0x5ab3('0x50')])&&fs[_0x5ab3('0x4c')](_0x3cfcec)){logger[_0x5ab3('0x5b')](_0x5ab3('0x5d')+_0x3cfcec+_0x5ab3('0x5e'));fs['unlinkSync'](_0x3cfcec);}_0x3cfcec=_0x3cfcec+_0x5ab3('0x5f');if(!_[_0x5ab3('0x59')](_0x53d768[_0x5ab3('0x50')])&&fs[_0x5ab3('0x4c')](_0x3cfcec)){logger['info'](_0x5ab3('0x5d')+_0x3cfcec+_0x5ab3('0x5e'));fs[_0x5ab3('0x60')](_0x3cfcec);}return _0x53d768;})[_0x5ab3('0x22')](function(_0x50ff46){if(!_0x50ff46)throw new InternalError();return _0x50ff46[_0x5ab3('0x23')]();})[_0x5ab3('0x22')](function(){_0x2c518c['status'](0xcc)['end']();})[_0x5ab3('0x41')](handleError(_0x2c518c,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8f64268..abb4a97 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 _0x398a=['../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x398a,0x11a));var _0xa398=function(_0x40d1d7,_0x32fd55){_0x40d1d7=_0x40d1d7-0x0;var _0x397471=_0x398a[_0x40d1d7];return _0x397471;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require(_0xa398('0x2'))(_0xa398('0x3'));var moment=require(_0xa398('0x4'));var BPromise=require(_0xa398('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa398('0x6'));var attributes=require(_0xa398('0x7'));module[_0xa398('0x8')]=function(_0x1e57a9,_0x3421a5){return _0x1e57a9[_0xa398('0x9')](_0xa398('0xa'),attributes,{'tableName':_0xa398('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x414f=['path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x58af1c,_0x2a453c){var _0x1cc28a=function(_0x40da7f){while(--_0x40da7f){_0x58af1c['push'](_0x58af1c['shift']());}};_0x1cc28a(++_0x2a453c);}(_0x414f,0x13f));var _0xf414=function(_0x4ab9d8,_0x211196){_0x4ab9d8=_0x4ab9d8-0x0;var _0x2b7b2e=_0x414f[_0x4ab9d8];return _0x2b7b2e;};'use strict';var _=require(_0xf414('0x0'));var util=require('util');var logger=require(_0xf414('0x1'))(_0xf414('0x2'));var moment=require('moment');var BPromise=require(_0xf414('0x3'));var rp=require(_0xf414('0x4'));var fs=require('fs');var path=require(_0xf414('0x5'));var rimraf=require(_0xf414('0x6'));var config=require(_0xf414('0x7'));var attributes=require(_0xf414('0x8'));module[_0xf414('0x9')]=function(_0x5dda1d,_0x3be83a){return _0x5dda1d['define'](_0xf414('0xa'),attributes,{'tableName':_0xf414('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 2b8e989..b63bc85 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 _0x67d0=['../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','create','options','raw','CreateSquareRecording','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x798104,_0x2b4b0a){var _0x561c0c=function(_0xa724e6){while(--_0xa724e6){_0x798104['push'](_0x798104['shift']());}};_0x561c0c(++_0x2b4b0a);}(_0x67d0,0x1c7));var _0x067d=function(_0x2ac17f,_0x7eabec){_0x2ac17f=_0x2ac17f-0x0;var _0x4e54f6=_0x67d0[_0x2ac17f];return _0x4e54f6;};'use strict';var _=require(_0x067d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x067d('0x1'));var rs=require(_0x067d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x067d('0x3'))['db'];var utils=require(_0x067d('0x4'));var logger=require(_0x067d('0x5'))('rpc');var config=require(_0x067d('0x6'));var jayson=require(_0x067d('0x7'));var client=jayson['client'][_0x067d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x280256,_0x1b5512,_0x33d3f2){return new BPromise(function(_0x348c44,_0x1736e0){return client['request'](_0x280256,_0x33d3f2)[_0x067d('0x9')](function(_0x467aa8){logger[_0x067d('0xa')](_0x067d('0xb'),_0x1b5512,_0x067d('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1b5512,'request\x20sent',JSON[_0x067d('0xd')](_0x467aa8));if(_0x467aa8['error']){if(_0x467aa8[_0x067d('0xe')][_0x067d('0xf')]===0x1f4){logger[_0x067d('0xe')](_0x067d('0xb'),_0x1b5512,_0x467aa8[_0x067d('0xe')][_0x067d('0x10')]);return _0x1736e0(_0x467aa8['error'][_0x067d('0x10')]);}logger[_0x067d('0xe')]('SquareRecording,\x20%s,\x20%s',_0x1b5512,_0x467aa8['error']['message']);return _0x348c44(_0x467aa8[_0x067d('0xe')][_0x067d('0x10')]);}else{logger[_0x067d('0xa')]('SquareRecording,\x20%s,\x20%s',_0x1b5512,'request\x20sent');_0x348c44(_0x467aa8['result'][_0x067d('0x10')]);}})[_0x067d('0x11')](function(_0xb2aafd){logger['error'](_0x067d('0xb'),_0x1b5512,_0xb2aafd);_0x1736e0(_0xb2aafd);});});}exports['CreateSquareRecording']=function(_0x37cbf3){var _0x7d80a1=this;return new Promise(function(_0x4012e7,_0x34f032){return db['SquareRecording'][_0x067d('0x12')](_0x37cbf3['body'],{'raw':_0x37cbf3[_0x067d('0x13')]?_0x37cbf3[_0x067d('0x13')][_0x067d('0x14')]===undefined?!![]:![]:!![]})[_0x067d('0x9')](function(_0x2b3764){logger[_0x067d('0xa')](_0x067d('0x15'),_0x37cbf3);logger[_0x067d('0x16')]('CreateSquareRecording',_0x37cbf3,JSON['stringify'](_0x2b3764));_0x4012e7(_0x2b3764);})[_0x067d('0x11')](function(_0x4bf972){logger[_0x067d('0xe')]('CreateSquareRecording',_0x4bf972[_0x067d('0x10')],_0x37cbf3);_0x34f032(_0x7d80a1['error'](0x1f4,_0x4bf972['message']));});});}; \ No newline at end of file +var _0x9452=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x41ba4d,_0x7976a){var _0x26835e=function(_0x99525d){while(--_0x99525d){_0x41ba4d['push'](_0x41ba4d['shift']());}};_0x26835e(++_0x7976a);}(_0x9452,0x1a5));var _0x2945=function(_0x2aa86d,_0x250de6){_0x2aa86d=_0x2aa86d-0x0;var _0x33d9ca=_0x9452[_0x2aa86d];return _0x33d9ca;};'use strict';var _=require(_0x2945('0x0'));var util=require(_0x2945('0x1'));var moment=require(_0x2945('0x2'));var BPromise=require(_0x2945('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2945('0x4'));var logger=require(_0x2945('0x5'))(_0x2945('0x6'));var config=require(_0x2945('0x7'));var jayson=require(_0x2945('0x8'));var client=jayson['client'][_0x2945('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f4b6d,_0x1fee78,_0x233e69){return new BPromise(function(_0x435dc4,_0x37a07a){return client[_0x2945('0xa')](_0x9f4b6d,_0x233e69)[_0x2945('0xb')](function(_0x55a55f){logger[_0x2945('0xc')]('SquareRecording,\x20%s,\x20%s',_0x1fee78,_0x2945('0xd'));logger[_0x2945('0xe')](_0x2945('0xf'),_0x1fee78,_0x2945('0xd'),JSON[_0x2945('0x10')](_0x55a55f));if(_0x55a55f[_0x2945('0x11')]){if(_0x55a55f[_0x2945('0x11')][_0x2945('0x12')]===0x1f4){logger[_0x2945('0x11')]('SquareRecording,\x20%s,\x20%s',_0x1fee78,_0x55a55f['error'][_0x2945('0x13')]);return _0x37a07a(_0x55a55f['error']['message']);}logger[_0x2945('0x11')]('SquareRecording,\x20%s,\x20%s',_0x1fee78,_0x55a55f['error'][_0x2945('0x13')]);return _0x435dc4(_0x55a55f['error'][_0x2945('0x13')]);}else{logger[_0x2945('0xc')](_0x2945('0x14'),_0x1fee78,_0x2945('0xd'));_0x435dc4(_0x55a55f[_0x2945('0x15')]['message']);}})[_0x2945('0x16')](function(_0x273adf){logger['error'](_0x2945('0x14'),_0x1fee78,_0x273adf);_0x37a07a(_0x273adf);});});}exports[_0x2945('0x17')]=function(_0xe5cf81){var _0x529890=this;return new Promise(function(_0x4d6e04,_0x59c42f){return db[_0x2945('0x18')][_0x2945('0x19')](_0xe5cf81[_0x2945('0x1a')],{'raw':_0xe5cf81[_0x2945('0x1b')]?_0xe5cf81[_0x2945('0x1b')][_0x2945('0x1c')]===undefined?!![]:![]:!![]})[_0x2945('0xb')](function(_0x44c648){logger[_0x2945('0xc')]('CreateSquareRecording',_0xe5cf81);logger[_0x2945('0xe')]('CreateSquareRecording',_0xe5cf81,JSON[_0x2945('0x10')](_0x44c648));_0x4d6e04(_0x44c648);})[_0x2945('0x16')](function(_0x1b7259){logger[_0x2945('0x11')](_0x2945('0x17'),_0x1b7259['message'],_0xe5cf81);_0x59c42f(_0x529890[_0x2945('0x11')](0x1f4,_0x1b7259[_0x2945('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 0c66673..180c805 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(_0x13c5bf,_0x204d66){var _0x7c871f=function(_0x2668db){while(--_0x2668db){_0x13c5bf['push'](_0x13c5bf['shift']());}};_0x7c871f(++_0x204d66);}(_0xe706,0xa3));var _0x6e70=function(_0x498b38,_0x2d9583){_0x498b38=_0x498b38-0x0;var _0x10feb7=_0xe706[_0x498b38];return _0x10feb7;};'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 _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(_0x25ffd4,_0x16b31d){var _0x414452=function(_0x4440d2){while(--_0x4440d2){_0x25ffd4['push'](_0x25ffd4['shift']());}};_0x414452(++_0x16b31d);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 91a989b..988e46b 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 _0x6baf=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x17dabe,_0x58d6b2){var _0x3791e5=function(_0x22a942){while(--_0x22a942){_0x17dabe['push'](_0x17dabe['shift']());}};_0x3791e5(++_0x58d6b2);}(_0x6baf,0xc3));var _0xf6ba=function(_0x22a409,_0x1092d7){_0x22a409=_0x22a409-0x0;var _0xfc05e4=_0x6baf[_0x22a409];return _0xfc05e4;};'use strict';var Sequelize=require(_0xf6ba('0x0'));module[_0xf6ba('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf6ba('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf6ba('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf6ba('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf6ba('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xf6ba('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xf6ba('0x2')]},'dnid':{'type':Sequelize[_0xf6ba('0x2')]},'rdnis':{'type':Sequelize[_0xf6ba('0x2')]},'context':{'type':Sequelize[_0xf6ba('0x2')]},'extension':{'type':Sequelize[_0xf6ba('0x2')]},'priority':{'type':Sequelize[_0xf6ba('0x2')]},'enhanced':{'type':Sequelize[_0xf6ba('0x2')]},'accountcode':{'type':Sequelize[_0xf6ba('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xf6ba('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf6ba('0x3')]},'bot':{'type':Sequelize[_0xf6ba('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x8588=['STRING','DATE','exports'];(function(_0x3653c7,_0xadb356){var _0x58a021=function(_0x20b237){while(--_0x20b237){_0x3653c7['push'](_0x3653c7['shift']());}};_0x58a021(++_0xadb356);}(_0x8588,0x185));var _0x8858=function(_0x4f7cd5,_0x356d8d){_0x4f7cd5=_0x4f7cd5-0x0;var _0xc302c6=_0x8588[_0x4f7cd5];return _0xc302c6;};'use strict';var Sequelize=require('sequelize');module[_0x8858('0x0')]={'network':{'type':Sequelize[_0x8858('0x1')]},'network_script':{'type':Sequelize[_0x8858('0x1')]},'request':{'type':Sequelize[_0x8858('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8858('0x1')]},'type':{'type':Sequelize[_0x8858('0x1')]},'uniqueid':{'type':Sequelize[_0x8858('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8858('0x1')]},'calleridname':{'type':Sequelize[_0x8858('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x8858('0x1')]},'callington':{'type':Sequelize[_0x8858('0x1')]},'callingtns':{'type':Sequelize[_0x8858('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8858('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x8858('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x8858('0x1')]},'joinAt':{'type':Sequelize[_0x8858('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 6f7bbf5..735212b 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 _0x7bcd=['rows','catch','show','params','length','create','body','find','describe','eml-format','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','SquareReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll'];(function(_0x14f9b9,_0x102f56){var _0xab268f=function(_0x484fc1){while(--_0x484fc1){_0x14f9b9['push'](_0x14f9b9['shift']());}};_0xab268f(++_0x102f56);}(_0x7bcd,0xe4));var _0xd7bc=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0x7bcd[_0x4099ee];return _0x1b7bfc;};'use strict';var emlformat=require(_0xd7bc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd7bc('0x1'));var moment=require(_0xd7bc('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd7bc('0x3'));var util=require('util');var path=require(_0xd7bc('0x4'));var sox=require('sox');var csv=require(_0xd7bc('0x5'));var ejs=require(_0xd7bc('0x6'));var fs=require('fs');var fs_extra=require(_0xd7bc('0x7'));var _=require(_0xd7bc('0x8'));var squel=require(_0xd7bc('0x9'));var crypto=require(_0xd7bc('0xa'));var jsforce=require(_0xd7bc('0xb'));var deskjs=require(_0xd7bc('0xc'));var toCsv=require(_0xd7bc('0x5'));var querystring=require(_0xd7bc('0xd'));var Papa=require(_0xd7bc('0xe'));var Redis=require(_0xd7bc('0xf'));var authService=require(_0xd7bc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7bc('0x11'));var logger=require(_0xd7bc('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd7bc('0x13'));var licenseUtil=require(_0xd7bc('0x14'));var db=require(_0xd7bc('0x15'))['db'];function respondWithStatusCode(_0x2f48ee,_0x4ec1c2){_0x4ec1c2=_0x4ec1c2||0xcc;return function(_0x4f4d3e){if(_0x4f4d3e){return _0x2f48ee[_0xd7bc('0x16')](_0x4ec1c2);}return _0x2f48ee[_0xd7bc('0x17')](_0x4ec1c2)[_0xd7bc('0x18')]();};}function respondWithResult(_0x3234e1,_0x5bd729){_0x5bd729=_0x5bd729||0xc8;return function(_0x555352){if(_0x555352){return _0x3234e1['status'](_0x5bd729)[_0xd7bc('0x19')](_0x555352);}};}function respondWithFilteredResult(_0x35e7db,_0x5e9c20){return function(_0x45ed7d){if(_0x45ed7d){var _0x13b0c0=typeof _0x5e9c20[_0xd7bc('0x1a')]===_0xd7bc('0x1b')&&typeof _0x5e9c20[_0xd7bc('0x1c')]==='undefined';var _0x23dabb=_0x45ed7d[_0xd7bc('0x1d')];var _0x90eae6=_0x13b0c0?0x0:_0x5e9c20[_0xd7bc('0x1a')];var _0xb129d1=_0x13b0c0?_0x45ed7d[_0xd7bc('0x1d')]:_0x5e9c20[_0xd7bc('0x1a')]+_0x5e9c20[_0xd7bc('0x1c')];var _0x353fe7;if(_0xb129d1>=_0x23dabb){_0xb129d1=_0x23dabb;_0x353fe7=0xc8;}else{_0x353fe7=0xce;}_0x35e7db[_0xd7bc('0x17')](_0x353fe7);return _0x35e7db[_0xd7bc('0x1e')](_0xd7bc('0x1f'),_0x90eae6+'-'+_0xb129d1+'/'+_0x23dabb)[_0xd7bc('0x19')](_0x45ed7d);}return null;};}function patchUpdates(_0x5e9b83){return function(_0x266036){try{jsonpatch[_0xd7bc('0x20')](_0x266036,_0x5e9b83,!![]);}catch(_0x493d48){return BPromise['reject'](_0x493d48);}return _0x266036['save']();};}function saveUpdates(_0x3bee60,_0x46f899){return function(_0x8187cb){if(_0x8187cb){return _0x8187cb[_0xd7bc('0x21')](_0x3bee60)[_0xd7bc('0x22')](function(_0x2e5d79){return _0x2e5d79;});}return null;};}function removeEntity(_0x3a74c7,_0x175b6c){return function(_0x14bbd4){if(_0x14bbd4){return _0x14bbd4[_0xd7bc('0x23')]()['then'](function(){_0x3a74c7[_0xd7bc('0x17')](0xcc)[_0xd7bc('0x18')]();});}};}function handleEntityNotFound(_0x1ce99d,_0x163a89){return function(_0x5540a5){if(!_0x5540a5){_0x1ce99d[_0xd7bc('0x16')](0x194);}return _0x5540a5;};}function handleError(_0x15b0e5,_0x1501cc){_0x1501cc=_0x1501cc||0x1f4;return function(_0x1a11a2){logger[_0xd7bc('0x24')](_0x1a11a2[_0xd7bc('0x25')]);if(_0x1a11a2[_0xd7bc('0x26')]){delete _0x1a11a2[_0xd7bc('0x26')];}_0x15b0e5[_0xd7bc('0x17')](_0x1501cc)[_0xd7bc('0x27')](_0x1a11a2);};}exports[_0xd7bc('0x28')]=function(_0x48b7b5,_0x522736){var _0x189250={},_0x498b6b={},_0x2b95b3={'count':0x0,'rows':[]};var _0xaeca4d=_['map'](db[_0xd7bc('0x29')]['rawAttributes'],function(_0x916329){return{'name':_0x916329[_0xd7bc('0x2a')],'type':_0x916329['type'][_0xd7bc('0x2b')]};});_0x498b6b[_0xd7bc('0x2c')]=_[_0xd7bc('0x2d')](_0xaeca4d,_0xd7bc('0x26'));_0x498b6b[_0xd7bc('0x2e')]=_[_0xd7bc('0x2f')](_0x48b7b5[_0xd7bc('0x2e')]);_0x498b6b[_0xd7bc('0x30')]=_[_0xd7bc('0x31')](_0x498b6b[_0xd7bc('0x2c')],_0x498b6b[_0xd7bc('0x2e')]);_0x189250[_0xd7bc('0x32')]=_['intersection'](_0x498b6b['model'],qs[_0xd7bc('0x33')](_0x48b7b5[_0xd7bc('0x2e')][_0xd7bc('0x33')]));_0x189250['attributes']=_0x189250[_0xd7bc('0x32')]['length']?_0x189250[_0xd7bc('0x32')]:_0x498b6b['model'];if(!_0x48b7b5[_0xd7bc('0x2e')][_0xd7bc('0x34')](_0xd7bc('0x35'))){_0x189250[_0xd7bc('0x1c')]=qs['limit'](_0x48b7b5['query']['limit']);_0x189250[_0xd7bc('0x1a')]=qs[_0xd7bc('0x1a')](_0x48b7b5[_0xd7bc('0x2e')][_0xd7bc('0x1a')]);}_0x189250[_0xd7bc('0x36')]=qs['sort'](_0x48b7b5[_0xd7bc('0x2e')][_0xd7bc('0x37')]);_0x189250[_0xd7bc('0x38')]=qs['filters'](_[_0xd7bc('0x39')](_0x48b7b5[_0xd7bc('0x2e')],_0x498b6b[_0xd7bc('0x30')]),_0xaeca4d);if(_0x48b7b5[_0xd7bc('0x2e')][_0xd7bc('0x3a')]){_0x189250[_0xd7bc('0x38')]=_['merge'](_0x189250['where'],{'$or':_[_0xd7bc('0x2d')](_0xaeca4d,function(_0x5a7822){if(_0x5a7822['type']!==_0xd7bc('0x3b')){var _0x3756f8={};_0x3756f8[_0x5a7822['name']]={'$like':'%'+_0x48b7b5['query'][_0xd7bc('0x3a')]+'%'};return _0x3756f8;}})});}_0x189250=_[_0xd7bc('0x3c')]({},_0x189250,_0x48b7b5[_0xd7bc('0x3d')]);var _0x1e39c2={'where':_0x189250[_0xd7bc('0x38')]};return db[_0xd7bc('0x29')]['count'](_0x1e39c2)['then'](function(_0xab239){_0x2b95b3['count']=_0xab239;if(_0x48b7b5['query'][_0xd7bc('0x3e')]){_0x189250['include']=[{'all':!![]}];}return db['SquareReport'][_0xd7bc('0x3f')](_0x189250);})[_0xd7bc('0x22')](function(_0x512b05){_0x2b95b3[_0xd7bc('0x40')]=_0x512b05;return _0x2b95b3;})[_0xd7bc('0x22')](respondWithFilteredResult(_0x522736,_0x189250))[_0xd7bc('0x41')](handleError(_0x522736,null));};exports[_0xd7bc('0x42')]=function(_0x4c8ec9,_0x1485bc){var _0x3acde0={'raw':!![],'where':{'id':_0x4c8ec9[_0xd7bc('0x43')]['id']}},_0x125e54={};_0x125e54['model']=_[_0xd7bc('0x2f')](db[_0xd7bc('0x29')]['rawAttributes']);_0x125e54[_0xd7bc('0x2e')]=_[_0xd7bc('0x2f')](_0x4c8ec9[_0xd7bc('0x2e')]);_0x125e54['filters']=_[_0xd7bc('0x31')](_0x125e54[_0xd7bc('0x2c')],_0x125e54[_0xd7bc('0x2e')]);_0x3acde0[_0xd7bc('0x32')]=_[_0xd7bc('0x31')](_0x125e54[_0xd7bc('0x2c')],qs[_0xd7bc('0x33')](_0x4c8ec9['query'][_0xd7bc('0x33')]));_0x3acde0[_0xd7bc('0x32')]=_0x3acde0[_0xd7bc('0x32')][_0xd7bc('0x44')]?_0x3acde0[_0xd7bc('0x32')]:_0x125e54[_0xd7bc('0x2c')];if(_0x4c8ec9[_0xd7bc('0x2e')]['includeAll']){_0x3acde0['include']=[{'all':!![]}];}_0x3acde0=_[_0xd7bc('0x3c')]({},_0x3acde0,_0x4c8ec9[_0xd7bc('0x3d')]);return db[_0xd7bc('0x29')]['find'](_0x3acde0)[_0xd7bc('0x22')](handleEntityNotFound(_0x1485bc,null))[_0xd7bc('0x22')](respondWithResult(_0x1485bc,null))['catch'](handleError(_0x1485bc,null));};exports[_0xd7bc('0x45')]=function(_0x29ec0c,_0x4c9208){return db[_0xd7bc('0x29')][_0xd7bc('0x45')](_0x29ec0c[_0xd7bc('0x46')],{})[_0xd7bc('0x22')](respondWithResult(_0x4c9208,0xc9))[_0xd7bc('0x41')](handleError(_0x4c9208,null));};exports[_0xd7bc('0x21')]=function(_0x23b1df,_0x3ca733){if(_0x23b1df[_0xd7bc('0x46')]['id']){delete _0x23b1df[_0xd7bc('0x46')]['id'];}return db[_0xd7bc('0x29')]['find']({'where':{'id':_0x23b1df[_0xd7bc('0x43')]['id']}})[_0xd7bc('0x22')](handleEntityNotFound(_0x3ca733,null))[_0xd7bc('0x22')](saveUpdates(_0x23b1df['body'],null))[_0xd7bc('0x22')](respondWithResult(_0x3ca733,null))[_0xd7bc('0x41')](handleError(_0x3ca733,null));};exports['destroy']=function(_0x4590f9,_0x36f7db){return db[_0xd7bc('0x29')][_0xd7bc('0x47')]({'where':{'id':_0x4590f9[_0xd7bc('0x43')]['id']}})[_0xd7bc('0x22')](handleEntityNotFound(_0x36f7db,null))[_0xd7bc('0x22')](removeEntity(_0x36f7db,null))[_0xd7bc('0x41')](handleError(_0x36f7db,null));};exports[_0xd7bc('0x48')]=function(_0x62e7de,_0x48b9fb){return db[_0xd7bc('0x29')][_0xd7bc('0x48')]()['then'](respondWithResult(_0x48b9fb,null))[_0xd7bc('0x41')](handleError(_0x48b9fb,null));}; \ No newline at end of file +var _0x9d54=['set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','then','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x26da5e,_0x2f4830){var _0x19932c=function(_0x681c95){while(--_0x681c95){_0x26da5e['push'](_0x26da5e['shift']());}};_0x19932c(++_0x2f4830);}(_0x9d54,0x11a));var _0x49d5=function(_0x4f53d6,_0x406b82){_0x4f53d6=_0x4f53d6-0x0;var _0x2b2c2e=_0x9d54[_0x4f53d6];return _0x2b2c2e;};'use strict';var emlformat=require(_0x49d5('0x0'));var rimraf=require(_0x49d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x49d5('0x2'));var rp=require(_0x49d5('0x3'));var moment=require(_0x49d5('0x4'));var BPromise=require(_0x49d5('0x5'));var Mustache=require('mustache');var util=require(_0x49d5('0x6'));var path=require(_0x49d5('0x7'));var sox=require('sox');var csv=require(_0x49d5('0x8'));var ejs=require(_0x49d5('0x9'));var fs=require('fs');var fs_extra=require(_0x49d5('0xa'));var _=require(_0x49d5('0xb'));var squel=require(_0x49d5('0xc'));var crypto=require(_0x49d5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49d5('0x8'));var querystring=require('querystring');var Papa=require(_0x49d5('0xe'));var Redis=require(_0x49d5('0xf'));var authService=require(_0x49d5('0x10'));var qs=require(_0x49d5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49d5('0x12'));var logger=require('../../config/logger')(_0x49d5('0x13'));var utils=require(_0x49d5('0x14'));var config=require(_0x49d5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x49d5('0x16'))['db'];function respondWithStatusCode(_0x3eba46,_0x18f75d){_0x18f75d=_0x18f75d||0xcc;return function(_0x46a7af){if(_0x46a7af){return _0x3eba46[_0x49d5('0x17')](_0x18f75d);}return _0x3eba46[_0x49d5('0x18')](_0x18f75d)[_0x49d5('0x19')]();};}function respondWithResult(_0x3187fd,_0x1dab2d){_0x1dab2d=_0x1dab2d||0xc8;return function(_0x278deb){if(_0x278deb){return _0x3187fd[_0x49d5('0x18')](_0x1dab2d)[_0x49d5('0x1a')](_0x278deb);}};}function respondWithFilteredResult(_0x431a93,_0x516eaf){return function(_0x46c5b2){if(_0x46c5b2){var _0x3d6f6d=typeof _0x516eaf[_0x49d5('0x1b')]===_0x49d5('0x1c')&&typeof _0x516eaf[_0x49d5('0x1d')]===_0x49d5('0x1c');var _0x4b6275=_0x46c5b2['count'];var _0x2ab158=_0x3d6f6d?0x0:_0x516eaf[_0x49d5('0x1b')];var _0xee9731=_0x3d6f6d?_0x46c5b2['count']:_0x516eaf[_0x49d5('0x1b')]+_0x516eaf[_0x49d5('0x1d')];var _0x4d8111;if(_0xee9731>=_0x4b6275){_0xee9731=_0x4b6275;_0x4d8111=0xc8;}else{_0x4d8111=0xce;}_0x431a93[_0x49d5('0x18')](_0x4d8111);return _0x431a93[_0x49d5('0x1e')](_0x49d5('0x1f'),_0x2ab158+'-'+_0xee9731+'/'+_0x4b6275)[_0x49d5('0x1a')](_0x46c5b2);}return null;};}function patchUpdates(_0x2a056d){return function(_0x10f5c1){try{jsonpatch[_0x49d5('0x20')](_0x10f5c1,_0x2a056d,!![]);}catch(_0x91d61d){return BPromise[_0x49d5('0x21')](_0x91d61d);}return _0x10f5c1[_0x49d5('0x22')]();};}function saveUpdates(_0x4d502e,_0x3db692){return function(_0x329309){if(_0x329309){return _0x329309[_0x49d5('0x23')](_0x4d502e)['then'](function(_0x175fdb){return _0x175fdb;});}return null;};}function removeEntity(_0xa3501d,_0x48d60e){return function(_0x5972e4){if(_0x5972e4){return _0x5972e4[_0x49d5('0x24')]()['then'](function(){_0xa3501d[_0x49d5('0x18')](0xcc)[_0x49d5('0x19')]();});}};}function handleEntityNotFound(_0xe177dc,_0x132867){return function(_0x251dfe){if(!_0x251dfe){_0xe177dc[_0x49d5('0x17')](0x194);}return _0x251dfe;};}function handleError(_0x2ffcf7,_0x57532d){_0x57532d=_0x57532d||0x1f4;return function(_0x1c77e2){logger[_0x49d5('0x25')](_0x1c77e2[_0x49d5('0x26')]);if(_0x1c77e2[_0x49d5('0x27')]){delete _0x1c77e2['name'];}_0x2ffcf7['status'](_0x57532d)[_0x49d5('0x28')](_0x1c77e2);};}exports[_0x49d5('0x29')]=function(_0x3c9afd,_0x33f174){var _0x195c70={},_0x37b99d={},_0x251848={'count':0x0,'rows':[]};var _0xe6e44c=_[_0x49d5('0x2a')](db[_0x49d5('0x2b')][_0x49d5('0x2c')],function(_0x17a26f){return{'name':_0x17a26f[_0x49d5('0x2d')],'type':_0x17a26f[_0x49d5('0x2e')][_0x49d5('0x2f')]};});_0x37b99d[_0x49d5('0x30')]=_[_0x49d5('0x2a')](_0xe6e44c,'name');_0x37b99d[_0x49d5('0x31')]=_[_0x49d5('0x32')](_0x3c9afd['query']);_0x37b99d['filters']=_['intersection'](_0x37b99d[_0x49d5('0x30')],_0x37b99d[_0x49d5('0x31')]);_0x195c70['attributes']=_[_0x49d5('0x33')](_0x37b99d[_0x49d5('0x30')],qs[_0x49d5('0x34')](_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x34')]));_0x195c70['attributes']=_0x195c70[_0x49d5('0x35')]['length']?_0x195c70[_0x49d5('0x35')]:_0x37b99d[_0x49d5('0x30')];if(!_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x36')](_0x49d5('0x37'))){_0x195c70[_0x49d5('0x1d')]=qs[_0x49d5('0x1d')](_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x1d')]);_0x195c70[_0x49d5('0x1b')]=qs[_0x49d5('0x1b')](_0x3c9afd['query']['offset']);}_0x195c70[_0x49d5('0x38')]=qs[_0x49d5('0x39')](_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x39')]);_0x195c70[_0x49d5('0x3a')]=qs[_0x49d5('0x3b')](_[_0x49d5('0x3c')](_0x3c9afd[_0x49d5('0x31')],_0x37b99d[_0x49d5('0x3b')]),_0xe6e44c);if(_0x3c9afd[_0x49d5('0x31')]['filter']){_0x195c70[_0x49d5('0x3a')]=_['merge'](_0x195c70[_0x49d5('0x3a')],{'$or':_[_0x49d5('0x2a')](_0xe6e44c,function(_0x2ea141){if(_0x2ea141[_0x49d5('0x2e')]!=='VIRTUAL'){var _0x44dbad={};_0x44dbad[_0x2ea141[_0x49d5('0x27')]]={'$like':'%'+_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x3d')]+'%'};return _0x44dbad;}})});}_0x195c70=_[_0x49d5('0x3e')]({},_0x195c70,_0x3c9afd[_0x49d5('0x3f')]);var _0xdf3ca3={'where':_0x195c70[_0x49d5('0x3a')]};return db[_0x49d5('0x2b')][_0x49d5('0x40')](_0xdf3ca3)[_0x49d5('0x41')](function(_0x104dc8){_0x251848[_0x49d5('0x40')]=_0x104dc8;if(_0x3c9afd[_0x49d5('0x31')][_0x49d5('0x42')]){_0x195c70[_0x49d5('0x43')]=[{'all':!![]}];}return db[_0x49d5('0x2b')][_0x49d5('0x44')](_0x195c70);})['then'](function(_0x59cfdf){_0x251848[_0x49d5('0x45')]=_0x59cfdf;return _0x251848;})['then'](respondWithFilteredResult(_0x33f174,_0x195c70))[_0x49d5('0x46')](handleError(_0x33f174,null));};exports[_0x49d5('0x47')]=function(_0x17e025,_0x57d5fc){var _0x44424e={'raw':!![],'where':{'id':_0x17e025['params']['id']}},_0x9afab6={};_0x9afab6[_0x49d5('0x30')]=_[_0x49d5('0x32')](db['SquareReport']['rawAttributes']);_0x9afab6[_0x49d5('0x31')]=_[_0x49d5('0x32')](_0x17e025[_0x49d5('0x31')]);_0x9afab6[_0x49d5('0x3b')]=_[_0x49d5('0x33')](_0x9afab6[_0x49d5('0x30')],_0x9afab6[_0x49d5('0x31')]);_0x44424e[_0x49d5('0x35')]=_[_0x49d5('0x33')](_0x9afab6[_0x49d5('0x30')],qs[_0x49d5('0x34')](_0x17e025[_0x49d5('0x31')][_0x49d5('0x34')]));_0x44424e['attributes']=_0x44424e[_0x49d5('0x35')][_0x49d5('0x48')]?_0x44424e[_0x49d5('0x35')]:_0x9afab6[_0x49d5('0x30')];if(_0x17e025[_0x49d5('0x31')][_0x49d5('0x42')]){_0x44424e[_0x49d5('0x43')]=[{'all':!![]}];}_0x44424e=_[_0x49d5('0x3e')]({},_0x44424e,_0x17e025[_0x49d5('0x3f')]);return db[_0x49d5('0x2b')]['find'](_0x44424e)[_0x49d5('0x41')](handleEntityNotFound(_0x57d5fc,null))[_0x49d5('0x41')](respondWithResult(_0x57d5fc,null))[_0x49d5('0x46')](handleError(_0x57d5fc,null));};exports[_0x49d5('0x49')]=function(_0xaa6404,_0x3551d6){return db[_0x49d5('0x2b')][_0x49d5('0x49')](_0xaa6404[_0x49d5('0x4a')],{})['then'](respondWithResult(_0x3551d6,0xc9))[_0x49d5('0x46')](handleError(_0x3551d6,null));};exports[_0x49d5('0x23')]=function(_0x1daf4b,_0x2ea3c5){if(_0x1daf4b[_0x49d5('0x4a')]['id']){delete _0x1daf4b['body']['id'];}return db[_0x49d5('0x2b')][_0x49d5('0x4b')]({'where':{'id':_0x1daf4b['params']['id']}})[_0x49d5('0x41')](handleEntityNotFound(_0x2ea3c5,null))[_0x49d5('0x41')](saveUpdates(_0x1daf4b[_0x49d5('0x4a')],null))[_0x49d5('0x41')](respondWithResult(_0x2ea3c5,null))[_0x49d5('0x46')](handleError(_0x2ea3c5,null));};exports[_0x49d5('0x24')]=function(_0x2fa901,_0x4c5ef9){return db[_0x49d5('0x2b')][_0x49d5('0x4b')]({'where':{'id':_0x2fa901[_0x49d5('0x4c')]['id']}})[_0x49d5('0x41')](handleEntityNotFound(_0x4c5ef9,null))[_0x49d5('0x41')](removeEntity(_0x4c5ef9,null))['catch'](handleError(_0x4c5ef9,null));};exports[_0x49d5('0x4d')]=function(_0x152eff,_0x2d6d26){return db[_0x49d5('0x2b')]['describe']()[_0x49d5('0x41')](respondWithResult(_0x2d6d26,null))[_0x49d5('0x46')](handleError(_0x2d6d26,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 46ae692..4e735d9 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 _0x1bf3=['uid_pname','uniqueid','project_name','leaveAt','lodash','api','../../config/environment','./squareReport.attributes','define','SquareReport'];(function(_0x1762e8,_0x306a99){var _0x32b3ca=function(_0x43d708){while(--_0x43d708){_0x1762e8['push'](_0x1762e8['shift']());}};_0x32b3ca(++_0x306a99);}(_0x1bf3,0x1b2));var _0x31bf=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1bf3[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x31bf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x31bf('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('rimraf');var config=require(_0x31bf('0x2'));var attributes=require(_0x31bf('0x3'));module['exports']=function(_0x29c560,_0x160a0f){return _0x29c560[_0x31bf('0x4')](_0x31bf('0x5'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x31bf('0x6'),'fields':[_0x31bf('0x7'),_0x31bf('0x8')]},{'name':_0x31bf('0x9'),'fields':[_0x31bf('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc2e=['api','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','uid_pname','uniqueid','project_name','leaveAt','util'];(function(_0x4be669,_0x28a697){var _0x2e1141=function(_0x35b7de){while(--_0x35b7de){_0x4be669['push'](_0x4be669['shift']());}};_0x2e1141(++_0x28a697);}(_0xfc2e,0xdf));var _0xefc2=function(_0x290675,_0xe20764){_0x290675=_0x290675-0x0;var _0x56758d=_0xfc2e[_0x290675];return _0x56758d;};'use strict';var _=require('lodash');var util=require(_0xefc2('0x0'));var logger=require('../../config/logger')(_0xefc2('0x1'));var moment=require(_0xefc2('0x2'));var BPromise=require(_0xefc2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefc2('0x4'));var rimraf=require(_0xefc2('0x5'));var config=require(_0xefc2('0x6'));var attributes=require(_0xefc2('0x7'));module[_0xefc2('0x8')]=function(_0x4285e6,_0x4b1c62){return _0x4285e6[_0xefc2('0x9')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xefc2('0xa'),'fields':[_0xefc2('0xb'),_0xefc2('0xc')]},{'name':_0xefc2('0xd'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index e0cc160..4400c00 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 _0x1874=['SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreateSquareReport','SquareReport','create','options','raw','catch','UpdateSquareReport','update','body','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x7400cd,_0x38906e){var _0x377202=function(_0x9b6ca7){while(--_0x9b6ca7){_0x7400cd['push'](_0x7400cd['shift']());}};_0x377202(++_0x38906e);}(_0x1874,0x147));var _0x4187=function(_0x9fdfdf,_0x48220f){_0x9fdfdf=_0x9fdfdf-0x0;var _0x5d51c8=_0x1874[_0x9fdfdf];return _0x5d51c8;};'use strict';var _=require('lodash');var util=require(_0x4187('0x0'));var moment=require(_0x4187('0x1'));var BPromise=require('bluebird');var rs=require(_0x4187('0x2'));var fs=require('fs');var Redis=require(_0x4187('0x3'));var db=require(_0x4187('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4187('0x5'))(_0x4187('0x6'));var config=require('../../config/environment');var jayson=require(_0x4187('0x7'));var client=jayson[_0x4187('0x8')][_0x4187('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e1f4e,_0x1d03e5,_0x13eaa3){return new BPromise(function(_0x30c132,_0x1e6bef){return client[_0x4187('0xa')](_0x1e1f4e,_0x13eaa3)[_0x4187('0xb')](function(_0x43bc20){logger[_0x4187('0xc')](_0x4187('0xd'),_0x1d03e5,'request\x20sent');logger[_0x4187('0xe')](_0x4187('0xf'),_0x1d03e5,'request\x20sent',JSON[_0x4187('0x10')](_0x43bc20));if(_0x43bc20['error']){if(_0x43bc20[_0x4187('0x11')][_0x4187('0x12')]===0x1f4){logger[_0x4187('0x11')]('SquareReport,\x20%s,\x20%s',_0x1d03e5,_0x43bc20[_0x4187('0x11')]['message']);return _0x1e6bef(_0x43bc20[_0x4187('0x11')][_0x4187('0x13')]);}logger[_0x4187('0x11')]('SquareReport,\x20%s,\x20%s',_0x1d03e5,_0x43bc20[_0x4187('0x11')][_0x4187('0x13')]);return _0x30c132(_0x43bc20['error'][_0x4187('0x13')]);}else{logger[_0x4187('0xc')](_0x4187('0xd'),_0x1d03e5,_0x4187('0x14'));_0x30c132(_0x43bc20[_0x4187('0x15')][_0x4187('0x13')]);}})['catch'](function(_0x255fcb){logger[_0x4187('0x11')](_0x4187('0xd'),_0x1d03e5,_0x255fcb);_0x1e6bef(_0x255fcb);});});}exports[_0x4187('0x16')]=function(_0x363a07){var _0x14e4fa=this;return new Promise(function(_0x2705b0,_0x4b5013){return db[_0x4187('0x17')][_0x4187('0x18')](_0x363a07['body'],{'raw':_0x363a07[_0x4187('0x19')]?_0x363a07[_0x4187('0x19')][_0x4187('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x139c30){logger[_0x4187('0xc')](_0x4187('0x16'),_0x363a07);logger[_0x4187('0xe')](_0x4187('0x16'),_0x363a07,JSON[_0x4187('0x10')](_0x139c30));_0x2705b0(_0x139c30);})[_0x4187('0x1b')](function(_0x2e16d6){logger[_0x4187('0x11')](_0x4187('0x16'),_0x2e16d6[_0x4187('0x13')],_0x363a07);_0x4b5013(_0x14e4fa[_0x4187('0x11')](0x1f4,_0x2e16d6[_0x4187('0x13')]));});});};exports[_0x4187('0x1c')]=function(_0x495617){var _0x4c0aa2=this;return new Promise(function(_0x521c09,_0x3b2a1a){return db['SquareReport'][_0x4187('0x1d')](_0x495617[_0x4187('0x1e')],{'raw':_0x495617['options']?_0x495617[_0x4187('0x19')][_0x4187('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x495617['options']?_0x495617['options'][_0x4187('0x1f')]||null:null,'attributes':_0x495617[_0x4187('0x19')]?_0x495617[_0x4187('0x19')][_0x4187('0x20')]||null:null,'limit':_0x495617[_0x4187('0x19')]?_0x495617[_0x4187('0x19')][_0x4187('0x21')]||null:null})[_0x4187('0xb')](function(_0x188fa4){logger[_0x4187('0xc')](_0x4187('0x1c'),_0x495617);logger[_0x4187('0xe')](_0x4187('0x1c'),_0x495617,JSON[_0x4187('0x10')](_0x188fa4));_0x521c09(_0x188fa4);})[_0x4187('0x1b')](function(_0x3a1298){logger['error']('UpdateSquareReport',_0x3a1298['message'],_0x495617);_0x3b2a1a(_0x4c0aa2['error'](0x1f4,_0x3a1298['message']));});});}; \ No newline at end of file +var _0xe58e=['client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareReport','create','options','raw','info','debug','SquareReport','body','attributes','limit','UpdateSquareReport','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3e668e,_0x18b3f7){var _0x3a1d60=function(_0x58e0f8){while(--_0x58e0f8){_0x3e668e['push'](_0x3e668e['shift']());}};_0x3a1d60(++_0x18b3f7);}(_0xe58e,0x10e));var _0xee58=function(_0x10d852,_0x3110e8){_0x10d852=_0x10d852-0x0;var _0x3f7e90=_0xe58e[_0x10d852];return _0x3f7e90;};'use strict';var _=require(_0xee58('0x0'));var util=require(_0xee58('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xee58('0x2'));var fs=require('fs');var Redis=require(_0xee58('0x3'));var db=require(_0xee58('0x4'))['db'];var utils=require(_0xee58('0x5'));var logger=require(_0xee58('0x6'))(_0xee58('0x7'));var config=require(_0xee58('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xee58('0x9')][_0xee58('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47eb60,_0x30c654,_0x450743){return new BPromise(function(_0x74e955,_0xaacdfe){return client[_0xee58('0xb')](_0x47eb60,_0x450743)[_0xee58('0xc')](function(_0x4e5c1d){logger['info'](_0xee58('0xd'),_0x30c654,_0xee58('0xe'));logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x30c654,'request\x20sent',JSON[_0xee58('0xf')](_0x4e5c1d));if(_0x4e5c1d[_0xee58('0x10')]){if(_0x4e5c1d[_0xee58('0x10')]['code']===0x1f4){logger[_0xee58('0x10')](_0xee58('0xd'),_0x30c654,_0x4e5c1d['error'][_0xee58('0x11')]);return _0xaacdfe(_0x4e5c1d['error']['message']);}logger['error'](_0xee58('0xd'),_0x30c654,_0x4e5c1d['error']['message']);return _0x74e955(_0x4e5c1d[_0xee58('0x10')][_0xee58('0x11')]);}else{logger['info'](_0xee58('0xd'),_0x30c654,_0xee58('0xe'));_0x74e955(_0x4e5c1d[_0xee58('0x12')][_0xee58('0x11')]);}})['catch'](function(_0x3b7418){logger[_0xee58('0x10')](_0xee58('0xd'),_0x30c654,_0x3b7418);_0xaacdfe(_0x3b7418);});});}exports[_0xee58('0x13')]=function(_0x2d512d){var _0x47e0c5=this;return new Promise(function(_0x4c9d18,_0x18e035){return db['SquareReport'][_0xee58('0x14')](_0x2d512d['body'],{'raw':_0x2d512d[_0xee58('0x15')]?_0x2d512d[_0xee58('0x15')][_0xee58('0x16')]===undefined?!![]:![]:!![]})[_0xee58('0xc')](function(_0x200e9e){logger[_0xee58('0x17')](_0xee58('0x13'),_0x2d512d);logger[_0xee58('0x18')](_0xee58('0x13'),_0x2d512d,JSON[_0xee58('0xf')](_0x200e9e));_0x4c9d18(_0x200e9e);})['catch'](function(_0x46ab6a){logger['error'](_0xee58('0x13'),_0x46ab6a[_0xee58('0x11')],_0x2d512d);_0x18e035(_0x47e0c5[_0xee58('0x10')](0x1f4,_0x46ab6a[_0xee58('0x11')]));});});};exports['UpdateSquareReport']=function(_0x1c5338){var _0x100347=this;return new Promise(function(_0x3aab9f,_0x3f2807){return db[_0xee58('0x19')]['update'](_0x1c5338[_0xee58('0x1a')],{'raw':_0x1c5338['options']?_0x1c5338['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c5338[_0xee58('0x15')]?_0x1c5338[_0xee58('0x15')]['where']||null:null,'attributes':_0x1c5338[_0xee58('0x15')]?_0x1c5338['options'][_0xee58('0x1b')]||null:null,'limit':_0x1c5338[_0xee58('0x15')]?_0x1c5338[_0xee58('0x15')][_0xee58('0x1c')]||null:null})['then'](function(_0x448781){logger['info'](_0xee58('0x1d'),_0x1c5338);logger['debug']('UpdateSquareReport',_0x1c5338,JSON[_0xee58('0xf')](_0x448781));_0x3aab9f(_0x448781);})[_0xee58('0x1e')](function(_0x896da9){logger[_0xee58('0x10')](_0xee58('0x1d'),_0x896da9[_0xee58('0x11')],_0x1c5338);_0x3f2807(_0x100347[_0xee58('0x10')](0x1f4,_0x896da9[_0xee58('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 76e8f45..8539fd9 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 _0x2946=['connect-timeout','express','fs-extra','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0x4bf215,_0x5a5558){var _0x549175=function(_0x5e070f){while(--_0x5e070f){_0x4bf215['push'](_0x4bf215['shift']());}};_0x549175(++_0x5a5558);}(_0x2946,0x11b));var _0x6294=function(_0x62d6d6,_0x3bc879){_0x62d6d6=_0x62d6d6-0x0;var _0x565812=_0x2946[_0x62d6d6];return _0x565812;};'use strict';var multer=require(_0x6294('0x0'));var util=require(_0x6294('0x1'));var path=require('path');var timeout=require(_0x6294('0x2'));var express=require(_0x6294('0x3'));var router=express['Router']();var fs_extra=require(_0x6294('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6294('0x5'));var controller=require(_0x6294('0x6'));router[_0x6294('0x7')]('/',auth[_0x6294('0x8')](),controller[_0x6294('0x9')]);router[_0x6294('0x7')](_0x6294('0xa'),auth['isAuthenticated'](),controller[_0x6294('0xb')]);router[_0x6294('0x7')](_0x6294('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6294('0xd')]('/',auth[_0x6294('0x8')](),controller[_0x6294('0xe')]);router[_0x6294('0xf')](_0x6294('0xc'),auth[_0x6294('0x8')](),controller[_0x6294('0x10')]);router['delete'](_0x6294('0xc'),auth[_0x6294('0x8')](),controller[_0x6294('0x11')]);module[_0x6294('0x12')]=router; \ No newline at end of file +var _0xf5bc=['index','post','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5bc,0x103));var _0xcf5b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf5bc[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xcf5b('0x0'));var util=require(_0xcf5b('0x1'));var path=require(_0xcf5b('0x2'));var timeout=require(_0xcf5b('0x3'));var express=require(_0xcf5b('0x4'));var router=express['Router']();var fs_extra=require(_0xcf5b('0x5'));var auth=require(_0xcf5b('0x6'));var interaction=require(_0xcf5b('0x7'));var config=require('../../config/environment');var controller=require(_0xcf5b('0x8'));router[_0xcf5b('0x9')]('/',auth[_0xcf5b('0xa')](),controller[_0xcf5b('0xb')]);router[_0xcf5b('0x9')]('/describe',auth[_0xcf5b('0xa')](),controller['describe']);router[_0xcf5b('0x9')]('/:id',auth[_0xcf5b('0xa')](),controller['show']);router[_0xcf5b('0xc')]('/',auth[_0xcf5b('0xa')](),controller[_0xcf5b('0xd')]);router['put'](_0xcf5b('0xe'),auth['isAuthenticated'](),controller[_0xcf5b('0xf')]);router[_0xcf5b('0x10')](_0xcf5b('0xe'),auth[_0xcf5b('0xa')](),controller['destroy']);module[_0xcf5b('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index da00e3c..f4fdd62 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 _0x21f0=['TEXT','exports','STRING'];(function(_0x2f4f89,_0x304a47){var _0x1aa072=function(_0x554a22){while(--_0x554a22){_0x2f4f89['push'](_0x2f4f89['shift']());}};_0x1aa072(++_0x304a47);}(_0x21f0,0xc4));var _0x021f=function(_0x634ee1,_0x3130ee){_0x634ee1=_0x634ee1-0x0;var _0x534c67=_0x21f0[_0x634ee1];return _0x534c67;};'use strict';var Sequelize=require('sequelize');module[_0x021f('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x021f('0x1')]},'application':{'type':Sequelize[_0x021f('0x1')]},'data':{'type':Sequelize[_0x021f('0x2')]},'project_name':{'type':Sequelize[_0x021f('0x1')]},'callerid':{'type':Sequelize[_0x021f('0x1')]}}; \ No newline at end of file +var _0xc357=['STRING','TEXT','exports'];(function(_0x19ca08,_0x59e626){var _0x11b9b7=function(_0xbcfe85){while(--_0xbcfe85){_0x19ca08['push'](_0x19ca08['shift']());}};_0x11b9b7(++_0x59e626);}(_0xc357,0x83));var _0x7c35=function(_0x236848,_0x302e7f){_0x236848=_0x236848-0x0;var _0x4de889=_0xc357[_0x236848];return _0x4de889;};'use strict';var Sequelize=require('sequelize');module[_0x7c35('0x0')]={'uniqueid':{'type':Sequelize[_0x7c35('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x7c35('0x1')]},'data':{'type':Sequelize[_0x7c35('0x2')]},'project_name':{'type':Sequelize[_0x7c35('0x1')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index ed5b7b3..79d36e6 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 _0xeb56=['findAll','rows','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','SquareDetailsReport','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include'];(function(_0x286227,_0x1a2719){var _0x2a0323=function(_0x2f37d2){while(--_0x2f37d2){_0x286227['push'](_0x286227['shift']());}};_0x2a0323(++_0x1a2719);}(_0xeb56,0x185));var _0x6eb5=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xeb56[_0xdeefbd];return _0x4ff63f;};'use strict';var emlformat=require(_0x6eb5('0x0'));var rimraf=require(_0x6eb5('0x1'));var zipdir=require(_0x6eb5('0x2'));var jsonpatch=require(_0x6eb5('0x3'));var rp=require('request-promise');var moment=require(_0x6eb5('0x4'));var BPromise=require(_0x6eb5('0x5'));var Mustache=require(_0x6eb5('0x6'));var util=require(_0x6eb5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6eb5('0x8'));var _=require(_0x6eb5('0x9'));var squel=require(_0x6eb5('0xa'));var crypto=require(_0x6eb5('0xb'));var jsforce=require(_0x6eb5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6eb5('0xd'));var querystring=require(_0x6eb5('0xe'));var Papa=require(_0x6eb5('0xf'));var Redis=require(_0x6eb5('0x10'));var authService=require(_0x6eb5('0x11'));var qs=require(_0x6eb5('0x12'));var as=require(_0x6eb5('0x13'));var hardwareService=require(_0x6eb5('0x14'));var logger=require(_0x6eb5('0x15'))(_0x6eb5('0x16'));var utils=require(_0x6eb5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x6eb5('0x18'));var db=require(_0x6eb5('0x19'))['db'];function respondWithStatusCode(_0x27420c,_0x52d2cf){_0x52d2cf=_0x52d2cf||0xcc;return function(_0x30ec58){if(_0x30ec58){return _0x27420c[_0x6eb5('0x1a')](_0x52d2cf);}return _0x27420c[_0x6eb5('0x1b')](_0x52d2cf)[_0x6eb5('0x1c')]();};}function respondWithResult(_0x54eb5f,_0x5d0298){_0x5d0298=_0x5d0298||0xc8;return function(_0x36e359){if(_0x36e359){return _0x54eb5f[_0x6eb5('0x1b')](_0x5d0298)[_0x6eb5('0x1d')](_0x36e359);}};}function respondWithFilteredResult(_0x5b8582,_0x5202c7){return function(_0x205ca2){if(_0x205ca2){var _0x3080be=typeof _0x5202c7[_0x6eb5('0x1e')]==='undefined'&&typeof _0x5202c7[_0x6eb5('0x1f')]===_0x6eb5('0x20');var _0x1c38ad=_0x205ca2[_0x6eb5('0x21')];var _0x454d85=_0x3080be?0x0:_0x5202c7[_0x6eb5('0x1e')];var _0x4acff9=_0x3080be?_0x205ca2[_0x6eb5('0x21')]:_0x5202c7['offset']+_0x5202c7[_0x6eb5('0x1f')];var _0x5f1335;if(_0x4acff9>=_0x1c38ad){_0x4acff9=_0x1c38ad;_0x5f1335=0xc8;}else{_0x5f1335=0xce;}_0x5b8582[_0x6eb5('0x1b')](_0x5f1335);return _0x5b8582[_0x6eb5('0x22')](_0x6eb5('0x23'),_0x454d85+'-'+_0x4acff9+'/'+_0x1c38ad)[_0x6eb5('0x1d')](_0x205ca2);}return null;};}function patchUpdates(_0x467a16){return function(_0x48df46){try{jsonpatch[_0x6eb5('0x24')](_0x48df46,_0x467a16,!![]);}catch(_0x3e8092){return BPromise[_0x6eb5('0x25')](_0x3e8092);}return _0x48df46[_0x6eb5('0x26')]();};}function saveUpdates(_0x3847c4,_0x23bcc9){return function(_0x26f3d3){if(_0x26f3d3){return _0x26f3d3[_0x6eb5('0x27')](_0x3847c4)[_0x6eb5('0x28')](function(_0x1f2f0f){return _0x1f2f0f;});}return null;};}function removeEntity(_0x93a47b,_0x57ecbb){return function(_0x2dbccc){if(_0x2dbccc){return _0x2dbccc[_0x6eb5('0x29')]()[_0x6eb5('0x28')](function(){_0x93a47b[_0x6eb5('0x1b')](0xcc)[_0x6eb5('0x1c')]();});}};}function handleEntityNotFound(_0x5332ea,_0x45441b){return function(_0x3a5c96){if(!_0x3a5c96){_0x5332ea[_0x6eb5('0x1a')](0x194);}return _0x3a5c96;};}function handleError(_0x5abd65,_0x11c6be){_0x11c6be=_0x11c6be||0x1f4;return function(_0x10cbf9){logger[_0x6eb5('0x2a')](_0x10cbf9['stack']);if(_0x10cbf9[_0x6eb5('0x2b')]){delete _0x10cbf9[_0x6eb5('0x2b')];}_0x5abd65['status'](_0x11c6be)['send'](_0x10cbf9);};}exports[_0x6eb5('0x2c')]=function(_0x3099ec,_0x2c1f0c){var _0x886a21={},_0x48dfdc={},_0x12305a={'count':0x0,'rows':[]};var _0x423804=_['map'](db[_0x6eb5('0x2d')][_0x6eb5('0x2e')],function(_0x37547f){return{'name':_0x37547f['fieldName'],'type':_0x37547f[_0x6eb5('0x2f')][_0x6eb5('0x30')]};});_0x48dfdc[_0x6eb5('0x31')]=_[_0x6eb5('0x32')](_0x423804,_0x6eb5('0x2b'));_0x48dfdc['query']=_[_0x6eb5('0x33')](_0x3099ec[_0x6eb5('0x34')]);_0x48dfdc[_0x6eb5('0x35')]=_[_0x6eb5('0x36')](_0x48dfdc[_0x6eb5('0x31')],_0x48dfdc['query']);_0x886a21['attributes']=_['intersection'](_0x48dfdc[_0x6eb5('0x31')],qs['fields'](_0x3099ec[_0x6eb5('0x34')][_0x6eb5('0x37')]));_0x886a21[_0x6eb5('0x38')]=_0x886a21[_0x6eb5('0x38')][_0x6eb5('0x39')]?_0x886a21[_0x6eb5('0x38')]:_0x48dfdc['model'];if(!_0x3099ec[_0x6eb5('0x34')]['hasOwnProperty']('nolimit')){_0x886a21[_0x6eb5('0x1f')]=qs[_0x6eb5('0x1f')](_0x3099ec['query'][_0x6eb5('0x1f')]);_0x886a21['offset']=qs[_0x6eb5('0x1e')](_0x3099ec[_0x6eb5('0x34')][_0x6eb5('0x1e')]);}_0x886a21[_0x6eb5('0x3a')]=qs[_0x6eb5('0x3b')](_0x3099ec[_0x6eb5('0x34')][_0x6eb5('0x3b')]);_0x886a21[_0x6eb5('0x3c')]=qs[_0x6eb5('0x35')](_[_0x6eb5('0x3d')](_0x3099ec['query'],_0x48dfdc['filters']),_0x423804);if(_0x3099ec['query'][_0x6eb5('0x3e')]){_0x886a21[_0x6eb5('0x3c')]=_[_0x6eb5('0x3f')](_0x886a21[_0x6eb5('0x3c')],{'$or':_[_0x6eb5('0x32')](_0x423804,function(_0x3604bb){if(_0x3604bb[_0x6eb5('0x2f')]!==_0x6eb5('0x40')){var _0x5968c8={};_0x5968c8[_0x3604bb[_0x6eb5('0x2b')]]={'$like':'%'+_0x3099ec[_0x6eb5('0x34')][_0x6eb5('0x3e')]+'%'};return _0x5968c8;}})});}_0x886a21=_[_0x6eb5('0x3f')]({},_0x886a21,_0x3099ec['options']);var _0x3c17f0={'where':_0x886a21[_0x6eb5('0x3c')]};return db[_0x6eb5('0x2d')][_0x6eb5('0x21')](_0x3c17f0)['then'](function(_0x1734eb){_0x12305a[_0x6eb5('0x21')]=_0x1734eb;if(_0x3099ec[_0x6eb5('0x34')][_0x6eb5('0x41')]){_0x886a21[_0x6eb5('0x42')]=[{'all':!![]}];}return db[_0x6eb5('0x2d')][_0x6eb5('0x43')](_0x886a21);})[_0x6eb5('0x28')](function(_0x19c3b3){_0x12305a[_0x6eb5('0x44')]=_0x19c3b3;return _0x12305a;})[_0x6eb5('0x28')](respondWithFilteredResult(_0x2c1f0c,_0x886a21))['catch'](handleError(_0x2c1f0c,null));};exports['show']=function(_0x1e7a1b,_0x2a3dfc){var _0x382221={'raw':!![],'where':{'id':_0x1e7a1b[_0x6eb5('0x45')]['id']}},_0x2e0368={};_0x2e0368[_0x6eb5('0x31')]=_['keys'](db[_0x6eb5('0x2d')][_0x6eb5('0x2e')]);_0x2e0368[_0x6eb5('0x34')]=_['keys'](_0x1e7a1b['query']);_0x2e0368['filters']=_[_0x6eb5('0x36')](_0x2e0368[_0x6eb5('0x31')],_0x2e0368[_0x6eb5('0x34')]);_0x382221['attributes']=_[_0x6eb5('0x36')](_0x2e0368['model'],qs[_0x6eb5('0x37')](_0x1e7a1b[_0x6eb5('0x34')][_0x6eb5('0x37')]));_0x382221[_0x6eb5('0x38')]=_0x382221['attributes'][_0x6eb5('0x39')]?_0x382221['attributes']:_0x2e0368[_0x6eb5('0x31')];if(_0x1e7a1b[_0x6eb5('0x34')]['includeAll']){_0x382221[_0x6eb5('0x42')]=[{'all':!![]}];}_0x382221=_['merge']({},_0x382221,_0x1e7a1b[_0x6eb5('0x46')]);return db[_0x6eb5('0x2d')][_0x6eb5('0x47')](_0x382221)[_0x6eb5('0x28')](handleEntityNotFound(_0x2a3dfc,null))[_0x6eb5('0x28')](respondWithResult(_0x2a3dfc,null))[_0x6eb5('0x48')](handleError(_0x2a3dfc,null));};exports['create']=function(_0x5c04df,_0x465fd8){return db[_0x6eb5('0x2d')][_0x6eb5('0x49')](_0x5c04df[_0x6eb5('0x4a')],{})[_0x6eb5('0x28')](respondWithResult(_0x465fd8,0xc9))[_0x6eb5('0x48')](handleError(_0x465fd8,null));};exports['update']=function(_0x5ca1eb,_0x9aca84){if(_0x5ca1eb[_0x6eb5('0x4a')]['id']){delete _0x5ca1eb[_0x6eb5('0x4a')]['id'];}return db[_0x6eb5('0x2d')][_0x6eb5('0x47')]({'where':{'id':_0x5ca1eb['params']['id']}})['then'](handleEntityNotFound(_0x9aca84,null))[_0x6eb5('0x28')](saveUpdates(_0x5ca1eb['body'],null))[_0x6eb5('0x28')](respondWithResult(_0x9aca84,null))[_0x6eb5('0x48')](handleError(_0x9aca84,null));};exports[_0x6eb5('0x29')]=function(_0x515f46,_0x7b710f){return db['SquareDetailsReport'][_0x6eb5('0x47')]({'where':{'id':_0x515f46['params']['id']}})[_0x6eb5('0x28')](handleEntityNotFound(_0x7b710f,null))[_0x6eb5('0x28')](removeEntity(_0x7b710f,null))[_0x6eb5('0x48')](handleError(_0x7b710f,null));};exports[_0x6eb5('0x4b')]=function(_0x72178a,_0x2dcfda){return db[_0x6eb5('0x2d')][_0x6eb5('0x4b')]()[_0x6eb5('0x28')](respondWithResult(_0x2dcfda,null))[_0x6eb5('0x48')](handleError(_0x2dcfda,null));}; \ No newline at end of file +var _0x9ad4=['SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','where','filters','filter','merge','VIRTUAL','findAll','rows','catch','show','params','include','options','create','update','body','find','describe','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','map'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0x9ad4,0x187));var _0x49ad=function(_0x1ad0b4,_0x3638f4){_0x1ad0b4=_0x1ad0b4-0x0;var _0x42f563=_0x9ad4[_0x1ad0b4];return _0x42f563;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x49ad('0x0'));var zipdir=require(_0x49ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x49ad('0x2'));var moment=require(_0x49ad('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x49ad('0x4'));var util=require(_0x49ad('0x5'));var path=require('path');var sox=require(_0x49ad('0x6'));var csv=require(_0x49ad('0x7'));var ejs=require(_0x49ad('0x8'));var fs=require('fs');var fs_extra=require(_0x49ad('0x9'));var _=require(_0x49ad('0xa'));var squel=require(_0x49ad('0xb'));var crypto=require(_0x49ad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x49ad('0xd'));var toCsv=require(_0x49ad('0x7'));var querystring=require(_0x49ad('0xe'));var Papa=require(_0x49ad('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x49ad('0x10'));var hardwareService=require(_0x49ad('0x11'));var logger=require(_0x49ad('0x12'))(_0x49ad('0x13'));var utils=require('../../config/utils');var config=require(_0x49ad('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x49ad('0x15'))['db'];function respondWithStatusCode(_0x465e31,_0x9e599c){_0x9e599c=_0x9e599c||0xcc;return function(_0x5653ba){if(_0x5653ba){return _0x465e31[_0x49ad('0x16')](_0x9e599c);}return _0x465e31[_0x49ad('0x17')](_0x9e599c)[_0x49ad('0x18')]();};}function respondWithResult(_0x40aefb,_0x1cd418){_0x1cd418=_0x1cd418||0xc8;return function(_0x484516){if(_0x484516){return _0x40aefb[_0x49ad('0x17')](_0x1cd418)[_0x49ad('0x19')](_0x484516);}};}function respondWithFilteredResult(_0x23811a,_0x1ec1ef){return function(_0x14e3ed){if(_0x14e3ed){var _0x43efc2=typeof _0x1ec1ef[_0x49ad('0x1a')]===_0x49ad('0x1b')&&typeof _0x1ec1ef[_0x49ad('0x1c')]===_0x49ad('0x1b');var _0xfef749=_0x14e3ed[_0x49ad('0x1d')];var _0x278b2f=_0x43efc2?0x0:_0x1ec1ef['offset'];var _0x634fa3=_0x43efc2?_0x14e3ed['count']:_0x1ec1ef[_0x49ad('0x1a')]+_0x1ec1ef['limit'];var _0x2560ae;if(_0x634fa3>=_0xfef749){_0x634fa3=_0xfef749;_0x2560ae=0xc8;}else{_0x2560ae=0xce;}_0x23811a['status'](_0x2560ae);return _0x23811a[_0x49ad('0x1e')](_0x49ad('0x1f'),_0x278b2f+'-'+_0x634fa3+'/'+_0xfef749)[_0x49ad('0x19')](_0x14e3ed);}return null;};}function patchUpdates(_0x48d6ee){return function(_0xc87615){try{jsonpatch['apply'](_0xc87615,_0x48d6ee,!![]);}catch(_0x1accbb){return BPromise[_0x49ad('0x20')](_0x1accbb);}return _0xc87615[_0x49ad('0x21')]();};}function saveUpdates(_0x21424a,_0x16a23f){return function(_0x19d1c3){if(_0x19d1c3){return _0x19d1c3['update'](_0x21424a)[_0x49ad('0x22')](function(_0x1fb567){return _0x1fb567;});}return null;};}function removeEntity(_0x698be8,_0x1f81e1){return function(_0x54d0da){if(_0x54d0da){return _0x54d0da[_0x49ad('0x23')]()['then'](function(){_0x698be8[_0x49ad('0x17')](0xcc)[_0x49ad('0x18')]();});}};}function handleEntityNotFound(_0x125d2b,_0x5a9f26){return function(_0x5ae671){if(!_0x5ae671){_0x125d2b[_0x49ad('0x16')](0x194);}return _0x5ae671;};}function handleError(_0x3e4dca,_0x2ec6b6){_0x2ec6b6=_0x2ec6b6||0x1f4;return function(_0x2d383d){logger[_0x49ad('0x24')](_0x2d383d['stack']);if(_0x2d383d[_0x49ad('0x25')]){delete _0x2d383d[_0x49ad('0x25')];}_0x3e4dca[_0x49ad('0x17')](_0x2ec6b6)[_0x49ad('0x26')](_0x2d383d);};}exports[_0x49ad('0x27')]=function(_0x37965a,_0x3f26b5){var _0x13270f={},_0x50e5ff={},_0x162a65={'count':0x0,'rows':[]};var _0x19bdb6=_[_0x49ad('0x28')](db[_0x49ad('0x29')][_0x49ad('0x2a')],function(_0x348343){return{'name':_0x348343[_0x49ad('0x2b')],'type':_0x348343[_0x49ad('0x2c')][_0x49ad('0x2d')]};});_0x50e5ff[_0x49ad('0x2e')]=_[_0x49ad('0x28')](_0x19bdb6,_0x49ad('0x25'));_0x50e5ff[_0x49ad('0x2f')]=_[_0x49ad('0x30')](_0x37965a[_0x49ad('0x2f')]);_0x50e5ff['filters']=_['intersection'](_0x50e5ff[_0x49ad('0x2e')],_0x50e5ff['query']);_0x13270f[_0x49ad('0x31')]=_[_0x49ad('0x32')](_0x50e5ff[_0x49ad('0x2e')],qs[_0x49ad('0x33')](_0x37965a[_0x49ad('0x2f')]['fields']));_0x13270f[_0x49ad('0x31')]=_0x13270f[_0x49ad('0x31')][_0x49ad('0x34')]?_0x13270f[_0x49ad('0x31')]:_0x50e5ff[_0x49ad('0x2e')];if(!_0x37965a[_0x49ad('0x2f')]['hasOwnProperty'](_0x49ad('0x35'))){_0x13270f[_0x49ad('0x1c')]=qs[_0x49ad('0x1c')](_0x37965a[_0x49ad('0x2f')][_0x49ad('0x1c')]);_0x13270f['offset']=qs[_0x49ad('0x1a')](_0x37965a[_0x49ad('0x2f')][_0x49ad('0x1a')]);}_0x13270f[_0x49ad('0x36')]=qs['sort'](_0x37965a[_0x49ad('0x2f')]['sort']);_0x13270f[_0x49ad('0x37')]=qs[_0x49ad('0x38')](_['pick'](_0x37965a[_0x49ad('0x2f')],_0x50e5ff[_0x49ad('0x38')]),_0x19bdb6);if(_0x37965a[_0x49ad('0x2f')][_0x49ad('0x39')]){_0x13270f[_0x49ad('0x37')]=_[_0x49ad('0x3a')](_0x13270f[_0x49ad('0x37')],{'$or':_['map'](_0x19bdb6,function(_0x3db6f0){if(_0x3db6f0[_0x49ad('0x2c')]!==_0x49ad('0x3b')){var _0x198ec9={};_0x198ec9[_0x3db6f0[_0x49ad('0x25')]]={'$like':'%'+_0x37965a[_0x49ad('0x2f')][_0x49ad('0x39')]+'%'};return _0x198ec9;}})});}_0x13270f=_['merge']({},_0x13270f,_0x37965a['options']);var _0x2ab4f8={'where':_0x13270f['where']};return db[_0x49ad('0x29')][_0x49ad('0x1d')](_0x2ab4f8)['then'](function(_0xd1bf84){_0x162a65[_0x49ad('0x1d')]=_0xd1bf84;if(_0x37965a[_0x49ad('0x2f')]['includeAll']){_0x13270f['include']=[{'all':!![]}];}return db[_0x49ad('0x29')][_0x49ad('0x3c')](_0x13270f);})[_0x49ad('0x22')](function(_0x198ea1){_0x162a65[_0x49ad('0x3d')]=_0x198ea1;return _0x162a65;})[_0x49ad('0x22')](respondWithFilteredResult(_0x3f26b5,_0x13270f))[_0x49ad('0x3e')](handleError(_0x3f26b5,null));};exports[_0x49ad('0x3f')]=function(_0x317157,_0xf41b78){var _0x3873bb={'raw':!![],'where':{'id':_0x317157[_0x49ad('0x40')]['id']}},_0x488485={};_0x488485[_0x49ad('0x2e')]=_[_0x49ad('0x30')](db[_0x49ad('0x29')]['rawAttributes']);_0x488485[_0x49ad('0x2f')]=_[_0x49ad('0x30')](_0x317157[_0x49ad('0x2f')]);_0x488485[_0x49ad('0x38')]=_[_0x49ad('0x32')](_0x488485[_0x49ad('0x2e')],_0x488485[_0x49ad('0x2f')]);_0x3873bb[_0x49ad('0x31')]=_[_0x49ad('0x32')](_0x488485[_0x49ad('0x2e')],qs[_0x49ad('0x33')](_0x317157[_0x49ad('0x2f')][_0x49ad('0x33')]));_0x3873bb[_0x49ad('0x31')]=_0x3873bb[_0x49ad('0x31')][_0x49ad('0x34')]?_0x3873bb[_0x49ad('0x31')]:_0x488485[_0x49ad('0x2e')];if(_0x317157[_0x49ad('0x2f')]['includeAll']){_0x3873bb[_0x49ad('0x41')]=[{'all':!![]}];}_0x3873bb=_[_0x49ad('0x3a')]({},_0x3873bb,_0x317157[_0x49ad('0x42')]);return db['SquareDetailsReport']['find'](_0x3873bb)[_0x49ad('0x22')](handleEntityNotFound(_0xf41b78,null))[_0x49ad('0x22')](respondWithResult(_0xf41b78,null))['catch'](handleError(_0xf41b78,null));};exports[_0x49ad('0x43')]=function(_0x375270,_0x486ea6){return db[_0x49ad('0x29')][_0x49ad('0x43')](_0x375270['body'],{})[_0x49ad('0x22')](respondWithResult(_0x486ea6,0xc9))[_0x49ad('0x3e')](handleError(_0x486ea6,null));};exports[_0x49ad('0x44')]=function(_0x22b360,_0x5f069f){if(_0x22b360[_0x49ad('0x45')]['id']){delete _0x22b360['body']['id'];}return db[_0x49ad('0x29')][_0x49ad('0x46')]({'where':{'id':_0x22b360[_0x49ad('0x40')]['id']}})[_0x49ad('0x22')](handleEntityNotFound(_0x5f069f,null))[_0x49ad('0x22')](saveUpdates(_0x22b360['body'],null))[_0x49ad('0x22')](respondWithResult(_0x5f069f,null))[_0x49ad('0x3e')](handleError(_0x5f069f,null));};exports['destroy']=function(_0x3d6a08,_0x2d58b4){return db[_0x49ad('0x29')][_0x49ad('0x46')]({'where':{'id':_0x3d6a08[_0x49ad('0x40')]['id']}})[_0x49ad('0x22')](handleEntityNotFound(_0x2d58b4,null))[_0x49ad('0x22')](removeEntity(_0x2d58b4,null))[_0x49ad('0x3e')](handleError(_0x2d58b4,null));};exports[_0x49ad('0x47')]=function(_0x1e9a96,_0x2a730e){return db['SquareDetailsReport'][_0x49ad('0x47')]()[_0x49ad('0x22')](respondWithResult(_0x2a730e,null))[_0x49ad('0x3e')](handleError(_0x2a730e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 34706bc..564c28f 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 _0x3b2b=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','api','bluebird','request-promise','path','../../config/environment'];(function(_0x420017,_0x3787b3){var _0x3b750c=function(_0x1f88a3){while(--_0x1f88a3){_0x420017['push'](_0x420017['shift']());}};_0x3b750c(++_0x3787b3);}(_0x3b2b,0x131));var _0xb3b2=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x3b2b[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xb3b2('0x0'));var util=require(_0xb3b2('0x1'));var logger=require('../../config/logger')(_0xb3b2('0x2'));var moment=require('moment');var BPromise=require(_0xb3b2('0x3'));var rp=require(_0xb3b2('0x4'));var fs=require('fs');var path=require(_0xb3b2('0x5'));var rimraf=require('rimraf');var config=require(_0xb3b2('0x6'));var attributes=require(_0xb3b2('0x7'));module[_0xb3b2('0x8')]=function(_0x347617,_0x49c3cd){return _0x347617[_0xb3b2('0x9')](_0xb3b2('0xa'),attributes,{'tableName':_0xb3b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9615=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9615,0x1b6));var _0x5961=function(_0xa82876,_0x5c0967){_0xa82876=_0xa82876-0x0;var _0x3abd67=_0x9615[_0xa82876];return _0x3abd67;};'use strict';var _=require('lodash');var util=require(_0x5961('0x0'));var logger=require(_0x5961('0x1'))(_0x5961('0x2'));var moment=require(_0x5961('0x3'));var BPromise=require(_0x5961('0x4'));var rp=require(_0x5961('0x5'));var fs=require('fs');var path=require(_0x5961('0x6'));var rimraf=require(_0x5961('0x7'));var config=require(_0x5961('0x8'));var attributes=require('./squareReportDetail.attributes');module[_0x5961('0x9')]=function(_0x35bd1e,_0x473ac0){return _0x35bd1e[_0x5961('0xa')](_0x5961('0xb'),attributes,{'tableName':_0x5961('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index f8242c8..40b7c16 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 _0x17a7=['debug','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x17a7,0xc2));var _0x717a=function(_0x4d7120,_0x26b1df){_0x4d7120=_0x4d7120-0x0;var _0x1e66ef=_0x17a7[_0x4d7120];return _0x1e66ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x717a('0x0'));var rs=require(_0x717a('0x1'));var fs=require('fs');var Redis=require(_0x717a('0x2'));var db=require(_0x717a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x717a('0x4'))('rpc');var config=require(_0x717a('0x5'));var jayson=require(_0x717a('0x6'));var client=jayson['client'][_0x717a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ca7a6,_0xd7d2ce,_0x311738){return new BPromise(function(_0x536824,_0x1066d4){return client['request'](_0x1ca7a6,_0x311738)[_0x717a('0x8')](function(_0x567130){logger[_0x717a('0x9')](_0x717a('0xa'),_0xd7d2ce,_0x717a('0xb'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'),JSON[_0x717a('0xc')](_0x567130));if(_0x567130[_0x717a('0xd')]){if(_0x567130[_0x717a('0xd')][_0x717a('0xe')]===0x1f4){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x567130['error'][_0x717a('0xf')]);return _0x1066d4(_0x567130['error']['message']);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xd7d2ce,_0x567130[_0x717a('0xd')]['message']);return _0x536824(_0x567130[_0x717a('0xd')]['message']);}else{logger[_0x717a('0x9')]('SquareDetailsReport,\x20%s,\x20%s',_0xd7d2ce,_0x717a('0xb'));_0x536824(_0x567130[_0x717a('0x10')][_0x717a('0xf')]);}})['catch'](function(_0x186b4d){logger['error'](_0x717a('0xa'),_0xd7d2ce,_0x186b4d);_0x1066d4(_0x186b4d);});});}exports[_0x717a('0x11')]=function(_0x152e10){var _0x8b295=this;return new Promise(function(_0x45dc38,_0x2fe7a7){return db[_0x717a('0x12')][_0x717a('0x13')](_0x152e10[_0x717a('0x14')],{'raw':_0x152e10[_0x717a('0x15')]?_0x152e10['options']['raw']===undefined?!![]:![]:!![]})[_0x717a('0x8')](function(_0x1d7ebd){logger[_0x717a('0x9')](_0x717a('0x11'),_0x152e10);logger[_0x717a('0x16')](_0x717a('0x11'),_0x152e10,JSON[_0x717a('0xc')](_0x1d7ebd));_0x45dc38(_0x1d7ebd);})[_0x717a('0x17')](function(_0x4e95dc){logger[_0x717a('0xd')](_0x717a('0x11'),_0x4e95dc[_0x717a('0xf')],_0x152e10);_0x2fe7a7(_0x8b295[_0x717a('0xd')](0x1f4,_0x4e95dc[_0x717a('0xf')]));});});}; \ No newline at end of file +var _0x1b0e=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareDetailsReport','create','options','raw','stringify','lodash','util'];(function(_0x24f79f,_0x50512f){var _0x2a44e5=function(_0x3b66f5){while(--_0x3b66f5){_0x24f79f['push'](_0x24f79f['shift']());}};_0x2a44e5(++_0x50512f);}(_0x1b0e,0x132));var _0xe1b0=function(_0x184b8c,_0x83ac28){_0x184b8c=_0x184b8c-0x0;var _0x5a1e23=_0x1b0e[_0x184b8c];return _0x5a1e23;};'use strict';var _=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var moment=require(_0xe1b0('0x2'));var BPromise=require(_0xe1b0('0x3'));var rs=require(_0xe1b0('0x4'));var fs=require('fs');var Redis=require(_0xe1b0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe1b0('0x6'))(_0xe1b0('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1b0('0x8'));var client=jayson[_0xe1b0('0x9')][_0xe1b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e806,_0x36f5cd,_0x1eef2a){return new BPromise(function(_0x5aacc2,_0x123268){return client[_0xe1b0('0xb')](_0x52e806,_0x1eef2a)[_0xe1b0('0xc')](function(_0x400eee){logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));logger[_0xe1b0('0x10')](_0xe1b0('0x11'),_0x36f5cd,_0xe1b0('0xf'),JSON['stringify'](_0x400eee));if(_0x400eee[_0xe1b0('0x12')]){if(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x13')]===0x1f4){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x123268(_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);}logger['error'](_0xe1b0('0xe'),_0x36f5cd,_0x400eee[_0xe1b0('0x12')][_0xe1b0('0x14')]);return _0x5aacc2(_0x400eee['error']['message']);}else{logger[_0xe1b0('0xd')](_0xe1b0('0xe'),_0x36f5cd,_0xe1b0('0xf'));_0x5aacc2(_0x400eee[_0xe1b0('0x15')][_0xe1b0('0x14')]);}})[_0xe1b0('0x16')](function(_0x5dfd78){logger[_0xe1b0('0x12')](_0xe1b0('0xe'),_0x36f5cd,_0x5dfd78);_0x123268(_0x5dfd78);});});}exports[_0xe1b0('0x17')]=function(_0x2928b6){var _0x349f90=this;return new Promise(function(_0x5c195f,_0x5b300e){return db['SquareDetailsReport'][_0xe1b0('0x18')](_0x2928b6['body'],{'raw':_0x2928b6[_0xe1b0('0x19')]?_0x2928b6[_0xe1b0('0x19')][_0xe1b0('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3e0a89){logger[_0xe1b0('0xd')]('CreateSquareDetailsReport',_0x2928b6);logger[_0xe1b0('0x10')](_0xe1b0('0x17'),_0x2928b6,JSON[_0xe1b0('0x1b')](_0x3e0a89));_0x5c195f(_0x3e0a89);})['catch'](function(_0x3c0824){logger['error']('CreateSquareDetailsReport',_0x3c0824['message'],_0x2928b6);_0x5b300e(_0x349f90['error'](0x1f4,_0x3c0824[_0xe1b0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 374a697..3ba4e09 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 _0xd859=['killProcess','express','Router','./system.controller','isAuthenticated','index','/process/:pid/kill'];(function(_0x44334a,_0x181bce){var _0x20a140=function(_0x7ee785){while(--_0x7ee785){_0x44334a['push'](_0x44334a['shift']());}};_0x20a140(++_0x181bce);}(_0xd859,0xb0));var _0x9d85=function(_0x2b3b3a,_0x3226e0){_0x2b3b3a=_0x2b3b3a-0x0;var _0x4b1b2c=_0xd859[_0x2b3b3a];return _0x4b1b2c;};'use strict';var express=require(_0x9d85('0x0'));var router=express[_0x9d85('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x9d85('0x2'));router['get']('/',auth[_0x9d85('0x3')](),controller[_0x9d85('0x4')]);router['get'](_0x9d85('0x5'),auth['isAuthenticated'](),controller[_0x9d85('0x6')]);module['exports']=router; \ No newline at end of file +var _0xda95=['isAuthenticated','index','get','/process/:pid/kill','killProcess','../../components/auth/service'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0xda95,0x1bb));var _0x5da9=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xda95[_0x2064e5];return _0x21a233;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x5da9('0x0'));var controller=require('./system.controller');router['get']('/',auth[_0x5da9('0x1')](),controller[_0x5da9('0x2')]);router[_0x5da9('0x3')](_0x5da9('0x4'),auth['isAuthenticated'](),controller[_0x5da9('0x5')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index ca09c62..43bcf01 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 _0xf1b6=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','api','bluebird','error','status','send','index','then'];(function(_0x4048cf,_0x471761){var _0x2d64a8=function(_0x4aa92a){while(--_0x4aa92a){_0x4048cf['push'](_0x4048cf['shift']());}};_0x2d64a8(++_0x471761);}(_0xf1b6,0x167));var _0x6f1b=function(_0x566d31,_0x481c2a){_0x566d31=_0x566d31-0x0;var _0x35cc9d=_0xf1b6[_0x566d31];return _0x35cc9d;};'use strict';var info=require(_0x6f1b('0x0'));var exec=require(_0x6f1b('0x1'))['exec'];var logger=require('../../config/logger')(_0x6f1b('0x2'));var util=require('util');var BPromise=require(_0x6f1b('0x3'));var _=require('lodash');function handleError(_0x308a7b,_0x16e5c3,_0x23e5ba){_0x16e5c3=_0x16e5c3||0x1f4;return function(_0x24e3fa){logger[_0x6f1b('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x23e5ba,_0x16e5c3,util['inspect'](_0x24e3fa,{'showHidden':![],'depth':null}));delete _0x24e3fa['name'];_0x308a7b[_0x6f1b('0x5')](_0x16e5c3)[_0x6f1b('0x6')](_0x24e3fa);};}exports[_0x6f1b('0x7')]=function(_0x3c7128,_0x3b0fe7){return info['getAllData']()[_0x6f1b('0x8')](function(_0x118e87){return _0x3b0fe7[_0x6f1b('0x5')](0xc8)['json'](_0x118e87);})[_0x6f1b('0x9')](function(_0x1bfd1f){return _0x3b0fe7['status'](0x1f4)['json'](_0x1bfd1f);});};exports[_0x6f1b('0xa')]=function(_0x326725,_0x357f2f){var _0x1612fc=[_0x6f1b('0xb')];return new BPromise(function(_0x1a7c55,_0x4e0920){return exec(util[_0x6f1b('0xc')](_0x6f1b('0xd'),_0x326725[_0x6f1b('0xe')][_0x6f1b('0xf')]),function(_0x43e403,_0x4bd1d0,_0x38d6d6){if(_0x43e403){return _0x4e0920(_0x43e403);}return _0x1a7c55(_0x4bd1d0);});})[_0x6f1b('0x8')](function(_0x4246b3){var _0x563bfe=![];var _0x133fa2=_0x4246b3[_0x6f1b('0x10')](/\n/);for(var _0x52c281=0x0,_0x1a8605=_0x1612fc[_0x6f1b('0x11')];_0x52c281<_0x1a8605,_0x563bfe===![];_0x52c281+=0x1){if(_0x4246b3[_0x6f1b('0x12')](_0x1612fc[_0x52c281])>=0x0){_0x563bfe=!![];}}if(!_0x563bfe){throw new Error(util[_0x6f1b('0xc')](_0x6f1b('0x13'),_0x326725[_0x6f1b('0xe')]['pid']));}process['kill'](_0x326725[_0x6f1b('0xe')][_0x6f1b('0xf')],_0x6f1b('0x14'));return _0x357f2f['status'](0xc8)[_0x6f1b('0x15')]({'message':util[_0x6f1b('0xc')](_0x6f1b('0x16'),_0x326725[_0x6f1b('0xe')][_0x6f1b('0xf')])});})[_0x6f1b('0x9')](handleError(_0x357f2f,null,_0x6f1b('0xa')));}; \ No newline at end of file +var _0x826b=['indexOf','pid','kill','SIGINT','killProcess','systeminformation','child_process','exec','../../config/logger','api','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length'];(function(_0x23b0aa,_0x5967c1){var _0x299166=function(_0x6f8203){while(--_0x6f8203){_0x23b0aa['push'](_0x23b0aa['shift']());}};_0x299166(++_0x5967c1);}(_0x826b,0x131));var _0xb826=function(_0x3e88bb,_0x13e981){_0x3e88bb=_0x3e88bb-0x0;var _0x17bbfa=_0x826b[_0x3e88bb];return _0x17bbfa;};'use strict';var info=require(_0xb826('0x0'));var exec=require(_0xb826('0x1'))[_0xb826('0x2')];var logger=require(_0xb826('0x3'))(_0xb826('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x48b91c,_0x24bdb1,_0x5c806c){_0x24bdb1=_0x24bdb1||0x1f4;return function(_0x44bacf){logger['error'](_0xb826('0x5'),_0x5c806c,_0x24bdb1,util[_0xb826('0x6')](_0x44bacf,{'showHidden':![],'depth':null}));delete _0x44bacf['name'];_0x48b91c[_0xb826('0x7')](_0x24bdb1)[_0xb826('0x8')](_0x44bacf);};}exports[_0xb826('0x9')]=function(_0x324170,_0x21c16b){return info[_0xb826('0xa')]()[_0xb826('0xb')](function(_0x2cd8d8){return _0x21c16b[_0xb826('0x7')](0xc8)['json'](_0x2cd8d8);})[_0xb826('0xc')](function(_0x4d8824){return _0x21c16b[_0xb826('0x7')](0x1f4)[_0xb826('0xd')](_0x4d8824);});};exports['killProcess']=function(_0x5e52e3,_0x376e79){var _0xb72cd2=[_0xb826('0xe')];return new BPromise(function(_0x11ad18,_0x4b4376){return exec(util[_0xb826('0xf')](_0xb826('0x10'),_0x5e52e3[_0xb826('0x11')]['pid']),function(_0xaf7fd9,_0x271ffe,_0x2db3af){if(_0xaf7fd9){return _0x4b4376(_0xaf7fd9);}return _0x11ad18(_0x271ffe);});})['then'](function(_0x1c26a5){var _0x1374a3=![];var _0x2eefff=_0x1c26a5[_0xb826('0x12')](/\n/);for(var _0x20d884=0x0,_0x5af946=_0xb72cd2[_0xb826('0x13')];_0x20d884<_0x5af946,_0x1374a3===![];_0x20d884+=0x1){if(_0x1c26a5[_0xb826('0x14')](_0xb72cd2[_0x20d884])>=0x0){_0x1374a3=!![];}}if(!_0x1374a3){throw new Error(util[_0xb826('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x5e52e3['params'][_0xb826('0x15')]));}process[_0xb826('0x16')](_0x5e52e3['params'][_0xb826('0x15')],_0xb826('0x17'));return _0x376e79[_0xb826('0x7')](0xc8)['json']({'message':util[_0xb826('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x5e52e3['params'][_0xb826('0x15')])});})['catch'](handleError(_0x376e79,null,_0xb826('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index e36ef5d..b018ced 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 _0x5ff3=['/:id','post','create','put','update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index'];(function(_0x179f68,_0x5549f9){var _0x189e84=function(_0x10a6a1){while(--_0x10a6a1){_0x179f68['push'](_0x179f68['shift']());}};_0x189e84(++_0x5549f9);}(_0x5ff3,0x17d));var _0x35ff=function(_0x20875f,_0x459036){_0x20875f=_0x20875f-0x0;var _0x4d1600=_0x5ff3[_0x20875f];return _0x4d1600;};'use strict';var multer=require('multer');var util=require(_0x35ff('0x0'));var path=require('path');var timeout=require(_0x35ff('0x1'));var express=require('express');var router=express[_0x35ff('0x2')]();var fs_extra=require(_0x35ff('0x3'));var auth=require(_0x35ff('0x4'));var interaction=require(_0x35ff('0x5'));var config=require('../../config/environment');var controller=require(_0x35ff('0x6'));router[_0x35ff('0x7')]('/',auth[_0x35ff('0x8')](),controller[_0x35ff('0x9')]);router[_0x35ff('0x7')]('/describe',auth[_0x35ff('0x8')](),controller['describe']);router[_0x35ff('0x7')](_0x35ff('0xa'),auth[_0x35ff('0x8')](),controller['show']);router[_0x35ff('0xb')]('/',auth['isAuthenticated'](),controller[_0x35ff('0xc')]);router[_0x35ff('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x35ff('0xf')]);module[_0x35ff('0x10')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x1732b8,_0x2022cf){var _0x2c3848=function(_0x47b00e){while(--_0x47b00e){_0x1732b8['push'](_0x1732b8['shift']());}};_0x2c3848(++_0x2022cf);}(_0xedd9,0xfc));var _0x9edd=function(_0x40f6e9,_0x1cc6cf){_0x40f6e9=_0x40f6e9-0x0;var _0x605d54=_0xedd9[_0x40f6e9];return _0x605d54;};'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'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 9ac8fa7..661f1a9 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 _0x33d2=['exports','STRING','#0091EA','sequelize'];(function(_0x287b0a,_0x57d5fb){var _0x1909d4=function(_0x50c719){while(--_0x50c719){_0x287b0a['push'](_0x287b0a['shift']());}};_0x1909d4(++_0x57d5fb);}(_0x33d2,0x7f));var _0x233d=function(_0x39e144,_0x4b4847){_0x39e144=_0x39e144-0x0;var _0x5ba205=_0x33d2[_0x39e144];return _0x5ba205;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'name':{'type':Sequelize[_0x233d('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x233d('0x2')],'defaultValue':_0x233d('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x317b=['exports','name','STRING','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x317b,0x1c7));var _0xb317=function(_0x33cdd2,_0x930b1b){_0x33cdd2=_0x33cdd2-0x0;var _0x400d2a=_0x317b[_0x33cdd2];return _0x400d2a;};'use strict';var Sequelize=require(_0xb317('0x0'));module[_0xb317('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb317('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb317('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb317('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index d8a780a..e5a9f9b 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 _0xa39d=['bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','apply','reject','save','update','then','destroy','get','Tags','error','stack','send','index','map','Tag','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa39d,0xf7));var _0xda39=function(_0x346b72,_0x46d312){_0x346b72=_0x346b72-0x0;var _0x488be6=_0xa39d[_0x346b72];return _0x488be6;};'use strict';var emlformat=require(_0xda39('0x0'));var rimraf=require(_0xda39('0x1'));var zipdir=require(_0xda39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda39('0x3'));var moment=require(_0xda39('0x4'));var BPromise=require(_0xda39('0x5'));var Mustache=require(_0xda39('0x6'));var util=require(_0xda39('0x7'));var path=require('path');var sox=require(_0xda39('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xda39('0x9'));var _=require(_0xda39('0xa'));var squel=require(_0xda39('0xb'));var crypto=require(_0xda39('0xc'));var jsforce=require(_0xda39('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xda39('0xe'));var querystring=require(_0xda39('0xf'));var Papa=require(_0xda39('0x10'));var Redis=require(_0xda39('0x11'));var authService=require(_0xda39('0x12'));var qs=require(_0xda39('0x13'));var as=require(_0xda39('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xda39('0x15'));var utils=require(_0xda39('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xda39('0x17'));var db=require(_0xda39('0x18'))['db'];function respondWithStatusCode(_0x1a6161,_0x246c84){_0x246c84=_0x246c84||0xcc;return function(_0x30a00b){if(_0x30a00b){return _0x1a6161[_0xda39('0x19')](_0x246c84);}return _0x1a6161['status'](_0x246c84)[_0xda39('0x1a')]();};}function respondWithResult(_0x4936c4,_0xc5bd2d){_0xc5bd2d=_0xc5bd2d||0xc8;return function(_0x1ab6df){if(_0x1ab6df){return _0x4936c4['status'](_0xc5bd2d)['json'](_0x1ab6df);}};}function respondWithFilteredResult(_0x5adf25,_0xa28838){return function(_0x476305){if(_0x476305){var _0x29533b=typeof _0xa28838[_0xda39('0x1b')]==='undefined'&&typeof _0xa28838[_0xda39('0x1c')]===_0xda39('0x1d');var _0x3ac356=_0x476305[_0xda39('0x1e')];var _0x5b93c6=_0x29533b?0x0:_0xa28838['offset'];var _0x1ed121=_0x29533b?_0x476305['count']:_0xa28838[_0xda39('0x1b')]+_0xa28838[_0xda39('0x1c')];var _0x273de5;if(_0x1ed121>=_0x3ac356){_0x1ed121=_0x3ac356;_0x273de5=0xc8;}else{_0x273de5=0xce;}_0x5adf25[_0xda39('0x1f')](_0x273de5);return _0x5adf25[_0xda39('0x20')]('Content-Range',_0x5b93c6+'-'+_0x1ed121+'/'+_0x3ac356)['json'](_0x476305);}return null;};}function patchUpdates(_0x3b9e86){return function(_0x5d76e0){try{jsonpatch[_0xda39('0x21')](_0x5d76e0,_0x3b9e86,!![]);}catch(_0x184e01){return BPromise[_0xda39('0x22')](_0x184e01);}return _0x5d76e0[_0xda39('0x23')]();};}function saveUpdates(_0x3a010a,_0x228186){return function(_0x54608f){if(_0x54608f){return _0x54608f[_0xda39('0x24')](_0x3a010a)[_0xda39('0x25')](function(_0x46525e){return _0x46525e;});}return null;};}function removeEntity(_0x1089fa,_0x1a6ce9){return function(_0x4a25be){if(_0x4a25be){return _0x4a25be[_0xda39('0x26')]()[_0xda39('0x25')](function(){var _0x52172e=_0x4a25be[_0xda39('0x27')]({'plain':!![]});var _0x2fca60=_0xda39('0x28');return db['UserProfileResource'][_0xda39('0x26')]({'where':{'type':_0x2fca60,'resourceId':_0x52172e['id']}})[_0xda39('0x25')](function(){return _0x4a25be;});})[_0xda39('0x25')](function(){_0x1089fa[_0xda39('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b08bb,_0x3e4fa0){return function(_0x469dae){if(!_0x469dae){_0x5b08bb[_0xda39('0x19')](0x194);}return _0x469dae;};}function handleError(_0x1c9bf8,_0x556b0d){_0x556b0d=_0x556b0d||0x1f4;return function(_0x17060a){logger[_0xda39('0x29')](_0x17060a[_0xda39('0x2a')]);if(_0x17060a['name']){delete _0x17060a['name'];}_0x1c9bf8[_0xda39('0x1f')](_0x556b0d)[_0xda39('0x2b')](_0x17060a);};}exports[_0xda39('0x2c')]=function(_0x3ad1f8,_0x101bab){var _0x3fbc21={},_0x324529={},_0x12dca0={'count':0x0,'rows':[]};var _0x54a577=_[_0xda39('0x2d')](db[_0xda39('0x2e')][_0xda39('0x2f')],function(_0x2045aa){return{'name':_0x2045aa['fieldName'],'type':_0x2045aa[_0xda39('0x30')][_0xda39('0x31')]};});_0x324529[_0xda39('0x32')]=_['map'](_0x54a577,_0xda39('0x33'));_0x324529[_0xda39('0x34')]=_[_0xda39('0x35')](_0x3ad1f8['query']);_0x324529[_0xda39('0x36')]=_[_0xda39('0x37')](_0x324529[_0xda39('0x32')],_0x324529[_0xda39('0x34')]);_0x3fbc21[_0xda39('0x38')]=_[_0xda39('0x37')](_0x324529[_0xda39('0x32')],qs[_0xda39('0x39')](_0x3ad1f8[_0xda39('0x34')][_0xda39('0x39')]));_0x3fbc21[_0xda39('0x38')]=_0x3fbc21[_0xda39('0x38')][_0xda39('0x3a')]?_0x3fbc21[_0xda39('0x38')]:_0x324529['model'];if(!_0x3ad1f8[_0xda39('0x34')][_0xda39('0x3b')](_0xda39('0x3c'))){_0x3fbc21['limit']=qs['limit'](_0x3ad1f8[_0xda39('0x34')][_0xda39('0x1c')]);_0x3fbc21[_0xda39('0x1b')]=qs[_0xda39('0x1b')](_0x3ad1f8['query'][_0xda39('0x1b')]);}_0x3fbc21[_0xda39('0x3d')]=qs[_0xda39('0x3e')](_0x3ad1f8['query'][_0xda39('0x3e')]);_0x3fbc21[_0xda39('0x3f')]=qs[_0xda39('0x36')](_['pick'](_0x3ad1f8[_0xda39('0x34')],_0x324529[_0xda39('0x36')]),_0x54a577);if(_0x3ad1f8[_0xda39('0x34')][_0xda39('0x40')]){_0x3fbc21[_0xda39('0x3f')]=_['merge'](_0x3fbc21[_0xda39('0x3f')],{'$or':_[_0xda39('0x2d')](_0x54a577,function(_0x5e9506){if(_0x5e9506['type']!=='VIRTUAL'){var _0xf560b={};_0xf560b[_0x5e9506[_0xda39('0x33')]]={'$like':'%'+_0x3ad1f8[_0xda39('0x34')][_0xda39('0x40')]+'%'};return _0xf560b;}})});}_0x3fbc21=_[_0xda39('0x41')]({},_0x3fbc21,_0x3ad1f8[_0xda39('0x42')]);var _0x149f07={'where':_0x3fbc21[_0xda39('0x3f')]};return db[_0xda39('0x2e')][_0xda39('0x1e')](_0x149f07)[_0xda39('0x25')](function(_0x2c9c93){_0x12dca0[_0xda39('0x1e')]=_0x2c9c93;if(_0x3ad1f8[_0xda39('0x34')][_0xda39('0x43')]){_0x3fbc21[_0xda39('0x44')]=[{'all':!![]}];}return db['Tag'][_0xda39('0x45')](_0x3fbc21);})[_0xda39('0x25')](function(_0x36c451){_0x12dca0[_0xda39('0x46')]=_0x36c451;return _0x12dca0;})['then'](respondWithFilteredResult(_0x101bab,_0x3fbc21))[_0xda39('0x47')](handleError(_0x101bab,null));};exports[_0xda39('0x48')]=function(_0x11b106,_0x513ca0){var _0x56ee3a={'raw':!![],'where':{'id':_0x11b106[_0xda39('0x49')]['id']}},_0x10cc55={};_0x10cc55[_0xda39('0x32')]=_[_0xda39('0x35')](db[_0xda39('0x2e')][_0xda39('0x2f')]);_0x10cc55['query']=_[_0xda39('0x35')](_0x11b106[_0xda39('0x34')]);_0x10cc55['filters']=_[_0xda39('0x37')](_0x10cc55[_0xda39('0x32')],_0x10cc55[_0xda39('0x34')]);_0x56ee3a[_0xda39('0x38')]=_[_0xda39('0x37')](_0x10cc55[_0xda39('0x32')],qs[_0xda39('0x39')](_0x11b106[_0xda39('0x34')][_0xda39('0x39')]));_0x56ee3a[_0xda39('0x38')]=_0x56ee3a['attributes']['length']?_0x56ee3a['attributes']:_0x10cc55[_0xda39('0x32')];if(_0x11b106[_0xda39('0x34')][_0xda39('0x43')]){_0x56ee3a['include']=[{'all':!![]}];}_0x56ee3a=_['merge']({},_0x56ee3a,_0x11b106[_0xda39('0x42')]);return db['Tag']['find'](_0x56ee3a)[_0xda39('0x25')](handleEntityNotFound(_0x513ca0,null))[_0xda39('0x25')](respondWithResult(_0x513ca0,null))['catch'](handleError(_0x513ca0,null));};exports['create']=function(_0x4c9256,_0x5c1d37){return db[_0xda39('0x2e')]['create'](_0x4c9256[_0xda39('0x4a')],{})[_0xda39('0x25')](function(_0x4a1f54){var _0x1cb860=_0x4c9256[_0xda39('0x4b')][_0xda39('0x27')]({'plain':!![]});if(!_0x1cb860)throw new Error(_0xda39('0x4c'));if(_0x1cb860[_0xda39('0x4d')]===_0xda39('0x4b')){var _0x9a4e3c=_0x4a1f54[_0xda39('0x27')]({'plain':!![]});var _0xd88931=_0xda39('0x28');return db[_0xda39('0x4e')]['find']({'where':{'name':_0xd88931,'userProfileId':_0x1cb860['userProfileId']},'raw':!![]})['then'](function(_0x234620){if(_0x234620&&_0x234620[_0xda39('0x4f')]===0x0){return db[_0xda39('0x50')][_0xda39('0x51')]({'name':_0x9a4e3c['name'],'resourceId':_0x9a4e3c['id'],'type':_0x234620[_0xda39('0x33')],'sectionId':_0x234620['id']},{})[_0xda39('0x25')](function(){return _0x4a1f54;});}else{return _0x4a1f54;}})[_0xda39('0x47')](function(_0x1f637f){logger[_0xda39('0x29')](_0xda39('0x52'),_0x1f637f);throw _0x1f637f;});}return _0x4a1f54;})['then'](respondWithResult(_0x5c1d37,0xc9))['catch'](handleError(_0x5c1d37,null));};exports[_0xda39('0x24')]=function(_0x15a2cc,_0x587e8d){if(_0x15a2cc['body']['id']){delete _0x15a2cc[_0xda39('0x4a')]['id'];}return db[_0xda39('0x2e')]['find']({'where':{'id':_0x15a2cc[_0xda39('0x49')]['id']}})[_0xda39('0x25')](handleEntityNotFound(_0x587e8d,null))[_0xda39('0x25')](saveUpdates(_0x15a2cc['body'],null))['then'](respondWithResult(_0x587e8d,null))[_0xda39('0x47')](handleError(_0x587e8d,null));};exports[_0xda39('0x26')]=function(_0x8a06fa,_0x4e24fb){return db[_0xda39('0x2e')]['find']({'where':{'id':_0x8a06fa[_0xda39('0x49')]['id']}})['then'](handleEntityNotFound(_0x4e24fb,null))['then'](removeEntity(_0x4e24fb,null))[_0xda39('0x47')](handleError(_0x4e24fb,null));};exports[_0xda39('0x53')]=function(_0x58e18b,_0x4c939f){return db[_0xda39('0x2e')][_0xda39('0x53')]()[_0xda39('0x25')](respondWithResult(_0x4c939f,null))[_0xda39('0x47')](handleError(_0x4c939f,null));}; \ No newline at end of file +var _0xa454=['sox','to-csv','ejs','fs-extra','jsforce','desk.js','papaparse','../../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','Content-Range','apply','reject','save','then','destroy','Tags','UserProfileResource','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','includeAll','findAll','catch','show','params','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','path'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0xa454,0xa3));var _0x4a45=function(_0x31f3e0,_0x20c652){_0x31f3e0=_0x31f3e0-0x0;var _0x102491=_0xa454[_0x31f3e0];return _0x102491;};'use strict';var emlformat=require(_0x4a45('0x0'));var rimraf=require(_0x4a45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4a45('0x2'));var moment=require(_0x4a45('0x3'));var BPromise=require(_0x4a45('0x4'));var Mustache=require(_0x4a45('0x5'));var util=require('util');var path=require(_0x4a45('0x6'));var sox=require(_0x4a45('0x7'));var csv=require(_0x4a45('0x8'));var ejs=require(_0x4a45('0x9'));var fs=require('fs');var fs_extra=require(_0x4a45('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4a45('0xb'));var deskjs=require(_0x4a45('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a45('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a45('0xe'));var as=require(_0x4a45('0xf'));var hardwareService=require(_0x4a45('0x10'));var logger=require(_0x4a45('0x11'))(_0x4a45('0x12'));var utils=require(_0x4a45('0x13'));var config=require(_0x4a45('0x14'));var licenseUtil=require(_0x4a45('0x15'));var db=require(_0x4a45('0x16'))['db'];function respondWithStatusCode(_0x46edfc,_0x219215){_0x219215=_0x219215||0xcc;return function(_0x2a42e3){if(_0x2a42e3){return _0x46edfc[_0x4a45('0x17')](_0x219215);}return _0x46edfc[_0x4a45('0x18')](_0x219215)[_0x4a45('0x19')]();};}function respondWithResult(_0x451403,_0x5cfc96){_0x5cfc96=_0x5cfc96||0xc8;return function(_0x35b027){if(_0x35b027){return _0x451403[_0x4a45('0x18')](_0x5cfc96)[_0x4a45('0x1a')](_0x35b027);}};}function respondWithFilteredResult(_0x1201ed,_0x815838){return function(_0x7f3fab){if(_0x7f3fab){var _0x1eba40=typeof _0x815838[_0x4a45('0x1b')]===_0x4a45('0x1c')&&typeof _0x815838['limit']===_0x4a45('0x1c');var _0x39deb4=_0x7f3fab[_0x4a45('0x1d')];var _0x3333b4=_0x1eba40?0x0:_0x815838['offset'];var _0x3a8935=_0x1eba40?_0x7f3fab[_0x4a45('0x1d')]:_0x815838[_0x4a45('0x1b')]+_0x815838[_0x4a45('0x1e')];var _0x359b4c;if(_0x3a8935>=_0x39deb4){_0x3a8935=_0x39deb4;_0x359b4c=0xc8;}else{_0x359b4c=0xce;}_0x1201ed[_0x4a45('0x18')](_0x359b4c);return _0x1201ed[_0x4a45('0x1f')](_0x4a45('0x20'),_0x3333b4+'-'+_0x3a8935+'/'+_0x39deb4)[_0x4a45('0x1a')](_0x7f3fab);}return null;};}function patchUpdates(_0x4852ae){return function(_0x6fcf42){try{jsonpatch[_0x4a45('0x21')](_0x6fcf42,_0x4852ae,!![]);}catch(_0x4d1c3c){return BPromise[_0x4a45('0x22')](_0x4d1c3c);}return _0x6fcf42[_0x4a45('0x23')]();};}function saveUpdates(_0x3681da,_0x5b93bc){return function(_0x31a804){if(_0x31a804){return _0x31a804['update'](_0x3681da)[_0x4a45('0x24')](function(_0x517f93){return _0x517f93;});}return null;};}function removeEntity(_0x4b7657,_0x195086){return function(_0x70f94e){if(_0x70f94e){return _0x70f94e[_0x4a45('0x25')]()['then'](function(){var _0x19aba9=_0x70f94e['get']({'plain':!![]});var _0x1ab6b5=_0x4a45('0x26');return db[_0x4a45('0x27')][_0x4a45('0x25')]({'where':{'type':_0x1ab6b5,'resourceId':_0x19aba9['id']}})[_0x4a45('0x24')](function(){return _0x70f94e;});})['then'](function(){_0x4b7657[_0x4a45('0x18')](0xcc)[_0x4a45('0x19')]();});}};}function handleEntityNotFound(_0x9542a6,_0x39d237){return function(_0x4fb774){if(!_0x4fb774){_0x9542a6[_0x4a45('0x17')](0x194);}return _0x4fb774;};}function handleError(_0x24f2ab,_0x4e91bd){_0x4e91bd=_0x4e91bd||0x1f4;return function(_0x38c2e0){logger['error'](_0x38c2e0[_0x4a45('0x28')]);if(_0x38c2e0['name']){delete _0x38c2e0[_0x4a45('0x29')];}_0x24f2ab['status'](_0x4e91bd)[_0x4a45('0x2a')](_0x38c2e0);};}exports[_0x4a45('0x2b')]=function(_0x75f4cd,_0x15efe8){var _0x526ddc={},_0x309e05={},_0x40bb84={'count':0x0,'rows':[]};var _0x57b175=_[_0x4a45('0x2c')](db[_0x4a45('0x2d')][_0x4a45('0x2e')],function(_0x13fbf7){return{'name':_0x13fbf7[_0x4a45('0x2f')],'type':_0x13fbf7[_0x4a45('0x30')][_0x4a45('0x31')]};});_0x309e05['model']=_['map'](_0x57b175,_0x4a45('0x29'));_0x309e05[_0x4a45('0x32')]=_[_0x4a45('0x33')](_0x75f4cd[_0x4a45('0x32')]);_0x309e05['filters']=_[_0x4a45('0x34')](_0x309e05[_0x4a45('0x35')],_0x309e05[_0x4a45('0x32')]);_0x526ddc['attributes']=_['intersection'](_0x309e05[_0x4a45('0x35')],qs[_0x4a45('0x36')](_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x36')]));_0x526ddc['attributes']=_0x526ddc[_0x4a45('0x37')][_0x4a45('0x38')]?_0x526ddc[_0x4a45('0x37')]:_0x309e05[_0x4a45('0x35')];if(!_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x39')](_0x4a45('0x3a'))){_0x526ddc[_0x4a45('0x1e')]=qs[_0x4a45('0x1e')](_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x1e')]);_0x526ddc[_0x4a45('0x1b')]=qs['offset'](_0x75f4cd[_0x4a45('0x32')]['offset']);}_0x526ddc[_0x4a45('0x3b')]=qs[_0x4a45('0x3c')](_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x3c')]);_0x526ddc[_0x4a45('0x3d')]=qs[_0x4a45('0x3e')](_['pick'](_0x75f4cd[_0x4a45('0x32')],_0x309e05[_0x4a45('0x3e')]),_0x57b175);if(_0x75f4cd['query'][_0x4a45('0x3f')]){_0x526ddc[_0x4a45('0x3d')]=_['merge'](_0x526ddc[_0x4a45('0x3d')],{'$or':_[_0x4a45('0x2c')](_0x57b175,function(_0x274dde){if(_0x274dde[_0x4a45('0x30')]!=='VIRTUAL'){var _0x55ca1c={};_0x55ca1c[_0x274dde[_0x4a45('0x29')]]={'$like':'%'+_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x3f')]+'%'};return _0x55ca1c;}})});}_0x526ddc=_['merge']({},_0x526ddc,_0x75f4cd[_0x4a45('0x40')]);var _0xce5671={'where':_0x526ddc[_0x4a45('0x3d')]};return db[_0x4a45('0x2d')][_0x4a45('0x1d')](_0xce5671)['then'](function(_0x4929b7){_0x40bb84[_0x4a45('0x1d')]=_0x4929b7;if(_0x75f4cd[_0x4a45('0x32')][_0x4a45('0x41')]){_0x526ddc['include']=[{'all':!![]}];}return db['Tag'][_0x4a45('0x42')](_0x526ddc);})[_0x4a45('0x24')](function(_0x3abd7c){_0x40bb84['rows']=_0x3abd7c;return _0x40bb84;})[_0x4a45('0x24')](respondWithFilteredResult(_0x15efe8,_0x526ddc))[_0x4a45('0x43')](handleError(_0x15efe8,null));};exports[_0x4a45('0x44')]=function(_0x48362f,_0x588498){var _0x4962e0={'raw':!![],'where':{'id':_0x48362f[_0x4a45('0x45')]['id']}},_0x4af18f={};_0x4af18f['model']=_[_0x4a45('0x33')](db[_0x4a45('0x2d')]['rawAttributes']);_0x4af18f[_0x4a45('0x32')]=_[_0x4a45('0x33')](_0x48362f[_0x4a45('0x32')]);_0x4af18f['filters']=_[_0x4a45('0x34')](_0x4af18f['model'],_0x4af18f[_0x4a45('0x32')]);_0x4962e0[_0x4a45('0x37')]=_[_0x4a45('0x34')](_0x4af18f[_0x4a45('0x35')],qs[_0x4a45('0x36')](_0x48362f['query'][_0x4a45('0x36')]));_0x4962e0['attributes']=_0x4962e0[_0x4a45('0x37')][_0x4a45('0x38')]?_0x4962e0[_0x4a45('0x37')]:_0x4af18f[_0x4a45('0x35')];if(_0x48362f[_0x4a45('0x32')]['includeAll']){_0x4962e0[_0x4a45('0x46')]=[{'all':!![]}];}_0x4962e0=_['merge']({},_0x4962e0,_0x48362f[_0x4a45('0x40')]);return db[_0x4a45('0x2d')][_0x4a45('0x47')](_0x4962e0)[_0x4a45('0x24')](handleEntityNotFound(_0x588498,null))[_0x4a45('0x24')](respondWithResult(_0x588498,null))[_0x4a45('0x43')](handleError(_0x588498,null));};exports['create']=function(_0x2089e7,_0xcd0b32){return db[_0x4a45('0x2d')]['create'](_0x2089e7[_0x4a45('0x48')],{})[_0x4a45('0x24')](function(_0x15445c){var _0x2bd918=_0x2089e7[_0x4a45('0x49')][_0x4a45('0x4a')]({'plain':!![]});if(!_0x2bd918)throw new Error(_0x4a45('0x4b'));if(_0x2bd918[_0x4a45('0x4c')]==='user'){var _0x2480b9=_0x15445c[_0x4a45('0x4a')]({'plain':!![]});var _0x267eb4='Tags';return db[_0x4a45('0x4d')][_0x4a45('0x47')]({'where':{'name':_0x267eb4,'userProfileId':_0x2bd918[_0x4a45('0x4e')]},'raw':!![]})[_0x4a45('0x24')](function(_0x2e152c){if(_0x2e152c&&_0x2e152c[_0x4a45('0x4f')]===0x0){return db['UserProfileResource'][_0x4a45('0x50')]({'name':_0x2480b9[_0x4a45('0x29')],'resourceId':_0x2480b9['id'],'type':_0x2e152c['name'],'sectionId':_0x2e152c['id']},{})[_0x4a45('0x24')](function(){return _0x15445c;});}else{return _0x15445c;}})[_0x4a45('0x43')](function(_0x59bc12){logger[_0x4a45('0x51')](_0x4a45('0x52'),_0x59bc12);throw _0x59bc12;});}return _0x15445c;})[_0x4a45('0x24')](respondWithResult(_0xcd0b32,0xc9))[_0x4a45('0x43')](handleError(_0xcd0b32,null));};exports[_0x4a45('0x53')]=function(_0x4b5baf,_0x48c4ce){if(_0x4b5baf[_0x4a45('0x48')]['id']){delete _0x4b5baf['body']['id'];}return db[_0x4a45('0x2d')][_0x4a45('0x47')]({'where':{'id':_0x4b5baf['params']['id']}})[_0x4a45('0x24')](handleEntityNotFound(_0x48c4ce,null))[_0x4a45('0x24')](saveUpdates(_0x4b5baf[_0x4a45('0x48')],null))[_0x4a45('0x24')](respondWithResult(_0x48c4ce,null))[_0x4a45('0x43')](handleError(_0x48c4ce,null));};exports[_0x4a45('0x25')]=function(_0x57287e,_0x1517df){return db[_0x4a45('0x2d')]['find']({'where':{'id':_0x57287e[_0x4a45('0x45')]['id']}})[_0x4a45('0x24')](handleEntityNotFound(_0x1517df,null))[_0x4a45('0x24')](removeEntity(_0x1517df,null))[_0x4a45('0x43')](handleError(_0x1517df,null));};exports[_0x4a45('0x54')]=function(_0x399412,_0x2496f3){return db['Tag'][_0x4a45('0x54')]()[_0x4a45('0x24')](respondWithResult(_0x2496f3,null))[_0x4a45('0x43')](handleError(_0x2496f3,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index c8a4fa7..16af73b 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 _0xe440=['util','../../config/logger','api','bluebird','request-promise','rimraf','Tag','tools_tags','lodash'];(function(_0x4283f9,_0x34672b){var _0xfbf082=function(_0x28f0b6){while(--_0x28f0b6){_0x4283f9['push'](_0x4283f9['shift']());}};_0xfbf082(++_0x34672b);}(_0xe440,0x7d));var _0x0e44=function(_0x2002d0,_0x906fbd){_0x2002d0=_0x2002d0-0x0;var _0x4fa3b6=_0xe440[_0x2002d0];return _0x4fa3b6;};'use strict';var _=require(_0x0e44('0x0'));var util=require(_0x0e44('0x1'));var logger=require(_0x0e44('0x2'))(_0x0e44('0x3'));var moment=require('moment');var BPromise=require(_0x0e44('0x4'));var rp=require(_0x0e44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e44('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x48b8d9,_0x32b38d){return _0x48b8d9['define'](_0x0e44('0x7'),attributes,{'tableName':_0x0e44('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x507f=['exports','define','Tag','tools_tags','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x2c199a,_0x48f439){var _0x27670b=function(_0xfbff44){while(--_0xfbff44){_0x2c199a['push'](_0x2c199a['shift']());}};_0x27670b(++_0x48f439);}(_0x507f,0x1c4));var _0xf507=function(_0x366bcc,_0x1a97d4){_0x366bcc=_0x366bcc-0x0;var _0x1fc3d9=_0x507f[_0x366bcc];return _0x1fc3d9;};'use strict';var _=require(_0xf507('0x0'));var util=require('util');var logger=require(_0xf507('0x1'))(_0xf507('0x2'));var moment=require(_0xf507('0x3'));var BPromise=require(_0xf507('0x4'));var rp=require(_0xf507('0x5'));var fs=require('fs');var path=require(_0xf507('0x6'));var rimraf=require(_0xf507('0x7'));var config=require(_0xf507('0x8'));var attributes=require(_0xf507('0x9'));module[_0xf507('0xa')]=function(_0x41a725,_0x2ab1a2){return _0x41a725[_0xf507('0xb')](_0xf507('0xc'),attributes,{'tableName':_0xf507('0xd'),'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 923be51..3bc6884 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 _0xcb81=['lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x51dd76,_0x31959a){var _0x54caa5=function(_0x5e03df){while(--_0x5e03df){_0x51dd76['push'](_0x51dd76['shift']());}};_0x54caa5(++_0x31959a);}(_0xcb81,0x154));var _0x1cb8=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0xcb81[_0x55c979];return _0x690107;};'use strict';var _=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var moment=require('moment');var BPromise=require(_0x1cb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1cb8('0x3'));var logger=require(_0x1cb8('0x4'))(_0x1cb8('0x5'));var config=require(_0x1cb8('0x6'));var jayson=require(_0x1cb8('0x7'));var client=jayson['client'][_0x1cb8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ac2d6,_0x584b16,_0x2408c2){return new BPromise(function(_0x39b4ad,_0x282fd8){return client['request'](_0x2ac2d6,_0x2408c2)[_0x1cb8('0x9')](function(_0x51dc9e){logger['info'](_0x1cb8('0xa'),_0x584b16,_0x1cb8('0xb'));logger[_0x1cb8('0xc')](_0x1cb8('0xd'),_0x584b16,_0x1cb8('0xb'),JSON[_0x1cb8('0xe')](_0x51dc9e));if(_0x51dc9e[_0x1cb8('0xf')]){if(_0x51dc9e[_0x1cb8('0xf')]['code']===0x1f4){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x282fd8(_0x51dc9e[_0x1cb8('0xf')]['message']);}logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);return _0x39b4ad(_0x51dc9e[_0x1cb8('0xf')][_0x1cb8('0x10')]);}else{logger[_0x1cb8('0x11')](_0x1cb8('0xa'),_0x584b16,'request\x20sent');_0x39b4ad(_0x51dc9e[_0x1cb8('0x12')]['message']);}})[_0x1cb8('0x13')](function(_0x28b8ff){logger[_0x1cb8('0xf')](_0x1cb8('0xa'),_0x584b16,_0x28b8ff);_0x282fd8(_0x28b8ff);});});} \ No newline at end of file +var _0x0c6d=['code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0c6d,0xf7));var _0xd0c6=function(_0x3e12cf,_0x3ba5bf){_0x3e12cf=_0x3e12cf-0x0;var _0x323fe3=_0x0c6d[_0x3e12cf];return _0x323fe3;};'use strict';var _=require('lodash');var util=require(_0xd0c6('0x0'));var moment=require(_0xd0c6('0x1'));var BPromise=require(_0xd0c6('0x2'));var rs=require(_0xd0c6('0x3'));var fs=require('fs');var Redis=require(_0xd0c6('0x4'));var db=require(_0xd0c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0c6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd0c6('0x7')][_0xd0c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4a64,_0x5de1cd,_0x16c6da){return new BPromise(function(_0x534412,_0x2a14f1){return client[_0xd0c6('0x9')](_0x2d4a64,_0x16c6da)[_0xd0c6('0xa')](function(_0x184f65){logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));logger[_0xd0c6('0xe')](_0xd0c6('0xf'),_0x5de1cd,'request\x20sent',JSON[_0xd0c6('0x10')](_0x184f65));if(_0x184f65['error']){if(_0x184f65['error'][_0xd0c6('0x11')]===0x1f4){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x2a14f1(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);return _0x534412(_0x184f65[_0xd0c6('0x12')][_0xd0c6('0x13')]);}else{logger[_0xd0c6('0xb')](_0xd0c6('0xc'),_0x5de1cd,_0xd0c6('0xd'));_0x534412(_0x184f65[_0xd0c6('0x14')][_0xd0c6('0x13')]);}})[_0xd0c6('0x15')](function(_0x19dd14){logger[_0xd0c6('0x12')](_0xd0c6('0xc'),_0x5de1cd,_0x19dd14);_0x2a14f1(_0x19dd14);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index a355f48..beceeaf 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 9a9e2e8..3b6777c 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 _0x757a=['exports','STRING'];(function(_0x518657,_0x33d293){var _0x1b1f4f=function(_0x11b7f8){while(--_0x11b7f8){_0x518657['push'](_0x518657['shift']());}};_0x1b1f4f(++_0x33d293);}(_0x757a,0xde));var _0xa757=function(_0x306c42,_0x37b510){_0x306c42=_0x306c42-0x0;var _0xee98ec=_0x757a[_0x306c42];return _0xee98ec;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb7e7[_0x1abb09];return _0xea1c07;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 3ce4247..19f9e08 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 _0x8b15=['Queue','findOrCreate','Queue:save','interface','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','all','TeamVoicePrefix','upsert','spread','removeAgents','isArray','emit','Queue:remove','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../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','./team.socket','sendStatus','end','json','offset','limit','count','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','Team','type','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','model','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','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','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','ValidationError','Unknown\x20channel','capitalize','channel','toLowerCase','rawAttributes','Queues','findOne','isValidChannel','add','ids','removeQueues','remove','addAgents','Voice','Chat','Sms','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User'];(function(_0x11f75a,_0x477b3a){var _0x1ce538=function(_0x5adff2){while(--_0x5adff2){_0x11f75a['push'](_0x11f75a['shift']());}};_0x1ce538(++_0x477b3a);}(_0x8b15,0x1ed));var _0x58b1=function(_0x51f0dd,_0x3c13cb){_0x51f0dd=_0x51f0dd-0x0;var _0x27ce57=_0x8b15[_0x51f0dd];return _0x27ce57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x58b1('0x0'));var zipdir=require(_0x58b1('0x1'));var jsonpatch=require(_0x58b1('0x2'));var rp=require(_0x58b1('0x3'));var moment=require(_0x58b1('0x4'));var BPromise=require(_0x58b1('0x5'));var Mustache=require(_0x58b1('0x6'));var util=require(_0x58b1('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58b1('0x8'));var fs=require('fs');var fs_extra=require(_0x58b1('0x9'));var _=require(_0x58b1('0xa'));var squel=require(_0x58b1('0xb'));var crypto=require(_0x58b1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x58b1('0xd'));var toCsv=require(_0x58b1('0xe'));var querystring=require(_0x58b1('0xf'));var Papa=require(_0x58b1('0x10'));var Redis=require('ioredis');var authService=require(_0x58b1('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58b1('0x12'));var hardwareService=require(_0x58b1('0x13'));var logger=require(_0x58b1('0x14'))(_0x58b1('0x15'));var utils=require(_0x58b1('0x16'));var config=require(_0x58b1('0x17'));var licenseUtil=require(_0x58b1('0x18'));var db=require(_0x58b1('0x19'))['db'];config[_0x58b1('0x1a')]=_[_0x58b1('0x1b')](config['redis'],{'host':_0x58b1('0x1c'),'port':0x18eb});var socket=require(_0x58b1('0x1d'))(new Redis(config['redis']));require(_0x58b1('0x1e'))['register'](socket);function respondWithStatusCode(_0xccefba,_0x3b5b2a){_0x3b5b2a=_0x3b5b2a||0xcc;return function(_0x74fcf7){if(_0x74fcf7){return _0xccefba[_0x58b1('0x1f')](_0x3b5b2a);}return _0xccefba['status'](_0x3b5b2a)[_0x58b1('0x20')]();};}function respondWithResult(_0x2c7143,_0x459d48){_0x459d48=_0x459d48||0xc8;return function(_0x3ce4b7){if(_0x3ce4b7){return _0x2c7143['status'](_0x459d48)[_0x58b1('0x21')](_0x3ce4b7);}};}function respondWithFilteredResult(_0x2a1458,_0x57a12e){return function(_0x32153e){if(_0x32153e){var _0xaa0e18=typeof _0x57a12e[_0x58b1('0x22')]==='undefined'&&typeof _0x57a12e[_0x58b1('0x23')]==='undefined';var _0x2b55c0=_0x32153e[_0x58b1('0x24')];var _0x19b79a=_0xaa0e18?0x0:_0x57a12e[_0x58b1('0x22')];var _0xdef40d=_0xaa0e18?_0x32153e[_0x58b1('0x24')]:_0x57a12e['offset']+_0x57a12e['limit'];var _0xa26b67;if(_0xdef40d>=_0x2b55c0){_0xdef40d=_0x2b55c0;_0xa26b67=0xc8;}else{_0xa26b67=0xce;}_0x2a1458[_0x58b1('0x25')](_0xa26b67);return _0x2a1458[_0x58b1('0x26')](_0x58b1('0x27'),_0x19b79a+'-'+_0xdef40d+'/'+_0x2b55c0)['json'](_0x32153e);}return null;};}function patchUpdates(_0x2a749d){return function(_0x28bcb0){try{jsonpatch[_0x58b1('0x28')](_0x28bcb0,_0x2a749d,!![]);}catch(_0x294955){return BPromise[_0x58b1('0x29')](_0x294955);}return _0x28bcb0[_0x58b1('0x2a')]();};}function saveUpdates(_0x59c775,_0x2f5fdd){return function(_0x2945e1){if(_0x2945e1){return _0x2945e1['update'](_0x59c775)[_0x58b1('0x2b')](function(_0x562be9){return _0x562be9;});}return null;};}function handleEntityNotFound(_0x3e4b5f,_0x1dcaee){return function(_0x242c9e){if(!_0x242c9e){_0x3e4b5f[_0x58b1('0x1f')](0x194);}return _0x242c9e;};}function handleError(_0x3279b2,_0x5465e2){_0x5465e2=_0x5465e2||0x1f4;return function(_0x2b4d0b){logger[_0x58b1('0x2c')](_0x2b4d0b[_0x58b1('0x2d')]);if(_0x2b4d0b['name']){delete _0x2b4d0b[_0x58b1('0x2e')];}_0x3279b2[_0x58b1('0x25')](_0x5465e2)[_0x58b1('0x2f')](_0x2b4d0b);};}exports[_0x58b1('0x30')]=function(_0xa4e85c,_0x38550a){var _0x3c9b9b={},_0x1786b0={},_0x3a4acd={'count':0x0,'rows':[]};var _0x28c925=_['map'](db[_0x58b1('0x31')]['rawAttributes'],function(_0x5561e1){return{'name':_0x5561e1['fieldName'],'type':_0x5561e1[_0x58b1('0x32')]['key']};});_0x1786b0['model']=_[_0x58b1('0x33')](_0x28c925,_0x58b1('0x2e'));_0x1786b0[_0x58b1('0x34')]=_[_0x58b1('0x35')](_0xa4e85c[_0x58b1('0x34')]);_0x1786b0[_0x58b1('0x36')]=_[_0x58b1('0x37')](_0x1786b0['model'],_0x1786b0['query']);_0x3c9b9b['attributes']=_[_0x58b1('0x37')](_0x1786b0['model'],qs[_0x58b1('0x38')](_0xa4e85c['query'][_0x58b1('0x38')]));_0x3c9b9b['attributes']=_0x3c9b9b[_0x58b1('0x39')]['length']?_0x3c9b9b[_0x58b1('0x39')]:_0x1786b0['model'];if(!_0xa4e85c[_0x58b1('0x34')][_0x58b1('0x3a')]('nolimit')){_0x3c9b9b[_0x58b1('0x23')]=qs['limit'](_0xa4e85c[_0x58b1('0x34')][_0x58b1('0x23')]);_0x3c9b9b[_0x58b1('0x22')]=qs['offset'](_0xa4e85c['query'][_0x58b1('0x22')]);}_0x3c9b9b[_0x58b1('0x3b')]=qs[_0x58b1('0x3c')](_0xa4e85c[_0x58b1('0x34')][_0x58b1('0x3c')]);_0x3c9b9b[_0x58b1('0x3d')]=qs[_0x58b1('0x36')](_[_0x58b1('0x3e')](_0xa4e85c[_0x58b1('0x34')],_0x1786b0[_0x58b1('0x36')]),_0x28c925);if(_0xa4e85c['query']['filter']){_0x3c9b9b[_0x58b1('0x3d')]=_[_0x58b1('0x3f')](_0x3c9b9b[_0x58b1('0x3d')],{'$or':_['map'](_0x28c925,function(_0x4f5779){if(_0x4f5779['type']!==_0x58b1('0x40')){var _0x28edca={};_0x28edca[_0x4f5779[_0x58b1('0x2e')]]={'$like':'%'+_0xa4e85c[_0x58b1('0x34')][_0x58b1('0x41')]+'%'};return _0x28edca;}})});}_0x3c9b9b=_['merge']({},_0x3c9b9b,_0xa4e85c[_0x58b1('0x42')]);var _0x3407f0={'where':_0x3c9b9b[_0x58b1('0x3d')]};return db['Team'][_0x58b1('0x24')](_0x3407f0)[_0x58b1('0x2b')](function(_0x3c27c5){_0x3a4acd[_0x58b1('0x24')]=_0x3c27c5;if(_0xa4e85c[_0x58b1('0x34')][_0x58b1('0x43')]){_0x3c9b9b[_0x58b1('0x44')]=[{'all':!![]}];}return db[_0x58b1('0x31')][_0x58b1('0x45')](_0x3c9b9b);})[_0x58b1('0x2b')](function(_0x15e1c0){_0x3a4acd[_0x58b1('0x46')]=_0x15e1c0;return _0x3a4acd;})[_0x58b1('0x2b')](respondWithFilteredResult(_0x38550a,_0x3c9b9b))[_0x58b1('0x47')](handleError(_0x38550a,null));};exports[_0x58b1('0x48')]=function(_0x3fd232,_0x528893){var _0x3a7764={'raw':![],'where':{'id':_0x3fd232[_0x58b1('0x49')]['id']}},_0x41d560={};_0x41d560[_0x58b1('0x4a')]=_['keys'](db['Team']['rawAttributes']);_0x41d560[_0x58b1('0x34')]=_['keys'](_0x3fd232['query']);_0x41d560['filters']=_[_0x58b1('0x37')](_0x41d560[_0x58b1('0x4a')],_0x41d560[_0x58b1('0x34')]);_0x3a7764[_0x58b1('0x39')]=_[_0x58b1('0x37')](_0x41d560[_0x58b1('0x4a')],qs[_0x58b1('0x38')](_0x3fd232[_0x58b1('0x34')][_0x58b1('0x38')]));_0x3a7764['attributes']=_0x3a7764[_0x58b1('0x39')][_0x58b1('0x4b')]?_0x3a7764[_0x58b1('0x39')]:_0x41d560[_0x58b1('0x4a')];if(_0x3fd232[_0x58b1('0x34')][_0x58b1('0x43')]){_0x3a7764[_0x58b1('0x44')]=[{'all':!![]}];}_0x3a7764=_[_0x58b1('0x3f')]({},_0x3a7764,_0x3fd232[_0x58b1('0x42')]);return db[_0x58b1('0x31')][_0x58b1('0x4c')](_0x3a7764)['then'](handleEntityNotFound(_0x528893,null))[_0x58b1('0x2b')](respondWithResult(_0x528893,null))[_0x58b1('0x47')](handleError(_0x528893,null));};exports[_0x58b1('0x4d')]=function(_0x53957e,_0x55937f){return db[_0x58b1('0x31')]['create'](_0x53957e[_0x58b1('0x4e')],{})['then'](function(_0x374b9c){var _0xb18e0a=_0x53957e[_0x58b1('0x4f')][_0x58b1('0x50')]({'plain':!![]});if(!_0xb18e0a)throw new Error(_0x58b1('0x51'));if(_0xb18e0a[_0x58b1('0x52')]===_0x58b1('0x4f')){var _0x1794c=_0x374b9c[_0x58b1('0x50')]({'plain':!![]});var _0xc10a0d=_0x58b1('0x53');return db['UserProfileSection'][_0x58b1('0x4c')]({'where':{'name':_0xc10a0d,'userProfileId':_0xb18e0a[_0x58b1('0x54')]},'raw':!![]})[_0x58b1('0x2b')](function(_0x3c574d){if(_0x3c574d&&_0x3c574d[_0x58b1('0x55')]===0x0){return db[_0x58b1('0x56')][_0x58b1('0x4d')]({'name':_0x1794c[_0x58b1('0x2e')],'resourceId':_0x1794c['id'],'type':_0x3c574d[_0x58b1('0x2e')],'sectionId':_0x3c574d['id']},{})[_0x58b1('0x2b')](function(){return _0x374b9c;});}else{return _0x374b9c;}})['catch'](function(_0x4294c0){logger[_0x58b1('0x2c')](_0x58b1('0x57'),_0x4294c0);throw _0x4294c0;});}return _0x374b9c;})[_0x58b1('0x2b')](respondWithResult(_0x55937f,0xc9))['catch'](handleError(_0x55937f,null));};exports['update']=function(_0x10e57b,_0x3a74e0){if(_0x10e57b[_0x58b1('0x4e')]['id']){delete _0x10e57b[_0x58b1('0x4e')]['id'];}return db[_0x58b1('0x31')][_0x58b1('0x4c')]({'where':{'id':_0x10e57b[_0x58b1('0x49')]['id']}})[_0x58b1('0x2b')](handleEntityNotFound(_0x3a74e0,null))[_0x58b1('0x2b')](saveUpdates(_0x10e57b['body'],null))['then'](respondWithResult(_0x3a74e0,null))[_0x58b1('0x47')](handleError(_0x3a74e0,null));};exports[_0x58b1('0x58')]=function(_0x29af3e,_0x5878bc){var _0x4460f5=_0x29af3e[_0x58b1('0x49')]['id'];var _0x52ae77=[];return db[_0x58b1('0x59')][_0x58b1('0x5a')](function(_0x20a596){var _0x15f37f=_0x58b1('0x5b')+_0x4460f5;return db['sequelize'][_0x58b1('0x34')](_0x15f37f,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')][_0x58b1('0x5e')],'raw':!![],'transaction':_0x20a596})['then'](function(_0x3bc523){_0x52ae77=_[_0x58b1('0x33')](_0x3bc523,function(_0x145b2b){return Number(_0x145b2b[_0x58b1('0x5f')]);});})[_0x58b1('0x2b')](function(){var _0x2a50ad=_0x58b1('0x60')+_0x4460f5;return db['sequelize']['query'](_0x2a50ad,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')]['SELECT'],'raw':!![],'transaction':_0x20a596});})[_0x58b1('0x2b')](function(_0x22c060){var _0x5ac9bf=_[_0x58b1('0x33')](_0x22c060,function(_0x50e039){return Number(_0x50e039[_0x58b1('0x61')]);});return db[_0x58b1('0x62')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'VoiceQueueId':{'$in':_0x5ac9bf}},'transaction':_0x20a596});})['then'](function(){var _0x3e5180=_0x58b1('0x63')+_0x4460f5;return db['sequelize'][_0x58b1('0x34')](_0x3e5180,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')][_0x58b1('0x5e')],'raw':!![],'transaction':_0x20a596});})[_0x58b1('0x2b')](function(_0x2497db){var _0x3701c7=_[_0x58b1('0x33')](_0x2497db,function(_0x12d4f4){return Number(_0x12d4f4['MailQueueId']);});return db[_0x58b1('0x64')]['destroy']({'where':{'UserId':{'$in':_0x52ae77},'MailQueueId':{'$in':_0x3701c7}},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){var _0x18916a=_0x58b1('0x65')+_0x4460f5;return db[_0x58b1('0x59')]['query'](_0x18916a,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')][_0x58b1('0x5e')],'raw':!![],'transaction':_0x20a596});})[_0x58b1('0x2b')](function(_0x36911a){var _0x1731c2=_[_0x58b1('0x33')](_0x36911a,function(_0x468011){return Number(_0x468011[_0x58b1('0x66')]);});return db[_0x58b1('0x67')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'SmsQueueId':{'$in':_0x1731c2}},'transaction':_0x20a596});})['then'](function(){var _0x79820d=_0x58b1('0x68')+_0x4460f5;return db[_0x58b1('0x59')][_0x58b1('0x34')](_0x79820d,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')][_0x58b1('0x5e')],'raw':!![],'transaction':_0x20a596});})['then'](function(_0x2a1bcd){var _0x1f1a79=_[_0x58b1('0x33')](_0x2a1bcd,function(_0x415d30){return Number(_0x415d30[_0x58b1('0x69')]);});return db[_0x58b1('0x6a')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'ChatQueueId':{'$in':_0x1f1a79}},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){var _0x48eead='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4460f5;return db[_0x58b1('0x59')][_0x58b1('0x34')](_0x48eead,{'type':db[_0x58b1('0x5c')][_0x58b1('0x5d')][_0x58b1('0x5e')],'raw':!![],'transaction':_0x20a596});})['then'](function(_0x45b157){var _0x30405c=_[_0x58b1('0x33')](_0x45b157,function(_0x1a64db){return Number(_0x1a64db[_0x58b1('0x6b')]);});return db[_0x58b1('0x6c')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'FaxQueueId':{'$in':_0x30405c}},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){var _0x2389f3=_0x58b1('0x6d')+_0x4460f5;return db[_0x58b1('0x59')]['query'](_0x2389f3,{'type':db['Sequelize'][_0x58b1('0x5d')]['SELECT'],'raw':!![],'transaction':_0x20a596});})[_0x58b1('0x2b')](function(_0x3ad4a0){var _0x540e25=_['map'](_0x3ad4a0,function(_0x36837c){return Number(_0x36837c['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'OpenchannelQueueId':{'$in':_0x540e25}},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){var _0x116452=_0x58b1('0x6e')+_0x4460f5;return db[_0x58b1('0x59')][_0x58b1('0x34')](_0x116452,{'type':db['Sequelize'][_0x58b1('0x5d')]['SELECT'],'raw':!![],'transaction':_0x20a596});})['then'](function(_0xdacbe7){var _0x23187a=_[_0x58b1('0x33')](_0xdacbe7,function(_0x3163e1){return Number(_0x3163e1[_0x58b1('0x6f')]);});return db[_0x58b1('0x70')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'WhatsappQueueId':{'$in':_0x23187a}},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){return db['TeamVoicePrefix'][_0x58b1('0x4c')]({'where':{'TeamId':_0x4460f5}});})['then'](function(_0x10e415){if(_0x10e415===null){return;}return db[_0x58b1('0x71')][_0x58b1('0x58')]({'where':{'UserId':{'$in':_0x52ae77},'VoicePrefixId':_0x10e415[_0x58b1('0x72')]},'transaction':_0x20a596});})[_0x58b1('0x2b')](function(){return db[_0x58b1('0x31')]['destroy']({'where':{'id':_0x4460f5},'cascade':!![],'transaction':_0x20a596});})[_0x58b1('0x2b')](function(_0x57b03c){if(_0x57b03c===0x0){_0x5878bc[_0x58b1('0x1f')](0x194);}else{return db['UserProfileResource'][_0x58b1('0x58')]({'where':{'type':'Teams','resourceId':_0x4460f5},'cascade':!![],'transaction':_0x20a596})[_0x58b1('0x2b')](function(){_0x5878bc[_0x58b1('0x25')](0xcc)[_0x58b1('0x20')]();});}})[_0x58b1('0x47')](function(_0x4e7c6b){_0x5878bc[_0x58b1('0x25')](0x1f4)['send'](_0x4e7c6b);});});};exports[_0x58b1('0x73')]=function(_0x22acf8,_0x1cd7c5,_0x3551c7){return db[_0x58b1('0x31')]['findOne']({'where':{'id':_0x22acf8[_0x58b1('0x49')]['id']}})[_0x58b1('0x2b')](handleEntityNotFound(_0x1cd7c5,null))[_0x58b1('0x2b')](function(_0x22761f){if(!_0x22acf8['query']['channel']||!utils['isValidChannel'](_0x22acf8[_0x58b1('0x34')]['channel'])){throw new db['Sequelize'][(_0x58b1('0x74'))](_0x58b1('0x75'));}var _0x1f7b36={};var _0x12f987={};_0x12f987[_0x58b1('0x4a')]=_[_0x58b1('0x35')](db[_[_0x58b1('0x76')](_0x22acf8['query'][_0x58b1('0x77')][_0x58b1('0x78')]())+'Queue'][_0x58b1('0x79')]);_0x12f987['query']=_[_0x58b1('0x35')](_0x22acf8['query']);_0x12f987[_0x58b1('0x36')]=_[_0x58b1('0x37')](_0x12f987[_0x58b1('0x4a')],_0x12f987[_0x58b1('0x34')]);_0x1f7b36[_0x58b1('0x39')]=_['intersection'](_0x12f987[_0x58b1('0x4a')],qs['fields'](_0x22acf8[_0x58b1('0x34')][_0x58b1('0x38')]));_0x1f7b36['attributes']=_0x1f7b36[_0x58b1('0x39')][_0x58b1('0x4b')]?_0x1f7b36[_0x58b1('0x39')]:_0x12f987['model'];_0x1f7b36[_0x58b1('0x23')]=qs['limit'](_0x22acf8['query'][_0x58b1('0x23')]);_0x1f7b36[_0x58b1('0x22')]=qs[_0x58b1('0x22')](_0x22acf8[_0x58b1('0x34')]['offset']);_0x1f7b36[_0x58b1('0x3b')]=qs[_0x58b1('0x3c')](_0x22acf8[_0x58b1('0x34')]['sort']);_0x1f7b36[_0x58b1('0x3d')]=qs[_0x58b1('0x36')](_[_0x58b1('0x3e')](_0x22acf8[_0x58b1('0x34')],_0x12f987[_0x58b1('0x36')]));_0x1f7b36=_[_0x58b1('0x3f')]({},_0x1f7b36,_0x22acf8['options']);return _0x22761f[_0x58b1('0x50')+_[_0x58b1('0x76')](_0x22acf8[_0x58b1('0x34')][_0x58b1('0x77')][_0x58b1('0x78')]())+_0x58b1('0x7a')](_0x1f7b36);})['then'](respondWithResult(_0x1cd7c5,null))[_0x58b1('0x47')](handleError(_0x1cd7c5,null));};exports['addQueues']=function(_0x2b1c31,_0x5f3ce0,_0x16371c){return db[_0x58b1('0x31')][_0x58b1('0x7b')]({'where':{'id':_0x2b1c31[_0x58b1('0x49')]['id']}})['then'](function(_0x3e2ecc){if(_0x3e2ecc){if(!_0x2b1c31['body']['channel']||!utils[_0x58b1('0x7c')](_0x2b1c31[_0x58b1('0x4e')][_0x58b1('0x77')])){throw new db[(_0x58b1('0x5c'))][(_0x58b1('0x74'))](_0x58b1('0x75'));}return _0x3e2ecc[_0x58b1('0x7d')+_['capitalize'](_0x2b1c31['body'][_0x58b1('0x77')][_0x58b1('0x78')]())+_0x58b1('0x7a')](_0x2b1c31[_0x58b1('0x4e')][_0x58b1('0x7e')]);}return null;})['then'](handleEntityNotFound(_0x5f3ce0,null))[_0x58b1('0x2b')](respondWithStatusCode(_0x5f3ce0,null))[_0x58b1('0x47')](handleError(_0x5f3ce0,null));};exports[_0x58b1('0x7f')]=function(_0x408bef,_0x3d46bd,_0x37a92b){return db[_0x58b1('0x31')][_0x58b1('0x7b')]({'where':{'id':_0x408bef['params']['id']}})[_0x58b1('0x2b')](function(_0x2c5870){if(_0x2c5870){if(!_0x408bef[_0x58b1('0x34')]['channel']||!utils[_0x58b1('0x7c')](_0x408bef[_0x58b1('0x34')][_0x58b1('0x77')])){throw new db[(_0x58b1('0x5c'))][(_0x58b1('0x74'))](_0x58b1('0x75'));}return _0x2c5870[_0x58b1('0x80')+_[_0x58b1('0x76')](_0x408bef[_0x58b1('0x34')][_0x58b1('0x77')][_0x58b1('0x78')]())+_0x58b1('0x7a')](_0x408bef[_0x58b1('0x34')][_0x58b1('0x7e')]);}return null;})[_0x58b1('0x2b')](handleEntityNotFound(_0x3d46bd,null))[_0x58b1('0x2b')](respondWithStatusCode(_0x3d46bd,null))['catch'](handleError(_0x3d46bd,null));};exports[_0x58b1('0x81')]=function(_0x39ff7a,_0x28b022){var _0x44d6f5=_['isArray'](_0x39ff7a['body']['ids'])?_0x39ff7a[_0x58b1('0x4e')][_0x58b1('0x7e')]:[_0x39ff7a[_0x58b1('0x4e')][_0x58b1('0x7e')]];var _0x5056ea=_0x39ff7a[_0x58b1('0x49')]['id'];return db['Team'][_0x58b1('0x4c')]({'where':{'id':_0x5056ea}})[_0x58b1('0x2b')](handleEntityNotFound(_0x28b022,null))['then'](function(_0x293e5f){if(_0x293e5f){var _0x1d5e85=[_0x58b1('0x82'),_0x58b1('0x83'),'Mail',_0x58b1('0x84'),'Fax',_0x58b1('0x85'),_0x58b1('0x86')];return db[_0x58b1('0x59')][_0x58b1('0x5a')](function(_0x73c0a1){var _0x18338d=_[_0x58b1('0x33')](_0x1d5e85,function(_0x4b3ee4){var _0x15978e={'attributes':['id',_0x58b1('0x2e')]};if(_0x4b3ee4==='Voice'){_0x15978e['through']={'attributes':[_0x58b1('0x87')]};}return _0x293e5f[_0x58b1('0x50')+_0x4b3ee4+_0x58b1('0x7a')](_0x15978e)[_0x58b1('0x2b')](function(_0x5bf619){var _0x22dca2=_[_0x58b1('0x33')](_0x5bf619,function(_0x57c7c0){var _0x5dc5db=_[_0x58b1('0x33')](_0x44d6f5,function(_0x575f3f){var _0x352247={'where':{'UserId':_0x575f3f,[_0x4b3ee4+_0x58b1('0x88')]:_0x57c7c0['id']},'transaction':_0x73c0a1};if(_0x4b3ee4===_0x58b1('0x82')){_0x352247['defaults']={'penalty':_0x57c7c0[_0x58b1('0x89')][_0x58b1('0x87')]};}return db[_0x58b1('0x8a')+_0x4b3ee4+_0x58b1('0x8b')][_0x58b1('0x8c')](_0x352247)[_0x58b1('0x2b')](function(){socket['emit'](_0x58b1('0x4f')+_0x4b3ee4+_0x58b1('0x8d'),{'UserId':_0x575f3f,[_0x4b3ee4+_0x58b1('0x88')]:_0x57c7c0['id']});if(_0x4b3ee4!=='Voice'){return;}return db[_0x58b1('0x8a')][_0x58b1('0x45')]({'where':{'id':_0x44d6f5,'online':0x1},'attributes':['id','name','online','voicePause',_0x58b1('0x8e')],'raw':!![]})['then'](function(_0x20e329){var _0x57b3df=_[_0x58b1('0x33')](_0x20e329,function(_0x564517){return db[_0x58b1('0x8f')]['upsert']({'membername':_0x564517[_0x58b1('0x2e')],'UserId':_0x564517['id'],'queue_name':_0x57c7c0[_0x58b1('0x2e')],'VoiceQueueId':_0x57c7c0['id'],'interface':_[_0x58b1('0x90')](_0x564517[_0x58b1('0x8e')])?util[_0x58b1('0x91')](_0x58b1('0x92'),_0x564517['name']):_0x564517[_0x58b1('0x8e')],'paused':_0x564517[_0x58b1('0x93')]||![],'penalty':_0x57c7c0['TeamVoiceQueue'][_0x58b1('0x87')]},{'transaction':_0x73c0a1});});return Promise[_0x58b1('0x94')](_0x57b3df);});});});return Promise[_0x58b1('0x94')](_0x5dc5db);});return Promise[_0x58b1('0x94')](_0x22dca2);})[_0x58b1('0x2b')](function(){return db[_0x58b1('0x95')][_0x58b1('0x7b')]({'where':{'teamId':_0x5056ea}})['then'](function(_0xbed200){if(_0xbed200){var _0x2d8928=_[_0x58b1('0x33')](_0x44d6f5,function(_0x283fa0){db[_0x58b1('0x71')][_0x58b1('0x96')]({'UserId':_0x283fa0,'VoicePrefixId':_0xbed200[_0x58b1('0x72')]});});return Promise[_0x58b1('0x94')](_0x2d8928);}});});});return Promise[_0x58b1('0x94')](_0x18338d)[_0x58b1('0x2b')](function(){return _0x293e5f[_0x58b1('0x81')](_0x44d6f5,{'transaction':_0x73c0a1})[_0x58b1('0x97')](function(_0x3ced3b){return _0x3ced3b;});});});}})[_0x58b1('0x2b')](respondWithResult(_0x28b022,null))[_0x58b1('0x47')](handleError(_0x28b022,null));};exports[_0x58b1('0x98')]=function(_0x50c5b2,_0x3df518){var _0x410800=_[_0x58b1('0x99')](_0x50c5b2['query']['ids'])?_0x50c5b2[_0x58b1('0x34')][_0x58b1('0x7e')]:[_0x50c5b2[_0x58b1('0x34')]['ids']];var _0x2d80bf=_0x50c5b2[_0x58b1('0x49')]['id'];return db[_0x58b1('0x31')][_0x58b1('0x4c')]({'where':{'id':_0x2d80bf}})[_0x58b1('0x2b')](handleEntityNotFound(_0x3df518,null))[_0x58b1('0x2b')](function(_0x429e35){if(_0x429e35){var _0x52443c=[_0x58b1('0x82'),_0x58b1('0x83'),'Mail',_0x58b1('0x84'),'Fax','Openchannel','Whatsapp'];return db[_0x58b1('0x59')][_0x58b1('0x5a')](function(_0x5776d0){var _0x404ad1=_['map'](_0x52443c,function(_0xf98c1e){var _0x5187d2={'attributes':['id','name']};return _0x429e35['get'+_0xf98c1e+_0x58b1('0x7a')](_0x5187d2)[_0x58b1('0x2b')](function(_0x179286){var _0x1666f9=_[_0x58b1('0x33')](_0x179286,function(_0x58830c){return _0x58830c[_0x58b1('0x98')](_0x410800,{'transaction':_0x5776d0})[_0x58b1('0x2b')](function(){var _0x3ba0a9=_[_0x58b1('0x33')](_0x410800,function(_0x3d848f){socket[_0x58b1('0x9a')]('user'+_0xf98c1e+_0x58b1('0x9b'),{'UserId':Number(_0x3d848f),[_0xf98c1e+_0x58b1('0x88')]:_0x58830c['id']});if(_0xf98c1e!==_0x58b1('0x82')){return;}return db[_0x58b1('0x8f')][_0x58b1('0x58')]({'where':{'VoiceQueueId':_0x58830c['id'],'UserId':_0x3d848f},'transaction':_0x5776d0});});return Promise['all'](_0x3ba0a9);});});return Promise[_0x58b1('0x94')](_0x1666f9);});});return Promise[_0x58b1('0x94')](_0x404ad1)['then'](function(){return _0x429e35[_0x58b1('0x98')](_0x410800,{'transaction':_0x5776d0});})[_0x58b1('0x2b')](function(){return db['TeamVoicePrefix'][_0x58b1('0x7b')]({'where':{'teamId':_0x2d80bf}})[_0x58b1('0x2b')](function(_0x1ee925){if(_0x1ee925){var _0x22d863=_[_0x58b1('0x33')](_0x410800,function(_0x34c4ee){db[_0x58b1('0x71')][_0x58b1('0x58')]({'where':{'UserId':_0x34c4ee,'VoicePrefixId':_0x1ee925['VoicePrefixId']}});});return Promise['all'](_0x22d863);}});});});}})[_0x58b1('0x2b')](respondWithStatusCode(_0x3df518,null))[_0x58b1('0x47')](handleError(_0x3df518,null));};exports['getAgents']=function(_0x470385,_0x4fb1bd,_0x524732){var _0x26abfc={};var _0x160dda={};var _0x491844;var _0x48e38f;return db[_0x58b1('0x31')][_0x58b1('0x7b')]({'where':{'id':_0x470385[_0x58b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fb1bd,null))['then'](function(_0x21385c){if(_0x21385c){_0x491844=_0x21385c;_0x160dda[_0x58b1('0x4a')]=_['keys'](db[_0x58b1('0x8a')][_0x58b1('0x79')]);_0x160dda[_0x58b1('0x34')]=_[_0x58b1('0x35')](_0x470385[_0x58b1('0x34')]);_0x160dda['filters']=_[_0x58b1('0x37')](_0x160dda['model'],_0x160dda['query']);_0x26abfc[_0x58b1('0x39')]=_['intersection'](_0x160dda['model'],qs[_0x58b1('0x38')](_0x470385[_0x58b1('0x34')][_0x58b1('0x38')]));_0x26abfc['attributes']=_0x26abfc[_0x58b1('0x39')][_0x58b1('0x4b')]?_0x26abfc[_0x58b1('0x39')]:_0x160dda[_0x58b1('0x4a')];_0x26abfc[_0x58b1('0x3b')]=qs[_0x58b1('0x3c')](_0x470385[_0x58b1('0x34')][_0x58b1('0x3c')]);_0x26abfc['where']=qs[_0x58b1('0x36')](_[_0x58b1('0x3e')](_0x470385[_0x58b1('0x34')],_0x160dda[_0x58b1('0x36')]));if(_0x470385[_0x58b1('0x34')][_0x58b1('0x41')]){_0x26abfc['where']=_['merge'](_0x26abfc['where'],{'$or':_[_0x58b1('0x33')](_0x26abfc[_0x58b1('0x39')],function(_0xd3fbc8){var _0x2868c9={};_0x2868c9[_0xd3fbc8]={'$like':'%'+_0x470385[_0x58b1('0x34')][_0x58b1('0x41')]+'%'};return _0x2868c9;})});}_0x26abfc=_[_0x58b1('0x3f')]({},_0x26abfc,_0x470385[_0x58b1('0x42')]);return _0x491844[_0x58b1('0x9c')](_0x26abfc);}})[_0x58b1('0x2b')](function(_0x1ddc87){if(_0x1ddc87){_0x48e38f=_0x1ddc87['length'];if(!_0x470385[_0x58b1('0x34')][_0x58b1('0x3a')](_0x58b1('0x9d'))){_0x26abfc['limit']=qs[_0x58b1('0x23')](_0x470385[_0x58b1('0x34')][_0x58b1('0x23')]);_0x26abfc[_0x58b1('0x22')]=qs[_0x58b1('0x22')](_0x470385[_0x58b1('0x34')]['offset']);}return _0x491844[_0x58b1('0x9c')](_0x26abfc);}})[_0x58b1('0x2b')](function(_0x1bdb48){if(_0x1bdb48){return _0x1bdb48?{'count':_0x48e38f,'rows':_0x1bdb48}:null;}})[_0x58b1('0x2b')](respondWithResult(_0x4fb1bd,null))['catch'](handleError(_0x4fb1bd,null));}; \ No newline at end of file +var _0x4f4a=['body','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','QueryTypes','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','Teams','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','capitalize','findOne','add','Queues','ids','remove','Voice','Chat','Mail','Sms','Fax','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','VoicePrefixId','addAgents','spread','removeAgents','Openchannel','getAgents','zip-dir','fast-json-patch','request-promise','moment','util','path','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Team','includeAll','include','findAll','rows','catch','show','params','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update'];(function(_0x1f83a9,_0x563ce2){var _0x5d30e0=function(_0x3295c8){while(--_0x3295c8){_0x1f83a9['push'](_0x1f83a9['shift']());}};_0x5d30e0(++_0x563ce2);}(_0x4f4a,0xda));var _0xa4f4=function(_0x37f030,_0x1d5e22){_0x37f030=_0x37f030-0x0;var _0x55a37f=_0x4f4a[_0x37f030];return _0x55a37f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa4f4('0x0'));var jsonpatch=require(_0xa4f4('0x1'));var rp=require(_0xa4f4('0x2'));var moment=require(_0xa4f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa4f4('0x4'));var path=require(_0xa4f4('0x5'));var sox=require(_0xa4f4('0x6'));var csv=require(_0xa4f4('0x7'));var ejs=require(_0xa4f4('0x8'));var fs=require('fs');var fs_extra=require(_0xa4f4('0x9'));var _=require(_0xa4f4('0xa'));var squel=require('squel');var crypto=require(_0xa4f4('0xb'));var jsforce=require(_0xa4f4('0xc'));var deskjs=require(_0xa4f4('0xd'));var toCsv=require(_0xa4f4('0x7'));var querystring=require(_0xa4f4('0xe'));var Papa=require(_0xa4f4('0xf'));var Redis=require(_0xa4f4('0x10'));var authService=require(_0xa4f4('0x11'));var qs=require(_0xa4f4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4f4('0x13'))(_0xa4f4('0x14'));var utils=require(_0xa4f4('0x15'));var config=require(_0xa4f4('0x16'));var licenseUtil=require(_0xa4f4('0x17'));var db=require(_0xa4f4('0x18'))['db'];config[_0xa4f4('0x19')]=_[_0xa4f4('0x1a')](config[_0xa4f4('0x19')],{'host':_0xa4f4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4f4('0x19')]));require(_0xa4f4('0x1c'))[_0xa4f4('0x1d')](socket);function respondWithStatusCode(_0x144049,_0x58beb0){_0x58beb0=_0x58beb0||0xcc;return function(_0x420782){if(_0x420782){return _0x144049[_0xa4f4('0x1e')](_0x58beb0);}return _0x144049[_0xa4f4('0x1f')](_0x58beb0)[_0xa4f4('0x20')]();};}function respondWithResult(_0x195a74,_0xaf6a46){_0xaf6a46=_0xaf6a46||0xc8;return function(_0x2c4e4c){if(_0x2c4e4c){return _0x195a74[_0xa4f4('0x1f')](_0xaf6a46)['json'](_0x2c4e4c);}};}function respondWithFilteredResult(_0x32b4e6,_0x109332){return function(_0x31cc11){if(_0x31cc11){var _0x140c7e=typeof _0x109332[_0xa4f4('0x21')]===_0xa4f4('0x22')&&typeof _0x109332['limit']===_0xa4f4('0x22');var _0xa2723b=_0x31cc11[_0xa4f4('0x23')];var _0x5aa9f8=_0x140c7e?0x0:_0x109332['offset'];var _0x5d4aef=_0x140c7e?_0x31cc11['count']:_0x109332['offset']+_0x109332[_0xa4f4('0x24')];var _0x15c154;if(_0x5d4aef>=_0xa2723b){_0x5d4aef=_0xa2723b;_0x15c154=0xc8;}else{_0x15c154=0xce;}_0x32b4e6[_0xa4f4('0x1f')](_0x15c154);return _0x32b4e6[_0xa4f4('0x25')]('Content-Range',_0x5aa9f8+'-'+_0x5d4aef+'/'+_0xa2723b)[_0xa4f4('0x26')](_0x31cc11);}return null;};}function patchUpdates(_0xccbc7){return function(_0x2a2100){try{jsonpatch[_0xa4f4('0x27')](_0x2a2100,_0xccbc7,!![]);}catch(_0x4bf6e0){return BPromise[_0xa4f4('0x28')](_0x4bf6e0);}return _0x2a2100[_0xa4f4('0x29')]();};}function saveUpdates(_0x2d77a8,_0x433d85){return function(_0x4f78a4){if(_0x4f78a4){return _0x4f78a4['update'](_0x2d77a8)[_0xa4f4('0x2a')](function(_0x921008){return _0x921008;});}return null;};}function handleEntityNotFound(_0x33e553,_0x2abc71){return function(_0x239712){if(!_0x239712){_0x33e553[_0xa4f4('0x1e')](0x194);}return _0x239712;};}function handleError(_0x101dfe,_0x2154f7){_0x2154f7=_0x2154f7||0x1f4;return function(_0x3749f6){logger['error'](_0x3749f6['stack']);if(_0x3749f6[_0xa4f4('0x2b')]){delete _0x3749f6[_0xa4f4('0x2b')];}_0x101dfe['status'](_0x2154f7)[_0xa4f4('0x2c')](_0x3749f6);};}exports[_0xa4f4('0x2d')]=function(_0x5ba6e9,_0x301b81){var _0x3ab13d={},_0xbc1d16={},_0x453b14={'count':0x0,'rows':[]};var _0x519df2=_[_0xa4f4('0x2e')](db['Team'][_0xa4f4('0x2f')],function(_0x3e8ce3){return{'name':_0x3e8ce3[_0xa4f4('0x30')],'type':_0x3e8ce3[_0xa4f4('0x31')][_0xa4f4('0x32')]};});_0xbc1d16[_0xa4f4('0x33')]=_[_0xa4f4('0x2e')](_0x519df2,'name');_0xbc1d16[_0xa4f4('0x34')]=_[_0xa4f4('0x35')](_0x5ba6e9['query']);_0xbc1d16[_0xa4f4('0x36')]=_[_0xa4f4('0x37')](_0xbc1d16[_0xa4f4('0x33')],_0xbc1d16['query']);_0x3ab13d[_0xa4f4('0x38')]=_['intersection'](_0xbc1d16[_0xa4f4('0x33')],qs[_0xa4f4('0x39')](_0x5ba6e9[_0xa4f4('0x34')]['fields']));_0x3ab13d['attributes']=_0x3ab13d[_0xa4f4('0x38')][_0xa4f4('0x3a')]?_0x3ab13d[_0xa4f4('0x38')]:_0xbc1d16[_0xa4f4('0x33')];if(!_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x3b')](_0xa4f4('0x3c'))){_0x3ab13d[_0xa4f4('0x24')]=qs[_0xa4f4('0x24')](_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x24')]);_0x3ab13d[_0xa4f4('0x21')]=qs['offset'](_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x21')]);}_0x3ab13d[_0xa4f4('0x3d')]=qs[_0xa4f4('0x3e')](_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x3e')]);_0x3ab13d[_0xa4f4('0x3f')]=qs[_0xa4f4('0x36')](_[_0xa4f4('0x40')](_0x5ba6e9[_0xa4f4('0x34')],_0xbc1d16[_0xa4f4('0x36')]),_0x519df2);if(_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x41')]){_0x3ab13d[_0xa4f4('0x3f')]=_[_0xa4f4('0x42')](_0x3ab13d['where'],{'$or':_[_0xa4f4('0x2e')](_0x519df2,function(_0x3fd762){if(_0x3fd762[_0xa4f4('0x31')]!=='VIRTUAL'){var _0x3d3621={};_0x3d3621[_0x3fd762[_0xa4f4('0x2b')]]={'$like':'%'+_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x41')]+'%'};return _0x3d3621;}})});}_0x3ab13d=_[_0xa4f4('0x42')]({},_0x3ab13d,_0x5ba6e9[_0xa4f4('0x43')]);var _0x274b8a={'where':_0x3ab13d[_0xa4f4('0x3f')]};return db[_0xa4f4('0x44')][_0xa4f4('0x23')](_0x274b8a)[_0xa4f4('0x2a')](function(_0x5b6c5f){_0x453b14[_0xa4f4('0x23')]=_0x5b6c5f;if(_0x5ba6e9[_0xa4f4('0x34')][_0xa4f4('0x45')]){_0x3ab13d[_0xa4f4('0x46')]=[{'all':!![]}];}return db[_0xa4f4('0x44')][_0xa4f4('0x47')](_0x3ab13d);})[_0xa4f4('0x2a')](function(_0x3777bb){_0x453b14[_0xa4f4('0x48')]=_0x3777bb;return _0x453b14;})[_0xa4f4('0x2a')](respondWithFilteredResult(_0x301b81,_0x3ab13d))[_0xa4f4('0x49')](handleError(_0x301b81,null));};exports[_0xa4f4('0x4a')]=function(_0xd51fe8,_0x4dd7a4){var _0x40b7da={'raw':![],'where':{'id':_0xd51fe8[_0xa4f4('0x4b')]['id']}},_0x538199={};_0x538199['model']=_['keys'](db[_0xa4f4('0x44')][_0xa4f4('0x2f')]);_0x538199['query']=_[_0xa4f4('0x35')](_0xd51fe8[_0xa4f4('0x34')]);_0x538199['filters']=_[_0xa4f4('0x37')](_0x538199[_0xa4f4('0x33')],_0x538199['query']);_0x40b7da[_0xa4f4('0x38')]=_[_0xa4f4('0x37')](_0x538199[_0xa4f4('0x33')],qs[_0xa4f4('0x39')](_0xd51fe8['query'][_0xa4f4('0x39')]));_0x40b7da['attributes']=_0x40b7da[_0xa4f4('0x38')][_0xa4f4('0x3a')]?_0x40b7da[_0xa4f4('0x38')]:_0x538199[_0xa4f4('0x33')];if(_0xd51fe8[_0xa4f4('0x34')]['includeAll']){_0x40b7da['include']=[{'all':!![]}];}_0x40b7da=_[_0xa4f4('0x42')]({},_0x40b7da,_0xd51fe8['options']);return db[_0xa4f4('0x44')][_0xa4f4('0x4c')](_0x40b7da)[_0xa4f4('0x2a')](handleEntityNotFound(_0x4dd7a4,null))[_0xa4f4('0x2a')](respondWithResult(_0x4dd7a4,null))[_0xa4f4('0x49')](handleError(_0x4dd7a4,null));};exports['create']=function(_0x36408f,_0x163175){return db[_0xa4f4('0x44')]['create'](_0x36408f['body'],{})[_0xa4f4('0x2a')](function(_0x2c8252){var _0x99b029=_0x36408f[_0xa4f4('0x4d')][_0xa4f4('0x4e')]({'plain':!![]});if(!_0x99b029)throw new Error(_0xa4f4('0x4f'));if(_0x99b029[_0xa4f4('0x50')]===_0xa4f4('0x4d')){var _0x24dfd7=_0x2c8252['get']({'plain':!![]});var _0x16f5a9='Teams';return db[_0xa4f4('0x51')]['find']({'where':{'name':_0x16f5a9,'userProfileId':_0x99b029['userProfileId']},'raw':!![]})[_0xa4f4('0x2a')](function(_0x4ef1f3){if(_0x4ef1f3&&_0x4ef1f3[_0xa4f4('0x52')]===0x0){return db[_0xa4f4('0x53')][_0xa4f4('0x54')]({'name':_0x24dfd7[_0xa4f4('0x2b')],'resourceId':_0x24dfd7['id'],'type':_0x4ef1f3[_0xa4f4('0x2b')],'sectionId':_0x4ef1f3['id']},{})['then'](function(){return _0x2c8252;});}else{return _0x2c8252;}})[_0xa4f4('0x49')](function(_0x1e79ab){logger[_0xa4f4('0x55')](_0xa4f4('0x56'),_0x1e79ab);throw _0x1e79ab;});}return _0x2c8252;})[_0xa4f4('0x2a')](respondWithResult(_0x163175,0xc9))[_0xa4f4('0x49')](handleError(_0x163175,null));};exports[_0xa4f4('0x57')]=function(_0x87330b,_0x4307a7){if(_0x87330b[_0xa4f4('0x58')]['id']){delete _0x87330b['body']['id'];}return db[_0xa4f4('0x44')][_0xa4f4('0x4c')]({'where':{'id':_0x87330b[_0xa4f4('0x4b')]['id']}})[_0xa4f4('0x2a')](handleEntityNotFound(_0x4307a7,null))['then'](saveUpdates(_0x87330b[_0xa4f4('0x58')],null))['then'](respondWithResult(_0x4307a7,null))[_0xa4f4('0x49')](handleError(_0x4307a7,null));};exports[_0xa4f4('0x59')]=function(_0x3faea7,_0x40a877){var _0x21ca0b=_0x3faea7['params']['id'];var _0x455f6e=[];return db[_0xa4f4('0x5a')][_0xa4f4('0x5b')](function(_0x5529ba){var _0x31adec=_0xa4f4('0x5c')+_0x21ca0b;return db[_0xa4f4('0x5a')]['query'](_0x31adec,{'type':db[_0xa4f4('0x5d')]['QueryTypes'][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba})['then'](function(_0x771e8){_0x455f6e=_[_0xa4f4('0x2e')](_0x771e8,function(_0x2650c8){return Number(_0x2650c8['UserId']);});})[_0xa4f4('0x2a')](function(){var _0x42f662='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x21ca0b;return db['sequelize'][_0xa4f4('0x34')](_0x42f662,{'type':db['Sequelize'][_0xa4f4('0x5f')][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(_0x1dd372){var _0xa58dc9=_[_0xa4f4('0x2e')](_0x1dd372,function(_0x2f984e){return Number(_0x2f984e[_0xa4f4('0x60')]);});return db[_0xa4f4('0x61')][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'VoiceQueueId':{'$in':_0xa58dc9}},'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(){var _0x50a3e7=_0xa4f4('0x62')+_0x21ca0b;return db[_0xa4f4('0x5a')][_0xa4f4('0x34')](_0x50a3e7,{'type':db[_0xa4f4('0x5d')][_0xa4f4('0x5f')][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})['then'](function(_0x2be56b){var _0x16fde5=_[_0xa4f4('0x2e')](_0x2be56b,function(_0x65d1b7){return Number(_0x65d1b7[_0xa4f4('0x63')]);});return db[_0xa4f4('0x64')][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'MailQueueId':{'$in':_0x16fde5}},'transaction':_0x5529ba});})['then'](function(){var _0x27c905=_0xa4f4('0x65')+_0x21ca0b;return db[_0xa4f4('0x5a')][_0xa4f4('0x34')](_0x27c905,{'type':db['Sequelize']['QueryTypes'][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(_0xa4ccad){var _0xd4bab5=_[_0xa4f4('0x2e')](_0xa4ccad,function(_0x27a5a6){return Number(_0x27a5a6['SmsQueueId']);});return db[_0xa4f4('0x66')][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'SmsQueueId':{'$in':_0xd4bab5}},'transaction':_0x5529ba});})['then'](function(){var _0x3423ac=_0xa4f4('0x67')+_0x21ca0b;return db[_0xa4f4('0x5a')][_0xa4f4('0x34')](_0x3423ac,{'type':db[_0xa4f4('0x5d')]['QueryTypes'][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(_0x46420b){var _0x3750e5=_[_0xa4f4('0x2e')](_0x46420b,function(_0x1d20d1){return Number(_0x1d20d1[_0xa4f4('0x68')]);});return db['UserChatQueue'][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'ChatQueueId':{'$in':_0x3750e5}},'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(){var _0xf13886='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x21ca0b;return db[_0xa4f4('0x5a')]['query'](_0xf13886,{'type':db[_0xa4f4('0x5d')]['QueryTypes'][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})['then'](function(_0x3d265a){var _0x110a39=_[_0xa4f4('0x2e')](_0x3d265a,function(_0xf71388){return Number(_0xf71388[_0xa4f4('0x69')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x455f6e},'FaxQueueId':{'$in':_0x110a39}},'transaction':_0x5529ba});})['then'](function(){var _0x1498fa=_0xa4f4('0x6a')+_0x21ca0b;return db['sequelize'][_0xa4f4('0x34')](_0x1498fa,{'type':db[_0xa4f4('0x5d')][_0xa4f4('0x5f')][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(_0x90113){var _0x9e7e53=_[_0xa4f4('0x2e')](_0x90113,function(_0x9119c7){return Number(_0x9119c7['OpenchannelQueueId']);});return db[_0xa4f4('0x6b')][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'OpenchannelQueueId':{'$in':_0x9e7e53}},'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(){var _0x9a7486=_0xa4f4('0x6c')+_0x21ca0b;return db[_0xa4f4('0x5a')][_0xa4f4('0x34')](_0x9a7486,{'type':db[_0xa4f4('0x5d')][_0xa4f4('0x5f')][_0xa4f4('0x5e')],'raw':!![],'transaction':_0x5529ba});})['then'](function(_0x5a7722){var _0x590b01=_[_0xa4f4('0x2e')](_0x5a7722,function(_0x566edb){return Number(_0x566edb[_0xa4f4('0x6d')]);});return db['UserWhatsappQueue'][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'WhatsappQueueId':{'$in':_0x590b01}},'transaction':_0x5529ba});})['then'](function(){return db[_0xa4f4('0x6e')][_0xa4f4('0x4c')]({'where':{'TeamId':_0x21ca0b}});})[_0xa4f4('0x2a')](function(_0x2f7859){if(_0x2f7859===null){return;}return db[_0xa4f4('0x6f')][_0xa4f4('0x59')]({'where':{'UserId':{'$in':_0x455f6e},'VoicePrefixId':_0x2f7859['VoicePrefixId']},'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(){return db['Team'][_0xa4f4('0x59')]({'where':{'id':_0x21ca0b},'cascade':!![],'transaction':_0x5529ba});})[_0xa4f4('0x2a')](function(_0x27b2d0){if(_0x27b2d0===0x0){_0x40a877[_0xa4f4('0x1e')](0x194);}else{return db[_0xa4f4('0x53')][_0xa4f4('0x59')]({'where':{'type':_0xa4f4('0x70'),'resourceId':_0x21ca0b},'cascade':!![],'transaction':_0x5529ba})['then'](function(){_0x40a877['status'](0xcc)[_0xa4f4('0x20')]();});}})['catch'](function(_0x1ca34e){_0x40a877['status'](0x1f4)[_0xa4f4('0x2c')](_0x1ca34e);});});};exports['getQueues']=function(_0x509853,_0x42da10,_0x4f6c91){return db[_0xa4f4('0x44')]['findOne']({'where':{'id':_0x509853['params']['id']}})[_0xa4f4('0x2a')](handleEntityNotFound(_0x42da10,null))[_0xa4f4('0x2a')](function(_0x3c6931){if(!_0x509853[_0xa4f4('0x34')][_0xa4f4('0x71')]||!utils[_0xa4f4('0x72')](_0x509853[_0xa4f4('0x34')]['channel'])){throw new db[(_0xa4f4('0x5d'))][(_0xa4f4('0x73'))](_0xa4f4('0x74'));}var _0x46cc0c={};var _0x5a52b8={};_0x5a52b8[_0xa4f4('0x33')]=_[_0xa4f4('0x35')](db[_['capitalize'](_0x509853[_0xa4f4('0x34')]['channel'][_0xa4f4('0x75')]())+_0xa4f4('0x76')][_0xa4f4('0x2f')]);_0x5a52b8['query']=_[_0xa4f4('0x35')](_0x509853['query']);_0x5a52b8[_0xa4f4('0x36')]=_['intersection'](_0x5a52b8[_0xa4f4('0x33')],_0x5a52b8[_0xa4f4('0x34')]);_0x46cc0c[_0xa4f4('0x38')]=_[_0xa4f4('0x37')](_0x5a52b8[_0xa4f4('0x33')],qs['fields'](_0x509853[_0xa4f4('0x34')][_0xa4f4('0x39')]));_0x46cc0c[_0xa4f4('0x38')]=_0x46cc0c['attributes'][_0xa4f4('0x3a')]?_0x46cc0c[_0xa4f4('0x38')]:_0x5a52b8[_0xa4f4('0x33')];_0x46cc0c['limit']=qs[_0xa4f4('0x24')](_0x509853[_0xa4f4('0x34')][_0xa4f4('0x24')]);_0x46cc0c[_0xa4f4('0x21')]=qs[_0xa4f4('0x21')](_0x509853['query'][_0xa4f4('0x21')]);_0x46cc0c['order']=qs[_0xa4f4('0x3e')](_0x509853[_0xa4f4('0x34')]['sort']);_0x46cc0c[_0xa4f4('0x3f')]=qs[_0xa4f4('0x36')](_[_0xa4f4('0x40')](_0x509853[_0xa4f4('0x34')],_0x5a52b8[_0xa4f4('0x36')]));_0x46cc0c=_[_0xa4f4('0x42')]({},_0x46cc0c,_0x509853['options']);return _0x3c6931[_0xa4f4('0x4e')+_[_0xa4f4('0x77')](_0x509853['query'][_0xa4f4('0x71')][_0xa4f4('0x75')]())+'Queues'](_0x46cc0c);})[_0xa4f4('0x2a')](respondWithResult(_0x42da10,null))[_0xa4f4('0x49')](handleError(_0x42da10,null));};exports['addQueues']=function(_0x343139,_0x4cf700,_0x4263a0){return db[_0xa4f4('0x44')][_0xa4f4('0x78')]({'where':{'id':_0x343139['params']['id']}})['then'](function(_0x46c46e){if(_0x46c46e){if(!_0x343139[_0xa4f4('0x58')][_0xa4f4('0x71')]||!utils[_0xa4f4('0x72')](_0x343139[_0xa4f4('0x58')][_0xa4f4('0x71')])){throw new db['Sequelize'][(_0xa4f4('0x73'))](_0xa4f4('0x74'));}return _0x46c46e[_0xa4f4('0x79')+_['capitalize'](_0x343139[_0xa4f4('0x58')][_0xa4f4('0x71')][_0xa4f4('0x75')]())+_0xa4f4('0x7a')](_0x343139[_0xa4f4('0x58')][_0xa4f4('0x7b')]);}return null;})[_0xa4f4('0x2a')](handleEntityNotFound(_0x4cf700,null))[_0xa4f4('0x2a')](respondWithStatusCode(_0x4cf700,null))[_0xa4f4('0x49')](handleError(_0x4cf700,null));};exports['removeQueues']=function(_0x34f6b3,_0x3b4846,_0x4f04bf){return db[_0xa4f4('0x44')]['findOne']({'where':{'id':_0x34f6b3[_0xa4f4('0x4b')]['id']}})['then'](function(_0x4842e1){if(_0x4842e1){if(!_0x34f6b3[_0xa4f4('0x34')]['channel']||!utils['isValidChannel'](_0x34f6b3[_0xa4f4('0x34')]['channel'])){throw new db[(_0xa4f4('0x5d'))][(_0xa4f4('0x73'))](_0xa4f4('0x74'));}return _0x4842e1[_0xa4f4('0x7c')+_[_0xa4f4('0x77')](_0x34f6b3[_0xa4f4('0x34')]['channel'][_0xa4f4('0x75')]())+_0xa4f4('0x7a')](_0x34f6b3[_0xa4f4('0x34')]['ids']);}return null;})['then'](handleEntityNotFound(_0x3b4846,null))[_0xa4f4('0x2a')](respondWithStatusCode(_0x3b4846,null))['catch'](handleError(_0x3b4846,null));};exports['addAgents']=function(_0x1787e8,_0x5e69dd){var _0x54901e=_['isArray'](_0x1787e8[_0xa4f4('0x58')][_0xa4f4('0x7b')])?_0x1787e8[_0xa4f4('0x58')][_0xa4f4('0x7b')]:[_0x1787e8['body']['ids']];var _0x1af106=_0x1787e8[_0xa4f4('0x4b')]['id'];return db[_0xa4f4('0x44')][_0xa4f4('0x4c')]({'where':{'id':_0x1af106}})[_0xa4f4('0x2a')](handleEntityNotFound(_0x5e69dd,null))[_0xa4f4('0x2a')](function(_0x11489a){if(_0x11489a){var _0x4123eb=[_0xa4f4('0x7d'),_0xa4f4('0x7e'),_0xa4f4('0x7f'),_0xa4f4('0x80'),_0xa4f4('0x81'),'Openchannel',_0xa4f4('0x82')];return db[_0xa4f4('0x5a')][_0xa4f4('0x5b')](function(_0x5a4f79){var _0x7410a7=_['map'](_0x4123eb,function(_0x346329){var _0x1fe3df={'attributes':['id','name']};if(_0x346329===_0xa4f4('0x7d')){_0x1fe3df[_0xa4f4('0x83')]={'attributes':[_0xa4f4('0x84')]};}return _0x11489a[_0xa4f4('0x4e')+_0x346329+_0xa4f4('0x7a')](_0x1fe3df)[_0xa4f4('0x2a')](function(_0x33ee6f){var _0x11a40c=_[_0xa4f4('0x2e')](_0x33ee6f,function(_0x4bd8cb){var _0x140f87=_[_0xa4f4('0x2e')](_0x54901e,function(_0x30c159){var _0x3fbe31={'where':{'UserId':_0x30c159,[_0x346329+_0xa4f4('0x85')]:_0x4bd8cb['id']},'transaction':_0x5a4f79};if(_0x346329==='Voice'){_0x3fbe31['defaults']={'penalty':_0x4bd8cb[_0xa4f4('0x86')][_0xa4f4('0x84')]};}return db[_0xa4f4('0x87')+_0x346329+_0xa4f4('0x76')]['findOrCreate'](_0x3fbe31)['then'](function(){socket[_0xa4f4('0x88')](_0xa4f4('0x4d')+_0x346329+_0xa4f4('0x89'),{'UserId':_0x30c159,[_0x346329+_0xa4f4('0x85')]:_0x4bd8cb['id']});if(_0x346329!==_0xa4f4('0x7d')){return;}return db[_0xa4f4('0x87')][_0xa4f4('0x47')]({'where':{'id':_0x54901e,'online':0x1},'attributes':['id',_0xa4f4('0x2b'),_0xa4f4('0x8a'),_0xa4f4('0x8b'),_0xa4f4('0x8c')],'raw':!![]})[_0xa4f4('0x2a')](function(_0x560d22){var _0x2cdf69=_[_0xa4f4('0x2e')](_0x560d22,function(_0x48df47){return db[_0xa4f4('0x8d')][_0xa4f4('0x8e')]({'membername':_0x48df47[_0xa4f4('0x2b')],'UserId':_0x48df47['id'],'queue_name':_0x4bd8cb['name'],'VoiceQueueId':_0x4bd8cb['id'],'interface':_[_0xa4f4('0x8f')](_0x48df47[_0xa4f4('0x8c')])?util[_0xa4f4('0x90')](_0xa4f4('0x91'),_0x48df47[_0xa4f4('0x2b')]):_0x48df47['interface'],'paused':_0x48df47[_0xa4f4('0x8b')]||![],'penalty':_0x4bd8cb[_0xa4f4('0x86')]['penalty']},{'transaction':_0x5a4f79});});return Promise[_0xa4f4('0x92')](_0x2cdf69);});});});return Promise['all'](_0x140f87);});return Promise[_0xa4f4('0x92')](_0x11a40c);})['then'](function(){return db['TeamVoicePrefix'][_0xa4f4('0x78')]({'where':{'teamId':_0x1af106}})[_0xa4f4('0x2a')](function(_0x1f789b){if(_0x1f789b){var _0x1ed1c8=_['map'](_0x54901e,function(_0x2ce268){db[_0xa4f4('0x6f')][_0xa4f4('0x8e')]({'UserId':_0x2ce268,'VoicePrefixId':_0x1f789b[_0xa4f4('0x93')]});});return Promise['all'](_0x1ed1c8);}});});});return Promise['all'](_0x7410a7)[_0xa4f4('0x2a')](function(){return _0x11489a[_0xa4f4('0x94')](_0x54901e,{'transaction':_0x5a4f79})[_0xa4f4('0x95')](function(_0x5aa9bf){return _0x5aa9bf;});});});}})[_0xa4f4('0x2a')](respondWithResult(_0x5e69dd,null))['catch'](handleError(_0x5e69dd,null));};exports[_0xa4f4('0x96')]=function(_0x1b7f9e,_0x5f35dc){var _0x184839=_['isArray'](_0x1b7f9e[_0xa4f4('0x34')][_0xa4f4('0x7b')])?_0x1b7f9e[_0xa4f4('0x34')]['ids']:[_0x1b7f9e['query'][_0xa4f4('0x7b')]];var _0x3bdeda=_0x1b7f9e['params']['id'];return db[_0xa4f4('0x44')][_0xa4f4('0x4c')]({'where':{'id':_0x3bdeda}})[_0xa4f4('0x2a')](handleEntityNotFound(_0x5f35dc,null))[_0xa4f4('0x2a')](function(_0x123e4c){if(_0x123e4c){var _0x3a5841=[_0xa4f4('0x7d'),_0xa4f4('0x7e'),_0xa4f4('0x7f'),_0xa4f4('0x80'),_0xa4f4('0x81'),_0xa4f4('0x97'),'Whatsapp'];return db[_0xa4f4('0x5a')][_0xa4f4('0x5b')](function(_0x97f2a6){var _0xb19399=_['map'](_0x3a5841,function(_0x349ee9){var _0x12f964={'attributes':['id','name']};return _0x123e4c['get'+_0x349ee9+_0xa4f4('0x7a')](_0x12f964)[_0xa4f4('0x2a')](function(_0x34bb65){var _0xd940da=_[_0xa4f4('0x2e')](_0x34bb65,function(_0x33fe5f){return _0x33fe5f['removeAgents'](_0x184839,{'transaction':_0x97f2a6})[_0xa4f4('0x2a')](function(){var _0x22119e=_[_0xa4f4('0x2e')](_0x184839,function(_0x25a6ac){socket[_0xa4f4('0x88')](_0xa4f4('0x4d')+_0x349ee9+'Queue:remove',{'UserId':Number(_0x25a6ac),[_0x349ee9+_0xa4f4('0x85')]:_0x33fe5f['id']});if(_0x349ee9!==_0xa4f4('0x7d')){return;}return db[_0xa4f4('0x8d')]['destroy']({'where':{'VoiceQueueId':_0x33fe5f['id'],'UserId':_0x25a6ac},'transaction':_0x97f2a6});});return Promise[_0xa4f4('0x92')](_0x22119e);});});return Promise['all'](_0xd940da);});});return Promise['all'](_0xb19399)[_0xa4f4('0x2a')](function(){return _0x123e4c[_0xa4f4('0x96')](_0x184839,{'transaction':_0x97f2a6});})['then'](function(){return db[_0xa4f4('0x6e')][_0xa4f4('0x78')]({'where':{'teamId':_0x3bdeda}})[_0xa4f4('0x2a')](function(_0x186ad7){if(_0x186ad7){var _0x2b78f5=_['map'](_0x184839,function(_0x1fc8a8){db[_0xa4f4('0x6f')]['destroy']({'where':{'UserId':_0x1fc8a8,'VoicePrefixId':_0x186ad7[_0xa4f4('0x93')]}});});return Promise[_0xa4f4('0x92')](_0x2b78f5);}});});});}})[_0xa4f4('0x2a')](respondWithStatusCode(_0x5f35dc,null))[_0xa4f4('0x49')](handleError(_0x5f35dc,null));};exports[_0xa4f4('0x98')]=function(_0x192a9c,_0x4b815d,_0x5d770e){var _0x344ece={};var _0x5aaed3={};var _0x180cf5;var _0x5f5dca;return db[_0xa4f4('0x44')][_0xa4f4('0x78')]({'where':{'id':_0x192a9c[_0xa4f4('0x4b')]['id']}})[_0xa4f4('0x2a')](handleEntityNotFound(_0x4b815d,null))[_0xa4f4('0x2a')](function(_0x19a0f5){if(_0x19a0f5){_0x180cf5=_0x19a0f5;_0x5aaed3[_0xa4f4('0x33')]=_['keys'](db[_0xa4f4('0x87')][_0xa4f4('0x2f')]);_0x5aaed3[_0xa4f4('0x34')]=_[_0xa4f4('0x35')](_0x192a9c['query']);_0x5aaed3[_0xa4f4('0x36')]=_[_0xa4f4('0x37')](_0x5aaed3[_0xa4f4('0x33')],_0x5aaed3[_0xa4f4('0x34')]);_0x344ece['attributes']=_[_0xa4f4('0x37')](_0x5aaed3[_0xa4f4('0x33')],qs[_0xa4f4('0x39')](_0x192a9c[_0xa4f4('0x34')][_0xa4f4('0x39')]));_0x344ece[_0xa4f4('0x38')]=_0x344ece[_0xa4f4('0x38')][_0xa4f4('0x3a')]?_0x344ece[_0xa4f4('0x38')]:_0x5aaed3[_0xa4f4('0x33')];_0x344ece[_0xa4f4('0x3d')]=qs[_0xa4f4('0x3e')](_0x192a9c['query'][_0xa4f4('0x3e')]);_0x344ece[_0xa4f4('0x3f')]=qs[_0xa4f4('0x36')](_[_0xa4f4('0x40')](_0x192a9c['query'],_0x5aaed3['filters']));if(_0x192a9c[_0xa4f4('0x34')][_0xa4f4('0x41')]){_0x344ece['where']=_[_0xa4f4('0x42')](_0x344ece['where'],{'$or':_[_0xa4f4('0x2e')](_0x344ece[_0xa4f4('0x38')],function(_0x4aeec3){var _0x5a2451={};_0x5a2451[_0x4aeec3]={'$like':'%'+_0x192a9c['query'][_0xa4f4('0x41')]+'%'};return _0x5a2451;})});}_0x344ece=_[_0xa4f4('0x42')]({},_0x344ece,_0x192a9c[_0xa4f4('0x43')]);return _0x180cf5['getAgents'](_0x344ece);}})[_0xa4f4('0x2a')](function(_0x525266){if(_0x525266){_0x5f5dca=_0x525266['length'];if(!_0x192a9c['query'][_0xa4f4('0x3b')]('nolimit')){_0x344ece[_0xa4f4('0x24')]=qs[_0xa4f4('0x24')](_0x192a9c[_0xa4f4('0x34')]['limit']);_0x344ece[_0xa4f4('0x21')]=qs[_0xa4f4('0x21')](_0x192a9c[_0xa4f4('0x34')][_0xa4f4('0x21')]);}return _0x180cf5[_0xa4f4('0x98')](_0x344ece);}})[_0xa4f4('0x2a')](function(_0x46e864){if(_0x46e864){return _0x46e864?{'count':_0x5f5dca,'rows':_0x46e864}:null;}})[_0xa4f4('0x2a')](respondWithResult(_0x4b815d,null))[_0xa4f4('0x49')](handleError(_0x4b815d,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 9fa9605..b3e1f3c 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 _0x6685=['hasOwnProperty','hook','exports','../../mysqldb','Team','setMaxListeners','save','update','remove','emit'];(function(_0x4605c8,_0x51fb77){var _0x74025a=function(_0x3498fa){while(--_0x3498fa){_0x4605c8['push'](_0x4605c8['shift']());}};_0x74025a(++_0x51fb77);}(_0x6685,0xfd));var _0x5668=function(_0x147d4c,_0x3ab68b){_0x147d4c=_0x147d4c-0x0;var _0x44afec=_0x6685[_0x147d4c];return _0x44afec;};'use strict';var EventEmitter=require('events');var Team=require(_0x5668('0x0'))['db'][_0x5668('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x5668('0x2')](0x0);var events={'afterCreate':_0x5668('0x3'),'afterUpdate':_0x5668('0x4'),'afterDestroy':_0x5668('0x5')};function emitEvent(_0x1a762e){return function(_0x4f0789,_0x78e1a1,_0x379bcc){TeamEvents[_0x5668('0x6')](_0x1a762e+':'+_0x4f0789['id'],_0x4f0789);TeamEvents[_0x5668('0x6')](_0x1a762e,_0x4f0789);_0x379bcc(null);};}for(var e in events){if(events[_0x5668('0x7')](e)){var event=events[e];Team[_0x5668('0x8')](e,emitEvent(event));}}module[_0x5668('0x9')]=TeamEvents; \ No newline at end of file +var _0xc9d9=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc9d9,0x141));var _0x9c9d=function(_0x2b6ff5,_0x518846){_0x2b6ff5=_0x2b6ff5-0x0;var _0x542efb=_0xc9d9[_0x2b6ff5];return _0x542efb;};'use strict';var EventEmitter=require(_0x9c9d('0x0'));var Team=require(_0x9c9d('0x1'))['db'][_0x9c9d('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c9d('0x3'),'afterUpdate':_0x9c9d('0x4'),'afterDestroy':_0x9c9d('0x5')};function emitEvent(_0x4a0386){return function(_0x306215,_0x233d8f,_0x3cb024){TeamEvents['emit'](_0x4a0386+':'+_0x306215['id'],_0x306215);TeamEvents['emit'](_0x4a0386,_0x306215);_0x3cb024(null);};}for(var e in events){if(events[_0x9c9d('0x6')](e)){var event=events[e];Team[_0x9c9d('0x7')](e,emitEvent(event));}}module[_0x9c9d('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index edaf83d..11121a2 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 _0x9151=['Team','teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','map','setDataValue','channel','catch','exports','define'];(function(_0xf887b2,_0x129d8f){var _0x28d259=function(_0xbf61a2){while(--_0xbf61a2){_0xf887b2['push'](_0xf887b2['shift']());}};_0x28d259(++_0x129d8f);}(_0x9151,0x15e));var _0x1915=function(_0x371b29,_0x2d33ed){_0x371b29=_0x371b29-0x0;var _0x434d79=_0x9151[_0x371b29];return _0x434d79;};'use strict';var _=require(_0x1915('0x0'));var attributes=require(_0x1915('0x1'));function getQueuesByChannel(_0x30bfb7,_0x5551e5){var _0x66736c=_0x1915('0x2')+_0x5551e5+_0x1915('0x3');return _0x30bfb7[_0x66736c]()['then'](function(_0x332b36){return _[_0x1915('0x4')](_0x332b36,function(_0x413978){_0x413978[_0x1915('0x5')](_0x1915('0x6'),_0x5551e5);return _0x413978;});})[_0x1915('0x7')](function(_0x1dd5cf){throw _0x1dd5cf;});}module[_0x1915('0x8')]=function(_0x3231c2){return _0x3231c2[_0x1915('0x9')](_0x1915('0xa'),attributes,{'tableName':_0x1915('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1f78b3=this;var _0x5f2fd0=[_0x1915('0xc'),'Fax',_0x1915('0xd'),_0x1915('0xe'),_0x1915('0xf'),_0x1915('0x10'),_0x1915('0x11')];return Promise[_0x1915('0x12')]()['then'](function(){var _0xd89d7e=_[_0x1915('0x4')](_0x5f2fd0,function(_0x1d08e3){return getQueuesByChannel(_0x1f78b3,_0x1d08e3);});return Promise[_0x1915('0x13')](_0xd89d7e);})[_0x1915('0x7')](function(_0x13287f){throw _0x13287f;});}}});}; \ No newline at end of file +var _0xf6da=['Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','catch','./team.attributes','Queues','then','map','setDataValue','channel','exports','define','Team','teams','Chat'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6da,0x1d5));var _0xaf6d=function(_0x28f550,_0x5ec7d4){_0x28f550=_0x28f550-0x0;var _0x3d8001=_0xf6da[_0x28f550];return _0x3d8001;};'use strict';var _=require('lodash');var attributes=require(_0xaf6d('0x0'));function getQueuesByChannel(_0x4cd81c,_0x31de85){var _0x2feb9d='get'+_0x31de85+_0xaf6d('0x1');return _0x4cd81c[_0x2feb9d]()[_0xaf6d('0x2')](function(_0x55b4b2){return _[_0xaf6d('0x3')](_0x55b4b2,function(_0x199abe){_0x199abe[_0xaf6d('0x4')](_0xaf6d('0x5'),_0x31de85);return _0x199abe;});})['catch'](function(_0x5aae76){throw _0x5aae76;});}module[_0xaf6d('0x6')]=function(_0x551373){return _0x551373[_0xaf6d('0x7')](_0xaf6d('0x8'),attributes,{'tableName':_0xaf6d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x41e61d=this;var _0x98698f=[_0xaf6d('0xa'),_0xaf6d('0xb'),_0xaf6d('0xc'),_0xaf6d('0xd'),_0xaf6d('0xe'),_0xaf6d('0xf'),_0xaf6d('0x10')];return Promise[_0xaf6d('0x11')]()['then'](function(){var _0x27d582=_[_0xaf6d('0x3')](_0x98698f,function(_0x56875c){return getQueuesByChannel(_0x41e61d,_0x56875c);});return Promise[_0xaf6d('0x12')](_0x27d582);})[_0xaf6d('0x13')](function(_0x98bf10){throw _0x98bf10;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 75fbb9a..adb9690 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 _0x287e=['jayson/promise','client','http','defaults','redis','socket.io-emitter','request','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x287e,0x75));var _0xe287=function(_0x523f64,_0x2b6add){_0x523f64=_0x523f64-0x0;var _0x36a2c3=_0x287e[_0x523f64];return _0x36a2c3;};'use strict';var _=require(_0xe287('0x0'));var util=require(_0xe287('0x1'));var moment=require(_0xe287('0x2'));var BPromise=require(_0xe287('0x3'));var rs=require(_0xe287('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe287('0x5'))(_0xe287('0x6'));var config=require(_0xe287('0x7'));var jayson=require(_0xe287('0x8'));var client=jayson[_0xe287('0x9')][_0xe287('0xa')]({'port':0x232a});config['redis']=_[_0xe287('0xb')](config[_0xe287('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xe287('0xd'))(new Redis(config[_0xe287('0xc')]));require('./team.socket')['register'](socket);function respondWithRpcPromise(_0x9e6aa2,_0x2b2bdb,_0x500ca5){return new BPromise(function(_0x13d013,_0x37c056){return client[_0xe287('0xe')](_0x9e6aa2,_0x500ca5)[_0xe287('0xf')](function(_0x34554d){logger['info'](_0xe287('0x10'),_0x2b2bdb,_0xe287('0x11'));logger['debug'](_0xe287('0x12'),_0x2b2bdb,'request\x20sent',JSON[_0xe287('0x13')](_0x34554d));if(_0x34554d[_0xe287('0x14')]){if(_0x34554d[_0xe287('0x14')]['code']===0x1f4){logger[_0xe287('0x14')]('Team,\x20%s,\x20%s',_0x2b2bdb,_0x34554d[_0xe287('0x14')][_0xe287('0x15')]);return _0x37c056(_0x34554d[_0xe287('0x14')][_0xe287('0x15')]);}logger[_0xe287('0x14')](_0xe287('0x10'),_0x2b2bdb,_0x34554d['error'][_0xe287('0x15')]);return _0x13d013(_0x34554d[_0xe287('0x14')][_0xe287('0x15')]);}else{logger[_0xe287('0x16')](_0xe287('0x10'),_0x2b2bdb,_0xe287('0x11'));_0x13d013(_0x34554d[_0xe287('0x17')][_0xe287('0x15')]);}})[_0xe287('0x18')](function(_0xa5afb3){logger['error'](_0xe287('0x10'),_0x2b2bdb,_0xa5afb3);_0x37c056(_0xa5afb3);});});} \ No newline at end of file +var _0xc932=['Team,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1d570a,_0xdabdba){var _0x3a0b6f=function(_0x95137c){while(--_0x95137c){_0x1d570a['push'](_0x1d570a['shift']());}};_0x3a0b6f(++_0xdabdba);}(_0xc932,0x95));var _0x2c93=function(_0x51c726,_0x332b95){_0x51c726=_0x51c726-0x0;var _0x23fe86=_0xc932[_0x51c726];return _0x23fe86;};'use strict';var _=require(_0x2c93('0x0'));var util=require('util');var moment=require(_0x2c93('0x1'));var BPromise=require(_0x2c93('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c93('0x3'));var db=require(_0x2c93('0x4'))['db'];var utils=require(_0x2c93('0x5'));var logger=require(_0x2c93('0x6'))(_0x2c93('0x7'));var config=require(_0x2c93('0x8'));var jayson=require(_0x2c93('0x9'));var client=jayson[_0x2c93('0xa')][_0x2c93('0xb')]({'port':0x232a});config[_0x2c93('0xc')]=_[_0x2c93('0xd')](config[_0x2c93('0xc')],{'host':_0x2c93('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2c93('0xf'))[_0x2c93('0x10')](socket);function respondWithRpcPromise(_0x3448bf,_0x477935,_0x50c4e1){return new BPromise(function(_0xad37f7,_0x25579a){return client[_0x2c93('0x11')](_0x3448bf,_0x50c4e1)[_0x2c93('0x12')](function(_0xda7a8b){logger[_0x2c93('0x13')]('Team,\x20%s,\x20%s',_0x477935,_0x2c93('0x14'));logger[_0x2c93('0x15')](_0x2c93('0x16'),_0x477935,'request\x20sent',JSON['stringify'](_0xda7a8b));if(_0xda7a8b[_0x2c93('0x17')]){if(_0xda7a8b[_0x2c93('0x17')][_0x2c93('0x18')]===0x1f4){logger[_0x2c93('0x17')](_0x2c93('0x19'),_0x477935,_0xda7a8b['error'][_0x2c93('0x1a')]);return _0x25579a(_0xda7a8b['error'][_0x2c93('0x1a')]);}logger[_0x2c93('0x17')](_0x2c93('0x19'),_0x477935,_0xda7a8b[_0x2c93('0x17')]['message']);return _0xad37f7(_0xda7a8b['error'][_0x2c93('0x1a')]);}else{logger['info'](_0x2c93('0x19'),_0x477935,_0x2c93('0x14'));_0xad37f7(_0xda7a8b[_0x2c93('0x1b')]['message']);}})[_0x2c93('0x1c')](function(_0xdbfffd){logger[_0x2c93('0x17')](_0x2c93('0x19'),_0x477935,_0xdbfffd);_0x25579a(_0xdbfffd);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index bf7732e..e6f4546 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 _0x081c=['length','team:','./team.events','remove','update','emit','removeListener','register'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x081c,0x16a));var _0xc081=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x081c[_0x7d62cb];return _0x3a6266;};'use strict';var TeamEvents=require(_0xc081('0x0'));var events=['save',_0xc081('0x1'),_0xc081('0x2')];function createListener(_0x2a8e80,_0xfa398a){return function(_0x5fef56){_0xfa398a[_0xc081('0x3')](_0x2a8e80,_0x5fef56);};}function removeListener(_0x12db8f,_0x2c9b23){return function(){TeamEvents[_0xc081('0x4')](_0x12db8f,_0x2c9b23);};}exports[_0xc081('0x5')]=function(_0x4c7506){for(var _0x3e7bf7=0x0,_0x58a8fa=events[_0xc081('0x6')];_0x3e7bf7<_0x58a8fa;_0x3e7bf7++){var _0x4b539d=events[_0x3e7bf7];var _0x51b7a1=createListener(_0xc081('0x7')+_0x4b539d,_0x4c7506);TeamEvents['on'](_0x4b539d,_0x51b7a1);}}; \ No newline at end of file +var _0xc4ff=['team:','save','remove','update','emit','removeListener','register','length'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xc4ff,0x111));var _0xfc4f=function(_0x169b0f,_0x4605e6){_0x169b0f=_0x169b0f-0x0;var _0x17bf28=_0xc4ff[_0x169b0f];return _0x17bf28;};'use strict';var TeamEvents=require('./team.events');var events=[_0xfc4f('0x0'),_0xfc4f('0x1'),_0xfc4f('0x2')];function createListener(_0x2dae53,_0x3f5f60){return function(_0x4e1f76){_0x3f5f60[_0xfc4f('0x3')](_0x2dae53,_0x4e1f76);};}function removeListener(_0x2c8aed,_0x134680){return function(){TeamEvents[_0xfc4f('0x4')](_0x2c8aed,_0x134680);};}exports[_0xfc4f('0x5')]=function(_0x260a13){for(var _0x191269=0x0,_0x23f54a=events[_0xfc4f('0x6')];_0x191269<_0x23f54a;_0x191269++){var _0x17b13e=events[_0x191269];var _0x12f070=createListener(_0xfc4f('0x7')+_0x17b13e,_0x260a13);TeamEvents['on'](_0x17b13e,_0x12f070);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e13ce4b..efd37fd 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 _0xd20f=['exports','INTEGER','sequelize'];(function(_0x19e721,_0x2ac35d){var _0x560071=function(_0x4206c9){while(--_0x4206c9){_0x19e721['push'](_0x19e721['shift']());}};_0x560071(++_0x2ac35d);}(_0xd20f,0xbf));var _0xfd20=function(_0x166de9,_0x2bd260){_0x166de9=_0x166de9-0x0;var _0x16c0c4=_0xd20f[_0x166de9];return _0x16c0c4;};'use strict';var Sequelize=require(_0xfd20('0x0'));module[_0xfd20('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xfd20('0x2')]}}; \ No newline at end of file +var _0x78d8=['exports','INTEGER'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x78d8,0x15c));var _0x878d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x78d8[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x878d('0x0')]={'TeamId':{'type':Sequelize[_0x878d('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x878d('0x1')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 1c6e457..c0876b7 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 _0xcbde=['moment','bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','team_has_voice_prefixes','lodash','../../config/logger','api'];(function(_0x5dc069,_0x382e77){var _0x8fd949=function(_0x4997ce){while(--_0x4997ce){_0x5dc069['push'](_0x5dc069['shift']());}};_0x8fd949(++_0x382e77);}(_0xcbde,0x141));var _0xecbd=function(_0x80dc74,_0x52f84b){_0x80dc74=_0x80dc74-0x0;var _0x4b76c2=_0xcbde[_0x80dc74];return _0x4b76c2;};'use strict';var _=require(_0xecbd('0x0'));var util=require('util');var logger=require(_0xecbd('0x1'))(_0xecbd('0x2'));var moment=require(_0xecbd('0x3'));var BPromise=require(_0xecbd('0x4'));var rp=require(_0xecbd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xecbd('0x6'));var attributes=require(_0xecbd('0x7'));module['exports']=function(_0x25b899,_0x27a04d){return _0x25b899['define']('TeamVoicePrefix',attributes,{'tableName':_0xecbd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa887=['../../config/environment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x146250,_0x36d953){var _0x515ccd=function(_0x4c4a32){while(--_0x4c4a32){_0x146250['push'](_0x146250['shift']());}};_0x515ccd(++_0x36d953);}(_0xa887,0x89));var _0x7a88=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa887[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7a88('0x0'));var util=require('util');var logger=require(_0x7a88('0x1'))(_0x7a88('0x2'));var moment=require('moment');var BPromise=require(_0x7a88('0x3'));var rp=require(_0x7a88('0x4'));var fs=require('fs');var path=require(_0x7a88('0x5'));var rimraf=require(_0x7a88('0x6'));var config=require(_0x7a88('0x7'));var attributes=require(_0x7a88('0x8'));module[_0x7a88('0x9')]=function(_0xf70f6,_0x12fabf){return _0xf70f6['define'](_0x7a88('0xa'),attributes,{'tableName':_0x7a88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index fd0f454..5955d71 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x837239,_0x2a8a19){var _0x2b1d96=function(_0x972b46){while(--_0x972b46){_0x837239['push'](_0x837239['shift']());}};_0x2b1d96(++_0x2a8a19);}(_0x70e0,0x17b));var _0x070e=function(_0x2c2e86,_0x14fc30){_0x2c2e86=_0x2c2e86-0x0;var _0x3caa75=_0x70e0[_0x2c2e86];return _0x3caa75;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d1caa58..3e294bc 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 _0x06b2=['INTEGER','sequelize','exports'];(function(_0x4e28af,_0x33748c){var _0x1fb5e0=function(_0x4c6cc7){while(--_0x4c6cc7){_0x4e28af['push'](_0x4e28af['shift']());}};_0x1fb5e0(++_0x33748c);}(_0x06b2,0x124));var _0x206b=function(_0x43c62b,_0x58efd1){_0x43c62b=_0x43c62b-0x0;var _0x2b23e7=_0x06b2[_0x43c62b];return _0x2b23e7;};'use strict';var Sequelize=require(_0x206b('0x0'));module[_0x206b('0x1')]={'penalty':{'type':Sequelize[_0x206b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4bc2=['sequelize','exports'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x4bc2,0xe4));var _0x24bc=function(_0x11dd9a,_0x175eb2){_0x11dd9a=_0x11dd9a-0x0;var _0x247f46=_0x4bc2[_0x11dd9a];return _0x247f46;};'use strict';var Sequelize=require(_0x24bc('0x0'));module[_0x24bc('0x1')]={'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 6bdcef3..ca6bda5 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 _0x3d6d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger'];(function(_0x48aab1,_0x40c4ff){var _0x3f6f07=function(_0x2131b4){while(--_0x2131b4){_0x48aab1['push'](_0x48aab1['shift']());}};_0x3f6f07(++_0x40c4ff);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x3d6d[_0x4ae829];return _0x256b31;};'use strict';var _=require(_0xd3d6('0x0'));var util=require(_0xd3d6('0x1'));var logger=require(_0xd3d6('0x2'))(_0xd3d6('0x3'));var moment=require(_0xd3d6('0x4'));var BPromise=require(_0xd3d6('0x5'));var rp=require(_0xd3d6('0x6'));var fs=require('fs');var path=require(_0xd3d6('0x7'));var rimraf=require(_0xd3d6('0x8'));var config=require(_0xd3d6('0x9'));var attributes=require(_0xd3d6('0xa'));module['exports']=function(_0x5400f8,_0x3f36){return _0x5400f8[_0xd3d6('0xb')](_0xd3d6('0xc'),attributes,{'tableName':_0xd3d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb31a=['define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x36d5da,_0x4e2e1b){var _0x1df228=function(_0x45be13){while(--_0x45be13){_0x36d5da['push'](_0x36d5da['shift']());}};_0x1df228(++_0x4e2e1b);}(_0xb31a,0xd4));var _0xab31=function(_0x4af334,_0x4dcfa6){_0x4af334=_0x4af334-0x0;var _0x48ef93=_0xb31a[_0x4af334];return _0x48ef93;};'use strict';var _=require(_0xab31('0x0'));var util=require(_0xab31('0x1'));var logger=require(_0xab31('0x2'))(_0xab31('0x3'));var moment=require(_0xab31('0x4'));var BPromise=require(_0xab31('0x5'));var rp=require(_0xab31('0x6'));var fs=require('fs');var path=require(_0xab31('0x7'));var rimraf=require(_0xab31('0x8'));var config=require(_0xab31('0x9'));var attributes=require(_0xab31('0xa'));module[_0xab31('0xb')]=function(_0x9c6740,_0x2c336b){return _0x9c6740[_0xab31('0xc')]('TeamVoiceQueue',attributes,{'tableName':_0xab31('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 3ea199c..2a10e8e 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 _0xe700=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','../../config/utils'];(function(_0x18ca46,_0x1f0589){var _0x4613b7=function(_0x397f18){while(--_0x397f18){_0x18ca46['push'](_0x18ca46['shift']());}};_0x4613b7(++_0x1f0589);}(_0xe700,0xf7));var _0x0e70=function(_0x4a4604,_0x3bbcc5){_0x4a4604=_0x4a4604-0x0;var _0x10d51a=_0xe700[_0x4a4604];return _0x10d51a;};'use strict';var _=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var moment=require(_0x0e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e70('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e70('0x4'));var logger=require(_0x0e70('0x5'))(_0x0e70('0x6'));var config=require('../../config/environment');var jayson=require(_0x0e70('0x7'));var client=jayson[_0x0e70('0x8')][_0x0e70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2917c5,_0x286353,_0x17f27e){return new BPromise(function(_0x43547a,_0x14c000){return client[_0x0e70('0xa')](_0x2917c5,_0x17f27e)[_0x0e70('0xb')](function(_0x277b30){logger[_0x0e70('0xc')](_0x0e70('0xd'),_0x286353,_0x0e70('0xe'));logger[_0x0e70('0xf')](_0x0e70('0x10'),_0x286353,'request\x20sent',JSON['stringify'](_0x277b30));if(_0x277b30[_0x0e70('0x11')]){if(_0x277b30['error'][_0x0e70('0x12')]===0x1f4){logger['error'](_0x0e70('0xd'),_0x286353,_0x277b30[_0x0e70('0x11')]['message']);return _0x14c000(_0x277b30[_0x0e70('0x11')][_0x0e70('0x13')]);}logger['error'](_0x0e70('0xd'),_0x286353,_0x277b30[_0x0e70('0x11')][_0x0e70('0x13')]);return _0x43547a(_0x277b30['error'][_0x0e70('0x13')]);}else{logger[_0x0e70('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x286353,'request\x20sent');_0x43547a(_0x277b30[_0x0e70('0x14')]['message']);}})['catch'](function(_0x9ff2f7){logger[_0x0e70('0x11')](_0x0e70('0xd'),_0x286353,_0x9ff2f7);_0x14c000(_0x9ff2f7);});});} \ No newline at end of file +var _0xe78c=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','randomstring','../../mysqldb','../../config/utils','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0xe78c,0xaa));var _0xce78=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe78c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0xce78('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xce78('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce78('0x2'))['db'];var utils=require(_0xce78('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce78('0x4')][_0xce78('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2afba0,_0x5b2057,_0x204148){return new BPromise(function(_0x1c3788,_0x29c2c0){return client[_0xce78('0x6')](_0x2afba0,_0x204148)[_0xce78('0x7')](function(_0x5d186a){logger['info'](_0xce78('0x8'),_0x5b2057,_0xce78('0x9'));logger[_0xce78('0xa')](_0xce78('0xb'),_0x5b2057,_0xce78('0x9'),JSON['stringify'](_0x5d186a));if(_0x5d186a['error']){if(_0x5d186a[_0xce78('0xc')][_0xce78('0xd')]===0x1f4){logger[_0xce78('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5b2057,_0x5d186a[_0xce78('0xc')]['message']);return _0x29c2c0(_0x5d186a[_0xce78('0xc')][_0xce78('0xe')]);}logger['error'](_0xce78('0x8'),_0x5b2057,_0x5d186a['error'][_0xce78('0xe')]);return _0x1c3788(_0x5d186a[_0xce78('0xc')][_0xce78('0xe')]);}else{logger[_0xce78('0xf')](_0xce78('0x8'),_0x5b2057,_0xce78('0x9'));_0x1c3788(_0x5d186a[_0xce78('0x10')][_0xce78('0xe')]);}})[_0xce78('0x11')](function(_0xe5c945){logger[_0xce78('0xc')](_0xce78('0x8'),_0x5b2057,_0xe5c945);_0x29c2c0(_0xe5c945);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 3d21054..d7d2e5a 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 _0xb470=['get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0xb470,0x75));var _0x0b47=function(_0x44187a,_0xcde2b4){_0x44187a=_0x44187a-0x0;var _0x5a8049=_0xb470[_0x44187a];return _0x5a8049;};'use strict';var multer=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var path=require(_0x0b47('0x2'));var timeout=require(_0x0b47('0x3'));var express=require('express');var router=express[_0x0b47('0x4')]();var fs_extra=require(_0x0b47('0x5'));var auth=require(_0x0b47('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b47('0x7'));var controller=require(_0x0b47('0x8'));router[_0x0b47('0x9')]('/',auth[_0x0b47('0xa')](),controller[_0x0b47('0xb')]);router[_0x0b47('0x9')](_0x0b47('0xc'),auth[_0x0b47('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0b47('0xd')](_0x0b47('0xc'),auth['isAuthenticated'](),controller[_0x0b47('0xe')]);router[_0x0b47('0xf')](_0x0b47('0xc'),auth[_0x0b47('0xa')](),controller[_0x0b47('0x10')]);module[_0x0b47('0x11')]=router; \ No newline at end of file +var _0xfb0b=['post','create','delete','exports','multer','util','path','express','Router','../../components/interaction/service','./template.controller','get','isAuthenticated','index','/:id','show'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xfb0b,0x94));var _0xbfb0=function(_0xacec1f,_0x53c3d3){_0xacec1f=_0xacec1f-0x0;var _0x636b54=_0xfb0b[_0xacec1f];return _0x636b54;};'use strict';var multer=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var path=require(_0xbfb0('0x2'));var timeout=require('connect-timeout');var express=require(_0xbfb0('0x3'));var router=express[_0xbfb0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbfb0('0x5'));var config=require('../../config/environment');var controller=require(_0xbfb0('0x6'));router[_0xbfb0('0x7')]('/',auth[_0xbfb0('0x8')](),controller[_0xbfb0('0x9')]);router[_0xbfb0('0x7')](_0xbfb0('0xa'),auth['isAuthenticated'](),controller[_0xbfb0('0xb')]);router[_0xbfb0('0xc')]('/',auth[_0xbfb0('0x8')](),controller[_0xbfb0('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbfb0('0xe')](_0xbfb0('0xa'),auth[_0xbfb0('0x8')](),controller['destroy']);module[_0xbfb0('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 3f35e84..a76bf7c 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 _0xa866=['STRING'];(function(_0x2b92d2,_0x4e8ded){var _0x133446=function(_0x43edf5){while(--_0x43edf5){_0x2b92d2['push'](_0x2b92d2['shift']());}};_0x133446(++_0x4e8ded);}(_0xa866,0x1ac));var _0x6a86=function(_0x5c90d7,_0x3e6486){_0x5c90d7=_0x5c90d7-0x0;var _0x173e5e=_0xa866[_0x5c90d7];return _0x173e5e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6a86('0x0')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0f45=['exports','STRING','TEXT','sequelize'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x0f45,0xa3));var _0x50f4=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x0f45[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0x50f4('0x0'));module[_0x50f4('0x1')]={'name':{'type':Sequelize[_0x50f4('0x2')]},'description':{'type':Sequelize[_0x50f4('0x2')]},'html':{'type':Sequelize[_0x50f4('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index d0aa65c..deffa61 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 _0x92d5=['fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','Templates','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','Template','includeAll','include','findAll','show','params','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir'];(function(_0xeb67d8,_0x14a337){var _0x4138f9=function(_0x3b0407){while(--_0x3b0407){_0xeb67d8['push'](_0xeb67d8['shift']());}};_0x4138f9(++_0x14a337);}(_0x92d5,0xf3));var _0x592d=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x92d5[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x592d('0x0'));var rimraf=require(_0x592d('0x1'));var zipdir=require(_0x592d('0x2'));var jsonpatch=require(_0x592d('0x3'));var rp=require(_0x592d('0x4'));var moment=require('moment');var BPromise=require(_0x592d('0x5'));var Mustache=require(_0x592d('0x6'));var util=require(_0x592d('0x7'));var path=require('path');var sox=require(_0x592d('0x8'));var csv=require(_0x592d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x592d('0xa'));var _=require(_0x592d('0xb'));var squel=require('squel');var crypto=require(_0x592d('0xc'));var jsforce=require(_0x592d('0xd'));var deskjs=require(_0x592d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x592d('0xf'));var Redis=require('ioredis');var authService=require(_0x592d('0x10'));var qs=require(_0x592d('0x11'));var as=require(_0x592d('0x12'));var hardwareService=require(_0x592d('0x13'));var logger=require(_0x592d('0x14'))('api');var utils=require(_0x592d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4372d3,_0x4f81c3){_0x4f81c3=_0x4f81c3||0xcc;return function(_0x16659f){if(_0x16659f){return _0x4372d3[_0x592d('0x16')](_0x4f81c3);}return _0x4372d3[_0x592d('0x17')](_0x4f81c3)[_0x592d('0x18')]();};}function respondWithResult(_0x4146ea,_0x1290a2){_0x1290a2=_0x1290a2||0xc8;return function(_0x20995c){if(_0x20995c){return _0x4146ea[_0x592d('0x17')](_0x1290a2)[_0x592d('0x19')](_0x20995c);}};}function respondWithFilteredResult(_0x251f0a,_0x9be1b7){return function(_0x10e313){if(_0x10e313){var _0x2e641d=typeof _0x9be1b7[_0x592d('0x1a')]===_0x592d('0x1b')&&typeof _0x9be1b7[_0x592d('0x1c')]==='undefined';var _0x5eced5=_0x10e313['count'];var _0x2be87b=_0x2e641d?0x0:_0x9be1b7[_0x592d('0x1a')];var _0x172ddc=_0x2e641d?_0x10e313[_0x592d('0x1d')]:_0x9be1b7[_0x592d('0x1a')]+_0x9be1b7[_0x592d('0x1c')];var _0x2d072c;if(_0x172ddc>=_0x5eced5){_0x172ddc=_0x5eced5;_0x2d072c=0xc8;}else{_0x2d072c=0xce;}_0x251f0a['status'](_0x2d072c);return _0x251f0a[_0x592d('0x1e')](_0x592d('0x1f'),_0x2be87b+'-'+_0x172ddc+'/'+_0x5eced5)[_0x592d('0x19')](_0x10e313);}return null;};}function patchUpdates(_0x5d5db3){return function(_0x2dc35f){try{jsonpatch[_0x592d('0x20')](_0x2dc35f,_0x5d5db3,!![]);}catch(_0x58b14c){return BPromise[_0x592d('0x21')](_0x58b14c);}return _0x2dc35f[_0x592d('0x22')]();};}function saveUpdates(_0x26f681,_0x2f2fbc){return function(_0x56b36a){if(_0x56b36a){return _0x56b36a['update'](_0x26f681)['then'](function(_0x26e7c7){return _0x26e7c7;});}return null;};}function removeEntity(_0x15a68b,_0x235fab){return function(_0x2d97b8){if(_0x2d97b8){return _0x2d97b8[_0x592d('0x23')]()[_0x592d('0x24')](function(){var _0x2c6b1b=_0x2d97b8['get']({'plain':!![]});var _0x34bd7c=_0x592d('0x25');return db['UserProfileResource'][_0x592d('0x23')]({'where':{'type':_0x34bd7c,'resourceId':_0x2c6b1b['id']}})[_0x592d('0x24')](function(){return _0x2d97b8;});})[_0x592d('0x24')](function(){_0x15a68b[_0x592d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e9bb2,_0x54e4e5){return function(_0x4f2579){if(!_0x4f2579){_0x1e9bb2[_0x592d('0x16')](0x194);}return _0x4f2579;};}function handleError(_0x1a8b6e,_0x1c5ae9){_0x1c5ae9=_0x1c5ae9||0x1f4;return function(_0x35df40){logger[_0x592d('0x26')](_0x35df40['stack']);if(_0x35df40[_0x592d('0x27')]){delete _0x35df40['name'];}_0x1a8b6e[_0x592d('0x17')](_0x1c5ae9)[_0x592d('0x28')](_0x35df40);};}exports['index']=function(_0x47bba8,_0x4c0433){var _0x12be00={},_0x14cb3d={},_0x37ace7={'count':0x0,'rows':[]};var _0x2a1d6e=_[_0x592d('0x29')](db['Template'][_0x592d('0x2a')],function(_0xa02c05){return{'name':_0xa02c05[_0x592d('0x2b')],'type':_0xa02c05[_0x592d('0x2c')][_0x592d('0x2d')]};});_0x14cb3d['model']=_[_0x592d('0x29')](_0x2a1d6e,'name');_0x14cb3d[_0x592d('0x2e')]=_[_0x592d('0x2f')](_0x47bba8[_0x592d('0x2e')]);_0x14cb3d['filters']=_[_0x592d('0x30')](_0x14cb3d[_0x592d('0x31')],_0x14cb3d[_0x592d('0x2e')]);_0x12be00[_0x592d('0x32')]=_[_0x592d('0x30')](_0x14cb3d[_0x592d('0x31')],qs[_0x592d('0x33')](_0x47bba8[_0x592d('0x2e')]['fields']));_0x12be00[_0x592d('0x32')]=_0x12be00['attributes'][_0x592d('0x34')]?_0x12be00[_0x592d('0x32')]:_0x14cb3d[_0x592d('0x31')];if(!_0x47bba8[_0x592d('0x2e')]['hasOwnProperty'](_0x592d('0x35'))){_0x12be00['limit']=qs[_0x592d('0x1c')](_0x47bba8[_0x592d('0x2e')]['limit']);_0x12be00['offset']=qs[_0x592d('0x1a')](_0x47bba8[_0x592d('0x2e')][_0x592d('0x1a')]);}_0x12be00[_0x592d('0x36')]=qs[_0x592d('0x37')](_0x47bba8[_0x592d('0x2e')][_0x592d('0x37')]);_0x12be00[_0x592d('0x38')]=qs['filters'](_[_0x592d('0x39')](_0x47bba8[_0x592d('0x2e')],_0x14cb3d[_0x592d('0x3a')]),_0x2a1d6e);if(_0x47bba8[_0x592d('0x2e')][_0x592d('0x3b')]){_0x12be00[_0x592d('0x38')]=_[_0x592d('0x3c')](_0x12be00[_0x592d('0x38')],{'$or':_['map'](_0x2a1d6e,function(_0x4f416c){if(_0x4f416c['type']!==_0x592d('0x3d')){var _0x28cf8b={};_0x28cf8b[_0x4f416c['name']]={'$like':'%'+_0x47bba8[_0x592d('0x2e')][_0x592d('0x3b')]+'%'};return _0x28cf8b;}})});}_0x12be00=_[_0x592d('0x3c')]({},_0x12be00,_0x47bba8['options']);var _0x2f19ad={'where':_0x12be00[_0x592d('0x38')]};return db[_0x592d('0x3e')]['count'](_0x2f19ad)[_0x592d('0x24')](function(_0x528e53){_0x37ace7[_0x592d('0x1d')]=_0x528e53;if(_0x47bba8[_0x592d('0x2e')][_0x592d('0x3f')]){_0x12be00[_0x592d('0x40')]=[{'all':!![]}];}return db[_0x592d('0x3e')][_0x592d('0x41')](_0x12be00);})[_0x592d('0x24')](function(_0x1b184e){_0x37ace7['rows']=_0x1b184e;return _0x37ace7;})['then'](respondWithFilteredResult(_0x4c0433,_0x12be00))['catch'](handleError(_0x4c0433,null));};exports[_0x592d('0x42')]=function(_0x1c9fec,_0x249633){var _0x1eecea={'raw':!![],'where':{'id':_0x1c9fec[_0x592d('0x43')]['id']}},_0x418a84={};_0x418a84[_0x592d('0x31')]=_[_0x592d('0x2f')](db[_0x592d('0x3e')]['rawAttributes']);_0x418a84[_0x592d('0x2e')]=_['keys'](_0x1c9fec[_0x592d('0x2e')]);_0x418a84[_0x592d('0x3a')]=_[_0x592d('0x30')](_0x418a84[_0x592d('0x31')],_0x418a84[_0x592d('0x2e')]);_0x1eecea[_0x592d('0x32')]=_[_0x592d('0x30')](_0x418a84['model'],qs[_0x592d('0x33')](_0x1c9fec[_0x592d('0x2e')][_0x592d('0x33')]));_0x1eecea[_0x592d('0x32')]=_0x1eecea[_0x592d('0x32')][_0x592d('0x34')]?_0x1eecea[_0x592d('0x32')]:_0x418a84[_0x592d('0x31')];if(_0x1c9fec[_0x592d('0x2e')][_0x592d('0x3f')]){_0x1eecea[_0x592d('0x40')]=[{'all':!![]}];}_0x1eecea=_[_0x592d('0x3c')]({},_0x1eecea,_0x1c9fec[_0x592d('0x44')]);return db[_0x592d('0x3e')][_0x592d('0x45')](_0x1eecea)[_0x592d('0x24')](handleEntityNotFound(_0x249633,null))['then'](respondWithResult(_0x249633,null))[_0x592d('0x46')](handleError(_0x249633,null));};exports[_0x592d('0x47')]=function(_0x212978,_0x39a315){return db[_0x592d('0x3e')][_0x592d('0x47')](_0x212978[_0x592d('0x48')],{})['then'](function(_0x16873e){var _0x1b4489=_0x212978[_0x592d('0x49')][_0x592d('0x4a')]({'plain':!![]});if(!_0x1b4489)throw new Error(_0x592d('0x4b'));if(_0x1b4489[_0x592d('0x4c')]==='user'){var _0x2d90b8=_0x16873e['get']({'plain':!![]});var _0x1bdf7c=_0x592d('0x25');return db[_0x592d('0x4d')]['find']({'where':{'name':_0x1bdf7c,'userProfileId':_0x1b4489[_0x592d('0x4e')]},'raw':!![]})[_0x592d('0x24')](function(_0x5c959a){if(_0x5c959a&&_0x5c959a['autoAssociation']===0x0){return db[_0x592d('0x4f')][_0x592d('0x47')]({'name':_0x2d90b8[_0x592d('0x27')],'resourceId':_0x2d90b8['id'],'type':_0x5c959a[_0x592d('0x27')],'sectionId':_0x5c959a['id']},{})[_0x592d('0x24')](function(){return _0x16873e;});}else{return _0x16873e;}})[_0x592d('0x46')](function(_0x358e12){logger[_0x592d('0x26')](_0x592d('0x50'),_0x358e12);throw _0x358e12;});}return _0x16873e;})[_0x592d('0x24')](respondWithResult(_0x39a315,0xc9))[_0x592d('0x46')](handleError(_0x39a315,null));};exports[_0x592d('0x51')]=function(_0x26d2eb,_0x2b3f92){if(_0x26d2eb[_0x592d('0x48')]['id']){delete _0x26d2eb['body']['id'];}return db[_0x592d('0x3e')][_0x592d('0x45')]({'where':{'id':_0x26d2eb['params']['id']}})[_0x592d('0x24')](handleEntityNotFound(_0x2b3f92,null))[_0x592d('0x24')](saveUpdates(_0x26d2eb['body'],null))[_0x592d('0x24')](respondWithResult(_0x2b3f92,null))[_0x592d('0x46')](handleError(_0x2b3f92,null));};exports['destroy']=function(_0x34ca1e,_0x45bd95){return db[_0x592d('0x3e')][_0x592d('0x45')]({'where':{'id':_0x34ca1e[_0x592d('0x43')]['id']}})[_0x592d('0x24')](handleEntityNotFound(_0x45bd95,null))[_0x592d('0x24')](removeEntity(_0x45bd95,null))['catch'](handleError(_0x45bd95,null));}; \ No newline at end of file +var _0x2753=['limit','undefined','count','Content-Range','json','apply','save','update','destroy','then','get','Templates','end','error','stack','name','send','index','map','Template','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset'];(function(_0x181094,_0x5cb367){var _0x3fb1db=function(_0x497aee){while(--_0x497aee){_0x181094['push'](_0x181094['shift']());}};_0x3fb1db(++_0x5cb367);}(_0x2753,0xe0));var _0x3275=function(_0x245400,_0x153e01){_0x245400=_0x245400-0x0;var _0x3ea712=_0x2753[_0x245400];return _0x3ea712;};'use strict';var emlformat=require(_0x3275('0x0'));var rimraf=require(_0x3275('0x1'));var zipdir=require(_0x3275('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3275('0x3'));var moment=require(_0x3275('0x4'));var BPromise=require(_0x3275('0x5'));var Mustache=require(_0x3275('0x6'));var util=require(_0x3275('0x7'));var path=require(_0x3275('0x8'));var sox=require(_0x3275('0x9'));var csv=require(_0x3275('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3275('0xb'));var _=require(_0x3275('0xc'));var squel=require(_0x3275('0xd'));var crypto=require(_0x3275('0xe'));var jsforce=require(_0x3275('0xf'));var deskjs=require(_0x3275('0x10'));var toCsv=require(_0x3275('0xa'));var querystring=require('querystring');var Papa=require(_0x3275('0x11'));var Redis=require(_0x3275('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3275('0x13'));var hardwareService=require(_0x3275('0x14'));var logger=require(_0x3275('0x15'))('api');var utils=require(_0x3275('0x16'));var config=require(_0x3275('0x17'));var licenseUtil=require(_0x3275('0x18'));var db=require(_0x3275('0x19'))['db'];function respondWithStatusCode(_0x131cd9,_0xa38895){_0xa38895=_0xa38895||0xcc;return function(_0x37f814){if(_0x37f814){return _0x131cd9['sendStatus'](_0xa38895);}return _0x131cd9[_0x3275('0x1a')](_0xa38895)['end']();};}function respondWithResult(_0x584df6,_0x16b894){_0x16b894=_0x16b894||0xc8;return function(_0x44966a){if(_0x44966a){return _0x584df6['status'](_0x16b894)['json'](_0x44966a);}};}function respondWithFilteredResult(_0x2ce25f,_0x3188c0){return function(_0x6a0470){if(_0x6a0470){var _0x575c6c=typeof _0x3188c0[_0x3275('0x1b')]==='undefined'&&typeof _0x3188c0[_0x3275('0x1c')]===_0x3275('0x1d');var _0x577675=_0x6a0470[_0x3275('0x1e')];var _0x822fbb=_0x575c6c?0x0:_0x3188c0[_0x3275('0x1b')];var _0x2bc151=_0x575c6c?_0x6a0470['count']:_0x3188c0[_0x3275('0x1b')]+_0x3188c0['limit'];var _0x31ed39;if(_0x2bc151>=_0x577675){_0x2bc151=_0x577675;_0x31ed39=0xc8;}else{_0x31ed39=0xce;}_0x2ce25f[_0x3275('0x1a')](_0x31ed39);return _0x2ce25f['set'](_0x3275('0x1f'),_0x822fbb+'-'+_0x2bc151+'/'+_0x577675)[_0x3275('0x20')](_0x6a0470);}return null;};}function patchUpdates(_0x3ecd08){return function(_0x29a546){try{jsonpatch[_0x3275('0x21')](_0x29a546,_0x3ecd08,!![]);}catch(_0x3dc52d){return BPromise['reject'](_0x3dc52d);}return _0x29a546[_0x3275('0x22')]();};}function saveUpdates(_0x2eca5f,_0xff0cb1){return function(_0xa6120a){if(_0xa6120a){return _0xa6120a[_0x3275('0x23')](_0x2eca5f)['then'](function(_0x31ad19){return _0x31ad19;});}return null;};}function removeEntity(_0x13dce6,_0x116c3e){return function(_0x680aeb){if(_0x680aeb){return _0x680aeb[_0x3275('0x24')]()[_0x3275('0x25')](function(){var _0x521597=_0x680aeb[_0x3275('0x26')]({'plain':!![]});var _0x2748a6=_0x3275('0x27');return db['UserProfileResource'][_0x3275('0x24')]({'where':{'type':_0x2748a6,'resourceId':_0x521597['id']}})['then'](function(){return _0x680aeb;});})[_0x3275('0x25')](function(){_0x13dce6[_0x3275('0x1a')](0xcc)[_0x3275('0x28')]();});}};}function handleEntityNotFound(_0x3ea84d,_0x5bd95e){return function(_0x2364ee){if(!_0x2364ee){_0x3ea84d['sendStatus'](0x194);}return _0x2364ee;};}function handleError(_0x4eb2d1,_0x4d0321){_0x4d0321=_0x4d0321||0x1f4;return function(_0x1835d3){logger[_0x3275('0x29')](_0x1835d3[_0x3275('0x2a')]);if(_0x1835d3[_0x3275('0x2b')]){delete _0x1835d3[_0x3275('0x2b')];}_0x4eb2d1[_0x3275('0x1a')](_0x4d0321)[_0x3275('0x2c')](_0x1835d3);};}exports[_0x3275('0x2d')]=function(_0x209749,_0x277364){var _0x596d05={},_0x1de8d8={},_0xf27227={'count':0x0,'rows':[]};var _0x19abf2=_[_0x3275('0x2e')](db[_0x3275('0x2f')][_0x3275('0x30')],function(_0x1939c0){return{'name':_0x1939c0['fieldName'],'type':_0x1939c0[_0x3275('0x31')][_0x3275('0x32')]};});_0x1de8d8[_0x3275('0x33')]=_[_0x3275('0x2e')](_0x19abf2,_0x3275('0x2b'));_0x1de8d8[_0x3275('0x34')]=_[_0x3275('0x35')](_0x209749[_0x3275('0x34')]);_0x1de8d8[_0x3275('0x36')]=_['intersection'](_0x1de8d8[_0x3275('0x33')],_0x1de8d8[_0x3275('0x34')]);_0x596d05[_0x3275('0x37')]=_[_0x3275('0x38')](_0x1de8d8['model'],qs[_0x3275('0x39')](_0x209749[_0x3275('0x34')]['fields']));_0x596d05[_0x3275('0x37')]=_0x596d05[_0x3275('0x37')][_0x3275('0x3a')]?_0x596d05['attributes']:_0x1de8d8[_0x3275('0x33')];if(!_0x209749[_0x3275('0x34')][_0x3275('0x3b')](_0x3275('0x3c'))){_0x596d05['limit']=qs[_0x3275('0x1c')](_0x209749[_0x3275('0x34')][_0x3275('0x1c')]);_0x596d05[_0x3275('0x1b')]=qs[_0x3275('0x1b')](_0x209749[_0x3275('0x34')]['offset']);}_0x596d05[_0x3275('0x3d')]=qs[_0x3275('0x3e')](_0x209749[_0x3275('0x34')]['sort']);_0x596d05[_0x3275('0x3f')]=qs[_0x3275('0x36')](_[_0x3275('0x40')](_0x209749['query'],_0x1de8d8['filters']),_0x19abf2);if(_0x209749['query'][_0x3275('0x41')]){_0x596d05[_0x3275('0x3f')]=_[_0x3275('0x42')](_0x596d05[_0x3275('0x3f')],{'$or':_[_0x3275('0x2e')](_0x19abf2,function(_0x5382a1){if(_0x5382a1[_0x3275('0x31')]!=='VIRTUAL'){var _0x26bb59={};_0x26bb59[_0x5382a1[_0x3275('0x2b')]]={'$like':'%'+_0x209749[_0x3275('0x34')]['filter']+'%'};return _0x26bb59;}})});}_0x596d05=_[_0x3275('0x42')]({},_0x596d05,_0x209749[_0x3275('0x43')]);var _0x280f84={'where':_0x596d05['where']};return db['Template']['count'](_0x280f84)[_0x3275('0x25')](function(_0x5ea174){_0xf27227['count']=_0x5ea174;if(_0x209749[_0x3275('0x34')][_0x3275('0x44')]){_0x596d05[_0x3275('0x45')]=[{'all':!![]}];}return db[_0x3275('0x2f')][_0x3275('0x46')](_0x596d05);})['then'](function(_0x213d4d){_0xf27227[_0x3275('0x47')]=_0x213d4d;return _0xf27227;})['then'](respondWithFilteredResult(_0x277364,_0x596d05))[_0x3275('0x48')](handleError(_0x277364,null));};exports[_0x3275('0x49')]=function(_0x3cbdd4,_0x19a4a2){var _0x207763={'raw':!![],'where':{'id':_0x3cbdd4['params']['id']}},_0x2bc173={};_0x2bc173['model']=_[_0x3275('0x35')](db[_0x3275('0x2f')][_0x3275('0x30')]);_0x2bc173['query']=_[_0x3275('0x35')](_0x3cbdd4[_0x3275('0x34')]);_0x2bc173[_0x3275('0x36')]=_[_0x3275('0x38')](_0x2bc173[_0x3275('0x33')],_0x2bc173[_0x3275('0x34')]);_0x207763[_0x3275('0x37')]=_[_0x3275('0x38')](_0x2bc173[_0x3275('0x33')],qs['fields'](_0x3cbdd4[_0x3275('0x34')][_0x3275('0x39')]));_0x207763[_0x3275('0x37')]=_0x207763[_0x3275('0x37')][_0x3275('0x3a')]?_0x207763[_0x3275('0x37')]:_0x2bc173[_0x3275('0x33')];if(_0x3cbdd4['query'][_0x3275('0x44')]){_0x207763['include']=[{'all':!![]}];}_0x207763=_['merge']({},_0x207763,_0x3cbdd4[_0x3275('0x43')]);return db['Template'][_0x3275('0x4a')](_0x207763)[_0x3275('0x25')](handleEntityNotFound(_0x19a4a2,null))['then'](respondWithResult(_0x19a4a2,null))['catch'](handleError(_0x19a4a2,null));};exports[_0x3275('0x4b')]=function(_0x47d92e,_0x5c9dc2){return db[_0x3275('0x2f')][_0x3275('0x4b')](_0x47d92e[_0x3275('0x4c')],{})[_0x3275('0x25')](function(_0x56f1a7){var _0x2e0a16=_0x47d92e[_0x3275('0x4d')]['get']({'plain':!![]});if(!_0x2e0a16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e0a16[_0x3275('0x4e')]===_0x3275('0x4d')){var _0x120dfd=_0x56f1a7[_0x3275('0x26')]({'plain':!![]});var _0x3945d0=_0x3275('0x27');return db['UserProfileSection'][_0x3275('0x4a')]({'where':{'name':_0x3945d0,'userProfileId':_0x2e0a16[_0x3275('0x4f')]},'raw':!![]})['then'](function(_0x41fddb){if(_0x41fddb&&_0x41fddb[_0x3275('0x50')]===0x0){return db[_0x3275('0x51')][_0x3275('0x4b')]({'name':_0x120dfd['name'],'resourceId':_0x120dfd['id'],'type':_0x41fddb[_0x3275('0x2b')],'sectionId':_0x41fddb['id']},{})[_0x3275('0x25')](function(){return _0x56f1a7;});}else{return _0x56f1a7;}})[_0x3275('0x48')](function(_0x453e9a){logger[_0x3275('0x29')](_0x3275('0x52'),_0x453e9a);throw _0x453e9a;});}return _0x56f1a7;})['then'](respondWithResult(_0x5c9dc2,0xc9))[_0x3275('0x48')](handleError(_0x5c9dc2,null));};exports[_0x3275('0x23')]=function(_0x1f0b1f,_0x378b29){if(_0x1f0b1f['body']['id']){delete _0x1f0b1f[_0x3275('0x4c')]['id'];}return db['Template'][_0x3275('0x4a')]({'where':{'id':_0x1f0b1f[_0x3275('0x53')]['id']}})[_0x3275('0x25')](handleEntityNotFound(_0x378b29,null))['then'](saveUpdates(_0x1f0b1f[_0x3275('0x4c')],null))['then'](respondWithResult(_0x378b29,null))[_0x3275('0x48')](handleError(_0x378b29,null));};exports[_0x3275('0x24')]=function(_0x5951ff,_0x41f28d){return db[_0x3275('0x2f')]['find']({'where':{'id':_0x5951ff[_0x3275('0x53')]['id']}})[_0x3275('0x25')](handleEntityNotFound(_0x41f28d,null))[_0x3275('0x25')](removeEntity(_0x41f28d,null))[_0x3275('0x48')](handleError(_0x41f28d,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index acb976b..d930bd4 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 _0x47f1=['moment','bluebird','request-promise','path','../../config/environment','exports','Template','tools_templates','util','../../config/logger','api'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x47f1,0x147));var _0x147f=function(_0x3c71e1,_0x3fb4e1){_0x3c71e1=_0x3c71e1-0x0;var _0x4166ab=_0x47f1[_0x3c71e1];return _0x4166ab;};'use strict';var _=require('lodash');var util=require(_0x147f('0x0'));var logger=require(_0x147f('0x1'))(_0x147f('0x2'));var moment=require(_0x147f('0x3'));var BPromise=require(_0x147f('0x4'));var rp=require(_0x147f('0x5'));var fs=require('fs');var path=require(_0x147f('0x6'));var rimraf=require('rimraf');var config=require(_0x147f('0x7'));var attributes=require('./template.attributes');module[_0x147f('0x8')]=function(_0x55e892,_0x3ca85b){return _0x55e892['define'](_0x147f('0x9'),attributes,{'tableName':_0x147f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a49=['./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x5a49,0x170));var _0x95a4=function(_0x4fd8c5,_0x2def69){_0x4fd8c5=_0x4fd8c5-0x0;var _0x5d18b3=_0x5a49[_0x4fd8c5];return _0x5d18b3;};'use strict';var _=require(_0x95a4('0x0'));var util=require(_0x95a4('0x1'));var logger=require(_0x95a4('0x2'))(_0x95a4('0x3'));var moment=require(_0x95a4('0x4'));var BPromise=require(_0x95a4('0x5'));var rp=require(_0x95a4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95a4('0x7'));var config=require(_0x95a4('0x8'));var attributes=require(_0x95a4('0x9'));module[_0x95a4('0xa')]=function(_0x13f30f,_0x1db0c7){return _0x13f30f[_0x95a4('0xb')](_0x95a4('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 95d11d7..d9293d1 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 _0x62a2=['findAll','options','raw','where','attributes','limit','include','map','model','then','GetTemplate','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template'];(function(_0x269959,_0x672d5e){var _0x1624f8=function(_0x1d31c8){while(--_0x1d31c8){_0x269959['push'](_0x269959['shift']());}};_0x1624f8(++_0x672d5e);}(_0x62a2,0x169));var _0x262a=function(_0x4e502e,_0x2a7c94){_0x4e502e=_0x4e502e-0x0;var _0x25c957=_0x62a2[_0x4e502e];return _0x25c957;};'use strict';var _=require(_0x262a('0x0'));var util=require(_0x262a('0x1'));var moment=require(_0x262a('0x2'));var BPromise=require('bluebird');var rs=require(_0x262a('0x3'));var fs=require('fs');var Redis=require(_0x262a('0x4'));var db=require(_0x262a('0x5'))['db'];var utils=require(_0x262a('0x6'));var logger=require(_0x262a('0x7'))(_0x262a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x262a('0x9')][_0x262a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28ad19,_0x1924af,_0x5979f6){return new BPromise(function(_0x2d6622,_0x358b38){return client[_0x262a('0xb')](_0x28ad19,_0x5979f6)['then'](function(_0x22878e){logger[_0x262a('0xc')](_0x262a('0xd'),_0x1924af,_0x262a('0xe'));logger[_0x262a('0xf')](_0x262a('0x10'),_0x1924af,_0x262a('0xe'),JSON[_0x262a('0x11')](_0x22878e));if(_0x22878e['error']){if(_0x22878e[_0x262a('0x12')][_0x262a('0x13')]===0x1f4){logger['error'](_0x262a('0xd'),_0x1924af,_0x22878e[_0x262a('0x12')][_0x262a('0x14')]);return _0x358b38(_0x22878e[_0x262a('0x12')][_0x262a('0x14')]);}logger[_0x262a('0x12')]('Template,\x20%s,\x20%s',_0x1924af,_0x22878e[_0x262a('0x12')][_0x262a('0x14')]);return _0x2d6622(_0x22878e['error'][_0x262a('0x14')]);}else{logger['info'](_0x262a('0xd'),_0x1924af,_0x262a('0xe'));_0x2d6622(_0x22878e[_0x262a('0x15')][_0x262a('0x14')]);}})[_0x262a('0x16')](function(_0x2183b6){logger[_0x262a('0x12')](_0x262a('0xd'),_0x1924af,_0x2183b6);_0x358b38(_0x2183b6);});});}exports['GetTemplate']=function(_0x4cd455){var _0x58dde0=this;return new Promise(function(_0x2ce65b,_0x39037f){return db[_0x262a('0x17')][_0x262a('0x18')]({'raw':_0x4cd455[_0x262a('0x19')]?_0x4cd455[_0x262a('0x19')][_0x262a('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cd455[_0x262a('0x19')]?_0x4cd455[_0x262a('0x19')][_0x262a('0x1b')]||null:null,'attributes':_0x4cd455[_0x262a('0x19')]?_0x4cd455['options'][_0x262a('0x1c')]||null:null,'limit':_0x4cd455[_0x262a('0x19')]?_0x4cd455[_0x262a('0x19')][_0x262a('0x1d')]||null:null,'include':_0x4cd455[_0x262a('0x19')]?_0x4cd455[_0x262a('0x19')][_0x262a('0x1e')]?_[_0x262a('0x1f')](_0x4cd455['options'][_0x262a('0x1e')],function(_0x278f4f){return{'model':db[_0x278f4f['model']],'as':_0x278f4f['as'],'attributes':_0x278f4f[_0x262a('0x1c')],'include':_0x278f4f[_0x262a('0x1e')]?_[_0x262a('0x1f')](_0x278f4f[_0x262a('0x1e')],function(_0x6baa7f){return{'model':db[_0x6baa7f[_0x262a('0x20')]],'as':_0x6baa7f['as'],'attributes':_0x6baa7f[_0x262a('0x1c')],'include':_0x6baa7f[_0x262a('0x1e')]?_[_0x262a('0x1f')](_0x6baa7f[_0x262a('0x1e')],function(_0x19fc9b){return{'model':db[_0x19fc9b[_0x262a('0x20')]],'as':_0x19fc9b['as'],'attributes':_0x19fc9b[_0x262a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x262a('0x21')](function(_0x5306cc){logger[_0x262a('0xc')](_0x262a('0x22'),_0x4cd455);logger[_0x262a('0xf')](_0x262a('0x22'),_0x4cd455,JSON[_0x262a('0x11')](_0x5306cc));_0x2ce65b(_0x5306cc);})[_0x262a('0x16')](function(_0x4a3480){logger[_0x262a('0x12')](_0x262a('0x22'),_0x4a3480['message'],_0x4cd455);_0x39037f(_0x58dde0[_0x262a('0x12')](0x1f4,_0x4a3480[_0x262a('0x14')]));});});}; \ No newline at end of file +var _0x9453=['findAll','raw','options','where','attributes','include','map','model','debug','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','info','GetTemplate','Template'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9453,0x1e9));var _0x3945=function(_0x29f454,_0x5630a6){_0x29f454=_0x29f454-0x0;var _0x5b3c10=_0x9453[_0x29f454];return _0x5b3c10;};'use strict';var _=require(_0x3945('0x0'));var util=require(_0x3945('0x1'));var moment=require('moment');var BPromise=require(_0x3945('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3945('0x3'))['db'];var utils=require(_0x3945('0x4'));var logger=require(_0x3945('0x5'))(_0x3945('0x6'));var config=require(_0x3945('0x7'));var jayson=require(_0x3945('0x8'));var client=jayson[_0x3945('0x9')][_0x3945('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54dfea,_0x5eb0bc,_0x48d894){return new BPromise(function(_0x4d08ca,_0x112ae7){return client[_0x3945('0xb')](_0x54dfea,_0x48d894)[_0x3945('0xc')](function(_0x3d7356){logger['info']('Template,\x20%s,\x20%s',_0x5eb0bc,_0x3945('0xd'));logger['debug'](_0x3945('0xe'),_0x5eb0bc,_0x3945('0xd'),JSON[_0x3945('0xf')](_0x3d7356));if(_0x3d7356[_0x3945('0x10')]){if(_0x3d7356[_0x3945('0x10')][_0x3945('0x11')]===0x1f4){logger[_0x3945('0x10')](_0x3945('0x12'),_0x5eb0bc,_0x3d7356[_0x3945('0x10')][_0x3945('0x13')]);return _0x112ae7(_0x3d7356[_0x3945('0x10')][_0x3945('0x13')]);}logger['error'](_0x3945('0x12'),_0x5eb0bc,_0x3d7356[_0x3945('0x10')][_0x3945('0x13')]);return _0x4d08ca(_0x3d7356['error'][_0x3945('0x13')]);}else{logger[_0x3945('0x14')]('Template,\x20%s,\x20%s',_0x5eb0bc,'request\x20sent');_0x4d08ca(_0x3d7356['result']['message']);}})['catch'](function(_0x44e7f0){logger[_0x3945('0x10')](_0x3945('0x12'),_0x5eb0bc,_0x44e7f0);_0x112ae7(_0x44e7f0);});});}exports[_0x3945('0x15')]=function(_0x40ad7d){var _0x18603e=this;return new Promise(function(_0x288b22,_0x435f10){return db[_0x3945('0x16')][_0x3945('0x17')]({'raw':_0x40ad7d['options']?_0x40ad7d['options'][_0x3945('0x18')]===undefined?!![]:![]:!![],'where':_0x40ad7d[_0x3945('0x19')]?_0x40ad7d['options'][_0x3945('0x1a')]||null:null,'attributes':_0x40ad7d[_0x3945('0x19')]?_0x40ad7d[_0x3945('0x19')][_0x3945('0x1b')]||null:null,'limit':_0x40ad7d[_0x3945('0x19')]?_0x40ad7d[_0x3945('0x19')]['limit']||null:null,'include':_0x40ad7d['options']?_0x40ad7d[_0x3945('0x19')][_0x3945('0x1c')]?_[_0x3945('0x1d')](_0x40ad7d[_0x3945('0x19')][_0x3945('0x1c')],function(_0x3ca208){return{'model':db[_0x3ca208[_0x3945('0x1e')]],'as':_0x3ca208['as'],'attributes':_0x3ca208[_0x3945('0x1b')],'include':_0x3ca208[_0x3945('0x1c')]?_[_0x3945('0x1d')](_0x3ca208[_0x3945('0x1c')],function(_0x4f87e9){return{'model':db[_0x4f87e9[_0x3945('0x1e')]],'as':_0x4f87e9['as'],'attributes':_0x4f87e9['attributes'],'include':_0x4f87e9[_0x3945('0x1c')]?_[_0x3945('0x1d')](_0x4f87e9[_0x3945('0x1c')],function(_0x26f0da){return{'model':db[_0x26f0da[_0x3945('0x1e')]],'as':_0x26f0da['as'],'attributes':_0x26f0da['attributes']};}):[]};}):[]};}):[]:[]})[_0x3945('0xc')](function(_0x4bdd14){logger[_0x3945('0x14')](_0x3945('0x15'),_0x40ad7d);logger[_0x3945('0x1f')](_0x3945('0x15'),_0x40ad7d,JSON['stringify'](_0x4bdd14));_0x288b22(_0x4bdd14);})['catch'](function(_0x112e3e){logger[_0x3945('0x10')](_0x3945('0x15'),_0x112e3e[_0x3945('0x13')],_0x40ad7d);_0x435f10(_0x18603e['error'](0x1f4,_0x112e3e[_0x3945('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 902edc0..07ed1c6 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 _0xacfd=['../../components/auth/service','../../config/environment','./trigger.controller','get','index','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','/:id/all_conditions','addAllCondition','addAnyCondition','put','/:id','update','delete','destroy','multer','util','connect-timeout','Router','fs-extra'];(function(_0x45f28a,_0x23f69e){var _0x381444=function(_0x4144e1){while(--_0x4144e1){_0x45f28a['push'](_0x45f28a['shift']());}};_0x381444(++_0x23f69e);}(_0xacfd,0x119));var _0xdacf=function(_0x396f9a,_0x36bf05){_0x396f9a=_0x396f9a-0x0;var _0x1b736d=_0xacfd[_0x396f9a];return _0x1b736d;};'use strict';var multer=require(_0xdacf('0x0'));var util=require(_0xdacf('0x1'));var path=require('path');var timeout=require(_0xdacf('0x2'));var express=require('express');var router=express[_0xdacf('0x3')]();var fs_extra=require(_0xdacf('0x4'));var auth=require(_0xdacf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdacf('0x6'));var controller=require(_0xdacf('0x7'));router[_0xdacf('0x8')]('/',auth['isAuthenticated'](),controller[_0xdacf('0x9')]);router['get']('/:id',auth[_0xdacf('0xa')](),controller[_0xdacf('0xb')]);router[_0xdacf('0x8')]('/:id/all_conditions',auth[_0xdacf('0xa')](),controller[_0xdacf('0xc')]);router[_0xdacf('0x8')](_0xdacf('0xd'),auth[_0xdacf('0xa')](),controller[_0xdacf('0xe')]);router[_0xdacf('0x8')](_0xdacf('0xf'),auth[_0xdacf('0xa')](),controller['getActions']);router[_0xdacf('0x10')]('/',auth[_0xdacf('0xa')](),controller[_0xdacf('0x11')]);router[_0xdacf('0x10')](_0xdacf('0x12'),auth[_0xdacf('0xa')](),controller[_0xdacf('0x13')]);router[_0xdacf('0x10')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xdacf('0x14')]);router[_0xdacf('0x10')]('/:id/actions',auth[_0xdacf('0xa')](),controller['addAction']);router[_0xdacf('0x15')](_0xdacf('0x16'),auth['isAuthenticated'](),controller[_0xdacf('0x17')]);router[_0xdacf('0x18')](_0xdacf('0x16'),auth['isAuthenticated'](),controller[_0xdacf('0x19')]);module['exports']=router; \ No newline at end of file +var _0x9972=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','post','create','addAnyCondition','/:id/actions','put','/:id','delete'];(function(_0x13aa1d,_0x5bedda){var _0x1b5192=function(_0x4c8e0e){while(--_0x4c8e0e){_0x13aa1d['push'](_0x13aa1d['shift']());}};_0x1b5192(++_0x5bedda);}(_0x9972,0xaa));var _0x2997=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9972[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x2997('0x0'));var util=require(_0x2997('0x1'));var path=require(_0x2997('0x2'));var timeout=require(_0x2997('0x3'));var express=require('express');var router=express[_0x2997('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2997('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2997('0x6'));var controller=require(_0x2997('0x7'));router['get']('/',auth[_0x2997('0x8')](),controller[_0x2997('0x9')]);router[_0x2997('0xa')]('/:id',auth[_0x2997('0x8')](),controller[_0x2997('0xb')]);router[_0x2997('0xa')](_0x2997('0xc'),auth[_0x2997('0x8')](),controller[_0x2997('0xd')]);router['get'](_0x2997('0xe'),auth[_0x2997('0x8')](),controller['getAnyConditions']);router[_0x2997('0xa')]('/:id/actions',auth[_0x2997('0x8')](),controller['getActions']);router[_0x2997('0xf')]('/',auth[_0x2997('0x8')](),controller[_0x2997('0x10')]);router['post'](_0x2997('0xc'),auth[_0x2997('0x8')](),controller['addAllCondition']);router[_0x2997('0xf')](_0x2997('0xe'),auth[_0x2997('0x8')](),controller[_0x2997('0x11')]);router[_0x2997('0xf')](_0x2997('0x12'),auth[_0x2997('0x8')](),controller['addAction']);router[_0x2997('0x13')](_0x2997('0x14'),auth[_0x2997('0x8')](),controller['update']);router[_0x2997('0x15')](_0x2997('0x14'),auth[_0x2997('0x8')](),controller[_0x2997('0x16')]);module[_0x2997('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 6e32682..cb596f9 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 _0x3cd8=['STRING','BOOLEAN','sequelize'];(function(_0x567033,_0x202d71){var _0x480de4=function(_0x38c5e6){while(--_0x38c5e6){_0x567033['push'](_0x567033['shift']());}};_0x480de4(++_0x202d71);}(_0x3cd8,0x128));var _0x83cd=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x3cd8[_0x19ac6e];return _0x1cdcf3;};'use strict';var Sequelize=require(_0x83cd('0x0'));module['exports']={'name':{'type':Sequelize[_0x83cd('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x83cd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x36ac=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1d664a,_0x149a34){var _0x335345=function(_0x461fac){while(--_0x461fac){_0x1d664a['push'](_0x1d664a['shift']());}};_0x335345(++_0x149a34);}(_0x36ac,0x1d0));var _0xc36a=function(_0x43c1f3,_0x3b228a){_0x43c1f3=_0x43c1f3-0x0;var _0x50489b=_0x36ac[_0x43c1f3];return _0x50489b;};'use strict';var Sequelize=require(_0xc36a('0x0'));module[_0xc36a('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc36a('0x2')]},'description':{'type':Sequelize[_0xc36a('0x2')]},'status':{'type':Sequelize[_0xc36a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 049b3f0..7693462 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 _0xec90=['Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Triggers','sendStatus','error','stack','name','send','index','Trigger','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','rawAttributes','nolimit','pick','getAnyConditions','addAction','TriggerId'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xec90,0xc0));var _0x0ec9=function(_0x54256c,_0x51e1e6){_0x54256c=_0x54256c-0x0;var _0x295965=_0xec90[_0x54256c];return _0x295965;};'use strict';var emlformat=require(_0x0ec9('0x0'));var rimraf=require(_0x0ec9('0x1'));var zipdir=require(_0x0ec9('0x2'));var jsonpatch=require(_0x0ec9('0x3'));var rp=require('request-promise');var moment=require(_0x0ec9('0x4'));var BPromise=require(_0x0ec9('0x5'));var Mustache=require(_0x0ec9('0x6'));var util=require(_0x0ec9('0x7'));var path=require(_0x0ec9('0x8'));var sox=require(_0x0ec9('0x9'));var csv=require(_0x0ec9('0xa'));var ejs=require(_0x0ec9('0xb'));var fs=require('fs');var fs_extra=require(_0x0ec9('0xc'));var _=require('lodash');var squel=require(_0x0ec9('0xd'));var crypto=require(_0x0ec9('0xe'));var jsforce=require(_0x0ec9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0ec9('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0ec9('0x10'));var qs=require(_0x0ec9('0x11'));var as=require(_0x0ec9('0x12'));var hardwareService=require(_0x0ec9('0x13'));var logger=require(_0x0ec9('0x14'))(_0x0ec9('0x15'));var utils=require(_0x0ec9('0x16'));var config=require(_0x0ec9('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d82f6,_0x5add88){_0x5add88=_0x5add88||0xcc;return function(_0x389615){if(_0x389615){return _0x1d82f6['sendStatus'](_0x5add88);}return _0x1d82f6[_0x0ec9('0x18')](_0x5add88)[_0x0ec9('0x19')]();};}function respondWithResult(_0x535ac0,_0x203053){_0x203053=_0x203053||0xc8;return function(_0x3f9ca1){if(_0x3f9ca1){return _0x535ac0['status'](_0x203053)[_0x0ec9('0x1a')](_0x3f9ca1);}};}function respondWithFilteredResult(_0x29bb93,_0x15d7f0){return function(_0x4e60b7){if(_0x4e60b7){var _0x4c439e=typeof _0x15d7f0[_0x0ec9('0x1b')]===_0x0ec9('0x1c')&&typeof _0x15d7f0[_0x0ec9('0x1d')]==='undefined';var _0x9daf59=_0x4e60b7[_0x0ec9('0x1e')];var _0x17af2d=_0x4c439e?0x0:_0x15d7f0['offset'];var _0x28c1e1=_0x4c439e?_0x4e60b7[_0x0ec9('0x1e')]:_0x15d7f0[_0x0ec9('0x1b')]+_0x15d7f0[_0x0ec9('0x1d')];var _0x250e3a;if(_0x28c1e1>=_0x9daf59){_0x28c1e1=_0x9daf59;_0x250e3a=0xc8;}else{_0x250e3a=0xce;}_0x29bb93[_0x0ec9('0x18')](_0x250e3a);return _0x29bb93[_0x0ec9('0x1f')]('Content-Range',_0x17af2d+'-'+_0x28c1e1+'/'+_0x9daf59)[_0x0ec9('0x1a')](_0x4e60b7);}return null;};}function patchUpdates(_0x171987){return function(_0x3d6df1){try{jsonpatch['apply'](_0x3d6df1,_0x171987,!![]);}catch(_0x4c7175){return BPromise[_0x0ec9('0x20')](_0x4c7175);}return _0x3d6df1[_0x0ec9('0x21')]();};}function saveUpdates(_0x3a3466,_0x28226d){return function(_0x514cdd){if(_0x514cdd){return _0x514cdd[_0x0ec9('0x22')](_0x3a3466)[_0x0ec9('0x23')](function(_0x35c5c7){return _0x35c5c7;});}return null;};}function removeEntity(_0x267c7e,_0x96191f){return function(_0x323a35){if(_0x323a35){return _0x323a35[_0x0ec9('0x24')]()[_0x0ec9('0x23')](function(){var _0x500716=_0x323a35[_0x0ec9('0x25')]({'plain':!![]});var _0xd8f8a0=_0x0ec9('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0xd8f8a0,'resourceId':_0x500716['id']}})[_0x0ec9('0x23')](function(){return _0x323a35;});})[_0x0ec9('0x23')](function(){_0x267c7e[_0x0ec9('0x18')](0xcc)[_0x0ec9('0x19')]();});}};}function handleEntityNotFound(_0x23738f,_0x4b261c){return function(_0x5123da){if(!_0x5123da){_0x23738f[_0x0ec9('0x27')](0x194);}return _0x5123da;};}function handleError(_0x1d6b3a,_0x310385){_0x310385=_0x310385||0x1f4;return function(_0x3edd76){logger[_0x0ec9('0x28')](_0x3edd76[_0x0ec9('0x29')]);if(_0x3edd76[_0x0ec9('0x2a')]){delete _0x3edd76[_0x0ec9('0x2a')];}_0x1d6b3a['status'](_0x310385)[_0x0ec9('0x2b')](_0x3edd76);};}exports[_0x0ec9('0x2c')]=function(_0x2b316f,_0x3c1626){var _0x1238dd={},_0x323c92={},_0x3e1d48={'count':0x0,'rows':[]};var _0x16b74b=_['map'](db[_0x0ec9('0x2d')]['rawAttributes'],function(_0x4ab932){return{'name':_0x4ab932[_0x0ec9('0x2e')],'type':_0x4ab932[_0x0ec9('0x2f')][_0x0ec9('0x30')]};});_0x323c92[_0x0ec9('0x31')]=_['map'](_0x16b74b,_0x0ec9('0x2a'));_0x323c92[_0x0ec9('0x32')]=_[_0x0ec9('0x33')](_0x2b316f['query']);_0x323c92[_0x0ec9('0x34')]=_[_0x0ec9('0x35')](_0x323c92['model'],_0x323c92[_0x0ec9('0x32')]);_0x1238dd[_0x0ec9('0x36')]=_['intersection'](_0x323c92[_0x0ec9('0x31')],qs[_0x0ec9('0x37')](_0x2b316f['query'][_0x0ec9('0x37')]));_0x1238dd[_0x0ec9('0x36')]=_0x1238dd['attributes']['length']?_0x1238dd[_0x0ec9('0x36')]:_0x323c92['model'];if(!_0x2b316f[_0x0ec9('0x32')][_0x0ec9('0x38')]('nolimit')){_0x1238dd[_0x0ec9('0x1d')]=qs[_0x0ec9('0x1d')](_0x2b316f['query']['limit']);_0x1238dd[_0x0ec9('0x1b')]=qs[_0x0ec9('0x1b')](_0x2b316f['query'][_0x0ec9('0x1b')]);}_0x1238dd[_0x0ec9('0x39')]=qs[_0x0ec9('0x3a')](_0x2b316f[_0x0ec9('0x32')][_0x0ec9('0x3a')]);_0x1238dd[_0x0ec9('0x3b')]=qs[_0x0ec9('0x34')](_['pick'](_0x2b316f[_0x0ec9('0x32')],_0x323c92[_0x0ec9('0x34')]),_0x16b74b);if(_0x2b316f['query'][_0x0ec9('0x3c')]){_0x1238dd[_0x0ec9('0x3b')]=_[_0x0ec9('0x3d')](_0x1238dd['where'],{'$or':_[_0x0ec9('0x3e')](_0x16b74b,function(_0x36ed31){if(_0x36ed31[_0x0ec9('0x2f')]!=='VIRTUAL'){var _0x453486={};_0x453486[_0x36ed31['name']]={'$like':'%'+_0x2b316f[_0x0ec9('0x32')]['filter']+'%'};return _0x453486;}})});}_0x1238dd=_[_0x0ec9('0x3d')]({},_0x1238dd,_0x2b316f[_0x0ec9('0x3f')]);var _0x3ed277={'where':_0x1238dd['where']};return db[_0x0ec9('0x2d')][_0x0ec9('0x1e')](_0x3ed277)['then'](function(_0x3e9f3a){_0x3e1d48[_0x0ec9('0x1e')]=_0x3e9f3a;if(_0x2b316f[_0x0ec9('0x32')][_0x0ec9('0x40')]){_0x1238dd[_0x0ec9('0x41')]=[{'all':!![]}];}return db[_0x0ec9('0x2d')][_0x0ec9('0x42')](_0x1238dd);})[_0x0ec9('0x23')](function(_0x421e4f){_0x3e1d48[_0x0ec9('0x43')]=_0x421e4f;return _0x3e1d48;})['then'](respondWithFilteredResult(_0x3c1626,_0x1238dd))[_0x0ec9('0x44')](handleError(_0x3c1626,null));};exports[_0x0ec9('0x45')]=function(_0x342dfc,_0xf6b254){var _0x43abf8={'raw':![],'where':{'id':_0x342dfc[_0x0ec9('0x46')]['id']}},_0x59502a={};_0x59502a[_0x0ec9('0x31')]=_['keys'](db[_0x0ec9('0x2d')]['rawAttributes']);_0x59502a[_0x0ec9('0x32')]=_[_0x0ec9('0x33')](_0x342dfc['query']);_0x59502a[_0x0ec9('0x34')]=_[_0x0ec9('0x35')](_0x59502a[_0x0ec9('0x31')],_0x59502a[_0x0ec9('0x32')]);_0x43abf8[_0x0ec9('0x36')]=_[_0x0ec9('0x35')](_0x59502a['model'],qs[_0x0ec9('0x37')](_0x342dfc[_0x0ec9('0x32')][_0x0ec9('0x37')]));_0x43abf8['attributes']=_0x43abf8[_0x0ec9('0x36')][_0x0ec9('0x47')]?_0x43abf8[_0x0ec9('0x36')]:_0x59502a[_0x0ec9('0x31')];if(_0x342dfc[_0x0ec9('0x32')][_0x0ec9('0x40')]){_0x43abf8[_0x0ec9('0x41')]=[{'all':!![]}];}_0x43abf8=_['merge']({},_0x43abf8,_0x342dfc[_0x0ec9('0x3f')]);return db[_0x0ec9('0x2d')][_0x0ec9('0x48')](_0x43abf8)[_0x0ec9('0x23')](handleEntityNotFound(_0xf6b254,null))[_0x0ec9('0x23')](respondWithResult(_0xf6b254,null))[_0x0ec9('0x44')](handleError(_0xf6b254,null));};exports[_0x0ec9('0x49')]=function(_0x5e66d7,_0x4e42e3){return db[_0x0ec9('0x2d')]['create'](_0x5e66d7[_0x0ec9('0x4a')],{})[_0x0ec9('0x23')](function(_0x3cf957){var _0x179d78=_0x5e66d7[_0x0ec9('0x4b')]['get']({'plain':!![]});if(!_0x179d78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x179d78[_0x0ec9('0x4c')]===_0x0ec9('0x4b')){var _0x559f00=_0x3cf957[_0x0ec9('0x25')]({'plain':!![]});var _0x27ae36='Triggers';return db[_0x0ec9('0x4d')]['find']({'where':{'name':_0x27ae36,'userProfileId':_0x179d78['userProfileId']},'raw':!![]})[_0x0ec9('0x23')](function(_0x4ca52e){if(_0x4ca52e&&_0x4ca52e[_0x0ec9('0x4e')]===0x0){return db[_0x0ec9('0x4f')][_0x0ec9('0x49')]({'name':_0x559f00['name'],'resourceId':_0x559f00['id'],'type':_0x4ca52e[_0x0ec9('0x2a')],'sectionId':_0x4ca52e['id']},{})[_0x0ec9('0x23')](function(){return _0x3cf957;});}else{return _0x3cf957;}})[_0x0ec9('0x44')](function(_0x50b7b5){logger[_0x0ec9('0x28')](_0x0ec9('0x50'),_0x50b7b5);throw _0x50b7b5;});}return _0x3cf957;})[_0x0ec9('0x23')](respondWithResult(_0x4e42e3,0xc9))[_0x0ec9('0x44')](handleError(_0x4e42e3,null));};exports['update']=function(_0x107e33,_0x1dcbe7){if(_0x107e33['body']['id']){delete _0x107e33['body']['id'];}return db[_0x0ec9('0x2d')]['find']({'where':{'id':_0x107e33[_0x0ec9('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dcbe7,null))[_0x0ec9('0x23')](saveUpdates(_0x107e33['body'],null))[_0x0ec9('0x23')](respondWithResult(_0x1dcbe7,null))[_0x0ec9('0x44')](handleError(_0x1dcbe7,null));};exports['destroy']=function(_0x4472bf,_0x262a79){return db[_0x0ec9('0x2d')][_0x0ec9('0x48')]({'where':{'id':_0x4472bf[_0x0ec9('0x46')]['id']}})[_0x0ec9('0x23')](handleEntityNotFound(_0x262a79,null))['then'](removeEntity(_0x262a79,null))[_0x0ec9('0x44')](handleError(_0x262a79,null));};exports['addAllCondition']=function(_0x6a14d5,_0x4bb9ed,_0x532547){if(_0x6a14d5['body']['id']){delete _0x6a14d5[_0x0ec9('0x4a')]['id'];}return db[_0x0ec9('0x2d')][_0x0ec9('0x48')]({'where':{'id':_0x6a14d5['params']['id']}})[_0x0ec9('0x23')](handleEntityNotFound(_0x4bb9ed,null))['then'](function(_0x10aadd){if(_0x10aadd){_0x6a14d5[_0x0ec9('0x4a')][_0x0ec9('0x51')]=_0x10aadd['id'];return db[_0x0ec9('0x52')][_0x0ec9('0x49')](_0x6a14d5['body']);}})[_0x0ec9('0x23')](respondWithResult(_0x4bb9ed,null))[_0x0ec9('0x44')](handleError(_0x4bb9ed,null));};exports[_0x0ec9('0x53')]=function(_0x278475,_0x2ebae9,_0x619d31){if(_0x278475[_0x0ec9('0x4a')]['id']){delete _0x278475[_0x0ec9('0x4a')]['id'];}return db[_0x0ec9('0x2d')][_0x0ec9('0x48')]({'where':{'id':_0x278475[_0x0ec9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ebae9,null))[_0x0ec9('0x23')](function(_0x28b702){if(_0x28b702){_0x278475[_0x0ec9('0x4a')][_0x0ec9('0x54')]=_0x28b702['id'];return db[_0x0ec9('0x52')]['create'](_0x278475['body']);}})['then'](respondWithResult(_0x2ebae9,null))[_0x0ec9('0x44')](handleError(_0x2ebae9,null));};exports[_0x0ec9('0x55')]=function(_0x425dae,_0x311cd9,_0x16aaf4){var _0x2ed61a={};var _0x12bbdd={};var _0x39e000;var _0x28b3a0;return db['Trigger'][_0x0ec9('0x56')]({'where':{'id':_0x425dae[_0x0ec9('0x46')]['id']}})[_0x0ec9('0x23')](handleEntityNotFound(_0x311cd9,null))['then'](function(_0x2fcd36){if(_0x2fcd36){_0x39e000=_0x2fcd36;_0x12bbdd[_0x0ec9('0x31')]=_[_0x0ec9('0x33')](db['Condition'][_0x0ec9('0x57')]);_0x12bbdd[_0x0ec9('0x32')]=_['keys'](_0x425dae[_0x0ec9('0x32')]);_0x12bbdd[_0x0ec9('0x34')]=_[_0x0ec9('0x35')](_0x12bbdd[_0x0ec9('0x31')],_0x12bbdd[_0x0ec9('0x32')]);_0x2ed61a[_0x0ec9('0x36')]=_[_0x0ec9('0x35')](_0x12bbdd[_0x0ec9('0x31')],qs['fields'](_0x425dae['query']['fields']));_0x2ed61a[_0x0ec9('0x36')]=_0x2ed61a['attributes'][_0x0ec9('0x47')]?_0x2ed61a[_0x0ec9('0x36')]:_0x12bbdd[_0x0ec9('0x31')];_0x2ed61a['order']=qs[_0x0ec9('0x3a')](_0x425dae['query'][_0x0ec9('0x3a')]);_0x2ed61a[_0x0ec9('0x3b')]=qs[_0x0ec9('0x34')](_['pick'](_0x425dae[_0x0ec9('0x32')],_0x12bbdd[_0x0ec9('0x34')]));if(_0x425dae[_0x0ec9('0x32')][_0x0ec9('0x3c')]){_0x2ed61a[_0x0ec9('0x3b')]=_['merge'](_0x2ed61a[_0x0ec9('0x3b')],{'$or':_[_0x0ec9('0x3e')](_0x2ed61a[_0x0ec9('0x36')],function(_0x13275b){var _0x39bea4={};_0x39bea4[_0x13275b]={'$like':'%'+_0x425dae['query'][_0x0ec9('0x3c')]+'%'};return _0x39bea4;})});}_0x2ed61a=_[_0x0ec9('0x3d')]({},_0x2ed61a,_0x425dae[_0x0ec9('0x3f')]);return _0x39e000['getAllConditions'](_0x2ed61a);}})[_0x0ec9('0x23')](function(_0x50677a){if(_0x50677a){_0x28b3a0=_0x50677a['length'];if(!_0x425dae[_0x0ec9('0x32')][_0x0ec9('0x38')](_0x0ec9('0x58'))){_0x2ed61a['limit']=qs['limit'](_0x425dae['query']['limit']);_0x2ed61a['offset']=qs[_0x0ec9('0x1b')](_0x425dae[_0x0ec9('0x32')]['offset']);}return _0x39e000[_0x0ec9('0x55')](_0x2ed61a);}})['then'](function(_0x32e12f){if(_0x32e12f){return _0x32e12f?{'count':_0x28b3a0,'rows':_0x32e12f}:null;}})[_0x0ec9('0x23')](respondWithResult(_0x311cd9,null))[_0x0ec9('0x44')](handleError(_0x311cd9,null));};exports['getAnyConditions']=function(_0x46be86,_0x5e0036,_0x3f7fc1){var _0x2d247b={};var _0x571ae8={};var _0x4bb756;var _0x2e4197;return db[_0x0ec9('0x2d')][_0x0ec9('0x56')]({'where':{'id':_0x46be86['params']['id']}})[_0x0ec9('0x23')](handleEntityNotFound(_0x5e0036,null))[_0x0ec9('0x23')](function(_0x37e3ba){if(_0x37e3ba){_0x4bb756=_0x37e3ba;_0x571ae8[_0x0ec9('0x31')]=_['keys'](db[_0x0ec9('0x52')]['rawAttributes']);_0x571ae8[_0x0ec9('0x32')]=_['keys'](_0x46be86[_0x0ec9('0x32')]);_0x571ae8[_0x0ec9('0x34')]=_[_0x0ec9('0x35')](_0x571ae8['model'],_0x571ae8[_0x0ec9('0x32')]);_0x2d247b['attributes']=_[_0x0ec9('0x35')](_0x571ae8[_0x0ec9('0x31')],qs[_0x0ec9('0x37')](_0x46be86[_0x0ec9('0x32')]['fields']));_0x2d247b[_0x0ec9('0x36')]=_0x2d247b[_0x0ec9('0x36')][_0x0ec9('0x47')]?_0x2d247b[_0x0ec9('0x36')]:_0x571ae8['model'];_0x2d247b['order']=qs[_0x0ec9('0x3a')](_0x46be86[_0x0ec9('0x32')]['sort']);_0x2d247b['where']=qs[_0x0ec9('0x34')](_[_0x0ec9('0x59')](_0x46be86['query'],_0x571ae8[_0x0ec9('0x34')]));if(_0x46be86[_0x0ec9('0x32')][_0x0ec9('0x3c')]){_0x2d247b[_0x0ec9('0x3b')]=_[_0x0ec9('0x3d')](_0x2d247b[_0x0ec9('0x3b')],{'$or':_[_0x0ec9('0x3e')](_0x2d247b[_0x0ec9('0x36')],function(_0x36f11f){var _0x5c7048={};_0x5c7048[_0x36f11f]={'$like':'%'+_0x46be86[_0x0ec9('0x32')][_0x0ec9('0x3c')]+'%'};return _0x5c7048;})});}_0x2d247b=_[_0x0ec9('0x3d')]({},_0x2d247b,_0x46be86[_0x0ec9('0x3f')]);return _0x4bb756[_0x0ec9('0x5a')](_0x2d247b);}})[_0x0ec9('0x23')](function(_0x406998){if(_0x406998){_0x2e4197=_0x406998[_0x0ec9('0x47')];if(!_0x46be86[_0x0ec9('0x32')][_0x0ec9('0x38')](_0x0ec9('0x58'))){_0x2d247b[_0x0ec9('0x1d')]=qs[_0x0ec9('0x1d')](_0x46be86[_0x0ec9('0x32')][_0x0ec9('0x1d')]);_0x2d247b[_0x0ec9('0x1b')]=qs['offset'](_0x46be86[_0x0ec9('0x32')][_0x0ec9('0x1b')]);}return _0x4bb756[_0x0ec9('0x5a')](_0x2d247b);}})[_0x0ec9('0x23')](function(_0x323703){if(_0x323703){return _0x323703?{'count':_0x2e4197,'rows':_0x323703}:null;}})['then'](respondWithResult(_0x5e0036,null))['catch'](handleError(_0x5e0036,null));};exports[_0x0ec9('0x5b')]=function(_0x5b74aa,_0x4ef556,_0x491e1f){if(_0x5b74aa[_0x0ec9('0x4a')]['id']){delete _0x5b74aa['body']['id'];}return db[_0x0ec9('0x2d')][_0x0ec9('0x48')]({'where':{'id':_0x5b74aa['params']['id']}})[_0x0ec9('0x23')](handleEntityNotFound(_0x4ef556,null))[_0x0ec9('0x23')](function(_0x5b4e65){if(_0x5b4e65){_0x5b74aa[_0x0ec9('0x4a')][_0x0ec9('0x5c')]=_0x5b4e65['id'];return db['Action'][_0x0ec9('0x49')](_0x5b74aa[_0x0ec9('0x4a')]);}})['then'](respondWithResult(_0x4ef556,null))[_0x0ec9('0x44')](handleError(_0x4ef556,null));};exports['getActions']=function(_0x3a1c46,_0x37ceb8,_0x5b9b9a){var _0x4f355b={};var _0x1ce183={};var _0x4081a7;var _0xd31867;return db[_0x0ec9('0x2d')][_0x0ec9('0x56')]({'where':{'id':_0x3a1c46[_0x0ec9('0x46')]['id']}})['then'](handleEntityNotFound(_0x37ceb8,null))[_0x0ec9('0x23')](function(_0x2c81ac){if(_0x2c81ac){_0x4081a7=_0x2c81ac;_0x1ce183['model']=_[_0x0ec9('0x33')](db[_0x0ec9('0x5d')][_0x0ec9('0x57')]);_0x1ce183[_0x0ec9('0x32')]=_[_0x0ec9('0x33')](_0x3a1c46[_0x0ec9('0x32')]);_0x1ce183[_0x0ec9('0x34')]=_['intersection'](_0x1ce183[_0x0ec9('0x31')],_0x1ce183[_0x0ec9('0x32')]);_0x4f355b['attributes']=_[_0x0ec9('0x35')](_0x1ce183[_0x0ec9('0x31')],qs[_0x0ec9('0x37')](_0x3a1c46[_0x0ec9('0x32')][_0x0ec9('0x37')]));_0x4f355b[_0x0ec9('0x36')]=_0x4f355b[_0x0ec9('0x36')][_0x0ec9('0x47')]?_0x4f355b[_0x0ec9('0x36')]:_0x1ce183[_0x0ec9('0x31')];_0x4f355b[_0x0ec9('0x39')]=qs[_0x0ec9('0x3a')](_0x3a1c46['query']['sort']);_0x4f355b[_0x0ec9('0x3b')]=qs[_0x0ec9('0x34')](_[_0x0ec9('0x59')](_0x3a1c46['query'],_0x1ce183[_0x0ec9('0x34')]));if(_0x3a1c46[_0x0ec9('0x32')]['filter']){_0x4f355b['where']=_[_0x0ec9('0x3d')](_0x4f355b[_0x0ec9('0x3b')],{'$or':_[_0x0ec9('0x3e')](_0x4f355b[_0x0ec9('0x36')],function(_0x4f8c19){var _0x17b974={};_0x17b974[_0x4f8c19]={'$like':'%'+_0x3a1c46[_0x0ec9('0x32')]['filter']+'%'};return _0x17b974;})});}_0x4f355b=_[_0x0ec9('0x3d')]({},_0x4f355b,_0x3a1c46[_0x0ec9('0x3f')]);return _0x4081a7[_0x0ec9('0x5e')](_0x4f355b);}})[_0x0ec9('0x23')](function(_0x5e3a33){if(_0x5e3a33){_0xd31867=_0x5e3a33[_0x0ec9('0x47')];if(!_0x3a1c46[_0x0ec9('0x32')]['hasOwnProperty'](_0x0ec9('0x58'))){_0x4f355b[_0x0ec9('0x1d')]=qs[_0x0ec9('0x1d')](_0x3a1c46[_0x0ec9('0x32')][_0x0ec9('0x1d')]);_0x4f355b[_0x0ec9('0x1b')]=qs['offset'](_0x3a1c46['query']['offset']);}return _0x4081a7['getActions'](_0x4f355b);}})[_0x0ec9('0x23')](function(_0x28a71c){if(_0x28a71c){return _0x28a71c?{'count':_0xd31867,'rows':_0x28a71c}:null;}})['then'](respondWithResult(_0x37ceb8,null))['catch'](handleError(_0x37ceb8,null));}; \ No newline at end of file +var _0x525a=['count','limit','set','Content-Range','json','reject','save','update','then','get','Triggers','UserProfileResource','destroy','status','error','stack','name','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','include','Trigger','findAll','rows','catch','show','params','fields','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','map','options','getAnyConditions','addAction','TriggerId','Action','getActions','findOne','rimraf','request-promise','moment','mustache','util','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','offset','undefined'];(function(_0x383c98,_0x2d7b8f){var _0x1691d2=function(_0x55c9b8){while(--_0x55c9b8){_0x383c98['push'](_0x383c98['shift']());}};_0x1691d2(++_0x2d7b8f);}(_0x525a,0xfa));var _0xa525=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x525a[_0x485b5a];return _0xd2b34d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa525('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa525('0x1'));var moment=require(_0xa525('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xa525('0x3'));var util=require(_0xa525('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xa525('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa525('0x6'));var _=require(_0xa525('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa525('0x8'));var toCsv=require(_0xa525('0x5'));var querystring=require(_0xa525('0x9'));var Papa=require(_0xa525('0xa'));var Redis=require(_0xa525('0xb'));var authService=require(_0xa525('0xc'));var qs=require(_0xa525('0xd'));var as=require(_0xa525('0xe'));var hardwareService=require(_0xa525('0xf'));var logger=require(_0xa525('0x10'))(_0xa525('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa525('0x12'))['db'];function respondWithStatusCode(_0x2654e1,_0x52cd1d){_0x52cd1d=_0x52cd1d||0xcc;return function(_0x683eee){if(_0x683eee){return _0x2654e1[_0xa525('0x13')](_0x52cd1d);}return _0x2654e1['status'](_0x52cd1d)[_0xa525('0x14')]();};}function respondWithResult(_0x2e7825,_0x2e8c23){_0x2e8c23=_0x2e8c23||0xc8;return function(_0x34794b){if(_0x34794b){return _0x2e7825['status'](_0x2e8c23)['json'](_0x34794b);}};}function respondWithFilteredResult(_0x45b847,_0x2cf975){return function(_0x24a139){if(_0x24a139){var _0x29f7f0=typeof _0x2cf975[_0xa525('0x15')]===_0xa525('0x16')&&typeof _0x2cf975['limit']===_0xa525('0x16');var _0x4ae18c=_0x24a139[_0xa525('0x17')];var _0x252abd=_0x29f7f0?0x0:_0x2cf975[_0xa525('0x15')];var _0x3b2713=_0x29f7f0?_0x24a139[_0xa525('0x17')]:_0x2cf975[_0xa525('0x15')]+_0x2cf975[_0xa525('0x18')];var _0x3e4d6e;if(_0x3b2713>=_0x4ae18c){_0x3b2713=_0x4ae18c;_0x3e4d6e=0xc8;}else{_0x3e4d6e=0xce;}_0x45b847['status'](_0x3e4d6e);return _0x45b847[_0xa525('0x19')](_0xa525('0x1a'),_0x252abd+'-'+_0x3b2713+'/'+_0x4ae18c)[_0xa525('0x1b')](_0x24a139);}return null;};}function patchUpdates(_0x2fd7d7){return function(_0xde4ac0){try{jsonpatch['apply'](_0xde4ac0,_0x2fd7d7,!![]);}catch(_0x2149a0){return BPromise[_0xa525('0x1c')](_0x2149a0);}return _0xde4ac0[_0xa525('0x1d')]();};}function saveUpdates(_0x519894,_0xa7ca69){return function(_0x2ff5b8){if(_0x2ff5b8){return _0x2ff5b8[_0xa525('0x1e')](_0x519894)[_0xa525('0x1f')](function(_0x331030){return _0x331030;});}return null;};}function removeEntity(_0x202e77,_0x1a9a3a){return function(_0x213fa1){if(_0x213fa1){return _0x213fa1['destroy']()['then'](function(){var _0xf149df=_0x213fa1[_0xa525('0x20')]({'plain':!![]});var _0x3c3091=_0xa525('0x21');return db[_0xa525('0x22')][_0xa525('0x23')]({'where':{'type':_0x3c3091,'resourceId':_0xf149df['id']}})['then'](function(){return _0x213fa1;});})[_0xa525('0x1f')](function(){_0x202e77[_0xa525('0x24')](0xcc)[_0xa525('0x14')]();});}};}function handleEntityNotFound(_0x32ee6a,_0x247aa0){return function(_0x343efd){if(!_0x343efd){_0x32ee6a[_0xa525('0x13')](0x194);}return _0x343efd;};}function handleError(_0x301f8a,_0x53f1f3){_0x53f1f3=_0x53f1f3||0x1f4;return function(_0x234bca){logger[_0xa525('0x25')](_0x234bca[_0xa525('0x26')]);if(_0x234bca[_0xa525('0x27')]){delete _0x234bca[_0xa525('0x27')];}_0x301f8a[_0xa525('0x24')](_0x53f1f3)['send'](_0x234bca);};}exports['index']=function(_0x3aa973,_0x28c005){var _0x1b3235={},_0x41624d={},_0x114c63={'count':0x0,'rows':[]};var _0x5c7c07=_['map'](db['Trigger'][_0xa525('0x28')],function(_0x28663f){return{'name':_0x28663f[_0xa525('0x29')],'type':_0x28663f['type'][_0xa525('0x2a')]};});_0x41624d['model']=_['map'](_0x5c7c07,_0xa525('0x27'));_0x41624d[_0xa525('0x2b')]=_[_0xa525('0x2c')](_0x3aa973[_0xa525('0x2b')]);_0x41624d[_0xa525('0x2d')]=_[_0xa525('0x2e')](_0x41624d[_0xa525('0x2f')],_0x41624d[_0xa525('0x2b')]);_0x1b3235[_0xa525('0x30')]=_['intersection'](_0x41624d[_0xa525('0x2f')],qs['fields'](_0x3aa973[_0xa525('0x2b')]['fields']));_0x1b3235[_0xa525('0x30')]=_0x1b3235[_0xa525('0x30')][_0xa525('0x31')]?_0x1b3235['attributes']:_0x41624d[_0xa525('0x2f')];if(!_0x3aa973[_0xa525('0x2b')][_0xa525('0x32')]('nolimit')){_0x1b3235['limit']=qs[_0xa525('0x18')](_0x3aa973[_0xa525('0x2b')][_0xa525('0x18')]);_0x1b3235[_0xa525('0x15')]=qs[_0xa525('0x15')](_0x3aa973[_0xa525('0x2b')][_0xa525('0x15')]);}_0x1b3235[_0xa525('0x33')]=qs[_0xa525('0x34')](_0x3aa973[_0xa525('0x2b')][_0xa525('0x34')]);_0x1b3235[_0xa525('0x35')]=qs[_0xa525('0x2d')](_[_0xa525('0x36')](_0x3aa973['query'],_0x41624d['filters']),_0x5c7c07);if(_0x3aa973['query'][_0xa525('0x37')]){_0x1b3235[_0xa525('0x35')]=_[_0xa525('0x38')](_0x1b3235[_0xa525('0x35')],{'$or':_['map'](_0x5c7c07,function(_0x5609a4){if(_0x5609a4[_0xa525('0x39')]!==_0xa525('0x3a')){var _0x1d915b={};_0x1d915b[_0x5609a4['name']]={'$like':'%'+_0x3aa973[_0xa525('0x2b')][_0xa525('0x37')]+'%'};return _0x1d915b;}})});}_0x1b3235=_[_0xa525('0x38')]({},_0x1b3235,_0x3aa973['options']);var _0x3a63a7={'where':_0x1b3235[_0xa525('0x35')]};return db['Trigger'][_0xa525('0x17')](_0x3a63a7)[_0xa525('0x1f')](function(_0x55f940){_0x114c63['count']=_0x55f940;if(_0x3aa973[_0xa525('0x2b')]['includeAll']){_0x1b3235[_0xa525('0x3b')]=[{'all':!![]}];}return db[_0xa525('0x3c')][_0xa525('0x3d')](_0x1b3235);})[_0xa525('0x1f')](function(_0xa7fae0){_0x114c63[_0xa525('0x3e')]=_0xa7fae0;return _0x114c63;})['then'](respondWithFilteredResult(_0x28c005,_0x1b3235))[_0xa525('0x3f')](handleError(_0x28c005,null));};exports[_0xa525('0x40')]=function(_0x308903,_0x232b07){var _0x57a972={'raw':![],'where':{'id':_0x308903[_0xa525('0x41')]['id']}},_0x1d7dd1={};_0x1d7dd1[_0xa525('0x2f')]=_[_0xa525('0x2c')](db[_0xa525('0x3c')]['rawAttributes']);_0x1d7dd1[_0xa525('0x2b')]=_['keys'](_0x308903[_0xa525('0x2b')]);_0x1d7dd1[_0xa525('0x2d')]=_[_0xa525('0x2e')](_0x1d7dd1[_0xa525('0x2f')],_0x1d7dd1['query']);_0x57a972['attributes']=_['intersection'](_0x1d7dd1[_0xa525('0x2f')],qs[_0xa525('0x42')](_0x308903[_0xa525('0x2b')][_0xa525('0x42')]));_0x57a972['attributes']=_0x57a972[_0xa525('0x30')][_0xa525('0x31')]?_0x57a972[_0xa525('0x30')]:_0x1d7dd1[_0xa525('0x2f')];if(_0x308903[_0xa525('0x2b')][_0xa525('0x43')]){_0x57a972['include']=[{'all':!![]}];}_0x57a972=_[_0xa525('0x38')]({},_0x57a972,_0x308903['options']);return db[_0xa525('0x3c')]['find'](_0x57a972)[_0xa525('0x1f')](handleEntityNotFound(_0x232b07,null))[_0xa525('0x1f')](respondWithResult(_0x232b07,null))[_0xa525('0x3f')](handleError(_0x232b07,null));};exports[_0xa525('0x44')]=function(_0x12163b,_0x1da1aa){return db[_0xa525('0x3c')][_0xa525('0x44')](_0x12163b[_0xa525('0x45')],{})[_0xa525('0x1f')](function(_0x437ba2){var _0x2d092c=_0x12163b[_0xa525('0x46')][_0xa525('0x20')]({'plain':!![]});if(!_0x2d092c)throw new Error(_0xa525('0x47'));if(_0x2d092c[_0xa525('0x48')]===_0xa525('0x46')){var _0x4fcdb1=_0x437ba2['get']({'plain':!![]});var _0x153fea=_0xa525('0x21');return db[_0xa525('0x49')][_0xa525('0x4a')]({'where':{'name':_0x153fea,'userProfileId':_0x2d092c[_0xa525('0x4b')]},'raw':!![]})[_0xa525('0x1f')](function(_0x2818a5){if(_0x2818a5&&_0x2818a5[_0xa525('0x4c')]===0x0){return db[_0xa525('0x22')]['create']({'name':_0x4fcdb1[_0xa525('0x27')],'resourceId':_0x4fcdb1['id'],'type':_0x2818a5[_0xa525('0x27')],'sectionId':_0x2818a5['id']},{})[_0xa525('0x1f')](function(){return _0x437ba2;});}else{return _0x437ba2;}})[_0xa525('0x3f')](function(_0x4fc1bc){logger[_0xa525('0x25')](_0xa525('0x4d'),_0x4fc1bc);throw _0x4fc1bc;});}return _0x437ba2;})[_0xa525('0x1f')](respondWithResult(_0x1da1aa,0xc9))[_0xa525('0x3f')](handleError(_0x1da1aa,null));};exports['update']=function(_0xe0fe1b,_0x3db051){if(_0xe0fe1b[_0xa525('0x45')]['id']){delete _0xe0fe1b[_0xa525('0x45')]['id'];}return db[_0xa525('0x3c')][_0xa525('0x4a')]({'where':{'id':_0xe0fe1b[_0xa525('0x41')]['id']}})[_0xa525('0x1f')](handleEntityNotFound(_0x3db051,null))['then'](saveUpdates(_0xe0fe1b[_0xa525('0x45')],null))[_0xa525('0x1f')](respondWithResult(_0x3db051,null))[_0xa525('0x3f')](handleError(_0x3db051,null));};exports[_0xa525('0x23')]=function(_0xc87e13,_0x2ae3e3){return db[_0xa525('0x3c')]['find']({'where':{'id':_0xc87e13[_0xa525('0x41')]['id']}})[_0xa525('0x1f')](handleEntityNotFound(_0x2ae3e3,null))['then'](removeEntity(_0x2ae3e3,null))[_0xa525('0x3f')](handleError(_0x2ae3e3,null));};exports[_0xa525('0x4e')]=function(_0x537658,_0x59502f,_0x3624bd){if(_0x537658[_0xa525('0x45')]['id']){delete _0x537658[_0xa525('0x45')]['id'];}return db[_0xa525('0x3c')][_0xa525('0x4a')]({'where':{'id':_0x537658['params']['id']}})['then'](handleEntityNotFound(_0x59502f,null))['then'](function(_0x37b4cf){if(_0x37b4cf){_0x537658[_0xa525('0x45')][_0xa525('0x4f')]=_0x37b4cf['id'];return db[_0xa525('0x50')][_0xa525('0x44')](_0x537658[_0xa525('0x45')]);}})[_0xa525('0x1f')](respondWithResult(_0x59502f,null))[_0xa525('0x3f')](handleError(_0x59502f,null));};exports[_0xa525('0x51')]=function(_0x172eb5,_0x9dc1ac,_0x4545a6){if(_0x172eb5[_0xa525('0x45')]['id']){delete _0x172eb5['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x172eb5[_0xa525('0x41')]['id']}})[_0xa525('0x1f')](handleEntityNotFound(_0x9dc1ac,null))[_0xa525('0x1f')](function(_0x69869f){if(_0x69869f){_0x172eb5[_0xa525('0x45')]['TriggerAnyId']=_0x69869f['id'];return db['Condition']['create'](_0x172eb5[_0xa525('0x45')]);}})[_0xa525('0x1f')](respondWithResult(_0x9dc1ac,null))['catch'](handleError(_0x9dc1ac,null));};exports[_0xa525('0x52')]=function(_0x5a940e,_0x58a1ec,_0x58eedb){var _0xd50ba3={};var _0x41a38b={};var _0x46c6e8;var _0xef684a;return db[_0xa525('0x3c')]['findOne']({'where':{'id':_0x5a940e[_0xa525('0x41')]['id']}})[_0xa525('0x1f')](handleEntityNotFound(_0x58a1ec,null))[_0xa525('0x1f')](function(_0x1214f8){if(_0x1214f8){_0x46c6e8=_0x1214f8;_0x41a38b['model']=_[_0xa525('0x2c')](db['Condition'][_0xa525('0x28')]);_0x41a38b['query']=_[_0xa525('0x2c')](_0x5a940e[_0xa525('0x2b')]);_0x41a38b['filters']=_['intersection'](_0x41a38b['model'],_0x41a38b[_0xa525('0x2b')]);_0xd50ba3[_0xa525('0x30')]=_['intersection'](_0x41a38b[_0xa525('0x2f')],qs[_0xa525('0x42')](_0x5a940e[_0xa525('0x2b')][_0xa525('0x42')]));_0xd50ba3['attributes']=_0xd50ba3[_0xa525('0x30')]['length']?_0xd50ba3['attributes']:_0x41a38b[_0xa525('0x2f')];_0xd50ba3[_0xa525('0x33')]=qs[_0xa525('0x34')](_0x5a940e[_0xa525('0x2b')][_0xa525('0x34')]);_0xd50ba3[_0xa525('0x35')]=qs[_0xa525('0x2d')](_['pick'](_0x5a940e[_0xa525('0x2b')],_0x41a38b[_0xa525('0x2d')]));if(_0x5a940e[_0xa525('0x2b')][_0xa525('0x37')]){_0xd50ba3[_0xa525('0x35')]=_['merge'](_0xd50ba3['where'],{'$or':_[_0xa525('0x53')](_0xd50ba3[_0xa525('0x30')],function(_0x13146b){var _0x35a785={};_0x35a785[_0x13146b]={'$like':'%'+_0x5a940e['query'][_0xa525('0x37')]+'%'};return _0x35a785;})});}_0xd50ba3=_['merge']({},_0xd50ba3,_0x5a940e[_0xa525('0x54')]);return _0x46c6e8[_0xa525('0x52')](_0xd50ba3);}})['then'](function(_0x221b65){if(_0x221b65){_0xef684a=_0x221b65['length'];if(!_0x5a940e['query']['hasOwnProperty']('nolimit')){_0xd50ba3['limit']=qs[_0xa525('0x18')](_0x5a940e[_0xa525('0x2b')][_0xa525('0x18')]);_0xd50ba3[_0xa525('0x15')]=qs['offset'](_0x5a940e[_0xa525('0x2b')][_0xa525('0x15')]);}return _0x46c6e8[_0xa525('0x52')](_0xd50ba3);}})[_0xa525('0x1f')](function(_0xe93452){if(_0xe93452){return _0xe93452?{'count':_0xef684a,'rows':_0xe93452}:null;}})[_0xa525('0x1f')](respondWithResult(_0x58a1ec,null))[_0xa525('0x3f')](handleError(_0x58a1ec,null));};exports['getAnyConditions']=function(_0x1f8ee7,_0x4e4caf,_0x381f71){var _0x2d4332={};var _0x61765c={};var _0x3ff28b;var _0x21fc7c;return db[_0xa525('0x3c')]['findOne']({'where':{'id':_0x1f8ee7[_0xa525('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e4caf,null))[_0xa525('0x1f')](function(_0x15fe82){if(_0x15fe82){_0x3ff28b=_0x15fe82;_0x61765c[_0xa525('0x2f')]=_[_0xa525('0x2c')](db[_0xa525('0x50')][_0xa525('0x28')]);_0x61765c[_0xa525('0x2b')]=_[_0xa525('0x2c')](_0x1f8ee7['query']);_0x61765c['filters']=_[_0xa525('0x2e')](_0x61765c[_0xa525('0x2f')],_0x61765c[_0xa525('0x2b')]);_0x2d4332['attributes']=_['intersection'](_0x61765c['model'],qs[_0xa525('0x42')](_0x1f8ee7['query']['fields']));_0x2d4332[_0xa525('0x30')]=_0x2d4332[_0xa525('0x30')][_0xa525('0x31')]?_0x2d4332['attributes']:_0x61765c[_0xa525('0x2f')];_0x2d4332[_0xa525('0x33')]=qs[_0xa525('0x34')](_0x1f8ee7[_0xa525('0x2b')][_0xa525('0x34')]);_0x2d4332['where']=qs['filters'](_[_0xa525('0x36')](_0x1f8ee7['query'],_0x61765c[_0xa525('0x2d')]));if(_0x1f8ee7[_0xa525('0x2b')][_0xa525('0x37')]){_0x2d4332['where']=_[_0xa525('0x38')](_0x2d4332['where'],{'$or':_[_0xa525('0x53')](_0x2d4332[_0xa525('0x30')],function(_0x1f2941){var _0x5a128a={};_0x5a128a[_0x1f2941]={'$like':'%'+_0x1f8ee7[_0xa525('0x2b')][_0xa525('0x37')]+'%'};return _0x5a128a;})});}_0x2d4332=_[_0xa525('0x38')]({},_0x2d4332,_0x1f8ee7['options']);return _0x3ff28b[_0xa525('0x55')](_0x2d4332);}})[_0xa525('0x1f')](function(_0x2794f7){if(_0x2794f7){_0x21fc7c=_0x2794f7[_0xa525('0x31')];if(!_0x1f8ee7[_0xa525('0x2b')]['hasOwnProperty']('nolimit')){_0x2d4332['limit']=qs[_0xa525('0x18')](_0x1f8ee7[_0xa525('0x2b')]['limit']);_0x2d4332[_0xa525('0x15')]=qs[_0xa525('0x15')](_0x1f8ee7[_0xa525('0x2b')]['offset']);}return _0x3ff28b['getAnyConditions'](_0x2d4332);}})[_0xa525('0x1f')](function(_0x54efcf){if(_0x54efcf){return _0x54efcf?{'count':_0x21fc7c,'rows':_0x54efcf}:null;}})[_0xa525('0x1f')](respondWithResult(_0x4e4caf,null))[_0xa525('0x3f')](handleError(_0x4e4caf,null));};exports[_0xa525('0x56')]=function(_0x43a2b4,_0x1aa532,_0x575382){if(_0x43a2b4[_0xa525('0x45')]['id']){delete _0x43a2b4[_0xa525('0x45')]['id'];}return db[_0xa525('0x3c')][_0xa525('0x4a')]({'where':{'id':_0x43a2b4[_0xa525('0x41')]['id']}})['then'](handleEntityNotFound(_0x1aa532,null))[_0xa525('0x1f')](function(_0x50563a){if(_0x50563a){_0x43a2b4[_0xa525('0x45')][_0xa525('0x57')]=_0x50563a['id'];return db[_0xa525('0x58')]['create'](_0x43a2b4['body']);}})[_0xa525('0x1f')](respondWithResult(_0x1aa532,null))[_0xa525('0x3f')](handleError(_0x1aa532,null));};exports[_0xa525('0x59')]=function(_0x407849,_0x264795,_0x186294){var _0x1302f4={};var _0x2b8252={};var _0x30dcfe;var _0x41b934;return db[_0xa525('0x3c')][_0xa525('0x5a')]({'where':{'id':_0x407849[_0xa525('0x41')]['id']}})['then'](handleEntityNotFound(_0x264795,null))[_0xa525('0x1f')](function(_0x1e4421){if(_0x1e4421){_0x30dcfe=_0x1e4421;_0x2b8252[_0xa525('0x2f')]=_['keys'](db[_0xa525('0x58')]['rawAttributes']);_0x2b8252['query']=_[_0xa525('0x2c')](_0x407849[_0xa525('0x2b')]);_0x2b8252[_0xa525('0x2d')]=_['intersection'](_0x2b8252[_0xa525('0x2f')],_0x2b8252[_0xa525('0x2b')]);_0x1302f4[_0xa525('0x30')]=_['intersection'](_0x2b8252[_0xa525('0x2f')],qs['fields'](_0x407849['query']['fields']));_0x1302f4[_0xa525('0x30')]=_0x1302f4['attributes'][_0xa525('0x31')]?_0x1302f4[_0xa525('0x30')]:_0x2b8252[_0xa525('0x2f')];_0x1302f4[_0xa525('0x33')]=qs['sort'](_0x407849[_0xa525('0x2b')][_0xa525('0x34')]);_0x1302f4[_0xa525('0x35')]=qs[_0xa525('0x2d')](_[_0xa525('0x36')](_0x407849['query'],_0x2b8252[_0xa525('0x2d')]));if(_0x407849[_0xa525('0x2b')][_0xa525('0x37')]){_0x1302f4[_0xa525('0x35')]=_[_0xa525('0x38')](_0x1302f4[_0xa525('0x35')],{'$or':_[_0xa525('0x53')](_0x1302f4['attributes'],function(_0x346a18){var _0x454076={};_0x454076[_0x346a18]={'$like':'%'+_0x407849[_0xa525('0x2b')]['filter']+'%'};return _0x454076;})});}_0x1302f4=_['merge']({},_0x1302f4,_0x407849[_0xa525('0x54')]);return _0x30dcfe[_0xa525('0x59')](_0x1302f4);}})[_0xa525('0x1f')](function(_0xb80f16){if(_0xb80f16){_0x41b934=_0xb80f16[_0xa525('0x31')];if(!_0x407849[_0xa525('0x2b')][_0xa525('0x32')]('nolimit')){_0x1302f4[_0xa525('0x18')]=qs[_0xa525('0x18')](_0x407849[_0xa525('0x2b')][_0xa525('0x18')]);_0x1302f4[_0xa525('0x15')]=qs['offset'](_0x407849[_0xa525('0x2b')][_0xa525('0x15')]);}return _0x30dcfe[_0xa525('0x59')](_0x1302f4);}})[_0xa525('0x1f')](function(_0x1af35c){if(_0x1af35c){return _0x1af35c?{'count':_0x41b934,'rows':_0x1af35c}:null;}})[_0xa525('0x1f')](respondWithResult(_0x264795,null))[_0xa525('0x3f')](handleError(_0x264795,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 699de03..7447440 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 _0x225c=['moment','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x225c,0x106));var _0xc225=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x225c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc225('0x0'));var util=require(_0xc225('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc225('0x2'));var BPromise=require('bluebird');var rp=require(_0xc225('0x3'));var fs=require('fs');var path=require(_0xc225('0x4'));var rimraf=require(_0xc225('0x5'));var config=require(_0xc225('0x6'));var attributes=require(_0xc225('0x7'));module[_0xc225('0x8')]=function(_0x22d294,_0x54be3a){return _0x22d294[_0xc225('0x9')](_0xc225('0xa'),attributes,{'tableName':_0xc225('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4853=['path','rimraf','define','Trigger','tools_triggers','util','api','moment','bluebird','request-promise'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x3485('0x0'));var logger=require('../../config/logger')(_0x3485('0x1'));var moment=require(_0x3485('0x2'));var BPromise=require(_0x3485('0x3'));var rp=require(_0x3485('0x4'));var fs=require('fs');var path=require(_0x3485('0x5'));var rimraf=require(_0x3485('0x6'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0x249d2c,_0x7512e3){return _0x249d2c[_0x3485('0x7')](_0x3485('0x8'),attributes,{'tableName':_0x3485('0x9'),'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 779bd28..dd15f8c 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 _0xdac3=['raw','where','attributes','limit','include','map','model','then','stringify','ShowTrigger','find','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','request','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','GetTrigger','Trigger','findAll','options'];(function(_0x3f55db,_0x4aca08){var _0x59ac51=function(_0x13c6b4){while(--_0x13c6b4){_0x3f55db['push'](_0x3f55db['shift']());}};_0x59ac51(++_0x4aca08);}(_0xdac3,0x160));var _0x3dac=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0xdac3[_0x19aaa9];return _0x465463;};'use strict';var _=require(_0x3dac('0x0'));var util=require(_0x3dac('0x1'));var moment=require(_0x3dac('0x2'));var BPromise=require('bluebird');var rs=require(_0x3dac('0x3'));var fs=require('fs');var Redis=require(_0x3dac('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3dac('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3dac('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3dac('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4493bb,_0x2b13d5,_0x2db751){return new BPromise(function(_0x34a273,_0x252267){return client[_0x3dac('0x8')](_0x4493bb,_0x2db751)['then'](function(_0x559e88){logger[_0x3dac('0x9')](_0x3dac('0xa'),_0x2b13d5,'request\x20sent');logger[_0x3dac('0xb')]('Trigger,\x20%s,\x20%s,\x20%s',_0x2b13d5,_0x3dac('0xc'),JSON['stringify'](_0x559e88));if(_0x559e88[_0x3dac('0xd')]){if(_0x559e88[_0x3dac('0xd')]['code']===0x1f4){logger[_0x3dac('0xd')](_0x3dac('0xa'),_0x2b13d5,_0x559e88['error'][_0x3dac('0xe')]);return _0x252267(_0x559e88[_0x3dac('0xd')]['message']);}logger[_0x3dac('0xd')](_0x3dac('0xa'),_0x2b13d5,_0x559e88[_0x3dac('0xd')][_0x3dac('0xe')]);return _0x34a273(_0x559e88[_0x3dac('0xd')][_0x3dac('0xe')]);}else{logger[_0x3dac('0x9')](_0x3dac('0xa'),_0x2b13d5,_0x3dac('0xc'));_0x34a273(_0x559e88['result'][_0x3dac('0xe')]);}})[_0x3dac('0xf')](function(_0x49395b){logger['error']('Trigger,\x20%s,\x20%s',_0x2b13d5,_0x49395b);_0x252267(_0x49395b);});});}exports[_0x3dac('0x10')]=function(_0x32f0a8){var _0x53eca9=this;return new Promise(function(_0x37ace1,_0x517c06){return db[_0x3dac('0x11')][_0x3dac('0x12')]({'raw':_0x32f0a8[_0x3dac('0x13')]?_0x32f0a8['options'][_0x3dac('0x14')]===undefined?!![]:![]:!![],'where':_0x32f0a8[_0x3dac('0x13')]?_0x32f0a8['options'][_0x3dac('0x15')]||null:null,'attributes':_0x32f0a8[_0x3dac('0x13')]?_0x32f0a8['options'][_0x3dac('0x16')]||null:null,'limit':_0x32f0a8[_0x3dac('0x13')]?_0x32f0a8[_0x3dac('0x13')][_0x3dac('0x17')]||null:null,'include':_0x32f0a8[_0x3dac('0x13')]?_0x32f0a8[_0x3dac('0x13')][_0x3dac('0x18')]?_[_0x3dac('0x19')](_0x32f0a8[_0x3dac('0x13')][_0x3dac('0x18')],function(_0x4b99a0){return{'model':db[_0x4b99a0[_0x3dac('0x1a')]],'as':_0x4b99a0['as'],'attributes':_0x4b99a0['attributes'],'include':_0x4b99a0[_0x3dac('0x18')]?_['map'](_0x4b99a0['include'],function(_0x36e275){return{'model':db[_0x36e275[_0x3dac('0x1a')]],'as':_0x36e275['as'],'attributes':_0x36e275[_0x3dac('0x16')],'include':_0x36e275[_0x3dac('0x18')]?_['map'](_0x36e275[_0x3dac('0x18')],function(_0x154f3f){return{'model':db[_0x154f3f[_0x3dac('0x1a')]],'as':_0x154f3f['as'],'attributes':_0x154f3f[_0x3dac('0x16')]};}):[]};}):[]};}):[]:[]})[_0x3dac('0x1b')](function(_0x19e9fc){logger[_0x3dac('0x9')](_0x3dac('0x10'),_0x32f0a8);logger[_0x3dac('0xb')](_0x3dac('0x10'),_0x32f0a8,JSON[_0x3dac('0x1c')](_0x19e9fc));_0x37ace1(_0x19e9fc);})[_0x3dac('0xf')](function(_0x3b2426){logger[_0x3dac('0xd')]('GetTrigger',_0x3b2426[_0x3dac('0xe')],_0x32f0a8);_0x517c06(_0x53eca9[_0x3dac('0xd')](0x1f4,_0x3b2426[_0x3dac('0xe')]));});});};exports[_0x3dac('0x1d')]=function(_0xec4f6d){var _0x2e5e44=this;return new Promise(function(_0x5db780,_0x36754b){return db[_0x3dac('0x11')][_0x3dac('0x1e')]({'raw':_0xec4f6d[_0x3dac('0x13')]?_0xec4f6d['options'][_0x3dac('0x14')]===undefined?!![]:![]:!![],'where':_0xec4f6d[_0x3dac('0x13')]?_0xec4f6d[_0x3dac('0x13')][_0x3dac('0x15')]||null:null,'attributes':_0xec4f6d[_0x3dac('0x13')]?_0xec4f6d[_0x3dac('0x13')][_0x3dac('0x16')]||null:null,'include':_0xec4f6d[_0x3dac('0x13')]?_0xec4f6d[_0x3dac('0x13')]['include']?_[_0x3dac('0x19')](_0xec4f6d[_0x3dac('0x13')]['include'],function(_0x3a8202){return{'model':db[_0x3a8202[_0x3dac('0x1a')]],'as':_0x3a8202['as'],'attributes':_0x3a8202[_0x3dac('0x16')],'include':_0x3a8202['include']?_[_0x3dac('0x19')](_0x3a8202[_0x3dac('0x18')],function(_0x4a176b){return{'model':db[_0x4a176b[_0x3dac('0x1a')]],'as':_0x4a176b['as'],'attributes':_0x4a176b[_0x3dac('0x16')],'include':_0x4a176b[_0x3dac('0x18')]?_[_0x3dac('0x19')](_0x4a176b[_0x3dac('0x18')],function(_0x435036){return{'model':db[_0x435036['model']],'as':_0x435036['as'],'attributes':_0x435036[_0x3dac('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e7614){logger[_0x3dac('0x9')](_0x3dac('0x1d'),_0xec4f6d);logger[_0x3dac('0xb')](_0x3dac('0x1d'),_0xec4f6d,JSON[_0x3dac('0x1c')](_0x3e7614));_0x5db780(_0x3e7614);})[_0x3dac('0xf')](function(_0x4cca2b){logger[_0x3dac('0xd')](_0x3dac('0x1d'),_0x4cca2b['message'],_0xec4f6d);_0x36754b(_0x2e5e44[_0x3dac('0xd')](0x1f4,_0x4cca2b[_0x3dac('0xe')]));});});}; \ No newline at end of file +var _0x0e1a=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','limit','include','attributes','map','model','ShowTrigger','find','raw','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e1a,0x1e1));var _0xa0e1=function(_0x270ace,_0x491769){_0x270ace=_0x270ace-0x0;var _0x980379=_0x0e1a[_0x270ace];return _0x980379;};'use strict';var _=require(_0xa0e1('0x0'));var util=require(_0xa0e1('0x1'));var moment=require(_0xa0e1('0x2'));var BPromise=require(_0xa0e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0e1('0x4'));var db=require(_0xa0e1('0x5'))['db'];var utils=require(_0xa0e1('0x6'));var logger=require('../../config/logger')(_0xa0e1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x101e1d,_0x5dc9d0,_0x3db996){return new BPromise(function(_0xc5cbbd,_0x100575){return client[_0xa0e1('0x8')](_0x101e1d,_0x3db996)[_0xa0e1('0x9')](function(_0x2df98d){logger[_0xa0e1('0xa')](_0xa0e1('0xb'),_0x5dc9d0,_0xa0e1('0xc'));logger[_0xa0e1('0xd')](_0xa0e1('0xe'),_0x5dc9d0,_0xa0e1('0xc'),JSON[_0xa0e1('0xf')](_0x2df98d));if(_0x2df98d[_0xa0e1('0x10')]){if(_0x2df98d[_0xa0e1('0x10')][_0xa0e1('0x11')]===0x1f4){logger['error'](_0xa0e1('0xb'),_0x5dc9d0,_0x2df98d[_0xa0e1('0x10')]['message']);return _0x100575(_0x2df98d[_0xa0e1('0x10')][_0xa0e1('0x12')]);}logger['error'](_0xa0e1('0xb'),_0x5dc9d0,_0x2df98d[_0xa0e1('0x10')][_0xa0e1('0x12')]);return _0xc5cbbd(_0x2df98d[_0xa0e1('0x10')][_0xa0e1('0x12')]);}else{logger[_0xa0e1('0xa')]('Trigger,\x20%s,\x20%s',_0x5dc9d0,'request\x20sent');_0xc5cbbd(_0x2df98d['result'][_0xa0e1('0x12')]);}})[_0xa0e1('0x13')](function(_0x5a54f9){logger['error'](_0xa0e1('0xb'),_0x5dc9d0,_0x5a54f9);_0x100575(_0x5a54f9);});});}exports[_0xa0e1('0x14')]=function(_0x5d5310){var _0x3da4eb=this;return new Promise(function(_0x4c6191,_0x1f2f51){return db[_0xa0e1('0x15')][_0xa0e1('0x16')]({'raw':_0x5d5310[_0xa0e1('0x17')]?_0x5d5310[_0xa0e1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5d5310[_0xa0e1('0x17')]?_0x5d5310[_0xa0e1('0x17')]['where']||null:null,'attributes':_0x5d5310[_0xa0e1('0x17')]?_0x5d5310[_0xa0e1('0x17')]['attributes']||null:null,'limit':_0x5d5310['options']?_0x5d5310['options'][_0xa0e1('0x18')]||null:null,'include':_0x5d5310[_0xa0e1('0x17')]?_0x5d5310[_0xa0e1('0x17')][_0xa0e1('0x19')]?_['map'](_0x5d5310[_0xa0e1('0x17')]['include'],function(_0x2742e2){return{'model':db[_0x2742e2['model']],'as':_0x2742e2['as'],'attributes':_0x2742e2[_0xa0e1('0x1a')],'include':_0x2742e2[_0xa0e1('0x19')]?_[_0xa0e1('0x1b')](_0x2742e2[_0xa0e1('0x19')],function(_0x1bb1fc){return{'model':db[_0x1bb1fc[_0xa0e1('0x1c')]],'as':_0x1bb1fc['as'],'attributes':_0x1bb1fc['attributes'],'include':_0x1bb1fc[_0xa0e1('0x19')]?_['map'](_0x1bb1fc[_0xa0e1('0x19')],function(_0x3fb880){return{'model':db[_0x3fb880['model']],'as':_0x3fb880['as'],'attributes':_0x3fb880[_0xa0e1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x37c5f7){logger[_0xa0e1('0xa')](_0xa0e1('0x14'),_0x5d5310);logger[_0xa0e1('0xd')](_0xa0e1('0x14'),_0x5d5310,JSON[_0xa0e1('0xf')](_0x37c5f7));_0x4c6191(_0x37c5f7);})[_0xa0e1('0x13')](function(_0x18e24c){logger[_0xa0e1('0x10')](_0xa0e1('0x14'),_0x18e24c[_0xa0e1('0x12')],_0x5d5310);_0x1f2f51(_0x3da4eb[_0xa0e1('0x10')](0x1f4,_0x18e24c['message']));});});};exports[_0xa0e1('0x1d')]=function(_0x327386){var _0x591a3f=this;return new Promise(function(_0x194990,_0x36a03a){return db[_0xa0e1('0x15')][_0xa0e1('0x1e')]({'raw':_0x327386['options']?_0x327386['options'][_0xa0e1('0x1f')]===undefined?!![]:![]:!![],'where':_0x327386[_0xa0e1('0x17')]?_0x327386[_0xa0e1('0x17')][_0xa0e1('0x20')]||null:null,'attributes':_0x327386[_0xa0e1('0x17')]?_0x327386['options'][_0xa0e1('0x1a')]||null:null,'include':_0x327386['options']?_0x327386[_0xa0e1('0x17')][_0xa0e1('0x19')]?_[_0xa0e1('0x1b')](_0x327386[_0xa0e1('0x17')][_0xa0e1('0x19')],function(_0xb14303){return{'model':db[_0xb14303['model']],'as':_0xb14303['as'],'attributes':_0xb14303[_0xa0e1('0x1a')],'include':_0xb14303['include']?_['map'](_0xb14303[_0xa0e1('0x19')],function(_0x30091a){return{'model':db[_0x30091a[_0xa0e1('0x1c')]],'as':_0x30091a['as'],'attributes':_0x30091a['attributes'],'include':_0x30091a[_0xa0e1('0x19')]?_[_0xa0e1('0x1b')](_0x30091a[_0xa0e1('0x19')],function(_0x6942f8){return{'model':db[_0x6942f8['model']],'as':_0x6942f8['as'],'attributes':_0x6942f8[_0xa0e1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41665e){logger[_0xa0e1('0xa')](_0xa0e1('0x1d'),_0x327386);logger['debug']('ShowTrigger',_0x327386,JSON['stringify'](_0x41665e));_0x194990(_0x41665e);})['catch'](function(_0x3ea9a8){logger[_0xa0e1('0x10')](_0xa0e1('0x1d'),_0x3ea9a8[_0xa0e1('0x12')],_0x327386);_0x36a03a(_0x591a3f['error'](0x1f4,_0x3ea9a8['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0a55fa5..eca1ad9 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 _0x177d=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x177d,0xe0));var _0xd177=function(_0x509212,_0x3bae65){_0x509212=_0x509212-0x0;var _0x1c4146=_0x177d[_0x509212];return _0x1c4146;};'use strict';var multer=require(_0xd177('0x0'));var util=require(_0xd177('0x1'));var path=require(_0xd177('0x2'));var timeout=require(_0xd177('0x3'));var express=require(_0xd177('0x4'));var router=express[_0xd177('0x5')]();var fs_extra=require(_0xd177('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd177('0x7'));var config=require(_0xd177('0x8'));var controller=require(_0xd177('0x9'));router[_0xd177('0xa')]('/',auth[_0xd177('0xb')](),controller[_0xd177('0xc')]);router[_0xd177('0xa')](_0xd177('0xd'),auth[_0xd177('0xb')](),controller[_0xd177('0xe')]);router[_0xd177('0xf')](_0xd177('0x10'),auth[_0xd177('0xb')](),controller[_0xd177('0x11')]);router[_0xd177('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd177('0x12')](_0xd177('0xd'),auth[_0xd177('0xb')](),controller['update']);router[_0xd177('0x13')]('/:id',auth[_0xd177('0xb')](),controller[_0xd177('0x14')]);module[_0xd177('0x15')]=router; \ No newline at end of file +var _0xb842=['../../config/environment','get','isAuthenticated','index','show','post','clone','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x4ebdf4,_0x57d47f){var _0x18d1c1=function(_0x83f2a0){while(--_0x83f2a0){_0x4ebdf4['push'](_0x4ebdf4['shift']());}};_0x18d1c1(++_0x57d47f);}(_0xb842,0x13c));var _0x2b84=function(_0x495054,_0x304104){_0x495054=_0x495054-0x0;var _0x146d2e=_0xb842[_0x495054];return _0x146d2e;};'use strict';var multer=require(_0x2b84('0x0'));var util=require(_0x2b84('0x1'));var path=require(_0x2b84('0x2'));var timeout=require(_0x2b84('0x3'));var express=require(_0x2b84('0x4'));var router=express['Router']();var fs_extra=require(_0x2b84('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2b84('0x6'));var config=require(_0x2b84('0x7'));var controller=require('./trunk.controller');router[_0x2b84('0x8')]('/',auth[_0x2b84('0x9')](),controller[_0x2b84('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2b84('0xb')]);router[_0x2b84('0xc')]('/:id/clone',auth[_0x2b84('0x9')](),controller[_0x2b84('0xd')]);router['post']('/',auth[_0x2b84('0x9')](),controller['create']);router[_0x2b84('0xe')]('/:id',auth[_0x2b84('0x9')](),controller[_0x2b84('0xf')]);router[_0x2b84('0x10')](_0x2b84('0x11'),auth[_0x2b84('0x9')](),controller[_0x2b84('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index addd8c5..f021b07 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 _0x85af=['originate','uac','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','name','friend','user','peer','STRING','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','setDataValue','transport','join','getDataValue','split','rfc2833','shortinfo','inband','auto','yes','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','INTEGER','\x22\x22\x20<>','accept','refuse'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x85af,0xce));var _0xf85a=function(_0x43cc56,_0x5ee5b0){_0x43cc56=_0x43cc56-0x0;var _0x538452=_0x85af[_0x43cc56];return _0x538452;};'use strict';var Sequelize=require(_0xf85a('0x0'));module[_0xf85a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf85a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xf85a('0x3'),_0xf85a('0x4'),_0xf85a('0x5')),'allowNull':![],'defaultValue':_0xf85a('0x3')},'context':{'type':Sequelize[_0xf85a('0x6')],'allowNull':![],'defaultValue':_0xf85a('0x7')},'callingpres':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x9'),_0xf85a('0xa'),'ALLOWED_FAILED_SCREEN',_0xf85a('0xb'),_0xf85a('0xc'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xf85a('0xd'))},'deny':{'type':Sequelize[_0xf85a('0x6')]},'permit':{'type':Sequelize[_0xf85a('0x6')]},'secret':{'type':Sequelize[_0xf85a('0x6')]},'md5secret':{'type':Sequelize[_0xf85a('0x6')]},'remotesecret':{'type':Sequelize[_0xf85a('0x6')]},'transport':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':'udp','set':function(_0x3d6237){this[_0xf85a('0xe')](_0xf85a('0xf'),_0x3d6237?_0x3d6237[_0xf85a('0x10')](','):null);},'get':function(){return this[_0xf85a('0x11')](_0xf85a('0xf'))?this['getDataValue'](_0xf85a('0xf'))[_0xf85a('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x13'),'info',_0xf85a('0x14'),_0xf85a('0x15'),_0xf85a('0x16')),'defaultValue':_0xf85a('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0xf85a('0x17'),'no',_0xf85a('0x18'),_0xf85a('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf85a('0x8')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf85a('0x6')]},'directmediadeny':{'type':Sequelize[_0xf85a('0x6')]},'nat':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':'force_rport,comedia','set':function(_0x36508e){this[_0xf85a('0xe')](_0xf85a('0x1a'),_0x36508e?_0x36508e[_0xf85a('0x10')](','):null);},'get':function(){return this[_0xf85a('0x11')](_0xf85a('0x1a'))?this[_0xf85a('0x11')](_0xf85a('0x1a'))[_0xf85a('0x12')](','):null;},'comment':_0xf85a('0x1b')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xf85a('0x6')]},'pickupgroup':{'type':Sequelize[_0xf85a('0x6')]},'namedpickupgroup':{'type':Sequelize[_0xf85a('0x6')]},'language':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf85a('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':_0xf85a('0x1c')},'allow':{'type':Sequelize[_0xf85a('0x6')],'allowNull':![],'defaultValue':_0xf85a('0x1d'),'set':function(_0x59ef4f){this[_0xf85a('0xe')](_0xf85a('0x1e'),_0x59ef4f?_0x59ef4f['join'](';'):_0xf85a('0x1d'));},'get':function(){return this[_0xf85a('0x11')]('allow')?this[_0xf85a('0x11')](_0xf85a('0x1e'))[_0xf85a('0x12')](';'):null;},'comment':_0xf85a('0x1f')},'autoframing':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'insecure':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':_0xf85a('0x20'),'set':function(_0x1f65d7){this[_0xf85a('0xe')](_0xf85a('0x21'),_0x1f65d7?_0x1f65d7[_0xf85a('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xf85a('0x21'))?this[_0xf85a('0x11')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf85a('0x8')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf85a('0x8')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no',_0xf85a('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0xf85a('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xf85a('0x8')]('yes','no')},'accountcode':{'type':Sequelize[_0xf85a('0x23')](0xb)},'setvar':{'type':Sequelize[_0xf85a('0x6')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xf85a('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no'),'defaultValue':_0xf85a('0x17')},'busylevel':{'type':Sequelize[_0xf85a('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xf85a('0x6')]},'template':{'type':Sequelize[_0xf85a('0x6')]},'videosupport':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf85a('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'mailbox':{'type':Sequelize[_0xf85a('0x6')]},'session_timers':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x25'),_0xf85a('0x26'),_0xf85a('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x28'),'uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xf85a('0x6')]},'fromuser':{'type':Sequelize[_0xf85a('0x6')]},'port':{'type':Sequelize[_0xf85a('0x23')](0x5)},'qualify':{'type':Sequelize[_0xf85a('0x8')]('yes','no'),'defaultValue':_0xf85a('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xf85a('0x6')]},'defaultuser':{'type':Sequelize[_0xf85a('0x6')]},'rtptimeout':{'type':Sequelize[_0xf85a('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf85a('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xf85a('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf85a('0x6')]},'callbackextension':{'type':Sequelize[_0xf85a('0x6')]},'timert1':{'type':Sequelize[_0xf85a('0x23')](0xb)},'timerb':{'type':Sequelize[_0xf85a('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xf85a('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xf85a('0x6')]},'contactdeny':{'type':Sequelize[_0xf85a('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xf85a('0x6')]},'maxforwards':{'type':Sequelize[_0xf85a('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xf85a('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'force_avp':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'icesupport':{'type':Sequelize[_0xf85a('0x8')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xf85a('0x8')](_0xf85a('0x17'),'no',_0xf85a('0x29'),_0xf85a('0x2a'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xf85a('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0xf85a('0x6')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xf85a('0x6')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM'](_0xf85a('0x2b'),_0xf85a('0x2c'),_0xf85a('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf85a('0x6')]},'usereqphone':{'type':Sequelize[_0xf85a('0x8')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xf85a('0x6')]},'call_limit':{'type':Sequelize[_0xf85a('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xf85a('0x8')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xf85a('0x8')]('yes','no')},'vmexten':{'type':Sequelize[_0xf85a('0x6')]},'mohinterpret':{'type':Sequelize[_0xf85a('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xf85a('0x6')]},'description':{'type':Sequelize[_0xf85a('0x6')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0xf85a('0x2e')},'canreinvite':{'type':Sequelize['ENUM'](_0xf85a('0x17'),'no',_0xf85a('0x18'),_0xf85a('0x19'),_0xf85a('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf85a('0x6')]},'otherFields':{'type':Sequelize[_0xf85a('0x6')]},'active':{'type':Sequelize[_0xf85a('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf85a('0x6')],'defaultValue':'no'}}; \ No newline at end of file +var _0x8bdd=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER','originate','uac','uas','pai','fingerprint','certificate','active','actpass','nonat','BOOLEAN','sequelize','exports','name','ENUM','friend','user','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','getDataValue'];(function(_0xa1c7b9,_0x40664a){var _0x12dcf2=function(_0x8fd42e){while(--_0x8fd42e){_0xa1c7b9['push'](_0xa1c7b9['shift']());}};_0x12dcf2(++_0x40664a);}(_0x8bdd,0x1c5));var _0xd8bd=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8bdd[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xd8bd('0x0'));module[_0xd8bd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd8bd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x4'),_0xd8bd('0x5'),_0xd8bd('0x6')),'allowNull':![],'defaultValue':_0xd8bd('0x4')},'context':{'type':Sequelize[_0xd8bd('0x7')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xd8bd('0x3')]('ALLOWED_NOT_SCREENED',_0xd8bd('0x8'),'ALLOWED_FAILED_SCREEN',_0xd8bd('0x9'),_0xd8bd('0xa'),_0xd8bd('0xb'),'PROHIB_FAILED_SCREEN',_0xd8bd('0xc'))},'deny':{'type':Sequelize[_0xd8bd('0x7')]},'permit':{'type':Sequelize[_0xd8bd('0x7')]},'secret':{'type':Sequelize[_0xd8bd('0x7')]},'md5secret':{'type':Sequelize[_0xd8bd('0x7')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0xd8bd('0xd'),'set':function(_0x337a85){this['setDataValue'](_0xd8bd('0xe'),_0x337a85?_0x337a85[_0xd8bd('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xd8bd('0xe'))?this[_0xd8bd('0x10')]('transport')[_0xd8bd('0x11')](','):null;},'comment':_0xd8bd('0x12')},'dtmfmode':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x13'),_0xd8bd('0x14'),_0xd8bd('0x15'),_0xd8bd('0x16'),_0xd8bd('0x17')),'defaultValue':_0xd8bd('0x13')},'directmedia':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xd8bd('0x7')]},'nat':{'type':Sequelize[_0xd8bd('0x7')],'defaultValue':_0xd8bd('0x19'),'set':function(_0x3b08d7){this[_0xd8bd('0x1a')](_0xd8bd('0x1b'),_0x3b08d7?_0x3b08d7[_0xd8bd('0xf')](','):null);},'get':function(){return this[_0xd8bd('0x10')]('nat')?this[_0xd8bd('0x10')](_0xd8bd('0x1b'))[_0xd8bd('0x11')](','):null;},'comment':_0xd8bd('0x1c')},'callgroup':{'type':Sequelize[_0xd8bd('0x7')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xd8bd('0x7')]},'namedpickupgroup':{'type':Sequelize[_0xd8bd('0x7')]},'language':{'type':Sequelize[_0xd8bd('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd8bd('0x7')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd8bd('0x7')],'defaultValue':_0xd8bd('0x1d')},'allow':{'type':Sequelize[_0xd8bd('0x7')],'allowNull':![],'defaultValue':_0xd8bd('0x1e'),'set':function(_0x2e52af){this['setDataValue'](_0xd8bd('0x1f'),_0x2e52af?_0x2e52af['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xd8bd('0x10')](_0xd8bd('0x1f'))?this[_0xd8bd('0x10')]('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xd8bd('0x3')]('yes','no')},'insecure':{'type':Sequelize[_0xd8bd('0x7')],'defaultValue':'port,invite','set':function(_0xe621ae){this['setDataValue']('insecure',_0xe621ae?_0xe621ae[_0xd8bd('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xd8bd('0x20'))?this[_0xd8bd('0x10')]('insecure')['split'](','):null;},'comment':_0xd8bd('0x21')},'trustrpid':{'type':Sequelize[_0xd8bd('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no',_0xd8bd('0x22'))},'promiscredir':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xd8bd('0x7')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd8bd('0x23')},'amaflags':{'type':Sequelize[_0xd8bd('0x7')]},'callcounter':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no'),'defaultValue':_0xd8bd('0x18')},'busylevel':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xd8bd('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd8bd('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xd8bd('0x7')]},'template':{'type':Sequelize[_0xd8bd('0x7')]},'videosupport':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xd8bd('0x3')]('accept','refuse',_0xd8bd('0x25'))},'session_expires':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x26'),_0xd8bd('0x27')),'defaultValue':_0xd8bd('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0xd8bd('0x7')]},'regexten':{'type':Sequelize[_0xd8bd('0x7')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd8bd('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd8bd('0x18'),'no'),'defaultValue':_0xd8bd('0x18')},'keepalive':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xd8bd('0x7')]},'defaultuser':{'type':Sequelize[_0xd8bd('0x7')]},'rtptimeout':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no',_0xd8bd('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd8bd('0x7')]},'callbackextension':{'type':Sequelize[_0xd8bd('0x7')]},'timert1':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'timerb':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xd8bd('0x7')]},'contactacl':{'type':Sequelize[_0xd8bd('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0xd8bd('0x7')]},'use_q850_reason':{'type':Sequelize[_0xd8bd('0x7')]},'maxforwards':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xd8bd('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xd8bd('0x18'),'no')},'icesupport':{'type':Sequelize[_0xd8bd('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no',_0xd8bd('0x29'),_0xd8bd('0x2a'))},'dtlsrekey':{'type':Sequelize[_0xd8bd('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd8bd('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0xd8bd('0x7')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xd8bd('0x7')]},'dtlscapath':{'type':Sequelize[_0xd8bd('0x7')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd8bd('0x2b'),'passive',_0xd8bd('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xd8bd('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd8bd('0x7')]},'recordofffeature':{'type':Sequelize[_0xd8bd('0x7')]},'call_limit':{'type':Sequelize[_0xd8bd('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd8bd('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xd8bd('0x3')](_0xd8bd('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd8bd('0x7')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xd8bd('0x3')]('yes','no',_0xd8bd('0x2d'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd8bd('0x7')]},'otherFields':{'type':Sequelize[_0xd8bd('0x7')]},'active':{'type':Sequelize[_0xd8bd('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd8bd('0x7')],'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 6f73c49..175476a 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 _0x3e74=['map','Trunk','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','filter','merge','options','includeAll','include','findAll','params','clone','find','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','utf8','readFileSync','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','writeFileSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','Trunks','UserProfileResource','stack','name','send','index'];(function(_0x1b1631,_0x1b131b){var _0x322dfe=function(_0x435016){while(--_0x435016){_0x1b1631['push'](_0x1b1631['shift']());}};_0x322dfe(++_0x1b131b);}(_0x3e74,0x175));var _0x43e7=function(_0x557ebd,_0x158588){_0x557ebd=_0x557ebd-0x0;var _0x207904=_0x3e74[_0x557ebd];return _0x207904;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];var jayson=require(_0x43e7('0x15'));var client=jayson[_0x43e7('0x16')][_0x43e7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x4e008c,_0x583d85,_0x2fcb36,_0x21fdd3){return new BPromise(function(_0x44b0bd,_0x51b974){var _0x5e641c=_0x21fdd3||client;return _0x5e641c[_0x43e7('0x18')](_0x4e008c,_0x2fcb36)[_0x43e7('0x19')](function(_0x203378){logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,'request\x20sent');logger[_0x43e7('0x1b')](_0x43e7('0x1c'),_0x583d85,_0x43e7('0x1d'),JSON['stringify'](_0x203378));if(_0x203378['error']){if(_0x203378[_0x43e7('0x1e')][_0x43e7('0x1f')]===0x1f4){logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x51b974(_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);}logger[_0x43e7('0x1e')](_0x43e7('0x20'),_0x583d85,_0x203378[_0x43e7('0x1e')][_0x43e7('0x21')]);return _0x44b0bd(_0x203378['error'][_0x43e7('0x21')]);}else{logger[_0x43e7('0x1a')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x43e7('0x1d'));_0x44b0bd(_0x203378[_0x43e7('0x22')][_0x43e7('0x21')]);}})[_0x43e7('0x23')](function(_0x4077fb){logger[_0x43e7('0x1e')]('Trunk,\x20%s,\x20%s',_0x583d85,_0x4077fb);_0x51b974(_0x4077fb);});});}function respondWithStatusCode(_0x454359,_0x4eea52){_0x4eea52=_0x4eea52||0xcc;return function(_0x4c9df3){if(_0x4c9df3){return _0x454359[_0x43e7('0x24')](_0x4eea52);}return _0x454359[_0x43e7('0x25')](_0x4eea52)['end']();};}function respondWithResult(_0x1f0673,_0x4ca5cf){_0x4ca5cf=_0x4ca5cf||0xc8;return function(_0x326dab){if(_0x326dab){return _0x1f0673['status'](_0x4ca5cf)[_0x43e7('0x26')](_0x326dab);}};}function respondWithFilteredResult(_0x1b5f50,_0x20888b){return function(_0x405f85){if(_0x405f85){var _0x51f4d7=typeof _0x20888b['offset']===_0x43e7('0x27')&&typeof _0x20888b['limit']===_0x43e7('0x27');var _0x40dc8f=_0x405f85[_0x43e7('0x28')];var _0xb1fc63=_0x51f4d7?0x0:_0x20888b['offset'];var _0x33a1a5=_0x51f4d7?_0x405f85[_0x43e7('0x28')]:_0x20888b[_0x43e7('0x29')]+_0x20888b[_0x43e7('0x2a')];var _0x442c3b;if(_0x33a1a5>=_0x40dc8f){_0x33a1a5=_0x40dc8f;_0x442c3b=0xc8;}else{_0x442c3b=0xce;}_0x1b5f50[_0x43e7('0x25')](_0x442c3b);return _0x1b5f50[_0x43e7('0x2b')](_0x43e7('0x2c'),_0xb1fc63+'-'+_0x33a1a5+'/'+_0x40dc8f)[_0x43e7('0x26')](_0x405f85);}return null;};}function patchUpdates(_0x35dbcd){return function(_0x17df44){try{jsonpatch[_0x43e7('0x2d')](_0x17df44,_0x35dbcd,!![]);}catch(_0x2bde44){return BPromise[_0x43e7('0x2e')](_0x2bde44);}return _0x17df44['save']();};}function saveUpdates(_0x238321,_0x44f6b0){return function(_0x3b8f78){if(_0x3b8f78){return _0x3b8f78[_0x43e7('0x2f')](_0x238321)[_0x43e7('0x19')](function(_0x4c8650){return _0x4c8650;});}return null;};}function removeEntity(_0x1eba65,_0x49b83d){return function(_0x30d47e){if(_0x30d47e){return _0x30d47e[_0x43e7('0x30')]()['then'](function(){var _0x5a7342=_0x30d47e['get']({'plain':!![]});var _0xf8320=_0x43e7('0x31');return db[_0x43e7('0x32')][_0x43e7('0x30')]({'where':{'type':_0xf8320,'resourceId':_0x5a7342['id']}})[_0x43e7('0x19')](function(){return _0x30d47e;});})[_0x43e7('0x19')](function(){_0x1eba65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ac23d,_0x59e5b2){return function(_0x4e8e86){if(!_0x4e8e86){_0x4ac23d['sendStatus'](0x194);}return _0x4e8e86;};}function handleError(_0x5cb753,_0x14d888){_0x14d888=_0x14d888||0x1f4;return function(_0x49cda6){logger[_0x43e7('0x1e')](_0x49cda6[_0x43e7('0x33')]);if(_0x49cda6[_0x43e7('0x34')]){delete _0x49cda6[_0x43e7('0x34')];}_0x5cb753[_0x43e7('0x25')](_0x14d888)[_0x43e7('0x35')](_0x49cda6);};}exports[_0x43e7('0x36')]=function(_0x4f1a5f,_0x5332d9){var _0x5d84f4={},_0xfa0474={},_0xfe70e9={'count':0x0,'rows':[]};var _0x199ff6=_[_0x43e7('0x37')](db[_0x43e7('0x38')][_0x43e7('0x39')],function(_0x1d4589){return{'name':_0x1d4589[_0x43e7('0x3a')],'type':_0x1d4589['type'][_0x43e7('0x3b')]};});_0xfa0474[_0x43e7('0x3c')]=_['map'](_0x199ff6,_0x43e7('0x34'));_0xfa0474['query']=_[_0x43e7('0x3d')](_0x4f1a5f[_0x43e7('0x3e')]);_0xfa0474[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfa0474[_0x43e7('0x3c')],_0xfa0474[_0x43e7('0x3e')]);_0x5d84f4['attributes']=_['intersection'](_0xfa0474[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x41')]));_0x5d84f4[_0x43e7('0x42')]=_0x5d84f4['attributes'][_0x43e7('0x43')]?_0x5d84f4[_0x43e7('0x42')]:_0xfa0474['model'];if(!_0x4f1a5f[_0x43e7('0x3e')]['hasOwnProperty'](_0x43e7('0x44'))){_0x5d84f4['limit']=qs[_0x43e7('0x2a')](_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x2a')]);_0x5d84f4[_0x43e7('0x29')]=qs['offset'](_0x4f1a5f['query'][_0x43e7('0x29')]);}_0x5d84f4[_0x43e7('0x45')]=qs[_0x43e7('0x46')](_0x4f1a5f[_0x43e7('0x3e')]['sort']);_0x5d84f4['where']=qs['filters'](_[_0x43e7('0x47')](_0x4f1a5f['query'],_0xfa0474[_0x43e7('0x3f')]),_0x199ff6);if(_0x4f1a5f['query']['filter']){_0x5d84f4[_0x43e7('0x48')]=_['merge'](_0x5d84f4[_0x43e7('0x48')],{'$or':_[_0x43e7('0x37')](_0x199ff6,function(_0x257bd8){if(_0x257bd8[_0x43e7('0x49')]!=='VIRTUAL'){var _0x91f1e4={};_0x91f1e4[_0x257bd8[_0x43e7('0x34')]]={'$like':'%'+_0x4f1a5f[_0x43e7('0x3e')][_0x43e7('0x4a')]+'%'};return _0x91f1e4;}})});}_0x5d84f4=_[_0x43e7('0x4b')]({},_0x5d84f4,_0x4f1a5f[_0x43e7('0x4c')]);var _0x51eef4={'where':_0x5d84f4['where']};return db[_0x43e7('0x38')][_0x43e7('0x28')](_0x51eef4)[_0x43e7('0x19')](function(_0x4c00a8){_0xfe70e9['count']=_0x4c00a8;if(_0x4f1a5f['query'][_0x43e7('0x4d')]){_0x5d84f4[_0x43e7('0x4e')]=[{'all':!![]}];}return db['Trunk'][_0x43e7('0x4f')](_0x5d84f4);})[_0x43e7('0x19')](function(_0x3c96fe){_0xfe70e9['rows']=_0x3c96fe;return _0xfe70e9;})['then'](respondWithFilteredResult(_0x5332d9,_0x5d84f4))['catch'](handleError(_0x5332d9,null));};exports['show']=function(_0x214e7e,_0xe955fc){var _0x52fea5={'raw':![],'where':{'id':_0x214e7e[_0x43e7('0x50')]['id']}},_0x23e7cb={};_0x23e7cb[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0x23e7cb['query']=_['keys'](_0x214e7e[_0x43e7('0x3e')]);_0x23e7cb[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],_0x23e7cb[_0x43e7('0x3e')]);_0x52fea5[_0x43e7('0x42')]=_[_0x43e7('0x40')](_0x23e7cb[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x214e7e[_0x43e7('0x3e')]['fields']));_0x52fea5[_0x43e7('0x42')]=_0x52fea5[_0x43e7('0x42')]['length']?_0x52fea5[_0x43e7('0x42')]:_0x23e7cb['model'];if(_0x214e7e[_0x43e7('0x3e')][_0x43e7('0x4d')]){_0x52fea5[_0x43e7('0x4e')]=[{'all':!![]}];}_0x52fea5=_[_0x43e7('0x4b')]({},_0x52fea5,_0x214e7e[_0x43e7('0x4c')]);return db['Trunk']['find'](_0x52fea5)[_0x43e7('0x19')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x19')](respondWithResult(_0xe955fc,null))[_0x43e7('0x23')](handleError(_0xe955fc,null));};exports[_0x43e7('0x51')]=function(_0x23d835,_0x25bb44){var _0xa47464={'where':{'id':_0x23d835[_0x43e7('0x50')]['id']}},_0x44f8a0={};_0x44f8a0[_0x43e7('0x3c')]=_[_0x43e7('0x3d')](db['Trunk'][_0x43e7('0x39')]);_0xa47464[_0x43e7('0x42')]=_['intersection'](_0x44f8a0[_0x43e7('0x3c')],qs[_0x43e7('0x41')](_0x23d835[_0x43e7('0x3e')]['fields']));_0xa47464['attributes']=_0xa47464[_0x43e7('0x42')][_0x43e7('0x43')]?_0xa47464['attributes']:_0x44f8a0[_0x43e7('0x3c')];if(_0x23d835['query']['includeAll']){_0xa47464[_0x43e7('0x4e')]=[{'all':!![]}];}_0xa47464=_[_0x43e7('0x4b')]({},_0xa47464,_0x23d835[_0x43e7('0x4c')]);return db[_0x43e7('0x38')][_0x43e7('0x52')](_0xa47464)['then'](handleEntityNotFound(_0x25bb44,null))[_0x43e7('0x19')](function(_0xdb9fbe){if(_0xdb9fbe){var _0x4d89bd=_0xdb9fbe[_0x43e7('0x53')]({'plain':!![]});_0x4d89bd=qs[_0x43e7('0x54')](_0x4d89bd,['id',_0x43e7('0x55'),'updatedAt']);_0x23d835['body']=_['omit'](_0x23d835[_0x43e7('0x56')],['id',_0x43e7('0x55'),_0x43e7('0x57')]);return db[_0x43e7('0x38')]['create'](_['merge'](_0x4d89bd,_0x23d835[_0x43e7('0x56')]),{'include':_0x23d835[_0x43e7('0x3e')][_0x43e7('0x4d')]?[{'all':!![]}]:undefined})[_0x43e7('0x19')](function(_0x5ea0db){var _0x4438c0=_0x23d835[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x4438c0)throw new Error(_0x43e7('0x59'));if(_0x4438c0[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x4665db=_0x5ea0db[_0x43e7('0x53')]({'plain':!![]});var _0x406155=_0x43e7('0x31');return db[_0x43e7('0x5b')]['find']({'where':{'name':_0x406155,'userProfileId':_0x4438c0['userProfileId']},'raw':!![]})[_0x43e7('0x19')](function(_0x58a3a8){if(_0x58a3a8&&_0x58a3a8['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x5c')]({'name':_0x4665db[_0x43e7('0x34')],'resourceId':_0x4665db['id'],'type':_0x58a3a8['name'],'sectionId':_0x58a3a8['id']},{})[_0x43e7('0x19')](function(){return _0x5ea0db;});}else{return _0x5ea0db;}})[_0x43e7('0x23')](function(_0x1d8438){logger['error'](_0x43e7('0x5d'),_0x1d8438);throw _0x1d8438;});}return _0x5ea0db;});}})[_0x43e7('0x19')](respondWithResult(_0x25bb44,0xc9))[_0x43e7('0x23')](handleError(_0x25bb44,null));};exports[_0x43e7('0x5c')]=function(_0x2f43d7,_0x472a19,_0x1e02fa){var _0x515f01;return db[_0x43e7('0x38')][_0x43e7('0x5c')](_0x2f43d7[_0x43e7('0x56')],{'raw':!![]})['then'](function(_0x56b06d){_0x515f01=_0x56b06d;return db[_0x43e7('0x38')]['findAll']({'raw':!![]});})['then'](function(_0x1b793d){var _0x154e47=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x16499c=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x4e5956=ejs[_0x43e7('0x64')](_0x154e47,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x65'),_0x4e5956);if(_0x515f01[_0x43e7('0x66')]){var _0x37301b=ejs[_0x43e7('0x64')](_0x16499c,{'trunks':_0x1b793d||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x37301b);}})[_0x43e7('0x19')](function(){return respondWithRpcPromise(_0x43e7('0x68'),'create',{'module':_0x43e7('0x69')});})[_0x43e7('0x19')](function(){var _0x219dc6=_0x2f43d7[_0x43e7('0x58')][_0x43e7('0x53')]({'plain':!![]});if(!_0x219dc6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x219dc6[_0x43e7('0x5a')]===_0x43e7('0x58')){var _0x35d133=_0x515f01[_0x43e7('0x53')]({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x52')]({'where':{'name':_0x43e7('0x31'),'userProfileId':_0x219dc6['userProfileId']},'raw':!![]})['then'](function(_0x405faa){if(_0x405faa&&_0x405faa['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x35d133[_0x43e7('0x34')],'resourceId':_0x35d133['id'],'type':_0x405faa[_0x43e7('0x34')],'sectionId':_0x405faa['id']},{})[_0x43e7('0x19')](function(){return _0x515f01;});}else{return _0x515f01;}})[_0x43e7('0x23')](function(_0x18713b){logger[_0x43e7('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18713b);throw _0x18713b;});}return _0x515f01;})[_0x43e7('0x19')](respondWithResult(_0x472a19,0xc9))[_0x43e7('0x23')](handleError(_0x472a19,null));};exports[_0x43e7('0x2f')]=function(_0x5b4c76,_0x2abca0,_0xea84ec){var _0x184ae3;return db[_0x43e7('0x38')][_0x43e7('0x52')]({'where':{'id':_0x5b4c76[_0x43e7('0x50')]['id']}})[_0x43e7('0x19')](handleEntityNotFound(_0x2abca0,null))[_0x43e7('0x19')](saveUpdates(_0x5b4c76['body'],null))['then'](function(_0x55990c){if(_0x55990c){_0x184ae3=_0x55990c;return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});}})['then'](function(_0x3fe23f){if(_0x3fe23f){var _0x39a787=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x177a7a=fs[_0x43e7('0x62')](path['join'](config['root'],_0x43e7('0x63')),_0x43e7('0x61'));var _0x3b7e5b=ejs['render'](_0x39a787,{'trunks':_0x3fe23f||[]});fs[_0x43e7('0x6a')](_0x43e7('0x65'),_0x3b7e5b);var _0x401654=ejs[_0x43e7('0x64')](_0x177a7a,{'trunks':_0x3fe23f||[]});fs['writeFileSync'](_0x43e7('0x67'),_0x401654);return respondWithRpcPromise('Reload',_0x43e7('0x2f'),{'module':_0x43e7('0x69')});}return null;})[_0x43e7('0x19')](function(_0x90667c){if(_0x90667c){return _0x184ae3;}})[_0x43e7('0x19')](respondWithResult(_0x2abca0,null))[_0x43e7('0x23')](handleError(_0x2abca0,null));};exports[_0x43e7('0x30')]=function(_0x5e8d4e,_0x109c86,_0x40257e){var _0x1aea4e;return db[_0x43e7('0x38')]['find']({'where':{'id':_0x5e8d4e['params']['id']}})['then'](handleEntityNotFound(_0x109c86,null))[_0x43e7('0x19')](removeEntity(_0x109c86,null))['then'](function(){return db[_0x43e7('0x38')][_0x43e7('0x4f')]({'raw':!![]});})[_0x43e7('0x19')](function(_0x7387f6){var _0xa75254=fs[_0x43e7('0x62')](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x60')),_0x43e7('0x61'));var _0x3de22e=fs['readFileSync'](path[_0x43e7('0x5e')](config[_0x43e7('0x5f')],_0x43e7('0x63')),_0x43e7('0x61'));var _0x206e54=ejs['render'](_0xa75254,{'trunks':_0x7387f6});var _0x5e04ec=ejs[_0x43e7('0x64')](_0x3de22e,{'trunks':_0x7387f6});fs[_0x43e7('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x206e54);fs[_0x43e7('0x6a')](_0x43e7('0x67'),_0x5e04ec);return respondWithRpcPromise('Reload','destroy',{'module':_0x43e7('0x69')});})[_0x43e7('0x23')](handleError(_0x109c86,null));}; \ No newline at end of file +var _0xe5b3=['then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','request\x20sent','result','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','clone','find','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x40a76e,_0x294bfc){_0x40a76e=_0x40a76e-0x0;var _0xaa0197=_0xe5b3[_0x40a76e];return _0xaa0197;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e5b('0x0'));var zipdir=require(_0x3e5b('0x1'));var jsonpatch=require(_0x3e5b('0x2'));var rp=require(_0x3e5b('0x3'));var moment=require(_0x3e5b('0x4'));var BPromise=require(_0x3e5b('0x5'));var Mustache=require(_0x3e5b('0x6'));var util=require(_0x3e5b('0x7'));var path=require(_0x3e5b('0x8'));var sox=require(_0x3e5b('0x9'));var csv=require(_0x3e5b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e5b('0xb'));var _=require(_0x3e5b('0xc'));var squel=require('squel');var crypto=require(_0x3e5b('0xd'));var jsforce=require(_0x3e5b('0xe'));var deskjs=require(_0x3e5b('0xf'));var toCsv=require(_0x3e5b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x10'));var authService=require(_0x3e5b('0x11'));var qs=require(_0x3e5b('0x12'));var as=require(_0x3e5b('0x13'));var hardwareService=require(_0x3e5b('0x14'));var logger=require('../../config/logger')(_0x3e5b('0x15'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x16'));var licenseUtil=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];var jayson=require(_0x3e5b('0x19'));var client=jayson[_0x3e5b('0x1a')][_0x3e5b('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x405e70,_0x560010,_0x39a2a1,_0x5f2f9c){return new BPromise(function(_0x51a188,_0x4d71a3){var _0x3754e3=_0x5f2f9c||client;return _0x3754e3[_0x3e5b('0x1c')](_0x405e70,_0x39a2a1)[_0x3e5b('0x1d')](function(_0x4fb471){logger[_0x3e5b('0x1e')]('Trunk,\x20%s,\x20%s',_0x560010,'request\x20sent');logger[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x560010,'request\x20sent',JSON[_0x3e5b('0x21')](_0x4fb471));if(_0x4fb471[_0x3e5b('0x22')]){if(_0x4fb471['error'][_0x3e5b('0x23')]===0x1f4){logger[_0x3e5b('0x22')]('Trunk,\x20%s,\x20%s',_0x560010,_0x4fb471['error'][_0x3e5b('0x24')]);return _0x4d71a3(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);return _0x51a188(_0x4fb471[_0x3e5b('0x22')][_0x3e5b('0x24')]);}else{logger[_0x3e5b('0x1e')](_0x3e5b('0x25'),_0x560010,_0x3e5b('0x26'));_0x51a188(_0x4fb471[_0x3e5b('0x27')][_0x3e5b('0x24')]);}})['catch'](function(_0x433f9c){logger[_0x3e5b('0x22')](_0x3e5b('0x25'),_0x560010,_0x433f9c);_0x4d71a3(_0x433f9c);});});}function respondWithStatusCode(_0x150674,_0x50039b){_0x50039b=_0x50039b||0xcc;return function(_0x1eb80f){if(_0x1eb80f){return _0x150674['sendStatus'](_0x50039b);}return _0x150674[_0x3e5b('0x28')](_0x50039b)[_0x3e5b('0x29')]();};}function respondWithResult(_0x4d5e61,_0x41b684){_0x41b684=_0x41b684||0xc8;return function(_0x2f6368){if(_0x2f6368){return _0x4d5e61[_0x3e5b('0x28')](_0x41b684)[_0x3e5b('0x2a')](_0x2f6368);}};}function respondWithFilteredResult(_0x3bb749,_0x26c7f2){return function(_0x160e87){if(_0x160e87){var _0x2ddf57=typeof _0x26c7f2['offset']===_0x3e5b('0x2b')&&typeof _0x26c7f2['limit']===_0x3e5b('0x2b');var _0x4fd64b=_0x160e87[_0x3e5b('0x2c')];var _0x1f6473=_0x2ddf57?0x0:_0x26c7f2[_0x3e5b('0x2d')];var _0x475b39=_0x2ddf57?_0x160e87[_0x3e5b('0x2c')]:_0x26c7f2[_0x3e5b('0x2d')]+_0x26c7f2[_0x3e5b('0x2e')];var _0x9c2123;if(_0x475b39>=_0x4fd64b){_0x475b39=_0x4fd64b;_0x9c2123=0xc8;}else{_0x9c2123=0xce;}_0x3bb749[_0x3e5b('0x28')](_0x9c2123);return _0x3bb749[_0x3e5b('0x2f')](_0x3e5b('0x30'),_0x1f6473+'-'+_0x475b39+'/'+_0x4fd64b)['json'](_0x160e87);}return null;};}function patchUpdates(_0x21bc10){return function(_0x1882aa){try{jsonpatch[_0x3e5b('0x31')](_0x1882aa,_0x21bc10,!![]);}catch(_0x2a14eb){return BPromise[_0x3e5b('0x32')](_0x2a14eb);}return _0x1882aa[_0x3e5b('0x33')]();};}function saveUpdates(_0x345927,_0x4c4e01){return function(_0x33f089){if(_0x33f089){return _0x33f089['update'](_0x345927)['then'](function(_0x32c6b0){return _0x32c6b0;});}return null;};}function removeEntity(_0x78d68a,_0x51ea0d){return function(_0x40e37d){if(_0x40e37d){return _0x40e37d[_0x3e5b('0x34')]()[_0x3e5b('0x1d')](function(){var _0x33e356=_0x40e37d[_0x3e5b('0x35')]({'plain':!![]});var _0x26f842=_0x3e5b('0x36');return db[_0x3e5b('0x37')][_0x3e5b('0x34')]({'where':{'type':_0x26f842,'resourceId':_0x33e356['id']}})[_0x3e5b('0x1d')](function(){return _0x40e37d;});})[_0x3e5b('0x1d')](function(){_0x78d68a[_0x3e5b('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x141b7e,_0xec45c5){return function(_0x53caa2){if(!_0x53caa2){_0x141b7e['sendStatus'](0x194);}return _0x53caa2;};}function handleError(_0x471196,_0x56d7ef){_0x56d7ef=_0x56d7ef||0x1f4;return function(_0x2939da){logger[_0x3e5b('0x22')](_0x2939da[_0x3e5b('0x38')]);if(_0x2939da[_0x3e5b('0x39')]){delete _0x2939da['name'];}_0x471196[_0x3e5b('0x28')](_0x56d7ef)['send'](_0x2939da);};}exports[_0x3e5b('0x3a')]=function(_0x5ec841,_0x47f7c8){var _0x48f414={},_0x10c202={},_0x174ebf={'count':0x0,'rows':[]};var _0x2eaa30=_[_0x3e5b('0x3b')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')],function(_0x5466ac){return{'name':_0x5466ac['fieldName'],'type':_0x5466ac['type']['key']};});_0x10c202['model']=_['map'](_0x2eaa30,'name');_0x10c202[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x5ec841[_0x3e5b('0x3e')]);_0x10c202[_0x3e5b('0x40')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],_0x10c202[_0x3e5b('0x3e')]);_0x48f414[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x10c202[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x5ec841['query'][_0x3e5b('0x44')]));_0x48f414[_0x3e5b('0x43')]=_0x48f414[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x48f414[_0x3e5b('0x43')]:_0x10c202[_0x3e5b('0x42')];if(!_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x46')](_0x3e5b('0x47'))){_0x48f414[_0x3e5b('0x2e')]=qs[_0x3e5b('0x2e')](_0x5ec841['query']['limit']);_0x48f414['offset']=qs['offset'](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x2d')]);}_0x48f414[_0x3e5b('0x48')]=qs[_0x3e5b('0x49')](_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x49')]);_0x48f414[_0x3e5b('0x4a')]=qs[_0x3e5b('0x40')](_[_0x3e5b('0x4b')](_0x5ec841[_0x3e5b('0x3e')],_0x10c202['filters']),_0x2eaa30);if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x4c')]){_0x48f414[_0x3e5b('0x4a')]=_[_0x3e5b('0x4d')](_0x48f414[_0x3e5b('0x4a')],{'$or':_['map'](_0x2eaa30,function(_0x588ee7){if(_0x588ee7['type']!==_0x3e5b('0x4e')){var _0x20af6a={};_0x20af6a[_0x588ee7[_0x3e5b('0x39')]]={'$like':'%'+_0x5ec841['query']['filter']+'%'};return _0x20af6a;}})});}_0x48f414=_[_0x3e5b('0x4d')]({},_0x48f414,_0x5ec841[_0x3e5b('0x4f')]);var _0x123947={'where':_0x48f414['where']};return db['Trunk'][_0x3e5b('0x2c')](_0x123947)['then'](function(_0x14b62a){_0x174ebf[_0x3e5b('0x2c')]=_0x14b62a;if(_0x5ec841[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x48f414[_0x3e5b('0x51')]=[{'all':!![]}];}return db[_0x3e5b('0x3c')][_0x3e5b('0x52')](_0x48f414);})[_0x3e5b('0x1d')](function(_0x339852){_0x174ebf['rows']=_0x339852;return _0x174ebf;})[_0x3e5b('0x1d')](respondWithFilteredResult(_0x47f7c8,_0x48f414))['catch'](handleError(_0x47f7c8,null));};exports[_0x3e5b('0x53')]=function(_0x2e7047,_0x26e11e){var _0x3d51fa={'raw':![],'where':{'id':_0x2e7047[_0x3e5b('0x54')]['id']}},_0x291e4d={};_0x291e4d[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x291e4d[_0x3e5b('0x3e')]=_[_0x3e5b('0x3f')](_0x2e7047[_0x3e5b('0x3e')]);_0x291e4d['filters']=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],_0x291e4d[_0x3e5b('0x3e')]);_0x3d51fa[_0x3e5b('0x43')]=_[_0x3e5b('0x41')](_0x291e4d[_0x3e5b('0x42')],qs['fields'](_0x2e7047[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x3d51fa[_0x3e5b('0x43')]=_0x3d51fa[_0x3e5b('0x43')][_0x3e5b('0x45')]?_0x3d51fa[_0x3e5b('0x43')]:_0x291e4d[_0x3e5b('0x42')];if(_0x2e7047[_0x3e5b('0x3e')]['includeAll']){_0x3d51fa[_0x3e5b('0x51')]=[{'all':!![]}];}_0x3d51fa=_['merge']({},_0x3d51fa,_0x2e7047['options']);return db[_0x3e5b('0x3c')]['find'](_0x3d51fa)[_0x3e5b('0x1d')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x1d')](respondWithResult(_0x26e11e,null))[_0x3e5b('0x55')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x56')]=function(_0x4a492b,_0x5ddeee){var _0x545712={'where':{'id':_0x4a492b[_0x3e5b('0x54')]['id']}},_0x581b94={};_0x581b94[_0x3e5b('0x42')]=_[_0x3e5b('0x3f')](db[_0x3e5b('0x3c')][_0x3e5b('0x3d')]);_0x545712['attributes']=_['intersection'](_0x581b94[_0x3e5b('0x42')],qs[_0x3e5b('0x44')](_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x44')]));_0x545712[_0x3e5b('0x43')]=_0x545712['attributes']['length']?_0x545712['attributes']:_0x581b94['model'];if(_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]){_0x545712[_0x3e5b('0x51')]=[{'all':!![]}];}_0x545712=_[_0x3e5b('0x4d')]({},_0x545712,_0x4a492b[_0x3e5b('0x4f')]);return db[_0x3e5b('0x3c')][_0x3e5b('0x57')](_0x545712)[_0x3e5b('0x1d')](handleEntityNotFound(_0x5ddeee,null))['then'](function(_0x285db6){if(_0x285db6){var _0x29897b=_0x285db6[_0x3e5b('0x35')]({'plain':!![]});_0x29897b=qs[_0x3e5b('0x58')](_0x29897b,['id',_0x3e5b('0x59'),'updatedAt']);_0x4a492b[_0x3e5b('0x5a')]=_['omit'](_0x4a492b[_0x3e5b('0x5a')],['id',_0x3e5b('0x59'),'updatedAt']);return db['Trunk']['create'](_[_0x3e5b('0x4d')](_0x29897b,_0x4a492b['body']),{'include':_0x4a492b[_0x3e5b('0x3e')][_0x3e5b('0x50')]?[{'all':!![]}]:undefined})[_0x3e5b('0x1d')](function(_0x40197c){var _0x14f187=_0x4a492b['user']['get']({'plain':!![]});if(!_0x14f187)throw new Error(_0x3e5b('0x5b'));if(_0x14f187[_0x3e5b('0x5c')]===_0x3e5b('0x5d')){var _0x4dfb45=_0x40197c[_0x3e5b('0x35')]({'plain':!![]});var _0x3c5293=_0x3e5b('0x36');return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3c5293,'userProfileId':_0x14f187[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x4a1ce3){if(_0x4a1ce3&&_0x4a1ce3[_0x3e5b('0x60')]===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x4dfb45[_0x3e5b('0x39')],'resourceId':_0x4dfb45['id'],'type':_0x4a1ce3[_0x3e5b('0x39')],'sectionId':_0x4a1ce3['id']},{})[_0x3e5b('0x1d')](function(){return _0x40197c;});}else{return _0x40197c;}})[_0x3e5b('0x55')](function(_0x2411c3){logger[_0x3e5b('0x22')](_0x3e5b('0x62'),_0x2411c3);throw _0x2411c3;});}return _0x40197c;});}})['then'](respondWithResult(_0x5ddeee,0xc9))[_0x3e5b('0x55')](handleError(_0x5ddeee,null));};exports[_0x3e5b('0x61')]=function(_0x5af305,_0x177144,_0x31ef31){var _0x561c78;return db['Trunk']['create'](_0x5af305[_0x3e5b('0x5a')],{'raw':!![]})[_0x3e5b('0x1d')](function(_0x498e6d){_0x561c78=_0x498e6d;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});})['then'](function(_0x3d3bf2){var _0x17f60f=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0x410c7a=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x40103e=ejs[_0x3e5b('0x69')](_0x17f60f,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x40103e);if(_0x561c78['registry']){var _0x590f0c=ejs[_0x3e5b('0x69')](_0x410c7a,{'trunks':_0x3d3bf2||[]});fs[_0x3e5b('0x6a')]('/etc/asterisk/sip_xcally_registers.conf',_0x590f0c);}})[_0x3e5b('0x1d')](function(){return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x61'),{'module':_0x3e5b('0x6d')});})[_0x3e5b('0x1d')](function(){var _0x9deb09=_0x5af305[_0x3e5b('0x5d')]['get']({'plain':!![]});if(!_0x9deb09)throw new Error(_0x3e5b('0x5b'));if(_0x9deb09[_0x3e5b('0x5c')]==='user'){var _0x577747=_0x561c78['get']({'plain':!![]});return db[_0x3e5b('0x5e')][_0x3e5b('0x57')]({'where':{'name':_0x3e5b('0x36'),'userProfileId':_0x9deb09[_0x3e5b('0x5f')]},'raw':!![]})[_0x3e5b('0x1d')](function(_0x1ba550){if(_0x1ba550&&_0x1ba550['autoAssociation']===0x0){return db[_0x3e5b('0x37')][_0x3e5b('0x61')]({'name':_0x577747['name'],'resourceId':_0x577747['id'],'type':_0x1ba550[_0x3e5b('0x39')],'sectionId':_0x1ba550['id']},{})['then'](function(){return _0x561c78;});}else{return _0x561c78;}})['catch'](function(_0x211e73){logger[_0x3e5b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211e73);throw _0x211e73;});}return _0x561c78;})[_0x3e5b('0x1d')](respondWithResult(_0x177144,0xc9))[_0x3e5b('0x55')](handleError(_0x177144,null));};exports['update']=function(_0x2e36af,_0x185640,_0x14baa9){var _0x1425eb;return db[_0x3e5b('0x3c')][_0x3e5b('0x57')]({'where':{'id':_0x2e36af['params']['id']}})['then'](handleEntityNotFound(_0x185640,null))[_0x3e5b('0x1d')](saveUpdates(_0x2e36af['body'],null))['then'](function(_0x25d3d8){if(_0x25d3d8){_0x1425eb=_0x25d3d8;return db[_0x3e5b('0x3c')][_0x3e5b('0x52')]({'raw':!![]});}})['then'](function(_0x2e5fa3){if(_0x2e5fa3){var _0x4b8d19=fs[_0x3e5b('0x63')](path['join'](config[_0x3e5b('0x65')],_0x3e5b('0x66')),_0x3e5b('0x67'));var _0xdf2677=fs['readFileSync'](path[_0x3e5b('0x64')](config['root'],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x58ccf3=ejs[_0x3e5b('0x69')](_0x4b8d19,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x58ccf3);var _0x5ad011=ejs[_0x3e5b('0x69')](_0xdf2677,{'trunks':_0x2e5fa3||[]});fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5ad011);return respondWithRpcPromise('Reload',_0x3e5b('0x6f'),{'module':_0x3e5b('0x6d')});}return null;})['then'](function(_0xd9d941){if(_0xd9d941){return _0x1425eb;}})[_0x3e5b('0x1d')](respondWithResult(_0x185640,null))[_0x3e5b('0x55')](handleError(_0x185640,null));};exports['destroy']=function(_0x3b3306,_0x30e079,_0x352f7e){var _0x1d7c05;return db['Trunk'][_0x3e5b('0x57')]({'where':{'id':_0x3b3306['params']['id']}})[_0x3e5b('0x1d')](handleEntityNotFound(_0x30e079,null))['then'](removeEntity(_0x30e079,null))[_0x3e5b('0x1d')](function(){return db[_0x3e5b('0x3c')]['findAll']({'raw':!![]});})[_0x3e5b('0x1d')](function(_0x2299b9){var _0x56ff9d=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x66')),'utf8');var _0x53328b=fs[_0x3e5b('0x63')](path[_0x3e5b('0x64')](config[_0x3e5b('0x65')],_0x3e5b('0x68')),_0x3e5b('0x67'));var _0x3d1193=ejs['render'](_0x56ff9d,{'trunks':_0x2299b9});var _0x5d6aae=ejs[_0x3e5b('0x69')](_0x53328b,{'trunks':_0x2299b9});fs[_0x3e5b('0x6a')](_0x3e5b('0x6b'),_0x3d1193);fs[_0x3e5b('0x6a')](_0x3e5b('0x6e'),_0x5d6aae);return respondWithRpcPromise(_0x3e5b('0x6c'),_0x3e5b('0x34'),{'module':_0x3e5b('0x6d')});})['catch'](handleError(_0x30e079,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 4e7f9e0..77e7885 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 _0xe9b4=['exports','define','Trunk','lodash','rimraf','../../config/environment','./trunk.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe9b4,0x176));var _0x4e9b=function(_0x533064,_0x84cbbd){_0x533064=_0x533064-0x0;var _0xa16d1a=_0xe9b4[_0x533064];return _0xa16d1a;};'use strict';var _=require(_0x4e9b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4e9b('0x1'));var config=require(_0x4e9b('0x2'));var attributes=require(_0x4e9b('0x3'));module[_0x4e9b('0x4')]=function(_0x3c2458,_0x5ac27a){return _0x3c2458[_0x4e9b('0x5')](_0x4e9b('0x6'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2623=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x2623,0x79));var _0x3262=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0x2623[_0xf2f332];return _0x56cce3;};'use strict';var _=require(_0x3262('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3262('0x1'));var moment=require(_0x3262('0x2'));var BPromise=require(_0x3262('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3262('0x4'));var rimraf=require(_0x3262('0x5'));var config=require(_0x3262('0x6'));var attributes=require(_0x3262('0x7'));module[_0x3262('0x8')]=function(_0x2d3958,_0x5a28b1){return _0x2d3958[_0x3262('0x9')](_0x3262('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 3faaefc..c945bcc 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 _0x40b9=['code','Trunk,\x20%s,\x20%s','message','result','Trunk','options','raw','where','attributes','map','include','model','GetTrunk','catch','ShowTrunk','find','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x311e41,_0x526808){var _0x4e2ad0=function(_0x3797e3){while(--_0x3797e3){_0x311e41['push'](_0x311e41['shift']());}};_0x4e2ad0(++_0x526808);}(_0x40b9,0x1de));var _0x940b=function(_0x35e675,_0x3516d3){_0x35e675=_0x35e675-0x0;var _0x27d04a=_0x40b9[_0x35e675];return _0x27d04a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x940b('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x940b('0x1'))['db'];var utils=require(_0x940b('0x2'));var logger=require(_0x940b('0x3'))(_0x940b('0x4'));var config=require(_0x940b('0x5'));var jayson=require(_0x940b('0x6'));var client=jayson[_0x940b('0x7')][_0x940b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbe9eed,_0x5449ae,_0x5d2222){return new BPromise(function(_0x5d3135,_0x561617){return client[_0x940b('0x9')](_0xbe9eed,_0x5d2222)[_0x940b('0xa')](function(_0x2d8f4c){logger[_0x940b('0xb')]('Trunk,\x20%s,\x20%s',_0x5449ae,_0x940b('0xc'));logger[_0x940b('0xd')](_0x940b('0xe'),_0x5449ae,_0x940b('0xc'),JSON[_0x940b('0xf')](_0x2d8f4c));if(_0x2d8f4c[_0x940b('0x10')]){if(_0x2d8f4c[_0x940b('0x10')][_0x940b('0x11')]===0x1f4){logger[_0x940b('0x10')](_0x940b('0x12'),_0x5449ae,_0x2d8f4c[_0x940b('0x10')][_0x940b('0x13')]);return _0x561617(_0x2d8f4c[_0x940b('0x10')][_0x940b('0x13')]);}logger['error'](_0x940b('0x12'),_0x5449ae,_0x2d8f4c['error'][_0x940b('0x13')]);return _0x5d3135(_0x2d8f4c[_0x940b('0x10')][_0x940b('0x13')]);}else{logger[_0x940b('0xb')]('Trunk,\x20%s,\x20%s',_0x5449ae,'request\x20sent');_0x5d3135(_0x2d8f4c[_0x940b('0x14')][_0x940b('0x13')]);}})['catch'](function(_0x3d8b26){logger[_0x940b('0x10')](_0x940b('0x12'),_0x5449ae,_0x3d8b26);_0x561617(_0x3d8b26);});});}exports['GetTrunk']=function(_0x3df7ed){var _0x9823d9=this;return new Promise(function(_0x438f1d,_0x56adda){return db[_0x940b('0x15')]['findAll']({'raw':_0x3df7ed['options']?_0x3df7ed[_0x940b('0x16')][_0x940b('0x17')]===undefined?!![]:![]:!![],'where':_0x3df7ed[_0x940b('0x16')]?_0x3df7ed[_0x940b('0x16')][_0x940b('0x18')]||null:null,'attributes':_0x3df7ed[_0x940b('0x16')]?_0x3df7ed[_0x940b('0x16')][_0x940b('0x19')]||null:null,'limit':_0x3df7ed['options']?_0x3df7ed[_0x940b('0x16')]['limit']||null:null,'include':_0x3df7ed[_0x940b('0x16')]?_0x3df7ed[_0x940b('0x16')]['include']?_[_0x940b('0x1a')](_0x3df7ed[_0x940b('0x16')][_0x940b('0x1b')],function(_0xe6d552){return{'model':db[_0xe6d552[_0x940b('0x1c')]],'as':_0xe6d552['as'],'attributes':_0xe6d552['attributes'],'include':_0xe6d552[_0x940b('0x1b')]?_['map'](_0xe6d552[_0x940b('0x1b')],function(_0x1d7c54){return{'model':db[_0x1d7c54[_0x940b('0x1c')]],'as':_0x1d7c54['as'],'attributes':_0x1d7c54[_0x940b('0x19')],'include':_0x1d7c54[_0x940b('0x1b')]?_[_0x940b('0x1a')](_0x1d7c54[_0x940b('0x1b')],function(_0x19e948){return{'model':db[_0x19e948[_0x940b('0x1c')]],'as':_0x19e948['as'],'attributes':_0x19e948[_0x940b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x136483){logger[_0x940b('0xb')](_0x940b('0x1d'),_0x3df7ed);logger[_0x940b('0xd')]('GetTrunk',_0x3df7ed,JSON['stringify'](_0x136483));_0x438f1d(_0x136483);})[_0x940b('0x1e')](function(_0x319669){logger[_0x940b('0x10')]('GetTrunk',_0x319669[_0x940b('0x13')],_0x3df7ed);_0x56adda(_0x9823d9[_0x940b('0x10')](0x1f4,_0x319669[_0x940b('0x13')]));});});};exports[_0x940b('0x1f')]=function(_0xf19855){var _0x550517=this;return new Promise(function(_0x5ed70f,_0x27a6b4){return db[_0x940b('0x15')][_0x940b('0x20')]({'raw':_0xf19855['options']?_0xf19855[_0x940b('0x16')][_0x940b('0x17')]===undefined?!![]:![]:!![],'where':_0xf19855[_0x940b('0x16')]?_0xf19855[_0x940b('0x16')][_0x940b('0x18')]||null:null,'attributes':_0xf19855[_0x940b('0x16')]?_0xf19855[_0x940b('0x16')][_0x940b('0x19')]||null:null,'include':_0xf19855[_0x940b('0x16')]?_0xf19855['options'][_0x940b('0x1b')]?_[_0x940b('0x1a')](_0xf19855['options'][_0x940b('0x1b')],function(_0x9b1236){return{'model':db[_0x9b1236[_0x940b('0x1c')]],'as':_0x9b1236['as'],'attributes':_0x9b1236[_0x940b('0x19')],'include':_0x9b1236[_0x940b('0x1b')]?_['map'](_0x9b1236['include'],function(_0x10cc2f){return{'model':db[_0x10cc2f['model']],'as':_0x10cc2f['as'],'attributes':_0x10cc2f['attributes'],'include':_0x10cc2f[_0x940b('0x1b')]?_[_0x940b('0x1a')](_0x10cc2f['include'],function(_0x4088e6){return{'model':db[_0x4088e6[_0x940b('0x1c')]],'as':_0x4088e6['as'],'attributes':_0x4088e6['attributes']};}):[]};}):[]};}):[]:[]})[_0x940b('0xa')](function(_0x4f0ffa){logger['info']('ShowTrunk',_0xf19855);logger[_0x940b('0xd')](_0x940b('0x1f'),_0xf19855,JSON[_0x940b('0xf')](_0x4f0ffa));_0x5ed70f(_0x4f0ffa);})[_0x940b('0x1e')](function(_0x518b7d){logger[_0x940b('0x10')](_0x940b('0x1f'),_0x518b7d[_0x940b('0x13')],_0xf19855);_0x27a6b4(_0x550517[_0x940b('0x10')](0x1f4,_0x518b7d['message']));});});}; \ No newline at end of file +var _0xf3e0=['then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','attributes','limit','map','include','model','catch','ShowTrunk','where','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xf3e0,0xa0));var _0x0f3e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xf3e0[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0x0f3e('0x0'));var util=require('util');var moment=require(_0x0f3e('0x1'));var BPromise=require(_0x0f3e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f3e('0x3'))['db'];var utils=require(_0x0f3e('0x4'));var logger=require(_0x0f3e('0x5'))(_0x0f3e('0x6'));var config=require(_0x0f3e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0f3e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b1a49,_0x3373f9,_0x41d652){return new BPromise(function(_0x35071a,_0x3f28d5){return client[_0x0f3e('0x9')](_0x3b1a49,_0x41d652)[_0x0f3e('0xa')](function(_0x17a9e4){logger[_0x0f3e('0xb')](_0x0f3e('0xc'),_0x3373f9,'request\x20sent');logger[_0x0f3e('0xd')](_0x0f3e('0xe'),_0x3373f9,_0x0f3e('0xf'),JSON[_0x0f3e('0x10')](_0x17a9e4));if(_0x17a9e4[_0x0f3e('0x11')]){if(_0x17a9e4[_0x0f3e('0x11')][_0x0f3e('0x12')]===0x1f4){logger[_0x0f3e('0x11')](_0x0f3e('0xc'),_0x3373f9,_0x17a9e4['error'][_0x0f3e('0x13')]);return _0x3f28d5(_0x17a9e4['error'][_0x0f3e('0x13')]);}logger[_0x0f3e('0x11')](_0x0f3e('0xc'),_0x3373f9,_0x17a9e4[_0x0f3e('0x11')][_0x0f3e('0x13')]);return _0x35071a(_0x17a9e4[_0x0f3e('0x11')][_0x0f3e('0x13')]);}else{logger[_0x0f3e('0xb')](_0x0f3e('0xc'),_0x3373f9,_0x0f3e('0xf'));_0x35071a(_0x17a9e4[_0x0f3e('0x14')][_0x0f3e('0x13')]);}})['catch'](function(_0x2687a0){logger[_0x0f3e('0x11')]('Trunk,\x20%s,\x20%s',_0x3373f9,_0x2687a0);_0x3f28d5(_0x2687a0);});});}exports[_0x0f3e('0x15')]=function(_0x5c204b){var _0x5e1903=this;return new Promise(function(_0x46f7ec,_0x5304f5){return db[_0x0f3e('0x16')][_0x0f3e('0x17')]({'raw':_0x5c204b['options']?_0x5c204b[_0x0f3e('0x18')][_0x0f3e('0x19')]===undefined?!![]:![]:!![],'where':_0x5c204b['options']?_0x5c204b[_0x0f3e('0x18')]['where']||null:null,'attributes':_0x5c204b['options']?_0x5c204b[_0x0f3e('0x18')][_0x0f3e('0x1a')]||null:null,'limit':_0x5c204b[_0x0f3e('0x18')]?_0x5c204b['options'][_0x0f3e('0x1b')]||null:null,'include':_0x5c204b['options']?_0x5c204b[_0x0f3e('0x18')]['include']?_[_0x0f3e('0x1c')](_0x5c204b['options']['include'],function(_0x161b54){return{'model':db[_0x161b54['model']],'as':_0x161b54['as'],'attributes':_0x161b54[_0x0f3e('0x1a')],'include':_0x161b54[_0x0f3e('0x1d')]?_['map'](_0x161b54[_0x0f3e('0x1d')],function(_0x8b01a2){return{'model':db[_0x8b01a2[_0x0f3e('0x1e')]],'as':_0x8b01a2['as'],'attributes':_0x8b01a2[_0x0f3e('0x1a')],'include':_0x8b01a2[_0x0f3e('0x1d')]?_['map'](_0x8b01a2[_0x0f3e('0x1d')],function(_0x14a158){return{'model':db[_0x14a158[_0x0f3e('0x1e')]],'as':_0x14a158['as'],'attributes':_0x14a158[_0x0f3e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f3e('0xa')](function(_0x1d190f){logger[_0x0f3e('0xb')]('GetTrunk',_0x5c204b);logger[_0x0f3e('0xd')](_0x0f3e('0x15'),_0x5c204b,JSON[_0x0f3e('0x10')](_0x1d190f));_0x46f7ec(_0x1d190f);})[_0x0f3e('0x1f')](function(_0x14ec26){logger['error'](_0x0f3e('0x15'),_0x14ec26[_0x0f3e('0x13')],_0x5c204b);_0x5304f5(_0x5e1903[_0x0f3e('0x11')](0x1f4,_0x14ec26['message']));});});};exports[_0x0f3e('0x20')]=function(_0x43f427){var _0x4a5202=this;return new Promise(function(_0x4368f1,_0x3afa3b){return db[_0x0f3e('0x16')]['find']({'raw':_0x43f427[_0x0f3e('0x18')]?_0x43f427[_0x0f3e('0x18')][_0x0f3e('0x19')]===undefined?!![]:![]:!![],'where':_0x43f427[_0x0f3e('0x18')]?_0x43f427[_0x0f3e('0x18')][_0x0f3e('0x21')]||null:null,'attributes':_0x43f427['options']?_0x43f427['options']['attributes']||null:null,'include':_0x43f427[_0x0f3e('0x18')]?_0x43f427[_0x0f3e('0x18')]['include']?_[_0x0f3e('0x1c')](_0x43f427['options']['include'],function(_0x3e1981){return{'model':db[_0x3e1981[_0x0f3e('0x1e')]],'as':_0x3e1981['as'],'attributes':_0x3e1981['attributes'],'include':_0x3e1981['include']?_['map'](_0x3e1981[_0x0f3e('0x1d')],function(_0x3d8c79){return{'model':db[_0x3d8c79[_0x0f3e('0x1e')]],'as':_0x3d8c79['as'],'attributes':_0x3d8c79['attributes'],'include':_0x3d8c79[_0x0f3e('0x1d')]?_[_0x0f3e('0x1c')](_0x3d8c79['include'],function(_0x521e01){return{'model':db[_0x521e01[_0x0f3e('0x1e')]],'as':_0x521e01['as'],'attributes':_0x521e01[_0x0f3e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f3e('0xa')](function(_0xf205ac){logger[_0x0f3e('0xb')](_0x0f3e('0x20'),_0x43f427);logger[_0x0f3e('0xd')](_0x0f3e('0x20'),_0x43f427,JSON['stringify'](_0xf205ac));_0x4368f1(_0xf205ac);})[_0x0f3e('0x1f')](function(_0x3fc5fc){logger['error'](_0x0f3e('0x20'),_0x3fc5fc[_0x0f3e('0x13')],_0x43f427);_0x3afa3b(_0x4a5202[_0x0f3e('0x11')](0x1f4,_0x3fc5fc[_0x0f3e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 09ce408..b4f982d 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 _0x056c=['/:id','isAuthenticated','update','exports','express','./user-setting.controller','put'];(function(_0x48a21a,_0x37e824){var _0x31a500=function(_0x51493c){while(--_0x51493c){_0x48a21a['push'](_0x48a21a['shift']());}};_0x31a500(++_0x37e824);}(_0x056c,0x169));var _0xc056=function(_0x4b4517,_0x5dbf6a){_0x4b4517=_0x4b4517-0x0;var _0x48278b=_0x056c[_0x4b4517];return _0x48278b;};'use strict';var express=require(_0xc056('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xc056('0x1'));router[_0xc056('0x2')](_0xc056('0x3'),auth[_0xc056('0x4')](),controller[_0xc056('0x5')]);module[_0xc056('0x6')]=router; \ No newline at end of file +var _0x7f21=['put','/:id','exports','./user-setting.controller'];(function(_0x31d523,_0x4daab4){var _0x25bd95=function(_0x343642){while(--_0x343642){_0x31d523['push'](_0x31d523['shift']());}};_0x25bd95(++_0x4daab4);}(_0x7f21,0x17b));var _0x17f2=function(_0x116c2d,_0x161055){_0x116c2d=_0x116c2d-0x0;var _0x2d8eea=_0x7f21[_0x116c2d];return _0x2d8eea;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x17f2('0x0'));router[_0x17f2('0x1')](_0x17f2('0x2'),auth['isAuthenticated'](),controller['update']);module[_0x17f2('0x3')]=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 62ea4e9..8530f5a 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 _0x3167=['error','warning','info','ENUM','TEXT','sequelize'];(function(_0x4660ba,_0x4a2d0d){var _0x496378=function(_0x285336){while(--_0x285336){_0x4660ba['push'](_0x4660ba['shift']());}};_0x496378(++_0x4a2d0d);}(_0x3167,0x71));var _0x7316=function(_0x51f84a,_0x445f17){_0x51f84a=_0x51f84a-0x0;var _0x4ba63d=_0x3167[_0x51f84a];return _0x4ba63d;};'use strict';var Sequelize=require(_0x7316('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x7316('0x1'),_0x7316('0x2'),_0x7316('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize[_0x7316('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x7316('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x7316('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':'UserId'}}; \ No newline at end of file +var _0x4cf5=['debug','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','warning','info'];(function(_0x7abdba,_0x3aac45){var _0x46b521=function(_0x4d79bc){while(--_0x4d79bc){_0x7abdba['push'](_0x7abdba['shift']());}};_0x46b521(++_0x3aac45);}(_0x4cf5,0x188));var _0x54cf=function(_0x463c38,_0x562392){_0x463c38=_0x463c38-0x0;var _0x17304f=_0x4cf5[_0x463c38];return _0x17304f;};'use strict';var Sequelize=require(_0x54cf('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x54cf('0x1'),_0x54cf('0x2'),_0x54cf('0x3'),_0x54cf('0x4')];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x54cf('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x54cf('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x54cf('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x54cf('0x7')],'unique':_0x54cf('0x8')}}; \ 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 273da33..5ed6a3e 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 _0xe79a=['socket.io-emitter','redis','register','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','update','role','admin','Unauthorized','params','find','catch','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe79a,0x70));var _0xae79=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0xe79a[_0x5e6116];return _0x29bf86;};'use strict';var _=require('lodash');var Redis=require('ioredis');var logger=require(_0xae79('0x0'))('api');var config=require(_0xae79('0x1'));var db=require(_0xae79('0x2'))['db'];var socket=require(_0xae79('0x3'))(new Redis(config[_0xae79('0x4')]));require('./user-setting.socket')[_0xae79('0x5')](socket);config[_0xae79('0x4')]=_[_0xae79('0x6')](config['redis'],{'host':_0xae79('0x7'),'port':0x18eb});function respondWithResult(_0x3a92bf,_0x51c226){_0x51c226=_0x51c226||0xc8;return function(_0x54e61d){if(_0x54e61d){return _0x3a92bf[_0xae79('0x8')](_0x51c226)[_0xae79('0x9')](_0x54e61d);}};}function saveUpdates(_0x497fff){return function(_0x4043ff){if(_0x4043ff){return _0x4043ff['update'](_0x497fff)[_0xae79('0xa')](function(_0x5dce36){return _0x5dce36;});}return null;};}function handleEntityNotFound(_0x4f4678){return function(_0x8c0bf9){if(!_0x8c0bf9){_0x4f4678[_0xae79('0xb')](0x194);}return _0x8c0bf9;};}function handleError(_0x117557,_0x5ac6ad){_0x5ac6ad=_0x5ac6ad||0x1f4;return function(_0x29a184){logger[_0xae79('0xc')](_0x29a184[_0xae79('0xd')]);if(_0x29a184[_0xae79('0xe')]){delete _0x29a184[_0xae79('0xe')];}_0x117557[_0xae79('0x8')](_0x5ac6ad)[_0xae79('0xf')](_0x29a184);};}exports[_0xae79('0x10')]=function(_0x15ed35,_0x471fbf){if(_0x15ed35['user'][_0xae79('0x11')]!==_0xae79('0x12'))throw new Error(_0xae79('0x13'));if(isNaN(Number(_0x15ed35[_0xae79('0x14')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db['UserSetting'][_0xae79('0x15')]({'where':{'id':_0x15ed35[_0xae79('0x14')]['id']}})['then'](handleEntityNotFound(_0x471fbf,null))[_0xae79('0xa')](saveUpdates(_0x15ed35['body'],null))[_0xae79('0xa')](respondWithResult(_0x471fbf,null))[_0xae79('0x16')](handleError(_0x471fbf,null));}; \ No newline at end of file +var _0xf53f=['register','defaults','status','json','update','sendStatus','error','stack','name','send','params','Invalid\x20user\x20setting\x20id','UserSetting','body','then','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket'];(function(_0x2b9d8f,_0x487185){var _0x40c4d5=function(_0x40036e){while(--_0x40036e){_0x2b9d8f['push'](_0x2b9d8f['shift']());}};_0x40c4d5(++_0x487185);}(_0xf53f,0x8d));var _0xff53=function(_0x1c0bc6,_0x42e1be){_0x1c0bc6=_0x1c0bc6-0x0;var _0x3b0734=_0xf53f[_0x1c0bc6];return _0x3b0734;};'use strict';var _=require(_0xff53('0x0'));var Redis=require(_0xff53('0x1'));var logger=require(_0xff53('0x2'))(_0xff53('0x3'));var config=require(_0xff53('0x4'));var db=require(_0xff53('0x5'))['db'];var socket=require(_0xff53('0x6'))(new Redis(config[_0xff53('0x7')]));require(_0xff53('0x8'))[_0xff53('0x9')](socket);config[_0xff53('0x7')]=_[_0xff53('0xa')](config['redis'],{'host':'localhost','port':0x18eb});function respondWithResult(_0x27b397,_0x5751e7){_0x5751e7=_0x5751e7||0xc8;return function(_0x1c27bb){if(_0x1c27bb){return _0x27b397[_0xff53('0xb')](_0x5751e7)[_0xff53('0xc')](_0x1c27bb);}};}function saveUpdates(_0x5d149e){return function(_0x51445a){if(_0x51445a){return _0x51445a[_0xff53('0xd')](_0x5d149e)['then'](function(_0x130576){return _0x130576;});}return null;};}function handleEntityNotFound(_0xecf2a7){return function(_0x511667){if(!_0x511667){_0xecf2a7[_0xff53('0xe')](0x194);}return _0x511667;};}function handleError(_0x14f3ac,_0x4c8069){_0x4c8069=_0x4c8069||0x1f4;return function(_0x2225b0){logger[_0xff53('0xf')](_0x2225b0[_0xff53('0x10')]);if(_0x2225b0['name']){delete _0x2225b0[_0xff53('0x11')];}_0x14f3ac[_0xff53('0xb')](_0x4c8069)[_0xff53('0x12')](_0x2225b0);};}exports['update']=function(_0x121852,_0x14aeb7){if(_0x121852['user']['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x121852[_0xff53('0x13')]['id'])))throw new Error(_0xff53('0x14'));return db[_0xff53('0x15')]['find']({'where':{'id':_0x121852[_0xff53('0x13')]['id']}})['then'](handleEntityNotFound(_0x14aeb7,null))['then'](saveUpdates(_0x121852[_0xff53('0x16')],null))[_0xff53('0x17')](respondWithResult(_0x14aeb7,null))[_0xff53('0x18')](handleError(_0x14aeb7,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 d679d3b..b4e0c7a 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 _0xf35e=['../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xd074a2,_0x3c1867){var _0x1bea99=function(_0x5f41c2){while(--_0x5f41c2){_0xd074a2['push'](_0xd074a2['shift']());}};_0x1bea99(++_0x3c1867);}(_0xf35e,0x1c2));var _0xef35=function(_0x40ed5b,_0x295ae0){_0x40ed5b=_0x40ed5b-0x0;var _0x1e2014=_0xf35e[_0x40ed5b];return _0x1e2014;};'use strict';var EventEmitter=require(_0xef35('0x0'));var UserSetting=require(_0xef35('0x1'))['db'][_0xef35('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xef35('0x3')](0x0);var events={'afterCreate':_0xef35('0x4'),'afterUpdate':_0xef35('0x5'),'afterDestroy':_0xef35('0x6')};function emitEvent(_0x31e103){return function(_0x2f05b6,_0x55e156,_0x108603){UserSettingEvents[_0xef35('0x7')](_0x31e103+':'+_0x2f05b6['id'],_0x2f05b6);UserSettingEvents['emit'](_0x31e103,_0x2f05b6);_0x108603(null);};}for(var e in events){if(events[_0xef35('0x8')](e)){var event=events[e];UserSetting[_0xef35('0x9')](e,emitEvent(event));}}module[_0xef35('0xa')]=UserSettingEvents; \ No newline at end of file +var _0xe963=['emit','hasOwnProperty','save','update','remove'];(function(_0xdf9539,_0x28eb9a){var _0x5b79ed=function(_0x321874){while(--_0x321874){_0xdf9539['push'](_0xdf9539['shift']());}};_0x5b79ed(++_0x28eb9a);}(_0xe963,0x1c9));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3e96('0x0'),'afterUpdate':_0x3e96('0x1'),'afterDestroy':_0x3e96('0x2')};function emitEvent(_0x31b043){return function(_0x43e3af,_0xb3e351,_0x27f0b8){UserSettingEvents[_0x3e96('0x3')](_0x31b043+':'+_0x43e3af['id'],_0x43e3af);UserSettingEvents[_0x3e96('0x3')](_0x31b043,_0x43e3af);_0x27f0b8(null);};}for(var e in events){if(events[_0x3e96('0x4')](e)){var event=events[e];UserSetting['hook'](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 2fef7f7..0cd8531 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 _0x6075=['define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x6075,0x142));var _0x5607=function(_0x737187,_0x32acb1){_0x737187=_0x737187-0x0;var _0x5d1e92=_0x6075[_0x737187];return _0x5d1e92;};'use strict';var attributes=require(_0x5607('0x0'));module[_0x5607('0x1')]=function(_0x491939){return _0x491939[_0x5607('0x2')](_0x5607('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48cde9){if(!_0x48cde9[_0x5607('0x4')])_0x48cde9['clientSideLoggingEnabledSince']=null;else if(_0x48cde9['clientSideLoggingEnabledSince']===null)_0x48cde9[_0x5607('0x5')]=new Date();}}});}; \ No newline at end of file +var _0x91a7=['clientSideLoggingEnabledSince','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x33521,_0x5a6aeb){var _0x32403b=function(_0x159ebf){while(--_0x159ebf){_0x33521['push'](_0x33521['shift']());}};_0x32403b(++_0x5a6aeb);}(_0x91a7,0xe7));var _0x791a=function(_0x37ba5f,_0x20e99c){_0x37ba5f=_0x37ba5f-0x0;var _0x3bcce6=_0x91a7[_0x37ba5f];return _0x3bcce6;};'use strict';var attributes=require('./user-setting.attributes');module[_0x791a('0x0')]=function(_0x3d6eab){return _0x3d6eab[_0x791a('0x1')]('UserSetting',attributes,{'tableName':_0x791a('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b6f78){if(!_0x5b6f78[_0x791a('0x3')])_0x5b6f78['clientSideLoggingEnabledSince']=null;else if(_0x5b6f78['clientSideLoggingEnabledSince']===null)_0x5b6f78[_0x791a('0x4')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index e1b97e1..c3eb77b 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 _0x4b38=['user-setting:update','UserId','register','user-setting:','./user-setting.events','save','remove','update','emit'];(function(_0x5e1569,_0xe2fa7b){var _0x14f6c0=function(_0x30a9da){while(--_0x30a9da){_0x5e1569['push'](_0x5e1569['shift']());}};_0x14f6c0(++_0xe2fa7b);}(_0x4b38,0x11b));var _0x84b3=function(_0x4c4e43,_0x228602){_0x4c4e43=_0x4c4e43-0x0;var _0x1ceba9=_0x4b38[_0x4c4e43];return _0x1ceba9;};'use strict';var UserSettingEvents=require(_0x84b3('0x0'));var events=[_0x84b3('0x1'),_0x84b3('0x2'),_0x84b3('0x3')];function createListener(_0x5781ea,_0x32c978){return function(_0x30b4c1){_0x32c978[_0x84b3('0x4')](_0x5781ea,_0x30b4c1);if(_0x5781ea===_0x84b3('0x5')){_0x32c978[_0x84b3('0x4')]('user-setting:update:user-'+_0x30b4c1[_0x84b3('0x6')],_0x30b4c1);}};}exports[_0x84b3('0x7')]=function(_0x540a9f){for(var _0x51d866=0x0,_0x5d0a6c=events['length'];_0x51d866<_0x5d0a6c;_0x51d866++){var _0x188cb9=events[_0x51d866];var _0x1b1a01=createListener(_0x84b3('0x8')+_0x188cb9,_0x540a9f);UserSettingEvents['on'](_0x188cb9,_0x1b1a01);}}; \ No newline at end of file +var _0xd464=['user-setting:update:user-','UserId','register','./user-setting.events','save','remove','update','user-setting:update','emit'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0xd464,0xdb));var _0x4d46=function(_0x1b5f85,_0x362767){_0x1b5f85=_0x1b5f85-0x0;var _0x240a91=_0xd464[_0x1b5f85];return _0x240a91;};'use strict';var UserSettingEvents=require(_0x4d46('0x0'));var events=[_0x4d46('0x1'),_0x4d46('0x2'),_0x4d46('0x3')];function createListener(_0x129931,_0x11fa34){return function(_0x248d05){_0x11fa34['emit'](_0x129931,_0x248d05);if(_0x129931===_0x4d46('0x4')){_0x11fa34[_0x4d46('0x5')](_0x4d46('0x6')+_0x248d05[_0x4d46('0x7')],_0x248d05);}};}exports[_0x4d46('0x8')]=function(_0x40e796){for(var _0x4207f4=0x0,_0x5a9994=events['length'];_0x4207f4<_0x5a9994;_0x4207f4++){var _0xc4612e=events[_0x4207f4];var _0x50557a=createListener('user-setting:'+_0xc4612e,_0x40e796);UserSettingEvents['on'](_0xc4612e,_0x50557a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f7637c6..eb94016 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 _0xd417=['whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','join','now','single','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','put','update','/:id/password','removeTeams','delete','destroy','removeMailInteractions','removeWhatsappInteractions','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/whoami'];(function(_0x144c0c,_0x113cfe){var _0x436221=function(_0x231dd7){while(--_0x231dd7){_0x144c0c['push'](_0x144c0c['shift']());}};_0x436221(++_0x113cfe);}(_0xd417,0x1eb));var _0x7d41=function(_0xa5d77b,_0x1bd1a1){_0xa5d77b=_0xa5d77b-0x0;var _0x3f4a6c=_0xd417[_0xa5d77b];return _0x3f4a6c;};'use strict';var multer=require('multer');var util=require(_0x7d41('0x0'));var path=require(_0x7d41('0x1'));var timeout=require(_0x7d41('0x2'));var express=require(_0x7d41('0x3'));var router=express[_0x7d41('0x4')]();var fs_extra=require(_0x7d41('0x5'));var auth=require(_0x7d41('0x6'));var interaction=require(_0x7d41('0x7'));var config=require(_0x7d41('0x8'));var controller=require('./user.controller');router[_0x7d41('0x9')]('/',auth[_0x7d41('0xa')](),controller[_0x7d41('0xb')]);router['get']('/describe',auth[_0x7d41('0xa')](),controller[_0x7d41('0xc')]);router[_0x7d41('0x9')](_0x7d41('0xd'),auth[_0x7d41('0xa')](),controller[_0x7d41('0xe')]);router[_0x7d41('0x9')](_0x7d41('0xf'),auth[_0x7d41('0xa')](),controller['getPresence']);router[_0x7d41('0x9')](_0x7d41('0x10'),auth[_0x7d41('0xa')](),controller['show']);router['get'](_0x7d41('0x11'),controller[_0x7d41('0x12')]);router[_0x7d41('0x9')](_0x7d41('0x13'),auth[_0x7d41('0xa')](),controller['getOpenTabs']);router['get'](_0x7d41('0x14'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x15')]);router[_0x7d41('0x9')](_0x7d41('0x16'),auth['isAuthenticated'](),controller[_0x7d41('0x17')]);router['get'](_0x7d41('0x18'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x19')]);router[_0x7d41('0x9')](_0x7d41('0x1a'),auth[_0x7d41('0xa')](),controller['getGroups']);router['get'](_0x7d41('0x1b'),auth['isAuthenticated'](),controller[_0x7d41('0x1c')]);router['get'](_0x7d41('0x1d'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x1e')]);router['get']('/:id/chat/interactions',auth[_0x7d41('0xa')](),controller[_0x7d41('0x1f')]);router[_0x7d41('0x9')](_0x7d41('0x20'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x21')]);router['get']('/:id/mail/interactions',auth[_0x7d41('0xa')](),controller['getMailInteractions']);router[_0x7d41('0x9')](_0x7d41('0x22'),auth[_0x7d41('0xa')](),controller['getSmsInteractions']);router[_0x7d41('0x9')](_0x7d41('0x23'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x24')]);router[_0x7d41('0x9')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0x7d41('0x25')]);router[_0x7d41('0x9')](_0x7d41('0x26'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x27')]);router[_0x7d41('0x9')](_0x7d41('0x28'),auth['isAuthenticated'](),controller[_0x7d41('0x29')]);router[_0x7d41('0x9')](_0x7d41('0x2a'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7d41('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller['getVoicePrefixes']);router[_0x7d41('0x9')](_0x7d41('0x2b'),auth[_0x7d41('0xa')](),controller['getFaxAccounts']);router[_0x7d41('0x9')](_0x7d41('0x2c'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x2d')]);router[_0x7d41('0x9')](_0x7d41('0x2e'),auth['isAuthenticated'](),controller[_0x7d41('0x2f')]);router[_0x7d41('0x9')](_0x7d41('0x30'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x31')]);router[_0x7d41('0x9')](_0x7d41('0x32'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x33')]);router['get']('/:id/whatsapp_accounts',auth[_0x7d41('0xa')](),controller[_0x7d41('0x34')]);router[_0x7d41('0x9')](_0x7d41('0x35'),auth[_0x7d41('0xa')](),controller['getScheduledCalls']);router[_0x7d41('0x9')](_0x7d41('0x36'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x37')]);router[_0x7d41('0x38')](_0x7d41('0x14'),auth['isAuthenticated'](),controller[_0x7d41('0x39')]);router[_0x7d41('0x38')]('/',auth[_0x7d41('0xa')](),controller[_0x7d41('0x3a')]);router['post'](_0x7d41('0x3b'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x3c')]);router[_0x7d41('0x38')](_0x7d41('0x16'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x3d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2528cf,_0x4ff2ac,_0x30f762){_0x30f762(null,path[_0x7d41('0x3e')](config['root'],'server/files/images/'));},'filename':function(_0x3d060e,_0x543a52,_0x1d49a7){_0x1d49a7(null,util['format']('%s-%s',Date[_0x7d41('0x3f')](),_0x543a52['originalname']));}})});router[_0x7d41('0x38')](_0x7d41('0x11'),upload[_0x7d41('0x40')]('file'),controller[_0x7d41('0x41')]);router[_0x7d41('0x38')](_0x7d41('0x42'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x43')]);router[_0x7d41('0x38')](_0x7d41('0x44'),auth['isAuthenticated'](),controller[_0x7d41('0x45')]);router[_0x7d41('0x38')]('/:id/pause',auth[_0x7d41('0xa')](),controller[_0x7d41('0x46')]);router[_0x7d41('0x38')](_0x7d41('0x47'),auth[_0x7d41('0xa')](),controller['unpause']);router[_0x7d41('0x38')](_0x7d41('0x26'),auth['isAuthenticated'](),controller['addTeams']);router[_0x7d41('0x38')]('/:id/chat_interactions',auth[_0x7d41('0xa')](),controller[_0x7d41('0x48')]);router['post'](_0x7d41('0x49'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x4a')]);router[_0x7d41('0x38')](_0x7d41('0x4b'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x4c')]);router[_0x7d41('0x38')](_0x7d41('0x4d'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x4e')]);router[_0x7d41('0x38')](_0x7d41('0x4f'),auth[_0x7d41('0xa')](),controller['addOpenchannelInteractions']);router[_0x7d41('0x38')](_0x7d41('0x50'),auth['isAuthenticated'](),controller[_0x7d41('0x51')]);router[_0x7d41('0x38')](_0x7d41('0x2b'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x52')]);router[_0x7d41('0x38')](_0x7d41('0x2c'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x53')]);router[_0x7d41('0x38')](_0x7d41('0x2e'),auth['isAuthenticated'](),controller[_0x7d41('0x54')]);router[_0x7d41('0x38')](_0x7d41('0x30'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x55')]);router[_0x7d41('0x38')](_0x7d41('0x32'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x56')]);router[_0x7d41('0x38')](_0x7d41('0x57'),auth[_0x7d41('0xa')](),controller['addWhatsappAccounts']);router['post'](_0x7d41('0x36'),auth['isAuthenticated'](),controller['createApiKey']);router[_0x7d41('0x58')](_0x7d41('0x10'),auth['isAuthenticated'](),controller[_0x7d41('0x59')]);router[_0x7d41('0x58')](_0x7d41('0x5a'),auth[_0x7d41('0xa')](),controller['changePassword']);router['delete'](_0x7d41('0x16'),auth[_0x7d41('0xa')](),controller['removeQueues']);router['delete']('/:id/teams',auth[_0x7d41('0xa')](),controller[_0x7d41('0x5b')]);router[_0x7d41('0x5c')]('/:id',auth[_0x7d41('0xa')](),controller[_0x7d41('0x5d')]);router[_0x7d41('0x5c')]('/:id/chat_interactions',auth[_0x7d41('0xa')](),controller['removeChatInteractions']);router['delete'](_0x7d41('0x49'),auth['isAuthenticated'](),controller[_0x7d41('0x5e')]);router[_0x7d41('0x5c')](_0x7d41('0x4b'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x7d41('0x5c')](_0x7d41('0x4d'),auth[_0x7d41('0xa')](),controller['removeSmsInteractions']);router[_0x7d41('0x5c')]('/:id/openchannel_interactions',auth[_0x7d41('0xa')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x7d41('0x5f')]);router[_0x7d41('0x5c')](_0x7d41('0x2b'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x7d41('0x5c')]('/:id/mail_accounts',auth[_0x7d41('0xa')](),controller['removeMailAccounts']);router[_0x7d41('0x5c')](_0x7d41('0x2e'),auth[_0x7d41('0xa')](),controller['removeOpenchannelAccounts']);router[_0x7d41('0x5c')](_0x7d41('0x30'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x60')]);router[_0x7d41('0x5c')](_0x7d41('0x32'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x61')]);router['delete'](_0x7d41('0x57'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x62')]);router[_0x7d41('0x5c')](_0x7d41('0x36'),auth[_0x7d41('0xa')](),controller[_0x7d41('0x63')]);router['post']('/:id/messengerSoundNotification',auth[_0x7d41('0xa')](),controller[_0x7d41('0x64')]);module['exports']=router; \ No newline at end of file +var _0x2661=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/whoami','getPresence','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','/:id/queues','/:id/queues_rt','/:id/groups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','getChatWebsites','/:id/scheduled_calls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','diskStorage','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','put','/:id','update','/:id/password','delete','removeQueues','removeTeams','removeChatInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeApiKey'];(function(_0x21a705,_0x322778){var _0x11bf56=function(_0x274879){while(--_0x274879){_0x21a705['push'](_0x21a705['shift']());}};_0x11bf56(++_0x322778);}(_0x2661,0x142));var _0x1266=function(_0x1d1007,_0x178729){_0x1d1007=_0x1d1007-0x0;var _0x26343f=_0x2661[_0x1d1007];return _0x26343f;};'use strict';var multer=require(_0x1266('0x0'));var util=require(_0x1266('0x1'));var path=require(_0x1266('0x2'));var timeout=require(_0x1266('0x3'));var express=require(_0x1266('0x4'));var router=express[_0x1266('0x5')]();var fs_extra=require(_0x1266('0x6'));var auth=require(_0x1266('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1266('0x8'));var controller=require('./user.controller');router['get']('/',auth[_0x1266('0x9')](),controller[_0x1266('0xa')]);router[_0x1266('0xb')](_0x1266('0xc'),auth[_0x1266('0x9')](),controller[_0x1266('0xd')]);router[_0x1266('0xb')](_0x1266('0xe'),auth[_0x1266('0x9')](),controller['whoami']);router[_0x1266('0xb')]('/presence',auth['isAuthenticated'](),controller[_0x1266('0xf')]);router['get']('/:id',auth[_0x1266('0x9')](),controller[_0x1266('0x10')]);router['get'](_0x1266('0x11'),controller[_0x1266('0x12')]);router[_0x1266('0xb')]('/:id/open_tabs',auth[_0x1266('0x9')](),controller[_0x1266('0x13')]);router[_0x1266('0xb')](_0x1266('0x14'),auth['isAuthenticated'](),controller['getContacts']);router[_0x1266('0xb')](_0x1266('0x15'),auth[_0x1266('0x9')](),controller['getQueues']);router[_0x1266('0xb')](_0x1266('0x16'),auth[_0x1266('0x9')](),controller['getVoiceQueuesRt']);router[_0x1266('0xb')](_0x1266('0x17'),auth['isAuthenticated'](),controller['getGroups']);router[_0x1266('0xb')]('/:id/recordings',auth['isAuthenticated'](),controller[_0x1266('0x18')]);router[_0x1266('0xb')](_0x1266('0x19'),auth[_0x1266('0x9')](),controller[_0x1266('0x1a')]);router['get'](_0x1266('0x1b'),auth[_0x1266('0x9')](),controller[_0x1266('0x1c')]);router[_0x1266('0xb')]('/:id/openchannel/interactions',auth[_0x1266('0x9')](),controller[_0x1266('0x1d')]);router[_0x1266('0xb')](_0x1266('0x1e'),auth[_0x1266('0x9')](),controller[_0x1266('0x1f')]);router[_0x1266('0xb')]('/:id/sms/interactions',auth[_0x1266('0x9')](),controller['getSmsInteractions']);router['get'](_0x1266('0x20'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x1266('0xb')](_0x1266('0x21'),auth[_0x1266('0x9')](),controller[_0x1266('0x22')]);router[_0x1266('0xb')](_0x1266('0x23'),auth[_0x1266('0x9')](),controller[_0x1266('0x24')]);router['get'](_0x1266('0x25'),auth['isAuthenticated'](),controller[_0x1266('0x26')]);router[_0x1266('0xb')]('/:id/agents',auth[_0x1266('0x9')](),controller[_0x1266('0x27')]);router[_0x1266('0xb')](_0x1266('0x28'),auth[_0x1266('0x9')](),controller[_0x1266('0x29')]);router[_0x1266('0xb')](_0x1266('0x2a'),auth[_0x1266('0x9')](),controller['getFaxAccounts']);router[_0x1266('0xb')](_0x1266('0x2b'),auth[_0x1266('0x9')](),controller['getMailAccounts']);router[_0x1266('0xb')](_0x1266('0x2c'),auth[_0x1266('0x9')](),controller[_0x1266('0x2d')]);router[_0x1266('0xb')]('/:id/sms_accounts',auth[_0x1266('0x9')](),controller[_0x1266('0x2e')]);router[_0x1266('0xb')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x1266('0x2f')]);router[_0x1266('0xb')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller['getWhatsappAccounts']);router['get'](_0x1266('0x30'),auth[_0x1266('0x9')](),controller['getScheduledCalls']);router[_0x1266('0xb')](_0x1266('0x31'),auth[_0x1266('0x9')](),controller[_0x1266('0x32')]);router['post'](_0x1266('0x14'),auth['isAuthenticated'](),controller['addContacts']);router[_0x1266('0x33')]('/',auth[_0x1266('0x9')](),controller[_0x1266('0x34')]);router['post'](_0x1266('0x35'),auth['isAuthenticated'](),controller[_0x1266('0x36')]);router['post']('/:id/queues',auth[_0x1266('0x9')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1266('0x37')]({'destination':function(_0x4ef6e7,_0x39e910,_0x3e8106){_0x3e8106(null,path['join'](config[_0x1266('0x38')],_0x1266('0x39')));},'filename':function(_0x5cf617,_0x9a1a08,_0x389e13){_0x389e13(null,util[_0x1266('0x3a')](_0x1266('0x3b'),Date['now'](),_0x9a1a08[_0x1266('0x3c')]));}})});router[_0x1266('0x33')](_0x1266('0x11'),upload[_0x1266('0x3d')](_0x1266('0x3e')),controller[_0x1266('0x3f')]);router[_0x1266('0x33')](_0x1266('0x40'),auth[_0x1266('0x9')](),controller[_0x1266('0x41')]);router[_0x1266('0x33')]('/:id/logout',auth[_0x1266('0x9')](),controller['logout']);router[_0x1266('0x33')](_0x1266('0x42'),auth[_0x1266('0x9')](),controller[_0x1266('0x43')]);router[_0x1266('0x33')](_0x1266('0x44'),auth[_0x1266('0x9')](),controller[_0x1266('0x45')]);router[_0x1266('0x33')]('/:id/teams',auth[_0x1266('0x9')](),controller[_0x1266('0x46')]);router[_0x1266('0x33')](_0x1266('0x47'),auth[_0x1266('0x9')](),controller[_0x1266('0x48')]);router[_0x1266('0x33')](_0x1266('0x49'),auth[_0x1266('0x9')](),controller[_0x1266('0x4a')]);router[_0x1266('0x33')](_0x1266('0x4b'),auth[_0x1266('0x9')](),controller['addFaxInteractions']);router['post'](_0x1266('0x4c'),auth[_0x1266('0x9')](),controller[_0x1266('0x4d')]);router[_0x1266('0x33')]('/:id/openchannel_interactions',auth[_0x1266('0x9')](),controller['addOpenchannelInteractions']);router[_0x1266('0x33')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x1266('0x4e')]);router[_0x1266('0x33')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1266('0x4f')]);router[_0x1266('0x33')]('/:id/mail_accounts',auth[_0x1266('0x9')](),controller[_0x1266('0x50')]);router[_0x1266('0x33')](_0x1266('0x2c'),auth[_0x1266('0x9')](),controller[_0x1266('0x51')]);router['post'](_0x1266('0x52'),auth[_0x1266('0x9')](),controller[_0x1266('0x53')]);router[_0x1266('0x33')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router['post'](_0x1266('0x54'),auth[_0x1266('0x9')](),controller[_0x1266('0x55')]);router['post'](_0x1266('0x31'),auth[_0x1266('0x9')](),controller['createApiKey']);router[_0x1266('0x56')](_0x1266('0x57'),auth['isAuthenticated'](),controller[_0x1266('0x58')]);router[_0x1266('0x56')](_0x1266('0x59'),auth[_0x1266('0x9')](),controller['changePassword']);router[_0x1266('0x5a')](_0x1266('0x15'),auth[_0x1266('0x9')](),controller[_0x1266('0x5b')]);router[_0x1266('0x5a')](_0x1266('0x23'),auth[_0x1266('0x9')](),controller[_0x1266('0x5c')]);router[_0x1266('0x5a')](_0x1266('0x57'),auth[_0x1266('0x9')](),controller['destroy']);router['delete'](_0x1266('0x47'),auth['isAuthenticated'](),controller[_0x1266('0x5d')]);router[_0x1266('0x5a')](_0x1266('0x49'),auth[_0x1266('0x9')](),controller['removeMailInteractions']);router['delete'](_0x1266('0x4b'),auth['isAuthenticated'](),controller[_0x1266('0x5e')]);router['delete'](_0x1266('0x4c'),auth['isAuthenticated'](),controller[_0x1266('0x5f')]);router['delete']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x1266('0x60')]);router[_0x1266('0x5a')](_0x1266('0x61'),auth['isAuthenticated'](),controller[_0x1266('0x62')]);router[_0x1266('0x5a')](_0x1266('0x2a'),auth[_0x1266('0x9')](),controller[_0x1266('0x63')]);router[_0x1266('0x5a')]('/:id/mail_accounts',auth[_0x1266('0x9')](),controller[_0x1266('0x64')]);router[_0x1266('0x5a')](_0x1266('0x2c'),auth[_0x1266('0x9')](),controller[_0x1266('0x65')]);router['delete'](_0x1266('0x52'),auth[_0x1266('0x9')](),controller[_0x1266('0x66')]);router[_0x1266('0x5a')](_0x1266('0x67'),auth[_0x1266('0x9')](),controller[_0x1266('0x68')]);router[_0x1266('0x5a')]('/:id/whatsapp_accounts',auth[_0x1266('0x9')](),controller['removeWhatsappAccounts']);router[_0x1266('0x5a')](_0x1266('0x31'),auth[_0x1266('0x9')](),controller[_0x1266('0x69')]);router[_0x1266('0x33')]('/:id/messengerSoundNotification',auth[_0x1266('0x9')](),controller['messengerSoundNotification']);module[_0x1266('0x6a')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index c2256e5..92f8ab1 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 _0xe749=['dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uas','fingerprint','certificate','passive','actpass','showWebBar','get','isArray','wss','encryption','avpf','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','permissions','map','phoneBarEnableScreenRecordingByAgent','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','name','setDataValue','defaultuser','fullname','callerid','format','getDataValue','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','\x22%s\x22\x20<%s>','BOOLEAN','DATE'];(function(_0xdc0535,_0x49d32a){var _0x19c8aa=function(_0x14c740){while(--_0x14c740){_0xdc0535['push'](_0xdc0535['shift']());}};_0x19c8aa(++_0x49d32a);}(_0xe749,0xed));var _0x9e74=function(_0x5e4244,_0x4ac0bc){_0x5e4244=_0x5e4244-0x0;var _0x303520=_0xe749[_0x5e4244];return _0x303520;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9e74('0x0'));var util=require(_0x9e74('0x1'));var _=require(_0x9e74('0x2'));module[_0x9e74('0x3')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9e74('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2d0a62){this[_0x9e74('0x5')](_0x9e74('0x4'),_0x2d0a62);this['setDataValue'](_0x9e74('0x6'),_0x2d0a62);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x2f5b69){this['setDataValue'](_0x9e74('0x7'),_0x2f5b69);this['setDataValue'](_0x9e74('0x8'),util[_0x9e74('0x9')]('\x22%s\x22\x20<%s>',_0x2f5b69,this[_0x9e74('0xa')](_0x9e74('0xb'))));}},'alias':{'type':Sequelize[_0x9e74('0xc')]},'email':{'type':Sequelize[_0x9e74('0xc')],'allowNull':![],'unique':_0x9e74('0xd'),'validate':{'isEmail':!![]},'set':function(_0xd72a11){if(_0xd72a11){this[_0x9e74('0x5')]('email',_0xd72a11[_0x9e74('0xe')]());}}},'role':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x10'),_0x9e74('0x11'),_0x9e74('0x12'),_0x9e74('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x9e74('0xc')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x9e74('0xc')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':![],'unique':_0x9e74('0xb'),'set':function(_0x2f654f){this[_0x9e74('0x5')](_0x9e74('0xb'),_0x2f654f);this[_0x9e74('0x5')]('accountcode',_0x2f654f);this[_0x9e74('0x5')]('callerid',util[_0x9e74('0x9')](_0x9e74('0x15'),this[_0x9e74('0xa')](_0x9e74('0x7')),_0x2f654f));}},'salt':{'type':Sequelize[_0x9e74('0xc')]},'phone':{'type':Sequelize[_0x9e74('0xc')]},'mobile':{'type':Sequelize[_0x9e74('0xc')]},'address':{'type':Sequelize[_0x9e74('0xc')]},'zipcode':{'type':Sequelize[_0x9e74('0xc')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x9e74('0x17')]},'voicePause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x9e74('0xc')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x9e74('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x9e74('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![],'defaultValue':_0x9e74('0x18')},'ipaddr':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'port':{'type':Sequelize[_0x9e74('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x9e74('0x19'),_0x9e74('0x11'),_0x9e74('0x1a')),'allowNull':!![],'defaultValue':_0x9e74('0x19')},'context':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![],'defaultValue':_0x9e74('0x1b')},'callingpres':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x1c'),_0x9e74('0x1d'),_0x9e74('0x1e'),_0x9e74('0x1f'),_0x9e74('0x20'),_0x9e74('0x21'),_0x9e74('0x22'),_0x9e74('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'transport':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![],'defaultValue':_0x9e74('0x24'),'set':function(_0xf8800e){this[_0x9e74('0x5')](_0x9e74('0x25'),_0xf8800e?_0xf8800e[_0x9e74('0x26')](','):null);},'get':function(){return this[_0x9e74('0xa')](_0x9e74('0x25'))?this[_0x9e74('0xa')](_0x9e74('0x25'))[_0x9e74('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x9e74('0x28'),_0x9e74('0x29'),_0x9e74('0x2a'),_0x9e74('0x2b'),'auto'),'allowNull':!![],'defaultValue':_0x9e74('0x28')},'directmedia':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no',_0x9e74('0x2d'),_0x9e74('0x2e'),_0x9e74('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x9e74('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'nat':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![],'defaultValue':_0x9e74('0x30'),'set':function(_0xddf929){this['setDataValue'](_0x9e74('0x31'),_0xddf929?_0xddf929[_0x9e74('0x26')](','):null);},'get':function(){return this[_0x9e74('0xa')](_0x9e74('0x31'))?this[_0x9e74('0xa')](_0x9e74('0x31'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x9e74('0xc')]},'namedcallgroup':{'type':Sequelize[_0x9e74('0xc')]},'pickupgroup':{'type':Sequelize[_0x9e74('0xc')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x9e74('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x9e74('0xc')]},'disallow':{'type':Sequelize[_0x9e74('0xc')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x9e74('0xc')],'allowNull':![],'defaultValue':_0x9e74('0x32'),'set':function(_0x16aa2c){this[_0x9e74('0x5')](_0x9e74('0x33'),_0x16aa2c?_0x16aa2c[_0x9e74('0x26')](';'):_0x9e74('0x32'));},'get':function(){return this['getDataValue'](_0x9e74('0x33'))?this[_0x9e74('0xa')](_0x9e74('0x33'))[_0x9e74('0x27')](';'):null;},'comment':_0x9e74('0x34')},'autoframing':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![],'set':function(_0x6850ef){this[_0x9e74('0x5')](_0x9e74('0x35'),_0x6850ef?_0x6850ef[_0x9e74('0x26')](','):null);},'get':function(){return this[_0x9e74('0xa')](_0x9e74('0x35'))?this[_0x9e74('0xa')](_0x9e74('0x35'))['split'](','):null;},'comment':_0x9e74('0x36')},'trustrpid':{'type':Sequelize[_0x9e74('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no',_0x9e74('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x9e74('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![],'defaultValue':_0x9e74('0x2c')},'busylevel':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'template':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x9e74('0xf')]('yes','no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x39'),_0x9e74('0x3a'),_0x9e74('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x9e74('0xf')]('uac',_0x9e74('0x3c')),'allowNull':!![],'defaultValue':_0x9e74('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x9e74('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0x9e74('0x2c')},'keepalive':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no',_0x9e74('0x3d'),_0x9e74('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x9e74('0x3f'),_0x9e74('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x9e74('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x9e74('0x2c'),'no',_0x9e74('0x2d'),_0x9e74('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x9e74('0xc')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x9e74('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0,'set':function(_0x357ba3){this[_0x9e74('0x5')](_0x9e74('0x41'),_0x357ba3);var _0x6aa181=this[_0x9e74('0x42')]({'plain':!![]});switch(_0x357ba3){case 0x0:case 0x1:var _0x1a5813=_0x6aa181[_0x9e74('0x25')]?_[_0x9e74('0x43')](_0x6aa181['transport'])?_0x6aa181[_0x9e74('0x25')][_0x9e74('0x26')]():_0x6aa181[_0x9e74('0x25')]:_0x9e74('0x24');if(_0x1a5813===_0x9e74('0x44')){_0x1a5813=_0x9e74('0x24');}this[_0x9e74('0x5')](_0x9e74('0x25'),_0x1a5813);this[_0x9e74('0x5')](_0x9e74('0x45'),'no');this[_0x9e74('0x5')](_0x9e74('0x46'),null);this[_0x9e74('0x5')](_0x9e74('0x47'),null);this['setDataValue']('icesupport',null);this[_0x9e74('0x5')](_0x9e74('0x48'),null);this[_0x9e74('0x5')](_0x9e74('0x49'),null);this['setDataValue'](_0x9e74('0x4a'),null);this[_0x9e74('0x5')](_0x9e74('0x4b'),null);this[_0x9e74('0x5')](_0x9e74('0x4c'),null);this['setDataValue'](_0x9e74('0x4d'),'no');break;case 0x2:this['setDataValue'](_0x9e74('0x25'),_0x9e74('0x44'));this[_0x9e74('0x5')](_0x9e74('0x45'),_0x9e74('0x2c'));this[_0x9e74('0x5')](_0x9e74('0x46'),'yes');this[_0x9e74('0x5')]('force_avp',_0x9e74('0x2c'));this[_0x9e74('0x5')]('icesupport',_0x9e74('0x2c'));this[_0x9e74('0x5')](_0x9e74('0x48'),'yes');this[_0x9e74('0x5')]('dtlsverify','no');this[_0x9e74('0x5')](_0x9e74('0x4a'),_0x9e74('0x40'));this[_0x9e74('0x5')](_0x9e74('0x4b'),_0x6aa181['dtlscertfile']||_0x9e74('0x4e'));this[_0x9e74('0x5')](_0x9e74('0x4c'),_0x6aa181[_0x9e74('0x4c')]||'/etc/pki/tls/private/motion.key');this[_0x9e74('0x5')]('rtcp_mux',_0x9e74('0x2c'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0xd51678){this[_0x9e74('0x5')]('permissions',_0xd51678?_0xd51678['join'](','):[]);},'get':function(){return this[_0x9e74('0xa')](_0x9e74('0x4f'))?_[_0x9e74('0x50')](this[_0x9e74('0xa')](_0x9e74('0x4f'))[_0x9e74('0x27')](','),function(_0x210d38){return parseInt(_0x210d38,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x9e74('0xc')]},'phoneBarBusyNumber':{'type':Sequelize[_0x9e74('0xc')]},'phoneBarUnconditional':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x9e74('0xc')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x9e74('0xf')](_0x9e74('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x9e74('0xc')]},'phoneBarEnableJaws':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x9e74('0xa')]('phoneBarEnableScreenRecordingByAgent')?this[_0x9e74('0xa')](_0x9e74('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x9e74('0xc')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![],'set':function(_0x11de4c){if(typeof _0x11de4c==='string'){var _0x56fb17=_0x11de4c==='1'?!![]:_0x11de4c==='0'?![]:_0x11de4c==='true'?!![]:_0x11de4c==='false'?![]:![];this[_0x9e74('0x5')](_0x9e74('0x52'),_0x56fb17);}else{this[_0x9e74('0x5')](_0x9e74('0x52'),_0x11de4c);}}},'blocked':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![],'set':function(_0x20d94d){this[_0x9e74('0x5')](_0x9e74('0x53'),_0x20d94d);if(_0x20d94d===!![]){this[_0x9e74('0x5')](_0x9e74('0x54'),moment());this[_0x9e74('0x5')](_0x9e74('0x55'),0x0);}else{this[_0x9e74('0x5')](_0x9e74('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x9e74('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x9e74('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x9e74('0x14')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x9e74('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xe577=['name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','split','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','refuse','uac','uas','fingerprint','certificate','actpass','showWebBar','isArray','udp','encryption','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','avpf','dtlsverify','dtlscertfile','/etc/pki/tls/certs/motion.crt','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','blocked','loginAttempts','blockedAt','sequelize','moment','util','lodash','exports','STRING'];(function(_0x5799b5,_0x22fd44){var _0x4a564a=function(_0xdd5b99){while(--_0xdd5b99){_0x5799b5['push'](_0x5799b5['shift']());}};_0x4a564a(++_0x22fd44);}(_0xe577,0x1b7));var _0x7e57=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xe577[_0x543084];return _0x306a57;};'use strict';var Sequelize=require(_0x7e57('0x0'));var moment=require(_0x7e57('0x1'));var util=require(_0x7e57('0x2'));var _=require(_0x7e57('0x3'));module[_0x7e57('0x4')]={'name':{'type':Sequelize[_0x7e57('0x5')],'allowNull':![],'unique':_0x7e57('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0xee3c28){this[_0x7e57('0x7')](_0x7e57('0x6'),_0xee3c28);this['setDataValue'](_0x7e57('0x8'),_0xee3c28);},'comment':_0x7e57('0x9')},'fullname':{'type':Sequelize[_0x7e57('0x5')],'allowNull':![],'set':function(_0x296d08){this[_0x7e57('0x7')](_0x7e57('0xa'),_0x296d08);this['setDataValue'](_0x7e57('0xb'),util[_0x7e57('0xc')](_0x7e57('0xd'),_0x296d08,this[_0x7e57('0xe')](_0x7e57('0xf'))));}},'alias':{'type':Sequelize[_0x7e57('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7e57('0x10'),'validate':{'isEmail':!![]},'set':function(_0x5b5e5a){if(_0x5b5e5a){this[_0x7e57('0x7')](_0x7e57('0x10'),_0x5b5e5a['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x7e57('0x11'),_0x7e57('0x12'),_0x7e57('0x13'),_0x7e57('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x7e57('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x7e57('0x5')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':![],'unique':_0x7e57('0xf'),'set':function(_0x100c26){this[_0x7e57('0x7')]('internal',_0x100c26);this[_0x7e57('0x7')](_0x7e57('0x16'),_0x100c26);this[_0x7e57('0x7')]('callerid',util[_0x7e57('0xc')](_0x7e57('0xd'),this['getDataValue'](_0x7e57('0xa')),_0x100c26));}},'salt':{'type':Sequelize[_0x7e57('0x5')]},'phone':{'type':Sequelize[_0x7e57('0x5')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x7e57('0x5')]},'zipcode':{'type':Sequelize[_0x7e57('0x5')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x7e57('0x5')]},'country':{'type':Sequelize[_0x7e57('0x5')]},'online':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x7e57('0x18')]},'voicePause':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x7e57('0x5')],'defaultValue':_0x7e57('0x19')},'lastPauseAt':{'type':Sequelize[_0x7e57('0x18')]},'chatCapacity':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x7e57('0x15')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![],'defaultValue':_0x7e57('0x1a')},'ipaddr':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0x7e57('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x1c'),'user',_0x7e57('0x1d')),'allowNull':!![],'defaultValue':_0x7e57('0x1c')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7e57('0x1e')},'callingpres':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x1f'),_0x7e57('0x20'),'ALLOWED_FAILED_SCREEN',_0x7e57('0x21'),_0x7e57('0x22'),'PROHIB_PASSED_SCREEN',_0x7e57('0x23'),_0x7e57('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![],'defaultValue':'udp','set':function(_0x2cdb16){this[_0x7e57('0x7')]('transport',_0x2cdb16?_0x2cdb16['join'](','):null);},'get':function(){return this['getDataValue'](_0x7e57('0x25'))?this['getDataValue'](_0x7e57('0x25'))['split'](','):null;},'comment':_0x7e57('0x26')},'dtmfmode':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x27'),'info','shortinfo',_0x7e57('0x28'),_0x7e57('0x29')),'allowNull':!![],'defaultValue':_0x7e57('0x27')},'directmedia':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no',_0x7e57('0x2b'),_0x7e57('0x2c'),_0x7e57('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x7e57('0x2e'),'set':function(_0x308080){this[_0x7e57('0x7')](_0x7e57('0x2f'),_0x308080?_0x308080['join'](','):null);},'get':function(){return this['getDataValue'](_0x7e57('0x2f'))?this[_0x7e57('0xe')]('nat')['split'](','):null;},'comment':_0x7e57('0x30')},'callgroup':{'type':Sequelize[_0x7e57('0x5')]},'namedcallgroup':{'type':Sequelize[_0x7e57('0x5')]},'pickupgroup':{'type':Sequelize[_0x7e57('0x5')]},'namedpickupgroup':{'type':Sequelize[_0x7e57('0x5')]},'language':{'type':Sequelize[_0x7e57('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x7e57('0x5')]},'disallow':{'type':Sequelize[_0x7e57('0x5')],'allowNull':![],'defaultValue':_0x7e57('0x31')},'allow':{'type':Sequelize[_0x7e57('0x5')],'allowNull':![],'defaultValue':_0x7e57('0x32'),'set':function(_0x1dfa57){this[_0x7e57('0x7')](_0x7e57('0x33'),_0x1dfa57?_0x1dfa57[_0x7e57('0x34')](';'):_0x7e57('0x32'));},'get':function(){return this['getDataValue'](_0x7e57('0x33'))?this[_0x7e57('0xe')]('allow')[_0x7e57('0x35')](';'):null;},'comment':_0x7e57('0x36')},'autoframing':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![],'set':function(_0x3e6cfb){this[_0x7e57('0x7')]('insecure',_0x3e6cfb?_0x3e6cfb[_0x7e57('0x34')](','):null);},'get':function(){return this['getDataValue'](_0x7e57('0x37'))?this[_0x7e57('0xe')]('insecure')[_0x7e57('0x35')](','):null;},'comment':_0x7e57('0x38')},'trustrpid':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no',_0x7e57('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![],'defaultValue':_0x7e57('0x3a')},'amaflags':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x7e57('0x1b')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no',_0x7e57('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0x7e57('0x3c'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x3d'),_0x7e57('0x3e')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x7e57('0x1b')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x7e57('0x1b')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x7e57('0x1b')]('yes','no',_0x7e57('0x3f'),_0x7e57('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x7e57('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x7e57('0x15')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x7e57('0x1b')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x7e57('0x2a'),'no',_0x7e57('0x2b'),_0x7e57('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x7e57('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0x7e57('0x18')]},'passwordResetAt':{'type':Sequelize[_0x7e57('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0,'set':function(_0x1f3366){this[_0x7e57('0x7')](_0x7e57('0x42'),_0x1f3366);var _0x4f74a2=this['get']({'plain':!![]});switch(_0x1f3366){case 0x0:case 0x1:var _0x604544=_0x4f74a2[_0x7e57('0x25')]?_[_0x7e57('0x43')](_0x4f74a2[_0x7e57('0x25')])?_0x4f74a2[_0x7e57('0x25')][_0x7e57('0x34')]():_0x4f74a2[_0x7e57('0x25')]:_0x7e57('0x44');if(_0x604544==='wss'){_0x604544=_0x7e57('0x44');}this[_0x7e57('0x7')](_0x7e57('0x25'),_0x604544);this['setDataValue'](_0x7e57('0x45'),'no');this['setDataValue']('avpf',null);this[_0x7e57('0x7')](_0x7e57('0x46'),null);this[_0x7e57('0x7')](_0x7e57('0x47'),null);this[_0x7e57('0x7')](_0x7e57('0x48'),null);this[_0x7e57('0x7')]('dtlsverify',null);this[_0x7e57('0x7')](_0x7e57('0x49'),null);this[_0x7e57('0x7')]('dtlscertfile',null);this[_0x7e57('0x7')](_0x7e57('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0x7e57('0x7')]('transport','wss');this[_0x7e57('0x7')](_0x7e57('0x45'),_0x7e57('0x2a'));this['setDataValue'](_0x7e57('0x4b'),_0x7e57('0x2a'));this[_0x7e57('0x7')]('force_avp','yes');this['setDataValue'](_0x7e57('0x47'),'yes');this[_0x7e57('0x7')](_0x7e57('0x48'),_0x7e57('0x2a'));this[_0x7e57('0x7')](_0x7e57('0x4c'),'no');this[_0x7e57('0x7')](_0x7e57('0x49'),'actpass');this[_0x7e57('0x7')](_0x7e57('0x4d'),_0x4f74a2[_0x7e57('0x4d')]||_0x7e57('0x4e'));this[_0x7e57('0x7')](_0x7e57('0x4a'),_0x4f74a2[_0x7e57('0x4a')]||'/etc/pki/tls/private/motion.key');this['setDataValue']('rtcp_mux',_0x7e57('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x7e57('0x4f')],'set':function(_0x96b067){this[_0x7e57('0x7')]('permissions',_0x96b067?_0x96b067['join'](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x7e57('0xe')](_0x7e57('0x50'))[_0x7e57('0x35')](','),function(_0xc4c9e){return parseInt(_0xc4c9e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x7e57('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x7e57('0x5')]},'phoneBarBusyNumber':{'type':Sequelize[_0x7e57('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x7e57('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x7e57('0x1b')](_0x7e57('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x7e57('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x7e57('0x51')],'get':function(){return this[_0x7e57('0xe')](_0x7e57('0x52'))?this[_0x7e57('0xe')](_0x7e57('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'interface':{'type':Sequelize[_0x7e57('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x7e57('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x59bb5c){if(typeof _0x59bb5c===_0x7e57('0x53')){var _0x1b8e81=_0x59bb5c==='1'?!![]:_0x59bb5c==='0'?![]:_0x59bb5c===_0x7e57('0x54')?!![]:_0x59bb5c==='false'?![]:![];this[_0x7e57('0x7')](_0x7e57('0x55'),_0x1b8e81);}else{this[_0x7e57('0x7')](_0x7e57('0x55'),_0x59bb5c);}}},'blocked':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![],'set':function(_0x2ccc7e){this['setDataValue'](_0x7e57('0x56'),_0x2ccc7e);if(_0x2ccc7e===!![]){this['setDataValue']('blockedAt',moment());this[_0x7e57('0x7')](_0x7e57('0x57'),0x0);}else{this[_0x7e57('0x7')](_0x7e57('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x7e57('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x7e57('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x7e57('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x7e57('0x15')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index b8f933b..c2f2d07 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 _0x1caf=['ids','omit','internal','Setting','securePassword','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','email','permissions','101','102','113','104','105','106','107','108','109','100','111','114','create','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','Agents','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','autoAssociation','compact','newPassword','Sequelize','ValidationError','authenticate','oldPassword','Wrong\x20credentials','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','capitalize','toLowerCase','Queues','penalty','spread','Queue:save','VoiceQueue','voice','format','SIP/%s','UserVoiceQueueRt','upsert','channel','Unknown\x20channel','remove','isArray','QueueId','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','whatsapp','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','Tag','Tags','color','tag','getQueues','findOne','isValidChannel','model','keys','Queue','filters','intersection','fields','order','sort','where','pick','findAll','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','hasOwnProperty','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','LOGININPAUSE','resolve','logout','pause','QueuePause','PAUSE','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','Team','getTeams','addTeams','transaction','getAssociatedQueues','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','flattenDeep','removeAgent','getLists','CmList','getAgents','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','CmContact','dialActive','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','idle','ringing','queues','inbound','flatten','toString','col','asc','substring','uniqBy','orderBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','util','path','lodash','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','api','../../config/utils','../../config/environment','../../errors/api','handleError','../../mysqldb','socket.io-emitter','redis','register','defaults','localhost','http','sendStatus','status','offset','undefined','limit','count','set','json','request','then','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','User,\x20%s,\x20%s','message','result','update','emit','userNotification:recalc:','destroy','get','user','agent','Telephones','telephone','filter','ignore','map','value','find','role','name','stack','send','User','rawAttributes','fieldName','type','key','password','salt','resetPasswordToken','resetPasswordExpires','md5secret','includes','index','getOptions','query','includeAll','include','userSetting','UserSetting','attributes','push','rows','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','all','catch','show','params','merge','options','body','describe','addContacts'];(function(_0x1abf73,_0x1256f3){var _0x2f2ede=function(_0x2236b){while(--_0x2236b){_0x1abf73['push'](_0x1abf73['shift']());}};_0x2f2ede(++_0x1256f3);}(_0x1caf,0x133));var _0xf1ca=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x1caf[_0x565c49];return _0x20ca34;};'use strict';var moment=require('moment');var util=require(_0xf1ca('0x0'));var path=require(_0xf1ca('0x1'));var fs=require('fs');var _=require(_0xf1ca('0x2'));var squel=require(_0xf1ca('0x3'));var Redis=require(_0xf1ca('0x4'));var jayson=require('jayson/promise');var authService=require('../../components/auth/service');var contacts=require(_0xf1ca('0x5'));var qs=require(_0xf1ca('0x6'));var rta=require(_0xf1ca('0x7'));var logger=require(_0xf1ca('0x8'))(_0xf1ca('0x9'));var utils=require(_0xf1ca('0xa'));var config=require(_0xf1ca('0xb'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0xf1ca('0xc'))['APIBadRequestError'];var APINotFoundError=require(_0xf1ca('0xc'))['APINotFoundError'];var APIForbiddenError=require(_0xf1ca('0xc'))['APIForbiddenrror'];var APIHandleError=require(_0xf1ca('0xc'))[_0xf1ca('0xd')];var db=require(_0xf1ca('0xe'))['db'];var socket=require(_0xf1ca('0xf'))(new Redis(config[_0xf1ca('0x10')]));require('./user.socket')[_0xf1ca('0x11')](socket);config['redis']=_[_0xf1ca('0x12')](config['redis'],{'host':_0xf1ca('0x13'),'port':0x18eb});var amiClient=jayson['client'][_0xf1ca('0x14')]({'port':0x232a});var values;function respondWithStatusCode(_0x5ae6fa,_0x5144a1){_0x5144a1=_0x5144a1||0xcc;return function(_0x1fe85a){if(_0x1fe85a){return _0x5ae6fa[_0xf1ca('0x15')](_0x5144a1);}return _0x5ae6fa['status'](_0x5144a1)['end']();};}function respondWithResult(_0x5a9509,_0x2fd7c9){_0x2fd7c9=_0x2fd7c9||0xc8;return function(_0x14dea8){if(_0x14dea8){return _0x5a9509[_0xf1ca('0x16')](_0x2fd7c9)['json'](_0x14dea8);}};}function respondWithFilteredResult(_0x23538c,_0x4461ee){return function(_0x5f0195){if(_0x5f0195){var _0x3535f7=typeof _0x4461ee[_0xf1ca('0x17')]===_0xf1ca('0x18')&&typeof _0x4461ee[_0xf1ca('0x19')]==='undefined';var _0xbc6ebe=_0x5f0195['count'];var _0x53f133=_0x3535f7?0x0:_0x4461ee[_0xf1ca('0x17')];var _0x526c24=_0x3535f7?_0x5f0195[_0xf1ca('0x1a')]:_0x4461ee[_0xf1ca('0x17')]+_0x4461ee['limit'];var _0x1b1c01;if(_0x526c24>=_0xbc6ebe){_0x526c24=_0xbc6ebe;_0x1b1c01=0xc8;}else{_0x1b1c01=0xce;}_0x23538c[_0xf1ca('0x16')](_0x1b1c01);return _0x23538c[_0xf1ca('0x1b')]('Content-Range',_0x53f133+'-'+_0x526c24+'/'+_0xbc6ebe)[_0xf1ca('0x1c')](_0x5f0195);}return null;};}function respondWithRpcPromise(_0x2e7087,_0x170480,_0x51da7a,_0x2fe6c6){return new Promise(function(_0xe3a65e,_0x23aade){var _0x5223f6=_0x2fe6c6||amiClient;return _0x5223f6[_0xf1ca('0x1d')](_0x2e7087,_0x51da7a)[_0xf1ca('0x1e')](function(_0xce3266){logger[_0xf1ca('0x1f')]('User,\x20%s,\x20%s',_0x170480,'request\x20sent');logger[_0xf1ca('0x20')](_0xf1ca('0x21'),_0x170480,_0xf1ca('0x22'),JSON[_0xf1ca('0x23')](_0xce3266));if(_0xce3266[_0xf1ca('0x24')]){if(_0xce3266[_0xf1ca('0x24')]['code']===0x1f4){logger[_0xf1ca('0x24')](_0xf1ca('0x25'),_0x170480,_0xce3266['error'][_0xf1ca('0x26')]);return _0x23aade(_0xce3266[_0xf1ca('0x24')]['message']);}logger['error'](_0xf1ca('0x25'),_0x170480,_0xce3266[_0xf1ca('0x24')]['message']);return _0xe3a65e(_0xce3266[_0xf1ca('0x24')][_0xf1ca('0x26')]);}else{logger[_0xf1ca('0x1f')](_0xf1ca('0x25'),_0x170480,_0xf1ca('0x22'));_0xe3a65e(_0xce3266[_0xf1ca('0x27')][_0xf1ca('0x26')]);}})['catch'](function(_0x400e0c){logger[_0xf1ca('0x24')](_0xf1ca('0x25'),_0x170480,_0x400e0c);_0x23aade(_0x400e0c);});});}function saveUpdates(_0x37bf87){return function(_0x3f8e13){if(_0x3f8e13){return _0x3f8e13[_0xf1ca('0x28')](_0x37bf87)[_0xf1ca('0x1e')](function(_0x56e5e1){if(_0x56e5e1['role']==='agent'){socket[_0xf1ca('0x29')](_0xf1ca('0x2a')+_0x56e5e1['id'],_0x56e5e1);}return _0x56e5e1;});}return null;};}function removeEntity(_0x3af401,_0x11c565){return function(_0x226f2f){if(_0x226f2f){return _0x226f2f[_0xf1ca('0x2b')]({'transaction':_0x11c565})[_0xf1ca('0x1e')](function(){var _0x5aeff0=_0x226f2f[_0xf1ca('0x2c')]({'plain':!![]});if(_0x5aeff0['role']==='admin')return;var _0x1b88e8=[{'name':'Users','value':_0xf1ca('0x2d'),'ignore':!![]},{'name':'Agents','value':_0xf1ca('0x2e'),'ignore':![]},{'name':_0xf1ca('0x2f'),'value':_0xf1ca('0x30'),'ignore':![]}];var _0x2a7ff7=_(_0x1b88e8)[_0xf1ca('0x31')](_0xf1ca('0x32'))[_0xf1ca('0x33')]('value')[_0xf1ca('0x34')]();if(_['includes'](_0x2a7ff7,_0x5aeff0['role'])){return;}var _0x26cd33=_[_0xf1ca('0x35')](_0x1b88e8,[_0xf1ca('0x34'),_0x5aeff0[_0xf1ca('0x36')]])[_0xf1ca('0x37')];return db['UserProfileResource'][_0xf1ca('0x2b')]({'where':{'type':_0x26cd33,'resourceId':_0x5aeff0['id']},'transaction':_0x11c565})[_0xf1ca('0x1e')](function(){return _0x226f2f;});})['then'](function(){_0x3af401['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x439ab7){return function(_0x222c92){if(!_0x222c92){_0x439ab7[_0xf1ca('0x15')](0x194);}return _0x222c92;};}function handleError(_0x4d169f,_0x469f26){_0x469f26=_0x469f26||0x1f4;return function(_0x94580c){logger[_0xf1ca('0x24')](_0x94580c[_0xf1ca('0x38')]);if(_0x94580c[_0xf1ca('0x37')]){delete _0x94580c[_0xf1ca('0x37')];}_0x4d169f[_0xf1ca('0x16')](_0x469f26)[_0xf1ca('0x39')](_0x94580c);};}function getUserAttributes(){return _(db[_0xf1ca('0x3a')][_0xf1ca('0x3b')])[_0xf1ca('0x33')](function(_0x341791){return{'name':_0x341791[_0xf1ca('0x3c')],'type':_0x341791[_0xf1ca('0x3d')][_0xf1ca('0x3e')]};})[_0xf1ca('0x31')](function(_0x1bb520){return![_0xf1ca('0x3f'),_0xf1ca('0x40'),'previousPasswords',_0xf1ca('0x41'),_0xf1ca('0x42'),_0xf1ca('0x43')][_0xf1ca('0x44')](_0x1bb520[_0xf1ca('0x37')]);})[_0xf1ca('0x34')]();}exports[_0xf1ca('0x45')]=function(_0x43e478,_0x49d66d){var _0x55438b={},_0x5ca319={'count':0x0,'rows':[]};var _0x52f9db=getUserAttributes();_0x55438b=qs[_0xf1ca('0x46')](_0x52f9db,_0x43e478);var _0x14803a={'where':_0x55438b['where']};return db[_0xf1ca('0x3a')]['count'](_0x14803a)['then'](function(_0x139821){_0x5ca319[_0xf1ca('0x1a')]=_0x139821;if(_0x43e478[_0xf1ca('0x47')][_0xf1ca('0x48')]){_0x55438b[_0xf1ca('0x49')]=[{'all':!![]}];}if(_0x43e478[_0xf1ca('0x47')][_0xf1ca('0x4a')]==='true'){_0x55438b['include']=[{'model':db[_0xf1ca('0x4b')],'as':'userSetting'}];}if(!_[_0xf1ca('0x44')](_0x55438b[_0xf1ca('0x4c')],'id')){_0x55438b[_0xf1ca('0x4c')][_0xf1ca('0x4d')]('id');}return db[_0xf1ca('0x3a')]['findAll'](_0x55438b);})['then'](function(_0x535765){_0x5ca319[_0xf1ca('0x4e')]=_0x535765;if(_0x43e478[_0xf1ca('0x47')][_0xf1ca('0x4f')]===_0xf1ca('0x50')){var _0x5957a4=[];for(var _0xd187f5=0x0;_0xd187f5<_0x5ca319[_0xf1ca('0x4e')][_0xf1ca('0x51')];_0xd187f5++){_0x5957a4[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x52'),_0x5ca319[_0xf1ca('0x4e')][_0xd187f5][_0xf1ca('0x53')]));_0x5957a4[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x54'),_0x5ca319[_0xf1ca('0x4e')][_0xd187f5][_0xf1ca('0x53')]));_0x5957a4[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x55'),_0x5ca319[_0xf1ca('0x4e')][_0xd187f5]['dataValues']));_0x5957a4[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x56'),_0x5ca319[_0xf1ca('0x4e')][_0xd187f5][_0xf1ca('0x53')]));_0x5957a4['push'](get_open_tabs(_0xf1ca('0x57'),_0x5ca319[_0xf1ca('0x4e')][_0xd187f5][_0xf1ca('0x53')]));_0x5957a4[_0xf1ca('0x4d')](get_open_tabs('whatsapp',_0x5ca319[_0xf1ca('0x4e')][_0xd187f5]['dataValues']));}return Promise[_0xf1ca('0x58')](_0x5957a4)[_0xf1ca('0x1e')](function(){return _0x5ca319;});}else{return _0x5ca319;}})[_0xf1ca('0x1e')](respondWithFilteredResult(_0x49d66d,_0x55438b))[_0xf1ca('0x59')](handleError(_0x49d66d,null));};exports[_0xf1ca('0x5a')]=function(_0x5837c3,_0x3d824c){var _0xd181c3=getUserAttributes();_0x5837c3[_0xf1ca('0x47')]['id']=_0x5837c3[_0xf1ca('0x5b')]['id'];var _0x33be46=qs[_0xf1ca('0x46')](_0xd181c3,_0x5837c3);if(_0x5837c3['query'][_0xf1ca('0x48')]){_0x33be46[_0xf1ca('0x49')]=[{'all':!![]}];}if(_0x5837c3['query'][_0xf1ca('0x4a')]===_0xf1ca('0x50')){_0x33be46['include']=[{'model':db[_0xf1ca('0x4b')],'as':_0xf1ca('0x4a')}];}_0x33be46=_[_0xf1ca('0x5c')]({},_0x33be46,_0x5837c3[_0xf1ca('0x5d')]);if(!_['includes'](_0x33be46[_0xf1ca('0x4c')],'id')){_0x33be46[_0xf1ca('0x4c')][_0xf1ca('0x4d')]('id');}return db[_0xf1ca('0x3a')][_0xf1ca('0x35')](_0x33be46)[_0xf1ca('0x1e')](handleEntityNotFound(_0x3d824c,null))[_0xf1ca('0x1e')](function(_0x40c471){var _0x5b72af=[];values=_0x40c471;if(_0x5837c3[_0xf1ca('0x47')][_0xf1ca('0x4f')]===_0xf1ca('0x50')){_0x5b72af['push'](get_open_tabs(_0xf1ca('0x52'),_0x40c471['dataValues']));_0x5b72af[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x54'),_0x40c471[_0xf1ca('0x53')]));_0x5b72af[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x57'),_0x40c471[_0xf1ca('0x53')]));_0x5b72af[_0xf1ca('0x4d')](get_open_tabs('whatsapp',_0x40c471[_0xf1ca('0x53')]));_0x5b72af[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x55'),_0x40c471['dataValues']));_0x5b72af['push'](get_open_tabs('mail',_0x40c471[_0xf1ca('0x53')]));return Promise[_0xf1ca('0x58')](_0x5b72af);}else{return values;}})[_0xf1ca('0x1e')](function(){return values;})['then'](respondWithResult(_0x3d824c,null))[_0xf1ca('0x59')](handleError(_0x3d824c,null));};exports['update']=function(_0x1b4237,_0x34655c){if(_0x1b4237[_0xf1ca('0x5e')]['id']){delete _0x1b4237['body']['id'];}delete _0x1b4237['body']['role'];return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x1b4237['params']['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x34655c,null))[_0xf1ca('0x1e')](saveUpdates(_0x1b4237[_0xf1ca('0x5e')],null))[_0xf1ca('0x1e')](respondWithResult(_0x34655c,null))[_0xf1ca('0x59')](handleError(_0x34655c,null));};exports[_0xf1ca('0x5f')]=function(_0x588c45,_0x5e4bc0){return db['User'][_0xf1ca('0x5f')]()[_0xf1ca('0x1e')](respondWithResult(_0x5e4bc0,null))[_0xf1ca('0x59')](handleError(_0x5e4bc0,null));};exports[_0xf1ca('0x60')]=function(_0x53f66a,_0x585f00){return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x53f66a[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x585f00,null))[_0xf1ca('0x1e')](function(_0x5b8c51){if(_0x5b8c51){return _0x5b8c51[_0xf1ca('0x60')](_0x53f66a[_0xf1ca('0x5e')][_0xf1ca('0x61')],_[_0xf1ca('0x62')](_0x53f66a[_0xf1ca('0x5e')],[_0xf1ca('0x61'),'id'])||{});}})[_0xf1ca('0x1e')](respondWithResult(_0x585f00,null))[_0xf1ca('0x59')](handleError(_0x585f00,null));};function validateUser(_0x225316){return new Promise(function(_0x41743f,_0x50a470){if(_0x225316[_0xf1ca('0x63')])return _0x41743f(_0x225316);return db[_0xf1ca('0x64')]['findById'](0x1)[_0xf1ca('0x1e')](function(_0x3c27b8){if(_0x3c27b8[_0xf1ca('0x65')])authService['validatePasswordPattern'](_0x225316['password']);db['User'][_0xf1ca('0x66')](_0xf1ca('0x63'))[_0xf1ca('0x1e')](function(_0x4e5515){if(_[_0xf1ca('0x67')](_0x4e5515)){_0x225316[_0xf1ca('0x63')]=_0x3c27b8['min_internal']||0x1;return;}if(_[_0xf1ca('0x67')](_0x3c27b8[_0xf1ca('0x68')])||_0x3c27b8['min_internal']===_0x4e5515){_0x225316[_0xf1ca('0x63')]=_0x4e5515+0x1;return;}if(_0x3c27b8[_0xf1ca('0x68')]>_0x4e5515){_0x225316[_0xf1ca('0x63')]=_0x3c27b8[_0xf1ca('0x68')];return;}return db[_0xf1ca('0x69')][_0xf1ca('0x47')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xf1ca('0x69')][_0xf1ca('0x6a')][_0xf1ca('0x6b')]})['then'](function(_0x4fc85e){if(_0x4fc85e&&_0x4fc85e[_0xf1ca('0x51')]){for(var _0x78946=0x0,_0x2de599=_0x4fc85e[_0xf1ca('0x51')];_0x78946<_0x2de599&&_['isNil'](_0x225316[_0xf1ca('0x63')]);_0x78946++){if(_0x3c27b8[_0xf1ca('0x68')]<=_0x4fc85e[_0x78946]['from']){_0x225316['internal']=_0x4fc85e[_0x78946][_0xf1ca('0x6c')];}else if(_0x3c27b8['min_internal']>_0x4fc85e[_0x78946][_0xf1ca('0x6c')]&&_0x3c27b8[_0xf1ca('0x68')]<=_0x4fc85e[_0x78946]['to']){_0x225316[_0xf1ca('0x63')]=_0x3c27b8[_0xf1ca('0x68')];}}}if(_['isNil'](_0x225316[_0xf1ca('0x63')])){_0x225316['internal']=_0x4e5515+0x1;}return _0x41743f(_0x225316);});});})[_0xf1ca('0x59')](function(_0x3a8ab4){_0x50a470(_0x3a8ab4);});});}function updateUser(_0x295bf9){return new Promise(function(_0x1a715a,_0x4ec2f2){try{if(_0x295bf9[_0xf1ca('0x6d')]){_0x295bf9[_0xf1ca('0x6e')]=_0x295bf9[_0xf1ca('0x63')];_0x295bf9[_0xf1ca('0x6f')]={'mailbox':_0x295bf9[_0xf1ca('0x63')],'password':_0x295bf9[_0xf1ca('0x3f')],'fullname':_0x295bf9['fullname'],'email':_0x295bf9[_0xf1ca('0x70')]};}if(_0x295bf9[_0xf1ca('0x36')]===_0xf1ca('0x2e')){if(!_0x295bf9['permissions'])_0x295bf9[_0xf1ca('0x71')]=[_0xf1ca('0x72'),_0xf1ca('0x73'),'103',_0xf1ca('0x74'),'110',_0xf1ca('0x75'),_0xf1ca('0x76'),_0xf1ca('0x77'),_0xf1ca('0x78'),_0xf1ca('0x79'),_0xf1ca('0x7a'),_0xf1ca('0x7b'),_0xf1ca('0x7c'),_0xf1ca('0x7d'),'115'];}_0x1a715a(_0x295bf9);}catch(_0xef4d38){_0x4ec2f2(_0xef4d38);}});}exports[_0xf1ca('0x7e')]=function(_0xe10cba,_0x4748dc){if(_0xe10cba[_0xf1ca('0x2d')][_0xf1ca('0x36')]===_0xf1ca('0x2e'))throw new Error(_0xf1ca('0x7f'));if(_0xe10cba[_0xf1ca('0x5e')][_0xf1ca('0x36')]===_0xf1ca('0x2d')&&_0xe10cba[_0xf1ca('0x2d')][_0xf1ca('0x36')]!==_0xf1ca('0x80')){throw new Error(_0xf1ca('0x81'));}if(_0xe10cba[_0xf1ca('0x5e')][_0xf1ca('0x36')]===_0xf1ca('0x80')&&_0xe10cba['user'][_0xf1ca('0x36')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xf1ca('0x82')]([_0xe10cba[_0xf1ca('0x5e')]])[_0xf1ca('0x1e')](function(){return validateUser(_0xe10cba[_0xf1ca('0x5e')]);})[_0xf1ca('0x1e')](function(_0x5f5591){return updateUser(_0x5f5591)[_0xf1ca('0x1e')](function(_0x2dc695){if(_0x2dc695['role']===_0xf1ca('0x80')){_0x2dc695[_0xf1ca('0x83')]=_0xe10cba[_0xf1ca('0x2d')][_0xf1ca('0x83')];delete _0x2dc695[_0xf1ca('0x84')];}return _0x2dc695;});})[_0xf1ca('0x1e')](function(_0x280821){return db[_0xf1ca('0x3a')]['create'](_0x280821,{'include':[{'model':db[_0xf1ca('0x6f')],'as':_0xf1ca('0x6f')}]});})[_0xf1ca('0x1e')](function(_0x59391a){if(_0xe10cba[_0xf1ca('0x5e')][_0xf1ca('0x36')]===_0xf1ca('0x2d'))return _0x59391a;if(_0xe10cba[_0xf1ca('0x2d')][_0xf1ca('0x36')]!==_0xf1ca('0x2d'))return _0x59391a;return db['UserProfileSection'][_0xf1ca('0x35')]({'where':{'name':_0x59391a[_0xf1ca('0x36')]==='agent'?_0xf1ca('0x85'):_0xf1ca('0x2f'),'userProfileId':_0xe10cba[_0xf1ca('0x2d')][_0xf1ca('0x84')]},'raw':!![]})['then'](function(_0x1cdce3){if(!_0x1cdce3||_0x1cdce3['autoAssociation']!=0x0)return _0x59391a;return db[_0xf1ca('0x86')][_0xf1ca('0x7e')]({'name':_0x59391a[_0xf1ca('0x37')],'resourceId':_0x59391a['id'],'type':_0x1cdce3[_0xf1ca('0x37')],'sectionId':_0x1cdce3['id']},{})['then'](function(){return _0x59391a;});})[_0xf1ca('0x59')](function(_0x4fd6e3){logger[_0xf1ca('0x24')](_0xf1ca('0x87'),_0x4fd6e3);throw _0x4fd6e3;});})['then'](respondWithResult(_0x4748dc,0xc9))[_0xf1ca('0x59')](handleError(_0x4748dc,null));};exports[_0xf1ca('0x88')]=function(_0x4d35ea,_0x47d64c){var _0x1f1147=_0x4d35ea[_0xf1ca('0x5e')];var _0x55d6f6=[];if(_0x4d35ea[_0xf1ca('0x2d')][_0xf1ca('0x36')]===_0xf1ca('0x2e'))throw new Error('Unauthorized');if(_[_0xf1ca('0x89')](_0x1f1147,[_0xf1ca('0x36'),_0xf1ca('0x2d')])&&_0x4d35ea[_0xf1ca('0x2d')][_0xf1ca('0x36')]!==_0xf1ca('0x80')){throw new Error(_0xf1ca('0x81'));}if(_[_0xf1ca('0x89')](_0x1f1147,[_0xf1ca('0x36'),_0xf1ca('0x80')])&&_0x4d35ea[_0xf1ca('0x2d')][_0xf1ca('0x36')]!==_0xf1ca('0x80')){throw new Error(_0xf1ca('0x8a'));}return licenseUtil[_0xf1ca('0x82')](_0x1f1147)['then'](function(){return validateUser(_0x1f1147[0x0]);})[_0xf1ca('0x1e')](function(){for(var _0x503552=0x1;_0x503552<_0x1f1147[_0xf1ca('0x51')];_0x503552++){var _0x158126=_0x1f1147[_0x503552-0x1][_0xf1ca('0x63')];if(!_0x1f1147[_0x503552][_0xf1ca('0x63')])_0x1f1147[_0x503552]['internal']=_0x158126+0x1;_0x55d6f6[_0xf1ca('0x4d')](validateUser(_0x1f1147[_0x503552]));}return Promise[_0xf1ca('0x58')](_0x55d6f6);})['then'](function(){_0x55d6f6=[];for(var _0x3309a8=0x0;_0x3309a8<_0x1f1147[_0xf1ca('0x51')];_0x3309a8++){_0x55d6f6[_0xf1ca('0x4d')](updateUser(_0x1f1147[_0x3309a8]));}return Promise[_0xf1ca('0x58')](_0x55d6f6);})['then'](function(){_0x55d6f6=_0x1f1147[_0xf1ca('0x33')](function(_0x1dc05e){return db[_0xf1ca('0x3a')][_0xf1ca('0x7e')](_0x1dc05e,{'include':[{'model':db[_0xf1ca('0x6f')],'as':_0xf1ca('0x6f')}]})['then'](function(_0x21a2df){_0x1dc05e['id']=_0x21a2df['id'];return _0x1dc05e;});});return Promise[_0xf1ca('0x58')](_0x55d6f6);})[_0xf1ca('0x1e')](function(_0x23cd70){if(_0x4d35ea['body'][_0xf1ca('0x36')]==='user')return _0x23cd70;if(_0x4d35ea[_0xf1ca('0x2d')]['role']!=='user')return _0x23cd70;var _0x18da82=_[_0xf1ca('0x89')](_0x23cd70,function(_0x193ce1){return _0x193ce1[_0xf1ca('0x36')]==='agent'||_0x193ce1[_0xf1ca('0x36')]==='telephone';});if(!_0x18da82)return _0x23cd70;return db[_0xf1ca('0x8b')]['findAll']({'where':{'name':{'$or':[_0xf1ca('0x85'),_0xf1ca('0x2f')]},'userProfileId':_0x4d35ea['user'][_0xf1ca('0x84')]},'raw':!![]})[_0xf1ca('0x1e')](function(_0xb6bc7c){if(_['isEmpty'](_0xb6bc7c)||!_[_0xf1ca('0x89')](_0xb6bc7c,[_0xf1ca('0x8c'),0x0]))return _0x23cd70;_0x55d6f6=[];var _0x5d68df=_(_0xb6bc7c)['map'](function(_0x564342){if(_0x564342['autoAssociation']===0x1)return;return _0x564342['name']===_0xf1ca('0x85')?_0xf1ca('0x2e'):_0xf1ca('0x30');})[_0xf1ca('0x8d')]()[_0xf1ca('0x34')]();for(var _0x29795f=0x0;_0x29795f<_0x23cd70[_0xf1ca('0x51')];_0x29795f++){if(!_[_0xf1ca('0x44')](_0x5d68df,_0x23cd70[_0x29795f]['role']))return;var _0x2ea5fa=_0x23cd70[_0x29795f]['role']===_0xf1ca('0x2e')?'Agents':_0xf1ca('0x2f');_0x55d6f6['push'](db[_0xf1ca('0x86')][_0xf1ca('0x7e')]({'name':_0x23cd70[_0x29795f][_0xf1ca('0x37')],'resourceId':_0x23cd70[_0x29795f]['id'],'type':_0x2ea5fa,'sectionId':_[_0xf1ca('0x35')](_0xb6bc7c,[_0xf1ca('0x37'),_0x2ea5fa])['id']},{}));}return Promise[_0xf1ca('0x58')](_0x55d6f6);});})[_0xf1ca('0x1e')](respondWithResult(_0x47d64c,0xc9))[_0xf1ca('0x59')](handleError(_0x47d64c,null));};exports['changePassword']=function(_0x27ef2c,_0x32a858){if(_0x27ef2c[_0xf1ca('0x5e')]['id']){delete _0x27ef2c[_0xf1ca('0x5e')]['id'];}return db['User'][_0xf1ca('0x35')]({'where':{'id':_0x27ef2c['params']['id']}})[_0xf1ca('0x1e')](function(_0x22b3ec){if(!_0x22b3ec)return null;if(_0x22b3ec['id']===_0x27ef2c[_0xf1ca('0x2d')]['id']){if(!_0x27ef2c['body']['oldPassword']||!_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')]){throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x22b3ec[_0xf1ca('0x91')](_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x92')])){throw new db['Sequelize'][(_0xf1ca('0x90'))](_0xf1ca('0x93'));}if(_0x27ef2c[_0xf1ca('0x5e')]['oldPassword']===_0x27ef2c[_0xf1ca('0x5e')]['newPassword']){throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x27ef2c['user']['role']===_0xf1ca('0x80')){if(!_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')]){throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x27ef2c[_0xf1ca('0x2d')]['role']==='user'){if(!_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x22b3ec[_0xf1ca('0x36')]!==_0xf1ca('0x2e')){throw new db['Sequelize'][(_0xf1ca('0x90'))](_0xf1ca('0x7f'));}}else{throw new db[(_0xf1ca('0x8f'))]['ValidationError'](_0xf1ca('0x7f'));}return _0x22b3ec;})[_0xf1ca('0x1e')](handleEntityNotFound(_0x32a858,null))[_0xf1ca('0x1e')](function(_0x54ad55){return db[_0xf1ca('0x64')]['findOne']({'attributes':['id',_0xf1ca('0x65'),_0xf1ca('0x94'),_0xf1ca('0x95')]})[_0xf1ca('0x1e')](function(_0x30d245){if(_0x30d245['securePassword'])authService[_0xf1ca('0x96')](_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')]);if(!_0x30d245['enforcePasswordHistory']||!_0x54ad55[_0xf1ca('0x97')])return _0x54ad55;authService[_0xf1ca('0x98')](_0x27ef2c[_0xf1ca('0x5e')]['newPassword'],_0x54ad55[_0xf1ca('0x97')],_0x30d245[_0xf1ca('0x95')]);return _0x54ad55;})[_0xf1ca('0x1e')](saveUpdates({'password':_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')],'passwordResetAt':_0x27ef2c[_0xf1ca('0x2d')]['id']==_0x27ef2c['params']['id']?moment():null,'previousPasswords':authService[_0xf1ca('0x99')](_0x27ef2c[_0xf1ca('0x5e')][_0xf1ca('0x8e')],_0x54ad55['previousPasswords'])},null));})[_0xf1ca('0x1e')](respondWithResult(_0x32a858,null))[_0xf1ca('0x59')](handleError(_0x32a858,null));};exports[_0xf1ca('0x9a')]=function(_0x8ebd90,_0x38b897){var _0x74c9bc=_0x8ebd90[_0xf1ca('0x5e')]['channel'];return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x8ebd90[_0xf1ca('0x5b')]['id']},'attributes':['id',_0xf1ca('0x37'),'role',_0xf1ca('0x9b'),_0xf1ca('0x9c'),_0xf1ca('0x9d'),_0xf1ca('0x9e')]})['then'](handleEntityNotFound(_0x38b897,null))[_0xf1ca('0x1e')](function(_0x3ead93){if(_0x3ead93){if(!utils['isValidChannel'](_0x74c9bc)){throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))]('Unknown\x20channel');}return _0x3ead93['add'+_[_0xf1ca('0x9f')](_0x74c9bc[_0xf1ca('0xa0')]())+_0xf1ca('0xa1')](_0x8ebd90[_0xf1ca('0x5e')][_0xf1ca('0x61')],{'penalty':_0x8ebd90['body'][_0xf1ca('0xa2')]||0x0})[_0xf1ca('0xa3')](function(_0xbac2ed){for(var _0x30d72f=0x0;_0x30d72f<_0x8ebd90['body'][_0xf1ca('0x61')][_0xf1ca('0x51')];_0x30d72f+=0x1){var _0x1a99ac={'UserId':Number(_0x8ebd90[_0xf1ca('0x5b')]['id'])};_0x1a99ac[_[_0xf1ca('0x9f')](_0x74c9bc[_0xf1ca('0xa0')]())+'QueueId']=Number(_0x8ebd90[_0xf1ca('0x5e')][_0xf1ca('0x61')][_0x30d72f]);socket[_0xf1ca('0x29')](_0xf1ca('0x2d')+_['capitalize'](_0x74c9bc[_0xf1ca('0xa0')]())+_0xf1ca('0xa4'),_0x1a99ac);}return _0xbac2ed;})[_0xf1ca('0x1e')](function(){if(_0x74c9bc==='voice'){return db[_0xf1ca('0xa5')]['findAll']({'where':{'id':_0x8ebd90[_0xf1ca('0x5e')]['ids']||[]},'raw':!![],'attributes':['id',_0xf1ca('0x37')]});}})[_0xf1ca('0x1e')](function(_0x942289){var _0x4622e9=_0x3ead93[_0xf1ca('0x2c')]({'plain':!![]});var _0x5a0b5c=[];if(_0x74c9bc===_0xf1ca('0xa6')&&_0x4622e9[_0xf1ca('0x36')]===_0xf1ca('0x2e')&&_0x4622e9['online']){for(let _0x540ed1=0x0;_0x540ed1<_0x942289[_0xf1ca('0x51')];_0x540ed1+=0x1){_0x5a0b5c['push']({'membername':_0x4622e9[_0xf1ca('0x37')],'UserId':_0x4622e9['id'],'queue_name':_0x942289[_0x540ed1][_0xf1ca('0x37')],'VoiceQueueId':_0x942289[_0x540ed1]['id'],'interface':_[_0xf1ca('0x67')](_0x4622e9[_0xf1ca('0x9e')])?util[_0xf1ca('0xa7')](_0xf1ca('0xa8'),_0x4622e9[_0xf1ca('0x37')]):_0x4622e9[_0xf1ca('0x9e')],'paused':_0x4622e9[_0xf1ca('0x9d')]||![],'penalty':_0x8ebd90[_0xf1ca('0x5e')][_0xf1ca('0xa2')]||0x0});}return Promise[_0xf1ca('0x58')](_0x5a0b5c['map'](function(_0x303070){return db[_0xf1ca('0xa9')][_0xf1ca('0xaa')](_0x303070);}));}return _0x3ead93;});}})[_0xf1ca('0x1e')](respondWithStatusCode(_0x38b897,null))[_0xf1ca('0x59')](handleError(_0x38b897,null));};exports['removeQueues']=function(_0x2b7aed,_0x339ebc){var _0x14a3b8,_0x45d65b;return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x2b7aed['params']['id']},'attributes':['id','name',_0xf1ca('0x36')]})[_0xf1ca('0x1e')](handleEntityNotFound(_0x339ebc,null))[_0xf1ca('0x1e')](function(_0x46fea9){if(_0x46fea9){_0x14a3b8=_0x46fea9;if(!_0x2b7aed['query'][_0xf1ca('0xab')]||!utils['isValidChannel'](_0x2b7aed[_0xf1ca('0x47')]['channel'])){throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))](_0xf1ca('0xac'));}return _0x46fea9[_0xf1ca('0xad')+_[_0xf1ca('0x9f')](_0x2b7aed['query'][_0xf1ca('0xab')]['toLowerCase']())+_0xf1ca('0xa1')](_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0x61')]);}})[_0xf1ca('0x1e')](function(_0x5757e5){if(_[_0xf1ca('0xae')](_0x2b7aed[_0xf1ca('0x47')]['ids'])){for(var _0x4dc72f=0x0;_0x4dc72f<_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0x61')][_0xf1ca('0x51')];_0x4dc72f+=0x1){_0x45d65b={'UserId':Number(_0x2b7aed['params']['id'])};_0x45d65b[_[_0xf1ca('0x9f')](_0x2b7aed['query'][_0xf1ca('0xab')]['toLowerCase']())+_0xf1ca('0xaf')]=Number(_0x2b7aed['query'][_0xf1ca('0x61')][_0x4dc72f]);socket['emit'](_0xf1ca('0x2d')+_['capitalize'](_0x2b7aed['query'][_0xf1ca('0xab')][_0xf1ca('0xa0')]())+'Queue:remove',_0x45d65b);}}else{_0x45d65b={'UserId':Number(_0x2b7aed[_0xf1ca('0x5b')]['id'])};_0x45d65b[_[_0xf1ca('0x9f')](_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0xab')][_0xf1ca('0xa0')]())+_0xf1ca('0xaf')]=Number(_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0x61')]);socket[_0xf1ca('0x29')](_0xf1ca('0x2d')+_[_0xf1ca('0x9f')](_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0xab')][_0xf1ca('0xa0')]())+_0xf1ca('0xb0'),_0x45d65b);}return _0x5757e5;})[_0xf1ca('0x1e')](function(){if(_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0xab')]===_0xf1ca('0xa6')){return db[_0xf1ca('0xa9')][_0xf1ca('0x2b')]({'where':{'UserId':_0x2b7aed[_0xf1ca('0x5b')]['id'],'VoiceQueueId':_0x2b7aed[_0xf1ca('0x47')][_0xf1ca('0x61')]},'individualHooks':!![]})[_0xf1ca('0x1e')](function(){return _0x14a3b8;});}return _0x14a3b8;})[_0xf1ca('0x1e')](respondWithStatusCode(_0x339ebc,null))[_0xf1ca('0x59')](handleError(_0x339ebc,null));};exports['addAvatar']=function(_0x4adf4e,_0x19c983){_0x4adf4e[_0xf1ca('0x5e')][_0xf1ca('0xb1')]=_0x4adf4e[_0xf1ca('0xb2')][_0xf1ca('0xb3')];return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x4adf4e[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x19c983,null))[_0xf1ca('0x1e')](saveUpdates(_0x4adf4e[_0xf1ca('0x5e')],null))[_0xf1ca('0x1e')](respondWithResult(_0x19c983,null))[_0xf1ca('0x59')](handleError(_0x19c983,null));};exports[_0xf1ca('0xb4')]=function(_0x1c6080,_0x4f419a){var _0x20e1cc=path[_0xf1ca('0xb5')](config[_0xf1ca('0xb6')],_0xf1ca('0xb7'));return db[_0xf1ca('0x3a')]['find']({'where':{'id':_0x1c6080[_0xf1ca('0x5b')]['id']},'attributes':['id',_0xf1ca('0xb1')],'raw':!![]})['then'](handleEntityNotFound(_0x4f419a,null))[_0xf1ca('0x1e')](function(_0x55f7fe){if(_0x55f7fe){if(_[_0xf1ca('0x67')](_0x55f7fe['userpic'])){return _0x4f419a[_0xf1ca('0xb8')](_0x20e1cc);}else{if(!fs[_0xf1ca('0xb9')](path[_0xf1ca('0xb5')](config[_0xf1ca('0xb6')],_0xf1ca('0xba'),_0x55f7fe['userpic']))){return _0x4f419a[_0xf1ca('0xb8')](_0x20e1cc);}return _0x4f419a[_0xf1ca('0xb8')](path[_0xf1ca('0xb5')](config[_0xf1ca('0xb6')],_0xf1ca('0xba'),_0x55f7fe['userpic']));}}})[_0xf1ca('0x59')](handleError(_0x4f419a,null));};exports[_0xf1ca('0xbb')]=function(_0x5b0f8d,_0x4dd03b){return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x5b0f8d[_0xf1ca('0x5b')]['id']},'attributes':['id']})[_0xf1ca('0x1e')](handleEntityNotFound(_0x4dd03b,null))[_0xf1ca('0x1e')](function(_0x1a2fcf){var _0x6b01a=[];values=_0x1a2fcf[_0xf1ca('0x53')];_0x6b01a[_0xf1ca('0x4d')](get_open_tabs('chat',_0x1a2fcf[_0xf1ca('0x53')]));_0x6b01a['push'](get_open_tabs(_0xf1ca('0x54'),_0x1a2fcf[_0xf1ca('0x53')]));_0x6b01a[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x57'),_0x1a2fcf['dataValues']));_0x6b01a[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0xbc'),_0x1a2fcf[_0xf1ca('0x53')]));_0x6b01a[_0xf1ca('0x4d')](get_open_tabs(_0xf1ca('0x55'),_0x1a2fcf['dataValues']));_0x6b01a[_0xf1ca('0x4d')](get_open_tabs('mail',_0x1a2fcf['dataValues']));return Promise[_0xf1ca('0x58')](_0x6b01a);})[_0xf1ca('0x1e')](function(_0x1931f5){if(_0x1931f5){var _0x4da23c=_[_0xf1ca('0x33')](values['ChatOpenTabs'],function(_0x3076a3){return{'channel':_0xf1ca('0xbd'),'id':_0x3076a3['id'],'createdAt':_0x3076a3[_0xf1ca('0xbe')]};});var _0x5cc57f=_[_0xf1ca('0x33')](values[_0xf1ca('0xbf')],function(_0x479616){return{'channel':_0xf1ca('0xc0'),'id':_0x479616['id'],'createdAt':_0x479616[_0xf1ca('0xbe')]};});var _0x4b3316=_['map'](values[_0xf1ca('0xc1')],function(_0x111277){return{'channel':_0xf1ca('0xc2'),'id':_0x111277['id'],'createdAt':_0x111277[_0xf1ca('0xbe')]};});var _0x3e4b85=_[_0xf1ca('0x33')](values[_0xf1ca('0xc3')],function(_0x4e62f4){return{'channel':_0xf1ca('0xc4'),'id':_0x4e62f4['id'],'createdAt':_0x4e62f4[_0xf1ca('0xbe')]};});var _0x3af186=_[_0xf1ca('0x33')](values[_0xf1ca('0xc5')],function(_0x26a60c){return{'channel':_0xf1ca('0xc6'),'id':_0x26a60c['id'],'createdAt':_0x26a60c[_0xf1ca('0xbe')]};});var _0x542fb1=_['map'](values[_0xf1ca('0xc7')],function(_0x29c3ae){return{'channel':'WHATSAPP','id':_0x29c3ae['id'],'createdAt':_0x29c3ae['createdAt']};});var _0x22e8fc=_[_0xf1ca('0xc8')](_0x4da23c,_0x5cc57f,_0x4b3316,_0x3e4b85,_0x3af186,_0x542fb1);var _0x12343e={'count':_0x22e8fc[_0xf1ca('0x51')],'rows':_0x22e8fc};return _0x12343e;}else return null;})[_0xf1ca('0x1e')](respondWithResult(_0x4dd03b,null))[_0xf1ca('0x59')](handleError(_0x4dd03b,null));};exports[_0xf1ca('0xc9')]=function(_0x519323,_0x2ae5cd){var _0x5d71af={};return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0x519323[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](function(_0xce3059){if(!_0xce3059){throw new APINotFoundError(util[_0xf1ca('0xa7')](_0xf1ca('0xca'),_0x519323[_0xf1ca('0x5b')]['id']));}return contacts[_0xf1ca('0x5f')]();})[_0xf1ca('0x1e')](function(_0x1ba4bf){_0x519323['query'][_0xf1ca('0x3a')]=_0x519323['params']['id'];_0x5d71af=qs[_0xf1ca('0x46')](_0x1ba4bf,_0x519323);if(_0x519323['query']['hasOwnProperty'](_0xf1ca('0x48'))){_0x5d71af[_0xf1ca('0x49')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xf1ca('0xcb')],'as':_0xf1ca('0xcc'),'attributes':['id',_0xf1ca('0x37'),_0xf1ca('0xcd')],'where':_0x519323[_0xf1ca('0x47')][_0xf1ca('0xce')]?{'id':_0x519323[_0xf1ca('0x47')][_0xf1ca('0xce')]}:undefined,'required':_0x519323[_0xf1ca('0x47')][_0xf1ca('0xce')]?!![]:![]}];}return contacts['findAll'](_0x519323[_0xf1ca('0x47')],_0x519323[_0xf1ca('0x2d')],_0x5d71af,_0x1ba4bf);})[_0xf1ca('0x1e')](respondWithFilteredResult(_0x2ae5cd,_0x5d71af))['catch'](APIHandleError(_0x2ae5cd));};exports[_0xf1ca('0xcf')]=function(_0x46e4d2,_0x4ab835){var _0x398306;var _0x2ab94b={};var _0x2d29fc;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x46e4d2[_0xf1ca('0x5b')]['id']},'attributes':['id',_0xf1ca('0x37'),_0xf1ca('0x36')]})[_0xf1ca('0x1e')](handleEntityNotFound(_0x4ab835,null))[_0xf1ca('0x1e')](function(_0x2a83ca){if(!utils[_0xf1ca('0xd1')](_0x46e4d2[_0xf1ca('0x47')]['channel'])){throw new db['Sequelize'][(_0xf1ca('0x90'))](_0xf1ca('0xac'));}_0x398306=_0x2a83ca;var _0x5bdd6d={};_0x5bdd6d[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_[_0xf1ca('0x9f')](_0x46e4d2[_0xf1ca('0x47')]['channel'])+_0xf1ca('0xd4')][_0xf1ca('0x3b')]);_0x5bdd6d[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x46e4d2['query']);_0x5bdd6d[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x5bdd6d[_0xf1ca('0xd2')],_0x5bdd6d[_0xf1ca('0x47')]);_0x2ab94b[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x5bdd6d[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x46e4d2['query']['fields']));_0x2ab94b['attributes']=_0x2ab94b['attributes'][_0xf1ca('0x51')]?_0x2ab94b[_0xf1ca('0x4c')]:_0x5bdd6d['model'];_0x2ab94b[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x46e4d2[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x2ab94b[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x46e4d2[_0xf1ca('0x47')],_0x5bdd6d[_0xf1ca('0xd5')]));if(_0x46e4d2[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x2ab94b['where']=_[_0xf1ca('0x5c')](_0x2ab94b[_0xf1ca('0xda')],{'$or':_['map'](_0x2ab94b[_0xf1ca('0x4c')],function(_0x65092d){var _0x45e1b8={};_0x45e1b8[_0x65092d]={'$like':'%'+_0x46e4d2[_0xf1ca('0x47')]['filter']+'%'};return _0x45e1b8;})});}_0x2ab94b=_[_0xf1ca('0x5c')]({},_0x2ab94b,_0x46e4d2[_0xf1ca('0x5d')]);switch(_0x398306[_0xf1ca('0x36')]){case _0xf1ca('0x80'):return db[_[_0xf1ca('0x9f')](_0x46e4d2['query']['channel'])+_0xf1ca('0xd4')][_0xf1ca('0xdc')](_0x2ab94b);case _0xf1ca('0x2d'):case _0xf1ca('0x2e'):return _0x398306[_0xf1ca('0x2c')+_[_0xf1ca('0x9f')](_0x46e4d2['query'][_0xf1ca('0xab')])+_0xf1ca('0xa1')](_0x2ab94b);default:throw new db[(_0xf1ca('0x8f'))][(_0xf1ca('0x90'))](_0xf1ca('0xdd'));}})[_0xf1ca('0x1e')](function(_0x39256d){_0x2d29fc=_0x39256d[_0xf1ca('0x51')];if(!_0x46e4d2[_0xf1ca('0x47')]['hasOwnProperty'](_0xf1ca('0xde'))){_0x2ab94b[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x46e4d2[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x2ab94b[_0xf1ca('0x17')]=qs['offset'](_0x46e4d2[_0xf1ca('0x47')][_0xf1ca('0x17')]);}switch(_0x398306[_0xf1ca('0x36')]){case _0xf1ca('0x80'):return db[_[_0xf1ca('0x9f')](_0x46e4d2[_0xf1ca('0x47')]['channel'])+_0xf1ca('0xd4')]['findAll'](_0x2ab94b);case'user':case _0xf1ca('0x2e'):return _0x398306[_0xf1ca('0x2c')+_[_0xf1ca('0x9f')](_0x46e4d2['query']['channel'])+_0xf1ca('0xa1')](_0x2ab94b);}})[_0xf1ca('0x1e')](function(_0x56a0d1){return{'count':_0x2d29fc,'rows':_0x56a0d1};})[_0xf1ca('0x1e')](respondWithResult(_0x4ab835,null))['catch'](handleError(_0x4ab835,null));};exports['getVoiceQueuesRt']=function(_0x2cacd2,_0x1afd48){var _0x3001e4={};var _0x140145={};var _0x12d484;var _0x49b0e7;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x2cacd2['params']['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x1afd48,null))[_0xf1ca('0x1e')](function(_0x13a777){if(_0x13a777){_0x12d484=_0x13a777;_0x140145[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xa9')]['rawAttributes']);_0x140145['query']=_[_0xf1ca('0xd3')](_0x2cacd2[_0xf1ca('0x47')]);_0x140145[_0xf1ca('0xd5')]=_['intersection'](_0x140145[_0xf1ca('0xd2')],_0x140145[_0xf1ca('0x47')]);_0x3001e4[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x140145[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x3001e4[_0xf1ca('0x4c')]=_0x3001e4[_0xf1ca('0x4c')]['length']?_0x3001e4[_0xf1ca('0x4c')]:_0x140145['model'];_0x3001e4[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x3001e4['where']=qs[_0xf1ca('0xd5')](_['pick'](_0x2cacd2['query'],_0x140145[_0xf1ca('0xd5')]));if(_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x3001e4[_0xf1ca('0xda')]=_[_0xf1ca('0x5c')](_0x3001e4['where'],{'$or':_[_0xf1ca('0x33')](_0x3001e4[_0xf1ca('0x4c')],function(_0x38afb4){var _0x28c516={};_0x28c516[_0x38afb4]={'$like':'%'+_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0x28c516;})});}_0x3001e4=_[_0xf1ca('0x5c')]({},_0x3001e4,_0x2cacd2[_0xf1ca('0x5d')]);return _0x12d484[_0xf1ca('0xdf')](_0x3001e4);}})['then'](function(_0x5890bd){if(_0x5890bd){_0x49b0e7=_0x5890bd[_0xf1ca('0x51')];if(!_0x2cacd2[_0xf1ca('0x47')]['hasOwnProperty']('nolimit')){_0x3001e4['limit']=qs['limit'](_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x3001e4[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x2cacd2[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x12d484[_0xf1ca('0xdf')](_0x3001e4);}})[_0xf1ca('0x1e')](function(_0x482ef5){if(_0x482ef5){return _0x482ef5?{'count':_0x49b0e7,'rows':_0x482ef5}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x1afd48,null))['catch'](handleError(_0x1afd48,null));};exports[_0xf1ca('0xe0')]=function(_0x4c4e18,_0x162a8e){var _0x3d2f03={};var _0x2400a0={};var _0x154b04;var _0x1e2743;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x4c4e18[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x162a8e,null))[_0xf1ca('0x1e')](function(_0x1d8ff5){if(_0x1d8ff5){_0x154b04=_0x1d8ff5;_0x2400a0[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xe1')][_0xf1ca('0x3b')]);_0x2400a0[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x4c4e18[_0xf1ca('0x47')]);_0x2400a0[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x2400a0[_0xf1ca('0xd2')],_0x2400a0[_0xf1ca('0x47')]);_0x3d2f03[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x2400a0[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x3d2f03[_0xf1ca('0x4c')]=_0x3d2f03['attributes'][_0xf1ca('0x51')]?_0x3d2f03[_0xf1ca('0x4c')]:_0x2400a0['model'];_0x3d2f03[_0xf1ca('0xd8')]=qs['sort'](_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x3d2f03[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x4c4e18[_0xf1ca('0x47')],_0x2400a0[_0xf1ca('0xd5')]));if(_0x4c4e18[_0xf1ca('0x47')]['filter']){_0x3d2f03[_0xf1ca('0xda')]=_[_0xf1ca('0x5c')](_0x3d2f03[_0xf1ca('0xda')],{'$or':_[_0xf1ca('0x33')](_0x3d2f03[_0xf1ca('0x4c')],function(_0x31b5d4){var _0x32b1e9={};_0x32b1e9[_0x31b5d4]={'$like':'%'+_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0x32b1e9;})});}_0x3d2f03=_['merge']({},_0x3d2f03,_0x4c4e18[_0xf1ca('0x5d')]);return _0x154b04[_0xf1ca('0xe0')](_0x3d2f03);}})[_0xf1ca('0x1e')](function(_0x4082d8){if(_0x4082d8){_0x1e2743=_0x4082d8['length'];if(!_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0xe2')]('nolimit')){_0x3d2f03['limit']=qs[_0xf1ca('0x19')](_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x3d2f03[_0xf1ca('0x17')]=qs['offset'](_0x4c4e18[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x154b04['getGroups'](_0x3d2f03);}})[_0xf1ca('0x1e')](function(_0x18fec4){if(_0x18fec4){return _0x18fec4?{'count':_0x1e2743,'rows':_0x18fec4}:null;}})['then'](respondWithResult(_0x162a8e,null))[_0xf1ca('0x59')](handleError(_0x162a8e,null));};exports[_0xf1ca('0xe3')]=function(_0x5ccf71,_0x1429c9){var _0x5c0a00={'raw':!![],'where':{}};var _0x2025e4={};var _0xda5d06={'count':0x0,'rows':[]};return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0x5ccf71['params']['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x1429c9,null))['then'](function(_0x2fb296){if(_0x2fb296){_0x2025e4['model']=_['keys'](db[_0xf1ca('0xe4')][_0xf1ca('0x3b')]);_0x2025e4['query']=_['keys'](_0x5ccf71[_0xf1ca('0x47')]);_0x2025e4[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x2025e4[_0xf1ca('0xd2')],_0x2025e4[_0xf1ca('0x47')]);_0x5c0a00[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x2025e4[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x5c0a00[_0xf1ca('0x4c')]=_0x5c0a00[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x5c0a00['attributes']:_0x2025e4[_0xf1ca('0xd2')];if(!_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0xe2')]('nolimit')){_0x5c0a00['limit']=qs[_0xf1ca('0x19')](_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x5c0a00[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0x17')]);}_0x5c0a00[_0xf1ca('0xd8')]=qs['sort'](_0x5ccf71['query'][_0xf1ca('0xd9')]);_0x5c0a00['where']=qs[_0xf1ca('0xd5')](_['pick'](_0x5ccf71[_0xf1ca('0x47')],_0x2025e4['filters']));_0x5c0a00[_0xf1ca('0xda')][_0xf1ca('0xe5')]=_0x2fb296['id'];if(_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x5c0a00[_0xf1ca('0xda')]=_[_0xf1ca('0x5c')](_0x5c0a00[_0xf1ca('0xda')],{'$or':_[_0xf1ca('0x33')](_0x5c0a00[_0xf1ca('0x4c')],function(_0x50878d){var _0x57699e={};_0x57699e[_0x50878d]={'$like':'%'+_0x5ccf71['query']['filter']+'%'};return _0x57699e;})});}_0x5c0a00=_[_0xf1ca('0x5c')]({},_0x5c0a00,_0x5ccf71[_0xf1ca('0x5d')]);return db['VoiceRecording']['count']({'where':_0x5c0a00[_0xf1ca('0xda')]})[_0xf1ca('0x1e')](function(_0x3c3bca){_0xda5d06[_0xf1ca('0x1a')]=_0x3c3bca;if(_0x5ccf71[_0xf1ca('0x47')][_0xf1ca('0x48')]){_0x5c0a00['include']=[{'all':!![]}];}return db[_0xf1ca('0xe4')][_0xf1ca('0xdc')](_0x5c0a00);})[_0xf1ca('0x1e')](function(_0x1fc427){_0xda5d06[_0xf1ca('0x4e')]=_0x1fc427;return _0xda5d06;});}})[_0xf1ca('0x1e')](respondWithFilteredResult(_0x1429c9,_0x5c0a00))[_0xf1ca('0x59')](handleError(_0x1429c9,null));};exports[_0xf1ca('0xe6')]=function(_0x3868c2,_0x2eaa96){var _0x1d4874={'raw':!![],'where':{}};var _0x5b083e={};var _0x5ace82={'count':0x0,'rows':[]};return db['User'][_0xf1ca('0xd0')]({'where':{'id':_0x3868c2[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x2eaa96,null))['then'](function(_0x1c83a9){if(_0x1c83a9){_0x5b083e[_0xf1ca('0xd2')]=_['keys'](db[_0xf1ca('0xe7')][_0xf1ca('0x3b')]);_0x5b083e[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x3868c2[_0xf1ca('0x47')]);_0x5b083e[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x5b083e[_0xf1ca('0xd2')],_0x5b083e['query']);_0x1d4874[_0xf1ca('0x4c')]=_['intersection'](_0x5b083e[_0xf1ca('0xd2')],qs['fields'](_0x3868c2[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x1d4874[_0xf1ca('0x4c')]=_0x1d4874[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x1d4874[_0xf1ca('0x4c')]:_0x5b083e[_0xf1ca('0xd2')];if(!_0x3868c2[_0xf1ca('0x47')]['hasOwnProperty']('nolimit')){_0x1d4874[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x3868c2[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x1d4874[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x3868c2['query'][_0xf1ca('0x17')]);}_0x1d4874[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x3868c2['query']['sort']);_0x1d4874['where']=qs['filters'](_[_0xf1ca('0xdb')](_0x3868c2['query'],_0x5b083e[_0xf1ca('0xd5')]));_0x1d4874['where'][_0xf1ca('0xe5')]=_0x1c83a9['id'];if(_0x3868c2[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x1d4874[_0xf1ca('0xda')]=_[_0xf1ca('0x5c')](_0x1d4874[_0xf1ca('0xda')],{'$or':_['map'](_0x1d4874[_0xf1ca('0x4c')],function(_0x360341){var _0x5a152d={};_0x5a152d[_0x360341]={'$like':'%'+_0x3868c2['query'][_0xf1ca('0x31')]+'%'};return _0x5a152d;})});}_0x1d4874=_[_0xf1ca('0x5c')]({},_0x1d4874,_0x3868c2['options']);return db['ScreenRecording'][_0xf1ca('0x1a')]({'where':_0x1d4874[_0xf1ca('0xda')]})[_0xf1ca('0x1e')](function(_0x280066){_0x5ace82[_0xf1ca('0x1a')]=_0x280066;if(_0x3868c2['query'][_0xf1ca('0x48')]){_0x1d4874['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xf1ca('0xdc')](_0x1d4874);})['then'](function(_0x3a7b38){_0x5ace82[_0xf1ca('0x4e')]=_0x3a7b38;return _0x5ace82;});}})[_0xf1ca('0x1e')](respondWithFilteredResult(_0x2eaa96,_0x1d4874))[_0xf1ca('0x59')](handleError(_0x2eaa96,null));};exports[_0xf1ca('0xe8')]=function(_0x33c4fa,_0x55338a){var _0x23be32={};var _0x14d88b={};var _0x1a3066;var _0x34658a;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x33c4fa[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x55338a,null))[_0xf1ca('0x1e')](function(_0x3331a2){if(_0x3331a2){_0x1a3066=_0x3331a2;_0x14d88b[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xe9')][_0xf1ca('0x3b')]);_0x14d88b[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x33c4fa[_0xf1ca('0x47')]);_0x14d88b[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x14d88b[_0xf1ca('0xd2')],_0x14d88b[_0xf1ca('0x47')]);_0x23be32[_0xf1ca('0x4c')]=_['intersection'](_0x14d88b['model'],qs['fields'](_0x33c4fa[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x23be32[_0xf1ca('0x4c')]=_0x23be32[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x23be32['attributes']:_0x14d88b[_0xf1ca('0xd2')];_0x23be32[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x33c4fa[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x23be32['where']=qs['filters'](_[_0xf1ca('0xdb')](_0x33c4fa['query'],_0x14d88b[_0xf1ca('0xd5')]));if(_0x33c4fa[_0xf1ca('0x47')]['filter']){_0x23be32[_0xf1ca('0xda')]=_['merge'](_0x23be32[_0xf1ca('0xda')],{'$or':_[_0xf1ca('0x33')](_0x23be32['attributes'],function(_0x2fc1b7){var _0x353003={};_0x353003[_0x2fc1b7]={'$like':'%'+_0x33c4fa['query'][_0xf1ca('0x31')]+'%'};return _0x353003;})});}_0x23be32=_['merge']({},_0x23be32,_0x33c4fa['options']);return _0x1a3066[_0xf1ca('0xe8')](_0x23be32);}})[_0xf1ca('0x1e')](function(_0x3fa00d){if(_0x3fa00d){_0x34658a=_0x3fa00d[_0xf1ca('0x51')];if(!_0x33c4fa[_0xf1ca('0x47')]['hasOwnProperty'](_0xf1ca('0xde'))){_0x23be32[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x33c4fa['query']['limit']);_0x23be32[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x33c4fa[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x1a3066[_0xf1ca('0xe8')](_0x23be32);}})[_0xf1ca('0x1e')](function(_0x17274b){if(_0x17274b){return _0x17274b?{'count':_0x34658a,'rows':_0x17274b}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x55338a,null))[_0xf1ca('0x59')](handleError(_0x55338a,null));};exports[_0xf1ca('0xea')]=function(_0x361626,_0x5016cb){var _0x5506cd={};var _0x897f6d={};var _0x3899b5;var _0x453bee;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x361626[_0xf1ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5016cb,null))[_0xf1ca('0x1e')](function(_0x1daf7e){if(_0x1daf7e){_0x3899b5=_0x1daf7e;_0x897f6d[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xeb')]['rawAttributes']);_0x897f6d[_0xf1ca('0x47')]=_['keys'](_0x361626[_0xf1ca('0x47')]);_0x897f6d[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x897f6d[_0xf1ca('0xd2')],_0x897f6d['query']);_0x5506cd['attributes']=_[_0xf1ca('0xd6')](_0x897f6d[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x361626[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x5506cd[_0xf1ca('0x4c')]=_0x5506cd['attributes']['length']?_0x5506cd[_0xf1ca('0x4c')]:_0x897f6d[_0xf1ca('0xd2')];_0x5506cd[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x361626[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x5506cd['where']=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x361626[_0xf1ca('0x47')],_0x897f6d[_0xf1ca('0xd5')]));if(_0x361626[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x5506cd['where']=_[_0xf1ca('0x5c')](_0x5506cd['where'],{'$or':_[_0xf1ca('0x33')](_0x5506cd['attributes'],function(_0x13d84a){var _0xe15216={};_0xe15216[_0x13d84a]={'$like':'%'+_0x361626[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0xe15216;})});}_0x5506cd=_['merge']({},_0x5506cd,_0x361626[_0xf1ca('0x5d')]);return _0x3899b5[_0xf1ca('0xea')](_0x5506cd);}})['then'](function(_0x5562a5){if(_0x5562a5){_0x453bee=_0x5562a5[_0xf1ca('0x51')];if(!_0x361626[_0xf1ca('0x47')][_0xf1ca('0xe2')](_0xf1ca('0xde'))){_0x5506cd['limit']=qs[_0xf1ca('0x19')](_0x361626[_0xf1ca('0x47')]['limit']);_0x5506cd[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x361626[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x3899b5['getOpenchannelInteractions'](_0x5506cd);}})[_0xf1ca('0x1e')](function(_0xa90feb){if(_0xa90feb){return _0xa90feb?{'count':_0x453bee,'rows':_0xa90feb}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x5016cb,null))[_0xf1ca('0x59')](handleError(_0x5016cb,null));};exports[_0xf1ca('0xec')]=function(_0xa9090d,_0x1f9899){var _0x53261b={'raw':!![],'where':{}};var _0x44bb32={};var _0x1cc3d0={'count':0x0,'rows':[]};return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0xa9090d['params']['id']}})['then'](handleEntityNotFound(_0x1f9899,null))[_0xf1ca('0x1e')](function(_0x20494e){if(_0x20494e){_0x44bb32[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xed')][_0xf1ca('0x3b')]);_0x44bb32[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0xa9090d[_0xf1ca('0x47')]);_0x44bb32[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x44bb32[_0xf1ca('0xd2')],_0x44bb32[_0xf1ca('0x47')]);_0x53261b[_0xf1ca('0x4c')]=_['intersection'](_0x44bb32['model'],qs['fields'](_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x53261b['attributes']=_0x53261b[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x53261b[_0xf1ca('0x4c')]:_0x44bb32[_0xf1ca('0xd2')];if(!_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0xe2')](_0xf1ca('0xde'))){_0x53261b[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x53261b[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0x17')]);}_0x53261b[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x53261b['where']=qs[_0xf1ca('0xd5')](_['pick'](_0xa9090d['query'],_0x44bb32[_0xf1ca('0xd5')]));_0x53261b[_0xf1ca('0xda')][_0xf1ca('0xe5')]=_0x20494e['id'];if(_0xa9090d[_0xf1ca('0x47')]['filter']){_0x53261b[_0xf1ca('0xda')]=_[_0xf1ca('0x5c')](_0x53261b['where'],{'$or':_[_0xf1ca('0x33')](_0x53261b[_0xf1ca('0x4c')],function(_0x5c7bf8){var _0x2245f2={};_0x2245f2[_0x5c7bf8]={'$like':'%'+_0xa9090d['query']['filter']+'%'};return _0x2245f2;})});}_0x53261b=_[_0xf1ca('0x5c')]({},_0x53261b,_0xa9090d[_0xf1ca('0x5d')]);return db['MailInteraction'][_0xf1ca('0x1a')]({'where':_0x53261b[_0xf1ca('0xda')]})[_0xf1ca('0x1e')](function(_0x2febf4){_0x1cc3d0[_0xf1ca('0x1a')]=_0x2febf4;if(_0xa9090d[_0xf1ca('0x47')][_0xf1ca('0x48')]){_0x53261b[_0xf1ca('0x49')]=[{'all':!![]}];}return db['MailInteraction'][_0xf1ca('0xdc')](_0x53261b);})[_0xf1ca('0x1e')](function(_0x24b85e){_0x1cc3d0['rows']=_0x24b85e;return _0x1cc3d0;});}})['then'](respondWithFilteredResult(_0x1f9899,_0x53261b))[_0xf1ca('0x59')](handleError(_0x1f9899,null));};exports['getSmsInteractions']=function(_0x4974ae,_0x19d7f9){var _0x5b9bfc={};var _0x5f8e7a={};var _0x347588;var _0x38dcdf;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x4974ae[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x19d7f9,null))[_0xf1ca('0x1e')](function(_0x47b179){if(_0x47b179){_0x347588=_0x47b179;_0x5f8e7a[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xee')][_0xf1ca('0x3b')]);_0x5f8e7a[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x4974ae['query']);_0x5f8e7a[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x5f8e7a[_0xf1ca('0xd2')],_0x5f8e7a[_0xf1ca('0x47')]);_0x5b9bfc[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x5f8e7a[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x4974ae['query']['fields']));_0x5b9bfc[_0xf1ca('0x4c')]=_0x5b9bfc[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x5b9bfc[_0xf1ca('0x4c')]:_0x5f8e7a[_0xf1ca('0xd2')];_0x5b9bfc[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x4974ae[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x5b9bfc['where']=qs['filters'](_['pick'](_0x4974ae['query'],_0x5f8e7a[_0xf1ca('0xd5')]));if(_0x4974ae[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x5b9bfc['where']=_[_0xf1ca('0x5c')](_0x5b9bfc['where'],{'$or':_[_0xf1ca('0x33')](_0x5b9bfc[_0xf1ca('0x4c')],function(_0x4c6679){var _0x568212={};_0x568212[_0x4c6679]={'$like':'%'+_0x4974ae[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0x568212;})});}_0x5b9bfc=_[_0xf1ca('0x5c')]({},_0x5b9bfc,_0x4974ae[_0xf1ca('0x5d')]);return _0x347588[_0xf1ca('0xef')](_0x5b9bfc);}})[_0xf1ca('0x1e')](function(_0x5f4c4e){if(_0x5f4c4e){_0x38dcdf=_0x5f4c4e['length'];if(!_0x4974ae[_0xf1ca('0x47')][_0xf1ca('0xe2')](_0xf1ca('0xde'))){_0x5b9bfc[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x4974ae[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x5b9bfc['offset']=qs[_0xf1ca('0x17')](_0x4974ae[_0xf1ca('0x47')]['offset']);}return _0x347588[_0xf1ca('0xef')](_0x5b9bfc);}})[_0xf1ca('0x1e')](function(_0x1c6e0b){if(_0x1c6e0b){return _0x1c6e0b?{'count':_0x38dcdf,'rows':_0x1c6e0b}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x19d7f9,null))[_0xf1ca('0x59')](handleError(_0x19d7f9,null));};exports['getFaxInteractions']=function(_0x8a0f40,_0x50caba){var _0xa901fe={};var _0x11413b={};var _0x29524a;var _0x31c972;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x8a0f40['params']['id']}})['then'](handleEntityNotFound(_0x50caba,null))[_0xf1ca('0x1e')](function(_0x2ebea2){if(_0x2ebea2){_0x29524a=_0x2ebea2;_0x11413b['model']=_['keys'](db[_0xf1ca('0xf0')][_0xf1ca('0x3b')]);_0x11413b[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x8a0f40[_0xf1ca('0x47')]);_0x11413b[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x11413b[_0xf1ca('0xd2')],_0x11413b[_0xf1ca('0x47')]);_0xa901fe[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x11413b['model'],qs[_0xf1ca('0xd7')](_0x8a0f40['query'][_0xf1ca('0xd7')]));_0xa901fe[_0xf1ca('0x4c')]=_0xa901fe[_0xf1ca('0x4c')]['length']?_0xa901fe['attributes']:_0x11413b[_0xf1ca('0xd2')];_0xa901fe[_0xf1ca('0xd8')]=qs[_0xf1ca('0xd9')](_0x8a0f40[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0xa901fe[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x8a0f40[_0xf1ca('0x47')],_0x11413b[_0xf1ca('0xd5')]));if(_0x8a0f40[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0xa901fe[_0xf1ca('0xda')]=_['merge'](_0xa901fe[_0xf1ca('0xda')],{'$or':_[_0xf1ca('0x33')](_0xa901fe[_0xf1ca('0x4c')],function(_0x58d074){var _0x5d1467={};_0x5d1467[_0x58d074]={'$like':'%'+_0x8a0f40[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0x5d1467;})});}_0xa901fe=_[_0xf1ca('0x5c')]({},_0xa901fe,_0x8a0f40[_0xf1ca('0x5d')]);return _0x29524a[_0xf1ca('0xf1')](_0xa901fe);}})[_0xf1ca('0x1e')](function(_0x59cb8d){if(_0x59cb8d){_0x31c972=_0x59cb8d['length'];if(!_0x8a0f40[_0xf1ca('0x47')][_0xf1ca('0xe2')](_0xf1ca('0xde'))){_0xa901fe[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x8a0f40[_0xf1ca('0x47')]['limit']);_0xa901fe['offset']=qs[_0xf1ca('0x17')](_0x8a0f40['query']['offset']);}return _0x29524a['getFaxInteractions'](_0xa901fe);}})[_0xf1ca('0x1e')](function(_0x82d030){if(_0x82d030){return _0x82d030?{'count':_0x31c972,'rows':_0x82d030}:null;}})['then'](respondWithResult(_0x50caba,null))[_0xf1ca('0x59')](handleError(_0x50caba,null));};exports['getWhatsappInteractions']=function(_0x1c18f4,_0x128154){var _0x138007={};var _0x545275={};var _0x3a3bab;var _0x55f1a2;return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0x1c18f4[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x128154,null))[_0xf1ca('0x1e')](function(_0x75d6ae){if(_0x75d6ae){_0x3a3bab=_0x75d6ae;_0x545275[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0xf2')][_0xf1ca('0x3b')]);_0x545275[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x1c18f4[_0xf1ca('0x47')]);_0x545275[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x545275[_0xf1ca('0xd2')],_0x545275[_0xf1ca('0x47')]);_0x138007[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x545275['model'],qs[_0xf1ca('0xd7')](_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x138007[_0xf1ca('0x4c')]=_0x138007[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x138007[_0xf1ca('0x4c')]:_0x545275[_0xf1ca('0xd2')];_0x138007[_0xf1ca('0xd8')]=qs['sort'](_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x138007[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x1c18f4[_0xf1ca('0x47')],_0x545275[_0xf1ca('0xd5')]));if(_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x138007['where']=_[_0xf1ca('0x5c')](_0x138007['where'],{'$or':_['map'](_0x138007[_0xf1ca('0x4c')],function(_0x4d151b){var _0x2c1a77={};_0x2c1a77[_0x4d151b]={'$like':'%'+_0x1c18f4['query'][_0xf1ca('0x31')]+'%'};return _0x2c1a77;})});}_0x138007=_[_0xf1ca('0x5c')]({},_0x138007,_0x1c18f4[_0xf1ca('0x5d')]);return _0x3a3bab['getWhatsappInteractions'](_0x138007);}})[_0xf1ca('0x1e')](function(_0x5a5f3e){if(_0x5a5f3e){_0x55f1a2=_0x5a5f3e[_0xf1ca('0x51')];if(!_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0xe2')]('nolimit')){_0x138007[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x138007[_0xf1ca('0x17')]=qs[_0xf1ca('0x17')](_0x1c18f4[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x3a3bab[_0xf1ca('0xf3')](_0x138007);}})[_0xf1ca('0x1e')](function(_0x14c696){if(_0x14c696){return _0x14c696?{'count':_0x55f1a2,'rows':_0x14c696}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x128154,null))[_0xf1ca('0x59')](handleError(_0x128154,null));};exports[_0xf1ca('0xf4')]=function(_0x51ddfb,_0x2e9c5f,_0x150913){var _0x4e0d4b;var _0x1cbf8e;var _0x51daf9;var _0x173f6f=!_['isNil'](_0x51ddfb[_0xf1ca('0x5b')]['id'])?_0x51ddfb[_0xf1ca('0x5b')]['id']:!_[_0xf1ca('0x67')](_0x51ddfb['user']['id'])?_0x51ddfb['user']['id']:null;return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x173f6f,'role':{'$or':[_0xf1ca('0x80'),_0xf1ca('0x2d'),_0xf1ca('0x2e')]}},'attributes':['id',_0xf1ca('0x37'),_0xf1ca('0xf5'),_0xf1ca('0xf6'),'role','internal','loginInPause']})[_0xf1ca('0x1e')](function(_0x59cf28){if(_0x59cf28){if(_0x59cf28['role']===_0xf1ca('0x2e')){_0x4e0d4b=_0x59cf28;if(_0x51ddfb[_0xf1ca('0x5e')]['interface']){_0x51daf9=util['format'](_0xf1ca('0xf7'),_0x4e0d4b[_0x51ddfb[_0xf1ca('0x5e')][_0xf1ca('0x9e')]]);}else if(_0x51ddfb[_0xf1ca('0x5e')][_0xf1ca('0xf8')]){_0x51daf9=util[_0xf1ca('0xa7')](_0xf1ca('0xa8'),_0x51ddfb[_0xf1ca('0x5e')][_0xf1ca('0xf8')]);}else{_0x51daf9=util[_0xf1ca('0xa7')]('SIP/%s',_0x4e0d4b[_0xf1ca('0x37')]);}socket['to'](util['format']('user:%s',_0x4e0d4b[_0xf1ca('0x37')]))[_0xf1ca('0x29')](_0xf1ca('0xf9'),{'user':{'id':_0x4e0d4b['id'],'name':_0x4e0d4b[_0xf1ca('0x37')]},'ip':_0x51ddfb[_0xf1ca('0xfa')][_0xf1ca('0xfb')]||_0x51ddfb[_0xf1ca('0xfc')][_0xf1ca('0xfd')]||_0x51ddfb[_0xf1ca('0xfe')]['remoteAddress']||_0x51ddfb[_0xf1ca('0xfc')][_0xf1ca('0xfe')]['remoteAddress']});return db['UserVoiceQueueRt'][_0xf1ca('0x2b')]({'where':{'membername':_0x4e0d4b[_0xf1ca('0x37')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0xf1ca('0xff'));}})['then'](function(){if(_0x4e0d4b){return _0x4e0d4b[_0xf1ca('0x100')]({'raw':!![]});}})['then'](function(_0x18ce9e){if(_0x4e0d4b){if(_0x18ce9e){_0x1cbf8e=_0x18ce9e;if(_0x1cbf8e[_0xf1ca('0x51')]){var _0x34bf54=_0x1cbf8e[_0xf1ca('0x33')](function(_0x419679){var _0x3c95c6={'membername':_0x4e0d4b[_0xf1ca('0x37')],'UserId':_0x4e0d4b['id'],'queue_name':_0x419679['name'],'VoiceQueueId':_0x419679['id'],'interface':_0x51daf9,'paused':_0x4e0d4b['loginInPause']||![],'penalty':_0x419679['UserVoiceQueue.penalty']||0x0};return db[_0xf1ca('0xa9')]['upsert'](_0x3c95c6);});return Promise[_0xf1ca('0x58')](_0x34bf54);}}}})[_0xf1ca('0x1e')](function(){if(_0x4e0d4b){return db[_0xf1ca('0x101')][_0xf1ca('0xdc')]({'where':{'membername':_0x4e0d4b[_0xf1ca('0x37')],'exitAt':null}});}})[_0xf1ca('0x1e')](function(_0x17680c){if(_0x4e0d4b){var _0xff184f=[];_0x17680c['forEach'](function(_0x4ae305){_0xff184f['push'](_0x4ae305[_0xf1ca('0x28')]({'exitAt':moment()[_0xf1ca('0xa7')](_0xf1ca('0x102'))}));});return Promise[_0xf1ca('0x58')](_0xff184f);}})[_0xf1ca('0x1e')](function(){if(_0x4e0d4b){var _0x5edcc7=[];var _0xa4ba2=[];var _0x3dae2a=utils[_0xf1ca('0x103')]();var _0x597287={'membername':_0x4e0d4b[_0xf1ca('0x37')],'interface':_0x51daf9,'enterAt':moment()['format'](_0xf1ca('0x102')),'role':_0x4e0d4b[_0xf1ca('0x36')],'internal':_0x4e0d4b['internal']};_0x3dae2a[_0xf1ca('0x104')](function(_0x569a5e){_0x5edcc7['push'](_[_0xf1ca('0x5c')]({'channel':_0x569a5e,'type':_0xf1ca('0x105'),'data1':_0x51ddfb[_0xf1ca('0x5e')][_0xf1ca('0x106')],'data2':_0x51daf9},_0x597287));if(_0x4e0d4b[_0xf1ca('0x9c')]){_0xa4ba2['push'](_[_0xf1ca('0x5c')]({'channel':_0x569a5e,'type':'PAUSE','data1':'LOGININPAUSE'},_0x597287));}});return db[_0xf1ca('0x101')][_0xf1ca('0x88')](_0x5edcc7['concat'](_0xa4ba2),{'individualHooks':!![]});}})[_0xf1ca('0x1e')](function(){if(_0x4e0d4b){return _0x4e0d4b[_0xf1ca('0x28')]({'online':!![],'lastLoginAt':moment()[_0xf1ca('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4e0d4b['loginInPause']||![],'mailPause':_0x4e0d4b['loginInPause']||![],'chatPause':_0x4e0d4b['loginInPause']||![],'faxPause':_0x4e0d4b[_0xf1ca('0x9c')]||![],'smsPause':_0x4e0d4b[_0xf1ca('0x9c')]||![],'openchannelPause':_0x4e0d4b[_0xf1ca('0x9c')]||![],'whatsappPause':_0x4e0d4b['loginInPause']||![],'pauseType':_0x4e0d4b[_0xf1ca('0x9c')]?_0xf1ca('0x107'):null,'interface':_0x51daf9,'lastPauseAt':moment()[_0xf1ca('0xa7')](_0xf1ca('0x102'))});}})[_0xf1ca('0x1e')](function(_0x265eea){if(_0x51ddfb['isMiddleware']){return _0x150913();}else{return Promise[_0xf1ca('0x108')](_0x265eea)[_0xf1ca('0x1e')](respondWithResult(_0x2e9c5f,null));}})['catch'](handleError(_0x2e9c5f,null));};exports[_0xf1ca('0x109')]=function(_0xeef302,_0x231515){var _0x52981d;return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0xeef302[_0xf1ca('0x5b')]['id'],'role':_0xf1ca('0x2e')},'attributes':['id',_0xf1ca('0x37'),_0xf1ca('0x36')]})['then'](handleEntityNotFound(_0x231515,null))[_0xf1ca('0x1e')](function(_0x2b3386){if(_0x2b3386){_0x52981d=_0x2b3386;return db[_0xf1ca('0xa9')]['destroy']({'where':{'membername':_0x52981d[_0xf1ca('0x37')]},'individualHooks':!![]});}})[_0xf1ca('0x1e')](function(){return db['MemberReport'][_0xf1ca('0xdc')]({'where':{'membername':_0x52981d[_0xf1ca('0x37')],'exitAt':null}});})[_0xf1ca('0x1e')](function(_0x502e58){var _0x18bbe8=[];_0x502e58[_0xf1ca('0x104')](function(_0x65566c){_0x18bbe8[_0xf1ca('0x4d')](_0x65566c[_0xf1ca('0x28')]({'exitAt':moment()['format'](_0xf1ca('0x102'))}));});return Promise['all'](_0x18bbe8);})['then'](function(){return _0x52981d[_0xf1ca('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xf1ca('0x1e')](respondWithResult(_0x231515,null))[_0xf1ca('0x59')](handleError(_0x231515,null));};exports[_0xf1ca('0x10a')]=function(_0x432f45,_0x5f3633){var _0x2d46eb;return db[_0xf1ca('0xa9')][_0xf1ca('0x28')]({'paused':0x1},{'where':{'UserId':_0x432f45['params']['id']},'individualHooks':!![]})[_0xf1ca('0x1e')](function(){return db['User']['find']({'where':{'id':_0x432f45['params']['id'],'role':_0xf1ca('0x2e')},'attributes':['id','name',_0xf1ca('0x36'),_0xf1ca('0x63'),'interface','online']});})[_0xf1ca('0x1e')](handleEntityNotFound(_0x5f3633,null))[_0xf1ca('0x1e')](function(_0x312a06){if(_0x312a06){_0x2d46eb=_0x312a06;return respondWithRpcPromise(_0xf1ca('0x10b'),_0xf1ca('0x10a'),{'id':_0x2d46eb['id'],'name':_0x2d46eb['name'],'pause':!![]});}})['then'](function(){if(_0x2d46eb){return db[_0xf1ca('0x101')]['findAll']({'where':{'membername':_0x2d46eb['name'],'type':_0xf1ca('0x10c'),'exitAt':null}});}})['then'](function(_0x1ab4e4){if(_0x1ab4e4[_0xf1ca('0x51')]){var _0x1ed0d0=moment()[_0xf1ca('0xa7')](_0xf1ca('0x102'));for(var _0x6574d2=0x0,_0x2cd090=_0x1ab4e4[_0xf1ca('0x51')];_0x6574d2<_0x2cd090;_0x6574d2++){_0x1ab4e4[_0x6574d2]['updateAttributes']({'exitAt':_0x1ed0d0});}}})['then'](function(){var _0x32c957=[];var _0x44a081=utils[_0xf1ca('0x103')]();_0x44a081[_0xf1ca('0x104')](function(_0x52352d){_0x32c957[_0xf1ca('0x4d')]({'channel':_0x52352d,'membername':_0x2d46eb['name'],'interface':_[_0xf1ca('0x67')](_0x2d46eb[_0xf1ca('0x9e')])?util['format'](_0xf1ca('0xa8'),_0x2d46eb[_0xf1ca('0x37')]):_0x2d46eb[_0xf1ca('0x9e')],'type':'PAUSE','enterAt':moment()[_0xf1ca('0xa7')](_0xf1ca('0x102')),'data1':_0x432f45[_0xf1ca('0x5e')][_0xf1ca('0x3d')]||_0xf1ca('0x10d'),'role':_0x2d46eb[_0xf1ca('0x36')],'internal':_0x2d46eb[_0xf1ca('0x63')]});});return db[_0xf1ca('0x101')]['bulkCreate'](_0x32c957,{'individualHooks':!![]});})[_0xf1ca('0x1e')](function(){return _0x2d46eb[_0xf1ca('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x432f45[_0xf1ca('0x5e')]['type']||_0xf1ca('0x10d'),'lastPauseAt':moment()[_0xf1ca('0xa7')](_0xf1ca('0x102'))});})[_0xf1ca('0x1e')](respondWithResult(_0x5f3633,null))[_0xf1ca('0x59')](handleError(_0x5f3633,null));};exports[_0xf1ca('0x10e')]=function(_0x42c245,_0xcb0b96){if(_0x42c245['body'][_0xf1ca('0xab')]&&!utils[_0xf1ca('0xd1')](_0x42c245[_0xf1ca('0x5e')][_0xf1ca('0xab')])){throw new APIBadRequestError(util[_0xf1ca('0xa7')](_0xf1ca('0x10f'),_0x42c245[_0xf1ca('0x5e')][_0xf1ca('0xab')]));}return db[_0xf1ca('0x3a')][_0xf1ca('0x35')]({'where':{'id':_0x42c245[_0xf1ca('0x5b')]['id']},'attributes':['id','name',_0xf1ca('0x36'),'internal',_0xf1ca('0x9e'),_0xf1ca('0x9b'),_0xf1ca('0x9d'),_0xf1ca('0x110'),_0xf1ca('0x111'),'faxPause',_0xf1ca('0x112'),_0xf1ca('0x113'),_0xf1ca('0x114'),_0xf1ca('0x115'),_0xf1ca('0x116')]})[_0xf1ca('0x1e')](function(_0x242eda){if(!_0x242eda){throw new APINotFoundError(util[_0xf1ca('0xa7')](_0xf1ca('0xca'),_0x42c245[_0xf1ca('0x5b')]['id']));}return _0x242eda[_0xf1ca('0x10e')](_0x42c245[_0xf1ca('0x5e')][_0xf1ca('0xab')]);})[_0xf1ca('0x1e')](respondWithResult(_0xcb0b96,null))[_0xf1ca('0x59')](APIHandleError(_0xcb0b96));};exports['getTeams']=function(_0x9284a4,_0x2d6d7e){var _0x53f2e1={};var _0x2200f3={};var _0x3e682a;var _0x305718;return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0x9284a4['params']['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x2d6d7e,null))[_0xf1ca('0x1e')](function(_0x24d887){if(_0x24d887){_0x3e682a=_0x24d887;_0x2200f3[_0xf1ca('0xd2')]=_[_0xf1ca('0xd3')](db[_0xf1ca('0x117')][_0xf1ca('0x3b')]);_0x2200f3[_0xf1ca('0x47')]=_['keys'](_0x9284a4[_0xf1ca('0x47')]);_0x2200f3['filters']=_[_0xf1ca('0xd6')](_0x2200f3[_0xf1ca('0xd2')],_0x2200f3['query']);_0x53f2e1[_0xf1ca('0x4c')]=_['intersection'](_0x2200f3[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x9284a4[_0xf1ca('0x47')]['fields']));_0x53f2e1[_0xf1ca('0x4c')]=_0x53f2e1['attributes'][_0xf1ca('0x51')]?_0x53f2e1['attributes']:_0x2200f3['model'];_0x53f2e1['order']=qs[_0xf1ca('0xd9')](_0x9284a4[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x53f2e1[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x9284a4[_0xf1ca('0x47')],_0x2200f3[_0xf1ca('0xd5')]));if(_0x9284a4['query']['filter']){_0x53f2e1[_0xf1ca('0xda')]=_['merge'](_0x53f2e1[_0xf1ca('0xda')],{'$or':_['map'](_0x53f2e1['attributes'],function(_0x59e541){var _0x476a12={};_0x476a12[_0x59e541]={'$like':'%'+_0x9284a4['query']['filter']+'%'};return _0x476a12;})});}_0x53f2e1=_[_0xf1ca('0x5c')]({},_0x53f2e1,_0x9284a4[_0xf1ca('0x5d')]);return _0x3e682a[_0xf1ca('0x118')](_0x53f2e1);}})[_0xf1ca('0x1e')](function(_0x5d5089){if(_0x5d5089){_0x305718=_0x5d5089['length'];if(!_0x9284a4[_0xf1ca('0x47')][_0xf1ca('0xe2')]('nolimit')){_0x53f2e1[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x9284a4[_0xf1ca('0x47')][_0xf1ca('0x19')]);_0x53f2e1[_0xf1ca('0x17')]=qs['offset'](_0x9284a4[_0xf1ca('0x47')][_0xf1ca('0x17')]);}return _0x3e682a[_0xf1ca('0x118')](_0x53f2e1);}})[_0xf1ca('0x1e')](function(_0x10216d){if(_0x10216d){return _0x10216d?{'count':_0x305718,'rows':_0x10216d}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0x2d6d7e,null))[_0xf1ca('0x59')](handleError(_0x2d6d7e,null));};exports[_0xf1ca('0x119')]=function(_0x4e5251,_0x595ff4){var _0x55d5b9=_0x4e5251[_0xf1ca('0x5b')]['id'];var _0x2b6b62=_0x4e5251[_0xf1ca('0x5e')]?_0x4e5251[_0xf1ca('0x5e')]['ids']:null;var _0xfce4f2=[];return Promise[_0xf1ca('0x108')]()[_0xf1ca('0x1e')](function(){if(!_0x2b6b62)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xf1ca('0x1e')](function(){return db['User'][_0xf1ca('0xd0')]({'where':{'id':_0x55d5b9}});})['then'](function(_0x2d90cf){if(!_0x2d90cf)throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x4e5251[_0xf1ca('0x5b')]['id']));return db['sequelize'][_0xf1ca('0x11a')](function(_0x47bebd){return _0x2d90cf[_0xf1ca('0x119')](_0x2b6b62,{'transaction':_0x47bebd})[_0xf1ca('0x1e')](function(){return db[_0xf1ca('0x117')][_0xf1ca('0xdc')]({'where':{'id':{'$in':_0x2b6b62}}});})['then'](function(_0x320247){var _0x2c0658=_[_0xf1ca('0x33')](_0x320247,function(_0xbd7082){return _0xbd7082[_0xf1ca('0x11b')]();});return Promise[_0xf1ca('0x58')](_0x2c0658);})['then'](function(_0x87ce64){_0xfce4f2=_['flattenDeep'](_0x87ce64);var _0xba95dd=_['map'](_0xfce4f2,function(_0x4f2ec9){return _0x4f2ec9['addAgent'](_0x2d90cf['id'],{'transaction':_0x47bebd});});return Promise['all'](_0xba95dd);})[_0xf1ca('0x1e')](function(){if(!_0x2d90cf[_0xf1ca('0x9b')])return;var _0x560a75=_[_0xf1ca('0x31')](_0xfce4f2,function(_0xb10710){return _0xb10710[_0xf1ca('0x11c')]('channel')===_0xf1ca('0x11d');});var _0x34ffec=_[_0xf1ca('0x33')](_0x560a75,function(_0xd54844){return db[_0xf1ca('0xa9')][_0xf1ca('0xaa')]({'membername':_0x2d90cf[_0xf1ca('0x37')],'UserId':_0x2d90cf['id'],'queue_name':_0xd54844[_0xf1ca('0x37')],'VoiceQueueId':_0xd54844['id'],'interface':_[_0xf1ca('0x67')](_0x2d90cf[_0xf1ca('0x9e')])?util[_0xf1ca('0xa7')](_0xf1ca('0xa8'),_0x2d90cf['name']):_0x2d90cf[_0xf1ca('0x9e')],'paused':_0x2d90cf[_0xf1ca('0x9d')]||![],'penalty':_0x2d90cf[_0xf1ca('0xa2')]},{'transaction':_0x47bebd});});return Promise[_0xf1ca('0x58')](_0x34ffec);})[_0xf1ca('0x1e')](function(){return db[_0xf1ca('0x11e')][_0xf1ca('0xdc')]({'where':{'teamId':{'$in':_0x2b6b62}}});})[_0xf1ca('0x1e')](function(_0x3cb9ef){var _0x22d0d4=_[_0xf1ca('0x33')](_0x3cb9ef,function(_0x379126){return db[_0xf1ca('0x11f')]['create']({'UserId':_0x2d90cf['id'],'VoicePrefixId':_0x379126[_0xf1ca('0x120')]},{'transaction':_0x47bebd});});return Promise[_0xf1ca('0x58')](_0x22d0d4);});});})[_0xf1ca('0x1e')](function(){for(var _0xf0c722=0x0;_0xf0c722<_0xfce4f2['length'];_0xf0c722++){var _0x2f6cce=_0xfce4f2[_0xf0c722][_0xf1ca('0x11c')](_0xf1ca('0xab'));var _0x1c0c2e=_0x2f6cce+_0xf1ca('0xaf');socket['emit']('user'+_0x2f6cce+_0xf1ca('0xa4'),{'UserId':_0x55d5b9,['queueField']:_0xfce4f2[_0xf0c722]['id']});}})[_0xf1ca('0x1e')](respondWithStatusCode(_0x595ff4,null))[_0xf1ca('0x59')](APIHandleError(_0x595ff4));};exports['removeTeams']=function(_0x53051,_0x20526a){var _0x136505=_0x53051['params']['id'];var _0x5b6e15=null;if(_0x53051['query'][_0xf1ca('0x61')]){_0x5b6e15=_[_0xf1ca('0xae')](_0x53051[_0xf1ca('0x47')][_0xf1ca('0x61')])?_0x53051[_0xf1ca('0x47')][_0xf1ca('0x61')]:[_0x53051[_0xf1ca('0x47')][_0xf1ca('0x61')]];}var _0x3a58ed=[];return Promise[_0xf1ca('0x108')]()['then'](function(){if(!_0x5b6e15)throw new APIBadRequestError(_0xf1ca('0x121'));})[_0xf1ca('0x1e')](function(){return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x136505}});})[_0xf1ca('0x1e')](function(_0x45e340){if(!_0x45e340)throw new APINotFoundError(util[_0xf1ca('0xa7')](_0xf1ca('0xca'),_0x53051[_0xf1ca('0x5b')]['id']));return db[_0xf1ca('0x69')][_0xf1ca('0x11a')](function(_0x23ac6c){return _0x45e340[_0xf1ca('0x122')](_0x5b6e15,{'transaction':_0x23ac6c})[_0xf1ca('0x1e')](function(){return db[_0xf1ca('0x117')]['findAll']({'where':{'id':{'$in':_0x5b6e15}}});})[_0xf1ca('0x1e')](function(_0x2985d2){var _0x5e4f96=_[_0xf1ca('0x33')](_0x2985d2,function(_0x594798){return _0x594798[_0xf1ca('0x11b')]();});return Promise['all'](_0x5e4f96);})[_0xf1ca('0x1e')](function(_0x11c65a){_0x3a58ed=_[_0xf1ca('0x123')](_0x11c65a);var _0x676d4b=_[_0xf1ca('0x33')](_0x3a58ed,function(_0x19c4c5){return _0x19c4c5[_0xf1ca('0x124')](_0x45e340['id'],{'transaction':_0x23ac6c});});return Promise[_0xf1ca('0x58')](_0x676d4b);})['then'](function(){if(!_0x45e340['online'])return;var _0x42f989=_[_0xf1ca('0x31')](_0x3a58ed,function(_0x10649c){return _0x10649c[_0xf1ca('0x11c')](_0xf1ca('0xab'))===_0xf1ca('0x11d');});var _0x3326c8=_[_0xf1ca('0x33')](_0x42f989,function(_0x3d4883){return db[_0xf1ca('0xa9')][_0xf1ca('0x2b')]({'where':{'VoiceQueueId':_0x3d4883['id'],'UserId':_0x45e340['id']},'transaction':_0x23ac6c});});return Promise[_0xf1ca('0x58')](_0x3326c8);})[_0xf1ca('0x1e')](function(){return db[_0xf1ca('0x11e')][_0xf1ca('0xdc')]({'where':{'teamId':{'$in':_0x5b6e15}}});})['then'](function(_0x41c1d9){var _0x54bbc7=_[_0xf1ca('0x33')](_0x41c1d9,function(_0x5c4a03){return db[_0xf1ca('0x11f')][_0xf1ca('0x2b')]({'where':{'UserId':_0x45e340['id'],'VoicePrefixId':_0x5c4a03[_0xf1ca('0x120')]}},{'transaction':_0x23ac6c});});return Promise[_0xf1ca('0x58')](_0x54bbc7);});});})[_0xf1ca('0x1e')](function(){for(var _0x149ec5=0x0;_0x149ec5<_0x3a58ed[_0xf1ca('0x51')];_0x149ec5++){var _0x3d3e2d=_0x3a58ed[_0x149ec5][_0xf1ca('0x11c')](_0xf1ca('0xab'));var _0x173c00=_0x3d3e2d+_0xf1ca('0xaf');socket[_0xf1ca('0x29')](_0xf1ca('0x2d')+_0x3d3e2d+_0xf1ca('0xb0'),{'UserId':_0x136505,['queueField']:_0x3a58ed[_0x149ec5]['id']});}})['then'](respondWithStatusCode(_0x20526a,null))[_0xf1ca('0x59')](APIHandleError(_0x20526a));};exports[_0xf1ca('0x125')]=function(_0x17b0a6,_0xd8db13){var _0x18f28a={};var _0x60151b={};var _0x14a6e9;var _0xcbb865;return db[_0xf1ca('0x3a')]['findOne']({'where':{'id':_0x17b0a6[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0xd8db13,null))[_0xf1ca('0x1e')](function(_0x2063bc){if(_0x2063bc){_0x14a6e9=_0x2063bc;_0x60151b[_0xf1ca('0xd2')]=_['keys'](db[_0xf1ca('0x126')]['rawAttributes']);_0x60151b[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x17b0a6[_0xf1ca('0x47')]);_0x60151b[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x60151b[_0xf1ca('0xd2')],_0x60151b['query']);_0x18f28a[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x60151b[_0xf1ca('0xd2')],qs[_0xf1ca('0xd7')](_0x17b0a6[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x18f28a[_0xf1ca('0x4c')]=_0x18f28a[_0xf1ca('0x4c')][_0xf1ca('0x51')]?_0x18f28a[_0xf1ca('0x4c')]:_0x60151b[_0xf1ca('0xd2')];_0x18f28a[_0xf1ca('0xd8')]=qs['sort'](_0x17b0a6[_0xf1ca('0x47')][_0xf1ca('0xd9')]);_0x18f28a['where']=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x17b0a6['query'],_0x60151b['filters']));if(_0x17b0a6[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x18f28a['where']=_[_0xf1ca('0x5c')](_0x18f28a[_0xf1ca('0xda')],{'$or':_[_0xf1ca('0x33')](_0x18f28a[_0xf1ca('0x4c')],function(_0x4337b3){var _0xc858e6={};_0xc858e6[_0x4337b3]={'$like':'%'+_0x17b0a6[_0xf1ca('0x47')][_0xf1ca('0x31')]+'%'};return _0xc858e6;})});}_0x18f28a=_[_0xf1ca('0x5c')]({},_0x18f28a,_0x17b0a6['options']);return _0x14a6e9[_0xf1ca('0x125')](_0x18f28a);}})[_0xf1ca('0x1e')](function(_0x167869){if(_0x167869){_0xcbb865=_0x167869['length'];if(!_0x17b0a6['query']['hasOwnProperty'](_0xf1ca('0xde'))){_0x18f28a[_0xf1ca('0x19')]=qs[_0xf1ca('0x19')](_0x17b0a6['query'][_0xf1ca('0x19')]);_0x18f28a[_0xf1ca('0x17')]=qs['offset'](_0x17b0a6['query'][_0xf1ca('0x17')]);}return _0x14a6e9[_0xf1ca('0x125')](_0x18f28a);}})['then'](function(_0x238001){if(_0x238001){return _0x238001?{'count':_0xcbb865,'rows':_0x238001}:null;}})[_0xf1ca('0x1e')](respondWithResult(_0xd8db13,null))['catch'](handleError(_0xd8db13,null));};exports[_0xf1ca('0x127')]=function(_0x19a924,_0x1d0638){var _0x53f602={};var _0x511396={};var _0x41322c;return db[_0xf1ca('0x3a')][_0xf1ca('0xd0')]({'where':{'id':_0x19a924[_0xf1ca('0x5b')]['id']}})[_0xf1ca('0x1e')](handleEntityNotFound(_0x1d0638,null))['then'](function(_0x153e31){if(_0x153e31){_0x41322c=_0x153e31;_0x511396['model']=_[_0xf1ca('0xd3')](db[_0xf1ca('0x3a')][_0xf1ca('0x3b')]);_0x511396[_0xf1ca('0x47')]=_[_0xf1ca('0xd3')](_0x19a924[_0xf1ca('0x47')]);_0x511396[_0xf1ca('0xd5')]=_[_0xf1ca('0xd6')](_0x511396['model'],_0x511396['query']);_0x53f602[_0xf1ca('0x4c')]=_[_0xf1ca('0xd6')](_0x511396['model'],qs[_0xf1ca('0xd7')](_0x19a924[_0xf1ca('0x47')][_0xf1ca('0xd7')]));_0x53f602[_0xf1ca('0x4c')]=_0x53f602[_0xf1ca('0x4c')]['length']?_0x53f602[_0xf1ca('0x4c')]:_0x511396['model'];_0x53f602['order']=qs['sort'](_0x19a924['query'][_0xf1ca('0xd9')]);_0x53f602[_0xf1ca('0xda')]=qs[_0xf1ca('0xd5')](_[_0xf1ca('0xdb')](_0x19a924[_0xf1ca('0x47')],_0x511396[_0xf1ca('0xd5')]));if(_0x19a924[_0xf1ca('0x47')][_0xf1ca('0x31')]){_0x53f602['where']=_['merge'](_0x53f602[_0xf1ca('0xda')],{'$or':_['map'](_0x53f602['attributes'],function(_0xef5b65){var _0x56ec15={};_0x56ec15[_0xef5b65]={'$like':'%'+_0x19a924['query'][_0xf1ca('0x31')]+'%'};return _0x56ec15;})});}_0x53f602[_0xf1ca('0xd2')]=db[_0xf1ca('0x3a')];_0x53f602['as']=_0xf1ca('0x85');_0x53f602=_['merge']({},_0x53f602,_0x19a924[_0xf1ca('0x5d')]);return _0x41322c[_0xf1ca('0x100')]({'include':[_0x53f602]});}})[_0xf1ca('0x1e')](function(_0x157b46){if(_0x157b46){var _0x1140ea={},_0x2ff4d7=[];for(var _0x1b3d8f=0x0;_0x1b3d8f<_0x157b46['length'];_0x1b3d8f+=0x1){for(var _0x356edf=0x0,_0x3ad828;_0x356edf<_0x157b46[_0x1b3d8f][_0xf1ca('0x85')][_0xf1ca('0x51')];_0x356edf+=0x1){_0x3ad828=_0x157b46[_0x1b3d8f][_0xf1ca('0x85')][_0x356edf]['get']({'plain':!![]});_0x1140ea[_0x3ad828['id']]=_0x3ad828;}}_0x1140ea=_['values'](_0x1140ea);for(var _0x6648fb=qs[_0xf1ca('0x17')](_0x19a924['query'][_0xf1ca('0x17')]);_0x6648fb<_0x1140ea['length']&&_0x2ff4d7['length']=_0x4d7e0e){_0x436a5c=_0x4d7e0e;_0x5ccb5f=0xc8;}else{_0x5ccb5f=0xce;}_0x2055c8[_0xfadb('0x12')](_0x5ccb5f);return _0x2055c8[_0xfadb('0x18')](_0xfadb('0x19'),_0x2414bf+'-'+_0x436a5c+'/'+_0x4d7e0e)[_0xfadb('0x13')](_0x494aa1);}return null;};}function respondWithRpcPromise(_0x9e3cf0,_0x3c6413,_0x9599aa,_0x282979){return new Promise(function(_0x2b1850,_0x7bb163){var _0x29de9c=_0x282979||amiClient;return _0x29de9c[_0xfadb('0x1a')](_0x9e3cf0,_0x9599aa)[_0xfadb('0x1b')](function(_0x299ee3){logger[_0xfadb('0x1c')]('User,\x20%s,\x20%s',_0x3c6413,'request\x20sent');logger[_0xfadb('0x1d')](_0xfadb('0x1e'),_0x3c6413,_0xfadb('0x1f'),JSON[_0xfadb('0x20')](_0x299ee3));if(_0x299ee3[_0xfadb('0x21')]){if(_0x299ee3[_0xfadb('0x21')][_0xfadb('0x22')]===0x1f4){logger[_0xfadb('0x21')](_0xfadb('0x23'),_0x3c6413,_0x299ee3[_0xfadb('0x21')][_0xfadb('0x24')]);return _0x7bb163(_0x299ee3[_0xfadb('0x21')][_0xfadb('0x24')]);}logger[_0xfadb('0x21')]('User,\x20%s,\x20%s',_0x3c6413,_0x299ee3[_0xfadb('0x21')][_0xfadb('0x24')]);return _0x2b1850(_0x299ee3[_0xfadb('0x21')][_0xfadb('0x24')]);}else{logger['info'](_0xfadb('0x23'),_0x3c6413,_0xfadb('0x1f'));_0x2b1850(_0x299ee3[_0xfadb('0x25')]['message']);}})['catch'](function(_0xdddaec){logger['error'](_0xfadb('0x23'),_0x3c6413,_0xdddaec);_0x7bb163(_0xdddaec);});});}function saveUpdates(_0x689061){return function(_0xbddd10){if(_0xbddd10){return _0xbddd10[_0xfadb('0x26')](_0x689061)['then'](function(_0xd749a5){if(_0xd749a5['role']===_0xfadb('0x27')){socket['emit'](_0xfadb('0x28')+_0xd749a5['id'],_0xd749a5);}return _0xd749a5;});}return null;};}function removeEntity(_0x1e6902,_0x425ae5){return function(_0x208aa3){if(_0x208aa3){return _0x208aa3[_0xfadb('0x29')]({'transaction':_0x425ae5})['then'](function(){var _0x2ea385=_0x208aa3[_0xfadb('0x2a')]({'plain':!![]});if(_0x2ea385[_0xfadb('0x2b')]===_0xfadb('0x2c'))return;var _0x21843c=[{'name':_0xfadb('0x2d'),'value':_0xfadb('0x2e'),'ignore':!![]},{'name':_0xfadb('0x2f'),'value':_0xfadb('0x27'),'ignore':![]},{'name':_0xfadb('0x30'),'value':_0xfadb('0x31'),'ignore':![]}];var _0x416cd3=_(_0x21843c)[_0xfadb('0x32')](_0xfadb('0x33'))[_0xfadb('0x34')](_0xfadb('0x35'))[_0xfadb('0x35')]();if(_['includes'](_0x416cd3,_0x2ea385[_0xfadb('0x2b')])){return;}var _0x59688c=_[_0xfadb('0x36')](_0x21843c,[_0xfadb('0x35'),_0x2ea385[_0xfadb('0x2b')]])[_0xfadb('0x37')];return db['UserProfileResource'][_0xfadb('0x29')]({'where':{'type':_0x59688c,'resourceId':_0x2ea385['id']},'transaction':_0x425ae5})[_0xfadb('0x1b')](function(){return _0x208aa3;});})['then'](function(){_0x1e6902[_0xfadb('0x12')](0xcc)[_0xfadb('0x38')]();});}};}function handleEntityNotFound(_0x345dde){return function(_0xadda79){if(!_0xadda79){_0x345dde['sendStatus'](0x194);}return _0xadda79;};}function handleError(_0x59e5c6,_0x3a0c88){_0x3a0c88=_0x3a0c88||0x1f4;return function(_0x327e6f){logger[_0xfadb('0x21')](_0x327e6f[_0xfadb('0x39')]);if(_0x327e6f['name']){delete _0x327e6f[_0xfadb('0x37')];}_0x59e5c6['status'](_0x3a0c88)['send'](_0x327e6f);};}function getUserAttributes(){return _(db[_0xfadb('0x3a')]['rawAttributes'])[_0xfadb('0x34')](function(_0x5a6d5e){return{'name':_0x5a6d5e[_0xfadb('0x3b')],'type':_0x5a6d5e[_0xfadb('0x3c')][_0xfadb('0x3d')]};})[_0xfadb('0x32')](function(_0x15f5c5){return![_0xfadb('0x3e'),'salt',_0xfadb('0x3f'),_0xfadb('0x40'),_0xfadb('0x41'),_0xfadb('0x42')][_0xfadb('0x43')](_0x15f5c5[_0xfadb('0x37')]);})[_0xfadb('0x35')]();}exports['index']=function(_0x143b62,_0x22e66b){var _0x37b40c={},_0x3efce1={'count':0x0,'rows':[]};var _0x1f6831=getUserAttributes();_0x37b40c=qs[_0xfadb('0x44')](_0x1f6831,_0x143b62);var _0x324ed1={'where':_0x37b40c['where']};return db[_0xfadb('0x3a')][_0xfadb('0x16')](_0x324ed1)[_0xfadb('0x1b')](function(_0x2c967a){_0x3efce1[_0xfadb('0x16')]=_0x2c967a;if(_0x143b62[_0xfadb('0x45')][_0xfadb('0x46')]){_0x37b40c['include']=[{'all':!![]}];}if(_0x143b62['query']['userSetting']==='true'){_0x37b40c[_0xfadb('0x47')]=[{'model':db[_0xfadb('0x48')],'as':_0xfadb('0x49')}];}if(!_[_0xfadb('0x43')](_0x37b40c[_0xfadb('0x4a')],'id')){_0x37b40c[_0xfadb('0x4a')][_0xfadb('0x4b')]('id');}return db[_0xfadb('0x3a')][_0xfadb('0x4c')](_0x37b40c);})[_0xfadb('0x1b')](function(_0x33ec0b){_0x3efce1[_0xfadb('0x4d')]=_0x33ec0b;if(_0x143b62[_0xfadb('0x45')]['openTabs']===_0xfadb('0x4e')){var _0x308fdf=[];for(var _0x1bfd28=0x0;_0x1bfd28<_0x3efce1[_0xfadb('0x4d')][_0xfadb('0x4f')];_0x1bfd28++){_0x308fdf['push'](get_open_tabs(_0xfadb('0x50'),_0x3efce1[_0xfadb('0x4d')][_0x1bfd28]['dataValues']));_0x308fdf[_0xfadb('0x4b')](get_open_tabs('sms',_0x3efce1[_0xfadb('0x4d')][_0x1bfd28]['dataValues']));_0x308fdf['push'](get_open_tabs(_0xfadb('0x51'),_0x3efce1['rows'][_0x1bfd28][_0xfadb('0x52')]));_0x308fdf['push'](get_open_tabs(_0xfadb('0x53'),_0x3efce1['rows'][_0x1bfd28][_0xfadb('0x52')]));_0x308fdf['push'](get_open_tabs(_0xfadb('0x54'),_0x3efce1[_0xfadb('0x4d')][_0x1bfd28]['dataValues']));_0x308fdf['push'](get_open_tabs(_0xfadb('0x55'),_0x3efce1[_0xfadb('0x4d')][_0x1bfd28][_0xfadb('0x52')]));}return Promise[_0xfadb('0x56')](_0x308fdf)[_0xfadb('0x1b')](function(){return _0x3efce1;});}else{return _0x3efce1;}})[_0xfadb('0x1b')](respondWithFilteredResult(_0x22e66b,_0x37b40c))[_0xfadb('0x57')](handleError(_0x22e66b,null));};exports['show']=function(_0x34e895,_0x4a36d1){var _0x5320a7=getUserAttributes();_0x34e895[_0xfadb('0x45')]['id']=_0x34e895[_0xfadb('0x58')]['id'];var _0x377bcb=qs['getOptions'](_0x5320a7,_0x34e895);if(_0x34e895[_0xfadb('0x45')][_0xfadb('0x46')]){_0x377bcb['include']=[{'all':!![]}];}if(_0x34e895[_0xfadb('0x45')]['userSetting']===_0xfadb('0x4e')){_0x377bcb['include']=[{'model':db[_0xfadb('0x48')],'as':'userSetting'}];}_0x377bcb=_[_0xfadb('0x59')]({},_0x377bcb,_0x34e895['options']);if(!_['includes'](_0x377bcb['attributes'],'id')){_0x377bcb[_0xfadb('0x4a')][_0xfadb('0x4b')]('id');}return db[_0xfadb('0x3a')][_0xfadb('0x36')](_0x377bcb)[_0xfadb('0x1b')](handleEntityNotFound(_0x4a36d1,null))[_0xfadb('0x1b')](function(_0x1ca58f){var _0x2ac3ac=[];values=_0x1ca58f;if(_0x34e895[_0xfadb('0x45')]['openTabs']===_0xfadb('0x4e')){_0x2ac3ac[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x50'),_0x1ca58f[_0xfadb('0x52')]));_0x2ac3ac[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x5a'),_0x1ca58f[_0xfadb('0x52')]));_0x2ac3ac[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x54'),_0x1ca58f[_0xfadb('0x52')]));_0x2ac3ac[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x55'),_0x1ca58f[_0xfadb('0x52')]));_0x2ac3ac[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x51'),_0x1ca58f[_0xfadb('0x52')]));_0x2ac3ac['push'](get_open_tabs(_0xfadb('0x53'),_0x1ca58f['dataValues']));return Promise[_0xfadb('0x56')](_0x2ac3ac);}else{return values;}})['then'](function(){return values;})[_0xfadb('0x1b')](respondWithResult(_0x4a36d1,null))['catch'](handleError(_0x4a36d1,null));};exports[_0xfadb('0x26')]=function(_0x2627aa,_0x35c238){if(_0x2627aa[_0xfadb('0x5b')]['id']){delete _0x2627aa[_0xfadb('0x5b')]['id'];}delete _0x2627aa['body'][_0xfadb('0x2b')];return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x2627aa[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x35c238,null))['then'](saveUpdates(_0x2627aa[_0xfadb('0x5b')],null))['then'](respondWithResult(_0x35c238,null))[_0xfadb('0x57')](handleError(_0x35c238,null));};exports[_0xfadb('0x5c')]=function(_0x5ce55f,_0x4b5a05){return db['User'][_0xfadb('0x5c')]()['then'](respondWithResult(_0x4b5a05,null))[_0xfadb('0x57')](handleError(_0x4b5a05,null));};exports['addContacts']=function(_0x2c7ba8,_0x588931){return db['User'][_0xfadb('0x36')]({'where':{'id':_0x2c7ba8[_0xfadb('0x58')]['id']}})['then'](handleEntityNotFound(_0x588931,null))[_0xfadb('0x1b')](function(_0x38300c){if(_0x38300c){return _0x38300c['addContacts'](_0x2c7ba8[_0xfadb('0x5b')][_0xfadb('0x5d')],_[_0xfadb('0x5e')](_0x2c7ba8['body'],[_0xfadb('0x5d'),'id'])||{});}})[_0xfadb('0x1b')](respondWithResult(_0x588931,null))[_0xfadb('0x57')](handleError(_0x588931,null));};function validateUser(_0x11e2d6){return new Promise(function(_0x41b900,_0x1e3947){if(_0x11e2d6[_0xfadb('0x5f')])return _0x41b900(_0x11e2d6);return db[_0xfadb('0x60')][_0xfadb('0x61')](0x1)['then'](function(_0x5a7af1){if(_0x5a7af1[_0xfadb('0x62')])authService[_0xfadb('0x63')](_0x11e2d6[_0xfadb('0x3e')]);db[_0xfadb('0x3a')][_0xfadb('0x64')](_0xfadb('0x5f'))[_0xfadb('0x1b')](function(_0x30da64){if(_[_0xfadb('0x65')](_0x30da64)){_0x11e2d6[_0xfadb('0x5f')]=_0x5a7af1[_0xfadb('0x66')]||0x1;return;}if(_[_0xfadb('0x65')](_0x5a7af1[_0xfadb('0x66')])||_0x5a7af1[_0xfadb('0x66')]===_0x30da64){_0x11e2d6[_0xfadb('0x5f')]=_0x30da64+0x1;return;}if(_0x5a7af1[_0xfadb('0x66')]>_0x30da64){_0x11e2d6[_0xfadb('0x5f')]=_0x5a7af1['min_internal'];return;}return db[_0xfadb('0x67')][_0xfadb('0x45')](_0xfadb('0x68'),{'type':db[_0xfadb('0x67')][_0xfadb('0x69')][_0xfadb('0x6a')]})[_0xfadb('0x1b')](function(_0x59280f){if(_0x59280f&&_0x59280f['length']){for(var _0x18ca15=0x0,_0x5635b2=_0x59280f[_0xfadb('0x4f')];_0x18ca15<_0x5635b2&&_['isNil'](_0x11e2d6[_0xfadb('0x5f')]);_0x18ca15++){if(_0x5a7af1[_0xfadb('0x66')]<=_0x59280f[_0x18ca15][_0xfadb('0x6b')]){_0x11e2d6[_0xfadb('0x5f')]=_0x59280f[_0x18ca15][_0xfadb('0x6b')];}else if(_0x5a7af1[_0xfadb('0x66')]>_0x59280f[_0x18ca15]['from']&&_0x5a7af1[_0xfadb('0x66')]<=_0x59280f[_0x18ca15]['to']){_0x11e2d6[_0xfadb('0x5f')]=_0x5a7af1[_0xfadb('0x66')];}}}if(_[_0xfadb('0x65')](_0x11e2d6[_0xfadb('0x5f')])){_0x11e2d6[_0xfadb('0x5f')]=_0x30da64+0x1;}return _0x41b900(_0x11e2d6);});});})[_0xfadb('0x57')](function(_0x2ec526){_0x1e3947(_0x2ec526);});});}function updateUser(_0xcb8980){return new Promise(function(_0x17fbef,_0xf2a2c2){try{if(_0xcb8980[_0xfadb('0x6c')]){_0xcb8980[_0xfadb('0x6d')]=_0xcb8980[_0xfadb('0x5f')];_0xcb8980['VoiceMail']={'mailbox':_0xcb8980[_0xfadb('0x5f')],'password':_0xcb8980['password'],'fullname':_0xcb8980[_0xfadb('0x6e')],'email':_0xcb8980['email']};}if(_0xcb8980['role']===_0xfadb('0x27')){if(!_0xcb8980['permissions'])_0xcb8980[_0xfadb('0x6f')]=[_0xfadb('0x70'),_0xfadb('0x71'),'103',_0xfadb('0x72'),_0xfadb('0x73'),_0xfadb('0x74'),_0xfadb('0x75'),'106',_0xfadb('0x76'),_0xfadb('0x77'),_0xfadb('0x78'),_0xfadb('0x79'),_0xfadb('0x7a'),_0xfadb('0x7b'),_0xfadb('0x7c')];}_0x17fbef(_0xcb8980);}catch(_0xd7995){_0xf2a2c2(_0xd7995);}});}exports['create']=function(_0x133fc5,_0x229768){if(_0x133fc5[_0xfadb('0x2e')]['role']===_0xfadb('0x27'))throw new Error(_0xfadb('0x7d'));if(_0x133fc5[_0xfadb('0x5b')][_0xfadb('0x2b')]===_0xfadb('0x2e')&&_0x133fc5[_0xfadb('0x2e')][_0xfadb('0x2b')]!==_0xfadb('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x133fc5[_0xfadb('0x5b')][_0xfadb('0x2b')]===_0xfadb('0x2c')&&_0x133fc5[_0xfadb('0x2e')][_0xfadb('0x2b')]!==_0xfadb('0x2c')){throw new Error(_0xfadb('0x7e'));}return licenseUtil[_0xfadb('0x7f')]([_0x133fc5[_0xfadb('0x5b')]])[_0xfadb('0x1b')](function(){return validateUser(_0x133fc5['body']);})[_0xfadb('0x1b')](function(_0x15bfd6){return updateUser(_0x15bfd6)[_0xfadb('0x1b')](function(_0x4ac978){if(_0x4ac978[_0xfadb('0x2b')]===_0xfadb('0x2c')){_0x4ac978[_0xfadb('0x80')]=_0x133fc5[_0xfadb('0x2e')][_0xfadb('0x80')];delete _0x4ac978['userProfileId'];}return _0x4ac978;});})[_0xfadb('0x1b')](function(_0xc496e6){return db[_0xfadb('0x3a')][_0xfadb('0x81')](_0xc496e6,{'include':[{'model':db['VoiceMail'],'as':_0xfadb('0x82')}]});})['then'](function(_0x1d0205){if(_0x133fc5[_0xfadb('0x5b')][_0xfadb('0x2b')]===_0xfadb('0x2e'))return _0x1d0205;if(_0x133fc5[_0xfadb('0x2e')][_0xfadb('0x2b')]!==_0xfadb('0x2e'))return _0x1d0205;return db['UserProfileSection'][_0xfadb('0x36')]({'where':{'name':_0x1d0205[_0xfadb('0x2b')]===_0xfadb('0x27')?_0xfadb('0x2f'):'Telephones','userProfileId':_0x133fc5[_0xfadb('0x2e')]['userProfileId']},'raw':!![]})[_0xfadb('0x1b')](function(_0x387e37){if(!_0x387e37||_0x387e37['autoAssociation']!=0x0)return _0x1d0205;return db[_0xfadb('0x83')][_0xfadb('0x81')]({'name':_0x1d0205[_0xfadb('0x37')],'resourceId':_0x1d0205['id'],'type':_0x387e37['name'],'sectionId':_0x387e37['id']},{})[_0xfadb('0x1b')](function(){return _0x1d0205;});})['catch'](function(_0x26f0dd){logger[_0xfadb('0x21')](_0xfadb('0x84'),_0x26f0dd);throw _0x26f0dd;});})[_0xfadb('0x1b')](respondWithResult(_0x229768,0xc9))[_0xfadb('0x57')](handleError(_0x229768,null));};exports[_0xfadb('0x85')]=function(_0x15cc5e,_0x27fb9a){var _0x22c326=_0x15cc5e[_0xfadb('0x5b')];var _0x122f6c=[];if(_0x15cc5e['user']['role']===_0xfadb('0x27'))throw new Error(_0xfadb('0x7d'));if(_[_0xfadb('0x86')](_0x22c326,[_0xfadb('0x2b'),'user'])&&_0x15cc5e[_0xfadb('0x2e')][_0xfadb('0x2b')]!==_0xfadb('0x2c')){throw new Error(_0xfadb('0x87'));}if(_[_0xfadb('0x86')](_0x22c326,[_0xfadb('0x2b'),_0xfadb('0x2c')])&&_0x15cc5e['user'][_0xfadb('0x2b')]!==_0xfadb('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0xfadb('0x7f')](_0x22c326)[_0xfadb('0x1b')](function(){return validateUser(_0x22c326[0x0]);})[_0xfadb('0x1b')](function(){for(var _0x517d3c=0x1;_0x517d3c<_0x22c326[_0xfadb('0x4f')];_0x517d3c++){var _0x1eb645=_0x22c326[_0x517d3c-0x1][_0xfadb('0x5f')];if(!_0x22c326[_0x517d3c][_0xfadb('0x5f')])_0x22c326[_0x517d3c]['internal']=_0x1eb645+0x1;_0x122f6c['push'](validateUser(_0x22c326[_0x517d3c]));}return Promise['all'](_0x122f6c);})[_0xfadb('0x1b')](function(){_0x122f6c=[];for(var _0xda765f=0x0;_0xda765f<_0x22c326[_0xfadb('0x4f')];_0xda765f++){_0x122f6c[_0xfadb('0x4b')](updateUser(_0x22c326[_0xda765f]));}return Promise[_0xfadb('0x56')](_0x122f6c);})[_0xfadb('0x1b')](function(){_0x122f6c=_0x22c326[_0xfadb('0x34')](function(_0x4a73fd){return db['User'][_0xfadb('0x81')](_0x4a73fd,{'include':[{'model':db['VoiceMail'],'as':_0xfadb('0x82')}]})['then'](function(_0x3e96b1){_0x4a73fd['id']=_0x3e96b1['id'];return _0x4a73fd;});});return Promise[_0xfadb('0x56')](_0x122f6c);})[_0xfadb('0x1b')](function(_0x96f5){if(_0x15cc5e['body']['role']==='user')return _0x96f5;if(_0x15cc5e['user'][_0xfadb('0x2b')]!==_0xfadb('0x2e'))return _0x96f5;var _0x3af314=_[_0xfadb('0x86')](_0x96f5,function(_0x578470){return _0x578470[_0xfadb('0x2b')]===_0xfadb('0x27')||_0x578470[_0xfadb('0x2b')]===_0xfadb('0x31');});if(!_0x3af314)return _0x96f5;return db[_0xfadb('0x88')][_0xfadb('0x4c')]({'where':{'name':{'$or':[_0xfadb('0x2f'),_0xfadb('0x30')]},'userProfileId':_0x15cc5e[_0xfadb('0x2e')][_0xfadb('0x89')]},'raw':!![]})[_0xfadb('0x1b')](function(_0x2b105f){if(_[_0xfadb('0x8a')](_0x2b105f)||!_[_0xfadb('0x86')](_0x2b105f,[_0xfadb('0x8b'),0x0]))return _0x96f5;_0x122f6c=[];var _0x536ef0=_(_0x2b105f)[_0xfadb('0x34')](function(_0x1f79d0){if(_0x1f79d0[_0xfadb('0x8b')]===0x1)return;return _0x1f79d0[_0xfadb('0x37')]===_0xfadb('0x2f')?_0xfadb('0x27'):'telephone';})[_0xfadb('0x8c')]()[_0xfadb('0x35')]();for(var _0x31e5e9=0x0;_0x31e5e9<_0x96f5[_0xfadb('0x4f')];_0x31e5e9++){if(!_[_0xfadb('0x43')](_0x536ef0,_0x96f5[_0x31e5e9][_0xfadb('0x2b')]))return;var _0x2f82f4=_0x96f5[_0x31e5e9]['role']===_0xfadb('0x27')?_0xfadb('0x2f'):_0xfadb('0x30');_0x122f6c['push'](db[_0xfadb('0x83')][_0xfadb('0x81')]({'name':_0x96f5[_0x31e5e9][_0xfadb('0x37')],'resourceId':_0x96f5[_0x31e5e9]['id'],'type':_0x2f82f4,'sectionId':_[_0xfadb('0x36')](_0x2b105f,[_0xfadb('0x37'),_0x2f82f4])['id']},{}));}return Promise[_0xfadb('0x56')](_0x122f6c);});})['then'](respondWithResult(_0x27fb9a,0xc9))['catch'](handleError(_0x27fb9a,null));};exports[_0xfadb('0x8d')]=function(_0x2131f5,_0xa5cb14){if(_0x2131f5[_0xfadb('0x5b')]['id']){delete _0x2131f5[_0xfadb('0x5b')]['id'];}return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x2131f5[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](function(_0x2388cd){if(!_0x2388cd)return null;if(_0x2388cd['id']===_0x2131f5[_0xfadb('0x2e')]['id']){if(!_0x2131f5[_0xfadb('0x5b')][_0xfadb('0x8e')]||!_0x2131f5[_0xfadb('0x5b')][_0xfadb('0x8f')]){throw new db['Sequelize']['ValidationError'](_0xfadb('0x90'));}if(!_0x2388cd['authenticate'](_0x2131f5[_0xfadb('0x5b')][_0xfadb('0x8e')])){throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))](_0xfadb('0x93'));}if(_0x2131f5['body'][_0xfadb('0x8e')]===_0x2131f5[_0xfadb('0x5b')][_0xfadb('0x8f')]){throw new db[(_0xfadb('0x91'))]['ValidationError'](_0xfadb('0x94'));}}else if(_0x2131f5['user']['role']===_0xfadb('0x2c')){if(!_0x2131f5[_0xfadb('0x5b')]['newPassword']){throw new db['Sequelize'][(_0xfadb('0x92'))](_0xfadb('0x95'));}}else if(_0x2131f5[_0xfadb('0x2e')][_0xfadb('0x2b')]===_0xfadb('0x2e')){if(!_0x2131f5[_0xfadb('0x5b')]['newPassword']){throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))](_0xfadb('0x95'));}if(_0x2388cd[_0xfadb('0x2b')]!==_0xfadb('0x27')){throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))](_0xfadb('0x7d'));}}else{throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))](_0xfadb('0x7d'));}return _0x2388cd;})[_0xfadb('0x1b')](handleEntityNotFound(_0xa5cb14,null))[_0xfadb('0x1b')](function(_0x3d38e6){return db[_0xfadb('0x60')]['findOne']({'attributes':['id','securePassword',_0xfadb('0x96'),_0xfadb('0x97')]})[_0xfadb('0x1b')](function(_0x3ae95d){if(_0x3ae95d[_0xfadb('0x62')])authService[_0xfadb('0x63')](_0x2131f5['body'][_0xfadb('0x8f')]);if(!_0x3ae95d[_0xfadb('0x96')]||!_0x3d38e6[_0xfadb('0x3f')])return _0x3d38e6;authService[_0xfadb('0x98')](_0x2131f5['body'][_0xfadb('0x8f')],_0x3d38e6[_0xfadb('0x3f')],_0x3ae95d[_0xfadb('0x97')]);return _0x3d38e6;})[_0xfadb('0x1b')](saveUpdates({'password':_0x2131f5[_0xfadb('0x5b')][_0xfadb('0x8f')],'passwordResetAt':_0x2131f5[_0xfadb('0x2e')]['id']==_0x2131f5['params']['id']?moment():null,'previousPasswords':authService[_0xfadb('0x99')](_0x2131f5['body']['newPassword'],_0x3d38e6[_0xfadb('0x3f')])},null));})['then'](respondWithResult(_0xa5cb14,null))[_0xfadb('0x57')](handleError(_0xa5cb14,null));};exports['addQueues']=function(_0x226c2b,_0x51230c){var _0x3ba136=_0x226c2b[_0xfadb('0x5b')][_0xfadb('0x9a')];return db['User'][_0xfadb('0x36')]({'where':{'id':_0x226c2b[_0xfadb('0x58')]['id']},'attributes':['id','name',_0xfadb('0x2b'),'online','loginInPause',_0xfadb('0x9b'),_0xfadb('0x9c')]})['then'](handleEntityNotFound(_0x51230c,null))[_0xfadb('0x1b')](function(_0xd59305){if(_0xd59305){if(!utils['isValidChannel'](_0x3ba136)){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0xd59305[_0xfadb('0x9d')+_[_0xfadb('0x9e')](_0x3ba136['toLowerCase']())+_0xfadb('0x9f')](_0x226c2b[_0xfadb('0x5b')]['ids'],{'penalty':_0x226c2b[_0xfadb('0x5b')][_0xfadb('0xa0')]||0x0})[_0xfadb('0xa1')](function(_0xe8cc98){for(var _0x2c3d92=0x0;_0x2c3d92<_0x226c2b[_0xfadb('0x5b')][_0xfadb('0x5d')][_0xfadb('0x4f')];_0x2c3d92+=0x1){var _0x28884b={'UserId':Number(_0x226c2b[_0xfadb('0x58')]['id'])};_0x28884b[_[_0xfadb('0x9e')](_0x3ba136[_0xfadb('0xa2')]())+_0xfadb('0xa3')]=Number(_0x226c2b[_0xfadb('0x5b')][_0xfadb('0x5d')][_0x2c3d92]);socket[_0xfadb('0xa4')](_0xfadb('0x2e')+_[_0xfadb('0x9e')](_0x3ba136[_0xfadb('0xa2')]())+'Queue:save',_0x28884b);}return _0xe8cc98;})[_0xfadb('0x1b')](function(){if(_0x3ba136===_0xfadb('0xa5')){return db[_0xfadb('0xa6')][_0xfadb('0x4c')]({'where':{'id':_0x226c2b[_0xfadb('0x5b')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0xfadb('0x1b')](function(_0x1f4a4b){var _0x2b4e7c=_0xd59305[_0xfadb('0x2a')]({'plain':!![]});var _0x3505c7=[];if(_0x3ba136==='voice'&&_0x2b4e7c[_0xfadb('0x2b')]===_0xfadb('0x27')&&_0x2b4e7c['online']){for(let _0x167eb6=0x0;_0x167eb6<_0x1f4a4b[_0xfadb('0x4f')];_0x167eb6+=0x1){_0x3505c7[_0xfadb('0x4b')]({'membername':_0x2b4e7c['name'],'UserId':_0x2b4e7c['id'],'queue_name':_0x1f4a4b[_0x167eb6][_0xfadb('0x37')],'VoiceQueueId':_0x1f4a4b[_0x167eb6]['id'],'interface':_[_0xfadb('0x65')](_0x2b4e7c[_0xfadb('0x9c')])?util[_0xfadb('0xa7')](_0xfadb('0xa8'),_0x2b4e7c[_0xfadb('0x37')]):_0x2b4e7c[_0xfadb('0x9c')],'paused':_0x2b4e7c[_0xfadb('0x9b')]||![],'penalty':_0x226c2b[_0xfadb('0x5b')][_0xfadb('0xa0')]||0x0});}return Promise[_0xfadb('0x56')](_0x3505c7[_0xfadb('0x34')](function(_0x480735){return db[_0xfadb('0xa9')][_0xfadb('0xaa')](_0x480735);}));}return _0xd59305;});}})[_0xfadb('0x1b')](respondWithStatusCode(_0x51230c,null))['catch'](handleError(_0x51230c,null));};exports[_0xfadb('0xab')]=function(_0x26cc16,_0x1f2936){var _0x46a35a,_0x2d9804;return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x26cc16['params']['id']},'attributes':['id',_0xfadb('0x37'),_0xfadb('0x2b')]})['then'](handleEntityNotFound(_0x1f2936,null))[_0xfadb('0x1b')](function(_0x255e2e){if(_0x255e2e){_0x46a35a=_0x255e2e;if(!_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')]||!utils['isValidChannel'](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')])){throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))]('Unknown\x20channel');}return _0x255e2e[_0xfadb('0xac')+_[_0xfadb('0x9e')](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')][_0xfadb('0xa2')]())+_0xfadb('0x9f')](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x5d')]);}})[_0xfadb('0x1b')](function(_0x2627e9){if(_['isArray'](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x5d')])){for(var _0x1f1af3=0x0;_0x1f1af3<_0x26cc16[_0xfadb('0x45')][_0xfadb('0x5d')]['length'];_0x1f1af3+=0x1){_0x2d9804={'UserId':Number(_0x26cc16['params']['id'])};_0x2d9804[_[_0xfadb('0x9e')](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')]['toLowerCase']())+_0xfadb('0xa3')]=Number(_0x26cc16[_0xfadb('0x45')][_0xfadb('0x5d')][_0x1f1af3]);socket[_0xfadb('0xa4')](_0xfadb('0x2e')+_[_0xfadb('0x9e')](_0x26cc16['query'][_0xfadb('0x9a')][_0xfadb('0xa2')]())+'Queue:remove',_0x2d9804);}}else{_0x2d9804={'UserId':Number(_0x26cc16[_0xfadb('0x58')]['id'])};_0x2d9804[_[_0xfadb('0x9e')](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')]['toLowerCase']())+_0xfadb('0xa3')]=Number(_0x26cc16['query'][_0xfadb('0x5d')]);socket[_0xfadb('0xa4')](_0xfadb('0x2e')+_['capitalize'](_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')][_0xfadb('0xa2')]())+_0xfadb('0xad'),_0x2d9804);}return _0x2627e9;})[_0xfadb('0x1b')](function(){if(_0x26cc16[_0xfadb('0x45')][_0xfadb('0x9a')]===_0xfadb('0xa5')){return db[_0xfadb('0xa9')][_0xfadb('0x29')]({'where':{'UserId':_0x26cc16[_0xfadb('0x58')]['id'],'VoiceQueueId':_0x26cc16[_0xfadb('0x45')][_0xfadb('0x5d')]},'individualHooks':!![]})['then'](function(){return _0x46a35a;});}return _0x46a35a;})[_0xfadb('0x1b')](respondWithStatusCode(_0x1f2936,null))[_0xfadb('0x57')](handleError(_0x1f2936,null));};exports['addAvatar']=function(_0x52ef51,_0x321c64){_0x52ef51[_0xfadb('0x5b')][_0xfadb('0xae')]=_0x52ef51[_0xfadb('0xaf')]['filename'];return db['User']['find']({'where':{'id':_0x52ef51[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x321c64,null))[_0xfadb('0x1b')](saveUpdates(_0x52ef51[_0xfadb('0x5b')],null))['then'](respondWithResult(_0x321c64,null))['catch'](handleError(_0x321c64,null));};exports[_0xfadb('0xb0')]=function(_0x456d41,_0xa23dd1){var _0x22fdc4=path[_0xfadb('0xb1')](config[_0xfadb('0xb2')],'server/files/images/logos/default_profile.png');return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x456d41['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0xfadb('0x1b')](handleEntityNotFound(_0xa23dd1,null))[_0xfadb('0x1b')](function(_0x377cb2){if(_0x377cb2){if(_['isNil'](_0x377cb2[_0xfadb('0xae')])){return _0xa23dd1[_0xfadb('0xb3')](_0x22fdc4);}else{if(!fs[_0xfadb('0xb4')](path[_0xfadb('0xb1')](config['root'],'server/files/images/',_0x377cb2[_0xfadb('0xae')]))){return _0xa23dd1[_0xfadb('0xb3')](_0x22fdc4);}return _0xa23dd1['download'](path[_0xfadb('0xb1')](config[_0xfadb('0xb2')],'server/files/images/',_0x377cb2[_0xfadb('0xae')]));}}})[_0xfadb('0x57')](handleError(_0xa23dd1,null));};exports[_0xfadb('0xb5')]=function(_0x54f514,_0x25a6d2){return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x54f514['params']['id']},'attributes':['id']})[_0xfadb('0x1b')](handleEntityNotFound(_0x25a6d2,null))[_0xfadb('0x1b')](function(_0x36f22e){var _0x5acaed=[];values=_0x36f22e[_0xfadb('0x52')];_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x50'),_0x36f22e[_0xfadb('0x52')]));_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x5a'),_0x36f22e['dataValues']));_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x54'),_0x36f22e[_0xfadb('0x52')]));_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x55'),_0x36f22e['dataValues']));_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x51'),_0x36f22e[_0xfadb('0x52')]));_0x5acaed[_0xfadb('0x4b')](get_open_tabs(_0xfadb('0x53'),_0x36f22e[_0xfadb('0x52')]));return Promise['all'](_0x5acaed);})[_0xfadb('0x1b')](function(_0x42ec7b){if(_0x42ec7b){var _0x24e937=_['map'](values[_0xfadb('0xb6')],function(_0x299a68){return{'channel':_0xfadb('0xb7'),'id':_0x299a68['id'],'createdAt':_0x299a68[_0xfadb('0xb8')]};});var _0x280e18=_[_0xfadb('0x34')](values[_0xfadb('0xb9')],function(_0x173688){return{'channel':_0xfadb('0xba'),'id':_0x173688['id'],'createdAt':_0x173688[_0xfadb('0xb8')]};});var _0x260567=_['map'](values['OpenchannelOpenTabs'],function(_0x341b97){return{'channel':_0xfadb('0xbb'),'id':_0x341b97['id'],'createdAt':_0x341b97[_0xfadb('0xb8')]};});var _0x4bc2d3=_[_0xfadb('0x34')](values[_0xfadb('0xbc')],function(_0x16f5de){return{'channel':_0xfadb('0xbd'),'id':_0x16f5de['id'],'createdAt':_0x16f5de[_0xfadb('0xb8')]};});var _0x30ac31=_[_0xfadb('0x34')](values[_0xfadb('0xbe')],function(_0x164dfd){return{'channel':'SMS','id':_0x164dfd['id'],'createdAt':_0x164dfd[_0xfadb('0xb8')]};});var _0x433850=_[_0xfadb('0x34')](values['WhatsappOpenTabs'],function(_0x5d2b0d){return{'channel':_0xfadb('0xbf'),'id':_0x5d2b0d['id'],'createdAt':_0x5d2b0d['createdAt']};});var _0x139a78=_[_0xfadb('0xc0')](_0x24e937,_0x280e18,_0x260567,_0x4bc2d3,_0x30ac31,_0x433850);var _0x776b77={'count':_0x139a78['length'],'rows':_0x139a78};return _0x776b77;}else return null;})[_0xfadb('0x1b')](respondWithResult(_0x25a6d2,null))['catch'](handleError(_0x25a6d2,null));};exports[_0xfadb('0xc1')]=function(_0x1d2565,_0x220636){var _0xcf94dd={};return db['User'][_0xfadb('0xc2')]({'where':{'id':_0x1d2565[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](function(_0x35596e){if(!_0x35596e){throw new APINotFoundError(util[_0xfadb('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1d2565[_0xfadb('0x58')]['id']));}return contacts[_0xfadb('0x5c')]();})['then'](function(_0x14fdf7){_0x1d2565[_0xfadb('0x45')][_0xfadb('0x3a')]=_0x1d2565[_0xfadb('0x58')]['id'];_0xcf94dd=qs['getOptions'](_0x14fdf7,_0x1d2565);if(_0x1d2565[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0x46'))){_0xcf94dd[_0xfadb('0x47')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0xfadb('0xc4')],'where':_0x1d2565[_0xfadb('0x45')][_0xfadb('0xc5')]?{'id':_0x1d2565[_0xfadb('0x45')]['tag']}:undefined,'required':_0x1d2565['query'][_0xfadb('0xc5')]?!![]:![]}];}return contacts[_0xfadb('0x4c')](_0x1d2565[_0xfadb('0x45')],_0x1d2565[_0xfadb('0x2e')],_0xcf94dd,_0x14fdf7);})['then'](respondWithFilteredResult(_0x220636,_0xcf94dd))[_0xfadb('0x57')](APIHandleError(_0x220636));};exports[_0xfadb('0xc6')]=function(_0x496d47,_0x15e834){var _0x2a8d33;var _0x3c29d2={};var _0x509c5b;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x496d47['params']['id']},'attributes':['id',_0xfadb('0x37'),'role']})['then'](handleEntityNotFound(_0x15e834,null))[_0xfadb('0x1b')](function(_0x112038){if(!utils['isValidChannel'](_0x496d47[_0xfadb('0x45')]['channel'])){throw new db[(_0xfadb('0x91'))][(_0xfadb('0x92'))]('Unknown\x20channel');}_0x2a8d33=_0x112038;var _0x5e3fcd={};_0x5e3fcd[_0xfadb('0xc7')]=_['keys'](db[_[_0xfadb('0x9e')](_0x496d47['query']['channel'])+_0xfadb('0xc8')][_0xfadb('0xc9')]);_0x5e3fcd['query']=_[_0xfadb('0xca')](_0x496d47[_0xfadb('0x45')]);_0x5e3fcd[_0xfadb('0xcb')]=_['intersection'](_0x5e3fcd[_0xfadb('0xc7')],_0x5e3fcd[_0xfadb('0x45')]);_0x3c29d2[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x5e3fcd[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x496d47[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x3c29d2[_0xfadb('0x4a')]=_0x3c29d2[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x3c29d2[_0xfadb('0x4a')]:_0x5e3fcd[_0xfadb('0xc7')];_0x3c29d2[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x496d47[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x3c29d2[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x496d47[_0xfadb('0x45')],_0x5e3fcd[_0xfadb('0xcb')]));if(_0x496d47[_0xfadb('0x45')][_0xfadb('0x32')]){_0x3c29d2[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x3c29d2['where'],{'$or':_[_0xfadb('0x34')](_0x3c29d2[_0xfadb('0x4a')],function(_0x2ec218){var _0x233a7e={};_0x233a7e[_0x2ec218]={'$like':'%'+_0x496d47[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x233a7e;})});}_0x3c29d2=_[_0xfadb('0x59')]({},_0x3c29d2,_0x496d47['options']);switch(_0x2a8d33[_0xfadb('0x2b')]){case _0xfadb('0x2c'):return db[_[_0xfadb('0x9e')](_0x496d47[_0xfadb('0x45')]['channel'])+_0xfadb('0xc8')][_0xfadb('0x4c')](_0x3c29d2);case _0xfadb('0x2e'):case'agent':return _0x2a8d33['get'+_[_0xfadb('0x9e')](_0x496d47[_0xfadb('0x45')][_0xfadb('0x9a')])+_0xfadb('0x9f')](_0x3c29d2);default:throw new db['Sequelize'][(_0xfadb('0x92'))]('Unknown\x20role');}})['then'](function(_0x3740a8){_0x509c5b=_0x3740a8[_0xfadb('0x4f')];if(!_0x496d47['query'][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x3c29d2['limit']=qs[_0xfadb('0x15')](_0x496d47[_0xfadb('0x45')][_0xfadb('0x15')]);_0x3c29d2['offset']=qs[_0xfadb('0x17')](_0x496d47[_0xfadb('0x45')][_0xfadb('0x17')]);}switch(_0x2a8d33[_0xfadb('0x2b')]){case _0xfadb('0x2c'):return db[_[_0xfadb('0x9e')](_0x496d47[_0xfadb('0x45')][_0xfadb('0x9a')])+_0xfadb('0xc8')][_0xfadb('0x4c')](_0x3c29d2);case'user':case _0xfadb('0x27'):return _0x2a8d33[_0xfadb('0x2a')+_[_0xfadb('0x9e')](_0x496d47['query'][_0xfadb('0x9a')])+_0xfadb('0x9f')](_0x3c29d2);}})[_0xfadb('0x1b')](function(_0x5dfcd0){return{'count':_0x509c5b,'rows':_0x5dfcd0};})[_0xfadb('0x1b')](respondWithResult(_0x15e834,null))['catch'](handleError(_0x15e834,null));};exports[_0xfadb('0xd3')]=function(_0x113d72,_0x318eb7){var _0xe266={};var _0x5a28ac={};var _0x553b21;var _0x79f2d5;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x113d72['params']['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x318eb7,null))['then'](function(_0x3d741d){if(_0x3d741d){_0x553b21=_0x3d741d;_0x5a28ac[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xa9')][_0xfadb('0xc9')]);_0x5a28ac[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x113d72[_0xfadb('0x45')]);_0x5a28ac[_0xfadb('0xcb')]=_['intersection'](_0x5a28ac['model'],_0x5a28ac['query']);_0xe266[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x5a28ac[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x113d72[_0xfadb('0x45')]['fields']));_0xe266['attributes']=_0xe266[_0xfadb('0x4a')]['length']?_0xe266[_0xfadb('0x4a')]:_0x5a28ac[_0xfadb('0xc7')];_0xe266[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x113d72['query'][_0xfadb('0xcf')]);_0xe266[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x113d72['query'],_0x5a28ac['filters']));if(_0x113d72[_0xfadb('0x45')]['filter']){_0xe266['where']=_[_0xfadb('0x59')](_0xe266[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0xe266[_0xfadb('0x4a')],function(_0x2d9193){var _0x17a00={};_0x17a00[_0x2d9193]={'$like':'%'+_0x113d72[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x17a00;})});}_0xe266=_[_0xfadb('0x59')]({},_0xe266,_0x113d72['options']);return _0x553b21[_0xfadb('0xd3')](_0xe266);}})['then'](function(_0x147d18){if(_0x147d18){_0x79f2d5=_0x147d18[_0xfadb('0x4f')];if(!_0x113d72[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0xe266[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x113d72['query'][_0xfadb('0x15')]);_0xe266[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x113d72['query'][_0xfadb('0x17')]);}return _0x553b21[_0xfadb('0xd3')](_0xe266);}})[_0xfadb('0x1b')](function(_0x1bffcb){if(_0x1bffcb){return _0x1bffcb?{'count':_0x79f2d5,'rows':_0x1bffcb}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x318eb7,null))[_0xfadb('0x57')](handleError(_0x318eb7,null));};exports['getGroups']=function(_0x2a7354,_0xee9d15){var _0x5406ca={};var _0x5a1d89={};var _0xbd92a4;var _0x39eb6b;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x2a7354[_0xfadb('0x58')]['id']}})['then'](handleEntityNotFound(_0xee9d15,null))[_0xfadb('0x1b')](function(_0x287709){if(_0x287709){_0xbd92a4=_0x287709;_0x5a1d89[_0xfadb('0xc7')]=_['keys'](db[_0xfadb('0xd4')][_0xfadb('0xc9')]);_0x5a1d89[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x2a7354['query']);_0x5a1d89[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x5a1d89[_0xfadb('0xc7')],_0x5a1d89[_0xfadb('0x45')]);_0x5406ca[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x5a1d89[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x2a7354[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x5406ca[_0xfadb('0x4a')]=_0x5406ca[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x5406ca[_0xfadb('0x4a')]:_0x5a1d89[_0xfadb('0xc7')];_0x5406ca[_0xfadb('0xce')]=qs['sort'](_0x2a7354[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x5406ca[_0xfadb('0xd0')]=qs['filters'](_['pick'](_0x2a7354[_0xfadb('0x45')],_0x5a1d89[_0xfadb('0xcb')]));if(_0x2a7354[_0xfadb('0x45')][_0xfadb('0x32')]){_0x5406ca[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x5406ca[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x5406ca['attributes'],function(_0x1d3050){var _0x481043={};_0x481043[_0x1d3050]={'$like':'%'+_0x2a7354['query'][_0xfadb('0x32')]+'%'};return _0x481043;})});}_0x5406ca=_['merge']({},_0x5406ca,_0x2a7354['options']);return _0xbd92a4[_0xfadb('0xd5')](_0x5406ca);}})[_0xfadb('0x1b')](function(_0x2441ac){if(_0x2441ac){_0x39eb6b=_0x2441ac[_0xfadb('0x4f')];if(!_0x2a7354['query']['hasOwnProperty'](_0xfadb('0xd2'))){_0x5406ca[_0xfadb('0x15')]=qs['limit'](_0x2a7354[_0xfadb('0x45')][_0xfadb('0x15')]);_0x5406ca[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x2a7354[_0xfadb('0x45')][_0xfadb('0x17')]);}return _0xbd92a4[_0xfadb('0xd5')](_0x5406ca);}})[_0xfadb('0x1b')](function(_0x1cc763){if(_0x1cc763){return _0x1cc763?{'count':_0x39eb6b,'rows':_0x1cc763}:null;}})[_0xfadb('0x1b')](respondWithResult(_0xee9d15,null))['catch'](handleError(_0xee9d15,null));};exports[_0xfadb('0xd6')]=function(_0x3ac540,_0x2bfc8f){var _0x171450={'raw':!![],'where':{}};var _0x5799fb={};var _0x37fe2b={'count':0x0,'rows':[]};return db[_0xfadb('0x3a')]['findOne']({'where':{'id':_0x3ac540[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x2bfc8f,null))[_0xfadb('0x1b')](function(_0x1cc220){if(_0x1cc220){_0x5799fb['model']=_[_0xfadb('0xca')](db[_0xfadb('0xd7')][_0xfadb('0xc9')]);_0x5799fb['query']=_['keys'](_0x3ac540['query']);_0x5799fb[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x5799fb[_0xfadb('0xc7')],_0x5799fb[_0xfadb('0x45')]);_0x171450[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x5799fb['model'],qs[_0xfadb('0xcd')](_0x3ac540[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x171450[_0xfadb('0x4a')]=_0x171450[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x171450['attributes']:_0x5799fb[_0xfadb('0xc7')];if(!_0x3ac540[_0xfadb('0x45')]['hasOwnProperty'](_0xfadb('0xd2'))){_0x171450[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x3ac540[_0xfadb('0x45')][_0xfadb('0x15')]);_0x171450[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x3ac540['query'][_0xfadb('0x17')]);}_0x171450[_0xfadb('0xce')]=qs['sort'](_0x3ac540['query']['sort']);_0x171450['where']=qs[_0xfadb('0xcb')](_['pick'](_0x3ac540[_0xfadb('0x45')],_0x5799fb['filters']));_0x171450[_0xfadb('0xd0')][_0xfadb('0xd8')]=_0x1cc220['id'];if(_0x3ac540[_0xfadb('0x45')]['filter']){_0x171450[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x171450[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x171450['attributes'],function(_0x404555){var _0x38da2e={};_0x38da2e[_0x404555]={'$like':'%'+_0x3ac540[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x38da2e;})});}_0x171450=_[_0xfadb('0x59')]({},_0x171450,_0x3ac540['options']);return db[_0xfadb('0xd7')][_0xfadb('0x16')]({'where':_0x171450['where']})['then'](function(_0x312029){_0x37fe2b[_0xfadb('0x16')]=_0x312029;if(_0x3ac540[_0xfadb('0x45')][_0xfadb('0x46')]){_0x171450['include']=[{'all':!![]}];}return db[_0xfadb('0xd7')][_0xfadb('0x4c')](_0x171450);})['then'](function(_0x361c9c){_0x37fe2b[_0xfadb('0x4d')]=_0x361c9c;return _0x37fe2b;});}})[_0xfadb('0x1b')](respondWithFilteredResult(_0x2bfc8f,_0x171450))['catch'](handleError(_0x2bfc8f,null));};exports['getScreenRecordings']=function(_0x32d20f,_0x505b0e){var _0x4946f6={'raw':!![],'where':{}};var _0x40e377={};var _0x4561d5={'count':0x0,'rows':[]};return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x32d20f['params']['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x505b0e,null))[_0xfadb('0x1b')](function(_0x1c4971){if(_0x1c4971){_0x40e377[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xd9')]['rawAttributes']);_0x40e377['query']=_[_0xfadb('0xca')](_0x32d20f[_0xfadb('0x45')]);_0x40e377[_0xfadb('0xcb')]=_['intersection'](_0x40e377['model'],_0x40e377[_0xfadb('0x45')]);_0x4946f6[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x40e377[_0xfadb('0xc7')],qs['fields'](_0x32d20f[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x4946f6[_0xfadb('0x4a')]=_0x4946f6[_0xfadb('0x4a')]['length']?_0x4946f6[_0xfadb('0x4a')]:_0x40e377[_0xfadb('0xc7')];if(!_0x32d20f['query']['hasOwnProperty']('nolimit')){_0x4946f6[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x32d20f[_0xfadb('0x45')][_0xfadb('0x15')]);_0x4946f6[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x32d20f['query'][_0xfadb('0x17')]);}_0x4946f6[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x32d20f['query'][_0xfadb('0xcf')]);_0x4946f6[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x32d20f[_0xfadb('0x45')],_0x40e377['filters']));_0x4946f6[_0xfadb('0xd0')][_0xfadb('0xd8')]=_0x1c4971['id'];if(_0x32d20f[_0xfadb('0x45')]['filter']){_0x4946f6[_0xfadb('0xd0')]=_['merge'](_0x4946f6['where'],{'$or':_[_0xfadb('0x34')](_0x4946f6[_0xfadb('0x4a')],function(_0x595ac9){var _0x222342={};_0x222342[_0x595ac9]={'$like':'%'+_0x32d20f[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x222342;})});}_0x4946f6=_[_0xfadb('0x59')]({},_0x4946f6,_0x32d20f['options']);return db[_0xfadb('0xd9')][_0xfadb('0x16')]({'where':_0x4946f6[_0xfadb('0xd0')]})[_0xfadb('0x1b')](function(_0x45a471){_0x4561d5[_0xfadb('0x16')]=_0x45a471;if(_0x32d20f[_0xfadb('0x45')][_0xfadb('0x46')]){_0x4946f6[_0xfadb('0x47')]=[{'all':!![]}];}return db[_0xfadb('0xd9')][_0xfadb('0x4c')](_0x4946f6);})[_0xfadb('0x1b')](function(_0x3e30fb){_0x4561d5[_0xfadb('0x4d')]=_0x3e30fb;return _0x4561d5;});}})[_0xfadb('0x1b')](respondWithFilteredResult(_0x505b0e,_0x4946f6))[_0xfadb('0x57')](handleError(_0x505b0e,null));};exports[_0xfadb('0xda')]=function(_0x486043,_0x5aa372){var _0x28d7dc={};var _0x1e4636={};var _0x3f60af;var _0x22a684;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x486043['params']['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x5aa372,null))['then'](function(_0x1d8e9c){if(_0x1d8e9c){_0x3f60af=_0x1d8e9c;_0x1e4636[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xdb')][_0xfadb('0xc9')]);_0x1e4636[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x486043[_0xfadb('0x45')]);_0x1e4636[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x1e4636[_0xfadb('0xc7')],_0x1e4636[_0xfadb('0x45')]);_0x28d7dc[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x1e4636[_0xfadb('0xc7')],qs['fields'](_0x486043[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x28d7dc[_0xfadb('0x4a')]=_0x28d7dc[_0xfadb('0x4a')]['length']?_0x28d7dc[_0xfadb('0x4a')]:_0x1e4636[_0xfadb('0xc7')];_0x28d7dc[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x486043['query']['sort']);_0x28d7dc[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x486043[_0xfadb('0x45')],_0x1e4636['filters']));if(_0x486043['query'][_0xfadb('0x32')]){_0x28d7dc[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x28d7dc[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x28d7dc[_0xfadb('0x4a')],function(_0x12d8d6){var _0x57964f={};_0x57964f[_0x12d8d6]={'$like':'%'+_0x486043[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x57964f;})});}_0x28d7dc=_[_0xfadb('0x59')]({},_0x28d7dc,_0x486043['options']);return _0x3f60af[_0xfadb('0xda')](_0x28d7dc);}})[_0xfadb('0x1b')](function(_0x266bfe){if(_0x266bfe){_0x22a684=_0x266bfe[_0xfadb('0x4f')];if(!_0x486043[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x28d7dc['limit']=qs[_0xfadb('0x15')](_0x486043['query'][_0xfadb('0x15')]);_0x28d7dc[_0xfadb('0x17')]=qs['offset'](_0x486043[_0xfadb('0x45')][_0xfadb('0x17')]);}return _0x3f60af[_0xfadb('0xda')](_0x28d7dc);}})[_0xfadb('0x1b')](function(_0x4d5a80){if(_0x4d5a80){return _0x4d5a80?{'count':_0x22a684,'rows':_0x4d5a80}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x5aa372,null))[_0xfadb('0x57')](handleError(_0x5aa372,null));};exports[_0xfadb('0xdc')]=function(_0x35d543,_0x23ffc7){var _0x122a69={};var _0x237e7d={};var _0x18d1d4;var _0x2dff48;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x35d543[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x23ffc7,null))[_0xfadb('0x1b')](function(_0x3ecaf0){if(_0x3ecaf0){_0x18d1d4=_0x3ecaf0;_0x237e7d[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xdd')][_0xfadb('0xc9')]);_0x237e7d[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x35d543[_0xfadb('0x45')]);_0x237e7d[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x237e7d[_0xfadb('0xc7')],_0x237e7d['query']);_0x122a69[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x237e7d[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x35d543[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x122a69[_0xfadb('0x4a')]=_0x122a69[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x122a69['attributes']:_0x237e7d[_0xfadb('0xc7')];_0x122a69[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x35d543[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x122a69[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x35d543['query'],_0x237e7d[_0xfadb('0xcb')]));if(_0x35d543['query']['filter']){_0x122a69['where']=_['merge'](_0x122a69[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x122a69[_0xfadb('0x4a')],function(_0x7f25b9){var _0xd6f0={};_0xd6f0[_0x7f25b9]={'$like':'%'+_0x35d543[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0xd6f0;})});}_0x122a69=_['merge']({},_0x122a69,_0x35d543[_0xfadb('0xde')]);return _0x18d1d4[_0xfadb('0xdc')](_0x122a69);}})['then'](function(_0x41ebed){if(_0x41ebed){_0x2dff48=_0x41ebed[_0xfadb('0x4f')];if(!_0x35d543[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x122a69[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x35d543[_0xfadb('0x45')]['limit']);_0x122a69[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x35d543[_0xfadb('0x45')][_0xfadb('0x17')]);}return _0x18d1d4[_0xfadb('0xdc')](_0x122a69);}})[_0xfadb('0x1b')](function(_0x332408){if(_0x332408){return _0x332408?{'count':_0x2dff48,'rows':_0x332408}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x23ffc7,null))[_0xfadb('0x57')](handleError(_0x23ffc7,null));};exports[_0xfadb('0xdf')]=function(_0x50f1fd,_0x678e2e){var _0x48d029={'raw':!![],'where':{}};var _0x4d2256={};var _0x280100={'count':0x0,'rows':[]};return db['User'][_0xfadb('0xc2')]({'where':{'id':_0x50f1fd[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x678e2e,null))[_0xfadb('0x1b')](function(_0x2edd23){if(_0x2edd23){_0x4d2256[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xe0')][_0xfadb('0xc9')]);_0x4d2256[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x50f1fd['query']);_0x4d2256[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x4d2256[_0xfadb('0xc7')],_0x4d2256[_0xfadb('0x45')]);_0x48d029[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x4d2256[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x50f1fd[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x48d029['attributes']=_0x48d029[_0xfadb('0x4a')]['length']?_0x48d029['attributes']:_0x4d2256[_0xfadb('0xc7')];if(!_0x50f1fd[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x48d029['limit']=qs[_0xfadb('0x15')](_0x50f1fd[_0xfadb('0x45')][_0xfadb('0x15')]);_0x48d029[_0xfadb('0x17')]=qs['offset'](_0x50f1fd[_0xfadb('0x45')]['offset']);}_0x48d029[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x50f1fd['query'][_0xfadb('0xcf')]);_0x48d029['where']=qs[_0xfadb('0xcb')](_['pick'](_0x50f1fd['query'],_0x4d2256['filters']));_0x48d029[_0xfadb('0xd0')][_0xfadb('0xd8')]=_0x2edd23['id'];if(_0x50f1fd[_0xfadb('0x45')]['filter']){_0x48d029[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x48d029[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x48d029[_0xfadb('0x4a')],function(_0x4fccfb){var _0x1b8601={};_0x1b8601[_0x4fccfb]={'$like':'%'+_0x50f1fd[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x1b8601;})});}_0x48d029=_[_0xfadb('0x59')]({},_0x48d029,_0x50f1fd[_0xfadb('0xde')]);return db[_0xfadb('0xe0')][_0xfadb('0x16')]({'where':_0x48d029['where']})[_0xfadb('0x1b')](function(_0x190546){_0x280100[_0xfadb('0x16')]=_0x190546;if(_0x50f1fd[_0xfadb('0x45')]['includeAll']){_0x48d029['include']=[{'all':!![]}];}return db['MailInteraction'][_0xfadb('0x4c')](_0x48d029);})[_0xfadb('0x1b')](function(_0x64073e){_0x280100[_0xfadb('0x4d')]=_0x64073e;return _0x280100;});}})[_0xfadb('0x1b')](respondWithFilteredResult(_0x678e2e,_0x48d029))['catch'](handleError(_0x678e2e,null));};exports[_0xfadb('0xe1')]=function(_0x1b748a,_0x3e45ca){var _0x3d6e3e={};var _0x51c0d6={};var _0x235e78;var _0x56f692;return db[_0xfadb('0x3a')]['findOne']({'where':{'id':_0x1b748a[_0xfadb('0x58')]['id']}})['then'](handleEntityNotFound(_0x3e45ca,null))['then'](function(_0x58cfb7){if(_0x58cfb7){_0x235e78=_0x58cfb7;_0x51c0d6[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xe2')]['rawAttributes']);_0x51c0d6[_0xfadb('0x45')]=_[_0xfadb('0xca')](_0x1b748a[_0xfadb('0x45')]);_0x51c0d6[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x51c0d6[_0xfadb('0xc7')],_0x51c0d6[_0xfadb('0x45')]);_0x3d6e3e[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x51c0d6['model'],qs[_0xfadb('0xcd')](_0x1b748a[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x3d6e3e['attributes']=_0x3d6e3e[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x3d6e3e[_0xfadb('0x4a')]:_0x51c0d6[_0xfadb('0xc7')];_0x3d6e3e['order']=qs[_0xfadb('0xcf')](_0x1b748a['query'][_0xfadb('0xcf')]);_0x3d6e3e[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x1b748a[_0xfadb('0x45')],_0x51c0d6[_0xfadb('0xcb')]));if(_0x1b748a[_0xfadb('0x45')]['filter']){_0x3d6e3e[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x3d6e3e['where'],{'$or':_[_0xfadb('0x34')](_0x3d6e3e[_0xfadb('0x4a')],function(_0x10835a){var _0x4c4bd1={};_0x4c4bd1[_0x10835a]={'$like':'%'+_0x1b748a['query'][_0xfadb('0x32')]+'%'};return _0x4c4bd1;})});}_0x3d6e3e=_['merge']({},_0x3d6e3e,_0x1b748a[_0xfadb('0xde')]);return _0x235e78[_0xfadb('0xe1')](_0x3d6e3e);}})[_0xfadb('0x1b')](function(_0x3fde08){if(_0x3fde08){_0x56f692=_0x3fde08[_0xfadb('0x4f')];if(!_0x1b748a['query'][_0xfadb('0xc3')]('nolimit')){_0x3d6e3e['limit']=qs[_0xfadb('0x15')](_0x1b748a[_0xfadb('0x45')][_0xfadb('0x15')]);_0x3d6e3e[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x1b748a['query']['offset']);}return _0x235e78[_0xfadb('0xe1')](_0x3d6e3e);}})[_0xfadb('0x1b')](function(_0x39ccfe){if(_0x39ccfe){return _0x39ccfe?{'count':_0x56f692,'rows':_0x39ccfe}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x3e45ca,null))[_0xfadb('0x57')](handleError(_0x3e45ca,null));};exports[_0xfadb('0xe3')]=function(_0x51a822,_0x1d5238){var _0x144a50={};var _0x311b59={};var _0x113bae;var _0x2dca02;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x51a822[_0xfadb('0x58')]['id']}})['then'](handleEntityNotFound(_0x1d5238,null))[_0xfadb('0x1b')](function(_0x3f74fa){if(_0x3f74fa){_0x113bae=_0x3f74fa;_0x311b59[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0xe4')][_0xfadb('0xc9')]);_0x311b59[_0xfadb('0x45')]=_['keys'](_0x51a822[_0xfadb('0x45')]);_0x311b59[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x311b59[_0xfadb('0xc7')],_0x311b59['query']);_0x144a50['attributes']=_[_0xfadb('0xcc')](_0x311b59[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x51a822[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x144a50[_0xfadb('0x4a')]=_0x144a50['attributes'][_0xfadb('0x4f')]?_0x144a50[_0xfadb('0x4a')]:_0x311b59[_0xfadb('0xc7')];_0x144a50[_0xfadb('0xce')]=qs['sort'](_0x51a822[_0xfadb('0x45')]['sort']);_0x144a50[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x51a822[_0xfadb('0x45')],_0x311b59[_0xfadb('0xcb')]));if(_0x51a822[_0xfadb('0x45')][_0xfadb('0x32')]){_0x144a50[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x144a50[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x144a50[_0xfadb('0x4a')],function(_0x5b3bfc){var _0x2d8124={};_0x2d8124[_0x5b3bfc]={'$like':'%'+_0x51a822[_0xfadb('0x45')]['filter']+'%'};return _0x2d8124;})});}_0x144a50=_[_0xfadb('0x59')]({},_0x144a50,_0x51a822[_0xfadb('0xde')]);return _0x113bae[_0xfadb('0xe3')](_0x144a50);}})[_0xfadb('0x1b')](function(_0x46adb0){if(_0x46adb0){_0x2dca02=_0x46adb0['length'];if(!_0x51a822['query']['hasOwnProperty'](_0xfadb('0xd2'))){_0x144a50[_0xfadb('0x15')]=qs['limit'](_0x51a822['query'][_0xfadb('0x15')]);_0x144a50['offset']=qs[_0xfadb('0x17')](_0x51a822[_0xfadb('0x45')][_0xfadb('0x17')]);}return _0x113bae[_0xfadb('0xe3')](_0x144a50);}})[_0xfadb('0x1b')](function(_0x3557b0){if(_0x3557b0){return _0x3557b0?{'count':_0x2dca02,'rows':_0x3557b0}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x1d5238,null))[_0xfadb('0x57')](handleError(_0x1d5238,null));};exports['getWhatsappInteractions']=function(_0x52f85a,_0x710b61){var _0xbddba1={};var _0x16f29c={};var _0x26f9f6;var _0xf817b3;return db[_0xfadb('0x3a')]['findOne']({'where':{'id':_0x52f85a[_0xfadb('0x58')]['id']}})['then'](handleEntityNotFound(_0x710b61,null))[_0xfadb('0x1b')](function(_0x2cf8af){if(_0x2cf8af){_0x26f9f6=_0x2cf8af;_0x16f29c[_0xfadb('0xc7')]=_['keys'](db[_0xfadb('0xe5')][_0xfadb('0xc9')]);_0x16f29c[_0xfadb('0x45')]=_['keys'](_0x52f85a[_0xfadb('0x45')]);_0x16f29c[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x16f29c['model'],_0x16f29c['query']);_0xbddba1[_0xfadb('0x4a')]=_['intersection'](_0x16f29c[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x52f85a['query'][_0xfadb('0xcd')]));_0xbddba1[_0xfadb('0x4a')]=_0xbddba1['attributes']['length']?_0xbddba1[_0xfadb('0x4a')]:_0x16f29c[_0xfadb('0xc7')];_0xbddba1[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x52f85a['query'][_0xfadb('0xcf')]);_0xbddba1[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_[_0xfadb('0xd1')](_0x52f85a[_0xfadb('0x45')],_0x16f29c[_0xfadb('0xcb')]));if(_0x52f85a[_0xfadb('0x45')]['filter']){_0xbddba1[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0xbddba1[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0xbddba1[_0xfadb('0x4a')],function(_0x2aeb23){var _0x3611f6={};_0x3611f6[_0x2aeb23]={'$like':'%'+_0x52f85a['query'][_0xfadb('0x32')]+'%'};return _0x3611f6;})});}_0xbddba1=_[_0xfadb('0x59')]({},_0xbddba1,_0x52f85a[_0xfadb('0xde')]);return _0x26f9f6[_0xfadb('0xe6')](_0xbddba1);}})[_0xfadb('0x1b')](function(_0x2794c4){if(_0x2794c4){_0xf817b3=_0x2794c4[_0xfadb('0x4f')];if(!_0x52f85a[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0xbddba1[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x52f85a[_0xfadb('0x45')]['limit']);_0xbddba1[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x52f85a[_0xfadb('0x45')]['offset']);}return _0x26f9f6['getWhatsappInteractions'](_0xbddba1);}})[_0xfadb('0x1b')](function(_0x3cbbcd){if(_0x3cbbcd){return _0x3cbbcd?{'count':_0xf817b3,'rows':_0x3cbbcd}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x710b61,null))[_0xfadb('0x57')](handleError(_0x710b61,null));};exports['login']=function(_0x417c8c,_0x26b517,_0xf75ce7){var _0x3b4b0f;var _0x2e9e2f;var _0x2ede2f;var _0x40fed3=!_[_0xfadb('0x65')](_0x417c8c[_0xfadb('0x58')]['id'])?_0x417c8c[_0xfadb('0x58')]['id']:!_['isNil'](_0x417c8c[_0xfadb('0x2e')]['id'])?_0x417c8c['user']['id']:null;return db[_0xfadb('0x3a')]['find']({'where':{'id':_0x40fed3,'role':{'$or':[_0xfadb('0x2c'),_0xfadb('0x2e'),_0xfadb('0x27')]}},'attributes':['id',_0xfadb('0x37'),_0xfadb('0xe7'),_0xfadb('0xe8'),_0xfadb('0x2b'),_0xfadb('0x5f'),_0xfadb('0xe9')]})[_0xfadb('0x1b')](function(_0x4650a7){if(_0x4650a7){if(_0x4650a7['role']===_0xfadb('0x27')){_0x3b4b0f=_0x4650a7;if(_0x417c8c[_0xfadb('0x5b')][_0xfadb('0x9c')]){_0x2ede2f=util[_0xfadb('0xa7')](_0xfadb('0xea'),_0x3b4b0f[_0x417c8c['body'][_0xfadb('0x9c')]]);}else if(_0x417c8c[_0xfadb('0x5b')]['intrf']){_0x2ede2f=util[_0xfadb('0xa7')](_0xfadb('0xa8'),_0x417c8c[_0xfadb('0x5b')][_0xfadb('0xeb')]);}else{_0x2ede2f=util[_0xfadb('0xa7')](_0xfadb('0xa8'),_0x3b4b0f[_0xfadb('0x37')]);}socket['to'](util[_0xfadb('0xa7')](_0xfadb('0xec'),_0x3b4b0f[_0xfadb('0x37')]))[_0xfadb('0xa4')](_0xfadb('0xed'),{'user':{'id':_0x3b4b0f['id'],'name':_0x3b4b0f[_0xfadb('0x37')]},'ip':_0x417c8c['headers']['x-forwarded-for']||_0x417c8c[_0xfadb('0xee')]['remoteAddress']||_0x417c8c[_0xfadb('0xef')][_0xfadb('0xf0')]||_0x417c8c[_0xfadb('0xee')][_0xfadb('0xef')][_0xfadb('0xf0')]});return db[_0xfadb('0xa9')][_0xfadb('0x29')]({'where':{'membername':_0x3b4b0f[_0xfadb('0x37')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError']('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0xfadb('0x1b')](function(){if(_0x3b4b0f){return _0x3b4b0f[_0xfadb('0xf1')]({'raw':!![]});}})[_0xfadb('0x1b')](function(_0x253c90){if(_0x3b4b0f){if(_0x253c90){_0x2e9e2f=_0x253c90;if(_0x2e9e2f[_0xfadb('0x4f')]){var _0x43250a=_0x2e9e2f['map'](function(_0x84ce8a){var _0x46aad8={'membername':_0x3b4b0f[_0xfadb('0x37')],'UserId':_0x3b4b0f['id'],'queue_name':_0x84ce8a[_0xfadb('0x37')],'VoiceQueueId':_0x84ce8a['id'],'interface':_0x2ede2f,'paused':_0x3b4b0f[_0xfadb('0xe9')]||![],'penalty':_0x84ce8a[_0xfadb('0xf2')]||0x0};return db[_0xfadb('0xa9')][_0xfadb('0xaa')](_0x46aad8);});return Promise['all'](_0x43250a);}}}})[_0xfadb('0x1b')](function(){if(_0x3b4b0f){return db['MemberReport']['findAll']({'where':{'membername':_0x3b4b0f[_0xfadb('0x37')],'exitAt':null}});}})[_0xfadb('0x1b')](function(_0x1de000){if(_0x3b4b0f){var _0x1d9705=[];_0x1de000[_0xfadb('0xf3')](function(_0x440d7e){_0x1d9705[_0xfadb('0x4b')](_0x440d7e[_0xfadb('0x26')]({'exitAt':moment()[_0xfadb('0xa7')](_0xfadb('0xf4'))}));});return Promise[_0xfadb('0x56')](_0x1d9705);}})['then'](function(){if(_0x3b4b0f){var _0x1319ef=[];var _0x3a7c11=[];var _0x2e15f1=utils[_0xfadb('0xf5')]();var _0x1523a4={'membername':_0x3b4b0f[_0xfadb('0x37')],'interface':_0x2ede2f,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3b4b0f[_0xfadb('0x2b')],'internal':_0x3b4b0f[_0xfadb('0x5f')]};_0x2e15f1['forEach'](function(_0x4a767c){_0x1319ef[_0xfadb('0x4b')](_['merge']({'channel':_0x4a767c,'type':_0xfadb('0xf6'),'data1':_0x417c8c[_0xfadb('0x5b')]['device'],'data2':_0x2ede2f},_0x1523a4));if(_0x3b4b0f[_0xfadb('0xe9')]){_0x3a7c11[_0xfadb('0x4b')](_[_0xfadb('0x59')]({'channel':_0x4a767c,'type':_0xfadb('0xf7'),'data1':_0xfadb('0xf8')},_0x1523a4));}});return db[_0xfadb('0xf9')][_0xfadb('0x85')](_0x1319ef[_0xfadb('0xc0')](_0x3a7c11),{'individualHooks':!![]});}})[_0xfadb('0x1b')](function(){if(_0x3b4b0f){return _0x3b4b0f[_0xfadb('0x26')]({'online':!![],'lastLoginAt':moment()[_0xfadb('0xa7')](_0xfadb('0xf4')),'voicePause':_0x3b4b0f[_0xfadb('0xe9')]||![],'mailPause':_0x3b4b0f[_0xfadb('0xe9')]||![],'chatPause':_0x3b4b0f['loginInPause']||![],'faxPause':_0x3b4b0f['loginInPause']||![],'smsPause':_0x3b4b0f[_0xfadb('0xe9')]||![],'openchannelPause':_0x3b4b0f['loginInPause']||![],'whatsappPause':_0x3b4b0f[_0xfadb('0xe9')]||![],'pauseType':_0x3b4b0f[_0xfadb('0xe9')]?_0xfadb('0xf8'):null,'interface':_0x2ede2f,'lastPauseAt':moment()[_0xfadb('0xa7')](_0xfadb('0xf4'))});}})[_0xfadb('0x1b')](function(_0x1844eb){if(_0x417c8c[_0xfadb('0xfa')]){return _0xf75ce7();}else{return Promise[_0xfadb('0xfb')](_0x1844eb)[_0xfadb('0x1b')](respondWithResult(_0x26b517,null));}})['catch'](handleError(_0x26b517,null));};exports['logout']=function(_0x13e764,_0x362a3a){var _0x327141;return db[_0xfadb('0x3a')][_0xfadb('0x36')]({'where':{'id':_0x13e764['params']['id'],'role':'agent'},'attributes':['id',_0xfadb('0x37'),'role']})['then'](handleEntityNotFound(_0x362a3a,null))[_0xfadb('0x1b')](function(_0x211e96){if(_0x211e96){_0x327141=_0x211e96;return db[_0xfadb('0xa9')][_0xfadb('0x29')]({'where':{'membername':_0x327141[_0xfadb('0x37')]},'individualHooks':!![]});}})[_0xfadb('0x1b')](function(){return db['MemberReport'][_0xfadb('0x4c')]({'where':{'membername':_0x327141['name'],'exitAt':null}});})[_0xfadb('0x1b')](function(_0x4e81e3){var _0x15f305=[];_0x4e81e3[_0xfadb('0xf3')](function(_0x27eafa){_0x15f305[_0xfadb('0x4b')](_0x27eafa['update']({'exitAt':moment()[_0xfadb('0xa7')](_0xfadb('0xf4'))}));});return Promise[_0xfadb('0x56')](_0x15f305);})[_0xfadb('0x1b')](function(){return _0x327141['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xfadb('0x1b')](respondWithResult(_0x362a3a,null))[_0xfadb('0x57')](handleError(_0x362a3a,null));};exports[_0xfadb('0xfc')]=function(_0xe111b8,_0x40b30a){var _0x1031b3;return db[_0xfadb('0xa9')][_0xfadb('0x26')]({'paused':0x1},{'where':{'UserId':_0xe111b8[_0xfadb('0x58')]['id']},'individualHooks':!![]})[_0xfadb('0x1b')](function(){return db['User']['find']({'where':{'id':_0xe111b8['params']['id'],'role':_0xfadb('0x27')},'attributes':['id',_0xfadb('0x37'),_0xfadb('0x2b'),_0xfadb('0x5f'),_0xfadb('0x9c'),'online']});})[_0xfadb('0x1b')](handleEntityNotFound(_0x40b30a,null))[_0xfadb('0x1b')](function(_0x52635a){if(_0x52635a){_0x1031b3=_0x52635a;return respondWithRpcPromise('QueuePause',_0xfadb('0xfc'),{'id':_0x1031b3['id'],'name':_0x1031b3['name'],'pause':!![]});}})['then'](function(){if(_0x1031b3){return db[_0xfadb('0xf9')][_0xfadb('0x4c')]({'where':{'membername':_0x1031b3[_0xfadb('0x37')],'type':_0xfadb('0xf7'),'exitAt':null}});}})[_0xfadb('0x1b')](function(_0x5db601){if(_0x5db601[_0xfadb('0x4f')]){var _0x13d27e=moment()[_0xfadb('0xa7')](_0xfadb('0xf4'));for(var _0x492f31=0x0,_0xc1461d=_0x5db601[_0xfadb('0x4f')];_0x492f31<_0xc1461d;_0x492f31++){_0x5db601[_0x492f31][_0xfadb('0xfd')]({'exitAt':_0x13d27e});}}})['then'](function(){var _0x24d464=[];var _0x7d48c0=utils['getChannels']();_0x7d48c0['forEach'](function(_0x1132c3){_0x24d464[_0xfadb('0x4b')]({'channel':_0x1132c3,'membername':_0x1031b3[_0xfadb('0x37')],'interface':_[_0xfadb('0x65')](_0x1031b3[_0xfadb('0x9c')])?util[_0xfadb('0xa7')](_0xfadb('0xa8'),_0x1031b3['name']):_0x1031b3[_0xfadb('0x9c')],'type':'PAUSE','enterAt':moment()['format'](_0xfadb('0xf4')),'data1':_0xe111b8[_0xfadb('0x5b')][_0xfadb('0x3c')]||'DEFAULT\x20PAUSE','role':_0x1031b3[_0xfadb('0x2b')],'internal':_0x1031b3[_0xfadb('0x5f')]});});return db[_0xfadb('0xf9')][_0xfadb('0x85')](_0x24d464,{'individualHooks':!![]});})[_0xfadb('0x1b')](function(){return _0x1031b3[_0xfadb('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xe111b8[_0xfadb('0x5b')][_0xfadb('0x3c')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xfadb('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xfadb('0x1b')](respondWithResult(_0x40b30a,null))['catch'](handleError(_0x40b30a,null));};exports[_0xfadb('0xfe')]=function(_0x584b50,_0x1029ed){if(_0x584b50['body'][_0xfadb('0x9a')]&&!utils['isValidChannel'](_0x584b50[_0xfadb('0x5b')][_0xfadb('0x9a')])){throw new APIBadRequestError(util[_0xfadb('0xa7')](_0xfadb('0xff'),_0x584b50[_0xfadb('0x5b')][_0xfadb('0x9a')]));}return db['User'][_0xfadb('0x36')]({'where':{'id':_0x584b50[_0xfadb('0x58')]['id']},'attributes':['id',_0xfadb('0x37'),_0xfadb('0x2b'),_0xfadb('0x5f'),_0xfadb('0x9c'),_0xfadb('0x100'),_0xfadb('0x9b'),_0xfadb('0x101'),_0xfadb('0x102'),_0xfadb('0x103'),'openchannelPause',_0xfadb('0x104'),_0xfadb('0x105'),'pauseType','lastPauseAt']})[_0xfadb('0x1b')](function(_0x62f3ec){if(!_0x62f3ec){throw new APINotFoundError(util[_0xfadb('0xa7')](_0xfadb('0x106'),_0x584b50[_0xfadb('0x58')]['id']));}return _0x62f3ec['unpause'](_0x584b50['body']['channel']);})[_0xfadb('0x1b')](respondWithResult(_0x1029ed,null))[_0xfadb('0x57')](APIHandleError(_0x1029ed));};exports[_0xfadb('0x107')]=function(_0x22dfe8,_0x3dcbb7){var _0x82c01c={};var _0x50fa7c={};var _0x5602bd;var _0x5ad0fe;return db['User']['findOne']({'where':{'id':_0x22dfe8[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x3dcbb7,null))[_0xfadb('0x1b')](function(_0x2498d4){if(_0x2498d4){_0x5602bd=_0x2498d4;_0x50fa7c['model']=_[_0xfadb('0xca')](db['Team'][_0xfadb('0xc9')]);_0x50fa7c[_0xfadb('0x45')]=_['keys'](_0x22dfe8[_0xfadb('0x45')]);_0x50fa7c[_0xfadb('0xcb')]=_[_0xfadb('0xcc')](_0x50fa7c[_0xfadb('0xc7')],_0x50fa7c['query']);_0x82c01c['attributes']=_[_0xfadb('0xcc')](_0x50fa7c['model'],qs[_0xfadb('0xcd')](_0x22dfe8['query']['fields']));_0x82c01c[_0xfadb('0x4a')]=_0x82c01c['attributes'][_0xfadb('0x4f')]?_0x82c01c[_0xfadb('0x4a')]:_0x50fa7c[_0xfadb('0xc7')];_0x82c01c[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x22dfe8[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x82c01c['where']=qs['filters'](_[_0xfadb('0xd1')](_0x22dfe8[_0xfadb('0x45')],_0x50fa7c[_0xfadb('0xcb')]));if(_0x22dfe8[_0xfadb('0x45')][_0xfadb('0x32')]){_0x82c01c[_0xfadb('0xd0')]=_['merge'](_0x82c01c[_0xfadb('0xd0')],{'$or':_['map'](_0x82c01c[_0xfadb('0x4a')],function(_0x54c819){var _0x1922a0={};_0x1922a0[_0x54c819]={'$like':'%'+_0x22dfe8[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x1922a0;})});}_0x82c01c=_[_0xfadb('0x59')]({},_0x82c01c,_0x22dfe8['options']);return _0x5602bd['getTeams'](_0x82c01c);}})[_0xfadb('0x1b')](function(_0x2bf769){if(_0x2bf769){_0x5ad0fe=_0x2bf769[_0xfadb('0x4f')];if(!_0x22dfe8[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x82c01c[_0xfadb('0x15')]=qs['limit'](_0x22dfe8[_0xfadb('0x45')][_0xfadb('0x15')]);_0x82c01c[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x22dfe8[_0xfadb('0x45')][_0xfadb('0x17')]);}return _0x5602bd[_0xfadb('0x107')](_0x82c01c);}})[_0xfadb('0x1b')](function(_0x29ef4f){if(_0x29ef4f){return _0x29ef4f?{'count':_0x5ad0fe,'rows':_0x29ef4f}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x3dcbb7,null))[_0xfadb('0x57')](handleError(_0x3dcbb7,null));};exports[_0xfadb('0x108')]=function(_0x398b96,_0x49f1bb){var _0x3b2c65=_0x398b96[_0xfadb('0x58')]['id'];var _0x1c4233=_0x398b96[_0xfadb('0x5b')]?_0x398b96[_0xfadb('0x5b')][_0xfadb('0x5d')]:null;var _0x402a58=[];return Promise[_0xfadb('0xfb')]()[_0xfadb('0x1b')](function(){if(!_0x1c4233)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0xfadb('0x1b')](function(){return db[_0xfadb('0x3a')]['findOne']({'where':{'id':_0x3b2c65}});})['then'](function(_0x35ef55){if(!_0x35ef55)throw new APINotFoundError(util[_0xfadb('0xa7')](_0xfadb('0x106'),_0x398b96[_0xfadb('0x58')]['id']));return db['sequelize'][_0xfadb('0x109')](function(_0x208b5e){return _0x35ef55[_0xfadb('0x108')](_0x1c4233,{'transaction':_0x208b5e})[_0xfadb('0x1b')](function(){return db[_0xfadb('0x10a')][_0xfadb('0x4c')]({'where':{'id':{'$in':_0x1c4233}}});})[_0xfadb('0x1b')](function(_0x141791){var _0x2babc0=_[_0xfadb('0x34')](_0x141791,function(_0x538017){return _0x538017[_0xfadb('0x10b')]();});return Promise[_0xfadb('0x56')](_0x2babc0);})[_0xfadb('0x1b')](function(_0x14ea2d){_0x402a58=_['flattenDeep'](_0x14ea2d);var _0x37639b=_[_0xfadb('0x34')](_0x402a58,function(_0x4ecf24){return _0x4ecf24[_0xfadb('0x10c')](_0x35ef55['id'],{'transaction':_0x208b5e});});return Promise[_0xfadb('0x56')](_0x37639b);})['then'](function(){if(!_0x35ef55[_0xfadb('0x100')])return;var _0x1ef998=_[_0xfadb('0x32')](_0x402a58,function(_0x35780f){return _0x35780f[_0xfadb('0x10d')](_0xfadb('0x9a'))===_0xfadb('0x10e');});var _0x30df5b=_[_0xfadb('0x34')](_0x1ef998,function(_0x3f3441){return db[_0xfadb('0xa9')]['upsert']({'membername':_0x35ef55['name'],'UserId':_0x35ef55['id'],'queue_name':_0x3f3441['name'],'VoiceQueueId':_0x3f3441['id'],'interface':_[_0xfadb('0x65')](_0x35ef55[_0xfadb('0x9c')])?util[_0xfadb('0xa7')](_0xfadb('0xa8'),_0x35ef55['name']):_0x35ef55['interface'],'paused':_0x35ef55[_0xfadb('0x9b')]||![],'penalty':_0x35ef55[_0xfadb('0xa0')]},{'transaction':_0x208b5e});});return Promise[_0xfadb('0x56')](_0x30df5b);})[_0xfadb('0x1b')](function(){return db['TeamVoicePrefix'][_0xfadb('0x4c')]({'where':{'teamId':{'$in':_0x1c4233}}});})['then'](function(_0x3ee487){var _0x2018f4=_[_0xfadb('0x34')](_0x3ee487,function(_0x28fdb9){return db[_0xfadb('0x10f')]['create']({'UserId':_0x35ef55['id'],'VoicePrefixId':_0x28fdb9[_0xfadb('0x110')]},{'transaction':_0x208b5e});});return Promise[_0xfadb('0x56')](_0x2018f4);});});})[_0xfadb('0x1b')](function(){for(var _0x45e253=0x0;_0x45e253<_0x402a58[_0xfadb('0x4f')];_0x45e253++){var _0x5901c1=_0x402a58[_0x45e253][_0xfadb('0x10d')](_0xfadb('0x9a'));var _0x3cdcc3=_0x5901c1+_0xfadb('0xa3');socket['emit']('user'+_0x5901c1+_0xfadb('0x111'),{'UserId':_0x3b2c65,['queueField']:_0x402a58[_0x45e253]['id']});}})['then'](respondWithStatusCode(_0x49f1bb,null))[_0xfadb('0x57')](APIHandleError(_0x49f1bb));};exports[_0xfadb('0x112')]=function(_0x1d0b73,_0x244f32){var _0x53c0f0=_0x1d0b73[_0xfadb('0x58')]['id'];var _0x2fd809=null;if(_0x1d0b73['query']['ids']){_0x2fd809=_[_0xfadb('0x113')](_0x1d0b73[_0xfadb('0x45')][_0xfadb('0x5d')])?_0x1d0b73[_0xfadb('0x45')][_0xfadb('0x5d')]:[_0x1d0b73[_0xfadb('0x45')][_0xfadb('0x5d')]];}var _0x3a5e64=[];return Promise[_0xfadb('0xfb')]()[_0xfadb('0x1b')](function(){if(!_0x2fd809)throw new APIBadRequestError(_0xfadb('0x114'));})[_0xfadb('0x1b')](function(){return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x53c0f0}});})['then'](function(_0x34191f){if(!_0x34191f)throw new APINotFoundError(util[_0xfadb('0xa7')](_0xfadb('0x106'),_0x1d0b73[_0xfadb('0x58')]['id']));return db['sequelize']['transaction'](function(_0x43874c){return _0x34191f[_0xfadb('0x112')](_0x2fd809,{'transaction':_0x43874c})[_0xfadb('0x1b')](function(){return db['Team'][_0xfadb('0x4c')]({'where':{'id':{'$in':_0x2fd809}}});})['then'](function(_0x15e5c5){var _0xb53104=_[_0xfadb('0x34')](_0x15e5c5,function(_0x40c801){return _0x40c801[_0xfadb('0x10b')]();});return Promise[_0xfadb('0x56')](_0xb53104);})[_0xfadb('0x1b')](function(_0x45e255){_0x3a5e64=_[_0xfadb('0x115')](_0x45e255);var _0xea7637=_[_0xfadb('0x34')](_0x3a5e64,function(_0x187aa6){return _0x187aa6[_0xfadb('0x116')](_0x34191f['id'],{'transaction':_0x43874c});});return Promise[_0xfadb('0x56')](_0xea7637);})[_0xfadb('0x1b')](function(){if(!_0x34191f['online'])return;var _0x486e3d=_['filter'](_0x3a5e64,function(_0x1235a3){return _0x1235a3[_0xfadb('0x10d')](_0xfadb('0x9a'))==='Voice';});var _0x5e2128=_[_0xfadb('0x34')](_0x486e3d,function(_0x27fd44){return db[_0xfadb('0xa9')][_0xfadb('0x29')]({'where':{'VoiceQueueId':_0x27fd44['id'],'UserId':_0x34191f['id']},'transaction':_0x43874c});});return Promise[_0xfadb('0x56')](_0x5e2128);})[_0xfadb('0x1b')](function(){return db[_0xfadb('0x117')][_0xfadb('0x4c')]({'where':{'teamId':{'$in':_0x2fd809}}});})[_0xfadb('0x1b')](function(_0x3fb53e){var _0xaf551b=_['map'](_0x3fb53e,function(_0x1e2c60){return db['UserVoicePrefix'][_0xfadb('0x29')]({'where':{'UserId':_0x34191f['id'],'VoicePrefixId':_0x1e2c60[_0xfadb('0x110')]}},{'transaction':_0x43874c});});return Promise[_0xfadb('0x56')](_0xaf551b);});});})[_0xfadb('0x1b')](function(){for(var _0x39fb21=0x0;_0x39fb21<_0x3a5e64[_0xfadb('0x4f')];_0x39fb21++){var _0x5c89e3=_0x3a5e64[_0x39fb21]['getDataValue'](_0xfadb('0x9a'));var _0x5e249e=_0x5c89e3+_0xfadb('0xa3');socket[_0xfadb('0xa4')](_0xfadb('0x2e')+_0x5c89e3+_0xfadb('0xad'),{'UserId':_0x53c0f0,['queueField']:_0x3a5e64[_0x39fb21]['id']});}})[_0xfadb('0x1b')](respondWithStatusCode(_0x244f32,null))[_0xfadb('0x57')](APIHandleError(_0x244f32));};exports['getLists']=function(_0x1dc566,_0x2657fc){var _0x36be56={};var _0x466e25={};var _0xdf370b;var _0x4d6b97;return db[_0xfadb('0x3a')][_0xfadb('0xc2')]({'where':{'id':_0x1dc566[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x2657fc,null))[_0xfadb('0x1b')](function(_0x11ade0){if(_0x11ade0){_0xdf370b=_0x11ade0;_0x466e25[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0x118')][_0xfadb('0xc9')]);_0x466e25['query']=_['keys'](_0x1dc566[_0xfadb('0x45')]);_0x466e25[_0xfadb('0xcb')]=_['intersection'](_0x466e25[_0xfadb('0xc7')],_0x466e25[_0xfadb('0x45')]);_0x36be56[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x466e25[_0xfadb('0xc7')],qs['fields'](_0x1dc566[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x36be56[_0xfadb('0x4a')]=_0x36be56[_0xfadb('0x4a')][_0xfadb('0x4f')]?_0x36be56[_0xfadb('0x4a')]:_0x466e25[_0xfadb('0xc7')];_0x36be56[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x1dc566[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x36be56[_0xfadb('0xd0')]=qs[_0xfadb('0xcb')](_['pick'](_0x1dc566[_0xfadb('0x45')],_0x466e25[_0xfadb('0xcb')]));if(_0x1dc566[_0xfadb('0x45')][_0xfadb('0x32')]){_0x36be56[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x36be56['where'],{'$or':_[_0xfadb('0x34')](_0x36be56[_0xfadb('0x4a')],function(_0x30415b){var _0x3a51ab={};_0x3a51ab[_0x30415b]={'$like':'%'+_0x1dc566[_0xfadb('0x45')][_0xfadb('0x32')]+'%'};return _0x3a51ab;})});}_0x36be56=_[_0xfadb('0x59')]({},_0x36be56,_0x1dc566['options']);return _0xdf370b[_0xfadb('0x119')](_0x36be56);}})[_0xfadb('0x1b')](function(_0x2e24a7){if(_0x2e24a7){_0x4d6b97=_0x2e24a7[_0xfadb('0x4f')];if(!_0x1dc566[_0xfadb('0x45')][_0xfadb('0xc3')](_0xfadb('0xd2'))){_0x36be56[_0xfadb('0x15')]=qs[_0xfadb('0x15')](_0x1dc566['query']['limit']);_0x36be56[_0xfadb('0x17')]=qs[_0xfadb('0x17')](_0x1dc566['query']['offset']);}return _0xdf370b[_0xfadb('0x119')](_0x36be56);}})[_0xfadb('0x1b')](function(_0x5069b1){if(_0x5069b1){return _0x5069b1?{'count':_0x4d6b97,'rows':_0x5069b1}:null;}})[_0xfadb('0x1b')](respondWithResult(_0x2657fc,null))[_0xfadb('0x57')](handleError(_0x2657fc,null));};exports[_0xfadb('0x11a')]=function(_0x2faded,_0x2bd596){var _0x4aff1f={};var _0x5d7ce6={};var _0x31bed7;return db[_0xfadb('0x3a')]['findOne']({'where':{'id':_0x2faded[_0xfadb('0x58')]['id']}})[_0xfadb('0x1b')](handleEntityNotFound(_0x2bd596,null))[_0xfadb('0x1b')](function(_0x18d075){if(_0x18d075){_0x31bed7=_0x18d075;_0x5d7ce6[_0xfadb('0xc7')]=_[_0xfadb('0xca')](db[_0xfadb('0x3a')][_0xfadb('0xc9')]);_0x5d7ce6[_0xfadb('0x45')]=_['keys'](_0x2faded[_0xfadb('0x45')]);_0x5d7ce6[_0xfadb('0xcb')]=_['intersection'](_0x5d7ce6['model'],_0x5d7ce6['query']);_0x4aff1f[_0xfadb('0x4a')]=_[_0xfadb('0xcc')](_0x5d7ce6[_0xfadb('0xc7')],qs[_0xfadb('0xcd')](_0x2faded[_0xfadb('0x45')][_0xfadb('0xcd')]));_0x4aff1f[_0xfadb('0x4a')]=_0x4aff1f[_0xfadb('0x4a')]['length']?_0x4aff1f[_0xfadb('0x4a')]:_0x5d7ce6[_0xfadb('0xc7')];_0x4aff1f[_0xfadb('0xce')]=qs[_0xfadb('0xcf')](_0x2faded[_0xfadb('0x45')][_0xfadb('0xcf')]);_0x4aff1f[_0xfadb('0xd0')]=qs['filters'](_['pick'](_0x2faded['query'],_0x5d7ce6[_0xfadb('0xcb')]));if(_0x2faded[_0xfadb('0x45')][_0xfadb('0x32')]){_0x4aff1f[_0xfadb('0xd0')]=_[_0xfadb('0x59')](_0x4aff1f[_0xfadb('0xd0')],{'$or':_[_0xfadb('0x34')](_0x4aff1f['attributes'],function(_0x506ae0){var _0x810cf2={};_0x810cf2[_0x506ae0]={'$like':'%'+_0x2faded[_0xfadb('0x45')]['filter']+'%'};return _0x810cf2;})});}_0x4aff1f[_0xfadb('0xc7')]=db[_0xfadb('0x3a')];_0x4aff1f['as']=_0xfadb('0x2f');_0x4aff1f=_[_0xfadb('0x59')]({},_0x4aff1f,_0x2faded[_0xfadb('0xde')]);return _0x31bed7[_0xfadb('0xf1')]({'include':[_0x4aff1f]});}})[_0xfadb('0x1b')](function(_0x1e4bb7){if(_0x1e4bb7){var _0x40be96={},_0x4305f8=[];for(var _0x167eda=0x0;_0x167eda<_0x1e4bb7[_0xfadb('0x4f')];_0x167eda+=0x1){for(var _0x10da44=0x0,_0x417574;_0x10da44<_0x1e4bb7[_0x167eda][_0xfadb('0x2f')][_0xfadb('0x4f')];_0x10da44+=0x1){_0x417574=_0x1e4bb7[_0x167eda][_0xfadb('0x2f')][_0x10da44][_0xfadb('0x2a')]({'plain':!![]});_0x40be96[_0x417574['id']]=_0x417574;}}_0x40be96=_[_0xfadb('0x11b')](_0x40be96);for(var _0x2c43d7=qs[_0xfadb('0x17')](_0x2faded[_0xfadb('0x45')]['offset']);_0x2c43d7<_0x40be96[_0xfadb('0x4f')]&&_0x4305f8['length']=_0x4aa0b1[_0x9a77('0x4b')]){throw new Error(_0x9a77('0x4c'));}})[_0x9a77('0x1d')](function(){if(_0x478483){return db[_0x9a77('0x23')][_0x9a77('0x4d')]({'where':{'membername':_0x478483[_0x9a77('0x1f')]},'individualHooks':!![]});}})[_0x9a77('0x1d')](function(){if(_0x478483){return _0x478483[_0x9a77('0x4e')]({'raw':!![]});}})['then'](function(_0x5463e7){if(_0x478483){if(_0x5463e7){var _0x4f881e=[];_0x3632cd=_0x5463e7;if(_0x3632cd['length']){for(var _0x1f12ce=0x0;_0x1f12ce<_0x3632cd[_0x9a77('0x27')];_0x1f12ce++){_0x4f881e[_0x9a77('0x4f')](db[_0x9a77('0x23')]['upsert']({'membername':_0x478483[_0x9a77('0x1f')],'UserId':_0x478483['id'],'queue_name':_0x3632cd[_0x1f12ce][_0x9a77('0x1f')],'VoiceQueueId':_0x3632cd[_0x1f12ce]['id'],'interface':_0x455b7e,'paused':_0x478483[_0x9a77('0x47')]||![],'penalty':_0x3632cd[_0x1f12ce][_0x9a77('0x50')]||0x0}));}return BPromise[_0x9a77('0x46')](_0x4f881e);}}}})[_0x9a77('0x1d')](function(){if(_0x478483){return db[_0x9a77('0x25')][_0x9a77('0x45')]({'where':{'membername':_0x478483[_0x9a77('0x1f')],'exitAt':null}});}})[_0x9a77('0x1d')](function(_0x19604a){if(_0x478483){if(_0x19604a&&_0x19604a[_0x9a77('0x27')]){var _0x58f287=[];_0x19604a[_0x9a77('0x2a')](function(_0x289821){_0x58f287['push'](_0x289821[_0x9a77('0x24')]({'exitAt':moment()[_0x9a77('0x21')](_0x9a77('0x28'))}));});return BPromise['all'](_0x58f287);}}})[_0x9a77('0x1d')](function(){if(_0x478483){var _0x4c4756=[];var _0x2d4a3c=[];var _0x3d3cef=utils[_0x9a77('0x29')]();var _0x236568={'membername':_0x478483['name'],'interface':_0x455b7e,'enterAt':moment()['format'](_0x9a77('0x28')),'role':_0x478483[_0x9a77('0x20')],'internal':_0x478483[_0x9a77('0x30')]};_0x3d3cef[_0x9a77('0x2a')](function(_0x40bb69){_0x4c4756[_0x9a77('0x4f')](_[_0x9a77('0x51')]({'channel':_0x40bb69,'type':'LOGIN','data1':_0x9a77('0x52'),'data2':_0x455b7e},_0x236568));if(_0x478483[_0x9a77('0x47')]){_0x2d4a3c[_0x9a77('0x4f')](_[_0x9a77('0x51')]({'channel':_0x40bb69,'type':_0x9a77('0x26'),'data1':_0x9a77('0x53')},_0x236568));}});return db['MemberReport']['bulkCreate'](_0x4c4756[_0x9a77('0x54')](_0x2d4a3c),{'individualHooks':!![]});}})[_0x9a77('0x1d')](function(){if(_0x478483){return _0x478483[_0x9a77('0x24')]({'online':!![],'lastLoginAt':moment()[_0x9a77('0x21')](_0x9a77('0x28')),'voicePause':_0x478483[_0x9a77('0x47')]||![],'mailPause':_0x478483[_0x9a77('0x47')]||![],'chatPause':_0x478483[_0x9a77('0x47')]||![],'faxPause':_0x478483[_0x9a77('0x47')]||![],'smsPause':_0x478483[_0x9a77('0x47')]||![],'openchannelPause':_0x478483[_0x9a77('0x47')]||![],'pauseType':_0x478483[_0x9a77('0x47')]?_0x9a77('0x53'):null,'lastPauseAt':moment()[_0x9a77('0x21')](_0x9a77('0x28')),'interface':_0x455b7e});}})[_0x9a77('0x1d')](function(_0x3283b5){_0x1e5401(_0x3283b5);})['catch'](function(_0x5eba1a){_0x43ae00(_0x363020['error'](0x1f4,_0x5eba1a[_0x9a77('0x19')]));});});}; \ No newline at end of file +var _0x3b68=['UnpauseUser','resolve','channel','isValidChannel','findOne','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','system','LogoutUser','forEach','LoginUser','mobile','loginInPause','count','agent','getLicense','agents','UserVoiceQueueRt','destroy','upsert','merge','LOGIN','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','info','debug','stringify','catch','message','find','then','ShowUser','error','PauseUser','name','role','internal','interface','format','params','update','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','push','SIP/%s','body','DEFAULT\x20PAUSE','uniqueid','MemberReport','bulkCreate','type'];(function(_0x5e14e1,_0x5dccf4){var _0x267fd5=function(_0x2162e4){while(--_0x2162e4){_0x5e14e1['push'](_0x5e14e1['shift']());}};_0x267fd5(++_0x5dccf4);}(_0x3b68,0x76));var _0x83b6=function(_0x12ca24,_0x56c0ec){_0x12ca24=_0x12ca24-0x0;var _0x56937f=_0x3b68[_0x12ca24];return _0x56937f;};'use strict';var _=require(_0x83b6('0x0'));var util=require(_0x83b6('0x1'));var moment=require(_0x83b6('0x2'));var BPromise=require(_0x83b6('0x3'));var Redis=require(_0x83b6('0x4'));var db=require(_0x83b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x83b6('0x6'))(_0x83b6('0x7'));var config=require('../../config/environment');config[_0x83b6('0x8')]=_[_0x83b6('0x9')](config[_0x83b6('0x8')],{'host':_0x83b6('0xa'),'port':0x18eb});var socket=require(_0x83b6('0xb'))(new Redis(config[_0x83b6('0x8')]));require(_0x83b6('0xc'))[_0x83b6('0xd')](socket);exports[_0x83b6('0xe')]=function(_0x138077){var _0x420bc1=this;return new Promise(function(_0x3a75bf,_0x53b8c3){return db[_0x83b6('0xf')][_0x83b6('0x10')]({'raw':_0x138077['options']?_0x138077[_0x83b6('0x11')][_0x83b6('0x12')]===undefined?!![]:![]:!![],'where':_0x138077[_0x83b6('0x11')]?_0x138077['options'][_0x83b6('0x13')]||null:null,'attributes':_0x138077['options']?_0x138077[_0x83b6('0x11')]['attributes']||null:null,'limit':_0x138077[_0x83b6('0x11')]?_0x138077[_0x83b6('0x11')][_0x83b6('0x14')]||null:null,'include':_0x138077[_0x83b6('0x11')]?_0x138077[_0x83b6('0x11')][_0x83b6('0x15')]?_[_0x83b6('0x16')](_0x138077[_0x83b6('0x11')]['include'],function(_0x29652f){return{'model':db[_0x29652f['model']],'as':_0x29652f['as'],'attributes':_0x29652f['attributes'],'include':_0x29652f[_0x83b6('0x15')]?_[_0x83b6('0x16')](_0x29652f[_0x83b6('0x15')],function(_0x38b7d7){return{'model':db[_0x38b7d7[_0x83b6('0x17')]],'as':_0x38b7d7['as'],'attributes':_0x38b7d7['attributes'],'include':_0x38b7d7[_0x83b6('0x15')]?_[_0x83b6('0x16')](_0x38b7d7[_0x83b6('0x15')],function(_0x5bcff1){return{'model':db[_0x5bcff1[_0x83b6('0x17')]],'as':_0x5bcff1['as'],'attributes':_0x5bcff1[_0x83b6('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ace5a){logger[_0x83b6('0x19')](_0x83b6('0xe'),_0x138077);logger[_0x83b6('0x1a')](_0x83b6('0xe'),_0x138077,JSON[_0x83b6('0x1b')](_0x2ace5a));_0x3a75bf(_0x2ace5a);})[_0x83b6('0x1c')](function(_0x63f1f4){logger['error'](_0x83b6('0xe'),_0x63f1f4[_0x83b6('0x1d')],_0x138077);_0x53b8c3(_0x420bc1['error'](0x1f4,_0x63f1f4[_0x83b6('0x1d')]));});});};exports['ShowUser']=function(_0x5c28b2){var _0x314425=this;return new Promise(function(_0x12f1ca,_0x304482){return db['User'][_0x83b6('0x1e')]({'raw':_0x5c28b2[_0x83b6('0x11')]?_0x5c28b2[_0x83b6('0x11')][_0x83b6('0x12')]===undefined?!![]:![]:!![],'where':_0x5c28b2['options']?_0x5c28b2[_0x83b6('0x11')][_0x83b6('0x13')]||null:null,'attributes':_0x5c28b2[_0x83b6('0x11')]?_0x5c28b2['options']['attributes']||null:null,'include':_0x5c28b2[_0x83b6('0x11')]?_0x5c28b2[_0x83b6('0x11')][_0x83b6('0x15')]?_[_0x83b6('0x16')](_0x5c28b2[_0x83b6('0x11')][_0x83b6('0x15')],function(_0x400683){return{'model':db[_0x400683['model']],'as':_0x400683['as'],'attributes':_0x400683['attributes'],'include':_0x400683[_0x83b6('0x15')]?_['map'](_0x400683['include'],function(_0xf39a90){return{'model':db[_0xf39a90['model']],'as':_0xf39a90['as'],'attributes':_0xf39a90[_0x83b6('0x18')],'include':_0xf39a90[_0x83b6('0x15')]?_['map'](_0xf39a90['include'],function(_0x1cc219){return{'model':db[_0x1cc219[_0x83b6('0x17')]],'as':_0x1cc219['as'],'attributes':_0x1cc219['attributes']};}):[]};}):[]};}):[]:[]})[_0x83b6('0x1f')](function(_0x4ff481){logger[_0x83b6('0x19')](_0x83b6('0x20'),_0x5c28b2);logger[_0x83b6('0x1a')]('ShowUser',_0x5c28b2,JSON[_0x83b6('0x1b')](_0x4ff481));_0x12f1ca(_0x4ff481);})[_0x83b6('0x1c')](function(_0x3f319e){logger['error'](_0x83b6('0x20'),_0x3f319e[_0x83b6('0x1d')],_0x5c28b2);_0x304482(_0x314425[_0x83b6('0x21')](0x1f4,_0x3f319e['message']));});});};exports[_0x83b6('0x22')]=function(_0x390e41){var _0x5d319d;return db['User'][_0x83b6('0x1e')]({'where':_0x390e41[_0x83b6('0x11')][_0x83b6('0x13')]||{},'attributes':['id',_0x83b6('0x23'),_0x83b6('0x24'),_0x83b6('0x25'),_0x83b6('0x26')]})[_0x83b6('0x1f')](function(_0x3d4fa4){if(!_0x3d4fa4){throw new Error(util[_0x83b6('0x27')]('User\x20with\x20id\x20%s\x20not\x20found',_0x390e41[_0x83b6('0x28')]['id']));}_0x5d319d=_0x3d4fa4;return db['UserVoiceQueueRt'][_0x83b6('0x29')]({'paused':0x1},{'where':{'UserId':_0x5d319d['id']},'individualHooks':!![]});})[_0x83b6('0x1f')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x5d319d[_0x83b6('0x23')],'type':'PAUSE','exitAt':null}});})[_0x83b6('0x1f')](function(_0x3736d4){if(_0x3736d4&&_0x3736d4['length']){var _0x169858=moment()[_0x83b6('0x27')](_0x83b6('0x2a'));for(var _0x428cc6=0x0,_0x5ea436=_0x3736d4[_0x83b6('0x2b')];_0x428cc6<_0x5ea436;_0x428cc6++){_0x3736d4[_0x428cc6][_0x83b6('0x2c')]({'exitAt':_0x169858});}}})[_0x83b6('0x1f')](function(){var _0x4cdba8=[];var _0x5b8551=utils[_0x83b6('0x2d')]();_0x5b8551['forEach'](function(_0x125cb3){_0x4cdba8[_0x83b6('0x2e')]({'channel':_0x125cb3,'membername':_0x5d319d[_0x83b6('0x23')],'interface':_['isNil'](_0x5d319d[_0x83b6('0x26')])?util['format'](_0x83b6('0x2f'),_0x5d319d[_0x83b6('0x23')]):_0x5d319d['interface'],'type':'PAUSE','enterAt':moment()[_0x83b6('0x27')](_0x83b6('0x2a')),'data1':_0x390e41[_0x83b6('0x30')]['type']||_0x83b6('0x31'),'role':_0x5d319d['role'],'internal':_0x5d319d[_0x83b6('0x25')],'uniqueid':_0x390e41[_0x83b6('0x30')][_0x83b6('0x32')]||null});});return db[_0x83b6('0x33')][_0x83b6('0x34')](_0x4cdba8,{'individualHooks':!![]});})['then'](function(){return _0x5d319d[_0x83b6('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x390e41[_0x83b6('0x30')][_0x83b6('0x35')]||_0x83b6('0x31'),'lastPauseAt':moment()[_0x83b6('0x27')](_0x83b6('0x2a'))});})[_0x83b6('0x1c')](function(_0x5b8ecb){throw _0x5b8ecb;});};exports[_0x83b6('0x36')]=function(_0x3a821c){return Promise[_0x83b6('0x37')]()[_0x83b6('0x1f')](function(){if(_0x3a821c[_0x83b6('0x30')][_0x83b6('0x38')]&&!utils[_0x83b6('0x39')](_0x3a821c[_0x83b6('0x30')][_0x83b6('0x38')])){throw new Error(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x3a821c['body'][_0x83b6('0x38')]));}return db[_0x83b6('0xf')][_0x83b6('0x3a')]({'where':_0x3a821c[_0x83b6('0x11')]['where']||{},'attributes':['id',_0x83b6('0x23'),_0x83b6('0x24'),_0x83b6('0x25'),'interface',_0x83b6('0x3b'),_0x83b6('0x3c'),_0x83b6('0x3d'),_0x83b6('0x3e'),_0x83b6('0x3f'),_0x83b6('0x40'),_0x83b6('0x41'),_0x83b6('0x42'),_0x83b6('0x43'),'lastPauseAt']});})[_0x83b6('0x1f')](function(_0x31a6ec){if(!_0x31a6ec){throw new Error(util[_0x83b6('0x27')](_0x83b6('0x44'),_0x3a821c[_0x83b6('0x28')]['id']));}return _0x31a6ec['unpause'](_0x3a821c[_0x83b6('0x30')][_0x83b6('0x38')],_0x83b6('0x45'));})[_0x83b6('0x1c')](function(_0x525151){throw _0x525151;});};exports[_0x83b6('0x46')]=function(_0x43ad5a){var _0x202431=this;return new Promise(function(_0x3ee1e6,_0x24cb8){var _0xdbde01;return db[_0x83b6('0xf')][_0x83b6('0x3a')]({'where':_0x43ad5a[_0x83b6('0x11')][_0x83b6('0x13')]||{},'attributes':['id',_0x83b6('0x23')]})[_0x83b6('0x1f')](function(_0x23680f){if(_0x23680f){_0xdbde01=_0x23680f;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0xdbde01[_0x83b6('0x23')]},'individualHooks':!![]});}})[_0x83b6('0x1f')](function(){if(_0xdbde01){return db[_0x83b6('0x33')][_0x83b6('0x10')]({'where':{'membername':_0xdbde01[_0x83b6('0x23')],'exitAt':null}});}})[_0x83b6('0x1f')](function(_0x2ff7f3){if(_0xdbde01){if(_0x2ff7f3&&_0x2ff7f3[_0x83b6('0x2b')]){var _0x175383=[];_0x2ff7f3[_0x83b6('0x47')](function(_0x4cb479){_0x175383[_0x83b6('0x2e')](_0x4cb479[_0x83b6('0x29')]({'exitAt':moment()[_0x83b6('0x27')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x175383);}}})['then'](function(){if(_0xdbde01){return _0xdbde01['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2e83b7){_0x3ee1e6(_0x2e83b7);})[_0x83b6('0x1c')](function(_0x35e593){_0x24cb8(_0x202431['error'](0x1f4,_0x35e593[_0x83b6('0x1d')]));});});};exports[_0x83b6('0x48')]=function(_0x30a988){var _0x2c0f13=this;return new Promise(function(_0xab0793,_0x24f1d0){var _0xf7c7de;var _0x2cc1b5;var _0x467cf0;var _0x439a44;return db[_0x83b6('0xf')][_0x83b6('0x3a')]({'where':_0x30a988['options']['where']||{},'attributes':['id',_0x83b6('0x23'),_0x83b6('0x24'),_0x83b6('0x49'),'phone',_0x83b6('0x25'),_0x83b6('0x4a'),_0x83b6('0x26')]})['then'](function(_0x24133c){if(_0x24133c){_0xf7c7de=_0x24133c;_0x439a44=_0x30a988['body'][_0x83b6('0x26')]?_0x30a988[_0x83b6('0x30')][_0x83b6('0x26')]:util[_0x83b6('0x27')]('SIP/%s',_0xf7c7de[_0x83b6('0x23')]);return db[_0x83b6('0xf')][_0x83b6('0x4b')]({'where':{'role':_0x83b6('0x4c'),'online':!![],'id':{'$ne':_0xf7c7de['id']}}});}})[_0x83b6('0x1f')](function(_0x17097a){if(_0x17097a){_0x467cf0=_0x17097a;return require('../../config/license/util')[_0x83b6('0x4d')]();}})[_0x83b6('0x1f')](function(_0x10c65e){if(_0x10c65e&&_0x10c65e[_0x83b6('0x4e')]&&_0x467cf0>=_0x10c65e[_0x83b6('0x4e')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x83b6('0x1f')](function(){if(_0xf7c7de){return db[_0x83b6('0x4f')][_0x83b6('0x50')]({'where':{'membername':_0xf7c7de[_0x83b6('0x23')]},'individualHooks':!![]});}})[_0x83b6('0x1f')](function(){if(_0xf7c7de){return _0xf7c7de['getVoiceQueues']({'raw':!![]});}})[_0x83b6('0x1f')](function(_0x1c5ea3){if(_0xf7c7de){if(_0x1c5ea3){var _0x16f90f=[];_0x2cc1b5=_0x1c5ea3;if(_0x2cc1b5[_0x83b6('0x2b')]){for(var _0x3fe160=0x0;_0x3fe160<_0x2cc1b5[_0x83b6('0x2b')];_0x3fe160++){_0x16f90f[_0x83b6('0x2e')](db[_0x83b6('0x4f')][_0x83b6('0x51')]({'membername':_0xf7c7de['name'],'UserId':_0xf7c7de['id'],'queue_name':_0x2cc1b5[_0x3fe160][_0x83b6('0x23')],'VoiceQueueId':_0x2cc1b5[_0x3fe160]['id'],'interface':_0x439a44,'paused':_0xf7c7de['loginInPause']||![],'penalty':_0x2cc1b5[_0x3fe160]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x16f90f);}}}})[_0x83b6('0x1f')](function(){if(_0xf7c7de){return db[_0x83b6('0x33')]['findAll']({'where':{'membername':_0xf7c7de[_0x83b6('0x23')],'exitAt':null}});}})[_0x83b6('0x1f')](function(_0x309791){if(_0xf7c7de){if(_0x309791&&_0x309791[_0x83b6('0x2b')]){var _0x535350=[];_0x309791[_0x83b6('0x47')](function(_0x211627){_0x535350[_0x83b6('0x2e')](_0x211627['update']({'exitAt':moment()[_0x83b6('0x27')](_0x83b6('0x2a'))}));});return BPromise['all'](_0x535350);}}})['then'](function(){if(_0xf7c7de){var _0x184c97=[];var _0x1a684a=[];var _0x587344=utils[_0x83b6('0x2d')]();var _0x1c1d2b={'membername':_0xf7c7de[_0x83b6('0x23')],'interface':_0x439a44,'enterAt':moment()[_0x83b6('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xf7c7de['role'],'internal':_0xf7c7de[_0x83b6('0x25')]};_0x587344['forEach'](function(_0x4261cf){_0x184c97['push'](_[_0x83b6('0x52')]({'channel':_0x4261cf,'type':_0x83b6('0x53'),'data1':_0x83b6('0x54'),'data2':_0x439a44},_0x1c1d2b));if(_0xf7c7de['loginInPause']){_0x1a684a[_0x83b6('0x2e')](_[_0x83b6('0x52')]({'channel':_0x4261cf,'type':'PAUSE','data1':_0x83b6('0x55')},_0x1c1d2b));}});return db[_0x83b6('0x33')][_0x83b6('0x34')](_0x184c97['concat'](_0x1a684a),{'individualHooks':!![]});}})[_0x83b6('0x1f')](function(){if(_0xf7c7de){return _0xf7c7de[_0x83b6('0x29')]({'online':!![],'lastLoginAt':moment()[_0x83b6('0x27')](_0x83b6('0x2a')),'voicePause':_0xf7c7de[_0x83b6('0x4a')]||![],'mailPause':_0xf7c7de[_0x83b6('0x4a')]||![],'chatPause':_0xf7c7de[_0x83b6('0x4a')]||![],'faxPause':_0xf7c7de[_0x83b6('0x4a')]||![],'smsPause':_0xf7c7de[_0x83b6('0x4a')]||![],'openchannelPause':_0xf7c7de[_0x83b6('0x4a')]||![],'pauseType':_0xf7c7de[_0x83b6('0x4a')]?_0x83b6('0x55'):null,'lastPauseAt':moment()[_0x83b6('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x439a44});}})['then'](function(_0x122358){_0xab0793(_0x122358);})[_0x83b6('0x1c')](function(_0x2109a0){_0x24f1d0(_0x2c0f13[_0x83b6('0x21')](0x1f4,_0x2109a0[_0x83b6('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 1b136e6..ead55ef 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 _0x4a83=['register','user:','./user.events','save','remove','emit','removeListener'];(function(_0x417edf,_0x5ae68c){var _0x11ff3f=function(_0x420587){while(--_0x420587){_0x417edf['push'](_0x417edf['shift']());}};_0x11ff3f(++_0x5ae68c);}(_0x4a83,0x19f));var _0x34a8=function(_0x429085,_0x1997d6){_0x429085=_0x429085-0x0;var _0x92d224=_0x4a83[_0x429085];return _0x92d224;};'use strict';var UserEvents=require(_0x34a8('0x0'));var events=[_0x34a8('0x1'),_0x34a8('0x2'),'update'];function createListener(_0x2a1ce2,_0x37540d){return function(_0x888dc){_0x37540d[_0x34a8('0x3')](_0x2a1ce2,_0x888dc);};}function removeListener(_0x3c71b0,_0x2e0bbd){return function(){UserEvents[_0x34a8('0x4')](_0x3c71b0,_0x2e0bbd);};}exports[_0x34a8('0x5')]=function(_0x8b0067){for(var _0x5dc847=0x0,_0x724b84=events['length'];_0x5dc847<_0x724b84;_0x5dc847++){var _0x144a40=events[_0x5dc847];var _0xdc169a=createListener(_0x34a8('0x6')+_0x144a40,_0x8b0067);UserEvents['on'](_0x144a40,_0xdc169a);}}; \ No newline at end of file +var _0xcd68=['removeListener','./user.events','save','remove','update','emit'];(function(_0x428c9e,_0xfce6e){var _0x15f0ac=function(_0x1394b5){while(--_0x1394b5){_0x428c9e['push'](_0x428c9e['shift']());}};_0x15f0ac(++_0xfce6e);}(_0xcd68,0x109));var _0x8cd6=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xcd68[_0x5e36d1];return _0x950b9e;};'use strict';var UserEvents=require(_0x8cd6('0x0'));var events=[_0x8cd6('0x1'),_0x8cd6('0x2'),_0x8cd6('0x3')];function createListener(_0x2e3311,_0x421b53){return function(_0x3ea01c){_0x421b53[_0x8cd6('0x4')](_0x2e3311,_0x3ea01c);};}function removeListener(_0x39a91c,_0x2dd7f9){return function(){UserEvents[_0x8cd6('0x5')](_0x39a91c,_0x2dd7f9);};}exports['register']=function(_0xe6a185){for(var _0x175b69=0x0,_0x1008aa=events['length'];_0x175b69<_0x1008aa;_0x175b69++){var _0x1faa18=events[_0x175b69];var _0x57e944=createListener('user:'+_0x1faa18,_0xe6a185);UserEvents['on'](_0x1faa18,_0x57e944);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index cc68d80..e7ebfcd 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0xf200b2,_0x59538b){var _0x34f028=function(_0x259eb6){while(--_0x259eb6){_0xf200b2['push'](_0xf200b2['shift']());}};_0x34f028(++_0x59538b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x30fdf9,_0x89096d){var _0x3c43bb=function(_0x40a755){while(--_0x40a755){_0x30fdf9['push'](_0x30fdf9['shift']());}};_0x3c43bb(++_0x89096d);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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 d91f19f..b889306 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 _0x5c06=['sequelize','INTEGER'];(function(_0x2fdfe7,_0x27726d){var _0x215059=function(_0x144a64){while(--_0x144a64){_0x2fdfe7['push'](_0x2fdfe7['shift']());}};_0x215059(++_0x27726d);}(_0x5c06,0x6c));var _0x65c0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5c06[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x65c0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x65c0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8626=['INTEGER','exports'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x8626,0xd9));var _0x6862=function(_0x1c2f02,_0x2a486f){_0x1c2f02=_0x1c2f02-0x0;var _0x4c0299=_0x8626[_0x1c2f02];return _0x4c0299;};'use strict';var Sequelize=require('sequelize');module[_0x6862('0x0')]={'penalty':{'type':Sequelize[_0x6862('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 0a7460f..890b737 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 _0x9436=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x4de142,_0x52ae2a){var _0x5b5af2=function(_0x3d7ae3){while(--_0x3d7ae3){_0x4de142['push'](_0x4de142['shift']());}};_0x5b5af2(++_0x52ae2a);}(_0x9436,0x177));var _0x6943=function(_0x514015,_0x298fc5){_0x514015=_0x514015-0x0;var _0x21e361=_0x9436[_0x514015];return _0x21e361;};'use strict';var _=require(_0x6943('0x0'));var util=require(_0x6943('0x1'));var logger=require(_0x6943('0x2'))(_0x6943('0x3'));var moment=require('moment');var BPromise=require(_0x6943('0x4'));var rp=require(_0x6943('0x5'));var fs=require('fs');var path=require(_0x6943('0x6'));var rimraf=require(_0x6943('0x7'));var config=require(_0x6943('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x6943('0x9')]=function(_0x54d13f,_0x55ae8b){return _0x54d13f[_0x6943('0xa')](_0x6943('0xb'),attributes,{'tableName':_0x6943('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56a0=['moment','path','rimraf','../../config/environment','exports','define','user_has_chat_queues','../../config/logger','api'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x56a0,0xa0));var _0x056a=function(_0x6cf622,_0x146e67){_0x6cf622=_0x6cf622-0x0;var _0x1887fe=_0x56a0[_0x6cf622];return _0x1887fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x056a('0x0'))(_0x056a('0x1'));var moment=require(_0x056a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x056a('0x3'));var rimraf=require(_0x056a('0x4'));var config=require(_0x056a('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x056a('0x6')]=function(_0x140352,_0x59895b){return _0x140352[_0x056a('0x7')]('UserChatQueue',attributes,{'tableName':_0x056a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 9cc071a..7212f93 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 _0x80be=['request','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58ae3b,_0x12faf5){var _0x5b75b4=function(_0x3d4baa){while(--_0x3d4baa){_0x58ae3b['push'](_0x58ae3b['shift']());}};_0x5b75b4(++_0x12faf5);}(_0x80be,0x11e));var _0xe80b=function(_0x13d86d,_0x4c8196){_0x13d86d=_0x13d86d-0x0;var _0x2d91de=_0x80be[_0x13d86d];return _0x2d91de;};'use strict';var _=require(_0xe80b('0x0'));var util=require(_0xe80b('0x1'));var moment=require(_0xe80b('0x2'));var BPromise=require(_0xe80b('0x3'));var rs=require(_0xe80b('0x4'));var fs=require('fs');var Redis=require(_0xe80b('0x5'));var db=require(_0xe80b('0x6'))['db'];var utils=require(_0xe80b('0x7'));var logger=require(_0xe80b('0x8'))(_0xe80b('0x9'));var config=require(_0xe80b('0xa'));var jayson=require(_0xe80b('0xb'));var client=jayson[_0xe80b('0xc')][_0xe80b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4963d3,_0x3d1292,_0x332095){return new BPromise(function(_0x505dd0,_0x5f453a){return client[_0xe80b('0xe')](_0x4963d3,_0x332095)['then'](function(_0x4e2ac1){logger['info'](_0xe80b('0xf'),_0x3d1292,'request\x20sent');logger[_0xe80b('0x10')](_0xe80b('0x11'),_0x3d1292,_0xe80b('0x12'),JSON[_0xe80b('0x13')](_0x4e2ac1));if(_0x4e2ac1[_0xe80b('0x14')]){if(_0x4e2ac1['error'][_0xe80b('0x15')]===0x1f4){logger[_0xe80b('0x14')](_0xe80b('0xf'),_0x3d1292,_0x4e2ac1[_0xe80b('0x14')][_0xe80b('0x16')]);return _0x5f453a(_0x4e2ac1['error'][_0xe80b('0x16')]);}logger[_0xe80b('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x3d1292,_0x4e2ac1[_0xe80b('0x14')][_0xe80b('0x16')]);return _0x505dd0(_0x4e2ac1['error'][_0xe80b('0x16')]);}else{logger[_0xe80b('0x17')](_0xe80b('0xf'),_0x3d1292,_0xe80b('0x12'));_0x505dd0(_0x4e2ac1['result'][_0xe80b('0x16')]);}})[_0xe80b('0x18')](function(_0x4b200b){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x3d1292,_0x4b200b);_0x5f453a(_0x4b200b);});});} \ No newline at end of file +var _0x10ec=['rpc','../../config/environment','jayson/promise','client','http','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe7a219,_0x512edf){var _0x3a3d4f=function(_0x5e3bc8){while(--_0x5e3bc8){_0xe7a219['push'](_0xe7a219['shift']());}};_0x3a3d4f(++_0x512edf);}(_0x10ec,0x127));var _0xc10e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x10ec[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xc10e('0x0'));var util=require(_0xc10e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc10e('0x2'))['db'];var utils=require(_0xc10e('0x3'));var logger=require(_0xc10e('0x4'))(_0xc10e('0x5'));var config=require(_0xc10e('0x6'));var jayson=require(_0xc10e('0x7'));var client=jayson[_0xc10e('0x8')][_0xc10e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aac70,_0x388e29,_0x580d27){return new BPromise(function(_0x2c9716,_0x4bc60a){return client['request'](_0x1aac70,_0x580d27)[_0xc10e('0xa')](function(_0x5bdb06){logger['info'](_0xc10e('0xb'),_0x388e29,_0xc10e('0xc'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x388e29,_0xc10e('0xc'),JSON[_0xc10e('0xd')](_0x5bdb06));if(_0x5bdb06[_0xc10e('0xe')]){if(_0x5bdb06['error'][_0xc10e('0xf')]===0x1f4){logger[_0xc10e('0xe')](_0xc10e('0xb'),_0x388e29,_0x5bdb06['error'][_0xc10e('0x10')]);return _0x4bc60a(_0x5bdb06[_0xc10e('0xe')][_0xc10e('0x10')]);}logger[_0xc10e('0xe')](_0xc10e('0xb'),_0x388e29,_0x5bdb06['error'][_0xc10e('0x10')]);return _0x2c9716(_0x5bdb06['error'][_0xc10e('0x10')]);}else{logger[_0xc10e('0x11')](_0xc10e('0xb'),_0x388e29,'request\x20sent');_0x2c9716(_0x5bdb06[_0xc10e('0x12')][_0xc10e('0x10')]);}})[_0xc10e('0x13')](function(_0x38e986){logger[_0xc10e('0xe')](_0xc10e('0xb'),_0x388e29,_0x38e986);_0x4bc60a(_0x38e986);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index cc8ae5e..efb1dcb 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x26e105,_0x821a88){var _0x534f19=function(_0x3cbc79){while(--_0x3cbc79){_0x26e105['push'](_0x26e105['shift']());}};_0x534f19(++_0x821a88);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x721052,_0x527836){var _0x4190fa=function(_0xbd852d){while(--_0xbd852d){_0x721052['push'](_0x721052['shift']());}};_0x4190fa(++_0x527836);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xcb91[_0x420b24];return _0x4da552;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 9e97e6e..f7c8ade 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 _0xe1fc=['exports','INTEGER'];(function(_0x59498e,_0x1ea6d9){var _0x20473a=function(_0x515515){while(--_0x515515){_0x59498e['push'](_0x59498e['shift']());}};_0x20473a(++_0x1ea6d9);}(_0xe1fc,0x1aa));var _0xce1f=function(_0x13e300,_0x1bcb41){_0x13e300=_0x13e300-0x0;var _0x5a3eea=_0xe1fc[_0x13e300];return _0x5a3eea;};'use strict';var Sequelize=require('sequelize');module[_0xce1f('0x0')]={'penalty':{'type':Sequelize[_0xce1f('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c34=['sequelize','INTEGER'];(function(_0x23c9b6,_0x5b7661){var _0x3a23dd=function(_0x305ad4){while(--_0x305ad4){_0x23c9b6['push'](_0x23c9b6['shift']());}};_0x3a23dd(++_0x5b7661);}(_0x5c34,0xd2));var _0x45c3=function(_0x531789,_0x427558){_0x531789=_0x531789-0x0;var _0x29db1c=_0x5c34[_0x531789];return _0x29db1c;};'use strict';var Sequelize=require(_0x45c3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x45c3('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x45c3('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7466358..c88c579 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 _0xf9e8=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x16f1a9,_0x568803){var _0x40ba3f=function(_0x12035d){while(--_0x12035d){_0x16f1a9['push'](_0x16f1a9['shift']());}};_0x40ba3f(++_0x568803);}(_0xf9e8,0x1d3));var _0x8f9e=function(_0x47acac,_0x3b8af6){_0x47acac=_0x47acac-0x0;var _0xebed16=_0xf9e8[_0x47acac];return _0xebed16;};'use strict';var _=require(_0x8f9e('0x0'));var util=require('util');var logger=require(_0x8f9e('0x1'))(_0x8f9e('0x2'));var moment=require('moment');var BPromise=require(_0x8f9e('0x3'));var rp=require(_0x8f9e('0x4'));var fs=require('fs');var path=require(_0x8f9e('0x5'));var rimraf=require('rimraf');var config=require(_0x8f9e('0x6'));var attributes=require(_0x8f9e('0x7'));module[_0x8f9e('0x8')]=function(_0x31000f,_0x2bb450){return _0x31000f[_0x8f9e('0x9')](_0x8f9e('0xa'),attributes,{'tableName':_0x8f9e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d4e=['exports','define','UserFaxQueue','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes'];(function(_0x2323a1,_0x1f8843){var _0x877675=function(_0x5b5aea){while(--_0x5b5aea){_0x2323a1['push'](_0x2323a1['shift']());}};_0x877675(++_0x1f8843);}(_0x7d4e,0xea));var _0xe7d4=function(_0x56ecc5,_0x2dd313){_0x56ecc5=_0x56ecc5-0x0;var _0x53043a=_0x7d4e[_0x56ecc5];return _0x53043a;};'use strict';var _=require(_0xe7d4('0x0'));var util=require(_0xe7d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe7d4('0x2'));var BPromise=require('bluebird');var rp=require(_0xe7d4('0x3'));var fs=require('fs');var path=require(_0xe7d4('0x4'));var rimraf=require(_0xe7d4('0x5'));var config=require(_0xe7d4('0x6'));var attributes=require(_0xe7d4('0x7'));module[_0xe7d4('0x8')]=function(_0x4b854e,_0x655512){return _0x4b854e[_0xe7d4('0x9')](_0xe7d4('0xa'),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 3489d0f..96de61e 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 _0xf274=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c9e61,_0x2d13f5){var _0x4d55d6=function(_0x56f065){while(--_0x56f065){_0x2c9e61['push'](_0x2c9e61['shift']());}};_0x4d55d6(++_0x2d13f5);}(_0xf274,0x197));var _0x4f27=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xf274[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x4f27('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f27('0x1'));var rs=require(_0x4f27('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f27('0x3'))['db'];var utils=require(_0x4f27('0x4'));var logger=require(_0x4f27('0x5'))('rpc');var config=require(_0x4f27('0x6'));var jayson=require(_0x4f27('0x7'));var client=jayson[_0x4f27('0x8')][_0x4f27('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42f801,_0x20e176,_0x4e622e){return new BPromise(function(_0x3b2b04,_0x16d6e8){return client[_0x4f27('0xa')](_0x42f801,_0x4e622e)[_0x4f27('0xb')](function(_0x4c1ee4){logger[_0x4f27('0xc')](_0x4f27('0xd'),_0x20e176,_0x4f27('0xe'));logger[_0x4f27('0xf')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x20e176,_0x4f27('0xe'),JSON[_0x4f27('0x10')](_0x4c1ee4));if(_0x4c1ee4[_0x4f27('0x11')]){if(_0x4c1ee4[_0x4f27('0x11')]['code']===0x1f4){logger[_0x4f27('0x11')](_0x4f27('0xd'),_0x20e176,_0x4c1ee4[_0x4f27('0x11')][_0x4f27('0x12')]);return _0x16d6e8(_0x4c1ee4[_0x4f27('0x11')]['message']);}logger['error'](_0x4f27('0xd'),_0x20e176,_0x4c1ee4[_0x4f27('0x11')][_0x4f27('0x12')]);return _0x3b2b04(_0x4c1ee4[_0x4f27('0x11')][_0x4f27('0x12')]);}else{logger[_0x4f27('0xc')](_0x4f27('0xd'),_0x20e176,_0x4f27('0xe'));_0x3b2b04(_0x4c1ee4[_0x4f27('0x13')][_0x4f27('0x12')]);}})[_0x4f27('0x14')](function(_0x1a7055){logger[_0x4f27('0x11')](_0x4f27('0xd'),_0x20e176,_0x1a7055);_0x16d6e8(_0x1a7055);});});} \ No newline at end of file +var _0x0bd1=['error','message','UserFaxQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x0bd1,0x7d));var _0x10bd=function(_0x20d6f0,_0x33e54c){_0x20d6f0=_0x20d6f0-0x0;var _0x105ceb=_0x0bd1[_0x20d6f0];return _0x105ceb;};'use strict';var _=require(_0x10bd('0x0'));var util=require(_0x10bd('0x1'));var moment=require(_0x10bd('0x2'));var BPromise=require(_0x10bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x10bd('0x5'));var config=require(_0x10bd('0x6'));var jayson=require(_0x10bd('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x9af32e,_0x2a3405,_0x2ceddc){return new BPromise(function(_0x1c0978,_0x3d24b8){return client[_0x10bd('0x8')](_0x9af32e,_0x2ceddc)[_0x10bd('0x9')](function(_0x4eff5c){logger[_0x10bd('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x2a3405,_0x10bd('0xb'));logger[_0x10bd('0xc')](_0x10bd('0xd'),_0x2a3405,_0x10bd('0xb'),JSON[_0x10bd('0xe')](_0x4eff5c));if(_0x4eff5c[_0x10bd('0xf')]){if(_0x4eff5c['error']['code']===0x1f4){logger[_0x10bd('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x2a3405,_0x4eff5c['error'][_0x10bd('0x10')]);return _0x3d24b8(_0x4eff5c[_0x10bd('0xf')]['message']);}logger['error'](_0x10bd('0x11'),_0x2a3405,_0x4eff5c[_0x10bd('0xf')][_0x10bd('0x10')]);return _0x1c0978(_0x4eff5c[_0x10bd('0xf')]['message']);}else{logger['info'](_0x10bd('0x11'),_0x2a3405,'request\x20sent');_0x1c0978(_0x4eff5c[_0x10bd('0x12')]['message']);}})[_0x10bd('0x13')](function(_0xeb598){logger[_0x10bd('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x2a3405,_0xeb598);_0x3d24b8(_0xeb598);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 2d5e79a..ae21802 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3c23d5,_0x5365fc){var _0x336c68=function(_0x4a8e49){while(--_0x4a8e49){_0x3c23d5['push'](_0x3c23d5['shift']());}};_0x336c68(++_0x5365fc);}(_0xedd9,0xfc));var _0x9edd=function(_0x20cc13,_0x1b730f){_0x20cc13=_0x20cc13-0x0;var _0x5fefe9=_0xedd9[_0x20cc13];return _0x5fefe9;};'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(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'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 a4560b6..637ad5b 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 _0xe0bf=['exports'];(function(_0x11643a,_0x46c5ec){var _0x3f2ece=function(_0x3886e7){while(--_0x3886e7){_0x11643a['push'](_0x11643a['shift']());}};_0x3f2ece(++_0x46c5ec);}(_0xe0bf,0xa7));var _0xfe0b=function(_0xaa13d8,_0x23e538){_0xaa13d8=_0xaa13d8-0x0;var _0xeadef2=_0xe0bf[_0xaa13d8];return _0xeadef2;};'use strict';var Sequelize=require('sequelize');module[_0xfe0b('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9096=['sequelize','exports','INTEGER'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x9096,0x174));var _0x6909=function(_0x4f1126,_0x5d315e){_0x4f1126=_0x4f1126-0x0;var _0x42f377=_0x9096[_0x4f1126];return _0x42f377;};'use strict';var Sequelize=require(_0x6909('0x0'));module[_0x6909('0x1')]={'penalty':{'type':Sequelize[_0x6909('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 23f6a2e..cd7ccb8 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 _0x69bf=['rimraf','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69bf,0x1cc));var _0xf69b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x69bf[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf69b('0x0'));var util=require(_0xf69b('0x1'));var logger=require(_0xf69b('0x2'))(_0xf69b('0x3'));var moment=require(_0xf69b('0x4'));var BPromise=require(_0xf69b('0x5'));var rp=require(_0xf69b('0x6'));var fs=require('fs');var path=require(_0xf69b('0x7'));var rimraf=require(_0xf69b('0x8'));var config=require('../../config/environment');var attributes=require(_0xf69b('0x9'));module['exports']=function(_0xc100f1,_0x11e882){return _0xc100f1[_0xf69b('0xa')](_0xf69b('0xb'),attributes,{'tableName':_0xf69b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb669=['user_has_mail_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','UserMailQueue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb669,0x156));var _0x9b66=function(_0x42a153,_0x52ad4d){_0x42a153=_0x42a153-0x0;var _0x40cecc=_0xb669[_0x42a153];return _0x40cecc;};'use strict';var _=require(_0x9b66('0x0'));var util=require(_0x9b66('0x1'));var logger=require(_0x9b66('0x2'))(_0x9b66('0x3'));var moment=require(_0x9b66('0x4'));var BPromise=require('bluebird');var rp=require(_0x9b66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b66('0x6'));var config=require(_0x9b66('0x7'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3abcc7,_0xf399a2){return _0x3abcc7[_0x9b66('0x8')](_0x9b66('0x9'),attributes,{'tableName':_0x9b66('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 1fb6b4f..4ffe1e0 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x11cce9,_0x33b0f2){var _0x71b455=function(_0x483b4c){while(--_0x483b4c){_0x11cce9['push'](_0x11cce9['shift']());}};_0x71b455(++_0x33b0f2);}(_0xe14b,0x93));var _0xbe14=function(_0x50a280,_0x2c4cd7){_0x50a280=_0x50a280-0x0;var _0x28f21f=_0xe14b[_0x50a280];return _0x28f21f;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x2e39e8,_0xd844fd){var _0x54e2f0=function(_0x33a712){while(--_0x33a712){_0x2e39e8['push'](_0x2e39e8['shift']());}};_0x54e2f0(++_0xd844fd);}(_0x55ca,0x126));var _0xa55c=function(_0x1f6e37,_0x560390){_0x1f6e37=_0x1f6e37-0x0;var _0x3d17ad=_0x55ca[_0x1f6e37];return _0x3d17ad;};'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')]('UserMailQueue,\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')]('UserMailQueue,\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);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 1bff4f7..7dbe3fd 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 _0xf8bc=['isAuthenticated','sendUserNotification','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c072b,_0x6c4449){var _0x167ee3=function(_0x33ef93){while(--_0x33ef93){_0x2c072b['push'](_0x2c072b['shift']());}};_0x167ee3(++_0x6c4449);}(_0xf8bc,0xb7));var _0xcf8b=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xf8bc[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0xcf8b('0x0'));var util=require(_0xcf8b('0x1'));var path=require(_0xcf8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xcf8b('0x3'));var router=express[_0xcf8b('0x4')]();var fs_extra=require(_0xcf8b('0x5'));var auth=require(_0xcf8b('0x6'));var interaction=require(_0xcf8b('0x7'));var config=require(_0xcf8b('0x8'));var controller=require('./userNotification.controller');router['post']('/',auth[_0xcf8b('0x9')](),controller[_0xcf8b('0xa')]);module[_0xcf8b('0xb')]=router; \ No newline at end of file +var _0x5a14=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','Router','fs-extra'];(function(_0x3fc54b,_0x128245){var _0x2c350b=function(_0x448b52){while(--_0x448b52){_0x3fc54b['push'](_0x3fc54b['shift']());}};_0x2c350b(++_0x128245);}(_0x5a14,0xef));var _0x45a1=function(_0x1e76d0,_0x33a50c){_0x1e76d0=_0x1e76d0-0x0;var _0x5d473d=_0x5a14[_0x1e76d0];return _0x5d473d;};'use strict';var multer=require('multer');var util=require(_0x45a1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x45a1('0x1')]();var fs_extra=require(_0x45a1('0x2'));var auth=require(_0x45a1('0x3'));var interaction=require(_0x45a1('0x4'));var config=require(_0x45a1('0x5'));var controller=require(_0x45a1('0x6'));router[_0x45a1('0x7')]('/',auth[_0x45a1('0x8')](),controller[_0x45a1('0x9')]);module[_0x45a1('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 662dd5e..56792b5 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 _0x54a8=['sequelize','exports','STRING','TEXT','BOOLEAN'];(function(_0x49c653,_0x390195){var _0x31e169=function(_0x3684ac){while(--_0x3684ac){_0x49c653['push'](_0x49c653['shift']());}};_0x31e169(++_0x390195);}(_0x54a8,0xaf));var _0x854a=function(_0x1ef310,_0x3ce18a){_0x1ef310=_0x1ef310-0x0;var _0x5e966c=_0x54a8[_0x1ef310];return _0x5e966c;};'use strict';var Sequelize=require(_0x854a('0x0'));module[_0x854a('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x854a('0x2')]},'recipientsId':{'type':Sequelize[_0x854a('0x3')]},'recipientsDescription':{'type':Sequelize[_0x854a('0x2')]},'beep':{'type':Sequelize[_0x854a('0x4')]}}; \ No newline at end of file +var _0x53ac=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0xca1f0e,_0x2713d5){var _0x35e4ef=function(_0x44c40f){while(--_0x44c40f){_0xca1f0e['push'](_0xca1f0e['shift']());}};_0x35e4ef(++_0x2713d5);}(_0x53ac,0xc5));var _0xc53a=function(_0x5d91ae,_0x849bd9){_0x5d91ae=_0x5d91ae-0x0;var _0x1a5336=_0x53ac[_0x5d91ae];return _0x1a5336;};'use strict';var Sequelize=require(_0xc53a('0x0'));module[_0xc53a('0x1')]={'body':{'type':Sequelize[_0xc53a('0x2')]},'senderName':{'type':Sequelize[_0xc53a('0x3')]},'recipientsId':{'type':Sequelize[_0xc53a('0x2')]},'recipientsDescription':{'type':Sequelize[_0xc53a('0x3')]},'beep':{'type':Sequelize[_0xc53a('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index db75781..5610c4a 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 _0x1926=['jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','json','apply','reject','save','update','then','destroy','stack','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','recipients','Sequelize','ValidationError','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','join','sequelize','transaction','create','beep','forEach','recipient','emit','userNotification:send','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','catch','startCase','User','ids','queue','replace','Queue','push','flatten','getAgents','eml-format','zip-dir','moment','bluebird','mustache','util','ejs','fs-extra','lodash','crypto'];(function(_0x37b327,_0x47b877){var _0x184e2f=function(_0x5d692d){while(--_0x5d692d){_0x37b327['push'](_0x37b327['shift']());}};_0x184e2f(++_0x47b877);}(_0x1926,0x1ea));var _0x6192=function(_0x15cd94,_0xd4426b){_0x15cd94=_0x15cd94-0x0;var _0x29c7da=_0x1926[_0x15cd94];return _0x29c7da;};'use strict';var emlformat=require(_0x6192('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6192('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6192('0x2'));var BPromise=require(_0x6192('0x3'));var Mustache=require(_0x6192('0x4'));var util=require(_0x6192('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6192('0x6'));var fs=require('fs');var fs_extra=require(_0x6192('0x7'));var _=require(_0x6192('0x8'));var squel=require('squel');var crypto=require(_0x6192('0x9'));var jsforce=require(_0x6192('0xa'));var deskjs=require(_0x6192('0xb'));var toCsv=require(_0x6192('0xc'));var querystring=require('querystring');var Papa=require(_0x6192('0xd'));var Redis=require(_0x6192('0xe'));var authService=require(_0x6192('0xf'));var qs=require(_0x6192('0x10'));var as=require(_0x6192('0x11'));var hardwareService=require(_0x6192('0x12'));var logger=require('../../config/logger')(_0x6192('0x13'));var utils=require(_0x6192('0x14'));var config=require(_0x6192('0x15'));var licenseUtil=require(_0x6192('0x16'));var db=require(_0x6192('0x17'))['db'];config[_0x6192('0x18')]=_['defaults'](config[_0x6192('0x18')],{'host':_0x6192('0x19'),'port':0x18eb});var socket=require(_0x6192('0x1a'))(new Redis(config[_0x6192('0x18')]));require('./userNotification.socket')[_0x6192('0x1b')](socket);function respondWithStatusCode(_0x15f1a3,_0x296ee6){_0x296ee6=_0x296ee6||0xcc;return function(_0x39451e){if(_0x39451e){return _0x15f1a3[_0x6192('0x1c')](_0x296ee6);}return _0x15f1a3[_0x6192('0x1d')](_0x296ee6)[_0x6192('0x1e')]();};}function respondWithResult(_0x30f160,_0x511e13){_0x511e13=_0x511e13||0xc8;return function(_0x24c4cf){if(_0x24c4cf){return _0x30f160[_0x6192('0x1d')](_0x511e13)['json'](_0x24c4cf);}};}function respondWithFilteredResult(_0xa58bdd,_0x1df564){return function(_0x1dab1f){if(_0x1dab1f){var _0x5aeff0=typeof _0x1df564[_0x6192('0x1f')]===_0x6192('0x20')&&typeof _0x1df564[_0x6192('0x21')]===_0x6192('0x20');var _0x41a09f=_0x1dab1f['count'];var _0x38eeeb=_0x5aeff0?0x0:_0x1df564[_0x6192('0x1f')];var _0x240cd3=_0x5aeff0?_0x1dab1f['count']:_0x1df564[_0x6192('0x1f')]+_0x1df564['limit'];var _0x41e1bd;if(_0x240cd3>=_0x41a09f){_0x240cd3=_0x41a09f;_0x41e1bd=0xc8;}else{_0x41e1bd=0xce;}_0xa58bdd[_0x6192('0x1d')](_0x41e1bd);return _0xa58bdd['set']('Content-Range',_0x38eeeb+'-'+_0x240cd3+'/'+_0x41a09f)[_0x6192('0x22')](_0x1dab1f);}return null;};}function patchUpdates(_0x30cf65){return function(_0x31f4c8){try{jsonpatch[_0x6192('0x23')](_0x31f4c8,_0x30cf65,!![]);}catch(_0x499347){return BPromise[_0x6192('0x24')](_0x499347);}return _0x31f4c8[_0x6192('0x25')]();};}function saveUpdates(_0x5956c9,_0xfa7d15){return function(_0x5de749){if(_0x5de749){return _0x5de749[_0x6192('0x26')](_0x5956c9)[_0x6192('0x27')](function(_0x4699d5){return _0x4699d5;});}return null;};}function removeEntity(_0x531062,_0x1b7511){return function(_0x25f6ab){if(_0x25f6ab){return _0x25f6ab[_0x6192('0x28')]()['then'](function(){_0x531062[_0x6192('0x1d')](0xcc)[_0x6192('0x1e')]();});}};}function handleEntityNotFound(_0x3abdc4,_0x4efa24){return function(_0x9d9ff6){if(!_0x9d9ff6){_0x3abdc4[_0x6192('0x1c')](0x194);}return _0x9d9ff6;};}function handleError(_0x554f18,_0x53db04){_0x53db04=_0x53db04||0x1f4;return function(_0x14448d){logger['error'](_0x14448d[_0x6192('0x29')]);if(_0x14448d['name']){delete _0x14448d[_0x6192('0x2a')];}_0x554f18[_0x6192('0x1d')](_0x53db04)[_0x6192('0x2b')](_0x14448d);};}exports[_0x6192('0x2c')]=function(_0x53bbb9,_0x4338ff,_0x5defdc){if(!_0x53bbb9[_0x6192('0x2d')][_0x6192('0x2e')]('text')&&!_0x53bbb9['body']['hasOwnProperty'](_0x6192('0x2f'))){throw new db['Sequelize']['ValidationError']('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x53bbb9[_0x6192('0x2d')][_0x6192('0x2e')](_0x6192('0x2f'))&&!_0x53bbb9['body']['hasOwnProperty']('view')){throw new db['Sequelize']['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x53bbb9[_0x6192('0x2d')][_0x6192('0x2e')](_0x6192('0x30'))){throw new db[(_0x6192('0x31'))][(_0x6192('0x32'))](_0x6192('0x33'));}else{try{var _0x3aa06f=JSON[_0x6192('0x34')](_0x53bbb9[_0x6192('0x2d')][_0x6192('0x30')]);}catch(_0x171b28){logger[_0x6192('0x35')](_0x171b28);throw new db[(_0x6192('0x31'))][(_0x6192('0x32'))](_0x6192('0x36'));}var _0x9025cf=[_0x6192('0x37'),_0x6192('0x38'),_0x6192('0x39'),_0x6192('0x3a'),'smsqueue',_0x6192('0x3b'),_0x6192('0x3c'),'team',_0x6192('0x3d')];if(_[_0x6192('0x3e')](_0x3aa06f,function(_0x48f1ef){return!_[_0x6192('0x3f')](_0x9025cf,_0x48f1ef[_0x6192('0x40')][_0x6192('0x41')]());})){throw new db[(_0x6192('0x31'))][(_0x6192('0x32'))](_0x6192('0x42'));}}}var _0x5dde79={};_0x5dde79[_0x6192('0x43')]=_0x53bbb9[_0x6192('0x2d')][_0x6192('0x2e')](_0x6192('0x43'))?_0x53bbb9[_0x6192('0x2d')][_0x6192('0x43')]:_0x53bbb9[_0x6192('0x3d')][_0x6192('0x44')];_0x5dde79[_0x6192('0x45')]=_[_0x6192('0x46')](_0x53bbb9['body'][_0x6192('0x45')])?null:_0x53bbb9[_0x6192('0x2d')][_0x6192('0x45')];_0x5dde79['beep']=_0x53bbb9['body']['beep']||![];_0x5dde79[_0x6192('0x47')]=_0x53bbb9[_0x6192('0x3d')]['id'];return getContent(_0x53bbb9['body'])[_0x6192('0x27')](function(_0xcef972){_0x5dde79['body']=_0xcef972;return getRecipients(_0x3aa06f);})[_0x6192('0x27')](function(_0x496f74){_0x5dde79[_0x6192('0x48')]=_[_0x6192('0x49')](_0x496f74)[_0x6192('0x4a')](',');return db[_0x6192('0x4b')][_0x6192('0x4c')](function(_0x49cec9){return db['UserNotification'][_0x6192('0x4d')](_0x5dde79,{'raw':!![],'transaction':_0x49cec9})[_0x6192('0x27')](function(_0x3798f2){var _0x2b3f56={'sender':_0x5dde79[_0x6192('0x43')],'description':_0x5dde79[_0x6192('0x45')],'content':_0x5dde79[_0x6192('0x2d')],'beep':_0x5dde79[_0x6192('0x4e')]};_0x496f74[_0x6192('0x4f')](function(_0x324008){_0x2b3f56[_0x6192('0x50')]=_0x324008;socket[_0x6192('0x51')](_0x6192('0x52'),_0x2b3f56);});return _0x3798f2;});});})[_0x6192('0x27')](respondWithResult(_0x4338ff,0xc9))['catch'](handleError(_0x4338ff,null));};function getContent(_0x1cbd2b){return new BPromise(function(_0x4e9387,_0x3c3011){if(_0x1cbd2b[_0x6192('0x53')]){_0x4e9387(_0x1cbd2b[_0x6192('0x53')]);return;}return db[_0x6192('0x54')][_0x6192('0x55')]({'attributes':['html'],'where':{'id':_0x1cbd2b[_0x6192('0x2f')]},'raw':!![]})[_0x6192('0x27')](function(_0x1a314c){if(!_0x1a314c)throw new db['Sequelize'][(_0x6192('0x32'))](_0x6192('0x56'));var _0x1012e5=Mustache[_0x6192('0x57')](_0x1a314c[_0x6192('0x58')],_0x1cbd2b[_0x6192('0x59')]);_0x4e9387(_0x1012e5);})[_0x6192('0x5a')](function(_0x342675){_0x3c3011(_0x342675);});});}function getRecipients(_0x1e96c0){return new BPromise(function(_0x5fe439,_0x5d6f1b){var _0x494222=[];var _0x13323d=[];_0x1e96c0['forEach'](function(_0x158c86){var _0x2b0798=_[_0x6192('0x5b')](_0x158c86[_0x6192('0x40')][_0x6192('0x41')]());if(_0x2b0798===_0x6192('0x5c')){_0x494222=_['union'](_0x494222,_0x158c86[_0x6192('0x5d')]);}else{if(_[_0x6192('0x3f')](_0x2b0798,_0x6192('0x5e')))_0x2b0798=_0x2b0798[_0x6192('0x5f')]('queue',_0x6192('0x60'));_0x158c86[_0x6192('0x5d')][_0x6192('0x4f')](function(_0x1c9942){_0x13323d[_0x6192('0x61')](getAgents(_0x2b0798,_0x1c9942));});}});return BPromise['all'](_0x13323d)[_0x6192('0x27')](function(_0x50a0fa){_0x494222=_['union'](_0x494222,_[_0x6192('0x62')](_0x50a0fa));_0x5fe439(_0x494222);})[_0x6192('0x5a')](function(_0x34913e){_0x5d6f1b(_0x34913e);});});}function getAgents(_0x4a7bf3,_0x598dc3){return new BPromise(function(_0x19b49e,_0x1b04ee){return db[_0x4a7bf3][_0x6192('0x55')]({'where':{'id':_0x598dc3}})[_0x6192('0x27')](function(_0x445b20){return _0x445b20[_0x6192('0x63')]({'attributes':['id'],'raw':!![]})[_0x6192('0x27')](function(_0x72c553){var _0x4c1b3f=_['map'](_0x72c553,'id');_0x19b49e(_0x4c1b3f);});})['catch'](function(_0x4f2dd4){_0x1b04ee(_0x4f2dd4);});});} \ No newline at end of file +var _0x4387=['to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sequelize','UserNotification','emit','catch','html','Invalid\x20\x27TemplateId\x27\x20parameter','forEach','startCase','toLowerCase','User','union','ids','queue','replace','Queue','push','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2a61de,_0x2df265){var _0x17ef27=function(_0x2337f8){while(--_0x2337f8){_0x2a61de['push'](_0x2a61de['shift']());}};_0x17ef27(++_0x2df265);}(_0x4387,0x171));var _0x7438=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4387[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7438('0x0'));var rimraf=require(_0x7438('0x1'));var zipdir=require(_0x7438('0x2'));var jsonpatch=require(_0x7438('0x3'));var rp=require('request-promise');var moment=require(_0x7438('0x4'));var BPromise=require(_0x7438('0x5'));var Mustache=require(_0x7438('0x6'));var util=require(_0x7438('0x7'));var path=require('path');var sox=require(_0x7438('0x8'));var csv=require('to-csv');var ejs=require(_0x7438('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7438('0xa'));var squel=require(_0x7438('0xb'));var crypto=require(_0x7438('0xc'));var jsforce=require(_0x7438('0xd'));var deskjs=require(_0x7438('0xe'));var toCsv=require(_0x7438('0xf'));var querystring=require('querystring');var Papa=require(_0x7438('0x10'));var Redis=require('ioredis');var authService=require(_0x7438('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7438('0x12'));var hardwareService=require(_0x7438('0x13'));var logger=require(_0x7438('0x14'))(_0x7438('0x15'));var utils=require('../../config/utils');var config=require(_0x7438('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7438('0x17'))['db'];config[_0x7438('0x18')]=_[_0x7438('0x19')](config[_0x7438('0x18')],{'host':_0x7438('0x1a'),'port':0x18eb});var socket=require(_0x7438('0x1b'))(new Redis(config[_0x7438('0x18')]));require(_0x7438('0x1c'))[_0x7438('0x1d')](socket);function respondWithStatusCode(_0x53b700,_0x517ecb){_0x517ecb=_0x517ecb||0xcc;return function(_0x58f0d4){if(_0x58f0d4){return _0x53b700[_0x7438('0x1e')](_0x517ecb);}return _0x53b700[_0x7438('0x1f')](_0x517ecb)[_0x7438('0x20')]();};}function respondWithResult(_0x5b58a3,_0x35a093){_0x35a093=_0x35a093||0xc8;return function(_0x66692){if(_0x66692){return _0x5b58a3[_0x7438('0x1f')](_0x35a093)[_0x7438('0x21')](_0x66692);}};}function respondWithFilteredResult(_0x1fb146,_0x4b4e3a){return function(_0xf98015){if(_0xf98015){var _0x491bcb=typeof _0x4b4e3a[_0x7438('0x22')]===_0x7438('0x23')&&typeof _0x4b4e3a[_0x7438('0x24')]==='undefined';var _0x3bd5fa=_0xf98015[_0x7438('0x25')];var _0x18aa9f=_0x491bcb?0x0:_0x4b4e3a[_0x7438('0x22')];var _0x53cee2=_0x491bcb?_0xf98015['count']:_0x4b4e3a[_0x7438('0x22')]+_0x4b4e3a[_0x7438('0x24')];var _0x534407;if(_0x53cee2>=_0x3bd5fa){_0x53cee2=_0x3bd5fa;_0x534407=0xc8;}else{_0x534407=0xce;}_0x1fb146[_0x7438('0x1f')](_0x534407);return _0x1fb146['set']('Content-Range',_0x18aa9f+'-'+_0x53cee2+'/'+_0x3bd5fa)[_0x7438('0x21')](_0xf98015);}return null;};}function patchUpdates(_0x22b72d){return function(_0x1b7fff){try{jsonpatch[_0x7438('0x26')](_0x1b7fff,_0x22b72d,!![]);}catch(_0x22d48f){return BPromise[_0x7438('0x27')](_0x22d48f);}return _0x1b7fff[_0x7438('0x28')]();};}function saveUpdates(_0x439d5f,_0x5357c2){return function(_0x349191){if(_0x349191){return _0x349191[_0x7438('0x29')](_0x439d5f)[_0x7438('0x2a')](function(_0x3f2f7a){return _0x3f2f7a;});}return null;};}function removeEntity(_0x54c01b,_0x207767){return function(_0x38c554){if(_0x38c554){return _0x38c554[_0x7438('0x2b')]()['then'](function(){_0x54c01b['status'](0xcc)[_0x7438('0x20')]();});}};}function handleEntityNotFound(_0x2fb692,_0x503ad6){return function(_0x29345a){if(!_0x29345a){_0x2fb692[_0x7438('0x1e')](0x194);}return _0x29345a;};}function handleError(_0x3af1f6,_0xcc57b2){_0xcc57b2=_0xcc57b2||0x1f4;return function(_0x111628){logger[_0x7438('0x2c')](_0x111628['stack']);if(_0x111628[_0x7438('0x2d')]){delete _0x111628[_0x7438('0x2d')];}_0x3af1f6['status'](_0xcc57b2)[_0x7438('0x2e')](_0x111628);};}exports[_0x7438('0x2f')]=function(_0xb5aadd,_0x5edf56,_0x2b2898){if(!_0xb5aadd[_0x7438('0x30')][_0x7438('0x31')](_0x7438('0x32'))&&!_0xb5aadd['body'][_0x7438('0x31')](_0x7438('0x33'))){throw new db[(_0x7438('0x34'))][(_0x7438('0x35'))](_0x7438('0x36'));}else{if(_0xb5aadd[_0x7438('0x30')][_0x7438('0x31')](_0x7438('0x33'))&&!_0xb5aadd[_0x7438('0x30')][_0x7438('0x31')](_0x7438('0x37'))){throw new db['Sequelize']['ValidationError'](_0x7438('0x38'));}if(!_0xb5aadd[_0x7438('0x30')][_0x7438('0x31')](_0x7438('0x39'))){throw new db[(_0x7438('0x34'))][(_0x7438('0x35'))](_0x7438('0x3a'));}else{try{var _0x26f0f9=JSON[_0x7438('0x3b')](_0xb5aadd[_0x7438('0x30')]['recipients']);}catch(_0x1a2d92){logger['error'](_0x1a2d92);throw new db[(_0x7438('0x34'))][(_0x7438('0x35'))](_0x7438('0x3c'));}var _0x2d4f9b=[_0x7438('0x3d'),_0x7438('0x3e'),_0x7438('0x3f'),_0x7438('0x40'),_0x7438('0x41'),_0x7438('0x42'),_0x7438('0x43'),_0x7438('0x44'),_0x7438('0x45')];if(_['some'](_0x26f0f9,function(_0x20d8dd){return!_[_0x7438('0x46')](_0x2d4f9b,_0x20d8dd['model']['toLowerCase']());})){throw new db['Sequelize'][(_0x7438('0x35'))](_0x7438('0x47'));}}}var _0x4873f0={};_0x4873f0[_0x7438('0x48')]=_0xb5aadd['body']['hasOwnProperty'](_0x7438('0x48'))?_0xb5aadd[_0x7438('0x30')]['senderName']:_0xb5aadd['user'][_0x7438('0x49')];_0x4873f0[_0x7438('0x4a')]=_[_0x7438('0x4b')](_0xb5aadd[_0x7438('0x30')][_0x7438('0x4a')])?null:_0xb5aadd[_0x7438('0x30')]['recipientsDescription'];_0x4873f0[_0x7438('0x4c')]=_0xb5aadd[_0x7438('0x30')][_0x7438('0x4c')]||![];_0x4873f0['SenderId']=_0xb5aadd['user']['id'];return getContent(_0xb5aadd[_0x7438('0x30')])[_0x7438('0x2a')](function(_0x131b6f){_0x4873f0[_0x7438('0x30')]=_0x131b6f;return getRecipients(_0x26f0f9);})[_0x7438('0x2a')](function(_0x3ab5ba){_0x4873f0[_0x7438('0x4d')]=_['sortBy'](_0x3ab5ba)['join'](',');return db[_0x7438('0x4e')]['transaction'](function(_0x46cf39){return db[_0x7438('0x4f')]['create'](_0x4873f0,{'raw':!![],'transaction':_0x46cf39})[_0x7438('0x2a')](function(_0x345d37){var _0x34f146={'sender':_0x4873f0[_0x7438('0x48')],'description':_0x4873f0['recipientsDescription'],'content':_0x4873f0[_0x7438('0x30')],'beep':_0x4873f0[_0x7438('0x4c')]};_0x3ab5ba['forEach'](function(_0x22df5e){_0x34f146['recipient']=_0x22df5e;socket[_0x7438('0x50')]('userNotification:send',_0x34f146);});return _0x345d37;});});})[_0x7438('0x2a')](respondWithResult(_0x5edf56,0xc9))[_0x7438('0x51')](handleError(_0x5edf56,null));};function getContent(_0x8734b1){return new BPromise(function(_0x555e48,_0x2a5e5f){if(_0x8734b1[_0x7438('0x32')]){_0x555e48(_0x8734b1[_0x7438('0x32')]);return;}return db['Template']['findOne']({'attributes':[_0x7438('0x52')],'where':{'id':_0x8734b1[_0x7438('0x33')]},'raw':!![]})[_0x7438('0x2a')](function(_0xa9e42b){if(!_0xa9e42b)throw new db[(_0x7438('0x34'))]['ValidationError'](_0x7438('0x53'));var _0x278ab5=Mustache['render'](_0xa9e42b['html'],_0x8734b1[_0x7438('0x37')]);_0x555e48(_0x278ab5);})[_0x7438('0x51')](function(_0x30cde2){_0x2a5e5f(_0x30cde2);});});}function getRecipients(_0x37c527){return new BPromise(function(_0x1a1d9a,_0x4374aa){var _0x1a32fc=[];var _0x23bfbf=[];_0x37c527[_0x7438('0x54')](function(_0x102b88){var _0x3a7bc5=_[_0x7438('0x55')](_0x102b88['model'][_0x7438('0x56')]());if(_0x3a7bc5===_0x7438('0x57')){_0x1a32fc=_[_0x7438('0x58')](_0x1a32fc,_0x102b88[_0x7438('0x59')]);}else{if(_['includes'](_0x3a7bc5,_0x7438('0x5a')))_0x3a7bc5=_0x3a7bc5[_0x7438('0x5b')]('queue',_0x7438('0x5c'));_0x102b88[_0x7438('0x59')][_0x7438('0x54')](function(_0x22120){_0x23bfbf[_0x7438('0x5d')](getAgents(_0x3a7bc5,_0x22120));});}});return BPromise['all'](_0x23bfbf)[_0x7438('0x2a')](function(_0x2b7477){_0x1a32fc=_[_0x7438('0x58')](_0x1a32fc,_['flatten'](_0x2b7477));_0x1a1d9a(_0x1a32fc);})[_0x7438('0x51')](function(_0x66be14){_0x4374aa(_0x66be14);});});}function getAgents(_0x29b7cc,_0xa222da){return new BPromise(function(_0x1e5146,_0x406656){return db[_0x29b7cc][_0x7438('0x5e')]({'where':{'id':_0xa222da}})[_0x7438('0x2a')](function(_0x2db15b){return _0x2db15b['getAgents']({'attributes':['id'],'raw':!![]})['then'](function(_0x3b8415){var _0x558c86=_[_0x7438('0x5f')](_0x3b8415,'id');_0x1e5146(_0x558c86);});})[_0x7438('0x51')](function(_0x9ee253){_0x406656(_0x9ee253);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 37b380b..50d423d 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 _0x5c0e=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0x5c0e,0x1ae));var _0xe5c0=function(_0x17b0d4,_0x377add){_0x17b0d4=_0x17b0d4-0x0;var _0x2d02c7=_0x5c0e[_0x17b0d4];return _0x2d02c7;};'use strict';var EventEmitter=require(_0xe5c0('0x0'));var UserNotification=require(_0xe5c0('0x1'))['db'][_0xe5c0('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xe5c0('0x3')](0x0);var events={'afterCreate':_0xe5c0('0x4'),'afterUpdate':_0xe5c0('0x5'),'afterDestroy':_0xe5c0('0x6')};function emitEvent(_0x3a89b3){return function(_0x18808f,_0x5e8139,_0x51e56a){UserNotificationEvents[_0xe5c0('0x7')](_0x3a89b3+':'+_0x18808f['id'],_0x18808f);UserNotificationEvents[_0xe5c0('0x7')](_0x3a89b3,_0x18808f);_0x51e56a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xe5c0('0x8')](e,emitEvent(event));}}module[_0xe5c0('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x7b6b=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove','emit'];(function(_0x533c2d,_0x45651c){var _0x4361fb=function(_0x345710){while(--_0x345710){_0x533c2d['push'](_0x533c2d['shift']());}};_0x4361fb(++_0x45651c);}(_0x7b6b,0x1e0));var _0xb7b6=function(_0x1cc23e,_0x3a0232){_0x1cc23e=_0x1cc23e-0x0;var _0x322aa7=_0x7b6b[_0x1cc23e];return _0x322aa7;};'use strict';var EventEmitter=require(_0xb7b6('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb7b6('0x1')](0x0);var events={'afterCreate':_0xb7b6('0x2'),'afterUpdate':_0xb7b6('0x3'),'afterDestroy':_0xb7b6('0x4')};function emitEvent(_0xb19576){return function(_0x5504f4,_0x38bb7a,_0x306d09){UserNotificationEvents[_0xb7b6('0x5')](_0xb19576+':'+_0x5504f4['id'],_0x5504f4);UserNotificationEvents[_0xb7b6('0x5')](_0xb19576,_0x5504f4);_0x306d09(null);};}for(var e in events){if(events[_0xb7b6('0x6')](e)){var event=events[e];UserNotification[_0xb7b6('0x7')](e,emitEvent(event));}}module[_0xb7b6('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 0c2e32e..a4c53c2 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 _0xd08a=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','../../config/environment','./userNotification.attributes','exports','define','userNotifications'];(function(_0x9b4cda,_0x206ec1){var _0x1ac6c5=function(_0x4ba0a3){while(--_0x4ba0a3){_0x9b4cda['push'](_0x9b4cda['shift']());}};_0x1ac6c5(++_0x206ec1);}(_0xd08a,0x91));var _0xad08=function(_0x40adc2,_0x3ae72e){_0x40adc2=_0x40adc2-0x0;var _0xc19b2e=_0xd08a[_0x40adc2];return _0xc19b2e;};'use strict';var _=require(_0xad08('0x0'));var util=require(_0xad08('0x1'));var logger=require('../../config/logger')(_0xad08('0x2'));var moment=require('moment');var BPromise=require(_0xad08('0x3'));var rp=require(_0xad08('0x4'));var fs=require('fs');var path=require(_0xad08('0x5'));var rimraf=require('rimraf');var config=require(_0xad08('0x6'));var attributes=require(_0xad08('0x7'));module[_0xad08('0x8')]=function(_0xecc155,_0x1c9e7b){return _0xecc155[_0xad08('0x9')]('UserNotification',attributes,{'tableName':_0xad08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xad08('0xb')});}; \ No newline at end of file +var _0x17b6=['path','rimraf','./userNotification.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise'];(function(_0x4f34d8,_0x40f022){var _0xc97536=function(_0xef9dfc){while(--_0xef9dfc){_0x4f34d8['push'](_0x4f34d8['shift']());}};_0xc97536(++_0x40f022);}(_0x17b6,0xf7));var _0x617b=function(_0x42a94b,_0x416eac){_0x42a94b=_0x42a94b-0x0;var _0x5ab9e5=_0x17b6[_0x42a94b];return _0x5ab9e5;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x617b('0x2'));var fs=require('fs');var path=require(_0x617b('0x3'));var rimraf=require(_0x617b('0x4'));var config=require('../../config/environment');var attributes=require(_0x617b('0x5'));module[_0x617b('0x6')]=function(_0x4a4940,_0x3088f3){return _0x4a4940[_0x617b('0x7')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x617b('0x8'),'collate':_0x617b('0x9')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 9237ee0..1a43c16 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 _0xb4dd=['UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./userNotification.socket','register','request','then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0xb4dd,0x154));var _0xdb4d=function(_0x425d3d,_0x329b86){_0x425d3d=_0x425d3d-0x0;var _0x50fd88=_0xb4dd[_0x425d3d];return _0x50fd88;};'use strict';var _=require(_0xdb4d('0x0'));var util=require(_0xdb4d('0x1'));var moment=require(_0xdb4d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb4d('0x3'))['db'];var utils=require(_0xdb4d('0x4'));var logger=require(_0xdb4d('0x5'))(_0xdb4d('0x6'));var config=require(_0xdb4d('0x7'));var jayson=require(_0xdb4d('0x8'));var client=jayson[_0xdb4d('0x9')]['http']({'port':0x232a});config[_0xdb4d('0xa')]=_[_0xdb4d('0xb')](config[_0xdb4d('0xa')],{'host':_0xdb4d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdb4d('0xd'))[_0xdb4d('0xe')](socket);function respondWithRpcPromise(_0x591467,_0x8acfe6,_0x12cd76){return new BPromise(function(_0x1a830a,_0x4adc06){return client[_0xdb4d('0xf')](_0x591467,_0x12cd76)[_0xdb4d('0x10')](function(_0x4061b4){logger[_0xdb4d('0x11')]('UserNotification,\x20%s,\x20%s',_0x8acfe6,'request\x20sent');logger[_0xdb4d('0x12')](_0xdb4d('0x13'),_0x8acfe6,_0xdb4d('0x14'),JSON[_0xdb4d('0x15')](_0x4061b4));if(_0x4061b4[_0xdb4d('0x16')]){if(_0x4061b4[_0xdb4d('0x16')][_0xdb4d('0x17')]===0x1f4){logger[_0xdb4d('0x16')](_0xdb4d('0x18'),_0x8acfe6,_0x4061b4[_0xdb4d('0x16')][_0xdb4d('0x19')]);return _0x4adc06(_0x4061b4['error'][_0xdb4d('0x19')]);}logger[_0xdb4d('0x16')](_0xdb4d('0x18'),_0x8acfe6,_0x4061b4[_0xdb4d('0x16')][_0xdb4d('0x19')]);return _0x1a830a(_0x4061b4[_0xdb4d('0x16')][_0xdb4d('0x19')]);}else{logger[_0xdb4d('0x11')]('UserNotification,\x20%s,\x20%s',_0x8acfe6,_0xdb4d('0x14'));_0x1a830a(_0x4061b4[_0xdb4d('0x1a')]['message']);}})[_0xdb4d('0x1b')](function(_0x3e6162){logger[_0xdb4d('0x16')](_0xdb4d('0x18'),_0x8acfe6,_0x3e6162);_0x4adc06(_0x3e6162);});});} \ No newline at end of file +var _0x95fc=['register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./userNotification.socket'];(function(_0x1b6b99,_0x638d06){var _0x5485bd=function(_0x4f00c2){while(--_0x4f00c2){_0x1b6b99['push'](_0x1b6b99['shift']());}};_0x5485bd(++_0x638d06);}(_0x95fc,0xf5));var _0xc95f=function(_0x2ad70f,_0x22c3e0){_0x2ad70f=_0x2ad70f-0x0;var _0x584c59=_0x95fc[_0x2ad70f];return _0x584c59;};'use strict';var _=require('lodash');var util=require(_0xc95f('0x0'));var moment=require(_0xc95f('0x1'));var BPromise=require(_0xc95f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc95f('0x3'));var db=require(_0xc95f('0x4'))['db'];var utils=require(_0xc95f('0x5'));var logger=require(_0xc95f('0x6'))(_0xc95f('0x7'));var config=require(_0xc95f('0x8'));var jayson=require(_0xc95f('0x9'));var client=jayson[_0xc95f('0xa')][_0xc95f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc95f('0xc')],{'host':_0xc95f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc95f('0xe'))[_0xc95f('0xf')](socket);function respondWithRpcPromise(_0x337527,_0x25dfe2,_0x3cb4c0){return new BPromise(function(_0x15fb4a,_0xc4f5c3){return client['request'](_0x337527,_0x3cb4c0)[_0xc95f('0x10')](function(_0x5d84d1){logger[_0xc95f('0x11')](_0xc95f('0x12'),_0x25dfe2,_0xc95f('0x13'));logger[_0xc95f('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x25dfe2,_0xc95f('0x13'),JSON[_0xc95f('0x15')](_0x5d84d1));if(_0x5d84d1['error']){if(_0x5d84d1[_0xc95f('0x16')][_0xc95f('0x17')]===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x25dfe2,_0x5d84d1[_0xc95f('0x16')][_0xc95f('0x18')]);return _0xc4f5c3(_0x5d84d1[_0xc95f('0x16')][_0xc95f('0x18')]);}logger['error'](_0xc95f('0x12'),_0x25dfe2,_0x5d84d1[_0xc95f('0x16')]['message']);return _0x15fb4a(_0x5d84d1[_0xc95f('0x16')][_0xc95f('0x18')]);}else{logger[_0xc95f('0x11')](_0xc95f('0x12'),_0x25dfe2,_0xc95f('0x13'));_0x15fb4a(_0x5d84d1[_0xc95f('0x19')]['message']);}})['catch'](function(_0x51cce8){logger[_0xc95f('0x16')](_0xc95f('0x12'),_0x25dfe2,_0x51cce8);_0xc4f5c3(_0x51cce8);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index bb10afb..e06a402 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 _0x06cd=['update','emit','removeListener','register','userNotification:','./userNotification.events','save'];(function(_0x1ad74c,_0x459f26){var _0x566148=function(_0x2efdd1){while(--_0x2efdd1){_0x1ad74c['push'](_0x1ad74c['shift']());}};_0x566148(++_0x459f26);}(_0x06cd,0xc2));var _0xd06c=function(_0x35d137,_0x4bb69d){_0x35d137=_0x35d137-0x0;var _0x217567=_0x06cd[_0x35d137];return _0x217567;};'use strict';var UserNotificationEvents=require(_0xd06c('0x0'));var events=[_0xd06c('0x1'),'remove',_0xd06c('0x2')];function createListener(_0x505f30,_0x41e046){return function(_0xa4e1be){_0x41e046[_0xd06c('0x3')](_0x505f30,_0xa4e1be);};}function removeListener(_0x246fa6,_0x760b7e){return function(){UserNotificationEvents[_0xd06c('0x4')](_0x246fa6,_0x760b7e);};}exports[_0xd06c('0x5')]=function(_0x202403){for(var _0x1c8fa0=0x0,_0x243c6b=events['length'];_0x1c8fa0<_0x243c6b;_0x1c8fa0++){var _0x156471=events[_0x1c8fa0];var _0x41cc9c=createListener(_0xd06c('0x6')+_0x156471,_0x202403);UserNotificationEvents['on'](_0x156471,_0x41cc9c);}}; \ No newline at end of file +var _0x2b0b=['save','remove','update','emit','removeListener','length','userNotification:'];(function(_0x3ada42,_0x448411){var _0xc73505=function(_0x13fab3){while(--_0x13fab3){_0x3ada42['push'](_0x3ada42['shift']());}};_0xc73505(++_0x448411);}(_0x2b0b,0x85));var _0xb2b0=function(_0x5a1d0b,_0x12887e){_0x5a1d0b=_0x5a1d0b-0x0;var _0x3bd68f=_0x2b0b[_0x5a1d0b];return _0x3bd68f;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xb2b0('0x0'),_0xb2b0('0x1'),_0xb2b0('0x2')];function createListener(_0x230362,_0x13d83b){return function(_0x282e97){_0x13d83b[_0xb2b0('0x3')](_0x230362,_0x282e97);};}function removeListener(_0x12d1c0,_0x5dce9a){return function(){UserNotificationEvents[_0xb2b0('0x4')](_0x12d1c0,_0x5dce9a);};}exports['register']=function(_0x4f76d5){for(var _0x4514f9=0x0,_0x2fa528=events[_0xb2b0('0x5')];_0x4514f9<_0x2fa528;_0x4514f9++){var _0x2e7321=events[_0x4514f9];var _0x4e5f90=createListener(_0xb2b0('0x6')+_0x2e7321,_0x4f76d5);UserNotificationEvents['on'](_0x2e7321,_0x4e5f90);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e6681f1..db72ee4 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1160c3,_0x36e66c){var _0x164dd6=function(_0x4a13c7){while(--_0x4a13c7){_0x1160c3['push'](_0x1160c3['shift']());}};_0x164dd6(++_0x36e66c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0xcb91[_0x272638];return _0x19d027;};'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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x84054a,_0x2df2a2){var _0x374e61=function(_0x139a0c){while(--_0x139a0c){_0x84054a['push'](_0x84054a['shift']());}};_0x374e61(++_0x2df2a2);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index ef47f3c..115d650 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 _0xc11a=['INTEGER','sequelize','exports'];(function(_0xa8f24a,_0x48d7d3){var _0x3a1471=function(_0x281470){while(--_0x281470){_0xa8f24a['push'](_0xa8f24a['shift']());}};_0x3a1471(++_0x48d7d3);}(_0xc11a,0x1d5));var _0xac11=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc11a[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0xac11('0x0'));module[_0xac11('0x1')]={'penalty':{'type':Sequelize[_0xac11('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d3e=['sequelize','exports','INTEGER'];(function(_0x57f52f,_0x8c94d3){var _0x1b1d09=function(_0x4ec090){while(--_0x4ec090){_0x57f52f['push'](_0x57f52f['shift']());}};_0x1b1d09(++_0x8c94d3);}(_0x6d3e,0x186));var _0xe6d3=function(_0x3102d1,_0x2b731a){_0x3102d1=_0x3102d1-0x0;var _0x149a50=_0x6d3e[_0x3102d1];return _0x149a50;};'use strict';var Sequelize=require(_0xe6d3('0x0'));module[_0xe6d3('0x1')]={'penalty':{'type':Sequelize[_0xe6d3('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 6d583e4..9f776d9 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 _0x3e6f=['UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','bluebird','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0xbb50a9,_0x54ef96){var _0x20bbd8=function(_0x5bdfac){while(--_0x5bdfac){_0xbb50a9['push'](_0xbb50a9['shift']());}};_0x20bbd8(++_0x54ef96);}(_0x3e6f,0x18a));var _0xf3e6=function(_0x30ef0a,_0x36777c){_0x30ef0a=_0x30ef0a-0x0;var _0x268e13=_0x3e6f[_0x30ef0a];return _0x268e13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf3e6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xf3e6('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf3e6('0x2'));var config=require(_0xf3e6('0x3'));var attributes=require(_0xf3e6('0x4'));module['exports']=function(_0x1a0fcf,_0x370e69){return _0x1a0fcf[_0xf3e6('0x5')](_0xf3e6('0x6'),attributes,{'tableName':_0xf3e6('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1da6=['user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserOpenchannelQueue'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x1da6,0x83));var _0x61da=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x1da6[_0x438912];return _0x18112f;};'use strict';var _=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var logger=require(_0x61da('0x2'))('api');var moment=require(_0x61da('0x3'));var BPromise=require(_0x61da('0x4'));var rp=require(_0x61da('0x5'));var fs=require('fs');var path=require(_0x61da('0x6'));var rimraf=require(_0x61da('0x7'));var config=require(_0x61da('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x61da('0x9')]=function(_0x2287a8,_0x58d66f){return _0x2287a8[_0x61da('0xa')](_0x61da('0xb'),attributes,{'tableName':_0x61da('0xc'),'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 2b5e13f..ec88b11 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 _0x7b53=['randomstring','../../mysqldb','../../config/environment','jayson/promise','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird'];(function(_0x32e6d8,_0x16f12b){var _0x43c98d=function(_0xfbced){while(--_0xfbced){_0x32e6d8['push'](_0x32e6d8['shift']());}};_0x43c98d(++_0x16f12b);}(_0x7b53,0x1eb));var _0x37b5=function(_0x2369a5,_0x483c00){_0x2369a5=_0x2369a5-0x0;var _0x55ee7a=_0x7b53[_0x2369a5];return _0x55ee7a;};'use strict';var _=require('lodash');var util=require(_0x37b5('0x0'));var moment=require(_0x37b5('0x1'));var BPromise=require(_0x37b5('0x2'));var rs=require(_0x37b5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37b5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x37b5('0x5'));var jayson=require(_0x37b5('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3167f4,_0x270ae4,_0x536e50){return new BPromise(function(_0x48411a,_0x155497){return client[_0x37b5('0x7')](_0x3167f4,_0x536e50)[_0x37b5('0x8')](function(_0x194016){logger['info'](_0x37b5('0x9'),_0x270ae4,_0x37b5('0xa'));logger[_0x37b5('0xb')](_0x37b5('0xc'),_0x270ae4,_0x37b5('0xa'),JSON[_0x37b5('0xd')](_0x194016));if(_0x194016[_0x37b5('0xe')]){if(_0x194016[_0x37b5('0xe')][_0x37b5('0xf')]===0x1f4){logger[_0x37b5('0xe')](_0x37b5('0x9'),_0x270ae4,_0x194016[_0x37b5('0xe')][_0x37b5('0x10')]);return _0x155497(_0x194016[_0x37b5('0xe')][_0x37b5('0x10')]);}logger[_0x37b5('0xe')](_0x37b5('0x9'),_0x270ae4,_0x194016[_0x37b5('0xe')][_0x37b5('0x10')]);return _0x48411a(_0x194016[_0x37b5('0xe')][_0x37b5('0x10')]);}else{logger[_0x37b5('0x11')](_0x37b5('0x9'),_0x270ae4,'request\x20sent');_0x48411a(_0x194016['result'][_0x37b5('0x10')]);}})[_0x37b5('0x12')](function(_0x306b0e){logger['error'](_0x37b5('0x9'),_0x270ae4,_0x306b0e);_0x155497(_0x306b0e);});});} \ No newline at end of file +var _0x91c1=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x278905,_0x1c0bc2){var _0x126c80=function(_0x5d0dda){while(--_0x5d0dda){_0x278905['push'](_0x278905['shift']());}};_0x126c80(++_0x1c0bc2);}(_0x91c1,0x14c));var _0x191c=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0x91c1[_0x5ad07c];return _0x204bae;};'use strict';var _=require(_0x191c('0x0'));var util=require(_0x191c('0x1'));var moment=require(_0x191c('0x2'));var BPromise=require(_0x191c('0x3'));var rs=require(_0x191c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x191c('0x5'))['db'];var utils=require(_0x191c('0x6'));var logger=require(_0x191c('0x7'))(_0x191c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x191c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e84a1,_0x107805,_0x237310){return new BPromise(function(_0xde8b4a,_0x5d8456){return client['request'](_0x3e84a1,_0x237310)[_0x191c('0xa')](function(_0x20a0e3){logger[_0x191c('0xb')](_0x191c('0xc'),_0x107805,_0x191c('0xd'));logger[_0x191c('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x107805,_0x191c('0xd'),JSON[_0x191c('0xf')](_0x20a0e3));if(_0x20a0e3['error']){if(_0x20a0e3[_0x191c('0x10')][_0x191c('0x11')]===0x1f4){logger[_0x191c('0x10')](_0x191c('0xc'),_0x107805,_0x20a0e3[_0x191c('0x10')][_0x191c('0x12')]);return _0x5d8456(_0x20a0e3[_0x191c('0x10')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x107805,_0x20a0e3[_0x191c('0x10')]['message']);return _0xde8b4a(_0x20a0e3[_0x191c('0x10')][_0x191c('0x12')]);}else{logger['info'](_0x191c('0xc'),_0x107805,'request\x20sent');_0xde8b4a(_0x20a0e3[_0x191c('0x13')][_0x191c('0x12')]);}})[_0x191c('0x14')](function(_0x3c8025){logger[_0x191c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x107805,_0x3c8025);_0x5d8456(_0x3c8025);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 8be63ed..48fe2d1 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 _0x2131=['update','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfile.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/sections','getSections','/:id/resources','getResources','post','create','addSections','put'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x2131,0xee));var _0x1213=function(_0x4247e5,_0x30b7bb){_0x4247e5=_0x4247e5-0x0;var _0x5ee3d5=_0x2131[_0x4247e5];return _0x5ee3d5;};'use strict';var multer=require(_0x1213('0x0'));var util=require(_0x1213('0x1'));var path=require('path');var timeout=require(_0x1213('0x2'));var express=require(_0x1213('0x3'));var router=express[_0x1213('0x4')]();var fs_extra=require(_0x1213('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1213('0x6'));var config=require('../../config/environment');var controller=require(_0x1213('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1213('0x8')]);router[_0x1213('0x9')](_0x1213('0xa'),auth['isAuthenticated'](),controller[_0x1213('0xb')]);router[_0x1213('0x9')](_0x1213('0xc'),auth[_0x1213('0xd')](),controller[_0x1213('0xe')]);router[_0x1213('0x9')](_0x1213('0xf'),auth[_0x1213('0xd')](),controller[_0x1213('0x10')]);router[_0x1213('0x9')](_0x1213('0x11'),auth[_0x1213('0xd')](),controller[_0x1213('0x12')]);router[_0x1213('0x13')]('/',auth['isAuthenticated'](),controller[_0x1213('0x14')]);router[_0x1213('0x13')]('/:id/clone',auth[_0x1213('0xd')](),controller['clone']);router[_0x1213('0x13')](_0x1213('0xf'),auth[_0x1213('0xd')](),controller[_0x1213('0x15')]);router[_0x1213('0x13')](_0x1213('0x11'),auth[_0x1213('0xd')](),controller['addResources']);router[_0x1213('0x16')](_0x1213('0xc'),auth[_0x1213('0xd')](),controller[_0x1213('0x17')]);router[_0x1213('0x18')]('/:id',auth[_0x1213('0xd')](),controller[_0x1213('0x19')]);router[_0x1213('0x18')](_0x1213('0xf'),auth['isAuthenticated'](),controller[_0x1213('0x1a')]);router['delete']('/:id/resources',auth[_0x1213('0xd')](),controller[_0x1213('0x1b')]);module[_0x1213('0x1c')]=router; \ No newline at end of file +var _0xd1fd=['./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','update','delete','destroy','removeSections','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1f75d4,_0x183581){var _0x72f2ca=function(_0x5aafee){while(--_0x5aafee){_0x1f75d4['push'](_0x1f75d4['shift']());}};_0x72f2ca(++_0x183581);}(_0xd1fd,0x1e0));var _0xdd1f=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0xd1fd[_0x2f16e5];return _0x5d082a;};'use strict';var multer=require(_0xdd1f('0x0'));var util=require(_0xdd1f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdd1f('0x2'));var router=express['Router']();var fs_extra=require(_0xdd1f('0x3'));var auth=require(_0xdd1f('0x4'));var interaction=require(_0xdd1f('0x5'));var config=require('../../config/environment');var controller=require(_0xdd1f('0x6'));router[_0xdd1f('0x7')]('/',auth[_0xdd1f('0x8')](),controller[_0xdd1f('0x9')]);router[_0xdd1f('0x7')](_0xdd1f('0xa'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0xb')]);router[_0xdd1f('0x7')](_0xdd1f('0xc'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0xd')]);router[_0xdd1f('0x7')](_0xdd1f('0xe'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0xf')]);router[_0xdd1f('0x7')](_0xdd1f('0x10'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0x11')]);router[_0xdd1f('0x12')]('/',auth[_0xdd1f('0x8')](),controller[_0xdd1f('0x13')]);router['post'](_0xdd1f('0x14'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0x15')]);router['post'](_0xdd1f('0xe'),auth['isAuthenticated'](),controller['addSections']);router[_0xdd1f('0x12')](_0xdd1f('0x10'),auth['isAuthenticated'](),controller['addResources']);router['put'](_0xdd1f('0xc'),auth[_0xdd1f('0x8')](),controller[_0xdd1f('0x16')]);router[_0xdd1f('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xdd1f('0x18')]);router['delete'](_0xdd1f('0xe'),auth['isAuthenticated'](),controller[_0xdd1f('0x19')]);router[_0xdd1f('0x17')](_0xdd1f('0x10'),auth[_0xdd1f('0x8')](),controller['removeResources']);module[_0xdd1f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index a698b9b..9d5c830 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 _0x42a4=['setDataValue','getDataValue','crudPermissions','split','BOOLEAN','sequelize','name','STRING'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x42a4,0x7d));var _0x442a=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x42a4[_0x1646fa];return _0x5a47a5;};'use strict';var Sequelize=require(_0x442a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x442a('0x1')},'crudPermissions':{'type':Sequelize[_0x442a('0x2')],'set':function(_0x3c260b){this[_0x442a('0x3')]('crudPermissions',_0x3c260b?_0x3c260b['join'](''):[]);},'get':function(){return this[_0x442a('0x4')](_0x442a('0x5'))?this['getDataValue'](_0x442a('0x5'))[_0x442a('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x442a('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x442a('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x442a('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0a7a=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0a7a,0x106));var _0xa0a7=function(_0x18d974,_0x2816a1){_0x18d974=_0x18d974-0x0;var _0x378bed=_0x0a7a[_0x18d974];return _0x378bed;};'use strict';var Sequelize=require(_0xa0a7('0x0'));module[_0xa0a7('0x1')]={'name':{'type':Sequelize[_0xa0a7('0x2')],'allowNull':![],'unique':_0xa0a7('0x3')},'crudPermissions':{'type':Sequelize[_0xa0a7('0x2')],'set':function(_0x4d54b1){this[_0xa0a7('0x4')](_0xa0a7('0x5'),_0x4d54b1?_0x4d54b1[_0xa0a7('0x6')](''):[]);},'get':function(){return this[_0xa0a7('0x7')]('crudPermissions')?this[_0xa0a7('0x7')](_0xa0a7('0x5'))[_0xa0a7('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xa0a7('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa0a7('0x9')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index b74437f..9bda776 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 _0x6bbe=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./userProfile.socket','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','type','key','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','length','include','catch','create','clone','params','find','get','omit','createdAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','updatedAt','sectionId','Resources','describe','userProfileId','ids','getSections','includes','subsections','enabled','concat','push','Dashboard','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x5129bd,_0x26e419){var _0x414769=function(_0x2c1fcc){while(--_0x2c1fcc){_0x5129bd['push'](_0x5129bd['shift']());}};_0x414769(++_0x26e419);}(_0x6bbe,0x13b));var _0xe6bb=function(_0x20b0ec,_0xb688b){_0x20b0ec=_0x20b0ec-0x0;var _0x46519a=_0x6bbe[_0x20b0ec];return _0x46519a;};'use strict';var emlformat=require(_0xe6bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6bb('0x1'));var jsonpatch=require(_0xe6bb('0x2'));var rp=require(_0xe6bb('0x3'));var moment=require(_0xe6bb('0x4'));var BPromise=require(_0xe6bb('0x5'));var Mustache=require(_0xe6bb('0x6'));var util=require(_0xe6bb('0x7'));var path=require(_0xe6bb('0x8'));var sox=require(_0xe6bb('0x9'));var csv=require(_0xe6bb('0xa'));var ejs=require(_0xe6bb('0xb'));var fs=require('fs');var fs_extra=require(_0xe6bb('0xc'));var _=require(_0xe6bb('0xd'));var squel=require('squel');var crypto=require(_0xe6bb('0xe'));var jsforce=require(_0xe6bb('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe6bb('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe6bb('0x10'));var authService=require(_0xe6bb('0x11'));var qs=require(_0xe6bb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6bb('0x13'));var logger=require(_0xe6bb('0x14'))('api');var utils=require(_0xe6bb('0x15'));var config=require(_0xe6bb('0x16'));var licenseUtil=require(_0xe6bb('0x17'));var db=require(_0xe6bb('0x18'))['db'];config[_0xe6bb('0x19')]=_['defaults'](config[_0xe6bb('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe6bb('0x19')]));require(_0xe6bb('0x1a'))['register'](socket);function respondWithStatusCode(_0x1cb53c,_0x5cad74){_0x5cad74=_0x5cad74||0xcc;return function(_0x5b8001){if(_0x5b8001){return _0x1cb53c[_0xe6bb('0x1b')](_0x5cad74);}return _0x1cb53c['status'](_0x5cad74)[_0xe6bb('0x1c')]();};}function respondWithResult(_0x2a13c7,_0x2b06c4){_0x2b06c4=_0x2b06c4||0xc8;return function(_0x102092){if(_0x102092){return _0x2a13c7[_0xe6bb('0x1d')](_0x2b06c4)[_0xe6bb('0x1e')](_0x102092);}};}function respondWithFilteredResult(_0x1136e7,_0x907d60){return function(_0x4ac730){if(_0x4ac730){var _0x35e058=typeof _0x907d60[_0xe6bb('0x1f')]===_0xe6bb('0x20')&&typeof _0x907d60['limit']===_0xe6bb('0x20');var _0xf5c155=_0x4ac730[_0xe6bb('0x21')];var _0x241d81=_0x35e058?0x0:_0x907d60[_0xe6bb('0x1f')];var _0x2364a7=_0x35e058?_0x4ac730[_0xe6bb('0x21')]:_0x907d60[_0xe6bb('0x1f')]+_0x907d60['limit'];var _0x3f787d;if(_0x2364a7>=_0xf5c155){_0x2364a7=_0xf5c155;_0x3f787d=0xc8;}else{_0x3f787d=0xce;}_0x1136e7['status'](_0x3f787d);return _0x1136e7[_0xe6bb('0x22')](_0xe6bb('0x23'),_0x241d81+'-'+_0x2364a7+'/'+_0xf5c155)['json'](_0x4ac730);}return null;};}function patchUpdates(_0xc0e4d7){return function(_0x1229ba){try{jsonpatch[_0xe6bb('0x24')](_0x1229ba,_0xc0e4d7,!![]);}catch(_0x3eda8e){return BPromise[_0xe6bb('0x25')](_0x3eda8e);}return _0x1229ba[_0xe6bb('0x26')]();};}function saveUpdates(_0x5572f4,_0x5d2e4a){return function(_0x44dac6){if(_0x44dac6){return _0x44dac6[_0xe6bb('0x27')](_0x5572f4)[_0xe6bb('0x28')](function(_0x5bc682){return _0x5bc682;});}return null;};}function removeEntity(_0x4b3e84,_0x26841a){return function(_0x179501){if(_0x179501){return _0x179501[_0xe6bb('0x29')]()[_0xe6bb('0x28')](function(){_0x4b3e84[_0xe6bb('0x1d')](0xcc)[_0xe6bb('0x1c')]();});}};}function handleEntityNotFound(_0x570703,_0x1d63ae){return function(_0x2e6941){if(!_0x2e6941){_0x570703[_0xe6bb('0x1b')](0x194);}return _0x2e6941;};}function handleError(_0x332bf8,_0x215e10){_0x215e10=_0x215e10||0x1f4;return function(_0x4a245e){logger[_0xe6bb('0x2a')](_0x4a245e[_0xe6bb('0x2b')]);if(_0x4a245e[_0xe6bb('0x2c')]){delete _0x4a245e[_0xe6bb('0x2c')];}_0x332bf8[_0xe6bb('0x1d')](_0x215e10)[_0xe6bb('0x2d')](_0x4a245e);};}exports[_0xe6bb('0x2e')]=function(_0x1da89d,_0x21341e){var _0x435188={},_0xc55f09={},_0x8da836={'count':0x0,'rows':[]};var _0x2ca88c=_[_0xe6bb('0x2f')](db[_0xe6bb('0x30')]['rawAttributes'],function(_0x5e51b1){return{'name':_0x5e51b1['fieldName'],'type':_0x5e51b1[_0xe6bb('0x31')][_0xe6bb('0x32')]};});_0xc55f09['model']=_[_0xe6bb('0x2f')](_0x2ca88c,_0xe6bb('0x2c'));_0xc55f09[_0xe6bb('0x33')]=_['keys'](_0x1da89d['query']);_0xc55f09['filters']=_[_0xe6bb('0x34')](_0xc55f09['model'],_0xc55f09[_0xe6bb('0x33')]);_0x435188[_0xe6bb('0x35')]=_['intersection'](_0xc55f09[_0xe6bb('0x36')],qs['fields'](_0x1da89d[_0xe6bb('0x33')][_0xe6bb('0x37')]));_0x435188['attributes']=_0x435188[_0xe6bb('0x35')]['length']?_0x435188[_0xe6bb('0x35')]:_0xc55f09[_0xe6bb('0x36')];if(!_0x1da89d['query'][_0xe6bb('0x38')](_0xe6bb('0x39'))){_0x435188['limit']=qs[_0xe6bb('0x3a')](_0x1da89d[_0xe6bb('0x33')][_0xe6bb('0x3a')]);_0x435188[_0xe6bb('0x1f')]=qs['offset'](_0x1da89d[_0xe6bb('0x33')][_0xe6bb('0x1f')]);}_0x435188[_0xe6bb('0x3b')]=qs[_0xe6bb('0x3c')](_0x1da89d[_0xe6bb('0x33')][_0xe6bb('0x3c')]);_0x435188[_0xe6bb('0x3d')]=qs[_0xe6bb('0x3e')](_['pick'](_0x1da89d[_0xe6bb('0x33')],_0xc55f09[_0xe6bb('0x3e')]),_0x2ca88c);if(_0x1da89d['query'][_0xe6bb('0x3f')]){_0x435188[_0xe6bb('0x3d')]=_[_0xe6bb('0x40')](_0x435188[_0xe6bb('0x3d')],{'$or':_[_0xe6bb('0x2f')](_0x2ca88c,function(_0x13d5ac){if(_0x13d5ac[_0xe6bb('0x31')]!=='VIRTUAL'){var _0x46b270={};_0x46b270[_0x13d5ac['name']]={'$like':'%'+_0x1da89d[_0xe6bb('0x33')][_0xe6bb('0x3f')]+'%'};return _0x46b270;}})});}_0x435188=_['merge']({},_0x435188,_0x1da89d[_0xe6bb('0x41')]);var _0xa64390={'where':_0x435188['where']};return db[_0xe6bb('0x30')][_0xe6bb('0x21')](_0xa64390)[_0xe6bb('0x28')](function(_0x1eee6c){_0x8da836[_0xe6bb('0x21')]=_0x1eee6c;if(_0x1da89d['query'][_0xe6bb('0x42')]){_0x435188['include']=[{'all':!![]}];}return db['UserProfile'][_0xe6bb('0x43')](_0x435188);})[_0xe6bb('0x28')](function(_0x4d0fa5){_0x8da836[_0xe6bb('0x44')]=_0x4d0fa5;return _0x8da836;})[_0xe6bb('0x28')](respondWithFilteredResult(_0x21341e,_0x435188))['catch'](handleError(_0x21341e,null));};exports[_0xe6bb('0x45')]=function(_0x4e3243,_0x49c04a){var _0x545dd0={'raw':![],'where':{'id':_0x4e3243['params']['id']}},_0x3c9045={};_0x3c9045[_0xe6bb('0x36')]=_['keys'](db[_0xe6bb('0x30')][_0xe6bb('0x46')]);_0x3c9045[_0xe6bb('0x33')]=_['keys'](_0x4e3243[_0xe6bb('0x33')]);_0x3c9045[_0xe6bb('0x3e')]=_['intersection'](_0x3c9045[_0xe6bb('0x36')],_0x3c9045['query']);_0x545dd0['attributes']=_['intersection'](_0x3c9045['model'],qs[_0xe6bb('0x37')](_0x4e3243[_0xe6bb('0x33')][_0xe6bb('0x37')]));_0x545dd0[_0xe6bb('0x35')]=_0x545dd0[_0xe6bb('0x35')][_0xe6bb('0x47')]?_0x545dd0[_0xe6bb('0x35')]:_0x3c9045[_0xe6bb('0x36')];if(_0x4e3243[_0xe6bb('0x33')][_0xe6bb('0x42')]){_0x545dd0[_0xe6bb('0x48')]=[{'all':!![]}];}_0x545dd0=_[_0xe6bb('0x40')]({},_0x545dd0,_0x4e3243[_0xe6bb('0x41')]);return db[_0xe6bb('0x30')]['find'](_0x545dd0)[_0xe6bb('0x28')](handleEntityNotFound(_0x49c04a,null))[_0xe6bb('0x28')](respondWithResult(_0x49c04a,null))[_0xe6bb('0x49')](handleError(_0x49c04a,null));};exports[_0xe6bb('0x4a')]=function(_0x518d3b,_0x20e204){return db[_0xe6bb('0x30')][_0xe6bb('0x4a')](_0x518d3b['body'],{})[_0xe6bb('0x28')](respondWithResult(_0x20e204,0xc9))[_0xe6bb('0x49')](handleError(_0x20e204,null));};exports[_0xe6bb('0x4b')]=function(_0x19f6db,_0x3d7982){var _0x4caac4={'where':{'id':_0x19f6db[_0xe6bb('0x4c')]['id']}},_0x58b4d1={};_0x58b4d1['model']=_['keys'](db['UserProfile'][_0xe6bb('0x46')]);_0x4caac4[_0xe6bb('0x35')]=_[_0xe6bb('0x34')](_0x58b4d1[_0xe6bb('0x36')],qs[_0xe6bb('0x37')](_0x19f6db[_0xe6bb('0x33')][_0xe6bb('0x37')]));_0x4caac4[_0xe6bb('0x35')]=_0x4caac4[_0xe6bb('0x35')][_0xe6bb('0x47')]?_0x4caac4[_0xe6bb('0x35')]:_0x58b4d1[_0xe6bb('0x36')];if(_0x19f6db[_0xe6bb('0x33')][_0xe6bb('0x42')]){_0x4caac4['include']=[{'all':!![]}];}_0x4caac4=_[_0xe6bb('0x40')]({},_0x4caac4,_0x19f6db['options']);return db['UserProfile'][_0xe6bb('0x4d')](_0x4caac4)['then'](handleEntityNotFound(_0x3d7982,null))['then'](function(_0x33c9ff){if(_0x33c9ff){var _0x127db3=_0x33c9ff[_0xe6bb('0x4e')]({'plain':!![]});_0x127db3=qs[_0xe6bb('0x4f')](_0x127db3,['id',_0xe6bb('0x50'),'updatedAt',_0xe6bb('0x51')]);_0x19f6db[_0xe6bb('0x52')]=_[_0xe6bb('0x4f')](_0x19f6db[_0xe6bb('0x52')],['id',_0xe6bb('0x50'),'updatedAt']);return db[_0xe6bb('0x53')][_0xe6bb('0x54')](function(_0x1e6eaa){return db[_0xe6bb('0x30')]['create'](_[_0xe6bb('0x40')](_0x127db3,_0x19f6db[_0xe6bb('0x52')]),{'include':_0x19f6db[_0xe6bb('0x33')][_0xe6bb('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x1e6eaa})['then'](function(_0x529d56){var _0x2420af=_0x529d56[_0xe6bb('0x4e')]({'plain':!![]});return db[_0xe6bb('0x55')][_0xe6bb('0x43')]({'where':{'userProfileId':_0x19f6db[_0xe6bb('0x4c')]['id']},'raw':!![]})[_0xe6bb('0x28')](function(_0x3bfe94){if(_0x3bfe94){return BPromise[_0xe6bb('0x56')](_0x3bfe94,function(_0x3945a6){return new BPromise(function(_0x3164a2,_0x421caf){if(_0x3945a6[_0xe6bb('0x57')]===null||_0x3945a6[_0xe6bb('0x57')]===0x1)_0x3164a2(null);return db[_0xe6bb('0x58')][_0xe6bb('0x43')]({'where':{'sectionId':_0x3945a6['id']},'raw':!![]})[_0xe6bb('0x28')](function(_0x1d334a){var _0x52f91c=_[_0xe6bb('0x2f')](_0x1d334a,function(_0x5a2860){return qs[_0xe6bb('0x4f')](_0x5a2860,['id','createdAt',_0xe6bb('0x59'),_0xe6bb('0x5a')]);});_0x3164a2(_0x52f91c);})['catch'](function(_0xba8148){_0x421caf(_0xba8148);});})[_0xe6bb('0x28')](function(_0x5aa96d){var _0x520e24=qs[_0xe6bb('0x4f')](_0x3945a6,['id','createdAt',_0xe6bb('0x59')]);_0x520e24['userProfileId']=_0x2420af['id'];if(_0x5aa96d)_0x520e24['Resources']=_0x5aa96d;return _0x520e24;})[_0xe6bb('0x28')](function(_0x3396fc){return db['UserProfileSection']['create'](_0x3396fc,{'include':[{'model':db[_0xe6bb('0x58')],'as':_0xe6bb('0x5b')}],'raw':!![],'transaction':_0x1e6eaa});});})['then'](function(){return _0x2420af;});}});});});}})[_0xe6bb('0x28')](respondWithResult(_0x3d7982,0xc9))[_0xe6bb('0x49')](handleError(_0x3d7982,null));};exports['update']=function(_0x9fd365,_0x247d85){if(_0x9fd365['body']['id']){delete _0x9fd365[_0xe6bb('0x52')]['id'];}return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0x9fd365[_0xe6bb('0x4c')]['id']}})[_0xe6bb('0x28')](handleEntityNotFound(_0x247d85,null))[_0xe6bb('0x28')](saveUpdates(_0x9fd365[_0xe6bb('0x52')],null))[_0xe6bb('0x28')](respondWithResult(_0x247d85,null))[_0xe6bb('0x49')](handleError(_0x247d85,null));};exports[_0xe6bb('0x29')]=function(_0x2051be,_0x38c9fb){return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0x2051be[_0xe6bb('0x4c')]['id']}})[_0xe6bb('0x28')](handleEntityNotFound(_0x38c9fb,null))[_0xe6bb('0x28')](removeEntity(_0x38c9fb,null))[_0xe6bb('0x49')](handleError(_0x38c9fb,null));};exports[_0xe6bb('0x5c')]=function(_0x67e9cb,_0x50c810){return db[_0xe6bb('0x30')][_0xe6bb('0x5c')]()[_0xe6bb('0x28')](respondWithResult(_0x50c810,null))[_0xe6bb('0x49')](handleError(_0x50c810,null));};exports['addSections']=function(_0x5192cf,_0x39188a){var _0x15fd0d=_0x5192cf[_0xe6bb('0x52')];return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0x5192cf[_0xe6bb('0x4c')]['id']}})[_0xe6bb('0x28')](handleEntityNotFound(_0x39188a,null))[_0xe6bb('0x28')](function(_0x3ad301){if(_0x3ad301){return db[_0xe6bb('0x53')][_0xe6bb('0x54')](function(_0x49aaf4){return db[_0xe6bb('0x55')]['destroy']({'where':{'userProfileId':_0x5192cf[_0xe6bb('0x4c')]['id'],'sectionId':_[_0xe6bb('0x2f')](_0x15fd0d,function(_0x291a58){return _0x291a58[_0xe6bb('0x5a')];})},'transaction':_0x49aaf4})['then'](function(){var _0x573a5d=_['map'](_0x15fd0d,function(_0x145e70){_0x145e70[_0xe6bb('0x5d')]=_0x5192cf[_0xe6bb('0x4c')]['id'];return _0x145e70;});var _0x27a216=[];return BPromise[_0xe6bb('0x56')](_0x573a5d,function(_0x5d39c9){return db[_0xe6bb('0x55')][_0xe6bb('0x4a')](_0x5d39c9,{'include':[{'model':db[_0xe6bb('0x58')],'as':_0xe6bb('0x5b')}],'raw':!![],'transaction':_0x49aaf4})[_0xe6bb('0x28')](function(_0x4e69fb){_0x27a216['push'](_0x4e69fb[_0xe6bb('0x4e')]({'plain':!![]}));});})[_0xe6bb('0x28')](function(){return _0x27a216;});});});}})[_0xe6bb('0x28')](function(_0x3ee699){return _0x3ee699;})[_0xe6bb('0x28')](respondWithResult(_0x39188a,null))[_0xe6bb('0x49')](handleError(_0x39188a,null));};exports['removeSections']=function(_0x32dd91,_0x3c0f05){var _0x5ca8ec;return db['UserProfile'][_0xe6bb('0x4d')]({'where':{'id':_0x32dd91[_0xe6bb('0x4c')]['id']},'attributes':['id','name']})[_0xe6bb('0x28')](handleEntityNotFound(_0x3c0f05,null))[_0xe6bb('0x28')](function(_0xa2a93f){if(_0xa2a93f){_0x5ca8ec=_0xa2a93f;return db[_0xe6bb('0x55')][_0xe6bb('0x29')]({'where':{'userProfileId':_0x32dd91[_0xe6bb('0x4c')]['id'],'sectionId':_0x32dd91[_0xe6bb('0x33')][_0xe6bb('0x5e')]}});}})[_0xe6bb('0x28')](function(){return _0x5ca8ec;})[_0xe6bb('0x28')](respondWithStatusCode(_0x3c0f05,null))[_0xe6bb('0x49')](handleError(_0x3c0f05,null));};exports[_0xe6bb('0x5f')]=function(_0x8677f,_0xc16de8){var _0xe4019f=[];var _0x14e3c0=[];return db[_0xe6bb('0x55')][_0xe6bb('0x43')]({'where':{'userProfileId':_0x8677f[_0xe6bb('0x4c')]['id']},'raw':!![]})[_0xe6bb('0x28')](function(_0x34a9b1){_0xe4019f=_[_0xe6bb('0x3f')](_0x34a9b1,function(_0x2052a1){return _0x2052a1['enabled']===0x1||_['includes']([0x3eb,0x709],_0x2052a1[_0xe6bb('0x5a')]);});if(!_['isEmpty'](_0xe4019f)){return _[_0xe6bb('0x2f')](_0xe4019f,function(_0x3a5d63){return _0x3a5d63[_0xe6bb('0x5a')];});}else{return;}})['then'](function(_0xec59b7){if(_0xec59b7)_0x14e3c0=_0xec59b7;if(_[_0xe6bb('0x60')](_0x14e3c0,0x64)){var _0x3263f9=_[_0xe6bb('0x4d')](_0xe4019f,{'sectionId':0x64});return hasDefaultDashboard(_0x3263f9)['then'](function(_0x530567){return _[_0xe6bb('0x2f')](_0xe4019f,function(_0x523d4a){if(_0x523d4a[_0xe6bb('0x5a')]===0x64){_0x523d4a[_0xe6bb('0x61')]=_0x530567;}return _0x523d4a;});});}else{return;}})[_0xe6bb('0x28')](function(_0x3d9537){if(_0x3d9537)_0xe4019f=_0x3d9537;if(_[_0xe6bb('0x60')](_0x14e3c0,0x3eb)){var _0xd1993b=_[_0xe6bb('0x4d')](_0xe4019f,{'sectionId':0x3eb});return getCustomDashboards(_0xd1993b)[_0xe6bb('0x28')](function(_0x67f016){return _[_0xe6bb('0x2f')](_0xe4019f,function(_0x3858ac){if(_0xd1993b[_0xe6bb('0x62')]){if(_0x3858ac[_0xe6bb('0x5a')]===0x3eb){_0x3858ac[_0xe6bb('0x61')]=_0x67f016;}}else{if(_0x3858ac['sectionId']===0x64){if(!_0x3858ac[_0xe6bb('0x61')]){_0x3858ac[_0xe6bb('0x61')]=[];}_0x3858ac['subsections']=_0x3858ac[_0xe6bb('0x61')][_0xe6bb('0x63')](_0x67f016);}}return _0x3858ac;});});}else{return;}})[_0xe6bb('0x28')](function(_0x40a2e3){if(_0x40a2e3)_0xe4019f=_0x40a2e3;if(_[_0xe6bb('0x60')](_0x14e3c0,0x709)){var _0x259a46=_['find'](_0xe4019f,{'sectionId':0x709});return getPlugins(_0x259a46)[_0xe6bb('0x28')](function(_0x6e76b8){if(_0x259a46[_0xe6bb('0x62')]){return _['map'](_0xe4019f,function(_0x3a17d1){if(_0x3a17d1['sectionId']===0x709){_0x3a17d1['subsections']=_0x6e76b8;}return _0x3a17d1;});}else{var _0x5a3d5e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x6e76b8};var _0x57eced=_[_0xe6bb('0x2f')](_0xe4019f);_0x57eced[_0xe6bb('0x64')](_0x5a3d5e);return _0x57eced;}});}else{return;}})['then'](function(_0x16d663){if(_0x16d663)_0xe4019f=_0x16d663;return _[_0xe6bb('0x3f')](_0xe4019f,[_0xe6bb('0x62'),0x1]);})[_0xe6bb('0x28')](respondWithResult(_0xc16de8,null))[_0xe6bb('0x49')](handleError(_0xc16de8,null));};function hasDefaultDashboard(_0x1c0d08){var _0x53d6d9=[0x65];return new BPromise(function(_0x4c4e6f,_0x23f210){try{if(_0x1c0d08[_0xe6bb('0x57')]){_0x4c4e6f(_0x53d6d9);}else{return db[_0xe6bb('0x58')]['findOne']({'where':{'sectionId':_0x1c0d08['id']},'raw':!![]})['then'](function(_0x31fd48){_0x31fd48?_0x4c4e6f(_0x53d6d9):_0x4c4e6f();});}}catch(_0x2a79be){_0x23f210(_0x2a79be);}});}function getCustomDashboards(_0x66e1a6){var _0x550ed7=[];return new BPromise(function(_0x86da88,_0x1c1f59){try{if(_0x66e1a6[_0xe6bb('0x57')]){return db[_0xe6bb('0x65')][_0xe6bb('0x43')]({'raw':!![]})[_0xe6bb('0x28')](function(_0x329b5c){_0x329b5c[_0xe6bb('0x66')](function(_0x59a990){_0x550ed7[_0xe6bb('0x64')](_0x59a990['id']+0x1869f);});_0x86da88(_0x550ed7);});}else{return db['UserProfileResource'][_0xe6bb('0x43')]({'where':{'sectionId':_0x66e1a6['id']},'raw':!![]})[_0xe6bb('0x28')](function(_0x415464){_0x415464[_0xe6bb('0x66')](function(_0x38ae33){_0x550ed7['push'](_0x38ae33['resourceId']+0x1869f);});_0x86da88(_0x550ed7);});}}catch(_0x205985){_0x1c1f59(_0x205985);}});}function getPlugins(_0x223f22){var _0x492bbc=[];return new BPromise(function(_0x460359,_0x5e1ded){try{if(_0x223f22[_0xe6bb('0x57')]){return db[_0xe6bb('0x67')][_0xe6bb('0x43')]({'raw':!![]})[_0xe6bb('0x28')](function(_0x266c57){_0x266c57[_0xe6bb('0x66')](function(_0x869d09){_0x492bbc[_0xe6bb('0x64')](_0x869d09['id']+0x15b38);});_0x460359(_0x492bbc);});}else{return db['UserProfileResource'][_0xe6bb('0x43')]({'where':{'sectionId':_0x223f22['id']},'raw':!![]})['then'](function(_0x45ceed){_0x45ceed[_0xe6bb('0x66')](function(_0x5935ae){_0x492bbc[_0xe6bb('0x64')](_0x5935ae[_0xe6bb('0x68')]+0x15b38);});_0x460359(_0x492bbc);});}}catch(_0x29cde7){_0x5e1ded(_0x29cde7);}});}exports[_0xe6bb('0x69')]=function(_0x5d1a8a,_0x1bed90){return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0x5d1a8a['params']['id']}})[_0xe6bb('0x28')](handleEntityNotFound(_0x1bed90,null))[_0xe6bb('0x28')](function(_0x4fd4ca){if(_0x4fd4ca){return db[_0xe6bb('0x53')]['transaction'](function(_0x467568){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x5d1a8a[_0xe6bb('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0xe6bb('0x28')](function(_0x51c395){if(_0x51c395){return db[_0xe6bb('0x55')]['destroy']({'where':{'userProfileId':_0x5d1a8a[_0xe6bb('0x4c')]['id'],'id':_[_0xe6bb('0x2f')](_0x51c395,function(_0x5622c6){return _0x5622c6['id'];})},'transaction':_0x467568});}})[_0xe6bb('0x28')](function(_0x532162){var _0x5b1d4b=_[_0xe6bb('0x2f')](_0x5d1a8a[_0xe6bb('0x52')],function(_0x5b1d9e){_0x5b1d9e['userProfileId']=_0x5d1a8a[_0xe6bb('0x4c')]['id'];return _0x5b1d9e;});return db['UserProfileSection'][_0xe6bb('0x6a')](_0x5b1d4b,{'raw':!![],'transaction':_0x467568});})[_0xe6bb('0x28')](function(_0x5a508f){var _0x3dc684=_['filter'](_[_0xe6bb('0x2f')](_0x5a508f,function(_0x21044c){return _0x21044c[_0xe6bb('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x3dc684){return db[_0xe6bb('0x55')]['findAll']({'where':{'userProfileId':_0x5d1a8a['params']['id'],'sectionId':_[_0xe6bb('0x2f')](_0x3dc684,function(_0x7b9c7e){return _0x7b9c7e[_0xe6bb('0x5a')];})},'attributes':['id',_0xe6bb('0x5a')],'raw':!![]})[_0xe6bb('0x28')](function(_0x230406){var _0x2ad74f=_[_0xe6bb('0x2f')](_0x5d1a8a[_0xe6bb('0x52')],function(_0x411ca0){_0x411ca0[_0xe6bb('0x5d')]=_0x5d1a8a[_0xe6bb('0x4c')]['id'];return _0x411ca0;});return db[_0xe6bb('0x58')]['bulkCreate'](_0x2ad74f,{'raw':!![],'transaction':_0x467568});});}})[_0xe6bb('0x49')](handleError(_0x1bed90,null));});}})[_0xe6bb('0x28')](function(_0x4ce276){var _0x1edd24=_[_0xe6bb('0x2f')](_0x4ce276,function(_0x1f335e){return _0x1f335e[_0xe6bb('0x4e')]({'plain':!![]});});})[_0xe6bb('0x28')](respondWithResult(_0x1bed90,null))[_0xe6bb('0x49')](handleError(_0x1bed90,null));};exports['removeResources']=function(_0xf45e7e,_0x5774e9,_0x2ef05a){return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0xf45e7e[_0xe6bb('0x4c')]['id']}})[_0xe6bb('0x28')](handleEntityNotFound(_0x5774e9,null))['then'](function(_0x2e29df){if(_0x2e29df){return _0x2e29df[_0xe6bb('0x6b')](_0xf45e7e[_0xe6bb('0x33')][_0xe6bb('0x5e')]);}})[_0xe6bb('0x28')](respondWithStatusCode(_0x5774e9,null))['catch'](handleError(_0x5774e9,null));};exports[_0xe6bb('0x6c')]=function(_0x2ce3c7,_0x51d871){var _0x10fd46={};if(!_0x2ce3c7[_0xe6bb('0x33')][_0xe6bb('0x6d')])throw new Error(_0xe6bb('0x6e'));if(!_0x2ce3c7[_0xe6bb('0x33')][_0xe6bb('0x38')](_0xe6bb('0x39'))){_0x10fd46[_0xe6bb('0x3a')]=qs[_0xe6bb('0x3a')](_0x2ce3c7[_0xe6bb('0x33')][_0xe6bb('0x3a')]);_0x10fd46[_0xe6bb('0x1f')]=qs[_0xe6bb('0x1f')](_0x2ce3c7[_0xe6bb('0x33')]['offset']);}return db[_0xe6bb('0x30')][_0xe6bb('0x4d')]({'where':{'id':_0x2ce3c7[_0xe6bb('0x4c')]['id']}})[_0xe6bb('0x28')](function(_0x95eb4){if(!_0x95eb4)throw new Error(_0xe6bb('0x6f')+_0x2ce3c7[_0xe6bb('0x4c')]['id']);return db[_0xe6bb('0x30')][_0xe6bb('0x6c')](_0x2ce3c7);})[_0xe6bb('0x28')](respondWithFilteredResult(_0x51d871,_0x10fd46))[_0xe6bb('0x49')](handleError(_0x51d871,null));}; \ No newline at end of file +var _0xd2e2=['Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','UserProfile','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','create','params','get','omit','createdAt','crudPermissions','body','updatedAt','transaction','autoAssociation','UserProfileResource','Resources','describe','UserProfileSection','sectionId','userProfileId','each','push','removeSections','getSections','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId'];(function(_0x285efb,_0x13e320){var _0x540155=function(_0x57f944){while(--_0x57f944){_0x285efb['push'](_0x285efb['shift']());}};_0x540155(++_0x13e320);}(_0xd2e2,0x1d4));var _0x2d2e=function(_0x186156,_0x1c1b7a){_0x186156=_0x186156-0x0;var _0x354699=_0xd2e2[_0x186156];return _0x354699;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d2e('0x0'));var zipdir=require(_0x2d2e('0x1'));var jsonpatch=require(_0x2d2e('0x2'));var rp=require(_0x2d2e('0x3'));var moment=require('moment');var BPromise=require(_0x2d2e('0x4'));var Mustache=require(_0x2d2e('0x5'));var util=require('util');var path=require(_0x2d2e('0x6'));var sox=require(_0x2d2e('0x7'));var csv=require('to-csv');var ejs=require(_0x2d2e('0x8'));var fs=require('fs');var fs_extra=require(_0x2d2e('0x9'));var _=require(_0x2d2e('0xa'));var squel=require(_0x2d2e('0xb'));var crypto=require(_0x2d2e('0xc'));var jsforce=require(_0x2d2e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2d2e('0xe'));var querystring=require(_0x2d2e('0xf'));var Papa=require(_0x2d2e('0x10'));var Redis=require(_0x2d2e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2d2e('0x12'));var hardwareService=require(_0x2d2e('0x13'));var logger=require(_0x2d2e('0x14'))(_0x2d2e('0x15'));var utils=require(_0x2d2e('0x16'));var config=require(_0x2d2e('0x17'));var licenseUtil=require(_0x2d2e('0x18'));var db=require('../../mysqldb')['db'];config[_0x2d2e('0x19')]=_[_0x2d2e('0x1a')](config['redis'],{'host':_0x2d2e('0x1b'),'port':0x18eb});var socket=require(_0x2d2e('0x1c'))(new Redis(config[_0x2d2e('0x19')]));require(_0x2d2e('0x1d'))['register'](socket);function respondWithStatusCode(_0x15197a,_0x5f2614){_0x5f2614=_0x5f2614||0xcc;return function(_0x4fdf65){if(_0x4fdf65){return _0x15197a[_0x2d2e('0x1e')](_0x5f2614);}return _0x15197a[_0x2d2e('0x1f')](_0x5f2614)[_0x2d2e('0x20')]();};}function respondWithResult(_0x319323,_0x478574){_0x478574=_0x478574||0xc8;return function(_0x51d858){if(_0x51d858){return _0x319323['status'](_0x478574)[_0x2d2e('0x21')](_0x51d858);}};}function respondWithFilteredResult(_0x20f9dd,_0x19132a){return function(_0x2b31e1){if(_0x2b31e1){var _0x409352=typeof _0x19132a[_0x2d2e('0x22')]==='undefined'&&typeof _0x19132a[_0x2d2e('0x23')]===_0x2d2e('0x24');var _0x2a72fb=_0x2b31e1['count'];var _0x12beff=_0x409352?0x0:_0x19132a[_0x2d2e('0x22')];var _0xbe9b2a=_0x409352?_0x2b31e1['count']:_0x19132a['offset']+_0x19132a['limit'];var _0x55c898;if(_0xbe9b2a>=_0x2a72fb){_0xbe9b2a=_0x2a72fb;_0x55c898=0xc8;}else{_0x55c898=0xce;}_0x20f9dd[_0x2d2e('0x1f')](_0x55c898);return _0x20f9dd[_0x2d2e('0x25')](_0x2d2e('0x26'),_0x12beff+'-'+_0xbe9b2a+'/'+_0x2a72fb)[_0x2d2e('0x21')](_0x2b31e1);}return null;};}function patchUpdates(_0x47979a){return function(_0x1c6a9e){try{jsonpatch['apply'](_0x1c6a9e,_0x47979a,!![]);}catch(_0x52642c){return BPromise[_0x2d2e('0x27')](_0x52642c);}return _0x1c6a9e[_0x2d2e('0x28')]();};}function saveUpdates(_0x420655,_0x59a877){return function(_0x2ffba7){if(_0x2ffba7){return _0x2ffba7[_0x2d2e('0x29')](_0x420655)[_0x2d2e('0x2a')](function(_0x1ba5ff){return _0x1ba5ff;});}return null;};}function removeEntity(_0x256df6,_0x267537){return function(_0x3c29ce){if(_0x3c29ce){return _0x3c29ce[_0x2d2e('0x2b')]()['then'](function(){_0x256df6[_0x2d2e('0x1f')](0xcc)[_0x2d2e('0x20')]();});}};}function handleEntityNotFound(_0x264ecf,_0x437e7c){return function(_0x5aeccf){if(!_0x5aeccf){_0x264ecf[_0x2d2e('0x1e')](0x194);}return _0x5aeccf;};}function handleError(_0x2e6066,_0x45e534){_0x45e534=_0x45e534||0x1f4;return function(_0x3a8b82){logger[_0x2d2e('0x2c')](_0x3a8b82['stack']);if(_0x3a8b82[_0x2d2e('0x2d')]){delete _0x3a8b82[_0x2d2e('0x2d')];}_0x2e6066[_0x2d2e('0x1f')](_0x45e534)[_0x2d2e('0x2e')](_0x3a8b82);};}exports[_0x2d2e('0x2f')]=function(_0x329c27,_0x19c201){var _0x264c4f={},_0x2c32ad={},_0x3df1ad={'count':0x0,'rows':[]};var _0x439e48=_[_0x2d2e('0x30')](db[_0x2d2e('0x31')]['rawAttributes'],function(_0x59a71f){return{'name':_0x59a71f[_0x2d2e('0x32')],'type':_0x59a71f[_0x2d2e('0x33')][_0x2d2e('0x34')]};});_0x2c32ad[_0x2d2e('0x35')]=_['map'](_0x439e48,_0x2d2e('0x2d'));_0x2c32ad['query']=_[_0x2d2e('0x36')](_0x329c27[_0x2d2e('0x37')]);_0x2c32ad[_0x2d2e('0x38')]=_[_0x2d2e('0x39')](_0x2c32ad['model'],_0x2c32ad[_0x2d2e('0x37')]);_0x264c4f['attributes']=_[_0x2d2e('0x39')](_0x2c32ad[_0x2d2e('0x35')],qs[_0x2d2e('0x3a')](_0x329c27['query'][_0x2d2e('0x3a')]));_0x264c4f[_0x2d2e('0x3b')]=_0x264c4f['attributes']['length']?_0x264c4f[_0x2d2e('0x3b')]:_0x2c32ad[_0x2d2e('0x35')];if(!_0x329c27['query'][_0x2d2e('0x3c')](_0x2d2e('0x3d'))){_0x264c4f['limit']=qs[_0x2d2e('0x23')](_0x329c27[_0x2d2e('0x37')][_0x2d2e('0x23')]);_0x264c4f[_0x2d2e('0x22')]=qs[_0x2d2e('0x22')](_0x329c27[_0x2d2e('0x37')][_0x2d2e('0x22')]);}_0x264c4f[_0x2d2e('0x3e')]=qs[_0x2d2e('0x3f')](_0x329c27[_0x2d2e('0x37')][_0x2d2e('0x3f')]);_0x264c4f['where']=qs['filters'](_['pick'](_0x329c27[_0x2d2e('0x37')],_0x2c32ad['filters']),_0x439e48);if(_0x329c27[_0x2d2e('0x37')][_0x2d2e('0x40')]){_0x264c4f[_0x2d2e('0x41')]=_[_0x2d2e('0x42')](_0x264c4f[_0x2d2e('0x41')],{'$or':_['map'](_0x439e48,function(_0x208737){if(_0x208737[_0x2d2e('0x33')]!==_0x2d2e('0x43')){var _0x3cfda5={};_0x3cfda5[_0x208737[_0x2d2e('0x2d')]]={'$like':'%'+_0x329c27['query'][_0x2d2e('0x40')]+'%'};return _0x3cfda5;}})});}_0x264c4f=_[_0x2d2e('0x42')]({},_0x264c4f,_0x329c27[_0x2d2e('0x44')]);var _0x2220e6={'where':_0x264c4f['where']};return db['UserProfile'][_0x2d2e('0x45')](_0x2220e6)[_0x2d2e('0x2a')](function(_0x4328e1){_0x3df1ad[_0x2d2e('0x45')]=_0x4328e1;if(_0x329c27[_0x2d2e('0x37')][_0x2d2e('0x46')]){_0x264c4f['include']=[{'all':!![]}];}return db[_0x2d2e('0x31')][_0x2d2e('0x47')](_0x264c4f);})[_0x2d2e('0x2a')](function(_0x3fce6c){_0x3df1ad[_0x2d2e('0x48')]=_0x3fce6c;return _0x3df1ad;})[_0x2d2e('0x2a')](respondWithFilteredResult(_0x19c201,_0x264c4f))[_0x2d2e('0x49')](handleError(_0x19c201,null));};exports[_0x2d2e('0x4a')]=function(_0x2e7723,_0x462308){var _0x5b55e4={'raw':![],'where':{'id':_0x2e7723['params']['id']}},_0x4edff6={};_0x4edff6[_0x2d2e('0x35')]=_[_0x2d2e('0x36')](db[_0x2d2e('0x31')][_0x2d2e('0x4b')]);_0x4edff6['query']=_[_0x2d2e('0x36')](_0x2e7723['query']);_0x4edff6['filters']=_['intersection'](_0x4edff6[_0x2d2e('0x35')],_0x4edff6[_0x2d2e('0x37')]);_0x5b55e4['attributes']=_[_0x2d2e('0x39')](_0x4edff6[_0x2d2e('0x35')],qs[_0x2d2e('0x3a')](_0x2e7723[_0x2d2e('0x37')]['fields']));_0x5b55e4[_0x2d2e('0x3b')]=_0x5b55e4[_0x2d2e('0x3b')][_0x2d2e('0x4c')]?_0x5b55e4['attributes']:_0x4edff6[_0x2d2e('0x35')];if(_0x2e7723['query']['includeAll']){_0x5b55e4[_0x2d2e('0x4d')]=[{'all':!![]}];}_0x5b55e4=_[_0x2d2e('0x42')]({},_0x5b55e4,_0x2e7723['options']);return db[_0x2d2e('0x31')][_0x2d2e('0x4e')](_0x5b55e4)['then'](handleEntityNotFound(_0x462308,null))[_0x2d2e('0x2a')](respondWithResult(_0x462308,null))[_0x2d2e('0x49')](handleError(_0x462308,null));};exports['create']=function(_0x1f996f,_0x2bcee4){return db['UserProfile'][_0x2d2e('0x4f')](_0x1f996f['body'],{})['then'](respondWithResult(_0x2bcee4,0xc9))[_0x2d2e('0x49')](handleError(_0x2bcee4,null));};exports['clone']=function(_0x16856f,_0x38938c){var _0x5d8472={'where':{'id':_0x16856f[_0x2d2e('0x50')]['id']}},_0x130289={};_0x130289[_0x2d2e('0x35')]=_[_0x2d2e('0x36')](db[_0x2d2e('0x31')]['rawAttributes']);_0x5d8472['attributes']=_[_0x2d2e('0x39')](_0x130289[_0x2d2e('0x35')],qs[_0x2d2e('0x3a')](_0x16856f['query']['fields']));_0x5d8472[_0x2d2e('0x3b')]=_0x5d8472[_0x2d2e('0x3b')][_0x2d2e('0x4c')]?_0x5d8472[_0x2d2e('0x3b')]:_0x130289[_0x2d2e('0x35')];if(_0x16856f[_0x2d2e('0x37')]['includeAll']){_0x5d8472[_0x2d2e('0x4d')]=[{'all':!![]}];}_0x5d8472=_['merge']({},_0x5d8472,_0x16856f[_0x2d2e('0x44')]);return db[_0x2d2e('0x31')][_0x2d2e('0x4e')](_0x5d8472)[_0x2d2e('0x2a')](handleEntityNotFound(_0x38938c,null))[_0x2d2e('0x2a')](function(_0x5661ed){if(_0x5661ed){var _0x45339e=_0x5661ed[_0x2d2e('0x51')]({'plain':!![]});_0x45339e=qs[_0x2d2e('0x52')](_0x45339e,['id',_0x2d2e('0x53'),'updatedAt',_0x2d2e('0x54')]);_0x16856f[_0x2d2e('0x55')]=_[_0x2d2e('0x52')](_0x16856f[_0x2d2e('0x55')],['id','createdAt',_0x2d2e('0x56')]);return db['sequelize'][_0x2d2e('0x57')](function(_0x1a5da1){return db[_0x2d2e('0x31')]['create'](_[_0x2d2e('0x42')](_0x45339e,_0x16856f[_0x2d2e('0x55')]),{'include':_0x16856f['query'][_0x2d2e('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x1a5da1})['then'](function(_0x562fb3){var _0x1f932c=_0x562fb3[_0x2d2e('0x51')]({'plain':!![]});return db['UserProfileSection'][_0x2d2e('0x47')]({'where':{'userProfileId':_0x16856f['params']['id']},'raw':!![]})[_0x2d2e('0x2a')](function(_0x7728e4){if(_0x7728e4){return BPromise['each'](_0x7728e4,function(_0x4e27c2){return new BPromise(function(_0xf1e782,_0x13f8ad){if(_0x4e27c2[_0x2d2e('0x58')]===null||_0x4e27c2['autoAssociation']===0x1)_0xf1e782(null);return db[_0x2d2e('0x59')]['findAll']({'where':{'sectionId':_0x4e27c2['id']},'raw':!![]})[_0x2d2e('0x2a')](function(_0xa0fb83){var _0x1202a7=_[_0x2d2e('0x30')](_0xa0fb83,function(_0x474eed){return qs[_0x2d2e('0x52')](_0x474eed,['id',_0x2d2e('0x53'),'updatedAt','sectionId']);});_0xf1e782(_0x1202a7);})[_0x2d2e('0x49')](function(_0x3bfc89){_0x13f8ad(_0x3bfc89);});})[_0x2d2e('0x2a')](function(_0x4e50ba){var _0x161c2f=qs[_0x2d2e('0x52')](_0x4e27c2,['id',_0x2d2e('0x53'),_0x2d2e('0x56')]);_0x161c2f['userProfileId']=_0x1f932c['id'];if(_0x4e50ba)_0x161c2f[_0x2d2e('0x5a')]=_0x4e50ba;return _0x161c2f;})[_0x2d2e('0x2a')](function(_0x438ec3){return db['UserProfileSection'][_0x2d2e('0x4f')](_0x438ec3,{'include':[{'model':db[_0x2d2e('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x1a5da1});});})['then'](function(){return _0x1f932c;});}});});});}})['then'](respondWithResult(_0x38938c,0xc9))['catch'](handleError(_0x38938c,null));};exports[_0x2d2e('0x29')]=function(_0x5a78eb,_0x253c11){if(_0x5a78eb['body']['id']){delete _0x5a78eb[_0x2d2e('0x55')]['id'];}return db[_0x2d2e('0x31')][_0x2d2e('0x4e')]({'where':{'id':_0x5a78eb[_0x2d2e('0x50')]['id']}})[_0x2d2e('0x2a')](handleEntityNotFound(_0x253c11,null))['then'](saveUpdates(_0x5a78eb['body'],null))['then'](respondWithResult(_0x253c11,null))['catch'](handleError(_0x253c11,null));};exports[_0x2d2e('0x2b')]=function(_0x432bdf,_0x2da637){return db[_0x2d2e('0x31')]['find']({'where':{'id':_0x432bdf[_0x2d2e('0x50')]['id']}})[_0x2d2e('0x2a')](handleEntityNotFound(_0x2da637,null))[_0x2d2e('0x2a')](removeEntity(_0x2da637,null))[_0x2d2e('0x49')](handleError(_0x2da637,null));};exports[_0x2d2e('0x5b')]=function(_0x279125,_0x374e75){return db['UserProfile'][_0x2d2e('0x5b')]()[_0x2d2e('0x2a')](respondWithResult(_0x374e75,null))[_0x2d2e('0x49')](handleError(_0x374e75,null));};exports['addSections']=function(_0x553f7b,_0xfabc00){var _0x45bf8c=_0x553f7b['body'];return db['UserProfile'][_0x2d2e('0x4e')]({'where':{'id':_0x553f7b[_0x2d2e('0x50')]['id']}})['then'](handleEntityNotFound(_0xfabc00,null))[_0x2d2e('0x2a')](function(_0x1f46b6){if(_0x1f46b6){return db['sequelize'][_0x2d2e('0x57')](function(_0x23baa7){return db[_0x2d2e('0x5c')][_0x2d2e('0x2b')]({'where':{'userProfileId':_0x553f7b[_0x2d2e('0x50')]['id'],'sectionId':_[_0x2d2e('0x30')](_0x45bf8c,function(_0xbde24d){return _0xbde24d[_0x2d2e('0x5d')];})},'transaction':_0x23baa7})['then'](function(){var _0x4621b3=_[_0x2d2e('0x30')](_0x45bf8c,function(_0x3b6a76){_0x3b6a76[_0x2d2e('0x5e')]=_0x553f7b[_0x2d2e('0x50')]['id'];return _0x3b6a76;});var _0x41966b=[];return BPromise[_0x2d2e('0x5f')](_0x4621b3,function(_0x48c4d5){return db[_0x2d2e('0x5c')][_0x2d2e('0x4f')](_0x48c4d5,{'include':[{'model':db[_0x2d2e('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x23baa7})[_0x2d2e('0x2a')](function(_0x532cf4){_0x41966b[_0x2d2e('0x60')](_0x532cf4[_0x2d2e('0x51')]({'plain':!![]}));});})[_0x2d2e('0x2a')](function(){return _0x41966b;});});});}})[_0x2d2e('0x2a')](function(_0x44be00){return _0x44be00;})[_0x2d2e('0x2a')](respondWithResult(_0xfabc00,null))[_0x2d2e('0x49')](handleError(_0xfabc00,null));};exports[_0x2d2e('0x61')]=function(_0x43de5a,_0x58c652){var _0x420e64;return db[_0x2d2e('0x31')][_0x2d2e('0x4e')]({'where':{'id':_0x43de5a[_0x2d2e('0x50')]['id']},'attributes':['id',_0x2d2e('0x2d')]})[_0x2d2e('0x2a')](handleEntityNotFound(_0x58c652,null))[_0x2d2e('0x2a')](function(_0x29eba8){if(_0x29eba8){_0x420e64=_0x29eba8;return db['UserProfileSection'][_0x2d2e('0x2b')]({'where':{'userProfileId':_0x43de5a[_0x2d2e('0x50')]['id'],'sectionId':_0x43de5a[_0x2d2e('0x37')]['ids']}});}})[_0x2d2e('0x2a')](function(){return _0x420e64;})['then'](respondWithStatusCode(_0x58c652,null))[_0x2d2e('0x49')](handleError(_0x58c652,null));};exports[_0x2d2e('0x62')]=function(_0x5049b6,_0x165293){var _0xb3a141=[];var _0x427b00=[];return db[_0x2d2e('0x5c')]['findAll']({'where':{'userProfileId':_0x5049b6['params']['id']},'raw':!![]})['then'](function(_0x4eb9fa){_0xb3a141=_['filter'](_0x4eb9fa,function(_0x5373c3){return _0x5373c3[_0x2d2e('0x63')]===0x1||_[_0x2d2e('0x64')]([0x3eb,0x709],_0x5373c3[_0x2d2e('0x5d')]);});if(!_[_0x2d2e('0x65')](_0xb3a141)){return _[_0x2d2e('0x30')](_0xb3a141,function(_0x1b2314){return _0x1b2314['sectionId'];});}else{return;}})[_0x2d2e('0x2a')](function(_0x519967){if(_0x519967)_0x427b00=_0x519967;if(_[_0x2d2e('0x64')](_0x427b00,0x64)){var _0x424bc3=_[_0x2d2e('0x4e')](_0xb3a141,{'sectionId':0x64});return hasDefaultDashboard(_0x424bc3)[_0x2d2e('0x2a')](function(_0x4d9044){return _[_0x2d2e('0x30')](_0xb3a141,function(_0x57f2d1){if(_0x57f2d1['sectionId']===0x64){_0x57f2d1['subsections']=_0x4d9044;}return _0x57f2d1;});});}else{return;}})[_0x2d2e('0x2a')](function(_0x9612ea){if(_0x9612ea)_0xb3a141=_0x9612ea;if(_[_0x2d2e('0x64')](_0x427b00,0x3eb)){var _0x30155c=_[_0x2d2e('0x4e')](_0xb3a141,{'sectionId':0x3eb});return getCustomDashboards(_0x30155c)[_0x2d2e('0x2a')](function(_0x2cfa72){return _['map'](_0xb3a141,function(_0x5d80b4){if(_0x30155c[_0x2d2e('0x63')]){if(_0x5d80b4['sectionId']===0x3eb){_0x5d80b4['subsections']=_0x2cfa72;}}else{if(_0x5d80b4[_0x2d2e('0x5d')]===0x64){if(!_0x5d80b4[_0x2d2e('0x66')]){_0x5d80b4[_0x2d2e('0x66')]=[];}_0x5d80b4[_0x2d2e('0x66')]=_0x5d80b4[_0x2d2e('0x66')][_0x2d2e('0x67')](_0x2cfa72);}}return _0x5d80b4;});});}else{return;}})['then'](function(_0x4a91bd){if(_0x4a91bd)_0xb3a141=_0x4a91bd;if(_[_0x2d2e('0x64')](_0x427b00,0x709)){var _0x10ecd0=_[_0x2d2e('0x4e')](_0xb3a141,{'sectionId':0x709});return getPlugins(_0x10ecd0)[_0x2d2e('0x2a')](function(_0x5668b4){if(_0x10ecd0[_0x2d2e('0x63')]){return _[_0x2d2e('0x30')](_0xb3a141,function(_0x314a9e){if(_0x314a9e[_0x2d2e('0x5d')]===0x709){_0x314a9e[_0x2d2e('0x66')]=_0x5668b4;}return _0x314a9e;});}else{var _0x28684b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5668b4};var _0x5e057b=_[_0x2d2e('0x30')](_0xb3a141);_0x5e057b[_0x2d2e('0x60')](_0x28684b);return _0x5e057b;}});}else{return;}})['then'](function(_0x147f8f){if(_0x147f8f)_0xb3a141=_0x147f8f;return _[_0x2d2e('0x40')](_0xb3a141,[_0x2d2e('0x63'),0x1]);})[_0x2d2e('0x2a')](respondWithResult(_0x165293,null))[_0x2d2e('0x49')](handleError(_0x165293,null));};function hasDefaultDashboard(_0x4226c9){var _0x324e03=[0x65];return new BPromise(function(_0x5034d0,_0x64e772){try{if(_0x4226c9[_0x2d2e('0x58')]){_0x5034d0(_0x324e03);}else{return db[_0x2d2e('0x59')][_0x2d2e('0x68')]({'where':{'sectionId':_0x4226c9['id']},'raw':!![]})[_0x2d2e('0x2a')](function(_0x3bb65e){_0x3bb65e?_0x5034d0(_0x324e03):_0x5034d0();});}}catch(_0x37e940){_0x64e772(_0x37e940);}});}function getCustomDashboards(_0x2e488d){var _0x31b563=[];return new BPromise(function(_0x46c0e0,_0x30b3be){try{if(_0x2e488d['autoAssociation']){return db['Dashboard'][_0x2d2e('0x47')]({'raw':!![]})[_0x2d2e('0x2a')](function(_0x1f6de9){_0x1f6de9[_0x2d2e('0x69')](function(_0x5ca0fb){_0x31b563[_0x2d2e('0x60')](_0x5ca0fb['id']+0x1869f);});_0x46c0e0(_0x31b563);});}else{return db[_0x2d2e('0x59')][_0x2d2e('0x47')]({'where':{'sectionId':_0x2e488d['id']},'raw':!![]})[_0x2d2e('0x2a')](function(_0x2457f5){_0x2457f5[_0x2d2e('0x69')](function(_0x40a512){_0x31b563[_0x2d2e('0x60')](_0x40a512[_0x2d2e('0x6a')]+0x1869f);});_0x46c0e0(_0x31b563);});}}catch(_0x263d3c){_0x30b3be(_0x263d3c);}});}function getPlugins(_0x4c43d4){var _0xb6fc38=[];return new BPromise(function(_0x1def3d,_0x18b094){try{if(_0x4c43d4['autoAssociation']){return db[_0x2d2e('0x6b')][_0x2d2e('0x47')]({'raw':!![]})[_0x2d2e('0x2a')](function(_0x468fd1){_0x468fd1[_0x2d2e('0x69')](function(_0x4a0019){_0xb6fc38[_0x2d2e('0x60')](_0x4a0019['id']+0x15b38);});_0x1def3d(_0xb6fc38);});}else{return db[_0x2d2e('0x59')][_0x2d2e('0x47')]({'where':{'sectionId':_0x4c43d4['id']},'raw':!![]})[_0x2d2e('0x2a')](function(_0x264ca2){_0x264ca2[_0x2d2e('0x69')](function(_0x2a469f){_0xb6fc38['push'](_0x2a469f[_0x2d2e('0x6a')]+0x15b38);});_0x1def3d(_0xb6fc38);});}}catch(_0x43fbba){_0x18b094(_0x43fbba);}});}exports[_0x2d2e('0x6c')]=function(_0x2a8677,_0x24268f){return db['UserProfile']['find']({'where':{'id':_0x2a8677[_0x2d2e('0x50')]['id']}})['then'](handleEntityNotFound(_0x24268f,null))['then'](function(_0x10f306){if(_0x10f306){return db['sequelize']['transaction'](function(_0x12c064){return db['UserProfileSection'][_0x2d2e('0x47')]({'where':{'userProfileId':_0x2a8677[_0x2d2e('0x50')]['id']},'attributes':['id'],'raw':!![]})[_0x2d2e('0x2a')](function(_0x26088a){if(_0x26088a){return db[_0x2d2e('0x5c')][_0x2d2e('0x2b')]({'where':{'userProfileId':_0x2a8677[_0x2d2e('0x50')]['id'],'id':_[_0x2d2e('0x30')](_0x26088a,function(_0x40531e){return _0x40531e['id'];})},'transaction':_0x12c064});}})[_0x2d2e('0x2a')](function(_0x399ed1){var _0x2b4fdb=_['map'](_0x2a8677['body'],function(_0x10cc52){_0x10cc52[_0x2d2e('0x5e')]=_0x2a8677[_0x2d2e('0x50')]['id'];return _0x10cc52;});return db[_0x2d2e('0x5c')][_0x2d2e('0x6d')](_0x2b4fdb,{'raw':!![],'transaction':_0x12c064});})['then'](function(_0x465ce2){var _0x232f3c=_[_0x2d2e('0x40')](_[_0x2d2e('0x30')](_0x465ce2,function(_0x28a291){return _0x28a291[_0x2d2e('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x232f3c){return db[_0x2d2e('0x5c')][_0x2d2e('0x47')]({'where':{'userProfileId':_0x2a8677[_0x2d2e('0x50')]['id'],'sectionId':_[_0x2d2e('0x30')](_0x232f3c,function(_0x4a82ab){return _0x4a82ab[_0x2d2e('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x2d2e('0x2a')](function(_0x1b60fa){var _0x442079=_[_0x2d2e('0x30')](_0x2a8677['body'],function(_0x4c2bf5){_0x4c2bf5[_0x2d2e('0x5e')]=_0x2a8677['params']['id'];return _0x4c2bf5;});return db['UserProfileResource'][_0x2d2e('0x6d')](_0x442079,{'raw':!![],'transaction':_0x12c064});});}})[_0x2d2e('0x49')](handleError(_0x24268f,null));});}})['then'](function(_0x156e4d){var _0x5c29d7=_[_0x2d2e('0x30')](_0x156e4d,function(_0x542b69){return _0x542b69['get']({'plain':!![]});});})[_0x2d2e('0x2a')](respondWithResult(_0x24268f,null))[_0x2d2e('0x49')](handleError(_0x24268f,null));};exports['removeResources']=function(_0x4428d1,_0x44c08c,_0x3d1511){return db[_0x2d2e('0x31')][_0x2d2e('0x4e')]({'where':{'id':_0x4428d1[_0x2d2e('0x50')]['id']}})['then'](handleEntityNotFound(_0x44c08c,null))[_0x2d2e('0x2a')](function(_0x4d84ff){if(_0x4d84ff){return _0x4d84ff[_0x2d2e('0x6e')](_0x4428d1[_0x2d2e('0x37')][_0x2d2e('0x6f')]);}})[_0x2d2e('0x2a')](respondWithStatusCode(_0x44c08c,null))[_0x2d2e('0x49')](handleError(_0x44c08c,null));};exports[_0x2d2e('0x70')]=function(_0x5d31e8,_0x2797b7){var _0x4d84d1={};if(!_0x5d31e8['query'][_0x2d2e('0x71')])throw new Error(_0x2d2e('0x72'));if(!_0x5d31e8[_0x2d2e('0x37')][_0x2d2e('0x3c')](_0x2d2e('0x3d'))){_0x4d84d1[_0x2d2e('0x23')]=qs[_0x2d2e('0x23')](_0x5d31e8[_0x2d2e('0x37')][_0x2d2e('0x23')]);_0x4d84d1['offset']=qs[_0x2d2e('0x22')](_0x5d31e8[_0x2d2e('0x37')]['offset']);}return db[_0x2d2e('0x31')]['find']({'where':{'id':_0x5d31e8[_0x2d2e('0x50')]['id']}})[_0x2d2e('0x2a')](function(_0x1d3f14){if(!_0x1d3f14)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5d31e8[_0x2d2e('0x50')]['id']);return db[_0x2d2e('0x31')][_0x2d2e('0x70')](_0x5d31e8);})[_0x2d2e('0x2a')](respondWithFilteredResult(_0x2797b7,_0x4d84d1))[_0x2d2e('0x49')](handleError(_0x2797b7,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index bfba2bf..581f878 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 _0x4c60=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','update'];(function(_0x4916f8,_0x16a75e){var _0x19edfd=function(_0x1165f2){while(--_0x1165f2){_0x4916f8['push'](_0x4916f8['shift']());}};_0x19edfd(++_0x16a75e);}(_0x4c60,0xc1));var _0x04c6=function(_0x573c48,_0x42cd67){_0x573c48=_0x573c48-0x0;var _0x51da8a=_0x4c60[_0x573c48];return _0x51da8a;};'use strict';var EventEmitter=require(_0x04c6('0x0'));var UserProfile=require(_0x04c6('0x1'))['db'][_0x04c6('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x04c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x04c6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x52a464){return function(_0x4ad4f1,_0x53ca7a,_0x3a9493){UserProfileEvents[_0x04c6('0x5')](_0x52a464+':'+_0x4ad4f1['id'],_0x4ad4f1);UserProfileEvents[_0x04c6('0x5')](_0x52a464,_0x4ad4f1);_0x3a9493(null);};}for(var e in events){if(events[_0x04c6('0x6')](e)){var event=events[e];UserProfile[_0x04c6('0x7')](e,emitEvent(event));}}module[_0x04c6('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x9264=['hasOwnProperty','hook','events','../../mysqldb','UserProfile','setMaxListeners','remove'];(function(_0x12279c,_0x41f84f){var _0x3db606=function(_0x5012d3){while(--_0x5012d3){_0x12279c['push'](_0x12279c['shift']());}};_0x3db606(++_0x41f84f);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4926('0x0'));var UserProfile=require(_0x4926('0x1'))['db'][_0x4926('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x4926('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4926('0x4')};function emitEvent(_0x483fdd){return function(_0x49b167,_0x1a2246,_0x4e0848){UserProfileEvents['emit'](_0x483fdd+':'+_0x49b167['id'],_0x49b167);UserProfileEvents['emit'](_0x483fdd,_0x49b167);_0x4e0848(null);};}for(var e in events){if(events[_0x4926('0x5')](e)){var event=events[e];UserProfile[_0x4926('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index ffe785b..04097a4 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 _0x05f8=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','autoAssociation','includeAll','include','reportType','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','extraQueryConditions','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','dataValues','mail','openchannel','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','map','catch','model','then','associatedResources','name','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','odbc','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','CmContact','ListId','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','Plugin','extractedreports','Reports','reportId','metrics','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','user_profiles','../../components/parsers/qs','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','all','ignore','union','length','find','rawAttributes','keys'];(function(_0x5a926f,_0x4ba86a){var _0x20af18=function(_0xbfe34a){while(--_0xbfe34a){_0x5a926f['push'](_0x5a926f['shift']());}};_0x20af18(++_0x4ba86a);}(_0x05f8,0x1b3));var _0x805f=function(_0x2eb3b8,_0x2b09aa){_0x2eb3b8=_0x2eb3b8-0x0;var _0x45d8df=_0x05f8[_0x2eb3b8];return _0x45d8df;};'use strict';var _=require(_0x805f('0x0'));var attributes=require(_0x805f('0x1'));var squel=require(_0x805f('0x2'));module[_0x805f('0x3')]=function(_0x35a1f8){var _0x1df381=_0x35a1f8[_0x805f('0x4')];function _0x398a99(_0x137251,_0x5ce0b9){return new Promise(function(_0x18b3b9,_0x13f2d7){if(!_0x5ce0b9)return _0x18b3b9(null);var _0x5c773b=_0x5ce0b9[_0x805f('0x5')]?{[_0x5ce0b9[_0x805f('0x5')][_0x805f('0x6')]]:_0x5ce0b9['filter'][_0x805f('0x7')]}:undefined;return _0x1df381[_0x137251][_0x805f('0x8')]({'where':_0x5c773b,'raw':!![]})['then'](function(_0x3439eb){_0x5ce0b9['associatedResources']=_[_0x805f('0x9')](_0x3439eb,'id');_0x18b3b9(_0x5ce0b9);})[_0x805f('0xa')](function(_0x320c1a){_0x13f2d7(_0x320c1a);});});}function _0x3d4a1f(_0x2a64d5,_0x19b9ef){return new Promise(function(_0x4474f4,_0x4dba02){var _0x12ee76=_0x2a64d5[_0x805f('0x5')]?{[_0x2a64d5[_0x805f('0x5')][_0x805f('0x6')]]:_0x2a64d5[_0x805f('0x5')]['value']}:undefined;return _0x1df381[_0x2a64d5[_0x805f('0xb')]][_0x805f('0x8')]({'where':_0x12ee76,'raw':!![]})[_0x805f('0xc')](function(_0xb3f701){_0x19b9ef[_0x805f('0xd')]=_['map'](_0xb3f701,function(_0x3da37b){return _0x3da37b[_0x805f('0xe')];});_0x4474f4(_0x19b9ef);})[_0x805f('0xa')](function(_0x5a78b8){_0x4dba02(_0x5a78b8);});});}function _0x255ffd(_0x4fbb3e,_0x474fb6,_0x353da2){if(!_0x474fb6)return Promise[_0x805f('0xf')](null);return new Promise(function(_0x539597,_0x416094){return _0x1df381['UserProfileResource'][_0x805f('0x8')]({'where':{'sectionId':_0x474fb6['id']},'raw':!![]})[_0x805f('0xc')](function(_0x26913f){if(_0x4fbb3e[_0x805f('0x6')]&&_0x4fbb3e[_0x805f('0x6')]!=='id'){_0x474fb6[_0x805f('0xd')]=_[_0x805f('0x9')](_0x26913f,function(_0x2fecc0){return _0x2fecc0[_0x4fbb3e[_0x805f('0x6')]];});}else{if(_0x353da2===_0x805f('0x10')){_0x474fb6[_0x805f('0xd')]=_[_0x805f('0x9')](_0x26913f,function(_0x487d77){return{'id':_0x487d77[_0x805f('0x11')],'type':_0x487d77['type']};});}else{_0x474fb6[_0x805f('0xd')]=_['map'](_0x26913f,function(_0x2b7a20){return _0x2b7a20[_0x805f('0x11')];});}}_0x539597(_0x474fb6);})[_0x805f('0xa')](function(_0x150358){_0x416094(_0x150358);});});}function _0x5b1d85(_0x47722a,_0x3ae8a2){var _0xba8768={'parentSections':[]};switch(_0x47722a[_0x805f('0x12')]()){case _0x805f('0x13'):_0xba8768['childModel']='SquareProject';break;case _0x805f('0x14'):_0xba8768[_0x805f('0x15')]=_0x805f('0x16');break;case _0x805f('0x17'):_0xba8768[_0x805f('0x15')]=_0x805f('0x18');_0xba8768[_0x805f('0x19')]=[{'name':_0x805f('0x1a'),'field':_0x805f('0xe'),'foreignKey':_0x805f('0x1b')}];break;case _0x805f('0x1c'):_0xba8768[_0x805f('0x15')]=_0x805f('0x1d');break;case'contacts':_0xba8768[_0x805f('0x15')]=_0x805f('0x1e');_0xba8768[_0x805f('0x19')]=[{'name':'Lists','field':'id','foreignKey':_0x805f('0x1f')}];break;case'lists':_0xba8768[_0x805f('0x15')]=_0x805f('0x20');break;case _0x805f('0x21'):_0xba8768[_0x805f('0x15')]=_0x805f('0x22');break;case _0x805f('0x23'):_0xba8768[_0x805f('0x15')]=_0x805f('0x24');break;case _0x805f('0x25'):_0xba8768[_0x805f('0x15')]='ChatQueue';break;case'chatwebsites':_0xba8768[_0x805f('0x15')]=_0x805f('0x26');break;case _0x805f('0x27'):_0xba8768[_0x805f('0x15')]=_0x805f('0x28');break;case'faxaccounts':_0xba8768[_0x805f('0x15')]=_0x805f('0x29');break;case _0x805f('0x2a'):case _0x805f('0x2b'):case _0x805f('0x2c'):_0xba8768['childModel']=_0x805f('0x2d');break;case _0x805f('0x2e'):_0xba8768[_0x805f('0x15')]=_0x805f('0x2f');break;case'voicemails':_0xba8768['childModel']=_0x805f('0x30');break;case'voicerecordings':_0xba8768[_0x805f('0x15')]=_0x805f('0x31');_0xba8768[_0x805f('0x19')]=[{'name':_0x805f('0x32'),'field':_0x805f('0xe'),'foreignKey':_0x805f('0x33'),'model':'User','filter':{'field':_0x805f('0x34'),'value':[_0x805f('0x35')]}},{'name':_0x805f('0x36'),'field':_0x805f('0xe'),'foreignKey':_0x805f('0x33'),'model':_0x805f('0x37'),'filter':{'field':_0x805f('0x34'),'value':[_0x805f('0x38')]}},{'name':_0x805f('0x39'),'field':_0x805f('0xe'),'foreignKey':_0x805f('0x3a'),'model':_0x805f('0x3b'),'filter':{'field':_0x805f('0x3c'),'value':[_0x805f('0x3d')]}},{'name':_0x805f('0x3e'),'field':_0x805f('0xe'),'foreignKey':_0x805f('0x3a'),'model':_0x805f('0x3b'),'filter':{'field':_0x805f('0x3c'),'value':[_0x805f('0x3f')]}}];break;case _0x805f('0x40'):_0xba8768['childModel']=_0x805f('0x41');break;case _0x805f('0x42'):_0xba8768[_0x805f('0x15')]='VoiceChanSpy';break;case _0x805f('0x43'):_0xba8768[_0x805f('0x15')]=_0x805f('0x44');break;case'ivrcampaigns':_0xba8768['childModel']=_0x805f('0x45');break;case _0x805f('0x46'):_0xba8768[_0x805f('0x15')]=_0x805f('0x47');break;case _0x805f('0x48'):_0xba8768['childModel']='MailAccount';break;case _0x805f('0x49'):_0xba8768[_0x805f('0x15')]=_0x805f('0x4a');break;case _0x805f('0x4b'):_0xba8768[_0x805f('0x15')]='OpenchannelQueue';break;case _0x805f('0x4c'):_0xba8768['childModel']='OpenchannelAccount';break;case _0x805f('0x4d'):_0xba8768[_0x805f('0x15')]='SmsQueue';break;case _0x805f('0x4e'):_0xba8768[_0x805f('0x15')]=_0x805f('0x4f');break;case _0x805f('0x50'):_0xba8768[_0x805f('0x15')]='WhatsappQueue';break;case _0x805f('0x51'):_0xba8768[_0x805f('0x15')]=_0x805f('0x52');break;case _0x805f('0x53'):_0xba8768[_0x805f('0x15')]=_0x805f('0x54');break;case _0x805f('0x55'):case _0x805f('0x56'):_0xba8768[_0x805f('0x15')]='VoiceQueue';if(_0x3ae8a2){_0xba8768[_0x805f('0x19')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x805f('0x57'):case _0x805f('0x58'):case _0x805f('0x59'):_0xba8768[_0x805f('0x15')]=_0x805f('0x37');if(_0x3ae8a2){_0xba8768[_0x805f('0x19')]=[{'name':'Users','filter':{'field':_0x805f('0x34'),'value':[_0x805f('0x5a'),_0x805f('0x5b')]},'ignore':!![]},{'name':_0x805f('0x32')},{'name':_0x805f('0x36')}];}break;case _0x805f('0x5c'):_0xba8768[_0x805f('0x15')]=_0x805f('0x5d');break;case'salesforceaccounts':_0xba8768[_0x805f('0x15')]='SalesforceAccount';break;case _0x805f('0x5e'):_0xba8768[_0x805f('0x15')]=_0x805f('0x5f');break;case'sugarcrmaccounts':_0xba8768[_0x805f('0x15')]=_0x805f('0x60');break;case _0x805f('0x61'):_0xba8768['childModel']=_0x805f('0x62');break;case _0x805f('0x63'):_0xba8768[_0x805f('0x15')]=_0x805f('0x64');break;case _0x805f('0x65'):_0xba8768[_0x805f('0x15')]=_0x805f('0x37');break;case _0x805f('0x66'):_0xba8768['childModel']=_0x805f('0x67');break;case _0x805f('0x68'):_0xba8768[_0x805f('0x15')]=_0x805f('0x69');break;case'customdashboards':_0xba8768[_0x805f('0x15')]=_0x805f('0x6a');break;case _0x805f('0x6b'):_0xba8768[_0x805f('0x15')]='Interval';break;case'pauses':_0xba8768['childModel']=_0x805f('0x6c');break;case _0x805f('0x6d'):_0xba8768[_0x805f('0x15')]=_0x805f('0x6e');break;case _0x805f('0x6f'):_0xba8768[_0x805f('0x15')]=_0x805f('0x70');break;case _0x805f('0x71'):_0xba8768['childModel']=_0x805f('0x72');break;case _0x805f('0x73'):_0xba8768[_0x805f('0x15')]=_0x805f('0x74');break;case _0x805f('0x75'):_0xba8768['childModel']=_0x805f('0x76');break;case _0x805f('0x77'):_0xba8768['childModel']=_0x805f('0x78');break;case'variables':_0xba8768[_0x805f('0x15')]=_0x805f('0x79');break;case'plugins':_0xba8768[_0x805f('0x15')]=_0x805f('0x7a');break;case _0x805f('0x7b'):_0xba8768[_0x805f('0x15')]='AnalyticExtractedReport';_0xba8768[_0x805f('0x19')]=[{'name':_0x805f('0x7c'),'field':'id','foreignKey':_0x805f('0x7d')}];break;case _0x805f('0x7e'):_0xba8768[_0x805f('0x15')]='AnalyticMetric';break;}return _0xba8768;}function _0x4c1506(_0x3a7b3b,_0x2261f6){var _0x8ccb89=_0x3a7b3b[_0x805f('0x7f')](0x0)[_0x805f('0x80')]()+_0x3a7b3b['slice'](0x1);var _0x5c3531={'type':_0x1df381[_0x805f('0x81')][_0x805f('0x82')][_0x805f('0x83')],'raw':!![]};return new Promise(function(_0x290800,_0x419589){var _0x21784c=squel[_0x805f('0x84')]()[_0x805f('0x6')](_0x805f('0x85')+_0x8ccb89+_0x805f('0x86'),'id')['field'](_0x805f('0x87'))[_0x805f('0x88')](_0x805f('0x89')+_0x3a7b3b+_0x805f('0x8a'),'ui')[_0x805f('0x8b')](_0x805f('0x8c'),_0x2261f6['id']);return _0x1df381[_0x805f('0x8d')][_0x805f('0x8e')](_0x21784c['toString'](),_0x5c3531)[_0x805f('0xc')](function(_0x5c2587){_0x2261f6[_0x8ccb89+'OpenTabs']=_0x5c2587;_0x290800(_0x5c2587);})[_0x805f('0xa')](function(_0xea2362){_0x419589(_0xea2362);});});}return _0x35a1f8[_0x805f('0x8f')](_0x805f('0x90'),attributes,{'tableName':_0x805f('0x91'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x241f52){var _0x8d660e=require(_0x805f('0x92'));var _0x429455={'raw':_0x241f52[_0x805f('0x8e')]['raw'],'where':{}};var _0x4bc2dc={};var _0xb505cd={'count':0x0,'rows':[]};var _0x4a69cf=_0x241f52[_0x805f('0x8e')][_0x805f('0x93')];var _0x548f63=_0x241f52[_0x805f('0x8e')]['mergeResources']||![];var _0x1cb310=_0x5b1d85(_0x4a69cf,_0x548f63);if(!_0x1cb310[_0x805f('0x15')])throw new Error(_0x805f('0x94')+_0x4a69cf+'\x27');var _0x59ee2=[{'name':_0x4a69cf}];if(!_[_0x805f('0x95')](_0x1cb310[_0x805f('0x19')]))_0x59ee2=_0x1cb310[_0x805f('0x19')];var _0x2e6b70=[];for(var _0x44615e=0x0;_0x44615e<_0x59ee2['length'];_0x44615e++){_0x2e6b70[_0x805f('0x96')](_0x1df381[_0x805f('0x97')]['find']({'where':{'userProfileId':_0x241f52['params']['id'],'name':_0x59ee2[_0x44615e][_0x805f('0xe')]},'raw':!![]}));}return Promise[_0x805f('0x98')](_0x2e6b70)[_0x805f('0xc')](function(_0x3d65b3){var _0x58449b=_[_0x805f('0x5')](_0x3d65b3,function(_0x31a839){return _0x31a839?_0x31a839:undefined;});var _0x4aa837=_['filter'](_0x59ee2,[_0x805f('0x99'),!![]]);var _0x5b05be=_['isEmpty'](_0x58449b)&&_['isEmpty'](_0x4aa837)?null:_[_0x805f('0x9a')](_0x4aa837,_0x58449b);if(!_0x5b05be)return null;var _0x2d1516=[];for(var _0x5de315=0x0;_0x5de315<_0x5b05be[_0x805f('0x9b')];_0x5de315++){var _0x3017fd=_[_0x805f('0x9c')](_0x59ee2,function(_0xdb5d4e){return _0x5b05be[_0x5de315]?_0xdb5d4e[_0x805f('0xe')]===_0x5b05be[_0x5de315]['name']:null;});if(_0x3017fd){if(_0x5b05be[_0x5de315]['ignore']){_0x2d1516['push'](_0x398a99(_0x1cb310[_0x805f('0x15')],_0x5b05be[_0x5de315]));}else{if(!_0x5b05be[_0x5de315]['autoAssociation']){_0x2d1516['push'](_0x255ffd(_0x3017fd,_0x5b05be[_0x5de315],_0x1cb310[_0x805f('0x15')]));}else{if(_0x3017fd[_0x805f('0xb')]){_0x2d1516[_0x805f('0x96')](_0x3d4a1f(_0x3017fd,_0x5b05be[_0x5de315]));}}}}}return Promise[_0x805f('0x98')](_0x2d1516);})['then'](function(_0x1e665a){var _0x526cce=_0x1e665a;var _0x5727ac=null;if(_0x526cce){_0x5727ac=_0x526cce['length']===0x1?_0x526cce[0x0]:null;}if(!_0x5727ac&&!_0x526cce)return _0xb505cd;var _0x61e8e3=_0x1df381[_0x1cb310[_0x805f('0x15')]][_0x805f('0x9d')];_0x4bc2dc['model']=_[_0x805f('0x9e')](_0x61e8e3);_0x4bc2dc[_0x805f('0x8e')]=_['keys'](_0x241f52[_0x805f('0x8e')]);_0x4bc2dc[_0x805f('0x9f')]=_[_0x805f('0xa0')](_0x4bc2dc[_0x805f('0xb')],_0x4bc2dc[_0x805f('0x8e')]);_0x429455[_0x805f('0xa1')]=_[_0x805f('0xa0')](_0x4bc2dc['model'],_0x8d660e[_0x805f('0xa2')](_0x241f52['query'][_0x805f('0xa2')]));_0x429455[_0x805f('0xa1')]=_0x429455[_0x805f('0xa1')]['length']?_0x429455[_0x805f('0xa1')]:_0x4bc2dc['model'];if(!_0x241f52['query'][_0x805f('0xa3')](_0x805f('0xa4'))){_0x429455[_0x805f('0xa5')]=_0x8d660e[_0x805f('0xa5')](_0x241f52[_0x805f('0x8e')][_0x805f('0xa5')]);_0x429455[_0x805f('0xa6')]=_0x8d660e[_0x805f('0xa6')](_0x241f52[_0x805f('0x8e')]['offset']);}_0x429455['order']=_0x8d660e['sort'](_0x241f52[_0x805f('0x8e')][_0x805f('0xa7')]);_0x429455['where']=_0x8d660e[_0x805f('0x9f')](_[_0x805f('0xa8')](_0x241f52[_0x805f('0x8e')],_0x4bc2dc[_0x805f('0x9f')]));if(_0x241f52[_0x805f('0x8e')][_0x805f('0x5')]){_0x429455[_0x805f('0x8b')]=_[_0x805f('0xa9')](_0x429455['where'],{'$or':_[_0x805f('0x9')](_0x61e8e3,function(_0x17dd66){if(_0x17dd66['type'][_0x805f('0xaa')]!==_0x805f('0xab')){var _0x1f593e={};_0x1f593e[_0x17dd66['field']]={'$like':'%'+_0x241f52['query'][_0x805f('0x5')]+'%'};return _0x1f593e;}})});}var _0x1cbae2=[];var _0x180eaa=null;var _0x4fb586={};if(_0x5727ac){_0x180eaa=_['find'](_0x59ee2,[_0x805f('0xe'),_0x5727ac[_0x805f('0xe')]]);if(_0x180eaa['field']){_0x4fb586={};if(_0x1cb310[_0x805f('0x15')]==='AnalyticExtractedReport'){_0x4fb586[_0x180eaa[_0x805f('0xac')]]=_[_0x805f('0x9')](_0x5727ac['associatedResources'],'id');}else{_0x4fb586[_0x180eaa['foreignKey']]=_0x5727ac[_0x805f('0xd')];}_0x1cbae2['push'](_0x4fb586);}else{_0x429455[_0x805f('0x8b')]['id']=_0x5727ac[_0x805f('0xd')];}}else{for(var _0x220cb9=0x0;_0x220cb9<_0x526cce[_0x805f('0x9b')];_0x220cb9++){_0x180eaa=_[_0x805f('0x9c')](_0x59ee2,['name',_0x526cce[_0x220cb9][_0x805f('0xe')]]);if(_0x180eaa[_0x805f('0x6')]){_0x4fb586={};_0x4fb586[_0x180eaa[_0x805f('0xac')]]=_0x526cce[_0x220cb9][_0x805f('0xd')];_0x1cbae2['push'](_0x4fb586);}else{if(!_0x429455[_0x805f('0x8b')]['id'])_0x429455[_0x805f('0x8b')]['id']=[];_0x526cce[_0x220cb9]['associatedResources'][_0x805f('0xad')](function(_0x4f9189){_0x429455[_0x805f('0x8b')]['id'][_0x805f('0x96')](_0x4f9189);});}}}if(!_['isEmpty'](_0x1cbae2)){_0x429455[_0x805f('0x8b')]=_['merge'](_0x429455[_0x805f('0x8b')],{'$and':{'$or':_0x1cbae2}});}_0x429455=_['merge']({},_0x429455,_0x241f52['options']);if(_0x5727ac&&!_0x5727ac[_0x805f('0xae')]&&_0x1cb310[_0x805f('0x15')]===_0x805f('0x10')){if(_0x241f52[_0x805f('0x8e')][_0x805f('0xaf')]){_0x429455[_0x805f('0xb0')]=[{'all':!![]}];}return _0x1df381[_0x1cb310['childModel']]['findAll'](_0x429455)['then'](function(_0x5d8443){var _0x230942=[];_0x5d8443['forEach'](function(_0x2c6f54){var _0x21b135;switch(_0x2c6f54[_0x805f('0xb1')]){case'default':_0x21b135=_[_0x805f('0x9c')](_0x5727ac[_0x805f('0xd')],function(_0x37b47c){return _0x37b47c['id']===_0x2c6f54[_0x805f('0x7d')]&&_0x37b47c[_0x805f('0x3c')]===_0x805f('0xb2');});break;case _0x805f('0xb3'):_0x21b135=_[_0x805f('0x9c')](_0x5727ac[_0x805f('0xd')],function(_0x2e0468){return _0x2e0468['id']===_0x2c6f54[_0x805f('0x7d')]&&_0x2e0468[_0x805f('0x3c')]===_0x805f('0xb4');});break;}if(_0x21b135)_0x230942[_0x805f('0x96')](_0x2c6f54);});_0xb505cd[_0x805f('0xb5')]=_0x230942['length'];_0xb505cd[_0x805f('0xb6')]=_0x230942;return _0xb505cd;});}else{if(!_[_0x805f('0x95')](_0x241f52[_0x805f('0x8e')]['ids'])){_0x429455[_0x805f('0x8b')]['id']=_0x429455[_0x805f('0x8b')]['id']?_[_0x805f('0xa0')](_0x429455[_0x805f('0x8b')]['id'],_0x241f52[_0x805f('0x8e')][_0x805f('0xb7')]):_0x241f52['query'][_0x805f('0xb7')];if(_0x241f52[_0x805f('0x8e')][_0x805f('0xb8')]){_0x429455[_0x805f('0xb9')]=_0x241f52[_0x805f('0x8e')][_0x805f('0xb8')];}}if(_0x241f52[_0x805f('0x8e')][_0x805f('0xba')]){_0x429455[_0x805f('0x8b')]=_[_0x805f('0xa9')](_0x429455[_0x805f('0x8b')],{'$and':_0x241f52['query']['extraQueryConditions']});}return _0x1df381[_0x1cb310[_0x805f('0x15')]][_0x805f('0xb5')]({'where':_0x429455[_0x805f('0x8b')]})['then'](function(_0x1314b2){_0xb505cd['count']=_0x1314b2;if(_0x241f52['query'][_0x805f('0xaf')]){if(_0x1cb310['childModel']===_0x805f('0x1e')){_0x429455[_0x805f('0xb0')]=[{'model':_0x1df381[_0x805f('0x72')],'as':_0x805f('0xbb'),'attributes':['id',_0x805f('0xe'),_0x805f('0xbc')],'required':_0x241f52[_0x805f('0x8e')][_0x805f('0xbd')]?!![]:![]},{'model':_0x1df381[_0x805f('0x72')],'as':_0x805f('0xbe'),'attributes':['id',_0x805f('0xe'),_0x805f('0xbc')],'through':_0x241f52[_0x805f('0x8e')][_0x805f('0xbd')]?{'attributes':[],'where':{'TagId':_0x241f52[_0x805f('0x8e')]['tag']||undefined}}:{},'required':_0x241f52[_0x805f('0x8e')][_0x805f('0xbd')]?!![]:![]}];}else{_0x429455[_0x805f('0xb0')]=[{'all':!![]}];}}return _0x1df381[_0x1cb310['childModel']]['findAll'](_0x429455);})[_0x805f('0xc')](function(_0x3a0e56){_0xb505cd[_0x805f('0xb6')]=_0x3a0e56;if(_0x4a69cf===_0x805f('0x32')&&_0x241f52[_0x805f('0x8e')][_0x805f('0xbf')]===_0x805f('0xc0')){var _0x4f7cc5=[];for(var _0x5f5648=0x0;_0x5f5648<_0xb505cd[_0x805f('0xb6')][_0x805f('0x9b')];_0x5f5648++){_0x4f7cc5['push'](_0x4c1506(_0x805f('0xc1'),_0xb505cd[_0x805f('0xb6')][_0x5f5648]['dataValues']));_0x4f7cc5[_0x805f('0x96')](_0x4c1506(_0x805f('0xc2'),_0xb505cd[_0x805f('0xb6')][_0x5f5648][_0x805f('0xc3')]));_0x4f7cc5[_0x805f('0x96')](_0x4c1506('fax',_0xb505cd[_0x805f('0xb6')][_0x5f5648][_0x805f('0xc3')]));_0x4f7cc5[_0x805f('0x96')](_0x4c1506(_0x805f('0xc4'),_0xb505cd[_0x805f('0xb6')][_0x5f5648]['dataValues']));_0x4f7cc5[_0x805f('0x96')](_0x4c1506(_0x805f('0xc5'),_0xb505cd[_0x805f('0xb6')][_0x5f5648][_0x805f('0xc3')]));_0x4f7cc5[_0x805f('0x96')](_0x4c1506('whatsapp',_0xb505cd['rows'][_0x5f5648][_0x805f('0xc3')]));}return Promise[_0x805f('0x98')](_0x4f7cc5)[_0x805f('0xc')](function(){return _0xb505cd;});}return _0xb505cd;});}});}}});}; \ No newline at end of file +var _0xe2f3=['mail','openchannel','whatsapp','lodash','./userProfile.attributes','exports','models','filter','field','then','associatedResources','map','catch','value','model','findAll','name','resolve','UserProfileResource','AnalyticExtractedReport','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','Lists','lists','CmList','companies','CmCompany','chatqueues','chatwebsites','ChatWebsite','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceMail','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','Disposition','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','triggers','Trigger','Trunk','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','ui.UserId\x20=\x20?','query','toString','define','UserProfile','../../components/parsers/qs','raw','section','mergeResources','isEmpty','length','push','find','params','all','ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','color','tag','ThroughTags','true','chat','dataValues','fax'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe2f3,0x181));var _0x3e2f=function(_0x2a8cb7,_0x314d29){_0x2a8cb7=_0x2a8cb7-0x0;var _0x183a1f=_0xe2f3[_0x2a8cb7];return _0x183a1f;};'use strict';var _=require(_0x3e2f('0x0'));var attributes=require(_0x3e2f('0x1'));var squel=require('squel');module[_0x3e2f('0x2')]=function(_0x14374c){var _0x217fb8=_0x14374c[_0x3e2f('0x3')];function _0x10a45a(_0x7b8eb,_0x466c35){return new Promise(function(_0x3528aa,_0x111c2f){if(!_0x466c35)return _0x3528aa(null);var _0x417685=_0x466c35[_0x3e2f('0x4')]?{[_0x466c35[_0x3e2f('0x4')][_0x3e2f('0x5')]]:_0x466c35[_0x3e2f('0x4')]['value']}:undefined;return _0x217fb8[_0x7b8eb]['findAll']({'where':_0x417685,'raw':!![]})[_0x3e2f('0x6')](function(_0x373587){_0x466c35[_0x3e2f('0x7')]=_[_0x3e2f('0x8')](_0x373587,'id');_0x3528aa(_0x466c35);})[_0x3e2f('0x9')](function(_0x1175be){_0x111c2f(_0x1175be);});});}function _0x2647a0(_0x3527a8,_0x5e20be){return new Promise(function(_0xd132b4,_0x4ee837){var _0x488512=_0x3527a8[_0x3e2f('0x4')]?{[_0x3527a8[_0x3e2f('0x4')][_0x3e2f('0x5')]]:_0x3527a8[_0x3e2f('0x4')][_0x3e2f('0xa')]}:undefined;return _0x217fb8[_0x3527a8[_0x3e2f('0xb')]][_0x3e2f('0xc')]({'where':_0x488512,'raw':!![]})[_0x3e2f('0x6')](function(_0x446f0b){_0x5e20be[_0x3e2f('0x7')]=_[_0x3e2f('0x8')](_0x446f0b,function(_0x6b9d95){return _0x6b9d95[_0x3e2f('0xd')];});_0xd132b4(_0x5e20be);})[_0x3e2f('0x9')](function(_0x433801){_0x4ee837(_0x433801);});});}function _0x1935e2(_0x4fddda,_0x3820a5,_0x3a36df){if(!_0x3820a5)return Promise[_0x3e2f('0xe')](null);return new Promise(function(_0x12c2da,_0x57cffe){return _0x217fb8[_0x3e2f('0xf')][_0x3e2f('0xc')]({'where':{'sectionId':_0x3820a5['id']},'raw':!![]})[_0x3e2f('0x6')](function(_0xbf08de){if(_0x4fddda[_0x3e2f('0x5')]&&_0x4fddda[_0x3e2f('0x5')]!=='id'){_0x3820a5[_0x3e2f('0x7')]=_['map'](_0xbf08de,function(_0x5dac6d){return _0x5dac6d[_0x4fddda['field']];});}else{if(_0x3a36df===_0x3e2f('0x10')){_0x3820a5[_0x3e2f('0x7')]=_[_0x3e2f('0x8')](_0xbf08de,function(_0x25ee2c){return{'id':_0x25ee2c['resourceId'],'type':_0x25ee2c[_0x3e2f('0x11')]};});}else{_0x3820a5[_0x3e2f('0x7')]=_['map'](_0xbf08de,function(_0x1297d5){return _0x1297d5[_0x3e2f('0x12')];});}}_0x12c2da(_0x3820a5);})[_0x3e2f('0x9')](function(_0x10ecdf){_0x57cffe(_0x10ecdf);});});}function _0x4db132(_0x1c9163,_0x52a665){var _0x2a685f={'parentSections':[]};switch(_0x1c9163[_0x3e2f('0x13')]()){case _0x3e2f('0x14'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x16');break;case _0x3e2f('0x17'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x18');break;case _0x3e2f('0x19'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x1a');_0x2a685f[_0x3e2f('0x1b')]=[{'name':_0x3e2f('0x1c'),'field':_0x3e2f('0xd'),'foreignKey':_0x3e2f('0x1d')}];break;case _0x3e2f('0x1e'):_0x2a685f[_0x3e2f('0x15')]='JscriptyProject';break;case _0x3e2f('0x1f'):_0x2a685f[_0x3e2f('0x15')]='CmContact';_0x2a685f['parentSections']=[{'name':_0x3e2f('0x20'),'field':'id','foreignKey':'ListId'}];break;case _0x3e2f('0x21'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x22');break;case _0x3e2f('0x23'):_0x2a685f['childModel']=_0x3e2f('0x24');break;case'globalcustomfields':_0x2a685f['childModel']='CmCustomField';break;case _0x3e2f('0x25'):_0x2a685f[_0x3e2f('0x15')]='ChatQueue';break;case _0x3e2f('0x26'):_0x2a685f['childModel']=_0x3e2f('0x27');break;case'faxqueues':_0x2a685f['childModel']='FaxQueue';break;case _0x3e2f('0x28'):_0x2a685f['childModel']='FaxAccount';break;case _0x3e2f('0x29'):case _0x3e2f('0x2a'):case _0x3e2f('0x2b'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x2c');break;case _0x3e2f('0x2d'):_0x2a685f['childModel']='VoiceContext';break;case'voicemails':_0x2a685f['childModel']=_0x3e2f('0x2e');break;case'voicerecordings':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x2f');_0x2a685f[_0x3e2f('0x1b')]=[{'name':'Agents','field':'name','foreignKey':_0x3e2f('0x30'),'model':_0x3e2f('0x31'),'filter':{'field':_0x3e2f('0x32'),'value':[_0x3e2f('0x33')]}},{'name':_0x3e2f('0x34'),'field':_0x3e2f('0xd'),'foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x3e2f('0x35')]}},{'name':_0x3e2f('0x36'),'field':'name','foreignKey':'queue','model':_0x3e2f('0x37'),'filter':{'field':_0x3e2f('0x11'),'value':[_0x3e2f('0x38')]}},{'name':_0x3e2f('0x39'),'field':_0x3e2f('0xd'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x3e2f('0x11'),'value':[_0x3e2f('0x3a')]}}];break;case'musiconholds':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x3b');break;case'chanspies':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x3c');break;case _0x3e2f('0x3d'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x3e');break;case _0x3e2f('0x3f'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x40');break;case _0x3e2f('0x41'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x42');break;case _0x3e2f('0x43'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x44');break;case _0x3e2f('0x45'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x46');break;case _0x3e2f('0x47'):_0x2a685f[_0x3e2f('0x15')]='OpenchannelQueue';break;case _0x3e2f('0x48'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x49');break;case _0x3e2f('0x4a'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x4b');break;case _0x3e2f('0x4c'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x4d');break;case _0x3e2f('0x4e'):_0x2a685f['childModel']=_0x3e2f('0x4f');break;case'whatsappaccounts':_0x2a685f[_0x3e2f('0x15')]='WhatsappAccount';break;case _0x3e2f('0x50'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x51');break;case _0x3e2f('0x52'):case _0x3e2f('0x53'):_0x2a685f['childModel']=_0x3e2f('0x37');if(_0x52a665){_0x2a685f[_0x3e2f('0x1b')]=[{'name':_0x3e2f('0x36')},{'name':_0x3e2f('0x39')}];}break;case _0x3e2f('0x54'):case _0x3e2f('0x55'):case _0x3e2f('0x56'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x31');if(_0x52a665){_0x2a685f[_0x3e2f('0x1b')]=[{'name':_0x3e2f('0x57'),'filter':{'field':'role','value':[_0x3e2f('0x58'),_0x3e2f('0x59')]},'ignore':!![]},{'name':_0x3e2f('0x5a')},{'name':_0x3e2f('0x34')}];}break;case _0x3e2f('0x5b'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x5c');break;case _0x3e2f('0x5d'):_0x2a685f[_0x3e2f('0x15')]='SalesforceAccount';break;case'freshdeskaccounts':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x5e');break;case'sugarcrmaccounts':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x5f');break;case _0x3e2f('0x60'):_0x2a685f['childModel']=_0x3e2f('0x61');break;case _0x3e2f('0x62'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x63');break;case _0x3e2f('0x64'):_0x2a685f['childModel']='User';break;case'cannedanswers':_0x2a685f['childModel']=_0x3e2f('0x65');break;case'dispositions':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x66');break;case _0x3e2f('0x67'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x68');break;case'intervals':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x69');break;case _0x3e2f('0x6a'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x6b');break;case _0x3e2f('0x6c'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x6d');break;case'sounds':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x6e');break;case _0x3e2f('0x6f'):_0x2a685f['childModel']=_0x3e2f('0x70');break;case'templates':_0x2a685f['childModel']='Template';break;case _0x3e2f('0x71'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x72');break;case'trunks':_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x73');break;case _0x3e2f('0x74'):_0x2a685f[_0x3e2f('0x15')]='Variable';break;case _0x3e2f('0x75'):_0x2a685f[_0x3e2f('0x15')]='Plugin';break;case _0x3e2f('0x76'):_0x2a685f[_0x3e2f('0x15')]='AnalyticExtractedReport';_0x2a685f[_0x3e2f('0x1b')]=[{'name':_0x3e2f('0x77'),'field':'id','foreignKey':_0x3e2f('0x78')}];break;case _0x3e2f('0x79'):_0x2a685f[_0x3e2f('0x15')]=_0x3e2f('0x7a');break;}return _0x2a685f;}function _0x4c205f(_0x1b8a7a,_0x2a7b73){var _0x38b52d=_0x1b8a7a[_0x3e2f('0x7b')](0x0)[_0x3e2f('0x7c')]()+_0x1b8a7a[_0x3e2f('0x7d')](0x1);var _0x30469f={'type':_0x217fb8[_0x3e2f('0x7e')][_0x3e2f('0x7f')][_0x3e2f('0x80')],'raw':!![]};return new Promise(function(_0x4d8df3,_0x180fa4){var _0x579ce2=squel['select']()[_0x3e2f('0x5')](_0x3e2f('0x81')+_0x38b52d+_0x3e2f('0x82'),'id')[_0x3e2f('0x5')](_0x3e2f('0x83'))[_0x3e2f('0x84')](_0x3e2f('0x85')+_0x1b8a7a+'_interactions','ui')['where'](_0x3e2f('0x86'),_0x2a7b73['id']);return _0x217fb8['sequelize'][_0x3e2f('0x87')](_0x579ce2[_0x3e2f('0x88')](),_0x30469f)[_0x3e2f('0x6')](function(_0x5bd349){_0x2a7b73[_0x38b52d+'OpenTabs']=_0x5bd349;_0x4d8df3(_0x5bd349);})[_0x3e2f('0x9')](function(_0xd4c2c7){_0x180fa4(_0xd4c2c7);});});}return _0x14374c[_0x3e2f('0x89')](_0x3e2f('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4e1815){var _0x4f3c6c=require(_0x3e2f('0x8b'));var _0x46d0b3={'raw':_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x8c')],'where':{}};var _0x2ad083={};var _0x274776={'count':0x0,'rows':[]};var _0x51df03=_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x8d')];var _0x8eac65=_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x8e')]||![];var _0x8e2e0=_0x4db132(_0x51df03,_0x8eac65);if(!_0x8e2e0[_0x3e2f('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x51df03+'\x27');var _0x34c22d=[{'name':_0x51df03}];if(!_[_0x3e2f('0x8f')](_0x8e2e0[_0x3e2f('0x1b')]))_0x34c22d=_0x8e2e0['parentSections'];var _0x64e963=[];for(var _0x1a9626=0x0;_0x1a9626<_0x34c22d[_0x3e2f('0x90')];_0x1a9626++){_0x64e963[_0x3e2f('0x91')](_0x217fb8['UserProfileSection'][_0x3e2f('0x92')]({'where':{'userProfileId':_0x4e1815[_0x3e2f('0x93')]['id'],'name':_0x34c22d[_0x1a9626][_0x3e2f('0xd')]},'raw':!![]}));}return Promise[_0x3e2f('0x94')](_0x64e963)[_0x3e2f('0x6')](function(_0x5946ba){var _0xce3a1=_[_0x3e2f('0x4')](_0x5946ba,function(_0x5d5945){return _0x5d5945?_0x5d5945:undefined;});var _0x5d99e7=_['filter'](_0x34c22d,[_0x3e2f('0x95'),!![]]);var _0x42ed48=_['isEmpty'](_0xce3a1)&&_[_0x3e2f('0x8f')](_0x5d99e7)?null:_[_0x3e2f('0x96')](_0x5d99e7,_0xce3a1);if(!_0x42ed48)return null;var _0x3b4c9f=[];for(var _0x1a1dc2=0x0;_0x1a1dc2<_0x42ed48[_0x3e2f('0x90')];_0x1a1dc2++){var _0xc23534=_[_0x3e2f('0x92')](_0x34c22d,function(_0x422222){return _0x42ed48[_0x1a1dc2]?_0x422222['name']===_0x42ed48[_0x1a1dc2][_0x3e2f('0xd')]:null;});if(_0xc23534){if(_0x42ed48[_0x1a1dc2][_0x3e2f('0x95')]){_0x3b4c9f[_0x3e2f('0x91')](_0x10a45a(_0x8e2e0[_0x3e2f('0x15')],_0x42ed48[_0x1a1dc2]));}else{if(!_0x42ed48[_0x1a1dc2][_0x3e2f('0x97')]){_0x3b4c9f[_0x3e2f('0x91')](_0x1935e2(_0xc23534,_0x42ed48[_0x1a1dc2],_0x8e2e0[_0x3e2f('0x15')]));}else{if(_0xc23534[_0x3e2f('0xb')]){_0x3b4c9f[_0x3e2f('0x91')](_0x2647a0(_0xc23534,_0x42ed48[_0x1a1dc2]));}}}}}return Promise[_0x3e2f('0x94')](_0x3b4c9f);})['then'](function(_0x21d988){var _0xcb599c=_0x21d988;var _0x570a12=null;if(_0xcb599c){_0x570a12=_0xcb599c[_0x3e2f('0x90')]===0x1?_0xcb599c[0x0]:null;}if(!_0x570a12&&!_0xcb599c)return _0x274776;var _0x1654d1=_0x217fb8[_0x8e2e0[_0x3e2f('0x15')]]['rawAttributes'];_0x2ad083[_0x3e2f('0xb')]=_[_0x3e2f('0x98')](_0x1654d1);_0x2ad083[_0x3e2f('0x87')]=_[_0x3e2f('0x98')](_0x4e1815[_0x3e2f('0x87')]);_0x2ad083[_0x3e2f('0x99')]=_[_0x3e2f('0x9a')](_0x2ad083[_0x3e2f('0xb')],_0x2ad083['query']);_0x46d0b3[_0x3e2f('0x9b')]=_[_0x3e2f('0x9a')](_0x2ad083['model'],_0x4f3c6c[_0x3e2f('0x9c')](_0x4e1815['query']['fields']));_0x46d0b3[_0x3e2f('0x9b')]=_0x46d0b3[_0x3e2f('0x9b')][_0x3e2f('0x90')]?_0x46d0b3[_0x3e2f('0x9b')]:_0x2ad083['model'];if(!_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x9d')](_0x3e2f('0x9e'))){_0x46d0b3[_0x3e2f('0x9f')]=_0x4f3c6c['limit'](_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x9f')]);_0x46d0b3[_0x3e2f('0xa0')]=_0x4f3c6c[_0x3e2f('0xa0')](_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xa0')]);}_0x46d0b3[_0x3e2f('0xa1')]=_0x4f3c6c[_0x3e2f('0xa2')](_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xa2')]);_0x46d0b3['where']=_0x4f3c6c[_0x3e2f('0x99')](_[_0x3e2f('0xa3')](_0x4e1815['query'],_0x2ad083[_0x3e2f('0x99')]));if(_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x4')]){_0x46d0b3[_0x3e2f('0xa4')]=_[_0x3e2f('0xa5')](_0x46d0b3[_0x3e2f('0xa4')],{'$or':_[_0x3e2f('0x8')](_0x1654d1,function(_0x723d2b){if(_0x723d2b['type']['key']!==_0x3e2f('0xa6')){var _0x427d09={};_0x427d09[_0x723d2b['field']]={'$like':'%'+_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0x4')]+'%'};return _0x427d09;}})});}var _0x4a21b9=[];var _0x538b49=null;var _0x3d63b1={};if(_0x570a12){_0x538b49=_[_0x3e2f('0x92')](_0x34c22d,[_0x3e2f('0xd'),_0x570a12['name']]);if(_0x538b49['field']){_0x3d63b1={};if(_0x8e2e0['childModel']===_0x3e2f('0x10')){_0x3d63b1[_0x538b49['foreignKey']]=_[_0x3e2f('0x8')](_0x570a12['associatedResources'],'id');}else{_0x3d63b1[_0x538b49[_0x3e2f('0xa7')]]=_0x570a12[_0x3e2f('0x7')];}_0x4a21b9[_0x3e2f('0x91')](_0x3d63b1);}else{_0x46d0b3[_0x3e2f('0xa4')]['id']=_0x570a12[_0x3e2f('0x7')];}}else{for(var _0x493391=0x0;_0x493391<_0xcb599c['length'];_0x493391++){_0x538b49=_[_0x3e2f('0x92')](_0x34c22d,[_0x3e2f('0xd'),_0xcb599c[_0x493391][_0x3e2f('0xd')]]);if(_0x538b49['field']){_0x3d63b1={};_0x3d63b1[_0x538b49[_0x3e2f('0xa7')]]=_0xcb599c[_0x493391][_0x3e2f('0x7')];_0x4a21b9[_0x3e2f('0x91')](_0x3d63b1);}else{if(!_0x46d0b3[_0x3e2f('0xa4')]['id'])_0x46d0b3[_0x3e2f('0xa4')]['id']=[];_0xcb599c[_0x493391][_0x3e2f('0x7')][_0x3e2f('0xa8')](function(_0x1a2b1c){_0x46d0b3[_0x3e2f('0xa4')]['id'][_0x3e2f('0x91')](_0x1a2b1c);});}}}if(!_[_0x3e2f('0x8f')](_0x4a21b9)){_0x46d0b3[_0x3e2f('0xa4')]=_[_0x3e2f('0xa5')](_0x46d0b3[_0x3e2f('0xa4')],{'$and':{'$or':_0x4a21b9}});}_0x46d0b3=_[_0x3e2f('0xa5')]({},_0x46d0b3,_0x4e1815[_0x3e2f('0xa9')]);if(_0x570a12&&!_0x570a12[_0x3e2f('0x97')]&&_0x8e2e0[_0x3e2f('0x15')]===_0x3e2f('0x10')){if(_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xaa')]){_0x46d0b3[_0x3e2f('0xab')]=[{'all':!![]}];}return _0x217fb8[_0x8e2e0[_0x3e2f('0x15')]]['findAll'](_0x46d0b3)[_0x3e2f('0x6')](function(_0x5f5a7c){var _0x4c2e0a=[];_0x5f5a7c['forEach'](function(_0x5566c9){var _0x39f6cf;switch(_0x5566c9[_0x3e2f('0xac')]){case _0x3e2f('0xad'):_0x39f6cf=_['find'](_0x570a12['associatedResources'],function(_0x2515fb){return _0x2515fb['id']===_0x5566c9[_0x3e2f('0x78')]&&_0x2515fb[_0x3e2f('0x11')]==='DefaultReports';});break;case _0x3e2f('0xae'):_0x39f6cf=_[_0x3e2f('0x92')](_0x570a12[_0x3e2f('0x7')],function(_0x3760a8){return _0x3760a8['id']===_0x5566c9[_0x3e2f('0x78')]&&_0x3760a8[_0x3e2f('0x11')]===_0x3e2f('0xaf');});break;}if(_0x39f6cf)_0x4c2e0a[_0x3e2f('0x91')](_0x5566c9);});_0x274776[_0x3e2f('0xb0')]=_0x4c2e0a[_0x3e2f('0x90')];_0x274776[_0x3e2f('0xb1')]=_0x4c2e0a;return _0x274776;});}else{if(!_['isEmpty'](_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb2')])){_0x46d0b3[_0x3e2f('0xa4')]['id']=_0x46d0b3[_0x3e2f('0xa4')]['id']?_[_0x3e2f('0x9a')](_0x46d0b3[_0x3e2f('0xa4')]['id'],_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb2')]):_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb2')];if(_0x4e1815['query']['customSorting']){_0x46d0b3[_0x3e2f('0xa1')]=_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb3')];}}if(_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb4')]){_0x46d0b3[_0x3e2f('0xa4')]=_[_0x3e2f('0xa5')](_0x46d0b3['where'],{'$and':_0x4e1815[_0x3e2f('0x87')]['extraQueryConditions']});}return _0x217fb8[_0x8e2e0[_0x3e2f('0x15')]]['count']({'where':_0x46d0b3[_0x3e2f('0xa4')]})[_0x3e2f('0x6')](function(_0x959df7){_0x274776[_0x3e2f('0xb0')]=_0x959df7;if(_0x4e1815[_0x3e2f('0x87')]['includeAll']){if(_0x8e2e0['childModel']==='CmContact'){_0x46d0b3[_0x3e2f('0xab')]=[{'model':_0x217fb8['Tag'],'as':'Tags','attributes':['id',_0x3e2f('0xd'),_0x3e2f('0xb5')],'required':_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb6')]?!![]:![]},{'model':_0x217fb8[_0x3e2f('0x70')],'as':_0x3e2f('0xb7'),'attributes':['id','name',_0x3e2f('0xb5')],'through':_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb6')]?{'attributes':[],'where':{'TagId':_0x4e1815[_0x3e2f('0x87')]['tag']||undefined}}:{},'required':_0x4e1815[_0x3e2f('0x87')][_0x3e2f('0xb6')]?!![]:![]}];}else{_0x46d0b3['include']=[{'all':!![]}];}}return _0x217fb8[_0x8e2e0['childModel']][_0x3e2f('0xc')](_0x46d0b3);})[_0x3e2f('0x6')](function(_0x24d4b7){_0x274776['rows']=_0x24d4b7;if(_0x51df03==='Agents'&&_0x4e1815[_0x3e2f('0x87')]['openTabs']===_0x3e2f('0xb8')){var _0x4ee828=[];for(var _0x103afd=0x0;_0x103afd<_0x274776['rows'][_0x3e2f('0x90')];_0x103afd++){_0x4ee828[_0x3e2f('0x91')](_0x4c205f(_0x3e2f('0xb9'),_0x274776['rows'][_0x103afd][_0x3e2f('0xba')]));_0x4ee828[_0x3e2f('0x91')](_0x4c205f('sms',_0x274776[_0x3e2f('0xb1')][_0x103afd][_0x3e2f('0xba')]));_0x4ee828[_0x3e2f('0x91')](_0x4c205f(_0x3e2f('0xbb'),_0x274776[_0x3e2f('0xb1')][_0x103afd]['dataValues']));_0x4ee828[_0x3e2f('0x91')](_0x4c205f(_0x3e2f('0xbc'),_0x274776['rows'][_0x103afd][_0x3e2f('0xba')]));_0x4ee828['push'](_0x4c205f(_0x3e2f('0xbd'),_0x274776[_0x3e2f('0xb1')][_0x103afd][_0x3e2f('0xba')]));_0x4ee828[_0x3e2f('0x91')](_0x4c205f(_0x3e2f('0xbe'),_0x274776[_0x3e2f('0xb1')][_0x103afd][_0x3e2f('0xba')]));}return Promise[_0x3e2f('0x94')](_0x4ee828)[_0x3e2f('0x6')](function(){return _0x274776;});}return _0x274776;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index c21a981..9ddedee 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 _0x2f4a=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3af13e,_0x5ea870){var _0x343d31=function(_0x13339d){while(--_0x13339d){_0x3af13e['push'](_0x3af13e['shift']());}};_0x343d31(++_0x5ea870);}(_0x2f4a,0x8f));var _0xa2f4=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2f4a[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0xa2f4('0x0'));var util=require(_0xa2f4('0x1'));var moment=require(_0xa2f4('0x2'));var BPromise=require(_0xa2f4('0x3'));var rs=require(_0xa2f4('0x4'));var fs=require('fs');var Redis=require(_0xa2f4('0x5'));var db=require(_0xa2f4('0x6'))['db'];var utils=require(_0xa2f4('0x7'));var logger=require(_0xa2f4('0x8'))(_0xa2f4('0x9'));var config=require('../../config/environment');var jayson=require(_0xa2f4('0xa'));var client=jayson[_0xa2f4('0xb')][_0xa2f4('0xc')]({'port':0x232a});config[_0xa2f4('0xd')]=_[_0xa2f4('0xe')](config[_0xa2f4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2f4('0xf'))(new Redis(config['redis']));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x5aa6ef,_0x2a73ce,_0x1a8c24){return new BPromise(function(_0x279df7,_0x3924f3){return client['request'](_0x5aa6ef,_0x1a8c24)[_0xa2f4('0x10')](function(_0x527e4a){logger[_0xa2f4('0x11')](_0xa2f4('0x12'),_0x2a73ce,'request\x20sent');logger[_0xa2f4('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2a73ce,_0xa2f4('0x14'),JSON['stringify'](_0x527e4a));if(_0x527e4a[_0xa2f4('0x15')]){if(_0x527e4a['error'][_0xa2f4('0x16')]===0x1f4){logger[_0xa2f4('0x15')](_0xa2f4('0x12'),_0x2a73ce,_0x527e4a[_0xa2f4('0x15')][_0xa2f4('0x17')]);return _0x3924f3(_0x527e4a[_0xa2f4('0x15')]['message']);}logger[_0xa2f4('0x15')](_0xa2f4('0x12'),_0x2a73ce,_0x527e4a['error']['message']);return _0x279df7(_0x527e4a[_0xa2f4('0x15')][_0xa2f4('0x17')]);}else{logger[_0xa2f4('0x11')]('UserProfile,\x20%s,\x20%s',_0x2a73ce,'request\x20sent');_0x279df7(_0x527e4a['result']['message']);}})[_0xa2f4('0x18')](function(_0xaeaf8a){logger['error'](_0xa2f4('0x12'),_0x2a73ce,_0xaeaf8a);_0x3924f3(_0xaeaf8a);});});} \ No newline at end of file +var _0x583c=['UserProfile,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x17216e,_0x36fe38){var _0x20c86a=function(_0x41f9e8){while(--_0x41f9e8){_0x17216e['push'](_0x17216e['shift']());}};_0x20c86a(++_0x36fe38);}(_0x583c,0x12b));var _0xc583=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x583c[_0x393500];return _0x120d3b;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});config[_0xc583('0xa')]=_[_0xc583('0xb')](config['redis'],{'host':_0xc583('0xc'),'port':0x18eb});var socket=require(_0xc583('0xd'))(new Redis(config['redis']));require(_0xc583('0xe'))[_0xc583('0xf')](socket);function respondWithRpcPromise(_0x25f8d3,_0xb23f07,_0x2d99ca){return new BPromise(function(_0x550b1e,_0x3437be){return client[_0xc583('0x10')](_0x25f8d3,_0x2d99ca)['then'](function(_0x23c51a){logger[_0xc583('0x11')]('UserProfile,\x20%s,\x20%s',_0xb23f07,_0xc583('0x12'));logger[_0xc583('0x13')](_0xc583('0x14'),_0xb23f07,_0xc583('0x12'),JSON[_0xc583('0x15')](_0x23c51a));if(_0x23c51a[_0xc583('0x16')]){if(_0x23c51a[_0xc583('0x16')][_0xc583('0x17')]===0x1f4){logger[_0xc583('0x16')]('UserProfile,\x20%s,\x20%s',_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x3437be(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}logger['error'](_0xc583('0x19'),_0xb23f07,_0x23c51a[_0xc583('0x16')]['message']);return _0x550b1e(_0x23c51a[_0xc583('0x16')][_0xc583('0x18')]);}else{logger['info'](_0xc583('0x19'),_0xb23f07,_0xc583('0x12'));_0x550b1e(_0x23c51a[_0xc583('0x1a')][_0xc583('0x18')]);}})['catch'](function(_0x3dd3cc){logger['error'](_0xc583('0x19'),_0xb23f07,_0x3dd3cc);_0x3437be(_0x3dd3cc);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 8d42fdf..e804ab2 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 _0x5e1f=['remove','update','register','length','userProfile:','./userProfile.events'];(function(_0xc14e9b,_0x5c3047){var _0x48f298=function(_0x3ddc68){while(--_0x3ddc68){_0xc14e9b['push'](_0xc14e9b['shift']());}};_0x48f298(++_0x5c3047);}(_0x5e1f,0x101));var _0xf5e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e1f[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require(_0xf5e1('0x0'));var events=['save',_0xf5e1('0x1'),_0xf5e1('0x2')];function createListener(_0x334e9c,_0x3e2c98){return function(_0x16048a){_0x3e2c98['emit'](_0x334e9c,_0x16048a);};}function removeListener(_0x26956b,_0x48a6a7){return function(){UserProfileEvents['removeListener'](_0x26956b,_0x48a6a7);};}exports[_0xf5e1('0x3')]=function(_0x516d14){for(var _0x1803bb=0x0,_0x1aee00=events[_0xf5e1('0x4')];_0x1803bb<_0x1aee00;_0x1803bb++){var _0x132d42=events[_0x1803bb];var _0x2711cd=createListener(_0xf5e1('0x5')+_0x132d42,_0x516d14);UserProfileEvents['on'](_0x132d42,_0x2711cd);}}; \ No newline at end of file +var _0xc940=['./userProfile.events','remove','update','emit','removeListener','length','userProfile:'];(function(_0x1532c8,_0x5beef1){var _0x22f6e6=function(_0x750154){while(--_0x750154){_0x1532c8['push'](_0x1532c8['shift']());}};_0x22f6e6(++_0x5beef1);}(_0xc940,0x11f));var _0x0c94=function(_0x2766ef,_0x8c13d3){_0x2766ef=_0x2766ef-0x0;var _0x55e5f9=_0xc940[_0x2766ef];return _0x55e5f9;};'use strict';var UserProfileEvents=require(_0x0c94('0x0'));var events=['save',_0x0c94('0x1'),_0x0c94('0x2')];function createListener(_0x5a5c87,_0x809a94){return function(_0x505dc5){_0x809a94[_0x0c94('0x3')](_0x5a5c87,_0x505dc5);};}function removeListener(_0x3a6d2b,_0x4718e7){return function(){UserProfileEvents[_0x0c94('0x4')](_0x3a6d2b,_0x4718e7);};}exports['register']=function(_0x276072){for(var _0x2d2574=0x0,_0x218f26=events[_0x0c94('0x5')];_0x2d2574<_0x218f26;_0x2d2574++){var _0x4fe2aa=events[_0x2d2574];var _0x10c1a1=createListener(_0x0c94('0x6')+_0x4fe2aa,_0x276072);UserProfileEvents['on'](_0x4fe2aa,_0x10c1a1);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2b2f1f0..89a12a7 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 _0x1e35=['index','get','describe','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x1e35,0x198));var _0x51e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e35[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x51e3('0x0'));var util=require(_0x51e3('0x1'));var path=require(_0x51e3('0x2'));var timeout=require(_0x51e3('0x3'));var express=require(_0x51e3('0x4'));var router=express[_0x51e3('0x5')]();var fs_extra=require(_0x51e3('0x6'));var auth=require(_0x51e3('0x7'));var interaction=require(_0x51e3('0x8'));var config=require(_0x51e3('0x9'));var controller=require(_0x51e3('0xa'));router['get']('/',auth[_0x51e3('0xb')](),controller[_0x51e3('0xc')]);router[_0x51e3('0xd')]('/describe',auth[_0x51e3('0xb')](),controller[_0x51e3('0xe')]);router[_0x51e3('0xd')](_0x51e3('0xf'),auth[_0x51e3('0xb')](),controller[_0x51e3('0x10')]);router[_0x51e3('0x11')]('/',auth['isAuthenticated'](),controller[_0x51e3('0x12')]);router['put'](_0x51e3('0xf'),auth[_0x51e3('0xb')](),controller['update']);router[_0x51e3('0x13')](_0x51e3('0xf'),auth[_0x51e3('0xb')](),controller[_0x51e3('0x14')]);module['exports']=router; \ No newline at end of file +var _0x5f6a=['get','isAuthenticated','/describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x504bec,_0xf62c08){var _0x3577ed=function(_0x1bd0ed){while(--_0x1bd0ed){_0x504bec['push'](_0x504bec['shift']());}};_0x3577ed(++_0xf62c08);}(_0x5f6a,0x10f));var _0xa5f6=function(_0x8bae67,_0x22c5b1){_0x8bae67=_0x8bae67-0x0;var _0x190d50=_0x5f6a[_0x8bae67];return _0x190d50;};'use strict';var multer=require(_0xa5f6('0x0'));var util=require('util');var path=require(_0xa5f6('0x1'));var timeout=require(_0xa5f6('0x2'));var express=require(_0xa5f6('0x3'));var router=express[_0xa5f6('0x4')]();var fs_extra=require(_0xa5f6('0x5'));var auth=require(_0xa5f6('0x6'));var interaction=require(_0xa5f6('0x7'));var config=require(_0xa5f6('0x8'));var controller=require('./userProfileResource.controller');router[_0xa5f6('0x9')]('/',auth[_0xa5f6('0xa')](),controller['index']);router[_0xa5f6('0x9')](_0xa5f6('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa5f6('0xc'),auth[_0xa5f6('0xa')](),controller[_0xa5f6('0xd')]);router[_0xa5f6('0xe')]('/',auth[_0xa5f6('0xa')](),controller[_0xa5f6('0xf')]);router['put'](_0xa5f6('0xc'),auth['isAuthenticated'](),controller[_0xa5f6('0x10')]);router[_0xa5f6('0x11')](_0xa5f6('0xc'),auth[_0xa5f6('0xa')](),controller[_0xa5f6('0x12')]);module[_0xa5f6('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index b4f0dbb..83ef1ea 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 _0xeb9c=['STRING','INTEGER'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0xeb9c,0x117));var _0xceb9=function(_0xb0b2cb,_0x448e1a){_0xb0b2cb=_0xb0b2cb-0x0;var _0x4d0e97=_0xeb9c[_0xb0b2cb];return _0x4d0e97;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xceb9('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xceb9('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x74a6=['exports','INTEGER','STRING'];(function(_0x419be5,_0x29d15c){var _0x19d166=function(_0x5a8f66){while(--_0x5a8f66){_0x419be5['push'](_0x419be5['shift']());}};_0x19d166(++_0x29d15c);}(_0x74a6,0x144));var _0x674a=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x74a6[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require('sequelize');module[_0x674a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x674a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x674a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c345bdf..4ed68fd 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 _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x7096,0x10c));var _0x6709=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x7096[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +var _0x9536=['rawAttributes','intersection','length','options','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','error','stack','name','index','map','UserProfileResource','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9536,0x179));var _0x6953=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x9536[_0x339129];return _0x1570df;};'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['UserProfileResource'][_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['create']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['create'](_0x15c142[_0x6953('0x48')],{})[_0x6953('0x3c')](respondWithResult(_0x1d5979,0xc9))['catch'](handleError(_0x1d5979,null));};exports['update']=function(_0xbf5b61,_0x265b44){if(_0xbf5b61[_0x6953('0x48')]['id']){delete _0xbf5b61[_0x6953('0x48')]['id'];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0xbf5b61[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x265b44,null))[_0x6953('0x3c')](saveUpdates(_0xbf5b61[_0x6953('0x48')],null))[_0x6953('0x3c')](respondWithResult(_0x265b44,null))['catch'](handleError(_0x265b44,null));};exports['destroy']=function(_0x14a7bf,_0x38e3e8){return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'id':_0x14a7bf[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x38e3e8,null))[_0x6953('0x3c')](removeEntity(_0x38e3e8,null))[_0x6953('0x41')](handleError(_0x38e3e8,null));};exports[_0x6953('0x49')]=function(_0x50b962,_0x5f15b0){return db['UserProfileResource']['describe']()[_0x6953('0x3c')](respondWithResult(_0x5f15b0,null))[_0x6953('0x41')](handleError(_0x5f15b0,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 2e15002..0687e4a 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 _0x4e4c=['UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x17098f,_0xa534f0){var _0x148a69=function(_0x4307e7){while(--_0x4307e7){_0x17098f['push'](_0x17098f['shift']());}};_0x148a69(++_0xa534f0);}(_0x4e4c,0xf5));var _0xc4e4=function(_0x14a826,_0x236964){_0x14a826=_0x14a826-0x0;var _0x1b9a81=_0x4e4c[_0x14a826];return _0x1b9a81;};'use strict';var _=require('lodash');var util=require(_0xc4e4('0x0'));var logger=require(_0xc4e4('0x1'))(_0xc4e4('0x2'));var moment=require(_0xc4e4('0x3'));var BPromise=require(_0xc4e4('0x4'));var rp=require(_0xc4e4('0x5'));var fs=require('fs');var path=require(_0xc4e4('0x6'));var rimraf=require(_0xc4e4('0x7'));var config=require(_0xc4e4('0x8'));var attributes=require(_0xc4e4('0x9'));module[_0xc4e4('0xa')]=function(_0x439baa,_0x1ed0c0){return _0x439baa['define'](_0xc4e4('0xb'),attributes,{'tableName':_0xc4e4('0xc'),'paranoid':![],'indexes':[{'name':_0xc4e4('0xd'),'fields':[_0xc4e4('0xe'),_0xc4e4('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc2e3=['../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','compositeIndex','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3b18e4,_0x230f29){var _0x1147a1=function(_0x162d21){while(--_0x162d21){_0x3b18e4['push'](_0x3b18e4['shift']());}};_0x1147a1(++_0x230f29);}(_0xc2e3,0x1a9));var _0x3c2e=function(_0x73be90,_0x202f96){_0x73be90=_0x73be90-0x0;var _0x539454=_0xc2e3[_0x73be90];return _0x539454;};'use strict';var _=require(_0x3c2e('0x0'));var util=require(_0x3c2e('0x1'));var logger=require(_0x3c2e('0x2'))('api');var moment=require(_0x3c2e('0x3'));var BPromise=require(_0x3c2e('0x4'));var rp=require(_0x3c2e('0x5'));var fs=require('fs');var path=require(_0x3c2e('0x6'));var rimraf=require('rimraf');var config=require(_0x3c2e('0x7'));var attributes=require(_0x3c2e('0x8'));module[_0x3c2e('0x9')]=function(_0x4799fa,_0x28fc7a){return _0x4799fa['define'](_0x3c2e('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x3c2e('0xb'),'fields':['resourceId','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 4af6c56..079ac38 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 _0xfe24=['../../config/environment','info','request\x20sent','error','message','UserProfileResource,\x20%s,\x20%s','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfe24,0x96));var _0x4fe2=function(_0x516f0a,_0x5632b4){_0x516f0a=_0x516f0a-0x0;var _0x1792a0=_0xfe24[_0x516f0a];return _0x1792a0;};'use strict';var _=require(_0x4fe2('0x0'));var util=require(_0x4fe2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4fe2('0x2'));var fs=require('fs');var Redis=require(_0x4fe2('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4fe2('0x4'))(_0x4fe2('0x5'));var config=require(_0x4fe2('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44d6cb,_0x5f4139,_0x4de48f){return new BPromise(function(_0x4ae2be,_0xc32812){return client['request'](_0x44d6cb,_0x4de48f)['then'](function(_0x416de9){logger[_0x4fe2('0x7')]('UserProfileResource,\x20%s,\x20%s',_0x5f4139,_0x4fe2('0x8'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x5f4139,'request\x20sent',JSON['stringify'](_0x416de9));if(_0x416de9[_0x4fe2('0x9')]){if(_0x416de9[_0x4fe2('0x9')]['code']===0x1f4){logger[_0x4fe2('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x5f4139,_0x416de9['error'][_0x4fe2('0xa')]);return _0xc32812(_0x416de9[_0x4fe2('0x9')]['message']);}logger[_0x4fe2('0x9')]('UserProfileResource,\x20%s,\x20%s',_0x5f4139,_0x416de9[_0x4fe2('0x9')]['message']);return _0x4ae2be(_0x416de9[_0x4fe2('0x9')][_0x4fe2('0xa')]);}else{logger['info'](_0x4fe2('0xb'),_0x5f4139,_0x4fe2('0x8'));_0x4ae2be(_0x416de9['result'][_0x4fe2('0xa')]);}})[_0x4fe2('0xc')](function(_0x53c270){logger[_0x4fe2('0x9')](_0x4fe2('0xb'),_0x5f4139,_0x53c270);_0xc32812(_0x53c270);});});} \ No newline at end of file +var _0xa071=['ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','moment','randomstring'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0xa071,0x179));var _0x1a07=function(_0x56fa18,_0x4235e9){_0x56fa18=_0x56fa18-0x0;var _0x1d97fe=_0xa071[_0x56fa18];return _0x1d97fe;};'use strict';var _=require(_0x1a07('0x0'));var util=require('util');var moment=require(_0x1a07('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a07('0x2'));var fs=require('fs');var Redis=require(_0x1a07('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a07('0x4'));var config=require(_0x1a07('0x5'));var jayson=require(_0x1a07('0x6'));var client=jayson[_0x1a07('0x7')][_0x1a07('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bdd16,_0x32938a,_0x89286f){return new BPromise(function(_0x2f4293,_0x1814f3){return client[_0x1a07('0x9')](_0x2bdd16,_0x89286f)[_0x1a07('0xa')](function(_0x1a6f90){logger[_0x1a07('0xb')](_0x1a07('0xc'),_0x32938a,'request\x20sent');logger[_0x1a07('0xd')](_0x1a07('0xe'),_0x32938a,'request\x20sent',JSON[_0x1a07('0xf')](_0x1a6f90));if(_0x1a6f90[_0x1a07('0x10')]){if(_0x1a6f90[_0x1a07('0x10')][_0x1a07('0x11')]===0x1f4){logger[_0x1a07('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x32938a,_0x1a6f90[_0x1a07('0x10')]['message']);return _0x1814f3(_0x1a6f90['error'][_0x1a07('0x12')]);}logger[_0x1a07('0x10')](_0x1a07('0xc'),_0x32938a,_0x1a6f90[_0x1a07('0x10')]['message']);return _0x2f4293(_0x1a6f90['error'][_0x1a07('0x12')]);}else{logger['info'](_0x1a07('0xc'),_0x32938a,_0x1a07('0x13'));_0x2f4293(_0x1a6f90['result']['message']);}})['catch'](function(_0x63bd95){logger[_0x1a07('0x10')](_0x1a07('0xc'),_0x32938a,_0x63bd95);_0x1814f3(_0x63bd95);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 3e060b1..a2ec49a 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 _0x762f=['isAuthenticated','/:id','show','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index'];(function(_0x291647,_0xb02113){var _0x3f90ec=function(_0x79ea2b){while(--_0x79ea2b){_0x291647['push'](_0x291647['shift']());}};_0x3f90ec(++_0xb02113);}(_0x762f,0xe4));var _0xf762=function(_0x4b2cc4,_0x384a32){_0x4b2cc4=_0x4b2cc4-0x0;var _0x75fe41=_0x762f[_0x4b2cc4];return _0x75fe41;};'use strict';var multer=require(_0xf762('0x0'));var util=require('util');var path=require(_0xf762('0x1'));var timeout=require(_0xf762('0x2'));var express=require(_0xf762('0x3'));var router=express[_0xf762('0x4')]();var fs_extra=require(_0xf762('0x5'));var auth=require(_0xf762('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf762('0x7'));var controller=require('./userProfileSection.controller');router[_0xf762('0x8')]('/',auth['isAuthenticated'](),controller[_0xf762('0x9')]);router[_0xf762('0x8')]('/describe',auth[_0xf762('0xa')](),controller['describe']);router[_0xf762('0x8')](_0xf762('0xb'),auth[_0xf762('0xa')](),controller[_0xf762('0xc')]);router['post']('/',auth[_0xf762('0xa')](),controller[_0xf762('0xd')]);router['put'](_0xf762('0xb'),auth[_0xf762('0xa')](),controller[_0xf762('0xe')]);router['delete'](_0xf762('0xb'),auth[_0xf762('0xa')](),controller[_0xf762('0xf')]);module[_0xf762('0x10')]=router; \ No newline at end of file +var _0x77b0=['fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x123855,_0x2fc84e){var _0x5b7bfb=function(_0x4f0d66){while(--_0x4f0d66){_0x123855['push'](_0x123855['shift']());}};_0x5b7bfb(++_0x2fc84e);}(_0x77b0,0xc2));var _0x077b=function(_0x4d863c,_0x2d8c8f){_0x4d863c=_0x4d863c-0x0;var _0x30d587=_0x77b0[_0x4d863c];return _0x30d587;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x077b('0x0'));var timeout=require(_0x077b('0x1'));var express=require(_0x077b('0x2'));var router=express[_0x077b('0x3')]();var fs_extra=require(_0x077b('0x4'));var auth=require(_0x077b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x077b('0x6')]('/',auth[_0x077b('0x7')](),controller[_0x077b('0x8')]);router[_0x077b('0x6')](_0x077b('0x9'),auth[_0x077b('0x7')](),controller[_0x077b('0xa')]);router[_0x077b('0x6')](_0x077b('0xb'),auth[_0x077b('0x7')](),controller[_0x077b('0xc')]);router[_0x077b('0xd')]('/',auth[_0x077b('0x7')](),controller['create']);router[_0x077b('0xe')](_0x077b('0xb'),auth[_0x077b('0x7')](),controller[_0x077b('0xf')]);router[_0x077b('0x10')](_0x077b('0xb'),auth[_0x077b('0x7')](),controller[_0x077b('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index be74886..64e23b5 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 _0xdd4f=['BOOLEAN','STRING','setDataValue','join','getDataValue','crudPermissions','sequelize','INTEGER'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xaf27d,_0xec93ae){_0xaf27d=_0xaf27d-0x0;var _0x13e91f=_0xdd4f[_0xaf27d];return _0x13e91f;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xfdd4('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0xfdd4('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xfdd4('0x3')],'set':function(_0x3175f6){this[_0xfdd4('0x4')]('crudPermissions',_0x3175f6?_0x3175f6[_0xfdd4('0x5')](''):[]);},'get':function(){return this[_0xfdd4('0x6')](_0xfdd4('0x7'))?this[_0xfdd4('0x6')](_0xfdd4('0x7'))['split'](''):[];}}}; \ No newline at end of file +var _0xd4a2=['join','getDataValue','split','sequelize','STRING','BOOLEAN','setDataValue','crudPermissions'];(function(_0x2517fa,_0x23d100){var _0x463ab2=function(_0x5921c5){while(--_0x5921c5){_0x2517fa['push'](_0x2517fa['shift']());}};_0x463ab2(++_0x23d100);}(_0xd4a2,0x173));var _0x2d4a=function(_0x19c9ef,_0x21109c){_0x19c9ef=_0x19c9ef-0x0;var _0x3e9d6e=_0xd4a2[_0x19c9ef];return _0x3e9d6e;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2d4a('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x2d4a('0x1')],'set':function(_0x5d435a){this[_0x2d4a('0x3')](_0x2d4a('0x4'),_0x5d435a?_0x5d435a[_0x2d4a('0x5')](''):[]);},'get':function(){return this[_0x2d4a('0x6')](_0x2d4a('0x4'))?this['getDataValue'](_0x2d4a('0x4'))[_0x2d4a('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a3af474..484de86 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 _0x6ba7=['order','sort','where','filter','merge','options','UserProfileSection','includeAll','include','findAll','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x143ae9,_0xded38b){var _0x43c6db=function(_0x3940b8){while(--_0x3940b8){_0x143ae9['push'](_0x143ae9['shift']());}};_0x43c6db(++_0xded38b);}(_0x6ba7,0xf2));var _0x76ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ba7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x76ba('0x0'));var rimraf=require(_0x76ba('0x1'));var zipdir=require(_0x76ba('0x2'));var jsonpatch=require(_0x76ba('0x3'));var rp=require(_0x76ba('0x4'));var moment=require('moment');var BPromise=require(_0x76ba('0x5'));var Mustache=require(_0x76ba('0x6'));var util=require(_0x76ba('0x7'));var path=require(_0x76ba('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x76ba('0x9'));var fs=require('fs');var fs_extra=require(_0x76ba('0xa'));var _=require(_0x76ba('0xb'));var squel=require(_0x76ba('0xc'));var crypto=require(_0x76ba('0xd'));var jsforce=require(_0x76ba('0xe'));var deskjs=require(_0x76ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x76ba('0x10'));var Papa=require('papaparse');var Redis=require(_0x76ba('0x11'));var authService=require(_0x76ba('0x12'));var qs=require(_0x76ba('0x13'));var as=require(_0x76ba('0x14'));var hardwareService=require(_0x76ba('0x15'));var logger=require(_0x76ba('0x16'))(_0x76ba('0x17'));var utils=require(_0x76ba('0x18'));var config=require(_0x76ba('0x19'));var licenseUtil=require(_0x76ba('0x1a'));var db=require(_0x76ba('0x1b'))['db'];function respondWithStatusCode(_0x3fce00,_0x54c0dc){_0x54c0dc=_0x54c0dc||0xcc;return function(_0x347dc6){if(_0x347dc6){return _0x3fce00[_0x76ba('0x1c')](_0x54c0dc);}return _0x3fce00[_0x76ba('0x1d')](_0x54c0dc)[_0x76ba('0x1e')]();};}function respondWithResult(_0x11a615,_0x50e4bd){_0x50e4bd=_0x50e4bd||0xc8;return function(_0x4724e2){if(_0x4724e2){return _0x11a615[_0x76ba('0x1d')](_0x50e4bd)[_0x76ba('0x1f')](_0x4724e2);}};}function respondWithFilteredResult(_0x4593cb,_0x5e97f1){return function(_0x267078){if(_0x267078){var _0x4cb6f9=typeof _0x5e97f1['offset']==='undefined'&&typeof _0x5e97f1[_0x76ba('0x20')]===_0x76ba('0x21');var _0x13edc9=_0x267078[_0x76ba('0x22')];var _0x350fb6=_0x4cb6f9?0x0:_0x5e97f1[_0x76ba('0x23')];var _0x29cca4=_0x4cb6f9?_0x267078[_0x76ba('0x22')]:_0x5e97f1[_0x76ba('0x23')]+_0x5e97f1[_0x76ba('0x20')];var _0x25982b;if(_0x29cca4>=_0x13edc9){_0x29cca4=_0x13edc9;_0x25982b=0xc8;}else{_0x25982b=0xce;}_0x4593cb[_0x76ba('0x1d')](_0x25982b);return _0x4593cb[_0x76ba('0x24')](_0x76ba('0x25'),_0x350fb6+'-'+_0x29cca4+'/'+_0x13edc9)[_0x76ba('0x1f')](_0x267078);}return null;};}function patchUpdates(_0x97cef3){return function(_0x8c3eaa){try{jsonpatch[_0x76ba('0x26')](_0x8c3eaa,_0x97cef3,!![]);}catch(_0x26414a){return BPromise['reject'](_0x26414a);}return _0x8c3eaa[_0x76ba('0x27')]();};}function saveUpdates(_0xf3ae40,_0x3be9b1){return function(_0x7c3e0e){if(_0x7c3e0e){return _0x7c3e0e['update'](_0xf3ae40)[_0x76ba('0x28')](function(_0x566044){return _0x566044;});}return null;};}function removeEntity(_0xefd2df,_0x9957a7){return function(_0x37c347){if(_0x37c347){return _0x37c347[_0x76ba('0x29')]()[_0x76ba('0x28')](function(){_0xefd2df[_0x76ba('0x1d')](0xcc)[_0x76ba('0x1e')]();});}};}function handleEntityNotFound(_0x26c2c4,_0x9f78dc){return function(_0x174f6a){if(!_0x174f6a){_0x26c2c4['sendStatus'](0x194);}return _0x174f6a;};}function handleError(_0x3f91da,_0x34c83e){_0x34c83e=_0x34c83e||0x1f4;return function(_0x5d0d31){logger['error'](_0x5d0d31[_0x76ba('0x2a')]);if(_0x5d0d31[_0x76ba('0x2b')]){delete _0x5d0d31['name'];}_0x3f91da[_0x76ba('0x1d')](_0x34c83e)['send'](_0x5d0d31);};}exports[_0x76ba('0x2c')]=function(_0x3554d7,_0x246f50){var _0x2c5b73={},_0x2aa6b0={},_0x45fcc1={'count':0x0,'rows':[]};var _0x57dd45=_[_0x76ba('0x2d')](db['UserProfileSection'][_0x76ba('0x2e')],function(_0x1ab6c2){return{'name':_0x1ab6c2['fieldName'],'type':_0x1ab6c2[_0x76ba('0x2f')][_0x76ba('0x30')]};});_0x2aa6b0[_0x76ba('0x31')]=_[_0x76ba('0x2d')](_0x57dd45,_0x76ba('0x2b'));_0x2aa6b0[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x3554d7['query']);_0x2aa6b0[_0x76ba('0x34')]=_[_0x76ba('0x35')](_0x2aa6b0['model'],_0x2aa6b0[_0x76ba('0x32')]);_0x2c5b73[_0x76ba('0x36')]=_[_0x76ba('0x35')](_0x2aa6b0['model'],qs[_0x76ba('0x37')](_0x3554d7[_0x76ba('0x32')]['fields']));_0x2c5b73[_0x76ba('0x36')]=_0x2c5b73['attributes'][_0x76ba('0x38')]?_0x2c5b73[_0x76ba('0x36')]:_0x2aa6b0[_0x76ba('0x31')];if(!_0x3554d7[_0x76ba('0x32')][_0x76ba('0x39')]('nolimit')){_0x2c5b73['limit']=qs[_0x76ba('0x20')](_0x3554d7[_0x76ba('0x32')][_0x76ba('0x20')]);_0x2c5b73['offset']=qs[_0x76ba('0x23')](_0x3554d7[_0x76ba('0x32')][_0x76ba('0x23')]);}_0x2c5b73[_0x76ba('0x3a')]=qs['sort'](_0x3554d7[_0x76ba('0x32')][_0x76ba('0x3b')]);_0x2c5b73[_0x76ba('0x3c')]=qs['filters'](_['pick'](_0x3554d7[_0x76ba('0x32')],_0x2aa6b0['filters']),_0x57dd45);if(_0x3554d7[_0x76ba('0x32')][_0x76ba('0x3d')]){_0x2c5b73[_0x76ba('0x3c')]=_['merge'](_0x2c5b73[_0x76ba('0x3c')],{'$or':_[_0x76ba('0x2d')](_0x57dd45,function(_0xe7f509){if(_0xe7f509[_0x76ba('0x2f')]!=='VIRTUAL'){var _0x13e78f={};_0x13e78f[_0xe7f509['name']]={'$like':'%'+_0x3554d7['query']['filter']+'%'};return _0x13e78f;}})});}_0x2c5b73=_[_0x76ba('0x3e')]({},_0x2c5b73,_0x3554d7[_0x76ba('0x3f')]);var _0xdccfba={'where':_0x2c5b73[_0x76ba('0x3c')]};return db[_0x76ba('0x40')][_0x76ba('0x22')](_0xdccfba)[_0x76ba('0x28')](function(_0x46e399){_0x45fcc1[_0x76ba('0x22')]=_0x46e399;if(_0x3554d7[_0x76ba('0x32')][_0x76ba('0x41')]){_0x2c5b73[_0x76ba('0x42')]=[{'all':!![]}];}return db[_0x76ba('0x40')][_0x76ba('0x43')](_0x2c5b73);})['then'](function(_0xe6d68e){_0x45fcc1['rows']=_0xe6d68e;return _0x45fcc1;})[_0x76ba('0x28')](respondWithFilteredResult(_0x246f50,_0x2c5b73))[_0x76ba('0x44')](handleError(_0x246f50,null));};exports['show']=function(_0x3d0472,_0x1ee074){var _0x457709={'raw':![],'where':{'id':_0x3d0472[_0x76ba('0x45')]['id']}},_0x3e1bad={};_0x3e1bad[_0x76ba('0x31')]=_[_0x76ba('0x33')](db[_0x76ba('0x40')][_0x76ba('0x2e')]);_0x3e1bad[_0x76ba('0x32')]=_[_0x76ba('0x33')](_0x3d0472[_0x76ba('0x32')]);_0x3e1bad[_0x76ba('0x34')]=_[_0x76ba('0x35')](_0x3e1bad[_0x76ba('0x31')],_0x3e1bad[_0x76ba('0x32')]);_0x457709[_0x76ba('0x36')]=_['intersection'](_0x3e1bad[_0x76ba('0x31')],qs[_0x76ba('0x37')](_0x3d0472['query'][_0x76ba('0x37')]));_0x457709['attributes']=_0x457709[_0x76ba('0x36')][_0x76ba('0x38')]?_0x457709[_0x76ba('0x36')]:_0x3e1bad[_0x76ba('0x31')];if(_0x3d0472[_0x76ba('0x32')][_0x76ba('0x41')]){_0x457709[_0x76ba('0x42')]=[{'all':!![]}];}_0x457709=_[_0x76ba('0x3e')]({},_0x457709,_0x3d0472[_0x76ba('0x3f')]);return db['UserProfileSection'][_0x76ba('0x46')](_0x457709)['then'](handleEntityNotFound(_0x1ee074,null))[_0x76ba('0x28')](respondWithResult(_0x1ee074,null))['catch'](handleError(_0x1ee074,null));};exports['create']=function(_0x450107,_0x12066e){return db[_0x76ba('0x40')][_0x76ba('0x47')](_0x450107[_0x76ba('0x48')],{})[_0x76ba('0x28')](respondWithResult(_0x12066e,0xc9))[_0x76ba('0x44')](handleError(_0x12066e,null));};exports[_0x76ba('0x49')]=function(_0xb111e2,_0x33387a){if(_0xb111e2[_0x76ba('0x48')]['id']){delete _0xb111e2['body']['id'];}return db[_0x76ba('0x40')][_0x76ba('0x46')]({'where':{'id':_0xb111e2[_0x76ba('0x45')]['id']}})['then'](handleEntityNotFound(_0x33387a,null))[_0x76ba('0x28')](saveUpdates(_0xb111e2[_0x76ba('0x48')],null))[_0x76ba('0x28')](respondWithResult(_0x33387a,null))[_0x76ba('0x44')](handleError(_0x33387a,null));};exports[_0x76ba('0x29')]=function(_0x3fa864,_0x4886fb){return db['UserProfileSection']['find']({'where':{'id':_0x3fa864[_0x76ba('0x45')]['id']}})[_0x76ba('0x28')](handleEntityNotFound(_0x4886fb,null))[_0x76ba('0x28')](removeEntity(_0x4886fb,null))[_0x76ba('0x44')](handleError(_0x4886fb,null));};exports[_0x76ba('0x4a')]=function(_0x527155,_0x5b6bc5){return db[_0x76ba('0x40')]['describe']()[_0x76ba('0x28')](respondWithResult(_0x5b6bc5,null))[_0x76ba('0x44')](handleError(_0x5b6bc5,null));}; \ No newline at end of file +var _0xdb5e=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x159c77,_0x4ee369){var _0x59803e=function(_0x4b7314){while(--_0x4b7314){_0x159c77['push'](_0x159c77['shift']());}};_0x59803e(++_0x4ee369);}(_0xdb5e,0x8b));var _0xedb5=function(_0x445e37,_0x1c1ba5){_0x445e37=_0x445e37-0x0;var _0x104676=_0xdb5e[_0x445e37];return _0x104676;};'use strict';var emlformat=require(_0xedb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedb5('0x1'));var jsonpatch=require(_0xedb5('0x2'));var rp=require(_0xedb5('0x3'));var moment=require(_0xedb5('0x4'));var BPromise=require(_0xedb5('0x5'));var Mustache=require(_0xedb5('0x6'));var util=require(_0xedb5('0x7'));var path=require('path');var sox=require(_0xedb5('0x8'));var csv=require(_0xedb5('0x9'));var ejs=require(_0xedb5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedb5('0xb'));var squel=require(_0xedb5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xedb5('0xd'));var toCsv=require(_0xedb5('0x9'));var querystring=require('querystring');var Papa=require(_0xedb5('0xe'));var Redis=require(_0xedb5('0xf'));var authService=require(_0xedb5('0x10'));var qs=require(_0xedb5('0x11'));var as=require(_0xedb5('0x12'));var hardwareService=require(_0xedb5('0x13'));var logger=require(_0xedb5('0x14'))(_0xedb5('0x15'));var utils=require('../../config/utils');var config=require(_0xedb5('0x16'));var licenseUtil=require(_0xedb5('0x17'));var db=require(_0xedb5('0x18'))['db'];function respondWithStatusCode(_0x386c02,_0xb35419){_0xb35419=_0xb35419||0xcc;return function(_0x35197d){if(_0x35197d){return _0x386c02['sendStatus'](_0xb35419);}return _0x386c02[_0xedb5('0x19')](_0xb35419)[_0xedb5('0x1a')]();};}function respondWithResult(_0x110ac6,_0x48acbb){_0x48acbb=_0x48acbb||0xc8;return function(_0x3241ad){if(_0x3241ad){return _0x110ac6[_0xedb5('0x19')](_0x48acbb)[_0xedb5('0x1b')](_0x3241ad);}};}function respondWithFilteredResult(_0x11f3ec,_0x4fa599){return function(_0x270ef7){if(_0x270ef7){var _0xd8fbad=typeof _0x4fa599[_0xedb5('0x1c')]==='undefined'&&typeof _0x4fa599['limit']===_0xedb5('0x1d');var _0x45603b=_0x270ef7[_0xedb5('0x1e')];var _0xa0160a=_0xd8fbad?0x0:_0x4fa599['offset'];var _0x17b12c=_0xd8fbad?_0x270ef7['count']:_0x4fa599[_0xedb5('0x1c')]+_0x4fa599[_0xedb5('0x1f')];var _0x1cf4fd;if(_0x17b12c>=_0x45603b){_0x17b12c=_0x45603b;_0x1cf4fd=0xc8;}else{_0x1cf4fd=0xce;}_0x11f3ec[_0xedb5('0x19')](_0x1cf4fd);return _0x11f3ec['set']('Content-Range',_0xa0160a+'-'+_0x17b12c+'/'+_0x45603b)[_0xedb5('0x1b')](_0x270ef7);}return null;};}function patchUpdates(_0x3e6dcb){return function(_0x45c496){try{jsonpatch[_0xedb5('0x20')](_0x45c496,_0x3e6dcb,!![]);}catch(_0x20a663){return BPromise[_0xedb5('0x21')](_0x20a663);}return _0x45c496[_0xedb5('0x22')]();};}function saveUpdates(_0x451d89,_0x29ee2b){return function(_0x33ef2b){if(_0x33ef2b){return _0x33ef2b[_0xedb5('0x23')](_0x451d89)[_0xedb5('0x24')](function(_0x18a96e){return _0x18a96e;});}return null;};}function removeEntity(_0x36c090,_0x2ca22a){return function(_0x255043){if(_0x255043){return _0x255043[_0xedb5('0x25')]()['then'](function(){_0x36c090[_0xedb5('0x19')](0xcc)[_0xedb5('0x1a')]();});}};}function handleEntityNotFound(_0x3d88d6,_0x280c5f){return function(_0x5b24f1){if(!_0x5b24f1){_0x3d88d6[_0xedb5('0x26')](0x194);}return _0x5b24f1;};}function handleError(_0x39b3d5,_0x3f4655){_0x3f4655=_0x3f4655||0x1f4;return function(_0x23540f){logger[_0xedb5('0x27')](_0x23540f[_0xedb5('0x28')]);if(_0x23540f['name']){delete _0x23540f[_0xedb5('0x29')];}_0x39b3d5[_0xedb5('0x19')](_0x3f4655)[_0xedb5('0x2a')](_0x23540f);};}exports['index']=function(_0x558525,_0x446cca){var _0x6bae1a={},_0x32d32d={},_0x295641={'count':0x0,'rows':[]};var _0x493148=_[_0xedb5('0x2b')](db[_0xedb5('0x2c')][_0xedb5('0x2d')],function(_0x2fe845){return{'name':_0x2fe845[_0xedb5('0x2e')],'type':_0x2fe845['type'][_0xedb5('0x2f')]};});_0x32d32d[_0xedb5('0x30')]=_[_0xedb5('0x2b')](_0x493148,_0xedb5('0x29'));_0x32d32d[_0xedb5('0x31')]=_[_0xedb5('0x32')](_0x558525[_0xedb5('0x31')]);_0x32d32d['filters']=_[_0xedb5('0x33')](_0x32d32d[_0xedb5('0x30')],_0x32d32d['query']);_0x6bae1a['attributes']=_[_0xedb5('0x33')](_0x32d32d[_0xedb5('0x30')],qs[_0xedb5('0x34')](_0x558525[_0xedb5('0x31')][_0xedb5('0x34')]));_0x6bae1a[_0xedb5('0x35')]=_0x6bae1a[_0xedb5('0x35')][_0xedb5('0x36')]?_0x6bae1a[_0xedb5('0x35')]:_0x32d32d['model'];if(!_0x558525['query'][_0xedb5('0x37')](_0xedb5('0x38'))){_0x6bae1a[_0xedb5('0x1f')]=qs[_0xedb5('0x1f')](_0x558525['query']['limit']);_0x6bae1a[_0xedb5('0x1c')]=qs[_0xedb5('0x1c')](_0x558525[_0xedb5('0x31')][_0xedb5('0x1c')]);}_0x6bae1a['order']=qs[_0xedb5('0x39')](_0x558525[_0xedb5('0x31')][_0xedb5('0x39')]);_0x6bae1a[_0xedb5('0x3a')]=qs[_0xedb5('0x3b')](_[_0xedb5('0x3c')](_0x558525[_0xedb5('0x31')],_0x32d32d[_0xedb5('0x3b')]),_0x493148);if(_0x558525[_0xedb5('0x31')][_0xedb5('0x3d')]){_0x6bae1a[_0xedb5('0x3a')]=_[_0xedb5('0x3e')](_0x6bae1a[_0xedb5('0x3a')],{'$or':_[_0xedb5('0x2b')](_0x493148,function(_0x18b3a6){if(_0x18b3a6[_0xedb5('0x3f')]!=='VIRTUAL'){var _0x643da2={};_0x643da2[_0x18b3a6[_0xedb5('0x29')]]={'$like':'%'+_0x558525[_0xedb5('0x31')]['filter']+'%'};return _0x643da2;}})});}_0x6bae1a=_[_0xedb5('0x3e')]({},_0x6bae1a,_0x558525[_0xedb5('0x40')]);var _0x423736={'where':_0x6bae1a[_0xedb5('0x3a')]};return db[_0xedb5('0x2c')]['count'](_0x423736)[_0xedb5('0x24')](function(_0x12e91a){_0x295641['count']=_0x12e91a;if(_0x558525['query'][_0xedb5('0x41')]){_0x6bae1a[_0xedb5('0x42')]=[{'all':!![]}];}return db[_0xedb5('0x2c')][_0xedb5('0x43')](_0x6bae1a);})[_0xedb5('0x24')](function(_0x123f49){_0x295641[_0xedb5('0x44')]=_0x123f49;return _0x295641;})[_0xedb5('0x24')](respondWithFilteredResult(_0x446cca,_0x6bae1a))[_0xedb5('0x45')](handleError(_0x446cca,null));};exports[_0xedb5('0x46')]=function(_0x3f04e4,_0xabbe57){var _0x510354={'raw':![],'where':{'id':_0x3f04e4[_0xedb5('0x47')]['id']}},_0x51261b={};_0x51261b[_0xedb5('0x30')]=_[_0xedb5('0x32')](db['UserProfileSection'][_0xedb5('0x2d')]);_0x51261b[_0xedb5('0x31')]=_['keys'](_0x3f04e4[_0xedb5('0x31')]);_0x51261b['filters']=_[_0xedb5('0x33')](_0x51261b[_0xedb5('0x30')],_0x51261b['query']);_0x510354[_0xedb5('0x35')]=_[_0xedb5('0x33')](_0x51261b[_0xedb5('0x30')],qs['fields'](_0x3f04e4['query'][_0xedb5('0x34')]));_0x510354[_0xedb5('0x35')]=_0x510354['attributes']['length']?_0x510354[_0xedb5('0x35')]:_0x51261b[_0xedb5('0x30')];if(_0x3f04e4[_0xedb5('0x31')][_0xedb5('0x41')]){_0x510354[_0xedb5('0x42')]=[{'all':!![]}];}_0x510354=_[_0xedb5('0x3e')]({},_0x510354,_0x3f04e4['options']);return db['UserProfileSection'][_0xedb5('0x48')](_0x510354)[_0xedb5('0x24')](handleEntityNotFound(_0xabbe57,null))[_0xedb5('0x24')](respondWithResult(_0xabbe57,null))[_0xedb5('0x45')](handleError(_0xabbe57,null));};exports[_0xedb5('0x49')]=function(_0x562e58,_0x530978){return db['UserProfileSection']['create'](_0x562e58[_0xedb5('0x4a')],{})['then'](respondWithResult(_0x530978,0xc9))[_0xedb5('0x45')](handleError(_0x530978,null));};exports['update']=function(_0xc68921,_0x4286ea){if(_0xc68921['body']['id']){delete _0xc68921[_0xedb5('0x4a')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0xc68921['params']['id']}})[_0xedb5('0x24')](handleEntityNotFound(_0x4286ea,null))['then'](saveUpdates(_0xc68921[_0xedb5('0x4a')],null))[_0xedb5('0x24')](respondWithResult(_0x4286ea,null))[_0xedb5('0x45')](handleError(_0x4286ea,null));};exports[_0xedb5('0x25')]=function(_0x51bceb,_0x3b3c66){return db[_0xedb5('0x2c')][_0xedb5('0x48')]({'where':{'id':_0x51bceb[_0xedb5('0x47')]['id']}})[_0xedb5('0x24')](handleEntityNotFound(_0x3b3c66,null))[_0xedb5('0x24')](removeEntity(_0x3b3c66,null))[_0xedb5('0x45')](handleError(_0x3b3c66,null));};exports[_0xedb5('0x4b')]=function(_0x239eb0,_0x35b7b6){return db[_0xedb5('0x2c')][_0xedb5('0x4b')]()['then'](respondWithResult(_0x35b7b6,null))[_0xedb5('0x45')](handleError(_0x35b7b6,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ff69cb5..4caff27 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 _0xae29=['bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','../../config/logger','api','moment'];(function(_0x296d1b,_0x1f0bf0){var _0x3c747f=function(_0x1d5096){while(--_0x1d5096){_0x296d1b['push'](_0x296d1b['shift']());}};_0x3c747f(++_0x1f0bf0);}(_0xae29,0xda));var _0x9ae2=function(_0x2a99ee,_0x2adb3d){_0x2a99ee=_0x2a99ee-0x0;var _0x4d2ae3=_0xae29[_0x2a99ee];return _0x4d2ae3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ae2('0x0'))(_0x9ae2('0x1'));var moment=require(_0x9ae2('0x2'));var BPromise=require(_0x9ae2('0x3'));var rp=require(_0x9ae2('0x4'));var fs=require('fs');var path=require(_0x9ae2('0x5'));var rimraf=require('rimraf');var config=require(_0x9ae2('0x6'));var attributes=require(_0x9ae2('0x7'));module['exports']=function(_0x2556d3,_0x12c080){return _0x2556d3[_0x9ae2('0x8')](_0x9ae2('0x9'),attributes,{'tableName':_0x9ae2('0xa'),'paranoid':![],'indexes':[{'name':_0x9ae2('0xb'),'fields':[_0x9ae2('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc4=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','api','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define'];(function(_0xcd49bd,_0x2a12a3){var _0xb6ee44=function(_0x1f77bb){while(--_0x1f77bb){_0xcd49bd['push'](_0xcd49bd['shift']());}};_0xb6ee44(++_0x2a12a3);}(_0x3fc4,0x125));var _0x43fc=function(_0x4dd512,_0x339e08){_0x4dd512=_0x4dd512-0x0;var _0x287c86=_0x3fc4[_0x4dd512];return _0x287c86;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x43fc('0x0'));var moment=require('moment');var BPromise=require(_0x43fc('0x1'));var rp=require(_0x43fc('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43fc('0x3'));var config=require('../../config/environment');var attributes=require(_0x43fc('0x4'));module[_0x43fc('0x5')]=function(_0x2fc378,_0x5ae7f1){return _0x2fc378[_0x43fc('0x6')](_0x43fc('0x7'),attributes,{'tableName':_0x43fc('0x8'),'paranoid':![],'indexes':[{'name':_0x43fc('0x9'),'fields':[_0x43fc('0xa'),_0x43fc('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index a78be0d..23b84c3 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 _0x1eec=['request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','UserProfileSection,\x20%s,\x20%s'];(function(_0x2ec7b2,_0x542eb9){var _0x2c868f=function(_0xde0af9){while(--_0xde0af9){_0x2ec7b2['push'](_0x2ec7b2['shift']());}};_0x2c868f(++_0x542eb9);}(_0x1eec,0x1bf));var _0xc1ee=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x1eec[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require(_0xc1ee('0x0'));var moment=require('moment');var BPromise=require(_0xc1ee('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1ee('0x2'));var db=require(_0xc1ee('0x3'))['db'];var utils=require(_0xc1ee('0x4'));var logger=require('../../config/logger')(_0xc1ee('0x5'));var config=require(_0xc1ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc1ee('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16f56d,_0x3619c8,_0x418c76){return new BPromise(function(_0x437c58,_0x2f025b){return client[_0xc1ee('0x8')](_0x16f56d,_0x418c76)[_0xc1ee('0x9')](function(_0x5b5a1b){logger[_0xc1ee('0xa')](_0xc1ee('0xb'),_0x3619c8,_0xc1ee('0xc'));logger['debug'](_0xc1ee('0xd'),_0x3619c8,'request\x20sent',JSON['stringify'](_0x5b5a1b));if(_0x5b5a1b[_0xc1ee('0xe')]){if(_0x5b5a1b['error']['code']===0x1f4){logger['error'](_0xc1ee('0xb'),_0x3619c8,_0x5b5a1b[_0xc1ee('0xe')][_0xc1ee('0xf')]);return _0x2f025b(_0x5b5a1b[_0xc1ee('0xe')]['message']);}logger['error'](_0xc1ee('0xb'),_0x3619c8,_0x5b5a1b['error']['message']);return _0x437c58(_0x5b5a1b[_0xc1ee('0xe')][_0xc1ee('0xf')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x3619c8,_0xc1ee('0xc'));_0x437c58(_0x5b5a1b['result'][_0xc1ee('0xf')]);}})[_0xc1ee('0x10')](function(_0x3ae080){logger[_0xc1ee('0xe')](_0xc1ee('0xb'),_0x3619c8,_0x3ae080);_0x2f025b(_0x3ae080);});});} \ No newline at end of file +var _0x4911=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch'];(function(_0x4abe25,_0x3d2379){var _0x472ebf=function(_0x592f0d){while(--_0x592f0d){_0x4abe25['push'](_0x4abe25['shift']());}};_0x472ebf(++_0x3d2379);}(_0x4911,0xa8));var _0x1491=function(_0x47d1ae,_0x41e056){_0x47d1ae=_0x47d1ae-0x0;var _0x47328a=_0x4911[_0x47d1ae];return _0x47328a;};'use strict';var _=require('lodash');var util=require(_0x1491('0x0'));var moment=require(_0x1491('0x1'));var BPromise=require(_0x1491('0x2'));var rs=require(_0x1491('0x3'));var fs=require('fs');var Redis=require(_0x1491('0x4'));var db=require(_0x1491('0x5'))['db'];var utils=require(_0x1491('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1491('0x7'));var client=jayson[_0x1491('0x8')][_0x1491('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38af7c,_0x2bb54e,_0x4b90fe){return new BPromise(function(_0x27f27f,_0x1edcda){return client[_0x1491('0xa')](_0x38af7c,_0x4b90fe)[_0x1491('0xb')](function(_0xe3d199){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x2bb54e,_0x1491('0xc'));logger[_0x1491('0xd')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2bb54e,_0x1491('0xc'),JSON['stringify'](_0xe3d199));if(_0xe3d199['error']){if(_0xe3d199[_0x1491('0xe')][_0x1491('0xf')]===0x1f4){logger['error'](_0x1491('0x10'),_0x2bb54e,_0xe3d199['error'][_0x1491('0x11')]);return _0x1edcda(_0xe3d199[_0x1491('0xe')]['message']);}logger[_0x1491('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x2bb54e,_0xe3d199[_0x1491('0xe')][_0x1491('0x11')]);return _0x27f27f(_0xe3d199[_0x1491('0xe')][_0x1491('0x11')]);}else{logger[_0x1491('0x12')](_0x1491('0x10'),_0x2bb54e,'request\x20sent');_0x27f27f(_0xe3d199[_0x1491('0x13')][_0x1491('0x11')]);}})[_0x1491('0x14')](function(_0x22f9ed){logger['error'](_0x1491('0x10'),_0x2bb54e,_0x22f9ed);_0x1edcda(_0x22f9ed);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index a28befd..9542888 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x329b3c,_0x160c83){var _0x1b37e5=function(_0x5dcdcd){while(--_0x5dcdcd){_0x329b3c['push'](_0x329b3c['shift']());}};_0x1b37e5(++_0x160c83);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x27de03,_0x4647a1){var _0x12ad03=function(_0x4ea094){while(--_0x4ea094){_0x27de03['push'](_0x27de03['shift']());}};_0x12ad03(++_0x4647a1);}(_0xedd9,0xfc));var _0x9edd=function(_0x2f33dc,_0x54da28){_0x2f33dc=_0x2f33dc-0x0;var _0x405583=_0xedd9[_0x2f33dc];return _0x405583;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index c285e5f..e6a0b4d 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 _0xa0cf=['exports','INTEGER','sequelize'];(function(_0x388ec2,_0x3cd6df){var _0x112db2=function(_0x23fd4c){while(--_0x23fd4c){_0x388ec2['push'](_0x388ec2['shift']());}};_0x112db2(++_0x3cd6df);}(_0xa0cf,0x164));var _0xfa0c=function(_0x22342c,_0x218835){_0x22342c=_0x22342c-0x0;var _0xd3b434=_0xa0cf[_0x22342c];return _0xd3b434;};'use strict';var Sequelize=require(_0xfa0c('0x0'));module[_0xfa0c('0x1')]={'penalty':{'type':Sequelize[_0xfa0c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x23d3=['INTEGER','sequelize','exports'];(function(_0x274d64,_0x41bcff){var _0x2366b3=function(_0x4273a2){while(--_0x4273a2){_0x274d64['push'](_0x274d64['shift']());}};_0x2366b3(++_0x41bcff);}(_0x23d3,0xe8));var _0x323d=function(_0x2a3c4b,_0x57a6cb){_0x2a3c4b=_0x2a3c4b-0x0;var _0x11b612=_0x23d3[_0x2a3c4b];return _0x11b612;};'use strict';var Sequelize=require(_0x323d('0x0'));module[_0x323d('0x1')]={'penalty':{'type':Sequelize[_0x323d('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 2edcf3f..a19ee4a 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 _0xb511=['rimraf','../../config/environment','exports','define','UserSmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb511,0x165));var _0x1b51=function(_0x31f178,_0x462583){_0x31f178=_0x31f178-0x0;var _0x113425=_0xb511[_0x31f178];return _0x113425;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6455=['request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x189304,_0x1339fc){var _0x3be1d9=function(_0x2dcf75){while(--_0x2dcf75){_0x189304['push'](_0x189304['shift']());}};_0x3be1d9(++_0x1339fc);}(_0x6455,0x97));var _0x5645=function(_0x174c41,_0x3959f3){_0x174c41=_0x174c41-0x0;var _0x1617f4=_0x6455[_0x174c41];return _0x1617f4;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'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 bc0e202..65de175 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 _0x6fa3=['debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','util','randomstring','ioredis','../../config/environment','jayson/promise','client','http','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x362580,_0x1a5304){var _0x1a7e2d=function(_0x47abc0){while(--_0x47abc0){_0x362580['push'](_0x362580['shift']());}};_0x1a7e2d(++_0x1a5304);}(_0x6fa3,0xd7));var _0x36fa=function(_0x2b18f2,_0xccf589){_0x2b18f2=_0x2b18f2-0x0;var _0x4ed53d=_0x6fa3[_0x2b18f2];return _0x4ed53d;};'use strict';var _=require('lodash');var util=require(_0x36fa('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x36fa('0x1'));var fs=require('fs');var Redis=require(_0x36fa('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x36fa('0x3'));var jayson=require(_0x36fa('0x4'));var client=jayson[_0x36fa('0x5')][_0x36fa('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5d17b1,_0x5a2044,_0x292242){return new BPromise(function(_0x859299,_0x2ac0a6){return client['request'](_0x5d17b1,_0x292242)['then'](function(_0x25079d){logger[_0x36fa('0x7')](_0x36fa('0x8'),_0x5a2044,'request\x20sent');logger[_0x36fa('0x9')](_0x36fa('0xa'),_0x5a2044,_0x36fa('0xb'),JSON[_0x36fa('0xc')](_0x25079d));if(_0x25079d[_0x36fa('0xd')]){if(_0x25079d['error'][_0x36fa('0xe')]===0x1f4){logger['error'](_0x36fa('0x8'),_0x5a2044,_0x25079d['error'][_0x36fa('0xf')]);return _0x2ac0a6(_0x25079d[_0x36fa('0xd')][_0x36fa('0xf')]);}logger[_0x36fa('0xd')](_0x36fa('0x8'),_0x5a2044,_0x25079d[_0x36fa('0xd')][_0x36fa('0xf')]);return _0x859299(_0x25079d['error'][_0x36fa('0xf')]);}else{logger[_0x36fa('0x7')](_0x36fa('0x8'),_0x5a2044,_0x36fa('0xb'));_0x859299(_0x25079d['result'][_0x36fa('0xf')]);}})['catch'](function(_0xfabc68){logger[_0x36fa('0xd')](_0x36fa('0x8'),_0x5a2044,_0xfabc68);_0x2ac0a6(_0xfabc68);});});} \ No newline at end of file +var _0xe45d=['../../config/logger','rpc','../../config/environment','jayson/promise','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils'];(function(_0x166924,_0xec53de){var _0x21dbbf=function(_0x184541){while(--_0x184541){_0x166924['push'](_0x166924['shift']());}};_0x21dbbf(++_0xec53de);}(_0xe45d,0x176));var _0xde45=function(_0x751a37,_0x16f6ad){_0x751a37=_0x751a37-0x0;var _0x383bfb=_0xe45d[_0x751a37];return _0x383bfb;};'use strict';var _=require(_0xde45('0x0'));var util=require('util');var moment=require(_0xde45('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xde45('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xde45('0x3'));var logger=require(_0xde45('0x4'))(_0xde45('0x5'));var config=require(_0xde45('0x6'));var jayson=require(_0xde45('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc160f4,_0x2be68e,_0x280de7){return new BPromise(function(_0x14029e,_0x27dcd1){return client['request'](_0xc160f4,_0x280de7)[_0xde45('0x8')](function(_0x1f8583){logger[_0xde45('0x9')](_0xde45('0xa'),_0x2be68e,_0xde45('0xb'));logger['debug'](_0xde45('0xc'),_0x2be68e,_0xde45('0xb'),JSON['stringify'](_0x1f8583));if(_0x1f8583[_0xde45('0xd')]){if(_0x1f8583[_0xde45('0xd')][_0xde45('0xe')]===0x1f4){logger[_0xde45('0xd')](_0xde45('0xa'),_0x2be68e,_0x1f8583[_0xde45('0xd')][_0xde45('0xf')]);return _0x27dcd1(_0x1f8583[_0xde45('0xd')][_0xde45('0xf')]);}logger[_0xde45('0xd')](_0xde45('0xa'),_0x2be68e,_0x1f8583['error'][_0xde45('0xf')]);return _0x14029e(_0x1f8583[_0xde45('0xd')]['message']);}else{logger[_0xde45('0x9')](_0xde45('0xa'),_0x2be68e,'request\x20sent');_0x14029e(_0x1f8583[_0xde45('0x10')][_0xde45('0xf')]);}})[_0xde45('0x11')](function(_0x597e80){logger[_0xde45('0xd')](_0xde45('0xa'),_0x2be68e,_0x597e80);_0x27dcd1(_0x597e80);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index da06e63..9753a11 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 _0xd596=['INTEGER','sequelize','exports'];(function(_0x205846,_0x4761d0){var _0x2db9ff=function(_0x5716c7){while(--_0x5716c7){_0x205846['push'](_0x205846['shift']());}};_0x2db9ff(++_0x4761d0);}(_0xd596,0x67));var _0x6d59=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xd596[_0x4c260a];return _0x17bbdd;};'use strict';var Sequelize=require(_0x6d59('0x0'));module[_0x6d59('0x1')]={'UserId':{'type':Sequelize[_0x6d59('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd140=['sequelize','exports','INTEGER'];(function(_0x1de9d4,_0x3940c4){var _0xe52a0b=function(_0x249f5e){while(--_0x249f5e){_0x1de9d4['push'](_0x1de9d4['shift']());}};_0xe52a0b(++_0x3940c4);}(_0xd140,0x108));var _0x0d14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd140[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d14('0x0'));module[_0x0d14('0x1')]={'UserId':{'type':Sequelize[_0x0d14('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x0d14('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 71c7bb6..e96bbcb 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(_0x5814fb,_0x2fbb1a){var _0x2b60c9=function(_0x32a64e){while(--_0x32a64e){_0x5814fb['push'](_0x5814fb['shift']());}};_0x2b60c9(++_0x2fbb1a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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(_0x1ee43a,_0x3c48f1){var _0xc3705d=function(_0x37e3bc){while(--_0x37e3bc){_0x1ee43a['push'](_0x1ee43a['shift']());}};_0xc3705d(++_0x3c48f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 18cb236..a2ba426 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5077d1,_0x51893b){var _0x16e1c7=function(_0x1ffd27){while(--_0x1ffd27){_0x5077d1['push'](_0x5077d1['shift']());}};_0x16e1c7(++_0x51893b);}(_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(_0x19f183,_0x540981){var _0x317275=function(_0x39d261){while(--_0x39d261){_0x19f183['push'](_0x19f183['shift']());}};_0x317275(++_0x540981);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 631db7b..283f4bc 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 _0xfa42=['INTEGER'];(function(_0x34e18e,_0x222db2){var _0x524271=function(_0x2e2769){while(--_0x2e2769){_0x34e18e['push'](_0x34e18e['shift']());}};_0x524271(++_0x222db2);}(_0xfa42,0x97));var _0x2fa4=function(_0x50e321,_0x39ce92){_0x50e321=_0x50e321-0x0;var _0x2c16a1=_0xfa42[_0x50e321];return _0x2c16a1;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x2fa4('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9d9d=['INTEGER','exports'];(function(_0x3942b1,_0x13309b){var _0x16a949=function(_0x2e1e8c){while(--_0x2e1e8c){_0x3942b1['push'](_0x3942b1['shift']());}};_0x16a949(++_0x13309b);}(_0x9d9d,0x129));var _0xd9d9=function(_0x4eaa58,_0x1f4273){_0x4eaa58=_0x4eaa58-0x0;var _0x476cda=_0x9d9d[_0x4eaa58];return _0x476cda;};'use strict';var Sequelize=require('sequelize');module[_0xd9d9('0x0')]={'penalty':{'type':Sequelize[_0xd9d9('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 e5a9e7a..2b483ea 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 _0xf951=['exports','define','UserVoiceQueue','user_has_voice_queues','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xc85a46,_0x3df076){var _0x5061ab=function(_0x841f99){while(--_0x841f99){_0xc85a46['push'](_0xc85a46['shift']());}};_0x5061ab(++_0x3df076);}(_0xf951,0x1f3));var _0x1f95=function(_0x57b2db,_0x413803){_0x57b2db=_0x57b2db-0x0;var _0x288f48=_0xf951[_0x57b2db];return _0x288f48;};'use strict';var _=require('lodash');var util=require(_0x1f95('0x0'));var logger=require('../../config/logger')(_0x1f95('0x1'));var moment=require(_0x1f95('0x2'));var BPromise=require('bluebird');var rp=require(_0x1f95('0x3'));var fs=require('fs');var path=require(_0x1f95('0x4'));var rimraf=require(_0x1f95('0x5'));var config=require(_0x1f95('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x1f95('0x7')]=function(_0x1f07fa,_0x14f896){return _0x1f07fa[_0x1f95('0x8')](_0x1f95('0x9'),attributes,{'tableName':_0x1f95('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6b5=['./userVoiceQueue.attributes','define','user_has_voice_queues','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x20b986,_0x4ae649){var _0x59a42e=function(_0x2150ff){while(--_0x2150ff){_0x20b986['push'](_0x20b986['shift']());}};_0x59a42e(++_0x4ae649);}(_0xa6b5,0x7b));var _0x5a6b=function(_0x25509e,_0x1914ac){_0x25509e=_0x25509e-0x0;var _0x363ebb=_0xa6b5[_0x25509e];return _0x363ebb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a6b('0x0'))(_0x5a6b('0x1'));var moment=require(_0x5a6b('0x2'));var BPromise=require('bluebird');var rp=require(_0x5a6b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5a6b('0x4'));var attributes=require(_0x5a6b('0x5'));module['exports']=function(_0xe1796c,_0x455d80){return _0xe1796c[_0x5a6b('0x6')]('UserVoiceQueue',attributes,{'tableName':_0x5a6b('0x7'),'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 a5bf15d..6578da9 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 _0x05a2=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x462cce,_0x259961){var _0x420ff8=function(_0x57485c){while(--_0x57485c){_0x462cce['push'](_0x462cce['shift']());}};_0x420ff8(++_0x259961);}(_0x05a2,0x12d));var _0x205a=function(_0x304c01,_0x41a9db){_0x304c01=_0x304c01-0x0;var _0x4551b6=_0x05a2[_0x304c01];return _0x4551b6;};'use strict';var _=require(_0x205a('0x0'));var util=require(_0x205a('0x1'));var moment=require('moment');var BPromise=require(_0x205a('0x2'));var rs=require(_0x205a('0x3'));var fs=require('fs');var Redis=require(_0x205a('0x4'));var db=require(_0x205a('0x5'))['db'];var utils=require(_0x205a('0x6'));var logger=require(_0x205a('0x7'))(_0x205a('0x8'));var config=require(_0x205a('0x9'));var jayson=require(_0x205a('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf1daa,_0x1fb102,_0x4d0597){return new BPromise(function(_0x3079db,_0x1000f8){return client[_0x205a('0xb')](_0xf1daa,_0x4d0597)['then'](function(_0x5609ef){logger[_0x205a('0xc')](_0x205a('0xd'),_0x1fb102,'request\x20sent');logger[_0x205a('0xe')](_0x205a('0xf'),_0x1fb102,'request\x20sent',JSON[_0x205a('0x10')](_0x5609ef));if(_0x5609ef['error']){if(_0x5609ef['error'][_0x205a('0x11')]===0x1f4){logger[_0x205a('0x12')](_0x205a('0xd'),_0x1fb102,_0x5609ef['error'][_0x205a('0x13')]);return _0x1000f8(_0x5609ef[_0x205a('0x12')][_0x205a('0x13')]);}logger['error'](_0x205a('0xd'),_0x1fb102,_0x5609ef[_0x205a('0x12')]['message']);return _0x3079db(_0x5609ef[_0x205a('0x12')]['message']);}else{logger[_0x205a('0xc')](_0x205a('0xd'),_0x1fb102,_0x205a('0x14'));_0x3079db(_0x5609ef[_0x205a('0x15')][_0x205a('0x13')]);}})['catch'](function(_0x5002da){logger['error'](_0x205a('0xd'),_0x1fb102,_0x5002da);_0x1000f8(_0x5002da);});});} \ No newline at end of file +var _0x7577=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','randomstring','../../config/utils'];(function(_0xa65f15,_0x51c41a){var _0x3b1371=function(_0x446a61){while(--_0x446a61){_0xa65f15['push'](_0xa65f15['shift']());}};_0x3b1371(++_0x51c41a);}(_0x7577,0x95));var _0x7757=function(_0x13a484,_0x55f9b1){_0x13a484=_0x13a484-0x0;var _0x28a89a=_0x7577[_0x13a484];return _0x28a89a;};'use strict';var _=require(_0x7757('0x0'));var util=require(_0x7757('0x1'));var moment=require(_0x7757('0x2'));var BPromise=require('bluebird');var rs=require(_0x7757('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7757('0x4'));var logger=require(_0x7757('0x5'))(_0x7757('0x6'));var config=require(_0x7757('0x7'));var jayson=require(_0x7757('0x8'));var client=jayson[_0x7757('0x9')][_0x7757('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a27da,_0x39ef15,_0x5c790b){return new BPromise(function(_0x2898d1,_0x31233c){return client[_0x7757('0xb')](_0x1a27da,_0x5c790b)['then'](function(_0x49ff69){logger['info'](_0x7757('0xc'),_0x39ef15,'request\x20sent');logger[_0x7757('0xd')](_0x7757('0xe'),_0x39ef15,'request\x20sent',JSON[_0x7757('0xf')](_0x49ff69));if(_0x49ff69[_0x7757('0x10')]){if(_0x49ff69[_0x7757('0x10')][_0x7757('0x11')]===0x1f4){logger['error'](_0x7757('0xc'),_0x39ef15,_0x49ff69['error'][_0x7757('0x12')]);return _0x31233c(_0x49ff69['error'][_0x7757('0x12')]);}logger[_0x7757('0x10')](_0x7757('0xc'),_0x39ef15,_0x49ff69['error'][_0x7757('0x12')]);return _0x2898d1(_0x49ff69[_0x7757('0x10')][_0x7757('0x12')]);}else{logger[_0x7757('0x13')](_0x7757('0xc'),_0x39ef15,_0x7757('0x14'));_0x2898d1(_0x49ff69['result']['message']);}})[_0x7757('0x15')](function(_0x6e967){logger[_0x7757('0x10')](_0x7757('0xc'),_0x39ef15,_0x6e967);_0x31233c(_0x6e967);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index b41ef0f..885f2b5 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x52ff9d,_0x261336){var _0x39b24b=function(_0x49dcdd){while(--_0x49dcdd){_0x52ff9d['push'](_0x52ff9d['shift']());}};_0x39b24b(++_0x261336);}(_0xe706,0xa3));var _0x6e70=function(_0x310da1,_0x390f65){_0x310da1=_0x310da1-0x0;var _0x333d17=_0xe706[_0x310da1];return _0x333d17;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c63428f..fad8641 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 _0x5ca8=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5ca8,0x71));var _0x85ca=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5ca8[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0x85ca('0x0'));module[_0x85ca('0x1')]={'uniqueid':{'type':Sequelize[_0x85ca('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x85ca('0x3')},'membername':{'type':Sequelize[_0x85ca('0x4')],'allowNull':![],'comment':_0x85ca('0x3')},'UserId':{'type':Sequelize[_0x85ca('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x85ca('0x5'),'comment':_0x85ca('0x3')},'VoiceQueueId':{'type':Sequelize[_0x85ca('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x85ca('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x85ca('0x2')](0xb),'defaultValue':0x0,'comment':_0x85ca('0x3')},'paused':{'type':Sequelize[_0x85ca('0x2')](0xb),'defaultValue':0x0,'comment':_0x85ca('0x3')}}; \ No newline at end of file +var _0xf586=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0xf586,0x124));var _0x6f58=function(_0x4383e9,_0xa4b307){_0x4383e9=_0x4383e9-0x0;var _0x355405=_0xf586[_0x4383e9];return _0x355405;};'use strict';var Sequelize=require(_0x6f58('0x0'));module[_0x6f58('0x1')]={'uniqueid':{'type':Sequelize[_0x6f58('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6f58('0x3')},'membername':{'type':Sequelize[_0x6f58('0x4')],'allowNull':![],'comment':_0x6f58('0x3')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x6f58('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x6f58('0x4')],'allowNull':![],'unique':_0x6f58('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x6f58('0x2')](0xb),'defaultValue':0x0,'comment':_0x6f58('0x3')},'paused':{'type':Sequelize[_0x6f58('0x2')](0xb),'defaultValue':0x0,'comment':_0x6f58('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 53c14dc..43641d2 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 _0xf9a4=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x562d1d,_0x4b8def){var _0x4eeb00=function(_0x58849b){while(--_0x58849b){_0x562d1d['push'](_0x562d1d['shift']());}};_0x4eeb00(++_0x4b8def);}(_0xf9a4,0x86));var _0x4f9a=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xf9a4[_0x2112d4];return _0x434972;};'use strict';var EventEmitter=require(_0x4f9a('0x0'));var UserVoiceQueueRt=require(_0x4f9a('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x4f9a('0x2')](0x0);var events={'afterCreate':_0x4f9a('0x3'),'afterUpdate':_0x4f9a('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe3d211){return function(_0x191fe2,_0x19836f,_0x1f6040){UserVoiceQueueRtEvents[_0x4f9a('0x5')](_0xe3d211+':'+_0x191fe2['id'],_0x191fe2);UserVoiceQueueRtEvents['emit'](_0xe3d211,_0x191fe2);_0x1f6040(null);};}for(var e in events){if(events[_0x4f9a('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x4f9a('0x7')](e,emitEvent(event));}}module[_0x4f9a('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x7b12=['UserVoiceQueueRt','setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b12,0xcf));var _0x27b1=function(_0x4814a7,_0x1a084d){_0x4814a7=_0x4814a7-0x0;var _0x406700=_0x7b12[_0x4814a7];return _0x406700;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x27b1('0x0'))['db'][_0x27b1('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x27b1('0x2')](0x0);var events={'afterCreate':_0x27b1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12ce3b){return function(_0x5a563d,_0x529943,_0x2a46b8){UserVoiceQueueRtEvents['emit'](_0x12ce3b+':'+_0x5a563d['id'],_0x5a563d);UserVoiceQueueRtEvents[_0x27b1('0x4')](_0x12ce3b,_0x5a563d);_0x2a46b8(null);};}for(var e in events){if(events[_0x27b1('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0x27b1('0x6')](e,emitEvent(event));}}module[_0x27b1('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 89ec2b1..994ab85 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 _0x6a9f=['util','api','request-promise','path','rimraf','../../config/environment','define','lodash'];(function(_0x5258dc,_0x45b282){var _0x3aa4c7=function(_0x226da7){while(--_0x226da7){_0x5258dc['push'](_0x5258dc['shift']());}};_0x3aa4c7(++_0x45b282);}(_0x6a9f,0x187));var _0xf6a9=function(_0x5a9daf,_0x2cc19f){_0x5a9daf=_0x5a9daf-0x0;var _0x15a833=_0x6a9f[_0x5a9daf];return _0x15a833;};'use strict';var _=require(_0xf6a9('0x0'));var util=require(_0xf6a9('0x1'));var logger=require('../../config/logger')(_0xf6a9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6a9('0x3'));var fs=require('fs');var path=require(_0xf6a9('0x4'));var rimraf=require(_0xf6a9('0x5'));var config=require(_0xf6a9('0x6'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x5d7e6a,_0x5f572e){return _0x5d7e6a[_0xf6a9('0x7')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2bf=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x505c75,_0x4b87e2){var _0x1f6f00=function(_0x4abaf4){while(--_0x4abaf4){_0x505c75['push'](_0x505c75['shift']());}};_0x1f6f00(++_0x4b87e2);}(_0xe2bf,0x143));var _0xfe2b=function(_0x729735,_0x15c8d8){_0x729735=_0x729735-0x0;var _0x262707=_0xe2bf[_0x729735];return _0x262707;};'use strict';var _=require(_0xfe2b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfe2b('0x1'));var moment=require(_0xfe2b('0x2'));var BPromise=require('bluebird');var rp=require(_0xfe2b('0x3'));var fs=require('fs');var path=require(_0xfe2b('0x4'));var rimraf=require(_0xfe2b('0x5'));var config=require(_0xfe2b('0x6'));var attributes=require(_0xfe2b('0x7'));module['exports']=function(_0x38442b,_0x561ff0){return _0x38442b[_0xfe2b('0x8')](_0xfe2b('0x9'),attributes,{'tableName':_0xfe2b('0xa'),'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 d205f32..e9c2a37 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 _0x4dce=['./userVoiceQueueRt.socket','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4dce,0x1d0));var _0xe4dc=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0x4dce[_0xa76664];return _0x3f7743;};'use strict';var _=require(_0xe4dc('0x0'));var util=require(_0xe4dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe4dc('0x2'));var fs=require('fs');var Redis=require(_0xe4dc('0x3'));var db=require(_0xe4dc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4dc('0x5'))(_0xe4dc('0x6'));var config=require(_0xe4dc('0x7'));var jayson=require(_0xe4dc('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xe4dc('0x9')]=_['defaults'](config['redis'],{'host':_0xe4dc('0xa'),'port':0x18eb});var socket=require(_0xe4dc('0xb'))(new Redis(config['redis']));require(_0xe4dc('0xc'))[_0xe4dc('0xd')](socket);function respondWithRpcPromise(_0x3fb33f,_0x4b8796,_0x19680a){return new BPromise(function(_0x36fc54,_0xfe726b){return client['request'](_0x3fb33f,_0x19680a)[_0xe4dc('0xe')](function(_0xcf6df2){logger[_0xe4dc('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b8796,_0xe4dc('0x10'));logger[_0xe4dc('0x11')](_0xe4dc('0x12'),_0x4b8796,_0xe4dc('0x10'),JSON[_0xe4dc('0x13')](_0xcf6df2));if(_0xcf6df2[_0xe4dc('0x14')]){if(_0xcf6df2[_0xe4dc('0x14')][_0xe4dc('0x15')]===0x1f4){logger[_0xe4dc('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b8796,_0xcf6df2[_0xe4dc('0x14')][_0xe4dc('0x16')]);return _0xfe726b(_0xcf6df2[_0xe4dc('0x14')][_0xe4dc('0x16')]);}logger[_0xe4dc('0x14')](_0xe4dc('0x17'),_0x4b8796,_0xcf6df2[_0xe4dc('0x14')][_0xe4dc('0x16')]);return _0x36fc54(_0xcf6df2['error'][_0xe4dc('0x16')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4b8796,_0xe4dc('0x10'));_0x36fc54(_0xcf6df2['result'][_0xe4dc('0x16')]);}})[_0xe4dc('0x18')](function(_0x1157c4){logger[_0xe4dc('0x14')](_0xe4dc('0x17'),_0x4b8796,_0x1157c4);_0xfe726b(_0x1157c4);});});}exports[_0xe4dc('0x19')]=function(_0x30212a){var _0x10f615=this;return new Promise(function(_0x3c0277,_0x301eec){return db[_0xe4dc('0x1a')][_0xe4dc('0x1b')]({'raw':_0x30212a['options']?_0x30212a[_0xe4dc('0x1c')][_0xe4dc('0x1d')]===undefined?!![]:![]:!![],'where':_0x30212a[_0xe4dc('0x1c')]?_0x30212a[_0xe4dc('0x1c')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xe4dc('0x1e')]['fn']('IF',db[_0xe4dc('0x1e')][_0xe4dc('0x1f')](_0xe4dc('0x20')))),_0xe4dc('0x21')]]})[_0xe4dc('0xe')](function(_0x5bad81){logger['info'](_0xe4dc('0x19'),_0x30212a);logger[_0xe4dc('0x11')]('GetVoiceQueueRtPauses',_0x30212a,JSON[_0xe4dc('0x13')](_0x5bad81));_0x3c0277(_0x5bad81);})[_0xe4dc('0x18')](function(_0x1e555d){logger[_0xe4dc('0x14')](_0xe4dc('0x19'),_0x1e555d[_0xe4dc('0x16')],_0x30212a);_0x301eec(_0x10f615['error'](0x1f4,_0x1e555d['message']));});});}; \ No newline at end of file +var _0x6e7e=['stringify','error','message','result','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','GetVoiceQueueRtPauses','catch','lodash','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s'];(function(_0x20af37,_0x426de4){var _0x567361=function(_0x23978c){while(--_0x23978c){_0x20af37['push'](_0x20af37['shift']());}};_0x567361(++_0x426de4);}(_0x6e7e,0x159));var _0xe6e7=function(_0x20fa63,_0x65c8d3){_0x20fa63=_0x20fa63-0x0;var _0x4c37ae=_0x6e7e[_0x20fa63];return _0x4c37ae;};'use strict';var _=require(_0xe6e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe6e7('0x1'));var db=require(_0xe6e7('0x2'))['db'];var utils=require(_0xe6e7('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xe6e7('0x4'));var jayson=require(_0xe6e7('0x5'));var client=jayson[_0xe6e7('0x6')][_0xe6e7('0x7')]({'port':0x232a});config[_0xe6e7('0x8')]=_['defaults'](config[_0xe6e7('0x8')],{'host':_0xe6e7('0x9'),'port':0x18eb});var socket=require(_0xe6e7('0xa'))(new Redis(config[_0xe6e7('0x8')]));require('./userVoiceQueueRt.socket')[_0xe6e7('0xb')](socket);function respondWithRpcPromise(_0x1ae9d9,_0x75b552,_0x3aafa9){return new BPromise(function(_0x2cc882,_0x5c7c47){return client[_0xe6e7('0xc')](_0x1ae9d9,_0x3aafa9)['then'](function(_0x14029d){logger[_0xe6e7('0xd')](_0xe6e7('0xe'),_0x75b552,_0xe6e7('0xf'));logger[_0xe6e7('0x10')](_0xe6e7('0x11'),_0x75b552,_0xe6e7('0xf'),JSON[_0xe6e7('0x12')](_0x14029d));if(_0x14029d[_0xe6e7('0x13')]){if(_0x14029d[_0xe6e7('0x13')]['code']===0x1f4){logger['error'](_0xe6e7('0xe'),_0x75b552,_0x14029d['error'][_0xe6e7('0x14')]);return _0x5c7c47(_0x14029d[_0xe6e7('0x13')][_0xe6e7('0x14')]);}logger[_0xe6e7('0x13')](_0xe6e7('0xe'),_0x75b552,_0x14029d[_0xe6e7('0x13')][_0xe6e7('0x14')]);return _0x2cc882(_0x14029d['error']['message']);}else{logger['info'](_0xe6e7('0xe'),_0x75b552,_0xe6e7('0xf'));_0x2cc882(_0x14029d[_0xe6e7('0x15')][_0xe6e7('0x14')]);}})['catch'](function(_0x334c61){logger['error'](_0xe6e7('0xe'),_0x75b552,_0x334c61);_0x5c7c47(_0x334c61);});});}exports['GetVoiceQueueRtPauses']=function(_0x217e6c){var _0x78a01a=this;return new Promise(function(_0x297357,_0x56e8af){return db['UserVoiceQueueRt'][_0xe6e7('0x16')]({'raw':_0x217e6c[_0xe6e7('0x17')]?_0x217e6c[_0xe6e7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x217e6c[_0xe6e7('0x17')]?_0x217e6c['options'][_0xe6e7('0x18')]||null:null,'attributes':[[db[_0xe6e7('0x19')]['fn'](_0xe6e7('0x1a'),db[_0xe6e7('0x19')]['fn']('IF',db['sequelize'][_0xe6e7('0x1b')](_0xe6e7('0x1c')))),_0xe6e7('0x1d')]]})[_0xe6e7('0x1e')](function(_0x3e72df){logger[_0xe6e7('0xd')](_0xe6e7('0x1f'),_0x217e6c);logger['debug'](_0xe6e7('0x1f'),_0x217e6c,JSON[_0xe6e7('0x12')](_0x3e72df));_0x297357(_0x3e72df);})[_0xe6e7('0x20')](function(_0x431938){logger['error'](_0xe6e7('0x1f'),_0x431938['message'],_0x217e6c);_0x56e8af(_0x78a01a[_0xe6e7('0x13')](0x1f4,_0x431938['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index b79781f..33ee801 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 _0x9aac=['emit','removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','remove','update'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9aac,0x135));var _0xc9aa=function(_0x1d7147,_0x16612f){_0x1d7147=_0x1d7147-0x0;var _0x2cd9a0=_0x9aac[_0x1d7147];return _0x2cd9a0;};'use strict';var UserVoiceQueueRtEvents=require(_0xc9aa('0x0'));var events=['save',_0xc9aa('0x1'),_0xc9aa('0x2')];function createListener(_0x57da2f,_0xaee75d){return function(_0x4e88d6){_0xaee75d[_0xc9aa('0x3')](_0x57da2f,_0x4e88d6);};}function removeListener(_0x5c8ce2,_0x28c49c){return function(){UserVoiceQueueRtEvents[_0xc9aa('0x4')](_0x5c8ce2,_0x28c49c);};}exports['register']=function(_0x280687){for(var _0x2f9029=0x0,_0x34beeb=events['length'];_0x2f9029<_0x34beeb;_0x2f9029++){var _0x2f3fde=events[_0x2f9029];var _0x24829f=createListener(_0xc9aa('0x5')+_0x2f3fde,_0x280687);UserVoiceQueueRtEvents['on'](_0x2f3fde,_0x24829f);}}; \ No newline at end of file +var _0x2d2c=['save','remove','update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x57d795,_0x3c6e8a){var _0x389c56=function(_0x109c85){while(--_0x109c85){_0x57d795['push'](_0x57d795['shift']());}};_0x389c56(++_0x3c6e8a);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x2d2c[_0x340756];return _0x2ef745;};'use strict';var UserVoiceQueueRtEvents=require(_0xc2d2('0x0'));var events=[_0xc2d2('0x1'),_0xc2d2('0x2'),_0xc2d2('0x3')];function createListener(_0x3c2bdc,_0x157b48){return function(_0x4a1460){_0x157b48[_0xc2d2('0x4')](_0x3c2bdc,_0x4a1460);};}function removeListener(_0x4ea94c,_0x22d836){return function(){UserVoiceQueueRtEvents[_0xc2d2('0x5')](_0x4ea94c,_0x22d836);};}exports[_0xc2d2('0x6')]=function(_0x45ad0c){for(var _0xe9cf0e=0x0,_0x5d2d3f=events['length'];_0xe9cf0e<_0x5d2d3f;_0xe9cf0e++){var _0x241c02=events[_0xe9cf0e];var _0x13c6c6=createListener(_0xc2d2('0x7')+_0x241c02,_0x45ad0c);UserVoiceQueueRtEvents['on'](_0x241c02,_0x13c6c6);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e173c02..8a14a33 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x580d0e,_0x1e5f43){var _0xb51111=function(_0x4718e7){while(--_0x4718e7){_0x580d0e['push'](_0x580d0e['shift']());}};_0xb51111(++_0x1e5f43);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x234494,_0x2fec34){var _0x5229fe=function(_0x21b028){while(--_0x21b028){_0x234494['push'](_0x234494['shift']());}};_0x5229fe(++_0x2fec34);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 1d0db23..465974b 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 _0x6379=['sequelize','exports','INTEGER'];(function(_0x506855,_0x398908){var _0x214809=function(_0x57f6ae){while(--_0x57f6ae){_0x506855['push'](_0x506855['shift']());}};_0x214809(++_0x398908);}(_0x6379,0x84));var _0x9637=function(_0x924c29,_0x309120){_0x924c29=_0x924c29-0x0;var _0x24ddd6=_0x6379[_0x924c29];return _0x24ddd6;};'use strict';var Sequelize=require(_0x9637('0x0'));module[_0x9637('0x1')]={'penalty':{'type':Sequelize[_0x9637('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2dfd=['sequelize','exports','INTEGER'];(function(_0xbe6b49,_0x48c808){var _0x3c313c=function(_0x369b04){while(--_0x369b04){_0xbe6b49['push'](_0xbe6b49['shift']());}};_0x3c313c(++_0x48c808);}(_0x2dfd,0x12f));var _0xd2df=function(_0xa685a0,_0x75e4f8){_0xa685a0=_0xa685a0-0x0;var _0x4f34f0=_0x2dfd[_0xa685a0];return _0x4f34f0;};'use strict';var Sequelize=require(_0xd2df('0x0'));module[_0xd2df('0x1')]={'penalty':{'type':Sequelize[_0xd2df('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 933fa41..55384d4 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 _0x799c=['user_has_whatsapp_queues','util','../../config/logger','moment','path','rimraf','../../config/environment','exports','UserWhatsappQueue'];(function(_0x241de8,_0x24c165){var _0x19fb75=function(_0x3f1515){while(--_0x3f1515){_0x241de8['push'](_0x241de8['shift']());}};_0x19fb75(++_0x24c165);}(_0x799c,0x160));var _0xc799=function(_0xf5754b,_0x50d057){_0xf5754b=_0xf5754b-0x0;var _0x1a9aa5=_0x799c[_0xf5754b];return _0x1a9aa5;};'use strict';var _=require('lodash');var util=require(_0xc799('0x0'));var logger=require(_0xc799('0x1'))('api');var moment=require(_0xc799('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc799('0x3'));var rimraf=require(_0xc799('0x4'));var config=require(_0xc799('0x5'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc799('0x6')]=function(_0x2ca624,_0x310b46){return _0x2ca624['define'](_0xc799('0x7'),attributes,{'tableName':_0xc799('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x375a=['bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x375a,0x1a0));var _0xa375=function(_0x1cc301,_0x5985bc){_0x1cc301=_0x1cc301-0x0;var _0x597919=_0x375a[_0x1cc301];return _0x597919;};'use strict';var _=require(_0xa375('0x0'));var util=require('util');var logger=require(_0xa375('0x1'))(_0xa375('0x2'));var moment=require(_0xa375('0x3'));var BPromise=require(_0xa375('0x4'));var rp=require(_0xa375('0x5'));var fs=require('fs');var path=require(_0xa375('0x6'));var rimraf=require('rimraf');var config=require(_0xa375('0x7'));var attributes=require(_0xa375('0x8'));module[_0xa375('0x9')]=function(_0x39054c,_0x29f50b){return _0x39054c['define'](_0xa375('0xa'),attributes,{'tableName':_0xa375('0xb'),'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 0c892b8..4786898 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 _0xa141=['info','UserWhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1d7665,_0x1f134a){var _0x47aa73=function(_0x2d0988){while(--_0x2d0988){_0x1d7665['push'](_0x1d7665['shift']());}};_0x47aa73(++_0x1f134a);}(_0xa141,0x1d6));var _0x1a14=function(_0x21c3dc,_0x6c6c14){_0x21c3dc=_0x21c3dc-0x0;var _0x5ab4a3=_0xa141[_0x21c3dc];return _0x5ab4a3;};'use strict';var _=require(_0x1a14('0x0'));var util=require('util');var moment=require(_0x1a14('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a14('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a14('0x3'))(_0x1a14('0x4'));var config=require(_0x1a14('0x5'));var jayson=require(_0x1a14('0x6'));var client=jayson['client'][_0x1a14('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38fa65,_0x3f85fb,_0x536a01){return new BPromise(function(_0x3d463e,_0x582f89){return client[_0x1a14('0x8')](_0x38fa65,_0x536a01)[_0x1a14('0x9')](function(_0x3e5bf5){logger[_0x1a14('0xa')](_0x1a14('0xb'),_0x3f85fb,'request\x20sent');logger[_0x1a14('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3f85fb,_0x1a14('0xd'),JSON[_0x1a14('0xe')](_0x3e5bf5));if(_0x3e5bf5[_0x1a14('0xf')]){if(_0x3e5bf5[_0x1a14('0xf')][_0x1a14('0x10')]===0x1f4){logger[_0x1a14('0xf')](_0x1a14('0xb'),_0x3f85fb,_0x3e5bf5[_0x1a14('0xf')][_0x1a14('0x11')]);return _0x582f89(_0x3e5bf5[_0x1a14('0xf')][_0x1a14('0x11')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x3f85fb,_0x3e5bf5[_0x1a14('0xf')][_0x1a14('0x11')]);return _0x3d463e(_0x3e5bf5['error'][_0x1a14('0x11')]);}else{logger[_0x1a14('0xa')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3f85fb,_0x1a14('0xd'));_0x3d463e(_0x3e5bf5[_0x1a14('0x12')]['message']);}})[_0x1a14('0x13')](function(_0x278490){logger[_0x1a14('0xf')](_0x1a14('0xb'),_0x3f85fb,_0x278490);_0x582f89(_0x278490);});});} \ No newline at end of file +var _0x03d7=['moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x512b4b,_0x1827cb){var _0x1f210e=function(_0x10d646){while(--_0x10d646){_0x512b4b['push'](_0x512b4b['shift']());}};_0x1f210e(++_0x1827cb);}(_0x03d7,0x1a2));var _0x703d=function(_0x34b030,_0x8cf8d9){_0x34b030=_0x34b030-0x0;var _0x515c46=_0x03d7[_0x34b030];return _0x515c46;};'use strict';var _=require(_0x703d('0x0'));var util=require(_0x703d('0x1'));var moment=require(_0x703d('0x2'));var BPromise=require('bluebird');var rs=require(_0x703d('0x3'));var fs=require('fs');var Redis=require(_0x703d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x703d('0x5'));var logger=require('../../config/logger')(_0x703d('0x6'));var config=require(_0x703d('0x7'));var jayson=require(_0x703d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ff498,_0x4b417d,_0x24b45a){return new BPromise(function(_0x765df6,_0x1a4b47){return client[_0x703d('0x9')](_0x1ff498,_0x24b45a)[_0x703d('0xa')](function(_0x46f2d9){logger[_0x703d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4b417d,_0x703d('0xc'));logger[_0x703d('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4b417d,_0x703d('0xc'),JSON[_0x703d('0xe')](_0x46f2d9));if(_0x46f2d9[_0x703d('0xf')]){if(_0x46f2d9[_0x703d('0xf')][_0x703d('0x10')]===0x1f4){logger[_0x703d('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4b417d,_0x46f2d9[_0x703d('0xf')]['message']);return _0x1a4b47(_0x46f2d9[_0x703d('0xf')][_0x703d('0x11')]);}logger[_0x703d('0xf')](_0x703d('0x12'),_0x4b417d,_0x46f2d9[_0x703d('0xf')][_0x703d('0x11')]);return _0x765df6(_0x46f2d9[_0x703d('0xf')][_0x703d('0x11')]);}else{logger[_0x703d('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x4b417d,_0x703d('0xc'));_0x765df6(_0x46f2d9[_0x703d('0x13')][_0x703d('0x11')]);}})[_0x703d('0x14')](function(_0x35a2e1){logger[_0x703d('0xf')](_0x703d('0x12'),_0x4b417d,_0x35a2e1);_0x1a4b47(_0x35a2e1);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 5c21509..ba105b3 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 _0xc978=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x8c97('0x0'));var util=require(_0x8c97('0x1'));var path=require(_0x8c97('0x2'));var timeout=require(_0x8c97('0x3'));var express=require(_0x8c97('0x4'));var router=express[_0x8c97('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c97('0x6'));var interaction=require(_0x8c97('0x7'));var config=require(_0x8c97('0x8'));var controller=require(_0x8c97('0x9'));router[_0x8c97('0xa')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0xc')]);router['get'](_0x8c97('0xd'),auth[_0x8c97('0xb')](),controller[_0x8c97('0xe')]);router[_0x8c97('0xf')]('/',auth[_0x8c97('0xb')](),controller[_0x8c97('0x10')]);router[_0x8c97('0x11')]('/:id',auth[_0x8c97('0xb')](),controller[_0x8c97('0x12')]);router[_0x8c97('0x13')](_0x8c97('0xd'),auth[_0x8c97('0xb')](),controller[_0x8c97('0x14')]);module[_0x8c97('0x15')]=router; \ No newline at end of file +var _0x4be6=['./variable.controller','isAuthenticated','index','get','show','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4d31c9,_0x2fbc37){var _0x1518d9=function(_0x4fc14e){while(--_0x4fc14e){_0x4d31c9['push'](_0x4d31c9['shift']());}};_0x1518d9(++_0x2fbc37);}(_0x4be6,0xb5));var _0x64be=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x4be6[_0x13606d];return _0x1b85b0;};'use strict';var multer=require('multer');var util=require(_0x64be('0x0'));var path=require(_0x64be('0x1'));var timeout=require(_0x64be('0x2'));var express=require(_0x64be('0x3'));var router=express[_0x64be('0x4')]();var fs_extra=require(_0x64be('0x5'));var auth=require(_0x64be('0x6'));var interaction=require(_0x64be('0x7'));var config=require(_0x64be('0x8'));var controller=require(_0x64be('0x9'));router['get']('/',auth[_0x64be('0xa')](),controller[_0x64be('0xb')]);router[_0x64be('0xc')]('/:id',auth[_0x64be('0xa')](),controller[_0x64be('0xd')]);router['post']('/',auth[_0x64be('0xa')](),controller['create']);router[_0x64be('0xe')](_0x64be('0xf'),auth['isAuthenticated'](),controller[_0x64be('0x10')]);router[_0x64be('0x11')](_0x64be('0xf'),auth[_0x64be('0xa')](),controller['destroy']);module[_0x64be('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c35da3d..aa8651a 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 _0x36fe=['exports','STRING','name','sequelize'];(function(_0x49fa90,_0xd09a7a){var _0x36e3db=function(_0x2e5d65){while(--_0x2e5d65){_0x49fa90['push'](_0x49fa90['shift']());}};_0x36e3db(++_0xd09a7a);}(_0x36fe,0x17b));var _0xe36f=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0x36fe[_0x34b87f];return _0x449805;};'use strict';var Sequelize=require(_0xe36f('0x0'));module[_0xe36f('0x1')]={'name':{'type':Sequelize[_0xe36f('0x2')],'unique':_0xe36f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe36f('0x2')]}}; \ No newline at end of file +var _0x2e51=['STRING','sequelize','exports','name'];(function(_0x274a5f,_0xaea11a){var _0xe72b3=function(_0x495c27){while(--_0x495c27){_0x274a5f['push'](_0x274a5f['shift']());}};_0xe72b3(++_0xaea11a);}(_0x2e51,0x1b9));var _0x12e5=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x2e51[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x12e5('0x0'));module[_0x12e5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x12e5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x12e5('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0c19001..52d8137 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 _0x0b0e=['body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','then','destroy','UserProfileResource','error','name','send','map','Variable','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','catch','show','keys','includeAll','find'];(function(_0xe28306,_0x3417a9){var _0x334806=function(_0x10264b){while(--_0x10264b){_0xe28306['push'](_0xe28306['shift']());}};_0x334806(++_0x3417a9);}(_0x0b0e,0x1d9));var _0xe0b0=function(_0x450f09,_0x59561d){_0x450f09=_0x450f09-0x0;var _0x4e22ec=_0x0b0e[_0x450f09];return _0x4e22ec;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0b0('0xa'));var _=require('lodash');var squel=require(_0xe0b0('0xb'));var crypto=require(_0xe0b0('0xc'));var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require(_0xe0b0('0x10'));var Redis=require('ioredis');var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require(_0xe0b0('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xe0b0('0x15'));var licenseUtil=require(_0xe0b0('0x16'));var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x49df5e,_0x511b96){_0x511b96=_0x511b96||0xcc;return function(_0x2b4d08){if(_0x2b4d08){return _0x49df5e[_0xe0b0('0x18')](_0x511b96);}return _0x49df5e[_0xe0b0('0x19')](_0x511b96)['end']();};}function respondWithResult(_0x5884a5,_0x32cba5){_0x32cba5=_0x32cba5||0xc8;return function(_0x59cff9){if(_0x59cff9){return _0x5884a5[_0xe0b0('0x19')](_0x32cba5)[_0xe0b0('0x1a')](_0x59cff9);}};}function respondWithFilteredResult(_0x29b202,_0x530ca4){return function(_0x15597f){if(_0x15597f){var _0xc36972=typeof _0x530ca4[_0xe0b0('0x1b')]===_0xe0b0('0x1c')&&typeof _0x530ca4['limit']===_0xe0b0('0x1c');var _0x5d9786=_0x15597f[_0xe0b0('0x1d')];var _0x353b83=_0xc36972?0x0:_0x530ca4[_0xe0b0('0x1b')];var _0x56a4a6=_0xc36972?_0x15597f['count']:_0x530ca4['offset']+_0x530ca4[_0xe0b0('0x1e')];var _0x5281c9;if(_0x56a4a6>=_0x5d9786){_0x56a4a6=_0x5d9786;_0x5281c9=0xc8;}else{_0x5281c9=0xce;}_0x29b202['status'](_0x5281c9);return _0x29b202[_0xe0b0('0x1f')]('Content-Range',_0x353b83+'-'+_0x56a4a6+'/'+_0x5d9786)[_0xe0b0('0x1a')](_0x15597f);}return null;};}function patchUpdates(_0x3e3773){return function(_0x2d9162){try{jsonpatch[_0xe0b0('0x20')](_0x2d9162,_0x3e3773,!![]);}catch(_0x44b9d6){return BPromise['reject'](_0x44b9d6);}return _0x2d9162[_0xe0b0('0x21')]();};}function saveUpdates(_0x5ba044,_0x2d82b5){return function(_0x2b2351){if(_0x2b2351){return _0x2b2351['update'](_0x5ba044)[_0xe0b0('0x22')](function(_0x47e5e9){return _0x47e5e9;});}return null;};}function removeEntity(_0x22a4d6,_0x599847){return function(_0x5b47a1){if(_0x5b47a1){return _0x5b47a1[_0xe0b0('0x23')]()[_0xe0b0('0x22')](function(){var _0x2aab6a=_0x5b47a1['get']({'plain':!![]});var _0x5f07cf='Variables';return db[_0xe0b0('0x24')]['destroy']({'where':{'type':_0x5f07cf,'resourceId':_0x2aab6a['id']}})[_0xe0b0('0x22')](function(){return _0x5b47a1;});})[_0xe0b0('0x22')](function(){_0x22a4d6[_0xe0b0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7db97d,_0x3306fa){return function(_0x19db27){if(!_0x19db27){_0x7db97d[_0xe0b0('0x18')](0x194);}return _0x19db27;};}function handleError(_0x2735fa,_0x3939f8){_0x3939f8=_0x3939f8||0x1f4;return function(_0x27e994){logger[_0xe0b0('0x25')](_0x27e994['stack']);if(_0x27e994[_0xe0b0('0x26')]){delete _0x27e994[_0xe0b0('0x26')];}_0x2735fa[_0xe0b0('0x19')](_0x3939f8)[_0xe0b0('0x27')](_0x27e994);};}exports['index']=function(_0x22ec53,_0x4350dd){var _0x413e5f={},_0x555606={},_0x5605b4={'count':0x0,'rows':[]};var _0x5eb85e=_[_0xe0b0('0x28')](db[_0xe0b0('0x29')]['rawAttributes'],function(_0x51616){return{'name':_0x51616['fieldName'],'type':_0x51616[_0xe0b0('0x2a')]['key']};});_0x555606[_0xe0b0('0x2b')]=_[_0xe0b0('0x28')](_0x5eb85e,_0xe0b0('0x26'));_0x555606[_0xe0b0('0x2c')]=_['keys'](_0x22ec53[_0xe0b0('0x2c')]);_0x555606[_0xe0b0('0x2d')]=_['intersection'](_0x555606[_0xe0b0('0x2b')],_0x555606[_0xe0b0('0x2c')]);_0x413e5f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x555606['model'],qs[_0xe0b0('0x30')](_0x22ec53['query'][_0xe0b0('0x30')]));_0x413e5f[_0xe0b0('0x2e')]=_0x413e5f[_0xe0b0('0x2e')][_0xe0b0('0x31')]?_0x413e5f[_0xe0b0('0x2e')]:_0x555606[_0xe0b0('0x2b')];if(!_0x22ec53[_0xe0b0('0x2c')][_0xe0b0('0x32')](_0xe0b0('0x33'))){_0x413e5f[_0xe0b0('0x1e')]=qs[_0xe0b0('0x1e')](_0x22ec53[_0xe0b0('0x2c')][_0xe0b0('0x1e')]);_0x413e5f[_0xe0b0('0x1b')]=qs[_0xe0b0('0x1b')](_0x22ec53[_0xe0b0('0x2c')]['offset']);}_0x413e5f[_0xe0b0('0x34')]=qs[_0xe0b0('0x35')](_0x22ec53['query'][_0xe0b0('0x35')]);_0x413e5f[_0xe0b0('0x36')]=qs['filters'](_[_0xe0b0('0x37')](_0x22ec53[_0xe0b0('0x2c')],_0x555606[_0xe0b0('0x2d')]),_0x5eb85e);if(_0x22ec53['query']['filter']){_0x413e5f[_0xe0b0('0x36')]=_[_0xe0b0('0x38')](_0x413e5f['where'],{'$or':_['map'](_0x5eb85e,function(_0x13e9d5){if(_0x13e9d5[_0xe0b0('0x2a')]!=='VIRTUAL'){var _0x3d3ae9={};_0x3d3ae9[_0x13e9d5[_0xe0b0('0x26')]]={'$like':'%'+_0x22ec53[_0xe0b0('0x2c')][_0xe0b0('0x39')]+'%'};return _0x3d3ae9;}})});}_0x413e5f=_['merge']({},_0x413e5f,_0x22ec53[_0xe0b0('0x3a')]);var _0xc5fb37={'where':_0x413e5f[_0xe0b0('0x36')]};return db['Variable'][_0xe0b0('0x1d')](_0xc5fb37)['then'](function(_0x223688){_0x5605b4['count']=_0x223688;if(_0x22ec53['query']['includeAll']){_0x413e5f[_0xe0b0('0x3b')]=[{'all':!![]}];}return db['Variable'][_0xe0b0('0x3c')](_0x413e5f);})[_0xe0b0('0x22')](function(_0x24456f){_0x5605b4['rows']=_0x24456f;return _0x5605b4;})[_0xe0b0('0x22')](respondWithFilteredResult(_0x4350dd,_0x413e5f))[_0xe0b0('0x3d')](handleError(_0x4350dd,null));};exports[_0xe0b0('0x3e')]=function(_0x4dedee,_0x566f36){var _0x3d2f32={'raw':!![],'where':{'id':_0x4dedee['params']['id']}},_0x16f914={};_0x16f914[_0xe0b0('0x2b')]=_[_0xe0b0('0x3f')](db['Variable']['rawAttributes']);_0x16f914[_0xe0b0('0x2c')]=_[_0xe0b0('0x3f')](_0x4dedee[_0xe0b0('0x2c')]);_0x16f914[_0xe0b0('0x2d')]=_[_0xe0b0('0x2f')](_0x16f914[_0xe0b0('0x2b')],_0x16f914['query']);_0x3d2f32['attributes']=_[_0xe0b0('0x2f')](_0x16f914[_0xe0b0('0x2b')],qs['fields'](_0x4dedee[_0xe0b0('0x2c')][_0xe0b0('0x30')]));_0x3d2f32[_0xe0b0('0x2e')]=_0x3d2f32['attributes']['length']?_0x3d2f32[_0xe0b0('0x2e')]:_0x16f914[_0xe0b0('0x2b')];if(_0x4dedee[_0xe0b0('0x2c')][_0xe0b0('0x40')]){_0x3d2f32[_0xe0b0('0x3b')]=[{'all':!![]}];}_0x3d2f32=_[_0xe0b0('0x38')]({},_0x3d2f32,_0x4dedee[_0xe0b0('0x3a')]);return db[_0xe0b0('0x29')][_0xe0b0('0x41')](_0x3d2f32)['then'](handleEntityNotFound(_0x566f36,null))[_0xe0b0('0x22')](respondWithResult(_0x566f36,null))['catch'](handleError(_0x566f36,null));};exports['create']=function(_0x572a64,_0x4b28a7){return db[_0xe0b0('0x29')]['create'](_0x572a64[_0xe0b0('0x42')],{})['then'](function(_0x4bebad){var _0x4f4af2=_0x572a64[_0xe0b0('0x43')][_0xe0b0('0x44')]({'plain':!![]});if(!_0x4f4af2)throw new Error(_0xe0b0('0x45'));if(_0x4f4af2[_0xe0b0('0x46')]===_0xe0b0('0x43')){var _0x581f94=_0x4bebad[_0xe0b0('0x44')]({'plain':!![]});var _0x4f0f74='Variables';return db[_0xe0b0('0x47')][_0xe0b0('0x41')]({'where':{'name':_0x4f0f74,'userProfileId':_0x4f4af2[_0xe0b0('0x48')]},'raw':!![]})[_0xe0b0('0x22')](function(_0x36849b){if(_0x36849b&&_0x36849b[_0xe0b0('0x49')]===0x0){return db[_0xe0b0('0x24')][_0xe0b0('0x4a')]({'name':_0x581f94['name'],'resourceId':_0x581f94['id'],'type':_0x36849b['name'],'sectionId':_0x36849b['id']},{})[_0xe0b0('0x22')](function(){return _0x4bebad;});}else{return _0x4bebad;}})[_0xe0b0('0x3d')](function(_0x3471b5){logger['error'](_0xe0b0('0x4b'),_0x3471b5);throw _0x3471b5;});}return _0x4bebad;})[_0xe0b0('0x22')](respondWithResult(_0x4b28a7,0xc9))[_0xe0b0('0x3d')](handleError(_0x4b28a7,null));};exports['update']=function(_0x72e88d,_0x2ec6aa){if(_0x72e88d[_0xe0b0('0x42')]['id']){delete _0x72e88d[_0xe0b0('0x42')]['id'];}return db['Variable'][_0xe0b0('0x41')]({'where':{'id':_0x72e88d[_0xe0b0('0x4c')]['id']}})[_0xe0b0('0x22')](handleEntityNotFound(_0x2ec6aa,null))[_0xe0b0('0x22')](saveUpdates(_0x72e88d[_0xe0b0('0x42')],null))['then'](respondWithResult(_0x2ec6aa,null))[_0xe0b0('0x3d')](handleError(_0x2ec6aa,null));};exports[_0xe0b0('0x23')]=function(_0x50f522,_0x16ff12){return db[_0xe0b0('0x29')][_0xe0b0('0x41')]({'where':{'id':_0x50f522[_0xe0b0('0x4c')]['id']}})[_0xe0b0('0x22')](handleEntityNotFound(_0x16ff12,null))[_0xe0b0('0x22')](removeEntity(_0x16ff12,null))[_0xe0b0('0x3d')](handleError(_0x16ff12,null));}; \ No newline at end of file +var _0x1696=['status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','keys','include','options','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x556980,_0x12f938){var _0x1fe209=function(_0x3700e0){while(--_0x3700e0){_0x556980['push'](_0x556980['shift']());}};_0x1fe209(++_0x12f938);}(_0x1696,0x17e));var _0x6169=function(_0x5f34ae,_0x437c00){_0x5f34ae=_0x5f34ae-0x0;var _0x9a3405=_0x1696[_0x5f34ae];return _0x9a3405;};'use strict';var emlformat=require(_0x6169('0x0'));var rimraf=require(_0x6169('0x1'));var zipdir=require(_0x6169('0x2'));var jsonpatch=require(_0x6169('0x3'));var rp=require(_0x6169('0x4'));var moment=require(_0x6169('0x5'));var BPromise=require(_0x6169('0x6'));var Mustache=require(_0x6169('0x7'));var util=require(_0x6169('0x8'));var path=require(_0x6169('0x9'));var sox=require(_0x6169('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6169('0xb'));var _=require(_0x6169('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6169('0xd'));var deskjs=require(_0x6169('0xe'));var toCsv=require(_0x6169('0xf'));var querystring=require(_0x6169('0x10'));var Papa=require(_0x6169('0x11'));var Redis=require(_0x6169('0x12'));var authService=require(_0x6169('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6169('0x14'));var logger=require(_0x6169('0x15'))(_0x6169('0x16'));var utils=require('../../config/utils');var config=require(_0x6169('0x17'));var licenseUtil=require(_0x6169('0x18'));var db=require(_0x6169('0x19'))['db'];function respondWithStatusCode(_0x3c0bed,_0x3fee49){_0x3fee49=_0x3fee49||0xcc;return function(_0x56b42b){if(_0x56b42b){return _0x3c0bed[_0x6169('0x1a')](_0x3fee49);}return _0x3c0bed['status'](_0x3fee49)[_0x6169('0x1b')]();};}function respondWithResult(_0x476ea9,_0x5a9455){_0x5a9455=_0x5a9455||0xc8;return function(_0x34cfec){if(_0x34cfec){return _0x476ea9[_0x6169('0x1c')](_0x5a9455)[_0x6169('0x1d')](_0x34cfec);}};}function respondWithFilteredResult(_0x5eaffe,_0x4addf0){return function(_0xc65b28){if(_0xc65b28){var _0x3ba2a7=typeof _0x4addf0[_0x6169('0x1e')]===_0x6169('0x1f')&&typeof _0x4addf0[_0x6169('0x20')]===_0x6169('0x1f');var _0x426779=_0xc65b28[_0x6169('0x21')];var _0x2c2afc=_0x3ba2a7?0x0:_0x4addf0[_0x6169('0x1e')];var _0x27de7f=_0x3ba2a7?_0xc65b28['count']:_0x4addf0[_0x6169('0x1e')]+_0x4addf0[_0x6169('0x20')];var _0x3747c2;if(_0x27de7f>=_0x426779){_0x27de7f=_0x426779;_0x3747c2=0xc8;}else{_0x3747c2=0xce;}_0x5eaffe[_0x6169('0x1c')](_0x3747c2);return _0x5eaffe[_0x6169('0x22')]('Content-Range',_0x2c2afc+'-'+_0x27de7f+'/'+_0x426779)['json'](_0xc65b28);}return null;};}function patchUpdates(_0x32c6de){return function(_0xe3baf2){try{jsonpatch['apply'](_0xe3baf2,_0x32c6de,!![]);}catch(_0x31d599){return BPromise[_0x6169('0x23')](_0x31d599);}return _0xe3baf2[_0x6169('0x24')]();};}function saveUpdates(_0x3cebd6,_0x832bdd){return function(_0xceaa53){if(_0xceaa53){return _0xceaa53[_0x6169('0x25')](_0x3cebd6)[_0x6169('0x26')](function(_0x1c2f2a){return _0x1c2f2a;});}return null;};}function removeEntity(_0x2dd060,_0x4ab13d){return function(_0x18d568){if(_0x18d568){return _0x18d568[_0x6169('0x27')]()[_0x6169('0x26')](function(){var _0x15674a=_0x18d568[_0x6169('0x28')]({'plain':!![]});var _0x4662b9=_0x6169('0x29');return db[_0x6169('0x2a')][_0x6169('0x27')]({'where':{'type':_0x4662b9,'resourceId':_0x15674a['id']}})[_0x6169('0x26')](function(){return _0x18d568;});})[_0x6169('0x26')](function(){_0x2dd060[_0x6169('0x1c')](0xcc)[_0x6169('0x1b')]();});}};}function handleEntityNotFound(_0x3c8218,_0x3b6f79){return function(_0xbb22a9){if(!_0xbb22a9){_0x3c8218['sendStatus'](0x194);}return _0xbb22a9;};}function handleError(_0x3446d3,_0x368b78){_0x368b78=_0x368b78||0x1f4;return function(_0x20e903){logger[_0x6169('0x2b')](_0x20e903[_0x6169('0x2c')]);if(_0x20e903[_0x6169('0x2d')]){delete _0x20e903[_0x6169('0x2d')];}_0x3446d3[_0x6169('0x1c')](_0x368b78)[_0x6169('0x2e')](_0x20e903);};}exports[_0x6169('0x2f')]=function(_0xa9e09a,_0x18ea6b){var _0x17ff1c={},_0x14ebfd={},_0x4a3f20={'count':0x0,'rows':[]};var _0x5c757f=_[_0x6169('0x30')](db[_0x6169('0x31')][_0x6169('0x32')],function(_0x59c3c1){return{'name':_0x59c3c1[_0x6169('0x33')],'type':_0x59c3c1[_0x6169('0x34')][_0x6169('0x35')]};});_0x14ebfd[_0x6169('0x36')]=_[_0x6169('0x30')](_0x5c757f,'name');_0x14ebfd[_0x6169('0x37')]=_['keys'](_0xa9e09a[_0x6169('0x37')]);_0x14ebfd['filters']=_[_0x6169('0x38')](_0x14ebfd[_0x6169('0x36')],_0x14ebfd['query']);_0x17ff1c[_0x6169('0x39')]=_[_0x6169('0x38')](_0x14ebfd[_0x6169('0x36')],qs[_0x6169('0x3a')](_0xa9e09a[_0x6169('0x37')][_0x6169('0x3a')]));_0x17ff1c[_0x6169('0x39')]=_0x17ff1c['attributes'][_0x6169('0x3b')]?_0x17ff1c[_0x6169('0x39')]:_0x14ebfd[_0x6169('0x36')];if(!_0xa9e09a[_0x6169('0x37')]['hasOwnProperty'](_0x6169('0x3c'))){_0x17ff1c[_0x6169('0x20')]=qs['limit'](_0xa9e09a[_0x6169('0x37')][_0x6169('0x20')]);_0x17ff1c[_0x6169('0x1e')]=qs[_0x6169('0x1e')](_0xa9e09a[_0x6169('0x37')][_0x6169('0x1e')]);}_0x17ff1c['order']=qs[_0x6169('0x3d')](_0xa9e09a['query'][_0x6169('0x3d')]);_0x17ff1c[_0x6169('0x3e')]=qs[_0x6169('0x3f')](_[_0x6169('0x40')](_0xa9e09a[_0x6169('0x37')],_0x14ebfd[_0x6169('0x3f')]),_0x5c757f);if(_0xa9e09a[_0x6169('0x37')][_0x6169('0x41')]){_0x17ff1c[_0x6169('0x3e')]=_[_0x6169('0x42')](_0x17ff1c[_0x6169('0x3e')],{'$or':_[_0x6169('0x30')](_0x5c757f,function(_0x4410fc){if(_0x4410fc[_0x6169('0x34')]!==_0x6169('0x43')){var _0x44ce8e={};_0x44ce8e[_0x4410fc[_0x6169('0x2d')]]={'$like':'%'+_0xa9e09a[_0x6169('0x37')][_0x6169('0x41')]+'%'};return _0x44ce8e;}})});}_0x17ff1c=_[_0x6169('0x42')]({},_0x17ff1c,_0xa9e09a['options']);var _0x30ccf0={'where':_0x17ff1c[_0x6169('0x3e')]};return db[_0x6169('0x31')][_0x6169('0x21')](_0x30ccf0)[_0x6169('0x26')](function(_0xdd9772){_0x4a3f20[_0x6169('0x21')]=_0xdd9772;if(_0xa9e09a['query'][_0x6169('0x44')]){_0x17ff1c['include']=[{'all':!![]}];}return db[_0x6169('0x31')]['findAll'](_0x17ff1c);})['then'](function(_0x45b926){_0x4a3f20['rows']=_0x45b926;return _0x4a3f20;})[_0x6169('0x26')](respondWithFilteredResult(_0x18ea6b,_0x17ff1c))[_0x6169('0x45')](handleError(_0x18ea6b,null));};exports[_0x6169('0x46')]=function(_0x378986,_0x4ecad1){var _0xdaf63a={'raw':!![],'where':{'id':_0x378986[_0x6169('0x47')]['id']}},_0xbe094d={};_0xbe094d['model']=_['keys'](db[_0x6169('0x31')]['rawAttributes']);_0xbe094d[_0x6169('0x37')]=_[_0x6169('0x48')](_0x378986['query']);_0xbe094d[_0x6169('0x3f')]=_[_0x6169('0x38')](_0xbe094d[_0x6169('0x36')],_0xbe094d[_0x6169('0x37')]);_0xdaf63a['attributes']=_[_0x6169('0x38')](_0xbe094d[_0x6169('0x36')],qs[_0x6169('0x3a')](_0x378986[_0x6169('0x37')][_0x6169('0x3a')]));_0xdaf63a['attributes']=_0xdaf63a[_0x6169('0x39')][_0x6169('0x3b')]?_0xdaf63a['attributes']:_0xbe094d[_0x6169('0x36')];if(_0x378986['query'][_0x6169('0x44')]){_0xdaf63a[_0x6169('0x49')]=[{'all':!![]}];}_0xdaf63a=_[_0x6169('0x42')]({},_0xdaf63a,_0x378986[_0x6169('0x4a')]);return db[_0x6169('0x31')][_0x6169('0x4b')](_0xdaf63a)[_0x6169('0x26')](handleEntityNotFound(_0x4ecad1,null))[_0x6169('0x26')](respondWithResult(_0x4ecad1,null))[_0x6169('0x45')](handleError(_0x4ecad1,null));};exports[_0x6169('0x4c')]=function(_0x5d53f,_0x245722){return db[_0x6169('0x31')][_0x6169('0x4c')](_0x5d53f[_0x6169('0x4d')],{})['then'](function(_0x4fd9d6){var _0x4a4379=_0x5d53f['user']['get']({'plain':!![]});if(!_0x4a4379)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a4379['role']===_0x6169('0x4e')){var _0x517483=_0x4fd9d6['get']({'plain':!![]});var _0x48b9db=_0x6169('0x29');return db['UserProfileSection'][_0x6169('0x4b')]({'where':{'name':_0x48b9db,'userProfileId':_0x4a4379[_0x6169('0x4f')]},'raw':!![]})[_0x6169('0x26')](function(_0xa46b62){if(_0xa46b62&&_0xa46b62[_0x6169('0x50')]===0x0){return db[_0x6169('0x2a')][_0x6169('0x4c')]({'name':_0x517483[_0x6169('0x2d')],'resourceId':_0x517483['id'],'type':_0xa46b62[_0x6169('0x2d')],'sectionId':_0xa46b62['id']},{})[_0x6169('0x26')](function(){return _0x4fd9d6;});}else{return _0x4fd9d6;}})['catch'](function(_0x4306c4){logger[_0x6169('0x2b')](_0x6169('0x51'),_0x4306c4);throw _0x4306c4;});}return _0x4fd9d6;})[_0x6169('0x26')](respondWithResult(_0x245722,0xc9))[_0x6169('0x45')](handleError(_0x245722,null));};exports[_0x6169('0x25')]=function(_0x5f13f6,_0x1ad762){if(_0x5f13f6[_0x6169('0x4d')]['id']){delete _0x5f13f6[_0x6169('0x4d')]['id'];}return db['Variable'][_0x6169('0x4b')]({'where':{'id':_0x5f13f6[_0x6169('0x47')]['id']}})[_0x6169('0x26')](handleEntityNotFound(_0x1ad762,null))[_0x6169('0x26')](saveUpdates(_0x5f13f6['body'],null))[_0x6169('0x26')](respondWithResult(_0x1ad762,null))['catch'](handleError(_0x1ad762,null));};exports[_0x6169('0x27')]=function(_0x11d788,_0x4c2be3){return db[_0x6169('0x31')][_0x6169('0x4b')]({'where':{'id':_0x11d788[_0x6169('0x47')]['id']}})['then'](handleEntityNotFound(_0x4c2be3,null))[_0x6169('0x26')](removeEntity(_0x4c2be3,null))['catch'](handleError(_0x4c2be3,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 51b0480..bc6321b 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 _0x11bd=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash'];(function(_0x21d5a8,_0x361102){var _0x159072=function(_0x5db4dd){while(--_0x5db4dd){_0x21d5a8['push'](_0x21d5a8['shift']());}};_0x159072(++_0x361102);}(_0x11bd,0x8e));var _0xd11b=function(_0x426d01,_0x3c14a2){_0x426d01=_0x426d01-0x0;var _0xb723b1=_0x11bd[_0x426d01];return _0xb723b1;};'use strict';var _=require(_0xd11b('0x0'));var util=require(_0xd11b('0x1'));var logger=require('../../config/logger')(_0xd11b('0x2'));var moment=require(_0xd11b('0x3'));var BPromise=require(_0xd11b('0x4'));var rp=require(_0xd11b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd11b('0x6'));var config=require(_0xd11b('0x7'));var attributes=require(_0xd11b('0x8'));module[_0xd11b('0x9')]=function(_0x3b4d67,_0x1af2fd){return _0x3b4d67[_0xd11b('0xa')](_0xd11b('0xb'),attributes,{'tableName':_0xd11b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6117=['./variable.attributes','exports','define','Variable','tools_variables','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x211b0b,_0x383bea){var _0x3a0b82=function(_0x5471ae){while(--_0x5471ae){_0x211b0b['push'](_0x211b0b['shift']());}};_0x3a0b82(++_0x383bea);}(_0x6117,0x75));var _0x7611=function(_0x426724,_0x15925f){_0x426724=_0x426724-0x0;var _0x8ffc9c=_0x6117[_0x426724];return _0x8ffc9c;};'use strict';var _=require('lodash');var util=require(_0x7611('0x0'));var logger=require(_0x7611('0x1'))(_0x7611('0x2'));var moment=require(_0x7611('0x3'));var BPromise=require(_0x7611('0x4'));var rp=require(_0x7611('0x5'));var fs=require('fs');var path=require(_0x7611('0x6'));var rimraf=require(_0x7611('0x7'));var config=require(_0x7611('0x8'));var attributes=require(_0x7611('0x9'));module[_0x7611('0xa')]=function(_0x5a220b,_0xd8e3b1){return _0x5a220b[_0x7611('0xb')](_0x7611('0xc'),attributes,{'tableName':_0x7611('0xd'),'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 5b8897c..12f9596 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 _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0xe497ae,_0x49ef16){var _0x341ef0=function(_0x2b396c){while(--_0x2b396c){_0xe497ae['push'](_0xe497ae['shift']());}};_0x341ef0(++_0x49ef16);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x5bb3a6,_0xc89ee3){var _0x279273=function(_0x232bdf){while(--_0x232bdf){_0x5bb3a6['push'](_0x5bb3a6['shift']());}};_0x279273(++_0xc89ee3);}(_0x5fc3,0xa8));var _0x35fc=function(_0x19ac6e,_0x435862){_0x19ac6e=_0x19ac6e-0x0;var _0x1cdcf3=_0x5fc3[_0x19ac6e];return _0x1cdcf3;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index fca0508..20bdee1 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 _0x0ce1=['/reset','isAuthenticated','reset','pull','restart','migrations','exports','express','Router','./version.controller','get','index','/fetch','canUpdate'];(function(_0x1ae727,_0x517287){var _0x641361=function(_0x2a8ac3){while(--_0x2a8ac3){_0x1ae727['push'](_0x1ae727['shift']());}};_0x641361(++_0x517287);}(_0x0ce1,0x1e3));var _0x10ce=function(_0x3db23b,_0x57f147){_0x3db23b=_0x3db23b-0x0;var _0x39cdf5=_0x0ce1[_0x3db23b];return _0x39cdf5;};'use strict';var express=require(_0x10ce('0x0'));var router=express[_0x10ce('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x10ce('0x2'));router[_0x10ce('0x3')]('/',controller[_0x10ce('0x4')]);router['get'](_0x10ce('0x5'),auth['isAuthenticated'](),auth[_0x10ce('0x6')](),controller['fetch']);router[_0x10ce('0x3')](_0x10ce('0x7'),auth[_0x10ce('0x8')](),auth[_0x10ce('0x6')](),controller[_0x10ce('0x9')]);router[_0x10ce('0x3')]('/pull',auth[_0x10ce('0x8')](),auth['canUpdate'](),controller[_0x10ce('0xa')]);router[_0x10ce('0x3')]('/restart',auth[_0x10ce('0x8')](),controller[_0x10ce('0xb')]);router[_0x10ce('0x3')]('/migrations',controller[_0x10ce('0xc')]);module[_0x10ce('0xd')]=router; \ No newline at end of file +var _0x1ae8=['/migrations','migrations','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','/pull','/restart','restart'];(function(_0xbd7925,_0x2d046b){var _0x213b72=function(_0x2c9784){while(--_0x2c9784){_0xbd7925['push'](_0xbd7925['shift']());}};_0x213b72(++_0x2d046b);}(_0x1ae8,0x15b));var _0x81ae=function(_0x4f24bc,_0x115b87){_0x4f24bc=_0x4f24bc-0x0;var _0x2d1c0f=_0x1ae8[_0x4f24bc];return _0x2d1c0f;};'use strict';var express=require('express');var router=express[_0x81ae('0x0')]();var auth=require(_0x81ae('0x1'));var controller=require(_0x81ae('0x2'));router[_0x81ae('0x3')]('/',controller[_0x81ae('0x4')]);router[_0x81ae('0x3')](_0x81ae('0x5'),auth[_0x81ae('0x6')](),auth[_0x81ae('0x7')](),controller[_0x81ae('0x8')]);router[_0x81ae('0x3')](_0x81ae('0x9'),auth['isAuthenticated'](),auth[_0x81ae('0x7')](),controller['reset']);router[_0x81ae('0x3')](_0x81ae('0xa'),auth['isAuthenticated'](),auth[_0x81ae('0x7')](),controller['pull']);router[_0x81ae('0x3')](_0x81ae('0xb'),auth[_0x81ae('0x6')](),controller[_0x81ae('0xc')]);router[_0x81ae('0x3')](_0x81ae('0xd'),controller[_0x81ae('0xe')]);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 84d707a..2f3fe14 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 _0xbd01=['info','git\x20fetch','reset','FETCH_HEAD','error','git\x20reset\x20--hard\x20FETCH_HEAD','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','length','push','sequelize','getQueryInterface','server','map','last','catch','UniqueConstraintError','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','status','json','origin','master'];(function(_0x3fa296,_0x2bd315){var _0x10b19f=function(_0x2c868d){while(--_0x2c868d){_0x3fa296['push'](_0x3fa296['shift']());}};_0x10b19f(++_0x2bd315);}(_0xbd01,0x131));var _0x1bd0=function(_0x3697c5,_0x581f85){_0x3697c5=_0x3697c5-0x0;var _0x3b2a9f=_0xbd01[_0x3697c5];return _0x3b2a9f;};'use strict';var Umzug=require('umzug');var path=require(_0x1bd0('0x0'));var fs=require('fs');var _=require(_0x1bd0('0x1'));var pkginfo=require(_0x1bd0('0x2'))(module,_0x1bd0('0x3'));var compareVersions=require(_0x1bd0('0x4'));var exec=require(_0x1bd0('0x5'))[_0x1bd0('0x6')];var db=require(_0x1bd0('0x7'))['db'];var config=require(_0x1bd0('0x8'));var pm2=require(_0x1bd0('0x9'));var logger=require(_0x1bd0('0xa'))(_0x1bd0('0xb'));var git=require(_0x1bd0('0xc'))(config[_0x1bd0('0xd')]);exports[_0x1bd0('0xe')]=function(_0xa1f1ca,_0x4245ce){var _0x55dcdc={'current':module[_0x1bd0('0xf')][_0x1bd0('0x3')],'phonebar':0x2};if(_0xa1f1ca[_0x1bd0('0x10')]&&_0xa1f1ca[_0x1bd0('0x10')][_0x1bd0('0x11')]){return git[_0x1bd0('0x12')]()[_0x1bd0('0x13')](function(_0x494cc5,_0x280186){_0x55dcdc[_0x1bd0('0x11')]=(_0x494cc5?module['exports'][_0x1bd0('0x3')]:_0x280186[_0x1bd0('0x11')])||'2.0.0';return _0x4245ce[_0x1bd0('0x14')](0xc8)[_0x1bd0('0x15')](_0x55dcdc);});}else{return _0x4245ce['status'](0xc8)[_0x1bd0('0x15')](_0x55dcdc);}};exports[_0x1bd0('0x12')]=function(_0x27bbaa,_0x36b761){return git[_0x1bd0('0x12')]([_0x1bd0('0x16'),_0x1bd0('0x17')],function(_0x16ba05){if(_0x16ba05){logger['error'](_0x16ba05);return _0x36b761[_0x1bd0('0x14')](0x1f4)[_0x1bd0('0x15')](_0x16ba05);}logger[_0x1bd0('0x18')](_0x1bd0('0x19'));return _0x36b761[_0x1bd0('0x14')](0xc8)[_0x1bd0('0x15')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x5b0fa2,_0xee49f){return git[_0x1bd0('0x1a')](['--hard',_0x1bd0('0x1b')],function(_0x1505ca){if(_0x1505ca){logger[_0x1bd0('0x1c')](_0x1505ca);return _0xee49f[_0x1bd0('0x14')](0x1f4)['json'](_0x1505ca);}logger['info'](_0x1bd0('0x1d'));return _0xee49f['status'](0xc8)[_0x1bd0('0x15')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x23a4fc,_0x25a507){exec('npm\x20install\x20--production',function(_0xed7c3f,_0x5c4884,_0x27be36){logger['info'](_0x5c4884);logger[_0x1bd0('0x18')](_0x27be36);if(_0xed7c3f){logger['error'](_0xed7c3f);return _0x25a507[_0x1bd0('0x14')](0x1f4)['json'](_0xed7c3f);}return _0x25a507[_0x1bd0('0x14')](0xc8)[_0x1bd0('0x15')]({'output':_0x5c4884});});};exports[_0x1bd0('0x1e')]=function(_0x2c63e2,_0x143341){return pm2[_0x1bd0('0x1e')](_0x1bd0('0x1f'))[_0x1bd0('0x20')](function(_0xa98c13){logger['info'](_0x1bd0('0x21'),_0xa98c13);return _0x143341[_0x1bd0('0x14')](0xc8)[_0x1bd0('0x15')]({'output':_0x1bd0('0x22')});})['catch'](function(_0x40fecc){logger[_0x1bd0('0x1c')](_0x40fecc);return _0x143341['status'](0x1f4)['json'](_0x40fecc);});};exports[_0x1bd0('0x23')]=function(_0x318597,_0x501f63){var _0x448a01=fs[_0x1bd0('0x24')](path[_0x1bd0('0x25')](config[_0x1bd0('0xd')],'server',_0x1bd0('0x23')));var _0x4090dd=[];for(var _0x1145a5=0x0;_0x1145a5<_0x448a01[_0x1bd0('0x26')];_0x1145a5++){var _0x3363c2=_0x448a01[_0x1145a5]['replace']('.js','');if(compareVersions(module[_0x1bd0('0xf')][_0x1bd0('0x3')],_0x3363c2)===-0x1){_0x4090dd[_0x1bd0('0x27')](_0x3363c2);}}if(_0x4090dd[_0x1bd0('0x26')]){var _0x58ce24=_0x4090dd['sort'](compareVersions);var _0x18209d=new Umzug({'storage':_0x1bd0('0x28'),'storageOptions':{'model':db['Migration'],'modelName':'Migration','columnName':_0x1bd0('0x3')},'migrations':{'params':[db['sequelize'][_0x1bd0('0x29')](),db['sequelize']['constructor'],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x1bd0('0x25')](config['root'],_0x1bd0('0x2a'),_0x1bd0('0x23')),'pattern':/\.js$/}});_0x18209d['up']({'migrations':_[_0x1bd0('0x2b')](_0x58ce24,function(_0x35ed28){return _0x35ed28+'.js';})})[_0x1bd0('0x20')](function(){return _0x501f63['status'](0xc8)[_0x1bd0('0x15')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+'\x20to\x20'+_[_0x1bd0('0x2c')](_0x58ce24),'migrations':_[_0x1bd0('0x25')](_0x58ce24)});})[_0x1bd0('0x2d')](function(_0x30a4f9){if(_0x30a4f9 instanceof db[_0x1bd0('0x28')][_0x1bd0('0x2e')]){return _0x501f63[_0x1bd0('0x14')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x501f63[_0x1bd0('0x14')](0x1f4)['json'](_0x30a4f9);}});}else{return _0x501f63[_0x1bd0('0x14')](0xc8)[_0x1bd0('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xbb47=['info','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','push','sequelize','Migration','getQueryInterface','constructor','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbb47,0x15b));var _0x7bb4=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0xbb47[_0xaf25ae];return _0x49732d;};'use strict';var Umzug=require(_0x7bb4('0x0'));var path=require(_0x7bb4('0x1'));var fs=require('fs');var _=require(_0x7bb4('0x2'));var pkginfo=require(_0x7bb4('0x3'))(module,_0x7bb4('0x4'));var compareVersions=require(_0x7bb4('0x5'));var exec=require(_0x7bb4('0x6'))[_0x7bb4('0x7')];var db=require(_0x7bb4('0x8'))['db'];var config=require(_0x7bb4('0x9'));var pm2=require(_0x7bb4('0xa'));var logger=require('../../config/logger')('update');var git=require(_0x7bb4('0xb'))(config[_0x7bb4('0xc')]);exports['index']=function(_0x376b73,_0x1e276e){var _0x23e24e={'current':module[_0x7bb4('0xd')][_0x7bb4('0x4')],'phonebar':0x2};if(_0x376b73[_0x7bb4('0xe')]&&_0x376b73[_0x7bb4('0xe')][_0x7bb4('0xf')]){return git[_0x7bb4('0x10')]()[_0x7bb4('0x11')](function(_0x3b91b3,_0x1d9be2){_0x23e24e[_0x7bb4('0xf')]=(_0x3b91b3?module[_0x7bb4('0xd')][_0x7bb4('0x4')]:_0x1d9be2[_0x7bb4('0xf')])||_0x7bb4('0x12');return _0x1e276e[_0x7bb4('0x13')](0xc8)['json'](_0x23e24e);});}else{return _0x1e276e['status'](0xc8)[_0x7bb4('0x14')](_0x23e24e);}};exports[_0x7bb4('0x10')]=function(_0x4c22e6,_0x415667){return git[_0x7bb4('0x10')]([_0x7bb4('0x15'),_0x7bb4('0x16')],function(_0xaafa06){if(_0xaafa06){logger[_0x7bb4('0x17')](_0xaafa06);return _0x415667[_0x7bb4('0x13')](0x1f4)[_0x7bb4('0x14')](_0xaafa06);}logger[_0x7bb4('0x18')]('git\x20fetch');return _0x415667[_0x7bb4('0x13')](0xc8)[_0x7bb4('0x14')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x7bb4('0x19')]=function(_0x35dea4,_0x39fb7c){return git[_0x7bb4('0x19')]([_0x7bb4('0x1a'),_0x7bb4('0x1b')],function(_0x45f8ff){if(_0x45f8ff){logger['error'](_0x45f8ff);return _0x39fb7c[_0x7bb4('0x13')](0x1f4)['json'](_0x45f8ff);}logger['info']('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x39fb7c[_0x7bb4('0x13')](0xc8)[_0x7bb4('0x14')]({'output':_0x7bb4('0x1c')});});};exports[_0x7bb4('0x1d')]=function(_0x24d262,_0x3691a1){exec(_0x7bb4('0x1e'),function(_0x2de38d,_0x12c0e7,_0x495ed2){logger[_0x7bb4('0x18')](_0x12c0e7);logger[_0x7bb4('0x18')](_0x495ed2);if(_0x2de38d){logger[_0x7bb4('0x17')](_0x2de38d);return _0x3691a1[_0x7bb4('0x13')](0x1f4)[_0x7bb4('0x14')](_0x2de38d);}return _0x3691a1['status'](0xc8)['json']({'output':_0x12c0e7});});};exports['restart']=function(_0x1203b3,_0x4509b5){return pm2['restart'](_0x7bb4('0x1f'))[_0x7bb4('0x20')](function(_0x594a9c){logger[_0x7bb4('0x18')]('pm2\x20restart\x20motion\x20%s',_0x594a9c);return _0x4509b5[_0x7bb4('0x13')](0xc8)[_0x7bb4('0x14')]({'output':_0x7bb4('0x21')});})[_0x7bb4('0x22')](function(_0x2eba46){logger[_0x7bb4('0x17')](_0x2eba46);return _0x4509b5[_0x7bb4('0x13')](0x1f4)[_0x7bb4('0x14')](_0x2eba46);});};exports[_0x7bb4('0x23')]=function(_0x148158,_0x275a7b){var _0x48756a=fs[_0x7bb4('0x24')](path[_0x7bb4('0x25')](config[_0x7bb4('0xc')],_0x7bb4('0x26'),'migrations'));var _0x1f35b9=[];for(var _0x930e2f=0x0;_0x930e2f<_0x48756a[_0x7bb4('0x27')];_0x930e2f++){var _0xa0d3fd=_0x48756a[_0x930e2f][_0x7bb4('0x28')]('.js','');if(compareVersions(module[_0x7bb4('0xd')][_0x7bb4('0x4')],_0xa0d3fd)===-0x1){_0x1f35b9[_0x7bb4('0x29')](_0xa0d3fd);}}if(_0x1f35b9['length']){var _0x1af2e0=_0x1f35b9['sort'](compareVersions);var _0x224801=new Umzug({'storage':_0x7bb4('0x2a'),'storageOptions':{'model':db[_0x7bb4('0x2b')],'modelName':_0x7bb4('0x2b'),'columnName':_0x7bb4('0x4')},'migrations':{'params':[db[_0x7bb4('0x2a')][_0x7bb4('0x2c')](),db[_0x7bb4('0x2a')][_0x7bb4('0x2d')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x7bb4('0x25')](config[_0x7bb4('0xc')],_0x7bb4('0x26'),_0x7bb4('0x23')),'pattern':/\.js$/}});_0x224801['up']({'migrations':_[_0x7bb4('0x2e')](_0x1af2e0,function(_0x5cf5cc){return _0x5cf5cc+_0x7bb4('0x2f');})})[_0x7bb4('0x20')](function(){return _0x275a7b[_0x7bb4('0x13')](0xc8)['json']({'output':_0x7bb4('0x30')+module[_0x7bb4('0xd')]['version']+_0x7bb4('0x31')+_[_0x7bb4('0x32')](_0x1af2e0),'migrations':_[_0x7bb4('0x25')](_0x1af2e0)});})[_0x7bb4('0x22')](function(_0x3372d7){if(_0x3372d7 instanceof db[_0x7bb4('0x2a')][_0x7bb4('0x33')]){return _0x275a7b[_0x7bb4('0x13')](0xc8)[_0x7bb4('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x275a7b['status'](0x1f4)['json'](_0x3372d7);}});}else{return _0x275a7b[_0x7bb4('0x13')](0xc8)[_0x7bb4('0x14')]({'output':_0x7bb4('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b5bf965..b685d8c 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 _0x9d5c=['/describe','describe','put','delete','/:id','multer','util','express','Router','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d5c,0x67));var _0xc9d5=function(_0x22fc91,_0x3bbbce){_0x22fc91=_0x22fc91-0x0;var _0x483790=_0x9d5c[_0x22fc91];return _0x483790;};'use strict';var multer=require(_0xc9d5('0x0'));var util=require(_0xc9d5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9d5('0x2'));var router=express[_0xc9d5('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc9d5('0x4'));var config=require('../../config/environment');var controller=require(_0xc9d5('0x5'));router['get']('/',auth[_0xc9d5('0x6')](),controller[_0xc9d5('0x7')]);router[_0xc9d5('0x8')](_0xc9d5('0x9'),auth[_0xc9d5('0x6')](),controller[_0xc9d5('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc9d5('0x6')](),controller['create']);router[_0xc9d5('0xb')]('/:id',auth[_0xc9d5('0x6')](),controller['update']);router[_0xc9d5('0xc')](_0xc9d5('0xd'),auth[_0xc9d5('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x3d1d=['create','put','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','show'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0x3d1d,0x194));var _0xd3d1=function(_0x1911fe,_0x274a78){_0x1911fe=_0x1911fe-0x0;var _0x4d8c76=_0x3d1d[_0x1911fe];return _0x4d8c76;};'use strict';var multer=require(_0xd3d1('0x0'));var util=require(_0xd3d1('0x1'));var path=require('path');var timeout=require(_0xd3d1('0x2'));var express=require(_0xd3d1('0x3'));var router=express[_0xd3d1('0x4')]();var fs_extra=require(_0xd3d1('0x5'));var auth=require(_0xd3d1('0x6'));var interaction=require(_0xd3d1('0x7'));var config=require('../../config/environment');var controller=require(_0xd3d1('0x8'));router[_0xd3d1('0x9')]('/',auth[_0xd3d1('0xa')](),controller[_0xd3d1('0xb')]);router[_0xd3d1('0x9')](_0xd3d1('0xc'),auth[_0xd3d1('0xa')](),controller['describe']);router[_0xd3d1('0x9')]('/:id',auth[_0xd3d1('0xa')](),controller[_0xd3d1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd3d1('0xe')]);router[_0xd3d1('0xf')]('/:id',auth[_0xd3d1('0xa')](),controller['update']);router[_0xd3d1('0x10')](_0xd3d1('0x11'),auth[_0xd3d1('0xa')](),controller['destroy']);module[_0xd3d1('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ccc4148..bb6cbad 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 _0x0abf=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x0abf,0xe8));var _0xf0ab=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0abf[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'type':{'type':Sequelize[_0xf0ab('0x1')]},'uniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf0ab('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf0ab('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf0ab('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf0ab('0x2')]},'holdtime':{'type':Sequelize[_0xf0ab('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf0ab('0x3')]},'agentacw':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf0ab('0x1')]},'lastevent':{'type':Sequelize[_0xf0ab('0x1')]},'channel':{'type':Sequelize[_0xf0ab('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf0ab('0x1')]},'accountcode':{'type':Sequelize[_0xf0ab('0x1')]},'context':{'type':Sequelize[_0xf0ab('0x1')]},'exten':{'type':Sequelize[_0xf0ab('0x1')]},'priority':{'type':Sequelize[_0xf0ab('0x1')]},'destchannel':{'type':Sequelize[_0xf0ab('0x1')]},'destchannelstate':{'type':Sequelize[_0xf0ab('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf0ab('0x1')]},'destcalleridname':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf0ab('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf0ab('0x1')]},'destlanguage':{'type':Sequelize[_0xf0ab('0x1')]},'destaccountcode':{'type':Sequelize[_0xf0ab('0x1')]},'destcontext':{'type':Sequelize[_0xf0ab('0x1')]},'destexten':{'type':Sequelize[_0xf0ab('0x1')]},'destpriority':{'type':Sequelize[_0xf0ab('0x1')]},'destuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xf0ab('0x1')]},'transfer':{'type':Sequelize[_0xf0ab('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf0ab('0x1')],'comment':_0xf0ab('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf0ab('0x1')]},'agententerreason':{'type':Sequelize[_0xf0ab('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1131=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x410dad,_0x506e31){var _0x324e27=function(_0x14c3d0){while(--_0x14c3d0){_0x410dad['push'](_0x410dad['shift']());}};_0x324e27(++_0x506e31);}(_0x1131,0x71));var _0x1113=function(_0x26831a,_0x1d99f4){_0x26831a=_0x26831a-0x0;var _0x1044ae=_0x1131[_0x26831a];return _0x1044ae;};'use strict';var Sequelize=require('sequelize');module[_0x1113('0x0')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1113('0x1')]},'queue':{'type':Sequelize[_0x1113('0x1')]},'interface':{'type':Sequelize[_0x1113('0x1')]},'membername':{'type':Sequelize[_0x1113('0x1')]},'agentcalledAt':{'type':Sequelize[_0x1113('0x2')]},'agentconnectAt':{'type':Sequelize[_0x1113('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x1113('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x1113('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x1113('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x1113('0x3')]},'agentacw':{'type':Sequelize[_0x1113('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x1113('0x3')]},'reason':{'type':Sequelize[_0x1113('0x1')]},'lastevent':{'type':Sequelize[_0x1113('0x1')]},'channel':{'type':Sequelize[_0x1113('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1113('0x1')]},'connectedlinename':{'type':Sequelize[_0x1113('0x1')]},'language':{'type':Sequelize[_0x1113('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1113('0x1')]},'exten':{'type':Sequelize[_0x1113('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x1113('0x1')]},'destchannelstate':{'type':Sequelize[_0x1113('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x1113('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1113('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x1113('0x1')]},'destcontext':{'type':Sequelize[_0x1113('0x1')]},'destexten':{'type':Sequelize[_0x1113('0x1')]},'destpriority':{'type':Sequelize[_0x1113('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x1113('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x1113('0x1')]},'transfer':{'type':Sequelize[_0x1113('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1113('0x1')],'comment':_0x1113('0x5')},'transferexten':{'type':Sequelize[_0x1113('0x1')]},'transferuniqueid':{'type':Sequelize[_0x1113('0x1')]},'agententerreason':{'type':Sequelize[_0x1113('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 b28b32e..fe66329 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(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 0c0591d..80e0881 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 _0x0f89=['../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x23e366,_0x1048c4){var _0x2930e9=function(_0x5d3247){while(--_0x5d3247){_0x23e366['push'](_0x23e366['shift']());}};_0x2930e9(++_0x1048c4);}(_0x0f89,0x111));var _0x90f8=function(_0x56f958,_0x5ab381){_0x56f958=_0x56f958-0x0;var _0x3afefe=_0x0f89[_0x56f958];return _0x3afefe;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var logger=require(_0x90f8('0x2'))('api');var moment=require(_0x90f8('0x3'));var BPromise=require(_0x90f8('0x4'));var rp=require(_0x90f8('0x5'));var fs=require('fs');var path=require(_0x90f8('0x6'));var rimraf=require('rimraf');var config=require(_0x90f8('0x7'));var attributes=require(_0x90f8('0x8'));module['exports']=function(_0x7b8d25,_0x4439a9){return _0x7b8d25[_0x90f8('0x9')](_0x90f8('0xa'),attributes,{'tableName':_0x90f8('0xb'),'paranoid':![],'indexes':[{'fields':[_0x90f8('0xc'),_0x90f8('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f47=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid','util','../../config/logger','moment','request-promise','rimraf'];(function(_0xbb163,_0x53e7ab){var _0x4125e5=function(_0x5613b4){while(--_0x5613b4){_0xbb163['push'](_0xbb163['shift']());}};_0x4125e5(++_0x53e7ab);}(_0x6f47,0xc7));var _0x76f4=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x6f47[_0xbd08b4];return _0x314f1e;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var logger=require(_0x76f4('0x1'))('api');var moment=require(_0x76f4('0x2'));var BPromise=require('bluebird');var rp=require(_0x76f4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var attributes=require(_0x76f4('0x6'));module[_0x76f4('0x7')]=function(_0x5754ca,_0x35602f){return _0x5754ca[_0x76f4('0x8')](_0x76f4('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x76f4('0xa'),_0x76f4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index fed55a5..ab79f29 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 _0xe55b=['request\x20sent','stringify','error','code','message','catch','VoiceAgentReport','create','body','options','raw','then','debug','CreateVoiceAgentReport','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xe55b,0xde));var _0xbe55=function(_0x584b87,_0x3542b8){_0x584b87=_0x584b87-0x0;var _0x3e7b7e=_0xe55b[_0x584b87];return _0x3e7b7e;};'use strict';var _=require(_0xbe55('0x0'));var util=require('util');var moment=require(_0xbe55('0x1'));var BPromise=require(_0xbe55('0x2'));var rs=require(_0xbe55('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe55('0x4'))['db'];var utils=require(_0xbe55('0x5'));var logger=require(_0xbe55('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xb55769,_0x176bfe,_0x19713b){return new BPromise(function(_0x490e7e,_0x18473b){return client['request'](_0xb55769,_0x19713b)['then'](function(_0x11468b){logger[_0xbe55('0x7')](_0xbe55('0x8'),_0x176bfe,'request\x20sent');logger['debug'](_0xbe55('0x9'),_0x176bfe,_0xbe55('0xa'),JSON[_0xbe55('0xb')](_0x11468b));if(_0x11468b[_0xbe55('0xc')]){if(_0x11468b[_0xbe55('0xc')][_0xbe55('0xd')]===0x1f4){logger[_0xbe55('0xc')](_0xbe55('0x8'),_0x176bfe,_0x11468b[_0xbe55('0xc')][_0xbe55('0xe')]);return _0x18473b(_0x11468b[_0xbe55('0xc')][_0xbe55('0xe')]);}logger[_0xbe55('0xc')](_0xbe55('0x8'),_0x176bfe,_0x11468b[_0xbe55('0xc')]['message']);return _0x490e7e(_0x11468b[_0xbe55('0xc')][_0xbe55('0xe')]);}else{logger[_0xbe55('0x7')](_0xbe55('0x8'),_0x176bfe,'request\x20sent');_0x490e7e(_0x11468b['result']['message']);}})[_0xbe55('0xf')](function(_0x495464){logger[_0xbe55('0xc')](_0xbe55('0x8'),_0x176bfe,_0x495464);_0x18473b(_0x495464);});});}exports['CreateVoiceAgentReport']=function(_0x21d4da){var _0x3722cc=this;return new Promise(function(_0x5969f9,_0x520738){return db[_0xbe55('0x10')][_0xbe55('0x11')](_0x21d4da[_0xbe55('0x12')],{'raw':_0x21d4da[_0xbe55('0x13')]?_0x21d4da['options'][_0xbe55('0x14')]===undefined?!![]:![]:!![]})[_0xbe55('0x15')](function(_0x3c6e85){logger[_0xbe55('0x7')]('CreateVoiceAgentReport',_0x21d4da);logger[_0xbe55('0x16')]('CreateVoiceAgentReport',_0x21d4da,JSON[_0xbe55('0xb')](_0x3c6e85));_0x5969f9(_0x3c6e85);})[_0xbe55('0xf')](function(_0x9bade8){logger['error'](_0xbe55('0x17'),_0x9bade8[_0xbe55('0xe')],_0x21d4da);_0x520738(_0x3722cc[_0xbe55('0xc')](0x1f4,_0x9bade8[_0xbe55('0xe')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2241ab){var _0x218d5b=this;return new Promise(function(_0x3be598,_0x10c61d){return db[_0xbe55('0x10')][_0xbe55('0x18')](_0x2241ab[_0xbe55('0x12')],{'raw':_0x2241ab[_0xbe55('0x13')]?_0x2241ab['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2241ab[_0xbe55('0x13')]?_0x2241ab[_0xbe55('0x13')][_0xbe55('0x19')]||null:null,'attributes':_0x2241ab[_0xbe55('0x13')]?_0x2241ab[_0xbe55('0x13')][_0xbe55('0x1a')]||null:null,'limit':_0x2241ab['options']?_0x2241ab[_0xbe55('0x13')][_0xbe55('0x1b')]||null:null})[_0xbe55('0x15')](function(_0xa460bf){logger['info'](_0xbe55('0x1c'),_0x2241ab);logger[_0xbe55('0x16')](_0xbe55('0x1c'),_0x2241ab,JSON['stringify'](_0xa460bf));_0x3be598(_0xa460bf);})[_0xbe55('0xf')](function(_0x450f50){logger['error'](_0xbe55('0x1c'),_0x450f50['message'],_0x2241ab);_0x10c61d(_0x218d5b[_0xbe55('0xc')](0x1f4,_0x450f50['message']));});});}; \ No newline at end of file +var _0xce3a=['../../config/environment','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x65c0bb,_0x82e7b8){var _0x320bd5=function(_0x6e1675){while(--_0x6e1675){_0x65c0bb['push'](_0x65c0bb['shift']());}};_0x320bd5(++_0x82e7b8);}(_0xce3a,0x94));var _0xace3=function(_0x3b9168,_0x55d1a3){_0x3b9168=_0x3b9168-0x0;var _0x8f7914=_0xce3a[_0x3b9168];return _0x8f7914;};'use strict';var _=require(_0xace3('0x0'));var util=require(_0xace3('0x1'));var moment=require('moment');var BPromise=require(_0xace3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xace3('0x3'));var db=require(_0xace3('0x4'))['db'];var utils=require(_0xace3('0x5'));var logger=require('../../config/logger')(_0xace3('0x6'));var config=require(_0xace3('0x7'));var jayson=require(_0xace3('0x8'));var client=jayson['client'][_0xace3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x407ea5,_0x448b3b,_0x63e17){return new BPromise(function(_0x44ba55,_0x3b3048){return client['request'](_0x407ea5,_0x63e17)[_0xace3('0xa')](function(_0x1730aa){logger[_0xace3('0xb')](_0xace3('0xc'),_0x448b3b,'request\x20sent');logger[_0xace3('0xd')](_0xace3('0xe'),_0x448b3b,_0xace3('0xf'),JSON[_0xace3('0x10')](_0x1730aa));if(_0x1730aa[_0xace3('0x11')]){if(_0x1730aa['error'][_0xace3('0x12')]===0x1f4){logger[_0xace3('0x11')](_0xace3('0xc'),_0x448b3b,_0x1730aa[_0xace3('0x11')][_0xace3('0x13')]);return _0x3b3048(_0x1730aa[_0xace3('0x11')]['message']);}logger[_0xace3('0x11')](_0xace3('0xc'),_0x448b3b,_0x1730aa[_0xace3('0x11')][_0xace3('0x13')]);return _0x44ba55(_0x1730aa[_0xace3('0x11')]['message']);}else{logger[_0xace3('0xb')](_0xace3('0xc'),_0x448b3b,_0xace3('0xf'));_0x44ba55(_0x1730aa[_0xace3('0x14')][_0xace3('0x13')]);}})['catch'](function(_0x2fbda2){logger[_0xace3('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x448b3b,_0x2fbda2);_0x3b3048(_0x2fbda2);});});}exports[_0xace3('0x15')]=function(_0x1c4418){var _0x22ef31=this;return new Promise(function(_0x35ea28,_0x5dec82){return db[_0xace3('0x16')]['create'](_0x1c4418[_0xace3('0x17')],{'raw':_0x1c4418[_0xace3('0x18')]?_0x1c4418[_0xace3('0x18')][_0xace3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cf357){logger['info']('CreateVoiceAgentReport',_0x1c4418);logger[_0xace3('0xd')]('CreateVoiceAgentReport',_0x1c4418,JSON[_0xace3('0x10')](_0x3cf357));_0x35ea28(_0x3cf357);})['catch'](function(_0x56ffb7){logger[_0xace3('0x11')]('CreateVoiceAgentReport',_0x56ffb7[_0xace3('0x13')],_0x1c4418);_0x5dec82(_0x22ef31[_0xace3('0x11')](0x1f4,_0x56ffb7[_0xace3('0x13')]));});});};exports[_0xace3('0x1a')]=function(_0x2791b8){var _0x181876=this;return new Promise(function(_0x4220f3,_0x4c1bc7){return db['VoiceAgentReport'][_0xace3('0x1b')](_0x2791b8['body'],{'raw':_0x2791b8[_0xace3('0x18')]?_0x2791b8[_0xace3('0x18')][_0xace3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2791b8[_0xace3('0x18')]?_0x2791b8[_0xace3('0x18')][_0xace3('0x1c')]||null:null,'attributes':_0x2791b8[_0xace3('0x18')]?_0x2791b8[_0xace3('0x18')][_0xace3('0x1d')]||null:null,'limit':_0x2791b8[_0xace3('0x18')]?_0x2791b8[_0xace3('0x18')][_0xace3('0x1e')]||null:null})[_0xace3('0xa')](function(_0x34f067){logger[_0xace3('0xb')](_0xace3('0x1a'),_0x2791b8);logger[_0xace3('0xd')](_0xace3('0x1a'),_0x2791b8,JSON[_0xace3('0x10')](_0x34f067));_0x4220f3(_0x34f067);})['catch'](function(_0xdbdc8b){logger[_0xace3('0x11')](_0xace3('0x1a'),_0xdbdc8b[_0xace3('0x13')],_0x2791b8);_0x4c1bc7(_0x181876[_0xace3('0x11')](0x1f4,_0xdbdc8b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index ff5b1fc..7a5c332 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 _0xcb99=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x24a90c,_0x1a7405){var _0x43e52e=function(_0x3857a3){while(--_0x3857a3){_0x24a90c['push'](_0x24a90c['shift']());}};_0x43e52e(++_0x1a7405);}(_0xcb99,0x8b));var _0x9cb9=function(_0x48d2f9,_0x2e4981){_0x48d2f9=_0x48d2f9-0x0;var _0x2d9527=_0xcb99[_0x48d2f9];return _0x2d9527;};'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'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);router[_0x9cb9('0xe')](_0x9cb9('0xb'),auth['isAuthenticated'](),controller[_0x9cb9('0xf')]);router[_0x9cb9('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x11')]);module[_0x9cb9('0x12')]=router; \ No newline at end of file +var _0xadb8=['/describe','describe','post','/:id','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','get'];(function(_0x1f5887,_0x2fa1f1){var _0x21774b=function(_0x48a7e5){while(--_0x48a7e5){_0x1f5887['push'](_0x1f5887['shift']());}};_0x21774b(++_0x2fa1f1);}(_0xadb8,0x1d0));var _0x8adb=function(_0x335a62,_0xfafea4){_0x335a62=_0x335a62-0x0;var _0x249a9a=_0xadb8[_0x335a62];return _0x249a9a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8adb('0x0'));var timeout=require('connect-timeout');var express=require(_0x8adb('0x1'));var router=express[_0x8adb('0x2')]();var fs_extra=require(_0x8adb('0x3'));var auth=require(_0x8adb('0x4'));var interaction=require(_0x8adb('0x5'));var config=require(_0x8adb('0x6'));var controller=require(_0x8adb('0x7'));router['get']('/',auth[_0x8adb('0x8')](),controller[_0x8adb('0x9')]);router[_0x8adb('0xa')](_0x8adb('0xb'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xc')]);router[_0x8adb('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8adb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0xf')]);router[_0x8adb('0x10')](_0x8adb('0xe'),auth[_0x8adb('0x8')](),controller[_0x8adb('0x11')]);module[_0x8adb('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 3474fbe..e8ef86d 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 _0x582b=['DATE','INTEGER','exports','STRING','inbound','outbound','inbound-fax','outbound-fax','dialer'];(function(_0xeb7d81,_0x5d5228){var _0x16106e=function(_0x13d1fb){while(--_0x13d1fb){_0xeb7d81['push'](_0xeb7d81['shift']());}};_0x16106e(++_0x5d5228);}(_0x582b,0x185));var _0xb582=function(_0x33e200,_0x4d13ab){_0x33e200=_0x33e200-0x0;var _0xc868bb=_0x582b[_0x33e200];return _0xc868bb;};'use strict';var Sequelize=require('sequelize');module[_0xb582('0x0')]={'uniqueid':{'type':Sequelize[_0xb582('0x1')]},'type':{'type':Sequelize['ENUM'](_0xb582('0x2'),'internal',_0xb582('0x3'),_0xb582('0x4'),_0xb582('0x5'),_0xb582('0x6'))},'tag':{'type':Sequelize[_0xb582('0x1')]},'accountcode':{'type':Sequelize[_0xb582('0x1')]},'source':{'type':Sequelize[_0xb582('0x1')]},'destination':{'type':Sequelize[_0xb582('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb582('0x1')]},'channel':{'type':Sequelize[_0xb582('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xb582('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb582('0x7')]},'endtime':{'type':Sequelize[_0xb582('0x7')]},'duration':{'type':Sequelize[_0xb582('0x8')]},'billableseconds':{'type':Sequelize[_0xb582('0x8')]},'mohtime':{'type':Sequelize[_0xb582('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb582('0x1')]},'amaflags':{'type':Sequelize[_0xb582('0x1')]},'userfield':{'type':Sequelize[_0xb582('0x1')]},'userDisposition':{'type':Sequelize[_0xb582('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xb582('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xb582('0x1')]},'note':{'type':Sequelize[_0xb582('0x1')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xb582('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb01c=['TEXT','DATE','INTEGER','sequelize','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0xb01c,0xbe));var _0xcb01=function(_0x3c82b3,_0x46c615){_0x3c82b3=_0x3c82b3-0x0;var _0x439456=_0xb01c[_0x3c82b3];return _0x439456;};'use strict';var Sequelize=require(_0xcb01('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcb01('0x1')]},'type':{'type':Sequelize[_0xcb01('0x2')](_0xcb01('0x3'),_0xcb01('0x4'),_0xcb01('0x5'),_0xcb01('0x6'),_0xcb01('0x7'),'dialer')},'tag':{'type':Sequelize[_0xcb01('0x1')]},'accountcode':{'type':Sequelize[_0xcb01('0x1')]},'source':{'type':Sequelize[_0xcb01('0x1')]},'destination':{'type':Sequelize[_0xcb01('0x1')]},'destinationcontext':{'type':Sequelize[_0xcb01('0x1')]},'callerid':{'type':Sequelize[_0xcb01('0x1')]},'channel':{'type':Sequelize[_0xcb01('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xcb01('0x1')]},'lastdata':{'type':Sequelize[_0xcb01('0x8')]},'starttime':{'type':Sequelize[_0xcb01('0x9')]},'systemanswertime':{'type':Sequelize[_0xcb01('0x9')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xcb01('0x9')]},'duration':{'type':Sequelize[_0xcb01('0xa')]},'billableseconds':{'type':Sequelize[_0xcb01('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcb01('0x1')]},'amaflags':{'type':Sequelize[_0xcb01('0x1')]},'userfield':{'type':Sequelize[_0xcb01('0x1')]},'userDisposition':{'type':Sequelize[_0xcb01('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xcb01('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcb01('0x1')]},'prefix':{'type':Sequelize[_0xcb01('0x1')]},'routeid':{'type':Sequelize[_0xcb01('0xa')]},'sipcallid':{'type':Sequelize[_0xcb01('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ba1a772..6821470 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 _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','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','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x16de68,_0x33d7ff){var _0x1c277e=function(_0x1d8549){while(--_0x1d8549){_0x16de68['push'](_0x16de68['shift']());}};_0x1c277e(++_0x33d7ff);}(_0xadb5,0xad));var _0x5adb=function(_0x36e873,_0x15e4fe){_0x36e873=_0x36e873-0x0;var _0x50710c=_0xadb5[_0x36e873];return _0x50710c;};'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['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index f0310e3..ffaa12b 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 _0xde4a=['../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','uniqueid','lodash','api','moment','rimraf'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0xde4a,0x1e6));var _0xade4=function(_0x4df793,_0x49fe82){_0x4df793=_0x4df793-0x0;var _0x4f0a30=_0xde4a[_0x4df793];return _0x4f0a30;};'use strict';var _=require(_0xade4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xade4('0x1'));var moment=require(_0xade4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xade4('0x3'));var config=require(_0xade4('0x4'));var attributes=require(_0xade4('0x5'));module[_0xade4('0x6')]=function(_0x48fed9,_0x48f588){return _0x48fed9['define'](_0xade4('0x7'),attributes,{'tableName':_0xade4('0x8'),'paranoid':![],'indexes':[{'fields':[_0xade4('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08b7=['path','rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','../../config/logger','request-promise'];(function(_0x505942,_0x1db575){var _0x5dd4af=function(_0xea04ab){while(--_0xea04ab){_0x505942['push'](_0x505942['shift']());}};_0x5dd4af(++_0x1db575);}(_0x08b7,0x173));var _0x708b=function(_0x88c763,_0x27cbd8){_0x88c763=_0x88c763-0x0;var _0xb89940=_0x08b7[_0x88c763];return _0xb89940;};'use strict';var _=require('lodash');var util=require(_0x708b('0x0'));var logger=require(_0x708b('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x708b('0x2'));var fs=require('fs');var path=require(_0x708b('0x3'));var rimraf=require(_0x708b('0x4'));var config=require('../../config/environment');var attributes=require(_0x708b('0x5'));module[_0x708b('0x6')]=function(_0x35dd17,_0x2f0abd){return _0x35dd17[_0x708b('0x7')](_0x708b('0x8'),attributes,{'tableName':_0x708b('0x9'),'paranoid':![],'indexes':[{'fields':[_0x708b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 6331b17..8ce86d5 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 _0x6a69=['attributes','include','map','model','catch','CreateVoiceCallReport','create','raw','update','body','limit','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','code','error','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','findAll','options','where'];(function(_0x5d4c00,_0x47f5d9){var _0x38820b=function(_0x331965){while(--_0x331965){_0x5d4c00['push'](_0x5d4c00['shift']());}};_0x38820b(++_0x47f5d9);}(_0x6a69,0xfc));var _0x96a6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x6a69[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x96a6('0x0'));var util=require(_0x96a6('0x1'));var moment=require(_0x96a6('0x2'));var BPromise=require(_0x96a6('0x3'));var rs=require(_0x96a6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96a6('0x5'))['db'];var utils=require(_0x96a6('0x6'));var logger=require(_0x96a6('0x7'))(_0x96a6('0x8'));var config=require(_0x96a6('0x9'));var jayson=require(_0x96a6('0xa'));var client=jayson[_0x96a6('0xb')][_0x96a6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39e0d3,_0x453cda,_0x7513af){return new BPromise(function(_0x543da4,_0x3f6933){return client[_0x96a6('0xd')](_0x39e0d3,_0x7513af)[_0x96a6('0xe')](function(_0x4ec6b6){logger[_0x96a6('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x453cda,_0x96a6('0x10'));logger[_0x96a6('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x453cda,_0x96a6('0x10'),JSON[_0x96a6('0x12')](_0x4ec6b6));if(_0x4ec6b6['error']){if(_0x4ec6b6['error'][_0x96a6('0x13')]===0x1f4){logger[_0x96a6('0x14')](_0x96a6('0x15'),_0x453cda,_0x4ec6b6[_0x96a6('0x14')][_0x96a6('0x16')]);return _0x3f6933(_0x4ec6b6[_0x96a6('0x14')][_0x96a6('0x16')]);}logger[_0x96a6('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x453cda,_0x4ec6b6[_0x96a6('0x14')][_0x96a6('0x16')]);return _0x543da4(_0x4ec6b6['error']['message']);}else{logger[_0x96a6('0xf')](_0x96a6('0x15'),_0x453cda,'request\x20sent');_0x543da4(_0x4ec6b6['result'][_0x96a6('0x16')]);}})['catch'](function(_0x5780c9){logger[_0x96a6('0x14')](_0x96a6('0x15'),_0x453cda,_0x5780c9);_0x3f6933(_0x5780c9);});});}exports[_0x96a6('0x17')]=function(_0x2fbc8c){var _0x3f0c80=this;return new Promise(function(_0x281e97,_0x144ce9){return db[_0x96a6('0x18')][_0x96a6('0x19')]({'raw':_0x2fbc8c[_0x96a6('0x1a')]?_0x2fbc8c[_0x96a6('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2fbc8c['options']?_0x2fbc8c[_0x96a6('0x1a')][_0x96a6('0x1b')]||null:null,'attributes':_0x2fbc8c[_0x96a6('0x1a')]?_0x2fbc8c['options'][_0x96a6('0x1c')]||null:null,'limit':_0x2fbc8c[_0x96a6('0x1a')]?_0x2fbc8c['options']['limit']||null:null,'include':_0x2fbc8c[_0x96a6('0x1a')]?_0x2fbc8c[_0x96a6('0x1a')][_0x96a6('0x1d')]?_['map'](_0x2fbc8c[_0x96a6('0x1a')][_0x96a6('0x1d')],function(_0x1c6539){return{'model':db[_0x1c6539['model']],'as':_0x1c6539['as'],'attributes':_0x1c6539[_0x96a6('0x1c')],'include':_0x1c6539['include']?_[_0x96a6('0x1e')](_0x1c6539[_0x96a6('0x1d')],function(_0x55673b){return{'model':db[_0x55673b[_0x96a6('0x1f')]],'as':_0x55673b['as'],'attributes':_0x55673b['attributes'],'include':_0x55673b['include']?_['map'](_0x55673b[_0x96a6('0x1d')],function(_0x5e9247){return{'model':db[_0x5e9247[_0x96a6('0x1f')]],'as':_0x5e9247['as'],'attributes':_0x5e9247[_0x96a6('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x96a6('0xe')](function(_0x56a7a7){logger[_0x96a6('0xf')]('GetVoiceCallReport',_0x2fbc8c);logger['debug'](_0x96a6('0x17'),_0x2fbc8c,JSON[_0x96a6('0x12')](_0x56a7a7));_0x281e97(_0x56a7a7);})[_0x96a6('0x20')](function(_0x2eedef){logger['error'](_0x96a6('0x17'),_0x2eedef['message'],_0x2fbc8c);_0x144ce9(_0x3f0c80[_0x96a6('0x14')](0x1f4,_0x2eedef['message']));});});};exports[_0x96a6('0x21')]=function(_0xf4ecba){var _0x5e8509=this;return new Promise(function(_0x165a48,_0x7a004){return db['VoiceCallReport'][_0x96a6('0x22')](_0xf4ecba['body'],{'raw':_0xf4ecba[_0x96a6('0x1a')]?_0xf4ecba[_0x96a6('0x1a')][_0x96a6('0x23')]===undefined?!![]:![]:!![]})[_0x96a6('0xe')](function(_0x29bd75){logger[_0x96a6('0xf')](_0x96a6('0x21'),_0xf4ecba);logger[_0x96a6('0x11')]('CreateVoiceCallReport',_0xf4ecba,JSON[_0x96a6('0x12')](_0x29bd75));_0x165a48(_0x29bd75);})[_0x96a6('0x20')](function(_0x1daa36){logger['error']('CreateVoiceCallReport',_0x1daa36[_0x96a6('0x16')],_0xf4ecba);_0x7a004(_0x5e8509[_0x96a6('0x14')](0x1f4,_0x1daa36[_0x96a6('0x16')]));});});};exports['UpdateVoiceCallReport']=function(_0x581365){var _0x4d6f1e=this;return new Promise(function(_0x27fdbe,_0x1e0956){return db[_0x96a6('0x18')][_0x96a6('0x24')](_0x581365[_0x96a6('0x25')],{'raw':_0x581365[_0x96a6('0x1a')]?_0x581365[_0x96a6('0x1a')][_0x96a6('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581365['options']?_0x581365[_0x96a6('0x1a')][_0x96a6('0x1b')]||null:null,'attributes':_0x581365[_0x96a6('0x1a')]?_0x581365[_0x96a6('0x1a')][_0x96a6('0x1c')]||null:null,'limit':_0x581365[_0x96a6('0x1a')]?_0x581365[_0x96a6('0x1a')][_0x96a6('0x26')]||null:null})['then'](function(_0x305e43){logger['info']('UpdateVoiceCallReport',_0x581365);logger[_0x96a6('0x11')](_0x96a6('0x27'),_0x581365,JSON[_0x96a6('0x12')](_0x305e43));_0x27fdbe(_0x305e43);})[_0x96a6('0x20')](function(_0x4f32d0){logger['error'](_0x96a6('0x27'),_0x4f32d0[_0x96a6('0x16')],_0x581365);_0x1e0956(_0x4d6f1e[_0x96a6('0x14')](0x1f4,_0x4f32d0[_0x96a6('0x16')]));});});}; \ No newline at end of file +var _0x4af5=['map','model','attributes','GetVoiceCallReport','CreateVoiceCallReport','VoiceCallReport','UpdateVoiceCallReport','update','body','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','options','raw','where','include'];(function(_0x951c0,_0x15486b){var _0x3da877=function(_0x1e346f){while(--_0x1e346f){_0x951c0['push'](_0x951c0['shift']());}};_0x3da877(++_0x15486b);}(_0x4af5,0x122));var _0x54af=function(_0x41d871,_0x4cd6fd){_0x41d871=_0x41d871-0x0;var _0x40994d=_0x4af5[_0x41d871];return _0x40994d;};'use strict';var _=require(_0x54af('0x0'));var util=require(_0x54af('0x1'));var moment=require('moment');var BPromise=require(_0x54af('0x2'));var rs=require(_0x54af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54af('0x4'))['db'];var utils=require(_0x54af('0x5'));var logger=require(_0x54af('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x54af('0x7'));var client=jayson[_0x54af('0x8')][_0x54af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x376c74,_0x368eee,_0xc67a47){return new BPromise(function(_0xbad052,_0x2d573f){return client[_0x54af('0xa')](_0x376c74,_0xc67a47)[_0x54af('0xb')](function(_0x26d501){logger[_0x54af('0xc')](_0x54af('0xd'),_0x368eee,_0x54af('0xe'));logger[_0x54af('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x368eee,_0x54af('0xe'),JSON[_0x54af('0x10')](_0x26d501));if(_0x26d501['error']){if(_0x26d501[_0x54af('0x11')]['code']===0x1f4){logger['error'](_0x54af('0xd'),_0x368eee,_0x26d501[_0x54af('0x11')][_0x54af('0x12')]);return _0x2d573f(_0x26d501['error'][_0x54af('0x12')]);}logger[_0x54af('0x11')](_0x54af('0xd'),_0x368eee,_0x26d501[_0x54af('0x11')][_0x54af('0x12')]);return _0xbad052(_0x26d501[_0x54af('0x11')]['message']);}else{logger[_0x54af('0xc')](_0x54af('0xd'),_0x368eee,'request\x20sent');_0xbad052(_0x26d501[_0x54af('0x13')][_0x54af('0x12')]);}})[_0x54af('0x14')](function(_0x28e99f){logger[_0x54af('0x11')](_0x54af('0xd'),_0x368eee,_0x28e99f);_0x2d573f(_0x28e99f);});});}exports['GetVoiceCallReport']=function(_0x1a40dd){var _0x1df49e=this;return new Promise(function(_0x11cf7d,_0x1fe04c){return db['VoiceCallReport']['findAll']({'raw':_0x1a40dd[_0x54af('0x15')]?_0x1a40dd[_0x54af('0x15')][_0x54af('0x16')]===undefined?!![]:![]:!![],'where':_0x1a40dd['options']?_0x1a40dd['options'][_0x54af('0x17')]||null:null,'attributes':_0x1a40dd['options']?_0x1a40dd[_0x54af('0x15')]['attributes']||null:null,'limit':_0x1a40dd[_0x54af('0x15')]?_0x1a40dd['options']['limit']||null:null,'include':_0x1a40dd[_0x54af('0x15')]?_0x1a40dd['options'][_0x54af('0x18')]?_[_0x54af('0x19')](_0x1a40dd[_0x54af('0x15')][_0x54af('0x18')],function(_0xdfcc06){return{'model':db[_0xdfcc06[_0x54af('0x1a')]],'as':_0xdfcc06['as'],'attributes':_0xdfcc06[_0x54af('0x1b')],'include':_0xdfcc06[_0x54af('0x18')]?_['map'](_0xdfcc06[_0x54af('0x18')],function(_0x22e3e1){return{'model':db[_0x22e3e1[_0x54af('0x1a')]],'as':_0x22e3e1['as'],'attributes':_0x22e3e1[_0x54af('0x1b')],'include':_0x22e3e1[_0x54af('0x18')]?_['map'](_0x22e3e1['include'],function(_0x33b455){return{'model':db[_0x33b455['model']],'as':_0x33b455['as'],'attributes':_0x33b455['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x136e0c){logger['info'](_0x54af('0x1c'),_0x1a40dd);logger[_0x54af('0xf')](_0x54af('0x1c'),_0x1a40dd,JSON[_0x54af('0x10')](_0x136e0c));_0x11cf7d(_0x136e0c);})[_0x54af('0x14')](function(_0x6c442c){logger['error'](_0x54af('0x1c'),_0x6c442c['message'],_0x1a40dd);_0x1fe04c(_0x1df49e[_0x54af('0x11')](0x1f4,_0x6c442c[_0x54af('0x12')]));});});};exports[_0x54af('0x1d')]=function(_0x553773){var _0x5dc25e=this;return new Promise(function(_0x5ac015,_0x5d799d){return db[_0x54af('0x1e')]['create'](_0x553773['body'],{'raw':_0x553773[_0x54af('0x15')]?_0x553773['options'][_0x54af('0x16')]===undefined?!![]:![]:!![]})[_0x54af('0xb')](function(_0x21bbed){logger[_0x54af('0xc')](_0x54af('0x1d'),_0x553773);logger[_0x54af('0xf')](_0x54af('0x1d'),_0x553773,JSON['stringify'](_0x21bbed));_0x5ac015(_0x21bbed);})[_0x54af('0x14')](function(_0x399e34){logger['error'](_0x54af('0x1d'),_0x399e34[_0x54af('0x12')],_0x553773);_0x5d799d(_0x5dc25e[_0x54af('0x11')](0x1f4,_0x399e34[_0x54af('0x12')]));});});};exports[_0x54af('0x1f')]=function(_0x11d010){var _0x57dc07=this;return new Promise(function(_0x1c4fb1,_0xd3bf7f){return db['VoiceCallReport'][_0x54af('0x20')](_0x11d010[_0x54af('0x21')],{'raw':_0x11d010[_0x54af('0x15')]?_0x11d010['options'][_0x54af('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d010['options']?_0x11d010[_0x54af('0x15')][_0x54af('0x17')]||null:null,'attributes':_0x11d010['options']?_0x11d010[_0x54af('0x15')][_0x54af('0x1b')]||null:null,'limit':_0x11d010[_0x54af('0x15')]?_0x11d010[_0x54af('0x15')][_0x54af('0x22')]||null:null})[_0x54af('0xb')](function(_0x59992f){logger[_0x54af('0xc')](_0x54af('0x1f'),_0x11d010);logger[_0x54af('0xf')]('UpdateVoiceCallReport',_0x11d010,JSON[_0x54af('0x10')](_0x59992f));_0x1c4fb1(_0x59992f);})[_0x54af('0x14')](function(_0x4657cb){logger[_0x54af('0x11')](_0x54af('0x1f'),_0x4657cb[_0x54af('0x12')],_0x11d010);_0xd3bf7f(_0x57dc07[_0x54af('0x11')](0x1f4,_0x4657cb[_0x54af('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 5b78332..ecbf99b 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 _0x5c44=['../../config/environment','./voiceChanSpy.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0x5c44,0x176));var _0x45c4=function(_0x1f7579,_0x3d829b){_0x1f7579=_0x1f7579-0x0;var _0x5072e3=_0x5c44[_0x1f7579];return _0x5072e3;};'use strict';var multer=require(_0x45c4('0x0'));var util=require(_0x45c4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x45c4('0x2'));var router=express[_0x45c4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x45c4('0x4'));var interaction=require(_0x45c4('0x5'));var config=require(_0x45c4('0x6'));var controller=require(_0x45c4('0x7'));router['get']('/',auth[_0x45c4('0x8')](),controller[_0x45c4('0x9')]);router[_0x45c4('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x45c4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x45c4('0xc')]);router[_0x45c4('0xd')](_0x45c4('0xe'),auth[_0x45c4('0x8')](),controller[_0x45c4('0xf')]);router[_0x45c4('0x10')](_0x45c4('0xe'),auth[_0x45c4('0x8')](),controller[_0x45c4('0x11')]);module[_0x45c4('0x12')]=router; \ No newline at end of file +var _0x0100=['../../config/environment','./voiceChanSpy.controller','index','get','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x0100,0x187));var _0x0010=function(_0x5cfdd8,_0x27555c){_0x5cfdd8=_0x5cfdd8-0x0;var _0x4fd729=_0x0100[_0x5cfdd8];return _0x4fd729;};'use strict';var multer=require(_0x0010('0x0'));var util=require(_0x0010('0x1'));var path=require(_0x0010('0x2'));var timeout=require(_0x0010('0x3'));var express=require(_0x0010('0x4'));var router=express[_0x0010('0x5')]();var fs_extra=require(_0x0010('0x6'));var auth=require(_0x0010('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0010('0x8'));var controller=require(_0x0010('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0010('0xa')]);router[_0x0010('0xb')](_0x0010('0xc'),auth[_0x0010('0xd')](),controller[_0x0010('0xe')]);router['post']('/',auth[_0x0010('0xd')](),controller['create']);router[_0x0010('0xf')](_0x0010('0xc'),auth[_0x0010('0xd')](),controller[_0x0010('0x10')]);router['delete'](_0x0010('0xc'),auth[_0x0010('0xd')](),controller[_0x0010('0x11')]);module[_0x0010('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fcaf14f..71a23d9 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 _0xf66d=['options','BOOLEAN','STRING','setDataValue','getDataValue'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xf66d,0xe8));var _0xdf66=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf66d[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdf66('0x0')]},'prefix':{'type':Sequelize[_0xdf66('0x0')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xdf66('0x0')],'set':function(_0x5e2b5f){this[_0xdf66('0x1')]('options',_0x5e2b5f?_0x5e2b5f['join'](''):[]);},'get':function(){return this[_0xdf66('0x2')](_0xdf66('0x3'))?this[_0xdf66('0x2')](_0xdf66('0x3'))['split'](''):[];}},'auth':{'type':Sequelize[_0xdf66('0x4')],'defaultValue':![]},'password':{'type':Sequelize[_0xdf66('0x0')]},'record':{'type':Sequelize[_0xdf66('0x4')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc8a7=['getDataValue','split','sequelize','exports','STRING','name','options','join'];(function(_0x50a73f,_0x5a6ae8){var _0x1f23f0=function(_0x207141){while(--_0x207141){_0x50a73f['push'](_0x50a73f['shift']());}};_0x1f23f0(++_0x5a6ae8);}(_0xc8a7,0xba));var _0x7c8a=function(_0x4c413e,_0x198ed9){_0x4c413e=_0x4c413e-0x0;var _0x18870b=_0xc8a7[_0x4c413e];return _0x18870b;};'use strict';var Sequelize=require(_0x7c8a('0x0'));module[_0x7c8a('0x1')]={'name':{'type':Sequelize[_0x7c8a('0x2')]},'prefix':{'type':Sequelize[_0x7c8a('0x2')],'unique':_0x7c8a('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x4768cf){this['setDataValue'](_0x7c8a('0x4'),_0x4768cf?_0x4768cf[_0x7c8a('0x5')](''):[]);},'get':function(){return this[_0x7c8a('0x6')](_0x7c8a('0x4'))?this['getDataValue'](_0x7c8a('0x4'))[_0x7c8a('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x7c8a('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7c8a('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d76bb37..3a66f44 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 _0xb9a7=['json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','VoiceChanSpy','includeAll','include','findAll','rows','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end'];(function(_0x5b13fa,_0x142b38){var _0x58a133=function(_0x1a7f6f){while(--_0x1a7f6f){_0x5b13fa['push'](_0x5b13fa['shift']());}};_0x58a133(++_0x142b38);}(_0xb9a7,0x112));var _0x7b9a=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb9a7[_0x5f1391];return _0x50ebe3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){var _0x5b2f52=_0x269c07[_0x7b9a('0x20')]({'plain':!![]});var _0x23219e='ChanSpies';return db[_0x7b9a('0x21')]['destroy']({'where':{'type':_0x23219e,'resourceId':_0x5b2f52['id']}})[_0x7b9a('0x1e')](function(){return _0x269c07;});})[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d886,_0x55301c){return function(_0x54df8a){if(!_0x54df8a){_0x24d886[_0x7b9a('0x22')](0x194);}return _0x54df8a;};}function handleError(_0x58fec8,_0x5be740){_0x5be740=_0x5be740||0x1f4;return function(_0x3847b4){logger['error'](_0x3847b4[_0x7b9a('0x23')]);if(_0x3847b4[_0x7b9a('0x24')]){delete _0x3847b4['name'];}_0x58fec8[_0x7b9a('0x14')](_0x5be740)[_0x7b9a('0x25')](_0x3847b4);};}exports[_0x7b9a('0x26')]=function(_0x5b64d7,_0x45ccf5){var _0x2ce78b={},_0x181e9c={},_0x6c8b1f={'count':0x0,'rows':[]};var _0x5028e7=_[_0x7b9a('0x27')](db['VoiceChanSpy']['rawAttributes'],function(_0x2d278e){return{'name':_0x2d278e[_0x7b9a('0x28')],'type':_0x2d278e[_0x7b9a('0x29')]['key']};});_0x181e9c[_0x7b9a('0x2a')]=_[_0x7b9a('0x27')](_0x5028e7,'name');_0x181e9c['query']=_[_0x7b9a('0x2b')](_0x5b64d7[_0x7b9a('0x2c')]);_0x181e9c['filters']=_[_0x7b9a('0x2d')](_0x181e9c[_0x7b9a('0x2a')],_0x181e9c[_0x7b9a('0x2c')]);_0x2ce78b[_0x7b9a('0x2e')]=_[_0x7b9a('0x2d')](_0x181e9c['model'],qs[_0x7b9a('0x2f')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x2ce78b[_0x7b9a('0x2e')]=_0x2ce78b[_0x7b9a('0x2e')][_0x7b9a('0x30')]?_0x2ce78b['attributes']:_0x181e9c['model'];if(!_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x31')]('nolimit')){_0x2ce78b[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x5b64d7[_0x7b9a('0x2c')]['limit']);_0x2ce78b[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x5b64d7['query']['offset']);}_0x2ce78b[_0x7b9a('0x32')]=qs[_0x7b9a('0x33')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x33')]);_0x2ce78b[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_[_0x7b9a('0x36')](_0x5b64d7[_0x7b9a('0x2c')],_0x181e9c['filters']),_0x5028e7);if(_0x5b64d7[_0x7b9a('0x2c')]['filter']){_0x2ce78b[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x2ce78b[_0x7b9a('0x34')],{'$or':_[_0x7b9a('0x27')](_0x5028e7,function(_0x3fa4cd){if(_0x3fa4cd[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x34eebe={};_0x34eebe[_0x3fa4cd[_0x7b9a('0x24')]]={'$like':'%'+_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x34eebe;}})});}_0x2ce78b=_['merge']({},_0x2ce78b,_0x5b64d7[_0x7b9a('0x39')]);var _0xf86939={'where':_0x2ce78b[_0x7b9a('0x34')]};return db[_0x7b9a('0x3a')]['count'](_0xf86939)[_0x7b9a('0x1e')](function(_0x53d89a){_0x6c8b1f[_0x7b9a('0x19')]=_0x53d89a;if(_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x3b')]){_0x2ce78b[_0x7b9a('0x3c')]=[{'all':!![]}];}return db[_0x7b9a('0x3a')][_0x7b9a('0x3d')](_0x2ce78b);})['then'](function(_0x33edc6){_0x6c8b1f[_0x7b9a('0x3e')]=_0x33edc6;return _0x6c8b1f;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x45ccf5,_0x2ce78b))['catch'](handleError(_0x45ccf5,null));};exports['show']=function(_0x3724fe,_0x454b35){var _0x995d59={'raw':![],'where':{'id':_0x3724fe[_0x7b9a('0x3f')]['id']}},_0x5cd3dd={};_0x5cd3dd[_0x7b9a('0x2a')]=_['keys'](db['VoiceChanSpy']['rawAttributes']);_0x5cd3dd[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x3724fe['query']);_0x5cd3dd[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0x5cd3dd[_0x7b9a('0x2a')],_0x5cd3dd['query']);_0x995d59[_0x7b9a('0x2e')]=_['intersection'](_0x5cd3dd[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x3724fe[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x995d59[_0x7b9a('0x2e')]=_0x995d59['attributes'][_0x7b9a('0x30')]?_0x995d59['attributes']:_0x5cd3dd[_0x7b9a('0x2a')];if(_0x3724fe['query']['includeAll']){_0x995d59[_0x7b9a('0x3c')]=[{'all':!![]}];}_0x995d59=_[_0x7b9a('0x37')]({},_0x995d59,_0x3724fe[_0x7b9a('0x39')]);return db[_0x7b9a('0x3a')][_0x7b9a('0x40')](_0x995d59)[_0x7b9a('0x1e')](handleEntityNotFound(_0x454b35,null))[_0x7b9a('0x1e')](respondWithResult(_0x454b35,null))[_0x7b9a('0x41')](handleError(_0x454b35,null));};exports[_0x7b9a('0x42')]=function(_0x5088c7,_0x1d7957){return db[_0x7b9a('0x3a')]['create'](_0x5088c7['body'],{})['then'](function(_0x1b3e65){var _0x30296e=_0x5088c7[_0x7b9a('0x43')][_0x7b9a('0x20')]({'plain':!![]});if(!_0x30296e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30296e[_0x7b9a('0x44')]===_0x7b9a('0x43')){var _0x287dea=_0x1b3e65[_0x7b9a('0x20')]({'plain':!![]});var _0x2d083b='ChanSpies';return db[_0x7b9a('0x45')]['find']({'where':{'name':_0x2d083b,'userProfileId':_0x30296e[_0x7b9a('0x46')]},'raw':!![]})[_0x7b9a('0x1e')](function(_0x239146){if(_0x239146&&_0x239146[_0x7b9a('0x47')]===0x0){return db['UserProfileResource'][_0x7b9a('0x42')]({'name':_0x287dea[_0x7b9a('0x24')],'resourceId':_0x287dea['id'],'type':_0x239146[_0x7b9a('0x24')],'sectionId':_0x239146['id']},{})[_0x7b9a('0x1e')](function(){return _0x1b3e65;});}else{return _0x1b3e65;}})[_0x7b9a('0x41')](function(_0x3e2f1b){logger[_0x7b9a('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f1b);throw _0x3e2f1b;});}return _0x1b3e65;})['then'](respondWithResult(_0x1d7957,0xc9))['catch'](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1d')]=function(_0x2f8929,_0x5a1b7d){if(_0x2f8929['body']['id']){delete _0x2f8929['body']['id'];}return db['VoiceChanSpy'][_0x7b9a('0x40')]({'where':{'id':_0x2f8929[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x5a1b7d,null))[_0x7b9a('0x1e')](saveUpdates(_0x2f8929[_0x7b9a('0x49')],null))[_0x7b9a('0x1e')](respondWithResult(_0x5a1b7d,null))[_0x7b9a('0x41')](handleError(_0x5a1b7d,null));};exports[_0x7b9a('0x1f')]=function(_0x5dc17e,_0x1f99f5){return db['VoiceChanSpy'][_0x7b9a('0x40')]({'where':{'id':_0x5dc17e[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1f99f5,null))[_0x7b9a('0x1e')](removeEntity(_0x1f99f5,null))[_0x7b9a('0x41')](handleError(_0x1f99f5,null));}; \ No newline at end of file +var _0x453b=['pick','merge','options','VoiceChanSpy','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where'];(function(_0x3c80b6,_0x1c1456){var _0x53a14e=function(_0x2ad565){while(--_0x2ad565){_0x3c80b6['push'](_0x3c80b6['shift']());}};_0x53a14e(++_0x1c1456);}(_0x453b,0x164));var _0xb453=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x453b[_0x314a8c];return _0x1d4607;};'use strict';var emlformat=require(_0xb453('0x0'));var rimraf=require(_0xb453('0x1'));var zipdir=require(_0xb453('0x2'));var jsonpatch=require(_0xb453('0x3'));var rp=require(_0xb453('0x4'));var moment=require(_0xb453('0x5'));var BPromise=require(_0xb453('0x6'));var Mustache=require(_0xb453('0x7'));var util=require(_0xb453('0x8'));var path=require(_0xb453('0x9'));var sox=require(_0xb453('0xa'));var csv=require(_0xb453('0xb'));var ejs=require(_0xb453('0xc'));var fs=require('fs');var fs_extra=require(_0xb453('0xd'));var _=require(_0xb453('0xe'));var squel=require(_0xb453('0xf'));var crypto=require('crypto');var jsforce=require(_0xb453('0x10'));var deskjs=require(_0xb453('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb453('0x12'));var Papa=require('papaparse');var Redis=require(_0xb453('0x13'));var authService=require(_0xb453('0x14'));var qs=require(_0xb453('0x15'));var as=require(_0xb453('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb453('0x17'))(_0xb453('0x18'));var utils=require(_0xb453('0x19'));var config=require(_0xb453('0x1a'));var licenseUtil=require(_0xb453('0x1b'));var db=require(_0xb453('0x1c'))['db'];function respondWithStatusCode(_0x223bf5,_0x22e39b){_0x22e39b=_0x22e39b||0xcc;return function(_0x2d24b9){if(_0x2d24b9){return _0x223bf5['sendStatus'](_0x22e39b);}return _0x223bf5['status'](_0x22e39b)['end']();};}function respondWithResult(_0x2926b7,_0x50d908){_0x50d908=_0x50d908||0xc8;return function(_0x3853fb){if(_0x3853fb){return _0x2926b7[_0xb453('0x1d')](_0x50d908)[_0xb453('0x1e')](_0x3853fb);}};}function respondWithFilteredResult(_0x4b3d05,_0x5ee747){return function(_0x30550b){if(_0x30550b){var _0x376b8e=typeof _0x5ee747[_0xb453('0x1f')]===_0xb453('0x20')&&typeof _0x5ee747[_0xb453('0x21')]===_0xb453('0x20');var _0x10630b=_0x30550b[_0xb453('0x22')];var _0x3e5148=_0x376b8e?0x0:_0x5ee747['offset'];var _0x583a2d=_0x376b8e?_0x30550b['count']:_0x5ee747['offset']+_0x5ee747[_0xb453('0x21')];var _0x434c2f;if(_0x583a2d>=_0x10630b){_0x583a2d=_0x10630b;_0x434c2f=0xc8;}else{_0x434c2f=0xce;}_0x4b3d05[_0xb453('0x1d')](_0x434c2f);return _0x4b3d05[_0xb453('0x23')](_0xb453('0x24'),_0x3e5148+'-'+_0x583a2d+'/'+_0x10630b)[_0xb453('0x1e')](_0x30550b);}return null;};}function patchUpdates(_0x590283){return function(_0x4d1cd7){try{jsonpatch['apply'](_0x4d1cd7,_0x590283,!![]);}catch(_0x453a8e){return BPromise['reject'](_0x453a8e);}return _0x4d1cd7[_0xb453('0x25')]();};}function saveUpdates(_0x37892e,_0x1f87bf){return function(_0x22f284){if(_0x22f284){return _0x22f284[_0xb453('0x26')](_0x37892e)[_0xb453('0x27')](function(_0x106273){return _0x106273;});}return null;};}function removeEntity(_0x5f8a52,_0x1ab2b6){return function(_0x587862){if(_0x587862){return _0x587862[_0xb453('0x28')]()[_0xb453('0x27')](function(){var _0x3e1f96=_0x587862[_0xb453('0x29')]({'plain':!![]});var _0x2c0942=_0xb453('0x2a');return db[_0xb453('0x2b')][_0xb453('0x28')]({'where':{'type':_0x2c0942,'resourceId':_0x3e1f96['id']}})[_0xb453('0x27')](function(){return _0x587862;});})[_0xb453('0x27')](function(){_0x5f8a52[_0xb453('0x1d')](0xcc)[_0xb453('0x2c')]();});}};}function handleEntityNotFound(_0x3e6631,_0x4cfa3f){return function(_0x36955c){if(!_0x36955c){_0x3e6631[_0xb453('0x2d')](0x194);}return _0x36955c;};}function handleError(_0x9da2f4,_0x2bea0b){_0x2bea0b=_0x2bea0b||0x1f4;return function(_0x430ba4){logger[_0xb453('0x2e')](_0x430ba4[_0xb453('0x2f')]);if(_0x430ba4[_0xb453('0x30')]){delete _0x430ba4[_0xb453('0x30')];}_0x9da2f4['status'](_0x2bea0b)[_0xb453('0x31')](_0x430ba4);};}exports[_0xb453('0x32')]=function(_0x3e386d,_0x59f741){var _0x4ae042={},_0x1613d8={},_0x201fd5={'count':0x0,'rows':[]};var _0x175d0c=_[_0xb453('0x33')](db['VoiceChanSpy']['rawAttributes'],function(_0x48bbdd){return{'name':_0x48bbdd[_0xb453('0x34')],'type':_0x48bbdd['type']['key']};});_0x1613d8[_0xb453('0x35')]=_[_0xb453('0x33')](_0x175d0c,_0xb453('0x30'));_0x1613d8[_0xb453('0x36')]=_[_0xb453('0x37')](_0x3e386d[_0xb453('0x36')]);_0x1613d8[_0xb453('0x38')]=_[_0xb453('0x39')](_0x1613d8['model'],_0x1613d8['query']);_0x4ae042[_0xb453('0x3a')]=_['intersection'](_0x1613d8['model'],qs[_0xb453('0x3b')](_0x3e386d[_0xb453('0x36')]['fields']));_0x4ae042[_0xb453('0x3a')]=_0x4ae042[_0xb453('0x3a')][_0xb453('0x3c')]?_0x4ae042[_0xb453('0x3a')]:_0x1613d8[_0xb453('0x35')];if(!_0x3e386d['query']['hasOwnProperty']('nolimit')){_0x4ae042[_0xb453('0x21')]=qs[_0xb453('0x21')](_0x3e386d[_0xb453('0x36')]['limit']);_0x4ae042[_0xb453('0x1f')]=qs['offset'](_0x3e386d[_0xb453('0x36')]['offset']);}_0x4ae042[_0xb453('0x3d')]=qs[_0xb453('0x3e')](_0x3e386d[_0xb453('0x36')][_0xb453('0x3e')]);_0x4ae042[_0xb453('0x3f')]=qs[_0xb453('0x38')](_[_0xb453('0x40')](_0x3e386d[_0xb453('0x36')],_0x1613d8[_0xb453('0x38')]),_0x175d0c);if(_0x3e386d[_0xb453('0x36')]['filter']){_0x4ae042['where']=_[_0xb453('0x41')](_0x4ae042[_0xb453('0x3f')],{'$or':_[_0xb453('0x33')](_0x175d0c,function(_0x1e6658){if(_0x1e6658['type']!=='VIRTUAL'){var _0x499cdc={};_0x499cdc[_0x1e6658[_0xb453('0x30')]]={'$like':'%'+_0x3e386d[_0xb453('0x36')]['filter']+'%'};return _0x499cdc;}})});}_0x4ae042=_['merge']({},_0x4ae042,_0x3e386d[_0xb453('0x42')]);var _0x3f43a1={'where':_0x4ae042['where']};return db[_0xb453('0x43')][_0xb453('0x22')](_0x3f43a1)[_0xb453('0x27')](function(_0x29a188){_0x201fd5[_0xb453('0x22')]=_0x29a188;if(_0x3e386d[_0xb453('0x36')]['includeAll']){_0x4ae042['include']=[{'all':!![]}];}return db[_0xb453('0x43')][_0xb453('0x44')](_0x4ae042);})[_0xb453('0x27')](function(_0x3bab40){_0x201fd5[_0xb453('0x45')]=_0x3bab40;return _0x201fd5;})[_0xb453('0x27')](respondWithFilteredResult(_0x59f741,_0x4ae042))[_0xb453('0x46')](handleError(_0x59f741,null));};exports[_0xb453('0x47')]=function(_0x18269b,_0x440c79){var _0x39d993={'raw':![],'where':{'id':_0x18269b[_0xb453('0x48')]['id']}},_0x188653={};_0x188653['model']=_[_0xb453('0x37')](db['VoiceChanSpy'][_0xb453('0x49')]);_0x188653[_0xb453('0x36')]=_[_0xb453('0x37')](_0x18269b[_0xb453('0x36')]);_0x188653[_0xb453('0x38')]=_[_0xb453('0x39')](_0x188653[_0xb453('0x35')],_0x188653[_0xb453('0x36')]);_0x39d993['attributes']=_[_0xb453('0x39')](_0x188653[_0xb453('0x35')],qs[_0xb453('0x3b')](_0x18269b[_0xb453('0x36')][_0xb453('0x3b')]));_0x39d993[_0xb453('0x3a')]=_0x39d993[_0xb453('0x3a')][_0xb453('0x3c')]?_0x39d993[_0xb453('0x3a')]:_0x188653[_0xb453('0x35')];if(_0x18269b['query'][_0xb453('0x4a')]){_0x39d993[_0xb453('0x4b')]=[{'all':!![]}];}_0x39d993=_['merge']({},_0x39d993,_0x18269b[_0xb453('0x42')]);return db[_0xb453('0x43')][_0xb453('0x4c')](_0x39d993)[_0xb453('0x27')](handleEntityNotFound(_0x440c79,null))[_0xb453('0x27')](respondWithResult(_0x440c79,null))['catch'](handleError(_0x440c79,null));};exports[_0xb453('0x4d')]=function(_0x4090ef,_0x4c2a74){return db[_0xb453('0x43')]['create'](_0x4090ef[_0xb453('0x4e')],{})[_0xb453('0x27')](function(_0x5175cc){var _0x494f11=_0x4090ef[_0xb453('0x4f')][_0xb453('0x29')]({'plain':!![]});if(!_0x494f11)throw new Error(_0xb453('0x50'));if(_0x494f11['role']==='user'){var _0x18df8e=_0x5175cc['get']({'plain':!![]});var _0x54f917=_0xb453('0x2a');return db[_0xb453('0x51')]['find']({'where':{'name':_0x54f917,'userProfileId':_0x494f11[_0xb453('0x52')]},'raw':!![]})[_0xb453('0x27')](function(_0x4f2647){if(_0x4f2647&&_0x4f2647[_0xb453('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x18df8e['name'],'resourceId':_0x18df8e['id'],'type':_0x4f2647[_0xb453('0x30')],'sectionId':_0x4f2647['id']},{})[_0xb453('0x27')](function(){return _0x5175cc;});}else{return _0x5175cc;}})[_0xb453('0x46')](function(_0x5a534c){logger[_0xb453('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a534c);throw _0x5a534c;});}return _0x5175cc;})[_0xb453('0x27')](respondWithResult(_0x4c2a74,0xc9))[_0xb453('0x46')](handleError(_0x4c2a74,null));};exports['update']=function(_0x255682,_0x5c5d6a){if(_0x255682[_0xb453('0x4e')]['id']){delete _0x255682[_0xb453('0x4e')]['id'];}return db['VoiceChanSpy'][_0xb453('0x4c')]({'where':{'id':_0x255682[_0xb453('0x48')]['id']}})[_0xb453('0x27')](handleEntityNotFound(_0x5c5d6a,null))['then'](saveUpdates(_0x255682[_0xb453('0x4e')],null))['then'](respondWithResult(_0x5c5d6a,null))['catch'](handleError(_0x5c5d6a,null));};exports[_0xb453('0x28')]=function(_0x455851,_0x4885cb){return db[_0xb453('0x43')]['find']({'where':{'id':_0x455851[_0xb453('0x48')]['id']}})[_0xb453('0x27')](handleEntityNotFound(_0x4885cb,null))[_0xb453('0x27')](removeEntity(_0x4885cb,null))[_0xb453('0x46')](handleError(_0x4885cb,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a76d324..1b04382 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 _0x4e2b=['from-sip','%s%s','prefix','push','merge','Set','format','CDR(type)=%s','record','MixMonitor','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','User','findAll','internal','agent','exports','define','voice_chanspy','then','bulkCreate','VoiceExtension','destroy','catch','lodash','util','bluebird','./voiceChanSpy.attributes','context'];(function(_0x50c53e,_0x49ec24){var _0xa8ffdd=function(_0x362088){while(--_0x362088){_0x50c53e['push'](_0x50c53e['shift']());}};_0xa8ffdd(++_0x49ec24);}(_0x4e2b,0x192));var _0xb4e2=function(_0x1ef17a,_0x263706){_0x1ef17a=_0x1ef17a-0x0;var _0x61d48a=_0x4e2b[_0x1ef17a];return _0x61d48a;};'use strict';var _=require(_0xb4e2('0x0'));var util=require(_0xb4e2('0x1'));var BPromise=require(_0xb4e2('0x2'));var attributes=require(_0xb4e2('0x3'));var getUserApplications=function(_0x22b33a,_0x2b56f3,_0x55d7e1){var _0x548dc4=0x1;var _0x3f8417=[];var _0x32b7da={'context':_0x2b56f3[_0xb4e2('0x4')]||_0xb4e2('0x5'),'exten':util['format'](_0xb4e2('0x6'),_0x22b33a[_0xb4e2('0x7')],_0x55d7e1),'type':'system','isApp':![],'ChanSpyId':_0x22b33a['id'],'UserId':_0x2b56f3['id']};_0x3f8417[_0xb4e2('0x8')](_[_0xb4e2('0x9')]({'app':_0xb4e2('0xa'),'appdata':util[_0xb4e2('0xb')](_0xb4e2('0xc'),'chanspy'),'priority':_0x548dc4++},_0x32b7da));if(_0x22b33a[_0xb4e2('0xd')]){_0x3f8417[_0xb4e2('0x8')](_[_0xb4e2('0x9')]({'app':_0xb4e2('0xe'),'appdata':util[_0xb4e2('0xb')]('${UNIQUEID}.%s,a',_0x22b33a[_0xb4e2('0xf')]),'priority':_0x548dc4++},_0x32b7da));}if(_0x22b33a['auth']){_0x3f8417[_0xb4e2('0x8')](_[_0xb4e2('0x9')]({'app':_0xb4e2('0x10'),'appdata':_0x22b33a['password'],'priority':_0x548dc4++},_0x32b7da));}_0x3f8417[_0xb4e2('0x8')](_[_0xb4e2('0x9')]({'app':_0xb4e2('0x11'),'appdata':util[_0xb4e2('0xb')](_0xb4e2('0x12'),_0x2b56f3[_0xb4e2('0x13')],_0x22b33a[_0xb4e2('0x14')]?_0x22b33a['options'][_0xb4e2('0x15')](''):''),'priority':_0x548dc4++},_0x32b7da));if(_0x22b33a[_0xb4e2('0xd')]){_0x3f8417[_0xb4e2('0x8')](_[_0xb4e2('0x9')]({'app':_0xb4e2('0x16'),'priority':_0x548dc4++},_0x32b7da));}return _0x3f8417;};var getChanSpyApplications=function(_0x3cde1b,_0x40584c){var _0x370c5c=[];for(var _0x2f6362=0x0,_0x4ca92e=0x1;_0x2f6362<_0x40584c[_0xb4e2('0x17')];_0x2f6362++,_0x4ca92e=0x1){_0x370c5c=_0x370c5c[_0xb4e2('0x18')](getUserApplications(_0x3cde1b,_0x40584c[_0x2f6362],_0x40584c[_0x2f6362]['internal']));if(_0x40584c[_0x2f6362]['internal']!=_0x40584c[_0x2f6362]['name']){_0x370c5c=_0x370c5c['concat'](getUserApplications(_0x3cde1b,_0x40584c[_0x2f6362],_0x40584c[_0x2f6362][_0xb4e2('0x13')]));}}return _0x370c5c;};var getChanSpyPromise=function(_0x1309fa,_0x47c651){return new BPromise(function(_0x3ec5e2,_0x32d7ca){return _0x1309fa[_0xb4e2('0x19')][_0xb4e2('0x1a')]({'attributes':['id',_0xb4e2('0x13'),_0xb4e2('0x1b')],'where':{'role':_0xb4e2('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3ac6e9){if(_0x3ac6e9){return _0x3ec5e2(getChanSpyApplications(_0x47c651,_0x3ac6e9));}return _0x3ec5e2([]);})['catch'](function(_0x37d980){_0x32d7ca(_0x37d980);});});};module[_0xb4e2('0x1d')]=function(_0x37f801,_0x341999){var _0x3560b1=_0x37f801['models'];return _0x37f801[_0xb4e2('0x1e')]('VoiceChanSpy',attributes,{'tableName':_0xb4e2('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xbfb750,_0x392a30,_0x16b576){return getChanSpyPromise(_0x3560b1,_0xbfb750)[_0xb4e2('0x20')](function(_0x199a52){if(_0x199a52&&_0x199a52[_0xb4e2('0x17')]){return _0x3560b1['VoiceExtension'][_0xb4e2('0x21')](_0x199a52);}})['then'](function(){_0x16b576();})['catch'](function(_0x17fc70){_0x16b576(_0x17fc70);});},'afterUpdate':function(_0x342e86,_0x62b643,_0x14ba73){return _0x3560b1[_0xb4e2('0x22')][_0xb4e2('0x23')]({'where':{'ChanSpyId':_0x342e86['id']}})[_0xb4e2('0x20')](function(){return getChanSpyPromise(_0x3560b1,_0x342e86);})['then'](function(_0x5835a1){if(_0x5835a1&&_0x5835a1['length']){return _0x3560b1[_0xb4e2('0x22')][_0xb4e2('0x21')](_0x5835a1);}})[_0xb4e2('0x20')](function(){_0x14ba73();})[_0xb4e2('0x24')](function(_0x5d8db7){_0x14ba73(_0x5d8db7);});},'afterDestroy':function(_0x3ae74a,_0x5b5239,_0x5df162){return _0x3560b1[_0xb4e2('0x22')][_0xb4e2('0x23')]({'where':{'ChanSpyId':_0x3ae74a['id']}})[_0xb4e2('0x20')](function(){_0x5df162();})[_0xb4e2('0x24')](function(_0x455b50){_0x5df162(_0x455b50);});}}});}; \ No newline at end of file +var _0xa311=['destroy','lodash','util','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','merge','Set','CDR(type)=%s','record','push','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','name','options','join','length','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xa311,0x17d));var _0x1a31=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa311[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x1a31('0x0'));var util=require(_0x1a31('0x1'));var BPromise=require('bluebird');var attributes=require(_0x1a31('0x2'));var getUserApplications=function(_0x513074,_0x1d7241,_0x275ffa){var _0x371cff=0x1;var _0x2429a8=[];var _0x4dd522={'context':_0x1d7241[_0x1a31('0x3')]||_0x1a31('0x4'),'exten':util[_0x1a31('0x5')](_0x1a31('0x6'),_0x513074[_0x1a31('0x7')],_0x275ffa),'type':_0x1a31('0x8'),'isApp':![],'ChanSpyId':_0x513074['id'],'UserId':_0x1d7241['id']};_0x2429a8['push'](_[_0x1a31('0x9')]({'app':_0x1a31('0xa'),'appdata':util[_0x1a31('0x5')](_0x1a31('0xb'),'chanspy'),'priority':_0x371cff++},_0x4dd522));if(_0x513074[_0x1a31('0xc')]){_0x2429a8[_0x1a31('0xd')](_[_0x1a31('0x9')]({'app':_0x1a31('0xe'),'appdata':util[_0x1a31('0x5')](_0x1a31('0xf'),_0x513074['recordingFormat']),'priority':_0x371cff++},_0x4dd522));}if(_0x513074[_0x1a31('0x10')]){_0x2429a8[_0x1a31('0xd')](_[_0x1a31('0x9')]({'app':'Authenticate','appdata':_0x513074[_0x1a31('0x11')],'priority':_0x371cff++},_0x4dd522));}_0x2429a8[_0x1a31('0xd')](_['merge']({'app':_0x1a31('0x12'),'appdata':util[_0x1a31('0x5')]('SIP/%s,%s',_0x1d7241[_0x1a31('0x13')],_0x513074[_0x1a31('0x14')]?_0x513074[_0x1a31('0x14')][_0x1a31('0x15')](''):''),'priority':_0x371cff++},_0x4dd522));if(_0x513074[_0x1a31('0xc')]){_0x2429a8[_0x1a31('0xd')](_[_0x1a31('0x9')]({'app':'StopMixMonitor','priority':_0x371cff++},_0x4dd522));}return _0x2429a8;};var getChanSpyApplications=function(_0x2bd56a,_0x4452b4){var _0x62a58c=[];for(var _0x5a20af=0x0,_0x2e0be3=0x1;_0x5a20af<_0x4452b4[_0x1a31('0x16')];_0x5a20af++,_0x2e0be3=0x1){_0x62a58c=_0x62a58c[_0x1a31('0x17')](getUserApplications(_0x2bd56a,_0x4452b4[_0x5a20af],_0x4452b4[_0x5a20af]['internal']));if(_0x4452b4[_0x5a20af][_0x1a31('0x18')]!=_0x4452b4[_0x5a20af][_0x1a31('0x13')]){_0x62a58c=_0x62a58c['concat'](getUserApplications(_0x2bd56a,_0x4452b4[_0x5a20af],_0x4452b4[_0x5a20af][_0x1a31('0x13')]));}}return _0x62a58c;};var getChanSpyPromise=function(_0x4b7828,_0x33892d){return new BPromise(function(_0x344a3a,_0x7c84ea){return _0x4b7828[_0x1a31('0x19')][_0x1a31('0x1a')]({'attributes':['id',_0x1a31('0x13'),_0x1a31('0x18')],'where':{'role':_0x1a31('0x1b'),'chanspy':!![]},'raw':!![]})[_0x1a31('0x1c')](function(_0x55cc1c){if(_0x55cc1c){return _0x344a3a(getChanSpyApplications(_0x33892d,_0x55cc1c));}return _0x344a3a([]);})[_0x1a31('0x1d')](function(_0x5443b4){_0x7c84ea(_0x5443b4);});});};module[_0x1a31('0x1e')]=function(_0x39f0f1,_0x3175e6){var _0x564ad2=_0x39f0f1[_0x1a31('0x1f')];return _0x39f0f1[_0x1a31('0x20')](_0x1a31('0x21'),attributes,{'tableName':_0x1a31('0x22'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4219b6,_0x4c777d,_0x4a695a){return getChanSpyPromise(_0x564ad2,_0x4219b6)['then'](function(_0x481be8){if(_0x481be8&&_0x481be8[_0x1a31('0x16')]){return _0x564ad2['VoiceExtension'][_0x1a31('0x23')](_0x481be8);}})[_0x1a31('0x1c')](function(){_0x4a695a();})[_0x1a31('0x1d')](function(_0x17db83){_0x4a695a(_0x17db83);});},'afterUpdate':function(_0x253e35,_0x2f30d2,_0x152811){return _0x564ad2[_0x1a31('0x24')][_0x1a31('0x25')]({'where':{'ChanSpyId':_0x253e35['id']}})[_0x1a31('0x1c')](function(){return getChanSpyPromise(_0x564ad2,_0x253e35);})[_0x1a31('0x1c')](function(_0x5c4f00){if(_0x5c4f00&&_0x5c4f00[_0x1a31('0x16')]){return _0x564ad2[_0x1a31('0x24')][_0x1a31('0x23')](_0x5c4f00);}})['then'](function(){_0x152811();})['catch'](function(_0x1b562e){_0x152811(_0x1b562e);});},'afterDestroy':function(_0x290502,_0x16f0e9,_0x4b9632){return _0x564ad2['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x290502['id']}})[_0x1a31('0x1c')](function(){_0x4b9632();})[_0x1a31('0x1d')](function(_0xdbe0af){_0x4b9632(_0xdbe0af);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b8e7207..eaf3187 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 _0xee4f=['VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x591cf5,_0x6c9c25){var _0x5dd298=function(_0x158783){while(--_0x158783){_0x591cf5['push'](_0x591cf5['shift']());}};_0x5dd298(++_0x6c9c25);}(_0xee4f,0xad));var _0xfee4=function(_0x33175c,_0x589d5a){_0x33175c=_0x33175c-0x0;var _0x2fb232=_0xee4f[_0x33175c];return _0x2fb232;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fb6b,_0x2fb1b3,_0x16cc9a){return new BPromise(function(_0x34908a,_0x4d3c71){return client['request'](_0x52fb6b,_0x16cc9a)[_0xfee4('0x7')](function(_0x11556d){logger[_0xfee4('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x2fb1b3,'request\x20sent');logger[_0xfee4('0x9')](_0xfee4('0xa'),_0x2fb1b3,_0xfee4('0xb'),JSON['stringify'](_0x11556d));if(_0x11556d[_0xfee4('0xc')]){if(_0x11556d[_0xfee4('0xc')][_0xfee4('0xd')]===0x1f4){logger[_0xfee4('0xc')](_0xfee4('0xe'),_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x4d3c71(_0x11556d['error'][_0xfee4('0xf')]);}logger[_0xfee4('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x2fb1b3,_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);return _0x34908a(_0x11556d[_0xfee4('0xc')][_0xfee4('0xf')]);}else{logger[_0xfee4('0x8')](_0xfee4('0xe'),_0x2fb1b3,_0xfee4('0xb'));_0x34908a(_0x11556d['result'][_0xfee4('0xf')]);}})[_0xfee4('0x10')](function(_0x437979){logger['error'](_0xfee4('0xe'),_0x2fb1b3,_0x437979);_0x4d3c71(_0x437979);});});} \ No newline at end of file +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x1b96ee,_0x5859c1){var _0x2ae111=function(_0x2c1837){while(--_0x2c1837){_0x1b96ee['push'](_0x1b96ee['shift']());}};_0x2ae111(++_0x5859c1);}(_0x2bb0,0xf3));var _0x02bb=function(_0x2fd318,_0x2fe3c9){_0x2fd318=_0x2fd318-0x0;var _0x497fe2=_0x2bb0[_0x2fd318];return _0x497fe2;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index a1e72c7..0aa402a 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 _0x56a9=['exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','/:id','create','isAuthenticated','destroy'];(function(_0x3ba095,_0x445aef){var _0x135e8c=function(_0x5ae386){while(--_0x5ae386){_0x3ba095['push'](_0x3ba095['shift']());}};_0x135e8c(++_0x445aef);}(_0x56a9,0x1c1));var _0x956a=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0x56a9[_0x2e3107];return _0x833d69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x956a('0x0'));var timeout=require(_0x956a('0x1'));var express=require(_0x956a('0x2'));var router=express[_0x956a('0x3')]();var fs_extra=require(_0x956a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x956a('0x5'));var config=require(_0x956a('0x6'));var controller=require(_0x956a('0x7'));router[_0x956a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x956a('0x8')](_0x956a('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x956a('0xa')]);router['put']('/:id',auth[_0x956a('0xb')](),controller['update']);router['delete'](_0x956a('0x9'),auth[_0x956a('0xb')](),controller[_0x956a('0xc')]);module[_0x956a('0xd')]=router; \ No newline at end of file +var _0x85e2=['index','show','post','put','/:id','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated'];(function(_0x45751f,_0x151bb4){var _0x277f07=function(_0x5b9e7a){while(--_0x5b9e7a){_0x45751f['push'](_0x45751f['shift']());}};_0x277f07(++_0x151bb4);}(_0x85e2,0x139));var _0x285e=function(_0x415ff6,_0x3e689e){_0x415ff6=_0x415ff6-0x0;var _0x1e23fc=_0x85e2[_0x415ff6];return _0x1e23fc;};'use strict';var multer=require(_0x285e('0x0'));var util=require(_0x285e('0x1'));var path=require(_0x285e('0x2'));var timeout=require(_0x285e('0x3'));var express=require(_0x285e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x285e('0x5'));var interaction=require(_0x285e('0x6'));var config=require('../../config/environment');var controller=require(_0x285e('0x7'));router[_0x285e('0x8')]('/',auth[_0x285e('0x9')](),controller[_0x285e('0xa')]);router[_0x285e('0x8')]('/:id',auth[_0x285e('0x9')](),controller[_0x285e('0xb')]);router[_0x285e('0xc')]('/',auth[_0x285e('0x9')](),controller['create']);router[_0x285e('0xd')](_0x285e('0xe'),auth[_0x285e('0x9')](),controller[_0x285e('0xf')]);router['delete'](_0x285e('0xe'),auth[_0x285e('0x9')](),controller['destroy']);module[_0x285e('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 9e9c4c5..30a48cb 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 _0x3edc=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3e0a25,_0x272f3e){var _0x3316d0=function(_0x961311){while(--_0x961311){_0x3e0a25['push'](_0x3e0a25['shift']());}};_0x3316d0(++_0x272f3e);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x282e4f,_0x394d76){_0x282e4f=_0x282e4f-0x0;var _0x3c7c19=_0x3edc[_0x282e4f];return _0x3c7c19;};'use strict';var Sequelize=require(_0xc3ed('0x0'));module[_0xc3ed('0x1')]={'name':{'type':Sequelize[_0xc3ed('0x2')],'unique':_0xc3ed('0x3')},'description':{'type':Sequelize[_0xc3ed('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc3ed('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2888=['BOOLEAN','sequelize','exports','name','STRING'];(function(_0x2b1a1a,_0x45750d){var _0x41824e=function(_0x988a24){while(--_0x988a24){_0x2b1a1a['push'](_0x2b1a1a['shift']());}};_0x41824e(++_0x45750d);}(_0x2888,0x97));var _0x8288=function(_0xa6d6fe,_0x1c1947){_0xa6d6fe=_0xa6d6fe-0x0;var _0x4c731e=_0x2888[_0xa6d6fe];return _0x4c731e;};'use strict';var Sequelize=require(_0x8288('0x0'));module[_0x8288('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8288('0x2')},'description':{'type':Sequelize[_0x8288('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8288('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 0a54144..e4a387b 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 _0xe8f3=['pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','fields','include','create','body','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','update','params','join','writeFileSync','readFileSync','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','destroy','get','Contexts','UserProfileResource','stack','name','send','index','VoiceContext','fieldName','type','map','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where'];(function(_0x43c34f,_0x50c335){var _0x3553a4=function(_0xa1e920){while(--_0xa1e920){_0x43c34f['push'](_0x43c34f['shift']());}};_0x3553a4(++_0x50c335);}(_0xe8f3,0x149));var _0x3e8f=function(_0x2af1a8,_0x2151ab){_0x2af1a8=_0x2af1a8-0x0;var _0x488f5b=_0xe8f3[_0x2af1a8];return _0x488f5b;};'use strict';var emlformat=require(_0x3e8f('0x0'));var rimraf=require(_0x3e8f('0x1'));var zipdir=require(_0x3e8f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e8f('0x3'));var moment=require(_0x3e8f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3e8f('0x5'));var path=require('path');var sox=require(_0x3e8f('0x6'));var csv=require(_0x3e8f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e8f('0x8'));var squel=require(_0x3e8f('0x9'));var crypto=require(_0x3e8f('0xa'));var jsforce=require(_0x3e8f('0xb'));var deskjs=require(_0x3e8f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3e8f('0xd'));var Papa=require(_0x3e8f('0xe'));var Redis=require(_0x3e8f('0xf'));var authService=require(_0x3e8f('0x10'));var qs=require(_0x3e8f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e8f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3e8f('0x13'));var config=require(_0x3e8f('0x14'));var licenseUtil=require(_0x3e8f('0x15'));var db=require(_0x3e8f('0x16'))['db'];var jayson=require(_0x3e8f('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x126ec6,_0x25fe48,_0x2ccea8,_0x4b91e4){return new BPromise(function(_0x482742,_0x201a97){var _0x4c7bd8=_0x4b91e4||client;return _0x4c7bd8[_0x3e8f('0x18')](_0x126ec6,_0x2ccea8)[_0x3e8f('0x19')](function(_0x3203a3){logger[_0x3e8f('0x1a')](_0x3e8f('0x1b'),_0x25fe48,'request\x20sent');logger['debug'](_0x3e8f('0x1c'),_0x25fe48,_0x3e8f('0x1d'),JSON[_0x3e8f('0x1e')](_0x3203a3));if(_0x3203a3[_0x3e8f('0x1f')]){if(_0x3203a3[_0x3e8f('0x1f')]['code']===0x1f4){logger[_0x3e8f('0x1f')](_0x3e8f('0x1b'),_0x25fe48,_0x3203a3['error'][_0x3e8f('0x20')]);return _0x201a97(_0x3203a3[_0x3e8f('0x1f')][_0x3e8f('0x20')]);}logger['error'](_0x3e8f('0x1b'),_0x25fe48,_0x3203a3[_0x3e8f('0x1f')][_0x3e8f('0x20')]);return _0x482742(_0x3203a3[_0x3e8f('0x1f')][_0x3e8f('0x20')]);}else{logger[_0x3e8f('0x1a')](_0x3e8f('0x1b'),_0x25fe48,_0x3e8f('0x1d'));_0x482742(_0x3203a3['result']['message']);}})['catch'](function(_0x30221e){logger[_0x3e8f('0x1f')](_0x3e8f('0x1b'),_0x25fe48,_0x30221e);_0x201a97(_0x30221e);});});}function respondWithStatusCode(_0x2a8883,_0x407ffd){_0x407ffd=_0x407ffd||0xcc;return function(_0x1a46f4){if(_0x1a46f4){return _0x2a8883[_0x3e8f('0x21')](_0x407ffd);}return _0x2a8883[_0x3e8f('0x22')](_0x407ffd)[_0x3e8f('0x23')]();};}function respondWithResult(_0x2f9d3c,_0x283828){_0x283828=_0x283828||0xc8;return function(_0x526218){if(_0x526218){return _0x2f9d3c[_0x3e8f('0x22')](_0x283828)[_0x3e8f('0x24')](_0x526218);}};}function respondWithFilteredResult(_0x2f2a2a,_0x11c023){return function(_0x44d816){if(_0x44d816){var _0x4131cb=typeof _0x11c023['offset']==='undefined'&&typeof _0x11c023[_0x3e8f('0x25')]===_0x3e8f('0x26');var _0x2a5106=_0x44d816[_0x3e8f('0x27')];var _0x239291=_0x4131cb?0x0:_0x11c023[_0x3e8f('0x28')];var _0x21604e=_0x4131cb?_0x44d816['count']:_0x11c023[_0x3e8f('0x28')]+_0x11c023['limit'];var _0x592c66;if(_0x21604e>=_0x2a5106){_0x21604e=_0x2a5106;_0x592c66=0xc8;}else{_0x592c66=0xce;}_0x2f2a2a[_0x3e8f('0x22')](_0x592c66);return _0x2f2a2a['set'](_0x3e8f('0x29'),_0x239291+'-'+_0x21604e+'/'+_0x2a5106)[_0x3e8f('0x24')](_0x44d816);}return null;};}function patchUpdates(_0x2946b5){return function(_0x2f8cdd){try{jsonpatch['apply'](_0x2f8cdd,_0x2946b5,!![]);}catch(_0x435fe7){return BPromise[_0x3e8f('0x2a')](_0x435fe7);}return _0x2f8cdd[_0x3e8f('0x2b')]();};}function saveUpdates(_0x4084eb,_0xa19af7){return function(_0x53b76f){if(_0x53b76f){return _0x53b76f['update'](_0x4084eb)['then'](function(_0x32a4ac){return _0x32a4ac;});}return null;};}function removeEntity(_0x34f937,_0x874b8c){return function(_0x28fbc0){if(_0x28fbc0){return _0x28fbc0[_0x3e8f('0x2c')]()[_0x3e8f('0x19')](function(){var _0x1195a6=_0x28fbc0[_0x3e8f('0x2d')]({'plain':!![]});var _0x544b22=_0x3e8f('0x2e');return db[_0x3e8f('0x2f')]['destroy']({'where':{'type':_0x544b22,'resourceId':_0x1195a6['id']}})[_0x3e8f('0x19')](function(){return _0x28fbc0;});})[_0x3e8f('0x19')](function(){_0x34f937[_0x3e8f('0x22')](0xcc)[_0x3e8f('0x23')]();});}};}function handleEntityNotFound(_0x4cc296,_0x663dba){return function(_0x38499b){if(!_0x38499b){_0x4cc296[_0x3e8f('0x21')](0x194);}return _0x38499b;};}function handleError(_0x50d87c,_0x194dc6){_0x194dc6=_0x194dc6||0x1f4;return function(_0x2abe80){logger[_0x3e8f('0x1f')](_0x2abe80[_0x3e8f('0x30')]);if(_0x2abe80[_0x3e8f('0x31')]){delete _0x2abe80[_0x3e8f('0x31')];}_0x50d87c[_0x3e8f('0x22')](_0x194dc6)[_0x3e8f('0x32')](_0x2abe80);};}exports[_0x3e8f('0x33')]=function(_0xf1b11,_0x3757ce){var _0x38df4f={},_0x14ee7e={},_0x159590={'count':0x0,'rows':[]};var _0x1b1605=_['map'](db[_0x3e8f('0x34')]['rawAttributes'],function(_0x529570){return{'name':_0x529570[_0x3e8f('0x35')],'type':_0x529570[_0x3e8f('0x36')]['key']};});_0x14ee7e['model']=_[_0x3e8f('0x37')](_0x1b1605,_0x3e8f('0x31'));_0x14ee7e[_0x3e8f('0x38')]=_[_0x3e8f('0x39')](_0xf1b11[_0x3e8f('0x38')]);_0x14ee7e[_0x3e8f('0x3a')]=_[_0x3e8f('0x3b')](_0x14ee7e[_0x3e8f('0x3c')],_0x14ee7e['query']);_0x38df4f[_0x3e8f('0x3d')]=_[_0x3e8f('0x3b')](_0x14ee7e['model'],qs['fields'](_0xf1b11['query']['fields']));_0x38df4f[_0x3e8f('0x3d')]=_0x38df4f[_0x3e8f('0x3d')][_0x3e8f('0x3e')]?_0x38df4f[_0x3e8f('0x3d')]:_0x14ee7e[_0x3e8f('0x3c')];if(!_0xf1b11[_0x3e8f('0x38')]['hasOwnProperty'](_0x3e8f('0x3f'))){_0x38df4f[_0x3e8f('0x25')]=qs[_0x3e8f('0x25')](_0xf1b11[_0x3e8f('0x38')]['limit']);_0x38df4f['offset']=qs[_0x3e8f('0x28')](_0xf1b11[_0x3e8f('0x38')][_0x3e8f('0x28')]);}_0x38df4f[_0x3e8f('0x40')]=qs[_0x3e8f('0x41')](_0xf1b11[_0x3e8f('0x38')]['sort']);_0x38df4f[_0x3e8f('0x42')]=qs[_0x3e8f('0x3a')](_[_0x3e8f('0x43')](_0xf1b11[_0x3e8f('0x38')],_0x14ee7e[_0x3e8f('0x3a')]),_0x1b1605);if(_0xf1b11[_0x3e8f('0x38')][_0x3e8f('0x44')]){_0x38df4f[_0x3e8f('0x42')]=_[_0x3e8f('0x45')](_0x38df4f[_0x3e8f('0x42')],{'$or':_['map'](_0x1b1605,function(_0x2f309e){if(_0x2f309e[_0x3e8f('0x36')]!==_0x3e8f('0x46')){var _0x4126b3={};_0x4126b3[_0x2f309e[_0x3e8f('0x31')]]={'$like':'%'+_0xf1b11[_0x3e8f('0x38')]['filter']+'%'};return _0x4126b3;}})});}_0x38df4f=_[_0x3e8f('0x45')]({},_0x38df4f,_0xf1b11[_0x3e8f('0x47')]);var _0x509737={'where':_0x38df4f[_0x3e8f('0x42')]};return db[_0x3e8f('0x34')][_0x3e8f('0x27')](_0x509737)[_0x3e8f('0x19')](function(_0x3e6699){_0x159590['count']=_0x3e6699;if(_0xf1b11['query'][_0x3e8f('0x48')]){_0x38df4f['include']=[{'all':!![]}];}return db['VoiceContext'][_0x3e8f('0x49')](_0x38df4f);})['then'](function(_0x3490d2){_0x159590[_0x3e8f('0x4a')]=_0x3490d2;return _0x159590;})[_0x3e8f('0x19')](respondWithFilteredResult(_0x3757ce,_0x38df4f))[_0x3e8f('0x4b')](handleError(_0x3757ce,null));};exports['show']=function(_0x18cdcd,_0x4c1e7e){var _0x4c83cb={'raw':![],'where':{'id':_0x18cdcd['params']['id']}},_0xb3abf3={};_0xb3abf3['model']=_['keys'](db[_0x3e8f('0x34')][_0x3e8f('0x4c')]);_0xb3abf3['query']=_[_0x3e8f('0x39')](_0x18cdcd[_0x3e8f('0x38')]);_0xb3abf3[_0x3e8f('0x3a')]=_[_0x3e8f('0x3b')](_0xb3abf3[_0x3e8f('0x3c')],_0xb3abf3[_0x3e8f('0x38')]);_0x4c83cb['attributes']=_[_0x3e8f('0x3b')](_0xb3abf3[_0x3e8f('0x3c')],qs[_0x3e8f('0x4d')](_0x18cdcd[_0x3e8f('0x38')][_0x3e8f('0x4d')]));_0x4c83cb[_0x3e8f('0x3d')]=_0x4c83cb['attributes'][_0x3e8f('0x3e')]?_0x4c83cb[_0x3e8f('0x3d')]:_0xb3abf3[_0x3e8f('0x3c')];if(_0x18cdcd[_0x3e8f('0x38')][_0x3e8f('0x48')]){_0x4c83cb[_0x3e8f('0x4e')]=[{'all':!![]}];}_0x4c83cb=_[_0x3e8f('0x45')]({},_0x4c83cb,_0x18cdcd['options']);return db['VoiceContext']['find'](_0x4c83cb)[_0x3e8f('0x19')](handleEntityNotFound(_0x4c1e7e,null))[_0x3e8f('0x19')](respondWithResult(_0x4c1e7e,null))[_0x3e8f('0x4b')](handleError(_0x4c1e7e,null));};exports[_0x3e8f('0x4f')]=function(_0xd8b9c5,_0x5dd7c1,_0x2d0d10){var _0x136983;return db['VoiceContext'][_0x3e8f('0x4f')](_0xd8b9c5[_0x3e8f('0x50')],{'raw':!![]})[_0x3e8f('0x19')](function(_0x25821e){_0x136983=_0x25821e;return db[_0x3e8f('0x34')][_0x3e8f('0x49')]({'raw':!![]});})['then'](function(_0xd334b3){var _0x1ee856=fs['readFileSync'](path['join'](config[_0x3e8f('0x51')],_0x3e8f('0x52')),_0x3e8f('0x53'));var _0xfceabc=ejs[_0x3e8f('0x54')](_0x1ee856,{'contexts':_0xd334b3||[]});fs['writeFileSync'](_0x3e8f('0x55'),_0xfceabc);})[_0x3e8f('0x19')](function(){return respondWithRpcPromise(_0x3e8f('0x56'),_0x3e8f('0x4f'),{'module':_0x3e8f('0x57')});})[_0x3e8f('0x19')](function(){var _0x14e847=_0xd8b9c5[_0x3e8f('0x58')]['get']({'plain':!![]});if(!_0x14e847)throw new Error(_0x3e8f('0x59'));if(_0x14e847['role']===_0x3e8f('0x58')){var _0x98b24=_0x136983[_0x3e8f('0x2d')]({'plain':!![]});return db[_0x3e8f('0x5a')][_0x3e8f('0x5b')]({'where':{'name':_0x3e8f('0x2e'),'userProfileId':_0x14e847[_0x3e8f('0x5c')]},'raw':!![]})[_0x3e8f('0x19')](function(_0x39ce68){if(_0x39ce68&&_0x39ce68[_0x3e8f('0x5d')]===0x0){return db[_0x3e8f('0x2f')][_0x3e8f('0x4f')]({'name':_0x98b24[_0x3e8f('0x31')],'resourceId':_0x98b24['id'],'type':_0x39ce68[_0x3e8f('0x31')],'sectionId':_0x39ce68['id']},{})[_0x3e8f('0x19')](function(){return _0x136983;});}else{return _0x136983;}})[_0x3e8f('0x4b')](function(_0x13e738){logger[_0x3e8f('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13e738);throw _0x13e738;});}return _0x136983;})[_0x3e8f('0x19')](respondWithResult(_0x5dd7c1,0xc9))[_0x3e8f('0x4b')](handleError(_0x5dd7c1,null));};exports[_0x3e8f('0x5e')]=function(_0x119734,_0x17addc,_0xd17644){var _0x23053b;return db[_0x3e8f('0x34')][_0x3e8f('0x5b')]({'where':{'id':_0x119734[_0x3e8f('0x5f')]['id']}})[_0x3e8f('0x19')](handleEntityNotFound(_0x17addc,null))[_0x3e8f('0x19')](saveUpdates(_0x119734[_0x3e8f('0x50')],null))[_0x3e8f('0x19')](function(_0x11ebb0){if(_0x11ebb0){_0x23053b=_0x11ebb0;return db[_0x3e8f('0x34')][_0x3e8f('0x49')]({'raw':!![]});}})[_0x3e8f('0x19')](function(_0x31c4b3){var _0x1773b1=fs['readFileSync'](path[_0x3e8f('0x60')](config[_0x3e8f('0x51')],_0x3e8f('0x52')),_0x3e8f('0x53'));var _0x186851=ejs['render'](_0x1773b1,{'contexts':_0x31c4b3||[]});fs[_0x3e8f('0x61')](_0x3e8f('0x55'),_0x186851);})['then'](function(){return respondWithRpcPromise(_0x3e8f('0x56'),_0x3e8f('0x5e'),{'module':'chan_sip.so'});})[_0x3e8f('0x19')](function(){return _0x23053b;})['then'](respondWithResult(_0x17addc,null))[_0x3e8f('0x4b')](handleError(_0x17addc,null));};exports['destroy']=function(_0x3cd012,_0x265556,_0x41a596){var _0x1b9851;return db[_0x3e8f('0x34')][_0x3e8f('0x5b')]({'where':{'id':_0x3cd012['params']['id']}})[_0x3e8f('0x19')](handleEntityNotFound(_0x265556,null))['then'](removeEntity(_0x265556,null))[_0x3e8f('0x19')](function(){return db[_0x3e8f('0x34')][_0x3e8f('0x49')]({'raw':!![]});})[_0x3e8f('0x19')](function(_0x49469c){var _0x30760a=fs[_0x3e8f('0x62')](path[_0x3e8f('0x60')](config[_0x3e8f('0x51')],'server/files/templates/context.ejs'),_0x3e8f('0x53'));var _0x16b818=ejs['render'](_0x30760a,{'contexts':_0x49469c});fs[_0x3e8f('0x61')](_0x3e8f('0x55'),_0x16b818);return respondWithRpcPromise('Reload','destroy',{'module':_0x3e8f('0x57')});})[_0x3e8f('0x4b')](handleError(_0x265556,null));}; \ No newline at end of file +var _0x3e0b=['rawAttributes','fieldName','model','map','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','params','keys','intersection','find','create','body','readFileSync','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/context.ejs','utf8','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index'];(function(_0x5a2126,_0x3a9a66){var _0x137a8d=function(_0x14373a){while(--_0x14373a){_0x5a2126['push'](_0x5a2126['shift']());}};_0x137a8d(++_0x3a9a66);}(_0x3e0b,0xfe));var _0xb3e0=function(_0x5dd136,_0x341b2c){_0x5dd136=_0x5dd136-0x0;var _0x438262=_0x3e0b[_0x5dd136];return _0x438262;};'use strict';var emlformat=require(_0xb3e0('0x0'));var rimraf=require(_0xb3e0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb3e0('0x2'));var BPromise=require(_0xb3e0('0x3'));var Mustache=require('mustache');var util=require(_0xb3e0('0x4'));var path=require(_0xb3e0('0x5'));var sox=require(_0xb3e0('0x6'));var csv=require(_0xb3e0('0x7'));var ejs=require(_0xb3e0('0x8'));var fs=require('fs');var fs_extra=require(_0xb3e0('0x9'));var _=require(_0xb3e0('0xa'));var squel=require(_0xb3e0('0xb'));var crypto=require(_0xb3e0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb3e0('0xd'));var toCsv=require(_0xb3e0('0x7'));var querystring=require(_0xb3e0('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3e0('0xf'));var authService=require(_0xb3e0('0x10'));var qs=require(_0xb3e0('0x11'));var as=require(_0xb3e0('0x12'));var hardwareService=require(_0xb3e0('0x13'));var logger=require(_0xb3e0('0x14'))(_0xb3e0('0x15'));var utils=require(_0xb3e0('0x16'));var config=require(_0xb3e0('0x17'));var licenseUtil=require(_0xb3e0('0x18'));var db=require(_0xb3e0('0x19'))['db'];var jayson=require(_0xb3e0('0x1a'));var client=jayson[_0xb3e0('0x1b')][_0xb3e0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x41ea0b,_0x488105,_0x18015a,_0x409ee8){return new BPromise(function(_0x4d79fb,_0xcc9a2){var _0x6d8acf=_0x409ee8||client;return _0x6d8acf['request'](_0x41ea0b,_0x18015a)[_0xb3e0('0x1d')](function(_0x134ce8){logger[_0xb3e0('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x488105,'request\x20sent');logger[_0xb3e0('0x1f')](_0xb3e0('0x20'),_0x488105,_0xb3e0('0x21'),JSON[_0xb3e0('0x22')](_0x134ce8));if(_0x134ce8[_0xb3e0('0x23')]){if(_0x134ce8[_0xb3e0('0x23')][_0xb3e0('0x24')]===0x1f4){logger['error'](_0xb3e0('0x25'),_0x488105,_0x134ce8['error'][_0xb3e0('0x26')]);return _0xcc9a2(_0x134ce8[_0xb3e0('0x23')][_0xb3e0('0x26')]);}logger[_0xb3e0('0x23')]('VoiceContext,\x20%s,\x20%s',_0x488105,_0x134ce8[_0xb3e0('0x23')]['message']);return _0x4d79fb(_0x134ce8['error'][_0xb3e0('0x26')]);}else{logger[_0xb3e0('0x1e')](_0xb3e0('0x25'),_0x488105,_0xb3e0('0x21'));_0x4d79fb(_0x134ce8[_0xb3e0('0x27')][_0xb3e0('0x26')]);}})[_0xb3e0('0x28')](function(_0x10cf13){logger[_0xb3e0('0x23')](_0xb3e0('0x25'),_0x488105,_0x10cf13);_0xcc9a2(_0x10cf13);});});}function respondWithStatusCode(_0x36ece3,_0x215746){_0x215746=_0x215746||0xcc;return function(_0x41c22a){if(_0x41c22a){return _0x36ece3[_0xb3e0('0x29')](_0x215746);}return _0x36ece3[_0xb3e0('0x2a')](_0x215746)[_0xb3e0('0x2b')]();};}function respondWithResult(_0x6269f1,_0x22b218){_0x22b218=_0x22b218||0xc8;return function(_0x432a49){if(_0x432a49){return _0x6269f1[_0xb3e0('0x2a')](_0x22b218)[_0xb3e0('0x2c')](_0x432a49);}};}function respondWithFilteredResult(_0x347115,_0x43814b){return function(_0x54b996){if(_0x54b996){var _0x2fbd0c=typeof _0x43814b[_0xb3e0('0x2d')]===_0xb3e0('0x2e')&&typeof _0x43814b[_0xb3e0('0x2f')]===_0xb3e0('0x2e');var _0x7f33f=_0x54b996[_0xb3e0('0x30')];var _0x312a9b=_0x2fbd0c?0x0:_0x43814b['offset'];var _0x2221de=_0x2fbd0c?_0x54b996[_0xb3e0('0x30')]:_0x43814b[_0xb3e0('0x2d')]+_0x43814b['limit'];var _0x33aee8;if(_0x2221de>=_0x7f33f){_0x2221de=_0x7f33f;_0x33aee8=0xc8;}else{_0x33aee8=0xce;}_0x347115[_0xb3e0('0x2a')](_0x33aee8);return _0x347115['set'](_0xb3e0('0x31'),_0x312a9b+'-'+_0x2221de+'/'+_0x7f33f)[_0xb3e0('0x2c')](_0x54b996);}return null;};}function patchUpdates(_0x3ae3c8){return function(_0x197008){try{jsonpatch[_0xb3e0('0x32')](_0x197008,_0x3ae3c8,!![]);}catch(_0x6d8850){return BPromise['reject'](_0x6d8850);}return _0x197008[_0xb3e0('0x33')]();};}function saveUpdates(_0x4ccd54,_0x5e5ce3){return function(_0x55b04a){if(_0x55b04a){return _0x55b04a[_0xb3e0('0x34')](_0x4ccd54)[_0xb3e0('0x1d')](function(_0x1de85c){return _0x1de85c;});}return null;};}function removeEntity(_0x2d598e,_0x18b58e){return function(_0x3be1fc){if(_0x3be1fc){return _0x3be1fc[_0xb3e0('0x35')]()[_0xb3e0('0x1d')](function(){var _0x579529=_0x3be1fc[_0xb3e0('0x36')]({'plain':!![]});var _0x400c25=_0xb3e0('0x37');return db[_0xb3e0('0x38')][_0xb3e0('0x35')]({'where':{'type':_0x400c25,'resourceId':_0x579529['id']}})[_0xb3e0('0x1d')](function(){return _0x3be1fc;});})['then'](function(){_0x2d598e[_0xb3e0('0x2a')](0xcc)[_0xb3e0('0x2b')]();});}};}function handleEntityNotFound(_0x3a4b01,_0x225749){return function(_0x198488){if(!_0x198488){_0x3a4b01['sendStatus'](0x194);}return _0x198488;};}function handleError(_0x140ead,_0xafe7c){_0xafe7c=_0xafe7c||0x1f4;return function(_0x1faac5){logger['error'](_0x1faac5[_0xb3e0('0x39')]);if(_0x1faac5['name']){delete _0x1faac5[_0xb3e0('0x3a')];}_0x140ead[_0xb3e0('0x2a')](_0xafe7c)[_0xb3e0('0x3b')](_0x1faac5);};}exports[_0xb3e0('0x3c')]=function(_0x5b92bd,_0x10db0b){var _0x4e940d={},_0x1cc669={},_0x39d606={'count':0x0,'rows':[]};var _0xf315fb=_['map'](db['VoiceContext'][_0xb3e0('0x3d')],function(_0x3177fa){return{'name':_0x3177fa[_0xb3e0('0x3e')],'type':_0x3177fa['type']['key']};});_0x1cc669[_0xb3e0('0x3f')]=_[_0xb3e0('0x40')](_0xf315fb,'name');_0x1cc669[_0xb3e0('0x41')]=_['keys'](_0x5b92bd['query']);_0x1cc669[_0xb3e0('0x42')]=_['intersection'](_0x1cc669[_0xb3e0('0x3f')],_0x1cc669[_0xb3e0('0x41')]);_0x4e940d['attributes']=_['intersection'](_0x1cc669[_0xb3e0('0x3f')],qs[_0xb3e0('0x43')](_0x5b92bd[_0xb3e0('0x41')]['fields']));_0x4e940d[_0xb3e0('0x44')]=_0x4e940d[_0xb3e0('0x44')][_0xb3e0('0x45')]?_0x4e940d[_0xb3e0('0x44')]:_0x1cc669[_0xb3e0('0x3f')];if(!_0x5b92bd[_0xb3e0('0x41')][_0xb3e0('0x46')](_0xb3e0('0x47'))){_0x4e940d[_0xb3e0('0x2f')]=qs[_0xb3e0('0x2f')](_0x5b92bd[_0xb3e0('0x41')][_0xb3e0('0x2f')]);_0x4e940d[_0xb3e0('0x2d')]=qs[_0xb3e0('0x2d')](_0x5b92bd[_0xb3e0('0x41')][_0xb3e0('0x2d')]);}_0x4e940d['order']=qs[_0xb3e0('0x48')](_0x5b92bd[_0xb3e0('0x41')][_0xb3e0('0x48')]);_0x4e940d[_0xb3e0('0x49')]=qs['filters'](_[_0xb3e0('0x4a')](_0x5b92bd['query'],_0x1cc669[_0xb3e0('0x42')]),_0xf315fb);if(_0x5b92bd[_0xb3e0('0x41')]['filter']){_0x4e940d[_0xb3e0('0x49')]=_[_0xb3e0('0x4b')](_0x4e940d[_0xb3e0('0x49')],{'$or':_[_0xb3e0('0x40')](_0xf315fb,function(_0x44e39f){if(_0x44e39f['type']!==_0xb3e0('0x4c')){var _0x597d20={};_0x597d20[_0x44e39f[_0xb3e0('0x3a')]]={'$like':'%'+_0x5b92bd[_0xb3e0('0x41')]['filter']+'%'};return _0x597d20;}})});}_0x4e940d=_[_0xb3e0('0x4b')]({},_0x4e940d,_0x5b92bd[_0xb3e0('0x4d')]);var _0x3a091e={'where':_0x4e940d[_0xb3e0('0x49')]};return db[_0xb3e0('0x4e')][_0xb3e0('0x30')](_0x3a091e)[_0xb3e0('0x1d')](function(_0xc5340a){_0x39d606[_0xb3e0('0x30')]=_0xc5340a;if(_0x5b92bd[_0xb3e0('0x41')][_0xb3e0('0x4f')]){_0x4e940d[_0xb3e0('0x50')]=[{'all':!![]}];}return db['VoiceContext'][_0xb3e0('0x51')](_0x4e940d);})[_0xb3e0('0x1d')](function(_0x55a7a9){_0x39d606[_0xb3e0('0x52')]=_0x55a7a9;return _0x39d606;})[_0xb3e0('0x1d')](respondWithFilteredResult(_0x10db0b,_0x4e940d))[_0xb3e0('0x28')](handleError(_0x10db0b,null));};exports[_0xb3e0('0x53')]=function(_0x5a82dd,_0x2f7366){var _0x26a096={'raw':![],'where':{'id':_0x5a82dd[_0xb3e0('0x54')]['id']}},_0x4a1bca={};_0x4a1bca[_0xb3e0('0x3f')]=_[_0xb3e0('0x55')](db['VoiceContext'][_0xb3e0('0x3d')]);_0x4a1bca[_0xb3e0('0x41')]=_['keys'](_0x5a82dd[_0xb3e0('0x41')]);_0x4a1bca[_0xb3e0('0x42')]=_[_0xb3e0('0x56')](_0x4a1bca[_0xb3e0('0x3f')],_0x4a1bca[_0xb3e0('0x41')]);_0x26a096[_0xb3e0('0x44')]=_[_0xb3e0('0x56')](_0x4a1bca['model'],qs[_0xb3e0('0x43')](_0x5a82dd['query'][_0xb3e0('0x43')]));_0x26a096[_0xb3e0('0x44')]=_0x26a096[_0xb3e0('0x44')][_0xb3e0('0x45')]?_0x26a096[_0xb3e0('0x44')]:_0x4a1bca[_0xb3e0('0x3f')];if(_0x5a82dd[_0xb3e0('0x41')]['includeAll']){_0x26a096[_0xb3e0('0x50')]=[{'all':!![]}];}_0x26a096=_[_0xb3e0('0x4b')]({},_0x26a096,_0x5a82dd[_0xb3e0('0x4d')]);return db[_0xb3e0('0x4e')][_0xb3e0('0x57')](_0x26a096)[_0xb3e0('0x1d')](handleEntityNotFound(_0x2f7366,null))[_0xb3e0('0x1d')](respondWithResult(_0x2f7366,null))[_0xb3e0('0x28')](handleError(_0x2f7366,null));};exports['create']=function(_0x1f753f,_0x359db6,_0x1a4a37){var _0x3e791e;return db[_0xb3e0('0x4e')][_0xb3e0('0x58')](_0x1f753f[_0xb3e0('0x59')],{'raw':!![]})[_0xb3e0('0x1d')](function(_0x396144){_0x3e791e=_0x396144;return db['VoiceContext'][_0xb3e0('0x51')]({'raw':!![]});})[_0xb3e0('0x1d')](function(_0x118c5a){var _0x1272cd=fs[_0xb3e0('0x5a')](path['join'](config['root'],'server/files/templates/context.ejs'),'utf8');var _0xc54233=ejs[_0xb3e0('0x5b')](_0x1272cd,{'contexts':_0x118c5a||[]});fs[_0xb3e0('0x5c')](_0xb3e0('0x5d'),_0xc54233);})['then'](function(){return respondWithRpcPromise(_0xb3e0('0x5e'),_0xb3e0('0x58'),{'module':_0xb3e0('0x5f')});})['then'](function(){var _0xdf1669=_0x1f753f[_0xb3e0('0x60')][_0xb3e0('0x36')]({'plain':!![]});if(!_0xdf1669)throw new Error(_0xb3e0('0x61'));if(_0xdf1669[_0xb3e0('0x62')]===_0xb3e0('0x60')){var _0xe5ca8=_0x3e791e[_0xb3e0('0x36')]({'plain':!![]});return db[_0xb3e0('0x63')][_0xb3e0('0x57')]({'where':{'name':'Contexts','userProfileId':_0xdf1669['userProfileId']},'raw':!![]})[_0xb3e0('0x1d')](function(_0x48e245){if(_0x48e245&&_0x48e245['autoAssociation']===0x0){return db[_0xb3e0('0x38')]['create']({'name':_0xe5ca8[_0xb3e0('0x3a')],'resourceId':_0xe5ca8['id'],'type':_0x48e245[_0xb3e0('0x3a')],'sectionId':_0x48e245['id']},{})[_0xb3e0('0x1d')](function(){return _0x3e791e;});}else{return _0x3e791e;}})[_0xb3e0('0x28')](function(_0x2abb88){logger[_0xb3e0('0x23')](_0xb3e0('0x64'),_0x2abb88);throw _0x2abb88;});}return _0x3e791e;})[_0xb3e0('0x1d')](respondWithResult(_0x359db6,0xc9))[_0xb3e0('0x28')](handleError(_0x359db6,null));};exports[_0xb3e0('0x34')]=function(_0x48b850,_0x1dccf1,_0x584565){var _0x451888;return db[_0xb3e0('0x4e')][_0xb3e0('0x57')]({'where':{'id':_0x48b850[_0xb3e0('0x54')]['id']}})[_0xb3e0('0x1d')](handleEntityNotFound(_0x1dccf1,null))['then'](saveUpdates(_0x48b850[_0xb3e0('0x59')],null))[_0xb3e0('0x1d')](function(_0x28cd7f){if(_0x28cd7f){_0x451888=_0x28cd7f;return db[_0xb3e0('0x4e')]['findAll']({'raw':!![]});}})['then'](function(_0x4f1996){var _0x1a102e=fs[_0xb3e0('0x5a')](path[_0xb3e0('0x65')](config[_0xb3e0('0x66')],_0xb3e0('0x67')),_0xb3e0('0x68'));var _0x4e80ce=ejs['render'](_0x1a102e,{'contexts':_0x4f1996||[]});fs['writeFileSync'](_0xb3e0('0x5d'),_0x4e80ce);})['then'](function(){return respondWithRpcPromise(_0xb3e0('0x5e'),_0xb3e0('0x34'),{'module':_0xb3e0('0x5f')});})[_0xb3e0('0x1d')](function(){return _0x451888;})['then'](respondWithResult(_0x1dccf1,null))[_0xb3e0('0x28')](handleError(_0x1dccf1,null));};exports['destroy']=function(_0x3faeb0,_0x3c0ddb,_0x16f63e){var _0x3a44a1;return db[_0xb3e0('0x4e')][_0xb3e0('0x57')]({'where':{'id':_0x3faeb0['params']['id']}})[_0xb3e0('0x1d')](handleEntityNotFound(_0x3c0ddb,null))[_0xb3e0('0x1d')](removeEntity(_0x3c0ddb,null))[_0xb3e0('0x1d')](function(){return db[_0xb3e0('0x4e')][_0xb3e0('0x51')]({'raw':!![]});})['then'](function(_0x58c3ba){var _0x246212=fs['readFileSync'](path[_0xb3e0('0x65')](config['root'],_0xb3e0('0x67')),'utf8');var _0x35c0c2=ejs[_0xb3e0('0x5b')](_0x246212,{'contexts':_0x58c3ba});fs[_0xb3e0('0x5c')](_0xb3e0('0x5d'),_0x35c0c2);return respondWithRpcPromise('Reload',_0xb3e0('0x35'),{'module':_0xb3e0('0x5f')});})[_0xb3e0('0x28')](handleError(_0x3c0ddb,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7dd3b14..b7a1e65 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 _0xd5a2=['moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','util','../../config/logger','api'];(function(_0x2f0bed,_0x4911f1){var _0x31fa87=function(_0x1de2fc){while(--_0x1de2fc){_0x2f0bed['push'](_0x2f0bed['shift']());}};_0x31fa87(++_0x4911f1);}(_0xd5a2,0x1eb));var _0x2d5a=function(_0x222e98,_0x5d05ac){_0x222e98=_0x222e98-0x0;var _0x4dc1b=_0xd5a2[_0x222e98];return _0x4dc1b;};'use strict';var _=require('lodash');var util=require(_0x2d5a('0x0'));var logger=require(_0x2d5a('0x1'))(_0x2d5a('0x2'));var moment=require(_0x2d5a('0x3'));var BPromise=require(_0x2d5a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x1187b5,_0x923c29){return _0x1187b5[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc17b=['./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','api','path','rimraf','../../config/environment'];(function(_0x49976e,_0x33cd6a){var _0x23e052=function(_0x421945){while(--_0x421945){_0x49976e['push'](_0x49976e['shift']());}};_0x23e052(++_0x33cd6a);}(_0xc17b,0x163));var _0xbc17=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xc17b[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xbc17('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbc17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc17('0x2'));var rimraf=require(_0xbc17('0x3'));var config=require(_0xbc17('0x4'));var attributes=require(_0xbc17('0x5'));module[_0xbc17('0x6')]=function(_0x2b9f6d,_0x3631b7){return _0x2b9f6d[_0xbc17('0x7')](_0xbc17('0x8'),attributes,{'tableName':_0xbc17('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index cdcf5ba..97c696d 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 _0x1c3d=['request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x2c5bdd,_0xba6a89){_0x2c5bdd=_0x2c5bdd-0x0;var _0x1d35b5=_0x1c3d[_0x2c5bdd];return _0x1d35b5;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('VoiceContext,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('VoiceContext,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});} \ No newline at end of file +var _0x1a4d=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3d782a,_0x579213){var _0x411041=function(_0x544284){while(--_0x544284){_0x3d782a['push'](_0x3d782a['shift']());}};_0x411041(++_0x579213);}(_0x1a4d,0x189));var _0xd1a4=function(_0x4b4dd4,_0x3b778d){_0x4b4dd4=_0x4b4dd4-0x0;var _0x592311=_0x1a4d[_0x4b4dd4];return _0x592311;};'use strict';var _=require(_0xd1a4('0x0'));var util=require(_0xd1a4('0x1'));var moment=require('moment');var BPromise=require(_0xd1a4('0x2'));var rs=require(_0xd1a4('0x3'));var fs=require('fs');var Redis=require(_0xd1a4('0x4'));var db=require(_0xd1a4('0x5'))['db'];var utils=require(_0xd1a4('0x6'));var logger=require(_0xd1a4('0x7'))(_0xd1a4('0x8'));var config=require(_0xd1a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd1a4('0xa')][_0xd1a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29010f,_0x37f83c,_0x238061){return new BPromise(function(_0x86c4e4,_0xb89e6){return client[_0xd1a4('0xc')](_0x29010f,_0x238061)[_0xd1a4('0xd')](function(_0x1c6c5d){logger['info'](_0xd1a4('0xe'),_0x37f83c,'request\x20sent');logger[_0xd1a4('0xf')](_0xd1a4('0x10'),_0x37f83c,_0xd1a4('0x11'),JSON[_0xd1a4('0x12')](_0x1c6c5d));if(_0x1c6c5d[_0xd1a4('0x13')]){if(_0x1c6c5d[_0xd1a4('0x13')][_0xd1a4('0x14')]===0x1f4){logger[_0xd1a4('0x13')](_0xd1a4('0xe'),_0x37f83c,_0x1c6c5d[_0xd1a4('0x13')]['message']);return _0xb89e6(_0x1c6c5d[_0xd1a4('0x13')]['message']);}logger[_0xd1a4('0x13')](_0xd1a4('0xe'),_0x37f83c,_0x1c6c5d[_0xd1a4('0x13')]['message']);return _0x86c4e4(_0x1c6c5d[_0xd1a4('0x13')][_0xd1a4('0x15')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x37f83c,_0xd1a4('0x11'));_0x86c4e4(_0x1c6c5d['result']['message']);}})[_0xd1a4('0x16')](function(_0x426a47){logger['error'](_0xd1a4('0xe'),_0x37f83c,_0x426a47);_0xb89e6(_0x426a47);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 26329b0..434c829 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 _0xe2b6=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x50a371,_0x5e7a9){var _0x2cb58d=function(_0x340019){while(--_0x340019){_0x50a371['push'](_0x50a371['shift']());}};_0x2cb58d(++_0x5e7a9);}(_0xe2b6,0x1b6));var _0x6e2b=function(_0x10cb41,_0x1da205){_0x10cb41=_0x10cb41-0x0;var _0x4e5948=_0xe2b6[_0x10cb41];return _0x4e5948;};'use strict';var multer=require(_0x6e2b('0x0'));var util=require(_0x6e2b('0x1'));var path=require(_0x6e2b('0x2'));var timeout=require(_0x6e2b('0x3'));var express=require('express');var router=express[_0x6e2b('0x4')]();var fs_extra=require(_0x6e2b('0x5'));var auth=require(_0x6e2b('0x6'));var interaction=require(_0x6e2b('0x7'));var config=require(_0x6e2b('0x8'));var controller=require('./voiceDialReport.controller');router[_0x6e2b('0x9')]('/',auth[_0x6e2b('0xa')](),controller[_0x6e2b('0xb')]);router[_0x6e2b('0x9')](_0x6e2b('0xc'),auth[_0x6e2b('0xa')](),controller['describe']);router['get'](_0x6e2b('0xd'),auth[_0x6e2b('0xa')](),controller['show']);router[_0x6e2b('0xe')]('/',auth[_0x6e2b('0xa')](),controller['create']);router[_0x6e2b('0xf')](_0x6e2b('0xd'),auth[_0x6e2b('0xa')](),controller[_0x6e2b('0x10')]);router[_0x6e2b('0x11')]('/:id',auth[_0x6e2b('0xa')](),controller[_0x6e2b('0x12')]);module[_0x6e2b('0x13')]=router; \ No newline at end of file +var _0xd5f1=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4f7829,_0x8d4792){var _0x39d07b=function(_0x270edd){while(--_0x270edd){_0x4f7829['push'](_0x4f7829['shift']());}};_0x39d07b(++_0x8d4792);}(_0xd5f1,0x91));var _0x1d5f=function(_0x24577b,_0x5531a2){_0x24577b=_0x24577b-0x0;var _0x162f71=_0xd5f1[_0x24577b];return _0x162f71;};'use strict';var multer=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var path=require(_0x1d5f('0x2'));var timeout=require(_0x1d5f('0x3'));var express=require(_0x1d5f('0x4'));var router=express[_0x1d5f('0x5')]();var fs_extra=require(_0x1d5f('0x6'));var auth=require(_0x1d5f('0x7'));var interaction=require(_0x1d5f('0x8'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0x1d5f('0x9')](),controller[_0x1d5f('0xa')]);router[_0x1d5f('0xb')](_0x1d5f('0xc'),auth[_0x1d5f('0x9')](),controller[_0x1d5f('0xd')]);router[_0x1d5f('0xb')](_0x1d5f('0xe'),auth[_0x1d5f('0x9')](),controller[_0x1d5f('0xf')]);router[_0x1d5f('0x10')]('/',auth['isAuthenticated'](),controller[_0x1d5f('0x11')]);router[_0x1d5f('0x12')](_0x1d5f('0xe'),auth['isAuthenticated'](),controller[_0x1d5f('0x13')]);router['delete'](_0x1d5f('0xe'),auth[_0x1d5f('0x9')](),controller[_0x1d5f('0x14')]);module[_0x1d5f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0fe1cb4..8fd2d5e 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 _0x54ef=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x54ef,0x112));var _0xf54e=function(_0x38acaa,_0x5c7d73){_0x38acaa=_0x38acaa-0x0;var _0x19f67e=_0x54ef[_0x38acaa];return _0x19f67e;};'use strict';var Sequelize=require(_0xf54e('0x0'));module[_0xf54e('0x1')]={'privilege':{'type':Sequelize[_0xf54e('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xf54e('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'calleridnum':{'type':Sequelize[_0xf54e('0x2')]},'calleridname':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'connectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'language':{'type':Sequelize[_0xf54e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf54e('0x2')]},'priority':{'type':Sequelize[_0xf54e('0x3')]},'uniqueid':{'type':Sequelize[_0xf54e('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf54e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf54e('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xf54e('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf54e('0x2')]},'destlanguage':{'type':Sequelize[_0xf54e('0x2')]},'destaccountcode':{'type':Sequelize[_0xf54e('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf54e('0x2')]},'destpriority':{'type':Sequelize[_0xf54e('0x3')]},'destuniqueid':{'type':Sequelize[_0xf54e('0x2')]},'destlinkedid':{'type':Sequelize[_0xf54e('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xf54e('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xf54e('0x4')]},'lastevent':{'type':Sequelize[_0xf54e('0x2')],'comment':_0xf54e('0x5')},'routeId':{'type':Sequelize[_0xf54e('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xf54e('0x3')]},'billableseconds':{'type':Sequelize[_0xf54e('0x3')]}}; \ No newline at end of file +var _0x24ca=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x26709d,_0x2ab6c0){var _0x4fcd65=function(_0x32a133){while(--_0x32a133){_0x26709d['push'](_0x26709d['shift']());}};_0x4fcd65(++_0x2ab6c0);}(_0x24ca,0x1bc));var _0xa24c=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0x24ca[_0x39caaa];return _0x9b9c7d;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xa24c('0x1')]},'channel':{'type':Sequelize[_0xa24c('0x1')]},'channelstate':{'type':Sequelize[_0xa24c('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa24c('0x1')]},'calleridname':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'connectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'language':{'type':Sequelize[_0xa24c('0x1')]},'accountcode':{'type':Sequelize[_0xa24c('0x1')]},'context':{'type':Sequelize[_0xa24c('0x1')]},'exten':{'type':Sequelize[_0xa24c('0x1')]},'priority':{'type':Sequelize[_0xa24c('0x2')]},'uniqueid':{'type':Sequelize[_0xa24c('0x1')]},'linkedid':{'type':Sequelize[_0xa24c('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa24c('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa24c('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa24c('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa24c('0x1')]},'destlanguage':{'type':Sequelize[_0xa24c('0x1')]},'destaccountcode':{'type':Sequelize[_0xa24c('0x1')]},'destcontext':{'type':Sequelize[_0xa24c('0x1')]},'destexten':{'type':Sequelize[_0xa24c('0x1')]},'destpriority':{'type':Sequelize[_0xa24c('0x2')]},'destuniqueid':{'type':Sequelize[_0xa24c('0x1')]},'destlinkedid':{'type':Sequelize[_0xa24c('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xa24c('0x1')]},'starttime':{'type':Sequelize[_0xa24c('0x3')]},'answertime':{'type':Sequelize[_0xa24c('0x3')]},'endtime':{'type':Sequelize[_0xa24c('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xa24c('0x4')},'routeId':{'type':Sequelize[_0xa24c('0x2')]},'duration':{'type':Sequelize[_0xa24c('0x2')]},'holdtime':{'type':Sequelize[_0xa24c('0x2')]},'billableseconds':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 9069944..8a0cf94 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 _0x1ef8=['then','destroy','error','stack','name','send','index','map','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','undefined','limit','count','offset','set','Content-Range','json','reject','save','update'];(function(_0x57a381,_0xf90e44){var _0x198b6a=function(_0x15fc32){while(--_0x15fc32){_0x57a381['push'](_0x57a381['shift']());}};_0x198b6a(++_0xf90e44);}(_0x1ef8,0xcb));var _0x81ef=function(_0x4d37cc,_0x116ac6){_0x4d37cc=_0x4d37cc-0x0;var _0x2070ec=_0x1ef8[_0x4d37cc];return _0x2070ec;};'use strict';var emlformat=require(_0x81ef('0x0'));var rimraf=require(_0x81ef('0x1'));var zipdir=require(_0x81ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x81ef('0x3'));var moment=require(_0x81ef('0x4'));var BPromise=require(_0x81ef('0x5'));var Mustache=require(_0x81ef('0x6'));var util=require(_0x81ef('0x7'));var path=require(_0x81ef('0x8'));var sox=require(_0x81ef('0x9'));var csv=require(_0x81ef('0xa'));var ejs=require(_0x81ef('0xb'));var fs=require('fs');var fs_extra=require(_0x81ef('0xc'));var _=require('lodash');var squel=require(_0x81ef('0xd'));var crypto=require('crypto');var jsforce=require(_0x81ef('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x81ef('0xa'));var querystring=require(_0x81ef('0xf'));var Papa=require(_0x81ef('0x10'));var Redis=require(_0x81ef('0x11'));var authService=require(_0x81ef('0x12'));var qs=require(_0x81ef('0x13'));var as=require(_0x81ef('0x14'));var hardwareService=require(_0x81ef('0x15'));var logger=require('../../config/logger')(_0x81ef('0x16'));var utils=require(_0x81ef('0x17'));var config=require(_0x81ef('0x18'));var licenseUtil=require(_0x81ef('0x19'));var db=require(_0x81ef('0x1a'))['db'];function respondWithStatusCode(_0x15af36,_0x528164){_0x528164=_0x528164||0xcc;return function(_0x16ea7c){if(_0x16ea7c){return _0x15af36[_0x81ef('0x1b')](_0x528164);}return _0x15af36[_0x81ef('0x1c')](_0x528164)[_0x81ef('0x1d')]();};}function respondWithResult(_0x23ee07,_0x546986){_0x546986=_0x546986||0xc8;return function(_0x2e2154){if(_0x2e2154){return _0x23ee07[_0x81ef('0x1c')](_0x546986)['json'](_0x2e2154);}};}function respondWithFilteredResult(_0x1ac6be,_0x3159a4){return function(_0x50b235){if(_0x50b235){var _0x37151f=typeof _0x3159a4['offset']===_0x81ef('0x1e')&&typeof _0x3159a4[_0x81ef('0x1f')]===_0x81ef('0x1e');var _0x219cbe=_0x50b235[_0x81ef('0x20')];var _0x3477d0=_0x37151f?0x0:_0x3159a4[_0x81ef('0x21')];var _0x3f160e=_0x37151f?_0x50b235[_0x81ef('0x20')]:_0x3159a4[_0x81ef('0x21')]+_0x3159a4[_0x81ef('0x1f')];var _0x1b973f;if(_0x3f160e>=_0x219cbe){_0x3f160e=_0x219cbe;_0x1b973f=0xc8;}else{_0x1b973f=0xce;}_0x1ac6be[_0x81ef('0x1c')](_0x1b973f);return _0x1ac6be[_0x81ef('0x22')](_0x81ef('0x23'),_0x3477d0+'-'+_0x3f160e+'/'+_0x219cbe)[_0x81ef('0x24')](_0x50b235);}return null;};}function patchUpdates(_0x36f1b6){return function(_0x556e05){try{jsonpatch['apply'](_0x556e05,_0x36f1b6,!![]);}catch(_0x81bd57){return BPromise[_0x81ef('0x25')](_0x81bd57);}return _0x556e05[_0x81ef('0x26')]();};}function saveUpdates(_0x6d4179,_0x4f054b){return function(_0x24df13){if(_0x24df13){return _0x24df13[_0x81ef('0x27')](_0x6d4179)[_0x81ef('0x28')](function(_0x5a3b77){return _0x5a3b77;});}return null;};}function removeEntity(_0x29048e,_0x2cba8c){return function(_0x3f45f8){if(_0x3f45f8){return _0x3f45f8[_0x81ef('0x29')]()[_0x81ef('0x28')](function(){_0x29048e[_0x81ef('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e9d7,_0x270c90){return function(_0x28da3f){if(!_0x28da3f){_0x19e9d7[_0x81ef('0x1b')](0x194);}return _0x28da3f;};}function handleError(_0x3d2816,_0x37c5f3){_0x37c5f3=_0x37c5f3||0x1f4;return function(_0x2bac45){logger[_0x81ef('0x2a')](_0x2bac45[_0x81ef('0x2b')]);if(_0x2bac45[_0x81ef('0x2c')]){delete _0x2bac45[_0x81ef('0x2c')];}_0x3d2816[_0x81ef('0x1c')](_0x37c5f3)[_0x81ef('0x2d')](_0x2bac45);};}exports[_0x81ef('0x2e')]=function(_0x416032,_0x1f16c0){var _0x10c401={},_0x5bae97={},_0x588876={'count':0x0,'rows':[]};var _0x4b25a9=_[_0x81ef('0x2f')](db['VoiceDialReport']['rawAttributes'],function(_0x52f618){return{'name':_0x52f618[_0x81ef('0x30')],'type':_0x52f618[_0x81ef('0x31')]['key']};});_0x5bae97[_0x81ef('0x32')]=_['map'](_0x4b25a9,'name');_0x5bae97[_0x81ef('0x33')]=_[_0x81ef('0x34')](_0x416032[_0x81ef('0x33')]);_0x5bae97['filters']=_['intersection'](_0x5bae97[_0x81ef('0x32')],_0x5bae97['query']);_0x10c401[_0x81ef('0x35')]=_[_0x81ef('0x36')](_0x5bae97[_0x81ef('0x32')],qs['fields'](_0x416032['query'][_0x81ef('0x37')]));_0x10c401[_0x81ef('0x35')]=_0x10c401[_0x81ef('0x35')][_0x81ef('0x38')]?_0x10c401[_0x81ef('0x35')]:_0x5bae97[_0x81ef('0x32')];if(!_0x416032[_0x81ef('0x33')][_0x81ef('0x39')](_0x81ef('0x3a'))){_0x10c401[_0x81ef('0x1f')]=qs[_0x81ef('0x1f')](_0x416032[_0x81ef('0x33')][_0x81ef('0x1f')]);_0x10c401[_0x81ef('0x21')]=qs[_0x81ef('0x21')](_0x416032[_0x81ef('0x33')]['offset']);}_0x10c401[_0x81ef('0x3b')]=qs['sort'](_0x416032['query'][_0x81ef('0x3c')]);_0x10c401[_0x81ef('0x3d')]=qs[_0x81ef('0x3e')](_[_0x81ef('0x3f')](_0x416032[_0x81ef('0x33')],_0x5bae97[_0x81ef('0x3e')]),_0x4b25a9);if(_0x416032[_0x81ef('0x33')][_0x81ef('0x40')]){_0x10c401[_0x81ef('0x3d')]=_[_0x81ef('0x41')](_0x10c401[_0x81ef('0x3d')],{'$or':_[_0x81ef('0x2f')](_0x4b25a9,function(_0x14ed37){if(_0x14ed37[_0x81ef('0x31')]!==_0x81ef('0x42')){var _0x5371d8={};_0x5371d8[_0x14ed37['name']]={'$like':'%'+_0x416032[_0x81ef('0x33')]['filter']+'%'};return _0x5371d8;}})});}_0x10c401=_[_0x81ef('0x41')]({},_0x10c401,_0x416032['options']);var _0x69748e={'where':_0x10c401[_0x81ef('0x3d')]};return db[_0x81ef('0x43')][_0x81ef('0x20')](_0x69748e)[_0x81ef('0x28')](function(_0x31be55){_0x588876[_0x81ef('0x20')]=_0x31be55;if(_0x416032[_0x81ef('0x33')][_0x81ef('0x44')]){_0x10c401[_0x81ef('0x45')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x81ef('0x46')](_0x10c401);})['then'](function(_0xe49a55){_0x588876[_0x81ef('0x47')]=_0xe49a55;return _0x588876;})[_0x81ef('0x28')](respondWithFilteredResult(_0x1f16c0,_0x10c401))[_0x81ef('0x48')](handleError(_0x1f16c0,null));};exports[_0x81ef('0x49')]=function(_0xf54a8a,_0x5bdcba){var _0x42f95d={'raw':!![],'where':{'id':_0xf54a8a[_0x81ef('0x4a')]['id']}},_0x2f743b={};_0x2f743b[_0x81ef('0x32')]=_[_0x81ef('0x34')](db[_0x81ef('0x43')][_0x81ef('0x4b')]);_0x2f743b[_0x81ef('0x33')]=_[_0x81ef('0x34')](_0xf54a8a[_0x81ef('0x33')]);_0x2f743b[_0x81ef('0x3e')]=_[_0x81ef('0x36')](_0x2f743b[_0x81ef('0x32')],_0x2f743b[_0x81ef('0x33')]);_0x42f95d[_0x81ef('0x35')]=_['intersection'](_0x2f743b[_0x81ef('0x32')],qs[_0x81ef('0x37')](_0xf54a8a[_0x81ef('0x33')][_0x81ef('0x37')]));_0x42f95d['attributes']=_0x42f95d[_0x81ef('0x35')][_0x81ef('0x38')]?_0x42f95d['attributes']:_0x2f743b[_0x81ef('0x32')];if(_0xf54a8a['query'][_0x81ef('0x44')]){_0x42f95d[_0x81ef('0x45')]=[{'all':!![]}];}_0x42f95d=_[_0x81ef('0x41')]({},_0x42f95d,_0xf54a8a[_0x81ef('0x4c')]);return db[_0x81ef('0x43')]['find'](_0x42f95d)[_0x81ef('0x28')](handleEntityNotFound(_0x5bdcba,null))[_0x81ef('0x28')](respondWithResult(_0x5bdcba,null))[_0x81ef('0x48')](handleError(_0x5bdcba,null));};exports[_0x81ef('0x4d')]=function(_0x2729fd,_0x2b5229){return db[_0x81ef('0x43')][_0x81ef('0x4d')](_0x2729fd['body'],{})[_0x81ef('0x28')](respondWithResult(_0x2b5229,0xc9))[_0x81ef('0x48')](handleError(_0x2b5229,null));};exports['update']=function(_0x2d27f6,_0x2d1b98){if(_0x2d27f6[_0x81ef('0x4e')]['id']){delete _0x2d27f6['body']['id'];}return db[_0x81ef('0x43')][_0x81ef('0x4f')]({'where':{'id':_0x2d27f6[_0x81ef('0x4a')]['id']}})[_0x81ef('0x28')](handleEntityNotFound(_0x2d1b98,null))[_0x81ef('0x28')](saveUpdates(_0x2d27f6['body'],null))[_0x81ef('0x28')](respondWithResult(_0x2d1b98,null))[_0x81ef('0x48')](handleError(_0x2d1b98,null));};exports[_0x81ef('0x29')]=function(_0x199b97,_0x51a6c6){return db[_0x81ef('0x43')]['find']({'where':{'id':_0x199b97[_0x81ef('0x4a')]['id']}})[_0x81ef('0x28')](handleEntityNotFound(_0x51a6c6,null))[_0x81ef('0x28')](removeEntity(_0x51a6c6,null))[_0x81ef('0x48')](handleError(_0x51a6c6,null));};exports[_0x81ef('0x50')]=function(_0x26e039,_0x9544f){return db['VoiceDialReport'][_0x81ef('0x50')]()[_0x81ef('0x28')](respondWithResult(_0x9544f,null))[_0x81ef('0x48')](handleError(_0x9544f,null));}; \ No newline at end of file +var _0xd47a=['VoiceDialReport','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0xd47a,0xb7));var _0xad47=function(_0x41ba41,_0x145412){_0x41ba41=_0x41ba41-0x0;var _0x22d385=_0xd47a[_0x41ba41];return _0x22d385;};'use strict';var emlformat=require(_0xad47('0x0'));var rimraf=require(_0xad47('0x1'));var zipdir=require(_0xad47('0x2'));var jsonpatch=require(_0xad47('0x3'));var rp=require(_0xad47('0x4'));var moment=require(_0xad47('0x5'));var BPromise=require(_0xad47('0x6'));var Mustache=require('mustache');var util=require(_0xad47('0x7'));var path=require(_0xad47('0x8'));var sox=require('sox');var csv=require(_0xad47('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad47('0xa'));var _=require(_0xad47('0xb'));var squel=require('squel');var crypto=require(_0xad47('0xc'));var jsforce=require(_0xad47('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xad47('0x9'));var querystring=require(_0xad47('0xe'));var Papa=require(_0xad47('0xf'));var Redis=require('ioredis');var authService=require(_0xad47('0x10'));var qs=require(_0xad47('0x11'));var as=require(_0xad47('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xad47('0x13'))('api');var utils=require(_0xad47('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad47('0x15'))['db'];function respondWithStatusCode(_0x25d1dc,_0x557a9b){_0x557a9b=_0x557a9b||0xcc;return function(_0x49423d){if(_0x49423d){return _0x25d1dc[_0xad47('0x16')](_0x557a9b);}return _0x25d1dc[_0xad47('0x17')](_0x557a9b)[_0xad47('0x18')]();};}function respondWithResult(_0x5ba273,_0x339264){_0x339264=_0x339264||0xc8;return function(_0x29b70b){if(_0x29b70b){return _0x5ba273[_0xad47('0x17')](_0x339264)[_0xad47('0x19')](_0x29b70b);}};}function respondWithFilteredResult(_0x388d04,_0x1686ef){return function(_0x534a15){if(_0x534a15){var _0x4375d7=typeof _0x1686ef[_0xad47('0x1a')]===_0xad47('0x1b')&&typeof _0x1686ef['limit']===_0xad47('0x1b');var _0x21958c=_0x534a15[_0xad47('0x1c')];var _0x4232c4=_0x4375d7?0x0:_0x1686ef[_0xad47('0x1a')];var _0x490716=_0x4375d7?_0x534a15['count']:_0x1686ef[_0xad47('0x1a')]+_0x1686ef[_0xad47('0x1d')];var _0x2a965b;if(_0x490716>=_0x21958c){_0x490716=_0x21958c;_0x2a965b=0xc8;}else{_0x2a965b=0xce;}_0x388d04[_0xad47('0x17')](_0x2a965b);return _0x388d04[_0xad47('0x1e')](_0xad47('0x1f'),_0x4232c4+'-'+_0x490716+'/'+_0x21958c)[_0xad47('0x19')](_0x534a15);}return null;};}function patchUpdates(_0xa452b5){return function(_0x5e075d){try{jsonpatch[_0xad47('0x20')](_0x5e075d,_0xa452b5,!![]);}catch(_0x40ec9d){return BPromise[_0xad47('0x21')](_0x40ec9d);}return _0x5e075d[_0xad47('0x22')]();};}function saveUpdates(_0x444010,_0x3b3849){return function(_0x1b8397){if(_0x1b8397){return _0x1b8397['update'](_0x444010)[_0xad47('0x23')](function(_0x3d672b){return _0x3d672b;});}return null;};}function removeEntity(_0xe8c098,_0x105911){return function(_0xbfcfaa){if(_0xbfcfaa){return _0xbfcfaa['destroy']()[_0xad47('0x23')](function(){_0xe8c098[_0xad47('0x17')](0xcc)[_0xad47('0x18')]();});}};}function handleEntityNotFound(_0x2bbad7,_0x4a2d38){return function(_0x51f0ad){if(!_0x51f0ad){_0x2bbad7['sendStatus'](0x194);}return _0x51f0ad;};}function handleError(_0x120e78,_0x20252f){_0x20252f=_0x20252f||0x1f4;return function(_0x6b0443){logger[_0xad47('0x24')](_0x6b0443[_0xad47('0x25')]);if(_0x6b0443[_0xad47('0x26')]){delete _0x6b0443[_0xad47('0x26')];}_0x120e78[_0xad47('0x17')](_0x20252f)[_0xad47('0x27')](_0x6b0443);};}exports[_0xad47('0x28')]=function(_0x1c854c,_0x3b7096){var _0x3ab08c={},_0x4e4ef0={},_0x5da4cc={'count':0x0,'rows':[]};var _0x30611e=_[_0xad47('0x29')](db[_0xad47('0x2a')]['rawAttributes'],function(_0x21156f){return{'name':_0x21156f[_0xad47('0x2b')],'type':_0x21156f['type'][_0xad47('0x2c')]};});_0x4e4ef0[_0xad47('0x2d')]=_[_0xad47('0x29')](_0x30611e,'name');_0x4e4ef0[_0xad47('0x2e')]=_[_0xad47('0x2f')](_0x1c854c[_0xad47('0x2e')]);_0x4e4ef0['filters']=_[_0xad47('0x30')](_0x4e4ef0[_0xad47('0x2d')],_0x4e4ef0['query']);_0x3ab08c['attributes']=_['intersection'](_0x4e4ef0['model'],qs[_0xad47('0x31')](_0x1c854c[_0xad47('0x2e')][_0xad47('0x31')]));_0x3ab08c['attributes']=_0x3ab08c['attributes']['length']?_0x3ab08c[_0xad47('0x32')]:_0x4e4ef0['model'];if(!_0x1c854c[_0xad47('0x2e')]['hasOwnProperty'](_0xad47('0x33'))){_0x3ab08c[_0xad47('0x1d')]=qs['limit'](_0x1c854c[_0xad47('0x2e')]['limit']);_0x3ab08c['offset']=qs['offset'](_0x1c854c[_0xad47('0x2e')][_0xad47('0x1a')]);}_0x3ab08c[_0xad47('0x34')]=qs['sort'](_0x1c854c[_0xad47('0x2e')][_0xad47('0x35')]);_0x3ab08c[_0xad47('0x36')]=qs[_0xad47('0x37')](_['pick'](_0x1c854c[_0xad47('0x2e')],_0x4e4ef0[_0xad47('0x37')]),_0x30611e);if(_0x1c854c[_0xad47('0x2e')][_0xad47('0x38')]){_0x3ab08c['where']=_[_0xad47('0x39')](_0x3ab08c[_0xad47('0x36')],{'$or':_[_0xad47('0x29')](_0x30611e,function(_0x3dfa85){if(_0x3dfa85['type']!==_0xad47('0x3a')){var _0x29ba6e={};_0x29ba6e[_0x3dfa85[_0xad47('0x26')]]={'$like':'%'+_0x1c854c[_0xad47('0x2e')][_0xad47('0x38')]+'%'};return _0x29ba6e;}})});}_0x3ab08c=_[_0xad47('0x39')]({},_0x3ab08c,_0x1c854c[_0xad47('0x3b')]);var _0x58fd0e={'where':_0x3ab08c[_0xad47('0x36')]};return db[_0xad47('0x2a')]['count'](_0x58fd0e)[_0xad47('0x23')](function(_0x5e9a39){_0x5da4cc[_0xad47('0x1c')]=_0x5e9a39;if(_0x1c854c[_0xad47('0x2e')][_0xad47('0x3c')]){_0x3ab08c[_0xad47('0x3d')]=[{'all':!![]}];}return db[_0xad47('0x2a')][_0xad47('0x3e')](_0x3ab08c);})[_0xad47('0x23')](function(_0x685d8f){_0x5da4cc[_0xad47('0x3f')]=_0x685d8f;return _0x5da4cc;})[_0xad47('0x23')](respondWithFilteredResult(_0x3b7096,_0x3ab08c))[_0xad47('0x40')](handleError(_0x3b7096,null));};exports[_0xad47('0x41')]=function(_0x42279d,_0x4d73b3){var _0x4ceb78={'raw':!![],'where':{'id':_0x42279d[_0xad47('0x42')]['id']}},_0x16aab0={};_0x16aab0[_0xad47('0x2d')]=_['keys'](db['VoiceDialReport'][_0xad47('0x43')]);_0x16aab0['query']=_[_0xad47('0x2f')](_0x42279d[_0xad47('0x2e')]);_0x16aab0[_0xad47('0x37')]=_[_0xad47('0x30')](_0x16aab0[_0xad47('0x2d')],_0x16aab0[_0xad47('0x2e')]);_0x4ceb78[_0xad47('0x32')]=_['intersection'](_0x16aab0[_0xad47('0x2d')],qs[_0xad47('0x31')](_0x42279d[_0xad47('0x2e')][_0xad47('0x31')]));_0x4ceb78[_0xad47('0x32')]=_0x4ceb78[_0xad47('0x32')][_0xad47('0x44')]?_0x4ceb78[_0xad47('0x32')]:_0x16aab0[_0xad47('0x2d')];if(_0x42279d['query'][_0xad47('0x3c')]){_0x4ceb78['include']=[{'all':!![]}];}_0x4ceb78=_[_0xad47('0x39')]({},_0x4ceb78,_0x42279d[_0xad47('0x3b')]);return db[_0xad47('0x2a')][_0xad47('0x45')](_0x4ceb78)[_0xad47('0x23')](handleEntityNotFound(_0x4d73b3,null))[_0xad47('0x23')](respondWithResult(_0x4d73b3,null))[_0xad47('0x40')](handleError(_0x4d73b3,null));};exports[_0xad47('0x46')]=function(_0x221a8a,_0x42e34b){return db[_0xad47('0x2a')][_0xad47('0x46')](_0x221a8a[_0xad47('0x47')],{})['then'](respondWithResult(_0x42e34b,0xc9))[_0xad47('0x40')](handleError(_0x42e34b,null));};exports[_0xad47('0x48')]=function(_0x3b838b,_0x5a8928){if(_0x3b838b['body']['id']){delete _0x3b838b['body']['id'];}return db[_0xad47('0x2a')][_0xad47('0x45')]({'where':{'id':_0x3b838b[_0xad47('0x42')]['id']}})[_0xad47('0x23')](handleEntityNotFound(_0x5a8928,null))[_0xad47('0x23')](saveUpdates(_0x3b838b['body'],null))['then'](respondWithResult(_0x5a8928,null))[_0xad47('0x40')](handleError(_0x5a8928,null));};exports[_0xad47('0x49')]=function(_0x1cf6b0,_0x5ec513){return db[_0xad47('0x2a')][_0xad47('0x45')]({'where':{'id':_0x1cf6b0[_0xad47('0x42')]['id']}})['then'](handleEntityNotFound(_0x5ec513,null))[_0xad47('0x23')](removeEntity(_0x5ec513,null))[_0xad47('0x40')](handleError(_0x5ec513,null));};exports[_0xad47('0x4a')]=function(_0x209bf1,_0x427144){return db['VoiceDialReport']['describe']()[_0xad47('0x23')](respondWithResult(_0x427144,null))[_0xad47('0x40')](handleError(_0x427144,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 5c6e3f9..9f6eab8 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 _0x79b2=['moment','request-promise','rimraf','../../config/environment','define','VoiceDialReport','report_dial','lodash','../../config/logger'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x79b2,0x142));var _0x279b=function(_0x424cc1,_0x102900){_0x424cc1=_0x424cc1-0x0;var _0x3b556b=_0x79b2[_0x424cc1];return _0x3b556b;};'use strict';var _=require(_0x279b('0x0'));var util=require('util');var logger=require(_0x279b('0x1'))('api');var moment=require(_0x279b('0x2'));var BPromise=require('bluebird');var rp=require(_0x279b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x279b('0x4'));var config=require(_0x279b('0x5'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x793c92,_0x253050){return _0x793c92[_0x279b('0x6')](_0x279b('0x7'),attributes,{'tableName':_0x279b('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9e6c=['request-promise','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','lodash','util','api','bluebird'];(function(_0x593941,_0x54b080){var _0x292692=function(_0x9eaf6c){while(--_0x9eaf6c){_0x593941['push'](_0x593941['shift']());}};_0x292692(++_0x54b080);}(_0x9e6c,0x1d5));var _0xc9e6=function(_0xcf9ca6,_0x314884){_0xcf9ca6=_0xcf9ca6-0x0;var _0x13badc=_0x9e6c[_0xcf9ca6];return _0x13badc;};'use strict';var _=require(_0xc9e6('0x0'));var util=require(_0xc9e6('0x1'));var logger=require('../../config/logger')(_0xc9e6('0x2'));var moment=require('moment');var BPromise=require(_0xc9e6('0x3'));var rp=require(_0xc9e6('0x4'));var fs=require('fs');var path=require(_0xc9e6('0x5'));var rimraf=require('rimraf');var config=require(_0xc9e6('0x6'));var attributes=require(_0xc9e6('0x7'));module['exports']=function(_0x415c4e,_0x3d1aa1){return _0x415c4e[_0xc9e6('0x8')](_0xc9e6('0x9'),attributes,{'tableName':_0xc9e6('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 7f2de28..88c12d9 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 _0x71b8=['VoiceDialReport','create','options','debug','UpdateVoiceDialReport','update','body','raw','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','CreateVoiceDialReport'];(function(_0x393909,_0x2e0350){var _0x27d291=function(_0xf11057){while(--_0xf11057){_0x393909['push'](_0x393909['shift']());}};_0x27d291(++_0x2e0350);}(_0x71b8,0x155));var _0x871b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x71b8[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x871b('0x0'));var BPromise=require(_0x871b('0x1'));var rs=require(_0x871b('0x2'));var fs=require('fs');var Redis=require(_0x871b('0x3'));var db=require(_0x871b('0x4'))['db'];var utils=require(_0x871b('0x5'));var logger=require(_0x871b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x871b('0x7'));var client=jayson['client'][_0x871b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57014a,_0x517f9e,_0x451987){return new BPromise(function(_0x1d3632,_0xc77345){return client[_0x871b('0x9')](_0x57014a,_0x451987)[_0x871b('0xa')](function(_0x20ae19){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x517f9e,'request\x20sent');logger['debug'](_0x871b('0xb'),_0x517f9e,'request\x20sent',JSON[_0x871b('0xc')](_0x20ae19));if(_0x20ae19[_0x871b('0xd')]){if(_0x20ae19[_0x871b('0xd')][_0x871b('0xe')]===0x1f4){logger[_0x871b('0xd')](_0x871b('0xf'),_0x517f9e,_0x20ae19[_0x871b('0xd')][_0x871b('0x10')]);return _0xc77345(_0x20ae19[_0x871b('0xd')][_0x871b('0x10')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x517f9e,_0x20ae19[_0x871b('0xd')][_0x871b('0x10')]);return _0x1d3632(_0x20ae19[_0x871b('0xd')][_0x871b('0x10')]);}else{logger[_0x871b('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x517f9e,_0x871b('0x12'));_0x1d3632(_0x20ae19[_0x871b('0x13')]['message']);}})[_0x871b('0x14')](function(_0x165ce8){logger[_0x871b('0xd')](_0x871b('0xf'),_0x517f9e,_0x165ce8);_0xc77345(_0x165ce8);});});}exports[_0x871b('0x15')]=function(_0x12870d){var _0x2f7a2b=this;return new Promise(function(_0x5bd35b,_0x1ddd27){return db[_0x871b('0x16')][_0x871b('0x17')](_0x12870d['body'],{'raw':_0x12870d[_0x871b('0x18')]?_0x12870d['options']['raw']===undefined?!![]:![]:!![]})[_0x871b('0xa')](function(_0x5b1ca2){logger['info'](_0x871b('0x15'),_0x12870d);logger[_0x871b('0x19')](_0x871b('0x15'),_0x12870d,JSON[_0x871b('0xc')](_0x5b1ca2));_0x5bd35b(_0x5b1ca2);})['catch'](function(_0x55205e){logger[_0x871b('0xd')](_0x871b('0x15'),_0x55205e[_0x871b('0x10')],_0x12870d);_0x1ddd27(_0x2f7a2b[_0x871b('0xd')](0x1f4,_0x55205e['message']));});});};exports[_0x871b('0x1a')]=function(_0x27565e){var _0x19ee21=this;return new Promise(function(_0x32bfe4,_0x20d8d5){return db[_0x871b('0x16')][_0x871b('0x1b')](_0x27565e[_0x871b('0x1c')],{'raw':_0x27565e[_0x871b('0x18')]?_0x27565e[_0x871b('0x18')][_0x871b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27565e[_0x871b('0x18')]?_0x27565e['options'][_0x871b('0x1e')]||null:null,'attributes':_0x27565e[_0x871b('0x18')]?_0x27565e[_0x871b('0x18')][_0x871b('0x1f')]||null:null,'limit':_0x27565e['options']?_0x27565e[_0x871b('0x18')][_0x871b('0x20')]||null:null})[_0x871b('0xa')](function(_0x342da0){logger[_0x871b('0x11')]('UpdateVoiceDialReport',_0x27565e);logger['debug']('UpdateVoiceDialReport',_0x27565e,JSON[_0x871b('0xc')](_0x342da0));_0x32bfe4(_0x342da0);})[_0x871b('0x14')](function(_0x3e5f3d){logger['error'](_0x871b('0x1a'),_0x3e5f3d[_0x871b('0x10')],_0x27565e);_0x20d8d5(_0x19ee21[_0x871b('0xd')](0x1f4,_0x3e5f3d[_0x871b('0x10')]));});});}; \ No newline at end of file +var _0xd8e7=['CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','where','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','VoiceDialReport','create','body','options'];(function(_0x510393,_0x44f011){var _0x562049=function(_0xdf76f7){while(--_0xdf76f7){_0x510393['push'](_0x510393['shift']());}};_0x562049(++_0x44f011);}(_0xd8e7,0x1e2));var _0x7d8e=function(_0x4dc4f1,_0x270f95){_0x4dc4f1=_0x4dc4f1-0x0;var _0x5b2716=_0xd8e7[_0x4dc4f1];return _0x5b2716;};'use strict';var _=require('lodash');var util=require(_0x7d8e('0x0'));var moment=require(_0x7d8e('0x1'));var BPromise=require(_0x7d8e('0x2'));var rs=require(_0x7d8e('0x3'));var fs=require('fs');var Redis=require(_0x7d8e('0x4'));var db=require(_0x7d8e('0x5'))['db'];var utils=require(_0x7d8e('0x6'));var logger=require(_0x7d8e('0x7'))(_0x7d8e('0x8'));var config=require('../../config/environment');var jayson=require(_0x7d8e('0x9'));var client=jayson[_0x7d8e('0xa')][_0x7d8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x476bbc,_0x120762,_0x47971d){return new BPromise(function(_0xec3e56,_0x5aaa70){return client[_0x7d8e('0xc')](_0x476bbc,_0x47971d)[_0x7d8e('0xd')](function(_0x38f79a){logger['info'](_0x7d8e('0xe'),_0x120762,'request\x20sent');logger['debug'](_0x7d8e('0xf'),_0x120762,_0x7d8e('0x10'),JSON[_0x7d8e('0x11')](_0x38f79a));if(_0x38f79a[_0x7d8e('0x12')]){if(_0x38f79a[_0x7d8e('0x12')][_0x7d8e('0x13')]===0x1f4){logger[_0x7d8e('0x12')](_0x7d8e('0xe'),_0x120762,_0x38f79a[_0x7d8e('0x12')][_0x7d8e('0x14')]);return _0x5aaa70(_0x38f79a[_0x7d8e('0x12')][_0x7d8e('0x14')]);}logger[_0x7d8e('0x12')](_0x7d8e('0xe'),_0x120762,_0x38f79a[_0x7d8e('0x12')][_0x7d8e('0x14')]);return _0xec3e56(_0x38f79a[_0x7d8e('0x12')]['message']);}else{logger[_0x7d8e('0x15')](_0x7d8e('0xe'),_0x120762,_0x7d8e('0x10'));_0xec3e56(_0x38f79a[_0x7d8e('0x16')][_0x7d8e('0x14')]);}})[_0x7d8e('0x17')](function(_0x463cde){logger[_0x7d8e('0x12')](_0x7d8e('0xe'),_0x120762,_0x463cde);_0x5aaa70(_0x463cde);});});}exports['CreateVoiceDialReport']=function(_0x11af21){var _0x455a3c=this;return new Promise(function(_0x222793,_0x4b9e10){return db[_0x7d8e('0x18')][_0x7d8e('0x19')](_0x11af21[_0x7d8e('0x1a')],{'raw':_0x11af21[_0x7d8e('0x1b')]?_0x11af21[_0x7d8e('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x7d8e('0xd')](function(_0x542312){logger[_0x7d8e('0x15')](_0x7d8e('0x1c'),_0x11af21);logger[_0x7d8e('0x1d')]('CreateVoiceDialReport',_0x11af21,JSON[_0x7d8e('0x11')](_0x542312));_0x222793(_0x542312);})['catch'](function(_0x39512d){logger['error'](_0x7d8e('0x1c'),_0x39512d[_0x7d8e('0x14')],_0x11af21);_0x4b9e10(_0x455a3c[_0x7d8e('0x12')](0x1f4,_0x39512d[_0x7d8e('0x14')]));});});};exports[_0x7d8e('0x1e')]=function(_0x52473a){var _0x2b389e=this;return new Promise(function(_0x2655f3,_0x4cb174){return db[_0x7d8e('0x18')][_0x7d8e('0x1f')](_0x52473a[_0x7d8e('0x1a')],{'raw':_0x52473a[_0x7d8e('0x1b')]?_0x52473a[_0x7d8e('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52473a[_0x7d8e('0x1b')]?_0x52473a[_0x7d8e('0x1b')][_0x7d8e('0x20')]||null:null,'attributes':_0x52473a[_0x7d8e('0x1b')]?_0x52473a[_0x7d8e('0x1b')][_0x7d8e('0x21')]||null:null,'limit':_0x52473a['options']?_0x52473a[_0x7d8e('0x1b')]['limit']||null:null})['then'](function(_0x3cc9ed){logger[_0x7d8e('0x15')](_0x7d8e('0x1e'),_0x52473a);logger[_0x7d8e('0x1d')](_0x7d8e('0x1e'),_0x52473a,JSON['stringify'](_0x3cc9ed));_0x2655f3(_0x3cc9ed);})[_0x7d8e('0x17')](function(_0x361833){logger[_0x7d8e('0x12')](_0x7d8e('0x1e'),_0x361833[_0x7d8e('0x14')],_0x52473a);_0x4cb174(_0x2b389e[_0x7d8e('0x12')](0x1f4,_0x361833[_0x7d8e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index c6f0331..c548d2e 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 _0x9354=['../../components/auth/service','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','/:id','create','post','addApplications','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b1f6c,_0x5947d6){var _0x26ab32=function(_0x4e64c5){while(--_0x4e64c5){_0x1b1f6c['push'](_0x1b1f6c['shift']());}};_0x26ab32(++_0x5947d6);}(_0x9354,0x150));var _0x4935=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0x9354[_0x1af0e5];return _0x3c444a;};'use strict';var multer=require(_0x4935('0x0'));var util=require('util');var path=require(_0x4935('0x1'));var timeout=require(_0x4935('0x2'));var express=require(_0x4935('0x3'));var router=express[_0x4935('0x4')]();var fs_extra=require(_0x4935('0x5'));var auth=require(_0x4935('0x6'));var interaction=require(_0x4935('0x7'));var config=require('../../config/environment');var controller=require(_0x4935('0x8'));router['get']('/',auth[_0x4935('0x9')](),controller[_0x4935('0xa')]);router['get'](_0x4935('0xb'),auth[_0x4935('0x9')](),controller['show']);router['post']('/',auth[_0x4935('0x9')](),controller[_0x4935('0xc')]);router[_0x4935('0xd')]('/:id/applications',auth['isAuthenticated'](),controller[_0x4935('0xe')]);router[_0x4935('0xf')](_0x4935('0xb'),auth['isAuthenticated'](),controller[_0x4935('0x10')]);router['delete'](_0x4935('0xb'),auth[_0x4935('0x9')](),controller[_0x4935('0x11')]);module[_0x4935('0x12')]=router; \ No newline at end of file +var _0xd72c=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications'];(function(_0x366d17,_0x141534){var _0x5346c6=function(_0x1003aa){while(--_0x1003aa){_0x366d17['push'](_0x366d17['shift']());}};_0x5346c6(++_0x141534);}(_0xd72c,0x175));var _0xcd72=function(_0x46d495,_0x1f70b9){_0x46d495=_0x46d495-0x0;var _0x32eb70=_0xd72c[_0x46d495];return _0x32eb70;};'use strict';var multer=require(_0xcd72('0x0'));var util=require('util');var path=require(_0xcd72('0x1'));var timeout=require(_0xcd72('0x2'));var express=require(_0xcd72('0x3'));var router=express[_0xcd72('0x4')]();var fs_extra=require(_0xcd72('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd72('0x6'));var config=require(_0xcd72('0x7'));var controller=require(_0xcd72('0x8'));router[_0xcd72('0x9')]('/',auth[_0xcd72('0xa')](),controller[_0xcd72('0xb')]);router[_0xcd72('0x9')](_0xcd72('0xc'),auth[_0xcd72('0xa')](),controller[_0xcd72('0xd')]);router[_0xcd72('0xe')]('/',auth[_0xcd72('0xa')](),controller[_0xcd72('0xf')]);router[_0xcd72('0xe')](_0xcd72('0x10'),auth['isAuthenticated'](),controller[_0xcd72('0x11')]);router[_0xcd72('0x12')]('/:id',auth[_0xcd72('0xa')](),controller[_0xcd72('0x13')]);router[_0xcd72('0x14')](_0xcd72('0xc'),auth[_0xcd72('0xa')](),controller[_0xcd72('0x15')]);module[_0xcd72('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 136971d..82d7e7f 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 _0xb23c=['outbound-fax','system','any','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax'];(function(_0x5c0a20,_0x302e16){var _0x3b7f28=function(_0x3506a7){while(--_0x3506a7){_0x5c0a20['push'](_0x5c0a20['shift']());}};_0x3b7f28(++_0x302e16);}(_0xb23c,0x74));var _0xcb23=function(_0x16effc,_0x1c1714){_0x16effc=_0x16effc-0x0;var _0x33e841=_0xb23c[_0x16effc];return _0x33e841;};'use strict';var Sequelize=require(_0xcb23('0x0'));module[_0xcb23('0x1')]={'context':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'unique':_0xcb23('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'unique':_0xcb23('0x3')},'priority':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xcb23('0x3')},'tag':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'defaultValue':_0xcb23('0x4')},'appdata':{'type':Sequelize[_0xcb23('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xcb23('0x5')](_0xcb23('0x6'),_0xcb23('0x7'),_0xcb23('0x8'),_0xcb23('0x9'),_0xcb23('0xa'),_0xcb23('0xb'),_0xcb23('0xc')),'allowNull':![]},'description':{'type':Sequelize[_0xcb23('0x2')]},'interval':{'type':Sequelize[_0xcb23('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xcb23('0xd')]},'isApp':{'type':Sequelize[_0xcb23('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xcb23('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xcb23('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xcb23('0x2')],'defaultValue':_0xcb23('0xf')},'answer':{'type':Sequelize[_0xcb23('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xd79db9){return this[_0xcb23('0x10')](_0xcb23('0x11'));}},'alias':{'type':Sequelize[_0xcb23('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xa85c=['wav','BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','system','*,*,*,*','INTEGER'];(function(_0x1982b5,_0x30901b){var _0x140a99=function(_0x42f6e2){while(--_0x42f6e2){_0x1982b5['push'](_0x1982b5['shift']());}};_0x140a99(++_0x30901b);}(_0xa85c,0x1e3));var _0xca85=function(_0x4756a1,_0x3f8d1){_0x4756a1=_0x4756a1-0x0;var _0x177c4f=_0xa85c[_0x4756a1];return _0x177c4f;};'use strict';var Sequelize=require(_0xca85('0x0'));module[_0xca85('0x1')]={'context':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'unique':_0xca85('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'unique':_0xca85('0x3')},'priority':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xca85('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'defaultValue':_0xca85('0x4')},'appdata':{'type':Sequelize[_0xca85('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xca85('0x5')](_0xca85('0x6'),'outbound',_0xca85('0x7'),_0xca85('0x8'),'outbound-fax',_0xca85('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xca85('0x2')]},'interval':{'type':Sequelize[_0xca85('0x2')],'allowNull':![],'defaultValue':_0xca85('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xca85('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xca85('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xca85('0xb')]},'recordingFormat':{'type':Sequelize[_0xca85('0x2')],'defaultValue':_0xca85('0xc')},'answer':{'type':Sequelize[_0xca85('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x983c64){return this['getDataValue'](_0xca85('0xe'));}},'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 2e92d86..fb6c788 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 _0x24a2=['VoiceExtension','include','rows','catch','show','params','keys','rawAttributes','length','includeAll','options','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OutboundRoutes','internal','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','get','InboundRoutes','outbound','InternalRoutes','ignore','value','type','find','name','stack','send','index','map','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0x24a2,0x13e));var _0x224a=function(_0x49a1c4,_0x1b81f0){_0x49a1c4=_0x49a1c4-0x0;var _0x29bdf6=_0x24a2[_0x49a1c4];return _0x29bdf6;};'use strict';var _=require('lodash');var Redis=require(_0x224a('0x0'));var qs=require(_0x224a('0x1'));var logger=require(_0x224a('0x2'))(_0x224a('0x3'));var config=require('../../config/environment');var db=require(_0x224a('0x4'))['db'];config['redis']=_[_0x224a('0x5')](config[_0x224a('0x6')],{'host':_0x224a('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x224a('0x6')]));require('./voiceExtension.socket')[_0x224a('0x8')](socket);function respondWithStatusCode(_0x54392e,_0x240a0a){_0x240a0a=_0x240a0a||0xcc;return function(_0x49fd05){if(_0x49fd05){return _0x54392e[_0x224a('0x9')](_0x240a0a);}return _0x54392e[_0x224a('0xa')](_0x240a0a)['end']();};}function respondWithResult(_0x349fa0,_0x3695c1){_0x3695c1=_0x3695c1||0xc8;return function(_0xc3cb08){if(_0xc3cb08){return _0x349fa0[_0x224a('0xa')](_0x3695c1)[_0x224a('0xb')](_0xc3cb08);}};}function respondWithFilteredResult(_0x1b0be5,_0x266226){return function(_0x2fd8cc){if(_0x2fd8cc){var _0x14b5a0=typeof _0x266226[_0x224a('0xc')]==='undefined'&&typeof _0x266226['limit']===_0x224a('0xd');var _0x2c6fa7=_0x2fd8cc[_0x224a('0xe')];var _0xedca76=_0x14b5a0?0x0:_0x266226[_0x224a('0xc')];var _0x3bbb95=_0x14b5a0?_0x2fd8cc[_0x224a('0xe')]:_0x266226['offset']+_0x266226[_0x224a('0xf')];var _0x3f9c5c;if(_0x3bbb95>=_0x2c6fa7){_0x3bbb95=_0x2c6fa7;_0x3f9c5c=0xc8;}else{_0x3f9c5c=0xce;}_0x1b0be5[_0x224a('0xa')](_0x3f9c5c);return _0x1b0be5[_0x224a('0x10')](_0x224a('0x11'),_0xedca76+'-'+_0x3bbb95+'/'+_0x2c6fa7)[_0x224a('0xb')](_0x2fd8cc);}return null;};}function removeEntity(_0x336141){return function(_0x43e564){if(_0x43e564){return _0x43e564[_0x224a('0x12')]()[_0x224a('0x13')](function(){var _0x424eb5=_0x43e564[_0x224a('0x14')]({'plain':!![]});var _0xd41944=[{'name':_0x224a('0x15'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x224a('0x16'),'ignore':![]},{'name':_0x224a('0x17'),'value':'internal','ignore':![]}];var _0xc4957e=_(_0xd41944)['filter'](_0x224a('0x18'))['map'](_0x224a('0x19'))[_0x224a('0x19')]();if(_['includes'](_0xc4957e,_0x424eb5[_0x224a('0x1a')])){return;}var _0x928366=_[_0x224a('0x1b')](_0xd41944,[_0x224a('0x19'),_0x424eb5[_0x224a('0x1a')]])[_0x224a('0x1c')];return db['UserProfileResource'][_0x224a('0x12')]({'where':{'type':_0x928366,'resourceId':_0x424eb5['id']}})[_0x224a('0x13')](function(){return _0x43e564;});})['then'](function(){_0x336141[_0x224a('0xa')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b0efb){return function(_0x32800d){if(!_0x32800d){_0x4b0efb[_0x224a('0x9')](0x194);}return _0x32800d;};}function handleError(_0x4c91fa,_0x1d857d){_0x1d857d=_0x1d857d||0x1f4;return function(_0x506d39){logger['error'](_0x506d39[_0x224a('0x1d')]);if(_0x506d39[_0x224a('0x1c')]){delete _0x506d39[_0x224a('0x1c')];}_0x4c91fa['status'](_0x1d857d)[_0x224a('0x1e')](_0x506d39);};}exports[_0x224a('0x1f')]=function(_0x360763,_0x594a67){var _0xf5cead={},_0xf84901={},_0xbaa8fa={'count':0x0,'rows':[]};var _0x2ea568=_[_0x224a('0x20')](db['VoiceExtension']['rawAttributes'],function(_0x472c48){return{'name':_0x472c48['fieldName'],'type':_0x472c48[_0x224a('0x1a')]['key']};});_0xf84901[_0x224a('0x21')]=_['map'](_0x2ea568,'name');_0xf84901[_0x224a('0x22')]=_['keys'](_0x360763[_0x224a('0x22')]);_0xf84901[_0x224a('0x23')]=_['intersection'](_0xf84901[_0x224a('0x21')],_0xf84901[_0x224a('0x22')]);_0xf5cead['attributes']=_[_0x224a('0x24')](_0xf84901['model'],qs[_0x224a('0x25')](_0x360763['query'][_0x224a('0x25')]));_0xf5cead[_0x224a('0x26')]=_0xf5cead[_0x224a('0x26')]['length']?_0xf5cead[_0x224a('0x26')]:_0xf84901['model'];if(!_0x360763[_0x224a('0x22')][_0x224a('0x27')](_0x224a('0x28'))){_0xf5cead['limit']=qs[_0x224a('0xf')](_0x360763[_0x224a('0x22')][_0x224a('0xf')]);_0xf5cead[_0x224a('0xc')]=qs[_0x224a('0xc')](_0x360763[_0x224a('0x22')]['offset']);}_0xf5cead[_0x224a('0x29')]=qs[_0x224a('0x2a')](_0x360763[_0x224a('0x22')][_0x224a('0x2a')]);_0xf5cead[_0x224a('0x2b')]=qs[_0x224a('0x23')](_['pick'](_0x360763['query'],_0xf84901['filters']),_0x2ea568);if(_0x360763[_0x224a('0x22')][_0x224a('0x2c')]){_0xf5cead['where']=_[_0x224a('0x2d')](_0xf5cead['where'],{'$or':_['map'](_0x2ea568,function(_0x13db02){if(_0x13db02[_0x224a('0x1a')]!=='VIRTUAL'){var _0x55ffe1={};_0x55ffe1[_0x13db02[_0x224a('0x1c')]]={'$like':'%'+_0x360763[_0x224a('0x22')][_0x224a('0x2c')]+'%'};return _0x55ffe1;}})});}_0xf5cead=_[_0x224a('0x2d')]({},_0xf5cead,_0x360763['options']);var _0x5e179d={'where':_0xf5cead[_0x224a('0x2b')]};return db[_0x224a('0x2e')][_0x224a('0xe')](_0x5e179d)[_0x224a('0x13')](function(_0x12dfb7){_0xbaa8fa['count']=_0x12dfb7;if(_0x360763[_0x224a('0x22')]['includeAll']){_0xf5cead[_0x224a('0x2f')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0xf5cead);})['then'](function(_0x587b75){_0xbaa8fa[_0x224a('0x30')]=_0x587b75;return _0xbaa8fa;})['then'](respondWithFilteredResult(_0x594a67,_0xf5cead))[_0x224a('0x31')](handleError(_0x594a67,null));};exports[_0x224a('0x32')]=function(_0x375ec3,_0x362736){var _0x33a8fc={'raw':![],'where':{'id':_0x375ec3[_0x224a('0x33')]['id']}},_0x1c97b2={};_0x1c97b2[_0x224a('0x21')]=_[_0x224a('0x34')](db[_0x224a('0x2e')][_0x224a('0x35')]);_0x1c97b2[_0x224a('0x22')]=_[_0x224a('0x34')](_0x375ec3[_0x224a('0x22')]);_0x1c97b2['filters']=_[_0x224a('0x24')](_0x1c97b2[_0x224a('0x21')],_0x1c97b2[_0x224a('0x22')]);_0x33a8fc[_0x224a('0x26')]=_[_0x224a('0x24')](_0x1c97b2[_0x224a('0x21')],qs[_0x224a('0x25')](_0x375ec3['query']['fields']));_0x33a8fc['attributes']=_0x33a8fc[_0x224a('0x26')][_0x224a('0x36')]?_0x33a8fc[_0x224a('0x26')]:_0x1c97b2[_0x224a('0x21')];if(_0x375ec3[_0x224a('0x22')][_0x224a('0x37')]){_0x33a8fc[_0x224a('0x2f')]=[{'all':!![]}];}_0x33a8fc=_[_0x224a('0x2d')]({},_0x33a8fc,_0x375ec3[_0x224a('0x38')]);return db[_0x224a('0x2e')][_0x224a('0x1b')](_0x33a8fc)['then'](handleEntityNotFound(_0x362736,null))[_0x224a('0x13')](respondWithResult(_0x362736,null))[_0x224a('0x31')](handleError(_0x362736,null));};exports[_0x224a('0x12')]=function(_0x26db4d,_0xd96a05){return db[_0x224a('0x2e')][_0x224a('0x1b')]({'where':{'id':_0x26db4d[_0x224a('0x33')]['id']}})[_0x224a('0x13')](handleEntityNotFound(_0xd96a05,null))[_0x224a('0x13')](removeEntity(_0xd96a05,null))[_0x224a('0x31')](handleError(_0xd96a05,null));};exports[_0x224a('0x39')]=function(_0x395ee3,_0x437566){if(_0x395ee3[_0x224a('0x3a')][_0x224a('0x1a')]===_0x224a('0x16')&&!_[_0x224a('0x3b')](_0x395ee3['body']['exten'],'_')){_0x395ee3['body'][_0x224a('0x3c')]='_'[_0x224a('0x3d')](_0x395ee3[_0x224a('0x3a')][_0x224a('0x3c')]);}return db[_0x224a('0x2e')][_0x224a('0x39')](_0x395ee3[_0x224a('0x3a')],{'raw':![]})[_0x224a('0x13')](function(_0xd71dde){var _0x4a5b15=_0x395ee3['user'][_0x224a('0x14')]({'plain':!![]});if(!_0x4a5b15)throw new Error(_0x224a('0x3e'));if(_0x4a5b15[_0x224a('0x3f')]===_0x224a('0x40')){var _0xc4a280=_0xd71dde[_0x224a('0x14')]({'plain':!![]});var _0x4a9b59=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x224a('0x41'),'value':_0x224a('0x16')},{'name':'InternalRoutes','value':_0x224a('0x42')}];var _0x3d04b4=_[_0x224a('0x1b')](_0x4a9b59,[_0x224a('0x19'),_0xc4a280['type']])[_0x224a('0x1c')];return db[_0x224a('0x43')][_0x224a('0x1b')]({'where':{'name':_0x3d04b4,'userProfileId':_0x4a5b15[_0x224a('0x44')]},'raw':!![]})[_0x224a('0x13')](function(_0x1c23de){if(_0x1c23de&&_0x1c23de['autoAssociation']===0x0){return db[_0x224a('0x45')][_0x224a('0x39')]({'name':_0xc4a280[_0x224a('0x1c')],'resourceId':_0xc4a280['id'],'type':_0x1c23de[_0x224a('0x1c')],'sectionId':_0x1c23de['id']},{})['then'](function(){return _0xd71dde;});}else{return _0xd71dde;}})[_0x224a('0x31')](function(_0xef264){logger[_0x224a('0x46')](_0x224a('0x47'),_0xef264);throw _0xef264;});}return _0xd71dde;})['then'](respondWithResult(_0x437566,0xc9))[_0x224a('0x31')](handleError(_0x437566,null));};exports[_0x224a('0x48')]=function(_0x5518b0,_0x54c140){if(_0x5518b0['body']['id']){delete _0x5518b0['body']['id'];}return db[_0x224a('0x2e')][_0x224a('0x1b')]({'where':{'id':_0x5518b0[_0x224a('0x33')]['id']}})[_0x224a('0x13')](handleEntityNotFound(_0x54c140,null))[_0x224a('0x13')](function(_0x295c10){if(_0x295c10){return db[_0x224a('0x2e')][_0x224a('0x48')](_[_0x224a('0x49')](_0x5518b0['body'],['exten','context','description',_0x224a('0x4a'),_0x224a('0x4b'),_0x224a('0x4c'),_0x224a('0x4d')]),{'where':{'context':_0x295c10[_0x224a('0x4e')],'exten':_0x295c10['exten']},'individualHooks':!![]})[_0x224a('0x13')](function(_0x18de02){return _0x18de02;});}return null;})[_0x224a('0x13')](respondWithStatusCode(_0x54c140,null))[_0x224a('0x31')](handleError(_0x54c140,null));};exports['addApplications']=function(_0x24107d,_0x115d99){var _0x50efaf=_0x24107d[_0x224a('0x33')]['id'];var _0xb2a346=_0x24107d[_0x224a('0x3a')];var _0x314553=0xc8;var _0x438fef=null;return db[_0x224a('0x4f')][_0x224a('0x50')]({'isolationLevel':db[_0x224a('0x4f')][_0x224a('0x51')][_0x224a('0x52')][_0x224a('0x53')]},function(_0x8ecca3){return db['VoiceExtension'][_0x224a('0x54')]({'where':{'id':_0x50efaf},'transaction':_0x8ecca3})[_0x224a('0x13')](function(_0x4c9857){if(_0x4c9857){return db['VoiceExtension'][_0x224a('0x12')]({'where':{'VoiceExtensionId':_0x50efaf},'transaction':_0x8ecca3})[_0x224a('0x13')](function(){var _0x5d84f6=_['map'](_0xb2a346,function(_0x5531c0){_0x5531c0[_0x224a('0x55')]=_0x50efaf;_0x5531c0[_0x224a('0x56')]=!![];return _0x5531c0;});return _0x4c9857[_0x224a('0x57')](_0x5d84f6);})['then'](function(_0x1bdf94){return db[_0x224a('0x2e')]['bulkCreate'](_0x1bdf94,{'transaction':_0x8ecca3});});}else{_0x314553=0x194;_0x438fef=[];}});})[_0x224a('0x13')](function(){if(_0x314553!==0x194){return db[_0x224a('0x2e')][_0x224a('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x50efaf},'order':_0x224a('0x59')})['then'](function(_0x208e0a){_0x438fef=_0x208e0a;});}})[_0x224a('0x31')](function(_0x2bfd5a){_0x314553=0x1f4;logger['error'](_0x2bfd5a['stack']);if(_0x2bfd5a[_0x224a('0x1c')]){delete _0x2bfd5a[_0x224a('0x1c')];}_0x438fef=_0x2bfd5a;})[_0x224a('0x5a')](function(){if(_0x438fef===null){_0x115d99['sendStatus'](_0x314553);}else{if(_0x314553===0x1f4){_0x115d99[_0x224a('0xa')](_0x314553)[_0x224a('0x1e')](_0x438fef);}else{_0x115d99[_0x224a('0xa')](_0x314553)[_0x224a('0xb')](_0x438fef);}}});}; \ No newline at end of file +var _0x9b44=['filter','merge','VIRTUAL','options','includeAll','include','VoiceExtension','findAll','rows','show','params','rawAttributes','catch','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','alias','addApplications','sequelize','transaction','Transaction','findOne','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','end','json','offset','undefined','count','limit','status','set','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','map','value','includes','type','find','name','UserProfileResource','then','sendStatus','error','stack','send','index','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b44,0xe3));var _0x49b4=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x9b44[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x49b4('0x0'));var Redis=require(_0x49b4('0x1'));var qs=require(_0x49b4('0x2'));var logger=require(_0x49b4('0x3'))(_0x49b4('0x4'));var config=require(_0x49b4('0x5'));var db=require(_0x49b4('0x6'))['db'];config[_0x49b4('0x7')]=_['defaults'](config[_0x49b4('0x7')],{'host':_0x49b4('0x8'),'port':0x18eb});var socket=require(_0x49b4('0x9'))(new Redis(config['redis']));require(_0x49b4('0xa'))[_0x49b4('0xb')](socket);function respondWithStatusCode(_0x305b97,_0x3e6c49){_0x3e6c49=_0x3e6c49||0xcc;return function(_0x181c83){if(_0x181c83){return _0x305b97['sendStatus'](_0x3e6c49);}return _0x305b97['status'](_0x3e6c49)[_0x49b4('0xc')]();};}function respondWithResult(_0x355089,_0x4f44a1){_0x4f44a1=_0x4f44a1||0xc8;return function(_0x57fd2d){if(_0x57fd2d){return _0x355089['status'](_0x4f44a1)[_0x49b4('0xd')](_0x57fd2d);}};}function respondWithFilteredResult(_0x45e0fa,_0x2077f3){return function(_0x55821d){if(_0x55821d){var _0x7a7716=typeof _0x2077f3[_0x49b4('0xe')]===_0x49b4('0xf')&&typeof _0x2077f3['limit']===_0x49b4('0xf');var _0x37375d=_0x55821d[_0x49b4('0x10')];var _0x57fb39=_0x7a7716?0x0:_0x2077f3[_0x49b4('0xe')];var _0xb8b327=_0x7a7716?_0x55821d['count']:_0x2077f3['offset']+_0x2077f3[_0x49b4('0x11')];var _0x2bcbb1;if(_0xb8b327>=_0x37375d){_0xb8b327=_0x37375d;_0x2bcbb1=0xc8;}else{_0x2bcbb1=0xce;}_0x45e0fa[_0x49b4('0x12')](_0x2bcbb1);return _0x45e0fa[_0x49b4('0x13')](_0x49b4('0x14'),_0x57fb39+'-'+_0xb8b327+'/'+_0x37375d)['json'](_0x55821d);}return null;};}function removeEntity(_0x17bab5){return function(_0x278c7c){if(_0x278c7c){return _0x278c7c[_0x49b4('0x15')]()['then'](function(){var _0x36ca14=_0x278c7c[_0x49b4('0x16')]({'plain':!![]});var _0x18a767=[{'name':_0x49b4('0x17'),'value':_0x49b4('0x18'),'ignore':![]},{'name':_0x49b4('0x19'),'value':_0x49b4('0x1a'),'ignore':![]},{'name':_0x49b4('0x1b'),'value':_0x49b4('0x1c'),'ignore':![]}];var _0x28ce6e=_(_0x18a767)['filter']('ignore')[_0x49b4('0x1d')](_0x49b4('0x1e'))[_0x49b4('0x1e')]();if(_[_0x49b4('0x1f')](_0x28ce6e,_0x36ca14[_0x49b4('0x20')])){return;}var _0x369ff2=_[_0x49b4('0x21')](_0x18a767,[_0x49b4('0x1e'),_0x36ca14[_0x49b4('0x20')]])[_0x49b4('0x22')];return db[_0x49b4('0x23')]['destroy']({'where':{'type':_0x369ff2,'resourceId':_0x36ca14['id']}})[_0x49b4('0x24')](function(){return _0x278c7c;});})[_0x49b4('0x24')](function(){_0x17bab5[_0x49b4('0x12')](0xcc)[_0x49b4('0xc')]();});}};}function handleEntityNotFound(_0x298caa){return function(_0x27a0f6){if(!_0x27a0f6){_0x298caa[_0x49b4('0x25')](0x194);}return _0x27a0f6;};}function handleError(_0x46dabd,_0x346b0b){_0x346b0b=_0x346b0b||0x1f4;return function(_0x8ac694){logger[_0x49b4('0x26')](_0x8ac694[_0x49b4('0x27')]);if(_0x8ac694[_0x49b4('0x22')]){delete _0x8ac694[_0x49b4('0x22')];}_0x46dabd[_0x49b4('0x12')](_0x346b0b)[_0x49b4('0x28')](_0x8ac694);};}exports[_0x49b4('0x29')]=function(_0xc14186,_0x411014){var _0x1708e2={},_0x15af55={},_0x2f83b1={'count':0x0,'rows':[]};var _0x261749=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x2784de){return{'name':_0x2784de[_0x49b4('0x2a')],'type':_0x2784de[_0x49b4('0x20')][_0x49b4('0x2b')]};});_0x15af55[_0x49b4('0x2c')]=_[_0x49b4('0x1d')](_0x261749,_0x49b4('0x22'));_0x15af55[_0x49b4('0x2d')]=_[_0x49b4('0x2e')](_0xc14186[_0x49b4('0x2d')]);_0x15af55['filters']=_[_0x49b4('0x2f')](_0x15af55[_0x49b4('0x2c')],_0x15af55[_0x49b4('0x2d')]);_0x1708e2['attributes']=_['intersection'](_0x15af55[_0x49b4('0x2c')],qs[_0x49b4('0x30')](_0xc14186[_0x49b4('0x2d')][_0x49b4('0x30')]));_0x1708e2['attributes']=_0x1708e2[_0x49b4('0x31')][_0x49b4('0x32')]?_0x1708e2[_0x49b4('0x31')]:_0x15af55[_0x49b4('0x2c')];if(!_0xc14186[_0x49b4('0x2d')][_0x49b4('0x33')](_0x49b4('0x34'))){_0x1708e2[_0x49b4('0x11')]=qs[_0x49b4('0x11')](_0xc14186[_0x49b4('0x2d')]['limit']);_0x1708e2[_0x49b4('0xe')]=qs['offset'](_0xc14186[_0x49b4('0x2d')][_0x49b4('0xe')]);}_0x1708e2[_0x49b4('0x35')]=qs[_0x49b4('0x36')](_0xc14186[_0x49b4('0x2d')][_0x49b4('0x36')]);_0x1708e2[_0x49b4('0x37')]=qs[_0x49b4('0x38')](_[_0x49b4('0x39')](_0xc14186[_0x49b4('0x2d')],_0x15af55['filters']),_0x261749);if(_0xc14186[_0x49b4('0x2d')][_0x49b4('0x3a')]){_0x1708e2[_0x49b4('0x37')]=_[_0x49b4('0x3b')](_0x1708e2[_0x49b4('0x37')],{'$or':_['map'](_0x261749,function(_0x543a54){if(_0x543a54[_0x49b4('0x20')]!==_0x49b4('0x3c')){var _0x324494={};_0x324494[_0x543a54[_0x49b4('0x22')]]={'$like':'%'+_0xc14186[_0x49b4('0x2d')][_0x49b4('0x3a')]+'%'};return _0x324494;}})});}_0x1708e2=_[_0x49b4('0x3b')]({},_0x1708e2,_0xc14186[_0x49b4('0x3d')]);var _0x5cd435={'where':_0x1708e2['where']};return db['VoiceExtension'][_0x49b4('0x10')](_0x5cd435)[_0x49b4('0x24')](function(_0xf2a6b3){_0x2f83b1[_0x49b4('0x10')]=_0xf2a6b3;if(_0xc14186['query'][_0x49b4('0x3e')]){_0x1708e2[_0x49b4('0x3f')]=[{'all':!![]}];}return db[_0x49b4('0x40')][_0x49b4('0x41')](_0x1708e2);})[_0x49b4('0x24')](function(_0x3436b9){_0x2f83b1[_0x49b4('0x42')]=_0x3436b9;return _0x2f83b1;})['then'](respondWithFilteredResult(_0x411014,_0x1708e2))['catch'](handleError(_0x411014,null));};exports[_0x49b4('0x43')]=function(_0x7e6b26,_0x5032c4){var _0x10ef99={'raw':![],'where':{'id':_0x7e6b26[_0x49b4('0x44')]['id']}},_0xbc308c={};_0xbc308c[_0x49b4('0x2c')]=_[_0x49b4('0x2e')](db[_0x49b4('0x40')][_0x49b4('0x45')]);_0xbc308c['query']=_['keys'](_0x7e6b26[_0x49b4('0x2d')]);_0xbc308c[_0x49b4('0x38')]=_[_0x49b4('0x2f')](_0xbc308c[_0x49b4('0x2c')],_0xbc308c[_0x49b4('0x2d')]);_0x10ef99['attributes']=_[_0x49b4('0x2f')](_0xbc308c['model'],qs[_0x49b4('0x30')](_0x7e6b26[_0x49b4('0x2d')]['fields']));_0x10ef99[_0x49b4('0x31')]=_0x10ef99[_0x49b4('0x31')][_0x49b4('0x32')]?_0x10ef99[_0x49b4('0x31')]:_0xbc308c[_0x49b4('0x2c')];if(_0x7e6b26['query'][_0x49b4('0x3e')]){_0x10ef99[_0x49b4('0x3f')]=[{'all':!![]}];}_0x10ef99=_['merge']({},_0x10ef99,_0x7e6b26[_0x49b4('0x3d')]);return db[_0x49b4('0x40')][_0x49b4('0x21')](_0x10ef99)[_0x49b4('0x24')](handleEntityNotFound(_0x5032c4,null))['then'](respondWithResult(_0x5032c4,null))[_0x49b4('0x46')](handleError(_0x5032c4,null));};exports[_0x49b4('0x15')]=function(_0x477dfe,_0x358afa){return db[_0x49b4('0x40')][_0x49b4('0x21')]({'where':{'id':_0x477dfe[_0x49b4('0x44')]['id']}})[_0x49b4('0x24')](handleEntityNotFound(_0x358afa,null))[_0x49b4('0x24')](removeEntity(_0x358afa,null))[_0x49b4('0x46')](handleError(_0x358afa,null));};exports['create']=function(_0xd9af3b,_0x4b7cb6){if(_0xd9af3b[_0x49b4('0x47')]['type']===_0x49b4('0x1a')&&!_[_0x49b4('0x48')](_0xd9af3b[_0x49b4('0x47')][_0x49b4('0x49')],'_')){_0xd9af3b[_0x49b4('0x47')][_0x49b4('0x49')]='_'[_0x49b4('0x4a')](_0xd9af3b[_0x49b4('0x47')][_0x49b4('0x49')]);}return db[_0x49b4('0x40')][_0x49b4('0x4b')](_0xd9af3b[_0x49b4('0x47')],{'raw':![]})[_0x49b4('0x24')](function(_0x702488){var _0x4be3f2=_0xd9af3b[_0x49b4('0x4c')][_0x49b4('0x16')]({'plain':!![]});if(!_0x4be3f2)throw new Error(_0x49b4('0x4d'));if(_0x4be3f2[_0x49b4('0x4e')]===_0x49b4('0x4c')){var _0x39f550=_0x702488['get']({'plain':!![]});var _0x219e45=[{'name':_0x49b4('0x17'),'value':_0x49b4('0x18')},{'name':_0x49b4('0x19'),'value':'outbound'},{'name':_0x49b4('0x1b'),'value':'internal'}];var _0x242525=_['find'](_0x219e45,['value',_0x39f550[_0x49b4('0x20')]])[_0x49b4('0x22')];return db['UserProfileSection']['find']({'where':{'name':_0x242525,'userProfileId':_0x4be3f2['userProfileId']},'raw':!![]})[_0x49b4('0x24')](function(_0x2b3e1d){if(_0x2b3e1d&&_0x2b3e1d['autoAssociation']===0x0){return db[_0x49b4('0x23')][_0x49b4('0x4b')]({'name':_0x39f550[_0x49b4('0x22')],'resourceId':_0x39f550['id'],'type':_0x2b3e1d[_0x49b4('0x22')],'sectionId':_0x2b3e1d['id']},{})['then'](function(){return _0x702488;});}else{return _0x702488;}})[_0x49b4('0x46')](function(_0x322a13){logger[_0x49b4('0x26')](_0x49b4('0x4f'),_0x322a13);throw _0x322a13;});}return _0x702488;})[_0x49b4('0x24')](respondWithResult(_0x4b7cb6,0xc9))['catch'](handleError(_0x4b7cb6,null));};exports[_0x49b4('0x50')]=function(_0x441e7f,_0x341099){if(_0x441e7f[_0x49b4('0x47')]['id']){delete _0x441e7f[_0x49b4('0x47')]['id'];}return db[_0x49b4('0x40')][_0x49b4('0x21')]({'where':{'id':_0x441e7f[_0x49b4('0x44')]['id']}})[_0x49b4('0x24')](handleEntityNotFound(_0x341099,null))[_0x49b4('0x24')](function(_0x4478e1){if(_0x4478e1){return db[_0x49b4('0x40')][_0x49b4('0x50')](_[_0x49b4('0x39')](_0x441e7f[_0x49b4('0x47')],['exten',_0x49b4('0x51'),_0x49b4('0x52'),_0x49b4('0x53'),'cutdigits','mandatoryDisposition',_0x49b4('0x54')]),{'where':{'context':_0x4478e1[_0x49b4('0x51')],'exten':_0x4478e1['exten']},'individualHooks':!![]})[_0x49b4('0x24')](function(_0x1a6765){return _0x1a6765;});}return null;})[_0x49b4('0x24')](respondWithStatusCode(_0x341099,null))[_0x49b4('0x46')](handleError(_0x341099,null));};exports[_0x49b4('0x55')]=function(_0xb1c0da,_0x4a2e91){var _0x2b2602=_0xb1c0da[_0x49b4('0x44')]['id'];var _0x3ec085=_0xb1c0da['body'];var _0x4c38e5=0xc8;var _0x509326=null;return db[_0x49b4('0x56')][_0x49b4('0x57')]({'isolationLevel':db[_0x49b4('0x56')][_0x49b4('0x58')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x531830){return db[_0x49b4('0x40')][_0x49b4('0x59')]({'where':{'id':_0x2b2602},'transaction':_0x531830})[_0x49b4('0x24')](function(_0x47169f){if(_0x47169f){return db[_0x49b4('0x40')][_0x49b4('0x15')]({'where':{'VoiceExtensionId':_0x2b2602},'transaction':_0x531830})[_0x49b4('0x24')](function(){var _0x31e8f8=_[_0x49b4('0x1d')](_0x3ec085,function(_0x3beada){_0x3beada[_0x49b4('0x5a')]=_0x2b2602;_0x3beada[_0x49b4('0x5b')]=!![];return _0x3beada;});return _0x47169f[_0x49b4('0x5c')](_0x31e8f8);})[_0x49b4('0x24')](function(_0x58bee7){return db[_0x49b4('0x40')]['bulkCreate'](_0x58bee7,{'transaction':_0x531830});});}else{_0x4c38e5=0x194;_0x509326=[];}});})[_0x49b4('0x24')](function(){if(_0x4c38e5!==0x194){return db[_0x49b4('0x40')][_0x49b4('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x2b2602},'order':_0x49b4('0x5e')})[_0x49b4('0x24')](function(_0x4faab4){_0x509326=_0x4faab4;});}})[_0x49b4('0x46')](function(_0x35e1f9){_0x4c38e5=0x1f4;logger[_0x49b4('0x26')](_0x35e1f9[_0x49b4('0x27')]);if(_0x35e1f9[_0x49b4('0x22')]){delete _0x35e1f9[_0x49b4('0x22')];}_0x509326=_0x35e1f9;})['finally'](function(){if(_0x509326===null){_0x4a2e91[_0x49b4('0x25')](_0x4c38e5);}else{if(_0x4c38e5===0x1f4){_0x4a2e91[_0x49b4('0x12')](_0x4c38e5)[_0x49b4('0x28')](_0x509326);}else{_0x4a2e91[_0x49b4('0x12')](_0x4c38e5)['json'](_0x509326);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 55469de..3c4ec65 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 _0xeb9c=['hook','exports','../../mysqldb','VoiceExtension','save','update','emit'];(function(_0x4f5da4,_0x487a0b){var _0x251052=function(_0x492913){while(--_0x492913){_0x4f5da4['push'](_0x4f5da4['shift']());}};_0x251052(++_0x487a0b);}(_0xeb9c,0xdb));var _0xceb9=function(_0x561eeb,_0x4df8ee){_0x561eeb=_0x561eeb-0x0;var _0x27e9f8=_0xeb9c[_0x561eeb];return _0x27e9f8;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xceb9('0x0'))['db'][_0xceb9('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xceb9('0x2'),'afterUpdate':_0xceb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x24ea48){return function(_0x31c2f3,_0x1031e0,_0x24bd38){VoiceExtensionEvents['emit'](_0x24ea48+':'+_0x31c2f3['id'],_0x31c2f3);VoiceExtensionEvents[_0xceb9('0x4')](_0x24ea48,_0x31c2f3);_0x24bd38(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xceb9('0x5')](e,emitEvent(event));}}module[_0xceb9('0x6')]=VoiceExtensionEvents; \ No newline at end of file +var _0x65c4=['VoiceExtension','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4e566c,_0x16e04c){var _0x31947e=function(_0x2479a3){while(--_0x2479a3){_0x4e566c['push'](_0x4e566c['shift']());}};_0x31947e(++_0x16e04c);}(_0x65c4,0x98));var _0x465c=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x65c4[_0x27e811];return _0x1627fa;};'use strict';var EventEmitter=require(_0x465c('0x0'));var VoiceExtension=require(_0x465c('0x1'))['db'][_0x465c('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x465c('0x3')](0x0);var events={'afterCreate':_0x465c('0x4'),'afterUpdate':_0x465c('0x5'),'afterDestroy':_0x465c('0x6')};function emitEvent(_0x5cba69){return function(_0x2eede1,_0x1bfb9c,_0x350733){VoiceExtensionEvents[_0x465c('0x7')](_0x5cba69+':'+_0x2eede1['id'],_0x2eede1);VoiceExtensionEvents[_0x465c('0x7')](_0x5cba69,_0x2eede1);_0x350733(null);};}for(var e in events){if(events[_0x465c('0x8')](e)){var event=events[e];VoiceExtension[_0x465c('0x9')](e,emitEvent(event));}}module[_0x465c('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 7c9fe48..2fbe9b0 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 _0x0a88=['interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','define','VoiceExtension','get','lodash','./voiceExtension.attributes','exports','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','push','inbound','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','phone','prefix','param','SIP','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll'];(function(_0x260859,_0x3cfcff){var _0x4b77f8=function(_0x2e48f8){while(--_0x2e48f8){_0x260859['push'](_0x260859['shift']());}};_0x4b77f8(++_0x3cfcff);}(_0x0a88,0x7a));var _0x80a8=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0x0a88[_0x6e1239];return _0x418150;};'use strict';var _=require(_0x80a8('0x0'));var attributes=require(_0x80a8('0x1'));module[_0x80a8('0x2')]=function(_0x53f94f){var _0x365120=_0x53f94f['models'];function _0x490df2(_0x1cfa75){var _0x15576d=0x2;var _0x4f5a0b=[{'type':_0x1cfa75[_0x80a8('0x3')],'app':_0x80a8('0x4'),'appdata':_0x80a8('0x5')+_0x1cfa75[_0x80a8('0x3')],'context':_0x1cfa75[_0x80a8('0x6')],'exten':_0x1cfa75[_0x80a8('0x7')],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']},{'type':_0x1cfa75[_0x80a8('0x3')],'app':_0x1cfa75['alias']?_0x80a8('0x4'):_0x80a8('0x8'),'appdata':_0x1cfa75[_0x80a8('0x9')]?_0x80a8('0xa')+_0x1cfa75[_0x80a8('0x9')]:'No\x20alias\x20set','context':_0x1cfa75[_0x80a8('0x6')],'exten':_0x1cfa75[_0x80a8('0x7')],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']}];if(_0x1cfa75[_0x80a8('0x3')]==='inbound'){_0x4f5a0b[_0x80a8('0xb')]({'type':_0x80a8('0xc'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0xd')+_0x1cfa75['id'],'context':_0x1cfa75[_0x80a8('0x6')],'exten':_0x1cfa75[_0x80a8('0x7')],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']});}_0x4f5a0b[_0x80a8('0xb')]({'type':_0x1cfa75[_0x80a8('0x3')],'app':_0x80a8('0x4'),'appdata':_0x80a8('0xe'),'context':_0x1cfa75['context'],'exten':_0x1cfa75['exten'],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']},{'type':_0x1cfa75[_0x80a8('0x3')],'app':_0x80a8('0x4'),'appdata':_0x80a8('0xf'),'context':_0x1cfa75[_0x80a8('0x6')],'exten':_0x1cfa75[_0x80a8('0x7')],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']},{'type':_0x1cfa75[_0x80a8('0x3')],'app':_0x80a8('0x4'),'appdata':_0x80a8('0x10'),'context':_0x1cfa75[_0x80a8('0x6')],'exten':_0x1cfa75[_0x80a8('0x7')],'priority':_0x15576d++,'VoiceExtensionId':_0x1cfa75['id']});return _0x4f5a0b;}function _0x540c13(_0x3021b0){var _0x9b20=0x2;var _0x5e228b=[{'type':_0x80a8('0x11'),'app':'Set','appdata':_0x80a8('0x12'),'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':'outbound','app':_0x3021b0['alias']?'Set':_0x80a8('0x8'),'appdata':_0x3021b0[_0x80a8('0x9')]?_0x80a8('0xa')+_0x3021b0[_0x80a8('0x9')]:'No\x20alias\x20set','context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0['exten'],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0x13')+(_0x3021b0[_0x80a8('0x14')]?_0x80a8('0x15')+_0x3021b0['cutdigits']+'}':_0x80a8('0x16')),'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0xd')+_0x3021b0['id'],'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0['exten'],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x17'),'appdata':_0x80a8('0x18')+(_0x9b20+0x2)+_0x80a8('0x19')+(_0x9b20+0x1)+')','context':_0x3021b0['context'],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x3021b0[_0x80a8('0x14')]?_0x80a8('0x1a')+_0x3021b0['cutdigits']+'}':_0x80a8('0x1b'),'context':_0x3021b0['context'],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0xe'),'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0xf'),'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':_0x80a8('0x11'),'app':_0x80a8('0x4'),'appdata':_0x80a8('0x1c')+_0x3021b0['id'],'context':_0x3021b0['context'],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']}];if(_0x3021b0[_0x80a8('0x1d')](_0x80a8('0x1e'))&&_0x3021b0[_0x80a8('0x1e')]!=='none'){_0x5e228b[_0x80a8('0xb')]({'type':_0x80a8('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0[_0x80a8('0x7')],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']},{'type':'outbound','app':_0x80a8('0x4'),'appdata':_0x80a8('0x1f')+_0x3021b0[_0x80a8('0x1e')]||_0x80a8('0x20'),'context':_0x3021b0[_0x80a8('0x6')],'exten':_0x3021b0['exten'],'priority':_0x9b20++,'VoiceExtensionId':_0x3021b0['id']});}return _0x5e228b;}function _0x319ffa(_0xa00ab6,_0x5af630){var _0x1b577b=[{'name':_0x80a8('0x21'),'param':0x0},{'name':_0x80a8('0x22'),'param':0x1},{'name':_0x80a8('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x426542={};var _0x428992=_0x5af630[_0x80a8('0x24')](',');var _0x24ca47=[];for(var _0x5cd0a8=0x0;_0x5cd0a8<_0x1b577b[_0x80a8('0x25')];_0x5cd0a8++){switch(_0x1b577b[_0x5cd0a8][_0x80a8('0x26')]){case _0x80a8('0x21'):_0x426542[_0x80a8('0x21')]=_0x428992[_0x1b577b[_0x5cd0a8]['param']][_0x80a8('0x24')]('/')[0x1];_0x426542[_0x80a8('0x27')]=_0x428992[_0x1b577b[_0x5cd0a8]['param']][_0x80a8('0x24')]('/')[0x2];_0x426542[_0x80a8('0x28')]=_0x426542[_0x80a8('0x27')]?_0x426542[_0x80a8('0x27')][_0x80a8('0x24')]('$')[0x0]:undefined;_0x426542['phone']=_0xa00ab6[_0x80a8('0x14')]?(_0x426542[_0x80a8('0x28')]||'')+_0x80a8('0x15')+_0xa00ab6['cutdigits']+'}':(_0x426542['prefix']||'')+_0x80a8('0x16');_0x24ca47[_0x1b577b[_0x5cd0a8][_0x80a8('0x29')]]=[_0x80a8('0x2a'),_0x426542[_0x80a8('0x21')],_0x426542[_0x80a8('0x27')]][_0x80a8('0x2b')]('/');break;case _0x80a8('0x23'):_0x426542[_0x80a8('0x23')]=_0x428992[_0x1b577b[_0x5cd0a8][_0x80a8('0x29')]];if(_0xa00ab6[_0x80a8('0x1e')]!==_0x80a8('0x2c')){if(_0x426542[_0x80a8('0x23')][_0x80a8('0x2d')]('U(xcally-mixmonitor-context)')<0x0){_0x426542[_0x80a8('0x23')]+=_0x80a8('0x2e');}}else{_0x426542[_0x80a8('0x23')]=_0x426542['options']['replace'](_0x80a8('0x2e'),'');}_0x24ca47[_0x1b577b[_0x5cd0a8][_0x80a8('0x29')]]=_0x426542['options'];break;default:_0x24ca47[_0x1b577b[_0x5cd0a8][_0x80a8('0x29')]]=_0x428992[_0x1b577b[_0x5cd0a8][_0x80a8('0x29')]];}}return _0x24ca47['join'](',');}function _0x5ae5dc(_0x3e330e,_0x12ecc2,_0x1dabda){return new Promise(function(_0x3138da,_0x343438){var _0x197fa3=[];if(_[_0x80a8('0x2f')](_0x12ecc2))return _0x3138da(_0x197fa3);_0x365120[_0x80a8('0x30')][_0x80a8('0x31')]({'attributes':['id',_0x80a8('0x32'),_0x80a8('0x33')],'raw':!![]})[_0x80a8('0x34')](function(_0x5a4620){for(var _0x163dfd=0x0,_0x133fe3=0x0;_0x163dfd<_0x12ecc2['length'];_0x163dfd++,_0x133fe3=0x0){var _0x53d26f=_0x12ecc2[_0x163dfd];var _0x493b6d=[];var _0x3fddd3=[];delete _0x53d26f['id'];if(_0x53d26f[_0x80a8('0x32')]!==_0x80a8('0x35')){_0x53d26f['intervals']=[_0x53d26f['interval']];}else{_0x53d26f[_0x80a8('0x36')]=_0x53d26f[_0x80a8('0x33')]?_[_0x80a8('0x37')](_[_0x80a8('0x38')](_0x5a4620,{'IntervalId':_0x53d26f[_0x80a8('0x33')]}),_0x80a8('0x32')):[];}_0x53d26f[_0x80a8('0x6')]=_0x3e330e['context'];_0x53d26f[_0x80a8('0x7')]=_0x3e330e[_0x80a8('0x7')];if(_0x53d26f[_0x80a8('0x3')])_0x53d26f['type']=_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')]();if(_0x3e330e[_0x80a8('0x3')]===_0x80a8('0x11')){if(_0x53d26f['hasOwnProperty'](_0x80a8('0x3a'))&&_0x53d26f[_0x80a8('0x3a')]&&_0x53d26f[_0x80a8('0x3a')]!=='--'){_0x493b6d['push']({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':'Set','appdata':_0x80a8('0x3b')+_0x53d26f[_0x80a8('0x3a')],'context':_0x3e330e['context'],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f['intervals']['length']+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});}_0x493b6d['push']({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':_0x80a8('0x17'),'appdata':_0x80a8('0x3c')+(_0x53d26f['callerID']?_0x80a8('0x3d')+_0x53d26f[_0x80a8('0x3e')]+')':_0x80a8('0x3f')),'context':_0x3e330e['context'],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f[_0x80a8('0x36')]['length']+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});}else{if(_0x53d26f[_0x80a8('0x1d')](_0x80a8('0x40'))){if([_0x80a8('0x41'),_0x80a8('0x42')]['includes'](_0x53d26f[_0x80a8('0x43')][_0x80a8('0x39')]())&&_0x53d26f[_0x80a8('0x44')]!==_0x80a8('0x45')){if(_0x53d26f['answer']){_0x493b6d[_0x80a8('0xb')]({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':_0x80a8('0x17'),'appdata':_0x80a8('0x46'),'context':_0x3e330e[_0x80a8('0x6')],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});_0x493b6d[_0x80a8('0xb')]({'type':_0x53d26f[_0x80a8('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x80a8('0x47'),'context':_0x3e330e[_0x80a8('0x6')],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});}else{_0x493b6d[_0x80a8('0xb')]({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':_0x80a8('0x17'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x3e330e[_0x80a8('0x6')],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});_0x493b6d[_0x80a8('0xb')]({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':_0x80a8('0x4'),'appdata':_0x80a8('0x48'),'context':_0x3e330e[_0x80a8('0x6')],'exten':_0x3e330e['exten'],'priority':_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});}}}}for(var _0x333abb=0x0;_0x333abb<_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')];_0x333abb++){var _0x249942=_0x1dabda+_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')];var _0x14e936=_0x333abb===_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]-0x1?_0x1dabda+_0x493b6d[_0x80a8('0x25')]+_0x3fddd3[_0x80a8('0x25')]+0x2:_0x1dabda+_0x333abb+0x1;_0x493b6d[_0x80a8('0x49')](_0x333abb,0x0,{'type':_0x3e330e[_0x80a8('0x3')],'app':_0x80a8('0x4a'),'appdata':_0x53d26f['intervals'][_0x333abb]+'?'+_0x3e330e[_0x80a8('0x6')]+_0x80a8('0x4b')+_0x249942+':'+_0x3e330e[_0x80a8('0x6')]+_0x80a8('0x4b')+_0x14e936,'exten':_0x3e330e[_0x80a8('0x7')],'context':_0x3e330e[_0x80a8('0x6')],'priority':_0x1dabda+_0x333abb,'VoiceExtensionId':_0x3e330e['id']});}if(_0x53d26f[_0x80a8('0x44')]===_0x80a8('0x4c')){_0x53d26f[_0x80a8('0x4d')]=_0x319ffa(_0x3e330e,_0x53d26f[_0x80a8('0x4d')]);}if(_0x53d26f[_0x80a8('0x44')]==='agi'){_0x493b6d['push']({'type':_0x53d26f[_0x80a8('0x3')][_0x80a8('0x39')](),'app':_0x80a8('0x4'),'appdata':_0x80a8('0x4e'),'context':_0x3e330e[_0x80a8('0x6')],'exten':_0x3e330e[_0x80a8('0x7')],'priority':_0x53d26f[_0x80a8('0x36')][_0x80a8('0x25')]+_0x1dabda+_0x133fe3++,'VoiceExtensionId':_0x3e330e['id']});}_0x53d26f[_0x80a8('0x4f')]=_0x493b6d[_0x80a8('0x25')]?_[_0x80a8('0x50')](_0x493b6d)[_0x80a8('0x4f')]+0x1:_0x1dabda;_0x197fa3=_[_0x80a8('0x51')](_0x197fa3,_0x493b6d,[_0x53d26f],_0x3fddd3);_0x1dabda=_[_0x80a8('0x50')](_0x197fa3)['priority']+0x1;}return _0x3138da(_0x197fa3);})[_0x80a8('0x52')](function(_0x4ac972){_0x343438(_0x4ac972);});});}return _0x53f94f[_0x80a8('0x53')](_0x80a8('0x54'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5eee04){var _0x523839=this[_0x80a8('0x55')]({'plain':!![]});var _0x5142ad=_0x523839['type']===_0x80a8('0x11')?_0x540c13(_0x523839):_0x490df2(_0x523839);return _0x5ae5dc(_0x523839,_0x5eee04,_[_0x80a8('0x50')](_0x5142ad)[_0x80a8('0x4f')]+0x1)['then'](function(_0x502614){var _0x399e44=_[_0x80a8('0x51')](_0x5142ad,_0x502614);_0x399e44['push']({'type':_0x523839[_0x80a8('0x3')],'app':'Hangup','exten':_0x523839[_0x80a8('0x7')],'context':_0x523839[_0x80a8('0x6')],'priority':_[_0x80a8('0x50')](_0x399e44)[_0x80a8('0x4f')]+0x1,'VoiceExtensionId':_0x523839['id']});return _0x399e44;});}}});}; \ No newline at end of file +var _0xccfc=['XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','VoiceExtension','voice_extensions','Hangup','lodash','./voiceExtension.attributes','models','type','exten','Set','NoOp','alias','No\x20alias\x20set','context','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','url','length','name','trunk','param','split','phone','prefix','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress'];(function(_0x261426,_0x2dd424){var _0xc67713=function(_0x1cc04){while(--_0x1cc04){_0x261426['push'](_0x261426['shift']());}};_0xc67713(++_0x2dd424);}(_0xccfc,0x19a));var _0xcccf=function(_0x1d771e,_0x1d6848){_0x1d771e=_0x1d771e-0x0;var _0x4f9f38=_0xccfc[_0x1d771e];return _0x4f9f38;};'use strict';var _=require(_0xcccf('0x0'));var attributes=require(_0xcccf('0x1'));module['exports']=function(_0x10ef72){var _0x41f08e=_0x10ef72[_0xcccf('0x2')];function _0xfdb49b(_0x431940){var _0x7425b5=0x2;var _0x56ca5b=[{'type':_0x431940[_0xcccf('0x3')],'app':'Set','appdata':'CDR(type)='+_0x431940[_0xcccf('0x3')],'context':_0x431940['context'],'exten':_0x431940[_0xcccf('0x4')],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']},{'type':_0x431940[_0xcccf('0x3')],'app':_0x431940['alias']?_0xcccf('0x5'):_0xcccf('0x6'),'appdata':_0x431940[_0xcccf('0x7')]?'CDR(routeAlias)='+_0x431940[_0xcccf('0x7')]:_0xcccf('0x8'),'context':_0x431940[_0xcccf('0x9')],'exten':_0x431940[_0xcccf('0x4')],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']}];if(_0x431940['type']===_0xcccf('0xa')){_0x56ca5b[_0xcccf('0xb')]({'type':'inbound','app':'Set','appdata':'CDR(routeid)='+_0x431940['id'],'context':_0x431940[_0xcccf('0x9')],'exten':_0x431940[_0xcccf('0x4')],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']});}_0x56ca5b[_0xcccf('0xb')]({'type':_0x431940[_0xcccf('0x3')],'app':_0xcccf('0x5'),'appdata':_0xcccf('0xc'),'context':_0x431940[_0xcccf('0x9')],'exten':_0x431940[_0xcccf('0x4')],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']},{'type':_0x431940[_0xcccf('0x3')],'app':_0xcccf('0x5'),'appdata':_0xcccf('0xd'),'context':_0x431940[_0xcccf('0x9')],'exten':_0x431940['exten'],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']},{'type':_0x431940[_0xcccf('0x3')],'app':'Set','appdata':_0xcccf('0xe'),'context':_0x431940[_0xcccf('0x9')],'exten':_0x431940['exten'],'priority':_0x7425b5++,'VoiceExtensionId':_0x431940['id']});return _0x56ca5b;}function _0x2fa6bc(_0x5140af){var _0x3f8b21=0x2;var _0x9a4eff=[{'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':'CDR(type)=outbound','context':_0x5140af['context'],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0x5140af[_0xcccf('0x7')]?_0xcccf('0x5'):_0xcccf('0x6'),'appdata':_0x5140af[_0xcccf('0x7')]?_0xcccf('0x10')+_0x5140af[_0xcccf('0x7')]:_0xcccf('0x8'),'context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x11')+(_0x5140af[_0xcccf('0x12')]?_0xcccf('0x13')+_0x5140af[_0xcccf('0x12')]+'}':_0xcccf('0x14')),'context':_0x5140af['context'],'exten':_0x5140af['exten'],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x15')+_0x5140af['id'],'context':_0x5140af['context'],'exten':_0x5140af['exten'],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0xcccf('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3f8b21+0x2)+'):Goto('+(_0x3f8b21+0x1)+')','context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':'outbound','app':_0xcccf('0x5'),'appdata':_0x5140af[_0xcccf('0x12')]?_0xcccf('0x17')+_0x5140af[_0xcccf('0x12')]+'}':_0xcccf('0x18'),'context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':_0xcccf('0xc'),'context':_0x5140af['context'],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5140af['context'],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':'Set','appdata':_0xcccf('0xe'),'context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':'outbound','app':_0xcccf('0x5'),'appdata':'outboundrouteid='+_0x5140af['id'],'context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']}];if(_0x5140af[_0xcccf('0x19')](_0xcccf('0x1a'))&&_0x5140af[_0xcccf('0x1a')]!==_0xcccf('0x1b')){_0x9a4eff['push']({'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af[_0xcccf('0x4')],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']},{'type':_0xcccf('0xf'),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x1c')+_0x5140af[_0xcccf('0x1a')]||'wav','context':_0x5140af[_0xcccf('0x9')],'exten':_0x5140af['exten'],'priority':_0x3f8b21++,'VoiceExtensionId':_0x5140af['id']});}return _0x9a4eff;}function _0x59edc6(_0x1fc2aa,_0x16f8c6){var _0x453b76=[{'name':'trunk','param':0x0},{'name':'timeout','param':0x1},{'name':'options','param':0x2},{'name':_0xcccf('0x1d'),'param':0x3}];var _0x48c56f={};var _0x19b01a=_0x16f8c6['split'](',');var _0x484374=[];for(var _0x378103=0x0;_0x378103<_0x453b76[_0xcccf('0x1e')];_0x378103++){switch(_0x453b76[_0x378103][_0xcccf('0x1f')]){case _0xcccf('0x20'):_0x48c56f[_0xcccf('0x20')]=_0x19b01a[_0x453b76[_0x378103][_0xcccf('0x21')]][_0xcccf('0x22')]('/')[0x1];_0x48c56f[_0xcccf('0x23')]=_0x19b01a[_0x453b76[_0x378103][_0xcccf('0x21')]][_0xcccf('0x22')]('/')[0x2];_0x48c56f[_0xcccf('0x24')]=_0x48c56f[_0xcccf('0x23')]?_0x48c56f[_0xcccf('0x23')][_0xcccf('0x22')]('$')[0x0]:undefined;_0x48c56f[_0xcccf('0x23')]=_0x1fc2aa[_0xcccf('0x12')]?(_0x48c56f[_0xcccf('0x24')]||'')+_0xcccf('0x13')+_0x1fc2aa[_0xcccf('0x12')]+'}':(_0x48c56f[_0xcccf('0x24')]||'')+_0xcccf('0x14');_0x484374[_0x453b76[_0x378103][_0xcccf('0x21')]]=['SIP',_0x48c56f[_0xcccf('0x20')],_0x48c56f[_0xcccf('0x23')]][_0xcccf('0x25')]('/');break;case _0xcccf('0x26'):_0x48c56f[_0xcccf('0x26')]=_0x19b01a[_0x453b76[_0x378103][_0xcccf('0x21')]];if(_0x1fc2aa[_0xcccf('0x1a')]!==_0xcccf('0x1b')){if(_0x48c56f['options'][_0xcccf('0x27')](_0xcccf('0x28'))<0x0){_0x48c56f['options']+='U(xcally-mixmonitor-context)';}}else{_0x48c56f[_0xcccf('0x26')]=_0x48c56f['options'][_0xcccf('0x29')](_0xcccf('0x28'),'');}_0x484374[_0x453b76[_0x378103][_0xcccf('0x21')]]=_0x48c56f['options'];break;default:_0x484374[_0x453b76[_0x378103][_0xcccf('0x21')]]=_0x19b01a[_0x453b76[_0x378103][_0xcccf('0x21')]];}}return _0x484374[_0xcccf('0x25')](',');}function _0x2ea9bc(_0x51ceda,_0xca191,_0x4d576a){return new Promise(function(_0x578039,_0x4160f2){var _0x2ba5d4=[];if(_[_0xcccf('0x2a')](_0xca191))return _0x578039(_0x2ba5d4);_0x41f08e['Interval'][_0xcccf('0x2b')]({'attributes':['id',_0xcccf('0x2c'),_0xcccf('0x2d')],'raw':!![]})[_0xcccf('0x2e')](function(_0x97eded){for(var _0x42fa4c=0x0,_0x4f646d=0x0;_0x42fa4c<_0xca191['length'];_0x42fa4c++,_0x4f646d=0x0){var _0xdc0374=_0xca191[_0x42fa4c];var _0x4f2f66=[];var _0x5220c8=[];delete _0xdc0374['id'];if(_0xdc0374['interval']!==_0xcccf('0x2f')){_0xdc0374[_0xcccf('0x30')]=[_0xdc0374[_0xcccf('0x2c')]];}else{_0xdc0374['intervals']=_0xdc0374['IntervalId']?_[_0xcccf('0x31')](_[_0xcccf('0x32')](_0x97eded,{'IntervalId':_0xdc0374['IntervalId']}),_0xcccf('0x2c')):[];}_0xdc0374[_0xcccf('0x9')]=_0x51ceda[_0xcccf('0x9')];_0xdc0374[_0xcccf('0x4')]=_0x51ceda['exten'];if(_0xdc0374[_0xcccf('0x3')])_0xdc0374[_0xcccf('0x3')]=_0xdc0374['type'][_0xcccf('0x33')]();if(_0x51ceda['type']===_0xcccf('0xf')){if(_0xdc0374['hasOwnProperty']('tag')&&_0xdc0374[_0xcccf('0x34')]&&_0xdc0374[_0xcccf('0x34')]!=='--'){_0x4f2f66['push']({'type':_0xdc0374[_0xcccf('0x3')][_0xcccf('0x33')](),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x35')+_0xdc0374[_0xcccf('0x34')],'context':_0x51ceda[_0xcccf('0x9')],'exten':_0x51ceda[_0xcccf('0x4')],'priority':_0xdc0374['intervals'][_0xcccf('0x1e')]+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});}_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374[_0xcccf('0x3')][_0xcccf('0x33')](),'app':_0xcccf('0x16'),'appdata':_0xcccf('0x36')+(_0xdc0374[_0xcccf('0x37')]?_0xcccf('0x38')+_0xdc0374['callerID']+')':'NoOp(No\x20number\x20available)'),'context':_0x51ceda['context'],'exten':_0x51ceda[_0xcccf('0x4')],'priority':_0xdc0374[_0xcccf('0x30')][_0xcccf('0x1e')]+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});}else{if(_0xdc0374['hasOwnProperty']('answer')){if([_0xcccf('0x39'),_0xcccf('0x3a')][_0xcccf('0x3b')](_0xdc0374[_0xcccf('0x3c')][_0xcccf('0x33')]())&&_0xdc0374['appType']!==_0xcccf('0x3d')){if(_0xdc0374['answer']){_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374[_0xcccf('0x3')][_0xcccf('0x33')](),'app':_0xcccf('0x16'),'appdata':_0xcccf('0x3e'),'context':_0x51ceda[_0xcccf('0x9')],'exten':_0x51ceda['exten'],'priority':_0xdc0374[_0xcccf('0x30')][_0xcccf('0x1e')]+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374[_0xcccf('0x3')][_0xcccf('0x33')](),'app':_0xcccf('0x5'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x51ceda[_0xcccf('0x9')],'exten':_0x51ceda['exten'],'priority':_0xdc0374[_0xcccf('0x30')]['length']+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});}else{_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374['type'][_0xcccf('0x33')](),'app':'ExecIf','appdata':_0xcccf('0x3f'),'context':_0x51ceda[_0xcccf('0x9')],'exten':_0x51ceda[_0xcccf('0x4')],'priority':_0xdc0374[_0xcccf('0x30')]['length']+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374[_0xcccf('0x3')][_0xcccf('0x33')](),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x40'),'context':_0x51ceda['context'],'exten':_0x51ceda[_0xcccf('0x4')],'priority':_0xdc0374['intervals']['length']+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});}}}}for(var _0x54e435=0x0;_0x54e435<_0xdc0374['intervals'][_0xcccf('0x1e')];_0x54e435++){var _0x25d4da=_0x4d576a+_0xdc0374['intervals'][_0xcccf('0x1e')];var _0x272f07=_0x54e435===_0xdc0374['intervals'][_0xcccf('0x1e')]-0x1?_0x4d576a+_0x4f2f66['length']+_0x5220c8[_0xcccf('0x1e')]+0x2:_0x4d576a+_0x54e435+0x1;_0x4f2f66[_0xcccf('0x41')](_0x54e435,0x0,{'type':_0x51ceda[_0xcccf('0x3')],'app':'GotoIfTime','appdata':_0xdc0374['intervals'][_0x54e435]+'?'+_0x51ceda[_0xcccf('0x9')]+_0xcccf('0x42')+_0x25d4da+':'+_0x51ceda[_0xcccf('0x9')]+',${EXTEN},'+_0x272f07,'exten':_0x51ceda['exten'],'context':_0x51ceda[_0xcccf('0x9')],'priority':_0x4d576a+_0x54e435,'VoiceExtensionId':_0x51ceda['id']});}if(_0xdc0374[_0xcccf('0x43')]===_0xcccf('0x44')){_0xdc0374['appdata']=_0x59edc6(_0x51ceda,_0xdc0374[_0xcccf('0x45')]);}if(_0xdc0374['appType']===_0xcccf('0x46')){_0x4f2f66[_0xcccf('0xb')]({'type':_0xdc0374[_0xcccf('0x3')]['toLowerCase'](),'app':_0xcccf('0x5'),'appdata':_0xcccf('0x47'),'context':_0x51ceda['context'],'exten':_0x51ceda[_0xcccf('0x4')],'priority':_0xdc0374['intervals']['length']+_0x4d576a+_0x4f646d++,'VoiceExtensionId':_0x51ceda['id']});}_0xdc0374[_0xcccf('0x48')]=_0x4f2f66[_0xcccf('0x1e')]?_[_0xcccf('0x49')](_0x4f2f66)['priority']+0x1:_0x4d576a;_0x2ba5d4=_[_0xcccf('0x4a')](_0x2ba5d4,_0x4f2f66,[_0xdc0374],_0x5220c8);_0x4d576a=_[_0xcccf('0x49')](_0x2ba5d4)[_0xcccf('0x48')]+0x1;}return _0x578039(_0x2ba5d4);})[_0xcccf('0x4b')](function(_0x4e8d9f){_0x4160f2(_0x4e8d9f);});});}return _0x10ef72['define'](_0xcccf('0x4c'),attributes,{'tableName':_0xcccf('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37e402){var _0x5cb0a2=this['get']({'plain':!![]});var _0x597531=_0x5cb0a2[_0xcccf('0x3')]==='outbound'?_0x2fa6bc(_0x5cb0a2):_0xfdb49b(_0x5cb0a2);return _0x2ea9bc(_0x5cb0a2,_0x37e402,_[_0xcccf('0x49')](_0x597531)['priority']+0x1)[_0xcccf('0x2e')](function(_0x3faf3a){var _0x323e9f=_[_0xcccf('0x4a')](_0x597531,_0x3faf3a);_0x323e9f['push']({'type':_0x5cb0a2[_0xcccf('0x3')],'app':_0xcccf('0x4e'),'exten':_0x5cb0a2[_0xcccf('0x4')],'context':_0x5cb0a2['context'],'priority':_[_0xcccf('0x49')](_0x323e9f)[_0xcccf('0x48')]+0x1,'VoiceExtensionId':_0x5cb0a2['id']});return _0x323e9f;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 3a8e89a..40deba7 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 _0x87d8=['localhost','socket.io-emitter','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','attributes','limit','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x224ae9,_0x3e5844){var _0x1c8b07=function(_0x2a8c03){while(--_0x2a8c03){_0x224ae9['push'](_0x224ae9['shift']());}};_0x1c8b07(++_0x3e5844);}(_0x87d8,0x1a9));var _0x887d=function(_0x2da563,_0x52eb28){_0x2da563=_0x2da563-0x0;var _0x518093=_0x87d8[_0x2da563];return _0x518093;};'use strict';var _=require('lodash');var util=require(_0x887d('0x0'));var moment=require(_0x887d('0x1'));var BPromise=require(_0x887d('0x2'));var rs=require(_0x887d('0x3'));var fs=require('fs');var Redis=require(_0x887d('0x4'));var db=require(_0x887d('0x5'))['db'];var utils=require(_0x887d('0x6'));var logger=require(_0x887d('0x7'))(_0x887d('0x8'));var config=require(_0x887d('0x9'));var jayson=require(_0x887d('0xa'));var client=jayson[_0x887d('0xb')][_0x887d('0xc')]({'port':0x232a});config[_0x887d('0xd')]=_[_0x887d('0xe')](config['redis'],{'host':_0x887d('0xf'),'port':0x18eb});var socket=require(_0x887d('0x10'))(new Redis(config['redis']));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x56c73a,_0x4396d8,_0x31488d){return new BPromise(function(_0x1f745a,_0x3db821){return client['request'](_0x56c73a,_0x31488d)['then'](function(_0x1aba20){logger[_0x887d('0x11')](_0x887d('0x12'),_0x4396d8,_0x887d('0x13'));logger[_0x887d('0x14')](_0x887d('0x15'),_0x4396d8,_0x887d('0x13'),JSON[_0x887d('0x16')](_0x1aba20));if(_0x1aba20['error']){if(_0x1aba20[_0x887d('0x17')][_0x887d('0x18')]===0x1f4){logger[_0x887d('0x17')]('VoiceExtension,\x20%s,\x20%s',_0x4396d8,_0x1aba20[_0x887d('0x17')][_0x887d('0x19')]);return _0x3db821(_0x1aba20['error']['message']);}logger['error'](_0x887d('0x12'),_0x4396d8,_0x1aba20[_0x887d('0x17')]['message']);return _0x1f745a(_0x1aba20[_0x887d('0x17')][_0x887d('0x19')]);}else{logger[_0x887d('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x4396d8,_0x887d('0x13'));_0x1f745a(_0x1aba20[_0x887d('0x1a')]['message']);}})[_0x887d('0x1b')](function(_0x54481b){logger[_0x887d('0x17')](_0x887d('0x12'),_0x4396d8,_0x54481b);_0x3db821(_0x54481b);});});}exports[_0x887d('0x1c')]=function(_0x99ca6){var _0x2c5a10=this;return new Promise(function(_0x378edb,_0x2efaa8){return db[_0x887d('0x1d')][_0x887d('0x1e')]({'raw':_0x99ca6['options']?_0x99ca6['options'][_0x887d('0x1f')]===undefined?!![]:![]:!![],'where':_0x99ca6['options']?_0x99ca6[_0x887d('0x20')][_0x887d('0x21')]||null:null,'attributes':_0x99ca6[_0x887d('0x20')]?_0x99ca6[_0x887d('0x20')][_0x887d('0x22')]||null:null,'limit':_0x99ca6[_0x887d('0x20')]?_0x99ca6['options'][_0x887d('0x23')]||null:null,'include':_0x99ca6[_0x887d('0x20')]?_0x99ca6['options']['include']?_[_0x887d('0x24')](_0x99ca6[_0x887d('0x20')][_0x887d('0x25')],function(_0x36d9fd){return{'model':db[_0x36d9fd['model']],'as':_0x36d9fd['as'],'attributes':_0x36d9fd[_0x887d('0x22')],'include':_0x36d9fd[_0x887d('0x25')]?_[_0x887d('0x24')](_0x36d9fd['include'],function(_0x2c4883){return{'model':db[_0x2c4883[_0x887d('0x26')]],'as':_0x2c4883['as'],'attributes':_0x2c4883[_0x887d('0x22')],'include':_0x2c4883['include']?_['map'](_0x2c4883[_0x887d('0x25')],function(_0x6bca0){return{'model':db[_0x6bca0['model']],'as':_0x6bca0['as'],'attributes':_0x6bca0['attributes']};}):[]};}):[]};}):[]:[]})[_0x887d('0x27')](function(_0x5768c0){logger[_0x887d('0x11')](_0x887d('0x1c'),_0x99ca6);logger['debug'](_0x887d('0x1c'),_0x99ca6,JSON[_0x887d('0x16')](_0x5768c0));_0x378edb(_0x5768c0);})['catch'](function(_0x5edbe5){logger['error'](_0x887d('0x1c'),_0x5edbe5[_0x887d('0x19')],_0x99ca6);_0x2efaa8(_0x2c5a10[_0x887d('0x17')](0x1f4,_0x5edbe5[_0x887d('0x19')]));});});}; \ No newline at end of file +var _0x1b94=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','include','map','model','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x1b94,0x1f2));var _0x41b9=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x1b94[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x41b9('0x0'));var util=require(_0x41b9('0x1'));var moment=require(_0x41b9('0x2'));var BPromise=require(_0x41b9('0x3'));var rs=require(_0x41b9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41b9('0x5'))['db'];var utils=require(_0x41b9('0x6'));var logger=require(_0x41b9('0x7'))('rpc');var config=require(_0x41b9('0x8'));var jayson=require(_0x41b9('0x9'));var client=jayson[_0x41b9('0xa')]['http']({'port':0x232a});config[_0x41b9('0xb')]=_[_0x41b9('0xc')](config[_0x41b9('0xb')],{'host':_0x41b9('0xd'),'port':0x18eb});var socket=require(_0x41b9('0xe'))(new Redis(config['redis']));require(_0x41b9('0xf'))[_0x41b9('0x10')](socket);function respondWithRpcPromise(_0x4bca88,_0xb0dd9f,_0x386807){return new BPromise(function(_0x4ed664,_0x2ac417){return client[_0x41b9('0x11')](_0x4bca88,_0x386807)['then'](function(_0x11bb6f){logger['info'](_0x41b9('0x12'),_0xb0dd9f,'request\x20sent');logger[_0x41b9('0x13')](_0x41b9('0x14'),_0xb0dd9f,_0x41b9('0x15'),JSON[_0x41b9('0x16')](_0x11bb6f));if(_0x11bb6f[_0x41b9('0x17')]){if(_0x11bb6f['error'][_0x41b9('0x18')]===0x1f4){logger[_0x41b9('0x17')]('VoiceExtension,\x20%s,\x20%s',_0xb0dd9f,_0x11bb6f[_0x41b9('0x17')][_0x41b9('0x19')]);return _0x2ac417(_0x11bb6f[_0x41b9('0x17')][_0x41b9('0x19')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0xb0dd9f,_0x11bb6f['error'][_0x41b9('0x19')]);return _0x4ed664(_0x11bb6f[_0x41b9('0x17')]['message']);}else{logger['info'](_0x41b9('0x12'),_0xb0dd9f,_0x41b9('0x15'));_0x4ed664(_0x11bb6f[_0x41b9('0x1a')][_0x41b9('0x19')]);}})[_0x41b9('0x1b')](function(_0x475aa8){logger['error'](_0x41b9('0x12'),_0xb0dd9f,_0x475aa8);_0x2ac417(_0x475aa8);});});}exports[_0x41b9('0x1c')]=function(_0x5bc794){var _0x155043=this;return new Promise(function(_0x2f6b69,_0x2c205e){return db[_0x41b9('0x1d')][_0x41b9('0x1e')]({'raw':_0x5bc794[_0x41b9('0x1f')]?_0x5bc794['options'][_0x41b9('0x20')]===undefined?!![]:![]:!![],'where':_0x5bc794['options']?_0x5bc794[_0x41b9('0x1f')][_0x41b9('0x21')]||null:null,'attributes':_0x5bc794[_0x41b9('0x1f')]?_0x5bc794[_0x41b9('0x1f')][_0x41b9('0x22')]||null:null,'limit':_0x5bc794['options']?_0x5bc794[_0x41b9('0x1f')]['limit']||null:null,'include':_0x5bc794['options']?_0x5bc794['options'][_0x41b9('0x23')]?_[_0x41b9('0x24')](_0x5bc794[_0x41b9('0x1f')][_0x41b9('0x23')],function(_0x136b46){return{'model':db[_0x136b46[_0x41b9('0x25')]],'as':_0x136b46['as'],'attributes':_0x136b46[_0x41b9('0x22')],'include':_0x136b46[_0x41b9('0x23')]?_[_0x41b9('0x24')](_0x136b46['include'],function(_0x516845){return{'model':db[_0x516845[_0x41b9('0x25')]],'as':_0x516845['as'],'attributes':_0x516845[_0x41b9('0x22')],'include':_0x516845[_0x41b9('0x23')]?_[_0x41b9('0x24')](_0x516845[_0x41b9('0x23')],function(_0x16d96e){return{'model':db[_0x16d96e[_0x41b9('0x25')]],'as':_0x16d96e['as'],'attributes':_0x16d96e[_0x41b9('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5eeb51){logger[_0x41b9('0x26')]('GetVoiceExtension',_0x5bc794);logger[_0x41b9('0x13')]('GetVoiceExtension',_0x5bc794,JSON[_0x41b9('0x16')](_0x5eeb51));_0x2f6b69(_0x5eeb51);})[_0x41b9('0x1b')](function(_0x4be093){logger['error'](_0x41b9('0x1c'),_0x4be093[_0x41b9('0x19')],_0x5bc794);_0x2c205e(_0x155043['error'](0x1f4,_0x4be093[_0x41b9('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index e973d29..8028bec 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1e61c2,_0x388981){_0x1e61c2=_0x1e61c2-0x0;var _0xbc8fa2=_0x1cb9[_0x1e61c2];return _0xbc8fa2;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file +var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1cb9,0x14e));var _0x91cb=function(_0x328f6f,_0x2628f6){_0x328f6f=_0x328f6f-0x0;var _0x2e6d3d=_0x1cb9[_0x328f6f];return _0x2e6d3d;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 9d9cb0f..ec1ee8f 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 _0x4991=['show','/:id/messages','post','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated'];(function(_0x543561,_0x3efefe){var _0x2de230=function(_0x4d16f1){while(--_0x4d16f1){_0x543561['push'](_0x543561['shift']());}};_0x2de230(++_0x3efefe);}(_0x4991,0xf7));var _0x1499=function(_0x4c59c1,_0x2529ec){_0x4c59c1=_0x4c59c1-0x0;var _0x2fc4bd=_0x4991[_0x4c59c1];return _0x2fc4bd;};'use strict';var multer=require(_0x1499('0x0'));var util=require('util');var path=require(_0x1499('0x1'));var timeout=require('connect-timeout');var express=require(_0x1499('0x2'));var router=express[_0x1499('0x3')]();var fs_extra=require(_0x1499('0x4'));var auth=require(_0x1499('0x5'));var interaction=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var controller=require(_0x1499('0x8'));router[_0x1499('0x9')]('/',auth['isAuthenticated'](),controller[_0x1499('0xa')]);router[_0x1499('0x9')](_0x1499('0xb'),auth[_0x1499('0xc')](),controller[_0x1499('0xd')]);router[_0x1499('0x9')](_0x1499('0xe'),auth[_0x1499('0xc')](),controller['getMessages']);router[_0x1499('0xf')]('/',auth[_0x1499('0xc')](),controller['create']);router[_0x1499('0x10')](_0x1499('0xb'),auth['isAuthenticated'](),controller[_0x1499('0x11')]);router[_0x1499('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1499('0x13')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','/:id','isAuthenticated','show','/:id/messages','getMessages','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x37495a,_0x9229dd){var _0x41e1d8=function(_0x6727df){while(--_0x6727df){_0x37495a['push'](_0x37495a['shift']());}};_0x41e1d8(++_0x9229dd);}(_0x4975,0x86));var _0x5497=function(_0x51f2bf,_0xe9dccb){_0x51f2bf=_0x51f2bf-0x0;var _0x2056f4=_0x4975[_0x51f2bf];return _0x2056f4;};'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('0xc'),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/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 254ec07..0bbdcb2 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 _0xb66f=['STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize','exports'];(function(_0x2e7c96,_0x27804d){var _0x36008e=function(_0xd03b6b){while(--_0xd03b6b){_0x2e7c96['push'](_0x2e7c96['shift']());}};_0x36008e(++_0x27804d);}(_0xb66f,0x75));var _0xfb66=function(_0x578232,_0x164631){_0x578232=_0x578232-0x0;var _0x399f13=_0xb66f[_0x578232];return _0x399f13;};'use strict';var Sequelize=require(_0xfb66('0x0'));module[_0xfb66('0x1')]={'customer_id':{'type':Sequelize[_0xfb66('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xfb66('0x3'),'unique':_0xfb66('0x4')},'mailbox':{'type':Sequelize[_0xfb66('0x2')],'defaultValue':'','allowNull':![],'unique':_0xfb66('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xfb66('0x2')]},'email':{'type':Sequelize[_0xfb66('0x2')],'validate':{'isEmail':!![]},'set':function(_0x12b442){this['setDataValue'](_0xfb66('0x5'),typeof _0x12b442==='string'&&_0x12b442[_0xfb66('0x6')]()?_0x12b442['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xfb66('0x2')],'defaultValue':_0xfb66('0x7')},'attach':{'type':Sequelize[_0xfb66('0x8')]('yes','no'),'defaultValue':_0xfb66('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':_0xfb66('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0xfb66('0x2')]},'callback':{'type':Sequelize[_0xfb66('0x2')]},'review':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xfb66('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xfb66('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':_0xfb66('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0xfb66('0x8')](_0xfb66('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xfb66('0x8')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xfb66('0xb')},'emailsubject':{'type':Sequelize[_0xfb66('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xfb66('0xc')],'get':function(){return this['getDataValue'](_0xfb66('0xd'))+_0xfb66('0xe')+this[_0xfb66('0xf')](_0xfb66('0x10'));}}}; \ No newline at end of file +var _0xe5a3=['\x20-\x20','mailbox','exports','STRING','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue'];(function(_0x1790e9,_0x386921){var _0x179951=function(_0x348002){while(--_0x348002){_0x1790e9['push'](_0x1790e9['shift']());}};_0x179951(++_0x386921);}(_0xe5a3,0xe2));var _0x3e5a=function(_0x21c8d9,_0x54b0c4){_0x21c8d9=_0x21c8d9-0x0;var _0x5409eb=_0xe5a3[_0x21c8d9];return _0x5409eb;};'use strict';var Sequelize=require('sequelize');module[_0x3e5a('0x0')]={'customer_id':{'type':Sequelize[_0x3e5a('0x1')]},'context':{'type':Sequelize[_0x3e5a('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x3e5a('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3e5a('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3e5a('0x1')],'validate':{'isEmail':!![]},'set':function(_0xde3f8c){this[_0x3e5a('0x2')](_0x3e5a('0x3'),typeof _0xde3f8c===_0x3e5a('0x4')&&_0xde3f8c[_0x3e5a('0x5')]()?_0xde3f8c[_0x3e5a('0x5')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x3e5a('0x1')],'defaultValue':_0x3e5a('0x6')},'attach':{'type':Sequelize['ENUM'](_0x3e5a('0x7'),'no'),'defaultValue':_0x3e5a('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':_0x3e5a('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3e5a('0x1')]},'callback':{'type':Sequelize[_0x3e5a('0x1')]},'review':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3e5a('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':_0x3e5a('0x7'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3e5a('0x8')](_0x3e5a('0x7'),'no'),'defaultValue':_0x3e5a('0x7'),'allowNull':![]},'stamp':{'type':_0x3e5a('0xa')},'emailsubject':{'type':Sequelize[_0x3e5a('0x1')]},'emailbody':{'type':Sequelize[_0x3e5a('0x1')]},'maxsecs':{'type':Sequelize[_0x3e5a('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3e5a('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3e5a('0xc')],'get':function(){return this[_0x3e5a('0xd')]('fullname')+_0x3e5a('0xe')+this[_0x3e5a('0xd')](_0x3e5a('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 00211a3..b88f0b3 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 _0xe1e3=['set','Content-Range','apply','reject','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','VoiceMail','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','body','VoiceMailMessage','nolimit','order','options','findAndCountAll','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','offset','limit','count','status'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x571916,_0x326e54){_0x571916=_0x571916-0x0;var _0x25452f=_0xe1e3[_0x571916];return _0x25452f;};'use strict';var emlformat=require(_0x3e1e('0x0'));var rimraf=require(_0x3e1e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e1e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e1e('0x3'));var Mustache=require('mustache');var util=require(_0x3e1e('0x4'));var path=require(_0x3e1e('0x5'));var sox=require(_0x3e1e('0x6'));var csv=require(_0x3e1e('0x7'));var ejs=require(_0x3e1e('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1e('0x9'));var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x7'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e47b9,_0x536129){_0x536129=_0x536129||0xcc;return function(_0x5c09a2){if(_0x5c09a2){return _0x4e47b9[_0x3e1e('0x14')](_0x536129);}return _0x4e47b9['status'](_0x536129)['end']();};}function respondWithResult(_0x3a9375,_0x8bd4cd){_0x8bd4cd=_0x8bd4cd||0xc8;return function(_0x78ee54){if(_0x78ee54){return _0x3a9375['status'](_0x8bd4cd)['json'](_0x78ee54);}};}function respondWithFilteredResult(_0x4131a1,_0x1b62e6){return function(_0x4dca60){if(_0x4dca60){var _0x26cb35=typeof _0x1b62e6[_0x3e1e('0x15')]==='undefined'&&typeof _0x1b62e6[_0x3e1e('0x16')]==='undefined';var _0x23228c=_0x4dca60[_0x3e1e('0x17')];var _0x1d786c=_0x26cb35?0x0:_0x1b62e6[_0x3e1e('0x15')];var _0x791ed8=_0x26cb35?_0x4dca60[_0x3e1e('0x17')]:_0x1b62e6['offset']+_0x1b62e6['limit'];var _0x4a9497;if(_0x791ed8>=_0x23228c){_0x791ed8=_0x23228c;_0x4a9497=0xc8;}else{_0x4a9497=0xce;}_0x4131a1[_0x3e1e('0x18')](_0x4a9497);return _0x4131a1[_0x3e1e('0x19')](_0x3e1e('0x1a'),_0x1d786c+'-'+_0x791ed8+'/'+_0x23228c)['json'](_0x4dca60);}return null;};}function patchUpdates(_0x1c5acd){return function(_0x530815){try{jsonpatch[_0x3e1e('0x1b')](_0x530815,_0x1c5acd,!![]);}catch(_0x33ec1d){return BPromise[_0x3e1e('0x1c')](_0x33ec1d);}return _0x530815['save']();};}function saveUpdates(_0x53e051,_0x96396){return function(_0xefa098){if(_0xefa098){return _0xefa098['update'](_0x53e051)['then'](function(_0x13d7ac){return _0x13d7ac;});}return null;};}function removeEntity(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(_0x60e6bc){return _0x60e6bc[_0x3e1e('0x1d')]()[_0x3e1e('0x1e')](function(){var _0x33bf0f=_0x60e6bc[_0x3e1e('0x1f')]({'plain':!![]});var _0x159212=_0x3e1e('0x20');return db[_0x3e1e('0x21')]['destroy']({'where':{'type':_0x159212,'resourceId':_0x33bf0f['id']}})['then'](function(){return _0x60e6bc;});})[_0x3e1e('0x1e')](function(){_0x1b5097[_0x3e1e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be84e,_0x56b9a8){return function(_0x1a33bb){if(!_0x1a33bb){_0x4be84e[_0x3e1e('0x14')](0x194);}return _0x1a33bb;};}function handleError(_0x5b1bd1,_0x52f966){_0x52f966=_0x52f966||0x1f4;return function(_0x5ac814){logger[_0x3e1e('0x22')](_0x5ac814[_0x3e1e('0x23')]);if(_0x5ac814['name']){delete _0x5ac814[_0x3e1e('0x24')];}_0x5b1bd1[_0x3e1e('0x18')](_0x52f966)[_0x3e1e('0x25')](_0x5ac814);};}exports['index']=function(_0xdef39,_0x4ec149){var _0x591c36={},_0x494c75={},_0x39da8d={'count':0x0,'rows':[]};var _0x5b8f95=_['map'](db[_0x3e1e('0x26')][_0x3e1e('0x27')],function(_0x1c57c2){return{'name':_0x1c57c2[_0x3e1e('0x28')],'type':_0x1c57c2[_0x3e1e('0x29')]['key']};});_0x494c75['model']=_['map'](_0x5b8f95,'name');_0x494c75[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0xdef39[_0x3e1e('0x2a')]);_0x494c75[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x494c75[_0x3e1e('0x2e')],_0x494c75[_0x3e1e('0x2a')]);_0x591c36[_0x3e1e('0x2f')]=_['intersection'](_0x494c75[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0xdef39['query'][_0x3e1e('0x30')]));_0x591c36[_0x3e1e('0x2f')]=_0x591c36[_0x3e1e('0x2f')][_0x3e1e('0x31')]?_0x591c36['attributes']:_0x494c75['model'];if(!_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x32')]('nolimit')){_0x591c36[_0x3e1e('0x16')]=qs[_0x3e1e('0x16')](_0xdef39['query'][_0x3e1e('0x16')]);_0x591c36[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x15')]);}_0x591c36['order']=qs[_0x3e1e('0x33')](_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x33')]);_0x591c36[_0x3e1e('0x34')]=qs['filters'](_[_0x3e1e('0x35')](_0xdef39[_0x3e1e('0x2a')],_0x494c75[_0x3e1e('0x2c')]),_0x5b8f95);if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x591c36[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x591c36['where'],{'$or':_[_0x3e1e('0x38')](_0x5b8f95,function(_0x4fdd7c){if(_0x4fdd7c['type']!==_0x3e1e('0x39')){var _0x469a42={};_0x469a42[_0x4fdd7c[_0x3e1e('0x24')]]={'$like':'%'+_0xdef39['query'][_0x3e1e('0x36')]+'%'};return _0x469a42;}})});}_0x591c36=_[_0x3e1e('0x37')]({},_0x591c36,_0xdef39['options']);var _0x16d03f={'where':_0x591c36[_0x3e1e('0x34')]};return db['VoiceMail']['count'](_0x16d03f)[_0x3e1e('0x1e')](function(_0x49e4cb){_0x39da8d['count']=_0x49e4cb;if(_0xdef39[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0x591c36[_0x3e1e('0x3b')]=[{'all':!![]}];}return db[_0x3e1e('0x26')][_0x3e1e('0x3c')](_0x591c36);})['then'](function(_0x5b32ad){_0x39da8d[_0x3e1e('0x3d')]=_0x5b32ad;return _0x39da8d;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4ec149,_0x591c36))[_0x3e1e('0x3e')](handleError(_0x4ec149,null));};exports['show']=function(_0x1124d0,_0x2dcce1){var _0xabe865={'raw':!![],'where':{'id':_0x1124d0[_0x3e1e('0x3f')]['id']}},_0x4ad5fd={};_0x4ad5fd['model']=_['keys'](db[_0x3e1e('0x26')][_0x3e1e('0x27')]);_0x4ad5fd[_0x3e1e('0x2a')]=_[_0x3e1e('0x2b')](_0x1124d0['query']);_0x4ad5fd['filters']=_['intersection'](_0x4ad5fd['model'],_0x4ad5fd[_0x3e1e('0x2a')]);_0xabe865[_0x3e1e('0x2f')]=_['intersection'](_0x4ad5fd['model'],qs[_0x3e1e('0x30')](_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x30')]));_0xabe865['attributes']=_0xabe865[_0x3e1e('0x2f')]['length']?_0xabe865[_0x3e1e('0x2f')]:_0x4ad5fd[_0x3e1e('0x2e')];if(_0x1124d0[_0x3e1e('0x2a')][_0x3e1e('0x3a')]){_0xabe865[_0x3e1e('0x3b')]=[{'all':!![]}];}_0xabe865=_[_0x3e1e('0x37')]({},_0xabe865,_0x1124d0['options']);return db[_0x3e1e('0x26')][_0x3e1e('0x40')](_0xabe865)['then'](handleEntityNotFound(_0x2dcce1,null))[_0x3e1e('0x1e')](respondWithResult(_0x2dcce1,null))[_0x3e1e('0x3e')](handleError(_0x2dcce1,null));};exports['create']=function(_0x1cc820,_0x347b3f){return db[_0x3e1e('0x26')][_0x3e1e('0x41')](_0x1cc820['body'],{})[_0x3e1e('0x1e')](function(_0x3d7303){var _0x29d23b=_0x1cc820[_0x3e1e('0x42')]['get']({'plain':!![]});if(!_0x29d23b)throw new Error(_0x3e1e('0x43'));if(_0x29d23b[_0x3e1e('0x44')]===_0x3e1e('0x42')){var _0x25ddf7=_0x3d7303[_0x3e1e('0x1f')]({'plain':!![]});var _0x1df5a8=_0x3e1e('0x20');return db[_0x3e1e('0x45')]['find']({'where':{'name':_0x1df5a8,'userProfileId':_0x29d23b[_0x3e1e('0x46')]},'raw':!![]})['then'](function(_0x5b0d0d){if(_0x5b0d0d&&_0x5b0d0d['autoAssociation']===0x0){return db[_0x3e1e('0x21')][_0x3e1e('0x41')]({'name':_0x25ddf7['name'],'resourceId':_0x25ddf7['id'],'type':_0x5b0d0d[_0x3e1e('0x24')],'sectionId':_0x5b0d0d['id']},{})['then'](function(){return _0x3d7303;});}else{return _0x3d7303;}})['catch'](function(_0x3eaf76){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3eaf76);throw _0x3eaf76;});}return _0x3d7303;})['then'](respondWithResult(_0x347b3f,0xc9))[_0x3e1e('0x3e')](handleError(_0x347b3f,null));};exports[_0x3e1e('0x47')]=function(_0x1334c8,_0x162a51){if(_0x1334c8[_0x3e1e('0x48')]['id']){delete _0x1334c8[_0x3e1e('0x48')]['id'];}return db[_0x3e1e('0x26')]['find']({'where':{'id':_0x1334c8[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x162a51,null))[_0x3e1e('0x1e')](saveUpdates(_0x1334c8[_0x3e1e('0x48')],null))[_0x3e1e('0x1e')](respondWithResult(_0x162a51,null))['catch'](handleError(_0x162a51,null));};exports['destroy']=function(_0xba8d16,_0xb1456e){return db['VoiceMail'][_0x3e1e('0x40')]({'where':{'id':_0xba8d16['params']['id']}})['then'](handleEntityNotFound(_0xb1456e,null))[_0x3e1e('0x1e')](removeEntity(_0xb1456e,null))[_0x3e1e('0x3e')](handleError(_0xb1456e,null));};exports['getMessages']=function(_0x17bc26,_0x551f12,_0x553451){return db[_0x3e1e('0x26')]['findOne']({'where':{'id':_0x17bc26[_0x3e1e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x551f12,null))[_0x3e1e('0x1e')](function(_0x57d845){var _0x7ea199;var _0x8a4987={},_0x48be40={};_0x48be40['model']=_['keys'](db[_0x3e1e('0x49')][_0x3e1e('0x27')]);_0x48be40[_0x3e1e('0x2a')]=_['keys'](_0x17bc26[_0x3e1e('0x2a')]);_0x48be40[_0x3e1e('0x2c')]=_[_0x3e1e('0x2d')](_0x48be40['model'],_0x48be40['query']);_0x8a4987[_0x3e1e('0x2f')]=_['intersection'](_0x48be40[_0x3e1e('0x2e')],qs[_0x3e1e('0x30')](_0x17bc26[_0x3e1e('0x2a')]['fields']));_0x8a4987[_0x3e1e('0x2f')]=_0x8a4987['attributes'][_0x3e1e('0x31')]?_0x8a4987[_0x3e1e('0x2f')]:_0x48be40['model'];if(!_0x17bc26[_0x3e1e('0x2a')]['hasOwnProperty'](_0x3e1e('0x4a'))){_0x8a4987['limit']=qs[_0x3e1e('0x16')](_0x17bc26['query'][_0x3e1e('0x16')]);_0x8a4987[_0x3e1e('0x15')]=qs[_0x3e1e('0x15')](_0x17bc26['query'][_0x3e1e('0x15')]);}_0x8a4987[_0x3e1e('0x4b')]=qs['sort'](_0x17bc26[_0x3e1e('0x2a')]['sort']);_0x8a4987['where']=qs['filters'](_[_0x3e1e('0x35')](_0x17bc26[_0x3e1e('0x2a')],_0x48be40[_0x3e1e('0x2c')]));if(_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]){_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'$or':_[_0x3e1e('0x38')](_0x8a4987[_0x3e1e('0x2f')],function(_0x4634c0){var _0x2a9c84={};_0x2a9c84[_0x4634c0]={'$like':'%'+_0x17bc26[_0x3e1e('0x2a')][_0x3e1e('0x36')]+'%'};return _0x2a9c84;})});}_0x8a4987[_0x3e1e('0x34')]=_[_0x3e1e('0x37')](_0x8a4987['where'],{'mailboxuser':_0x57d845['mailbox']});_0x8a4987=_[_0x3e1e('0x37')]({},_0x8a4987,_0x17bc26[_0x3e1e('0x4c')]);return db[_0x3e1e('0x49')][_0x3e1e('0x4d')](_0x8a4987)[_0x3e1e('0x1e')](respondWithFilteredResult(_0x551f12,_0x8a4987));})[_0x3e1e('0x3e')](handleError(_0x551f12,null));}; \ No newline at end of file +var _0xbaf0=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','Voicemails','UserProfileResource','then','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user'];(function(_0x5af91e,_0x47dd01){var _0x20b8a1=function(_0x23cb63){while(--_0x23cb63){_0x5af91e['push'](_0x5af91e['shift']());}};_0x20b8a1(++_0x47dd01);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xcc;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0x1b')](_0xe4378c);}return _0x465dd7['status'](_0xe4378c)[_0x0baf('0x1c')]();};}function respondWithResult(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0xc8;return function(_0x1f50c3){if(_0x1f50c3){return _0x49e44b[_0x0baf('0x1d')](_0x1c76a8)[_0x0baf('0x1e')](_0x1f50c3);}};}function respondWithFilteredResult(_0xb8339e,_0x469599){return function(_0x4f80a8){if(_0x4f80a8){var _0x4cd79d=typeof _0x469599[_0x0baf('0x1f')]===_0x0baf('0x20')&&typeof _0x469599[_0x0baf('0x21')]===_0x0baf('0x20');var _0x2cf7da=_0x4f80a8[_0x0baf('0x22')];var _0x53c338=_0x4cd79d?0x0:_0x469599[_0x0baf('0x1f')];var _0xfbecec=_0x4cd79d?_0x4f80a8[_0x0baf('0x22')]:_0x469599[_0x0baf('0x1f')]+_0x469599[_0x0baf('0x21')];var _0x42b7f2;if(_0xfbecec>=_0x2cf7da){_0xfbecec=_0x2cf7da;_0x42b7f2=0xc8;}else{_0x42b7f2=0xce;}_0xb8339e['status'](_0x42b7f2);return _0xb8339e['set'](_0x0baf('0x23'),_0x53c338+'-'+_0xfbecec+'/'+_0x2cf7da)[_0x0baf('0x1e')](_0x4f80a8);}return null;};}function patchUpdates(_0x32e839){return function(_0x1848e8){try{jsonpatch[_0x0baf('0x24')](_0x1848e8,_0x32e839,!![]);}catch(_0x3e3e20){return BPromise[_0x0baf('0x25')](_0x3e3e20);}return _0x1848e8[_0x0baf('0x26')]();};}function saveUpdates(_0x2c42e2,_0x15a2c3){return function(_0x54f2fa){if(_0x54f2fa){return _0x54f2fa[_0x0baf('0x27')](_0x2c42e2)['then'](function(_0xf6c158){return _0xf6c158;});}return null;};}function removeEntity(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(_0x2ef0aa){return _0x2ef0aa['destroy']()['then'](function(){var _0x47c4b=_0x2ef0aa[_0x0baf('0x28')]({'plain':!![]});var _0x34e264=_0x0baf('0x29');return db[_0x0baf('0x2a')]['destroy']({'where':{'type':_0x34e264,'resourceId':_0x47c4b['id']}})[_0x0baf('0x2b')](function(){return _0x2ef0aa;});})[_0x0baf('0x2b')](function(){_0x5dbf00[_0x0baf('0x1d')](0xcc)[_0x0baf('0x1c')]();});}};}function handleEntityNotFound(_0x3843b8,_0x3b9b31){return function(_0x453525){if(!_0x453525){_0x3843b8['sendStatus'](0x194);}return _0x453525;};}function handleError(_0x1590b4,_0x393a5a){_0x393a5a=_0x393a5a||0x1f4;return function(_0xcaf13d){logger[_0x0baf('0x2c')](_0xcaf13d['stack']);if(_0xcaf13d[_0x0baf('0x2d')]){delete _0xcaf13d[_0x0baf('0x2d')];}_0x1590b4['status'](_0x393a5a)[_0x0baf('0x2e')](_0xcaf13d);};}exports[_0x0baf('0x2f')]=function(_0x478ce8,_0xb4dbb1){var _0xd14f0f={},_0x366924={},_0x213a6a={'count':0x0,'rows':[]};var _0x57476f=_[_0x0baf('0x30')](db[_0x0baf('0x31')][_0x0baf('0x32')],function(_0x3ed995){return{'name':_0x3ed995[_0x0baf('0x33')],'type':_0x3ed995[_0x0baf('0x34')][_0x0baf('0x35')]};});_0x366924[_0x0baf('0x36')]=_[_0x0baf('0x30')](_0x57476f,_0x0baf('0x2d'));_0x366924[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x478ce8[_0x0baf('0x37')]);_0x366924[_0x0baf('0x39')]=_['intersection'](_0x366924[_0x0baf('0x36')],_0x366924['query']);_0xd14f0f[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x366924[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x478ce8['query'][_0x0baf('0x3c')]));_0xd14f0f[_0x0baf('0x3a')]=_0xd14f0f['attributes'][_0x0baf('0x3d')]?_0xd14f0f[_0x0baf('0x3a')]:_0x366924[_0x0baf('0x36')];if(!_0x478ce8[_0x0baf('0x37')][_0x0baf('0x3e')](_0x0baf('0x3f'))){_0xd14f0f[_0x0baf('0x21')]=qs[_0x0baf('0x21')](_0x478ce8['query'][_0x0baf('0x21')]);_0xd14f0f[_0x0baf('0x1f')]=qs['offset'](_0x478ce8[_0x0baf('0x37')]['offset']);}_0xd14f0f['order']=qs[_0x0baf('0x40')](_0x478ce8[_0x0baf('0x37')]['sort']);_0xd14f0f['where']=qs[_0x0baf('0x39')](_[_0x0baf('0x41')](_0x478ce8[_0x0baf('0x37')],_0x366924[_0x0baf('0x39')]),_0x57476f);if(_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]){_0xd14f0f[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0xd14f0f[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x57476f,function(_0x200864){if(_0x200864[_0x0baf('0x34')]!==_0x0baf('0x45')){var _0x229ea6={};_0x229ea6[_0x200864['name']]={'$like':'%'+_0x478ce8[_0x0baf('0x37')][_0x0baf('0x42')]+'%'};return _0x229ea6;}})});}_0xd14f0f=_['merge']({},_0xd14f0f,_0x478ce8[_0x0baf('0x46')]);var _0x324369={'where':_0xd14f0f[_0x0baf('0x43')]};return db[_0x0baf('0x31')][_0x0baf('0x22')](_0x324369)[_0x0baf('0x2b')](function(_0x57b581){_0x213a6a[_0x0baf('0x22')]=_0x57b581;if(_0x478ce8[_0x0baf('0x37')]['includeAll']){_0xd14f0f[_0x0baf('0x47')]=[{'all':!![]}];}return db[_0x0baf('0x31')][_0x0baf('0x48')](_0xd14f0f);})[_0x0baf('0x2b')](function(_0x504031){_0x213a6a[_0x0baf('0x49')]=_0x504031;return _0x213a6a;})[_0x0baf('0x2b')](respondWithFilteredResult(_0xb4dbb1,_0xd14f0f))[_0x0baf('0x4a')](handleError(_0xb4dbb1,null));};exports[_0x0baf('0x4b')]=function(_0x2b6d54,_0x385b24){var _0x33da34={'raw':!![],'where':{'id':_0x2b6d54[_0x0baf('0x4c')]['id']}},_0x1fa237={};_0x1fa237[_0x0baf('0x36')]=_['keys'](db[_0x0baf('0x31')][_0x0baf('0x32')]);_0x1fa237[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x2b6d54[_0x0baf('0x37')]);_0x1fa237['filters']=_[_0x0baf('0x3b')](_0x1fa237[_0x0baf('0x36')],_0x1fa237[_0x0baf('0x37')]);_0x33da34[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x1fa237['model'],qs[_0x0baf('0x3c')](_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x3c')]));_0x33da34[_0x0baf('0x3a')]=_0x33da34[_0x0baf('0x3a')][_0x0baf('0x3d')]?_0x33da34[_0x0baf('0x3a')]:_0x1fa237['model'];if(_0x2b6d54[_0x0baf('0x37')][_0x0baf('0x4d')]){_0x33da34[_0x0baf('0x47')]=[{'all':!![]}];}_0x33da34=_['merge']({},_0x33da34,_0x2b6d54[_0x0baf('0x46')]);return db[_0x0baf('0x31')][_0x0baf('0x4e')](_0x33da34)[_0x0baf('0x2b')](handleEntityNotFound(_0x385b24,null))[_0x0baf('0x2b')](respondWithResult(_0x385b24,null))[_0x0baf('0x4a')](handleError(_0x385b24,null));};exports[_0x0baf('0x4f')]=function(_0x5a54bb,_0x22c451){return db[_0x0baf('0x31')][_0x0baf('0x4f')](_0x5a54bb[_0x0baf('0x50')],{})[_0x0baf('0x2b')](function(_0xc427b2){var _0x40d4a6=_0x5a54bb[_0x0baf('0x51')][_0x0baf('0x28')]({'plain':!![]});if(!_0x40d4a6)throw new Error(_0x0baf('0x52'));if(_0x40d4a6[_0x0baf('0x53')]==='user'){var _0x528ff6=_0xc427b2[_0x0baf('0x28')]({'plain':!![]});var _0x3d6b19=_0x0baf('0x29');return db[_0x0baf('0x54')][_0x0baf('0x4e')]({'where':{'name':_0x3d6b19,'userProfileId':_0x40d4a6[_0x0baf('0x55')]},'raw':!![]})[_0x0baf('0x2b')](function(_0x4b492c){if(_0x4b492c&&_0x4b492c[_0x0baf('0x56')]===0x0){return db[_0x0baf('0x2a')][_0x0baf('0x4f')]({'name':_0x528ff6[_0x0baf('0x2d')],'resourceId':_0x528ff6['id'],'type':_0x4b492c[_0x0baf('0x2d')],'sectionId':_0x4b492c['id']},{})[_0x0baf('0x2b')](function(){return _0xc427b2;});}else{return _0xc427b2;}})['catch'](function(_0x3eebe5){logger['error'](_0x0baf('0x57'),_0x3eebe5);throw _0x3eebe5;});}return _0xc427b2;})['then'](respondWithResult(_0x22c451,0xc9))[_0x0baf('0x4a')](handleError(_0x22c451,null));};exports['update']=function(_0x35b1a5,_0x4c035b){if(_0x35b1a5[_0x0baf('0x50')]['id']){delete _0x35b1a5[_0x0baf('0x50')]['id'];}return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0x35b1a5[_0x0baf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c035b,null))[_0x0baf('0x2b')](saveUpdates(_0x35b1a5[_0x0baf('0x50')],null))[_0x0baf('0x2b')](respondWithResult(_0x4c035b,null))[_0x0baf('0x4a')](handleError(_0x4c035b,null));};exports[_0x0baf('0x58')]=function(_0xa19b21,_0x480834){return db[_0x0baf('0x31')][_0x0baf('0x4e')]({'where':{'id':_0xa19b21[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x480834,null))[_0x0baf('0x2b')](removeEntity(_0x480834,null))[_0x0baf('0x4a')](handleError(_0x480834,null));};exports[_0x0baf('0x59')]=function(_0x565292,_0x48e855,_0x23f6ea){return db[_0x0baf('0x31')][_0x0baf('0x5a')]({'where':{'id':_0x565292[_0x0baf('0x4c')]['id']}})[_0x0baf('0x2b')](handleEntityNotFound(_0x48e855,null))[_0x0baf('0x2b')](function(_0xaa4293){var _0x14a667;var _0x3d9a32={},_0x585969={};_0x585969[_0x0baf('0x36')]=_[_0x0baf('0x38')](db[_0x0baf('0x5b')][_0x0baf('0x32')]);_0x585969[_0x0baf('0x37')]=_[_0x0baf('0x38')](_0x565292[_0x0baf('0x37')]);_0x585969['filters']=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],_0x585969[_0x0baf('0x37')]);_0x3d9a32[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x585969[_0x0baf('0x36')],qs[_0x0baf('0x3c')](_0x565292[_0x0baf('0x37')]['fields']));_0x3d9a32[_0x0baf('0x3a')]=_0x3d9a32['attributes'][_0x0baf('0x3d')]?_0x3d9a32['attributes']:_0x585969['model'];if(!_0x565292[_0x0baf('0x37')]['hasOwnProperty'](_0x0baf('0x3f'))){_0x3d9a32[_0x0baf('0x21')]=qs['limit'](_0x565292[_0x0baf('0x37')][_0x0baf('0x21')]);_0x3d9a32[_0x0baf('0x1f')]=qs['offset'](_0x565292['query'][_0x0baf('0x1f')]);}_0x3d9a32[_0x0baf('0x5c')]=qs[_0x0baf('0x40')](_0x565292[_0x0baf('0x37')][_0x0baf('0x40')]);_0x3d9a32['where']=qs[_0x0baf('0x39')](_['pick'](_0x565292['query'],_0x585969['filters']));if(_0x565292[_0x0baf('0x37')]['filter']){_0x3d9a32['where']=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'$or':_[_0x0baf('0x30')](_0x3d9a32[_0x0baf('0x3a')],function(_0x245967){var _0x27ddc7={};_0x27ddc7[_0x245967]={'$like':'%'+_0x565292['query'][_0x0baf('0x42')]+'%'};return _0x27ddc7;})});}_0x3d9a32[_0x0baf('0x43')]=_[_0x0baf('0x44')](_0x3d9a32[_0x0baf('0x43')],{'mailboxuser':_0xaa4293[_0x0baf('0x5d')]});_0x3d9a32=_[_0x0baf('0x44')]({},_0x3d9a32,_0x565292['options']);return db[_0x0baf('0x5b')][_0x0baf('0x5e')](_0x3d9a32)[_0x0baf('0x2b')](respondWithFilteredResult(_0x48e855,_0x3d9a32));})['catch'](handleError(_0x48e855,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2ade185..83ff8f6 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 _0x9d1a=['mailbox_context','mailbox','context','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x3f9f73,_0x5146c6){var _0x3e3ff5=function(_0x4ad221){while(--_0x4ad221){_0x3f9f73['push'](_0x3f9f73['shift']());}};_0x3e3ff5(++_0x5146c6);}(_0x9d1a,0x173));var _0xa9d1=function(_0x83f529,_0x3d55d7){_0x83f529=_0x83f529-0x0;var _0x4383b8=_0x9d1a[_0x83f529];return _0x4383b8;};'use strict';var _=require(_0xa9d1('0x0'));var util=require(_0xa9d1('0x1'));var logger=require(_0xa9d1('0x2'))('api');var moment=require(_0xa9d1('0x3'));var BPromise=require(_0xa9d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9d1('0x5'));var rimraf=require(_0xa9d1('0x6'));var config=require(_0xa9d1('0x7'));var attributes=require(_0xa9d1('0x8'));module[_0xa9d1('0x9')]=function(_0x1696a6,_0x414a8c){return _0x1696a6[_0xa9d1('0xa')](_0xa9d1('0xb'),attributes,{'tableName':_0xa9d1('0xc'),'paranoid':![],'indexes':[{'name':_0xa9d1('0xd'),'fields':[_0xa9d1('0xe'),_0xa9d1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa774=['./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x281f48,_0x4a2cda){var _0x2ce2d4=function(_0xb44062){while(--_0xb44062){_0x281f48['push'](_0x281f48['shift']());}};_0x2ce2d4(++_0x4a2cda);}(_0xa774,0x19c));var _0x4a77=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xa774[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0x4a77('0x0'));var util=require(_0x4a77('0x1'));var logger=require(_0x4a77('0x2'))(_0x4a77('0x3'));var moment=require(_0x4a77('0x4'));var BPromise=require(_0x4a77('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a77('0x6'));var rimraf=require(_0x4a77('0x7'));var config=require('../../config/environment');var attributes=require(_0x4a77('0x8'));module[_0x4a77('0x9')]=function(_0xfcb575,_0x3c4776){return _0xfcb575[_0x4a77('0xa')](_0x4a77('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x4a77('0xc'),'fields':[_0x4a77('0xd'),_0x4a77('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index b436396..b5a0735 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 _0x9460=['http','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x499795,_0x6b8f24){var _0x40b3ce=function(_0xe84831){while(--_0xe84831){_0x499795['push'](_0x499795['shift']());}};_0x40b3ce(++_0x6b8f24);}(_0x9460,0x1aa));var _0x0946=function(_0x303898,_0x565dee){_0x303898=_0x303898-0x0;var _0x4d07dc=_0x9460[_0x303898];return _0x4d07dc;};'use strict';var _=require(_0x0946('0x0'));var util=require(_0x0946('0x1'));var moment=require(_0x0946('0x2'));var BPromise=require('bluebird');var rs=require(_0x0946('0x3'));var fs=require('fs');var Redis=require(_0x0946('0x4'));var db=require(_0x0946('0x5'))['db'];var utils=require(_0x0946('0x6'));var logger=require('../../config/logger')(_0x0946('0x7'));var config=require(_0x0946('0x8'));var jayson=require(_0x0946('0x9'));var client=jayson[_0x0946('0xa')][_0x0946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c1f4e,_0x114ba7,_0x2b9374){return new BPromise(function(_0x2d708c,_0x751b6e){return client['request'](_0x5c1f4e,_0x2b9374)['then'](function(_0x4cbe16){logger['info'](_0x0946('0xc'),_0x114ba7,_0x0946('0xd'));logger[_0x0946('0xe')](_0x0946('0xf'),_0x114ba7,'request\x20sent',JSON[_0x0946('0x10')](_0x4cbe16));if(_0x4cbe16[_0x0946('0x11')]){if(_0x4cbe16[_0x0946('0x11')][_0x0946('0x12')]===0x1f4){logger[_0x0946('0x11')](_0x0946('0xc'),_0x114ba7,_0x4cbe16[_0x0946('0x11')][_0x0946('0x13')]);return _0x751b6e(_0x4cbe16[_0x0946('0x11')][_0x0946('0x13')]);}logger[_0x0946('0x11')]('VoiceMail,\x20%s,\x20%s',_0x114ba7,_0x4cbe16[_0x0946('0x11')][_0x0946('0x13')]);return _0x2d708c(_0x4cbe16[_0x0946('0x11')][_0x0946('0x13')]);}else{logger[_0x0946('0x14')]('VoiceMail,\x20%s,\x20%s',_0x114ba7,'request\x20sent');_0x2d708c(_0x4cbe16[_0x0946('0x15')][_0x0946('0x13')]);}})[_0x0946('0x16')](function(_0x5695bf){logger[_0x0946('0x11')](_0x0946('0xc'),_0x114ba7,_0x5695bf);_0x751b6e(_0x5695bf);});});} \ No newline at end of file +var _0xc1d2=['../../config/environment','jayson/promise','client','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1d2,0xcb));var _0x2c1d=function(_0x1e7d61,_0xd62eab){_0x1e7d61=_0x1e7d61-0x0;var _0x426bd8=_0xc1d2[_0x1e7d61];return _0x426bd8;};'use strict';var _=require(_0x2c1d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2c1d('0x1'));var rs=require(_0x2c1d('0x2'));var fs=require('fs');var Redis=require(_0x2c1d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c1d('0x4'));var logger=require(_0x2c1d('0x5'))(_0x2c1d('0x6'));var config=require(_0x2c1d('0x7'));var jayson=require(_0x2c1d('0x8'));var client=jayson[_0x2c1d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f43fb,_0x28b825,_0x4b9191){return new BPromise(function(_0x140f5a,_0xd5db99){return client[_0x2c1d('0xa')](_0x2f43fb,_0x4b9191)[_0x2c1d('0xb')](function(_0x4217cd){logger['info'](_0x2c1d('0xc'),_0x28b825,_0x2c1d('0xd'));logger[_0x2c1d('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x28b825,_0x2c1d('0xd'),JSON[_0x2c1d('0xf')](_0x4217cd));if(_0x4217cd[_0x2c1d('0x10')]){if(_0x4217cd[_0x2c1d('0x10')][_0x2c1d('0x11')]===0x1f4){logger[_0x2c1d('0x10')](_0x2c1d('0xc'),_0x28b825,_0x4217cd[_0x2c1d('0x10')]['message']);return _0xd5db99(_0x4217cd['error']['message']);}logger[_0x2c1d('0x10')](_0x2c1d('0xc'),_0x28b825,_0x4217cd[_0x2c1d('0x10')][_0x2c1d('0x12')]);return _0x140f5a(_0x4217cd['error'][_0x2c1d('0x12')]);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x28b825,_0x2c1d('0xd'));_0x140f5a(_0x4217cd[_0x2c1d('0x13')][_0x2c1d('0x12')]);}})[_0x2c1d('0x14')](function(_0x25777d){logger[_0x2c1d('0x10')](_0x2c1d('0xc'),_0x28b825,_0x25777d);_0xd5db99(_0x25777d);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index a440211..8e74bea 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 _0x25a2=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','put','update','delete','destroy','exports'];(function(_0x15b718,_0x5ed0a2){var _0x8e7052=function(_0x5cf474){while(--_0x5cf474){_0x15b718['push'](_0x15b718['shift']());}};_0x8e7052(++_0x5ed0a2);}(_0x25a2,0x78));var _0x225a=function(_0xb8e012,_0x132095){_0xb8e012=_0xb8e012-0x0;var _0x33c743=_0x25a2[_0xb8e012];return _0x33c743;};'use strict';var multer=require(_0x225a('0x0'));var util=require(_0x225a('0x1'));var path=require(_0x225a('0x2'));var timeout=require(_0x225a('0x3'));var express=require(_0x225a('0x4'));var router=express[_0x225a('0x5')]();var fs_extra=require(_0x225a('0x6'));var auth=require(_0x225a('0x7'));var interaction=require(_0x225a('0x8'));var config=require(_0x225a('0x9'));var controller=require(_0x225a('0xa'));router[_0x225a('0xb')]('/',auth[_0x225a('0xc')](),controller[_0x225a('0xd')]);router[_0x225a('0xb')](_0x225a('0xe'),auth[_0x225a('0xc')](),controller[_0x225a('0xf')]);router[_0x225a('0xb')](_0x225a('0x10'),auth[_0x225a('0xc')](),controller['download']);router[_0x225a('0x11')]('/',auth['isAuthenticated'](),controller[_0x225a('0x12')]);router[_0x225a('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x225a('0x14')]);router[_0x225a('0x15')](_0x225a('0xe'),auth[_0x225a('0xc')](),controller[_0x225a('0x16')]);module[_0x225a('0x17')]=router; \ No newline at end of file +var _0x8ae6=['index','show','/:id/download','download','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8ae6,0xc3));var _0x68ae=function(_0x572e25,_0x24b3bb){_0x572e25=_0x572e25-0x0;var _0x512208=_0x8ae6[_0x572e25];return _0x512208;};'use strict';var multer=require(_0x68ae('0x0'));var util=require(_0x68ae('0x1'));var path=require(_0x68ae('0x2'));var timeout=require(_0x68ae('0x3'));var express=require(_0x68ae('0x4'));var router=express[_0x68ae('0x5')]();var fs_extra=require(_0x68ae('0x6'));var auth=require(_0x68ae('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x68ae('0x8'));var controller=require(_0x68ae('0x9'));router[_0x68ae('0xa')]('/',auth[_0x68ae('0xb')](),controller[_0x68ae('0xc')]);router[_0x68ae('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x68ae('0xd')]);router[_0x68ae('0xa')](_0x68ae('0xe'),auth[_0x68ae('0xb')](),controller[_0x68ae('0xf')]);router[_0x68ae('0x10')]('/',auth[_0x68ae('0xb')](),controller[_0x68ae('0x11')]);router[_0x68ae('0x12')](_0x68ae('0x13'),auth[_0x68ae('0xb')](),controller['update']);router[_0x68ae('0x14')](_0x68ae('0x13'),auth[_0x68ae('0xb')](),controller[_0x68ae('0x15')]);module[_0x68ae('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index e48c6a7..f54d254 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 _0xaaf7=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','INTEGER','STRING','BLOB'];(function(_0x1231a0,_0x51f142){var _0x13d004=function(_0x822106){while(--_0x822106){_0x1231a0['push'](_0x1231a0['shift']());}};_0x13d004(++_0x51f142);}(_0xaaf7,0x1e4));var _0x7aaf=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0xaaf7[_0x36d203];return _0x2f9e62;};'use strict';var Sequelize=require(_0x7aaf('0x0'));module[_0x7aaf('0x1')]={'name':{'type':Sequelize[_0x7aaf('0x2')],'get':function(_0x426277){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x7aaf('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x7aaf('0x5')](_0x7aaf('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7aaf('0x4')],'defaultValue':''},'stamp':{'type':_0x7aaf('0x7'),'defaultValue':Sequelize[_0x7aaf('0x8')](_0x7aaf('0x9'))}}; \ No newline at end of file +var _0xc858=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','INTEGER','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc858,0xf8));var _0x8c85=function(_0x24d22f,_0xfa6241){_0x24d22f=_0x24d22f-0x0;var _0x33b153=_0xc858[_0x24d22f];return _0x33b153;};'use strict';var Sequelize=require('sequelize');module[_0x8c85('0x0')]={'name':{'type':Sequelize[_0x8c85('0x1')],'get':function(_0x1bdc0d){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x8c85('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x8c85('0x4')](_0x8c85('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x8c85('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x8c85('0x6'),'defaultValue':Sequelize[_0x8c85('0x7')](_0x8c85('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index c0b1835..51bc734 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 _0x7b06=['limit','undefined','count','set','json','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','differenceBy','query','keys','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','Content-Disposition','attachment;\x20filename=\x22','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset'];(function(_0x57c90d,_0x3b5787){var _0x2d0b37=function(_0x3c157c){while(--_0x3c157c){_0x57c90d['push'](_0x57c90d['shift']());}};_0x2d0b37(++_0x3b5787);}(_0x7b06,0xd3));var _0x67b0=function(_0x5bdd93,_0x208ccb){_0x5bdd93=_0x5bdd93-0x0;var _0x2caf5e=_0x7b06[_0x5bdd93];return _0x2caf5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67b0('0x0'));var zipdir=require(_0x67b0('0x1'));var jsonpatch=require(_0x67b0('0x2'));var rp=require(_0x67b0('0x3'));var moment=require('moment');var BPromise=require(_0x67b0('0x4'));var Mustache=require(_0x67b0('0x5'));var util=require(_0x67b0('0x6'));var path=require(_0x67b0('0x7'));var sox=require(_0x67b0('0x8'));var csv=require(_0x67b0('0x9'));var ejs=require(_0x67b0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67b0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x67b0('0xc'));var Papa=require('papaparse');var Redis=require(_0x67b0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x67b0('0xe'));var as=require(_0x67b0('0xf'));var hardwareService=require(_0x67b0('0x10'));var logger=require(_0x67b0('0x11'))('api');var utils=require(_0x67b0('0x12'));var config=require(_0x67b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21ffbf,_0x2a7c9c){_0x2a7c9c=_0x2a7c9c||0xcc;return function(_0xeefee9){if(_0xeefee9){return _0x21ffbf['sendStatus'](_0x2a7c9c);}return _0x21ffbf[_0x67b0('0x14')](_0x2a7c9c)[_0x67b0('0x15')]();};}function respondWithResult(_0x491714,_0x35638f){_0x35638f=_0x35638f||0xc8;return function(_0x2e216e){if(_0x2e216e){return _0x491714[_0x67b0('0x14')](_0x35638f)['json'](_0x2e216e);}};}function respondWithFilteredResult(_0xb07956,_0x27fbaa){return function(_0xa5e8dc){if(_0xa5e8dc){var _0x4f27b9=typeof _0x27fbaa[_0x67b0('0x16')]==='undefined'&&typeof _0x27fbaa[_0x67b0('0x17')]===_0x67b0('0x18');var _0x33106e=_0xa5e8dc[_0x67b0('0x19')];var _0x1363e2=_0x4f27b9?0x0:_0x27fbaa['offset'];var _0x5bc584=_0x4f27b9?_0xa5e8dc[_0x67b0('0x19')]:_0x27fbaa[_0x67b0('0x16')]+_0x27fbaa[_0x67b0('0x17')];var _0x570548;if(_0x5bc584>=_0x33106e){_0x5bc584=_0x33106e;_0x570548=0xc8;}else{_0x570548=0xce;}_0xb07956[_0x67b0('0x14')](_0x570548);return _0xb07956[_0x67b0('0x1a')]('Content-Range',_0x1363e2+'-'+_0x5bc584+'/'+_0x33106e)[_0x67b0('0x1b')](_0xa5e8dc);}return null;};}function patchUpdates(_0x4d370d){return function(_0x441414){try{jsonpatch['apply'](_0x441414,_0x4d370d,!![]);}catch(_0x461166){return BPromise[_0x67b0('0x1c')](_0x461166);}return _0x441414[_0x67b0('0x1d')]();};}function saveUpdates(_0x53ee09,_0x5500c9){return function(_0x27a619){if(_0x27a619){return _0x27a619[_0x67b0('0x1e')](_0x53ee09)[_0x67b0('0x1f')](function(_0x3ef3b4){return _0x3ef3b4;});}return null;};}function removeEntity(_0x351ba3,_0xca4278){return function(_0x28a42e){if(_0x28a42e){return _0x28a42e[_0x67b0('0x20')]()[_0x67b0('0x1f')](function(){_0x351ba3[_0x67b0('0x14')](0xcc)[_0x67b0('0x15')]();});}};}function handleEntityNotFound(_0x560788,_0x13df9d){return function(_0x298b60){if(!_0x298b60){_0x560788[_0x67b0('0x21')](0x194);}return _0x298b60;};}function handleError(_0x176d68,_0x22dd20){_0x22dd20=_0x22dd20||0x1f4;return function(_0x252cc7){logger[_0x67b0('0x22')](_0x252cc7[_0x67b0('0x23')]);if(_0x252cc7['name']){delete _0x252cc7[_0x67b0('0x24')];}_0x176d68['status'](_0x22dd20)[_0x67b0('0x25')](_0x252cc7);};}exports[_0x67b0('0x26')]=function(_0x1d19af,_0x2e47d1){var _0x150228={},_0x41fdd2={},_0x1de787={'count':0x0,'rows':[]};var _0x25f728=_[_0x67b0('0x27')](db['VoiceMailMessage'][_0x67b0('0x28')],function(_0x5736c4){return{'name':_0x5736c4['fieldName'],'type':_0x5736c4[_0x67b0('0x29')]['key']};});_0x41fdd2['model']=_[_0x67b0('0x2a')](_[_0x67b0('0x27')](_0x25f728,_0x67b0('0x24')),[_0x67b0('0x24')]);_0x41fdd2[_0x67b0('0x2b')]=_[_0x67b0('0x2c')](_0x1d19af['query']);_0x41fdd2[_0x67b0('0x2d')]=_[_0x67b0('0x2e')](_0x41fdd2[_0x67b0('0x2f')],_0x41fdd2[_0x67b0('0x2b')]);_0x150228['attributes']=_[_0x67b0('0x2e')](_0x41fdd2['model'],qs['fields'](_0x1d19af['query']['fields']));_0x150228[_0x67b0('0x30')]=_0x150228[_0x67b0('0x30')][_0x67b0('0x31')]?_0x150228['attributes']:_0x41fdd2[_0x67b0('0x2f')];if(!_0x1d19af['query']['hasOwnProperty'](_0x67b0('0x32'))){_0x150228[_0x67b0('0x17')]=qs['limit'](_0x1d19af[_0x67b0('0x2b')][_0x67b0('0x17')]);_0x150228['offset']=qs[_0x67b0('0x16')](_0x1d19af[_0x67b0('0x2b')][_0x67b0('0x16')]);}_0x150228[_0x67b0('0x33')]=qs[_0x67b0('0x34')](_0x1d19af[_0x67b0('0x2b')][_0x67b0('0x34')]);_0x150228[_0x67b0('0x35')]=qs[_0x67b0('0x2d')](_[_0x67b0('0x36')](_0x1d19af[_0x67b0('0x2b')],_0x41fdd2['filters']),_0x25f728);if(_0x1d19af['query'][_0x67b0('0x37')]){_0x150228[_0x67b0('0x35')]=_[_0x67b0('0x38')](_0x150228[_0x67b0('0x35')],{'$or':_[_0x67b0('0x27')](_0x25f728,function(_0x14925b){if(_0x14925b[_0x67b0('0x29')]!==_0x67b0('0x39')){var _0x2a7468={};_0x2a7468[_0x14925b['name']]={'$like':'%'+_0x1d19af[_0x67b0('0x2b')][_0x67b0('0x37')]+'%'};return _0x2a7468;}})});}_0x150228=_['merge']({},_0x150228,_0x1d19af[_0x67b0('0x3a')]);var _0x51776c={'where':_0x150228['where']};return db[_0x67b0('0x3b')][_0x67b0('0x19')](_0x51776c)[_0x67b0('0x1f')](function(_0x383747){_0x1de787[_0x67b0('0x19')]=_0x383747;if(_0x1d19af[_0x67b0('0x2b')][_0x67b0('0x3c')]){_0x150228[_0x67b0('0x3d')]=[{'all':!![]}];}return db[_0x67b0('0x3b')][_0x67b0('0x3e')](_0x150228);})['then'](function(_0x3a7a10){_0x1de787[_0x67b0('0x3f')]=_0x3a7a10;return _0x1de787;})['then'](respondWithFilteredResult(_0x2e47d1,_0x150228))[_0x67b0('0x40')](handleError(_0x2e47d1,null));};exports[_0x67b0('0x41')]=function(_0x4f9ba0,_0x157052){var _0x107163={'raw':!![],'where':{'id':_0x4f9ba0[_0x67b0('0x42')]['id']}},_0x322b22={};_0x322b22[_0x67b0('0x2f')]=_['keys'](db[_0x67b0('0x3b')][_0x67b0('0x28')]);_0x322b22[_0x67b0('0x2b')]=_[_0x67b0('0x2c')](_0x4f9ba0['query']);_0x322b22['filters']=_[_0x67b0('0x2e')](_0x322b22[_0x67b0('0x2f')],_0x322b22[_0x67b0('0x2b')]);_0x107163[_0x67b0('0x30')]=_[_0x67b0('0x2e')](_0x322b22[_0x67b0('0x2f')],qs['fields'](_0x4f9ba0[_0x67b0('0x2b')]['fields']));_0x107163[_0x67b0('0x30')]=_0x107163[_0x67b0('0x30')][_0x67b0('0x31')]?_0x107163[_0x67b0('0x30')]:_0x322b22['model'];if(_0x4f9ba0[_0x67b0('0x2b')][_0x67b0('0x3c')]){_0x107163[_0x67b0('0x3d')]=[{'all':!![]}];}_0x107163=_['merge']({},_0x107163,_0x4f9ba0[_0x67b0('0x3a')]);return db[_0x67b0('0x3b')]['find'](_0x107163)[_0x67b0('0x1f')](handleEntityNotFound(_0x157052,null))[_0x67b0('0x1f')](respondWithResult(_0x157052,null))[_0x67b0('0x40')](handleError(_0x157052,null));};exports['create']=function(_0x49b980,_0x161c36){return db[_0x67b0('0x3b')]['create'](_0x49b980[_0x67b0('0x43')],{})['then'](respondWithResult(_0x161c36,0xc9))[_0x67b0('0x40')](handleError(_0x161c36,null));};exports[_0x67b0('0x1e')]=function(_0x40f8df,_0x429f8c){if(_0x40f8df[_0x67b0('0x43')]['id']){delete _0x40f8df[_0x67b0('0x43')]['id'];}return db[_0x67b0('0x3b')][_0x67b0('0x44')]({'where':{'id':_0x40f8df['params']['id']}})[_0x67b0('0x1f')](handleEntityNotFound(_0x429f8c,null))[_0x67b0('0x1f')](saveUpdates(_0x40f8df['body'],null))['then'](respondWithResult(_0x429f8c,null))[_0x67b0('0x40')](handleError(_0x429f8c,null));};exports['destroy']=function(_0x3a681b,_0x122817){return db[_0x67b0('0x3b')][_0x67b0('0x44')]({'where':{'id':_0x3a681b['params']['id']}})[_0x67b0('0x1f')](handleEntityNotFound(_0x122817,null))[_0x67b0('0x1f')](removeEntity(_0x122817,null))['catch'](handleError(_0x122817,null));};exports[_0x67b0('0x45')]=function(_0x982adf,_0x553437,_0x57cd7e){return db['VoiceMailMessage'][_0x67b0('0x44')]({'where':{'id':_0x982adf['params']['id']},'attributes':['id',_0x67b0('0x46'),'msg_id']})[_0x67b0('0x1f')](handleEntityNotFound(_0x553437,null))[_0x67b0('0x1f')](function(_0x5aa283){if(_0x5aa283){if(!_0x5aa283[_0x67b0('0x46')]){throw new db[(_0x67b0('0x47'))][(_0x67b0('0x48'))](_0x67b0('0x49'));}var _0x22a7b8={'Content-Type':_0x67b0('0x4a'),'Content-Disposition':'attachment'};if(_0x5aa283[_0x67b0('0x4b')]){_0x22a7b8[_0x67b0('0x4c')]=_0x67b0('0x4d')+_0x5aa283[_0x67b0('0x4b')]+'.wav\x22';}_0x553437['set'](_0x22a7b8);return _0x553437[_0x67b0('0x25')](new Buffer(_0x5aa283['recording']));}})[_0x67b0('0x40')](handleError(_0x553437,null));}; \ No newline at end of file +var _0x9372=['options','include','rows','catch','show','params','keys','length','includeAll','find','create','update','body','destroy','msg_id','recording','Sequelize','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x9372,0x6b));var _0x2937=function(_0x5db061,_0xa789c){_0x5db061=_0x5db061-0x0;var _0x129fb8=_0x9372[_0x5db061];return _0x129fb8;};'use strict';var emlformat=require(_0x2937('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2937('0x1'));var jsonpatch=require(_0x2937('0x2'));var rp=require(_0x2937('0x3'));var moment=require(_0x2937('0x4'));var BPromise=require(_0x2937('0x5'));var Mustache=require(_0x2937('0x6'));var util=require(_0x2937('0x7'));var path=require('path');var sox=require(_0x2937('0x8'));var csv=require('to-csv');var ejs=require(_0x2937('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2937('0xa'));var crypto=require(_0x2937('0xb'));var jsforce=require(_0x2937('0xc'));var deskjs=require(_0x2937('0xd'));var toCsv=require(_0x2937('0xe'));var querystring=require('querystring');var Papa=require(_0x2937('0xf'));var Redis=require(_0x2937('0x10'));var authService=require(_0x2937('0x11'));var qs=require(_0x2937('0x12'));var as=require(_0x2937('0x13'));var hardwareService=require(_0x2937('0x14'));var logger=require(_0x2937('0x15'))(_0x2937('0x16'));var utils=require(_0x2937('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2937('0x18'));var db=require(_0x2937('0x19'))['db'];function respondWithStatusCode(_0x52b021,_0x11400e){_0x11400e=_0x11400e||0xcc;return function(_0x21fab5){if(_0x21fab5){return _0x52b021[_0x2937('0x1a')](_0x11400e);}return _0x52b021[_0x2937('0x1b')](_0x11400e)[_0x2937('0x1c')]();};}function respondWithResult(_0x54b7b1,_0x2b9dd2){_0x2b9dd2=_0x2b9dd2||0xc8;return function(_0x5d78e2){if(_0x5d78e2){return _0x54b7b1[_0x2937('0x1b')](_0x2b9dd2)[_0x2937('0x1d')](_0x5d78e2);}};}function respondWithFilteredResult(_0x14af8e,_0x41c197){return function(_0xede5ba){if(_0xede5ba){var _0x113443=typeof _0x41c197[_0x2937('0x1e')]===_0x2937('0x1f')&&typeof _0x41c197[_0x2937('0x20')]===_0x2937('0x1f');var _0x48315f=_0xede5ba[_0x2937('0x21')];var _0x399189=_0x113443?0x0:_0x41c197[_0x2937('0x1e')];var _0x3e83d5=_0x113443?_0xede5ba[_0x2937('0x21')]:_0x41c197[_0x2937('0x1e')]+_0x41c197[_0x2937('0x20')];var _0x441349;if(_0x3e83d5>=_0x48315f){_0x3e83d5=_0x48315f;_0x441349=0xc8;}else{_0x441349=0xce;}_0x14af8e['status'](_0x441349);return _0x14af8e[_0x2937('0x22')](_0x2937('0x23'),_0x399189+'-'+_0x3e83d5+'/'+_0x48315f)[_0x2937('0x1d')](_0xede5ba);}return null;};}function patchUpdates(_0x9fce71){return function(_0xc7b60e){try{jsonpatch[_0x2937('0x24')](_0xc7b60e,_0x9fce71,!![]);}catch(_0x53191a){return BPromise[_0x2937('0x25')](_0x53191a);}return _0xc7b60e[_0x2937('0x26')]();};}function saveUpdates(_0x18af41,_0xb33932){return function(_0x31ebd8){if(_0x31ebd8){return _0x31ebd8['update'](_0x18af41)[_0x2937('0x27')](function(_0x1f0d86){return _0x1f0d86;});}return null;};}function removeEntity(_0x3fa375,_0x5b289b){return function(_0x576fbb){if(_0x576fbb){return _0x576fbb['destroy']()[_0x2937('0x27')](function(){_0x3fa375[_0x2937('0x1b')](0xcc)[_0x2937('0x1c')]();});}};}function handleEntityNotFound(_0x1496e5,_0x5685fd){return function(_0x5c17a4){if(!_0x5c17a4){_0x1496e5[_0x2937('0x1a')](0x194);}return _0x5c17a4;};}function handleError(_0x59b113,_0x22dfbc){_0x22dfbc=_0x22dfbc||0x1f4;return function(_0x5748a9){logger['error'](_0x5748a9[_0x2937('0x28')]);if(_0x5748a9[_0x2937('0x29')]){delete _0x5748a9['name'];}_0x59b113[_0x2937('0x1b')](_0x22dfbc)['send'](_0x5748a9);};}exports[_0x2937('0x2a')]=function(_0x1992cb,_0x15910a){var _0x4c8b29={},_0x138b27={},_0x46ceda={'count':0x0,'rows':[]};var _0x16a413=_[_0x2937('0x2b')](db[_0x2937('0x2c')][_0x2937('0x2d')],function(_0xa87ab7){return{'name':_0xa87ab7[_0x2937('0x2e')],'type':_0xa87ab7[_0x2937('0x2f')][_0x2937('0x30')]};});_0x138b27[_0x2937('0x31')]=_['differenceBy'](_[_0x2937('0x2b')](_0x16a413,_0x2937('0x29')),[_0x2937('0x29')]);_0x138b27[_0x2937('0x32')]=_['keys'](_0x1992cb[_0x2937('0x32')]);_0x138b27[_0x2937('0x33')]=_['intersection'](_0x138b27[_0x2937('0x31')],_0x138b27[_0x2937('0x32')]);_0x4c8b29[_0x2937('0x34')]=_[_0x2937('0x35')](_0x138b27[_0x2937('0x31')],qs[_0x2937('0x36')](_0x1992cb[_0x2937('0x32')]['fields']));_0x4c8b29[_0x2937('0x34')]=_0x4c8b29[_0x2937('0x34')]['length']?_0x4c8b29[_0x2937('0x34')]:_0x138b27[_0x2937('0x31')];if(!_0x1992cb['query'][_0x2937('0x37')]('nolimit')){_0x4c8b29[_0x2937('0x20')]=qs['limit'](_0x1992cb[_0x2937('0x32')]['limit']);_0x4c8b29[_0x2937('0x1e')]=qs[_0x2937('0x1e')](_0x1992cb[_0x2937('0x32')][_0x2937('0x1e')]);}_0x4c8b29[_0x2937('0x38')]=qs[_0x2937('0x39')](_0x1992cb['query']['sort']);_0x4c8b29[_0x2937('0x3a')]=qs['filters'](_[_0x2937('0x3b')](_0x1992cb[_0x2937('0x32')],_0x138b27[_0x2937('0x33')]),_0x16a413);if(_0x1992cb[_0x2937('0x32')][_0x2937('0x3c')]){_0x4c8b29['where']=_[_0x2937('0x3d')](_0x4c8b29[_0x2937('0x3a')],{'$or':_['map'](_0x16a413,function(_0x134f98){if(_0x134f98[_0x2937('0x2f')]!==_0x2937('0x3e')){var _0x50e66b={};_0x50e66b[_0x134f98[_0x2937('0x29')]]={'$like':'%'+_0x1992cb[_0x2937('0x32')][_0x2937('0x3c')]+'%'};return _0x50e66b;}})});}_0x4c8b29=_[_0x2937('0x3d')]({},_0x4c8b29,_0x1992cb[_0x2937('0x3f')]);var _0x468d94={'where':_0x4c8b29[_0x2937('0x3a')]};return db[_0x2937('0x2c')]['count'](_0x468d94)[_0x2937('0x27')](function(_0x4d3820){_0x46ceda['count']=_0x4d3820;if(_0x1992cb['query']['includeAll']){_0x4c8b29[_0x2937('0x40')]=[{'all':!![]}];}return db[_0x2937('0x2c')]['findAll'](_0x4c8b29);})[_0x2937('0x27')](function(_0x75f37b){_0x46ceda[_0x2937('0x41')]=_0x75f37b;return _0x46ceda;})[_0x2937('0x27')](respondWithFilteredResult(_0x15910a,_0x4c8b29))[_0x2937('0x42')](handleError(_0x15910a,null));};exports[_0x2937('0x43')]=function(_0x5650a9,_0x26c823){var _0x12b758={'raw':!![],'where':{'id':_0x5650a9[_0x2937('0x44')]['id']}},_0x235dd3={};_0x235dd3[_0x2937('0x31')]=_[_0x2937('0x45')](db[_0x2937('0x2c')][_0x2937('0x2d')]);_0x235dd3['query']=_['keys'](_0x5650a9[_0x2937('0x32')]);_0x235dd3['filters']=_[_0x2937('0x35')](_0x235dd3[_0x2937('0x31')],_0x235dd3['query']);_0x12b758['attributes']=_[_0x2937('0x35')](_0x235dd3[_0x2937('0x31')],qs[_0x2937('0x36')](_0x5650a9['query'][_0x2937('0x36')]));_0x12b758['attributes']=_0x12b758[_0x2937('0x34')][_0x2937('0x46')]?_0x12b758[_0x2937('0x34')]:_0x235dd3[_0x2937('0x31')];if(_0x5650a9[_0x2937('0x32')][_0x2937('0x47')]){_0x12b758[_0x2937('0x40')]=[{'all':!![]}];}_0x12b758=_[_0x2937('0x3d')]({},_0x12b758,_0x5650a9[_0x2937('0x3f')]);return db[_0x2937('0x2c')][_0x2937('0x48')](_0x12b758)[_0x2937('0x27')](handleEntityNotFound(_0x26c823,null))[_0x2937('0x27')](respondWithResult(_0x26c823,null))[_0x2937('0x42')](handleError(_0x26c823,null));};exports['create']=function(_0x2e7afa,_0x146f4e){return db[_0x2937('0x2c')][_0x2937('0x49')](_0x2e7afa['body'],{})[_0x2937('0x27')](respondWithResult(_0x146f4e,0xc9))[_0x2937('0x42')](handleError(_0x146f4e,null));};exports[_0x2937('0x4a')]=function(_0x29caeb,_0x717678){if(_0x29caeb[_0x2937('0x4b')]['id']){delete _0x29caeb[_0x2937('0x4b')]['id'];}return db[_0x2937('0x2c')][_0x2937('0x48')]({'where':{'id':_0x29caeb['params']['id']}})['then'](handleEntityNotFound(_0x717678,null))[_0x2937('0x27')](saveUpdates(_0x29caeb[_0x2937('0x4b')],null))['then'](respondWithResult(_0x717678,null))['catch'](handleError(_0x717678,null));};exports[_0x2937('0x4c')]=function(_0xba107,_0x108153){return db[_0x2937('0x2c')][_0x2937('0x48')]({'where':{'id':_0xba107[_0x2937('0x44')]['id']}})[_0x2937('0x27')](handleEntityNotFound(_0x108153,null))[_0x2937('0x27')](removeEntity(_0x108153,null))['catch'](handleError(_0x108153,null));};exports['download']=function(_0x735897,_0x284b8e,_0x3e7008){return db['VoiceMailMessage'][_0x2937('0x48')]({'where':{'id':_0x735897[_0x2937('0x44')]['id']},'attributes':['id','recording',_0x2937('0x4d')]})[_0x2937('0x27')](handleEntityNotFound(_0x284b8e,null))[_0x2937('0x27')](function(_0x4f6b76){if(_0x4f6b76){if(!_0x4f6b76[_0x2937('0x4e')]){throw new db[(_0x2937('0x4f'))][(_0x2937('0x50'))]('VoiceMailMessage\x20not\x20found');}var _0x17ae7f={'Content-Type':_0x2937('0x51'),'Content-Disposition':_0x2937('0x52')};if(_0x4f6b76[_0x2937('0x4d')]){_0x17ae7f[_0x2937('0x53')]=_0x2937('0x54')+_0x4f6b76[_0x2937('0x4d')]+'.wav\x22';}_0x284b8e[_0x2937('0x22')](_0x17ae7f);return _0x284b8e['send'](new Buffer(_0x4f6b76[_0x2937('0x4e')]));}})[_0x2937('0x42')](handleError(_0x284b8e,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index dde5fec..b01730a 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 _0x2172=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x2172,0x1cb));var _0x2217=function(_0x5a9cb4,_0x18ac0c){_0x5a9cb4=_0x5a9cb4-0x0;var _0x480931=_0x2172[_0x5a9cb4];return _0x480931;};'use strict';var _=require(_0x2217('0x0'));var util=require('util');var logger=require(_0x2217('0x1'))(_0x2217('0x2'));var moment=require(_0x2217('0x3'));var BPromise=require(_0x2217('0x4'));var rp=require(_0x2217('0x5'));var fs=require('fs');var path=require(_0x2217('0x6'));var rimraf=require('rimraf');var config=require(_0x2217('0x7'));var attributes=require('./voiceMailMessage.attributes');module[_0x2217('0x8')]=function(_0x228d3d,_0x50b0a1){return _0x228d3d[_0x2217('0x9')](_0x2217('0xa'),attributes,{'tableName':_0x2217('0xb'),'paranoid':![],'indexes':[{'name':_0x2217('0xc'),'fields':[_0x2217('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xff9f=['dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages'];(function(_0x2bcddb,_0x3eaf37){var _0x12a9e8=function(_0xeeb678){while(--_0xeeb678){_0x2bcddb['push'](_0x2bcddb['shift']());}};_0x12a9e8(++_0x3eaf37);}(_0xff9f,0xe2));var _0xfff9=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0xff9f[_0x5a7d41];return _0x98d8fa;};'use strict';var _=require(_0xfff9('0x0'));var util=require(_0xfff9('0x1'));var logger=require(_0xfff9('0x2'))(_0xfff9('0x3'));var moment=require(_0xfff9('0x4'));var BPromise=require(_0xfff9('0x5'));var rp=require(_0xfff9('0x6'));var fs=require('fs');var path=require(_0xfff9('0x7'));var rimraf=require('rimraf');var config=require(_0xfff9('0x8'));var attributes=require(_0xfff9('0x9'));module[_0xfff9('0xa')]=function(_0x2e703e,_0x4aca1c){return _0x2e703e[_0xfff9('0xb')](_0xfff9('0xc'),attributes,{'tableName':_0xfff9('0xd'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xfff9('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 4f0d51e..be036b6 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 _0x99c1=['../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','VoiceMailMessage,\x20%s,\x20%s','info','catch','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x52e7cb,_0x535571){var _0x214fff=function(_0x767cf9){while(--_0x767cf9){_0x52e7cb['push'](_0x52e7cb['shift']());}};_0x214fff(++_0x535571);}(_0x99c1,0x18b));var _0x199c=function(_0x19401f,_0x2a3f4c){_0x19401f=_0x19401f-0x0;var _0x1189a9=_0x99c1[_0x19401f];return _0x1189a9;};'use strict';var _=require('lodash');var util=require(_0x199c('0x0'));var moment=require(_0x199c('0x1'));var BPromise=require('bluebird');var rs=require(_0x199c('0x2'));var fs=require('fs');var Redis=require(_0x199c('0x3'));var db=require(_0x199c('0x4'))['db'];var utils=require(_0x199c('0x5'));var logger=require(_0x199c('0x6'))(_0x199c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x199c('0x8')][_0x199c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x360465,_0x4c8e1e,_0x2e7a77){return new BPromise(function(_0xaaab6,_0x23d767){return client[_0x199c('0xa')](_0x360465,_0x2e7a77)[_0x199c('0xb')](function(_0x48372e){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4c8e1e,_0x199c('0xc'));logger['debug'](_0x199c('0xd'),_0x4c8e1e,_0x199c('0xc'),JSON['stringify'](_0x48372e));if(_0x48372e['error']){if(_0x48372e[_0x199c('0xe')][_0x199c('0xf')]===0x1f4){logger[_0x199c('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c8e1e,_0x48372e['error']['message']);return _0x23d767(_0x48372e[_0x199c('0xe')][_0x199c('0x10')]);}logger[_0x199c('0xe')](_0x199c('0x11'),_0x4c8e1e,_0x48372e[_0x199c('0xe')][_0x199c('0x10')]);return _0xaaab6(_0x48372e[_0x199c('0xe')][_0x199c('0x10')]);}else{logger[_0x199c('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x4c8e1e,_0x199c('0xc'));_0xaaab6(_0x48372e['result']['message']);}})[_0x199c('0x13')](function(_0x250f71){logger[_0x199c('0xe')](_0x199c('0x11'),_0x4c8e1e,_0x250f71);_0x23d767(_0x250f71);});});} \ No newline at end of file +var _0x576d=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code'];(function(_0xa19250,_0x43a93e){var _0xe9768b=function(_0x3db0c7){while(--_0x3db0c7){_0xa19250['push'](_0xa19250['shift']());}};_0xe9768b(++_0x43a93e);}(_0x576d,0x1ce));var _0xd576=function(_0x10b643,_0xd6eb6b){_0x10b643=_0x10b643-0x0;var _0x4c6d7c=_0x576d[_0x10b643];return _0x4c6d7c;};'use strict';var _=require(_0xd576('0x0'));var util=require(_0xd576('0x1'));var moment=require(_0xd576('0x2'));var BPromise=require('bluebird');var rs=require(_0xd576('0x3'));var fs=require('fs');var Redis=require(_0xd576('0x4'));var db=require(_0xd576('0x5'))['db'];var utils=require(_0xd576('0x6'));var logger=require(_0xd576('0x7'))('rpc');var config=require(_0xd576('0x8'));var jayson=require(_0xd576('0x9'));var client=jayson[_0xd576('0xa')][_0xd576('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2af2c0,_0xc6e91f,_0x58bc20){return new BPromise(function(_0x18e402,_0x168545){return client[_0xd576('0xc')](_0x2af2c0,_0x58bc20)[_0xd576('0xd')](function(_0x204844){logger[_0xd576('0xe')](_0xd576('0xf'),_0xc6e91f,_0xd576('0x10'));logger[_0xd576('0x11')](_0xd576('0x12'),_0xc6e91f,_0xd576('0x10'),JSON['stringify'](_0x204844));if(_0x204844[_0xd576('0x13')]){if(_0x204844['error'][_0xd576('0x14')]===0x1f4){logger[_0xd576('0x13')](_0xd576('0xf'),_0xc6e91f,_0x204844[_0xd576('0x13')][_0xd576('0x15')]);return _0x168545(_0x204844[_0xd576('0x13')]['message']);}logger[_0xd576('0x13')](_0xd576('0xf'),_0xc6e91f,_0x204844[_0xd576('0x13')][_0xd576('0x15')]);return _0x18e402(_0x204844[_0xd576('0x13')][_0xd576('0x15')]);}else{logger[_0xd576('0xe')](_0xd576('0xf'),_0xc6e91f,_0xd576('0x10'));_0x18e402(_0x204844[_0xd576('0x16')][_0xd576('0x15')]);}})['catch'](function(_0x475d3e){logger[_0xd576('0x13')](_0xd576('0xf'),_0xc6e91f,_0x475d3e);_0x168545(_0x475d3e);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 65162f7..e311eba 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 _0x15e0=['show','/:id/sounds','getSounds','post','create','update','delete','/:id/sounds/:id2','removeSound','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated'];(function(_0x1696e5,_0x149e73){var _0x1d5afd=function(_0x3d2222){while(--_0x3d2222){_0x1696e5['push'](_0x1696e5['shift']());}};_0x1d5afd(++_0x149e73);}(_0x15e0,0xb1));var _0x015e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15e0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x015e('0x0'));var util=require(_0x015e('0x1'));var path=require('path');var timeout=require(_0x015e('0x2'));var express=require('express');var router=express[_0x015e('0x3')]();var fs_extra=require(_0x015e('0x4'));var auth=require(_0x015e('0x5'));var interaction=require(_0x015e('0x6'));var config=require(_0x015e('0x7'));var controller=require(_0x015e('0x8'));router[_0x015e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x015e('0x9')](_0x015e('0xa'),auth[_0x015e('0xb')](),controller[_0x015e('0xc')]);router[_0x015e('0x9')](_0x015e('0xd'),auth[_0x015e('0xb')](),controller[_0x015e('0xe')]);router[_0x015e('0xf')]('/',auth[_0x015e('0xb')](),controller[_0x015e('0x10')]);router[_0x015e('0xf')](_0x015e('0xd'),auth[_0x015e('0xb')](),controller['addSound']);router['put']('/:id',auth[_0x015e('0xb')](),controller[_0x015e('0x11')]);router[_0x015e('0x12')](_0x015e('0xa'),auth[_0x015e('0xb')](),controller['destroy']);router[_0x015e('0x12')](_0x015e('0x13'),auth[_0x015e('0xb')](),controller[_0x015e('0x14')]);module['exports']=router; \ No newline at end of file +var _0x62a7=['/:id/sounds','getSounds','create','/:id','update','delete','destroy','removeSound','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index'];(function(_0x5b1f34,_0x268f0c){var _0x276ff5=function(_0x5753cf){while(--_0x5753cf){_0x5b1f34['push'](_0x5b1f34['shift']());}};_0x276ff5(++_0x268f0c);}(_0x62a7,0x121));var _0x762a=function(_0x4e7f3f,_0x5c57da){_0x4e7f3f=_0x4e7f3f-0x0;var _0x441fd2=_0x62a7[_0x4e7f3f];return _0x441fd2;};'use strict';var multer=require(_0x762a('0x0'));var util=require(_0x762a('0x1'));var path=require(_0x762a('0x2'));var timeout=require(_0x762a('0x3'));var express=require('express');var router=express[_0x762a('0x4')]();var fs_extra=require(_0x762a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x762a('0x6'));var config=require('../../config/environment');var controller=require(_0x762a('0x7'));router[_0x762a('0x8')]('/',auth[_0x762a('0x9')](),controller[_0x762a('0xa')]);router[_0x762a('0x8')]('/:id',auth[_0x762a('0x9')](),controller['show']);router[_0x762a('0x8')](_0x762a('0xb'),auth['isAuthenticated'](),controller[_0x762a('0xc')]);router['post']('/',auth[_0x762a('0x9')](),controller[_0x762a('0xd')]);router['post'](_0x762a('0xb'),auth[_0x762a('0x9')](),controller['addSound']);router['put'](_0x762a('0xe'),auth['isAuthenticated'](),controller[_0x762a('0xf')]);router[_0x762a('0x10')]('/:id',auth[_0x762a('0x9')](),controller[_0x762a('0x11')]);router[_0x762a('0x10')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x762a('0x12')]);module[_0x762a('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index c4ce243..819d517 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 _0xd02d=['custom','files','quietmp3nb','quietmp3','mp3','STRING','alpha','BOOLEAN','sequelize','exports','name','ENUM'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0xd02d,0x128));var _0xdd02=function(_0x44a136,_0x276d95){_0x44a136=_0x44a136-0x0;var _0x2efa92=_0xd02d[_0x44a136];return _0x2efa92;};'use strict';var Sequelize=require(_0xdd02('0x0'));module[_0xdd02('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdd02('0x2')},'mode':{'type':Sequelize[_0xdd02('0x3')](_0xdd02('0x4'),_0xdd02('0x5'),'mp3nb',_0xdd02('0x6'),_0xdd02('0x7'),_0xdd02('0x8')),'allowNull':!![],'defaultValue':_0xdd02('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xdd02('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdd02('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdd02('0x9')],'allowNull':!![],'defaultValue':_0xdd02('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xdd02('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa072=['quietmp3','mp3','STRING','alpha','TIMESTAMP','BOOLEAN','exports','name','ENUM','files','mp3nb','quietmp3nb'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xa072,0xde));var _0x2a07=function(_0x352b44,_0x4a91a1){_0x352b44=_0x352b44-0x0;var _0x3e8baa=_0xa072[_0x352b44];return _0x3e8baa;};'use strict';var Sequelize=require('sequelize');module[_0x2a07('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2a07('0x1')},'mode':{'type':Sequelize[_0x2a07('0x2')]('custom',_0x2a07('0x3'),_0x2a07('0x4'),_0x2a07('0x5'),_0x2a07('0x6'),_0x2a07('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x2a07('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x2a07('0x8')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2a07('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2a07('0x8')],'allowNull':!![],'defaultValue':_0x2a07('0x9')},'format':{'type':Sequelize[_0x2a07('0x8')],'allowNull':!![]},'stamp':{'type':_0x2a07('0xa')},'defaultEntry':{'type':Sequelize[_0x2a07('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 911336a..a4d6c50 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 _0xceda=['message','addSound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','Sequelize','ValidationError','removeSound','id2','Sound','getSounds','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','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','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','index','map','VoiceMusicOnHold','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','sequelize','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','readdirSync','forEach','unlinkSync','rmdirSync'];(function(_0x17f734,_0x10036e){var _0x39de6d=function(_0x50e419){while(--_0x50e419){_0x17f734['push'](_0x17f734['shift']());}};_0x39de6d(++_0x10036e);}(_0xceda,0xfe));var _0xaced=function(_0x5d7250,_0x256121){_0x5d7250=_0x5d7250-0x0;var _0x484c8f=_0xceda[_0x5d7250];return _0x484c8f;};'use strict';var emlformat=require(_0xaced('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaced('0x1'));var jsonpatch=require(_0xaced('0x2'));var rp=require(_0xaced('0x3'));var moment=require('moment');var BPromise=require(_0xaced('0x4'));var Mustache=require('mustache');var util=require(_0xaced('0x5'));var path=require(_0xaced('0x6'));var sox=require(_0xaced('0x7'));var csv=require(_0xaced('0x8'));var ejs=require(_0xaced('0x9'));var fs=require('fs');var fs_extra=require(_0xaced('0xa'));var _=require(_0xaced('0xb'));var squel=require(_0xaced('0xc'));var crypto=require(_0xaced('0xd'));var jsforce=require(_0xaced('0xe'));var deskjs=require(_0xaced('0xf'));var toCsv=require(_0xaced('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaced('0x10'));var authService=require(_0xaced('0x11'));var qs=require(_0xaced('0x12'));var as=require(_0xaced('0x13'));var hardwareService=require(_0xaced('0x14'));var logger=require(_0xaced('0x15'))(_0xaced('0x16'));var utils=require('../../config/utils');var config=require(_0xaced('0x17'));var licenseUtil=require(_0xaced('0x18'));var db=require(_0xaced('0x19'))['db'];function respondWithStatusCode(_0x1a3961,_0x485e4e){_0x485e4e=_0x485e4e||0xcc;return function(_0x12c900){if(_0x12c900){return _0x1a3961[_0xaced('0x1a')](_0x485e4e);}return _0x1a3961[_0xaced('0x1b')](_0x485e4e)[_0xaced('0x1c')]();};}function respondWithResult(_0x1e156e,_0x28336c){_0x28336c=_0x28336c||0xc8;return function(_0x45a850){if(_0x45a850){return _0x1e156e[_0xaced('0x1b')](_0x28336c)[_0xaced('0x1d')](_0x45a850);}};}function respondWithFilteredResult(_0x1dd0bf,_0x13badf){return function(_0x2c1b39){if(_0x2c1b39){var _0x166d88=typeof _0x13badf['offset']===_0xaced('0x1e')&&typeof _0x13badf[_0xaced('0x1f')]==='undefined';var _0x93ce80=_0x2c1b39[_0xaced('0x20')];var _0x24b38a=_0x166d88?0x0:_0x13badf['offset'];var _0x547dc0=_0x166d88?_0x2c1b39['count']:_0x13badf[_0xaced('0x21')]+_0x13badf['limit'];var _0x4aff2c;if(_0x547dc0>=_0x93ce80){_0x547dc0=_0x93ce80;_0x4aff2c=0xc8;}else{_0x4aff2c=0xce;}_0x1dd0bf[_0xaced('0x1b')](_0x4aff2c);return _0x1dd0bf[_0xaced('0x22')](_0xaced('0x23'),_0x24b38a+'-'+_0x547dc0+'/'+_0x93ce80)[_0xaced('0x1d')](_0x2c1b39);}return null;};}function patchUpdates(_0x317ffa){return function(_0x1bfb28){try{jsonpatch[_0xaced('0x24')](_0x1bfb28,_0x317ffa,!![]);}catch(_0x12230e){return BPromise[_0xaced('0x25')](_0x12230e);}return _0x1bfb28[_0xaced('0x26')]();};}function saveUpdates(_0x548bb8,_0x31fee5){return function(_0x181bd7){if(_0x181bd7){return _0x181bd7[_0xaced('0x27')](_0x548bb8)[_0xaced('0x28')](function(_0x5c3640){return _0x5c3640;});}return null;};}function removeEntity(_0x4c771a,_0x3aad86){return function(_0x4b385a){if(_0x4b385a){return _0x4b385a[_0xaced('0x29')]()[_0xaced('0x28')](function(){var _0x345dc3=_0x4b385a[_0xaced('0x2a')]({'plain':!![]});var _0x3ae34e='MusicOnHolds';return db[_0xaced('0x2b')][_0xaced('0x29')]({'where':{'type':_0x3ae34e,'resourceId':_0x345dc3['id']}})['then'](function(){return _0x4b385a;});})[_0xaced('0x28')](function(){_0x4c771a[_0xaced('0x1b')](0xcc)[_0xaced('0x1c')]();});}};}function handleEntityNotFound(_0x219915,_0x5bc530){return function(_0x59ef61){if(!_0x59ef61){_0x219915[_0xaced('0x1a')](0x194);}return _0x59ef61;};}function handleError(_0x2bc5e8,_0x47834a){_0x47834a=_0x47834a||0x1f4;return function(_0x35f5f8){logger['error'](_0x35f5f8['stack']);if(_0x35f5f8[_0xaced('0x2c')]){delete _0x35f5f8[_0xaced('0x2c')];}_0x2bc5e8[_0xaced('0x1b')](_0x47834a)['send'](_0x35f5f8);};}exports[_0xaced('0x2d')]=function(_0x27eb48,_0x3e72a2){var _0x24520e={},_0xf146ce={},_0x53e058={'count':0x0,'rows':[]};var _0x26f45c=_[_0xaced('0x2e')](db[_0xaced('0x2f')]['rawAttributes'],function(_0x351786){return{'name':_0x351786['fieldName'],'type':_0x351786[_0xaced('0x30')][_0xaced('0x31')]};});_0xf146ce[_0xaced('0x32')]=_[_0xaced('0x2e')](_0x26f45c,_0xaced('0x2c'));_0xf146ce[_0xaced('0x33')]=_[_0xaced('0x34')](_0x27eb48[_0xaced('0x33')]);_0xf146ce['filters']=_['intersection'](_0xf146ce['model'],_0xf146ce[_0xaced('0x33')]);_0x24520e[_0xaced('0x35')]=_[_0xaced('0x36')](_0xf146ce['model'],qs[_0xaced('0x37')](_0x27eb48[_0xaced('0x33')][_0xaced('0x37')]));_0x24520e[_0xaced('0x35')]=_0x24520e[_0xaced('0x35')][_0xaced('0x38')]?_0x24520e[_0xaced('0x35')]:_0xf146ce[_0xaced('0x32')];if(!_0x27eb48[_0xaced('0x33')][_0xaced('0x39')](_0xaced('0x3a'))){_0x24520e[_0xaced('0x1f')]=qs['limit'](_0x27eb48[_0xaced('0x33')][_0xaced('0x1f')]);_0x24520e[_0xaced('0x21')]=qs[_0xaced('0x21')](_0x27eb48[_0xaced('0x33')][_0xaced('0x21')]);}_0x24520e[_0xaced('0x3b')]=qs['sort'](_0x27eb48['query']['sort']);delete _0x27eb48[_0xaced('0x33')][_0xaced('0x3c')];_0x24520e['where']=qs[_0xaced('0x3d')](_[_0xaced('0x3e')](_0x27eb48['query'],_0xf146ce[_0xaced('0x3d')]),_0x26f45c);if(_0x27eb48[_0xaced('0x33')][_0xaced('0x3f')]){_0x24520e[_0xaced('0x40')]=_[_0xaced('0x41')](_0x24520e[_0xaced('0x40')],{'$or':_['map'](_0x26f45c,function(_0x52e74e){if(_0x52e74e['type']!==_0xaced('0x42')){var _0x2ebee8={};_0x2ebee8[_0x52e74e[_0xaced('0x2c')]]={'$like':'%'+_0x27eb48[_0xaced('0x33')][_0xaced('0x3f')]+'%'};return _0x2ebee8;}})});}_0x24520e=_[_0xaced('0x41')]({},_0x24520e,_0x27eb48[_0xaced('0x43')]);var _0x312662={'where':_0x24520e[_0xaced('0x40')]};return db[_0xaced('0x2f')][_0xaced('0x20')](_0x312662)[_0xaced('0x28')](function(_0x1c1350){_0x53e058[_0xaced('0x20')]=_0x1c1350;if(_0x27eb48[_0xaced('0x33')][_0xaced('0x44')]){_0x24520e[_0xaced('0x45')]=[{'all':!![]}];}return db[_0xaced('0x2f')][_0xaced('0x46')](_0x24520e);})[_0xaced('0x28')](function(_0x8d1a35){_0x53e058[_0xaced('0x47')]=_0x8d1a35;return _0x53e058;})[_0xaced('0x28')](respondWithFilteredResult(_0x3e72a2,_0x24520e))[_0xaced('0x48')](handleError(_0x3e72a2,null));};exports[_0xaced('0x49')]=function(_0x29587d,_0x3b6510){var _0x23189f={'raw':![],'where':{'id':_0x29587d[_0xaced('0x4a')]['id']}},_0x1eab9d={};_0x1eab9d['model']=_[_0xaced('0x34')](db[_0xaced('0x2f')][_0xaced('0x4b')]);_0x1eab9d[_0xaced('0x33')]=_[_0xaced('0x34')](_0x29587d['query']);_0x1eab9d['filters']=_['intersection'](_0x1eab9d[_0xaced('0x32')],_0x1eab9d['query']);_0x23189f[_0xaced('0x35')]=_['intersection'](_0x1eab9d['model'],qs[_0xaced('0x37')](_0x29587d[_0xaced('0x33')][_0xaced('0x37')]));_0x23189f['attributes']=_0x23189f['attributes']['length']?_0x23189f[_0xaced('0x35')]:_0x1eab9d[_0xaced('0x32')];if(_0x29587d[_0xaced('0x33')][_0xaced('0x44')]){_0x23189f['include']=[{'all':!![]}];}_0x23189f=_[_0xaced('0x41')]({},_0x23189f,_0x29587d['options']);return db[_0xaced('0x2f')][_0xaced('0x4c')](_0x23189f)['then'](handleEntityNotFound(_0x3b6510,null))[_0xaced('0x28')](respondWithResult(_0x3b6510,null))[_0xaced('0x48')](handleError(_0x3b6510,null));};exports[_0xaced('0x27')]=function(_0x346d4f,_0x55ea81){if(_0x346d4f[_0xaced('0x4d')]['id']){delete _0x346d4f[_0xaced('0x4d')]['id'];}return db[_0xaced('0x2f')][_0xaced('0x4c')]({'where':{'id':_0x346d4f['params']['id']}})[_0xaced('0x28')](handleEntityNotFound(_0x55ea81,null))[_0xaced('0x28')](saveUpdates(_0x346d4f[_0xaced('0x4d')],null))[_0xaced('0x28')](respondWithResult(_0x55ea81,null))[_0xaced('0x48')](handleError(_0x55ea81,null));};exports['create']=function(_0x23625e,_0x18c59a,_0x153d7b){return db[_0xaced('0x4e')][_0xaced('0x4f')](function(_0x3a6ad4){if(_0x23625e['body'][_0xaced('0x50')]===_0xaced('0x51')){_0x23625e[_0xaced('0x4d')][_0xaced('0x52')]=path[_0xaced('0x53')](config[_0xaced('0x54')],_0xaced('0x55'),_0x23625e['body']['name']);}return db['VoiceMusicOnHold'][_0xaced('0x56')](_0x23625e[_0xaced('0x4d')],{'transaction':_0x3a6ad4})[_0xaced('0x28')](function(_0x2ec380){if(_0x23625e[_0xaced('0x4d')]['mode']==='files'){fs[_0xaced('0x57')](_0x2ec380[_0xaced('0x52')],parseInt(_0xaced('0x58'),0x8));}var _0x3510ff=_0x23625e['user'][_0xaced('0x2a')]({'plain':!![]});if(!_0x3510ff)throw new Error(_0xaced('0x59'));if(_0x3510ff[_0xaced('0x5a')]===_0xaced('0x5b')){var _0x1ad12c=_0x2ec380[_0xaced('0x2a')]({'plain':!![]});return db[_0xaced('0x5c')][_0xaced('0x4c')]({'where':{'name':'MusicOnHolds','userProfileId':_0x3510ff[_0xaced('0x5d')]},'raw':!![]})[_0xaced('0x28')](function(_0x50a4eb){if(_0x50a4eb&&_0x50a4eb[_0xaced('0x5e')]===0x0){return db[_0xaced('0x2b')][_0xaced('0x56')]({'name':_0x1ad12c[_0xaced('0x2c')],'resourceId':_0x1ad12c['id'],'type':_0x50a4eb[_0xaced('0x2c')],'sectionId':_0x50a4eb['id']},{})['then'](function(){return _0x2ec380;});}else{return _0x2ec380;}})[_0xaced('0x48')](function(_0x10f53f){logger[_0xaced('0x5f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10f53f);});}return _0x2ec380;});})['then'](respondWithResult(_0x18c59a,0xc9))[_0xaced('0x48')](handleError(_0x18c59a,null));};exports[_0xaced('0x29')]=function(_0x3b5e39,_0x3b87fe,_0xc019fb){var _0x171547;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3b5e39[_0xaced('0x4a')]['id']}})['then'](function(_0xf5b427){if(_0xf5b427){return db[_0xaced('0x4e')]['transaction'](function(_0x24cedf){return _0xf5b427[_0xaced('0x29')]({'transaction':_0x24cedf,'raw':!![]})[_0xaced('0x28')](function(_0x6d4fcb){if(_0x6d4fcb[_0xaced('0x52')]){fs[_0xaced('0x60')](_0x6d4fcb[_0xaced('0x52')])[_0xaced('0x61')](function(_0x43428d){fs[_0xaced('0x62')](path[_0xaced('0x53')](_0x6d4fcb[_0xaced('0x52')],_0x43428d));});fs[_0xaced('0x63')](_0x6d4fcb['directory']);}return _0x6d4fcb;});})[_0xaced('0x48')](function(_0x3d90c2){throw new db['Sequelize']['ValidationError'](_0x3d90c2[_0xaced('0x64')]);});}})[_0xaced('0x28')](handleEntityNotFound(_0x3b87fe,null))[_0xaced('0x28')](removeEntity(_0x3b87fe,null))[_0xaced('0x48')](handleError(_0x3b87fe,null));};exports[_0xaced('0x65')]=function(_0x45acb5,_0x4c97e0,_0x1839ff){return db[_0xaced('0x4e')]['transaction'](function(_0xca941f){var _0x4912c5;return db[_0xaced('0x2f')][_0xaced('0x4c')]({'where':{'id':_0x45acb5[_0xaced('0x4a')]['id']}})[_0xaced('0x28')](function(_0xef1cf6){if(_0xef1cf6){_0x4912c5=_0xef1cf6;return _0xef1cf6['addSound'](_0x45acb5['body']['id'],{'transaction':_0xca941f});}})[_0xaced('0x28')](function(_0x32747a){if(_0x32747a){return db['Sound'][_0xaced('0x66')]({'where':{'id':_0x45acb5[_0xaced('0x4d')]['id']},'attributes':['id','name',_0xaced('0x67'),'converted_format',_0xaced('0x68')],'raw':!![]});}})['then'](function(_0x46775c){if(_0x46775c){var _0x3a0ea7=path['join'](config['root'],_0xaced('0x69'),util[_0xaced('0x6a')](_0xaced('0x6b'),path[_0xaced('0x6c')](_0x46775c['save_name'],path[_0xaced('0x6d')](_0x46775c[_0xaced('0x67')])),_0x46775c[_0xaced('0x6e')]));var _0x44e248=path['join'](config['root'],_0xaced('0x55'),_0x4912c5[_0xaced('0x2c')],util[_0xaced('0x6a')](_0xaced('0x6b'),_0x46775c[_0xaced('0x2c')],_0x46775c['converted_format']));fs[_0xaced('0x6f')](_0x3a0ea7,_0x44e248);return _0x46775c;}})[_0xaced('0x48')](function(_0x412da0){throw new db[(_0xaced('0x70'))][(_0xaced('0x71'))](_0x412da0['message']);});})[_0xaced('0x28')](handleEntityNotFound(_0x4c97e0,null))[_0xaced('0x28')](respondWithResult(_0x4c97e0,0xc9))[_0xaced('0x48')](handleError(_0x4c97e0,null));};exports[_0xaced('0x72')]=function(_0x2acebc,_0x512817,_0x149341){return db[_0xaced('0x4e')][_0xaced('0x4f')](function(_0xed1586){var _0x322d0b;return db[_0xaced('0x2f')][_0xaced('0x66')]({'where':{'id':_0x2acebc[_0xaced('0x4a')]['id']}})[_0xaced('0x28')](handleEntityNotFound(_0x512817,null))[_0xaced('0x28')](function(_0x280db9){if(_0x280db9){_0x322d0b=_0x280db9;return _0x280db9[_0xaced('0x72')](_0x2acebc[_0xaced('0x4a')][_0xaced('0x73')]);}})[_0xaced('0x28')](function(_0x3bfc89){if(_0x3bfc89){return db[_0xaced('0x74')][_0xaced('0x66')]({'where':{'id':_0x2acebc[_0xaced('0x4a')][_0xaced('0x73')]},'attributes':['id','name',_0xaced('0x67'),'converted_format',_0xaced('0x68')],'raw':!![]});}})['then'](function(_0x1799b7){if(_0x1799b7){fs[_0xaced('0x62')](path[_0xaced('0x53')](_0x322d0b['directory'],util['format'](_0xaced('0x6b'),_0x1799b7[_0xaced('0x2c')],_0x1799b7[_0xaced('0x6e')])));return _0x1799b7;}})[_0xaced('0x48')](function(_0xd2deb3){throw new db[(_0xaced('0x70'))]['ValidationError'](_0xd2deb3[_0xaced('0x64')]);});})[_0xaced('0x28')](handleEntityNotFound(_0x512817,null))[_0xaced('0x28')](respondWithStatusCode(_0x512817,0xcc))[_0xaced('0x48')](handleError(_0x512817,null));};exports[_0xaced('0x75')]=function(_0x1d060e,_0x380263,_0x4a6d9d){var _0x28e2ee={};var _0x1af860={};var _0x5a7a53;var _0x357bdc;return db[_0xaced('0x2f')]['findOne']({'where':{'id':_0x1d060e['params']['id']}})[_0xaced('0x28')](handleEntityNotFound(_0x380263,null))[_0xaced('0x28')](function(_0x1f5966){if(_0x1f5966){_0x5a7a53=_0x1f5966;_0x1af860[_0xaced('0x32')]=_[_0xaced('0x34')](db[_0xaced('0x74')]['rawAttributes']);_0x1af860['query']=_[_0xaced('0x34')](_0x1d060e[_0xaced('0x33')]);_0x1af860[_0xaced('0x3d')]=_[_0xaced('0x36')](_0x1af860[_0xaced('0x32')],_0x1af860['query']);_0x28e2ee['attributes']=_['intersection'](_0x1af860[_0xaced('0x32')],qs[_0xaced('0x37')](_0x1d060e[_0xaced('0x33')]['fields']));_0x28e2ee[_0xaced('0x35')]=_0x28e2ee['attributes'][_0xaced('0x38')]?_0x28e2ee[_0xaced('0x35')]:_0x1af860[_0xaced('0x32')];_0x28e2ee['order']=qs[_0xaced('0x3c')](_0x1d060e[_0xaced('0x33')]['sort']);_0x28e2ee[_0xaced('0x40')]=qs[_0xaced('0x3d')](_[_0xaced('0x3e')](_0x1d060e[_0xaced('0x33')],_0x1af860[_0xaced('0x3d')]));if(_0x1d060e['query'][_0xaced('0x3f')]){_0x28e2ee[_0xaced('0x40')]=_[_0xaced('0x41')](_0x28e2ee[_0xaced('0x40')],{'$or':_['map'](_0x28e2ee[_0xaced('0x35')],function(_0x1b0c09){var _0x5aa140={};_0x5aa140[_0x1b0c09]={'$like':'%'+_0x1d060e['query']['filter']+'%'};return _0x5aa140;})});}_0x28e2ee=_['merge']({},_0x28e2ee,_0x1d060e[_0xaced('0x43')]);return _0x5a7a53[_0xaced('0x75')](_0x28e2ee);}})[_0xaced('0x28')](function(_0x410123){if(_0x410123){_0x357bdc=_0x410123[_0xaced('0x38')];if(!_0x1d060e[_0xaced('0x33')]['hasOwnProperty'](_0xaced('0x3a'))){_0x28e2ee[_0xaced('0x1f')]=qs['limit'](_0x1d060e['query'][_0xaced('0x1f')]);_0x28e2ee['offset']=qs[_0xaced('0x21')](_0x1d060e['query'][_0xaced('0x21')]);}return _0x5a7a53['getSounds'](_0x28e2ee);}})[_0xaced('0x28')](function(_0x345114){if(_0x345114){return _0x345114?{'count':_0x357bdc,'rows':_0x345114}:null;}})[_0xaced('0x28')](respondWithResult(_0x380263,null))['catch'](handleError(_0x380263,null));}; \ No newline at end of file +var _0x907f=['undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','MusicOnHolds','then','status','stack','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','name','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','body','sequelize','mode','files','join','root','create','mkdirSync','directory','0777','user','get','role','userProfileId','error','transaction','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','addSound','Sound','findOne','save_name','server/files/sounds/converted','basename','extname','converted_format','server/files/moh','format','%s.%s','symlinkSync','removeSound','id2','createdAt','Sequelize','getSounds','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','../../mysqldb','sendStatus','end','offset','limit'];(function(_0x243293,_0x37a0f3){var _0x322181=function(_0x24da51){while(--_0x24da51){_0x243293['push'](_0x243293['shift']());}};_0x322181(++_0x37a0f3);}(_0x907f,0xc9));var _0xf907=function(_0x18e7de,_0x177756){_0x18e7de=_0x18e7de-0x0;var _0x3b6215=_0x907f[_0x18e7de];return _0x3b6215;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf907('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf907('0x1'));var rp=require(_0xf907('0x2'));var moment=require(_0xf907('0x3'));var BPromise=require(_0xf907('0x4'));var Mustache=require(_0xf907('0x5'));var util=require('util');var path=require(_0xf907('0x6'));var sox=require(_0xf907('0x7'));var csv=require(_0xf907('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf907('0x9'));var _=require(_0xf907('0xa'));var squel=require(_0xf907('0xb'));var crypto=require(_0xf907('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf907('0xd'));var toCsv=require(_0xf907('0x8'));var querystring=require('querystring');var Papa=require(_0xf907('0xe'));var Redis=require(_0xf907('0xf'));var authService=require(_0xf907('0x10'));var qs=require(_0xf907('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf907('0x12'));var logger=require(_0xf907('0x13'))(_0xf907('0x14'));var utils=require(_0xf907('0x15'));var config=require(_0xf907('0x16'));var licenseUtil=require(_0xf907('0x17'));var db=require(_0xf907('0x18'))['db'];function respondWithStatusCode(_0x3badbd,_0x4c650c){_0x4c650c=_0x4c650c||0xcc;return function(_0x166a18){if(_0x166a18){return _0x3badbd[_0xf907('0x19')](_0x4c650c);}return _0x3badbd['status'](_0x4c650c)[_0xf907('0x1a')]();};}function respondWithResult(_0x13006c,_0x2ece3b){_0x2ece3b=_0x2ece3b||0xc8;return function(_0x41cc63){if(_0x41cc63){return _0x13006c['status'](_0x2ece3b)['json'](_0x41cc63);}};}function respondWithFilteredResult(_0x30a436,_0x1b9e96){return function(_0x59dd82){if(_0x59dd82){var _0x4d64f9=typeof _0x1b9e96[_0xf907('0x1b')]==='undefined'&&typeof _0x1b9e96[_0xf907('0x1c')]===_0xf907('0x1d');var _0x25c9ed=_0x59dd82[_0xf907('0x1e')];var _0xbd66fd=_0x4d64f9?0x0:_0x1b9e96[_0xf907('0x1b')];var _0x41c575=_0x4d64f9?_0x59dd82[_0xf907('0x1e')]:_0x1b9e96[_0xf907('0x1b')]+_0x1b9e96[_0xf907('0x1c')];var _0x39c30c;if(_0x41c575>=_0x25c9ed){_0x41c575=_0x25c9ed;_0x39c30c=0xc8;}else{_0x39c30c=0xce;}_0x30a436['status'](_0x39c30c);return _0x30a436[_0xf907('0x1f')](_0xf907('0x20'),_0xbd66fd+'-'+_0x41c575+'/'+_0x25c9ed)[_0xf907('0x21')](_0x59dd82);}return null;};}function patchUpdates(_0x10a422){return function(_0x261a25){try{jsonpatch[_0xf907('0x22')](_0x261a25,_0x10a422,!![]);}catch(_0x55d20b){return BPromise[_0xf907('0x23')](_0x55d20b);}return _0x261a25[_0xf907('0x24')]();};}function saveUpdates(_0x1636ba,_0x217342){return function(_0x49b348){if(_0x49b348){return _0x49b348[_0xf907('0x25')](_0x1636ba)['then'](function(_0x399902){return _0x399902;});}return null;};}function removeEntity(_0x5c4fb3,_0x8aa958){return function(_0x355a5f){if(_0x355a5f){return _0x355a5f[_0xf907('0x26')]()['then'](function(){var _0x218b29=_0x355a5f['get']({'plain':!![]});var _0x2e2af3=_0xf907('0x27');return db['UserProfileResource'][_0xf907('0x26')]({'where':{'type':_0x2e2af3,'resourceId':_0x218b29['id']}})[_0xf907('0x28')](function(){return _0x355a5f;});})['then'](function(){_0x5c4fb3[_0xf907('0x29')](0xcc)[_0xf907('0x1a')]();});}};}function handleEntityNotFound(_0x1dd1ab,_0x16af96){return function(_0x386a7d){if(!_0x386a7d){_0x1dd1ab[_0xf907('0x19')](0x194);}return _0x386a7d;};}function handleError(_0x3a7c01,_0x1f7f4c){_0x1f7f4c=_0x1f7f4c||0x1f4;return function(_0x369bd5){logger['error'](_0x369bd5[_0xf907('0x2a')]);if(_0x369bd5['name']){delete _0x369bd5['name'];}_0x3a7c01[_0xf907('0x29')](_0x1f7f4c)[_0xf907('0x2b')](_0x369bd5);};}exports[_0xf907('0x2c')]=function(_0x12ced9,_0x5b889d){var _0x288b5a={},_0x4d5fa1={},_0x119cb0={'count':0x0,'rows':[]};var _0x31d285=_[_0xf907('0x2d')](db[_0xf907('0x2e')][_0xf907('0x2f')],function(_0x2d9cdd){return{'name':_0x2d9cdd[_0xf907('0x30')],'type':_0x2d9cdd['type'][_0xf907('0x31')]};});_0x4d5fa1[_0xf907('0x32')]=_['map'](_0x31d285,_0xf907('0x33'));_0x4d5fa1['query']=_[_0xf907('0x34')](_0x12ced9['query']);_0x4d5fa1[_0xf907('0x35')]=_[_0xf907('0x36')](_0x4d5fa1[_0xf907('0x32')],_0x4d5fa1[_0xf907('0x37')]);_0x288b5a[_0xf907('0x38')]=_[_0xf907('0x36')](_0x4d5fa1[_0xf907('0x32')],qs['fields'](_0x12ced9[_0xf907('0x37')][_0xf907('0x39')]));_0x288b5a[_0xf907('0x38')]=_0x288b5a[_0xf907('0x38')][_0xf907('0x3a')]?_0x288b5a[_0xf907('0x38')]:_0x4d5fa1[_0xf907('0x32')];if(!_0x12ced9['query']['hasOwnProperty'](_0xf907('0x3b'))){_0x288b5a[_0xf907('0x1c')]=qs[_0xf907('0x1c')](_0x12ced9[_0xf907('0x37')]['limit']);_0x288b5a[_0xf907('0x1b')]=qs['offset'](_0x12ced9[_0xf907('0x37')][_0xf907('0x1b')]);}_0x288b5a[_0xf907('0x3c')]=qs[_0xf907('0x3d')](_0x12ced9['query']['sort']);delete _0x12ced9[_0xf907('0x37')][_0xf907('0x3d')];_0x288b5a[_0xf907('0x3e')]=qs[_0xf907('0x35')](_[_0xf907('0x3f')](_0x12ced9[_0xf907('0x37')],_0x4d5fa1[_0xf907('0x35')]),_0x31d285);if(_0x12ced9['query']['filter']){_0x288b5a[_0xf907('0x3e')]=_[_0xf907('0x40')](_0x288b5a[_0xf907('0x3e')],{'$or':_[_0xf907('0x2d')](_0x31d285,function(_0x23dcae){if(_0x23dcae[_0xf907('0x41')]!==_0xf907('0x42')){var _0x5aaa95={};_0x5aaa95[_0x23dcae[_0xf907('0x33')]]={'$like':'%'+_0x12ced9['query'][_0xf907('0x43')]+'%'};return _0x5aaa95;}})});}_0x288b5a=_['merge']({},_0x288b5a,_0x12ced9[_0xf907('0x44')]);var _0x4e73d0={'where':_0x288b5a[_0xf907('0x3e')]};return db[_0xf907('0x2e')]['count'](_0x4e73d0)['then'](function(_0x17ec65){_0x119cb0[_0xf907('0x1e')]=_0x17ec65;if(_0x12ced9[_0xf907('0x37')]['includeAll']){_0x288b5a[_0xf907('0x45')]=[{'all':!![]}];}return db[_0xf907('0x2e')][_0xf907('0x46')](_0x288b5a);})[_0xf907('0x28')](function(_0x10a523){_0x119cb0[_0xf907('0x47')]=_0x10a523;return _0x119cb0;})[_0xf907('0x28')](respondWithFilteredResult(_0x5b889d,_0x288b5a))[_0xf907('0x48')](handleError(_0x5b889d,null));};exports[_0xf907('0x49')]=function(_0x4fa9f2,_0x2c6e9d){var _0x3a0800={'raw':![],'where':{'id':_0x4fa9f2[_0xf907('0x4a')]['id']}},_0x28aee0={};_0x28aee0['model']=_[_0xf907('0x34')](db['VoiceMusicOnHold'][_0xf907('0x2f')]);_0x28aee0['query']=_[_0xf907('0x34')](_0x4fa9f2[_0xf907('0x37')]);_0x28aee0[_0xf907('0x35')]=_['intersection'](_0x28aee0[_0xf907('0x32')],_0x28aee0['query']);_0x3a0800['attributes']=_[_0xf907('0x36')](_0x28aee0[_0xf907('0x32')],qs[_0xf907('0x39')](_0x4fa9f2[_0xf907('0x37')]['fields']));_0x3a0800['attributes']=_0x3a0800[_0xf907('0x38')][_0xf907('0x3a')]?_0x3a0800['attributes']:_0x28aee0[_0xf907('0x32')];if(_0x4fa9f2[_0xf907('0x37')]['includeAll']){_0x3a0800[_0xf907('0x45')]=[{'all':!![]}];}_0x3a0800=_['merge']({},_0x3a0800,_0x4fa9f2[_0xf907('0x44')]);return db[_0xf907('0x2e')][_0xf907('0x4b')](_0x3a0800)[_0xf907('0x28')](handleEntityNotFound(_0x2c6e9d,null))['then'](respondWithResult(_0x2c6e9d,null))[_0xf907('0x48')](handleError(_0x2c6e9d,null));};exports['update']=function(_0x1b57da,_0x34d3ab){if(_0x1b57da['body']['id']){delete _0x1b57da[_0xf907('0x4c')]['id'];}return db[_0xf907('0x2e')]['find']({'where':{'id':_0x1b57da[_0xf907('0x4a')]['id']}})[_0xf907('0x28')](handleEntityNotFound(_0x34d3ab,null))[_0xf907('0x28')](saveUpdates(_0x1b57da[_0xf907('0x4c')],null))['then'](respondWithResult(_0x34d3ab,null))['catch'](handleError(_0x34d3ab,null));};exports['create']=function(_0x1b036a,_0x8b1b11,_0x18b82e){return db[_0xf907('0x4d')]['transaction'](function(_0x46df3b){if(_0x1b036a[_0xf907('0x4c')][_0xf907('0x4e')]===_0xf907('0x4f')){_0x1b036a[_0xf907('0x4c')]['directory']=path[_0xf907('0x50')](config[_0xf907('0x51')],'server/files/moh',_0x1b036a[_0xf907('0x4c')][_0xf907('0x33')]);}return db[_0xf907('0x2e')][_0xf907('0x52')](_0x1b036a[_0xf907('0x4c')],{'transaction':_0x46df3b})[_0xf907('0x28')](function(_0x36654c){if(_0x1b036a[_0xf907('0x4c')][_0xf907('0x4e')]===_0xf907('0x4f')){fs[_0xf907('0x53')](_0x36654c[_0xf907('0x54')],parseInt(_0xf907('0x55'),0x8));}var _0xb3aee9=_0x1b036a[_0xf907('0x56')][_0xf907('0x57')]({'plain':!![]});if(!_0xb3aee9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb3aee9[_0xf907('0x58')]==='user'){var _0x4d1a92=_0x36654c['get']({'plain':!![]});return db['UserProfileSection'][_0xf907('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0xb3aee9[_0xf907('0x59')]},'raw':!![]})['then'](function(_0x20104a){if(_0x20104a&&_0x20104a['autoAssociation']===0x0){return db['UserProfileResource'][_0xf907('0x52')]({'name':_0x4d1a92['name'],'resourceId':_0x4d1a92['id'],'type':_0x20104a['name'],'sectionId':_0x20104a['id']},{})[_0xf907('0x28')](function(){return _0x36654c;});}else{return _0x36654c;}})['catch'](function(_0x43b1a4){logger[_0xf907('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43b1a4);});}return _0x36654c;});})[_0xf907('0x28')](respondWithResult(_0x8b1b11,0xc9))[_0xf907('0x48')](handleError(_0x8b1b11,null));};exports[_0xf907('0x26')]=function(_0x1af5c9,_0xe0cf74,_0x55cbd6){var _0x5ce886;return db[_0xf907('0x2e')][_0xf907('0x4b')]({'where':{'id':_0x1af5c9[_0xf907('0x4a')]['id']}})[_0xf907('0x28')](function(_0x53802a){if(_0x53802a){return db[_0xf907('0x4d')][_0xf907('0x5b')](function(_0xf6d7b7){return _0x53802a['destroy']({'transaction':_0xf6d7b7,'raw':!![]})[_0xf907('0x28')](function(_0x5a4190){if(_0x5a4190[_0xf907('0x54')]){fs[_0xf907('0x5c')](_0x5a4190[_0xf907('0x54')])[_0xf907('0x5d')](function(_0xf091c7){fs[_0xf907('0x5e')](path[_0xf907('0x50')](_0x5a4190[_0xf907('0x54')],_0xf091c7));});fs[_0xf907('0x5f')](_0x5a4190[_0xf907('0x54')]);}return _0x5a4190;});})[_0xf907('0x48')](function(_0x3fad93){throw new db['Sequelize'][(_0xf907('0x60'))](_0x3fad93[_0xf907('0x61')]);});}})[_0xf907('0x28')](handleEntityNotFound(_0xe0cf74,null))[_0xf907('0x28')](removeEntity(_0xe0cf74,null))[_0xf907('0x48')](handleError(_0xe0cf74,null));};exports['addSound']=function(_0x47ea59,_0x5e2491,_0x18e4fb){return db['sequelize'][_0xf907('0x5b')](function(_0x3ac9aa){var _0xdaccfa;return db[_0xf907('0x2e')][_0xf907('0x4b')]({'where':{'id':_0x47ea59['params']['id']}})[_0xf907('0x28')](function(_0x45cc66){if(_0x45cc66){_0xdaccfa=_0x45cc66;return _0x45cc66[_0xf907('0x62')](_0x47ea59[_0xf907('0x4c')]['id'],{'transaction':_0x3ac9aa});}})[_0xf907('0x28')](function(_0x3f7850){if(_0x3f7850){return db[_0xf907('0x63')][_0xf907('0x64')]({'where':{'id':_0x47ea59[_0xf907('0x4c')]['id']},'attributes':['id',_0xf907('0x33'),_0xf907('0x65'),'converted_format','createdAt'],'raw':!![]});}})[_0xf907('0x28')](function(_0x486993){if(_0x486993){var _0x147fa3=path['join'](config[_0xf907('0x51')],_0xf907('0x66'),util['format']('%s.%s',path[_0xf907('0x67')](_0x486993['save_name'],path[_0xf907('0x68')](_0x486993[_0xf907('0x65')])),_0x486993[_0xf907('0x69')]));var _0x2841f6=path[_0xf907('0x50')](config['root'],_0xf907('0x6a'),_0xdaccfa[_0xf907('0x33')],util[_0xf907('0x6b')](_0xf907('0x6c'),_0x486993['name'],_0x486993[_0xf907('0x69')]));fs[_0xf907('0x6d')](_0x147fa3,_0x2841f6);return _0x486993;}})[_0xf907('0x48')](function(_0x24d729){throw new db['Sequelize'][(_0xf907('0x60'))](_0x24d729[_0xf907('0x61')]);});})['then'](handleEntityNotFound(_0x5e2491,null))[_0xf907('0x28')](respondWithResult(_0x5e2491,0xc9))['catch'](handleError(_0x5e2491,null));};exports[_0xf907('0x6e')]=function(_0x2b9915,_0x9414d0,_0x4db6de){return db['sequelize']['transaction'](function(_0x53f4f2){var _0x326944;return db[_0xf907('0x2e')][_0xf907('0x64')]({'where':{'id':_0x2b9915[_0xf907('0x4a')]['id']}})['then'](handleEntityNotFound(_0x9414d0,null))[_0xf907('0x28')](function(_0x460a31){if(_0x460a31){_0x326944=_0x460a31;return _0x460a31[_0xf907('0x6e')](_0x2b9915[_0xf907('0x4a')][_0xf907('0x6f')]);}})[_0xf907('0x28')](function(_0x2d7505){if(_0x2d7505){return db[_0xf907('0x63')][_0xf907('0x64')]({'where':{'id':_0x2b9915[_0xf907('0x4a')]['id2']},'attributes':['id','name',_0xf907('0x65'),_0xf907('0x69'),_0xf907('0x70')],'raw':!![]});}})[_0xf907('0x28')](function(_0x16031a){if(_0x16031a){fs['unlinkSync'](path['join'](_0x326944[_0xf907('0x54')],util[_0xf907('0x6b')](_0xf907('0x6c'),_0x16031a[_0xf907('0x33')],_0x16031a['converted_format'])));return _0x16031a;}})[_0xf907('0x48')](function(_0x24d1f3){throw new db[(_0xf907('0x71'))][(_0xf907('0x60'))](_0x24d1f3['message']);});})['then'](handleEntityNotFound(_0x9414d0,null))[_0xf907('0x28')](respondWithStatusCode(_0x9414d0,0xcc))[_0xf907('0x48')](handleError(_0x9414d0,null));};exports['getSounds']=function(_0x3da1d5,_0x532da3,_0x34109b){var _0x5c02cf={};var _0x3b8159={};var _0x9e1530;var _0x398c22;return db[_0xf907('0x2e')][_0xf907('0x64')]({'where':{'id':_0x3da1d5[_0xf907('0x4a')]['id']}})[_0xf907('0x28')](handleEntityNotFound(_0x532da3,null))[_0xf907('0x28')](function(_0x5a9577){if(_0x5a9577){_0x9e1530=_0x5a9577;_0x3b8159[_0xf907('0x32')]=_[_0xf907('0x34')](db[_0xf907('0x63')][_0xf907('0x2f')]);_0x3b8159['query']=_[_0xf907('0x34')](_0x3da1d5[_0xf907('0x37')]);_0x3b8159[_0xf907('0x35')]=_[_0xf907('0x36')](_0x3b8159[_0xf907('0x32')],_0x3b8159[_0xf907('0x37')]);_0x5c02cf[_0xf907('0x38')]=_[_0xf907('0x36')](_0x3b8159[_0xf907('0x32')],qs[_0xf907('0x39')](_0x3da1d5[_0xf907('0x37')]['fields']));_0x5c02cf[_0xf907('0x38')]=_0x5c02cf['attributes'][_0xf907('0x3a')]?_0x5c02cf['attributes']:_0x3b8159[_0xf907('0x32')];_0x5c02cf[_0xf907('0x3c')]=qs[_0xf907('0x3d')](_0x3da1d5[_0xf907('0x37')][_0xf907('0x3d')]);_0x5c02cf[_0xf907('0x3e')]=qs['filters'](_[_0xf907('0x3f')](_0x3da1d5[_0xf907('0x37')],_0x3b8159[_0xf907('0x35')]));if(_0x3da1d5[_0xf907('0x37')]['filter']){_0x5c02cf['where']=_[_0xf907('0x40')](_0x5c02cf[_0xf907('0x3e')],{'$or':_[_0xf907('0x2d')](_0x5c02cf[_0xf907('0x38')],function(_0xdad718){var _0xa76d8c={};_0xa76d8c[_0xdad718]={'$like':'%'+_0x3da1d5[_0xf907('0x37')][_0xf907('0x43')]+'%'};return _0xa76d8c;})});}_0x5c02cf=_['merge']({},_0x5c02cf,_0x3da1d5[_0xf907('0x44')]);return _0x9e1530[_0xf907('0x72')](_0x5c02cf);}})['then'](function(_0x503bc3){if(_0x503bc3){_0x398c22=_0x503bc3['length'];if(!_0x3da1d5[_0xf907('0x37')]['hasOwnProperty'](_0xf907('0x3b'))){_0x5c02cf['limit']=qs[_0xf907('0x1c')](_0x3da1d5[_0xf907('0x37')]['limit']);_0x5c02cf[_0xf907('0x1b')]=qs[_0xf907('0x1b')](_0x3da1d5[_0xf907('0x37')]['offset']);}return _0x9e1530[_0xf907('0x72')](_0x5c02cf);}})['then'](function(_0x4f95bb){if(_0x4f95bb){return _0x4f95bb?{'count':_0x398c22,'rows':_0x4f95bb}:null;}})[_0xf907('0x28')](respondWithResult(_0x532da3,null))[_0xf907('0x48')](handleError(_0x532da3,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index cc44570..83e32f6 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 _0x3d95=['rimraf','../../config/environment','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x40a9cd,_0x32d8a3){var _0x22cfc2=function(_0x30980e){while(--_0x30980e){_0x40a9cd['push'](_0x40a9cd['shift']());}};_0x22cfc2(++_0x32d8a3);}(_0x3d95,0x11a));var _0x53d9=function(_0x52b32d,_0xa6ad2c){_0x52b32d=_0x52b32d-0x0;var _0x158c31=_0x3d95[_0x52b32d];return _0x158c31;};'use strict';var _=require(_0x53d9('0x0'));var util=require(_0x53d9('0x1'));var logger=require(_0x53d9('0x2'))('api');var moment=require(_0x53d9('0x3'));var BPromise=require(_0x53d9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53d9('0x5'));var rimraf=require(_0x53d9('0x6'));var config=require(_0x53d9('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x53d9('0x8')]=function(_0x1be813,_0x1e5731){return _0x1be813[_0x53d9('0x9')](_0x53d9('0xa'),attributes,{'tableName':_0x53d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x660a=['voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x32a69c,_0x40f56e){var _0x2f9cf3=function(_0x1fb4b6){while(--_0x1fb4b6){_0x32a69c['push'](_0x32a69c['shift']());}};_0x2f9cf3(++_0x40f56e);}(_0x660a,0xf8));var _0xa660=function(_0x28ae89,_0x17cdd4){_0x28ae89=_0x28ae89-0x0;var _0x24f0f5=_0x660a[_0x28ae89];return _0x24f0f5;};'use strict';var _=require(_0xa660('0x0'));var util=require(_0xa660('0x1'));var logger=require(_0xa660('0x2'))(_0xa660('0x3'));var moment=require(_0xa660('0x4'));var BPromise=require(_0xa660('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa660('0x6'));var config=require(_0xa660('0x7'));var attributes=require(_0xa660('0x8'));module[_0xa660('0x9')]=function(_0x1b3e36,_0x457804){return _0x1b3e36[_0xa660('0xa')](_0xa660('0xb'),attributes,{'tableName':_0xa660('0xc'),'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 f00e63b..df9af7c 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x1f8334,_0x578352){var _0x59c29b=function(_0x448cae){while(--_0x448cae){_0x1f8334['push'](_0x1f8334['shift']());}};_0x59c29b(++_0x578352);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4893be,_0x40c14f){var _0x226c42=function(_0x4db31b){while(--_0x4db31b){_0x4893be['push'](_0x4893be['shift']());}};_0x226c42(++_0x40c14f);}(_0x70e0,0x17b));var _0x070e=function(_0x425796,_0x2c4ce9){_0x425796=_0x425796-0x0;var _0x5b13cb=_0x70e0[_0x425796];return _0x5b13cb;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 50bdfa1..9457961 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 _0xf61e=['post','/:id/users','addAgents','addTeams','put','update','destroy','delete','removeAgents','removeTeams','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','create'];(function(_0x2ca7ef,_0x1948f2){var _0x4f559d=function(_0x46a789){while(--_0x46a789){_0x2ca7ef['push'](_0x2ca7ef['shift']());}};_0x4f559d(++_0x1948f2);}(_0xf61e,0x82));var _0xef61=function(_0x5ca610,_0xff91c){_0x5ca610=_0x5ca610-0x0;var _0xbd2d51=_0xf61e[_0x5ca610];return _0xbd2d51;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef61('0x3')]();var fs_extra=require(_0xef61('0x4'));var auth=require(_0xef61('0x5'));var interaction=require(_0xef61('0x6'));var config=require(_0xef61('0x7'));var controller=require(_0xef61('0x8'));router[_0xef61('0x9')]('/',auth[_0xef61('0xa')](),controller[_0xef61('0xb')]);router['get'](_0xef61('0xc'),auth['isAuthenticated'](),controller[_0xef61('0xd')]);router[_0xef61('0x9')](_0xef61('0xe'),auth[_0xef61('0xa')](),controller[_0xef61('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xef61('0x10')]);router[_0xef61('0x9')](_0xef61('0x11'),auth['isAuthenticated'](),controller[_0xef61('0x12')]);router['post']('/',auth[_0xef61('0xa')](),controller[_0xef61('0x13')]);router[_0xef61('0x14')](_0xef61('0x15'),auth['isAuthenticated'](),controller[_0xef61('0x16')]);router['post'](_0xef61('0x11'),auth[_0xef61('0xa')](),controller[_0xef61('0x17')]);router[_0xef61('0x18')](_0xef61('0xe'),auth[_0xef61('0xa')](),controller[_0xef61('0x19')]);router['delete'](_0xef61('0xe'),auth['isAuthenticated'](),controller[_0xef61('0x1a')]);router[_0xef61('0x1b')](_0xef61('0x15'),auth[_0xef61('0xa')](),controller[_0xef61('0x1c')]);router['delete'](_0xef61('0x11'),auth['isAuthenticated'](),controller[_0xef61('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xf6c1=['/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xf6c1,0x99));var _0x1f6c=function(_0x1f8fd6,_0x35322d){_0x1f8fd6=_0x1f8fd6-0x0;var _0x1cfeef=_0xf6c1[_0x1f8fd6];return _0x1cfeef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f6c('0x0'));var timeout=require(_0x1f6c('0x1'));var express=require(_0x1f6c('0x2'));var router=express['Router']();var fs_extra=require(_0x1f6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var controller=require(_0x1f6c('0x6'));router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router['get'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xb')]);router[_0x1f6c('0x7')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xd')]);router[_0x1f6c('0x7')](_0x1f6c('0xe'),auth['isAuthenticated'](),controller['getAgents']);router['get'](_0x1f6c('0xf'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x10')]);router[_0x1f6c('0x11')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x12')]);router['post'](_0x1f6c('0xe'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x13')]);router[_0x1f6c('0x11')](_0x1f6c('0xf'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x14')]);router[_0x1f6c('0x15')]('/:id',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x16')]);router[_0x1f6c('0x17')](_0x1f6c('0xc'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x18')]);router['delete']('/:id/users',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x19')]);router['delete'](_0x1f6c('0xf'),auth['isAuthenticated'](),controller[_0x1f6c('0x1a')]);module[_0x1f6c('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 7fc1f47..975c35e 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 _0xe1ec=['getDataValue','INTEGER','exports','STRING','name','VIRTUAL','system-'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xe1ec,0x19f));var _0xce1e=function(_0x38c9d6,_0x185abf){_0x38c9d6=_0x38c9d6-0x0;var _0x545b1c=_0xe1ec[_0x38c9d6];return _0x545b1c;};'use strict';var Sequelize=require('sequelize');module[_0xce1e('0x0')]={'name':{'type':Sequelize[_0xce1e('0x1')],'allowNull':![],'unique':_0xce1e('0x2')},'prefix':{'type':Sequelize[_0xce1e('0x3')],'get':function(_0x537447){return _0xce1e('0x4')+this[_0xce1e('0x5')](_0xce1e('0x2'))+'-';}},'description':{'type':Sequelize[_0xce1e('0x1')]},'callerIdAll':{'type':Sequelize[_0xce1e('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xce1e('0x6')]}}; \ No newline at end of file +var _0xe64b=['exports','STRING','name','VIRTUAL','getDataValue','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe64b,0x7e));var _0xbe64=function(_0x578c7e,_0x470b5f){_0x578c7e=_0x578c7e-0x0;var _0x2b2437=_0xe64b[_0x578c7e];return _0x2b2437;};'use strict';var Sequelize=require('sequelize');module[_0xbe64('0x0')]={'name':{'type':Sequelize[_0xbe64('0x1')],'allowNull':![],'unique':_0xbe64('0x2')},'prefix':{'type':Sequelize[_0xbe64('0x3')],'get':function(_0x2f455e){return'system-'+this[_0xbe64('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0xbe64('0x1')]},'callerIdAll':{'type':Sequelize[_0xbe64('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xbe64('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index fcfa233..793be34 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 _0x5c3c=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','sequelize','transaction','get','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','removeAgents','isArray','userVoicePrefix:remove','emit','getAgents','findOne','User','pick','getTeams','addTeams','Team','findAll','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','removeTeams','select','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','Agents','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','union','compact','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x227b67,_0x5c4075){var _0x16f616=function(_0x46e857){while(--_0x46e857){_0x227b67['push'](_0x227b67['shift']());}};_0x16f616(++_0x5c4075);}(_0x5c3c,0x132));var _0xc5c3=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5c3c[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5c3('0x18')]=_[_0xc5c3('0x19')](config[_0xc5c3('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc5c3('0x1a'))(new Redis(config[_0xc5c3('0x18')]));require(_0xc5c3('0x1b'))[_0xc5c3('0x1c')](socket);function respondWithStatusCode(_0xc8a636,_0x5f34bb){_0x5f34bb=_0x5f34bb||0xcc;return function(_0x5c0341){if(_0x5c0341){return _0xc8a636[_0xc5c3('0x1d')](_0x5f34bb);}return _0xc8a636[_0xc5c3('0x1e')](_0x5f34bb)[_0xc5c3('0x1f')]();};}function respondWithResult(_0xef8b21,_0x5ecd4b){_0x5ecd4b=_0x5ecd4b||0xc8;return function(_0x4ff2de){if(_0x4ff2de){return _0xef8b21[_0xc5c3('0x1e')](_0x5ecd4b)['json'](_0x4ff2de);}};}function respondWithFilteredResult(_0xa9bc84,_0x17ec62){return function(_0x2ff158){if(_0x2ff158){var _0x13c867=typeof _0x17ec62[_0xc5c3('0x20')]==='undefined'&&typeof _0x17ec62[_0xc5c3('0x21')]===_0xc5c3('0x22');var _0x123dba=_0x2ff158[_0xc5c3('0x23')];var _0x4e570f=_0x13c867?0x0:_0x17ec62[_0xc5c3('0x20')];var _0x41578a=_0x13c867?_0x2ff158[_0xc5c3('0x23')]:_0x17ec62[_0xc5c3('0x20')]+_0x17ec62[_0xc5c3('0x21')];var _0x564815;if(_0x41578a>=_0x123dba){_0x41578a=_0x123dba;_0x564815=0xc8;}else{_0x564815=0xce;}_0xa9bc84[_0xc5c3('0x1e')](_0x564815);return _0xa9bc84[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e570f+'-'+_0x41578a+'/'+_0x123dba)[_0xc5c3('0x26')](_0x2ff158);}return null;};}function patchUpdates(_0x1c5793){return function(_0x67445){try{jsonpatch[_0xc5c3('0x27')](_0x67445,_0x1c5793,!![]);}catch(_0x5996a0){return BPromise['reject'](_0x5996a0);}return _0x67445[_0xc5c3('0x28')]();};}function saveUpdates(_0x38dd9e,_0x53ab72){return function(_0x5c7329){if(_0x5c7329){return _0x5c7329[_0xc5c3('0x29')](_0x38dd9e)[_0xc5c3('0x2a')](function(_0x38a3df){return _0x38a3df;});}return null;};}function removeEntity(_0x52e54a,_0x4af067){return function(_0x2df06b){if(_0x2df06b){return _0x2df06b[_0xc5c3('0x2b')]()[_0xc5c3('0x2a')](function(){var _0x29791c=_0x2df06b['get']({'plain':!![]});var _0x21efd6='VoicePrefixes';return db[_0xc5c3('0x2c')]['destroy']({'where':{'type':_0x21efd6,'resourceId':_0x29791c['id']}})[_0xc5c3('0x2a')](function(){return _0x2df06b;});})[_0xc5c3('0x2a')](function(){_0x52e54a[_0xc5c3('0x1e')](0xcc)[_0xc5c3('0x1f')]();});}};}function handleEntityNotFound(_0x15361c,_0x2d07e1){return function(_0x35a397){if(!_0x35a397){_0x15361c['sendStatus'](0x194);}return _0x35a397;};}function handleError(_0xbcafd6,_0x4a3300){_0x4a3300=_0x4a3300||0x1f4;return function(_0xc4b134){logger[_0xc5c3('0x2d')](_0xc4b134['stack']);if(_0xc4b134['name']){delete _0xc4b134[_0xc5c3('0x2e')];}_0xbcafd6[_0xc5c3('0x1e')](_0x4a3300)[_0xc5c3('0x2f')](_0xc4b134);};}exports[_0xc5c3('0x30')]=function(_0x52adcf,_0x3f9591){var _0x24aa70={},_0x3ebcbc={},_0x303eab={'count':0x0,'rows':[]};var _0x1b4538=_[_0xc5c3('0x31')](db[_0xc5c3('0x32')][_0xc5c3('0x33')],function(_0x1d1e6d){return{'name':_0x1d1e6d['fieldName'],'type':_0x1d1e6d[_0xc5c3('0x34')][_0xc5c3('0x35')]};});_0x3ebcbc[_0xc5c3('0x36')]=_[_0xc5c3('0x31')](_0x1b4538,_0xc5c3('0x2e'));_0x3ebcbc[_0xc5c3('0x37')]=_[_0xc5c3('0x38')](_0x52adcf['query']);_0x3ebcbc['filters']=_[_0xc5c3('0x39')](_0x3ebcbc['model'],_0x3ebcbc[_0xc5c3('0x37')]);_0x24aa70[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x3ebcbc[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x52adcf['query'][_0xc5c3('0x3b')]));_0x24aa70[_0xc5c3('0x3a')]=_0x24aa70['attributes'][_0xc5c3('0x3c')]?_0x24aa70[_0xc5c3('0x3a')]:_0x3ebcbc[_0xc5c3('0x36')];if(!_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x24aa70[_0xc5c3('0x21')]=qs[_0xc5c3('0x21')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x21')]);_0x24aa70['offset']=qs[_0xc5c3('0x20')](_0x52adcf['query']['offset']);}_0x24aa70[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x24aa70[_0xc5c3('0x41')]=qs['filters'](_['pick'](_0x52adcf[_0xc5c3('0x37')],_0x3ebcbc[_0xc5c3('0x42')]),_0x1b4538);if(_0x52adcf['query'][_0xc5c3('0x43')]){_0x24aa70['where']=_[_0xc5c3('0x44')](_0x24aa70[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x1b4538,function(_0x59c9cb){if(_0x59c9cb[_0xc5c3('0x34')]!==_0xc5c3('0x45')){var _0x525ef8={};_0x525ef8[_0x59c9cb[_0xc5c3('0x2e')]]={'$like':'%'+_0x52adcf['query'][_0xc5c3('0x43')]+'%'};return _0x525ef8;}})});}_0x24aa70=_[_0xc5c3('0x44')]({},_0x24aa70,_0x52adcf['options']);var _0x4d2056={'where':_0x24aa70['where']};return db[_0xc5c3('0x32')][_0xc5c3('0x23')](_0x4d2056)['then'](function(_0x1a8490){_0x303eab[_0xc5c3('0x23')]=_0x1a8490;if(_0x52adcf[_0xc5c3('0x37')][_0xc5c3('0x46')]){_0x24aa70['include']=[{'all':!![]}];}return db[_0xc5c3('0x32')]['findAll'](_0x24aa70);})['then'](function(_0x1363fa){_0x303eab[_0xc5c3('0x47')]=_0x1363fa;return _0x303eab;})['then'](respondWithFilteredResult(_0x3f9591,_0x24aa70))[_0xc5c3('0x48')](handleError(_0x3f9591,null));};exports[_0xc5c3('0x49')]=function(_0x590e65,_0x333c38){var _0x4ffc5a={'raw':![],'where':{'id':_0x590e65[_0xc5c3('0x4a')]['id']}},_0x122a6d={};_0x122a6d['model']=_[_0xc5c3('0x38')](db['VoicePrefix'][_0xc5c3('0x33')]);_0x122a6d[_0xc5c3('0x37')]=_['keys'](_0x590e65[_0xc5c3('0x37')]);_0x122a6d[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x122a6d[_0xc5c3('0x36')],_0x122a6d[_0xc5c3('0x37')]);_0x4ffc5a[_0xc5c3('0x3a')]=_['intersection'](_0x122a6d[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x590e65[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x4ffc5a[_0xc5c3('0x3a')]=_0x4ffc5a['attributes']['length']?_0x4ffc5a[_0xc5c3('0x3a')]:_0x122a6d[_0xc5c3('0x36')];if(_0x590e65[_0xc5c3('0x37')]['includeAll']){_0x4ffc5a[_0xc5c3('0x4b')]=[{'all':!![]}];}_0x4ffc5a=_[_0xc5c3('0x44')]({},_0x4ffc5a,_0x590e65[_0xc5c3('0x4c')]);return db[_0xc5c3('0x32')][_0xc5c3('0x4d')](_0x4ffc5a)[_0xc5c3('0x2a')](handleEntityNotFound(_0x333c38,null))[_0xc5c3('0x2a')](respondWithResult(_0x333c38,null))['catch'](handleError(_0x333c38,null));};exports[_0xc5c3('0x2b')]=function(_0x3ff21e,_0x4538ab){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x3ff21e[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x4538ab,null))[_0xc5c3('0x2a')](removeEntity(_0x4538ab,null))[_0xc5c3('0x48')](handleError(_0x4538ab,null));};exports['describe']=function(_0xd716e6,_0x58204c){return db[_0xc5c3('0x32')]['describe']()[_0xc5c3('0x2a')](respondWithResult(_0x58204c,null))[_0xc5c3('0x48')](handleError(_0x58204c,null));};exports[_0xc5c3('0x4e')]=function(_0x325643,_0x1311de){var _0x4be969;return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x348960){return db[_0xc5c3('0x32')][_0xc5c3('0x4e')](_0x325643['body'],{'transaction':_0x348960})[_0xc5c3('0x2a')](function(_0x34bf9c){_0x4be969=_0x34bf9c[_0xc5c3('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xc5c3('0x4d')]({'where':{'id':_0x4be969['VoiceExtensionId']},'raw':!![]})['then'](function(_0x39f83a){return createVoicePrefixExtensions(_0x4be969,_0x39f83a,_0x348960);});});})[_0xc5c3('0x2a')](function(){var _0x110105=_0x325643[_0xc5c3('0x52')][_0xc5c3('0x51')]({'plain':!![]});if(!_0x110105)throw new Error(_0xc5c3('0x53'));if(_0x110105['role']===_0xc5c3('0x52')){var _0x1ad3aa=_0x4be969;return db[_0xc5c3('0x54')][_0xc5c3('0x4d')]({'where':{'name':_0xc5c3('0x55'),'userProfileId':_0x110105[_0xc5c3('0x56')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x524aff){if(_0x524aff&&_0x524aff['autoAssociation']===0x0){return db[_0xc5c3('0x2c')][_0xc5c3('0x4e')]({'name':_0x1ad3aa['name'],'resourceId':_0x1ad3aa['id'],'type':_0x524aff[_0xc5c3('0x2e')],'sectionId':_0x524aff['id']},{})[_0xc5c3('0x2a')](function(){return _0x4be969;});}else{return _0x4be969;}})[_0xc5c3('0x48')](function(_0x41bcf7){logger['error'](_0xc5c3('0x57'),_0x41bcf7);throw _0x41bcf7;});}return _0x4be969;})[_0xc5c3('0x2a')](respondWithResult(_0x1311de,null))[_0xc5c3('0x48')](handleError(_0x1311de,null));};function Extension(_0x314392,_0x1b66bf,_0x36420a,_0x90e30b){this[_0xc5c3('0x58')]=_0xc5c3('0x59');this['exten']=_0x314392;this[_0xc5c3('0x5a')]=_0x36420a;this[_0xc5c3('0x34')]=_0xc5c3('0x5b');this['description']=_0xc5c3('0x5c');this[_0xc5c3('0x5d')]=_0x1b66bf;this[_0xc5c3('0x5e')]=_0x90e30b;}function createVoicePrefixExtensions(_0x30226f,_0x32d5e2,_0x5067ed){return new BPromise(function(_0xf54924,_0xea569b){var _0xf40f27=new Extension(formatPrefixName(_0x30226f[_0xc5c3('0x5f')]),0x1,_0xc5c3('0x60'),_0xc5c3('0x61'));_0xf40f27[_0xc5c3('0x62')]=_0x30226f['id'];return db['VoiceExtension'][_0xc5c3('0x4e')](_0xf40f27,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x397fc8){var _0x13f6a1=_0x397fc8[_0xc5c3('0x51')]({'plain':!![]});var _0x3cd213=_[_0xc5c3('0x31')](addVoicePrefixExtensions(_0x30226f,_0x32d5e2),function(_0x5b9013){_0x5b9013['VoiceExtensionId']=_0x13f6a1['id'];_0x5b9013[_0xc5c3('0x62')]=_0x30226f['id'];return _0x5b9013;});return db[_0xc5c3('0x63')][_0xc5c3('0x64')](_0x3cd213,{'transaction':_0x5067ed})[_0xc5c3('0x2a')](function(_0x1ed757){if(!_0x1ed757){return _0xea569b(_0xc5c3('0x65'));}else{return _0xf54924(_0x1ed757);}})[_0xc5c3('0x48')](function(_0x2cdd7a){return _0xea569b(_0x2cdd7a);});});;});};function addVoicePrefixExtensions(_0x385b39,_0x4d3e6f){var _0x92c6cf=[];var _0x358b83=formatPrefixName(_0x385b39['prefix']);_0x92c6cf['push'](new Extension(_0x358b83,0x2,_0xc5c3('0x66'),_0xc5c3('0x67')+_0x385b39[_0xc5c3('0x2e')]));if(_0x385b39[_0xc5c3('0x68')]){_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,_0xc5c3('0x66'),_0xc5c3('0x6a')+_0x385b39[_0xc5c3('0x68')]));}else{_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x3,'NoOp',_0xc5c3('0x6b')));}_0x92c6cf[_0xc5c3('0x69')](new Extension(_0x358b83,0x4,_0xc5c3('0x6c'),_0x4d3e6f[_0xc5c3('0x58')]+','+_0xc5c3('0x6d')+(0x8+_0x385b39[_0xc5c3('0x2e')][_0xc5c3('0x3c')])+'}'+','+0x1));return _0x92c6cf;}function formatPrefixName(_0x114c90){var _0x22606a='_';for(var _0x31e280=0x0;_0x31e280<_0x114c90[_0xc5c3('0x3c')];_0x31e280++){if(_0x114c90['charAt'](_0x31e280)=='-'){_0x22606a+=_0x114c90['charAt'](_0x31e280);}else{_0x22606a+='['+_0x114c90[_0xc5c3('0x6e')](_0x31e280)+']';}}_0x22606a+='.';return _0x22606a;}exports[_0xc5c3('0x29')]=function(_0x6281e5,_0x1951a5,_0x5540c0){var _0x2da018=_0x6281e5[_0xc5c3('0x6f')];_0x2da018[_0xc5c3('0x5f')]=_0xc5c3('0x70')+_0x2da018[_0xc5c3('0x2e')]+'-';return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x4a3f71){return db[_0xc5c3('0x32')]['update'](_0x2da018,{'where':{'id':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x2b')]({'where':{'VoicePrefixId':_0x2da018['id']},'transaction':_0x4a3f71})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x63')][_0xc5c3('0x4d')]({'where':{'id':_0x2da018[_0xc5c3('0x71')]},'raw':!![]})[_0xc5c3('0x2a')](function(_0x4813a0){return createVoicePrefixExtensions(_0x2da018,_0x4813a0,_0x4a3f71);});});});})[_0xc5c3('0x2a')](function(){return db[_0xc5c3('0x32')][_0xc5c3('0x72')](_0x2da018['id']);})['then'](respondWithResult(_0x1951a5,null))['catch'](handleError(_0x1951a5,null));};exports[_0xc5c3('0x73')]=function(_0x5d6b6b,_0x5bcbd3,_0x1f222f){return db[_0xc5c3('0x32')]['find']({'where':{'id':_0x5d6b6b[_0xc5c3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bcbd3,null))['then'](function(_0x2dbe80){if(_0x2dbe80){return _0x2dbe80[_0xc5c3('0x73')](_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')],_[_0xc5c3('0x75')](_0x5d6b6b['body'],[_0xc5c3('0x74'),'id'])||{})['spread'](function(_0x110167){for(var _0x109cfa=0x0;_0x109cfa<_0x5d6b6b[_0xc5c3('0x6f')][_0xc5c3('0x74')][_0xc5c3('0x3c')];_0x109cfa+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x5d6b6b['body'][_0xc5c3('0x74')][_0x109cfa]),'VoicePrefixId':Number(_0x5d6b6b[_0xc5c3('0x4a')]['id'])});}return _0x110167;});}})[_0xc5c3('0x2a')](respondWithResult(_0x5bcbd3,null))['catch'](handleError(_0x5bcbd3,null));};exports[_0xc5c3('0x76')]=function(_0x41222d,_0x5dcd4d,_0x3afa94){return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x41222d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x5dcd4d,null))[_0xc5c3('0x2a')](function(_0x4b0d02){if(_0x4b0d02){return _0x4b0d02[_0xc5c3('0x76')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])[_0xc5c3('0x2a')](function(){if(_[_0xc5c3('0x77')](_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')])){for(var _0x1f36f8=0x0;_0x1f36f8<_0x41222d['query']['ids']['length'];_0x1f36f8+=0x1){socket['emit'](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')][_0x1f36f8]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}}else{socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':Number(_0x41222d[_0xc5c3('0x37')][_0xc5c3('0x74')]),'VoicePrefixId':Number(_0x41222d[_0xc5c3('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x5dcd4d,null))[_0xc5c3('0x48')](handleError(_0x5dcd4d,null));};exports[_0xc5c3('0x7a')]=function(_0x3aa5e2,_0x1efa1d,_0x2fae6d){var _0x258e36={};var _0x2f1be8={};var _0x550966;var _0x5733a2;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x3aa5e2[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x1efa1d,null))[_0xc5c3('0x2a')](function(_0x306d22){if(_0x306d22){_0x550966=_0x306d22;_0x2f1be8[_0xc5c3('0x36')]=_[_0xc5c3('0x38')](db[_0xc5c3('0x7c')][_0xc5c3('0x33')]);_0x2f1be8[_0xc5c3('0x37')]=_['keys'](_0x3aa5e2[_0xc5c3('0x37')]);_0x2f1be8[_0xc5c3('0x42')]=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],_0x2f1be8[_0xc5c3('0x37')]);_0x258e36['attributes']=_[_0xc5c3('0x39')](_0x2f1be8[_0xc5c3('0x36')],qs[_0xc5c3('0x3b')](_0x3aa5e2[_0xc5c3('0x37')]['fields']));_0x258e36[_0xc5c3('0x3a')]=_0x258e36[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x258e36['attributes']:_0x2f1be8[_0xc5c3('0x36')];_0x258e36[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x40')]);_0x258e36[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_[_0xc5c3('0x7d')](_0x3aa5e2[_0xc5c3('0x37')],_0x2f1be8[_0xc5c3('0x42')]));if(_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x43')]){_0x258e36[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x258e36[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x258e36['attributes'],function(_0x2bf9d2){var _0x8aaa64={};_0x8aaa64[_0x2bf9d2]={'$like':'%'+_0x3aa5e2['query'][_0xc5c3('0x43')]+'%'};return _0x8aaa64;})});}_0x258e36=_['merge']({},_0x258e36,_0x3aa5e2[_0xc5c3('0x4c')]);return _0x550966[_0xc5c3('0x7a')](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x1800a0){if(_0x1800a0){_0x5733a2=_0x1800a0[_0xc5c3('0x3c')];if(!_0x3aa5e2['query'][_0xc5c3('0x3d')](_0xc5c3('0x3e'))){_0x258e36[_0xc5c3('0x21')]=qs['limit'](_0x3aa5e2['query'][_0xc5c3('0x21')]);_0x258e36['offset']=qs[_0xc5c3('0x20')](_0x3aa5e2[_0xc5c3('0x37')][_0xc5c3('0x20')]);}return _0x550966['getAgents'](_0x258e36);}})[_0xc5c3('0x2a')](function(_0x3325b6){if(_0x3325b6){return _0x3325b6?{'count':_0x5733a2,'rows':_0x3325b6}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x1efa1d,null))[_0xc5c3('0x48')](handleError(_0x1efa1d,null));};exports[_0xc5c3('0x7e')]=function(_0x57070d,_0x2f5315,_0x37ef35){var _0x2dcae5={};var _0x5d5248={};var _0xd3091c;var _0x26292e;return db[_0xc5c3('0x32')][_0xc5c3('0x7b')]({'where':{'id':_0x57070d[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](handleEntityNotFound(_0x2f5315,null))[_0xc5c3('0x2a')](function(_0x12d800){if(_0x12d800){_0xd3091c=_0x12d800;_0x5d5248['model']=_[_0xc5c3('0x38')](db['Team'][_0xc5c3('0x33')]);_0x5d5248[_0xc5c3('0x37')]=_['keys'](_0x57070d[_0xc5c3('0x37')]);_0x5d5248[_0xc5c3('0x42')]=_['intersection'](_0x5d5248[_0xc5c3('0x36')],_0x5d5248[_0xc5c3('0x37')]);_0x2dcae5[_0xc5c3('0x3a')]=_[_0xc5c3('0x39')](_0x5d5248[_0xc5c3('0x36')],qs['fields'](_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x3b')]));_0x2dcae5[_0xc5c3('0x3a')]=_0x2dcae5[_0xc5c3('0x3a')][_0xc5c3('0x3c')]?_0x2dcae5[_0xc5c3('0x3a')]:_0x5d5248['model'];_0x2dcae5[_0xc5c3('0x3f')]=qs[_0xc5c3('0x40')](_0x57070d['query']['sort']);_0x2dcae5[_0xc5c3('0x41')]=qs[_0xc5c3('0x42')](_['pick'](_0x57070d[_0xc5c3('0x37')],_0x5d5248[_0xc5c3('0x42')]));if(_0x57070d[_0xc5c3('0x37')]['filter']){_0x2dcae5[_0xc5c3('0x41')]=_[_0xc5c3('0x44')](_0x2dcae5[_0xc5c3('0x41')],{'$or':_[_0xc5c3('0x31')](_0x2dcae5[_0xc5c3('0x3a')],function(_0x86d21a){var _0x53f1d={};_0x53f1d[_0x86d21a]={'$like':'%'+_0x57070d[_0xc5c3('0x37')][_0xc5c3('0x43')]+'%'};return _0x53f1d;})});}_0x2dcae5=_[_0xc5c3('0x44')]({},_0x2dcae5,_0x57070d[_0xc5c3('0x4c')]);return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})['then'](function(_0x48e3a2){if(_0x48e3a2){_0x26292e=_0x48e3a2[_0xc5c3('0x3c')];if(!_0x57070d['query']['hasOwnProperty'](_0xc5c3('0x3e'))){_0x2dcae5['limit']=qs[_0xc5c3('0x21')](_0x57070d[_0xc5c3('0x37')]['limit']);_0x2dcae5['offset']=qs[_0xc5c3('0x20')](_0x57070d['query']['offset']);}return _0xd3091c[_0xc5c3('0x7e')](_0x2dcae5);}})[_0xc5c3('0x2a')](function(_0x3ce0e9){if(_0x3ce0e9){return _0x3ce0e9?{'count':_0x26292e,'rows':_0x3ce0e9}:null;}})[_0xc5c3('0x2a')](respondWithResult(_0x2f5315,null))[_0xc5c3('0x48')](handleError(_0x2f5315,null));};exports[_0xc5c3('0x7f')]=function(_0x116965,_0xa4672a,_0x1aba09){var _0x557b8f=_0x116965['body'][_0xc5c3('0x74')];var _0x389c96;return db[_0xc5c3('0x80')][_0xc5c3('0x81')]({'where':{'id':_0x557b8f},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id',_0xc5c3('0x2e'),'online',_0xc5c3('0x82'),_0xc5c3('0x83')],'raw':!![]}]})[_0xc5c3('0x2a')](function(_0x2c8937){if(_0x2c8937){_0x389c96=_0x2c8937;var _0x9e9372=_[_0xc5c3('0x84')](_0x2c8937,function(_0x1dcde5){var _0x2c8fdb=_0x1dcde5['get']({'plain':!![]});return _0x2c8fdb['Agents'];});return db['VoicePrefix'][_0xc5c3('0x4d')]({'where':{'id':_0x116965[_0xc5c3('0x4a')]['id']}})[_0xc5c3('0x2a')](function(_0x3cc60b){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x2c5fd2){return _0x3cc60b[_0xc5c3('0x7f')](_0x557b8f,{'transaction':_0x2c5fd2})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x389c96,function(_0x554787){return db[_0xc5c3('0x86')][_0xc5c3('0x87')]({'TeamId':_0x554787['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},{'transaction':_0x2c5fd2});});})[_0xc5c3('0x2a')](function(){return BPromise[_0xc5c3('0x85')](_0x9e9372,function(_0x589e28){return db[_0xc5c3('0x88')][_0xc5c3('0x89')]({'where':{'UserId':_0x589e28['id'],'VoicePrefixId':_0x116965[_0xc5c3('0x4a')]['id']},'transaction':_0x2c5fd2});});})['then'](function(){_0x9e9372[_0xc5c3('0x8a')](function(_0x2dd850){socket[_0xc5c3('0x79')](_0xc5c3('0x8b'),{'UserId':_0x2dd850['id'],'VoicePrefixId':_0x3cc60b['id']});});});});});}})[_0xc5c3('0x2a')](respondWithStatusCode(_0xa4672a,null))[_0xc5c3('0x48')](handleError(_0xa4672a,null));};exports[_0xc5c3('0x8c')]=function(_0x53a502,_0x762654,_0x37459f){return db['Team'][_0xc5c3('0x81')]({'where':{'id':_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')]},'attributes':['id'],'include':[{'model':db[_0xc5c3('0x7c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc5c3('0x2a')](handleEntityNotFound(_0x762654,null))[_0xc5c3('0x2a')](function(_0x3aafa0){var _0xe80b2b=_[_0xc5c3('0x31')](_0x3aafa0,'id');var _0x2b49da=[];var _0x47bd08=[];var _0x314072=squel[_0xc5c3('0x8d')]();_0x314072['field'](_0xc5c3('0x8e'))['from'](_0xc5c3('0x8f'),'tq')[_0xc5c3('0x90')](_0xc5c3('0x91'),'ut',_0xc5c3('0x92'))['where']('VoicePrefixId\x20=\x20?',_0x53a502['params']['id']);for(var _0x3b5ca9=0x0;_0x3b5ca9<_0x3aafa0[_0xc5c3('0x3c')];_0x3b5ca9+=0x1){let _0x283935=_0x3aafa0[_0x3b5ca9];for(var _0x5cebbc=0x0;_0x5cebbc<_0x283935[_0xc5c3('0x93')]['length'];_0x5cebbc+=0x1){let _0x423b48=_0x283935[_0xc5c3('0x93')][_0x5cebbc];var _0x2a8dfc=_0x314072[_0xc5c3('0x94')]();_0x2a8dfc[_0xc5c3('0x41')](_0xc5c3('0x95'),_0x423b48['id']);_0x47bd08[_0xc5c3('0x69')](db[_0xc5c3('0x4f')][_0xc5c3('0x37')](_0x2a8dfc[_0xc5c3('0x96')](),{'type':db['sequelize'][_0xc5c3('0x97')]['SELECT']})[_0xc5c3('0x2a')](function(_0x397543){if(_0x397543[_0xc5c3('0x3c')]===0x1){return _0x423b48['id'];}else{var _0x21941a=_['every'](_[_0xc5c3('0x31')](_0x397543,_0xc5c3('0x98')),function(_0x1b7fc8){return _['includes'](_0xe80b2b,_0x1b7fc8);});if(_0x21941a){return _0x423b48['id'];}}}));}}return BPromise['all'](_0x47bd08)[_0xc5c3('0x2a')](function(_0x5731da){_0x2b49da=_(_0x2b49da)[_0xc5c3('0x99')](_0x5731da)[_0xc5c3('0x9a')]()['value']();return db[_0xc5c3('0x32')][_0xc5c3('0x4d')]({'where':{'id':_0x53a502['params']['id']}})['then'](function(_0x288b93){return db[_0xc5c3('0x4f')][_0xc5c3('0x50')](function(_0x187a7a){return _0x288b93['removeTeams'](_0x53a502[_0xc5c3('0x37')][_0xc5c3('0x74')],{'transaction':_0x187a7a})[_0xc5c3('0x2a')](function(){if(!_['isEmpty'](_0x2b49da)){return _0x288b93[_0xc5c3('0x76')](_0x2b49da,{'transaction':_0x187a7a});}})[_0xc5c3('0x2a')](function(){_0x2b49da['forEach'](function(_0x8ec6b6){socket[_0xc5c3('0x79')](_0xc5c3('0x78'),{'UserId':_0x8ec6b6,'VoicePrefixId':_0x288b93['id']});});});});});});})[_0xc5c3('0x2a')](respondWithStatusCode(_0x762654,null))[_0xc5c3('0x48')](handleError(_0x762654,null));}; \ No newline at end of file +var _0xc900=['voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','tq.TeamId','from','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','end','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VoicePrefix','includeAll','include','findAll','show','params','options','catch','destroy','find','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','context','exten','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','update','system-','sequelize','findById','addAgents','omit','ids','spread','emit','userVoicePrefix:save','isArray','userVoicePrefix:remove','getAgents','findOne','User','hasOwnProperty','Team','getTeams','addTeams','Agents'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xc900,0xb3));var _0x0c90=function(_0x24ad86,_0x1f3dd5){_0x24ad86=_0x24ad86-0x0;var _0x1be2cd=_0xc900[_0x24ad86];return _0x1be2cd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];config['redis']=_[_0x0c90('0x19')](config[_0x0c90('0x1a')],{'host':_0x0c90('0x1b'),'port':0x18eb});var socket=require(_0x0c90('0x1c'))(new Redis(config[_0x0c90('0x1a')]));require('./voicePrefix.socket')[_0x0c90('0x1d')](socket);function respondWithStatusCode(_0x4451e0,_0x4f35f4){_0x4f35f4=_0x4f35f4||0xcc;return function(_0x2c82a4){if(_0x2c82a4){return _0x4451e0[_0x0c90('0x1e')](_0x4f35f4);}return _0x4451e0[_0x0c90('0x1f')](_0x4f35f4)['end']();};}function respondWithResult(_0x5daeb7,_0x412635){_0x412635=_0x412635||0xc8;return function(_0x15ca42){if(_0x15ca42){return _0x5daeb7[_0x0c90('0x1f')](_0x412635)[_0x0c90('0x20')](_0x15ca42);}};}function respondWithFilteredResult(_0x276b92,_0x2cab22){return function(_0x42321a){if(_0x42321a){var _0x57b9a6=typeof _0x2cab22[_0x0c90('0x21')]===_0x0c90('0x22')&&typeof _0x2cab22[_0x0c90('0x23')]===_0x0c90('0x22');var _0x594267=_0x42321a[_0x0c90('0x24')];var _0xd129ca=_0x57b9a6?0x0:_0x2cab22[_0x0c90('0x21')];var _0x1241a9=_0x57b9a6?_0x42321a[_0x0c90('0x24')]:_0x2cab22[_0x0c90('0x21')]+_0x2cab22['limit'];var _0x365a42;if(_0x1241a9>=_0x594267){_0x1241a9=_0x594267;_0x365a42=0xc8;}else{_0x365a42=0xce;}_0x276b92['status'](_0x365a42);return _0x276b92[_0x0c90('0x25')](_0x0c90('0x26'),_0xd129ca+'-'+_0x1241a9+'/'+_0x594267)['json'](_0x42321a);}return null;};}function patchUpdates(_0x2a053a){return function(_0x43ddc3){try{jsonpatch[_0x0c90('0x27')](_0x43ddc3,_0x2a053a,!![]);}catch(_0x86dee){return BPromise[_0x0c90('0x28')](_0x86dee);}return _0x43ddc3[_0x0c90('0x29')]();};}function saveUpdates(_0x4dfbc3,_0x26f0a3){return function(_0x12f22c){if(_0x12f22c){return _0x12f22c['update'](_0x4dfbc3)['then'](function(_0x28d005){return _0x28d005;});}return null;};}function removeEntity(_0x3ea861,_0x35c243){return function(_0x109a5f){if(_0x109a5f){return _0x109a5f['destroy']()[_0x0c90('0x2a')](function(){var _0x438652=_0x109a5f[_0x0c90('0x2b')]({'plain':!![]});var _0x277d4a=_0x0c90('0x2c');return db[_0x0c90('0x2d')]['destroy']({'where':{'type':_0x277d4a,'resourceId':_0x438652['id']}})[_0x0c90('0x2a')](function(){return _0x109a5f;});})[_0x0c90('0x2a')](function(){_0x3ea861[_0x0c90('0x1f')](0xcc)[_0x0c90('0x2e')]();});}};}function handleEntityNotFound(_0x52d28d,_0x4c8603){return function(_0x1f27f1){if(!_0x1f27f1){_0x52d28d[_0x0c90('0x1e')](0x194);}return _0x1f27f1;};}function handleError(_0x3bff04,_0x122a4f){_0x122a4f=_0x122a4f||0x1f4;return function(_0x119e09){logger['error'](_0x119e09[_0x0c90('0x2f')]);if(_0x119e09[_0x0c90('0x30')]){delete _0x119e09[_0x0c90('0x30')];}_0x3bff04['status'](_0x122a4f)[_0x0c90('0x31')](_0x119e09);};}exports['index']=function(_0x54a3f5,_0x886634){var _0x5071b={},_0x2f0835={},_0x41189f={'count':0x0,'rows':[]};var _0x58c01a=_[_0x0c90('0x32')](db['VoicePrefix'][_0x0c90('0x33')],function(_0x5a0e75){return{'name':_0x5a0e75[_0x0c90('0x34')],'type':_0x5a0e75[_0x0c90('0x35')]['key']};});_0x2f0835[_0x0c90('0x36')]=_[_0x0c90('0x32')](_0x58c01a,_0x0c90('0x30'));_0x2f0835[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x54a3f5[_0x0c90('0x37')]);_0x2f0835[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x2f0835['model'],_0x2f0835[_0x0c90('0x37')]);_0x5071b[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x2f0835[_0x0c90('0x36')],qs['fields'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x5071b[_0x0c90('0x3b')]=_0x5071b[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x5071b[_0x0c90('0x3b')]:_0x2f0835[_0x0c90('0x36')];if(!_0x54a3f5[_0x0c90('0x37')]['hasOwnProperty'](_0x0c90('0x3e'))){_0x5071b[_0x0c90('0x23')]=qs['limit'](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x23')]);_0x5071b[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x54a3f5[_0x0c90('0x37')]['offset']);}_0x5071b[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x40')]);_0x5071b[_0x0c90('0x41')]=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x54a3f5[_0x0c90('0x37')],_0x2f0835[_0x0c90('0x39')]),_0x58c01a);if(_0x54a3f5['query'][_0x0c90('0x43')]){_0x5071b['where']=_[_0x0c90('0x44')](_0x5071b['where'],{'$or':_[_0x0c90('0x32')](_0x58c01a,function(_0x62e316){if(_0x62e316['type']!=='VIRTUAL'){var _0x27ef6f={};_0x27ef6f[_0x62e316['name']]={'$like':'%'+_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x27ef6f;}})});}_0x5071b=_[_0x0c90('0x44')]({},_0x5071b,_0x54a3f5['options']);var _0x2ad8eb={'where':_0x5071b[_0x0c90('0x41')]};return db[_0x0c90('0x45')][_0x0c90('0x24')](_0x2ad8eb)[_0x0c90('0x2a')](function(_0x1184c4){_0x41189f['count']=_0x1184c4;if(_0x54a3f5[_0x0c90('0x37')][_0x0c90('0x46')]){_0x5071b[_0x0c90('0x47')]=[{'all':!![]}];}return db[_0x0c90('0x45')][_0x0c90('0x48')](_0x5071b);})[_0x0c90('0x2a')](function(_0x30b9df){_0x41189f['rows']=_0x30b9df;return _0x41189f;})[_0x0c90('0x2a')](respondWithFilteredResult(_0x886634,_0x5071b))['catch'](handleError(_0x886634,null));};exports[_0x0c90('0x49')]=function(_0x2470ce,_0x1a7a36){var _0x1179b0={'raw':![],'where':{'id':_0x2470ce[_0x0c90('0x4a')]['id']}},_0x38842c={};_0x38842c[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x45')][_0x0c90('0x33')]);_0x38842c[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2470ce[_0x0c90('0x37')]);_0x38842c[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x38842c['model'],_0x38842c[_0x0c90('0x37')]);_0x1179b0[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x38842c[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x2470ce[_0x0c90('0x37')][_0x0c90('0x3c')]));_0x1179b0[_0x0c90('0x3b')]=_0x1179b0[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x1179b0[_0x0c90('0x3b')]:_0x38842c[_0x0c90('0x36')];if(_0x2470ce[_0x0c90('0x37')][_0x0c90('0x46')]){_0x1179b0['include']=[{'all':!![]}];}_0x1179b0=_[_0x0c90('0x44')]({},_0x1179b0,_0x2470ce[_0x0c90('0x4b')]);return db['VoicePrefix']['find'](_0x1179b0)['then'](handleEntityNotFound(_0x1a7a36,null))[_0x0c90('0x2a')](respondWithResult(_0x1a7a36,null))[_0x0c90('0x4c')](handleError(_0x1a7a36,null));};exports[_0x0c90('0x4d')]=function(_0x3fbdfc,_0x11d2de){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x3fbdfc[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x11d2de,null))['then'](removeEntity(_0x11d2de,null))[_0x0c90('0x4c')](handleError(_0x11d2de,null));};exports[_0x0c90('0x4f')]=function(_0xd639a1,_0xb483e7){return db[_0x0c90('0x45')][_0x0c90('0x4f')]()[_0x0c90('0x2a')](respondWithResult(_0xb483e7,null))[_0x0c90('0x4c')](handleError(_0xb483e7,null));};exports[_0x0c90('0x50')]=function(_0xeeee3b,_0x5e288e){var _0xac80b2;return db['sequelize'][_0x0c90('0x51')](function(_0x67539d){return db[_0x0c90('0x45')][_0x0c90('0x50')](_0xeeee3b[_0x0c90('0x52')],{'transaction':_0x67539d})[_0x0c90('0x2a')](function(_0x58dcfc){_0xac80b2=_0x58dcfc['get']({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xac80b2[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x3bf5de){return createVoicePrefixExtensions(_0xac80b2,_0x3bf5de,_0x67539d);});});})['then'](function(){var _0x202666=_0xeeee3b[_0x0c90('0x54')]['get']({'plain':!![]});if(!_0x202666)throw new Error(_0x0c90('0x55'));if(_0x202666['role']===_0x0c90('0x54')){var _0x8951f2=_0xac80b2;return db[_0x0c90('0x56')][_0x0c90('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x202666[_0x0c90('0x57')]},'raw':!![]})['then'](function(_0x344613){if(_0x344613&&_0x344613[_0x0c90('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x8951f2['name'],'resourceId':_0x8951f2['id'],'type':_0x344613[_0x0c90('0x30')],'sectionId':_0x344613['id']},{})[_0x0c90('0x2a')](function(){return _0xac80b2;});}else{return _0xac80b2;}})[_0x0c90('0x4c')](function(_0x2f61cb){logger[_0x0c90('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f61cb);throw _0x2f61cb;});}return _0xac80b2;})[_0x0c90('0x2a')](respondWithResult(_0x5e288e,null))[_0x0c90('0x4c')](handleError(_0x5e288e,null));};function Extension(_0x5ee971,_0x3eb725,_0x5a11e5,_0x24326b){this[_0x0c90('0x5a')]='from-sip';this[_0x0c90('0x5b')]=_0x5ee971;this['app']=_0x5a11e5;this['type']='system';this[_0x0c90('0x5c')]=_0x0c90('0x5d');this[_0x0c90('0x5e')]=_0x3eb725;this[_0x0c90('0x5f')]=_0x24326b;}function createVoicePrefixExtensions(_0x536a26,_0x5b385b,_0x426f65){return new BPromise(function(_0xd982c5,_0x120b88){var _0x4c4e5a=new Extension(formatPrefixName(_0x536a26[_0x0c90('0x60')]),0x1,_0x0c90('0x61'),_0x0c90('0x62'));_0x4c4e5a['VoicePrefixId']=_0x536a26['id'];return db[_0x0c90('0x63')][_0x0c90('0x50')](_0x4c4e5a,{'transaction':_0x426f65})[_0x0c90('0x2a')](function(_0x521436){var _0x31343b=_0x521436[_0x0c90('0x2b')]({'plain':!![]});var _0x1a198b=_[_0x0c90('0x32')](addVoicePrefixExtensions(_0x536a26,_0x5b385b),function(_0xf58a25){_0xf58a25[_0x0c90('0x53')]=_0x31343b['id'];_0xf58a25[_0x0c90('0x64')]=_0x536a26['id'];return _0xf58a25;});return db[_0x0c90('0x63')][_0x0c90('0x65')](_0x1a198b,{'transaction':_0x426f65})['then'](function(_0x530bbe){if(!_0x530bbe){return _0x120b88(_0x0c90('0x66'));}else{return _0xd982c5(_0x530bbe);}})[_0x0c90('0x4c')](function(_0x3a44df){return _0x120b88(_0x3a44df);});});;});};function addVoicePrefixExtensions(_0x2faf14,_0x19dae5){var _0x2dad30=[];var _0x2f1459=formatPrefixName(_0x2faf14[_0x0c90('0x60')]);_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x2,_0x0c90('0x68'),_0x0c90('0x69')+_0x2faf14[_0x0c90('0x30')]));if(_0x2faf14[_0x0c90('0x6a')]){_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x68'),'PREFIX-CALLERIDALL='+_0x2faf14[_0x0c90('0x6a')]));}else{_0x2dad30[_0x0c90('0x67')](new Extension(_0x2f1459,0x3,_0x0c90('0x61'),'No\x20callerid\x20available'));}_0x2dad30['push'](new Extension(_0x2f1459,0x4,_0x0c90('0x6b'),_0x19dae5['context']+','+_0x0c90('0x6c')+(0x8+_0x2faf14[_0x0c90('0x30')]['length'])+'}'+','+0x1));return _0x2dad30;}function formatPrefixName(_0x2c64e0){var _0x3f4819='_';for(var _0x25ef97=0x0;_0x25ef97<_0x2c64e0[_0x0c90('0x3d')];_0x25ef97++){if(_0x2c64e0['charAt'](_0x25ef97)=='-'){_0x3f4819+=_0x2c64e0['charAt'](_0x25ef97);}else{_0x3f4819+='['+_0x2c64e0['charAt'](_0x25ef97)+']';}}_0x3f4819+='.';return _0x3f4819;}exports[_0x0c90('0x6d')]=function(_0x2d3287,_0x3bc90d,_0x2d5fe3){var _0x4a801f=_0x2d3287[_0x0c90('0x52')];_0x4a801f['prefix']=_0x0c90('0x6e')+_0x4a801f[_0x0c90('0x30')]+'-';return db[_0x0c90('0x6f')]['transaction'](function(_0x10f686){return db[_0x0c90('0x45')][_0x0c90('0x6d')](_0x4a801f,{'where':{'id':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x4a801f['id']},'transaction':_0x10f686})[_0x0c90('0x2a')](function(){return db['VoiceExtension'][_0x0c90('0x4e')]({'where':{'id':_0x4a801f[_0x0c90('0x53')]},'raw':!![]})[_0x0c90('0x2a')](function(_0x4a59b5){return createVoicePrefixExtensions(_0x4a801f,_0x4a59b5,_0x10f686);});});});})[_0x0c90('0x2a')](function(){return db[_0x0c90('0x45')][_0x0c90('0x70')](_0x4a801f['id']);})[_0x0c90('0x2a')](respondWithResult(_0x3bc90d,null))[_0x0c90('0x4c')](handleError(_0x3bc90d,null));};exports[_0x0c90('0x71')]=function(_0x53779b,_0x28a2f0,_0x431828){return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x53779b[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x28a2f0,null))[_0x0c90('0x2a')](function(_0x1777ac){if(_0x1777ac){return _0x1777ac[_0x0c90('0x71')](_0x53779b[_0x0c90('0x52')]['ids'],_[_0x0c90('0x72')](_0x53779b[_0x0c90('0x52')],[_0x0c90('0x73'),'id'])||{})[_0x0c90('0x74')](function(_0x4e8330){for(var _0x2e68ea=0x0;_0x2e68ea<_0x53779b[_0x0c90('0x52')][_0x0c90('0x73')]['length'];_0x2e68ea+=0x1){socket[_0x0c90('0x75')](_0x0c90('0x76'),{'UserId':Number(_0x53779b['body'][_0x0c90('0x73')][_0x2e68ea]),'VoicePrefixId':Number(_0x53779b['params']['id'])});}return _0x4e8330;});}})[_0x0c90('0x2a')](respondWithResult(_0x28a2f0,null))['catch'](handleError(_0x28a2f0,null));};exports['removeAgents']=function(_0x42e76a,_0x137c30,_0x56a38b){return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x42e76a[_0x0c90('0x4a')]['id']}})['then'](handleEntityNotFound(_0x137c30,null))['then'](function(_0x250d41){if(_0x250d41){return _0x250d41['removeAgents'](_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')])[_0x0c90('0x2a')](function(){if(_[_0x0c90('0x77')](_0x42e76a[_0x0c90('0x37')]['ids'])){for(var _0x471caa=0x0;_0x471caa<_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')]['length'];_0x471caa+=0x1){socket['emit'](_0x0c90('0x78'),{'UserId':Number(_0x42e76a[_0x0c90('0x37')][_0x0c90('0x73')][_0x471caa]),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x42e76a[_0x0c90('0x37')]['ids']),'VoicePrefixId':Number(_0x42e76a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x137c30,null))['catch'](handleError(_0x137c30,null));};exports[_0x0c90('0x79')]=function(_0x2ca017,_0x1bf6e0,_0x29ede1){var _0x16c383={};var _0x56a3bc={};var _0x5562cc;var _0x57eab8;return db[_0x0c90('0x45')][_0x0c90('0x7a')]({'where':{'id':_0x2ca017[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x1bf6e0,null))[_0x0c90('0x2a')](function(_0x3d5521){if(_0x3d5521){_0x5562cc=_0x3d5521;_0x56a3bc['model']=_[_0x0c90('0x38')](db[_0x0c90('0x7b')][_0x0c90('0x33')]);_0x56a3bc[_0x0c90('0x37')]=_[_0x0c90('0x38')](_0x2ca017[_0x0c90('0x37')]);_0x56a3bc[_0x0c90('0x39')]=_[_0x0c90('0x3a')](_0x56a3bc[_0x0c90('0x36')],_0x56a3bc[_0x0c90('0x37')]);_0x16c383[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x56a3bc['model'],qs[_0x0c90('0x3c')](_0x2ca017['query'][_0x0c90('0x3c')]));_0x16c383['attributes']=_0x16c383[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x16c383[_0x0c90('0x3b')]:_0x56a3bc[_0x0c90('0x36')];_0x16c383['order']=qs['sort'](_0x2ca017[_0x0c90('0x37')][_0x0c90('0x40')]);_0x16c383['where']=qs[_0x0c90('0x39')](_[_0x0c90('0x42')](_0x2ca017['query'],_0x56a3bc[_0x0c90('0x39')]));if(_0x2ca017[_0x0c90('0x37')]['filter']){_0x16c383[_0x0c90('0x41')]=_['merge'](_0x16c383[_0x0c90('0x41')],{'$or':_[_0x0c90('0x32')](_0x16c383[_0x0c90('0x3b')],function(_0x1b95db){var _0x519f74={};_0x519f74[_0x1b95db]={'$like':'%'+_0x2ca017[_0x0c90('0x37')]['filter']+'%'};return _0x519f74;})});}_0x16c383=_[_0x0c90('0x44')]({},_0x16c383,_0x2ca017[_0x0c90('0x4b')]);return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})[_0x0c90('0x2a')](function(_0x1306bb){if(_0x1306bb){_0x57eab8=_0x1306bb['length'];if(!_0x2ca017[_0x0c90('0x37')][_0x0c90('0x7c')](_0x0c90('0x3e'))){_0x16c383[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x2ca017[_0x0c90('0x37')]['limit']);_0x16c383[_0x0c90('0x21')]=qs[_0x0c90('0x21')](_0x2ca017['query'][_0x0c90('0x21')]);}return _0x5562cc[_0x0c90('0x79')](_0x16c383);}})['then'](function(_0x199d05){if(_0x199d05){return _0x199d05?{'count':_0x57eab8,'rows':_0x199d05}:null;}})[_0x0c90('0x2a')](respondWithResult(_0x1bf6e0,null))['catch'](handleError(_0x1bf6e0,null));};exports['getTeams']=function(_0x13c69c,_0x407c6e,_0x4859e9){var _0x391e3f={};var _0x4fee0e={};var _0x37d1d5;var _0x4c142b;return db['VoicePrefix'][_0x0c90('0x7a')]({'where':{'id':_0x13c69c[_0x0c90('0x4a')]['id']}})[_0x0c90('0x2a')](handleEntityNotFound(_0x407c6e,null))['then'](function(_0x54846c){if(_0x54846c){_0x37d1d5=_0x54846c;_0x4fee0e[_0x0c90('0x36')]=_[_0x0c90('0x38')](db[_0x0c90('0x7d')][_0x0c90('0x33')]);_0x4fee0e[_0x0c90('0x37')]=_['keys'](_0x13c69c[_0x0c90('0x37')]);_0x4fee0e['filters']=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],_0x4fee0e[_0x0c90('0x37')]);_0x391e3f[_0x0c90('0x3b')]=_[_0x0c90('0x3a')](_0x4fee0e[_0x0c90('0x36')],qs[_0x0c90('0x3c')](_0x13c69c['query']['fields']));_0x391e3f[_0x0c90('0x3b')]=_0x391e3f[_0x0c90('0x3b')][_0x0c90('0x3d')]?_0x391e3f[_0x0c90('0x3b')]:_0x4fee0e[_0x0c90('0x36')];_0x391e3f[_0x0c90('0x3f')]=qs[_0x0c90('0x40')](_0x13c69c[_0x0c90('0x37')]['sort']);_0x391e3f[_0x0c90('0x41')]=qs['filters'](_[_0x0c90('0x42')](_0x13c69c[_0x0c90('0x37')],_0x4fee0e[_0x0c90('0x39')]));if(_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]){_0x391e3f[_0x0c90('0x41')]=_[_0x0c90('0x44')](_0x391e3f['where'],{'$or':_['map'](_0x391e3f[_0x0c90('0x3b')],function(_0x4a001d){var _0x2204fe={};_0x2204fe[_0x4a001d]={'$like':'%'+_0x13c69c[_0x0c90('0x37')][_0x0c90('0x43')]+'%'};return _0x2204fe;})});}_0x391e3f=_['merge']({},_0x391e3f,_0x13c69c[_0x0c90('0x4b')]);return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x30be13){if(_0x30be13){_0x4c142b=_0x30be13[_0x0c90('0x3d')];if(!_0x13c69c['query']['hasOwnProperty'](_0x0c90('0x3e'))){_0x391e3f[_0x0c90('0x23')]=qs[_0x0c90('0x23')](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x23')]);_0x391e3f[_0x0c90('0x21')]=qs['offset'](_0x13c69c[_0x0c90('0x37')][_0x0c90('0x21')]);}return _0x37d1d5[_0x0c90('0x7e')](_0x391e3f);}})[_0x0c90('0x2a')](function(_0x5103ae){if(_0x5103ae){return _0x5103ae?{'count':_0x4c142b,'rows':_0x5103ae}:null;}})['then'](respondWithResult(_0x407c6e,null))[_0x0c90('0x4c')](handleError(_0x407c6e,null));};exports[_0x0c90('0x7f')]=function(_0x59e8d9,_0x9bed36,_0x379a0e){var _0x19a144=_0x59e8d9[_0x0c90('0x52')][_0x0c90('0x73')];var _0x5379bc;return db[_0x0c90('0x7d')]['findAll']({'where':{'id':_0x19a144},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id',_0x0c90('0x30'),'online',_0x0c90('0x81'),_0x0c90('0x82')],'raw':!![]}]})[_0x0c90('0x2a')](function(_0x5f295e){if(_0x5f295e){_0x5379bc=_0x5f295e;var _0x5a2961=_['flatMap'](_0x5f295e,function(_0x4930cd){var _0x2858a9=_0x4930cd[_0x0c90('0x2b')]({'plain':!![]});return _0x2858a9['Agents'];});return db['VoicePrefix'][_0x0c90('0x4e')]({'where':{'id':_0x59e8d9['params']['id']}})[_0x0c90('0x2a')](function(_0x13c0f2){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x1091fb){return _0x13c0f2['addTeams'](_0x19a144,{'transaction':_0x1091fb})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5379bc,function(_0x35ee25){return db[_0x0c90('0x84')][_0x0c90('0x85')]({'TeamId':_0x35ee25['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},{'transaction':_0x1091fb});});})[_0x0c90('0x2a')](function(){return BPromise[_0x0c90('0x83')](_0x5a2961,function(_0x3614d1){return db[_0x0c90('0x86')]['findOrCreate']({'where':{'UserId':_0x3614d1['id'],'VoicePrefixId':_0x59e8d9[_0x0c90('0x4a')]['id']},'transaction':_0x1091fb});});})['then'](function(){_0x5a2961[_0x0c90('0x87')](function(_0x40dd25){socket[_0x0c90('0x75')]('userVoicePrefix:save',{'UserId':_0x40dd25['id'],'VoicePrefixId':_0x13c0f2['id']});});});});});}})[_0x0c90('0x2a')](respondWithStatusCode(_0x9bed36,null))['catch'](handleError(_0x9bed36,null));};exports[_0x0c90('0x88')]=function(_0x1c2814,_0x2f542b,_0x3f3787){return db[_0x0c90('0x7d')][_0x0c90('0x48')]({'where':{'id':_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')]},'attributes':['id'],'include':[{'model':db[_0x0c90('0x7b')],'as':_0x0c90('0x80'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2f542b,null))[_0x0c90('0x2a')](function(_0x31dde9){var _0x37acdc=_['map'](_0x31dde9,'id');var _0x5f431d=[];var _0x2dabe6=[];var _0x28736e=squel['select']();_0x28736e['field'](_0x0c90('0x89'))[_0x0c90('0x8a')]('team_has_voice_prefixes','tq')[_0x0c90('0x8b')](_0x0c90('0x8c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0c90('0x41')](_0x0c90('0x8d'),_0x1c2814['params']['id']);for(var _0x1fb55a=0x0;_0x1fb55a<_0x31dde9['length'];_0x1fb55a+=0x1){let _0x5aa532=_0x31dde9[_0x1fb55a];for(var _0x8e8e30=0x0;_0x8e8e30<_0x5aa532[_0x0c90('0x80')]['length'];_0x8e8e30+=0x1){let _0x5c942d=_0x5aa532[_0x0c90('0x80')][_0x8e8e30];var _0x155915=_0x28736e[_0x0c90('0x8e')]();_0x155915[_0x0c90('0x41')](_0x0c90('0x8f'),_0x5c942d['id']);_0x2dabe6['push'](db[_0x0c90('0x6f')][_0x0c90('0x37')](_0x155915[_0x0c90('0x90')](),{'type':db[_0x0c90('0x6f')][_0x0c90('0x91')][_0x0c90('0x92')]})['then'](function(_0x18cc89){if(_0x18cc89['length']===0x1){return _0x5c942d['id'];}else{var _0x5e6e8f=_['every'](_[_0x0c90('0x32')](_0x18cc89,_0x0c90('0x93')),function(_0x53c760){return _[_0x0c90('0x94')](_0x37acdc,_0x53c760);});if(_0x5e6e8f){return _0x5c942d['id'];}}}));}}return BPromise['all'](_0x2dabe6)['then'](function(_0x22b3df){_0x5f431d=_(_0x5f431d)[_0x0c90('0x95')](_0x22b3df)[_0x0c90('0x96')]()[_0x0c90('0x97')]();return db[_0x0c90('0x45')][_0x0c90('0x4e')]({'where':{'id':_0x1c2814[_0x0c90('0x4a')]['id']}})['then'](function(_0x2eece9){return db[_0x0c90('0x6f')][_0x0c90('0x51')](function(_0x3817a4){return _0x2eece9[_0x0c90('0x88')](_0x1c2814[_0x0c90('0x37')][_0x0c90('0x73')],{'transaction':_0x3817a4})[_0x0c90('0x2a')](function(){if(!_[_0x0c90('0x98')](_0x5f431d)){return _0x2eece9[_0x0c90('0x99')](_0x5f431d,{'transaction':_0x3817a4});}})[_0x0c90('0x2a')](function(){_0x5f431d[_0x0c90('0x87')](function(_0x9187af){socket[_0x0c90('0x75')]('userVoicePrefix:remove',{'UserId':_0x9187af,'VoicePrefixId':_0x2eece9['id']});});});});});});})[_0x0c90('0x2a')](respondWithStatusCode(_0x2f542b,null))[_0x0c90('0x4c')](handleError(_0x2f542b,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 94c0812..dc793a8 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 _0x5476=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x5476,0x13f));var _0x6547=function(_0xa5178f,_0x57f8fc){_0xa5178f=_0xa5178f-0x0;var _0x8d03c=_0x5476[_0xa5178f];return _0x8d03c;};'use strict';var EventEmitter=require(_0x6547('0x0'));var VoicePrefix=require(_0x6547('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x6547('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x16b2b9){return function(_0x5724b5,_0x5e3b42,_0x3c967b){VoicePrefixEvents['emit'](_0x16b2b9+':'+_0x5724b5['id'],_0x5724b5);VoicePrefixEvents[_0x6547('0x3')](_0x16b2b9,_0x5724b5);_0x3c967b(null);};}for(var e in events){if(events[_0x6547('0x4')](e)){var event=events[e];VoicePrefix[_0x6547('0x5')](e,emitEvent(event));}}module[_0x6547('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x56f3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x56f3,0xdd));var _0x356f=function(_0x507858,_0x25df35){_0x507858=_0x507858-0x0;var _0x32ed29=_0x56f3[_0x507858];return _0x32ed29;};'use strict';var EventEmitter=require(_0x356f('0x0'));var VoicePrefix=require(_0x356f('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x356f('0x2')](0x0);var events={'afterCreate':_0x356f('0x3'),'afterUpdate':'update','afterDestroy':_0x356f('0x4')};function emitEvent(_0x3dd6ef){return function(_0x40a89c,_0x37efc7,_0x5cf25e){VoicePrefixEvents[_0x356f('0x5')](_0x3dd6ef+':'+_0x40a89c['id'],_0x40a89c);VoicePrefixEvents[_0x356f('0x5')](_0x3dd6ef,_0x40a89c);_0x5cf25e(null);};}for(var e in events){if(events[_0x356f('0x6')](e)){var event=events[e];VoicePrefix[_0x356f('0x7')](e,emitEvent(event));}}module[_0x356f('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 4e822fd..0700a2b 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 _0x9fbe=['exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x333640,_0x1b5684){var _0x4a5d45=function(_0xf43772){while(--_0xf43772){_0x333640['push'](_0x333640['shift']());}};_0x4a5d45(++_0x1b5684);}(_0x9fbe,0x160));var _0xe9fb=function(_0x17749b,_0x4b4e3e){_0x17749b=_0x17749b-0x0;var _0x37ad41=_0x9fbe[_0x17749b];return _0x37ad41;};'use strict';var _=require(_0xe9fb('0x0'));var util=require(_0xe9fb('0x1'));var logger=require(_0xe9fb('0x2'))('api');var moment=require(_0xe9fb('0x3'));var BPromise=require(_0xe9fb('0x4'));var rp=require(_0xe9fb('0x5'));var fs=require('fs');var path=require(_0xe9fb('0x6'));var rimraf=require('rimraf');var config=require(_0xe9fb('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xe9fb('0x8')]=function(_0x3a4bbe,_0x4c8b24){return _0x3a4bbe[_0xe9fb('0x9')](_0xe9fb('0xa'),attributes,{'tableName':_0xe9fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cb1=['VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define'];(function(_0x353e3f,_0x3222af){var _0x3feb54=function(_0x34332a){while(--_0x34332a){_0x353e3f['push'](_0x353e3f['shift']());}};_0x3feb54(++_0x3222af);}(_0x5cb1,0x15e));var _0x15cb=function(_0x2cefc5,_0x108d4e){_0x2cefc5=_0x2cefc5-0x0;var _0x5f39ce=_0x5cb1[_0x2cefc5];return _0x5f39ce;};'use strict';var _=require(_0x15cb('0x0'));var util=require(_0x15cb('0x1'));var logger=require(_0x15cb('0x2'))(_0x15cb('0x3'));var moment=require(_0x15cb('0x4'));var BPromise=require(_0x15cb('0x5'));var rp=require(_0x15cb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15cb('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x15cb('0x8')]=function(_0x246c7c,_0xe97b0d){return _0x246c7c[_0x15cb('0x9')](_0x15cb('0xa'),attributes,{'tableName':_0x15cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6fe7a2c..150fb70 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 _0x25d4=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a80f2,_0x3805cf){var _0x8ce82f=function(_0x1a0712){while(--_0x1a0712){_0x5a80f2['push'](_0x5a80f2['shift']());}};_0x8ce82f(++_0x3805cf);}(_0x25d4,0xb1));var _0x425d=function(_0xa9b435,_0x2678a0){_0xa9b435=_0xa9b435-0x0;var _0x2e6bf7=_0x25d4[_0xa9b435];return _0x2e6bf7;};'use strict';var _=require(_0x425d('0x0'));var util=require(_0x425d('0x1'));var moment=require(_0x425d('0x2'));var BPromise=require(_0x425d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x425d('0x4'));var db=require(_0x425d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x425d('0x6'))('rpc');var config=require(_0x425d('0x7'));var jayson=require(_0x425d('0x8'));var client=jayson[_0x425d('0x9')]['http']({'port':0x232a});config[_0x425d('0xa')]=_['defaults'](config[_0x425d('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x425d('0xa')]));require(_0x425d('0xb'))[_0x425d('0xc')](socket);function respondWithRpcPromise(_0x40edc0,_0x5ba9c0,_0x590df7){return new BPromise(function(_0x2a1efb,_0x5ddb60){return client[_0x425d('0xd')](_0x40edc0,_0x590df7)['then'](function(_0x1de3e7){logger[_0x425d('0xe')](_0x425d('0xf'),_0x5ba9c0,_0x425d('0x10'));logger[_0x425d('0x11')](_0x425d('0x12'),_0x5ba9c0,_0x425d('0x10'),JSON[_0x425d('0x13')](_0x1de3e7));if(_0x1de3e7['error']){if(_0x1de3e7[_0x425d('0x14')][_0x425d('0x15')]===0x1f4){logger[_0x425d('0x14')](_0x425d('0xf'),_0x5ba9c0,_0x1de3e7[_0x425d('0x14')][_0x425d('0x16')]);return _0x5ddb60(_0x1de3e7[_0x425d('0x14')][_0x425d('0x16')]);}logger[_0x425d('0x14')](_0x425d('0xf'),_0x5ba9c0,_0x1de3e7['error'][_0x425d('0x16')]);return _0x2a1efb(_0x1de3e7[_0x425d('0x14')][_0x425d('0x16')]);}else{logger[_0x425d('0xe')](_0x425d('0xf'),_0x5ba9c0,_0x425d('0x10'));_0x2a1efb(_0x1de3e7[_0x425d('0x17')][_0x425d('0x16')]);}})[_0x425d('0x18')](function(_0x597c14){logger['error'](_0x425d('0xf'),_0x5ba9c0,_0x597c14);_0x5ddb60(_0x597c14);});});} \ No newline at end of file +var _0xb511=['rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4e88bb,_0x2ae0eb){var _0x5b8c48=function(_0x1b4ce7){while(--_0x1b4ce7){_0x4e88bb['push'](_0x4e88bb['shift']());}};_0x5b8c48(++_0x2ae0eb);}(_0xb511,0x165));var _0x1b51=function(_0x985ed5,_0x1ee412){_0x985ed5=_0x985ed5-0x0;var _0x41a518=_0xb511[_0x985ed5];return _0x41a518;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});config[_0x1b51('0xa')]=_[_0x1b51('0xb')](config['redis'],{'host':_0x1b51('0xc'),'port':0x18eb});var socket=require(_0x1b51('0xd'))(new Redis(config[_0x1b51('0xa')]));require(_0x1b51('0xe'))[_0x1b51('0xf')](socket);function respondWithRpcPromise(_0x388fa7,_0x16a25b,_0x220ca2){return new BPromise(function(_0x4d01be,_0x337839){return client[_0x1b51('0x10')](_0x388fa7,_0x220ca2)[_0x1b51('0x11')](function(_0x3cc22d){logger[_0x1b51('0x12')](_0x1b51('0x13'),_0x16a25b,'request\x20sent');logger[_0x1b51('0x14')](_0x1b51('0x15'),_0x16a25b,_0x1b51('0x16'),JSON[_0x1b51('0x17')](_0x3cc22d));if(_0x3cc22d[_0x1b51('0x18')]){if(_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x19')]===0x1f4){logger['error'](_0x1b51('0x13'),_0x16a25b,_0x3cc22d['error']['message']);return _0x337839(_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x1a')]);}logger['error'](_0x1b51('0x13'),_0x16a25b,_0x3cc22d[_0x1b51('0x18')][_0x1b51('0x1a')]);return _0x4d01be(_0x3cc22d['error'][_0x1b51('0x1a')]);}else{logger[_0x1b51('0x12')](_0x1b51('0x13'),_0x16a25b,_0x1b51('0x16'));_0x4d01be(_0x3cc22d['result'][_0x1b51('0x1a')]);}})[_0x1b51('0x1b')](function(_0x153c33){logger['error']('VoicePrefix,\x20%s,\x20%s',_0x16a25b,_0x153c33);_0x337839(_0x153c33);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2d1edc6..2f1b65e 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 _0xcf14=['voicePrefix:','./voicePrefix.events','remove','update','emit','removeListener','register','length'];(function(_0x3e0a89,_0x1bcd31){var _0x2719b9=function(_0x4d40a2){while(--_0x4d40a2){_0x3e0a89['push'](_0x3e0a89['shift']());}};_0x2719b9(++_0x1bcd31);}(_0xcf14,0xa1));var _0x4cf1=function(_0xd1229a,_0x405b4a){_0xd1229a=_0xd1229a-0x0;var _0x865d3e=_0xcf14[_0xd1229a];return _0x865d3e;};'use strict';var VoicePrefixEvents=require(_0x4cf1('0x0'));var events=['save',_0x4cf1('0x1'),_0x4cf1('0x2')];function createListener(_0x55e5b6,_0x3401df){return function(_0x15f9b9){_0x3401df[_0x4cf1('0x3')](_0x55e5b6,_0x15f9b9);};}function removeListener(_0xc34979,_0x5de7f1){return function(){VoicePrefixEvents[_0x4cf1('0x4')](_0xc34979,_0x5de7f1);};}exports[_0x4cf1('0x5')]=function(_0x11a184){for(var _0x12076f=0x0,_0x32ad8c=events[_0x4cf1('0x6')];_0x12076f<_0x32ad8c;_0x12076f++){var _0x9efe60=events[_0x12076f];var _0x50273f=createListener(_0x4cf1('0x7')+_0x9efe60,_0x11a184);VoicePrefixEvents['on'](_0x9efe60,_0x50273f);}}; \ No newline at end of file +var _0x7ae7=['voicePrefix:','./voicePrefix.events','save','update','emit','removeListener','register','length'];(function(_0x36a6cd,_0x225b81){var _0x5d8e90=function(_0x196f6b){while(--_0x196f6b){_0x36a6cd['push'](_0x36a6cd['shift']());}};_0x5d8e90(++_0x225b81);}(_0x7ae7,0xd9));var _0x77ae=function(_0x24a97b,_0x2feac0){_0x24a97b=_0x24a97b-0x0;var _0x186301=_0x7ae7[_0x24a97b];return _0x186301;};'use strict';var VoicePrefixEvents=require(_0x77ae('0x0'));var events=[_0x77ae('0x1'),'remove',_0x77ae('0x2')];function createListener(_0x13da67,_0x176048){return function(_0xf7c23c){_0x176048[_0x77ae('0x3')](_0x13da67,_0xf7c23c);};}function removeListener(_0x897790,_0x1a4fc0){return function(){VoicePrefixEvents[_0x77ae('0x4')](_0x897790,_0x1a4fc0);};}exports[_0x77ae('0x5')]=function(_0x3dd200){for(var _0x276be6=0x0,_0x1fcff8=events[_0x77ae('0x6')];_0x276be6<_0x1fcff8;_0x276be6++){var _0x56197f=events[_0x276be6];var _0x131f0b=createListener(_0x77ae('0x7')+_0x56197f,_0x3dd200);VoicePrefixEvents['on'](_0x56197f,_0x131f0b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 3bfc169..a8fe408 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0xb10b[_0x3caeb5];return _0x5eca7e;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xb10b,0x12a));var _0xbb10=function(_0x36436d,_0x20292c){_0x36436d=_0x36436d-0x0;var _0x34615d=_0xb10b[_0x36436d];return _0x34615d;};'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 dd0a3a0..c847c4b 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 _0xfcbf=['rrmemory','linear','wrandom','rrordered','strategy','getDataValue','dialMethod','preview','booked','roundrobin','includes','setDataValue','INTEGER','yes','all','once','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ENUM','ringall','leastrecent','fewestcalls','random'];(function(_0x1b3e5f,_0xf928b3){var _0x33bc90=function(_0x464f0a){while(--_0x464f0a){_0x1b3e5f['push'](_0x1b3e5f['shift']());}};_0x33bc90(++_0xf928b3);}(_0xfcbf,0xf9));var _0xffcb=function(_0x286716,_0x55f1bd){_0x286716=_0x286716-0x0;var _0x19623e=_0xfcbf[_0x286716];return _0x19623e;};'use strict';var Sequelize=require(_0xffcb('0x0'));module[_0xffcb('0x1')]={'name':{'type':Sequelize[_0xffcb('0x2')],'allowNull':![],'unique':_0xffcb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xffcb('0x4'),_0xffcb('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xffcb('0x6')},'announce':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xffcb('0x7')]('rr',_0xffcb('0x8'),_0xffcb('0x9'),_0xffcb('0xa'),_0xffcb('0xb'),_0xffcb('0xc'),_0xffcb('0xd'),_0xffcb('0xe'),_0xffcb('0xf')),'allowNull':![],'defaultValue':_0xffcb('0x8'),'set':function(_0x297ba7){this['setDataValue'](_0xffcb('0x10'),_0x297ba7?_0x297ba7:_0xffcb('0xc'));},'get':function(){var _0x5aa582=this[_0xffcb('0x11')]('type');var _0x253ab8=this['getDataValue'](_0xffcb('0x12'));var _0x5b8c43=this['getDataValue'](_0xffcb('0x10'));if(_0x5aa582===_0xffcb('0x5')){if(_0x253ab8===_0xffcb('0x13')){return null;}if(_0x253ab8===_0xffcb('0x14')&&![_0xffcb('0xc'),_0xffcb('0x15')][_0xffcb('0x16')](_0x5b8c43)){this[_0xffcb('0x17')](_0xffcb('0x10'),_0xffcb('0xc'));}}return _0x5b8c43;}},'servicelevel':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xffcb('0x18')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xffcb('0x2')]},'weight':{'type':Sequelize[_0xffcb('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xffcb('0x19')},'autopause':{'type':Sequelize['ENUM']('yes','no',_0xffcb('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xffcb('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0xffcb('0x7')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xffcb('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xffcb('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xffcb('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xffcb('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xffcb('0x19'),'no'),'defaultValue':_0xffcb('0x19')},'announce_holdtime':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x19'),'no',_0xffcb('0x1b')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xffcb('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0xffcb('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xffcb('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xffcb('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xffcb('0x2')]},'queue_quantity1':{'type':Sequelize[_0xffcb('0x2')]},'queue_quantity2':{'type':Sequelize[_0xffcb('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xffcb('0x2')]},'queue_less_than':{'type':Sequelize[_0xffcb('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x18e3a5){this['setDataValue'](_0xffcb('0x1c'),_0x18e3a5?_0x18e3a5[_0xffcb('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0xffcb('0x1c'))?this[_0xffcb('0x11')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':'yes','set':function(_0x4f4977){this[_0xffcb('0x17')](_0xffcb('0x1e'),_0x4f4977?_0x4f4977[_0xffcb('0x1d')](','):undefined);},'get':function(){return this[_0xffcb('0x11')](_0xffcb('0x1e'))?this[_0xffcb('0x11')](_0xffcb('0x1e'))[_0xffcb('0x1f')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':'no','set':function(_0xbe4041){this[_0xffcb('0x17')]('leavewhenempty',_0xbe4041?_0xbe4041[_0xffcb('0x1d')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this['getDataValue'](_0xffcb('0x20'))[_0xffcb('0x1f')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xffcb('0x7')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xffcb('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xffcb('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':0x0,'set':function(_0x127a30){this[_0xffcb('0x17')](_0xffcb('0x22'),_0x127a30);if(_0x127a30){if(this['getDataValue'](_0xffcb('0x23'))<0x2){this[_0xffcb('0x17')](_0xffcb('0x23'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM'](_0xffcb('0x13'),_0xffcb('0x24'),_0xffcb('0x25'),'predictive',_0xffcb('0x14')),'defaultValue':_0xffcb('0x24'),'comment':_0xffcb('0x26')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xffcb('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffcb('0x28')},'dialLimitQueue':{'type':Sequelize[_0xffcb('0x18')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xffcb('0x29')},'dialPowerLevel':{'type':Sequelize[_0xffcb('0x2a')](0x2)[_0xffcb('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xffcb('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xffcb('0x2c'),_0xffcb('0x2d')),'defaultValue':_0xffcb('0x2d'),'comment':_0xffcb('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xffcb('0x2a')](0x2)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xffcb('0x2f')},'dialPredictiveInterval':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xffcb('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0xffcb('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xffcb('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xffcb('0x18')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':_0xffcb('0x31'),'comment':_0xffcb('0x32')},'dialQueueTimeout':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffcb('0x33')},'dialQueueProject':{'type':Sequelize[_0xffcb('0x2')],'comment':_0xffcb('0x34')},'dialCongestionMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffcb('0x35')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xffcb('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffcb('0x36')},'dialBusyMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffcb('0x37')},'dialBusyRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffcb('0x38')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'comment':_0xffcb('0x39')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)[_0xffcb('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffcb('0x3a')},'dialGlobalMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xffcb('0x3b')},'dialTimezone':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':_0xffcb('0x3c')},'dialPrefix':{'type':Sequelize[_0xffcb('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xffcb('0x3d'),_0xffcb('0x3e'),_0xffcb('0x3f')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffcb('0x40')},'dialAMDInitialSilence':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xffcb('0x41')},'dialAMDGreeting':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xffcb('0x42')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xffcb('0x43')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xffcb('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffcb('0x44')},'dialAMDMinWordLength':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xffcb('0x45')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xffcb('0x46')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xffcb('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xffcb('0x47')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xffcb('0x18')](0x9)[_0xffcb('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xffcb('0x48')},'dialRecallMeTimeout':{'type':Sequelize[_0xffcb('0x18')](0x5)[_0xffcb('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xffcb('0x49')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xffcb('0x4a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xffcb('0x7')](_0xffcb('0x4b'),_0xffcb('0x4c')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffcb('0x4d')},'dialCutDigit':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xffcb('0x4e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffcb('0x4f')},'dialDropRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffcb('0x50')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)[_0xffcb('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xffcb('0x51')},'dialMachineRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xffcb('0x18')](0x5)[_0xffcb('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xffcb('0x52')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xffcb('0x18')],'allowNull':!![],'comment':_0xffcb('0x53')},'mandatoryDisposition':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':![],'comment':_0xffcb('0x54'),'set':function(_0x17fd6f){if(!_0x17fd6f)this[_0xffcb('0x17')](_0xffcb('0x55'),null);this['setDataValue'](_0xffcb('0x56'),_0x17fd6f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xffcb('0x18')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xffcb('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xffcb('0x18')](0x3)[_0xffcb('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xffcb('0x21')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb4e=['BOOLEAN','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','preview','booked','roundrobin','includes','INTEGER','yes','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','acw','Active/Disactive\x20Campaign','progressive','power','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xfb4e,0x18d));var _0xefb4=function(_0x575934,_0x4a6760){_0x575934=_0x575934-0x0;var _0x109a3d=_0xfb4e[_0x575934];return _0x109a3d;};'use strict';var Sequelize=require('sequelize');module[_0xefb4('0x0')]={'name':{'type':Sequelize[_0xefb4('0x1')],'allowNull':![],'unique':_0xefb4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x4'),_0xefb4('0x5')),'allowNull':![],'defaultValue':_0xefb4('0x4')},'musiconhold':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':_0xefb4('0x6')},'announce':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xefb4('0x3')]('rr',_0xefb4('0x7'),_0xefb4('0x8'),'fewestcalls',_0xefb4('0x9'),_0xefb4('0xa'),'linear',_0xefb4('0xb'),'rrordered'),'allowNull':![],'defaultValue':_0xefb4('0x7'),'set':function(_0x3c7b27){this[_0xefb4('0xc')](_0xefb4('0xd'),_0x3c7b27?_0x3c7b27:'rrmemory');},'get':function(){var _0x1bcd74=this[_0xefb4('0xe')](_0xefb4('0xf'));var _0x201ec0=this['getDataValue']('dialMethod');var _0x5690c7=this[_0xefb4('0xe')](_0xefb4('0xd'));if(_0x1bcd74==='outbound'){if(_0x201ec0===_0xefb4('0x10')){return null;}if(_0x201ec0===_0xefb4('0x11')&&![_0xefb4('0xa'),_0xefb4('0x12')][_0xefb4('0x13')](_0x5690c7)){this[_0xefb4('0xc')](_0xefb4('0xd'),'rrmemory');}}return _0x5690c7;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xefb4('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xefb4('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xefb4('0x1')]},'weight':{'type':Sequelize[_0xefb4('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':_0xefb4('0x15')},'autopause':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xefb4('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xefb4('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xefb4('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xefb4('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xefb4('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':_0xefb4('0x15')},'announce_holdtime':{'type':Sequelize['ENUM'](_0xefb4('0x15'),'no',_0xefb4('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xefb4('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xefb4('0x1')]},'queue_youarenext':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xefb4('0x1')]},'queue_quantity1':{'type':Sequelize[_0xefb4('0x1')]},'queue_quantity2':{'type':Sequelize[_0xefb4('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xefb4('0x17')],'set':function(_0x83e237){this[_0xefb4('0xc')](_0xefb4('0x18'),_0x83e237?_0x83e237[_0xefb4('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xefb4('0x18'))?this[_0xefb4('0xe')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':_0xefb4('0x15'),'set':function(_0x42180a){this[_0xefb4('0xc')](_0xefb4('0x1a'),_0x42180a?_0x42180a['join'](','):undefined);},'get':function(){return this[_0xefb4('0xe')](_0xefb4('0x1a'))?this[_0xefb4('0xe')](_0xefb4('0x1a'))[_0xefb4('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':'no','set':function(_0x3a1f82){this[_0xefb4('0xc')](_0xefb4('0x1c'),_0x3a1f82?_0x3a1f82[_0xefb4('0x19')](','):undefined);},'get':function(){return this[_0xefb4('0xe')](_0xefb4('0x1c'))?this['getDataValue'](_0xefb4('0x1c'))[_0xefb4('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xefb4('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xefb4('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xefb4('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x10460c){this['setDataValue'](_0xefb4('0x1d'),_0x10460c);if(_0x10460c){if(this[_0xefb4('0xe')]('wrapuptime')<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xefb4('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xefb4('0x1e')},'dialMethod':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x10'),_0xefb4('0x1f'),_0xefb4('0x20'),'predictive',_0xefb4('0x11')),'defaultValue':_0xefb4('0x1f'),'comment':_0xefb4('0x21')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xefb4('0x22')},'dialLimitQueue':{'type':Sequelize[_0xefb4('0x14')](0x4)[_0xefb4('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xefb4('0x24')},'dialPowerLevel':{'type':Sequelize[_0xefb4('0x25')](0x2)[_0xefb4('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xefb4('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xefb4('0x3')]('agentBusyFactor',_0xefb4('0x27')),'defaultValue':_0xefb4('0x27'),'comment':_0xefb4('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xefb4('0x25')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xefb4('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xefb4('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xefb4('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':_0xefb4('0x2c'),'comment':_0xefb4('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xefb4('0x1')],'comment':_0xefb4('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefb4('0x30')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'comment':_0xefb4('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefb4('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':_0xefb4('0x34')},'dialPrefix':{'type':Sequelize[_0xefb4('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xefb4('0x3')](_0xefb4('0x35'),'never',_0xefb4('0x36')),'defaultValue':_0xefb4('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xefb4('0x14')](0x9)[_0xefb4('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xefb4('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xefb4('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xefb4('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xefb4('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xefb4('0x14')](0x9)[_0xefb4('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xefb4('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xefb4('0x14')](0x9)[_0xefb4('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xefb4('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xefb4('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xefb4('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xefb4('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xefb4('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xefb4('0x14')](0x9)[_0xefb4('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xefb4('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xefb4('0x3d')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xefb4('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xefb4('0x3f'),_0xefb4('0x40')),'defaultValue':_0xefb4('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xefb4('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xefb4('0x41')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xefb4('0x42')},'dialCutDigit':{'type':Sequelize[_0xefb4('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x43')},'dialDropRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefb4('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xefb4('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xefb4('0x46')},'dialMachineMaxRetry':{'type':Sequelize[_0xefb4('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x47')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xefb4('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xefb4('0x14')](0x5)[_0xefb4('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xefb4('0x14')],'allowNull':!![],'comment':_0xefb4('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xefb4('0x41')],'defaultValue':![],'comment':_0xefb4('0x4a'),'set':function(_0x378582){if(!_0x378582)this['setDataValue'](_0xefb4('0x4b'),null);this[_0xefb4('0xc')](_0xefb4('0x4c'),_0x378582);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xefb4('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xefb4('0x41')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xefb4('0x14')](0x3)[_0xefb4('0x23')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xefb4('0x41')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 02758d2..2ab5c7f 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 _0x55ca=['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','clone','merge','omit','createdAt','updatedAt','VoiceQueues','UserProfileResource','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','where','rows','getHopperHistories','CmHopperHistory','pick','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','interface','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','userVoiceQueue:remove','addAgents','ids','spread','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','field','ContactId','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','COALESCE(phone,\x27\x27)','push','cm_hopper_additional_phones','CmHopperId','h.id','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','moment','bluebird','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','end','json','undefined','count','offset','set','Content-Range','update','then','destroy','get','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','type','sendStatus','error','stack','name','send','index','map','VoiceQueue','key','getOptions','include','query','findAll','catch','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x4cbd7d,_0x493409){var _0x4f41a4=function(_0x527ffb){while(--_0x527ffb){_0x4cbd7d['push'](_0x4cbd7d['shift']());}};_0x4f41a4(++_0x493409);}(_0x55ca,0x126));var _0xa55c=function(_0xf64500,_0x410815){_0xf64500=_0xf64500-0x0;var _0x58a6e0=_0x55ca[_0xf64500];return _0x58a6e0;};'use strict';var moment=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require(_0xa55c('0x2'));var qs=require(_0xa55c('0x3'));var logger=require('../../config/logger')(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var db=require(_0xa55c('0x6'))['db'];config[_0xa55c('0x7')]=_[_0xa55c('0x8')](config[_0xa55c('0x7')],{'host':_0xa55c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa55c('0x7')]));require(_0xa55c('0xa'))['register'](socket);function respondWithStatusCode(_0x291996,_0x290d28){_0x290d28=_0x290d28||0xcc;return function(_0x52a3bc){if(_0x52a3bc){return _0x291996['sendStatus'](_0x290d28);}return _0x291996[_0xa55c('0xb')](_0x290d28)[_0xa55c('0xc')]();};}function respondWithResult(_0x381d07,_0x5d8e5a){_0x5d8e5a=_0x5d8e5a||0xc8;return function(_0x31646d){if(_0x31646d){return _0x381d07[_0xa55c('0xb')](_0x5d8e5a)[_0xa55c('0xd')](_0x31646d);}};}function respondWithFilteredResult(_0x70c2de,_0x3998f7){return function(_0x15eec8){if(_0x15eec8){var _0x5d47ff=typeof _0x3998f7['offset']===_0xa55c('0xe')&&typeof _0x3998f7['limit']==='undefined';var _0x59ea8d=_0x15eec8[_0xa55c('0xf')];var _0x3930e4=_0x5d47ff?0x0:_0x3998f7[_0xa55c('0x10')];var _0x938bd6=_0x5d47ff?_0x15eec8[_0xa55c('0xf')]:_0x3998f7[_0xa55c('0x10')]+_0x3998f7['limit'];var _0x3ccf65;if(_0x938bd6>=_0x59ea8d){_0x938bd6=_0x59ea8d;_0x3ccf65=0xc8;}else{_0x3ccf65=0xce;}_0x70c2de[_0xa55c('0xb')](_0x3ccf65);return _0x70c2de[_0xa55c('0x11')](_0xa55c('0x12'),_0x3930e4+'-'+_0x938bd6+'/'+_0x59ea8d)[_0xa55c('0xd')](_0x15eec8);}return null;};}function saveUpdates(_0x3ae86b){return function(_0x51590e){if(_0x51590e){return _0x51590e[_0xa55c('0x13')](_0x3ae86b)[_0xa55c('0x14')](function(_0x4cee3c){return _0x4cee3c;});}return null;};}function removeEntity(_0x3d4c9e){return function(_0x104a99){if(_0x104a99){return _0x104a99[_0xa55c('0x15')]()[_0xa55c('0x14')](function(){var _0x23a1ae=_0x104a99[_0xa55c('0x16')]({'plain':!![]});var _0x4c0daf=[{'name':'VoiceQueues','value':_0xa55c('0x17'),'ignore':![]},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19'),'ignore':![]}];var _0x4cfe10=_(_0x4c0daf)[_0xa55c('0x1a')](_0xa55c('0x1b'))['map'](_0xa55c('0x1c'))[_0xa55c('0x1c')]();if(_[_0xa55c('0x1d')](_0x4cfe10,_0x23a1ae[_0xa55c('0x1e')])){return;}var _0x234372=_['find'](_0x4c0daf,[_0xa55c('0x1c'),_0x23a1ae['type']])['name'];return db['UserProfileResource'][_0xa55c('0x15')]({'where':{'type':_0x234372,'resourceId':_0x23a1ae['id']}})['then'](function(){return _0x104a99;});})[_0xa55c('0x14')](function(){_0x3d4c9e[_0xa55c('0xb')](0xcc)[_0xa55c('0xc')]();});}};}function handleEntityNotFound(_0xf0e574){return function(_0x2313a9){if(!_0x2313a9){_0xf0e574[_0xa55c('0x1f')](0x194);}return _0x2313a9;};}function handleError(_0x1da633,_0x11e7f7){_0x11e7f7=_0x11e7f7||0x1f4;return function(_0x192df2){logger[_0xa55c('0x20')](_0x192df2[_0xa55c('0x21')]);if(_0x192df2['name']){delete _0x192df2[_0xa55c('0x22')];}_0x1da633[_0xa55c('0xb')](_0x11e7f7)[_0xa55c('0x23')](_0x192df2);};}exports[_0xa55c('0x24')]=function(_0x5d940d,_0x1377b0){var _0x22f6b6={};var _0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x25')](db[_0xa55c('0x26')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x1e')][_0xa55c('0x27')]};});_0x22f6b6=qs[_0xa55c('0x28')](_0x201941,_0x5d940d);var _0x223813={'where':_0x22f6b6['where']};return db[_0xa55c('0x26')][_0xa55c('0xf')](_0x223813)[_0xa55c('0x14')](function(_0x20da31){_0x1b8388[_0xa55c('0xf')]=_0x20da31;_0x22f6b6[_0xa55c('0x29')]=qs[_0xa55c('0x29')](_0x5d940d[_0xa55c('0x2a')]);return db[_0xa55c('0x26')][_0xa55c('0x2b')](_0x22f6b6);})[_0xa55c('0x14')](function(_0x4eb7c4){_0x1b8388['rows']=_0x4eb7c4;return _0x1b8388;})[_0xa55c('0x14')](respondWithFilteredResult(_0x1377b0,_0x22f6b6))[_0xa55c('0x2c')](handleError(_0x1377b0,null));};exports['show']=function(_0x30fadd,_0x2f0110){var _0x2e9623={'raw':![],'where':{'id':_0x30fadd[_0xa55c('0x2d')]['id']}},_0x1839ac={};_0x1839ac[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x26')][_0xa55c('0x30')]);_0x1839ac['query']=_['keys'](_0x30fadd['query']);_0x1839ac[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x1839ac[_0xa55c('0x2e')],_0x1839ac['query']);_0x2e9623[_0xa55c('0x33')]=_['intersection'](_0x1839ac[_0xa55c('0x2e')],qs['fields'](_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2e9623[_0xa55c('0x33')]=_0x2e9623['attributes'][_0xa55c('0x35')]?_0x2e9623[_0xa55c('0x33')]:_0x1839ac['model'];if(_0x30fadd[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x2e9623['include']=[{'all':!![]}];}_0x2e9623=_['merge']({},_0x2e9623,_0x30fadd[_0xa55c('0x37')]);return db['VoiceQueue'][_0xa55c('0x38')](_0x2e9623)[_0xa55c('0x14')](handleEntityNotFound(_0x2f0110,null))['then'](respondWithResult(_0x2f0110,null))['catch'](handleError(_0x2f0110,null));};exports['create']=function(_0x4de781,_0x3b3308){return db[_0xa55c('0x26')][_0xa55c('0x39')](_0x4de781[_0xa55c('0x3a')],{})[_0xa55c('0x14')](function(_0x56d17c){var _0x3d52d8=_0x4de781[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x3d52d8)throw new Error(_0xa55c('0x3c'));if(_0x3d52d8[_0xa55c('0x3d')]===_0xa55c('0x3b')){var _0x554620=_0x56d17c[_0xa55c('0x16')]({'plain':!![]});var _0x5ee63d=[{'name':'VoiceQueues','value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':'outbound'}];var _0x2bd98b=_['find'](_0x5ee63d,['value',_0x554620[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x2bd98b,'userProfileId':_0x3d52d8[_0xa55c('0x3f')]},'raw':!![]})[_0xa55c('0x14')](function(_0x5d9d5d){if(_0x5d9d5d&&_0x5d9d5d[_0xa55c('0x40')]===0x0){return db['UserProfileResource'][_0xa55c('0x39')]({'name':_0x554620[_0xa55c('0x22')],'resourceId':_0x554620['id'],'type':_0x5d9d5d['name'],'sectionId':_0x5d9d5d['id']},{})[_0xa55c('0x14')](function(){return _0x56d17c;});}else{return _0x56d17c;}})[_0xa55c('0x2c')](function(_0x5d834d){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x5d834d);throw _0x5d834d;});}return _0x56d17c;})[_0xa55c('0x14')](respondWithResult(_0x3b3308,0xc9))['catch'](handleError(_0x3b3308,null));};exports[_0xa55c('0x42')]=function(_0x582901,_0x2f9717){var _0x3a8af4={'where':{'id':_0x582901['params']['id']}},_0x451269={};_0x451269[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['VoiceQueue'][_0xa55c('0x30')]);_0x3a8af4[_0xa55c('0x33')]=_['intersection'](_0x451269[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x582901['query'][_0xa55c('0x34')]));_0x3a8af4[_0xa55c('0x33')]=_0x3a8af4[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3a8af4['attributes']:_0x451269[_0xa55c('0x2e')];if(_0x582901['query'][_0xa55c('0x36')]){_0x3a8af4[_0xa55c('0x29')]=[{'all':!![]}];}_0x3a8af4=_[_0xa55c('0x43')]({},_0x3a8af4,_0x582901['options']);return db[_0xa55c('0x26')][_0xa55c('0x38')](_0x3a8af4)['then'](handleEntityNotFound(_0x2f9717,null))[_0xa55c('0x14')](function(_0x34de95){if(_0x34de95){var _0x3822b7=_0x34de95[_0xa55c('0x16')]({'plain':!![]});_0x3822b7=qs[_0xa55c('0x44')](_0x3822b7,['id',_0xa55c('0x45'),_0xa55c('0x46')]);_0x582901[_0xa55c('0x3a')]=_[_0xa55c('0x44')](_0x582901[_0xa55c('0x3a')],['id','createdAt',_0xa55c('0x46')]);return db[_0xa55c('0x26')][_0xa55c('0x39')](_['merge'](_0x3822b7,_0x582901[_0xa55c('0x3a')]),{'include':_0x582901[_0xa55c('0x2a')]['includeAll']?[{'all':!![]}]:undefined})[_0xa55c('0x14')](function(_0x4fa412){var _0x2b6a0e=_0x582901[_0xa55c('0x3b')][_0xa55c('0x16')]({'plain':!![]});if(!_0x2b6a0e)throw new Error(_0xa55c('0x3c'));if(_0x2b6a0e[_0xa55c('0x3d')]==='user'){var _0x44b7c1=_0x4fa412[_0xa55c('0x16')]({'plain':!![]});var _0x4b85cc=[{'name':_0xa55c('0x47'),'value':_0xa55c('0x17')},{'name':_0xa55c('0x18'),'value':_0xa55c('0x19')}];var _0x50176b=_['find'](_0x4b85cc,[_0xa55c('0x1c'),_0x44b7c1[_0xa55c('0x1e')]])[_0xa55c('0x22')];return db[_0xa55c('0x3e')]['find']({'where':{'name':_0x50176b,'userProfileId':_0x2b6a0e[_0xa55c('0x3f')]},'raw':!![]})['then'](function(_0x2742e4){if(_0x2742e4&&_0x2742e4[_0xa55c('0x40')]===0x0){return db[_0xa55c('0x48')][_0xa55c('0x39')]({'name':_0x44b7c1[_0xa55c('0x22')],'resourceId':_0x44b7c1['id'],'type':_0x2742e4['name'],'sectionId':_0x2742e4['id']},{})[_0xa55c('0x14')](function(){return _0x4fa412;});}else{return _0x4fa412;}})['catch'](function(_0x23f67f){logger[_0xa55c('0x20')](_0xa55c('0x41'),_0x23f67f);throw _0x23f67f;});}return _0x4fa412;});}})[_0xa55c('0x14')](respondWithResult(_0x2f9717,0xc9))[_0xa55c('0x2c')](handleError(_0x2f9717,null));};exports[_0xa55c('0x13')]=function(_0x5d14e0,_0x53e2be){if(_0x5d14e0[_0xa55c('0x3a')]['id']){delete _0x5d14e0[_0xa55c('0x3a')]['id'];}return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x5d14e0[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x53e2be,null))[_0xa55c('0x14')](saveUpdates(_0x5d14e0[_0xa55c('0x3a')],null))[_0xa55c('0x14')](respondWithResult(_0x53e2be,null))[_0xa55c('0x2c')](handleError(_0x53e2be,null));};exports[_0xa55c('0x15')]=function(_0x493f51,_0xdd92c1){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x493f51[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0xdd92c1,null))['then'](removeEntity(_0xdd92c1,null))[_0xa55c('0x2c')](handleError(_0xdd92c1,null));};exports['getHoppers']=function(_0x2e482a,_0x5e3a28){var _0x3495a7={'raw':![],'where':{}};var _0x5a8897={};var _0x34edc5={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x2e482a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x5e3a28,null))[_0xa55c('0x14')](function(_0xafaf8c){if(_0xafaf8c){_0x5a8897[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x4a')]['rawAttributes']);_0x5a8897[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x2e482a['query']);_0x5a8897[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],_0x5a8897[_0xa55c('0x2a')]);_0x3495a7[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x5a8897[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x2e482a['query'][_0xa55c('0x34')]));_0x3495a7[_0xa55c('0x33')]=_0x3495a7[_0xa55c('0x33')][_0xa55c('0x35')]?_0x3495a7[_0xa55c('0x33')]:_0x5a8897[_0xa55c('0x2e')];if(!_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x3495a7['limit']=qs[_0xa55c('0x4d')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x3495a7[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x3495a7[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x3495a7['where']=qs[_0xa55c('0x31')](_['pick'](_0x2e482a[_0xa55c('0x2a')],_0x5a8897[_0xa55c('0x31')]));_0x3495a7[_0xa55c('0x50')]['VoiceQueueId']=_0xafaf8c['id'];if(_0x2e482a['query'][_0xa55c('0x1a')]){_0x3495a7[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x3495a7[_0xa55c('0x50')],{'$or':_['map'](_0x3495a7[_0xa55c('0x33')],function(_0xd02251){var _0x8ea1c6={};_0x8ea1c6[_0xd02251]={'$like':'%'+_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x8ea1c6;})});}_0x3495a7=_['merge']({},_0x3495a7,_0x2e482a['options']);return db[_0xa55c('0x4a')][_0xa55c('0xf')]({'where':_0x3495a7[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x1af9d5){_0x34edc5['count']=_0x1af9d5;if(_0x2e482a[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x3495a7['include']=[{'all':!![]}];}return db[_0xa55c('0x4a')][_0xa55c('0x2b')](_0x3495a7);})[_0xa55c('0x14')](function(_0x4dcb93){_0x34edc5[_0xa55c('0x51')]=_0x4dcb93;return _0x34edc5;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x5e3a28,_0x3495a7))[_0xa55c('0x2c')](handleError(_0x5e3a28,null));};exports[_0xa55c('0x52')]=function(_0x232143,_0x506f74){var _0x25bd5b={'raw':!![],'where':{}};var _0x2e2cf6={};var _0x4bf233={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x232143['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x506f74,null))[_0xa55c('0x14')](function(_0x2f13db){if(_0x2f13db){_0x2e2cf6[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x53')][_0xa55c('0x30')]);_0x2e2cf6[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x232143['query']);_0x2e2cf6[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],_0x2e2cf6[_0xa55c('0x2a')]);_0x25bd5b['attributes']=_[_0xa55c('0x32')](_0x2e2cf6[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x232143[_0xa55c('0x2a')]['fields']));_0x25bd5b['attributes']=_0x25bd5b[_0xa55c('0x33')][_0xa55c('0x35')]?_0x25bd5b[_0xa55c('0x33')]:_0x2e2cf6[_0xa55c('0x2e')];if(!_0x232143['query']['hasOwnProperty'](_0xa55c('0x4c'))){_0x25bd5b[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x232143[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x25bd5b[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x232143['query'][_0xa55c('0x10')]);}_0x25bd5b['order']=qs[_0xa55c('0x4f')](_0x232143['query'][_0xa55c('0x4f')]);_0x25bd5b[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x232143[_0xa55c('0x2a')],_0x2e2cf6[_0xa55c('0x31')]));_0x25bd5b[_0xa55c('0x50')][_0xa55c('0x55')]=_0x2f13db['id'];if(_0x232143['query']['filter']){_0x25bd5b[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x25bd5b[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x25bd5b[_0xa55c('0x33')],function(_0x137728){var _0x47e8e2={};_0x47e8e2[_0x137728]={'$like':'%'+_0x232143[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x47e8e2;})});}_0x25bd5b=_[_0xa55c('0x43')]({},_0x25bd5b,_0x232143[_0xa55c('0x37')]);return db[_0xa55c('0x53')][_0xa55c('0xf')]({'where':_0x25bd5b[_0xa55c('0x50')]})[_0xa55c('0x14')](function(_0x58b670){_0x4bf233[_0xa55c('0xf')]=_0x58b670;if(_0x232143[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x25bd5b[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x53')]['findAll'](_0x25bd5b);})[_0xa55c('0x14')](function(_0x2ab1f2){_0x4bf233['rows']=_0x2ab1f2;return _0x4bf233;});}})['then'](respondWithFilteredResult(_0x506f74,_0x25bd5b))[_0xa55c('0x2c')](handleError(_0x506f74,null));};exports[_0xa55c('0x56')]=function(_0x5c2229,_0x559e71){var _0x579726={'raw':!![],'where':{}};var _0x5ab79e={};var _0xf8e295={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x5c2229[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x559e71,null))[_0xa55c('0x14')](function(_0x568a5b){if(_0x568a5b){_0x5ab79e[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x57')][_0xa55c('0x30')]);_0x5ab79e['query']=_[_0xa55c('0x2f')](_0x5c2229[_0xa55c('0x2a')]);_0x5ab79e[_0xa55c('0x31')]=_['intersection'](_0x5ab79e[_0xa55c('0x2e')],_0x5ab79e['query']);_0x579726['attributes']=_[_0xa55c('0x32')](_0x5ab79e[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x579726[_0xa55c('0x33')]=_0x579726[_0xa55c('0x33')]['length']?_0x579726['attributes']:_0x5ab79e[_0xa55c('0x2e')];if(!_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x579726[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x579726[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x5c2229['query'][_0xa55c('0x10')]);}_0x579726[_0xa55c('0x4e')]=qs['sort'](_0x5c2229[_0xa55c('0x2a')]['sort']);_0x579726[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x5c2229[_0xa55c('0x2a')],_0x5ab79e[_0xa55c('0x31')]));_0x579726['where'][_0xa55c('0x55')]=_0x568a5b['id'];if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x579726[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x579726[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x579726['attributes'],function(_0x49a307){var _0x5c08e5={};_0x5c08e5[_0x49a307]={'$like':'%'+_0x5c2229[_0xa55c('0x2a')]['filter']+'%'};return _0x5c08e5;})});}_0x579726=_[_0xa55c('0x43')]({},_0x579726,_0x5c2229[_0xa55c('0x37')]);return db[_0xa55c('0x57')][_0xa55c('0xf')]({'where':_0x579726[_0xa55c('0x50')]})['then'](function(_0x253d7a){_0xf8e295['count']=_0x253d7a;if(_0x5c2229[_0xa55c('0x2a')][_0xa55c('0x36')]){_0x579726[_0xa55c('0x29')]=[{'all':!![]}];}return db[_0xa55c('0x57')]['findAll'](_0x579726);})[_0xa55c('0x14')](function(_0x46f8ab){_0xf8e295[_0xa55c('0x51')]=_0x46f8ab;return _0xf8e295;});}})[_0xa55c('0x14')](respondWithFilteredResult(_0x559e71,_0x579726))[_0xa55c('0x2c')](handleError(_0x559e71,null));};exports[_0xa55c('0x58')]=function(_0x270bd0,_0x472c73){var _0x5bae40={'raw':!![],'where':{}};var _0x147962={};var _0x1538dc={'count':0x0,'rows':[]};return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x270bd0[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x472c73,null))['then'](function(_0x46124b){if(_0x46124b){_0x147962['model']=_[_0xa55c('0x2f')](db['CmHopperBlack'][_0xa55c('0x30')]);_0x147962[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x270bd0['query']);_0x147962[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x147962[_0xa55c('0x2e')],_0x147962['query']);_0x5bae40[_0xa55c('0x33')]=_['intersection'](_0x147962[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x270bd0['query'][_0xa55c('0x34')]));_0x5bae40['attributes']=_0x5bae40[_0xa55c('0x33')][_0xa55c('0x35')]?_0x5bae40['attributes']:_0x147962[_0xa55c('0x2e')];if(!_0x270bd0[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x5bae40[_0xa55c('0x4d')]=qs['limit'](_0x270bd0[_0xa55c('0x2a')]['limit']);_0x5bae40['offset']=qs[_0xa55c('0x10')](_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x10')]);}_0x5bae40[_0xa55c('0x4e')]=qs['sort'](_0x270bd0[_0xa55c('0x2a')]['sort']);_0x5bae40[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x270bd0['query'],_0x147962[_0xa55c('0x31')]));_0x5bae40['where']['VoiceQueueId']=_0x46124b['id'];if(_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x5bae40[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x5bae40[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x5bae40[_0xa55c('0x33')],function(_0x9225d9){var _0x465801={};_0x465801[_0x9225d9]={'$like':'%'+_0x270bd0[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x465801;})});}_0x5bae40=_[_0xa55c('0x43')]({},_0x5bae40,_0x270bd0[_0xa55c('0x37')]);return db['CmHopperBlack'][_0xa55c('0xf')]({'where':_0x5bae40['where']})['then'](function(_0x5c8003){_0x1538dc[_0xa55c('0xf')]=_0x5c8003;if(_0x270bd0['query'][_0xa55c('0x36')]){_0x5bae40['include']=[{'all':!![]}];}return db[_0xa55c('0x59')]['findAll'](_0x5bae40);})['then'](function(_0xfb1954){_0x1538dc['rows']=_0xfb1954;return _0x1538dc;});}})['then'](respondWithFilteredResult(_0x472c73,_0x5bae40))[_0xa55c('0x2c')](handleError(_0x472c73,null));};exports[_0xa55c('0x5a')]=function(_0x4ba496,_0x11349d){var _0x55caeb={};var _0x294e54={};var _0x403dff;var _0x1dcd8a;return db['VoiceQueue']['findOne']({'where':{'id':_0x4ba496[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x11349d,null))[_0xa55c('0x14')](function(_0xfda07f){if(_0xfda07f){_0x403dff=_0xfda07f;_0x294e54[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x5b')][_0xa55c('0x30')]);_0x294e54['query']=_[_0xa55c('0x2f')](_0x4ba496[_0xa55c('0x2a')]);_0x294e54[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],_0x294e54[_0xa55c('0x2a')]);_0x55caeb[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x294e54[_0xa55c('0x2e')],qs['fields'](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x55caeb[_0xa55c('0x33')]=_0x55caeb['attributes']['length']?_0x55caeb['attributes']:_0x294e54[_0xa55c('0x2e')];_0x55caeb['order']=qs[_0xa55c('0x4f')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x55caeb[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x4ba496[_0xa55c('0x2a')],_0x294e54[_0xa55c('0x31')]));if(_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x55caeb[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x55caeb[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x55caeb[_0xa55c('0x33')],function(_0x1c7aec){var _0xf0bcac={};_0xf0bcac[_0x1c7aec]={'$like':'%'+_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0xf0bcac;})});}_0x55caeb=_[_0xa55c('0x43')]({},_0x55caeb,_0x4ba496[_0xa55c('0x37')]);return _0x403dff[_0xa55c('0x5a')](_0x55caeb);}})[_0xa55c('0x14')](function(_0x168b3f){if(_0x168b3f){_0x1dcd8a=_0x168b3f['length'];if(!_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4b')]('nolimit')){_0x55caeb[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x4ba496[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x55caeb[_0xa55c('0x10')]=qs['offset'](_0x4ba496[_0xa55c('0x2a')]['offset']);}return _0x403dff['getTeams'](_0x55caeb);}})[_0xa55c('0x14')](function(_0x1c9903){if(_0x1c9903){return _0x1c9903?{'count':_0x1dcd8a,'rows':_0x1c9903}:null;}})[_0xa55c('0x14')](respondWithResult(_0x11349d,null))[_0xa55c('0x2c')](handleError(_0x11349d,null));};exports[_0xa55c('0x5c')]=function(_0x23b513,_0x1e4464){var _0xd9f634=_0x23b513[_0xa55c('0x3a')][_0xa55c('0x5d')];var _0x1036b3=_[_0xa55c('0x25')](_0xd9f634,'id');return db[_0xa55c('0x5b')][_0xa55c('0x2b')]({'where':{'id':_0x1036b3},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':_0xa55c('0x5f'),'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),'interface'],'raw':!![]}]})['then'](function(_0x55a98d){if(_0x55a98d){var _0x200c28=_[_0xa55c('0x62')](_0x55a98d,function(_0x5e41b3){var _0x45b329=_0x5e41b3['get']({'plain':!![]});_0x45b329[_0xa55c('0x5f')]['forEach'](function(_0x3060f2){_0x3060f2[_0xa55c('0x63')]=_[_0xa55c('0x38')](_0xd9f634,{'id':_0x45b329['id']})[_0xa55c('0x63')];});return _0x45b329[_0xa55c('0x5f')];});return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x23b513[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x665054){return db[_0xa55c('0x64')]['transaction'](function(_0x59f3a4){return _0x665054[_0xa55c('0x5c')](_0x1036b3,{'transaction':_0x59f3a4})['then'](function(){return BPromise[_0xa55c('0x65')](_0xd9f634,function(_0x5447a4){return db[_0xa55c('0x66')][_0xa55c('0x67')]({'TeamId':_0x5447a4['id'],'VoiceQueueId':_0x23b513[_0xa55c('0x2d')]['id'],'penalty':_0x5447a4['penalty']},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){return BPromise[_0xa55c('0x65')](_0x200c28,function(_0x130c5f){return db['UserVoiceQueue'][_0xa55c('0x68')]({'where':{'UserId':_0x130c5f['id'],'VoiceQueueId':_0x23b513['params']['id']},'defaults':{'penalty':_0x130c5f[_0xa55c('0x63')]},'transaction':_0x59f3a4});});})['then'](function(){return BPromise['each'](_[_0xa55c('0x1a')](_0x200c28,{'online':!![]}),function(_0x40e121){return db[_0xa55c('0x69')]['upsert']({'membername':_0x40e121[_0xa55c('0x22')],'UserId':_0x40e121['id'],'queue_name':_0x665054[_0xa55c('0x22')],'VoiceQueueId':_0x665054['id'],'interface':_[_0xa55c('0x6a')](_0x40e121[_0xa55c('0x6b')])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0x40e121[_0xa55c('0x22')]):_0x40e121[_0xa55c('0x6b')],'paused':_0x40e121['voicePause']||![],'penalty':_0x40e121[_0xa55c('0x63')]},{'transaction':_0x59f3a4});});})[_0xa55c('0x14')](function(){_0x200c28[_0xa55c('0x6e')](function(_0x151533){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':_0x151533['id'],'VoiceQueueId':_0x665054['id']});});});});});}})[_0xa55c('0x14')](respondWithStatusCode(_0x1e4464,null))[_0xa55c('0x2c')](handleError(_0x1e4464,null));};exports[_0xa55c('0x71')]=function(_0x261087,_0x2ef9dd){return db['Team'][_0xa55c('0x2b')]({'where':{'id':_0x261087['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa55c('0x5e')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa55c('0x14')](handleEntityNotFound(_0x2ef9dd,null))['then'](function(_0x302284){var _0x231499=_[_0xa55c('0x25')](_0x302284,'id');var _0x2d3e42=[];var _0x97275b=[];var _0x5c7c60=squel[_0xa55c('0x72')]();_0x5c7c60['field'](_0xa55c('0x73'))['from']('team_has_voice_queues','tq')[_0xa55c('0x74')](_0xa55c('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa55c('0x50')](_0xa55c('0x76'),_0x261087[_0xa55c('0x2d')]['id']);for(var _0x485652=0x0;_0x485652<_0x302284['length'];_0x485652+=0x1){let _0x57a1fc=_0x302284[_0x485652];for(var _0x50018c=0x0;_0x50018c<_0x57a1fc[_0xa55c('0x5f')][_0xa55c('0x35')];_0x50018c+=0x1){let _0x4c77c4=_0x57a1fc[_0xa55c('0x5f')][_0x50018c];var _0x1322a0=_0x5c7c60[_0xa55c('0x42')]();_0x1322a0['where'](_0xa55c('0x77'),_0x4c77c4['id']);_0x97275b['push'](db['sequelize']['query'](_0x1322a0[_0xa55c('0x78')](),{'type':db['sequelize'][_0xa55c('0x79')]['SELECT']})[_0xa55c('0x14')](function(_0x21e529){if(_0x21e529[_0xa55c('0x35')]===0x1){return _0x4c77c4['id'];}else{var _0x5063e7=_[_0xa55c('0x7a')](_[_0xa55c('0x25')](_0x21e529,_0xa55c('0x7b')),function(_0x16401f){return _[_0xa55c('0x1d')](_0x231499,_0x16401f);});if(_0x5063e7){return _0x4c77c4['id'];}}}));}}return BPromise[_0xa55c('0x7c')](_0x97275b)[_0xa55c('0x14')](function(_0x34d755){_0x2d3e42=_(_0x2d3e42)[_0xa55c('0x7d')](_0x34d755)['compact']()[_0xa55c('0x1c')]();return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x261087[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(_0x2c0b71){return db['sequelize'][_0xa55c('0x7e')](function(_0x5bae58){return _0x2c0b71[_0xa55c('0x71')](_0x261087[_0xa55c('0x2a')]['ids'],{'transaction':_0x5bae58})[_0xa55c('0x14')](function(){if(!_[_0xa55c('0x7f')](_0x2d3e42)){return _0x2c0b71['removeAgents'](_0x2d3e42,{'transaction':_0x5bae58})['then'](function(){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0x261087[_0xa55c('0x2d')]['id'],'UserId':_0x2d3e42},'transaction':_0x5bae58});});}})[_0xa55c('0x14')](function(){_0x2d3e42[_0xa55c('0x6e')](function(_0x1a335b){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':_0x1a335b,'VoiceQueueId':_0x2c0b71['id']});});});});});});})['then'](respondWithStatusCode(_0x2ef9dd,null))[_0xa55c('0x2c')](handleError(_0x2ef9dd,null));};exports[_0xa55c('0x81')]=function(_0xc8cd97,_0x21a206){var _0x29469d,_0x59a69d;return db[_0xa55c('0x26')]['find']({'where':{'id':_0xc8cd97['params']['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x21a206,null))[_0xa55c('0x14')](function(_0x6fcc){if(_0x6fcc){_0x59a69d=_0x6fcc;return _0x6fcc[_0xa55c('0x81')](_0xc8cd97['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0xc8cd97[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{})[_0xa55c('0x83')](function(_0x4295c1){for(var _0x37f242=0x0;_0x37f242<_0xc8cd97[_0xa55c('0x3a')]['ids'][_0xa55c('0x35')];_0x37f242+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x70'),{'UserId':Number(_0xc8cd97[_0xa55c('0x3a')]['ids'][_0x37f242]),'VoiceQueueId':Number(_0xc8cd97[_0xa55c('0x2d')]['id'])});}return _0x4295c1;});}})[_0xa55c('0x14')](function(_0x65c752){_0x29469d=_0x65c752||[];if(_0x59a69d){return db['User'][_0xa55c('0x2b')]({'where':{'id':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x82')]},'attributes':['id',_0xa55c('0x22'),_0xa55c('0x60'),_0xa55c('0x61'),_0xa55c('0x6b')],'raw':!![]});}})['then'](function(_0xcd4f3a){if(!_[_0xa55c('0x7f')](_0xcd4f3a)){var _0x496e8c=[];for(var _0x1c930b=0x0;_0x1c930b<_0xcd4f3a[_0xa55c('0x35')];_0x1c930b++){if(_0xcd4f3a[_0x1c930b][_0xa55c('0x60')]){_0x496e8c['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0xcd4f3a[_0x1c930b][_0xa55c('0x22')],'UserId':_0xcd4f3a[_0x1c930b]['id'],'queue_name':_0x59a69d[_0xa55c('0x22')],'VoiceQueueId':_0x59a69d['id'],'interface':_['isNil'](_0xcd4f3a[_0x1c930b]['interface'])?util[_0xa55c('0x6c')](_0xa55c('0x6d'),_0xcd4f3a[_0x1c930b]['name']):_0xcd4f3a[_0x1c930b]['interface'],'paused':_0xcd4f3a[_0x1c930b][_0xa55c('0x61')]||![],'penalty':_0xc8cd97[_0xa55c('0x3a')][_0xa55c('0x63')]||0x0}));}}return BPromise['all'](_0x496e8c);}})['then'](function(){return _0x29469d;})[_0xa55c('0x14')](respondWithResult(_0x21a206,null))['catch'](handleError(_0x21a206,null));};exports[_0xa55c('0x84')]=function(_0xe0a356,_0x5a4e69){return db[_0xa55c('0x26')]['find']({'where':{'id':_0xe0a356['params']['id']}})['then'](handleEntityNotFound(_0x5a4e69,null))['then'](function(_0x527669){if(_0x527669){return _0x527669[_0xa55c('0x84')](_0xe0a356['query'][_0xa55c('0x82')])[_0xa55c('0x14')](function(){if(_[_0xa55c('0x85')](_0xe0a356['query'][_0xa55c('0x82')])){for(var _0x111ff8=0x0;_0x111ff8<_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0xa55c('0x35')];_0x111ff8+=0x1){socket[_0xa55c('0x6f')](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')][_0x111ff8]),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}}else{socket['emit'](_0xa55c('0x80'),{'UserId':Number(_0xe0a356[_0xa55c('0x2a')]['ids']),'VoiceQueueId':Number(_0xe0a356[_0xa55c('0x2d')]['id'])});}});}})[_0xa55c('0x14')](function(_0x940871){return db[_0xa55c('0x69')][_0xa55c('0x15')]({'where':{'VoiceQueueId':_0xe0a356[_0xa55c('0x2d')]['id'],'UserId':_0xe0a356[_0xa55c('0x2a')][_0xa55c('0x82')]}})[_0xa55c('0x14')](function(){return _0x940871;});})[_0xa55c('0x14')](respondWithStatusCode(_0x5a4e69,null))[_0xa55c('0x2c')](handleError(_0x5a4e69,null));};exports[_0xa55c('0x86')]=function(_0x262d72,_0x228d12){var _0x16e229={};var _0x5c8713={};var _0x2d03b2;var _0x4b2e75;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x262d72[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x228d12,null))['then'](function(_0x537011){if(_0x537011){_0x2d03b2=_0x537011;_0x5c8713[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db['User'][_0xa55c('0x30')]);_0x5c8713[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x262d72['query']);_0x5c8713[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x5c8713[_0xa55c('0x2e')],_0x5c8713['query']);_0x16e229[_0xa55c('0x33')]=_['intersection'](_0x5c8713[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x16e229[_0xa55c('0x33')]=_0x16e229['attributes'][_0xa55c('0x35')]?_0x16e229[_0xa55c('0x33')]:_0x5c8713[_0xa55c('0x2e')];_0x16e229['order']=qs[_0xa55c('0x4f')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x16e229['where']=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x262d72[_0xa55c('0x2a')],_0x5c8713[_0xa55c('0x31')]));if(_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x16e229[_0xa55c('0x50')]=_['merge'](_0x16e229[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x16e229[_0xa55c('0x33')],function(_0x100ccb){var _0x531e60={};_0x531e60[_0x100ccb]={'$like':'%'+_0x262d72[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x531e60;})});}_0x16e229=_[_0xa55c('0x43')]({},_0x16e229,_0x262d72[_0xa55c('0x37')]);return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0x243cf3){if(_0x243cf3){_0x4b2e75=_0x243cf3['length'];if(!_0x262d72[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x16e229[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x262d72['query']['limit']);_0x16e229['offset']=qs[_0xa55c('0x10')](_0x262d72[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x2d03b2[_0xa55c('0x86')](_0x16e229);}})[_0xa55c('0x14')](function(_0xb22076){if(_0xb22076){return _0xb22076?{'count':_0x4b2e75,'rows':_0xb22076}:null;}})[_0xa55c('0x14')](respondWithResult(_0x228d12,null))[_0xa55c('0x2c')](handleError(_0x228d12,null));};exports['getMembers']=function(_0x35c42c,_0x3b2174){var _0x35375e={};var _0x19a5f1={};var _0x3e7cfa;var _0xd511c0;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x35c42c['params']['id']}})['then'](handleEntityNotFound(_0x3b2174,null))['then'](function(_0x58831d){if(_0x58831d){_0x3e7cfa=_0x58831d;_0x19a5f1[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x69')][_0xa55c('0x30')]);_0x19a5f1[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x35c42c[_0xa55c('0x2a')]);_0x19a5f1[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x19a5f1[_0xa55c('0x2e')],_0x19a5f1[_0xa55c('0x2a')]);_0x35375e['attributes']=_['intersection'](_0x19a5f1[_0xa55c('0x2e')],qs['fields'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x35375e[_0xa55c('0x33')]=_0x35375e[_0xa55c('0x33')][_0xa55c('0x35')]?_0x35375e[_0xa55c('0x33')]:_0x19a5f1[_0xa55c('0x2e')];_0x35375e[_0xa55c('0x4e')]=qs[_0xa55c('0x4f')](_0x35c42c['query'][_0xa55c('0x4f')]);_0x35375e[_0xa55c('0x50')]=qs['filters'](_['pick'](_0x35c42c[_0xa55c('0x2a')],_0x19a5f1[_0xa55c('0x31')]));if(_0x35c42c[_0xa55c('0x2a')]['filter']){_0x35375e[_0xa55c('0x50')]=_[_0xa55c('0x43')](_0x35375e[_0xa55c('0x50')],{'$or':_[_0xa55c('0x25')](_0x35375e['attributes'],function(_0x55459c){var _0x33d58c={};_0x33d58c[_0x55459c]={'$like':'%'+_0x35c42c['query']['filter']+'%'};return _0x33d58c;})});}_0x35375e=_[_0xa55c('0x43')]({},_0x35375e,_0x35c42c[_0xa55c('0x37')]);return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})[_0xa55c('0x14')](function(_0x5184ea){if(_0x5184ea){_0xd511c0=_0x5184ea[_0xa55c('0x35')];if(!_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x35375e[_0xa55c('0x4d')]=qs['limit'](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x35375e[_0xa55c('0x10')]=qs[_0xa55c('0x10')](_0x35c42c[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x3e7cfa[_0xa55c('0x87')](_0x35375e);}})['then'](function(_0x2d5e0e){return _0x2d5e0e?{'count':_0xd511c0,'rows':_0x2d5e0e}:null;})['then'](respondWithResult(_0x3b2174,null))[_0xa55c('0x2c')](handleError(_0x3b2174,null));};exports[_0xa55c('0x88')]=function(_0x3755a7,_0x50663f){var _0x50b42f={};var _0x307b39={};var _0x1319c6;var _0x536e1d;return db['VoiceQueue'][_0xa55c('0x49')]({'where':{'id':_0x3755a7[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x50663f,null))[_0xa55c('0x14')](function(_0x568a42){if(_0x568a42){_0x1319c6=_0x568a42;_0x307b39[_0xa55c('0x2e')]=_[_0xa55c('0x2f')](db[_0xa55c('0x89')][_0xa55c('0x30')]);_0x307b39['query']=_[_0xa55c('0x2f')](_0x3755a7[_0xa55c('0x2a')]);_0x307b39[_0xa55c('0x31')]=_['intersection'](_0x307b39['model'],_0x307b39[_0xa55c('0x2a')]);_0x50b42f['attributes']=_['intersection'](_0x307b39[_0xa55c('0x2e')],qs[_0xa55c('0x34')](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x50b42f[_0xa55c('0x33')]=_0x50b42f[_0xa55c('0x33')][_0xa55c('0x35')]?_0x50b42f[_0xa55c('0x33')]:_0x307b39[_0xa55c('0x2e')];_0x50b42f[_0xa55c('0x4e')]=qs['sort'](_0x3755a7['query'][_0xa55c('0x4f')]);_0x50b42f[_0xa55c('0x50')]=qs[_0xa55c('0x31')](_[_0xa55c('0x54')](_0x3755a7['query'],_0x307b39[_0xa55c('0x31')]));if(_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]){_0x50b42f[_0xa55c('0x50')]=_['merge'](_0x50b42f[_0xa55c('0x50')],{'$or':_['map'](_0x50b42f['attributes'],function(_0x545806){var _0x4fbb59={};_0x4fbb59[_0x545806]={'$like':'%'+_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x4fbb59;})});}_0x50b42f=_['merge']({},_0x50b42f,_0x3755a7[_0xa55c('0x37')]);return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x3899bd){if(_0x3899bd){_0x536e1d=_0x3899bd[_0xa55c('0x35')];if(!_0x3755a7[_0xa55c('0x2a')]['hasOwnProperty'](_0xa55c('0x4c'))){_0x50b42f[_0xa55c('0x4d')]=qs[_0xa55c('0x4d')](_0x3755a7[_0xa55c('0x2a')]['limit']);_0x50b42f['offset']=qs['offset'](_0x3755a7[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1319c6[_0xa55c('0x88')](_0x50b42f);}})[_0xa55c('0x14')](function(_0x1205cb){if(_0x1205cb){return _0x1205cb?{'count':_0x536e1d,'rows':_0x1205cb}:null;}})[_0xa55c('0x14')](respondWithResult(_0x50663f,null))[_0xa55c('0x2c')](handleError(_0x50663f,null));};exports[_0xa55c('0x8a')]=function(_0x499008,_0x4ef239){var _0x3e3208=moment()[_0xa55c('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x1e19d6,_0x286b33;return db['VoiceQueue']['find']({'where':{'id':_0x499008[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x4ef239,null))[_0xa55c('0x14')](function(_0x236015){if(_0x236015){_0x286b33=_0x236015;return _0x236015['addLists'](_0x499008['body'][_0xa55c('0x82')],_[_0xa55c('0x44')](_0x499008[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x18e4fd){var _0x185c5b;_0x1e19d6=_0x18e4fd||[];var _0x2511fe=[];if(_0x18e4fd){for(var _0x3ba948=0x0;_0x3ba948<_0x18e4fd[_0xa55c('0x35')];_0x3ba948+=0x1){var _0x5e83e9=_0x18e4fd[_0x3ba948][_0xa55c('0x16')]({'plain':!![]});_0x286b33['dialCheckDuplicateType']=_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]?_0x499008[_0xa55c('0x3a')][_0xa55c('0x8b')]:_0x286b33[_0xa55c('0x8b')];switch(_0x286b33[_0xa55c('0x8b')]){case _0xa55c('0x8c'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('phone',_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','scheduledAt')[_0xa55c('0x94')]('id',_0xa55c('0x95'))['field'](_0x5e83e9[_0xa55c('0x96')]['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')]['toString']())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()['field'](_0xa55c('0x9c'))[_0xa55c('0x97')](_0xa55c('0x9d'))[_0xa55c('0x50')]('VoiceQueueId\x20=\x20?',_0x499008['params']['id'][_0xa55c('0x78')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xa55c('0x72')]()[_0xa55c('0x94')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008['params']['id'][_0xa55c('0x78')]())))[_0xa55c('0x78')]();break;case _0xa55c('0x9e'):_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))[_0xa55c('0x94')](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))['field']('\x27'+_0x3e3208+'\x27',_0xa55c('0x45'))['field']('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))['where'](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL')[_0xa55c('0x50')](_0xa55c('0x9b'),squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x9f'))[_0xa55c('0x97')](_0xa55c('0x8f'))[_0xa55c('0x50')](_0xa55c('0x76'),_0x499008[_0xa55c('0x2d')]['id']['toString']())))[_0xa55c('0x78')]();break;default:_0x185c5b=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0x8f'))[_0xa55c('0x90')]([_0xa55c('0x91'),_0xa55c('0x92'),_0xa55c('0x95'),_0xa55c('0x93'),'VoiceQueueId',_0xa55c('0x45'),'updatedAt'],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x92'))[_0xa55c('0x94')]('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x5e83e9['CmListId']['toString'](),_0xa55c('0x93'))['field'](_0x499008[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),_0xa55c('0x55'))[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')](_0xa55c('0x9a'),_0x5e83e9[_0xa55c('0x96')][_0xa55c('0x78')]())[_0xa55c('0x50')]('phone\x20IS\x20NOT\x20NULL'))[_0xa55c('0x78')]();}_0x2511fe[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x185c5b));}return BPromise[_0xa55c('0x7c')](_0x2511fe);}})[_0xa55c('0x14')](function(){var _0x4457e9=[];var _0x456cb9=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xa1'))[_0xa55c('0x90')]([_0xa55c('0xa2'),_0xa55c('0x91'),'OrderBy',_0xa55c('0x45'),_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0xa3'))['field']('ci.item')['field']('ci.OrderBy+1')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27','createdAt')[_0xa55c('0x94')]('\x27'+_0x3e3208+'\x27',_0xa55c('0x46'))[_0xa55c('0x97')](_0xa55c('0xa4'),'ci')[_0xa55c('0x74')](_0xa55c('0x8f'),'h',_0xa55c('0xa5'))[_0xa55c('0x50')](_0xa55c('0xa6'),_0x3e3208)[_0xa55c('0x50')](_0xa55c('0xa7'),'PHONE'))[_0xa55c('0x78')]();_0x4457e9[_0xa55c('0xa0')](db[_0xa55c('0x64')]['query'](_0x456cb9));return BPromise['all'](_0x4457e9);})['then'](function(){return _0x1e19d6;})[_0xa55c('0x14')](respondWithResult(_0x4ef239,null))[_0xa55c('0x2c')](handleError(_0x4ef239,null));};exports[_0xa55c('0xa8')]=function(_0x27cd1b,_0x3ed3a5){return db[_0xa55c('0x26')][_0xa55c('0x38')]({'where':{'id':_0x27cd1b[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x3ed3a5,null))[_0xa55c('0x14')](function(_0x3def57){if(_0x3def57){return _0x3def57[_0xa55c('0xa8')](_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x4f5f1a){if(_0x4f5f1a){return db[_0xa55c('0x4a')]['destroy']({'where':{'ListId':_0x27cd1b[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x27cd1b[_0xa55c('0x2d')]['id']}})['then'](function(){return _0x4f5f1a;});}})['then'](respondWithStatusCode(_0x3ed3a5,null))[_0xa55c('0x2c')](handleError(_0x3ed3a5,null));};exports[_0xa55c('0xa9')]=function(_0x30af02,_0x5ebd8a){var _0x2420da={};var _0x2a4b78={};var _0x1e4c2d;var _0x2bf777;return db[_0xa55c('0x26')][_0xa55c('0x49')]({'where':{'id':_0x30af02[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5ebd8a,null))[_0xa55c('0x14')](function(_0x266b12){if(_0x266b12){_0x1e4c2d=_0x266b12;_0x2a4b78[_0xa55c('0x2e')]=_['keys'](db[_0xa55c('0x89')]['rawAttributes']);_0x2a4b78[_0xa55c('0x2a')]=_[_0xa55c('0x2f')](_0x30af02['query']);_0x2a4b78[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x2a4b78[_0xa55c('0x2e')],_0x2a4b78['query']);_0x2420da[_0xa55c('0x33')]=_[_0xa55c('0x32')](_0x2a4b78['model'],qs['fields'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x34')]));_0x2420da[_0xa55c('0x33')]=_0x2420da[_0xa55c('0x33')][_0xa55c('0x35')]?_0x2420da['attributes']:_0x2a4b78[_0xa55c('0x2e')];_0x2420da['order']=qs['sort'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4f')]);_0x2420da['where']=qs[_0xa55c('0x31')](_['pick'](_0x30af02[_0xa55c('0x2a')],_0x2a4b78[_0xa55c('0x31')]));if(_0x30af02['query'][_0xa55c('0x1a')]){_0x2420da[_0xa55c('0x50')]=_['merge'](_0x2420da[_0xa55c('0x50')],{'$or':_['map'](_0x2420da['attributes'],function(_0x37273b){var _0x1cd529={};_0x1cd529[_0x37273b]={'$like':'%'+_0x30af02[_0xa55c('0x2a')][_0xa55c('0x1a')]+'%'};return _0x1cd529;})});}_0x2420da=_[_0xa55c('0x43')]({},_0x2420da,_0x30af02[_0xa55c('0x37')]);return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})['then'](function(_0x27e791){if(_0x27e791){_0x2bf777=_0x27e791[_0xa55c('0x35')];if(!_0x30af02['query'][_0xa55c('0x4b')](_0xa55c('0x4c'))){_0x2420da['limit']=qs[_0xa55c('0x4d')](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x4d')]);_0x2420da[_0xa55c('0x10')]=qs['offset'](_0x30af02[_0xa55c('0x2a')][_0xa55c('0x10')]);}return _0x1e4c2d[_0xa55c('0xa9')](_0x2420da);}})[_0xa55c('0x14')](function(_0x365331){if(_0x365331){return _0x365331?{'count':_0x2bf777,'rows':_0x365331}:null;}})[_0xa55c('0x14')](respondWithResult(_0x5ebd8a,null))['catch'](handleError(_0x5ebd8a,null));};exports[_0xa55c('0xaa')]=function(_0x4d7cd6,_0x1ca9bd){var _0x2bf932;return db['VoiceQueue']['find']({'where':{'id':_0x4d7cd6[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](handleEntityNotFound(_0x1ca9bd,null))[_0xa55c('0x14')](function(_0x3c9d2b){if(_0x3c9d2b){return _0x3c9d2b[_0xa55c('0xaa')](_0x4d7cd6[_0xa55c('0x3a')][_0xa55c('0x82')],_['omit'](_0x4d7cd6[_0xa55c('0x3a')],[_0xa55c('0x82'),'id'])||{});}return null;})[_0xa55c('0x83')](function(_0x158b01){var _0x19f576;_0x2bf932=_0x158b01||[];var _0x10da4b=[];if(_0x158b01){for(var _0x3320ab=0x0;_0x3320ab<_0x158b01[_0xa55c('0x35')];_0x3320ab+=0x1){var _0x298cf5=_0x158b01[_0x3320ab][_0xa55c('0x16')]({'plain':!![]});_0x19f576=squel[_0xa55c('0x8d')]()[_0xa55c('0x8e')](_0xa55c('0xab'))['fromQuery']([_0xa55c('0x91'),'ContactId',_0xa55c('0x93'),_0xa55c('0x55'),'createdAt',_0xa55c('0x46')],squel[_0xa55c('0x72')]()[_0xa55c('0x94')](_0xa55c('0x91'),_0xa55c('0x91'))['field']('id',_0xa55c('0x95'))[_0xa55c('0x94')](_0x298cf5[_0xa55c('0x96')]['toString'](),'ListId')['field'](_0x4d7cd6[_0xa55c('0x2d')]['id'][_0xa55c('0x78')](),'VoiceQueueId')[_0xa55c('0x94')](_0xa55c('0xac'),_0xa55c('0x45'))[_0xa55c('0x94')](_0xa55c('0xac'),'updatedAt')[_0xa55c('0x97')](_0xa55c('0x98'))[_0xa55c('0x50')](_0xa55c('0x99'))[_0xa55c('0x50')]('ListId\x20=\x20?',_0x298cf5['CmListId'][_0xa55c('0x78')]())[_0xa55c('0x50')](_0xa55c('0xad')))['toString']();_0x10da4b[_0xa55c('0xa0')](db[_0xa55c('0x64')][_0xa55c('0x2a')](_0x19f576));}return BPromise[_0xa55c('0x7c')](_0x10da4b);}})[_0xa55c('0x14')](function(){return _0x2bf932;})[_0xa55c('0x14')](respondWithResult(_0x1ca9bd,null))[_0xa55c('0x2c')](handleError(_0x1ca9bd,null));};exports[_0xa55c('0xae')]=function(_0x23862a,_0xb432d1){return db['VoiceQueue'][_0xa55c('0x38')]({'where':{'id':_0x23862a[_0xa55c('0x2d')]['id']}})['then'](handleEntityNotFound(_0xb432d1,null))[_0xa55c('0x14')](function(_0x5bc270){if(_0x5bc270){return _0x5bc270[_0xa55c('0xae')](_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')]);}})[_0xa55c('0x14')](function(_0x543b4a){if(_0x543b4a){return db[_0xa55c('0x59')]['destroy']({'where':{'ListId':_0x23862a[_0xa55c('0x2a')][_0xa55c('0x82')],'VoiceQueueId':_0x23862a[_0xa55c('0x2d')]['id']}})[_0xa55c('0x14')](function(){return _0x543b4a;});}})[_0xa55c('0x14')](respondWithStatusCode(_0xb432d1,null))['catch'](handleError(_0xb432d1,null));}; \ No newline at end of file +var _0x7217=['toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','ids','emit','userVoiceQueue:remove','addAgents','isEmpty','removeAgents','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','fromQuery','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','type','find','name','UserProfileResource','end','error','send','index','VoiceQueue','fieldName','getOptions','where','include','query','findAll','rows','catch','params','model','keys','rawAttributes','filters','attributes','intersection','fields','length','options','create','user','role','outbound','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','includeAll','omit','createdAt','updatedAt','body','merge','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','limit','order','sort','pick','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','online','flatMap','penalty','sequelize','transaction','addTeams','upsert','each','UserVoiceQueueRt','isNil','interface','format','SIP/%s','voicePause','forEach','userVoiceQueue:save','removeTeams','Agents','select','field','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0x7217,0x19e));var _0x7721=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7217[_0x3c4737];return _0x2bb926;};'use strict';var moment=require(_0x7721('0x0'));var BPromise=require('bluebird');var util=require(_0x7721('0x1'));var _=require(_0x7721('0x2'));var squel=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var qs=require(_0x7721('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x7721('0x6'));var db=require(_0x7721('0x7'))['db'];config[_0x7721('0x8')]=_[_0x7721('0x9')](config[_0x7721('0x8')],{'host':_0x7721('0xa'),'port':0x18eb});var socket=require(_0x7721('0xb'))(new Redis(config[_0x7721('0x8')]));require(_0x7721('0xc'))[_0x7721('0xd')](socket);function respondWithStatusCode(_0x3e6368,_0x2a66cb){_0x2a66cb=_0x2a66cb||0xcc;return function(_0xfa8835){if(_0xfa8835){return _0x3e6368[_0x7721('0xe')](_0x2a66cb);}return _0x3e6368[_0x7721('0xf')](_0x2a66cb)['end']();};}function respondWithResult(_0x461d1a,_0x29bc8f){_0x29bc8f=_0x29bc8f||0xc8;return function(_0x8729a6){if(_0x8729a6){return _0x461d1a[_0x7721('0xf')](_0x29bc8f)[_0x7721('0x10')](_0x8729a6);}};}function respondWithFilteredResult(_0x409b37,_0x1e7fd7){return function(_0x27b36b){if(_0x27b36b){var _0x55b4ca=typeof _0x1e7fd7[_0x7721('0x11')]===_0x7721('0x12')&&typeof _0x1e7fd7['limit']===_0x7721('0x12');var _0x30da54=_0x27b36b[_0x7721('0x13')];var _0x2e9752=_0x55b4ca?0x0:_0x1e7fd7['offset'];var _0x3cbce8=_0x55b4ca?_0x27b36b[_0x7721('0x13')]:_0x1e7fd7['offset']+_0x1e7fd7['limit'];var _0x4b183e;if(_0x3cbce8>=_0x30da54){_0x3cbce8=_0x30da54;_0x4b183e=0xc8;}else{_0x4b183e=0xce;}_0x409b37[_0x7721('0xf')](_0x4b183e);return _0x409b37[_0x7721('0x14')](_0x7721('0x15'),_0x2e9752+'-'+_0x3cbce8+'/'+_0x30da54)[_0x7721('0x10')](_0x27b36b);}return null;};}function saveUpdates(_0x5ed94b){return function(_0x20f669){if(_0x20f669){return _0x20f669['update'](_0x5ed94b)[_0x7721('0x16')](function(_0x5cb0e6){return _0x5cb0e6;});}return null;};}function removeEntity(_0xfec626){return function(_0x4e96fb){if(_0x4e96fb){return _0x4e96fb[_0x7721('0x17')]()[_0x7721('0x16')](function(){var _0x2286e5=_0x4e96fb[_0x7721('0x18')]({'plain':!![]});var _0x402820=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a'),'ignore':![]},{'name':_0x7721('0x1b'),'value':'outbound','ignore':![]}];var _0x288f7e=_(_0x402820)[_0x7721('0x1c')](_0x7721('0x1d'))[_0x7721('0x1e')]('value')[_0x7721('0x1f')]();if(_['includes'](_0x288f7e,_0x2286e5[_0x7721('0x20')])){return;}var _0x288e3a=_[_0x7721('0x21')](_0x402820,[_0x7721('0x1f'),_0x2286e5[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x23')]['destroy']({'where':{'type':_0x288e3a,'resourceId':_0x2286e5['id']}})[_0x7721('0x16')](function(){return _0x4e96fb;});})[_0x7721('0x16')](function(){_0xfec626[_0x7721('0xf')](0xcc)[_0x7721('0x24')]();});}};}function handleEntityNotFound(_0x40d550){return function(_0x16355a){if(!_0x16355a){_0x40d550[_0x7721('0xe')](0x194);}return _0x16355a;};}function handleError(_0xf753f1,_0x40f367){_0x40f367=_0x40f367||0x1f4;return function(_0x52316e){logger[_0x7721('0x25')](_0x52316e['stack']);if(_0x52316e['name']){delete _0x52316e[_0x7721('0x22')];}_0xf753f1[_0x7721('0xf')](_0x40f367)[_0x7721('0x26')](_0x52316e);};}exports[_0x7721('0x27')]=function(_0x1ea4d,_0x37b9f0){var _0xd7d703={};var _0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x1e')](db[_0x7721('0x28')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x29')],'type':_0x4a25c9[_0x7721('0x20')]['key']};});_0xd7d703=qs[_0x7721('0x2a')](_0x5c54f0,_0x1ea4d);var _0x4651b5={'where':_0xd7d703[_0x7721('0x2b')]};return db['VoiceQueue'][_0x7721('0x13')](_0x4651b5)[_0x7721('0x16')](function(_0x1492d4){_0x1da2d8[_0x7721('0x13')]=_0x1492d4;_0xd7d703[_0x7721('0x2c')]=qs['include'](_0x1ea4d[_0x7721('0x2d')]);return db[_0x7721('0x28')][_0x7721('0x2e')](_0xd7d703);})['then'](function(_0x35de7a){_0x1da2d8[_0x7721('0x2f')]=_0x35de7a;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x37b9f0,_0xd7d703))[_0x7721('0x30')](handleError(_0x37b9f0,null));};exports['show']=function(_0x2d6ba0,_0x326c50){var _0x19d082={'raw':![],'where':{'id':_0x2d6ba0[_0x7721('0x31')]['id']}},_0x1d894b={};_0x1d894b[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x28')][_0x7721('0x34')]);_0x1d894b[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x2d6ba0['query']);_0x1d894b[_0x7721('0x35')]=_['intersection'](_0x1d894b[_0x7721('0x32')],_0x1d894b[_0x7721('0x2d')]);_0x19d082[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1d894b[_0x7721('0x32')],qs[_0x7721('0x38')](_0x2d6ba0['query']['fields']));_0x19d082['attributes']=_0x19d082['attributes'][_0x7721('0x39')]?_0x19d082[_0x7721('0x36')]:_0x1d894b[_0x7721('0x32')];if(_0x2d6ba0[_0x7721('0x2d')]['includeAll']){_0x19d082[_0x7721('0x2c')]=[{'all':!![]}];}_0x19d082=_['merge']({},_0x19d082,_0x2d6ba0[_0x7721('0x3a')]);return db[_0x7721('0x28')]['find'](_0x19d082)[_0x7721('0x16')](handleEntityNotFound(_0x326c50,null))[_0x7721('0x16')](respondWithResult(_0x326c50,null))['catch'](handleError(_0x326c50,null));};exports['create']=function(_0x3d84d3,_0xfc4dc4){return db[_0x7721('0x28')][_0x7721('0x3b')](_0x3d84d3['body'],{})[_0x7721('0x16')](function(_0x120de9){var _0x40ce8c=_0x3d84d3[_0x7721('0x3c')][_0x7721('0x18')]({'plain':!![]});if(!_0x40ce8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40ce8c[_0x7721('0x3d')]==='user'){var _0xaa3216=_0x120de9['get']({'plain':!![]});var _0x2333b8=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':'QueueCampaigns','value':_0x7721('0x3e')}];var _0x11d853=_[_0x7721('0x21')](_0x2333b8,['value',_0xaa3216[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x11d853,'userProfileId':_0x40ce8c[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x463ccc){if(_0x463ccc&&_0x463ccc['autoAssociation']===0x0){return db['UserProfileResource'][_0x7721('0x3b')]({'name':_0xaa3216[_0x7721('0x22')],'resourceId':_0xaa3216['id'],'type':_0x463ccc[_0x7721('0x22')],'sectionId':_0x463ccc['id']},{})[_0x7721('0x16')](function(){return _0x120de9;});}else{return _0x120de9;}})[_0x7721('0x30')](function(_0x15181b){logger[_0x7721('0x25')](_0x7721('0x41'),_0x15181b);throw _0x15181b;});}return _0x120de9;})[_0x7721('0x16')](respondWithResult(_0xfc4dc4,0xc9))[_0x7721('0x30')](handleError(_0xfc4dc4,null));};exports['clone']=function(_0x578867,_0x5ed70d){var _0x6a4664={'where':{'id':_0x578867[_0x7721('0x31')]['id']}},_0x151f69={};_0x151f69['model']=_[_0x7721('0x33')](db[_0x7721('0x28')]['rawAttributes']);_0x6a4664[_0x7721('0x36')]=_['intersection'](_0x151f69[_0x7721('0x32')],qs['fields'](_0x578867[_0x7721('0x2d')][_0x7721('0x38')]));_0x6a4664[_0x7721('0x36')]=_0x6a4664['attributes'][_0x7721('0x39')]?_0x6a4664[_0x7721('0x36')]:_0x151f69['model'];if(_0x578867[_0x7721('0x2d')][_0x7721('0x42')]){_0x6a4664[_0x7721('0x2c')]=[{'all':!![]}];}_0x6a4664=_['merge']({},_0x6a4664,_0x578867[_0x7721('0x3a')]);return db['VoiceQueue'][_0x7721('0x21')](_0x6a4664)[_0x7721('0x16')](handleEntityNotFound(_0x5ed70d,null))[_0x7721('0x16')](function(_0x443503){if(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x18')]({'plain':!![]});_0x1c95d8=qs[_0x7721('0x43')](_0x1c95d8,['id',_0x7721('0x44'),_0x7721('0x45')]);_0x578867[_0x7721('0x46')]=_[_0x7721('0x43')](_0x578867[_0x7721('0x46')],['id',_0x7721('0x44'),_0x7721('0x45')]);return db[_0x7721('0x28')]['create'](_[_0x7721('0x47')](_0x1c95d8,_0x578867[_0x7721('0x46')]),{'include':_0x578867[_0x7721('0x2d')][_0x7721('0x42')]?[{'all':!![]}]:undefined})[_0x7721('0x16')](function(_0x315127){var _0x267f5e=_0x578867['user'][_0x7721('0x18')]({'plain':!![]});if(!_0x267f5e)throw new Error(_0x7721('0x48'));if(_0x267f5e[_0x7721('0x3d')]===_0x7721('0x3c')){var _0x1f1e84=_0x315127[_0x7721('0x18')]({'plain':!![]});var _0x7fbd6c=[{'name':_0x7721('0x19'),'value':_0x7721('0x1a')},{'name':_0x7721('0x1b'),'value':_0x7721('0x3e')}];var _0x52e870=_[_0x7721('0x21')](_0x7fbd6c,[_0x7721('0x1f'),_0x1f1e84[_0x7721('0x20')]])[_0x7721('0x22')];return db[_0x7721('0x3f')][_0x7721('0x21')]({'where':{'name':_0x52e870,'userProfileId':_0x267f5e[_0x7721('0x40')]},'raw':!![]})[_0x7721('0x16')](function(_0x360882){if(_0x360882&&_0x360882[_0x7721('0x49')]===0x0){return db[_0x7721('0x23')][_0x7721('0x3b')]({'name':_0x1f1e84[_0x7721('0x22')],'resourceId':_0x1f1e84['id'],'type':_0x360882[_0x7721('0x22')],'sectionId':_0x360882['id']},{})[_0x7721('0x16')](function(){return _0x315127;});}else{return _0x315127;}})['catch'](function(_0x50e9e9){logger['error'](_0x7721('0x41'),_0x50e9e9);throw _0x50e9e9;});}return _0x315127;});}})['then'](respondWithResult(_0x5ed70d,0xc9))['catch'](handleError(_0x5ed70d,null));};exports['update']=function(_0x5d7036,_0x47925a){if(_0x5d7036[_0x7721('0x46')]['id']){delete _0x5d7036[_0x7721('0x46')]['id'];}return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x5d7036['params']['id']}})['then'](handleEntityNotFound(_0x47925a,null))['then'](saveUpdates(_0x5d7036[_0x7721('0x46')],null))['then'](respondWithResult(_0x47925a,null))['catch'](handleError(_0x47925a,null));};exports['destroy']=function(_0x160292,_0x2e9155){return db[_0x7721('0x28')]['find']({'where':{'id':_0x160292[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x2e9155,null))[_0x7721('0x16')](removeEntity(_0x2e9155,null))[_0x7721('0x30')](handleError(_0x2e9155,null));};exports[_0x7721('0x4a')]=function(_0x16e80b,_0xad43ce){var _0x3e3301={'raw':![],'where':{}};var _0x127f46={};var _0x197b73={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16e80b[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0xad43ce,null))[_0x7721('0x16')](function(_0x4cbd28){if(_0x4cbd28){_0x127f46[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x4c')][_0x7721('0x34')]);_0x127f46['query']=_[_0x7721('0x33')](_0x16e80b[_0x7721('0x2d')]);_0x127f46['filters']=_[_0x7721('0x37')](_0x127f46['model'],_0x127f46[_0x7721('0x2d')]);_0x3e3301[_0x7721('0x36')]=_[_0x7721('0x37')](_0x127f46[_0x7721('0x32')],qs[_0x7721('0x38')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x38')]));_0x3e3301[_0x7721('0x36')]=_0x3e3301[_0x7721('0x36')]['length']?_0x3e3301[_0x7721('0x36')]:_0x127f46[_0x7721('0x32')];if(!_0x16e80b[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x3e3301[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16e80b['query'][_0x7721('0x4f')]);_0x3e3301[_0x7721('0x11')]=qs['offset'](_0x16e80b[_0x7721('0x2d')]['offset']);}_0x3e3301[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16e80b[_0x7721('0x2d')][_0x7721('0x51')]);_0x3e3301[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x16e80b['query'],_0x127f46[_0x7721('0x35')]));_0x3e3301[_0x7721('0x2b')][_0x7721('0x53')]=_0x4cbd28['id'];if(_0x16e80b['query']['filter']){_0x3e3301['where']=_['merge'](_0x3e3301['where'],{'$or':_[_0x7721('0x1e')](_0x3e3301[_0x7721('0x36')],function(_0x580473){var _0x2d4b3a={};_0x2d4b3a[_0x580473]={'$like':'%'+_0x16e80b[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x2d4b3a;})});}_0x3e3301=_[_0x7721('0x47')]({},_0x3e3301,_0x16e80b['options']);return db[_0x7721('0x4c')][_0x7721('0x13')]({'where':_0x3e3301[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0x3cf3fd){_0x197b73['count']=_0x3cf3fd;if(_0x16e80b[_0x7721('0x2d')][_0x7721('0x42')]){_0x3e3301[_0x7721('0x2c')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3e3301);})[_0x7721('0x16')](function(_0x752564){_0x197b73[_0x7721('0x2f')]=_0x752564;return _0x197b73;});}})[_0x7721('0x16')](respondWithFilteredResult(_0xad43ce,_0x3e3301))[_0x7721('0x30')](handleError(_0xad43ce,null));};exports['getHopperHistories']=function(_0x4ba35e,_0x263070){var _0x1bd97e={'raw':!![],'where':{}};var _0x68de4={};var _0x3c66b3={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x4ba35e[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x263070,null))[_0x7721('0x16')](function(_0x413185){if(_0x413185){_0x68de4[_0x7721('0x32')]=_['keys'](db[_0x7721('0x54')][_0x7721('0x34')]);_0x68de4[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x4ba35e['query']);_0x68de4['filters']=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],_0x68de4[_0x7721('0x2d')]);_0x1bd97e[_0x7721('0x36')]=_[_0x7721('0x37')](_0x68de4[_0x7721('0x32')],qs['fields'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x38')]));_0x1bd97e[_0x7721('0x36')]=_0x1bd97e['attributes'][_0x7721('0x39')]?_0x1bd97e[_0x7721('0x36')]:_0x68de4[_0x7721('0x32')];if(!_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x1bd97e[_0x7721('0x4f')]=qs['limit'](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1bd97e[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x11')]);}_0x1bd97e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ba35e[_0x7721('0x2d')][_0x7721('0x51')]);_0x1bd97e[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0x4ba35e[_0x7721('0x2d')],_0x68de4[_0x7721('0x35')]));_0x1bd97e['where'][_0x7721('0x53')]=_0x413185['id'];if(_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1bd97e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x1bd97e['where'],{'$or':_[_0x7721('0x1e')](_0x1bd97e[_0x7721('0x36')],function(_0x44326d){var _0x21b365={};_0x21b365[_0x44326d]={'$like':'%'+_0x4ba35e[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x21b365;})});}_0x1bd97e=_['merge']({},_0x1bd97e,_0x4ba35e[_0x7721('0x3a')]);return db[_0x7721('0x54')]['count']({'where':_0x1bd97e[_0x7721('0x2b')]})['then'](function(_0x453792){_0x3c66b3[_0x7721('0x13')]=_0x453792;if(_0x4ba35e['query'][_0x7721('0x42')]){_0x1bd97e['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1bd97e);})[_0x7721('0x16')](function(_0x20f12e){_0x3c66b3[_0x7721('0x2f')]=_0x20f12e;return _0x3c66b3;});}})['then'](respondWithFilteredResult(_0x263070,_0x1bd97e))['catch'](handleError(_0x263070,null));};exports['getHopperFinals']=function(_0x355aa8,_0x3f7923){var _0x3c9334={'raw':!![],'where':{}};var _0x4220cf={};var _0x3b02d7={'count':0x0,'rows':[]};return db[_0x7721('0x28')]['findOne']({'where':{'id':_0x355aa8[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3f7923,null))[_0x7721('0x16')](function(_0xcf5304){if(_0xcf5304){_0x4220cf[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x55')][_0x7721('0x34')]);_0x4220cf[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x355aa8[_0x7721('0x2d')]);_0x4220cf[_0x7721('0x35')]=_['intersection'](_0x4220cf['model'],_0x4220cf[_0x7721('0x2d')]);_0x3c9334[_0x7721('0x36')]=_['intersection'](_0x4220cf[_0x7721('0x32')],qs['fields'](_0x355aa8['query'][_0x7721('0x38')]));_0x3c9334['attributes']=_0x3c9334['attributes'][_0x7721('0x39')]?_0x3c9334[_0x7721('0x36')]:_0x4220cf[_0x7721('0x32')];if(!_0x355aa8[_0x7721('0x2d')][_0x7721('0x4d')]('nolimit')){_0x3c9334[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x355aa8[_0x7721('0x2d')][_0x7721('0x4f')]);_0x3c9334['offset']=qs['offset'](_0x355aa8[_0x7721('0x2d')][_0x7721('0x11')]);}_0x3c9334['order']=qs[_0x7721('0x51')](_0x355aa8[_0x7721('0x2d')]['sort']);_0x3c9334['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x355aa8[_0x7721('0x2d')],_0x4220cf[_0x7721('0x35')]));_0x3c9334[_0x7721('0x2b')][_0x7721('0x53')]=_0xcf5304['id'];if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x1c')]){_0x3c9334['where']=_[_0x7721('0x47')](_0x3c9334[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x3c9334[_0x7721('0x36')],function(_0xe1c795){var _0x9b5f60={};_0x9b5f60[_0xe1c795]={'$like':'%'+_0x355aa8[_0x7721('0x2d')]['filter']+'%'};return _0x9b5f60;})});}_0x3c9334=_[_0x7721('0x47')]({},_0x3c9334,_0x355aa8[_0x7721('0x3a')]);return db['CmHopperFinal'][_0x7721('0x13')]({'where':_0x3c9334[_0x7721('0x2b')]})[_0x7721('0x16')](function(_0xb8547a){_0x3b02d7[_0x7721('0x13')]=_0xb8547a;if(_0x355aa8[_0x7721('0x2d')][_0x7721('0x42')]){_0x3c9334[_0x7721('0x2c')]=[{'all':!![]}];}return db[_0x7721('0x55')][_0x7721('0x2e')](_0x3c9334);})['then'](function(_0x418954){_0x3b02d7[_0x7721('0x2f')]=_0x418954;return _0x3b02d7;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x3f7923,_0x3c9334))[_0x7721('0x30')](handleError(_0x3f7923,null));};exports[_0x7721('0x56')]=function(_0x47653d,_0x12869b){var _0x1cfee2={'raw':!![],'where':{}};var _0x425327={};var _0x42ee11={'count':0x0,'rows':[]};return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x47653d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12869b,null))[_0x7721('0x16')](function(_0x461938){if(_0x461938){_0x425327[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x57')][_0x7721('0x34')]);_0x425327['query']=_[_0x7721('0x33')](_0x47653d['query']);_0x425327[_0x7721('0x35')]=_[_0x7721('0x37')](_0x425327[_0x7721('0x32')],_0x425327[_0x7721('0x2d')]);_0x1cfee2[_0x7721('0x36')]=_['intersection'](_0x425327['model'],qs['fields'](_0x47653d['query'][_0x7721('0x38')]));_0x1cfee2[_0x7721('0x36')]=_0x1cfee2[_0x7721('0x36')][_0x7721('0x39')]?_0x1cfee2[_0x7721('0x36')]:_0x425327['model'];if(!_0x47653d[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x1cfee2[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x47653d[_0x7721('0x2d')][_0x7721('0x4f')]);_0x1cfee2[_0x7721('0x11')]=qs['offset'](_0x47653d[_0x7721('0x2d')]['offset']);}_0x1cfee2['order']=qs[_0x7721('0x51')](_0x47653d[_0x7721('0x2d')][_0x7721('0x51')]);_0x1cfee2[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x47653d[_0x7721('0x2d')],_0x425327[_0x7721('0x35')]));_0x1cfee2[_0x7721('0x2b')][_0x7721('0x53')]=_0x461938['id'];if(_0x47653d[_0x7721('0x2d')][_0x7721('0x1c')]){_0x1cfee2[_0x7721('0x2b')]=_['merge'](_0x1cfee2[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x1cfee2[_0x7721('0x36')],function(_0x193326){var _0x1dbf47={};_0x1dbf47[_0x193326]={'$like':'%'+_0x47653d['query'][_0x7721('0x1c')]+'%'};return _0x1dbf47;})});}_0x1cfee2=_[_0x7721('0x47')]({},_0x1cfee2,_0x47653d[_0x7721('0x3a')]);return db['CmHopperBlack'][_0x7721('0x13')]({'where':_0x1cfee2[_0x7721('0x2b')]})['then'](function(_0x29403d){_0x42ee11[_0x7721('0x13')]=_0x29403d;if(_0x47653d[_0x7721('0x2d')][_0x7721('0x42')]){_0x1cfee2['include']=[{'all':!![]}];}return db[_0x7721('0x57')]['findAll'](_0x1cfee2);})[_0x7721('0x16')](function(_0x1c50c2){_0x42ee11['rows']=_0x1c50c2;return _0x42ee11;});}})[_0x7721('0x16')](respondWithFilteredResult(_0x12869b,_0x1cfee2))[_0x7721('0x30')](handleError(_0x12869b,null));};exports['getTeams']=function(_0x29968c,_0x11733f){var _0x5e3816={};var _0x7fd3e8={};var _0x52e8b1;var _0x240b0a;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x29968c['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x11733f,null))['then'](function(_0x5a00be){if(_0x5a00be){_0x52e8b1=_0x5a00be;_0x7fd3e8[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x58')][_0x7721('0x34')]);_0x7fd3e8[_0x7721('0x2d')]=_['keys'](_0x29968c[_0x7721('0x2d')]);_0x7fd3e8[_0x7721('0x35')]=_[_0x7721('0x37')](_0x7fd3e8[_0x7721('0x32')],_0x7fd3e8[_0x7721('0x2d')]);_0x5e3816['attributes']=_[_0x7721('0x37')](_0x7fd3e8['model'],qs[_0x7721('0x38')](_0x29968c['query']['fields']));_0x5e3816[_0x7721('0x36')]=_0x5e3816['attributes']['length']?_0x5e3816[_0x7721('0x36')]:_0x7fd3e8[_0x7721('0x32')];_0x5e3816[_0x7721('0x50')]=qs['sort'](_0x29968c[_0x7721('0x2d')]['sort']);_0x5e3816['where']=qs['filters'](_[_0x7721('0x52')](_0x29968c[_0x7721('0x2d')],_0x7fd3e8[_0x7721('0x35')]));if(_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]){_0x5e3816[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x5e3816[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x5e3816[_0x7721('0x36')],function(_0x25bf32){var _0x4ec3c6={};_0x4ec3c6[_0x25bf32]={'$like':'%'+_0x29968c[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x4ec3c6;})});}_0x5e3816=_[_0x7721('0x47')]({},_0x5e3816,_0x29968c[_0x7721('0x3a')]);return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0xc7e4e9){if(_0xc7e4e9){_0x240b0a=_0xc7e4e9['length'];if(!_0x29968c['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x5e3816[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x29968c['query'][_0x7721('0x4f')]);_0x5e3816['offset']=qs[_0x7721('0x11')](_0x29968c['query'][_0x7721('0x11')]);}return _0x52e8b1[_0x7721('0x59')](_0x5e3816);}})[_0x7721('0x16')](function(_0x249a5b){if(_0x249a5b){return _0x249a5b?{'count':_0x240b0a,'rows':_0x249a5b}:null;}})[_0x7721('0x16')](respondWithResult(_0x11733f,null))[_0x7721('0x30')](handleError(_0x11733f,null));};exports['addTeams']=function(_0x509f2d,_0x4d2644){var _0x2b0968=_0x509f2d['body'][_0x7721('0x5a')];var _0x186ada=_['map'](_0x2b0968,'id');return db[_0x7721('0x58')][_0x7721('0x2e')]({'where':{'id':_0x186ada},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':'Agents','attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),'voicePause','interface'],'raw':!![]}]})[_0x7721('0x16')](function(_0xc85b9){if(_0xc85b9){var _0x58be49=_[_0x7721('0x5d')](_0xc85b9,function(_0x283716){var _0x4cd26e=_0x283716['get']({'plain':!![]});_0x4cd26e['Agents']['forEach'](function(_0x19be6b){_0x19be6b[_0x7721('0x5e')]=_[_0x7721('0x21')](_0x2b0968,{'id':_0x4cd26e['id']})['penalty'];});return _0x4cd26e['Agents'];});return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x509f2d[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x14711c){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0x435455){return _0x14711c[_0x7721('0x61')](_0x186ada,{'transaction':_0x435455})['then'](function(){return BPromise['each'](_0x2b0968,function(_0x415445){return db['TeamVoiceQueue'][_0x7721('0x62')]({'TeamId':_0x415445['id'],'VoiceQueueId':_0x509f2d['params']['id'],'penalty':_0x415445[_0x7721('0x5e')]},{'transaction':_0x435455});});})['then'](function(){return BPromise[_0x7721('0x63')](_0x58be49,function(_0x14341e){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x14341e['id'],'VoiceQueueId':_0x509f2d[_0x7721('0x31')]['id']},'defaults':{'penalty':_0x14341e[_0x7721('0x5e')]},'transaction':_0x435455});});})[_0x7721('0x16')](function(){return BPromise[_0x7721('0x63')](_[_0x7721('0x1c')](_0x58be49,{'online':!![]}),function(_0x5e69d7){return db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x5e69d7[_0x7721('0x22')],'UserId':_0x5e69d7['id'],'queue_name':_0x14711c['name'],'VoiceQueueId':_0x14711c['id'],'interface':_[_0x7721('0x65')](_0x5e69d7[_0x7721('0x66')])?util[_0x7721('0x67')](_0x7721('0x68'),_0x5e69d7[_0x7721('0x22')]):_0x5e69d7[_0x7721('0x66')],'paused':_0x5e69d7[_0x7721('0x69')]||![],'penalty':_0x5e69d7[_0x7721('0x5e')]},{'transaction':_0x435455});});})[_0x7721('0x16')](function(){_0x58be49[_0x7721('0x6a')](function(_0x2a2d8a){socket['emit'](_0x7721('0x6b'),{'UserId':_0x2a2d8a['id'],'VoiceQueueId':_0x14711c['id']});});});});});}})[_0x7721('0x16')](respondWithStatusCode(_0x4d2644,null))[_0x7721('0x30')](handleError(_0x4d2644,null));};exports[_0x7721('0x6c')]=function(_0xcb843e,_0x35d3f1){return db[_0x7721('0x58')]['findAll']({'where':{'id':_0xcb843e[_0x7721('0x2d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7721('0x5b')],'as':_0x7721('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x7721('0x16')](handleEntityNotFound(_0x35d3f1,null))[_0x7721('0x16')](function(_0x37b607){var _0x3d6d41=_['map'](_0x37b607,'id');var _0xbce1b=[];var _0x4d3ad1=[];var _0x4028fa=squel[_0x7721('0x6e')]();_0x4028fa[_0x7721('0x6f')]('tq.TeamId')[_0x7721('0x70')](_0x7721('0x71'),'tq')[_0x7721('0x72')](_0x7721('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7721('0x2b')](_0x7721('0x74'),_0xcb843e[_0x7721('0x31')]['id']);for(var _0x980f26=0x0;_0x980f26<_0x37b607['length'];_0x980f26+=0x1){let _0x40dd5e=_0x37b607[_0x980f26];for(var _0x3d143a=0x0;_0x3d143a<_0x40dd5e[_0x7721('0x6d')][_0x7721('0x39')];_0x3d143a+=0x1){let _0x53fa66=_0x40dd5e[_0x7721('0x6d')][_0x3d143a];var _0x1a95e6=_0x4028fa[_0x7721('0x75')]();_0x1a95e6[_0x7721('0x2b')](_0x7721('0x76'),_0x53fa66['id']);_0x4d3ad1[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x1a95e6[_0x7721('0x78')](),{'type':db['sequelize'][_0x7721('0x79')][_0x7721('0x7a')]})[_0x7721('0x16')](function(_0x1c246b){if(_0x1c246b[_0x7721('0x39')]===0x1){return _0x53fa66['id'];}else{var _0x31447d=_[_0x7721('0x7b')](_[_0x7721('0x1e')](_0x1c246b,_0x7721('0x7c')),function(_0x14fd97){return _[_0x7721('0x7d')](_0x3d6d41,_0x14fd97);});if(_0x31447d){return _0x53fa66['id'];}}}));}}return BPromise[_0x7721('0x7e')](_0x4d3ad1)[_0x7721('0x16')](function(_0x18ccdf){_0xbce1b=_(_0xbce1b)[_0x7721('0x7f')](_0x18ccdf)[_0x7721('0x80')]()['value']();return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xcb843e[_0x7721('0x31')]['id']}})[_0x7721('0x16')](function(_0x157310){return db[_0x7721('0x5f')][_0x7721('0x60')](function(_0xdd0e7a){return _0x157310[_0x7721('0x6c')](_0xcb843e[_0x7721('0x2d')][_0x7721('0x81')],{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){if(!_['isEmpty'](_0xbce1b)){return _0x157310['removeAgents'](_0xbce1b,{'transaction':_0xdd0e7a})[_0x7721('0x16')](function(){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0xcb843e[_0x7721('0x31')]['id'],'UserId':_0xbce1b},'transaction':_0xdd0e7a});});}})[_0x7721('0x16')](function(){_0xbce1b['forEach'](function(_0x1ebc86){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':_0x1ebc86,'VoiceQueueId':_0x157310['id']});});});});});});})[_0x7721('0x16')](respondWithStatusCode(_0x35d3f1,null))[_0x7721('0x30')](handleError(_0x35d3f1,null));};exports[_0x7721('0x84')]=function(_0xc0f448,_0x3dc688){var _0x298aca,_0x45b430;return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0xc0f448['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x3dc688,null))[_0x7721('0x16')](function(_0x16e0cd){if(_0x16e0cd){_0x45b430=_0x16e0cd;return _0x16e0cd['addAgents'](_0xc0f448[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xc0f448['body'],[_0x7721('0x81'),'id'])||{})['spread'](function(_0x5f3dd2){for(var _0xa73193=0x0;_0xa73193<_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0x7721('0x39')];_0xa73193+=0x1){socket['emit'](_0x7721('0x6b'),{'UserId':Number(_0xc0f448[_0x7721('0x46')][_0x7721('0x81')][_0xa73193]),'VoiceQueueId':Number(_0xc0f448[_0x7721('0x31')]['id'])});}return _0x5f3dd2;});}})[_0x7721('0x16')](function(_0x5b12c7){_0x298aca=_0x5b12c7||[];if(_0x45b430){return db[_0x7721('0x5b')][_0x7721('0x2e')]({'where':{'id':_0xc0f448[_0x7721('0x46')][_0x7721('0x81')]},'attributes':['id',_0x7721('0x22'),_0x7721('0x5c'),_0x7721('0x69'),_0x7721('0x66')],'raw':!![]});}})[_0x7721('0x16')](function(_0x385c86){if(!_[_0x7721('0x85')](_0x385c86)){var _0xc18d1a=[];for(var _0x9575b3=0x0;_0x9575b3<_0x385c86[_0x7721('0x39')];_0x9575b3++){if(_0x385c86[_0x9575b3][_0x7721('0x5c')]){_0xc18d1a[_0x7721('0x77')](db[_0x7721('0x64')][_0x7721('0x62')]({'membername':_0x385c86[_0x9575b3][_0x7721('0x22')],'UserId':_0x385c86[_0x9575b3]['id'],'queue_name':_0x45b430[_0x7721('0x22')],'VoiceQueueId':_0x45b430['id'],'interface':_[_0x7721('0x65')](_0x385c86[_0x9575b3][_0x7721('0x66')])?util['format'](_0x7721('0x68'),_0x385c86[_0x9575b3]['name']):_0x385c86[_0x9575b3][_0x7721('0x66')],'paused':_0x385c86[_0x9575b3][_0x7721('0x69')]||![],'penalty':_0xc0f448[_0x7721('0x46')][_0x7721('0x5e')]||0x0}));}}return BPromise['all'](_0xc18d1a);}})[_0x7721('0x16')](function(){return _0x298aca;})[_0x7721('0x16')](respondWithResult(_0x3dc688,null))['catch'](handleError(_0x3dc688,null));};exports[_0x7721('0x86')]=function(_0x3a8f89,_0x52aae1){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x3a8f89[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x52aae1,null))[_0x7721('0x16')](function(_0x55c43c){if(_0x55c43c){return _0x55c43c['removeAgents'](_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')])['then'](function(){if(_['isArray'](_0x3a8f89[_0x7721('0x2d')]['ids'])){for(var _0x1c23e3=0x0;_0x1c23e3<_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]['length'];_0x1c23e3+=0x1){socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')][_0x1c23e3]),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}}else{socket[_0x7721('0x82')](_0x7721('0x83'),{'UserId':Number(_0x3a8f89[_0x7721('0x2d')]['ids']),'VoiceQueueId':Number(_0x3a8f89[_0x7721('0x31')]['id'])});}});}})[_0x7721('0x16')](function(_0x3c3c7e){return db[_0x7721('0x64')][_0x7721('0x17')]({'where':{'VoiceQueueId':_0x3a8f89['params']['id'],'UserId':_0x3a8f89[_0x7721('0x2d')][_0x7721('0x81')]}})[_0x7721('0x16')](function(){return _0x3c3c7e;});})[_0x7721('0x16')](respondWithStatusCode(_0x52aae1,null))[_0x7721('0x30')](handleError(_0x52aae1,null));};exports[_0x7721('0x87')]=function(_0x16b110,_0x366323){var _0x14b49e={};var _0x12f568={};var _0x259640;var _0x4a0e50;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0x16b110[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x366323,null))[_0x7721('0x16')](function(_0x25e4db){if(_0x25e4db){_0x259640=_0x25e4db;_0x12f568[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x5b')][_0x7721('0x34')]);_0x12f568[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x16b110[_0x7721('0x2d')]);_0x12f568[_0x7721('0x35')]=_[_0x7721('0x37')](_0x12f568['model'],_0x12f568[_0x7721('0x2d')]);_0x14b49e['attributes']=_['intersection'](_0x12f568[_0x7721('0x32')],qs['fields'](_0x16b110[_0x7721('0x2d')][_0x7721('0x38')]));_0x14b49e[_0x7721('0x36')]=_0x14b49e[_0x7721('0x36')]['length']?_0x14b49e['attributes']:_0x12f568[_0x7721('0x32')];_0x14b49e[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x16b110[_0x7721('0x2d')][_0x7721('0x51')]);_0x14b49e[_0x7721('0x2b')]=qs[_0x7721('0x35')](_['pick'](_0x16b110[_0x7721('0x2d')],_0x12f568['filters']));if(_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]){_0x14b49e[_0x7721('0x2b')]=_[_0x7721('0x47')](_0x14b49e[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x14b49e[_0x7721('0x36')],function(_0x184f1b){var _0xa257a0={};_0xa257a0[_0x184f1b]={'$like':'%'+_0x16b110[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0xa257a0;})});}_0x14b49e=_[_0x7721('0x47')]({},_0x14b49e,_0x16b110[_0x7721('0x3a')]);return _0x259640[_0x7721('0x87')](_0x14b49e);}})[_0x7721('0x16')](function(_0x1ee0c1){if(_0x1ee0c1){_0x4a0e50=_0x1ee0c1[_0x7721('0x39')];if(!_0x16b110[_0x7721('0x2d')]['hasOwnProperty'](_0x7721('0x4e'))){_0x14b49e[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0x16b110[_0x7721('0x2d')][_0x7721('0x4f')]);_0x14b49e[_0x7721('0x11')]=qs['offset'](_0x16b110[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x259640[_0x7721('0x87')](_0x14b49e);}})['then'](function(_0x1bdadb){if(_0x1bdadb){return _0x1bdadb?{'count':_0x4a0e50,'rows':_0x1bdadb}:null;}})['then'](respondWithResult(_0x366323,null))[_0x7721('0x30')](handleError(_0x366323,null));};exports['getMembers']=function(_0xe5e55f,_0x17ce3b){var _0xbc0a80={};var _0xf2dc08={};var _0x5b493a;var _0x45024c;return db[_0x7721('0x28')][_0x7721('0x4b')]({'where':{'id':_0xe5e55f[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x17ce3b,null))['then'](function(_0x12b255){if(_0x12b255){_0x5b493a=_0x12b255;_0xf2dc08['model']=_[_0x7721('0x33')](db[_0x7721('0x64')][_0x7721('0x34')]);_0xf2dc08[_0x7721('0x2d')]=_[_0x7721('0x33')](_0xe5e55f[_0x7721('0x2d')]);_0xf2dc08[_0x7721('0x35')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],_0xf2dc08['query']);_0xbc0a80[_0x7721('0x36')]=_[_0x7721('0x37')](_0xf2dc08[_0x7721('0x32')],qs['fields'](_0xe5e55f['query'][_0x7721('0x38')]));_0xbc0a80[_0x7721('0x36')]=_0xbc0a80[_0x7721('0x36')][_0x7721('0x39')]?_0xbc0a80[_0x7721('0x36')]:_0xf2dc08[_0x7721('0x32')];_0xbc0a80['order']=qs[_0x7721('0x51')](_0xe5e55f[_0x7721('0x2d')]['sort']);_0xbc0a80[_0x7721('0x2b')]=qs['filters'](_[_0x7721('0x52')](_0xe5e55f['query'],_0xf2dc08[_0x7721('0x35')]));if(_0xe5e55f['query']['filter']){_0xbc0a80['where']=_[_0x7721('0x47')](_0xbc0a80['where'],{'$or':_['map'](_0xbc0a80['attributes'],function(_0x52a1ee){var _0x41c991={};_0x41c991[_0x52a1ee]={'$like':'%'+_0xe5e55f[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x41c991;})});}_0xbc0a80=_[_0x7721('0x47')]({},_0xbc0a80,_0xe5e55f[_0x7721('0x3a')]);return _0x5b493a['getMembers'](_0xbc0a80);}})[_0x7721('0x16')](function(_0x22d4e0){if(_0x22d4e0){_0x45024c=_0x22d4e0['length'];if(!_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0xbc0a80[_0x7721('0x4f')]=qs[_0x7721('0x4f')](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x4f')]);_0xbc0a80[_0x7721('0x11')]=qs['offset'](_0xe5e55f[_0x7721('0x2d')][_0x7721('0x11')]);}return _0x5b493a[_0x7721('0x88')](_0xbc0a80);}})[_0x7721('0x16')](function(_0x2fbb00){return _0x2fbb00?{'count':_0x45024c,'rows':_0x2fbb00}:null;})[_0x7721('0x16')](respondWithResult(_0x17ce3b,null))[_0x7721('0x30')](handleError(_0x17ce3b,null));};exports[_0x7721('0x89')]=function(_0x561235,_0x12ad4d){var _0x226081={};var _0x17c3e7={};var _0x250cbf;var _0x255b22;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x561235[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x12ad4d,null))[_0x7721('0x16')](function(_0x396880){if(_0x396880){_0x250cbf=_0x396880;_0x17c3e7['model']=_[_0x7721('0x33')](db[_0x7721('0x8a')]['rawAttributes']);_0x17c3e7[_0x7721('0x2d')]=_[_0x7721('0x33')](_0x561235[_0x7721('0x2d')]);_0x17c3e7[_0x7721('0x35')]=_[_0x7721('0x37')](_0x17c3e7['model'],_0x17c3e7[_0x7721('0x2d')]);_0x226081[_0x7721('0x36')]=_['intersection'](_0x17c3e7['model'],qs[_0x7721('0x38')](_0x561235[_0x7721('0x2d')][_0x7721('0x38')]));_0x226081['attributes']=_0x226081[_0x7721('0x36')]['length']?_0x226081['attributes']:_0x17c3e7[_0x7721('0x32')];_0x226081[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x561235[_0x7721('0x2d')][_0x7721('0x51')]);_0x226081['where']=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x561235[_0x7721('0x2d')],_0x17c3e7[_0x7721('0x35')]));if(_0x561235[_0x7721('0x2d')]['filter']){_0x226081[_0x7721('0x2b')]=_['merge'](_0x226081[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x226081[_0x7721('0x36')],function(_0x5209ff){var _0x2583c1={};_0x2583c1[_0x5209ff]={'$like':'%'+_0x561235['query'][_0x7721('0x1c')]+'%'};return _0x2583c1;})});}_0x226081=_[_0x7721('0x47')]({},_0x226081,_0x561235[_0x7721('0x3a')]);return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x3235d8){if(_0x3235d8){_0x255b22=_0x3235d8[_0x7721('0x39')];if(!_0x561235[_0x7721('0x2d')][_0x7721('0x4d')](_0x7721('0x4e'))){_0x226081['limit']=qs[_0x7721('0x4f')](_0x561235[_0x7721('0x2d')][_0x7721('0x4f')]);_0x226081[_0x7721('0x11')]=qs[_0x7721('0x11')](_0x561235['query'][_0x7721('0x11')]);}return _0x250cbf[_0x7721('0x89')](_0x226081);}})[_0x7721('0x16')](function(_0x501e31){if(_0x501e31){return _0x501e31?{'count':_0x255b22,'rows':_0x501e31}:null;}})[_0x7721('0x16')](respondWithResult(_0x12ad4d,null))[_0x7721('0x30')](handleError(_0x12ad4d,null));};exports[_0x7721('0x8b')]=function(_0xe325e1,_0x1aa1fc){var _0x560be6=moment()[_0x7721('0x67')](_0x7721('0x8c'));var _0x1bd066,_0xaa15c5;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xe325e1[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x1aa1fc,null))[_0x7721('0x16')](function(_0x42ffff){if(_0x42ffff){_0xaa15c5=_0x42ffff;return _0x42ffff[_0x7721('0x8b')](_0xe325e1[_0x7721('0x46')][_0x7721('0x81')],_[_0x7721('0x43')](_0xe325e1[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x3f19f5){var _0x28f11a;_0x1bd066=_0x3f19f5||[];var _0x3bc8f3=[];if(_0x3f19f5){for(var _0x26cea3=0x0;_0x26cea3<_0x3f19f5[_0x7721('0x39')];_0x26cea3+=0x1){var _0x57e928=_0x3f19f5[_0x26cea3]['get']({'plain':!![]});_0xaa15c5[_0x7721('0x8e')]=_0xe325e1[_0x7721('0x46')][_0x7721('0x8e')]?_0xe325e1[_0x7721('0x46')]['dialCheckDuplicateType']:_0xaa15c5[_0x7721('0x8e')];switch(_0xaa15c5['dialCheckDuplicateType']){case _0x7721('0x8f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')['fromQuery'](['phone',_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),'updatedAt'],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),'ListId')[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','updatedAt')['from'](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928['CmListId'][_0x7721('0x78')]())[_0x7721('0x2b')](_0x7721('0x9a'))[_0x7721('0x2b')](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9c'))[_0x7721('0x70')](_0x7721('0x9d'))['where'](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id']['toString']()))[_0x7721('0x2b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7721('0x6e')]()['field'](_0x7721('0x9e'))['from']('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0xe325e1[_0x7721('0x31')]['id']['toString']())))[_0x7721('0x78')]();break;case _0x7721('0x9f'):_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')](_0x7721('0xa0'))[_0x7721('0xa1')](['phone',_0x7721('0x92'),_0x7721('0x93'),'ListId','VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x57e928[_0x7721('0x96')][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field']('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))['from'](_0x7721('0x97'))['where']('deletedAt\x20IS\x20NULL')[_0x7721('0x2b')]('ListId\x20=\x20?',_0x57e928[_0x7721('0x96')]['toString']())[_0x7721('0x2b')](_0x7721('0x9a'))['where'](_0x7721('0x9b'),squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x9e'))[_0x7721('0x70')]('cm_hopper')[_0x7721('0x2b')](_0x7721('0x74'),_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')]())))[_0x7721('0x78')]();break;default:_0x28f11a=squel[_0x7721('0x90')]()[_0x7721('0x91')]('cm_hopper')[_0x7721('0xa1')]([_0x7721('0x95'),_0x7721('0x92'),_0x7721('0x93'),_0x7721('0x94'),'VoiceQueueId',_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0x95'),_0x7721('0x95'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x92'))[_0x7721('0x6f')]('id',_0x7721('0x93'))['field'](_0x57e928['CmListId'][_0x7721('0x78')](),'ListId')['field'](_0xe325e1[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x44'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0x97'))[_0x7721('0x2b')](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x57e928[_0x7721('0x96')][_0x7721('0x78')]())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();}_0x3bc8f3[_0x7721('0x77')](db[_0x7721('0x5f')][_0x7721('0x2d')](_0x28f11a));}return BPromise[_0x7721('0x7e')](_0x3bc8f3);}})[_0x7721('0x16')](function(){var _0x5f53b3=[];var _0x8fc283=squel[_0x7721('0x90')]()['into'](_0x7721('0xa2'))['fromQuery']([_0x7721('0xa3'),_0x7721('0x95'),_0x7721('0xa4'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()[_0x7721('0x6f')](_0x7721('0xa5'))[_0x7721('0x6f')](_0x7721('0xa6'))[_0x7721('0x6f')](_0x7721('0xa7'))[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27','createdAt')[_0x7721('0x6f')]('\x27'+_0x560be6+'\x27',_0x7721('0x45'))[_0x7721('0x70')](_0x7721('0xa8'),'ci')[_0x7721('0x72')](_0x7721('0xa0'),'h',_0x7721('0xa9'))['where'](_0x7721('0xaa'),_0x560be6)[_0x7721('0x2b')](_0x7721('0xab'),'PHONE'))[_0x7721('0x78')]();_0x5f53b3['push'](db['sequelize'][_0x7721('0x2d')](_0x8fc283));return BPromise[_0x7721('0x7e')](_0x5f53b3);})['then'](function(){return _0x1bd066;})[_0x7721('0x16')](respondWithResult(_0x1aa1fc,null))[_0x7721('0x30')](handleError(_0x1aa1fc,null));};exports[_0x7721('0xac')]=function(_0xbc4f13,_0x50f4bd){return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0xbc4f13['params']['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x50f4bd,null))[_0x7721('0x16')](function(_0x537831){if(_0x537831){return _0x537831[_0x7721('0xac')](_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')]);}})[_0x7721('0x16')](function(_0x49548e){if(_0x49548e){return db['CmHopper'][_0x7721('0x17')]({'where':{'ListId':_0xbc4f13[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0xbc4f13[_0x7721('0x31')]['id']}})['then'](function(){return _0x49548e;});}})['then'](respondWithStatusCode(_0x50f4bd,null))[_0x7721('0x30')](handleError(_0x50f4bd,null));};exports[_0x7721('0xad')]=function(_0x4ea8ac,_0x226556){var _0x4bd023={};var _0x50de45={};var _0x51ac8f;var _0x27ed5e;return db['VoiceQueue'][_0x7721('0x4b')]({'where':{'id':_0x4ea8ac[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x226556,null))['then'](function(_0x4893c0){if(_0x4893c0){_0x51ac8f=_0x4893c0;_0x50de45[_0x7721('0x32')]=_[_0x7721('0x33')](db[_0x7721('0x8a')][_0x7721('0x34')]);_0x50de45[_0x7721('0x2d')]=_['keys'](_0x4ea8ac[_0x7721('0x2d')]);_0x50de45[_0x7721('0x35')]=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],_0x50de45[_0x7721('0x2d')]);_0x4bd023['attributes']=_[_0x7721('0x37')](_0x50de45[_0x7721('0x32')],qs[_0x7721('0x38')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x38')]));_0x4bd023[_0x7721('0x36')]=_0x4bd023['attributes']['length']?_0x4bd023[_0x7721('0x36')]:_0x50de45[_0x7721('0x32')];_0x4bd023[_0x7721('0x50')]=qs[_0x7721('0x51')](_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x51')]);_0x4bd023[_0x7721('0x2b')]=qs[_0x7721('0x35')](_[_0x7721('0x52')](_0x4ea8ac[_0x7721('0x2d')],_0x50de45[_0x7721('0x35')]));if(_0x4ea8ac['query'][_0x7721('0x1c')]){_0x4bd023[_0x7721('0x2b')]=_['merge'](_0x4bd023[_0x7721('0x2b')],{'$or':_[_0x7721('0x1e')](_0x4bd023[_0x7721('0x36')],function(_0x400273){var _0x42c438={};_0x42c438[_0x400273]={'$like':'%'+_0x4ea8ac[_0x7721('0x2d')][_0x7721('0x1c')]+'%'};return _0x42c438;})});}_0x4bd023=_[_0x7721('0x47')]({},_0x4bd023,_0x4ea8ac[_0x7721('0x3a')]);return _0x51ac8f[_0x7721('0xad')](_0x4bd023);}})[_0x7721('0x16')](function(_0x1192a8){if(_0x1192a8){_0x27ed5e=_0x1192a8[_0x7721('0x39')];if(!_0x4ea8ac['query'][_0x7721('0x4d')](_0x7721('0x4e'))){_0x4bd023['limit']=qs[_0x7721('0x4f')](_0x4ea8ac['query'][_0x7721('0x4f')]);_0x4bd023[_0x7721('0x11')]=qs['offset'](_0x4ea8ac['query'][_0x7721('0x11')]);}return _0x51ac8f['getBlackLists'](_0x4bd023);}})[_0x7721('0x16')](function(_0x2f7067){if(_0x2f7067){return _0x2f7067?{'count':_0x27ed5e,'rows':_0x2f7067}:null;}})[_0x7721('0x16')](respondWithResult(_0x226556,null))[_0x7721('0x30')](handleError(_0x226556,null));};exports[_0x7721('0xae')]=function(_0x376f37,_0x5b157e){var _0x4b84b9;return db['VoiceQueue'][_0x7721('0x21')]({'where':{'id':_0x376f37[_0x7721('0x31')]['id']}})[_0x7721('0x16')](handleEntityNotFound(_0x5b157e,null))[_0x7721('0x16')](function(_0x39d43b){if(_0x39d43b){return _0x39d43b['addBlackLists'](_0x376f37['body'][_0x7721('0x81')],_[_0x7721('0x43')](_0x376f37[_0x7721('0x46')],[_0x7721('0x81'),'id'])||{});}return null;})[_0x7721('0x8d')](function(_0x430304){var _0x469b6b;_0x4b84b9=_0x430304||[];var _0x6766c6=[];if(_0x430304){for(var _0x37877c=0x0;_0x37877c<_0x430304['length'];_0x37877c+=0x1){var _0x259eaa=_0x430304[_0x37877c][_0x7721('0x18')]({'plain':!![]});_0x469b6b=squel['insert']()['into'](_0x7721('0xaf'))[_0x7721('0xa1')]([_0x7721('0x95'),'ContactId',_0x7721('0x94'),_0x7721('0x53'),_0x7721('0x44'),_0x7721('0x45')],squel[_0x7721('0x6e')]()['field'](_0x7721('0x95'),'phone')[_0x7721('0x6f')]('id','ContactId')[_0x7721('0x6f')](_0x259eaa['CmListId'][_0x7721('0x78')](),_0x7721('0x94'))[_0x7721('0x6f')](_0x376f37[_0x7721('0x31')]['id'][_0x7721('0x78')](),_0x7721('0x53'))['field'](_0x7721('0xb0'),_0x7721('0x44'))[_0x7721('0x6f')](_0x7721('0xb0'),'updatedAt')[_0x7721('0x70')](_0x7721('0x97'))['where'](_0x7721('0x98'))[_0x7721('0x2b')](_0x7721('0x99'),_0x259eaa['CmListId']['toString']())[_0x7721('0x2b')]('phone\x20IS\x20NOT\x20NULL'))[_0x7721('0x78')]();_0x6766c6[_0x7721('0x77')](db['sequelize'][_0x7721('0x2d')](_0x469b6b));}return BPromise[_0x7721('0x7e')](_0x6766c6);}})['then'](function(){return _0x4b84b9;})[_0x7721('0x16')](respondWithResult(_0x5b157e,null))[_0x7721('0x30')](handleError(_0x5b157e,null));};exports[_0x7721('0xb1')]=function(_0x37da70,_0x54616a){return db[_0x7721('0x28')][_0x7721('0x21')]({'where':{'id':_0x37da70[_0x7721('0x31')]['id']}})['then'](handleEntityNotFound(_0x54616a,null))[_0x7721('0x16')](function(_0x174e79){if(_0x174e79){return _0x174e79['removeBlackLists'](_0x37da70[_0x7721('0x2d')]['ids']);}})[_0x7721('0x16')](function(_0x4c1b63){if(_0x4c1b63){return db[_0x7721('0x57')][_0x7721('0x17')]({'where':{'ListId':_0x37da70[_0x7721('0x2d')][_0x7721('0x81')],'VoiceQueueId':_0x37da70[_0x7721('0x31')]['id']}})['then'](function(){return _0x4c1b63;});}})[_0x7721('0x16')](respondWithStatusCode(_0x54616a,null))[_0x7721('0x30')](handleError(_0x54616a,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 7f82c1e..645f56b 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 _0x84bd=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x56d6f4,_0x48f290){var _0x18286d=function(_0x4f744c){while(--_0x4f744c){_0x56d6f4['push'](_0x56d6f4['shift']());}};_0x18286d(++_0x48f290);}(_0x84bd,0x16f));var _0xd84b=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x84bd[_0x57cc22];return _0x6f7bdc;};'use strict';var EventEmitter=require(_0xd84b('0x0'));var VoiceQueue=require(_0xd84b('0x1'))['db'][_0xd84b('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd84b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd84b('0x4'),'afterDestroy':_0xd84b('0x5')};function emitEvent(_0x4b858e){return function(_0x3e875e,_0xdff663,_0x1589e3){VoiceQueueEvents[_0xd84b('0x6')](_0x4b858e+':'+_0x3e875e['id'],_0x3e875e);VoiceQueueEvents[_0xd84b('0x6')](_0x4b858e,_0x3e875e);_0x1589e3(null);};}for(var e in events){if(events[_0xd84b('0x7')](e)){var event=events[e];VoiceQueue[_0xd84b('0x8')](e,emitEvent(event));}}module[_0xd84b('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x0b89=['setMaxListeners','save','update','remove','emit','hook','exports','events','VoiceQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b89,0xfa));var _0x90b8=function(_0x2c20c3,_0x2594e1){_0x2c20c3=_0x2c20c3-0x0;var _0x17ed4c=_0x0b89[_0x2c20c3];return _0x17ed4c;};'use strict';var EventEmitter=require(_0x90b8('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x90b8('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x90b8('0x2')](0x0);var events={'afterCreate':_0x90b8('0x3'),'afterUpdate':_0x90b8('0x4'),'afterDestroy':_0x90b8('0x5')};function emitEvent(_0x467599){return function(_0x43da9e,_0xeecf1c,_0x4cc437){VoiceQueueEvents[_0x90b8('0x6')](_0x467599+':'+_0x43da9e['id'],_0x43da9e);VoiceQueueEvents[_0x90b8('0x6')](_0x467599,_0x43da9e);_0x4cc437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x90b8('0x7')](e,emitEvent(event));}}module[_0x90b8('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 a35ebbf..cf8cf00 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['request-promise','path','./voiceQueue.attributes','define','VoiceQueue','voice_queues','../../config/logger','api','moment','bluebird'];(function(_0x29571e,_0x4add3a){var _0xc2296e=function(_0x307a0c){while(--_0x307a0c){_0x29571e['push'](_0x29571e['shift']());}};_0xc2296e(++_0x4add3a);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue'];(function(_0x5d8b1e,_0x216b9e){var _0x1a742b=function(_0x5817d6){while(--_0x5817d6){_0x5d8b1e['push'](_0x5d8b1e['shift']());}};_0x1a742b(++_0x216b9e);}(_0x34e8,0x12c));var _0x834e=function(_0x2ce71e,_0x407dfb){_0x2ce71e=_0x2ce71e-0x0;var _0x3c2efa=_0x34e8[_0x2ce71e];return _0x3c2efa;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index f6f7f32..70a35fa 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 _0x4b80=['localhost','./voiceQueue.socket','register','request','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','catch','GetVoiceQueue','findAll','options','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x218994,_0x2cf487){var _0x3f350b=function(_0x2e2065){while(--_0x2e2065){_0x218994['push'](_0x218994['shift']());}};_0x3f350b(++_0x2cf487);}(_0x4b80,0x99));var _0x04b8=function(_0x2a4b9f,_0x1704cb){_0x2a4b9f=_0x2a4b9f-0x0;var _0x13186b=_0x4b80[_0x2a4b9f];return _0x13186b;};'use strict';var _=require(_0x04b8('0x0'));var util=require(_0x04b8('0x1'));var moment=require(_0x04b8('0x2'));var BPromise=require(_0x04b8('0x3'));var rs=require(_0x04b8('0x4'));var fs=require('fs');var Redis=require(_0x04b8('0x5'));var db=require(_0x04b8('0x6'))['db'];var utils=require(_0x04b8('0x7'));var logger=require(_0x04b8('0x8'))(_0x04b8('0x9'));var config=require(_0x04b8('0xa'));var jayson=require(_0x04b8('0xb'));var client=jayson[_0x04b8('0xc')][_0x04b8('0xd')]({'port':0x232a});config[_0x04b8('0xe')]=_['defaults'](config[_0x04b8('0xe')],{'host':_0x04b8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04b8('0xe')]));require(_0x04b8('0x10'))[_0x04b8('0x11')](socket);function respondWithRpcPromise(_0x395c27,_0x2a637b,_0x37a9d4){return new BPromise(function(_0x28f310,_0x2370a2){return client[_0x04b8('0x12')](_0x395c27,_0x37a9d4)['then'](function(_0x3bae3f){logger['info'](_0x04b8('0x13'),_0x2a637b,'request\x20sent');logger[_0x04b8('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x2a637b,_0x04b8('0x15'),JSON[_0x04b8('0x16')](_0x3bae3f));if(_0x3bae3f['error']){if(_0x3bae3f['error'][_0x04b8('0x17')]===0x1f4){logger[_0x04b8('0x18')](_0x04b8('0x13'),_0x2a637b,_0x3bae3f[_0x04b8('0x18')][_0x04b8('0x19')]);return _0x2370a2(_0x3bae3f[_0x04b8('0x18')][_0x04b8('0x19')]);}logger['error'](_0x04b8('0x13'),_0x2a637b,_0x3bae3f[_0x04b8('0x18')][_0x04b8('0x19')]);return _0x28f310(_0x3bae3f[_0x04b8('0x18')]['message']);}else{logger[_0x04b8('0x1a')](_0x04b8('0x13'),_0x2a637b,_0x04b8('0x15'));_0x28f310(_0x3bae3f['result'][_0x04b8('0x19')]);}})[_0x04b8('0x1b')](function(_0xaf01a0){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x2a637b,_0xaf01a0);_0x2370a2(_0xaf01a0);});});}exports[_0x04b8('0x1c')]=function(_0x42ad99){var _0x39a0bc=this;return new Promise(function(_0x34e733,_0x1fab5f){return db['VoiceQueue'][_0x04b8('0x1d')]({'raw':_0x42ad99[_0x04b8('0x1e')]?_0x42ad99['options']['raw']===undefined?!![]:![]:!![],'where':_0x42ad99['options']?_0x42ad99[_0x04b8('0x1e')]['where']||null:null,'attributes':_0x42ad99[_0x04b8('0x1e')]?_0x42ad99[_0x04b8('0x1e')][_0x04b8('0x1f')]||null:null,'limit':_0x42ad99['options']?_0x42ad99['options'][_0x04b8('0x20')]||null:null,'include':_0x42ad99[_0x04b8('0x1e')]?_0x42ad99['options'][_0x04b8('0x21')]?_[_0x04b8('0x22')](_0x42ad99[_0x04b8('0x1e')][_0x04b8('0x21')],function(_0x4dd05c){return{'model':db[_0x4dd05c[_0x04b8('0x23')]],'as':_0x4dd05c['as'],'attributes':_0x4dd05c['attributes'],'include':_0x4dd05c[_0x04b8('0x21')]?_[_0x04b8('0x22')](_0x4dd05c[_0x04b8('0x21')],function(_0x2314cd){return{'model':db[_0x2314cd[_0x04b8('0x23')]],'as':_0x2314cd['as'],'attributes':_0x2314cd[_0x04b8('0x1f')],'include':_0x2314cd[_0x04b8('0x21')]?_['map'](_0x2314cd[_0x04b8('0x21')],function(_0x5ec7f3){return{'model':db[_0x5ec7f3[_0x04b8('0x23')]],'as':_0x5ec7f3['as'],'attributes':_0x5ec7f3[_0x04b8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x04b8('0x24')](function(_0x3928a2){logger[_0x04b8('0x1a')]('GetVoiceQueue',_0x42ad99);logger['debug'](_0x04b8('0x1c'),_0x42ad99,JSON['stringify'](_0x3928a2));_0x34e733(_0x3928a2);})[_0x04b8('0x1b')](function(_0x15ebfc){logger[_0x04b8('0x18')](_0x04b8('0x1c'),_0x15ebfc[_0x04b8('0x19')],_0x42ad99);_0x1fab5f(_0x39a0bc[_0x04b8('0x18')](0x1f4,_0x15ebfc[_0x04b8('0x19')]));});});};exports[_0x04b8('0x25')]=function(_0x2ca693){var _0x1d7072=this;return new Promise(function(_0x191189,_0x577551){return db[_0x04b8('0x26')][_0x04b8('0x27')]({'raw':_0x2ca693[_0x04b8('0x1e')]?_0x2ca693['options'][_0x04b8('0x28')]===undefined?!![]:![]:!![],'where':_0x2ca693[_0x04b8('0x1e')]?_0x2ca693[_0x04b8('0x1e')][_0x04b8('0x29')]||null:null,'attributes':_0x2ca693[_0x04b8('0x1e')]?_0x2ca693[_0x04b8('0x1e')][_0x04b8('0x1f')]||null:null,'include':_0x2ca693[_0x04b8('0x1e')]?_0x2ca693[_0x04b8('0x1e')][_0x04b8('0x21')]?_[_0x04b8('0x22')](_0x2ca693['options'][_0x04b8('0x21')],function(_0x28f868){return{'model':db[_0x28f868['model']],'as':_0x28f868['as'],'attributes':_0x28f868[_0x04b8('0x1f')],'include':_0x28f868['include']?_['map'](_0x28f868[_0x04b8('0x21')],function(_0x3010c8){return{'model':db[_0x3010c8[_0x04b8('0x23')]],'as':_0x3010c8['as'],'attributes':_0x3010c8[_0x04b8('0x1f')],'include':_0x3010c8[_0x04b8('0x21')]?_[_0x04b8('0x22')](_0x3010c8[_0x04b8('0x21')],function(_0x2513da){return{'model':db[_0x2513da[_0x04b8('0x23')]],'as':_0x2513da['as'],'attributes':_0x2513da[_0x04b8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x04b8('0x24')](function(_0x2e1571){logger[_0x04b8('0x1a')](_0x04b8('0x25'),_0x2ca693);logger[_0x04b8('0x14')]('ShowVoiceQueue',_0x2ca693,JSON[_0x04b8('0x16')](_0x2e1571));_0x191189(_0x2e1571);})[_0x04b8('0x1b')](function(_0x28bd41){logger[_0x04b8('0x18')]('ShowVoiceQueue',_0x28bd41[_0x04b8('0x19')],_0x2ca693);_0x577551(_0x1d7072[_0x04b8('0x18')](0x1f4,_0x28bd41['message']));});});}; \ No newline at end of file +var _0x7570=['model','GetVoiceQueue','ShowVoiceQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','VoiceQueue','findAll','options','where','attributes','limit','map','include'];(function(_0x1b9f0f,_0x3f6372){var _0x21ba67=function(_0x425817){while(--_0x425817){_0x1b9f0f['push'](_0x1b9f0f['shift']());}};_0x21ba67(++_0x3f6372);}(_0x7570,0x1bf));var _0x0757=function(_0x5e568d,_0x4d9882){_0x5e568d=_0x5e568d-0x0;var _0x3916f8=_0x7570[_0x5e568d];return _0x3916f8;};'use strict';var _=require('lodash');var util=require(_0x0757('0x0'));var moment=require(_0x0757('0x1'));var BPromise=require(_0x0757('0x2'));var rs=require(_0x0757('0x3'));var fs=require('fs');var Redis=require(_0x0757('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0757('0x5'));var logger=require(_0x0757('0x6'))('rpc');var config=require(_0x0757('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0757('0x8')]['http']({'port':0x232a});config['redis']=_[_0x0757('0x9')](config[_0x0757('0xa')],{'host':_0x0757('0xb'),'port':0x18eb});var socket=require(_0x0757('0xc'))(new Redis(config[_0x0757('0xa')]));require(_0x0757('0xd'))[_0x0757('0xe')](socket);function respondWithRpcPromise(_0x27478a,_0x1adfb5,_0x3d3e81){return new BPromise(function(_0x319f28,_0x52d616){return client[_0x0757('0xf')](_0x27478a,_0x3d3e81)[_0x0757('0x10')](function(_0x3b4f28){logger[_0x0757('0x11')](_0x0757('0x12'),_0x1adfb5,_0x0757('0x13'));logger[_0x0757('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x1adfb5,'request\x20sent',JSON[_0x0757('0x15')](_0x3b4f28));if(_0x3b4f28[_0x0757('0x16')]){if(_0x3b4f28[_0x0757('0x16')][_0x0757('0x17')]===0x1f4){logger[_0x0757('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x1adfb5,_0x3b4f28[_0x0757('0x16')][_0x0757('0x18')]);return _0x52d616(_0x3b4f28[_0x0757('0x16')]['message']);}logger[_0x0757('0x16')](_0x0757('0x12'),_0x1adfb5,_0x3b4f28[_0x0757('0x16')]['message']);return _0x319f28(_0x3b4f28[_0x0757('0x16')]['message']);}else{logger[_0x0757('0x11')](_0x0757('0x12'),_0x1adfb5,_0x0757('0x13'));_0x319f28(_0x3b4f28['result']['message']);}})[_0x0757('0x19')](function(_0x5b1919){logger[_0x0757('0x16')](_0x0757('0x12'),_0x1adfb5,_0x5b1919);_0x52d616(_0x5b1919);});});}exports['GetVoiceQueue']=function(_0x4fd15d){var _0x2d4464=this;return new Promise(function(_0x2a1094,_0x59deb7){return db[_0x0757('0x1a')][_0x0757('0x1b')]({'raw':_0x4fd15d['options']?_0x4fd15d['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fd15d[_0x0757('0x1c')]?_0x4fd15d[_0x0757('0x1c')][_0x0757('0x1d')]||null:null,'attributes':_0x4fd15d[_0x0757('0x1c')]?_0x4fd15d[_0x0757('0x1c')][_0x0757('0x1e')]||null:null,'limit':_0x4fd15d['options']?_0x4fd15d['options'][_0x0757('0x1f')]||null:null,'include':_0x4fd15d['options']?_0x4fd15d[_0x0757('0x1c')]['include']?_[_0x0757('0x20')](_0x4fd15d[_0x0757('0x1c')][_0x0757('0x21')],function(_0x1decc9){return{'model':db[_0x1decc9[_0x0757('0x22')]],'as':_0x1decc9['as'],'attributes':_0x1decc9[_0x0757('0x1e')],'include':_0x1decc9['include']?_[_0x0757('0x20')](_0x1decc9[_0x0757('0x21')],function(_0x3120cb){return{'model':db[_0x3120cb[_0x0757('0x22')]],'as':_0x3120cb['as'],'attributes':_0x3120cb[_0x0757('0x1e')],'include':_0x3120cb[_0x0757('0x21')]?_[_0x0757('0x20')](_0x3120cb[_0x0757('0x21')],function(_0x242c85){return{'model':db[_0x242c85[_0x0757('0x22')]],'as':_0x242c85['as'],'attributes':_0x242c85[_0x0757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0757('0x10')](function(_0x28e7c5){logger[_0x0757('0x11')](_0x0757('0x23'),_0x4fd15d);logger['debug']('GetVoiceQueue',_0x4fd15d,JSON['stringify'](_0x28e7c5));_0x2a1094(_0x28e7c5);})[_0x0757('0x19')](function(_0x1cf6ab){logger[_0x0757('0x16')](_0x0757('0x23'),_0x1cf6ab[_0x0757('0x18')],_0x4fd15d);_0x59deb7(_0x2d4464[_0x0757('0x16')](0x1f4,_0x1cf6ab[_0x0757('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x4aa250){var _0x1d07e2=this;return new Promise(function(_0x20f0f0,_0x554a63){return db[_0x0757('0x1a')]['find']({'raw':_0x4aa250[_0x0757('0x1c')]?_0x4aa250[_0x0757('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x4aa250[_0x0757('0x1c')]?_0x4aa250[_0x0757('0x1c')][_0x0757('0x1d')]||null:null,'attributes':_0x4aa250[_0x0757('0x1c')]?_0x4aa250[_0x0757('0x1c')][_0x0757('0x1e')]||null:null,'include':_0x4aa250[_0x0757('0x1c')]?_0x4aa250['options'][_0x0757('0x21')]?_['map'](_0x4aa250[_0x0757('0x1c')][_0x0757('0x21')],function(_0x408dfa){return{'model':db[_0x408dfa[_0x0757('0x22')]],'as':_0x408dfa['as'],'attributes':_0x408dfa[_0x0757('0x1e')],'include':_0x408dfa[_0x0757('0x21')]?_[_0x0757('0x20')](_0x408dfa['include'],function(_0x31d0fe){return{'model':db[_0x31d0fe[_0x0757('0x22')]],'as':_0x31d0fe['as'],'attributes':_0x31d0fe[_0x0757('0x1e')],'include':_0x31d0fe[_0x0757('0x21')]?_[_0x0757('0x20')](_0x31d0fe['include'],function(_0x96d0ae){return{'model':db[_0x96d0ae['model']],'as':_0x96d0ae['as'],'attributes':_0x96d0ae[_0x0757('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0757('0x10')](function(_0x25e9a4){logger[_0x0757('0x11')](_0x0757('0x24'),_0x4aa250);logger[_0x0757('0x14')](_0x0757('0x24'),_0x4aa250,JSON[_0x0757('0x15')](_0x25e9a4));_0x20f0f0(_0x25e9a4);})[_0x0757('0x19')](function(_0xf856d1){logger[_0x0757('0x16')](_0x0757('0x24'),_0xf856d1['message'],_0x4aa250);_0x554a63(_0x1d07e2['error'](0x1f4,_0xf856d1['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e085ee8..8c9aae4 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 _0xaea5=['remove','update','emit','removeListener','register','length','voiceQueue:','save'];(function(_0x53c58e,_0x588716){var _0x46b113=function(_0x45b299){while(--_0x45b299){_0x53c58e['push'](_0x53c58e['shift']());}};_0x46b113(++_0x588716);}(_0xaea5,0x1bf));var _0x5aea=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xaea5[_0x2b4411];return _0x8e41ef;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x5aea('0x0'),_0x5aea('0x1'),_0x5aea('0x2')];function createListener(_0x52ef4b,_0x189b89){return function(_0x1ef2af){_0x189b89[_0x5aea('0x3')](_0x52ef4b,_0x1ef2af);};}function removeListener(_0x2f5659,_0x149e06){return function(){VoiceQueueEvents[_0x5aea('0x4')](_0x2f5659,_0x149e06);};}exports[_0x5aea('0x5')]=function(_0x5e8950){for(var _0x5b7941=0x0,_0x9da6c8=events[_0x5aea('0x6')];_0x5b7941<_0x9da6c8;_0x5b7941++){var _0x2e3656=events[_0x5b7941];var _0x1f7427=createListener(_0x5aea('0x7')+_0x2e3656,_0x5e8950);VoiceQueueEvents['on'](_0x2e3656,_0x1f7427);}}; \ No newline at end of file +var _0x376c=['length','./voiceQueue.events','save','remove','removeListener','register'];(function(_0xadd417,_0x207028){var _0x5c79e7=function(_0xa07df0){while(--_0xa07df0){_0xadd417['push'](_0xadd417['shift']());}};_0x5c79e7(++_0x207028);}(_0x376c,0xdf));var _0xc376=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x376c[_0x51020b];return _0x371e47;};'use strict';var VoiceQueueEvents=require(_0xc376('0x0'));var events=[_0xc376('0x1'),_0xc376('0x2'),'update'];function createListener(_0x36fa44,_0x288b9d){return function(_0x5aa428){_0x288b9d['emit'](_0x36fa44,_0x5aa428);};}function removeListener(_0x192d8c,_0x38ef53){return function(){VoiceQueueEvents[_0xc376('0x3')](_0x192d8c,_0x38ef53);};}exports[_0xc376('0x4')]=function(_0xa0fb0b){for(var _0x59f4fc=0x0,_0x4397ce=events[_0xc376('0x5')];_0x59f4fc<_0x4397ce;_0x59f4fc++){var _0x46d0bb=events[_0x59f4fc];var _0x212e54=createListener('voiceQueue:'+_0x46d0bb,_0xa0fb0b);VoiceQueueEvents['on'](_0x46d0bb,_0x212e54);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 2431237..7aa660d 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 _0x43d5=['../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1d1963,_0x32cc0e){var _0x3f58bb=function(_0x514823){while(--_0x514823){_0x1d1963['push'](_0x1d1963['shift']());}};_0x3f58bb(++_0x32cc0e);}(_0x43d5,0xe9));var _0x543d=function(_0x36d05c,_0x1cb82f){_0x36d05c=_0x36d05c-0x0;var _0x35773c=_0x43d5[_0x36d05c];return _0x35773c;};'use strict';var multer=require(_0x543d('0x0'));var util=require(_0x543d('0x1'));var path=require(_0x543d('0x2'));var timeout=require(_0x543d('0x3'));var express=require(_0x543d('0x4'));var router=express[_0x543d('0x5')]();var fs_extra=require(_0x543d('0x6'));var auth=require(_0x543d('0x7'));var interaction=require(_0x543d('0x8'));var config=require('../../config/environment');var controller=require(_0x543d('0x9'));router[_0x543d('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x543d('0xa')](_0x543d('0xb'),auth[_0x543d('0xc')](),controller[_0x543d('0xd')]);router[_0x543d('0xa')]('/index',auth[_0x543d('0xc')](),controller[_0x543d('0xe')]);router['get'](_0x543d('0xf'),auth[_0x543d('0xc')](),controller[_0x543d('0x10')]);router[_0x543d('0x11')]('/',auth[_0x543d('0xc')](),controller[_0x543d('0x12')]);router[_0x543d('0x13')](_0x543d('0xf'),auth[_0x543d('0xc')](),controller[_0x543d('0x14')]);router[_0x543d('0x15')]('/:id',auth[_0x543d('0xc')](),controller[_0x543d('0x16')]);module[_0x543d('0x17')]=router; \ No newline at end of file +var _0x6645=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','put','update','delete','destroy'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x6645,0x7f));var _0x5664=function(_0x499894,_0x2ab76f){_0x499894=_0x499894-0x0;var _0x5c2b2c=_0x6645[_0x499894];return _0x5c2b2c;};'use strict';var multer=require(_0x5664('0x0'));var util=require('util');var path=require(_0x5664('0x1'));var timeout=require('connect-timeout');var express=require(_0x5664('0x2'));var router=express[_0x5664('0x3')]();var fs_extra=require(_0x5664('0x4'));var auth=require(_0x5664('0x5'));var interaction=require(_0x5664('0x6'));var config=require('../../config/environment');var controller=require(_0x5664('0x7'));router[_0x5664('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x5664('0x9')](),controller[_0x5664('0xa')]);router[_0x5664('0x8')](_0x5664('0xb'),auth[_0x5664('0x9')](),controller[_0x5664('0xc')]);router[_0x5664('0x8')](_0x5664('0xd'),auth['isAuthenticated'](),controller[_0x5664('0xe')]);router[_0x5664('0xf')]('/',auth[_0x5664('0x9')](),controller['create']);router[_0x5664('0x10')]('/:id',auth[_0x5664('0x9')](),controller[_0x5664('0x11')]);router[_0x5664('0x12')](_0x5664('0xd'),auth[_0x5664('0x9')](),controller[_0x5664('0x13')]);module[_0x5664('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 916b6df..057849d 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 _0xc2cd=['diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc2cd,0x135));var _0xdc2c=function(_0x58ede3,_0x32d13e){_0x58ede3=_0x58ede3-0x0;var _0x1bfe06=_0xc2cd[_0x58ede3];return _0x1bfe06;};'use strict';var Sequelize=require(_0xdc2c('0x0'));var moment=require('moment');module[_0xdc2c('0x1')]={'type':{'type':Sequelize[_0xdc2c('0x2')]},'uniqueid':{'type':Sequelize[_0xdc2c('0x2')]},'calleridnum':{'type':Sequelize[_0xdc2c('0x2')]},'calleridname':{'type':Sequelize[_0xdc2c('0x2')]},'queue':{'type':Sequelize[_0xdc2c('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xdc2c('0x3')],'set':function(_0x1f42d3){var _0x2a9bf4=moment(_0x1f42d3);var _0x1ca58b=moment(this[_0xdc2c('0x4')](_0xdc2c('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3b225d=_0x2a9bf4[_0xdc2c('0x6')](_0x1ca58b,_0xdc2c('0x7'));this[_0xdc2c('0x8')](_0xdc2c('0x9'),_0x1f42d3);this[_0xdc2c('0x8')](_0xdc2c('0xa'),_0x3b225d||null);}},'position':{'type':Sequelize[_0xdc2c('0xb')]},'count':{'type':Sequelize[_0xdc2c('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xdc2c('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xdc2c('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xdc2c('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xdc2c('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xdc2c('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xdc2c('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xdc2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdc2c('0x2')]},'connectedlinename':{'type':Sequelize[_0xdc2c('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdc2c('0x2')]},'exten':{'type':Sequelize[_0xdc2c('0x2')]},'priority':{'type':Sequelize[_0xdc2c('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xdc2c('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xdc2c('0x2')]},'transfer':{'type':Sequelize[_0xdc2c('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdc2c('0x2')],'comment':_0xdc2c('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xdc2c('0x2')]},'disposition':{'type':Sequelize[_0xdc2c('0x2')]},'secondDisposition':{'type':Sequelize[_0xdc2c('0x2')]},'thirdDisposition':{'type':Sequelize[_0xdc2c('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xdc2c('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0xdc2c('0x2')]}}; \ No newline at end of file +var _0x41b2=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','format','diff','setDataValue','INTEGER','BOOLEAN'];(function(_0x3fce17,_0x23b9cd){var _0x3e9696=function(_0x5d9977){while(--_0x5d9977){_0x3fce17['push'](_0x3fce17['shift']());}};_0x3e9696(++_0x23b9cd);}(_0x41b2,0xc2));var _0x241b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x241b('0x0'));var moment=require(_0x241b('0x1'));module[_0x241b('0x2')]={'type':{'type':Sequelize[_0x241b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x241b('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x241b('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2420d5){var _0x5cb07e=moment(_0x2420d5);var _0x5ddc62=moment(this['getDataValue']('queuecallerjoinAt'))[_0x241b('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2f0e31=_0x5cb07e[_0x241b('0x6')](_0x5ddc62,'seconds');this[_0x241b('0x7')]('queuecallerleaveAt',_0x2420d5);this['setDataValue']('holdtime',_0x2f0e31||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x241b('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x241b('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x241b('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x241b('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x241b('0x4')]},'queuecallerexit':{'type':Sequelize[_0x241b('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x241b('0x3')],'comment':_0x241b('0xa')},'originalposition':{'type':Sequelize[_0x241b('0x8')]},'channel':{'type':Sequelize[_0x241b('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x241b('0x3')]},'accountcode':{'type':Sequelize[_0x241b('0x3')]},'context':{'type':Sequelize[_0x241b('0x3')]},'exten':{'type':Sequelize[_0x241b('0x3')]},'priority':{'type':Sequelize[_0x241b('0x3')]},'holdtime':{'type':Sequelize[_0x241b('0x8')]},'mohtime':{'type':Sequelize[_0x241b('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x241b('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x241b('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x241b('0xb')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x241b('0x3')]},'secondDisposition':{'type':Sequelize[_0x241b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x241b('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x241b('0x8')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 3f2c5e0..fc021f4 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 _0x59b3=['includeAll','find','create','body','describe','getVoiceQueuesReport','length','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','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','destroy','then','error','stack','name','VoiceQueueReport','rawAttributes','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params'];(function(_0x567483,_0x16dcc3){var _0x1d714d=function(_0x31aed0){while(--_0x31aed0){_0x567483['push'](_0x567483['shift']());}};_0x1d714d(++_0x16dcc3);}(_0x59b3,0xa9));var _0x359b=function(_0xc8a692,_0x579320){_0xc8a692=_0xc8a692-0x0;var _0x5055d8=_0x59b3[_0xc8a692];return _0x5055d8;};'use strict';var emlformat=require(_0x359b('0x0'));var rimraf=require(_0x359b('0x1'));var zipdir=require(_0x359b('0x2'));var jsonpatch=require(_0x359b('0x3'));var rp=require(_0x359b('0x4'));var moment=require(_0x359b('0x5'));var BPromise=require(_0x359b('0x6'));var Mustache=require(_0x359b('0x7'));var util=require(_0x359b('0x8'));var path=require(_0x359b('0x9'));var sox=require(_0x359b('0xa'));var csv=require(_0x359b('0xb'));var ejs=require(_0x359b('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359b('0xd'));var squel=require('squel');var crypto=require(_0x359b('0xe'));var jsforce=require(_0x359b('0xf'));var deskjs=require(_0x359b('0x10'));var toCsv=require(_0x359b('0xb'));var querystring=require('querystring');var Papa=require(_0x359b('0x11'));var Redis=require(_0x359b('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x359b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x359b('0x14'))(_0x359b('0x15'));var utils=require(_0x359b('0x16'));var config=require(_0x359b('0x17'));var licenseUtil=require(_0x359b('0x18'));var db=require(_0x359b('0x19'))['db'];config['redis']=_['defaults'](config[_0x359b('0x1a')],{'host':_0x359b('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x359b('0x1a')]));require(_0x359b('0x1c'))[_0x359b('0x1d')](socket);function respondWithStatusCode(_0x5f46cf,_0x58e418){_0x58e418=_0x58e418||0xcc;return function(_0x19c14d){if(_0x19c14d){return _0x5f46cf[_0x359b('0x1e')](_0x58e418);}return _0x5f46cf[_0x359b('0x1f')](_0x58e418)[_0x359b('0x20')]();};}function respondWithResult(_0x321769,_0x52f067){_0x52f067=_0x52f067||0xc8;return function(_0x32c6bd){if(_0x32c6bd){return _0x321769['status'](_0x52f067)[_0x359b('0x21')](_0x32c6bd);}};}function respondWithFilteredResult(_0x97bf7a,_0x4a1d8f){return function(_0x5ea31e){if(_0x5ea31e){var _0x198071=typeof _0x4a1d8f['offset']===_0x359b('0x22')&&typeof _0x4a1d8f['limit']==='undefined';var _0x41e8ee=_0x5ea31e[_0x359b('0x23')];var _0x1cb463=_0x198071?0x0:_0x4a1d8f[_0x359b('0x24')];var _0x384d2d=_0x198071?_0x5ea31e[_0x359b('0x23')]:_0x4a1d8f[_0x359b('0x24')]+_0x4a1d8f[_0x359b('0x25')];var _0x5265a6;if(_0x384d2d>=_0x41e8ee){_0x384d2d=_0x41e8ee;_0x5265a6=0xc8;}else{_0x5265a6=0xce;}_0x97bf7a['status'](_0x5265a6);return _0x97bf7a['set'](_0x359b('0x26'),_0x1cb463+'-'+_0x384d2d+'/'+_0x41e8ee)[_0x359b('0x21')](_0x5ea31e);}return null;};}function patchUpdates(_0x296adc){return function(_0x152f22){try{jsonpatch[_0x359b('0x27')](_0x152f22,_0x296adc,!![]);}catch(_0x2f0075){return BPromise[_0x359b('0x28')](_0x2f0075);}return _0x152f22[_0x359b('0x29')]();};}function saveUpdates(_0x17e639,_0x6830b3){return function(_0x21223b){if(_0x21223b){return _0x21223b['update'](_0x17e639)['then'](function(_0x28a85e){return _0x28a85e;});}return null;};}function removeEntity(_0x32b810,_0x4668aa){return function(_0x89bab9){if(_0x89bab9){return _0x89bab9[_0x359b('0x2a')]()[_0x359b('0x2b')](function(){_0x32b810[_0x359b('0x1f')](0xcc)[_0x359b('0x20')]();});}};}function handleEntityNotFound(_0x516c6f,_0x88364f){return function(_0x2223d2){if(!_0x2223d2){_0x516c6f[_0x359b('0x1e')](0x194);}return _0x2223d2;};}function handleError(_0xe745b,_0x32167d){_0x32167d=_0x32167d||0x1f4;return function(_0x14b42a){logger[_0x359b('0x2c')](_0x14b42a[_0x359b('0x2d')]);if(_0x14b42a[_0x359b('0x2e')]){delete _0x14b42a[_0x359b('0x2e')];}_0xe745b['status'](_0x32167d)['send'](_0x14b42a);};}exports['index']=function(_0xee43d9,_0x17aa10){var _0x446e61={},_0x12fd5c={},_0x883c46={'count':0x0,'rows':[]};var _0x4aad58=_['map'](db[_0x359b('0x2f')][_0x359b('0x30')],function(_0xe752ee){return{'name':_0xe752ee['fieldName'],'type':_0xe752ee[_0x359b('0x31')][_0x359b('0x32')]};});_0x12fd5c[_0x359b('0x33')]=_[_0x359b('0x34')](_0x4aad58,'name');_0x12fd5c[_0x359b('0x35')]=_[_0x359b('0x36')](_0xee43d9['query']);_0x12fd5c['filters']=_[_0x359b('0x37')](_0x12fd5c[_0x359b('0x33')],_0x12fd5c[_0x359b('0x35')]);_0x446e61['attributes']=_[_0x359b('0x37')](_0x12fd5c[_0x359b('0x33')],qs[_0x359b('0x38')](_0xee43d9[_0x359b('0x35')]['fields']));_0x446e61[_0x359b('0x39')]=_0x446e61[_0x359b('0x39')]['length']?_0x446e61[_0x359b('0x39')]:_0x12fd5c[_0x359b('0x33')];if(!_0xee43d9[_0x359b('0x35')][_0x359b('0x3a')](_0x359b('0x3b'))){_0x446e61[_0x359b('0x25')]=qs['limit'](_0xee43d9[_0x359b('0x35')][_0x359b('0x25')]);_0x446e61['offset']=qs[_0x359b('0x24')](_0xee43d9[_0x359b('0x35')][_0x359b('0x24')]);}_0x446e61[_0x359b('0x3c')]=qs[_0x359b('0x3d')](_0xee43d9[_0x359b('0x35')][_0x359b('0x3d')]);_0x446e61[_0x359b('0x3e')]=qs[_0x359b('0x3f')](_[_0x359b('0x40')](_0xee43d9[_0x359b('0x35')],_0x12fd5c[_0x359b('0x3f')]),_0x4aad58);if(_0xee43d9[_0x359b('0x35')][_0x359b('0x41')]){_0x446e61['where']=_[_0x359b('0x42')](_0x446e61[_0x359b('0x3e')],{'$or':_['map'](_0x4aad58,function(_0xa71193){if(_0xa71193[_0x359b('0x31')]!==_0x359b('0x43')){var _0xe6c452={};_0xe6c452[_0xa71193['name']]={'$like':'%'+_0xee43d9[_0x359b('0x35')][_0x359b('0x41')]+'%'};return _0xe6c452;}})});}_0x446e61=_[_0x359b('0x42')]({},_0x446e61,_0xee43d9[_0x359b('0x44')]);var _0x23f2f5={'where':_0x446e61['where']};return db[_0x359b('0x2f')][_0x359b('0x23')](_0x23f2f5)[_0x359b('0x2b')](function(_0x2a4737){_0x883c46[_0x359b('0x23')]=_0x2a4737;if(_0xee43d9[_0x359b('0x35')]['includeAll']){_0x446e61[_0x359b('0x45')]=[{'all':!![]}];}return db[_0x359b('0x2f')][_0x359b('0x46')](_0x446e61);})[_0x359b('0x2b')](function(_0xcd2a8){_0x883c46[_0x359b('0x47')]=_0xcd2a8;return _0x883c46;})[_0x359b('0x2b')](respondWithFilteredResult(_0x17aa10,_0x446e61))[_0x359b('0x48')](handleError(_0x17aa10,null));};exports['show']=function(_0x4557d9,_0x173edb){var _0x10bf4c={'raw':![],'where':{'id':_0x4557d9[_0x359b('0x49')]['id']}},_0x2ab52c={};_0x2ab52c[_0x359b('0x33')]=_[_0x359b('0x36')](db[_0x359b('0x2f')][_0x359b('0x30')]);_0x2ab52c[_0x359b('0x35')]=_[_0x359b('0x36')](_0x4557d9[_0x359b('0x35')]);_0x2ab52c[_0x359b('0x3f')]=_[_0x359b('0x37')](_0x2ab52c[_0x359b('0x33')],_0x2ab52c[_0x359b('0x35')]);_0x10bf4c[_0x359b('0x39')]=_[_0x359b('0x37')](_0x2ab52c[_0x359b('0x33')],qs[_0x359b('0x38')](_0x4557d9['query']['fields']));_0x10bf4c[_0x359b('0x39')]=_0x10bf4c[_0x359b('0x39')]['length']?_0x10bf4c[_0x359b('0x39')]:_0x2ab52c[_0x359b('0x33')];if(_0x4557d9[_0x359b('0x35')][_0x359b('0x4a')]){_0x10bf4c[_0x359b('0x45')]=[{'all':!![]}];}_0x10bf4c=_[_0x359b('0x42')]({},_0x10bf4c,_0x4557d9[_0x359b('0x44')]);return db[_0x359b('0x2f')][_0x359b('0x4b')](_0x10bf4c)['then'](handleEntityNotFound(_0x173edb,null))[_0x359b('0x2b')](respondWithResult(_0x173edb,null))['catch'](handleError(_0x173edb,null));};exports['create']=function(_0x1c2986,_0x5f4575){return db[_0x359b('0x2f')][_0x359b('0x4c')](_0x1c2986[_0x359b('0x4d')],{})[_0x359b('0x2b')](respondWithResult(_0x5f4575,0xc9))[_0x359b('0x48')](handleError(_0x5f4575,null));};exports['update']=function(_0x42c69e,_0x11afb0){if(_0x42c69e[_0x359b('0x4d')]['id']){delete _0x42c69e[_0x359b('0x4d')]['id'];}return db[_0x359b('0x2f')]['find']({'where':{'id':_0x42c69e['params']['id']}})['then'](handleEntityNotFound(_0x11afb0,null))[_0x359b('0x2b')](saveUpdates(_0x42c69e['body'],null))['then'](respondWithResult(_0x11afb0,null))['catch'](handleError(_0x11afb0,null));};exports[_0x359b('0x2a')]=function(_0x18b2f9,_0x55d35c){return db[_0x359b('0x2f')][_0x359b('0x4b')]({'where':{'id':_0x18b2f9['params']['id']}})[_0x359b('0x2b')](handleEntityNotFound(_0x55d35c,null))[_0x359b('0x2b')](removeEntity(_0x55d35c,null))['catch'](handleError(_0x55d35c,null));};exports[_0x359b('0x4e')]=function(_0x3b566a,_0x5ba6dd){return db[_0x359b('0x2f')][_0x359b('0x4e')]()[_0x359b('0x2b')](respondWithResult(_0x5ba6dd,null))[_0x359b('0x48')](handleError(_0x5ba6dd,null));};exports[_0x359b('0x4f')]=function(_0x298ddc,_0x10f860){var _0x1a1b1a={},_0x1a74a3={},_0x472399={'count':0x0,'rows':[]};_0x1a74a3['model']=_['keys'](db[_0x359b('0x2f')]['rawAttributes']);_0x1a74a3['query']=_[_0x359b('0x36')](_0x298ddc[_0x359b('0x35')]);_0x1a74a3[_0x359b('0x3f')]=_[_0x359b('0x37')](_0x1a74a3[_0x359b('0x33')],_0x1a74a3[_0x359b('0x35')]);_0x1a1b1a[_0x359b('0x39')]=_[_0x359b('0x37')](_0x1a74a3['model'],qs[_0x359b('0x38')](_0x298ddc[_0x359b('0x35')][_0x359b('0x38')]));_0x1a1b1a[_0x359b('0x39')]=_0x1a1b1a[_0x359b('0x39')][_0x359b('0x50')]?_0x1a1b1a[_0x359b('0x39')]:_0x1a74a3['model'];if(!_0x298ddc[_0x359b('0x35')][_0x359b('0x3a')](_0x359b('0x3b'))){_0x1a1b1a[_0x359b('0x25')]=qs[_0x359b('0x25')](_0x298ddc[_0x359b('0x35')][_0x359b('0x25')]);_0x1a1b1a[_0x359b('0x24')]=qs[_0x359b('0x24')](_0x298ddc[_0x359b('0x35')][_0x359b('0x24')]);}_0x1a1b1a['order']=qs[_0x359b('0x3d')](_0x298ddc['query'][_0x359b('0x3d')]);_0x1a1b1a[_0x359b('0x3e')]=qs[_0x359b('0x3f')](_[_0x359b('0x40')](_0x298ddc['query'],_0x1a74a3[_0x359b('0x3f')]));if(_0x298ddc[_0x359b('0x35')][_0x359b('0x41')]){_0x1a1b1a[_0x359b('0x3e')]=_['merge'](_0x1a1b1a['where'],{'$or':_[_0x359b('0x34')](_0x1a1b1a[_0x359b('0x39')],function(_0x46694e){var _0x3e26e1={};_0x3e26e1[_0x46694e]={'$like':'%'+_0x298ddc['query']['filter']+'%'};return _0x3e26e1;})});}_0x1a1b1a=_[_0x359b('0x42')]({},_0x1a1b1a,_0x298ddc[_0x359b('0x44')]);var _0x39d442={'where':_0x1a1b1a[_0x359b('0x3e')]};return db[_0x359b('0x2f')][_0x359b('0x23')](_0x39d442)['then'](function(_0x1c88b1){_0x472399[_0x359b('0x23')]=_0x1c88b1;if(_0x298ddc['query'][_0x359b('0x4a')]){_0x1a1b1a[_0x359b('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x1a1b1a);})['then'](function(_0xd4cdb5){_0x472399['rows']=_0xd4cdb5;return _0x472399;})[_0x359b('0x2b')](respondWithFilteredResult(_0x10f860,_0x1a1b1a,'getVoiceQueuesReport'))[_0x359b('0x48')](handleError(_0x10f860,null,_0x359b('0x4f')));}; \ No newline at end of file +var _0xb3fd=['find','create','body','describe','order','where','rows','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','merge','filter','options','includeAll','findAll','catch','show','params','length','include'];(function(_0x52515e,_0x19436c){var _0x3ea31a=function(_0x3c8b99){while(--_0x3c8b99){_0x52515e['push'](_0x52515e['shift']());}};_0x3ea31a(++_0x19436c);}(_0xb3fd,0xfb));var _0xdb3f=function(_0x15dc90,_0x151449){_0x15dc90=_0x15dc90-0x0;var _0x199c39=_0xb3fd[_0x15dc90];return _0x199c39;};'use strict';var emlformat=require(_0xdb3f('0x0'));var rimraf=require(_0xdb3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb3f('0x2'));var rp=require(_0xdb3f('0x3'));var moment=require(_0xdb3f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdb3f('0x5'));var sox=require(_0xdb3f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb3f('0x7'));var squel=require(_0xdb3f('0x8'));var crypto=require(_0xdb3f('0x9'));var jsforce=require(_0xdb3f('0xa'));var deskjs=require(_0xdb3f('0xb'));var toCsv=require(_0xdb3f('0xc'));var querystring=require(_0xdb3f('0xd'));var Papa=require('papaparse');var Redis=require(_0xdb3f('0xe'));var authService=require(_0xdb3f('0xf'));var qs=require(_0xdb3f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb3f('0x11'));var logger=require(_0xdb3f('0x12'))(_0xdb3f('0x13'));var utils=require(_0xdb3f('0x14'));var config=require(_0xdb3f('0x15'));var licenseUtil=require(_0xdb3f('0x16'));var db=require(_0xdb3f('0x17'))['db'];config[_0xdb3f('0x18')]=_['defaults'](config[_0xdb3f('0x18')],{'host':_0xdb3f('0x19'),'port':0x18eb});var socket=require(_0xdb3f('0x1a'))(new Redis(config[_0xdb3f('0x18')]));require(_0xdb3f('0x1b'))['register'](socket);function respondWithStatusCode(_0x207194,_0x548999){_0x548999=_0x548999||0xcc;return function(_0x4b3f89){if(_0x4b3f89){return _0x207194[_0xdb3f('0x1c')](_0x548999);}return _0x207194[_0xdb3f('0x1d')](_0x548999)[_0xdb3f('0x1e')]();};}function respondWithResult(_0x1f4905,_0x33d45d){_0x33d45d=_0x33d45d||0xc8;return function(_0x2b00f2){if(_0x2b00f2){return _0x1f4905[_0xdb3f('0x1d')](_0x33d45d)[_0xdb3f('0x1f')](_0x2b00f2);}};}function respondWithFilteredResult(_0x4124db,_0x450a8d){return function(_0x35fecc){if(_0x35fecc){var _0x4c257f=typeof _0x450a8d[_0xdb3f('0x20')]==='undefined'&&typeof _0x450a8d[_0xdb3f('0x21')]===_0xdb3f('0x22');var _0x1f0f84=_0x35fecc[_0xdb3f('0x23')];var _0x496e38=_0x4c257f?0x0:_0x450a8d['offset'];var _0x5a3bde=_0x4c257f?_0x35fecc[_0xdb3f('0x23')]:_0x450a8d['offset']+_0x450a8d[_0xdb3f('0x21')];var _0x5c923c;if(_0x5a3bde>=_0x1f0f84){_0x5a3bde=_0x1f0f84;_0x5c923c=0xc8;}else{_0x5c923c=0xce;}_0x4124db[_0xdb3f('0x1d')](_0x5c923c);return _0x4124db[_0xdb3f('0x24')](_0xdb3f('0x25'),_0x496e38+'-'+_0x5a3bde+'/'+_0x1f0f84)[_0xdb3f('0x1f')](_0x35fecc);}return null;};}function patchUpdates(_0xeb097d){return function(_0x3da80b){try{jsonpatch[_0xdb3f('0x26')](_0x3da80b,_0xeb097d,!![]);}catch(_0x3eeba8){return BPromise['reject'](_0x3eeba8);}return _0x3da80b['save']();};}function saveUpdates(_0x105fb5,_0xaf528e){return function(_0x377738){if(_0x377738){return _0x377738[_0xdb3f('0x27')](_0x105fb5)['then'](function(_0x5f7413){return _0x5f7413;});}return null;};}function removeEntity(_0x595002,_0x3740ee){return function(_0x53e096){if(_0x53e096){return _0x53e096[_0xdb3f('0x28')]()[_0xdb3f('0x29')](function(){_0x595002[_0xdb3f('0x1d')](0xcc)[_0xdb3f('0x1e')]();});}};}function handleEntityNotFound(_0x1d8961,_0x4f8073){return function(_0x4c819c){if(!_0x4c819c){_0x1d8961[_0xdb3f('0x1c')](0x194);}return _0x4c819c;};}function handleError(_0x1ab455,_0x45ead4){_0x45ead4=_0x45ead4||0x1f4;return function(_0x4ef109){logger['error'](_0x4ef109[_0xdb3f('0x2a')]);if(_0x4ef109[_0xdb3f('0x2b')]){delete _0x4ef109[_0xdb3f('0x2b')];}_0x1ab455['status'](_0x45ead4)[_0xdb3f('0x2c')](_0x4ef109);};}exports[_0xdb3f('0x2d')]=function(_0x2564f8,_0x5725e5){var _0x3d928b={},_0x1b9fe1={},_0x31cc4e={'count':0x0,'rows':[]};var _0x2d7389=_[_0xdb3f('0x2e')](db[_0xdb3f('0x2f')][_0xdb3f('0x30')],function(_0x3e1258){return{'name':_0x3e1258[_0xdb3f('0x31')],'type':_0x3e1258[_0xdb3f('0x32')][_0xdb3f('0x33')]};});_0x1b9fe1[_0xdb3f('0x34')]=_['map'](_0x2d7389,'name');_0x1b9fe1['query']=_[_0xdb3f('0x35')](_0x2564f8[_0xdb3f('0x36')]);_0x1b9fe1[_0xdb3f('0x37')]=_['intersection'](_0x1b9fe1['model'],_0x1b9fe1['query']);_0x3d928b[_0xdb3f('0x38')]=_[_0xdb3f('0x39')](_0x1b9fe1[_0xdb3f('0x34')],qs['fields'](_0x2564f8['query'][_0xdb3f('0x3a')]));_0x3d928b[_0xdb3f('0x38')]=_0x3d928b[_0xdb3f('0x38')]['length']?_0x3d928b[_0xdb3f('0x38')]:_0x1b9fe1[_0xdb3f('0x34')];if(!_0x2564f8[_0xdb3f('0x36')][_0xdb3f('0x3b')](_0xdb3f('0x3c'))){_0x3d928b[_0xdb3f('0x21')]=qs[_0xdb3f('0x21')](_0x2564f8[_0xdb3f('0x36')][_0xdb3f('0x21')]);_0x3d928b[_0xdb3f('0x20')]=qs[_0xdb3f('0x20')](_0x2564f8[_0xdb3f('0x36')][_0xdb3f('0x20')]);}_0x3d928b['order']=qs['sort'](_0x2564f8['query'][_0xdb3f('0x3d')]);_0x3d928b['where']=qs[_0xdb3f('0x37')](_[_0xdb3f('0x3e')](_0x2564f8['query'],_0x1b9fe1[_0xdb3f('0x37')]),_0x2d7389);if(_0x2564f8['query']['filter']){_0x3d928b['where']=_[_0xdb3f('0x3f')](_0x3d928b['where'],{'$or':_[_0xdb3f('0x2e')](_0x2d7389,function(_0xce01c4){if(_0xce01c4[_0xdb3f('0x32')]!=='VIRTUAL'){var _0x162a0a={};_0x162a0a[_0xce01c4['name']]={'$like':'%'+_0x2564f8[_0xdb3f('0x36')][_0xdb3f('0x40')]+'%'};return _0x162a0a;}})});}_0x3d928b=_[_0xdb3f('0x3f')]({},_0x3d928b,_0x2564f8[_0xdb3f('0x41')]);var _0x39b23c={'where':_0x3d928b['where']};return db[_0xdb3f('0x2f')][_0xdb3f('0x23')](_0x39b23c)[_0xdb3f('0x29')](function(_0x184d27){_0x31cc4e[_0xdb3f('0x23')]=_0x184d27;if(_0x2564f8[_0xdb3f('0x36')][_0xdb3f('0x42')]){_0x3d928b['include']=[{'all':!![]}];}return db[_0xdb3f('0x2f')][_0xdb3f('0x43')](_0x3d928b);})[_0xdb3f('0x29')](function(_0x26d958){_0x31cc4e['rows']=_0x26d958;return _0x31cc4e;})[_0xdb3f('0x29')](respondWithFilteredResult(_0x5725e5,_0x3d928b))[_0xdb3f('0x44')](handleError(_0x5725e5,null));};exports[_0xdb3f('0x45')]=function(_0x4b690c,_0x186257){var _0x3356be={'raw':![],'where':{'id':_0x4b690c[_0xdb3f('0x46')]['id']}},_0x3a8307={};_0x3a8307[_0xdb3f('0x34')]=_[_0xdb3f('0x35')](db['VoiceQueueReport'][_0xdb3f('0x30')]);_0x3a8307[_0xdb3f('0x36')]=_['keys'](_0x4b690c[_0xdb3f('0x36')]);_0x3a8307['filters']=_[_0xdb3f('0x39')](_0x3a8307[_0xdb3f('0x34')],_0x3a8307[_0xdb3f('0x36')]);_0x3356be[_0xdb3f('0x38')]=_[_0xdb3f('0x39')](_0x3a8307[_0xdb3f('0x34')],qs[_0xdb3f('0x3a')](_0x4b690c['query'][_0xdb3f('0x3a')]));_0x3356be['attributes']=_0x3356be[_0xdb3f('0x38')][_0xdb3f('0x47')]?_0x3356be[_0xdb3f('0x38')]:_0x3a8307['model'];if(_0x4b690c[_0xdb3f('0x36')][_0xdb3f('0x42')]){_0x3356be[_0xdb3f('0x48')]=[{'all':!![]}];}_0x3356be=_[_0xdb3f('0x3f')]({},_0x3356be,_0x4b690c['options']);return db[_0xdb3f('0x2f')][_0xdb3f('0x49')](_0x3356be)[_0xdb3f('0x29')](handleEntityNotFound(_0x186257,null))[_0xdb3f('0x29')](respondWithResult(_0x186257,null))[_0xdb3f('0x44')](handleError(_0x186257,null));};exports[_0xdb3f('0x4a')]=function(_0x5a7957,_0x3f0ce5){return db[_0xdb3f('0x2f')][_0xdb3f('0x4a')](_0x5a7957[_0xdb3f('0x4b')],{})['then'](respondWithResult(_0x3f0ce5,0xc9))[_0xdb3f('0x44')](handleError(_0x3f0ce5,null));};exports[_0xdb3f('0x27')]=function(_0x27616e,_0x40810d){if(_0x27616e[_0xdb3f('0x4b')]['id']){delete _0x27616e[_0xdb3f('0x4b')]['id'];}return db[_0xdb3f('0x2f')][_0xdb3f('0x49')]({'where':{'id':_0x27616e[_0xdb3f('0x46')]['id']}})['then'](handleEntityNotFound(_0x40810d,null))[_0xdb3f('0x29')](saveUpdates(_0x27616e['body'],null))[_0xdb3f('0x29')](respondWithResult(_0x40810d,null))[_0xdb3f('0x44')](handleError(_0x40810d,null));};exports[_0xdb3f('0x28')]=function(_0x414e97,_0x30ec80){return db[_0xdb3f('0x2f')][_0xdb3f('0x49')]({'where':{'id':_0x414e97[_0xdb3f('0x46')]['id']}})[_0xdb3f('0x29')](handleEntityNotFound(_0x30ec80,null))[_0xdb3f('0x29')](removeEntity(_0x30ec80,null))[_0xdb3f('0x44')](handleError(_0x30ec80,null));};exports[_0xdb3f('0x4c')]=function(_0x57e6a3,_0x3e1453){return db[_0xdb3f('0x2f')][_0xdb3f('0x4c')]()[_0xdb3f('0x29')](respondWithResult(_0x3e1453,null))[_0xdb3f('0x44')](handleError(_0x3e1453,null));};exports['getVoiceQueuesReport']=function(_0xbc372e,_0x2c4d66){var _0x4b1a73={},_0xa55c35={},_0x575f7b={'count':0x0,'rows':[]};_0xa55c35[_0xdb3f('0x34')]=_[_0xdb3f('0x35')](db[_0xdb3f('0x2f')][_0xdb3f('0x30')]);_0xa55c35[_0xdb3f('0x36')]=_[_0xdb3f('0x35')](_0xbc372e[_0xdb3f('0x36')]);_0xa55c35[_0xdb3f('0x37')]=_[_0xdb3f('0x39')](_0xa55c35[_0xdb3f('0x34')],_0xa55c35[_0xdb3f('0x36')]);_0x4b1a73[_0xdb3f('0x38')]=_[_0xdb3f('0x39')](_0xa55c35[_0xdb3f('0x34')],qs['fields'](_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x3a')]));_0x4b1a73[_0xdb3f('0x38')]=_0x4b1a73[_0xdb3f('0x38')]['length']?_0x4b1a73[_0xdb3f('0x38')]:_0xa55c35[_0xdb3f('0x34')];if(!_0xbc372e[_0xdb3f('0x36')]['hasOwnProperty'](_0xdb3f('0x3c'))){_0x4b1a73[_0xdb3f('0x21')]=qs[_0xdb3f('0x21')](_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x21')]);_0x4b1a73['offset']=qs['offset'](_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x20')]);}_0x4b1a73[_0xdb3f('0x4d')]=qs[_0xdb3f('0x3d')](_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x3d')]);_0x4b1a73[_0xdb3f('0x4e')]=qs[_0xdb3f('0x37')](_[_0xdb3f('0x3e')](_0xbc372e[_0xdb3f('0x36')],_0xa55c35['filters']));if(_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x40')]){_0x4b1a73[_0xdb3f('0x4e')]=_[_0xdb3f('0x3f')](_0x4b1a73[_0xdb3f('0x4e')],{'$or':_[_0xdb3f('0x2e')](_0x4b1a73['attributes'],function(_0xe0302){var _0xefd2f={};_0xefd2f[_0xe0302]={'$like':'%'+_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x40')]+'%'};return _0xefd2f;})});}_0x4b1a73=_[_0xdb3f('0x3f')]({},_0x4b1a73,_0xbc372e[_0xdb3f('0x41')]);var _0x515b5a={'where':_0x4b1a73[_0xdb3f('0x4e')]};return db[_0xdb3f('0x2f')][_0xdb3f('0x23')](_0x515b5a)[_0xdb3f('0x29')](function(_0x1e9ece){_0x575f7b[_0xdb3f('0x23')]=_0x1e9ece;if(_0xbc372e[_0xdb3f('0x36')][_0xdb3f('0x42')]){_0x4b1a73[_0xdb3f('0x48')]=[{'all':!![]}];}return db[_0xdb3f('0x2f')]['findAll'](_0x4b1a73);})[_0xdb3f('0x29')](function(_0x2fd89a){_0x575f7b[_0xdb3f('0x4f')]=_0x2fd89a;return _0x575f7b;})[_0xdb3f('0x29')](respondWithFilteredResult(_0x2c4d66,_0x4b1a73,_0xdb3f('0x50')))[_0xdb3f('0x44')](handleError(_0x2c4d66,null,_0xdb3f('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 779bd50..6d85a86 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 _0x5405=['save','emit','exports','setMaxListeners'];(function(_0x59575d,_0x3c389b){var _0x4a6ad4=function(_0x49fe37){while(--_0x49fe37){_0x59575d['push'](_0x59575d['shift']());}};_0x4a6ad4(++_0x3c389b);}(_0x5405,0x1b7));var _0x5540=function(_0x28b163,_0x329551){_0x28b163=_0x28b163-0x0;var _0x8736ed=_0x5405[_0x28b163];return _0x8736ed;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5540('0x0')](0x0);var events={'afterCreate':_0x5540('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e4bb5){return function(_0x383b8e,_0x1a2099,_0x43625b){VoiceQueueReportEvents[_0x5540('0x2')](_0x2e4bb5+':'+_0x383b8e['id'],_0x383b8e);VoiceQueueReportEvents[_0x5540('0x2')](_0x2e4bb5,_0x383b8e);_0x43625b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x5540('0x3')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xf3eb=['emit','hasOwnProperty','hook','events','VoiceQueueReport','setMaxListeners','save','remove'];(function(_0x4c6302,_0x311370){var _0x58bc5c=function(_0x51f64d){while(--_0x51f64d){_0x4c6302['push'](_0x4c6302['shift']());}};_0x58bc5c(++_0x311370);}(_0xf3eb,0x10b));var _0xbf3e=function(_0x558b2b,_0x2cc6f5){_0x558b2b=_0x558b2b-0x0;var _0x449a82=_0xf3eb[_0x558b2b];return _0x449a82;};'use strict';var EventEmitter=require(_0xbf3e('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xbf3e('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbf3e('0x2')](0x0);var events={'afterCreate':_0xbf3e('0x3'),'afterUpdate':'update','afterDestroy':_0xbf3e('0x4')};function emitEvent(_0xc3fa93){return function(_0x581e5f,_0x5779bb,_0x3c1d43){VoiceQueueReportEvents['emit'](_0xc3fa93+':'+_0x581e5f['id'],_0x581e5f);VoiceQueueReportEvents[_0xbf3e('0x5')](_0xc3fa93,_0x581e5f);_0x3c1d43(null);};}for(var e in events){if(events[_0xbf3e('0x6')](e)){var event=events[e];VoiceQueueReport[_0xbf3e('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 67afddb..96500f0 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 _0x35fd=['uniqueid','calleridnum','util','../../config/logger','bluebird','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x161ca5,_0x44cc3a){var _0x15af94=function(_0x18ff91){while(--_0x18ff91){_0x161ca5['push'](_0x161ca5['shift']());}};_0x15af94(++_0x44cc3a);}(_0x35fd,0x1d6));var _0xd35f=function(_0x8bd7b3,_0x55ffba){_0x8bd7b3=_0x8bd7b3-0x0;var _0x1d6993=_0x35fd[_0x8bd7b3];return _0x1d6993;};'use strict';var _=require('lodash');var util=require(_0xd35f('0x0'));var logger=require(_0xd35f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd35f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd35f('0x3'));var rimraf=require('rimraf');var config=require(_0xd35f('0x4'));var attributes=require(_0xd35f('0x5'));module[_0xd35f('0x6')]=function(_0x481cb0,_0x220144){return _0x481cb0[_0xd35f('0x7')](_0xd35f('0x8'),attributes,{'tableName':_0xd35f('0x9'),'paranoid':![],'indexes':[{'fields':[_0xd35f('0xa')]},{'fields':[_0xd35f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4413=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','report_queue','calleridnum'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4413,0x1e1));var _0x3441=function(_0x2d254c,_0x25dcfb){_0x2d254c=_0x2d254c-0x0;var _0x65721b=_0x4413[_0x2d254c];return _0x65721b;};'use strict';var _=require(_0x3441('0x0'));var util=require(_0x3441('0x1'));var logger=require(_0x3441('0x2'))(_0x3441('0x3'));var moment=require(_0x3441('0x4'));var BPromise=require(_0x3441('0x5'));var rp=require(_0x3441('0x6'));var fs=require('fs');var path=require(_0x3441('0x7'));var rimraf=require(_0x3441('0x8'));var config=require('../../config/environment');var attributes=require(_0x3441('0x9'));module[_0x3441('0xa')]=function(_0x1723db,_0x4ae989){return _0x1723db['define']('VoiceQueueReport',attributes,{'tableName':_0x3441('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3441('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 2338919..ef4ea5b 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 _0x90d1=['findAll','options','where','limit','include','map','model','attributes','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','VoiceQueueReport'];(function(_0x37fd66,_0x2249c8){var _0x567746=function(_0x391089){while(--_0x391089){_0x37fd66['push'](_0x37fd66['shift']());}};_0x567746(++_0x2249c8);}(_0x90d1,0x13c));var _0x190d=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0x90d1[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0x190d('0x0'));var util=require(_0x190d('0x1'));var moment=require(_0x190d('0x2'));var BPromise=require(_0x190d('0x3'));var rs=require(_0x190d('0x4'));var fs=require('fs');var Redis=require(_0x190d('0x5'));var db=require(_0x190d('0x6'))['db'];var utils=require(_0x190d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x190d('0x8'));var jayson=require(_0x190d('0x9'));var client=jayson[_0x190d('0xa')][_0x190d('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x190d('0xc'),'port':0x18eb});var socket=require(_0x190d('0xd'))(new Redis(config['redis']));require(_0x190d('0xe'))[_0x190d('0xf')](socket);function respondWithRpcPromise(_0x5eece5,_0x2a690d,_0x5bbf7f){return new BPromise(function(_0x461a2f,_0x29bdee){return client['request'](_0x5eece5,_0x5bbf7f)[_0x190d('0x10')](function(_0xa144ff){logger[_0x190d('0x11')](_0x190d('0x12'),_0x2a690d,_0x190d('0x13'));logger[_0x190d('0x14')](_0x190d('0x15'),_0x2a690d,_0x190d('0x13'),JSON['stringify'](_0xa144ff));if(_0xa144ff['error']){if(_0xa144ff[_0x190d('0x16')][_0x190d('0x17')]===0x1f4){logger[_0x190d('0x16')](_0x190d('0x12'),_0x2a690d,_0xa144ff[_0x190d('0x16')][_0x190d('0x18')]);return _0x29bdee(_0xa144ff[_0x190d('0x16')]['message']);}logger['error'](_0x190d('0x12'),_0x2a690d,_0xa144ff[_0x190d('0x16')]['message']);return _0x461a2f(_0xa144ff[_0x190d('0x16')]['message']);}else{logger[_0x190d('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x2a690d,_0x190d('0x13'));_0x461a2f(_0xa144ff[_0x190d('0x19')][_0x190d('0x18')]);}})[_0x190d('0x1a')](function(_0x5d5d5b){logger[_0x190d('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x2a690d,_0x5d5d5b);_0x29bdee(_0x5d5d5b);});});}exports['GetVoiceQueueReport']=function(_0x575661){var _0x527723=this;return new Promise(function(_0x1fc485,_0x482d11){return db[_0x190d('0x1b')][_0x190d('0x1c')]({'raw':_0x575661[_0x190d('0x1d')]?_0x575661[_0x190d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x575661[_0x190d('0x1d')]?_0x575661['options'][_0x190d('0x1e')]||null:null,'attributes':_0x575661[_0x190d('0x1d')]?_0x575661[_0x190d('0x1d')]['attributes']||null:null,'limit':_0x575661[_0x190d('0x1d')]?_0x575661[_0x190d('0x1d')][_0x190d('0x1f')]||null:null,'include':_0x575661[_0x190d('0x1d')]?_0x575661[_0x190d('0x1d')][_0x190d('0x20')]?_[_0x190d('0x21')](_0x575661[_0x190d('0x1d')][_0x190d('0x20')],function(_0x2a7870){return{'model':db[_0x2a7870['model']],'as':_0x2a7870['as'],'attributes':_0x2a7870['attributes'],'include':_0x2a7870[_0x190d('0x20')]?_[_0x190d('0x21')](_0x2a7870[_0x190d('0x20')],function(_0x5c161b){return{'model':db[_0x5c161b[_0x190d('0x22')]],'as':_0x5c161b['as'],'attributes':_0x5c161b['attributes'],'include':_0x5c161b[_0x190d('0x20')]?_[_0x190d('0x21')](_0x5c161b[_0x190d('0x20')],function(_0x4addf5){return{'model':db[_0x4addf5['model']],'as':_0x4addf5['as'],'attributes':_0x4addf5[_0x190d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x190d('0x10')](function(_0x4da7f0){logger[_0x190d('0x11')]('GetVoiceQueueReport',_0x575661);logger[_0x190d('0x14')](_0x190d('0x24'),_0x575661,JSON[_0x190d('0x25')](_0x4da7f0));_0x1fc485(_0x4da7f0);})[_0x190d('0x1a')](function(_0x3e0faf){logger[_0x190d('0x16')]('GetVoiceQueueReport',_0x3e0faf[_0x190d('0x18')],_0x575661);_0x482d11(_0x527723[_0x190d('0x16')](0x1f4,_0x3e0faf['message']));});});};exports[_0x190d('0x26')]=function(_0x1264a2){var _0x2e53c7=this;return new Promise(function(_0x4169a1,_0x41b38b){return db[_0x190d('0x1b')]['create'](_0x1264a2[_0x190d('0x27')],{'raw':_0x1264a2[_0x190d('0x1d')]?_0x1264a2['options'][_0x190d('0x28')]===undefined?!![]:![]:!![]})[_0x190d('0x10')](function(_0x2ea6f8){logger[_0x190d('0x11')](_0x190d('0x26'),_0x1264a2);logger[_0x190d('0x14')](_0x190d('0x26'),_0x1264a2,JSON[_0x190d('0x25')](_0x2ea6f8));_0x4169a1(_0x2ea6f8);})[_0x190d('0x1a')](function(_0x2f3f2b){logger[_0x190d('0x16')](_0x190d('0x26'),_0x2f3f2b[_0x190d('0x18')],_0x1264a2);_0x41b38b(_0x2e53c7[_0x190d('0x16')](0x1f4,_0x2f3f2b['message']));});});};exports[_0x190d('0x29')]=function(_0x47c54d){var _0x220f80=this;return new Promise(function(_0x393b2d,_0x2f62ba){return db['VoiceQueueReport'][_0x190d('0x2a')](_0x47c54d[_0x190d('0x27')],{'raw':_0x47c54d[_0x190d('0x1d')]?_0x47c54d[_0x190d('0x1d')][_0x190d('0x28')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c54d[_0x190d('0x1d')]?_0x47c54d['options']['where']||null:null,'attributes':_0x47c54d[_0x190d('0x1d')]?_0x47c54d[_0x190d('0x1d')][_0x190d('0x23')]||null:null,'limit':_0x47c54d[_0x190d('0x1d')]?_0x47c54d[_0x190d('0x1d')][_0x190d('0x1f')]||null:null})[_0x190d('0x10')](function(_0x5466b8){logger['info'](_0x190d('0x29'),_0x47c54d);logger[_0x190d('0x14')](_0x190d('0x29'),_0x47c54d,JSON[_0x190d('0x25')](_0x5466b8));_0x393b2d(_0x5466b8);})[_0x190d('0x1a')](function(_0x1e197c){logger[_0x190d('0x16')](_0x190d('0x29'),_0x1e197c[_0x190d('0x18')],_0x47c54d);_0x2f62ba(_0x220f80[_0x190d('0x16')](0x1f4,_0x1e197c[_0x190d('0x18')]));});});}; \ No newline at end of file +var _0xe2b6=['where','attributes','limit','include','map','model','GetVoiceQueueReport','create','CreateVoiceQueueReport','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueueReport','options','raw'];(function(_0x53c86c,_0x5398a8){var _0x306a38=function(_0x351f0d){while(--_0x351f0d){_0x53c86c['push'](_0x53c86c['shift']());}};_0x306a38(++_0x5398a8);}(_0xe2b6,0x142));var _0x6e2b=function(_0x1fe8eb,_0x429fa0){_0x1fe8eb=_0x1fe8eb-0x0;var _0x2a4588=_0xe2b6[_0x1fe8eb];return _0x2a4588;};'use strict';var _=require(_0x6e2b('0x0'));var util=require(_0x6e2b('0x1'));var moment=require(_0x6e2b('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e2b('0x3'));var fs=require('fs');var Redis=require(_0x6e2b('0x4'));var db=require(_0x6e2b('0x5'))['db'];var utils=require(_0x6e2b('0x6'));var logger=require(_0x6e2b('0x7'))(_0x6e2b('0x8'));var config=require('../../config/environment');var jayson=require(_0x6e2b('0x9'));var client=jayson['client'][_0x6e2b('0xa')]({'port':0x232a});config[_0x6e2b('0xb')]=_['defaults'](config[_0x6e2b('0xb')],{'host':_0x6e2b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x6e2b('0xd')](socket);function respondWithRpcPromise(_0x98991b,_0x1d3131,_0xcdaf0a){return new BPromise(function(_0x42e197,_0x1579cb){return client['request'](_0x98991b,_0xcdaf0a)[_0x6e2b('0xe')](function(_0x372ecf){logger[_0x6e2b('0xf')](_0x6e2b('0x10'),_0x1d3131,_0x6e2b('0x11'));logger[_0x6e2b('0x12')](_0x6e2b('0x13'),_0x1d3131,_0x6e2b('0x11'),JSON[_0x6e2b('0x14')](_0x372ecf));if(_0x372ecf[_0x6e2b('0x15')]){if(_0x372ecf[_0x6e2b('0x15')][_0x6e2b('0x16')]===0x1f4){logger[_0x6e2b('0x15')](_0x6e2b('0x10'),_0x1d3131,_0x372ecf['error'][_0x6e2b('0x17')]);return _0x1579cb(_0x372ecf[_0x6e2b('0x15')][_0x6e2b('0x17')]);}logger[_0x6e2b('0x15')](_0x6e2b('0x10'),_0x1d3131,_0x372ecf[_0x6e2b('0x15')][_0x6e2b('0x17')]);return _0x42e197(_0x372ecf[_0x6e2b('0x15')][_0x6e2b('0x17')]);}else{logger[_0x6e2b('0xf')](_0x6e2b('0x10'),_0x1d3131,_0x6e2b('0x11'));_0x42e197(_0x372ecf[_0x6e2b('0x18')]['message']);}})[_0x6e2b('0x19')](function(_0x1fac71){logger[_0x6e2b('0x15')](_0x6e2b('0x10'),_0x1d3131,_0x1fac71);_0x1579cb(_0x1fac71);});});}exports['GetVoiceQueueReport']=function(_0x244167){var _0x59041b=this;return new Promise(function(_0x14b695,_0x381836){return db[_0x6e2b('0x1a')]['findAll']({'raw':_0x244167[_0x6e2b('0x1b')]?_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x1c')]===undefined?!![]:![]:!![],'where':_0x244167[_0x6e2b('0x1b')]?_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x1d')]||null:null,'attributes':_0x244167[_0x6e2b('0x1b')]?_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x1e')]||null:null,'limit':_0x244167[_0x6e2b('0x1b')]?_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x1f')]||null:null,'include':_0x244167[_0x6e2b('0x1b')]?_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x20')]?_[_0x6e2b('0x21')](_0x244167[_0x6e2b('0x1b')][_0x6e2b('0x20')],function(_0x18a56d){return{'model':db[_0x18a56d[_0x6e2b('0x22')]],'as':_0x18a56d['as'],'attributes':_0x18a56d[_0x6e2b('0x1e')],'include':_0x18a56d[_0x6e2b('0x20')]?_['map'](_0x18a56d['include'],function(_0x4f5b91){return{'model':db[_0x4f5b91['model']],'as':_0x4f5b91['as'],'attributes':_0x4f5b91[_0x6e2b('0x1e')],'include':_0x4f5b91[_0x6e2b('0x20')]?_[_0x6e2b('0x21')](_0x4f5b91[_0x6e2b('0x20')],function(_0x2fbc84){return{'model':db[_0x2fbc84[_0x6e2b('0x22')]],'as':_0x2fbc84['as'],'attributes':_0x2fbc84[_0x6e2b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e2b('0xe')](function(_0x10e24f){logger['info'](_0x6e2b('0x23'),_0x244167);logger[_0x6e2b('0x12')](_0x6e2b('0x23'),_0x244167,JSON[_0x6e2b('0x14')](_0x10e24f));_0x14b695(_0x10e24f);})[_0x6e2b('0x19')](function(_0x484c31){logger['error'](_0x6e2b('0x23'),_0x484c31['message'],_0x244167);_0x381836(_0x59041b[_0x6e2b('0x15')](0x1f4,_0x484c31[_0x6e2b('0x17')]));});});};exports['CreateVoiceQueueReport']=function(_0xe80b7a){var _0x1528e1=this;return new Promise(function(_0xc15cef,_0x28f6a6){return db[_0x6e2b('0x1a')][_0x6e2b('0x24')](_0xe80b7a['body'],{'raw':_0xe80b7a[_0x6e2b('0x1b')]?_0xe80b7a['options'][_0x6e2b('0x1c')]===undefined?!![]:![]:!![]})[_0x6e2b('0xe')](function(_0x3ef3a6){logger[_0x6e2b('0xf')](_0x6e2b('0x25'),_0xe80b7a);logger[_0x6e2b('0x12')](_0x6e2b('0x25'),_0xe80b7a,JSON[_0x6e2b('0x14')](_0x3ef3a6));_0xc15cef(_0x3ef3a6);})[_0x6e2b('0x19')](function(_0x3a7590){logger[_0x6e2b('0x15')](_0x6e2b('0x25'),_0x3a7590[_0x6e2b('0x17')],_0xe80b7a);_0x28f6a6(_0x1528e1[_0x6e2b('0x15')](0x1f4,_0x3a7590[_0x6e2b('0x17')]));});});};exports[_0x6e2b('0x26')]=function(_0x2ef97c){var _0x3e1442=this;return new Promise(function(_0x1aafb9,_0x59ebae){return db[_0x6e2b('0x1a')]['update'](_0x2ef97c['body'],{'raw':_0x2ef97c['options']?_0x2ef97c[_0x6e2b('0x1b')][_0x6e2b('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef97c[_0x6e2b('0x1b')]?_0x2ef97c['options']['where']||null:null,'attributes':_0x2ef97c[_0x6e2b('0x1b')]?_0x2ef97c['options'][_0x6e2b('0x1e')]||null:null,'limit':_0x2ef97c[_0x6e2b('0x1b')]?_0x2ef97c['options'][_0x6e2b('0x1f')]||null:null})[_0x6e2b('0xe')](function(_0x213a1c){logger[_0x6e2b('0xf')](_0x6e2b('0x26'),_0x2ef97c);logger[_0x6e2b('0x12')](_0x6e2b('0x26'),_0x2ef97c,JSON['stringify'](_0x213a1c));_0x1aafb9(_0x213a1c);})[_0x6e2b('0x19')](function(_0x18089f){logger['error'](_0x6e2b('0x26'),_0x18089f[_0x6e2b('0x17')],_0x2ef97c);_0x59ebae(_0x3e1442[_0x6e2b('0x15')](0x1f4,_0x18089f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 0865f83..e534ce2 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 _0xdedd=['register','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x4c555a,_0x11893e){var _0x548fd0=function(_0x44008e){while(--_0x44008e){_0x4c555a['push'](_0x4c555a['shift']());}};_0x548fd0(++_0x11893e);}(_0xdedd,0x197));var _0xdded=function(_0x2f03e8,_0x427e58){_0x2f03e8=_0x2f03e8-0x0;var _0x248ea8=_0xdedd[_0x2f03e8];return _0x248ea8;};'use strict';var VoiceQueueReportEvents=require(_0xdded('0x0'));var events=[_0xdded('0x1'),_0xdded('0x2'),_0xdded('0x3')];function createListener(_0x357ada,_0x53d8af){return function(_0x18ba9d){_0x53d8af[_0xdded('0x4')](_0x357ada,_0x18ba9d);};}function removeListener(_0x207a33,_0x3e91ad){return function(){VoiceQueueReportEvents[_0xdded('0x5')](_0x207a33,_0x3e91ad);};}exports[_0xdded('0x6')]=function(_0x2e327c){for(var _0x277fab=0x0,_0x59aa13=events['length'];_0x277fab<_0x59aa13;_0x277fab++){var _0x558cff=events[_0x277fab];var _0x224a4d=createListener('voiceQueueReport:'+_0x558cff,_0x2e327c);VoiceQueueReportEvents['on'](_0x558cff,_0x224a4d);}}; \ No newline at end of file +var _0x891b=['update','emit','removeListener','register','voiceQueueReport:','remove'];(function(_0x167211,_0x1528f2){var _0x5085c4=function(_0x1ce392){while(--_0x1ce392){_0x167211['push'](_0x167211['shift']());}};_0x5085c4(++_0x1528f2);}(_0x891b,0xc5));var _0xb891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x891b[_0x14add3];return _0x4a174f;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=['save',_0xb891('0x0'),_0xb891('0x1')];function createListener(_0x4988eb,_0x31870f){return function(_0xca3e82){_0x31870f[_0xb891('0x2')](_0x4988eb,_0xca3e82);};}function removeListener(_0x467558,_0x587bf1){return function(){VoiceQueueReportEvents[_0xb891('0x3')](_0x467558,_0x587bf1);};}exports[_0xb891('0x4')]=function(_0x542400){for(var _0x3635be=0x0,_0x4eda97=events['length'];_0x3635be<_0x4eda97;_0x3635be++){var _0x5521f0=events[_0x3635be];var _0x134dc0=createListener(_0xb891('0x5')+_0x5521f0,_0x542400);VoiceQueueReportEvents['on'](_0x5521f0,_0x134dc0);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d4de9de..9a55591 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 _0x0601=['./voiceQueuesLog.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0601,0x6b));var _0x1060=function(_0x16e8bc,_0x142c3d){_0x16e8bc=_0x16e8bc-0x0;var _0x240ddd=_0x0601[_0x16e8bc];return _0x240ddd;};'use strict';var multer=require(_0x1060('0x0'));var util=require(_0x1060('0x1'));var path=require(_0x1060('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1060('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1060('0x4'));var controller=require(_0x1060('0x5'));router['get']('/',auth[_0x1060('0x6')](),controller[_0x1060('0x7')]);router['get'](_0x1060('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x1060('0x9')]('/',auth[_0x1060('0x6')](),controller[_0x1060('0xa')]);router[_0x1060('0xb')](_0x1060('0x8'),auth['isAuthenticated'](),controller[_0x1060('0xc')]);router[_0x1060('0xd')](_0x1060('0x8'),auth['isAuthenticated'](),controller[_0x1060('0xe')]);module[_0x1060('0xf')]=router; \ No newline at end of file +var _0xecfd=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x23266e,_0x3647e2){var _0x55c2b6=function(_0x32afd4){while(--_0x32afd4){_0x23266e['push'](_0x23266e['shift']());}};_0x55c2b6(++_0x3647e2);}(_0xecfd,0x6c));var _0xdecf=function(_0x55c2e2,_0x238a2e){_0x55c2e2=_0x55c2e2-0x0;var _0x4dd53a=_0xecfd[_0x55c2e2];return _0x4dd53a;};'use strict';var multer=require(_0xdecf('0x0'));var util=require(_0xdecf('0x1'));var path=require(_0xdecf('0x2'));var timeout=require(_0xdecf('0x3'));var express=require(_0xdecf('0x4'));var router=express[_0xdecf('0x5')]();var fs_extra=require(_0xdecf('0x6'));var auth=require(_0xdecf('0x7'));var interaction=require(_0xdecf('0x8'));var config=require('../../config/environment');var controller=require(_0xdecf('0x9'));router[_0xdecf('0xa')]('/',auth[_0xdecf('0xb')](),controller['index']);router[_0xdecf('0xa')]('/:id',auth[_0xdecf('0xb')](),controller['show']);router[_0xdecf('0xc')]('/',auth[_0xdecf('0xb')](),controller['create']);router[_0xdecf('0xd')](_0xdecf('0xe'),auth[_0xdecf('0xb')](),controller[_0xdecf('0xf')]);router[_0xdecf('0x10')](_0xdecf('0xe'),auth[_0xdecf('0xb')](),controller[_0xdecf('0x11')]);module[_0xdecf('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 8e13491..8fe3bdc 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 _0x6ea6=['literal','sequelize','moment','exports','STRING'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6ea6,0xe7));var _0x66ea=function(_0x44dba1,_0x270ad5){_0x44dba1=_0x44dba1-0x0;var _0x2fbd3f=_0x6ea6[_0x44dba1];return _0x2fbd3f;};'use strict';var Sequelize=require(_0x66ea('0x0'));var moment=require(_0x66ea('0x1'));module[_0x66ea('0x2')]={'time':{'type':Sequelize[_0x66ea('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x66ea('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x66ea('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x66ea('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x66ea('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x66ea('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x66ea('0x4')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x4c6f=['sequelize','moment','exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x27dd8e,_0x4ac4ee){var _0x137b68=function(_0x56d15d){while(--_0x56d15d){_0x27dd8e['push'](_0x27dd8e['shift']());}};_0x137b68(++_0x4ac4ee);}(_0x4c6f,0x1b2));var _0xf4c6=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0x4c6f[_0x1c7b4c];return _0x18daf6;};'use strict';var Sequelize=require(_0xf4c6('0x0'));var moment=require(_0xf4c6('0x1'));module[_0xf4c6('0x2')]={'time':{'type':Sequelize[_0xf4c6('0x3')]},'callid':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xf4c6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xf4c6('0x4')],'allowNull':![],'defaultValue':Sequelize[_0xf4c6('0x5')](_0xf4c6('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index a7c8669..789cb90 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 _0x0c12=['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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','VoiceQueuesLog','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','order','sort','filter','where','merge','options','include','catch','params','includeAll','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3001d8,_0x23a87e){var _0x55e37c=function(_0x12a743){while(--_0x12a743){_0x3001d8['push'](_0x3001d8['shift']());}};_0x55e37c(++_0x23a87e);}(_0x0c12,0x153));var _0x20c1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c12[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x20c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x20c1('0x1'));var jsonpatch=require(_0x20c1('0x2'));var rp=require(_0x20c1('0x3'));var moment=require(_0x20c1('0x4'));var BPromise=require(_0x20c1('0x5'));var Mustache=require(_0x20c1('0x6'));var util=require(_0x20c1('0x7'));var path=require(_0x20c1('0x8'));var sox=require(_0x20c1('0x9'));var csv=require(_0x20c1('0xa'));var ejs=require(_0x20c1('0xb'));var fs=require('fs');var fs_extra=require(_0x20c1('0xc'));var _=require(_0x20c1('0xd'));var squel=require(_0x20c1('0xe'));var crypto=require(_0x20c1('0xf'));var jsforce=require(_0x20c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x20c1('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x20c1('0x12'));var qs=require(_0x20c1('0x13'));var as=require(_0x20c1('0x14'));var hardwareService=require(_0x20c1('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x20c1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x20c1('0x17'));var db=require(_0x20c1('0x18'))['db'];function respondWithStatusCode(_0x50b9e9,_0x435754){_0x435754=_0x435754||0xcc;return function(_0x4f00cd){if(_0x4f00cd){return _0x50b9e9[_0x20c1('0x19')](_0x435754);}return _0x50b9e9[_0x20c1('0x1a')](_0x435754)[_0x20c1('0x1b')]();};}function respondWithResult(_0x1d8157,_0x165fd8){_0x165fd8=_0x165fd8||0xc8;return function(_0x435fe6){if(_0x435fe6){return _0x1d8157[_0x20c1('0x1a')](_0x165fd8)[_0x20c1('0x1c')](_0x435fe6);}};}function respondWithFilteredResult(_0x55a192,_0x3d852c){return function(_0x49191c){if(_0x49191c){var _0x1ca30a=typeof _0x3d852c['offset']==='undefined'&&typeof _0x3d852c[_0x20c1('0x1d')]===_0x20c1('0x1e');var _0x5db7dd=_0x49191c[_0x20c1('0x1f')];var _0x12020b=_0x1ca30a?0x0:_0x3d852c[_0x20c1('0x20')];var _0x574cf9=_0x1ca30a?_0x49191c[_0x20c1('0x1f')]:_0x3d852c[_0x20c1('0x20')]+_0x3d852c[_0x20c1('0x1d')];var _0x64c579;if(_0x574cf9>=_0x5db7dd){_0x574cf9=_0x5db7dd;_0x64c579=0xc8;}else{_0x64c579=0xce;}_0x55a192[_0x20c1('0x1a')](_0x64c579);return _0x55a192[_0x20c1('0x21')](_0x20c1('0x22'),_0x12020b+'-'+_0x574cf9+'/'+_0x5db7dd)[_0x20c1('0x1c')](_0x49191c);}return null;};}function patchUpdates(_0x5f3039){return function(_0x32ad4e){try{jsonpatch[_0x20c1('0x23')](_0x32ad4e,_0x5f3039,!![]);}catch(_0x14f71c){return BPromise['reject'](_0x14f71c);}return _0x32ad4e[_0x20c1('0x24')]();};}function saveUpdates(_0x5a53ae,_0x326364){return function(_0x298814){if(_0x298814){return _0x298814['update'](_0x5a53ae)['then'](function(_0x3a9dd6){return _0x3a9dd6;});}return null;};}function removeEntity(_0x1c9c54,_0x1eaf45){return function(_0x492179){if(_0x492179){return _0x492179[_0x20c1('0x25')]()[_0x20c1('0x26')](function(){_0x1c9c54[_0x20c1('0x1a')](0xcc)[_0x20c1('0x1b')]();});}};}function handleEntityNotFound(_0x27f1f4,_0x56daa2){return function(_0x491f47){if(!_0x491f47){_0x27f1f4[_0x20c1('0x19')](0x194);}return _0x491f47;};}function handleError(_0x3e1075,_0xe3a9a3){_0xe3a9a3=_0xe3a9a3||0x1f4;return function(_0x2800e0){logger[_0x20c1('0x27')](_0x2800e0[_0x20c1('0x28')]);if(_0x2800e0[_0x20c1('0x29')]){delete _0x2800e0['name'];}_0x3e1075[_0x20c1('0x1a')](_0xe3a9a3)['send'](_0x2800e0);};}exports['index']=function(_0x467e70,_0x42dabd){var _0x137e4d={},_0x24ca40={},_0x16b574={'count':0x0,'rows':[]};var _0x414a16=_['map'](db[_0x20c1('0x2a')][_0x20c1('0x2b')],function(_0x51b048){return{'name':_0x51b048[_0x20c1('0x2c')],'type':_0x51b048['type'][_0x20c1('0x2d')]};});_0x24ca40[_0x20c1('0x2e')]=_[_0x20c1('0x2f')](_0x414a16,_0x20c1('0x29'));_0x24ca40['query']=_[_0x20c1('0x30')](_0x467e70['query']);_0x24ca40[_0x20c1('0x31')]=_['intersection'](_0x24ca40['model'],_0x24ca40[_0x20c1('0x32')]);_0x137e4d[_0x20c1('0x33')]=_[_0x20c1('0x34')](_0x24ca40['model'],qs[_0x20c1('0x35')](_0x467e70[_0x20c1('0x32')]['fields']));_0x137e4d['attributes']=_0x137e4d[_0x20c1('0x33')][_0x20c1('0x36')]?_0x137e4d[_0x20c1('0x33')]:_0x24ca40[_0x20c1('0x2e')];if(!_0x467e70[_0x20c1('0x32')]['hasOwnProperty']('nolimit')){_0x137e4d[_0x20c1('0x1d')]=qs[_0x20c1('0x1d')](_0x467e70[_0x20c1('0x32')][_0x20c1('0x1d')]);_0x137e4d[_0x20c1('0x20')]=qs[_0x20c1('0x20')](_0x467e70['query'][_0x20c1('0x20')]);}_0x137e4d[_0x20c1('0x37')]=qs['sort'](_0x467e70[_0x20c1('0x32')][_0x20c1('0x38')]);_0x137e4d['where']=qs[_0x20c1('0x31')](_['pick'](_0x467e70['query'],_0x24ca40[_0x20c1('0x31')]),_0x414a16);if(_0x467e70[_0x20c1('0x32')][_0x20c1('0x39')]){_0x137e4d[_0x20c1('0x3a')]=_[_0x20c1('0x3b')](_0x137e4d[_0x20c1('0x3a')],{'$or':_['map'](_0x414a16,function(_0x491042){if(_0x491042['type']!=='VIRTUAL'){var _0x1da23f={};_0x1da23f[_0x491042['name']]={'$like':'%'+_0x467e70['query'][_0x20c1('0x39')]+'%'};return _0x1da23f;}})});}_0x137e4d=_[_0x20c1('0x3b')]({},_0x137e4d,_0x467e70[_0x20c1('0x3c')]);var _0x444c21={'where':_0x137e4d[_0x20c1('0x3a')]};return db[_0x20c1('0x2a')]['count'](_0x444c21)[_0x20c1('0x26')](function(_0x8067c1){_0x16b574[_0x20c1('0x1f')]=_0x8067c1;if(_0x467e70[_0x20c1('0x32')]['includeAll']){_0x137e4d[_0x20c1('0x3d')]=[{'all':!![]}];}return db[_0x20c1('0x2a')]['findAll'](_0x137e4d);})['then'](function(_0x24f415){_0x16b574['rows']=_0x24f415;return _0x16b574;})[_0x20c1('0x26')](respondWithFilteredResult(_0x42dabd,_0x137e4d))[_0x20c1('0x3e')](handleError(_0x42dabd,null));};exports['show']=function(_0x5df20d,_0x21f515){var _0x502cb6={'raw':!![],'where':{'id':_0x5df20d[_0x20c1('0x3f')]['id']}},_0x6d3389={};_0x6d3389[_0x20c1('0x2e')]=_[_0x20c1('0x30')](db[_0x20c1('0x2a')][_0x20c1('0x2b')]);_0x6d3389[_0x20c1('0x32')]=_['keys'](_0x5df20d[_0x20c1('0x32')]);_0x6d3389[_0x20c1('0x31')]=_[_0x20c1('0x34')](_0x6d3389[_0x20c1('0x2e')],_0x6d3389[_0x20c1('0x32')]);_0x502cb6['attributes']=_[_0x20c1('0x34')](_0x6d3389['model'],qs[_0x20c1('0x35')](_0x5df20d[_0x20c1('0x32')][_0x20c1('0x35')]));_0x502cb6['attributes']=_0x502cb6['attributes'][_0x20c1('0x36')]?_0x502cb6[_0x20c1('0x33')]:_0x6d3389[_0x20c1('0x2e')];if(_0x5df20d[_0x20c1('0x32')][_0x20c1('0x40')]){_0x502cb6[_0x20c1('0x3d')]=[{'all':!![]}];}_0x502cb6=_[_0x20c1('0x3b')]({},_0x502cb6,_0x5df20d[_0x20c1('0x3c')]);return db['VoiceQueuesLog'][_0x20c1('0x41')](_0x502cb6)[_0x20c1('0x26')](handleEntityNotFound(_0x21f515,null))[_0x20c1('0x26')](respondWithResult(_0x21f515,null))[_0x20c1('0x3e')](handleError(_0x21f515,null));};exports[_0x20c1('0x42')]=function(_0x407a1c,_0xcb6665){return db['VoiceQueuesLog']['create'](_0x407a1c['body'],{})[_0x20c1('0x26')](respondWithResult(_0xcb6665,0xc9))[_0x20c1('0x3e')](handleError(_0xcb6665,null));};exports[_0x20c1('0x43')]=function(_0x2a8886,_0x4f3f8e){if(_0x2a8886['body']['id']){delete _0x2a8886[_0x20c1('0x44')]['id'];}return db['VoiceQueuesLog'][_0x20c1('0x41')]({'where':{'id':_0x2a8886[_0x20c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4f3f8e,null))[_0x20c1('0x26')](saveUpdates(_0x2a8886[_0x20c1('0x44')],null))[_0x20c1('0x26')](respondWithResult(_0x4f3f8e,null))['catch'](handleError(_0x4f3f8e,null));};exports[_0x20c1('0x25')]=function(_0x5646d4,_0x4536fe){return db[_0x20c1('0x2a')]['find']({'where':{'id':_0x5646d4[_0x20c1('0x3f')]['id']}})[_0x20c1('0x26')](handleEntityNotFound(_0x4536fe,null))[_0x20c1('0x26')](removeEntity(_0x4536fe,null))[_0x20c1('0x3e')](handleError(_0x4536fe,null));}; \ No newline at end of file +var _0xf6c6=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','limit','undefined','offset','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','filters','intersection','attributes','fields','query','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','keys','options','find','create','body','update','params'];(function(_0x51fdde,_0x53d8d2){var _0x387137=function(_0x5d1197){while(--_0x5d1197){_0x51fdde['push'](_0x51fdde['shift']());}};_0x387137(++_0x53d8d2);}(_0xf6c6,0x172));var _0x6f6c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xf6c6[_0x3070dc];return _0x431489;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f6c('0x0'));var zipdir=require(_0x6f6c('0x1'));var jsonpatch=require(_0x6f6c('0x2'));var rp=require(_0x6f6c('0x3'));var moment=require(_0x6f6c('0x4'));var BPromise=require(_0x6f6c('0x5'));var Mustache=require(_0x6f6c('0x6'));var util=require(_0x6f6c('0x7'));var path=require(_0x6f6c('0x8'));var sox=require(_0x6f6c('0x9'));var csv=require(_0x6f6c('0xa'));var ejs=require(_0x6f6c('0xb'));var fs=require('fs');var fs_extra=require(_0x6f6c('0xc'));var _=require(_0x6f6c('0xd'));var squel=require(_0x6f6c('0xe'));var crypto=require('crypto');var jsforce=require(_0x6f6c('0xf'));var deskjs=require(_0x6f6c('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6f6c('0x11'));var Papa=require(_0x6f6c('0x12'));var Redis=require(_0x6f6c('0x13'));var authService=require(_0x6f6c('0x14'));var qs=require(_0x6f6c('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f6c('0x16'))(_0x6f6c('0x17'));var utils=require(_0x6f6c('0x18'));var config=require(_0x6f6c('0x19'));var licenseUtil=require(_0x6f6c('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b94a8,_0x92049a){_0x92049a=_0x92049a||0xcc;return function(_0xa3d567){if(_0xa3d567){return _0x1b94a8['sendStatus'](_0x92049a);}return _0x1b94a8['status'](_0x92049a)[_0x6f6c('0x1b')]();};}function respondWithResult(_0x293bee,_0x320a19){_0x320a19=_0x320a19||0xc8;return function(_0x24b593){if(_0x24b593){return _0x293bee[_0x6f6c('0x1c')](_0x320a19)[_0x6f6c('0x1d')](_0x24b593);}};}function respondWithFilteredResult(_0x5e46f5,_0x58a7e1){return function(_0x40fd32){if(_0x40fd32){var _0x4f01e6=typeof _0x58a7e1['offset']==='undefined'&&typeof _0x58a7e1[_0x6f6c('0x1e')]===_0x6f6c('0x1f');var _0x1fed8f=_0x40fd32['count'];var _0x2b9550=_0x4f01e6?0x0:_0x58a7e1[_0x6f6c('0x20')];var _0x3eae0f=_0x4f01e6?_0x40fd32[_0x6f6c('0x21')]:_0x58a7e1['offset']+_0x58a7e1[_0x6f6c('0x1e')];var _0x1fc950;if(_0x3eae0f>=_0x1fed8f){_0x3eae0f=_0x1fed8f;_0x1fc950=0xc8;}else{_0x1fc950=0xce;}_0x5e46f5[_0x6f6c('0x1c')](_0x1fc950);return _0x5e46f5[_0x6f6c('0x22')](_0x6f6c('0x23'),_0x2b9550+'-'+_0x3eae0f+'/'+_0x1fed8f)[_0x6f6c('0x1d')](_0x40fd32);}return null;};}function patchUpdates(_0x11ac34){return function(_0x3dbf71){try{jsonpatch['apply'](_0x3dbf71,_0x11ac34,!![]);}catch(_0x3bad37){return BPromise[_0x6f6c('0x24')](_0x3bad37);}return _0x3dbf71[_0x6f6c('0x25')]();};}function saveUpdates(_0xf65f4c,_0x28d6e5){return function(_0x48f8f3){if(_0x48f8f3){return _0x48f8f3['update'](_0xf65f4c)[_0x6f6c('0x26')](function(_0x4084d2){return _0x4084d2;});}return null;};}function removeEntity(_0xb2fd05,_0x5bd4f3){return function(_0x32b5f6){if(_0x32b5f6){return _0x32b5f6[_0x6f6c('0x27')]()[_0x6f6c('0x26')](function(){_0xb2fd05[_0x6f6c('0x1c')](0xcc)[_0x6f6c('0x1b')]();});}};}function handleEntityNotFound(_0x365399,_0x32752d){return function(_0x222003){if(!_0x222003){_0x365399[_0x6f6c('0x28')](0x194);}return _0x222003;};}function handleError(_0x415c4a,_0x43cf33){_0x43cf33=_0x43cf33||0x1f4;return function(_0x3e8dd1){logger[_0x6f6c('0x29')](_0x3e8dd1['stack']);if(_0x3e8dd1[_0x6f6c('0x2a')]){delete _0x3e8dd1['name'];}_0x415c4a[_0x6f6c('0x1c')](_0x43cf33)[_0x6f6c('0x2b')](_0x3e8dd1);};}exports['index']=function(_0x5c05e7,_0x3fce6d){var _0x34b5b4={},_0x3e6923={},_0x46a45c={'count':0x0,'rows':[]};var _0x184cf8=_[_0x6f6c('0x2c')](db[_0x6f6c('0x2d')][_0x6f6c('0x2e')],function(_0xa3f202){return{'name':_0xa3f202[_0x6f6c('0x2f')],'type':_0xa3f202[_0x6f6c('0x30')]['key']};});_0x3e6923[_0x6f6c('0x31')]=_['map'](_0x184cf8,_0x6f6c('0x2a'));_0x3e6923['query']=_['keys'](_0x5c05e7['query']);_0x3e6923[_0x6f6c('0x32')]=_[_0x6f6c('0x33')](_0x3e6923['model'],_0x3e6923['query']);_0x34b5b4[_0x6f6c('0x34')]=_['intersection'](_0x3e6923['model'],qs[_0x6f6c('0x35')](_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x35')]));_0x34b5b4['attributes']=_0x34b5b4[_0x6f6c('0x34')][_0x6f6c('0x37')]?_0x34b5b4[_0x6f6c('0x34')]:_0x3e6923['model'];if(!_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x38')]('nolimit')){_0x34b5b4[_0x6f6c('0x1e')]=qs['limit'](_0x5c05e7[_0x6f6c('0x36')]['limit']);_0x34b5b4['offset']=qs[_0x6f6c('0x20')](_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x20')]);}_0x34b5b4['order']=qs['sort'](_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x39')]);_0x34b5b4[_0x6f6c('0x3a')]=qs[_0x6f6c('0x32')](_[_0x6f6c('0x3b')](_0x5c05e7['query'],_0x3e6923[_0x6f6c('0x32')]),_0x184cf8);if(_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x3c')]){_0x34b5b4[_0x6f6c('0x3a')]=_[_0x6f6c('0x3d')](_0x34b5b4[_0x6f6c('0x3a')],{'$or':_[_0x6f6c('0x2c')](_0x184cf8,function(_0xa1cbfc){if(_0xa1cbfc[_0x6f6c('0x30')]!=='VIRTUAL'){var _0x42bf78={};_0x42bf78[_0xa1cbfc['name']]={'$like':'%'+_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x3c')]+'%'};return _0x42bf78;}})});}_0x34b5b4=_[_0x6f6c('0x3d')]({},_0x34b5b4,_0x5c05e7['options']);var _0xf32f6d={'where':_0x34b5b4[_0x6f6c('0x3a')]};return db[_0x6f6c('0x2d')]['count'](_0xf32f6d)[_0x6f6c('0x26')](function(_0x44706e){_0x46a45c[_0x6f6c('0x21')]=_0x44706e;if(_0x5c05e7[_0x6f6c('0x36')][_0x6f6c('0x3e')]){_0x34b5b4[_0x6f6c('0x3f')]=[{'all':!![]}];}return db[_0x6f6c('0x2d')][_0x6f6c('0x40')](_0x34b5b4);})['then'](function(_0x417ffd){_0x46a45c[_0x6f6c('0x41')]=_0x417ffd;return _0x46a45c;})[_0x6f6c('0x26')](respondWithFilteredResult(_0x3fce6d,_0x34b5b4))[_0x6f6c('0x42')](handleError(_0x3fce6d,null));};exports['show']=function(_0x209fa6,_0x18fe6d){var _0x351960={'raw':!![],'where':{'id':_0x209fa6['params']['id']}},_0x26ca4a={};_0x26ca4a[_0x6f6c('0x31')]=_[_0x6f6c('0x43')](db[_0x6f6c('0x2d')][_0x6f6c('0x2e')]);_0x26ca4a[_0x6f6c('0x36')]=_[_0x6f6c('0x43')](_0x209fa6[_0x6f6c('0x36')]);_0x26ca4a[_0x6f6c('0x32')]=_[_0x6f6c('0x33')](_0x26ca4a[_0x6f6c('0x31')],_0x26ca4a[_0x6f6c('0x36')]);_0x351960['attributes']=_[_0x6f6c('0x33')](_0x26ca4a[_0x6f6c('0x31')],qs[_0x6f6c('0x35')](_0x209fa6[_0x6f6c('0x36')]['fields']));_0x351960[_0x6f6c('0x34')]=_0x351960[_0x6f6c('0x34')][_0x6f6c('0x37')]?_0x351960['attributes']:_0x26ca4a[_0x6f6c('0x31')];if(_0x209fa6[_0x6f6c('0x36')]['includeAll']){_0x351960['include']=[{'all':!![]}];}_0x351960=_[_0x6f6c('0x3d')]({},_0x351960,_0x209fa6[_0x6f6c('0x44')]);return db[_0x6f6c('0x2d')][_0x6f6c('0x45')](_0x351960)[_0x6f6c('0x26')](handleEntityNotFound(_0x18fe6d,null))[_0x6f6c('0x26')](respondWithResult(_0x18fe6d,null))['catch'](handleError(_0x18fe6d,null));};exports[_0x6f6c('0x46')]=function(_0x114157,_0x444f78){return db['VoiceQueuesLog'][_0x6f6c('0x46')](_0x114157[_0x6f6c('0x47')],{})['then'](respondWithResult(_0x444f78,0xc9))[_0x6f6c('0x42')](handleError(_0x444f78,null));};exports[_0x6f6c('0x48')]=function(_0xb3622f,_0xe95aeb){if(_0xb3622f[_0x6f6c('0x47')]['id']){delete _0xb3622f['body']['id'];}return db[_0x6f6c('0x2d')][_0x6f6c('0x45')]({'where':{'id':_0xb3622f[_0x6f6c('0x49')]['id']}})[_0x6f6c('0x26')](handleEntityNotFound(_0xe95aeb,null))[_0x6f6c('0x26')](saveUpdates(_0xb3622f[_0x6f6c('0x47')],null))[_0x6f6c('0x26')](respondWithResult(_0xe95aeb,null))[_0x6f6c('0x42')](handleError(_0xe95aeb,null));};exports[_0x6f6c('0x27')]=function(_0x99c15a,_0x4a58dd){return db[_0x6f6c('0x2d')][_0x6f6c('0x45')]({'where':{'id':_0x99c15a[_0x6f6c('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a58dd,null))[_0x6f6c('0x26')](removeEntity(_0x4a58dd,null))['catch'](handleError(_0x4a58dd,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 75fdedb..7bb2afb 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 _0x0b21=['dtm','util','../../config/logger','moment','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event'];(function(_0x479188,_0x505a1c){var _0x466b0d=function(_0x57c2c8){while(--_0x57c2c8){_0x479188['push'](_0x479188['shift']());}};_0x466b0d(++_0x505a1c);}(_0x0b21,0x6d));var _0x10b2=function(_0x467a13,_0xf978b4){_0x467a13=_0x467a13-0x0;var _0x4407a5=_0x0b21[_0x467a13];return _0x4407a5;};'use strict';var _=require('lodash');var util=require(_0x10b2('0x0'));var logger=require(_0x10b2('0x1'))('api');var moment=require(_0x10b2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x10b2('0x3'));var rimraf=require(_0x10b2('0x4'));var config=require('../../config/environment');var attributes=require(_0x10b2('0x5'));module[_0x10b2('0x6')]=function(_0xbe6425,_0x2cba34){return _0xbe6425[_0x10b2('0x7')](_0x10b2('0x8'),attributes,{'tableName':_0x10b2('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x10b2('0xa'),_0x10b2('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x30ab=['moment','bluebird','request-promise','../../config/environment','define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','api'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x30ab,0x11d));var _0xb30a=function(_0x1ec278,_0x276e9c){_0x1ec278=_0x1ec278-0x0;var _0x2c8985=_0x30ab[_0x1ec278];return _0x2c8985;};'use strict';var _=require(_0xb30a('0x0'));var util=require(_0xb30a('0x1'));var logger=require('../../config/logger')(_0xb30a('0x2'));var moment=require(_0xb30a('0x3'));var BPromise=require(_0xb30a('0x4'));var rp=require(_0xb30a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb30a('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0xc780bc,_0x447108){return _0xc780bc[_0xb30a('0x7')](_0xb30a('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xb30a('0x9'),'fields':[_0xb30a('0xa'),_0xb30a('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index e7aa007..e3c9dcf 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 _0x7dfc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7dfc,0x19b));var _0xc7df=function(_0x19dfd6,_0x11ee3a){_0x19dfd6=_0x19dfd6-0x0;var _0x29da14=_0x7dfc[_0x19dfd6];return _0x29da14;};'use strict';var _=require(_0xc7df('0x0'));var util=require(_0xc7df('0x1'));var moment=require('moment');var BPromise=require(_0xc7df('0x2'));var rs=require(_0xc7df('0x3'));var fs=require('fs');var Redis=require(_0xc7df('0x4'));var db=require(_0xc7df('0x5'))['db'];var utils=require(_0xc7df('0x6'));var logger=require(_0xc7df('0x7'))(_0xc7df('0x8'));var config=require(_0xc7df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc7df('0xa')][_0xc7df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x288e4e,_0x2d142c,_0x2fbf63){return new BPromise(function(_0x491233,_0x69cedb){return client[_0xc7df('0xc')](_0x288e4e,_0x2fbf63)['then'](function(_0x4c81f9){logger[_0xc7df('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d142c,_0xc7df('0xe'));logger[_0xc7df('0xf')](_0xc7df('0x10'),_0x2d142c,_0xc7df('0xe'),JSON['stringify'](_0x4c81f9));if(_0x4c81f9['error']){if(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x12')]===0x1f4){logger[_0xc7df('0x11')](_0xc7df('0x13'),_0x2d142c,_0x4c81f9['error'][_0xc7df('0x14')]);return _0x69cedb(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);}logger[_0xc7df('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2d142c,_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);return _0x491233(_0x4c81f9[_0xc7df('0x11')][_0xc7df('0x14')]);}else{logger[_0xc7df('0xd')](_0xc7df('0x13'),_0x2d142c,'request\x20sent');_0x491233(_0x4c81f9[_0xc7df('0x15')][_0xc7df('0x14')]);}})[_0xc7df('0x16')](function(_0x3c580b){logger['error'](_0xc7df('0x13'),_0x2d142c,_0x3c580b);_0x69cedb(_0x3c580b);});});} \ No newline at end of file +var _0xfbac=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfbac,0x167));var _0xcfba=function(_0x19d7ad,_0x185033){_0x19d7ad=_0x19d7ad-0x0;var _0x37b255=_0xfbac[_0x19d7ad];return _0x37b255;};'use strict';var _=require('lodash');var util=require(_0xcfba('0x0'));var moment=require(_0xcfba('0x1'));var BPromise=require(_0xcfba('0x2'));var rs=require(_0xcfba('0x3'));var fs=require('fs');var Redis=require(_0xcfba('0x4'));var db=require(_0xcfba('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfba('0x6'));var config=require(_0xcfba('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5af20d,_0x2ca4c6,_0x5b7669){return new BPromise(function(_0x15e8d6,_0x2c68cd){return client['request'](_0x5af20d,_0x5b7669)[_0xcfba('0x9')](function(_0xeae9f2){logger[_0xcfba('0xa')](_0xcfba('0xb'),_0x2ca4c6,_0xcfba('0xc'));logger[_0xcfba('0xd')](_0xcfba('0xe'),_0x2ca4c6,_0xcfba('0xc'),JSON[_0xcfba('0xf')](_0xeae9f2));if(_0xeae9f2[_0xcfba('0x10')]){if(_0xeae9f2[_0xcfba('0x10')][_0xcfba('0x11')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x2ca4c6,_0xeae9f2[_0xcfba('0x10')][_0xcfba('0x12')]);return _0x2c68cd(_0xeae9f2['error'][_0xcfba('0x12')]);}logger[_0xcfba('0x10')](_0xcfba('0xb'),_0x2ca4c6,_0xeae9f2[_0xcfba('0x10')][_0xcfba('0x12')]);return _0x15e8d6(_0xeae9f2[_0xcfba('0x10')][_0xcfba('0x12')]);}else{logger[_0xcfba('0xa')](_0xcfba('0xb'),_0x2ca4c6,_0xcfba('0xc'));_0x15e8d6(_0xeae9f2[_0xcfba('0x13')][_0xcfba('0x12')]);}})[_0xcfba('0x14')](function(_0x5bff45){logger[_0xcfba('0x10')](_0xcfba('0xb'),_0x2ca4c6,_0x5bff45);_0x2c68cd(_0x5bff45);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c03a6bb..0f946bd 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 _0x4f54=['isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller'];(function(_0x23e387,_0x43ce11){var _0x301d0d=function(_0x51b6bd){while(--_0x51b6bd){_0x23e387['push'](_0x23e387['shift']());}};_0x301d0d(++_0x43ce11);}(_0x4f54,0xbb));var _0x44f5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4f54[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x44f5('0x0'));var util=require('util');var path=require(_0x44f5('0x1'));var timeout=require(_0x44f5('0x2'));var express=require(_0x44f5('0x3'));var router=express['Router']();var fs_extra=require(_0x44f5('0x4'));var auth=require(_0x44f5('0x5'));var interaction=require(_0x44f5('0x6'));var config=require(_0x44f5('0x7'));var controller=require(_0x44f5('0x8'));router['get']('/',auth[_0x44f5('0x9')](),controller[_0x44f5('0xa')]);router[_0x44f5('0xb')](_0x44f5('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x44f5('0xb')](_0x44f5('0xd'),auth[_0x44f5('0x9')](),controller[_0x44f5('0xe')]);router[_0x44f5('0xb')](_0x44f5('0xf'),auth[_0x44f5('0x9')](),controller[_0x44f5('0x10')]);router[_0x44f5('0xb')](_0x44f5('0x11'),controller[_0x44f5('0x12')]);router[_0x44f5('0xb')](_0x44f5('0x13'),auth[_0x44f5('0x9')](),controller[_0x44f5('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x44f5('0x15')]);router[_0x44f5('0x16')]('/:id/transcribe',auth[_0x44f5('0x9')](),controller[_0x44f5('0x17')]);router[_0x44f5('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x44f5('0x19')]);router[_0x44f5('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x44f5('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xef79=['/describe','isAuthenticated','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x20b300,_0x177644){var _0x4ddd99=function(_0x333e74){while(--_0x333e74){_0x20b300['push'](_0x20b300['shift']());}};_0x4ddd99(++_0x177644);}(_0xef79,0x155));var _0x9ef7=function(_0x1407c1,_0x46d5e8){_0x1407c1=_0x1407c1-0x0;var _0x2ad224=_0xef79[_0x1407c1];return _0x2ad224;};'use strict';var multer=require(_0x9ef7('0x0'));var util=require('util');var path=require(_0x9ef7('0x1'));var timeout=require(_0x9ef7('0x2'));var express=require(_0x9ef7('0x3'));var router=express['Router']();var fs_extra=require(_0x9ef7('0x4'));var auth=require(_0x9ef7('0x5'));var interaction=require(_0x9ef7('0x6'));var config=require(_0x9ef7('0x7'));var controller=require('./voiceRecording.controller');router[_0x9ef7('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ef7('0x9')]);router['get'](_0x9ef7('0xa'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0xc')]);router[_0x9ef7('0x8')](_0x9ef7('0xd'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0xe')]);router[_0x9ef7('0x8')](_0x9ef7('0xf'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0x10')]);router['get'](_0x9ef7('0x11'),controller[_0x9ef7('0x12')]);router[_0x9ef7('0x8')](_0x9ef7('0x13'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0x14')]);router[_0x9ef7('0x15')]('/',auth[_0x9ef7('0xb')](),controller['create']);router[_0x9ef7('0x15')](_0x9ef7('0x13'),auth['isAuthenticated'](),controller[_0x9ef7('0x16')]);router['put'](_0x9ef7('0xd'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0x17')]);router[_0x9ef7('0x18')](_0x9ef7('0xd'),auth[_0x9ef7('0xb')](),controller[_0x9ef7('0x19')]);module[_0x9ef7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index eca0fb6..5ea7a99 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(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 6437261..a0ab465 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 _0x35dc=['count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','show','find','body','params','catch','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','../../components/encryptor','sequelize','col','token','$and','push','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','language','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','offset'];(function(_0x2f2b39,_0x246213){var _0x3cc553=function(_0x4650d6){while(--_0x4650d6){_0x2f2b39['push'](_0x2f2b39['shift']());}};_0x3cc553(++_0x246213);}(_0x35dc,0x7a));var _0xc35d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x35dc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc35d('0x0'));var rimraf=require(_0xc35d('0x1'));var zipdir=require(_0xc35d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc35d('0x3'));var Mustache=require(_0xc35d('0x4'));var util=require(_0xc35d('0x5'));var path=require('path');var sox=require(_0xc35d('0x6'));var csv=require('to-csv');var ejs=require(_0xc35d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc35d('0x8'));var crypto=require('crypto');var jsforce=require(_0xc35d('0x9'));var deskjs=require(_0xc35d('0xa'));var toCsv=require(_0xc35d('0xb'));var querystring=require(_0xc35d('0xc'));var Papa=require(_0xc35d('0xd'));var AWS=require(_0xc35d('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0xc35d('0xf'));var authService=require(_0xc35d('0x10'));var qs=require(_0xc35d('0x11'));var as=require(_0xc35d('0x12'));var hardwareService=require(_0xc35d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc35d('0x14'));var config=require(_0xc35d('0x15'));var licenseUtil=require(_0xc35d('0x16'));var db=require(_0xc35d('0x17'))['db'];function respondWithStatusCode(_0x859f73,_0x4d4c6f){_0x4d4c6f=_0x4d4c6f||0xcc;return function(_0x2638b9){if(_0x2638b9){return _0x859f73[_0xc35d('0x18')](_0x4d4c6f);}return _0x859f73[_0xc35d('0x19')](_0x4d4c6f)[_0xc35d('0x1a')]();};}function respondWithResult(_0x295812,_0x40052c){_0x40052c=_0x40052c||0xc8;return function(_0x3697e9){if(_0x3697e9){return _0x295812['status'](_0x40052c)['json'](_0x3697e9);}};}function respondWithFilteredResult(_0xb10687,_0x3ee8c0){return function(_0x466b96){if(_0x466b96){var _0x823bfb=typeof _0x3ee8c0['offset']===_0xc35d('0x1b')&&typeof _0x3ee8c0['limit']===_0xc35d('0x1b');var _0x1da54a=_0x466b96['count'];var _0x118810=_0x823bfb?0x0:_0x3ee8c0[_0xc35d('0x1c')];var _0x333e08=_0x823bfb?_0x466b96[_0xc35d('0x1d')]:_0x3ee8c0[_0xc35d('0x1c')]+_0x3ee8c0[_0xc35d('0x1e')];var _0x24fe57;if(_0x333e08>=_0x1da54a){_0x333e08=_0x1da54a;_0x24fe57=0xc8;}else{_0x24fe57=0xce;}_0xb10687[_0xc35d('0x19')](_0x24fe57);return _0xb10687[_0xc35d('0x1f')](_0xc35d('0x20'),_0x118810+'-'+_0x333e08+'/'+_0x1da54a)[_0xc35d('0x21')](_0x466b96);}return null;};}function patchUpdates(_0x48db43){return function(_0x60583e){try{jsonpatch[_0xc35d('0x22')](_0x60583e,_0x48db43,!![]);}catch(_0x332f19){return BPromise[_0xc35d('0x23')](_0x332f19);}return _0x60583e['save']();};}function saveUpdates(_0x1311a6,_0x31909a){return function(_0x3e180a){if(_0x3e180a){return _0x3e180a[_0xc35d('0x24')](_0x1311a6)[_0xc35d('0x25')](function(_0x3dd5db){return _0x3dd5db;});}return null;};}function removeEntity(_0x1d9066,_0x1dbf65){return function(_0x4a67ef){if(_0x4a67ef){return _0x4a67ef[_0xc35d('0x26')]()['then'](function(){_0x1d9066['status'](0xcc)[_0xc35d('0x1a')]();});}};}function handleEntityNotFound(_0x422ee7,_0x2cd3c0){return function(_0x18395c){if(!_0x18395c){_0x422ee7[_0xc35d('0x18')](0x194);}return _0x18395c;};}function handleError(_0x22cc7b,_0x4b6404){_0x4b6404=_0x4b6404||0x1f4;return function(_0x2e63e2){logger[_0xc35d('0x27')](_0x2e63e2['stack']);if(_0x2e63e2[_0xc35d('0x28')]){delete _0x2e63e2[_0xc35d('0x28')];}_0x22cc7b[_0xc35d('0x19')](_0x4b6404)[_0xc35d('0x29')](_0x2e63e2);};}exports[_0xc35d('0x2a')]=function(_0x492c3d,_0x27d793){var _0x4c7ae2={},_0x545b25={},_0x444d52={'count':0x0,'rows':[]};var _0x4962c2=_[_0xc35d('0x2b')](db[_0xc35d('0x2c')][_0xc35d('0x2d')],function(_0x10e3b0){return{'name':_0x10e3b0[_0xc35d('0x2e')],'type':_0x10e3b0[_0xc35d('0x2f')][_0xc35d('0x30')]};});_0x545b25['model']=_[_0xc35d('0x31')](_[_0xc35d('0x2b')](_0x4962c2,_0xc35d('0x28')),['format']);_0x545b25[_0xc35d('0x32')]=_[_0xc35d('0x33')](_0x492c3d[_0xc35d('0x32')]);_0x545b25[_0xc35d('0x34')]=_[_0xc35d('0x35')](_0x545b25[_0xc35d('0x36')],_0x545b25[_0xc35d('0x32')]);_0x4c7ae2[_0xc35d('0x37')]=_[_0xc35d('0x35')](_0x545b25[_0xc35d('0x36')],qs[_0xc35d('0x38')](_0x492c3d[_0xc35d('0x32')]['fields']));_0x4c7ae2[_0xc35d('0x37')]=_0x4c7ae2[_0xc35d('0x37')][_0xc35d('0x39')]?_0x4c7ae2[_0xc35d('0x37')]:_0x545b25[_0xc35d('0x36')];if(!_0x492c3d['query']['hasOwnProperty'](_0xc35d('0x3a'))){_0x4c7ae2[_0xc35d('0x1e')]=qs['limit'](_0x492c3d[_0xc35d('0x32')][_0xc35d('0x1e')]);_0x4c7ae2[_0xc35d('0x1c')]=qs[_0xc35d('0x1c')](_0x492c3d[_0xc35d('0x32')][_0xc35d('0x1c')]);}_0x4c7ae2['order']=qs[_0xc35d('0x3b')](_0x492c3d['query']['sort']);_0x4c7ae2[_0xc35d('0x3c')]=qs[_0xc35d('0x34')](_[_0xc35d('0x3d')](_0x492c3d[_0xc35d('0x32')],_0x545b25[_0xc35d('0x34')]),_0x4962c2);if(_0x492c3d[_0xc35d('0x32')]['filter']){_0x4c7ae2[_0xc35d('0x3c')]=_[_0xc35d('0x3e')](_0x4c7ae2[_0xc35d('0x3c')],{'$or':_[_0xc35d('0x2b')](_0x4962c2,function(_0x2dcbfb){if(_0x2dcbfb[_0xc35d('0x2f')]!==_0xc35d('0x3f')){var _0x4cd256={};_0x4cd256[_0x2dcbfb[_0xc35d('0x28')]]={'$like':'%'+_0x492c3d['query'][_0xc35d('0x40')]+'%'};return _0x4cd256;}})});}_0x4c7ae2=_[_0xc35d('0x3e')]({},_0x4c7ae2,_0x492c3d[_0xc35d('0x41')]);var _0x373584={'where':_0x4c7ae2[_0xc35d('0x3c')]};return db[_0xc35d('0x2c')]['count'](_0x373584)['then'](function(_0x3a8c31){_0x444d52[_0xc35d('0x1d')]=_0x3a8c31;if(_0x492c3d['query'][_0xc35d('0x42')]){_0x4c7ae2['include']=[{'all':!![]}];}return db[_0xc35d('0x2c')]['findAll'](_0x4c7ae2);})[_0xc35d('0x25')](function(_0x5b694c){_0x444d52[_0xc35d('0x43')]=_0x5b694c;return _0x444d52;})['then'](respondWithFilteredResult(_0x27d793,_0x4c7ae2))['catch'](handleError(_0x27d793,null));};exports[_0xc35d('0x44')]=function(_0x183713,_0x250a5f){var _0xd0e38d={'raw':![],'where':{'id':_0x183713['params']['id']}},_0x3853de={};_0x3853de['model']=_['keys'](db['VoiceRecording']['rawAttributes']);_0x3853de[_0xc35d('0x32')]=_[_0xc35d('0x33')](_0x183713[_0xc35d('0x32')]);_0x3853de[_0xc35d('0x34')]=_[_0xc35d('0x35')](_0x3853de[_0xc35d('0x36')],_0x3853de[_0xc35d('0x32')]);_0xd0e38d[_0xc35d('0x37')]=_['intersection'](_0x3853de[_0xc35d('0x36')],qs['fields'](_0x183713[_0xc35d('0x32')]['fields']));_0xd0e38d[_0xc35d('0x37')]=_0xd0e38d['attributes'][_0xc35d('0x39')]?_0xd0e38d[_0xc35d('0x37')]:_0x3853de[_0xc35d('0x36')];if(_0x183713[_0xc35d('0x32')][_0xc35d('0x42')]){_0xd0e38d['include']=[{'all':!![]}];}_0xd0e38d=_[_0xc35d('0x3e')]({},_0xd0e38d,_0x183713[_0xc35d('0x41')]);return db[_0xc35d('0x2c')][_0xc35d('0x45')](_0xd0e38d)[_0xc35d('0x25')](handleEntityNotFound(_0x250a5f,null))[_0xc35d('0x25')](respondWithResult(_0x250a5f,null))['catch'](handleError(_0x250a5f,null));};exports['create']=function(_0x337de8,_0x530687){return db['VoiceRecording']['create'](_0x337de8[_0xc35d('0x46')],{})[_0xc35d('0x25')](respondWithResult(_0x530687,0xc9))['catch'](handleError(_0x530687,null));};exports[_0xc35d('0x24')]=function(_0x386424,_0x3f7acb){if(_0x386424[_0xc35d('0x46')]['id']){delete _0x386424[_0xc35d('0x46')]['id'];}return db[_0xc35d('0x2c')][_0xc35d('0x45')]({'where':{'id':_0x386424[_0xc35d('0x47')]['id']}})[_0xc35d('0x25')](handleEntityNotFound(_0x3f7acb,null))[_0xc35d('0x25')](saveUpdates(_0x386424[_0xc35d('0x46')],null))['then'](respondWithResult(_0x3f7acb,null))[_0xc35d('0x48')](handleError(_0x3f7acb,null));};exports['describe']=function(_0x8d7c3d,_0x34f038){return db['VoiceRecording']['describe']()['then'](respondWithResult(_0x34f038,null))[_0xc35d('0x48')](handleError(_0x34f038,null));};exports[_0xc35d('0x49')]=function(_0x4e95be,_0xd711b0,_0x521fd9){var _0x1d4db8=require('../../components/encryptor');var _0x48c13b=![];var _0x24efd9={};if(_0x4e95be[_0xc35d('0x32')][_0xc35d('0x2f')]&&_0x4e95be[_0xc35d('0x32')]['type']==='uniqueid'){_0x24efd9[_0xc35d('0x4a')]=_0x4e95be[_0xc35d('0x47')]['id'];}else{_0x24efd9['id']=_0x4e95be['params']['id'];}return db[_0xc35d('0x2c')][_0xc35d('0x45')]({'where':_0x24efd9,'attributes':['id',_0xc35d('0x4b')],'raw':!![]})[_0xc35d('0x25')](handleEntityNotFound(_0xd711b0,null))[_0xc35d('0x25')](function(_0x182643){if(_0x182643){var _0x214031=_0x182643[_0xc35d('0x4b')];var _0x186e8b=util[_0xc35d('0x4c')](_0xc35d('0x4d'),_0x214031);if(fs[_0xc35d('0x4e')](_0x186e8b)){_0x48c13b=!![];return _0x1d4db8[_0xc35d('0x4f')](_0x186e8b,_0x214031,config[_0xc35d('0x50')][_0xc35d('0x51')])['then'](function(){return _0x182643;});}return _0x182643;}})[_0xc35d('0x25')](function(_0x174549){if(_0x174549){var _0x1206d9=_0x174549[_0xc35d('0x4b')];if(!fs[_0xc35d('0x4e')](_0x1206d9)){throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))](_0xc35d('0x54'));}if(_0x174549[_0xc35d('0x55')]){return _0xd711b0[_0xc35d('0x49')](_0x1206d9,_0x174549['filename']+path[_0xc35d('0x56')](_0x1206d9),function(){if(_0x48c13b){fs[_0xc35d('0x57')](_0x1206d9);}});}else{return _0xd711b0[_0xc35d('0x49')](_0x1206d9,function(_0x4b33b1){if(_0x48c13b){fs[_0xc35d('0x57')](_0x1206d9);}});}}})[_0xc35d('0x48')](function(_0x37f116){if(_0x37f116[_0xc35d('0x58')]===_0xc35d('0x54')){_0xd711b0['status'](0x194)[_0xc35d('0x29')](_0xc35d('0x59'));}else{return handleError(_0xd711b0,null);}});};exports[_0xc35d('0x5a')]=function(_0xc71ac5,_0x4cb83e,_0x4d0ddf){var _0x1172db=require(_0xc35d('0x5b'));var _0xfdfef4=![];var _0x3e661a={'$and':[db[_0xc35d('0x5c')][_0xc35d('0x3c')](db[_0xc35d('0x5c')]['fn']('MD5',db[_0xc35d('0x5c')][_0xc35d('0x5d')](_0xc35d('0x4a'))),_0xc71ac5[_0xc35d('0x32')][_0xc35d('0x5e')])]};if(_0xc71ac5[_0xc35d('0x32')][_0xc35d('0x2f')]&&_0xc71ac5['query'][_0xc35d('0x2f')]===_0xc35d('0x4a')){_0x3e661a[_0xc35d('0x5f')]['push']({'uniqueid':_0xc71ac5[_0xc35d('0x47')]['id']});}else{_0x3e661a['$and'][_0xc35d('0x60')]({'id':_0xc71ac5[_0xc35d('0x47')]['id']});}return db[_0xc35d('0x2c')][_0xc35d('0x45')]({'where':_0x3e661a,'attributes':['id','value'],'raw':!![]})[_0xc35d('0x25')](handleEntityNotFound(_0x4cb83e,null))[_0xc35d('0x25')](function(_0x6c0418){if(_0x6c0418){var _0x215c28=util[_0xc35d('0x4c')](_0xc35d('0x4d'),_0x6c0418[_0xc35d('0x4b')]);if(fs[_0xc35d('0x4e')](_0x215c28)){_0xfdfef4=!![];return _0x1172db[_0xc35d('0x4f')](_0x215c28,_0x6c0418[_0xc35d('0x4b')],config['secrets'][_0xc35d('0x51')])[_0xc35d('0x25')](function(){return _0x6c0418;});}return _0x6c0418;}})[_0xc35d('0x25')](function(_0x16163c){if(_0x16163c){if(!fs['existsSync'](_0x16163c['value'])){throw new db['Sequelize'][(_0xc35d('0x53'))](_0xc35d('0x54'));}if(_0x16163c[_0xc35d('0x55')]){return _0x4cb83e[_0xc35d('0x49')](_0x16163c[_0xc35d('0x4b')],_0x16163c[_0xc35d('0x55')]+path['extname'](_0x16163c['value']),function(){if(_0xfdfef4){fs[_0xc35d('0x57')](_0x16163c[_0xc35d('0x4b')]);}});}else{return _0x4cb83e[_0xc35d('0x49')](_0x16163c['value'],function(_0x504d59){if(_0xfdfef4){fs[_0xc35d('0x57')](_0x16163c[_0xc35d('0x4b')]);}});}}})[_0xc35d('0x48')](handleError(_0x4cb83e,null));};exports[_0xc35d('0x26')]=function(_0x4ed9a,_0x236462){return db[_0xc35d('0x2c')][_0xc35d('0x45')]({'where':{'id':_0x4ed9a[_0xc35d('0x47')]['id']}})[_0xc35d('0x25')](function(_0x52569b){if(_[_0xc35d('0x61')](_0x52569b)){throw new ReferenceError(_0xc35d('0x62'));}return _0x52569b;})['then'](function(_0x5cdc5a){var _0x92a393=_0x5cdc5a[_0xc35d('0x4b')];logger[_0xc35d('0x63')](_0xc35d('0x64'),_0x92a393);if(!_[_0xc35d('0x61')](_0x5cdc5a[_0xc35d('0x4b')])&&fs[_0xc35d('0x4e')](_0x92a393)){logger[_0xc35d('0x63')](_0xc35d('0x65')+_0x92a393+_0xc35d('0x66'));fs[_0xc35d('0x67')](_0x92a393);}_0x92a393=_0x92a393+'.cypher';if(!_[_0xc35d('0x61')](_0x5cdc5a[_0xc35d('0x4b')])&&fs[_0xc35d('0x4e')](_0x92a393)){logger[_0xc35d('0x63')]('File:\x20\x22'+_0x92a393+_0xc35d('0x66'));fs['unlinkSync'](_0x92a393);}return _0x5cdc5a;})['then'](function(_0x5e92cd){if(!_0x5e92cd)throw new InternalError();return _0x5e92cd[_0xc35d('0x26')]();})[_0xc35d('0x25')](function(){_0x236462[_0xc35d('0x19')](0xcc)[_0xc35d('0x1a')]();})[_0xc35d('0x48')](handleError(_0x236462,null));};function getBucketslist(_0x4370ab,_0x3171d6,_0x50b7ec){return new Promise(function(_0x404a9f,_0x8afa2f){var _0x441584=new AWS['S3']({'accessKeyId':_0x3171d6,'secretAccessKey':_0x4370ab,'region':_0x50b7ec});_0x441584[_0xc35d('0x68')]({},function(_0x221758,_0x4b8c11){if(_0x221758){return _0x8afa2f(_0x221758);}else{return _0x404a9f(_0x4b8c11);}});});}function createBucket(_0x525651,_0x367a7d,_0x239e57,_0xe02dc5){return new Promise(function(_0x4502f5,_0x104643){var _0x315549=new AWS['S3']({'accessKeyId':_0x367a7d,'secretAccessKey':_0x525651,'region':_0x239e57});_0x315549[_0xc35d('0x69')]({'Bucket':_0xe02dc5},function(_0x2ddb8d,_0xbc91d9){if(_0x2ddb8d){return _0x104643(_0x2ddb8d);}else{return _0x4502f5(_0xbc91d9);}});});}function uploadFile(_0x14a8e1,_0x5d56e7,_0x20add3,_0x4e726b,_0x24a078,_0x50918b){return new Promise(function(_0x4d68d0,_0x309a41){var _0x5a7559=new AWS['S3']({'accessKeyId':_0x5d56e7,'secretAccessKey':_0x14a8e1,'region':_0x20add3});_0x5a7559[_0xc35d('0x6a')]({'Bucket':_0x4e726b,'Key':_0x24a078,'Body':_0x50918b},function(_0x2a0e34,_0x4779be){if(_0x2a0e34){return _0x309a41(_0x2a0e34);}else{return _0x4d68d0(_0x4779be);}});});}function startTranscribe(_0x13eacf,_0x38a3ba,_0x2da637,_0x15bc9b,_0x274029,_0x2c23bf){return new Promise(function(_0x1d75fb,_0x31115c){var _0x29180d=new AWS[(_0xc35d('0x6b'))]({'accessKeyId':_0x38a3ba,'secretAccessKey':_0x13eacf,'region':_0x2da637});_0x29180d[_0xc35d('0x6c')]({'TranscriptionJobName':_0x15bc9b,'LanguageCode':_0x274029,'Media':{'MediaFileUri':_0x2c23bf}},function(_0x25c172,_0x197ce7){if(_0x25c172){return _0x31115c(_0x25c172);}else{return _0x1d75fb(_0x197ce7);}});});}function transcribe(_0x594429,_0x428643,_0x4c485f,_0x2c9741,_0x55b195,_0x2744d6,_0x30b82a){return new Promise(function(_0x272f1b,_0x48e86a){var _0x502706={};logger[_0xc35d('0x63')](util[_0xc35d('0x4c')](_0xc35d('0x6d'),_0x594429,_0x55b195));return uploadFile(_0x428643,_0x4c485f,_0x2c9741,_0x55b195,path[_0xc35d('0x6e')](_0x2744d6),fs[_0xc35d('0x6f')](_0x2744d6))[_0xc35d('0x25')](function(_0x2d540d){logger[_0xc35d('0x63')](util['format'](_0xc35d('0x70'),_0x594429,_0x55b195,_0x2d540d[_0xc35d('0x71')]));_0x502706[_0xc35d('0x72')]=_0x2d540d[_0xc35d('0x73')];_0x502706['location']=_0x2d540d[_0xc35d('0x71')];logger['info'](util['format'](_0xc35d('0x74'),_0x594429));return startTranscribe(_0x428643,_0x4c485f,_0x2c9741,uuidv4(),_0x30b82a,_0x2d540d[_0xc35d('0x71')]);})[_0xc35d('0x25')](function(_0x366301){logger['info'](util[_0xc35d('0x4c')](_0xc35d('0x75'),_0x594429,_0x366301[_0xc35d('0x76')][_0xc35d('0x77')]));_0x502706['transcribeName']=_0x366301['TranscriptionJob'][_0xc35d('0x77')];_0x502706[_0xc35d('0x78')]=_0x366301[_0xc35d('0x76')][_0xc35d('0x79')];return _0x272f1b(_0x502706);})[_0xc35d('0x48')](function(_0xd369cc){return _0x48e86a(_0xd369cc);});});}exports[_0xc35d('0x7a')]=function(_0x9182e8,_0x2f8e04,_0x40b31b){var _0x143424;var _0x4bf7e6;var _0x477193;var _0x279ca1=require(_0xc35d('0x5b'));return db[_0xc35d('0x2c')][_0xc35d('0x7b')]({'where':{'id':_0x9182e8[_0xc35d('0x47')]['id']}})[_0xc35d('0x25')](function(_0x3463b6){if(_0x3463b6){var _0xf97e97=util['format'](_0xc35d('0x4d'),_0x3463b6[_0xc35d('0x4b')]);if(fs[_0xc35d('0x4e')](_0xf97e97)){cypher=!![];return _0x279ca1[_0xc35d('0x4f')](_0xf97e97,_0x3463b6[_0xc35d('0x4b')],config[_0xc35d('0x50')]['recording'])[_0xc35d('0x25')](function(){return _0x3463b6;});}return _0x3463b6;}})[_0xc35d('0x25')](function(_0x550fd6){if(!_0x550fd6){throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))]('Voice\x20Recording\x20not\x20found');}_0x4bf7e6=_0x550fd6;return db[_0xc35d('0x7c')][_0xc35d('0x7b')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2f8e04,null))[_0xc35d('0x25')](function(_0x3e8165){if(_0x3e8165){_0x143424=_0x3e8165;if(!_0x143424[_0xc35d('0x7d')]||!_0x143424[_0xc35d('0x7e')]||!_0x143424['transcribeRegion']||!_0x143424['language']||!_0x143424[_0xc35d('0x72')]){throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))](_0xc35d('0x7f'));}if(_0x9182e8['body'][_0xc35d('0x80')]&&(!_0x143424[_0xc35d('0x81')]||!_0x143424[_0xc35d('0x82')]||!_0x143424[_0xc35d('0x83')]||!_0x143424['language']||!_0x143424['bucket'])){throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xc35d('0x84')][_0xc35d('0x7b')]({'where':{'id':_0x143424['transcribeAccountId']}});}})['then'](function(_0x4a4b76){if(!_0x4a4b76){throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4a4b76[_0xc35d('0x85')]||!_0x4a4b76[_0xc35d('0x86')]){throw new db[(_0xc35d('0x52'))]['ValidationError'](_0xc35d('0x87'));}_0x477193=_0x4a4b76;return getBucketslist(_0x477193[_0xc35d('0x85')],_0x477193['data2'],_0x143424[_0xc35d('0x88')]);})['then'](function(_0x273b18){if(_0x273b18&&_0x273b18['Buckets']){var _0x8ff705=_[_0xc35d('0x45')](_0x273b18[_0xc35d('0x89')],function(_0x2699ee){return _0x2699ee['Name']===_0x143424[_0xc35d('0x72')];});if(!_0x8ff705){logger[_0xc35d('0x63')](util[_0xc35d('0x4c')](_0xc35d('0x8a'),_0x9182e8[_0xc35d('0x47')]['id'],_0x143424[_0xc35d('0x72')]));return createBucket(_0x477193[_0xc35d('0x85')],_0x477193[_0xc35d('0x86')],_0x143424['transcribeRegion'],_0x143424[_0xc35d('0x72')]);}logger['info'](util[_0xc35d('0x4c')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x9182e8[_0xc35d('0x47')]['id'],_0x143424[_0xc35d('0x72')]));return;}})[_0xc35d('0x25')](function(_0x467d87){if(_0x4bf7e6[_0xc35d('0x78')]===_0xc35d('0x8b')){return transcribe(_0x9182e8[_0xc35d('0x47')]['id'],_0x477193[_0xc35d('0x85')],_0x477193[_0xc35d('0x86')],_0x143424[_0xc35d('0x88')],_0x143424[_0xc35d('0x72')],_0x4bf7e6[_0xc35d('0x4b')],_0x143424[_0xc35d('0x8c')]);}else{logger[_0xc35d('0x63')](util['format'](_0xc35d('0x8d'),_0x9182e8[_0xc35d('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x1af42a){if(_0x1af42a){_0x1af42a[_0xc35d('0x8e')]=_0x9182e8[_0xc35d('0x46')]['runSentiment'];return _0x4bf7e6[_0xc35d('0x8f')](_0x1af42a);}})[_0xc35d('0x25')](respondWithResult(_0x2f8e04,null))[_0xc35d('0x48')](handleError(_0x2f8e04,null));};function writeFile(_0x4389e0,_0x22d759){return new Promise(function(_0x599fd5,_0x2170fd){fs[_0xc35d('0x90')](_0x22d759,_0x4389e0,function(_0x3f9676,_0x228d4b){if(_0x3f9676){return _0x2170fd(_0x3f9676);}else{return _0x599fd5(_0x228d4b);}});});}exports[_0xc35d('0x91')]=function(_0x25db94,_0x35ab37,_0x16114b){return db[_0xc35d('0x2c')][_0xc35d('0x7b')]({'where':{'id':_0x25db94[_0xc35d('0x47')]['id']}})['then'](handleEntityNotFound(_0x35ab37))[_0xc35d('0x25')](function(_0x61279c){if(_0x61279c&&_0x61279c['fileText']){var _0x544632=_0x61279c[_0xc35d('0x92')];var _0x4ba255=config[_0xc35d('0x93')]+_0xc35d('0x94')+_0x61279c['id']+_0xc35d('0x95');if(fs['existsSync'](_0x4ba255)){return _0x4ba255;}return writeFile(_0x544632,_0x4ba255)[_0xc35d('0x25')](function(){return _0x4ba255;});}else{throw new db[(_0xc35d('0x52'))][(_0xc35d('0x53'))](_0xc35d('0x96'));}})[_0xc35d('0x25')](function(_0x46ea34){return _0x35ab37[_0xc35d('0x49')](_0x46ea34);})[_0xc35d('0x48')](handleError(_0x35ab37));}; \ No newline at end of file +var _0x2a77=['sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','writeFile','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','lodash','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','offset','undefined','count','set','Content-Range','reject','save','update','then','status','end','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','recording','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment'];(function(_0x11b579,_0x120d5a){var _0x3d9ee4=function(_0x13d470){while(--_0x13d470){_0x11b579['push'](_0x11b579['shift']());}};_0x3d9ee4(++_0x120d5a);}(_0x2a77,0xa9));var _0x72a7=function(_0x40a0a4,_0x5d30d0){_0x40a0a4=_0x40a0a4-0x0;var _0x50cc17=_0x2a77[_0x40a0a4];return _0x50cc17;};'use strict';var emlformat=require(_0x72a7('0x0'));var rimraf=require(_0x72a7('0x1'));var zipdir=require(_0x72a7('0x2'));var jsonpatch=require(_0x72a7('0x3'));var rp=require(_0x72a7('0x4'));var moment=require(_0x72a7('0x5'));var BPromise=require(_0x72a7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x72a7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72a7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x72a7('0x9'));var toCsv=require('to-csv');var querystring=require(_0x72a7('0xa'));var Papa=require(_0x72a7('0xb'));var AWS=require(_0x72a7('0xc'));var uuidv4=require(_0x72a7('0xd'));var Redis=require(_0x72a7('0xe'));var authService=require(_0x72a7('0xf'));var qs=require(_0x72a7('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x72a7('0x11'));var config=require(_0x72a7('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a7('0x13'))['db'];function respondWithStatusCode(_0x1baa38,_0x330e21){_0x330e21=_0x330e21||0xcc;return function(_0x211e3e){if(_0x211e3e){return _0x1baa38[_0x72a7('0x14')](_0x330e21);}return _0x1baa38['status'](_0x330e21)['end']();};}function respondWithResult(_0x5dfc44,_0xae82a){_0xae82a=_0xae82a||0xc8;return function(_0x2c4fe1){if(_0x2c4fe1){return _0x5dfc44['status'](_0xae82a)['json'](_0x2c4fe1);}};}function respondWithFilteredResult(_0x463b88,_0x2919df){return function(_0x1d3722){if(_0x1d3722){var _0x5be93f=typeof _0x2919df[_0x72a7('0x15')]===_0x72a7('0x16')&&typeof _0x2919df['limit']===_0x72a7('0x16');var _0x9f27a1=_0x1d3722['count'];var _0x3bbf7a=_0x5be93f?0x0:_0x2919df[_0x72a7('0x15')];var _0xbe432f=_0x5be93f?_0x1d3722[_0x72a7('0x17')]:_0x2919df[_0x72a7('0x15')]+_0x2919df['limit'];var _0x337a1a;if(_0xbe432f>=_0x9f27a1){_0xbe432f=_0x9f27a1;_0x337a1a=0xc8;}else{_0x337a1a=0xce;}_0x463b88['status'](_0x337a1a);return _0x463b88[_0x72a7('0x18')](_0x72a7('0x19'),_0x3bbf7a+'-'+_0xbe432f+'/'+_0x9f27a1)['json'](_0x1d3722);}return null;};}function patchUpdates(_0x1b19da){return function(_0x55bca7){try{jsonpatch['apply'](_0x55bca7,_0x1b19da,!![]);}catch(_0x5944a7){return BPromise[_0x72a7('0x1a')](_0x5944a7);}return _0x55bca7[_0x72a7('0x1b')]();};}function saveUpdates(_0x1f57e4,_0x5376bb){return function(_0x3ed298){if(_0x3ed298){return _0x3ed298[_0x72a7('0x1c')](_0x1f57e4)[_0x72a7('0x1d')](function(_0x439eaf){return _0x439eaf;});}return null;};}function removeEntity(_0x2e9480,_0x57a21c){return function(_0x30496d){if(_0x30496d){return _0x30496d['destroy']()[_0x72a7('0x1d')](function(){_0x2e9480[_0x72a7('0x1e')](0xcc)[_0x72a7('0x1f')]();});}};}function handleEntityNotFound(_0x5dc321,_0x142777){return function(_0x105358){if(!_0x105358){_0x5dc321[_0x72a7('0x14')](0x194);}return _0x105358;};}function handleError(_0x5da7c3,_0x52b566){_0x52b566=_0x52b566||0x1f4;return function(_0x57eec5){logger['error'](_0x57eec5[_0x72a7('0x20')]);if(_0x57eec5[_0x72a7('0x21')]){delete _0x57eec5[_0x72a7('0x21')];}_0x5da7c3[_0x72a7('0x1e')](_0x52b566)[_0x72a7('0x22')](_0x57eec5);};}exports[_0x72a7('0x23')]=function(_0x191833,_0x2d4503){var _0xe3c6d3={},_0x279339={},_0x1a0294={'count':0x0,'rows':[]};var _0x1d80c3=_[_0x72a7('0x24')](db[_0x72a7('0x25')][_0x72a7('0x26')],function(_0x7441){return{'name':_0x7441[_0x72a7('0x27')],'type':_0x7441[_0x72a7('0x28')][_0x72a7('0x29')]};});_0x279339[_0x72a7('0x2a')]=_[_0x72a7('0x2b')](_[_0x72a7('0x24')](_0x1d80c3,'name'),[_0x72a7('0x2c')]);_0x279339[_0x72a7('0x2d')]=_[_0x72a7('0x2e')](_0x191833[_0x72a7('0x2d')]);_0x279339[_0x72a7('0x2f')]=_[_0x72a7('0x30')](_0x279339['model'],_0x279339[_0x72a7('0x2d')]);_0xe3c6d3[_0x72a7('0x31')]=_[_0x72a7('0x30')](_0x279339[_0x72a7('0x2a')],qs[_0x72a7('0x32')](_0x191833[_0x72a7('0x2d')]['fields']));_0xe3c6d3[_0x72a7('0x31')]=_0xe3c6d3['attributes']['length']?_0xe3c6d3['attributes']:_0x279339['model'];if(!_0x191833[_0x72a7('0x2d')]['hasOwnProperty'](_0x72a7('0x33'))){_0xe3c6d3[_0x72a7('0x34')]=qs['limit'](_0x191833[_0x72a7('0x2d')]['limit']);_0xe3c6d3[_0x72a7('0x15')]=qs[_0x72a7('0x15')](_0x191833[_0x72a7('0x2d')]['offset']);}_0xe3c6d3[_0x72a7('0x35')]=qs['sort'](_0x191833['query'][_0x72a7('0x36')]);_0xe3c6d3[_0x72a7('0x37')]=qs[_0x72a7('0x2f')](_['pick'](_0x191833[_0x72a7('0x2d')],_0x279339['filters']),_0x1d80c3);if(_0x191833[_0x72a7('0x2d')]['filter']){_0xe3c6d3[_0x72a7('0x37')]=_['merge'](_0xe3c6d3[_0x72a7('0x37')],{'$or':_[_0x72a7('0x24')](_0x1d80c3,function(_0x3d7fcd){if(_0x3d7fcd[_0x72a7('0x28')]!==_0x72a7('0x38')){var _0xc95029={};_0xc95029[_0x3d7fcd['name']]={'$like':'%'+_0x191833[_0x72a7('0x2d')][_0x72a7('0x39')]+'%'};return _0xc95029;}})});}_0xe3c6d3=_[_0x72a7('0x3a')]({},_0xe3c6d3,_0x191833[_0x72a7('0x3b')]);var _0x423d2e={'where':_0xe3c6d3[_0x72a7('0x37')]};return db[_0x72a7('0x25')][_0x72a7('0x17')](_0x423d2e)['then'](function(_0x5aa74e){_0x1a0294['count']=_0x5aa74e;if(_0x191833[_0x72a7('0x2d')][_0x72a7('0x3c')]){_0xe3c6d3[_0x72a7('0x3d')]=[{'all':!![]}];}return db[_0x72a7('0x25')][_0x72a7('0x3e')](_0xe3c6d3);})[_0x72a7('0x1d')](function(_0x39d12b){_0x1a0294[_0x72a7('0x3f')]=_0x39d12b;return _0x1a0294;})[_0x72a7('0x1d')](respondWithFilteredResult(_0x2d4503,_0xe3c6d3))[_0x72a7('0x40')](handleError(_0x2d4503,null));};exports[_0x72a7('0x41')]=function(_0x5cd52c,_0x3a3ee2){var _0xbf38cf={'raw':![],'where':{'id':_0x5cd52c['params']['id']}},_0x1342c2={};_0x1342c2['model']=_['keys'](db[_0x72a7('0x25')][_0x72a7('0x26')]);_0x1342c2['query']=_['keys'](_0x5cd52c[_0x72a7('0x2d')]);_0x1342c2[_0x72a7('0x2f')]=_[_0x72a7('0x30')](_0x1342c2['model'],_0x1342c2[_0x72a7('0x2d')]);_0xbf38cf[_0x72a7('0x31')]=_[_0x72a7('0x30')](_0x1342c2['model'],qs[_0x72a7('0x32')](_0x5cd52c[_0x72a7('0x2d')][_0x72a7('0x32')]));_0xbf38cf['attributes']=_0xbf38cf[_0x72a7('0x31')][_0x72a7('0x42')]?_0xbf38cf['attributes']:_0x1342c2['model'];if(_0x5cd52c['query'][_0x72a7('0x3c')]){_0xbf38cf[_0x72a7('0x3d')]=[{'all':!![]}];}_0xbf38cf=_[_0x72a7('0x3a')]({},_0xbf38cf,_0x5cd52c[_0x72a7('0x3b')]);return db['VoiceRecording'][_0x72a7('0x43')](_0xbf38cf)[_0x72a7('0x1d')](handleEntityNotFound(_0x3a3ee2,null))[_0x72a7('0x1d')](respondWithResult(_0x3a3ee2,null))[_0x72a7('0x40')](handleError(_0x3a3ee2,null));};exports[_0x72a7('0x44')]=function(_0x379424,_0xf7e32d){return db['VoiceRecording'][_0x72a7('0x44')](_0x379424['body'],{})[_0x72a7('0x1d')](respondWithResult(_0xf7e32d,0xc9))['catch'](handleError(_0xf7e32d,null));};exports[_0x72a7('0x1c')]=function(_0xc80225,_0x2ad6b4){if(_0xc80225[_0x72a7('0x45')]['id']){delete _0xc80225[_0x72a7('0x45')]['id'];}return db['VoiceRecording'][_0x72a7('0x43')]({'where':{'id':_0xc80225[_0x72a7('0x46')]['id']}})[_0x72a7('0x1d')](handleEntityNotFound(_0x2ad6b4,null))[_0x72a7('0x1d')](saveUpdates(_0xc80225['body'],null))['then'](respondWithResult(_0x2ad6b4,null))[_0x72a7('0x40')](handleError(_0x2ad6b4,null));};exports[_0x72a7('0x47')]=function(_0x2201ad,_0x6b6352){return db[_0x72a7('0x25')]['describe']()[_0x72a7('0x1d')](respondWithResult(_0x6b6352,null))[_0x72a7('0x40')](handleError(_0x6b6352,null));};exports[_0x72a7('0x48')]=function(_0x26e2ad,_0x4cb3e9,_0x3bc835){var _0x2e0a2e=require(_0x72a7('0x49'));var _0x415b27=![];var _0x599006={};if(_0x26e2ad[_0x72a7('0x2d')][_0x72a7('0x28')]&&_0x26e2ad[_0x72a7('0x2d')][_0x72a7('0x28')]===_0x72a7('0x4a')){_0x599006[_0x72a7('0x4a')]=_0x26e2ad[_0x72a7('0x46')]['id'];}else{_0x599006['id']=_0x26e2ad[_0x72a7('0x46')]['id'];}return db[_0x72a7('0x25')][_0x72a7('0x43')]({'where':_0x599006,'attributes':['id',_0x72a7('0x4b')],'raw':!![]})[_0x72a7('0x1d')](handleEntityNotFound(_0x4cb3e9,null))['then'](function(_0x21de8e){if(_0x21de8e){var _0xefc921=_0x21de8e[_0x72a7('0x4b')];var _0x5ae4cc=util[_0x72a7('0x2c')]('%s.cypher',_0xefc921);if(fs[_0x72a7('0x4c')](_0x5ae4cc)){_0x415b27=!![];return _0x2e0a2e[_0x72a7('0x4d')](_0x5ae4cc,_0xefc921,config[_0x72a7('0x4e')]['recording'])['then'](function(){return _0x21de8e;});}return _0x21de8e;}})[_0x72a7('0x1d')](function(_0x32dca4){if(_0x32dca4){var _0x4b5a87=_0x32dca4[_0x72a7('0x4b')];if(!fs[_0x72a7('0x4c')](_0x4b5a87)){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x51'));}if(_0x32dca4['filename']){return _0x4cb3e9[_0x72a7('0x48')](_0x4b5a87,_0x32dca4[_0x72a7('0x52')]+path['extname'](_0x4b5a87),function(){if(_0x415b27){fs[_0x72a7('0x53')](_0x4b5a87);}});}else{return _0x4cb3e9[_0x72a7('0x48')](_0x4b5a87,function(_0x1b36d1){if(_0x415b27){fs[_0x72a7('0x53')](_0x4b5a87);}});}}})[_0x72a7('0x40')](function(_0x238911){if(_0x238911[_0x72a7('0x54')]==='VoiceRecording\x20not\x20found'){_0x4cb3e9[_0x72a7('0x1e')](0x194)['send'](_0x72a7('0x55'));}else{return handleError(_0x4cb3e9,null);}});};exports[_0x72a7('0x56')]=function(_0xcdf3f7,_0x53193a,_0x1a6dc4){var _0x17dada=require(_0x72a7('0x49'));var _0x1ea668=![];var _0x14b9bb={'$and':[db[_0x72a7('0x57')][_0x72a7('0x37')](db[_0x72a7('0x57')]['fn'](_0x72a7('0x58'),db[_0x72a7('0x57')][_0x72a7('0x59')](_0x72a7('0x4a'))),_0xcdf3f7[_0x72a7('0x2d')][_0x72a7('0x5a')])]};if(_0xcdf3f7[_0x72a7('0x2d')]['type']&&_0xcdf3f7[_0x72a7('0x2d')][_0x72a7('0x28')]===_0x72a7('0x4a')){_0x14b9bb[_0x72a7('0x5b')]['push']({'uniqueid':_0xcdf3f7[_0x72a7('0x46')]['id']});}else{_0x14b9bb['$and'][_0x72a7('0x5c')]({'id':_0xcdf3f7[_0x72a7('0x46')]['id']});}return db[_0x72a7('0x25')]['find']({'where':_0x14b9bb,'attributes':['id',_0x72a7('0x4b')],'raw':!![]})[_0x72a7('0x1d')](handleEntityNotFound(_0x53193a,null))[_0x72a7('0x1d')](function(_0x17a3c0){if(_0x17a3c0){var _0x3aae8a=util[_0x72a7('0x2c')](_0x72a7('0x5d'),_0x17a3c0[_0x72a7('0x4b')]);if(fs[_0x72a7('0x4c')](_0x3aae8a)){_0x1ea668=!![];return _0x17dada['decryptFile'](_0x3aae8a,_0x17a3c0[_0x72a7('0x4b')],config[_0x72a7('0x4e')][_0x72a7('0x5e')])[_0x72a7('0x1d')](function(){return _0x17a3c0;});}return _0x17a3c0;}})[_0x72a7('0x1d')](function(_0x28b2be){if(_0x28b2be){if(!fs['existsSync'](_0x28b2be[_0x72a7('0x4b')])){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x51'));}if(_0x28b2be['filename']){return _0x53193a[_0x72a7('0x48')](_0x28b2be[_0x72a7('0x4b')],_0x28b2be['filename']+path['extname'](_0x28b2be[_0x72a7('0x4b')]),function(){if(_0x1ea668){fs[_0x72a7('0x53')](_0x28b2be[_0x72a7('0x4b')]);}});}else{return _0x53193a[_0x72a7('0x48')](_0x28b2be[_0x72a7('0x4b')],function(_0x345491){if(_0x1ea668){fs['unlink'](_0x28b2be[_0x72a7('0x4b')]);}});}}})[_0x72a7('0x40')](handleError(_0x53193a,null));};exports[_0x72a7('0x5f')]=function(_0x5650f7,_0x474bc2){return db[_0x72a7('0x25')]['find']({'where':{'id':_0x5650f7['params']['id']}})[_0x72a7('0x1d')](function(_0x2439ec){if(_[_0x72a7('0x60')](_0x2439ec)){throw new ReferenceError(_0x72a7('0x61'));}return _0x2439ec;})[_0x72a7('0x1d')](function(_0x5475a6){var _0x27d2b8=_0x5475a6[_0x72a7('0x4b')];logger[_0x72a7('0x62')](_0x72a7('0x63'),_0x27d2b8);if(!_['isNil'](_0x5475a6[_0x72a7('0x4b')])&&fs['existsSync'](_0x27d2b8)){logger[_0x72a7('0x62')](_0x72a7('0x64')+_0x27d2b8+_0x72a7('0x65'));fs[_0x72a7('0x66')](_0x27d2b8);}_0x27d2b8=_0x27d2b8+'.cypher';if(!_[_0x72a7('0x60')](_0x5475a6['value'])&&fs[_0x72a7('0x4c')](_0x27d2b8)){logger[_0x72a7('0x62')](_0x72a7('0x64')+_0x27d2b8+_0x72a7('0x65'));fs[_0x72a7('0x66')](_0x27d2b8);}return _0x5475a6;})[_0x72a7('0x1d')](function(_0x49a1c5){if(!_0x49a1c5)throw new InternalError();return _0x49a1c5[_0x72a7('0x5f')]();})[_0x72a7('0x1d')](function(){_0x474bc2[_0x72a7('0x1e')](0xcc)[_0x72a7('0x1f')]();})['catch'](handleError(_0x474bc2,null));};function getBucketslist(_0x140c79,_0x56a1fa,_0x1757cc){return new Promise(function(_0x29f61e,_0x20d952){var _0x1fda30=new AWS['S3']({'accessKeyId':_0x56a1fa,'secretAccessKey':_0x140c79,'region':_0x1757cc});_0x1fda30[_0x72a7('0x67')]({},function(_0x51d62a,_0x39ff8b){if(_0x51d62a){return _0x20d952(_0x51d62a);}else{return _0x29f61e(_0x39ff8b);}});});}function createBucket(_0x44545c,_0x10684b,_0x2a04cc,_0x3cf013){return new Promise(function(_0x28e525,_0x34f7b1){var _0x24361e=new AWS['S3']({'accessKeyId':_0x10684b,'secretAccessKey':_0x44545c,'region':_0x2a04cc});_0x24361e[_0x72a7('0x68')]({'Bucket':_0x3cf013},function(_0x110c37,_0x1d8d01){if(_0x110c37){return _0x34f7b1(_0x110c37);}else{return _0x28e525(_0x1d8d01);}});});}function uploadFile(_0x3d84b3,_0x4b2233,_0x27b325,_0x5f009d,_0x49d876,_0x23026c){return new Promise(function(_0x2aeaa5,_0x353a16){var _0x2feec2=new AWS['S3']({'accessKeyId':_0x4b2233,'secretAccessKey':_0x3d84b3,'region':_0x27b325});_0x2feec2[_0x72a7('0x69')]({'Bucket':_0x5f009d,'Key':_0x49d876,'Body':_0x23026c},function(_0x10f020,_0x1356c4){if(_0x10f020){return _0x353a16(_0x10f020);}else{return _0x2aeaa5(_0x1356c4);}});});}function startTranscribe(_0x1ead5b,_0x4118de,_0x1e317a,_0x3ea7f0,_0x339ac8,_0x38f0e2){return new Promise(function(_0x159ea3,_0x771ec7){var _0x145902=new AWS['TranscribeService']({'accessKeyId':_0x4118de,'secretAccessKey':_0x1ead5b,'region':_0x1e317a});_0x145902['startTranscriptionJob']({'TranscriptionJobName':_0x3ea7f0,'LanguageCode':_0x339ac8,'Media':{'MediaFileUri':_0x38f0e2}},function(_0x4cd15c,_0x47ba01){if(_0x4cd15c){return _0x771ec7(_0x4cd15c);}else{return _0x159ea3(_0x47ba01);}});});}function transcribe(_0x145269,_0x292274,_0x5664b3,_0x1fd83c,_0xa31e56,_0x1e8e1f,_0x1745c2){return new Promise(function(_0x445246,_0x23f674){var _0x2e065b={};logger['info'](util[_0x72a7('0x2c')](_0x72a7('0x6a'),_0x145269,_0xa31e56));return uploadFile(_0x292274,_0x5664b3,_0x1fd83c,_0xa31e56,path[_0x72a7('0x6b')](_0x1e8e1f),fs['readFileSync'](_0x1e8e1f))[_0x72a7('0x1d')](function(_0xd297ae){logger[_0x72a7('0x62')](util[_0x72a7('0x2c')](_0x72a7('0x6c'),_0x145269,_0xa31e56,_0xd297ae['Location']));_0x2e065b[_0x72a7('0x6d')]=_0xd297ae[_0x72a7('0x6e')];_0x2e065b[_0x72a7('0x6f')]=_0xd297ae[_0x72a7('0x70')];logger[_0x72a7('0x62')](util[_0x72a7('0x2c')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x145269));return startTranscribe(_0x292274,_0x5664b3,_0x1fd83c,uuidv4(),_0x1745c2,_0xd297ae[_0x72a7('0x70')]);})[_0x72a7('0x1d')](function(_0x32fb33){logger[_0x72a7('0x62')](util[_0x72a7('0x2c')](_0x72a7('0x71'),_0x145269,_0x32fb33[_0x72a7('0x72')][_0x72a7('0x73')]));_0x2e065b[_0x72a7('0x74')]=_0x32fb33[_0x72a7('0x72')]['TranscriptionJobName'];_0x2e065b[_0x72a7('0x75')]=_0x32fb33[_0x72a7('0x72')][_0x72a7('0x76')];return _0x445246(_0x2e065b);})['catch'](function(_0x49e24d){return _0x23f674(_0x49e24d);});});}exports['runTranscribe']=function(_0x34b052,_0x1371aa,_0xd175c8){var _0x1529df;var _0x4b9f80;var _0x41257c;var _0x222466=require(_0x72a7('0x49'));return db['VoiceRecording']['findOne']({'where':{'id':_0x34b052[_0x72a7('0x46')]['id']}})[_0x72a7('0x1d')](function(_0x16cbe5){if(_0x16cbe5){var _0x290c9c=util[_0x72a7('0x2c')](_0x72a7('0x5d'),_0x16cbe5['value']);if(fs[_0x72a7('0x4c')](_0x290c9c)){cypher=!![];return _0x222466[_0x72a7('0x4d')](_0x290c9c,_0x16cbe5['value'],config[_0x72a7('0x4e')][_0x72a7('0x5e')])['then'](function(){return _0x16cbe5;});}return _0x16cbe5;}})[_0x72a7('0x1d')](function(_0x22711d){if(!_0x22711d){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x77'));}_0x4b9f80=_0x22711d;return db[_0x72a7('0x78')][_0x72a7('0x79')]({'where':{'id':0x1}});})[_0x72a7('0x1d')](handleEntityNotFound(_0x1371aa,null))['then'](function(_0x38c7e7){if(_0x38c7e7){_0x1529df=_0x38c7e7;if(!_0x1529df[_0x72a7('0x7a')]||!_0x1529df[_0x72a7('0x7b')]||!_0x1529df['transcribeRegion']||!_0x1529df[_0x72a7('0x7c')]||!_0x1529df['bucket']){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x7d'));}if(_0x34b052[_0x72a7('0x45')][_0x72a7('0x7e')]&&(!_0x1529df[_0x72a7('0x7f')]||!_0x1529df[_0x72a7('0x80')]||!_0x1529df[_0x72a7('0x81')]||!_0x1529df[_0x72a7('0x7c')]||!_0x1529df[_0x72a7('0x6d')])){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x82'));}return db[_0x72a7('0x83')]['findOne']({'where':{'id':_0x1529df['transcribeAccountId']}});}})[_0x72a7('0x1d')](function(_0x30874f){if(!_0x30874f){throw new db[(_0x72a7('0x4f'))]['ValidationError'](_0x72a7('0x84'));}if(!_0x30874f[_0x72a7('0x85')]||!_0x30874f[_0x72a7('0x86')]){throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x87'));}_0x41257c=_0x30874f;return getBucketslist(_0x41257c[_0x72a7('0x85')],_0x41257c[_0x72a7('0x86')],_0x1529df[_0x72a7('0x88')]);})[_0x72a7('0x1d')](function(_0x240069){if(_0x240069&&_0x240069[_0x72a7('0x89')]){var _0x555e52=_['find'](_0x240069['Buckets'],function(_0x45fcc8){return _0x45fcc8[_0x72a7('0x8a')]===_0x1529df['bucket'];});if(!_0x555e52){logger[_0x72a7('0x62')](util['format'](_0x72a7('0x8b'),_0x34b052[_0x72a7('0x46')]['id'],_0x1529df[_0x72a7('0x6d')]));return createBucket(_0x41257c[_0x72a7('0x85')],_0x41257c[_0x72a7('0x86')],_0x1529df[_0x72a7('0x88')],_0x1529df[_0x72a7('0x6d')]);}logger[_0x72a7('0x62')](util[_0x72a7('0x2c')](_0x72a7('0x8c'),_0x34b052[_0x72a7('0x46')]['id'],_0x1529df[_0x72a7('0x6d')]));return;}})[_0x72a7('0x1d')](function(_0x2098b1){if(_0x4b9f80['transcribeStatus']===_0x72a7('0x8d')){return transcribe(_0x34b052['params']['id'],_0x41257c[_0x72a7('0x85')],_0x41257c[_0x72a7('0x86')],_0x1529df['transcribeRegion'],_0x1529df[_0x72a7('0x6d')],_0x4b9f80[_0x72a7('0x4b')],_0x1529df[_0x72a7('0x7c')]);}else{logger['info'](util[_0x72a7('0x2c')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x34b052[_0x72a7('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})['then'](function(_0x42a65b){if(_0x42a65b){_0x42a65b[_0x72a7('0x8e')]=_0x34b052[_0x72a7('0x45')][_0x72a7('0x7e')];return _0x4b9f80['updateAttributes'](_0x42a65b);}})[_0x72a7('0x1d')](respondWithResult(_0x1371aa,null))[_0x72a7('0x40')](handleError(_0x1371aa,null));};function writeFile(_0x5ca5c1,_0x2d5f48){return new Promise(function(_0x27700a,_0x2f44c2){fs[_0x72a7('0x8f')](_0x2d5f48,_0x5ca5c1,function(_0x4cffb2,_0x2372bf){if(_0x4cffb2){return _0x2f44c2(_0x4cffb2);}else{return _0x27700a(_0x2372bf);}});});}exports[_0x72a7('0x90')]=function(_0x4c3baf,_0x313390,_0x290b73){return db[_0x72a7('0x25')][_0x72a7('0x79')]({'where':{'id':_0x4c3baf[_0x72a7('0x46')]['id']}})['then'](handleEntityNotFound(_0x313390))[_0x72a7('0x1d')](function(_0x56e23b){if(_0x56e23b&&_0x56e23b['fileText']){var _0x208dbb=_0x56e23b[_0x72a7('0x91')];var _0x255818=config['root']+'/server/files/transcribes/transcribe_'+_0x56e23b['id']+_0x72a7('0x92');if(fs[_0x72a7('0x4c')](_0x255818)){return _0x255818;}return writeFile(_0x208dbb,_0x255818)['then'](function(){return _0x255818;});}else{throw new db[(_0x72a7('0x4f'))][(_0x72a7('0x50'))](_0x72a7('0x93'));}})[_0x72a7('0x1d')](function(_0x2be28b){return _0x313390[_0x72a7('0x48')](_0x2be28b);})['catch'](handleError(_0x313390));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c166f20..f1f4ed7 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 _0x032a=['exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0x1b2bc7,_0x56bcf3){var _0x3dfe92=function(_0xfb0fd4){while(--_0xfb0fd4){_0x1b2bc7['push'](_0x1b2bc7['shift']());}};_0x3dfe92(++_0x56bcf3);}(_0x032a,0xf0));var _0xa032=function(_0x1bf301,_0xda5c4c){_0x1bf301=_0x1bf301-0x0;var _0x51c947=_0x032a[_0x1bf301];return _0x51c947;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0xa032('0x0')]=function(_0x591b65,_0xb3b072){return _0x591b65[_0xa032('0x1')](_0xa032('0x2'),attributes,{'tableName':_0xa032('0x3'),'paranoid':![],'indexes':[{'name':_0xa032('0x4'),'fields':[_0xa032('0x4')]},{'name':_0xa032('0x5'),'fields':[_0xa032('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc125=['exports','define','VoiceRecording','voice_recordings','uniqueid','transcribeStatus'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xc125,0x150));var _0x5c12=function(_0xb50877,_0x3c5b53){_0xb50877=_0xb50877-0x0;var _0x559f23=_0xc125[_0xb50877];return _0x559f23;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x5c12('0x0')]=function(_0x50655b,_0x231f6d){return _0x50655b[_0x5c12('0x1')](_0x5c12('0x2'),attributes,{'tableName':_0x5c12('0x3'),'paranoid':![],'indexes':[{'name':_0x5c12('0x4'),'fields':[_0x5c12('0x4')]},{'name':_0x5c12('0x5'),'fields':[_0x5c12('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 9632766..80f38e2 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 _0x8aad=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info'];(function(_0x356183,_0x3a716d){var _0x1e8664=function(_0x572436){while(--_0x572436){_0x356183['push'](_0x356183['shift']());}};_0x1e8664(++_0x3a716d);}(_0x8aad,0x146));var _0xd8aa=function(_0x1037cc,_0x2543ad){_0x1037cc=_0x1037cc-0x0;var _0x563222=_0x8aad[_0x1037cc];return _0x563222;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});}exports[_0xd8aa('0x14')]=function(_0x32e2cd){var _0x3a29ca=this;return new Promise(function(_0x2d34ac,_0x4953be){return db[_0xd8aa('0x15')][_0xd8aa('0x16')](_0x32e2cd[_0xd8aa('0x17')],{'raw':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')][_0xd8aa('0x1a')]||null:null,'attributes':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x1b')]||null:null,'limit':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')]['limit']||null:null})[_0xd8aa('0x1c')](function(_0x7a4ce7){logger[_0xd8aa('0x9')](_0xd8aa('0x14'),_0x32e2cd);logger[_0xd8aa('0xc')](_0xd8aa('0x14'),_0x32e2cd,JSON[_0xd8aa('0xe')](_0x7a4ce7));_0x2d34ac(_0x7a4ce7);})[_0xd8aa('0x13')](function(_0x375f64){logger[_0xd8aa('0xf')](_0xd8aa('0x14'),_0x375f64[_0xd8aa('0x11')],_0x32e2cd);_0x4953be(_0x3a29ca[_0xd8aa('0xf')](0x1f4,_0x375f64['message']));});});};exports[_0xd8aa('0x1d')]=function(_0x59eb3f){var _0xd4d204=this;return new Promise(function(_0x1f6ab2,_0x26cff3){var _0x3696fd=require(_0xd8aa('0x1e'));var _0x19edee;return db[_0xd8aa('0x1f')][_0xd8aa('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xd8aa('0x1c')](function(_0x34b792){_0x19edee=_0x34b792;return db[_0xd8aa('0x15')]['create'](_0x59eb3f[_0xd8aa('0x17')]);})['then'](function(_0x3052c6){if(_0x19edee[_0xd8aa('0x21')]&&fs[_0xd8aa('0x22')](_0x3052c6[_0xd8aa('0x23')])){var _0x44f783=util[_0xd8aa('0x24')](_0xd8aa('0x25'),_0x3052c6[_0xd8aa('0x23')]);return _0x3696fd['encryptFile'](_0x3052c6[_0xd8aa('0x23')],_0x44f783,config[_0xd8aa('0x26')][_0xd8aa('0x27')])[_0xd8aa('0x1c')](function(){fs[_0xd8aa('0x28')](_0x3052c6[_0xd8aa('0x23')]);logger[_0xd8aa('0x9')](_0xd8aa('0x29'));return _0x3052c6;});}return _0x3052c6;})['then'](function(_0x265217){logger[_0xd8aa('0x9')](_0xd8aa('0x1d'),_0x59eb3f);logger['debug'](_0xd8aa('0x1d'),_0x59eb3f,JSON[_0xd8aa('0xe')](_0x265217));_0x1f6ab2(_0x265217);})[_0xd8aa('0x13')](function(_0x45c216){logger[_0xd8aa('0xf')](_0xd8aa('0x1d'),_0x45c216[_0xd8aa('0x11')],_0x59eb3f);_0x26cff3(_0xd4d204[_0xd8aa('0xf')](0x1f4,_0x45c216[_0xd8aa('0x11')]));});});}; \ No newline at end of file +var _0xcaf2=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','encryptFile','secrets','recording','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceRecording','body','options','raw','where','attributes','limit','UpdateVoiceRecording','stringify','catch'];(function(_0x4cce09,_0x1810c5){var _0xeecac6=function(_0x556276){while(--_0x556276){_0x4cce09['push'](_0x4cce09['shift']());}};_0xeecac6(++_0x1810c5);}(_0xcaf2,0x8a));var _0x2caf=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xcaf2[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['UpdateVoiceRecording']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['update'](_0x4a33fc[_0x2caf('0x15')],{'raw':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc['options'][_0x2caf('0x18')]||null:null,'attributes':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x19')]||null:null,'limit':_0x4a33fc[_0x2caf('0x16')]?_0x4a33fc[_0x2caf('0x16')][_0x2caf('0x1a')]||null:null})[_0x2caf('0xa')](function(_0x3332b1){logger[_0x2caf('0xb')](_0x2caf('0x1b'),_0x4a33fc);logger['debug'](_0x2caf('0x1b'),_0x4a33fc,JSON[_0x2caf('0x1c')](_0x3332b1));_0x58047b(_0x3332b1);})[_0x2caf('0x1d')](function(_0x401ea2){logger[_0x2caf('0x10')](_0x2caf('0x1b'),_0x401ea2[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x401ea2[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1e')]=function(_0x5ad211){var _0x6a32ac=this;return new Promise(function(_0x325eda,_0xbefce6){var _0x37b08f=require(_0x2caf('0x1f'));var _0x17d3c6;return db[_0x2caf('0x20')][_0x2caf('0x21')]({'attributes':['id',_0x2caf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x2caf('0xa')](function(_0x30da75){_0x17d3c6=_0x30da75;return db[_0x2caf('0x14')][_0x2caf('0x23')](_0x5ad211['body']);})[_0x2caf('0xa')](function(_0xda0ec5){if(_0x17d3c6[_0x2caf('0x22')]&&fs[_0x2caf('0x24')](_0xda0ec5[_0x2caf('0x25')])){var _0x1f52bf=util[_0x2caf('0x26')]('%s.cypher',_0xda0ec5[_0x2caf('0x25')]);return _0x37b08f[_0x2caf('0x27')](_0xda0ec5['value'],_0x1f52bf,config[_0x2caf('0x28')][_0x2caf('0x29')])[_0x2caf('0xa')](function(){fs['unlink'](_0xda0ec5[_0x2caf('0x25')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0xda0ec5;});}return _0xda0ec5;})[_0x2caf('0xa')](function(_0x28b715){logger[_0x2caf('0xb')](_0x2caf('0x1e'),_0x5ad211);logger[_0x2caf('0xe')](_0x2caf('0x1e'),_0x5ad211,JSON[_0x2caf('0x1c')](_0x28b715));_0x325eda(_0x28b715);})[_0x2caf('0x1d')](function(_0x20818e){logger['error'](_0x2caf('0x1e'),_0x20818e[_0x2caf('0x12')],_0x5ad211);_0xbefce6(_0x6a32ac[_0x2caf('0x10')](0x1f4,_0x20818e[_0x2caf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 2112541..7896040 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 _0x32aa=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','update','delete','destroy','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32aa,0x14f));var _0xa32a=function(_0x1bce4a,_0x4e33a9){_0x1bce4a=_0x1bce4a-0x0;var _0x5d414d=_0x32aa[_0x1bce4a];return _0x5d414d;};'use strict';var multer=require(_0xa32a('0x0'));var util=require(_0xa32a('0x1'));var path=require(_0xa32a('0x2'));var timeout=require(_0xa32a('0x3'));var express=require('express');var router=express[_0xa32a('0x4')]();var fs_extra=require(_0xa32a('0x5'));var auth=require(_0xa32a('0x6'));var interaction=require(_0xa32a('0x7'));var config=require(_0xa32a('0x8'));var controller=require(_0xa32a('0x9'));router[_0xa32a('0xa')]('/',auth[_0xa32a('0xb')](),controller[_0xa32a('0xc')]);router[_0xa32a('0xa')](_0xa32a('0xd'),auth[_0xa32a('0xb')](),controller[_0xa32a('0xe')]);router[_0xa32a('0xa')]('/:id',auth[_0xa32a('0xb')](),controller[_0xa32a('0xf')]);router['post']('/',auth[_0xa32a('0xb')](),controller[_0xa32a('0x10')]);router['put']('/:id',auth[_0xa32a('0xb')](),controller[_0xa32a('0x11')]);router[_0xa32a('0x12')]('/:id',auth[_0xa32a('0xb')](),controller[_0xa32a('0x13')]);module[_0xa32a('0x14')]=router; \ No newline at end of file +var _0x5750=['/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index'];(function(_0x28fb48,_0x5d54e5){var _0x2902e9=function(_0x5b5d27){while(--_0x5b5d27){_0x28fb48['push'](_0x28fb48['shift']());}};_0x2902e9(++_0x5d54e5);}(_0x5750,0x184));var _0x0575=function(_0x5c110c,_0x58d08b){_0x5c110c=_0x5c110c-0x0;var _0x485822=_0x5750[_0x5c110c];return _0x485822;};'use strict';var multer=require(_0x0575('0x0'));var util=require(_0x0575('0x1'));var path=require('path');var timeout=require(_0x0575('0x2'));var express=require(_0x0575('0x3'));var router=express[_0x0575('0x4')]();var fs_extra=require(_0x0575('0x5'));var auth=require(_0x0575('0x6'));var interaction=require(_0x0575('0x7'));var config=require('../../config/environment');var controller=require(_0x0575('0x8'));router[_0x0575('0x9')]('/',auth[_0x0575('0xa')](),controller[_0x0575('0xb')]);router[_0x0575('0x9')]('/describe',auth[_0x0575('0xa')](),controller['describe']);router[_0x0575('0x9')](_0x0575('0xc'),auth['isAuthenticated'](),controller[_0x0575('0xd')]);router[_0x0575('0xe')]('/',auth['isAuthenticated'](),controller[_0x0575('0xf')]);router[_0x0575('0x10')](_0x0575('0xc'),auth[_0x0575('0xa')](),controller[_0x0575('0x11')]);router[_0x0575('0x12')](_0x0575('0xc'),auth[_0x0575('0xa')](),controller[_0x0575('0x13')]);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 2cd1296..7c41fde 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 _0xbd09=['ENUM','blind','attended','STRING','exports'];(function(_0x377df4,_0x5cabd4){var _0x3b4993=function(_0x11219e){while(--_0x11219e){_0x377df4['push'](_0x377df4['shift']());}};_0x3b4993(++_0x5cabd4);}(_0xbd09,0x8b));var _0x9bd0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbd09[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9bd0('0x0')]={'type':{'type':Sequelize[_0x9bd0('0x1')](_0x9bd0('0x2'),_0x9bd0('0x3'))},'result':{'type':Sequelize[_0x9bd0('0x4')]},'transfererchannel':{'type':Sequelize[_0x9bd0('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x9bd0('0x4')]},'transferercalleridname':{'type':Sequelize[_0x9bd0('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x9bd0('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x9bd0('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x9bd0('0x4')]},'transfereechannel':{'type':Sequelize[_0x9bd0('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x9bd0('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x9bd0('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x9bd0('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x9bd0('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x9bd0('0x4')]},'transfereecontext':{'type':Sequelize[_0x9bd0('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x9bd0('0x1')]('Yes','No')},'context':{'type':Sequelize[_0x9bd0('0x4')]},'extension':{'type':Sequelize[_0x9bd0('0x4')]}}; \ No newline at end of file +var _0xf488=['attended','STRING','sequelize','exports','ENUM'];(function(_0x3c59fc,_0x10dbd2){var _0x2b78d4=function(_0x5f161a){while(--_0x5f161a){_0x3c59fc['push'](_0x3c59fc['shift']());}};_0x2b78d4(++_0x10dbd2);}(_0xf488,0xfc));var _0x8f48=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xf488[_0x30bd4d];return _0x306915;};'use strict';var Sequelize=require(_0x8f48('0x0'));var moment=require('moment');module[_0x8f48('0x1')]={'type':{'type':Sequelize[_0x8f48('0x2')]('blind',_0x8f48('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x8f48('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x8f48('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x8f48('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x8f48('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x8f48('0x4')]},'transferercontext':{'type':Sequelize[_0x8f48('0x4')]},'transfererexten':{'type':Sequelize[_0x8f48('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x8f48('0x4')]},'transfereechannel':{'type':Sequelize[_0x8f48('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x8f48('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x8f48('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8f48('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8f48('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x8f48('0x4')]},'transfereecontext':{'type':Sequelize[_0x8f48('0x4')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x8f48('0x4')]},'isexternal':{'type':Sequelize[_0x8f48('0x2')]('Yes','No')},'context':{'type':Sequelize[_0x8f48('0x4')]},'extension':{'type':Sequelize[_0x8f48('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 783480b..5f9f550 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 _0xda15=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','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','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','VoiceTransferReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','describe'];(function(_0x4d5173,_0x3fd6d1){var _0x5f403f=function(_0x3d23b0){while(--_0x3d23b0){_0x4d5173['push'](_0x4d5173['shift']());}};_0x5f403f(++_0x3fd6d1);}(_0xda15,0xe1));var _0x5da1=function(_0x491e8c,_0x1714e9){_0x491e8c=_0x491e8c-0x0;var _0xd1d710=_0xda15[_0x491e8c];return _0xd1d710;};'use strict';var emlformat=require(_0x5da1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5da1('0x1'));var jsonpatch=require(_0x5da1('0x2'));var rp=require(_0x5da1('0x3'));var moment=require('moment');var BPromise=require(_0x5da1('0x4'));var Mustache=require(_0x5da1('0x5'));var util=require('util');var path=require(_0x5da1('0x6'));var sox=require('sox');var csv=require(_0x5da1('0x7'));var ejs=require(_0x5da1('0x8'));var fs=require('fs');var fs_extra=require(_0x5da1('0x9'));var _=require(_0x5da1('0xa'));var squel=require(_0x5da1('0xb'));var crypto=require('crypto');var jsforce=require(_0x5da1('0xc'));var deskjs=require(_0x5da1('0xd'));var toCsv=require(_0x5da1('0x7'));var querystring=require(_0x5da1('0xe'));var Papa=require(_0x5da1('0xf'));var Redis=require(_0x5da1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5da1('0x11'));var as=require(_0x5da1('0x12'));var hardwareService=require(_0x5da1('0x13'));var logger=require(_0x5da1('0x14'))('api');var utils=require(_0x5da1('0x15'));var config=require(_0x5da1('0x16'));var licenseUtil=require(_0x5da1('0x17'));var db=require(_0x5da1('0x18'))['db'];function respondWithStatusCode(_0x12b3ef,_0x1db5b1){_0x1db5b1=_0x1db5b1||0xcc;return function(_0x1c13a3){if(_0x1c13a3){return _0x12b3ef['sendStatus'](_0x1db5b1);}return _0x12b3ef['status'](_0x1db5b1)[_0x5da1('0x19')]();};}function respondWithResult(_0x66bb4,_0x308fca){_0x308fca=_0x308fca||0xc8;return function(_0x51f921){if(_0x51f921){return _0x66bb4[_0x5da1('0x1a')](_0x308fca)[_0x5da1('0x1b')](_0x51f921);}};}function respondWithFilteredResult(_0x3f470c,_0x715fd6){return function(_0x4ed913){if(_0x4ed913){var _0x14c604=typeof _0x715fd6[_0x5da1('0x1c')]===_0x5da1('0x1d')&&typeof _0x715fd6['limit']===_0x5da1('0x1d');var _0x17634c=_0x4ed913[_0x5da1('0x1e')];var _0x2d67bc=_0x14c604?0x0:_0x715fd6['offset'];var _0x2f03b8=_0x14c604?_0x4ed913[_0x5da1('0x1e')]:_0x715fd6[_0x5da1('0x1c')]+_0x715fd6[_0x5da1('0x1f')];var _0x5168d9;if(_0x2f03b8>=_0x17634c){_0x2f03b8=_0x17634c;_0x5168d9=0xc8;}else{_0x5168d9=0xce;}_0x3f470c['status'](_0x5168d9);return _0x3f470c[_0x5da1('0x20')](_0x5da1('0x21'),_0x2d67bc+'-'+_0x2f03b8+'/'+_0x17634c)[_0x5da1('0x1b')](_0x4ed913);}return null;};}function patchUpdates(_0x24956b){return function(_0x264737){try{jsonpatch[_0x5da1('0x22')](_0x264737,_0x24956b,!![]);}catch(_0x2528f7){return BPromise[_0x5da1('0x23')](_0x2528f7);}return _0x264737[_0x5da1('0x24')]();};}function saveUpdates(_0x385ed9,_0x68a1cc){return function(_0x3116c4){if(_0x3116c4){return _0x3116c4[_0x5da1('0x25')](_0x385ed9)[_0x5da1('0x26')](function(_0xe977dc){return _0xe977dc;});}return null;};}function removeEntity(_0x1b8c4d,_0x31ee04){return function(_0x28a6fe){if(_0x28a6fe){return _0x28a6fe[_0x5da1('0x27')]()[_0x5da1('0x26')](function(){_0x1b8c4d[_0x5da1('0x1a')](0xcc)[_0x5da1('0x19')]();});}};}function handleEntityNotFound(_0x160490,_0x23b071){return function(_0x3caa3e){if(!_0x3caa3e){_0x160490['sendStatus'](0x194);}return _0x3caa3e;};}function handleError(_0x97ce6a,_0x35c44a){_0x35c44a=_0x35c44a||0x1f4;return function(_0x2b1cd9){logger[_0x5da1('0x28')](_0x2b1cd9['stack']);if(_0x2b1cd9[_0x5da1('0x29')]){delete _0x2b1cd9[_0x5da1('0x29')];}_0x97ce6a[_0x5da1('0x1a')](_0x35c44a)[_0x5da1('0x2a')](_0x2b1cd9);};}exports['index']=function(_0x45a7f9,_0x53f14b){var _0x18e1ba={},_0x44e250={},_0x557c68={'count':0x0,'rows':[]};var _0x330f69=_['map'](db[_0x5da1('0x2b')][_0x5da1('0x2c')],function(_0x1569db){return{'name':_0x1569db[_0x5da1('0x2d')],'type':_0x1569db['type'][_0x5da1('0x2e')]};});_0x44e250['model']=_[_0x5da1('0x2f')](_0x330f69,_0x5da1('0x29'));_0x44e250['query']=_[_0x5da1('0x30')](_0x45a7f9[_0x5da1('0x31')]);_0x44e250[_0x5da1('0x32')]=_[_0x5da1('0x33')](_0x44e250[_0x5da1('0x34')],_0x44e250[_0x5da1('0x31')]);_0x18e1ba[_0x5da1('0x35')]=_[_0x5da1('0x33')](_0x44e250[_0x5da1('0x34')],qs[_0x5da1('0x36')](_0x45a7f9['query']['fields']));_0x18e1ba[_0x5da1('0x35')]=_0x18e1ba[_0x5da1('0x35')][_0x5da1('0x37')]?_0x18e1ba['attributes']:_0x44e250[_0x5da1('0x34')];if(!_0x45a7f9['query'][_0x5da1('0x38')](_0x5da1('0x39'))){_0x18e1ba[_0x5da1('0x1f')]=qs[_0x5da1('0x1f')](_0x45a7f9[_0x5da1('0x31')]['limit']);_0x18e1ba[_0x5da1('0x1c')]=qs['offset'](_0x45a7f9[_0x5da1('0x31')][_0x5da1('0x1c')]);}_0x18e1ba[_0x5da1('0x3a')]=qs[_0x5da1('0x3b')](_0x45a7f9[_0x5da1('0x31')][_0x5da1('0x3b')]);_0x18e1ba[_0x5da1('0x3c')]=qs[_0x5da1('0x32')](_[_0x5da1('0x3d')](_0x45a7f9[_0x5da1('0x31')],_0x44e250['filters']),_0x330f69);if(_0x45a7f9['query'][_0x5da1('0x3e')]){_0x18e1ba['where']=_[_0x5da1('0x3f')](_0x18e1ba[_0x5da1('0x3c')],{'$or':_[_0x5da1('0x2f')](_0x330f69,function(_0x2e58df){if(_0x2e58df['type']!==_0x5da1('0x40')){var _0x559a19={};_0x559a19[_0x2e58df[_0x5da1('0x29')]]={'$like':'%'+_0x45a7f9[_0x5da1('0x31')][_0x5da1('0x3e')]+'%'};return _0x559a19;}})});}_0x18e1ba=_[_0x5da1('0x3f')]({},_0x18e1ba,_0x45a7f9[_0x5da1('0x41')]);var _0x2bef47={'where':_0x18e1ba[_0x5da1('0x3c')]};return db[_0x5da1('0x2b')][_0x5da1('0x1e')](_0x2bef47)[_0x5da1('0x26')](function(_0x194854){_0x557c68[_0x5da1('0x1e')]=_0x194854;if(_0x45a7f9[_0x5da1('0x31')][_0x5da1('0x42')]){_0x18e1ba[_0x5da1('0x43')]=[{'all':!![]}];}return db[_0x5da1('0x2b')]['findAll'](_0x18e1ba);})[_0x5da1('0x26')](function(_0x241c57){_0x557c68[_0x5da1('0x44')]=_0x241c57;return _0x557c68;})['then'](respondWithFilteredResult(_0x53f14b,_0x18e1ba))[_0x5da1('0x45')](handleError(_0x53f14b,null));};exports['show']=function(_0x4bafce,_0x348897){var _0xd14351={'raw':!![],'where':{'id':_0x4bafce[_0x5da1('0x46')]['id']}},_0x2673a4={};_0x2673a4[_0x5da1('0x34')]=_[_0x5da1('0x30')](db['VoiceTransferReport'][_0x5da1('0x2c')]);_0x2673a4['query']=_[_0x5da1('0x30')](_0x4bafce['query']);_0x2673a4[_0x5da1('0x32')]=_[_0x5da1('0x33')](_0x2673a4[_0x5da1('0x34')],_0x2673a4[_0x5da1('0x31')]);_0xd14351['attributes']=_['intersection'](_0x2673a4['model'],qs['fields'](_0x4bafce[_0x5da1('0x31')][_0x5da1('0x36')]));_0xd14351['attributes']=_0xd14351[_0x5da1('0x35')][_0x5da1('0x37')]?_0xd14351[_0x5da1('0x35')]:_0x2673a4[_0x5da1('0x34')];if(_0x4bafce['query'][_0x5da1('0x42')]){_0xd14351[_0x5da1('0x43')]=[{'all':!![]}];}_0xd14351=_[_0x5da1('0x3f')]({},_0xd14351,_0x4bafce[_0x5da1('0x41')]);return db[_0x5da1('0x2b')]['find'](_0xd14351)['then'](handleEntityNotFound(_0x348897,null))['then'](respondWithResult(_0x348897,null))[_0x5da1('0x45')](handleError(_0x348897,null));};exports[_0x5da1('0x47')]=function(_0x531b20,_0x3de3b5){return db[_0x5da1('0x2b')][_0x5da1('0x47')](_0x531b20['body'],{})['then'](respondWithResult(_0x3de3b5,0xc9))[_0x5da1('0x45')](handleError(_0x3de3b5,null));};exports[_0x5da1('0x25')]=function(_0x2594df,_0x1dc2a9){if(_0x2594df[_0x5da1('0x48')]['id']){delete _0x2594df[_0x5da1('0x48')]['id'];}return db['VoiceTransferReport'][_0x5da1('0x49')]({'where':{'id':_0x2594df[_0x5da1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1dc2a9,null))['then'](saveUpdates(_0x2594df[_0x5da1('0x48')],null))[_0x5da1('0x26')](respondWithResult(_0x1dc2a9,null))[_0x5da1('0x45')](handleError(_0x1dc2a9,null));};exports[_0x5da1('0x27')]=function(_0x26a79e,_0x109904){return db['VoiceTransferReport']['find']({'where':{'id':_0x26a79e[_0x5da1('0x46')]['id']}})[_0x5da1('0x26')](handleEntityNotFound(_0x109904,null))['then'](removeEntity(_0x109904,null))['catch'](handleError(_0x109904,null));};exports[_0x5da1('0x4a')]=function(_0x2e1668,_0x14af16){return db[_0x5da1('0x2b')]['describe']()[_0x5da1('0x26')](respondWithResult(_0x14af16,null))[_0x5da1('0x45')](handleError(_0x14af16,null));}; \ No newline at end of file +var _0x6e29=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','sendStatus','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','include','findAll','catch','show','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4755fb,_0x6ac718){var _0x910ab3=function(_0x3e35cc){while(--_0x3e35cc){_0x4755fb['push'](_0x4755fb['shift']());}};_0x910ab3(++_0x6ac718);}(_0x6e29,0x84));var _0x96e2=function(_0x4e735f,_0x15ed28){_0x4e735f=_0x4e735f-0x0;var _0x8d16a3=_0x6e29[_0x4e735f];return _0x8d16a3;};'use strict';var emlformat=require(_0x96e2('0x0'));var rimraf=require(_0x96e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96e2('0x2'));var rp=require(_0x96e2('0x3'));var moment=require(_0x96e2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x96e2('0x5'));var sox=require('sox');var csv=require(_0x96e2('0x6'));var ejs=require(_0x96e2('0x7'));var fs=require('fs');var fs_extra=require(_0x96e2('0x8'));var _=require(_0x96e2('0x9'));var squel=require('squel');var crypto=require(_0x96e2('0xa'));var jsforce=require(_0x96e2('0xb'));var deskjs=require(_0x96e2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96e2('0xd'));var Papa=require(_0x96e2('0xe'));var Redis=require(_0x96e2('0xf'));var authService=require(_0x96e2('0x10'));var qs=require(_0x96e2('0x11'));var as=require(_0x96e2('0x12'));var hardwareService=require(_0x96e2('0x13'));var logger=require(_0x96e2('0x14'))(_0x96e2('0x15'));var utils=require('../../config/utils');var config=require(_0x96e2('0x16'));var licenseUtil=require(_0x96e2('0x17'));var db=require(_0x96e2('0x18'))['db'];function respondWithStatusCode(_0xcf1604,_0x32c00f){_0x32c00f=_0x32c00f||0xcc;return function(_0x1661d9){if(_0x1661d9){return _0xcf1604['sendStatus'](_0x32c00f);}return _0xcf1604[_0x96e2('0x19')](_0x32c00f)[_0x96e2('0x1a')]();};}function respondWithResult(_0x44def4,_0x55a480){_0x55a480=_0x55a480||0xc8;return function(_0x1ad7fa){if(_0x1ad7fa){return _0x44def4[_0x96e2('0x19')](_0x55a480)[_0x96e2('0x1b')](_0x1ad7fa);}};}function respondWithFilteredResult(_0x1e7084,_0x4da338){return function(_0x5a4ed0){if(_0x5a4ed0){var _0x176ba9=typeof _0x4da338[_0x96e2('0x1c')]===_0x96e2('0x1d')&&typeof _0x4da338[_0x96e2('0x1e')]===_0x96e2('0x1d');var _0xcc7f6e=_0x5a4ed0[_0x96e2('0x1f')];var _0x4df6eb=_0x176ba9?0x0:_0x4da338[_0x96e2('0x1c')];var _0x67021c=_0x176ba9?_0x5a4ed0[_0x96e2('0x1f')]:_0x4da338[_0x96e2('0x1c')]+_0x4da338[_0x96e2('0x1e')];var _0x4e2cb8;if(_0x67021c>=_0xcc7f6e){_0x67021c=_0xcc7f6e;_0x4e2cb8=0xc8;}else{_0x4e2cb8=0xce;}_0x1e7084[_0x96e2('0x19')](_0x4e2cb8);return _0x1e7084[_0x96e2('0x20')]('Content-Range',_0x4df6eb+'-'+_0x67021c+'/'+_0xcc7f6e)[_0x96e2('0x1b')](_0x5a4ed0);}return null;};}function patchUpdates(_0x4b0ab5){return function(_0x523d68){try{jsonpatch['apply'](_0x523d68,_0x4b0ab5,!![]);}catch(_0x4d410b){return BPromise[_0x96e2('0x21')](_0x4d410b);}return _0x523d68[_0x96e2('0x22')]();};}function saveUpdates(_0x4d2f6a,_0x1211af){return function(_0x17cd4c){if(_0x17cd4c){return _0x17cd4c[_0x96e2('0x23')](_0x4d2f6a)['then'](function(_0x51fcca){return _0x51fcca;});}return null;};}function removeEntity(_0x57ef7e,_0x295666){return function(_0x26bb9f){if(_0x26bb9f){return _0x26bb9f[_0x96e2('0x24')]()['then'](function(){_0x57ef7e[_0x96e2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e84ee,_0x2c31cc){return function(_0xb58af){if(!_0xb58af){_0x5e84ee[_0x96e2('0x25')](0x194);}return _0xb58af;};}function handleError(_0x932e0a,_0x2f641a){_0x2f641a=_0x2f641a||0x1f4;return function(_0x1308df){logger[_0x96e2('0x26')](_0x1308df[_0x96e2('0x27')]);if(_0x1308df['name']){delete _0x1308df[_0x96e2('0x28')];}_0x932e0a[_0x96e2('0x19')](_0x2f641a)[_0x96e2('0x29')](_0x1308df);};}exports[_0x96e2('0x2a')]=function(_0x1e6c01,_0x49205a){var _0x39fc54={},_0xd6e5dd={},_0x30d532={'count':0x0,'rows':[]};var _0x2940a0=_[_0x96e2('0x2b')](db[_0x96e2('0x2c')][_0x96e2('0x2d')],function(_0x308956){return{'name':_0x308956[_0x96e2('0x2e')],'type':_0x308956[_0x96e2('0x2f')][_0x96e2('0x30')]};});_0xd6e5dd['model']=_[_0x96e2('0x2b')](_0x2940a0,_0x96e2('0x28'));_0xd6e5dd[_0x96e2('0x31')]=_[_0x96e2('0x32')](_0x1e6c01[_0x96e2('0x31')]);_0xd6e5dd[_0x96e2('0x33')]=_[_0x96e2('0x34')](_0xd6e5dd[_0x96e2('0x35')],_0xd6e5dd[_0x96e2('0x31')]);_0x39fc54['attributes']=_[_0x96e2('0x34')](_0xd6e5dd['model'],qs[_0x96e2('0x36')](_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x36')]));_0x39fc54['attributes']=_0x39fc54['attributes']['length']?_0x39fc54[_0x96e2('0x37')]:_0xd6e5dd[_0x96e2('0x35')];if(!_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x38')](_0x96e2('0x39'))){_0x39fc54['limit']=qs[_0x96e2('0x1e')](_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x1e')]);_0x39fc54['offset']=qs[_0x96e2('0x1c')](_0x1e6c01['query'][_0x96e2('0x1c')]);}_0x39fc54[_0x96e2('0x3a')]=qs['sort'](_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x3b')]);_0x39fc54[_0x96e2('0x3c')]=qs[_0x96e2('0x33')](_['pick'](_0x1e6c01[_0x96e2('0x31')],_0xd6e5dd[_0x96e2('0x33')]),_0x2940a0);if(_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x3d')]){_0x39fc54['where']=_[_0x96e2('0x3e')](_0x39fc54[_0x96e2('0x3c')],{'$or':_['map'](_0x2940a0,function(_0x50fd66){if(_0x50fd66[_0x96e2('0x2f')]!==_0x96e2('0x3f')){var _0xf41bf2={};_0xf41bf2[_0x50fd66[_0x96e2('0x28')]]={'$like':'%'+_0x1e6c01[_0x96e2('0x31')][_0x96e2('0x3d')]+'%'};return _0xf41bf2;}})});}_0x39fc54=_[_0x96e2('0x3e')]({},_0x39fc54,_0x1e6c01[_0x96e2('0x40')]);var _0x52a568={'where':_0x39fc54[_0x96e2('0x3c')]};return db['VoiceTransferReport'][_0x96e2('0x1f')](_0x52a568)[_0x96e2('0x41')](function(_0x1b2b75){_0x30d532[_0x96e2('0x1f')]=_0x1b2b75;if(_0x1e6c01['query']['includeAll']){_0x39fc54[_0x96e2('0x42')]=[{'all':!![]}];}return db[_0x96e2('0x2c')][_0x96e2('0x43')](_0x39fc54);})['then'](function(_0x4168bc){_0x30d532['rows']=_0x4168bc;return _0x30d532;})['then'](respondWithFilteredResult(_0x49205a,_0x39fc54))[_0x96e2('0x44')](handleError(_0x49205a,null));};exports[_0x96e2('0x45')]=function(_0x5ad34f,_0x1cea2a){var _0xca0364={'raw':!![],'where':{'id':_0x5ad34f[_0x96e2('0x46')]['id']}},_0x34289f={};_0x34289f['model']=_[_0x96e2('0x32')](db[_0x96e2('0x2c')][_0x96e2('0x2d')]);_0x34289f[_0x96e2('0x31')]=_[_0x96e2('0x32')](_0x5ad34f['query']);_0x34289f['filters']=_[_0x96e2('0x34')](_0x34289f[_0x96e2('0x35')],_0x34289f[_0x96e2('0x31')]);_0xca0364[_0x96e2('0x37')]=_['intersection'](_0x34289f[_0x96e2('0x35')],qs[_0x96e2('0x36')](_0x5ad34f[_0x96e2('0x31')][_0x96e2('0x36')]));_0xca0364[_0x96e2('0x37')]=_0xca0364[_0x96e2('0x37')][_0x96e2('0x47')]?_0xca0364['attributes']:_0x34289f[_0x96e2('0x35')];if(_0x5ad34f[_0x96e2('0x31')]['includeAll']){_0xca0364[_0x96e2('0x42')]=[{'all':!![]}];}_0xca0364=_[_0x96e2('0x3e')]({},_0xca0364,_0x5ad34f['options']);return db['VoiceTransferReport'][_0x96e2('0x48')](_0xca0364)[_0x96e2('0x41')](handleEntityNotFound(_0x1cea2a,null))[_0x96e2('0x41')](respondWithResult(_0x1cea2a,null))[_0x96e2('0x44')](handleError(_0x1cea2a,null));};exports[_0x96e2('0x49')]=function(_0x580ab5,_0x2f65b9){return db[_0x96e2('0x2c')]['create'](_0x580ab5[_0x96e2('0x4a')],{})[_0x96e2('0x41')](respondWithResult(_0x2f65b9,0xc9))[_0x96e2('0x44')](handleError(_0x2f65b9,null));};exports[_0x96e2('0x23')]=function(_0xca7e10,_0x11b4a9){if(_0xca7e10[_0x96e2('0x4a')]['id']){delete _0xca7e10['body']['id'];}return db['VoiceTransferReport'][_0x96e2('0x48')]({'where':{'id':_0xca7e10['params']['id']}})['then'](handleEntityNotFound(_0x11b4a9,null))['then'](saveUpdates(_0xca7e10[_0x96e2('0x4a')],null))[_0x96e2('0x41')](respondWithResult(_0x11b4a9,null))[_0x96e2('0x44')](handleError(_0x11b4a9,null));};exports[_0x96e2('0x24')]=function(_0x4f5153,_0x14ef9e){return db[_0x96e2('0x2c')][_0x96e2('0x48')]({'where':{'id':_0x4f5153[_0x96e2('0x46')]['id']}})[_0x96e2('0x41')](handleEntityNotFound(_0x14ef9e,null))[_0x96e2('0x41')](removeEntity(_0x14ef9e,null))[_0x96e2('0x44')](handleError(_0x14ef9e,null));};exports[_0x96e2('0x4b')]=function(_0x3b3138,_0x4990f4){return db[_0x96e2('0x2c')][_0x96e2('0x4b')]()[_0x96e2('0x41')](respondWithResult(_0x4990f4,null))[_0x96e2('0x44')](handleError(_0x4990f4,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index fa98d41..5bfbf3d 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 _0x886d=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x380cc2,_0x272e24){var _0x2df042=function(_0x228f03){while(--_0x228f03){_0x380cc2['push'](_0x380cc2['shift']());}};_0x2df042(++_0x272e24);}(_0x886d,0x14b));var _0xd886=function(_0x367825,_0xba445e){_0x367825=_0x367825-0x0;var _0x17e0c2=_0x886d[_0x367825];return _0x17e0c2;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var logger=require(_0xd886('0x2'))(_0xd886('0x3'));var moment=require(_0xd886('0x4'));var BPromise=require(_0xd886('0x5'));var rp=require(_0xd886('0x6'));var fs=require('fs');var path=require(_0xd886('0x7'));var rimraf=require(_0xd886('0x8'));var config=require(_0xd886('0x9'));var attributes=require(_0xd886('0xa'));module[_0xd886('0xb')]=function(_0xcb176e,_0x546e50){return _0xcb176e['define'](_0xd886('0xc'),attributes,{'tableName':_0xd886('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xade6=['path','rimraf','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x398d85,_0x2465d7){var _0x33c2bb=function(_0x4aa229){while(--_0x4aa229){_0x398d85['push'](_0x398d85['shift']());}};_0x33c2bb(++_0x2465d7);}(_0xade6,0xf6));var _0x6ade=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xade6[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x6ade('0x0'));var util=require(_0x6ade('0x1'));var logger=require(_0x6ade('0x2'))('api');var moment=require(_0x6ade('0x3'));var BPromise=require(_0x6ade('0x4'));var rp=require(_0x6ade('0x5'));var fs=require('fs');var path=require(_0x6ade('0x6'));var rimraf=require(_0x6ade('0x7'));var config=require('../../config/environment');var attributes=require(_0x6ade('0x8'));module[_0x6ade('0x9')]=function(_0x28139d,_0x2bf139){return _0x28139d[_0x6ade('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x6ade('0xb'),'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 97308cc..61e86f4 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 _0x78a9=['info','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x30ffc1,_0x556cd6){var _0x586b40=function(_0x2b0bed){while(--_0x2b0bed){_0x30ffc1['push'](_0x30ffc1['shift']());}};_0x586b40(++_0x556cd6);}(_0x78a9,0x10a));var _0x978a=function(_0x47df23,_0x4c34db){_0x47df23=_0x47df23-0x0;var _0xf4bf0e=_0x78a9[_0x47df23];return _0xf4bf0e;};'use strict';var _=require(_0x978a('0x0'));var util=require(_0x978a('0x1'));var moment=require(_0x978a('0x2'));var BPromise=require(_0x978a('0x3'));var rs=require(_0x978a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x978a('0x5'))['db'];var utils=require(_0x978a('0x6'));var logger=require(_0x978a('0x7'))(_0x978a('0x8'));var config=require('../../config/environment');var jayson=require(_0x978a('0x9'));var client=jayson[_0x978a('0xa')][_0x978a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0734a,_0x34b725,_0x89b45c){return new BPromise(function(_0x32fc15,_0x53ebb7){return client[_0x978a('0xc')](_0xd0734a,_0x89b45c)[_0x978a('0xd')](function(_0x2823ea){logger[_0x978a('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x34b725,'request\x20sent');logger[_0x978a('0xf')](_0x978a('0x10'),_0x34b725,_0x978a('0x11'),JSON[_0x978a('0x12')](_0x2823ea));if(_0x2823ea['error']){if(_0x2823ea[_0x978a('0x13')][_0x978a('0x14')]===0x1f4){logger[_0x978a('0x13')](_0x978a('0x15'),_0x34b725,_0x2823ea['error'][_0x978a('0x16')]);return _0x53ebb7(_0x2823ea['error'][_0x978a('0x16')]);}logger[_0x978a('0x13')](_0x978a('0x15'),_0x34b725,_0x2823ea[_0x978a('0x13')][_0x978a('0x16')]);return _0x32fc15(_0x2823ea[_0x978a('0x13')]['message']);}else{logger[_0x978a('0xe')](_0x978a('0x15'),_0x34b725,_0x978a('0x11'));_0x32fc15(_0x2823ea[_0x978a('0x17')][_0x978a('0x16')]);}})[_0x978a('0x18')](function(_0x5c7054){logger[_0x978a('0x13')](_0x978a('0x15'),_0x34b725,_0x5c7054);_0x53ebb7(_0x5c7054);});});}exports[_0x978a('0x19')]=function(_0x102801){var _0x32783c=this;return new Promise(function(_0x1e3633,_0x570967){return db['VoiceTransferReport']['create'](_0x102801['body'],{'raw':_0x102801[_0x978a('0x1a')]?_0x102801[_0x978a('0x1a')][_0x978a('0x1b')]===undefined?!![]:![]:!![]})[_0x978a('0xd')](function(_0x2f5537){logger[_0x978a('0xe')](_0x978a('0x19'),_0x102801);logger[_0x978a('0xf')](_0x978a('0x19'),_0x102801,JSON['stringify'](_0x2f5537));_0x1e3633(_0x2f5537);})['catch'](function(_0x4ed351){logger[_0x978a('0x13')](_0x978a('0x19'),_0x4ed351[_0x978a('0x16')],_0x102801);_0x570967(_0x32783c[_0x978a('0x13')](0x1f4,_0x4ed351['message']));});});}; \ No newline at end of file +var _0xf60d=['info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x2e7704,_0xe71a0e){var _0x352b27=function(_0x123e3e){while(--_0x123e3e){_0x2e7704['push'](_0x2e7704['shift']());}};_0x352b27(++_0xe71a0e);}(_0xf60d,0x14f));var _0xdf60=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xf60d[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0xdf60('0x0'));var util=require('util');var moment=require(_0xdf60('0x1'));var BPromise=require(_0xdf60('0x2'));var rs=require(_0xdf60('0x3'));var fs=require('fs');var Redis=require(_0xdf60('0x4'));var db=require(_0xdf60('0x5'))['db'];var utils=require(_0xdf60('0x6'));var logger=require(_0xdf60('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xdf60('0x8'));var client=jayson[_0xdf60('0x9')][_0xdf60('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227abd,_0x140677,_0x473bf9){return new BPromise(function(_0x3571d6,_0x21fdb5){return client[_0xdf60('0xb')](_0x227abd,_0x473bf9)[_0xdf60('0xc')](function(_0x4a33e6){logger[_0xdf60('0xd')](_0xdf60('0xe'),_0x140677,'request\x20sent');logger[_0xdf60('0xf')](_0xdf60('0x10'),_0x140677,_0xdf60('0x11'),JSON[_0xdf60('0x12')](_0x4a33e6));if(_0x4a33e6[_0xdf60('0x13')]){if(_0x4a33e6[_0xdf60('0x13')][_0xdf60('0x14')]===0x1f4){logger[_0xdf60('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x140677,_0x4a33e6[_0xdf60('0x13')]['message']);return _0x21fdb5(_0x4a33e6['error'][_0xdf60('0x15')]);}logger['error'](_0xdf60('0xe'),_0x140677,_0x4a33e6[_0xdf60('0x13')][_0xdf60('0x15')]);return _0x3571d6(_0x4a33e6['error'][_0xdf60('0x15')]);}else{logger[_0xdf60('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x140677,_0xdf60('0x11'));_0x3571d6(_0x4a33e6[_0xdf60('0x16')][_0xdf60('0x15')]);}})[_0xdf60('0x17')](function(_0x3b5dc0){logger[_0xdf60('0x13')](_0xdf60('0xe'),_0x140677,_0x3b5dc0);_0x21fdb5(_0x3b5dc0);});});}exports[_0xdf60('0x18')]=function(_0x290da9){var _0x362316=this;return new Promise(function(_0x4deeca,_0x4ab879){return db[_0xdf60('0x19')][_0xdf60('0x1a')](_0x290da9['body'],{'raw':_0x290da9[_0xdf60('0x1b')]?_0x290da9['options'][_0xdf60('0x1c')]===undefined?!![]:![]:!![]})[_0xdf60('0xc')](function(_0x32190a){logger[_0xdf60('0xd')](_0xdf60('0x18'),_0x290da9);logger[_0xdf60('0xf')]('CreateVoiceTransferReport',_0x290da9,JSON[_0xdf60('0x12')](_0x32190a));_0x4deeca(_0x32190a);})['catch'](function(_0x473a74){logger['error'](_0xdf60('0x18'),_0x473a74[_0xdf60('0x15')],_0x290da9);_0x4ab879(_0x362316[_0xdf60('0x13')](0x1f4,_0x473a74[_0xdf60('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 5f8cc6e..bfa21ae 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(_0x1c5ae6,_0x30f2bd){var _0x4623f3=function(_0x25d2dd){while(--_0x25d2dd){_0x1c5ae6['push'](_0x1c5ae6['shift']());}};_0x4623f3(++_0x30f2bd);}(_0xe5b3,0x133));var _0x3e5b=function(_0x258fed,_0x2a02dd){_0x258fed=_0x258fed-0x0;var _0x3a8b64=_0xe5b3[_0x258fed];return _0x3a8b64;};'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 _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x2b35ca,_0x4943ce){var _0x68389e=function(_0x4e9d92){while(--_0x4e9d92){_0x2b35ca['push'](_0x2b35ca['shift']());}};_0x68389e(++_0x4943ce);}(_0x00bb,0x1d8));var _0xb00b=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x00bb[_0xb0f7c3];return _0x28ea68;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index ca6eeca..91fc11e 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 _0x3667=['defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','send','request','then','error','code','message','catch','User','agent','VoiceChannels','filter','rows','UserId','sessionId','originate\x20fired:','body','length','json','userId','callNumber','callerId','entityFound:','format','status','hangup\x20fired:','user:%s','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','../../config/logger','webbarapi','ioredis','redis'];(function(_0x59d1a6,_0x29f6c8){var _0x34cf2b=function(_0x42c5cb){while(--_0x42c5cb){_0x59d1a6['push'](_0x59d1a6['shift']());}};_0x34cf2b(++_0x29f6c8);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x7366('0x0'));var fs=require('fs');var _=require(_0x7366('0x1'));var db=require(_0x7366('0x2'))['db'];var config=require(_0x7366('0x3'));var util=require(_0x7366('0x4'));var BPromise=require('bluebird');var jayson=require(_0x7366('0x5'));var amiClient=jayson[_0x7366('0x6')]['http']({'port':0x232a});var logger=require(_0x7366('0x7'))(_0x7366('0x8'));var Redis=require(_0x7366('0x9'));config[_0x7366('0xa')]=_[_0x7366('0xb')](config['redis'],{'host':_0x7366('0xc'),'port':0x18eb});var io=require(_0x7366('0xd'))(new Redis(config[_0x7366('0xa')]));var Schema=require(_0x7366('0xe'));var originateValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'callNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x12')]},'callerId':{'type':_0x7366('0x11')},'callbackUrl':{'type':_0x7366('0x11')}});var hangupValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x13')]},'transferNumber':{'type':_0x7366('0x11'),'required':[!![],_0x7366('0x14')]}});var holdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]},'sessionId':{'type':_0x7366('0x11'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7366('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7366('0xf'),'required':[!![],_0x7366('0x10')]}});function emit(_0x2c0422,_0xe2c87b,_0x431c01){logger[_0x7366('0x15')](_0x2c0422,_0xe2c87b,JSON[_0x7366('0x16')](_0x431c01));io['to'](_0x2c0422)[_0x7366('0x17')](_0xe2c87b,_0x431c01);}function handleError(_0x41113f){return function(_0x1a71f5){console['log'](_0x7366('0x18'),_0x1a71f5,_0x1a71f5 instanceof RangeError);logger['error'](_0x1a71f5[_0x7366('0x19')]);if(_0x1a71f5 instanceof RangeError){if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x194)[_0x7366('0x1b')](_0x1a71f5);}else{if(_0x1a71f5[_0x7366('0x1a')]){delete _0x1a71f5[_0x7366('0x1a')];}_0x41113f['status'](0x1f4)[_0x7366('0x1b')](_0x1a71f5);}};}function checkError(){return function(_0x1946c6){if(!_0x1946c6){throw new RangeError('NotFound');}return _0x1946c6;};}function respondWithRpcPromise(_0x3bfbca,_0x411dfe){return new BPromise(function(_0xaab659,_0x1a12d2){var _0x3c30a2=amiClient;return _0x3c30a2[_0x7366('0x1c')](_0x3bfbca,_0x411dfe)[_0x7366('0x1d')](function(_0x22ed7e){if(_0x22ed7e[_0x7366('0x1e')]){if(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x1f')]===0x1f4){return _0x1a12d2(_0x22ed7e[_0x7366('0x1e')][_0x7366('0x20')]);}return _0xaab659(_0x22ed7e['error'][_0x7366('0x20')]);}else{_0xaab659(_0x22ed7e['result']);}})[_0x7366('0x21')](function(_0x4ab987){_0x1a12d2(_0x4ab987);});});}function getAgent(_0x5e30fb){return db[_0x7366('0x22')]['findOne']({'where':{'id':_0x5e30fb,'role':_0x7366('0x23')}})['then'](checkError());}function getAgentCheckSession(_0x256633,_0x191177){return new BPromise(function(_0x5c37e2,_0x6d196a){var _0x565aa7=respondWithRpcPromise(_0x7366('0x24'));var _0x2b61af=getAgent(_0x256633);Promise['all']([_0x565aa7,_0x2b61af])[_0x7366('0x1d')](function(_0x507baf){var _0xc58ac7=_0x507baf[0x0];var _0x46f80f=_0x507baf[0x1];var _0x39d6ea=_[_0x7366('0x25')](_0xc58ac7[_0x7366('0x26')],function(_0x5e075c){return _0x5e075c[_0x7366('0x27')]==_0x46f80f['id']&&_0x5e075c[_0x7366('0x28')]==_0x191177;});if(_0x39d6ea['length']==0x1){_0x5c37e2(_0x46f80f);}else{_0x6d196a(new RangeError('sessionId\x20'+_0x191177+'\x20not\x20found!'));}});});}exports['originate']=function(_0x2a1d46,_0x43d487){logger[_0x7366('0x15')](_0x7366('0x29'),_0x2a1d46['body']);var _0x3ca5e6=originateValidation[_0x7366('0xe')](_0x2a1d46[_0x7366('0x2a')]);if(_0x3ca5e6[_0x7366('0x2b')]>0x0){return _0x43d487['status'](0x190)[_0x7366('0x2c')](_0x3ca5e6);}var _0x311dab=_0x2a1d46['body'][_0x7366('0x2d')];var _0x44c81e=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2e')];var _0x7779c7=_0x2a1d46[_0x7366('0x2a')][_0x7366('0x2f')];var _0x26858b=_0x2a1d46[_0x7366('0x2a')]['callbackUrl'];return getAgent(_0x311dab)[_0x7366('0x1d')](function(_0x83b879){logger['info'](_0x7366('0x30'),_0x83b879[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x83b879[_0x7366('0x1a')]),'webbar:originate',{'callNumber':_0x44c81e,'callerId':_0x7779c7,'callbackUrl':_0x26858b});return _0x43d487[_0x7366('0x32')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0x7366('0x21')](handleError(_0x43d487));};exports['hangup']=function(_0x3228b5,_0x116081){logger['info'](_0x7366('0x33'),_0x3228b5['body']);var _0x36f861=hangupValidation[_0x7366('0xe')](_0x3228b5[_0x7366('0x2a')]);if(_0x36f861[_0x7366('0x2b')]>0x0){return _0x116081['status'](0x190)[_0x7366('0x2c')](_0x36f861);}var _0x1d8be3=_0x3228b5[_0x7366('0x2a')]['userId'];var _0x487e36=_0x3228b5[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x1d8be3)[_0x7366('0x1d')](function(_0x18e9b1){logger[_0x7366('0x15')](_0x7366('0x30'),_0x18e9b1['name']);emit(util['format'](_0x7366('0x34'),_0x18e9b1[_0x7366('0x1a')]),'webbar:hangup',{'sessionId':_0x487e36});return _0x116081[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x7366('0x21')](handleError(_0x116081));};exports['answer']=function(_0xafac5,_0x1834cf){logger['info']('answer\x20fired:',_0xafac5[_0x7366('0x2a')]);var _0xedc3c7=answerValidation[_0x7366('0xe')](_0xafac5[_0x7366('0x2a')]);if(_0xedc3c7['length']>0x0){return _0x1834cf[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0xedc3c7);}var _0xb9d7e4=_0xafac5[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3d8c79=_0xafac5[_0x7366('0x2a')]['sessionId'];return getAgent(_0xb9d7e4)[_0x7366('0x1d')](function(_0x320fc2){logger[_0x7366('0x15')]('entityFound:',_0x320fc2[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x320fc2[_0x7366('0x1a')]),_0x7366('0x35'),{'sessionId':_0x3d8c79});return _0x1834cf[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x36')});})[_0x7366('0x21')](handleError(_0x1834cf));};exports[_0x7366('0x37')]=function(_0x570459,_0x37b251){logger[_0x7366('0x15')](_0x7366('0x38'),_0x570459['body']);var _0xb32e28=holdValidation[_0x7366('0xe')](_0x570459[_0x7366('0x2a')]);if(_0xb32e28[_0x7366('0x2b')]>0x0){return _0x37b251['status'](0x190)[_0x7366('0x2c')](_0xb32e28);}var _0x2d1c52=_0x570459[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3cf180=_0x570459[_0x7366('0x2a')][_0x7366('0x28')];return getAgent(_0x2d1c52)[_0x7366('0x1d')](function(_0x2ad8bf){logger['info'](_0x7366('0x30'),_0x2ad8bf[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x2ad8bf[_0x7366('0x1a')]),'webbar:hold',{'sessionId':_0x3cf180});return _0x37b251[_0x7366('0x32')](0xc8)['json']({'error':![],'message':_0x7366('0x39')});})[_0x7366('0x21')](handleError(_0x37b251));};exports[_0x7366('0x3a')]=function(_0x22026a,_0x588b31){logger[_0x7366('0x15')](_0x7366('0x3b'),_0x22026a[_0x7366('0x2a')]);var _0x46a532=unholdValidation[_0x7366('0xe')](_0x22026a[_0x7366('0x2a')]);if(_0x46a532[_0x7366('0x2b')]>0x0){return _0x588b31[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x46a532);}var _0x336b4d=_0x22026a[_0x7366('0x2a')][_0x7366('0x2d')];var _0x5d2a2c=_0x22026a[_0x7366('0x2a')]['sessionId'];return getAgent(_0x336b4d)['then'](function(_0x1d488b){logger[_0x7366('0x15')]('entityFound:',_0x1d488b[_0x7366('0x1a')]);emit(util[_0x7366('0x31')]('user:%s',_0x1d488b['name']),_0x7366('0x3c'),{'sessionId':_0x5d2a2c});return _0x588b31['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x3d')});})['catch'](handleError(_0x588b31));};exports[_0x7366('0x3e')]=function(_0x1b3923,_0xcce4ef){logger['info'](_0x7366('0x3f'),_0xcce4ef[_0x7366('0x2a')]);var _0x2ca931=callsValidation[_0x7366('0xe')](_0x1b3923['body']);if(_0x2ca931[_0x7366('0x2b')]>0x0){return _0xcce4ef[_0x7366('0x32')](0x190)[_0x7366('0x2c')](_0x2ca931);}var _0xa15c2b=_0x1b3923[_0x7366('0x2a')]['userId'];var _0x1249a7=respondWithRpcPromise(_0x7366('0x24'));var _0x5b3160=getAgent(_0xa15c2b);return Promise[_0x7366('0x40')]([_0x1249a7,_0x5b3160])['then'](function(_0x2335cc){var _0x5cbefc=_0x2335cc[0x0];var _0x427066=_0x2335cc[0x1];var _0x16d438=_['filter'](_0x5cbefc[_0x7366('0x26')],function(_0xec468a){return _0xec468a[_0x7366('0x27')]==_0x427066['id'];});return _0xcce4ef[_0x7366('0x32')](0xc8)['json']({'count':_0x16d438['length'],'rows':_0x16d438});})[_0x7366('0x21')](handleError(_0xcce4ef));};exports['conference']=function(_0x432755,_0x14f758){logger[_0x7366('0x15')](_0x7366('0x41'),_0x432755[_0x7366('0x2a')]);var _0x3e64b7=conferenceValidation[_0x7366('0xe')](_0x432755[_0x7366('0x2a')]);if(_0x3e64b7[_0x7366('0x2b')]>0x0){return _0x14f758['status'](0x190)[_0x7366('0x2c')](_0x3e64b7);}var _0x52d254=_0x432755['body']['userId'];return getAgent(_0x52d254)[_0x7366('0x1d')](function(_0x523016){logger[_0x7366('0x15')]('entityFound:',_0x523016[_0x7366('0x1a')]);emit(util['format'](_0x7366('0x34'),_0x523016[_0x7366('0x1a')]),'webbar:conference');return _0x14f758['status'](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x42')});})[_0x7366('0x21')](handleError(_0x14f758));};exports[_0x7366('0x43')]=function(_0x5dc9e2,_0x349bd2){logger[_0x7366('0x15')](_0x7366('0x44'),_0x5dc9e2['body']);var _0x5a9aeb=transferValidation[_0x7366('0xe')](_0x5dc9e2[_0x7366('0x2a')]);if(_0x5a9aeb[_0x7366('0x2b')]>0x0){return _0x349bd2['status'](0x190)[_0x7366('0x2c')](_0x5a9aeb);}var _0x1e121f=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x2d')];var _0x3aa57b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x28')];var _0x38c65b=_0x5dc9e2[_0x7366('0x2a')][_0x7366('0x45')];return getAgent(_0x1e121f)[_0x7366('0x1d')](function(_0x5d5c2e){logger[_0x7366('0x15')](_0x7366('0x30'),_0x5d5c2e['name']);emit(util[_0x7366('0x31')]('user:%s',_0x5d5c2e['name']),_0x7366('0x46'),{'sessionId':_0x3aa57b,'transferNumber':_0x38c65b});return _0x349bd2[_0x7366('0x32')](0xc8)[_0x7366('0x2c')]({'error':![],'message':_0x7366('0x47')});})[_0x7366('0x21')](handleError(_0x349bd2));}; \ No newline at end of file +var _0xa588=['client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','emit','handleError:','error','name','status','send','NotFound','request','then','code','message','result','catch','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','transfer','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise'];(function(_0x1fd4d7,_0x2feafd){var _0x7efe8a=function(_0xc54f55){while(--_0xc54f55){_0x1fd4d7['push'](_0x1fd4d7['shift']());}};_0x7efe8a(++_0x2feafd);}(_0xa588,0xe1));var _0x8a58=function(_0x243de9,_0x1897bb){_0x243de9=_0x243de9-0x0;var _0x58e4bd=_0xa588[_0x243de9];return _0x58e4bd;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x8a58('0x0'));var db=require(_0x8a58('0x1'))['db'];var config=require(_0x8a58('0x2'));var util=require(_0x8a58('0x3'));var BPromise=require(_0x8a58('0x4'));var jayson=require(_0x8a58('0x5'));var amiClient=jayson[_0x8a58('0x6')][_0x8a58('0x7')]({'port':0x232a});var logger=require(_0x8a58('0x8'))('webbarapi');var Redis=require(_0x8a58('0x9'));config[_0x8a58('0xa')]=_[_0x8a58('0xb')](config[_0x8a58('0xa')],{'host':_0x8a58('0xc'),'port':0x18eb});var io=require(_0x8a58('0xd'))(new Redis(config[_0x8a58('0xa')]));var Schema=require(_0x8a58('0xe'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'callNumber':{'type':_0x8a58('0x10'),'required':[!![],_0x8a58('0x11')]},'callerId':{'type':_0x8a58('0x10')},'callbackUrl':{'type':_0x8a58('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'sessionId':{'type':_0x8a58('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':[!![],_0x8a58('0x13')]},'transferNumber':{'type':_0x8a58('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x8a58('0x12'),'required':[!![],_0x8a58('0xf')]}});function emit(_0x26e3a8,_0xd967db,_0xddfaae){logger['info'](_0x26e3a8,_0xd967db,JSON['stringify'](_0xddfaae));io['to'](_0x26e3a8)[_0x8a58('0x14')](_0xd967db,_0xddfaae);}function handleError(_0x107e0a){return function(_0x18a14d){console['log'](_0x8a58('0x15'),_0x18a14d,_0x18a14d instanceof RangeError);logger[_0x8a58('0x16')](_0x18a14d['stack']);if(_0x18a14d instanceof RangeError){if(_0x18a14d[_0x8a58('0x17')]){delete _0x18a14d[_0x8a58('0x17')];}_0x107e0a[_0x8a58('0x18')](0x194)[_0x8a58('0x19')](_0x18a14d);}else{if(_0x18a14d[_0x8a58('0x17')]){delete _0x18a14d[_0x8a58('0x17')];}_0x107e0a[_0x8a58('0x18')](0x1f4)[_0x8a58('0x19')](_0x18a14d);}};}function checkError(){return function(_0x92951){if(!_0x92951){throw new RangeError(_0x8a58('0x1a'));}return _0x92951;};}function respondWithRpcPromise(_0xb20cfe,_0x844b58){return new BPromise(function(_0x3758fa,_0x34adb8){var _0x561a9a=amiClient;return _0x561a9a[_0x8a58('0x1b')](_0xb20cfe,_0x844b58)[_0x8a58('0x1c')](function(_0x20a6c5){if(_0x20a6c5[_0x8a58('0x16')]){if(_0x20a6c5[_0x8a58('0x16')][_0x8a58('0x1d')]===0x1f4){return _0x34adb8(_0x20a6c5[_0x8a58('0x16')]['message']);}return _0x3758fa(_0x20a6c5[_0x8a58('0x16')][_0x8a58('0x1e')]);}else{_0x3758fa(_0x20a6c5[_0x8a58('0x1f')]);}})[_0x8a58('0x20')](function(_0x4fb0fb){_0x34adb8(_0x4fb0fb);});});}function getAgent(_0x1e9c3b){return db[_0x8a58('0x21')][_0x8a58('0x22')]({'where':{'id':_0x1e9c3b,'role':'agent'}})[_0x8a58('0x1c')](checkError());}function getAgentCheckSession(_0x31abcc,_0x4426ff){return new BPromise(function(_0x27d7c8,_0x367aec){var _0x3e317f=respondWithRpcPromise(_0x8a58('0x23'));var _0x4d5041=getAgent(_0x31abcc);Promise[_0x8a58('0x24')]([_0x3e317f,_0x4d5041])['then'](function(_0x501aa1){var _0x5e7265=_0x501aa1[0x0];var _0x4cfc96=_0x501aa1[0x1];var _0x5a9c53=_[_0x8a58('0x25')](_0x5e7265[_0x8a58('0x26')],function(_0x1b2d9e){return _0x1b2d9e[_0x8a58('0x27')]==_0x4cfc96['id']&&_0x1b2d9e[_0x8a58('0x28')]==_0x4426ff;});if(_0x5a9c53[_0x8a58('0x29')]==0x1){_0x27d7c8(_0x4cfc96);}else{_0x367aec(new RangeError(_0x8a58('0x2a')+_0x4426ff+_0x8a58('0x2b')));}});});}exports[_0x8a58('0x2c')]=function(_0x3d9e3a,_0x8ab99c){logger[_0x8a58('0x2d')](_0x8a58('0x2e'),_0x3d9e3a['body']);var _0x330e8a=originateValidation[_0x8a58('0xe')](_0x3d9e3a[_0x8a58('0x2f')]);if(_0x330e8a[_0x8a58('0x29')]>0x0){return _0x8ab99c[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x330e8a);}var _0x50c73d=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x25ecd6=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x32')];var _0x264cc7=_0x3d9e3a[_0x8a58('0x2f')]['callerId'];var _0x3d1fb0=_0x3d9e3a[_0x8a58('0x2f')][_0x8a58('0x33')];return getAgent(_0x50c73d)['then'](function(_0x5ecfea){logger['info'](_0x8a58('0x34'),_0x5ecfea[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x5ecfea['name']),_0x8a58('0x37'),{'callNumber':_0x25ecd6,'callerId':_0x264cc7,'callbackUrl':_0x3d1fb0});return _0x8ab99c[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x38')});})['catch'](handleError(_0x8ab99c));};exports[_0x8a58('0x39')]=function(_0x2a7c70,_0x5aad83){logger[_0x8a58('0x2d')](_0x8a58('0x3a'),_0x2a7c70[_0x8a58('0x2f')]);var _0x35d930=hangupValidation[_0x8a58('0xe')](_0x2a7c70[_0x8a58('0x2f')]);if(_0x35d930['length']>0x0){return _0x5aad83['status'](0x190)[_0x8a58('0x30')](_0x35d930);}var _0x31b8fe=_0x2a7c70['body'][_0x8a58('0x31')];var _0x2e1d71=_0x2a7c70[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x31b8fe)[_0x8a58('0x1c')](function(_0x4e9e04){logger[_0x8a58('0x2d')]('entityFound:',_0x4e9e04[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x4e9e04[_0x8a58('0x17')]),_0x8a58('0x3b'),{'sessionId':_0x2e1d71});return _0x5aad83[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x5aad83));};exports[_0x8a58('0x3c')]=function(_0x54e454,_0x53fd19){logger[_0x8a58('0x2d')](_0x8a58('0x3d'),_0x54e454[_0x8a58('0x2f')]);var _0x573cd3=answerValidation['validate'](_0x54e454[_0x8a58('0x2f')]);if(_0x573cd3['length']>0x0){return _0x53fd19[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x573cd3);}var _0x3feec0=_0x54e454[_0x8a58('0x2f')]['userId'];var _0x417951=_0x54e454[_0x8a58('0x2f')]['sessionId'];return getAgent(_0x3feec0)[_0x8a58('0x1c')](function(_0xba52de){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0xba52de['name']);emit(util[_0x8a58('0x35')]('user:%s',_0xba52de[_0x8a58('0x17')]),_0x8a58('0x3e'),{'sessionId':_0x417951});return _0x53fd19['status'](0xc8)[_0x8a58('0x30')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x53fd19));};exports[_0x8a58('0x3f')]=function(_0x417b08,_0x177ba9){logger[_0x8a58('0x2d')](_0x8a58('0x40'),_0x417b08[_0x8a58('0x2f')]);var _0x507423=holdValidation['validate'](_0x417b08[_0x8a58('0x2f')]);if(_0x507423[_0x8a58('0x29')]>0x0){return _0x177ba9[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x507423);}var _0x1ec51b=_0x417b08[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x903c85=_0x417b08[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x1ec51b)[_0x8a58('0x1c')](function(_0x392c32){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x392c32['name']);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x392c32[_0x8a58('0x17')]),_0x8a58('0x41'),{'sessionId':_0x903c85});return _0x177ba9[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x42')});})['catch'](handleError(_0x177ba9));};exports['unhold']=function(_0x5ab682,_0x31e12a){logger[_0x8a58('0x2d')](_0x8a58('0x43'),_0x5ab682['body']);var _0x3883ee=unholdValidation[_0x8a58('0xe')](_0x5ab682[_0x8a58('0x2f')]);if(_0x3883ee[_0x8a58('0x29')]>0x0){return _0x31e12a[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x3883ee);}var _0x22f5aa=_0x5ab682[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x2f48ef=_0x5ab682[_0x8a58('0x2f')][_0x8a58('0x28')];return getAgent(_0x22f5aa)['then'](function(_0xf44eaa){logger[_0x8a58('0x2d')]('entityFound:',_0xf44eaa[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0xf44eaa['name']),_0x8a58('0x44'),{'sessionId':_0x2f48ef});return _0x31e12a['status'](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x45')});})[_0x8a58('0x20')](handleError(_0x31e12a));};exports[_0x8a58('0x46')]=function(_0x3c7225,_0xfd0229){logger[_0x8a58('0x2d')](_0x8a58('0x47'),_0xfd0229[_0x8a58('0x2f')]);var _0x53fbde=callsValidation[_0x8a58('0xe')](_0x3c7225[_0x8a58('0x2f')]);if(_0x53fbde[_0x8a58('0x29')]>0x0){return _0xfd0229[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x53fbde);}var _0x57adf4=_0x3c7225[_0x8a58('0x2f')][_0x8a58('0x31')];var _0xa01a37=respondWithRpcPromise(_0x8a58('0x23'));var _0x1022d5=getAgent(_0x57adf4);return Promise[_0x8a58('0x24')]([_0xa01a37,_0x1022d5])[_0x8a58('0x1c')](function(_0x38e435){var _0x515f26=_0x38e435[0x0];var _0x415dea=_0x38e435[0x1];var _0xbf6332=_[_0x8a58('0x25')](_0x515f26['rows'],function(_0x229e68){return _0x229e68['UserId']==_0x415dea['id'];});return _0xfd0229[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'count':_0xbf6332[_0x8a58('0x29')],'rows':_0xbf6332});})[_0x8a58('0x20')](handleError(_0xfd0229));};exports[_0x8a58('0x48')]=function(_0x2f653d,_0x1b8292){logger[_0x8a58('0x2d')]('conference\x20fired:',_0x2f653d['body']);var _0x455aeb=conferenceValidation[_0x8a58('0xe')](_0x2f653d[_0x8a58('0x2f')]);if(_0x455aeb[_0x8a58('0x29')]>0x0){return _0x1b8292[_0x8a58('0x18')](0x190)[_0x8a58('0x30')](_0x455aeb);}var _0x1b4f68=_0x2f653d['body'][_0x8a58('0x31')];return getAgent(_0x1b4f68)[_0x8a58('0x1c')](function(_0x493ccd){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x493ccd[_0x8a58('0x17')]);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x493ccd[_0x8a58('0x17')]),'webbar:conference');return _0x1b8292[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':'conference\x20executed!'});})[_0x8a58('0x20')](handleError(_0x1b8292));};exports[_0x8a58('0x49')]=function(_0x19e256,_0x26b333){logger['info']('transfer\x20fired:',_0x19e256[_0x8a58('0x2f')]);var _0x5ce699=transferValidation[_0x8a58('0xe')](_0x19e256[_0x8a58('0x2f')]);if(_0x5ce699[_0x8a58('0x29')]>0x0){return _0x26b333[_0x8a58('0x18')](0x190)['json'](_0x5ce699);}var _0xb0b5da=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x31')];var _0x371930=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x28')];var _0x9046f1=_0x19e256[_0x8a58('0x2f')][_0x8a58('0x4a')];return getAgent(_0xb0b5da)[_0x8a58('0x1c')](function(_0x318acd){logger[_0x8a58('0x2d')](_0x8a58('0x34'),_0x318acd['name']);emit(util[_0x8a58('0x35')](_0x8a58('0x36'),_0x318acd[_0x8a58('0x17')]),_0x8a58('0x4b'),{'sessionId':_0x371930,'transferNumber':_0x9046f1});return _0x26b333[_0x8a58('0x18')](0xc8)[_0x8a58('0x30')]({'error':![],'message':_0x8a58('0x4c')});})[_0x8a58('0x20')](handleError(_0x26b333));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index abd1d6e..a3e2a8a 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 _0xc1be=['../../components/interaction/service','../../config/environment','./whatsappAccount.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','create','post','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','send','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5de0ef,_0x211b39){var _0x2d859e=function(_0x3fad24){while(--_0x3fad24){_0x5de0ef['push'](_0x5de0ef['shift']());}};_0x2d859e(++_0x211b39);}(_0xc1be,0x16b));var _0xec1b=function(_0x884e20,_0x2eeb34){_0x884e20=_0x884e20-0x0;var _0x506d24=_0xc1be[_0x884e20];return _0x506d24;};'use strict';var multer=require(_0xec1b('0x0'));var util=require('util');var path=require(_0xec1b('0x1'));var timeout=require(_0xec1b('0x2'));var express=require(_0xec1b('0x3'));var router=express[_0xec1b('0x4')]();var fs_extra=require(_0xec1b('0x5'));var auth=require(_0xec1b('0x6'));var interaction=require(_0xec1b('0x7'));var config=require(_0xec1b('0x8'));var controller=require(_0xec1b('0x9'));router['get']('/',auth[_0xec1b('0xa')](),controller['index']);router['get'](_0xec1b('0xb'),auth[_0xec1b('0xa')](),controller[_0xec1b('0xc')]);router[_0xec1b('0xd')](_0xec1b('0xe'),auth['isAuthenticated'](),controller[_0xec1b('0xf')]);router[_0xec1b('0xd')](_0xec1b('0x10'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x11')]);router[_0xec1b('0xd')](_0xec1b('0x12'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x13')]);router[_0xec1b('0xd')](_0xec1b('0x14'),auth['isAuthenticated'](),controller[_0xec1b('0x15')]);router[_0xec1b('0xd')]('/:id/applications',auth[_0xec1b('0xa')](),controller[_0xec1b('0x16')]);router['post']('/',auth[_0xec1b('0xa')](),controller[_0xec1b('0x17')]);router[_0xec1b('0x18')](_0xec1b('0x10'),auth['isAuthenticated'](),controller[_0xec1b('0x19')]);router['post'](_0xec1b('0x12'),auth['isAuthenticated'](),controller[_0xec1b('0x1a')]);router[_0xec1b('0x18')](_0xec1b('0x14'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x1b')]);router[_0xec1b('0x18')]('/:id/applications',auth['isAuthenticated'](),controller[_0xec1b('0x1c')]);router[_0xec1b('0x18')](_0xec1b('0x1d'),controller['notify']);router[_0xec1b('0x18')]('/:id/send',auth[_0xec1b('0xa')](),controller[_0xec1b('0x1e')]);router[_0xec1b('0x1f')](_0xec1b('0xe'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x20')]);router[_0xec1b('0x21')](_0xec1b('0xe'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x22')]);router[_0xec1b('0x21')](_0xec1b('0x10'),auth[_0xec1b('0xa')](),controller[_0xec1b('0x23')]);router['delete'](_0xec1b('0x12'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xec1b('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xec1b('0x24')]=router; \ No newline at end of file +var _0x401a=['/:id/users','getAgents','getApplications','post','/:id/canned_answers','addAnswer','/:id/applications','notify','send','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions'];(function(_0x9cede6,_0x435984){var _0x48aa48=function(_0x310993){while(--_0x310993){_0x9cede6['push'](_0x9cede6['shift']());}};_0x48aa48(++_0x435984);}(_0x401a,0x1c1));var _0xa401=function(_0x27c6bc,_0x23e64b){_0x27c6bc=_0x27c6bc-0x0;var _0x1596b8=_0x401a[_0x27c6bc];return _0x1596b8;};'use strict';var multer=require(_0xa401('0x0'));var util=require('util');var path=require(_0xa401('0x1'));var timeout=require(_0xa401('0x2'));var express=require(_0xa401('0x3'));var router=express['Router']();var fs_extra=require(_0xa401('0x4'));var auth=require(_0xa401('0x5'));var interaction=require(_0xa401('0x6'));var config=require(_0xa401('0x7'));var controller=require(_0xa401('0x8'));router[_0xa401('0x9')]('/',auth[_0xa401('0xa')](),controller['index']);router[_0xa401('0x9')](_0xa401('0xb'),auth[_0xa401('0xa')](),controller[_0xa401('0xc')]);router[_0xa401('0x9')]('/:id',auth[_0xa401('0xa')](),controller[_0xa401('0xd')]);router['get'](_0xa401('0xe'),auth[_0xa401('0xa')](),controller['getDispositions']);router[_0xa401('0x9')]('/:id/canned_answers',auth[_0xa401('0xa')](),controller['getAnswers']);router[_0xa401('0x9')](_0xa401('0xf'),auth[_0xa401('0xa')](),controller[_0xa401('0x10')]);router[_0xa401('0x9')]('/:id/applications',auth[_0xa401('0xa')](),controller[_0xa401('0x11')]);router['post']('/',auth[_0xa401('0xa')](),controller['create']);router['post'](_0xa401('0xe'),auth[_0xa401('0xa')](),controller['addDisposition']);router[_0xa401('0x12')](_0xa401('0x13'),auth[_0xa401('0xa')](),controller[_0xa401('0x14')]);router['post'](_0xa401('0xf'),auth[_0xa401('0xa')](),controller['addAgents']);router[_0xa401('0x12')](_0xa401('0x15'),auth[_0xa401('0xa')](),controller['addApplications']);router[_0xa401('0x12')]('/:id/notify',controller[_0xa401('0x16')]);router[_0xa401('0x12')]('/:id/send',auth[_0xa401('0xa')](),controller[_0xa401('0x17')]);router[_0xa401('0x18')](_0xa401('0x19'),auth[_0xa401('0xa')](),controller[_0xa401('0x1a')]);router[_0xa401('0x1b')](_0xa401('0x19'),auth[_0xa401('0xa')](),controller[_0xa401('0x1c')]);router['delete'](_0xa401('0xe'),auth[_0xa401('0xa')](),controller['removeDispositions']);router[_0xa401('0x1b')](_0xa401('0x13'),auth[_0xa401('0xa')](),controller['removeAnswers']);router[_0xa401('0x1b')](_0xa401('0xf'),auth[_0xa401('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 919b69c..9568313 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 _0xdca7=['exports','STRING','name','ENUM','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize'];(function(_0x39d612,_0x4189ba){var _0x595252=function(_0x625bcd){while(--_0x625bcd){_0x39d612['push'](_0x39d612['shift']());}};_0x595252(++_0x4189ba);}(_0xdca7,0xe6));var _0x7dca=function(_0x429b85,_0x5cbf97){_0x429b85=_0x429b85-0x0;var _0x3356e7=_0xdca7[_0x429b85];return _0x3356e7;};'use strict';var Sequelize=require(_0x7dca('0x0'));var rs=require('randomstring');module[_0x7dca('0x1')]={'name':{'type':Sequelize[_0x7dca('0x2')],'unique':_0x7dca('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x7dca('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x7dca('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7dca('0x4')]('twilio','sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x7dca('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x7dca('0x5');}},'notificationSound':{'type':Sequelize[_0x7dca('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x7dca('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7dca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x7dca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7dca('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7dca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7dca('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7dca('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7dca('0x7')],'comment':_0x7dca('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7dca('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x36b4c0){if(!_0x36b4c0){this[_0x7dca('0x9')]('mandatoryDispositionPauseId',null);}this[_0x7dca('0x9')](_0x7dca('0xa'),_0x36b4c0);}},'description':{'type':Sequelize[_0x7dca('0x2')]}}; \ No newline at end of file +var _0xab1d=['sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xab1d,0x130));var _0xdab1=function(_0x133887,_0x6b8630){_0x133887=_0x133887-0x0;var _0x5ebb03=_0xab1d[_0x133887];return _0x5ebb03;};'use strict';var Sequelize=require(_0xdab1('0x0'));var rs=require(_0xdab1('0x1'));module[_0xdab1('0x2')]={'name':{'type':Sequelize[_0xdab1('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xdab1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xdab1('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xdab1('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xdab1('0x5')](_0xdab1('0x6'),_0xdab1('0x7'))},'accountSid':{'type':Sequelize[_0xdab1('0x3')]},'baseUrl':{'type':Sequelize[_0xdab1('0x3')]},'authToken':{'type':Sequelize[_0xdab1('0x3')]},'notificationTemplate':{'type':Sequelize[_0xdab1('0x8')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xdab1('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xdab1('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xdab1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xdab1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xdab1('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xdab1('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xdab1('0xa')],'comment':_0xdab1('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xdab1('0xc'),'set':function(_0x9dcec7){if(!_0x9dcec7){this[_0xdab1('0xd')](_0xdab1('0xe'),null);}this[_0xdab1('0xd')](_0xdab1('0xf'),_0x9dcec7);}},'description':{'type':Sequelize[_0xdab1('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index e27cd7d..235336a 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 _0x72f6=['DESC','list','defaults','CmContact','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','queueId','waitForTheAssignedQueue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','\x0a','List','Messages','dataValues','push','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','name','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','WhatsappAccount','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','WhatsappAccountId','options','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','finally','getApplications','notify','Applications','account','sinch','statuses','state','read','WhatsappMessage','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','whatsapp:','Body','MessageSid','notifications','messageId','message_id','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts'];(function(_0x4c8600,_0x75404){var _0x70d4a1=function(_0x18fcb6){while(--_0x18fcb6){_0x4c8600['push'](_0x4c8600['shift']());}};_0x70d4a1(++_0x75404);}(_0x72f6,0x1a9));var _0x672f=function(_0x24e1c6,_0x2c9231){_0x24e1c6=_0x24e1c6-0x0;var _0x476fe0=_0x72f6[_0x24e1c6];return _0x476fe0;};'use strict';var emlformat=require(_0x672f('0x0'));var rimraf=require(_0x672f('0x1'));var zipdir=require(_0x672f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x672f('0x3'));var moment=require(_0x672f('0x4'));var BPromise=require(_0x672f('0x5'));var Mustache=require(_0x672f('0x6'));var util=require('util');var path=require(_0x672f('0x7'));var sox=require(_0x672f('0x8'));var csv=require(_0x672f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x672f('0xa'));var _=require(_0x672f('0xb'));var squel=require(_0x672f('0xc'));var crypto=require(_0x672f('0xd'));var jsforce=require(_0x672f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x672f('0x9'));var querystring=require(_0x672f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x672f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x672f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x672f('0x12'));var utils=require(_0x672f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x672f('0x14'));var db=require(_0x672f('0x15'))['db'];config[_0x672f('0x16')]=_['defaults'](config[_0x672f('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x672f('0x17'))(new Redis(config['redis']));require(_0x672f('0x18'))['register'](socket);var jayson=require(_0x672f('0x19'));var client=jayson[_0x672f('0x1a')][_0x672f('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x24ed3f,_0x24d0cc,_0x5d553e,_0x2720d0){return new BPromise(function(_0x23ff32,_0x321349){var _0x23db1a=_0x2720d0||client;return _0x23db1a[_0x672f('0x1c')](_0x24ed3f,_0x5d553e)[_0x672f('0x1d')](function(_0x14c42b){logger[_0x672f('0x1e')](_0x672f('0x1f'),_0x24d0cc,_0x672f('0x20'));logger[_0x672f('0x21')](_0x672f('0x22'),_0x24d0cc,_0x672f('0x20'),JSON[_0x672f('0x23')](_0x14c42b));if(_0x14c42b[_0x672f('0x24')]){if(_0x14c42b[_0x672f('0x24')]['code']===0x1f4){logger[_0x672f('0x24')](_0x672f('0x1f'),_0x24d0cc,_0x14c42b[_0x672f('0x24')][_0x672f('0x25')]);return _0x321349(_0x14c42b[_0x672f('0x24')][_0x672f('0x25')]);}logger[_0x672f('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x24d0cc,_0x14c42b[_0x672f('0x24')][_0x672f('0x25')]);return _0x23ff32(_0x14c42b[_0x672f('0x24')]['message']);}else{logger[_0x672f('0x1e')](_0x672f('0x1f'),_0x24d0cc,_0x672f('0x20'));_0x23ff32(_0x14c42b[_0x672f('0x26')][_0x672f('0x25')]);}})[_0x672f('0x27')](function(_0x488ced){logger[_0x672f('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x24d0cc,_0x488ced);_0x321349(_0x488ced);});});}function respondWithStatusCode(_0x425642,_0x2276bf){_0x2276bf=_0x2276bf||0xcc;return function(_0x42b018){if(_0x42b018){return _0x425642[_0x672f('0x28')](_0x2276bf);}return _0x425642[_0x672f('0x29')](_0x2276bf)[_0x672f('0x2a')]();};}function respondWithResult(_0x43966a,_0x2cf45b){_0x2cf45b=_0x2cf45b||0xc8;return function(_0x27b859){if(_0x27b859){return _0x43966a['status'](_0x2cf45b)[_0x672f('0x2b')](_0x27b859);}};}function respondWithFilteredResult(_0x8be90b,_0x73eb33){return function(_0xb36d43){if(_0xb36d43){var _0x8b3721=typeof _0x73eb33[_0x672f('0x2c')]==='undefined'&&typeof _0x73eb33[_0x672f('0x2d')]===_0x672f('0x2e');var _0x5dd0d4=_0xb36d43[_0x672f('0x2f')];var _0x44403d=_0x8b3721?0x0:_0x73eb33[_0x672f('0x2c')];var _0x18ba2e=_0x8b3721?_0xb36d43['count']:_0x73eb33[_0x672f('0x2c')]+_0x73eb33[_0x672f('0x2d')];var _0x33986b;if(_0x18ba2e>=_0x5dd0d4){_0x18ba2e=_0x5dd0d4;_0x33986b=0xc8;}else{_0x33986b=0xce;}_0x8be90b[_0x672f('0x29')](_0x33986b);return _0x8be90b['set'](_0x672f('0x30'),_0x44403d+'-'+_0x18ba2e+'/'+_0x5dd0d4)['json'](_0xb36d43);}return null;};}function patchUpdates(_0x3bf046){return function(_0x2badac){try{jsonpatch[_0x672f('0x31')](_0x2badac,_0x3bf046,!![]);}catch(_0x19156f){return BPromise[_0x672f('0x32')](_0x19156f);}return _0x2badac[_0x672f('0x33')]();};}function saveUpdates(_0x1ef383,_0x3d4ba2){return function(_0xfe2500){if(_0xfe2500){return _0xfe2500[_0x672f('0x34')](_0x1ef383)[_0x672f('0x1d')](function(_0x5537a0){return _0x5537a0;});}return null;};}function removeEntity(_0x3b3923,_0x1a55d6){return function(_0x516ff4){if(_0x516ff4){return _0x516ff4[_0x672f('0x35')]()[_0x672f('0x1d')](function(){var _0x15be14=_0x516ff4[_0x672f('0x36')]({'plain':!![]});var _0x49e655='WhatsappAccounts';return db[_0x672f('0x37')][_0x672f('0x35')]({'where':{'type':_0x49e655,'resourceId':_0x15be14['id']}})['then'](function(){return _0x516ff4;});})['then'](function(){_0x3b3923[_0x672f('0x29')](0xcc)[_0x672f('0x2a')]();});}};}function handleEntityNotFound(_0x48adf3,_0x4bbea3){return function(_0x12d088){if(!_0x12d088){_0x48adf3[_0x672f('0x28')](0x194);}return _0x12d088;};}function handleError(_0xc4e0dd,_0x180569){_0x180569=_0x180569||0x1f4;return function(_0x5cad51){logger[_0x672f('0x24')](_0x5cad51[_0x672f('0x38')]);if(_0x5cad51['name']){delete _0x5cad51['name'];}_0xc4e0dd[_0x672f('0x29')](_0x180569)[_0x672f('0x39')](_0x5cad51);};}exports[_0x672f('0x3a')]=function(_0x89e84b,_0x4b5d1e){var _0x55f869={'include':[{'model':db[_0x672f('0x3b')],'as':_0x672f('0x3c')}]},_0x110cc5={},_0x5ebd51={'count':0x0,'rows':[]};var _0x3b81ec=_['map'](db['WhatsappAccount'][_0x672f('0x3d')],function(_0x15c2ed){return{'name':_0x15c2ed[_0x672f('0x3e')],'type':_0x15c2ed[_0x672f('0x3f')][_0x672f('0x40')]};});_0x110cc5['model']=_[_0x672f('0x41')](_0x3b81ec,_0x672f('0x42'));_0x110cc5[_0x672f('0x43')]=_[_0x672f('0x44')](_0x89e84b[_0x672f('0x43')]);_0x110cc5['filters']=_['intersection'](_0x110cc5[_0x672f('0x45')],_0x110cc5[_0x672f('0x43')]);_0x55f869[_0x672f('0x46')]=_[_0x672f('0x47')](_0x110cc5[_0x672f('0x45')],qs[_0x672f('0x48')](_0x89e84b[_0x672f('0x43')][_0x672f('0x48')]));_0x55f869[_0x672f('0x46')]=_0x55f869['attributes'][_0x672f('0x49')]?_0x55f869['attributes']:_0x110cc5[_0x672f('0x45')];if(!_0x89e84b[_0x672f('0x43')]['hasOwnProperty'](_0x672f('0x4a'))){_0x55f869[_0x672f('0x2d')]=qs[_0x672f('0x2d')](_0x89e84b[_0x672f('0x43')]['limit']);_0x55f869[_0x672f('0x2c')]=qs[_0x672f('0x2c')](_0x89e84b[_0x672f('0x43')][_0x672f('0x2c')]);}_0x55f869[_0x672f('0x4b')]=qs['sort'](_0x89e84b[_0x672f('0x43')][_0x672f('0x4c')]);_0x55f869[_0x672f('0x4d')]=qs[_0x672f('0x4e')](_[_0x672f('0x4f')](_0x89e84b[_0x672f('0x43')],_0x110cc5[_0x672f('0x4e')]),_0x3b81ec);if(_0x89e84b['query'][_0x672f('0x50')]){_0x55f869['where']=_[_0x672f('0x51')](_0x55f869[_0x672f('0x4d')],{'$or':_[_0x672f('0x41')](_0x3b81ec,function(_0x10ae47){if(_0x10ae47[_0x672f('0x3f')]!==_0x672f('0x52')){var _0x3816fc={};_0x3816fc[_0x10ae47[_0x672f('0x42')]]={'$like':'%'+_0x89e84b[_0x672f('0x43')][_0x672f('0x50')]+'%'};return _0x3816fc;}})});}_0x55f869=_[_0x672f('0x51')]({},_0x55f869,_0x89e84b['options']);var _0x485b09={'where':_0x55f869[_0x672f('0x4d')]};return db[_0x672f('0x53')]['count'](_0x485b09)[_0x672f('0x1d')](function(_0x4a071e){_0x5ebd51['count']=_0x4a071e;if(_0x89e84b[_0x672f('0x43')][_0x672f('0x54')]){_0x55f869[_0x672f('0x55')]=[{'all':!![]}];}return db[_0x672f('0x53')][_0x672f('0x56')](_0x55f869);})[_0x672f('0x1d')](function(_0x171a4e){_0x5ebd51[_0x672f('0x57')]=_0x171a4e;return _0x5ebd51;})[_0x672f('0x1d')](respondWithFilteredResult(_0x4b5d1e,_0x55f869))['catch'](handleError(_0x4b5d1e,null));};exports[_0x672f('0x58')]=function(_0x2e93d3,_0x5405d5){var _0x218885={'raw':![],'where':{'id':_0x2e93d3[_0x672f('0x59')]['id']},'include':[{'model':db[_0x672f('0x3b')],'as':_0x672f('0x3c')}]},_0x4d1325={};_0x4d1325[_0x672f('0x45')]=_[_0x672f('0x44')](db[_0x672f('0x53')][_0x672f('0x3d')]);_0x4d1325['query']=_[_0x672f('0x44')](_0x2e93d3[_0x672f('0x43')]);_0x4d1325['filters']=_[_0x672f('0x47')](_0x4d1325[_0x672f('0x45')],_0x4d1325[_0x672f('0x43')]);_0x218885[_0x672f('0x46')]=_[_0x672f('0x47')](_0x4d1325[_0x672f('0x45')],qs[_0x672f('0x48')](_0x2e93d3[_0x672f('0x43')]['fields']));_0x218885['attributes']=_0x218885[_0x672f('0x46')][_0x672f('0x49')]?_0x218885[_0x672f('0x46')]:_0x4d1325[_0x672f('0x45')];if(_0x2e93d3['query'][_0x672f('0x54')]){_0x218885['include']=[{'all':!![]}];}_0x218885=_[_0x672f('0x51')]({},_0x218885,_0x2e93d3['options']);return db[_0x672f('0x53')]['find'](_0x218885)[_0x672f('0x1d')](handleEntityNotFound(_0x5405d5,null))[_0x672f('0x1d')](respondWithResult(_0x5405d5,null))[_0x672f('0x27')](handleError(_0x5405d5,null));};exports[_0x672f('0x5a')]=function(_0x281ef1,_0x104830){return db[_0x672f('0x53')][_0x672f('0x5a')](_0x281ef1[_0x672f('0x5b')],{})[_0x672f('0x1d')](function(_0x53ef6d){var _0x9b4e62=_0x281ef1[_0x672f('0x5c')][_0x672f('0x36')]({'plain':!![]});if(!_0x9b4e62)throw new Error(_0x672f('0x5d'));if(_0x9b4e62[_0x672f('0x5e')]===_0x672f('0x5c')){var _0x51145c=_0x53ef6d[_0x672f('0x36')]({'plain':!![]});var _0x364e4d=_0x672f('0x5f');return db[_0x672f('0x60')][_0x672f('0x61')]({'where':{'name':_0x364e4d,'userProfileId':_0x9b4e62[_0x672f('0x62')]},'raw':!![]})[_0x672f('0x1d')](function(_0x5ec45a){if(_0x5ec45a&&_0x5ec45a[_0x672f('0x63')]===0x0){return db[_0x672f('0x37')]['create']({'name':_0x51145c['name'],'resourceId':_0x51145c['id'],'type':_0x5ec45a['name'],'sectionId':_0x5ec45a['id']},{})['then'](function(){return _0x53ef6d;});}else{return _0x53ef6d;}})['catch'](function(_0x2b5fb2){logger['error'](_0x672f('0x64'),_0x2b5fb2);throw _0x2b5fb2;});}return _0x53ef6d;})[_0x672f('0x1d')](respondWithResult(_0x104830,0xc9))[_0x672f('0x27')](handleError(_0x104830,null));};exports[_0x672f('0x34')]=function(_0x3de455,_0x536e4e){if(_0x3de455['body']['id']){delete _0x3de455['body']['id'];}return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x3de455[_0x672f('0x59')]['id']},'include':[{'model':db[_0x672f('0x3b')],'as':_0x672f('0x3c')}]})[_0x672f('0x1d')](handleEntityNotFound(_0x536e4e,null))[_0x672f('0x1d')](saveUpdates(_0x3de455[_0x672f('0x5b')],null))[_0x672f('0x1d')](respondWithResult(_0x536e4e,null))[_0x672f('0x27')](handleError(_0x536e4e,null));};exports[_0x672f('0x35')]=function(_0x181842,_0x1952d1){return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x181842[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x1952d1,null))[_0x672f('0x1d')](removeEntity(_0x1952d1,null))[_0x672f('0x27')](handleError(_0x1952d1,null));};exports[_0x672f('0x65')]=function(_0xe53d4,_0x26036f){return db[_0x672f('0x53')][_0x672f('0x65')]()[_0x672f('0x1d')](respondWithResult(_0x26036f,null))[_0x672f('0x27')](handleError(_0x26036f,null));};exports[_0x672f('0x66')]=function(_0x2a428e,_0x55b967,_0x3c4db0){if(_0x2a428e['body']['id']){delete _0x2a428e[_0x672f('0x5b')]['id'];}return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x2a428e['params']['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x55b967,null))[_0x672f('0x1d')](function(_0x46a271){if(_0x46a271){_0x2a428e[_0x672f('0x5b')]['WhatsappAccountId']=_0x46a271['id'];return db[_0x672f('0x67')]['create'](_0x2a428e[_0x672f('0x5b')]);}})[_0x672f('0x1d')](respondWithResult(_0x55b967,null))[_0x672f('0x27')](handleError(_0x55b967,null));};exports['getDispositions']=function(_0x300c8a,_0x2f1a8b,_0x41fda6){var _0xff258={'raw':![],'where':{}};var _0x3b94e5={};var _0x2911f6={'count':0x0,'rows':[]};return db[_0x672f('0x53')][_0x672f('0x68')]({'where':{'id':_0x300c8a['params']['id']}})['then'](handleEntityNotFound(_0x2f1a8b,null))[_0x672f('0x1d')](function(_0x451dff){if(_0x451dff){_0x3b94e5['model']=_[_0x672f('0x44')](db[_0x672f('0x67')]['rawAttributes']);_0x3b94e5[_0x672f('0x43')]=_[_0x672f('0x44')](_0x300c8a[_0x672f('0x43')]);_0x3b94e5[_0x672f('0x4e')]=_['intersection'](_0x3b94e5[_0x672f('0x45')],_0x3b94e5['query']);_0xff258[_0x672f('0x46')]=_[_0x672f('0x47')](_0x3b94e5['model'],qs[_0x672f('0x48')](_0x300c8a[_0x672f('0x43')]['fields']));_0xff258[_0x672f('0x46')]=_0xff258[_0x672f('0x46')][_0x672f('0x49')]?_0xff258[_0x672f('0x46')]:_0x3b94e5[_0x672f('0x45')];if(!_0x300c8a[_0x672f('0x43')][_0x672f('0x69')](_0x672f('0x4a'))){_0xff258[_0x672f('0x2d')]=qs[_0x672f('0x2d')](_0x300c8a[_0x672f('0x43')]['limit']);_0xff258[_0x672f('0x2c')]=qs[_0x672f('0x2c')](_0x300c8a['query']['offset']);}_0xff258[_0x672f('0x4b')]=qs['sort'](_0x300c8a[_0x672f('0x43')][_0x672f('0x4c')]);_0xff258[_0x672f('0x4d')]=qs[_0x672f('0x4e')](_[_0x672f('0x4f')](_0x300c8a[_0x672f('0x43')],_0x3b94e5[_0x672f('0x4e')]));_0xff258[_0x672f('0x4d')][_0x672f('0x6a')]=_0x451dff['id'];if(_0x300c8a['query'][_0x672f('0x50')]){_0xff258['where']=_[_0x672f('0x51')](_0xff258[_0x672f('0x4d')],{'$or':_[_0x672f('0x41')](_0xff258[_0x672f('0x46')],function(_0x1a7e34){var _0xd54db2={};_0xd54db2[_0x1a7e34]={'$like':'%'+_0x300c8a[_0x672f('0x43')][_0x672f('0x50')]+'%'};return _0xd54db2;})});}_0xff258=_[_0x672f('0x51')]({},_0xff258,_0x300c8a[_0x672f('0x6b')]);return db['Disposition'][_0x672f('0x2f')]({'where':_0xff258[_0x672f('0x4d')]})['then'](function(_0xce15f1){_0x2911f6[_0x672f('0x2f')]=_0xce15f1;if(_0x300c8a['query']['includeAll']){_0xff258[_0x672f('0x55')]=[{'all':!![]}];}return db[_0x672f('0x67')][_0x672f('0x56')](_0xff258);})[_0x672f('0x1d')](function(_0x1b858c){_0x2911f6[_0x672f('0x57')]=_0x1b858c;return _0x2911f6;});}})['then'](respondWithFilteredResult(_0x2f1a8b,_0xff258))[_0x672f('0x27')](handleError(_0x2f1a8b,null));};exports[_0x672f('0x6c')]=function(_0x263dcf,_0x33b3dd,_0x123a94){return db[_0x672f('0x53')]['find']({'where':{'id':_0x263dcf[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x33b3dd,null))['then'](function(_0x49169e){if(_0x49169e){return _0x49169e[_0x672f('0x6c')](_0x263dcf[_0x672f('0x43')][_0x672f('0x6d')]);}})[_0x672f('0x1d')](respondWithStatusCode(_0x33b3dd,null))['catch'](handleError(_0x33b3dd,null));};exports[_0x672f('0x6e')]=function(_0x314ace,_0x1ad83e,_0x5cee22){if(_0x314ace['body']['id']){delete _0x314ace[_0x672f('0x5b')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x314ace[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x1ad83e,null))['then'](function(_0x2da472){if(_0x2da472){_0x314ace['body'][_0x672f('0x6a')]=_0x2da472['id'];return db[_0x672f('0x6f')][_0x672f('0x5a')](_0x314ace['body']);}})[_0x672f('0x1d')](respondWithResult(_0x1ad83e,null))[_0x672f('0x27')](handleError(_0x1ad83e,null));};exports['getAnswers']=function(_0x6f8d90,_0x406175,_0x53d5b1){var _0x477273={'raw':![],'where':{}};var _0x3676e8={};var _0x481c0b={'count':0x0,'rows':[]};return db[_0x672f('0x53')]['findOne']({'where':{'id':_0x6f8d90[_0x672f('0x59')]['id']}})['then'](handleEntityNotFound(_0x406175,null))[_0x672f('0x1d')](function(_0x28540f){if(_0x28540f){_0x3676e8[_0x672f('0x45')]=_[_0x672f('0x44')](db[_0x672f('0x6f')][_0x672f('0x3d')]);_0x3676e8[_0x672f('0x43')]=_[_0x672f('0x44')](_0x6f8d90[_0x672f('0x43')]);_0x3676e8[_0x672f('0x4e')]=_[_0x672f('0x47')](_0x3676e8[_0x672f('0x45')],_0x3676e8[_0x672f('0x43')]);_0x477273['attributes']=_[_0x672f('0x47')](_0x3676e8[_0x672f('0x45')],qs['fields'](_0x6f8d90['query']['fields']));_0x477273[_0x672f('0x46')]=_0x477273[_0x672f('0x46')][_0x672f('0x49')]?_0x477273['attributes']:_0x3676e8[_0x672f('0x45')];if(!_0x6f8d90[_0x672f('0x43')][_0x672f('0x69')](_0x672f('0x4a'))){_0x477273[_0x672f('0x2d')]=qs[_0x672f('0x2d')](_0x6f8d90[_0x672f('0x43')][_0x672f('0x2d')]);_0x477273['offset']=qs[_0x672f('0x2c')](_0x6f8d90[_0x672f('0x43')][_0x672f('0x2c')]);}_0x477273[_0x672f('0x4b')]=qs[_0x672f('0x4c')](_0x6f8d90[_0x672f('0x43')]['sort']);_0x477273['where']=qs[_0x672f('0x4e')](_[_0x672f('0x4f')](_0x6f8d90[_0x672f('0x43')],_0x3676e8[_0x672f('0x4e')]));_0x477273[_0x672f('0x4d')][_0x672f('0x6a')]=_0x28540f['id'];if(_0x6f8d90[_0x672f('0x43')][_0x672f('0x50')]){_0x477273[_0x672f('0x4d')]=_[_0x672f('0x51')](_0x477273['where'],{'$or':_[_0x672f('0x41')](_0x477273[_0x672f('0x46')],function(_0x5d48d7){var _0x323415={};_0x323415[_0x5d48d7]={'$like':'%'+_0x6f8d90[_0x672f('0x43')]['filter']+'%'};return _0x323415;})});}_0x477273=_[_0x672f('0x51')]({},_0x477273,_0x6f8d90[_0x672f('0x6b')]);return db[_0x672f('0x6f')][_0x672f('0x2f')]({'where':_0x477273[_0x672f('0x4d')]})[_0x672f('0x1d')](function(_0x385f68){_0x481c0b[_0x672f('0x2f')]=_0x385f68;if(_0x6f8d90['query'][_0x672f('0x54')]){_0x477273[_0x672f('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x672f('0x56')](_0x477273);})['then'](function(_0x2693dd){_0x481c0b[_0x672f('0x57')]=_0x2693dd;return _0x481c0b;});}})['then'](respondWithFilteredResult(_0x406175,_0x477273))[_0x672f('0x27')](handleError(_0x406175,null));};exports[_0x672f('0x70')]=function(_0x3cf800,_0x323de7,_0x4ab374){return db[_0x672f('0x53')]['find']({'where':{'id':_0x3cf800[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x323de7,null))[_0x672f('0x1d')](function(_0x318574){if(_0x318574){return _0x318574[_0x672f('0x70')](_0x3cf800[_0x672f('0x43')][_0x672f('0x6d')]);}})[_0x672f('0x1d')](respondWithStatusCode(_0x323de7,null))['catch'](handleError(_0x323de7,null));};exports[_0x672f('0x71')]=function(_0x2781f2,_0x61a19f,_0x146159){return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x2781f2[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x61a19f,null))[_0x672f('0x1d')](function(_0x2a2844){if(_0x2a2844){return _0x2a2844[_0x672f('0x71')](_0x2781f2[_0x672f('0x5b')][_0x672f('0x6d')],_[_0x672f('0x72')](_0x2781f2[_0x672f('0x5b')],[_0x672f('0x6d'),'id'])||{})[_0x672f('0x73')](function(_0x1b0af1){for(var _0x14bfae=0x0;_0x14bfae<_0x2781f2[_0x672f('0x5b')][_0x672f('0x6d')][_0x672f('0x49')];_0x14bfae+=0x1){socket['emit'](_0x672f('0x74'),{'UserId':Number(_0x2781f2[_0x672f('0x5b')][_0x672f('0x6d')][_0x14bfae]),'WhatsappAccountId':Number(_0x2781f2[_0x672f('0x59')]['id'])});}return _0x1b0af1;});}})[_0x672f('0x1d')](respondWithResult(_0x61a19f,null))[_0x672f('0x27')](handleError(_0x61a19f,null));};exports[_0x672f('0x75')]=function(_0x3523ec,_0x37e496,_0x40de62){return db['WhatsappAccount'][_0x672f('0x61')]({'where':{'id':_0x3523ec[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x37e496,null))[_0x672f('0x1d')](function(_0x4871a9){if(_0x4871a9){return _0x4871a9[_0x672f('0x75')](_0x3523ec[_0x672f('0x43')]['ids'])['then'](function(){if(_[_0x672f('0x76')](_0x3523ec[_0x672f('0x43')]['ids'])){for(var _0xb28872=0x0;_0xb28872<_0x3523ec['query'][_0x672f('0x6d')]['length'];_0xb28872+=0x1){socket[_0x672f('0x77')](_0x672f('0x78'),{'UserId':Number(_0x3523ec[_0x672f('0x43')][_0x672f('0x6d')][_0xb28872]),'WhatsappAccountId':Number(_0x3523ec[_0x672f('0x59')]['id'])});}}else{socket[_0x672f('0x77')](_0x672f('0x78'),{'UserId':Number(_0x3523ec[_0x672f('0x43')]['ids']),'WhatsappAccountId':Number(_0x3523ec['params']['id'])});}});}})['then'](respondWithStatusCode(_0x37e496,null))[_0x672f('0x27')](handleError(_0x37e496,null));};exports[_0x672f('0x79')]=function(_0x58f37c,_0x3ffa25,_0x162d85){var _0x264851={};var _0x5c8d51={};var _0x451892;var _0xba5e8f;return db['WhatsappAccount'][_0x672f('0x68')]({'where':{'id':_0x58f37c[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x3ffa25,null))[_0x672f('0x1d')](function(_0x1b2a30){if(_0x1b2a30){_0x451892=_0x1b2a30;_0x5c8d51[_0x672f('0x45')]=_[_0x672f('0x44')](db[_0x672f('0x7a')][_0x672f('0x3d')]);_0x5c8d51[_0x672f('0x43')]=_[_0x672f('0x44')](_0x58f37c[_0x672f('0x43')]);_0x5c8d51[_0x672f('0x4e')]=_[_0x672f('0x47')](_0x5c8d51['model'],_0x5c8d51[_0x672f('0x43')]);_0x264851[_0x672f('0x46')]=_[_0x672f('0x47')](_0x5c8d51[_0x672f('0x45')],qs[_0x672f('0x48')](_0x58f37c[_0x672f('0x43')][_0x672f('0x48')]));_0x264851['attributes']=_0x264851[_0x672f('0x46')][_0x672f('0x49')]?_0x264851['attributes']:_0x5c8d51[_0x672f('0x45')];_0x264851[_0x672f('0x4b')]=qs[_0x672f('0x4c')](_0x58f37c[_0x672f('0x43')][_0x672f('0x4c')]);_0x264851[_0x672f('0x4d')]=qs['filters'](_['pick'](_0x58f37c[_0x672f('0x43')],_0x5c8d51['filters']));if(_0x58f37c[_0x672f('0x43')]['filter']){_0x264851['where']=_['merge'](_0x264851[_0x672f('0x4d')],{'$or':_[_0x672f('0x41')](_0x264851[_0x672f('0x46')],function(_0x4ece6c){var _0x5aa510={};_0x5aa510[_0x4ece6c]={'$like':'%'+_0x58f37c[_0x672f('0x43')]['filter']+'%'};return _0x5aa510;})});}_0x264851=_['merge']({},_0x264851,_0x58f37c['options']);return _0x451892[_0x672f('0x79')](_0x264851);}})[_0x672f('0x1d')](function(_0x359b71){if(_0x359b71){_0xba5e8f=_0x359b71[_0x672f('0x49')];if(!_0x58f37c['query'][_0x672f('0x69')](_0x672f('0x4a'))){_0x264851[_0x672f('0x2d')]=qs[_0x672f('0x2d')](_0x58f37c[_0x672f('0x43')][_0x672f('0x2d')]);_0x264851['offset']=qs[_0x672f('0x2c')](_0x58f37c['query'][_0x672f('0x2c')]);}return _0x451892[_0x672f('0x79')](_0x264851);}})[_0x672f('0x1d')](function(_0x3ca300){if(_0x3ca300){return _0x3ca300?{'count':_0xba5e8f,'rows':_0x3ca300}:null;}})[_0x672f('0x1d')](respondWithResult(_0x3ffa25,null))[_0x672f('0x27')](handleError(_0x3ffa25,null));};exports[_0x672f('0x7b')]=function(_0x1c4464,_0x3f5520){var _0x289bef=_0x1c4464[_0x672f('0x59')]['id'];var _0x3e182f=_0x1c4464['body'];var _0x3ba96a=0xc8;var _0x900a53=null;return db[_0x672f('0x7c')][_0x672f('0x7d')]({'isolationLevel':db[_0x672f('0x7c')]['Transaction']['ISOLATION_LEVELS'][_0x672f('0x7e')]},function(_0x54c520){return db[_0x672f('0x53')][_0x672f('0x68')]({'where':{'id':_0x289bef},'transaction':_0x54c520})['then'](function(_0x342156){if(_0x342156){return db['WhatsappApplication'][_0x672f('0x35')]({'where':{'WhatsappAccountId':_0x289bef},'transaction':_0x54c520})[_0x672f('0x1d')](function(){var _0x1e79e2=_[_0x672f('0x41')](_0x3e182f,function(_0x23876d){_0x23876d[_0x672f('0x6a')]=_0x289bef;return _0x23876d;});return db['WhatsappApplication']['bulkCreate'](_0x1e79e2,{'transaction':_0x54c520});});}else{_0x3ba96a=0x194;_0x900a53=[];}});})[_0x672f('0x1d')](function(){if(_0x3ba96a!==0x194){return db[_0x672f('0x7f')][_0x672f('0x80')]({'where':{'WhatsappAccountId':_0x289bef},'order':_0x672f('0x81')})[_0x672f('0x1d')](function(_0x1cfac2){_0x900a53=_0x1cfac2;});}})['catch'](function(_0x2019f3){_0x3ba96a=0x1f4;logger['error'](_0x2019f3[_0x672f('0x38')]);if(_0x2019f3[_0x672f('0x42')]){delete _0x2019f3[_0x672f('0x42')];}_0x900a53=_0x2019f3;})[_0x672f('0x82')](function(){if(_0x900a53===null){_0x3f5520[_0x672f('0x28')](_0x3ba96a);}else{if(_0x3ba96a===0x1f4){_0x3f5520[_0x672f('0x29')](_0x3ba96a)['send'](_0x900a53);}else{_0x3f5520[_0x672f('0x29')](_0x3ba96a)['json'](_0x900a53);}}});};exports[_0x672f('0x83')]=function(_0x22c8ab,_0x37b434,_0x46a0b3){var _0x1ef633={};var _0x234aaa={};var _0x326c40;var _0x548dd9;return db[_0x672f('0x53')]['findOne']({'where':{'id':_0x22c8ab[_0x672f('0x59')]['id']}})[_0x672f('0x1d')](handleEntityNotFound(_0x37b434,null))[_0x672f('0x1d')](function(_0x8e795e){if(_0x8e795e){_0x326c40=_0x8e795e;_0x234aaa['model']=_[_0x672f('0x44')](db[_0x672f('0x7f')][_0x672f('0x3d')]);_0x234aaa[_0x672f('0x43')]=_[_0x672f('0x44')](_0x22c8ab[_0x672f('0x43')]);_0x234aaa['filters']=_[_0x672f('0x47')](_0x234aaa[_0x672f('0x45')],_0x234aaa['query']);_0x1ef633['attributes']=_[_0x672f('0x47')](_0x234aaa[_0x672f('0x45')],qs[_0x672f('0x48')](_0x22c8ab[_0x672f('0x43')]['fields']));_0x1ef633['attributes']=_0x1ef633[_0x672f('0x46')][_0x672f('0x49')]?_0x1ef633['attributes']:_0x234aaa[_0x672f('0x45')];_0x1ef633[_0x672f('0x4b')]=qs['sort'](_0x22c8ab[_0x672f('0x43')]['sort']);_0x1ef633[_0x672f('0x4d')]=qs[_0x672f('0x4e')](_[_0x672f('0x4f')](_0x22c8ab[_0x672f('0x43')],_0x234aaa[_0x672f('0x4e')]));if(_0x22c8ab['query'][_0x672f('0x50')]){_0x1ef633['where']=_['merge'](_0x1ef633[_0x672f('0x4d')],{'$or':_['map'](_0x1ef633['attributes'],function(_0x10deee){var _0x2e5a28={};_0x2e5a28[_0x10deee]={'$like':'%'+_0x22c8ab[_0x672f('0x43')][_0x672f('0x50')]+'%'};return _0x2e5a28;})});}_0x1ef633=_[_0x672f('0x51')]({},_0x1ef633,_0x22c8ab[_0x672f('0x6b')]);return _0x326c40[_0x672f('0x83')](_0x1ef633);}})[_0x672f('0x1d')](function(_0x54d1a6){if(_0x54d1a6){_0x548dd9=_0x54d1a6[_0x672f('0x49')];if(!_0x22c8ab[_0x672f('0x43')][_0x672f('0x69')](_0x672f('0x4a'))){_0x1ef633['limit']=qs[_0x672f('0x2d')](_0x22c8ab[_0x672f('0x43')][_0x672f('0x2d')]);_0x1ef633[_0x672f('0x2c')]=qs[_0x672f('0x2c')](_0x22c8ab[_0x672f('0x43')][_0x672f('0x2c')]);}return _0x326c40[_0x672f('0x83')](_0x1ef633);}})[_0x672f('0x1d')](function(_0x51c158){if(_0x51c158){return _0x51c158?{'count':_0x548dd9,'rows':_0x51c158}:null;}})['then'](respondWithResult(_0x37b434,null))[_0x672f('0x27')](handleError(_0x37b434,null));};exports[_0x672f('0x84')]=function(_0x1fe46e,_0x258c70,_0x562076){var _0xe6c979={'channel':'whatsapp'};var _0xb02c68=[];var _0x4f3f61=[];var _0x22bbf6={};return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x1fe46e['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x672f('0x85')}]})['then'](handleEntityNotFound(_0x258c70,null))[_0x672f('0x1d')](function(_0x1df96e){_0xe6c979['account']=_0x1df96e;if(_0xe6c979[_0x672f('0x86')]&&_0xe6c979[_0x672f('0x86')]['type']===_0x672f('0x87')&&_0x1fe46e[_0x672f('0x5b')]['statuses']){if(_0x1fe46e[_0x672f('0x5b')][_0x672f('0x88')][_0x672f('0x49')]===0x0)return;if(_0x1fe46e[_0x672f('0x5b')][_0x672f('0x88')][0x0][_0x672f('0x89')]!==_0x672f('0x8a'))return;return db[_0x672f('0x8b')]['update']({'read':!![],'readAt':_0x1fe46e[_0x672f('0x5b')][_0x672f('0x88')][0x0]['timestamp']},{'where':{'messageId':_0x1fe46e['body']['statuses'][0x0]['message_id']},'individualHooks':!![]})[_0x672f('0x1d')](function(_0x1f4922){return _0x258c70['status'](0xc8)[_0x672f('0x2b')](_0x1f4922);});}_0xe6c979[_0x672f('0x8c')]=_[_0x672f('0x8d')](_0x1df96e['Applications'],[_0x672f('0x81')],[_0x672f('0x8e')]);if(_0xe6c979['account'][_0x672f('0x85')]){delete _0xe6c979[_0x672f('0x86')][_0x672f('0x85')];}return db['CmContact'][_0x672f('0x65')]()['then'](function(_0x3ec41d){if(!_0x3ec41d){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))](_0x672f('0x91'));}_0xb02c68=_['difference'](_[_0x672f('0x44')](_0x3ec41d),['createdAt',_0x672f('0x92')]);_0x4f3f61=_['difference'](_[_0x672f('0x44')](_0x3ec41d),[_0x672f('0x93'),_0x672f('0x92'),_0x672f('0x94'),_0x672f('0x95')]);_0xe6c979[_0x672f('0x5b')]={'mapKey':'mobile'};if(_0xe6c979[_0x672f('0x86')]&&_0xe6c979[_0x672f('0x86')][_0x672f('0x3f')]===_0x672f('0x96')){_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')]=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x98')]['replace'](_0x672f('0x99'),'');_0xe6c979['body']['body']=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x9a')];_0xe6c979[_0x672f('0x5b')]['messageId']=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x9b')];}if(_0xe6c979[_0x672f('0x86')]&&_0xe6c979[_0x672f('0x86')][_0x672f('0x3f')]===_0x672f('0x87')){_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')]=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x9c')][0x0][_0x672f('0x97')];_0xe6c979[_0x672f('0x5b')][_0x672f('0x5b')]=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x9c')][0x0][_0x672f('0x25')]['body'];_0xe6c979[_0x672f('0x5b')][_0x672f('0x9d')]=_0x1fe46e[_0x672f('0x5b')][_0x672f('0x9c')][0x0][_0x672f('0x9e')];}if(_0xe6c979[_0x672f('0x5b')]['id']){delete _0xe6c979[_0x672f('0x5b')]['id'];}if(_[_0x672f('0x9f')](_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')])){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))]('from\x20is\x20mandatory');}if(_[_0x672f('0x9f')](_0xe6c979[_0x672f('0x5b')][_0x672f('0x5b')])||_0xe6c979[_0x672f('0x5b')][_0x672f('0x5b')]===''){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))](_0x672f('0xa0'));}if(_[_0x672f('0x9f')](_0xe6c979[_0x672f('0x5b')][_0x672f('0xa1')])){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))](_0x672f('0xa2')+_0x4f3f61);}if(!_[_0x672f('0xa3')](_0x4f3f61,_0xe6c979[_0x672f('0x5b')][_0x672f('0xa1')])){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4f3f61);}_0x22bbf6[_0xe6c979[_0x672f('0x5b')]['mapKey']]=_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')];return db[_0x672f('0xa4')][_0x672f('0x61')]({'where':{'id':_0xe6c979['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0x672f('0xa5'),'where':_0x22bbf6,'limit':0x1,'order':[[_0x672f('0x92'),_0x672f('0xa6')]]}]});})[_0x672f('0x1d')](handleEntityNotFound(_0x258c70,null))[_0x672f('0x1d')](function(_0x4e5634){if(_0x4e5634){_0xe6c979[_0x672f('0xa7')]=_[_0x672f('0x72')](_0x4e5634,['Contacts']);if(_0x4e5634[_0x672f('0xa5')][_0x672f('0x49')]){return _0x4e5634[_0x672f('0xa5')][0x0];}var _0x28a6c4=_[_0x672f('0xa8')](_0xe6c979['body'],{'firstName':_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')],'ListId':_0x4e5634['id']});_0x28a6c4[_0xe6c979[_0x672f('0x5b')][_0x672f('0xa1')]]=_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')];return db[_0x672f('0xa9')][_0x672f('0x5a')](_0x28a6c4,{'fields':_0xb02c68,'raw':!![]});}})[_0x672f('0x1d')](handleEntityNotFound(_0x258c70,null))[_0x672f('0x1d')](function(_0xbd4921){if(_0xbd4921){_0xe6c979[_0x672f('0xaa')]=_0xbd4921;var _0x3c68db={'ContactId':_0xbd4921['id'],'phone':_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')],'WhatsappAccountId':_0x1fe46e['params']['id']};var _0x1ebaf6={'ContactId':_0xbd4921['id'],'WhatsappAccountId':_0x1fe46e['params']['id'],'closed':![]};return db[_0x672f('0xab')][_0x672f('0x61')]({'where':_0x1ebaf6})[_0x672f('0x1d')](function(_0x760350){if(_0x760350){return[_0x760350,![]];}return db[_0x672f('0xab')][_0x672f('0x5a')](_0x3c68db)['then'](function(_0x20124b){return[_0x20124b,!![]];});});}})[_0x672f('0x73')](function(_0x194835,_0xc50a6d){_0xe6c979[_0x672f('0xac')]=_0x194835[_0x672f('0x36')]({'plain':!![]});_0xe6c979[_0x672f('0xac')][_0x672f('0xad')]=![];if(_0xc50a6d){if(_0xe6c979['account'][_0x672f('0xae')]){_0xe6c979[_0x672f('0x8c')]['push']({'id':0x0,'priority':_0xe6c979[_0x672f('0x8c')]['length']+0x1,'app':_0x672f('0xaf'),'appdata':_0x672f('0xb0'),'interval':_0x672f('0xb1')});}_0xe6c979['interaction'][_0x672f('0xad')]=!![];}return db['WhatsappMessage'][_0x672f('0x5a')]({'phone':_0xe6c979[_0x672f('0x5b')][_0x672f('0x97')],'messageId':_0xe6c979[_0x672f('0x5b')][_0x672f('0x9d')],'body':_0xe6c979[_0x672f('0x5b')][_0x672f('0x5b')],'WhatsappAccountId':_0x1fe46e[_0x672f('0x59')]['id'],'WhatsappInteractionId':_0x194835['id'],'direction':'in','ContactId':_0x194835['ContactId'],'AttachmentId':_0xe6c979[_0x672f('0x5b')][_0x672f('0xb2')]});})[_0x672f('0x1d')](function(_0x5098a9){_0xe6c979['message']=_0x5098a9;if(!_0xe6c979[_0x672f('0xac')][_0x672f('0xb3')])return;return db[_0x672f('0x7a')]['find']({'attributes':['id',_0x672f('0x42')],'where':{'id':_0xe6c979['interaction'][_0x672f('0xb3')]}});})['then'](function(_0x17b929){if(_0x17b929){_0xe6c979['applications'][_0x672f('0xb4')]({'id':0x0,'priority':0x0,'app':_0x672f('0xb5'),'appdata':_0x17b929[_0x672f('0x42')]+','+(_0xe6c979[_0x672f('0x86')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}if(!_0xe6c979[_0x672f('0xac')][_0x672f('0xb6')])return;return db['WhatsappQueue']['find']({'attributes':['id',_0x672f('0x42')],'where':{'id':_0xe6c979[_0x672f('0xac')]['queueId']}});})[_0x672f('0x1d')](function(_0xd6cccf){if(_0xd6cccf){_0xe6c979[_0x672f('0x8c')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xd6cccf[_0x672f('0x42')]+','+(_0xe6c979[_0x672f('0x86')][_0x672f('0xb7')]||0x12c),'interval':_0x672f('0xb1')});}return respondWithRpcPromise(_0x672f('0xb8'),_0x672f('0xb9'),_0xe6c979);})[_0x672f('0x1d')](function(_0x19fd8a){if(_0x19fd8a){var _0x738da4=0xc8;var _0x6b9f6e=_0x672f('0xba');logger[_0x672f('0x1e')](_0x672f('0x22'),_0x6b9f6e,_0x738da4,'entity\x20found');logger[_0x672f('0x21')](_0x672f('0xbb'),_0x6b9f6e,_0x738da4,_0x672f('0xbc'),JSON[_0x672f('0x23')](_0x19fd8a));if(_0xe6c979['account'][_0x672f('0x3f')]==='twilio'){return _0x258c70['status'](_0x738da4)[_0x672f('0xbd')](_0x672f('0xbe'),_0x672f('0xbf'))[_0x672f('0x39')](_0x672f('0xc0'));}else{return _0x258c70['status'](_0x738da4)[_0x672f('0x2b')](_0x19fd8a);}}});})['catch'](handleError(_0x258c70,null));};exports[_0x672f('0x39')]=function(_0x2ba337,_0x4f225d,_0x3b14af){var _0x2bd087,_0x1f415e,_0x26b23f;if(_[_0x672f('0x9f')](_0x2ba337[_0x672f('0x5b')][_0x672f('0x5b')])||_0x2ba337[_0x672f('0x5b')][_0x672f('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0x672f('0xa0'));}if(_[_0x672f('0x9f')](_0x2ba337[_0x672f('0x5b')]['to'])){throw new db[(_0x672f('0x8f'))][(_0x672f('0x90'))]('to\x20is\x20mandatory');}_0x2bd087=_0x2ba337[_0x672f('0x5b')]['to'];return db[_0x672f('0x53')][_0x672f('0x61')]({'where':{'id':_0x2ba337['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x672f('0xa9')],'as':_0x672f('0xa5'),'where':{'mobile':_0x2bd087},'limit':0x1,'order':[[_0x672f('0x92'),'DESC']]}]}]})[_0x672f('0x1d')](handleEntityNotFound(_0x4f225d,null))['then'](function(_0x41e49e){if(_0x41e49e&&_0x41e49e['List']){_0x1f415e=_0x41e49e['get']({'plain':!![]});if(_0x1f415e['List']&&_0x1f415e[_0x672f('0xc1')][_0x672f('0xa5')][_0x672f('0x49')]){return _0x1f415e[_0x672f('0xc1')][_0x672f('0xa5')][0x0];}return db['CmContact']['create'](_[_0x672f('0xa8')](_0x2ba337[_0x672f('0x5b')],{'firstName':_0x2bd087,'mobile':_0x2bd087,'phone':_0x2bd087,'ListId':_0x1f415e[_0x672f('0x95')]}));}})[_0x672f('0x1d')](handleEntityNotFound(_0x4f225d,null))['then'](function(_0x3d0eab){if(_0x3d0eab){_0x26b23f=_0x3d0eab;return db[_0x672f('0xab')][_0x672f('0x61')]({'where':{'ContactId':_0x26b23f['id'],'closed':![],'WhatsappAccountId':_0x1f415e['id']}})[_0x672f('0x1d')](function(_0x4a0206){if(_0x4a0206){return[_0x4a0206,![]];}return db[_0x672f('0xab')][_0x672f('0x5a')]({'UserId':_0x2ba337[_0x672f('0x5c')]['id'],'ContactId':_0x26b23f['id'],'WhatsappAccountId':_0x1f415e['id'],'phone':_0x2bd087,'firstMsgDirection':'out','Messages':[_['merge'](_0x2ba337[_0x672f('0x5b')],{'read':![],'body':_0x2ba337[_0x672f('0x5b')][_0x672f('0x5b')],'phone':_0x2bd087,'WhatsappAccountId':_0x1f415e['id'],'UserId':_0x2ba337[_0x672f('0x5c')]['id'],'ContactId':_0x26b23f['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x672f('0xc2')}]})[_0x672f('0x1d')](function(_0x14542a){return[_0x14542a,!![]];});});}})[_0x672f('0x73')](function(_0x1c354d,_0x956cfe){if(_0x956cfe){return _0x1c354d;}return db[_0x672f('0x8b')]['create'](_[_0x672f('0x51')](_0x2ba337[_0x672f('0x5b')],{'read':![],'body':_0x2ba337[_0x672f('0x5b')][_0x672f('0x5b')],'phone':_0x2bd087,'WhatsappAccountId':_0x1f415e['id'],'WhatsappInteractionId':_0x1c354d['id'],'UserId':_0x2ba337[_0x672f('0x5c')]['id'],'ContactId':_0x26b23f['id']}))[_0x672f('0x1d')](function(_0x281b76){_0x1c354d['dataValues']['Messages']=[];_0x1c354d[_0x672f('0xc3')][_0x672f('0xc2')][_0x672f('0xc4')](_0x281b76[_0x672f('0xc3')]);return _0x1c354d;});})['then'](respondWithResult(_0x4f225d,null))[_0x672f('0x27')](handleError(_0x4f225d,null));}; \ No newline at end of file +var _0x63ad=['fields','attributes','length','order','sort','where','pick','filter','merge','options','WhatsappAccount','includeAll','include','findAll','rows','show','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','mandatoryDispositionPause','describe','addDisposition','params','Disposition','getDispositions','hasOwnProperty','nolimit','removeDispositions','ids','WhatsappAccountId','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','findOne','User','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','findAndCountAll','getApplications','notify','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','update','message_id','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','mobile','twilio','From','whatsapp:','Body','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','unmanaged','*,*,*,*','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','WhatsappQueue','queue','waitForTheAssignedQueue','Start','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','\x0a','List','out','Messages','dataValues','push','rimraf','zip-dir','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','get','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x28e9fe,_0x394a7c){var _0x175e37=function(_0x5ba389){while(--_0x5ba389){_0x28e9fe['push'](_0x28e9fe['shift']());}};_0x175e37(++_0x394a7c);}(_0x63ad,0x7d));var _0xd63a=function(_0x5a2e7a,_0x15e1fd){_0x5a2e7a=_0x5a2e7a-0x0;var _0x13d1a9=_0x63ad[_0x5a2e7a];return _0x13d1a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd63a('0x0'));var zipdir=require(_0xd63a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd63a('0x2'));var util=require(_0xd63a('0x3'));var path=require('path');var sox=require(_0xd63a('0x4'));var csv=require(_0xd63a('0x5'));var ejs=require(_0xd63a('0x6'));var fs=require('fs');var fs_extra=require(_0xd63a('0x7'));var _=require(_0xd63a('0x8'));var squel=require(_0xd63a('0x9'));var crypto=require('crypto');var jsforce=require(_0xd63a('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd63a('0x5'));var querystring=require('querystring');var Papa=require(_0xd63a('0xb'));var Redis=require(_0xd63a('0xc'));var authService=require(_0xd63a('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd63a('0xe'))('api');var utils=require(_0xd63a('0xf'));var config=require(_0xd63a('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xd63a('0x11'))['db'];config[_0xd63a('0x12')]=_[_0xd63a('0x13')](config[_0xd63a('0x12')],{'host':_0xd63a('0x14'),'port':0x18eb});var socket=require(_0xd63a('0x15'))(new Redis(config[_0xd63a('0x12')]));require('./whatsappAccount.socket')[_0xd63a('0x16')](socket);var jayson=require(_0xd63a('0x17'));var client=jayson[_0xd63a('0x18')][_0xd63a('0x19')]({'port':0x232c});function respondWithRpcPromise(_0x1284cf,_0x2c4ff8,_0x2d9b2b,_0x59423d){return new BPromise(function(_0x3a0ce1,_0x5f37a1){var _0x11c164=_0x59423d||client;return _0x11c164[_0xd63a('0x1a')](_0x1284cf,_0x2d9b2b)[_0xd63a('0x1b')](function(_0x268908){logger[_0xd63a('0x1c')](_0xd63a('0x1d'),_0x2c4ff8,_0xd63a('0x1e'));logger[_0xd63a('0x1f')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2c4ff8,_0xd63a('0x1e'),JSON['stringify'](_0x268908));if(_0x268908[_0xd63a('0x20')]){if(_0x268908[_0xd63a('0x20')]['code']===0x1f4){logger['error'](_0xd63a('0x1d'),_0x2c4ff8,_0x268908[_0xd63a('0x20')][_0xd63a('0x21')]);return _0x5f37a1(_0x268908[_0xd63a('0x20')]['message']);}logger[_0xd63a('0x20')](_0xd63a('0x1d'),_0x2c4ff8,_0x268908[_0xd63a('0x20')][_0xd63a('0x21')]);return _0x3a0ce1(_0x268908['error'][_0xd63a('0x21')]);}else{logger['info'](_0xd63a('0x1d'),_0x2c4ff8,_0xd63a('0x1e'));_0x3a0ce1(_0x268908['result'][_0xd63a('0x21')]);}})[_0xd63a('0x22')](function(_0x1924c6){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x2c4ff8,_0x1924c6);_0x5f37a1(_0x1924c6);});});}function respondWithStatusCode(_0x3d7ba5,_0x4a488c){_0x4a488c=_0x4a488c||0xcc;return function(_0x4e56be){if(_0x4e56be){return _0x3d7ba5[_0xd63a('0x23')](_0x4a488c);}return _0x3d7ba5[_0xd63a('0x24')](_0x4a488c)[_0xd63a('0x25')]();};}function respondWithResult(_0x487037,_0x20fb37){_0x20fb37=_0x20fb37||0xc8;return function(_0x14ada0){if(_0x14ada0){return _0x487037['status'](_0x20fb37)[_0xd63a('0x26')](_0x14ada0);}};}function respondWithFilteredResult(_0x4d2cf4,_0x533370){return function(_0x49c815){if(_0x49c815){var _0x5b52c2=typeof _0x533370[_0xd63a('0x27')]===_0xd63a('0x28')&&typeof _0x533370[_0xd63a('0x29')]===_0xd63a('0x28');var _0x2b1a0d=_0x49c815['count'];var _0x246f46=_0x5b52c2?0x0:_0x533370[_0xd63a('0x27')];var _0x2735af=_0x5b52c2?_0x49c815[_0xd63a('0x2a')]:_0x533370[_0xd63a('0x27')]+_0x533370[_0xd63a('0x29')];var _0x551524;if(_0x2735af>=_0x2b1a0d){_0x2735af=_0x2b1a0d;_0x551524=0xc8;}else{_0x551524=0xce;}_0x4d2cf4['status'](_0x551524);return _0x4d2cf4[_0xd63a('0x2b')](_0xd63a('0x2c'),_0x246f46+'-'+_0x2735af+'/'+_0x2b1a0d)['json'](_0x49c815);}return null;};}function patchUpdates(_0x23c274){return function(_0x539ec6){try{jsonpatch['apply'](_0x539ec6,_0x23c274,!![]);}catch(_0x4e8030){return BPromise['reject'](_0x4e8030);}return _0x539ec6[_0xd63a('0x2d')]();};}function saveUpdates(_0x5158a8,_0x3c8438){return function(_0x1b13ad){if(_0x1b13ad){return _0x1b13ad['update'](_0x5158a8)[_0xd63a('0x1b')](function(_0x28c3cf){return _0x28c3cf;});}return null;};}function removeEntity(_0x530d9a,_0x3f546f){return function(_0x316c2c){if(_0x316c2c){return _0x316c2c['destroy']()[_0xd63a('0x1b')](function(){var _0x981d6d=_0x316c2c[_0xd63a('0x2e')]({'plain':!![]});var _0x56d122=_0xd63a('0x2f');return db[_0xd63a('0x30')][_0xd63a('0x31')]({'where':{'type':_0x56d122,'resourceId':_0x981d6d['id']}})[_0xd63a('0x1b')](function(){return _0x316c2c;});})[_0xd63a('0x1b')](function(){_0x530d9a[_0xd63a('0x24')](0xcc)[_0xd63a('0x25')]();});}};}function handleEntityNotFound(_0x4521ef,_0x168070){return function(_0x503c14){if(!_0x503c14){_0x4521ef[_0xd63a('0x23')](0x194);}return _0x503c14;};}function handleError(_0x13a75f,_0x4d522a){_0x4d522a=_0x4d522a||0x1f4;return function(_0x23cefa){logger[_0xd63a('0x20')](_0x23cefa[_0xd63a('0x32')]);if(_0x23cefa[_0xd63a('0x33')]){delete _0x23cefa[_0xd63a('0x33')];}_0x13a75f[_0xd63a('0x24')](_0x4d522a)[_0xd63a('0x34')](_0x23cefa);};}exports['index']=function(_0x589218,_0x30dfb5){var _0x1b2c80={'include':[{'model':db[_0xd63a('0x35')],'as':'mandatoryDispositionPause'}]},_0x59c4e2={},_0x196c1f={'count':0x0,'rows':[]};var _0x2d9007=_[_0xd63a('0x36')](db['WhatsappAccount'][_0xd63a('0x37')],function(_0x1d2391){return{'name':_0x1d2391[_0xd63a('0x38')],'type':_0x1d2391[_0xd63a('0x39')][_0xd63a('0x3a')]};});_0x59c4e2[_0xd63a('0x3b')]=_[_0xd63a('0x36')](_0x2d9007,_0xd63a('0x33'));_0x59c4e2[_0xd63a('0x3c')]=_[_0xd63a('0x3d')](_0x589218[_0xd63a('0x3c')]);_0x59c4e2[_0xd63a('0x3e')]=_[_0xd63a('0x3f')](_0x59c4e2[_0xd63a('0x3b')],_0x59c4e2[_0xd63a('0x3c')]);_0x1b2c80['attributes']=_[_0xd63a('0x3f')](_0x59c4e2[_0xd63a('0x3b')],qs['fields'](_0x589218[_0xd63a('0x3c')][_0xd63a('0x40')]));_0x1b2c80[_0xd63a('0x41')]=_0x1b2c80[_0xd63a('0x41')][_0xd63a('0x42')]?_0x1b2c80[_0xd63a('0x41')]:_0x59c4e2[_0xd63a('0x3b')];if(!_0x589218['query']['hasOwnProperty']('nolimit')){_0x1b2c80['limit']=qs[_0xd63a('0x29')](_0x589218[_0xd63a('0x3c')][_0xd63a('0x29')]);_0x1b2c80['offset']=qs[_0xd63a('0x27')](_0x589218[_0xd63a('0x3c')][_0xd63a('0x27')]);}_0x1b2c80[_0xd63a('0x43')]=qs[_0xd63a('0x44')](_0x589218[_0xd63a('0x3c')]['sort']);_0x1b2c80[_0xd63a('0x45')]=qs[_0xd63a('0x3e')](_[_0xd63a('0x46')](_0x589218[_0xd63a('0x3c')],_0x59c4e2['filters']),_0x2d9007);if(_0x589218[_0xd63a('0x3c')][_0xd63a('0x47')]){_0x1b2c80[_0xd63a('0x45')]=_[_0xd63a('0x48')](_0x1b2c80[_0xd63a('0x45')],{'$or':_[_0xd63a('0x36')](_0x2d9007,function(_0x590798){if(_0x590798[_0xd63a('0x39')]!=='VIRTUAL'){var _0x4b9f99={};_0x4b9f99[_0x590798[_0xd63a('0x33')]]={'$like':'%'+_0x589218['query'][_0xd63a('0x47')]+'%'};return _0x4b9f99;}})});}_0x1b2c80=_[_0xd63a('0x48')]({},_0x1b2c80,_0x589218[_0xd63a('0x49')]);var _0x5cff6b={'where':_0x1b2c80[_0xd63a('0x45')]};return db[_0xd63a('0x4a')]['count'](_0x5cff6b)[_0xd63a('0x1b')](function(_0x48ed92){_0x196c1f['count']=_0x48ed92;if(_0x589218[_0xd63a('0x3c')][_0xd63a('0x4b')]){_0x1b2c80[_0xd63a('0x4c')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xd63a('0x4d')](_0x1b2c80);})[_0xd63a('0x1b')](function(_0x33fcca){_0x196c1f[_0xd63a('0x4e')]=_0x33fcca;return _0x196c1f;})[_0xd63a('0x1b')](respondWithFilteredResult(_0x30dfb5,_0x1b2c80))[_0xd63a('0x22')](handleError(_0x30dfb5,null));};exports[_0xd63a('0x4f')]=function(_0x47d588,_0x430ff2){var _0x154ebe={'raw':![],'where':{'id':_0x47d588['params']['id']},'include':[{'model':db[_0xd63a('0x35')],'as':'mandatoryDispositionPause'}]},_0x23628a={};_0x23628a[_0xd63a('0x3b')]=_[_0xd63a('0x3d')](db[_0xd63a('0x4a')][_0xd63a('0x37')]);_0x23628a[_0xd63a('0x3c')]=_['keys'](_0x47d588[_0xd63a('0x3c')]);_0x23628a['filters']=_['intersection'](_0x23628a[_0xd63a('0x3b')],_0x23628a[_0xd63a('0x3c')]);_0x154ebe[_0xd63a('0x41')]=_[_0xd63a('0x3f')](_0x23628a['model'],qs['fields'](_0x47d588[_0xd63a('0x3c')][_0xd63a('0x40')]));_0x154ebe[_0xd63a('0x41')]=_0x154ebe[_0xd63a('0x41')][_0xd63a('0x42')]?_0x154ebe[_0xd63a('0x41')]:_0x23628a[_0xd63a('0x3b')];if(_0x47d588[_0xd63a('0x3c')]['includeAll']){_0x154ebe[_0xd63a('0x4c')]=[{'all':!![]}];}_0x154ebe=_[_0xd63a('0x48')]({},_0x154ebe,_0x47d588[_0xd63a('0x49')]);return db[_0xd63a('0x4a')]['find'](_0x154ebe)['then'](handleEntityNotFound(_0x430ff2,null))[_0xd63a('0x1b')](respondWithResult(_0x430ff2,null))[_0xd63a('0x22')](handleError(_0x430ff2,null));};exports[_0xd63a('0x50')]=function(_0x13511e,_0x30af08){return db[_0xd63a('0x4a')]['create'](_0x13511e['body'],{})[_0xd63a('0x1b')](function(_0x2b4402){var _0x1068a4=_0x13511e['user']['get']({'plain':!![]});if(!_0x1068a4)throw new Error(_0xd63a('0x51'));if(_0x1068a4[_0xd63a('0x52')]===_0xd63a('0x53')){var _0x2e8f3e=_0x2b4402[_0xd63a('0x2e')]({'plain':!![]});var _0x2214ab=_0xd63a('0x2f');return db[_0xd63a('0x54')]['find']({'where':{'name':_0x2214ab,'userProfileId':_0x1068a4[_0xd63a('0x55')]},'raw':!![]})[_0xd63a('0x1b')](function(_0x309f6f){if(_0x309f6f&&_0x309f6f['autoAssociation']===0x0){return db[_0xd63a('0x30')]['create']({'name':_0x2e8f3e['name'],'resourceId':_0x2e8f3e['id'],'type':_0x309f6f[_0xd63a('0x33')],'sectionId':_0x309f6f['id']},{})[_0xd63a('0x1b')](function(){return _0x2b4402;});}else{return _0x2b4402;}})[_0xd63a('0x22')](function(_0x4a4fa5){logger[_0xd63a('0x20')](_0xd63a('0x56'),_0x4a4fa5);throw _0x4a4fa5;});}return _0x2b4402;})[_0xd63a('0x1b')](respondWithResult(_0x30af08,0xc9))[_0xd63a('0x22')](handleError(_0x30af08,null));};exports['update']=function(_0x486c8e,_0x5bcbdf){if(_0x486c8e[_0xd63a('0x57')]['id']){delete _0x486c8e['body']['id'];}return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0x486c8e['params']['id']},'include':[{'model':db[_0xd63a('0x35')],'as':_0xd63a('0x59')}]})[_0xd63a('0x1b')](handleEntityNotFound(_0x5bcbdf,null))[_0xd63a('0x1b')](saveUpdates(_0x486c8e[_0xd63a('0x57')],null))['then'](respondWithResult(_0x5bcbdf,null))[_0xd63a('0x22')](handleError(_0x5bcbdf,null));};exports['destroy']=function(_0x4053a3,_0x717100){return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0x4053a3['params']['id']}})['then'](handleEntityNotFound(_0x717100,null))[_0xd63a('0x1b')](removeEntity(_0x717100,null))[_0xd63a('0x22')](handleError(_0x717100,null));};exports['describe']=function(_0x5a1461,_0x201e80){return db['WhatsappAccount'][_0xd63a('0x5a')]()[_0xd63a('0x1b')](respondWithResult(_0x201e80,null))[_0xd63a('0x22')](handleError(_0x201e80,null));};exports[_0xd63a('0x5b')]=function(_0x5c26ba,_0xbfb041,_0xda51ea){if(_0x5c26ba[_0xd63a('0x57')]['id']){delete _0x5c26ba[_0xd63a('0x57')]['id'];}return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0x5c26ba[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0xbfb041,null))['then'](function(_0x69b3a6){if(_0x69b3a6){_0x5c26ba[_0xd63a('0x57')]['WhatsappAccountId']=_0x69b3a6['id'];return db[_0xd63a('0x5d')]['create'](_0x5c26ba[_0xd63a('0x57')]);}})[_0xd63a('0x1b')](respondWithResult(_0xbfb041,null))[_0xd63a('0x22')](handleError(_0xbfb041,null));};exports[_0xd63a('0x5e')]=function(_0x96c520,_0x9b6916,_0x2a6ce4){var _0x26849b={'raw':![],'where':{}};var _0x2cdc96={};var _0x45ae04={'count':0x0,'rows':[]};return db[_0xd63a('0x4a')]['findOne']({'where':{'id':_0x96c520[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x9b6916,null))['then'](function(_0x2c960d){if(_0x2c960d){_0x2cdc96[_0xd63a('0x3b')]=_[_0xd63a('0x3d')](db[_0xd63a('0x5d')][_0xd63a('0x37')]);_0x2cdc96['query']=_['keys'](_0x96c520['query']);_0x2cdc96[_0xd63a('0x3e')]=_[_0xd63a('0x3f')](_0x2cdc96['model'],_0x2cdc96['query']);_0x26849b[_0xd63a('0x41')]=_[_0xd63a('0x3f')](_0x2cdc96[_0xd63a('0x3b')],qs[_0xd63a('0x40')](_0x96c520[_0xd63a('0x3c')][_0xd63a('0x40')]));_0x26849b[_0xd63a('0x41')]=_0x26849b['attributes'][_0xd63a('0x42')]?_0x26849b[_0xd63a('0x41')]:_0x2cdc96['model'];if(!_0x96c520[_0xd63a('0x3c')][_0xd63a('0x5f')](_0xd63a('0x60'))){_0x26849b[_0xd63a('0x29')]=qs[_0xd63a('0x29')](_0x96c520[_0xd63a('0x3c')][_0xd63a('0x29')]);_0x26849b['offset']=qs[_0xd63a('0x27')](_0x96c520[_0xd63a('0x3c')][_0xd63a('0x27')]);}_0x26849b['order']=qs[_0xd63a('0x44')](_0x96c520[_0xd63a('0x3c')][_0xd63a('0x44')]);_0x26849b[_0xd63a('0x45')]=qs[_0xd63a('0x3e')](_['pick'](_0x96c520['query'],_0x2cdc96[_0xd63a('0x3e')]));_0x26849b[_0xd63a('0x45')]['WhatsappAccountId']=_0x2c960d['id'];if(_0x96c520[_0xd63a('0x3c')]['filter']){_0x26849b[_0xd63a('0x45')]=_[_0xd63a('0x48')](_0x26849b['where'],{'$or':_['map'](_0x26849b['attributes'],function(_0x5c9cf3){var _0x20e7d0={};_0x20e7d0[_0x5c9cf3]={'$like':'%'+_0x96c520['query'][_0xd63a('0x47')]+'%'};return _0x20e7d0;})});}_0x26849b=_['merge']({},_0x26849b,_0x96c520[_0xd63a('0x49')]);return db[_0xd63a('0x5d')][_0xd63a('0x2a')]({'where':_0x26849b[_0xd63a('0x45')]})[_0xd63a('0x1b')](function(_0x36d3f1){_0x45ae04['count']=_0x36d3f1;if(_0x96c520['query']['includeAll']){_0x26849b['include']=[{'all':!![]}];}return db[_0xd63a('0x5d')]['findAll'](_0x26849b);})[_0xd63a('0x1b')](function(_0x3e29dc){_0x45ae04[_0xd63a('0x4e')]=_0x3e29dc;return _0x45ae04;});}})[_0xd63a('0x1b')](respondWithFilteredResult(_0x9b6916,_0x26849b))[_0xd63a('0x22')](handleError(_0x9b6916,null));};exports[_0xd63a('0x61')]=function(_0x54a9eb,_0x3425a5,_0x19ba84){return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0x54a9eb[_0xd63a('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3425a5,null))[_0xd63a('0x1b')](function(_0x3bbc6a){if(_0x3bbc6a){return _0x3bbc6a[_0xd63a('0x61')](_0x54a9eb[_0xd63a('0x3c')][_0xd63a('0x62')]);}})[_0xd63a('0x1b')](respondWithStatusCode(_0x3425a5,null))[_0xd63a('0x22')](handleError(_0x3425a5,null));};exports['addAnswer']=function(_0x87849d,_0x2b7bbc,_0x4f80a7){if(_0x87849d[_0xd63a('0x57')]['id']){delete _0x87849d['body']['id'];}return db['WhatsappAccount'][_0xd63a('0x58')]({'where':{'id':_0x87849d[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x2b7bbc,null))[_0xd63a('0x1b')](function(_0x64e058){if(_0x64e058){_0x87849d[_0xd63a('0x57')][_0xd63a('0x63')]=_0x64e058['id'];return db[_0xd63a('0x64')][_0xd63a('0x50')](_0x87849d[_0xd63a('0x57')]);}})[_0xd63a('0x1b')](respondWithResult(_0x2b7bbc,null))['catch'](handleError(_0x2b7bbc,null));};exports[_0xd63a('0x65')]=function(_0x166e07,_0x2139af,_0x9ac7e7){var _0x2e3127={'raw':![],'where':{}};var _0x11d163={};var _0x17cc95={'count':0x0,'rows':[]};return db[_0xd63a('0x4a')]['findOne']({'where':{'id':_0x166e07['params']['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x2139af,null))[_0xd63a('0x1b')](function(_0x4ae0d1){if(_0x4ae0d1){_0x11d163['model']=_[_0xd63a('0x3d')](db[_0xd63a('0x64')][_0xd63a('0x37')]);_0x11d163['query']=_[_0xd63a('0x3d')](_0x166e07[_0xd63a('0x3c')]);_0x11d163['filters']=_[_0xd63a('0x3f')](_0x11d163[_0xd63a('0x3b')],_0x11d163[_0xd63a('0x3c')]);_0x2e3127[_0xd63a('0x41')]=_[_0xd63a('0x3f')](_0x11d163['model'],qs[_0xd63a('0x40')](_0x166e07[_0xd63a('0x3c')][_0xd63a('0x40')]));_0x2e3127[_0xd63a('0x41')]=_0x2e3127[_0xd63a('0x41')][_0xd63a('0x42')]?_0x2e3127[_0xd63a('0x41')]:_0x11d163['model'];if(!_0x166e07[_0xd63a('0x3c')][_0xd63a('0x5f')](_0xd63a('0x60'))){_0x2e3127[_0xd63a('0x29')]=qs[_0xd63a('0x29')](_0x166e07[_0xd63a('0x3c')][_0xd63a('0x29')]);_0x2e3127[_0xd63a('0x27')]=qs[_0xd63a('0x27')](_0x166e07[_0xd63a('0x3c')][_0xd63a('0x27')]);}_0x2e3127['order']=qs[_0xd63a('0x44')](_0x166e07['query']['sort']);_0x2e3127[_0xd63a('0x45')]=qs[_0xd63a('0x3e')](_['pick'](_0x166e07[_0xd63a('0x3c')],_0x11d163[_0xd63a('0x3e')]));_0x2e3127[_0xd63a('0x45')][_0xd63a('0x63')]=_0x4ae0d1['id'];if(_0x166e07['query'][_0xd63a('0x47')]){_0x2e3127[_0xd63a('0x45')]=_['merge'](_0x2e3127[_0xd63a('0x45')],{'$or':_[_0xd63a('0x36')](_0x2e3127[_0xd63a('0x41')],function(_0x3b24d5){var _0x4368e8={};_0x4368e8[_0x3b24d5]={'$like':'%'+_0x166e07[_0xd63a('0x3c')][_0xd63a('0x47')]+'%'};return _0x4368e8;})});}_0x2e3127=_[_0xd63a('0x48')]({},_0x2e3127,_0x166e07[_0xd63a('0x49')]);return db[_0xd63a('0x64')][_0xd63a('0x2a')]({'where':_0x2e3127[_0xd63a('0x45')]})[_0xd63a('0x1b')](function(_0x31e2d6){_0x17cc95[_0xd63a('0x2a')]=_0x31e2d6;if(_0x166e07[_0xd63a('0x3c')]['includeAll']){_0x2e3127[_0xd63a('0x4c')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd63a('0x4d')](_0x2e3127);})['then'](function(_0x19cafa){_0x17cc95['rows']=_0x19cafa;return _0x17cc95;});}})['then'](respondWithFilteredResult(_0x2139af,_0x2e3127))[_0xd63a('0x22')](handleError(_0x2139af,null));};exports[_0xd63a('0x66')]=function(_0x41fc9b,_0x522e5a,_0x209424){return db['WhatsappAccount'][_0xd63a('0x58')]({'where':{'id':_0x41fc9b[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x522e5a,null))[_0xd63a('0x1b')](function(_0x2c0268){if(_0x2c0268){return _0x2c0268[_0xd63a('0x66')](_0x41fc9b[_0xd63a('0x3c')][_0xd63a('0x62')]);}})[_0xd63a('0x1b')](respondWithStatusCode(_0x522e5a,null))['catch'](handleError(_0x522e5a,null));};exports['addAgents']=function(_0xf5a513,_0x1fcf78,_0x57dcfe){return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0xf5a513[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x1fcf78,null))[_0xd63a('0x1b')](function(_0x13c218){if(_0x13c218){return _0x13c218[_0xd63a('0x67')](_0xf5a513['body'][_0xd63a('0x62')],_[_0xd63a('0x68')](_0xf5a513['body'],[_0xd63a('0x62'),'id'])||{})[_0xd63a('0x69')](function(_0x2ccf3a){for(var _0x36ab61=0x0;_0x36ab61<_0xf5a513[_0xd63a('0x57')][_0xd63a('0x62')][_0xd63a('0x42')];_0x36ab61+=0x1){socket[_0xd63a('0x6a')](_0xd63a('0x6b'),{'UserId':Number(_0xf5a513[_0xd63a('0x57')][_0xd63a('0x62')][_0x36ab61]),'WhatsappAccountId':Number(_0xf5a513[_0xd63a('0x5c')]['id'])});}return _0x2ccf3a;});}})['then'](respondWithResult(_0x1fcf78,null))[_0xd63a('0x22')](handleError(_0x1fcf78,null));};exports[_0xd63a('0x6c')]=function(_0x377e1b,_0x4c429e,_0x2c4287){return db[_0xd63a('0x4a')]['find']({'where':{'id':_0x377e1b[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x4c429e,null))[_0xd63a('0x1b')](function(_0x3ff2fd){if(_0x3ff2fd){return _0x3ff2fd['removeAgents'](_0x377e1b['query'][_0xd63a('0x62')])[_0xd63a('0x1b')](function(){if(_[_0xd63a('0x6d')](_0x377e1b['query'][_0xd63a('0x62')])){for(var _0x899214=0x0;_0x899214<_0x377e1b['query'][_0xd63a('0x62')][_0xd63a('0x42')];_0x899214+=0x1){socket[_0xd63a('0x6a')](_0xd63a('0x6e'),{'UserId':Number(_0x377e1b[_0xd63a('0x3c')][_0xd63a('0x62')][_0x899214]),'WhatsappAccountId':Number(_0x377e1b[_0xd63a('0x5c')]['id'])});}}else{socket[_0xd63a('0x6a')](_0xd63a('0x6e'),{'UserId':Number(_0x377e1b[_0xd63a('0x3c')][_0xd63a('0x62')]),'WhatsappAccountId':Number(_0x377e1b[_0xd63a('0x5c')]['id'])});}});}})[_0xd63a('0x1b')](respondWithStatusCode(_0x4c429e,null))[_0xd63a('0x22')](handleError(_0x4c429e,null));};exports['getAgents']=function(_0x36ea56,_0x5e0990,_0x1fd8d7){var _0x2f4dd4={};var _0x43e35b={};var _0x1cea98;var _0x59e5ff;return db[_0xd63a('0x4a')][_0xd63a('0x6f')]({'where':{'id':_0x36ea56[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x5e0990,null))['then'](function(_0x596a16){if(_0x596a16){_0x1cea98=_0x596a16;_0x43e35b[_0xd63a('0x3b')]=_[_0xd63a('0x3d')](db[_0xd63a('0x70')]['rawAttributes']);_0x43e35b[_0xd63a('0x3c')]=_[_0xd63a('0x3d')](_0x36ea56[_0xd63a('0x3c')]);_0x43e35b[_0xd63a('0x3e')]=_[_0xd63a('0x3f')](_0x43e35b[_0xd63a('0x3b')],_0x43e35b[_0xd63a('0x3c')]);_0x2f4dd4[_0xd63a('0x41')]=_[_0xd63a('0x3f')](_0x43e35b[_0xd63a('0x3b')],qs[_0xd63a('0x40')](_0x36ea56[_0xd63a('0x3c')][_0xd63a('0x40')]));_0x2f4dd4[_0xd63a('0x41')]=_0x2f4dd4[_0xd63a('0x41')][_0xd63a('0x42')]?_0x2f4dd4['attributes']:_0x43e35b[_0xd63a('0x3b')];_0x2f4dd4[_0xd63a('0x43')]=qs[_0xd63a('0x44')](_0x36ea56['query'][_0xd63a('0x44')]);_0x2f4dd4[_0xd63a('0x45')]=qs[_0xd63a('0x3e')](_[_0xd63a('0x46')](_0x36ea56[_0xd63a('0x3c')],_0x43e35b[_0xd63a('0x3e')]));if(_0x36ea56['query'][_0xd63a('0x47')]){_0x2f4dd4[_0xd63a('0x45')]=_[_0xd63a('0x48')](_0x2f4dd4[_0xd63a('0x45')],{'$or':_['map'](_0x2f4dd4[_0xd63a('0x41')],function(_0x44d47d){var _0xe71e81={};_0xe71e81[_0x44d47d]={'$like':'%'+_0x36ea56[_0xd63a('0x3c')][_0xd63a('0x47')]+'%'};return _0xe71e81;})});}_0x2f4dd4=_[_0xd63a('0x48')]({},_0x2f4dd4,_0x36ea56[_0xd63a('0x49')]);return _0x1cea98[_0xd63a('0x71')](_0x2f4dd4);}})[_0xd63a('0x1b')](function(_0x53931f){if(_0x53931f){_0x59e5ff=_0x53931f[_0xd63a('0x42')];if(!_0x36ea56[_0xd63a('0x3c')][_0xd63a('0x5f')](_0xd63a('0x60'))){_0x2f4dd4[_0xd63a('0x29')]=qs[_0xd63a('0x29')](_0x36ea56[_0xd63a('0x3c')][_0xd63a('0x29')]);_0x2f4dd4[_0xd63a('0x27')]=qs[_0xd63a('0x27')](_0x36ea56[_0xd63a('0x3c')][_0xd63a('0x27')]);}return _0x1cea98[_0xd63a('0x71')](_0x2f4dd4);}})[_0xd63a('0x1b')](function(_0x17b7c0){if(_0x17b7c0){return _0x17b7c0?{'count':_0x59e5ff,'rows':_0x17b7c0}:null;}})[_0xd63a('0x1b')](respondWithResult(_0x5e0990,null))[_0xd63a('0x22')](handleError(_0x5e0990,null));};exports[_0xd63a('0x72')]=function(_0x384cc3,_0x2c54ce){var _0x209672=_0x384cc3['params']['id'];var _0x2d4faf=_0x384cc3['body'];var _0x3186bb=0xc8;var _0x180e7d=null;return db[_0xd63a('0x73')][_0xd63a('0x74')]({'isolationLevel':db[_0xd63a('0x73')][_0xd63a('0x75')]['ISOLATION_LEVELS'][_0xd63a('0x76')]},function(_0x3b00ea){return db['WhatsappAccount'][_0xd63a('0x6f')]({'where':{'id':_0x209672},'transaction':_0x3b00ea})[_0xd63a('0x1b')](function(_0x29c8fa){if(_0x29c8fa){return db['WhatsappApplication'][_0xd63a('0x31')]({'where':{'WhatsappAccountId':_0x209672},'transaction':_0x3b00ea})[_0xd63a('0x1b')](function(){var _0x3e5a63=_[_0xd63a('0x36')](_0x2d4faf,function(_0x5a895a){_0x5a895a[_0xd63a('0x63')]=_0x209672;return _0x5a895a;});return db[_0xd63a('0x77')]['bulkCreate'](_0x3e5a63,{'transaction':_0x3b00ea});});}else{_0x3186bb=0x194;_0x180e7d=[];}});})[_0xd63a('0x1b')](function(){if(_0x3186bb!==0x194){return db[_0xd63a('0x77')][_0xd63a('0x78')]({'where':{'WhatsappAccountId':_0x209672},'order':'priority'})[_0xd63a('0x1b')](function(_0x341193){_0x180e7d=_0x341193;});}})['catch'](function(_0x4375da){_0x3186bb=0x1f4;logger['error'](_0x4375da[_0xd63a('0x32')]);if(_0x4375da['name']){delete _0x4375da['name'];}_0x180e7d=_0x4375da;})['finally'](function(){if(_0x180e7d===null){_0x2c54ce[_0xd63a('0x23')](_0x3186bb);}else{if(_0x3186bb===0x1f4){_0x2c54ce[_0xd63a('0x24')](_0x3186bb)[_0xd63a('0x34')](_0x180e7d);}else{_0x2c54ce[_0xd63a('0x24')](_0x3186bb)[_0xd63a('0x26')](_0x180e7d);}}});};exports[_0xd63a('0x79')]=function(_0x5f133a,_0x490bc1,_0x43647c){var _0x12a4ef={};var _0xe66501={};var _0x31bac5;var _0x1d2e1a;return db[_0xd63a('0x4a')]['findOne']({'where':{'id':_0x5f133a[_0xd63a('0x5c')]['id']}})[_0xd63a('0x1b')](handleEntityNotFound(_0x490bc1,null))[_0xd63a('0x1b')](function(_0x151898){if(_0x151898){_0x31bac5=_0x151898;_0xe66501['model']=_[_0xd63a('0x3d')](db[_0xd63a('0x77')]['rawAttributes']);_0xe66501[_0xd63a('0x3c')]=_['keys'](_0x5f133a[_0xd63a('0x3c')]);_0xe66501['filters']=_[_0xd63a('0x3f')](_0xe66501['model'],_0xe66501[_0xd63a('0x3c')]);_0x12a4ef[_0xd63a('0x41')]=_['intersection'](_0xe66501[_0xd63a('0x3b')],qs[_0xd63a('0x40')](_0x5f133a['query']['fields']));_0x12a4ef[_0xd63a('0x41')]=_0x12a4ef[_0xd63a('0x41')][_0xd63a('0x42')]?_0x12a4ef[_0xd63a('0x41')]:_0xe66501[_0xd63a('0x3b')];_0x12a4ef[_0xd63a('0x43')]=qs[_0xd63a('0x44')](_0x5f133a['query'][_0xd63a('0x44')]);_0x12a4ef[_0xd63a('0x45')]=qs[_0xd63a('0x3e')](_['pick'](_0x5f133a[_0xd63a('0x3c')],_0xe66501[_0xd63a('0x3e')]));if(_0x5f133a[_0xd63a('0x3c')][_0xd63a('0x47')]){_0x12a4ef[_0xd63a('0x45')]=_[_0xd63a('0x48')](_0x12a4ef[_0xd63a('0x45')],{'$or':_[_0xd63a('0x36')](_0x12a4ef[_0xd63a('0x41')],function(_0x414e4c){var _0xce1157={};_0xce1157[_0x414e4c]={'$like':'%'+_0x5f133a[_0xd63a('0x3c')][_0xd63a('0x47')]+'%'};return _0xce1157;})});}_0x12a4ef=_['merge']({},_0x12a4ef,_0x5f133a['options']);return _0x31bac5['getApplications'](_0x12a4ef);}})['then'](function(_0x18b32a){if(_0x18b32a){_0x1d2e1a=_0x18b32a[_0xd63a('0x42')];if(!_0x5f133a[_0xd63a('0x3c')][_0xd63a('0x5f')](_0xd63a('0x60'))){_0x12a4ef[_0xd63a('0x29')]=qs[_0xd63a('0x29')](_0x5f133a['query'][_0xd63a('0x29')]);_0x12a4ef[_0xd63a('0x27')]=qs[_0xd63a('0x27')](_0x5f133a[_0xd63a('0x3c')]['offset']);}return _0x31bac5['getApplications'](_0x12a4ef);}})[_0xd63a('0x1b')](function(_0x2e298c){if(_0x2e298c){return _0x2e298c?{'count':_0x1d2e1a,'rows':_0x2e298c}:null;}})[_0xd63a('0x1b')](respondWithResult(_0x490bc1,null))[_0xd63a('0x22')](handleError(_0x490bc1,null));};exports[_0xd63a('0x7a')]=function(_0x1bcb86,_0x559eae,_0x3dd879){var _0x720eec={'channel':_0xd63a('0x7b')};var _0x4fc639=[];var _0x4eefa0=[];var _0xfaf846={};return db['WhatsappAccount'][_0xd63a('0x58')]({'where':{'id':_0x1bcb86[_0xd63a('0x5c')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xd63a('0x7c')}]})[_0xd63a('0x1b')](handleEntityNotFound(_0x559eae,null))['then'](function(_0x3b30a9){_0x720eec[_0xd63a('0x7d')]=_0x3b30a9;if(_0x720eec['account']&&_0x720eec[_0xd63a('0x7d')][_0xd63a('0x39')]==='sinch'&&_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x7e')]){if(_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x7e')]['length']===0x0)return;if(_0x1bcb86['body'][_0xd63a('0x7e')][0x0][_0xd63a('0x7f')]!==_0xd63a('0x80'))return;return db[_0xd63a('0x81')][_0xd63a('0x82')]({'read':!![],'readAt':_0x1bcb86[_0xd63a('0x57')]['statuses'][0x0]['timestamp']},{'where':{'messageId':_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x7e')][0x0][_0xd63a('0x83')]},'individualHooks':!![]})[_0xd63a('0x1b')](function(_0x1d918e){return _0x559eae[_0xd63a('0x24')](0xc8)[_0xd63a('0x26')](_0x1d918e);});}_0x720eec[_0xd63a('0x84')]=_[_0xd63a('0x85')](_0x3b30a9[_0xd63a('0x7c')],[_0xd63a('0x86')],['asc']);if(_0x720eec[_0xd63a('0x7d')][_0xd63a('0x7c')]){delete _0x720eec[_0xd63a('0x7d')][_0xd63a('0x7c')];}return db[_0xd63a('0x87')][_0xd63a('0x5a')]()['then'](function(_0x548272){if(!_0x548272){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))](_0xd63a('0x8a'));}_0x4fc639=_['difference'](_[_0xd63a('0x3d')](_0x548272),[_0xd63a('0x8b'),'updatedAt']);_0x4eefa0=_[_0xd63a('0x8c')](_['keys'](_0x548272),[_0xd63a('0x8b'),_0xd63a('0x8d'),_0xd63a('0x8e'),_0xd63a('0x8f')]);_0x720eec['body']={'mapKey':_0xd63a('0x90')};if(_0x720eec[_0xd63a('0x7d')]&&_0x720eec[_0xd63a('0x7d')][_0xd63a('0x39')]===_0xd63a('0x91')){_0x720eec[_0xd63a('0x57')]['from']=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x92')]['replace'](_0xd63a('0x93'),'');_0x720eec[_0xd63a('0x57')][_0xd63a('0x57')]=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x94')];_0x720eec[_0xd63a('0x57')][_0xd63a('0x95')]=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x96')];}if(_0x720eec[_0xd63a('0x7d')]&&_0x720eec['account'][_0xd63a('0x39')]==='sinch'){_0x720eec[_0xd63a('0x57')][_0xd63a('0x97')]=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x98')][0x0][_0xd63a('0x97')];_0x720eec['body'][_0xd63a('0x57')]=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x98')][0x0]['message'][_0xd63a('0x57')];_0x720eec[_0xd63a('0x57')][_0xd63a('0x95')]=_0x1bcb86[_0xd63a('0x57')][_0xd63a('0x98')][0x0][_0xd63a('0x83')];}if(_0x720eec[_0xd63a('0x57')]['id']){delete _0x720eec['body']['id'];}if(_[_0xd63a('0x99')](_0x720eec[_0xd63a('0x57')][_0xd63a('0x97')])){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))](_0xd63a('0x9a'));}if(_[_0xd63a('0x99')](_0x720eec['body'][_0xd63a('0x57')])||_0x720eec[_0xd63a('0x57')]['body']===''){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))](_0xd63a('0x9b'));}if(_[_0xd63a('0x99')](_0x720eec[_0xd63a('0x57')]['mapKey'])){throw new db['Sequelize'][(_0xd63a('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4eefa0);}if(!_[_0xd63a('0x9c')](_0x4eefa0,_0x720eec[_0xd63a('0x57')][_0xd63a('0x9d')])){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))](_0xd63a('0x9e')+_0x4eefa0);}_0xfaf846[_0x720eec['body'][_0xd63a('0x9d')]]=_0x720eec[_0xd63a('0x57')]['from'];return db[_0xd63a('0x9f')][_0xd63a('0x58')]({'where':{'id':_0x720eec['account'][_0xd63a('0x8f')]},'include':[{'model':db[_0xd63a('0x87')],'as':_0xd63a('0xa0'),'where':_0xfaf846,'limit':0x1,'order':[[_0xd63a('0x8d'),'DESC']]}]});})[_0xd63a('0x1b')](handleEntityNotFound(_0x559eae,null))[_0xd63a('0x1b')](function(_0x2943a8){if(_0x2943a8){_0x720eec['list']=_['omit'](_0x2943a8,[_0xd63a('0xa0')]);if(_0x2943a8[_0xd63a('0xa0')][_0xd63a('0x42')]){return _0x2943a8[_0xd63a('0xa0')][0x0];}var _0x294159=_[_0xd63a('0x13')](_0x720eec[_0xd63a('0x57')],{'firstName':_0x720eec[_0xd63a('0x57')][_0xd63a('0x97')],'ListId':_0x2943a8['id']});_0x294159[_0x720eec[_0xd63a('0x57')][_0xd63a('0x9d')]]=_0x720eec['body']['from'];return db[_0xd63a('0x87')]['create'](_0x294159,{'fields':_0x4fc639,'raw':!![]});}})['then'](handleEntityNotFound(_0x559eae,null))['then'](function(_0x5c1e97){if(_0x5c1e97){_0x720eec[_0xd63a('0xa1')]=_0x5c1e97;var _0x45cd1f={'ContactId':_0x5c1e97['id'],'phone':_0x720eec['body'][_0xd63a('0x97')],'WhatsappAccountId':_0x1bcb86['params']['id']};var _0x2b05d5={'ContactId':_0x5c1e97['id'],'WhatsappAccountId':_0x1bcb86[_0xd63a('0x5c')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xd63a('0x58')]({'where':_0x2b05d5})[_0xd63a('0x1b')](function(_0x4a3dd9){if(_0x4a3dd9){return[_0x4a3dd9,![]];}return db[_0xd63a('0xa2')]['create'](_0x45cd1f)['then'](function(_0x18c425){return[_0x18c425,!![]];});});}})[_0xd63a('0x69')](function(_0x1357f1,_0x5f04e0){_0x720eec[_0xd63a('0xa3')]=_0x1357f1[_0xd63a('0x2e')]({'plain':!![]});_0x720eec[_0xd63a('0xa3')][_0xd63a('0xa4')]=![];if(_0x5f04e0){if(_0x720eec[_0xd63a('0x7d')][_0xd63a('0xa5')]){_0x720eec[_0xd63a('0x84')]['push']({'id':0x0,'priority':_0x720eec[_0xd63a('0x84')]['length']+0x1,'app':'close','appdata':_0xd63a('0xa6'),'interval':_0xd63a('0xa7')});}_0x720eec[_0xd63a('0xa3')][_0xd63a('0xa4')]=!![];}return db[_0xd63a('0x81')][_0xd63a('0x50')]({'phone':_0x720eec[_0xd63a('0x57')]['from'],'messageId':_0x720eec[_0xd63a('0x57')][_0xd63a('0x95')],'body':_0x720eec[_0xd63a('0x57')][_0xd63a('0x57')],'WhatsappAccountId':_0x1bcb86[_0xd63a('0x5c')]['id'],'WhatsappInteractionId':_0x1357f1['id'],'direction':'in','ContactId':_0x1357f1[_0xd63a('0xa8')],'AttachmentId':_0x720eec['body'][_0xd63a('0xa9')]});})['then'](function(_0xd0e59){_0x720eec[_0xd63a('0x21')]=_0xd0e59;if(!_0x720eec['interaction']['UserId'])return;return db[_0xd63a('0x70')][_0xd63a('0x58')]({'attributes':['id',_0xd63a('0x33')],'where':{'id':_0x720eec[_0xd63a('0xa3')]['UserId']}});})[_0xd63a('0x1b')](function(_0x28a5f6){if(_0x28a5f6){_0x720eec[_0xd63a('0x84')][_0xd63a('0xaa')]({'id':0x0,'priority':0x0,'app':_0xd63a('0xab'),'appdata':_0x28a5f6['name']+','+(_0x720eec[_0xd63a('0x7d')][_0xd63a('0xac')]||0xa),'interval':_0xd63a('0xa7')});}if(!_0x720eec[_0xd63a('0xa3')]['queueId'])return;return db[_0xd63a('0xad')]['find']({'attributes':['id',_0xd63a('0x33')],'where':{'id':_0x720eec['interaction']['queueId']}});})[_0xd63a('0x1b')](function(_0x23b10f){if(_0x23b10f){_0x720eec[_0xd63a('0x84')][_0xd63a('0xaa')]({'id':0x0,'priority':0x1,'app':_0xd63a('0xae'),'appdata':_0x23b10f['name']+','+(_0x720eec['account'][_0xd63a('0xaf')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xd63a('0xb0'),'startRouting',_0x720eec);})[_0xd63a('0x1b')](function(_0x200b94){if(_0x200b94){var _0x54e5a6=0xc8;var _0x57bb46='receiveMessage';logger['info'](_0xd63a('0xb1'),_0x57bb46,_0x54e5a6,_0xd63a('0xb2'));logger[_0xd63a('0x1f')](_0xd63a('0xb3'),_0x57bb46,_0x54e5a6,'entity\x20found',JSON[_0xd63a('0xb4')](_0x200b94));if(_0x720eec[_0xd63a('0x7d')][_0xd63a('0x39')]==='twilio'){return _0x559eae[_0xd63a('0x24')](_0x54e5a6)[_0xd63a('0x2b')](_0xd63a('0xb5'),_0xd63a('0xb6'))['send'](_0xd63a('0xb7'));}else{return _0x559eae['status'](_0x54e5a6)['json'](_0x200b94);}}});})[_0xd63a('0x22')](handleError(_0x559eae,null));};exports[_0xd63a('0x34')]=function(_0xd4dfdc,_0x433dd2,_0x28da5c){var _0x242aed,_0x3a281f,_0x1fc29d;if(_[_0xd63a('0x99')](_0xd4dfdc[_0xd63a('0x57')][_0xd63a('0x57')])||_0xd4dfdc[_0xd63a('0x57')][_0xd63a('0x57')]===''){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd63a('0x99')](_0xd4dfdc['body']['to'])){throw new db[(_0xd63a('0x88'))][(_0xd63a('0x89'))]('to\x20is\x20mandatory');}_0x242aed=_0xd4dfdc[_0xd63a('0x57')]['to'];return db[_0xd63a('0x4a')][_0xd63a('0x58')]({'where':{'id':_0xd4dfdc['params']['id']},'include':[{'model':db[_0xd63a('0x9f')],'as':_0xd63a('0xb8'),'include':[{'model':db[_0xd63a('0x87')],'as':_0xd63a('0xa0'),'where':{'mobile':_0x242aed},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x433dd2,null))[_0xd63a('0x1b')](function(_0x10bcb5){if(_0x10bcb5&&_0x10bcb5[_0xd63a('0xb8')]){_0x3a281f=_0x10bcb5[_0xd63a('0x2e')]({'plain':!![]});if(_0x3a281f['List']&&_0x3a281f[_0xd63a('0xb8')][_0xd63a('0xa0')][_0xd63a('0x42')]){return _0x3a281f[_0xd63a('0xb8')][_0xd63a('0xa0')][0x0];}return db['CmContact'][_0xd63a('0x50')](_[_0xd63a('0x13')](_0xd4dfdc[_0xd63a('0x57')],{'firstName':_0x242aed,'mobile':_0x242aed,'phone':_0x242aed,'ListId':_0x3a281f[_0xd63a('0x8f')]}));}})[_0xd63a('0x1b')](handleEntityNotFound(_0x433dd2,null))[_0xd63a('0x1b')](function(_0x30045e){if(_0x30045e){_0x1fc29d=_0x30045e;return db[_0xd63a('0xa2')][_0xd63a('0x58')]({'where':{'ContactId':_0x1fc29d['id'],'closed':![],'WhatsappAccountId':_0x3a281f['id']}})[_0xd63a('0x1b')](function(_0x5c828b){if(_0x5c828b){return[_0x5c828b,![]];}return db[_0xd63a('0xa2')]['create']({'UserId':_0xd4dfdc[_0xd63a('0x53')]['id'],'ContactId':_0x1fc29d['id'],'WhatsappAccountId':_0x3a281f['id'],'phone':_0x242aed,'firstMsgDirection':_0xd63a('0xb9'),'Messages':[_[_0xd63a('0x48')](_0xd4dfdc['body'],{'read':![],'body':_0xd4dfdc['body'][_0xd63a('0x57')],'phone':_0x242aed,'WhatsappAccountId':_0x3a281f['id'],'UserId':_0xd4dfdc[_0xd63a('0x53')]['id'],'ContactId':_0x1fc29d['id']})]},{'include':[{'model':db[_0xd63a('0x81')],'as':_0xd63a('0xba')}]})[_0xd63a('0x1b')](function(_0xbc91a5){return[_0xbc91a5,!![]];});});}})[_0xd63a('0x69')](function(_0x135dc6,_0x46b402){if(_0x46b402){return _0x135dc6;}return db['WhatsappMessage'][_0xd63a('0x50')](_['merge'](_0xd4dfdc[_0xd63a('0x57')],{'read':![],'body':_0xd4dfdc[_0xd63a('0x57')][_0xd63a('0x57')],'phone':_0x242aed,'WhatsappAccountId':_0x3a281f['id'],'WhatsappInteractionId':_0x135dc6['id'],'UserId':_0xd4dfdc['user']['id'],'ContactId':_0x1fc29d['id']}))[_0xd63a('0x1b')](function(_0x2b05d3){_0x135dc6[_0xd63a('0xbb')][_0xd63a('0xba')]=[];_0x135dc6[_0xd63a('0xbb')][_0xd63a('0xba')][_0xd63a('0xbc')](_0x2b05d3[_0xd63a('0xbb')]);return _0x135dc6;});})['then'](respondWithResult(_0x433dd2,null))[_0xd63a('0x22')](handleError(_0x433dd2,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6afb8a1..841107e 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 _0x5fe5=['save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3b8d58,_0x10bae6){var _0x19943a=function(_0x1b1daf){while(--_0x1b1daf){_0x3b8d58['push'](_0x3b8d58['shift']());}};_0x19943a(++_0x10bae6);}(_0x5fe5,0x1db));var _0x55fe=function(_0x44a9c8,_0x19facb){_0x44a9c8=_0x44a9c8-0x0;var _0x3a3d70=_0x5fe5[_0x44a9c8];return _0x3a3d70;};'use strict';var EventEmitter=require(_0x55fe('0x0'));var WhatsappAccount=require('../../mysqldb')['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x55fe('0x1'),'afterUpdate':_0x55fe('0x2'),'afterDestroy':_0x55fe('0x3')};function emitEvent(_0x423481){return function(_0x41f1d1,_0x349524,_0x11b12c){WhatsappAccountEvents[_0x55fe('0x4')](_0x423481+':'+_0x41f1d1['id'],_0x41f1d1);WhatsappAccountEvents[_0x55fe('0x4')](_0x423481,_0x41f1d1);_0x11b12c(null);};}for(var e in events){if(events[_0x55fe('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x55fe('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x3134=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3e2703,_0x402996){var _0x5a9018=function(_0xf8edd9){while(--_0xf8edd9){_0x3e2703['push'](_0x3e2703['shift']());}};_0x5a9018(++_0x402996);}(_0x3134,0x16e));var _0x4313=function(_0xf41af4,_0x2dca83){_0xf41af4=_0xf41af4-0x0;var _0x1290bc=_0x3134[_0xf41af4];return _0x1290bc;};'use strict';var EventEmitter=require(_0x4313('0x0'));var WhatsappAccount=require(_0x4313('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4313('0x2')](0x0);var events={'afterCreate':_0x4313('0x3'),'afterUpdate':_0x4313('0x4'),'afterDestroy':_0x4313('0x5')};function emitEvent(_0x5b33a8){return function(_0x5ce038,_0x4996eb,_0xc19a81){WhatsappAccountEvents[_0x4313('0x6')](_0x5b33a8+':'+_0x5ce038['id'],_0x5ce038);WhatsappAccountEvents[_0x4313('0x6')](_0x5b33a8,_0x5ce038);_0xc19a81(null);};}for(var e in events){if(events[_0x4313('0x7')](e)){var event=events[e];WhatsappAccount[_0x4313('0x8')](e,emitEvent(event));}}module[_0x4313('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 6f9e2a7..1235e1b 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 _0xfadd=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfadd,0x138));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xdfad('0x0'));var util=require(_0xdfad('0x1'));var logger=require(_0xdfad('0x2'))(_0xdfad('0x3'));var moment=require(_0xdfad('0x4'));var BPromise=require('bluebird');var rp=require(_0xdfad('0x5'));var fs=require('fs');var path=require(_0xdfad('0x6'));var rimraf=require('rimraf');var config=require(_0xdfad('0x7'));var attributes=require(_0xdfad('0x8'));module[_0xdfad('0x9')]=function(_0x1eed02,_0x473b29){return _0x1eed02[_0xdfad('0xa')](_0xdfad('0xb'),attributes,{'tableName':_0xdfad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66bd=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x66bd,0x18c));var _0xd66b=function(_0x32f850,_0x6ba444){_0x32f850=_0x32f850-0x0;var _0x38e424=_0x66bd[_0x32f850];return _0x38e424;};'use strict';var _=require(_0xd66b('0x0'));var util=require(_0xd66b('0x1'));var logger=require(_0xd66b('0x2'))(_0xd66b('0x3'));var moment=require(_0xd66b('0x4'));var BPromise=require(_0xd66b('0x5'));var rp=require(_0xd66b('0x6'));var fs=require('fs');var path=require(_0xd66b('0x7'));var rimraf=require('rimraf');var config=require(_0xd66b('0x8'));var attributes=require(_0xd66b('0x9'));module[_0xd66b('0xa')]=function(_0x45e812,_0x48e22a){return _0x45e812[_0xd66b('0xb')](_0xd66b('0xc'),attributes,{'tableName':_0xd66b('0xd'),'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 987e75f..ab4537e 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 _0xcf66=['WhatsappAccount','options','raw','where','map','include','model','attributes','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','WhatsappAccount,\x20%s,\x20%s','info','catch','ShowWhatsappAccount'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xcf66,0x71));var _0x6cf6=function(_0x1873e8,_0x4b77d7){_0x1873e8=_0x1873e8-0x0;var _0x523aef=_0xcf66[_0x1873e8];return _0x523aef;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var moment=require(_0x6cf6('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cf6('0x3'));var fs=require('fs');var Redis=require(_0x6cf6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cf6('0x5'))(_0x6cf6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6cf6('0x7'));var client=jayson[_0x6cf6('0x8')][_0x6cf6('0x9')]({'port':0x232a});config['redis']=_[_0x6cf6('0xa')](config[_0x6cf6('0xb')],{'host':_0x6cf6('0xc'),'port':0x18eb});var socket=require(_0x6cf6('0xd'))(new Redis(config[_0x6cf6('0xb')]));require(_0x6cf6('0xe'))['register'](socket);function respondWithRpcPromise(_0x58378c,_0x5b7f4e,_0x8e90e){return new BPromise(function(_0x504c98,_0x1fdf80){return client[_0x6cf6('0xf')](_0x58378c,_0x8e90e)[_0x6cf6('0x10')](function(_0x3f7fc1){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5b7f4e,'request\x20sent');logger[_0x6cf6('0x11')](_0x6cf6('0x12'),_0x5b7f4e,_0x6cf6('0x13'),JSON[_0x6cf6('0x14')](_0x3f7fc1));if(_0x3f7fc1[_0x6cf6('0x15')]){if(_0x3f7fc1[_0x6cf6('0x15')]['code']===0x1f4){logger[_0x6cf6('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x1fdf80(_0x3f7fc1['error'][_0x6cf6('0x16')]);}logger[_0x6cf6('0x15')](_0x6cf6('0x17'),_0x5b7f4e,_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);return _0x504c98(_0x3f7fc1[_0x6cf6('0x15')][_0x6cf6('0x16')]);}else{logger[_0x6cf6('0x18')](_0x6cf6('0x17'),_0x5b7f4e,_0x6cf6('0x13'));_0x504c98(_0x3f7fc1['result'][_0x6cf6('0x16')]);}})[_0x6cf6('0x19')](function(_0x22ab0){logger['error'](_0x6cf6('0x17'),_0x5b7f4e,_0x22ab0);_0x1fdf80(_0x22ab0);});});}exports[_0x6cf6('0x1a')]=function(_0x101e39){var _0x2995b3=this;return new Promise(function(_0x440634,_0x21e903){return db[_0x6cf6('0x1b')]['find']({'raw':_0x101e39[_0x6cf6('0x1c')]?_0x101e39[_0x6cf6('0x1c')][_0x6cf6('0x1d')]===undefined?!![]:![]:!![],'where':_0x101e39[_0x6cf6('0x1c')]?_0x101e39[_0x6cf6('0x1c')][_0x6cf6('0x1e')]||null:null,'attributes':_0x101e39[_0x6cf6('0x1c')]?_0x101e39[_0x6cf6('0x1c')]['attributes']||null:null,'include':_0x101e39['options']?_0x101e39[_0x6cf6('0x1c')]['include']?_[_0x6cf6('0x1f')](_0x101e39[_0x6cf6('0x1c')][_0x6cf6('0x20')],function(_0x448f26){return{'model':db[_0x448f26[_0x6cf6('0x21')]],'as':_0x448f26['as'],'attributes':_0x448f26[_0x6cf6('0x22')],'include':_0x448f26[_0x6cf6('0x20')]?_['map'](_0x448f26[_0x6cf6('0x20')],function(_0xc7b489){return{'model':db[_0xc7b489[_0x6cf6('0x21')]],'as':_0xc7b489['as'],'attributes':_0xc7b489['attributes'],'include':_0xc7b489[_0x6cf6('0x20')]?_[_0x6cf6('0x1f')](_0xc7b489[_0x6cf6('0x20')],function(_0x1f5a88){return{'model':db[_0x1f5a88['model']],'as':_0x1f5a88['as'],'attributes':_0x1f5a88['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cf6('0x10')](function(_0x4521af){logger[_0x6cf6('0x18')](_0x6cf6('0x1a'),_0x101e39);logger['debug'](_0x6cf6('0x1a'),_0x101e39,JSON['stringify'](_0x4521af));_0x440634(_0x4521af);})['catch'](function(_0x519a70){logger[_0x6cf6('0x15')](_0x6cf6('0x1a'),_0x519a70[_0x6cf6('0x16')],_0x101e39);_0x21e903(_0x2995b3[_0x6cf6('0x15')](0x1f4,_0x519a70[_0x6cf6('0x16')]));});});}; \ No newline at end of file +var _0xe7f4=['register','request','then','request\x20sent','debug','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','info','result','WhatsappAccount','find','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappAccount.socket'];(function(_0x1f7f89,_0x5155f2){var _0x455f1c=function(_0x4d1543){while(--_0x4d1543){_0x1f7f89['push'](_0x1f7f89['shift']());}};_0x455f1c(++_0x5155f2);}(_0xe7f4,0x8f));var _0x4e7f=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xe7f4[_0x1ae31c];return _0x19519d;};'use strict';var _=require(_0x4e7f('0x0'));var util=require(_0x4e7f('0x1'));var moment=require(_0x4e7f('0x2'));var BPromise=require(_0x4e7f('0x3'));var rs=require(_0x4e7f('0x4'));var fs=require('fs');var Redis=require(_0x4e7f('0x5'));var db=require(_0x4e7f('0x6'))['db'];var utils=require(_0x4e7f('0x7'));var logger=require(_0x4e7f('0x8'))(_0x4e7f('0x9'));var config=require(_0x4e7f('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4e7f('0xb')][_0x4e7f('0xc')]({'port':0x232a});config[_0x4e7f('0xd')]=_[_0x4e7f('0xe')](config[_0x4e7f('0xd')],{'host':_0x4e7f('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4e7f('0x10'))[_0x4e7f('0x11')](socket);function respondWithRpcPromise(_0x139d93,_0x460afc,_0x1531ac){return new BPromise(function(_0x31e2fe,_0x79c351){return client[_0x4e7f('0x12')](_0x139d93,_0x1531ac)[_0x4e7f('0x13')](function(_0xed3735){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x460afc,_0x4e7f('0x14'));logger[_0x4e7f('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x460afc,'request\x20sent',JSON[_0x4e7f('0x16')](_0xed3735));if(_0xed3735['error']){if(_0xed3735[_0x4e7f('0x17')][_0x4e7f('0x18')]===0x1f4){logger[_0x4e7f('0x17')](_0x4e7f('0x19'),_0x460afc,_0xed3735[_0x4e7f('0x17')][_0x4e7f('0x1a')]);return _0x79c351(_0xed3735[_0x4e7f('0x17')]['message']);}logger['error'](_0x4e7f('0x19'),_0x460afc,_0xed3735[_0x4e7f('0x17')]['message']);return _0x31e2fe(_0xed3735[_0x4e7f('0x17')][_0x4e7f('0x1a')]);}else{logger[_0x4e7f('0x1b')](_0x4e7f('0x19'),_0x460afc,_0x4e7f('0x14'));_0x31e2fe(_0xed3735[_0x4e7f('0x1c')][_0x4e7f('0x1a')]);}})['catch'](function(_0x17811a){logger[_0x4e7f('0x17')](_0x4e7f('0x19'),_0x460afc,_0x17811a);_0x79c351(_0x17811a);});});}exports['ShowWhatsappAccount']=function(_0x4914f4){var _0x109f9f=this;return new Promise(function(_0x12a631,_0x39b6d1){return db[_0x4e7f('0x1d')][_0x4e7f('0x1e')]({'raw':_0x4914f4['options']?_0x4914f4[_0x4e7f('0x1f')][_0x4e7f('0x20')]===undefined?!![]:![]:!![],'where':_0x4914f4[_0x4e7f('0x1f')]?_0x4914f4['options'][_0x4e7f('0x21')]||null:null,'attributes':_0x4914f4[_0x4e7f('0x1f')]?_0x4914f4['options']['attributes']||null:null,'include':_0x4914f4[_0x4e7f('0x1f')]?_0x4914f4[_0x4e7f('0x1f')][_0x4e7f('0x22')]?_[_0x4e7f('0x23')](_0x4914f4[_0x4e7f('0x1f')][_0x4e7f('0x22')],function(_0x545644){return{'model':db[_0x545644[_0x4e7f('0x24')]],'as':_0x545644['as'],'attributes':_0x545644[_0x4e7f('0x25')],'include':_0x545644[_0x4e7f('0x22')]?_[_0x4e7f('0x23')](_0x545644[_0x4e7f('0x22')],function(_0x1252c1){return{'model':db[_0x1252c1[_0x4e7f('0x24')]],'as':_0x1252c1['as'],'attributes':_0x1252c1[_0x4e7f('0x25')],'include':_0x1252c1['include']?_[_0x4e7f('0x23')](_0x1252c1[_0x4e7f('0x22')],function(_0x261e0c){return{'model':db[_0x261e0c['model']],'as':_0x261e0c['as'],'attributes':_0x261e0c[_0x4e7f('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4e7f('0x13')](function(_0x5958f3){logger[_0x4e7f('0x1b')](_0x4e7f('0x26'),_0x4914f4);logger[_0x4e7f('0x15')](_0x4e7f('0x26'),_0x4914f4,JSON[_0x4e7f('0x16')](_0x5958f3));_0x12a631(_0x5958f3);})[_0x4e7f('0x27')](function(_0x34b71a){logger[_0x4e7f('0x17')]('ShowWhatsappAccount',_0x34b71a[_0x4e7f('0x1a')],_0x4914f4);_0x39b6d1(_0x109f9f[_0x4e7f('0x17')](0x1f4,_0x34b71a[_0x4e7f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 21fe77b..571d4f4 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 _0x1b2f=['save','remove','update','emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1b2f,0x104));var _0xf1b2=function(_0x30703c,_0x32c526){_0x30703c=_0x30703c-0x0;var _0x424bcc=_0x1b2f[_0x30703c];return _0x424bcc;};'use strict';var WhatsappAccountEvents=require(_0xf1b2('0x0'));var events=[_0xf1b2('0x1'),_0xf1b2('0x2'),_0xf1b2('0x3')];function createListener(_0xa72149,_0x3f2c3f){return function(_0x3d033b){_0x3f2c3f[_0xf1b2('0x4')](_0xa72149,_0x3d033b);};}function removeListener(_0x553171,_0x5a48be){return function(){WhatsappAccountEvents[_0xf1b2('0x5')](_0x553171,_0x5a48be);};}exports[_0xf1b2('0x6')]=function(_0x286352){for(var _0x2f9a1f=0x0,_0x23e375=events[_0xf1b2('0x7')];_0x2f9a1f<_0x23e375;_0x2f9a1f++){var _0x499437=events[_0x2f9a1f];var _0x46a3a9=createListener(_0xf1b2('0x8')+_0x499437,_0x286352);WhatsappAccountEvents['on'](_0x499437,_0x46a3a9);}}; \ No newline at end of file +var _0x1ee5=['register','length','remove','emit','removeListener'];(function(_0x24b87e,_0x20593d){var _0x36038f=function(_0x21886a){while(--_0x21886a){_0x24b87e['push'](_0x24b87e['shift']());}};_0x36038f(++_0x20593d);}(_0x1ee5,0x124));var _0x51ee=function(_0x2422a6,_0x5979c9){_0x2422a6=_0x2422a6-0x0;var _0x1f9c40=_0x1ee5[_0x2422a6];return _0x1f9c40;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x51ee('0x0'),'update'];function createListener(_0x268609,_0x3c9b1e){return function(_0x3ae8cf){_0x3c9b1e[_0x51ee('0x1')](_0x268609,_0x3ae8cf);};}function removeListener(_0x145ba3,_0x2593f7){return function(){WhatsappAccountEvents[_0x51ee('0x2')](_0x145ba3,_0x2593f7);};}exports[_0x51ee('0x3')]=function(_0x54d470){for(var _0x2fa908=0x0,_0xb2a16=events[_0x51ee('0x4')];_0x2fa908<_0xb2a16;_0x2fa908++){var _0x365c63=events[_0x2fa908];var _0x3730d7=createListener('whatsappAccount:'+_0x365c63,_0x54d470);WhatsappAccountEvents['on'](_0x365c63,_0x3730d7);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 7dc1568..e8fa4b7 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 _0x0ad2=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0ad2,0x139));var _0x20ad=function(_0x5a73a0,_0x4f9df5){_0x5a73a0=_0x5a73a0-0x0;var _0x379bbf=_0x0ad2[_0x5a73a0];return _0x379bbf;};'use strict';var multer=require(_0x20ad('0x0'));var util=require(_0x20ad('0x1'));var path=require(_0x20ad('0x2'));var timeout=require(_0x20ad('0x3'));var express=require(_0x20ad('0x4'));var router=express[_0x20ad('0x5')]();var fs_extra=require(_0x20ad('0x6'));var auth=require(_0x20ad('0x7'));var interaction=require(_0x20ad('0x8'));var config=require(_0x20ad('0x9'));var controller=require(_0x20ad('0xa'));router[_0x20ad('0xb')]('/',auth[_0x20ad('0xc')](),controller[_0x20ad('0xd')]);router[_0x20ad('0xb')]('/:id',auth[_0x20ad('0xc')](),controller['show']);router[_0x20ad('0xe')]('/',auth[_0x20ad('0xc')](),controller[_0x20ad('0xf')]);router[_0x20ad('0x10')](_0x20ad('0x11'),auth[_0x20ad('0xc')](),controller[_0x20ad('0x12')]);router['delete'](_0x20ad('0x11'),auth[_0x20ad('0xc')](),controller[_0x20ad('0x13')]);module[_0x20ad('0x14')]=router; \ No newline at end of file +var _0x316a=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','post','create'];(function(_0x183ba0,_0x51c669){var _0xdbf1e7=function(_0x506ba5){while(--_0x506ba5){_0x183ba0['push'](_0x183ba0['shift']());}};_0xdbf1e7(++_0x51c669);}(_0x316a,0xaf));var _0xa316=function(_0x3852a4,_0x163221){_0x3852a4=_0x3852a4-0x0;var _0x8d8ea7=_0x316a[_0x3852a4];return _0x8d8ea7;};'use strict';var multer=require(_0xa316('0x0'));var util=require(_0xa316('0x1'));var path=require('path');var timeout=require(_0xa316('0x2'));var express=require(_0xa316('0x3'));var router=express[_0xa316('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa316('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0xa316('0x6')]('/',auth['isAuthenticated'](),controller[_0xa316('0x7')]);router[_0xa316('0x6')](_0xa316('0x8'),auth[_0xa316('0x9')](),controller['show']);router[_0xa316('0xa')]('/',auth['isAuthenticated'](),controller[_0xa316('0xb')]);router[_0xa316('0xc')](_0xa316('0x8'),auth[_0xa316('0x9')](),controller[_0xa316('0xd')]);router[_0xa316('0xe')](_0xa316('0x8'),auth[_0xa316('0x9')](),controller[_0xa316('0xf')]);module[_0xa316('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 3e683a1..84a26b4 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 _0x90d1=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x37c0d8,_0xace935){var _0x22ef98=function(_0x4d9763){while(--_0x4d9763){_0x37c0d8['push'](_0x37c0d8['shift']());}};_0x22ef98(++_0xace935);}(_0x90d1,0x6e));var _0x190d=function(_0x5addf7,_0x50785e){_0x5addf7=_0x5addf7-0x0;var _0xb0746a=_0x90d1[_0x5addf7];return _0xb0746a;};'use strict';var Sequelize=require(_0x190d('0x0'));module[_0x190d('0x1')]={'priority':{'type':Sequelize[_0x190d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x190d('0x3')],'allowNull':![],'defaultValue':_0x190d('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x190d('0x3')],'defaultValue':_0x190d('0x5')}}; \ No newline at end of file +var _0xfdf4=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x3a0f77,_0x39f605){var _0x54fd0c=function(_0x46208c){while(--_0x46208c){_0x3a0f77['push'](_0x3a0f77['shift']());}};_0x54fd0c(++_0x39f605);}(_0xfdf4,0xe6));var _0x4fdf=function(_0x442c81,_0x527145){_0x442c81=_0x442c81-0x0;var _0x11f026=_0xfdf4[_0x442c81];return _0x11f026;};'use strict';var Sequelize=require(_0x4fdf('0x0'));module[_0x4fdf('0x1')]={'priority':{'type':Sequelize[_0x4fdf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4fdf('0x3')],'allowNull':![],'defaultValue':_0x4fdf('0x4')},'appdata':{'type':Sequelize[_0x4fdf('0x5')]()},'description':{'type':Sequelize[_0x4fdf('0x3')]},'interval':{'type':Sequelize[_0x4fdf('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 096f513..e030ebe 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 _0x79a3=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','WhatsappApplication','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring'];(function(_0x47b3bc,_0x41cc2d){var _0x3b024f=function(_0x26e3b5){while(--_0x26e3b5){_0x47b3bc['push'](_0x47b3bc['shift']());}};_0x3b024f(++_0x41cc2d);}(_0x79a3,0x80));var _0x379a=function(_0x3a4104,_0x1925df){_0x3a4104=_0x3a4104-0x0;var _0x242e14=_0x79a3[_0x3a4104];return _0x242e14;};'use strict';var emlformat=require(_0x379a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x379a('0x1'));var jsonpatch=require(_0x379a('0x2'));var rp=require('request-promise');var moment=require(_0x379a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x379a('0x4'));var sox=require(_0x379a('0x5'));var csv=require(_0x379a('0x6'));var ejs=require(_0x379a('0x7'));var fs=require('fs');var fs_extra=require(_0x379a('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x379a('0x9'));var deskjs=require(_0x379a('0xa'));var toCsv=require(_0x379a('0x6'));var querystring=require(_0x379a('0xb'));var Papa=require(_0x379a('0xc'));var Redis=require(_0x379a('0xd'));var authService=require(_0x379a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x379a('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x379a('0x10'));var config=require(_0x379a('0x11'));var licenseUtil=require(_0x379a('0x12'));var db=require(_0x379a('0x13'))['db'];function respondWithStatusCode(_0x4fa4c8,_0x51d2f4){_0x51d2f4=_0x51d2f4||0xcc;return function(_0x4c69a6){if(_0x4c69a6){return _0x4fa4c8[_0x379a('0x14')](_0x51d2f4);}return _0x4fa4c8[_0x379a('0x15')](_0x51d2f4)[_0x379a('0x16')]();};}function respondWithResult(_0x17adab,_0x561cbf){_0x561cbf=_0x561cbf||0xc8;return function(_0x55a38d){if(_0x55a38d){return _0x17adab[_0x379a('0x15')](_0x561cbf)[_0x379a('0x17')](_0x55a38d);}};}function respondWithFilteredResult(_0x3626b0,_0x3651b2){return function(_0x59f698){if(_0x59f698){var _0x56bbd5=typeof _0x3651b2[_0x379a('0x18')]==='undefined'&&typeof _0x3651b2[_0x379a('0x19')]===_0x379a('0x1a');var _0x1c217d=_0x59f698['count'];var _0x48f0a9=_0x56bbd5?0x0:_0x3651b2[_0x379a('0x18')];var _0xd6cc17=_0x56bbd5?_0x59f698['count']:_0x3651b2[_0x379a('0x18')]+_0x3651b2[_0x379a('0x19')];var _0x51d67c;if(_0xd6cc17>=_0x1c217d){_0xd6cc17=_0x1c217d;_0x51d67c=0xc8;}else{_0x51d67c=0xce;}_0x3626b0['status'](_0x51d67c);return _0x3626b0['set'](_0x379a('0x1b'),_0x48f0a9+'-'+_0xd6cc17+'/'+_0x1c217d)['json'](_0x59f698);}return null;};}function patchUpdates(_0x263df8){return function(_0x1cdebe){try{jsonpatch[_0x379a('0x1c')](_0x1cdebe,_0x263df8,!![]);}catch(_0x120997){return BPromise[_0x379a('0x1d')](_0x120997);}return _0x1cdebe[_0x379a('0x1e')]();};}function saveUpdates(_0x1d3f0f,_0x1b1b98){return function(_0x4c0dda){if(_0x4c0dda){return _0x4c0dda[_0x379a('0x1f')](_0x1d3f0f)[_0x379a('0x20')](function(_0x28aedc){return _0x28aedc;});}return null;};}function removeEntity(_0x22737a,_0x31752c){return function(_0x2bf6d8){if(_0x2bf6d8){return _0x2bf6d8[_0x379a('0x21')]()['then'](function(){_0x22737a[_0x379a('0x15')](0xcc)[_0x379a('0x16')]();});}};}function handleEntityNotFound(_0x18bb37,_0x516ddf){return function(_0x483ddd){if(!_0x483ddd){_0x18bb37[_0x379a('0x14')](0x194);}return _0x483ddd;};}function handleError(_0x599efb,_0x13e665){_0x13e665=_0x13e665||0x1f4;return function(_0xc1fc5a){logger['error'](_0xc1fc5a[_0x379a('0x22')]);if(_0xc1fc5a[_0x379a('0x23')]){delete _0xc1fc5a[_0x379a('0x23')];}_0x599efb['status'](_0x13e665)[_0x379a('0x24')](_0xc1fc5a);};}exports['index']=function(_0x2a1765,_0x33d5f7){var _0xa803f7={},_0x3f92b1={},_0x4eed7e={'count':0x0,'rows':[]};var _0x1153e9=_[_0x379a('0x25')](db[_0x379a('0x26')][_0x379a('0x27')],function(_0x30c9ab){return{'name':_0x30c9ab['fieldName'],'type':_0x30c9ab[_0x379a('0x28')][_0x379a('0x29')]};});_0x3f92b1[_0x379a('0x2a')]=_[_0x379a('0x25')](_0x1153e9,_0x379a('0x23'));_0x3f92b1['query']=_[_0x379a('0x2b')](_0x2a1765[_0x379a('0x2c')]);_0x3f92b1[_0x379a('0x2d')]=_[_0x379a('0x2e')](_0x3f92b1[_0x379a('0x2a')],_0x3f92b1[_0x379a('0x2c')]);_0xa803f7['attributes']=_['intersection'](_0x3f92b1[_0x379a('0x2a')],qs['fields'](_0x2a1765[_0x379a('0x2c')][_0x379a('0x2f')]));_0xa803f7[_0x379a('0x30')]=_0xa803f7['attributes']['length']?_0xa803f7[_0x379a('0x30')]:_0x3f92b1[_0x379a('0x2a')];if(!_0x2a1765[_0x379a('0x2c')][_0x379a('0x31')]('nolimit')){_0xa803f7[_0x379a('0x19')]=qs[_0x379a('0x19')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x19')]);_0xa803f7['offset']=qs[_0x379a('0x18')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x18')]);}_0xa803f7[_0x379a('0x32')]=qs[_0x379a('0x33')](_0x2a1765[_0x379a('0x2c')][_0x379a('0x33')]);_0xa803f7[_0x379a('0x34')]=qs[_0x379a('0x2d')](_[_0x379a('0x35')](_0x2a1765['query'],_0x3f92b1[_0x379a('0x2d')]),_0x1153e9);if(_0x2a1765[_0x379a('0x2c')][_0x379a('0x36')]){_0xa803f7['where']=_[_0x379a('0x37')](_0xa803f7[_0x379a('0x34')],{'$or':_['map'](_0x1153e9,function(_0x4c031c){if(_0x4c031c['type']!==_0x379a('0x38')){var _0x1fc9dd={};_0x1fc9dd[_0x4c031c[_0x379a('0x23')]]={'$like':'%'+_0x2a1765['query']['filter']+'%'};return _0x1fc9dd;}})});}_0xa803f7=_['merge']({},_0xa803f7,_0x2a1765[_0x379a('0x39')]);var _0x88df47={'where':_0xa803f7[_0x379a('0x34')]};return db[_0x379a('0x26')][_0x379a('0x3a')](_0x88df47)[_0x379a('0x20')](function(_0x140f5e){_0x4eed7e[_0x379a('0x3a')]=_0x140f5e;if(_0x2a1765[_0x379a('0x2c')][_0x379a('0x3b')]){_0xa803f7['include']=[{'all':!![]}];}return db[_0x379a('0x26')][_0x379a('0x3c')](_0xa803f7);})[_0x379a('0x20')](function(_0x476d7b){_0x4eed7e[_0x379a('0x3d')]=_0x476d7b;return _0x4eed7e;})[_0x379a('0x20')](respondWithFilteredResult(_0x33d5f7,_0xa803f7))[_0x379a('0x3e')](handleError(_0x33d5f7,null));};exports[_0x379a('0x3f')]=function(_0x17b5f3,_0x1d3c66){var _0x2d0e3f={'raw':!![],'where':{'id':_0x17b5f3[_0x379a('0x40')]['id']}},_0x5ada4c={};_0x5ada4c[_0x379a('0x2a')]=_['keys'](db[_0x379a('0x26')][_0x379a('0x27')]);_0x5ada4c[_0x379a('0x2c')]=_['keys'](_0x17b5f3[_0x379a('0x2c')]);_0x5ada4c[_0x379a('0x2d')]=_['intersection'](_0x5ada4c[_0x379a('0x2a')],_0x5ada4c[_0x379a('0x2c')]);_0x2d0e3f[_0x379a('0x30')]=_['intersection'](_0x5ada4c[_0x379a('0x2a')],qs[_0x379a('0x2f')](_0x17b5f3[_0x379a('0x2c')]['fields']));_0x2d0e3f['attributes']=_0x2d0e3f[_0x379a('0x30')][_0x379a('0x41')]?_0x2d0e3f[_0x379a('0x30')]:_0x5ada4c[_0x379a('0x2a')];if(_0x17b5f3['query'][_0x379a('0x3b')]){_0x2d0e3f[_0x379a('0x42')]=[{'all':!![]}];}_0x2d0e3f=_['merge']({},_0x2d0e3f,_0x17b5f3['options']);return db[_0x379a('0x26')][_0x379a('0x43')](_0x2d0e3f)['then'](handleEntityNotFound(_0x1d3c66,null))[_0x379a('0x20')](respondWithResult(_0x1d3c66,null))[_0x379a('0x3e')](handleError(_0x1d3c66,null));};exports[_0x379a('0x44')]=function(_0x1d113c,_0x7abb23){return db[_0x379a('0x26')][_0x379a('0x44')](_0x1d113c[_0x379a('0x45')],{})[_0x379a('0x20')](respondWithResult(_0x7abb23,0xc9))[_0x379a('0x3e')](handleError(_0x7abb23,null));};exports['update']=function(_0x1f75e7,_0xb85859){if(_0x1f75e7[_0x379a('0x45')]['id']){delete _0x1f75e7[_0x379a('0x45')]['id'];}return db[_0x379a('0x26')]['find']({'where':{'id':_0x1f75e7[_0x379a('0x40')]['id']}})[_0x379a('0x20')](handleEntityNotFound(_0xb85859,null))[_0x379a('0x20')](saveUpdates(_0x1f75e7[_0x379a('0x45')],null))[_0x379a('0x20')](respondWithResult(_0xb85859,null))['catch'](handleError(_0xb85859,null));};exports[_0x379a('0x21')]=function(_0x41581a,_0x35cefe){return db[_0x379a('0x26')][_0x379a('0x43')]({'where':{'id':_0x41581a[_0x379a('0x40')]['id']}})[_0x379a('0x20')](handleEntityNotFound(_0x35cefe,null))[_0x379a('0x20')](removeEntity(_0x35cefe,null))[_0x379a('0x3e')](handleError(_0x35cefe,null));}; \ No newline at end of file +var _0x7f59=['fields','length','attributes','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','show','intersection','find','catch','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','set','apply','reject','save','then','destroy','end','sendStatus','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x10139d,_0x1d2d2b){var _0x2d5e45=function(_0x574912){while(--_0x574912){_0x10139d['push'](_0x10139d['shift']());}};_0x2d5e45(++_0x1d2d2b);}(_0x7f59,0x12e));var _0x97f5=function(_0x46bdee,_0x3c3738){_0x46bdee=_0x46bdee-0x0;var _0x5a3fae=_0x7f59[_0x46bdee];return _0x5a3fae;};'use strict';var emlformat=require(_0x97f5('0x0'));var rimraf=require(_0x97f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x97f5('0x2'));var rp=require(_0x97f5('0x3'));var moment=require(_0x97f5('0x4'));var BPromise=require(_0x97f5('0x5'));var Mustache=require(_0x97f5('0x6'));var util=require(_0x97f5('0x7'));var path=require(_0x97f5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97f5('0x9'));var squel=require(_0x97f5('0xa'));var crypto=require(_0x97f5('0xb'));var jsforce=require(_0x97f5('0xc'));var deskjs=require(_0x97f5('0xd'));var toCsv=require(_0x97f5('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x97f5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x97f5('0x10'));var hardwareService=require(_0x97f5('0x11'));var logger=require('../../config/logger')(_0x97f5('0x12'));var utils=require(_0x97f5('0x13'));var config=require(_0x97f5('0x14'));var licenseUtil=require(_0x97f5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e9348,_0x51ecf0){_0x51ecf0=_0x51ecf0||0xcc;return function(_0x52e270){if(_0x52e270){return _0x3e9348['sendStatus'](_0x51ecf0);}return _0x3e9348[_0x97f5('0x16')](_0x51ecf0)['end']();};}function respondWithResult(_0x2bb71d,_0x50c051){_0x50c051=_0x50c051||0xc8;return function(_0x40d970){if(_0x40d970){return _0x2bb71d[_0x97f5('0x16')](_0x50c051)[_0x97f5('0x17')](_0x40d970);}};}function respondWithFilteredResult(_0x2d7365,_0x149f5c){return function(_0x22b60c){if(_0x22b60c){var _0x4324e7=typeof _0x149f5c[_0x97f5('0x18')]==='undefined'&&typeof _0x149f5c['limit']===_0x97f5('0x19');var _0xb5cd54=_0x22b60c['count'];var _0x197be7=_0x4324e7?0x0:_0x149f5c[_0x97f5('0x18')];var _0x26caac=_0x4324e7?_0x22b60c[_0x97f5('0x1a')]:_0x149f5c[_0x97f5('0x18')]+_0x149f5c['limit'];var _0x2b4735;if(_0x26caac>=_0xb5cd54){_0x26caac=_0xb5cd54;_0x2b4735=0xc8;}else{_0x2b4735=0xce;}_0x2d7365[_0x97f5('0x16')](_0x2b4735);return _0x2d7365[_0x97f5('0x1b')]('Content-Range',_0x197be7+'-'+_0x26caac+'/'+_0xb5cd54)['json'](_0x22b60c);}return null;};}function patchUpdates(_0x43b957){return function(_0x52f92f){try{jsonpatch[_0x97f5('0x1c')](_0x52f92f,_0x43b957,!![]);}catch(_0x266703){return BPromise[_0x97f5('0x1d')](_0x266703);}return _0x52f92f[_0x97f5('0x1e')]();};}function saveUpdates(_0x47a1f1,_0x15201f){return function(_0xf7e42b){if(_0xf7e42b){return _0xf7e42b['update'](_0x47a1f1)[_0x97f5('0x1f')](function(_0x55697d){return _0x55697d;});}return null;};}function removeEntity(_0x3e7dcc,_0x57281e){return function(_0x297627){if(_0x297627){return _0x297627[_0x97f5('0x20')]()[_0x97f5('0x1f')](function(){_0x3e7dcc['status'](0xcc)[_0x97f5('0x21')]();});}};}function handleEntityNotFound(_0xefef9a,_0x1943c9){return function(_0x1eafce){if(!_0x1eafce){_0xefef9a[_0x97f5('0x22')](0x194);}return _0x1eafce;};}function handleError(_0x64284,_0x658a4c){_0x658a4c=_0x658a4c||0x1f4;return function(_0x284265){logger['error'](_0x284265['stack']);if(_0x284265[_0x97f5('0x23')]){delete _0x284265['name'];}_0x64284[_0x97f5('0x16')](_0x658a4c)[_0x97f5('0x24')](_0x284265);};}exports[_0x97f5('0x25')]=function(_0x1d758d,_0x33fa2d){var _0x561398={},_0x48e1e5={},_0x62e957={'count':0x0,'rows':[]};var _0x49bf8b=_[_0x97f5('0x26')](db[_0x97f5('0x27')][_0x97f5('0x28')],function(_0x38cfcc){return{'name':_0x38cfcc[_0x97f5('0x29')],'type':_0x38cfcc[_0x97f5('0x2a')][_0x97f5('0x2b')]};});_0x48e1e5[_0x97f5('0x2c')]=_[_0x97f5('0x26')](_0x49bf8b,_0x97f5('0x23'));_0x48e1e5[_0x97f5('0x2d')]=_[_0x97f5('0x2e')](_0x1d758d[_0x97f5('0x2d')]);_0x48e1e5[_0x97f5('0x2f')]=_['intersection'](_0x48e1e5[_0x97f5('0x2c')],_0x48e1e5[_0x97f5('0x2d')]);_0x561398['attributes']=_['intersection'](_0x48e1e5[_0x97f5('0x2c')],qs[_0x97f5('0x30')](_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x30')]));_0x561398['attributes']=_0x561398['attributes'][_0x97f5('0x31')]?_0x561398[_0x97f5('0x32')]:_0x48e1e5['model'];if(!_0x1d758d[_0x97f5('0x2d')]['hasOwnProperty'](_0x97f5('0x33'))){_0x561398[_0x97f5('0x34')]=qs['limit'](_0x1d758d['query']['limit']);_0x561398[_0x97f5('0x18')]=qs[_0x97f5('0x18')](_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x18')]);}_0x561398['order']=qs['sort'](_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x35')]);_0x561398['where']=qs[_0x97f5('0x2f')](_[_0x97f5('0x36')](_0x1d758d[_0x97f5('0x2d')],_0x48e1e5[_0x97f5('0x2f')]),_0x49bf8b);if(_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x37')]){_0x561398[_0x97f5('0x38')]=_['merge'](_0x561398[_0x97f5('0x38')],{'$or':_[_0x97f5('0x26')](_0x49bf8b,function(_0x7f1b98){if(_0x7f1b98[_0x97f5('0x2a')]!==_0x97f5('0x39')){var _0x1e447b={};_0x1e447b[_0x7f1b98[_0x97f5('0x23')]]={'$like':'%'+_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x37')]+'%'};return _0x1e447b;}})});}_0x561398=_[_0x97f5('0x3a')]({},_0x561398,_0x1d758d[_0x97f5('0x3b')]);var _0xdd1c20={'where':_0x561398[_0x97f5('0x38')]};return db['WhatsappApplication']['count'](_0xdd1c20)[_0x97f5('0x1f')](function(_0x121719){_0x62e957[_0x97f5('0x1a')]=_0x121719;if(_0x1d758d[_0x97f5('0x2d')][_0x97f5('0x3c')]){_0x561398[_0x97f5('0x3d')]=[{'all':!![]}];}return db[_0x97f5('0x27')]['findAll'](_0x561398);})[_0x97f5('0x1f')](function(_0x166099){_0x62e957['rows']=_0x166099;return _0x62e957;})[_0x97f5('0x1f')](respondWithFilteredResult(_0x33fa2d,_0x561398))['catch'](handleError(_0x33fa2d,null));};exports[_0x97f5('0x3e')]=function(_0x1a9149,_0xa444bc){var _0x3945ad={'raw':!![],'where':{'id':_0x1a9149['params']['id']}},_0x5bbc8a={};_0x5bbc8a[_0x97f5('0x2c')]=_[_0x97f5('0x2e')](db['WhatsappApplication'][_0x97f5('0x28')]);_0x5bbc8a[_0x97f5('0x2d')]=_[_0x97f5('0x2e')](_0x1a9149['query']);_0x5bbc8a[_0x97f5('0x2f')]=_[_0x97f5('0x3f')](_0x5bbc8a[_0x97f5('0x2c')],_0x5bbc8a[_0x97f5('0x2d')]);_0x3945ad[_0x97f5('0x32')]=_[_0x97f5('0x3f')](_0x5bbc8a[_0x97f5('0x2c')],qs['fields'](_0x1a9149[_0x97f5('0x2d')][_0x97f5('0x30')]));_0x3945ad[_0x97f5('0x32')]=_0x3945ad[_0x97f5('0x32')][_0x97f5('0x31')]?_0x3945ad[_0x97f5('0x32')]:_0x5bbc8a[_0x97f5('0x2c')];if(_0x1a9149[_0x97f5('0x2d')][_0x97f5('0x3c')]){_0x3945ad[_0x97f5('0x3d')]=[{'all':!![]}];}_0x3945ad=_[_0x97f5('0x3a')]({},_0x3945ad,_0x1a9149[_0x97f5('0x3b')]);return db[_0x97f5('0x27')][_0x97f5('0x40')](_0x3945ad)['then'](handleEntityNotFound(_0xa444bc,null))[_0x97f5('0x1f')](respondWithResult(_0xa444bc,null))[_0x97f5('0x41')](handleError(_0xa444bc,null));};exports['create']=function(_0x512a16,_0x57d9eb){return db['WhatsappApplication'][_0x97f5('0x42')](_0x512a16[_0x97f5('0x43')],{})[_0x97f5('0x1f')](respondWithResult(_0x57d9eb,0xc9))['catch'](handleError(_0x57d9eb,null));};exports[_0x97f5('0x44')]=function(_0x13b34d,_0x3e4261){if(_0x13b34d[_0x97f5('0x43')]['id']){delete _0x13b34d[_0x97f5('0x43')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x13b34d[_0x97f5('0x45')]['id']}})[_0x97f5('0x1f')](handleEntityNotFound(_0x3e4261,null))[_0x97f5('0x1f')](saveUpdates(_0x13b34d['body'],null))['then'](respondWithResult(_0x3e4261,null))[_0x97f5('0x41')](handleError(_0x3e4261,null));};exports[_0x97f5('0x20')]=function(_0x323ccf,_0x4f483c){return db['WhatsappApplication']['find']({'where':{'id':_0x323ccf[_0x97f5('0x45')]['id']}})[_0x97f5('0x1f')](handleEntityNotFound(_0x4f483c,null))[_0x97f5('0x1f')](removeEntity(_0x4f483c,null))['catch'](handleError(_0x4f483c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7b47808..074111e 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 _0x032a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications'];(function(_0x278f85,_0x59b235){var _0x2b0e80=function(_0x5903e8){while(--_0x5903e8){_0x278f85['push'](_0x278f85['shift']());}};_0x2b0e80(++_0x59b235);}(_0x032a,0xf0));var _0xa032=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x032a[_0xaa0309];return _0x5de7ce;};'use strict';var _=require('lodash');var util=require(_0xa032('0x0'));var logger=require('../../config/logger')(_0xa032('0x1'));var moment=require(_0xa032('0x2'));var BPromise=require(_0xa032('0x3'));var rp=require(_0xa032('0x4'));var fs=require('fs');var path=require(_0xa032('0x5'));var rimraf=require(_0xa032('0x6'));var config=require(_0xa032('0x7'));var attributes=require(_0xa032('0x8'));module[_0xa032('0x9')]=function(_0x2b1445,_0x43d0f5){return _0x2b1445[_0xa032('0xa')]('WhatsappApplication',attributes,{'tableName':_0xa032('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6ddd=['moment','bluebird','path','../../config/environment','exports','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x6ddd,0xae));var _0xd6dd=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6ddd[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd6dd('0x0'))(_0xd6dd('0x1'));var moment=require(_0xd6dd('0x2'));var BPromise=require(_0xd6dd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6dd('0x4'));var rimraf=require('rimraf');var config=require(_0xd6dd('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0xd6dd('0x6')]=function(_0x27439a,_0x47005f){return _0x27439a['define'](_0xd6dd('0x7'),attributes,{'tableName':_0xd6dd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd6dd('0x9'),'collate':_0xd6dd('0xa')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 4b5dc06..1bf6c53 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 _0x2dae=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x4788fe,_0x53c215){var _0x206687=function(_0x2c4776){while(--_0x2c4776){_0x4788fe['push'](_0x4788fe['shift']());}};_0x206687(++_0x53c215);}(_0x2dae,0xc3));var _0xe2da=function(_0x2de020,_0x252df0){_0x2de020=_0x2de020-0x0;var _0x182b7c=_0x2dae[_0x2de020];return _0x182b7c;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});} \ No newline at end of file +var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5906b6,_0x541824){var _0x2733da=function(_0x46b23f){while(--_0x46b23f){_0x5906b6['push'](_0x5906b6['shift']());}};_0x2733da(++_0x541824);}(_0x2d17,0x17e));var _0x72d1=function(_0x964032,_0x1a1d68){_0x964032=_0x964032-0x0;var _0xbfa2d5=_0x2d17[_0x964032];return _0xbfa2d5;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 8bf0192..b6fff5c 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 _0xf006=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','path','connect-timeout','Router','../../components/auth/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x4762ec,_0x2fb345){var _0x2fdb22=function(_0x8cf4c8){while(--_0x8cf4c8){_0x4762ec['push'](_0x4762ec['shift']());}};_0x2fdb22(++_0x2fb345);}(_0xf006,0x146));var _0x6f00=function(_0x54ad73,_0x482b4f){_0x54ad73=_0x54ad73-0x0;var _0x4e0f50=_0xf006[_0x54ad73];return _0x4e0f50;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6f00('0x0'));var timeout=require(_0x6f00('0x1'));var express=require('express');var router=express[_0x6f00('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6f00('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6f00('0x4'));router[_0x6f00('0x5')]('/',auth[_0x6f00('0x6')](),controller['index']);router[_0x6f00('0x5')]('/describe',auth[_0x6f00('0x6')](),controller[_0x6f00('0x7')]);router[_0x6f00('0x5')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x9')]);router[_0x6f00('0x5')](_0x6f00('0xa'),auth[_0x6f00('0x6')](),controller[_0x6f00('0xb')]);router[_0x6f00('0x5')](_0x6f00('0xc'),auth[_0x6f00('0x6')](),controller['download']);router[_0x6f00('0xd')]('/',auth[_0x6f00('0x6')](),controller[_0x6f00('0xe')]);router[_0x6f00('0xd')](_0x6f00('0xa'),auth['isAuthenticated'](),controller[_0x6f00('0xf')]);router['post'](_0x6f00('0x10'),auth['isAuthenticated'](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),_0x6f00('0x13')),controller[_0x6f00('0x14')]);router[_0x6f00('0x15')](_0x6f00('0x8'),auth[_0x6f00('0x6')](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),'whatsappinteraction:update'),controller[_0x6f00('0x16')]);router['delete']('/:id',auth[_0x6f00('0x6')](),interaction[_0x6f00('0x11')](_0x6f00('0x12'),_0x6f00('0x17')),controller[_0x6f00('0x18')]);router[_0x6f00('0x19')](_0x6f00('0x10'),auth[_0x6f00('0x6')](),controller[_0x6f00('0x1a')]);module[_0x6f00('0x1b')]=router; \ No newline at end of file +var _0x4f0d=['show','/:id/messages','/:id/download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0x4f0d,0x1c2));var _0xd4f0=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x4f0d[_0x454165];return _0x56db53;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd4f0('0x0')]();var fs_extra=require(_0xd4f0('0x1'));var auth=require(_0xd4f0('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd4f0('0x3'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0xd4f0('0x4')](),controller['index']);router[_0xd4f0('0x5')](_0xd4f0('0x6'),auth['isAuthenticated'](),controller[_0xd4f0('0x7')]);router[_0xd4f0('0x5')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),controller[_0xd4f0('0x9')]);router['get'](_0xd4f0('0xa'),auth[_0xd4f0('0x4')](),controller['getMessages']);router['get'](_0xd4f0('0xb'),auth[_0xd4f0('0x4')](),controller['download']);router[_0xd4f0('0xc')]('/',auth[_0xd4f0('0x4')](),controller[_0xd4f0('0xd')]);router[_0xd4f0('0xc')](_0xd4f0('0xa'),auth['isAuthenticated'](),controller[_0xd4f0('0xe')]);router[_0xd4f0('0xc')](_0xd4f0('0xf'),auth[_0xd4f0('0x4')](),interaction[_0xd4f0('0x10')](_0xd4f0('0x11'),_0xd4f0('0x12')),controller[_0xd4f0('0x13')]);router[_0xd4f0('0x14')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),interaction[_0xd4f0('0x10')]('whatsapp','whatsappinteraction:update'),controller[_0xd4f0('0x15')]);router[_0xd4f0('0x16')](_0xd4f0('0x8'),auth[_0xd4f0('0x4')](),interaction['tracked']('whatsapp',_0xd4f0('0x17')),controller[_0xd4f0('0x18')]);router[_0xd4f0('0x16')](_0xd4f0('0xf'),auth[_0xd4f0('0x4')](),controller[_0xd4f0('0x19')]);module[_0xd4f0('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 06b852e..be10bd3 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 _0xd983=['out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x37f8cd,_0x38aeee){var _0x7cfd8d=function(_0x1d5497){while(--_0x1d5497){_0x37f8cd['push'](_0x37f8cd['shift']());}};_0x7cfd8d(++_0x38aeee);}(_0xd983,0x1df));var _0x3d98=function(_0x54b915,_0x335768){_0x54b915=_0x54b915-0x0;var _0xe56145=_0xd983[_0x54b915];return _0xe56145;};'use strict';var Sequelize=require(_0x3d98('0x0'));var moment=require(_0x3d98('0x1'));module[_0x3d98('0x2')]={'closed':{'type':Sequelize[_0x3d98('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d98('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3d98('0x5')]},'note':{'type':Sequelize[_0x3d98('0x5')]},'phone':{'type':Sequelize[_0x3d98('0x5')]},'read1stAt':{'type':Sequelize[_0x3d98('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3d98('0x6')]('in',_0x3d98('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3d98('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3d98('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3d98('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x3d98('0x8')]}}; \ No newline at end of file +var _0xc664=['DATE','STRING','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc664,0x90));var _0x4c66=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc664[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4c66('0x0'));var moment=require(_0x4c66('0x1'));module['exports']={'closed':{'type':Sequelize[_0x4c66('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c66('0x3')]},'disposition':{'type':Sequelize[_0x4c66('0x4')]},'secondDisposition':{'type':Sequelize[_0x4c66('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4c66('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4c66('0x4')]},'read1stAt':{'type':Sequelize[_0x4c66('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4c66('0x5')]('in',_0x4c66('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4c66('0x5')]('in',_0x4c66('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4c66('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index e8de351..7248c71 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 _0xf29d=['fields','length','includeAll','merge','options','find','catch','create','body','describe','WhatsappMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','offset','order','sort','where','pick','WhatsappInteractionId','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','fullname','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','User','Owner','get','Whatsapp','Account','closed','disposition','basename','pipe','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','json','undefined','limit','count','Content-Range','update','then','destroy','sendStatus','name','send','index','map','rawAttributes','findAll','query','show','params','WhatsappInteraction','keys','filters','intersection','model','attributes'];(function(_0x5dbf9b,_0x4588c4){var _0x2cdbb5=function(_0x118fd4){while(--_0x118fd4){_0x5dbf9b['push'](_0x5dbf9b['shift']());}};_0x2cdbb5(++_0x4588c4);}(_0xf29d,0xc4));var _0xdf29=function(_0x26d6c5,_0x3e8110){_0x26d6c5=_0x26d6c5-0x0;var _0x2c6d9e=_0xf29d[_0x26d6c5];return _0x2c6d9e;};'use strict';var rimraf=require(_0xdf29('0x0'));var zipdir=require(_0xdf29('0x1'));var moment=require('moment');var BPromise=require(_0xdf29('0x2'));var util=require(_0xdf29('0x3'));var path=require(_0xdf29('0x4'));var ejs=require(_0xdf29('0x5'));var fs=require('fs');var _=require(_0xdf29('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xdf29('0x7'));var logger=require(_0xdf29('0x8'))(_0xdf29('0x9'));var config=require('../../config/environment');var db=require(_0xdf29('0xa'))['db'];config[_0xdf29('0xb')]=_[_0xdf29('0xc')](config['redis'],{'host':_0xdf29('0xd'),'port':0x18eb});var socket=require(_0xdf29('0xe'))(new Redis(config[_0xdf29('0xb')]));require(_0xdf29('0xf'))['register'](socket);function respondWithStatusCode(_0x5503f0,_0x3e1865){_0x3e1865=_0x3e1865||0xcc;return function(_0x14b4ec){if(_0x14b4ec){return _0x5503f0['sendStatus'](_0x3e1865);}return _0x5503f0[_0xdf29('0x10')](_0x3e1865)[_0xdf29('0x11')]();};}function respondWithResult(_0x21aa75,_0x2a055e){_0x2a055e=_0x2a055e||0xc8;return function(_0x122b7e){if(_0x122b7e){return _0x21aa75['status'](_0x2a055e)[_0xdf29('0x12')](_0x122b7e);}};}function respondWithFilteredResult(_0x4f0875,_0x756e52){return function(_0x196db8){if(_0x196db8){var _0x11bf94=typeof _0x756e52['offset']===_0xdf29('0x13')&&typeof _0x756e52[_0xdf29('0x14')]==='undefined';var _0xcf93bd=_0x196db8[_0xdf29('0x15')];var _0x14ddaa=_0x11bf94?0x0:_0x756e52['offset'];var _0x45ea43=_0x11bf94?_0x196db8['count']:_0x756e52['offset']+_0x756e52[_0xdf29('0x14')];var _0x3e2ca5;if(_0x45ea43>=_0xcf93bd){_0x45ea43=_0xcf93bd;_0x3e2ca5=0xc8;}else{_0x3e2ca5=0xce;}_0x4f0875['status'](_0x3e2ca5);return _0x4f0875['set'](_0xdf29('0x16'),_0x14ddaa+'-'+_0x45ea43+'/'+_0xcf93bd)[_0xdf29('0x12')](_0x196db8);}return null;};}function saveUpdates(_0x4debb5){return function(_0x207daa){if(_0x207daa){return _0x207daa[_0xdf29('0x17')](_0x4debb5)[_0xdf29('0x18')](function(_0x3e13db){return _0x3e13db;});}return null;};}function removeEntity(_0x2e1755){return function(_0x407f30){if(_0x407f30){return _0x407f30[_0xdf29('0x19')]()[_0xdf29('0x18')](function(){_0x2e1755[_0xdf29('0x10')](0xcc)[_0xdf29('0x11')]();});}};}function handleEntityNotFound(_0x2746fc){return function(_0x2767a7){if(!_0x2767a7){_0x2746fc[_0xdf29('0x1a')](0x194);}return _0x2767a7;};}function handleError(_0x38bf87,_0x3370dd){_0x3370dd=_0x3370dd||0x1f4;return function(_0xd09fa6){logger['error'](_0xd09fa6['stack']);if(_0xd09fa6[_0xdf29('0x1b')]){delete _0xd09fa6[_0xdf29('0x1b')];}_0x38bf87[_0xdf29('0x10')](_0x3370dd)[_0xdf29('0x1c')](_0xd09fa6);};}exports[_0xdf29('0x1d')]=function(_0x47a1af,_0x7a2fcd){var _0x20907f={};var _0x3c93e2=_[_0xdf29('0x1e')](db['WhatsappInteraction'][_0xdf29('0x1f')],function(_0x503cd4){return{'name':_0x503cd4['fieldName'],'type':_0x503cd4['type']['key']};});_0x20907f=qs['getOptions'](_0x3c93e2,_0x47a1af);return interaction[_0xdf29('0x20')]('whatsapp',_0x47a1af[_0xdf29('0x21')],_0x47a1af['user'],_0x20907f,_0x3c93e2)['then'](respondWithFilteredResult(_0x7a2fcd,_0x20907f))['catch'](handleError(_0x7a2fcd,null));};exports[_0xdf29('0x22')]=function(_0x3cdca4,_0x4fd7c9){var _0x333965={'raw':![],'where':{'id':_0x3cdca4[_0xdf29('0x23')]['id']}},_0x37ca23={};_0x37ca23['model']=_['keys'](db[_0xdf29('0x24')][_0xdf29('0x1f')]);_0x37ca23[_0xdf29('0x21')]=_[_0xdf29('0x25')](_0x3cdca4[_0xdf29('0x21')]);_0x37ca23[_0xdf29('0x26')]=_[_0xdf29('0x27')](_0x37ca23[_0xdf29('0x28')],_0x37ca23[_0xdf29('0x21')]);_0x333965[_0xdf29('0x29')]=_[_0xdf29('0x27')](_0x37ca23[_0xdf29('0x28')],qs[_0xdf29('0x2a')](_0x3cdca4[_0xdf29('0x21')][_0xdf29('0x2a')]));_0x333965['attributes']=_0x333965[_0xdf29('0x29')][_0xdf29('0x2b')]?_0x333965['attributes']:_0x37ca23[_0xdf29('0x28')];if(_0x3cdca4[_0xdf29('0x21')][_0xdf29('0x2c')]){_0x333965['include']=[{'all':!![]}];}_0x333965=_[_0xdf29('0x2d')]({},_0x333965,_0x3cdca4[_0xdf29('0x2e')]);return db[_0xdf29('0x24')][_0xdf29('0x2f')](_0x333965)['then'](handleEntityNotFound(_0x4fd7c9,null))[_0xdf29('0x18')](respondWithResult(_0x4fd7c9,null))[_0xdf29('0x30')](handleError(_0x4fd7c9,null));};exports['create']=function(_0x36eac3,_0x55d25c){return db[_0xdf29('0x24')][_0xdf29('0x31')](_0x36eac3[_0xdf29('0x32')],{})[_0xdf29('0x18')](respondWithResult(_0x55d25c,0xc9))[_0xdf29('0x30')](handleError(_0x55d25c,null));};exports[_0xdf29('0x17')]=function(_0x47126b,_0x331d66){if(_0x47126b[_0xdf29('0x32')]['id']){delete _0x47126b['body']['id'];}return db[_0xdf29('0x24')][_0xdf29('0x2f')]({'where':{'id':_0x47126b[_0xdf29('0x23')]['id']}})[_0xdf29('0x18')](handleEntityNotFound(_0x331d66,null))[_0xdf29('0x18')](saveUpdates(_0x47126b[_0xdf29('0x32')],null))[_0xdf29('0x18')](respondWithResult(_0x331d66,null))[_0xdf29('0x30')](handleError(_0x331d66,null));};exports['destroy']=function(_0x576a8f,_0xc3cba9){return db['WhatsappInteraction'][_0xdf29('0x2f')]({'where':{'id':_0x576a8f[_0xdf29('0x23')]['id']}})[_0xdf29('0x18')](handleEntityNotFound(_0xc3cba9,null))[_0xdf29('0x18')](removeEntity(_0xc3cba9,null))[_0xdf29('0x30')](handleError(_0xc3cba9,null));};exports['describe']=function(_0x10affc,_0x46fdec){return db['WhatsappInteraction'][_0xdf29('0x33')]()[_0xdf29('0x18')](respondWithResult(_0x46fdec,null))[_0xdf29('0x30')](handleError(_0x46fdec,null));};exports['addMessage']=function(_0x2dbdab,_0x319cee){return db[_0xdf29('0x34')]['find']({'where':{'id':_0x2dbdab[_0xdf29('0x23')]['id']}})['then'](handleEntityNotFound(_0x319cee,null))['then'](function(_0x98bca5){if(_0x98bca5){return _0x98bca5[_0xdf29('0x35')](_0x2dbdab[_0xdf29('0x32')][_0xdf29('0x36')],_['omit'](_0x2dbdab[_0xdf29('0x32')],[_0xdf29('0x36'),'id'])||{});}})[_0xdf29('0x18')](respondWithResult(_0x319cee,null))[_0xdf29('0x30')](handleError(_0x319cee,null));};exports[_0xdf29('0x37')]=function(_0x4ebbac,_0x2ef2fe){var _0x37374d={'raw':![],'where':{}};var _0x3d08b0={};var _0x51d602={'count':0x0,'rows':[]};return db[_0xdf29('0x24')][_0xdf29('0x38')]({'where':{'id':_0x4ebbac['params']['id']}})[_0xdf29('0x18')](handleEntityNotFound(_0x2ef2fe,null))[_0xdf29('0x18')](function(_0x158348){if(_0x158348){_0x3d08b0[_0xdf29('0x28')]=_['keys'](db[_0xdf29('0x34')]['rawAttributes']);_0x3d08b0[_0xdf29('0x21')]=_[_0xdf29('0x25')](_0x4ebbac[_0xdf29('0x21')]);_0x3d08b0[_0xdf29('0x26')]=_[_0xdf29('0x27')](_0x3d08b0[_0xdf29('0x28')],_0x3d08b0[_0xdf29('0x21')]);_0x37374d[_0xdf29('0x29')]=_[_0xdf29('0x27')](_0x3d08b0[_0xdf29('0x28')],qs[_0xdf29('0x2a')](_0x4ebbac[_0xdf29('0x21')][_0xdf29('0x2a')]));_0x37374d['attributes']=_0x37374d['attributes'][_0xdf29('0x2b')]?_0x37374d[_0xdf29('0x29')]:_0x3d08b0['model'];if(!_0x4ebbac['query'][_0xdf29('0x39')]('nolimit')){_0x37374d[_0xdf29('0x14')]=qs[_0xdf29('0x14')](_0x4ebbac[_0xdf29('0x21')]['limit']);_0x37374d[_0xdf29('0x3a')]=qs[_0xdf29('0x3a')](_0x4ebbac[_0xdf29('0x21')][_0xdf29('0x3a')]);}_0x37374d[_0xdf29('0x3b')]=qs[_0xdf29('0x3c')](_0x4ebbac['query'][_0xdf29('0x3c')]);_0x37374d[_0xdf29('0x3d')]=qs[_0xdf29('0x26')](_[_0xdf29('0x3e')](_0x4ebbac[_0xdf29('0x21')],_0x3d08b0['filters']));_0x37374d[_0xdf29('0x3d')][_0xdf29('0x3f')]=_0x158348['id'];if(_0x4ebbac['query'][_0xdf29('0x40')]){_0x37374d[_0xdf29('0x3d')]=_['merge'](_0x37374d['where'],{'$or':_['map'](_0x37374d[_0xdf29('0x29')],function(_0x283287){var _0x51442a={};_0x51442a[_0x283287]={'$like':'%'+_0x4ebbac[_0xdf29('0x21')]['filter']+'%'};return _0x51442a;})});}if(_0x4ebbac['query']['$gte']){var _0x2f5d3e=_0x4ebbac['query']['$gte'][_0xdf29('0x41')](',');var _0x38a693={};_0x38a693[_0x2f5d3e[0x0]]={'$gte':moment(_0x2f5d3e[0x1])[_0xdf29('0x42')](_0xdf29('0x43'))};_0x37374d[_0xdf29('0x3d')]=_[_0xdf29('0x2d')](_0x37374d[_0xdf29('0x3d')],_0x38a693);}_0x37374d=_[_0xdf29('0x2d')]({},_0x37374d,_0x4ebbac[_0xdf29('0x2e')]);return db['WhatsappMessage']['count']({'where':_0x37374d[_0xdf29('0x3d')]})[_0xdf29('0x18')](function(_0x1cb24d){_0x51d602[_0xdf29('0x15')]=_0x1cb24d;if(_0x4ebbac[_0xdf29('0x21')][_0xdf29('0x2c')]){_0x37374d['include']=[{'all':!![]}];}return db[_0xdf29('0x34')][_0xdf29('0x20')](_0x37374d);})[_0xdf29('0x18')](function(_0x208ec2){_0x51d602[_0xdf29('0x44')]=_0x208ec2;return _0x51d602;});}})[_0xdf29('0x18')](respondWithFilteredResult(_0x2ef2fe,_0x37374d))[_0xdf29('0x30')](handleError(_0x2ef2fe,null));};exports[_0xdf29('0x45')]=function(_0x22c869,_0x171246){return db[_0xdf29('0x24')][_0xdf29('0x2f')]({'where':{'id':_0x22c869[_0xdf29('0x23')]['id']}})[_0xdf29('0x18')](handleEntityNotFound(_0x171246,null))[_0xdf29('0x18')](function(_0x40d420){if(_0x40d420){return _0x40d420[_0xdf29('0x46')](_0x22c869[_0xdf29('0x32')][_0xdf29('0x36')],_[_0xdf29('0x47')](_0x22c869['body'],['ids','id'])||{})[_0xdf29('0x48')](function(){return db[_0xdf29('0x49')][_0xdf29('0x20')]({'attributes':['id',_0xdf29('0x1b'),'color'],'where':{'id':_0x22c869[_0xdf29('0x32')][_0xdf29('0x36')]}});})[_0xdf29('0x18')](function(_0x1662bf){socket[_0xdf29('0x4a')](_0xdf29('0x4b'),{'id':Number(_0x22c869[_0xdf29('0x23')]['id']),'tags':_0x1662bf||[]});return{'id':Number(_0x22c869[_0xdf29('0x23')]['id']),'tags':_0x1662bf||[]};});}})[_0xdf29('0x18')](respondWithResult(_0x171246,null))[_0xdf29('0x30')](handleError(_0x171246,null));};exports[_0xdf29('0x4c')]=function(_0x583bc4,_0x5f205b){return db['WhatsappInteraction'][_0xdf29('0x2f')]({'where':{'id':_0x583bc4[_0xdf29('0x23')]['id']}})[_0xdf29('0x18')](handleEntityNotFound(_0x5f205b,null))[_0xdf29('0x18')](function(_0x5b155e){if(_0x5b155e){return _0x5b155e[_0xdf29('0x4c')](_0x583bc4['query']['ids']);}})['then'](respondWithStatusCode(_0x5f205b,null))['catch'](handleError(_0x5f205b,null));};exports[_0xdf29('0x4d')]=function(_0x1e2e80,_0x308727){var _0x2cc089=moment()[_0xdf29('0x4e')]()[_0xdf29('0x4f')]();var _0x223bcc=path[_0xdf29('0x50')](config[_0xdf29('0x51')],_0xdf29('0x52'),'files',_0xdf29('0x53'));var _0x401181=path[_0xdf29('0x50')](config[_0xdf29('0x51')],_0xdf29('0x52'),_0xdf29('0x54'),_0xdf29('0x55'));var _0xe636a1=path[_0xdf29('0x50')](_0x223bcc,_0x2cc089);var _0x4d9a41=util['format'](_0xdf29('0x56'),_0x1e2e80[_0xdf29('0x23')]['id'],_0x2cc089);var _0x2412d8=path['join'](_0x223bcc,_0x4d9a41);var _0x5ddf02=[];_0x5ddf02[_0xdf29('0x57')]({'model':db['User'],'as':'User','attributes':['id',_0xdf29('0x58')],'raw':!![]});_0x5ddf02['push']({'model':db['CmContact'],'as':_0xdf29('0x59'),'attributes':['id',_0xdf29('0x5a'),_0xdf29('0x5b')],'raw':!![]});if(_0x1e2e80[_0xdf29('0x21')][_0xdf29('0x55')]){_0x5ddf02[_0xdf29('0x57')]({'model':db[_0xdf29('0x5c')],'as':_0xdf29('0x5c'),'raw':!![]});}var _0x50d794=[{'model':db[_0xdf29('0x34')],'as':_0xdf29('0x5d'),'attributes':['id',_0xdf29('0x32'),_0xdf29('0x5e'),_0xdf29('0x5f'),_0xdf29('0x60'),_0xdf29('0x61')],'include':_0x5ddf02}];_0x50d794[_0xdf29('0x57')]({'model':db[_0xdf29('0x62')],'as':'Account','attributes':['id','name']});_0x50d794[_0xdf29('0x57')]({'model':db[_0xdf29('0x63')],'as':_0xdf29('0x64'),'attributes':['id',_0xdf29('0x58')]});return db[_0xdf29('0x24')]['find']({'where':{'id':_0x1e2e80[_0xdf29('0x23')]['id']},'include':_0x50d794})[_0xdf29('0x18')](handleEntityNotFound(_0x308727,null))['then'](function(_0x127462){if(_0x127462){var _0x255c44=_0x127462[_0xdf29('0x65')]({'plain':!![]});fs['mkdirSync'](_0xe636a1);var _0x292710={'channel':_0xdf29('0x66'),'account':_0x255c44[_0xdf29('0x67')][_0xdf29('0x1b')],'agent':_0x255c44[_0xdf29('0x64')]?_0x255c44[_0xdf29('0x64')]['fullname']:'N.A.','createdAt':moment(_0x255c44[_0xdf29('0x5e')])['format'](_0xdf29('0x43'))[_0xdf29('0x4f')](),'closedAt':_0x255c44[_0xdf29('0x68')]?moment(_0x255c44['closedAt'])[_0xdf29('0x42')](_0xdf29('0x43'))['toString']():'','disposition':_0x255c44[_0xdf29('0x69')],'messages':_(_0x255c44['Messages'])[_0xdf29('0x40')]({'secret':![]})['map'](function(_0x352b44){if(_0x352b44['Attachment']){var _0x38bb5f=path[_0xdf29('0x50')](_0x401181,_0x352b44[_0xdf29('0x5c')][_0xdf29('0x6a')]);if(fs['existsSync'](_0x38bb5f)){fs['createReadStream'](_0x38bb5f)[_0xdf29('0x6b')](fs[_0xdf29('0x6c')](path['join'](_0xe636a1,_0x352b44[_0xdf29('0x5c')][_0xdf29('0x6a')])));}}return{'date':moment(_0x352b44[_0xdf29('0x5e')])[_0xdf29('0x42')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdf29('0x4f')](),'sender':_0x352b44[_0xdf29('0x5f')]===_0xdf29('0x6d')?_0x352b44['User']?_0x352b44[_0xdf29('0x63')][_0xdf29('0x58')]:_0xdf29('0x6e'):_0x352b44['Contact'][_0xdf29('0x5a')]+(_0x352b44['Contact'][_0xdf29('0x5b')]?'\x20'+_0x352b44[_0xdf29('0x59')][_0xdf29('0x5b')]:''),'body':_0x352b44['Attachment']?_0x352b44['Attachment'][_0xdf29('0x6a')]:_0x352b44[_0xdf29('0x32')],'direction':_0x352b44['direction']==='out'?'A':'C','secret':_0x352b44[_0xdf29('0x60')],'read':_0x352b44[_0xdf29('0x61')],'attachment':_0x352b44['Attachment']};})[_0xdf29('0x6f')]()};return ejs[_0xdf29('0x70')](path['join'](config[_0xdf29('0x51')],'server',_0xdf29('0x71'),_0xdf29('0x72')),{'interaction':_0x292710})[_0xdf29('0x18')](function(_0x17edf8){var _0x320785=path[_0xdf29('0x50')](_0xe636a1,'transcript-'+_0x255c44['id']+'-'+_0x2cc089+'.pdf');var _0x314e6d={'path':_0x320785,'channel':_0xdf29('0x66'),'interactionId':_0x255c44['id']};return pdf[_0xdf29('0x73')](_0x17edf8,_0x314e6d);})['then'](function(){return new BPromise(function(_0x58c1ce,_0x238ebe){zipdir(_0xe636a1,{'saveTo':_0x2412d8},function(_0x23778a,_0x899426){if(_0x23778a)return _0x238ebe(_0x23778a);return _0x58c1ce(_0x899426);});})[_0xdf29('0x18')](function(){return new BPromise(function(_0x3604a4,_0xcb59d9){rimraf(_0xe636a1,function(_0xfc4c86){if(_0xfc4c86)_0xcb59d9(_0xfc4c86);return _0x3604a4();});});})['then'](function(){return _0x308727['download'](_0x2412d8,_0x4d9a41,function(_0x5b938a){if(_0x5b938a){console[_0xdf29('0x74')](_0xdf29('0x75'),_0x5b938a);}else{fs[_0xdf29('0x76')](_0x2412d8);}});});});}else{return _0x308727['sendStatus'](0xc8);}})[_0xdf29('0x30')](handleError(_0x308727,null));}; \ No newline at end of file +var _0x4dc7=['Tag','color','whatsappInteractionTags:save','removeTags','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','Contact','lastName','push','Attachment','createdAt','direction','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','N.A.','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./whatsappInteraction.socket','register','sendStatus','status','end','limit','count','offset','set','Content-Range','json','update','then','destroy','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','type','key','findAll','whatsapp','query','show','model','keys','filters','intersection','attributes','fields','length','options','find','catch','create','body','describe','addMessage','WhatsappMessage','omit','ids','findOne','params','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','includeAll','include','rows','setTags','spread'];(function(_0x1690f9,_0x3930ea){var _0x40a4ac=function(_0x19423f){while(--_0x19423f){_0x1690f9['push'](_0x1690f9['shift']());}};_0x40a4ac(++_0x3930ea);}(_0x4dc7,0x131));var _0x74dc=function(_0x57d1e8,_0x2603f2){_0x57d1e8=_0x57d1e8-0x0;var _0x4270fd=_0x4dc7[_0x57d1e8];return _0x4270fd;};'use strict';var rimraf=require(_0x74dc('0x0'));var zipdir=require(_0x74dc('0x1'));var moment=require(_0x74dc('0x2'));var BPromise=require(_0x74dc('0x3'));var util=require(_0x74dc('0x4'));var path=require('path');var ejs=require(_0x74dc('0x5'));var fs=require('fs');var _=require(_0x74dc('0x6'));var Redis=require(_0x74dc('0x7'));var interaction=require(_0x74dc('0x8'));var qs=require(_0x74dc('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x74dc('0xa'))['db'];config['redis']=_[_0x74dc('0xb')](config['redis'],{'host':_0x74dc('0xc'),'port':0x18eb});var socket=require(_0x74dc('0xd'))(new Redis(config[_0x74dc('0xe')]));require(_0x74dc('0xf'))[_0x74dc('0x10')](socket);function respondWithStatusCode(_0x2fdc10,_0x3bc658){_0x3bc658=_0x3bc658||0xcc;return function(_0x47671a){if(_0x47671a){return _0x2fdc10[_0x74dc('0x11')](_0x3bc658);}return _0x2fdc10[_0x74dc('0x12')](_0x3bc658)[_0x74dc('0x13')]();};}function respondWithResult(_0x5c7c0b,_0xdd6a1a){_0xdd6a1a=_0xdd6a1a||0xc8;return function(_0x4c886d){if(_0x4c886d){return _0x5c7c0b['status'](_0xdd6a1a)['json'](_0x4c886d);}};}function respondWithFilteredResult(_0x9cd796,_0xdee3c6){return function(_0x491d76){if(_0x491d76){var _0xd46f9a=typeof _0xdee3c6['offset']==='undefined'&&typeof _0xdee3c6[_0x74dc('0x14')]==='undefined';var _0x5eca56=_0x491d76[_0x74dc('0x15')];var _0x5ac0a1=_0xd46f9a?0x0:_0xdee3c6[_0x74dc('0x16')];var _0x1c3f67=_0xd46f9a?_0x491d76[_0x74dc('0x15')]:_0xdee3c6['offset']+_0xdee3c6[_0x74dc('0x14')];var _0x20539c;if(_0x1c3f67>=_0x5eca56){_0x1c3f67=_0x5eca56;_0x20539c=0xc8;}else{_0x20539c=0xce;}_0x9cd796[_0x74dc('0x12')](_0x20539c);return _0x9cd796[_0x74dc('0x17')](_0x74dc('0x18'),_0x5ac0a1+'-'+_0x1c3f67+'/'+_0x5eca56)[_0x74dc('0x19')](_0x491d76);}return null;};}function saveUpdates(_0x16f2f8){return function(_0x4ba9d6){if(_0x4ba9d6){return _0x4ba9d6[_0x74dc('0x1a')](_0x16f2f8)[_0x74dc('0x1b')](function(_0x399e9b){return _0x399e9b;});}return null;};}function removeEntity(_0x3bb162){return function(_0xebfe6e){if(_0xebfe6e){return _0xebfe6e[_0x74dc('0x1c')]()[_0x74dc('0x1b')](function(){_0x3bb162[_0x74dc('0x12')](0xcc)[_0x74dc('0x13')]();});}};}function handleEntityNotFound(_0x4c4b2d){return function(_0x53d6ac){if(!_0x53d6ac){_0x4c4b2d['sendStatus'](0x194);}return _0x53d6ac;};}function handleError(_0x28db87,_0x354b24){_0x354b24=_0x354b24||0x1f4;return function(_0x351beb){logger['error'](_0x351beb[_0x74dc('0x1d')]);if(_0x351beb['name']){delete _0x351beb[_0x74dc('0x1e')];}_0x28db87[_0x74dc('0x12')](_0x354b24)[_0x74dc('0x1f')](_0x351beb);};}exports[_0x74dc('0x20')]=function(_0x34b456,_0x4fafb0){var _0x42d855={};var _0x25e166=_[_0x74dc('0x21')](db[_0x74dc('0x22')][_0x74dc('0x23')],function(_0x36faed){return{'name':_0x36faed[_0x74dc('0x24')],'type':_0x36faed[_0x74dc('0x25')][_0x74dc('0x26')]};});_0x42d855=qs['getOptions'](_0x25e166,_0x34b456);return interaction[_0x74dc('0x27')](_0x74dc('0x28'),_0x34b456[_0x74dc('0x29')],_0x34b456['user'],_0x42d855,_0x25e166)[_0x74dc('0x1b')](respondWithFilteredResult(_0x4fafb0,_0x42d855))['catch'](handleError(_0x4fafb0,null));};exports[_0x74dc('0x2a')]=function(_0x52299c,_0x3bfee5){var _0x1f7a9a={'raw':![],'where':{'id':_0x52299c['params']['id']}},_0x36fe37={};_0x36fe37[_0x74dc('0x2b')]=_[_0x74dc('0x2c')](db[_0x74dc('0x22')][_0x74dc('0x23')]);_0x36fe37[_0x74dc('0x29')]=_[_0x74dc('0x2c')](_0x52299c[_0x74dc('0x29')]);_0x36fe37[_0x74dc('0x2d')]=_[_0x74dc('0x2e')](_0x36fe37[_0x74dc('0x2b')],_0x36fe37['query']);_0x1f7a9a[_0x74dc('0x2f')]=_[_0x74dc('0x2e')](_0x36fe37[_0x74dc('0x2b')],qs[_0x74dc('0x30')](_0x52299c[_0x74dc('0x29')][_0x74dc('0x30')]));_0x1f7a9a['attributes']=_0x1f7a9a[_0x74dc('0x2f')][_0x74dc('0x31')]?_0x1f7a9a[_0x74dc('0x2f')]:_0x36fe37[_0x74dc('0x2b')];if(_0x52299c[_0x74dc('0x29')]['includeAll']){_0x1f7a9a['include']=[{'all':!![]}];}_0x1f7a9a=_['merge']({},_0x1f7a9a,_0x52299c[_0x74dc('0x32')]);return db[_0x74dc('0x22')][_0x74dc('0x33')](_0x1f7a9a)['then'](handleEntityNotFound(_0x3bfee5,null))['then'](respondWithResult(_0x3bfee5,null))[_0x74dc('0x34')](handleError(_0x3bfee5,null));};exports['create']=function(_0x3cb7ef,_0x3d1f66){return db['WhatsappInteraction'][_0x74dc('0x35')](_0x3cb7ef[_0x74dc('0x36')],{})['then'](respondWithResult(_0x3d1f66,0xc9))[_0x74dc('0x34')](handleError(_0x3d1f66,null));};exports[_0x74dc('0x1a')]=function(_0x3fb8be,_0x5b7e3a){if(_0x3fb8be[_0x74dc('0x36')]['id']){delete _0x3fb8be[_0x74dc('0x36')]['id'];}return db[_0x74dc('0x22')]['find']({'where':{'id':_0x3fb8be['params']['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0x5b7e3a,null))[_0x74dc('0x1b')](saveUpdates(_0x3fb8be[_0x74dc('0x36')],null))['then'](respondWithResult(_0x5b7e3a,null))[_0x74dc('0x34')](handleError(_0x5b7e3a,null));};exports[_0x74dc('0x1c')]=function(_0x567a8c,_0xcc952c){return db[_0x74dc('0x22')]['find']({'where':{'id':_0x567a8c['params']['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0xcc952c,null))[_0x74dc('0x1b')](removeEntity(_0xcc952c,null))[_0x74dc('0x34')](handleError(_0xcc952c,null));};exports[_0x74dc('0x37')]=function(_0x51ef07,_0x30bdb6){return db['WhatsappInteraction']['describe']()['then'](respondWithResult(_0x30bdb6,null))[_0x74dc('0x34')](handleError(_0x30bdb6,null));};exports[_0x74dc('0x38')]=function(_0x4704c2,_0x2728e5){return db[_0x74dc('0x39')]['find']({'where':{'id':_0x4704c2['params']['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0x2728e5,null))[_0x74dc('0x1b')](function(_0xb9e549){if(_0xb9e549){return _0xb9e549[_0x74dc('0x38')](_0x4704c2[_0x74dc('0x36')]['ids'],_[_0x74dc('0x3a')](_0x4704c2[_0x74dc('0x36')],[_0x74dc('0x3b'),'id'])||{});}})[_0x74dc('0x1b')](respondWithResult(_0x2728e5,null))[_0x74dc('0x34')](handleError(_0x2728e5,null));};exports['getMessages']=function(_0x1ea191,_0x1f07ba){var _0x14cb08={'raw':![],'where':{}};var _0x40090e={};var _0x576d4d={'count':0x0,'rows':[]};return db[_0x74dc('0x22')][_0x74dc('0x3c')]({'where':{'id':_0x1ea191[_0x74dc('0x3d')]['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0x1f07ba,null))[_0x74dc('0x1b')](function(_0x468f6b){if(_0x468f6b){_0x40090e[_0x74dc('0x2b')]=_['keys'](db[_0x74dc('0x39')]['rawAttributes']);_0x40090e['query']=_['keys'](_0x1ea191[_0x74dc('0x29')]);_0x40090e[_0x74dc('0x2d')]=_[_0x74dc('0x2e')](_0x40090e[_0x74dc('0x2b')],_0x40090e[_0x74dc('0x29')]);_0x14cb08['attributes']=_[_0x74dc('0x2e')](_0x40090e['model'],qs[_0x74dc('0x30')](_0x1ea191[_0x74dc('0x29')][_0x74dc('0x30')]));_0x14cb08['attributes']=_0x14cb08[_0x74dc('0x2f')][_0x74dc('0x31')]?_0x14cb08['attributes']:_0x40090e['model'];if(!_0x1ea191[_0x74dc('0x29')]['hasOwnProperty'](_0x74dc('0x3e'))){_0x14cb08[_0x74dc('0x14')]=qs[_0x74dc('0x14')](_0x1ea191['query'][_0x74dc('0x14')]);_0x14cb08[_0x74dc('0x16')]=qs['offset'](_0x1ea191[_0x74dc('0x29')]['offset']);}_0x14cb08[_0x74dc('0x3f')]=qs[_0x74dc('0x40')](_0x1ea191[_0x74dc('0x29')]['sort']);_0x14cb08[_0x74dc('0x41')]=qs[_0x74dc('0x2d')](_[_0x74dc('0x42')](_0x1ea191['query'],_0x40090e[_0x74dc('0x2d')]));_0x14cb08['where'][_0x74dc('0x43')]=_0x468f6b['id'];if(_0x1ea191[_0x74dc('0x29')][_0x74dc('0x44')]){_0x14cb08[_0x74dc('0x41')]=_['merge'](_0x14cb08[_0x74dc('0x41')],{'$or':_[_0x74dc('0x21')](_0x14cb08[_0x74dc('0x2f')],function(_0xae82fc){var _0x261182={};_0x261182[_0xae82fc]={'$like':'%'+_0x1ea191[_0x74dc('0x29')][_0x74dc('0x44')]+'%'};return _0x261182;})});}if(_0x1ea191['query'][_0x74dc('0x45')]){var _0x1c55f7=_0x1ea191[_0x74dc('0x29')][_0x74dc('0x45')][_0x74dc('0x46')](',');var _0x2372be={};_0x2372be[_0x1c55f7[0x0]]={'$gte':moment(_0x1c55f7[0x1])[_0x74dc('0x47')](_0x74dc('0x48'))};_0x14cb08[_0x74dc('0x41')]=_[_0x74dc('0x49')](_0x14cb08[_0x74dc('0x41')],_0x2372be);}_0x14cb08=_[_0x74dc('0x49')]({},_0x14cb08,_0x1ea191[_0x74dc('0x32')]);return db[_0x74dc('0x39')]['count']({'where':_0x14cb08[_0x74dc('0x41')]})[_0x74dc('0x1b')](function(_0x159054){_0x576d4d[_0x74dc('0x15')]=_0x159054;if(_0x1ea191['query'][_0x74dc('0x4a')]){_0x14cb08[_0x74dc('0x4b')]=[{'all':!![]}];}return db[_0x74dc('0x39')][_0x74dc('0x27')](_0x14cb08);})[_0x74dc('0x1b')](function(_0x32e6cc){_0x576d4d[_0x74dc('0x4c')]=_0x32e6cc;return _0x576d4d;});}})[_0x74dc('0x1b')](respondWithFilteredResult(_0x1f07ba,_0x14cb08))['catch'](handleError(_0x1f07ba,null));};exports['addTags']=function(_0x21b7e8,_0x342545){return db['WhatsappInteraction'][_0x74dc('0x33')]({'where':{'id':_0x21b7e8['params']['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0x342545,null))[_0x74dc('0x1b')](function(_0x5d959b){if(_0x5d959b){return _0x5d959b[_0x74dc('0x4d')](_0x21b7e8[_0x74dc('0x36')][_0x74dc('0x3b')],_[_0x74dc('0x3a')](_0x21b7e8['body'],['ids','id'])||{})[_0x74dc('0x4e')](function(){return db[_0x74dc('0x4f')][_0x74dc('0x27')]({'attributes':['id',_0x74dc('0x1e'),_0x74dc('0x50')],'where':{'id':_0x21b7e8[_0x74dc('0x36')][_0x74dc('0x3b')]}});})[_0x74dc('0x1b')](function(_0x108523){socket['emit'](_0x74dc('0x51'),{'id':Number(_0x21b7e8[_0x74dc('0x3d')]['id']),'tags':_0x108523||[]});return{'id':Number(_0x21b7e8[_0x74dc('0x3d')]['id']),'tags':_0x108523||[]};});}})['then'](respondWithResult(_0x342545,null))[_0x74dc('0x34')](handleError(_0x342545,null));};exports[_0x74dc('0x52')]=function(_0x1c5d8c,_0x1a5d4b){return db[_0x74dc('0x22')]['find']({'where':{'id':_0x1c5d8c[_0x74dc('0x3d')]['id']}})[_0x74dc('0x1b')](handleEntityNotFound(_0x1a5d4b,null))[_0x74dc('0x1b')](function(_0x553d6f){if(_0x553d6f){return _0x553d6f['removeTags'](_0x1c5d8c[_0x74dc('0x29')][_0x74dc('0x3b')]);}})[_0x74dc('0x1b')](respondWithStatusCode(_0x1a5d4b,null))[_0x74dc('0x34')](handleError(_0x1a5d4b,null));};exports['download']=function(_0x4b5096,_0x1e1afe){var _0x1146e3=moment()[_0x74dc('0x53')]()[_0x74dc('0x54')]();var _0x4bb3aa=path[_0x74dc('0x55')](config[_0x74dc('0x56')],_0x74dc('0x57'),_0x74dc('0x58'),'tmp');var _0x29ea17=path['join'](config[_0x74dc('0x56')],_0x74dc('0x57'),_0x74dc('0x58'),_0x74dc('0x59'));var _0x212117=path['join'](_0x4bb3aa,_0x1146e3);var _0x5b0f48=util[_0x74dc('0x47')](_0x74dc('0x5a'),_0x4b5096[_0x74dc('0x3d')]['id'],_0x1146e3);var _0x298161=path[_0x74dc('0x55')](_0x4bb3aa,_0x5b0f48);var _0x257d40=[];_0x257d40['push']({'model':db[_0x74dc('0x5b')],'as':'User','attributes':['id',_0x74dc('0x5c')],'raw':!![]});_0x257d40['push']({'model':db['CmContact'],'as':_0x74dc('0x5d'),'attributes':['id','firstName',_0x74dc('0x5e')],'raw':!![]});if(_0x4b5096[_0x74dc('0x29')]['attachments']){_0x257d40[_0x74dc('0x5f')]({'model':db[_0x74dc('0x60')],'as':_0x74dc('0x60'),'raw':!![]});}var _0x1860b9=[{'model':db[_0x74dc('0x39')],'as':'Messages','attributes':['id',_0x74dc('0x36'),_0x74dc('0x61'),_0x74dc('0x62'),_0x74dc('0x63'),_0x74dc('0x64')],'include':_0x257d40}];_0x1860b9[_0x74dc('0x5f')]({'model':db[_0x74dc('0x65')],'as':'Account','attributes':['id',_0x74dc('0x1e')]});_0x1860b9[_0x74dc('0x5f')]({'model':db[_0x74dc('0x5b')],'as':_0x74dc('0x66'),'attributes':['id','fullname']});return db[_0x74dc('0x22')][_0x74dc('0x33')]({'where':{'id':_0x4b5096[_0x74dc('0x3d')]['id']},'include':_0x1860b9})['then'](handleEntityNotFound(_0x1e1afe,null))[_0x74dc('0x1b')](function(_0x50c0be){if(_0x50c0be){var _0x20f578=_0x50c0be[_0x74dc('0x67')]({'plain':!![]});fs[_0x74dc('0x68')](_0x212117);var _0x5ac2e2={'channel':_0x74dc('0x69'),'account':_0x20f578[_0x74dc('0x6a')]['name'],'agent':_0x20f578[_0x74dc('0x66')]?_0x20f578[_0x74dc('0x66')][_0x74dc('0x5c')]:_0x74dc('0x6b'),'createdAt':moment(_0x20f578['createdAt'])[_0x74dc('0x47')](_0x74dc('0x48'))[_0x74dc('0x54')](),'closedAt':_0x20f578[_0x74dc('0x6c')]?moment(_0x20f578[_0x74dc('0x6d')])[_0x74dc('0x47')](_0x74dc('0x48'))[_0x74dc('0x54')]():'','disposition':_0x20f578[_0x74dc('0x6e')],'messages':_(_0x20f578['Messages'])[_0x74dc('0x44')]({'secret':![]})[_0x74dc('0x21')](function(_0x241a84){if(_0x241a84[_0x74dc('0x60')]){var _0x486355=path['join'](_0x29ea17,_0x241a84[_0x74dc('0x60')][_0x74dc('0x6f')]);if(fs[_0x74dc('0x70')](_0x486355)){fs[_0x74dc('0x71')](_0x486355)[_0x74dc('0x72')](fs[_0x74dc('0x73')](path[_0x74dc('0x55')](_0x212117,_0x241a84[_0x74dc('0x60')]['basename'])));}}return{'date':moment(_0x241a84['createdAt'])[_0x74dc('0x47')](_0x74dc('0x48'))[_0x74dc('0x54')](),'sender':_0x241a84[_0x74dc('0x62')]===_0x74dc('0x74')?_0x241a84[_0x74dc('0x5b')]?_0x241a84[_0x74dc('0x5b')]['fullname']:_0x74dc('0x75'):_0x241a84[_0x74dc('0x5d')]['firstName']+(_0x241a84[_0x74dc('0x5d')]['lastName']?'\x20'+_0x241a84['Contact']['lastName']:''),'body':_0x241a84[_0x74dc('0x60')]?_0x241a84[_0x74dc('0x60')][_0x74dc('0x6f')]:_0x241a84[_0x74dc('0x36')],'direction':_0x241a84['direction']==='out'?'A':'C','secret':_0x241a84[_0x74dc('0x63')],'read':_0x241a84[_0x74dc('0x64')],'attachment':_0x241a84[_0x74dc('0x60')]};})[_0x74dc('0x76')]()};return ejs[_0x74dc('0x77')](path[_0x74dc('0x55')](config[_0x74dc('0x56')],'server',_0x74dc('0x78'),_0x74dc('0x79')),{'interaction':_0x5ac2e2})['then'](function(_0x502843){var _0x6f2dab=path[_0x74dc('0x55')](_0x212117,_0x74dc('0x7a')+_0x20f578['id']+'-'+_0x1146e3+_0x74dc('0x7b'));var _0xff410b={'path':_0x6f2dab,'channel':_0x74dc('0x69'),'interactionId':_0x20f578['id']};return pdf[_0x74dc('0x7c')](_0x502843,_0xff410b);})['then'](function(){return new BPromise(function(_0xd66fa7,_0x366fbb){zipdir(_0x212117,{'saveTo':_0x298161},function(_0x19341b,_0x5ee2a1){if(_0x19341b)return _0x366fbb(_0x19341b);return _0xd66fa7(_0x5ee2a1);});})[_0x74dc('0x1b')](function(){return new BPromise(function(_0x1432d2,_0x327e15){rimraf(_0x212117,function(_0x427711){if(_0x427711)_0x327e15(_0x427711);return _0x1432d2();});});})[_0x74dc('0x1b')](function(){return _0x1e1afe['download'](_0x298161,_0x5b0f48,function(_0x5cd324){if(_0x5cd324){console[_0x74dc('0x7d')](_0x74dc('0x7e'),_0x5cd324);}else{fs[_0x74dc('0x7f')](_0x298161);}});});});}else{return _0x1e1afe[_0x74dc('0x11')](0xc8);}})[_0x74dc('0x34')](handleError(_0x1e1afe,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 52c861a..ff603b7 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 _0x5a8c=['getUsers','then','setDataValue','Users','map','findAll','length','emit','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove'];(function(_0x5d9361,_0x5282e7){var _0x4bbb60=function(_0x4690df){while(--_0x4690df){_0x5d9361['push'](_0x5d9361['shift']());}};_0x4bbb60(++_0x5282e7);}(_0x5a8c,0x1da));var _0xc5a8=function(_0x2e0a7e,_0x23299f){_0x2e0a7e=_0x2e0a7e-0x0;var _0x217f0f=_0x5a8c[_0x2e0a7e];return _0x217f0f;};'use strict';var EventEmitter=require(_0xc5a8('0x0'));var WhatsappInteraction=require(_0xc5a8('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xc5a8('0x1'))['db'][_0xc5a8('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc5a8('0x3')](0x0);var events={'afterCreate':_0xc5a8('0x4'),'afterUpdate':'update','afterDestroy':_0xc5a8('0x5')};function emitEvent(_0x4310e4){return function(_0x5855dc,_0x16474d,_0x3c8f1e){_0x5855dc[_0xc5a8('0x6')]({'attributes':['id'],'raw':!![]})[_0xc5a8('0x7')](function(_0x1be8e7){_0x5855dc[_0xc5a8('0x8')](_0xc5a8('0x9'),_0x1be8e7[_0xc5a8('0xa')](function(_0x36e265){return{'id':_0x36e265['id']};}));return WhatsappMessage[_0xc5a8('0xb')]({'where':{'WhatsappInteractionId':_0x5855dc['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5a8('0x7')](function(_0x4e0029){_0x5855dc[_0xc5a8('0x8')]('unreadMessages',_0x4e0029[_0xc5a8('0xc')]);WhatsappInteractionEvents[_0xc5a8('0xd')](_0x4310e4+':'+_0x5855dc['id'],_0x5855dc);WhatsappInteractionEvents[_0xc5a8('0xd')](_0x4310e4,_0x5855dc);_0x3c8f1e(null);})['catch'](_0x3c8f1e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc5a8('0xe')](e,emitEvent(event));}}module[_0xc5a8('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x3451=['remove','getUsers','then','setDataValue','Users','unreadMessages','length','catch','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x19c397,_0x5a868e){var _0x2bd0ff=function(_0xd49780){while(--_0xd49780){_0x19c397['push'](_0x19c397['shift']());}};_0x2bd0ff(++_0x5a868e);}(_0x3451,0x19a));var _0x1345=function(_0x5e5979,_0x9642af){_0x5e5979=_0x5e5979-0x0;var _0x416570=_0x3451[_0x5e5979];return _0x416570;};'use strict';var EventEmitter=require(_0x1345('0x0'));var WhatsappInteraction=require(_0x1345('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x1345('0x1'))['db'][_0x1345('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x1345('0x3')](0x0);var events={'afterCreate':_0x1345('0x4'),'afterUpdate':_0x1345('0x5'),'afterDestroy':_0x1345('0x6')};function emitEvent(_0x2ec0e8){return function(_0x476ef9,_0x39a5f1,_0x30f76b){_0x476ef9[_0x1345('0x7')]({'attributes':['id'],'raw':!![]})[_0x1345('0x8')](function(_0x4b90dd){_0x476ef9[_0x1345('0x9')](_0x1345('0xa'),_0x4b90dd['map'](function(_0x3bc9c4){return{'id':_0x3bc9c4['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x476ef9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3e04bc){_0x476ef9['setDataValue'](_0x1345('0xb'),_0x3e04bc[_0x1345('0xc')]);WhatsappInteractionEvents['emit'](_0x2ec0e8+':'+_0x476ef9['id'],_0x476ef9);WhatsappInteractionEvents['emit'](_0x2ec0e8,_0x476ef9);_0x30f76b(null);})[_0x1345('0xd')](_0x30f76b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x1345('0xe')](e,emitEvent(event));}}module[_0x1345('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 627659d..59439a5 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 _0x6fae=['../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','util','moment','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6fae,0x15b));var _0xe6fa=function(_0xaecd6c,_0x1215ea){_0xaecd6c=_0xaecd6c-0x0;var _0x3c8992=_0x6fae[_0xaecd6c];return _0x3c8992;};'use strict';var _=require('lodash');var util=require(_0xe6fa('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe6fa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6fa('0x2'));var rimraf=require(_0xe6fa('0x3'));var config=require(_0xe6fa('0x4'));var attributes=require('./whatsappInteraction.attributes');module[_0xe6fa('0x5')]=function(_0x1044be,_0x48cb47){return _0x1044be[_0xe6fa('0x6')](_0xe6fa('0x7'),attributes,{'tableName':_0xe6fa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x32cfa7,_0x34a4cc,_0xc9793e){if(_0x32cfa7[_0xe6fa('0x9')](_0xe6fa('0xa'))){_0x32cfa7[_0xe6fa('0xb')]=moment()[_0xe6fa('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc9793e(null,_0x32cfa7);}}});}; \ No newline at end of file +var _0x1666=['bluebird','rimraf','../../config/environment','exports','WhatsappInteraction','changed','closed','closedAt','format','lodash','../../config/logger','api','moment'];(function(_0x1bfd18,_0x3a2dc1){var _0x5efa35=function(_0x58381e){while(--_0x58381e){_0x1bfd18['push'](_0x1bfd18['shift']());}};_0x5efa35(++_0x3a2dc1);}(_0x1666,0xbf));var _0x6166=function(_0x5e5102,_0x3ae409){_0x5e5102=_0x5e5102-0x0;var _0x573a1a=_0x1666[_0x5e5102];return _0x573a1a;};'use strict';var _=require(_0x6166('0x0'));var util=require('util');var logger=require(_0x6166('0x1'))(_0x6166('0x2'));var moment=require(_0x6166('0x3'));var BPromise=require(_0x6166('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6166('0x5'));var config=require(_0x6166('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0x6166('0x7')]=function(_0x1deed8,_0x5a530c){return _0x1deed8['define'](_0x6166('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xbf4bdf,_0x730db0,_0x374c21){if(_0xbf4bdf[_0x6166('0x9')](_0x6166('0xa'))){_0xbf4bdf[_0x6166('0xb')]=moment()[_0x6166('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x374c21(null,_0xbf4bdf);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 31d5ebe..5da815d 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 _0x9b2f=['../../config/logger','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','info','AddTagsToWhatsappInteraction','find','addTags','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x168495,_0x222f15){var _0x131fd4=function(_0x43f8c0){while(--_0x43f8c0){_0x168495['push'](_0x168495['shift']());}};_0x131fd4(++_0x222f15);}(_0x9b2f,0x78));var _0xf9b2=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0x9b2f[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0xf9b2('0x0'));var util=require(_0xf9b2('0x1'));var moment=require('moment');var BPromise=require(_0xf9b2('0x2'));var rs=require(_0xf9b2('0x3'));var fs=require('fs');var Redis=require(_0xf9b2('0x4'));var db=require(_0xf9b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf9b2('0x6'))(_0xf9b2('0x7'));var config=require('../../config/environment');var jayson=require(_0xf9b2('0x8'));var client=jayson[_0xf9b2('0x9')]['http']({'port':0x232a});config['redis']=_[_0xf9b2('0xa')](config['redis'],{'host':_0xf9b2('0xb'),'port':0x18eb});var socket=require(_0xf9b2('0xc'))(new Redis(config['redis']));require(_0xf9b2('0xd'))[_0xf9b2('0xe')](socket);function respondWithRpcPromise(_0x18982a,_0x5b1f6d,_0x116ec0){return new BPromise(function(_0xbb7a3b,_0x18dcac){return client['request'](_0x18982a,_0x116ec0)[_0xf9b2('0xf')](function(_0x350455){logger['info'](_0xf9b2('0x10'),_0x5b1f6d,_0xf9b2('0x11'));logger[_0xf9b2('0x12')](_0xf9b2('0x13'),_0x5b1f6d,'request\x20sent',JSON[_0xf9b2('0x14')](_0x350455));if(_0x350455['error']){if(_0x350455[_0xf9b2('0x15')][_0xf9b2('0x16')]===0x1f4){logger[_0xf9b2('0x15')](_0xf9b2('0x10'),_0x5b1f6d,_0x350455['error'][_0xf9b2('0x17')]);return _0x18dcac(_0x350455['error'][_0xf9b2('0x17')]);}logger[_0xf9b2('0x15')](_0xf9b2('0x10'),_0x5b1f6d,_0x350455['error'][_0xf9b2('0x17')]);return _0xbb7a3b(_0x350455[_0xf9b2('0x15')][_0xf9b2('0x17')]);}else{logger['info'](_0xf9b2('0x10'),_0x5b1f6d,_0xf9b2('0x11'));_0xbb7a3b(_0x350455[_0xf9b2('0x18')]['message']);}})[_0xf9b2('0x19')](function(_0x144dec){logger[_0xf9b2('0x15')](_0xf9b2('0x10'),_0x5b1f6d,_0x144dec);_0x18dcac(_0x144dec);});});}exports[_0xf9b2('0x1a')]=function(_0x1dffbe){var _0x1baff8=this;return new Promise(function(_0x434ae0,_0x50dd0c){return db[_0xf9b2('0x1b')][_0xf9b2('0x1c')](_0x1dffbe[_0xf9b2('0x1d')],{'raw':_0x1dffbe[_0xf9b2('0x1e')]?_0x1dffbe[_0xf9b2('0x1e')][_0xf9b2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dffbe[_0xf9b2('0x1e')]?_0x1dffbe[_0xf9b2('0x1e')][_0xf9b2('0x20')]||null:null,'attributes':_0x1dffbe[_0xf9b2('0x1e')]?_0x1dffbe[_0xf9b2('0x1e')][_0xf9b2('0x21')]||null:null,'limit':_0x1dffbe[_0xf9b2('0x1e')]?_0x1dffbe['options'][_0xf9b2('0x22')]||null:null})[_0xf9b2('0xf')](function(_0x39962d){logger[_0xf9b2('0x23')](_0xf9b2('0x1a'),_0x1dffbe);logger['debug']('UpdateWhatsappInteraction',_0x1dffbe,JSON[_0xf9b2('0x14')](_0x39962d));_0x434ae0(_0x39962d);})[_0xf9b2('0x19')](function(_0x5d223f){logger[_0xf9b2('0x15')]('UpdateWhatsappInteraction',_0x5d223f[_0xf9b2('0x17')],_0x1dffbe);_0x50dd0c(_0x1baff8['error'](0x1f4,_0x5d223f[_0xf9b2('0x17')]));});});};exports[_0xf9b2('0x24')]=function(_0x2fa64e){return new Promise(function(_0x521395,_0xabf780){return db['WhatsappInteraction'][_0xf9b2('0x25')]({'where':_0x2fa64e[_0xf9b2('0x1e')]?_0x2fa64e['options'][_0xf9b2('0x20')]||null:null})[_0xf9b2('0xf')](function(_0x2bc134){if(_0x2bc134){return _0x2bc134[_0xf9b2('0x26')](_0x2fa64e['body']['ids'],_[_0xf9b2('0x27')](_0x2fa64e[_0xf9b2('0x1d')],['ids','id'])||{});}})[_0xf9b2('0x28')](function(_0x1d82b0){logger[_0xf9b2('0x23')](_0xf9b2('0x29'),_0x2fa64e);logger[_0xf9b2('0x12')](_0xf9b2('0x29'),_0x2fa64e,JSON[_0xf9b2('0x14')](_0x1d82b0));_0x521395(_0x1d82b0);})['catch'](function(_0x323e7d){logger[_0xf9b2('0x15')](_0xf9b2('0x29'),_0x323e7d['message'],_0x2fa64e);_0xabf780(_this[_0xf9b2('0x15')](0x1f4,_0x323e7d[_0xf9b2('0x17')]));});});}; \ No newline at end of file +var _0x59be=['error','message','info','result','catch','UpdateWhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5c0232,_0x1c449f){var _0x589366=function(_0x31cd62){while(--_0x31cd62){_0x5c0232['push'](_0x5c0232['shift']());}};_0x589366(++_0x1c449f);}(_0x59be,0xf6));var _0xe59b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x59be[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe59b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe59b('0x1'));var rs=require(_0xe59b('0x2'));var fs=require('fs');var Redis=require(_0xe59b('0x3'));var db=require(_0xe59b('0x4'))['db'];var utils=require(_0xe59b('0x5'));var logger=require('../../config/logger')(_0xe59b('0x6'));var config=require(_0xe59b('0x7'));var jayson=require(_0xe59b('0x8'));var client=jayson[_0xe59b('0x9')][_0xe59b('0xa')]({'port':0x232a});config[_0xe59b('0xb')]=_[_0xe59b('0xc')](config['redis'],{'host':_0xe59b('0xd'),'port':0x18eb});var socket=require(_0xe59b('0xe'))(new Redis(config[_0xe59b('0xb')]));require(_0xe59b('0xf'))[_0xe59b('0x10')](socket);function respondWithRpcPromise(_0x932461,_0x5ddc89,_0x53d378){return new BPromise(function(_0x3f2b28,_0x309485){return client[_0xe59b('0x11')](_0x932461,_0x53d378)[_0xe59b('0x12')](function(_0x407055){logger['info'](_0xe59b('0x13'),_0x5ddc89,_0xe59b('0x14'));logger[_0xe59b('0x15')](_0xe59b('0x16'),_0x5ddc89,_0xe59b('0x14'),JSON[_0xe59b('0x17')](_0x407055));if(_0x407055['error']){if(_0x407055[_0xe59b('0x18')]['code']===0x1f4){logger[_0xe59b('0x18')](_0xe59b('0x13'),_0x5ddc89,_0x407055['error']['message']);return _0x309485(_0x407055[_0xe59b('0x18')][_0xe59b('0x19')]);}logger[_0xe59b('0x18')](_0xe59b('0x13'),_0x5ddc89,_0x407055[_0xe59b('0x18')]['message']);return _0x3f2b28(_0x407055[_0xe59b('0x18')][_0xe59b('0x19')]);}else{logger[_0xe59b('0x1a')](_0xe59b('0x13'),_0x5ddc89,_0xe59b('0x14'));_0x3f2b28(_0x407055[_0xe59b('0x1b')][_0xe59b('0x19')]);}})[_0xe59b('0x1c')](function(_0x5574ec){logger[_0xe59b('0x18')](_0xe59b('0x13'),_0x5ddc89,_0x5574ec);_0x309485(_0x5574ec);});});}exports[_0xe59b('0x1d')]=function(_0x28af13){var _0x4f4251=this;return new Promise(function(_0x58ea43,_0xab6559){return db['WhatsappInteraction'][_0xe59b('0x1e')](_0x28af13[_0xe59b('0x1f')],{'raw':_0x28af13['options']?_0x28af13[_0xe59b('0x20')][_0xe59b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28af13[_0xe59b('0x20')]?_0x28af13[_0xe59b('0x20')][_0xe59b('0x22')]||null:null,'attributes':_0x28af13[_0xe59b('0x20')]?_0x28af13['options'][_0xe59b('0x23')]||null:null,'limit':_0x28af13[_0xe59b('0x20')]?_0x28af13[_0xe59b('0x20')][_0xe59b('0x24')]||null:null})['then'](function(_0x5101a0){logger['info']('UpdateWhatsappInteraction',_0x28af13);logger[_0xe59b('0x15')](_0xe59b('0x1d'),_0x28af13,JSON[_0xe59b('0x17')](_0x5101a0));_0x58ea43(_0x5101a0);})['catch'](function(_0x78956){logger[_0xe59b('0x18')](_0xe59b('0x1d'),_0x78956[_0xe59b('0x19')],_0x28af13);_0xab6559(_0x4f4251[_0xe59b('0x18')](0x1f4,_0x78956[_0xe59b('0x19')]));});});};exports[_0xe59b('0x25')]=function(_0x250850){return new Promise(function(_0x1d073e,_0x57efbf){return db[_0xe59b('0x26')][_0xe59b('0x27')]({'where':_0x250850[_0xe59b('0x20')]?_0x250850['options'][_0xe59b('0x22')]||null:null})[_0xe59b('0x12')](function(_0x302bd3){if(_0x302bd3){return _0x302bd3[_0xe59b('0x28')](_0x250850[_0xe59b('0x1f')][_0xe59b('0x29')],_[_0xe59b('0x2a')](_0x250850[_0xe59b('0x1f')],['ids','id'])||{});}})[_0xe59b('0x2b')](function(_0x7275b3){logger[_0xe59b('0x1a')](_0xe59b('0x2c'),_0x250850);logger['debug'](_0xe59b('0x2c'),_0x250850,JSON[_0xe59b('0x17')](_0x7275b3));_0x1d073e(_0x7275b3);})[_0xe59b('0x1c')](function(_0x476c7e){logger[_0xe59b('0x18')](_0xe59b('0x2c'),_0x476c7e[_0xe59b('0x19')],_0x250850);_0x57efbf(_this[_0xe59b('0x18')](0x1f4,_0x476c7e[_0xe59b('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index faab709..c455053 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 _0xe6dc=['register','./whatsappInteraction.events','save','update','emit','removeListener'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0xe6dc,0x1db));var _0xce6d=function(_0x411bee,_0x53bb1b){_0x411bee=_0x411bee-0x0;var _0x2e09cd=_0xe6dc[_0x411bee];return _0x2e09cd;};'use strict';var WhatsappInteractionEvents=require(_0xce6d('0x0'));var events=[_0xce6d('0x1'),'remove',_0xce6d('0x2')];function createListener(_0x3eefb5,_0x17d402){return function(_0x403071){_0x17d402[_0xce6d('0x3')](_0x3eefb5,_0x403071);};}function removeListener(_0x53f81f,_0x444366){return function(){WhatsappInteractionEvents[_0xce6d('0x4')](_0x53f81f,_0x444366);};}exports[_0xce6d('0x5')]=function(_0x449f29){for(var _0x27af7b=0x0,_0x264569=events['length'];_0x27af7b<_0x264569;_0x27af7b++){var _0x1643fd=events[_0x27af7b];var _0x19c90d=createListener('whatsappInteraction:'+_0x1643fd,_0x449f29);WhatsappInteractionEvents['on'](_0x1643fd,_0x19c90d);}}; \ No newline at end of file +var _0x92fb=['./whatsappInteraction.events','remove','update','removeListener','length'];(function(_0xa998ef,_0x2a44ee){var _0x146cc7=function(_0x3e1627){while(--_0x3e1627){_0xa998ef['push'](_0xa998ef['shift']());}};_0x146cc7(++_0x2a44ee);}(_0x92fb,0x1e0));var _0xb92f=function(_0x466b8c,_0x492ed0){_0x466b8c=_0x466b8c-0x0;var _0x3f461d=_0x92fb[_0x466b8c];return _0x3f461d;};'use strict';var WhatsappInteractionEvents=require(_0xb92f('0x0'));var events=['save',_0xb92f('0x1'),_0xb92f('0x2')];function createListener(_0x59b1a6,_0x3d7212){return function(_0x2cb55d){_0x3d7212['emit'](_0x59b1a6,_0x2cb55d);};}function removeListener(_0x5950bb,_0x4905bb){return function(){WhatsappInteractionEvents[_0xb92f('0x3')](_0x5950bb,_0x4905bb);};}exports['register']=function(_0x1e87fc){for(var _0x25fa01=0x0,_0x3481e4=events[_0xb92f('0x4')];_0x25fa01<_0x3481e4;_0x25fa01++){var _0x4a83b2=events[_0x25fa01];var _0x127708=createListener('whatsappInteraction:'+_0x4a83b2,_0x1e87fc);WhatsappInteractionEvents['on'](_0x4a83b2,_0x127708);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 214462d..54da252 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 _0x4455=['./whatsappMessage.controller','get','index','/describe','isAuthenticated','describe','show','tracked','post','/:id/status','status','put','/:id','update','/:id/accept','accept','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2d681e,_0x356bfe){var _0xe2f69d=function(_0x35290a){while(--_0x35290a){_0x2d681e['push'](_0x2d681e['shift']());}};_0xe2f69d(++_0x356bfe);}(_0x4455,0xd1));var _0x5445=function(_0x2305b7,_0x474882){_0x2305b7=_0x2305b7-0x0;var _0x45b182=_0x4455[_0x2305b7];return _0x45b182;};'use strict';var multer=require('multer');var util=require(_0x5445('0x0'));var path=require(_0x5445('0x1'));var timeout=require(_0x5445('0x2'));var express=require(_0x5445('0x3'));var router=express[_0x5445('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5445('0x5'));var interaction=require(_0x5445('0x6'));var config=require('../../config/environment');var controller=require(_0x5445('0x7'));router[_0x5445('0x8')]('/',auth['isAuthenticated'](),controller[_0x5445('0x9')]);router[_0x5445('0x8')](_0x5445('0xa'),auth[_0x5445('0xb')](),controller[_0x5445('0xc')]);router[_0x5445('0x8')]('/:id',auth[_0x5445('0xb')](),controller[_0x5445('0xd')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x5445('0xe')]('whatsapp','whatsappmessage:create'),controller['create']);router[_0x5445('0xf')](_0x5445('0x10'),controller[_0x5445('0x11')]);router[_0x5445('0x12')](_0x5445('0x13'),auth[_0x5445('0xb')](),controller[_0x5445('0x14')]);router[_0x5445('0x12')](_0x5445('0x15'),auth[_0x5445('0xb')](),controller[_0x5445('0x16')]);router['put']('/:id/reject',auth[_0x5445('0xb')](),controller[_0x5445('0x17')]);router[_0x5445('0x18')](_0x5445('0x13'),auth['isAuthenticated'](),controller[_0x5445('0x19')]);module[_0x5445('0x1a')]=router; \ No newline at end of file +var _0x1b1f=['../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','describe','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status','status','put','update','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22bfe7,_0xc8795c){var _0xbff177=function(_0x5a842a){while(--_0x5a842a){_0x22bfe7['push'](_0x22bfe7['shift']());}};_0xbff177(++_0xc8795c);}(_0x1b1f,0xf5));var _0xf1b1=function(_0x357b12,_0x5d649c){_0x357b12=_0x357b12-0x0;var _0x5beb90=_0x1b1f[_0x357b12];return _0x5beb90;};'use strict';var multer=require(_0xf1b1('0x0'));var util=require('util');var path=require(_0xf1b1('0x1'));var timeout=require(_0xf1b1('0x2'));var express=require(_0xf1b1('0x3'));var router=express['Router']();var fs_extra=require(_0xf1b1('0x4'));var auth=require(_0xf1b1('0x5'));var interaction=require(_0xf1b1('0x6'));var config=require(_0xf1b1('0x7'));var controller=require(_0xf1b1('0x8'));router[_0xf1b1('0x9')]('/',auth[_0xf1b1('0xa')](),controller[_0xf1b1('0xb')]);router[_0xf1b1('0x9')]('/describe',auth[_0xf1b1('0xa')](),controller[_0xf1b1('0xc')]);router[_0xf1b1('0x9')]('/:id',auth[_0xf1b1('0xa')](),controller[_0xf1b1('0xd')]);router['post']('/',auth[_0xf1b1('0xa')](),interaction[_0xf1b1('0xe')](_0xf1b1('0xf'),_0xf1b1('0x10')),controller[_0xf1b1('0x11')]);router[_0xf1b1('0x12')](_0xf1b1('0x13'),controller[_0xf1b1('0x14')]);router[_0xf1b1('0x15')]('/:id',auth[_0xf1b1('0xa')](),controller[_0xf1b1('0x16')]);router[_0xf1b1('0x15')](_0xf1b1('0x17'),auth[_0xf1b1('0xa')](),controller[_0xf1b1('0x18')]);router[_0xf1b1('0x15')]('/:id/reject',auth[_0xf1b1('0xa')](),controller[_0xf1b1('0x19')]);router[_0xf1b1('0x1a')]('/:id',auth[_0xf1b1('0xa')](),controller['destroy']);module[_0xf1b1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 9a72090..3e35411 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 _0x7c2a=['BOOLEAN','sequelize','TEXT','medium','STRING','DATE'];(function(_0xa50cc7,_0x8bd25){var _0x5f02ae=function(_0x31f85e){while(--_0x31f85e){_0xa50cc7['push'](_0xa50cc7['shift']());}};_0x5f02ae(++_0x8bd25);}(_0x7c2a,0x169));var _0xa7c2=function(_0x371156,_0x26fefa){_0x371156=_0x371156-0x0;var _0x15f5e5=_0x7c2a[_0x371156];return _0x15f5e5;};'use strict';var Sequelize=require(_0xa7c2('0x0'));module['exports']={'body':{'type':Sequelize[_0xa7c2('0x1')](_0xa7c2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa7c2('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xa7c2('0x4')]},'secret':{'type':Sequelize[_0xa7c2('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa7c2('0x3')]},'providerResponse':{'type':Sequelize[_0xa7c2('0x1')]}}; \ No newline at end of file +var _0x0e04=['BOOLEAN','TEXT','ENUM','out','STRING','DATE'];(function(_0x2971ce,_0x18309b){var _0x514af7=function(_0x5a2617){while(--_0x5a2617){_0x2971ce['push'](_0x2971ce['shift']());}};_0x514af7(++_0x18309b);}(_0x0e04,0x18d));var _0x40e0=function(_0x41a527,_0x15a472){_0x41a527=_0x41a527-0x0;var _0x345dc0=_0x0e04[_0x41a527];return _0x345dc0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x40e0('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x40e0('0x1')]('in',_0x40e0('0x2')),'defaultValue':_0x40e0('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x40e0('0x3')](0xbe)},'phone':{'type':Sequelize[_0x40e0('0x3')]},'readAt':{'type':Sequelize[_0x40e0('0x4')]},'secret':{'type':Sequelize[_0x40e0('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x40e0('0x3')]},'providerResponse':{'type':Sequelize[_0x40e0('0x0')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index dbd2260..730df47 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 _0x9ea6=['squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','json','offset','limit','count','status','set','apply','update','destroy','then','end','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappMessage','includeAll','rows','show','include','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','user','agent','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','User','internal','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','fs-extra'];(function(_0x5a2c55,_0x1b8b09){var _0x38f4c0=function(_0x51ccc9){while(--_0x51ccc9){_0x5a2c55['push'](_0x5a2c55['shift']());}};_0x38f4c0(++_0x1b8b09);}(_0x9ea6,0x84));var _0x69ea=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9ea6[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x69ea('0x0'));var rimraf=require(_0x69ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69ea('0x2'));var rp=require(_0x69ea('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x69ea('0x4'));var util=require(_0x69ea('0x5'));var path=require(_0x69ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69ea('0x7'));var _=require('lodash');var squel=require(_0x69ea('0x8'));var crypto=require(_0x69ea('0x9'));var jsforce=require(_0x69ea('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x69ea('0xb'));var querystring=require(_0x69ea('0xc'));var Papa=require(_0x69ea('0xd'));var Redis=require(_0x69ea('0xe'));var authService=require(_0x69ea('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x69ea('0x10'));var hardwareService=require(_0x69ea('0x11'));var logger=require(_0x69ea('0x12'))('api');var utils=require(_0x69ea('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x69ea('0x14')]=_[_0x69ea('0x15')](config[_0x69ea('0x14')],{'host':_0x69ea('0x16'),'port':0x18eb});var socket=require(_0x69ea('0x17'))(new Redis(config[_0x69ea('0x14')]));require(_0x69ea('0x18'))[_0x69ea('0x19')](socket);var jayson=require(_0x69ea('0x1a'));var client=jayson[_0x69ea('0x1b')][_0x69ea('0x1c')]({'port':0x232c});var client9002=jayson[_0x69ea('0x1b')][_0x69ea('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x351fe6,_0x3009c7,_0x1fea0a,_0x172e80){return new BPromise(function(_0x16e5be,_0x396da8){var _0x55ffbf=_0x172e80||client;return _0x55ffbf['request'](_0x351fe6,_0x1fea0a)['then'](function(_0x4f5762){logger[_0x69ea('0x1d')](_0x69ea('0x1e'),_0x3009c7,'request\x20sent');logger[_0x69ea('0x1f')](_0x69ea('0x20'),_0x3009c7,_0x69ea('0x21'),JSON[_0x69ea('0x22')](_0x4f5762));if(_0x4f5762[_0x69ea('0x23')]){if(_0x4f5762[_0x69ea('0x23')][_0x69ea('0x24')]===0x1f4){logger[_0x69ea('0x23')](_0x69ea('0x1e'),_0x3009c7,_0x4f5762[_0x69ea('0x23')][_0x69ea('0x25')]);return _0x396da8(_0x4f5762[_0x69ea('0x23')][_0x69ea('0x25')]);}logger[_0x69ea('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3009c7,_0x4f5762[_0x69ea('0x23')][_0x69ea('0x25')]);return _0x16e5be(_0x4f5762['error'][_0x69ea('0x25')]);}else{logger['info'](_0x69ea('0x1e'),_0x3009c7,_0x69ea('0x21'));_0x16e5be(_0x4f5762[_0x69ea('0x26')][_0x69ea('0x25')]);}})[_0x69ea('0x27')](function(_0x5d6606){logger[_0x69ea('0x23')](_0x69ea('0x1e'),_0x3009c7,_0x5d6606);_0x396da8(_0x5d6606);});});}function respondWithStatusCode(_0x43f2f7,_0xb530f){_0xb530f=_0xb530f||0xcc;return function(_0x194377){if(_0x194377){return _0x43f2f7[_0x69ea('0x28')](_0xb530f);}return _0x43f2f7['status'](_0xb530f)['end']();};}function respondWithResult(_0x53d100,_0x35be86){_0x35be86=_0x35be86||0xc8;return function(_0x506e36){if(_0x506e36){return _0x53d100['status'](_0x35be86)[_0x69ea('0x29')](_0x506e36);}};}function respondWithFilteredResult(_0x2ac2bc,_0x31ad60){return function(_0x5106bf){if(_0x5106bf){var _0x37d571=typeof _0x31ad60[_0x69ea('0x2a')]==='undefined'&&typeof _0x31ad60[_0x69ea('0x2b')]==='undefined';var _0x4066e0=_0x5106bf['count'];var _0x129c98=_0x37d571?0x0:_0x31ad60[_0x69ea('0x2a')];var _0xe27360=_0x37d571?_0x5106bf[_0x69ea('0x2c')]:_0x31ad60[_0x69ea('0x2a')]+_0x31ad60[_0x69ea('0x2b')];var _0x248aaf;if(_0xe27360>=_0x4066e0){_0xe27360=_0x4066e0;_0x248aaf=0xc8;}else{_0x248aaf=0xce;}_0x2ac2bc[_0x69ea('0x2d')](_0x248aaf);return _0x2ac2bc[_0x69ea('0x2e')]('Content-Range',_0x129c98+'-'+_0xe27360+'/'+_0x4066e0)[_0x69ea('0x29')](_0x5106bf);}return null;};}function patchUpdates(_0x206e7a){return function(_0x51e05b){try{jsonpatch[_0x69ea('0x2f')](_0x51e05b,_0x206e7a,!![]);}catch(_0x15ccf7){return BPromise['reject'](_0x15ccf7);}return _0x51e05b['save']();};}function saveUpdates(_0x42fb68,_0x5b9674){return function(_0x3c7930){if(_0x3c7930){return _0x3c7930[_0x69ea('0x30')](_0x42fb68)['then'](function(_0x3faf9a){return _0x3faf9a;});}return null;};}function removeEntity(_0x4e0002,_0x41679f){return function(_0x50ea7a){if(_0x50ea7a){return _0x50ea7a[_0x69ea('0x31')]()[_0x69ea('0x32')](function(){_0x4e0002[_0x69ea('0x2d')](0xcc)[_0x69ea('0x33')]();});}};}function handleEntityNotFound(_0x29840b,_0x32e58d){return function(_0x41e76b){if(!_0x41e76b){_0x29840b[_0x69ea('0x28')](0x194);}return _0x41e76b;};}function handleError(_0x1513b3,_0x4cb6aa){_0x4cb6aa=_0x4cb6aa||0x1f4;return function(_0x280e98){logger['error'](_0x280e98[_0x69ea('0x34')]);if(_0x280e98[_0x69ea('0x35')]){delete _0x280e98[_0x69ea('0x35')];}_0x1513b3[_0x69ea('0x2d')](_0x4cb6aa)[_0x69ea('0x36')](_0x280e98);};}exports[_0x69ea('0x37')]=function(_0x3f2f2e,_0x7b6a2a){var _0x4b5931={},_0x484655={},_0x4f2937={'count':0x0,'rows':[]};var _0x79aa0=_['map'](db['WhatsappMessage'][_0x69ea('0x38')],function(_0x4fc5dd){return{'name':_0x4fc5dd['fieldName'],'type':_0x4fc5dd['type'][_0x69ea('0x39')]};});_0x484655['model']=_[_0x69ea('0x3a')](_0x79aa0,_0x69ea('0x35'));_0x484655[_0x69ea('0x3b')]=_[_0x69ea('0x3c')](_0x3f2f2e['query']);_0x484655[_0x69ea('0x3d')]=_[_0x69ea('0x3e')](_0x484655['model'],_0x484655[_0x69ea('0x3b')]);_0x4b5931[_0x69ea('0x3f')]=_[_0x69ea('0x3e')](_0x484655[_0x69ea('0x40')],qs[_0x69ea('0x41')](_0x3f2f2e[_0x69ea('0x3b')][_0x69ea('0x41')]));_0x4b5931[_0x69ea('0x3f')]=_0x4b5931[_0x69ea('0x3f')][_0x69ea('0x42')]?_0x4b5931[_0x69ea('0x3f')]:_0x484655[_0x69ea('0x40')];if(!_0x3f2f2e['query'][_0x69ea('0x43')](_0x69ea('0x44'))){_0x4b5931['limit']=qs[_0x69ea('0x2b')](_0x3f2f2e[_0x69ea('0x3b')]['limit']);_0x4b5931[_0x69ea('0x2a')]=qs[_0x69ea('0x2a')](_0x3f2f2e[_0x69ea('0x3b')][_0x69ea('0x2a')]);}_0x4b5931[_0x69ea('0x45')]=qs[_0x69ea('0x46')](_0x3f2f2e[_0x69ea('0x3b')]['sort']);_0x4b5931[_0x69ea('0x47')]=qs[_0x69ea('0x3d')](_[_0x69ea('0x48')](_0x3f2f2e[_0x69ea('0x3b')],_0x484655[_0x69ea('0x3d')]),_0x79aa0);if(_0x3f2f2e['query'][_0x69ea('0x49')]){_0x4b5931[_0x69ea('0x47')]=_[_0x69ea('0x4a')](_0x4b5931[_0x69ea('0x47')],{'$or':_[_0x69ea('0x3a')](_0x79aa0,function(_0x58389e){if(_0x58389e[_0x69ea('0x4b')]!==_0x69ea('0x4c')){var _0x21cdad={};_0x21cdad[_0x58389e[_0x69ea('0x35')]]={'$like':'%'+_0x3f2f2e[_0x69ea('0x3b')][_0x69ea('0x49')]+'%'};return _0x21cdad;}})});}_0x4b5931=_[_0x69ea('0x4a')]({},_0x4b5931,_0x3f2f2e[_0x69ea('0x4d')]);var _0x4e6850={'where':_0x4b5931[_0x69ea('0x47')]};return db[_0x69ea('0x4e')][_0x69ea('0x2c')](_0x4e6850)[_0x69ea('0x32')](function(_0x8b7fb0){_0x4f2937[_0x69ea('0x2c')]=_0x8b7fb0;if(_0x3f2f2e['query'][_0x69ea('0x4f')]){_0x4b5931['include']=[{'all':!![]}];}return db[_0x69ea('0x4e')]['findAll'](_0x4b5931);})[_0x69ea('0x32')](function(_0x480040){_0x4f2937[_0x69ea('0x50')]=_0x480040;return _0x4f2937;})[_0x69ea('0x32')](respondWithFilteredResult(_0x7b6a2a,_0x4b5931))[_0x69ea('0x27')](handleError(_0x7b6a2a,null));};exports[_0x69ea('0x51')]=function(_0x10ce89,_0x3b6af1){var _0x14fe98={'raw':!![],'where':{'id':_0x10ce89['params']['id']}},_0x1a4d9d={};_0x1a4d9d['model']=_[_0x69ea('0x3c')](db[_0x69ea('0x4e')][_0x69ea('0x38')]);_0x1a4d9d[_0x69ea('0x3b')]=_[_0x69ea('0x3c')](_0x10ce89['query']);_0x1a4d9d[_0x69ea('0x3d')]=_[_0x69ea('0x3e')](_0x1a4d9d[_0x69ea('0x40')],_0x1a4d9d[_0x69ea('0x3b')]);_0x14fe98[_0x69ea('0x3f')]=_[_0x69ea('0x3e')](_0x1a4d9d[_0x69ea('0x40')],qs[_0x69ea('0x41')](_0x10ce89[_0x69ea('0x3b')][_0x69ea('0x41')]));_0x14fe98[_0x69ea('0x3f')]=_0x14fe98[_0x69ea('0x3f')][_0x69ea('0x42')]?_0x14fe98[_0x69ea('0x3f')]:_0x1a4d9d['model'];if(_0x10ce89['query'][_0x69ea('0x4f')]){_0x14fe98[_0x69ea('0x52')]=[{'all':!![]}];}_0x14fe98=_[_0x69ea('0x4a')]({},_0x14fe98,_0x10ce89[_0x69ea('0x4d')]);return db[_0x69ea('0x4e')]['find'](_0x14fe98)[_0x69ea('0x32')](handleEntityNotFound(_0x3b6af1,null))[_0x69ea('0x32')](respondWithResult(_0x3b6af1,null))[_0x69ea('0x27')](handleError(_0x3b6af1,null));};exports[_0x69ea('0x53')]=function(_0x14b64f,_0x5aa669){return db[_0x69ea('0x4e')][_0x69ea('0x53')](_0x14b64f['body'],{})[_0x69ea('0x32')](respondWithResult(_0x5aa669,0xc9))['catch'](handleError(_0x5aa669,null));};exports[_0x69ea('0x30')]=function(_0x1d7cb1,_0x51f10c){if(_0x1d7cb1[_0x69ea('0x54')]['id']){delete _0x1d7cb1[_0x69ea('0x54')]['id'];}return db[_0x69ea('0x4e')][_0x69ea('0x55')]({'where':{'id':_0x1d7cb1[_0x69ea('0x56')]['id']}})[_0x69ea('0x32')](handleEntityNotFound(_0x51f10c,null))[_0x69ea('0x32')](saveUpdates(_0x1d7cb1[_0x69ea('0x54')],null))[_0x69ea('0x32')](respondWithResult(_0x51f10c,null))['catch'](handleError(_0x51f10c,null));};exports[_0x69ea('0x31')]=function(_0x140565,_0x13e5f8){return db[_0x69ea('0x4e')][_0x69ea('0x55')]({'where':{'id':_0x140565[_0x69ea('0x56')]['id']}})[_0x69ea('0x32')](handleEntityNotFound(_0x13e5f8,null))['then'](removeEntity(_0x13e5f8,null))[_0x69ea('0x27')](handleError(_0x13e5f8,null));};exports[_0x69ea('0x57')]=function(_0x5d0c89,_0x31654e){return db[_0x69ea('0x4e')][_0x69ea('0x57')]()[_0x69ea('0x32')](respondWithResult(_0x31654e,null))['catch'](handleError(_0x31654e,null));};var interaction_log=require(_0x69ea('0x12'))(_0x69ea('0x58'));exports[_0x69ea('0x59')]=function(_0x14d89c,_0x5962e2,_0x47eff6){var _0x2b65c0={'agent':{},'channel':_0x69ea('0x5a')};if(_0x14d89c[_0x69ea('0x54')]['id']){delete _0x14d89c[_0x69ea('0x54')]['id'];}_0x14d89c[_0x69ea('0x54')][_0x69ea('0x5b')]=!![];_0x14d89c['body'][_0x69ea('0x5c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x14d89c['body'][_0x69ea('0x5d')]=_0x14d89c[_0x69ea('0x54')][_0x69ea('0x5d')]||_0x14d89c[_0x69ea('0x5e')]['id'];_0x2b65c0[_0x69ea('0x5f')]['id']=_0x14d89c[_0x69ea('0x54')][_0x69ea('0x5d')];return db[_0x69ea('0x4e')][_0x69ea('0x55')]({'where':{'id':_0x14d89c[_0x69ea('0x56')]['id'],'UserId':null}})[_0x69ea('0x32')](handleEntityNotFound(_0x5962e2,null))['then'](saveUpdates(_0x14d89c[_0x69ea('0x54')],null))[_0x69ea('0x32')](function(_0x5f5ca3){if(_0x5f5ca3){_0x2b65c0[_0x69ea('0x25')]=_0x5f5ca3['get']({'plain':!![]});return db[_0x69ea('0x60')][_0x69ea('0x55')]({'where':{'id':_0x5f5ca3[_0x69ea('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x5962e2,null))['then'](function(_0x2396a2){if(_0x2396a2){return _0x2396a2[_0x69ea('0x30')]({'UserId':_0x14d89c[_0x69ea('0x54')][_0x69ea('0x5d')],'read1stAt':_['isNil'](_0x2396a2[_0x69ea('0x62')])?moment()[_0x69ea('0x63')](_0x69ea('0x64')):undefined});}return null;})[_0x69ea('0x32')](function(_0x1f0a2f){if(_0x1f0a2f){_0x2b65c0[_0x69ea('0x65')]=_0x1f0a2f['get']({'plain':!![]});interaction_log['info'](_0x69ea('0x66'),_0x14d89c[_0x69ea('0x5e')]['id'],_0x14d89c['user'][_0x69ea('0x35')],_0x14d89c[_0x69ea('0x5e')][_0x69ea('0x67')],_0x2b65c0[_0x69ea('0x65')]['id'],_0x14d89c['body']?JSON[_0x69ea('0x22')](_0x14d89c[_0x69ea('0x54')]):_0x69ea('0x68'));return respondWithRpcPromise(_0x69ea('0x69'),'acceptMessage',_0x2b65c0);}return null;})[_0x69ea('0x32')](function(_0x29940c){var _0x438871='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x29940c['message']['ContactId'];return db[_0x69ea('0x6a')][_0x69ea('0x3b')](_0x438871,{'type':db[_0x69ea('0x6b')][_0x69ea('0x6c')][_0x69ea('0x6d')],'raw':!![]})['then'](function(_0x47dd31){return _0x47dd31;});})[_0x69ea('0x32')](function(_0x1105e9){if(_0x1105e9){_0x2b65c0['message'][_0x69ea('0x6e')]=_0x1105e9[0x0];if(!_0x14d89c[_0x69ea('0x54')]['UserId'])return;return db['User'][_0x69ea('0x55')]({'where':{'id':_0x14d89c[_0x69ea('0x54')][_0x69ea('0x5d')],'role':_0x69ea('0x5f')},'attributes':['id',_0x69ea('0x35'),_0x69ea('0x6f'),_0x69ea('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0xadd46b){if(!_0xadd46b)return null;_0x2b65c0['message'][_0x69ea('0x5f')]=_0xadd46b;return _0x2b65c0;})[_0x69ea('0x32')](function(_0x3240a4){if(_0x3240a4){if(_0x14d89c[_0x69ea('0x54')][_0x69ea('0x71')]){_0x2b65c0[_0x69ea('0x25')][_0x69ea('0x72')]=util[_0x69ea('0x63')](_0x69ea('0x73'),_0x14d89c[_0x69ea('0x5e')][_0x69ea('0x35')]);_0x2b65c0[_0x69ea('0x25')]['channel']=_0x2b65c0[_0x69ea('0x74')];_0x2b65c0[_0x69ea('0x25')][_0x69ea('0x75')]=_0x2b65c0[_0x69ea('0x74')];_0x2b65c0['message'][_0x69ea('0x76')]=_0x69ea('0x59');return respondWithRpcPromise(_0x69ea('0x77'),_0x69ea('0x77'),{'event':_0x69ea('0x78'),'message':_0x2b65c0['message']},client9002)['then'](function(){return _0x2b65c0;});}return _0x2b65c0;}return null;})[_0x69ea('0x32')](respondWithResult(_0x5962e2,null))['catch'](handleError(_0x5962e2,null));};var interaction_log=require(_0x69ea('0x12'))('whatsapp-interactions');exports[_0x69ea('0x79')]=function(_0x59098c,_0x3c6231,_0x32e064){var _0x30bc5c={'agent':{},'channel':'whatsapp'};if(_0x59098c[_0x69ea('0x54')]['id']){delete _0x59098c[_0x69ea('0x54')]['id'];}_0x59098c['body']['UserId']=_0x59098c[_0x69ea('0x54')][_0x69ea('0x5d')]||_0x59098c[_0x69ea('0x5e')]['id'];_0x30bc5c[_0x69ea('0x5f')]['id']=_0x59098c[_0x69ea('0x54')][_0x69ea('0x5d')];return db['WhatsappMessage'][_0x69ea('0x55')]({'where':{'id':_0x59098c[_0x69ea('0x56')]['id'],'UserId':null}})[_0x69ea('0x32')](handleEntityNotFound(_0x3c6231,null))[_0x69ea('0x32')](function(_0x3ee4ee){if(_0x3ee4ee){_0x30bc5c['message']=_0x3ee4ee[_0x69ea('0x7a')]({'plain':!![]});return db[_0x69ea('0x60')][_0x69ea('0x55')]({'where':{'id':_0x3ee4ee['WhatsappInteractionId']}});}return null;})[_0x69ea('0x32')](handleEntityNotFound(_0x3c6231,null))[_0x69ea('0x32')](function(_0xc9b820){if(_0xc9b820){_0x30bc5c[_0x69ea('0x65')]=_0xc9b820[_0x69ea('0x7a')]({'plain':!![]});interaction_log[_0x69ea('0x1d')](_0x69ea('0x7b'),_0x59098c[_0x69ea('0x5e')]['id'],_0x59098c[_0x69ea('0x5e')][_0x69ea('0x35')],_0x59098c[_0x69ea('0x5e')][_0x69ea('0x67')],_0x30bc5c['interaction']['id'],_0x59098c[_0x69ea('0x54')]?JSON[_0x69ea('0x22')](_0x59098c[_0x69ea('0x54')]):_0x69ea('0x68'));return respondWithRpcPromise(_0x69ea('0x7c'),_0x69ea('0x7d'),_0x30bc5c);}return null;})[_0x69ea('0x32')](function(_0x3f2f17){var _0x23ed11=_0x69ea('0x7e')+_0x3f2f17[_0x69ea('0x25')][_0x69ea('0x7f')];return db['sequelize'][_0x69ea('0x3b')](_0x23ed11,{'type':db[_0x69ea('0x6b')][_0x69ea('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x2ffe40){return _0x2ffe40;});})[_0x69ea('0x32')](function(_0x40a5ee){if(_0x40a5ee){_0x30bc5c[_0x69ea('0x25')][_0x69ea('0x6e')]=_0x40a5ee[0x0];if(!_0x59098c['body'][_0x69ea('0x5d')])return;return db[_0x69ea('0x80')][_0x69ea('0x55')]({'where':{'id':_0x59098c[_0x69ea('0x54')][_0x69ea('0x5d')],'role':_0x69ea('0x5f')},'attributes':['id',_0x69ea('0x35'),_0x69ea('0x6f'),_0x69ea('0x70'),_0x69ea('0x81')],'raw':!![]});}return null;})[_0x69ea('0x32')](function(_0x30b755){if(!_0x30b755)return null;_0x30bc5c[_0x69ea('0x25')][_0x69ea('0x5f')]=_0x30b755;return _0x30bc5c;})[_0x69ea('0x32')](function(_0xd90ad4){if(_0xd90ad4){_0xd90ad4[_0x69ea('0x25')]['interface']=util['format']('SIP/%s',_0x59098c[_0x69ea('0x5e')][_0x69ea('0x35')]);_0xd90ad4[_0x69ea('0x25')]['channel']=_0x30bc5c[_0x69ea('0x74')];_0xd90ad4[_0x69ea('0x25')][_0x69ea('0x75')]=_0x30bc5c[_0x69ea('0x74')];_0xd90ad4['message']['event']='reject';respondWithRpcPromise(_0x69ea('0x77'),'EventManager',{'event':_0x69ea('0x82'),'message':_0xd90ad4['message']},client9002);return _0x30bc5c;}return null;})[_0x69ea('0x32')](respondWithResult(_0x3c6231,null))['catch'](handleError(_0x3c6231,null));};exports['status']=function(_0x4bdf38,_0x80060d,_0x2c3365){if(_0x4bdf38['body']['id']){delete _0x4bdf38[_0x69ea('0x54')]['id'];}var _0x172e6d;return db[_0x69ea('0x4e')][_0x69ea('0x55')]({'where':{'id':_0x4bdf38[_0x69ea('0x56')]['id']}})['then'](handleEntityNotFound(_0x80060d,null))[_0x69ea('0x32')](function(_0x30aeab){if(_0x30aeab){_0x172e6d=_0x30aeab;return db['WhatsappAccount'][_0x69ea('0x55')]({'where':{'id':_0x30aeab[_0x69ea('0x83')]}});}})[_0x69ea('0x32')](handleEntityNotFound(_0x80060d,null))[_0x69ea('0x32')](function(_0x1f75da){if(_0x1f75da){logger[_0x69ea('0x1f')](_0x69ea('0x84'),_0x69ea('0x2d'),_0x69ea('0x85'),_0x1f75da[_0x69ea('0x4b')],util[_0x69ea('0x86')](_0x4bdf38['body'],{'showHidden':![],'depth':null}));switch(_0x1f75da[_0x69ea('0x4b')]){case'twilio':if(_0x4bdf38[_0x69ea('0x54')][_0x69ea('0x87')]&&_0x4bdf38[_0x69ea('0x54')][_0x69ea('0x87')]===_0x172e6d[_0x69ea('0x88')]&&_0x4bdf38['body'][_0x69ea('0x89')]&&_0x4bdf38[_0x69ea('0x54')][_0x69ea('0x89')]===_0x69ea('0x5b')){return _0x172e6d[_0x69ea('0x30')]({'read':!![]});}else{logger[_0x69ea('0x23')](_0x69ea('0x8a'),'status',_0x69ea('0x8b'),util[_0x69ea('0x86')](_0x4bdf38['body'],{'showHidden':![],'depth':null}));}break;}return _0x172e6d;}})[_0x69ea('0x32')](respondWithResult(_0x80060d,null))['catch'](handleError(_0x80060d,null));}; \ No newline at end of file +var _0xcb3d=['fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','end','status','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','rows','show','params','find','create','body','accept','whatsapp','readAt','format','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','WhatsappInteraction','RejectMessage','rejectMessage','contact','fullname','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','read','twilio','eml-format','rimraf','zip-dir'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xcb3d,0x85));var _0xdcb3=function(_0x52ca57,_0x2e7e8d){_0x52ca57=_0x52ca57-0x0;var _0x1703c5=_0xcb3d[_0x52ca57];return _0x1703c5;};'use strict';var emlformat=require(_0xdcb3('0x0'));var rimraf=require(_0xdcb3('0x1'));var zipdir=require(_0xdcb3('0x2'));var jsonpatch=require(_0xdcb3('0x3'));var rp=require(_0xdcb3('0x4'));var moment=require(_0xdcb3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdcb3('0x6'));var util=require(_0xdcb3('0x7'));var path=require(_0xdcb3('0x8'));var sox=require('sox');var csv=require(_0xdcb3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdcb3('0xa'));var squel=require('squel');var crypto=require(_0xdcb3('0xb'));var jsforce=require(_0xdcb3('0xc'));var deskjs=require(_0xdcb3('0xd'));var toCsv=require(_0xdcb3('0x9'));var querystring=require(_0xdcb3('0xe'));var Papa=require(_0xdcb3('0xf'));var Redis=require(_0xdcb3('0x10'));var authService=require(_0xdcb3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdcb3('0x12'));var hardwareService=require(_0xdcb3('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdcb3('0x14'));var licenseUtil=require(_0xdcb3('0x15'));var db=require(_0xdcb3('0x16'))['db'];config[_0xdcb3('0x17')]=_[_0xdcb3('0x18')](config[_0xdcb3('0x17')],{'host':_0xdcb3('0x19'),'port':0x18eb});var socket=require(_0xdcb3('0x1a'))(new Redis(config['redis']));require(_0xdcb3('0x1b'))[_0xdcb3('0x1c')](socket);var jayson=require(_0xdcb3('0x1d'));var client=jayson[_0xdcb3('0x1e')][_0xdcb3('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdcb3('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x534cfe,_0x4bc080,_0x36f555,_0x29d303){return new BPromise(function(_0x47b433,_0x41bf70){var _0x36febe=_0x29d303||client;return _0x36febe[_0xdcb3('0x20')](_0x534cfe,_0x36f555)[_0xdcb3('0x21')](function(_0x485171){logger['info'](_0xdcb3('0x22'),_0x4bc080,'request\x20sent');logger[_0xdcb3('0x23')](_0xdcb3('0x24'),_0x4bc080,'request\x20sent',JSON[_0xdcb3('0x25')](_0x485171));if(_0x485171['error']){if(_0x485171[_0xdcb3('0x26')][_0xdcb3('0x27')]===0x1f4){logger[_0xdcb3('0x26')](_0xdcb3('0x22'),_0x4bc080,_0x485171['error']['message']);return _0x41bf70(_0x485171[_0xdcb3('0x26')][_0xdcb3('0x28')]);}logger[_0xdcb3('0x26')](_0xdcb3('0x22'),_0x4bc080,_0x485171[_0xdcb3('0x26')]['message']);return _0x47b433(_0x485171[_0xdcb3('0x26')][_0xdcb3('0x28')]);}else{logger[_0xdcb3('0x29')](_0xdcb3('0x22'),_0x4bc080,'request\x20sent');_0x47b433(_0x485171['result'][_0xdcb3('0x28')]);}})[_0xdcb3('0x2a')](function(_0x4f443f){logger[_0xdcb3('0x26')](_0xdcb3('0x22'),_0x4bc080,_0x4f443f);_0x41bf70(_0x4f443f);});});}function respondWithStatusCode(_0x3398d8,_0x3a12db){_0x3a12db=_0x3a12db||0xcc;return function(_0x4e2482){if(_0x4e2482){return _0x3398d8[_0xdcb3('0x2b')](_0x3a12db);}return _0x3398d8['status'](_0x3a12db)[_0xdcb3('0x2c')]();};}function respondWithResult(_0x4b86d3,_0x4f825d){_0x4f825d=_0x4f825d||0xc8;return function(_0x247410){if(_0x247410){return _0x4b86d3[_0xdcb3('0x2d')](_0x4f825d)['json'](_0x247410);}};}function respondWithFilteredResult(_0x4be095,_0x480d39){return function(_0xfc8a06){if(_0xfc8a06){var _0xe0fa02=typeof _0x480d39['offset']==='undefined'&&typeof _0x480d39[_0xdcb3('0x2e')]===_0xdcb3('0x2f');var _0x4f5495=_0xfc8a06[_0xdcb3('0x30')];var _0x247ce6=_0xe0fa02?0x0:_0x480d39['offset'];var _0x46cc6f=_0xe0fa02?_0xfc8a06[_0xdcb3('0x30')]:_0x480d39[_0xdcb3('0x31')]+_0x480d39[_0xdcb3('0x2e')];var _0x445d89;if(_0x46cc6f>=_0x4f5495){_0x46cc6f=_0x4f5495;_0x445d89=0xc8;}else{_0x445d89=0xce;}_0x4be095[_0xdcb3('0x2d')](_0x445d89);return _0x4be095['set'](_0xdcb3('0x32'),_0x247ce6+'-'+_0x46cc6f+'/'+_0x4f5495)['json'](_0xfc8a06);}return null;};}function patchUpdates(_0x1ef6ff){return function(_0x246ab8){try{jsonpatch['apply'](_0x246ab8,_0x1ef6ff,!![]);}catch(_0x1f59be){return BPromise[_0xdcb3('0x33')](_0x1f59be);}return _0x246ab8[_0xdcb3('0x34')]();};}function saveUpdates(_0x1a973b,_0xf06012){return function(_0x2f1769){if(_0x2f1769){return _0x2f1769[_0xdcb3('0x35')](_0x1a973b)[_0xdcb3('0x21')](function(_0x50c5e4){return _0x50c5e4;});}return null;};}function removeEntity(_0x4eee88,_0x45b992){return function(_0x58579f){if(_0x58579f){return _0x58579f[_0xdcb3('0x36')]()[_0xdcb3('0x21')](function(){_0x4eee88['status'](0xcc)[_0xdcb3('0x2c')]();});}};}function handleEntityNotFound(_0x31c8de,_0x516135){return function(_0x2df510){if(!_0x2df510){_0x31c8de['sendStatus'](0x194);}return _0x2df510;};}function handleError(_0x310c67,_0x96fbd1){_0x96fbd1=_0x96fbd1||0x1f4;return function(_0x24676c){logger[_0xdcb3('0x26')](_0x24676c['stack']);if(_0x24676c['name']){delete _0x24676c[_0xdcb3('0x37')];}_0x310c67[_0xdcb3('0x2d')](_0x96fbd1)[_0xdcb3('0x38')](_0x24676c);};}exports[_0xdcb3('0x39')]=function(_0x41a6f5,_0x1a8d5c){var _0x39042c={},_0x318f20={},_0x3833b5={'count':0x0,'rows':[]};var _0x446cb8=_[_0xdcb3('0x3a')](db['WhatsappMessage'][_0xdcb3('0x3b')],function(_0x27c4dd){return{'name':_0x27c4dd[_0xdcb3('0x3c')],'type':_0x27c4dd[_0xdcb3('0x3d')][_0xdcb3('0x3e')]};});_0x318f20['model']=_[_0xdcb3('0x3a')](_0x446cb8,_0xdcb3('0x37'));_0x318f20[_0xdcb3('0x3f')]=_[_0xdcb3('0x40')](_0x41a6f5[_0xdcb3('0x3f')]);_0x318f20[_0xdcb3('0x41')]=_[_0xdcb3('0x42')](_0x318f20[_0xdcb3('0x43')],_0x318f20[_0xdcb3('0x3f')]);_0x39042c[_0xdcb3('0x44')]=_[_0xdcb3('0x42')](_0x318f20[_0xdcb3('0x43')],qs[_0xdcb3('0x45')](_0x41a6f5['query']['fields']));_0x39042c[_0xdcb3('0x44')]=_0x39042c[_0xdcb3('0x44')][_0xdcb3('0x46')]?_0x39042c[_0xdcb3('0x44')]:_0x318f20[_0xdcb3('0x43')];if(!_0x41a6f5['query'][_0xdcb3('0x47')](_0xdcb3('0x48'))){_0x39042c[_0xdcb3('0x2e')]=qs[_0xdcb3('0x2e')](_0x41a6f5[_0xdcb3('0x3f')][_0xdcb3('0x2e')]);_0x39042c[_0xdcb3('0x31')]=qs['offset'](_0x41a6f5[_0xdcb3('0x3f')]['offset']);}_0x39042c[_0xdcb3('0x49')]=qs[_0xdcb3('0x4a')](_0x41a6f5[_0xdcb3('0x3f')][_0xdcb3('0x4a')]);_0x39042c[_0xdcb3('0x4b')]=qs[_0xdcb3('0x41')](_[_0xdcb3('0x4c')](_0x41a6f5[_0xdcb3('0x3f')],_0x318f20[_0xdcb3('0x41')]),_0x446cb8);if(_0x41a6f5[_0xdcb3('0x3f')][_0xdcb3('0x4d')]){_0x39042c[_0xdcb3('0x4b')]=_[_0xdcb3('0x4e')](_0x39042c[_0xdcb3('0x4b')],{'$or':_[_0xdcb3('0x3a')](_0x446cb8,function(_0xf8de89){if(_0xf8de89[_0xdcb3('0x3d')]!==_0xdcb3('0x4f')){var _0xca0b3e={};_0xca0b3e[_0xf8de89[_0xdcb3('0x37')]]={'$like':'%'+_0x41a6f5[_0xdcb3('0x3f')][_0xdcb3('0x4d')]+'%'};return _0xca0b3e;}})});}_0x39042c=_[_0xdcb3('0x4e')]({},_0x39042c,_0x41a6f5[_0xdcb3('0x50')]);var _0x150283={'where':_0x39042c[_0xdcb3('0x4b')]};return db[_0xdcb3('0x51')][_0xdcb3('0x30')](_0x150283)[_0xdcb3('0x21')](function(_0x4a785e){_0x3833b5[_0xdcb3('0x30')]=_0x4a785e;if(_0x41a6f5[_0xdcb3('0x3f')][_0xdcb3('0x52')]){_0x39042c[_0xdcb3('0x53')]=[{'all':!![]}];}return db[_0xdcb3('0x51')][_0xdcb3('0x54')](_0x39042c);})['then'](function(_0xed7c1c){_0x3833b5[_0xdcb3('0x55')]=_0xed7c1c;return _0x3833b5;})['then'](respondWithFilteredResult(_0x1a8d5c,_0x39042c))[_0xdcb3('0x2a')](handleError(_0x1a8d5c,null));};exports[_0xdcb3('0x56')]=function(_0x1d1aea,_0x340561){var _0x47b389={'raw':!![],'where':{'id':_0x1d1aea[_0xdcb3('0x57')]['id']}},_0x5c3037={};_0x5c3037[_0xdcb3('0x43')]=_[_0xdcb3('0x40')](db[_0xdcb3('0x51')][_0xdcb3('0x3b')]);_0x5c3037['query']=_[_0xdcb3('0x40')](_0x1d1aea[_0xdcb3('0x3f')]);_0x5c3037[_0xdcb3('0x41')]=_[_0xdcb3('0x42')](_0x5c3037[_0xdcb3('0x43')],_0x5c3037[_0xdcb3('0x3f')]);_0x47b389[_0xdcb3('0x44')]=_[_0xdcb3('0x42')](_0x5c3037['model'],qs[_0xdcb3('0x45')](_0x1d1aea[_0xdcb3('0x3f')]['fields']));_0x47b389[_0xdcb3('0x44')]=_0x47b389[_0xdcb3('0x44')][_0xdcb3('0x46')]?_0x47b389[_0xdcb3('0x44')]:_0x5c3037[_0xdcb3('0x43')];if(_0x1d1aea[_0xdcb3('0x3f')][_0xdcb3('0x52')]){_0x47b389[_0xdcb3('0x53')]=[{'all':!![]}];}_0x47b389=_[_0xdcb3('0x4e')]({},_0x47b389,_0x1d1aea[_0xdcb3('0x50')]);return db['WhatsappMessage'][_0xdcb3('0x58')](_0x47b389)['then'](handleEntityNotFound(_0x340561,null))[_0xdcb3('0x21')](respondWithResult(_0x340561,null))[_0xdcb3('0x2a')](handleError(_0x340561,null));};exports[_0xdcb3('0x59')]=function(_0x39fdfa,_0x2a3fc2){return db[_0xdcb3('0x51')][_0xdcb3('0x59')](_0x39fdfa[_0xdcb3('0x5a')],{})[_0xdcb3('0x21')](respondWithResult(_0x2a3fc2,0xc9))[_0xdcb3('0x2a')](handleError(_0x2a3fc2,null));};exports[_0xdcb3('0x35')]=function(_0x4066b6,_0x4337a7){if(_0x4066b6['body']['id']){delete _0x4066b6[_0xdcb3('0x5a')]['id'];}return db['WhatsappMessage']['find']({'where':{'id':_0x4066b6[_0xdcb3('0x57')]['id']}})[_0xdcb3('0x21')](handleEntityNotFound(_0x4337a7,null))['then'](saveUpdates(_0x4066b6[_0xdcb3('0x5a')],null))[_0xdcb3('0x21')](respondWithResult(_0x4337a7,null))[_0xdcb3('0x2a')](handleError(_0x4337a7,null));};exports['destroy']=function(_0x2c1981,_0x2b0429){return db['WhatsappMessage']['find']({'where':{'id':_0x2c1981['params']['id']}})[_0xdcb3('0x21')](handleEntityNotFound(_0x2b0429,null))['then'](removeEntity(_0x2b0429,null))['catch'](handleError(_0x2b0429,null));};exports['describe']=function(_0x213256,_0xe4b891){return db[_0xdcb3('0x51')]['describe']()[_0xdcb3('0x21')](respondWithResult(_0xe4b891,null))[_0xdcb3('0x2a')](handleError(_0xe4b891,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xdcb3('0x5b')]=function(_0x36697b,_0x556533,_0x1b30e6){var _0x361462={'agent':{},'channel':_0xdcb3('0x5c')};if(_0x36697b[_0xdcb3('0x5a')]['id']){delete _0x36697b[_0xdcb3('0x5a')]['id'];}_0x36697b[_0xdcb3('0x5a')]['read']=!![];_0x36697b['body'][_0xdcb3('0x5d')]=moment()[_0xdcb3('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x36697b[_0xdcb3('0x5a')][_0xdcb3('0x5f')]=_0x36697b[_0xdcb3('0x5a')]['UserId']||_0x36697b[_0xdcb3('0x60')]['id'];_0x361462[_0xdcb3('0x61')]['id']=_0x36697b[_0xdcb3('0x5a')][_0xdcb3('0x5f')];return db['WhatsappMessage'][_0xdcb3('0x58')]({'where':{'id':_0x36697b[_0xdcb3('0x57')]['id'],'UserId':null}})[_0xdcb3('0x21')](handleEntityNotFound(_0x556533,null))[_0xdcb3('0x21')](saveUpdates(_0x36697b[_0xdcb3('0x5a')],null))[_0xdcb3('0x21')](function(_0x4a205d){if(_0x4a205d){_0x361462['message']=_0x4a205d[_0xdcb3('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xdcb3('0x58')]({'where':{'id':_0x4a205d[_0xdcb3('0x63')]}});}return null;})[_0xdcb3('0x21')](handleEntityNotFound(_0x556533,null))[_0xdcb3('0x21')](function(_0x326b93){if(_0x326b93){return _0x326b93[_0xdcb3('0x35')]({'UserId':_0x36697b[_0xdcb3('0x5a')][_0xdcb3('0x5f')],'read1stAt':_[_0xdcb3('0x64')](_0x326b93[_0xdcb3('0x65')])?moment()[_0xdcb3('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4fe5d8){if(_0x4fe5d8){_0x361462[_0xdcb3('0x66')]=_0x4fe5d8[_0xdcb3('0x62')]({'plain':!![]});interaction_log[_0xdcb3('0x29')](_0xdcb3('0x67'),_0x36697b['user']['id'],_0x36697b[_0xdcb3('0x60')]['name'],_0x36697b[_0xdcb3('0x60')][_0xdcb3('0x68')],_0x361462['interaction']['id'],_0x36697b[_0xdcb3('0x5a')]?JSON[_0xdcb3('0x25')](_0x36697b[_0xdcb3('0x5a')]):_0xdcb3('0x69'));return respondWithRpcPromise(_0xdcb3('0x6a'),_0xdcb3('0x6b'),_0x361462);}return null;})['then'](function(_0x247cd2){var _0xe63a81=_0xdcb3('0x6c')+_0x247cd2[_0xdcb3('0x28')]['ContactId'];return db[_0xdcb3('0x6d')][_0xdcb3('0x3f')](_0xe63a81,{'type':db[_0xdcb3('0x6e')]['QueryTypes'][_0xdcb3('0x6f')],'raw':!![]})[_0xdcb3('0x21')](function(_0x1549f8){return _0x1549f8;});})[_0xdcb3('0x21')](function(_0x1e9453){if(_0x1e9453){_0x361462[_0xdcb3('0x28')]['contact']=_0x1e9453[0x0];if(!_0x36697b['body']['UserId'])return;return db[_0xdcb3('0x70')]['find']({'where':{'id':_0x36697b[_0xdcb3('0x5a')][_0xdcb3('0x5f')],'role':'agent'},'attributes':['id',_0xdcb3('0x37'),'fullname',_0xdcb3('0x71'),_0xdcb3('0x72')],'raw':!![]});}return null;})[_0xdcb3('0x21')](function(_0x4a1196){if(!_0x4a1196)return null;_0x361462[_0xdcb3('0x28')]['agent']=_0x4a1196;return _0x361462;})['then'](function(_0x2ef703){if(_0x2ef703){if(_0x36697b[_0xdcb3('0x5a')][_0xdcb3('0x73')]){_0x361462[_0xdcb3('0x28')][_0xdcb3('0x74')]=util['format'](_0xdcb3('0x75'),_0x36697b[_0xdcb3('0x60')]['name']);_0x361462[_0xdcb3('0x28')][_0xdcb3('0x76')]=_0x361462[_0xdcb3('0x76')];_0x361462[_0xdcb3('0x28')][_0xdcb3('0x77')]=_0x361462[_0xdcb3('0x76')];_0x361462['message'][_0xdcb3('0x78')]=_0xdcb3('0x5b');return respondWithRpcPromise(_0xdcb3('0x79'),_0xdcb3('0x79'),{'event':'acceptmessage','message':_0x361462[_0xdcb3('0x28')]},client9002)[_0xdcb3('0x21')](function(){return _0x361462;});}return _0x361462;}return null;})['then'](respondWithResult(_0x556533,null))[_0xdcb3('0x2a')](handleError(_0x556533,null));};var interaction_log=require('../../config/logger')(_0xdcb3('0x7a'));exports['reject']=function(_0x46be91,_0x581a20,_0x5be73){var _0x32e624={'agent':{},'channel':_0xdcb3('0x5c')};if(_0x46be91[_0xdcb3('0x5a')]['id']){delete _0x46be91['body']['id'];}_0x46be91[_0xdcb3('0x5a')]['UserId']=_0x46be91[_0xdcb3('0x5a')][_0xdcb3('0x5f')]||_0x46be91[_0xdcb3('0x60')]['id'];_0x32e624[_0xdcb3('0x61')]['id']=_0x46be91[_0xdcb3('0x5a')][_0xdcb3('0x5f')];return db[_0xdcb3('0x51')][_0xdcb3('0x58')]({'where':{'id':_0x46be91[_0xdcb3('0x57')]['id'],'UserId':null}})[_0xdcb3('0x21')](handleEntityNotFound(_0x581a20,null))[_0xdcb3('0x21')](function(_0x582727){if(_0x582727){_0x32e624['message']=_0x582727[_0xdcb3('0x62')]({'plain':!![]});return db[_0xdcb3('0x7b')][_0xdcb3('0x58')]({'where':{'id':_0x582727[_0xdcb3('0x63')]}});}return null;})[_0xdcb3('0x21')](handleEntityNotFound(_0x581a20,null))[_0xdcb3('0x21')](function(_0x4bd84d){if(_0x4bd84d){_0x32e624[_0xdcb3('0x66')]=_0x4bd84d[_0xdcb3('0x62')]({'plain':!![]});interaction_log[_0xdcb3('0x29')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46be91[_0xdcb3('0x60')]['id'],_0x46be91[_0xdcb3('0x60')][_0xdcb3('0x37')],_0x46be91[_0xdcb3('0x60')][_0xdcb3('0x68')],_0x32e624[_0xdcb3('0x66')]['id'],_0x46be91[_0xdcb3('0x5a')]?JSON[_0xdcb3('0x25')](_0x46be91[_0xdcb3('0x5a')]):_0xdcb3('0x69'));return respondWithRpcPromise(_0xdcb3('0x7c'),_0xdcb3('0x7d'),_0x32e624);}return null;})[_0xdcb3('0x21')](function(_0x33545a){var _0x4ba454=_0xdcb3('0x6c')+_0x33545a['message']['ContactId'];return db['sequelize']['query'](_0x4ba454,{'type':db[_0xdcb3('0x6e')]['QueryTypes'][_0xdcb3('0x6f')],'raw':!![]})[_0xdcb3('0x21')](function(_0x41f3f2){return _0x41f3f2;});})['then'](function(_0xca1d69){if(_0xca1d69){_0x32e624[_0xdcb3('0x28')][_0xdcb3('0x7e')]=_0xca1d69[0x0];if(!_0x46be91[_0xdcb3('0x5a')][_0xdcb3('0x5f')])return;return db['User'][_0xdcb3('0x58')]({'where':{'id':_0x46be91[_0xdcb3('0x5a')][_0xdcb3('0x5f')],'role':_0xdcb3('0x61')},'attributes':['id','name',_0xdcb3('0x7f'),_0xdcb3('0x71'),_0xdcb3('0x72')],'raw':!![]});}return null;})[_0xdcb3('0x21')](function(_0x4d938e){if(!_0x4d938e)return null;_0x32e624['message']['agent']=_0x4d938e;return _0x32e624;})['then'](function(_0x24edb4){if(_0x24edb4){_0x24edb4[_0xdcb3('0x28')][_0xdcb3('0x74')]=util[_0xdcb3('0x5e')](_0xdcb3('0x75'),_0x46be91['user']['name']);_0x24edb4[_0xdcb3('0x28')][_0xdcb3('0x76')]=_0x32e624['channel'];_0x24edb4[_0xdcb3('0x28')][_0xdcb3('0x77')]=_0x32e624[_0xdcb3('0x76')];_0x24edb4[_0xdcb3('0x28')]['event']=_0xdcb3('0x33');respondWithRpcPromise(_0xdcb3('0x79'),_0xdcb3('0x79'),{'event':'rejectmessage','message':_0x24edb4[_0xdcb3('0x28')]},client9002);return _0x32e624;}return null;})[_0xdcb3('0x21')](respondWithResult(_0x581a20,null))[_0xdcb3('0x2a')](handleError(_0x581a20,null));};exports[_0xdcb3('0x2d')]=function(_0x26baa3,_0x38dab6,_0x30a738){if(_0x26baa3[_0xdcb3('0x5a')]['id']){delete _0x26baa3[_0xdcb3('0x5a')]['id'];}var _0x4862cf;return db[_0xdcb3('0x51')][_0xdcb3('0x58')]({'where':{'id':_0x26baa3['params']['id']}})['then'](handleEntityNotFound(_0x38dab6,null))[_0xdcb3('0x21')](function(_0x131a0f){if(_0x131a0f){_0x4862cf=_0x131a0f;return db[_0xdcb3('0x80')][_0xdcb3('0x58')]({'where':{'id':_0x131a0f[_0xdcb3('0x81')]}});}})['then'](handleEntityNotFound(_0x38dab6,null))[_0xdcb3('0x21')](function(_0xcdc6fd){if(_0xcdc6fd){logger[_0xdcb3('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xdcb3('0x2d'),_0xdcb3('0x82'),_0xcdc6fd[_0xdcb3('0x3d')],util[_0xdcb3('0x83')](_0x26baa3[_0xdcb3('0x5a')],{'showHidden':![],'depth':null}));switch(_0xcdc6fd['type']){case'twilio':if(_0x26baa3['body']['MessageSid']&&_0x26baa3['body'][_0xdcb3('0x84')]===_0x4862cf['messageId']&&_0x26baa3[_0xdcb3('0x5a')][_0xdcb3('0x85')]&&_0x26baa3[_0xdcb3('0x5a')][_0xdcb3('0x85')]===_0xdcb3('0x86')){return _0x4862cf[_0xdcb3('0x35')]({'read':!![]});}else{logger[_0xdcb3('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xdcb3('0x2d'),_0xdcb3('0x87'),util[_0xdcb3('0x83')](_0x26baa3[_0xdcb3('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4862cf;}})[_0xdcb3('0x21')](respondWithResult(_0x38dab6,null))[_0xdcb3('0x2a')](handleError(_0x38dab6,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 900e30d..234dcf4 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 _0xd87e=['../../mysqldb','setMaxListeners','save','update','emit','exports','events'];(function(_0x4a0db0,_0x4e7a3c){var _0x5091f0=function(_0x496789){while(--_0x496789){_0x4a0db0['push'](_0x4a0db0['shift']());}};_0x5091f0(++_0x4e7a3c);}(_0xd87e,0x1bf));var _0xed87=function(_0x568363,_0x2e79a7){_0x568363=_0x568363-0x0;var _0x47f0ed=_0xd87e[_0x568363];return _0x47f0ed;};'use strict';var EventEmitter=require(_0xed87('0x0'));var WhatsappMessage=require(_0xed87('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xed87('0x2')](0x0);var events={'afterCreate':_0xed87('0x3'),'afterUpdate':_0xed87('0x4'),'afterDestroy':'remove'};function emitEvent(_0xbbee79){return function(_0x5e960f,_0x11a5d9,_0x41ca7c){WhatsappMessageEvents['emit'](_0xbbee79+':'+_0x5e960f['id'],_0x5e960f);WhatsappMessageEvents[_0xed87('0x5')](_0xbbee79,_0x5e960f);_0x41ca7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xed87('0x6')]=WhatsappMessageEvents; \ No newline at end of file +var _0x0c5d=['remove','emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0x5941b8,_0x42c96e){var _0x271381=function(_0x32e23d){while(--_0x32e23d){_0x5941b8['push'](_0x5941b8['shift']());}};_0x271381(++_0x42c96e);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x2c7bc8,_0x11a924){_0x2c7bc8=_0x2c7bc8-0x0;var _0x5e6716=_0x0c5d[_0x2c7bc8];return _0x5e6716;};'use strict';var EventEmitter=require(_0xd0c5('0x0'));var WhatsappMessage=require(_0xd0c5('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd0c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd0c5('0x3'),'afterDestroy':_0xd0c5('0x4')};function emitEvent(_0x83f28){return function(_0x177811,_0x4664bc,_0xc3a9b9){WhatsappMessageEvents[_0xd0c5('0x5')](_0x83f28+':'+_0x177811['id'],_0x177811);WhatsappMessageEvents[_0xd0c5('0x5')](_0x83f28,_0x177811);_0xc3a9b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xd0c5('0x6')](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 5f97ae3..7c94a78 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 _0x713d=['phone','create','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','direction','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','toLowerCase','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken'];(function(_0x139786,_0x2f45b6){var _0x1222d8=function(_0x57cf2f){while(--_0x57cf2f){_0x139786['push'](_0x139786['shift']());}};_0x1222d8(++_0x2f45b6);}(_0x713d,0xb9));var _0xd713=function(_0x54ccbc,_0x22292b){_0x54ccbc=_0x54ccbc-0x0;var _0x38332a=_0x713d[_0x54ccbc];return _0x38332a;};'use strict';var _=require(_0xd713('0x0'));var util=require('util');var logger=require(_0xd713('0x1'))('api');var moment=require(_0xd713('0x2'));var BPromise=require(_0xd713('0x3'));var rp=require(_0xd713('0x4'));var fetch=require(_0xd713('0x5'));var fs=require('fs');var path=require(_0xd713('0x6'));var rimraf=require(_0xd713('0x7'));var config=require(_0xd713('0x8'));var attributes=require(_0xd713('0x9'));module['exports']=function(_0x17f22c,_0x16f9ac){return _0x17f22c[_0xd713('0xa')](_0xd713('0xb'),attributes,{'tableName':_0xd713('0xc'),'paranoid':![],'indexes':[{'name':_0xd713('0xd'),'fields':['messageId']},{'name':_0xd713('0xe'),'fields':[_0xd713('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21c4d8,_0x315212,_0x394639){var _0x3e27d4=_0x17f22c[_0xd713('0x10')];var _0x2a0191=_0x21c4d8['get']({'plain':!![]});if(_0x2a0191[_0xd713('0x11')]['toLowerCase']()==='in'||_0x2a0191[_0xd713('0x11')]['toLowerCase']()==='out'&&!_0x2a0191['secret']&&!_['isNil'](_0x2a0191['UserId'])){_0x3e27d4[_0xd713('0x12')][_0xd713('0x13')]({'where':{'id':_0x2a0191[_0xd713('0x14')]}})[_0xd713('0x15')](function(_0x3f9a36){if(_0x3f9a36){_0x3f9a36[_0xd713('0x16')]({'lastMsgAt':_0x2a0191[_0xd713('0x17')],'lastMsgDirection':_0x2a0191['direction'][_0xd713('0x18')]()});}})[_0xd713('0x19')](function(_0x5df11b){console[_0xd713('0x1a')](_0x5df11b);});}if(_0x2a0191[_0xd713('0x11')]==='out'&&!_0x2a0191[_0xd713('0x1b')]){var _0x3eb885;_0x3e27d4[_0xd713('0x1c')][_0xd713('0x1d')]({'where':{'id':_0x2a0191[_0xd713('0x1e')]},'raw':!![]})[_0xd713('0x15')](function(_0x5a853d){_0x3eb885=_0x5a853d;if(_0x3eb885&&_0x3eb885[_0xd713('0x1f')]){switch(_0x3eb885['type']){case _0xd713('0x20'):var _0x28a3df=require('twilio');if(_0x3eb885[_0xd713('0x21')]&&_0x3eb885[_0xd713('0x22')]&&_0x3eb885[_0xd713('0x23')]){var _0x474c45=new _0x28a3df(_0x3eb885['accountSid'],_0x3eb885[_0xd713('0x22')]);_0x474c45['messages'][_0xd713('0x24')]({'body':_0x2a0191['body'],'to':_0xd713('0x25')+_0x2a0191[_0xd713('0x23')],'from':'whatsapp:'+_0x3eb885[_0xd713('0x23')],'statusCallback':_0x3eb885[_0xd713('0x26')]+'/api/whatsapp/messages/'+_0x2a0191['id']+_0xd713('0x27')+_0x3eb885[_0xd713('0x28')]})[_0xd713('0x15')](function(_0xe432bd){if(_0xe432bd[_0xd713('0x29')]){return _0x21c4d8[_0xd713('0x16')]({'messageId':_0xe432bd[_0xd713('0x29')]});}})['catch'](function(_0x1e0d2f){logger[_0xd713('0x1a')](_0xd713('0x2a'),_0xd713('0x2b'),_0xd713('0x20'),util[_0xd713('0x2c')](_0x1e0d2f,{'showHidden':![],'depth':null}));});}else{logger[_0xd713('0x1a')](_0xd713('0x2a'),_0xd713('0x2b'),'twilio',_0xd713('0x2d'));}break;case _0xd713('0x2e'):var _0x596f14=_0x3eb885[_0xd713('0x21')];var _0x578397=_0x3eb885[_0xd713('0x22')];var _0xd2c73d=_0x3eb885[_0xd713('0x2f')]+'/whatsapp/v1/'+_0x596f14+_0xd713('0x30');var _0x26d7ee={'to':[_0x2a0191[_0xd713('0x23')]],'message':{'type':'text','text':_0x2a0191[_0xd713('0xf')]}};var _0xd99e10={'method':_0xd713('0x31'),'uri':_0xd2c73d,'headers':{'Authorization':'Bearer\x20'+_0x578397,'Content-Type':_0xd713('0x32')},'body':_0x26d7ee,'json':!![]};rp(_0xd99e10)[_0xd713('0x15')](function(_0x3421de){if(_0x3421de[_0xd713('0x33')][0x0][_0xd713('0x34')]){return _0x21c4d8[_0xd713('0x16')]({'messageId':_0x3421de[_0xd713('0x33')][0x0]['message_id']});}})[_0xd713('0x19')](function(_0x30e6a3){logger['err'](_0xd713('0x35'),_0x30e6a3);});break;}}})['finally'](function(){_0x394639();});}else{_0x394639();}}},'charset':'utf8mb4','collate':_0xd713('0x36')});}; \ No newline at end of file +var _0xeed7=['api','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','define','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteractionId','then','update','createdAt','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','create','body','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','catch','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','finally','utf8mb4','../../config/logger'];(function(_0xbcf185,_0x251002){var _0x2ae4de=function(_0x26f5d2){while(--_0x26f5d2){_0xbcf185['push'](_0xbcf185['shift']());}};_0x2ae4de(++_0x251002);}(_0xeed7,0xdf));var _0x7eed=function(_0x369f80,_0x22d394){_0x369f80=_0x369f80-0x0;var _0x25cb93=_0xeed7[_0x369f80];return _0x25cb93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7eed('0x0'))(_0x7eed('0x1'));var moment=require('moment');var BPromise=require(_0x7eed('0x2'));var rp=require(_0x7eed('0x3'));var fetch=require(_0x7eed('0x4'));var fs=require('fs');var path=require(_0x7eed('0x5'));var rimraf=require('rimraf');var config=require(_0x7eed('0x6'));var attributes=require(_0x7eed('0x7'));module['exports']=function(_0x307a00,_0x50ab76){return _0x307a00[_0x7eed('0x8')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x7eed('0x9'),'fields':[_0x7eed('0x9')]},{'name':_0x7eed('0xa'),'fields':['body'],'type':_0x7eed('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4f0916,_0x5dc5bb,_0x377ff1){var _0x42aac7=_0x307a00[_0x7eed('0xc')];var _0x357ab8=_0x4f0916[_0x7eed('0xd')]({'plain':!![]});if(_0x357ab8[_0x7eed('0xe')][_0x7eed('0xf')]()==='in'||_0x357ab8[_0x7eed('0xe')][_0x7eed('0xf')]()==='out'&&!_0x357ab8[_0x7eed('0x10')]&&!_[_0x7eed('0x11')](_0x357ab8[_0x7eed('0x12')])){_0x42aac7['WhatsappInteraction']['findOne']({'where':{'id':_0x357ab8[_0x7eed('0x13')]}})[_0x7eed('0x14')](function(_0xe64c1){if(_0xe64c1){_0xe64c1[_0x7eed('0x15')]({'lastMsgAt':_0x357ab8[_0x7eed('0x16')],'lastMsgDirection':_0x357ab8['direction']['toLowerCase']()});}})['catch'](function(_0xdcfd1){console['error'](_0xdcfd1);});}if(_0x357ab8['direction']==='out'&&!_0x357ab8[_0x7eed('0x10')]){var _0x2fe55f;_0x42aac7[_0x7eed('0x17')][_0x7eed('0x18')]({'where':{'id':_0x357ab8[_0x7eed('0x19')]},'raw':!![]})[_0x7eed('0x14')](function(_0x222f33){_0x2fe55f=_0x222f33;if(_0x2fe55f&&_0x2fe55f[_0x7eed('0x1a')]){switch(_0x2fe55f[_0x7eed('0x1a')]){case _0x7eed('0x1b'):var _0xe36710=require(_0x7eed('0x1b'));if(_0x2fe55f[_0x7eed('0x1c')]&&_0x2fe55f[_0x7eed('0x1d')]&&_0x2fe55f['phone']){var _0x390012=new _0xe36710(_0x2fe55f['accountSid'],_0x2fe55f[_0x7eed('0x1d')]);_0x390012['messages'][_0x7eed('0x1e')]({'body':_0x357ab8[_0x7eed('0x1f')],'to':'whatsapp:'+_0x357ab8['phone'],'from':'whatsapp:'+_0x2fe55f[_0x7eed('0x20')],'statusCallback':_0x2fe55f[_0x7eed('0x21')]+_0x7eed('0x22')+_0x357ab8['id']+_0x7eed('0x23')+_0x2fe55f[_0x7eed('0x24')]})[_0x7eed('0x14')](function(_0x329e5f){if(_0x329e5f[_0x7eed('0x25')]){return _0x4f0916[_0x7eed('0x15')]({'messageId':_0x329e5f[_0x7eed('0x25')]});}})[_0x7eed('0x26')](function(_0x20420f){logger[_0x7eed('0x27')](_0x7eed('0x28'),_0x7eed('0x29'),_0x7eed('0x1b'),util[_0x7eed('0x2a')](_0x20420f,{'showHidden':![],'depth':null}));});}else{logger[_0x7eed('0x27')](_0x7eed('0x28'),_0x7eed('0x29'),_0x7eed('0x1b'),_0x7eed('0x2b'));}break;case _0x7eed('0x2c'):var _0x764ea3=_0x2fe55f[_0x7eed('0x1c')];var _0x37ace1=_0x2fe55f[_0x7eed('0x1d')];var _0x1a1a71=_0x2fe55f[_0x7eed('0x2d')]+_0x7eed('0x2e')+_0x764ea3+_0x7eed('0x2f');var _0x3d6e09={'to':[_0x357ab8[_0x7eed('0x20')]],'message':{'type':_0x7eed('0x30'),'text':_0x357ab8[_0x7eed('0x1f')]}};var _0x3fa0b8={'method':'POST','uri':_0x1a1a71,'headers':{'Authorization':_0x7eed('0x31')+_0x37ace1,'Content-Type':_0x7eed('0x32')},'body':_0x3d6e09,'json':!![]};rp(_0x3fa0b8)[_0x7eed('0x14')](function(_0x28e4d5){if(_0x28e4d5[_0x7eed('0x33')][0x0]['message_id']){return _0x4f0916['update']({'messageId':_0x28e4d5['statuses'][0x0][_0x7eed('0x34')]});}})[_0x7eed('0x26')](function(_0x3e7d64){logger[_0x7eed('0x35')]('WhatsappMessage,\x20%s',_0x3e7d64);});break;}}})[_0x7eed('0x36')](function(){_0x377ff1();});}else{_0x377ff1();}}},'charset':_0x7eed('0x37'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 0e45d8d..4d26cb1 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 _0x4e01=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','CreateWhatsappMessage','WhatsappMessage','body','options','raw','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4e01,0xbf));var _0x14e0=function(_0xb8d280,_0x153b6c){_0xb8d280=_0xb8d280-0x0;var _0x26bcc2=_0x4e01[_0xb8d280];return _0x26bcc2;};'use strict';var _=require('lodash');var util=require(_0x14e0('0x0'));var moment=require(_0x14e0('0x1'));var BPromise=require(_0x14e0('0x2'));var rs=require(_0x14e0('0x3'));var fs=require('fs');var Redis=require(_0x14e0('0x4'));var db=require(_0x14e0('0x5'))['db'];var utils=require(_0x14e0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x14e0('0x7'));var jayson=require(_0x14e0('0x8'));var client=jayson[_0x14e0('0x9')][_0x14e0('0xa')]({'port':0x232a});config[_0x14e0('0xb')]=_[_0x14e0('0xc')](config[_0x14e0('0xb')],{'host':_0x14e0('0xd'),'port':0x18eb});var socket=require(_0x14e0('0xe'))(new Redis(config['redis']));require(_0x14e0('0xf'))['register'](socket);function respondWithRpcPromise(_0x8d93d3,_0x4a6b58,_0x54a542){return new BPromise(function(_0x3a6b07,_0x18ef1d){return client[_0x14e0('0x10')](_0x8d93d3,_0x54a542)[_0x14e0('0x11')](function(_0x592c38){logger['info'](_0x14e0('0x12'),_0x4a6b58,_0x14e0('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4a6b58,_0x14e0('0x13'),JSON[_0x14e0('0x14')](_0x592c38));if(_0x592c38['error']){if(_0x592c38['error'][_0x14e0('0x15')]===0x1f4){logger[_0x14e0('0x16')](_0x14e0('0x12'),_0x4a6b58,_0x592c38['error'][_0x14e0('0x17')]);return _0x18ef1d(_0x592c38[_0x14e0('0x16')]['message']);}logger[_0x14e0('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x4a6b58,_0x592c38[_0x14e0('0x16')]['message']);return _0x3a6b07(_0x592c38[_0x14e0('0x16')]['message']);}else{logger[_0x14e0('0x18')](_0x14e0('0x12'),_0x4a6b58,_0x14e0('0x13'));_0x3a6b07(_0x592c38[_0x14e0('0x19')]['message']);}})['catch'](function(_0x4a5bda){logger[_0x14e0('0x16')](_0x14e0('0x12'),_0x4a6b58,_0x4a5bda);_0x18ef1d(_0x4a5bda);});});}exports[_0x14e0('0x1a')]=function(_0x3f451c){var _0x41b82d=this;return new Promise(function(_0x2b57bf,_0x54d95b){return db[_0x14e0('0x1b')]['create'](_0x3f451c[_0x14e0('0x1c')],{'raw':_0x3f451c[_0x14e0('0x1d')]?_0x3f451c[_0x14e0('0x1d')][_0x14e0('0x1e')]===undefined?!![]:![]:!![]})[_0x14e0('0x11')](function(_0x512ffe){logger[_0x14e0('0x18')](_0x14e0('0x1a'),_0x3f451c);logger[_0x14e0('0x1f')](_0x14e0('0x1a'),_0x3f451c,JSON[_0x14e0('0x14')](_0x512ffe));_0x2b57bf(_0x512ffe);})[_0x14e0('0x20')](function(_0x8bba46){logger['error'](_0x14e0('0x1a'),_0x8bba46[_0x14e0('0x17')],_0x3f451c);_0x54d95b(_0x41b82d[_0x14e0('0x16')](0x1f4,_0x8bba46[_0x14e0('0x17')]));});});}; \ No newline at end of file +var _0x1a80=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket'];(function(_0x379f38,_0x32be37){var _0x2656c7=function(_0x450679){while(--_0x450679){_0x379f38['push'](_0x379f38['shift']());}};_0x2656c7(++_0x32be37);}(_0x1a80,0x76));var _0x01a8=function(_0x3354ab,_0x4349dd){_0x3354ab=_0x3354ab-0x0;var _0x4445d3=_0x1a80[_0x3354ab];return _0x4445d3;};'use strict';var _=require('lodash');var util=require(_0x01a8('0x0'));var moment=require(_0x01a8('0x1'));var BPromise=require(_0x01a8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x01a8('0x3'));var db=require(_0x01a8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x01a8('0x5'))(_0x01a8('0x6'));var config=require('../../config/environment');var jayson=require(_0x01a8('0x7'));var client=jayson[_0x01a8('0x8')][_0x01a8('0x9')]({'port':0x232a});config[_0x01a8('0xa')]=_['defaults'](config[_0x01a8('0xa')],{'host':_0x01a8('0xb'),'port':0x18eb});var socket=require(_0x01a8('0xc'))(new Redis(config['redis']));require(_0x01a8('0xd'))[_0x01a8('0xe')](socket);function respondWithRpcPromise(_0x36c757,_0x437e0f,_0x5c95b2){return new BPromise(function(_0x67643b,_0x3bf0b0){return client[_0x01a8('0xf')](_0x36c757,_0x5c95b2)[_0x01a8('0x10')](function(_0x4680eb){logger[_0x01a8('0x11')](_0x01a8('0x12'),_0x437e0f,_0x01a8('0x13'));logger[_0x01a8('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x437e0f,'request\x20sent',JSON[_0x01a8('0x15')](_0x4680eb));if(_0x4680eb[_0x01a8('0x16')]){if(_0x4680eb[_0x01a8('0x16')][_0x01a8('0x17')]===0x1f4){logger[_0x01a8('0x16')](_0x01a8('0x12'),_0x437e0f,_0x4680eb[_0x01a8('0x16')][_0x01a8('0x18')]);return _0x3bf0b0(_0x4680eb[_0x01a8('0x16')]['message']);}logger['error'](_0x01a8('0x12'),_0x437e0f,_0x4680eb[_0x01a8('0x16')][_0x01a8('0x18')]);return _0x67643b(_0x4680eb['error'][_0x01a8('0x18')]);}else{logger[_0x01a8('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x437e0f,_0x01a8('0x13'));_0x67643b(_0x4680eb[_0x01a8('0x19')][_0x01a8('0x18')]);}})['catch'](function(_0x52e0ee){logger[_0x01a8('0x16')](_0x01a8('0x12'),_0x437e0f,_0x52e0ee);_0x3bf0b0(_0x52e0ee);});});}exports[_0x01a8('0x1a')]=function(_0x47e1e0){var _0x27ef7b=this;return new Promise(function(_0x4e1688,_0x105e1f){return db[_0x01a8('0x1b')][_0x01a8('0x1c')](_0x47e1e0[_0x01a8('0x1d')],{'raw':_0x47e1e0[_0x01a8('0x1e')]?_0x47e1e0[_0x01a8('0x1e')][_0x01a8('0x1f')]===undefined?!![]:![]:!![]})[_0x01a8('0x10')](function(_0x2b22dd){logger[_0x01a8('0x11')](_0x01a8('0x1a'),_0x47e1e0);logger[_0x01a8('0x14')](_0x01a8('0x1a'),_0x47e1e0,JSON[_0x01a8('0x15')](_0x2b22dd));_0x4e1688(_0x2b22dd);})[_0x01a8('0x20')](function(_0x561e17){logger[_0x01a8('0x16')](_0x01a8('0x1a'),_0x561e17[_0x01a8('0x18')],_0x47e1e0);_0x105e1f(_0x27ef7b['error'](0x1f4,_0x561e17[_0x01a8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 69400be..9a9daae 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 _0xc42b=['update','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xc42b,0xb8));var _0xbc42=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc42b[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappMessageEvents=require(_0xbc42('0x0'));var events=[_0xbc42('0x1'),'remove',_0xbc42('0x2')];function createListener(_0x1ab0b8,_0x1006a4){return function(_0x1edf0e){_0x1006a4['emit'](_0x1ab0b8,_0x1edf0e);};}function removeListener(_0x11904c,_0x5c789f){return function(){WhatsappMessageEvents['removeListener'](_0x11904c,_0x5c789f);};}exports[_0xbc42('0x3')]=function(_0x33fde1){for(var _0xe305c7=0x0,_0x4a2930=events[_0xbc42('0x4')];_0xe305c7<_0x4a2930;_0xe305c7++){var _0x3e4071=events[_0xe305c7];var _0x3ba5bf=createListener(_0xbc42('0x5')+_0x3e4071,_0x33fde1);WhatsappMessageEvents['on'](_0x3e4071,_0x3ba5bf);}}; \ No newline at end of file +var _0x0aad=['register','length','whatsappMessage:','./whatsappMessage.events','save','remove','update'];(function(_0x953fb9,_0x158641){var _0x45a400=function(_0x2638bc){while(--_0x2638bc){_0x953fb9['push'](_0x953fb9['shift']());}};_0x45a400(++_0x158641);}(_0x0aad,0x1bc));var _0xd0aa=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0aad[_0x4a9fb1];return _0x348672;};'use strict';var WhatsappMessageEvents=require(_0xd0aa('0x0'));var events=[_0xd0aa('0x1'),_0xd0aa('0x2'),_0xd0aa('0x3')];function createListener(_0x21b649,_0x55cbff){return function(_0x21f45d){_0x55cbff['emit'](_0x21b649,_0x21f45d);};}function removeListener(_0x4ae583,_0x4de2f9){return function(){WhatsappMessageEvents['removeListener'](_0x4ae583,_0x4de2f9);};}exports[_0xd0aa('0x4')]=function(_0x28e1f5){for(var _0x3ad679=0x0,_0x242a71=events[_0xd0aa('0x5')];_0x3ad679<_0x242a71;_0x3ad679++){var _0x16ac43=events[_0x3ad679];var _0x179df8=createListener(_0xd0aa('0x6')+_0x16ac43,_0x28e1f5);WhatsappMessageEvents['on'](_0x16ac43,_0x179df8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 36d8457..ff167a7 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 _0x05ef=['/:id/users','create','addTeams','post','put','/:id','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappQueue.controller','index','get','/describe','isAuthenticated','show','/:id/teams','getTeams'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x05ef,0x1d1));var _0xf05e=function(_0x445ff7,_0x2f90be){_0x445ff7=_0x445ff7-0x0;var _0x4f38fe=_0x05ef[_0x445ff7];return _0x4f38fe;};'use strict';var multer=require(_0xf05e('0x0'));var util=require(_0xf05e('0x1'));var path=require(_0xf05e('0x2'));var timeout=require(_0xf05e('0x3'));var express=require(_0xf05e('0x4'));var router=express['Router']();var fs_extra=require(_0xf05e('0x5'));var auth=require(_0xf05e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf05e('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf05e('0x8')]);router[_0xf05e('0x9')](_0xf05e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xf05e('0x9')]('/:id',auth[_0xf05e('0xb')](),controller[_0xf05e('0xc')]);router[_0xf05e('0x9')]('/:id/members',auth[_0xf05e('0xb')](),controller['getMembers']);router['get'](_0xf05e('0xd'),auth['isAuthenticated'](),controller[_0xf05e('0xe')]);router[_0xf05e('0x9')](_0xf05e('0xf'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xf05e('0x10')]);router['post'](_0xf05e('0xd'),auth[_0xf05e('0xb')](),controller[_0xf05e('0x11')]);router[_0xf05e('0x12')](_0xf05e('0xf'),auth[_0xf05e('0xb')](),controller['addAgents']);router[_0xf05e('0x13')](_0xf05e('0x14'),auth[_0xf05e('0xb')](),controller['update']);router[_0xf05e('0x15')](_0xf05e('0x14'),auth[_0xf05e('0xb')](),controller[_0xf05e('0x16')]);router[_0xf05e('0x15')](_0xf05e('0xd'),auth[_0xf05e('0xb')](),controller['removeTeams']);router[_0xf05e('0x15')]('/:id/users',auth['isAuthenticated'](),controller[_0xf05e('0x17')]);module['exports']=router; \ No newline at end of file +var _0xbedb=['getAgents','create','post','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','show','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x1d1f93,_0x27b0d7){var _0x2de1a5=function(_0x550c53){while(--_0x550c53){_0x1d1f93['push'](_0x1d1f93['shift']());}};_0x2de1a5(++_0x27b0d7);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xbbed('0x0'));var util=require('util');var path=require(_0xbbed('0x1'));var timeout=require(_0xbbed('0x2'));var express=require(_0xbbed('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbbed('0x4'));var interaction=require(_0xbbed('0x5'));var config=require(_0xbbed('0x6'));var controller=require(_0xbbed('0x7'));router[_0xbbed('0x8')]('/',auth[_0xbbed('0x9')](),controller[_0xbbed('0xa')]);router[_0xbbed('0x8')](_0xbbed('0xb'),auth[_0xbbed('0x9')](),controller['describe']);router[_0xbbed('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbbed('0xc')]);router[_0xbbed('0x8')](_0xbbed('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbbed('0x8')](_0xbbed('0xe'),auth[_0xbbed('0x9')](),controller[_0xbbed('0xf')]);router[_0xbbed('0x8')](_0xbbed('0x10'),auth['isAuthenticated'](),controller[_0xbbed('0x11')]);router['post']('/',auth[_0xbbed('0x9')](),controller[_0xbbed('0x12')]);router[_0xbbed('0x13')](_0xbbed('0xe'),auth[_0xbbed('0x9')](),controller[_0xbbed('0x14')]);router[_0xbbed('0x13')](_0xbbed('0x10'),auth[_0xbbed('0x9')](),controller[_0xbbed('0x15')]);router['put'](_0xbbed('0x16'),auth['isAuthenticated'](),controller[_0xbbed('0x17')]);router[_0xbbed('0x18')](_0xbbed('0x16'),auth[_0xbbed('0x9')](),controller[_0xbbed('0x19')]);router['delete'](_0xbbed('0xe'),auth[_0xbbed('0x9')](),controller[_0xbbed('0x1a')]);router[_0xbbed('0x18')](_0xbbed('0x10'),auth[_0xbbed('0x9')](),controller[_0xbbed('0x1b')]);module[_0xbbed('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index a400096..34a1160 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 _0xf874=['ENUM','rrmemory','beepall','STRING','name','INTEGER'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xf874,0xed));var _0x4f87=function(_0xa457d3,_0x1b1b2d){_0xa457d3=_0xa457d3-0x0;var _0x16e740=_0xf874[_0xa457d3];return _0x16e740;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4f87('0x0')],'unique':_0x4f87('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4f87('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f87('0x3')](_0x4f87('0x4'),_0x4f87('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x4f87('0x0')]}}; \ No newline at end of file +var _0x23a8=['exports','name','ENUM','rrmemory','roundrobin'];(function(_0x3f5a57,_0x3fd20d){var _0x35f0e1=function(_0x37391f){while(--_0x37391f){_0x3f5a57['push'](_0x3f5a57['shift']());}};_0x35f0e1(++_0x3fd20d);}(_0x23a8,0x172));var _0x823a=function(_0x30a5b9,_0x2ad854){_0x30a5b9=_0x30a5b9-0x0;var _0x4fd7e3=_0x23a8[_0x30a5b9];return _0x4fd7e3;};'use strict';var Sequelize=require('sequelize');module[_0x823a('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x823a('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x823a('0x2')](_0x823a('0x3'),'beepall',_0x823a('0x4'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 23c653e..e7ff422 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 _0x9d31=['compact','value','transaction','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','isArray','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','WhatsappQueues','UserProfileResource','name','send','index','map','WhatsappQueue','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','rawAttributes','filters','intersection','attributes','model','fields','length','merge','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','describe','findOne','UserWhatsappQueue','hasOwnProperty','nolimit','sort','WhatsappQueueId','filter','options','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','getTeams','order','pick','addTeams','ids','Team','Agents','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','union'];(function(_0x3907bc,_0x51fdcd){var _0x3398f3=function(_0x4db6f2){while(--_0x4db6f2){_0x3907bc['push'](_0x3907bc['shift']());}};_0x3398f3(++_0x51fdcd);}(_0x9d31,0x82));var _0x19d3=function(_0x560535,_0x334309){_0x560535=_0x560535-0x0;var _0x405240=_0x9d31[_0x560535];return _0x405240;};'use strict';var BPromise=require(_0x19d3('0x0'));var util=require('util');var _=require(_0x19d3('0x1'));var squel=require(_0x19d3('0x2'));var Redis=require(_0x19d3('0x3'));var qs=require(_0x19d3('0x4'));var logger=require(_0x19d3('0x5'))(_0x19d3('0x6'));var config=require(_0x19d3('0x7'));var db=require(_0x19d3('0x8'))['db'];config[_0x19d3('0x9')]=_['defaults'](config[_0x19d3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x19d3('0xa'))(new Redis(config[_0x19d3('0x9')]));require(_0x19d3('0xb'))['register'](socket);function respondWithStatusCode(_0x79f78d,_0x15b446){_0x15b446=_0x15b446||0xcc;return function(_0x937e9e){if(_0x937e9e){return _0x79f78d[_0x19d3('0xc')](_0x15b446);}return _0x79f78d[_0x19d3('0xd')](_0x15b446)[_0x19d3('0xe')]();};}function respondWithResult(_0x343f00,_0x9f7dcc){_0x9f7dcc=_0x9f7dcc||0xc8;return function(_0x20b359){if(_0x20b359){return _0x343f00['status'](_0x9f7dcc)['json'](_0x20b359);}};}function respondWithFilteredResult(_0xf9e4d5,_0x385692){return function(_0x5c68ce){if(_0x5c68ce){var _0x3f0c68=typeof _0x385692[_0x19d3('0xf')]===_0x19d3('0x10')&&typeof _0x385692[_0x19d3('0x11')]===_0x19d3('0x10');var _0x2cfa2c=_0x5c68ce[_0x19d3('0x12')];var _0x1cf34e=_0x3f0c68?0x0:_0x385692[_0x19d3('0xf')];var _0x33929f=_0x3f0c68?_0x5c68ce[_0x19d3('0x12')]:_0x385692[_0x19d3('0xf')]+_0x385692[_0x19d3('0x11')];var _0x52f93f;if(_0x33929f>=_0x2cfa2c){_0x33929f=_0x2cfa2c;_0x52f93f=0xc8;}else{_0x52f93f=0xce;}_0xf9e4d5[_0x19d3('0xd')](_0x52f93f);return _0xf9e4d5[_0x19d3('0x13')](_0x19d3('0x14'),_0x1cf34e+'-'+_0x33929f+'/'+_0x2cfa2c)[_0x19d3('0x15')](_0x5c68ce);}return null;};}function saveUpdates(_0x2d598d){return function(_0x565415){if(_0x565415){return _0x565415[_0x19d3('0x16')](_0x2d598d)[_0x19d3('0x17')](function(_0x12f1bf){return _0x12f1bf;});}return null;};}function removeEntity(_0x2eb8e8){return function(_0x5c5e17){if(_0x5c5e17){return _0x5c5e17[_0x19d3('0x18')]()[_0x19d3('0x17')](function(){var _0x5a4d42=_0x5c5e17['get']({'plain':!![]});var _0x12ce94=_0x19d3('0x19');return db[_0x19d3('0x1a')][_0x19d3('0x18')]({'where':{'type':_0x12ce94,'resourceId':_0x5a4d42['id']}})[_0x19d3('0x17')](function(){return _0x5c5e17;});})[_0x19d3('0x17')](function(){_0x2eb8e8[_0x19d3('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f337){return function(_0x17efa4){if(!_0x17efa4){_0x23f337['sendStatus'](0x194);}return _0x17efa4;};}function handleError(_0x4ee159,_0x2491cf){_0x2491cf=_0x2491cf||0x1f4;return function(_0x3d5272){logger['error'](_0x3d5272['stack']);if(_0x3d5272[_0x19d3('0x1b')]){delete _0x3d5272[_0x19d3('0x1b')];}_0x4ee159['status'](_0x2491cf)[_0x19d3('0x1c')](_0x3d5272);};}exports[_0x19d3('0x1d')]=function(_0x3e58ce,_0x29f5c2){var _0x1c6891={};var _0x1b3fe8={'count':0x0,'rows':[]};var _0x322045=_[_0x19d3('0x1e')](db[_0x19d3('0x1f')]['rawAttributes'],function(_0x2cf24c){return{'name':_0x2cf24c[_0x19d3('0x20')],'type':_0x2cf24c[_0x19d3('0x21')][_0x19d3('0x22')]};});_0x1c6891=qs[_0x19d3('0x23')](_0x322045,_0x3e58ce);var _0x3a2350={'where':_0x1c6891[_0x19d3('0x24')]};return db[_0x19d3('0x1f')][_0x19d3('0x12')](_0x3a2350)[_0x19d3('0x17')](function(_0x540a09){_0x1b3fe8[_0x19d3('0x12')]=_0x540a09;_0x1c6891[_0x19d3('0x25')]=qs[_0x19d3('0x25')](_0x3e58ce[_0x19d3('0x26')]);return db[_0x19d3('0x1f')][_0x19d3('0x27')](_0x1c6891);})[_0x19d3('0x17')](function(_0x32a77c){_0x1b3fe8[_0x19d3('0x28')]=_0x32a77c;return _0x1b3fe8;})[_0x19d3('0x17')](respondWithFilteredResult(_0x29f5c2,_0x1c6891))[_0x19d3('0x29')](handleError(_0x29f5c2,null));};exports[_0x19d3('0x2a')]=function(_0x4edbc1,_0x463638){var _0x456628={'raw':!![],'where':{'id':_0x4edbc1[_0x19d3('0x2b')]['id']}},_0x41c277={};_0x41c277['model']=_[_0x19d3('0x2c')](db[_0x19d3('0x1f')][_0x19d3('0x2d')]);_0x41c277['query']=_[_0x19d3('0x2c')](_0x4edbc1['query']);_0x41c277[_0x19d3('0x2e')]=_[_0x19d3('0x2f')](_0x41c277['model'],_0x41c277['query']);_0x456628[_0x19d3('0x30')]=_[_0x19d3('0x2f')](_0x41c277[_0x19d3('0x31')],qs[_0x19d3('0x32')](_0x4edbc1[_0x19d3('0x26')][_0x19d3('0x32')]));_0x456628[_0x19d3('0x30')]=_0x456628[_0x19d3('0x30')][_0x19d3('0x33')]?_0x456628['attributes']:_0x41c277[_0x19d3('0x31')];if(_0x4edbc1['query']['includeAll']){_0x456628[_0x19d3('0x25')]=[{'all':!![]}];}_0x456628=_[_0x19d3('0x34')]({},_0x456628,_0x4edbc1['options']);return db[_0x19d3('0x1f')][_0x19d3('0x35')](_0x456628)[_0x19d3('0x17')](handleEntityNotFound(_0x463638,null))[_0x19d3('0x17')](respondWithResult(_0x463638,null))[_0x19d3('0x29')](handleError(_0x463638,null));};exports['create']=function(_0x490276,_0x1b4ce1){return db['WhatsappQueue'][_0x19d3('0x36')](_0x490276[_0x19d3('0x37')],{})[_0x19d3('0x17')](function(_0x104d1b){var _0x37c8c1=_0x490276['user'][_0x19d3('0x38')]({'plain':!![]});if(!_0x37c8c1)throw new Error(_0x19d3('0x39'));if(_0x37c8c1[_0x19d3('0x3a')]===_0x19d3('0x3b')){var _0x317462=_0x104d1b[_0x19d3('0x38')]({'plain':!![]});var _0x56ee85=_0x19d3('0x19');return db[_0x19d3('0x3c')][_0x19d3('0x35')]({'where':{'name':_0x56ee85,'userProfileId':_0x37c8c1[_0x19d3('0x3d')]},'raw':!![]})[_0x19d3('0x17')](function(_0x3f9a18){if(_0x3f9a18&&_0x3f9a18[_0x19d3('0x3e')]===0x0){return db['UserProfileResource'][_0x19d3('0x36')]({'name':_0x317462[_0x19d3('0x1b')],'resourceId':_0x317462['id'],'type':_0x3f9a18[_0x19d3('0x1b')],'sectionId':_0x3f9a18['id']},{})[_0x19d3('0x17')](function(){return _0x104d1b;});}else{return _0x104d1b;}})['catch'](function(_0x15831d){logger[_0x19d3('0x3f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15831d);throw _0x15831d;});}return _0x104d1b;})[_0x19d3('0x17')](respondWithResult(_0x1b4ce1,0xc9))['catch'](handleError(_0x1b4ce1,null));};exports[_0x19d3('0x16')]=function(_0x4e2b24,_0x395f08){if(_0x4e2b24[_0x19d3('0x37')]['id']){delete _0x4e2b24[_0x19d3('0x37')]['id'];}return db[_0x19d3('0x1f')][_0x19d3('0x35')]({'where':{'id':_0x4e2b24[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x395f08,null))[_0x19d3('0x17')](saveUpdates(_0x4e2b24[_0x19d3('0x37')],null))[_0x19d3('0x17')](respondWithResult(_0x395f08,null))[_0x19d3('0x29')](handleError(_0x395f08,null));};exports[_0x19d3('0x18')]=function(_0x293565,_0x58d751){return db['WhatsappQueue'][_0x19d3('0x35')]({'where':{'id':_0x293565[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x58d751,null))[_0x19d3('0x17')](removeEntity(_0x58d751,null))[_0x19d3('0x29')](handleError(_0x58d751,null));};exports[_0x19d3('0x40')]=function(_0x52f743,_0x53da7d){return db[_0x19d3('0x1f')][_0x19d3('0x40')]()['then'](respondWithResult(_0x53da7d,null))['catch'](handleError(_0x53da7d,null));};exports['getMembers']=function(_0x20e525,_0x4a0725){var _0x24268c={'raw':!![],'where':{}},_0x404437={},_0x1b51e0;return db[_0x19d3('0x1f')][_0x19d3('0x41')]({'where':{'id':_0x20e525[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x4a0725,null))[_0x19d3('0x17')](function(_0x4e5fe2){if(_0x4e5fe2){_0x1b51e0=_0x4e5fe2[_0x19d3('0x38')]({'plain':!![]});_0x404437[_0x19d3('0x31')]=_['keys'](db[_0x19d3('0x42')][_0x19d3('0x2d')]);_0x404437['query']=_[_0x19d3('0x2c')](_0x20e525[_0x19d3('0x26')]);_0x404437[_0x19d3('0x2e')]=_['intersection'](_0x404437[_0x19d3('0x31')],_0x404437['query']);_0x24268c['attributes']=_['intersection'](_0x404437['model'],qs['fields'](_0x20e525[_0x19d3('0x26')][_0x19d3('0x32')]));_0x24268c[_0x19d3('0x30')]=_0x24268c[_0x19d3('0x30')][_0x19d3('0x33')]?_0x24268c[_0x19d3('0x30')]:_0x404437['model'];if(!_0x20e525[_0x19d3('0x26')][_0x19d3('0x43')](_0x19d3('0x44'))){_0x24268c['limit']=qs[_0x19d3('0x11')](_0x20e525['query'][_0x19d3('0x11')]);_0x24268c[_0x19d3('0xf')]=qs[_0x19d3('0xf')](_0x20e525[_0x19d3('0x26')][_0x19d3('0xf')]);}_0x24268c['order']=qs['sort'](_0x20e525[_0x19d3('0x26')][_0x19d3('0x45')]);_0x24268c[_0x19d3('0x24')]=qs[_0x19d3('0x2e')](_['pick'](_0x20e525[_0x19d3('0x26')],_0x404437[_0x19d3('0x2e')]));_0x24268c[_0x19d3('0x24')][_0x19d3('0x46')]=_0x4e5fe2['id'];if(_0x20e525['query'][_0x19d3('0x47')]){_0x24268c['where']=_['merge'](_0x24268c[_0x19d3('0x24')],{'$or':_['map'](_0x24268c[_0x19d3('0x30')],function(_0x1d5d0d){var _0x412a05={};_0x412a05[_0x1d5d0d]={'$like':'%'+_0x20e525[_0x19d3('0x26')][_0x19d3('0x47')]+'%'};return _0x412a05;})});}_0x24268c=_['merge']({},_0x24268c,_0x20e525[_0x19d3('0x48')]);return db[_0x19d3('0x42')][_0x19d3('0x27')](_0x24268c);}})[_0x19d3('0x17')](function(_0x57197b){if(_0x57197b){return db[_0x19d3('0x49')][_0x19d3('0x4a')]({'where':{'id':_[_0x19d3('0x1e')](_0x57197b,_0x19d3('0x4b')),'role':_0x19d3('0x4c')},'attributes':['id',_0x19d3('0x1b'),_0x19d3('0x4d'),_0x19d3('0x4e'),_0x19d3('0x4f')]});}})[_0x19d3('0x17')](function(_0x132b5c){if(_0x132b5c){return{'count':_0x132b5c[_0x19d3('0x12')],'rows':_[_0x19d3('0x1e')](_0x132b5c[_0x19d3('0x28')],function(_0x3a23c1){return{'membername':_0x3a23c1[_0x19d3('0x1b')],'UserId':_0x3a23c1['id'],'queue_name':_0x1b51e0[_0x19d3('0x1b')],'WhatsappQueueId':_0x1b51e0['id'],'interface':util[_0x19d3('0x50')](_0x19d3('0x51'),'SIP',_0x3a23c1[_0x19d3('0x1b')]),'penalty':0x0,'paused':_0x3a23c1['whatsappPause'],'createdAt':_0x3a23c1['createdAt'],'updatedAt':_0x3a23c1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x19d3('0x17')](respondWithFilteredResult(_0x4a0725,_0x24268c))[_0x19d3('0x29')](handleError(_0x4a0725,null));};exports[_0x19d3('0x52')]=function(_0x338b29,_0xef0439){var _0x3ac3b5={};var _0x2be736={};var _0x108f23;var _0x554772;return db[_0x19d3('0x1f')][_0x19d3('0x41')]({'where':{'id':_0x338b29[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0xef0439,null))['then'](function(_0x20b806){if(_0x20b806){_0x108f23=_0x20b806;_0x2be736['model']=_[_0x19d3('0x2c')](db['Team']['rawAttributes']);_0x2be736[_0x19d3('0x26')]=_['keys'](_0x338b29[_0x19d3('0x26')]);_0x2be736[_0x19d3('0x2e')]=_[_0x19d3('0x2f')](_0x2be736['model'],_0x2be736['query']);_0x3ac3b5['attributes']=_[_0x19d3('0x2f')](_0x2be736['model'],qs[_0x19d3('0x32')](_0x338b29[_0x19d3('0x26')][_0x19d3('0x32')]));_0x3ac3b5[_0x19d3('0x30')]=_0x3ac3b5['attributes']['length']?_0x3ac3b5[_0x19d3('0x30')]:_0x2be736[_0x19d3('0x31')];_0x3ac3b5[_0x19d3('0x53')]=qs[_0x19d3('0x45')](_0x338b29[_0x19d3('0x26')][_0x19d3('0x45')]);_0x3ac3b5[_0x19d3('0x24')]=qs['filters'](_[_0x19d3('0x54')](_0x338b29['query'],_0x2be736['filters']));if(_0x338b29['query'][_0x19d3('0x47')]){_0x3ac3b5[_0x19d3('0x24')]=_['merge'](_0x3ac3b5[_0x19d3('0x24')],{'$or':_['map'](_0x3ac3b5[_0x19d3('0x30')],function(_0x2f9216){var _0x9ecda0={};_0x9ecda0[_0x2f9216]={'$like':'%'+_0x338b29['query'][_0x19d3('0x47')]+'%'};return _0x9ecda0;})});}_0x3ac3b5=_['merge']({},_0x3ac3b5,_0x338b29[_0x19d3('0x48')]);return _0x108f23[_0x19d3('0x52')](_0x3ac3b5);}})[_0x19d3('0x17')](function(_0x501d97){if(_0x501d97){_0x554772=_0x501d97[_0x19d3('0x33')];if(!_0x338b29[_0x19d3('0x26')]['hasOwnProperty'](_0x19d3('0x44'))){_0x3ac3b5[_0x19d3('0x11')]=qs[_0x19d3('0x11')](_0x338b29[_0x19d3('0x26')][_0x19d3('0x11')]);_0x3ac3b5[_0x19d3('0xf')]=qs[_0x19d3('0xf')](_0x338b29[_0x19d3('0x26')][_0x19d3('0xf')]);}return _0x108f23[_0x19d3('0x52')](_0x3ac3b5);}})[_0x19d3('0x17')](function(_0x1b5929){if(_0x1b5929){return _0x1b5929?{'count':_0x554772,'rows':_0x1b5929}:null;}})[_0x19d3('0x17')](respondWithResult(_0xef0439,null))['catch'](handleError(_0xef0439,null));};exports[_0x19d3('0x55')]=function(_0x2f2c23,_0x106c03){var _0xd6f310=_0x2f2c23[_0x19d3('0x37')][_0x19d3('0x56')];return db[_0x19d3('0x57')]['findAll']({'where':{'id':_0xd6f310},'attributes':['id'],'include':[{'model':db[_0x19d3('0x49')],'as':_0x19d3('0x58'),'attributes':['id',_0x19d3('0x1b'),'online','voicePause',_0x19d3('0x59')],'raw':!![]}]})[_0x19d3('0x17')](function(_0x357456){if(_0x357456){var _0x49ac2a=_[_0x19d3('0x5a')](_0x357456,function(_0x459351){var _0x55cf3b=_0x459351[_0x19d3('0x38')]({'plain':!![]});return _0x55cf3b['Agents'];});return db[_0x19d3('0x1f')][_0x19d3('0x35')]({'where':{'id':_0x2f2c23[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](function(_0x2971e5){return db[_0x19d3('0x5b')]['transaction'](function(_0x330d40){return _0x2971e5[_0x19d3('0x55')](_0xd6f310,{'transaction':_0x330d40})[_0x19d3('0x17')](function(){return BPromise[_0x19d3('0x5c')](_0x49ac2a,function(_0xb7b9fa){return db['UserWhatsappQueue'][_0x19d3('0x5d')]({'where':{'UserId':_0xb7b9fa['id'],'WhatsappQueueId':_0x2f2c23['params']['id']},'transaction':_0x330d40});});})['then'](function(){_0x49ac2a[_0x19d3('0x5e')](function(_0x165880){socket[_0x19d3('0x5f')](_0x19d3('0x60'),{'UserId':_0x165880['id'],'WhatsappQueueId':_0x2971e5['id']});});});});});}})[_0x19d3('0x17')](respondWithStatusCode(_0x106c03,null))[_0x19d3('0x29')](handleError(_0x106c03,null));};exports[_0x19d3('0x61')]=function(_0x32a909,_0x43cf1a){return db[_0x19d3('0x57')][_0x19d3('0x27')]({'where':{'id':_0x32a909[_0x19d3('0x26')][_0x19d3('0x56')]},'attributes':['id'],'include':[{'model':db[_0x19d3('0x49')],'as':_0x19d3('0x58'),'attributes':['id'],'raw':!![]}]})[_0x19d3('0x17')](handleEntityNotFound(_0x43cf1a,null))[_0x19d3('0x17')](function(_0x361bb6){var _0x323960=_[_0x19d3('0x1e')](_0x361bb6,'id');var _0x4b1103=[];var _0xa1bc5f=[];var _0x116670=squel[_0x19d3('0x62')]();_0x116670['field'](_0x19d3('0x63'))[_0x19d3('0x64')](_0x19d3('0x65'),'tq')[_0x19d3('0x66')]('user_has_teams','ut',_0x19d3('0x67'))[_0x19d3('0x24')](_0x19d3('0x68'),_0x32a909['params']['id']);for(var _0x5b719d=0x0;_0x5b719d<_0x361bb6[_0x19d3('0x33')];_0x5b719d+=0x1){let _0x55cfb7=_0x361bb6[_0x5b719d];for(var _0x13bc33=0x0;_0x13bc33<_0x55cfb7[_0x19d3('0x58')]['length'];_0x13bc33+=0x1){let _0x533720=_0x55cfb7[_0x19d3('0x58')][_0x13bc33];var _0x3bc206=_0x116670[_0x19d3('0x69')]();_0x3bc206[_0x19d3('0x24')](_0x19d3('0x6a'),_0x533720['id']);_0xa1bc5f['push'](db[_0x19d3('0x5b')][_0x19d3('0x26')](_0x3bc206[_0x19d3('0x6b')](),{'type':db[_0x19d3('0x5b')]['QueryTypes'][_0x19d3('0x6c')]})[_0x19d3('0x17')](function(_0x442122){if(_0x442122['length']===0x1){return _0x533720['id'];}else{var _0x35cf95=_[_0x19d3('0x6d')](_['map'](_0x442122,'TeamId'),function(_0x4c801b){return _[_0x19d3('0x6e')](_0x323960,_0x4c801b);});if(_0x35cf95){return _0x533720['id'];}}}));}}return BPromise['all'](_0xa1bc5f)['then'](function(_0x4d5246){_0x4b1103=_(_0x4b1103)[_0x19d3('0x6f')](_0x4d5246)[_0x19d3('0x70')]()[_0x19d3('0x71')]();return db['WhatsappQueue'][_0x19d3('0x35')]({'where':{'id':_0x32a909['params']['id']}})[_0x19d3('0x17')](function(_0x5b92b6){return db['sequelize'][_0x19d3('0x72')](function(_0x45d806){return _0x5b92b6['removeTeams'](_0x32a909[_0x19d3('0x26')][_0x19d3('0x56')],{'transaction':_0x45d806})[_0x19d3('0x17')](function(){if(!_[_0x19d3('0x73')](_0x4b1103)){return _0x5b92b6[_0x19d3('0x74')](_0x4b1103,{'transaction':_0x45d806});}})['then'](function(){_0x4b1103['forEach'](function(_0x3e9a4e){socket[_0x19d3('0x5f')](_0x19d3('0x75'),{'UserId':_0x3e9a4e,'WhatsappQueueId':_0x5b92b6['id']});});});});});});})[_0x19d3('0x17')](respondWithStatusCode(_0x43cf1a,null))[_0x19d3('0x29')](handleError(_0x43cf1a,null));};exports[_0x19d3('0x76')]=function(_0x295d3d,_0x4476a8){return db[_0x19d3('0x1f')][_0x19d3('0x35')]({'where':{'id':_0x295d3d['params']['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x4476a8,null))[_0x19d3('0x17')](function(_0x5bde14){if(_0x5bde14){return _0x5bde14[_0x19d3('0x76')](_0x295d3d[_0x19d3('0x37')][_0x19d3('0x56')],_['omit'](_0x295d3d[_0x19d3('0x37')],[_0x19d3('0x56'),'id'])||{})['spread'](function(_0x1116ff){for(var _0x4c3f8f=0x0;_0x4c3f8f<_0x295d3d[_0x19d3('0x37')][_0x19d3('0x56')]['length'];_0x4c3f8f+=0x1){socket[_0x19d3('0x5f')](_0x19d3('0x60'),{'UserId':Number(_0x295d3d[_0x19d3('0x37')]['ids'][_0x4c3f8f]),'WhatsappQueueId':Number(_0x295d3d['params']['id'])});}return _0x1116ff;});}})[_0x19d3('0x17')](respondWithResult(_0x4476a8,null))['catch'](handleError(_0x4476a8,null));};exports[_0x19d3('0x74')]=function(_0x1cffe2,_0x2d0bed){return db[_0x19d3('0x1f')][_0x19d3('0x35')]({'where':{'id':_0x1cffe2[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x2d0bed,null))['then'](function(_0x3ee477){if(_0x3ee477){return _0x3ee477['removeAgents'](_0x1cffe2['query'][_0x19d3('0x56')])[_0x19d3('0x17')](function(){if(_[_0x19d3('0x77')](_0x1cffe2[_0x19d3('0x26')][_0x19d3('0x56')])){for(var _0x2997e3=0x0;_0x2997e3<_0x1cffe2[_0x19d3('0x26')][_0x19d3('0x56')][_0x19d3('0x33')];_0x2997e3+=0x1){socket[_0x19d3('0x5f')](_0x19d3('0x75'),{'UserId':Number(_0x1cffe2[_0x19d3('0x26')][_0x19d3('0x56')][_0x2997e3]),'WhatsappQueueId':Number(_0x1cffe2[_0x19d3('0x2b')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1cffe2['query'][_0x19d3('0x56')]),'WhatsappQueueId':Number(_0x1cffe2[_0x19d3('0x2b')]['id'])});}});}})[_0x19d3('0x17')](respondWithStatusCode(_0x2d0bed,null))[_0x19d3('0x29')](handleError(_0x2d0bed,null));};exports[_0x19d3('0x78')]=function(_0x3fba9d,_0x133122){var _0x36c3da={};var _0x21999f={};var _0x3ba486;var _0x4a983f;return db['WhatsappQueue'][_0x19d3('0x41')]({'where':{'id':_0x3fba9d[_0x19d3('0x2b')]['id']}})[_0x19d3('0x17')](handleEntityNotFound(_0x133122,null))['then'](function(_0x3db8d7){if(_0x3db8d7){_0x3ba486=_0x3db8d7;_0x21999f[_0x19d3('0x31')]=_[_0x19d3('0x2c')](db[_0x19d3('0x49')][_0x19d3('0x2d')]);_0x21999f[_0x19d3('0x26')]=_[_0x19d3('0x2c')](_0x3fba9d['query']);_0x21999f[_0x19d3('0x2e')]=_[_0x19d3('0x2f')](_0x21999f['model'],_0x21999f[_0x19d3('0x26')]);_0x36c3da[_0x19d3('0x30')]=_[_0x19d3('0x2f')](_0x21999f[_0x19d3('0x31')],qs['fields'](_0x3fba9d[_0x19d3('0x26')][_0x19d3('0x32')]));_0x36c3da[_0x19d3('0x30')]=_0x36c3da[_0x19d3('0x30')][_0x19d3('0x33')]?_0x36c3da[_0x19d3('0x30')]:_0x21999f[_0x19d3('0x31')];_0x36c3da['order']=qs[_0x19d3('0x45')](_0x3fba9d[_0x19d3('0x26')][_0x19d3('0x45')]);_0x36c3da[_0x19d3('0x24')]=qs['filters'](_[_0x19d3('0x54')](_0x3fba9d[_0x19d3('0x26')],_0x21999f[_0x19d3('0x2e')]));if(_0x3fba9d[_0x19d3('0x26')][_0x19d3('0x47')]){_0x36c3da[_0x19d3('0x24')]=_['merge'](_0x36c3da['where'],{'$or':_['map'](_0x36c3da[_0x19d3('0x30')],function(_0x4c6c72){var _0x1723a2={};_0x1723a2[_0x4c6c72]={'$like':'%'+_0x3fba9d[_0x19d3('0x26')][_0x19d3('0x47')]+'%'};return _0x1723a2;})});}_0x36c3da=_[_0x19d3('0x34')]({},_0x36c3da,_0x3fba9d[_0x19d3('0x48')]);return _0x3ba486['getAgents'](_0x36c3da);}})[_0x19d3('0x17')](function(_0x515949){if(_0x515949){_0x4a983f=_0x515949[_0x19d3('0x33')];if(!_0x3fba9d[_0x19d3('0x26')][_0x19d3('0x43')](_0x19d3('0x44'))){_0x36c3da[_0x19d3('0x11')]=qs[_0x19d3('0x11')](_0x3fba9d[_0x19d3('0x26')]['limit']);_0x36c3da[_0x19d3('0xf')]=qs[_0x19d3('0xf')](_0x3fba9d[_0x19d3('0x26')][_0x19d3('0xf')]);}return _0x3ba486[_0x19d3('0x78')](_0x36c3da);}})['then'](function(_0x4efec5){if(_0x4efec5){return _0x4efec5?{'count':_0x4a983f,'rows':_0x4efec5}:null;}})['then'](respondWithResult(_0x133122,null))[_0x19d3('0x29')](handleError(_0x133122,null));}; \ No newline at end of file +var _0xb0ea=['offset','undefined','count','limit','Content-Range','then','get','WhatsappQueues','UserProfileResource','destroy','sendStatus','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','findAll','catch','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','options','find','create','body','user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','hasOwnProperty','nolimit','sort','pick','WhatsappQueueId','merge','filter','UserWhatsappQueue','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','removeTeams','ids','select','field','team_has_whatsapp_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','union','value','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','emit','userWhatsappQueue:save','removeAgents','getAgents','util','lodash','ioredis','api','../../config/environment','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','status','end','json'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xb0ea,0xe7));var _0xab0e=function(_0x11c331,_0x523ccf){_0x11c331=_0x11c331-0x0;var _0x1b89e1=_0xb0ea[_0x11c331];return _0x1b89e1;};'use strict';var BPromise=require('bluebird');var util=require(_0xab0e('0x0'));var _=require(_0xab0e('0x1'));var squel=require('squel');var Redis=require(_0xab0e('0x2'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xab0e('0x3'));var config=require(_0xab0e('0x4'));var db=require(_0xab0e('0x5'))['db'];config[_0xab0e('0x6')]=_['defaults'](config[_0xab0e('0x6')],{'host':_0xab0e('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab0e('0x6')]));require(_0xab0e('0x8'))[_0xab0e('0x9')](socket);function respondWithStatusCode(_0x470a25,_0xc4525){_0xc4525=_0xc4525||0xcc;return function(_0x501aee){if(_0x501aee){return _0x470a25['sendStatus'](_0xc4525);}return _0x470a25[_0xab0e('0xa')](_0xc4525)[_0xab0e('0xb')]();};}function respondWithResult(_0xaceb96,_0x3c74ad){_0x3c74ad=_0x3c74ad||0xc8;return function(_0x39d054){if(_0x39d054){return _0xaceb96[_0xab0e('0xa')](_0x3c74ad)[_0xab0e('0xc')](_0x39d054);}};}function respondWithFilteredResult(_0x7bef0c,_0x4c47aa){return function(_0x1e7cc9){if(_0x1e7cc9){var _0x31a501=typeof _0x4c47aa[_0xab0e('0xd')]===_0xab0e('0xe')&&typeof _0x4c47aa['limit']===_0xab0e('0xe');var _0x50c8fb=_0x1e7cc9[_0xab0e('0xf')];var _0x5a92d1=_0x31a501?0x0:_0x4c47aa[_0xab0e('0xd')];var _0x17ed50=_0x31a501?_0x1e7cc9[_0xab0e('0xf')]:_0x4c47aa[_0xab0e('0xd')]+_0x4c47aa[_0xab0e('0x10')];var _0x243885;if(_0x17ed50>=_0x50c8fb){_0x17ed50=_0x50c8fb;_0x243885=0xc8;}else{_0x243885=0xce;}_0x7bef0c[_0xab0e('0xa')](_0x243885);return _0x7bef0c['set'](_0xab0e('0x11'),_0x5a92d1+'-'+_0x17ed50+'/'+_0x50c8fb)[_0xab0e('0xc')](_0x1e7cc9);}return null;};}function saveUpdates(_0xceadc){return function(_0x25bed5){if(_0x25bed5){return _0x25bed5['update'](_0xceadc)[_0xab0e('0x12')](function(_0x575868){return _0x575868;});}return null;};}function removeEntity(_0x3c747c){return function(_0x2ec321){if(_0x2ec321){return _0x2ec321['destroy']()[_0xab0e('0x12')](function(){var _0x4c9949=_0x2ec321[_0xab0e('0x13')]({'plain':!![]});var _0x46052d=_0xab0e('0x14');return db[_0xab0e('0x15')][_0xab0e('0x16')]({'where':{'type':_0x46052d,'resourceId':_0x4c9949['id']}})[_0xab0e('0x12')](function(){return _0x2ec321;});})[_0xab0e('0x12')](function(){_0x3c747c[_0xab0e('0xa')](0xcc)[_0xab0e('0xb')]();});}};}function handleEntityNotFound(_0x3285b8){return function(_0x4d5705){if(!_0x4d5705){_0x3285b8[_0xab0e('0x17')](0x194);}return _0x4d5705;};}function handleError(_0x286ed5,_0x5ab38d){_0x5ab38d=_0x5ab38d||0x1f4;return function(_0x182c96){logger['error'](_0x182c96[_0xab0e('0x18')]);if(_0x182c96['name']){delete _0x182c96[_0xab0e('0x19')];}_0x286ed5[_0xab0e('0xa')](_0x5ab38d)[_0xab0e('0x1a')](_0x182c96);};}exports['index']=function(_0x1fc46f,_0x2f9dfa){var _0x398da8={};var _0x4cd1a2={'count':0x0,'rows':[]};var _0x43f135=_[_0xab0e('0x1b')](db[_0xab0e('0x1c')][_0xab0e('0x1d')],function(_0x8dd6ac){return{'name':_0x8dd6ac[_0xab0e('0x1e')],'type':_0x8dd6ac[_0xab0e('0x1f')][_0xab0e('0x20')]};});_0x398da8=qs[_0xab0e('0x21')](_0x43f135,_0x1fc46f);var _0x45bf49={'where':_0x398da8[_0xab0e('0x22')]};return db[_0xab0e('0x1c')][_0xab0e('0xf')](_0x45bf49)['then'](function(_0x967476){_0x4cd1a2[_0xab0e('0xf')]=_0x967476;_0x398da8['include']=qs[_0xab0e('0x23')](_0x1fc46f['query']);return db['WhatsappQueue'][_0xab0e('0x24')](_0x398da8);})[_0xab0e('0x12')](function(_0x2621e4){_0x4cd1a2['rows']=_0x2621e4;return _0x4cd1a2;})['then'](respondWithFilteredResult(_0x2f9dfa,_0x398da8))[_0xab0e('0x25')](handleError(_0x2f9dfa,null));};exports[_0xab0e('0x26')]=function(_0x789528,_0x4a95cb){var _0xeffcb8={'raw':!![],'where':{'id':_0x789528[_0xab0e('0x27')]['id']}},_0xbb3e04={};_0xbb3e04[_0xab0e('0x28')]=_[_0xab0e('0x29')](db[_0xab0e('0x1c')][_0xab0e('0x1d')]);_0xbb3e04[_0xab0e('0x2a')]=_[_0xab0e('0x29')](_0x789528['query']);_0xbb3e04[_0xab0e('0x2b')]=_[_0xab0e('0x2c')](_0xbb3e04['model'],_0xbb3e04['query']);_0xeffcb8['attributes']=_[_0xab0e('0x2c')](_0xbb3e04[_0xab0e('0x28')],qs[_0xab0e('0x2d')](_0x789528[_0xab0e('0x2a')][_0xab0e('0x2d')]));_0xeffcb8[_0xab0e('0x2e')]=_0xeffcb8[_0xab0e('0x2e')][_0xab0e('0x2f')]?_0xeffcb8[_0xab0e('0x2e')]:_0xbb3e04['model'];if(_0x789528['query'][_0xab0e('0x30')]){_0xeffcb8[_0xab0e('0x23')]=[{'all':!![]}];}_0xeffcb8=_['merge']({},_0xeffcb8,_0x789528[_0xab0e('0x31')]);return db['WhatsappQueue'][_0xab0e('0x32')](_0xeffcb8)[_0xab0e('0x12')](handleEntityNotFound(_0x4a95cb,null))[_0xab0e('0x12')](respondWithResult(_0x4a95cb,null))[_0xab0e('0x25')](handleError(_0x4a95cb,null));};exports[_0xab0e('0x33')]=function(_0x251efa,_0x593e9c){return db[_0xab0e('0x1c')][_0xab0e('0x33')](_0x251efa[_0xab0e('0x34')],{})[_0xab0e('0x12')](function(_0x5bca9c){var _0x5a4a8d=_0x251efa[_0xab0e('0x35')][_0xab0e('0x13')]({'plain':!![]});if(!_0x5a4a8d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a4a8d[_0xab0e('0x36')]===_0xab0e('0x35')){var _0x2f5718=_0x5bca9c[_0xab0e('0x13')]({'plain':!![]});var _0x13f42a=_0xab0e('0x14');return db[_0xab0e('0x37')]['find']({'where':{'name':_0x13f42a,'userProfileId':_0x5a4a8d[_0xab0e('0x38')]},'raw':!![]})[_0xab0e('0x12')](function(_0x3476a4){if(_0x3476a4&&_0x3476a4['autoAssociation']===0x0){return db[_0xab0e('0x15')]['create']({'name':_0x2f5718['name'],'resourceId':_0x2f5718['id'],'type':_0x3476a4[_0xab0e('0x19')],'sectionId':_0x3476a4['id']},{})[_0xab0e('0x12')](function(){return _0x5bca9c;});}else{return _0x5bca9c;}})['catch'](function(_0x38ac2e){logger[_0xab0e('0x39')](_0xab0e('0x3a'),_0x38ac2e);throw _0x38ac2e;});}return _0x5bca9c;})[_0xab0e('0x12')](respondWithResult(_0x593e9c,0xc9))[_0xab0e('0x25')](handleError(_0x593e9c,null));};exports[_0xab0e('0x3b')]=function(_0x21fe57,_0x170a7f){if(_0x21fe57['body']['id']){delete _0x21fe57[_0xab0e('0x34')]['id'];}return db[_0xab0e('0x1c')]['find']({'where':{'id':_0x21fe57[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0x170a7f,null))['then'](saveUpdates(_0x21fe57[_0xab0e('0x34')],null))[_0xab0e('0x12')](respondWithResult(_0x170a7f,null))[_0xab0e('0x25')](handleError(_0x170a7f,null));};exports[_0xab0e('0x16')]=function(_0x436cd2,_0x3868e6){return db[_0xab0e('0x1c')][_0xab0e('0x32')]({'where':{'id':_0x436cd2['params']['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0x3868e6,null))['then'](removeEntity(_0x3868e6,null))[_0xab0e('0x25')](handleError(_0x3868e6,null));};exports[_0xab0e('0x3c')]=function(_0x39942e,_0x106bb5){return db[_0xab0e('0x1c')][_0xab0e('0x3c')]()[_0xab0e('0x12')](respondWithResult(_0x106bb5,null))[_0xab0e('0x25')](handleError(_0x106bb5,null));};exports[_0xab0e('0x3d')]=function(_0x2169c6,_0x505064){var _0x4e9403={'raw':!![],'where':{}},_0x4898bf={},_0x3cbe45;return db[_0xab0e('0x1c')][_0xab0e('0x3e')]({'where':{'id':_0x2169c6[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0x505064,null))[_0xab0e('0x12')](function(_0x130d36){if(_0x130d36){_0x3cbe45=_0x130d36[_0xab0e('0x13')]({'plain':!![]});_0x4898bf[_0xab0e('0x28')]=_[_0xab0e('0x29')](db['UserWhatsappQueue'][_0xab0e('0x1d')]);_0x4898bf[_0xab0e('0x2a')]=_[_0xab0e('0x29')](_0x2169c6[_0xab0e('0x2a')]);_0x4898bf['filters']=_[_0xab0e('0x2c')](_0x4898bf[_0xab0e('0x28')],_0x4898bf[_0xab0e('0x2a')]);_0x4e9403[_0xab0e('0x2e')]=_[_0xab0e('0x2c')](_0x4898bf[_0xab0e('0x28')],qs[_0xab0e('0x2d')](_0x2169c6[_0xab0e('0x2a')]['fields']));_0x4e9403['attributes']=_0x4e9403[_0xab0e('0x2e')]['length']?_0x4e9403[_0xab0e('0x2e')]:_0x4898bf[_0xab0e('0x28')];if(!_0x2169c6[_0xab0e('0x2a')][_0xab0e('0x3f')](_0xab0e('0x40'))){_0x4e9403['limit']=qs[_0xab0e('0x10')](_0x2169c6[_0xab0e('0x2a')][_0xab0e('0x10')]);_0x4e9403['offset']=qs['offset'](_0x2169c6[_0xab0e('0x2a')][_0xab0e('0xd')]);}_0x4e9403['order']=qs[_0xab0e('0x41')](_0x2169c6[_0xab0e('0x2a')]['sort']);_0x4e9403['where']=qs[_0xab0e('0x2b')](_[_0xab0e('0x42')](_0x2169c6[_0xab0e('0x2a')],_0x4898bf[_0xab0e('0x2b')]));_0x4e9403[_0xab0e('0x22')][_0xab0e('0x43')]=_0x130d36['id'];if(_0x2169c6[_0xab0e('0x2a')]['filter']){_0x4e9403[_0xab0e('0x22')]=_[_0xab0e('0x44')](_0x4e9403[_0xab0e('0x22')],{'$or':_[_0xab0e('0x1b')](_0x4e9403[_0xab0e('0x2e')],function(_0x52a17b){var _0x4d6268={};_0x4d6268[_0x52a17b]={'$like':'%'+_0x2169c6['query'][_0xab0e('0x45')]+'%'};return _0x4d6268;})});}_0x4e9403=_[_0xab0e('0x44')]({},_0x4e9403,_0x2169c6[_0xab0e('0x31')]);return db[_0xab0e('0x46')][_0xab0e('0x24')](_0x4e9403);}})[_0xab0e('0x12')](function(_0x2abd1f){if(_0x2abd1f){return db[_0xab0e('0x47')][_0xab0e('0x48')]({'where':{'id':_[_0xab0e('0x1b')](_0x2abd1f,'UserId'),'role':_0xab0e('0x49')},'attributes':['id',_0xab0e('0x19'),_0xab0e('0x4a'),_0xab0e('0x4b'),_0xab0e('0x4c')]});}})['then'](function(_0x333faf){if(_0x333faf){return{'count':_0x333faf[_0xab0e('0xf')],'rows':_[_0xab0e('0x1b')](_0x333faf[_0xab0e('0x4d')],function(_0x1d8667){return{'membername':_0x1d8667[_0xab0e('0x19')],'UserId':_0x1d8667['id'],'queue_name':_0x3cbe45[_0xab0e('0x19')],'WhatsappQueueId':_0x3cbe45['id'],'interface':util[_0xab0e('0x4e')](_0xab0e('0x4f'),_0xab0e('0x50'),_0x1d8667[_0xab0e('0x19')]),'penalty':0x0,'paused':_0x1d8667[_0xab0e('0x4a')],'createdAt':_0x1d8667[_0xab0e('0x4c')],'updatedAt':_0x1d8667[_0xab0e('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xab0e('0x12')](respondWithFilteredResult(_0x505064,_0x4e9403))[_0xab0e('0x25')](handleError(_0x505064,null));};exports[_0xab0e('0x51')]=function(_0x2a689d,_0xfc23b){var _0x5b09c5={};var _0x1974fc={};var _0x5357ef;var _0x4e58e1;return db[_0xab0e('0x1c')][_0xab0e('0x3e')]({'where':{'id':_0x2a689d[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0xfc23b,null))[_0xab0e('0x12')](function(_0x39e970){if(_0x39e970){_0x5357ef=_0x39e970;_0x1974fc[_0xab0e('0x28')]=_[_0xab0e('0x29')](db[_0xab0e('0x52')][_0xab0e('0x1d')]);_0x1974fc['query']=_[_0xab0e('0x29')](_0x2a689d['query']);_0x1974fc[_0xab0e('0x2b')]=_[_0xab0e('0x2c')](_0x1974fc[_0xab0e('0x28')],_0x1974fc[_0xab0e('0x2a')]);_0x5b09c5['attributes']=_[_0xab0e('0x2c')](_0x1974fc[_0xab0e('0x28')],qs[_0xab0e('0x2d')](_0x2a689d[_0xab0e('0x2a')][_0xab0e('0x2d')]));_0x5b09c5['attributes']=_0x5b09c5[_0xab0e('0x2e')][_0xab0e('0x2f')]?_0x5b09c5[_0xab0e('0x2e')]:_0x1974fc[_0xab0e('0x28')];_0x5b09c5[_0xab0e('0x53')]=qs['sort'](_0x2a689d['query']['sort']);_0x5b09c5[_0xab0e('0x22')]=qs[_0xab0e('0x2b')](_[_0xab0e('0x42')](_0x2a689d[_0xab0e('0x2a')],_0x1974fc[_0xab0e('0x2b')]));if(_0x2a689d[_0xab0e('0x2a')][_0xab0e('0x45')]){_0x5b09c5[_0xab0e('0x22')]=_[_0xab0e('0x44')](_0x5b09c5[_0xab0e('0x22')],{'$or':_['map'](_0x5b09c5[_0xab0e('0x2e')],function(_0xb70dc1){var _0x772f56={};_0x772f56[_0xb70dc1]={'$like':'%'+_0x2a689d['query'][_0xab0e('0x45')]+'%'};return _0x772f56;})});}_0x5b09c5=_[_0xab0e('0x44')]({},_0x5b09c5,_0x2a689d[_0xab0e('0x31')]);return _0x5357ef[_0xab0e('0x51')](_0x5b09c5);}})[_0xab0e('0x12')](function(_0x4fd099){if(_0x4fd099){_0x4e58e1=_0x4fd099[_0xab0e('0x2f')];if(!_0x2a689d['query'][_0xab0e('0x3f')](_0xab0e('0x40'))){_0x5b09c5[_0xab0e('0x10')]=qs['limit'](_0x2a689d['query'][_0xab0e('0x10')]);_0x5b09c5['offset']=qs[_0xab0e('0xd')](_0x2a689d[_0xab0e('0x2a')][_0xab0e('0xd')]);}return _0x5357ef['getTeams'](_0x5b09c5);}})[_0xab0e('0x12')](function(_0x1d6684){if(_0x1d6684){return _0x1d6684?{'count':_0x4e58e1,'rows':_0x1d6684}:null;}})['then'](respondWithResult(_0xfc23b,null))[_0xab0e('0x25')](handleError(_0xfc23b,null));};exports[_0xab0e('0x54')]=function(_0x2d5de8,_0x4b53fa){var _0x338ea0=_0x2d5de8[_0xab0e('0x34')]['ids'];return db[_0xab0e('0x52')][_0xab0e('0x24')]({'where':{'id':_0x338ea0},'attributes':['id'],'include':[{'model':db[_0xab0e('0x47')],'as':_0xab0e('0x55'),'attributes':['id',_0xab0e('0x19'),_0xab0e('0x56'),_0xab0e('0x57'),_0xab0e('0x58')],'raw':!![]}]})[_0xab0e('0x12')](function(_0x5225af){if(_0x5225af){var _0x37f064=_[_0xab0e('0x59')](_0x5225af,function(_0x50f288){var _0x120b8d=_0x50f288[_0xab0e('0x13')]({'plain':!![]});return _0x120b8d[_0xab0e('0x55')];});return db[_0xab0e('0x1c')][_0xab0e('0x32')]({'where':{'id':_0x2d5de8[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](function(_0x17c061){return db[_0xab0e('0x5a')][_0xab0e('0x5b')](function(_0x5b119c){return _0x17c061[_0xab0e('0x54')](_0x338ea0,{'transaction':_0x5b119c})[_0xab0e('0x12')](function(){return BPromise[_0xab0e('0x5c')](_0x37f064,function(_0x3adb84){return db['UserWhatsappQueue'][_0xab0e('0x5d')]({'where':{'UserId':_0x3adb84['id'],'WhatsappQueueId':_0x2d5de8[_0xab0e('0x27')]['id']},'transaction':_0x5b119c});});})[_0xab0e('0x12')](function(){_0x37f064[_0xab0e('0x5e')](function(_0x53903e){socket['emit']('userWhatsappQueue:save',{'UserId':_0x53903e['id'],'WhatsappQueueId':_0x17c061['id']});});});});});}})[_0xab0e('0x12')](respondWithStatusCode(_0x4b53fa,null))[_0xab0e('0x25')](handleError(_0x4b53fa,null));};exports[_0xab0e('0x5f')]=function(_0x5b106a,_0x5b783e){return db['Team'][_0xab0e('0x24')]({'where':{'id':_0x5b106a[_0xab0e('0x2a')][_0xab0e('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xab0e('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5b783e,null))['then'](function(_0x3de3d4){var _0x4fd022=_['map'](_0x3de3d4,'id');var _0x5db94e=[];var _0x5be2dd=[];var _0x58b540=squel[_0xab0e('0x61')]();_0x58b540[_0xab0e('0x62')]('tq.TeamId')['from'](_0xab0e('0x63'),'tq')['join'](_0xab0e('0x64'),'ut',_0xab0e('0x65'))[_0xab0e('0x22')](_0xab0e('0x66'),_0x5b106a[_0xab0e('0x27')]['id']);for(var _0x3143d6=0x0;_0x3143d6<_0x3de3d4[_0xab0e('0x2f')];_0x3143d6+=0x1){let _0x19eb81=_0x3de3d4[_0x3143d6];for(var _0x22ca10=0x0;_0x22ca10<_0x19eb81[_0xab0e('0x55')][_0xab0e('0x2f')];_0x22ca10+=0x1){let _0x36ff17=_0x19eb81[_0xab0e('0x55')][_0x22ca10];var _0x1c5d76=_0x58b540[_0xab0e('0x67')]();_0x1c5d76[_0xab0e('0x22')](_0xab0e('0x68'),_0x36ff17['id']);_0x5be2dd[_0xab0e('0x69')](db[_0xab0e('0x5a')][_0xab0e('0x2a')](_0x1c5d76[_0xab0e('0x6a')](),{'type':db[_0xab0e('0x5a')][_0xab0e('0x6b')]['SELECT']})[_0xab0e('0x12')](function(_0x408a91){if(_0x408a91[_0xab0e('0x2f')]===0x1){return _0x36ff17['id'];}else{var _0x16fd7e=_[_0xab0e('0x6c')](_[_0xab0e('0x1b')](_0x408a91,_0xab0e('0x6d')),function(_0x4f68f3){return _['includes'](_0x4fd022,_0x4f68f3);});if(_0x16fd7e){return _0x36ff17['id'];}}}));}}return BPromise[_0xab0e('0x6e')](_0x5be2dd)['then'](function(_0x4aee7d){_0x5db94e=_(_0x5db94e)[_0xab0e('0x6f')](_0x4aee7d)['compact']()[_0xab0e('0x70')]();return db['WhatsappQueue']['find']({'where':{'id':_0x5b106a[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](function(_0x259b4a){return db[_0xab0e('0x5a')][_0xab0e('0x5b')](function(_0x544338){return _0x259b4a[_0xab0e('0x5f')](_0x5b106a[_0xab0e('0x2a')][_0xab0e('0x60')],{'transaction':_0x544338})['then'](function(){if(!_[_0xab0e('0x71')](_0x5db94e)){return _0x259b4a['removeAgents'](_0x5db94e,{'transaction':_0x544338});}})[_0xab0e('0x12')](function(){_0x5db94e['forEach'](function(_0x1a97b2){socket['emit'](_0xab0e('0x72'),{'UserId':_0x1a97b2,'WhatsappQueueId':_0x259b4a['id']});});});});});});})[_0xab0e('0x12')](respondWithStatusCode(_0x5b783e,null))[_0xab0e('0x25')](handleError(_0x5b783e,null));};exports[_0xab0e('0x73')]=function(_0x48be63,_0x14d269){return db['WhatsappQueue'][_0xab0e('0x32')]({'where':{'id':_0x48be63[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0x14d269,null))[_0xab0e('0x12')](function(_0x42d093){if(_0x42d093){return _0x42d093[_0xab0e('0x73')](_0x48be63['body'][_0xab0e('0x60')],_[_0xab0e('0x74')](_0x48be63['body'],[_0xab0e('0x60'),'id'])||{})[_0xab0e('0x75')](function(_0x40abd1){for(var _0x2cc00d=0x0;_0x2cc00d<_0x48be63[_0xab0e('0x34')][_0xab0e('0x60')][_0xab0e('0x2f')];_0x2cc00d+=0x1){socket[_0xab0e('0x76')](_0xab0e('0x77'),{'UserId':Number(_0x48be63['body'][_0xab0e('0x60')][_0x2cc00d]),'WhatsappQueueId':Number(_0x48be63[_0xab0e('0x27')]['id'])});}return _0x40abd1;});}})['then'](respondWithResult(_0x14d269,null))[_0xab0e('0x25')](handleError(_0x14d269,null));};exports[_0xab0e('0x78')]=function(_0x393362,_0x1acb26){return db[_0xab0e('0x1c')][_0xab0e('0x32')]({'where':{'id':_0x393362['params']['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0x1acb26,null))[_0xab0e('0x12')](function(_0x2f7ca6){if(_0x2f7ca6){return _0x2f7ca6[_0xab0e('0x78')](_0x393362[_0xab0e('0x2a')][_0xab0e('0x60')])[_0xab0e('0x12')](function(){if(_['isArray'](_0x393362[_0xab0e('0x2a')][_0xab0e('0x60')])){for(var _0x59b0b5=0x0;_0x59b0b5<_0x393362[_0xab0e('0x2a')][_0xab0e('0x60')][_0xab0e('0x2f')];_0x59b0b5+=0x1){socket[_0xab0e('0x76')](_0xab0e('0x72'),{'UserId':Number(_0x393362[_0xab0e('0x2a')]['ids'][_0x59b0b5]),'WhatsappQueueId':Number(_0x393362['params']['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x393362[_0xab0e('0x2a')]['ids']),'WhatsappQueueId':Number(_0x393362['params']['id'])});}});}})[_0xab0e('0x12')](respondWithStatusCode(_0x1acb26,null))[_0xab0e('0x25')](handleError(_0x1acb26,null));};exports[_0xab0e('0x79')]=function(_0x1cd455,_0xc58e28){var _0x2e0143={};var _0x21a51e={};var _0x6f0a6;var _0x352d40;return db[_0xab0e('0x1c')]['findOne']({'where':{'id':_0x1cd455[_0xab0e('0x27')]['id']}})[_0xab0e('0x12')](handleEntityNotFound(_0xc58e28,null))[_0xab0e('0x12')](function(_0x583167){if(_0x583167){_0x6f0a6=_0x583167;_0x21a51e[_0xab0e('0x28')]=_[_0xab0e('0x29')](db[_0xab0e('0x47')][_0xab0e('0x1d')]);_0x21a51e[_0xab0e('0x2a')]=_[_0xab0e('0x29')](_0x1cd455['query']);_0x21a51e[_0xab0e('0x2b')]=_[_0xab0e('0x2c')](_0x21a51e[_0xab0e('0x28')],_0x21a51e[_0xab0e('0x2a')]);_0x2e0143[_0xab0e('0x2e')]=_['intersection'](_0x21a51e[_0xab0e('0x28')],qs[_0xab0e('0x2d')](_0x1cd455[_0xab0e('0x2a')][_0xab0e('0x2d')]));_0x2e0143[_0xab0e('0x2e')]=_0x2e0143['attributes'][_0xab0e('0x2f')]?_0x2e0143['attributes']:_0x21a51e['model'];_0x2e0143['order']=qs['sort'](_0x1cd455[_0xab0e('0x2a')][_0xab0e('0x41')]);_0x2e0143[_0xab0e('0x22')]=qs['filters'](_[_0xab0e('0x42')](_0x1cd455['query'],_0x21a51e[_0xab0e('0x2b')]));if(_0x1cd455[_0xab0e('0x2a')][_0xab0e('0x45')]){_0x2e0143['where']=_[_0xab0e('0x44')](_0x2e0143[_0xab0e('0x22')],{'$or':_[_0xab0e('0x1b')](_0x2e0143[_0xab0e('0x2e')],function(_0x308a46){var _0x23778c={};_0x23778c[_0x308a46]={'$like':'%'+_0x1cd455[_0xab0e('0x2a')][_0xab0e('0x45')]+'%'};return _0x23778c;})});}_0x2e0143=_[_0xab0e('0x44')]({},_0x2e0143,_0x1cd455[_0xab0e('0x31')]);return _0x6f0a6['getAgents'](_0x2e0143);}})[_0xab0e('0x12')](function(_0x31575a){if(_0x31575a){_0x352d40=_0x31575a[_0xab0e('0x2f')];if(!_0x1cd455[_0xab0e('0x2a')][_0xab0e('0x3f')]('nolimit')){_0x2e0143['limit']=qs[_0xab0e('0x10')](_0x1cd455['query'][_0xab0e('0x10')]);_0x2e0143[_0xab0e('0xd')]=qs[_0xab0e('0xd')](_0x1cd455[_0xab0e('0x2a')][_0xab0e('0xd')]);}return _0x6f0a6['getAgents'](_0x2e0143);}})[_0xab0e('0x12')](function(_0x216c64){if(_0x216c64){return _0x216c64?{'count':_0x352d40,'rows':_0x216c64}:null;}})['then'](respondWithResult(_0xc58e28,null))[_0xab0e('0x25')](handleError(_0xc58e28,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 48416a3..c874cd3 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 _0x06ad=['hook','exports','events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x06ad,0x7a));var _0xd06a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06ad[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd06a('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xd06a('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xd06a('0x2')](0x0);var events={'afterCreate':_0xd06a('0x3'),'afterUpdate':_0xd06a('0x4'),'afterDestroy':_0xd06a('0x5')};function emitEvent(_0x25dd36){return function(_0x4b419c,_0x4eca16,_0x12613b){WhatsappQueueEvents[_0xd06a('0x6')](_0x25dd36+':'+_0x4b419c['id'],_0x4b419c);WhatsappQueueEvents[_0xd06a('0x6')](_0x25dd36,_0x4b419c);_0x12613b(null);};}for(var e in events){if(events[_0xd06a('0x7')](e)){var event=events[e];WhatsappQueue[_0xd06a('0x8')](e,emitEvent(event));}}module[_0xd06a('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0xcf2a=['emit','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcf2a,0x11b));var _0xacf2=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xcf2a[_0x119705];return _0x2affc2;};'use strict';var EventEmitter=require(_0xacf2('0x0'));var WhatsappQueue=require(_0xacf2('0x1'))['db'][_0xacf2('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xacf2('0x3')](0x0);var events={'afterCreate':_0xacf2('0x4'),'afterUpdate':_0xacf2('0x5'),'afterDestroy':_0xacf2('0x6')};function emitEvent(_0xd26a99){return function(_0x5b55d1,_0xf38e93,_0x506be8){WhatsappQueueEvents[_0xacf2('0x7')](_0xd26a99+':'+_0x5b55d1['id'],_0x5b55d1);WhatsappQueueEvents[_0xacf2('0x7')](_0xd26a99,_0x5b55d1);_0x506be8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xacf2('0x8')](e,emitEvent(event));}}module[_0xacf2('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 758a4ab..245bd52 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 _0x42b8=['path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x42b8,0x180));var _0x842b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x42b8[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0x842b('0x0'));var logger=require(_0x842b('0x1'))(_0x842b('0x2'));var moment=require(_0x842b('0x3'));var BPromise=require(_0x842b('0x4'));var rp=require(_0x842b('0x5'));var fs=require('fs');var path=require(_0x842b('0x6'));var rimraf=require(_0x842b('0x7'));var config=require(_0x842b('0x8'));var attributes=require(_0x842b('0x9'));module[_0x842b('0xa')]=function(_0x4030ba,_0x2a745a){return _0x4030ba['define'](_0x842b('0xb'),attributes,{'tableName':_0x842b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f01=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x3f5bc9,_0x480910){var _0x4a5692=function(_0x313b07){while(--_0x313b07){_0x3f5bc9['push'](_0x3f5bc9['shift']());}};_0x4a5692(++_0x480910);}(_0x3f01,0x8a));var _0x13f0=function(_0x8d1a91,_0x3f915d){_0x8d1a91=_0x8d1a91-0x0;var _0x734041=_0x3f01[_0x8d1a91];return _0x734041;};'use strict';var _=require(_0x13f0('0x0'));var util=require(_0x13f0('0x1'));var logger=require(_0x13f0('0x2'))(_0x13f0('0x3'));var moment=require(_0x13f0('0x4'));var BPromise=require(_0x13f0('0x5'));var rp=require(_0x13f0('0x6'));var fs=require('fs');var path=require(_0x13f0('0x7'));var rimraf=require(_0x13f0('0x8'));var config=require(_0x13f0('0x9'));var attributes=require(_0x13f0('0xa'));module['exports']=function(_0x1e0a93,_0x4c67cd){return _0x1e0a93[_0x13f0('0xb')](_0x13f0('0xc'),attributes,{'tableName':_0x13f0('0xd'),'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 a8e6b1d..5582a32 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 _0x9611=['options','attributes','include','map','model','then','GetWhatsappQueue','stringify','find','raw','where','ShowWhatsappQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','findAll'];(function(_0x2e34f2,_0x1bcef4){var _0x3cb9c7=function(_0x3b82f3){while(--_0x3b82f3){_0x2e34f2['push'](_0x2e34f2['shift']());}};_0x3cb9c7(++_0x1bcef4);}(_0x9611,0x16b));var _0x1961=function(_0x30a583,_0x4bd710){_0x30a583=_0x30a583-0x0;var _0x535361=_0x9611[_0x30a583];return _0x535361;};'use strict';var _=require('lodash');var util=require(_0x1961('0x0'));var moment=require(_0x1961('0x1'));var BPromise=require(_0x1961('0x2'));var rs=require(_0x1961('0x3'));var fs=require('fs');var Redis=require(_0x1961('0x4'));var db=require(_0x1961('0x5'))['db'];var utils=require(_0x1961('0x6'));var logger=require(_0x1961('0x7'))('rpc');var config=require(_0x1961('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1961('0x9')]['http']({'port':0x232a});config[_0x1961('0xa')]=_[_0x1961('0xb')](config[_0x1961('0xa')],{'host':_0x1961('0xc'),'port':0x18eb});var socket=require(_0x1961('0xd'))(new Redis(config[_0x1961('0xa')]));require(_0x1961('0xe'))[_0x1961('0xf')](socket);function respondWithRpcPromise(_0x33bbc7,_0x135ddf,_0x49de5c){return new BPromise(function(_0x8e579b,_0xca56c7){return client[_0x1961('0x10')](_0x33bbc7,_0x49de5c)['then'](function(_0x934d43){logger[_0x1961('0x11')](_0x1961('0x12'),_0x135ddf,_0x1961('0x13'));logger[_0x1961('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x135ddf,_0x1961('0x13'),JSON['stringify'](_0x934d43));if(_0x934d43['error']){if(_0x934d43[_0x1961('0x15')][_0x1961('0x16')]===0x1f4){logger[_0x1961('0x15')](_0x1961('0x12'),_0x135ddf,_0x934d43[_0x1961('0x15')][_0x1961('0x17')]);return _0xca56c7(_0x934d43[_0x1961('0x15')][_0x1961('0x17')]);}logger[_0x1961('0x15')](_0x1961('0x12'),_0x135ddf,_0x934d43[_0x1961('0x15')][_0x1961('0x17')]);return _0x8e579b(_0x934d43['error'][_0x1961('0x17')]);}else{logger[_0x1961('0x11')](_0x1961('0x12'),_0x135ddf,_0x1961('0x13'));_0x8e579b(_0x934d43[_0x1961('0x18')][_0x1961('0x17')]);}})[_0x1961('0x19')](function(_0x281262){logger['error'](_0x1961('0x12'),_0x135ddf,_0x281262);_0xca56c7(_0x281262);});});}exports['GetWhatsappQueue']=function(_0x37d01d){var _0x3cc1b=this;return new Promise(function(_0x25cd79,_0x197427){return db['WhatsappQueue'][_0x1961('0x1a')]({'raw':_0x37d01d[_0x1961('0x1b')]?_0x37d01d['options']['raw']===undefined?!![]:![]:!![],'where':_0x37d01d[_0x1961('0x1b')]?_0x37d01d['options']['where']||null:null,'attributes':_0x37d01d[_0x1961('0x1b')]?_0x37d01d['options'][_0x1961('0x1c')]||null:null,'limit':_0x37d01d['options']?_0x37d01d[_0x1961('0x1b')]['limit']||null:null,'include':_0x37d01d[_0x1961('0x1b')]?_0x37d01d[_0x1961('0x1b')][_0x1961('0x1d')]?_[_0x1961('0x1e')](_0x37d01d[_0x1961('0x1b')][_0x1961('0x1d')],function(_0x54f698){return{'model':db[_0x54f698[_0x1961('0x1f')]],'as':_0x54f698['as'],'attributes':_0x54f698[_0x1961('0x1c')],'include':_0x54f698[_0x1961('0x1d')]?_[_0x1961('0x1e')](_0x54f698[_0x1961('0x1d')],function(_0x337b5f){return{'model':db[_0x337b5f[_0x1961('0x1f')]],'as':_0x337b5f['as'],'attributes':_0x337b5f[_0x1961('0x1c')],'include':_0x337b5f[_0x1961('0x1d')]?_[_0x1961('0x1e')](_0x337b5f['include'],function(_0x174a3a){return{'model':db[_0x174a3a[_0x1961('0x1f')]],'as':_0x174a3a['as'],'attributes':_0x174a3a[_0x1961('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1961('0x20')](function(_0x14d8de){logger[_0x1961('0x11')]('GetWhatsappQueue',_0x37d01d);logger[_0x1961('0x14')](_0x1961('0x21'),_0x37d01d,JSON[_0x1961('0x22')](_0x14d8de));_0x25cd79(_0x14d8de);})['catch'](function(_0x2dabdf){logger[_0x1961('0x15')](_0x1961('0x21'),_0x2dabdf['message'],_0x37d01d);_0x197427(_0x3cc1b[_0x1961('0x15')](0x1f4,_0x2dabdf[_0x1961('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x42676a){var _0x31cfd9=this;return new Promise(function(_0x86e1,_0x2ae2d3){return db['WhatsappQueue'][_0x1961('0x23')]({'raw':_0x42676a[_0x1961('0x1b')]?_0x42676a[_0x1961('0x1b')][_0x1961('0x24')]===undefined?!![]:![]:!![],'where':_0x42676a[_0x1961('0x1b')]?_0x42676a[_0x1961('0x1b')][_0x1961('0x25')]||null:null,'attributes':_0x42676a[_0x1961('0x1b')]?_0x42676a['options']['attributes']||null:null,'include':_0x42676a[_0x1961('0x1b')]?_0x42676a[_0x1961('0x1b')][_0x1961('0x1d')]?_[_0x1961('0x1e')](_0x42676a['options'][_0x1961('0x1d')],function(_0x17fd0d){return{'model':db[_0x17fd0d['model']],'as':_0x17fd0d['as'],'attributes':_0x17fd0d[_0x1961('0x1c')],'include':_0x17fd0d[_0x1961('0x1d')]?_['map'](_0x17fd0d['include'],function(_0x516697){return{'model':db[_0x516697[_0x1961('0x1f')]],'as':_0x516697['as'],'attributes':_0x516697[_0x1961('0x1c')],'include':_0x516697['include']?_['map'](_0x516697[_0x1961('0x1d')],function(_0x4896be){return{'model':db[_0x4896be[_0x1961('0x1f')]],'as':_0x4896be['as'],'attributes':_0x4896be[_0x1961('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1961('0x20')](function(_0x3ec429){logger['info'](_0x1961('0x26'),_0x42676a);logger['debug']('ShowWhatsappQueue',_0x42676a,JSON['stringify'](_0x3ec429));_0x86e1(_0x3ec429);})['catch'](function(_0x136c6e){logger[_0x1961('0x15')](_0x1961('0x26'),_0x136c6e[_0x1961('0x17')],_0x42676a);_0x2ae2d3(_0x31cfd9['error'](0x1f4,_0x136c6e['message']));});});}; \ No newline at end of file +var _0xbbfe=['where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','WhatsappQueue','options','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find'];(function(_0x31ad82,_0x5083e2){var _0x440f19=function(_0x2507c5){while(--_0x2507c5){_0x31ad82['push'](_0x31ad82['shift']());}};_0x440f19(++_0x5083e2);}(_0xbbfe,0x112));var _0xebbf=function(_0x57f9e2,_0x9db71){_0x57f9e2=_0x57f9e2-0x0;var _0x43b1ff=_0xbbfe[_0x57f9e2];return _0x43b1ff;};'use strict';var _=require(_0xebbf('0x0'));var util=require(_0xebbf('0x1'));var moment=require(_0xebbf('0x2'));var BPromise=require(_0xebbf('0x3'));var rs=require(_0xebbf('0x4'));var fs=require('fs');var Redis=require(_0xebbf('0x5'));var db=require(_0xebbf('0x6'))['db'];var utils=require(_0xebbf('0x7'));var logger=require(_0xebbf('0x8'))(_0xebbf('0x9'));var config=require(_0xebbf('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xebbf('0xb')]['http']({'port':0x232a});config[_0xebbf('0xc')]=_['defaults'](config[_0xebbf('0xc')],{'host':_0xebbf('0xd'),'port':0x18eb});var socket=require(_0xebbf('0xe'))(new Redis(config[_0xebbf('0xc')]));require(_0xebbf('0xf'))[_0xebbf('0x10')](socket);function respondWithRpcPromise(_0x4136c9,_0x3ce549,_0x582bfa){return new BPromise(function(_0x457a73,_0x1aaa53){return client[_0xebbf('0x11')](_0x4136c9,_0x582bfa)[_0xebbf('0x12')](function(_0x4d9332){logger[_0xebbf('0x13')](_0xebbf('0x14'),_0x3ce549,'request\x20sent');logger[_0xebbf('0x15')](_0xebbf('0x16'),_0x3ce549,_0xebbf('0x17'),JSON[_0xebbf('0x18')](_0x4d9332));if(_0x4d9332[_0xebbf('0x19')]){if(_0x4d9332[_0xebbf('0x19')]['code']===0x1f4){logger[_0xebbf('0x19')](_0xebbf('0x14'),_0x3ce549,_0x4d9332[_0xebbf('0x19')]['message']);return _0x1aaa53(_0x4d9332[_0xebbf('0x19')][_0xebbf('0x1a')]);}logger[_0xebbf('0x19')](_0xebbf('0x14'),_0x3ce549,_0x4d9332['error'][_0xebbf('0x1a')]);return _0x457a73(_0x4d9332['error'][_0xebbf('0x1a')]);}else{logger[_0xebbf('0x13')](_0xebbf('0x14'),_0x3ce549,'request\x20sent');_0x457a73(_0x4d9332['result'][_0xebbf('0x1a')]);}})[_0xebbf('0x1b')](function(_0x47b1c6){logger[_0xebbf('0x19')](_0xebbf('0x14'),_0x3ce549,_0x47b1c6);_0x1aaa53(_0x47b1c6);});});}exports['GetWhatsappQueue']=function(_0x1ba6d5){var _0x475fb8=this;return new Promise(function(_0x1c8a65,_0x3c1733){return db[_0xebbf('0x1c')]['findAll']({'raw':_0x1ba6d5[_0xebbf('0x1d')]?_0x1ba6d5[_0xebbf('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1ba6d5[_0xebbf('0x1d')]?_0x1ba6d5[_0xebbf('0x1d')]['where']||null:null,'attributes':_0x1ba6d5[_0xebbf('0x1d')]?_0x1ba6d5['options'][_0xebbf('0x1e')]||null:null,'limit':_0x1ba6d5[_0xebbf('0x1d')]?_0x1ba6d5['options'][_0xebbf('0x1f')]||null:null,'include':_0x1ba6d5[_0xebbf('0x1d')]?_0x1ba6d5[_0xebbf('0x1d')][_0xebbf('0x20')]?_[_0xebbf('0x21')](_0x1ba6d5[_0xebbf('0x1d')][_0xebbf('0x20')],function(_0x49d57a){return{'model':db[_0x49d57a[_0xebbf('0x22')]],'as':_0x49d57a['as'],'attributes':_0x49d57a[_0xebbf('0x1e')],'include':_0x49d57a[_0xebbf('0x20')]?_[_0xebbf('0x21')](_0x49d57a[_0xebbf('0x20')],function(_0x4019a5){return{'model':db[_0x4019a5[_0xebbf('0x22')]],'as':_0x4019a5['as'],'attributes':_0x4019a5[_0xebbf('0x1e')],'include':_0x4019a5[_0xebbf('0x20')]?_[_0xebbf('0x21')](_0x4019a5[_0xebbf('0x20')],function(_0x5ec1ac){return{'model':db[_0x5ec1ac[_0xebbf('0x22')]],'as':_0x5ec1ac['as'],'attributes':_0x5ec1ac[_0xebbf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xebbf('0x12')](function(_0x53f849){logger['info'](_0xebbf('0x23'),_0x1ba6d5);logger[_0xebbf('0x15')]('GetWhatsappQueue',_0x1ba6d5,JSON[_0xebbf('0x18')](_0x53f849));_0x1c8a65(_0x53f849);})[_0xebbf('0x1b')](function(_0x352a3a){logger[_0xebbf('0x19')](_0xebbf('0x23'),_0x352a3a[_0xebbf('0x1a')],_0x1ba6d5);_0x3c1733(_0x475fb8['error'](0x1f4,_0x352a3a['message']));});});};exports[_0xebbf('0x24')]=function(_0x21b6c5){var _0x5b0855=this;return new Promise(function(_0xc4960a,_0x2f3fc9){return db[_0xebbf('0x1c')][_0xebbf('0x25')]({'raw':_0x21b6c5[_0xebbf('0x1d')]?_0x21b6c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x21b6c5[_0xebbf('0x1d')]?_0x21b6c5[_0xebbf('0x1d')][_0xebbf('0x26')]||null:null,'attributes':_0x21b6c5[_0xebbf('0x1d')]?_0x21b6c5[_0xebbf('0x1d')][_0xebbf('0x1e')]||null:null,'include':_0x21b6c5[_0xebbf('0x1d')]?_0x21b6c5['options'][_0xebbf('0x20')]?_[_0xebbf('0x21')](_0x21b6c5[_0xebbf('0x1d')]['include'],function(_0x322579){return{'model':db[_0x322579[_0xebbf('0x22')]],'as':_0x322579['as'],'attributes':_0x322579[_0xebbf('0x1e')],'include':_0x322579['include']?_['map'](_0x322579[_0xebbf('0x20')],function(_0x560a72){return{'model':db[_0x560a72[_0xebbf('0x22')]],'as':_0x560a72['as'],'attributes':_0x560a72[_0xebbf('0x1e')],'include':_0x560a72[_0xebbf('0x20')]?_['map'](_0x560a72[_0xebbf('0x20')],function(_0x29e5c1){return{'model':db[_0x29e5c1[_0xebbf('0x22')]],'as':_0x29e5c1['as'],'attributes':_0x29e5c1[_0xebbf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xebbf('0x12')](function(_0x455dde){logger[_0xebbf('0x13')]('ShowWhatsappQueue',_0x21b6c5);logger[_0xebbf('0x15')](_0xebbf('0x24'),_0x21b6c5,JSON[_0xebbf('0x18')](_0x455dde));_0xc4960a(_0x455dde);})[_0xebbf('0x1b')](function(_0xb32f00){logger['error'](_0xebbf('0x24'),_0xb32f00[_0xebbf('0x1a')],_0x21b6c5);_0x2f3fc9(_0x5b0855[_0xebbf('0x19')](0x1f4,_0xb32f00[_0xebbf('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index c119bad..274a386 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 _0x1b14=['./whatsappQueue.events','save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b14,0x19e));var _0x41b1=function(_0xb1c0e1,_0x39590d){_0xb1c0e1=_0xb1c0e1-0x0;var _0x5c7c4=_0x1b14[_0xb1c0e1];return _0x5c7c4;};'use strict';var WhatsappQueueEvents=require(_0x41b1('0x0'));var events=[_0x41b1('0x1'),_0x41b1('0x2'),_0x41b1('0x3')];function createListener(_0xcd3acb,_0x5d3a4f){return function(_0x2633ad){_0x5d3a4f[_0x41b1('0x4')](_0xcd3acb,_0x2633ad);};}function removeListener(_0x1bca2a,_0x5486a5){return function(){WhatsappQueueEvents[_0x41b1('0x5')](_0x1bca2a,_0x5486a5);};}exports[_0x41b1('0x6')]=function(_0x2a1484){for(var _0x2b4e88=0x0,_0x532970=events[_0x41b1('0x7')];_0x2b4e88<_0x532970;_0x2b4e88++){var _0x13f86b=events[_0x2b4e88];var _0x80354f=createListener(_0x41b1('0x8')+_0x13f86b,_0x2a1484);WhatsappQueueEvents['on'](_0x13f86b,_0x80354f);}}; \ No newline at end of file +var _0xd3d8=['update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','remove'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd3d8,0xce));var _0x8d3d=function(_0x1fe024,_0x1bc26c){_0x1fe024=_0x1fe024-0x0;var _0x20f4b4=_0xd3d8[_0x1fe024];return _0x20f4b4;};'use strict';var WhatsappQueueEvents=require(_0x8d3d('0x0'));var events=['save',_0x8d3d('0x1'),_0x8d3d('0x2')];function createListener(_0x3e690b,_0xc0d49e){return function(_0x5c04fb){_0xc0d49e[_0x8d3d('0x3')](_0x3e690b,_0x5c04fb);};}function removeListener(_0x38201a,_0x418471){return function(){WhatsappQueueEvents[_0x8d3d('0x4')](_0x38201a,_0x418471);};}exports[_0x8d3d('0x5')]=function(_0x3a9d2f){for(var _0x56cc8f=0x0,_0x2badd8=events[_0x8d3d('0x6')];_0x56cc8f<_0x2badd8;_0x56cc8f++){var _0x9a5cd5=events[_0x56cc8f];var _0x5a3a66=createListener(_0x8d3d('0x7')+_0x9a5cd5,_0x3a9d2f);WhatsappQueueEvents['on'](_0x9a5cd5,_0x5a3a66);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 6c95832..25d0bc0 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 _0xff8f=['isAuthenticated','create','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','index','/describe','/:id'];(function(_0x1418ce,_0x29187f){var _0x431601=function(_0x253e7c){while(--_0x253e7c){_0x1418ce['push'](_0x1418ce['shift']());}};_0x431601(++_0x29187f);}(_0xff8f,0xa7));var _0xfff8=function(_0x374633,_0x349ba2){_0x374633=_0x374633-0x0;var _0x36da25=_0xff8f[_0x374633];return _0x36da25;};'use strict';var multer=require('multer');var util=require(_0xfff8('0x0'));var path=require(_0xfff8('0x1'));var timeout=require(_0xfff8('0x2'));var express=require(_0xfff8('0x3'));var router=express['Router']();var fs_extra=require(_0xfff8('0x4'));var auth=require(_0xfff8('0x5'));var interaction=require(_0xfff8('0x6'));var config=require(_0xfff8('0x7'));var controller=require(_0xfff8('0x8'));router[_0xfff8('0x9')]('/',auth['isAuthenticated'](),controller[_0xfff8('0xa')]);router[_0xfff8('0x9')](_0xfff8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xfff8('0x9')](_0xfff8('0xc'),auth[_0xfff8('0xd')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xfff8('0xe')]);router['put'](_0xfff8('0xc'),auth[_0xfff8('0xd')](),controller[_0xfff8('0xf')]);router[_0xfff8('0x10')](_0xfff8('0xc'),auth[_0xfff8('0xd')](),controller[_0xfff8('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3289=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','index','/describe','isAuthenticated','get','/:id','show','post','create','update','destroy','exports','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3289,0x1c1));var _0x9328=function(_0x39eae6,_0xc302ba){_0x39eae6=_0x39eae6-0x0;var _0x14b771=_0x3289[_0x39eae6];return _0x14b771;};'use strict';var multer=require('multer');var util=require(_0x9328('0x0'));var path=require(_0x9328('0x1'));var timeout=require(_0x9328('0x2'));var express=require('express');var router=express[_0x9328('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9328('0x4'));var interaction=require(_0x9328('0x5'));var config=require('../../config/environment');var controller=require(_0x9328('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9328('0x7')]);router['get'](_0x9328('0x8'),auth[_0x9328('0x9')](),controller['describe']);router[_0x9328('0xa')](_0x9328('0xb'),auth[_0x9328('0x9')](),controller[_0x9328('0xc')]);router[_0x9328('0xd')]('/',auth['isAuthenticated'](),controller[_0x9328('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9328('0xf')]);router['delete']('/:id',auth[_0x9328('0x9')](),controller[_0x9328('0x10')]);module[_0x9328('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 916c324..f3bfcc3 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(_0x457ec3,_0x40519e){var _0x28c76f=function(_0x4cb9d9){while(--_0x4cb9d9){_0x457ec3['push'](_0x457ec3['shift']());}};_0x28c76f(++_0x40519e);}(_0x7a54,0x106));var _0x47a5=function(_0xf4ac8f,_0x279a6f){_0xf4ac8f=_0xf4ac8f-0x0;var _0xfd9f1d=_0x7a54[_0xf4ac8f];return _0xfd9f1d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x94bc6a,_0x3ffd48){var _0x1d6acd=function(_0x24e645){while(--_0x24e645){_0x94bc6a['push'](_0x94bc6a['shift']());}};_0x1d6acd(++_0x3ffd48);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3963cb1..12812d6 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 _0xb9a7=['include','rows','catch','show','params','rawAttributes','intersection','create','body','describe','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','stack','map','WhatsappQueueReport','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll'];(function(_0x204751,_0x755f9a){var _0x581a89=function(_0x2a2d01){while(--_0x2a2d01){_0x204751['push'](_0x204751['shift']());}};_0x581a89(++_0x755f9a);}(_0xb9a7,0x112));var _0x7b9a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb9a7[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)[_0x7b9a('0x15')]();});}};}function handleEntityNotFound(_0x23219e,_0x5809f5){return function(_0x39b7ec){if(!_0x39b7ec){_0x23219e['sendStatus'](0x194);}return _0x39b7ec;};}function handleError(_0x31eb67,_0x3091ab){_0x3091ab=_0x3091ab||0x1f4;return function(_0x4c2271){logger['error'](_0x4c2271[_0x7b9a('0x20')]);if(_0x4c2271['name']){delete _0x4c2271['name'];}_0x31eb67[_0x7b9a('0x14')](_0x3091ab)['send'](_0x4c2271);};}exports['index']=function(_0x3847b4,_0x4d5880){var _0x5c89b6={},_0x314b6d={},_0x4fee38={'count':0x0,'rows':[]};var _0x1553ae=_[_0x7b9a('0x21')](db[_0x7b9a('0x22')]['rawAttributes'],function(_0x45ccf5){return{'name':_0x45ccf5[_0x7b9a('0x23')],'type':_0x45ccf5[_0x7b9a('0x24')][_0x7b9a('0x25')]};});_0x314b6d[_0x7b9a('0x26')]=_[_0x7b9a('0x21')](_0x1553ae,'name');_0x314b6d['query']=_[_0x7b9a('0x27')](_0x3847b4[_0x7b9a('0x28')]);_0x314b6d[_0x7b9a('0x29')]=_['intersection'](_0x314b6d[_0x7b9a('0x26')],_0x314b6d[_0x7b9a('0x28')]);_0x5c89b6['attributes']=_['intersection'](_0x314b6d[_0x7b9a('0x26')],qs[_0x7b9a('0x2a')](_0x3847b4['query'][_0x7b9a('0x2a')]));_0x5c89b6[_0x7b9a('0x2b')]=_0x5c89b6[_0x7b9a('0x2b')][_0x7b9a('0x2c')]?_0x5c89b6[_0x7b9a('0x2b')]:_0x314b6d['model'];if(!_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x2d')](_0x7b9a('0x2e'))){_0x5c89b6[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x3847b4[_0x7b9a('0x28')]['limit']);_0x5c89b6['offset']=qs[_0x7b9a('0x17')](_0x3847b4[_0x7b9a('0x28')]['offset']);}_0x5c89b6[_0x7b9a('0x2f')]=qs[_0x7b9a('0x30')](_0x3847b4[_0x7b9a('0x28')]['sort']);_0x5c89b6[_0x7b9a('0x31')]=qs[_0x7b9a('0x29')](_['pick'](_0x3847b4['query'],_0x314b6d[_0x7b9a('0x29')]),_0x1553ae);if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]){_0x5c89b6[_0x7b9a('0x31')]=_[_0x7b9a('0x33')](_0x5c89b6[_0x7b9a('0x31')],{'$or':_[_0x7b9a('0x21')](_0x1553ae,function(_0x380f4b){if(_0x380f4b['type']!==_0x7b9a('0x34')){var _0x5ac175={};_0x5ac175[_0x380f4b[_0x7b9a('0x35')]]={'$like':'%'+_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x32')]+'%'};return _0x5ac175;}})});}_0x5c89b6=_[_0x7b9a('0x33')]({},_0x5c89b6,_0x3847b4[_0x7b9a('0x36')]);var _0x89951b={'where':_0x5c89b6['where']};return db[_0x7b9a('0x22')][_0x7b9a('0x19')](_0x89951b)[_0x7b9a('0x1e')](function(_0x1bc1f0){_0x4fee38['count']=_0x1bc1f0;if(_0x3847b4[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x5c89b6[_0x7b9a('0x38')]=[{'all':!![]}];}return db[_0x7b9a('0x22')]['findAll'](_0x5c89b6);})[_0x7b9a('0x1e')](function(_0x53d89a){_0x4fee38[_0x7b9a('0x39')]=_0x53d89a;return _0x4fee38;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x4d5880,_0x5c89b6))[_0x7b9a('0x3a')](handleError(_0x4d5880,null));};exports[_0x7b9a('0x3b')]=function(_0x43fad0,_0x41f541){var _0x56e274={'raw':!![],'where':{'id':_0x43fad0[_0x7b9a('0x3c')]['id']}},_0x33edc6={};_0x33edc6[_0x7b9a('0x26')]=_['keys'](db['WhatsappQueueReport'][_0x7b9a('0x3d')]);_0x33edc6[_0x7b9a('0x28')]=_[_0x7b9a('0x27')](_0x43fad0[_0x7b9a('0x28')]);_0x33edc6[_0x7b9a('0x29')]=_[_0x7b9a('0x3e')](_0x33edc6['model'],_0x33edc6['query']);_0x56e274['attributes']=_[_0x7b9a('0x3e')](_0x33edc6[_0x7b9a('0x26')],qs['fields'](_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x2a')]));_0x56e274[_0x7b9a('0x2b')]=_0x56e274['attributes'][_0x7b9a('0x2c')]?_0x56e274['attributes']:_0x33edc6[_0x7b9a('0x26')];if(_0x43fad0[_0x7b9a('0x28')][_0x7b9a('0x37')]){_0x56e274[_0x7b9a('0x38')]=[{'all':!![]}];}_0x56e274=_[_0x7b9a('0x33')]({},_0x56e274,_0x43fad0['options']);return db[_0x7b9a('0x22')]['find'](_0x56e274)[_0x7b9a('0x1e')](handleEntityNotFound(_0x41f541,null))['then'](respondWithResult(_0x41f541,null))['catch'](handleError(_0x41f541,null));};exports[_0x7b9a('0x3f')]=function(_0x3727ef,_0x717d08){return db[_0x7b9a('0x22')][_0x7b9a('0x3f')](_0x3727ef[_0x7b9a('0x40')],{})[_0x7b9a('0x1e')](respondWithResult(_0x717d08,0xc9))[_0x7b9a('0x3a')](handleError(_0x717d08,null));};exports[_0x7b9a('0x1d')]=function(_0x5088c7,_0x1d7957){if(_0x5088c7[_0x7b9a('0x40')]['id']){delete _0x5088c7['body']['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x5088c7[_0x7b9a('0x3c')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1d7957,null))[_0x7b9a('0x1e')](saveUpdates(_0x5088c7[_0x7b9a('0x40')],null))['then'](respondWithResult(_0x1d7957,null))[_0x7b9a('0x3a')](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1f')]=function(_0x287dea,_0x33b200){return db[_0x7b9a('0x22')]['find']({'where':{'id':_0x287dea[_0x7b9a('0x3c')]['id']}})['then'](handleEntityNotFound(_0x33b200,null))[_0x7b9a('0x1e')](removeEntity(_0x33b200,null))[_0x7b9a('0x3a')](handleError(_0x33b200,null));};exports[_0x7b9a('0x41')]=function(_0x3f42a2,_0x52f2ca){return db[_0x7b9a('0x22')][_0x7b9a('0x41')]()[_0x7b9a('0x1e')](respondWithResult(_0x52f2ca,null))[_0x7b9a('0x3a')](handleError(_0x52f2ca,null));}; \ No newline at end of file +var _0x7af2=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x1cde17,_0x2fd08e){var _0x3203de=function(_0x5c8c4f){while(--_0x5c8c4f){_0x1cde17['push'](_0x1cde17['shift']());}};_0x3203de(++_0x2fd08e);}(_0x7af2,0x119));var _0x27af=function(_0xff5c73,_0x5ad315){_0xff5c73=_0xff5c73-0x0;var _0xa4126b=_0x7af2[_0xff5c73];return _0xa4126b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];function respondWithStatusCode(_0x49a883,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x203501){if(_0x203501){return _0x49a883[_0x27af('0x17')](_0x406340);}return _0x49a883[_0x27af('0x18')](_0x406340)[_0x27af('0x19')]();};}function respondWithResult(_0x1edb50,_0x234825){_0x234825=_0x234825||0xc8;return function(_0x3da435){if(_0x3da435){return _0x1edb50[_0x27af('0x18')](_0x234825)[_0x27af('0x1a')](_0x3da435);}};}function respondWithFilteredResult(_0x30f675,_0x9c2d4b){return function(_0x2d7800){if(_0x2d7800){var _0x3102c4=typeof _0x9c2d4b[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x9c2d4b[_0x27af('0x1d')]===_0x27af('0x1c');var _0x58583a=_0x2d7800[_0x27af('0x1e')];var _0x31d702=_0x3102c4?0x0:_0x9c2d4b['offset'];var _0x4e6e2f=_0x3102c4?_0x2d7800[_0x27af('0x1e')]:_0x9c2d4b[_0x27af('0x1b')]+_0x9c2d4b[_0x27af('0x1d')];var _0x31573a;if(_0x4e6e2f>=_0x58583a){_0x4e6e2f=_0x58583a;_0x31573a=0xc8;}else{_0x31573a=0xce;}_0x30f675[_0x27af('0x18')](_0x31573a);return _0x30f675['set'](_0x27af('0x1f'),_0x31d702+'-'+_0x4e6e2f+'/'+_0x58583a)[_0x27af('0x1a')](_0x2d7800);}return null;};}function patchUpdates(_0xcb4b90){return function(_0x5e7c19){try{jsonpatch[_0x27af('0x20')](_0x5e7c19,_0xcb4b90,!![]);}catch(_0x2eec5f){return BPromise[_0x27af('0x21')](_0x2eec5f);}return _0x5e7c19['save']();};}function saveUpdates(_0x2dce2b,_0x2460f4){return function(_0x30720b){if(_0x30720b){return _0x30720b[_0x27af('0x22')](_0x2dce2b)[_0x27af('0x23')](function(_0x396156){return _0x396156;});}return null;};}function removeEntity(_0x43dd9e,_0x35b36d){return function(_0x2e1bb0){if(_0x2e1bb0){return _0x2e1bb0['destroy']()['then'](function(){_0x43dd9e['status'](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x4feaf1,_0x12625c){return function(_0x396326){if(!_0x396326){_0x4feaf1['sendStatus'](0x194);}return _0x396326;};}function handleError(_0x393190,_0x1d9341){_0x1d9341=_0x1d9341||0x1f4;return function(_0x463e36){logger[_0x27af('0x24')](_0x463e36[_0x27af('0x25')]);if(_0x463e36[_0x27af('0x26')]){delete _0x463e36[_0x27af('0x26')];}_0x393190['status'](_0x1d9341)[_0x27af('0x27')](_0x463e36);};}exports[_0x27af('0x28')]=function(_0xadd38e,_0xe009a){var _0x25d65a={},_0xa08dd9={},_0x42a5b7={'count':0x0,'rows':[]};var _0x2b26ac=_[_0x27af('0x29')](db[_0x27af('0x2a')][_0x27af('0x2b')],function(_0x4f4955){return{'name':_0x4f4955[_0x27af('0x2c')],'type':_0x4f4955[_0x27af('0x2d')][_0x27af('0x2e')]};});_0xa08dd9[_0x27af('0x2f')]=_[_0x27af('0x29')](_0x2b26ac,_0x27af('0x26'));_0xa08dd9['query']=_['keys'](_0xadd38e[_0x27af('0x30')]);_0xa08dd9[_0x27af('0x31')]=_['intersection'](_0xa08dd9[_0x27af('0x2f')],_0xa08dd9[_0x27af('0x30')]);_0x25d65a[_0x27af('0x32')]=_[_0x27af('0x33')](_0xa08dd9[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xadd38e[_0x27af('0x30')][_0x27af('0x34')]));_0x25d65a[_0x27af('0x32')]=_0x25d65a[_0x27af('0x32')][_0x27af('0x35')]?_0x25d65a['attributes']:_0xa08dd9['model'];if(!_0xadd38e[_0x27af('0x30')][_0x27af('0x36')]('nolimit')){_0x25d65a[_0x27af('0x1d')]=qs[_0x27af('0x1d')](_0xadd38e['query'][_0x27af('0x1d')]);_0x25d65a[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xadd38e[_0x27af('0x30')][_0x27af('0x1b')]);}_0x25d65a['order']=qs[_0x27af('0x37')](_0xadd38e[_0x27af('0x30')]['sort']);_0x25d65a['where']=qs[_0x27af('0x31')](_[_0x27af('0x38')](_0xadd38e[_0x27af('0x30')],_0xa08dd9[_0x27af('0x31')]),_0x2b26ac);if(_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]){_0x25d65a['where']=_[_0x27af('0x3a')](_0x25d65a['where'],{'$or':_[_0x27af('0x29')](_0x2b26ac,function(_0x38a532){if(_0x38a532[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x1c6a4d={};_0x1c6a4d[_0x38a532['name']]={'$like':'%'+_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]+'%'};return _0x1c6a4d;}})});}_0x25d65a=_[_0x27af('0x3a')]({},_0x25d65a,_0xadd38e[_0x27af('0x3c')]);var _0x10c1be={'where':_0x25d65a[_0x27af('0x3d')]};return db[_0x27af('0x2a')][_0x27af('0x1e')](_0x10c1be)[_0x27af('0x23')](function(_0x18f11b){_0x42a5b7[_0x27af('0x1e')]=_0x18f11b;if(_0xadd38e[_0x27af('0x30')][_0x27af('0x3e')]){_0x25d65a[_0x27af('0x3f')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x27af('0x40')](_0x25d65a);})[_0x27af('0x23')](function(_0x44534b){_0x42a5b7[_0x27af('0x41')]=_0x44534b;return _0x42a5b7;})['then'](respondWithFilteredResult(_0xe009a,_0x25d65a))[_0x27af('0x42')](handleError(_0xe009a,null));};exports['show']=function(_0x516651,_0x2425dd){var _0x3c9c81={'raw':!![],'where':{'id':_0x516651[_0x27af('0x43')]['id']}},_0x279f99={};_0x279f99[_0x27af('0x2f')]=_[_0x27af('0x44')](db[_0x27af('0x2a')][_0x27af('0x2b')]);_0x279f99[_0x27af('0x30')]=_[_0x27af('0x44')](_0x516651[_0x27af('0x30')]);_0x279f99[_0x27af('0x31')]=_['intersection'](_0x279f99[_0x27af('0x2f')],_0x279f99[_0x27af('0x30')]);_0x3c9c81['attributes']=_['intersection'](_0x279f99[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x516651[_0x27af('0x30')][_0x27af('0x34')]));_0x3c9c81[_0x27af('0x32')]=_0x3c9c81['attributes'][_0x27af('0x35')]?_0x3c9c81['attributes']:_0x279f99[_0x27af('0x2f')];if(_0x516651[_0x27af('0x30')][_0x27af('0x3e')]){_0x3c9c81[_0x27af('0x3f')]=[{'all':!![]}];}_0x3c9c81=_[_0x27af('0x3a')]({},_0x3c9c81,_0x516651[_0x27af('0x3c')]);return db[_0x27af('0x2a')]['find'](_0x3c9c81)['then'](handleEntityNotFound(_0x2425dd,null))[_0x27af('0x23')](respondWithResult(_0x2425dd,null))['catch'](handleError(_0x2425dd,null));};exports[_0x27af('0x45')]=function(_0x1b43e2,_0x226025){return db[_0x27af('0x2a')][_0x27af('0x45')](_0x1b43e2[_0x27af('0x46')],{})[_0x27af('0x23')](respondWithResult(_0x226025,0xc9))['catch'](handleError(_0x226025,null));};exports[_0x27af('0x22')]=function(_0xc7e2a8,_0x20e180){if(_0xc7e2a8[_0x27af('0x46')]['id']){delete _0xc7e2a8[_0x27af('0x46')]['id'];}return db['WhatsappQueueReport'][_0x27af('0x47')]({'where':{'id':_0xc7e2a8[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x20e180,null))['then'](saveUpdates(_0xc7e2a8['body'],null))[_0x27af('0x23')](respondWithResult(_0x20e180,null))[_0x27af('0x42')](handleError(_0x20e180,null));};exports[_0x27af('0x48')]=function(_0x5be44f,_0x495794){return db[_0x27af('0x2a')]['find']({'where':{'id':_0x5be44f[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x495794,null))[_0x27af('0x23')](removeEntity(_0x495794,null))[_0x27af('0x42')](handleError(_0x495794,null));};exports[_0x27af('0x49')]=function(_0xb9e23,_0x123533){return db[_0x27af('0x2a')][_0x27af('0x49')]()[_0x27af('0x23')](respondWithResult(_0x123533,null))[_0x27af('0x42')](handleError(_0x123533,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 4945545..d79ee39 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 _0x42e2=['define','WhatsappQueueReport','report_whatsapp_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x25292e,_0x44f47f){var _0x48de57=function(_0x5c199d){while(--_0x5c199d){_0x25292e['push'](_0x25292e['shift']());}};_0x48de57(++_0x44f47f);}(_0x42e2,0x17c));var _0x242e=function(_0x68fb4d,_0x987a83){_0x68fb4d=_0x68fb4d-0x0;var _0x5a3db6=_0x42e2[_0x68fb4d];return _0x5a3db6;};'use strict';var _=require(_0x242e('0x0'));var util=require(_0x242e('0x1'));var logger=require(_0x242e('0x2'))(_0x242e('0x3'));var moment=require(_0x242e('0x4'));var BPromise=require(_0x242e('0x5'));var rp=require(_0x242e('0x6'));var fs=require('fs');var path=require(_0x242e('0x7'));var rimraf=require('rimraf');var config=require(_0x242e('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0x242e('0x9')]=function(_0x3fc951,_0x33c0ff){return _0x3fc951[_0x242e('0xa')](_0x242e('0xb'),attributes,{'tableName':_0x242e('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x058f=['util','../../config/logger','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue','uniqueid','lodash'];(function(_0x50e55a,_0x1ed537){var _0x2576f3=function(_0x258587){while(--_0x258587){_0x50e55a['push'](_0x50e55a['shift']());}};_0x2576f3(++_0x1ed537);}(_0x058f,0x1d7));var _0xf058=function(_0x1f3e3f,_0xde5cdc){_0x1f3e3f=_0x1f3e3f-0x0;var _0x4051fa=_0x058f[_0x1f3e3f];return _0x4051fa;};'use strict';var _=require(_0xf058('0x0'));var util=require(_0xf058('0x1'));var logger=require(_0xf058('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf058('0x3'));module[_0xf058('0x4')]=function(_0x3d53b1,_0x3a43c9){return _0x3d53b1[_0xf058('0x5')]('WhatsappQueueReport',attributes,{'tableName':_0xf058('0x6'),'paranoid':![],'indexes':[{'name':_0xf058('0x7'),'fields':[_0xf058('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 02dad0b..e904618 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 _0xa5e8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','debug','UpdateWhatsappQueueReport','attributes','limit','lodash','util'];(function(_0x4bbdd8,_0x358912){var _0xe25946=function(_0x2868ba){while(--_0x2868ba){_0x4bbdd8['push'](_0x4bbdd8['shift']());}};_0xe25946(++_0x358912);}(_0xa5e8,0x130));var _0x8a5e=function(_0x402f93,_0x151360){_0x402f93=_0x402f93-0x0;var _0x54feba=_0xa5e8[_0x402f93];return _0x54feba;};'use strict';var _=require(_0x8a5e('0x0'));var util=require(_0x8a5e('0x1'));var moment=require(_0x8a5e('0x2'));var BPromise=require(_0x8a5e('0x3'));var rs=require(_0x8a5e('0x4'));var fs=require('fs');var Redis=require(_0x8a5e('0x5'));var db=require(_0x8a5e('0x6'))['db'];var utils=require(_0x8a5e('0x7'));var logger=require(_0x8a5e('0x8'))(_0x8a5e('0x9'));var config=require(_0x8a5e('0xa'));var jayson=require(_0x8a5e('0xb'));var client=jayson[_0x8a5e('0xc')][_0x8a5e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x162dee,_0x17cf6b,_0x30d17a){return new BPromise(function(_0x52929d,_0x5a3571){return client[_0x8a5e('0xe')](_0x162dee,_0x30d17a)[_0x8a5e('0xf')](function(_0x2a1540){logger[_0x8a5e('0x10')](_0x8a5e('0x11'),_0x17cf6b,_0x8a5e('0x12'));logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x17cf6b,_0x8a5e('0x12'),JSON[_0x8a5e('0x13')](_0x2a1540));if(_0x2a1540[_0x8a5e('0x14')]){if(_0x2a1540[_0x8a5e('0x14')][_0x8a5e('0x15')]===0x1f4){logger['error'](_0x8a5e('0x11'),_0x17cf6b,_0x2a1540['error'][_0x8a5e('0x16')]);return _0x5a3571(_0x2a1540['error'][_0x8a5e('0x16')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x17cf6b,_0x2a1540[_0x8a5e('0x14')][_0x8a5e('0x16')]);return _0x52929d(_0x2a1540[_0x8a5e('0x14')][_0x8a5e('0x16')]);}else{logger[_0x8a5e('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x17cf6b,'request\x20sent');_0x52929d(_0x2a1540[_0x8a5e('0x17')][_0x8a5e('0x16')]);}})[_0x8a5e('0x18')](function(_0xd845e1){logger[_0x8a5e('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x17cf6b,_0xd845e1);_0x5a3571(_0xd845e1);});});}exports[_0x8a5e('0x19')]=function(_0x2529cc){var _0x5e7f0b=this;return new Promise(function(_0x456b26,_0x5295a3){return db[_0x8a5e('0x1a')]['create'](_0x2529cc[_0x8a5e('0x1b')],{'raw':_0x2529cc[_0x8a5e('0x1c')]?_0x2529cc[_0x8a5e('0x1c')][_0x8a5e('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1b0485){logger['info'](_0x8a5e('0x19'),_0x2529cc);logger[_0x8a5e('0x1e')](_0x8a5e('0x19'),_0x2529cc,JSON[_0x8a5e('0x13')](_0x1b0485));_0x456b26(_0x1b0485);})[_0x8a5e('0x18')](function(_0x1e4a21){logger[_0x8a5e('0x14')]('CreateWhatsappQueueReport',_0x1e4a21[_0x8a5e('0x16')],_0x2529cc);_0x5295a3(_0x5e7f0b[_0x8a5e('0x14')](0x1f4,_0x1e4a21[_0x8a5e('0x16')]));});});};exports[_0x8a5e('0x1f')]=function(_0xf74fc1){var _0xa317c8=this;return new Promise(function(_0x20f6bf,_0x1175f2){return db[_0x8a5e('0x1a')]['update'](_0xf74fc1[_0x8a5e('0x1b')],{'raw':_0xf74fc1[_0x8a5e('0x1c')]?_0xf74fc1[_0x8a5e('0x1c')][_0x8a5e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf74fc1[_0x8a5e('0x1c')]?_0xf74fc1[_0x8a5e('0x1c')]['where']||null:null,'attributes':_0xf74fc1[_0x8a5e('0x1c')]?_0xf74fc1[_0x8a5e('0x1c')][_0x8a5e('0x20')]||null:null,'limit':_0xf74fc1[_0x8a5e('0x1c')]?_0xf74fc1[_0x8a5e('0x1c')][_0x8a5e('0x21')]||null:null})['then'](function(_0x177cb7){logger[_0x8a5e('0x10')](_0x8a5e('0x1f'),_0xf74fc1);logger[_0x8a5e('0x1e')](_0x8a5e('0x1f'),_0xf74fc1,JSON[_0x8a5e('0x13')](_0x177cb7));_0x20f6bf(_0x177cb7);})[_0x8a5e('0x18')](function(_0xd4a3fb){logger['error'](_0x8a5e('0x1f'),_0xd4a3fb[_0x8a5e('0x16')],_0xf74fc1);_0x1175f2(_0xa317c8['error'](0x1f4,_0xd4a3fb['message']));});});}; \ No newline at end of file +var _0x4175=['error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then','UpdateWhatsappQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1d25e4,_0x455583){var _0x3f1238=function(_0xd5d35){while(--_0xd5d35){_0x1d25e4['push'](_0x1d25e4['shift']());}};_0x3f1238(++_0x455583);}(_0x4175,0x164));var _0x5417=function(_0x50537,_0x3ea336){_0x50537=_0x50537-0x0;var _0x5703e9=_0x4175[_0x50537];return _0x5703e9;};'use strict';var _=require(_0x5417('0x0'));var util=require(_0x5417('0x1'));var moment=require(_0x5417('0x2'));var BPromise=require(_0x5417('0x3'));var rs=require(_0x5417('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5417('0x5'))['db'];var utils=require(_0x5417('0x6'));var logger=require('../../config/logger')(_0x5417('0x7'));var config=require(_0x5417('0x8'));var jayson=require(_0x5417('0x9'));var client=jayson[_0x5417('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e77a8,_0x4b0329,_0x552390){return new BPromise(function(_0x5e38ec,_0x5dd864){return client[_0x5417('0xb')](_0x1e77a8,_0x552390)['then'](function(_0x4a07ca){logger[_0x5417('0xc')](_0x5417('0xd'),_0x4b0329,_0x5417('0xe'));logger[_0x5417('0xf')](_0x5417('0x10'),_0x4b0329,'request\x20sent',JSON[_0x5417('0x11')](_0x4a07ca));if(_0x4a07ca['error']){if(_0x4a07ca[_0x5417('0x12')][_0x5417('0x13')]===0x1f4){logger[_0x5417('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4b0329,_0x4a07ca['error'][_0x5417('0x14')]);return _0x5dd864(_0x4a07ca[_0x5417('0x12')][_0x5417('0x14')]);}logger[_0x5417('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4b0329,_0x4a07ca[_0x5417('0x12')][_0x5417('0x14')]);return _0x5e38ec(_0x4a07ca['error']['message']);}else{logger[_0x5417('0xc')](_0x5417('0xd'),_0x4b0329,_0x5417('0xe'));_0x5e38ec(_0x4a07ca[_0x5417('0x15')][_0x5417('0x14')]);}})[_0x5417('0x16')](function(_0x29b575){logger[_0x5417('0x12')](_0x5417('0xd'),_0x4b0329,_0x29b575);_0x5dd864(_0x29b575);});});}exports[_0x5417('0x17')]=function(_0xcc592e){var _0x219149=this;return new Promise(function(_0x4c2f5d,_0x46ba25){return db[_0x5417('0x18')][_0x5417('0x19')](_0xcc592e[_0x5417('0x1a')],{'raw':_0xcc592e[_0x5417('0x1b')]?_0xcc592e[_0x5417('0x1b')][_0x5417('0x1c')]===undefined?!![]:![]:!![]})[_0x5417('0x1d')](function(_0x35eabf){logger[_0x5417('0xc')](_0x5417('0x17'),_0xcc592e);logger[_0x5417('0xf')](_0x5417('0x17'),_0xcc592e,JSON[_0x5417('0x11')](_0x35eabf));_0x4c2f5d(_0x35eabf);})['catch'](function(_0x35409d){logger[_0x5417('0x12')]('CreateWhatsappQueueReport',_0x35409d[_0x5417('0x14')],_0xcc592e);_0x46ba25(_0x219149['error'](0x1f4,_0x35409d['message']));});});};exports[_0x5417('0x1e')]=function(_0x50727c){var _0x516cad=this;return new Promise(function(_0x460bbc,_0x39dc7b){return db[_0x5417('0x18')]['update'](_0x50727c['body'],{'raw':_0x50727c[_0x5417('0x1b')]?_0x50727c[_0x5417('0x1b')][_0x5417('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50727c['options']?_0x50727c[_0x5417('0x1b')][_0x5417('0x1f')]||null:null,'attributes':_0x50727c['options']?_0x50727c[_0x5417('0x1b')][_0x5417('0x20')]||null:null,'limit':_0x50727c['options']?_0x50727c[_0x5417('0x1b')][_0x5417('0x21')]||null:null})[_0x5417('0x1d')](function(_0x442299){logger[_0x5417('0xc')]('UpdateWhatsappQueueReport',_0x50727c);logger['debug'](_0x5417('0x1e'),_0x50727c,JSON['stringify'](_0x442299));_0x460bbc(_0x442299);})['catch'](function(_0x45677f){logger[_0x5417('0x12')](_0x5417('0x1e'),_0x45677f[_0x5417('0x14')],_0x50727c);_0x39dc7b(_0x516cad[_0x5417('0x12')](0x1f4,_0x45677f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 425d2bf..0a9e66b 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 _0x2d60=['describe','show','put','/:id','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3a5297,_0x103294){var _0x580bc9=function(_0x2c6112){while(--_0x2c6112){_0x3a5297['push'](_0x3a5297['shift']());}};_0x580bc9(++_0x103294);}(_0x2d60,0x191));var _0x02d6=function(_0x2a9f12,_0x3cd53a){_0x2a9f12=_0x2a9f12-0x0;var _0x4b1aa4=_0x2d60[_0x2a9f12];return _0x4b1aa4;};'use strict';var multer=require('multer');var util=require(_0x02d6('0x0'));var path=require(_0x02d6('0x1'));var timeout=require(_0x02d6('0x2'));var express=require(_0x02d6('0x3'));var router=express[_0x02d6('0x4')]();var fs_extra=require(_0x02d6('0x5'));var auth=require(_0x02d6('0x6'));var interaction=require(_0x02d6('0x7'));var config=require(_0x02d6('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x02d6('0x9')]('/',auth[_0x02d6('0xa')](),controller[_0x02d6('0xb')]);router[_0x02d6('0x9')](_0x02d6('0xc'),auth['isAuthenticated'](),controller[_0x02d6('0xd')]);router[_0x02d6('0x9')]('/:id',auth[_0x02d6('0xa')](),controller[_0x02d6('0xe')]);router['post']('/',auth[_0x02d6('0xa')](),controller['create']);router[_0x02d6('0xf')](_0x02d6('0x10'),auth[_0x02d6('0xa')](),controller['update']);router['delete'](_0x02d6('0x10'),auth[_0x02d6('0xa')](),controller[_0x02d6('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb34b=['delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index','describe','show','post','create','/:id','update'];(function(_0x2dfc32,_0x5f52d0){var _0x527827=function(_0xcc6a21){while(--_0xcc6a21){_0x2dfc32['push'](_0x2dfc32['shift']());}};_0x527827(++_0x5f52d0);}(_0xb34b,0x18e));var _0xbb34=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb34b[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0xbb34('0x0'));var path=require(_0xbb34('0x1'));var timeout=require(_0xbb34('0x2'));var express=require(_0xbb34('0x3'));var router=express[_0xbb34('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb34('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb34('0x6'));var controller=require(_0xbb34('0x7'));router['get']('/',auth[_0xbb34('0x8')](),controller[_0xbb34('0x9')]);router['get']('/describe',auth[_0xbb34('0x8')](),controller[_0xbb34('0xa')]);router['get']('/:id',auth[_0xbb34('0x8')](),controller[_0xbb34('0xb')]);router[_0xbb34('0xc')]('/',auth[_0xbb34('0x8')](),controller[_0xbb34('0xd')]);router['put'](_0xbb34('0xe'),auth[_0xbb34('0x8')](),controller[_0xbb34('0xf')]);router[_0xbb34('0x10')](_0xbb34('0xe'),auth[_0xbb34('0x8')](),controller[_0xbb34('0x11')]);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 b8c9b22..4e46aa1 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 _0x8e3f=['queue','sequelize','exports','STRING','account','agent'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8e3f[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xf8e3('0x0'));module[_0xf8e3('0x1')]={'uniqueid':{'type':Sequelize[_0xf8e3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xf8e3('0x3'),_0xf8e3('0x4'),_0xf8e3('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x199d=['exports','STRING','ENUM','account','queue','sequelize'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x199d,0x13d));var _0xd199=function(_0x28be72,_0x2b83af){_0x28be72=_0x28be72-0x0;var _0x46c5da=_0x199d[_0x28be72];return _0x46c5da;};'use strict';var Sequelize=require(_0xd199('0x0'));module[_0xd199('0x1')]={'uniqueid':{'type':Sequelize[_0xd199('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd199('0x3')](_0xd199('0x4'),'agent',_0xd199('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 1722d92..4d2555f 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 _0x2059=['include','findAll','rows','catch','show','keys','intersection','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll'];(function(_0x54f7e0,_0x37047e){var _0x1e83dd=function(_0x45f78e){while(--_0x45f78e){_0x54f7e0['push'](_0x54f7e0['shift']());}};_0x1e83dd(++_0x37047e);}(_0x2059,0xf6));var _0x9205=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x2059[_0x492535];return _0x256620;};'use strict';var emlformat=require(_0x9205('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9205('0x1'));var jsonpatch=require(_0x9205('0x2'));var rp=require(_0x9205('0x3'));var moment=require(_0x9205('0x4'));var BPromise=require(_0x9205('0x5'));var Mustache=require('mustache');var util=require(_0x9205('0x6'));var path=require(_0x9205('0x7'));var sox=require(_0x9205('0x8'));var csv=require(_0x9205('0x9'));var ejs=require(_0x9205('0xa'));var fs=require('fs');var fs_extra=require(_0x9205('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9205('0xc'));var jsforce=require(_0x9205('0xd'));var deskjs=require(_0x9205('0xe'));var toCsv=require(_0x9205('0x9'));var querystring=require(_0x9205('0xf'));var Papa=require('papaparse');var Redis=require(_0x9205('0x10'));var authService=require(_0x9205('0x11'));var qs=require(_0x9205('0x12'));var as=require(_0x9205('0x13'));var hardwareService=require(_0x9205('0x14'));var logger=require(_0x9205('0x15'))(_0x9205('0x16'));var utils=require(_0x9205('0x17'));var config=require(_0x9205('0x18'));var licenseUtil=require(_0x9205('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe0d011,_0x3e856f){_0x3e856f=_0x3e856f||0xcc;return function(_0x565a73){if(_0x565a73){return _0xe0d011[_0x9205('0x1a')](_0x3e856f);}return _0xe0d011[_0x9205('0x1b')](_0x3e856f)[_0x9205('0x1c')]();};}function respondWithResult(_0x3896f3,_0x108480){_0x108480=_0x108480||0xc8;return function(_0x530bc3){if(_0x530bc3){return _0x3896f3[_0x9205('0x1b')](_0x108480)[_0x9205('0x1d')](_0x530bc3);}};}function respondWithFilteredResult(_0x3ed98a,_0x54a61c){return function(_0x745337){if(_0x745337){var _0x510494=typeof _0x54a61c[_0x9205('0x1e')]==='undefined'&&typeof _0x54a61c[_0x9205('0x1f')]==='undefined';var _0x2d78d5=_0x745337[_0x9205('0x20')];var _0x4bcbec=_0x510494?0x0:_0x54a61c[_0x9205('0x1e')];var _0x16a337=_0x510494?_0x745337[_0x9205('0x20')]:_0x54a61c[_0x9205('0x1e')]+_0x54a61c[_0x9205('0x1f')];var _0x13fb35;if(_0x16a337>=_0x2d78d5){_0x16a337=_0x2d78d5;_0x13fb35=0xc8;}else{_0x13fb35=0xce;}_0x3ed98a[_0x9205('0x1b')](_0x13fb35);return _0x3ed98a['set'](_0x9205('0x21'),_0x4bcbec+'-'+_0x16a337+'/'+_0x2d78d5)[_0x9205('0x1d')](_0x745337);}return null;};}function patchUpdates(_0xf2f5fe){return function(_0x52659f){try{jsonpatch[_0x9205('0x22')](_0x52659f,_0xf2f5fe,!![]);}catch(_0x5a5d68){return BPromise[_0x9205('0x23')](_0x5a5d68);}return _0x52659f[_0x9205('0x24')]();};}function saveUpdates(_0x310d68,_0x20bdb1){return function(_0x14807e){if(_0x14807e){return _0x14807e[_0x9205('0x25')](_0x310d68)[_0x9205('0x26')](function(_0x2d61be){return _0x2d61be;});}return null;};}function removeEntity(_0x3c8e7a,_0x21aefe){return function(_0x469cf7){if(_0x469cf7){return _0x469cf7[_0x9205('0x27')]()['then'](function(){_0x3c8e7a[_0x9205('0x1b')](0xcc)[_0x9205('0x1c')]();});}};}function handleEntityNotFound(_0x3f3c70,_0x11525b){return function(_0x25ba48){if(!_0x25ba48){_0x3f3c70['sendStatus'](0x194);}return _0x25ba48;};}function handleError(_0x22a1e7,_0x3d5afd){_0x3d5afd=_0x3d5afd||0x1f4;return function(_0x20207d){logger[_0x9205('0x28')](_0x20207d['stack']);if(_0x20207d[_0x9205('0x29')]){delete _0x20207d[_0x9205('0x29')];}_0x22a1e7[_0x9205('0x1b')](_0x3d5afd)['send'](_0x20207d);};}exports[_0x9205('0x2a')]=function(_0x167508,_0x2b66ee){var _0x98dada={},_0x309db2={},_0x3428b8={'count':0x0,'rows':[]};var _0x149f3d=_['map'](db['WhatsappTransferReport'][_0x9205('0x2b')],function(_0x1e2862){return{'name':_0x1e2862[_0x9205('0x2c')],'type':_0x1e2862[_0x9205('0x2d')][_0x9205('0x2e')]};});_0x309db2[_0x9205('0x2f')]=_[_0x9205('0x30')](_0x149f3d,_0x9205('0x29'));_0x309db2[_0x9205('0x31')]=_['keys'](_0x167508[_0x9205('0x31')]);_0x309db2[_0x9205('0x32')]=_['intersection'](_0x309db2[_0x9205('0x2f')],_0x309db2[_0x9205('0x31')]);_0x98dada[_0x9205('0x33')]=_['intersection'](_0x309db2[_0x9205('0x2f')],qs['fields'](_0x167508[_0x9205('0x31')][_0x9205('0x34')]));_0x98dada[_0x9205('0x33')]=_0x98dada[_0x9205('0x33')][_0x9205('0x35')]?_0x98dada[_0x9205('0x33')]:_0x309db2[_0x9205('0x2f')];if(!_0x167508[_0x9205('0x31')][_0x9205('0x36')](_0x9205('0x37'))){_0x98dada[_0x9205('0x1f')]=qs[_0x9205('0x1f')](_0x167508[_0x9205('0x31')][_0x9205('0x1f')]);_0x98dada['offset']=qs[_0x9205('0x1e')](_0x167508[_0x9205('0x31')][_0x9205('0x1e')]);}_0x98dada[_0x9205('0x38')]=qs[_0x9205('0x39')](_0x167508[_0x9205('0x31')]['sort']);_0x98dada[_0x9205('0x3a')]=qs['filters'](_[_0x9205('0x3b')](_0x167508[_0x9205('0x31')],_0x309db2['filters']),_0x149f3d);if(_0x167508['query'][_0x9205('0x3c')]){_0x98dada[_0x9205('0x3a')]=_[_0x9205('0x3d')](_0x98dada['where'],{'$or':_['map'](_0x149f3d,function(_0x145cb5){if(_0x145cb5[_0x9205('0x2d')]!==_0x9205('0x3e')){var _0x37eccf={};_0x37eccf[_0x145cb5[_0x9205('0x29')]]={'$like':'%'+_0x167508['query'][_0x9205('0x3c')]+'%'};return _0x37eccf;}})});}_0x98dada=_[_0x9205('0x3d')]({},_0x98dada,_0x167508[_0x9205('0x3f')]);var _0x582037={'where':_0x98dada[_0x9205('0x3a')]};return db[_0x9205('0x40')][_0x9205('0x20')](_0x582037)[_0x9205('0x26')](function(_0x16e264){_0x3428b8[_0x9205('0x20')]=_0x16e264;if(_0x167508[_0x9205('0x31')][_0x9205('0x41')]){_0x98dada[_0x9205('0x42')]=[{'all':!![]}];}return db[_0x9205('0x40')][_0x9205('0x43')](_0x98dada);})['then'](function(_0x18fb82){_0x3428b8[_0x9205('0x44')]=_0x18fb82;return _0x3428b8;})[_0x9205('0x26')](respondWithFilteredResult(_0x2b66ee,_0x98dada))[_0x9205('0x45')](handleError(_0x2b66ee,null));};exports[_0x9205('0x46')]=function(_0x1f33ba,_0x74c26a){var _0x5a34c2={'raw':!![],'where':{'id':_0x1f33ba['params']['id']}},_0x590201={};_0x590201['model']=_[_0x9205('0x47')](db[_0x9205('0x40')]['rawAttributes']);_0x590201['query']=_[_0x9205('0x47')](_0x1f33ba[_0x9205('0x31')]);_0x590201[_0x9205('0x32')]=_[_0x9205('0x48')](_0x590201[_0x9205('0x2f')],_0x590201[_0x9205('0x31')]);_0x5a34c2['attributes']=_[_0x9205('0x48')](_0x590201[_0x9205('0x2f')],qs[_0x9205('0x34')](_0x1f33ba['query']['fields']));_0x5a34c2[_0x9205('0x33')]=_0x5a34c2[_0x9205('0x33')][_0x9205('0x35')]?_0x5a34c2['attributes']:_0x590201[_0x9205('0x2f')];if(_0x1f33ba[_0x9205('0x31')][_0x9205('0x41')]){_0x5a34c2[_0x9205('0x42')]=[{'all':!![]}];}_0x5a34c2=_[_0x9205('0x3d')]({},_0x5a34c2,_0x1f33ba[_0x9205('0x3f')]);return db[_0x9205('0x40')][_0x9205('0x49')](_0x5a34c2)[_0x9205('0x26')](handleEntityNotFound(_0x74c26a,null))[_0x9205('0x26')](respondWithResult(_0x74c26a,null))[_0x9205('0x45')](handleError(_0x74c26a,null));};exports['create']=function(_0x16e582,_0x161652){return db[_0x9205('0x40')][_0x9205('0x4a')](_0x16e582[_0x9205('0x4b')],{})[_0x9205('0x26')](respondWithResult(_0x161652,0xc9))[_0x9205('0x45')](handleError(_0x161652,null));};exports['update']=function(_0x1d7ab3,_0x5bef47){if(_0x1d7ab3[_0x9205('0x4b')]['id']){delete _0x1d7ab3[_0x9205('0x4b')]['id'];}return db[_0x9205('0x40')]['find']({'where':{'id':_0x1d7ab3[_0x9205('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5bef47,null))[_0x9205('0x26')](saveUpdates(_0x1d7ab3['body'],null))[_0x9205('0x26')](respondWithResult(_0x5bef47,null))['catch'](handleError(_0x5bef47,null));};exports[_0x9205('0x27')]=function(_0x4d0c44,_0x413570){return db[_0x9205('0x40')][_0x9205('0x49')]({'where':{'id':_0x4d0c44[_0x9205('0x4c')]['id']}})[_0x9205('0x26')](handleEntityNotFound(_0x413570,null))['then'](removeEntity(_0x413570,null))[_0x9205('0x45')](handleError(_0x413570,null));};exports[_0x9205('0x4d')]=function(_0x63a616,_0x51aff5){return db[_0x9205('0x40')]['describe']()[_0x9205('0x26')](respondWithResult(_0x51aff5,null))[_0x9205('0x45')](handleError(_0x51aff5,null));}; \ No newline at end of file +var _0xc863=['count','status','set','Content-Range','apply','reject','update','then','end','stack','name','send','map','WhatsappTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined'];(function(_0x43b901,_0x1ab3ed){var _0x2f5460=function(_0x5ab646){while(--_0x5ab646){_0x43b901['push'](_0x43b901['shift']());}};_0x2f5460(++_0x1ab3ed);}(_0xc863,0x1ea));var _0x3c86=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0xc863[_0x43a37c];return _0x5d1d40;};'use strict';var emlformat=require(_0x3c86('0x0'));var rimraf=require(_0x3c86('0x1'));var zipdir=require(_0x3c86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c86('0x3'));var moment=require(_0x3c86('0x4'));var BPromise=require(_0x3c86('0x5'));var Mustache=require(_0x3c86('0x6'));var util=require(_0x3c86('0x7'));var path=require(_0x3c86('0x8'));var sox=require('sox');var csv=require(_0x3c86('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c86('0xa'));var _=require(_0x3c86('0xb'));var squel=require('squel');var crypto=require(_0x3c86('0xc'));var jsforce=require(_0x3c86('0xd'));var deskjs=require(_0x3c86('0xe'));var toCsv=require(_0x3c86('0x9'));var querystring=require(_0x3c86('0xf'));var Papa=require(_0x3c86('0x10'));var Redis=require('ioredis');var authService=require(_0x3c86('0x11'));var qs=require(_0x3c86('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c86('0x13'));var logger=require(_0x3c86('0x14'))(_0x3c86('0x15'));var utils=require('../../config/utils');var config=require(_0x3c86('0x16'));var licenseUtil=require(_0x3c86('0x17'));var db=require(_0x3c86('0x18'))['db'];function respondWithStatusCode(_0x3c350e,_0x311178){_0x311178=_0x311178||0xcc;return function(_0x4a2c58){if(_0x4a2c58){return _0x3c350e['sendStatus'](_0x311178);}return _0x3c350e['status'](_0x311178)['end']();};}function respondWithResult(_0x362c7e,_0x30b442){_0x30b442=_0x30b442||0xc8;return function(_0x23a3c4){if(_0x23a3c4){return _0x362c7e['status'](_0x30b442)[_0x3c86('0x19')](_0x23a3c4);}};}function respondWithFilteredResult(_0x2091e3,_0x30bee4){return function(_0x540dab){if(_0x540dab){var _0x213070=typeof _0x30bee4[_0x3c86('0x1a')]==='undefined'&&typeof _0x30bee4['limit']===_0x3c86('0x1b');var _0xc3026e=_0x540dab[_0x3c86('0x1c')];var _0x5cbc8e=_0x213070?0x0:_0x30bee4[_0x3c86('0x1a')];var _0x2d416d=_0x213070?_0x540dab[_0x3c86('0x1c')]:_0x30bee4[_0x3c86('0x1a')]+_0x30bee4['limit'];var _0x2018a2;if(_0x2d416d>=_0xc3026e){_0x2d416d=_0xc3026e;_0x2018a2=0xc8;}else{_0x2018a2=0xce;}_0x2091e3[_0x3c86('0x1d')](_0x2018a2);return _0x2091e3[_0x3c86('0x1e')](_0x3c86('0x1f'),_0x5cbc8e+'-'+_0x2d416d+'/'+_0xc3026e)['json'](_0x540dab);}return null;};}function patchUpdates(_0x381ff1){return function(_0x291a4a){try{jsonpatch[_0x3c86('0x20')](_0x291a4a,_0x381ff1,!![]);}catch(_0x5a7fef){return BPromise[_0x3c86('0x21')](_0x5a7fef);}return _0x291a4a['save']();};}function saveUpdates(_0x7087d9,_0xb6a2f1){return function(_0x19d411){if(_0x19d411){return _0x19d411[_0x3c86('0x22')](_0x7087d9)[_0x3c86('0x23')](function(_0x368845){return _0x368845;});}return null;};}function removeEntity(_0x43e71f,_0x3d6dd){return function(_0x21fbac){if(_0x21fbac){return _0x21fbac['destroy']()['then'](function(){_0x43e71f[_0x3c86('0x1d')](0xcc)[_0x3c86('0x24')]();});}};}function handleEntityNotFound(_0x24fc1e,_0x3a211e){return function(_0x5d7739){if(!_0x5d7739){_0x24fc1e['sendStatus'](0x194);}return _0x5d7739;};}function handleError(_0x2e5113,_0x13bd08){_0x13bd08=_0x13bd08||0x1f4;return function(_0x59d290){logger['error'](_0x59d290[_0x3c86('0x25')]);if(_0x59d290[_0x3c86('0x26')]){delete _0x59d290[_0x3c86('0x26')];}_0x2e5113[_0x3c86('0x1d')](_0x13bd08)[_0x3c86('0x27')](_0x59d290);};}exports['index']=function(_0x50f2c1,_0x19889e){var _0xe6a952={},_0x4e1730={},_0x237bf9={'count':0x0,'rows':[]};var _0x2bb762=_[_0x3c86('0x28')](db[_0x3c86('0x29')][_0x3c86('0x2a')],function(_0x4215cd){return{'name':_0x4215cd['fieldName'],'type':_0x4215cd[_0x3c86('0x2b')][_0x3c86('0x2c')]};});_0x4e1730[_0x3c86('0x2d')]=_[_0x3c86('0x28')](_0x2bb762,_0x3c86('0x26'));_0x4e1730[_0x3c86('0x2e')]=_[_0x3c86('0x2f')](_0x50f2c1[_0x3c86('0x2e')]);_0x4e1730[_0x3c86('0x30')]=_[_0x3c86('0x31')](_0x4e1730[_0x3c86('0x2d')],_0x4e1730[_0x3c86('0x2e')]);_0xe6a952[_0x3c86('0x32')]=_[_0x3c86('0x31')](_0x4e1730['model'],qs[_0x3c86('0x33')](_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x33')]));_0xe6a952[_0x3c86('0x32')]=_0xe6a952['attributes'][_0x3c86('0x34')]?_0xe6a952['attributes']:_0x4e1730[_0x3c86('0x2d')];if(!_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x35')](_0x3c86('0x36'))){_0xe6a952[_0x3c86('0x37')]=qs[_0x3c86('0x37')](_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x37')]);_0xe6a952['offset']=qs[_0x3c86('0x1a')](_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x1a')]);}_0xe6a952['order']=qs[_0x3c86('0x38')](_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x38')]);_0xe6a952[_0x3c86('0x39')]=qs['filters'](_[_0x3c86('0x3a')](_0x50f2c1[_0x3c86('0x2e')],_0x4e1730[_0x3c86('0x30')]),_0x2bb762);if(_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x3b')]){_0xe6a952[_0x3c86('0x39')]=_['merge'](_0xe6a952['where'],{'$or':_[_0x3c86('0x28')](_0x2bb762,function(_0x2ca845){if(_0x2ca845[_0x3c86('0x2b')]!==_0x3c86('0x3c')){var _0x693b49={};_0x693b49[_0x2ca845[_0x3c86('0x26')]]={'$like':'%'+_0x50f2c1[_0x3c86('0x2e')][_0x3c86('0x3b')]+'%'};return _0x693b49;}})});}_0xe6a952=_[_0x3c86('0x3d')]({},_0xe6a952,_0x50f2c1[_0x3c86('0x3e')]);var _0x3cc4ab={'where':_0xe6a952[_0x3c86('0x39')]};return db[_0x3c86('0x29')][_0x3c86('0x1c')](_0x3cc4ab)['then'](function(_0x5f0714){_0x237bf9[_0x3c86('0x1c')]=_0x5f0714;if(_0x50f2c1['query']['includeAll']){_0xe6a952[_0x3c86('0x3f')]=[{'all':!![]}];}return db[_0x3c86('0x29')][_0x3c86('0x40')](_0xe6a952);})[_0x3c86('0x23')](function(_0x5d1942){_0x237bf9[_0x3c86('0x41')]=_0x5d1942;return _0x237bf9;})['then'](respondWithFilteredResult(_0x19889e,_0xe6a952))['catch'](handleError(_0x19889e,null));};exports[_0x3c86('0x42')]=function(_0x3b8685,_0x24b28a){var _0x5e75eb={'raw':!![],'where':{'id':_0x3b8685[_0x3c86('0x43')]['id']}},_0x3a1f89={};_0x3a1f89[_0x3c86('0x2d')]=_[_0x3c86('0x2f')](db[_0x3c86('0x29')][_0x3c86('0x2a')]);_0x3a1f89[_0x3c86('0x2e')]=_[_0x3c86('0x2f')](_0x3b8685['query']);_0x3a1f89[_0x3c86('0x30')]=_['intersection'](_0x3a1f89[_0x3c86('0x2d')],_0x3a1f89[_0x3c86('0x2e')]);_0x5e75eb[_0x3c86('0x32')]=_[_0x3c86('0x31')](_0x3a1f89[_0x3c86('0x2d')],qs['fields'](_0x3b8685['query'][_0x3c86('0x33')]));_0x5e75eb[_0x3c86('0x32')]=_0x5e75eb[_0x3c86('0x32')][_0x3c86('0x34')]?_0x5e75eb[_0x3c86('0x32')]:_0x3a1f89['model'];if(_0x3b8685['query']['includeAll']){_0x5e75eb[_0x3c86('0x3f')]=[{'all':!![]}];}_0x5e75eb=_[_0x3c86('0x3d')]({},_0x5e75eb,_0x3b8685[_0x3c86('0x3e')]);return db['WhatsappTransferReport'][_0x3c86('0x44')](_0x5e75eb)[_0x3c86('0x23')](handleEntityNotFound(_0x24b28a,null))['then'](respondWithResult(_0x24b28a,null))[_0x3c86('0x45')](handleError(_0x24b28a,null));};exports[_0x3c86('0x46')]=function(_0x27dafb,_0x57c41e){return db[_0x3c86('0x29')][_0x3c86('0x46')](_0x27dafb[_0x3c86('0x47')],{})[_0x3c86('0x23')](respondWithResult(_0x57c41e,0xc9))[_0x3c86('0x45')](handleError(_0x57c41e,null));};exports[_0x3c86('0x22')]=function(_0x282b2d,_0x481130){if(_0x282b2d[_0x3c86('0x47')]['id']){delete _0x282b2d[_0x3c86('0x47')]['id'];}return db[_0x3c86('0x29')][_0x3c86('0x44')]({'where':{'id':_0x282b2d[_0x3c86('0x43')]['id']}})[_0x3c86('0x23')](handleEntityNotFound(_0x481130,null))[_0x3c86('0x23')](saveUpdates(_0x282b2d[_0x3c86('0x47')],null))['then'](respondWithResult(_0x481130,null))[_0x3c86('0x45')](handleError(_0x481130,null));};exports[_0x3c86('0x48')]=function(_0x97947a,_0x505973){return db[_0x3c86('0x29')][_0x3c86('0x44')]({'where':{'id':_0x97947a[_0x3c86('0x43')]['id']}})[_0x3c86('0x23')](handleEntityNotFound(_0x505973,null))[_0x3c86('0x23')](removeEntity(_0x505973,null))['catch'](handleError(_0x505973,null));};exports[_0x3c86('0x49')]=function(_0x38a66f,_0x4ecdd8){return db[_0x3c86('0x29')][_0x3c86('0x49')]()['then'](respondWithResult(_0x4ecdd8,null))['catch'](handleError(_0x4ecdd8,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index e78a0ce..62c701d 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 _0x10fc=['path','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1bf00d,_0x118261){var _0x6d6802=function(_0x517eff){while(--_0x517eff){_0x1bf00d['push'](_0x1bf00d['shift']());}};_0x6d6802(++_0x118261);}(_0x10fc,0x1cd));var _0xc10f=function(_0x143f1b,_0x45cc3d){_0x143f1b=_0x143f1b-0x0;var _0x53ef44=_0x10fc[_0x143f1b];return _0x53ef44;};'use strict';var _=require(_0xc10f('0x0'));var util=require(_0xc10f('0x1'));var logger=require(_0xc10f('0x2'))(_0xc10f('0x3'));var moment=require(_0xc10f('0x4'));var BPromise=require(_0xc10f('0x5'));var rp=require(_0xc10f('0x6'));var fs=require('fs');var path=require(_0xc10f('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0xc10f('0x8')]=function(_0x4fa62f,_0x4a6c01){return _0x4fa62f[_0xc10f('0x9')](_0xc10f('0xa'),attributes,{'tableName':_0xc10f('0xb'),'paranoid':![],'indexes':[{'name':_0xc10f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53d9=['define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes'];(function(_0x1bb481,_0x3165ec){var _0x50c272=function(_0x9b82c7){while(--_0x9b82c7){_0x1bb481['push'](_0x1bb481['shift']());}};_0x50c272(++_0x3165ec);}(_0x53d9,0x100));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x953d('0x0'));var util=require(_0x953d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x953d('0x2'));var BPromise=require('bluebird');var rp=require(_0x953d('0x3'));var fs=require('fs');var path=require(_0x953d('0x4'));var rimraf=require(_0x953d('0x5'));var config=require(_0x953d('0x6'));var attributes=require(_0x953d('0x7'));module['exports']=function(_0x325097,_0x54bc08){return _0x325097[_0x953d('0x8')](_0x953d('0x9'),attributes,{'tableName':_0x953d('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x953d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 0d8c08a..ffd3cf4 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 _0x3b2f=['result','catch','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x312268,_0x149182){var _0x42b04c=function(_0x19a03a){while(--_0x19a03a){_0x312268['push'](_0x312268['shift']());}};_0x42b04c(++_0x149182);}(_0x3b2f,0x87));var _0xf3b2=function(_0x5b8cd2,_0xd73d07){_0x5b8cd2=_0x5b8cd2-0x0;var _0x34754a=_0x3b2f[_0x5b8cd2];return _0x34754a;};'use strict';var _=require('lodash');var util=require(_0xf3b2('0x0'));var moment=require('moment');var BPromise=require(_0xf3b2('0x1'));var rs=require(_0xf3b2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf3b2('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf3b2('0x4'));var config=require(_0xf3b2('0x5'));var jayson=require(_0xf3b2('0x6'));var client=jayson[_0xf3b2('0x7')][_0xf3b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x134490,_0x5b9d7c,_0x1b6332){return new BPromise(function(_0x4a507d,_0x136b60){return client['request'](_0x134490,_0x1b6332)[_0xf3b2('0x9')](function(_0xa7dd75){logger[_0xf3b2('0xa')](_0xf3b2('0xb'),_0x5b9d7c,_0xf3b2('0xc'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x5b9d7c,_0xf3b2('0xc'),JSON[_0xf3b2('0xd')](_0xa7dd75));if(_0xa7dd75[_0xf3b2('0xe')]){if(_0xa7dd75[_0xf3b2('0xe')][_0xf3b2('0xf')]===0x1f4){logger[_0xf3b2('0xe')](_0xf3b2('0xb'),_0x5b9d7c,_0xa7dd75[_0xf3b2('0xe')]['message']);return _0x136b60(_0xa7dd75[_0xf3b2('0xe')][_0xf3b2('0x10')]);}logger[_0xf3b2('0xe')](_0xf3b2('0xb'),_0x5b9d7c,_0xa7dd75[_0xf3b2('0xe')][_0xf3b2('0x10')]);return _0x4a507d(_0xa7dd75[_0xf3b2('0xe')]['message']);}else{logger['info'](_0xf3b2('0xb'),_0x5b9d7c,'request\x20sent');_0x4a507d(_0xa7dd75[_0xf3b2('0x11')][_0xf3b2('0x10')]);}})[_0xf3b2('0x12')](function(_0x1837a0){logger['error'](_0xf3b2('0xb'),_0x5b9d7c,_0x1837a0);_0x136b60(_0x1837a0);});});} \ No newline at end of file +var _0x7613=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util'];(function(_0x1f8756,_0x5a1a1b){var _0x100c8a=function(_0x16186a){while(--_0x16186a){_0x1f8756['push'](_0x1f8756['shift']());}};_0x100c8a(++_0x5a1a1b);}(_0x7613,0x11c));var _0x3761=function(_0x301bb2,_0xc4169c){_0x301bb2=_0x301bb2-0x0;var _0x51b5ec=_0x7613[_0x301bb2];return _0x51b5ec;};'use strict';var _=require(_0x3761('0x0'));var util=require(_0x3761('0x1'));var moment=require(_0x3761('0x2'));var BPromise=require('bluebird');var rs=require(_0x3761('0x3'));var fs=require('fs');var Redis=require(_0x3761('0x4'));var db=require(_0x3761('0x5'))['db'];var utils=require(_0x3761('0x6'));var logger=require('../../config/logger')(_0x3761('0x7'));var config=require(_0x3761('0x8'));var jayson=require(_0x3761('0x9'));var client=jayson[_0x3761('0xa')][_0x3761('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4549f2,_0x4b433e,_0x1c4070){return new BPromise(function(_0x1b70a0,_0x497fbd){return client['request'](_0x4549f2,_0x1c4070)['then'](function(_0x1115fc){logger[_0x3761('0xc')](_0x3761('0xd'),_0x4b433e,'request\x20sent');logger[_0x3761('0xe')](_0x3761('0xf'),_0x4b433e,_0x3761('0x10'),JSON[_0x3761('0x11')](_0x1115fc));if(_0x1115fc[_0x3761('0x12')]){if(_0x1115fc[_0x3761('0x12')]['code']===0x1f4){logger[_0x3761('0x12')](_0x3761('0xd'),_0x4b433e,_0x1115fc[_0x3761('0x12')][_0x3761('0x13')]);return _0x497fbd(_0x1115fc['error'][_0x3761('0x13')]);}logger['error'](_0x3761('0xd'),_0x4b433e,_0x1115fc['error'][_0x3761('0x13')]);return _0x1b70a0(_0x1115fc[_0x3761('0x12')]['message']);}else{logger[_0x3761('0xc')](_0x3761('0xd'),_0x4b433e,_0x3761('0x10'));_0x1b70a0(_0x1115fc[_0x3761('0x14')][_0x3761('0x13')]);}})[_0x3761('0x15')](function(_0x3dab89){logger[_0x3761('0x12')](_0x3761('0xd'),_0x4b433e,_0x3dab89);_0x497fbd(_0x3dab89);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 4fea4b6..a332682 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac9d=['./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','then','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','online','Offline\x20apps:','join','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2/config'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0xac9d,0x14d));var _0xdac9=function(_0x422baa,_0x98d34a){_0x422baa=_0x422baa-0x0;var _0x31c810=_0xac9d[_0x422baa];return _0x31c810;};'use strict';var _=require(_0xdac9('0x0'));var db=require(_0xdac9('0x1'))['db'];var seedDb=require(_0xdac9('0x2'));var checkLicense=require(_0xdac9('0x3'));var rpc=require(_0xdac9('0x4'));var config=require(_0xdac9('0x5'));var logger=require(_0xdac9('0x6'))(_0xdac9('0x7'));var pm2=require('./config/pm2');var pm2Config=require(_0xdac9('0x8'));var schedule=require('./config/schedule');var chat=require(_0xdac9('0x9'));var whatsapp=require(_0xdac9('0xa'));var transcribe=require(_0xdac9('0xb'));var provider=require(_0xdac9('0xc'));function main(){return db[_0xdac9('0xd')][_0xdac9('0xe')]()['then'](function(){if(config[_0xdac9('0xf')]){return seedDb['default']();}})[_0xdac9('0x10')](function(){return checkLicense[_0xdac9('0x11')]();})[_0xdac9('0x10')](function(){return rpc[_0xdac9('0x12')]();})[_0xdac9('0x10')](function(_0x2859bf){logger[_0xdac9('0x13')](_0x2859bf);return chat[_0xdac9('0x14')]();})[_0xdac9('0x10')](function(){return whatsapp['start']();})[_0xdac9('0x10')](function(){return schedule[_0xdac9('0x14')]();})['then'](function(){return transcribe[_0xdac9('0x14')]();})[_0xdac9('0x10')](function(){return provider[_0xdac9('0x14')]();})['then'](function(_0x16063f){logger[_0xdac9('0x13')](_0x16063f);return pm2[_0xdac9('0x14')](pm2Config);})['then'](function(_0x5dd536){var _0x52cbd4=_0x5dd536[_0xdac9('0x15')](function(_0x50f9fe){return typeof _0x50f9fe[_0xdac9('0x16')]===_0xdac9('0x17')&&_0x50f9fe[_0xdac9('0x16')]>=0x0;});if(_0x52cbd4[_0xdac9('0x18')]>0x0){throw new Error(_0x52cbd4[_0xdac9('0x18')]+_0xdac9('0x19')+_[_0xdac9('0x1a')](_0x52cbd4,function(_0xec1016){return'\x22'+_0xec1016['pm2_env'][_0xdac9('0x1b')]+'\x22';}));}logger[_0xdac9('0x13')]('Online\x20apps:',_[_0xdac9('0x1a')](_[_0xdac9('0x15')](_0x5dd536,{'status':_0xdac9('0x1c')}),_0xdac9('0x1b'))['join']());logger['info'](_0xdac9('0x1d'),_[_0xdac9('0x1a')](_[_0xdac9('0x15')](_0x5dd536,function(_0x395ec7){return _0x395ec7['status']!==_0xdac9('0x1c');}),_0xdac9('0x1b'))[_0xdac9('0x1e')]()||_0xdac9('0x1f'));console[_0xdac9('0x20')](_0xdac9('0x21'));})[_0xdac9('0x22')](function(_0xa1f726){console[_0xdac9('0x20')](_0xdac9('0x23'),_0xa1f726);logger['error'](_0xdac9('0x24'),_0xa1f726);process[_0xdac9('0x25')](0x1);});}main(); \ No newline at end of file +var _0x6bdc=['default','then','listen','start','info','exitCode','number','length','name','Online\x20apps:','filter','online','join','Offline\x20apps:','map','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB'];(function(_0xef2a14,_0x4c359a){var _0x242a4d=function(_0x3227c9){while(--_0x3227c9){_0xef2a14['push'](_0xef2a14['shift']());}};_0x242a4d(++_0x4c359a);}(_0x6bdc,0x14e));var _0xc6bd=function(_0x2c47f0,_0x5eda28){_0x2c47f0=_0x2c47f0-0x0;var _0x4103ce=_0x6bdc[_0x2c47f0];return _0x4103ce;};'use strict';var _=require(_0xc6bd('0x0'));var db=require(_0xc6bd('0x1'))['db'];var seedDb=require(_0xc6bd('0x2'));var checkLicense=require(_0xc6bd('0x3'));var rpc=require(_0xc6bd('0x4'));var config=require(_0xc6bd('0x5'));var logger=require(_0xc6bd('0x6'))(_0xc6bd('0x7'));var pm2=require(_0xc6bd('0x8'));var pm2Config=require(_0xc6bd('0x9'));var schedule=require('./config/schedule');var chat=require(_0xc6bd('0xa'));var whatsapp=require(_0xc6bd('0xb'));var transcribe=require(_0xc6bd('0xc'));var provider=require(_0xc6bd('0xd'));function main(){return db[_0xc6bd('0xe')][_0xc6bd('0xf')]()['then'](function(){if(config[_0xc6bd('0x10')]){return seedDb[_0xc6bd('0x11')]();}})[_0xc6bd('0x12')](function(){return checkLicense['default']();})['then'](function(){return rpc[_0xc6bd('0x13')]();})['then'](function(_0x3fdffe){logger['info'](_0x3fdffe);return chat[_0xc6bd('0x14')]();})[_0xc6bd('0x12')](function(){return whatsapp[_0xc6bd('0x14')]();})[_0xc6bd('0x12')](function(){return schedule[_0xc6bd('0x14')]();})[_0xc6bd('0x12')](function(){return transcribe[_0xc6bd('0x14')]();})[_0xc6bd('0x12')](function(){return provider[_0xc6bd('0x14')]();})[_0xc6bd('0x12')](function(_0xbfc32f){logger[_0xc6bd('0x15')](_0xbfc32f);return pm2[_0xc6bd('0x14')](pm2Config);})[_0xc6bd('0x12')](function(_0x54e9ce){var _0x3642bf=_0x54e9ce['filter'](function(_0x4c2a73){return typeof _0x4c2a73[_0xc6bd('0x16')]===_0xc6bd('0x17')&&_0x4c2a73[_0xc6bd('0x16')]>=0x0;});if(_0x3642bf[_0xc6bd('0x18')]>0x0){throw new Error(_0x3642bf[_0xc6bd('0x18')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x3642bf,function(_0x40df04){return'\x22'+_0x40df04['pm2_env'][_0xc6bd('0x19')]+'\x22';}));}logger[_0xc6bd('0x15')](_0xc6bd('0x1a'),_['map'](_[_0xc6bd('0x1b')](_0x54e9ce,{'status':_0xc6bd('0x1c')}),_0xc6bd('0x19'))[_0xc6bd('0x1d')]());logger[_0xc6bd('0x15')](_0xc6bd('0x1e'),_[_0xc6bd('0x1f')](_[_0xc6bd('0x1b')](_0x54e9ce,function(_0x53c9a0){return _0x53c9a0[_0xc6bd('0x20')]!=='online';}),'name')['join']()||_0xc6bd('0x21'));console[_0xc6bd('0x22')](_0xc6bd('0x23'));})[_0xc6bd('0x24')](function(_0x232a6e){console['log'](_0xc6bd('0x25'),_0x232a6e);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x232a6e);process[_0xc6bd('0x26')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index cf97b1f..1d245ff 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 _0x66b6=['chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','whatsappAutoanswer','whatsappAutoanswerDelay','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','status','json','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','find','authenticate','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','splice','unshift','encryptString','join','promisify','sign','secret','hex','floor','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','express-jwt','basic-auth','util','moment','secrets','session','role','fullname','name','internal','email','userpic','voicePause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments'];(function(_0x577b4c,_0xbf0f9e){var _0xaccf1e=function(_0x234236){while(--_0x234236){_0x577b4c['push'](_0x577b4c['shift']());}};_0xaccf1e(++_0xbf0f9e);}(_0x66b6,0x156));var _0x666b=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x66b6[_0xd63e3a];return _0x19c178;};'use strict';var db=require(_0x666b('0x0'))['db'];var config=require(_0x666b('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0x666b('0x2'));var encryptor=require(_0x666b('0x3'));var _=require(_0x666b('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x666b('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x666b('0x6'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x666b('0x7'));var moment=require(_0x666b('0x8'));var validateJwt=expressJwt({'secret':config[_0x666b('0x9')][_0x666b('0xa')]});var userAttributes=['id',_0x666b('0xb'),_0x666b('0xc'),_0x666b('0xd'),_0x666b('0xe'),_0x666b('0xf'),_0x666b('0x10'),'permissions','md5secret',_0x666b('0x11'),'chatPause','mailPause',_0x666b('0x12'),_0x666b('0x13'),_0x666b('0x14'),'pauseType',_0x666b('0x15'),_0x666b('0x16'),'lastPauseAt','crudPermissions',_0x666b('0x17'),_0x666b('0x18'),_0x666b('0x19'),_0x666b('0x1a'),_0x666b('0x1b'),_0x666b('0x1c'),_0x666b('0x1d'),_0x666b('0x1e'),_0x666b('0x1f'),_0x666b('0x20'),_0x666b('0x21'),'phoneBarRemoteControl',_0x666b('0x22'),_0x666b('0x23'),_0x666b('0x24'),_0x666b('0x25'),'privacyEnabled',_0x666b('0x26'),_0x666b('0x27'),'downloadVoiceRecordings',_0x666b('0x28'),_0x666b('0x29'),'ignorePauseForPreviewCalls','selectRecallMeCampaign',_0x666b('0x2a'),_0x666b('0x2b'),_0x666b('0x2c'),_0x666b('0x2d'),'smsAutoanswer',_0x666b('0x2e'),_0x666b('0x2f'),'openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay',_0x666b('0x30'),_0x666b('0x31'),'messengerSoundNotification'];exports['isChatInteractionAuthorized']=function(){return this[_0x666b('0x32')](!![])[_0x666b('0x33')](function(_0x26e9d7,_0x52259b,_0x409a11){if(_0x26e9d7[_0x666b('0x34')]){_0x409a11();}else{return db[_0x666b('0x35')][_0x666b('0x36')]({'where':{'id':_0x26e9d7[_0x666b('0x37')]['id']},'attributes':['id',_0x666b('0x38'),_0x666b('0x39')],'raw':!![]})[_0x666b('0x3a')](function(_0x4bc95a){if(_0x4bc95a&&_0x4bc95a['closed']&&!_0x26e9d7[_0x666b('0x3b')][_0x666b('0x3c')]){return _0x52259b[_0x666b('0x3d')](_0x4bc95a[_0x666b('0x39')]==='unmanaged'?0x195:0x193)[_0x666b('0x3e')]({'message':_0x4bc95a[_0x666b('0x39')]===_0x666b('0x3f')?_0x666b('0x40'):_0x666b('0x41')});}else{_0x409a11();}})['catch'](function(_0x10a2a8){_0x409a11(_0x10a2a8);});}});};exports['isAuthenticated']=function isAuthenticated(_0x55c5c3){return compose()[_0x666b('0x33')](function(_0x2212eb,_0x3a704b,_0xe8e646){var _0x4634d1;if(_0x2212eb[_0x666b('0x42')][_0x666b('0x43')]){if(_[_0x666b('0x44')](_0x2212eb[_0x666b('0x42')][_0x666b('0x43')],_0x666b('0x45'))){var _0x2b88cc=basicAuth(_0x2212eb);db['User'][_0x666b('0x46')]({'where':{'name':_0x2b88cc[_0x666b('0xd')]}})[_0x666b('0x3a')](function(_0x10e1e0){if(!_0x10e1e0||!_0x10e1e0[_0x666b('0x47')](_0x2b88cc['pass'])){return _0x3a704b['status'](0x191)['json']({'message':_0x666b('0x48')});}_0x2212eb['user']={'id':_0x10e1e0['id']};_0xe8e646();})[_0x666b('0x49')](function(_0x83c0e9){_0xe8e646(_0x83c0e9);});}else if(_['startsWith'](_0x2212eb[_0x666b('0x42')][_0x666b('0x43')],_0x666b('0x4a'))){validateJwt(_0x2212eb,_0x3a704b,_0xe8e646);}else{if(_0x55c5c3){_0xe8e646();}else{return _0x3a704b['status'](0x193)['json']({'message':_0x666b('0x4b')});}}}else if(_0x2212eb['query'][_0x666b('0x4c')]){try{var _0x3e2d26={'audience':hardwareConf[_0x666b('0x4d')](),'issuer':hardwareConf[_0x666b('0x4d')]()};verifyJwt(_0x2212eb[_0x666b('0x3b')]['apikey'],_0x3e2d26)[_0x666b('0x3a')](function(_0x5db491){return db[_0x666b('0x4e')][_0x666b('0x46')]({'where':{'id':_0x5db491['sub']}})[_0x666b('0x3a')](function(_0x1a6108){_0x4634d1=_0x1a6108;return db[_0x666b('0x4f')][_0x666b('0x36')]({'where':{'id':0x1},'attributes':[_0x666b('0x50'),_0x666b('0x51')],'raw':!![]});})[_0x666b('0x3a')](function(_0xa7a4ed){if(!_0x4634d1||!_['isEqual'](_0x4634d1[_0x666b('0x52')],_0x5db491[_0x666b('0x53')])){return _0x3a704b[_0x666b('0x3d')](0x191)[_0x666b('0x3e')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4634d1[_0x666b('0x54')]){return _0x3a704b['status'](0x191)[_0x666b('0x3e')]({'message':_0x666b('0x55')});}if(_0x4634d1[_0x666b('0x56')]){if(_0xa7a4ed[_0x666b('0x51')]>0x0){if(moment(_0x4634d1['blockedAt'])[_0x666b('0x57')](_0xa7a4ed[_0x666b('0x51')],_0x666b('0x58'))>moment()){return _0x3a704b['status'](0x191)[_0x666b('0x3e')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3a704b[_0x666b('0x3d')](0x191)['json']({'message':_0x666b('0x55')});}}_0x2212eb[_0x666b('0x34')]={'id':_0x4634d1['id']};_0xe8e646();});})[_0x666b('0x49')](function(){return _0x3a704b['status'](0x191)[_0x666b('0x3e')]({'message':_0x666b('0x55')});});}catch(_0x2c354d){_0xe8e646(_0x2c354d);}}else if(_0x55c5c3){_0xe8e646();}else{return _0x3a704b[_0x666b('0x3d')](0x193)[_0x666b('0x3e')]({'message':_0x666b('0x4b')});}})[_0x666b('0x33')](function(_0x7b3041,_0x758b23,_0x2b36a2){if(_0x7b3041[_0x666b('0x34')]){db[_0x666b('0x4e')][_0x666b('0x46')]({'where':{'id':_0x7b3041[_0x666b('0x34')]['id']},'attributes':userAttributes})['then'](function(_0x51240a){if(!_0x51240a){return _0x758b23[_0x666b('0x3d')](0x194)[_0x666b('0x3e')]({'message':'User\x20not\x20found.'});}_0x7b3041['user']=_0x51240a;_0x2b36a2();})[_0x666b('0x49')](function(_0x4c8705){_0x2b36a2(_0x4c8705);});}else if(_0x55c5c3){_0x2b36a2();}else{return _0x758b23[_0x666b('0x3d')](0x194)[_0x666b('0x3e')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x666b('0x59')]=function canUpdate(){return compose()['use'](function(_0x181f1d,_0x5e3cbe,_0x1a422e){return licenseUtil['getLicense']()[_0x666b('0x3a')](function(_0x57007c){if(_0x57007c[_0x666b('0x5a')]){_0x1a422e();}else{return _0x5e3cbe['status'](0x193)[_0x666b('0x3e')]({'message':_0x666b('0x5b')});}})['catch'](function(_0x810e93){_0x1a422e(_0x810e93);});});};exports[_0x666b('0x5c')]=function isWebrtcLicence(){return compose()['use'](function(_0x12272a,_0x4e5fc1,_0x53e640){return licenseUtil[_0x666b('0x5d')]()[_0x666b('0x3a')](function(_0x23434a){if(_0x23434a[_0x666b('0x5e')]){_0x53e640();}else{return _0x4e5fc1[_0x666b('0x3d')](0x193)[_0x666b('0x3e')]({'message':_0x666b('0x5b')});}})[_0x666b('0x49')](function(_0x5e0ebe){_0x53e640(_0x5e0ebe);});});};exports[_0x666b('0x5f')]=function(_0x25b26d,_0x4a13b7,_0x9be14){_0x25b26d[_0x666b('0x5f')]=!![];return _0x9be14();};exports[_0x666b('0x60')]=function signToken(_0x13dc5d){return signJwt(_0x13dc5d);};exports[_0x666b('0x61')]=function(_0x578ec8,_0x25c7b4){if(!_0x578ec8[_0x666b('0x34')]){return _0x25c7b4['status'](0x194)[_0x666b('0x3e')]({'message':_0x666b('0x62')});}var _0x15499f={'payload':{'id':_0x578ec8[_0x666b('0x34')]['id'],'role':_0x578ec8[_0x666b('0x34')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x15499f)[_0x666b('0x3a')](function(_0x27ed47){_0x25c7b4[_0x666b('0x63')](_0x666b('0x64'),_0x27ed47);_0x25c7b4[_0x666b('0x65')](_0x666b('0x66'));})[_0x666b('0x49')](function(_0x1ef74f){return _0x25c7b4['status'](0x1f4)[_0x666b('0x67')](_0x1ef74f);});};exports['retrieveApiKey']=function(_0x263a7c){if(_['isNil'](_0x263a7c[_0x666b('0x52')])||_[_0x666b('0x68')](_0x263a7c[_0x666b('0x69')])){return null;}else{return createJwt(_0x263a7c);}};exports['generateApiKey']=function(_0x157185){_0x157185[_0x666b('0x52')]=generateNonce();_0x157185[_0x666b('0x69')]=generateIssuedAt();return createJwt(_0x157185);};exports[_0x666b('0x6a')]=function(_0x18c0ae,_0x4e7814){var _0x296483=_0x18c0ae['query']['apikey'];if(_0x296483){var _0x4004c4={'nonce':_0x4e7814[_0x666b('0x52')],'iat':_0x4e7814[_0x666b('0x69')],'audience':hardwareConf[_0x666b('0x4d')](),'issuer':hardwareConf[_0x666b('0x4d')]()};return verifyJwt(_0x296483,_0x4004c4)['then'](function(){return generateApiKey(_0x4e7814);});}else{throw{'message':_0x666b('0x6b')};}};exports[_0x666b('0x6c')]=function(_0x12573e){var _0x4b32c2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x4b32c2[_0x666b('0x6d')](_0x12573e))throw new db['Sequelize'][(_0x666b('0x6e'))](_0x666b('0x6f'));return;};exports['validatePasswordHistory']=function(_0x4d906a,_0x5b175b,_0x48599c){var _0x34007d=encryptor['decryptString'](_0x5b175b)['split'](',');for(var _0x43566b=0x0;_0x43566b<_0x48599c;_0x43566b++){if(!_0x34007d[_0x43566b])break;if(_0x4d906a[_0x666b('0x70')]()===_0x34007d[_0x43566b][_0x666b('0x70')]()){var _0x37bd9b=util[_0x666b('0x71')](_0x666b('0x72'),_0x48599c);if(_0x48599c===0x1){_0x37bd9b='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db['Sequelize'][(_0x666b('0x6e'))](_0x37bd9b);}}return;};exports[_0x666b('0x73')]=function(_0x5e6ca4,_0xd52d0c){var _0x53201f=_0xd52d0c?encryptor[_0x666b('0x74')](_0xd52d0c)['split'](','):[];if(_0x53201f['length']===0x5){_0x53201f[_0x666b('0x75')](-0x1,0x1);}_0x53201f[_0x666b('0x76')](_0x5e6ca4);return encryptor[_0x666b('0x77')](_0x53201f[_0x666b('0x78')](','));};function signJwt(_0x200f43){var _0x4a30e7=BPromise[_0x666b('0x79')](jwt[_0x666b('0x7a')],{'context':jwt});var _0x47c8d9=_0x200f43[_0x666b('0x7b')]||config[_0x666b('0x9')][_0x666b('0xa')];return new BPromise(function(_0x442a63,_0xcb18c){_0x4a30e7(_0x200f43['payload'],_0x47c8d9,_0x200f43['options'])['then'](function(_0x588ca3){_0x442a63(_0x588ca3);})[_0x666b('0x49')](function(_0xe63c58){_0xcb18c(_0xe63c58);});});}function verifyJwt(_0x14ad73,_0x15e07d,_0x4e479b){var _0x4233f2=BPromise[_0x666b('0x79')](jwt['verify'],{'context':jwt});var _0x31bcdc=_0x4e479b||config[_0x666b('0x9')][_0x666b('0xa')];return new BPromise(function(_0x29c16b,_0x1a8604){_0x4233f2(_0x14ad73,_0x31bcdc,_0x15e07d)[_0x666b('0x3a')](function(_0x36fafd){_0x29c16b(_0x36fafd);})['catch'](function(_0x5daa88){_0x1a8604(_0x5daa88);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x666b('0x7c'));}function generateIssuedAt(){return Math[_0x666b('0x7d')](Date[_0x666b('0x7e')]()/0x3e8)[_0x666b('0x7f')]();}function createJwt(_0x4fc7b5){var _0x3e77a1={'payload':{'iat':_0x4fc7b5[_0x666b('0x69')],'nonce':_0x4fc7b5[_0x666b('0x52')]},'options':{'algorithm':'HS512','subject':_0x4fc7b5['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x666b('0x4d')]()}};return signJwt(_0x3e77a1)[_0x666b('0x3a')](function(_0x4b6df3){return{'iat':_0x4fc7b5[_0x666b('0x69')],'nonce':_0x4fc7b5[_0x666b('0x52')],'token':_0x4b6df3};});} \ No newline at end of file +var _0x5405=['promisify','secret','secrets','payload','options','verify','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','util','session','fullname','name','internal','email','permissions','md5secret','mailPause','faxPause','smsPause','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','closed','disposition','then','forceDownload','status','unmanaged','json','Unmanaged.','Forbidden.','isAuthenticated','authorization','headers','Basic','User','find','authenticate','Wrong\x20credentials.','catch','startsWith','Bearer','query','apikey','getUuid','Setting','blockDuration','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','getLicense','webrtc','isMiddleware','signToken','setTokenCookie','role','cookie','motion.token','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','splice','unshift','encryptString','join'];(function(_0x141f0e,_0x45df5e){var _0x48e312=function(_0x2ac715){while(--_0x2ac715){_0x141f0e['push'](_0x141f0e['shift']());}};_0x48e312(++_0x45df5e);}(_0x5405,0x1a8));var _0x5540=function(_0x109d0,_0xcbf079){_0x109d0=_0x109d0-0x0;var _0x2078f4=_0x5405[_0x109d0];return _0x2078f4;};'use strict';var db=require(_0x5540('0x0'))['db'];var config=require(_0x5540('0x1'));var hardwareConf=require(_0x5540('0x2'));var licenseUtil=require(_0x5540('0x3'));var encryptor=require(_0x5540('0x4'));var _=require(_0x5540('0x5'));var jwt=require(_0x5540('0x6'));var expressJwt=require(_0x5540('0x7'));var compose=require(_0x5540('0x8'));var basicAuth=require(_0x5540('0x9'));var crypto=require('crypto');var BPromise=require(_0x5540('0xa'));var util=require(_0x5540('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0x5540('0xc')]});var userAttributes=['id','role',_0x5540('0xd'),_0x5540('0xe'),_0x5540('0xf'),_0x5540('0x10'),'userpic',_0x5540('0x11'),_0x5540('0x12'),'voicePause','chatPause',_0x5540('0x13'),_0x5540('0x14'),_0x5540('0x15'),'openchannelPause','pauseType','showWebBar','lastLoginAt',_0x5540('0x16'),_0x5540('0x17'),_0x5540('0x18'),_0x5540('0x19'),'alias','phoneBarAutoAnswer',_0x5540('0x1a'),_0x5540('0x1b'),_0x5540('0x1c'),_0x5540('0x1d'),_0x5540('0x1e'),'phoneBarExpires',_0x5540('0x1f'),_0x5540('0x20'),_0x5540('0x21'),'hotdesk',_0x5540('0x22'),_0x5540('0x23'),_0x5540('0x24'),_0x5540('0x25'),'wssPort',_0x5540('0x26'),_0x5540('0x27'),_0x5540('0x28'),_0x5540('0x29'),_0x5540('0x2a'),_0x5540('0x2b'),_0x5540('0x2c'),'emailAutoanswer',_0x5540('0x2d'),_0x5540('0x2e'),_0x5540('0x2f'),_0x5540('0x30'),_0x5540('0x31'),_0x5540('0x32'),_0x5540('0x33'),_0x5540('0x34'),_0x5540('0x35'),'messengerSoundNotification'];exports[_0x5540('0x36')]=function(){return this['isAuthenticated'](!![])[_0x5540('0x37')](function(_0x3a24a,_0x16a3ba,_0x431160){if(_0x3a24a[_0x5540('0x38')]){_0x431160();}else{return db[_0x5540('0x39')][_0x5540('0x3a')]({'where':{'id':_0x3a24a['params']['id']},'attributes':['id',_0x5540('0x3b'),_0x5540('0x3c')],'raw':!![]})[_0x5540('0x3d')](function(_0x2d019f){if(_0x2d019f&&_0x2d019f[_0x5540('0x3b')]&&!_0x3a24a['query'][_0x5540('0x3e')]){return _0x16a3ba[_0x5540('0x3f')](_0x2d019f[_0x5540('0x3c')]===_0x5540('0x40')?0x195:0x193)[_0x5540('0x41')]({'message':_0x2d019f[_0x5540('0x3c')]===_0x5540('0x40')?_0x5540('0x42'):_0x5540('0x43')});}else{_0x431160();}})['catch'](function(_0x399ff3){_0x431160(_0x399ff3);});}});};exports[_0x5540('0x44')]=function isAuthenticated(_0x277ca9){return compose()[_0x5540('0x37')](function(_0xf3921b,_0xef833d,_0x1fe08e){var _0x2efc3d;if(_0xf3921b['headers'][_0x5540('0x45')]){if(_['startsWith'](_0xf3921b[_0x5540('0x46')][_0x5540('0x45')],_0x5540('0x47'))){var _0x28e95b=basicAuth(_0xf3921b);db[_0x5540('0x48')][_0x5540('0x49')]({'where':{'name':_0x28e95b[_0x5540('0xe')]}})[_0x5540('0x3d')](function(_0x21343b){if(!_0x21343b||!_0x21343b[_0x5540('0x4a')](_0x28e95b['pass'])){return _0xef833d[_0x5540('0x3f')](0x191)[_0x5540('0x41')]({'message':_0x5540('0x4b')});}_0xf3921b[_0x5540('0x38')]={'id':_0x21343b['id']};_0x1fe08e();})[_0x5540('0x4c')](function(_0x307f8d){_0x1fe08e(_0x307f8d);});}else if(_[_0x5540('0x4d')](_0xf3921b[_0x5540('0x46')][_0x5540('0x45')],_0x5540('0x4e'))){validateJwt(_0xf3921b,_0xef833d,_0x1fe08e);}else{if(_0x277ca9){_0x1fe08e();}else{return _0xef833d[_0x5540('0x3f')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xf3921b[_0x5540('0x4f')][_0x5540('0x50')]){try{var _0x1a7778={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x5540('0x51')]()};verifyJwt(_0xf3921b[_0x5540('0x4f')][_0x5540('0x50')],_0x1a7778)['then'](function(_0x470e1c){return db[_0x5540('0x48')][_0x5540('0x49')]({'where':{'id':_0x470e1c['sub']}})[_0x5540('0x3d')](function(_0x5021bf){_0x2efc3d=_0x5021bf;return db[_0x5540('0x52')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5540('0x53')],'raw':!![]});})[_0x5540('0x3d')](function(_0x4b049e){if(!_0x2efc3d||!_['isEqual'](_0x2efc3d['apiKeyNonce'],_0x470e1c[_0x5540('0x54')])){return _0xef833d[_0x5540('0x3f')](0x191)[_0x5540('0x41')]({'message':_0x5540('0x55')});}if(_0x2efc3d['disabled']){return _0xef833d[_0x5540('0x3f')](0x191)['json']({'message':_0x5540('0x56')});}if(_0x2efc3d['blocked']){if(_0x4b049e['blockDuration']>0x0){if(moment(_0x2efc3d[_0x5540('0x57')])['add'](_0x4b049e[_0x5540('0x53')],_0x5540('0x58'))>moment()){return _0xef833d[_0x5540('0x3f')](0x191)[_0x5540('0x41')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0xef833d['status'](0x191)['json']({'message':_0x5540('0x56')});}}_0xf3921b[_0x5540('0x38')]={'id':_0x2efc3d['id']};_0x1fe08e();});})['catch'](function(){return _0xef833d[_0x5540('0x3f')](0x191)[_0x5540('0x41')]({'message':_0x5540('0x56')});});}catch(_0x4ece03){_0x1fe08e(_0x4ece03);}}else if(_0x277ca9){_0x1fe08e();}else{return _0xef833d[_0x5540('0x3f')](0x193)[_0x5540('0x41')]({'message':_0x5540('0x59')});}})[_0x5540('0x37')](function(_0x51249f,_0x8c4926,_0x4ab760){if(_0x51249f[_0x5540('0x38')]){db[_0x5540('0x48')]['find']({'where':{'id':_0x51249f['user']['id']},'attributes':userAttributes})[_0x5540('0x3d')](function(_0x4ee573){if(!_0x4ee573){return _0x8c4926['status'](0x194)['json']({'message':_0x5540('0x5a')});}_0x51249f[_0x5540('0x38')]=_0x4ee573;_0x4ab760();})['catch'](function(_0x1643f4){_0x4ab760(_0x1643f4);});}else if(_0x277ca9){_0x4ab760();}else{return _0x8c4926[_0x5540('0x3f')](0x194)['json']({'message':_0x5540('0x5b')});}});};exports[_0x5540('0x5c')]=function canUpdate(){return compose()[_0x5540('0x37')](function(_0x4cc3c8,_0x5ea39e,_0x35a260){return licenseUtil['getLicense']()[_0x5540('0x3d')](function(_0x1d72ea){if(_0x1d72ea[_0x5540('0x5d')]){_0x35a260();}else{return _0x5ea39e['status'](0x193)['json']({'message':_0x5540('0x5e')});}})[_0x5540('0x4c')](function(_0x56764a){_0x35a260(_0x56764a);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()['use'](function(_0xc1929c,_0x1e2ff4,_0x2a818c){return licenseUtil[_0x5540('0x5f')]()[_0x5540('0x3d')](function(_0x20a3ad){if(_0x20a3ad[_0x5540('0x60')]){_0x2a818c();}else{return _0x1e2ff4['status'](0x193)['json']({'message':'Forbidden'});}})[_0x5540('0x4c')](function(_0x5cd7c3){_0x2a818c(_0x5cd7c3);});});};exports['isMiddleware']=function(_0x2b698a,_0x3c1d68,_0x14022d){_0x2b698a[_0x5540('0x61')]=!![];return _0x14022d();};exports[_0x5540('0x62')]=function signToken(_0x24661f){return signJwt(_0x24661f);};exports[_0x5540('0x63')]=function(_0x2627d2,_0x14fd51){if(!_0x2627d2[_0x5540('0x38')]){return _0x14fd51[_0x5540('0x3f')](0x194)[_0x5540('0x41')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x900c9a={'payload':{'id':_0x2627d2['user']['id'],'role':_0x2627d2[_0x5540('0x38')][_0x5540('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x900c9a)[_0x5540('0x3d')](function(_0x5df549){_0x14fd51[_0x5540('0x65')](_0x5540('0x66'),_0x5df549);_0x14fd51['redirect'](_0x5540('0x67'));})[_0x5540('0x4c')](function(_0x25b5be){return _0x14fd51[_0x5540('0x3f')](0x1f4)[_0x5540('0x68')](_0x25b5be);});};exports[_0x5540('0x69')]=function(_0x407505){if(_[_0x5540('0x6a')](_0x407505[_0x5540('0x6b')])||_['isNil'](_0x407505[_0x5540('0x6c')])){return null;}else{return createJwt(_0x407505);}};exports[_0x5540('0x6d')]=function(_0x56c68f){_0x56c68f[_0x5540('0x6b')]=generateNonce();_0x56c68f[_0x5540('0x6c')]=generateIssuedAt();return createJwt(_0x56c68f);};exports[_0x5540('0x6e')]=function(_0x48a7a1,_0xacde4f){var _0xfa35e5=_0x48a7a1[_0x5540('0x4f')][_0x5540('0x50')];if(_0xfa35e5){var _0x5b0514={'nonce':_0xacde4f[_0x5540('0x6b')],'iat':_0xacde4f[_0x5540('0x6c')],'audience':hardwareConf[_0x5540('0x51')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xfa35e5,_0x5b0514)['then'](function(){return generateApiKey(_0xacde4f);});}else{throw{'message':_0x5540('0x6f')};}};exports['validatePasswordPattern']=function(_0x269579){var _0x880fac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x880fac[_0x5540('0x70')](_0x269579))throw new db['Sequelize'][(_0x5540('0x71'))]('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[_0x5540('0x72')]=function(_0x6d4ace,_0x5c860e,_0x39390e){var _0x4f7c65=encryptor[_0x5540('0x73')](_0x5c860e)[_0x5540('0x74')](',');for(var _0x5a8a59=0x0;_0x5a8a59<_0x39390e;_0x5a8a59++){if(!_0x4f7c65[_0x5a8a59])break;if(_0x6d4ace['toLowerCase']()===_0x4f7c65[_0x5a8a59][_0x5540('0x75')]()){var _0x47e980=util[_0x5540('0x76')](_0x5540('0x77'),_0x39390e);if(_0x39390e===0x1){_0x47e980=_0x5540('0x78');}throw new db[(_0x5540('0x79'))]['ValidationError'](_0x47e980);}}return;};exports[_0x5540('0x7a')]=function(_0x2f8625,_0x387108){var _0x4aa188=_0x387108?encryptor['decryptString'](_0x387108)[_0x5540('0x74')](','):[];if(_0x4aa188[_0x5540('0x7b')]===0x5){_0x4aa188[_0x5540('0x7c')](-0x1,0x1);}_0x4aa188[_0x5540('0x7d')](_0x2f8625);return encryptor[_0x5540('0x7e')](_0x4aa188[_0x5540('0x7f')](','));};function signJwt(_0xc2b082){var _0x45a5b3=BPromise[_0x5540('0x80')](jwt['sign'],{'context':jwt});var _0x1b4371=_0xc2b082[_0x5540('0x81')]||config[_0x5540('0x82')][_0x5540('0xc')];return new BPromise(function(_0x67f35c,_0x3f82d0){_0x45a5b3(_0xc2b082[_0x5540('0x83')],_0x1b4371,_0xc2b082[_0x5540('0x84')])[_0x5540('0x3d')](function(_0x5ca56f){_0x67f35c(_0x5ca56f);})[_0x5540('0x4c')](function(_0x1a7c1f){_0x3f82d0(_0x1a7c1f);});});}function verifyJwt(_0x57a118,_0x600457,_0x5db9c2){var _0x5ba893=BPromise[_0x5540('0x80')](jwt[_0x5540('0x85')],{'context':jwt});var _0x4f85d8=_0x5db9c2||config[_0x5540('0x82')][_0x5540('0xc')];return new BPromise(function(_0x146cc9,_0x565047){_0x5ba893(_0x57a118,_0x4f85d8,_0x600457)[_0x5540('0x3d')](function(_0x35e34f){_0x146cc9(_0x35e34f);})[_0x5540('0x4c')](function(_0x185a31){_0x565047(_0x185a31);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x5540('0x86')](_0x5540('0x87'));}function generateIssuedAt(){return Math['floor'](Date[_0x5540('0x88')]()/0x3e8)[_0x5540('0x86')]();}function createJwt(_0x3258f1){var _0x5c1145={'payload':{'iat':_0x3258f1[_0x5540('0x6c')],'nonce':_0x3258f1['apiKeyNonce']},'options':{'algorithm':_0x5540('0x89'),'subject':_0x3258f1['id'][_0x5540('0x86')](),'issuer':hardwareConf[_0x5540('0x51')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x5c1145)[_0x5540('0x3d')](function(_0x197681){return{'iat':_0x3258f1[_0x5540('0x6c')],'nonce':_0x3258f1[_0x5540('0x6b')],'token':_0x197681};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index ea94f2e..ea18177 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 _0x4cfd=['CmCustomField','findOne','all','type','map','catch','../../mysqldb','findAll','skipContactsQuery','resolve','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','tags','user','skip','checkListsRestrictions','tag','countFilteredContacts','count','User','buildContactsQuery','getFilteredContacts','rows','CmContact','describe','keys','startsWith','cf_'];(function(_0x1ed96b,_0x15359f){var _0x5047e0=function(_0x23d5cd){while(--_0x23d5cd){_0x1ed96b['push'](_0x1ed96b['shift']());}};_0x5047e0(++_0x15359f);}(_0x4cfd,0xd2));var _0xd4cf=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x4cfd[_0x1b6c6d];return _0x290d9d;};'use strict';var _=require('lodash');var sqlUtils=require('./sql-utils');var db=require(_0xd4cf('0x0'))['db'];exports[_0xd4cf('0x1')]=function(_0x490746,_0x5f0dd8,_0x4e9073,_0xe9e7d3){var _0x1a0c6b={'count':0x0,'rows':[]};var _0x3f44d5=sqlUtils[_0xd4cf('0x2')](_0x5f0dd8,_0x490746);if(_0x3f44d5){return Promise['resolve'](_0x1a0c6b);}var _0x1f282d=sqlUtils['getContactsSubquery']();var _0x184a7d={};var _0x53c496=![];var _0x42b344=![];return Promise[_0xd4cf('0x3')]()[_0xd4cf('0x4')](function(){if(_0x490746[_0xd4cf('0x5')]){return sqlUtils[_0xd4cf('0x6')](_0x490746[_0xd4cf('0x5')],_0xe9e7d3);}else{return sqlUtils[_0xd4cf('0x7')](_0x490746,_0xe9e7d3);}})[_0xd4cf('0x4')](function(_0x3f0c95){_0x1f282d[_0xd4cf('0x8')](_0x3f0c95[_0xd4cf('0x9')]);_0x1f282d[_0xd4cf('0x8')](_0x3f0c95[_0xd4cf('0xa')]);_0x1f282d[_0xd4cf('0x8')](_0x3f0c95[_0xd4cf('0xb')]);_0x1f282d[_0xd4cf('0x8')](_0x3f0c95['user']['clause']);_0x184a7d=_0x3f0c95[_0xd4cf('0xc')];_0x42b344=_0x3f0c95[_0xd4cf('0xd')][_0xd4cf('0xe')];return sqlUtils[_0xd4cf('0xf')](_0x5f0dd8,_0x490746,_0x42b344);})['then'](function(_0x24689f){_0x1f282d[_0xd4cf('0x8')](_0x24689f);var _0x5c1e79=_0x490746[_0xd4cf('0x5')]?_0x184a7d['ids']:_0x490746[_0xd4cf('0x10')];_0x53c496=_0x5c1e79?!![]:![];return sqlUtils[_0xd4cf('0x11')](_0x1f282d,_0x5c1e79);})[_0xd4cf('0x4')](function(_0x252747){_0x1a0c6b['count']=_0x252747;if(_0x1a0c6b[_0xd4cf('0x12')]===0x0){return;}if(_0x490746[_0xd4cf('0x13')]){_0x42b344=!![];}return sqlUtils[_0xd4cf('0x14')](_0x1f282d,_0x490746['fields'],_0x4e9073,_0x53c496,_0x184a7d['clause'],_0x42b344);})[_0xd4cf('0x4')](function(_0x3a5655){if(!_0x3a5655){return[];}return sqlUtils[_0xd4cf('0x15')](_0x3a5655,_0x490746,_0x4e9073);})[_0xd4cf('0x4')](function(_0x184916){_0x1a0c6b[_0xd4cf('0x16')]=_0x184916;return _0x1a0c6b;})['catch'](function(_0x65a39d){throw _0x65a39d;});};exports['describe']=function(){var _0x59be7a={};var _0x728660=[];return db[_0xd4cf('0x17')][_0xd4cf('0x18')]()['then'](function(_0x36ed66){_0x59be7a=_0x36ed66;var _0xc5877d=Object[_0xd4cf('0x19')](_0x59be7a)['filter'](function(_0x107680){return _[_0xd4cf('0x1a')](_0x107680,_0xd4cf('0x1b'))?_0x107680:undefined;});var _0x21a02c=_0xc5877d['map'](function(_0x44ff64){return db[_0xd4cf('0x1c')][_0xd4cf('0x1d')]({'where':{'id':_0x44ff64['slice'](0x3)},'raw':!![]});});return Promise[_0xd4cf('0x1e')](_0x21a02c);})[_0xd4cf('0x4')](function(_0x7f0a63){for(var _0x2dd8ee=0x0;_0x2dd8ee<_0x7f0a63['length'];_0x2dd8ee++){if(_0x7f0a63[_0x2dd8ee]){var _0x4d46fe=_0xd4cf('0x1b')+_0x7f0a63[_0x2dd8ee]['id'];_0x59be7a[_0x4d46fe]['fieldType']=_0x7f0a63[_0x2dd8ee][_0xd4cf('0x1f')];}}_0x728660=_[_0xd4cf('0x20')](Object[_0xd4cf('0x19')](_0x59be7a),function(_0x5609bd){return{'name':_0x5609bd,'type':_0x59be7a[_0x5609bd][_0xd4cf('0x1f')]};});return _0x728660;})[_0xd4cf('0x21')](function(_0x280db3){throw _0x280db3;});}; \ No newline at end of file +var _0xa034=['ids','tag','count','User','clause','getFilteredContacts','describe','CmContact','startsWith','CmCustomField','findOne','slice','all','length','cf_','type','map','keys','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','search','parseQueryParameters','where','fields','filter','user','skip','checkListsRestrictions','then'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xa034,0xd8));var _0x4a03=function(_0x25abbe,_0x53b462){_0x25abbe=_0x25abbe-0x0;var _0x55c770=_0xa034[_0x25abbe];return _0x55c770;};'use strict';var _=require(_0x4a03('0x0'));var sqlUtils=require(_0x4a03('0x1'));var db=require(_0x4a03('0x2'))['db'];exports[_0x4a03('0x3')]=function(_0x28e721,_0x22375e,_0x3adfb8,_0x2d2e7e){var _0x50b2fe={'count':0x0,'rows':[]};var _0x2364ef=sqlUtils[_0x4a03('0x4')](_0x22375e,_0x28e721);if(_0x2364ef){return Promise[_0x4a03('0x5')](_0x50b2fe);}var _0x485653=sqlUtils['getContactsSubquery']();var _0x3bb5d9={};var _0x1b3e3f=![];var _0x2250b1=![];return Promise['resolve']()['then'](function(){if(_0x28e721['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x28e721[_0x4a03('0x6')],_0x2d2e7e);}else{return sqlUtils[_0x4a03('0x7')](_0x28e721,_0x2d2e7e);}})['then'](function(_0x46dae8){_0x485653[_0x4a03('0x8')](_0x46dae8['default']);_0x485653[_0x4a03('0x8')](_0x46dae8[_0x4a03('0x9')]);_0x485653[_0x4a03('0x8')](_0x46dae8[_0x4a03('0xa')]);_0x485653['where'](_0x46dae8[_0x4a03('0xb')]['clause']);_0x3bb5d9=_0x46dae8['tags'];_0x2250b1=_0x46dae8[_0x4a03('0xb')][_0x4a03('0xc')];return sqlUtils[_0x4a03('0xd')](_0x22375e,_0x28e721,_0x2250b1);})[_0x4a03('0xe')](function(_0x5c98b1){_0x485653['where'](_0x5c98b1);var _0x1c1912=_0x28e721[_0x4a03('0x6')]?_0x3bb5d9[_0x4a03('0xf')]:_0x28e721[_0x4a03('0x10')];_0x1b3e3f=_0x1c1912?!![]:![];return sqlUtils['countFilteredContacts'](_0x485653,_0x1c1912);})['then'](function(_0x35d597){_0x50b2fe[_0x4a03('0x11')]=_0x35d597;if(_0x50b2fe['count']===0x0){return;}if(_0x28e721[_0x4a03('0x12')]){_0x2250b1=!![];}return sqlUtils['buildContactsQuery'](_0x485653,_0x28e721[_0x4a03('0x9')],_0x3adfb8,_0x1b3e3f,_0x3bb5d9[_0x4a03('0x13')],_0x2250b1);})[_0x4a03('0xe')](function(_0x4a4eca){if(!_0x4a4eca){return[];}return sqlUtils[_0x4a03('0x14')](_0x4a4eca,_0x28e721,_0x3adfb8);})[_0x4a03('0xe')](function(_0x583034){_0x50b2fe['rows']=_0x583034;return _0x50b2fe;})['catch'](function(_0x205c87){throw _0x205c87;});};exports[_0x4a03('0x15')]=function(){var _0x142151={};var _0x5c77e3=[];return db[_0x4a03('0x16')][_0x4a03('0x15')]()['then'](function(_0x2960c7){_0x142151=_0x2960c7;var _0x21f2c9=Object['keys'](_0x142151)['filter'](function(_0x1a038d){return _[_0x4a03('0x17')](_0x1a038d,'cf_')?_0x1a038d:undefined;});var _0x9d172d=_0x21f2c9['map'](function(_0x43064d){return db[_0x4a03('0x18')][_0x4a03('0x19')]({'where':{'id':_0x43064d[_0x4a03('0x1a')](0x3)},'raw':!![]});});return Promise[_0x4a03('0x1b')](_0x9d172d);})['then'](function(_0x31142e){for(var _0x58f48e=0x0;_0x58f48e<_0x31142e[_0x4a03('0x1c')];_0x58f48e++){if(_0x31142e[_0x58f48e]){var _0x39a160=_0x4a03('0x1d')+_0x31142e[_0x58f48e]['id'];_0x142151[_0x39a160]['fieldType']=_0x31142e[_0x58f48e][_0x4a03('0x1e')];}}_0x5c77e3=_[_0x4a03('0x1f')](Object[_0x4a03('0x20')](_0x142151),function(_0x14959d){return{'name':_0x14959d,'type':_0x142151[_0x14959d][_0x4a03('0x1e')]};});return _0x5c77e3;})['catch'](function(_0x14b2d0){throw _0x14b2d0;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 6e9ab48..f463655 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 _0x3af1=['default','text','start','value','end','Tag','map','and','tags','ids','User','user','clause','skip','keys','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','tag','filter','agent','getLists','attributes','select','c.id','limit','offset','group','having','order','DESC','findAll','color','keyBy','Sequelize','QueryTypes','CmContact','sequelize','toString','Tags','push','t.id\x20IN\x20?','SELECT','exports','lodash','squel','../parsers/qs','../interaction/utils','role','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','firstName','lastName','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression'];(function(_0x3ba6c7,_0xd64db5){var _0x961f5c=function(_0x5a8f7b){while(--_0x5a8f7b){_0x3ba6c7['push'](_0x3ba6c7['shift']());}};_0x961f5c(++_0xd64db5);}(_0x3af1,0x171));var _0x13af=function(_0x2e6c5b,_0x48b4a2){_0x2e6c5b=_0x2e6c5b-0x0;var _0x7d3ac0=_0x3af1[_0x2e6c5b];return _0x7d3ac0;};'use strict';var _=require(_0x13af('0x0'));var squel=require(_0x13af('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x13af('0x2'));var utils=require(_0x13af('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x315859,_0x25316f){var _0x93c81f=![];if(_0x315859[_0x13af('0x4')]==='agent'&&!_0x25316f[_0x13af('0x5')]&&!_0x25316f[_0x13af('0x6')]&&_0x25316f[_0x13af('0x7')]!==_0x13af('0x8')){_0x93c81f=!![];}return _0x93c81f;}function getContactsSubquery(){return squel['select']()[_0x13af('0x9')](_0x13af('0xa'),'c')[_0x13af('0xb')](_0x13af('0xc'));}function applyJoinClauses(_0x4db1f0,_0x42e496){var _0xb1c64e=_0x42e496?'c':_0x13af('0xd');_0x4db1f0[_0x13af('0xe')]('cm_user_has_contacts','uc',_0x13af('0xf')+_0xb1c64e+_0x13af('0x10'))[_0x13af('0xe')](_0x13af('0x11'),'ct',_0x13af('0x12')+_0xb1c64e+_0x13af('0x10'))['left_join']('tools_tags','t',_0x13af('0x13'));return _0x4db1f0;}function addFieldsToQuery(_0x24a00e,_0x2313fb,_0x484c87,_0x2a0698,_0x513a65){var _0x1db9df=_0x513a65?'c':'subqry';if(!_0x2313fb){_0x2313fb=['id',_0x13af('0x14'),_0x13af('0x15'),'phone',_0x13af('0x16'),_0x13af('0x17'),_0x13af('0x18'),_0x13af('0x6'),'CompanyId',_0x13af('0x19'),_0x13af('0x1a'),_0x13af('0x1b'),_0x13af('0x1c')];}else if(!_0x2313fb[_0x13af('0x1d')]('id')){_0x2313fb['push']('id');}var _0x594be2=_0x484c87&&_0x513a65||!_0x484c87&&!_0x513a65;if(_0x2a0698){_0x594be2=_0x2a0698&&_0x513a65||!_0x2a0698&&!_0x513a65;}_0x2313fb['forEach'](function(_0x12543e){if(_0x12543e===_0x13af('0x1c')){if(_0x594be2){_0x24a00e[_0x13af('0x1e')](_0x13af('0x1f'),_0x12543e);}else if(_0x484c87||_0x2a0698){_0x24a00e['field'](_0x1db9df+'.'+_0x12543e);}}else{_0x24a00e[_0x13af('0x1e')](_0x1db9df+'.'+_0x12543e);}});return _0x24a00e;}function getSqlClauses(){var _0x1a41f5={'default':squel[_0x13af('0x20')](),'fields':squel[_0x13af('0x20')](),'filter':squel[_0x13af('0x20')](),'tags':{'clause':squel[_0x13af('0x20')](),'ids':null},'user':{'clause':squel[_0x13af('0x20')](),'skip':![]}};return _0x1a41f5;}function parseTagParameter(_0x8e9ffe){var _0x11c29f=squel[_0x13af('0x20')]();if(_0x8e9ffe){var _0x1af95b=utils[_0x13af('0x21')](_0x8e9ffe);_0x1af95b[_0x13af('0x22')](function(_0x1ba743){_0x11c29f['or'](_0x13af('0x23'),'%,'+_0x1ba743+',%');});}return _0x11c29f;}function parseSearchFilter(_0x2d2490){var _0x4aaeab=squel[_0x13af('0x20')]();if(_0x2d2490){var _0x117d1e=_0x2d2490[_0x13af('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x117d1e[_0x13af('0x25')]('\x20')[_0x13af('0x26')]>0x1){_0x4aaeab['or'](_0x13af('0x27'),qs[_0x13af('0x28')](_0x117d1e,!![]),null);}else{if(qs['isNumeric'](_0x117d1e)){_0x4aaeab['or']('c.id\x20LIKE\x20?',_0x117d1e+'%');_0x4aaeab['or'](_0x13af('0x29'),_0x117d1e+'%');_0x4aaeab['or'](_0x13af('0x2a'),_0x117d1e+'%');_0x4aaeab['or'](_0x13af('0x2b'),_0x117d1e+'%');}else if(qs[_0x13af('0x2c')](_0x117d1e)){_0x4aaeab['or'](_0x13af('0x2d'),_0x117d1e+'%');}else{_0x4aaeab['or'](_0x13af('0x2e'),'%'+_0x117d1e+'%');_0x4aaeab['or'](_0x13af('0x2f'),'%'+_0x117d1e+'%');_0x4aaeab['or'](_0x13af('0x2d'),'%'+_0x117d1e+'%');}}}return _0x4aaeab;}function parseAdvancedSearchFilter(_0x2c0845,_0x2df550){var _0x4d181b=getSqlClauses();var _0x24dcfa=as[_0x13af('0x30')](_0x2c0845);var _0x101ef8=_0x24dcfa[_0x13af('0x31')];for(var _0x54f209=0x0;_0x54f209<_0x24dcfa[_0x13af('0x32')][_0x13af('0x26')];_0x54f209++){var _0x5ba3db=_0x24dcfa[_0x13af('0x32')][_0x54f209];var _0x5f1968='c';var _0x2c5e73=_[_0x13af('0x33')](_0x2df550,[_0x13af('0x34'),_0x5ba3db['field']]);if(_0x2c5e73){if(_0x5ba3db[_0x13af('0x1e')]===_0x13af('0x35')||_0x2c5e73[_0x13af('0x36')]===_0x13af('0x37')){_0x5ba3db[_0x13af('0x38')]=_0x13af('0x39');}var _0x559f84=as[_0x13af('0x3a')](_0x5f1968,_0x2c5e73['type'],_0x5ba3db);_0x4d181b[_0x13af('0x3b')][_0x101ef8](_0x559f84[_0x13af('0x3c')],_0x559f84['value'][_0x13af('0x3d')],_0x559f84[_0x13af('0x3e')][_0x13af('0x3f')]);}else{if(_0x5ba3db[_0x13af('0x1e')]===_0x13af('0x40')){var _0x1367e9=_0x5ba3db['value']['split'](',')[_0x13af('0x41')](function(_0x1249da){return Number(_0x1249da);});var _0x553e2f=parseTagParameter(_0x1367e9);_0x4d181b['tags']['clause'][_0x13af('0x42')](_0x553e2f);_0x4d181b[_0x13af('0x43')][_0x13af('0x44')]=_0x1367e9;}else if(_0x5ba3db[_0x13af('0x1e')]===_0x13af('0x45')){_0x4d181b[_0x13af('0x46')][_0x13af('0x47')][_0x13af('0x42')]('uc.UserId\x20=\x20?',_0x5ba3db[_0x13af('0x3e')]);_0x4d181b[_0x13af('0x46')][_0x13af('0x48')]=!![];}}}return _0x4d181b;}function parseModelFields(_0x57ca28,_0x38a8a5){var _0x19a026=squel[_0x13af('0x20')]();var _0x3e8f69=_(_0x57ca28)[_0x13af('0x49')]()['map'](function(_0x128395){return _['some'](_0x38a8a5,[_0x13af('0x34'),_0x128395])?_0x128395:undefined;})['compact']()[_0x13af('0x3e')]();if(_0x57ca28[_0x13af('0x4a')]){_0x3e8f69['push'](_0x13af('0x4a'));}if(_0x57ca28[_0x13af('0x45')]){_0x3e8f69['push'](_0x13af('0x45'));}if(_0x3e8f69[_0x13af('0x26')]>0x0){_0x3e8f69[_0x13af('0x22')](function(_0xaceb7b){if(_0xaceb7b===_0x13af('0x6')){_0x19a026[_0x13af('0x42')](_0x13af('0x4b'),[][_0x13af('0x4c')](_0x57ca28[_0xaceb7b]));}else if(_0xaceb7b==='Contact'){var _0x37ce44='%'+_0x57ca28[_0xaceb7b]+'%';_0x19a026['and'](_0x13af('0x4d'),_0x37ce44);}else if(_0xaceb7b===_0x13af('0x45')){_0x19a026[_0x13af('0x42')]('uc.UserId\x20=\x20?',_0x57ca28[_0xaceb7b]);}else{_0x19a026[_0x13af('0x42')]('c.'+_0xaceb7b+_0x13af('0x4e'),_0x57ca28[_0xaceb7b]);}});}return _0x19a026;}function parseQueryParameters(_0x1d031e,_0x10b47e){var _0x311fa9=getSqlClauses();return Promise[_0x13af('0x4f')]()[_0x13af('0x50')](function(){return parseModelFields(_0x1d031e,_0x10b47e);})[_0x13af('0x50')](function(_0x255fd3){_0x311fa9['fields'][_0x13af('0x42')](_0x255fd3);return parseTagParameter(_0x1d031e[_0x13af('0x51')]);})[_0x13af('0x50')](function(_0x4ccf87){_0x311fa9[_0x13af('0x43')]['clause'][_0x13af('0x42')](_0x4ccf87);return parseSearchFilter(_0x1d031e[_0x13af('0x52')]);})['then'](function(_0x33251f){_0x311fa9['filter']=_0x33251f;return _0x311fa9;});}function checkListsRestrictions(_0x5af5c0,_0x5d9901,_0x2666de){var _0x479209=squel[_0x13af('0x20')]();return Promise['resolve']()[_0x13af('0x50')](function(){if(_0x5d9901[_0x13af('0x5')]&&_0x5af5c0[_0x13af('0x4')]===_0x13af('0x53')&&!_0x2666de){return _0x5af5c0[_0x13af('0x54')]({'attributes':['id'],'raw':!![]});}})[_0x13af('0x50')](function(_0x115b54){if(_0x115b54){if(_0x115b54[_0x13af('0x26')]===0x0){_0x479209[_0x13af('0x42')]('c.ListId\x20IS\x20NULL');}else{_0x479209[_0x13af('0x42')](_0x13af('0x4b'),_[_0x13af('0x41')](_0x115b54,'id'));}}})[_0x13af('0x50')](function(){return _0x479209;});}function buildContactsQuery(_0xa34131,_0x5a3221,_0xb0b754,_0x3820c1,_0x493206,_0x2581c9){if(_0x5a3221){_0x5a3221=_0xb0b754[_0x13af('0x55')];}_0xa34131=addFieldsToQuery(_0xa34131,_0x5a3221,_0x3820c1,_0x2581c9,!![]);var _0x43e5cb=squel[_0x13af('0x56')]();_0x43e5cb=addFieldsToQuery(_0x43e5cb,_0x5a3221,_0x3820c1,_0x2581c9,![]);if(_0x3820c1||_0x2581c9){_0xa34131=applyJoinClauses(_0xa34131,!![]);_0xa34131['group'](_0x13af('0x57'));if(_0xb0b754['limit']){_0x43e5cb[_0x13af('0x58')](_0xb0b754[_0x13af('0x58')]);}if(_0xb0b754[_0x13af('0x59')]){_0x43e5cb[_0x13af('0x59')](_0xb0b754[_0x13af('0x59')]);}}else{_0x43e5cb=applyJoinClauses(_0x43e5cb,![]);_0x43e5cb[_0x13af('0x5a')]('subqry.id');if(_0xb0b754['limit']){_0xa34131['limit'](_0xb0b754[_0x13af('0x58')]);}if(_0xb0b754[_0x13af('0x59')]){_0xa34131[_0x13af('0x59')](_0xb0b754[_0x13af('0x59')]);}}_0x43e5cb[_0x13af('0x5b')](_0x493206);if(_0xb0b754[_0x13af('0x5c')]){_0xb0b754[_0x13af('0x5c')]['forEach'](function(_0x880f91){_0xa34131['order']('c.'+_0x880f91[0x0],_0x880f91[0x1]==='DESC'?![]:!![]);_0x43e5cb[_0x13af('0x5c')]('subqry.'+_0x880f91[0x0],_0x880f91[0x1]===_0x13af('0x5d')?![]:!![]);});}_0x43e5cb['from'](_0xa34131,'subqry');return _0x43e5cb;}function getFilteredContacts(_0x1f329c){var _0x50a538=[];return db[_0x13af('0x40')][_0x13af('0x5e')]({'attributes':['id',_0x13af('0x34'),_0x13af('0x5f')],'raw':!![]})[_0x13af('0x50')](function(_0x3c158e){_0x50a538=_[_0x13af('0x60')](_0x3c158e,'id');var _0x47a913={'type':db[_0x13af('0x61')][_0x13af('0x62')]['SELECT'],'model':db[_0x13af('0x63')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x13af('0x64')]['query'](_0x1f329c[_0x13af('0x65')](),_0x47a913);})[_0x13af('0x50')](function(_0x4d4b00){_0x4d4b00['forEach'](function(_0x5f5c21){if(_0x5f5c21[_0x13af('0x1c')]){_0x5f5c21[_0x13af('0x66')]=[];_0x5f5c21[_0x13af('0x1c')][_0x13af('0x25')](',')[_0x13af('0x22')](function(_0x32d47b){_0x5f5c21[_0x13af('0x66')][_0x13af('0x67')](_0x50a538[_0x32d47b]);});}delete _0x5f5c21[_0x13af('0x1c')];});return _0x4d4b00;});}function countFilteredContacts(_0x4ddb34,_0x45f932){var _0x58f12a=_0x4ddb34['clone']();_0x58f12a[_0x13af('0x1e')]('COUNT(*)');_0x58f12a=applyJoinClauses(_0x58f12a,!![]);_0x4ddb34[_0x13af('0x5a')](_0x13af('0x57'));var _0x25e849=utils[_0x13af('0x21')](_0x45f932);if(!_['isEmpty'](_0x25e849)){_0x58f12a[_0x13af('0xb')](_0x13af('0x68'),_0x25e849);}var _0x863883={'type':db[_0x13af('0x61')][_0x13af('0x62')][_0x13af('0x69')],'raw':!![]};return db['sequelize']['query'](_0x58f12a[_0x13af('0x65')](),_0x863883)[_0x13af('0x50')](function(_0x7927a5){return _0x7927a5[0x0]['COUNT(*)'];});}module[_0x13af('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x4c49=['Tag','tags','and','ids','User','user','clause','uc.UserId\x20=\x20?','skip','keys','map','compact','Contact','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','tag','filter','resolve','c.ListId\x20IS\x20NULL','attributes','select','group','c.id','limit','offset','subqry.id','having','order','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','CmContact','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','sequelize','exports','squel','../parsers/advancedSearch','../parsers/qs','role','search','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','subqry','firstName','lastName','phone','mobile','fax','ListId','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','escapeLIKESpecialChars','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end'];(function(_0x518517,_0x20373c){var _0x1e10d9=function(_0x1a1672){while(--_0x1a1672){_0x518517['push'](_0x518517['shift']());}};_0x1e10d9(++_0x20373c);}(_0x4c49,0x110));var _0x94c4=function(_0x3204ef,_0x7b0afe){_0x3204ef=_0x3204ef-0x0;var _0x10f921=_0x4c49[_0x3204ef];return _0x10f921;};'use strict';var _=require('lodash');var squel=require(_0x94c4('0x0'));var as=require(_0x94c4('0x1'));var qs=require(_0x94c4('0x2'));var utils=require('../interaction/utils');var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x2e6b21,_0x3910dd){var _0x574d82=![];if(_0x2e6b21[_0x94c4('0x3')]==='agent'&&!_0x3910dd[_0x94c4('0x4')]&&!_0x3910dd['ListId']&&_0x3910dd[_0x94c4('0x5')]!==_0x94c4('0x6')){_0x574d82=!![];}return _0x574d82;}function getContactsSubquery(){return squel['select']()[_0x94c4('0x7')](_0x94c4('0x8'),'c')[_0x94c4('0x9')](_0x94c4('0xa'));}function applyJoinClauses(_0x357054,_0x30a891){var _0x1beb47=_0x30a891?'c':'subqry';_0x357054[_0x94c4('0xb')](_0x94c4('0xc'),'uc',_0x94c4('0xd')+_0x1beb47+_0x94c4('0xe'))[_0x94c4('0xb')](_0x94c4('0xf'),'ct',_0x94c4('0x10')+_0x1beb47+'.id')[_0x94c4('0xb')](_0x94c4('0x11'),'t',_0x94c4('0x12'));return _0x357054;}function addFieldsToQuery(_0x5680e2,_0x31268e,_0x323144,_0x566903,_0x5cd0c9){var _0x53e4c6=_0x5cd0c9?'c':_0x94c4('0x13');if(!_0x31268e){_0x31268e=['id',_0x94c4('0x14'),_0x94c4('0x15'),_0x94c4('0x16'),_0x94c4('0x17'),_0x94c4('0x18'),'email',_0x94c4('0x19'),_0x94c4('0x1a'),_0x94c4('0x1b'),_0x94c4('0x1c'),_0x94c4('0x1d'),_0x94c4('0x1e')];}else if(!_0x31268e[_0x94c4('0x1f')]('id')){_0x31268e[_0x94c4('0x20')]('id');}var _0xf12d6c=_0x323144&&_0x5cd0c9||!_0x323144&&!_0x5cd0c9;if(_0x566903){_0xf12d6c=_0x566903&&_0x5cd0c9||!_0x566903&&!_0x5cd0c9;}_0x31268e[_0x94c4('0x21')](function(_0x4da702){if(_0x4da702==='TagIds'){if(_0xf12d6c){_0x5680e2[_0x94c4('0x22')](_0x94c4('0x23'),_0x4da702);}else if(_0x323144||_0x566903){_0x5680e2[_0x94c4('0x22')](_0x53e4c6+'.'+_0x4da702);}}else{_0x5680e2['field'](_0x53e4c6+'.'+_0x4da702);}});return _0x5680e2;}function getSqlClauses(){var _0x4db637={'default':squel[_0x94c4('0x24')](),'fields':squel[_0x94c4('0x24')](),'filter':squel[_0x94c4('0x24')](),'tags':{'clause':squel[_0x94c4('0x24')](),'ids':null},'user':{'clause':squel[_0x94c4('0x24')](),'skip':![]}};return _0x4db637;}function parseTagParameter(_0x7cd531){var _0x3bda4d=squel[_0x94c4('0x24')]();if(_0x7cd531){var _0xefb4ab=utils[_0x94c4('0x25')](_0x7cd531);_0xefb4ab[_0x94c4('0x21')](function(_0x477910){_0x3bda4d['or'](_0x94c4('0x26'),'%,'+_0x477910+',%');});}return _0x3bda4d;}function parseSearchFilter(_0xf25911){var _0x47803f=squel[_0x94c4('0x24')]();if(_0xf25911){var _0x518ba2=_0xf25911[_0x94c4('0x27')]('\x5c','\x5c\x5c')[_0x94c4('0x27')](/'/g,'\x27\x27');var _0x4ec7f2=qs[_0x94c4('0x28')](_0x518ba2);if(_0x518ba2[_0x94c4('0x29')]('\x20')[_0x94c4('0x2a')]>0x1){_0x47803f['or'](_0x94c4('0x2b'),qs[_0x94c4('0x2c')](_0x518ba2,!![]),null);}else{if(qs[_0x94c4('0x2d')](_0x518ba2)){_0x47803f['or'](_0x94c4('0x2e'),_0x4ec7f2+'%');_0x47803f['or'](_0x94c4('0x2f'),_0x4ec7f2+'%');_0x47803f['or'](_0x94c4('0x30'),_0x4ec7f2+'%');_0x47803f['or'](_0x94c4('0x31'),_0x4ec7f2+'%');}else if(qs['isEmail'](_0x518ba2)){_0x47803f['or'](_0x94c4('0x32'),_0x4ec7f2+'%');}else{_0x47803f['or'](_0x94c4('0x33'),'%'+_0x4ec7f2+'%');_0x47803f['or']('c.lastName\x20LIKE\x20?','%'+_0x4ec7f2+'%');_0x47803f['or'](_0x94c4('0x32'),'%'+_0x4ec7f2+'%');}}}return _0x47803f;}function parseAdvancedSearchFilter(_0x467718,_0x4d3f1e){var _0x226eb3=getSqlClauses();var _0x5f436=as[_0x94c4('0x34')](_0x467718);var _0x2cb1f7=_0x5f436['sqlOperator'];for(var _0x1e5783=0x0;_0x1e5783<_0x5f436['conditions'][_0x94c4('0x2a')];_0x1e5783++){var _0x412996=_0x5f436[_0x94c4('0x35')][_0x1e5783];var _0x2df017='c';var _0x4beaf5=_['find'](_0x4d3f1e,[_0x94c4('0x36'),_0x412996[_0x94c4('0x22')]]);if(_0x4beaf5){if(_0x412996['field']===_0x94c4('0x37')||_0x4beaf5[_0x94c4('0x38')]===_0x94c4('0x39')){_0x412996[_0x94c4('0x3a')]=_0x94c4('0x3b');}var _0x28f4a4=as[_0x94c4('0x3c')](_0x2df017,_0x4beaf5[_0x94c4('0x3d')],_0x412996);_0x226eb3[_0x94c4('0x3e')][_0x2cb1f7](_0x28f4a4[_0x94c4('0x3f')],_0x28f4a4[_0x94c4('0x40')][_0x94c4('0x41')],_0x28f4a4['value'][_0x94c4('0x42')]);}else{if(_0x412996[_0x94c4('0x22')]===_0x94c4('0x43')){var _0x3fac55=_0x412996['value']['split'](',')['map'](function(_0x303d98){return Number(_0x303d98);});var _0xf9abc8=parseTagParameter(_0x3fac55);_0x226eb3[_0x94c4('0x44')]['clause'][_0x94c4('0x45')](_0xf9abc8);_0x226eb3[_0x94c4('0x44')][_0x94c4('0x46')]=_0x3fac55;}else if(_0x412996[_0x94c4('0x22')]===_0x94c4('0x47')){_0x226eb3[_0x94c4('0x48')][_0x94c4('0x49')][_0x94c4('0x45')](_0x94c4('0x4a'),_0x412996[_0x94c4('0x40')]);_0x226eb3[_0x94c4('0x48')][_0x94c4('0x4b')]=!![];}}}return _0x226eb3;}function parseModelFields(_0x3af778,_0x16c406){var _0x57353a=squel[_0x94c4('0x24')]();var _0x512d93=_(_0x3af778)[_0x94c4('0x4c')]()[_0x94c4('0x4d')](function(_0x319900){return _['some'](_0x16c406,[_0x94c4('0x36'),_0x319900])?_0x319900:undefined;})[_0x94c4('0x4e')]()['value']();if(_0x3af778[_0x94c4('0x4f')]){_0x512d93[_0x94c4('0x20')](_0x94c4('0x4f'));}if(_0x3af778[_0x94c4('0x47')]){_0x512d93['push']('User');}if(_0x512d93[_0x94c4('0x2a')]>0x0){_0x512d93[_0x94c4('0x21')](function(_0x231095){if(_0x231095===_0x94c4('0x19')){_0x57353a[_0x94c4('0x45')](_0x94c4('0x50'),[][_0x94c4('0x51')](_0x3af778[_0x231095]));}else if(_0x231095==='Contact'){var _0x5dec79='%'+_0x3af778[_0x231095]+'%';_0x57353a[_0x94c4('0x45')](_0x94c4('0x52'),_0x5dec79);}else if(_0x231095===_0x94c4('0x47')){_0x57353a[_0x94c4('0x45')](_0x94c4('0x4a'),_0x3af778[_0x231095]);}else{_0x57353a['and']('c.'+_0x231095+'\x20=\x20?',_0x3af778[_0x231095]);}});}return _0x57353a;}function parseQueryParameters(_0x2fdb51,_0x1ebcff){var _0x23c7c7=getSqlClauses();return Promise['resolve']()[_0x94c4('0x53')](function(){return parseModelFields(_0x2fdb51,_0x1ebcff);})['then'](function(_0x2c9021){_0x23c7c7['fields']['and'](_0x2c9021);return parseTagParameter(_0x2fdb51[_0x94c4('0x54')]);})[_0x94c4('0x53')](function(_0x4af91b){_0x23c7c7[_0x94c4('0x44')][_0x94c4('0x49')][_0x94c4('0x45')](_0x4af91b);return parseSearchFilter(_0x2fdb51[_0x94c4('0x55')]);})[_0x94c4('0x53')](function(_0x58fa0e){_0x23c7c7[_0x94c4('0x55')]=_0x58fa0e;return _0x23c7c7;});}function checkListsRestrictions(_0x4b08a2,_0x201f1d,_0x3e0e3b){var _0x5c0a7=squel[_0x94c4('0x24')]();return Promise[_0x94c4('0x56')]()['then'](function(){if(_0x201f1d[_0x94c4('0x4')]&&_0x4b08a2['role']==='agent'&&!_0x3e0e3b){return _0x4b08a2['getLists']({'attributes':['id'],'raw':!![]});}})[_0x94c4('0x53')](function(_0x57b3b1){if(_0x57b3b1){if(_0x57b3b1[_0x94c4('0x2a')]===0x0){_0x5c0a7[_0x94c4('0x45')](_0x94c4('0x57'));}else{_0x5c0a7[_0x94c4('0x45')](_0x94c4('0x50'),_[_0x94c4('0x4d')](_0x57b3b1,'id'));}}})[_0x94c4('0x53')](function(){return _0x5c0a7;});}function buildContactsQuery(_0x4436f5,_0x17d871,_0x3cc6a7,_0xc2c67a,_0x396962,_0x474bfb){if(_0x17d871){_0x17d871=_0x3cc6a7[_0x94c4('0x58')];}_0x4436f5=addFieldsToQuery(_0x4436f5,_0x17d871,_0xc2c67a,_0x474bfb,!![]);var _0x2efdcf=squel[_0x94c4('0x59')]();_0x2efdcf=addFieldsToQuery(_0x2efdcf,_0x17d871,_0xc2c67a,_0x474bfb,![]);if(_0xc2c67a||_0x474bfb){_0x4436f5=applyJoinClauses(_0x4436f5,!![]);_0x4436f5[_0x94c4('0x5a')](_0x94c4('0x5b'));if(_0x3cc6a7['limit']){_0x2efdcf[_0x94c4('0x5c')](_0x3cc6a7['limit']);}if(_0x3cc6a7['offset']){_0x2efdcf[_0x94c4('0x5d')](_0x3cc6a7[_0x94c4('0x5d')]);}}else{_0x2efdcf=applyJoinClauses(_0x2efdcf,![]);_0x2efdcf[_0x94c4('0x5a')](_0x94c4('0x5e'));if(_0x3cc6a7[_0x94c4('0x5c')]){_0x4436f5[_0x94c4('0x5c')](_0x3cc6a7[_0x94c4('0x5c')]);}if(_0x3cc6a7['offset']){_0x4436f5[_0x94c4('0x5d')](_0x3cc6a7['offset']);}}_0x2efdcf[_0x94c4('0x5f')](_0x396962);if(_0x3cc6a7[_0x94c4('0x60')]){_0x3cc6a7['order']['forEach'](function(_0x36ebbb){_0x4436f5['order']('c.'+_0x36ebbb[0x0],_0x36ebbb[0x1]==='DESC'?![]:!![]);_0x2efdcf[_0x94c4('0x60')]('subqry.'+_0x36ebbb[0x0],_0x36ebbb[0x1]===_0x94c4('0x61')?![]:!![]);});}_0x2efdcf[_0x94c4('0x7')](_0x4436f5,'subqry');return _0x2efdcf;}function getFilteredContacts(_0x22c0f2){var _0xec2e5a=[];return db[_0x94c4('0x43')][_0x94c4('0x62')]({'attributes':['id',_0x94c4('0x36'),'color'],'raw':!![]})[_0x94c4('0x53')](function(_0x192fdc){_0xec2e5a=_[_0x94c4('0x63')](_0x192fdc,'id');var _0x32f737={'type':db[_0x94c4('0x64')][_0x94c4('0x65')][_0x94c4('0x66')],'model':db[_0x94c4('0x67')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x94c4('0x68')](_0x22c0f2[_0x94c4('0x69')](),_0x32f737);})['then'](function(_0x2a88c5){_0x2a88c5[_0x94c4('0x21')](function(_0xedf1cb){if(_0xedf1cb['TagIds']){_0xedf1cb['Tags']=[];_0xedf1cb[_0x94c4('0x1e')][_0x94c4('0x29')](',')[_0x94c4('0x21')](function(_0x356234){_0xedf1cb[_0x94c4('0x6a')][_0x94c4('0x20')](_0xec2e5a[_0x356234]);});}delete _0xedf1cb[_0x94c4('0x1e')];});return _0x2a88c5;});}function countFilteredContacts(_0x2ea1b9,_0x381433){var _0xdc983=_0x2ea1b9[_0x94c4('0x6b')]();_0xdc983[_0x94c4('0x22')](_0x94c4('0x6c'));_0xdc983=applyJoinClauses(_0xdc983,!![]);_0x2ea1b9[_0x94c4('0x5a')](_0x94c4('0x5b'));var _0x5c0fe9=utils[_0x94c4('0x25')](_0x381433);if(!_[_0x94c4('0x6d')](_0x5c0fe9)){_0xdc983['where'](_0x94c4('0x6e'),_0x5c0fe9);}var _0x48cf85={'type':db[_0x94c4('0x64')][_0x94c4('0x65')]['SELECT'],'raw':!![]};return db[_0x94c4('0x6f')][_0x94c4('0x68')](_0xdc983[_0x94c4('0x69')](),_0x48cf85)[_0x94c4('0x53')](function(_0x15c04e){return _0x15c04e[0x0][_0x94c4('0x6c')];});}module[_0x94c4('0x70')]={'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 8d73a57..b294177 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 _0x65a2=['secrets','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','final','write','unlink','createDecipher','close','encryptString','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app'];(function(_0x55bc72,_0x41d5d9){var _0x7fafc1=function(_0x2ba238){while(--_0x2ba238){_0x55bc72['push'](_0x55bc72['shift']());}};_0x7fafc1(++_0x41d5d9);}(_0x65a2,0x66));var _0x265a=function(_0x290099,_0x51aabb){_0x290099=_0x290099-0x0;var _0x28e216=_0x65a2[_0x290099];return _0x28e216;};'use strict';var crypto=require(_0x265a('0x0'));var fs=require('fs');var BPromise=require(_0x265a('0x1'));var _=require(_0x265a('0x2'));var config=require(_0x265a('0x3'));var logger=require(_0x265a('0x4'))(_0x265a('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x265a('0x6')]['session'],'algorithm':_0x265a('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x265a('0x8')]&&config[_0x265a('0x8')][_0x265a('0x9')]){var isSupported=isAlgorithmSupported(config[_0x265a('0x8')][_0x265a('0x9')]);if(isSupported){fileOptions[_0x265a('0x9')]=config['encrypt'][_0x265a('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x265a('0xa')](',\x20');logger[_0x265a('0xb')](config['encrypt'][_0x265a('0x9')],_0x265a('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x34ab91){return AES_SUPPORTED_RX[_0x265a('0xd')](_0x34ab91);}function getSupportedCiphers(){return crypto[_0x265a('0xe')]()[_0x265a('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x5ac3a0){return getSupportedCiphers()[_0x265a('0x10')](_0x5ac3a0)>-0x1;}function combineOptions(_0xf4dfbf){var _0x25dd41={};for(var _0x324960 in fileOptions){if(fileOptions[_0x265a('0x11')](_0x324960)){_0x25dd41[_0x324960]=fileOptions[_0x324960];}}if(_0xf4dfbf){for(var _0x15be83 in _0xf4dfbf){if(_0xf4dfbf[_0x265a('0x11')](_0x15be83)){_0x25dd41[_0x15be83]=_0xf4dfbf[_0x15be83];}}}return _0x25dd41;}exports[_0x265a('0x12')]=function(_0x1f75ae,_0x5a5bf0,_0x3047ce,_0x3415a4){return new BPromise(function(_0x55067c,_0x520a98){_0x3415a4=combineOptions(_0x3415a4);var _0x256a87=new Buffer(_0x3047ce);var _0x479ade=fs[_0x265a('0x13')](_0x1f75ae);var _0x269933=fs[_0x265a('0x14')](_0x5a5bf0);var _0x3be515=crypto[_0x265a('0x15')](_0x3415a4[_0x265a('0x9')],_0x256a87);_0x479ade['on'](_0x265a('0x16'),function(_0x37fb33){var _0x5cbf66=new Buffer(_0x3be515[_0x265a('0x17')](_0x37fb33),_0x265a('0x18'));_0x269933['write'](_0x5cbf66);});_0x479ade['on'](_0x265a('0x19'),function(){try{var _0x49b38c=new Buffer(_0x3be515[_0x265a('0x1a')](_0x265a('0x18')),'binary');_0x269933[_0x265a('0x1b')](_0x49b38c);_0x269933[_0x265a('0x19')]();_0x269933['on']('close',function(){return _0x55067c(_0x5a5bf0);});}catch(_0x56bf65){fs[_0x265a('0x1c')](_0x5a5bf0);return _0x520a98(_0x56bf65);}});});};exports['decryptFile']=function(_0x398dab,_0x31287d,_0x5622e7,_0x1b4b7c){return new BPromise(function(_0x4abcb0,_0x5622b6){_0x1b4b7c=combineOptions(_0x1b4b7c);var _0x2c0b24=new Buffer(_0x5622e7);var _0x414268=fs[_0x265a('0x13')](_0x398dab);var _0x4cfa85=fs['createWriteStream'](_0x31287d);var _0x5896e6=crypto[_0x265a('0x1d')](_0x1b4b7c[_0x265a('0x9')],_0x2c0b24);_0x414268['on'](_0x265a('0x16'),function(_0x2e1c54){var _0x402fef=new Buffer(_0x5896e6['update'](_0x2e1c54),'binary');_0x4cfa85[_0x265a('0x1b')](_0x402fef);});_0x414268['on']('end',function(){try{var _0x40743a=new Buffer(_0x5896e6[_0x265a('0x1a')](_0x265a('0x18')),_0x265a('0x18'));_0x4cfa85[_0x265a('0x1b')](_0x40743a);_0x4cfa85[_0x265a('0x19')]();_0x4cfa85['on'](_0x265a('0x1e'),function(){return _0x4abcb0(_0x31287d);});}catch(_0x546988){fs[_0x265a('0x1c')](_0x31287d);return _0x5622b6(_0x546988);}});});};exports[_0x265a('0x1f')]=function(_0x1a7130,_0x51d11e,_0x4e8366){var _0xb6a4fe=_0x4e8366||stringOptions[_0x265a('0x9')];var _0x5bce89=_0x51d11e||stringOptions[_0x265a('0x20')];var _0x61b3e2=crypto[_0x265a('0x15')](_0xb6a4fe,_0x5bce89);var _0x52c278=_0x61b3e2[_0x265a('0x17')](_0x1a7130,_0x265a('0x21'),_0x265a('0x22'));_0x52c278+=_0x61b3e2[_0x265a('0x1a')](_0x265a('0x22'));return _0x52c278;};exports[_0x265a('0x23')]=function(_0x907135,_0x25cae8,_0x279c44){var _0x1d97ee=_0x279c44||stringOptions[_0x265a('0x9')];var _0x146c75=_0x25cae8||stringOptions[_0x265a('0x20')];var _0x371cfb=crypto[_0x265a('0x1d')](_0x1d97ee,_0x146c75);var _0x394909=_0x371cfb[_0x265a('0x17')](_0x907135,_0x265a('0x22'),'utf8');_0x394909+=_0x371cfb[_0x265a('0x1a')](_0x265a('0x21'));return _0x394909;}; \ No newline at end of file +var _0x7d81=['hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final','close','unlink','decryptFile','createDecipher','data','secret','utf8','base64','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf'];(function(_0xb739ce,_0x196200){var _0x45caef=function(_0x2de7df){while(--_0x2de7df){_0xb739ce['push'](_0xb739ce['shift']());}};_0x45caef(++_0x196200);}(_0x7d81,0xbb));var _0x17d8=function(_0x2d340d,_0x35a2f6){_0x2d340d=_0x2d340d-0x0;var _0x38932a=_0x7d81[_0x2d340d];return _0x38932a;};'use strict';var crypto=require(_0x17d8('0x0'));var fs=require('fs');var BPromise=require(_0x17d8('0x1'));var _=require('lodash');var config=require(_0x17d8('0x2'));var logger=require(_0x17d8('0x3'))(_0x17d8('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x17d8('0x5')][_0x17d8('0x6')],'algorithm':_0x17d8('0x7')};const fileOptions={'algorithm':_0x17d8('0x8')};if(config['encrypt']&&config[_0x17d8('0x9')][_0x17d8('0xa')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x17d8('0xa')]);if(isSupported){fileOptions[_0x17d8('0xa')]=config[_0x17d8('0x9')][_0x17d8('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x17d8('0xb')](',\x20');logger[_0x17d8('0xc')](config['encrypt'][_0x17d8('0xa')],_0x17d8('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x4e7c13){return AES_SUPPORTED_RX['test'](_0x4e7c13);}function getSupportedCiphers(){return crypto[_0x17d8('0xe')]()[_0x17d8('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x4f4aa7){return getSupportedCiphers()[_0x17d8('0x10')](_0x4f4aa7)>-0x1;}function combineOptions(_0x300cc0){var _0x1ae00e={};for(var _0xb8c998 in fileOptions){if(fileOptions[_0x17d8('0x11')](_0xb8c998)){_0x1ae00e[_0xb8c998]=fileOptions[_0xb8c998];}}if(_0x300cc0){for(var _0x3dff4d in _0x300cc0){if(_0x300cc0[_0x17d8('0x11')](_0x3dff4d)){_0x1ae00e[_0x3dff4d]=_0x300cc0[_0x3dff4d];}}}return _0x1ae00e;}exports['encryptFile']=function(_0x374380,_0x27d7be,_0xb1008e,_0x34bb8d){return new BPromise(function(_0x362d59,_0x3d9ab1){_0x34bb8d=combineOptions(_0x34bb8d);var _0x423f0b=new Buffer(_0xb1008e);var _0x250dfd=fs[_0x17d8('0x12')](_0x374380);var _0xa291ad=fs[_0x17d8('0x13')](_0x27d7be);var _0x56c122=crypto[_0x17d8('0x14')](_0x34bb8d['algorithm'],_0x423f0b);_0x250dfd['on']('data',function(_0x44aac0){var _0xc82504=new Buffer(_0x56c122[_0x17d8('0x15')](_0x44aac0),_0x17d8('0x16'));_0xa291ad[_0x17d8('0x17')](_0xc82504);});_0x250dfd['on'](_0x17d8('0x18'),function(){try{var _0x512b2e=new Buffer(_0x56c122[_0x17d8('0x19')](_0x17d8('0x16')),_0x17d8('0x16'));_0xa291ad[_0x17d8('0x17')](_0x512b2e);_0xa291ad[_0x17d8('0x18')]();_0xa291ad['on'](_0x17d8('0x1a'),function(){return _0x362d59(_0x27d7be);});}catch(_0x5bf018){fs[_0x17d8('0x1b')](_0x27d7be);return _0x3d9ab1(_0x5bf018);}});});};exports[_0x17d8('0x1c')]=function(_0x11a856,_0x2df5dc,_0xa7a1cb,_0x1eb202){return new BPromise(function(_0x5a8be3,_0x4cda22){_0x1eb202=combineOptions(_0x1eb202);var _0x95aaa5=new Buffer(_0xa7a1cb);var _0x510303=fs[_0x17d8('0x12')](_0x11a856);var _0x46b7fb=fs[_0x17d8('0x13')](_0x2df5dc);var _0x59d3aa=crypto[_0x17d8('0x1d')](_0x1eb202['algorithm'],_0x95aaa5);_0x510303['on'](_0x17d8('0x1e'),function(_0x5e10a9){var _0x112949=new Buffer(_0x59d3aa[_0x17d8('0x15')](_0x5e10a9),'binary');_0x46b7fb[_0x17d8('0x17')](_0x112949);});_0x510303['on'](_0x17d8('0x18'),function(){try{var _0x35ca63=new Buffer(_0x59d3aa[_0x17d8('0x19')]('binary'),'binary');_0x46b7fb[_0x17d8('0x17')](_0x35ca63);_0x46b7fb[_0x17d8('0x18')]();_0x46b7fb['on']('close',function(){return _0x5a8be3(_0x2df5dc);});}catch(_0x443d28){fs[_0x17d8('0x1b')](_0x2df5dc);return _0x4cda22(_0x443d28);}});});};exports['encryptString']=function(_0x5c01eb,_0x2ad706,_0xc6adb0){var _0x20d4b6=_0xc6adb0||stringOptions[_0x17d8('0xa')];var _0x1e1b8b=_0x2ad706||stringOptions[_0x17d8('0x1f')];var _0x262c0b=crypto[_0x17d8('0x14')](_0x20d4b6,_0x1e1b8b);var _0xa6e93=_0x262c0b[_0x17d8('0x15')](_0x5c01eb,_0x17d8('0x20'),_0x17d8('0x21'));_0xa6e93+=_0x262c0b[_0x17d8('0x19')](_0x17d8('0x21'));return _0xa6e93;};exports['decryptString']=function(_0x25af10,_0x1fcf28,_0x49d2a6){var _0x88dcc7=_0x49d2a6||stringOptions[_0x17d8('0xa')];var _0x1c694e=_0x1fcf28||stringOptions[_0x17d8('0x1f')];var _0x570b88=crypto[_0x17d8('0x1d')](_0x88dcc7,_0x1c694e);var _0x29e2af=_0x570b88[_0x17d8('0x15')](_0x25af10,_0x17d8('0x21'),_0x17d8('0x20'));_0x29e2af+=_0x570b88[_0x17d8('0x19')](_0x17d8('0x20'));return _0x29e2af;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 2a76263..06c9a94 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 _0xef01=['length','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','zip\x20finished','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','update','info','format','CSV','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','.csv'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xef01,0x6c));var _0x1ef0=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xef01[_0x40220a];return _0x3903cc;};'use strict';var util=require(_0x1ef0('0x0'));var path=require('path');var _=require(_0x1ef0('0x1'));var csv=require(_0x1ef0('0x2'));var fs=require('fs');var BPromise=require(_0x1ef0('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x1ef0('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1ef0('0x5'))[_0x1ef0('0x6')];var logger=require('../../config/logger')(_0x1ef0('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x1ef0('0x8')][0x2]);var QUERY=process[_0x1ef0('0x8')][0x3];var PATH=process[_0x1ef0('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xb62519,_0x14c401){var _0x3f3c94={'status':_0xb62519};var _0x504b36={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x14c401){_0x3f3c94[_0x1ef0('0x9')]=_0x14c401;}return db['AnalyticExtractedReport'][_0x1ef0('0xa')](_0x3f3c94,_0x504b36);}function main(){var _0x37836e=0x1388;var _0x53914b;logger[_0x1ef0('0xb')](util[_0x1ef0('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1ef0('0xd')));return db['Setting'][_0x1ef0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1ef0('0xf'),_0x1ef0('0x10')]})[_0x1ef0('0x11')](function(_0x17ce71){if(_0x17ce71){_0x53914b=_0x17ce71;_0x37836e=_0x53914b[_0x1ef0('0x10')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0x1ef0('0xc')](_0x1ef0('0x12'),QUERY),{'type':dbH[_0x1ef0('0x13')][_0x1ef0('0x14')][_0x1ef0('0x15')]});})[_0x1ef0('0x11')](function(_0x44a90e){if(!_0x44a90e[0x0]['num']){return analyticExtractedReport(_0x1ef0('0x16'));}var _0x101f74=[];var _0x5875ef=0x0;if(_0x53914b['split']){if(_0x44a90e&&_0x44a90e['length']){var _0x89397a=_[_0x1ef0('0x17')](_0x44a90e[0x0][_0x1ef0('0x18')]/_0x37836e);var _0x5d0986=Number[_0x1ef0('0x19')](_0x44a90e[0x0][_0x1ef0('0x18')]/_0x37836e)?_0x44a90e[0x0][_0x1ef0('0x18')]%_0x37836e:0x0;_0x89397a[_0x1ef0('0x1a')](function(_0x37203c){if(_0x37203c>0x0){_0x5875ef+=_0x37836e;}_0x101f74[_0x1ef0('0x1b')](dbH[_0x1ef0('0x13')]['query'](util[_0x1ef0('0xc')](_0x1ef0('0x1c'),QUERY,_0x37836e,_0x5875ef),{'type':dbH[_0x1ef0('0x13')]['QueryTypes'][_0x1ef0('0x15')]}));});if(_0x5d0986>0x0){_0x5875ef+=_0x37836e;_0x101f74[_0x1ef0('0x1b')](dbH['sequelize'][_0x1ef0('0x1d')](util['format'](_0x1ef0('0x1c'),QUERY,_0x5d0986,_0x5875ef),{'type':dbH[_0x1ef0('0x13')]['QueryTypes'][_0x1ef0('0x15')]}));}}}else{_0x101f74[_0x1ef0('0x1b')](dbH[_0x1ef0('0x13')][_0x1ef0('0x1d')](QUERY,{'type':dbH[_0x1ef0('0x13')][_0x1ef0('0x14')][_0x1ef0('0x15')]}));}var _0x57d58a=path[_0x1ef0('0x1e')](PATH);var _0x43022b=path[_0x1ef0('0x1f')](PATH,_0x1ef0('0x20'));var _0x27553c=_0x53914b[_0x1ef0('0xf')]&&_0x101f74[_0x1ef0('0x21')]>0x1;var _0x3f29c5=[];if(!fs['existsSync'](path[_0x1ef0('0x22')](_0x57d58a,_0x43022b))&&_0x27553c){fs[_0x1ef0('0x23')](path['join'](_0x57d58a,_0x43022b));}return BPromise[_0x1ef0('0x24')](_0x101f74,function(_0x2a0215){_0x3f29c5[_0x1ef0('0x1b')](_0x2a0215);})[_0x1ef0('0x11')](function(){for(var _0x373f7f=0x0;_0x373f7f<_0x3f29c5[_0x1ef0('0x21')];_0x373f7f+=0x1){var _0x4f6775;var _0x5aa7ce=_0x3f29c5[_0x373f7f];if(_0x27553c){_0x4f6775=path['join'](_0x57d58a,_0x43022b,util[_0x1ef0('0xc')]('%s%d.%s',_0x43022b,_0x373f7f,_0x1ef0('0x25')));}else{_0x4f6775=path[_0x1ef0('0x22')](_0x57d58a,util[_0x1ef0('0xc')]('%s.%s',_0x43022b,_0x1ef0('0x25')));}fs[_0x1ef0('0x26')](_0x4f6775,csv(_0x5aa7ce));}})[_0x1ef0('0x11')](function(){if(_0x27553c){return new Promise(function(_0x1c2492){zipdir(path[_0x1ef0('0x22')](_0x57d58a,_0x43022b),{'saveTo':path[_0x1ef0('0x22')](_0x57d58a,util[_0x1ef0('0xc')](_0x1ef0('0x27'),_0x43022b,_0x1ef0('0x28')))},function(_0x2b5022,_0x4c85e2){rimraf(path[_0x1ef0('0x22')](_0x57d58a,_0x43022b),function(){});_0x1c2492(_0x1ef0('0x29'));});});}})['then'](function(){logger[_0x1ef0('0xb')](util[_0x1ef0('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1ef0('0xd')));return analyticExtractedReport('Completed',_0x27553c?util[_0x1ef0('0xc')](_0x1ef0('0x27'),_0x43022b,_0x27553c?'zip':_0x1ef0('0x25')):null);});})['catch'](function(_0x509338){logger['info'](util[_0x1ef0('0xc')](_0x1ef0('0x2a'),EXTRACTED_REPORT_ID,_0x1ef0('0xd')),util[_0x1ef0('0x2b')](_0x509338,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1ef0('0x2c'));})[_0x1ef0('0x2d')](function(){process[_0x1ef0('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8e0c=['csv','writeFileSync','%s.%s','zip','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','argv','savename','update','info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s'];(function(_0x18847a,_0xd6898e){var _0x5b68ca=function(_0xf333b){while(--_0xf333b){_0x18847a['push'](_0x18847a['shift']());}};_0x5b68ca(++_0xd6898e);}(_0x8e0c,0x19f));var _0xc8e0=function(_0x26d3f1,_0x2ee80a){_0x26d3f1=_0x26d3f1-0x0;var _0x5333c5=_0x8e0c[_0x26d3f1];return _0x5333c5;};'use strict';var util=require('util');var path=require(_0xc8e0('0x0'));var _=require(_0xc8e0('0x1'));var csv=require(_0xc8e0('0x2'));var fs=require('fs');var BPromise=require(_0xc8e0('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xc8e0('0x4'));var db=require(_0xc8e0('0x5'))['db'];var dbH=require(_0xc8e0('0x5'))[_0xc8e0('0x6')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc8e0('0x7')][0x2]);var QUERY=process[_0xc8e0('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2253c4,_0x1f8b7e){var _0x41a889={'status':_0x2253c4};var _0x21673a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f8b7e){_0x41a889[_0xc8e0('0x8')]=_0x1f8b7e;}return db['AnalyticExtractedReport'][_0xc8e0('0x9')](_0x41a889,_0x21673a);}function main(){var _0xeee226=0x1388;var _0x51e36c;logger[_0xc8e0('0xa')](util[_0xc8e0('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc8e0('0xc')));return db[_0xc8e0('0xd')][_0xc8e0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc8e0('0xf'),_0xc8e0('0x10')]})[_0xc8e0('0x11')](function(_0x12d15c){if(_0x12d15c){_0x51e36c=_0x12d15c;_0xeee226=_0x51e36c[_0xc8e0('0x10')]||0x1388;}})['then'](function(){return dbH[_0xc8e0('0x12')][_0xc8e0('0x13')](util[_0xc8e0('0xb')](_0xc8e0('0x14'),QUERY),{'type':dbH[_0xc8e0('0x12')][_0xc8e0('0x15')]['SELECT']});})[_0xc8e0('0x11')](function(_0x511352){if(!_0x511352[0x0][_0xc8e0('0x16')]){return analyticExtractedReport(_0xc8e0('0x17'));}var _0x1939d0=[];var _0x3c2e8f=0x0;if(_0x51e36c[_0xc8e0('0xf')]){if(_0x511352&&_0x511352[_0xc8e0('0x18')]){var _0x3a84a3=_['range'](_0x511352[0x0][_0xc8e0('0x16')]/_0xeee226);var _0xc68f45=Number['isInteger'](_0x511352[0x0]['num']/_0xeee226)?_0x511352[0x0][_0xc8e0('0x16')]%_0xeee226:0x0;_0x3a84a3['forEach'](function(_0x468efb){if(_0x468efb>0x0){_0x3c2e8f+=_0xeee226;}_0x1939d0[_0xc8e0('0x19')](dbH[_0xc8e0('0x12')]['query'](util[_0xc8e0('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xeee226,_0x3c2e8f),{'type':dbH[_0xc8e0('0x12')][_0xc8e0('0x15')][_0xc8e0('0x1a')]}));});if(_0xc68f45>0x0){_0x3c2e8f+=_0xeee226;_0x1939d0[_0xc8e0('0x19')](dbH[_0xc8e0('0x12')][_0xc8e0('0x13')](util[_0xc8e0('0xb')](_0xc8e0('0x1b'),QUERY,_0xc68f45,_0x3c2e8f),{'type':dbH[_0xc8e0('0x12')][_0xc8e0('0x15')][_0xc8e0('0x1a')]}));}}}else{_0x1939d0[_0xc8e0('0x19')](dbH[_0xc8e0('0x12')]['query'](QUERY,{'type':dbH[_0xc8e0('0x12')]['QueryTypes']['SELECT']}));}var _0x25d091=path['dirname'](PATH);var _0x52d37f=path[_0xc8e0('0x1c')](PATH,_0xc8e0('0x1d'));var _0x4e7751=_0x51e36c['split']&&_0x1939d0[_0xc8e0('0x18')]>0x1;var _0x4f9406=[];if(!fs[_0xc8e0('0x1e')](path[_0xc8e0('0x1f')](_0x25d091,_0x52d37f))&&_0x4e7751){fs[_0xc8e0('0x20')](path['join'](_0x25d091,_0x52d37f));}return BPromise[_0xc8e0('0x21')](_0x1939d0,function(_0x3ec7a5){_0x4f9406[_0xc8e0('0x19')](_0x3ec7a5);})['then'](function(){for(var _0x4dbadc=0x0;_0x4dbadc<_0x4f9406[_0xc8e0('0x18')];_0x4dbadc+=0x1){var _0x41d58d;var _0x281fc0=_0x4f9406[_0x4dbadc];if(_0x4e7751){_0x41d58d=path[_0xc8e0('0x1f')](_0x25d091,_0x52d37f,util[_0xc8e0('0xb')](_0xc8e0('0x22'),_0x52d37f,_0x4dbadc,_0xc8e0('0x23')));}else{_0x41d58d=path[_0xc8e0('0x1f')](_0x25d091,util[_0xc8e0('0xb')]('%s.%s',_0x52d37f,_0xc8e0('0x23')));}fs[_0xc8e0('0x24')](_0x41d58d,csv(_0x281fc0));}})[_0xc8e0('0x11')](function(){if(_0x4e7751){return new Promise(function(_0x39fe4c){zipdir(path[_0xc8e0('0x1f')](_0x25d091,_0x52d37f),{'saveTo':path[_0xc8e0('0x1f')](_0x25d091,util[_0xc8e0('0xb')](_0xc8e0('0x25'),_0x52d37f,_0xc8e0('0x26')))},function(_0x41adbc,_0x4d549a){rimraf(path[_0xc8e0('0x1f')](_0x25d091,_0x52d37f),function(){});_0x39fe4c('zip\x20finished');});});}})[_0xc8e0('0x11')](function(){logger[_0xc8e0('0xa')](util[_0xc8e0('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xc8e0('0xc')));return analyticExtractedReport(_0xc8e0('0x27'),_0x4e7751?util[_0xc8e0('0xb')](_0xc8e0('0x25'),_0x52d37f,_0x4e7751?'zip':_0xc8e0('0x23')):null);});})[_0xc8e0('0x28')](function(_0x5414b3){logger['info'](util[_0xc8e0('0xb')](_0xc8e0('0x29'),EXTRACTED_REPORT_ID,_0xc8e0('0xc')),util['inspect'](_0x5414b3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xc8e0('0x2a'));})[_0xc8e0('0x2b')](function(){process[_0xc8e0('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index d6deb02..c518bc7 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 _0x2945=['zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','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-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','pdfmake/src/printer','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','length','auto','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','push','landscape','\x20/\x20','footer','Arial','black','right','num','Setting','split','splitSizePdf','then','range','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','each','flatten','%s%d.%s','pdf','%s.%s'];(function(_0x293646,_0x8c515b){var _0x3418db=function(_0x5b195d){while(--_0x5b195d){_0x293646['push'](_0x293646['shift']());}};_0x3418db(++_0x8c515b);}(_0x2945,0x130));var _0x5294=function(_0x215363,_0x5bf4ca){_0x215363=_0x215363-0x0;var _0x51b396=_0x2945[_0x215363];return _0x51b396;};'use strict';var _=require(_0x5294('0x0'));var fs=require('fs');var util=require(_0x5294('0x1'));var path=require('path');var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x5294('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x5294('0x3'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x5294('0x4'));var db=require(_0x5294('0x5'))['db'];var dbH=require(_0x5294('0x5'))[_0x5294('0x6')];var logger=require(_0x5294('0x7'))(_0x5294('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x5294('0x9')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x5294('0x9')][0x4];var NAME=process[_0x5294('0x9')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x303f93,_0x5c2040){var _0x215931={'status':_0x303f93};var _0x5533fb={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c2040){_0x215931[_0x5294('0xa')]=_0x5c2040;}return db[_0x5294('0xb')][_0x5294('0xc')](_0x215931,_0x5533fb);}function getHeaders(_0x26222c){return _[_0x5294('0xd')](_0x26222c,function(_0x4c8692){return{'text':_0x4c8692,'style':_0x5294('0xe')};});}function getRows(_0x54932a,_0x13adf9){return _[_0x5294('0xd')](_0x13adf9,function(_0x5eae26){return _(_0x5eae26)[_0x5294('0xf')](_0x54932a)['map'](function(_0x52a714){return _0x52a714?_['toString'](_0x52a714):'';})[_0x5294('0x10')]();});}function createTable(_0x5298d0,_0x1c5305){var _0x30451a={'widths':_['fill'](Array(_0x5298d0[_0x5294('0x11')]),0x91),'heights':function(_0x19076f){return _0x19076f===0x0?_0x5294('0x12'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5976eb=getHeaders(_0x5298d0);_0x30451a[_0x5294('0x13')]['push'](_0x5976eb);var _0x51c589=getRows(_0x5298d0,_0x1c5305);_0x30451a[_0x5294('0x13')]=_0x30451a[_0x5294('0x13')][_0x5294('0x14')](_0x51c589);return _0x30451a;}function createTables(_0x5dc5f7){var _0x28e4e7=[];var _0x57ad1f=_[_0x5294('0x15')](Object['keys'](_0x5dc5f7[0x0]),0x5);_0x57ad1f[_0x5294('0x16')](function(_0x359e3a){_0x28e4e7['push'](createTable(_0x359e3a,_0x5dc5f7));});return _0x28e4e7;}function getPDFDocDefinition(_0x341fd9){var _0x2aaba0=util[_0x5294('0x17')](_0x5294('0x18'),NAME,EXTRACTED_REPORT[_0x5294('0x19')],moment(EXTRACTED_REPORT[_0x5294('0x1a')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x5294('0x1b')])[_0x5294('0x17')](FORMAT));var _0x472bf3=[];for(var _0x4544ce=0x0;_0x4544ce<_0x341fd9[_0x5294('0x11')];_0x4544ce++){var _0x5a0893=[];if(_0x4544ce===0x0){_0x5a0893['push']({'text':_0x2aaba0,'style':_0x5294('0x1c')});}var _0x488ac4={'table':_0x341fd9[_0x4544ce]};if(_0x4544ce>0x0){_0x488ac4[_0x5294('0x1d')]=_0x5294('0x1e');_0x488ac4['margin']=[0x0,0x46,0x0,0x0];}_0x5a0893[_0x5294('0x1f')](_0x488ac4);_0x472bf3['push'](_0x5a0893);}return{'pageSize':'A4','pageOrientation':_0x5294('0x20'),'content':_0x472bf3,'footer':function(_0x2c812c,_0x4e97b1){return{'text':_0x2c812c['toString']()+_0x5294('0x21')+_0x4e97b1,'style':_0x5294('0x22')};},'defaultStyle':{'font':_0x5294('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5294('0x24')},'footer':{'alignment':_0x5294('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3e6f87){var _0x1c2044=0x1388;var _0x5585dd;if(!_0x3e6f87[0x0][_0x5294('0x26')]){return analyticExtractedReport('Empty');}return db[_0x5294('0x27')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5294('0x28'),_0x5294('0x29')]})[_0x5294('0x2a')](function(_0x237e5f){if(_0x237e5f){_0x5585dd=_0x237e5f;_0x1c2044=_0x5585dd[_0x5294('0x29')]||0x3e8;}})['then'](function(){var _0x300fb8=[];var _0x1ce61b=0x0;if(_0x5585dd[_0x5294('0x28')]){if(_0x3e6f87&&_0x3e6f87[_0x5294('0x11')]){var _0x189336=_[_0x5294('0x2b')](_0x3e6f87[0x0]['num']/_0x1c2044);var _0x38fe1a=Number[_0x5294('0x2c')](_0x3e6f87[0x0][_0x5294('0x26')]/_0x1c2044)?_0x3e6f87[0x0]['num']%_0x1c2044:0x0;_0x189336[_0x5294('0x16')](function(_0x4b452e){if(_0x4b452e>0x0){_0x1ce61b+=_0x1c2044;}_0x300fb8['push'](dbH['sequelize']['query'](util[_0x5294('0x17')](_0x5294('0x2d'),QUERY,_0x1c2044,_0x1ce61b),{'type':dbH[_0x5294('0x2e')][_0x5294('0x2f')][_0x5294('0x30')]}));});if(_0x38fe1a>0x0){_0x1ce61b+=_0x1c2044;_0x300fb8[_0x5294('0x1f')](dbH[_0x5294('0x2e')]['query'](util[_0x5294('0x17')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x38fe1a,_0x1ce61b),{'type':dbH[_0x5294('0x2e')][_0x5294('0x2f')][_0x5294('0x30')]}));}}}else{_0x300fb8[_0x5294('0x1f')](dbH[_0x5294('0x2e')][_0x5294('0x31')](QUERY,{'type':dbH[_0x5294('0x2e')]['QueryTypes'][_0x5294('0x30')]}));}var _0x2d5cf6=path[_0x5294('0x32')](PATH);var _0x565b2b=path[_0x5294('0x33')](PATH,_0x5294('0x34'));var _0x86a340=_0x5585dd['split']&&_0x300fb8[_0x5294('0x11')]>0x1;var _0x4e9dca=[];if(!fs[_0x5294('0x35')](path[_0x5294('0x36')](_0x2d5cf6,_0x565b2b))&&_0x86a340){fs['mkdirSync'](path[_0x5294('0x36')](_0x2d5cf6,_0x565b2b));}return BPromise[_0x5294('0x37')](_0x300fb8,function(_0xe27cfc){_0x4e9dca[_0x5294('0x1f')](_0xe27cfc);})[_0x5294('0x2a')](function(){var _0x5cbe3c=[];for(var _0x552d29=0x0;_0x552d29<_0x4e9dca[_0x5294('0x11')];_0x552d29+=0x1){var _0x4f6b53=_0x4e9dca[_0x552d29];var _0x5e0130=createTables(_[_0x5294('0x38')](_0x4f6b53));var _0x2cc9f7;var _0x505131=getPDFDocDefinition(_0x5e0130);var _0x1aa925=getPDFPrinter();var _0x336bfe=_0x1aa925['createPdfKitDocument'](_0x505131);if(_0x86a340){_0x2cc9f7=path['join'](_0x2d5cf6,_0x565b2b,util[_0x5294('0x17')](_0x5294('0x39'),_0x565b2b,_0x552d29,_0x5294('0x3a')));}else{_0x2cc9f7=path[_0x5294('0x36')](_0x2d5cf6,util[_0x5294('0x17')](_0x5294('0x3b'),_0x565b2b,_0x5294('0x3a')));}_0x5cbe3c[_0x5294('0x1f')](writePDFDocument(_0x336bfe,_0x2cc9f7));}return Promise['all'](_0x5cbe3c);})['then'](function(){if(_0x86a340){return new Promise(function(_0x50ffac){zipdir(path[_0x5294('0x36')](_0x2d5cf6,_0x565b2b),{'saveTo':path[_0x5294('0x36')](_0x2d5cf6,util['format'](_0x5294('0x3b'),_0x565b2b,_0x5294('0x3c')))},function(){rimraf(path[_0x5294('0x36')](_0x2d5cf6,_0x565b2b),function(){});_0x50ffac(_0x5294('0x3d'));});});}})[_0x5294('0x2a')](function(){if(!_0x86a340)return;rimraf(path[_0x5294('0x36')](_0x2d5cf6,_0x565b2b),function(){});})[_0x5294('0x2a')](function(){logger['info'](util[_0x5294('0x17')](_0x5294('0x3e'),EXTRACTED_REPORT_ID,_0x5294('0x3f')));return analyticExtractedReport(_0x5294('0x40'),_0x86a340?util['format']('%s.%s',_0x565b2b,_0x86a340?'zip':'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5294('0x41')](util['format'](_0x5294('0x42'),EXTRACTED_REPORT_ID,_0x5294('0x3f')));return db[_0x5294('0xb')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5294('0x2a')](function(_0x47a01e){EXTRACTED_REPORT=_0x47a01e;return dbH['sequelize'][_0x5294('0x31')](util[_0x5294('0x17')](_0x5294('0x43'),QUERY),{'type':dbH[_0x5294('0x2e')][_0x5294('0x2f')]['SELECT']});})['then'](extractReport)[_0x5294('0x44')](function(_0x2ccbb4){logger[_0x5294('0x41')](util[_0x5294('0x17')](_0x5294('0x45'),EXTRACTED_REPORT_ID,_0x5294('0x3f')),util[_0x5294('0x46')](_0x2ccbb4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5294('0x47'));})[_0x5294('0x48')](function(){process[_0x5294('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2e1a67=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x5294('0x4a'),'italics':__dirname+_0x5294('0x4b'),'bolditalics':__dirname+_0x5294('0x4c')}});return _0x2e1a67;}function getPDFDocDefinitionFromHTML(_0x5982ac,_0x375aac){var _0x5d413f=util[_0x5294('0x17')](_0x5294('0x4d'),_0x375aac[_0x5294('0x4e')],_0x375aac[_0x5294('0x4f')]);var _0x211619=moment()[_0x5294('0x17')](_0x5294('0x50'))[_0x5294('0x51')]();var _0x4f9fc1=htmlToPdfmake(_0x5982ac,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4f9fc1],'defaultStyle':{'font':_0x5294('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5294('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x5294('0x53'),'style':'header'}];},'footer':function(_0x39207c,_0x2c9270){return[{'text':util[_0x5294('0x17')](_0x5294('0x54'),_0x5d413f,_0x39207c,_0x2c9270,_0x211619),'style':'footer'}];}};}function writePDFDocument(_0x4bbb20,_0x45fc4b){return new Promise(function(_0x2fc3c2,_0x2b8971){var _0x287c56=_0x4bbb20[_0x5294('0x55')](fs['createWriteStream'](_0x45fc4b));_0x287c56['on'](_0x5294('0x56'),function(){_0x2fc3c2(_0x5294('0x56'));});_0x287c56['on'](_0x5294('0x57'),function(_0x315caf){_0x2b8971(_0x315caf);});_0x4bbb20[_0x5294('0x58')]();});}exports[_0x5294('0x59')]=function(_0x1d1952,_0x1c63ad){var _0x1e8ad7=getPDFPrinter();var _0x23a128=getPDFDocDefinitionFromHTML(_0x1d1952,_0x1c63ad);var _0x47db91=_0x1e8ad7[_0x5294('0x5a')](_0x23a128);return writePDFDocument(_0x47db91,_0x1c63ad['path'])[_0x5294('0x44')](function(_0x49b947){throw _0x49b947;});}; \ No newline at end of file +var _0xe6a5=['splitSizePdf','then','split','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','flatten','createPdfKitDocument','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','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','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','keys','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','landscape','\x20/\x20','Arial','black','Empty','find'];(function(_0x16b69f,_0x21c840){var _0x5d0735=function(_0x3237b8){while(--_0x3237b8){_0x16b69f['push'](_0x16b69f['shift']());}};_0x5d0735(++_0x21c840);}(_0xe6a5,0x1f2));var _0x5e6a=function(_0x431d83,_0x19941f){_0x431d83=_0x431d83-0x0;var _0x1835e7=_0xe6a5[_0x431d83];return _0x1835e7;};'use strict';var _=require(_0x5e6a('0x0'));var fs=require('fs');var util=require(_0x5e6a('0x1'));var path=require('path');var moment=require(_0x5e6a('0x2'));var htmlToPdfmake=require(_0x5e6a('0x3'));var PdfPrinter=require(_0x5e6a('0x4'));var zipdir=require(_0x5e6a('0x5'));var rimraf=require(_0x5e6a('0x6'));var JSDOM=require(_0x5e6a('0x7'))['JSDOM'];var window=new JSDOM('')[_0x5e6a('0x8')];var BPromise=require(_0x5e6a('0x9'));var db=require(_0x5e6a('0xa'))['db'];var dbH=require(_0x5e6a('0xa'))[_0x5e6a('0xb')];var logger=require(_0x5e6a('0xc'))(_0x5e6a('0xd'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x5e6a('0xe')][0x3];var PATH=process['argv'][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x5e6a('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x221f3c,_0x2fb2b1){var _0x13ef23={'status':_0x221f3c};var _0x58a5ae={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2fb2b1){_0x13ef23[_0x5e6a('0x10')]=_0x2fb2b1;}return db[_0x5e6a('0x11')]['update'](_0x13ef23,_0x58a5ae);}function getHeaders(_0x183fe9){return _[_0x5e6a('0x12')](_0x183fe9,function(_0x40a154){return{'text':_0x40a154,'style':_0x5e6a('0x13')};});}function getRows(_0x57c39c,_0x28910e){return _['map'](_0x28910e,function(_0x484757){return _(_0x484757)[_0x5e6a('0x14')](_0x57c39c)['map'](function(_0x2b6775){return _0x2b6775?_[_0x5e6a('0x15')](_0x2b6775):'';})[_0x5e6a('0x16')]();});}function createTable(_0x4e96fa,_0x536689){var _0x536650={'widths':_[_0x5e6a('0x17')](Array(_0x4e96fa[_0x5e6a('0x18')]),0x91),'heights':function(_0xbed678){return _0xbed678===0x0?_0x5e6a('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x43a5f2=getHeaders(_0x4e96fa);_0x536650[_0x5e6a('0x1a')][_0x5e6a('0x1b')](_0x43a5f2);var _0xccb3ba=getRows(_0x4e96fa,_0x536689);_0x536650[_0x5e6a('0x1a')]=_0x536650[_0x5e6a('0x1a')][_0x5e6a('0x1c')](_0xccb3ba);return _0x536650;}function createTables(_0x3db085){var _0x240116=[];var _0x176730=_['chunk'](Object[_0x5e6a('0x1d')](_0x3db085[0x0]),0x5);_0x176730['forEach'](function(_0x2b6fd5){_0x240116[_0x5e6a('0x1b')](createTable(_0x2b6fd5,_0x3db085));});return _0x240116;}function getPDFDocDefinition(_0x94cbf5){var _0x3ce08b=util[_0x5e6a('0x1e')](_0x5e6a('0x1f'),NAME,EXTRACTED_REPORT[_0x5e6a('0x20')],moment(EXTRACTED_REPORT[_0x5e6a('0x21')])[_0x5e6a('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0x5e6a('0x22')])['format'](FORMAT));var _0x4551e1=[];for(var _0x14edfb=0x0;_0x14edfb<_0x94cbf5[_0x5e6a('0x18')];_0x14edfb++){var _0x352378=[];if(_0x14edfb===0x0){_0x352378[_0x5e6a('0x1b')]({'text':_0x3ce08b,'style':_0x5e6a('0x23')});}var _0x3668ad={'table':_0x94cbf5[_0x14edfb]};if(_0x14edfb>0x0){_0x3668ad['pageBreak']='before';_0x3668ad['margin']=[0x0,0x46,0x0,0x0];}_0x352378[_0x5e6a('0x1b')](_0x3668ad);_0x4551e1[_0x5e6a('0x1b')](_0x352378);}return{'pageSize':'A4','pageOrientation':_0x5e6a('0x24'),'content':_0x4551e1,'footer':function(_0x595ee9,_0x1c81e0){return{'text':_0x595ee9[_0x5e6a('0x15')]()+_0x5e6a('0x25')+_0x1c81e0,'style':'footer'};},'defaultStyle':{'font':_0x5e6a('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5e6a('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3594ed){var _0x4f54be=0x1388;var _0x272e03;if(!_0x3594ed[0x0]['num']){return analyticExtractedReport(_0x5e6a('0x28'));}return db['Setting'][_0x5e6a('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5e6a('0x2a')]})[_0x5e6a('0x2b')](function(_0x5cf63a){if(_0x5cf63a){_0x272e03=_0x5cf63a;_0x4f54be=_0x272e03[_0x5e6a('0x2a')]||0x3e8;}})['then'](function(){var _0x333244=[];var _0x4c5cf4=0x0;if(_0x272e03[_0x5e6a('0x2c')]){if(_0x3594ed&&_0x3594ed[_0x5e6a('0x18')]){var _0x235807=_['range'](_0x3594ed[0x0][_0x5e6a('0x2d')]/_0x4f54be);var _0x1071f7=Number[_0x5e6a('0x2e')](_0x3594ed[0x0]['num']/_0x4f54be)?_0x3594ed[0x0][_0x5e6a('0x2d')]%_0x4f54be:0x0;_0x235807[_0x5e6a('0x2f')](function(_0x1468a1){if(_0x1468a1>0x0){_0x4c5cf4+=_0x4f54be;}_0x333244[_0x5e6a('0x1b')](dbH['sequelize'][_0x5e6a('0x30')](util[_0x5e6a('0x1e')](_0x5e6a('0x31'),QUERY,_0x4f54be,_0x4c5cf4),{'type':dbH[_0x5e6a('0x32')][_0x5e6a('0x33')][_0x5e6a('0x34')]}));});if(_0x1071f7>0x0){_0x4c5cf4+=_0x4f54be;_0x333244['push'](dbH[_0x5e6a('0x32')][_0x5e6a('0x30')](util[_0x5e6a('0x1e')](_0x5e6a('0x31'),QUERY,_0x1071f7,_0x4c5cf4),{'type':dbH[_0x5e6a('0x32')][_0x5e6a('0x33')][_0x5e6a('0x34')]}));}}}else{_0x333244['push'](dbH[_0x5e6a('0x32')][_0x5e6a('0x30')](QUERY,{'type':dbH[_0x5e6a('0x32')][_0x5e6a('0x33')][_0x5e6a('0x34')]}));}var _0x5df013=path[_0x5e6a('0x35')](PATH);var _0x42a7e1=path[_0x5e6a('0x36')](PATH,'.pdf');var _0x50d601=_0x272e03[_0x5e6a('0x2c')]&&_0x333244[_0x5e6a('0x18')]>0x1;var _0x47d677=[];if(!fs[_0x5e6a('0x37')](path[_0x5e6a('0x38')](_0x5df013,_0x42a7e1))&&_0x50d601){fs[_0x5e6a('0x39')](path['join'](_0x5df013,_0x42a7e1));}return BPromise['each'](_0x333244,function(_0xbfce40){_0x47d677['push'](_0xbfce40);})[_0x5e6a('0x2b')](function(){var _0x2048a9=[];for(var _0x45467c=0x0;_0x45467c<_0x47d677[_0x5e6a('0x18')];_0x45467c+=0x1){var _0x59de8b=_0x47d677[_0x45467c];var _0x359f97=createTables(_[_0x5e6a('0x3a')](_0x59de8b));var _0x29393d;var _0x53fbd4=getPDFDocDefinition(_0x359f97);var _0x3aa538=getPDFPrinter();var _0x5e938d=_0x3aa538[_0x5e6a('0x3b')](_0x53fbd4);if(_0x50d601){_0x29393d=path[_0x5e6a('0x38')](_0x5df013,_0x42a7e1,util[_0x5e6a('0x1e')]('%s%d.%s',_0x42a7e1,_0x45467c,_0x5e6a('0x3c')));}else{_0x29393d=path[_0x5e6a('0x38')](_0x5df013,util[_0x5e6a('0x1e')](_0x5e6a('0x3d'),_0x42a7e1,_0x5e6a('0x3c')));}_0x2048a9[_0x5e6a('0x1b')](writePDFDocument(_0x5e938d,_0x29393d));}return Promise['all'](_0x2048a9);})[_0x5e6a('0x2b')](function(){if(_0x50d601){return new Promise(function(_0x5bdf92){zipdir(path[_0x5e6a('0x38')](_0x5df013,_0x42a7e1),{'saveTo':path[_0x5e6a('0x38')](_0x5df013,util[_0x5e6a('0x1e')](_0x5e6a('0x3d'),_0x42a7e1,_0x5e6a('0x3e')))},function(){rimraf(path[_0x5e6a('0x38')](_0x5df013,_0x42a7e1),function(){});_0x5bdf92(_0x5e6a('0x3f'));});});}})[_0x5e6a('0x2b')](function(){if(!_0x50d601)return;rimraf(path[_0x5e6a('0x38')](_0x5df013,_0x42a7e1),function(){});})[_0x5e6a('0x2b')](function(){logger[_0x5e6a('0x40')](util[_0x5e6a('0x1e')](_0x5e6a('0x41'),EXTRACTED_REPORT_ID,_0x5e6a('0x42')));return analyticExtractedReport('Completed',_0x50d601?util[_0x5e6a('0x1e')](_0x5e6a('0x3d'),_0x42a7e1,_0x50d601?'zip':_0x5e6a('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x5e6a('0x1e')](_0x5e6a('0x43'),EXTRACTED_REPORT_ID,_0x5e6a('0x42')));return db[_0x5e6a('0x11')][_0x5e6a('0x44')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x11e438){EXTRACTED_REPORT=_0x11e438;return dbH['sequelize']['query'](util[_0x5e6a('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x5e6a('0x32')][_0x5e6a('0x33')][_0x5e6a('0x34')]});})[_0x5e6a('0x2b')](extractReport)[_0x5e6a('0x45')](function(_0x1f267e){logger['info'](util['format'](_0x5e6a('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x5e6a('0x47')](_0x1f267e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5e6a('0x48'));})[_0x5e6a('0x49')](function(){process[_0x5e6a('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x370ba1=new PdfPrinter({'Arial':{'normal':__dirname+_0x5e6a('0x4b'),'bold':__dirname+_0x5e6a('0x4c'),'italics':__dirname+_0x5e6a('0x4d'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x370ba1;}function getPDFDocDefinitionFromHTML(_0x1f5186,_0x57b8f2){var _0x50dccc=util[_0x5e6a('0x1e')](_0x5e6a('0x4e'),_0x57b8f2[_0x5e6a('0x4f')],_0x57b8f2[_0x5e6a('0x50')]);var _0x380105=moment()[_0x5e6a('0x1e')](_0x5e6a('0x51'))[_0x5e6a('0x15')]();var _0x31b6dc=htmlToPdfmake(_0x1f5186,{'window':window,'tableAutoSize':!![]});return{'content':[_0x31b6dc],'defaultStyle':{'font':_0x5e6a('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x5e6a('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x5e6a('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5e6a('0x52')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x46337e,_0x5e8c49){return[{'text':util[_0x5e6a('0x1e')](_0x5e6a('0x53'),_0x50dccc,_0x46337e,_0x5e8c49,_0x380105),'style':_0x5e6a('0x54')}];}};}function writePDFDocument(_0x572fab,_0x4fb0ba){return new Promise(function(_0x2af002,_0x6d3168){var _0x15a0e7=_0x572fab['pipe'](fs[_0x5e6a('0x55')](_0x4fb0ba));_0x15a0e7['on'](_0x5e6a('0x56'),function(){_0x2af002(_0x5e6a('0x56'));});_0x15a0e7['on'](_0x5e6a('0x57'),function(_0x3e3ce0){_0x6d3168(_0x3e3ce0);});_0x572fab[_0x5e6a('0x58')]();});}exports[_0x5e6a('0x59')]=function(_0x2d1476,_0x2794a4){var _0x585734=getPDFPrinter();var _0x2dab80=getPDFDocDefinitionFromHTML(_0x2d1476,_0x2794a4);var _0x579bd4=_0x585734[_0x5e6a('0x3b')](_0x2dab80);return writePDFDocument(_0x579bd4,_0x2794a4['path'])[_0x5e6a('0x45')](function(_0x334027){throw _0x334027;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ee582d1..5e38daf 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 _0x8f6f=['split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','mkdirSync','join','xlsx','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','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','XLSX','Setting'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x8f6f,0x1a9));var _0xf8f6=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x8f6f[_0x29b609];return _0x54c952;};'use strict';var util=require(_0xf8f6('0x0'));var path=require(_0xf8f6('0x1'));var _=require(_0xf8f6('0x2'));var fs=require('fs');var json2xls=require(_0xf8f6('0x3'));var BPromise=require(_0xf8f6('0x4'));var zipdir=require(_0xf8f6('0x5'));var rimraf=require(_0xf8f6('0x6'));var db=require(_0xf8f6('0x7'))['db'];var dbH=require(_0xf8f6('0x7'))[_0xf8f6('0x8')];var logger=require('../../config/logger')(_0xf8f6('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf8f6('0xa')][0x2]);var QUERY=process[_0xf8f6('0xa')][0x3];var PATH=process[_0xf8f6('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fced4,_0x27966d){var _0x37bb73={'status':_0x2fced4};var _0x4dfd98={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x27966d){_0x37bb73[_0xf8f6('0xb')]=_0x27966d;}return db[_0xf8f6('0xc')][_0xf8f6('0xd')](_0x37bb73,_0x4dfd98);}function main(){var _0x2c6dfc=0x1388;var _0x17d8c9;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf8f6('0xe')));return db[_0xf8f6('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf8f6('0x10'),_0xf8f6('0x11')]})['then'](function(_0x3555bd){if(_0x3555bd){_0x17d8c9=_0x3555bd;_0x2c6dfc=_0x17d8c9['splitSizeXlsx']||0x1388;}})[_0xf8f6('0x12')](function(){return dbH[_0xf8f6('0x13')][_0xf8f6('0x14')](util[_0xf8f6('0x15')](_0xf8f6('0x16'),QUERY),{'type':dbH[_0xf8f6('0x13')]['QueryTypes'][_0xf8f6('0x17')]});})['then'](function(_0x4a692f){if(!_0x4a692f[0x0]['num']){return analyticExtractedReport(_0xf8f6('0x18'));}var _0xc95d59=[];var _0x1b6ac6=0x0;if(_0x17d8c9[_0xf8f6('0x10')]){if(_0x4a692f&&_0x4a692f[_0xf8f6('0x19')]){var _0x5d1058=_['range'](_0x4a692f[0x0][_0xf8f6('0x1a')]/_0x2c6dfc);var _0x53884e=Number[_0xf8f6('0x1b')](_0x4a692f[0x0][_0xf8f6('0x1a')]/_0x2c6dfc)?_0x4a692f[0x0][_0xf8f6('0x1a')]%_0x2c6dfc:0x0;_0x5d1058[_0xf8f6('0x1c')](function(_0x3a1518){if(_0x3a1518>0x0){_0x1b6ac6+=_0x2c6dfc;}_0xc95d59[_0xf8f6('0x1d')](dbH['sequelize'][_0xf8f6('0x14')](util[_0xf8f6('0x15')](_0xf8f6('0x1e'),QUERY,_0x2c6dfc,_0x1b6ac6),{'type':dbH[_0xf8f6('0x13')][_0xf8f6('0x1f')][_0xf8f6('0x17')]}));});if(_0x53884e>0x0){_0x1b6ac6+=_0x2c6dfc;_0xc95d59[_0xf8f6('0x1d')](dbH['sequelize'][_0xf8f6('0x14')](util[_0xf8f6('0x15')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x53884e,_0x1b6ac6),{'type':dbH['sequelize'][_0xf8f6('0x1f')][_0xf8f6('0x17')]}));}}}else{_0xc95d59[_0xf8f6('0x1d')](dbH[_0xf8f6('0x13')][_0xf8f6('0x14')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xf8f6('0x17')]}));}var _0x4e7a7e=path[_0xf8f6('0x20')](PATH);var _0x1d2384=path[_0xf8f6('0x21')](PATH,_0xf8f6('0x22'));var _0x2c9c98=_0x17d8c9[_0xf8f6('0x10')]&&_0xc95d59['length']>0x1;var _0x137c57=[];if(!fs[_0xf8f6('0x23')](path['join'](_0x4e7a7e,_0x1d2384))&&_0x2c9c98){fs[_0xf8f6('0x24')](path[_0xf8f6('0x25')](_0x4e7a7e,_0x1d2384));}return BPromise['each'](_0xc95d59,function(_0x91fb8a){_0x137c57[_0xf8f6('0x1d')](_0x91fb8a);})[_0xf8f6('0x12')](function(){for(var _0x4120bf=0x0;_0x4120bf<_0x137c57[_0xf8f6('0x19')];_0x4120bf+=0x1){var _0x720a73;var _0x590080=_0x137c57[_0x4120bf];if(_0x2c9c98){_0x720a73=path[_0xf8f6('0x25')](_0x4e7a7e,_0x1d2384,util[_0xf8f6('0x15')]('%s%d.%s',_0x1d2384,_0x4120bf,_0xf8f6('0x26')));}else{_0x720a73=path[_0xf8f6('0x25')](_0x4e7a7e,util[_0xf8f6('0x15')]('%s.%s',_0x1d2384,'xlsx'));}fs['writeFileSync'](_0x720a73,json2xls(_0x590080),_0xf8f6('0x27'));}})[_0xf8f6('0x12')](function(){if(_0x2c9c98){return new Promise(function(_0x404be3){zipdir(path[_0xf8f6('0x25')](_0x4e7a7e,_0x1d2384),{'saveTo':path[_0xf8f6('0x25')](_0x4e7a7e,util['format'](_0xf8f6('0x28'),_0x1d2384,_0xf8f6('0x29')))},function(_0x42d6c1,_0x103cdf){rimraf(path[_0xf8f6('0x25')](_0x4e7a7e,_0x1d2384),function(){});_0x404be3(_0xf8f6('0x2a'));});});}})[_0xf8f6('0x12')](function(){logger[_0xf8f6('0x2b')](util[_0xf8f6('0x15')](_0xf8f6('0x2c'),EXTRACTED_REPORT_ID,_0xf8f6('0xe')));return analyticExtractedReport(_0xf8f6('0x2d'),_0x2c9c98?util[_0xf8f6('0x15')](_0xf8f6('0x28'),_0x1d2384,_0x2c9c98?'zip':_0xf8f6('0x26')):null);});})[_0xf8f6('0x2e')](function(_0x11b30f){logger[_0xf8f6('0x2b')](util[_0xf8f6('0x15')](_0xf8f6('0x2f'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xf8f6('0x30')](_0x11b30f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7268=['existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','.xlsx'];(function(_0x48d447,_0x412703){var _0x5abf48=function(_0x3874f8){while(--_0x3874f8){_0x48d447['push'](_0x48d447['shift']());}};_0x5abf48(++_0x412703);}(_0x7268,0x146));var _0x8726=function(_0x7535d0,_0x553017){_0x7535d0=_0x7535d0-0x0;var _0x23eb65=_0x7268[_0x7535d0];return _0x23eb65;};'use strict';var util=require(_0x8726('0x0'));var path=require('path');var _=require(_0x8726('0x1'));var fs=require('fs');var json2xls=require(_0x8726('0x2'));var BPromise=require(_0x8726('0x3'));var zipdir=require(_0x8726('0x4'));var rimraf=require('rimraf');var db=require(_0x8726('0x5'))['db'];var dbH=require(_0x8726('0x5'))[_0x8726('0x6')];var logger=require('../../config/logger')(_0x8726('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8726('0x8')][0x3];var PATH=process[_0x8726('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x25a729,_0x38fff8){var _0xb8db77={'status':_0x25a729};var _0x364cf5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x38fff8){_0xb8db77[_0x8726('0x9')]=_0x38fff8;}return db['AnalyticExtractedReport']['update'](_0xb8db77,_0x364cf5);}function main(){var _0x208825=0x1388;var _0x2e2c8f;logger['info'](util[_0x8726('0xa')](_0x8726('0xb'),EXTRACTED_REPORT_ID,_0x8726('0xc')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8726('0xd')]})[_0x8726('0xe')](function(_0x5f397d){if(_0x5f397d){_0x2e2c8f=_0x5f397d;_0x208825=_0x2e2c8f[_0x8726('0xd')]||0x1388;}})[_0x8726('0xe')](function(){return dbH[_0x8726('0xf')][_0x8726('0x10')](util[_0x8726('0xa')](_0x8726('0x11'),QUERY),{'type':dbH['sequelize'][_0x8726('0x12')][_0x8726('0x13')]});})[_0x8726('0xe')](function(_0x14bff1){if(!_0x14bff1[0x0][_0x8726('0x14')]){return analyticExtractedReport(_0x8726('0x15'));}var _0x2a4472=[];var _0x1b248d=0x0;if(_0x2e2c8f[_0x8726('0x16')]){if(_0x14bff1&&_0x14bff1[_0x8726('0x17')]){var _0x56071d=_[_0x8726('0x18')](_0x14bff1[0x0][_0x8726('0x14')]/_0x208825);var _0x28492a=Number[_0x8726('0x19')](_0x14bff1[0x0]['num']/_0x208825)?_0x14bff1[0x0][_0x8726('0x14')]%_0x208825:0x0;_0x56071d[_0x8726('0x1a')](function(_0x24bf04){if(_0x24bf04>0x0){_0x1b248d+=_0x208825;}_0x2a4472['push'](dbH[_0x8726('0xf')][_0x8726('0x10')](util[_0x8726('0xa')](_0x8726('0x1b'),QUERY,_0x208825,_0x1b248d),{'type':dbH[_0x8726('0xf')]['QueryTypes'][_0x8726('0x13')]}));});if(_0x28492a>0x0){_0x1b248d+=_0x208825;_0x2a4472['push'](dbH['sequelize'][_0x8726('0x10')](util['format'](_0x8726('0x1b'),QUERY,_0x28492a,_0x1b248d),{'type':dbH[_0x8726('0xf')][_0x8726('0x12')][_0x8726('0x13')]}));}}}else{_0x2a4472[_0x8726('0x1c')](dbH[_0x8726('0xf')][_0x8726('0x10')](QUERY,{'type':dbH['sequelize'][_0x8726('0x12')][_0x8726('0x13')]}));}var _0x4254c8=path['dirname'](PATH);var _0x2382ac=path[_0x8726('0x1d')](PATH,_0x8726('0x1e'));var _0xb28940=_0x2e2c8f[_0x8726('0x16')]&&_0x2a4472[_0x8726('0x17')]>0x1;var _0x35ddd1=[];if(!fs[_0x8726('0x1f')](path['join'](_0x4254c8,_0x2382ac))&&_0xb28940){fs[_0x8726('0x20')](path[_0x8726('0x21')](_0x4254c8,_0x2382ac));}return BPromise[_0x8726('0x22')](_0x2a4472,function(_0x3033fd){_0x35ddd1[_0x8726('0x1c')](_0x3033fd);})[_0x8726('0xe')](function(){for(var _0x247e09=0x0;_0x247e09<_0x35ddd1[_0x8726('0x17')];_0x247e09+=0x1){var _0x56af1e;var _0x3d2b86=_0x35ddd1[_0x247e09];if(_0xb28940){_0x56af1e=path[_0x8726('0x21')](_0x4254c8,_0x2382ac,util[_0x8726('0xa')](_0x8726('0x23'),_0x2382ac,_0x247e09,'xlsx'));}else{_0x56af1e=path[_0x8726('0x21')](_0x4254c8,util[_0x8726('0xa')](_0x8726('0x24'),_0x2382ac,_0x8726('0x25')));}fs[_0x8726('0x26')](_0x56af1e,json2xls(_0x3d2b86),_0x8726('0x27'));}})[_0x8726('0xe')](function(){if(_0xb28940){return new Promise(function(_0x1a33cd){zipdir(path[_0x8726('0x21')](_0x4254c8,_0x2382ac),{'saveTo':path[_0x8726('0x21')](_0x4254c8,util[_0x8726('0xa')](_0x8726('0x24'),_0x2382ac,'zip'))},function(_0x42a0dc,_0x1b9d8e){rimraf(path['join'](_0x4254c8,_0x2382ac),function(){});_0x1a33cd(_0x8726('0x28'));});});}})[_0x8726('0xe')](function(){logger['info'](util[_0x8726('0xa')](_0x8726('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x8726('0x2a'),_0xb28940?util[_0x8726('0xa')]('%s.%s',_0x2382ac,_0xb28940?_0x8726('0x2b'):'xlsx'):null);});})[_0x8726('0x2c')](function(_0x5192b9){logger[_0x8726('0x2d')](util['format'](_0x8726('0x2e'),EXTRACTED_REPORT_ID,_0x8726('0xc')),util[_0x8726('0x2f')](_0x5192b9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8726('0x30'));})[_0x8726('0x31')](function(){process[_0x8726('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d3b3926..7082420 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 _0xd56b=['VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','push','CDR(routeid)=','context','outbound','extensions','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','answer','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','util','models','findAll','then','intervals'];(function(_0x3fffdb,_0x18964c){var _0x5a9235=function(_0x303b08){while(--_0x303b08){_0x3fffdb['push'](_0x3fffdb['shift']());}};_0x5a9235(++_0x18964c);}(_0xd56b,0x11b));var _0xbd56=function(_0x31ea8c,_0x4a7422){_0x31ea8c=_0x31ea8c-0x0;var _0x589151=_0xd56b[_0x31ea8c];return _0x589151;};'use strict';var _=require('lodash');var util=require(_0xbd56('0x0'));function rewrite(_0x46b433,_0x14df29){var _0x311247=this;return _0x46b433[_0xbd56('0x1')]['Interval'][_0xbd56('0x2')]({'raw':!![]})[_0xbd56('0x3')](function(_0x3f5338){_0x311247[_0xbd56('0x4')]=_0x3f5338;return _0x46b433[_0xbd56('0x1')][_0xbd56('0x5')][_0xbd56('0x2')]({'where':{'IntervalId':_0x14df29[_0xbd56('0x6')]},'raw':!![]});})['then'](function(_0x4b8915){return _0x46b433[_0xbd56('0x1')][_0xbd56('0x5')][_0xbd56('0x2')]({'where':{'exten':{'$in':_[_0xbd56('0x7')](_[_0xbd56('0x8')](_0x4b8915,_0xbd56('0x9')))}},'order':[{'raw':_0xbd56('0xa')}],'raw':!![]});})[_0xbd56('0x3')](function(_0x1fdb03){var _0x5d6679=_['filter'](_0x1fdb03,{'priority':'1'});var _0x2d3f5b=_[_0xbd56('0xb')](_0x1fdb03,{'isApp':0x1});var _0x160913=_[_0xbd56('0xc')](_0x2d3f5b,_0xbd56('0x9'));var _0x14595b=[_0xbd56('0xd'),_0xbd56('0xe')];var _0x19fa6e=[];var _0x4dead1=[];for(var _0x4febde in _0x160913){if(_0x160913[_0xbd56('0xf')](_0x4febde)){_0x311247[_0xbd56('0x10')]=0x2;_0x311247['extensions']=[];_0x311247[_0xbd56('0x11')]=_['find'](_0x5d6679,{'exten':_0x160913[_0x4febde][0x0]['exten']});_0x311247['extensions']['push']({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':util[_0xbd56('0x14')](_0xbd56('0x15'),_0x160913[_0x4febde][0x0][_0xbd56('0x12')]),'context':_0x160913[_0x4febde][0x0]['context'],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});if(_0x160913[_0x4febde][0x0][_0xbd56('0x12')]===_0xbd56('0x17')){_0x311247['extensions'][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0]['type'],'app':'Set','appdata':_0xbd56('0x19')+_0x160913[_0x4febde][0x0][_0xbd56('0x16')],'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});}else if(_0x160913[_0x4febde][0x0][_0xbd56('0x12')]===_0xbd56('0x1b')){if(_0x311247[_0xbd56('0x11')]){_0x311247[_0xbd56('0x1c')][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x1d')+(_0x311247[_0xbd56('0x11')][_0xbd56('0x1e')]?_0xbd56('0x1f')+_0x311247[_0xbd56('0x11')]['cutdigits']+'}':_0xbd56('0x20')),'context':_0x160913[_0x4febde][0x0]['context'],'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});}_0x311247[_0xbd56('0x1c')]['push']({'type':_0x160913[_0x4febde][0x0]['type'],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x19')+_0x160913[_0x4febde][0x0][_0xbd56('0x16')],'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});var _0xeffdf=_0x311247[_0xbd56('0x10')]++;_0x311247['extensions']['push']({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0xeffdf+0x2)+_0xbd56('0x22')+(_0xeffdf+0x1)+')','context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'priority':_0xeffdf,'VoiceExtensionId':_0x160913[_0x4febde][0x0]['VoiceExtensionId']});if(_0x311247['extension']){_0x311247[_0xbd56('0x1c')][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0]['type'],'app':_0xbd56('0x13'),'appdata':_0x311247[_0xbd56('0x11')][_0xbd56('0x1e')]?'CDR(prefix)=${EXTEN:0:'+_0x311247['extension'][_0xbd56('0x1e')]+'}':_0xbd56('0x23'),'context':_0x160913[_0x4febde][0x0]['context'],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0]['VoiceExtensionId']});}_0x311247['extensions'][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x24')+_0x160913[_0x4febde][0x0][_0xbd56('0x16')],'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});if(_0x311247[_0xbd56('0x11')]&&_0x311247['extension'][_0xbd56('0xf')](_0xbd56('0x25'))&&_0x311247[_0xbd56('0x11')][_0xbd56('0x25')]!==_0xbd56('0x26')){_0x311247[_0xbd56('0x1c')]['push']({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x27'),'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0]['VoiceExtensionId']});_0x311247[_0xbd56('0x1c')][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x28')+_0x311247['extension'][_0xbd56('0x25')]||'wav','context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247['priority']++,'VoiceExtensionId':_0x160913[_0x4febde][0x0]['VoiceExtensionId']});}}_0x311247['extensions']['push']({'type':_0x160913[_0x4febde][0x0]['type'],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x29'),'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0]['VoiceExtensionId']});_0x311247[_0xbd56('0x1c')][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x160913[_0x4febde][0x0]['context'],'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});_0x311247[_0xbd56('0x1c')]['push']({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':'Set','appdata':_0xbd56('0x2a'),'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'exten':_0x160913[_0x4febde][0x0]['exten'],'priority':_0x311247[_0xbd56('0x10')]++,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});for(var _0x47d23f=0x0,_0x4b8773=0x0;_0x47d23f<_0x160913[_0x4febde][_0xbd56('0x2b')];_0x47d23f+=0x1,_0x4b8773=0x0){var _0x211cf1=_0x160913[_0x4febde][_0x47d23f];if(_0x211cf1[_0xbd56('0x12')]){_0x211cf1[_0xbd56('0x12')]=_0x211cf1[_0xbd56('0x12')]['toLowerCase']();}var _0x3b40e9=[];var _0x524c9d=[];delete _0x211cf1['id'];delete _0x211cf1[_0xbd56('0x2c')];delete _0x211cf1[_0xbd56('0x2d')];var _0x46d03b=_0x211cf1[_0xbd56('0x2e')]!==_0xbd56('0x2f')?[_0x211cf1[_0xbd56('0x2e')]]:_0x211cf1['IntervalId']?_['map'](_[_0xbd56('0xb')](_0x311247[_0xbd56('0x4')],{'IntervalId':_0x211cf1[_0xbd56('0x6')]}),_0xbd56('0x2e')):[];if(_0x211cf1[_0xbd56('0xf')](_0xbd56('0x30'))){if(_0x211cf1[_0xbd56('0x30')]&&_0x211cf1['tag']!=='--'){_0x3b40e9[_0xbd56('0x18')]({'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':'CDR(tag)='+_0x211cf1[_0xbd56('0x30')],'context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1['exten'],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247[_0xbd56('0x10')]+_0x4b8773++,'VoiceExtensionId':_0x211cf1[_0xbd56('0x16')]});}}if(_0x211cf1[_0xbd56('0x12')]===_0xbd56('0x1b')&&_0x211cf1[_0xbd56('0xf')]('callerID')){if(_0x211cf1['callerID']){_0x3b40e9['push']({'type':_0x211cf1[_0xbd56('0x12')],'app':'ExecIf','appdata':_0xbd56('0x31')+_0x211cf1[_0xbd56('0x32')]+')','context':_0x211cf1['context'],'exten':_0x211cf1[_0xbd56('0x9')],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247[_0xbd56('0x10')]+_0x4b8773++,'VoiceExtensionId':_0x211cf1['VoiceExtensionId']});}else{_0x3b40e9[_0xbd56('0x18')]({'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x21'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1['exten'],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247[_0xbd56('0x10')]+_0x4b8773++,'VoiceExtensionId':_0x211cf1['VoiceExtensionId']});}}if(_0x211cf1[_0xbd56('0xf')](_0xbd56('0x33'))){if(_0x14595b[_0xbd56('0x34')](_0x211cf1[_0xbd56('0x35')][_0xbd56('0x36')]())>=0x0&&_0x211cf1['appType']!==_0xbd56('0x37')){if(_0x211cf1[_0xbd56('0x33')]){_0x3b40e9[_0xbd56('0x18')]({'type':_0x211cf1[_0xbd56('0x12')],'app':'ExecIf','appdata':_0xbd56('0x38'),'context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1[_0xbd56('0x9')],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247[_0xbd56('0x10')]+_0x4b8773++,'VoiceExtensionId':_0x211cf1[_0xbd56('0x16')]});_0x3b40e9['push']({'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x39'),'context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1[_0xbd56('0x9')],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247[_0xbd56('0x10')]+_0x4b8773++,'VoiceExtensionId':_0x211cf1['VoiceExtensionId']});}else{_0x3b40e9[_0xbd56('0x18')]({'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x21'),'appdata':_0xbd56('0x3a'),'context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1[_0xbd56('0x9')],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247['priority']+_0x4b8773++,'VoiceExtensionId':_0x211cf1[_0xbd56('0x16')]});_0x3b40e9[_0xbd56('0x18')]({'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x13'),'appdata':_0xbd56('0x3b'),'context':_0x211cf1[_0xbd56('0x1a')],'exten':_0x211cf1[_0xbd56('0x9')],'priority':_0x46d03b[_0xbd56('0x2b')]+_0x311247['priority']+_0x4b8773++,'VoiceExtensionId':_0x211cf1[_0xbd56('0x16')]});}}}for(var _0x5649f7=0x0;_0x5649f7<_0x46d03b[_0xbd56('0x2b')];_0x5649f7+=0x1){var _0x5c0564=_0x311247[_0xbd56('0x10')]+_0x46d03b['length'];var _0x4bd954=_0x5649f7===_0x46d03b['length']-0x1?_0x311247[_0xbd56('0x10')]+_0x3b40e9['length']+_0x524c9d[_0xbd56('0x2b')]+0x2:_0x311247[_0xbd56('0x10')]+_0x5649f7+0x1;_0x3b40e9[_0xbd56('0x3c')](_0x5649f7,0x0,{'type':_0x211cf1[_0xbd56('0x12')],'app':_0xbd56('0x3d'),'appdata':_0x46d03b[_0x5649f7]+'?'+_0x211cf1[_0xbd56('0x1a')]+_0xbd56('0x3e')+_0x5c0564+':'+_0x211cf1[_0xbd56('0x1a')]+_0xbd56('0x3e')+_0x4bd954,'exten':_0x211cf1['exten'],'context':_0x211cf1[_0xbd56('0x1a')],'priority':_0x311247[_0xbd56('0x10')]+_0x5649f7,'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});}_0x211cf1['priority']=_0x3b40e9[_0xbd56('0x2b')]?_[_0xbd56('0x3f')](_0x3b40e9)[_0xbd56('0x10')]+0x1:_0x311247[_0xbd56('0x10')];_0x311247[_0xbd56('0x10')]=(_0x524c9d['length']?_[_0xbd56('0x3f')](_0x524c9d)[_0xbd56('0x10')]:_0x211cf1[_0xbd56('0x10')])+0x1;_0x311247[_0xbd56('0x1c')]=_[_0xbd56('0x40')](_0x311247[_0xbd56('0x1c')],_0x3b40e9,[_0x211cf1],_0x524c9d);}_0x311247[_0xbd56('0x1c')][_0xbd56('0x18')]({'type':_0x160913[_0x4febde][0x0][_0xbd56('0x12')],'app':_0xbd56('0x41'),'exten':_0x160913[_0x4febde][0x0][_0xbd56('0x9')],'context':_0x160913[_0x4febde][0x0][_0xbd56('0x1a')],'priority':_0x311247['priority'],'VoiceExtensionId':_0x160913[_0x4febde][0x0][_0xbd56('0x16')]});_0x19fa6e[_0xbd56('0x18')](_0x160913[_0x4febde][0x0][_0xbd56('0x16')]);_0x4dead1=_['concat'](_0x4dead1,_0x311247[_0xbd56('0x1c')]);}}return _0x46b433[_0xbd56('0x42')](function(_0x3f6a8f){return _0x46b433[_0xbd56('0x1')][_0xbd56('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x19fa6e}},'transaction':_0x3f6a8f})['then'](function(_0x57330a){return _0x46b433[_0xbd56('0x1')][_0xbd56('0x5')][_0xbd56('0x43')](_[_0xbd56('0x44')](_0x4dead1,_0xbd56('0x10')),{'transaction':_0x3f6a8f});});});})[_0xbd56('0x45')](function(_0x177222){console[_0xbd56('0x46')](_0x177222);});}exports[_0xbd56('0x47')]=rewrite; \ No newline at end of file +var _0x0124=['groupBy','queue','playback','extensions','push','type','Set','format','context','priority','inbound','CDR(routeid)=','VoiceExtensionId','outbound','extension','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','catch','error','rewrite','lodash','util','models','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0124,0x83));var _0x4012=function(_0x4cc45f,_0xc7c4d7){_0x4cc45f=_0x4cc45f-0x0;var _0x5dea8a=_0x0124[_0x4cc45f];return _0x5dea8a;};'use strict';var _=require(_0x4012('0x0'));var util=require(_0x4012('0x1'));function rewrite(_0x2c1830,_0xd1455b){var _0x339616=this;return _0x2c1830[_0x4012('0x2')]['Interval'][_0x4012('0x3')]({'raw':!![]})[_0x4012('0x4')](function(_0x3d165a){_0x339616[_0x4012('0x5')]=_0x3d165a;return _0x2c1830[_0x4012('0x2')]['VoiceExtension'][_0x4012('0x3')]({'where':{'IntervalId':_0xd1455b[_0x4012('0x6')]},'raw':!![]});})[_0x4012('0x4')](function(_0x14b046){return _0x2c1830[_0x4012('0x2')][_0x4012('0x7')][_0x4012('0x3')]({'where':{'exten':{'$in':_[_0x4012('0x8')](_[_0x4012('0x9')](_0x14b046,_0x4012('0xa')))}},'order':[{'raw':_0x4012('0xb')}],'raw':!![]});})['then'](function(_0x14e964){var _0x2d7495=_[_0x4012('0xc')](_0x14e964,{'priority':'1'});var _0x42f8ac=_[_0x4012('0xc')](_0x14e964,{'isApp':0x1});var _0x166107=_[_0x4012('0xd')](_0x42f8ac,_0x4012('0xa'));var _0x4cff83=[_0x4012('0xe'),_0x4012('0xf')];var _0x20a0fa=[];var _0x117cfe=[];for(var _0x1baeba in _0x166107){if(_0x166107['hasOwnProperty'](_0x1baeba)){_0x339616['priority']=0x2;_0x339616[_0x4012('0x10')]=[];_0x339616['extension']=_['find'](_0x2d7495,{'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')]});_0x339616['extensions'][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':util[_0x4012('0x14')]('CDR(type)=%s',_0x166107[_0x1baeba][0x0]['type']),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0]['exten'],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0]['VoiceExtensionId']});if(_0x166107[_0x1baeba][0x0][_0x4012('0x12')]===_0x4012('0x17')){_0x339616[_0x4012('0x10')]['push']({'type':_0x166107[_0x1baeba][0x0]['type'],'app':_0x4012('0x13'),'appdata':_0x4012('0x18')+_0x166107[_0x1baeba][0x0][_0x4012('0x19')],'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0]['exten'],'priority':_0x339616['priority']++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});}else if(_0x166107[_0x1baeba][0x0][_0x4012('0x12')]===_0x4012('0x1a')){if(_0x339616[_0x4012('0x1b')]){_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':'CDR(destination)='+(_0x339616[_0x4012('0x1b')]['cutdigits']?'${EXTEN:'+_0x339616['extension'][_0x4012('0x1c')]+'}':_0x4012('0x1d')),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});}_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x18')+_0x166107[_0x1baeba][0x0][_0x4012('0x19')],'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616['priority']++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});var _0x3703e3=_0x339616[_0x4012('0x16')]++;_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0]['type'],'app':_0x4012('0x1e'),'appdata':_0x4012('0x1f')+(_0x3703e3+0x2)+_0x4012('0x20')+(_0x3703e3+0x1)+')','context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x3703e3,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});if(_0x339616[_0x4012('0x1b')]){_0x339616[_0x4012('0x10')]['push']({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':'Set','appdata':_0x339616['extension'][_0x4012('0x1c')]?_0x4012('0x21')+_0x339616[_0x4012('0x1b')][_0x4012('0x1c')]+'}':_0x4012('0x22'),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616['priority']++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});}_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x23')+_0x166107[_0x1baeba][0x0][_0x4012('0x19')],'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});if(_0x339616['extension']&&_0x339616[_0x4012('0x1b')][_0x4012('0x24')]('recordingFormat')&&_0x339616['extension'][_0x4012('0x25')]!==_0x4012('0x26')){_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x27')+_0x339616['extension'][_0x4012('0x25')]||_0x4012('0x28'),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});}}_0x339616[_0x4012('0x10')]['push']({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});_0x339616[_0x4012('0x10')]['push']({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x29'),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});_0x339616[_0x4012('0x10')]['push']({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x2a'),'context':_0x166107[_0x1baeba][0x0][_0x4012('0x15')],'exten':_0x166107[_0x1baeba][0x0]['exten'],'priority':_0x339616[_0x4012('0x16')]++,'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});for(var _0x538f85=0x0,_0x221def=0x0;_0x538f85<_0x166107[_0x1baeba]['length'];_0x538f85+=0x1,_0x221def=0x0){var _0x34257d=_0x166107[_0x1baeba][_0x538f85];if(_0x34257d[_0x4012('0x12')]){_0x34257d[_0x4012('0x12')]=_0x34257d[_0x4012('0x12')][_0x4012('0x2b')]();}var _0x2dc4d5=[];var _0x2aaf15=[];delete _0x34257d['id'];delete _0x34257d[_0x4012('0x2c')];delete _0x34257d[_0x4012('0x2d')];var _0x22624e=_0x34257d[_0x4012('0x2e')]!==_0x4012('0x2f')?[_0x34257d[_0x4012('0x2e')]]:_0x34257d[_0x4012('0x6')]?_[_0x4012('0x9')](_['filter'](_0x339616[_0x4012('0x5')],{'IntervalId':_0x34257d[_0x4012('0x6')]}),'interval'):[];if(_0x34257d[_0x4012('0x24')](_0x4012('0x30'))){if(_0x34257d[_0x4012('0x30')]&&_0x34257d[_0x4012('0x30')]!=='--'){_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d[_0x4012('0x12')],'app':'Set','appdata':'CDR(tag)='+_0x34257d[_0x4012('0x30')],'context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d['exten'],'priority':_0x22624e[_0x4012('0x31')]+_0x339616[_0x4012('0x16')]+_0x221def++,'VoiceExtensionId':_0x34257d['VoiceExtensionId']});}}if(_0x34257d[_0x4012('0x12')]===_0x4012('0x1a')&&_0x34257d[_0x4012('0x24')](_0x4012('0x32'))){if(_0x34257d[_0x4012('0x32')]){_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d[_0x4012('0x12')],'app':'ExecIf','appdata':_0x4012('0x33')+_0x34257d[_0x4012('0x32')]+')','context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616['priority']+_0x221def++,'VoiceExtensionId':_0x34257d[_0x4012('0x19')]});}else{_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d['type'],'app':'ExecIf','appdata':_0x4012('0x34'),'context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616[_0x4012('0x16')]+_0x221def++,'VoiceExtensionId':_0x34257d[_0x4012('0x19')]});}}if(_0x34257d[_0x4012('0x24')](_0x4012('0x35'))){if(_0x4cff83[_0x4012('0x36')](_0x34257d['app'][_0x4012('0x2b')]())>=0x0&&_0x34257d[_0x4012('0x37')]!==_0x4012('0x38')){if(_0x34257d[_0x4012('0x35')]){_0x2dc4d5['push']({'type':_0x34257d[_0x4012('0x12')],'app':_0x4012('0x1e'),'appdata':_0x4012('0x39'),'context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616[_0x4012('0x16')]+_0x221def++,'VoiceExtensionId':_0x34257d['VoiceExtensionId']});_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d[_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616['priority']+_0x221def++,'VoiceExtensionId':_0x34257d[_0x4012('0x19')]});}else{_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d[_0x4012('0x12')],'app':'ExecIf','appdata':_0x4012('0x3a'),'context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616[_0x4012('0x16')]+_0x221def++,'VoiceExtensionId':_0x34257d['VoiceExtensionId']});_0x2dc4d5[_0x4012('0x11')]({'type':_0x34257d[_0x4012('0x12')],'app':_0x4012('0x13'),'appdata':_0x4012('0x3b'),'context':_0x34257d[_0x4012('0x15')],'exten':_0x34257d[_0x4012('0xa')],'priority':_0x22624e[_0x4012('0x31')]+_0x339616['priority']+_0x221def++,'VoiceExtensionId':_0x34257d[_0x4012('0x19')]});}}}for(var _0x33ddea=0x0;_0x33ddea<_0x22624e[_0x4012('0x31')];_0x33ddea+=0x1){var _0x275fb6=_0x339616[_0x4012('0x16')]+_0x22624e[_0x4012('0x31')];var _0xa68bc=_0x33ddea===_0x22624e[_0x4012('0x31')]-0x1?_0x339616[_0x4012('0x16')]+_0x2dc4d5['length']+_0x2aaf15[_0x4012('0x31')]+0x2:_0x339616['priority']+_0x33ddea+0x1;_0x2dc4d5[_0x4012('0x3c')](_0x33ddea,0x0,{'type':_0x34257d[_0x4012('0x12')],'app':_0x4012('0x3d'),'appdata':_0x22624e[_0x33ddea]+'?'+_0x34257d[_0x4012('0x15')]+',${EXTEN},'+_0x275fb6+':'+_0x34257d[_0x4012('0x15')]+_0x4012('0x3e')+_0xa68bc,'exten':_0x34257d[_0x4012('0xa')],'context':_0x34257d[_0x4012('0x15')],'priority':_0x339616[_0x4012('0x16')]+_0x33ddea,'VoiceExtensionId':_0x166107[_0x1baeba][0x0]['VoiceExtensionId']});}_0x34257d['priority']=_0x2dc4d5[_0x4012('0x31')]?_[_0x4012('0x3f')](_0x2dc4d5)[_0x4012('0x16')]+0x1:_0x339616[_0x4012('0x16')];_0x339616['priority']=(_0x2aaf15['length']?_[_0x4012('0x3f')](_0x2aaf15)[_0x4012('0x16')]:_0x34257d[_0x4012('0x16')])+0x1;_0x339616['extensions']=_[_0x4012('0x40')](_0x339616[_0x4012('0x10')],_0x2dc4d5,[_0x34257d],_0x2aaf15);}_0x339616[_0x4012('0x10')][_0x4012('0x11')]({'type':_0x166107[_0x1baeba][0x0][_0x4012('0x12')],'app':_0x4012('0x41'),'exten':_0x166107[_0x1baeba][0x0][_0x4012('0xa')],'context':_0x166107[_0x1baeba][0x0]['context'],'priority':_0x339616[_0x4012('0x16')],'VoiceExtensionId':_0x166107[_0x1baeba][0x0][_0x4012('0x19')]});_0x20a0fa['push'](_0x166107[_0x1baeba][0x0][_0x4012('0x19')]);_0x117cfe=_[_0x4012('0x40')](_0x117cfe,_0x339616[_0x4012('0x10')]);}}return _0x2c1830[_0x4012('0x42')](function(_0xdbe0dd){return _0x2c1830[_0x4012('0x2')][_0x4012('0x7')][_0x4012('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x20a0fa}},'transaction':_0xdbe0dd})[_0x4012('0x4')](function(_0x4129dc){return _0x2c1830[_0x4012('0x2')][_0x4012('0x7')][_0x4012('0x44')](_['sortBy'](_0x117cfe,_0x4012('0x16')),{'transaction':_0xdbe0dd});});});})[_0x4012('0x45')](function(_0x3d5786){console[_0x4012('0x46')](_0x3d5786);});}exports[_0x4012('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 548f5d3..7a8cfbc 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 _0x8a5c=['calleridnum','cm_hopper_final','str','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','then','get','push','query','VoiceQueueId','onlyIfOpen','sequelize','outbound','BlackLists','all','always','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','find','duplicate','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','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','\x20=\x20?','id\x20IN\x20?'];(function(_0x28b7ab,_0x16a764){var _0x56791b=function(_0x25d20d){while(--_0x25d20d){_0x28b7ab['push'](_0x28b7ab['shift']());}};_0x56791b(++_0x16a764);}(_0x8a5c,0x97));var _0xc8a5=function(_0x5f64ee,_0x159579){_0x5f64ee=_0x5f64ee-0x0;var _0x44c7a6=_0x8a5c[_0x5f64ee];return _0x44c7a6;};'use strict';var BPromise=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xc8a5('0x2'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xc8a5('0x3'))['db'];var config=require(_0xc8a5('0x4'));var logger=require(_0xc8a5('0x5'))(_0xc8a5('0x6'));config['redis']=_[_0xc8a5('0x7')](config[_0xc8a5('0x8')],{'host':_0xc8a5('0x9'),'port':0x18eb});var socket=require(_0xc8a5('0xa'))(new Redis(config[_0xc8a5('0x8')]));require(_0xc8a5('0xb'))[_0xc8a5('0xc')](socket);try{if(!process[_0xc8a5('0xd')][0x2]||process[_0xc8a5('0xd')][0x2]===_0xc8a5('0xe')||process[_0xc8a5('0xd')][0x2]===_0xc8a5('0xf')){throw new Error(_0xc8a5('0x10'));}var FILEPATH=process[_0xc8a5('0xd')][0x2];if(!process['argv'][0x3]||process[_0xc8a5('0xd')][0x3]==='undefined'||process[_0xc8a5('0xd')][0x3]===_0xc8a5('0xf')||!process[_0xc8a5('0xd')][0x4]||process[_0xc8a5('0xd')][0x4]===_0xc8a5('0xe')||process['argv'][0x4]==='null'){throw new Error(_0xc8a5('0x11'));}var FIELDS=_['zipObject'](process[_0xc8a5('0xd')][0x3]['split'](','),process[_0xc8a5('0xd')][0x4][_0xc8a5('0x12')](','));if(!process[_0xc8a5('0xd')][0x5]||process['argv'][0x5]===_0xc8a5('0xe')||process['argv'][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xc8a5('0xd')][0x5];var COMPANYID=process[_0xc8a5('0xd')][0x6]&&process[_0xc8a5('0xd')][0x6]!==_0xc8a5('0xe')&&process[_0xc8a5('0xd')][0x6]!==_0xc8a5('0xf')?process[_0xc8a5('0xd')][0x6]:null;var DUPLICATES=process[_0xc8a5('0xd')][0x7]&&process[_0xc8a5('0xd')][0x7]!==_0xc8a5('0xe')&&process[_0xc8a5('0xd')][0x7]!==_0xc8a5('0xf')?process[_0xc8a5('0xd')][0x7]:null;if(!process[_0xc8a5('0xd')][0x8]||process[_0xc8a5('0xd')][0x8]===_0xc8a5('0xe')||process['argv'][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0xc8a5('0xd')][0x8];}catch(_0x186086){logger['error'](_0x186086);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(_0x15b20d,_0x343f1f,_0x34f4fc,_0x1d3766){var _0x5d45e1={'message':_0x343f1f};_0x5d45e1[_0x15b20d]=!![];if(_0x34f4fc){_0x5d45e1[_0xc8a5('0x13')]=_0x34f4fc;}if(_0x1d3766){_0x5d45e1[_0xc8a5('0x14')]=_0x1d3766;}return _0x5d45e1;}function isEmail(_0x81fa7e){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))*$/[_0xc8a5('0x15')](_0x81fa7e);}function checkRow(_0x26f27e,_0x2802de,_0x3693ea){return new BPromise(function(_0x1ad4d5,_0x2c756e){if(_[_0xc8a5('0x16')](_0x26f27e)){return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),_0xc8a5('0x18'),null,_0x3693ea));}if(_0x26f27e['errors']&&_0x26f27e[_0xc8a5('0x19')][_0xc8a5('0x1a')]){var _0x4c53a3=_[_0xc8a5('0x1b')](_0x26f27e[_0xc8a5('0x19')],_0xc8a5('0x1c'))[_0xc8a5('0x1d')](';');return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),_0x4c53a3,null,_0x3693ea));}var _0x15ffe7={};for(var _0x127500 in FIELDS){if(FIELDS[_0xc8a5('0x1e')](_0x127500)&&FIELDS[_0x127500]){_0x15ffe7[_0x127500]=_0x26f27e[_0xc8a5('0x1f')][0x0][FIELDS[_0x127500]]||_0x26f27e[_0xc8a5('0x1f')][0x0]['\ufeff'+FIELDS[_0x127500]];}}if(!_0x15ffe7[_0xc8a5('0x20')]){return _0x2c756e(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x3693ea));}if(!_0x15ffe7[_0xc8a5('0x21')]){return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),_0xc8a5('0x22'),null,_0x3693ea));}if(_0x15ffe7[_0xc8a5('0x23')]){var _0x4ddefe=moment(_0x15ffe7['birthDate'],_0xc8a5('0x24'));if(!_0x4ddefe[_0xc8a5('0x25')]()){return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),_0xc8a5('0x26'),null,_0x3693ea));}}if(_0x15ffe7['email']){if(!isEmail(_0x15ffe7[_0xc8a5('0x27')])){return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),'email\x20format\x20is\x20not\x20valid!',null,_0x3693ea));}}_0x15ffe7[_0xc8a5('0x28')]=LISTID;_0x15ffe7['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2802de){var _0x201985={};for(var _0x1a2db5=0x0,_0x2b2e78=DUPLICATES[_0xc8a5('0x1a')];_0x1a2db5<_0x2b2e78;_0x1a2db5+=0x1){_0x201985[DUPLICATES[_0x1a2db5]]=_0x15ffe7[DUPLICATES[_0x1a2db5]];}var _0x4e2970=_[_0xc8a5('0x29')](_0x2802de,_0x201985);if(_0x4e2970){return _0x2c756e(handleCheckRowError(_0xc8a5('0x2a'),'Duplicate\x20Contact',_0x4e2970,_0x3693ea));}}return db['CmContact'][_0xc8a5('0x2b')](_0x15ffe7,{'raw':!![],'hooks':![],'fields':_[_0xc8a5('0x2c')](_0x15ffe7)})['then'](function(_0x319b7f){if(DUPLICATES&&DUPLICATES[_0xc8a5('0x1a')]&&_0x2802de){_0x2802de['push'](_[_0xc8a5('0x2d')](_0x15ffe7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x319b7f['id'];return _0x1ad4d5();})[_0xc8a5('0x2e')](function(_0x54b3de){return _0x2c756e(handleCheckRowError(_0xc8a5('0x17'),_0xc8a5('0x2f')+(_0x54b3de[_0xc8a5('0x1c')]||JSON[_0xc8a5('0x30')](_0x54b3de)),null,_0x3693ea));});});}function checkHopper(){function _0x2dfdc1(){return function(_0x7d3b0b){logger[_0xc8a5('0x17')](_0xc8a5('0x31'),_0xc8a5('0x32'),util[_0xc8a5('0x33')](_0x7d3b0b,{'showHidden':![],'depth':null}));};}var _0x37c3fe=function(_0x6e429a,_0x40c34a){var _0x26277=squel[_0xc8a5('0x34')]()[_0xc8a5('0x35')](_0xc8a5('0x36'))[_0xc8a5('0x37')]([_0xc8a5('0x21'),_0xc8a5('0x38'),_0xc8a5('0x39'),'ListId',_0x40c34a,_0xc8a5('0x3a'),_0xc8a5('0x3b')],squel[_0xc8a5('0x3c')]()[_0xc8a5('0x3d')]('phone','phone')[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x38'))[_0xc8a5('0x3d')]('id',_0xc8a5('0x39'))[_0xc8a5('0x3d')](LISTID[_0xc8a5('0x3f')](),_0xc8a5('0x28'))[_0xc8a5('0x3d')](_0x6e429a['id'][_0xc8a5('0x3f')](),_0x40c34a)['field'](_0xc8a5('0x3e'),'createdAt')[_0xc8a5('0x3d')]('NOW()',_0xc8a5('0x3b'))['from'](_0xc8a5('0x40'))[_0xc8a5('0x41')](_0xc8a5('0x42'))[_0xc8a5('0x41')](_0xc8a5('0x43'),LISTID[_0xc8a5('0x3f')]())[_0xc8a5('0x41')](_0xc8a5('0x44'))[_0xc8a5('0x41')](_0xc8a5('0x45'),squel[_0xc8a5('0x3c')]()['field'](_0xc8a5('0x21'))[_0xc8a5('0x46')](_0xc8a5('0x36'))[_0xc8a5('0x41')](_0x40c34a+_0xc8a5('0x47'),_0x6e429a['id'][_0xc8a5('0x3f')]())))[_0xc8a5('0x3f')]();return _0x26277;};var _0x5f3897=function(_0x3a17db,_0x563d6d){var _0x1ef2f4=squel['insert']()[_0xc8a5('0x35')](_0xc8a5('0x36'))['fromQuery'](['phone','scheduledAt',_0xc8a5('0x39'),_0xc8a5('0x28'),_0x563d6d,_0xc8a5('0x3a'),'updatedAt'],squel[_0xc8a5('0x3c')]()[_0xc8a5('0x3d')]('phone',_0xc8a5('0x21'))['field'](_0xc8a5('0x3e'),_0xc8a5('0x38'))[_0xc8a5('0x3d')]('id','ContactId')[_0xc8a5('0x3d')](LISTID[_0xc8a5('0x3f')](),'ListId')['field'](_0x3a17db['id'][_0xc8a5('0x3f')](),_0x563d6d)[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x3a'))[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x3b'))['from'](_0xc8a5('0x40'))[_0xc8a5('0x41')](_0xc8a5('0x42'))[_0xc8a5('0x41')]('ListId\x20=\x20?',LISTID[_0xc8a5('0x3f')]())[_0xc8a5('0x41')](_0xc8a5('0x48'),squel['str'](hopperContacts))[_0xc8a5('0x41')](_0xc8a5('0x44'))[_0xc8a5('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc8a5('0x3c')]()[_0xc8a5('0x3d')](_0xc8a5('0x49'))['from'](_0xc8a5('0x4a'))[_0xc8a5('0x41')](_0x563d6d+_0xc8a5('0x47'),_0x3a17db['id'][_0xc8a5('0x3f')]()))[_0xc8a5('0x41')](_0xc8a5('0x45'),squel[_0xc8a5('0x3c')]()['field'](_0xc8a5('0x21'))[_0xc8a5('0x46')](_0xc8a5('0x36'))[_0xc8a5('0x41')](_0x563d6d+_0xc8a5('0x47'),_0x3a17db['id']['toString']())))[_0xc8a5('0x3f')]();return _0x1ef2f4;};function _0x1c5dae(_0x39e6f7,_0x7577b8){var _0x38dec9=squel[_0xc8a5('0x34')]()[_0xc8a5('0x35')](_0xc8a5('0x36'))[_0xc8a5('0x37')]([_0xc8a5('0x21'),'scheduledAt',_0xc8a5('0x39'),'ListId',_0x7577b8,_0xc8a5('0x3a'),'updatedAt'],squel[_0xc8a5('0x3c')]()[_0xc8a5('0x3d')](_0xc8a5('0x21'),'phone')[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x38'))[_0xc8a5('0x3d')]('id',_0xc8a5('0x39'))['field'](LISTID[_0xc8a5('0x3f')](),'ListId')[_0xc8a5('0x3d')](_0x39e6f7['id']['toString'](),_0x7577b8)[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x3a'))[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x3b'))[_0xc8a5('0x46')](_0xc8a5('0x40'))['where']('deletedAt\x20IS\x20NULL')[_0xc8a5('0x41')](_0xc8a5('0x43'),LISTID['toString']())[_0xc8a5('0x41')]('id\x20IN\x20?',squel[_0xc8a5('0x4b')](hopperContacts))['where'](_0xc8a5('0x44')))[_0xc8a5('0x3f')]();return _0x38dec9;}function _0x525bad(_0x2ca225,_0x23e4fe){var _0x23bddf=squel[_0xc8a5('0x34')]()[_0xc8a5('0x35')]('cm_hopper_black')[_0xc8a5('0x37')]([_0xc8a5('0x21'),_0xc8a5('0x39'),_0xc8a5('0x28'),_0x23e4fe,'createdAt',_0xc8a5('0x3b')],squel['select']()[_0xc8a5('0x3d')]('phone',_0xc8a5('0x21'))['field']('id','ContactId')[_0xc8a5('0x3d')](LISTID[_0xc8a5('0x3f')](),_0xc8a5('0x28'))[_0xc8a5('0x3d')](_0x2ca225['id'][_0xc8a5('0x3f')](),_0x23e4fe)[_0xc8a5('0x3d')](_0xc8a5('0x3e'),_0xc8a5('0x3a'))['field'](_0xc8a5('0x3e'),_0xc8a5('0x3b'))[_0xc8a5('0x46')](_0xc8a5('0x40'))['where'](_0xc8a5('0x42'))['where']('ListId\x20=\x20?',LISTID[_0xc8a5('0x3f')]())[_0xc8a5('0x41')](_0xc8a5('0x48'),squel[_0xc8a5('0x4b')](hopperContacts))[_0xc8a5('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0xc8a5('0x3f')]();return _0x23bddf;}return db[_0xc8a5('0x4c')][_0xc8a5('0x4d')]({'where':{'type':'outbound'},'attributes':['id',_0xc8a5('0x4e')],'include':[{'model':db[_0xc8a5('0x4f')],'as':_0xc8a5('0x50'),'where':{'id':LISTID}}]})[_0xc8a5('0x51')](function(_0x5e74cb){var _0x27f2a9=[];if(_0x5e74cb){var _0x5e3a86;for(var _0x37f8cb=0x0,_0x38e1f0;_0x37f8cb<_0x5e74cb['length'];_0x37f8cb+=0x1){_0x38e1f0=_0x5e74cb[_0x37f8cb][_0xc8a5('0x52')]({'plain':!![]});switch(_0x38e1f0[_0xc8a5('0x4e')]){case'always':_0x27f2a9[_0xc8a5('0x53')](db['sequelize'][_0xc8a5('0x54')](_0x5f3897(_0x38e1f0,_0xc8a5('0x55')))[_0xc8a5('0x51')](function(){})['catch'](_0x2dfdc1()));break;case _0xc8a5('0x56'):_0x27f2a9['push'](db[_0xc8a5('0x57')]['query'](_0x37c3fe(_0x38e1f0,_0xc8a5('0x55')))[_0xc8a5('0x51')](function(){})['catch'](_0x2dfdc1()));break;default:_0x27f2a9[_0xc8a5('0x53')](db[_0xc8a5('0x57')][_0xc8a5('0x54')](_0x1c5dae(_0x38e1f0,_0xc8a5('0x55')))['then'](function(){})[_0xc8a5('0x2e')](_0x2dfdc1()));}}}return _0x27f2a9;})['all']()['then'](function(){return db[_0xc8a5('0x4c')][_0xc8a5('0x4d')]({'where':{'type':_0xc8a5('0x58')},'attributes':['id'],'include':[{'model':db[_0xc8a5('0x4f')],'as':_0xc8a5('0x59'),'where':{'id':LISTID}}]})[_0xc8a5('0x51')](function(_0x16b00f){var _0x398224=[];if(_0x16b00f){var _0x402aa4;for(var _0x22a418=0x0,_0x5a02d1;_0x22a418<_0x16b00f[_0xc8a5('0x1a')];_0x22a418+=0x1){_0x5a02d1=_0x16b00f[_0x22a418][_0xc8a5('0x52')]({'plain':!![]});_0x398224[_0xc8a5('0x53')](db[_0xc8a5('0x57')][_0xc8a5('0x54')](_0x525bad(_0x5a02d1,'VoiceQueueId'))[_0xc8a5('0x51')](function(){})['catch'](_0x2dfdc1()));}}return _0x398224;})[_0xc8a5('0x5a')]();})[_0xc8a5('0x51')](function(){return db['Campaign'][_0xc8a5('0x4d')]({'attributes':['id',_0xc8a5('0x4e')],'include':[{'model':db['CmList'],'as':_0xc8a5('0x50'),'where':{'id':LISTID}}]})[_0xc8a5('0x51')](function(_0x2a4f2c){var _0x2fd218=[];if(_0x2a4f2c){for(var _0x38772c=0x0,_0x5bf702;_0x38772c<_0x2a4f2c['length'];_0x38772c+=0x1){_0x5bf702=_0x2a4f2c[_0x38772c]['get']({'plain':!![]});switch(_0x5bf702[_0xc8a5('0x4e')]){case _0xc8a5('0x5b'):_0x2fd218['push'](db[_0xc8a5('0x57')][_0xc8a5('0x54')](_0x5f3897(_0x5bf702,_0xc8a5('0x5c')))['then'](function(){})[_0xc8a5('0x2e')](_0x2dfdc1()));break;case _0xc8a5('0x56'):_0x2fd218[_0xc8a5('0x53')](db['sequelize'][_0xc8a5('0x54')](_0x37c3fe(_0x5bf702,'CampaignId'))['then'](function(){})[_0xc8a5('0x2e')](_0x2dfdc1()));break;default:_0x2fd218[_0xc8a5('0x53')](db[_0xc8a5('0x57')][_0xc8a5('0x54')](_0x1c5dae(_0x5bf702,_0xc8a5('0x5c')))[_0xc8a5('0x51')](function(){})[_0xc8a5('0x2e')](_0x2dfdc1()));}}}return _0x2fd218;})[_0xc8a5('0x5a')]();})[_0xc8a5('0x51')](function(){return db[_0xc8a5('0x5d')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xc8a5('0x51')](function(_0x186bac){var _0x59535c=[];if(_0x186bac){for(var _0x2bc83d=0x0,_0x38a676;_0x2bc83d<_0x186bac[_0xc8a5('0x1a')];_0x2bc83d+=0x1){_0x38a676=_0x186bac[_0x2bc83d][_0xc8a5('0x52')]({'plain':!![]});_0x59535c[_0xc8a5('0x53')](db[_0xc8a5('0x57')][_0xc8a5('0x54')](_0x525bad(_0x38a676,'CampaignId'))[_0xc8a5('0x51')](function(){})[_0xc8a5('0x2e')](_0x2dfdc1()));}}return _0x59535c;})[_0xc8a5('0x5a')]();})['catch'](function(_0x1bc27c){logger['error'](_0xc8a5('0x5e'),_0xc8a5('0x5f'),_0x1bc27c[_0xc8a5('0x1c')]);});}var processPromises=function(_0x333bcd){return BPromise[_0xc8a5('0x5a')](promises)['then'](function(_0x777764){})['catch'](function(_0x52aa52){logger[_0xc8a5('0x17')](_0xc8a5('0x60'),JSON[_0xc8a5('0x30')](_0x52aa52));})[_0xc8a5('0x61')](function(){socket['emit'](_0xc8a5('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x333bcd){return _0x333bcd['resume']();}});};var endCsv=function(){return BPromise[_0xc8a5('0x63')]()[_0xc8a5('0x51')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xc8a5('0x64')](_0xc8a5('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xc8a5('0x65')](FILEPATH);}catch(_0x21fae7){logger['error'](_0xc8a5('0x66'),JSON['stringify'](_0x21fae7));}finally{process[_0xc8a5('0x67')](0x0);}});};process['on'](_0xc8a5('0x68'),function(){logger[_0xc8a5('0x69')](_0xc8a5('0x6a'));endCsv();});function main(){return BPromise[_0xc8a5('0x63')]()[_0xc8a5('0x51')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xc8a5('0x12')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc8a5('0x51')](function(_0x28ac3d){var _0x4ec318=fs[_0xc8a5('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc8a5('0x6c')](_0x4ec318,{'header':!![],'skipEmptyLines':!![],'step':function(_0x44eea3,_0x48da5d){total+=0x1;var _0x47cdeb=total;promises[_0xc8a5('0x53')](checkRow(_0x44eea3,_0x28ac3d,_0x47cdeb)[_0xc8a5('0x51')](function(){success+=0x1;})[_0xc8a5('0x2e')](function(_0x182c24){if(_0x182c24['error']){errors+=0x1;delete _0x182c24[_0xc8a5('0x17')];}else if(_0x182c24[_0xc8a5('0x2a')]){duplicates+=0x1;delete _0x182c24[_0xc8a5('0x2a')];}rows[_0xc8a5('0x53')](_0x182c24);}));if(total%0xc8===0x0){_0x48da5d[_0xc8a5('0x6d')]();return processPromises(_0x48da5d);}},'complete':function(){return processPromises()[_0xc8a5('0x51')](function(){logger['info'](_0xc8a5('0x6e'));endCsv();});},'error':function(_0x4ed52a,_0x59a849){logger[_0xc8a5('0x69')]('CSV\x20parse\x20error',JSON['stringify'](_0x4ed52a));endCsv();}});})[_0xc8a5('0x2e')](function(_0x163a69){logger[_0xc8a5('0x17')](_0xc8a5('0x6f'),JSON[_0xc8a5('0x30')](_0x163a69));});}main(); \ No newline at end of file +var _0xa4d8=['VoiceQueueId','catch','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../config/logger','api','defaults','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','test','isNil','errors','map','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','Duplicate\x20Contact','CmContact','keys','then','push','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','inspect','insert','into','cm_hopper','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','toString','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','fromQuery','id\x20IN\x20?','str','calleridnum','cm_hopper_final','findAll','outbound','dialCheckDuplicateType','CmList','Lists','sequelize','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4d8,0x1c7));var _0x8a4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa4d8[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x8a4d('0x0'));var _=require(_0x8a4d('0x1'));var fs=require('fs');var squel=require(_0x8a4d('0x2'));var Papa=require(_0x8a4d('0x3'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x8a4d('0x4'))(_0x8a4d('0x5'));config['redis']=_[_0x8a4d('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8a4d('0x7')]));require(_0x8a4d('0x8'))[_0x8a4d('0x9')](socket);try{if(!process['argv'][0x2]||process[_0x8a4d('0xa')][0x2]===_0x8a4d('0xb')||process[_0x8a4d('0xa')][0x2]===_0x8a4d('0xc')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x8a4d('0xa')][0x2];if(!process['argv'][0x3]||process[_0x8a4d('0xa')][0x3]==='undefined'||process[_0x8a4d('0xa')][0x3]===_0x8a4d('0xc')||!process['argv'][0x4]||process[_0x8a4d('0xa')][0x4]===_0x8a4d('0xb')||process['argv'][0x4]===_0x8a4d('0xc')){throw new Error(_0x8a4d('0xd'));}var FIELDS=_[_0x8a4d('0xe')](process['argv'][0x3]['split'](','),process[_0x8a4d('0xa')][0x4][_0x8a4d('0xf')](','));if(!process[_0x8a4d('0xa')][0x5]||process['argv'][0x5]==='undefined'||process[_0x8a4d('0xa')][0x5]==='null'){throw new Error(_0x8a4d('0x10'));}var LISTID=process[_0x8a4d('0xa')][0x5];var COMPANYID=process[_0x8a4d('0xa')][0x6]&&process[_0x8a4d('0xa')][0x6]!==_0x8a4d('0xb')&&process[_0x8a4d('0xa')][0x6]!==_0x8a4d('0xc')?process[_0x8a4d('0xa')][0x6]:null;var DUPLICATES=process[_0x8a4d('0xa')][0x7]&&process[_0x8a4d('0xa')][0x7]!=='undefined'&&process[_0x8a4d('0xa')][0x7]!==_0x8a4d('0xc')?process[_0x8a4d('0xa')][0x7]:null;if(!process['argv'][0x8]||process[_0x8a4d('0xa')][0x8]===_0x8a4d('0xb')||process[_0x8a4d('0xa')][0x8]===_0x8a4d('0xc')){throw new Error(_0x8a4d('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x1bf8ef){logger[_0x8a4d('0x12')](_0x1bf8ef);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(_0x30d823,_0x4f364b,_0x2eafd9,_0x47a3ea){var _0x568591={'message':_0x4f364b};_0x568591[_0x30d823]=!![];if(_0x2eafd9){_0x568591['contact']=_0x2eafd9;}if(_0x47a3ea){_0x568591[_0x8a4d('0x13')]=_0x47a3ea;}return _0x568591;}function isEmail(_0x2c411f){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))*$/[_0x8a4d('0x14')](_0x2c411f);}function checkRow(_0x3897aa,_0x542673,_0x1678d8){return new BPromise(function(_0x110112,_0xf7c7e2){if(_[_0x8a4d('0x15')](_0x3897aa)){return _0xf7c7e2(handleCheckRowError(_0x8a4d('0x12'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x1678d8));}if(_0x3897aa[_0x8a4d('0x16')]&&_0x3897aa[_0x8a4d('0x16')]['length']){var _0x119240=_[_0x8a4d('0x17')](_0x3897aa[_0x8a4d('0x16')],'message')[_0x8a4d('0x18')](';');return _0xf7c7e2(handleCheckRowError('error',_0x119240,null,_0x1678d8));}var _0x1fe6b4={};for(var _0x25087c in FIELDS){if(FIELDS[_0x8a4d('0x19')](_0x25087c)&&FIELDS[_0x25087c]){_0x1fe6b4[_0x25087c]=_0x3897aa[_0x8a4d('0x1a')][0x0][FIELDS[_0x25087c]]||_0x3897aa[_0x8a4d('0x1a')][0x0]['\ufeff'+FIELDS[_0x25087c]];}}if(!_0x1fe6b4['firstName']){return _0xf7c7e2(handleCheckRowError(_0x8a4d('0x12'),_0x8a4d('0x1b'),null,_0x1678d8));}if(!_0x1fe6b4[_0x8a4d('0x1c')]){return _0xf7c7e2(handleCheckRowError(_0x8a4d('0x12'),'phone\x20not\x20specified!',null,_0x1678d8));}if(_0x1fe6b4[_0x8a4d('0x1d')]){var _0x5805cd=moment(_0x1fe6b4[_0x8a4d('0x1d')],_0x8a4d('0x1e'));if(!_0x5805cd[_0x8a4d('0x1f')]()){return _0xf7c7e2(handleCheckRowError(_0x8a4d('0x12'),_0x8a4d('0x20'),null,_0x1678d8));}}if(_0x1fe6b4[_0x8a4d('0x21')]){if(!isEmail(_0x1fe6b4[_0x8a4d('0x21')])){return _0xf7c7e2(handleCheckRowError(_0x8a4d('0x12'),_0x8a4d('0x22'),null,_0x1678d8));}}_0x1fe6b4['ListId']=LISTID;_0x1fe6b4[_0x8a4d('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x8a4d('0x24')]&&_0x542673){var _0x28a259={};for(var _0x591580=0x0,_0x17a4a8=DUPLICATES['length'];_0x591580<_0x17a4a8;_0x591580+=0x1){_0x28a259[DUPLICATES[_0x591580]]=_0x1fe6b4[DUPLICATES[_0x591580]];}var _0x4d1c2a=_[_0x8a4d('0x25')](_0x542673,_0x28a259);if(_0x4d1c2a){return _0xf7c7e2(handleCheckRowError('duplicate',_0x8a4d('0x26'),_0x4d1c2a,_0x1678d8));}}return db[_0x8a4d('0x27')]['create'](_0x1fe6b4,{'raw':!![],'hooks':![],'fields':_[_0x8a4d('0x28')](_0x1fe6b4)})[_0x8a4d('0x29')](function(_0x2faffc){if(DUPLICATES&&DUPLICATES[_0x8a4d('0x24')]&&_0x542673){_0x542673[_0x8a4d('0x2a')](_['pick'](_0x1fe6b4,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2faffc['id'];return _0x110112();})['catch'](function(_0x31f0d4){return _0xf7c7e2(handleCheckRowError('error',_0x8a4d('0x2b')+(_0x31f0d4[_0x8a4d('0x2c')]||JSON[_0x8a4d('0x2d')](_0x31f0d4)),null,_0x1678d8));});});}function checkHopper(){function _0x10aef4(){return function(_0x14feb2){logger[_0x8a4d('0x12')](_0x8a4d('0x2e'),'checkHopper',util[_0x8a4d('0x2f')](_0x14feb2,{'showHidden':![],'depth':null}));};}var _0x2dda7b=function(_0x1d0dce,_0x43260c){var _0x17f0bc=squel[_0x8a4d('0x30')]()[_0x8a4d('0x31')](_0x8a4d('0x32'))['fromQuery']([_0x8a4d('0x1c'),_0x8a4d('0x33'),_0x8a4d('0x34'),_0x8a4d('0x35'),_0x43260c,_0x8a4d('0x36'),_0x8a4d('0x37')],squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x1c'),_0x8a4d('0x1c'))[_0x8a4d('0x39')]('NOW()',_0x8a4d('0x33'))['field']('id',_0x8a4d('0x34'))['field'](LISTID['toString'](),'ListId')['field'](_0x1d0dce['id'][_0x8a4d('0x3a')](),_0x43260c)[_0x8a4d('0x39')]('NOW()','createdAt')['field'](_0x8a4d('0x3b'),_0x8a4d('0x37'))['from'](_0x8a4d('0x3c'))[_0x8a4d('0x3d')](_0x8a4d('0x3e'))[_0x8a4d('0x3d')](_0x8a4d('0x3f'),LISTID[_0x8a4d('0x3a')]())[_0x8a4d('0x3d')](_0x8a4d('0x40'))[_0x8a4d('0x3d')](_0x8a4d('0x41'),squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')]('phone')[_0x8a4d('0x42')](_0x8a4d('0x32'))[_0x8a4d('0x3d')](_0x43260c+_0x8a4d('0x43'),_0x1d0dce['id']['toString']())))[_0x8a4d('0x3a')]();return _0x17f0bc;};var _0x1ca8df=function(_0x5a8113,_0x14dfff){var _0x1b29f5=squel[_0x8a4d('0x30')]()[_0x8a4d('0x31')](_0x8a4d('0x32'))[_0x8a4d('0x44')](['phone',_0x8a4d('0x33'),_0x8a4d('0x34'),'ListId',_0x14dfff,_0x8a4d('0x36'),'updatedAt'],squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x1c'),_0x8a4d('0x1c'))[_0x8a4d('0x39')](_0x8a4d('0x3b'),_0x8a4d('0x33'))[_0x8a4d('0x39')]('id',_0x8a4d('0x34'))['field'](LISTID[_0x8a4d('0x3a')](),_0x8a4d('0x35'))[_0x8a4d('0x39')](_0x5a8113['id'][_0x8a4d('0x3a')](),_0x14dfff)[_0x8a4d('0x39')]('NOW()',_0x8a4d('0x36'))['field'](_0x8a4d('0x3b'),_0x8a4d('0x37'))[_0x8a4d('0x42')](_0x8a4d('0x3c'))['where']('deletedAt\x20IS\x20NULL')[_0x8a4d('0x3d')]('ListId\x20=\x20?',LISTID[_0x8a4d('0x3a')]())[_0x8a4d('0x3d')](_0x8a4d('0x45'),squel[_0x8a4d('0x46')](hopperContacts))[_0x8a4d('0x3d')]('phone\x20IS\x20NOT\x20NULL')[_0x8a4d('0x3d')](_0x8a4d('0x41'),squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x47'))['from'](_0x8a4d('0x48'))[_0x8a4d('0x3d')](_0x14dfff+_0x8a4d('0x43'),_0x5a8113['id'][_0x8a4d('0x3a')]()))[_0x8a4d('0x3d')](_0x8a4d('0x41'),squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x1c'))[_0x8a4d('0x42')](_0x8a4d('0x32'))['where'](_0x14dfff+_0x8a4d('0x43'),_0x5a8113['id'][_0x8a4d('0x3a')]())))[_0x8a4d('0x3a')]();return _0x1b29f5;};function _0x321eae(_0x5ae898,_0x518c3c){var _0x41166e=squel[_0x8a4d('0x30')]()['into'](_0x8a4d('0x32'))[_0x8a4d('0x44')]([_0x8a4d('0x1c'),'scheduledAt','ContactId',_0x8a4d('0x35'),_0x518c3c,'createdAt','updatedAt'],squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x1c'),_0x8a4d('0x1c'))['field'](_0x8a4d('0x3b'),_0x8a4d('0x33'))['field']('id',_0x8a4d('0x34'))[_0x8a4d('0x39')](LISTID[_0x8a4d('0x3a')](),_0x8a4d('0x35'))[_0x8a4d('0x39')](_0x5ae898['id'][_0x8a4d('0x3a')](),_0x518c3c)['field'](_0x8a4d('0x3b'),_0x8a4d('0x36'))[_0x8a4d('0x39')]('NOW()',_0x8a4d('0x37'))[_0x8a4d('0x42')](_0x8a4d('0x3c'))[_0x8a4d('0x3d')](_0x8a4d('0x3e'))[_0x8a4d('0x3d')](_0x8a4d('0x3f'),LISTID[_0x8a4d('0x3a')]())[_0x8a4d('0x3d')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x8a4d('0x3d')](_0x8a4d('0x40')))[_0x8a4d('0x3a')]();return _0x41166e;}function _0x1f3e07(_0x47d4a2,_0x668bf3){var _0x20b1c6=squel['insert']()[_0x8a4d('0x31')]('cm_hopper_black')[_0x8a4d('0x44')]([_0x8a4d('0x1c'),_0x8a4d('0x34'),_0x8a4d('0x35'),_0x668bf3,'createdAt',_0x8a4d('0x37')],squel[_0x8a4d('0x38')]()[_0x8a4d('0x39')](_0x8a4d('0x1c'),'phone')['field']('id','ContactId')['field'](LISTID[_0x8a4d('0x3a')](),_0x8a4d('0x35'))[_0x8a4d('0x39')](_0x47d4a2['id'][_0x8a4d('0x3a')](),_0x668bf3)[_0x8a4d('0x39')](_0x8a4d('0x3b'),'createdAt')[_0x8a4d('0x39')](_0x8a4d('0x3b'),_0x8a4d('0x37'))[_0x8a4d('0x42')](_0x8a4d('0x3c'))[_0x8a4d('0x3d')](_0x8a4d('0x3e'))['where']('ListId\x20=\x20?',LISTID[_0x8a4d('0x3a')]())[_0x8a4d('0x3d')](_0x8a4d('0x45'),squel[_0x8a4d('0x46')](hopperContacts))['where'](_0x8a4d('0x40')))[_0x8a4d('0x3a')]();return _0x20b1c6;}return db['VoiceQueue'][_0x8a4d('0x49')]({'where':{'type':_0x8a4d('0x4a')},'attributes':['id',_0x8a4d('0x4b')],'include':[{'model':db[_0x8a4d('0x4c')],'as':_0x8a4d('0x4d'),'where':{'id':LISTID}}]})[_0x8a4d('0x29')](function(_0xf3fa59){var _0x480e60=[];if(_0xf3fa59){var _0x2b9ab0;for(var _0x2715d4=0x0,_0x112f59;_0x2715d4<_0xf3fa59[_0x8a4d('0x24')];_0x2715d4+=0x1){_0x112f59=_0xf3fa59[_0x2715d4]['get']({'plain':!![]});switch(_0x112f59[_0x8a4d('0x4b')]){case'always':_0x480e60['push'](db[_0x8a4d('0x4e')][_0x8a4d('0x4f')](_0x1ca8df(_0x112f59,_0x8a4d('0x50')))['then'](function(){})[_0x8a4d('0x51')](_0x10aef4()));break;case'onlyIfOpen':_0x480e60[_0x8a4d('0x2a')](db['sequelize'][_0x8a4d('0x4f')](_0x2dda7b(_0x112f59,_0x8a4d('0x50')))[_0x8a4d('0x29')](function(){})['catch'](_0x10aef4()));break;default:_0x480e60[_0x8a4d('0x2a')](db['sequelize'][_0x8a4d('0x4f')](_0x321eae(_0x112f59,'VoiceQueueId'))[_0x8a4d('0x29')](function(){})[_0x8a4d('0x51')](_0x10aef4()));}}}return _0x480e60;})[_0x8a4d('0x52')]()['then'](function(){return db[_0x8a4d('0x53')]['findAll']({'where':{'type':_0x8a4d('0x4a')},'attributes':['id'],'include':[{'model':db[_0x8a4d('0x4c')],'as':_0x8a4d('0x54'),'where':{'id':LISTID}}]})[_0x8a4d('0x29')](function(_0xc66616){var _0x41098b=[];if(_0xc66616){var _0x3e825d;for(var _0x479c20=0x0,_0x188e20;_0x479c20<_0xc66616['length'];_0x479c20+=0x1){_0x188e20=_0xc66616[_0x479c20][_0x8a4d('0x55')]({'plain':!![]});_0x41098b['push'](db[_0x8a4d('0x4e')][_0x8a4d('0x4f')](_0x1f3e07(_0x188e20,_0x8a4d('0x50')))['then'](function(){})['catch'](_0x10aef4()));}}return _0x41098b;})['all']();})[_0x8a4d('0x29')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x8a4d('0x4b')],'include':[{'model':db[_0x8a4d('0x4c')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0xc15749){var _0x2364c7=[];if(_0xc15749){for(var _0x16622b=0x0,_0x47fe91;_0x16622b<_0xc15749[_0x8a4d('0x24')];_0x16622b+=0x1){_0x47fe91=_0xc15749[_0x16622b]['get']({'plain':!![]});switch(_0x47fe91[_0x8a4d('0x4b')]){case'always':_0x2364c7[_0x8a4d('0x2a')](db[_0x8a4d('0x4e')][_0x8a4d('0x4f')](_0x1ca8df(_0x47fe91,_0x8a4d('0x56')))[_0x8a4d('0x29')](function(){})[_0x8a4d('0x51')](_0x10aef4()));break;case _0x8a4d('0x57'):_0x2364c7[_0x8a4d('0x2a')](db[_0x8a4d('0x4e')][_0x8a4d('0x4f')](_0x2dda7b(_0x47fe91,_0x8a4d('0x56')))[_0x8a4d('0x29')](function(){})['catch'](_0x10aef4()));break;default:_0x2364c7[_0x8a4d('0x2a')](db[_0x8a4d('0x4e')]['query'](_0x321eae(_0x47fe91,'CampaignId'))['then'](function(){})[_0x8a4d('0x51')](_0x10aef4()));}}}return _0x2364c7;})[_0x8a4d('0x52')]();})[_0x8a4d('0x29')](function(){return db[_0x8a4d('0x58')][_0x8a4d('0x49')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x8a4d('0x54'),'where':{'id':LISTID}}]})[_0x8a4d('0x29')](function(_0x4d076e){var _0xc21272=[];if(_0x4d076e){for(var _0x159fc8=0x0,_0x5397bd;_0x159fc8<_0x4d076e['length'];_0x159fc8+=0x1){_0x5397bd=_0x4d076e[_0x159fc8][_0x8a4d('0x55')]({'plain':!![]});_0xc21272['push'](db[_0x8a4d('0x4e')][_0x8a4d('0x4f')](_0x1f3e07(_0x5397bd,'CampaignId'))['then'](function(){})[_0x8a4d('0x51')](_0x10aef4()));}}return _0xc21272;})[_0x8a4d('0x52')]();})[_0x8a4d('0x51')](function(_0x53cc65){logger['error'](_0x8a4d('0x59'),_0x8a4d('0x5a'),_0x53cc65[_0x8a4d('0x2c')]);});}var processPromises=function(_0x299a3e){return BPromise[_0x8a4d('0x52')](promises)['then'](function(_0x4235c6){})[_0x8a4d('0x51')](function(_0x527cae){logger[_0x8a4d('0x12')](_0x8a4d('0x5b'),JSON[_0x8a4d('0x2d')](_0x527cae));})[_0x8a4d('0x5c')](function(){socket[_0x8a4d('0x5d')](_0x8a4d('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x299a3e){return _0x299a3e[_0x8a4d('0x5f')]();}});};var endCsv=function(){return BPromise[_0x8a4d('0x60')]()[_0x8a4d('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x8a4d('0x29')](function(){socket[_0x8a4d('0x5d')](_0x8a4d('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x3257d8){logger[_0x8a4d('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x8a4d('0x2d')](_0x3257d8));}finally{process[_0x8a4d('0x61')](0x0);}});};process['on'](_0x8a4d('0x62'),function(){logger[_0x8a4d('0x63')](_0x8a4d('0x64'));endCsv();});function main(){return BPromise[_0x8a4d('0x60')]()[_0x8a4d('0x29')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8a4d('0xf')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8a4d('0x29')](function(_0x4b5dbc){var _0x5f0089=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x8a4d('0x65')](_0x5f0089,{'header':!![],'skipEmptyLines':!![],'step':function(_0x940ab5,_0xae3f21){total+=0x1;var _0x26c21f=total;promises[_0x8a4d('0x2a')](checkRow(_0x940ab5,_0x4b5dbc,_0x26c21f)[_0x8a4d('0x29')](function(){success+=0x1;})[_0x8a4d('0x51')](function(_0x57b863){if(_0x57b863[_0x8a4d('0x12')]){errors+=0x1;delete _0x57b863[_0x8a4d('0x12')];}else if(_0x57b863['duplicate']){duplicates+=0x1;delete _0x57b863[_0x8a4d('0x66')];}rows[_0x8a4d('0x2a')](_0x57b863);}));if(total%0xc8===0x0){_0xae3f21[_0x8a4d('0x67')]();return processPromises(_0xae3f21);}},'complete':function(){return processPromises()[_0x8a4d('0x29')](function(){logger[_0x8a4d('0x63')](_0x8a4d('0x68'));endCsv();});},'error':function(_0x107400,_0xec5cc2){logger[_0x8a4d('0x63')](_0x8a4d('0x69'),JSON[_0x8a4d('0x2d')](_0x107400));endCsv();}});})[_0x8a4d('0x51')](function(_0x505d85){logger[_0x8a4d('0x12')](_0x8a4d('0x6a'),JSON[_0x8a4d('0x2d')](_0x505d85));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5f68d5e..38766fd 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 _0xe55a=['../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','join','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','length','all','split','isNil','filter','push','CmContactHasItem','findOne','updated','create','inserted','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','cm_hopper','phone','ListId','updatedAt','UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','insert','cm_hopper_black','fromQuery','ContactId','createdAt','select','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','into','.CmListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','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?','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','error','message','errors','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','main','send','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','keys','writeFileSync','parse','createReadStream','data','rows','find','replace','isValid','isNaN','isNumber','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','\x20not\x20specified','hasOwnProperty','itemTypeId','trim','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','voice_queues_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_blacklists','finish','affectedRows','emit','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','lodash','papaparse','util','bluebird','moment','ioredis'];(function(_0x4f4a77,_0x396f14){var _0x166023=function(_0x3a7e5c){while(--_0x3a7e5c){_0x4f4a77['push'](_0x4f4a77['shift']());}};_0x166023(++_0x396f14);}(_0xe55a,0x168));var _0xae55=function(_0x3e2865,_0x2231ee){_0x3e2865=_0x3e2865-0x0;var _0x2754d7=_0xe55a[_0x3e2865];return _0x2754d7;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xae55('0x0'));var Papa=require(_0xae55('0x1'));var util=require(_0xae55('0x2'));var BPromise=require(_0xae55('0x3'));var moment=require(_0xae55('0x4'));var squel=require('squel');var Redis=require(_0xae55('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xae55('0x6'));var shared=require('../../../config/environment/shared');var logger=require(_0xae55('0x7'))(_0xae55('0x8'));config[_0xae55('0x9')]=_[_0xae55('0xa')](config[_0xae55('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xae55('0xb'))(new Redis(config[_0xae55('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0xae55('0xc')]('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()[_0xae55('0xc')](_0xae55('0xd'));function isEmail(_0x1d35a4){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))*$/[_0xae55('0xe')](_0x1d35a4);}function selectNotIn(_0x4ef03b,_0x221a07,_0xb8b6e9,_0x202936,_0x5b439e){return squel['select']()[_0xae55('0xf')]('phone')['from'](_0x202936)[_0xae55('0x10')](_0x221a07,null,_0x221a07+'.id\x20=\x20'+_0x202936+'.'+_0xb8b6e9)[_0xae55('0x11')](_0x202936+'.'+_0xb8b6e9+_0xae55('0x12')+_0x4ef03b+'.'+_0xb8b6e9)[_0xae55('0x11')](_0x221a07+'.dialCheckDuplicateType\x20IN\x20('+_0x5b439e['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x29ef02,_0x218d9a){promisesAdditionalPhones=[];return db[_0xae55('0x13')][_0xae55('0x14')]({'raw':!![],'attributes':['id',_0xae55('0x15')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xae55('0x16')](function(_0x527127){if(_0x527127!==null){var _0x3ed7d1=[];for(var _0x4a5cb2=0x0;_0x4a5cb2<_0x527127[_0xae55('0x17')];_0x4a5cb2++){var _0x16ba13=_0x527127[_0x4a5cb2];_0x3ed7d1['push'](insertAdditionalPhones(_0x16ba13));}}Promise[_0xae55('0x18')](_0x3ed7d1)['then'](function(){_0x29ef02({'val':0x1});});});});}function insertAdditionalPhones(_0x51764d){return new Promise(function(_0x3a501c,_0x165f66){var _0x277e5d=_0x51764d['AdditionalPhones'];var _0x5b486f=_0x277e5d[_0xae55('0x19')](';');var _0x5ef32d=[];orderBy=0x0;for(var _0x2def79=0x0;_0x2def79<_0x5b486f['length'];_0x2def79++){_0x5ef32d['push'](splitAdditionalPhone(_0x51764d['id'],_0x5b486f[_0x2def79]));}Promise[_0xae55('0x18')](_0x5ef32d)[_0xae55('0x16')](function(){_0x3a501c({'val':_0x5b486f[_0xae55('0x17')]});});});}function splitAdditionalPhone(_0x2637ee,_0x1fdcfa){return new Promise(function(_0x28246a,_0x58d403){var _0x59874b=_0x1fdcfa[_0xae55('0x19')](':');var _0x33032d=_0x59874b[0x0];var _0xbddb89=_0x59874b[0x1];if(!_[_0xae55('0x1a')](_0xbddb89)){var _0x4cc055=_0xbddb89[_0xae55('0x19')]('|');var _0x40676c=[];for(var _0x10a953=0x0;_0x10a953<_0x4cc055[_0xae55('0x17')];_0x10a953++){if(_0x4cc055[_0x10a953]!==''){var _0x5d9ee7=_[_0xae55('0x1b')](promisesAdditionalPhones,{'contactId':_0x2637ee,'phone':_0x4cc055[_0x10a953]});if(_0x5d9ee7[_0xae55('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0xae55('0x1c')]({'contactId':_0x2637ee,'contactTypeId':_0x33032d,'phone':_0x4cc055[_0x10a953],'orderBy':orderBy});}}}_0x28246a({'ok':0x1});}else _0x28246a({'res':0x0});});}function createAdditionalPhone(_0x2b771a,_0x4b24ce,_0x4751aa,_0x441554){var _0x5dffff='';var _0x696c23='';var _0xf3e79e=_0x4751aa['split']('§');_0x5dffff=_0xf3e79e[0x0];if(_0xf3e79e[_0xae55('0x17')]==0x2)_0x696c23=_0xf3e79e[0x1];return new Promise(function(_0x55622d,_0x42d9c9){return db[_0xae55('0x1d')][_0xae55('0x1e')]({'where':{'CmContactId':_0x2b771a,'item':_0x5dffff}})[_0xae55('0x16')](function(_0x3537fb){if(_0x3537fb){return db[_0xae55('0x1d')]['update']({'ItemTypeId':_0x4b24ce,'description':_0x696c23,'OrderBy':_0x441554},{'where':{'CmContactId':_0x2b771a,'item':_0x5dffff}})[_0xae55('0x16')](function(_0x30ae5f){_0x55622d({'res':_0xae55('0x1f')});});}else{return db['CmContactHasItem'][_0xae55('0x20')]({'CmContactId':_0x2b771a,'item':_0x5dffff,'description':_0x696c23,'ItemTypeId':_0x4b24ce,'OrderBy':_0x441554,'ItemClass':'PHONE'})[_0xae55('0x16')](function(_0x1407a3){_0x55622d({'res':_0xae55('0x21')});});}});});}function insertCmHopper(_0x2b6388,_0x50da4a,_0x537c48,_0x49f1f5,_0x23f21b){var _0x36e0bb=['cm_contacts.phone','cm_contacts.scheduledat',_0xae55('0x22'),_0xae55('0x23'),_0x50da4a+'.'+_0x49f1f5,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0xae55('0x24'),'\x22'+_0x23f21b+'\x22'];return squel['insert']()['into'](_0xae55('0x25'))['fromQuery']([_0xae55('0x26'),'scheduledat','ContactId',_0xae55('0x27'),_0x49f1f5,'createdAt',_0xae55('0x28'),'priority',_0xae55('0x29'),_0xae55('0x2a')],squel['select']()[_0xae55('0x2b')](_0x36e0bb)[_0xae55('0x2c')](_0x50da4a)[_0xae55('0x10')](_0xae55('0x2d'),null,_0xae55('0x2e')+_0x50da4a+_0xae55('0x2f'))[_0xae55('0x10')](_0x537c48,null,_0x537c48+_0xae55('0x30')+_0x50da4a+'.'+_0x49f1f5)['where'](_0x50da4a+'.CmListId\x20=\x20?',_0x2b6388)[_0xae55('0x11')](_0xae55('0x31'),NOW)[_0xae55('0x11')](_0xae55('0x32'),selectNotIn(_0x50da4a,_0x537c48,_0x49f1f5,_0xae55('0x25'),[_0xae55('0x33'),_0xae55('0x34')]))[_0xae55('0x11')](_0xae55('0x32'),selectNotIn(_0x50da4a,_0x537c48,_0x49f1f5,_0xae55('0x25'),['\x22always\x22'])))[_0xae55('0x35')]();}function insertCmHopperBlack(_0x5aaa57,_0x3d66da,_0x813fc3,_0x7aadfa){var _0x3d3a1c=[_0xae55('0x36'),_0xae55('0x22'),_0xae55('0x23'),_0x3d66da+'.'+_0x7aadfa,_0xae55('0x37'),_0xae55('0x38')];return squel[_0xae55('0x39')]()['into'](_0xae55('0x3a'))[_0xae55('0x3b')]([_0xae55('0x26'),_0xae55('0x3c'),_0xae55('0x27'),_0x7aadfa,_0xae55('0x3d'),_0xae55('0x28')],squel['select']()[_0xae55('0x2b')](_0x3d3a1c)[_0xae55('0x2c')](_0x3d66da)[_0xae55('0x10')]('cm_contacts',null,_0xae55('0x2e')+_0x3d66da+_0xae55('0x2f'))[_0xae55('0x10')](_0x813fc3,null,_0x813fc3+'.id\x20=\x20'+_0x3d66da+'.'+_0x7aadfa)[_0xae55('0x11')](_0x3d66da+'.CmListId\x20=\x20?',_0x5aaa57)['where'](_0xae55('0x31'),NOW)[_0xae55('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xae55('0x3e')]()[_0xae55('0xf')](_0xae55('0x26'))[_0xae55('0x2c')](_0xae55('0x3a'))[_0xae55('0x11')](_0xae55('0x3f'),_0x5aaa57)[_0xae55('0x11')](_0x7aadfa+_0xae55('0x12')+_0x3d66da+'.'+_0x7aadfa)))['toString']();}function insertTzCmHopper(_0x4f41f6,_0xb33b43,_0x2b968c,_0x4d5988,_0x4f9bb4,_0x5da6ab){var _0x2955a5=['cm_contacts.phone',_0xae55('0x40')+_0x5da6ab+_0xae55('0x41'),_0xae55('0x22'),'cm_contacts.ListId',_0xb33b43+'.'+_0x4d5988,_0xae55('0x37'),_0xae55('0x38'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4f9bb4+'\x22'];var _0xfd4226=squel[_0xae55('0x39')]()[_0xae55('0x42')]('cm_hopper')[_0xae55('0x3b')]([_0xae55('0x26'),'scheduledat','ContactId','ListId',_0x4d5988,_0xae55('0x3d'),'updatedAt','priority',_0xae55('0x29'),_0xae55('0x2a')],squel[_0xae55('0x3e')]()[_0xae55('0x2b')](_0x2955a5)['from'](_0xb33b43)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0xb33b43+_0xae55('0x2f'))[_0xae55('0x10')](_0x2b968c,null,_0x2b968c+_0xae55('0x30')+_0xb33b43+'.'+_0x4d5988)['join'](_0x5da6ab,null,_0x5da6ab+_0xae55('0x30')+_0xb33b43+'.'+_0x4d5988)[_0xae55('0x11')](_0xb33b43+_0xae55('0x43'),_0x4f41f6)[_0xae55('0x11')](_0xae55('0x31'),NOW)[_0xae55('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xb33b43,_0x2b968c,_0x4d5988,'cm_hopper',[_0xae55('0x33'),_0xae55('0x34')]))[_0xae55('0x11')](_0xae55('0x32'),selectNotIn(_0xb33b43,_0x2b968c,_0x4d5988,_0xae55('0x25'),[_0xae55('0x33')])))[_0xae55('0x35')]();return _0xfd4226;}function insertTzCmHopperBlack(_0x121e56,_0x200c00,_0x4b86a2,_0x365dda){var _0x9d13a6=[_0xae55('0x36'),'cm_contacts.id',_0xae55('0x23'),_0x200c00+'.'+_0x365dda,_0xae55('0x37'),_0xae55('0x38')];return squel[_0xae55('0x39')]()[_0xae55('0x42')](_0xae55('0x3a'))[_0xae55('0x3b')](['phone','ContactId',_0xae55('0x27'),_0x365dda,_0xae55('0x3d'),_0xae55('0x28')],squel[_0xae55('0x3e')]()[_0xae55('0x2b')](_0x9d13a6)['from'](_0x200c00)[_0xae55('0x10')](_0xae55('0x2d'),null,'cm_contacts.ListId\x20=\x20'+_0x200c00+_0xae55('0x2f'))[_0xae55('0x10')](_0x4b86a2,null,_0x4b86a2+_0xae55('0x30')+_0x200c00+'.'+_0x365dda)['where'](_0x200c00+_0xae55('0x43'),_0x121e56)[_0xae55('0x11')](_0xae55('0x31'),NOW)[_0xae55('0x11')](_0xae55('0x32'),squel['select']()['field']('phone')[_0xae55('0x2c')](_0xae55('0x3a'))['where'](_0xae55('0x3f'),_0x121e56)[_0xae55('0x11')](_0x365dda+_0xae55('0x12')+_0x200c00+'.'+_0x365dda)))[_0xae55('0x35')]();}function insertCmHopperAdditionalPhones(_0x295859){var _0x517a72=[_0xae55('0x44'),_0xae55('0x45'),_0xae55('0x46'),_0xae55('0x47'),_0xae55('0x48')];return squel['insert']()[_0xae55('0x42')](_0xae55('0x49'))[_0xae55('0x3b')](['CmHopperId',_0xae55('0x26'),'OrderBy',_0xae55('0x3d'),'updatedAt'],squel['select']()['fields'](_0x517a72)[_0xae55('0x2c')](_0xae55('0x25'))[_0xae55('0x10')]('cm_contacts',null,_0xae55('0x4a'))[_0xae55('0x10')](_0xae55('0x4b'),null,_0xae55('0x4c'))[_0xae55('0x11')](_0xae55('0x4d'),_0x295859)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0xae55('0x35')]();}function insertCmContact(_0x2857c2,_0x2b508a,_0x4e4189,_0x55d57a){var _0x25278f=_['concat'](_['keys'](_0x55d57a),['ListId',_0xae55('0x4e'),_0xae55('0x3d'),'updatedAt','scheduledAt']);return squel[_0xae55('0x39')]()[_0xae55('0x42')](_0xae55('0x2d'))['fromQuery'](_0x25278f,squel[_0xae55('0x3e')]()['fields'](_0x25278f)[_0xae55('0x2c')](_0x2b508a)[_0xae55('0x11')]('('+_0x4e4189[_0xae55('0x10')](',')+_0xae55('0x4f'),squel[_0xae55('0x3e')]()[_0xae55('0x2b')](_0x4e4189)[_0xae55('0x2c')](_0xae55('0x2d'))[_0xae55('0x11')](_0xae55('0x3f'),_0x2857c2)[_0xae55('0x11')](_0xae55('0x50')))[_0xae55('0x11')](_0xae55('0x51'),squel['select']()[_0xae55('0xf')](_0xae55('0x52'),_0xae55('0x53'))[_0xae55('0x2c')](_0x2b508a)[_0xae55('0x54')](_0x4e4189['join'](','))))['toString']();}function handleStop(){logger[_0xae55('0x55')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0xd18fae){logger[_0xae55('0x56')](_0xd18fae[_0xae55('0x57')]);process['exit'](0x1);}function handleError(_0x5c7e78,_0xc4909e){stats[_0xae55('0x58')]['push']({'name':_0xc4909e[_0xae55('0x59')],'message':_0xc4909e[_0xae55('0x57')],'row':_0x5c7e78});}function handleQuery(_0x2ce2fc){logger[_0xae55('0x55')](_0x2ce2fc);return db['sequelize'][_0xae55('0x5a')](_0x2ce2fc)[_0xae55('0x5b')](function(_0x48fdd8){results['push'](_0x48fdd8);})[_0xae55('0x5c')](function(_0x3f8315){logger[_0xae55('0x56')](_0x3f8315[_0xae55('0x57')]);});}function updateTzCampaigns(_0x3d2465){return new Promise(function(_0x4ee0cc,_0x504974){var _0x54d825=squel['select']()[_0xae55('0x2b')]([_0xae55('0x5d'),_0xae55('0x5e')])['from'](_0xae55('0x5f'))[_0xae55('0x10')](_0xae55('0x60'),null,_0xae55('0x61'))[_0xae55('0x11')]('campaigns_has_cm_lists.CmListId='+_0x3d2465);db[_0xae55('0x62')][_0xae55('0x5a')](_0x54d825[_0xae55('0x35')]())[_0xae55('0x5b')](function(_0x1f4e27){var _0x43632b=[];for(var _0x3d944c=0x0;_0x3d944c<_0x1f4e27[_0xae55('0x17')];_0x3d944c++){_0x43632b[_0xae55('0x1c')](getTimezoneData(_0x1f4e27[_0x3d944c],tmp_campaigns));}BPromise['all'](_0x43632b)[_0xae55('0x16')](function(){_0x4ee0cc({'val':0x1});});})[_0xae55('0x5c')](function(_0x4d32b4){logger[_0xae55('0x56')](_0x4d32b4['message']);_0x4ee0cc({'val':0x0});});});}function updateTzVoiceQueues(_0x4051bb){return new Promise(function(_0x4f8e43,_0x1930db){var _0x3be124=squel[_0xae55('0x3e')]()[_0xae55('0x2b')]([_0xae55('0x63'),_0xae55('0x64')])[_0xae55('0x2c')]('voice_queues')[_0xae55('0x10')](_0xae55('0x65'),null,_0xae55('0x66'))[_0xae55('0x11')](_0xae55('0x67')+_0x4051bb);db[_0xae55('0x62')][_0xae55('0x5a')](_0x3be124[_0xae55('0x35')]())['spread'](function(_0x21682c){var _0x4a8b7a=[];for(var _0x2e496f=0x0;_0x2e496f<_0x21682c[_0xae55('0x17')];_0x2e496f++){_0x4a8b7a[_0xae55('0x1c')](getTimezoneData(_0x21682c[_0x2e496f],tmp_voice_queues));}BPromise[_0xae55('0x18')](_0x4a8b7a)[_0xae55('0x16')](function(){_0x4f8e43({'val':0x1});});})['catch'](function(_0x3d6069){logger[_0xae55('0x56')](_0x3d6069[_0xae55('0x57')]);_0x4f8e43({'val':0x0});});});}function getTimezoneData(_0x320e25,_0x551785){return new Promise(function(_0x19d303,_0x5bc1fc){var _0x2fdc73=shared[_0xae55('0x68')];var _0x3eb13c=_0x2fdc73[_0x320e25[_0xae55('0x69')]];if(_[_0xae55('0x1a')](_0x3eb13c)){_0x19d303({'ret':0x1});}else{var _0x3143bf=_0x3eb13c['utcOffset'];var _0x50b5a6=squel[_0xae55('0x39')]()[_0xae55('0x42')](_0x551785)[_0xae55('0x6a')]('id',_0x320e25['id'])[_0xae55('0x6a')](_0xae55('0x6b'),_0x3143bf)[_0xae55('0x6a')](_0xae55('0x69'),_0x320e25[_0xae55('0x69')])[_0xae55('0x35')]();return db[_0xae55('0x62')]['query'](_0x50b5a6)[_0xae55('0x5b')](function(_0x43b122){_0x19d303({'ret':0x1});})[_0xae55('0x5c')](function(_0x1337f7){logger[_0xae55('0x56')](_0x1337f7[_0xae55('0x57')]);_0x5bc1fc({'ret':0x1});});}});}function handleTZQuery(_0x4e9a0f){logger['info'](_0x4e9a0f);return db['sequelize'][_0xae55('0x5a')](_0x4e9a0f)[_0xae55('0x5b')](function(_0x377ab0){})[_0xae55('0x5c')](function(_0x363b0c){logger[_0xae55('0x56')](_0x363b0c[_0xae55('0x57')]);});}function main(_0x57e47d,_0x22bdf3,_0x114a68,_0x50d5a0){logger['info'](_0xae55('0x6c'),_0x57e47d,JSON['stringify'](_0x22bdf3));process[_0xae55('0x6d')]('start');var _0x3ed7df=_0x22bdf3[_0xae55('0x6e')];var _0x36980d=_[_0xae55('0x6f')](_0x3ed7df);var _0x1e7f1d=_0x22bdf3[_0xae55('0x70')];var _0x96d4bc=path[_0xae55('0x10')](config[_0xae55('0x71')],_0xae55('0x72'),_0x1e7f1d+_0xae55('0x73'));hasTZ=_['keys'](_0x3ed7df)[_0xae55('0x74')]('dialTimezone');var _0x3baa4d=_['keys'](_0x3ed7df)[_0xae55('0x10')]();logger['info'](_0xae55('0x75'),_0x3baa4d);db[_0xae55('0x76')]['findAll']({'raw':!![],'attributes':['id','name']})[_0xae55('0x16')](function(_0x2adb8d){for(var _0x2bd4b6=0x0;_0x2bd4b6<_0x2adb8d[_0xae55('0x17')];_0x2bd4b6++){if(_0x2adb8d[_0x2bd4b6]['name']in _0x3ed7df){contactItemTypes[_0xae55('0x1c')](_0x2adb8d[_0x2bd4b6]);delete _0x36980d[_0x2adb8d[_0x2bd4b6][_0xae55('0x77')]];hasAdditionalPhones=!![];}for(var _0x371209 in _0x3ed7df){if(_0x2adb8d[_0x2bd4b6]['name']+_0xae55('0x78')===_0x371209){phoneDescriptions[_0xae55('0x1c')]({'itemTypeId':_0x2adb8d[_0x2bd4b6]['id'],'description':_0x371209});delete _0x36980d[_0x371209];}}}if(hasAdditionalPhones)_0x36980d[_0xae55('0x15')]='';var _0x49b523=_[_0xae55('0x79')](_0x36980d)[_0xae55('0x10')]();logger['info'](_0xae55('0x75'),_0x49b523);fs[_0xae55('0x7a')](_0x96d4bc,_0x49b523+'\x0a');Papa[_0xae55('0x7b')](fs[_0xae55('0x7c')](_0x57e47d),{'header':!![],'skipEmptyLines':!![],'step':function(_0x51a38d,_0x5f2069){try{for(var _0x41031f=0x0,_0x30a45c=[];_0x41031f<_0x51a38d[_0xae55('0x7d')][_0xae55('0x17')];_0x41031f++){stats[_0xae55('0x7e')]+=0x1;if(_0x51a38d['errors'][_0x41031f]){handleError(_0x51a38d[_0xae55('0x7d')][_0x41031f],_0x51a38d[_0xae55('0x58')][_0x41031f]);}else{var _0x4e8bf1=[];var _0x558f33=[];var _0x5dd11a={};for(var _0x5a5386 in _0x3ed7df){let _0x514243=contactItemTypes[_0xae55('0x7f')](_0x3cf451=>_0x3cf451[_0xae55('0x77')]===_0x5a5386);let _0x3b5cf1=contactItemTypes[_0xae55('0x7f')](_0xbcda9e=>_0xbcda9e[_0xae55('0x77')]+_0xae55('0x78')===_0x5a5386);if(_[_0xae55('0x1a')](_0x514243)&&_['isNil'](_0x3b5cf1)){if(_0x3ed7df['hasOwnProperty'](_0x5a5386)){if(_0x51a38d[_0xae55('0x7d')][_0x41031f][_0x3ed7df[_0x5a5386]]){var _0x421df0=_['trim'](_0x51a38d['data'][_0x41031f][_0x3ed7df[_0x5a5386]][_0xae55('0x80')](/"/g,'\x27'));switch(_0x5a5386){case'scheduledat':var _0x387fcf=moment(_0x421df0,_0xae55('0xd'),!![]);if(_0x387fcf[_0xae55('0x81')]()){_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');}else{_0x4e8bf1[_0xae55('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0xfde78b=parseInt(_0x421df0);_0x421df0=_[_0xae55('0x82')](_0xfde78b)||_0xfde78b<0x0||_0xfde78b>0x4?_0x50d5a0?0x3:0x2:_0xfde78b;_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');break;case _0xae55('0x29'):var _0x3e9f47=parseInt(_0x421df0);if(_[_0xae55('0x83')](_0x3e9f47)&&_['includes'](_0x114a68,_0x3e9f47)){_0x30a45c[_0xae55('0x1c')]('\x22'+_0x3e9f47+'\x22');}else{_0x4e8bf1['push']('agent\x20not\x20exists');}break;case _0xae55('0x84'):if(isEmail(_0x421df0)){_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');}else{_0x4e8bf1[_0xae55('0x1c')]('email\x20wrong\x20format');}break;case _0xae55('0x85'):var _0x1c5e5a=moment(_0x421df0,_0xae55('0x86'),!![]);if(_0x1c5e5a[_0xae55('0x81')]()){_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');}else{_0x4e8bf1[_0xae55('0x1c')](_0xae55('0x87'));}break;case'dialTimezone':var _0x1764f1=shared['timezones'];var _0x311ff8=_0x1764f1[_0x421df0];if(!_[_0xae55('0x1a')](_0x311ff8)){var _0x4e4ad9=_0x311ff8[_0xae55('0x88')];_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');_0x30a45c[_0xae55('0x1c')]('\x22'+_0x4e4ad9+'\x22');}break;default:_0x30a45c[_0xae55('0x1c')]('\x22'+_0x421df0+'\x22');}}else{switch(_0x5a5386){case'firstName':case _0xae55('0x26'):_0x4e8bf1[_0xae55('0x1c')](_0x5a5386+_0xae55('0x89'));break;default:_0x30a45c[_0xae55('0x1c')]('\x22\x22');}}}}else{var _0x4fbb9a='';if(!_[_0xae55('0x1a')](_0x514243)){if(!_0x5dd11a[_0xae55('0x8a')](_0x514243['id'])){if(!_['isNil'](_0x51a38d[_0xae55('0x7d')][_0x41031f][_0x3ed7df[_0x5a5386]])){var _0x421df0=_['trim'](_0x51a38d[_0xae55('0x7d')][_0x41031f][_0x3ed7df[_0x5a5386]][_0xae55('0x80')](/"/g,'\x27'));var _0x2377b2=phoneDescriptions['find'](_0x2a8ce3=>_0x2a8ce3[_0xae55('0x8b')]===_0x514243['id']);if(!_['isNil'](_0x2377b2)){var _0x3528af=_[_0xae55('0x8c')](_0x51a38d['data'][_0x41031f][_0x3ed7df[_0x2377b2['description']]][_0xae55('0x80')](/"/g,'\x27'));if(!_[_0xae55('0x1a')](_0x3528af))_0x421df0=_0x421df0+'§'+_0x3528af;}if(_0x4fbb9a=='')_0x4fbb9a=_0x421df0;else _0x4fbb9a+='|'+_0x421df0;}_0x558f33[_0xae55('0x1c')](_0x514243['id']+':'+_0x4fbb9a);_0x5dd11a[_0x514243['id']]=0x1;}}}}if(hasAdditionalPhones){_0x30a45c[_0xae55('0x1c')]('\x22'+_0x558f33[_0xae55('0x10')](';')+'\x22');}if(_0x4e8bf1['length']){handleError(_0x51a38d['data'][_0x41031f],{'code':'SystemRow','message':_0x4e8bf1[_0xae55('0x10')]()});}else{fs[_0xae55('0x8d')](_0x96d4bc,_0x30a45c[_0xae55('0x10')]()+'\x0a');}_0x30a45c=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xae55('0x8e')+_0x1e7f1d,stats);stats[_0xae55('0x58')]=[];}}if(stopped){logger[_0xae55('0x55')](_0xae55('0x8f'));_0x5f2069['abort']();}}catch(_0x2190af){handleError(_0x51a38d[_0xae55('0x7d')][_0x41031f],{'code':_0xae55('0x90'),'message':_0x2190af[_0xae55('0x57')]});logger['error'](_0xae55('0x91'),_0x2190af[_0xae55('0x57')]);}},'complete':function(){try{var _0x15233e=[];var _0x2d6ba3=[];var _0x4e91fe=_0xae55('0x2d');if(_0x22bdf3[_0xae55('0x92')]&&_0x22bdf3[_0xae55('0x92')][_0xae55('0x17')]){_0x4e91fe=_0xae55('0x93')+_0x1e7f1d;_0x15233e[_0xae55('0x1c')]('CREATE\x20TABLE\x20'+_0x4e91fe+_0xae55('0x94'));}tmp_campaigns='campaigns_'+_0x1e7f1d;tmp_voice_queues=_0xae55('0x95')+_0x1e7f1d;_0x2d6ba3[_0xae55('0x1c')](_0xae55('0x96')+tmp_campaigns+_0xae55('0x97'));_0x2d6ba3[_0xae55('0x1c')](_0xae55('0x96')+tmp_voice_queues+_0xae55('0x97'));BPromise[_0xae55('0x98')](_0x2d6ba3,handleTZQuery)[_0xae55('0x16')](function(_0x51f6ca){updateTzCampaigns(_0x22bdf3[_0xae55('0x27')])[_0xae55('0x16')](function(_0x486094){updateTzVoiceQueues(_0x22bdf3[_0xae55('0x27')])['then'](function(_0x5882ef){if(hasTZ)_0x49b523=_0x49b523['replace'](_0xae55('0x69'),'dialTimezone,utcOffset');var _0x4923e1=util['format'](_0xae55('0x99'),_0x96d4bc,_0x4e91fe,_0x49b523,_0x22bdf3[_0xae55('0x27')],_0x22bdf3[_0xae55('0x4e')]||null,NOW,NOW);if(_[_0xae55('0x1a')](_0x3ed7df[_0xae55('0x9a')])){_0x4923e1+=_0xae55('0x9b');}_0x15233e['push'](_0x4923e1);if(_0x22bdf3[_0xae55('0x92')]&&_0x22bdf3[_0xae55('0x92')][_0xae55('0x17')]){_0x15233e[_0xae55('0x1c')](insertCmContact(_0x22bdf3[_0xae55('0x27')],_0x4e91fe,_0x22bdf3[_0xae55('0x92')],_0x3ed7df));_0x15233e[_0xae55('0x1c')](_0xae55('0x9c')+_0x4e91fe+';');}BPromise['each'](_0x15233e,handleQuery)[_0xae55('0x16')](function(_0x281083){BPromise[_0xae55('0x18')]([handleAdditionalPhones()])[_0xae55('0x16')](function(){_0x15233e=[];for(var _0x3c8273=0x0;_0x3c8273\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding','firstName\x20is\x20mandatory','body\x20id\x20mandatory','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','length','push','all','then','split','isNil','CmContactHasItem','findOne','update','updated','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme'];(function(_0x2a7930,_0x578fcf){var _0x54136b=function(_0x28dcd4){while(--_0x28dcd4){_0x2a7930['push'](_0x2a7930['shift']());}};_0x54136b(++_0x578fcf);}(_0x6b09,0x1cf));var _0x96b0=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x6b09[_0x39f34f];return _0x59fee1;};'use strict';var fs=require('fs');var path=require(_0x96b0('0x0'));var _=require(_0x96b0('0x1'));var Papa=require(_0x96b0('0x2'));var util=require(_0x96b0('0x3'));var BPromise=require(_0x96b0('0x4'));var moment=require(_0x96b0('0x5'));var squel=require(_0x96b0('0x6'));var Redis=require(_0x96b0('0x7'));var db=require(_0x96b0('0x8'))['db'];var config=require(_0x96b0('0x9'));var shared=require(_0x96b0('0xa'));var logger=require('../../../config/logger')(_0x96b0('0xb'));config[_0x96b0('0xc')]=_[_0x96b0('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x96b0('0xe'))(new Redis(config[_0x96b0('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x96b0('0xf')](_0x96b0('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x96b0('0xf')](_0x96b0('0x10'));function isEmail(_0xe95a97){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))*$/[_0x96b0('0x11')](_0xe95a97);}function selectNotIn(_0x46c349,_0x40ecc9,_0x5b2340,_0xcd0540,_0x2ca735){return squel[_0x96b0('0x12')]()[_0x96b0('0x13')](_0x96b0('0x14'))[_0x96b0('0x15')](_0xcd0540)[_0x96b0('0x16')](_0x40ecc9,null,_0x40ecc9+_0x96b0('0x17')+_0xcd0540+'.'+_0x5b2340)[_0x96b0('0x18')](_0xcd0540+'.'+_0x5b2340+_0x96b0('0x19')+_0x46c349+'.'+_0x5b2340)[_0x96b0('0x18')](_0x40ecc9+_0x96b0('0x1a')+_0x2ca735[_0x96b0('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x347806,_0x1c4837){promisesAdditionalPhones=[];return db[_0x96b0('0x1b')][_0x96b0('0x1c')]({'raw':!![],'attributes':['id',_0x96b0('0x1d')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x2c2156){if(_0x2c2156!==null){var _0x24a15d=[];for(var _0x2b313f=0x0;_0x2b313f<_0x2c2156[_0x96b0('0x1e')];_0x2b313f++){var _0x5539db=_0x2c2156[_0x2b313f];_0x24a15d[_0x96b0('0x1f')](insertAdditionalPhones(_0x5539db));}}Promise[_0x96b0('0x20')](_0x24a15d)[_0x96b0('0x21')](function(){_0x347806({'val':0x1});});});});}function insertAdditionalPhones(_0x18ec96){return new Promise(function(_0x351614,_0x455d87){var _0x136d67=_0x18ec96[_0x96b0('0x1d')];var _0x4a0c9f=_0x136d67[_0x96b0('0x22')](';');var _0x3315e8=[];orderBy=0x0;for(var _0x34bfb7=0x0;_0x34bfb7<_0x4a0c9f['length'];_0x34bfb7++){_0x3315e8[_0x96b0('0x1f')](splitAdditionalPhone(_0x18ec96['id'],_0x4a0c9f[_0x34bfb7]));}Promise[_0x96b0('0x20')](_0x3315e8)[_0x96b0('0x21')](function(){_0x351614({'val':_0x4a0c9f[_0x96b0('0x1e')]});});});}function splitAdditionalPhone(_0x976791,_0x31c8a7){return new Promise(function(_0x3dbe20,_0x1cb992){var _0x3193e9=_0x31c8a7['split'](':');var _0x4df301=_0x3193e9[0x0];var _0x5aeb93=_0x3193e9[0x1];if(!_[_0x96b0('0x23')](_0x5aeb93)){var _0x48a866=_0x5aeb93[_0x96b0('0x22')]('|');var _0x14a98f=[];for(var _0x4152ba=0x0;_0x4152ba<_0x48a866[_0x96b0('0x1e')];_0x4152ba++){if(_0x48a866[_0x4152ba]!==''){var _0x54f7dc=_['filter'](promisesAdditionalPhones,{'contactId':_0x976791,'phone':_0x48a866[_0x4152ba]});if(_0x54f7dc['length']==0x0){orderBy++;promisesAdditionalPhones[_0x96b0('0x1f')]({'contactId':_0x976791,'contactTypeId':_0x4df301,'phone':_0x48a866[_0x4152ba],'orderBy':orderBy});}}}_0x3dbe20({'ok':0x1});}else _0x3dbe20({'res':0x0});});}function createAdditionalPhone(_0x4ffb0a,_0x3e8f97,_0x413d8d,_0x468b34){var _0x4961d4='';var _0xc18d3='';var _0x95f6ae=_0x413d8d[_0x96b0('0x22')]('§');_0x4961d4=_0x95f6ae[0x0];if(_0x95f6ae[_0x96b0('0x1e')]==0x2)_0xc18d3=_0x95f6ae[0x1];return new Promise(function(_0xf575e2,_0x327372){return db[_0x96b0('0x24')][_0x96b0('0x25')]({'where':{'CmContactId':_0x4ffb0a,'item':_0x4961d4}})['then'](function(_0x474fc2){if(_0x474fc2){return db[_0x96b0('0x24')][_0x96b0('0x26')]({'ItemTypeId':_0x3e8f97,'description':_0xc18d3,'OrderBy':_0x468b34},{'where':{'CmContactId':_0x4ffb0a,'item':_0x4961d4}})['then'](function(_0x136066){_0xf575e2({'res':_0x96b0('0x27')});});}else{return db[_0x96b0('0x24')]['create']({'CmContactId':_0x4ffb0a,'item':_0x4961d4,'description':_0xc18d3,'ItemTypeId':_0x3e8f97,'OrderBy':_0x468b34,'ItemClass':'PHONE'})[_0x96b0('0x21')](function(_0x55cbe4){_0xf575e2({'res':_0x96b0('0x28')});});}});});}function insertCmHopper(_0x13adb0,_0x14ced4,_0x521540,_0x2d82b9,_0x3c66fc){var _0x1c020d=[_0x96b0('0x29'),_0x96b0('0x2a'),_0x96b0('0x2b'),_0x96b0('0x2c'),_0x14ced4+'.'+_0x2d82b9,'cm_contacts.createdAt',_0x96b0('0x2d'),_0x96b0('0x2e'),_0x96b0('0x2f'),'\x22'+_0x3c66fc+'\x22'];return squel[_0x96b0('0x30')]()[_0x96b0('0x31')](_0x96b0('0x32'))[_0x96b0('0x33')](['phone','scheduledat',_0x96b0('0x34'),_0x96b0('0x35'),_0x2d82b9,_0x96b0('0x36'),_0x96b0('0x37'),_0x96b0('0x38'),_0x96b0('0x39'),_0x96b0('0x3a')],squel['select']()[_0x96b0('0x3b')](_0x1c020d)[_0x96b0('0x15')](_0x14ced4)[_0x96b0('0x16')]('cm_contacts',null,_0x96b0('0x3c')+_0x14ced4+'.CmListId')['join'](_0x521540,null,_0x521540+_0x96b0('0x17')+_0x14ced4+'.'+_0x2d82b9)[_0x96b0('0x18')](_0x14ced4+_0x96b0('0x3d'),_0x13adb0)[_0x96b0('0x18')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x96b0('0x18')](_0x96b0('0x3e'),selectNotIn(_0x14ced4,_0x521540,_0x2d82b9,_0x96b0('0x32'),[_0x96b0('0x3f'),'\x22onlyIfOpen\x22']))['where'](_0x96b0('0x3e'),selectNotIn(_0x14ced4,_0x521540,_0x2d82b9,_0x96b0('0x32'),[_0x96b0('0x3f')])))['toString']();}function insertCmHopperBlack(_0x3edf62,_0x354a99,_0x3568d9,_0x152583){var _0x29c573=[_0x96b0('0x29'),'cm_contacts.id',_0x96b0('0x2c'),_0x354a99+'.'+_0x152583,'cm_contacts.createdAt',_0x96b0('0x2d')];return squel['insert']()[_0x96b0('0x31')](_0x96b0('0x40'))['fromQuery']([_0x96b0('0x14'),_0x96b0('0x34'),_0x96b0('0x35'),_0x152583,'createdAt','updatedAt'],squel[_0x96b0('0x12')]()['fields'](_0x29c573)['from'](_0x354a99)['join'](_0x96b0('0x41'),null,_0x96b0('0x3c')+_0x354a99+'.CmListId')[_0x96b0('0x16')](_0x3568d9,null,_0x3568d9+_0x96b0('0x17')+_0x354a99+'.'+_0x152583)[_0x96b0('0x18')](_0x354a99+'.CmListId\x20=\x20?',_0x3edf62)['where'](_0x96b0('0x42'),NOW)[_0x96b0('0x18')](_0x96b0('0x3e'),squel[_0x96b0('0x12')]()[_0x96b0('0x13')](_0x96b0('0x14'))[_0x96b0('0x15')](_0x96b0('0x40'))[_0x96b0('0x18')]('ListId\x20=\x20?',_0x3edf62)[_0x96b0('0x18')](_0x152583+_0x96b0('0x19')+_0x354a99+'.'+_0x152583)))[_0x96b0('0x43')]();}function insertTzCmHopper(_0x20d773,_0x2a98fa,_0x3ab5e0,_0x16a6d3,_0x594b39,_0x1573c9){var _0x1d353e=['cm_contacts.phone',_0x96b0('0x44')+_0x1573c9+'.offset-cm_contacts.utcOffset\x20minute)',_0x96b0('0x2b'),_0x96b0('0x2c'),_0x2a98fa+'.'+_0x16a6d3,'cm_contacts.createdAt',_0x96b0('0x2d'),_0x96b0('0x2e'),'cm_contacts.UserId','\x22'+_0x594b39+'\x22'];var _0x15a113=squel[_0x96b0('0x30')]()[_0x96b0('0x31')]('cm_hopper')['fromQuery'](['phone','scheduledat',_0x96b0('0x34'),_0x96b0('0x35'),_0x16a6d3,_0x96b0('0x36'),'updatedAt',_0x96b0('0x38'),_0x96b0('0x39'),_0x96b0('0x3a')],squel[_0x96b0('0x12')]()[_0x96b0('0x3b')](_0x1d353e)[_0x96b0('0x15')](_0x2a98fa)[_0x96b0('0x16')](_0x96b0('0x41'),null,_0x96b0('0x3c')+_0x2a98fa+_0x96b0('0x45'))['join'](_0x3ab5e0,null,_0x3ab5e0+'.id\x20=\x20'+_0x2a98fa+'.'+_0x16a6d3)['join'](_0x1573c9,null,_0x1573c9+_0x96b0('0x17')+_0x2a98fa+'.'+_0x16a6d3)[_0x96b0('0x18')](_0x2a98fa+'.CmListId\x20=\x20?',_0x20d773)[_0x96b0('0x18')](_0x96b0('0x42'),NOW)[_0x96b0('0x18')](_0x96b0('0x3e'),selectNotIn(_0x2a98fa,_0x3ab5e0,_0x16a6d3,_0x96b0('0x32'),['\x22always\x22',_0x96b0('0x46')]))[_0x96b0('0x18')](_0x96b0('0x3e'),selectNotIn(_0x2a98fa,_0x3ab5e0,_0x16a6d3,'cm_hopper',['\x22always\x22'])))[_0x96b0('0x43')]();return _0x15a113;}function insertTzCmHopperBlack(_0xb7065c,_0x4d1343,_0x4e6059,_0x206ce7){var _0x90ff70=[_0x96b0('0x29'),_0x96b0('0x2b'),'cm_contacts.ListId',_0x4d1343+'.'+_0x206ce7,_0x96b0('0x47'),'cm_contacts.updatedAt'];return squel[_0x96b0('0x30')]()[_0x96b0('0x31')]('cm_hopper_black')['fromQuery']([_0x96b0('0x14'),'ContactId',_0x96b0('0x35'),_0x206ce7,_0x96b0('0x36'),'updatedAt'],squel[_0x96b0('0x12')]()[_0x96b0('0x3b')](_0x90ff70)[_0x96b0('0x15')](_0x4d1343)[_0x96b0('0x16')](_0x96b0('0x41'),null,_0x96b0('0x3c')+_0x4d1343+_0x96b0('0x45'))[_0x96b0('0x16')](_0x4e6059,null,_0x4e6059+_0x96b0('0x17')+_0x4d1343+'.'+_0x206ce7)[_0x96b0('0x18')](_0x4d1343+_0x96b0('0x3d'),_0xb7065c)[_0x96b0('0x18')](_0x96b0('0x42'),NOW)[_0x96b0('0x18')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x96b0('0x14'))['from']('cm_hopper_black')[_0x96b0('0x18')](_0x96b0('0x48'),_0xb7065c)[_0x96b0('0x18')](_0x206ce7+_0x96b0('0x19')+_0x4d1343+'.'+_0x206ce7)))['toString']();}function insertCmHopperAdditionalPhones(_0x3fe2e5){var _0x134b09=[_0x96b0('0x49'),'cm_contact_has_items.item',_0x96b0('0x4a'),_0x96b0('0x4b'),_0x96b0('0x4c')];return squel['insert']()['into'](_0x96b0('0x4d'))[_0x96b0('0x33')]([_0x96b0('0x4e'),'phone',_0x96b0('0x4f'),_0x96b0('0x36'),'updatedAt'],squel['select']()[_0x96b0('0x3b')](_0x134b09)['from']('cm_hopper')[_0x96b0('0x16')]('cm_contacts',null,_0x96b0('0x50'))['join']('cm_contact_has_items',null,_0x96b0('0x51'))['where'](_0x96b0('0x52'),_0x3fe2e5)['where'](_0x96b0('0x42'),NOW))['toString']();}function insertCmContact(_0x2f95a3,_0x22a414,_0x55ceda,_0xd98f1b){var _0x410bb0=_['concat'](_['keys'](_0xd98f1b),[_0x96b0('0x35'),'CompanyId',_0x96b0('0x36'),'updatedAt',_0x96b0('0x53')]);return squel['insert']()[_0x96b0('0x31')](_0x96b0('0x41'))[_0x96b0('0x33')](_0x410bb0,squel[_0x96b0('0x12')]()[_0x96b0('0x3b')](_0x410bb0)[_0x96b0('0x15')](_0x22a414)['where']('('+_0x55ceda['join'](',')+_0x96b0('0x54'),squel['select']()[_0x96b0('0x3b')](_0x55ceda)['from'](_0x96b0('0x41'))[_0x96b0('0x18')](_0x96b0('0x48'),_0x2f95a3)[_0x96b0('0x18')]('deletedAt\x20IS\x20NULL'))[_0x96b0('0x18')]('id\x20IN\x20?',squel['select']()['field']('MIN(id)',_0x96b0('0x55'))[_0x96b0('0x15')](_0x22a414)[_0x96b0('0x56')](_0x55ceda[_0x96b0('0x16')](','))))[_0x96b0('0x43')]();}function handleStop(){logger[_0x96b0('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x9df6c){logger[_0x96b0('0x58')](_0x9df6c[_0x96b0('0x59')]);process[_0x96b0('0x5a')](0x1);}function handleError(_0x136b72,_0x5dd465){stats[_0x96b0('0x5b')][_0x96b0('0x1f')]({'name':_0x5dd465[_0x96b0('0x5c')],'message':_0x5dd465[_0x96b0('0x59')],'row':_0x136b72});}function handleQuery(_0x417491){logger[_0x96b0('0x57')](_0x417491);return db[_0x96b0('0x5d')][_0x96b0('0x5e')](_0x417491)[_0x96b0('0x5f')](function(_0x146d91){results[_0x96b0('0x1f')](_0x146d91);})['catch'](function(_0x11a7eb){logger[_0x96b0('0x58')](_0x11a7eb[_0x96b0('0x59')]);});}function updateTzCampaigns(_0x72ad7e){return new Promise(function(_0x29eeb2,_0x4ca401){var _0x1171e1=squel[_0x96b0('0x12')]()[_0x96b0('0x3b')]([_0x96b0('0x60'),_0x96b0('0x61')])[_0x96b0('0x15')]('campaigns')[_0x96b0('0x16')](_0x96b0('0x62'),null,_0x96b0('0x63'))[_0x96b0('0x18')](_0x96b0('0x64')+_0x72ad7e);db[_0x96b0('0x5d')][_0x96b0('0x5e')](_0x1171e1[_0x96b0('0x43')]())[_0x96b0('0x5f')](function(_0x111be0){var _0x309c58=[];for(var _0x2884da=0x0;_0x2884da<_0x111be0[_0x96b0('0x1e')];_0x2884da++){_0x309c58[_0x96b0('0x1f')](getTimezoneData(_0x111be0[_0x2884da],tmp_campaigns));}BPromise[_0x96b0('0x20')](_0x309c58)[_0x96b0('0x21')](function(){_0x29eeb2({'val':0x1});});})['catch'](function(_0x5742a9){logger['error'](_0x5742a9[_0x96b0('0x59')]);_0x29eeb2({'val':0x0});});});}function updateTzVoiceQueues(_0x3bec6b){return new Promise(function(_0x41523b,_0x511f8f){var _0x15eb6d=squel[_0x96b0('0x12')]()[_0x96b0('0x3b')]([_0x96b0('0x65'),'voice_queues.dialTimezone'])[_0x96b0('0x15')](_0x96b0('0x66'))[_0x96b0('0x16')](_0x96b0('0x67'),null,_0x96b0('0x68'))[_0x96b0('0x18')](_0x96b0('0x69')+_0x3bec6b);db[_0x96b0('0x5d')][_0x96b0('0x5e')](_0x15eb6d[_0x96b0('0x43')]())[_0x96b0('0x5f')](function(_0x19fb34){var _0x83e95c=[];for(var _0x38a851=0x0;_0x38a851<_0x19fb34[_0x96b0('0x1e')];_0x38a851++){_0x83e95c[_0x96b0('0x1f')](getTimezoneData(_0x19fb34[_0x38a851],tmp_voice_queues));}BPromise[_0x96b0('0x20')](_0x83e95c)[_0x96b0('0x21')](function(){_0x41523b({'val':0x1});});})[_0x96b0('0x6a')](function(_0x5c5340){logger['error'](_0x5c5340[_0x96b0('0x59')]);_0x41523b({'val':0x0});});});}function getTimezoneData(_0x3855c9,_0x27b891){return new Promise(function(_0x37e234,_0xca6bc8){var _0x43978a=shared['timezones'];var _0x139b65=_0x43978a[_0x3855c9[_0x96b0('0x6b')]];if(_['isNil'](_0x139b65)){_0x37e234({'ret':0x1});}else{var _0x2ad280=_0x139b65['utcOffset'];var _0x2387a8=squel[_0x96b0('0x30')]()['into'](_0x27b891)['set']('id',_0x3855c9['id'])[_0x96b0('0x6c')](_0x96b0('0x6d'),_0x2ad280)[_0x96b0('0x6c')](_0x96b0('0x6b'),_0x3855c9[_0x96b0('0x6b')])[_0x96b0('0x43')]();return db[_0x96b0('0x5d')][_0x96b0('0x5e')](_0x2387a8)['spread'](function(_0x27b592){_0x37e234({'ret':0x1});})['catch'](function(_0x4c699c){logger[_0x96b0('0x58')](_0x4c699c[_0x96b0('0x59')]);_0xca6bc8({'ret':0x1});});}});}function handleTZQuery(_0x2953b5){logger['info'](_0x2953b5);return db[_0x96b0('0x5d')][_0x96b0('0x5e')](_0x2953b5)[_0x96b0('0x5f')](function(_0x387cc5){})[_0x96b0('0x6a')](function(_0x27144a){logger[_0x96b0('0x58')](_0x27144a[_0x96b0('0x59')]);});}function main(_0x4a3817,_0xb2f015,_0x22689b,_0x35f8ca){logger[_0x96b0('0x57')]('main',_0x4a3817,JSON[_0x96b0('0x6e')](_0xb2f015));process[_0x96b0('0x6f')](_0x96b0('0x70'));var _0xe33689=_0xb2f015['binding'];var _0x3c4963=_[_0x96b0('0x71')](_0xe33689);var _0x531a2d=_0xb2f015[_0x96b0('0x72')];var _0x2e2adb=path[_0x96b0('0x16')](config[_0x96b0('0x73')],_0x96b0('0x74'),_0x531a2d+_0x96b0('0x75'));hasTZ=_[_0x96b0('0x76')](_0xe33689)[_0x96b0('0x77')]('dialTimezone');var _0xf21f=_[_0x96b0('0x76')](_0xe33689)['join']();logger[_0x96b0('0x57')]('header',_0xf21f);db[_0x96b0('0x78')]['findAll']({'raw':!![],'attributes':['id',_0x96b0('0x79')]})[_0x96b0('0x21')](function(_0x66d4e0){for(var _0x1e7e9d=0x0;_0x1e7e9d<_0x66d4e0[_0x96b0('0x1e')];_0x1e7e9d++){if(_0x66d4e0[_0x1e7e9d][_0x96b0('0x79')]in _0xe33689){contactItemTypes[_0x96b0('0x1f')](_0x66d4e0[_0x1e7e9d]);delete _0x3c4963[_0x66d4e0[_0x1e7e9d][_0x96b0('0x79')]];hasAdditionalPhones=!![];}for(var _0x1770aa in _0xe33689){if(_0x66d4e0[_0x1e7e9d][_0x96b0('0x79')]+_0x96b0('0x7a')===_0x1770aa){phoneDescriptions['push']({'itemTypeId':_0x66d4e0[_0x1e7e9d]['id'],'description':_0x1770aa});delete _0x3c4963[_0x1770aa];}}}if(hasAdditionalPhones)_0x3c4963[_0x96b0('0x1d')]='';var _0x4129ea=_[_0x96b0('0x76')](_0x3c4963)[_0x96b0('0x16')]();logger['info']('header',_0x4129ea);fs['writeFileSync'](_0x2e2adb,_0x4129ea+'\x0a');Papa[_0x96b0('0x7b')](fs[_0x96b0('0x7c')](_0x4a3817),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2519ea,_0x5085b9){try{for(var _0x7ec621=0x0,_0x387dc1=[];_0x7ec621<_0x2519ea[_0x96b0('0x7d')][_0x96b0('0x1e')];_0x7ec621++){stats[_0x96b0('0x7e')]+=0x1;if(_0x2519ea[_0x96b0('0x5b')][_0x7ec621]){handleError(_0x2519ea[_0x96b0('0x7d')][_0x7ec621],_0x2519ea['errors'][_0x7ec621]);}else{var _0x21a2e1=[];var _0x5768cc=[];var _0xcc7590={};for(var _0x452795 in _0xe33689){let _0x2fa548=contactItemTypes[_0x96b0('0x7f')](_0x426228=>_0x426228[_0x96b0('0x79')]===_0x452795);let _0x2cb7a3=contactItemTypes['find'](_0x4fe494=>_0x4fe494[_0x96b0('0x79')]+_0x96b0('0x7a')===_0x452795);if(_[_0x96b0('0x23')](_0x2fa548)&&_['isNil'](_0x2cb7a3)){if(_0xe33689['hasOwnProperty'](_0x452795)){if(_0x2519ea[_0x96b0('0x7d')][_0x7ec621][_0xe33689[_0x452795]]){var _0xd4650=_[_0x96b0('0x80')](_0x2519ea[_0x96b0('0x7d')][_0x7ec621][_0xe33689[_0x452795]][_0x96b0('0x81')](/"/g,'\x27'));switch(_0x452795){case _0x96b0('0x82'):var _0x22fb2e=moment(_0xd4650,_0x96b0('0x10'),!![]);if(_0x22fb2e[_0x96b0('0x83')]()){_0x387dc1['push']('\x22'+_0xd4650+'\x22');}else{_0x21a2e1[_0x96b0('0x1f')](_0x96b0('0x84'));}break;case'priority':var _0x4d2a87=parseInt(_0xd4650);_0xd4650=_[_0x96b0('0x85')](_0x4d2a87)||_0x4d2a87<0x0||_0x4d2a87>0x4?_0x35f8ca?0x3:0x2:_0x4d2a87;_0x387dc1[_0x96b0('0x1f')]('\x22'+_0xd4650+'\x22');break;case'UserId':var _0x53ba77=parseInt(_0xd4650);if(_['isNumber'](_0x53ba77)&&_['includes'](_0x22689b,_0x53ba77)){_0x387dc1[_0x96b0('0x1f')]('\x22'+_0x53ba77+'\x22');}else{_0x21a2e1['push'](_0x96b0('0x86'));}break;case _0x96b0('0x87'):if(isEmail(_0xd4650)){_0x387dc1[_0x96b0('0x1f')]('\x22'+_0xd4650+'\x22');}else{_0x21a2e1[_0x96b0('0x1f')](_0x96b0('0x88'));}break;case'dateOfBirth':var _0x425d49=moment(_0xd4650,'YYYY-MM-DD',!![]);if(_0x425d49['isValid']()){_0x387dc1[_0x96b0('0x1f')]('\x22'+_0xd4650+'\x22');}else{_0x21a2e1[_0x96b0('0x1f')](_0x96b0('0x89'));}break;case _0x96b0('0x6b'):var _0xc03ff3=shared['timezones'];var _0x584778=_0xc03ff3[_0xd4650];if(!_[_0x96b0('0x23')](_0x584778)){var _0x2a3213=_0x584778[_0x96b0('0x8a')];_0x387dc1[_0x96b0('0x1f')]('\x22'+_0xd4650+'\x22');_0x387dc1[_0x96b0('0x1f')]('\x22'+_0x2a3213+'\x22');}break;default:_0x387dc1[_0x96b0('0x1f')]('\x22'+_0xd4650+'\x22');}}else{switch(_0x452795){case _0x96b0('0x8b'):case _0x96b0('0x14'):_0x21a2e1[_0x96b0('0x1f')](_0x452795+_0x96b0('0x8c'));break;default:_0x387dc1[_0x96b0('0x1f')]('\x22\x22');}}}}else{var _0x20d418='';if(!_[_0x96b0('0x23')](_0x2fa548)){if(!_0xcc7590[_0x96b0('0x8d')](_0x2fa548['id'])){if(!_[_0x96b0('0x23')](_0x2519ea[_0x96b0('0x7d')][_0x7ec621][_0xe33689[_0x452795]])){var _0xd4650=_['trim'](_0x2519ea['data'][_0x7ec621][_0xe33689[_0x452795]][_0x96b0('0x81')](/"/g,'\x27'));var _0x37870b=phoneDescriptions[_0x96b0('0x7f')](_0x15582b=>_0x15582b['itemTypeId']===_0x2fa548['id']);if(!_['isNil'](_0x37870b)){var _0x502994=_[_0x96b0('0x80')](_0x2519ea[_0x96b0('0x7d')][_0x7ec621][_0xe33689[_0x37870b['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x502994))_0xd4650=_0xd4650+'§'+_0x502994;}if(_0x20d418=='')_0x20d418=_0xd4650;else _0x20d418+='|'+_0xd4650;}_0x5768cc[_0x96b0('0x1f')](_0x2fa548['id']+':'+_0x20d418);_0xcc7590[_0x2fa548['id']]=0x1;}}}}if(hasAdditionalPhones){_0x387dc1[_0x96b0('0x1f')]('\x22'+_0x5768cc[_0x96b0('0x16')](';')+'\x22');}if(_0x21a2e1[_0x96b0('0x1e')]){handleError(_0x2519ea[_0x96b0('0x7d')][_0x7ec621],{'code':'SystemRow','message':_0x21a2e1[_0x96b0('0x16')]()});}else{fs['appendFileSync'](_0x2e2adb,_0x387dc1[_0x96b0('0x16')]()+'\x0a');}_0x387dc1=[];}if(!(stats[_0x96b0('0x7e')]%0xc8)){socket[_0x96b0('0x8e')]('contact:import:'+_0x531a2d,stats);stats[_0x96b0('0x5b')]=[];}}if(stopped){logger[_0x96b0('0x57')](_0x96b0('0x8f'));_0x5085b9['abort']();}}catch(_0x5dcfba){handleError(_0x2519ea[_0x96b0('0x7d')][_0x7ec621],{'code':_0x96b0('0x90'),'message':_0x5dcfba[_0x96b0('0x59')]});logger['error'](_0x96b0('0x91'),_0x5dcfba[_0x96b0('0x59')]);}},'complete':function(){try{var _0x4652df=[];var _0xa2f444=[];var _0x38306d=_0x96b0('0x41');if(_0xb2f015['duplicates']&&_0xb2f015[_0x96b0('0x92')][_0x96b0('0x1e')]){_0x38306d='cm_contacts_'+_0x531a2d;_0x4652df[_0x96b0('0x1f')](_0x96b0('0x93')+_0x38306d+_0x96b0('0x94'));}tmp_campaigns='campaigns_'+_0x531a2d;tmp_voice_queues=_0x96b0('0x95')+_0x531a2d;_0xa2f444[_0x96b0('0x1f')](_0x96b0('0x93')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0xa2f444['push']('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x96b0('0x96')](_0xa2f444,handleTZQuery)[_0x96b0('0x21')](function(_0x21b972){updateTzCampaigns(_0xb2f015['ListId'])[_0x96b0('0x21')](function(_0x46fe18){updateTzVoiceQueues(_0xb2f015[_0x96b0('0x35')])[_0x96b0('0x21')](function(_0x579865){if(hasTZ)_0x4129ea=_0x4129ea[_0x96b0('0x81')]('dialTimezone','dialTimezone,utcOffset');var _0x193428=util[_0x96b0('0xf')](_0x96b0('0x97'),_0x2e2adb,_0x38306d,_0x4129ea,_0xb2f015[_0x96b0('0x35')],_0xb2f015[_0x96b0('0x98')]||null,NOW,NOW);if(_[_0x96b0('0x23')](_0xe33689[_0x96b0('0x82')])){_0x193428+=_0x96b0('0x99');}_0x4652df['push'](_0x193428);if(_0xb2f015[_0x96b0('0x92')]&&_0xb2f015[_0x96b0('0x92')][_0x96b0('0x1e')]){_0x4652df['push'](insertCmContact(_0xb2f015[_0x96b0('0x35')],_0x38306d,_0xb2f015['duplicates'],_0xe33689));_0x4652df[_0x96b0('0x1f')](_0x96b0('0x9a')+_0x38306d+';');}BPromise[_0x96b0('0x96')](_0x4652df,handleQuery)[_0x96b0('0x21')](function(_0x118aeb){BPromise[_0x96b0('0x20')]([handleAdditionalPhones()])['then'](function(){_0x4652df=[];for(var _0x31b16b=0x0;_0x31b16b_0x1b6e02['name']===_0x5e72e0);let _0x7bf5b9=contactItemTypes[_0xaf3d('0x70')](_0x5252dd=>_0x5252dd['name']+_0xaf3d('0x71')===_0x5e72e0);if(_['isNil'](_0x48e43b)&&_[_0xaf3d('0x1d')](_0x7bf5b9)){if(_0x4f379c['hasOwnProperty'](_0x5e72e0)){if(_0x2e6dfe[_0xaf3d('0x6f')][_0x963fc3][_0x4f379c[_0x5e72e0]]){var _0x5b2095=_[_0xaf3d('0x72')](_0x2e6dfe['data'][_0x963fc3][_0x4f379c[_0x5e72e0]][_0xaf3d('0x73')](/"/g,'\x27'));switch(_0x5e72e0){case _0xaf3d('0x34'):var _0x206398=moment(_0x5b2095,_0xaf3d('0xf'),!![]);if(_0x206398[_0xaf3d('0x74')]()){_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x5b2095+'\x22');}else{_0x2437a6[_0xaf3d('0x1f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xaf3d('0x37'):var _0x4a1698=parseInt(_0x5b2095);_0x5b2095=_[_0xaf3d('0x75')](_0x4a1698)||_0x4a1698<0x0||_0x4a1698>0x4?_0x18470e?0x3:0x2:_0x4a1698;_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x5b2095+'\x22');break;case _0xaf3d('0x38'):var _0x557062=parseInt(_0x5b2095);if(_[_0xaf3d('0x76')](_0x557062)&&_['includes'](_0x104920,_0x557062)){_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x557062+'\x22');}else{_0x2437a6['push'](_0xaf3d('0x77'));}break;case'email':if(isEmail(_0x5b2095)){_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x5b2095+'\x22');}else{_0x2437a6['push']('email\x20wrong\x20format');}break;case _0xaf3d('0x78'):var _0x3a49a7=moment(_0x5b2095,_0xaf3d('0x79'),!![]);if(_0x3a49a7[_0xaf3d('0x74')]()){_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x5b2095+'\x22');}else{_0x2437a6[_0xaf3d('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x29efd8[_0xaf3d('0x1f')]('\x22'+_0x5b2095+'\x22');}}else{switch(_0x5e72e0){case'firstName':case _0xaf3d('0x14'):_0x2437a6[_0xaf3d('0x1f')](_0x5e72e0+'\x20not\x20specified');break;default:_0x29efd8['push']('\x22\x22');}}}}else{var _0x3647fd='';if(!_[_0xaf3d('0x1d')](_0x48e43b)){if(!_0x17a3ad[_0xaf3d('0x7a')](_0x48e43b['id'])){for(var _0x46c29b=0x0;_0x46c29b<_0x4f379c[_0x5e72e0]['length'];_0x46c29b++){var _0x5b2095=_[_0xaf3d('0x72')](_0x2e6dfe['data'][_0x963fc3][_0x4f379c[_0x5e72e0][_0x46c29b]][_0xaf3d('0x73')](/"/g,'\x27'));var _0x4adcbf=phoneDescriptions[_0xaf3d('0x70')](_0x1ace04=>_0x1ace04[_0xaf3d('0x7b')]===_0x48e43b['id']);if(!_[_0xaf3d('0x1d')](_0x4adcbf)){var _0xf8c082=_['trim'](_0x2e6dfe['data'][_0x963fc3][_0x4f379c[_0x4adcbf[_0xaf3d('0x7c')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xaf3d('0x1d')](_0xf8c082))_0x5b2095=_0x5b2095+'§'+_0xf8c082;}if(_0x3647fd=='')_0x3647fd=_0x5b2095;else _0x3647fd+='|'+_0x5b2095;}_0x7bd2ad[_0xaf3d('0x1f')](_0x48e43b['id']+':'+_0x3647fd);_0x17a3ad[_0x48e43b['id']]=0x1;}}}}if(hasAdditionalPhones){_0x29efd8['push']('\x22'+_0x7bd2ad['join'](';')+'\x22');}if(_0x2437a6['length']){handleError(_0x2e6dfe[_0xaf3d('0x6f')][_0x963fc3],{'code':_0xaf3d('0x7d'),'message':_0x2437a6[_0xaf3d('0x16')]()});}else{fs[_0xaf3d('0x7e')](_0x1d62f0,_0x29efd8['join']()+'\x0a');}_0x29efd8=[];}if(!(stats[_0xaf3d('0x6e')]%0xc8)){socket['emit'](_0xaf3d('0x7f')+_0x144a6e,stats);stats[_0xaf3d('0x5e')]=[];}}if(stopped){logger[_0xaf3d('0x5a')](_0xaf3d('0x80'));_0x1da60f['abort']();}}catch(_0xf5f63e){handleError(_0x2e6dfe[_0xaf3d('0x6f')][_0x963fc3],{'code':'SystemError','message':_0xf5f63e[_0xaf3d('0x5c')]});logger['error'](_0xaf3d('0x81'),_0xf5f63e[_0xaf3d('0x5c')]);}},'complete':function(){try{var _0x49be3b=[];var _0x482341=tempTableName;_0x49be3b[_0xaf3d('0x1f')](_0xaf3d('0x82')+_0x482341+_0xaf3d('0x83'));logger[_0xaf3d('0x5a')](_0xaf3d('0x84'),contactItemTypes[_0xaf3d('0x1c')]);var _0x486bae=util[_0xaf3d('0xe')](_0xaf3d('0x85'),_0x1d62f0,_0x482341,_0x221478,_0x1633ab[_0xaf3d('0x35')],_0x1633ab[_0xaf3d('0x86')]||null,NOW,NOW);if(_[_0xaf3d('0x1d')](_0x4f379c[_0xaf3d('0x34')])){_0x486bae+=_0xaf3d('0x87');}_0x49be3b[_0xaf3d('0x1f')](_0x486bae);BPromise['each'](_0x49be3b,handleQuery)[_0xaf3d('0x20')](function(_0x540cd9){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x49be3b=[];for(var _0x5759d2=0x0;_0x5759d2\x20\x20');}var _0x4ce891=path['join'](config['root'],_0xaf3d('0x66'),process['argv'][0x2]);if(!fs[_0xaf3d('0x91')](_0x4ce891)){throw new Error(_0xaf3d('0x92'));}var _0x51cd96={};try{_0x51cd96=JSON[_0xaf3d('0x93')](process[_0xaf3d('0x90')][0x3]);if(!_0x51cd96[_0xaf3d('0x64')]){throw new Error(_0xaf3d('0x94'));}var _0x17d604=0x0;if(_0x51cd96[_0xaf3d('0x64')]['UserId']){_0x17d604=0x1;}if(!_0x51cd96[_0xaf3d('0x35')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x41b339){throw new Error(_0xaf3d('0x95'));}var _0x5185a6=[];try{_0x5185a6=_['map'](JSON[_0xaf3d('0x93')](process['argv'][0x4]),'id');}catch(_0x4f726a){logger[_0xaf3d('0x5a')](_0xaf3d('0x96'));}main(_0x4ce891,_0x51cd96,_0x5185a6,_0x17d604);}validate();process['on'](_0xaf3d('0x97'),handleStop);process['on'](_0xaf3d('0x98'),handleUncaughtException); \ No newline at end of file +var _0xcd6f=['main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','_description','keys','header','parse','createReadStream','rows','errors','data','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','itemTypeId','description','contact:import:','Abort\x20parser','abort','SystemError','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','orderBy','finish','affectedRows','emit','unlink','exit','catch','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','isNil','push','all','then','message','AdditionalPhones','split','CmContactHasItem','findOne','updated','create','PHONE','inserted','CmContact','update','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','cm_hopper','\x22always\x22','toString','cm_hopper_black','updatedAt','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','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','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','error','code','spread'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x27702c,_0xad309d){_0x27702c=_0x27702c-0x0;var _0xc775ad=_0xcd6f[_0x27702c];return _0xc775ad;};'use strict';var fs=require('fs');var path=require(_0xfcd6('0x0'));var _=require(_0xfcd6('0x1'));var Papa=require(_0xfcd6('0x2'));var util=require(_0xfcd6('0x3'));var BPromise=require(_0xfcd6('0x4'));var moment=require(_0xfcd6('0x5'));var squel=require('squel');var Redis=require(_0xfcd6('0x6'));var db=require(_0xfcd6('0x7'))['db'];var config=require(_0xfcd6('0x8'));var logger=require(_0xfcd6('0x9'))('import');config[_0xfcd6('0xa')]=_['defaults'](config[_0xfcd6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcd6('0xb'))(new Redis(config[_0xfcd6('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()['format'](_0xfcd6('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0xfcd6('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x4c2eb7){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'](_0x4c2eb7);}function selectNotIn(_0x43b053,_0x550f2b,_0x519cd5,_0x2a1666,_0xcc5317){return squel['select']()[_0xfcd6('0xe')](_0xfcd6('0xf'))[_0xfcd6('0x10')](_0x2a1666)[_0xfcd6('0x11')](_0x550f2b,null,_0x550f2b+_0xfcd6('0x12')+_0x2a1666+'.'+_0x519cd5)[_0xfcd6('0x13')](_0x2a1666+'.'+_0x519cd5+_0xfcd6('0x14')+_0x43b053+'.'+_0x519cd5)[_0xfcd6('0x13')](_0x550f2b+_0xfcd6('0x15')+_0xcc5317[_0xfcd6('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x19d98e,_0x2b4344){promisesAdditionalPhones=[];promisesContact=[];return db[_0xfcd6('0x16')][_0xfcd6('0x17')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0xc53a5c){if(_0xc53a5c!==null){var _0x2ae7f4=[];for(var _0x56756f=0x0;_0x56756f<_0xc53a5c[_0xfcd6('0x18')];_0x56756f++){var _0x3bb44a=_0xc53a5c[_0x56756f];if(!_[_0xfcd6('0x19')](_0x3bb44a[_0xfcd6('0xf')])){if(!_['isNil'](_0x3bb44a['AdditionalPhones']))_0x2ae7f4[_0xfcd6('0x1a')](insertAdditionalPhones(_0x3bb44a));promisesContact[_0xfcd6('0x1a')]({'contact':_0x3bb44a});}}}Promise[_0xfcd6('0x1b')](_0x2ae7f4)[_0xfcd6('0x1c')](function(){_0x19d98e({'val':0x1});});})['catch'](function(_0x123131){logger['error'](_0x123131[_0xfcd6('0x1d')]);});});}function insertAdditionalPhones(_0x934caf){return new Promise(function(_0x30a53b,_0x2792e4){var _0x42d685=_0x934caf[_0xfcd6('0x1e')];if(_[_0xfcd6('0x19')](_0x42d685))_0x2792e4({'val':0x0});else{var _0x471758=_0x42d685[_0xfcd6('0x1f')](';');var _0x4b2d32=[];orderBy=0x0;for(var _0x3d5cdf=0x0;_0x3d5cdf<_0x471758['length'];_0x3d5cdf++){_0x4b2d32[_0xfcd6('0x1a')](splitAdditionalPhone(_0x934caf['id'],_0x471758[_0x3d5cdf]));}Promise[_0xfcd6('0x1b')](_0x4b2d32)['then'](function(){_0x30a53b({'val':_0x471758[_0xfcd6('0x18')]});});}});}function splitAdditionalPhone(_0x44bc67,_0x23a6ca){return new Promise(function(_0x3fa274,_0x62c7d5){var _0x23b36b=_0x23a6ca['split'](':');var _0x26a91b=_0x23b36b[0x0];var _0x584c05=_0x23b36b[0x1];if(_0x584c05!==''){var _0x24ec43=_0x584c05[_0xfcd6('0x1f')]('|');var _0x1e576a=[];for(var _0x1e3402=0x0;_0x1e3402<_0x24ec43['length'];_0x1e3402++){if(_0x24ec43[_0x1e3402]!==''){var _0x4af752=_['filter'](promisesAdditionalPhones,{'contactId':_0x44bc67,'phone':_0x24ec43[_0x1e3402]});if(_0x4af752['length']==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x44bc67,'contactTypeId':_0x26a91b,'phone':_0x24ec43[_0x1e3402],'orderBy':orderBy});}}}_0x3fa274({'ok':0x1});}else _0x3fa274({'res':0x0});});}function createAdditionalPhone(_0x3c9620,_0xa5f72d,_0x578fd3,_0x5a0079){var _0x13c5b0='';var _0x150c63='';var _0x17e235=_0x578fd3[_0xfcd6('0x1f')]('§');_0x13c5b0=_0x17e235[0x0];if(_0x17e235[_0xfcd6('0x18')]==0x2)_0x150c63=_0x17e235[0x1];return new Promise(function(_0x15e459,_0x49dc2d){return db[_0xfcd6('0x20')][_0xfcd6('0x21')]({'where':{'CmContactId':_0x3c9620,'item':_0x13c5b0}})[_0xfcd6('0x1c')](function(_0x110b51){if(_0x110b51){return db[_0xfcd6('0x20')]['update']({'ItemTypeId':_0xa5f72d,'description':_0x150c63,'OrderBy':_0x5a0079},{'where':{'CmContactId':_0x3c9620,'item':_0x13c5b0}})['then'](function(_0x8098fc){_0x15e459({'res':_0xfcd6('0x22')});});}else{return db[_0xfcd6('0x20')][_0xfcd6('0x23')]({'CmContactId':_0x3c9620,'item':_0x13c5b0,'ItemTypeId':_0xa5f72d,'description':_0x150c63,'OrderBy':_0x5a0079,'ItemClass':_0xfcd6('0x24')})['then'](function(_0x489129){_0x15e459({'res':_0xfcd6('0x25')});});}});});}function updateContact(_0x312fde){return new Promise(function(_0x5719f0,_0xc8f840){var _0x94291a=_0x312fde['id'];delete _0x312fde['id'];return db[_0xfcd6('0x26')][_0xfcd6('0x27')](_0x312fde,{'where':{'id':_0x94291a}})[_0xfcd6('0x1c')](function(_0x174d4a){updatedRows+=0x1;return db[_0xfcd6('0x28')]['update']({'phone':_0x312fde['phone']},{'where':{'ContactId':_0x94291a}})[_0xfcd6('0x1c')](function(_0x30afe2){_0x5719f0({'ret':'OK'});});});});}function insertCmHopper(_0x5c4883,_0x4e9bf6,_0x528ec0,_0x1b9011,_0x18cfe5){var _0x563448=['cm_contacts.phone',_0xfcd6('0x29'),_0xfcd6('0x2a'),_0xfcd6('0x2b'),_0x4e9bf6+'.'+_0x1b9011,_0xfcd6('0x2c'),'cm_contacts.updatedAt',_0xfcd6('0x2d'),_0xfcd6('0x2e'),'\x22'+_0x18cfe5+'\x22'];return squel[_0xfcd6('0x2f')]()[_0xfcd6('0x30')]('cm_hopper')[_0xfcd6('0x31')]([_0xfcd6('0xf'),_0xfcd6('0x32'),_0xfcd6('0x33'),_0xfcd6('0x34'),_0x1b9011,_0xfcd6('0x35'),'updatedAt',_0xfcd6('0x36'),_0xfcd6('0x37'),'recallme'],squel[_0xfcd6('0x38')]()[_0xfcd6('0x39')](_0x563448)['from'](_0x4e9bf6)['join'](_0xfcd6('0x3a'),null,_0xfcd6('0x3b')+_0x4e9bf6+_0xfcd6('0x3c'))[_0xfcd6('0x11')](_0x528ec0,null,_0x528ec0+_0xfcd6('0x12')+_0x4e9bf6+'.'+_0x1b9011)[_0xfcd6('0x13')](_0x4e9bf6+'.CmListId\x20=\x20?',_0x5c4883)[_0xfcd6('0x13')](_0xfcd6('0x3d'),NOW)['where'](_0xfcd6('0x3e'),selectNotIn(_0x4e9bf6,_0x528ec0,_0x1b9011,'cm_hopper',['\x22always\x22',_0xfcd6('0x3f')]))[_0xfcd6('0x13')](_0xfcd6('0x3e'),selectNotIn(_0x4e9bf6,_0x528ec0,_0x1b9011,_0xfcd6('0x40'),[_0xfcd6('0x41')])))[_0xfcd6('0x42')]();}function insertCmHopperBlack(_0xef448e,_0x2321e6,_0x3cb6a7,_0xceca99){var _0x1cb53d=['cm_contacts.phone',_0xfcd6('0x2a'),_0xfcd6('0x2b'),_0x2321e6+'.'+_0xceca99,_0xfcd6('0x2c'),'cm_contacts.updatedAt'];return squel['insert']()[_0xfcd6('0x30')](_0xfcd6('0x43'))[_0xfcd6('0x31')]([_0xfcd6('0xf'),_0xfcd6('0x33'),'ListId',_0xceca99,_0xfcd6('0x35'),_0xfcd6('0x44')],squel['select']()[_0xfcd6('0x39')](_0x1cb53d)[_0xfcd6('0x10')](_0x2321e6)[_0xfcd6('0x11')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x2321e6+_0xfcd6('0x3c'))['join'](_0x3cb6a7,null,_0x3cb6a7+_0xfcd6('0x12')+_0x2321e6+'.'+_0xceca99)[_0xfcd6('0x13')](_0x2321e6+_0xfcd6('0x45'),_0xef448e)['where'](_0xfcd6('0x3d'),NOW)[_0xfcd6('0x13')](_0xfcd6('0x3e'),squel[_0xfcd6('0x38')]()['field'](_0xfcd6('0xf'))[_0xfcd6('0x10')](_0xfcd6('0x43'))[_0xfcd6('0x13')](_0xfcd6('0x46'),_0xef448e)[_0xfcd6('0x13')](_0xceca99+_0xfcd6('0x47'),_0x2321e6+'.'+_0xceca99)))[_0xfcd6('0x42')]();}function insertCmHopperAdditionalPhones(_0x32f5f1){var _0x2df914=[_0xfcd6('0x48'),'cm_contact_has_items.item',_0xfcd6('0x49'),_0xfcd6('0x4a'),_0xfcd6('0x4b')];return squel['insert']()[_0xfcd6('0x30')](_0xfcd6('0x4c'))[_0xfcd6('0x31')]([_0xfcd6('0x4d'),_0xfcd6('0xf'),_0xfcd6('0x4e'),_0xfcd6('0x35'),_0xfcd6('0x44')],squel[_0xfcd6('0x38')]()[_0xfcd6('0x39')](_0x2df914)[_0xfcd6('0x10')](_0xfcd6('0x40'))['join'](_0xfcd6('0x3a'),null,_0xfcd6('0x4f'))['join'](_0xfcd6('0x50'),null,_0xfcd6('0x51'))[_0xfcd6('0x13')]('cm_hopper.ListId\x20=\x20?',_0x32f5f1)[_0xfcd6('0x13')](_0xfcd6('0x3d'),NOW))[_0xfcd6('0x42')]();}function insertCmContact(_0x55b102,_0xc13a33,_0x516a66,_0x5a7ffa){var _0x1a7d2d=_[_0xfcd6('0x52')](_['keys'](_0x5a7ffa),[_0xfcd6('0x34'),_0xfcd6('0x53'),_0xfcd6('0x35'),_0xfcd6('0x44')]);return squel[_0xfcd6('0x2f')]()['into'](_0xfcd6('0x3a'))[_0xfcd6('0x31')](_0x1a7d2d,squel['select']()[_0xfcd6('0x39')](_0x1a7d2d)['from'](_0xc13a33)[_0xfcd6('0x13')]('('+_0x516a66[_0xfcd6('0x11')](',')+_0xfcd6('0x54'),squel[_0xfcd6('0x38')]()[_0xfcd6('0x39')](_0x516a66)['from'](_0xfcd6('0x3a'))[_0xfcd6('0x13')](_0xfcd6('0x46'),_0x55b102))[_0xfcd6('0x13')](_0xfcd6('0x55'),squel[_0xfcd6('0x38')]()['field'](_0xfcd6('0x56'),_0xfcd6('0x57'))['from'](_0xc13a33)['group'](_0x516a66[_0xfcd6('0x11')](','))))[_0xfcd6('0x42')]();}function handleStop(){logger[_0xfcd6('0x58')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3986c5){logger[_0xfcd6('0x59')](_0x3986c5[_0xfcd6('0x1d')]);process['exit'](0x1);}function handleError(_0x2c4edf,_0x76122d){stats['errors'][_0xfcd6('0x1a')]({'name':_0x76122d[_0xfcd6('0x5a')],'message':_0x76122d[_0xfcd6('0x1d')],'row':_0x2c4edf});}function handleQuery(_0x4865f1){logger[_0xfcd6('0x58')](_0x4865f1);return db['sequelize']['query'](_0x4865f1)[_0xfcd6('0x5b')](function(_0x815396){results['push'](_0x815396);})['catch'](function(_0x5a0e50){logger[_0xfcd6('0x59')](_0x5a0e50[_0xfcd6('0x1d')]);});}function main(_0x2d6bc2,_0x43dae3,_0x2f15de,_0x552eb8){logger[_0xfcd6('0x58')](_0xfcd6('0x5c'),_0x2d6bc2,JSON[_0xfcd6('0x5d')](_0x43dae3));process[_0xfcd6('0x5e')](_0xfcd6('0x5f'));var _0x340c81=_0x43dae3[_0xfcd6('0x60')];var _0x2dc681=_[_0xfcd6('0x61')](_0x340c81);var _0x3d6252=_0x43dae3[_0xfcd6('0x62')];var _0x45fe8a=path[_0xfcd6('0x11')](config[_0xfcd6('0x63')],_0xfcd6('0x64'),_0x3d6252+_0xfcd6('0x65'));logger[_0xfcd6('0x58')](_0xfcd6('0x66'),_0x43dae3);db['ContactItemType'][_0xfcd6('0x67')]({'raw':!![],'attributes':['id',_0xfcd6('0x68')]})[_0xfcd6('0x1c')](function(_0x3aa5a2){for(var _0x135dff=0x0;_0x135dff<_0x3aa5a2[_0xfcd6('0x18')];_0x135dff++){if(_0x3aa5a2[_0x135dff][_0xfcd6('0x68')]in _0x340c81){contactItemTypes['push'](_0x3aa5a2[_0x135dff]);delete _0x2dc681[_0x3aa5a2[_0x135dff]['name']];hasAdditionalPhones=!![];}for(var _0x353dff in _0x340c81){if(_0x3aa5a2[_0x135dff][_0xfcd6('0x68')]+_0xfcd6('0x69')===_0x353dff){phoneDescriptions['push']({'itemTypeId':_0x3aa5a2[_0x135dff]['id'],'description':_0x353dff});delete _0x2dc681[_0x353dff];}}}if(hasAdditionalPhones)_0x2dc681[_0xfcd6('0x1e')]='';var _0x41d9a7=_[_0xfcd6('0x6a')](_0x2dc681)[_0xfcd6('0x11')]();logger['info'](_0xfcd6('0x6b'),_0x41d9a7);fs['writeFileSync'](_0x45fe8a,_0x41d9a7+'\x0a');Papa[_0xfcd6('0x6c')](fs[_0xfcd6('0x6d')](_0x2d6bc2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x10cfca,_0xc3f3c5){try{for(var _0xbcdcbb=0x0,_0x5ec261=[];_0xbcdcbb<_0x10cfca['data'][_0xfcd6('0x18')];_0xbcdcbb++){stats[_0xfcd6('0x6e')]+=0x1;if(_0x10cfca[_0xfcd6('0x6f')][_0xbcdcbb]){handleError(_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb],_0x10cfca[_0xfcd6('0x6f')][_0xbcdcbb]);}else{var _0x4aa646=[];var _0x4f21c7=[];var _0x3cfa87={};for(var _0x1c183e in _0x340c81){let _0x4ababc=contactItemTypes[_0xfcd6('0x71')](_0x3674de=>_0x3674de['name']===_0x1c183e);let _0x432d76=contactItemTypes[_0xfcd6('0x71')](_0x3491cb=>_0x3491cb[_0xfcd6('0x68')]+_0xfcd6('0x69')===_0x1c183e);if(_['isNil'](_0x4ababc)&&_[_0xfcd6('0x19')](_0x432d76)){if(_0x340c81[_0xfcd6('0x72')](_0x1c183e)){if(_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb][_0x340c81[_0x1c183e]]){var _0x4c207a=_[_0xfcd6('0x73')](_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb][_0x340c81[_0x1c183e]][_0xfcd6('0x74')](/"/g,'\x27'));switch(_0x1c183e){case _0xfcd6('0x32'):var _0x56ea92=moment(_0x4c207a,_0xfcd6('0xc'),!![]);if(_0x56ea92[_0xfcd6('0x75')]()){_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4c207a+'\x22');}else{_0x4aa646[_0xfcd6('0x1a')](_0xfcd6('0x76'));}break;case _0xfcd6('0x36'):var _0x1d0b97=parseInt(_0x4c207a);_0x4c207a=_[_0xfcd6('0x77')](_0x1d0b97)||_0x1d0b97<0x0||_0x1d0b97>0x4?_0x552eb8?0x3:0x2:_0x1d0b97;_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4c207a+'\x22');break;case'UserId':var _0x6ae053=parseInt(_0x4c207a);if(_[_0xfcd6('0x78')](_0x6ae053)&&_[_0xfcd6('0x79')](_0x2f15de,_0x6ae053)){_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x6ae053+'\x22');}else{_0x4aa646[_0xfcd6('0x1a')]('agent\x20not\x20exists');}break;case _0xfcd6('0x7a'):if(isEmail(_0x4c207a)){_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4c207a+'\x22');}else{_0x4aa646['push'](_0xfcd6('0x7b'));}break;case'dateOfBirth':var _0x3c72f2=moment(_0x4c207a,_0xfcd6('0x7c'),!![]);if(_0x3c72f2['isValid']()){_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4c207a+'\x22');}else{_0x4aa646[_0xfcd6('0x1a')](_0xfcd6('0x7d'));}break;default:_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4c207a+'\x22');}}else{switch(_0x1c183e){case _0xfcd6('0x7e'):case'phone':_0x4aa646[_0xfcd6('0x1a')](_0x1c183e+'\x20not\x20specified');break;default:_0x5ec261[_0xfcd6('0x1a')]('\x22\x22');}}}}else{var _0x522c56='';if(!_[_0xfcd6('0x19')](_0x4ababc)){if(!_0x3cfa87['hasOwnProperty'](_0x4ababc['id'])){for(var _0xf8dc9=0x0;_0xf8dc9<_0x340c81[_0x1c183e][_0xfcd6('0x18')];_0xf8dc9++){var _0x4c207a=_['trim'](_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb][_0x340c81[_0x1c183e][_0xf8dc9]]['replace'](/"/g,'\x27'));var _0x1d10f1=phoneDescriptions['find'](_0x110b66=>_0x110b66[_0xfcd6('0x7f')]===_0x4ababc['id']);if(!_['isNil'](_0x1d10f1)){var _0x3d7605=_['trim'](_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb][_0x340c81[_0x1d10f1[_0xfcd6('0x80')]][0x0]][_0xfcd6('0x74')](/"/g,'\x27'));if(!_[_0xfcd6('0x19')](_0x3d7605))_0x4c207a=_0x4c207a+'§'+_0x3d7605;}if(_0x522c56=='')_0x522c56=_0x4c207a;else _0x522c56+='|'+_0x4c207a;}_0x4f21c7[_0xfcd6('0x1a')](_0x4ababc['id']+':'+_0x522c56);_0x3cfa87[_0x4ababc['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5ec261[_0xfcd6('0x1a')]('\x22'+_0x4f21c7[_0xfcd6('0x11')](';')+'\x22');}if(_0x4aa646[_0xfcd6('0x18')]){handleError(_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb],{'code':'SystemRow','message':_0x4aa646[_0xfcd6('0x11')]()});}else{fs['appendFileSync'](_0x45fe8a,_0x5ec261['join']()+'\x0a');}_0x5ec261=[];}if(!(stats[_0xfcd6('0x6e')]%0xc8)){socket['emit'](_0xfcd6('0x81')+_0x3d6252,stats);stats[_0xfcd6('0x6f')]=[];}}if(stopped){logger[_0xfcd6('0x58')](_0xfcd6('0x82'));_0xc3f3c5[_0xfcd6('0x83')]();}}catch(_0x228f97){handleError(_0x10cfca[_0xfcd6('0x70')][_0xbcdcbb],{'code':_0xfcd6('0x84'),'message':_0x228f97[_0xfcd6('0x1d')]});logger[_0xfcd6('0x59')]('step',_0x228f97[_0xfcd6('0x1d')]);}},'complete':function(){try{var _0xa3ee85=[];var _0x5ef359=tempTableName;_0xa3ee85[_0xfcd6('0x1a')]('CREATE\x20TABLE\x20'+_0x5ef359+_0xfcd6('0x85'));logger[_0xfcd6('0x58')](_0xfcd6('0x86'),contactItemTypes['length']);var _0x209b1c=util['format'](_0xfcd6('0x87'),_0x45fe8a,_0x5ef359,_0x41d9a7,_0x43dae3[_0xfcd6('0x34')],_0x43dae3['CompanyId']||null,NOW,NOW);if(_[_0xfcd6('0x19')](_0x340c81[_0xfcd6('0x32')])){_0x209b1c+=_0xfcd6('0x88');}_0xa3ee85['push'](_0x209b1c);BPromise[_0xfcd6('0x89')](_0xa3ee85,handleQuery)[_0xfcd6('0x1c')](function(_0x3efec4){BPromise[_0xfcd6('0x1b')]([handleAdditionalPhones()])[_0xfcd6('0x1c')](function(){_0xa3ee85=[];for(var _0x384817=0x0;_0x384817\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','i.id','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','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','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','TagIds','limit','offset','sequelize','toString','groupBy','Setting','findOne','enableEmailPreview','clone','COUNT(*)','getSelectedTags','isEmpty','t.id\x20IN\x20?','Sequelize','../parsers/advancedSearch','updateInteraction','./utils','role','agent','select','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','expr'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x258d,0x1ca));var _0xd258=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x258d[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var squel=require('squel');var as=require(_0xd258('0x0'));var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xd258('0x1')];var utils=require(_0xd258('0x2'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x4d5ab3,_0x36a2fb,_0x56c0d0){var _0x259f1f=![];var _0x3b91f3=utils['getAccountFK'](_0x4d5ab3);if(_0x36a2fb[_0xd258('0x3')]===_0xd258('0x4')&&!_0x56c0d0['search']&&!_0x56c0d0[_0x3b91f3]){_0x259f1f=!![];}return _0x259f1f;}function getTagsQuery(){return squel[_0xd258('0x5')]()[_0xd258('0x6')]('id')[_0xd258('0x6')]('name')['field'](_0xd258('0x7'))[_0xd258('0x8')](_0xd258('0x9'));}function getUsersQuery(_0x345cbc,_0x371e16){var _0x3dfb1b=utils[_0xd258('0xa')](_0x345cbc);var _0x5a8783=_0xd258('0xb')+_0x345cbc+_0xd258('0xc');var _0x15ff6f=squel[_0xd258('0x5')]()[_0xd258('0x6')](_0xd258('0xd'))['field'](_0xd258('0xe'))[_0xd258('0x6')](_0xd258('0xf')+_0x3dfb1b)[_0xd258('0x8')](_0x5a8783,'ui')['left_join'](_0xd258('0x10'),'u',_0xd258('0x11'));if(_0x371e16[_0xd258('0x12')]>0x0){_0x15ff6f[_0xd258('0x13')](_0xd258('0xf')+_0x3dfb1b+_0xd258('0x14'),_[_0xd258('0x15')](_0x371e16,'id'));}return _0x15ff6f;}function getInteractionsQuery(_0x3a50fc){var _0x55d710=utils[_0xd258('0x16')](_0x3a50fc);var _0x57e68f=utils['getAccountFK'](_0x3a50fc);var _0x4bda58=utils['getInteractionFK'](_0x3a50fc);return squel[_0xd258('0x5')]()[_0xd258('0x8')](_0x55d710[_0xd258('0x17')],'i')[_0xd258('0x18')](_0xd258('0x19'),'c',_0xd258('0x1a'))['left_join'](_0xd258('0x10'),'o',_0xd258('0x1b'))[_0xd258('0x18')](_0x55d710[_0xd258('0x1c')],'a',_0xd258('0x1d')+_0x57e68f)[_0xd258('0x18')](_0x55d710[_0xd258('0x1e')],'me',_0xd258('0x1f')+_0x4bda58+'\x20=\x20i.id')[_0xd258('0x18')](_0x55d710['interactionsTags'],'it',_0xd258('0x20')+_0x4bda58+'\x20=\x20i.id')[_0xd258('0x18')]('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x2a3b3b={'body':squel[_0xd258('0x21')](),'contact':squel['expr'](),'default':squel[_0xd258('0x21')](),'fields':squel[_0xd258('0x21')](),'filter':squel[_0xd258('0x21')](),'read':squel['expr'](),'tags':{'clause':squel[_0xd258('0x21')](),'ids':null},'user':squel[_0xd258('0x21')]()};return _0x2a3b3b;}function parseTagParameter(_0x391817){var _0x5776e2=squel[_0xd258('0x21')]();if(_0x391817){var _0x2e789c=utils['getSelectedTags'](_0x391817);_0x2e789c[_0xd258('0x22')](function(_0x38a280){_0x5776e2['or'](_0xd258('0x23'),'%,'+_0x38a280+',%');});}return _0x5776e2;}function parseReadParameter(_0x503754){var _0x4bc247='';if(_0x503754){_0x4bc247=_0xd258('0x24');if(_0x503754==='1'){_0x4bc247=_0x4bc247['replace'](_0xd258('0x25'),'=');}else{_0x4bc247=_0x4bc247[_0xd258('0x26')](_0xd258('0x25'),'>');}}return _0x4bc247;}function parseSearchFilter(_0x12100b,_0x20ba84){var _0x3518e3=squel[_0xd258('0x21')]();if(_0x20ba84){var _0x146192=_0x20ba84[_0xd258('0x26')]('\x5c','\x5c\x5c')[_0xd258('0x26')](/'/g,'\x27\x27');if(qs[_0xd258('0x27')](_0x146192)){_0x3518e3['or'](_0xd258('0x28'),_0x146192+'%');if(['sms','whatsapp'][_0xd258('0x29')](_0x12100b)){_0x3518e3['or'](_0xd258('0x2a'),_0x146192+'%');}else if(_0x12100b===_0xd258('0x2b')){_0x3518e3['or']('i.fax\x20LIKE\x20?',_0x146192+'%');}else if(_0x12100b===_0xd258('0x2c')){_0x3518e3['or'](_0xd258('0x2d'),_0x146192+'%');}}else if(_0x12100b===_0xd258('0x2e')&&qs[_0xd258('0x2f')](_0x146192)){_0x3518e3['or'](_0xd258('0x30'),_0x146192+'%');}else{if(_0x12100b===_0xd258('0x2e')){_0x3518e3['or'](_0xd258('0x31'),qs['getFullTextValue'](_0x146192,!![]))['or'](_0xd258('0x32'),qs[_0xd258('0x33')](_0x146192));}else if(_0x12100b!==_0xd258('0x2b')){_0x3518e3['or'](_0xd258('0x34'),qs[_0xd258('0x33')](_0x146192));}_0x3518e3['or'](_0xd258('0x35'),qs[_0xd258('0x33')](_0x146192,!![]),null);}}return _0x3518e3;}function parseAdvancedSearchFilter(_0x3aec0c,_0x5d4fc5){var _0x302250=getSqlClauses();var _0x290e2e=as[_0xd258('0x36')](_0x3aec0c);var _0x429d0a=_0x290e2e[_0xd258('0x37')];for(var _0x483053=0x0;_0x483053<_0x290e2e[_0xd258('0x38')][_0xd258('0x12')];_0x483053++){var _0x472d1a=_0x290e2e[_0xd258('0x38')][_0x483053];var _0x34f7ac='i';var _0x138ccc=_['find'](_0x5d4fc5,[_0xd258('0x39'),_0x472d1a[_0xd258('0x6')]]);if(_0x138ccc){var _0x23ef65=as['buildExpression'](_0x34f7ac,_0x138ccc[_0xd258('0x3a')],_0x472d1a);_0x302250['default'][_0x429d0a](_0x23ef65[_0xd258('0x3b')],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3d')],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3e')]);}else{switch(_0x472d1a['field']){case _0xd258('0x3f'):var _0x44abc2=parseReadParameter(_0x472d1a[_0xd258('0x3c')]);_0x302250[_0xd258('0x40')]['and'](_0x44abc2);break;case'Contact':if(_0x472d1a[_0xd258('0x41')]===_0xd258('0x42')){if(_0x472d1a[_0xd258('0x3c')][_0xd258('0x43')]('\x20')[_0xd258('0x12')]>0x1){_0x302250['contact'][_0x429d0a](_0xd258('0x35'),qs['getFullTextValue'](_0x472d1a['value'],!![]),null);}else{var _0x500a60='%'+_0x472d1a[_0xd258('0x3c')]+'%';_0x302250[_0xd258('0x44')][_0x429d0a](_0xd258('0x45'),_0x500a60,_0x500a60,_0x500a60);}}else{_0x138ccc=_['find'](_0x5d4fc5,[_0xd258('0x39'),'ContactId']);_0x472d1a['field']=_0xd258('0x46');_0x23ef65=as[_0xd258('0x47')](_0x34f7ac,_0x138ccc[_0xd258('0x3a')],_0x472d1a);_0x302250[_0xd258('0x44')][_0x429d0a](_0x23ef65[_0xd258('0x3b')],_0x23ef65['value'][_0xd258('0x3d')],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3e')]);}break;case _0xd258('0x48'):var _0x192c51=_0x472d1a[_0xd258('0x3c')]['split'](',')[_0xd258('0x15')](function(_0xb70c68){return Number(_0xb70c68);});var _0x34e6bc=parseTagParameter(_0x192c51);_0x302250[_0xd258('0x49')][_0xd258('0x4a')][_0xd258('0x4b')](_0x34e6bc);_0x302250[_0xd258('0x49')][_0xd258('0x4c')]=_0x192c51;break;case _0xd258('0x4d'):if(_0x472d1a['operator']===_0xd258('0x42')){_0x302250[_0xd258('0x4e')][_0x429d0a](_0xd258('0x4f'),'%'+_0x472d1a[_0xd258('0x3c')]+'%',null);}else{_0x138ccc=_[_0xd258('0x50')](_0x5d4fc5,[_0xd258('0x39'),_0xd258('0x51')]);_0x472d1a['field']=_0xd258('0x51');_0x23ef65=as[_0xd258('0x47')](_0x34f7ac,_0x138ccc[_0xd258('0x3a')],_0x472d1a);_0x302250[_0xd258('0x4e')][_0x429d0a](_0x23ef65['text'],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3d')],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3e')]);}break;case _0xd258('0x52'):case _0xd258('0x53'):_0x23ef65=as[_0xd258('0x47')]('me',null,_0x472d1a);_0x302250[_0xd258('0x52')][_0x429d0a](_0x23ef65[_0xd258('0x3b')],_0x23ef65[_0xd258('0x3c')][_0xd258('0x3d')],_0x23ef65[_0xd258('0x3c')]['end']);break;}}}return _0x302250;}function parseModelFields(_0x3e71d2,_0x26f264,_0x11550a){var _0x6d9588=utils[_0xd258('0x54')](_0x3e71d2);var _0x5cb66d=squel[_0xd258('0x21')]();var _0x41fdaf=_(_0x26f264)[_0xd258('0x55')]()[_0xd258('0x15')](function(_0x4b15ab){return _['some'](_0x11550a,[_0xd258('0x39'),_0x4b15ab])?_0x4b15ab:undefined;})[_0xd258('0x56')]()[_0xd258('0x3c')]();if(_0x41fdaf[_0xd258('0x12')]>0x0){_0x41fdaf[_0xd258('0x22')](function(_0x2f7819){if(_0x2f7819===_0x6d9588){_0x5cb66d[_0xd258('0x4b')]('i.'+_0x6d9588+'\x20IN\x20?',[][_0xd258('0x57')](_0x26f264[_0x2f7819]));}else if(_0x2f7819==='createdAt'){var _0x1af94d=JSON[_0xd258('0x58')](_0x26f264[_0x2f7819])[_0xd258('0x59')];var _0x40dbf4=JSON['parse'](_0x26f264[_0x2f7819])['$lte'];_0x5cb66d[_0xd258('0x4b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1af94d,_0x40dbf4);}else{if(_0x26f264[_0x2f7819]==='null'){_0x5cb66d[_0xd258('0x4b')]('i.'+_0x2f7819+_0xd258('0x5a'));}else{_0x5cb66d['and']('i.'+_0x2f7819+_0xd258('0x5b'),_0x26f264[_0x2f7819]);}}});}return _0x5cb66d;}function parseQueryParameters(_0x57acd6,_0x4d45c5,_0x52a193){var _0x5199fe=getSqlClauses();return Promise[_0xd258('0x5c')]()[_0xd258('0x5d')](function(){return parseModelFields(_0x57acd6,_0x4d45c5,_0x52a193);})[_0xd258('0x5d')](function(_0x342967){_0x5199fe[_0xd258('0x5e')]['and'](_0x342967);return parseReadParameter(_0x4d45c5[_0xd258('0x40')]);})['then'](function(_0x12f3fd){_0x5199fe[_0xd258('0x40')][_0xd258('0x4b')](_0x12f3fd);return parseTagParameter(_0x4d45c5[_0xd258('0x5f')]);})[_0xd258('0x5d')](function(_0x3bc896){_0x5199fe['tags'][_0xd258('0x4a')][_0xd258('0x4b')](_0x3bc896);return parseSearchFilter(_0x57acd6,_0x4d45c5[_0xd258('0x60')]);})['then'](function(_0x435b4b){_0x5199fe[_0xd258('0x60')]=_0x435b4b;return _0x5199fe;});}function checkAccountsRestrictions(_0x47928b,_0x8c8948,_0xddaa97){var _0xfb2f01=utils[_0xd258('0x54')](_0x47928b);var _0x1ab929=_0xd258('0x61')+_[_0xd258('0x62')](_0x47928b)+(_0x47928b===_0xd258('0x63')?_0xd258('0x64'):'Accounts');var _0x4441de=squel[_0xd258('0x21')]();return Promise['resolve']()[_0xd258('0x5d')](function(){if(_0xddaa97['search']&&_0x8c8948[_0xd258('0x3')]===_0xd258('0x4')){return _0x8c8948[_0x1ab929]({'attributes':['id'],'raw':!![]});}})[_0xd258('0x5d')](function(_0x249f29){if(_0x249f29){if(_0x249f29[_0xd258('0x12')]===0x0){_0x4441de[_0xd258('0x4b')]('i.'+_0xfb2f01+'\x20IS\x20NULL');}else{_0x4441de[_0xd258('0x4b')]('i.'+_0xfb2f01+'\x20IN\x20?',_[_0xd258('0x15')](_0x249f29,'id'));}}else if(!_0xddaa97[_0xfb2f01]){_0x4441de['and']('i.'+_0xfb2f01+_0xd258('0x65'));}})[_0xd258('0x5d')](function(){return _0x4441de;});}function getClosedOrderClause(_0x4841e6,_0x48d22b){var _0x76eb08='';var _0x223b1b=[_0xd258('0x66'),'i.secondDisposition',_0xd258('0x67')];if(_0x4841e6==='mail'){_0x223b1b[_0xd258('0x68')](_0xd258('0x69'));}if(_0x48d22b[_0xd258('0x6a')]==='0'&&_0x4841e6==='mail'){_0x76eb08=_0xd258('0x69');}else{if(_0x48d22b[_0xd258('0x6a')]==='1'){_0x223b1b['shift']();}_0x76eb08='CONCAT_WS(\x27\x27,\x20'+_0x223b1b['join'](',\x20')+')';}return _0x76eb08;}function getFilteredInteractions(_0x13cbf1,_0x24a9e9,_0x4c841b,_0x7d607c){var _0x150e06=utils[_0xd258('0xa')](_0x13cbf1);var _0x586404=_[_0xd258('0x62')](_0x13cbf1)+_0xd258('0x6b');var _0x143f94=[];var _0x3e74de=getTagsQuery();var _0x1cb6cb={'type':db['Sequelize'][_0xd258('0x6c')][_0xd258('0x6d')],'raw':!![]};var _0x1e998b=[];var _0x46476d=[];return db['sequelize'][_0xd258('0x6e')](_0x3e74de['toString'](),_0x1cb6cb)['then'](function(_0x3aeb3e){_0x143f94=_[_0xd258('0x6f')](_0x3aeb3e,'id');_0x1cb6cb=_[_0xd258('0x70')](_0x1cb6cb,{'model':db[_0x586404],'mapToModel':!![],'nest':!![]});if(_0x4c841b[_0xd258('0x5e')]){_0x7d607c[_0xd258('0x71')][_0xd258('0x22')](function(_0x5b743c){_0x24a9e9[_0xd258('0x6')]('i.'+_0x5b743c);});}else{_0x24a9e9[_0xd258('0x6')](_0xd258('0x72'),_0xd258('0x3f'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x73'),_0xd258('0x74'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x75'),_0xd258('0x76'));if(_0x13cbf1===_0xd258('0x2e')){_0x24a9e9[_0xd258('0x6')](_0xd258('0x77'),'Account.email');_0x24a9e9['field'](_0xd258('0x78'),'contactName');_0x24a9e9[_0xd258('0x6')](_0xd258('0x79'));_0x24a9e9[_0xd258('0x6')]('i.createdAt');_0x24a9e9[_0xd258('0x6')](_0xd258('0x7a'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x7b'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x7c'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x7d'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x7e'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x7f'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x80'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x67'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x81'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x66'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x69'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x82'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x83'));_0x24a9e9[_0xd258('0x6')]('i.MailAccountId');_0x24a9e9[_0xd258('0x6')](_0xd258('0x84'));}else if(_0x13cbf1===_0xd258('0x2c')){_0x24a9e9['field'](_0xd258('0x85'),_0xd258('0x86'));}else{_0x24a9e9[_0xd258('0x6')]('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',_0xd258('0x86'));}if(_0x13cbf1!==_0xd258('0x2e')){_0x24a9e9[_0xd258('0x6')](_0xd258('0x87'));}_0x24a9e9[_0xd258('0x6')](_0xd258('0x88'),_0xd258('0x89'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x8a'),_0xd258('0x8b'));_0x24a9e9[_0xd258('0x6')]('c.email',_0xd258('0x8c'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x8d'),'Contact.phone');_0x24a9e9[_0xd258('0x6')](_0xd258('0x8e'),_0xd258('0x8f'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x90'),_0xd258('0x91'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x92'),_0xd258('0x93'));_0x24a9e9[_0xd258('0x6')](_0xd258('0x94'),'Owner.internal');_0x24a9e9[_0xd258('0x6')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xd258('0x95'));}if(_0x7d607c[_0xd258('0x96')]){_0x24a9e9[_0xd258('0x96')](_0x7d607c[_0xd258('0x96')]);}if(_0x7d607c[_0xd258('0x97')]){_0x24a9e9[_0xd258('0x97')](_0x7d607c[_0xd258('0x97')]);}return db[_0xd258('0x98')]['query'](_0x24a9e9['toString'](),_0x1cb6cb);})[_0xd258('0x5d')](function(_0x11de08){_0x1e998b=_0x11de08;var _0x31ce47=getUsersQuery(_0x13cbf1,_0x1e998b);return db[_0xd258('0x98')][_0xd258('0x6e')](_0x31ce47[_0xd258('0x99')](),_0x1cb6cb);})['then'](function(_0x2d10e0){_0x46476d=_[_0xd258('0x9a')](_0x2d10e0,_0x150e06);if(_0x13cbf1===_0xd258('0x2e')){return db[_0xd258('0x9b')][_0xd258('0x9c')]({'attributes':[_0xd258('0x9d')],'raw':!![]});}})[_0xd258('0x5d')](function(_0x41d739){var _0x5dc3c9=_0x41d739?_0x41d739[_0xd258('0x9d')]:undefined;var _0x1763a5=_0x1e998b[_0xd258('0x15')](function(_0x2b0a78){return updateInteraction(_0x2b0a78,_0x143f94,_0x46476d,_0x5dc3c9);});return Promise['all'](_0x1763a5);});}function countFilteredInteractions(_0x12cbe3,_0x4aff3f){var _0x3ff5dd=_0x12cbe3[_0xd258('0x9e')]();_0x3ff5dd[_0xd258('0x6')](_0xd258('0x9f'));_0x3ff5dd[_0xd258('0x6')](_0xd258('0x72'),'unreadMessages');var _0x49f928=utils[_0xd258('0xa0')](_0x4aff3f);if(!_[_0xd258('0xa1')](_0x49f928)){_0x3ff5dd[_0xd258('0x13')](_0xd258('0xa2'),_0x49f928);}var _0x13cea3={'type':db[_0xd258('0xa3')][_0xd258('0x6c')][_0xd258('0x6d')],'raw':!![]};return db[_0xd258('0x98')][_0xd258('0x6e')](_0x3ff5dd[_0xd258('0x99')](),_0x13cea3);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0b4c=['MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','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','conditions','find','name','buildExpression','type','default','text','value','start','end','unreadMessages','read','and','Contact','operator','split','contact','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','tags','clause','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','some','compact','length','forEach','\x20IN\x20?','concat','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','get','capitalize','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','QueryTypes','sequelize','keyBy','merge','attributes','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.lastMsgDirection','i.subject','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','query','toString','groupBy','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','SELECT','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','agent','search','field','color','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.id','ui.','users','u.id\x20=\x20ui.UserId','where','map','getInteractionsTables','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.','me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','includes','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)'];(function(_0x18776a,_0x4fecab){var _0x484e4a=function(_0x2c8722){while(--_0x2c8722){_0x18776a['push'](_0x18776a['shift']());}};_0x484e4a(++_0x4fecab);}(_0x0b4c,0x11c));var _0xc0b4=function(_0x2d0057,_0x24db80){_0x2d0057=_0x2d0057-0x0;var _0x2881ca=_0x0b4c[_0x2d0057];return _0x2881ca;};'use strict';var _=require('lodash');var squel=require(_0xc0b4('0x0'));var as=require(_0xc0b4('0x1'));var qs=require(_0xc0b4('0x2'));var updateInteraction=require(_0xc0b4('0x3'))[_0xc0b4('0x4')];var utils=require(_0xc0b4('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x44704f,_0x3656ee,_0x32371b){var _0x5defe3=![];var _0x2c1762=utils[_0xc0b4('0x6')](_0x44704f);if(_0x3656ee['role']===_0xc0b4('0x7')&&!_0x32371b[_0xc0b4('0x8')]&&!_0x32371b[_0x2c1762]){_0x5defe3=!![];}return _0x5defe3;}function getTagsQuery(){return squel['select']()['field']('id')['field']('name')[_0xc0b4('0x9')](_0xc0b4('0xa'))[_0xc0b4('0xb')](_0xc0b4('0xc'));}function getUsersQuery(_0x118c6e,_0x239f8a){var _0x5d92c6=utils[_0xc0b4('0xd')](_0x118c6e);var _0x1bb2a3=_0xc0b4('0xe')+_0x118c6e+_0xc0b4('0xf');var _0x2fd27e=squel[_0xc0b4('0x10')]()[_0xc0b4('0x9')](_0xc0b4('0x11'))[_0xc0b4('0x9')]('u.fullname')['field'](_0xc0b4('0x12')+_0x5d92c6)[_0xc0b4('0xb')](_0x1bb2a3,'ui')['left_join'](_0xc0b4('0x13'),'u',_0xc0b4('0x14'));if(_0x239f8a['length']>0x0){_0x2fd27e[_0xc0b4('0x15')](_0xc0b4('0x12')+_0x5d92c6+'\x20IN\x20?',_[_0xc0b4('0x16')](_0x239f8a,'id'));}return _0x2fd27e;}function getInteractionsQuery(_0x3d676d){var _0x577af6=utils[_0xc0b4('0x17')](_0x3d676d);var _0x29b497=utils[_0xc0b4('0x6')](_0x3d676d);var _0x5ba1bb=utils['getInteractionFK'](_0x3d676d);return squel['select']()['from'](_0x577af6['interactions'],'i')[_0xc0b4('0x18')](_0xc0b4('0x19'),'c',_0xc0b4('0x1a'))['left_join'](_0xc0b4('0x13'),'o','o.id\x20=\x20i.UserId')[_0xc0b4('0x18')](_0x577af6['accounts'],'a',_0xc0b4('0x1b')+_0x29b497)[_0xc0b4('0x18')](_0x577af6['messages'],'me',_0xc0b4('0x1c')+_0x5ba1bb+_0xc0b4('0x1d'))[_0xc0b4('0x18')](_0x577af6['interactionsTags'],'it','it.'+_0x5ba1bb+'\x20=\x20i.id')[_0xc0b4('0x18')](_0xc0b4('0xc'),'t',_0xc0b4('0x1e'));}function getSqlClauses(){var _0x31d047={'body':squel[_0xc0b4('0x1f')](),'contact':squel[_0xc0b4('0x1f')](),'default':squel[_0xc0b4('0x1f')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0xc0b4('0x1f')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0xc0b4('0x1f')]()};return _0x31d047;}function parseTagParameter(_0x3cbe31){var _0x3802dd=squel[_0xc0b4('0x1f')]();if(_0x3cbe31){var _0x779c91=utils[_0xc0b4('0x20')](_0x3cbe31);_0x779c91['forEach'](function(_0x589c50){_0x3802dd['or'](_0xc0b4('0x21'),'%,'+_0x589c50+',%');});}return _0x3802dd;}function parseReadParameter(_0x572309){var _0x50158d='';if(_0x572309){_0x50158d=_0xc0b4('0x22');if(_0x572309==='1'){_0x50158d=_0x50158d[_0xc0b4('0x23')](_0xc0b4('0x24'),'=');}else{_0x50158d=_0x50158d[_0xc0b4('0x23')](_0xc0b4('0x24'),'>');}}return _0x50158d;}function parseSearchFilter(_0x27713f,_0xf31b18){var _0x40f81e=squel[_0xc0b4('0x1f')]();if(_0xf31b18){var _0xf0847=_0xf31b18[_0xc0b4('0x23')]('\x5c','\x5c\x5c')[_0xc0b4('0x23')](/'/g,'\x27\x27');var _0x113af1=qs['escapeLIKESpecialChars'](_0xf0847);if(qs[_0xc0b4('0x25')](_0xf0847)){_0x40f81e['or'](_0xc0b4('0x26'),_0x113af1+'%');if([_0xc0b4('0x27'),'whatsapp'][_0xc0b4('0x28')](_0x27713f)){_0x40f81e['or']('i.phone\x20LIKE\x20?',_0x113af1+'%');}else if(_0x27713f==='fax'){_0x40f81e['or'](_0xc0b4('0x29'),_0x113af1+'%');}else if(_0x27713f===_0xc0b4('0x2a')){_0x40f81e['or'](_0xc0b4('0x2b'),_0x113af1+'%');}}else if(_0x27713f===_0xc0b4('0x2c')&&qs[_0xc0b4('0x2d')](_0xf0847)){_0x40f81e['or'](_0xc0b4('0x2e'),_0x113af1+'%');}else{if(_0x27713f===_0xc0b4('0x2c')){_0x40f81e['or'](_0xc0b4('0x2f'),qs['getFullTextValue'](_0xf0847,!![]))['or'](_0xc0b4('0x30'),qs['getFullTextValue'](_0xf0847));}else if(_0x27713f!==_0xc0b4('0x31')){_0x40f81e['or'](_0xc0b4('0x32'),qs['getFullTextValue'](_0xf0847));}_0x40f81e['or'](_0xc0b4('0x33'),qs['getFullTextValue'](_0xf0847,!![]),null);}}return _0x40f81e;}function parseAdvancedSearchFilter(_0x30b623,_0x4e6925){var _0x26a5d9=getSqlClauses();var _0x597cdf=as[_0xc0b4('0x34')](_0x30b623);var _0x35e2c3=_0x597cdf['sqlOperator'];for(var _0xbd955f=0x0;_0xbd955f<_0x597cdf[_0xc0b4('0x35')]['length'];_0xbd955f++){var _0x34f4d5=_0x597cdf[_0xc0b4('0x35')][_0xbd955f];var _0x44730b='i';var _0x6d71b2=_[_0xc0b4('0x36')](_0x4e6925,[_0xc0b4('0x37'),_0x34f4d5[_0xc0b4('0x9')]]);if(_0x6d71b2){var _0x3aafe5=as[_0xc0b4('0x38')](_0x44730b,_0x6d71b2[_0xc0b4('0x39')],_0x34f4d5);_0x26a5d9[_0xc0b4('0x3a')][_0x35e2c3](_0x3aafe5[_0xc0b4('0x3b')],_0x3aafe5[_0xc0b4('0x3c')][_0xc0b4('0x3d')],_0x3aafe5['value'][_0xc0b4('0x3e')]);}else{switch(_0x34f4d5[_0xc0b4('0x9')]){case _0xc0b4('0x3f'):var _0x1641d7=parseReadParameter(_0x34f4d5['value']);_0x26a5d9[_0xc0b4('0x40')][_0xc0b4('0x41')](_0x1641d7);break;case _0xc0b4('0x42'):if(_0x34f4d5[_0xc0b4('0x43')]==='$substring'){if(_0x34f4d5[_0xc0b4('0x3c')][_0xc0b4('0x44')]('\x20')['length']>0x1){_0x26a5d9[_0xc0b4('0x45')][_0x35e2c3](_0xc0b4('0x33'),qs[_0xc0b4('0x46')](_0x34f4d5[_0xc0b4('0x3c')],!![]),null);}else{var _0x1270f4='%'+_0x34f4d5['value']+'%';_0x26a5d9['contact'][_0x35e2c3](_0xc0b4('0x47'),_0x1270f4,_0x1270f4,_0x1270f4);}}else{_0x6d71b2=_[_0xc0b4('0x36')](_0x4e6925,['name','ContactId']);_0x34f4d5['field']='ContactId';_0x3aafe5=as['buildExpression'](_0x44730b,_0x6d71b2[_0xc0b4('0x39')],_0x34f4d5);_0x26a5d9[_0xc0b4('0x45')][_0x35e2c3](_0x3aafe5[_0xc0b4('0x3b')],_0x3aafe5[_0xc0b4('0x3c')]['start'],_0x3aafe5['value']['end']);}break;case'Tag':var _0x2cbd8a=_0x34f4d5[_0xc0b4('0x3c')]['split'](',')[_0xc0b4('0x16')](function(_0x34dac8){return Number(_0x34dac8);});var _0x3fc1c2=parseTagParameter(_0x2cbd8a);_0x26a5d9[_0xc0b4('0x48')][_0xc0b4('0x49')]['and'](_0x3fc1c2);_0x26a5d9[_0xc0b4('0x48')]['ids']=_0x2cbd8a;break;case _0xc0b4('0x4a'):if(_0x34f4d5[_0xc0b4('0x43')]===_0xc0b4('0x4b')){_0x26a5d9['user'][_0x35e2c3](_0xc0b4('0x4c'),'%'+_0x34f4d5['value']+'%',null);}else{_0x6d71b2=_[_0xc0b4('0x36')](_0x4e6925,['name',_0xc0b4('0x4d')]);_0x34f4d5[_0xc0b4('0x9')]=_0xc0b4('0x4d');_0x3aafe5=as[_0xc0b4('0x38')](_0x44730b,_0x6d71b2['type'],_0x34f4d5);_0x26a5d9[_0xc0b4('0x4e')][_0x35e2c3](_0x3aafe5[_0xc0b4('0x3b')],_0x3aafe5[_0xc0b4('0x3c')]['start'],_0x3aafe5['value']['end']);}break;case _0xc0b4('0x4f'):case _0xc0b4('0x50'):_0x3aafe5=as[_0xc0b4('0x38')]('me',null,_0x34f4d5);_0x26a5d9[_0xc0b4('0x4f')][_0x35e2c3](_0x3aafe5[_0xc0b4('0x3b')],_0x3aafe5[_0xc0b4('0x3c')][_0xc0b4('0x3d')],_0x3aafe5[_0xc0b4('0x3c')][_0xc0b4('0x3e')]);break;}}}return _0x26a5d9;}function parseModelFields(_0x4fa1b9,_0x392057,_0x22096){var _0x3c3f36=utils[_0xc0b4('0x6')](_0x4fa1b9);var _0x340c5d=squel[_0xc0b4('0x1f')]();var _0x27dbf2=_(_0x392057)['keys']()['map'](function(_0x2d21f6){return _[_0xc0b4('0x51')](_0x22096,[_0xc0b4('0x37'),_0x2d21f6])?_0x2d21f6:undefined;})[_0xc0b4('0x52')]()[_0xc0b4('0x3c')]();if(_0x27dbf2[_0xc0b4('0x53')]>0x0){_0x27dbf2[_0xc0b4('0x54')](function(_0x3c88dc){if(_0x3c88dc===_0x3c3f36){_0x340c5d[_0xc0b4('0x41')]('i.'+_0x3c3f36+_0xc0b4('0x55'),[][_0xc0b4('0x56')](_0x392057[_0x3c88dc]));}else if(_0x3c88dc===_0xc0b4('0x57')){var _0x5f1bf9=JSON[_0xc0b4('0x58')](_0x392057[_0x3c88dc])[_0xc0b4('0x59')];var _0x228b64=JSON[_0xc0b4('0x58')](_0x392057[_0x3c88dc])['$lte'];_0x340c5d['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f1bf9,_0x228b64);}else{if(_0x392057[_0x3c88dc]===_0xc0b4('0x5a')){_0x340c5d[_0xc0b4('0x41')]('i.'+_0x3c88dc+_0xc0b4('0x5b'));}else{_0x340c5d[_0xc0b4('0x41')]('i.'+_0x3c88dc+_0xc0b4('0x5c'),_0x392057[_0x3c88dc]);}}});}return _0x340c5d;}function parseQueryParameters(_0x2962e4,_0xfe17d9,_0x5914a5){var _0x50e6d6=getSqlClauses();return Promise[_0xc0b4('0x5d')]()['then'](function(){return parseModelFields(_0x2962e4,_0xfe17d9,_0x5914a5);})[_0xc0b4('0x5e')](function(_0x5ccf2e){_0x50e6d6[_0xc0b4('0x5f')][_0xc0b4('0x41')](_0x5ccf2e);return parseReadParameter(_0xfe17d9[_0xc0b4('0x40')]);})[_0xc0b4('0x5e')](function(_0x5daf16){_0x50e6d6['read'][_0xc0b4('0x41')](_0x5daf16);return parseTagParameter(_0xfe17d9['tag']);})[_0xc0b4('0x5e')](function(_0x3a52d4){_0x50e6d6[_0xc0b4('0x48')][_0xc0b4('0x49')][_0xc0b4('0x41')](_0x3a52d4);return parseSearchFilter(_0x2962e4,_0xfe17d9[_0xc0b4('0x60')]);})[_0xc0b4('0x5e')](function(_0x3d3b20){_0x50e6d6['filter']=_0x3d3b20;return _0x50e6d6;});}function checkAccountsRestrictions(_0x35cefc,_0x30ba0f,_0x44a7a3){var _0x5a9794=utils[_0xc0b4('0x6')](_0x35cefc);var _0x40b5bd=_0xc0b4('0x61')+_[_0xc0b4('0x62')](_0x35cefc)+(_0x35cefc==='chat'?_0xc0b4('0x63'):_0xc0b4('0x64'));var _0x321ac0=squel['expr']();return Promise[_0xc0b4('0x5d')]()[_0xc0b4('0x5e')](function(){if(_0x44a7a3[_0xc0b4('0x8')]&&_0x30ba0f[_0xc0b4('0x65')]===_0xc0b4('0x7')){return _0x30ba0f[_0x40b5bd]({'attributes':['id'],'raw':!![]});}})[_0xc0b4('0x5e')](function(_0x5393f0){if(_0x5393f0){if(_0x5393f0['length']===0x0){_0x321ac0[_0xc0b4('0x41')]('i.'+_0x5a9794+'\x20IS\x20NULL');}else{_0x321ac0[_0xc0b4('0x41')]('i.'+_0x5a9794+'\x20IN\x20?',_[_0xc0b4('0x16')](_0x5393f0,'id'));}}else if(!_0x44a7a3[_0x5a9794]){_0x321ac0[_0xc0b4('0x41')]('i.'+_0x5a9794+_0xc0b4('0x66'));}})['then'](function(){return _0x321ac0;});}function getClosedOrderClause(_0x4ab4b1,_0x1649ee){var _0x2dc1ba='';var _0x31ab27=['i.thirdDisposition',_0xc0b4('0x67'),_0xc0b4('0x68')];if(_0x4ab4b1===_0xc0b4('0x2c')){_0x31ab27[_0xc0b4('0x69')](_0xc0b4('0x6a'));}if(_0x1649ee[_0xc0b4('0x6b')]==='0'&&_0x4ab4b1===_0xc0b4('0x2c')){_0x2dc1ba=_0xc0b4('0x6a');}else{if(_0x1649ee['closed']==='1'){_0x31ab27[_0xc0b4('0x6c')]();}_0x2dc1ba=_0xc0b4('0x6d')+_0x31ab27['join'](',\x20')+')';}return _0x2dc1ba;}function getFilteredInteractions(_0x244933,_0x391a9a,_0x430e17,_0x591154){var _0x319be6=utils[_0xc0b4('0xd')](_0x244933);var _0x2f1c51=_[_0xc0b4('0x62')](_0x244933)+_0xc0b4('0x6e');var _0x3341c0=[];var _0x350bae=getTagsQuery();var _0x53a1ba={'type':db[_0xc0b4('0x6f')][_0xc0b4('0x70')]['SELECT'],'raw':!![]};var _0x402b3d=[];var _0x1e896d=[];return db[_0xc0b4('0x71')]['query'](_0x350bae['toString'](),_0x53a1ba)[_0xc0b4('0x5e')](function(_0x47f28c){_0x3341c0=_[_0xc0b4('0x72')](_0x47f28c,'id');_0x53a1ba=_[_0xc0b4('0x73')](_0x53a1ba,{'model':db[_0x2f1c51],'mapToModel':!![],'nest':!![]});if(_0x430e17[_0xc0b4('0x5f')]){_0x591154[_0xc0b4('0x74')][_0xc0b4('0x54')](function(_0x43a606){_0x391a9a['field']('i.'+_0x43a606);});}else{_0x391a9a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc0b4('0x3f'));_0x391a9a[_0xc0b4('0x9')]('a.key',_0xc0b4('0x75'));_0x391a9a['field'](_0xc0b4('0x76'),_0xc0b4('0x77'));if(_0x244933===_0xc0b4('0x2c')){_0x391a9a['field'](_0xc0b4('0x78'),_0xc0b4('0x79'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x7a'),_0xc0b4('0x7b'));_0x391a9a['field'](_0xc0b4('0x7c'));_0x391a9a['field'](_0xc0b4('0x7d'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x7e'));_0x391a9a['field'](_0xc0b4('0x7f'));_0x391a9a[_0xc0b4('0x9')]('i.closedAt');_0x391a9a[_0xc0b4('0x9')]('i.attach');_0x391a9a[_0xc0b4('0x9')]('i.lastMsgAt');_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x80'));_0x391a9a['field'](_0xc0b4('0x81'));_0x391a9a[_0xc0b4('0x9')]('i.disposition');_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x67'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x82'));_0x391a9a[_0xc0b4('0x9')]('i.substatus');_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x83'));_0x391a9a['field'](_0xc0b4('0x84'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x85'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x86'));}else if(_0x244933===_0xc0b4('0x2a')){_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x87'),_0xc0b4('0x7b'));}else{_0x391a9a[_0xc0b4('0x9')]('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',_0xc0b4('0x7b'));}if(_0x244933!==_0xc0b4('0x2c')){_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x88'));}_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x89'),'Contact.firstName');_0x391a9a[_0xc0b4('0x9')]('c.lastName',_0xc0b4('0x8a'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x8b'),'Contact.email');_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x8c'),_0xc0b4('0x8d'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x8e'),_0xc0b4('0x8f'));_0x391a9a['field'](_0xc0b4('0x90'),_0xc0b4('0x91'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x92'),_0xc0b4('0x93'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x94'),_0xc0b4('0x95'));_0x391a9a[_0xc0b4('0x9')](_0xc0b4('0x96'),_0xc0b4('0x97'));}if(_0x591154[_0xc0b4('0x98')]){_0x391a9a[_0xc0b4('0x98')](_0x591154['limit']);}if(_0x591154[_0xc0b4('0x99')]){_0x391a9a[_0xc0b4('0x99')](_0x591154[_0xc0b4('0x99')]);}return db[_0xc0b4('0x71')][_0xc0b4('0x9a')](_0x391a9a[_0xc0b4('0x9b')](),_0x53a1ba);})['then'](function(_0x20737a){_0x402b3d=_0x20737a;var _0x20f404=getUsersQuery(_0x244933,_0x402b3d);return db[_0xc0b4('0x71')]['query'](_0x20f404[_0xc0b4('0x9b')](),_0x53a1ba);})[_0xc0b4('0x5e')](function(_0x2b9e22){_0x1e896d=_[_0xc0b4('0x9c')](_0x2b9e22,_0x319be6);if(_0x244933==='mail'){return db['Setting'][_0xc0b4('0x9d')]({'attributes':[_0xc0b4('0x9e')],'raw':!![]});}})['then'](function(_0x2345c3){var _0x10d8e7=_0x2345c3?_0x2345c3['enableEmailPreview']:undefined;var _0x569d59=_0x402b3d[_0xc0b4('0x16')](function(_0x24bedb){return updateInteraction(_0x24bedb,_0x3341c0,_0x1e896d,_0x10d8e7);});return Promise[_0xc0b4('0x9f')](_0x569d59);});}function countFilteredInteractions(_0x11be15,_0x3cf791){var _0x2931ac=_0x11be15[_0xc0b4('0xa0')]();_0x2931ac['field'](_0xc0b4('0xa1'));_0x2931ac['field'](_0xc0b4('0xa2'),_0xc0b4('0x3f'));var _0x199aab=utils['getSelectedTags'](_0x3cf791);if(!_['isEmpty'](_0x199aab)){_0x2931ac[_0xc0b4('0x15')](_0xc0b4('0xa3'),_0x199aab);}var _0x1ca988={'type':db['Sequelize'][_0xc0b4('0x70')][_0xc0b4('0xa4')],'raw':!![]};return db[_0xc0b4('0x71')][_0xc0b4('0x9a')](_0x2931ac[_0xc0b4('0x9b')](),_0x1ca988);}module[_0xc0b4('0xa5')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 564c10d..6b027e0 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 _0x5947=['findOne','out','plainBody','-id','then','trimStart','catch','updateInteraction','TagIds','Tags','lodash','../../mysqldb','map','split','forEach','push','waiting','unmanaged','abandoned','disposition','UserId','talking','total','MailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5947,0x1d2));var _0x7594=function(_0x1ee5a4,_0x322f54){_0x1ee5a4=_0x1ee5a4-0x0;var _0x257e8b=_0x5947[_0x1ee5a4];return _0x257e8b;};'use strict';var _=require(_0x7594('0x0'));var db=require(_0x7594('0x1'))['db'];function getInteractionUsers(_0x2dd98b,_0x3223ce){return new Promise(function(_0x5afddf,_0x1bef49){try{var _0xaa3cfd=[];if(_0x3223ce[_0x2dd98b]){_0xaa3cfd=_0x3223ce[_0x2dd98b][_0x7594('0x2')](function(_0x4bf4ef){return{'id':_0x4bf4ef['id'],'fullname':_0x4bf4ef['fullname']};});}return _0x5afddf(_0xaa3cfd);}catch(_0x148189){_0x1bef49(_0x148189);}});}function getInteractionTags(_0x480432,_0x159456){var _0x43eaf0=[];if(_0x480432){_0x480432[_0x7594('0x3')](',')[_0x7594('0x4')](function(_0x117696){_0x43eaf0[_0x7594('0x5')](_0x159456[_0x117696]);});}return _0x43eaf0;}function updateWaitingCounter(_0x1ee1d0){if(_0x1ee1d0[_0x7594('0x6')]){_0x1ee1d0[_0x7594('0x6')]-=0x1;}}function updateInteractionCounters(_0x440364){_0x440364[_0x7594('0x6')]=0x0;_0x440364['talking']=0x0;_0x440364['answered']=0x0;_0x440364[_0x7594('0x7')]=0x0;_0x440364[_0x7594('0x8')]=0x0;_0x440364['total']=0x0;if(_0x440364['closed']){if(_0x440364[_0x7594('0x9')]===_0x7594('0x8')){_0x440364[_0x7594('0x8')]+=0x1;updateWaitingCounter(_0x440364);}if(_0x440364[_0x7594('0xa')]){_0x440364['answered']+=0x1;if(_0x440364[_0x7594('0xb')]){_0x440364[_0x7594('0xb')]-=0x1;}}else{if(_0x440364[_0x7594('0x9')]){_0x440364['unmanaged']+=0x1;updateWaitingCounter(_0x440364);}}}else{if(!_0x440364['UserId']){_0x440364[_0x7594('0x6')]+=0x1;}if(_0x440364[_0x7594('0xa')]){_0x440364[_0x7594('0xb')]+=0x1;updateWaitingCounter(_0x440364);}}_0x440364[_0x7594('0xc')]+=0x1;return _0x440364;}function getLastMessageText(_0x40909d){return db[_0x7594('0xd')][_0x7594('0xe')]({'where':{'$and':[{'MailInteractionId':_0x40909d['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7594('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x7594('0x10')],'order':_0x7594('0x11'),'raw':!![]})[_0x7594('0x12')](function(_0x1b60f9){if(_0x1b60f9&&_0x1b60f9['plainBody']){_0x40909d['lastMsgText']=_[_0x7594('0x13')](_0x1b60f9[_0x7594('0x10')]);}return _0x40909d;})[_0x7594('0x14')](function(_0x35d713){throw _0x35d713;});}exports[_0x7594('0x15')]=function(_0x1a73b7,_0x5b66c5,_0xb79b67,_0x109c53){return new Promise(function(_0x349eea,_0xc8b2cc){return getInteractionUsers(_0x1a73b7['id'],_0xb79b67)[_0x7594('0x12')](function(_0x54650){_0x1a73b7['Users']=_0x54650;return getInteractionTags(_0x1a73b7[_0x7594('0x16')],_0x5b66c5);})['then'](function(_0x58caa7){_0x1a73b7[_0x7594('0x17')]=_0x58caa7;delete _0x1a73b7['TagIds'];return updateInteractionCounters(_0x1a73b7);})[_0x7594('0x12')](function(_0x44e5e6){if(_0x109c53){return getLastMessageText(_0x44e5e6);}else{return _0x44e5e6;}})[_0x7594('0x12')](function(_0x8ab2ac){_0x349eea(_0x8ab2ac);})['catch'](function(_0x4da3ad){_0xc8b2cc(_0x4da3ad);});});}; \ No newline at end of file +var _0xd26c=['answered','unmanaged','abandoned','total','closed','UserId','disposition','MailMessage','out','plainBody','-id','then','catch','updateInteraction','Users','Tags','TagIds','map','split','forEach','waiting','talking'];(function(_0x1251f2,_0x25fdd6){var _0x153c91=function(_0x240c23){while(--_0x240c23){_0x1251f2['push'](_0x1251f2['shift']());}};_0x153c91(++_0x25fdd6);}(_0xd26c,0xed));var _0xcd26=function(_0x3c0ffb,_0x4853b8){_0x3c0ffb=_0x3c0ffb-0x0;var _0x48177a=_0xd26c[_0x3c0ffb];return _0x48177a;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x11433e,_0x1f96a9){return new Promise(function(_0x2663db,_0x8731ac){try{var _0x3632f3=[];if(_0x1f96a9[_0x11433e]){_0x3632f3=_0x1f96a9[_0x11433e][_0xcd26('0x0')](function(_0x117c99){return{'id':_0x117c99['id'],'fullname':_0x117c99['fullname']};});}return _0x2663db(_0x3632f3);}catch(_0x42bcaa){_0x8731ac(_0x42bcaa);}});}function getInteractionTags(_0x47be4b,_0x19a341){var _0x455788=[];if(_0x47be4b){_0x47be4b[_0xcd26('0x1')](',')[_0xcd26('0x2')](function(_0x29479e){_0x455788['push'](_0x19a341[_0x29479e]);});}return _0x455788;}function updateWaitingCounter(_0x13b9aa){if(_0x13b9aa[_0xcd26('0x3')]){_0x13b9aa['waiting']-=0x1;}}function updateInteractionCounters(_0x189304){_0x189304[_0xcd26('0x3')]=0x0;_0x189304[_0xcd26('0x4')]=0x0;_0x189304[_0xcd26('0x5')]=0x0;_0x189304[_0xcd26('0x6')]=0x0;_0x189304[_0xcd26('0x7')]=0x0;_0x189304[_0xcd26('0x8')]=0x0;if(_0x189304[_0xcd26('0x9')]){if(_0x189304['disposition']===_0xcd26('0x7')){_0x189304['abandoned']+=0x1;updateWaitingCounter(_0x189304);}if(_0x189304[_0xcd26('0xa')]){_0x189304[_0xcd26('0x5')]+=0x1;if(_0x189304[_0xcd26('0x4')]){_0x189304[_0xcd26('0x4')]-=0x1;}}else{if(_0x189304[_0xcd26('0xb')]){_0x189304[_0xcd26('0x6')]+=0x1;updateWaitingCounter(_0x189304);}}}else{if(!_0x189304[_0xcd26('0xa')]){_0x189304[_0xcd26('0x3')]+=0x1;}if(_0x189304[_0xcd26('0xa')]){_0x189304['talking']+=0x1;updateWaitingCounter(_0x189304);}}_0x189304[_0xcd26('0x8')]+=0x1;return _0x189304;}function getLastMessageText(_0x1dc462){return db[_0xcd26('0xc')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1dc462['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xcd26('0xd')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xcd26('0xe')],'order':_0xcd26('0xf'),'raw':!![]})[_0xcd26('0x10')](function(_0x123ce0){if(_0x123ce0&&_0x123ce0[_0xcd26('0xe')]){_0x1dc462['lastMsgText']=_['trimStart'](_0x123ce0['plainBody']);}return _0x1dc462;})[_0xcd26('0x11')](function(_0x19fc35){throw _0x19fc35;});}exports[_0xcd26('0x12')]=function(_0x5cac21,_0x26f834,_0x53591c,_0x1baa4a){return new Promise(function(_0x46c050,_0x235b26){return getInteractionUsers(_0x5cac21['id'],_0x53591c)[_0xcd26('0x10')](function(_0x3e8d1c){_0x5cac21[_0xcd26('0x13')]=_0x3e8d1c;return getInteractionTags(_0x5cac21['TagIds'],_0x26f834);})['then'](function(_0x4f37b3){_0x5cac21[_0xcd26('0x14')]=_0x4f37b3;delete _0x5cac21[_0xcd26('0x15')];return updateInteractionCounters(_0x5cac21);})[_0xcd26('0x10')](function(_0x266547){if(_0x1baa4a){return getLastMessageText(_0x266547);}else{return _0x266547;}})['then'](function(_0x3a8bf3){_0x46c050(_0x3a8bf3);})[_0xcd26('0x11')](function(_0xd8f5b6){_0x235b26(_0xd8f5b6);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 912c323..7ef4a02 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 _0x49a8=['findOne','then','update','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','upperFirst','InteractionId','_interactions','_messages','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','null','Interaction'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x49a8,0x18d));var _0x849a=function(_0x119785,_0x5151a6){_0x119785=_0x119785-0x0;var _0x166697=_0x49a8[_0x119785];return _0x166697;};'use strict';var _=require(_0x849a('0x0'));var db=require(_0x849a('0x1'))['db'];var loggers={'openchannel':require(_0x849a('0x2'))(_0x849a('0x3')),'mail':require('../../config/logger')(_0x849a('0x4')),'fax':require('../../config/logger')(_0x849a('0x5')),'sms':require(_0x849a('0x2'))(_0x849a('0x6')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0x849a('0x2'))(_0x849a('0x7'))};function getAccountFK(_0x28cbfe){return _[_0x849a('0x8')](_0x28cbfe)+(_0x28cbfe===_0x849a('0x9')?_0x849a('0xa'):'Account')+'Id';}function getInteractionFK(_0x355d36){return _[_0x849a('0x8')](_0x355d36)+'InteractionId';}function getInteractionId(_0x4011a6,_0x3169a2,_0x5d9970){if(_0x4011a6&&_0x4011a6[_[_0x849a('0xb')](_0x5d9970)+_0x849a('0xc')]){return _0x4011a6[_[_0x849a('0xb')](_0x5d9970)+_0x849a('0xc')];}else if(_0x4011a6&&_0x4011a6['id']){return _0x4011a6['id'];}else if(_0x3169a2&&_0x3169a2['id']){return _0x3169a2['id'];}else{return'unknown';}}function getInteractionsTables(_0x31444d){return{'accounts':_0x31444d+'_'+(_0x31444d===_0x849a('0x9')?'websites':'accounts'),'interactions':_0x31444d+_0x849a('0xd'),'interactionsTags':_0x31444d+'_interaction_has_tags','messages':_0x31444d+_0x849a('0xe'),'userInteractions':'user_has_'+_0x31444d+_0x849a('0xd')};}function getSelectedTags(_0x616e89){var _0x13dbcb=[];if(_0x616e89){_0x13dbcb=Array[_0x849a('0xf')](_0x616e89)?_0x616e89:[_0x616e89];}return _0x13dbcb;}function log(_0xe94bf8,_0x3bfb32,_0x1aecca,_0x4c3905,_0x1c4374,_0x465915){loggers[_0x1c4374[_0x849a('0x10')]()][_0xe94bf8](_0x849a('0x11'),_0x465915[_0x849a('0x12')](),_0x3bfb32?_0x3bfb32['id']:null,_0x3bfb32?_0x3bfb32[_0x849a('0x13')]:null,_0x3bfb32?_0x3bfb32['role']:null,getInteractionId(_0x1aecca,_0x4c3905,_0x1c4374),_0x1aecca?JSON[_0x849a('0x14')](_0x1aecca):_0x849a('0x15'));}function updateUser(_0x282fc2,_0x1630b6,_0x24b7cf,_0x418253,_0x487917){db[_[_0x849a('0xb')](_0x418253)+_0x849a('0x16')][_0x849a('0x17')]({'where':{'id':getInteractionId(_0x1630b6,_0x24b7cf,_0x418253)}})[_0x849a('0x18')](function(_0x2c566b){if(_0x2c566b){return _0x2c566b[_0x849a('0x19')]({'UserId':_0x282fc2?_0x282fc2['id']:null});}})['then'](function(_0x1ac659){if(_0x1ac659){log(_0x849a('0x1a'),_0x282fc2,_0x1630b6,_0x24b7cf,_0x418253,_0x487917);}})[_0x849a('0x1b')](function(){log(_0x849a('0x1c'),_0x282fc2,_0x1630b6,_0x24b7cf,_0x418253,_0x487917);});}module[_0x849a('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xa754=['then','info','catch','error','lodash','openchannel-interactions','../../config/logger','mail-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','InteractionId','upperFirst','unknown','websites','_interactions','_interaction_has_tags','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','findOne'];(function(_0x22941e,_0x466da5){var _0x213caa=function(_0x37cffb){while(--_0x37cffb){_0x22941e['push'](_0x22941e['shift']());}};_0x213caa(++_0x466da5);}(_0xa754,0x138));var _0x4a75=function(_0x16036c,_0x487108){_0x16036c=_0x16036c-0x0;var _0x555a55=_0xa754[_0x16036c];return _0x555a55;};'use strict';var _=require(_0x4a75('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x4a75('0x1')),'mail':require(_0x4a75('0x2'))(_0x4a75('0x3')),'fax':require(_0x4a75('0x2'))('fax-interactions'),'sms':require(_0x4a75('0x2'))(_0x4a75('0x4')),'chat':require(_0x4a75('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x4a75('0x5'))};function getAccountFK(_0x54b9ef){return _[_0x4a75('0x6')](_0x54b9ef)+(_0x54b9ef===_0x4a75('0x7')?_0x4a75('0x8'):'Account')+'Id';}function getInteractionFK(_0x15b770){return _[_0x4a75('0x6')](_0x15b770)+_0x4a75('0x9');}function getInteractionId(_0xb3809b,_0x1210a7,_0x3de9e0){if(_0xb3809b&&_0xb3809b[_[_0x4a75('0xa')](_0x3de9e0)+_0x4a75('0x9')]){return _0xb3809b[_[_0x4a75('0xa')](_0x3de9e0)+_0x4a75('0x9')];}else if(_0xb3809b&&_0xb3809b['id']){return _0xb3809b['id'];}else if(_0x1210a7&&_0x1210a7['id']){return _0x1210a7['id'];}else{return _0x4a75('0xb');}}function getInteractionsTables(_0x5c900a){return{'accounts':_0x5c900a+'_'+(_0x5c900a===_0x4a75('0x7')?_0x4a75('0xc'):'accounts'),'interactions':_0x5c900a+_0x4a75('0xd'),'interactionsTags':_0x5c900a+_0x4a75('0xe'),'messages':_0x5c900a+'_messages','userInteractions':'user_has_'+_0x5c900a+'_interactions'};}function getSelectedTags(_0x1a52c8){var _0x5b2de2=[];if(_0x1a52c8){_0x5b2de2=Array[_0x4a75('0xf')](_0x1a52c8)?_0x1a52c8:[_0x1a52c8];}return _0x5b2de2;}function log(_0x1a2bab,_0x15c8dd,_0x450746,_0x4ab0c0,_0xafe186,_0x418438){loggers[_0xafe186[_0x4a75('0x10')]()][_0x1a2bab](_0x4a75('0x11'),_0x418438[_0x4a75('0x12')](),_0x15c8dd?_0x15c8dd['id']:null,_0x15c8dd?_0x15c8dd[_0x4a75('0x13')]:null,_0x15c8dd?_0x15c8dd[_0x4a75('0x14')]:null,getInteractionId(_0x450746,_0x4ab0c0,_0xafe186),_0x450746?JSON[_0x4a75('0x15')](_0x450746):_0x4a75('0x16'));}function updateUser(_0x1b1d7b,_0x27de04,_0x5306ed,_0x512018,_0x5e42e9){db[_[_0x4a75('0xa')](_0x512018)+'Interaction'][_0x4a75('0x17')]({'where':{'id':getInteractionId(_0x27de04,_0x5306ed,_0x512018)}})[_0x4a75('0x18')](function(_0x29b66d){if(_0x29b66d){return _0x29b66d['update']({'UserId':_0x1b1d7b?_0x1b1d7b['id']:null});}})['then'](function(_0x4ff4df){if(_0x4ff4df){log(_0x4a75('0x19'),_0x1b1d7b,_0x27de04,_0x5306ed,_0x512018,_0x5e42e9);}})[_0x4a75('0x1a')](function(){log(_0x4a75('0x1b'),_0x1b1d7b,_0x27de04,_0x5306ed,_0x512018,_0x5e42e9);});}module['exports']={'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 57908af..17134d6 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 _0x15ad=['createDecipher','aes-256-ctr','update','final','utf8','hasOwnProperty','use','findOne','then','count','json','users','User','crypto','util','../../mysqldb','../../config/environment','data1','license','split'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x15ad,0x175));var _0xd15a=function(_0x261d6c,_0x1d7d96){_0x261d6c=_0x261d6c-0x0;var _0x240a21=_0x15ad[_0x261d6c];return _0x240a21;};'use strict';var crypto=require(_0xd15a('0x0'));var util=require(_0xd15a('0x1'));var compose=require('composable-middleware');var db=require(_0xd15a('0x2'))['db'];var config=require(_0xd15a('0x3'));function getValueFromLicense(_0x377846,_0x550c6d){if(_0x377846&&_0x550c6d){if(_0x550c6d[_0xd15a('0x4')]&&_0x550c6d['license']){var _0x38a36d=_0x550c6d[_0xd15a('0x4')];var _0x58e60d=_0x550c6d[_0xd15a('0x5')];var _0xcc88c3=_0x38a36d[_0xd15a('0x6')]('-')[0x4];var _0x4d94d1=_0x38a36d[_0xd15a('0x6')]('-')[0x0];var _0x16ef0a=crypto[_0xd15a('0x7')](_0xd15a('0x8'),util['format']('%s:%s:%s',_0xcc88c3,_0x38a36d,_0x4d94d1));var _0x559d7c=_0x16ef0a[_0xd15a('0x9')](_0x58e60d,'base64','utf8');_0x559d7c+=_0x16ef0a[_0xd15a('0xa')](_0xd15a('0xb'));var _0x4ad429=JSON['parse'](_0x559d7c);return _0x4ad429[_0xd15a('0xc')](_0x377846)?_0x4ad429[_0x377846]:null;}}return null;}function isLimit(_0x595567,_0x4f326c,_0x28c323,_0x19e559){var _0x25d4b3=_0x4f326c;return compose()[_0xd15a('0xd')](function(_0x6c81fe,_0x2197e4,_0x5b5dff){return db['License'][_0xd15a('0xe')]({'where':{'id':0x1},'raw':!![]})[_0xd15a('0xf')](function(_0x15d755){var _0xcf26b0=getValueFromLicense(_0x595567,_0x15d755);return _0xcf26b0?_0xcf26b0:_0x25d4b3;})['then'](function(_0x33152a){_0x25d4b3=_0x33152a;return _0x28c323[_0xd15a('0x10')](_0x19e559);})[_0xd15a('0xf')](function(_0x296b09){if(_0x296b09>=_0x25d4b3){return _0x2197e4['status'](0x193)[_0xd15a('0x11')]({'message':util['format']('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x595567)});}_0x5b5dff();})['catch'](function(_0x136326){_0x5b5dff(_0x136326);});});}function isUserLimit(){return isLimit(_0xd15a('0x12'),0x1,db[_0xd15a('0x13')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x9cc4=['base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','format','%s:%s:%s','update'];(function(_0x39cf8d,_0x3b343b){var _0x34cd7e=function(_0x47fc64){while(--_0x47fc64){_0x39cf8d['push'](_0x39cf8d['shift']());}};_0x34cd7e(++_0x3b343b);}(_0x9cc4,0x154));var _0x49cc=function(_0x28b7a7,_0x473329){_0x28b7a7=_0x28b7a7-0x0;var _0x404258=_0x9cc4[_0x28b7a7];return _0x404258;};'use strict';var crypto=require(_0x49cc('0x0'));var util=require(_0x49cc('0x1'));var compose=require(_0x49cc('0x2'));var db=require(_0x49cc('0x3'))['db'];var config=require(_0x49cc('0x4'));function getValueFromLicense(_0x57f6af,_0x88ac4b){if(_0x57f6af&&_0x88ac4b){if(_0x88ac4b[_0x49cc('0x5')]&&_0x88ac4b[_0x49cc('0x6')]){var _0x31436e=_0x88ac4b[_0x49cc('0x5')];var _0x1a1551=_0x88ac4b[_0x49cc('0x6')];var _0x1d2548=_0x31436e[_0x49cc('0x7')]('-')[0x4];var _0x3f1e13=_0x31436e['split']('-')[0x0];var _0x38ce54=crypto['createDecipher']('aes-256-ctr',util[_0x49cc('0x8')](_0x49cc('0x9'),_0x1d2548,_0x31436e,_0x3f1e13));var _0x27d6d1=_0x38ce54[_0x49cc('0xa')](_0x1a1551,_0x49cc('0xb'),_0x49cc('0xc'));_0x27d6d1+=_0x38ce54[_0x49cc('0xd')](_0x49cc('0xc'));var _0x238d7d=JSON[_0x49cc('0xe')](_0x27d6d1);return _0x238d7d[_0x49cc('0xf')](_0x57f6af)?_0x238d7d[_0x57f6af]:null;}}return null;}function isLimit(_0xf8cac2,_0x213a52,_0x860c95,_0x17e757){var _0x38a84d=_0x213a52;return compose()[_0x49cc('0x10')](function(_0x332ad8,_0x5a3ea6,_0x34ed71){return db[_0x49cc('0x11')][_0x49cc('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x495412){var _0x256401=getValueFromLicense(_0xf8cac2,_0x495412);return _0x256401?_0x256401:_0x38a84d;})[_0x49cc('0x13')](function(_0x544dc){_0x38a84d=_0x544dc;return _0x860c95['count'](_0x17e757);})['then'](function(_0x45f47c){if(_0x45f47c>=_0x38a84d){return _0x5a3ea6['status'](0x193)[_0x49cc('0x14')]({'message':util[_0x49cc('0x8')](_0x49cc('0x15'),_0xf8cac2)});}_0x34ed71();})[_0x49cc('0x16')](function(_0x55d00e){_0x34ed71(_0x55d00e);});});}function isUserLimit(){return isLimit(_0x49cc('0x17'),0x1,db[_0x49cc('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0x49cc('0x19')}]}});}exports[_0x49cc('0x1a')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fd243ef..735a102 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 _0xae6c=['startsWith','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','match','indexOf','conditions','push','buildExpression','operator','$eq','value','includes','$gt','$lte','days','format','castTo','text','CAST(','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','hours','lodash','moment','parseSearch','sqlOperator'];(function(_0x565e2f,_0x3a11f3){var _0x3127e0=function(_0x2dfaa9){while(--_0x2dfaa9){_0x565e2f['push'](_0x565e2f['shift']());}};_0x3127e0(++_0x3a11f3);}(_0xae6c,0x68));var _0xcae6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xae6c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcae6('0x0'));var moment=require(_0xcae6('0x1'));exports[_0xcae6('0x2')]=function(_0x351ece){var _0x1011e1={'conditions':[]};_0x1011e1[_0xcae6('0x3')]=_[_0xcae6('0x4')](_0x351ece,_0xcae6('0x5'))?'or':_0xcae6('0x6');var _0x498d92=_0x351ece[_0xcae6('0x7')](_0xcae6('0x8'),'')[_0xcae6('0x7')](_0xcae6('0x5'),'')['split']('||');for(var _0x56ae62=0x0;_0x56ae62<_0x498d92[_0xcae6('0x9')];_0x56ae62++){var _0x47d5c1=_0x498d92[_0x56ae62][_0xcae6('0xa')](':=');var _0x53948e=_0x47d5c1[0x0];var _0x1c4779=_0x47d5c1[_0xcae6('0xb')](0x1);_0x1c4779[_0xcae6('0xc')](function(_0x4ca0de){var _0xa5b4b6=_0x4ca0de[_0xcae6('0xa')]('[')[_0xcae6('0xd')]();var _0xecb311=_0x4ca0de[_0xcae6('0xe')](/\[(.*?)\]/g);_0xecb311['forEach'](function(_0x55d0a4){var _0x35d978=_0x55d0a4['split']('[')['filter'](function(_0x374260){return _0x374260[_0xcae6('0xf')](']')>-0x1;})['map'](function(_0x1ad972){return _0x1ad972[_0xcae6('0xa')](']')[0x0];})[0x0];_0x1011e1[_0xcae6('0x10')][_0xcae6('0x11')]({'field':_0x53948e,'operator':_0xa5b4b6,'value':_0x35d978});});});}return _0x1011e1;};exports[_0xcae6('0x12')]=function(_0x59be55,_0x53e3f0,_0x9243e5){var _0x16c0fe={};if(_0x53e3f0==='DATE'){if(_0x9243e5[_0xcae6('0x13')]===_0xcae6('0x14')){_0x9243e5['operator']='$between';_0x9243e5[_0xcae6('0x15')]+=','+_0x9243e5['value'];}else if(_[_0xcae6('0x16')]([_0xcae6('0x17'),_0xcae6('0x18')],_0x9243e5[_0xcae6('0x13')])){_0x9243e5[_0xcae6('0x15')]=moment(_0x9243e5['value'])['add'](0x1,_0xcae6('0x19'))[_0xcae6('0x1a')]('YYYY-MM-DD');}}if(_0x9243e5[_0xcae6('0x1b')]){_0x53e3f0=_0x9243e5[_0xcae6('0x1b')];_0x16c0fe[_0xcae6('0x1c')]=_0xcae6('0x1d')+_0x59be55+'.'+_0x9243e5['field']+'\x20AS\x20'+_0x9243e5['castTo']+')\x20'+parseOperator(_0x9243e5['operator']);}else{_0x16c0fe['text']=_0x59be55+'.'+_0x9243e5['field']+'\x20'+parseOperator(_0x9243e5['operator']);}if(_[_0xcae6('0x16')]([_0xcae6('0x1e'),_0xcae6('0x1f')],_0x9243e5['operator']))_0x16c0fe[_0xcae6('0x1c')]='('+_0x16c0fe[_0xcae6('0x1c')]+_0xcae6('0x20')+_0x59be55+'.'+_0x9243e5[_0xcae6('0x21')]+_0xcae6('0x22');_0x16c0fe[_0xcae6('0x15')]=parseValue(_0x53e3f0,_0x9243e5[_0xcae6('0x13')],_0x9243e5[_0xcae6('0x15')]);return _0x16c0fe;};function parseOperator(_0x1edc0c){var _0x215941;switch(_0x1edc0c){case _0xcae6('0x23'):_0x215941=_0xcae6('0x24');break;case'$notIn':_0x215941=_0xcae6('0x25');break;case _0xcae6('0x14'):_0x215941=_0xcae6('0x26');break;case'$ne':_0x215941='<>\x20?';break;case _0xcae6('0x27'):case _0xcae6('0x28'):case _0xcae6('0x29'):_0x215941=_0xcae6('0x2a');break;case _0xcae6('0x2b'):_0x215941=_0xcae6('0x2c');break;case _0xcae6('0x17'):_0x215941=_0xcae6('0x2d');break;case _0xcae6('0x18'):_0x215941='<=\x20?';break;case _0xcae6('0x2e'):_0x215941='>=\x20?';break;case _0xcae6('0x2f'):_0x215941=_0xcae6('0x30');break;}return _0x215941;}function parseValue(_0x376033,_0x1a94e1,_0x1e092d){var _0x103ed3={'start':undefined,'end':undefined};switch(_0x1a94e1){case _0xcae6('0x23'):case _0xcae6('0x1f'):_0x103ed3[_0xcae6('0x31')]=_0x1e092d[_0xcae6('0xa')](',');break;case _0xcae6('0x27'):_0x103ed3['start']='%'+_0x1e092d+'%';break;case'$startsWith':_0x103ed3[_0xcae6('0x31')]=_0x1e092d+'%';break;case _0xcae6('0x29'):_0x103ed3[_0xcae6('0x31')]='%'+_0x1e092d;break;case _0xcae6('0x2f'):var _0x15f052=_0x1e092d['split'](',');var _0x1e092d=_0x15f052['shift']();var _0x3345ea=_0x15f052[_0xcae6('0x32')]();if(_0x376033==='DATE'){_0x1e092d=moment(_0x1e092d)[_0xcae6('0x33')](0x0,!![])['format']();_0x3345ea=moment(_0x3345ea)[_0xcae6('0x33')](0x0,!![])[_0xcae6('0x34')](0x17,_0xcae6('0x35'))[_0xcae6('0x34')](0x3b,'minutes')[_0xcae6('0x34')](0x3b,'seconds')[_0xcae6('0x1a')]();}_0x103ed3={'start':_0x1e092d,'end':_0x3345ea};break;default:_0x103ed3[_0xcae6('0x31')]=_0x1e092d;break;}return _0x103ed3;} \ No newline at end of file +var _0xa1d2=['$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','$lte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','format','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','[$and]','split','length','slice','forEach','shift','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','add','YYYY-MM-DD','castTo','\x20AS\x20','text','field','includes','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0xa1d2,0x1d2));var _0x2a1d=function(_0x39170d,_0x219e31){_0x39170d=_0x39170d-0x0;var _0x416467=_0xa1d2[_0x39170d];return _0x416467;};'use strict';var _=require(_0x2a1d('0x0'));var moment=require(_0x2a1d('0x1'));exports[_0x2a1d('0x2')]=function(_0x196910){var _0x7fe8b0={'conditions':[]};_0x7fe8b0[_0x2a1d('0x3')]=_['startsWith'](_0x196910,_0x2a1d('0x4'))?'or':_0x2a1d('0x5');var _0x57da65=_0x196910[_0x2a1d('0x6')](_0x2a1d('0x7'),'')[_0x2a1d('0x6')](_0x2a1d('0x4'),'')[_0x2a1d('0x8')]('||');for(var _0x44f775=0x0;_0x44f775<_0x57da65[_0x2a1d('0x9')];_0x44f775++){var _0x3546bc=_0x57da65[_0x44f775]['split'](':=');var _0x4d9cb1=_0x3546bc[0x0];var _0x25de85=_0x3546bc[_0x2a1d('0xa')](0x1);_0x25de85[_0x2a1d('0xb')](function(_0x4f77d6){var _0x44f204=_0x4f77d6[_0x2a1d('0x8')]('[')[_0x2a1d('0xc')]();var _0x34fdaf=_0x4f77d6['match'](/\[(.*?)\]/g);_0x34fdaf['forEach'](function(_0x59970c){var _0x41c6e6=_0x59970c['split']('[')[_0x2a1d('0xd')](function(_0x56012b){return _0x56012b[_0x2a1d('0xe')](']')>-0x1;})[_0x2a1d('0xf')](function(_0x53ef5f){return _0x53ef5f[_0x2a1d('0x8')](']')[0x0];})[0x0];_0x7fe8b0[_0x2a1d('0x10')][_0x2a1d('0x11')]({'field':_0x4d9cb1,'operator':_0x44f204,'value':_0x41c6e6});});});}return _0x7fe8b0;};exports[_0x2a1d('0x12')]=function(_0x58a14f,_0x3143db,_0x427f4b){var _0x231315={};if(_0x3143db===_0x2a1d('0x13')){if(_0x427f4b[_0x2a1d('0x14')]===_0x2a1d('0x15')){_0x427f4b[_0x2a1d('0x14')]='$between';_0x427f4b['value']+=','+_0x427f4b[_0x2a1d('0x16')];}else if(_['includes'](['$gt','$lte'],_0x427f4b[_0x2a1d('0x14')])){_0x427f4b[_0x2a1d('0x16')]=moment(_0x427f4b[_0x2a1d('0x16')])[_0x2a1d('0x17')](0x1,'days')['format'](_0x2a1d('0x18'));}}if(_0x427f4b[_0x2a1d('0x19')]){_0x3143db=_0x427f4b['castTo'];_0x231315['text']='CAST('+_0x58a14f+'.'+_0x427f4b['field']+_0x2a1d('0x1a')+_0x427f4b[_0x2a1d('0x19')]+')\x20'+parseOperator(_0x427f4b[_0x2a1d('0x14')]);}else{_0x231315[_0x2a1d('0x1b')]=_0x58a14f+'.'+_0x427f4b[_0x2a1d('0x1c')]+'\x20'+parseOperator(_0x427f4b[_0x2a1d('0x14')]);}if(_[_0x2a1d('0x1d')]([_0x2a1d('0x1e'),_0x2a1d('0x1f')],_0x427f4b['operator']))_0x231315[_0x2a1d('0x1b')]='('+_0x231315['text']+'\x20OR\x20'+_0x58a14f+'.'+_0x427f4b[_0x2a1d('0x1c')]+_0x2a1d('0x20');_0x231315[_0x2a1d('0x16')]=parseValue(_0x3143db,_0x427f4b['operator'],_0x427f4b[_0x2a1d('0x16')]);return _0x231315;};function parseOperator(_0x134908){var _0x4b423d;switch(_0x134908){case _0x2a1d('0x21'):_0x4b423d=_0x2a1d('0x22');break;case _0x2a1d('0x1f'):_0x4b423d=_0x2a1d('0x23');break;case'$eq':_0x4b423d=_0x2a1d('0x24');break;case _0x2a1d('0x1e'):_0x4b423d=_0x2a1d('0x25');break;case'$substring':case'$startsWith':case _0x2a1d('0x26'):_0x4b423d=_0x2a1d('0x27');break;case _0x2a1d('0x28'):_0x4b423d=_0x2a1d('0x29');break;case _0x2a1d('0x2a'):_0x4b423d=_0x2a1d('0x2b');break;case _0x2a1d('0x2c'):_0x4b423d='<=\x20?';break;case'$gte':_0x4b423d=_0x2a1d('0x2d');break;case _0x2a1d('0x2e'):_0x4b423d=_0x2a1d('0x2f');break;}return _0x4b423d;}function parseValue(_0x38b1a1,_0x700f62,_0x135563){var _0x4c37c5={'start':undefined,'end':undefined};switch(_0x700f62){case'$in':case _0x2a1d('0x1f'):_0x4c37c5[_0x2a1d('0x30')]=_0x135563['split'](',');break;case'$substring':_0x4c37c5['start']='%'+_0x135563+'%';break;case _0x2a1d('0x31'):_0x4c37c5['start']=_0x135563+'%';break;case _0x2a1d('0x26'):_0x4c37c5[_0x2a1d('0x30')]='%'+_0x135563;break;case'$between':var _0x513811=_0x135563[_0x2a1d('0x8')](',');var _0x135563=_0x513811[_0x2a1d('0xc')]();var _0x1c6899=_0x513811[_0x2a1d('0x32')]();if(_0x38b1a1===_0x2a1d('0x13')){_0x135563=moment(_0x135563)['utcOffset'](0x0,!![])[_0x2a1d('0x33')]();_0x1c6899=moment(_0x1c6899)[_0x2a1d('0x34')](0x0,!![])[_0x2a1d('0x17')](0x17,_0x2a1d('0x35'))[_0x2a1d('0x17')](0x3b,_0x2a1d('0x36'))['add'](0x3b,_0x2a1d('0x37'))[_0x2a1d('0x33')]();}_0x4c37c5={'start':_0x135563,'end':_0x1c6899};break;default:_0x4c37c5[_0x2a1d('0x30')]=_0x135563;break;}return _0x4c37c5;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6cee3cc..b7a011e 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 _0xfe5e=['options','include','lodash','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw','split','isEmpty','find','DATE','$gte','utc','format','$lte','YYYY-MM-DD','name','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','DESC','isObject','isString','isArray','unset','hasOwnProperty','omit','isNumeric','match','^[+]?[0-9]*$','isEmail','\x22{EXPR}\x22','{EXPR}','replace','forEach','push','join','getOptions','query','$id','filters','intersection','attributes','length','nolimit','order','where','pick','filter','columns','value','merge','VIRTUAL','lower'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe5e,0xc8));var _0xefe5=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xfe5e[_0x18d631];return _0x50d708;};'use strict';var _=require(_0xefe5('0x0'));var sequelize=require('sequelize');var moment=require(_0xefe5('0x1'));var db=require(_0xefe5('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x477ce9){var _0x4f2e0f=['ne'];try{var _0x522dc7=JSON[_0xefe5('0x3')](_0x477ce9);var _0xa4f9c2=Object[_0xefe5('0x4')](_0x522dc7)[0x0];return _0x4f2e0f[_0xefe5('0x5')](_0xa4f9c2);}catch(_0x2e9654){return![];}}function getOperatorValue(_0x5fd50b){var _0x196eeb=JSON[_0xefe5('0x3')](_0x5fd50b);var _0x59970b=Object[_0xefe5('0x4')](_0x196eeb)[0x0];var _0x23f6c8=_0x196eeb[_0x59970b];return{['$'+_0x59970b]:_0x23f6c8};}function parseIncludeModel(_0x553eab){var _0x3d0f0e=JSON['parse'](_0x553eab);return{'model':db[_0x3d0f0e[_0xefe5('0x6')]],'as':_0x3d0f0e[_0xefe5('0x7')],'attributes':_0x3d0f0e[_0xefe5('0x8')],'raw':_0x3d0f0e[_0xefe5('0x9')]};}exports['fields']=function(_0x779bd3){var _0x28e457=null;if(_0x779bd3){_0x28e457=_0x779bd3[_0xefe5('0xa')](',');}return _0x28e457;};exports['filters']=function(_0x476a09,_0x4a57f3){var _0x51ddd9={};if(!_[_0xefe5('0xb')](_0x476a09)){_['forOwn'](_0x476a09,function(_0x16c8f2,_0x1b8b7b){try{if(_0x4a57f3){var _0x465a17=_[_0xefe5('0xc')](_0x4a57f3,{'name':_0x1b8b7b})||{};if(hasSequelizeOperator(_0x16c8f2)){_0x51ddd9[_0x1b8b7b]=getOperatorValue(_0x16c8f2);}else if(_0x465a17['type']===_0xefe5('0xd')&&_['isPlainObject'](_0x16c8f2)){var _0x5f5823=JSON[_0xefe5('0x3')](_0x16c8f2);var _0x5736e4={'$gte':moment(moment(_0x5f5823[_0xefe5('0xe')])['format']('YYYY-MM-DD'))[_0xefe5('0xf')]()[_0xefe5('0x10')](),'$lte':moment(moment(_0x5f5823[_0xefe5('0x11')])[_0xefe5('0x10')](_0xefe5('0x12')))[_0xefe5('0xf')]()['subtract'](0x1,'s')[_0xefe5('0x10')]()};_0x51ddd9[_0x1b8b7b]=_0x5736e4;}else if(_0x465a17[_0xefe5('0x13')]==='uniqueid'){_0x51ddd9[_0x1b8b7b]=_0x16c8f2;}else{_0x51ddd9[_0x1b8b7b]=_['isArray'](_0x16c8f2)?_0x16c8f2:JSON['parse'](_0x16c8f2);}}else{_0x51ddd9[_0x1b8b7b]=_['isArray'](_0x16c8f2)?_0x16c8f2:JSON[_0xefe5('0x3')](_0x16c8f2);}}catch(_0x56488f){_0x51ddd9[_0x1b8b7b]=_0x16c8f2[_0xefe5('0xa')](',');}});}return _0x51ddd9;};exports[_0xefe5('0x14')]=function(_0x26c292){_0x26c292=parseInt(_0x26c292,0xa);if(!_0x26c292||_0x26c292<0x0){_0x26c292=LIMIT_VALUE;}return _0x26c292;};exports[_0xefe5('0x15')]=function(_0x416ab1){_0x416ab1=parseInt(_0x416ab1,0xa);if(!_0x416ab1||_0x416ab1<0x0){_0x416ab1=0x0;}return _0x416ab1;};exports[_0xefe5('0x16')]=function(_0x553a38){var _0x2b67fc,_0x70b437=null;if(_0x553a38){_0x2b67fc=_0x553a38[_0xefe5('0xa')](',');_0x70b437=_[_0xefe5('0x17')](_0x2b67fc,function(_0x4963a2){if(_0x4963a2[_0xefe5('0x18')]('-')===0x0){return[_0x4963a2===_0xefe5('0x19')?sequelize[_0xefe5('0x1a')](sequelize[_0xefe5('0x1b')](_0xefe5('0x19')),_0xefe5('0x1c')):_0x4963a2[_0xefe5('0x1d')](0x1),_0xefe5('0x1e')];}else{return[_0x4963a2===_0xefe5('0x19')?sequelize[_0xefe5('0x1a')](sequelize[_0xefe5('0x1b')]('priority'),_0xefe5('0x1c')):_0x4963a2,'ASC'];}});}return _0x70b437;};exports['omit']=function(_0x89ebe9,_0x22d3d3){if(_[_0xefe5('0xb')](_0x89ebe9)){return _0x89ebe9;}if(_['isArray'](_0x89ebe9)){for(var _0x1fd1a2=0x0;_0x1fd1a2<_0x89ebe9['length'];_0x1fd1a2+=0x1){_0x89ebe9[_0x1fd1a2]=this['omit'](_0x89ebe9[_0x1fd1a2],_0x22d3d3);}return _0x89ebe9;}if(!_[_0xefe5('0x1f')](_0x89ebe9)){return _0x89ebe9;}if(_[_0xefe5('0x20')](_0x22d3d3)){_0x22d3d3=[_0x22d3d3];}if(!_[_0xefe5('0x21')](_0x22d3d3)){return _0x89ebe9;}for(var _0x5e65c5=0x0;_0x5e65c5<_0x22d3d3['length'];_0x5e65c5+=0x1){_[_0xefe5('0x22')](_0x89ebe9,_0x22d3d3[_0x5e65c5]);}for(var _0x55a1cd in _0x89ebe9){if(_0x89ebe9[_0xefe5('0x23')](_0x55a1cd)){_0x89ebe9[_0x55a1cd]=this[_0xefe5('0x24')](_0x89ebe9[_0x55a1cd],_0x22d3d3);}}return _0x89ebe9;};exports[_0xefe5('0x25')]=function(_0x1701cd){return _0x1701cd[_0xefe5('0x26')](RegExp(_0xefe5('0x27')))?!![]:![];};exports[_0xefe5('0x28')]=function(_0x31e9ea){return _0x31e9ea[_0xefe5('0x26')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x45feb2,_0x8a18d0){var _0x26b7a4=[];var _0x5440fc=/([^:]")"+/g;var _0x4bac02=/[*<>~@-]/g;var _0xed06f6=/[ `!@#$%^&*()_\-?~<>]/;var _0x496d46=/[ ,]+/;var _0x54594d=_0x8a18d0?_0xefe5('0x29'):_0xefe5('0x2a');if(_0x8a18d0){_0x45feb2=_0x45feb2[_0xefe5('0x2b')](_0x4bac02,'\x20')['trim']();}_0x45feb2[_0xefe5('0xa')](_0x496d46)[_0xefe5('0x2c')](function(_0x10e9a4){_0x10e9a4=_0x10e9a4[_0xefe5('0x2b')](_0x5440fc,'$1');_0x10e9a4='+'+_0x10e9a4+'*';var _0x384b76=_0x10e9a4[_0xefe5('0x26')](_0xed06f6);if(_0x384b76){_0x10e9a4='\x22'+_0x10e9a4+'\x22';}_0x26b7a4[_0xefe5('0x2d')](_0x10e9a4);});_0x54594d=_0x54594d['replace'](_0xefe5('0x2a'),_0x26b7a4[_0xefe5('0x2e')]('\x20'));return _0x54594d;};exports[_0xefe5('0x2f')]=function(_0x2eef96,_0xf666e8,_0x203602){var _0x32b06d={},_0x4486a5={};if(_0xf666e8[_0xefe5('0x30')]['$id']){_0xf666e8[_0xefe5('0x30')]['id']=_0xf666e8['query']['$id'];delete _0xf666e8[_0xefe5('0x30')][_0xefe5('0x31')];}_0x32b06d[_0xefe5('0x6')]=_['map'](_0x2eef96,'name');_0x32b06d[_0xefe5('0x30')]=_['keys'](_0xf666e8['query']);_0x32b06d[_0xefe5('0x32')]=_[_0xefe5('0x33')](_0x32b06d[_0xefe5('0x6')],_0x32b06d[_0xefe5('0x30')]);_0x4486a5[_0xefe5('0x34')]=_[_0xefe5('0x33')](_0x32b06d[_0xefe5('0x6')],this[_0xefe5('0x8')](_0xf666e8['query'][_0xefe5('0x8')]));_0x4486a5['attributes']=_0x4486a5[_0xefe5('0x34')][_0xefe5('0x35')]?_0x4486a5[_0xefe5('0x34')]:_0x32b06d[_0xefe5('0x6')];if(!_0xf666e8[_0xefe5('0x30')][_0xefe5('0x23')](_0xefe5('0x36'))){_0x4486a5['limit']=this[_0xefe5('0x14')](_0xf666e8[_0xefe5('0x30')][_0xefe5('0x14')]);_0x4486a5[_0xefe5('0x15')]=this[_0xefe5('0x15')](_0xf666e8[_0xefe5('0x30')]['offset']);}_0x4486a5[_0xefe5('0x37')]=this[_0xefe5('0x16')](_0xf666e8[_0xefe5('0x30')]['sort']);_0x4486a5[_0xefe5('0x38')]=this[_0xefe5('0x32')](_[_0xefe5('0x39')](_0xf666e8[_0xefe5('0x30')],_0x32b06d[_0xefe5('0x32')]),_0x2eef96);if(_0xf666e8[_0xefe5('0x30')][_0xefe5('0x3a')]){var _0xef6395=_0x2eef96;var _0x282821=_0xf666e8[_0xefe5('0x30')][_0xefe5('0x3a')];if(typeof _0x282821==='object'){_0xef6395=_[_0xefe5('0x3a')](_0x2eef96,function(_0x5e6c05){return _['includes'](_0x282821[_0xefe5('0x3b')],_0x5e6c05[_0xefe5('0x13')]);});_0x282821=_0x282821[_0xefe5('0x3c')];}_0x4486a5['where']=_[_0xefe5('0x3d')](_0x4486a5[_0xefe5('0x38')],{'$or':_['map'](_0xef6395,function(_0x59491e){if(_0x59491e['type']!==_0xefe5('0x3e')){if(_0x203602){return sequelize[_0xefe5('0x38')](sequelize['fn'](_0xefe5('0x3f'),sequelize['col'](_0x59491e[_0xefe5('0x13')])),{'$like':sequelize['fn'](_0xefe5('0x3f'),'%'+_0xf666e8[_0xefe5('0x30')][_0xefe5('0x3a')]+'%')});}else{var _0x3e2084={};_0x3e2084[_0x59491e[_0xefe5('0x13')]]={'$like':'%'+_0xf666e8[_0xefe5('0x30')]['filter']+'%'};return _0x3e2084;}}})});}_0x4486a5=_['merge']({},_0x4486a5,_0xf666e8[_0xefe5('0x40')]);return _0x4486a5;};exports[_0xefe5('0x41')]=function(_0x1b290a){var _0x496858=[];if(_0x1b290a['includeAll']){_0x496858[_0xefe5('0x2d')]({'all':!![]});}else if(_0x1b290a[_0xefe5('0x41')]){if(Array['isArray'](_0x1b290a[_0xefe5('0x41')])){_0x496858=Object['keys'](_0x1b290a[_0xefe5('0x41')])[_0xefe5('0x17')](function(_0x1dd1e8){return parseIncludeModel(_0x1b290a[_0xefe5('0x41')][_0x1dd1e8]);});}else{var _0x1c2a42=parseIncludeModel(_0x1b290a['include']);_0x496858['push'](_0x1c2a42);}}return _0x496858;}; \ No newline at end of file +var _0x4d6f=['isEmpty','forOwn','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','name','uniqueid','isArray','split','sort','map','indexOf','priority','unsigned','substr','DESC','cast','col','ASC','length','omit','isObject','isString','hasOwnProperty','match','isEmail','getFullTextValue','\x22{EXPR}\x22','{EXPR}','replace','trim','push','join','getOptions','$id','query','intersection','attributes','limit','offset','where','pick','filter','object','columns','value','merge','lower','options','include','sequelize','moment','../../mysqldb','parse','keys','includes','model','alias','fields','raw','filters'];(function(_0x3ff685,_0x304b9e){var _0x2046c9=function(_0x7a10e9){while(--_0x7a10e9){_0x3ff685['push'](_0x3ff685['shift']());}};_0x2046c9(++_0x304b9e);}(_0x4d6f,0xf9));var _0xf4d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d6f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var sequelize=require(_0xf4d6('0x0'));var moment=require(_0xf4d6('0x1'));var db=require(_0xf4d6('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x5a9e9b){var _0x56f7e7=['ne'];try{var _0x1791b3=JSON[_0xf4d6('0x3')](_0x5a9e9b);var _0x225677=Object[_0xf4d6('0x4')](_0x1791b3)[0x0];return _0x56f7e7[_0xf4d6('0x5')](_0x225677);}catch(_0x4048c1){return![];}}function getOperatorValue(_0x31c65b){var _0x170cf2=JSON[_0xf4d6('0x3')](_0x31c65b);var _0x517d87=Object['keys'](_0x170cf2)[0x0];var _0x5d01d2=_0x170cf2[_0x517d87];return{['$'+_0x517d87]:_0x5d01d2};}function parseIncludeModel(_0x51916c){var _0x117216=JSON[_0xf4d6('0x3')](_0x51916c);return{'model':db[_0x117216[_0xf4d6('0x6')]],'as':_0x117216[_0xf4d6('0x7')],'attributes':_0x117216[_0xf4d6('0x8')],'raw':_0x117216[_0xf4d6('0x9')]};}exports[_0xf4d6('0x8')]=function(_0x15a3f2){var _0x5d11d2=null;if(_0x15a3f2){_0x5d11d2=_0x15a3f2['split'](',');}return _0x5d11d2;};exports[_0xf4d6('0xa')]=function(_0x5d3aa5,_0x53c0b7){var _0x194453={};if(!_[_0xf4d6('0xb')](_0x5d3aa5)){_[_0xf4d6('0xc')](_0x5d3aa5,function(_0x1ccbaa,_0x53f24c){try{if(_0x53c0b7){var _0x26b6c2=_['find'](_0x53c0b7,{'name':_0x53f24c})||{};if(hasSequelizeOperator(_0x1ccbaa)){_0x194453[_0x53f24c]=getOperatorValue(_0x1ccbaa);}else if(_0x26b6c2['type']===_0xf4d6('0xd')&&_[_0xf4d6('0xe')](_0x1ccbaa)){var _0x28a56a=JSON[_0xf4d6('0x3')](_0x1ccbaa);var _0x2ec018={'$gte':moment(moment(_0x28a56a[_0xf4d6('0xf')])[_0xf4d6('0x10')](_0xf4d6('0x11')))[_0xf4d6('0x12')]()['format'](),'$lte':moment(moment(_0x28a56a[_0xf4d6('0x13')])[_0xf4d6('0x10')](_0xf4d6('0x11')))[_0xf4d6('0x12')]()['subtract'](0x1,'s')['format']()};_0x194453[_0x53f24c]=_0x2ec018;}else if(_0x26b6c2[_0xf4d6('0x14')]===_0xf4d6('0x15')){_0x194453[_0x53f24c]=_0x1ccbaa;}else{_0x194453[_0x53f24c]=_[_0xf4d6('0x16')](_0x1ccbaa)?_0x1ccbaa:JSON[_0xf4d6('0x3')](_0x1ccbaa);}}else{_0x194453[_0x53f24c]=_['isArray'](_0x1ccbaa)?_0x1ccbaa:JSON['parse'](_0x1ccbaa);}}catch(_0x34a738){_0x194453[_0x53f24c]=_0x1ccbaa[_0xf4d6('0x17')](',');}});}return _0x194453;};exports['limit']=function(_0x139c9d){_0x139c9d=parseInt(_0x139c9d,0xa);if(!_0x139c9d||_0x139c9d<0x0){_0x139c9d=LIMIT_VALUE;}return _0x139c9d;};exports['offset']=function(_0x22299a){_0x22299a=parseInt(_0x22299a,0xa);if(!_0x22299a||_0x22299a<0x0){_0x22299a=0x0;}return _0x22299a;};exports[_0xf4d6('0x18')]=function(_0x37626e){var _0x230b3a,_0x6c30cd=null;if(_0x37626e){_0x230b3a=_0x37626e['split'](',');_0x6c30cd=_[_0xf4d6('0x19')](_0x230b3a,function(_0x19e104){if(_0x19e104[_0xf4d6('0x1a')]('-')===0x0){return[_0x19e104===_0xf4d6('0x1b')?sequelize['cast'](sequelize['col'](_0xf4d6('0x1b')),_0xf4d6('0x1c')):_0x19e104[_0xf4d6('0x1d')](0x1),_0xf4d6('0x1e')];}else{return[_0x19e104===_0xf4d6('0x1b')?sequelize[_0xf4d6('0x1f')](sequelize[_0xf4d6('0x20')](_0xf4d6('0x1b')),_0xf4d6('0x1c')):_0x19e104,_0xf4d6('0x21')];}});}return _0x6c30cd;};exports['omit']=function(_0x412c30,_0x47f2d6){if(_[_0xf4d6('0xb')](_0x412c30)){return _0x412c30;}if(_[_0xf4d6('0x16')](_0x412c30)){for(var _0x867781=0x0;_0x867781<_0x412c30[_0xf4d6('0x22')];_0x867781+=0x1){_0x412c30[_0x867781]=this[_0xf4d6('0x23')](_0x412c30[_0x867781],_0x47f2d6);}return _0x412c30;}if(!_[_0xf4d6('0x24')](_0x412c30)){return _0x412c30;}if(_[_0xf4d6('0x25')](_0x47f2d6)){_0x47f2d6=[_0x47f2d6];}if(!_[_0xf4d6('0x16')](_0x47f2d6)){return _0x412c30;}for(var _0x210323=0x0;_0x210323<_0x47f2d6[_0xf4d6('0x22')];_0x210323+=0x1){_['unset'](_0x412c30,_0x47f2d6[_0x210323]);}for(var _0x4b8b7e in _0x412c30){if(_0x412c30[_0xf4d6('0x26')](_0x4b8b7e)){_0x412c30[_0x4b8b7e]=this['omit'](_0x412c30[_0x4b8b7e],_0x47f2d6);}}return _0x412c30;};exports['isNumeric']=function(_0x24dc76){return _0x24dc76[_0xf4d6('0x27')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xf4d6('0x28')]=function(_0x5585c7){return _0x5585c7[_0xf4d6('0x27')](/^\S+@\S+$/)?!![]:![];};exports[_0xf4d6('0x29')]=function(_0x1c27bf,_0x591827){var _0x35b281=[];var _0x1602b0=/([^:]")"+/g;var _0x13565d=/[*<>~@-]/g;var _0x771ed2=/[ `!@#$%^&*()_\-?~<>]/;var _0x2d348c=/[ ,]+/;var _0x2da384=_0x591827?_0xf4d6('0x2a'):_0xf4d6('0x2b');if(_0x591827){_0x1c27bf=_0x1c27bf[_0xf4d6('0x2c')](_0x13565d,'\x20')[_0xf4d6('0x2d')]();}_0x1c27bf[_0xf4d6('0x17')](_0x2d348c)['forEach'](function(_0x59bb81){_0x59bb81=_0x59bb81[_0xf4d6('0x2c')](_0x1602b0,'$1');_0x59bb81='+'+_0x59bb81+'*';var _0x3ec877=_0x59bb81[_0xf4d6('0x27')](_0x771ed2);if(_0x3ec877){_0x59bb81='\x22'+_0x59bb81+'\x22';}_0x35b281[_0xf4d6('0x2e')](_0x59bb81);});_0x2da384=_0x2da384[_0xf4d6('0x2c')]('{EXPR}',_0x35b281[_0xf4d6('0x2f')]('\x20'));return _0x2da384;};exports[_0xf4d6('0x30')]=function(_0x4549a0,_0xfa406c,_0x1ea242){var _0xba21b9={},_0x5b8f49={};if(_0xfa406c['query'][_0xf4d6('0x31')]){_0xfa406c[_0xf4d6('0x32')]['id']=_0xfa406c[_0xf4d6('0x32')][_0xf4d6('0x31')];delete _0xfa406c[_0xf4d6('0x32')][_0xf4d6('0x31')];}_0xba21b9['model']=_[_0xf4d6('0x19')](_0x4549a0,'name');_0xba21b9[_0xf4d6('0x32')]=_[_0xf4d6('0x4')](_0xfa406c[_0xf4d6('0x32')]);_0xba21b9[_0xf4d6('0xa')]=_[_0xf4d6('0x33')](_0xba21b9['model'],_0xba21b9[_0xf4d6('0x32')]);_0x5b8f49['attributes']=_[_0xf4d6('0x33')](_0xba21b9[_0xf4d6('0x6')],this[_0xf4d6('0x8')](_0xfa406c[_0xf4d6('0x32')]['fields']));_0x5b8f49[_0xf4d6('0x34')]=_0x5b8f49['attributes'][_0xf4d6('0x22')]?_0x5b8f49[_0xf4d6('0x34')]:_0xba21b9[_0xf4d6('0x6')];if(!_0xfa406c['query'][_0xf4d6('0x26')]('nolimit')){_0x5b8f49[_0xf4d6('0x35')]=this[_0xf4d6('0x35')](_0xfa406c[_0xf4d6('0x32')]['limit']);_0x5b8f49['offset']=this[_0xf4d6('0x36')](_0xfa406c['query'][_0xf4d6('0x36')]);}_0x5b8f49['order']=this[_0xf4d6('0x18')](_0xfa406c[_0xf4d6('0x32')]['sort']);_0x5b8f49[_0xf4d6('0x37')]=this[_0xf4d6('0xa')](_[_0xf4d6('0x38')](_0xfa406c[_0xf4d6('0x32')],_0xba21b9[_0xf4d6('0xa')]),_0x4549a0);if(_0xfa406c[_0xf4d6('0x32')][_0xf4d6('0x39')]){var _0x187234=_0x4549a0;var _0xf740d8=_0xfa406c[_0xf4d6('0x32')]['filter'];if(typeof _0xf740d8===_0xf4d6('0x3a')){_0x187234=_['filter'](_0x4549a0,function(_0x100610){return _[_0xf4d6('0x5')](_0xf740d8[_0xf4d6('0x3b')],_0x100610['name']);});_0xf740d8=_0xf740d8[_0xf4d6('0x3c')];}_0x5b8f49['where']=_[_0xf4d6('0x3d')](_0x5b8f49[_0xf4d6('0x37')],{'$or':_[_0xf4d6('0x19')](_0x187234,function(_0x3776ab){if(_0x3776ab['type']!=='VIRTUAL'){if(_0x1ea242){return sequelize['where'](sequelize['fn'](_0xf4d6('0x3e'),sequelize[_0xf4d6('0x20')](_0x3776ab[_0xf4d6('0x14')])),{'$like':sequelize['fn'](_0xf4d6('0x3e'),'%'+_0xfa406c[_0xf4d6('0x32')]['filter']+'%')});}else{var _0x29864d={};_0x29864d[_0x3776ab[_0xf4d6('0x14')]]={'$like':'%'+_0xfa406c[_0xf4d6('0x32')][_0xf4d6('0x39')]+'%'};return _0x29864d;}}})});}_0x5b8f49=_[_0xf4d6('0x3d')]({},_0x5b8f49,_0xfa406c[_0xf4d6('0x3f')]);return _0x5b8f49;};exports[_0xf4d6('0x40')]=function(_0xe106d1){var _0x510da5=[];if(_0xe106d1['includeAll']){_0x510da5[_0xf4d6('0x2e')]({'all':!![]});}else if(_0xe106d1[_0xf4d6('0x40')]){if(Array[_0xf4d6('0x16')](_0xe106d1[_0xf4d6('0x40')])){_0x510da5=Object['keys'](_0xe106d1[_0xf4d6('0x40')])[_0xf4d6('0x19')](function(_0x55c471){return parseIncludeModel(_0xe106d1[_0xf4d6('0x40')][_0x55c471]);});}else{var _0x6b6a8=parseIncludeModel(_0xe106d1[_0xf4d6('0x40')]);_0x510da5[_0xf4d6('0x2e')](_0x6b6a8);}}return _0x510da5;};exports['escapeLIKESpecialChars']=function(_0x335db7){return _0x335db7[_0xf4d6('0x2c')](/[%_^-]/g,function(_0x4aa1e8){return'\x5c'+_0x4aa1e8;});}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index d57f43e..e222733 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 _0x7da7=['whatsappStatus','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','catch','unknown','*pause','busy','isArray','startCase','Queue','map','getAgents','all','then','flatten','uniq','value','getAgentIdsByStatus','includes','User','findAll','chatPause','openchannelPause','pauseType','globalStatus','split','fields','order','DESC','fullname','indexOf','internal','validateSortParameter','pause','toLowerCase','sortAgentsByStatus','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','filterAgentAttributes','name','role','userpic','voiceStatusTime','whatsappStatusTime','openchannelCapacity','chatCurrentCapacity','smsCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','smsPause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voicePause','voiceStatus','chatStatus','faxStatus','openchannelStatus','smsStatus'];(function(_0x3de2e7,_0x50525e){var _0x13254f=function(_0x149677){while(--_0x149677){_0x3de2e7['push'](_0x3de2e7['shift']());}};_0x13254f(++_0x50525e);}(_0x7da7,0x10d));var _0x77da=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x7da7[_0x188d31];return _0x30ed33;};'use strict';var _=require(_0x77da('0x0'));var jayson=require(_0x77da('0x1'));var db=require(_0x77da('0x2'))['db'];var amiClient=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x77da('0x3')][_0x77da('0x4')]({'port':0x232c});function isAgentPaused(_0x4f60c3,_0x3a9fa6){var _0x37b3d9=[_0x4f60c3['chatPause'],_0x4f60c3[_0x77da('0x5')],_0x4f60c3[_0x77da('0x6')],_0x4f60c3['openchannelPause'],_0x4f60c3[_0x77da('0x7')],_0x4f60c3['voicePause'],_0x4f60c3[_0x77da('0x8')]];if(!_0x3a9fa6)return _[_0x77da('0x9')](_0x37b3d9);var _0x37c5ab=_[_0x77da('0xa')](_0x37b3d9);return _0x37c5ab[_0x77da('0xb')]>0x0&&_0x37c5ab['length']<_0x37b3d9[_0x77da('0xb')]?!![]:![];}function isIdle(_0xb55827){return _0xb55827===_0x77da('0xc')||_0xb55827==='unknown'||_0xb55827===_0x77da('0xd')||_0xb55827===_0x77da('0xe')||_[_0x77da('0xf')](_0xb55827);}function isAgentIdle(_0x2a675a){if(_0x2a675a['voiceStatus']!==_0x77da('0xc')&&_0x2a675a[_0x77da('0x10')]){_0x2a675a[_0x77da('0x11')]='pause';return![];}return _['every']([_0x2a675a[_0x77da('0x12')],_0x2a675a[_0x77da('0x13')],_0x2a675a['mailStatus'],_0x2a675a[_0x77da('0x14')],_0x2a675a[_0x77da('0x15')],_0x2a675a[_0x77da('0x11')],_0x2a675a[_0x77da('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x77da('0x17'),{})['then'](function(_0x29cd7b){if(_0x29cd7b[_0x77da('0x18')]){throw new Error(_0x77da('0x19'));}var _0x4500c4=_0x29cd7b['result'];return routingClient['request']('Agents',{})['then'](function(_0x103e46){if(_0x103e46[_0x77da('0x18')]){throw new Error(_0x77da('0x1a'));}var _0x335dcb=_0x103e46[_0x77da('0x1b')];return _[_0x77da('0x1c')]({},_0x4500c4,_0x335dcb);});})[_0x77da('0x1d')](function(_0x3b6dde){throw _0x3b6dde;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x492063){var _0xd5a809=_0x77da('0x1e');if(isAgentPaused(_0x492063))_0xd5a809='pause';else if(isAgentPaused(_0x492063,!![]))_0xd5a809=_0x77da('0x1f');else if(isAgentIdle(_0x492063))_0xd5a809=_0x77da('0xc');else _0xd5a809=_0x77da('0x20');return _0xd5a809;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x58270c,_0x3e6cfe){var _0x58f6c1=_[_0x77da('0x21')](_0x58270c)?_0x58270c:[_0x58270c];var _0x1c27aa=_[_0x77da('0x22')](_0x3e6cfe)+_0x77da('0x23');var _0x10399a=_[_0x77da('0x24')](_0x58f6c1,function(_0x95b5db){return db[_0x1c27aa]['findOne']({'where':{'id':_0x95b5db}})['then'](function(_0xfd160){if(!_0xfd160)return[];return _0xfd160[_0x77da('0x25')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x77da('0x26')](_0x10399a)[_0x77da('0x27')](function(_0x545654){var _0x42240b=_(_0x545654)[_0x77da('0x28')]()[_0x77da('0x24')]('id')[_0x77da('0x29')]()[_0x77da('0x2a')]();return _0x42240b;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xce24b8,_0x3e090d,_0x1f2279){try{if(_0x3e090d[_0x77da('0xb')]>0x0){_0xce24b8=_0xce24b8['filter'](function(_0x5b4638){return _0x3e090d['includes'](_0x5b4638['id']);});}var _0x2258e9=_0xce24b8[_0x77da('0xa')](function(_0x410d09){var _0x3394d6=_0x77da('0x20');if(isAgentIdle(_0x410d09)){_0x3394d6='idle';}return _0x3394d6===_0x1f2279;});return _[_0x77da('0x24')](_0x2258e9,'id');}catch(_0x26f5a0){throw _0x26f5a0;}}exports[_0x77da('0x2b')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1d381b,_0x1e7853,_0x46e6b4){return Promise['resolve']()[_0x77da('0x27')](function(){if(_0x1e7853[_0x77da('0xb')]>0x0){_0x1d381b=_0x1d381b[_0x77da('0xa')](function(_0x38643a){return _0x1e7853[_0x77da('0x2c')](_0x38643a['id']);});}return _0x1d381b;})[_0x77da('0x27')](function(){return db[_0x77da('0x2d')][_0x77da('0x2e')]({'attributes':['id','name','fullname',_0x77da('0x2f'),_0x77da('0x5'),'mailPause',_0x77da('0x30'),_0x77da('0x7'),_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x31')],'where':{'id':{'$in':_[_0x77da('0x24')](_0x1d381b,'id')}},'raw':!![]});})[_0x77da('0x27')](function(_0x5c4a03){return _0x5c4a03[_0x77da('0x24')](function(_0x4df4b9){var _0x54b7f2=_['find'](_0x1d381b,['id',_0x4df4b9['id']]);var _0x17d236=filterAgentAttributes(_0x54b7f2);_['merge'](_0x4df4b9,_0x17d236);_0x4df4b9[_0x77da('0x32')]=getAgentStatus(_0x4df4b9);return _0x4df4b9;});})[_0x77da('0x27')](function(_0xce9df2){var _0x3cc78b=sortAgentsByStatus(_0xce9df2,_0x46e6b4);return _[_0x77da('0x24')](_0x3cc78b,'id');})[_0x77da('0x1d')](function(_0x43c20a){throw _0x43c20a;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x297d49){var _0x467410={'fields':[],'order':null};var _0x1ca53a=_0x297d49[_0x77da('0x33')](',');_0x467410[_0x77da('0x34')]=_[_0x77da('0xa')](_0x1ca53a,function(_0x48fccc){if(!_0x48fccc[_0x77da('0x2c')](_0x77da('0x32'))){return!![];}_0x467410[_0x77da('0x35')]=_['startsWith'](_0x48fccc,'-')?_0x77da('0x36'):'ASC';return![];});return _0x467410;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x599e21){if(!_0x599e21){_0x599e21='fullname,internal';}if(_0x599e21[_0x77da('0x2c')](_0x77da('0x37'))&&!_0x599e21[_0x77da('0x2c')]('internal')){var _0x21d337=_0x599e21['substring'](0x0,_0x599e21[_0x77da('0x38')]('fullname'));_0x599e21+=','+_0x21d337+_0x77da('0x39');}return _0x599e21;}exports[_0x77da('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x290667,_0x1612b7){var _0x240bee=_0x290667['sort'](function(_0x759b86,_0x1f48bd){if(_0x759b86[_0x77da('0x32')]===_0x1f48bd[_0x77da('0x32')]){if(_0x759b86[_0x77da('0x32')]===_0x77da('0x3b')){if(_0x1612b7==='DESC'){return(_0x759b86[_0x77da('0x31')]||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return(_0x759b86['pauseType']||'')<(_0x1f48bd[_0x77da('0x31')]||'')||_0x759b86['fullname'][_0x77da('0x3c')]()>_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}else{if(_0x1612b7==='DESC'){return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?0x1:-0x1;}else{return _0x759b86[_0x77da('0x37')][_0x77da('0x3c')]()<_0x1f48bd[_0x77da('0x37')][_0x77da('0x3c')]()?-0x1:0x1;}}}else{if(_0x1612b7===_0x77da('0x36')){return _0x759b86['globalStatus']<_0x1f48bd[_0x77da('0x32')]?0x1:-0x1;}else{return _0x759b86[_0x77da('0x32')]<_0x1f48bd[_0x77da('0x32')]?-0x1:0x1;}}});return _0x240bee;}exports[_0x77da('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x4644f3){var _0x2e3c38=['userpic','online',_0x77da('0x3e'),_0x77da('0x3f'),_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x39'),_0x77da('0x40'),'chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),'chatCapacity','openchannelCapacity',_0x77da('0x41'),_0x77da('0x42'),_0x77da('0x43'),_0x77da('0x44'),'chatCurrentCapacity',_0x77da('0x45'),_0x77da('0x46'),'smsCurrentCapacity',_0x77da('0x47'),_0x77da('0x48'),'chatStatus',_0x77da('0x14'),_0x77da('0x49'),_0x77da('0x15'),_0x77da('0x16'),_0x77da('0x13'),_0x77da('0x11'),_0x77da('0x4a'),_0x77da('0x4b'),_0x77da('0x4c'),_0x77da('0x4d'),'whatsappStatusTime',_0x77da('0x4e'),'voiceStatusTime',_0x77da('0x4f'),_0x77da('0x50'),_0x77da('0x51'),_0x77da('0x52'),_0x77da('0x53'),_0x77da('0x54')];var _0x3a78d2=['chatPause',_0x77da('0x30'),_0x77da('0x6'),_0x77da('0x7'),_0x77da('0x8'),'faxPause',_0x77da('0x10'),_0x77da('0x55')];var _0x133b14=_(_0x4644f3)['omit'](_0x3a78d2)['pick'](_0x2e3c38)[_0x77da('0x2a')]();return _0x133b14;}exports[_0x77da('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x77da('0x57'),_0x77da('0x37'),_0x77da('0x58'),'internal','online',_0x77da('0x32'),_0x77da('0x59'),'lastLoginAt',_0x77da('0x31'),_0x77da('0x3f'),_0x77da('0x5'),'chatPause',_0x77da('0x6'),_0x77da('0x30'),'smsPause',_0x77da('0x10'),_0x77da('0x8'),_0x77da('0x12'),_0x77da('0x13'),_0x77da('0x49'),_0x77da('0x14'),_0x77da('0x15'),_0x77da('0x11'),_0x77da('0x16'),'chatStatusTime',_0x77da('0x4e'),_0x77da('0x4c'),_0x77da('0x4b'),_0x77da('0x4d'),_0x77da('0x5a'),_0x77da('0x5b'),'chatCapacity',_0x77da('0x44'),_0x77da('0x41'),_0x77da('0x5c'),'smsCapacity',_0x77da('0x43'),_0x77da('0x5d'),_0x77da('0x48'),_0x77da('0x46'),_0x77da('0x45'),_0x77da('0x5e'),_0x77da('0x47'),'phoneBarEnableScreenRecordingByAgent',_0x77da('0x53'),'destconnectedlinenum',_0x77da('0x5f'),_0x77da('0x4f'),_0x77da('0x54'),'screenrecording'];}exports[_0x77da('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x326f=['faxStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','routealias','omit','pick','filterAgentAttributes','role','chatStatusTime','whatsappStatusTime','openchannelCurrentCapacity','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum','onhold','screenrecording','getRealtimeAgentsQueryFields','lodash','client','http','chatPause','faxPause','mailPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','ringing','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','findAll','name','fullname','openchannelPause','pauseType','find','merge','getSortedAgentsIdsByStatus','split','filter','globalStatus','startsWith','DESC','ASC','getUpdatedSortOptions','validateSortParameter','toLowerCase','userpic','lastLoginAt','lastPauseAt','internal','address','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatus','openchannelStatusTime','mailStatusTime','smsStatusTime'];(function(_0xc9638,_0x2d4e6e){var _0x544d81=function(_0x5552c1){while(--_0x5552c1){_0xc9638['push'](_0xc9638['shift']());}};_0x544d81(++_0x2d4e6e);}(_0x326f,0xd1));var _0xf326=function(_0x599aae,_0x14f861){_0x599aae=_0x599aae-0x0;var _0x3b6108=_0x326f[_0x599aae];return _0x3b6108;};'use strict';var _=require(_0xf326('0x0'));var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232a});var routingClient=jayson[_0xf326('0x1')][_0xf326('0x2')]({'port':0x232c});function isAgentPaused(_0x27e8d7,_0x120a26){var _0x9445c6=[_0x27e8d7[_0xf326('0x3')],_0x27e8d7[_0xf326('0x4')],_0x27e8d7[_0xf326('0x5')],_0x27e8d7['openchannelPause'],_0x27e8d7[_0xf326('0x6')],_0x27e8d7[_0xf326('0x7')],_0x27e8d7[_0xf326('0x8')]];if(!_0x120a26)return _[_0xf326('0x9')](_0x9445c6);var _0x515bfa=_['filter'](_0x9445c6);return _0x515bfa['length']>0x0&&_0x515bfa[_0xf326('0xa')]<_0x9445c6[_0xf326('0xa')]?!![]:![];}function isIdle(_0x163416){return _0x163416===_0xf326('0xb')||_0x163416===_0xf326('0xc')||_0x163416==='unavailable'||_0x163416===_0xf326('0xd')||_['isNil'](_0x163416);}function isAgentIdle(_0x1cf441){if(_0x1cf441['voiceStatus']!==_0xf326('0xb')&&_0x1cf441['voicePause']){_0x1cf441[_0xf326('0xe')]=_0xf326('0xf');return![];}return _['every']([_0x1cf441[_0xf326('0x10')],_0x1cf441[_0xf326('0x11')],_0x1cf441[_0xf326('0x12')],_0x1cf441[_0xf326('0x13')],_0x1cf441['smsStatus'],_0x1cf441[_0xf326('0xe')],_0x1cf441['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0xf326('0x14'),{})[_0xf326('0x15')](function(_0x1f2e5a){if(_0x1f2e5a[_0xf326('0x16')]){throw new Error(_0xf326('0x17'));}var _0x287a2a=_0x1f2e5a[_0xf326('0x18')];return routingClient[_0xf326('0x19')]('Agents',{})[_0xf326('0x15')](function(_0x453100){if(_0x453100[_0xf326('0x16')]){throw new Error(_0xf326('0x1a'));}var _0xcef2b5=_0x453100[_0xf326('0x18')];return _['merge']({},_0x287a2a,_0xcef2b5);});})['catch'](function(_0x56ad41){throw _0x56ad41;});}exports[_0xf326('0x1b')]=getRealtimeAgents;function getAgentStatus(_0x289f4b){var _0x484cbe='unknown';if(isAgentPaused(_0x289f4b))_0x484cbe=_0xf326('0xf');else if(isAgentPaused(_0x289f4b,!![]))_0x484cbe='*pause';else if(isAgentIdle(_0x289f4b))_0x484cbe='idle';else _0x484cbe=_0xf326('0x1c');return _0x484cbe;}exports[_0xf326('0x1d')]=getAgentStatus;function getAgentIdsByQueues(_0x549b46,_0x5aa184){var _0x19b8ba=_[_0xf326('0x1e')](_0x549b46)?_0x549b46:[_0x549b46];var _0x5f21a2=_[_0xf326('0x1f')](_0x5aa184)+_0xf326('0x20');var _0x43c53e=_[_0xf326('0x21')](_0x19b8ba,function(_0x17c157){return db[_0x5f21a2][_0xf326('0x22')]({'where':{'id':_0x17c157}})['then'](function(_0x55b9f4){if(!_0x55b9f4)return[];return _0x55b9f4['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xf326('0x23')](_0x43c53e)[_0xf326('0x15')](function(_0x2cd45a){var _0x1ff2b5=_(_0x2cd45a)[_0xf326('0x24')]()[_0xf326('0x21')]('id')['uniq']()[_0xf326('0x25')]();return _0x1ff2b5;});}exports[_0xf326('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x212d5d,_0x581531,_0x1617d2){try{if(_0x581531['length']>0x0){_0x212d5d=_0x212d5d['filter'](function(_0x6a8e89){return _0x581531[_0xf326('0x27')](_0x6a8e89['id']);});}var _0x2fa28e=_0x212d5d['filter'](function(_0xc115d9){var _0x292500='busy';if(isAgentIdle(_0xc115d9)){_0x292500=_0xf326('0xb');}return _0x292500===_0x1617d2;});return _[_0xf326('0x21')](_0x2fa28e,'id');}catch(_0xd77aba){throw _0xd77aba;}}exports[_0xf326('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xa80156,_0x269be9,_0x161143){return Promise[_0xf326('0x29')]()[_0xf326('0x15')](function(){if(_0x269be9[_0xf326('0xa')]>0x0){_0xa80156=_0xa80156['filter'](function(_0x1035ed){return _0x269be9[_0xf326('0x27')](_0x1035ed['id']);});}return _0xa80156;})[_0xf326('0x15')](function(){return db['User'][_0xf326('0x2a')]({'attributes':['id',_0xf326('0x2b'),_0xf326('0x2c'),'chatPause','faxPause',_0xf326('0x5'),_0xf326('0x2d'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x2e')],'where':{'id':{'$in':_[_0xf326('0x21')](_0xa80156,'id')}},'raw':!![]});})[_0xf326('0x15')](function(_0x580374){return _0x580374[_0xf326('0x21')](function(_0x1981bc){var _0x51207a=_[_0xf326('0x2f')](_0xa80156,['id',_0x1981bc['id']]);var _0x4e5d7c=filterAgentAttributes(_0x51207a);_[_0xf326('0x30')](_0x1981bc,_0x4e5d7c);_0x1981bc['globalStatus']=getAgentStatus(_0x1981bc);return _0x1981bc;});})['then'](function(_0xadb020){var _0x4d8eac=sortAgentsByStatus(_0xadb020,_0x161143);return _[_0xf326('0x21')](_0x4d8eac,'id');})['catch'](function(_0x310dbb){throw _0x310dbb;});}exports[_0xf326('0x31')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2750ae){var _0x529cbb={'fields':[],'order':null};var _0x3dcc7e=_0x2750ae[_0xf326('0x32')](',');_0x529cbb['fields']=_[_0xf326('0x33')](_0x3dcc7e,function(_0xf64dd0){if(!_0xf64dd0[_0xf326('0x27')](_0xf326('0x34'))){return!![];}_0x529cbb['order']=_[_0xf326('0x35')](_0xf64dd0,'-')?_0xf326('0x36'):_0xf326('0x37');return![];});return _0x529cbb;}exports[_0xf326('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0x1d88ed){if(!_0x1d88ed){_0x1d88ed='fullname,internal';}if(_0x1d88ed[_0xf326('0x27')](_0xf326('0x2c'))&&!_0x1d88ed['includes']('internal')){var _0x40564e=_0x1d88ed['substring'](0x0,_0x1d88ed['indexOf'](_0xf326('0x2c')));_0x1d88ed+=','+_0x40564e+'internal';}return _0x1d88ed;}exports[_0xf326('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x37a95b,_0x2c1e7f){var _0x39611e=_0x37a95b['sort'](function(_0x9dda89,_0x45d344){if(_0x9dda89[_0xf326('0x34')]===_0x45d344[_0xf326('0x34')]){if(_0x9dda89[_0xf326('0x34')]===_0xf326('0xf')){if(_0x2c1e7f===_0xf326('0x36')){return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')]['toLowerCase']()?0x1:-0x1;}else{return(_0x9dda89[_0xf326('0x2e')]||'')<(_0x45d344[_0xf326('0x2e')]||'')||_0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()>_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344['fullname'][_0xf326('0x3a')]()?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x2c')][_0xf326('0x3a')]()<_0x45d344[_0xf326('0x2c')][_0xf326('0x3a')]()?-0x1:0x1;}}}else{if(_0x2c1e7f==='DESC'){return _0x9dda89['globalStatus']<_0x45d344[_0xf326('0x34')]?0x1:-0x1;}else{return _0x9dda89[_0xf326('0x34')]<_0x45d344['globalStatus']?-0x1:0x1;}}});return _0x39611e;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x8e318d){var _0x269e89=[_0xf326('0x3b'),'online',_0xf326('0x3c'),_0xf326('0x3d'),_0xf326('0x2e'),_0xf326('0x3d'),_0xf326('0x3e'),_0xf326('0x3f'),_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),_0xf326('0x40'),_0xf326('0x41'),'mailCapacity',_0xf326('0x42'),_0xf326('0x43'),_0xf326('0x44'),_0xf326('0x45'),'openchannelCurrentCapacity',_0xf326('0x46'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x49'),'chatStatus',_0xf326('0x13'),_0xf326('0x12'),_0xf326('0x4a'),_0xf326('0x4b'),_0xf326('0x11'),'voiceStatus','chatStatusTime',_0xf326('0x4c'),_0xf326('0x4d'),_0xf326('0x4e'),'whatsappStatusTime',_0xf326('0x4f'),_0xf326('0x50'),_0xf326('0x51'),'destconnectedlinenum','screenrecording',_0xf326('0x52'),'phoneBarEnableAutomaticScreenRecording',_0xf326('0x53')];var _0x554277=[_0xf326('0x3'),_0xf326('0x2d'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x8'),_0xf326('0x4'),_0xf326('0x7'),'online'];var _0xcdaf3f=_(_0x8e318d)[_0xf326('0x54')](_0x554277)[_0xf326('0x55')](_0x269e89)['value']();return _0xcdaf3f;}exports[_0xf326('0x56')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xf326('0x2b'),_0xf326('0x2c'),_0xf326('0x57'),_0xf326('0x3e'),'online',_0xf326('0x34'),_0xf326('0x3b'),_0xf326('0x3c'),_0xf326('0x2e'),'lastPauseAt',_0xf326('0x4'),_0xf326('0x3'),_0xf326('0x5'),_0xf326('0x2d'),'smsPause','voicePause',_0xf326('0x8'),_0xf326('0x10'),'faxStatus',_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x4a'),_0xf326('0xe'),'whatsappStatus',_0xf326('0x58'),'faxStatusTime','mailStatusTime',_0xf326('0x4c'),'smsStatusTime',_0xf326('0x50'),_0xf326('0x59'),_0xf326('0x40'),'faxCapacity','mailCapacity',_0xf326('0x41'),_0xf326('0x42'),_0xf326('0x43'),'chatCurrentCapacity',_0xf326('0x49'),'mailCurrentCapacity',_0xf326('0x5a'),_0xf326('0x47'),_0xf326('0x48'),_0xf326('0x52'),_0xf326('0x5b'),_0xf326('0x5c'),_0xf326('0x5d'),_0xf326('0x51'),_0xf326('0x53'),_0xf326('0x5e')];}exports[_0xf326('0x5f')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 3864bb0..ea25570 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 _0x23cc=['lodash','jayson/promise','util','client','http','available','loggedIn','busy','inUse','loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','statusMessage','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','concat','outbound','map','paused','waiting','originated','find','merge','pick','initializeQueues'];(function(_0xca6909,_0x31d421){var _0x44d08e=function(_0x528844){while(--_0x528844){_0xca6909['push'](_0xca6909['shift']());}};_0x44d08e(++_0x31d421);}(_0x23cc,0x1f4));var _0xc23c=function(_0x2726a1,_0x5b0c9f){_0x2726a1=_0x2726a1-0x0;var _0x1e2847=_0x23cc[_0x2726a1];return _0x1e2847;};'use strict';var _=require(_0xc23c('0x0'));var jayson=require(_0xc23c('0x1'));var util=require(_0xc23c('0x2'));var amiClient=jayson[_0xc23c('0x3')][_0xc23c('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0xc23c('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xc23c('0x5'),_0xc23c('0x6'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xc23c('0x7'),_0xc23c('0x8'),'invalid',_0xc23c('0x9'),_0xc23c('0xa'),'onHold',_0xc23c('0xb'),_0xc23c('0xc'),_0xc23c('0xd'),_0xc23c('0xe'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking','originated','message',_0xc23c('0xf'),_0xc23c('0x10'),'dialMethod',_0xc23c('0x11'),_0xc23c('0x12'),_0xc23c('0x13'),_0xc23c('0x14'),_0xc23c('0x15'),_0xc23c('0x16'),_0xc23c('0x17'),'dialPredictiveInterval',_0xc23c('0x18'),_0xc23c('0x19'),_0xc23c('0x1a'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0xc23c('0x1b'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0xc23c('0x1c')];function getRealtimeQueues(_0x3bf42d,_0x56e4c1){var _0x55732c=_0x56e4c1===_0xc23c('0x1d')?amiClient:routingClient;return _0x55732c[_0xc23c('0x1e')](_[_0xc23c('0x1f')](_0x56e4c1)+_0xc23c('0x20'),_0x3bf42d)[_0xc23c('0x21')](function(_0x16fe15){if(_0x16fe15[_0xc23c('0x22')])throw new Error(util[_0xc23c('0x23')](_0xc23c('0x24'),_0x56e4c1));return _0x16fe15[_0xc23c('0x25')];})[_0xc23c('0x26')](function(_0x7bd8d3){throw _0x7bd8d3;});}exports[_0xc23c('0x27')]=getRealtimeQueues;function initializeQueues(_0x4c95a4,_0x162d03,_0x20982b,_0x589836){var _0x128202=DEFAULT_QUEUE_ATTRIBUTES;if(_0x20982b===_0xc23c('0x1d')){if(_0x589836==='inbound'){_0x128202=_0x128202[_0xc23c('0x28')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x589836===_0xc23c('0x29')){_0x128202=_0x128202[_0xc23c('0x28')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4c95a4[_0xc23c('0x2a')](function(_0x5bf150){var _0x176ba9=_0x5bf150['get']({'plain':!![]});_0x176ba9[_0xc23c('0x2b')]=0x0;_0x176ba9['loggedInDb']=0x0;_0x176ba9[_0xc23c('0x6')]=0x0;_0x176ba9[_0xc23c('0x5')]=0x0;_0x176ba9[_0xc23c('0x2c')]=0x0;if(_0x20982b===_0xc23c('0x1d')){_0x176ba9[_0xc23c('0xd')]=0x0;_0x176ba9[_0xc23c('0x7')]=0x0;if(_0x589836===_0xc23c('0x29')){_0x176ba9['pTalking']=0x0;_0x176ba9[_0xc23c('0x2d')]=0x0;}}var _0x2f1ce9=_[_0xc23c('0x2e')](_0x162d03,['id',_0x176ba9['id']]);if(_0x2f1ce9){_[_0xc23c('0x2f')](_0x176ba9,_[_0xc23c('0x30')](_0x2f1ce9,_0x128202));}return _0x176ba9;});}exports[_0xc23c('0x31')]=initializeQueues; \ No newline at end of file +var _0x76a8=['inbound','concat','outbound','map','get','waiting','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','loggedIn','paused','busy','invalid','notInUse','onHold','ringInUse','talking','unknown','originated','statusMessage','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x76a8,0x6c));var _0x876a=function(_0x4caf7a,_0x8608d8){_0x4caf7a=_0x4caf7a-0x0;var _0x2e325f=_0x76a8[_0x4caf7a];return _0x2e325f;};'use strict';var _=require(_0x876a('0x0'));var jayson=require(_0x876a('0x1'));var util=require(_0x876a('0x2'));var amiClient=jayson[_0x876a('0x3')][_0x876a('0x4')]({'port':0x232a});var routingClient=jayson[_0x876a('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x876a('0x5'),_0x876a('0x6'),_0x876a('0x7'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x876a('0x8'),'inUse',_0x876a('0x9'),'loggedInDb',_0x876a('0xa'),_0x876a('0xb'),'ringing',_0x876a('0xc'),_0x876a('0xd'),'unavailable',_0x876a('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x876a('0xf'),'message',_0x876a('0x10'),'dialActive',_0x876a('0x11'),_0x876a('0x12'),_0x876a('0x13'),_0x876a('0x14'),_0x876a('0x15'),'erlangCallToSecond',_0x876a('0x16'),_0x876a('0x17'),'dialPredictiveInterval',_0x876a('0x18'),_0x876a('0x19'),_0x876a('0x1a'),_0x876a('0x1b'),_0x876a('0x1c'),_0x876a('0x1d'),'predictiveIntervalDroppedCallsCallersExit',_0x876a('0x1e'),_0x876a('0x1f')];function getRealtimeQueues(_0x131e1c,_0x30f791){var _0x4f287a=_0x30f791===_0x876a('0x20')?amiClient:routingClient;return _0x4f287a[_0x876a('0x21')](_['startCase'](_0x30f791)+'Queues',_0x131e1c)[_0x876a('0x22')](function(_0x139943){if(_0x139943[_0x876a('0x23')])throw new Error(util['format'](_0x876a('0x24'),_0x30f791));return _0x139943[_0x876a('0x25')];})['catch'](function(_0x55dab3){throw _0x55dab3;});}exports[_0x876a('0x26')]=getRealtimeQueues;function initializeQueues(_0x3a2285,_0x333273,_0x5e8981,_0x1145c3){var _0x394fe1=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5e8981==='voice'){if(_0x1145c3===_0x876a('0x27')){_0x394fe1=_0x394fe1[_0x876a('0x28')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1145c3===_0x876a('0x29')){_0x394fe1=_0x394fe1[_0x876a('0x28')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x3a2285[_0x876a('0x2a')](function(_0x4039de){var _0x2ede60=_0x4039de[_0x876a('0x2b')]({'plain':!![]});_0x2ede60[_0x876a('0x7')]=0x0;_0x2ede60['loggedInDb']=0x0;_0x2ede60[_0x876a('0x6')]=0x0;_0x2ede60[_0x876a('0x5')]=0x0;_0x2ede60[_0x876a('0x2c')]=0x0;if(_0x5e8981==='voice'){_0x2ede60[_0x876a('0xd')]=0x0;_0x2ede60[_0x876a('0x8')]=0x0;if(_0x1145c3===_0x876a('0x29')){_0x2ede60['pTalking']=0x0;_0x2ede60[_0x876a('0xf')]=0x0;}}var _0x3f8651=_[_0x876a('0x2d')](_0x333273,['id',_0x2ede60['id']]);if(_0x3f8651){_[_0x876a('0x2e')](_0x2ede60,_[_0x876a('0x2f')](_0x3f8651,_0x394fe1));}return _0x2ede60;});}exports[_0x876a('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 853b58b..6b197ae 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x582ccd,_0xa9ab43){var _0x11545d=function(_0x4010fa){while(--_0x4010fa){_0x582ccd['push'](_0x582ccd['shift']());}};_0x11545d(++_0xa9ab43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index e3fb074..2f1c912 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 _0xfc14=['win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','md5','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','keys','length','IPv4','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','model','join','createHash','hex','getUuid','licenseToken','test'];(function(_0x293d91,_0x2a8714){var _0x5ec6c1=function(_0x57d16a){while(--_0x57d16a){_0x293d91['push'](_0x293d91['shift']());}};_0x5ec6c1(++_0x2a8714);}(_0xfc14,0x1f4));var _0x4fc1=function(_0x458969,_0x12b9ee){_0x458969=_0x458969-0x0;var _0x48e183=_0xfc14[_0x458969];return _0x48e183;};'use strict';var _=require(_0x4fc1('0x0'));var os=require('os');var crypto=require(_0x4fc1('0x1'));var machine=require(_0x4fc1('0x2'));var exec=require(_0x4fc1('0x3'))[_0x4fc1('0x4')];var config=require(_0x4fc1('0x5'));function getInterfaces(){var _0x35cf3c=[];var _0x4605f7=os['networkInterfaces']();var _0x35494f=_['orderBy'](_[_0x4fc1('0x6')](_0x4605f7));for(var _0x2a5a2a=0x0;_0x2a5a2a<_0x35494f[_0x4fc1('0x7')];_0x2a5a2a++){var _0x49cd67=_0x4605f7[_0x35494f[_0x2a5a2a]]['filter'](function(_0x1e2e71){return _0x1e2e71['family']===_0x4fc1('0x8')&&_0x1e2e71['internal']===![];});_0x35cf3c=_0x35cf3c[_0x4fc1('0x9')](_0x49cd67);}return _0x35cf3c;}function getFirstInterface(){var _0x44617f=_[_0x4fc1('0xa')](getInterfaces());return{'macAddress':_0x44617f&&_0x44617f[_0x4fc1('0xb')]?_0x44617f[_0x4fc1('0xb')]:_0x4fc1('0xc'),'ipAddress':_0x44617f&&_0x44617f[_0x4fc1('0xd')]?_0x44617f[_0x4fc1('0xd')]:_0x4fc1('0xe')};}exports[_0x4fc1('0xf')]=getFirstInterface;function getCPUhash(){var _0x24b138=_[_0x4fc1('0x10')](os[_0x4fc1('0x11')]()['map'](function(_0x24dc09){return _0x24dc09[_0x4fc1('0x12')];}))[_0x4fc1('0x13')](':');return crypto[_0x4fc1('0x14')]('md5')['update'](_0x24b138)['digest'](_0x4fc1('0x15'));}exports[_0x4fc1('0x16')]=function(){var _0x391e5e=os['platform']();var _0x382ef7=/[0-9a-f-]{36}/;if(config[_0x4fc1('0x17')]&&_0x382ef7[_0x4fc1('0x18')](config[_0x4fc1('0x17')])){return config[_0x4fc1('0x17')];}else if(_0x391e5e===_0x4fc1('0x19')){return exec(_0x4fc1('0x1a'),{'encoding':_0x4fc1('0x1b')})[_0x4fc1('0x1c')]('\x0d\x0a','');}else{var _0x4a2603=getFirstInterface();var _0x3f5807=getCPUhash();var _0x387199=_0x3f5807+'|'+os[_0x4fc1('0x1d')]()+'|'+_0x4a2603[_0x4fc1('0x1e')]+'|'+_0x4a2603[_0x4fc1('0x1f')];var _0x4ec034=crypto[_0x4fc1('0x14')](_0x4fc1('0x20'))[_0x4fc1('0x21')](_0x387199)['digest'](_0x4fc1('0x15'));return _0x4ec034[_0x4fc1('0x22')](0x0,0x8)+'-'+_0x4ec034[_0x4fc1('0x22')](0x8,0xc)+'-'+_0x4ec034[_0x4fc1('0x22')](0xc,0x10)+'-'+_0x4ec034['substring'](0x10,0x14)+'-'+_0x4ec034[_0x4fc1('0x22')](0x14);}}; \ No newline at end of file +var _0x970c=['head','mac','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','keys','length','filter','family','IPv4','internal','concat'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x970c,0xdc));var _0xc970=function(_0x5ec687,_0x5af6b3){_0x5ec687=_0x5ec687-0x0;var _0x1c6250=_0x970c[_0x5ec687];return _0x1c6250;};'use strict';var _=require(_0xc970('0x0'));var os=require('os');var crypto=require(_0xc970('0x1'));var machine=require(_0xc970('0x2'));var exec=require(_0xc970('0x3'))[_0xc970('0x4')];var config=require(_0xc970('0x5'));function getInterfaces(){var _0x532064=[];var _0x1ab1dc=os[_0xc970('0x6')]();var _0x34a110=_['orderBy'](_[_0xc970('0x7')](_0x1ab1dc));for(var _0x185b29=0x0;_0x185b29<_0x34a110[_0xc970('0x8')];_0x185b29++){var _0x414851=_0x1ab1dc[_0x34a110[_0x185b29]][_0xc970('0x9')](function(_0x2259b5){return _0x2259b5[_0xc970('0xa')]===_0xc970('0xb')&&_0x2259b5[_0xc970('0xc')]===![];});_0x532064=_0x532064[_0xc970('0xd')](_0x414851);}return _0x532064;}function getFirstInterface(){var _0x6d9347=_[_0xc970('0xe')](getInterfaces());return{'macAddress':_0x6d9347&&_0x6d9347[_0xc970('0xf')]?_0x6d9347[_0xc970('0xf')]:'00:00:00:00:00:00','ipAddress':_0x6d9347&&_0x6d9347[_0xc970('0x10')]?_0x6d9347['address']:_0xc970('0x11')};}exports[_0xc970('0x12')]=getFirstInterface;function getCPUhash(){var _0x62e137=_['orderBy'](os[_0xc970('0x13')]()[_0xc970('0x14')](function(_0x129461){return _0x129461[_0xc970('0x15')];}))[_0xc970('0x16')](':');return crypto[_0xc970('0x17')](_0xc970('0x18'))['update'](_0x62e137)[_0xc970('0x19')](_0xc970('0x1a'));}exports[_0xc970('0x1b')]=function(){var _0x38bbf5=os[_0xc970('0x1c')]();var _0x567654=/[0-9a-f-]{36}/;if(config[_0xc970('0x1d')]&&_0x567654[_0xc970('0x1e')](config[_0xc970('0x1d')])){return config[_0xc970('0x1d')];}else if(_0x38bbf5===_0xc970('0x1f')){return exec(_0xc970('0x20'),{'encoding':_0xc970('0x21')})[_0xc970('0x22')]('\x0d\x0a','');}else{var _0x24d5aa=getFirstInterface();var _0x39b9c6=getCPUhash();var _0x2d4384=_0x39b9c6+'|'+os[_0xc970('0x23')]()+'|'+_0x24d5aa[_0xc970('0x24')]+'|'+_0x24d5aa['ipAddress'];var _0x204725=crypto[_0xc970('0x17')](_0xc970('0x18'))[_0xc970('0x25')](_0x2d4384)[_0xc970('0x19')](_0xc970('0x1a'));return _0x204725[_0xc970('0x26')](0x0,0x8)+'-'+_0x204725[_0xc970('0x26')](0x8,0xc)+'-'+_0x204725['substring'](0xc,0x10)+'-'+_0x204725[_0xc970('0x26')](0x10,0x14)+'-'+_0x204725[_0xc970('0x26')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 06b5754..2f5bc3b 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 _0x0c88=['bluebird','pkginfo','../../mysqldb','../../components/encryptor','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','then','catch','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','error','message','finally','findOrCreate','spread','default','util','moment'];(function(_0x9d1cb6,_0x399f7a){var _0x961772=function(_0x3572eb){while(--_0x3572eb){_0x9d1cb6['push'](_0x9d1cb6['shift']());}};_0x961772(++_0x399f7a);}(_0x0c88,0x1a2));var _0x80c8=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x0c88[_0x4f4d19];return _0x27a258;};'use strict';var util=require(_0x80c8('0x0'));var moment=require(_0x80c8('0x1'));var rp=require('request-promise');var BPromise=require(_0x80c8('0x2'));var pkginfo=require(_0x80c8('0x3'))(module,'version');var db=require(_0x80c8('0x4'))['db'];var encryptor=require(_0x80c8('0x5'));var hardware=require('./hardware');var logger=require(_0x80c8('0x6'))(_0x80c8('0x7'));var HOST=_0x80c8('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x193db3){return new BPromise(function(_0x203f4,_0x21a796){var _0x28e88f=util[_0x80c8('0x9')](_0x80c8('0xa'),HOST,_0x193db3,module[_0x80c8('0xb')][_0x80c8('0xc')]);if(oldToken){_0x28e88f=util[_0x80c8('0x9')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x193db3,module[_0x80c8('0xb')][_0x80c8('0xc')],oldToken);}var _0x43cc3f={'uri':_0x28e88f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x43cc3f)[_0x80c8('0xd')](function(_0x5d5608){_0x203f4(_0x5d5608);})[_0x80c8('0xe')](function(_0x41d5ad){_0x21a796(_0x41d5ad);});});}function manageLicense(_0x48950e,_0x557a0a){var _0x327e30=_0x557a0a[_0x80c8('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x327e30[_0x80c8('0x10')]!==_0x48950e&&!_0x327e30[_0x80c8('0x11')]){oldToken=_0x327e30[_0x80c8('0x10')];}httpRequest(_0x48950e)[_0x80c8('0xd')](function(_0x27f92e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x27f92e['active']){isOldTokenSent=![];if(!_0x327e30[_0x80c8('0x7')]&&_0x327e30[_0x80c8('0x7')]!=_0x27f92e['license']||_0x327e30[_0x80c8('0x7')]&&_0x327e30[_0x80c8('0x11')]){logger[_0x80c8('0x12')](_0x80c8('0x13'));}if(_0x327e30[_0x80c8('0x7')]&&!_0x327e30[_0x80c8('0x11')]&&_0x327e30[_0x80c8('0x7')]!=_0x27f92e[_0x80c8('0x7')]){logger[_0x80c8('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x327e30[_0x80c8('0x7')]&&!_0x327e30['data2']&&_0x327e30[_0x80c8('0x7')]==_0x27f92e[_0x80c8('0x7')]){return _0x557a0a;}return _0x557a0a[_0x80c8('0x14')]({'data1':_0x48950e,'data2':null,'license':_0x27f92e['license']});}else{if(_0x27f92e['license']||_0x327e30['license']){if(!_0x327e30[_0x80c8('0x11')]){if(_0x327e30[_0x80c8('0x10')]==_0x48950e){GRAY_PERIOD_REASON=_0x80c8('0x15');logger['info'](_0x80c8('0x16'));}else{GRAY_PERIOD_REASON=_0x80c8('0x17');logger[_0x80c8('0x12')](_0x80c8('0x18'),_0x327e30[_0x80c8('0x10')],_0x48950e);}logger['info'](_0x80c8('0x19'),GRAY_PERIOD_REASON[_0x80c8('0x1a')](),moment()[_0x80c8('0x9')](_0x80c8('0x1b')));return _0x557a0a[_0x80c8('0x14')]({'data2':encryptor['encryptString'](moment()[_0x80c8('0x9')](_0x80c8('0x1b')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x327e30[_0x80c8('0x11')]),'days')>DAYS){logger[_0x80c8('0x12')](_0x80c8('0x1c'),moment()[_0x80c8('0x9')](_0x80c8('0x1b')));isOldTokenSent=![];return _0x557a0a[_0x80c8('0x14')]({'data1':_0x48950e,'data2':null,'license':null});}}}else{if(_0x327e30[_0x80c8('0x10')]!=_0x48950e){logger['info'](_0x80c8('0x18'),_0x327e30[_0x80c8('0x10')],_0x48950e);return _0x557a0a[_0x80c8('0x14')]({'data1':_0x48950e,'data2':null,'license':null});}}}return _0x557a0a;})['then'](function(_0x2d862f){_0x557a0a=_0x2d862f;})[_0x80c8('0xe')](function(_0x3674c4){logger[_0x80c8('0x1d')](_0x3674c4[_0x80c8('0x1e')]);})[_0x80c8('0x1f')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x557a0a);},TIME);});}function defaultLicense(){var _0x44fe9e=hardware['getUuid']();if(_0x44fe9e){return db['License'][_0x80c8('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x44fe9e}})[_0x80c8('0x21')](function(_0x45c52f,_0x5bb578){logger[_0x80c8('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x44fe9e);manageLicense(_0x44fe9e,_0x45c52f);})[_0x80c8('0xe')](function(_0x32b6ce){logger[_0x80c8('0x1d')](_0x32b6ce[_0x80c8('0x1e')]);});}}exports[_0x80c8('0x22')]=defaultLicense; \ No newline at end of file +var _0xaad9=['data2','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','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','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1'];(function(_0x25428f,_0x3e4c19){var _0xda115a=function(_0xa55544){while(--_0xa55544){_0x25428f['push'](_0x25428f['shift']());}};_0xda115a(++_0x3e4c19);}(_0xaad9,0x119));var _0x9aad=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xaad9[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x9aad('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x9aad('0x1'));var pkginfo=require('pkginfo')(module,_0x9aad('0x2'));var db=require(_0x9aad('0x3'))['db'];var encryptor=require(_0x9aad('0x4'));var hardware=require(_0x9aad('0x5'));var logger=require('../logger')('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5e3540){return new BPromise(function(_0x28339b,_0x2be293){var _0x356ab8=util[_0x9aad('0x6')](_0x9aad('0x7'),HOST,_0x5e3540,module[_0x9aad('0x8')][_0x9aad('0x2')]);if(oldToken){_0x356ab8=util[_0x9aad('0x6')](_0x9aad('0x9'),HOST,_0x5e3540,module['exports'][_0x9aad('0x2')],oldToken);}var _0x551ec7={'uri':_0x356ab8,'method':_0x9aad('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x551ec7)[_0x9aad('0xb')](function(_0x238404){_0x28339b(_0x238404);})[_0x9aad('0xc')](function(_0x7f3ccb){_0x2be293(_0x7f3ccb);});});}function manageLicense(_0x101394,_0x13b7e8){var _0x377c0f=_0x13b7e8[_0x9aad('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x377c0f[_0x9aad('0xe')]!==_0x101394&&!_0x377c0f[_0x9aad('0xf')]){oldToken=_0x377c0f[_0x9aad('0xe')];}httpRequest(_0x101394)[_0x9aad('0xb')](function(_0x258de9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x258de9['active']){isOldTokenSent=![];if(!_0x377c0f[_0x9aad('0x10')]&&_0x377c0f[_0x9aad('0x10')]!=_0x258de9[_0x9aad('0x10')]||_0x377c0f[_0x9aad('0x10')]&&_0x377c0f['data2']){logger[_0x9aad('0x11')](_0x9aad('0x12'));}if(_0x377c0f[_0x9aad('0x10')]&&!_0x377c0f[_0x9aad('0xf')]&&_0x377c0f['license']!=_0x258de9[_0x9aad('0x10')]){logger[_0x9aad('0x11')](_0x9aad('0x13'));}if(_0x377c0f[_0x9aad('0x10')]&&!_0x377c0f[_0x9aad('0xf')]&&_0x377c0f['license']==_0x258de9['license']){return _0x13b7e8;}return _0x13b7e8[_0x9aad('0x14')]({'data1':_0x101394,'data2':null,'license':_0x258de9[_0x9aad('0x10')]});}else{if(_0x258de9[_0x9aad('0x10')]||_0x377c0f['license']){if(!_0x377c0f['data2']){if(_0x377c0f[_0x9aad('0xe')]==_0x101394){GRAY_PERIOD_REASON='Disabled';logger[_0x9aad('0x11')](_0x9aad('0x15'));}else{GRAY_PERIOD_REASON=_0x9aad('0x16');logger[_0x9aad('0x11')](_0x9aad('0x17'),_0x377c0f['data1'],_0x101394);}logger['info'](_0x9aad('0x18'),GRAY_PERIOD_REASON[_0x9aad('0x19')](),moment()[_0x9aad('0x6')](_0x9aad('0x1a')));return _0x13b7e8[_0x9aad('0x14')]({'data2':encryptor[_0x9aad('0x1b')](moment()[_0x9aad('0x6')](_0x9aad('0x1a')))});}else{if(moment()['diff'](encryptor[_0x9aad('0x1c')](_0x377c0f[_0x9aad('0xf')]),_0x9aad('0x1d'))>DAYS){logger[_0x9aad('0x11')](_0x9aad('0x1e'),moment()[_0x9aad('0x6')](_0x9aad('0x1a')));isOldTokenSent=![];return _0x13b7e8[_0x9aad('0x14')]({'data1':_0x101394,'data2':null,'license':null});}}}else{if(_0x377c0f[_0x9aad('0xe')]!=_0x101394){logger[_0x9aad('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x377c0f[_0x9aad('0xe')],_0x101394);return _0x13b7e8[_0x9aad('0x14')]({'data1':_0x101394,'data2':null,'license':null});}}}return _0x13b7e8;})[_0x9aad('0xb')](function(_0x145690){_0x13b7e8=_0x145690;})[_0x9aad('0xc')](function(_0x670a3){logger[_0x9aad('0x1f')](_0x670a3[_0x9aad('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x9aad('0x21')](),_0x13b7e8);},TIME);});}function defaultLicense(){var _0x2dd350=hardware[_0x9aad('0x21')]();if(_0x2dd350){return db[_0x9aad('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2dd350}})[_0x9aad('0x23')](function(_0x3f3085,_0x461fee){logger[_0x9aad('0x11')](_0x9aad('0x24'),_0x2dd350);manageLicense(_0x2dd350,_0x3f3085);})[_0x9aad('0xc')](function(_0x5696fa){logger[_0x9aad('0x1f')](_0x5696fa['message']);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a13d2aa..9adcca4 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 _0xfae8=['Breaking\x20license','getUuid','License','find','defaults','then','uuid','data1','license','isEmpty','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','deadline','add','days','grayReason','disabled','message','findAll','COUNT','sequelize','col','role','count','admin','user','users','telephones','forEach','catch','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license'];(function(_0x4425ed,_0x3f129e){var _0x13005e=function(_0x5d75a0){while(--_0x5d75a0){_0x4425ed['push'](_0x4425ed['shift']());}};_0x13005e(++_0x3f129e);}(_0xfae8,0x1a1));var _0x8fae=function(_0x1f111d,_0x367a68){_0x1f111d=_0x1f111d-0x0;var _0x3c9bb7=_0xfae8[_0x1f111d];return _0x3c9bb7;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8fae('0x0'));var BPromise=require(_0x8fae('0x1'));var hardware=require(_0x8fae('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0x8fae('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8fae('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x8fae('0x5'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x8fae('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x8fae('0x6'),'machineUuid':hardware[_0x8fae('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x5b600f){return new BPromise(function(_0x4a5d5d,_0x3c1165){return db[_0x8fae('0x8')][_0x8fae('0x9')](_[_0x8fae('0xa')](_0x5b600f,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x395c6a){return checkLicense(_0x395c6a,null);})[_0x8fae('0xb')](function(_0xdff039){_0x4a5d5d(_0xdff039);return;})['catch'](function(_0x4dcb3f){_0x3c1165(_0x4dcb3f);});});}function checkLicense(_0xc1cee5,_0x301a6c){if(!_0xc1cee5){demoLicense[_0x8fae('0xc')]=_0xc1cee5[_0x8fae('0xd')];return demoLicense;}try{var _0x312e40=_0x301a6c||_0xc1cee5[_0x8fae('0xe')];if(_[_0x8fae('0xf')](_0x312e40)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x520738=_0xc1cee5[_0x8fae('0xd')];var _0x5a70a5=_0xc1cee5['data2'];var _0xa69de8=_0x520738[_0x8fae('0x10')]('-')[0x4];var _0x58a50f=_0x520738[_0x8fae('0x10')]('-')[0x0];var _0x30c6d8=encryptor['decryptString'](_0x312e40,util[_0x8fae('0x11')](_0x8fae('0x12'),_0xa69de8,_0x520738,_0x58a50f));var _0x4edab9=JSON[_0x8fae('0x13')](_0x30c6d8);_0x4edab9[_0x8fae('0x14')]=![];_0x4edab9['uuid']=_0x520738;_0x4edab9[_0x8fae('0x15')]=hardware[_0x8fae('0x7')]();if(_0x5a70a5){var _0x2284b9=encryptor[_0x8fae('0x16')](_0x5a70a5);_0x4edab9[_0x8fae('0x17')]=_0x2284b9;_0x4edab9[_0x8fae('0x18')]=moment(_0x2284b9)[_0x8fae('0x19')](0x7,_0x8fae('0x1a'))['format']();_0x4edab9[_0x8fae('0x1b')]=_0x4edab9[_0x8fae('0xc')]!=_0x4edab9[_0x8fae('0x15')]?'changed':_0x8fae('0x1c');}return _0x4edab9;}catch(_0x1bbdc0){breakingLicense[_0x8fae('0xc')]=_0xc1cee5['data1'];breakingLicense[_0x8fae('0x1d')]=_0x1bbdc0['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x58f4ba,_0x5d36c1){getLicense()[_0x8fae('0xb')](function(_0x20c1b4){return db['User'][_0x8fae('0x1e')]({'attributes':['role',[db['sequelize']['fn'](_0x8fae('0x1f'),db[_0x8fae('0x20')][_0x8fae('0x21')](_0x8fae('0x22'))),_0x8fae('0x23')]],'group':'role','where':{'role':{'$or':[_0x8fae('0x24'),_0x8fae('0x25'),'telephone']}},'raw':!![]})[_0x8fae('0xb')](function(_0x4822ca){var _0x450f1e={'user':_0x20c1b4[_0x8fae('0x26')]||0x0,'telephone':_0x20c1b4[_0x8fae('0x27')]||0x0};_0x4822ca[_0x8fae('0x28')](function(_0x358906){var _0x5f2231=_0x358906['role']==='admin'?'user':_0x358906[_0x8fae('0x22')];_0x450f1e[_0x5f2231]-=_0x358906[_0x8fae('0x23')];if(_0x450f1e[_0x5f2231]<0x0)_0x450f1e[_0x5f2231]=0x0;});_0x58f4ba(_0x450f1e);return;});})[_0x8fae('0x29')](function(_0x1368a6){_0x5d36c1(_0x1368a6);});});}function checkUserLimits(_0x3d4340){return new BPromise(function(_0x2e4fad,_0x4dc797){getLimits()[_0x8fae('0xb')](function(_0x1cbcac){var _0x59f1a2=_[_0x8fae('0x2a')](_[_0x8fae('0x2b')](_0x3d4340,_0x8fae('0x22')),[_0x8fae('0x24'),_0x8fae('0x25'),_0x8fae('0x2c')]);var _0x91bd8f=(_0x59f1a2[_0x8fae('0x24')]||0x0)+(_0x59f1a2[_0x8fae('0x25')]||0x0);var _0x2255c8=_0x59f1a2[_0x8fae('0x2c')]||0x0;if(_0x91bd8f>_0x1cbcac['user'])return _0x4dc797(_0x8fae('0x2d'));if(_0x2255c8>_0x1cbcac[_0x8fae('0x2c')])return _0x4dc797(_0x8fae('0x2e'));return _0x2e4fad();})[_0x8fae('0x29')](function(_0x166337){_0x4dc797(_0x166337);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xc06b=['exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','data2','split','format','%s:%s:%s','demo','machineUuid','decryptString','gray','deadline','add','days','grayReason','disabled','message','role','sequelize','COUNT','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones'];(function(_0xf8b7ca,_0x167c5f){var _0x42b4e8=function(_0x2366bd){while(--_0x2366bd){_0xf8b7ca['push'](_0xf8b7ca['shift']());}};_0x42b4e8(++_0x167c5f);}(_0xc06b,0x10f));var _0xbc06=function(_0x260e4b,_0x54668d){_0x260e4b=_0x260e4b-0x0;var _0x18dfba=_0xc06b[_0x260e4b];return _0x18dfba;};'use strict';var util=require(_0xbc06('0x0'));var _=require(_0xbc06('0x1'));var moment=require('moment');var BPromise=require(_0xbc06('0x2'));var hardware=require(_0xbc06('0x3'));var encryptor=require(_0xbc06('0x4'));var db=require(_0xbc06('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbc06('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xbc06('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbc06('0x8'),'machineUuid':hardware[_0xbc06('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2c1397){return new BPromise(function(_0x4f20c4,_0x3078d0){return db[_0xbc06('0x9')][_0xbc06('0xa')](_[_0xbc06('0xb')](_0x2c1397,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x5334f5){return checkLicense(_0x5334f5,null);})[_0xbc06('0xc')](function(_0x439600){_0x4f20c4(_0x439600);return;})[_0xbc06('0xd')](function(_0x4cce4f){_0x3078d0(_0x4cce4f);});});}function checkLicense(_0x1ee5c2,_0x2d73ff){if(!_0x1ee5c2){demoLicense[_0xbc06('0xe')]=_0x1ee5c2[_0xbc06('0xf')];return demoLicense;}try{var _0x3e7b33=_0x2d73ff||_0x1ee5c2['license'];if(_['isEmpty'](_0x3e7b33)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x175c04=_0x1ee5c2[_0xbc06('0xf')];var _0x13634a=_0x1ee5c2[_0xbc06('0x10')];var _0xf01d90=_0x175c04[_0xbc06('0x11')]('-')[0x4];var _0xc3c03e=_0x175c04[_0xbc06('0x11')]('-')[0x0];var _0x4d2d05=encryptor['decryptString'](_0x3e7b33,util[_0xbc06('0x12')](_0xbc06('0x13'),_0xf01d90,_0x175c04,_0xc3c03e));var _0x5bf5d2=JSON['parse'](_0x4d2d05);_0x5bf5d2[_0xbc06('0x14')]=![];_0x5bf5d2['uuid']=_0x175c04;_0x5bf5d2[_0xbc06('0x15')]=hardware[_0xbc06('0x7')]();if(_0x13634a){var _0x2b50d1=encryptor[_0xbc06('0x16')](_0x13634a);_0x5bf5d2[_0xbc06('0x17')]=_0x2b50d1;_0x5bf5d2[_0xbc06('0x18')]=moment(_0x2b50d1)[_0xbc06('0x19')](0x7,_0xbc06('0x1a'))['format']();_0x5bf5d2[_0xbc06('0x1b')]=_0x5bf5d2[_0xbc06('0xe')]!=_0x5bf5d2[_0xbc06('0x15')]?'changed':_0xbc06('0x1c');}return _0x5bf5d2;}catch(_0xc07fab){breakingLicense[_0xbc06('0xe')]=_0x1ee5c2[_0xbc06('0xf')];breakingLicense[_0xbc06('0x1d')]=_0xc07fab[_0xbc06('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x39445a,_0x15dc4b){getLicense()['then'](function(_0x1de6fc){return db['User']['findAll']({'attributes':[_0xbc06('0x1e'),[db[_0xbc06('0x1f')]['fn'](_0xbc06('0x20'),db[_0xbc06('0x1f')]['col'](_0xbc06('0x1e'))),_0xbc06('0x21')]],'group':'role','where':{'role':{'$or':[_0xbc06('0x22'),_0xbc06('0x23'),_0xbc06('0x24')]}},'raw':!![]})[_0xbc06('0xc')](function(_0x53dee8){var _0x6d80b5={'user':_0x1de6fc[_0xbc06('0x25')]||0x0,'telephone':_0x1de6fc[_0xbc06('0x26')]||0x0};_0x53dee8[_0xbc06('0x27')](function(_0x397f07){var _0x1edf8a=_0x397f07[_0xbc06('0x1e')]===_0xbc06('0x22')?_0xbc06('0x23'):_0x397f07['role'];_0x6d80b5[_0x1edf8a]-=_0x397f07[_0xbc06('0x21')];if(_0x6d80b5[_0x1edf8a]<0x0)_0x6d80b5[_0x1edf8a]=0x0;});_0x39445a(_0x6d80b5);return;});})['catch'](function(_0x2b78a6){_0x15dc4b(_0x2b78a6);});});}function checkUserLimits(_0x4555b3){return new BPromise(function(_0x23ffeb,_0xf412b5){getLimits()[_0xbc06('0xc')](function(_0x5dd651){var _0x205599=_[_0xbc06('0x28')](_[_0xbc06('0x29')](_0x4555b3,_0xbc06('0x1e')),[_0xbc06('0x22'),_0xbc06('0x23'),_0xbc06('0x24')]);var _0x73bdf5=(_0x205599[_0xbc06('0x22')]||0x0)+(_0x205599[_0xbc06('0x23')]||0x0);var _0xc4c8cf=_0x205599[_0xbc06('0x24')]||0x0;if(_0x73bdf5>_0x5dd651['user'])return _0xf412b5(_0xbc06('0x2a'));if(_0xc4c8cf>_0x5dd651['telephone'])return _0xf412b5(_0xbc06('0x2b'));return _0x23ffeb();})[_0xbc06('0xd')](function(_0x1158f4){_0xf412b5(_0x1158f4);});});}module[_0xbc06('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 91cec95..f61d037 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 _0x4b17=['secret','exports','myappanuglar-secret'];(function(_0x203495,_0x2625a4){var _0x1d4ded=function(_0x2c3822){while(--_0x2c3822){_0x203495['push'](_0x203495['shift']());}};_0x1d4ded(++_0x2625a4);}(_0x4b17,0x10f));var _0x74b1=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x4b17[_0x3fe393];return _0x534d14;};'use strict';module[_0x74b1('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x74b1('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x74b1('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xe820=['exports','myappanuglar-secret'];(function(_0x20ca64,_0x313402){var _0x107a56=function(_0x5d2e71){while(--_0x5d2e71){_0x20ca64['push'](_0x20ca64['shift']());}};_0x107a56(++_0x313402);}(_0xe820,0xd2));var _0x0e82=function(_0x3899ba,_0x55f426){_0x3899ba=_0x3899ba-0x0;var _0x2b0e71=_0xe820[_0x3899ba];return _0x2b0e71;};'use strict';module[_0x0e82('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x0e82('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 22f3b5a..7c70802 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa679=['../utils/loggers','fileLogger','exports'];(function(_0x53330e,_0x324907){var _0x234059=function(_0x4681c3){while(--_0x4681c3){_0x53330e['push'](_0x53330e['shift']());}};_0x234059(++_0x324907);}(_0xa679,0x66));var _0x9a67=function(_0x579bbc,_0x2a8f6c){_0x579bbc=_0x579bbc-0x0;var _0x4dd0ea=_0xa679[_0x579bbc];return _0x4dd0ea;};'use strict';var fileLogger=require(_0x9a67('0x0'))[_0x9a67('0x1')];module[_0x9a67('0x2')]=fileLogger; \ No newline at end of file +var _0xacb3=['../utils/loggers','fileLogger','exports'];(function(_0x9e689c,_0x2600d8){var _0x13ee00=function(_0x60e5e2){while(--_0x60e5e2){_0x9e689c['push'](_0x9e689c['shift']());}};_0x13ee00(++_0x2600d8);}(_0xacb3,0x90));var _0x3acb=function(_0x3ab14c,_0x4093a1){_0x3ab14c=_0x3ab14c-0x0;var _0x423753=_0xacb3[_0x3ab14c];return _0x423753;};'use strict';var fileLogger=require(_0x3acb('0x0'))[_0x3acb('0x1')];module[_0x3acb('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c6c83f4..2fdb32f 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 _0x79c0=['../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','../../config/environment','resolve','join','root'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0x79c0,0x1a9));var _0x079c=function(_0x443109,_0x57a56e){_0x443109=_0x443109-0x0;var _0x5413f6=_0x79c0[_0x443109];return _0x5413f6;};'use strict';var path=require('path');var cfg=require(_0x079c('0x0'));var env={'NODE_PATH':path[_0x079c('0x1')](path[_0x079c('0x2')](cfg[_0x079c('0x3')],'legacy-libs'))};var pm2config={'apps':[{'name':'express','script':path['join'](__dirname,_0x079c('0x4')),'env':env},{'name':'ami','script':path[_0x079c('0x2')](__dirname,_0x079c('0x5')),'env':env},{'name':_0x079c('0x6'),'script':path[_0x079c('0x2')](__dirname,_0x079c('0x7')),'env':env},{'name':_0x079c('0x8'),'script':path[_0x079c('0x2')](__dirname,_0x079c('0x9')),'env':env},{'name':'routing','script':path[_0x079c('0x2')](__dirname,_0x079c('0xa')),'env':env},{'name':_0x079c('0xb'),'script':path['join'](__dirname,_0x079c('0xc')),'env':env}]};module['exports']=pm2config; \ No newline at end of file +var _0xaf8d=['xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','root','express','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js'];(function(_0x5a22bf,_0x3ede6a){var _0x1a7051=function(_0xdac79c){while(--_0xdac79c){_0x5a22bf['push'](_0x5a22bf['shift']());}};_0x1a7051(++_0x3ede6a);}(_0xaf8d,0x1ce));var _0xdaf8=function(_0x44a46c,_0x10827b){_0x44a46c=_0x44a46c-0x0;var _0x52c14f=_0xaf8d[_0x44a46c];return _0x52c14f;};'use strict';var path=require(_0xdaf8('0x0'));var cfg=require(_0xdaf8('0x1'));var env={'NODE_PATH':path[_0xdaf8('0x2')](path[_0xdaf8('0x3')](cfg[_0xdaf8('0x4')],'legacy-libs'))};var pm2config={'apps':[{'name':_0xdaf8('0x5'),'script':path[_0xdaf8('0x3')](__dirname,_0xdaf8('0x6')),'env':env},{'name':_0xdaf8('0x7'),'script':path[_0xdaf8('0x3')](__dirname,_0xdaf8('0x8')),'env':env},{'name':'agi','script':path['join'](__dirname,_0xdaf8('0x9')),'env':env},{'name':_0xdaf8('0xa'),'script':path[_0xdaf8('0x3')](__dirname,_0xdaf8('0xb')),'env':env},{'name':_0xdaf8('0xc'),'script':path[_0xdaf8('0x3')](__dirname,_0xdaf8('0xd')),'env':env},{'name':_0xdaf8('0xe'),'script':path[_0xdaf8('0x3')](__dirname,_0xdaf8('0xf')),'env':env}]};module[_0xdaf8('0x10')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 14ad76f..8171d57 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 _0xb947=['dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0xcafb2b,_0x2cc85e){var _0x539f9a=function(_0x9a96e6){while(--_0x9a96e6){_0xcafb2b['push'](_0xcafb2b['shift']());}};_0x539f9a(++_0x2cc85e);}(_0xb947,0xe3));var _0x7b94=function(_0x562371,_0x195956){_0x562371=_0x562371-0x0;var _0xa27831=_0xb947[_0x562371];return _0xa27831;};'use strict';var pm2=require(_0x7b94('0x0'));var BPromise=require(_0x7b94('0x1'));var config=require(_0x7b94('0x2'));function connect(){return new BPromise(function(_0x5637b5,_0x159af0){return pm2[_0x7b94('0x3')](function(_0x47787a){if(_0x47787a){return _0x159af0(_0x47787a);}return _0x5637b5(_0x7b94('0x4'));});});};exports[_0x7b94('0x5')]=function(_0x3c6ac5){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x53bc45,_0x225f80){return pm2['start'](_0x3c6ac5,function(_0x42bfaa,_0x4c0201){if(_0x42bfaa){return _0x225f80(_0x42bfaa);}pm2[_0x7b94('0x7')]();return _0x53bc45(_0x4c0201);});});});};exports[_0x7b94('0x8')]=function(_0x58bd0b){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x1f313b,_0x219361){return pm2['stop'](_0x58bd0b,function(_0x2b63e8,_0x40ce5f){if(_0x2b63e8){return _0x219361(_0x2b63e8);}pm2['disconnect']();return _0x1f313b(_0x40ce5f);});});});};exports[_0x7b94('0x9')]=function(_0x174684){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x18f95d,_0x122c82){return pm2[_0x7b94('0x9')](_0x174684,function(_0x63a4ac,_0x4e79c5){if(_0x63a4ac){return _0x122c82(_0x63a4ac);}pm2[_0x7b94('0x7')]();return _0x18f95d(_0x4e79c5);});});});};exports[_0x7b94('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x170672,_0xb817bc){return pm2[_0x7b94('0xa')](function(_0x344816,_0x46d08f){if(_0x344816){return _0xb817bc(_0x344816);}pm2[_0x7b94('0x7')]();return _0x170672(_0x46d08f);});});});};exports[_0x7b94('0xb')]=function(_0x152e57){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x4c6d64,_0x113e40){return pm2[_0x7b94('0xb')](_0x152e57,function(_0x4a2642,_0x207743){if(_0x4a2642){return _0x113e40(_0x4a2642);}pm2['disconnect']();return _0x4c6d64(_0x207743);});});});};exports[_0x7b94('0xc')]=function(_0x2195a4){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x4bc957,_0x2705fe){return pm2[_0x7b94('0xc')](_0x2195a4,function(_0x497458,_0x338981){if(_0x497458){return _0x2705fe(_0x497458);}pm2['disconnect']();return _0x4bc957(_0x338981);});});});};exports[_0x7b94('0xd')]=function(){return connect()[_0x7b94('0x6')](function(){return new BPromise(function(_0x473556,_0x57e6fd){return pm2[_0x7b94('0xd')](function(_0x1e7218){if(_0x1e7218){return _0x57e6fd(_0x1e7218);}return _0x473556(_0x7b94('0xe'));});});});}; \ No newline at end of file +var _0xc9e3=['start','then','disconnect','stop','restart','list','describe','delete','saved','pm2','connect'];(function(_0x4d95db,_0x28b7e9){var _0x1cc484=function(_0x42c09c){while(--_0x42c09c){_0x4d95db['push'](_0x4d95db['shift']());}};_0x1cc484(++_0x28b7e9);}(_0xc9e3,0xe5));var _0x3c9e=function(_0x2d48b5,_0x55678e){_0x2d48b5=_0x2d48b5-0x0;var _0x10e308=_0xc9e3[_0x2d48b5];return _0x10e308;};'use strict';var pm2=require(_0x3c9e('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3729e4,_0x5d22ad){return pm2[_0x3c9e('0x1')](function(_0x36d137){if(_0x36d137){return _0x5d22ad(_0x36d137);}return _0x3729e4('connected');});});};exports[_0x3c9e('0x2')]=function(_0x3919c2){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x42c796,_0x238eaf){return pm2['start'](_0x3919c2,function(_0x5967a2,_0x39de20){if(_0x5967a2){return _0x238eaf(_0x5967a2);}pm2[_0x3c9e('0x4')]();return _0x42c796(_0x39de20);});});});};exports[_0x3c9e('0x5')]=function(_0x3d4fdd){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x20a8b3,_0x254bdd){return pm2[_0x3c9e('0x5')](_0x3d4fdd,function(_0x179fb1,_0x5b1eae){if(_0x179fb1){return _0x254bdd(_0x179fb1);}pm2[_0x3c9e('0x4')]();return _0x20a8b3(_0x5b1eae);});});});};exports[_0x3c9e('0x6')]=function(_0x817d2b){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x498d1c,_0x25d8fc){return pm2['restart'](_0x817d2b,function(_0x26d524,_0x5315eb){if(_0x26d524){return _0x25d8fc(_0x26d524);}pm2['disconnect']();return _0x498d1c(_0x5315eb);});});});};exports[_0x3c9e('0x7')]=function(){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x256348,_0x27bfc2){return pm2[_0x3c9e('0x7')](function(_0x305254,_0x5ef3d5){if(_0x305254){return _0x27bfc2(_0x305254);}pm2[_0x3c9e('0x4')]();return _0x256348(_0x5ef3d5);});});});};exports[_0x3c9e('0x8')]=function(_0x271414){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x5e92c3,_0x39fa35){return pm2[_0x3c9e('0x8')](_0x271414,function(_0x4f3837,_0x33900b){if(_0x4f3837){return _0x39fa35(_0x4f3837);}pm2[_0x3c9e('0x4')]();return _0x5e92c3(_0x33900b);});});});};exports[_0x3c9e('0x9')]=function(_0x54d8d7){return connect()['then'](function(){return new BPromise(function(_0x364008,_0x2cbcb7){return pm2[_0x3c9e('0x9')](_0x54d8d7,function(_0x598f07,_0x285ab5){if(_0x598f07){return _0x2cbcb7(_0x598f07);}pm2[_0x3c9e('0x4')]();return _0x364008(_0x285ab5);});});});};exports['dump']=function(){return connect()[_0x3c9e('0x3')](function(){return new BPromise(function(_0x2d13ea,_0x18153c){return pm2['dump'](function(_0x24b083){if(_0x24b083){return _0x18153c(_0x24b083);}return _0x2d13ea(_0x3c9e('0xa'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 671ca5d..a47eaa3 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 _0x8c0b=['timeout','length','emit','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','map','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x5b8ee5,_0x2cfb07){var _0x26ce3d=function(_0x455693){while(--_0x455693){_0x5b8ee5['push'](_0x5b8ee5['shift']());}};_0x26ce3d(++_0x2cfb07);}(_0x8c0b,0x1ac));var _0xb8c0=function(_0x4d1ad2,_0x16e920){_0x4d1ad2=_0x4d1ad2-0x0;var _0x46704c=_0x8c0b[_0x4d1ad2];return _0x46704c;};'use strict';var _=require(_0xb8c0('0x0'));var moment=require(_0xb8c0('0x1'));var Redis=require(_0xb8c0('0x2'));var util=require('util');var config=require('../../config/environment');var db=require(_0xb8c0('0x3'))['db'];var logger=require(_0xb8c0('0x4'))(_0xb8c0('0x5'));config['redis']=_[_0xb8c0('0x6')](config[_0xb8c0('0x7')],{'host':_0xb8c0('0x8'),'port':0x18eb});var io=require(_0xb8c0('0x9'))(new Redis(config[_0xb8c0('0x7')]));function closeInteractions(){var _0x12ecf7=0x0;var _0x14eac6=[];return db[_0xb8c0('0xa')][_0xb8c0('0xb')]({'raw':!![],'attributes':['id',_0xb8c0('0xc')],'where':{'id':0x1}})['then'](function(_0x22a5be){_0x12ecf7=_0x22a5be[_0xb8c0('0xc')];if(_0x12ecf7){return db[_0xb8c0('0xd')][_0xb8c0('0xe')]({'raw':!![],'attributes':['id',_0xb8c0('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xb8c0('0x10')](_0x22a5be[_0xb8c0('0xc')],_0xb8c0('0x11'))}}});}else{return[];}})[_0xb8c0('0x12')](function(_0x490c3a){if(_0x490c3a&&_0x490c3a['length']){_0x14eac6=_[_0xb8c0('0x13')](_0x490c3a||[],'id');logger['info'](_0xb8c0('0x14'),_0x14eac6[_0xb8c0('0x15')]());return db['ChatInteraction']['update']({'closeReason':'system','disposition':_0xb8c0('0x16'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x14eac6}});}})[_0xb8c0('0x12')](function(){if(_0x14eac6&&_0x14eac6[_0xb8c0('0x17')]){logger['info']('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x14eac6['join']());for(var _0x22f698=0x0;_0x22f698<_0x14eac6[_0xb8c0('0x17')];_0x22f698++){io[_0xb8c0('0x18')]('chatInteraction:update',{'id':_0x14eac6[_0x22f698],'closed':!![]});}}})[_0xb8c0('0x19')](function(_0x2e295e){logger[_0xb8c0('0x1a')](_0xb8c0('0x1b'),_0x2e295e?util[_0xb8c0('0x1c')](_0x2e295e,{'showHidden':![],'depth':null}):'');});}exports[_0xb8c0('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xcfa5=['join','system','timeout','format','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','start','lodash','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','length','map','[CHAT]\x20Interactions\x20to\x20close:'];(function(_0x25d538,_0xfe3623){var _0x21089d=function(_0x412f7c){while(--_0x412f7c){_0x25d538['push'](_0x25d538['shift']());}};_0x21089d(++_0xfe3623);}(_0xcfa5,0x1eb));var _0x5cfa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcfa5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5cfa('0x0'));var moment=require('moment');var Redis=require(_0x5cfa('0x1'));var util=require(_0x5cfa('0x2'));var config=require('../../config/environment');var db=require(_0x5cfa('0x3'))['db'];var logger=require(_0x5cfa('0x4'))(_0x5cfa('0x5'));config[_0x5cfa('0x6')]=_[_0x5cfa('0x7')](config[_0x5cfa('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5cfa('0x8'))(new Redis(config[_0x5cfa('0x6')]));function closeInteractions(){var _0x59a784=0x0;var _0xc86c17=[];return db[_0x5cfa('0x9')][_0x5cfa('0xa')]({'raw':!![],'attributes':['id',_0x5cfa('0xb')],'where':{'id':0x1}})[_0x5cfa('0xc')](function(_0x19adb5){_0x59a784=_0x19adb5[_0x5cfa('0xb')];if(_0x59a784){return db[_0x5cfa('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x5cfa('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5cfa('0xf')](_0x19adb5[_0x5cfa('0xb')],'minutes')}}});}else{return[];}})[_0x5cfa('0xc')](function(_0x1f8fbb){if(_0x1f8fbb&&_0x1f8fbb[_0x5cfa('0x10')]){_0xc86c17=_[_0x5cfa('0x11')](_0x1f8fbb||[],'id');logger['info'](_0x5cfa('0x12'),_0xc86c17[_0x5cfa('0x13')]());return db['ChatInteraction']['update']({'closeReason':_0x5cfa('0x14'),'disposition':_0x5cfa('0x15'),'closed':!![],'closedAt':moment()[_0x5cfa('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xc86c17}});}})[_0x5cfa('0xc')](function(){if(_0xc86c17&&_0xc86c17['length']){logger[_0x5cfa('0x17')](_0x5cfa('0x18'),_0xc86c17[_0x5cfa('0x13')]());for(var _0xf0969e=0x0;_0xf0969e<_0xc86c17[_0x5cfa('0x10')];_0xf0969e++){io[_0x5cfa('0x19')](_0x5cfa('0x1a'),{'id':_0xc86c17[_0xf0969e],'closed':!![]});}}})[_0x5cfa('0x1b')](function(_0x59151d){logger[_0x5cfa('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x59151d?util['inspect'](_0x59151d,{'showHidden':![],'depth':null}):'');});}exports[_0x5cfa('0x1d')]=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 10b3419..118eb6c 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 _0xbc5c=['startAllRefreshIntervals'];(function(_0x1a57d6,_0x4e36d6){var _0x2d98f4=function(_0x4e854d){while(--_0x4e854d){_0x1a57d6['push'](_0x1a57d6['shift']());}};_0x2d98f4(++_0x4e36d6);}(_0xbc5c,0x18f));var _0xcbc5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbc5c[_0x17d9e3];return _0x14192d;};'use strict';function start(){var _0x26f9bf=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x26f9bf[_0xcbc5('0x0')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file +var _0xecd2=['startAllRefreshIntervals','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0xfe5b57,_0x2ba44c){var _0x3344e1=function(_0x40d26d){while(--_0x40d26d){_0xfe5b57['push'](_0xfe5b57['shift']());}};_0x3344e1(++_0x2ba44c);}(_0xecd2,0xb9));var _0x2ecd=function(_0x4f2c21,_0x228b4d){_0x4f2c21=_0x4f2c21-0x0;var _0x2d14e5=_0xecd2[_0x4f2c21];return _0x2d14e5;};'use strict';function start(){var _0x5bb34d=require(_0x2ecd('0x0'));return _0x5bb34d[_0x2ecd('0x1')]();}module['exports']={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6f02413..754d670 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 _0xe82f=['error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','Schedule','findAll','name','CloudProvider','jobs','map','toString','keyBy','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','active','update\x20cron','run','start','moment','cron-job-manager','jayson/promise','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','MailAccount','Smtp','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','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','then','error'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xe82f,0xd0));var _0xfe82=function(_0x22169f,_0x49f51d){_0x22169f=_0x22169f-0x0;var _0x17d69f=_0xe82f[_0x22169f];return _0x17d69f;};'use strict';var fs=require('fs');var util=require('util');var path=require('path');var _=require('lodash');var moment=require(_0xfe82('0x0'));var CronJobManager=require(_0xfe82('0x1'));var jayson=require(_0xfe82('0x2'));var BPromise=require(_0xfe82('0x3'));var logger=require('../logger')(_0xfe82('0x4'));var db=require(_0xfe82('0x5'))['db'];var analyticCustomReportController=require(_0xfe82('0x6'));var analyticDefaultReportController=require(_0xfe82('0x7'));var client=jayson['client'][_0xfe82('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5c3a11,_0x19c6d0){return function(){logger[_0xfe82('0x9')](_0xfe82('0xa'),_0x5c3a11[_0xfe82('0xb')]);var _0x2e3e27=!![];var _0x1e065b=_0x5c3a11['MailAccount'][_0xfe82('0xc')]();var _0x2a25e5={'account':_0x1e065b,'message':{'from':util[_0xfe82('0xd')]('\x22%s\x22\x20<%s>',_0x5c3a11[_0xfe82('0xe')]['name'],_0x5c3a11[_0xfe82('0xe')]['email']||_0x5c3a11[_0xfe82('0xe')][_0xfe82('0xf')][_0xfe82('0x10')]),'to':_0x5c3a11[_0xfe82('0xb')],'cc':_0x5c3a11['cc'],'bcc':_0x5c3a11[_0xfe82('0x11')],'subject':util[_0xfe82('0xd')]('Report\x20%s\x20last\x20%s\x20%s',_0x19c6d0['name'],_0x5c3a11[_0xfe82('0x12')],_0x5c3a11[_0xfe82('0x13')])}};var _0x4a34d3=path[_0xfe82('0x14')](__dirname,_0xfe82('0x15'));var _0x344632=_0x19c6d0[_0xfe82('0x16')];var _0x2d5d0d=util[_0xfe82('0xd')](_0xfe82('0x17'),path[_0xfe82('0x18')](_0x19c6d0[_0xfe82('0x16')],path[_0xfe82('0x19')](_0x19c6d0[_0xfe82('0x16')])),_0xfe82('0x1a'));var _0x227946=path['join'](_0x4a34d3,_0x344632);var _0x29709d=path[_0xfe82('0x14')](_0x4a34d3,_0x2d5d0d);if(fs[_0xfe82('0x1b')](_0x227946)){_0x19c6d0[_0xfe82('0x1c')]=_0xfe82('0x1d');_0x2a25e5[_0xfe82('0x1e')][_0xfe82('0x1f')]=[{'filename':_0x344632,'path':_0x227946}];_0x2a25e5[_0xfe82('0x1e')][_0xfe82('0x20')]=util[_0xfe82('0xd')](_0xfe82('0x21'),JSON['stringify'](_0x19c6d0,null,0x2));}else if(fs[_0xfe82('0x1b')](_0x29709d)){_0x19c6d0['status']='Sent';_0x2a25e5['message']['attachments']=[{'filename':_0x2d5d0d,'path':_0x29709d}];}else{_0x2a25e5[_0xfe82('0x1e')][_0xfe82('0x20')]=_0xfe82('0x22');if(!_0x5c3a11[_0xfe82('0x23')]){_0x2e3e27=![];logger[_0xfe82('0x9')](_0xfe82('0x24'));}}if(_0x2e3e27){return client[_0xfe82('0x25')](_0xfe82('0x26'),_0x2a25e5)[_0xfe82('0x27')](function(_0x1f4fca){if(_0x1f4fca[_0xfe82('0x28')]){return logger[_0xfe82('0x28')](_0xfe82('0x29'),JSON[_0xfe82('0x2a')](_0x1f4fca));}return logger[_0xfe82('0x9')](_0xfe82('0x2b'));})[_0xfe82('0x2c')](function(_0x44b41e){return logger[_0xfe82('0x28')](_0xfe82('0x29'),JSON['stringify'](_0x44b41e));});}};}function handleError(){return function(_0x325db4){return logger['error'](JSON[_0xfe82('0x2a')](_0x325db4));};}function handleResult(_0x2addc1){return function(_0x5049f1){logger['info'](_0xfe82('0x2d'),JSON[_0xfe82('0x2a')](_0x5049f1));if(_0x2addc1[_0xfe82('0xe')]&&_0x2addc1[_0xfe82('0xe')]['Smtp']&&!_[_0xfe82('0x2e')](_0x2addc1[_0xfe82('0xb')])){setTimeout(handleSendEmail(_0x2addc1,_0x5049f1),0x3c*0x3e8);}};}function handleJob(_0x3d7dfc){return function(){try{if(_[_0xfe82('0x2e')](_0x3d7dfc[_0xfe82('0x12')])){return logger[_0xfe82('0x9')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xfe82('0x2e')](_0x3d7dfc['subtractUnit'])){return logger[_0xfe82('0x9')](_0xfe82('0x2f'));}var _0x19cca5={'startDate':moment()['subtract'](_0x3d7dfc[_0xfe82('0x12')],_0x3d7dfc[_0xfe82('0x13')])[_0xfe82('0xd')](_0xfe82('0x30')),'endDate':moment()[_0xfe82('0xd')](_0xfe82('0x30')),'type':'scheduled','output':_0x3d7dfc[_0xfe82('0x31')],'name':_0x3d7dfc['name']};if(!_[_0xfe82('0x2e')](_0x3d7dfc['DefaultReportId'])){logger[_0xfe82('0x9')]('exec\x20defaul\x20report\x20id:%s',_0x3d7dfc[_0xfe82('0x32')]);return analyticDefaultReportController[_0xfe82('0x33')]({'id':_0x3d7dfc[_0xfe82('0x32')]},_0x19cca5)['then'](handleResult(_0x3d7dfc))[_0xfe82('0x2c')](handleError());}if(!_[_0xfe82('0x2e')](_0x3d7dfc[_0xfe82('0x34')])){logger[_0xfe82('0x9')]('exec\x20custom\x20report\x20id:%s',_0x3d7dfc[_0xfe82('0x34')]);return analyticCustomReportController['runReport']({'id':_0x3d7dfc[_0xfe82('0x34')]},_0x19cca5)[_0xfe82('0x27')](handleResult(_0x3d7dfc))[_0xfe82('0x2c')](handleError());}}catch(_0x1e3ba4){logger[_0xfe82('0x28')](JSON['stringify'](_0x1e3ba4));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x39f1ec){var _0x123bd7={};if(_0x39f1ec){_0x123bd7['id']=_0x39f1ec;}return db[_0xfe82('0x35')][_0xfe82('0x36')]({'where':_0x123bd7,'include':[{'model':db['MailAccount'],'attributes':['id',_0xfe82('0x37'),_0xfe82('0xb')],'include':[{'model':db['MailServerOut'],'as':_0xfe82('0xf'),'include':[{'model':db[_0xfe82('0x38')],'as':'CloudProvider'}]}]}]})[_0xfe82('0x27')](function(_0x25e795){var _0x1c36ee=_['keys'](manager[_0xfe82('0x39')]);var _0x41b78f=_[_0xfe82('0x3a')](_0x25e795,function(_0x319923){return _0x319923['id'][_0xfe82('0x3b')]();});var _0x1a1df0=_[_0xfe82('0x3c')](_0x25e795,function(_0x48ad29){return _0x48ad29['id'][_0xfe82('0x3b')]();});var _0x133bdb=_0x39f1ec?_0x41b78f:_['difference'](_0x41b78f,_0x1c36ee);var _0x40067e=_[_0xfe82('0x3d')](_0x41b78f,_0x1c36ee);var _0x31dcde=_['difference'](_0x1c36ee,_0x41b78f);var _0x55a398;var _0x4753cb;for(_0x55a398=0x0;_0x55a398<_0x31dcde[_0xfe82('0x3e')]&&!_0x39f1ec;_0x55a398+=0x1){_0x4753cb=_0x31dcde[_0x55a398][_0xfe82('0x3b')]();if(manager[_0xfe82('0x3f')](_0x4753cb)){manager[_0xfe82('0x40')](_0x4753cb);manager[_0xfe82('0x41')](_0x4753cb);logger[_0xfe82('0x9')](_0xfe82('0x42'),_0x4753cb);}}logger[_0xfe82('0x9')](_0xfe82('0x43'),JSON['stringify'](_0x133bdb));for(_0x55a398=0x0;_0x55a398<_0x133bdb['length'];_0x55a398+=0x1){_0x4753cb=_0x133bdb[_0x55a398][_0xfe82('0x3b')]();logger[_0xfe82('0x9')](_0xfe82('0x44'),_0x4753cb);if(_0x39f1ec){logger[_0xfe82('0x9')](_0xfe82('0x45'),_0x39f1ec);logger['info'](JSON[_0xfe82('0x2a')](_0x1a1df0[_0x4753cb]));BPromise[_0xfe82('0x46')]()[_0xfe82('0x27')](handleJob(_0x1a1df0[_0x4753cb]));logger[_0xfe82('0x9')](_0xfe82('0x47'),_0x1a1df0[_0x4753cb][_0xfe82('0x37')],_0x1a1df0[_0x4753cb][_0xfe82('0x48')]);}else if(_0x1a1df0[_0x4753cb][_0xfe82('0x48')]&&_0x1a1df0[_0x4753cb]['active']&&moment()[_0xfe82('0x49')](_0x1a1df0[_0x4753cb][_0xfe82('0x4a')],_0x1a1df0[_0x4753cb][_0xfe82('0x4b')])){manager[_0xfe82('0x4c')](_0x4753cb,_0x1a1df0[_0x4753cb][_0xfe82('0x48')],handleJob(_0x1a1df0[_0x4753cb]));manager['start'](_0x4753cb);logger[_0xfe82('0x9')](_0xfe82('0x4d'),_0x1a1df0[_0x4753cb][_0xfe82('0x37')],_0x1a1df0[_0x4753cb][_0xfe82('0x48')]);}else if(manager[_0xfe82('0x3f')](_0x4753cb)){manager[_0xfe82('0x40')](_0x4753cb);manager[_0xfe82('0x41')](_0x4753cb);logger['info'](_0xfe82('0x4e'),_0x1a1df0[_0x4753cb][_0xfe82('0x37')],_0x1a1df0[_0x4753cb][_0xfe82('0x48')]);}}for(_0x55a398=0x0,_0x4753cb;_0x55a398<_0x40067e[_0xfe82('0x3e')]&&!_0x39f1ec;_0x55a398+=0x1){_0x4753cb=_0x40067e[_0x55a398][_0xfe82('0x3b')]();if(manager[_0xfe82('0x3f')](_0x4753cb)){if(_0x1a1df0[_0x4753cb][_0xfe82('0x48')]&&_0x1a1df0[_0x4753cb][_0xfe82('0x4f')]&&moment()[_0xfe82('0x49')](_0x1a1df0[_0x4753cb]['startAt'],_0x1a1df0[_0x4753cb]['endAt'])){manager['update'](_0x4753cb,_0x1a1df0[_0x4753cb][_0xfe82('0x48')],handleJob(_0x1a1df0[_0x4753cb]));logger['info'](_0xfe82('0x50'),_0x1a1df0[_0x4753cb][_0xfe82('0x37')],_0x1a1df0[_0x4753cb][_0xfe82('0x48')]);}else{manager[_0xfe82('0x40')](_0x4753cb);manager['deleteJob'](_0x4753cb);logger[_0xfe82('0x9')]('stop\x20cron',_0x1a1df0[_0x4753cb][_0xfe82('0x37')],_0x1a1df0[_0x4753cb][_0xfe82('0x48')]);}}}})[_0xfe82('0x2c')](function(_0x4816c0){logger[_0xfe82('0x28')](JSON[_0xfe82('0x2a')](_0x4816c0));});}exports[_0xfe82('0x51')]=function(_0xab94fd){return getJobs(_0xab94fd);};exports[_0xfe82('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xca33=['subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','toString','keyBy','difference','intersection','exists','stop','deleteJob','toRun','length','index','resolve','cron','startAt','add','start','add\x20cron','stop\x20cron','active','isBetween','endAt','update','util','path','lodash','moment','cron-job-manager','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','user','bcc','subtractUnit','join','../../files/reports','basename','savename','extname','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','request','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined'];(function(_0x23315e,_0x5d6754){var _0x5a9e67=function(_0xe10fc6){while(--_0xe10fc6){_0x23315e['push'](_0x23315e['shift']());}};_0x5a9e67(++_0x5d6754);}(_0xca33,0xc7));var _0x3ca3=function(_0x37bcd4,_0x2dafb5){_0x37bcd4=_0x37bcd4-0x0;var _0x5e2bd4=_0xca33[_0x37bcd4];return _0x5e2bd4;};'use strict';var fs=require('fs');var util=require(_0x3ca3('0x0'));var path=require(_0x3ca3('0x1'));var _=require(_0x3ca3('0x2'));var moment=require(_0x3ca3('0x3'));var CronJobManager=require(_0x3ca3('0x4'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3ca3('0x5'))(_0x3ca3('0x6'));var db=require(_0x3ca3('0x7'))['db'];var analyticCustomReportController=require(_0x3ca3('0x8'));var analyticDefaultReportController=require(_0x3ca3('0x9'));var client=jayson['client'][_0x3ca3('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5acdf8,_0x2d89ea){return function(){logger[_0x3ca3('0xb')](_0x3ca3('0xc'),_0x5acdf8[_0x3ca3('0xd')]);var _0x5966bb=!![];var _0x509891=_0x5acdf8['MailAccount']['getSmtpOptions']();var _0x191d85={'account':_0x509891,'message':{'from':util[_0x3ca3('0xe')](_0x3ca3('0xf'),_0x5acdf8[_0x3ca3('0x10')]['name'],_0x5acdf8[_0x3ca3('0x10')][_0x3ca3('0xd')]||_0x5acdf8[_0x3ca3('0x10')][_0x3ca3('0x11')][_0x3ca3('0x12')]),'to':_0x5acdf8[_0x3ca3('0xd')],'cc':_0x5acdf8['cc'],'bcc':_0x5acdf8[_0x3ca3('0x13')],'subject':util[_0x3ca3('0xe')]('Report\x20%s\x20last\x20%s\x20%s',_0x2d89ea['name'],_0x5acdf8['subtractNumber'],_0x5acdf8[_0x3ca3('0x14')])}};var _0x18628b=path[_0x3ca3('0x15')](__dirname,_0x3ca3('0x16'));var _0x4b1227=_0x2d89ea['savename'];var _0x285526=util[_0x3ca3('0xe')]('%s.%s',path[_0x3ca3('0x17')](_0x2d89ea[_0x3ca3('0x18')],path[_0x3ca3('0x19')](_0x2d89ea[_0x3ca3('0x18')])),'zip');var _0x416fa1=path['join'](_0x18628b,_0x4b1227);var _0x4eded1=path[_0x3ca3('0x15')](_0x18628b,_0x285526);if(fs[_0x3ca3('0x1a')](_0x416fa1)){_0x2d89ea[_0x3ca3('0x1b')]='Sent';_0x191d85[_0x3ca3('0x1c')][_0x3ca3('0x1d')]=[{'filename':_0x4b1227,'path':_0x416fa1}];_0x191d85[_0x3ca3('0x1c')][_0x3ca3('0x1e')]=util[_0x3ca3('0xe')](_0x3ca3('0x1f'),JSON[_0x3ca3('0x20')](_0x2d89ea,null,0x2));}else if(fs[_0x3ca3('0x1a')](_0x4eded1)){_0x2d89ea[_0x3ca3('0x1b')]=_0x3ca3('0x21');_0x191d85[_0x3ca3('0x1c')][_0x3ca3('0x1d')]=[{'filename':_0x285526,'path':_0x4eded1}];}else{_0x191d85[_0x3ca3('0x1c')][_0x3ca3('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5acdf8['sendIfEmpty']){_0x5966bb=![];logger[_0x3ca3('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x5966bb){return client[_0x3ca3('0x22')](_0x3ca3('0x23'),_0x191d85)[_0x3ca3('0x24')](function(_0x27f695){if(_0x27f695[_0x3ca3('0x25')]){return logger[_0x3ca3('0x25')](_0x3ca3('0x26'),JSON[_0x3ca3('0x20')](_0x27f695));}return logger[_0x3ca3('0xb')](_0x3ca3('0x27'));})['catch'](function(_0x190107){return logger[_0x3ca3('0x25')](_0x3ca3('0x26'),JSON[_0x3ca3('0x20')](_0x190107));});}};}function handleError(){return function(_0x4626f4){return logger[_0x3ca3('0x25')](JSON['stringify'](_0x4626f4));};}function handleResult(_0x4a71de){return function(_0x3313fb){logger[_0x3ca3('0xb')]('data',JSON[_0x3ca3('0x20')](_0x3313fb));if(_0x4a71de[_0x3ca3('0x10')]&&_0x4a71de[_0x3ca3('0x10')]['Smtp']&&!_['isNil'](_0x4a71de[_0x3ca3('0xd')])){setTimeout(handleSendEmail(_0x4a71de,_0x3313fb),0x3c*0x3e8);}};}function handleJob(_0x231095){return function(){try{if(_[_0x3ca3('0x28')](_0x231095[_0x3ca3('0x29')])){return logger[_0x3ca3('0xb')](_0x3ca3('0x2a'));}if(_[_0x3ca3('0x28')](_0x231095[_0x3ca3('0x14')])){return logger[_0x3ca3('0xb')](_0x3ca3('0x2b'));}var _0x19ce9d={'startDate':moment()[_0x3ca3('0x2c')](_0x231095['subtractNumber'],_0x231095[_0x3ca3('0x14')])[_0x3ca3('0xe')](_0x3ca3('0x2d')),'endDate':moment()[_0x3ca3('0xe')](_0x3ca3('0x2d')),'type':_0x3ca3('0x2e'),'output':_0x231095[_0x3ca3('0x2f')],'name':_0x231095[_0x3ca3('0x30')]};if(!_[_0x3ca3('0x28')](_0x231095[_0x3ca3('0x31')])){logger[_0x3ca3('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x231095[_0x3ca3('0x31')]);return analyticDefaultReportController['runReport']({'id':_0x231095[_0x3ca3('0x31')]},_0x19ce9d)['then'](handleResult(_0x231095))[_0x3ca3('0x32')](handleError());}if(!_[_0x3ca3('0x28')](_0x231095[_0x3ca3('0x33')])){logger[_0x3ca3('0xb')](_0x3ca3('0x34'),_0x231095[_0x3ca3('0x33')]);return analyticCustomReportController[_0x3ca3('0x35')]({'id':_0x231095[_0x3ca3('0x33')]},_0x19ce9d)[_0x3ca3('0x24')](handleResult(_0x231095))['catch'](handleError());}}catch(_0x231d56){logger[_0x3ca3('0x25')](JSON['stringify'](_0x231d56));}return logger['info'](_0x3ca3('0x36'));};}function getJobs(_0x1a6ac5){var _0x439ae7={};if(_0x1a6ac5){_0x439ae7['id']=_0x1a6ac5;}return db[_0x3ca3('0x37')][_0x3ca3('0x38')]({'where':_0x439ae7,'include':[{'model':db['MailAccount'],'attributes':['id',_0x3ca3('0x30'),_0x3ca3('0xd')],'include':[{'model':db[_0x3ca3('0x39')],'as':_0x3ca3('0x11'),'include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x3ca3('0x24')](function(_0x14f7e4){var _0x22c0be=_[_0x3ca3('0x3a')](manager[_0x3ca3('0x3b')]);var _0x3d26a3=_['map'](_0x14f7e4,function(_0x254d30){return _0x254d30['id'][_0x3ca3('0x3c')]();});var _0x2f1e5e=_[_0x3ca3('0x3d')](_0x14f7e4,function(_0x32b60d){return _0x32b60d['id'][_0x3ca3('0x3c')]();});var _0x12798b=_0x1a6ac5?_0x3d26a3:_[_0x3ca3('0x3e')](_0x3d26a3,_0x22c0be);var _0x26558a=_[_0x3ca3('0x3f')](_0x3d26a3,_0x22c0be);var _0x2f913f=_[_0x3ca3('0x3e')](_0x22c0be,_0x3d26a3);var _0x52fac2;var _0x34fd0c;for(_0x52fac2=0x0;_0x52fac2<_0x2f913f['length']&&!_0x1a6ac5;_0x52fac2+=0x1){_0x34fd0c=_0x2f913f[_0x52fac2]['toString']();if(manager[_0x3ca3('0x40')](_0x34fd0c)){manager[_0x3ca3('0x41')](_0x34fd0c);manager[_0x3ca3('0x42')](_0x34fd0c);logger[_0x3ca3('0xb')]('delete\x20cron',_0x34fd0c);}}logger[_0x3ca3('0xb')](_0x3ca3('0x43'),JSON[_0x3ca3('0x20')](_0x12798b));for(_0x52fac2=0x0;_0x52fac2<_0x12798b[_0x3ca3('0x44')];_0x52fac2+=0x1){_0x34fd0c=_0x12798b[_0x52fac2]['toString']();logger[_0x3ca3('0xb')](_0x3ca3('0x45'),_0x34fd0c);if(_0x1a6ac5){logger[_0x3ca3('0xb')]('my\x20id',_0x1a6ac5);logger[_0x3ca3('0xb')](JSON[_0x3ca3('0x20')](_0x2f1e5e[_0x34fd0c]));BPromise[_0x3ca3('0x46')]()[_0x3ca3('0x24')](handleJob(_0x2f1e5e[_0x34fd0c]));logger[_0x3ca3('0xb')]('run\x20job',_0x2f1e5e[_0x34fd0c][_0x3ca3('0x30')],_0x2f1e5e[_0x34fd0c]['cron']);}else if(_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')]&&_0x2f1e5e[_0x34fd0c]['active']&&moment()['isBetween'](_0x2f1e5e[_0x34fd0c][_0x3ca3('0x48')],_0x2f1e5e[_0x34fd0c]['endAt'])){manager[_0x3ca3('0x49')](_0x34fd0c,_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')],handleJob(_0x2f1e5e[_0x34fd0c]));manager[_0x3ca3('0x4a')](_0x34fd0c);logger[_0x3ca3('0xb')](_0x3ca3('0x4b'),_0x2f1e5e[_0x34fd0c][_0x3ca3('0x30')],_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')]);}else if(manager[_0x3ca3('0x40')](_0x34fd0c)){manager['stop'](_0x34fd0c);manager['deleteJob'](_0x34fd0c);logger[_0x3ca3('0xb')](_0x3ca3('0x4c'),_0x2f1e5e[_0x34fd0c][_0x3ca3('0x30')],_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')]);}}for(_0x52fac2=0x0,_0x34fd0c;_0x52fac2<_0x26558a[_0x3ca3('0x44')]&&!_0x1a6ac5;_0x52fac2+=0x1){_0x34fd0c=_0x26558a[_0x52fac2][_0x3ca3('0x3c')]();if(manager[_0x3ca3('0x40')](_0x34fd0c)){if(_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')]&&_0x2f1e5e[_0x34fd0c][_0x3ca3('0x4d')]&&moment()[_0x3ca3('0x4e')](_0x2f1e5e[_0x34fd0c][_0x3ca3('0x48')],_0x2f1e5e[_0x34fd0c][_0x3ca3('0x4f')])){manager[_0x3ca3('0x50')](_0x34fd0c,_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')],handleJob(_0x2f1e5e[_0x34fd0c]));logger[_0x3ca3('0xb')]('update\x20cron',_0x2f1e5e[_0x34fd0c]['name'],_0x2f1e5e[_0x34fd0c]['cron']);}else{manager[_0x3ca3('0x41')](_0x34fd0c);manager['deleteJob'](_0x34fd0c);logger[_0x3ca3('0xb')](_0x3ca3('0x4c'),_0x2f1e5e[_0x34fd0c][_0x3ca3('0x30')],_0x2f1e5e[_0x34fd0c][_0x3ca3('0x47')]);}}}})[_0x3ca3('0x32')](function(_0x5d2175){logger[_0x3ca3('0x25')](JSON[_0x3ca3('0x20')](_0x5d2175));});}exports['run']=function(_0x2edf41){return getJobs(_0x2edf41);};exports[_0x3ca3('0x4a')]=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 ca5605a..ded0fea 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 _0x7be1=['bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','then','results','length','transcripts','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Transcript\x20not\x20available','sentimentAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Mixed','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','forEach','push','all','error','start','lodash','aws-sdk','request-promise'];(function(_0x1a18bd,_0x2dcace){var _0x1ff5af=function(_0x43585f){while(--_0x43585f){_0x1a18bd['push'](_0x1a18bd['shift']());}};_0x1ff5af(++_0x2dcace);}(_0x7be1,0x165));var _0x17be=function(_0x1b2748,_0x4b3ad2){_0x1b2748=_0x1b2748-0x0;var _0x18fe11=_0x7be1[_0x1b2748];return _0x18fe11;};var _=require(_0x17be('0x0'));var AWS=require(_0x17be('0x1'));var rp=require(_0x17be('0x2'));var util=require('util');var BPromise=require(_0x17be('0x3'));var db=require(_0x17be('0x4'))['db'];var logger=require(_0x17be('0x5'))(_0x17be('0x6'));function getTranscriptionJob(_0x2bc9ed,_0x4b46fd,_0x4feea7,_0x55257a){return new Promise(function(_0x2fed12,_0x40f3f9){var _0x4f5b0c=new AWS[(_0x17be('0x7'))]({'accessKeyId':_0x4b46fd,'secretAccessKey':_0x2bc9ed,'region':_0x4feea7});_0x4f5b0c[_0x17be('0x8')]({'TranscriptionJobName':_0x55257a},function(_0x2c74b2,_0xfd9c5){if(_0x2c74b2){return _0x40f3f9(_0x2c74b2);}else{return _0x2fed12(_0xfd9c5);}});});}function sentiment(_0x4779a8,_0x16042b,_0x582848,_0x41e383,_0x589cdb){return new Promise(function(_0x3d23c3,_0x2c276e){var _0x520a49=new AWS[(_0x17be('0x9'))]({'accessKeyId':_0x16042b,'secretAccessKey':_0x4779a8,'region':_0x582848});_0x520a49[_0x17be('0xa')]({'Text':_0x41e383,'LanguageCode':_0x589cdb[_0x17be('0xb')](0x0,0x2)},function(_0x667ab3,_0x4ddc25){if(_0x667ab3){return _0x2c276e(_0x667ab3);}else{return _0x3d23c3(_0x4ddc25);}});});}function checkTranscribeJob(_0x431142,_0x52a62c,_0x40e3d5){var _0x4f4ad6;return new BPromise(function(_0x2af298,_0x1dff9e){logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0xe'),_0x431142['id'],_0x431142['transcribeName']));return getTranscriptionJob(_0x40e3d5[_0x17be('0xf')],_0x40e3d5['data2'],_0x52a62c['transcribeRegion'],_0x431142[_0x17be('0x10')])['then'](function(_0x2a37ec){logger['info'](util[_0x17be('0xd')](_0x17be('0x11'),_0x431142['id'],_0x431142['transcribeName'],_0x2a37ec[_0x17be('0x12')]['TranscriptionJobStatus']));if(!_0x431142[_0x17be('0x13')]){switch(_0x2a37ec['TranscriptionJob'][_0x17be('0x14')]){case _0x17be('0x15'):var _0x416f81={'transcribeStatus':_0x2a37ec[_0x17be('0x12')][_0x17be('0x14')],'fileUri':_0x2a37ec['TranscriptionJob'][_0x17be('0x16')][_0x17be('0x17')]};logger[_0x17be('0xc')](util[_0x17be('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0x431142['id']));return rp({'uri':_0x2a37ec[_0x17be('0x12')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0x17be('0x18')](function(_0x3ffd1e){logger[_0x17be('0xc')](util[_0x17be('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x431142['id']));if(_0x3ffd1e&&_0x3ffd1e[_0x17be('0x19')]&&_0x3ffd1e[_0x17be('0x19')]['transcripts']&&_0x3ffd1e[_0x17be('0x19')]['transcripts'][_0x17be('0x1a')]){_0x416f81[_0x17be('0x13')]='';for(var _0x47f00d=0x0;_0x47f00d<_0x3ffd1e[_0x17be('0x19')]['transcripts'][_0x17be('0x1a')];_0x47f00d++){_0x416f81['fileText']+=_0x3ffd1e['results'][_0x17be('0x1b')][_0x47f00d]['transcript']+'';}}return _0x431142[_0x17be('0x1c')](_0x416f81);})['then'](function(){logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x1d'),_0x431142['id']));if(!_0x431142[_0x17be('0x1e')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x21'));}if(!_0x52a62c[_0x17be('0x22')]||!_0x52a62c['sentimentAccountId']||!_0x52a62c[_0x17be('0x23')]||!_0x52a62c[_0x17be('0x24')]||!_0x52a62c[_0x17be('0x25')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x416f81[_0x17be('0x13')]){throw new Error(_0x17be('0x26'));}if(_0x52a62c[_0x17be('0x27')]===_0x40e3d5['id']){return _0x40e3d5;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings[_0x17be('0x27')]}});}})[_0x17be('0x18')](function(_0x57c5b2){if(!_0x57c5b2){throw new db[(_0x17be('0x1f'))]['ValidationError'](_0x17be('0x28'));}if(!_0x57c5b2[_0x17be('0xf')]||!_0x57c5b2[_0x17be('0x29')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x2a'));}_0x4f4ad6=_0x57c5b2;logger[_0x17be('0xc')](util[_0x17be('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x431142['id']));return sentiment(_0x4f4ad6[_0x17be('0xf')],_0x4f4ad6[_0x17be('0x29')],_0x52a62c['sentimentRegion'],_0x416f81[_0x17be('0x13')],_0x52a62c[_0x17be('0x24')]);})['then'](function(_0x2f0b81){logger['info'](util[_0x17be('0xd')](_0x17be('0x2b'),_0x431142['id']));return _0x431142['update']({'sentiment':_0x2f0b81[_0x17be('0x2c')],'sPositive':_0x2f0b81[_0x17be('0x2d')][_0x17be('0x2e')],'sNegative':_0x2f0b81[_0x17be('0x2d')][_0x17be('0x2f')],'sMixed':_0x2f0b81[_0x17be('0x2d')]['Mixed'],'sNeutral':_0x2f0b81[_0x17be('0x2d')][_0x17be('0x30')]});})['then'](function(){logger[_0x17be('0xc')](util['format'](_0x17be('0x1d'),_0x431142['id']));_0x2af298();});case _0x17be('0x31'):return _0x431142[_0x17be('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x2a37ec[_0x17be('0x12')][_0x17be('0x32')]})[_0x17be('0x18')](function(){logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x1d'),_0x431142['id']));_0x2af298();});default:logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x33'),_0x431142['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x431142[_0x17be('0x1e')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x52a62c[_0x17be('0x22')]||!_0x52a62c[_0x17be('0x27')]||!_0x52a62c[_0x17be('0x23')]||!_0x52a62c['language']||!_0x52a62c[_0x17be('0x25')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x34'));}if(!_0x431142['fileText']){throw new Error(_0x17be('0x26'));}if(_0x52a62c['sentimentAccountId']===_0x40e3d5['id']){return _0x40e3d5;}else{return db[_0x17be('0x35')][_0x17be('0x36')]({'where':{'id':_settings[_0x17be('0x27')]}});}})[_0x17be('0x18')](function(_0x3812c6){if(!_0x3812c6){throw new db[(_0x17be('0x1f'))]['ValidationError'](_0x17be('0x28'));}if(!_0x3812c6[_0x17be('0xf')]||!_0x3812c6[_0x17be('0x29')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x2a'));}_0x4f4ad6=_0x3812c6;logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x37'),_0x431142['id']));return sentiment(_0x4f4ad6[_0x17be('0xf')],_0x4f4ad6[_0x17be('0x29')],_0x52a62c[_0x17be('0x23')],_0x431142['fileText'],_0x52a62c[_0x17be('0x24')]);})[_0x17be('0x18')](function(_0x380e6b){logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x2b'),_0x431142['id']));return _0x431142['update']({'sentiment':_0x380e6b[_0x17be('0x2c')],'sPositive':_0x380e6b[_0x17be('0x2d')][_0x17be('0x2e')],'sNegative':_0x380e6b[_0x17be('0x2d')][_0x17be('0x2f')],'sMixed':_0x380e6b[_0x17be('0x2d')][_0x17be('0x38')],'sNeutral':_0x380e6b[_0x17be('0x2d')][_0x17be('0x30')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x17be('0xc')](util[_0x17be('0xd')](_0x17be('0x1d'),_0x431142['id']));_0x2af298();});}})[_0x17be('0x39')](function(_0x43be24){if(_0x43be24){if(!_0x43be24[_0x17be('0x3a')]||_0x43be24[_0x17be('0x3a')]!==_0x17be('0x3b')){logger['error'](util[_0x17be('0xd')](_0x17be('0x3c'),_0x431142['id']),util[_0x17be('0x3d')](_0x43be24,{'showHidden':![],'depth':null}));}}_0x2af298();});});}function checkTranscribe(){var _0x46f673;var _0x15b124;var _0x1619d3;return db['VoiceRecording']['findAll']({'where':{'transcribeStatus':_0x17be('0x3e')}})[_0x17be('0x18')](function(_0x38dc2f){if(!_0x38dc2f||!_0x38dc2f['length']){throw new db[(_0x17be('0x1f'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x46f673=_0x38dc2f;return db[_0x17be('0x3f')][_0x17be('0x36')]({'where':{'id':0x1}});})[_0x17be('0x18')](function(_0x427cee){if(!_0x427cee){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x40'));}_0x15b124=_0x427cee;if(!_0x15b124[_0x17be('0x6')]||!_0x15b124[_0x17be('0x41')]||!_0x15b124[_0x17be('0x42')]||!_0x15b124[_0x17be('0x24')]||!_0x15b124['bucket']){throw new db[(_0x17be('0x1f'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x17be('0x35')][_0x17be('0x36')]({'where':{'id':_0x15b124[_0x17be('0x41')]}});})['then'](function(_0x32b4f8){if(!_0x32b4f8){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x28'));}if(!_0x32b4f8[_0x17be('0xf')]||!_0x32b4f8[_0x17be('0x29')]){throw new db[(_0x17be('0x1f'))][(_0x17be('0x20'))](_0x17be('0x2a'));}_0x1619d3=_0x32b4f8;var _0x15a5e5=[];_0x46f673[_0x17be('0x43')](function(_0x1bd9cd){_0x15a5e5[_0x17be('0x44')](checkTranscribeJob(_0x1bd9cd,_0x15b124,_0x1619d3));});return BPromise[_0x17be('0x45')](_0x15a5e5);})['catch'](function(_0x9fcd24){if(_0x9fcd24){if(!_0x9fcd24[_0x17be('0x3a')]||_0x9fcd24[_0x17be('0x3a')]!==_0x17be('0x3b')){logger[_0x17be('0x46')](util['inspect'](_0x9fcd24,{'showHidden':![],'depth':null}));}}});}exports[_0x17be('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa047=['request-promise','util','../../mysqldb','transcribe','TranscribeService','Comprehend','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','ValidationError','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','Sentiment','Positive','Negative','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','forEach','push','all','catch','lodash','aws-sdk'];(function(_0x3053de,_0x18606a){var _0x3fc2aa=function(_0x55fc0c){while(--_0x55fc0c){_0x3053de['push'](_0x3053de['shift']());}};_0x3fc2aa(++_0x18606a);}(_0xa047,0x1c5));var _0x7a04=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0xa047[_0x3a7a9c];return _0x59156e;};var _=require(_0x7a04('0x0'));var AWS=require(_0x7a04('0x1'));var rp=require(_0x7a04('0x2'));var util=require(_0x7a04('0x3'));var BPromise=require('bluebird');var db=require(_0x7a04('0x4'))['db'];var logger=require('../../config/logger')(_0x7a04('0x5'));function getTranscriptionJob(_0x269341,_0x2b3190,_0x15c12c,_0x26a2c9){return new Promise(function(_0x4cc23b,_0x12564a){var _0x3166ff=new AWS[(_0x7a04('0x6'))]({'accessKeyId':_0x2b3190,'secretAccessKey':_0x269341,'region':_0x15c12c});_0x3166ff['getTranscriptionJob']({'TranscriptionJobName':_0x26a2c9},function(_0x10d92f,_0x10faf9){if(_0x10d92f){return _0x12564a(_0x10d92f);}else{return _0x4cc23b(_0x10faf9);}});});}function sentiment(_0x500da7,_0x150cbf,_0xc64317,_0x557e2f,_0x44d0e8){return new Promise(function(_0x4d21d3,_0x545716){var _0x24b4d7=new AWS[(_0x7a04('0x7'))]({'accessKeyId':_0x150cbf,'secretAccessKey':_0x500da7,'region':_0xc64317});_0x24b4d7['detectSentiment']({'Text':_0x557e2f,'LanguageCode':_0x44d0e8['substring'](0x0,0x2)},function(_0x4a90b2,_0x504fb0){if(_0x4a90b2){return _0x545716(_0x4a90b2);}else{return _0x4d21d3(_0x504fb0);}});});}function checkTranscribeJob(_0x3300ae,_0x3e8692,_0x15a002){var _0x10931c;return new BPromise(function(_0x44a0a1,_0x33fc47){logger[_0x7a04('0x8')](util[_0x7a04('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x3300ae['id'],_0x3300ae[_0x7a04('0xa')]));return getTranscriptionJob(_0x15a002[_0x7a04('0xb')],_0x15a002[_0x7a04('0xc')],_0x3e8692[_0x7a04('0xd')],_0x3300ae[_0x7a04('0xa')])[_0x7a04('0xe')](function(_0x4f434f){logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0xf'),_0x3300ae['id'],_0x3300ae['transcribeName'],_0x4f434f['TranscriptionJob'][_0x7a04('0x10')]));if(!_0x3300ae[_0x7a04('0x11')]){switch(_0x4f434f[_0x7a04('0x12')]['TranscriptionJobStatus']){case _0x7a04('0x13'):var _0x43aeec={'transcribeStatus':_0x4f434f['TranscriptionJob'][_0x7a04('0x10')],'fileUri':_0x4f434f['TranscriptionJob'][_0x7a04('0x14')]['TranscriptFileUri']};logger[_0x7a04('0x8')](util[_0x7a04('0x9')]('[RECORDING:%d]\x20Get\x20transcript',_0x3300ae['id']));return rp({'uri':_0x4f434f[_0x7a04('0x12')][_0x7a04('0x14')]['TranscriptFileUri'],'json':!![]})[_0x7a04('0xe')](function(_0x258346){logger['info'](util[_0x7a04('0x9')](_0x7a04('0x15'),_0x3300ae['id']));if(_0x258346&&_0x258346[_0x7a04('0x16')]&&_0x258346[_0x7a04('0x16')][_0x7a04('0x17')]&&_0x258346[_0x7a04('0x16')][_0x7a04('0x17')][_0x7a04('0x18')]){_0x43aeec['fileText']='';for(var _0x166e0b=0x0;_0x166e0b<_0x258346['results'][_0x7a04('0x17')][_0x7a04('0x18')];_0x166e0b++){_0x43aeec[_0x7a04('0x11')]+=_0x258346[_0x7a04('0x16')][_0x7a04('0x17')][_0x166e0b][_0x7a04('0x19')]+'';}}return _0x3300ae[_0x7a04('0x1a')](_0x43aeec);})[_0x7a04('0xe')](function(){logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0x1b'),_0x3300ae['id']));if(!_0x3300ae['tempSentiment']){throw new db[(_0x7a04('0x1c'))]['ValidationError'](_0x7a04('0x1d'));}if(!_0x3e8692[_0x7a04('0x1e')]||!_0x3e8692[_0x7a04('0x1f')]||!_0x3e8692[_0x7a04('0x20')]||!_0x3e8692[_0x7a04('0x21')]||!_0x3e8692[_0x7a04('0x22')]){throw new db['Sequelize'][(_0x7a04('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x43aeec[_0x7a04('0x11')]){throw new Error(_0x7a04('0x24'));}if(_0x3e8692['sentimentAccountId']===_0x15a002['id']){return _0x15a002;}else{return db[_0x7a04('0x25')][_0x7a04('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x224740){if(!_0x224740){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))](_0x7a04('0x27'));}if(!_0x224740[_0x7a04('0xb')]||!_0x224740[_0x7a04('0xc')]){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))]('Cloud\x20Provider\x20not\x20configured');}_0x10931c=_0x224740;logger[_0x7a04('0x8')](util[_0x7a04('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3300ae['id']));return sentiment(_0x10931c[_0x7a04('0xb')],_0x10931c[_0x7a04('0xc')],_0x3e8692[_0x7a04('0x20')],_0x43aeec[_0x7a04('0x11')],_0x3e8692[_0x7a04('0x21')]);})[_0x7a04('0xe')](function(_0x3d01d7){logger['info'](util[_0x7a04('0x9')](_0x7a04('0x28'),_0x3300ae['id']));return _0x3300ae['update']({'sentiment':_0x3d01d7['Sentiment'],'sPositive':_0x3d01d7[_0x7a04('0x29')]['Positive'],'sNegative':_0x3d01d7[_0x7a04('0x29')]['Negative'],'sMixed':_0x3d01d7[_0x7a04('0x29')][_0x7a04('0x2a')],'sNeutral':_0x3d01d7[_0x7a04('0x29')][_0x7a04('0x2b')]});})[_0x7a04('0xe')](function(){logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0x1b'),_0x3300ae['id']));_0x44a0a1();});case _0x7a04('0x2c'):return _0x3300ae['update']({'transcribeStatus':'FAILED','failureReason':_0x4f434f['TranscriptionJob']['FailureReason']})[_0x7a04('0xe')](function(){logger['info'](util[_0x7a04('0x9')](_0x7a04('0x1b'),_0x3300ae['id']));_0x44a0a1();});default:logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0x2d'),_0x3300ae['id']));break;}}else{return BPromise[_0x7a04('0x2e')]()[_0x7a04('0xe')](function(){if(!_0x3300ae['tempSentiment']){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))](_0x7a04('0x1d'));}if(!_0x3e8692['sentiment']||!_0x3e8692[_0x7a04('0x1f')]||!_0x3e8692[_0x7a04('0x20')]||!_0x3e8692[_0x7a04('0x21')]||!_0x3e8692[_0x7a04('0x22')]){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))](_0x7a04('0x2f'));}if(!_0x3300ae[_0x7a04('0x11')]){throw new Error('Transcript\x20not\x20available');}if(_0x3e8692['sentimentAccountId']===_0x15a002['id']){return _0x15a002;}else{return db[_0x7a04('0x25')][_0x7a04('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x585334){if(!_0x585334){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))](_0x7a04('0x27'));}if(!_0x585334[_0x7a04('0xb')]||!_0x585334[_0x7a04('0xc')]){throw new db[(_0x7a04('0x1c'))]['ValidationError'](_0x7a04('0x30'));}_0x10931c=_0x585334;logger[_0x7a04('0x8')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3300ae['id']));return sentiment(_0x10931c[_0x7a04('0xb')],_0x10931c[_0x7a04('0xc')],_0x3e8692[_0x7a04('0x20')],_0x3300ae[_0x7a04('0x11')],_0x3e8692[_0x7a04('0x21')]);})[_0x7a04('0xe')](function(_0x58d1a1){logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0x28'),_0x3300ae['id']));return _0x3300ae[_0x7a04('0x1a')]({'sentiment':_0x58d1a1[_0x7a04('0x31')],'sPositive':_0x58d1a1[_0x7a04('0x29')][_0x7a04('0x32')],'sNegative':_0x58d1a1['SentimentScore'][_0x7a04('0x33')],'sMixed':_0x58d1a1[_0x7a04('0x29')]['Mixed'],'sNeutral':_0x58d1a1['SentimentScore']['Neutral'],'transcribeStatus':_0x7a04('0x13')});})[_0x7a04('0xe')](function(){logger[_0x7a04('0x8')](util[_0x7a04('0x9')](_0x7a04('0x1b'),_0x3300ae['id']));_0x44a0a1();});}})['catch'](function(_0x513895){if(_0x513895){if(!_0x513895[_0x7a04('0x34')]||_0x513895[_0x7a04('0x34')]!==_0x7a04('0x35')){logger[_0x7a04('0x36')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x3300ae['id']),util[_0x7a04('0x37')](_0x513895,{'showHidden':![],'depth':null}));}}_0x44a0a1();});});}function checkTranscribe(){var _0x5dd5dc;var _0x19c1df;var _0x4d159d;return db[_0x7a04('0x38')][_0x7a04('0x39')]({'where':{'transcribeStatus':_0x7a04('0x3a')}})[_0x7a04('0xe')](function(_0x645bea){if(!_0x645bea||!_0x645bea[_0x7a04('0x18')]){throw new db[(_0x7a04('0x1c'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5dd5dc=_0x645bea;return db[_0x7a04('0x3b')][_0x7a04('0x26')]({'where':{'id':0x1}});})[_0x7a04('0xe')](function(_0x40e1d7){if(!_0x40e1d7){throw new db[(_0x7a04('0x1c'))][(_0x7a04('0x23'))](_0x7a04('0x3c'));}_0x19c1df=_0x40e1d7;if(!_0x19c1df[_0x7a04('0x5')]||!_0x19c1df['transcribeAccountId']||!_0x19c1df['transcribeRegion']||!_0x19c1df[_0x7a04('0x21')]||!_0x19c1df[_0x7a04('0x22')]){throw new db['Sequelize'][(_0x7a04('0x23'))]('Transcribe\x20not\x20configured');}return db['CloudProvider'][_0x7a04('0x26')]({'where':{'id':_0x19c1df['transcribeAccountId']}});})[_0x7a04('0xe')](function(_0x44b4ba){if(!_0x44b4ba){throw new db[(_0x7a04('0x1c'))]['ValidationError'](_0x7a04('0x27'));}if(!_0x44b4ba[_0x7a04('0xb')]||!_0x44b4ba[_0x7a04('0xc')]){throw new db['Sequelize']['ValidationError'](_0x7a04('0x30'));}_0x4d159d=_0x44b4ba;var _0x12a4a4=[];_0x5dd5dc[_0x7a04('0x3d')](function(_0x1174b7){_0x12a4a4[_0x7a04('0x3e')](checkTranscribeJob(_0x1174b7,_0x19c1df,_0x4d159d));});return BPromise[_0x7a04('0x3f')](_0x12a4a4);})[_0x7a04('0x40')](function(_0xd6b856){if(_0xd6b856){if(!_0xd6b856[_0x7a04('0x34')]||_0xd6b856[_0x7a04('0x34')]!==_0x7a04('0x35')){logger[_0x7a04('0x36')](util[_0x7a04('0x37')](_0xd6b856,{'showHidden':![],'depth':null}));}}});}exports['start']=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 fc9ae58..2db1951 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 _0xaae4=['ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','timeout','info','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment'];(function(_0x405fd8,_0x610984){var _0xbd161a=function(_0x428ee4){while(--_0x428ee4){_0x405fd8['push'](_0x405fd8['shift']());}};_0xbd161a(++_0x610984);}(_0xaae4,0x120));var _0x4aae=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xaae4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4aae('0x0'));var moment=require(_0x4aae('0x1'));var Redis=require(_0x4aae('0x2'));var util=require('util');var config=require(_0x4aae('0x3'));var db=require(_0x4aae('0x4'))['db'];var logger=require(_0x4aae('0x5'))(_0x4aae('0x6'));config[_0x4aae('0x7')]=_[_0x4aae('0x8')](config[_0x4aae('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x4aae('0x9'))(new Redis(config[_0x4aae('0x7')]));function closeInteractions(){var _0x49741d=[];return db[_0x4aae('0xa')][_0x4aae('0xb')]({'raw':!![],'attributes':['id',_0x4aae('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x4aae('0xd')](0x18,_0x4aae('0xe'))}}})[_0x4aae('0xf')](function(_0x1044bc){if(_0x1044bc&&_0x1044bc[_0x4aae('0x10')]){_0x49741d=_[_0x4aae('0x11')](_0x1044bc||[],'id');logger['info'](_0x4aae('0x12'),_0x49741d[_0x4aae('0x13')]());return db['WhatsappInteraction'][_0x4aae('0x14')]({'closeReason':'system','disposition':_0x4aae('0x15'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x49741d}});}})[_0x4aae('0xf')](function(){if(_0x49741d&&_0x49741d['length']){logger[_0x4aae('0x16')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x49741d[_0x4aae('0x13')]());for(var _0x1f7458=0x0;_0x1f7458<_0x49741d[_0x4aae('0x10')];_0x1f7458++){io[_0x4aae('0x17')](_0x4aae('0x18'),{'id':_0x49741d[_0x1f7458],'closed':!![]});}}})[_0x4aae('0x19')](function(_0x183233){logger['error'](_0x4aae('0x1a'),_0x183233?util[_0x4aae('0x1b')](_0x183233,{'showHidden':![],'depth':null}):'');});}exports[_0x4aae('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x977f=['schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','length','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb'];(function(_0x8ec26d,_0x2e44a8){var _0x45f3fc=function(_0x1611ae){while(--_0x1611ae){_0x8ec26d['push'](_0x8ec26d['shift']());}};_0x45f3fc(++_0x2e44a8);}(_0x977f,0x1d7));var _0xf977=function(_0x28446a,_0x9d9a8e){_0x28446a=_0x28446a-0x0;var _0x26a288=_0x977f[_0x28446a];return _0x26a288;};'use strict';var _=require(_0xf977('0x0'));var moment=require(_0xf977('0x1'));var Redis=require(_0xf977('0x2'));var util=require('util');var config=require(_0xf977('0x3'));var db=require(_0xf977('0x4'))['db'];var logger=require('../logger')(_0xf977('0x5'));config[_0xf977('0x6')]=_['defaults'](config[_0xf977('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf977('0x7'))(new Redis(config[_0xf977('0x6')]));function closeInteractions(){var _0x24ee1c=[];return db[_0xf977('0x8')][_0xf977('0x9')]({'raw':!![],'attributes':['id',_0xf977('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xf977('0xb')](0x18,_0xf977('0xc'))}}})[_0xf977('0xd')](function(_0x1805d3){if(_0x1805d3&&_0x1805d3['length']){_0x24ee1c=_[_0xf977('0xe')](_0x1805d3||[],'id');logger[_0xf977('0xf')](_0xf977('0x10'),_0x24ee1c[_0xf977('0x11')]());return db[_0xf977('0x8')][_0xf977('0x12')]({'closeReason':_0xf977('0x13'),'disposition':_0xf977('0x14'),'closed':!![],'closedAt':moment()[_0xf977('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x24ee1c}});}})['then'](function(){if(_0x24ee1c&&_0x24ee1c[_0xf977('0x16')]){logger[_0xf977('0xf')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x24ee1c[_0xf977('0x11')]());for(var _0x5bea6f=0x0;_0x5bea6f<_0x24ee1c['length'];_0x5bea6f++){io['emit'](_0xf977('0x17'),{'id':_0x24ee1c[_0x5bea6f],'closed':!![]});}}})[_0xf977('0x18')](function(_0x348afb){logger[_0xf977('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x348afb?util[_0xf977('0x1a')](_0x348afb,{'showHidden':![],'depth':null}):'');});}exports[_0xf977('0x1b')]=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 81b957c..d426771 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1555=['Innocenzo','@xcally.com','CmContact','then','log','finished\x20populating','contacts1','CmHopper','destroy','bulkCreate','hopper1','contacts2','hopper2','catch','util','push','Biondo','innocenzo.biondo','now'];(function(_0x6e6cd0,_0x5bb3f0){var _0x5ca39d=function(_0x26240a){while(--_0x26240a){_0x6e6cd0['push'](_0x6e6cd0['shift']());}};_0x5ca39d(++_0x5bb3f0);}(_0x1555,0x118));var _0x5155=function(_0xf6c4a3,_0x1e9e8d){_0xf6c4a3=_0xf6c4a3-0x0;var _0x257764=_0x1555[_0xf6c4a3];return _0x257764;};'use strict';var util=require(_0x5155('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5155('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5155('0x2')+i,'phone':0xf879fb460+i,'email':_0x5155('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5155('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5155('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5155('0x4')](),'updatedAt':Date[_0x5155('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5155('0x1')]({'id':i,'firstName':_0x5155('0x5')+i,'lastName':_0x5155('0x2')+i,'phone':0xf879fb460+i,'email':_0x5155('0x3')+i+_0x5155('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5155('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5155('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5155('0x4')](),'updatedAt':Date[_0x5155('0x4')]()});}db[_0x5155('0x7')]['destroy']({'where':{}})[_0x5155('0x8')](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0x5155('0x9')](_0x5155('0xa'),_0x5155('0xb'));return db[_0x5155('0xc')][_0x5155('0xd')]({'where':{}});})[_0x5155('0x8')](function(){return db[_0x5155('0xc')][_0x5155('0xe')](hopper);})[_0x5155('0x8')](function(){console[_0x5155('0x9')](_0x5155('0xa'),_0x5155('0xf'));return db[_0x5155('0x7')]['bulkCreate'](contacts2);})['then'](function(){console[_0x5155('0x9')](_0x5155('0xa'),_0x5155('0x10'));return db['CmHopper'][_0x5155('0xe')](hopper2);})[_0x5155('0x8')](function(){console['log']('finished\x20populating',_0x5155('0x11'));})[_0x5155('0x12')](function(_0x14f20c){console[_0x5155('0x9')](_0x14f20c);}); \ No newline at end of file +var _0x3e00=['Innocenzo','innocenzo.biondo','push','now','Biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2','catch','util','../mysqldb'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x3e00,0x7c));var _0x03e0=function(_0x1acc3c,_0x253b87){_0x1acc3c=_0x1acc3c-0x0;var _0x544d5d=_0x3e00[_0x1acc3c];return _0x544d5d;};'use strict';var util=require(_0x03e0('0x0'));var db=require(_0x03e0('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x03e0('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x03e0('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x03e0('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x03e0('0x5')](),'updatedAt':Date[_0x03e0('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x03e0('0x2')+i,'lastName':_0x03e0('0x6')+i,'phone':0xf879fb460+i,'email':_0x03e0('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x03e0('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x03e0('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x03e0('0x5')](),'updatedAt':Date[_0x03e0('0x5')]()});}db[_0x03e0('0x7')][_0x03e0('0x8')]({'where':{}})[_0x03e0('0x9')](function(){return db[_0x03e0('0x7')][_0x03e0('0xa')](contacts);})['then'](function(){console[_0x03e0('0xb')](_0x03e0('0xc'),_0x03e0('0xd'));return db[_0x03e0('0xe')][_0x03e0('0x8')]({'where':{}});})[_0x03e0('0x9')](function(){return db[_0x03e0('0xe')][_0x03e0('0xa')](hopper);})[_0x03e0('0x9')](function(){console[_0x03e0('0xb')](_0x03e0('0xc'),_0x03e0('0xf'));return db[_0x03e0('0x7')][_0x03e0('0xa')](contacts2);})[_0x03e0('0x9')](function(){console['log'](_0x03e0('0xc'),'contacts2');return db[_0x03e0('0xe')][_0x03e0('0xa')](hopper2);})[_0x03e0('0x9')](function(){console[_0x03e0('0xb')]('finished\x20populating',_0x03e0('0x10'));})[_0x03e0('0x11')](function(_0xf03c97){console[_0x03e0('0xb')](_0xf03c97);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 9862867..0ce16c0 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff2f=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','catch','log','../mysqldb','%s%s','agent','format','password','all'];(function(_0x49a84b,_0x17c1be){var _0x171650=function(_0x1cc9cf){while(--_0x1cc9cf){_0x49a84b['push'](_0x49a84b['shift']());}};_0x171650(++_0x17c1be);}(_0xff2f,0x10a));var _0xfff2=function(_0x33ebf5,_0x258ec6){_0x33ebf5=_0x33ebf5-0x0;var _0x66957b=_0xff2f[_0x33ebf5];return _0x66957b;};'use strict';var util=require('util');var db=require(_0xfff2('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0xfff2('0x1'),_0xfff2('0x2'),i),'fullname':util[_0xfff2('0x3')](_0xfff2('0x1'),'agent',i),'email':util[_0xfff2('0x3')]('%s%s@xcally.com',_0xfff2('0x2'),i),'role':_0xfff2('0x2'),'password':_0xfff2('0x4'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws','wss'],'disallow':[_0xfff2('0x5')],'allow':[_0xfff2('0x6')],'defaultuser':util[_0xfff2('0x3')](_0xfff2('0x1'),_0xfff2('0x2'),i),'encryption':'yes','avpf':_0xfff2('0x7'),'force_avp':_0xfff2('0x7'),'icesupport':_0xfff2('0x7'),'dtlsenable':_0xfff2('0x7'),'dtlsverify':'no','dtlscertfile':_0xfff2('0x8'),'dtlsprivatekey':_0xfff2('0x9'),'dtlssetup':_0xfff2('0xa'),'callerid':util[_0xfff2('0x3')](_0xfff2('0xb'),util[_0xfff2('0x3')]('%s%s',_0xfff2('0x2'),i),0xfa0+i)});}db[_0xfff2('0xc')]['bulkCreate'](users)[_0xfff2('0xd')](function(){console['log'](_0xfff2('0xe'));})[_0xfff2('0xf')](function(_0x4b4267){console[_0xfff2('0x10')](_0x4b4267);}); \ No newline at end of file +var _0x90e5=['catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user'];(function(_0x587b23,_0x533ebb){var _0x55f919=function(_0x191c70){while(--_0x191c70){_0x587b23['push'](_0x587b23['shift']());}};_0x55f919(++_0x533ebb);}(_0x90e5,0x9b));var _0x590e=function(_0x1f50c4,_0x58461d){_0x1f50c4=_0x1f50c4-0x0;var _0x32aa9d=_0x90e5[_0x1f50c4];return _0x32aa9d;};'use strict';var util=require(_0x590e('0x0'));var db=require(_0x590e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x590e('0x2')]({'name':util[_0x590e('0x3')](_0x590e('0x4'),_0x590e('0x5'),i),'fullname':util[_0x590e('0x3')](_0x590e('0x4'),'agent',i),'email':util['format'](_0x590e('0x6'),'agent',i),'role':_0x590e('0x5'),'password':_0x590e('0x7'),'internal':0xfa0+i,'type':_0x590e('0x8'),'transport':[_0x590e('0x9'),'ws','wss'],'disallow':[_0x590e('0xa')],'allow':[_0x590e('0xb')],'defaultuser':util[_0x590e('0x3')](_0x590e('0x4'),_0x590e('0x5'),i),'encryption':'yes','avpf':_0x590e('0xc'),'force_avp':'yes','icesupport':_0x590e('0xc'),'dtlsenable':_0x590e('0xc'),'dtlsverify':'no','dtlscertfile':_0x590e('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x590e('0xe'),'callerid':util[_0x590e('0x3')](_0x590e('0xf'),util[_0x590e('0x3')](_0x590e('0x4'),'agent',i),0xfa0+i)});}db[_0x590e('0x10')][_0x590e('0x11')](users)[_0x590e('0x12')](function(){console[_0x590e('0x13')](_0x590e('0x14'));})[_0x590e('0x15')](function(_0x23fb9e){console[_0x590e('0x13')](_0x23fb9e);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 5eb2cc3..b7f81b2 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff4f=['whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','lodash','util','bluebird','name','Agents','User','role','agent','telephone','type','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','ivr','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','voice:inbound','voice:outbound','ChatQueues','ChatQueue','SmsQueue','WhatsappQueue','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xff4f,0x156));var _0xfff4=function(_0x41c17d,_0x58a4b3){_0x41c17d=_0x41c17d-0x0;var _0x536e92=_0xff4f[_0x41c17d];return _0x536e92;};'use strict';var _=require(_0xfff4('0x0'));var util=require(_0xfff4('0x1'));var BPromise=require(_0xfff4('0x2'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xfff4('0x3')],'include':[{'as':_0xfff4('0x4'),'model':db[_0xfff4('0x5')],'attributes':['id','name',_0xfff4('0x6')],'raw':!![],'where':{'role':_0xfff4('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xfff4('0x3')],'where':{'role':_0xfff4('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xfff4('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xfff4('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0xfff4('0x3'),_0xfff4('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0xe9e378,_0x448091,_0x44ac7c){return db[_0xfff4('0xa')]['findOne']({'where':{'name':_0xe9e378,'userProfileId':_0x448091},'raw':!![]})[_0xfff4('0xb')](function(_0x19d915){if(_0x19d915){if(_0x19d915[_0xfff4('0xc')]){switch(_0xe9e378){case _0xfff4('0xd'):case'ChatQueues':case _0xfff4('0xe'):case _0xfff4('0xf'):case _0xfff4('0x10'):case _0xfff4('0x11'):case _0xfff4('0x12'):return db[_0x44ac7c][_0xfff4('0x13')](queryQueues);case _0xfff4('0x14'):return db[_0x44ac7c]['findAll'](queryTelephones);case _0xfff4('0x15'):return db[_0x44ac7c][_0xfff4('0x13')](queryTrunks);case _0xfff4('0x16'):return db[_0x44ac7c][_0xfff4('0x13')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0xfff4('0x17')],'where':{'sectionId':_0x19d915['id']},'raw':!![]})['then'](function(_0x2b317f){if(_0x2b317f){var _0x359ce1={'where':{'id':_['map'](_0x2b317f,_0xfff4('0x17'))},'raw':!![]};switch(_0x44ac7c){case _0xfff4('0x5'):_0x359ce1['where'][_0xfff4('0x6')]=_0xfff4('0x8');break;case'Campaign':_0x359ce1['where'][_0xfff4('0x9')]=_0xfff4('0x18');break;}return db[_0x44ac7c][_0xfff4('0x13')](_0x359ce1);}else{return[];}});}}else{return[];}})[_0xfff4('0xb')](function(_0xa875e1){return _0xa875e1;});}function joinOrLeaveQueues(_0x1a5a60,_0x19eb3e,_0x1430b9,_0x3e2e35){_0x1a5a60[_0x19eb3e](util[_0xfff4('0x19')](_0xfff4('0x1a'),_0x1430b9,_0x3e2e35[_0xfff4('0x3')]));if(_0x3e2e35[_0xfff4('0x4')]){for(var _0x1356c5=0x0;_0x1356c5<_0x3e2e35['Agents'][_0xfff4('0x1b')];_0x1356c5+=0x1){_0x1a5a60[_0x19eb3e](util[_0xfff4('0x19')](_0xfff4('0x1c'),_0x3e2e35[_0xfff4('0x4')][_0x1356c5][_0xfff4('0x3')]));}}}function joinOrLeave(_0x3f4ae5,_0x3650b6,_0x257180){var _0x2c28c1;if(_0x3f4ae5[_0xfff4('0x1d')][_0xfff4('0x1e')]['id']){db['User']['find']({'attributes':['id','name','role',_0xfff4('0x1f')],'where':{'id':_0x3f4ae5[_0xfff4('0x1d')][_0xfff4('0x1e')]['id']},'include':[{'model':db[_0xfff4('0x20')],'as':_0xfff4('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xfff4('0x22')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xfff4('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xfff4('0x24')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xfff4('0x25')],'as':_0xfff4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xfff4('0x27')],'as':_0xfff4('0x28'),'attributes':['id'],'raw':!![]}]})[_0xfff4('0xb')](function(_0x534557){if(_0x534557){_0x2c28c1=_0x534557;_0x3f4ae5[_0x3650b6](util[_0xfff4('0x19')](_0xfff4('0x1c'),_0x534557['name']));var _0x2c5ed2=[];switch(_0x534557['role']){case _0xfff4('0x29'):_0x3f4ae5[_0x3650b6]('voice:inbound');_0x3f4ae5[_0x3650b6]('voice:outbound');if(queryQueues[_0xfff4('0x2a')](_0xfff4('0x2b'))){delete queryQueues['include'];}_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x2d')][_0xfff4('0x13')](queryQueues));_0x2c5ed2[_0xfff4('0x2c')](db['ChatQueue']['findAll'](queryQueues));_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x2e')][_0xfff4('0x13')](queryQueues));_0x2c5ed2['push'](db['SmsQueue'][_0xfff4('0x13')](queryQueues));_0x2c5ed2['push'](db[_0xfff4('0x2f')][_0xfff4('0x13')](queryQueues));_0x2c5ed2['push'](db[_0xfff4('0x30')]['findAll'](queryQueues));_0x2c5ed2[_0xfff4('0x2c')](db['WhatsappQueue'][_0xfff4('0x13')](queryQueues));_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x5')][_0xfff4('0x13')](queryTelephones));_0x2c5ed2['push'](db[_0xfff4('0x31')][_0xfff4('0x13')](queryTrunks));_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x32')][_0xfff4('0x13')](queryCampaigns));_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x5')][_0xfff4('0x13')](queryAgents));break;case _0xfff4('0x33'):_0x3f4ae5[_0x3650b6](_0xfff4('0x34'));_0x3f4ae5[_0x3650b6](_0xfff4('0x35'));_0x2c5ed2['push'](getAssociatedResources(_0xfff4('0xd'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x2d')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x36'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x37')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0xe'),_0x534557['userProfileId'],_0xfff4('0x2e')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0xf'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x38')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x10'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x2f')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x11'),_0x534557[_0xfff4('0x1f')],'OpenchannelQueue'));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x12'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x39')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x14'),_0x534557[_0xfff4('0x1f')],_0xfff4('0x5')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources('Trunks',_0x534557[_0xfff4('0x1f')],_0xfff4('0x31')));_0x2c5ed2[_0xfff4('0x2c')](getAssociatedResources(_0xfff4('0x16'),_0x534557[_0xfff4('0x1f')],'Campaign'));_0x2c5ed2[_0xfff4('0x2c')](db[_0xfff4('0x5')][_0xfff4('0x13')](queryAgents));break;case _0xfff4('0x7'):_0x3f4ae5[_0x3650b6](_0xfff4('0x34'));_0x3f4ae5[_0x3650b6]('voice:outbound');_0x2c5ed2['push'](_0x534557[_0xfff4('0x3a')]({'attributes':['id',_0xfff4('0x3')]}));_0x2c5ed2['push'](_0x534557[_0xfff4('0x3b')]({'attributes':['id',_0xfff4('0x3')]}));_0x2c5ed2['push'](_0x534557['getFaxQueues']({'attributes':['id',_0xfff4('0x3')]}));_0x2c5ed2[_0xfff4('0x2c')](_0x534557[_0xfff4('0x3c')]({'attributes':['id','name']}));_0x2c5ed2[_0xfff4('0x2c')](_0x534557[_0xfff4('0x3d')]({'attributes':['id',_0xfff4('0x3')]}));_0x2c5ed2[_0xfff4('0x2c')](_0x534557[_0xfff4('0x3e')]({'attributes':['id',_0xfff4('0x3')]}));_0x2c5ed2[_0xfff4('0x2c')](_0x534557[_0xfff4('0x3f')]({'attributes':['id',_0xfff4('0x3')]}));break;}return BPromise[_0xfff4('0x40')](_0x2c5ed2);}})[_0xfff4('0xb')](function(_0x29e0d5){if(_0x29e0d5&&_0x29e0d5[_0xfff4('0x1b')]){for(var _0x4c905e=0x0;_0x4c905e<_0x29e0d5[_0xfff4('0x1b')];_0x4c905e+=0x1){for(var _0x212a1a=0x0;_0x212a1a<_0x29e0d5[_0x4c905e]['length'];_0x212a1a+=0x1){switch(_0x4c905e){case 0x0:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,'voice',_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x1:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x41'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x2:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x42'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x3:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x43'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x4:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x44'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x5:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x45'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x6:joinOrLeaveQueues(_0x3f4ae5,_0x3650b6,_0xfff4('0x46'),_0x29e0d5[_0x4c905e][_0x212a1a]);break;case 0x7:if(_0x2c28c1[_0xfff4('0x6')]!==_0xfff4('0x7'))_0x3f4ae5[_0x3650b6](util[_0xfff4('0x19')](_0xfff4('0x47'),_0x29e0d5[_0x4c905e][_0x212a1a][_0xfff4('0x3')]));break;case 0x8:if(_0x2c28c1['role']!==_0xfff4('0x7'))_0x3f4ae5[_0x3650b6](util[_0xfff4('0x19')](_0xfff4('0x48'),_0x29e0d5[_0x4c905e][_0x212a1a][_0xfff4('0x3')]));break;case 0x9:if(_0x2c28c1[_0xfff4('0x6')]!==_0xfff4('0x7'))_0x3f4ae5[_0x3650b6](util[_0xfff4('0x19')](_0xfff4('0x49'),_0x29e0d5[_0x4c905e][_0x212a1a][_0xfff4('0x9')],_0x29e0d5[_0x4c905e][_0x212a1a][_0xfff4('0x3')]));break;case 0xa:_0x3f4ae5[_0x3650b6](util[_0xfff4('0x19')](_0xfff4('0x1c'),_0x29e0d5[_0x4c905e][_0x212a1a][_0xfff4('0x3')]));break;}}}}})['then'](function(){if(_0x3650b6==='leave'){var _0x490037=_[_0xfff4('0x4a')](_0x2c28c1[_0xfff4('0x21')],'id');return _0x2c28c1[_0xfff4('0x4b')](_0x490037)[_0xfff4('0xb')](function(){for(var _0x225fd3=0x0;_0x225fd3<_0x490037[_0xfff4('0x1b')];_0x225fd3+=0x1){_0x257180[_0xfff4('0x4c')](_0xfff4('0x4d'),{'ChatInteractionId':Number(_0x490037[_0x225fd3]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0xb')](function(){if(_0x3650b6===_0xfff4('0x4e')){var _0x2eddb4=_[_0xfff4('0x4a')](_0x2c28c1[_0xfff4('0x4f')],'id');return _0x2c28c1[_0xfff4('0x50')](_0x2eddb4)[_0xfff4('0xb')](function(){for(var _0x2cfce1=0x0;_0x2cfce1<_0x2eddb4[_0xfff4('0x1b')];_0x2cfce1+=0x1){_0x257180[_0xfff4('0x4c')](_0xfff4('0x51'),{'MailInteractionId':Number(_0x2eddb4[_0x2cfce1]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0xb')](function(){if(_0x3650b6===_0xfff4('0x4e')){var _0x47cd18=_[_0xfff4('0x4a')](_0x2c28c1[_0xfff4('0x23')],'id');return _0x2c28c1[_0xfff4('0x52')](_0x47cd18)['then'](function(){for(var _0x24d252=0x0;_0x24d252<_0x47cd18[_0xfff4('0x1b')];_0x24d252+=0x1){_0x257180[_0xfff4('0x4c')](_0xfff4('0x53'),{'FaxInteractionId':Number(_0x47cd18[_0x24d252]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0xb')](function(){if(_0x3650b6===_0xfff4('0x4e')){var _0x128f6a=_[_0xfff4('0x4a')](_0x2c28c1[_0xfff4('0x54')],'id');return _0x2c28c1[_0xfff4('0x55')](_0x128f6a)[_0xfff4('0xb')](function(){for(var _0x347cf5=0x0;_0x347cf5<_0x128f6a['length'];_0x347cf5+=0x1){_0x257180[_0xfff4('0x4c')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x128f6a[_0x347cf5]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0xb')](function(){if(_0x3650b6===_0xfff4('0x4e')){var _0x48c8a8=_['map'](_0x2c28c1[_0xfff4('0x26')],'id');return _0x2c28c1[_0xfff4('0x56')](_0x48c8a8)['then'](function(){for(var _0x38a7a4=0x0;_0x38a7a4<_0x48c8a8['length'];_0x38a7a4+=0x1){_0x257180[_0xfff4('0x4c')](_0xfff4('0x57'),{'OpenchannelInteractionId':Number(_0x48c8a8[_0x38a7a4]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0xb')](function(){if(_0x3650b6===_0xfff4('0x4e')){var _0x66b354=_[_0xfff4('0x4a')](_0x2c28c1[_0xfff4('0x28')],'id');return _0x2c28c1['removeWhatsappInteractions'](_0x66b354)['then'](function(){for(var _0x855ce=0x0;_0x855ce<_0x66b354[_0xfff4('0x1b')];_0x855ce+=0x1){_0x257180[_0xfff4('0x4c')](_0xfff4('0x58'),{'WhatsappInteractionId':Number(_0x66b354[_0x855ce]),'UserId':Number(_0x2c28c1['id'])});}});}})[_0xfff4('0x59')](function(_0x268189){_0x3f4ae5[_0xfff4('0x5a')](_0x268189);});}}function onDisconnect(_0x4b1316,_0x1b9ac2){joinOrLeave(_0x4b1316,_0xfff4('0x4e'),_0x1b9ac2);}function onConnect(_0x2fcd68){joinOrLeave(_0x2fcd68,_0xfff4('0x5b'));}exports[_0xfff4('0x5c')]=function(_0x4e50f7){_0x4e50f7['on'](_0xfff4('0x5d'),function(_0x3ebd63){_0x3ebd63[_0xfff4('0x5e')](0x0);_0x3ebd63[_0xfff4('0x5f')]=_0x3ebd63[_0xfff4('0x60')]['connection'][_0xfff4('0x61')]+':'+_0x3ebd63['request'][_0xfff4('0x5d')][_0xfff4('0x62')];_0x3ebd63[_0xfff4('0x63')]=new Date();_0x3ebd63['log']=function(_0x43cff3){console[_0xfff4('0x5a')](_0xfff4('0x64')+_0x3ebd63['nsp'][_0xfff4('0x3')]+'['+_0x3ebd63[_0xfff4('0x5f')]+']',_0x43cff3);};_0x3ebd63['on'](_0xfff4('0x65'),function(){onDisconnect(_0x3ebd63,_0x4e50f7);_0x3ebd63[_0xfff4('0x5a')]('DISCONNECTED');});onConnect(_0x3ebd63);_0x3ebd63['log'](_0xfff4('0x66'));});}; \ No newline at end of file +var _0x0a05=['length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:inbound','ChatQueue','SmsQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','chat','fax','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','leave','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','request','SocketIO\x20','nsp','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','agent','telephone','type','ivr','findOne','then','VoiceQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','map','resourceId','User','where','role','format','%s:queue:%s'];(function(_0x13c5a2,_0x39b5b7){var _0x22f168=function(_0x574d4c){while(--_0x574d4c){_0x13c5a2['push'](_0x13c5a2['shift']());}};_0x22f168(++_0x39b5b7);}(_0x0a05,0x9e));var _0x50a0=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0x0a05[_0x3042c5];return _0x7cd140;};'use strict';var _=require(_0x50a0('0x0'));var util=require(_0x50a0('0x1'));var BPromise=require(_0x50a0('0x2'));var db=require(_0x50a0('0x3'))['db'];var config=require(_0x50a0('0x4'));var queryQueues={'attributes':['id',_0x50a0('0x5')],'include':[{'as':_0x50a0('0x6'),'model':db['User'],'attributes':['id',_0x50a0('0x5'),'role'],'raw':!![],'where':{'role':_0x50a0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x50a0('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x50a0('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x50a0('0x5'),_0x50a0('0x9')],'where':{'type':_0x50a0('0xa')}};function getAssociatedResources(_0x2ea146,_0x5d6056,_0x1edead){return db['UserProfileSection'][_0x50a0('0xb')]({'where':{'name':_0x2ea146,'userProfileId':_0x5d6056},'raw':!![]})[_0x50a0('0xc')](function(_0x39a17e){if(_0x39a17e){if(_0x39a17e['autoAssociation']){switch(_0x2ea146){case _0x50a0('0xd'):case'ChatQueues':case _0x50a0('0xe'):case'SmsQueues':case'MailQueues':case _0x50a0('0xf'):case _0x50a0('0x10'):return db[_0x1edead][_0x50a0('0x11')](queryQueues);case _0x50a0('0x12'):return db[_0x1edead][_0x50a0('0x11')](queryTelephones);case'Trunks':return db[_0x1edead][_0x50a0('0x11')](queryTrunks);case _0x50a0('0x13'):return db[_0x1edead][_0x50a0('0x11')](queryCampaigns);}}else{return db[_0x50a0('0x14')][_0x50a0('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x39a17e['id']},'raw':!![]})['then'](function(_0x4c34ba){if(_0x4c34ba){var _0x582fb5={'where':{'id':_[_0x50a0('0x15')](_0x4c34ba,_0x50a0('0x16'))},'raw':!![]};switch(_0x1edead){case _0x50a0('0x17'):_0x582fb5[_0x50a0('0x18')][_0x50a0('0x19')]=_0x50a0('0x8');break;case'Campaign':_0x582fb5['where'][_0x50a0('0x9')]=_0x50a0('0xa');break;}return db[_0x1edead][_0x50a0('0x11')](_0x582fb5);}else{return[];}});}}else{return[];}})[_0x50a0('0xc')](function(_0x265496){return _0x265496;});}function joinOrLeaveQueues(_0x48ec1e,_0x321d1d,_0x5d7536,_0x2603f1){_0x48ec1e[_0x321d1d](util[_0x50a0('0x1a')](_0x50a0('0x1b'),_0x5d7536,_0x2603f1[_0x50a0('0x5')]));if(_0x2603f1['Agents']){for(var _0x62c40a=0x0;_0x62c40a<_0x2603f1['Agents'][_0x50a0('0x1c')];_0x62c40a+=0x1){_0x48ec1e[_0x321d1d](util[_0x50a0('0x1a')]('user:%s',_0x2603f1[_0x50a0('0x6')][_0x62c40a][_0x50a0('0x5')]));}}}function joinOrLeave(_0xa82805,_0x89e493,_0x1a264a){var _0x10ec8b;if(_0xa82805[_0x50a0('0x1d')][_0x50a0('0x1e')]['id']){db['User']['find']({'attributes':['id',_0x50a0('0x5'),_0x50a0('0x19'),_0x50a0('0x1f')],'where':{'id':_0xa82805['handshake'][_0x50a0('0x1e')]['id']},'include':[{'model':db[_0x50a0('0x20')],'as':_0x50a0('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x50a0('0x22'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x50a0('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x50a0('0x24')],'as':_0x50a0('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x50a0('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x50a0('0x27')],'as':_0x50a0('0x28'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x3b5eb8){if(_0x3b5eb8){_0x10ec8b=_0x3b5eb8;_0xa82805[_0x89e493](util[_0x50a0('0x1a')](_0x50a0('0x29'),_0x3b5eb8[_0x50a0('0x5')]));var _0x5970e5=[];switch(_0x3b5eb8['role']){case'admin':_0xa82805[_0x89e493]('voice:inbound');_0xa82805[_0x89e493](_0x50a0('0x2a'));if(queryQueues[_0x50a0('0x2b')](_0x50a0('0x2c'))){delete queryQueues[_0x50a0('0x2c')];}_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x2e')][_0x50a0('0x11')](queryQueues));_0x5970e5['push'](db['ChatQueue'][_0x50a0('0x11')](queryQueues));_0x5970e5['push'](db[_0x50a0('0x2f')]['findAll'](queryQueues));_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x30')][_0x50a0('0x11')](queryQueues));_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x31')][_0x50a0('0x11')](queryQueues));_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x32')][_0x50a0('0x11')](queryQueues));_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x33')][_0x50a0('0x11')](queryQueues));_0x5970e5['push'](db[_0x50a0('0x17')]['findAll'](queryTelephones));_0x5970e5['push'](db[_0x50a0('0x34')][_0x50a0('0x11')](queryTrunks));_0x5970e5['push'](db[_0x50a0('0x35')][_0x50a0('0x11')](queryCampaigns));_0x5970e5[_0x50a0('0x2d')](db[_0x50a0('0x17')][_0x50a0('0x11')](queryAgents));break;case _0x50a0('0x36'):_0xa82805[_0x89e493](_0x50a0('0x37'));_0xa82805[_0x89e493](_0x50a0('0x2a'));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0xd'),_0x3b5eb8[_0x50a0('0x1f')],_0x50a0('0x2e')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources('ChatQueues',_0x3b5eb8[_0x50a0('0x1f')],_0x50a0('0x38')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0xe'),_0x3b5eb8[_0x50a0('0x1f')],_0x50a0('0x2f')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0x39'),_0x3b5eb8['userProfileId'],_0x50a0('0x30')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources('MailQueues',_0x3b5eb8['userProfileId'],_0x50a0('0x31')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources('OpenchannelQueues',_0x3b5eb8[_0x50a0('0x1f')],_0x50a0('0x32')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0x10'),_0x3b5eb8['userProfileId'],_0x50a0('0x33')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0x12'),_0x3b5eb8['userProfileId'],_0x50a0('0x17')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources('Trunks',_0x3b5eb8['userProfileId'],_0x50a0('0x34')));_0x5970e5[_0x50a0('0x2d')](getAssociatedResources(_0x50a0('0x13'),_0x3b5eb8[_0x50a0('0x1f')],_0x50a0('0x35')));_0x5970e5['push'](db[_0x50a0('0x17')][_0x50a0('0x11')](queryAgents));break;case'agent':_0xa82805[_0x89e493](_0x50a0('0x37'));_0xa82805[_0x89e493]('voice:outbound');_0x5970e5['push'](_0x3b5eb8['getVoiceQueues']({'attributes':['id',_0x50a0('0x5')]}));_0x5970e5['push'](_0x3b5eb8[_0x50a0('0x3a')]({'attributes':['id',_0x50a0('0x5')]}));_0x5970e5[_0x50a0('0x2d')](_0x3b5eb8[_0x50a0('0x3b')]({'attributes':['id',_0x50a0('0x5')]}));_0x5970e5[_0x50a0('0x2d')](_0x3b5eb8[_0x50a0('0x3c')]({'attributes':['id','name']}));_0x5970e5[_0x50a0('0x2d')](_0x3b5eb8[_0x50a0('0x3d')]({'attributes':['id','name']}));_0x5970e5[_0x50a0('0x2d')](_0x3b5eb8[_0x50a0('0x3e')]({'attributes':['id',_0x50a0('0x5')]}));_0x5970e5['push'](_0x3b5eb8[_0x50a0('0x3f')]({'attributes':['id',_0x50a0('0x5')]}));break;}return BPromise['all'](_0x5970e5);}})['then'](function(_0x4de799){if(_0x4de799&&_0x4de799[_0x50a0('0x1c')]){for(var _0x1797b6=0x0;_0x1797b6<_0x4de799[_0x50a0('0x1c')];_0x1797b6+=0x1){for(var _0x20b466=0x0;_0x20b466<_0x4de799[_0x1797b6][_0x50a0('0x1c')];_0x20b466+=0x1){switch(_0x1797b6){case 0x0:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x40'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x1:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x41'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x2:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x42'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x3:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x43'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x4:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x44'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x5:joinOrLeaveQueues(_0xa82805,_0x89e493,'openchannel',_0x4de799[_0x1797b6][_0x20b466]);break;case 0x6:joinOrLeaveQueues(_0xa82805,_0x89e493,_0x50a0('0x45'),_0x4de799[_0x1797b6][_0x20b466]);break;case 0x7:if(_0x10ec8b[_0x50a0('0x19')]!==_0x50a0('0x7'))_0xa82805[_0x89e493](util[_0x50a0('0x1a')]('telephone:%s',_0x4de799[_0x1797b6][_0x20b466][_0x50a0('0x5')]));break;case 0x8:if(_0x10ec8b['role']!==_0x50a0('0x7'))_0xa82805[_0x89e493](util['format'](_0x50a0('0x46'),_0x4de799[_0x1797b6][_0x20b466][_0x50a0('0x5')]));break;case 0x9:if(_0x10ec8b['role']!=='agent')_0xa82805[_0x89e493](util[_0x50a0('0x1a')](_0x50a0('0x47'),_0x4de799[_0x1797b6][_0x20b466][_0x50a0('0x9')],_0x4de799[_0x1797b6][_0x20b466][_0x50a0('0x5')]));break;case 0xa:_0xa82805[_0x89e493](util['format']('user:%s',_0x4de799[_0x1797b6][_0x20b466][_0x50a0('0x5')]));break;}}}}})[_0x50a0('0xc')](function(){if(_0x89e493==='leave'){var _0x4af95d=_[_0x50a0('0x15')](_0x10ec8b['ChatInteractions'],'id');return _0x10ec8b[_0x50a0('0x48')](_0x4af95d)[_0x50a0('0xc')](function(){for(var _0x54feae=0x0;_0x54feae<_0x4af95d[_0x50a0('0x1c')];_0x54feae+=0x1){_0x1a264a[_0x50a0('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x4af95d[_0x54feae]),'UserId':Number(_0x10ec8b['id'])});}});}})[_0x50a0('0xc')](function(){if(_0x89e493==='leave'){var _0x4abdf0=_[_0x50a0('0x15')](_0x10ec8b[_0x50a0('0x22')],'id');return _0x10ec8b[_0x50a0('0x4a')](_0x4abdf0)[_0x50a0('0xc')](function(){for(var _0x2730a6=0x0;_0x2730a6<_0x4abdf0[_0x50a0('0x1c')];_0x2730a6+=0x1){_0x1a264a['emit'](_0x50a0('0x4b'),{'MailInteractionId':Number(_0x4abdf0[_0x2730a6]),'UserId':Number(_0x10ec8b['id'])});}});}})[_0x50a0('0xc')](function(){if(_0x89e493==='leave'){var _0x51c1b5=_[_0x50a0('0x15')](_0x10ec8b[_0x50a0('0x23')],'id');return _0x10ec8b[_0x50a0('0x4c')](_0x51c1b5)[_0x50a0('0xc')](function(){for(var _0x447444=0x0;_0x447444<_0x51c1b5[_0x50a0('0x1c')];_0x447444+=0x1){_0x1a264a['emit'](_0x50a0('0x4d'),{'FaxInteractionId':Number(_0x51c1b5[_0x447444]),'UserId':Number(_0x10ec8b['id'])});}});}})[_0x50a0('0xc')](function(){if(_0x89e493===_0x50a0('0x4e')){var _0x3109d5=_['map'](_0x10ec8b['SmsInteractions'],'id');return _0x10ec8b['removeSmsInteractions'](_0x3109d5)[_0x50a0('0xc')](function(){for(var _0x16584b=0x0;_0x16584b<_0x3109d5[_0x50a0('0x1c')];_0x16584b+=0x1){_0x1a264a[_0x50a0('0x49')](_0x50a0('0x4f'),{'SmsInteractionId':Number(_0x3109d5[_0x16584b]),'UserId':Number(_0x10ec8b['id'])});}});}})[_0x50a0('0xc')](function(){if(_0x89e493===_0x50a0('0x4e')){var _0x2aadbc=_[_0x50a0('0x15')](_0x10ec8b[_0x50a0('0x26')],'id');return _0x10ec8b[_0x50a0('0x50')](_0x2aadbc)[_0x50a0('0xc')](function(){for(var _0x9822d=0x0;_0x9822d<_0x2aadbc['length'];_0x9822d+=0x1){_0x1a264a[_0x50a0('0x49')](_0x50a0('0x51'),{'OpenchannelInteractionId':Number(_0x2aadbc[_0x9822d]),'UserId':Number(_0x10ec8b['id'])});}});}})['then'](function(){if(_0x89e493===_0x50a0('0x4e')){var _0x40f648=_['map'](_0x10ec8b[_0x50a0('0x28')],'id');return _0x10ec8b[_0x50a0('0x52')](_0x40f648)[_0x50a0('0xc')](function(){for(var _0x29f05a=0x0;_0x29f05a<_0x40f648[_0x50a0('0x1c')];_0x29f05a+=0x1){_0x1a264a[_0x50a0('0x49')](_0x50a0('0x53'),{'WhatsappInteractionId':Number(_0x40f648[_0x29f05a]),'UserId':Number(_0x10ec8b['id'])});}});}})['catch'](function(_0x46e7b1){_0xa82805[_0x50a0('0x54')](_0x46e7b1);});}}function onDisconnect(_0x23ac08,_0x1456e3){joinOrLeave(_0x23ac08,'leave',_0x1456e3);}function onConnect(_0x547f05){joinOrLeave(_0x547f05,_0x50a0('0x55'));}exports[_0x50a0('0x56')]=function(_0x31cc0d){_0x31cc0d['on'](_0x50a0('0x57'),function(_0x3f8e20){_0x3f8e20[_0x50a0('0x58')](0x0);_0x3f8e20['address']=_0x3f8e20[_0x50a0('0x59')][_0x50a0('0x57')]['remoteAddress']+':'+_0x3f8e20[_0x50a0('0x59')]['connection']['remotePort'];_0x3f8e20['connectedAt']=new Date();_0x3f8e20[_0x50a0('0x54')]=function(_0x5b2174){console['log'](_0x50a0('0x5a')+_0x3f8e20[_0x50a0('0x5b')][_0x50a0('0x5')]+'['+_0x3f8e20['address']+']',_0x5b2174);};_0x3f8e20['on']('disconnect',function(){onDisconnect(_0x3f8e20,_0x31cc0d);_0x3f8e20[_0x50a0('0x54')]('DISCONNECTED');});onConnect(_0x3f8e20);_0x3f8e20['log'](_0x50a0('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 36979c4..5e9dc00 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 _0xb74e=['offlineMessage','opened','QueryTypes','undefined','name','AfterCreate','changed','closed','substatus','sequelize','Sequelize','find','fullname','email','internal','default','model','hook','toLowerCase','condition','util','jayson/promise','../logger','triggers','Chat','ChatInteraction','closedinteraction','ChatMessage','afterCreate','ChatOfflineMessage','newmessage','SmsInteraction','newinteraction','afterUpdate','Sms','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','direction','resolve','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','SELECT','contact','UserId','interface','format','SIP/%s','agent','incomingmessage','AfterCreateMessage','motionChannel'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0xb74e,0xa2));var _0xeb74=function(_0x284a13,_0x373d30){_0x284a13=_0x284a13-0x0;var _0x2f9324=_0xb74e[_0x284a13];return _0x2f9324;};'use strict';var util=require(_0xeb74('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xeb74('0x1'));var logger=require(_0xeb74('0x2'))(_0xeb74('0x3'));var client=jayson['client']['http']({'port':0x232a});var triggers=[{'channel':_0xeb74('0x4'),'model':_0xeb74('0x5'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0xeb74('0x5'),'event':'afterUpdate','condition':_0xeb74('0x6'),'callback':afterUpdate},{'channel':'Chat','model':_0xeb74('0x7'),'event':_0xeb74('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xeb74('0x4'),'model':_0xeb74('0x9'),'event':_0xeb74('0x8'),'condition':_0xeb74('0xa'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xeb74('0xb'),'event':'afterCreate','condition':_0xeb74('0xc'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0xeb74('0xd'),'condition':_0xeb74('0x6'),'callback':afterUpdate},{'channel':_0xeb74('0xe'),'model':'SmsMessage','event':_0xeb74('0x8'),'condition':_0xeb74('0xa'),'callback':afterCreateMessage},{'channel':_0xeb74('0xf'),'model':_0xeb74('0x10'),'event':_0xeb74('0x8'),'condition':_0xeb74('0xc'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xeb74('0xd'),'condition':_0xeb74('0x6'),'callback':afterUpdate},{'channel':_0xeb74('0xf'),'model':_0xeb74('0x11'),'event':'afterCreate','condition':_0xeb74('0xa'),'callback':afterCreateMessage},{'channel':_0xeb74('0x12'),'model':_0xeb74('0x13'),'event':'afterCreate','condition':_0xeb74('0xc'),'callback':afterCreate},{'channel':_0xeb74('0x12'),'model':_0xeb74('0x13'),'event':'afterUpdate','condition':_0xeb74('0x6'),'callback':afterUpdate},{'channel':_0xeb74('0x12'),'model':_0xeb74('0x14'),'event':_0xeb74('0x8'),'condition':_0xeb74('0xa'),'callback':afterCreateMessage},{'channel':_0xeb74('0x15'),'model':_0xeb74('0x16'),'event':'afterCreate','condition':_0xeb74('0xc'),'callback':afterCreate},{'channel':_0xeb74('0x15'),'model':'MailInteraction','event':_0xeb74('0xd'),'condition':_0xeb74('0x6'),'callback':afterUpdate},{'channel':_0xeb74('0x15'),'model':_0xeb74('0x17'),'event':_0xeb74('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':_0xeb74('0x18'),'event':_0xeb74('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0xeb74('0x18'),'event':_0xeb74('0xd'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xeb74('0x19'),'model':_0xeb74('0x1a'),'event':'afterCreate','condition':_0xeb74('0xa'),'callback':afterCreateMessage}];function request(_0x27f67a){return client['request'](_0xeb74('0x1b'),_0x27f67a)[_0xeb74('0x1c')](function(_0x1e00ef){logger['info'](_0xeb74('0x1d'),'EventManager',_0x1e00ef);if(_0x1e00ef[_0xeb74('0x1e')]){if(_0x1e00ef['error'][_0xeb74('0x1f')]===0x1f4){logger[_0xeb74('0x1e')](_0xeb74('0x1d'),_0xeb74('0x1b'),_0x1e00ef[_0xeb74('0x1e')]);}}})[_0xeb74('0x20')](function(_0xf99b20){logger[_0xeb74('0x1e')](_0xeb74('0x1d'),_0xeb74('0x1b'),_0xf99b20);});}function afterCreateMessage(_0x32f768){return function(_0x15910f){_0x15910f=_0x15910f[_0xeb74('0x21')]({'plain':!![]});_0x15910f[_0xeb74('0x22')]=_0x32f768;_0x15910f['motionChannel']=_0x32f768;_0x15910f[_0xeb74('0x23')]=_0x15910f[_0xeb74('0x24')];Promise[_0xeb74('0x25')]()[_0xeb74('0x1c')](function(){if(typeof _0x15910f[_0xeb74('0x26')]==='undefined')return null;var _0x456117=_0xeb74('0x27')+_0x15910f[_0xeb74('0x26')];return db['sequelize'][_0xeb74('0x28')](_0x456117,{'type':db['Sequelize']['QueryTypes'][_0xeb74('0x29')],'raw':!![]});})[_0xeb74('0x1c')](function(_0x1eba0c){if(_0x1eba0c){_0x15910f[_0xeb74('0x2a')]=_0x1eba0c[0x0];}if(typeof _0x15910f[_0xeb74('0x2b')]==='undefined')return;return getAgent(_0x15910f[_0xeb74('0x2b')]);})['then'](function(_0x381466){if(_0x381466){_0x15910f[_0xeb74('0x2c')]=util[_0xeb74('0x2d')](_0xeb74('0x2e'),_0x381466['name']);_0x15910f[_0xeb74('0x2f')]=_0x381466;_0x15910f[_0xeb74('0x22')]=_0x32f768;return request({'event':_0xeb74('0x30'),'message':_0x15910f});}else{return request({'event':'outgoingmessage','message':_0x15910f});}})[_0xeb74('0x20')](function(_0x49fc21){logger[_0xeb74('0x1e')](_0xeb74('0x1d'),_0xeb74('0x31'),_0x49fc21);});};}function afterCreateOfflineMessage(_0x267d53){return function(_0x56c789){_0x56c789=_0x56c789[_0xeb74('0x21')]({'plain':!![]});_0x56c789[_0xeb74('0x22')]=_0x267d53;_0x56c789[_0xeb74('0x32')]=_0x267d53;_0x56c789[_0xeb74('0x23')]=_0xeb74('0x33');return request({'event':_0x56c789[_0xeb74('0x23')],'message':_0x56c789});};}function afterCreate(_0x10fdcd,_0xcd734e){return function(_0x1ef07c){_0x1ef07c=_0x1ef07c[_0xeb74('0x21')]({'plain':!![]});_0x1ef07c[_0xeb74('0x22')]=_0x10fdcd;_0x1ef07c[_0xeb74('0x32')]=_0x10fdcd;_0x1ef07c[_0xeb74('0x23')]=_0xeb74('0x34');Promise['resolve']()['then'](function(){var _0x566873='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ef07c[_0xeb74('0x26')];return db['sequelize'][_0xeb74('0x28')](_0x566873,{'type':db['Sequelize'][_0xeb74('0x35')][_0xeb74('0x29')],'raw':!![]});})[_0xeb74('0x1c')](function(_0x177904){if(_0x177904){_0x1ef07c[_0xeb74('0x2a')]=_0x177904[0x0];}if(typeof _0x1ef07c['UserId']===_0xeb74('0x36'))return;return getAgent(_0x1ef07c[_0xeb74('0x2b')]);})[_0xeb74('0x1c')](function(_0x1ca926){if(_0x1ca926){_0x1ef07c[_0xeb74('0x2c')]=util['format'](_0xeb74('0x2e'),_0x1ca926[_0xeb74('0x37')]);_0x1ef07c[_0xeb74('0x2f')]=_0x1ca926;}return request({'event':_0xcd734e,'message':_0x1ef07c});})[_0xeb74('0x20')](function(_0x297a99){logger[_0xeb74('0x1e')](_0xeb74('0x1d'),_0xeb74('0x38'),_0x297a99);});};}function afterUpdate(_0x1f3208){return function(_0x563ad2){var _0x292e10=_0x563ad2[_0xeb74('0x39')](_0xeb74('0x3a'))&&_0x563ad2[_0xeb74('0x3a')];var _0x140e85=_0x563ad2[_0xeb74('0x39')](_0xeb74('0x3b'));if(_0x292e10||_0x140e85){var _0x511774=_0x292e10?_0xeb74('0x6'):'substatus';var _0x2fa423=_0x563ad2['get']({'plain':!![]});_0x2fa423[_0xeb74('0x22')]=_0x1f3208;_0x2fa423[_0xeb74('0x32')]=_0x1f3208;_0x2fa423[_0xeb74('0x23')]=_0x292e10?_0xeb74('0x3a'):'substatus';var _0x4cb80e=_0xeb74('0x27')+_0x2fa423[_0xeb74('0x26')];return db[_0xeb74('0x3c')][_0xeb74('0x28')](_0x4cb80e,{'type':db[_0xeb74('0x3d')][_0xeb74('0x35')]['SELECT'],'raw':!![]})['then'](function(_0x2b6d7e){if(_0x2b6d7e){_0x2fa423[_0xeb74('0x2a')]=_0x2b6d7e[0x0];}if(typeof _0x2fa423[_0xeb74('0x2b')]===_0xeb74('0x36'))return;return getAgent(_0x2fa423[_0xeb74('0x2b')]);})['then'](function(_0x5dbbb3){if(_0x5dbbb3){_0x2fa423[_0xeb74('0x2c')]=util[_0xeb74('0x2d')](_0xeb74('0x2e'),_0x5dbbb3['name']);_0x2fa423[_0xeb74('0x2f')]=_0x5dbbb3;}return request({'event':_0x511774,'message':_0x2fa423});})[_0xeb74('0x20')](function(_0x458e3c){logger[_0xeb74('0x1e')](_0xeb74('0x1d'),'AfterUpdate',_0x458e3c);});}};}function getAgent(_0x28bd2a){return db['User'][_0xeb74('0x3e')]({'where':{'id':_0x28bd2a},'attributes':['id',_0xeb74('0x37'),_0xeb74('0x3f'),_0xeb74('0x40'),_0xeb74('0x41')],'raw':!![]})[_0xeb74('0x1c')](function(_0x176f78){return _0x176f78;});}exports[_0xeb74('0x42')]=function(){for(var _0x3d3b47=0x0;_0x3d3b47=_0x33ee27[_0xdea3('0x13')]){throw Error(_0xdea3('0x14'));}_0x59ab78(_0x12478e);})[_0xdea3('0x15')](function(_0x1680cc){_0x4560f2(_0x1680cc);});});}; \ No newline at end of file +var _0x3132=['toLowerCase','includes','isUndefined','updateAttributes','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','chat','fax','sms','openchannel','getChannels','isValidChannel'];(function(_0x20020c,_0x19cf99){var _0x2ced6f=function(_0x40de40){while(--_0x40de40){_0x20020c['push'](_0x20020c['shift']());}};_0x2ced6f(++_0x19cf99);}(_0x3132,0xf3));var _0x2313=function(_0x259cad,_0x3dae11){_0x259cad=_0x259cad-0x0;var _0x4e6a68=_0x3132[_0x259cad];return _0x4e6a68;};'use strict';var _=require(_0x2313('0x0'));var BPromise=require(_0x2313('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x2313('0x2'));var channels=['voice','mail',_0x2313('0x3'),_0x2313('0x4'),_0x2313('0x5'),'whatsapp',_0x2313('0x6')];exports[_0x2313('0x7')]=function(){return channels;};exports[_0x2313('0x8')]=function(_0x3b2a99){_0x3b2a99=_0x3b2a99[_0x2313('0x9')]();return _[_0x2313('0xa')](channels,_0x3b2a99);};exports['clearBlockUser']=function(_0xb7c0d1,_0x5d06ba,_0x38d3a9,_0x26b905){var _0x4d489e={'loginAttempts':_0x5d06ba,'blocked':_0x38d3a9};if(!_[_0x2313('0xb')](_0x26b905)){_0x4d489e['blockedAt']=_0x26b905;}return _0xb7c0d1[_0x2313('0xc')](_0x4d489e);};exports['getLicense']=function(_0x2ce6c4){return new BPromise(function(_0xa269dc,_0x43ffe0){var _0x294377=0x0;if(_0x2ce6c4['role']!=='agent'){_0xa269dc(_0x2ce6c4);}db['User'][_0x2313('0xd')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2ce6c4['id']}}})[_0x2313('0xe')](function(_0x4175a4){_0x294377=_0x4175a4;return util['getLicense']();})[_0x2313('0xe')](function(_0x4a911a){if(_0x4a911a&&_0x4a911a[_0x2313('0xf')]&&_0x294377>=_0x4a911a['agents']){throw Error(_0x2313('0x10'));}_0xa269dc(_0x2ce6c4);})[_0x2313('0x11')](function(_0x5022fd){_0x43ffe0(_0x5022fd);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index e4275b1..84b5f60 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x400c=['util','../config/logger','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Forbidden','Conflict','error','statusMessage','status','exports'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x400c,0x118));var _0xc400=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x400c[_0x3947c9];return _0x2e7871;};'use strict';var util=require(_0xc400('0x0'));var logger=require(_0xc400('0x1'))('api');var APIError=function(_0x40f663,_0xafa423){this['message']=_0x40f663||_0xc400('0x2');this[_0xc400('0x3')]=_0xafa423||_0xc400('0x4');util[_0xc400('0x5')](APIError,Error);};var APIBadRequestError=function(_0xdf45a8){this[_0xc400('0x6')]=_0xdf45a8||_0xc400('0x7');this['name']=_0xc400('0x7');util[_0xc400('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x2139ff){this[_0xc400('0x6')]=_0x2139ff||'Forbidden';this[_0xc400('0x3')]='Forbidden';util[_0xc400('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0xc442eb){this[_0xc400('0x6')]=_0xc442eb||'Entity\x20not\x20found';this['name']=_0xc400('0x8');util[_0xc400('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x578330){this[_0xc400('0x6')]=_0x578330||_0xc400('0x9');this['name']=_0xc400('0xa');this[_0xc400('0xb')]=0x193;this[_0xc400('0xc')]={'type':_0xc400('0xd')};util[_0xc400('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x2ed10c){this[_0xc400('0x6')]=_0x2ed10c||'Resource\x20Conflict';this[_0xc400('0x3')]='Conflict';util[_0xc400('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x27514c){switch(_0x27514c){case _0xc400('0x7'):return 0x190;case _0xc400('0xe'),_0xc400('0xa'):return 0x193;case _0xc400('0x8'):return 0x194;case _0xc400('0xf'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x5936b0){if(_0x5936b0===_0xc400('0xa'))return _0x5936b0;return null;}function handleError(_0x2de7ea){return function(_0x9a6fa5){logger[_0xc400('0x10')](_0x9a6fa5['stack']);var _0x42faf3=getStatusCode(_0x9a6fa5[_0xc400('0x3')]);var _0xfbe06=getCustomStatusMessage(_0x9a6fa5['name']);if(_0x9a6fa5['name']){delete _0x9a6fa5['name'];}if(_0xfbe06){_0x2de7ea[_0xc400('0x11')]=_0xfbe06;}return _0x2de7ea[_0xc400('0x12')](_0x42faf3)['send'](_0x9a6fa5);};}module[_0xc400('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xa3ec=['Conflict','error','stack','status','send','exports','util','../config/logger','api','name','Error','inherits','Bad\x20Request','message','Forbidden','Entity\x20not\x20found','Out\x20Of\x20Interval','code','OutOfInterval'];(function(_0x17477f,_0x2bf2ef){var _0xfbafaa=function(_0x3c1c42){while(--_0x3c1c42){_0x17477f['push'](_0x17477f['shift']());}};_0xfbafaa(++_0x2bf2ef);}(_0xa3ec,0x1a8));var _0xca3e=function(_0x13bee7,_0x4575d6){_0x13bee7=_0x13bee7-0x0;var _0x46ff8f=_0xa3ec[_0x13bee7];return _0x46ff8f;};'use strict';var util=require(_0xca3e('0x0'));var logger=require(_0xca3e('0x1'))(_0xca3e('0x2'));var APIError=function(_0x4254a8,_0x261d89){this['message']=_0x4254a8||'Internal\x20Server\x20Error';this[_0xca3e('0x3')]=_0x261d89||_0xca3e('0x4');util[_0xca3e('0x5')](APIError,Error);};var APIBadRequestError=function(_0x2eb0ff){this['message']=_0x2eb0ff||_0xca3e('0x6');this[_0xca3e('0x3')]='Bad\x20Request';util[_0xca3e('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x24ebd6){this[_0xca3e('0x7')]=_0x24ebd6||_0xca3e('0x8');this['name']='Forbidden';util[_0xca3e('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x364141){this[_0xca3e('0x7')]=_0x364141||_0xca3e('0x9');this[_0xca3e('0x3')]='Not\x20Found';util[_0xca3e('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x354f31){this['message']=_0x354f31||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0xca3e('0x3')]=_0xca3e('0xa');this[_0xca3e('0xb')]=0x193;this['details']={'type':_0xca3e('0xc')};util[_0xca3e('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x27248e){this[_0xca3e('0x7')]=_0x27248e||'Resource\x20Conflict';this['name']=_0xca3e('0xd');util[_0xca3e('0x5')](APIBadRequestError,APIError);};function getStatusCode(_0x4f44c1){switch(_0x4f44c1){case _0xca3e('0x6'):return 0x190;case _0xca3e('0x8'),_0xca3e('0xa'):return 0x193;case'Not\x20Found':return 0x194;case _0xca3e('0xd'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0xd9c87){if(_0xd9c87===_0xca3e('0xa'))return _0xd9c87;return null;}function handleError(_0x5cc048){return function(_0x1ed044){logger[_0xca3e('0xe')](_0x1ed044[_0xca3e('0xf')]);var _0xf079e0=getStatusCode(_0x1ed044[_0xca3e('0x3')]);var _0x1e8569=getCustomStatusMessage(_0x1ed044[_0xca3e('0x3')]);if(_0x1ed044['name']){delete _0x1ed044[_0xca3e('0x3')];}if(_0x1e8569){_0x5cc048['statusMessage']=_0x1e8569;}return _0x5cc048[_0xca3e('0x10')](_0xf079e0)[_0xca3e('0x11')](_0x1ed044);};}module[_0xca3e('0x12')]={'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 cd795cb..464d772 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb38=['json','send','exports','404','status','render'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xdb38,0x19a));var _0x8db3=function(_0x329227,_0x15d642){_0x329227=_0x329227-0x0;var _0x2920a0=_0xdb38[_0x329227];return _0x2920a0;};'use strict';module[_0x8db3('0x0')][0x194]=function pageNotFound(_0x3f1b81,_0x4bd782){var _0x3dc8cb=_0x8db3('0x1');var _0x46b86b=0x194;var _0x44db12={'status':_0x46b86b};_0x4bd782[_0x8db3('0x2')](_0x44db12[_0x8db3('0x2')]);_0x4bd782[_0x8db3('0x3')](_0x3dc8cb,{},function(_0x326053,_0x86efdd){if(_0x326053){return _0x4bd782[_0x8db3('0x2')](_0x44db12[_0x8db3('0x2')])[_0x8db3('0x4')](_0x44db12);}_0x4bd782[_0x8db3('0x5')](_0x86efdd);});}; \ No newline at end of file +var _0x5f90=['status','send','exports','404'];(function(_0x1f1573,_0x1b4e20){var _0x36cdee=function(_0x1b9dfd){while(--_0x1b9dfd){_0x1f1573['push'](_0x1f1573['shift']());}};_0x36cdee(++_0x1b4e20);}(_0x5f90,0xc6));var _0x05f9=function(_0x2a03ca,_0x49a992){_0x2a03ca=_0x2a03ca-0x0;var _0x4973e2=_0x5f90[_0x2a03ca];return _0x4973e2;};'use strict';module[_0x05f9('0x0')][0x194]=function pageNotFound(_0x11d81f,_0x369df5){var _0x57ab18=_0x05f9('0x1');var _0x94409b=0x194;var _0x4bd1a0={'status':_0x94409b};_0x369df5['status'](_0x4bd1a0[_0x05f9('0x2')]);_0x369df5['render'](_0x57ab18,{},function(_0x3e4303,_0x19a22d){if(_0x3e4303){return _0x369df5[_0x05f9('0x2')](_0x4bd1a0[_0x05f9('0x2')])['json'](_0x4bd1a0);}_0x369df5[_0x05f9('0x3')](_0x19a22d);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 22b96bb..eb3d1d3 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3946=['../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','Campaign','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','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','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','UserId','hasMany','VoiceRecording','Recordings','VoiceExtension','Extensions','cascade','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','CmHopper','Hoppers','SET\x20NULL','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','cm_user_has_lists','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','VoicePrefixes','MailQueues','ChatQueues','UserChatQueue','FaxQueues','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','ChatWebsite','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','JscriptySessions','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Teams','TeamVoiceQueue','BlackLists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Dispositions','CannedAnswer','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','Items','FaxAccountId','FaxApplication','Exntensions','FaxMessage','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','team_has_openchannel_queues','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','CmContactHasItem','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Automation','Condition','All','AutomationAllId','Any','OneAny','Actions','Intervals','MailApplications','FaxApplications','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','Fields','DefaultReportId','AnalyticMetric','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Subjects','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','Dynamics365Field','FreshsalesField','FromId','ToId','SessionId','ProjectId','JscriptyProject','user_has_teams','team_has_sms_queues','team_has_whatsapp_queues','HopperBlacks','TrunkBackupId','campaigns_has_cm_blacklists','ChatOfflineMessageId','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','Smtp','exports','sequelize','lodash','jstz','determine','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','127.0.0.1','password','database','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','VoiceMail','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x3946,0x1d0));var _0x6394=function(_0xc2779b,_0x506b63){_0xc2779b=_0xc2779b-0x0;var _0x43f072=_0x3946[_0xc2779b];return _0x43f072;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x6394('0x0'));var _=require(_0x6394('0x1'));var jstz=require(_0x6394('0x2'));var timezone=jstz[_0x6394('0x3')]();config[_0x6394('0x0')]=_['defaultsDeep'](config[_0x6394('0x0')],{'database':_0x6394('0x4'),'username':_0x6394('0x5'),'password':_0x6394('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x6394('0x7'),'dialectOptions':{'charset':_0x6394('0x8')},'logging':![],'timezone':timezone[_0x6394('0x9')](),'define':{'charset':_0x6394('0xa'),'collate':_0x6394('0xb')}}});config[_0x6394('0xc')]=_[_0x6394('0xd')](config[_0x6394('0xc')],{'database':'motion2','username':_0x6394('0x5'),'password':_0x6394('0x6'),'options':{'host':_0x6394('0xe'),'port':0xcea,'dialect':_0x6394('0x7'),'dialectOptions':{'charset':_0x6394('0x8')},'logging':![],'timezone':timezone[_0x6394('0x9')](),'define':{'charset':_0x6394('0xa'),'collate':_0x6394('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6394('0x0')]['database'],config[_0x6394('0x0')]['username'],config[_0x6394('0x0')][_0x6394('0xf')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6394('0xc')][_0x6394('0x10')],config['sequelizeHistory']['username'],config[_0x6394('0xc')][_0x6394('0xf')],config[_0x6394('0xc')]['options'])};db[_0x6394('0x11')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/user/user.model');db[_0x6394('0x13')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x14'));db[_0x6394('0x15')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x16'));db['VoiceExtension']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x17'));db[_0x6394('0x18')]=db['sequelize'][_0x6394('0x12')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x6394('0x19')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x1a'));db['VoiceRecording']=db[_0x6394('0x0')][_0x6394('0x12')]('../api/voiceRecording/voiceRecording.model');db[_0x6394('0x1b')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/screenRecording/screenRecording.model');db[_0x6394('0x1c')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/voiceMail/voiceMail.model');db[_0x6394('0x1d')]=db['sequelize'][_0x6394('0x12')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x6394('0x1e')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x1f'));db[_0x6394('0x20')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x21'));db['VoiceAgentReport']=db[_0x6394('0x0')][_0x6394('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x6394('0x22')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x23'));db[_0x6394('0x24')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x25'));db[_0x6394('0x26')]=db[_0x6394('0x0')]['import'](_0x6394('0x27'));db[_0x6394('0x28')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x29'));db['UserVoiceQueue']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x2a'));db['UserChatQueue']=db['sequelize'][_0x6394('0x12')]('../api/userChatQueue/userChatQueue.model');db[_0x6394('0x2b')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/userMailQueue/userMailQueue.model');db[_0x6394('0x2c')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x2d'));db['UserSmsQueue']=db['sequelize']['import'](_0x6394('0x2e'));db[_0x6394('0x2f')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x6394('0x30')]=db['sequelize']['import'](_0x6394('0x31'));db[_0x6394('0x32')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x33'));db[_0x6394('0x34')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x35'));db[_0x6394('0x36')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x37'));db[_0x6394('0x38')]=db[_0x6394('0x0')]['import'](_0x6394('0x39'));db['MailSubstatus']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x3a'));db[_0x6394('0x3b')]=db['sequelize']['import'](_0x6394('0x3c'));db[_0x6394('0x3d')]=db[_0x6394('0x0')]['import'](_0x6394('0x3e'));db[_0x6394('0x3f')]=db[_0x6394('0x0')]['import'](_0x6394('0x40'));db[_0x6394('0x41')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x42'));db[_0x6394('0x43')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x44'));db['DashboardItem']=db['sequelize'][_0x6394('0x12')](_0x6394('0x45'));db[_0x6394('0x46')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x47'));db['FaxApplication']=db['sequelize'][_0x6394('0x12')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x48'));db['FaxMessage']=db[_0x6394('0x0')]['import'](_0x6394('0x49'));db[_0x6394('0x4a')]=db['sequelize']['import'](_0x6394('0x4b'));db['FaxQueueReport']=db['sequelize']['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x6394('0x4c')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x4d'));db[_0x6394('0x4e')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/smsApplication/smsApplication.model');db[_0x6394('0x4f')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x50'));db[_0x6394('0x51')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x52'));db[_0x6394('0x53')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x54'));db[_0x6394('0x55')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0x6394('0x56')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x57'));db[_0x6394('0x58')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x59'));db[_0x6394('0x5a')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x5b'));db['OpenchannelQueue']=db['sequelize']['import']('../api/openchannelQueue/openchannelQueue.model');db['ChatWebsite']=db[_0x6394('0x0')]['import'](_0x6394('0x5c'));db['OpenchannelQueueReport']=db['sequelize'][_0x6394('0x12')](_0x6394('0x5d'));db[_0x6394('0x5e')]=db[_0x6394('0x0')]['import'](_0x6394('0x5f'));db['ChatInteraction']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x60'));db[_0x6394('0x61')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x62'));db['ChatOfflineMessage']=db[_0x6394('0x0')]['import'](_0x6394('0x63'));db[_0x6394('0x64')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x65'));db[_0x6394('0x66')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x67'));db[_0x6394('0x68')]=db[_0x6394('0x0')]['import'](_0x6394('0x69'));db[_0x6394('0x6a')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x6b'));db[_0x6394('0x6c')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x6394('0x0')]['import']('../api/cmHopper/cmHopper.model');db[_0x6394('0x6d')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x6e'));db[_0x6394('0x6f')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x70'));db[_0x6394('0x71')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x72'));db['ReportAgentPreview']=db[_0x6394('0x0')]['import'](_0x6394('0x73'));db[_0x6394('0x74')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x75'));db[_0x6394('0x76')]=db['sequelize']['import']('../api/action/action.model');db['Automation']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x77'));db['CannedAnswer']=db['sequelize'][_0x6394('0x12')]('../api/cannedAnswer/cannedAnswer.model');db[_0x6394('0x78')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x79'));db['Condition']=db[_0x6394('0x0')][_0x6394('0x12')]('../api/condition/condition.model');db[_0x6394('0x7a')]=db[_0x6394('0x0')]['import'](_0x6394('0x7b'));db[_0x6394('0x7c')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x7d'));db['Cdr']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x7e'));db['VoiceQueuesLog']=db['sequelize']['import'](_0x6394('0x7f'));db[_0x6394('0x80')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x81'));db[_0x6394('0x82')]=db[_0x6394('0x0')]['import'](_0x6394('0x83'));db[_0x6394('0x84')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/tag/tag.model');db[_0x6394('0x85')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x86'));db['CmContactHasItem']=db[_0x6394('0x0')]['import'](_0x6394('0x87'));db[_0x6394('0x88')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x89'));db[_0x6394('0x8a')]=db['sequelize']['import']('../api/template/template.model');db[_0x6394('0x8b')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x8c'));db[_0x6394('0x8d')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/variable/variable.model');db[_0x6394('0x8e')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/integration/integration.model');db[_0x6394('0x8f')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x90'));db[_0x6394('0x91')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x6394('0x92')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x93'));db[_0x6394('0x94')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db['sequelize']['import']('../api/analyticMetric/analyticMetric.model');db[_0x6394('0x95')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x96'));db['AnalyticTreeReport']=db[_0x6394('0x0')]['import'](_0x6394('0x97'));db[_0x6394('0x98')]=db[_0x6394('0x0')]['import'](_0x6394('0x99'));db[_0x6394('0x9a')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x9b'));db[_0x6394('0x9c')]=db['sequelize'][_0x6394('0x12')]('../api/intSalesforceField/intSalesforceField.model');db[_0x6394('0x9d')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x9e'));db[_0x6394('0x9f')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xa0'));db[_0x6394('0xa1')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x6394('0xa2')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xa3'));db['DeskConfiguration']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xa4'));db[_0x6394('0xa5')]=db[_0x6394('0x0')]['import'](_0x6394('0xa6'));db['ZohoAccount']=db['sequelize']['import'](_0x6394('0xa7'));db[_0x6394('0xa8')]=db[_0x6394('0x0')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x6394('0xa9')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/intZohoField/intZohoField.model');db[_0x6394('0xaa')]=db['sequelize'][_0x6394('0x12')](_0x6394('0xab'));db[_0x6394('0xac')]=db[_0x6394('0x0')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x6394('0xad')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/intZendeskField/intZendeskField.model');db[_0x6394('0xae')]=db[_0x6394('0x0')]['import'](_0x6394('0xaf'));db[_0x6394('0xb0')]=db['sequelize']['import'](_0x6394('0xb1'));db[_0x6394('0xb2')]=db['sequelize']['import'](_0x6394('0xb3'));db[_0x6394('0xb4')]=db['sequelize']['import'](_0x6394('0xb5'));db['VtigerConfiguration']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xb6'));db['VtigerField']=db[_0x6394('0x0')]['import'](_0x6394('0xb7'));db[_0x6394('0xb8')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xb9'));db[_0x6394('0xba')]=db[_0x6394('0x0')]['import'](_0x6394('0xbb'));db[_0x6394('0xbc')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xbd'));db[_0x6394('0xbe')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xbf'));db[_0x6394('0xc0')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xc1'));db['Dynamics365Field']=db['sequelize'][_0x6394('0x12')](_0x6394('0xc2'));db[_0x6394('0xc3')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xc4'));db[_0x6394('0xc5')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db['sequelize'][_0x6394('0x12')](_0x6394('0xc6'));db[_0x6394('0x8e')]=db[_0x6394('0x0')]['import'](_0x6394('0xc7'));db[_0x6394('0xc8')]=db[_0x6394('0x0')]['import'](_0x6394('0xc9'));db[_0x6394('0xca')]=db[_0x6394('0x0')]['import'](_0x6394('0xcb'));db[_0x6394('0xcc')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xcd'));db[_0x6394('0xce')]=db[_0x6394('0x0')]['import'](_0x6394('0xcf'));db[_0x6394('0xd0')]=db[_0x6394('0x0')]['import'](_0x6394('0xd1'));db[_0x6394('0xd2')]=db[_0x6394('0x0')]['import'](_0x6394('0xd3'));db[_0x6394('0xd4')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xd5'));db[_0x6394('0xd6')]=db[_0x6394('0x0')]['import']('../api/squareReport/squareReport.model');db[_0x6394('0xd7')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db[_0x6394('0x0')]['import'](_0x6394('0xd8'));db['Setting']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xd9'));db['SquareOdbc']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xda'));db[_0x6394('0xdb')]=db['sequelize'][_0x6394('0x12')](_0x6394('0xdc'));db['SquareRecording']=db[_0x6394('0x0')]['import'](_0x6394('0xdd'));db['SquareMessage']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xde'));db[_0x6394('0xdf')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/team/team.model');db[_0x6394('0xe0')]=db['sequelize'][_0x6394('0x12')]('../api/license/license.model');db[_0x6394('0xe1')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/campaign/campaign.model');db['Migration']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xe2'));db[_0x6394('0xe3')]=db['sequelize'][_0x6394('0x12')](_0x6394('0xe4'));db[_0x6394('0xe5')]=db[_0x6394('0x0')]['import'](_0x6394('0xe6'));db[_0x6394('0xe7')]=db['sequelize']['import'](_0x6394('0xe8'));db[_0x6394('0xe9')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xea'));db[_0x6394('0xeb')]=db[_0x6394('0x0')]['import'](_0x6394('0xec'));db['OpenchannelTransferReport']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xed'));db[_0x6394('0xee')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xef'));db[_0x6394('0xf0')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xf1'));db[_0x6394('0xf2')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xf3'));db[_0x6394('0xf4')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xf5'));db[_0x6394('0xf6')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xf7'));db[_0x6394('0xf8')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xf9'));db[_0x6394('0xfa')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xfb'));db[_0x6394('0xfc')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xfd'));db[_0x6394('0xfe')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0xff'));db[_0x6394('0x100')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x101'));db[_0x6394('0x102')]=db['sequelize']['import'](_0x6394('0x103'));db[_0x6394('0x104')]=db[_0x6394('0x0')]['import'](_0x6394('0x105'));db[_0x6394('0x106')]=db['sequelize'][_0x6394('0x12')](_0x6394('0x107'));db[_0x6394('0x108')]=db[_0x6394('0x0')]['import'](_0x6394('0x109'));db[_0x6394('0x10a')]=db['sequelize'][_0x6394('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x10b'));db[_0x6394('0x10c')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x10d'));db[_0x6394('0x10e')]=db['sequelize'][_0x6394('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x6394('0x10f')]=db[_0x6394('0x0')][_0x6394('0x12')]('../api/user-setting/user-setting.model');db[_0x6394('0x110')]=db[_0x6394('0x0')][_0x6394('0x12')](_0x6394('0x111'));db[_0x6394('0x11')][_0x6394('0x112')](db[_0x6394('0x1c')],{'as':_0x6394('0x1c'),'onDelete':'cascade','foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x112')](db[_0x6394('0x10f')],{'as':'userSetting','onDelete':'cascade','foreignKey':'UserId'});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x115')],{'as':_0x6394('0x116'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x28')],{'as':'VoiceQueuesRt','foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x117')],{'as':_0x6394('0x118'),'onDelete':_0x6394('0x119'),'hooks':!![]});db['User'][_0x6394('0x114')](db[_0x6394('0x6f')],{'as':_0x6394('0x11a'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x71')],{'as':_0x6394('0x11b'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db['ReportAgentPreview'],{'as':_0x6394('0x11c'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x58')],{'as':_0x6394('0x11d'),'foreignKey':_0x6394('0x113')});db['User'][_0x6394('0x114')](db[_0x6394('0x11e')],{'as':'ChatInteractions','foreignKey':_0x6394('0x113')});db['User'][_0x6394('0x114')](db['SmsInteraction'],{'as':_0x6394('0x11f'),'foreignKey':'UserId'});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x120')],{'as':_0x6394('0x121'),'foreignKey':'UserId'});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0x3b')],{'as':_0x6394('0x122'),'foreignKey':'UserId'});db[_0x6394('0x11')][_0x6394('0x114')](db['WhatsappInteraction'],{'as':_0x6394('0x123'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11')][_0x6394('0x114')](db[_0x6394('0xfa')],{'as':_0x6394('0x124'),'foreignKey':_0x6394('0x125')});db[_0x6394('0x11')]['hasMany'](db[_0x6394('0x126')],{'as':_0x6394('0x127'),'foreignKey':_0x6394('0x113'),'onDelete':_0x6394('0x128')});db[_0x6394('0x11')][_0x6394('0x129')](db[_0x6394('0xf4')],{'as':'UserProfile','foreignKey':_0x6394('0x12a')});db[_0x6394('0x11')]['belongsToMany'](db[_0x6394('0x66')],{'as':_0x6394('0x12b'),'through':_0x6394('0x12c')});db[_0x6394('0x11')][_0x6394('0x12d')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db['User']['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x6394('0x12e')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0xdf')],{'through':'user_has_teams'});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x3b')],{'as':_0x6394('0x122'),'through':'user_has_mail_interactions'});db[_0x6394('0x11')]['belongsToMany'](db['ChatInteraction'],{'as':_0x6394('0x12f'),'through':_0x6394('0x130')});db[_0x6394('0x11')]['belongsToMany'](db['FaxInteraction'],{'as':_0x6394('0x121'),'through':_0x6394('0x131')});db['User'][_0x6394('0x12d')](db['SmsInteraction'],{'as':_0x6394('0x11f'),'through':_0x6394('0x132')});db[_0x6394('0x11')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x6394('0x11d'),'through':'user_has_openchannel_interactions'});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x100')],{'as':_0x6394('0x123'),'through':_0x6394('0x133')});db[_0x6394('0x11')][_0x6394('0x12d')](db['VoiceQueue'],{'as':_0x6394('0x134'),'through':_0x6394('0x135'),'required':![]});db[_0x6394('0x11')][_0x6394('0x12d')](db['VoicePrefix'],{'as':_0x6394('0x136'),'through':_0x6394('0x10e'),'required':![]});db['User'][_0x6394('0x12d')](db[_0x6394('0x38')],{'as':_0x6394('0x137'),'through':_0x6394('0x2b'),'required':![]});db[_0x6394('0x11')]['belongsToMany'](db[_0x6394('0x64')],{'as':_0x6394('0x138'),'through':_0x6394('0x139'),'required':![],'hooks':!![]});db['User'][_0x6394('0x12d')](db[_0x6394('0x4a')],{'as':_0x6394('0x13a'),'through':_0x6394('0x2c'),'required':![]});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x53')],{'as':_0x6394('0x13b'),'through':'UserSmsQueue','required':![]});db['User'][_0x6394('0x12d')](db[_0x6394('0x13c')],{'as':_0x6394('0x13d'),'through':_0x6394('0x2f'),'required':![]});db[_0x6394('0x11')]['belongsToMany'](db[_0x6394('0x108')],{'as':_0x6394('0x13e'),'through':_0x6394('0x30'),'required':![]});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0xf0')],{'through':_0x6394('0x12e')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x13f')],{'as':'ChatWebsites','through':_0x6394('0x140')});db['User'][_0x6394('0x12d')](db[_0x6394('0x46')],{'as':'FaxAccounts','through':_0x6394('0x141')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x36')],{'as':_0x6394('0x142'),'through':_0x6394('0x143')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x55')],{'as':'OpenchannelAccounts','through':_0x6394('0x144')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0x4c')],{'as':_0x6394('0x145'),'through':_0x6394('0x146')});db[_0x6394('0x11')][_0x6394('0x12d')](db[_0x6394('0xfc')],{'as':_0x6394('0x147'),'through':_0x6394('0x148')});db[_0x6394('0x13')]['hasMany'](db['VoiceExtension'],{'as':_0x6394('0x149'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x14a')});db[_0x6394('0x15')][_0x6394('0x114')](db[_0x6394('0x117')],{'onDelete':_0x6394('0x119')});db['VoiceExtension']['hasMany'](db[_0x6394('0x117')],{'as':_0x6394('0x14b'),'onDelete':'cascade'});db[_0x6394('0x18')][_0x6394('0x12d')](db[_0x6394('0x82')],{'as':_0x6394('0x14c'),'through':_0x6394('0x14d')});db['VoiceQueue'][_0x6394('0x114')](db[_0x6394('0x28')],{'as':_0x6394('0x14e'),'foreignKey':_0x6394('0x14f')});db[_0x6394('0x19')][_0x6394('0x114')](db[_0x6394('0x126')],{'as':_0x6394('0x127'),'foreignKey':_0x6394('0x14f')});db[_0x6394('0x19')][_0x6394('0x114')](db[_0x6394('0x6f')],{'as':_0x6394('0x11a'),'foreignKey':_0x6394('0x14f')});db['VoiceQueue'][_0x6394('0x114')](db[_0x6394('0x71')],{'as':_0x6394('0x150'),'foreignKey':_0x6394('0x14f')});db[_0x6394('0x19')][_0x6394('0x114')](db[_0x6394('0x11c')],{'as':_0x6394('0x11c'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x6394('0x114')](db[_0x6394('0x6d')],{'as':'HopperBlacks','foreignKey':'VoiceQueueId'});db[_0x6394('0x19')][_0x6394('0x114')](db['JscriptySessionReport'],{'as':_0x6394('0x151'),'foreignKey':_0x6394('0x14f')});db[_0x6394('0x19')]['belongsTo'](db[_0x6394('0x24')],{'as':_0x6394('0x24'),'foreignKey':_0x6394('0x152')});db[_0x6394('0x19')][_0x6394('0x129')](db[_0x6394('0x24')],{'as':_0x6394('0x153'),'foreignKey':'TrunkBackupId'});db[_0x6394('0x19')]['belongsTo'](db[_0x6394('0x7a')],{'as':_0x6394('0x7a'),'foreignKey':_0x6394('0x154')});db[_0x6394('0x19')][_0x6394('0x129')](db[_0x6394('0x7c')],{'as':_0x6394('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6394('0x19')]['belongsToMany'](db[_0x6394('0xf0')],{'as':_0x6394('0x156'),'through':_0x6394('0x157')});db[_0x6394('0x19')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':'Agents','through':_0x6394('0x135')});db[_0x6394('0x19')]['belongsToMany'](db[_0x6394('0xdf')],{'as':_0x6394('0x158'),'through':_0x6394('0x159')});db[_0x6394('0x19')][_0x6394('0x12d')](db[_0x6394('0xf0')],{'as':_0x6394('0x15a'),'through':'voice_queues_has_cm_blacklists'});db[_0x6394('0x115')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x11'),'foreignKey':'UserId'});db[_0x6394('0x1b')][_0x6394('0x129')](db['User'],{'as':'User','foreignKey':_0x6394('0x113')});db['VoiceMail']['hasMany'](db[_0x6394('0x1d')],{'as':_0x6394('0x15b'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x15c'),'sourceKey':_0x6394('0x15d')});db[_0x6394('0x1d')][_0x6394('0x129')](db['VoiceMail'],{'foreignKey':_0x6394('0x15c'),'targetKey':_0x6394('0x15d')});db[_0x6394('0x1e')]['hasMany'](db[_0x6394('0x22')],{'as':_0x6394('0x15e'),'foreignKey':_0x6394('0x15f'),'constraints':![]});db[_0x6394('0x1e')][_0x6394('0x114')](db['VoiceAgentReport'],{'as':_0x6394('0x160'),'foreignKey':_0x6394('0x15f'),'constraints':![]});db[_0x6394('0x1e')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x11'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x1e')][_0x6394('0x129')](db['CmContact'],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x32')][_0x6394('0x129')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x6394('0x163')});db[_0x6394('0x32')][_0x6394('0x129')](db[_0x6394('0x10a')],{'as':'CloudProvider','foreignKey':_0x6394('0x164'),'onDelete':'restrict'});db['MailServerOut'][_0x6394('0x129')](db[_0x6394('0x36')],{'as':_0x6394('0x36'),'foreignKey':_0x6394('0x163')});db['MailServerOut'][_0x6394('0x129')](db['CloudProvider'],{'as':_0x6394('0x10a'),'foreignKey':_0x6394('0x164'),'onDelete':_0x6394('0x165')});db['MailAccount']['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0x6394('0x119')});db[_0x6394('0x36')][_0x6394('0x112')](db[_0x6394('0x34')],{'as':'Smtp','onDelete':_0x6394('0x119')});db[_0x6394('0x36')][_0x6394('0x114')](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':_0x6394('0x163'),'onDelete':_0x6394('0x119')});db[_0x6394('0x36')]['hasMany'](db[_0x6394('0x167')],{'as':_0x6394('0x168'),'foreignKey':'MailAccountId'});db[_0x6394('0x36')][_0x6394('0x114')](db[_0x6394('0x3d')],{'as':_0x6394('0x15b'),'foreignKey':_0x6394('0x163')});db[_0x6394('0x36')][_0x6394('0x114')](db[_0x6394('0x3b')],{'as':_0x6394('0x169')});db[_0x6394('0x36')]['hasMany'](db['MailApplication'],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x163'),'onDelete':_0x6394('0x119')});db[_0x6394('0x36')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0x36')][_0x6394('0x129')](db[_0x6394('0x8a')],{'as':_0x6394('0x8a'),'foreignKey':_0x6394('0x16c')});db[_0x6394('0x36')][_0x6394('0x129')](db[_0x6394('0x7c')],{'as':_0x6394('0x155'),'foreignKey':_0x6394('0x16d')});db[_0x6394('0x36')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x143')});db['MailQueue'][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x2b')});db['MailQueue'][_0x6394('0x12d')](db[_0x6394('0xdf')],{'through':_0x6394('0x16f'),'as':_0x6394('0x158')});db['MailInteraction']['hasMany'](db[_0x6394('0x3d')],{'as':_0x6394('0x15b'),'onDelete':'cascade','foreignKey':_0x6394('0x170')});db[_0x6394('0x3b')]['belongsTo'](db[_0x6394('0x36')],{'as':_0x6394('0x171'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x3b')][_0x6394('0x129')](db['User'],{'as':'Owner','foreignKey':_0x6394('0x113')});db[_0x6394('0x3b')]['belongsToMany'](db[_0x6394('0x84')],{'through':_0x6394('0x172'),'as':_0x6394('0x173')});db[_0x6394('0x3b')]['belongsToMany'](db['Tag'],{'through':_0x6394('0x172'),'as':_0x6394('0x174')});db[_0x6394('0x3b')]['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x175'),'through':_0x6394('0x176'),'foreignKey':'MailInteractionId'});db[_0x6394('0x3d')]['hasMany'](db[_0x6394('0xe3')],{'as':_0x6394('0x177'),'onDelete':'cascade'});db[_0x6394('0x3d')]['belongsTo'](db[_0x6394('0x11')],{'as':_0x6394('0x11')});db['MailMessage']['belongsTo'](db[_0x6394('0x6c')],{'onDelete':'cascade','as':_0x6394('0x161')});db['MailMessage'][_0x6394('0x129')](db[_0x6394('0x3b')],{'as':_0x6394('0x178'),'foreignKey':_0x6394('0x170')});db['MailMessage'][_0x6394('0x129')](db[_0x6394('0x36')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x163')});db['MailMessage'][_0x6394('0x129')](db['ChatWebsite'],{'as':_0x6394('0x13f'),'foreignKey':_0x6394('0x179')});db['MailMessage'][_0x6394('0x129')](db[_0x6394('0x17a')],{'as':_0x6394('0x17a'),'foreignKey':'ChatOfflineMessageId'});db[_0x6394('0x3f')]['belongsTo'](db[_0x6394('0x11')],{'onDelete':_0x6394('0x165')});db[_0x6394('0x3f')][_0x6394('0x129')](db[_0x6394('0x38')],{'onDelete':_0x6394('0x165')});db[_0x6394('0x3f')][_0x6394('0x129')](db[_0x6394('0x36')],{'onDelete':_0x6394('0x165')});db[_0x6394('0x3f')]['belongsTo'](db[_0x6394('0x7a')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x154')});db['MailApplication'][_0x6394('0x129')](db[_0x6394('0x84')],{'onDelete':_0x6394('0x165'),'foreignKey':'TagId'});db[_0x6394('0x41')][_0x6394('0x129')](db[_0x6394('0x36')],{});db['MailQueueReport'][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db['MailQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport']['belongsTo'](db[_0x6394('0x3b')],{});db[_0x6394('0x41')][_0x6394('0x129')](db[_0x6394('0x3d')],{});db[_0x6394('0x41')][_0x6394('0x129')](db['User'],{});db[_0x6394('0x41')]['belongsTo'](db[_0x6394('0x38')],{});db[_0x6394('0x43')][_0x6394('0x114')](db['DashboardItem'],{'as':_0x6394('0x17b'),'onDelete':_0x6394('0x119')});db[_0x6394('0x46')][_0x6394('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x6394('0x17c'),'onDelete':_0x6394('0x119')});db[_0x6394('0x46')][_0x6394('0x114')](db['CannedAnswer'],{'as':_0x6394('0x168'),'foreignKey':_0x6394('0x17c')});db[_0x6394('0x46')][_0x6394('0x114')](db[_0x6394('0x120')],{'as':_0x6394('0x169')});db[_0x6394('0x46')][_0x6394('0x114')](db[_0x6394('0x17d')],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x17c'),'onDelete':_0x6394('0x119')});db[_0x6394('0x46')][_0x6394('0x114')](db['VoiceExtension'],{'as':_0x6394('0x17e'),'onDelete':'cascade'});db[_0x6394('0x46')][_0x6394('0x114')](db[_0x6394('0x17f')],{'as':_0x6394('0x15b')});db[_0x6394('0x46')][_0x6394('0x129')](db[_0x6394('0x24')],{'as':_0x6394('0x24')});db['FaxAccount'][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0x46')]['belongsTo'](db['Pause'],{'as':_0x6394('0x155'),'foreignKey':_0x6394('0x16d')});db[_0x6394('0x46')]['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x141')});db[_0x6394('0x17d')][_0x6394('0x129')](db['User'],{'onDelete':'restrict'});db[_0x6394('0x17d')]['belongsTo'](db[_0x6394('0x4a')],{'onDelete':_0x6394('0x165')});db[_0x6394('0x17d')]['belongsTo'](db['FaxAccount'],{'onDelete':_0x6394('0x165')});db[_0x6394('0x17d')][_0x6394('0x129')](db[_0x6394('0x84')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x180')});db[_0x6394('0x120')][_0x6394('0x114')](db[_0x6394('0x17f')],{'as':_0x6394('0x15b'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x181')});db[_0x6394('0x120')][_0x6394('0x129')](db[_0x6394('0x46')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x17c')});db[_0x6394('0x120')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x120')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x120')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x6394('0x120')]['belongsToMany'](db[_0x6394('0x84')],{'through':_0x6394('0x183'),'as':_0x6394('0x174')});db[_0x6394('0x120')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':'Users','through':_0x6394('0x131'),'foreignKey':_0x6394('0x181')});db[_0x6394('0x17f')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x11')});db['FaxMessage'][_0x6394('0x129')](db['FaxInteraction'],{'as':_0x6394('0x178'),'foreignKey':_0x6394('0x181')});db[_0x6394('0x17f')]['belongsTo'](db[_0x6394('0x6c')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x161')});db[_0x6394('0x17f')][_0x6394('0x129')](db['Attachment'],{'as':'Attachment','foreignKey':_0x6394('0x184')});db[_0x6394('0x17f')][_0x6394('0x129')](db[_0x6394('0x46')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x17c')});db['FaxQueue']['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x2c')});db['FaxQueue'][_0x6394('0x12d')](db['Team'],{'through':_0x6394('0x185'),'as':'Teams'});db[_0x6394('0x186')]['belongsTo'](db['FaxAccount'],{});db['FaxQueueReport'][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0x186')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db['FaxQueueReport'][_0x6394('0x129')](db[_0x6394('0x120')],{});db['FaxQueueReport'][_0x6394('0x129')](db[_0x6394('0x17f')],{});db[_0x6394('0x186')][_0x6394('0x129')](db[_0x6394('0x11')],{});db[_0x6394('0x186')][_0x6394('0x129')](db['FaxQueue'],{});db[_0x6394('0x4c')]['hasMany'](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0x6394('0x4c')][_0x6394('0x114')](db[_0x6394('0x167')],{'as':'Answers','foreignKey':_0x6394('0x187')});db['SmsAccount'][_0x6394('0x114')](db['SmsMessage'],{'as':_0x6394('0x15b'),'foreignKey':_0x6394('0x187')});db[_0x6394('0x4c')][_0x6394('0x114')](db[_0x6394('0x4f')],{'as':_0x6394('0x169')});db[_0x6394('0x4c')][_0x6394('0x114')](db['SmsApplication'],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x187'),'onDelete':'cascade'});db[_0x6394('0x4c')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':'List','foreignKey':'ListId'});db['SmsAccount'][_0x6394('0x129')](db[_0x6394('0x7c')],{'as':_0x6394('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x6394('0x12d')](db['User'],{'as':_0x6394('0x16e'),'through':_0x6394('0x146')});db[_0x6394('0x4e')]['belongsTo'](db[_0x6394('0x11')],{'onDelete':'restrict'});db[_0x6394('0x4e')][_0x6394('0x129')](db['SmsQueue'],{'onDelete':_0x6394('0x165')});db[_0x6394('0x4e')][_0x6394('0x129')](db[_0x6394('0x4c')],{'onDelete':_0x6394('0x165')});db[_0x6394('0x4e')][_0x6394('0x129')](db[_0x6394('0x7a')],{'onDelete':_0x6394('0x165'),'foreignKey':'IntervalId'});db[_0x6394('0x4e')][_0x6394('0x129')](db['Tag'],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x180')});db[_0x6394('0x4f')][_0x6394('0x114')](db[_0x6394('0x51')],{'as':_0x6394('0x15b'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x188')});db[_0x6394('0x4f')][_0x6394('0x129')](db['SmsAccount'],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x187')});db[_0x6394('0x4f')]['belongsTo'](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x4f')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x4f')][_0x6394('0x12d')](db['Tag'],{'through':_0x6394('0x189'),'as':_0x6394('0x173')});db[_0x6394('0x4f')][_0x6394('0x12d')](db['Tag'],{'through':'sms_interaction_has_tags','as':_0x6394('0x174')});db[_0x6394('0x4f')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x175'),'through':_0x6394('0x132'),'foreignKey':_0x6394('0x188')});db[_0x6394('0x51')][_0x6394('0x129')](db['User'],{'as':_0x6394('0x11')});db[_0x6394('0x51')][_0x6394('0x129')](db[_0x6394('0x6c')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x161')});db[_0x6394('0x51')][_0x6394('0x129')](db['SmsInteraction'],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x178'),'foreignKey':'SmsInteractionId'});db[_0x6394('0x51')][_0x6394('0x129')](db[_0x6394('0x4c')],{'as':'Account','foreignKey':_0x6394('0x187')});db['SmsQueue']['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x18a'),'foreignKey':_0x6394('0x18b')});db[_0x6394('0x53')][_0x6394('0x12d')](db[_0x6394('0xdf')],{'through':'team_has_sms_queues','as':_0x6394('0x158')});db['OpenchannelAccount'][_0x6394('0x114')](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':_0x6394('0x18c'),'onDelete':_0x6394('0x119')});db['OpenchannelAccount'][_0x6394('0x114')](db[_0x6394('0x167')],{'as':_0x6394('0x168'),'foreignKey':'OpenchannelAccountId'});db[_0x6394('0x55')][_0x6394('0x114')](db[_0x6394('0x58')],{'as':_0x6394('0x169'),'foreignKey':_0x6394('0x18c')});db[_0x6394('0x55')]['hasMany'](db[_0x6394('0x5a')],{'as':'Messages','foreignKey':_0x6394('0x18c')});db[_0x6394('0x55')]['hasMany'](db[_0x6394('0x56')],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x18c'),'onDelete':_0x6394('0x119')});db[_0x6394('0x55')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':'List','foreignKey':'ListId'});db[_0x6394('0x55')]['belongsTo'](db['Pause'],{'as':_0x6394('0x155'),'foreignKey':_0x6394('0x16d')});db[_0x6394('0x55')][_0x6394('0x12d')](db['User'],{'as':'Agents','through':'user_has_openchannel_accounts'});db['OpenchannelApplication']['belongsTo'](db[_0x6394('0x11')],{'onDelete':_0x6394('0x165')});db['OpenchannelApplication'][_0x6394('0x129')](db['OpenchannelQueue'],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x18d')});db['OpenchannelApplication'][_0x6394('0x129')](db[_0x6394('0x55')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x18c')});db['OpenchannelApplication'][_0x6394('0x129')](db[_0x6394('0x7a')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x154')});db['OpenchannelApplication'][_0x6394('0x129')](db[_0x6394('0x84')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x180')});db[_0x6394('0x58')][_0x6394('0x114')](db['OpenchannelMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x6394('0x58')][_0x6394('0x129')](db[_0x6394('0x55')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0x6394('0x58')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':'ContactId'});db[_0x6394('0x58')]['belongsTo'](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x58')][_0x6394('0x12d')](db['Tag'],{'through':_0x6394('0x18e'),'as':_0x6394('0x173')});db[_0x6394('0x58')]['belongsToMany'](db[_0x6394('0x84')],{'through':_0x6394('0x18e'),'as':_0x6394('0x174')});db['OpenchannelInteraction'][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x175'),'through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x6394('0x5a')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':'cascade','as':_0x6394('0x11')});db['OpenchannelMessage'][_0x6394('0x129')](db[_0x6394('0x6c')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x161')});db[_0x6394('0x5a')][_0x6394('0x129')](db[_0x6394('0x58')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x178'),'foreignKey':'OpenchannelInteractionId'});db[_0x6394('0x5a')][_0x6394('0x129')](db['Attachment'],{'as':_0x6394('0xe3'),'foreignKey':_0x6394('0x184')});db[_0x6394('0x5a')]['belongsTo'](db[_0x6394('0x55')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x18c')});db[_0x6394('0x13c')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x2f'),'foreignKey':'OpenchannelQueueId'});db[_0x6394('0x13c')][_0x6394('0x12d')](db[_0x6394('0xdf')],{'through':_0x6394('0x18f'),'as':_0x6394('0x158')});db[_0x6394('0x13f')]['hasMany'](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':'ChatWebsiteId','onDelete':_0x6394('0x119')});db['ChatWebsite'][_0x6394('0x114')](db[_0x6394('0x167')],{'as':_0x6394('0x168'),'foreignKey':_0x6394('0x179')});db['ChatWebsite'][_0x6394('0x114')](db[_0x6394('0x68')],{'as':'ProactiveActions'});db['ChatWebsite'][_0x6394('0x114')](db['ChatInteraction'],{'as':_0x6394('0x169')});db[_0x6394('0x13f')][_0x6394('0x114')](db[_0x6394('0x5e')],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x179'),'onDelete':_0x6394('0x119')});db['ChatWebsite'][_0x6394('0x114')](db[_0x6394('0x61')],{'as':_0x6394('0x15b')});db[_0x6394('0x13f')]['belongsTo'](db[_0x6394('0xf0')],{'as':'List','foreignKey':'ListId'});db[_0x6394('0x13f')][_0x6394('0x129')](db[_0x6394('0x7a')],{'as':'Interval','foreignKey':_0x6394('0x154')});db[_0x6394('0x13f')]['belongsTo'](db[_0x6394('0x36')],{'as':_0x6394('0x36'),'foreignKey':'MailAccountId'});db[_0x6394('0x13f')][_0x6394('0x129')](db[_0x6394('0x7c')],{'as':_0x6394('0x155'),'foreignKey':_0x6394('0x16d')});db[_0x6394('0x13f')]['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x140')});db[_0x6394('0x190')][_0x6394('0x129')](db[_0x6394('0x55')],{});db[_0x6394('0x190')][_0x6394('0x129')](db['CmList'],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0x190')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db['OpenchannelQueueReport'][_0x6394('0x129')](db[_0x6394('0x58')],{});db[_0x6394('0x190')]['belongsTo'](db[_0x6394('0x5a')],{});db[_0x6394('0x190')]['belongsTo'](db['User'],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0x6394('0x5e')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x191'),'foreignKey':_0x6394('0x113'),'onDelete':_0x6394('0x165')});db[_0x6394('0x5e')][_0x6394('0x129')](db[_0x6394('0x64')],{'as':_0x6394('0x192'),'foreignKey':'ChatQueueId','onDelete':_0x6394('0x165')});db[_0x6394('0x5e')]['belongsTo'](db[_0x6394('0x13f')],{'as':_0x6394('0x193'),'foreignKey':_0x6394('0x179'),'onDelete':_0x6394('0x165')});db[_0x6394('0x5e')]['belongsTo'](db[_0x6394('0x84')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x180')});db[_0x6394('0x11e')][_0x6394('0x114')](db[_0x6394('0x61')],{'as':_0x6394('0x15b'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x194')});db['ChatInteraction'][_0x6394('0x129')](db[_0x6394('0x13f')],{'as':_0x6394('0x171'),'foreignKey':'ChatWebsiteId'});db[_0x6394('0x11e')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':'ContactId'});db[_0x6394('0x11e')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x11e')][_0x6394('0x12d')](db[_0x6394('0x84')],{'through':_0x6394('0x195'),'as':_0x6394('0x173')});db[_0x6394('0x11e')][_0x6394('0x12d')](db[_0x6394('0x84')],{'through':_0x6394('0x195'),'as':_0x6394('0x174')});db[_0x6394('0x11e')]['belongsToMany'](db['User'],{'as':_0x6394('0x175'),'through':_0x6394('0x130'),'foreignKey':_0x6394('0x194')});db[_0x6394('0x61')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x11')});db[_0x6394('0x61')][_0x6394('0x129')](db[_0x6394('0x6c')],{'onDelete':_0x6394('0x119'),'as':'Contact','foreignKey':'ContactId'});db['ChatMessage'][_0x6394('0x129')](db[_0x6394('0x11e')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x178'),'foreignKey':_0x6394('0x194')});db[_0x6394('0x61')][_0x6394('0x129')](db[_0x6394('0xe3')],{'as':'Attachment','foreignKey':_0x6394('0x184')});db[_0x6394('0x61')][_0x6394('0x129')](db[_0x6394('0x13f')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x179')});db[_0x6394('0x17a')][_0x6394('0x114')](db[_0x6394('0xe3')],{'as':_0x6394('0x177'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x6394('0x119'),'hooks':!![]});db[_0x6394('0x17a')][_0x6394('0x129')](db[_0x6394('0x6c')],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x17a')][_0x6394('0x129')](db['ChatWebsite'],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x179')});db[_0x6394('0x64')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':'Agents','through':_0x6394('0x139'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x6394('0xdf')],{'through':_0x6394('0x196'),'as':_0x6394('0x158')});db[_0x6394('0x66')][_0x6394('0x114')](db[_0x6394('0xcc')],{'as':_0x6394('0x15b'),'foreignKey':_0x6394('0x197'),'onDelete':_0x6394('0x119')});db[_0x6394('0x66')][_0x6394('0x12d')](db['User'],{'as':_0x6394('0x14e'),'through':'chat_group_has_users'});db[_0x6394('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0x6394('0x193'),'foreignKey':_0x6394('0x179')});db[_0x6394('0x6a')][_0x6394('0x114')](db['CmContact'],{'as':_0x6394('0x198'),'foreignKey':_0x6394('0x199')});db[_0x6394('0x6c')][_0x6394('0x114')](db[_0x6394('0x19a')],{'as':_0x6394('0x19b'),'foreignKey':_0x6394('0x19c')});db['CmContact'][_0x6394('0x114')](db[_0x6394('0x126')],{'as':_0x6394('0x127'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x6c')][_0x6394('0x114')](db['CmHopperFinal'],{'as':_0x6394('0x11a'),'foreignKey':'ContactId'});db['CmContact'][_0x6394('0x114')](db['CmHopperHistory'],{'as':_0x6394('0x150'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x6c')][_0x6394('0x114')](db[_0x6394('0x11c')],{'as':_0x6394('0x11c'),'foreignKey':'ContactId'});db['CmContact'][_0x6394('0x114')](db[_0x6394('0xd2')],{'as':_0x6394('0x151'),'foreignKey':_0x6394('0x162')});db[_0x6394('0x6c')][_0x6394('0x114')](db['OpenchannelInteraction'],{'as':_0x6394('0x11d'),'foreignKey':_0x6394('0x162'),'onDelete':_0x6394('0x165')});db[_0x6394('0x6c')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x6394('0x162'),'onDelete':_0x6394('0x165')});db[_0x6394('0x6c')][_0x6394('0x114')](db[_0x6394('0x4f')],{'as':_0x6394('0x11f'),'foreignKey':_0x6394('0x162'),'onDelete':_0x6394('0x165')});db['CmContact'][_0x6394('0x114')](db[_0x6394('0x120')],{'as':_0x6394('0x121'),'foreignKey':_0x6394('0x162'),'onDelete':_0x6394('0x165')});db['CmContact'][_0x6394('0x114')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x6394('0x162'),'onDelete':_0x6394('0x165')});db['CmContact'][_0x6394('0x129')](db[_0x6394('0x6a')],{'as':_0x6394('0x19d'),'foreignKey':_0x6394('0x199')});db[_0x6394('0x6c')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b'),'onDelete':_0x6394('0x119')});db[_0x6394('0x6c')][_0x6394('0x12d')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0x6394('0x6c')][_0x6394('0x12d')](db[_0x6394('0x84')],{'as':'Tags','through':_0x6394('0x19e')});db[_0x6394('0x6c')][_0x6394('0x12d')](db[_0x6394('0x84')],{'through':'cm_contact_has_tags','as':_0x6394('0x174')});db[_0x6394('0x126')][_0x6394('0x114')](db[_0x6394('0x88')],{'as':_0x6394('0x19f'),'foreignKey':_0x6394('0x1a0')});db[_0x6394('0x126')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x6394('0x119')});db['CmHopper'][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b'),'onDelete':_0x6394('0x119')});db['CmHopper']['belongsTo'](db[_0x6394('0x11')],{'as':_0x6394('0x191'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x126')][_0x6394('0x129')](db[_0x6394('0x19')],{'as':_0x6394('0x192'),'foreignKey':_0x6394('0x14f'),'onDelete':_0x6394('0x119')});db['CmHopper'][_0x6394('0x129')](db[_0x6394('0xe1')],{'as':_0x6394('0xe1'),'foreignKey':_0x6394('0x1a1'),'onDelete':_0x6394('0x119')});db[_0x6394('0x126')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x1a2')});db[_0x6394('0x6d')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162'),'onDelete':'cascade'});db[_0x6394('0x6d')]['belongsTo'](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b'),'onDelete':_0x6394('0x119')});db[_0x6394('0x6d')][_0x6394('0x129')](db[_0x6394('0x19')],{'as':_0x6394('0x192'),'foreignKey':_0x6394('0x14f'),'onDelete':_0x6394('0x119')});db['CmHopperBlack'][_0x6394('0x129')](db[_0x6394('0xe1')],{'as':_0x6394('0xe1'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x6394('0x1a3')][_0x6394('0x114')](db[_0x6394('0x1a4')],{'as':{'plural':_0x6394('0x1a5'),'singular':'OneAll'},'foreignKey':_0x6394('0x1a6'),'onDelete':'cascade','hooks':!![]});db[_0x6394('0x1a3')][_0x6394('0x114')](db['Condition'],{'as':{'plural':_0x6394('0x1a7'),'singular':_0x6394('0x1a8')},'foreignKey':'AutomationAnyId','onDelete':_0x6394('0x119'),'hooks':!![]});db[_0x6394('0x1a3')]['hasMany'](db[_0x6394('0x76')],{'as':_0x6394('0x1a9'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db[_0x6394('0x78')][_0x6394('0x114')](db['Disposition'],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x6394('0x119')});db[_0x6394('0x7a')][_0x6394('0x114')](db[_0x6394('0x7a')],{'as':_0x6394('0x1aa'),'foreignKey':_0x6394('0x154'),'onDelete':_0x6394('0x119'),'hooks':!![],'required':![]});db[_0x6394('0x7a')][_0x6394('0x114')](db['VoiceExtension'],{'as':_0x6394('0x118'),'foreignKey':_0x6394('0x154'),'onDelete':_0x6394('0x165')});db['Interval'][_0x6394('0x114')](db[_0x6394('0x3f')],{'as':_0x6394('0x1ab'),'foreignKey':_0x6394('0x154')});db['Interval'][_0x6394('0x114')](db[_0x6394('0x5e')],{'as':'ChatApplications','foreignKey':_0x6394('0x154')});db[_0x6394('0x7a')][_0x6394('0x114')](db[_0x6394('0x17d')],{'as':_0x6394('0x1ac'),'foreignKey':_0x6394('0x154')});db[_0x6394('0x7a')][_0x6394('0x114')](db[_0x6394('0x4e')],{'as':'SmsApplications','foreignKey':_0x6394('0x154')});db[_0x6394('0x80')][_0x6394('0x129')](db[_0x6394('0x36')],{});db[_0x6394('0x80')][_0x6394('0x129')](db[_0x6394('0x92')],{'foreignKey':'DefaultReportId'});db[_0x6394('0x80')][_0x6394('0x129')](db[_0x6394('0x91')],{'foreignKey':_0x6394('0x1ad')});db[_0x6394('0x82')]['belongsToMany'](db[_0x6394('0x18')],{'as':_0x6394('0x1ae'),'through':_0x6394('0x14d'),'onDelete':_0x6394('0x165')});db[_0x6394('0x84')][_0x6394('0x12d')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x6394('0x84')][_0x6394('0x12d')](db[_0x6394('0x11e')],{'through':_0x6394('0x195')});db[_0x6394('0x84')][_0x6394('0x12d')](db[_0x6394('0x3b')],{'through':'mail_interaction_has_tags'});db[_0x6394('0x84')][_0x6394('0x12d')](db[_0x6394('0x4f')],{'through':_0x6394('0x189')});db[_0x6394('0x84')][_0x6394('0x12d')](db[_0x6394('0x120')],{'through':_0x6394('0x183')});db[_0x6394('0x84')]['belongsToMany'](db[_0x6394('0x58')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0x6394('0x12d')](db[_0x6394('0x100')],{'through':_0x6394('0x1af')});db['CmContactHasItem'][_0x6394('0x129')](db[_0x6394('0x85')],{'as':_0x6394('0x1b0'),'foreignKey':'ItemTypeId'});db[_0x6394('0x88')][_0x6394('0x129')](db[_0x6394('0x126')],{'as':_0x6394('0x1b1'),'foreignKey':'CmHopperId'});db['CmContactHasItem'][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x19c')});db['Trigger'][_0x6394('0x114')](db[_0x6394('0x1a4')],{'as':{'plural':_0x6394('0x1b2'),'singular':_0x6394('0x1b3')},'foreignKey':_0x6394('0x1b4'),'onDelete':_0x6394('0x119'),'hooks':!![]});db[_0x6394('0x8b')]['hasMany'](db[_0x6394('0x1a4')],{'as':{'plural':_0x6394('0x1b5'),'singular':_0x6394('0x1b6')},'foreignKey':'TriggerAnyId','onDelete':'cascade','hooks':!![]});db[_0x6394('0x8b')][_0x6394('0x114')](db[_0x6394('0x76')],{'as':_0x6394('0x1a9'),'foreignKey':'TriggerId','onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x6394('0x114')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1ad'),'hooks':!![]});db[_0x6394('0x92')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x6394('0x1b7'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1b8')});db[_0x6394('0x1b9')][_0x6394('0x114')](db[_0x6394('0x95')],{'as':_0x6394('0x1b7'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1ba')});db[_0x6394('0x95')]['belongsTo'](db[_0x6394('0x1b9')],{'foreignKey':'MetricId'});db[_0x6394('0x98')]['hasMany'](db[_0x6394('0x9a')],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0x9a')]['hasMany'](db['SalesforceField'],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x6394('0x1bd')});db[_0x6394('0x9a')][_0x6394('0x114')](db['SalesforceField'],{'as':_0x6394('0x1be'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0x9a')]['hasMany'](db[_0x6394('0x9c')],{'as':_0x6394('0x1b7'),'onDelete':'cascade','foreignKey':_0x6394('0x1c0')});db[_0x6394('0x9a')][_0x6394('0x129')](db[_0x6394('0x98')],{'as':_0x6394('0x171'),'foreignKey':'AccountId'});db[_0x6394('0x9c')]['hasMany'](db[_0x6394('0x9c')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0x9c')][_0x6394('0x114')](db[_0x6394('0x9c')],{'as':_0x6394('0x1c2'),'foreignKey':'DescriptionId'});db['SalesforceField'][_0x6394('0x114')](db['SalesforceField'],{'as':_0x6394('0x1c3'),'foreignKey':_0x6394('0x1c0')});db['SalesforceField'][_0x6394('0x129')](db['Variable'],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0x9d')][_0x6394('0x114')](db[_0x6394('0x9f')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x6394('0x1bc')});db['SugarcrmConfiguration'][_0x6394('0x114')](db[_0x6394('0xa1')],{'as':_0x6394('0x1c5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x6394('0x9f')]['hasMany'](db[_0x6394('0xa1')],{'as':'Descriptions','onDelete':_0x6394('0x119'),'foreignKey':'DescriptionId'});db[_0x6394('0x9f')][_0x6394('0x114')](db[_0x6394('0xa1')],{'as':_0x6394('0x1b7'),'onDelete':_0x6394('0x119'),'foreignKey':'FieldId'});db[_0x6394('0x9f')][_0x6394('0x129')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x6394('0x1bc')});db[_0x6394('0xa1')][_0x6394('0x114')](db[_0x6394('0xa1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x6394('0xa1')][_0x6394('0x114')](db[_0x6394('0xa1')],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db['SugarcrmField'][_0x6394('0x114')](db[_0x6394('0xa1')],{'as':_0x6394('0x1c3'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0xa1')][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x6394('0xa2')][_0x6394('0x114')](db[_0x6394('0x1c6')],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0x1c6')][_0x6394('0x114')](db[_0x6394('0xa5')],{'as':_0x6394('0x1c5'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0x1c6')][_0x6394('0x114')](db[_0x6394('0xa5')],{'as':_0x6394('0x1be'),'onDelete':'cascade','foreignKey':_0x6394('0x1bf')});db[_0x6394('0x1c6')][_0x6394('0x114')](db['DeskField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0x6394('0x1c0')});db[_0x6394('0x1c6')][_0x6394('0x129')](db[_0x6394('0xa2')],{'as':'Account','foreignKey':_0x6394('0x1bc')});db['DeskConfiguration'][_0x6394('0x12d')](db[_0x6394('0x84')],{'through':_0x6394('0x1c7')});db[_0x6394('0xa5')][_0x6394('0x114')](db[_0x6394('0xa5')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xa5')][_0x6394('0x114')](db[_0x6394('0xa5')],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xa5')][_0x6394('0x114')](db['DeskField'],{'as':_0x6394('0x1c3'),'foreignKey':_0x6394('0x1c0')});db['DeskField']['belongsTo'](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0x1c8')][_0x6394('0x114')](db[_0x6394('0xa8')],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0xa8')][_0x6394('0x114')](db[_0x6394('0xa9')],{'as':_0x6394('0x1c5'),'onDelete':_0x6394('0x119'),'foreignKey':'SubjectId'});db[_0x6394('0xa8')]['hasMany'](db['ZohoField'],{'as':_0x6394('0x1be'),'onDelete':'cascade','foreignKey':_0x6394('0x1bf')});db[_0x6394('0xa8')][_0x6394('0x114')](db[_0x6394('0xa9')],{'as':_0x6394('0x1b7'),'onDelete':'cascade','foreignKey':_0x6394('0x1c0')});db[_0x6394('0xa8')][_0x6394('0x129')](db[_0x6394('0x1c8')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0xa9')]['hasMany'](db['ZohoField'],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db['ZohoField'][_0x6394('0x114')](db['ZohoField'],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db['ZohoField'][_0x6394('0x114')](db[_0x6394('0xa9')],{'as':'Field','foreignKey':_0x6394('0x1c0')});db['ZohoField']['belongsTo'](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0xaa')][_0x6394('0x114')](db[_0x6394('0xac')],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db['ZendeskConfiguration'][_0x6394('0x114')](db['ZendeskField'],{'as':_0x6394('0x1c5'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xac')]['hasMany'](db['ZendeskField'],{'as':_0x6394('0x1be'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x6394('0x114')](db[_0x6394('0xad')],{'as':'Fields','foreignKey':_0x6394('0x1c0')});db[_0x6394('0xac')][_0x6394('0x129')](db[_0x6394('0xaa')],{'as':'Account','foreignKey':_0x6394('0x1bc')});db[_0x6394('0xac')][_0x6394('0x12d')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0x6394('0xad')][_0x6394('0x114')](db[_0x6394('0xad')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xad')]['hasMany'](db[_0x6394('0xad')],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xad')][_0x6394('0x114')](db[_0x6394('0xad')],{'as':_0x6394('0x1c3'),'foreignKey':'FieldId'});db[_0x6394('0xad')][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db['FreshdeskAccount'][_0x6394('0x114')](db['FreshdeskConfiguration'],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':'AccountId'});db[_0x6394('0xb0')][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':_0x6394('0x1c5'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bd')});db['FreshdeskConfiguration'][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':'Descriptions','onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xb0')][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':_0x6394('0x1b7'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0xb0')][_0x6394('0x129')](db[_0x6394('0xae')],{'as':'Account','foreignKey':_0x6394('0x1bc')});db[_0x6394('0xb0')][_0x6394('0x12d')](db[_0x6394('0x84')],{'through':_0x6394('0x1c9')});db[_0x6394('0xb2')][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xb2')][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xb2')][_0x6394('0x114')](db[_0x6394('0xb2')],{'as':'Field','foreignKey':_0x6394('0x1c0')});db[_0x6394('0xb2')][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0xb4')]['hasMany'](db[_0x6394('0x1ca')],{'as':'Configurations','onDelete':_0x6394('0x119'),'foreignKey':'AccountId'});db[_0x6394('0x1ca')][_0x6394('0x114')](db[_0x6394('0x1cb')],{'as':_0x6394('0x1c5'),'foreignKey':_0x6394('0x1bd')});db['VtigerConfiguration'][_0x6394('0x114')](db['VtigerField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x6394('0x1ca')][_0x6394('0x114')](db[_0x6394('0x1cb')],{'as':_0x6394('0x1b7'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0x1ca')][_0x6394('0x129')](db['VtigerAccount'],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0x1cb')][_0x6394('0x114')](db[_0x6394('0x1cb')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db['VtigerField'][_0x6394('0x114')](db[_0x6394('0x1cb')],{'as':_0x6394('0x1c2'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x6394('0x114')](db[_0x6394('0x1cb')],{'as':'Field','foreignKey':_0x6394('0x1c0')});db[_0x6394('0x1cb')][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0xb8')][_0x6394('0x114')](db['ServicenowConfiguration'],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0xba')][_0x6394('0x114')](db[_0x6394('0xbc')],{'as':'Subjects','foreignKey':_0x6394('0x1bd')});db[_0x6394('0xba')][_0x6394('0x114')](db[_0x6394('0xbc')],{'as':_0x6394('0x1be'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xba')][_0x6394('0x114')](db[_0x6394('0xbc')],{'as':_0x6394('0x1b7'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0xba')][_0x6394('0x129')](db[_0x6394('0xb8')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x6394('0x1c1'),'foreignKey':'SubjectId'});db[_0x6394('0xbc')][_0x6394('0x114')](db['ServicenowField'],{'as':_0x6394('0x1c2'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xbc')][_0x6394('0x114')](db[_0x6394('0xbc')],{'as':_0x6394('0x1c3'),'foreignKey':_0x6394('0x1c0')});db['ServicenowField'][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db[_0x6394('0xbe')][_0x6394('0x114')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db['Dynamics365Account'][_0x6394('0x129')](db['CloudProvider'],{'as':_0x6394('0x10a'),'foreignKey':_0x6394('0x164')});db['Dynamics365Configuration']['hasMany'](db[_0x6394('0x1cc')],{'as':_0x6394('0x1c5'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xc0')]['hasMany'](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bf')});db[_0x6394('0xc0')]['hasMany'](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0xc0')][_0x6394('0x129')](db[_0x6394('0xbe')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x1bc')});db[_0x6394('0x1cc')][_0x6394('0x114')](db[_0x6394('0x1cc')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0x1cc')][_0x6394('0x114')](db[_0x6394('0x1cc')],{'as':'Description','foreignKey':_0x6394('0x1bf')});db[_0x6394('0x1cc')][_0x6394('0x114')](db[_0x6394('0x1cc')],{'as':'Field','foreignKey':_0x6394('0x1c0')});db[_0x6394('0x1cc')][_0x6394('0x129')](db[_0x6394('0x8d')],{'as':_0x6394('0x8d'),'foreignKey':_0x6394('0x1c4')});db['FreshsalesAccount']['hasMany'](db[_0x6394('0xc5')],{'as':_0x6394('0x1bb'),'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1bc')});db['FreshsalesConfiguration'][_0x6394('0x114')](db[_0x6394('0x1cd')],{'as':_0x6394('0x1c5'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0xc5')][_0x6394('0x114')](db[_0x6394('0x1cd')],{'as':'Descriptions','foreignKey':_0x6394('0x1bf')});db['FreshsalesConfiguration'][_0x6394('0x114')](db['FreshsalesField'],{'as':_0x6394('0x1b7'),'foreignKey':_0x6394('0x1c0')});db[_0x6394('0xc5')][_0x6394('0x129')](db[_0x6394('0xc3')],{'as':'Account','foreignKey':_0x6394('0x1bc')});db[_0x6394('0x1cd')][_0x6394('0x114')](db[_0x6394('0x1cd')],{'as':_0x6394('0x1c1'),'foreignKey':_0x6394('0x1bd')});db[_0x6394('0x1cd')][_0x6394('0x114')](db[_0x6394('0x1cd')],{'as':'Description','foreignKey':_0x6394('0x1bf')});db[_0x6394('0x1cd')][_0x6394('0x114')](db[_0x6394('0x1cd')],{'as':'Field','foreignKey':_0x6394('0x1c0')});db[_0x6394('0x1cd')][_0x6394('0x129')](db['Variable'],{'as':_0x6394('0x8d'),'foreignKey':'VariableId'});db[_0x6394('0xca')]['belongsTo'](db[_0x6394('0x13f')],{});db['ChatQueueReport'][_0x6394('0x129')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x6394('0xca')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':'Contact','foreignKey':_0x6394('0x162')});db[_0x6394('0xca')][_0x6394('0x129')](db[_0x6394('0x11e')],{});db[_0x6394('0xca')][_0x6394('0x129')](db[_0x6394('0x61')],{});db[_0x6394('0xca')]['belongsTo'](db['User'],{});db[_0x6394('0xca')][_0x6394('0x129')](db['ChatQueue'],{});db[_0x6394('0xcc')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':'cascade','foreignKey':_0x6394('0x1ce')});db[_0x6394('0xcc')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':_0x6394('0x119'),'foreignKey':_0x6394('0x1cf')});db[_0x6394('0xd2')][_0x6394('0x114')](db[_0x6394('0xd0')],{'foreignKey':_0x6394('0x1d0'),'onDelete':_0x6394('0x119')});db['JscriptySessionReport'][_0x6394('0x114')](db[_0x6394('0xce')],{'foreignKey':_0x6394('0x1d0'),'onDelete':_0x6394('0x119')});db[_0x6394('0xd4')]['belongsTo'](db['SmsAccount'],{});db[_0x6394('0xd4')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':'ListId'});db['SmsQueueReport'][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db[_0x6394('0xd4')]['belongsTo'](db[_0x6394('0x4f')],{});db['SmsQueueReport'][_0x6394('0x129')](db[_0x6394('0x51')],{});db[_0x6394('0xd4')][_0x6394('0x129')](db['User'],{});db[_0x6394('0xd4')]['belongsTo'](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db[_0x6394('0xd2')],{'foreignKey':_0x6394('0x1d1')});db[_0x6394('0x1d2')][_0x6394('0x114')](db[_0x6394('0xd0')],{'foreignKey':_0x6394('0x1d1')});db[_0x6394('0x1d2')][_0x6394('0x114')](db[_0x6394('0xce')],{'foreignKey':_0x6394('0x1d1')});db[_0x6394('0xdf')][_0x6394('0x12d')](db['User'],{'as':_0x6394('0x16e'),'through':_0x6394('0x1d3')});db[_0x6394('0xdf')]['belongsToMany'](db[_0x6394('0x19')],{'through':_0x6394('0x159'),'as':_0x6394('0x134')});db[_0x6394('0xdf')][_0x6394('0x12d')](db[_0x6394('0x38')],{'through':'team_has_mail_queues','as':_0x6394('0x137')});db['Team'][_0x6394('0x12d')](db['ChatQueue'],{'through':_0x6394('0x196'),'as':_0x6394('0x138')});db['Team']['belongsToMany'](db['FaxQueue'],{'through':_0x6394('0x185'),'as':_0x6394('0x13a')});db['Team'][_0x6394('0x12d')](db[_0x6394('0x53')],{'through':_0x6394('0x1d4'),'as':'SmsQueues'});db[_0x6394('0xdf')][_0x6394('0x12d')](db['OpenchannelQueue'],{'through':_0x6394('0x18f'),'as':_0x6394('0x13d')});db['Team'][_0x6394('0x12d')](db[_0x6394('0x108')],{'through':_0x6394('0x1d5'),'as':_0x6394('0x13e')});db[_0x6394('0xdf')][_0x6394('0x12d')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0x6394('0x136')});db[_0x6394('0xe1')][_0x6394('0x114')](db['CmHopper'],{'as':_0x6394('0x127'),'foreignKey':_0x6394('0x1a1')});db[_0x6394('0xe1')][_0x6394('0x114')](db[_0x6394('0x6f')],{'as':'HopperFinals','foreignKey':_0x6394('0x1a1')});db[_0x6394('0xe1')][_0x6394('0x114')](db[_0x6394('0x71')],{'as':_0x6394('0x150'),'foreignKey':'CampaignId'});db[_0x6394('0xe1')][_0x6394('0x114')](db['CmHopperBlack'],{'as':_0x6394('0x1d6'),'foreignKey':_0x6394('0x1a1')});db[_0x6394('0xe1')][_0x6394('0x129')](db[_0x6394('0x24')],{'as':_0x6394('0x24'),'foreignKey':_0x6394('0x152')});db[_0x6394('0xe1')][_0x6394('0x129')](db[_0x6394('0x24')],{'as':_0x6394('0x153'),'foreignKey':_0x6394('0x1d7')});db['Campaign']['belongsTo'](db[_0x6394('0x7a')],{'as':_0x6394('0x7a'),'foreignKey':_0x6394('0x154')});db[_0x6394('0xe1')]['belongsTo'](db[_0x6394('0xdb')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0x6394('0xe1')]['belongsToMany'](db[_0x6394('0xf0')],{'as':_0x6394('0x156'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0x6394('0x12d')](db[_0x6394('0xf0')],{'as':_0x6394('0x15a'),'through':_0x6394('0x1d8')});db['Attachment'][_0x6394('0x129')](db[_0x6394('0x17a')],{'as':'ChatOfflineMessage','foreignKey':_0x6394('0x1d9')});db[_0x6394('0xe7')][_0x6394('0x129')](db['MailMessage'],{});db['MailTransferReport'][_0x6394('0x129')](db[_0x6394('0x3b')],{});db[_0x6394('0xe7')][_0x6394('0x129')](db[_0x6394('0x36')],{'foreignKey':_0x6394('0x1da'),'as':_0x6394('0x1db')});db[_0x6394('0xe7')][_0x6394('0x129')](db['User'],{'foreignKey':_0x6394('0x1dc'),'as':_0x6394('0x1dd')});db[_0x6394('0xe7')][_0x6394('0x129')](db['User'],{'foreignKey':_0x6394('0x1de'),'as':_0x6394('0x1df')});db[_0x6394('0xe7')][_0x6394('0x129')](db[_0x6394('0x38')],{'foreignKey':_0x6394('0x1e0'),'as':_0x6394('0x1e1')});db[_0x6394('0xe7')][_0x6394('0x129')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x6394('0x1e2')});db[_0x6394('0xe9')][_0x6394('0x129')](db[_0x6394('0x61')],{});db[_0x6394('0xe9')][_0x6394('0x129')](db[_0x6394('0x11e')],{});db[_0x6394('0xe9')][_0x6394('0x129')](db[_0x6394('0x13f')],{'foreignKey':_0x6394('0x1e3'),'as':_0x6394('0x1db')});db[_0x6394('0xe9')][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1dc'),'as':_0x6394('0x1dd')});db[_0x6394('0xe9')][_0x6394('0x129')](db['User'],{'foreignKey':'ToUserId','as':_0x6394('0x1df')});db['ChatTransferReport'][_0x6394('0x129')](db[_0x6394('0x64')],{'foreignKey':_0x6394('0x1e4'),'as':_0x6394('0x1e1')});db[_0x6394('0xe9')][_0x6394('0x129')](db[_0x6394('0x13f')],{'foreignKey':_0x6394('0x1e5'),'as':_0x6394('0x1e2')});db[_0x6394('0xeb')][_0x6394('0x129')](db[_0x6394('0x17f')],{});db['FaxTransferReport'][_0x6394('0x129')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x6394('0x129')](db[_0x6394('0x46')],{'foreignKey':_0x6394('0x1e6'),'as':_0x6394('0x1db')});db[_0x6394('0xeb')][_0x6394('0x129')](db['User'],{'foreignKey':_0x6394('0x1dc'),'as':_0x6394('0x1dd')});db[_0x6394('0xeb')][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1de'),'as':_0x6394('0x1df')});db[_0x6394('0xeb')][_0x6394('0x129')](db[_0x6394('0x4a')],{'foreignKey':'ToFaxQueueId','as':_0x6394('0x1e1')});db[_0x6394('0xeb')][_0x6394('0x129')](db[_0x6394('0x46')],{'foreignKey':'ToFaxAccountId','as':_0x6394('0x1e2')});db[_0x6394('0x1e7')]['belongsTo'](db[_0x6394('0x5a')],{});db[_0x6394('0x1e7')][_0x6394('0x129')](db[_0x6394('0x58')],{});db[_0x6394('0x1e7')]['belongsTo'](db[_0x6394('0x55')],{'foreignKey':'FromOpenchannelAccountId','as':_0x6394('0x1db')});db['OpenchannelTransferReport'][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1dc'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1de'),'as':_0x6394('0x1df')});db[_0x6394('0x1e7')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x6394('0x1e8'),'as':_0x6394('0x1e1')});db[_0x6394('0x1e7')]['belongsTo'](db[_0x6394('0x55')],{'foreignKey':_0x6394('0x1e9'),'as':_0x6394('0x1e2')});db[_0x6394('0xee')][_0x6394('0x129')](db[_0x6394('0x51')],{});db[_0x6394('0xee')]['belongsTo'](db[_0x6394('0x4f')],{});db[_0x6394('0xee')]['belongsTo'](db[_0x6394('0x4c')],{'foreignKey':_0x6394('0x1ea'),'as':_0x6394('0x1db')});db['SmsTransferReport'][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':'FromUserId','as':_0x6394('0x1dd')});db[_0x6394('0xee')][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1de'),'as':_0x6394('0x1df')});db['SmsTransferReport'][_0x6394('0x129')](db[_0x6394('0x53')],{'foreignKey':_0x6394('0x1eb'),'as':_0x6394('0x1e1')});db['SmsTransferReport'][_0x6394('0x129')](db[_0x6394('0x4c')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x6394('0xf0')][_0x6394('0x114')](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':_0x6394('0x16b'),'onDelete':_0x6394('0x119')});db[_0x6394('0xf0')][_0x6394('0x114')](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x6394('0x16b')});db['CmList']['hasMany'](db[_0x6394('0x6c')],{'as':'Contacts','onDelete':_0x6394('0x119'),'foreignKey':'ListId'});db[_0x6394('0xf0')][_0x6394('0x114')](db[_0x6394('0x6f')],{'as':_0x6394('0x11a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0xf0')][_0x6394('0x114')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x6394('0x16b')});db[_0x6394('0xf0')]['hasMany'](db[_0x6394('0x11c')],{'as':_0x6394('0x11c'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0xf0')]['belongsToMany'](db['VoiceQueue'],{'as':_0x6394('0x1ec'),'through':_0x6394('0x157')});db['CmList']['belongsToMany'](db['User'],{'as':_0x6394('0x16e'),'through':'cm_user_has_lists'});db[_0x6394('0xf2')][_0x6394('0x114')](db[_0x6394('0x117')],{'as':'Extensions','onDelete':_0x6394('0x119')});db[_0x6394('0xf2')][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x10e')});db[_0x6394('0xf2')][_0x6394('0x12d')](db[_0x6394('0xdf')],{'through':_0x6394('0x10c'),'as':_0x6394('0x158')});db[_0x6394('0xf4')][_0x6394('0x114')](db[_0x6394('0x11')],{'as':'Users','foreignKey':'userProfileId'});db[_0x6394('0xf4')][_0x6394('0x114')](db['UserProfileSection'],{'as':_0x6394('0x1ed'),'foreignKey':_0x6394('0x12a'),'onDelete':'cascade'});db[_0x6394('0xf6')]['hasMany'](db[_0x6394('0xf8')],{'as':_0x6394('0x1ee'),'foreignKey':_0x6394('0x1ef'),'onDelete':'cascade'});db[_0x6394('0xfc')][_0x6394('0x114')](db[_0x6394('0x78')],{'as':_0x6394('0x166'),'foreignKey':_0x6394('0x1f0'),'onDelete':_0x6394('0x119')});db['WhatsappAccount'][_0x6394('0x114')](db[_0x6394('0x167')],{'as':'Answers','foreignKey':_0x6394('0x1f0')});db['WhatsappAccount'][_0x6394('0x114')](db[_0x6394('0x102')],{'as':'Messages','foreignKey':_0x6394('0x1f0')});db[_0x6394('0xfc')][_0x6394('0x114')](db[_0x6394('0x100')],{'as':_0x6394('0x169')});db[_0x6394('0xfc')][_0x6394('0x114')](db[_0x6394('0xfe')],{'as':_0x6394('0x14b'),'foreignKey':_0x6394('0x1f0'),'onDelete':_0x6394('0x119')});db[_0x6394('0xfc')][_0x6394('0x129')](db[_0x6394('0xf0')],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0xfc')][_0x6394('0x129')](db[_0x6394('0x7c')],{'as':_0x6394('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6394('0xfc')]['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':_0x6394('0x148')});db[_0x6394('0xfe')][_0x6394('0x129')](db[_0x6394('0x11')],{'onDelete':_0x6394('0x165')});db[_0x6394('0xfe')]['belongsTo'](db[_0x6394('0x108')],{'onDelete':_0x6394('0x165')});db['WhatsappApplication'][_0x6394('0x129')](db[_0x6394('0xfc')],{'onDelete':_0x6394('0x165')});db[_0x6394('0xfe')][_0x6394('0x129')](db[_0x6394('0x7a')],{'onDelete':'restrict','foreignKey':_0x6394('0x154')});db[_0x6394('0xfe')][_0x6394('0x129')](db[_0x6394('0x84')],{'onDelete':_0x6394('0x165'),'foreignKey':_0x6394('0x180')});db[_0x6394('0x100')]['hasMany'](db[_0x6394('0x102')],{'as':_0x6394('0x15b'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x6394('0x100')][_0x6394('0x129')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x6394('0x1f0')});db[_0x6394('0x100')][_0x6394('0x129')](db[_0x6394('0x6c')],{'as':_0x6394('0x161'),'foreignKey':_0x6394('0x162')});db['WhatsappInteraction'][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x182'),'foreignKey':_0x6394('0x113')});db[_0x6394('0x100')][_0x6394('0x12d')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x6394('0x173')});db[_0x6394('0x100')][_0x6394('0x12d')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db[_0x6394('0x11')],{'as':_0x6394('0x175'),'through':_0x6394('0x133'),'foreignKey':_0x6394('0x1f1')});db[_0x6394('0x102')][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x11')});db[_0x6394('0x102')]['belongsTo'](db[_0x6394('0x6c')],{'onDelete':'cascade','as':_0x6394('0x161')});db[_0x6394('0x102')][_0x6394('0x129')](db['WhatsappInteraction'],{'onDelete':_0x6394('0x119'),'as':_0x6394('0x178'),'foreignKey':'WhatsappInteractionId'});db[_0x6394('0x102')]['belongsTo'](db[_0x6394('0xfc')],{'as':_0x6394('0x171'),'foreignKey':_0x6394('0x1f0')});db['WhatsappQueueReport'][_0x6394('0x129')](db[_0x6394('0xfc')],{});db[_0x6394('0x104')][_0x6394('0x129')](db['CmList'],{'as':_0x6394('0x16a'),'foreignKey':_0x6394('0x16b')});db[_0x6394('0x104')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x6394('0x162')});db[_0x6394('0x104')][_0x6394('0x129')](db[_0x6394('0x100')],{});db['WhatsappQueueReport'][_0x6394('0x129')](db[_0x6394('0x108')],{});db[_0x6394('0x104')][_0x6394('0x129')](db['WhatsappMessage'],{});db[_0x6394('0x104')][_0x6394('0x129')](db[_0x6394('0x11')],{});db[_0x6394('0x106')]['belongsTo'](db['WhatsappMessage'],{});db[_0x6394('0x106')][_0x6394('0x129')](db[_0x6394('0x100')],{});db[_0x6394('0x106')][_0x6394('0x129')](db[_0x6394('0xfc')],{'foreignKey':_0x6394('0x1f2'),'as':_0x6394('0x1db')});db[_0x6394('0x106')][_0x6394('0x129')](db[_0x6394('0xfc')],{'foreignKey':_0x6394('0x1f3'),'as':_0x6394('0x1e2')});db[_0x6394('0x106')][_0x6394('0x129')](db[_0x6394('0x108')],{'foreignKey':_0x6394('0x1f4'),'as':'ToQueue'});db[_0x6394('0x106')][_0x6394('0x129')](db[_0x6394('0x11')],{'foreignKey':'FromUserId','as':_0x6394('0x1dd')});db[_0x6394('0x106')]['belongsTo'](db[_0x6394('0x11')],{'foreignKey':_0x6394('0x1de'),'as':_0x6394('0x1df')});db['WhatsappQueue'][_0x6394('0x12d')](db[_0x6394('0x11')],{'as':_0x6394('0x16e'),'through':'UserWhatsappQueue','foreignKey':_0x6394('0x1f5')});db[_0x6394('0x108')]['belongsToMany'](db[_0x6394('0xdf')],{'through':'team_has_whatsapp_queues','as':_0x6394('0x158')});db['UserSetting'][_0x6394('0x129')](db[_0x6394('0x11')],{'as':_0x6394('0x1f6'),'foreignKey':_0x6394('0x113'),'onDelete':_0x6394('0x119'),'hooks':!![]});db['CloudProvider'][_0x6394('0x112')](db[_0x6394('0xbe')],{'as':_0x6394('0xbe'),'onDelete':'restrict'});db[_0x6394('0x10a')]['hasOne'](db[_0x6394('0x32')],{'as':_0x6394('0x1f7'),'onDelete':_0x6394('0x165')});db[_0x6394('0x10a')][_0x6394('0x112')](db[_0x6394('0x34')],{'as':_0x6394('0x1f8'),'onDelete':'restrict'});module[_0x6394('0x1f9')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc5bd=['List','ListId','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','MailQueueReport','DashboardItem','FaxAccountId','CannedAnswer','Answers','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','SmsAccountId','SmsMessage','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccount','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','team_has_chat_queues','ChatGroupId','chat_group_has_users','Contacts','CompanyId','JscriptySessions','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','Automation','Condition','OneAll','AutomationAllId','Any','OneAny','AutomationId','ParentId','Intervals','Extensions','ChatApplications','SmsApplications','Schedule','DefaultReportId','Mohs','whatsapp_interaction_has_tags','ItemTypeId','Hopper','CmContactId','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','CustomReportId','MetricId','Configurations','Subjects','AccountId','Subject','Description','DescriptionId','VariableId','SubjectId','Descriptions','FieldId','Field','int_desk_configuration_has_tags','ZohoAccount','ZohoConfiguration','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskField','ServicenowField','CloudProviderId','FreshsalesField','FromId','ToId','SessionId','ProjectId','VoiceQueues','team_has_whatsapp_queues','TrunkBackupId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','HopperFinals','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappMessage','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','name','utf8','sequelizeHistory','xC@LL1234','mysql','utf8mb4','database','password','options','User','import','VoiceChanSpy','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','HopperHistory','ReportAgentPreview','ChatInteractions','SmsInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','CmHopper','SET\x20NULL','belongsTo','userProfileId','belongsToMany','ChatGroup','Groups','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueue','VoicePrefixes','MailQueues','ChatQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SpiedAgents','VoiceContext','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','VoiceCallReport','AgentReports','Contact','ContactId','MailAccountId','restrict','MailServerOut','Smtp','Dispositions','Interactions'];(function(_0xcd48df,_0x257fd5){var _0x5083d3=function(_0x652306){while(--_0x652306){_0xcd48df['push'](_0xcd48df['shift']());}};_0x5083d3(++_0x257fd5);}(_0xc5bd,0x9a));var _0xdc5b=function(_0x355bf3,_0x249ee2){_0x355bf3=_0x355bf3-0x0;var _0x2f04c6=_0xc5bd[_0x355bf3];return _0x2f04c6;};'use strict';var config=require(_0xdc5b('0x0'));var Sequelize=require(_0xdc5b('0x1'));var _=require(_0xdc5b('0x2'));var jstz=require(_0xdc5b('0x3'));var timezone=jstz[_0xdc5b('0x4')]();config[_0xdc5b('0x1')]=_[_0xdc5b('0x5')](config[_0xdc5b('0x1')],{'database':_0xdc5b('0x6'),'username':_0xdc5b('0x7'),'password':'xC@LL1234','options':{'host':_0xdc5b('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xdc5b('0x9')](),'define':{'charset':_0xdc5b('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xdc5b('0x5')](config[_0xdc5b('0xb')],{'database':_0xdc5b('0x6'),'username':_0xdc5b('0x7'),'password':_0xdc5b('0xc'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xdc5b('0xd'),'dialectOptions':{'charset':_0xdc5b('0xe')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xdc5b('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xdc5b('0x1')][_0xdc5b('0xf')],config[_0xdc5b('0x1')]['username'],config[_0xdc5b('0x1')][_0xdc5b('0x10')],config[_0xdc5b('0x1')][_0xdc5b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xdc5b('0xf')],config['sequelizeHistory']['username'],config[_0xdc5b('0xb')][_0xdc5b('0x10')],config['sequelizeHistory'][_0xdc5b('0x11')])};db[_0xdc5b('0x12')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/user/user.model');db[_0xdc5b('0x14')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/voiceContext/voiceContext.model');db[_0xdc5b('0x15')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x16'));db[_0xdc5b('0x17')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x18'));db['VoiceQueue']=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x19'));db[_0xdc5b('0x1a')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x1b'));db[_0xdc5b('0x1c')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x1d'));db[_0xdc5b('0x1e')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x1f'));db[_0xdc5b('0x20')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x21'));db['VoiceCallReport']=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x22'));db[_0xdc5b('0x23')]=db['sequelize'][_0xdc5b('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0xdc5b('0x24')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x25'));db[_0xdc5b('0x26')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x27'));db['MemberReport']=db['sequelize']['import']('../api/memberReport/memberReport.model');db[_0xdc5b('0x28')]=db[_0xdc5b('0x1')]['import']('../api/trunk/trunk.model');db[_0xdc5b('0x29')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x2a'));db[_0xdc5b('0x2b')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x2c'));db[_0xdc5b('0x2d')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x2e'));db[_0xdc5b('0x2f')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x30'));db[_0xdc5b('0x31')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x32'));db[_0xdc5b('0x33')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0xdc5b('0x34')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x35'));db[_0xdc5b('0x36')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x37'));db[_0xdc5b('0x38')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x39'));db[_0xdc5b('0x3a')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x3b'));db['MailServerOut']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x3c'));db[_0xdc5b('0x3d')]=db['sequelize']['import'](_0xdc5b('0x3e'));db[_0xdc5b('0x3f')]=db[_0xdc5b('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0xdc5b('0x40')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x41'));db['MailInteraction']=db[_0xdc5b('0x1')]['import']('../api/mailInteraction/mailInteraction.model');db[_0xdc5b('0x42')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x43'));db[_0xdc5b('0x44')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x45'));db['MailQueueReport']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x46'));db[_0xdc5b('0x47')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x48'));db['DashboardItem']=db[_0xdc5b('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db[_0xdc5b('0x49')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x4a'));db[_0xdc5b('0x4b')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x4c'));db[_0xdc5b('0x4d')]=db['sequelize'][_0xdc5b('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0xdc5b('0x4e')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x4f'));db[_0xdc5b('0x50')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x51'));db[_0xdc5b('0x52')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x53'));db[_0xdc5b('0x54')]=db['sequelize']['import'](_0xdc5b('0x55'));db[_0xdc5b('0x56')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/smsApplication/smsApplication.model');db[_0xdc5b('0x57')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x58'));db['SmsMessage']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x59'));db[_0xdc5b('0x5a')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x5b'));db['OpenchannelAccount']=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x5c'));db[_0xdc5b('0x5d')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x5e'));db[_0xdc5b('0x5f')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x60'));db[_0xdc5b('0x61')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x62'));db[_0xdc5b('0x63')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x64'));db[_0xdc5b('0x65')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x66'));db[_0xdc5b('0x67')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x68'));db['ChatApplication']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x69'));db[_0xdc5b('0x6a')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x6b'));db[_0xdc5b('0x6c')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/chatMessage/chatMessage.model');db[_0xdc5b('0x6d')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x6e'));db[_0xdc5b('0x6f')]=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db['ChatGroup']=db['sequelize']['import'](_0xdc5b('0x70'));db[_0xdc5b('0x71')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x72'));db[_0xdc5b('0x73')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x74'));db[_0xdc5b('0x75')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x76'));db['CmHopper']=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x77'));db['CmHopperBlack']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x78'));db[_0xdc5b('0x79')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x7a'));db[_0xdc5b('0x7b')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x7c'));db['CmCustomField']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x7d'));db[_0xdc5b('0x7e')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x7f'));db['Automation']=db['sequelize'][_0xdc5b('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db[_0xdc5b('0x80')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x81'));db['Condition']=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x82'));db[_0xdc5b('0x83')]=db['sequelize']['import'](_0xdc5b('0x84'));db[_0xdc5b('0x85')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x86'));db[_0xdc5b('0x87')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/cdr/cdr.model');db[_0xdc5b('0x88')]=db['sequelize']['import'](_0xdc5b('0x89'));db['Schedule']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x8a'));db[_0xdc5b('0x8b')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x8c'));db[_0xdc5b('0x8d')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x8e'));db[_0xdc5b('0x8f')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x90'));db[_0xdc5b('0x91')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0xdc5b('0x92')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x93'));db[_0xdc5b('0x94')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x95'));db[_0xdc5b('0x96')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x97'));db[_0xdc5b('0x98')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x99'));db['Integration']=db['sequelize'][_0xdc5b('0x13')]('../api/integration/integration.model');db[_0xdc5b('0x9a')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x9b'));db[_0xdc5b('0x9c')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x9d'));db[_0xdc5b('0x9e')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x9f'));db[_0xdc5b('0xa0')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xa1'));db['AnalyticMetric']=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xa2'));db[_0xdc5b('0xa3')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xa4'));db[_0xdc5b('0xa5')]=db['sequelize']['import'](_0xdc5b('0xa6'));db[_0xdc5b('0xa7')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xa8'));db[_0xdc5b('0xa9')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xaa'));db[_0xdc5b('0xab')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xac'));db[_0xdc5b('0xad')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xae'));db[_0xdc5b('0xaf')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xb0'));db[_0xdc5b('0xb1')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xb2'));db[_0xdc5b('0xb3')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xb4'));db[_0xdc5b('0xb5')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xb6'));db[_0xdc5b('0xb7')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xb8'));db['ZohoAccount']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xb9'));db['ZohoConfiguration']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xba'));db['ZohoField']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xbb'));db['ZendeskAccount']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xbc'));db[_0xdc5b('0xbd')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xbe'));db[_0xdc5b('0xbf')]=db['sequelize']['import'](_0xdc5b('0xc0'));db[_0xdc5b('0xc1')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xc2'));db[_0xdc5b('0xc3')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xc4'));db['FreshdeskField']=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xc5'));db[_0xdc5b('0xc6')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xc7'));db[_0xdc5b('0xc8')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xc9'));db[_0xdc5b('0xca')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xcb'));db[_0xdc5b('0xcc')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xcd'));db[_0xdc5b('0xce')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xcf'));db['ServicenowField']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xd0'));db[_0xdc5b('0xd1')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xd2'));db[_0xdc5b('0xd3')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xd4'));db[_0xdc5b('0xd5')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xd6'));db[_0xdc5b('0xd7')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xd8'));db[_0xdc5b('0xd9')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xda'));db['FreshsalesField']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xdb'));db[_0xdc5b('0xdc')]=db[_0xdc5b('0x1')]['import']('../api/integration/integration.model');db[_0xdc5b('0xdd')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/network/network.model');db[_0xdc5b('0xde')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xdf'));db[_0xdc5b('0xe0')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xe1'));db[_0xdc5b('0xe2')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xe3'));db[_0xdc5b('0xe4')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xdc5b('0xe5')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xe6'));db[_0xdc5b('0xe7')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xe8'));db[_0xdc5b('0xe9')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xea'));db['SquareDetailsReport']=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xdc5b('0xeb')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xec'));db[_0xdc5b('0xed')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xee'));db['SquareOdbc']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xef'));db[_0xdc5b('0xf0')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xf1'));db[_0xdc5b('0xf2')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0xf3'));db['SquareMessage']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xf4'));db[_0xdc5b('0xf5')]=db['sequelize']['import'](_0xdc5b('0xf6'));db[_0xdc5b('0xf7')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xf8'));db[_0xdc5b('0xf9')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0xfa'));db['Migration']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xfb'));db[_0xdc5b('0xfc')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xfd'));db[_0xdc5b('0xfe')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0xff'));db[_0xdc5b('0x100')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x101'));db[_0xdc5b('0x102')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x103'));db[_0xdc5b('0x104')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x105'));db[_0xdc5b('0x106')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x107'));db[_0xdc5b('0x108')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x109'));db['CmList']=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/cmList/cmList.model');db[_0xdc5b('0x10a')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x10b'));db[_0xdc5b('0x10c')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x10d'));db[_0xdc5b('0x10e')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x10f'));db[_0xdc5b('0x110')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/userNotification/userNotification.model');db[_0xdc5b('0x111')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x112'));db[_0xdc5b('0x113')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x114'));db[_0xdc5b('0x115')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db['WhatsappMessage']=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/whatsappMessage/whatsappMessage.model');db[_0xdc5b('0x116')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x117'));db[_0xdc5b('0x118')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xdc5b('0x119')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')](_0xdc5b('0x11a'));db[_0xdc5b('0x11b')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x11c'));db[_0xdc5b('0x11d')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x11e'));db[_0xdc5b('0x11f')]=db[_0xdc5b('0x1')][_0xdc5b('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0xdc5b('0x120')]=db['sequelize'][_0xdc5b('0x13')](_0xdc5b('0x121'));db[_0xdc5b('0x122')]=db['sequelize']['import'](_0xdc5b('0x123'));db[_0xdc5b('0x124')]=db[_0xdc5b('0x1')]['import'](_0xdc5b('0x125'));db[_0xdc5b('0x12')][_0xdc5b('0x126')](db[_0xdc5b('0x1e')],{'as':_0xdc5b('0x1e'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x126')](db[_0xdc5b('0x122')],{'as':'userSetting','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')]['hasMany'](db[_0xdc5b('0x1a')],{'as':_0xdc5b('0x129'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x2b')],{'as':_0xdc5b('0x12b'),'foreignKey':_0xdc5b('0x128')});db['User'][_0xdc5b('0x12a')](db[_0xdc5b('0x15')],{'as':'Extensions','onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x12')]['hasMany'](db[_0xdc5b('0x79')],{'as':'HopperFinals','foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db['CmHopperHistory'],{'as':_0xdc5b('0x12c'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')]['hasMany'](db[_0xdc5b('0x12d')],{'as':_0xdc5b('0x12d'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x5f')],{'as':'OpenchannelInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xdc5b('0x6a')],{'as':_0xdc5b('0x12e'),'foreignKey':_0xdc5b('0x128')});db['User'][_0xdc5b('0x12a')](db[_0xdc5b('0x57')],{'as':_0xdc5b('0x12f'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x130')],{'as':_0xdc5b('0x131'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x115')],{'as':_0xdc5b('0x132'),'foreignKey':'UserId'});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x110')],{'as':_0xdc5b('0x133'),'foreignKey':'SenderId'});db[_0xdc5b('0x12')][_0xdc5b('0x12a')](db[_0xdc5b('0x134')],{'as':'Hoppers','foreignKey':_0xdc5b('0x128'),'onDelete':_0xdc5b('0x135')});db['User'][_0xdc5b('0x136')](db[_0xdc5b('0x10c')],{'as':'UserProfile','foreignKey':_0xdc5b('0x137')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x139')],{'as':_0xdc5b('0x13a'),'through':'chat_group_has_users'});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db['CmContact'],{'as':'Contacts','through':'cm_user_has_contacts'});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x13c'),'through':_0xdc5b('0x13d')});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0xf5')],{'through':_0xdc5b('0x13e')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x130')],{'as':_0xdc5b('0x131'),'through':'user_has_mail_interactions'});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x6a')],{'as':'ChatInteractions','through':_0xdc5b('0x13f')});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x4d')],{'as':_0xdc5b('0x140'),'through':'user_has_fax_interactions'});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x57')],{'as':_0xdc5b('0x12f'),'through':_0xdc5b('0x141')});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x5f')],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x115')],{'as':_0xdc5b('0x132'),'through':_0xdc5b('0x142')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x143')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xdc5b('0x12')]['belongsToMany'](db['VoicePrefix'],{'as':_0xdc5b('0x144'),'through':_0xdc5b('0x120'),'required':![]});db[_0xdc5b('0x12')]['belongsToMany'](db[_0xdc5b('0x3f')],{'as':_0xdc5b('0x145'),'through':'UserMailQueue','required':![]});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x6f')],{'as':_0xdc5b('0x146'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User']['belongsToMany'](db[_0xdc5b('0x50')],{'as':'FaxQueues','through':_0xdc5b('0x33'),'required':![]});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x5a')],{'as':_0xdc5b('0x147'),'through':_0xdc5b('0x34'),'required':![]});db['User'][_0xdc5b('0x138')](db[_0xdc5b('0x63')],{'as':_0xdc5b('0x148'),'through':_0xdc5b('0x36'),'required':![]});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x119')],{'as':_0xdc5b('0x149'),'through':_0xdc5b('0x38'),'required':![]});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db['CmList'],{'through':'cm_user_has_lists'});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x65')],{'as':_0xdc5b('0x14a'),'through':_0xdc5b('0x14b')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db['FaxAccount'],{'as':_0xdc5b('0x14c'),'through':_0xdc5b('0x14d')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db['MailAccount'],{'as':_0xdc5b('0x14e'),'through':_0xdc5b('0x14f')});db[_0xdc5b('0x12')]['belongsToMany'](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':_0xdc5b('0x150')});db[_0xdc5b('0x12')][_0xdc5b('0x138')](db[_0xdc5b('0x54')],{'as':_0xdc5b('0x151'),'through':_0xdc5b('0x152')});db[_0xdc5b('0x12')]['belongsToMany'](db[_0xdc5b('0x111')],{'as':_0xdc5b('0x153'),'through':'user_has_whatsapp_accounts'});db[_0xdc5b('0x14')][_0xdc5b('0x12a')](db['VoiceExtension'],{'as':_0xdc5b('0x154'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0xdc5b('0x155')][_0xdc5b('0x12a')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0xdc5b('0x15')][_0xdc5b('0x12a')](db[_0xdc5b('0x15')],{'as':_0xdc5b('0x156'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x17')][_0xdc5b('0x138')](db['Sound'],{'as':_0xdc5b('0x157'),'through':_0xdc5b('0x158')});db[_0xdc5b('0x143')]['hasMany'](db[_0xdc5b('0x2b')],{'as':_0xdc5b('0x159'),'foreignKey':_0xdc5b('0x15a')});db['VoiceQueue'][_0xdc5b('0x12a')](db[_0xdc5b('0x134')],{'as':_0xdc5b('0x15b'),'foreignKey':'VoiceQueueId'});db[_0xdc5b('0x143')]['hasMany'](db[_0xdc5b('0x79')],{'as':'HopperFinals','foreignKey':_0xdc5b('0x15a')});db[_0xdc5b('0x143')][_0xdc5b('0x12a')](db['CmHopperHistory'],{'as':_0xdc5b('0x15c'),'foreignKey':'VoiceQueueId'});db[_0xdc5b('0x143')]['hasMany'](db[_0xdc5b('0x12d')],{'as':_0xdc5b('0x12d'),'foreignKey':_0xdc5b('0x15a')});db[_0xdc5b('0x143')][_0xdc5b('0x12a')](db[_0xdc5b('0x15d')],{'as':_0xdc5b('0x15e'),'foreignKey':_0xdc5b('0x15a')});db[_0xdc5b('0x143')]['hasMany'](db[_0xdc5b('0xe5')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db[_0xdc5b('0x143')]['belongsTo'](db[_0xdc5b('0x28')],{'as':_0xdc5b('0x28'),'foreignKey':_0xdc5b('0x15f')});db[_0xdc5b('0x143')][_0xdc5b('0x136')](db[_0xdc5b('0x28')],{'as':_0xdc5b('0x160'),'foreignKey':'TrunkBackupId'});db[_0xdc5b('0x143')][_0xdc5b('0x136')](db['Interval'],{'as':'Interval','foreignKey':_0xdc5b('0x161')});db[_0xdc5b('0x143')]['belongsTo'](db[_0xdc5b('0x85')],{'as':_0xdc5b('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xdc5b('0x143')][_0xdc5b('0x138')](db[_0xdc5b('0x13b')],{'as':'Lists','through':_0xdc5b('0x163')});db[_0xdc5b('0x143')]['belongsToMany'](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x2d')});db[_0xdc5b('0x143')][_0xdc5b('0x138')](db['Team'],{'as':_0xdc5b('0x165'),'through':_0xdc5b('0x11d')});db[_0xdc5b('0x143')][_0xdc5b('0x138')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x166'),'through':_0xdc5b('0x167')});db[_0xdc5b('0x1a')][_0xdc5b('0x136')](db['User'],{'as':_0xdc5b('0x12'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x1c')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x12'),'foreignKey':'UserId'});db[_0xdc5b('0x1e')][_0xdc5b('0x12a')](db[_0xdc5b('0x20')],{'as':_0xdc5b('0x168'),'onDelete':_0xdc5b('0x127'),'foreignKey':'mailboxuser','sourceKey':_0xdc5b('0x169')});db[_0xdc5b('0x20')][_0xdc5b('0x136')](db[_0xdc5b('0x1e')],{'foreignKey':_0xdc5b('0x16a'),'targetKey':'mailbox'});db['VoiceCallReport']['hasMany'](db[_0xdc5b('0x26')],{'as':_0xdc5b('0x16b'),'foreignKey':_0xdc5b('0x16c'),'constraints':![]});db[_0xdc5b('0x16d')][_0xdc5b('0x12a')](db[_0xdc5b('0x24')],{'as':_0xdc5b('0x16e'),'foreignKey':_0xdc5b('0x16c'),'constraints':![]});db[_0xdc5b('0x16d')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':'User','foreignKey':'UserId'});db['VoiceCallReport']['belongsTo'](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x170')});db['MailServerIn'][_0xdc5b('0x136')](db[_0xdc5b('0x3d')],{'as':_0xdc5b('0x3d'),'foreignKey':_0xdc5b('0x171')});db[_0xdc5b('0x3a')]['belongsTo'](db[_0xdc5b('0x11b')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x173')][_0xdc5b('0x136')](db[_0xdc5b('0x3d')],{'as':_0xdc5b('0x3d'),'foreignKey':'MailAccountId'});db['MailServerOut'][_0xdc5b('0x136')](db[_0xdc5b('0x11b')],{'as':_0xdc5b('0x11b'),'foreignKey':'CloudProviderId','onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x3d')][_0xdc5b('0x126')](db[_0xdc5b('0x3a')],{'as':'Imap','onDelete':_0xdc5b('0x127')});db['MailAccount'][_0xdc5b('0x126')](db[_0xdc5b('0x173')],{'as':_0xdc5b('0x174'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x3d')][_0xdc5b('0x12a')](db[_0xdc5b('0x80')],{'as':_0xdc5b('0x175'),'foreignKey':_0xdc5b('0x171'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x3d')][_0xdc5b('0x12a')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xdc5b('0x171')});db[_0xdc5b('0x3d')]['hasMany'](db[_0xdc5b('0x42')],{'as':_0xdc5b('0x168'),'foreignKey':_0xdc5b('0x171')});db[_0xdc5b('0x3d')][_0xdc5b('0x12a')](db[_0xdc5b('0x130')],{'as':_0xdc5b('0x176')});db[_0xdc5b('0x3d')][_0xdc5b('0x12a')](db['MailApplication'],{'as':'Applications','foreignKey':_0xdc5b('0x171'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x3d')][_0xdc5b('0x136')](db['CmList'],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x3d')]['belongsTo'](db[_0xdc5b('0x94')],{'as':_0xdc5b('0x94'),'foreignKey':_0xdc5b('0x179')});db[_0xdc5b('0x3d')]['belongsTo'](db[_0xdc5b('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xdc5b('0x17a')});db[_0xdc5b('0x3d')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x14f')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x31')});db[_0xdc5b('0x3f')][_0xdc5b('0x138')](db[_0xdc5b('0xf5')],{'through':_0xdc5b('0x17b'),'as':_0xdc5b('0x165')});db[_0xdc5b('0x130')][_0xdc5b('0x12a')](db['MailMessage'],{'as':_0xdc5b('0x168'),'onDelete':'cascade','foreignKey':_0xdc5b('0x17c')});db['MailInteraction'][_0xdc5b('0x136')](db['MailAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':'MailAccountId'});db[_0xdc5b('0x130')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x130')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x17e'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x130')]['belongsToMany'](db[_0xdc5b('0x8d')],{'through':'mail_interaction_has_tags','as':_0xdc5b('0x17f')});db[_0xdc5b('0x130')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x180'),'as':_0xdc5b('0x181')});db['MailInteraction'][_0xdc5b('0x138')](db['User'],{'as':_0xdc5b('0x182'),'through':_0xdc5b('0x183'),'foreignKey':'MailInteractionId'});db[_0xdc5b('0x42')]['hasMany'](db[_0xdc5b('0xfc')],{'as':_0xdc5b('0x184'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x42')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x12')});db[_0xdc5b('0x42')]['belongsTo'](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f')});db['MailMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x130')],{'as':_0xdc5b('0x185'),'foreignKey':_0xdc5b('0x17c')});db['MailMessage'][_0xdc5b('0x136')](db['MailAccount'],{'as':'Account','foreignKey':_0xdc5b('0x171')});db[_0xdc5b('0x42')][_0xdc5b('0x136')](db[_0xdc5b('0x65')],{'as':_0xdc5b('0x65'),'foreignKey':_0xdc5b('0x186')});db[_0xdc5b('0x42')][_0xdc5b('0x136')](db[_0xdc5b('0x6d')],{'as':_0xdc5b('0x6d'),'foreignKey':_0xdc5b('0x187')});db[_0xdc5b('0x44')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x44')]['belongsTo'](db[_0xdc5b('0x3f')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x44')]['belongsTo'](db['MailAccount'],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x44')][_0xdc5b('0x136')](db[_0xdc5b('0x83')],{'onDelete':'restrict','foreignKey':_0xdc5b('0x161')});db[_0xdc5b('0x44')][_0xdc5b('0x136')](db[_0xdc5b('0x8d')],{'onDelete':'restrict','foreignKey':_0xdc5b('0x188')});db[_0xdc5b('0x189')][_0xdc5b('0x136')](db[_0xdc5b('0x3d')],{});db['MailQueueReport'][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x189')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':'Contact','foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x189')]['belongsTo'](db[_0xdc5b('0x130')],{});db[_0xdc5b('0x189')][_0xdc5b('0x136')](db[_0xdc5b('0x42')],{});db[_0xdc5b('0x189')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{});db[_0xdc5b('0x189')][_0xdc5b('0x136')](db['MailQueue'],{});db[_0xdc5b('0x47')][_0xdc5b('0x12a')](db[_0xdc5b('0x18a')],{'as':'Items','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x49')][_0xdc5b('0x12a')](db['Disposition'],{'as':_0xdc5b('0x175'),'foreignKey':_0xdc5b('0x18b'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x49')]['hasMany'](db[_0xdc5b('0x18c')],{'as':_0xdc5b('0x18d'),'foreignKey':_0xdc5b('0x18b')});db['FaxAccount'][_0xdc5b('0x12a')](db[_0xdc5b('0x4d')],{'as':'Interactions'});db[_0xdc5b('0x49')]['hasMany'](db[_0xdc5b('0x4b')],{'as':_0xdc5b('0x156'),'foreignKey':'FaxAccountId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x49')][_0xdc5b('0x12a')](db[_0xdc5b('0x15')],{'as':_0xdc5b('0x18e'),'onDelete':'cascade'});db[_0xdc5b('0x49')][_0xdc5b('0x12a')](db[_0xdc5b('0x4e')],{'as':_0xdc5b('0x168')});db[_0xdc5b('0x49')][_0xdc5b('0x136')](db[_0xdc5b('0x28')],{'as':'Trunk'});db[_0xdc5b('0x49')][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x49')][_0xdc5b('0x136')](db[_0xdc5b('0x85')],{'as':'mandatoryDispositionPause','foreignKey':_0xdc5b('0x17a')});db['FaxAccount'][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x14d')});db['FaxApplication'][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x4b')]['belongsTo'](db[_0xdc5b('0x50')],{'onDelete':'restrict'});db[_0xdc5b('0x4b')]['belongsTo'](db[_0xdc5b('0x49')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x4b')][_0xdc5b('0x136')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xdc5b('0x4d')][_0xdc5b('0x12a')](db[_0xdc5b('0x4e')],{'as':_0xdc5b('0x168'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x18f')});db[_0xdc5b('0x4d')][_0xdc5b('0x136')](db[_0xdc5b('0x49')],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x18b')});db[_0xdc5b('0x4d')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':'Contact','foreignKey':_0xdc5b('0x170')});db['FaxInteraction'][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':'Owner','foreignKey':_0xdc5b('0x128')});db['FaxInteraction'][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x190'),'as':_0xdc5b('0x17f')});db[_0xdc5b('0x4d')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x190'),'as':_0xdc5b('0x181')});db[_0xdc5b('0x4d')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':'Users','through':_0xdc5b('0x191'),'foreignKey':_0xdc5b('0x18f')});db[_0xdc5b('0x4e')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':'cascade','as':_0xdc5b('0x12')});db[_0xdc5b('0x4e')][_0xdc5b('0x136')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xdc5b('0x18f')});db['FaxMessage']['belongsTo'](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f')});db[_0xdc5b('0x4e')][_0xdc5b('0x136')](db[_0xdc5b('0xfc')],{'as':_0xdc5b('0xfc'),'foreignKey':_0xdc5b('0x192')});db[_0xdc5b('0x4e')][_0xdc5b('0x136')](db['FaxAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x18b')});db[_0xdc5b('0x50')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x33')});db[_0xdc5b('0x50')]['belongsToMany'](db[_0xdc5b('0xf5')],{'through':'team_has_fax_queues','as':_0xdc5b('0x165')});db['FaxQueueReport'][_0xdc5b('0x136')](db['FaxAccount'],{});db[_0xdc5b('0x52')]['belongsTo'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db['FaxQueueReport']['belongsTo'](db['CmContact'],{'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x52')][_0xdc5b('0x136')](db[_0xdc5b('0x4d')],{});db[_0xdc5b('0x52')][_0xdc5b('0x136')](db[_0xdc5b('0x4e')],{});db[_0xdc5b('0x52')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{});db['FaxQueueReport'][_0xdc5b('0x136')](db[_0xdc5b('0x50')],{});db[_0xdc5b('0x54')]['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xdc5b('0x193'),'onDelete':'cascade'});db[_0xdc5b('0x54')][_0xdc5b('0x12a')](db[_0xdc5b('0x18c')],{'as':'Answers','foreignKey':_0xdc5b('0x193')});db[_0xdc5b('0x54')]['hasMany'](db['SmsMessage'],{'as':_0xdc5b('0x168'),'foreignKey':_0xdc5b('0x193')});db[_0xdc5b('0x54')][_0xdc5b('0x12a')](db[_0xdc5b('0x57')],{'as':_0xdc5b('0x176')});db['SmsAccount']['hasMany'](db[_0xdc5b('0x56')],{'as':_0xdc5b('0x156'),'foreignKey':_0xdc5b('0x193'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x54')][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':'List','foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x54')][_0xdc5b('0x136')](db[_0xdc5b('0x85')],{'as':_0xdc5b('0x162'),'foreignKey':_0xdc5b('0x17a')});db[_0xdc5b('0x54')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':'user_has_sms_accounts'});db[_0xdc5b('0x56')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x56')][_0xdc5b('0x136')](db[_0xdc5b('0x5a')],{'onDelete':_0xdc5b('0x172')});db['SmsApplication'][_0xdc5b('0x136')](db[_0xdc5b('0x54')],{'onDelete':_0xdc5b('0x172')});db['SmsApplication'][_0xdc5b('0x136')](db['Interval'],{'onDelete':_0xdc5b('0x172'),'foreignKey':'IntervalId'});db[_0xdc5b('0x56')][_0xdc5b('0x136')](db[_0xdc5b('0x8d')],{'onDelete':_0xdc5b('0x172'),'foreignKey':'TagId'});db[_0xdc5b('0x57')][_0xdc5b('0x12a')](db[_0xdc5b('0x194')],{'as':'Messages','onDelete':_0xdc5b('0x127'),'foreignKey':'SmsInteractionId'});db[_0xdc5b('0x57')][_0xdc5b('0x136')](db[_0xdc5b('0x54')],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x193')});db[_0xdc5b('0x57')][_0xdc5b('0x136')](db['CmContact'],{'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x57')][_0xdc5b('0x136')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xdc5b('0x57')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x195'),'as':_0xdc5b('0x17f')});db[_0xdc5b('0x57')]['belongsToMany'](db['Tag'],{'through':_0xdc5b('0x195'),'as':_0xdc5b('0x181')});db[_0xdc5b('0x57')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x182'),'through':_0xdc5b('0x141'),'foreignKey':_0xdc5b('0x196')});db[_0xdc5b('0x194')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x12')});db[_0xdc5b('0x194')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f')});db[_0xdc5b('0x194')][_0xdc5b('0x136')](db[_0xdc5b('0x57')],{'onDelete':'cascade','as':_0xdc5b('0x185'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xdc5b('0x136')](db['SmsAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x193')});db[_0xdc5b('0x5a')]['belongsToMany'](db['User'],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x34'),'foreignKey':_0xdc5b('0x197')});db[_0xdc5b('0x5a')]['belongsToMany'](db['Team'],{'through':_0xdc5b('0x198'),'as':_0xdc5b('0x165')});db[_0xdc5b('0x199')][_0xdc5b('0x12a')](db[_0xdc5b('0x80')],{'as':_0xdc5b('0x175'),'foreignKey':_0xdc5b('0x19a'),'onDelete':_0xdc5b('0x127')});db['OpenchannelAccount'][_0xdc5b('0x12a')](db[_0xdc5b('0x18c')],{'as':_0xdc5b('0x18d'),'foreignKey':_0xdc5b('0x19a')});db[_0xdc5b('0x199')][_0xdc5b('0x12a')](db[_0xdc5b('0x5f')],{'as':'Interactions','foreignKey':'OpenchannelAccountId'});db[_0xdc5b('0x199')][_0xdc5b('0x12a')](db[_0xdc5b('0x61')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0xdc5b('0x199')]['hasMany'](db['OpenchannelApplication'],{'as':_0xdc5b('0x156'),'foreignKey':_0xdc5b('0x19a'),'onDelete':_0xdc5b('0x127')});db['OpenchannelAccount']['belongsTo'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0xdc5b('0x136')](db['Pause'],{'as':_0xdc5b('0x162'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xdc5b('0x199')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x150')});db[_0xdc5b('0x5d')]['belongsTo'](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x5d')][_0xdc5b('0x136')](db[_0xdc5b('0x63')],{'onDelete':_0xdc5b('0x172'),'foreignKey':_0xdc5b('0x19b')});db['OpenchannelApplication'][_0xdc5b('0x136')](db['OpenchannelAccount'],{'onDelete':_0xdc5b('0x172'),'foreignKey':'OpenchannelAccountId'});db[_0xdc5b('0x5d')][_0xdc5b('0x136')](db[_0xdc5b('0x83')],{'onDelete':'restrict','foreignKey':_0xdc5b('0x161')});db['OpenchannelApplication']['belongsTo'](db['Tag'],{'onDelete':_0xdc5b('0x172'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0xdc5b('0x12a')](db[_0xdc5b('0x61')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0xdc5b('0x5f')][_0xdc5b('0x136')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xdc5b('0x19a')});db[_0xdc5b('0x5f')][_0xdc5b('0x136')](db['CmContact'],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x5f')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x17e'),'foreignKey':'UserId'});db[_0xdc5b('0x5f')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':'openchannel_interaction_has_tags','as':_0xdc5b('0x17f')});db[_0xdc5b('0x5f')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x19c'),'as':'ThroughTags'});db[_0xdc5b('0x5f')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0xdc5b('0x61')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':'cascade','as':_0xdc5b('0x12')});db['OpenchannelMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f')});db[_0xdc5b('0x61')][_0xdc5b('0x136')](db['OpenchannelInteraction'],{'onDelete':_0xdc5b('0x127'),'as':'Interaction','foreignKey':_0xdc5b('0x19d')});db[_0xdc5b('0x61')][_0xdc5b('0x136')](db[_0xdc5b('0xfc')],{'as':_0xdc5b('0xfc'),'foreignKey':_0xdc5b('0x192')});db[_0xdc5b('0x61')]['belongsTo'](db['OpenchannelAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x19a')});db['OpenchannelQueue']['belongsToMany'](db['User'],{'as':_0xdc5b('0x164'),'through':'UserOpenchannelQueue','foreignKey':_0xdc5b('0x19b')});db[_0xdc5b('0x63')][_0xdc5b('0x138')](db[_0xdc5b('0xf5')],{'through':_0xdc5b('0x19e'),'as':_0xdc5b('0x165')});db['ChatWebsite'][_0xdc5b('0x12a')](db['Disposition'],{'as':_0xdc5b('0x175'),'foreignKey':_0xdc5b('0x186'),'onDelete':'cascade'});db['ChatWebsite'][_0xdc5b('0x12a')](db[_0xdc5b('0x18c')],{'as':'Answers','foreignKey':_0xdc5b('0x186')});db[_0xdc5b('0x65')][_0xdc5b('0x12a')](db[_0xdc5b('0x71')],{'as':_0xdc5b('0x19f')});db[_0xdc5b('0x65')][_0xdc5b('0x12a')](db[_0xdc5b('0x6a')],{'as':_0xdc5b('0x176')});db[_0xdc5b('0x65')][_0xdc5b('0x12a')](db[_0xdc5b('0x1a0')],{'as':_0xdc5b('0x156'),'foreignKey':_0xdc5b('0x186'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x65')][_0xdc5b('0x12a')](db[_0xdc5b('0x6c')],{'as':_0xdc5b('0x168')});db[_0xdc5b('0x65')][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x65')][_0xdc5b('0x136')](db[_0xdc5b('0x83')],{'as':_0xdc5b('0x83'),'foreignKey':'IntervalId'});db[_0xdc5b('0x65')]['belongsTo'](db['MailAccount'],{'as':_0xdc5b('0x3d'),'foreignKey':_0xdc5b('0x171')});db['ChatWebsite'][_0xdc5b('0x136')](db[_0xdc5b('0x85')],{'as':_0xdc5b('0x162'),'foreignKey':_0xdc5b('0x17a')});db[_0xdc5b('0x65')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xdc5b('0x67')][_0xdc5b('0x136')](db[_0xdc5b('0x199')],{});db[_0xdc5b('0x67')][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x67')]['belongsTo'](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x67')][_0xdc5b('0x136')](db[_0xdc5b('0x5f')],{});db['OpenchannelQueueReport'][_0xdc5b('0x136')](db[_0xdc5b('0x61')],{});db[_0xdc5b('0x67')]['belongsTo'](db[_0xdc5b('0x12')],{});db[_0xdc5b('0x67')][_0xdc5b('0x136')](db['OpenchannelQueue'],{});db[_0xdc5b('0x1a0')][_0xdc5b('0x136')](db['User'],{'as':_0xdc5b('0x1a1'),'foreignKey':_0xdc5b('0x128'),'onDelete':_0xdc5b('0x172')});db['ChatApplication'][_0xdc5b('0x136')](db[_0xdc5b('0x6f')],{'as':_0xdc5b('0x1a2'),'foreignKey':_0xdc5b('0x1a3'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x1a0')][_0xdc5b('0x136')](db['ChatWebsite'],{'as':_0xdc5b('0x1a4'),'foreignKey':'ChatWebsiteId','onDelete':_0xdc5b('0x172')});db['ChatApplication'][_0xdc5b('0x136')](db[_0xdc5b('0x8d')],{'onDelete':_0xdc5b('0x172'),'foreignKey':'TagId'});db[_0xdc5b('0x6a')][_0xdc5b('0x12a')](db[_0xdc5b('0x6c')],{'as':'Messages','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1a5')});db[_0xdc5b('0x6a')][_0xdc5b('0x136')](db[_0xdc5b('0x65')],{'as':_0xdc5b('0x17d'),'foreignKey':'ChatWebsiteId'});db[_0xdc5b('0x6a')]['belongsTo'](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x6a')][_0xdc5b('0x136')](db['User'],{'as':_0xdc5b('0x17e'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x6a')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':'chat_interaction_has_tags','as':_0xdc5b('0x17f')});db['ChatInteraction']['belongsToMany'](db[_0xdc5b('0x8d')],{'through':'chat_interaction_has_tags','as':_0xdc5b('0x181')});db[_0xdc5b('0x6a')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x182'),'through':_0xdc5b('0x13f'),'foreignKey':_0xdc5b('0x1a5')});db['ChatMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x12')});db[_0xdc5b('0x6c')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x170')});db['ChatMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x6a')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x185'),'foreignKey':_0xdc5b('0x1a5')});db[_0xdc5b('0x6c')]['belongsTo'](db[_0xdc5b('0xfc')],{'as':_0xdc5b('0xfc'),'foreignKey':'AttachmentId'});db[_0xdc5b('0x6c')]['belongsTo'](db[_0xdc5b('0x65')],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x186')});db[_0xdc5b('0x6d')][_0xdc5b('0x12a')](db[_0xdc5b('0xfc')],{'as':_0xdc5b('0x184'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x6d')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'onDelete':_0xdc5b('0x127'),'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x6d')][_0xdc5b('0x136')](db['ChatWebsite'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x186')});db['ChatQueue'][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xdc5b('0x138')](db[_0xdc5b('0xf5')],{'through':_0xdc5b('0x1a6'),'as':'Teams'});db[_0xdc5b('0x139')][_0xdc5b('0x12a')](db['ChatInternalMessage'],{'as':_0xdc5b('0x168'),'foreignKey':_0xdc5b('0x1a7'),'onDelete':_0xdc5b('0x127')});db['ChatGroup']['belongsToMany'](db['User'],{'as':'Members','through':_0xdc5b('0x1a8')});db['ChatProactiveAction'][_0xdc5b('0x136')](db[_0xdc5b('0x65')],{'as':_0xdc5b('0x1a4'),'foreignKey':_0xdc5b('0x186')});db['CmCompany'][_0xdc5b('0x12a')](db['CmContact'],{'as':_0xdc5b('0x1a9'),'foreignKey':_0xdc5b('0x1aa')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0x91')],{'as':'Phones','foreignKey':'CmContactId'});db[_0xdc5b('0x75')]['hasMany'](db[_0xdc5b('0x134')],{'as':_0xdc5b('0x15b'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0x12d')],{'as':_0xdc5b('0x12d'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0xe5')],{'as':_0xdc5b('0x1ab'),'foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0xdc5b('0x170'),'onDelete':_0xdc5b('0x172')});db['CmContact']['hasMany'](db[_0xdc5b('0x6a')],{'as':_0xdc5b('0x12e'),'foreignKey':_0xdc5b('0x170'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x75')]['hasMany'](db[_0xdc5b('0x57')],{'as':_0xdc5b('0x12f'),'foreignKey':_0xdc5b('0x170'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0x4d')],{'as':'FaxInteractions','foreignKey':_0xdc5b('0x170'),'onDelete':'restrict'});db[_0xdc5b('0x75')][_0xdc5b('0x12a')](db[_0xdc5b('0x130')],{'as':_0xdc5b('0x131'),'foreignKey':_0xdc5b('0x170'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x75')][_0xdc5b('0x136')](db['CmCompany'],{'as':_0xdc5b('0x1ac'),'foreignKey':_0xdc5b('0x1aa')});db[_0xdc5b('0x75')][_0xdc5b('0x136')](db['CmList'],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178'),'onDelete':_0xdc5b('0x127')});db['CmContact']['belongsToMany'](db['User'],{'as':_0xdc5b('0x182'),'through':_0xdc5b('0x1ad')});db[_0xdc5b('0x75')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'as':'Tags','through':_0xdc5b('0x1ae')});db[_0xdc5b('0x75')]['belongsToMany'](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x1ae'),'as':_0xdc5b('0x181')});db['CmHopper'][_0xdc5b('0x12a')](db[_0xdc5b('0x92')],{'as':_0xdc5b('0x1af'),'foreignKey':_0xdc5b('0x1b0')});db[_0xdc5b('0x134')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x134')]['belongsTo'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x134')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':'Agent','foreignKey':_0xdc5b('0x128')});db['CmHopper'][_0xdc5b('0x136')](db[_0xdc5b('0x143')],{'as':_0xdc5b('0x1a2'),'foreignKey':_0xdc5b('0x15a'),'onDelete':_0xdc5b('0x127')});db['CmHopper']['belongsTo'](db[_0xdc5b('0xf9')],{'as':_0xdc5b('0xf9'),'foreignKey':_0xdc5b('0x1b1'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x134')][_0xdc5b('0x136')](db['User'],{'as':_0xdc5b('0x17e'),'foreignKey':_0xdc5b('0x1b2')});db[_0xdc5b('0x15d')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xdc5b('0x127')});db['CmHopperBlack'][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack'][_0xdc5b('0x136')](db[_0xdc5b('0x143')],{'as':_0xdc5b('0x1a2'),'foreignKey':_0xdc5b('0x15a'),'onDelete':_0xdc5b('0x127')});db['CmHopperBlack']['belongsTo'](db['Campaign'],{'as':_0xdc5b('0xf9'),'foreignKey':'CampaignId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x1b3')]['hasMany'](db[_0xdc5b('0x1b4')],{'as':{'plural':'All','singular':_0xdc5b('0x1b5')},'foreignKey':_0xdc5b('0x1b6'),'onDelete':'cascade','hooks':!![]});db[_0xdc5b('0x1b3')][_0xdc5b('0x12a')](db[_0xdc5b('0x1b4')],{'as':{'plural':_0xdc5b('0x1b7'),'singular':_0xdc5b('0x1b8')},'foreignKey':'AutomationAnyId','onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x1b3')][_0xdc5b('0x12a')](db['Action'],{'as':'Actions','foreignKey':_0xdc5b('0x1b9'),'onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x80')]['hasMany'](db[_0xdc5b('0x80')],{'as':_0xdc5b('0x175'),'foreignKey':_0xdc5b('0x1ba'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x83')][_0xdc5b('0x12a')](db[_0xdc5b('0x83')],{'as':_0xdc5b('0x1bb'),'foreignKey':_0xdc5b('0x161'),'onDelete':_0xdc5b('0x127'),'hooks':!![],'required':![]});db[_0xdc5b('0x83')][_0xdc5b('0x12a')](db[_0xdc5b('0x15')],{'as':_0xdc5b('0x1bc'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0xdc5b('0x12a')](db[_0xdc5b('0x44')],{'as':'MailApplications','foreignKey':_0xdc5b('0x161')});db[_0xdc5b('0x83')]['hasMany'](db[_0xdc5b('0x1a0')],{'as':_0xdc5b('0x1bd'),'foreignKey':'IntervalId'});db[_0xdc5b('0x83')]['hasMany'](db['FaxApplication'],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0xdc5b('0x83')][_0xdc5b('0x12a')](db[_0xdc5b('0x56')],{'as':_0xdc5b('0x1be'),'foreignKey':'IntervalId'});db[_0xdc5b('0x1bf')]['belongsTo'](db['MailAccount'],{});db['Schedule'][_0xdc5b('0x136')](db[_0xdc5b('0x9e')],{'foreignKey':_0xdc5b('0x1c0')});db['Schedule'][_0xdc5b('0x136')](db[_0xdc5b('0x9c')],{'foreignKey':'CustomReportId'});db[_0xdc5b('0x8b')][_0xdc5b('0x138')](db[_0xdc5b('0x17')],{'as':_0xdc5b('0x1c1'),'through':_0xdc5b('0x158'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x8d')][_0xdc5b('0x138')](db[_0xdc5b('0x75')],{'through':_0xdc5b('0x1ae')});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xdc5b('0x8d')]['belongsToMany'](db[_0xdc5b('0x130')],{'through':_0xdc5b('0x180')});db[_0xdc5b('0x8d')][_0xdc5b('0x138')](db['SmsInteraction'],{'through':_0xdc5b('0x195')});db[_0xdc5b('0x8d')][_0xdc5b('0x138')](db[_0xdc5b('0x4d')],{'through':'fax_interaction_has_tags'});db[_0xdc5b('0x8d')][_0xdc5b('0x138')](db['OpenchannelInteraction'],{'through':_0xdc5b('0x19c')});db[_0xdc5b('0x8d')]['belongsToMany'](db[_0xdc5b('0x115')],{'through':_0xdc5b('0x1c2')});db[_0xdc5b('0x91')]['belongsTo'](db[_0xdc5b('0x8f')],{'as':'ItemType','foreignKey':_0xdc5b('0x1c3')});db[_0xdc5b('0x92')][_0xdc5b('0x136')](db[_0xdc5b('0x134')],{'as':_0xdc5b('0x1c4'),'foreignKey':_0xdc5b('0x1b0')});db[_0xdc5b('0x91')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':_0xdc5b('0x1c5')});db['Trigger'][_0xdc5b('0x12a')](db[_0xdc5b('0x1b4')],{'as':{'plural':_0xdc5b('0x1c6'),'singular':_0xdc5b('0x1c7')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0xdc5b('0x96')][_0xdc5b('0x12a')](db[_0xdc5b('0x1b4')],{'as':{'plural':_0xdc5b('0x1c8'),'singular':_0xdc5b('0x1c9')},'foreignKey':_0xdc5b('0x1ca'),'onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x96')][_0xdc5b('0x12a')](db[_0xdc5b('0x7e')],{'as':_0xdc5b('0x1cb'),'foreignKey':_0xdc5b('0x1cc'),'onDelete':_0xdc5b('0x127'),'hooks':!![]});db[_0xdc5b('0x9c')][_0xdc5b('0x12a')](db[_0xdc5b('0xa3')],{'as':_0xdc5b('0x1cd'),'onDelete':'cascade','foreignKey':_0xdc5b('0x1ce'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xdc5b('0xa3')],{'as':'Fields','onDelete':'cascade','foreignKey':'DefaultReportId'});db['AnalyticMetric'][_0xdc5b('0x12a')](db['AnalyticFieldReport'],{'as':_0xdc5b('0x1cd'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1cf')});db[_0xdc5b('0xa3')][_0xdc5b('0x136')](db['AnalyticMetric'],{'foreignKey':_0xdc5b('0x1cf')});db[_0xdc5b('0xa7')][_0xdc5b('0x12a')](db['SalesforceConfiguration'],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0xab')],{'as':_0xdc5b('0x1d1'),'onDelete':_0xdc5b('0x127'),'foreignKey':'SubjectId'});db[_0xdc5b('0xa9')][_0xdc5b('0x12a')](db[_0xdc5b('0xab')],{'as':'Descriptions','onDelete':_0xdc5b('0x127'),'foreignKey':'DescriptionId'});db[_0xdc5b('0xa9')][_0xdc5b('0x12a')](db[_0xdc5b('0xab')],{'as':_0xdc5b('0x1cd'),'onDelete':_0xdc5b('0x127'),'foreignKey':'FieldId'});db[_0xdc5b('0xa9')][_0xdc5b('0x136')](db[_0xdc5b('0xa7')],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xab')][_0xdc5b('0x12a')](db['SalesforceField'],{'as':_0xdc5b('0x1d3'),'foreignKey':'SubjectId'});db[_0xdc5b('0xab')]['hasMany'](db[_0xdc5b('0xab')],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db['SalesforceField']['hasMany'](db[_0xdc5b('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0xdc5b('0xab')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xad')]['hasMany'](db[_0xdc5b('0xaf')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':'AccountId'});db[_0xdc5b('0xaf')]['hasMany'](db['SugarcrmField'],{'as':_0xdc5b('0x1d1'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xaf')][_0xdc5b('0x12a')](db[_0xdc5b('0xb1')],{'as':_0xdc5b('0x1d8'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xaf')][_0xdc5b('0x12a')](db[_0xdc5b('0xb1')],{'as':_0xdc5b('0x1cd'),'onDelete':'cascade','foreignKey':_0xdc5b('0x1d9')});db['SugarcrmConfiguration'][_0xdc5b('0x136')](db[_0xdc5b('0xad')],{'as':_0xdc5b('0x17d'),'foreignKey':'AccountId'});db[_0xdc5b('0xb1')][_0xdc5b('0x12a')](db['SugarcrmField'],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xb1')][_0xdc5b('0x12a')](db[_0xdc5b('0xb1')],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xb1')][_0xdc5b('0x12a')](db[_0xdc5b('0xb1')],{'as':_0xdc5b('0x1da'),'foreignKey':_0xdc5b('0x1d9')});db['SugarcrmField'][_0xdc5b('0x136')](db[_0xdc5b('0x98')],{'as':_0xdc5b('0x98'),'foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xb3')][_0xdc5b('0x12a')](db[_0xdc5b('0xb5')],{'as':'Configurations','onDelete':_0xdc5b('0x127'),'foreignKey':'AccountId'});db[_0xdc5b('0xb5')][_0xdc5b('0x12a')](db['DeskField'],{'as':_0xdc5b('0x1d1'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xb5')]['hasMany'](db[_0xdc5b('0xb7')],{'as':_0xdc5b('0x1d8'),'onDelete':_0xdc5b('0x127'),'foreignKey':'DescriptionId'});db[_0xdc5b('0xb5')][_0xdc5b('0x12a')](db[_0xdc5b('0xb7')],{'as':'Fields','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0xb5')][_0xdc5b('0x136')](db[_0xdc5b('0xb3')],{'as':'Account','foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xb5')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x1db')});db[_0xdc5b('0xb7')][_0xdc5b('0x12a')](db['DeskField'],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db['DeskField'][_0xdc5b('0x12a')](db['DeskField'],{'as':_0xdc5b('0x1da'),'foreignKey':'FieldId'});db['DeskField'][_0xdc5b('0x136')](db[_0xdc5b('0x98')],{'as':_0xdc5b('0x98'),'foreignKey':'VariableId'});db[_0xdc5b('0x1dc')][_0xdc5b('0x12a')](db[_0xdc5b('0x1dd')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db['ZohoConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0x1de')],{'as':'Subjects','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0x1dd')][_0xdc5b('0x12a')](db[_0xdc5b('0x1de')],{'as':_0xdc5b('0x1d8'),'onDelete':_0xdc5b('0x127'),'foreignKey':'DescriptionId'});db['ZohoConfiguration']['hasMany'](db[_0xdc5b('0x1de')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xdc5b('0x1dd')][_0xdc5b('0x136')](db[_0xdc5b('0x1dc')],{'as':'Account','foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0x1de')][_0xdc5b('0x12a')](db['ZohoField'],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0x1de')][_0xdc5b('0x12a')](db[_0xdc5b('0x1de')],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db['ZohoField'][_0xdc5b('0x12a')](db['ZohoField'],{'as':'Field','foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0x1de')][_0xdc5b('0x136')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xdc5b('0x1df')][_0xdc5b('0x12a')](db[_0xdc5b('0xbd')],{'as':'Configurations','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db['ZendeskConfiguration']['hasMany'](db[_0xdc5b('0xbf')],{'as':_0xdc5b('0x1d1'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xbd')][_0xdc5b('0x12a')](db['ZendeskField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xdc5b('0xbd')][_0xdc5b('0x12a')](db[_0xdc5b('0xbf')],{'as':_0xdc5b('0x1cd'),'foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0xbd')]['belongsTo'](db['ZendeskAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xbd')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x1e0')});db[_0xdc5b('0xbf')][_0xdc5b('0x12a')](db['ZendeskField'],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xbf')][_0xdc5b('0x12a')](db[_0xdc5b('0xbf')],{'as':'Description','foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xbf')]['hasMany'](db[_0xdc5b('0xbf')],{'as':_0xdc5b('0x1da'),'foreignKey':'FieldId'});db[_0xdc5b('0xbf')][_0xdc5b('0x136')](db[_0xdc5b('0x98')],{'as':_0xdc5b('0x98'),'foreignKey':'VariableId'});db[_0xdc5b('0xc1')]['hasMany'](db[_0xdc5b('0xc3')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xc3')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e1')],{'as':_0xdc5b('0x1d1'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d7')});db['FreshdeskConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0x1e1')],{'as':_0xdc5b('0x1d8'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d5')});db['FreshdeskConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0x1e1')],{'as':_0xdc5b('0x1cd'),'onDelete':'cascade','foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0xc3')][_0xdc5b('0x136')](db['FreshdeskAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xc3')][_0xdc5b('0x138')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0xdc5b('0x1e1')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e1')],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0x1e1')]['hasMany'](db[_0xdc5b('0x1e1')],{'as':'Description','foreignKey':_0xdc5b('0x1d5')});db['FreshdeskField'][_0xdc5b('0x12a')](db['FreshdeskField'],{'as':_0xdc5b('0x1da'),'foreignKey':'FieldId'});db['FreshdeskField']['belongsTo'](db[_0xdc5b('0x98')],{'as':'Variable','foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xc6')]['hasMany'](db[_0xdc5b('0xc8')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xc8')][_0xdc5b('0x12a')](db[_0xdc5b('0xca')],{'as':_0xdc5b('0x1d1'),'foreignKey':'SubjectId'});db[_0xdc5b('0xc8')][_0xdc5b('0x12a')](db['VtigerField'],{'as':_0xdc5b('0x1d8'),'foreignKey':_0xdc5b('0x1d5')});db['VtigerConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0xca')],{'as':_0xdc5b('0x1cd'),'foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0xc8')][_0xdc5b('0x136')](db[_0xdc5b('0xc6')],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xca')]['hasMany'](db[_0xdc5b('0xca')],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xca')][_0xdc5b('0x12a')](db[_0xdc5b('0xca')],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xca')][_0xdc5b('0x12a')](db['VtigerField'],{'as':_0xdc5b('0x1da'),'foreignKey':_0xdc5b('0x1d9')});db['VtigerField']['belongsTo'](db[_0xdc5b('0x98')],{'as':'Variable','foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xcc')]['hasMany'](db[_0xdc5b('0xce')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0x1e2')],{'as':'Subjects','foreignKey':_0xdc5b('0x1d7')});db['ServicenowConfiguration'][_0xdc5b('0x12a')](db[_0xdc5b('0x1e2')],{'as':'Descriptions','foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xce')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e2')],{'as':_0xdc5b('0x1cd'),'foreignKey':_0xdc5b('0x1d9')});db['ServicenowConfiguration']['belongsTo'](db[_0xdc5b('0xcc')],{'as':'Account','foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0x1e2')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e2')],{'as':_0xdc5b('0x1d3'),'foreignKey':'SubjectId'});db['ServicenowField'][_0xdc5b('0x12a')](db[_0xdc5b('0x1e2')],{'as':'Description','foreignKey':_0xdc5b('0x1d5')});db['ServicenowField']['hasMany'](db[_0xdc5b('0x1e2')],{'as':'Field','foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0x1e2')][_0xdc5b('0x136')](db['Variable'],{'as':_0xdc5b('0x98'),'foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xd1')][_0xdc5b('0x12a')](db[_0xdc5b('0xd3')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xd1')]['belongsTo'](db[_0xdc5b('0x11b')],{'as':_0xdc5b('0x11b'),'foreignKey':_0xdc5b('0x1e3')});db[_0xdc5b('0xd3')][_0xdc5b('0x12a')](db['Dynamics365Field'],{'as':_0xdc5b('0x1d1'),'onDelete':'cascade','foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xd3')][_0xdc5b('0x12a')](db[_0xdc5b('0xd5')],{'as':'Descriptions','onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xd3')][_0xdc5b('0x12a')](db[_0xdc5b('0xd5')],{'as':_0xdc5b('0x1cd'),'onDelete':_0xdc5b('0x127'),'foreignKey':'FieldId'});db[_0xdc5b('0xd3')][_0xdc5b('0x136')](db[_0xdc5b('0xd1')],{'as':_0xdc5b('0x17d'),'foreignKey':'AccountId'});db['Dynamics365Field']['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xd5')]['hasMany'](db[_0xdc5b('0xd5')],{'as':_0xdc5b('0x1d4'),'foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0xd5')][_0xdc5b('0x12a')](db[_0xdc5b('0xd5')],{'as':'Field','foreignKey':'FieldId'});db[_0xdc5b('0xd5')][_0xdc5b('0x136')](db[_0xdc5b('0x98')],{'as':_0xdc5b('0x98'),'foreignKey':_0xdc5b('0x1d6')});db[_0xdc5b('0xd7')][_0xdc5b('0x12a')](db[_0xdc5b('0xd9')],{'as':_0xdc5b('0x1d0'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1d2')});db[_0xdc5b('0xd9')]['hasMany'](db['FreshsalesField'],{'as':_0xdc5b('0x1d1'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0xd9')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e4')],{'as':_0xdc5b('0x1d8'),'foreignKey':_0xdc5b('0x1d5')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xdc5b('0x1cd'),'foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0xd9')]['belongsTo'](db['FreshsalesAccount'],{'as':_0xdc5b('0x17d'),'foreignKey':_0xdc5b('0x1d2')});db['FreshsalesField']['hasMany'](db[_0xdc5b('0x1e4')],{'as':_0xdc5b('0x1d3'),'foreignKey':_0xdc5b('0x1d7')});db[_0xdc5b('0x1e4')]['hasMany'](db[_0xdc5b('0x1e4')],{'as':'Description','foreignKey':_0xdc5b('0x1d5')});db[_0xdc5b('0x1e4')][_0xdc5b('0x12a')](db[_0xdc5b('0x1e4')],{'as':'Field','foreignKey':_0xdc5b('0x1d9')});db[_0xdc5b('0x1e4')][_0xdc5b('0x136')](db[_0xdc5b('0x98')],{'as':_0xdc5b('0x98'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0xdc5b('0x136')](db['ChatWebsite'],{});db['ChatQueueReport'][_0xdc5b('0x136')](db['CmList'],{'as':_0xdc5b('0x177'),'foreignKey':'ListId'});db[_0xdc5b('0xde')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0xde')][_0xdc5b('0x136')](db[_0xdc5b('0x6a')],{});db[_0xdc5b('0xde')][_0xdc5b('0x136')](db[_0xdc5b('0x6c')],{});db[_0xdc5b('0xde')][_0xdc5b('0x136')](db['User'],{});db['ChatQueueReport'][_0xdc5b('0x136')](db['ChatQueue'],{});db[_0xdc5b('0xe0')][_0xdc5b('0x136')](db['User'],{'onDelete':'cascade','foreignKey':_0xdc5b('0x1e5')});db['ChatInternalMessage'][_0xdc5b('0x136')](db['User'],{'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x1e6')});db[_0xdc5b('0xe5')][_0xdc5b('0x12a')](db['JscriptyQuestionReport'],{'foreignKey':_0xdc5b('0x1e7'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0xe5')]['hasMany'](db[_0xdc5b('0xe2')],{'foreignKey':_0xdc5b('0x1e7'),'onDelete':_0xdc5b('0x127')});db['SmsQueueReport'][_0xdc5b('0x136')](db['SmsAccount'],{});db[_0xdc5b('0xe7')][_0xdc5b('0x136')](db[_0xdc5b('0x13b')],{'as':'List','foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0xe7')][_0xdc5b('0x136')](db['CmContact'],{'as':'Contact','foreignKey':_0xdc5b('0x170')});db[_0xdc5b('0xe7')][_0xdc5b('0x136')](db[_0xdc5b('0x57')],{});db[_0xdc5b('0xe7')][_0xdc5b('0x136')](db[_0xdc5b('0x194')],{});db[_0xdc5b('0xe7')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{});db[_0xdc5b('0xe7')]['belongsTo'](db[_0xdc5b('0x5a')],{});db['JscriptyProject'][_0xdc5b('0x12a')](db[_0xdc5b('0xe5')],{'foreignKey':_0xdc5b('0x1e8')});db['JscriptyProject'][_0xdc5b('0x12a')](db[_0xdc5b('0xe4')],{'foreignKey':_0xdc5b('0x1e8')});db[_0xdc5b('0xeb')]['hasMany'](db[_0xdc5b('0xe2')],{'foreignKey':'ProjectId'});db[_0xdc5b('0xf5')][_0xdc5b('0x138')](db['User'],{'as':_0xdc5b('0x164'),'through':'user_has_teams'});db['Team'][_0xdc5b('0x138')](db['VoiceQueue'],{'through':_0xdc5b('0x11d'),'as':_0xdc5b('0x1e9')});db[_0xdc5b('0xf5')][_0xdc5b('0x138')](db[_0xdc5b('0x3f')],{'through':_0xdc5b('0x17b'),'as':'MailQueues'});db[_0xdc5b('0xf5')][_0xdc5b('0x138')](db[_0xdc5b('0x6f')],{'through':_0xdc5b('0x1a6'),'as':_0xdc5b('0x146')});db[_0xdc5b('0xf5')]['belongsToMany'](db[_0xdc5b('0x50')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0xdc5b('0x138')](db[_0xdc5b('0x5a')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xdc5b('0xf5')][_0xdc5b('0x138')](db[_0xdc5b('0x63')],{'through':_0xdc5b('0x19e'),'as':_0xdc5b('0x148')});db['Team'][_0xdc5b('0x138')](db['WhatsappQueue'],{'through':_0xdc5b('0x1ea'),'as':'WhatsappQueues'});db[_0xdc5b('0xf5')][_0xdc5b('0x138')](db[_0xdc5b('0x10a')],{'through':_0xdc5b('0x11f'),'as':'VoicePrefixes'});db[_0xdc5b('0xf9')][_0xdc5b('0x12a')](db[_0xdc5b('0x134')],{'as':_0xdc5b('0x15b'),'foreignKey':_0xdc5b('0x1b1')});db[_0xdc5b('0xf9')]['hasMany'](db[_0xdc5b('0x79')],{'as':'HopperFinals','foreignKey':_0xdc5b('0x1b1')});db['Campaign'][_0xdc5b('0x12a')](db[_0xdc5b('0x7b')],{'as':'HopperHistories','foreignKey':_0xdc5b('0x1b1')});db[_0xdc5b('0xf9')][_0xdc5b('0x12a')](db[_0xdc5b('0x15d')],{'as':_0xdc5b('0x15e'),'foreignKey':_0xdc5b('0x1b1')});db[_0xdc5b('0xf9')][_0xdc5b('0x136')](db[_0xdc5b('0x28')],{'as':_0xdc5b('0x28'),'foreignKey':_0xdc5b('0x15f')});db[_0xdc5b('0xf9')][_0xdc5b('0x136')](db[_0xdc5b('0x28')],{'as':_0xdc5b('0x160'),'foreignKey':_0xdc5b('0x1eb')});db[_0xdc5b('0xf9')][_0xdc5b('0x136')](db['Interval'],{'as':'Interval','foreignKey':'IntervalId'});db[_0xdc5b('0xf9')][_0xdc5b('0x136')](db[_0xdc5b('0xf0')],{'as':_0xdc5b('0xf0'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x13c'),'through':_0xdc5b('0x1ec')});db[_0xdc5b('0xf9')]['belongsToMany'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x166'),'through':'campaigns_has_cm_blacklists'});db[_0xdc5b('0xfc')][_0xdc5b('0x136')](db[_0xdc5b('0x6d')],{'as':_0xdc5b('0x6d'),'foreignKey':_0xdc5b('0x187')});db[_0xdc5b('0x100')][_0xdc5b('0x136')](db[_0xdc5b('0x42')],{});db[_0xdc5b('0x100')][_0xdc5b('0x136')](db['MailInteraction'],{});db[_0xdc5b('0x100')][_0xdc5b('0x136')](db[_0xdc5b('0x3d')],{'foreignKey':_0xdc5b('0x1ed'),'as':_0xdc5b('0x1ee')});db['MailTransferReport'][_0xdc5b('0x136')](db['User'],{'foreignKey':_0xdc5b('0x1ef'),'as':'FromAgent'});db[_0xdc5b('0x100')]['belongsTo'](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1f0'),'as':'ToAgent'});db[_0xdc5b('0x100')][_0xdc5b('0x136')](db[_0xdc5b('0x3f')],{'foreignKey':'ToMailQueueId','as':_0xdc5b('0x1f1')});db[_0xdc5b('0x100')][_0xdc5b('0x136')](db[_0xdc5b('0x3d')],{'foreignKey':_0xdc5b('0x1f2'),'as':_0xdc5b('0x1f3')});db['ChatTransferReport']['belongsTo'](db[_0xdc5b('0x6c')],{});db[_0xdc5b('0x102')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0xdc5b('0x136')](db[_0xdc5b('0x65')],{'foreignKey':_0xdc5b('0x1f4'),'as':'FromAccount'});db[_0xdc5b('0x102')][_0xdc5b('0x136')](db['User'],{'foreignKey':_0xdc5b('0x1ef'),'as':_0xdc5b('0x1f5')});db['ChatTransferReport'][_0xdc5b('0x136')](db['User'],{'foreignKey':_0xdc5b('0x1f0'),'as':_0xdc5b('0x1f6')});db[_0xdc5b('0x102')][_0xdc5b('0x136')](db[_0xdc5b('0x6f')],{'foreignKey':_0xdc5b('0x1f7'),'as':_0xdc5b('0x1f1')});db['ChatTransferReport'][_0xdc5b('0x136')](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0xdc5b('0x1f3')});db['FaxTransferReport']['belongsTo'](db[_0xdc5b('0x4e')],{});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x4d')],{});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x49')],{'foreignKey':_0xdc5b('0x1f8'),'as':'FromAccount'});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1ef'),'as':_0xdc5b('0x1f5')});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1f0'),'as':_0xdc5b('0x1f6')});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x50')],{'foreignKey':'ToFaxQueueId','as':_0xdc5b('0x1f1')});db[_0xdc5b('0x104')][_0xdc5b('0x136')](db[_0xdc5b('0x49')],{'foreignKey':_0xdc5b('0x1f9'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0xdc5b('0x136')](db['OpenchannelMessage'],{});db[_0xdc5b('0x106')][_0xdc5b('0x136')](db[_0xdc5b('0x5f')],{});db[_0xdc5b('0x106')][_0xdc5b('0x136')](db[_0xdc5b('0x199')],{'foreignKey':_0xdc5b('0x1fa'),'as':_0xdc5b('0x1ee')});db[_0xdc5b('0x106')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xdc5b('0x1f5')});db[_0xdc5b('0x106')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1f0'),'as':_0xdc5b('0x1f6')});db[_0xdc5b('0x106')][_0xdc5b('0x136')](db[_0xdc5b('0x63')],{'foreignKey':_0xdc5b('0x1fb'),'as':_0xdc5b('0x1f1')});db[_0xdc5b('0x106')][_0xdc5b('0x136')](db[_0xdc5b('0x199')],{'foreignKey':'ToOpenchannelAccountId','as':_0xdc5b('0x1f3')});db[_0xdc5b('0x108')]['belongsTo'](db[_0xdc5b('0x194')],{});db[_0xdc5b('0x108')][_0xdc5b('0x136')](db[_0xdc5b('0x57')],{});db[_0xdc5b('0x108')][_0xdc5b('0x136')](db[_0xdc5b('0x54')],{'foreignKey':_0xdc5b('0x1fc'),'as':_0xdc5b('0x1ee')});db['SmsTransferReport'][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1ef'),'as':_0xdc5b('0x1f5')});db['SmsTransferReport'][_0xdc5b('0x136')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xdc5b('0x108')]['belongsTo'](db[_0xdc5b('0x5a')],{'foreignKey':_0xdc5b('0x1fd'),'as':_0xdc5b('0x1f1')});db[_0xdc5b('0x108')][_0xdc5b('0x136')](db[_0xdc5b('0x54')],{'foreignKey':'ToSmsAccountId','as':_0xdc5b('0x1f3')});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db[_0xdc5b('0x80')],{'as':_0xdc5b('0x175'),'foreignKey':'ListId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db[_0xdc5b('0x1fe')],{'as':_0xdc5b('0x1ff'),'foreignKey':'ListId'});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db[_0xdc5b('0x75')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db[_0xdc5b('0x79')],{'as':_0xdc5b('0x200'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db[_0xdc5b('0x7b')],{'as':_0xdc5b('0x12c'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x13b')][_0xdc5b('0x12a')](db['ReportAgentPreview'],{'as':_0xdc5b('0x12d'),'foreignKey':_0xdc5b('0x178')});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':_0xdc5b('0x201'),'through':'voice_queues_has_cm_lists'});db[_0xdc5b('0x13b')]['belongsToMany'](db[_0xdc5b('0x12')],{'as':'Agents','through':_0xdc5b('0x13d')});db['VoicePrefix'][_0xdc5b('0x12a')](db[_0xdc5b('0x15')],{'as':'Extensions','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x10a')]['belongsToMany'](db[_0xdc5b('0x12')],{'as':'Agents','through':_0xdc5b('0x120')});db['VoicePrefix']['belongsToMany'](db[_0xdc5b('0xf5')],{'through':'TeamVoicePrefix','as':'Teams'});db[_0xdc5b('0x10c')]['hasMany'](db['User'],{'as':'Users','foreignKey':'userProfileId'});db['UserProfile'][_0xdc5b('0x12a')](db[_0xdc5b('0x202')],{'as':_0xdc5b('0x203'),'foreignKey':'userProfileId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x202')][_0xdc5b('0x12a')](db[_0xdc5b('0x10e')],{'as':_0xdc5b('0x204'),'foreignKey':_0xdc5b('0x205'),'onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x111')][_0xdc5b('0x12a')](db[_0xdc5b('0x80')],{'as':_0xdc5b('0x175'),'foreignKey':'WhatsappAccountId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x111')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xdc5b('0x111')]['hasMany'](db[_0xdc5b('0x206')],{'as':_0xdc5b('0x168'),'foreignKey':_0xdc5b('0x207')});db[_0xdc5b('0x111')][_0xdc5b('0x12a')](db['WhatsappInteraction'],{'as':_0xdc5b('0x176')});db[_0xdc5b('0x111')][_0xdc5b('0x12a')](db[_0xdc5b('0x113')],{'as':'Applications','foreignKey':'WhatsappAccountId','onDelete':_0xdc5b('0x127')});db[_0xdc5b('0x111')]['belongsTo'](db[_0xdc5b('0x13b')],{'as':'List','foreignKey':_0xdc5b('0x178')});db['WhatsappAccount'][_0xdc5b('0x136')](db[_0xdc5b('0x85')],{'as':_0xdc5b('0x162'),'foreignKey':_0xdc5b('0x17a')});db['WhatsappAccount']['belongsToMany'](db['User'],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x208')});db[_0xdc5b('0x113')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x113')][_0xdc5b('0x136')](db[_0xdc5b('0x119')],{'onDelete':'restrict'});db[_0xdc5b('0x113')][_0xdc5b('0x136')](db[_0xdc5b('0x111')],{'onDelete':_0xdc5b('0x172')});db['WhatsappApplication'][_0xdc5b('0x136')](db[_0xdc5b('0x83')],{'onDelete':_0xdc5b('0x172'),'foreignKey':'IntervalId'});db[_0xdc5b('0x113')][_0xdc5b('0x136')](db[_0xdc5b('0x8d')],{'onDelete':_0xdc5b('0x172'),'foreignKey':_0xdc5b('0x188')});db[_0xdc5b('0x115')][_0xdc5b('0x12a')](db[_0xdc5b('0x206')],{'as':_0xdc5b('0x168'),'onDelete':_0xdc5b('0x127'),'foreignKey':_0xdc5b('0x209')});db[_0xdc5b('0x115')][_0xdc5b('0x136')](db[_0xdc5b('0x111')],{'as':'Account','foreignKey':_0xdc5b('0x207')});db[_0xdc5b('0x115')][_0xdc5b('0x136')](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x115')]['belongsTo'](db['User'],{'as':_0xdc5b('0x17e'),'foreignKey':_0xdc5b('0x128')});db[_0xdc5b('0x115')][_0xdc5b('0x138')](db[_0xdc5b('0x8d')],{'through':_0xdc5b('0x1c2'),'as':_0xdc5b('0x17f')});db[_0xdc5b('0x115')][_0xdc5b('0x138')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xdc5b('0x115')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x182'),'through':_0xdc5b('0x142'),'foreignKey':'WhatsappInteractionId'});db[_0xdc5b('0x206')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x12')});db[_0xdc5b('0x206')]['belongsTo'](db[_0xdc5b('0x75')],{'onDelete':'cascade','as':_0xdc5b('0x16f')});db['WhatsappMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x115')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xdc5b('0x209')});db['WhatsappMessage'][_0xdc5b('0x136')](db[_0xdc5b('0x111')],{'as':_0xdc5b('0x17d'),'foreignKey':'WhatsappAccountId'});db[_0xdc5b('0x116')][_0xdc5b('0x136')](db[_0xdc5b('0x111')],{});db[_0xdc5b('0x116')]['belongsTo'](db[_0xdc5b('0x13b')],{'as':_0xdc5b('0x177'),'foreignKey':_0xdc5b('0x178')});db[_0xdc5b('0x116')]['belongsTo'](db[_0xdc5b('0x75')],{'as':_0xdc5b('0x16f'),'foreignKey':'ContactId'});db[_0xdc5b('0x116')][_0xdc5b('0x136')](db[_0xdc5b('0x115')],{});db[_0xdc5b('0x116')][_0xdc5b('0x136')](db[_0xdc5b('0x119')],{});db['WhatsappQueueReport'][_0xdc5b('0x136')](db[_0xdc5b('0x206')],{});db[_0xdc5b('0x116')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{});db['WhatsappTransferReport'][_0xdc5b('0x136')](db[_0xdc5b('0x206')],{});db['WhatsappTransferReport'][_0xdc5b('0x136')](db[_0xdc5b('0x115')],{});db['WhatsappTransferReport'][_0xdc5b('0x136')](db[_0xdc5b('0x111')],{'foreignKey':_0xdc5b('0x20a'),'as':'FromAccount'});db['WhatsappTransferReport'][_0xdc5b('0x136')](db['WhatsappAccount'],{'foreignKey':_0xdc5b('0x20b'),'as':_0xdc5b('0x1f3')});db[_0xdc5b('0x118')][_0xdc5b('0x136')](db[_0xdc5b('0x119')],{'foreignKey':_0xdc5b('0x20c'),'as':_0xdc5b('0x1f1')});db[_0xdc5b('0x118')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1ef'),'as':'FromAgent'});db[_0xdc5b('0x118')][_0xdc5b('0x136')](db[_0xdc5b('0x12')],{'foreignKey':_0xdc5b('0x1f0'),'as':_0xdc5b('0x1f6')});db[_0xdc5b('0x119')][_0xdc5b('0x138')](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x164'),'through':_0xdc5b('0x38'),'foreignKey':_0xdc5b('0x20d')});db[_0xdc5b('0x119')][_0xdc5b('0x138')](db[_0xdc5b('0xf5')],{'through':_0xdc5b('0x1ea'),'as':_0xdc5b('0x165')});db[_0xdc5b('0x122')]['belongsTo'](db[_0xdc5b('0x12')],{'as':_0xdc5b('0x20e'),'foreignKey':_0xdc5b('0x128'),'onDelete':'cascade','hooks':!![]});db[_0xdc5b('0x11b')][_0xdc5b('0x126')](db[_0xdc5b('0xd1')],{'as':'Dynamics365Account','onDelete':'restrict'});db[_0xdc5b('0x11b')][_0xdc5b('0x126')](db[_0xdc5b('0x3a')],{'as':_0xdc5b('0x20f'),'onDelete':_0xdc5b('0x172')});db[_0xdc5b('0x11b')]['hasOne'](db[_0xdc5b('0x173')],{'as':_0xdc5b('0x174'),'onDelete':'restrict'});module[_0xdc5b('0x210')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 46e2724..c49ef90 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa6f6=['/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/jira','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','join','root','/www','static','/snippet','3.9.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','path','express','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField'];(function(_0x1b4448,_0x3771f1){var _0x39e807=function(_0x5538c3){while(--_0x5538c3){_0x1b4448['push'](_0x1b4448['shift']());}};_0x39e807(++_0x3771f1);}(_0xa6f6,0x16b));var _0x6a6f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa6f6[_0x57b54c];return _0x59cc19;};'use strict';var path=require(_0x6a6f('0x0'));var express=require(_0x6a6f('0x1'));var errors=require('./errors');var config=require(_0x6a6f('0x2'));var setupLoggers=require(_0x6a6f('0x3'))[_0x6a6f('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0x6a6f('0x5')]=function(_0x202960){return setupLoggers(_0x202960)[_0x6a6f('0x6')](function(){_0x202960[_0x6a6f('0x7')](_0x6a6f('0x8'),require(_0x6a6f('0x9')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xa'),require(_0x6a6f('0xb')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc'),require(_0x6a6f('0xd')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xe'),require('./api/voiceExtension'));_0x202960['use']('/api/voice/mohs',require(_0x6a6f('0xf')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x10'),require('./api/voiceQueue'));_0x202960[_0x6a6f('0x7')]('/api/voice/recordings',require(_0x6a6f('0x11')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x12'),require(_0x6a6f('0x13')));_0x202960[_0x6a6f('0x7')]('/api/voice/mails',require('./api/voiceMail'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x14'),require(_0x6a6f('0x15')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x16'),require(_0x6a6f('0x17')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x18'),require(_0x6a6f('0x19')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x1a'),require(_0x6a6f('0x1b')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x1c'),require(_0x6a6f('0x1d')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x1e'),require(_0x6a6f('0x1f')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x20'),require(_0x6a6f('0x21')));_0x202960['use'](_0x6a6f('0x22'),require(_0x6a6f('0x23')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x24'),require(_0x6a6f('0x25')));_0x202960[_0x6a6f('0x7')]('/api/mail/accounts',require(_0x6a6f('0x26')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x27'),require(_0x6a6f('0x28')));_0x202960['use'](_0x6a6f('0x29'),require(_0x6a6f('0x2a')));_0x202960[_0x6a6f('0x7')]('/api/mail/interactions',require(_0x6a6f('0x2b')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x2c'),require('./api/mailMessage'));_0x202960['use'](_0x6a6f('0x2d'),require('./api/mailApplication'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x2e'),require(_0x6a6f('0x2f')));_0x202960['use'](_0x6a6f('0x30'),require('./api/dashboard'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x31'),require(_0x6a6f('0x32')));_0x202960['use'](_0x6a6f('0x33'),require('./api/faxAccount'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x34'),require('./api/faxApplication'));_0x202960[_0x6a6f('0x7')]('/api/fax/interactions',require(_0x6a6f('0x35')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x36'),require('./api/faxMessage'));_0x202960['use'](_0x6a6f('0x37'),require('./api/faxQueue'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x38'),require(_0x6a6f('0x39')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x3a'),require(_0x6a6f('0x3b')));_0x202960[_0x6a6f('0x7')]('/api/sms/applications',require(_0x6a6f('0x3c')));_0x202960['use'](_0x6a6f('0x3d'),require(_0x6a6f('0x3e')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x3f'),require(_0x6a6f('0x40')));_0x202960[_0x6a6f('0x7')]('/api/sms/queues',require(_0x6a6f('0x41')));_0x202960['use'](_0x6a6f('0x42'),require(_0x6a6f('0x43')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x44'),require(_0x6a6f('0x45')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x46'),require(_0x6a6f('0x47')));_0x202960[_0x6a6f('0x7')]('/api/openchannel/messages',require(_0x6a6f('0x48')));_0x202960['use'](_0x6a6f('0x49'),require(_0x6a6f('0x4a')));_0x202960['use']('/api/chat/websites',require(_0x6a6f('0x4b')));_0x202960[_0x6a6f('0x7')]('/api/openchannel/reports/queue',require(_0x6a6f('0x4c')));_0x202960['use'](_0x6a6f('0x4d'),require(_0x6a6f('0x4e')));_0x202960['use']('/api/chat/interactions',require(_0x6a6f('0x4f')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x50'),require(_0x6a6f('0x51')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x52'),require(_0x6a6f('0x53')));_0x202960['use'](_0x6a6f('0x54'),require(_0x6a6f('0x55')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x56'),require(_0x6a6f('0x57')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x58'),require(_0x6a6f('0x59')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x5a'),require('./api/cmCompany'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x5b'),require(_0x6a6f('0x5c')));_0x202960['use'](_0x6a6f('0x5d'),require(_0x6a6f('0x5e')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x5f'),require('./api/cmHopperBlack'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x60'),require('./api/cmHopperFinal'));_0x202960['use'](_0x6a6f('0x61'),require(_0x6a6f('0x62')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x63'),require(_0x6a6f('0x64')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x65'),require('./api/action'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x66'),require(_0x6a6f('0x67')));_0x202960['use'](_0x6a6f('0x68'),require('./api/cannedAnswer'));_0x202960['use']('/api/dispositions',require('./api/disposition'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x69'),require(_0x6a6f('0x6a')));_0x202960['use'](_0x6a6f('0x6b'),require(_0x6a6f('0x6c')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x6d'),require(_0x6a6f('0x6e')));_0x202960[_0x6a6f('0x7')]('/api/cdr',require(_0x6a6f('0x6f')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x70'),require(_0x6a6f('0x71')));_0x202960['use']('/api/schedules',require(_0x6a6f('0x72')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x73'),require(_0x6a6f('0x74')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x75'),require(_0x6a6f('0x76')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x77'),require(_0x6a6f('0x78')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x79'),require('./api/cmContactHasItem'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x7a'),require(_0x6a6f('0x7b')));_0x202960[_0x6a6f('0x7')]('/api/templates',require(_0x6a6f('0x7c')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x7d'),require(_0x6a6f('0x7e')));_0x202960[_0x6a6f('0x7')]('/api/variables',require(_0x6a6f('0x7f')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x80'),require(_0x6a6f('0x81')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x82'),require(_0x6a6f('0x83')));_0x202960[_0x6a6f('0x7')]('/api/analytics/custom_reports',require(_0x6a6f('0x84')));_0x202960['use'](_0x6a6f('0x85'),require(_0x6a6f('0x86')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x87'),require(_0x6a6f('0x88')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x89'),require(_0x6a6f('0x8a')));_0x202960['use']('/api/analytics/field_reports',require(_0x6a6f('0x8b')));_0x202960['use'](_0x6a6f('0x8c'),require(_0x6a6f('0x8d')));_0x202960[_0x6a6f('0x7')]('/api/integrations/salesforce/accounts',require(_0x6a6f('0x8e')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x8f'),require(_0x6a6f('0x90')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x91'),require('./api/intSalesforceField'));_0x202960['use'](_0x6a6f('0x92'),require(_0x6a6f('0x93')));_0x202960[_0x6a6f('0x7')]('/api/integrations/sugarcrm/configurations',require(_0x6a6f('0x94')));_0x202960['use'](_0x6a6f('0x95'),require(_0x6a6f('0x96')));_0x202960[_0x6a6f('0x7')]('/api/integrations/desk/accounts',require(_0x6a6f('0x97')));_0x202960[_0x6a6f('0x7')]('/api/integrations/desk/configurations',require(_0x6a6f('0x98')));_0x202960[_0x6a6f('0x7')]('/api/integrations/desk/fields',require(_0x6a6f('0x99')));_0x202960['use'](_0x6a6f('0x9a'),require(_0x6a6f('0x9b')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x9c'),require(_0x6a6f('0x9d')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x9e'),require('./api/intZohoField'));_0x202960['use'](_0x6a6f('0x9f'),require(_0x6a6f('0xa0')));_0x202960['use'](_0x6a6f('0xa1'),require(_0x6a6f('0xa2')));_0x202960['use'](_0x6a6f('0xa3'),require('./api/intZendeskField'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xa4'),require(_0x6a6f('0xa5')));_0x202960['use'](_0x6a6f('0xa6'),require('./api/intFreshdeskConfiguration'));_0x202960['use'](_0x6a6f('0xa7'),require(_0x6a6f('0xa8')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xa9'),require('./api/intVtigerAccount'));_0x202960[_0x6a6f('0x7')]('/api/integrations/vtiger/configurations',require(_0x6a6f('0xaa')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xab'),require(_0x6a6f('0xac')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xad'),require('./api/intServicenowAccount'));_0x202960['use'](_0x6a6f('0xae'),require(_0x6a6f('0xaf')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xb0'),require(_0x6a6f('0xb1')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xb2'),require(_0x6a6f('0xb3')));_0x202960[_0x6a6f('0x7')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xb4'),require(_0x6a6f('0xb5')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xb6'),require(_0x6a6f('0xb7')));_0x202960[_0x6a6f('0x7')]('/api/integrations/freshsales/configurations',require(_0x6a6f('0xb8')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xb9'),require(_0x6a6f('0xba')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xbb'),require('./api/network'));_0x202960['use'](_0x6a6f('0xbc'),require(_0x6a6f('0xbd')));_0x202960['use'](_0x6a6f('0xbe'),require('./api/chatInternalMessage'));_0x202960[_0x6a6f('0x7')]('/api/jscripty/answers/reports',require(_0x6a6f('0xbf')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc0'),require(_0x6a6f('0xc1')));_0x202960['use']('/api/jscripty/sessions/reports',require(_0x6a6f('0xc2')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc3'),require(_0x6a6f('0xc4')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc5'),require('./api/squareReport'));_0x202960[_0x6a6f('0x7')]('/api/square/details/reports',require(_0x6a6f('0xc6')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc7'),require(_0x6a6f('0xc8')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xc9'),require(_0x6a6f('0xca')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xcb'),require(_0x6a6f('0xcc')));_0x202960[_0x6a6f('0x7')]('/api/square/projects',require(_0x6a6f('0xcd')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xce'),require(_0x6a6f('0xcf')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xd0'),require('./api/squareMessage'));_0x202960['use'](_0x6a6f('0xd1'),require('./api/team'));_0x202960[_0x6a6f('0x7')]('/api/license',require(_0x6a6f('0xd2')));_0x202960[_0x6a6f('0x7')]('/api/campaigns',require(_0x6a6f('0xd3')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xd4'),require(_0x6a6f('0xd5')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xd6'),require('./api/attachment'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xd7'),require(_0x6a6f('0xd8')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xd9'),require(_0x6a6f('0xda')));_0x202960[_0x6a6f('0x7')]('/api/chat/reports/transfer',require(_0x6a6f('0xdb')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xdc'),require('./api/faxTransferReport'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xdd'),require(_0x6a6f('0xde')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xdf'),require(_0x6a6f('0xe0')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xe1'),require('./api/cmList'));_0x202960['use'](_0x6a6f('0xe2'),require(_0x6a6f('0xe3')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xe4'),require(_0x6a6f('0xe5')));_0x202960[_0x6a6f('0x7')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x202960['use'](_0x6a6f('0xe6'),require(_0x6a6f('0xe7')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xe8'),require('./api/userNotification'));_0x202960[_0x6a6f('0x7')]('/api/whatsapp/accounts',require('./api/whatsappAccount'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xe9'),require(_0x6a6f('0xea')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xeb'),require(_0x6a6f('0xec')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xed'),require('./api/whatsappMessage'));_0x202960[_0x6a6f('0x7')]('/api/whatsapp/reports/queue',require(_0x6a6f('0xee')));_0x202960['use']('/api/whatsapp/reports/transfer',require(_0x6a6f('0xef')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xf0'),require(_0x6a6f('0xf1')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xf2'),require(_0x6a6f('0xf3')));_0x202960['use']('/api/realtime',require(_0x6a6f('0xf4')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xf5'),require(_0x6a6f('0xf6')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xf7'),require('./api/mailInteractionHasTag'));_0x202960['use'](_0x6a6f('0xf8'),require(_0x6a6f('0xf9')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xfa'),require(_0x6a6f('0xfb')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xfc'),require('./api/authActiveDirectory'));_0x202960[_0x6a6f('0x7')]('/api/jira',require(_0x6a6f('0xfd')));_0x202960[_0x6a6f('0x7')]('/api/rpc',require(_0x6a6f('0xfe')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0xff'),require('./api/version'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x100'),require('./api/system'));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x101'),require(_0x6a6f('0x102')));_0x202960['use']('/api/webbar',require(_0x6a6f('0x103')));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x104'),clientSideLogs);_0x202960[_0x6a6f('0x7')](_0x6a6f('0x105'),express['static'](path[_0x6a6f('0x106')](config[_0x6a6f('0x107')],_0x6a6f('0x105'))));_0x202960[_0x6a6f('0x7')](_0x6a6f('0x108'),express[_0x6a6f('0x109')](path[_0x6a6f('0x106')](config[_0x6a6f('0x107')],_0x6a6f('0x108'))));_0x202960[_0x6a6f('0x7')]('/demo',express['static'](path[_0x6a6f('0x106')](config[_0x6a6f('0x107')],'/demo')));_0x202960['use'](_0x6a6f('0x10a'),express[_0x6a6f('0x109')](path[_0x6a6f('0x106')](config[_0x6a6f('0x107')],'snippet',_0x6a6f('0x10b'))));_0x202960['use'](_0x6a6f('0x10c'),express[_0x6a6f('0x109')](path['join'](config[_0x6a6f('0x107')],_0x6a6f('0x10d'))));_0x202960[_0x6a6f('0x10e')](_0x6a6f('0x10f'))[_0x6a6f('0x110')](errors[0x194]);_0x202960['route']('/*')['get'](function(_0x20e898,_0x14f5c6){_0x14f5c6['sendFile'](path[_0x6a6f('0x111')](_0x202960[_0x6a6f('0x110')](_0x6a6f('0x112'))+'/index.html'));});return _0x202960;});}; \ No newline at end of file +var _0x15ed=['/api/chat/queues','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/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/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/apidoc','join','root','static','/demo','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','/index.html','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','default','then','./api/voiceChanSpy','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/voice/transfers/reports','/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/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/chatApplication','./api/chatInteraction','./api/chatMessage','./api/chatOfflineMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x15ed,0x1e6));var _0xd15e=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x15ed[_0x1f8053];return _0x174fd8;};'use strict';var path=require('path');var express=require(_0xd15e('0x0'));var errors=require(_0xd15e('0x1'));var config=require(_0xd15e('0x2'));var setupLoggers=require(_0xd15e('0x3'))[_0xd15e('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xd15e('0x5')]=function(_0x1c5b6e){return setupLoggers(_0x1c5b6e)[_0xd15e('0x6')](function(){_0x1c5b6e['use']('/api/users',require('./api/user'));_0x1c5b6e['use']('/api/voice/chanspy',require(_0xd15e('0x7')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x9'),require(_0xd15e('0xa')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb'),require(_0xd15e('0xc')));_0x1c5b6e[_0xd15e('0x8')]('/api/voice/mohs',require(_0xd15e('0xd')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xe'),require('./api/voiceQueue'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xf'),require('./api/voiceRecording'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x10'),require(_0xd15e('0x11')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x12'),require(_0xd15e('0x13')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x14'),require('./api/voiceMailMessage'));_0x1c5b6e['use']('/api/voice/calls/reports',require(_0xd15e('0x15')));_0x1c5b6e['use'](_0xd15e('0x16'),require(_0xd15e('0x17')));_0x1c5b6e[_0xd15e('0x8')]('/api/voice/agents/reports',require(_0xd15e('0x18')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x19'),require(_0xd15e('0x1a')));_0x1c5b6e['use']('/api/members/reports',require(_0xd15e('0x1b')));_0x1c5b6e[_0xd15e('0x8')]('/api/trunks',require('./api/trunk'));_0x1c5b6e['use'](_0xd15e('0x1c'),require('./api/voiceTransferReport'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x1d'),require(_0xd15e('0x1e')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x1f'),require(_0xd15e('0x20')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x21'),require(_0xd15e('0x22')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x23'),require(_0xd15e('0x24')));_0x1c5b6e['use'](_0xd15e('0x25'),require('./api/mailInteraction'));_0x1c5b6e['use'](_0xd15e('0x26'),require(_0xd15e('0x27')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x28'),require(_0xd15e('0x29')));_0x1c5b6e[_0xd15e('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x1c5b6e[_0xd15e('0x8')]('/api/dashboards',require(_0xd15e('0x2a')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x2b'),require(_0xd15e('0x2c')));_0x1c5b6e['use'](_0xd15e('0x2d'),require(_0xd15e('0x2e')));_0x1c5b6e['use'](_0xd15e('0x2f'),require(_0xd15e('0x30')));_0x1c5b6e[_0xd15e('0x8')]('/api/fax/interactions',require(_0xd15e('0x31')));_0x1c5b6e[_0xd15e('0x8')]('/api/fax/messages',require(_0xd15e('0x32')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x33'),require(_0xd15e('0x34')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x35'),require(_0xd15e('0x36')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x37'),require(_0xd15e('0x38')));_0x1c5b6e['use'](_0xd15e('0x39'),require(_0xd15e('0x3a')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x3b'),require(_0xd15e('0x3c')));_0x1c5b6e[_0xd15e('0x8')]('/api/sms/messages',require(_0xd15e('0x3d')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x3e'),require(_0xd15e('0x3f')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x40'),require('./api/openchannelAccount'));_0x1c5b6e['use'](_0xd15e('0x41'),require(_0xd15e('0x42')));_0x1c5b6e[_0xd15e('0x8')]('/api/openchannel/interactions',require(_0xd15e('0x43')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x44'),require('./api/openchannelMessage'));_0x1c5b6e['use'](_0xd15e('0x45'),require(_0xd15e('0x46')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x47'),require(_0xd15e('0x48')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x49'),require('./api/openchannelQueueReport'));_0x1c5b6e[_0xd15e('0x8')]('/api/chat/applications',require(_0xd15e('0x4a')));_0x1c5b6e[_0xd15e('0x8')]('/api/chat/interactions',require(_0xd15e('0x4b')));_0x1c5b6e[_0xd15e('0x8')]('/api/chat/messages',require(_0xd15e('0x4c')));_0x1c5b6e['use']('/api/chat/offline_messages',require(_0xd15e('0x4d')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x4e'),require('./api/chatQueue'));_0x1c5b6e[_0xd15e('0x8')]('/api/chat/groups',require('./api/chatGroup'));_0x1c5b6e[_0xd15e('0x8')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x4f'),require(_0xd15e('0x50')));_0x1c5b6e['use'](_0xd15e('0x51'),require(_0xd15e('0x52')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x53'),require(_0xd15e('0x54')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x55'),require(_0xd15e('0x56')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x57'),require(_0xd15e('0x58')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x59'),require(_0xd15e('0x5a')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x5b'),require('./api/cmCustomField'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x5c'),require(_0xd15e('0x5d')));_0x1c5b6e['use'](_0xd15e('0x5e'),require(_0xd15e('0x5f')));_0x1c5b6e['use'](_0xd15e('0x60'),require(_0xd15e('0x61')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x62'),require(_0xd15e('0x63')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x64'),require(_0xd15e('0x65')));_0x1c5b6e['use'](_0xd15e('0x66'),require(_0xd15e('0x67')));_0x1c5b6e['use'](_0xd15e('0x68'),require(_0xd15e('0x69')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x6a'),require(_0xd15e('0x6b')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x6c'),require('./api/voiceQueuesLog'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x6d'),require(_0xd15e('0x6e')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x6f'),require(_0xd15e('0x70')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x71'),require(_0xd15e('0x72')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x73'),require('./api/contactItemType'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x74'),require(_0xd15e('0x75')));_0x1c5b6e[_0xd15e('0x8')]('/api/cm_hopper_additional_phones',require(_0xd15e('0x76')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x77'),require(_0xd15e('0x78')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x79'),require(_0xd15e('0x7a')));_0x1c5b6e[_0xd15e('0x8')]('/api/variables',require('./api/variable'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x7b'),require(_0xd15e('0x7c')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x7d'),require(_0xd15e('0x7e')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x7f'),require(_0xd15e('0x80')));_0x1c5b6e['use'](_0xd15e('0x81'),require(_0xd15e('0x82')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x83'),require(_0xd15e('0x84')));_0x1c5b6e['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x85'),require(_0xd15e('0x86')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x87'),require(_0xd15e('0x88')));_0x1c5b6e['use'](_0xd15e('0x89'),require(_0xd15e('0x8a')));_0x1c5b6e['use'](_0xd15e('0x8b'),require('./api/intSalesforceConfiguration'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x8c'),require(_0xd15e('0x8d')));_0x1c5b6e['use'](_0xd15e('0x8e'),require(_0xd15e('0x8f')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x90'),require(_0xd15e('0x91')));_0x1c5b6e['use'](_0xd15e('0x92'),require(_0xd15e('0x93')));_0x1c5b6e['use']('/api/integrations/desk/accounts',require(_0xd15e('0x94')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x95'),require(_0xd15e('0x96')));_0x1c5b6e['use'](_0xd15e('0x97'),require(_0xd15e('0x98')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x99'),require(_0xd15e('0x9a')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x9b'),require(_0xd15e('0x9c')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x9d'),require(_0xd15e('0x9e')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x9f'),require(_0xd15e('0xa0')));_0x1c5b6e['use']('/api/integrations/zendesk/configurations',require(_0xd15e('0xa1')));_0x1c5b6e['use'](_0xd15e('0xa2'),require('./api/intZendeskField'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xa3'),require(_0xd15e('0xa4')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xa5'),require('./api/intFreshdeskConfiguration'));_0x1c5b6e[_0xd15e('0x8')]('/api/integrations/freshdesk/fields',require(_0xd15e('0xa6')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xa7'),require(_0xd15e('0xa8')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xa9'),require(_0xd15e('0xaa')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xab'),require(_0xd15e('0xac')));_0x1c5b6e['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xad'),require(_0xd15e('0xae')));_0x1c5b6e['use'](_0xd15e('0xaf'),require('./api/intServicenowField'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb0'),require(_0xd15e('0xb1')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb2'),require('./api/intDynamics365Configuration'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb3'),require('./api/intDynamics365Field'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb4'),require(_0xd15e('0xb5')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb6'),require(_0xd15e('0xb7')));_0x1c5b6e[_0xd15e('0x8')]('/api/integrations/freshsales/fields',require(_0xd15e('0xb8')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xb9'),require(_0xd15e('0xba')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xbb'),require(_0xd15e('0xbc')));_0x1c5b6e['use'](_0xd15e('0xbd'),require('./api/chatInternalMessage'));_0x1c5b6e['use'](_0xd15e('0xbe'),require(_0xd15e('0xbf')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xc0'),require('./api/jscriptyQuestionReport'));_0x1c5b6e['use'](_0xd15e('0xc1'),require(_0xd15e('0xc2')));_0x1c5b6e['use'](_0xd15e('0xc3'),require(_0xd15e('0xc4')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xc5'),require(_0xd15e('0xc6')));_0x1c5b6e['use']('/api/square/details/reports',require(_0xd15e('0xc7')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xc8'),require('./api/jscriptyProject'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xc9'),require(_0xd15e('0xca')));_0x1c5b6e['use'](_0xd15e('0xcb'),require(_0xd15e('0xcc')));_0x1c5b6e['use'](_0xd15e('0xcd'),require('./api/squareProject'));_0x1c5b6e[_0xd15e('0x8')]('/api/square/recordings',require(_0xd15e('0xce')));_0x1c5b6e['use'](_0xd15e('0xcf'),require('./api/squareMessage'));_0x1c5b6e[_0xd15e('0x8')]('/api/teams',require(_0xd15e('0xd0')));_0x1c5b6e[_0xd15e('0x8')]('/api/license',require(_0xd15e('0xd1')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xd2'),require(_0xd15e('0xd3')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xd4'),require(_0xd15e('0xd5')));_0x1c5b6e['use'](_0xd15e('0xd6'),require(_0xd15e('0xd7')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xd8'),require(_0xd15e('0xd9')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xda'),require(_0xd15e('0xdb')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xdc'),require(_0xd15e('0xdd')));_0x1c5b6e[_0xd15e('0x8')]('/api/fax/reports/transfer',require(_0xd15e('0xde')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xdf'),require(_0xd15e('0xe0')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xe1'),require(_0xd15e('0xe2')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xe3'),require(_0xd15e('0xe4')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xe5'),require(_0xd15e('0xe6')));_0x1c5b6e['use'](_0xd15e('0xe7'),require(_0xd15e('0xe8')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xe9'),require('./api/userProfileSection'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xea'),require('./api/userProfileResource'));_0x1c5b6e[_0xd15e('0x8')]('/api/userNotifications',require(_0xd15e('0xeb')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xec'),require(_0xd15e('0xed')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xee'),require('./api/whatsappApplication'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xef'),require('./api/whatsappInteraction'));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xf0'),require(_0xd15e('0xf1')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xf2'),require(_0xd15e('0xf3')));_0x1c5b6e[_0xd15e('0x8')]('/api/whatsapp/reports/transfer',require(_0xd15e('0xf4')));_0x1c5b6e[_0xd15e('0x8')]('/api/whatsapp/queues',require(_0xd15e('0xf5')));_0x1c5b6e['use'](_0xd15e('0xf6'),require(_0xd15e('0xf7')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xf8'),require(_0xd15e('0xf9')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xfa'),require(_0xd15e('0xfb')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xfc'),require(_0xd15e('0xfd')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0xfe'),require(_0xd15e('0xff')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x100'),require(_0xd15e('0x101')));_0x1c5b6e[_0xd15e('0x8')]('/api/auth/activedirectory',require(_0xd15e('0x102')));_0x1c5b6e['use'](_0xd15e('0x103'),require(_0xd15e('0x104')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x105'),require(_0xd15e('0x106')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x107'),require(_0xd15e('0x108')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x109'),require(_0xd15e('0x10a')));_0x1c5b6e['use'](_0xd15e('0x10b'),require('./api/pm2'));_0x1c5b6e[_0xd15e('0x8')]('/api/webbar',require('./api/webbar'));_0x1c5b6e[_0xd15e('0x8')]('/api/logs',clientSideLogs);_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x10c'),express['static'](path[_0xd15e('0x10d')](config[_0xd15e('0x10e')],'/apidoc')));_0x1c5b6e[_0xd15e('0x8')]('/www',express[_0xd15e('0x10f')](path[_0xd15e('0x10d')](config[_0xd15e('0x10e')],'/www')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x110'),express['static'](path[_0xd15e('0x10d')](config[_0xd15e('0x10e')],_0xd15e('0x110'))));_0x1c5b6e[_0xd15e('0x8')]('/snippet',express[_0xd15e('0x10f')](path[_0xd15e('0x10d')](config['root'],_0xd15e('0x111'),'3.9.0')));_0x1c5b6e[_0xd15e('0x8')](_0xd15e('0x112'),express[_0xd15e('0x10f')](path['join'](config[_0xd15e('0x10e')],_0xd15e('0x113'))));_0x1c5b6e[_0xd15e('0x114')](_0xd15e('0x115'))['get'](errors[0x194]);_0x1c5b6e[_0xd15e('0x114')]('/*')[_0xd15e('0x116')](function(_0x6afe50,_0x2a1f89){_0x2a1f89[_0xd15e('0x117')](path[_0xd15e('0x118')](_0x1c5b6e[_0xd15e('0x116')]('appPath')+_0xd15e('0x119')));});return _0x1c5b6e;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 709526a..afb81f1 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x092c=['../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc'];(function(_0x1ad27a,_0xb04645){var _0x2f911a=function(_0x5f20b3){while(--_0x5f20b3){_0x1ad27a['push'](_0x1ad27a['shift']());}};_0x2f911a(++_0xb04645);}(_0x092c,0xfc));var _0xc092=function(_0x30cf6b,_0x3e8c4f){_0x30cf6b=_0x30cf6b-0x0;var _0x45fc56=_0x092c[_0x30cf6b];return _0x45fc56;};'use strict';var jayson=require(_0xc092('0x0'));var _=require(_0xc092('0x1'));var config=require(_0xc092('0x2'));exports[_0xc092('0x3')]=function(){return new Promise(function(_0xa1b57c,_0x33ea83){var _0x1107b8={};_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x5')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x6')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x7')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x8')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x9')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0xa')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0xb')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/memberReport/memberReport.rpc'));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0xc')));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0xd')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0xe')));_0x1107b8=_['merge'](_0x1107b8,require('../api/mailServerIn/mailServerIn.rpc'));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0xf')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x10')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x11')));_0x1107b8=_['merge'](_0x1107b8,require('../api/mailMessage/mailMessage.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x12')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x13')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x14')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x15')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x16')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/faxMessage/faxMessage.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x17')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x18')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/smsAccount/smsAccount.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x19')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1a')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1b')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1c')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1d')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1e')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x1f')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x20')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x21')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x22')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x23')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x24')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x25')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x26')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x27')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/pause/pause.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x28')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x29')));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0x2a')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x2b')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x2c')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x2d')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x2e')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x2f')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x30')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x31')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x32')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x33')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x34')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x35')));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0x36')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/setting/setting.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x37')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x38')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x39')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x3a')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require('../api/campaign/campaign.rpc'));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x3b')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x3c')));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0x3d')));_0x1107b8=_['merge'](_0x1107b8,require(_0xc092('0x3e')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x3f')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x40')));_0x1107b8=_[_0xc092('0x4')](_0x1107b8,require(_0xc092('0x41')));var _0xc09767=jayson['server'](_0x1107b8)[_0xc092('0x42')]();var _0x49546f=config['rpc'][_0xc092('0x43')]||config[_0xc092('0x43')]+0x1;var _0x3c32b8=config['rpc']['ip']||'localhost';_0xc09767['on'](_0xc092('0x44'),function(_0x56027b){return _0x33ea83(_0x56027b);});_0xc09767[_0xc092('0x3')](_0x49546f,_0x3c32b8,function(){console[_0xc092('0x45')](_0xc092('0x46'),_0x3c32b8,_0x49546f);require('../config/triggers')[_0xc092('0x47')]();return _0xa1b57c(_0xc092('0x48')+_0x3c32b8+':'+_0x49546f);});});}; \ No newline at end of file +var _0xdfa0=['../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc'];(function(_0x56c3ca,_0x16ba7d){var _0x5c2f78=function(_0x498ffa){while(--_0x498ffa){_0x56c3ca['push'](_0x56c3ca['shift']());}};_0x5c2f78(++_0x16ba7d);}(_0xdfa0,0x69));var _0x0dfa=function(_0x43bff5,_0x5198a9){_0x43bff5=_0x43bff5-0x0;var _0x518fc9=_0xdfa0[_0x43bff5];return _0x518fc9;};'use strict';var jayson=require(_0x0dfa('0x0'));var _=require('lodash');var config=require(_0x0dfa('0x1'));exports[_0x0dfa('0x2')]=function(){return new Promise(function(_0x4cd9ac,_0x139d96){var _0x45a28e={};_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/user/user.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/voiceExtension/voiceExtension.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x4')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x5')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x6')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x7')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x8')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x9')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0xa')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0xb')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0xc')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0xd')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/mailServerIn/mailServerIn.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0xe')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0xf')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x10')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x11')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/mailApplication/mailApplication.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x12')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x13')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x14')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x15')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x16')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x17')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x18')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/smsAccount/smsAccount.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x19')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x1a')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/smsQueue/smsQueue.rpc'));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x1b')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x1c')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x1d')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x1e')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x1f')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x20')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x21')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x22')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x23')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x24')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x25')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x26')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x27')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/pause/pause.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x28')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x29')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x2a')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x2b')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/variable/variable.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x2c')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x2d')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x2e')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x2f')));_0x45a28e=_['merge'](_0x45a28e,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x30')));_0x45a28e=_['merge'](_0x45a28e,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x31')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x32')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x33')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x34')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x35')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x36')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x37')));_0x45a28e=_['merge'](_0x45a28e,require('../api/squareOdbc/squareOdbc.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x38')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x39')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/squareMessage/squareMessage.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/campaign/campaign.rpc'));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x3a')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/plugin/plugin.rpc'));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x3b')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require(_0x0dfa('0x3c')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x3d')));_0x45a28e=_['merge'](_0x45a28e,require(_0x0dfa('0x3e')));_0x45a28e=_[_0x0dfa('0x3')](_0x45a28e,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3a06d0=jayson[_0x0dfa('0x3f')](_0x45a28e)[_0x0dfa('0x40')]();var _0x4760b8=config[_0x0dfa('0x41')][_0x0dfa('0x42')]||config['port']+0x1;var _0x312ac0=config[_0x0dfa('0x41')]['ip']||_0x0dfa('0x43');_0x3a06d0['on'](_0x0dfa('0x44'),function(_0x42f2d9){return _0x139d96(_0x42f2d9);});_0x3a06d0[_0x0dfa('0x2')](_0x4760b8,_0x312ac0,function(){console[_0x0dfa('0x45')](_0x0dfa('0x46'),_0x312ac0,_0x4760b8);require(_0x0dfa('0x47'))[_0x0dfa('0x48')]();return _0x4cd9ac(_0x0dfa('0x49')+_0x312ac0+':'+_0x4760b8);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 09e39d4..220a5b3 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 _0x5707=['line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','result=','indexOf','substr','startsWith','split','length','match','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','prototype','sync','answer','sendRequest','ANSWER','getData','beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','error','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x5707,0x134));var _0x7570=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x5707[_0x2ab3d9];return _0x210a54;};'use strict';var util=require(_0x7570('0x0'));var _=require(_0x7570('0x1'));var EventEmitter=require(_0x7570('0x2'))[_0x7570('0x3')];var AGIReply=require(_0x7570('0x4'));var AGIError=require(_0x7570('0x5'));function AGIChannel(_0x16f106){var _0x345865=this,_0x1f22de=new AGIReply(),_0x444556=![],_0x1def11={};EventEmitter[_0x7570('0x6')](_0x345865);_0x16f106[_0x7570('0x7')](_0x7570('0x8'));_0x16f106[_0x7570('0x9')](0x8*0x3c*0x3c*0x3e8);_0x1f22de[_0x7570('0x7')](_0x7570('0x8'));_0x1f22de['on']('headers',function(_0x483301){for(var _0x3871c1 in _0x483301){_0x345865[_0x3871c1]=_0x483301[_0x3871c1];}_0x345865[_0x7570('0xa')](_0x7570('0xb'));});_0x1f22de['on'](_0x7570('0xc'),function(_0x16937f){if(_0x16937f['toLowerCase']()==_0x7570('0xd')){_0x345865['emit']('hangup');return;}if(_0x16937f[_0x7570('0xe')](0x0,0xb)==_0x7570('0xf')){_0x444556=!![];}if(_0x444556){_0x1def11['rx']+=_0x16937f+'\x0a';if(_0x16937f[_0x7570('0x10')](_0x7570('0x11'))!=-0x1){_0x444556=![];}}else{_0x1def11['rx']=_0x16937f;}if(_0x444556){return;}if(typeof _0x1def11['cb']==_0x7570('0x12')){var _0x3b139f=_0x1def11['rx']['substring'](0x0,0x3),_0x3dadbd=null,_0x6896c3=null;_0x3b139f=parseInt(_0x3b139f);if(isNaN(_0x3b139f)){_0x1def11['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x3b139f!=0xc8){_0x1def11['cb'](null,{'code':_0x3b139f,'result':-0x1,'extra':'KO'});return;}_0x3dadbd=_0x1def11['rx'][_0x7570('0xe')](0x4)['replace'](_0x7570('0x13'),'');if(_0x3dadbd[_0x7570('0x14')]('\x20')!=-0x1){_0x3dadbd=_0x3dadbd[_0x7570('0x15')](0x0,_0x3dadbd['indexOf']('\x20'));}if(_[_0x7570('0x16')](_0x3dadbd,'-1')){_0x3dadbd=parseInt(_0x3dadbd);}_0x6896c3=_0x1def11['rx'][_0x7570('0x17')]('\x20');if(_0x6896c3[_0x7570('0x18')]==0x3){_0x6896c3=_0x6896c3[0x2]['substring'](0x1,_0x6896c3[0x2]['length']-0x1);}else if(_0x6896c3['length']>0x3){var _0x1b2ca3=/\((.+)\)/;var _0x165290=_0x1def11['rx'][_0x7570('0x19')](_0x1b2ca3);if(_0x165290){_0x6896c3=_0x165290[0x1];}else{_0x6896c3=null;}}else{_0x6896c3=null;}_0x1def11['cb'](null,{'code':_0x3b139f,'result':_0x3dadbd,'extra':_0x6896c3});}});_0x16f106['on']('error',function(_0x3eba90){_0x345865[_0x7570('0xa')]('error',new AGIError(_0x7570('0x1a'),_0x3eba90[_0x7570('0x1b')]));});_0x16f106['on'](_0x7570('0x1c'),function(){_0x345865['emit'](_0x7570('0x1c'),new AGIError(_0x7570('0x1d')));});_0x16f106['on'](_0x7570('0x1e'),function(){_0x345865[_0x7570('0xa')]('timeout',new AGIError(_0x7570('0x1f')));_0x16f106[_0x7570('0x20')]();});_0x16f106[_0x7570('0x21')](_0x1f22de);this[_0x7570('0x22')]=function(_0x38bf9a,_0x398e74){var _0x38bf9a=_0x38bf9a||'',_0x398e74=typeof _0x398e74==_0x7570('0x12')?_0x398e74:new Function();_0x1def11={'tx':_0x38bf9a,'rx':'','cb':_0x398e74};_0x16f106[_0x7570('0x23')](_0x38bf9a+'\x0a');},this[_0x7570('0x1c')]=function(){_0x16f106[_0x7570('0x20')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x7570('0x24')]['sendRequest']=function(_0x3bace1){return this[_0x7570('0x22')][_0x7570('0x25')](this,_0x3bace1);};AGIChannel[_0x7570('0x24')][_0x7570('0x26')]=function(){return this[_0x7570('0x27')](_0x7570('0x28'));};AGIChannel[_0x7570('0x24')][_0x7570('0x29')]=function(_0x4cfdd0,_0x2a3f32,_0x531de5){_0x4cfdd0=_0x4cfdd0===undefined?_0x7570('0x2a'):_0x4cfdd0;_0x2a3f32=_0x2a3f32===undefined?'5':_0x2a3f32;_0x531de5=_0x531de5===undefined?'1':_0x531de5;return this[_0x7570('0x27')](util[_0x7570('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4cfdd0,_0x2a3f32*0x3e8,_0x531de5));};AGIChannel[_0x7570('0x24')]['noop']=function(_0x59e423){_0x59e423=_0x59e423||_0x7570('0x2c');return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x2d'),_0x59e423));};AGIChannel[_0x7570('0x24')][_0x7570('0x2e')]=function(_0xe0ce4b,_0xf9040c){if(_[_0x7570('0x2f')](_0xf9040c)){return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x30'),_0xe0ce4b,_0xf9040c['join'](',')));}return this[_0x7570('0x27')](util['format']('EXEC\x20%s\x20%s',_0xe0ce4b,_0xf9040c));};AGIChannel[_0x7570('0x24')][_0x7570('0x31')]=function(_0x4650b4){return this['sendRequest'](util[_0x7570('0x2b')](_0x7570('0x32'),_0x4650b4));};AGIChannel[_0x7570('0x24')][_0x7570('0x33')]=function(_0x4a1813){return this['sendRequest'](util['format'](_0x7570('0x34'),_0x4a1813));};AGIChannel[_0x7570('0x24')][_0x7570('0x35')]=function(_0x50a264){return this[_0x7570('0x27')](util[_0x7570('0x2b')]('SET\x20PRIORITY\x20%s',_0x50a264));};AGIChannel[_0x7570('0x24')][_0x7570('0xd')]=function(){return this[_0x7570('0x27')](_0x7570('0x36'));};AGIChannel[_0x7570('0x24')][_0x7570('0x37')]=function(_0x459039,_0x5b05e8){var _0x4416db=_['isBoolean'](_0x5b05e8)||_['isNumber'](_0x5b05e8)?_0x5b05e8[_0x7570('0x38')]():_0x5b05e8;return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x39'),_0x459039,_0x4416db?_0x4416db['toString']()[_0x7570('0x3a')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x7570('0x3b')]=function(_0x290df4,_0x130a1b){return this['sendRequest'](util[_0x7570('0x2b')](_0x7570('0x3c'),_0x290df4,_0x130a1b));};AGIChannel[_0x7570('0x24')][_0x7570('0x3d')]=function(_0xc5c098,_0x19a379){return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x3e'),_0xc5c098,_0x19a379));};AGIChannel[_0x7570('0x24')][_0x7570('0x3f')]=function(_0x442f3a,_0x3014aa){return this['sendRequest'](util[_0x7570('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x442f3a,_0x3014aa));};AGIChannel[_0x7570('0x24')][_0x7570('0x40')]=function(_0x414123,_0x4f8f17,_0x2c1a33){_0x4f8f17=_0x4f8f17||this['extension'];_0x2c1a33=_0x2c1a33||0x1;this[_0x7570('0x31')](_0x414123);this[_0x7570('0x33')](_0x4f8f17);this[_0x7570('0x35')](_0x2c1a33);return this[_0x7570('0x41')](util[_0x7570('0x2b')](_0x7570('0x42'),_0x414123,_0x4f8f17,_0x2c1a33));};AGIChannel['prototype'][_0x7570('0x43')]=function(_0x1f777d){return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x44'),_0x1f777d));};AGIChannel[_0x7570('0x24')][_0x7570('0x45')]=function(_0x5d1f05,_0x436212,_0x277319,_0x985b02,_0x5cd551,_0x21f322){_0x436212=_0x436212||_0x7570('0x46');_0x277319=_0x277319||'';_0x985b02=_0x985b02===undefined?-0x1:_0x985b02==='-1'?-0x1:_0x985b02*0x3e8;_0x5cd551=_0x5cd551===undefined?'':'s='+_0x5cd551;_0x21f322=_0x21f322?_0x7570('0x47'):'';return this['sendRequest'](util[_0x7570('0x2b')](_0x7570('0x48'),_0x5d1f05,_0x436212,_0x277319,_0x985b02,_0x21f322,_0x5cd551));};AGIChannel[_0x7570('0x24')][_0x7570('0x49')]=function(_0x563c6e,_0x57af34){_0x57af34=_0x57af34||'';return this[_0x7570('0x27')](util[_0x7570('0x2b')](_0x7570('0x4a'),_0x563c6e,_0x57af34));};AGIChannel['prototype'][_0x7570('0x4b')]=function(_0x4222f7){return this[_0x7570('0x2e')](_0x7570('0x4c'),_0x4222f7);};AGIChannel[_0x7570('0x24')]['wait']=function(_0x4e649b){return this[_0x7570('0x2e')](_0x7570('0x4d'),_0x4e649b);};AGIChannel['prototype'][_0x7570('0x4e')]=function(_0xd2dd96,_0x4a8fdf){this['noop'](util[_0x7570('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0xd2dd96['id'],_0xd2dd96[_0x7570('0x4f')],_0x4a8fdf));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xc967=['setTimeout','headers','emit','ready','line','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','substr','indexOf','split','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','toString','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8'];(function(_0x576d97,_0x4da04c){var _0x477f6a=function(_0x555ae8){while(--_0x555ae8){_0x576d97['push'](_0x576d97['shift']());}};_0x477f6a(++_0x4da04c);}(_0xc967,0x1b3));var _0x7c96=function(_0x4f6c62,_0x4e0267){_0x4f6c62=_0x4f6c62-0x0;var _0x4f6d3e=_0xc967[_0x4f6c62];return _0x4f6d3e;};'use strict';var util=require(_0x7c96('0x0'));var _=require(_0x7c96('0x1'));var EventEmitter=require(_0x7c96('0x2'))[_0x7c96('0x3')];var AGIReply=require(_0x7c96('0x4'));var AGIError=require(_0x7c96('0x5'));function AGIChannel(_0x4fd46d){var _0x518c8f=this,_0x42508e=new AGIReply(),_0x37cb3b=![],_0x578a5d={};EventEmitter[_0x7c96('0x6')](_0x518c8f);_0x4fd46d[_0x7c96('0x7')](_0x7c96('0x8'));_0x4fd46d[_0x7c96('0x9')](0x8*0x3c*0x3c*0x3e8);_0x42508e[_0x7c96('0x7')]('utf8');_0x42508e['on'](_0x7c96('0xa'),function(_0x5697d0){for(var _0x29cbab in _0x5697d0){_0x518c8f[_0x29cbab]=_0x5697d0[_0x29cbab];}_0x518c8f[_0x7c96('0xb')](_0x7c96('0xc'));});_0x42508e['on'](_0x7c96('0xd'),function(_0x2d9d54){if(_0x2d9d54['toLowerCase']()==_0x7c96('0xe')){_0x518c8f[_0x7c96('0xb')](_0x7c96('0xe'));return;}if(_0x2d9d54[_0x7c96('0xf')](0x0,0xb)=='520-Invalid'){_0x37cb3b=!![];}if(_0x37cb3b){_0x578a5d['rx']+=_0x2d9d54+'\x0a';if(_0x2d9d54[_0x7c96('0x10')](_0x7c96('0x11'))!=-0x1){_0x37cb3b=![];}}else{_0x578a5d['rx']=_0x2d9d54;}if(_0x37cb3b){return;}if(typeof _0x578a5d['cb']==_0x7c96('0x12')){var _0x7d14ea=_0x578a5d['rx'][_0x7c96('0xf')](0x0,0x3),_0x1b3c55=null,_0x17af32=null;_0x7d14ea=parseInt(_0x7d14ea);if(isNaN(_0x7d14ea)){_0x578a5d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x7c96('0x13')});return;}if(_0x7d14ea!=0xc8){_0x578a5d['cb'](null,{'code':_0x7d14ea,'result':-0x1,'extra':'KO'});return;}_0x1b3c55=_0x578a5d['rx'][_0x7c96('0xf')](0x4)[_0x7c96('0x14')]('result=','');if(_0x1b3c55['indexOf']('\x20')!=-0x1){_0x1b3c55=_0x1b3c55[_0x7c96('0x15')](0x0,_0x1b3c55[_0x7c96('0x16')]('\x20'));}if(_['startsWith'](_0x1b3c55,'-1')){_0x1b3c55=parseInt(_0x1b3c55);}_0x17af32=_0x578a5d['rx'][_0x7c96('0x17')]('\x20');if(_0x17af32['length']==0x3){_0x17af32=_0x17af32[0x2][_0x7c96('0xf')](0x1,_0x17af32[0x2]['length']-0x1);}else if(_0x17af32[_0x7c96('0x18')]>0x3){var _0x414d21=/\((.+)\)/;var _0x5d214b=_0x578a5d['rx']['match'](_0x414d21);if(_0x5d214b){_0x17af32=_0x5d214b[0x1];}else{_0x17af32=null;}}else{_0x17af32=null;}_0x578a5d['cb'](null,{'code':_0x7d14ea,'result':_0x1b3c55,'extra':_0x17af32});}});_0x4fd46d['on'](_0x7c96('0x19'),function(_0x367987){_0x518c8f['emit'](_0x7c96('0x19'),new AGIError(_0x7c96('0x1a'),_0x367987['code']));});_0x4fd46d['on'](_0x7c96('0x1b'),function(){_0x518c8f['emit'](_0x7c96('0x1b'),new AGIError(_0x7c96('0x1c')));});_0x4fd46d['on'](_0x7c96('0x1d'),function(){_0x518c8f[_0x7c96('0xb')]('timeout',new AGIError(_0x7c96('0x1e')));_0x4fd46d[_0x7c96('0x1f')]();});_0x4fd46d['pipe'](_0x42508e);this[_0x7c96('0x20')]=function(_0x1e504f,_0x1971f0){var _0x1e504f=_0x1e504f||'',_0x1971f0=typeof _0x1971f0=='function'?_0x1971f0:new Function();_0x578a5d={'tx':_0x1e504f,'rx':'','cb':_0x1971f0};_0x4fd46d[_0x7c96('0x21')](_0x1e504f+'\x0a');},this['close']=function(){_0x4fd46d[_0x7c96('0x1f')]();};}util[_0x7c96('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x7c96('0x23')][_0x7c96('0x24')]=function(_0xdebb33){return this[_0x7c96('0x20')][_0x7c96('0x25')](this,_0xdebb33);};AGIChannel[_0x7c96('0x23')]['answer']=function(){return this[_0x7c96('0x24')](_0x7c96('0x26'));};AGIChannel['prototype'][_0x7c96('0x27')]=function(_0x14ba83,_0x19c45f,_0x318caf){_0x14ba83=_0x14ba83===undefined?_0x7c96('0x28'):_0x14ba83;_0x19c45f=_0x19c45f===undefined?'5':_0x19c45f;_0x318caf=_0x318caf===undefined?'1':_0x318caf;return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x2a'),_0x14ba83,_0x19c45f*0x3e8,_0x318caf));};AGIChannel['prototype'][_0x7c96('0x2b')]=function(_0x36aaf8){_0x36aaf8=_0x36aaf8||_0x7c96('0x2c');return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x2d'),_0x36aaf8));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x2e')]=function(_0x2644c9,_0x211b4d){if(_['isArray'](_0x211b4d)){return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x2f'),_0x2644c9,_0x211b4d[_0x7c96('0x30')](',')));}return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x2f'),_0x2644c9,_0x211b4d));};AGIChannel[_0x7c96('0x23')]['setContext']=function(_0x29b63f){return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x31'),_0x29b63f));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x32')]=function(_0x449bd6){return this[_0x7c96('0x24')](util[_0x7c96('0x29')]('SET\x20EXTENSION\x20%s',_0x449bd6));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x33')]=function(_0x1d8d21){return this[_0x7c96('0x24')](util[_0x7c96('0x29')](_0x7c96('0x34'),_0x1d8d21));};AGIChannel[_0x7c96('0x23')][_0x7c96('0xe')]=function(){return this['sendRequest'](_0x7c96('0x35'));};AGIChannel[_0x7c96('0x23')]['setVariable']=function(_0x565d12,_0x187fad){var _0x5b4362=_['isBoolean'](_0x187fad)||_['isNumber'](_0x187fad)?_0x187fad[_0x7c96('0x36')]():_0x187fad;return this[_0x7c96('0x24')](util[_0x7c96('0x29')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x565d12,_0x5b4362?_0x5b4362[_0x7c96('0x36')]()[_0x7c96('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7c96('0x23')]['sayNumber']=function(_0xd2466e,_0x5a3fa0){return this['sendRequest'](util[_0x7c96('0x29')]('SAY\x20NUMBER\x20%s\x20%s',_0xd2466e,_0x5a3fa0));};AGIChannel['prototype']['sayDigits']=function(_0x371538,_0x3cd03d){return this['sendRequest'](util[_0x7c96('0x29')](_0x7c96('0x37'),_0x371538,_0x3cd03d));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x38')]=function(_0x2f605b,_0x4b775c){return this[_0x7c96('0x24')](util[_0x7c96('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x2f605b,_0x4b775c));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x39')]=function(_0x436368,_0x425144,_0x148e05){_0x425144=_0x425144||this[_0x7c96('0x3a')];_0x148e05=_0x148e05||0x1;this[_0x7c96('0x3b')](_0x436368);this[_0x7c96('0x32')](_0x425144);this[_0x7c96('0x33')](_0x148e05);return this[_0x7c96('0x2b')](util[_0x7c96('0x29')](_0x7c96('0x3c'),_0x436368,_0x425144,_0x148e05));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x3d')]=function(_0x2c0edf){return this['sendRequest'](util['format'](_0x7c96('0x3e'),_0x2c0edf));};AGIChannel['prototype'][_0x7c96('0x3f')]=function(_0x166fbc,_0x477306,_0x8f7f72,_0x23c053,_0x119780,_0x4e0bf9){_0x477306=_0x477306||_0x7c96('0x40');_0x8f7f72=_0x8f7f72||'';_0x23c053=_0x23c053===undefined?-0x1:_0x23c053==='-1'?-0x1:_0x23c053*0x3e8;_0x119780=_0x119780===undefined?'':'s='+_0x119780;_0x4e0bf9=_0x4e0bf9?_0x7c96('0x41'):'';return this[_0x7c96('0x24')](util[_0x7c96('0x29')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x166fbc,_0x477306,_0x8f7f72,_0x23c053,_0x4e0bf9,_0x119780));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x42')]=function(_0x2d0463,_0x306662){_0x306662=_0x306662||'';return this['sendRequest'](util[_0x7c96('0x29')](_0x7c96('0x43'),_0x2d0463,_0x306662));};AGIChannel[_0x7c96('0x23')][_0x7c96('0x44')]=function(_0x65dcef){return this[_0x7c96('0x2e')]('AGI',_0x65dcef);};AGIChannel['prototype'][_0x7c96('0x45')]=function(_0x51d195){return this[_0x7c96('0x2e')](_0x7c96('0x46'),_0x51d195);};AGIChannel[_0x7c96('0x23')][_0x7c96('0x19')]=function(_0x4605b4,_0x4910b3){this[_0x7c96('0x2b')](util[_0x7c96('0x29')](_0x7c96('0x47'),_0x4605b4['id'],_0x4605b4[_0x7c96('0x48')],_0x4910b3));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7c96('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 5486340..c1c2e35 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 _0x3ab0=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x49bd80,_0x53e5fe){var _0x2ccc98=function(_0x4496f4){while(--_0x4496f4){_0x49bd80['push'](_0x49bd80['shift']());}};_0x2ccc98(++_0x53e5fe);}(_0x3ab0,0xb1));var _0x03ab=function(_0x5c7753,_0x501726){_0x5c7753=_0x5c7753-0x0;var _0x5e5005=_0x3ab0[_0x5c7753];return _0x5e5005;};'use strict';var util=require(_0x03ab('0x0'));var error={'E_AGI_UNDEFINED':_0x03ab('0x1'),'E_AGI_ARGUMENT_PORT':_0x03ab('0x2'),'E_AGI_SERVER_ERROR':_0x03ab('0x3'),'E_AGI_SERVER_CLOSE':_0x03ab('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x03ab('0x5'),'E_AGI_SOCKET_ERROR':_0x03ab('0x6'),'E_AGI_SOCKET_CLOSE':_0x03ab('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x03ab('0x8'),'E_AGI_COMMAND_EMPTY':_0x03ab('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x03ab('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x424254){var _0x424254=_0x424254||null,_0x33c323=_0x33c323||[],_0x2eef1f=0x1,_0x44bf54='';if(!error[_0x424254]){_0x424254=_0x03ab('0xb');}_0x33c323[_0x03ab('0xc')](error[_0x424254]);while(arguments[_0x2eef1f]){_0x33c323[_0x03ab('0xc')](arguments[_0x2eef1f]);_0x2eef1f++;}_0x44bf54=util[_0x03ab('0xd')]['apply'](util,_0x33c323);this['message']=_0x44bf54;this['name']=_0x424254;}module['exports']=AGIError; \ No newline at end of file +var _0x522f=['Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','exports','util','Undefined\x20error.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x568496,_0x565afd){var _0x26c5c1=function(_0x4d251e){while(--_0x4d251e){_0x568496['push'](_0x568496['shift']());}};_0x26c5c1(++_0x565afd);}(_0x522f,0x1f0));var _0xf522=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x522f[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0xf522('0x0'));var error={'E_AGI_UNDEFINED':_0xf522('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xf522('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xf522('0x3'),'E_AGI_SOCKET_ERROR':_0xf522('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xf522('0x5'),'E_AGI_COMMAND_EMPTY':_0xf522('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf522('0x7'),'E_AGI_IVR_ENTRY':_0xf522('0x8')};function AGIError(_0x163491){var _0x163491=_0x163491||null,_0xa88798=_0xa88798||[],_0x5e6981=0x1,_0x3069fe='';if(!error[_0x163491]){_0x163491=_0xf522('0x9');}_0xa88798[_0xf522('0xa')](error[_0x163491]);while(arguments[_0x5e6981]){_0xa88798[_0xf522('0xa')](arguments[_0x5e6981]);_0x5e6981++;}_0x3069fe=util[_0xf522('0xb')]['apply'](util,_0xa88798);this[_0xf522('0xc')]=_0x3069fe;this['name']=_0x163491;}module[_0xf522('0xd')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 62e2bba..bcd9c94 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 _0x60eb=['localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','lodash','EventEmitter','ioredis','./error','../../config/environment','redis'];(function(_0x439ed4,_0x5e70a9){var _0x1b1bb0=function(_0x39832e){while(--_0x39832e){_0x439ed4['push'](_0x439ed4['shift']());}};_0x1b1bb0(++_0x5e70a9);}(_0x60eb,0x9f));var _0xb60e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x60eb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xb60e('0x0'));var EventEmitter=require('events')[_0xb60e('0x1')];var Redis=require(_0xb60e('0x2'));var AGIError=require(_0xb60e('0x3'));var config=require(_0xb60e('0x4'));config['redis']=_['defaults'](config[_0xb60e('0x5')],{'host':_0xb60e('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xb60e('0x5')]);sub[_0xb60e('0x7')](_0xb60e('0x8'),function(_0x4bc341){if(_0x4bc341)return eventEmitter[_0xb60e('0x9')](_0xb60e('0xa'),new AGIError(_0xb60e('0xb'),_0x4bc341));});sub['on'](_0xb60e('0xc'),function(_0x10c9e7,_0x14c054){if(_0x10c9e7!==_0xb60e('0x8'))return;try{var _0x542824=JSON[_0xb60e('0xd')](_0x14c054);eventEmitter[_0xb60e('0x9')](_0xb60e('0xe'),_0x542824);}catch(_0x3dd764){eventEmitter[_0xb60e('0x9')](_0xb60e('0xa'),new AGIError(_0xb60e('0xb'),_0x3dd764));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x6c68=['EventEmitter','ioredis','../../config/environment','redis','defaults','localhost','agi','error','E_AGI_SERVER_ERROR','message','emit','projectUpdate','lodash','events'];(function(_0x2d943c,_0x26d984){var _0x2af2e0=function(_0x17bbaa){while(--_0x17bbaa){_0x2d943c['push'](_0x2d943c['shift']());}};_0x2af2e0(++_0x26d984);}(_0x6c68,0x14e));var _0x86c6=function(_0xfb675c,_0x2cfb12){_0xfb675c=_0xfb675c-0x0;var _0x56179a=_0x6c68[_0xfb675c];return _0x56179a;};'use strict';var _=require(_0x86c6('0x0'));var EventEmitter=require(_0x86c6('0x1'))[_0x86c6('0x2')];var Redis=require(_0x86c6('0x3'));var AGIError=require('./error');var config=require(_0x86c6('0x4'));config[_0x86c6('0x5')]=_[_0x86c6('0x6')](config['redis'],{'host':_0x86c6('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x86c6('0x5')]);sub['subscribe'](_0x86c6('0x8'),function(_0x2794f1){if(_0x2794f1)return eventEmitter['emit'](_0x86c6('0x9'),new AGIError(_0x86c6('0xa'),_0x2794f1));});sub['on'](_0x86c6('0xb'),function(_0x3f9a54,_0x4332f8){if(_0x3f9a54!==_0x86c6('0x8'))return;try{var _0x36fc7c=JSON['parse'](_0x4332f8);eventEmitter[_0x86c6('0xc')](_0x86c6('0xd'),_0x36fc7c);}catch(_0xf05276){eventEmitter[_0x86c6('0xc')]('error',new AGIError(_0x86c6('0xa'),_0xf05276));}});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 2f26466..1996119 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 _0xb5ef=['prototype','addVertex','vertices','addEdge','push','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','condition','length','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges'];(function(_0x242edb,_0x228d97){var _0x5e188b=function(_0x52e659){while(--_0x52e659){_0x242edb['push'](_0x242edb['shift']());}};_0x5e188b(++_0x228d97);}(_0xb5ef,0x178));var _0xfb5e=function(_0x6a60fe,_0x2c1d99){_0x6a60fe=_0x6a60fe-0x0;var _0x123251=_0xb5ef[_0x6a60fe];return _0x123251;};'use strict';var _=require(_0xfb5e('0x0'));var logger=require(_0xfb5e('0x1'))(_0xfb5e('0x2'));var verticesWithRetry=[_0xfb5e('0x3'),_0xfb5e('0x4'),_0xfb5e('0x5')];var Graph=function(){this['vertices']={};this[_0xfb5e('0x6')]={};this[_0xfb5e('0x7')]=0x0;};Graph[_0xfb5e('0x8')][_0xfb5e('0x9')]=function(_0xc6ab05){this[_0xfb5e('0xa')][_0xc6ab05['id']]=_0xc6ab05;this[_0xfb5e('0x6')][_0xc6ab05['id']]=[];};Graph[_0xfb5e('0x8')][_0xfb5e('0xb')]=function(_0x4da7d4,_0x2fe3c1,_0x3cf938){this[_0xfb5e('0x6')][_0x4da7d4][_0xfb5e('0xc')]({'target':_0x2fe3c1,'condition':_0x3cf938});this['numberOfEdges']+=0x1;};Graph[_0xfb5e('0x8')]['size']=function(){return _['size'](this[_0xfb5e('0xa')]);};Graph['prototype'][_0xfb5e('0xd')]=function(){return this[_0xfb5e('0x7')];};Graph[_0xfb5e('0x8')][_0xfb5e('0xe')]=function(_0x154544){return this[_0xfb5e('0xa')][_0x154544];};Graph['prototype'][_0xfb5e('0xf')]=function(_0x803f24,_0x30813f){if(!this['vertices'][_0x803f24]){return logger[_0xfb5e('0x10')](_0xfb5e('0x11'));}var _0x5db024=_0x30813f(this[_0xfb5e('0xa')][_0x803f24]);if(!_0x5db024){return logger[_0xfb5e('0x10')](_0xfb5e('0x12'));}if(this[_0xfb5e('0x6')][_0x803f24]['length']===0x0){return logger['info'](_0xfb5e('0x13'));}for(var _0x3223c5=0x0,_0x303385=[],_0x19d987=![];_0x3223c5\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED'];(function(_0x1f98af,_0x238acf){var _0x2fabf7=function(_0x2ece53){while(--_0x2ece53){_0x1f98af['push'](_0x1f98af['shift']());}};_0x2fabf7(++_0x238acf);}(_0x54f1,0x17a));var _0x154f=function(_0x39e024,_0x20ef41){_0x39e024=_0x39e024-0x0;var _0x99dbb3=_0x54f1[_0x39e024];return _0x99dbb3;};'use strict';var _=require(_0x154f('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0x154f('0x1'));var logger=require('../../config/logger')(_0x154f('0x2'));var utilLicense=require(_0x154f('0x3'));var rpc=require(_0x154f('0x4'));var Project=require(_0x154f('0x5'));var AGIEmitter=require(_0x154f('0x6'))['EventEmitter'];var projects=[];config['agi']=_[_0x154f('0x7')](config[_0x154f('0x2')],{'ip':_0x154f('0x8'),'port':0x11dd});AGIEmitter['on'](_0x154f('0x9'),projectUpdateHandler);function connectionHandler(_0x546746){process[_0x154f('0xa')](function(){syncho(function(){try{setChannelVariables(_0x546746);agiHandler(_0x546746);}catch(_0x1b0f4a){logger[_0x154f('0xb')](_0x1b0f4a[_0x154f('0xc')]);}});});}function projectUpdateHandler(_0x171325){try{var _0x30fd6f=_[_0x154f('0xd')](projects,['id',_0x171325['id']]);if(_0x30fd6f>-0x1){if(_0x171325[_0x154f('0xe')]===!![]){projects[_0x154f('0xf')](_0x30fd6f,0x1);}else{projects[_0x30fd6f]=_0x171325;}}else{projects['push'](_0x171325);}}catch(_0x194e14){logger[_0x154f('0xb')](_0x194e14['stack']);}}function listeningHandler(){console[_0x154f('0x10')](_0x154f('0x11'),config['agi'][_0x154f('0x12')]);logger['info'](util[_0x154f('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x154f('0x2')]['ip'],config[_0x154f('0x2')]['port']));}function errorHandler(_0x47ce56){if(_0x47ce56&&_0x47ce56[_0x154f('0x14')]&&_0x47ce56['message']){logger[_0x154f('0xb')](util[_0x154f('0x13')](_0x154f('0x15'),_0x47ce56[_0x154f('0x14')],_0x47ce56[_0x154f('0x16')]));}else{logger[_0x154f('0xb')](util[_0x154f('0x13')](_0x154f('0x17'),_0x47ce56[_0x154f('0xc')]));}}function closeHandler(){logger[_0x154f('0x18')](util[_0x154f('0x13')](_0x154f('0x19'),this['arg_1'],this[_0x154f('0x1a')],this[_0x154f('0x1b')],this[_0x154f('0x1c')],this[_0x154f('0x1d')]));try{createSquareReport(this);}catch(_0x50daaa){logger[_0x154f('0xb')](_0x50daaa[_0x154f('0xc')]);}}function timeoutHandler(){logger[_0x154f('0x18')](util[_0x154f('0x13')](_0x154f('0x1e'),this[_0x154f('0x1f')],this[_0x154f('0x1a')],this[_0x154f('0x1b')],this['dnid'],this[_0x154f('0x1d')]));}function hangupHandler(){logger[_0x154f('0x18')](util['format'](_0x154f('0x20'),this['arg_1'],this['calleridname'],this[_0x154f('0x1b')],this[_0x154f('0x1c')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x112d2d,_0xce29c6){rpc[_0x154f('0x21')](_0x112d2d)[_0x154f('0x22')](function(_0x57b68b){if(_0xce29c6){_0xce29c6(null,_0x57b68b);}})['catch'](function(_0x4a9692){if(_0xce29c6){_0xce29c6(null,_0x4a9692);}});}function setChannelVariables(_0x2c8caa){for(var _0x3ec5ec in _0x2c8caa){if(_0x2c8caa[_0x154f('0x23')](_0x3ec5ec)){if(_0x3ec5ec[_0x154f('0x24')](_0x154f('0x25'))===0x0){_0x2c8caa[_0x3ec5ec[_0x154f('0x26')](0x4)]=_0x2c8caa[_0x3ec5ec];delete _0x2c8caa[_0x3ec5ec];}}}}function agiHandler(_0x51f333){logger[_0x154f('0x27')](_0x154f('0x28'),JSON[_0x154f('0x29')](_0x51f333,null,0x2));logger[_0x154f('0x18')](util[_0x154f('0x13')](_0x154f('0x2a'),_0x51f333[_0x154f('0x1f')],_0x51f333[_0x154f('0x1a')],_0x51f333[_0x154f('0x1b')],_0x51f333[_0x154f('0x1c')],_0x51f333[_0x154f('0x1d')]));_0x51f333['on'](_0x154f('0xb'),errorHandler);_0x51f333['on'](_0x154f('0x2b'),closeHandler);_0x51f333['on'](_0x154f('0x2c'),timeoutHandler);_0x51f333['evtHangup']=![];_0x51f333['on'](_0x154f('0x2d'),hangupHandler);var _0x57e1dd=_[_0x154f('0x2e')](projects,[_0x154f('0x14'),_0x51f333[_0x154f('0x1f')]]);if(!_0x57e1dd)return Project[_0x154f('0x2f')](_0x51f333);if(!_0x57e1dd[_0x154f('0x30')])return Project[_0x154f('0x31')](_0x51f333);return Project[_0x154f('0x32')](_0x57e1dd,_0x51f333);}function main(){var _0x55a085;return utilLicense[_0x154f('0x33')]()[_0x154f('0x22')](function(_0x52a09c){if(!_0x52a09c)return;if(_0x52a09c[_0x154f('0x34')]){if(_0x52a09c[_0x154f('0x35')]&&_0x52a09c['callysquare']>0x0){logger[_0x154f('0x18')](util[_0x154f('0x13')](_0x154f('0x36'),_0x52a09c['callysquare']));_0x55a085=_0x52a09c[_0x154f('0x35')];}else{logger[_0x154f('0x18')](_0x154f('0x37'));}}else{logger[_0x154f('0x18')](_0x154f('0x38'));_0x55a085=-0x1;}})[_0x154f('0x22')](function(){return Project[_0x154f('0x39')]();})[_0x154f('0x22')](function(_0x416ebf){projects=_0x416ebf;return;})['catch'](function(_0x37e63a){logger[_0x154f('0xb')](_0x154f('0x3a'),_0x37e63a['stack']);})[_0x154f('0x3b')](function(){var _0x5a0f05=require(_0x154f('0x3c'))(config[_0x154f('0x2')]['port'],config[_0x154f('0x2')]['ip'],_0x55a085);_0x5a0f05['on'](_0x154f('0xb'),errorHandler);_0x5a0f05['on']('listening',listeningHandler);_0x5a0f05['on'](_0x154f('0x3d'),connectionHandler);_0x5a0f05['on'](_0x154f('0x2b'),closeHandler);});}main(); \ No newline at end of file +var _0x621a=['handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','getAll','[LICENSE]','finally','./server','listening','connection','close','lodash','syncho','util','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','arg_1','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','find','handleNotFound'];(function(_0x2112e7,_0x5590b5){var _0x227583=function(_0x429208){while(--_0x429208){_0x2112e7['push'](_0x2112e7['shift']());}};_0x227583(++_0x5590b5);}(_0x621a,0x81));var _0xa621=function(_0x52c7f4,_0x2b3ad5){_0x52c7f4=_0x52c7f4-0x0;var _0x513d5b=_0x621a[_0x52c7f4];return _0x513d5b;};'use strict';var _=require(_0xa621('0x0'));var syncho=require(_0xa621('0x1'));var util=require(_0xa621('0x2'));var config=require('../../config/environment');var logger=require(_0xa621('0x3'))(_0xa621('0x4'));var utilLicense=require(_0xa621('0x5'));var rpc=require(_0xa621('0x6'));var Project=require(_0xa621('0x7'));var AGIEmitter=require('./events')[_0xa621('0x8')];var projects=[];config['agi']=_['defaults'](config['agi'],{'ip':_0xa621('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x188c44){process[_0xa621('0xa')](function(){syncho(function(){try{setChannelVariables(_0x188c44);agiHandler(_0x188c44);}catch(_0x2c8cc9){logger[_0xa621('0xb')](_0x2c8cc9[_0xa621('0xc')]);}});});}function projectUpdateHandler(_0x1e6c2c){try{var _0x38280b=_[_0xa621('0xd')](projects,['id',_0x1e6c2c['id']]);if(_0x38280b>-0x1){if(_0x1e6c2c[_0xa621('0xe')]===!![]){projects[_0xa621('0xf')](_0x38280b,0x1);}else{projects[_0x38280b]=_0x1e6c2c;}}else{projects[_0xa621('0x10')](_0x1e6c2c);}}catch(_0x17aaa5){logger[_0xa621('0xb')](_0x17aaa5[_0xa621('0xc')]);}}function listeningHandler(){console[_0xa621('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xa621('0x4')][_0xa621('0x12')]);logger[_0xa621('0x13')](util[_0xa621('0x14')](_0xa621('0x15'),config[_0xa621('0x4')]['ip'],config[_0xa621('0x4')]['port']));}function errorHandler(_0x536392){if(_0x536392&&_0x536392[_0xa621('0x16')]&&_0x536392[_0xa621('0x17')]){logger[_0xa621('0xb')](util[_0xa621('0x14')](_0xa621('0x18'),_0x536392[_0xa621('0x16')],_0x536392['message']));}else{logger[_0xa621('0xb')](util[_0xa621('0x14')](_0xa621('0x19'),_0x536392[_0xa621('0xc')]));}}function closeHandler(){logger[_0xa621('0x13')](util['format']('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xa621('0x1a')],this['calleridname'],this['callerid'],this[_0xa621('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0x59f9bf){logger['error'](_0x59f9bf[_0xa621('0xc')]);}}function timeoutHandler(){logger[_0xa621('0x13')](util[_0xa621('0x14')](_0xa621('0x1c'),this['arg_1'],this[_0xa621('0x1d')],this[_0xa621('0x1e')],this['dnid'],this[_0xa621('0x1f')]));}function hangupHandler(){logger[_0xa621('0x13')](util['format'](_0xa621('0x20'),this[_0xa621('0x1a')],this[_0xa621('0x1d')],this[_0xa621('0x1e')],this['dnid'],this[_0xa621('0x1f')]));this[_0xa621('0x21')]=!![];}function createSquareReport(_0x5834ed,_0x4e445f){rpc['createSquareReport'](_0x5834ed)[_0xa621('0x22')](function(_0x1230d5){if(_0x4e445f){_0x4e445f(null,_0x1230d5);}})[_0xa621('0x23')](function(_0x43b49d){if(_0x4e445f){_0x4e445f(null,_0x43b49d);}});}function setChannelVariables(_0x233580){for(var _0x671692 in _0x233580){if(_0x233580['hasOwnProperty'](_0x671692)){if(_0x671692[_0xa621('0x24')](_0xa621('0x25'))===0x0){_0x233580[_0x671692[_0xa621('0x26')](0x4)]=_0x233580[_0x671692];delete _0x233580[_0x671692];}}}}function agiHandler(_0xd60f11){logger[_0xa621('0x27')]('variables',JSON[_0xa621('0x28')](_0xd60f11,null,0x2));logger[_0xa621('0x13')](util['format'](_0xa621('0x29'),_0xd60f11['arg_1'],_0xd60f11[_0xa621('0x1d')],_0xd60f11['callerid'],_0xd60f11['dnid'],_0xd60f11[_0xa621('0x1f')]));_0xd60f11['on'](_0xa621('0xb'),errorHandler);_0xd60f11['on']('close',closeHandler);_0xd60f11['on'](_0xa621('0x2a'),timeoutHandler);_0xd60f11['evtHangup']=![];_0xd60f11['on']('hangup',hangupHandler);var _0x5ef225=_[_0xa621('0x2b')](projects,[_0xa621('0x16'),_0xd60f11[_0xa621('0x1a')]]);if(!_0x5ef225)return Project[_0xa621('0x2c')](_0xd60f11);if(!_0x5ef225['production'])return Project[_0xa621('0x2d')](_0xd60f11);return Project[_0xa621('0x2e')](_0x5ef225,_0xd60f11);}function main(){var _0x1012e0;return utilLicense[_0xa621('0x2f')]()[_0xa621('0x22')](function(_0x3b6693){if(!_0x3b6693)return;if(_0x3b6693['voice']){if(_0x3b6693[_0xa621('0x30')]&&_0x3b6693['callysquare']>0x0){logger[_0xa621('0x13')](util[_0xa621('0x14')](_0xa621('0x31'),_0x3b6693[_0xa621('0x30')]));_0x1012e0=_0x3b6693['callysquare'];}else{logger[_0xa621('0x13')](_0xa621('0x32'));}}else{logger[_0xa621('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x1012e0=-0x1;}})['then'](function(){return Project[_0xa621('0x33')]();})[_0xa621('0x22')](function(_0x1b3d0a){projects=_0x1b3d0a;return;})[_0xa621('0x23')](function(_0x289782){logger[_0xa621('0xb')](_0xa621('0x34'),_0x289782['stack']);})[_0xa621('0x35')](function(){var _0x2bbfb3=require(_0xa621('0x36'))(config[_0xa621('0x4')]['port'],config['agi']['ip'],_0x1012e0);_0x2bbfb3['on'](_0xa621('0xb'),errorHandler);_0x2bbfb3['on'](_0xa621('0x37'),listeningHandler);_0x2bbfb3['on'](_0xa621('0x38'),connectionHandler);_0x2bbfb3['on'](_0xa621('0x39'),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 dd59b1c..88bb50e 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 _0x4ced=['request','then','error','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x4ced,0xf7));var _0xd4ce=function(_0x5b91f0,_0x330916){_0x5b91f0=_0x5b91f0-0x0;var _0x147471=_0x4ced[_0x5b91f0];return _0x147471;};'use strict';var BPromise=require(_0xd4ce('0x0'));var jayson=require(_0xd4ce('0x1'));var client=jayson['client'][_0xd4ce('0x2')]({'port':0x232b});function request(_0x78c70f,_0x3feb67){return new BPromise(function(_0x368ebf,_0x227850){return client[_0xd4ce('0x3')](_0x78c70f,_0x3feb67)[_0xd4ce('0x4')](function(_0x5acce6){if(_0x5acce6[_0xd4ce('0x5')]){return _0x227850(_0x5acce6[_0xd4ce('0x5')]['message']);}else{return _0x368ebf(_0x5acce6[_0xd4ce('0x6')]);}})[_0xd4ce('0x7')](function(_0x36f731){return _0x227850(_0x36f731);});});}exports[_0xd4ce('0x8')]=function(_0x156afd,_0x4ad28f){return request(_0xd4ce('0x9'),{'account':_0x156afd,'message':_0x4ad28f});}; \ No newline at end of file +var _0x3c4e=['SendMail','bluebird','client','http','request','then','error','message','catch'];(function(_0x4aadc2,_0x4ea7e7){var _0xf41408=function(_0x3efb31){while(--_0x3efb31){_0x4aadc2['push'](_0x4aadc2['shift']());}};_0xf41408(++_0x4ea7e7);}(_0x3c4e,0x1f0));var _0xe3c4=function(_0x2a3e7c,_0x43d6a4){_0x2a3e7c=_0x2a3e7c-0x0;var _0x1318a7=_0x3c4e[_0x2a3e7c];return _0x1318a7;};'use strict';var BPromise=require(_0xe3c4('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xe3c4('0x1')][_0xe3c4('0x2')]({'port':0x232b});function request(_0x17bf56,_0x3451b5){return new BPromise(function(_0x10dc0f,_0x1ad823){return client[_0xe3c4('0x3')](_0x17bf56,_0x3451b5)[_0xe3c4('0x4')](function(_0x3caefc){if(_0x3caefc[_0xe3c4('0x5')]){return _0x1ad823(_0x3caefc[_0xe3c4('0x5')][_0xe3c4('0x6')]);}else{return _0x10dc0f(_0x3caefc['result']);}})[_0xe3c4('0x7')](function(_0x3a15c3){return _0x1ad823(_0x3a15c3);});});}exports['sendMailMessage']=function(_0x56e4e6,_0xc40295){return request(_0xe3c4('0x8'),{'account':_0x56e4e6,'message':_0xc40295});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 145a82a..ace0791 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 _0xb405=['agi','./rpc','./mailRpc','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','value','mxGraphModel','root','inspect','production','start','debug','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','stringify','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','xml2json','util','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb405,0x1ed));var _0x5b40=function(_0x461e57,_0x45b231){_0x461e57=_0x461e57-0x0;var _0x168c0f=_0xb405[_0x461e57];return _0x168c0f;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x5b40('0x0'));var util=require(_0x5b40('0x1'));var logger=require(_0x5b40('0x2'))(_0x5b40('0x3'));var rpc=require(_0x5b40('0x4'));var mailRpc=require(_0x5b40('0x5'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x5b40('0x6')]()[_0x5b40('0x7')](function(_0x2f55a9){logger[_0x5b40('0x8')](_0x5b40('0x9'),_0x2f55a9[_0x5b40('0xa')]);return[];});}function addVertex(_0x8a4fb,_0x210cf3,_0x528161){_0x210cf3[_0x5b40('0xb')]=_0x528161;if(_0x210cf3[_0x5b40('0xc')](_0x5b40('0xd'))){_0x210cf3[_0x5b40('0xe')]=parseInt(_0x210cf3['retry'],0xa);}_0x8a4fb[_0x5b40('0xf')](_[_0x5b40('0x10')](_0x210cf3,'mxCell'));}function initGraph(_0x58ca98,_0x36080c){var _0x5a8758=new Graph();for(var _0x3c7450 in _0x58ca98){if(_0x58ca98['hasOwnProperty'](_0x3c7450)){if(_[_0x5b40('0x11')](_0x58ca98[_0x3c7450])){for(var _0x42dc00=0x0;_0x42dc00<_0x58ca98[_0x3c7450][_0x5b40('0x12')];_0x42dc00+=0x1){addVertex(_0x5a8758,_0x58ca98[_0x3c7450][_0x42dc00],_0x3c7450);}}else{addVertex(_0x5a8758,_0x58ca98[_0x3c7450],_0x3c7450);}}}for(var _0x4ed70a=0x0;_0x4ed70a<_0x36080c[_0x5b40('0x12')];_0x4ed70a+=0x1){if(_0x36080c[_0x4ed70a][_0x5b40('0x13')]&&_0x36080c[_0x4ed70a][_0x5b40('0x14')]){_0x5a8758['addEdge'](_0x36080c[_0x4ed70a][_0x5b40('0x13')],_0x36080c[_0x4ed70a]['target'],_0x36080c[_0x4ed70a][_0x5b40('0x15')]);}}return _0x5a8758;}function getRoot(_0x4f4524){return parser['toJson'](_0x4f4524,{'object':!![]})[_0x5b40('0x16')][_0x5b40('0x17')];}function inspect(_0x3c3ea6){return util[_0x5b40('0x18')](_0x3c3ea6,{'showHidden':![],'depth':null});}function initialize(_0x56c022,_0x14ef6a){var _0x4e54a9=getRoot(_0x56c022[_0x5b40('0x19')]);if(!_0x4e54a9||!_0x4e54a9[_0x5b40('0x1a')])return;var _0x91e6bb,_0x21e71b,_0x2b5155;logger[_0x5b40('0x1b')](_0x5b40('0x17'),JSON['stringify'](_0x4e54a9,null,0x2));_0x14ef6a[_0x5b40('0x1c')]=moment()[_0x5b40('0x1d')](_0x5b40('0x1e'));_0x91e6bb=initGraph(_[_0x5b40('0x10')](_0x4e54a9,_0x5b40('0x1f')),_0x4e54a9[_0x5b40('0x1f')]);_0x21e71b=new Vertices(_0x14ef6a,rpc,mailRpc);logger[_0x5b40('0x20')](util[_0x5b40('0x1d')](_0x5b40('0x21'),_0x14ef6a[_0x5b40('0x22')],_0x14ef6a[_0x5b40('0x23')],_0x14ef6a[_0x5b40('0x24')],_0x14ef6a['dnid'],_0x14ef6a[_0x5b40('0x25')]));_0x91e6bb[_0x5b40('0x26')](_0x4e54a9[_0x5b40('0x1a')]['id'],function(_0x37d0f5){try{_0x37d0f5=_0x21e71b[_0x5b40('0x27')](_0x37d0f5);logger[_0x5b40('0x1b')](_0x5b40('0x28'),JSON['stringify'](_0x37d0f5,null,0x2));if(_0x37d0f5[_0x5b40('0xb')]===_0x5b40('0x29')){logger[_0x5b40('0x20')](_0x5b40('0x2a'));_0x14ef6a[_0x5b40('0x2b')]=_0x37d0f5[_0x5b40('0x2b')]||_0x14ef6a[_0x5b40('0x2b')];_0x14ef6a[_0x5b40('0x2c')]=_0x37d0f5[_0x5b40('0x2c')];_0x14ef6a[_0x5b40('0x2d')]=_0x37d0f5[_0x5b40('0x2d')]?_0x37d0f5[_0x5b40('0x2d')]-0x1:0x1;return null;}else if(_0x37d0f5&&_0x21e71b[_0x37d0f5[_0x5b40('0xb')]]){_0x2b5155=_0x21e71b[_0x37d0f5[_0x5b40('0xb')]](_0x37d0f5);logger[_0x5b40('0x20')](_0x5b40('0x2e'),JSON[_0x5b40('0x2f')](_0x2b5155,null,0x2));if(_0x2b5155&&_0x2b5155[_0x5b40('0x30')]===AGI_CODE_SUCCESS&&_0x2b5155[_0x5b40('0x31')]!==AGI_RESULT_ERROR&&!_0x14ef6a['evtHangup']){logger[_0x5b40('0x1b')](_0x5b40('0x2e'),inspect(_0x2b5155));return _[_0x5b40('0x32')](_0x2b5155[_0x5b40('0x31')])?null:_0x2b5155['result'][_0x5b40('0x33')]();}else{logger[_0x5b40('0x8')](_0x5b40('0x2e'),inspect(_0x2b5155));return null;}}else{logger[_0x5b40('0x8')](_0x5b40('0x34'));return null;}}catch(_0x4852b7){logger[_0x5b40('0x8')](_0x4852b7[_0x5b40('0xa')]);return null;}});if(_0x4e54a9[_0x5b40('0x35')]){logger[_0x5b40('0x20')](util[_0x5b40('0x1d')](_0x5b40('0x36'),_0x14ef6a[_0x5b40('0x22')],_0x14ef6a[_0x5b40('0x23')],_0x14ef6a[_0x5b40('0x24')],_0x14ef6a[_0x5b40('0x37')],_0x14ef6a[_0x5b40('0x25')]));_0x91e6bb[_0x5b40('0x26')](_0x4e54a9[_0x5b40('0x35')]['id'],function(_0xecea2a){try{_0xecea2a=_0x21e71b[_0x5b40('0x27')](_0xecea2a);logger[_0x5b40('0x1b')](_0x5b40('0x28'),JSON['stringify'](_0xecea2a,null,0x2));if(_0xecea2a&&_0x21e71b[_0xecea2a[_0x5b40('0xb')]]){_0x2b5155=_0x21e71b[_0xecea2a[_0x5b40('0xb')]](_0xecea2a);if(_0x2b5155){logger[_0x5b40('0x1b')](_0x5b40('0x2e'),inspect(_0x2b5155));return _[_0x5b40('0x32')](_0x2b5155[_0x5b40('0x31')])?null:_0x2b5155[_0x5b40('0x31')][_0x5b40('0x33')]();}else{logger[_0x5b40('0x8')](_0x5b40('0x2e'),inspect(_0x2b5155));return null;}}else{logger[_0x5b40('0x8')](_0x5b40('0x34'));return null;}}catch(_0x24dca8){logger[_0x5b40('0x8')](_0x24dca8['stack']);return null;}});}logger[_0x5b40('0x20')](util[_0x5b40('0x1d')](_0x5b40('0x38'),_0x14ef6a['arg_1'],_0x14ef6a[_0x5b40('0x23')],_0x14ef6a[_0x5b40('0x24')],_0x14ef6a['dnid'],_0x14ef6a[_0x5b40('0x25')]));logger[_0x5b40('0x20')](util[_0x5b40('0x1d')](_0x5b40('0x39'),_0x14ef6a[_0x5b40('0x2b')],_0x14ef6a[_0x5b40('0x2c')],parseInt(_0x14ef6a[_0x5b40('0x2d')],0xa)+0x1));_0x14ef6a[_0x5b40('0x3a')](_0x14ef6a[_0x5b40('0x2b')],_0x14ef6a[_0x5b40('0x2c')],parseInt(_0x14ef6a[_0x5b40('0x2d')],0xa)+0x1);_0x14ef6a[_0x5b40('0x3b')]();}function handleNotFound(_0x36a3a0){logger[_0x5b40('0x8')](util['format'](_0x5b40('0x3c'),_0x36a3a0[_0x5b40('0x22')]));_0x36a3a0[_0x5b40('0x3a')](_0x36a3a0[_0x5b40('0x2b')],_0x36a3a0[_0x5b40('0x2c')],parseInt(_0x36a3a0[_0x5b40('0x2d')],0xa)+0x1);_0x36a3a0[_0x5b40('0x3b')]();}function handleUnpublished(_0x43b100){logger['error'](util[_0x5b40('0x1d')](_0x5b40('0x3d'),_0x43b100['arg_1']));_0x43b100[_0x5b40('0x3a')](_0x43b100[_0x5b40('0x2b')],_0x43b100[_0x5b40('0x2c')],parseInt(_0x43b100['priority'],0xa)+0x1);_0x43b100[_0x5b40('0x3b')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xb5f3=['length','source','target','addEdge','value','root','inspect','production','start','debug','stringify','format','omit','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','evtHangup','isUndefined','toString','stack','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','agicommand','callerid','extension','continueAt','close','Project\x20%s\x20not\x20found','exports','lodash','moment','util','../../config/logger','./rpc','./mailRpc','./graph','getSquareProjects','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','retry','maxRetry','mxCell','isArray'];(function(_0x405326,_0x4c4eff){var _0xe5bd1f=function(_0x367ac8){while(--_0x367ac8){_0x405326['push'](_0x405326['shift']());}};_0xe5bd1f(++_0x4c4eff);}(_0xb5f3,0xc9));var _0x3b5f=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0xb5f3[_0x473ee7];return _0x30f0d4;};'use strict';var _=require(_0x3b5f('0x0'));var moment=require(_0x3b5f('0x1'));var parser=require('xml2json');var util=require(_0x3b5f('0x2'));var logger=require(_0x3b5f('0x3'))('agi');var rpc=require(_0x3b5f('0x4'));var mailRpc=require(_0x3b5f('0x5'));var Graph=require(_0x3b5f('0x6'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x3b5f('0x7')]()['catch'](function(_0x287feb){logger[_0x3b5f('0x8')](_0x3b5f('0x9'),_0x287feb['stack']);return[];});}function addVertex(_0x1d3ce0,_0x23b323,_0x7e0d00){_0x23b323['agicommand']=_0x7e0d00;if(_0x23b323[_0x3b5f('0xa')](_0x3b5f('0xb'))){_0x23b323[_0x3b5f('0xc')]=parseInt(_0x23b323['retry'],0xa);}_0x1d3ce0['addVertex'](_['omit'](_0x23b323,_0x3b5f('0xd')));}function initGraph(_0x44fbb8,_0x34d505){var _0x15a853=new Graph();for(var _0x3bfd42 in _0x44fbb8){if(_0x44fbb8[_0x3b5f('0xa')](_0x3bfd42)){if(_[_0x3b5f('0xe')](_0x44fbb8[_0x3bfd42])){for(var _0x151a0f=0x0;_0x151a0f<_0x44fbb8[_0x3bfd42]['length'];_0x151a0f+=0x1){addVertex(_0x15a853,_0x44fbb8[_0x3bfd42][_0x151a0f],_0x3bfd42);}}else{addVertex(_0x15a853,_0x44fbb8[_0x3bfd42],_0x3bfd42);}}}for(var _0xbc76c3=0x0;_0xbc76c3<_0x34d505[_0x3b5f('0xf')];_0xbc76c3+=0x1){if(_0x34d505[_0xbc76c3][_0x3b5f('0x10')]&&_0x34d505[_0xbc76c3][_0x3b5f('0x11')]){_0x15a853[_0x3b5f('0x12')](_0x34d505[_0xbc76c3][_0x3b5f('0x10')],_0x34d505[_0xbc76c3]['target'],_0x34d505[_0xbc76c3][_0x3b5f('0x13')]);}}return _0x15a853;}function getRoot(_0x131dfb){return parser['toJson'](_0x131dfb,{'object':!![]})['mxGraphModel'][_0x3b5f('0x14')];}function inspect(_0x27649b){return util[_0x3b5f('0x15')](_0x27649b,{'showHidden':![],'depth':null});}function initialize(_0x37850d,_0x4f37e8){var _0x1c83a0=getRoot(_0x37850d[_0x3b5f('0x16')]);if(!_0x1c83a0||!_0x1c83a0[_0x3b5f('0x17')])return;var _0x2118c0,_0x5e2b0e,_0x3121aa;logger[_0x3b5f('0x18')]('root',JSON[_0x3b5f('0x19')](_0x1c83a0,null,0x2));_0x4f37e8['joinAt']=moment()[_0x3b5f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2118c0=initGraph(_[_0x3b5f('0x1b')](_0x1c83a0,_0x3b5f('0xd')),_0x1c83a0[_0x3b5f('0xd')]);_0x5e2b0e=new Vertices(_0x4f37e8,rpc,mailRpc);logger[_0x3b5f('0x1c')](util['format'](_0x3b5f('0x1d'),_0x4f37e8[_0x3b5f('0x1e')],_0x4f37e8['calleridname'],_0x4f37e8['callerid'],_0x4f37e8['dnid'],_0x4f37e8[_0x3b5f('0x1f')]));_0x2118c0['traverseBFS'](_0x1c83a0[_0x3b5f('0x17')]['id'],function(_0x42a015){try{_0x42a015=_0x5e2b0e[_0x3b5f('0x20')](_0x42a015);logger[_0x3b5f('0x18')](_0x3b5f('0x21'),JSON[_0x3b5f('0x19')](_0x42a015,null,0x2));if(_0x42a015['agicommand']===_0x3b5f('0x22')){logger[_0x3b5f('0x1c')](_0x3b5f('0x23'));_0x4f37e8[_0x3b5f('0x24')]=_0x42a015[_0x3b5f('0x24')]||_0x4f37e8['context'];_0x4f37e8['extension']=_0x42a015['extension'];_0x4f37e8['priority']=_0x42a015['priority']?_0x42a015[_0x3b5f('0x25')]-0x1:0x1;return null;}else if(_0x42a015&&_0x5e2b0e[_0x42a015['agicommand']]){_0x3121aa=_0x5e2b0e[_0x42a015['agicommand']](_0x42a015);logger[_0x3b5f('0x1c')](_0x3b5f('0x26'),JSON['stringify'](_0x3121aa,null,0x2));if(_0x3121aa&&_0x3121aa[_0x3b5f('0x27')]===AGI_CODE_SUCCESS&&_0x3121aa[_0x3b5f('0x28')]!==AGI_RESULT_ERROR&&!_0x4f37e8[_0x3b5f('0x29')]){logger[_0x3b5f('0x18')](_0x3b5f('0x26'),inspect(_0x3121aa));return _[_0x3b5f('0x2a')](_0x3121aa[_0x3b5f('0x28')])?null:_0x3121aa['result'][_0x3b5f('0x2b')]();}else{logger[_0x3b5f('0x8')](_0x3b5f('0x26'),inspect(_0x3121aa));return null;}}else{logger[_0x3b5f('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x1cc968){logger[_0x3b5f('0x8')](_0x1cc968[_0x3b5f('0x2c')]);return null;}});if(_0x1c83a0['finally']){logger[_0x3b5f('0x1c')](util['format'](_0x3b5f('0x2d'),_0x4f37e8[_0x3b5f('0x1e')],_0x4f37e8[_0x3b5f('0x2e')],_0x4f37e8['callerid'],_0x4f37e8['dnid'],_0x4f37e8['uniqueid']));_0x2118c0['traverseBFS'](_0x1c83a0['finally']['id'],function(_0x3cf73a){try{_0x3cf73a=_0x5e2b0e[_0x3b5f('0x20')](_0x3cf73a);logger[_0x3b5f('0x18')](_0x3b5f('0x21'),JSON[_0x3b5f('0x19')](_0x3cf73a,null,0x2));if(_0x3cf73a&&_0x5e2b0e[_0x3cf73a[_0x3b5f('0x2f')]]){_0x3121aa=_0x5e2b0e[_0x3cf73a[_0x3b5f('0x2f')]](_0x3cf73a);if(_0x3121aa){logger['debug'](_0x3b5f('0x26'),inspect(_0x3121aa));return _[_0x3b5f('0x2a')](_0x3121aa['result'])?null:_0x3121aa[_0x3b5f('0x28')][_0x3b5f('0x2b')]();}else{logger[_0x3b5f('0x8')](_0x3b5f('0x26'),inspect(_0x3121aa));return null;}}else{logger[_0x3b5f('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x333fad){logger['error'](_0x333fad[_0x3b5f('0x2c')]);return null;}});}logger[_0x3b5f('0x1c')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4f37e8[_0x3b5f('0x1e')],_0x4f37e8[_0x3b5f('0x2e')],_0x4f37e8[_0x3b5f('0x30')],_0x4f37e8['dnid'],_0x4f37e8[_0x3b5f('0x1f')]));logger[_0x3b5f('0x1c')](util[_0x3b5f('0x1a')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x4f37e8[_0x3b5f('0x24')],_0x4f37e8[_0x3b5f('0x31')],parseInt(_0x4f37e8['priority'],0xa)+0x1));_0x4f37e8[_0x3b5f('0x32')](_0x4f37e8[_0x3b5f('0x24')],_0x4f37e8['extension'],parseInt(_0x4f37e8[_0x3b5f('0x25')],0xa)+0x1);_0x4f37e8[_0x3b5f('0x33')]();}function handleNotFound(_0x50461f){logger[_0x3b5f('0x8')](util[_0x3b5f('0x1a')](_0x3b5f('0x34'),_0x50461f[_0x3b5f('0x1e')]));_0x50461f[_0x3b5f('0x32')](_0x50461f['context'],_0x50461f[_0x3b5f('0x31')],parseInt(_0x50461f[_0x3b5f('0x25')],0xa)+0x1);_0x50461f[_0x3b5f('0x33')]();}function handleUnpublished(_0x208a5a){logger[_0x3b5f('0x8')](util[_0x3b5f('0x1a')]('Project\x20%s\x20not\x20published',_0x208a5a[_0x3b5f('0x1e')]));_0x208a5a[_0x3b5f('0x32')](_0x208a5a[_0x3b5f('0x24')],_0x208a5a[_0x3b5f('0x31')],parseInt(_0x208a5a[_0x3b5f('0x25')],0xa)+0x1);_0x208a5a[_0x3b5f('0x33')]();}module[_0x3b5f('0x35')]={'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 1f53a6c..342b066 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 _0xe845=['headers','line','stream','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','substring','length','indexOf','slice','trim','emit'];(function(_0x42acf9,_0x3b8ddf){var _0x102489=function(_0x59feac){while(--_0x59feac){_0x42acf9['push'](_0x42acf9['shift']());}};_0x102489(++_0x3b8ddf);}(_0xe845,0x101));var _0x5e84=function(_0x2ee5f5,_0x11779e){_0x2ee5f5=_0x2ee5f5-0x0;var _0x25f57a=_0xe845[_0x2ee5f5];return _0x25f57a;};'use strict';var util=require('util');var Transform=require(_0x5e84('0x0'))['Transform'];function AGIReply(_0x13c801){Transform[_0x5e84('0x1')](this,_0x13c801);this[_0x5e84('0x2')]='';this[_0x5e84('0x3')]=![];}util[_0x5e84('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x5e84('0x5')]=function(_0x5e1928,_0x19462f,_0x9fa657){var _0xfffd9e='\x0a',_0xdb13c5=['\x0a\x0a',_0x5e84('0x6')],_0x1f3aed=-0x1,_0x5bc887=-0x1,_0x1a2437='',_0x319cb3=0x0,_0x331588='',_0x233119='';this[_0x5e84('0x2')]+=_0x5e1928['toString']();_0x331588=this[_0x5e84('0x2')];if(!this[_0x5e84('0x3')]){_0x319cb3=0x0;while(_0xdb13c5[_0x319cb3]){while((_0x5bc887=_0x331588['indexOf'](_0xdb13c5[_0x319cb3]))!=-0x1){_0x1a2437=_0xdb13c5[_0x319cb3];_0x233119=_0x331588[_0x5e84('0x7')](0x0,_0x5bc887);_0x331588=_0x331588[_0x5e84('0x7')](_0x5bc887+_0x1a2437[_0x5e84('0x8')]);var _0x3dd408=_0x233119['split'](_0xfffd9e),_0xc5ee09=0x0,_0x173084={},_0x260c87='',_0x23277c='',_0x49e559=-0x1;while(_0x3dd408[_0xc5ee09]){_0x49e559=_0x3dd408[_0xc5ee09][_0x5e84('0x9')](':');if(_0x49e559!=-0x1){_0x260c87=_0x3dd408[_0xc5ee09][_0x5e84('0xa')](0x0,_0x49e559)[_0x5e84('0xb')]();_0x23277c=_0x3dd408[_0xc5ee09][_0x5e84('0xa')](_0x49e559+0x1)[_0x5e84('0xb')]();if(_0x260c87[_0x5e84('0x8')]>0x0){_0x173084[_0x260c87]=_0x23277c;}}else{}_0xc5ee09++;}this[_0x5e84('0xc')](_0x5e84('0xd'),_0x173084);this[_0x5e84('0x3')]=!![];}_0x319cb3++;}this[_0x5e84('0x2')]=_0x331588;}else{while((_0x1f3aed=_0x331588[_0x5e84('0x9')](_0xfffd9e))!=-0x1){_0x233119=_0x331588[_0x5e84('0x7')](0x0,_0x1f3aed);this[_0x5e84('0xc')](_0x5e84('0xe'),_0x233119);_0x331588=_0x331588[_0x5e84('0x7')](_0x1f3aed+_0xfffd9e['length']);}this[_0x5e84('0x2')]=_0x331588;}_0x9fa657();};module['exports']=AGIReply; \ No newline at end of file +var _0x00d6=['line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x00d6,0x1e5));var _0x600d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x00d6[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x600d('0x0'));var Transform=require(_0x600d('0x1'))[_0x600d('0x2')];function AGIReply(_0x2768c2){Transform[_0x600d('0x3')](this,_0x2768c2);this[_0x600d('0x4')]='';this[_0x600d('0x5')]=![];}util[_0x600d('0x6')](AGIReply,Transform);AGIReply[_0x600d('0x7')][_0x600d('0x8')]=function(_0x12822c,_0x2752d9,_0x3b9a14){var _0x581f6e='\x0a',_0x5d6a0c=['\x0a\x0a',_0x600d('0x9')],_0x43f76e=-0x1,_0x5de536=-0x1,_0x260fc9='',_0x1c2655=0x0,_0x150acd='',_0x3f5b2d='';this[_0x600d('0x4')]+=_0x12822c[_0x600d('0xa')]();_0x150acd=this[_0x600d('0x4')];if(!this['_inBody']){_0x1c2655=0x0;while(_0x5d6a0c[_0x1c2655]){while((_0x5de536=_0x150acd[_0x600d('0xb')](_0x5d6a0c[_0x1c2655]))!=-0x1){_0x260fc9=_0x5d6a0c[_0x1c2655];_0x3f5b2d=_0x150acd[_0x600d('0xc')](0x0,_0x5de536);_0x150acd=_0x150acd[_0x600d('0xc')](_0x5de536+_0x260fc9[_0x600d('0xd')]);var _0x1f23ee=_0x3f5b2d[_0x600d('0xe')](_0x581f6e),_0x5264fd=0x0,_0x4b0368={},_0x437ca4='',_0x2552a8='',_0xfddb8d=-0x1;while(_0x1f23ee[_0x5264fd]){_0xfddb8d=_0x1f23ee[_0x5264fd][_0x600d('0xb')](':');if(_0xfddb8d!=-0x1){_0x437ca4=_0x1f23ee[_0x5264fd][_0x600d('0xf')](0x0,_0xfddb8d)[_0x600d('0x10')]();_0x2552a8=_0x1f23ee[_0x5264fd][_0x600d('0xf')](_0xfddb8d+0x1)['trim']();if(_0x437ca4[_0x600d('0xd')]>0x0){_0x4b0368[_0x437ca4]=_0x2552a8;}}else{}_0x5264fd++;}this[_0x600d('0x11')](_0x600d('0x12'),_0x4b0368);this[_0x600d('0x5')]=!![];}_0x1c2655++;}this[_0x600d('0x4')]=_0x150acd;}else{while((_0x43f76e=_0x150acd['indexOf'](_0x581f6e))!=-0x1){_0x3f5b2d=_0x150acd[_0x600d('0xc')](0x0,_0x43f76e);this['emit'](_0x600d('0x13'),_0x3f5b2d);_0x150acd=_0x150acd['substring'](_0x43f76e+_0x581f6e[_0x600d('0xd')]);}this[_0x600d('0x4')]=_0x150acd;}_0x3b9a14();};module[_0x600d('0x14')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9868406..2c0a787 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 _0xed1f=['jayson/promise','client','http','request','then','error','message','result','catch','GetSquareProjects','name','getSquareProject','production','ShowMailAccount','CloudProvider','email','ShowSquareProject','getVariableById','ShowVariable','dsn','getUserById','ShowUser','phone','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','LogoutUser','lodash','moment'];(function(_0x3f6389,_0x2adf19){var _0x528d0b=function(_0x4a1dc1){while(--_0x4a1dc1){_0x3f6389['push'](_0x3f6389['shift']());}};_0x528d0b(++_0x2adf19);}(_0xed1f,0x6a));var _0xfed1=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xed1f[_0x5627e1];return _0x2f013f;};'use strict';var _=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var jayson=require(_0xfed1('0x2'));var client=jayson[_0xfed1('0x3')][_0xfed1('0x4')]({'port':0x2329});function request(_0x25f345,_0x1dd614){return new Promise(function(_0xa68587,_0x2209b3){return client[_0xfed1('0x5')](_0x25f345,_0x1dd614)[_0xfed1('0x6')](function(_0xd2c769){if(_0xd2c769[_0xfed1('0x7')]){return _0x2209b3(_0xd2c769[_0xfed1('0x7')][_0xfed1('0x8')]);}else{return _0xa68587(_0xd2c769[_0xfed1('0x9')]);}})[_0xfed1('0xa')](function(_0x2967ef){return _0x2209b3(_0x2967ef);});});}exports['getSquareProjects']=function(){return request(_0xfed1('0xb'),{'options':{'raw':![],'attributes':['id',_0xfed1('0xc'),'production']}});};exports[_0xfed1('0xd')]=function(_0x7bf48c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x7bf48c},'attributes':[_0xfed1('0xe')]}});};exports['getMailAccountById']=function(_0x1c3f40){return request(_0xfed1('0xf'),{'options':{'raw':![],'where':{'id':_0x1c3f40},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0xfed1('0x10'),'as':_0xfed1('0x10')}]}],'attributes':['id','name',_0xfed1('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x529b3d){return request(_0xfed1('0x12'),{'options':{'where':{'id':_0x529b3d},'attributes':[_0xfed1('0xc')]}});};exports['getVoiceQueueById']=function(_0x2dde3a){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x2dde3a},'attributes':['name']}});};exports[_0xfed1('0x13')]=function(_0x39aa0c){return request(_0xfed1('0x14'),{'options':{'where':{'id':_0x39aa0c},'attributes':[_0xfed1('0xc')]}});};exports['getSquareOdbcById']=function(_0x1a00f6){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x1a00f6},'attributes':[_0xfed1('0x15')]}});};exports[_0xfed1('0x16')]=function(_0x489a0f){return request(_0xfed1('0x17'),{'options':{'where':{'id':_0x489a0f},'attributes':[_0xfed1('0xc')]}});};exports['getContactByPhone']=function(_0x59509b){return request('GetContactByPhone',{'options':{'where':{'phone':_0x59509b[_0xfed1('0x18')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x201f18){return request(_0xfed1('0x19'),{'options':{'where':{'id':_0x201f18},'attributes':['name']}});};exports[_0xfed1('0x1a')]=function(_0x65f14b){return request('ShowSound',{'options':{'where':{'id':_0x65f14b},'attributes':[_0xfed1('0x1b')]}});};exports[_0xfed1('0x1c')]=function(_0xff4842){return request(_0xfed1('0x1d'),{'options':{'raw':![],'where':{'id':_0xff4842},'include':[{'model':'Interval','as':_0xfed1('0x1e')}]}});};exports['getSmsAccountById']=function(_0x446558){return request(_0xfed1('0x1f'),{'options':{'where':{'id':_0x446558},'attributes':['id',_0xfed1('0xc')]}});};exports['createSmsMessage']=function(_0x41d22c){return request('CreateSmsMessage',{'body':_0x41d22c});};exports[_0xfed1('0x20')]=function(_0x2793b7){return request(_0xfed1('0x21'),{'body':_0x2793b7});};exports[_0xfed1('0x22')]=function(_0x186ecc){return request(_0xfed1('0x23'),{'body':_['merge'](_0x186ecc,{'project_name':_0x186ecc[_0xfed1('0x24')],'prev_project_name':_0x186ecc[_0xfed1('0x25')]||'','is_subproject':_0x186ecc['arg_2']?!![]:![],'leaveAt':moment()[_0xfed1('0x26')](_0xfed1('0x27'))})});};exports[_0xfed1('0x28')]=function(_0x1d62c5){return request(_0xfed1('0x29'),{'body':_0x1d62c5});};exports[_0xfed1('0x2a')]=function(_0x583953){return request(_0xfed1('0x2b'),{'body':_0x583953});};exports['createCmContact']=function(_0x3106ee){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x3106ee['phone'],'ListId':_0x3106ee[_0xfed1('0x2c')]}}})[_0xfed1('0x6')](function(_0x2d334e){if(_0x2d334e){return _0x2d334e;}return request('CreateCmContact',{'body':_0x3106ee});});};exports[_0xfed1('0x2d')]=function(_0x437a25){return request(_0xfed1('0x2e'),{'options':{'where':{'id':_0x437a25},'attributes':[_0xfed1('0xc')]}});};exports[_0xfed1('0x2f')]=function(_0x30272b,_0x5ccc3a){return request(_0xfed1('0x30'),{'body':{'interface':_0x5ccc3a},'options':{'where':_0x30272b}});};exports[_0xfed1('0x31')]=function(_0x4fc309,_0x47a90c,_0x28bd98){return request(_0xfed1('0x32'),{'body':{'type':_0x47a90c,'uniqueid':_0x28bd98},'options':{'where':_0x4fc309}});};exports[_0xfed1('0x33')]=function(_0x71147f){return request(_0xfed1('0x34'),{'body':{},'options':{'where':_0x71147f}});};exports['agentLogout']=function(_0xecd1ec){return request(_0xfed1('0x35'),{'body':{},'options':{'where':_0xecd1ec}});}; \ No newline at end of file +var _0xe181=['getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','agentLogout','lodash','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','name','production','getSquareProject','ShowSquareProject','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','ShowVoiceQueue'];(function(_0x27085f,_0x5966c4){var _0x5f23d8=function(_0x5b9439){while(--_0x5b9439){_0x27085f['push'](_0x27085f['shift']());}};_0x5f23d8(++_0x5966c4);}(_0xe181,0x68));var _0x1e18=function(_0x4f103e,_0x284aaf){_0x4f103e=_0x4f103e-0x0;var _0x474b4d=_0xe181[_0x4f103e];return _0x474b4d;};'use strict';var _=require(_0x1e18('0x0'));var moment=require('moment');var jayson=require(_0x1e18('0x1'));var client=jayson[_0x1e18('0x2')][_0x1e18('0x3')]({'port':0x2329});function request(_0x42ca76,_0x4206ba){return new Promise(function(_0x16e2c3,_0x3ec619){return client['request'](_0x42ca76,_0x4206ba)[_0x1e18('0x4')](function(_0x50253a){if(_0x50253a['error']){return _0x3ec619(_0x50253a[_0x1e18('0x5')][_0x1e18('0x6')]);}else{return _0x16e2c3(_0x50253a[_0x1e18('0x7')]);}})[_0x1e18('0x8')](function(_0x9f9541){return _0x3ec619(_0x9f9541);});});}exports[_0x1e18('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id',_0x1e18('0xa'),_0x1e18('0xb')]}});};exports[_0x1e18('0xc')]=function(_0x363da4){return request(_0x1e18('0xd'),{'options':{'raw':![],'where':{'name':_0x363da4},'attributes':[_0x1e18('0xb')]}});};exports['getMailAccountById']=function(_0x13f018){return request(_0x1e18('0xe'),{'options':{'raw':![],'where':{'id':_0x13f018},'include':[{'model':_0x1e18('0xf'),'as':_0x1e18('0x10'),'include':[{'model':_0x1e18('0x11'),'as':_0x1e18('0x11')}]}],'attributes':['id',_0x1e18('0xa'),_0x1e18('0x12')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x257c5d){return request('ShowSquareProject',{'options':{'where':{'id':_0x257c5d},'attributes':[_0x1e18('0xa')]}});};exports['getVoiceQueueById']=function(_0x404b7f){return request(_0x1e18('0x13'),{'options':{'where':{'id':_0x404b7f},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x14')]=function(_0x1687ba){return request(_0x1e18('0x15'),{'options':{'where':{'id':_0x1687ba},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x16')]=function(_0x134863){return request(_0x1e18('0x17'),{'options':{'where':{'id':_0x134863},'attributes':[_0x1e18('0x18')]}});};exports[_0x1e18('0x19')]=function(_0x349f3c){return request(_0x1e18('0x1a'),{'options':{'where':{'id':_0x349f3c},'attributes':[_0x1e18('0xa')]}});};exports['getContactByPhone']=function(_0x1c91d2){return request(_0x1e18('0x1b'),{'options':{'where':{'phone':_0x1c91d2[_0x1e18('0x1c')]},'attributes':['id']}});};exports[_0x1e18('0x1d')]=function(_0x2834ee){return request(_0x1e18('0x1e'),{'options':{'where':{'id':_0x2834ee},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x1f')]=function(_0x2e849d){return request(_0x1e18('0x20'),{'options':{'where':{'id':_0x2e849d},'attributes':[_0x1e18('0x21')]}});};exports[_0x1e18('0x22')]=function(_0x3c4fdf){return request(_0x1e18('0x23'),{'options':{'raw':![],'where':{'id':_0x3c4fdf},'include':[{'model':_0x1e18('0x24'),'as':_0x1e18('0x25')}]}});};exports[_0x1e18('0x26')]=function(_0x5eb6b4){return request(_0x1e18('0x27'),{'options':{'where':{'id':_0x5eb6b4},'attributes':['id',_0x1e18('0xa')]}});};exports[_0x1e18('0x28')]=function(_0x52d5e2){return request(_0x1e18('0x29'),{'body':_0x52d5e2});};exports[_0x1e18('0x2a')]=function(_0x477660){return request(_0x1e18('0x2b'),{'body':_0x477660});};exports['createSquareReport']=function(_0x48f0ff){return request(_0x1e18('0x2c'),{'body':_['merge'](_0x48f0ff,{'project_name':_0x48f0ff['arg_1'],'prev_project_name':_0x48f0ff['arg_2']||'','is_subproject':_0x48f0ff[_0x1e18('0x2d')]?!![]:![],'leaveAt':moment()[_0x1e18('0x2e')](_0x1e18('0x2f'))})});};exports[_0x1e18('0x30')]=function(_0x3a95c1){return request(_0x1e18('0x31'),{'body':_0x3a95c1});};exports[_0x1e18('0x32')]=function(_0x149cb6){return request(_0x1e18('0x33'),{'body':_0x149cb6});};exports[_0x1e18('0x34')]=function(_0x1015a3){return request(_0x1e18('0x35'),{'options':{'raw':![],'where':{'phone':_0x1015a3[_0x1e18('0x1c')],'ListId':_0x1015a3[_0x1e18('0x36')]}}})['then'](function(_0x57000b){if(_0x57000b){return _0x57000b;}return request('CreateCmContact',{'body':_0x1015a3});});};exports[_0x1e18('0x37')]=function(_0x1baf4f){return request(_0x1e18('0x38'),{'options':{'where':{'id':_0x1baf4f},'attributes':[_0x1e18('0xa')]}});};exports[_0x1e18('0x39')]=function(_0x93dd11,_0x2d47c8){return request(_0x1e18('0x3a'),{'body':{'interface':_0x2d47c8},'options':{'where':_0x93dd11}});};exports['agentPause']=function(_0x27fdf7,_0xc7afe2,_0x5d4df9){return request(_0x1e18('0x3b'),{'body':{'type':_0xc7afe2,'uniqueid':_0x5d4df9},'options':{'where':_0x27fdf7}});};exports[_0x1e18('0x3c')]=function(_0x415d7b){return request('UnpauseUser',{'body':{},'options':{'where':_0x415d7b}});};exports[_0x1e18('0x3d')]=function(_0x5597ab){return request('LogoutUser',{'body':{},'options':{'where':_0x5597ab}});}; \ 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 b131a6a..f9d88fd 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 _0xcb41=['./lex','exports','./polly'];(function(_0x110f23,_0x2c0545){var _0x327499=function(_0x1e5f72){while(--_0x1e5f72){_0x110f23['push'](_0x110f23['shift']());}};_0x327499(++_0x2c0545);}(_0xcb41,0x1df));var _0x1cb4=function(_0x31103b,_0xe33e0){_0x31103b=_0x31103b-0x0;var _0x5ab9c7=_0xcb41[_0x31103b];return _0x5ab9c7;};var polly=require(_0x1cb4('0x0'));var lex=require(_0x1cb4('0x1'));module[_0x1cb4('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x297f=['./polly','./lex'];(function(_0x3ce2ca,_0x3e5be2){var _0xa78bdf=function(_0x335c27){while(--_0x335c27){_0x3ce2ca['push'](_0x3ce2ca['shift']());}};_0xa78bdf(++_0x3e5be2);}(_0x297f,0x1f0));var _0xf297=function(_0x48ed67,_0x32be02){_0x48ed67=_0x48ed67-0x0;var _0x3afc12=_0x297f[_0x48ed67];return _0x3afc12;};var polly=require(_0xf297('0x0'));var lex=require(_0xf297('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 496c565..e5abc53 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 _0x5ff3=['exports'];(function(_0x58d480,_0x3a34d6){var _0x85beeb=function(_0x42abcd){while(--_0x42abcd){_0x58d480['push'](_0x58d480['shift']());}};_0x85beeb(++_0x3a34d6);}(_0x5ff3,0x17d));var _0x35ff=function(_0x5ce85f,_0x310806){_0x5ce85f=_0x5ce85f-0x0;var _0x3c4680=_0x5ff3[_0x5ce85f];return _0x3c4680;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);}; \ No newline at end of file +var _0x70e0=['exports','./lib/api'];(function(_0x1a2edc,_0x718006){var _0xccd506=function(_0x35384b){while(--_0x35384b){_0x1a2edc['push'](_0x1a2edc['shift']());}};_0xccd506(++_0x718006);}(_0x70e0,0x17b));var _0x070e=function(_0x1c22c7,_0x3857cf){_0x1c22c7=_0x1c22c7-0x0;var _0x3da8d4=_0x70e0[_0x1c22c7];return _0x3da8d4;};'use strict';var lex=require(_0x070e('0x0'));module[_0x070e('0x1')]=function(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32){return lex(_0x198c2e,_0x4d95bb,_0x579b83,_0x16e651,_0xee173,_0x277d32);}; \ 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 51f2361..04d22f8 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(_0x332e37,_0x3eafb1){var _0x38d3ee=function(_0x4f9281){while(--_0x4f9281){_0x332e37['push'](_0x332e37['shift']());}};_0x38d3ee(++_0x3eafb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x145bc3,_0x17fad8){var _0x33f04b=function(_0xb0dba2){while(--_0xb0dba2){_0x145bc3['push'](_0x145bc3['shift']());}};_0x33f04b(++_0x17fad8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 b9c6553..a9a6d11 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 _0x102b=['exports'];(function(_0x428b30,_0x2e6335){var _0x213609=function(_0x42c3d3){while(--_0x42c3d3){_0x428b30['push'](_0x428b30['shift']());}};_0x213609(++_0x2e6335);}(_0x102b,0x1ba));var _0xb102=function(_0x54398b,_0x23f258){_0x54398b=_0x54398b-0x0;var _0xc946c4=_0x102b[_0x54398b];return _0xc946c4;};'use strict';var polly=require('./lib/api');module[_0xb102('0x0')]=function(_0xc9c499,_0x4cf676,_0x183326,_0x111101,_0x20a336,_0x274898,_0x3edec2){return polly(_0xc9c499,_0x4cf676,_0x183326,_0x111101,_0x20a336,_0x274898,_0x3edec2);}; \ No newline at end of file +var _0x4501=['./lib/api'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4501,0xbd));var _0x1450=function(_0x1452b8,_0x58dddb){_0x1452b8=_0x1452b8-0x0;var _0x1b14b2=_0x4501[_0x1452b8];return _0x1b14b2;};'use strict';var polly=require(_0x1450('0x0'));module['exports']=function(_0x1aafc1,_0x912f28,_0x32fdca,_0x396e13,_0xccb2c9,_0xf0393e,_0x1c9252){return polly(_0x1aafc1,_0x912f28,_0x32fdca,_0x396e13,_0xccb2c9,_0xf0393e,_0x1c9252);}; \ 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 3b9c63c..6773140 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 _0x1adc=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x3ec126,_0x47a952){var _0x45a9de=function(_0x2b9109){while(--_0x2b9109){_0x3ec126['push'](_0x3ec126['shift']());}};_0x45a9de(++_0x47a952);}(_0x1adc,0x117));var _0xc1ad=function(_0xa3821,_0x5f2371){_0xa3821=_0xa3821-0x0;var _0x4cb8a7=_0x1adc[_0xa3821];return _0x4cb8a7;};'use strict';var fs=require('fs');var path=require(_0xc1ad('0x0'));var BPromise=require(_0xc1ad('0x1'));var rs=require(_0xc1ad('0x2'));var AWS=require(_0xc1ad('0x3'));function pollyResult(_0x3da5b5,_0x567b56,_0x5f4782){return new BPromise(function(_0x4ebc8a,_0x2b4b4c){_0x3da5b5[_0xc1ad('0x4')](_0x567b56,function(_0x22e50e,_0x421e01){if(_0x22e50e){_0x2b4b4c(_0x22e50e);}else if(_0x421e01){if(_0x421e01[_0xc1ad('0x5')]instanceof Buffer){fs[_0xc1ad('0x6')](_0x5f4782,_0x421e01['AudioStream'],function(_0x508d3b){if(_0x508d3b){_0x2b4b4c(_0x508d3b);}else{_0x4ebc8a();}});}else{_0x2b4b4c(new Error(_0xc1ad('0x7')));}}else{_0x2b4b4c(new Error(_0xc1ad('0x8')));}});});}module[_0xc1ad('0x9')]=function(_0x358edc,_0x1cf4d9,_0x18fbba,_0x27bd93,_0x508744,_0x1cad37,_0x5a83fe){var _0x1dbb81=new AWS[(_0xc1ad('0xa'))]({'accessKeyId':_0x358edc,'secretAccessKey':_0x1cf4d9,'region':_0x18fbba});var _0x162c0e={'Text':_0x508744,'TextType':_0x1cad37||'text','OutputFormat':'mp3','VoiceId':_0x27bd93};return pollyResult(_0x1dbb81,_0x162c0e,_0x5a83fe);}; \ No newline at end of file +var _0x417f=['exports','text','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x3857d5,_0x331dc3){var _0x2647e5=function(_0x39b71b){while(--_0x39b71b){_0x3857d5['push'](_0x3857d5['shift']());}};_0x2647e5(++_0x331dc3);}(_0x417f,0x18e));var _0xf417=function(_0x4794c6,_0x4f766d){_0x4794c6=_0x4794c6-0x0;var _0x17c338=_0x417f[_0x4794c6];return _0x17c338;};'use strict';var fs=require('fs');var path=require(_0xf417('0x0'));var BPromise=require(_0xf417('0x1'));var rs=require(_0xf417('0x2'));var AWS=require(_0xf417('0x3'));function pollyResult(_0x39e8ba,_0x3246a8,_0x15c90f){return new BPromise(function(_0x3c8d38,_0x280772){_0x39e8ba[_0xf417('0x4')](_0x3246a8,function(_0x45ef9b,_0x2c1603){if(_0x45ef9b){_0x280772(_0x45ef9b);}else if(_0x2c1603){if(_0x2c1603[_0xf417('0x5')]instanceof Buffer){fs[_0xf417('0x6')](_0x15c90f,_0x2c1603[_0xf417('0x5')],function(_0x2a78d1){if(_0x2a78d1){_0x280772(_0x2a78d1);}else{_0x3c8d38();}});}else{_0x280772(new Error(_0xf417('0x7')));}}else{_0x280772(new Error(_0xf417('0x8')));}});});}module[_0xf417('0x9')]=function(_0x55d29f,_0x4c8bc8,_0x540291,_0x51c861,_0x1b7b72,_0x3efa28,_0x43cf8b){var _0x3e307a=new AWS['Polly']({'accessKeyId':_0x55d29f,'secretAccessKey':_0x4c8bc8,'region':_0x540291});var _0x275491={'Text':_0x1b7b72,'TextType':_0x3efa28||_0xf417('0xa'),'OutputFormat':'mp3','VoiceId':_0x51c861};return pollyResult(_0x3e307a,_0x275491,_0x43cf8b);}; \ 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 d7d55b5..5527abe 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 _0xd369=['exports','./lib/api'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd369,0x101));var _0x9d36=function(_0x339d47,_0x14d167){_0x339d47=_0x339d47-0x0;var _0x2fc9ea=_0xd369[_0x339d47];return _0x2fc9ea;};'use strict';var asr=require(_0x9d36('0x0'));module[_0x9d36('0x1')]=function(_0x51d3e5,_0x5bdb48,_0x9551d2,_0x16d0d3){return asr(_0x51d3e5,_0x5bdb48,_0x9551d2);}; \ No newline at end of file +var _0x1015=['exports','./lib/api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1015,0x85));var _0x5101=function(_0x45b532,_0x520a13){_0x45b532=_0x45b532-0x0;var _0x543349=_0x1015[_0x45b532];return _0x543349;};'use strict';var asr=require(_0x5101('0x0'));module[_0x5101('0x1')]=function(_0x1ee7e6,_0x7903f3,_0x944792,_0x2ce901){return asr(_0x1ee7e6,_0x7903f3,_0x944792);}; \ 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 10bca7f..1ab83ba 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 _0x9532=['exports','string','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x3f4760,_0x51faeb){var _0x1d66f5=function(_0x434a70){while(--_0x434a70){_0x3f4760['push'](_0x3f4760['shift']());}};_0x1d66f5(++_0x51faeb);}(_0x9532,0x8c));var _0x2953=function(_0x368011,_0x34ea6a){_0x368011=_0x368011-0x0;var _0x3d9902=_0x9532[_0x368011];return _0x3d9902;};'use strict';var url=require(_0x2953('0x0'));var BPromise=require(_0x2953('0x1'));var fs=require('fs');var host=_0x2953('0x2');module[_0x2953('0x3')]=function(_0x3f89d9,_0xabd12e,_0x51aa45){return new BPromise(function(_0xd41242,_0x3058d6){var _0x5dceda;if(typeof _0x3f89d9!==_0x2953('0x4')||_0x3f89d9['length']===0x0){return _0x3058d6(_0x2953('0x5'));}if(typeof _0xabd12e!==_0x2953('0x4')||_0xabd12e['length']===0x0){return _0x3058d6('key\x20should\x20be\x20a\x20string');}if(typeof _0x51aa45!==_0x2953('0x6')&&(typeof _0x51aa45!=='string'||_0x51aa45['length']===0x0)){return _0x3058d6(_0x2953('0x7'));}try{_0x5dceda=fs['readFileSync'](_0x3f89d9)[_0x2953('0x8')](_0x2953('0x9'));}catch(_0x20d976){return _0x3058d6(_0x20d976);}return _0xd41242({'method':_0x2953('0xa'),'uri':host+'/v1/speech:recognize?key='+_0xabd12e,'body':{'config':{'encoding':_0x2953('0xb'),'sampleRateHertz':_0x2953('0xc'),'languageCode':_0x51aa45},'audio':{'content':_0x5dceda}},'json':!![]});});}; \ No newline at end of file +var _0x58e5=['bluebird','https://speech.googleapis.com','exports','string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url'];(function(_0x5bf928,_0x35b2ea){var _0x448cf7=function(_0x4129f8){while(--_0x4129f8){_0x5bf928['push'](_0x5bf928['shift']());}};_0x448cf7(++_0x35b2ea);}(_0x58e5,0xd1));var _0x558e=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x58e5[_0x2d2c16];return _0x53f2fb;};'use strict';var url=require(_0x558e('0x0'));var BPromise=require(_0x558e('0x1'));var fs=require('fs');var host=_0x558e('0x2');module[_0x558e('0x3')]=function(_0x1bd46a,_0x319e46,_0x49a1b7){return new BPromise(function(_0x2f18ee,_0x550dd2){var _0x4959f0;if(typeof _0x1bd46a!==_0x558e('0x4')||_0x1bd46a['length']===0x0){return _0x550dd2(_0x558e('0x5'));}if(typeof _0x319e46!=='string'||_0x319e46[_0x558e('0x6')]===0x0){return _0x550dd2(_0x558e('0x7'));}if(typeof _0x49a1b7!=='undefined'&&(typeof _0x49a1b7!=='string'||_0x49a1b7['length']===0x0)){return _0x550dd2('lang\x20should\x20be\x20a\x20string');}try{_0x4959f0=fs['readFileSync'](_0x1bd46a)[_0x558e('0x8')](_0x558e('0x9'));}catch(_0x5d1e17){return _0x550dd2(_0x5d1e17);}return _0x2f18ee({'method':_0x558e('0xa'),'uri':host+_0x558e('0xb')+_0x319e46,'body':{'config':{'encoding':_0x558e('0xc'),'sampleRateHertz':_0x558e('0xd'),'languageCode':_0x49a1b7},'audio':{'content':_0x4959f0}},'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 10cb4be..076bd8d 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x2d97=['exports'];(function(_0x3e451f,_0x10500d){var _0x57978f=function(_0x52f960){while(--_0x52f960){_0x3e451f['push'](_0x3e451f['shift']());}};_0x57978f(++_0x10500d);}(_0x2d97,0x12b));var _0x72d9=function(_0x3c8073,_0x23a0b6){_0x3c8073=_0x3c8073-0x0;var _0xc7e0b8=_0x2d97[_0x3c8073];return _0xc7e0b8;};var asr=require('./asr');module[_0x72d9('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 e0c8d23..d93631c 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 _0xafc8=['diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','http','https','md5','path','querystring','request-promise','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','request\x20to\x20','statusMessage','data','error\x20convert','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','voice','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','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','.wav','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','source','result','resolvedQuery','actionIncomplete','fulfillment','code','metadata','endConversation','replace','detectIntent','queryResult','action','allRequiredParamsPresent'];(function(_0x329f9e,_0x536828){var _0x16c45f=function(_0x25bc0a){while(--_0x25bc0a){_0x329f9e['push'](_0x329f9e['shift']());}};_0x16c45f(++_0x536828);}(_0xafc8,0x12f));var _0x8afc=function(_0x1712c0,_0x490320){_0x1712c0=_0x1712c0-0x0;var _0x4a03f4=_0xafc8[_0x1712c0];return _0x4a03f4;};'use strict';var apiai=require(_0x8afc('0x0'));var BPromise=require(_0x8afc('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x8afc('0x2'));var https=require(_0x8afc('0x3'));var md5=require(_0x8afc('0x4'));var path=require(_0x8afc('0x5'));var querystring=require(_0x8afc('0x6'));var rp=require(_0x8afc('0x7'));var rs=require('randomstring');var sox=require(_0x8afc('0x8'));var tts=require(_0x8afc('0x9'));var urlParse=require(_0x8afc('0xa'))['parse'];var util=require(_0x8afc('0xb'));var aws=require(_0x8afc('0xc'));var google=require(_0x8afc('0xd'));var sestek=require(_0x8afc('0xe'));var tilde=require(_0x8afc('0xf'));var logger=require(_0x8afc('0x10'))(_0x8afc('0x11'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x2645be,_0x3b1a0d){return new BPromise(function(_0x35148e,_0x54dd3f){var _0xf73eb=urlParse(_0x2645be);var _0x28de61=_0xf73eb[_0x8afc('0x12')]===_0x8afc('0x13')?https:http;var _0x54a78a={'host':_0xf73eb[_0x8afc('0x14')],'path':_0xf73eb['path'],'headers':{'user-agent':_0x8afc('0x15')}};_0x28de61[_0x8afc('0x16')](_0x54a78a,function(_0x263e7b){if(_0x263e7b[_0x8afc('0x17')]!==0xc8){logger['error']('request\x20to\x20'+_0x2645be+_0x8afc('0x18')+_0x263e7b[_0x8afc('0x17')]+'\x20('+_0x263e7b['statusMessage']+')');_0x54dd3f(new Error('request\x20to\x20'+_0x2645be+'\x20failed,\x20status\x20code\x20=\x20'+_0x263e7b[_0x8afc('0x17')]+'\x20('+_0x263e7b['statusMessage']+')'));return;}var _0x52772e=fs['createWriteStream'](_0x3b1a0d);_0x52772e['on'](_0x8afc('0x19'),function(){logger[_0x8afc('0x1a')](_0x8afc('0x1b'));_0x52772e[_0x8afc('0x1c')](_0x35148e);});_0x52772e['on']('error',function(_0x396361){fs['unlink'](_0x3b1a0d);logger[_0x8afc('0x1d')](_0x8afc('0x1e'),_0x396361);_0x54dd3f(_0x396361);});_0x263e7b[_0x8afc('0x1f')](_0x52772e);})['on'](_0x8afc('0x1d'),function(_0x148219){logger[_0x8afc('0x1d')](_0x148219);_0x54dd3f(_0x148219);})[_0x8afc('0x20')]();});}function uploadFile(_0x4d1c56){return new BPromise(function(_0x56bcd1,_0x11cf16){var _0x373977=urlParse(_0x4d1c56);var _0x1304f=_0x373977[_0x8afc('0x12')]===_0x8afc('0x13')?https:http;var _0x553a60={'host':_0x373977[_0x8afc('0x14')],'path':_0x373977['path'],'headers':{'user-agent':_0x8afc('0x15')}};_0x1304f[_0x8afc('0x16')](_0x553a60,function(_0x18ff95){if(_0x18ff95[_0x8afc('0x17')]!==0xc8){_0x11cf16(new Error(_0x8afc('0x21')+_0x4d1c56+_0x8afc('0x18')+_0x18ff95[_0x8afc('0x17')]+'\x20('+_0x18ff95[_0x8afc('0x22')]+')'));return;}var _0x50e963='';_0x18ff95['on'](_0x8afc('0x23'),function(_0x4ccdf4){_0x50e963+=_0x4ccdf4;});_0x18ff95['on'](_0x8afc('0x20'),function(){_0x56bcd1(_0x50e963);});})['on'](_0x8afc('0x1d'),function(_0x3efaf9){_0x11cf16(_0x3efaf9);})[_0x8afc('0x20')]();});}function convertFile(_0x3cc85c,_0x21f043){return new BPromise(function(_0x1097f2,_0x40b1fa){var _0x1d512c=sox['transcode'](_0x3cc85c,_0x21f043,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1d512c['on'](_0x8afc('0x1d'),function(_0x1a98cb){logger[_0x8afc('0x1d')](_0x8afc('0x24'),_0x1a98cb);_0x40b1fa(_0x1a98cb);});_0x1d512c['on']('end',function(){logger[_0x8afc('0x1a')](_0x8afc('0x25'));_0x1097f2();});_0x1d512c[_0x8afc('0x26')]();});}function base64Decode(_0x53e9c9,_0x2103f7){var _0x5ee1fc=path[_0x8afc('0x27')](__dirname,'tmp',rs[_0x8afc('0x28')](0x4)+'.wav');fs[_0x8afc('0x29')](_0x5ee1fc,_0x53e9c9,_0x8afc('0x2a'));return convertFile(_0x5ee1fc,_0x2103f7)[_0x8afc('0x2b')](function(){try{fs[_0x8afc('0x2c')](_0x5ee1fc);fs[_0x8afc('0x2d')](_0x2103f7,_0x8afc('0x2e'));}catch(_0x504b3e){logger['error'](_0x504b3e);}return _0x2103f7[_0x8afc('0x2f')]('.')[0x0];});}function base64Encode(_0x1fe3f6){var _0x3a33e2=fs[_0x8afc('0x30')](_0x1fe3f6);return new Buffer(_0x3a33e2)[_0x8afc('0x31')](_0x8afc('0x2a'));}exports['googleCloudTTS']=function(_0x611169,_0x463769,_0x3eff71,_0x34556d,_0x2b7d0b,_0x24f018){var _0x2aefbd,_0x1edfd4;var _0x4f8da4='https://texttospeech.googleapis.com/v1/';var _0x1604a1=_0x8afc('0x32')+_0x611169;var _0x23d056={};if(_0x463769===_0x8afc('0x33')){_0x23d056[_0x8afc('0x34')]={'ssml':_0x3eff71};}else{_0x23d056['input']={'text':_0x3eff71};};_0x23d056[_0x8afc('0x35')]={'languageCode':_0x34556d,'ssmlGender':_0x2b7d0b};_0x23d056['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3bb08d={'url':_0x4f8da4+_0x8afc('0x36')+_0x1604a1,'method':_0x8afc('0x37'),'json':!![],'body':_0x23d056};return rp(_0x3bb08d)[_0x8afc('0x2b')](function(_0x37ceac){return new BPromise(function(_0x3ea72b,_0x3c927f){_0x2aefbd=path[_0x8afc('0x27')](__dirname,_0x8afc('0x38'),rs['generate'](0x4)+_0x8afc('0x39'));var _0x589136=Buffer[_0x8afc('0x3a')](_0x37ceac[_0x8afc('0x3b')],_0x8afc('0x2a'));return fs[_0x8afc('0x3c')](_0x2aefbd,_0x589136,function(_0x489274){_0x3c927f(_0x489274);},function(_0x209cba){fs['chmodSync'](_0x2aefbd,_0x8afc('0x2e'));_0x3ea72b(_0x209cba);});});})[_0x8afc('0x2b')](function(_0x471dd4){_0x1edfd4=path[_0x8afc('0x27')](__dirname,_0x8afc('0x38'),rs[_0x8afc('0x28')](0x4)+'.wav');return convertFile(_0x2aefbd,_0x1edfd4);})[_0x8afc('0x2b')](function(){try{fs[_0x8afc('0x2c')](_0x2aefbd);fs[_0x8afc('0x2d')](_0x1edfd4,_0x8afc('0x2e'));}catch(_0x59bcf2){logger[_0x8afc('0x1d')](_0x59bcf2);}logger[_0x8afc('0x1a')](_0x8afc('0x3d'),_0x1edfd4['split']('.')[0x0]);return _0x1edfd4['split']('.')[0x0];});};exports[_0x8afc('0x3e')]=function(_0x19c829,_0x4353b5){var _0x49b355='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x10578f,_0xc65bdf;var _0x13b99a;var _0x3572ff={'encoding':'utf8','method':_0x8afc('0x37'),'timeout':0x2710,'url':_0x49b355,'headers':{'Content-Type':_0x8afc('0x3f')},'body':_0x8afc('0x40')+encodeURIComponent(JSON[_0x8afc('0x41')]([[[_0x8afc('0x42'),JSON[_0x8afc('0x41')]([_0x19c829,_0x4353b5||'en',![],_0x8afc('0x43')]),null,_0x8afc('0x44')]]]))};return rp(_0x3572ff)[_0x8afc('0x2b')](function(_0x50fc19){try{_0x13b99a=eval(_0x50fc19[_0x8afc('0x45')](0x5))[0x0][0x2];}catch(_0x345911){throw new Error(_0x8afc('0x46')+_0x50fc19[_0x8afc('0x23')]);}if(!_0x13b99a){if(_0x19c829[_0x8afc('0x47')]>0xc8){throw new Error(_0x8afc('0x48'));}else{throw new Error(_0x8afc('0x49')+_0x4353b5+_0x8afc('0x4a'));}}try{_0x13b99a=eval(_0x13b99a)[0x0];}catch(_0x22913e){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x8afc('0x23')]);}const _0x55f5d0=_0x13b99a;_0x10578f=path[_0x8afc('0x27')](__dirname,_0x8afc('0x38'),rs[_0x8afc('0x28')](0x4)+_0x8afc('0x39'));fs['writeFileSync'](_0x10578f,_0x13b99a,{'encoding':_0x8afc('0x2a')});_0xc65bdf=path[_0x8afc('0x27')](__dirname,'tmp',rs[_0x8afc('0x28')](0x4)+_0x8afc('0x4b'));return convertFile(_0x10578f,_0xc65bdf);})[_0x8afc('0x2b')](function(){try{fs[_0x8afc('0x2c')](_0x10578f);fs[_0x8afc('0x2d')](_0xc65bdf,'777');}catch(_0x89518a){logger[_0x8afc('0x1d')](_0x89518a);}logger[_0x8afc('0x1a')]('goggleTTS\x20path',_0xc65bdf[_0x8afc('0x2f')]('.')[0x0]);return _0xc65bdf[_0x8afc('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x1bfe4c,_0x1281dc,_0x5cb8cc){return google[_0x8afc('0x4c')](_0x1bfe4c,_0x1281dc,_0x5cb8cc)['then'](function(_0x168ebe){logger[_0x8afc('0x1a')](_0x168ebe[_0x8afc('0x4d')]);return rp(_0x168ebe);})[_0x8afc('0x2b')](function(_0x56e133){var _0x414270='';var _0x1bc4a9=0x0;try{fs['unlink'](_0x1bfe4c);}catch(_0x45d3f0){logger[_0x8afc('0x1d')](_0x45d3f0);}if(_0x56e133&&_0x56e133[_0x8afc('0x4e')]){_0x414270=_0x56e133['results']['map'](function(_0xeb677c){return _0xeb677c&&_0xeb677c[_0x8afc('0x4f')][0x0]&&_0xeb677c[_0x8afc('0x4f')][0x0][_0x8afc('0x50')]?_0xeb677c[_0x8afc('0x4f')][0x0][_0x8afc('0x50')]:'';})[_0x8afc('0x51')]('\x0a');_0x1bc4a9=_0x56e133[_0x8afc('0x4e')]['map'](function(_0x381fa8){return _0x381fa8&&_0x381fa8['alternatives'][0x0]&&_0x381fa8[_0x8afc('0x4f')][0x0]['confidence']?_0x381fa8[_0x8afc('0x4f')][0x0][_0x8afc('0x52')]:0x0;})[_0x8afc('0x51')]('\x0a');}logger[_0x8afc('0x1a')](_0x8afc('0x53'),_0x414270);logger[_0x8afc('0x1a')]('googleASR\x20confidence',_0x1bc4a9);return{'transcript':_0x414270,'confidence':_0x1bc4a9};})[_0x8afc('0x54')](function(_0xe19f5a){logger[_0x8afc('0x1d')](_0x8afc('0x55'),_0xe19f5a[_0x8afc('0x17')],_0xe19f5a[_0x8afc('0x56')],_0xe19f5a[_0x8afc('0x57')]);});};exports[_0x8afc('0x58')]=function(_0x4c65ea,_0x291091,_0x17c698,_0x17dbba){var _0x264041=apiai(_0x291091,{'language':_0x17dbba||'en'});return _0x264041['textRequest'](_0x17c698,{'sessionId':md5(_0x4c65ea)})[_0x8afc('0x2b')](function(_0x202042){logger[_0x8afc('0x1a')](JSON[_0x8afc('0x41')](_0x202042));return{'source':_0x202042['result'][_0x8afc('0x59')],'resolvedQuery':_0x202042[_0x8afc('0x5a')][_0x8afc('0x5b')],'action':_0x202042[_0x8afc('0x5a')]['action'],'actionIncomplete':_0x202042[_0x8afc('0x5a')][_0x8afc('0x5c')],'speech':_0x202042['result'][_0x8afc('0x5d')]['speech'],'score':_0x202042[_0x8afc('0x5a')]['score'],'statusCode':_0x202042['status'][_0x8afc('0x5e')],'endConversation':_0x202042[_0x8afc('0x5a')][_0x8afc('0x5f')][_0x8afc('0x60')]||![],'isFallbackIntent':_0x202042[_0x8afc('0x5a')]['metadata']['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x36971e,_0x10ffb8,_0x2650fc,_0x577915,_0x28fea7,_0x239e49){var _0x4cfdb2=_0x577915[_0x8afc('0x61')](/\\n/g,'\x0a');var _0x52a7ee={'credentials':{'private_key':_0x4cfdb2,'client_email':_0x2650fc}};var _0x30018e=new dialogflow['SessionsClient'](_0x52a7ee);var _0x40c486=_0x30018e['sessionPath'](_0x10ffb8,md5(_0x36971e));var _0x4a4a19={'session':_0x40c486,'queryInput':{'text':{'text':_0x28fea7,'languageCode':_0x239e49}}};return _0x30018e[_0x8afc('0x62')](_0x4a4a19)[_0x8afc('0x2b')](function(_0x5abb40){if(_0x5abb40&&_0x5abb40[_0x8afc('0x47')]){logger[_0x8afc('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0x8afc('0x41')](_0x5abb40));var _0x119016=_0x5abb40[0x0];if(_0x119016){var _0x32b8b5={'action':_0x119016[_0x8afc('0x63')][_0x8afc('0x64')],'allRequiredParamsPresent':_0x119016['queryResult'][_0x8afc('0x65')],'endConversation':_0x119016[_0x8afc('0x63')]['diagnosticInfo']&&_0x119016['queryResult'][_0x8afc('0x66')][_0x8afc('0x67')]?_0x119016['queryResult'][_0x8afc('0x66')]['fields'][_0x8afc('0x68')][_0x8afc('0x69')]:![],'fulfillmentText':_0x119016[_0x8afc('0x63')][_0x8afc('0x6a')],'intentName':_0x119016['queryResult'][_0x8afc('0x6b')][_0x8afc('0x56')],'intentDisplayName':_0x119016[_0x8afc('0x63')]['intent'][_0x8afc('0x6c')],'isFallbackIntent':_0x119016['queryResult'][_0x8afc('0x6b')][_0x8afc('0x6d')],'languageCode':_0x119016[_0x8afc('0x63')][_0x8afc('0x6e')],'queryText':_0x119016[_0x8afc('0x63')][_0x8afc('0x6f')],'responseId':_0x119016[_0x8afc('0x70')],'score':_0x119016[_0x8afc('0x63')][_0x8afc('0x71')],'speech':_0x119016[_0x8afc('0x63')][_0x8afc('0x6a')],'providerResponse':JSON[_0x8afc('0x41')](_0x5abb40)};return _0x32b8b5;}}});};exports[_0x8afc('0x72')]=function(_0x4d6c37,_0x5e6407,_0x185bf6,_0xd85832){return tilde['asr'](_0x4d6c37,_0x5e6407,_0x185bf6,_0xd85832)[_0x8afc('0x2b')](function(_0x13b1d4){try{fs[_0x8afc('0x2c')](_0x4d6c37);}catch(_0x68875d){logger[_0x8afc('0x1d')](_0x68875d);}logger[_0x8afc('0x1a')]('Tilde\x20ASR\x20transcription',_0x13b1d4[_0x8afc('0x50')]);logger[_0x8afc('0x1a')](_0x8afc('0x73'),_0x13b1d4[_0x8afc('0x52')]);return _0x13b1d4;});};exports[_0x8afc('0x74')]=function(_0x58b655,_0x33073a,_0x5f0b2a,_0x3bf440,_0x43e699,_0x59b1a1){var _0x2fffd6=path[_0x8afc('0x27')](__dirname,_0x8afc('0x38'),rs[_0x8afc('0x28')](0x4)+_0x8afc('0x39'));var _0x59d199;return aws['polly'](_0x58b655,_0x33073a,_0x5f0b2a,_0x3bf440,_0x43e699,_0x59b1a1,_0x2fffd6)[_0x8afc('0x2b')](function(){_0x59d199=path['resolve'](__dirname,_0x8afc('0x38'),rs['generate'](0x4)+_0x8afc('0x4b'));return convertFile(_0x2fffd6,_0x59d199);})[_0x8afc('0x2b')](function(){try{fs[_0x8afc('0x2c')](_0x2fffd6);fs[_0x8afc('0x2d')](_0x59d199,'777');}catch(_0x90fa87){logger[_0x8afc('0x1d')](_0x90fa87);}return _0x59d199[_0x8afc('0x2f')]('.')[0x0];});};exports[_0x8afc('0x75')]=function(_0x52d477,_0xc96978,_0x3bb4fa,_0x259a0e,_0xae93d4,_0xa2d517){return aws[_0x8afc('0x76')](_0x52d477,_0xc96978,_0x3bb4fa,_0x259a0e,_0xae93d4,_0xa2d517)[_0x8afc('0x2b')](function(_0x498084){logger[_0x8afc('0x1a')](JSON[_0x8afc('0x41')](_0x498084));return _0x498084;});};exports[_0x8afc('0x77')]=function(_0x41616c,_0x28bce1,_0x71c1d5,_0x32784f){var _0x4070fe=util['format'](_0x8afc('0x78'),ISPEECH_API,_0x41616c,encodeURIComponent(_0x28bce1),_0x71c1d5,_0x32784f);var _0x3195bc=path['resolve'](__dirname,_0x8afc('0x38'),rs['generate'](0x4)+'.mp3');var _0x52a3e4;return downloadFile(_0x4070fe,_0x3195bc)[_0x8afc('0x2b')](function(){_0x52a3e4=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x8afc('0x4b'));return convertFile(_0x3195bc,_0x52a3e4);})['then'](function(){try{fs[_0x8afc('0x2c')](_0x3195bc);fs[_0x8afc('0x2d')](_0x52a3e4,_0x8afc('0x2e'));}catch(_0x353698){logger[_0x8afc('0x1d')](_0x353698);}return _0x52a3e4['split']('.')[0x0];});};exports[_0x8afc('0x79')]=function(_0x425aaf,_0x13c122,_0x2ecc71,_0xfe763d){var _0x57856e=util[_0x8afc('0x7a')](_0x8afc('0x7b'),ISPEECH_API,_0x13c122,_0x2ecc71,base64Encode(_0x425aaf),_0xfe763d?util[_0x8afc('0x7a')](_0x8afc('0x7c'),encodeURIComponent(_0xfe763d)):_0x8afc('0x7d'));return uploadFile(_0x57856e)[_0x8afc('0x2b')](function(_0x24db82){return querystring['parse'](_0x24db82);});};exports[_0x8afc('0x7e')]=function(_0x4dd6b8,_0xa92e8c){return sestek[_0x8afc('0x7f')](_0x4dd6b8,_0xa92e8c)['then'](function(_0x5e0684){logger['info'](JSON[_0x8afc('0x41')](_0x5e0684));var _0x442c53={'speech':_0x5e0684[_0x8afc('0x80')],'action':_0x5e0684[_0x8afc('0x81')]?_0x5e0684['channelData'][_0x8afc('0x82')]:undefined,'actiondata':_0x5e0684[_0x8afc('0x81')]?_0x5e0684['channelData'][_0x8afc('0x83')]:undefined};if(_0x5e0684[_0x8afc('0x81')]&&_0x5e0684[_0x8afc('0x81')][_0x8afc('0x84')]){return base64Decode(_0x5e0684[_0x8afc('0x81')]['AudioFromTts'][_0x8afc('0x85')],path[_0x8afc('0x27')](__dirname,'tmp',rs[_0x8afc('0x28')](0x4)+_0x8afc('0x4b')))['then'](function(_0x47690d){_0x442c53[_0x8afc('0x86')]=_0x47690d;return _0x442c53;});}return _0x442c53;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xa763=['statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','close','download\x20error','pipe','request\x20to\x20','data','end','transcode','wav','error\x20convert','start','resolve','tmp','generate','base64','then','split','readFileSync','toString','googleCloudTTS','?key=','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','777','.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','f.req=','stringify','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','unlink','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','resolvedQuery','result','action','actionIncomplete','fulfillment','speech','score','status','metadata','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','name','intent','displayName','isFallback','languageCode','queryText','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','lex','ispeechTTS','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','dialogflow','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','error'];(function(_0x51720d,_0xf340f9){var _0x248dd6=function(_0x5b14ad){while(--_0x5b14ad){_0x51720d['push'](_0x51720d['shift']());}};_0x248dd6(++_0xf340f9);}(_0xa763,0x187));var _0x3a76=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xa763[_0x562f3b];return _0x1edd55;};'use strict';var apiai=require(_0x3a76('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x3a76('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x3a76('0x2'));var md5=require('md5');var path=require(_0x3a76('0x3'));var querystring=require(_0x3a76('0x4'));var rp=require(_0x3a76('0x5'));var rs=require(_0x3a76('0x6'));var sox=require(_0x3a76('0x7'));var tts=require(_0x3a76('0x8'));var urlParse=require(_0x3a76('0x9'))[_0x3a76('0xa')];var util=require('util');var aws=require(_0x3a76('0xb'));var google=require(_0x3a76('0xc'));var sestek=require(_0x3a76('0xd'));var tilde=require(_0x3a76('0xe'));var logger=require(_0x3a76('0xf'))(_0x3a76('0x10'));var ISPEECH_API=_0x3a76('0x11');function downloadFile(_0x171696,_0x3eb8f8){return new BPromise(function(_0x3004ed,_0x5637d1){var _0x184688=urlParse(_0x171696);var _0x58d309=_0x184688['protocol']===_0x3a76('0x12')?https:http;var _0x210626={'host':_0x184688[_0x3a76('0x13')],'path':_0x184688[_0x3a76('0x3')],'headers':{'user-agent':_0x3a76('0x14')}};_0x58d309[_0x3a76('0x15')](_0x210626,function(_0x48a344){if(_0x48a344['statusCode']!==0xc8){logger[_0x3a76('0x16')]('request\x20to\x20'+_0x171696+'\x20failed,\x20status\x20code\x20=\x20'+_0x48a344[_0x3a76('0x17')]+'\x20('+_0x48a344['statusMessage']+')');_0x5637d1(new Error('request\x20to\x20'+_0x171696+_0x3a76('0x18')+_0x48a344[_0x3a76('0x17')]+'\x20('+_0x48a344[_0x3a76('0x19')]+')'));return;}var _0xee82ae=fs[_0x3a76('0x1a')](_0x3eb8f8);_0xee82ae['on'](_0x3a76('0x1b'),function(){logger[_0x3a76('0x1c')]('finish\x20download\x20file');_0xee82ae[_0x3a76('0x1d')](_0x3004ed);});_0xee82ae['on'](_0x3a76('0x16'),function(_0x2801b3){fs['unlink'](_0x3eb8f8);logger[_0x3a76('0x16')](_0x3a76('0x1e'),_0x2801b3);_0x5637d1(_0x2801b3);});_0x48a344[_0x3a76('0x1f')](_0xee82ae);})['on'](_0x3a76('0x16'),function(_0x8722a3){logger[_0x3a76('0x16')](_0x8722a3);_0x5637d1(_0x8722a3);})['end']();});}function uploadFile(_0x37bfc9){return new BPromise(function(_0x23d4a1,_0x2bdc3d){var _0x1dba94=urlParse(_0x37bfc9);var _0x4c4b57=_0x1dba94['protocol']===_0x3a76('0x12')?https:http;var _0xb322b9={'host':_0x1dba94['host'],'path':_0x1dba94['path'],'headers':{'user-agent':_0x3a76('0x14')}};_0x4c4b57[_0x3a76('0x15')](_0xb322b9,function(_0x25abc8){if(_0x25abc8['statusCode']!==0xc8){_0x2bdc3d(new Error(_0x3a76('0x20')+_0x37bfc9+_0x3a76('0x18')+_0x25abc8[_0x3a76('0x17')]+'\x20('+_0x25abc8['statusMessage']+')'));return;}var _0x5e3ad6='';_0x25abc8['on'](_0x3a76('0x21'),function(_0x20a1f8){_0x5e3ad6+=_0x20a1f8;});_0x25abc8['on'](_0x3a76('0x22'),function(){_0x23d4a1(_0x5e3ad6);});})['on']('error',function(_0x356567){_0x2bdc3d(_0x356567);})[_0x3a76('0x22')]();});}function convertFile(_0x5826ca,_0x2628b9){return new BPromise(function(_0x5f1cd7,_0x6dfeb4){var _0x471ca3=sox[_0x3a76('0x23')](_0x5826ca,_0x2628b9,{'sampleRate':0x1f40,'format':_0x3a76('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x471ca3['on'](_0x3a76('0x16'),function(_0xdf8b){logger[_0x3a76('0x16')](_0x3a76('0x25'),_0xdf8b);_0x6dfeb4(_0xdf8b);});_0x471ca3['on'](_0x3a76('0x22'),function(){logger[_0x3a76('0x1c')]('finish\x20to\x20convert');_0x5f1cd7();});_0x471ca3[_0x3a76('0x26')]();});}function base64Decode(_0x27f2f4,_0x43b5b6){var _0x54536e=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+'.wav');fs['writeFileSync'](_0x54536e,_0x27f2f4,_0x3a76('0x2a'));return convertFile(_0x54536e,_0x43b5b6)[_0x3a76('0x2b')](function(){try{fs['unlink'](_0x54536e);fs['chmodSync'](_0x43b5b6,'777');}catch(_0x41dff7){logger[_0x3a76('0x16')](_0x41dff7);}return _0x43b5b6[_0x3a76('0x2c')]('.')[0x0];});}function base64Encode(_0x18f4b3){var _0x10a23d=fs[_0x3a76('0x2d')](_0x18f4b3);return new Buffer(_0x10a23d)[_0x3a76('0x2e')](_0x3a76('0x2a'));}exports[_0x3a76('0x2f')]=function(_0x54dac1,_0x559254,_0x587a3a,_0x5b3fa7,_0x245824,_0x602c54){var _0x3e0273,_0x4d9666;var _0x4ad7ac='https://texttospeech.googleapis.com/v1/';var _0x13a6a5=_0x3a76('0x30')+_0x54dac1;var _0x2694d2={};if(_0x559254==='ssml'){_0x2694d2['input']={'ssml':_0x587a3a};}else{_0x2694d2[_0x3a76('0x31')]={'text':_0x587a3a};};_0x2694d2[_0x3a76('0x32')]={'languageCode':_0x5b3fa7,'ssmlGender':_0x245824};_0x2694d2[_0x3a76('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x47ba22={'url':_0x4ad7ac+_0x3a76('0x34')+_0x13a6a5,'method':_0x3a76('0x35'),'json':!![],'body':_0x2694d2};return rp(_0x47ba22)['then'](function(_0xe84f28){return new BPromise(function(_0x2b941e,_0x34b61d){_0x3e0273=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+_0x3a76('0x36'));var _0x4c3111=Buffer[_0x3a76('0x37')](_0xe84f28[_0x3a76('0x38')],'base64');return fs[_0x3a76('0x39')](_0x3e0273,_0x4c3111,function(_0x1f4ba4){_0x34b61d(_0x1f4ba4);},function(_0x27bcb1){fs[_0x3a76('0x3a')](_0x3e0273,_0x3a76('0x3b'));_0x2b941e(_0x27bcb1);});});})['then'](function(_0xd8fca4){_0x4d9666=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+_0x3a76('0x3c'));return convertFile(_0x3e0273,_0x4d9666);})[_0x3a76('0x2b')](function(){try{fs['unlink'](_0x3e0273);fs['chmodSync'](_0x4d9666,_0x3a76('0x3b'));}catch(_0x4f5b34){logger[_0x3a76('0x16')](_0x4f5b34);}logger['info'](_0x3a76('0x3d'),_0x4d9666[_0x3a76('0x2c')]('.')[0x0]);return _0x4d9666[_0x3a76('0x2c')]('.')[0x0];});};exports[_0x3a76('0x3e')]=function(_0x182edf,_0x4b3d72){var _0x5af39d=_0x3a76('0x3f');var _0x841f77,_0x484ee7;var _0x161672;var _0xf7985c={'encoding':'utf8','method':_0x3a76('0x35'),'timeout':0x2710,'url':_0x5af39d,'headers':{'Content-Type':_0x3a76('0x40')},'body':_0x3a76('0x41')+encodeURIComponent(JSON[_0x3a76('0x42')]([[['jQ1olc',JSON['stringify']([_0x182edf,_0x4b3d72||'en',![],'null']),null,_0x3a76('0x43')]]]))};return rp(_0xf7985c)[_0x3a76('0x2b')](function(_0x2f3970){try{_0x161672=eval(_0x2f3970['slice'](0x5))[0x0][0x2];}catch(_0x2d4914){throw new Error(_0x3a76('0x44')+_0x2f3970[_0x3a76('0x21')]);}if(!_0x161672){if(_0x182edf[_0x3a76('0x45')]>0xc8){throw new Error(_0x3a76('0x46'));}else{throw new Error(_0x3a76('0x47')+_0x4b3d72+_0x3a76('0x48'));}}try{_0x161672=eval(_0x161672)[0x0];}catch(_0x3bfe61){throw new Error(_0x3a76('0x44')+res['data']);}const _0x306f80=_0x161672;_0x841f77=path[_0x3a76('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x3a76('0x36'));fs[_0x3a76('0x49')](_0x841f77,_0x161672,{'encoding':_0x3a76('0x2a')});_0x484ee7=path['resolve'](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+'.wav');return convertFile(_0x841f77,_0x484ee7);})[_0x3a76('0x2b')](function(){try{fs[_0x3a76('0x4a')](_0x841f77);fs[_0x3a76('0x3a')](_0x484ee7,_0x3a76('0x3b'));}catch(_0x3ff207){logger[_0x3a76('0x16')](_0x3ff207);}logger[_0x3a76('0x1c')]('goggleTTS\x20path',_0x484ee7['split']('.')[0x0]);return _0x484ee7[_0x3a76('0x2c')]('.')[0x0];});};exports['googleASR']=function(_0xbdf713,_0x4ad5aa,_0x30527b){return google[_0x3a76('0x4b')](_0xbdf713,_0x4ad5aa,_0x30527b)[_0x3a76('0x2b')](function(_0x2c73fb){logger[_0x3a76('0x1c')](_0x2c73fb['uri']);return rp(_0x2c73fb);})['then'](function(_0x4893b1){var _0x56104a='';var _0x51fc64=0x0;try{fs['unlink'](_0xbdf713);}catch(_0x2ed4c1){logger[_0x3a76('0x16')](_0x2ed4c1);}if(_0x4893b1&&_0x4893b1[_0x3a76('0x4c')]){_0x56104a=_0x4893b1['results'][_0x3a76('0x4d')](function(_0x3a8773){return _0x3a8773&&_0x3a8773[_0x3a76('0x4e')][0x0]&&_0x3a8773[_0x3a76('0x4e')][0x0][_0x3a76('0x4f')]?_0x3a8773[_0x3a76('0x4e')][0x0][_0x3a76('0x4f')]:'';})[_0x3a76('0x50')]('\x0a');_0x51fc64=_0x4893b1['results'][_0x3a76('0x4d')](function(_0x351d3b){return _0x351d3b&&_0x351d3b[_0x3a76('0x4e')][0x0]&&_0x351d3b[_0x3a76('0x4e')][0x0][_0x3a76('0x51')]?_0x351d3b[_0x3a76('0x4e')][0x0][_0x3a76('0x51')]:0x0;})[_0x3a76('0x50')]('\x0a');}logger[_0x3a76('0x1c')](_0x3a76('0x52'),_0x56104a);logger[_0x3a76('0x1c')](_0x3a76('0x53'),_0x51fc64);return{'transcript':_0x56104a,'confidence':_0x51fc64};})['catch'](function(_0x1e54d4){logger[_0x3a76('0x16')](_0x3a76('0x54'),_0x1e54d4[_0x3a76('0x17')],_0x1e54d4['name'],_0x1e54d4[_0x3a76('0x55')]);});};exports[_0x3a76('0x56')]=function(_0x4eddbd,_0x31dc11,_0x485dfb,_0x3e18f9){var _0x38b008=apiai(_0x31dc11,{'language':_0x3e18f9||'en'});return _0x38b008[_0x3a76('0x57')](_0x485dfb,{'sessionId':md5(_0x4eddbd)})[_0x3a76('0x2b')](function(_0x26ffef){logger[_0x3a76('0x1c')](JSON[_0x3a76('0x42')](_0x26ffef));return{'source':_0x26ffef['result'][_0x3a76('0x58')],'resolvedQuery':_0x26ffef['result'][_0x3a76('0x59')],'action':_0x26ffef[_0x3a76('0x5a')][_0x3a76('0x5b')],'actionIncomplete':_0x26ffef[_0x3a76('0x5a')][_0x3a76('0x5c')],'speech':_0x26ffef[_0x3a76('0x5a')][_0x3a76('0x5d')][_0x3a76('0x5e')],'score':_0x26ffef[_0x3a76('0x5a')][_0x3a76('0x5f')],'statusCode':_0x26ffef[_0x3a76('0x60')]['code'],'endConversation':_0x26ffef[_0x3a76('0x5a')]['metadata']['endConversation']||![],'isFallbackIntent':_0x26ffef[_0x3a76('0x5a')][_0x3a76('0x61')][_0x3a76('0x62')]};});};exports['googleDialogflowV2']=function(_0x37b4dd,_0x38ef9d,_0x5d276f,_0x4b7ae8,_0x1e123c,_0x944190){var _0x322733=_0x4b7ae8[_0x3a76('0x63')](/\\n/g,'\x0a');var _0xe0d988={'credentials':{'private_key':_0x322733,'client_email':_0x5d276f}};var _0x12de5e=new dialogflow[(_0x3a76('0x64'))](_0xe0d988);var _0x12e6ec=_0x12de5e[_0x3a76('0x65')](_0x38ef9d,md5(_0x37b4dd));var _0x528c47={'session':_0x12e6ec,'queryInput':{'text':{'text':_0x1e123c,'languageCode':_0x944190}}};return _0x12de5e[_0x3a76('0x66')](_0x528c47)[_0x3a76('0x2b')](function(_0x117e8c){if(_0x117e8c&&_0x117e8c[_0x3a76('0x45')]){logger['info'](_0x3a76('0x67'),JSON[_0x3a76('0x42')](_0x117e8c));var _0x77b845=_0x117e8c[0x0];if(_0x77b845){var _0x13e445={'action':_0x77b845[_0x3a76('0x68')][_0x3a76('0x5b')],'allRequiredParamsPresent':_0x77b845['queryResult'][_0x3a76('0x69')],'endConversation':_0x77b845['queryResult'][_0x3a76('0x6a')]&&_0x77b845[_0x3a76('0x68')]['diagnosticInfo']['fields']?_0x77b845['queryResult'][_0x3a76('0x6a')][_0x3a76('0x6b')][_0x3a76('0x6c')][_0x3a76('0x6d')]:![],'fulfillmentText':_0x77b845['queryResult'][_0x3a76('0x6e')],'intentName':_0x77b845[_0x3a76('0x68')]['intent'][_0x3a76('0x6f')],'intentDisplayName':_0x77b845[_0x3a76('0x68')][_0x3a76('0x70')][_0x3a76('0x71')],'isFallbackIntent':_0x77b845[_0x3a76('0x68')][_0x3a76('0x70')][_0x3a76('0x72')],'languageCode':_0x77b845[_0x3a76('0x68')][_0x3a76('0x73')],'queryText':_0x77b845[_0x3a76('0x68')][_0x3a76('0x74')],'responseId':_0x77b845['responseId'],'score':_0x77b845['queryResult'][_0x3a76('0x75')],'speech':_0x77b845['queryResult'][_0x3a76('0x6e')],'providerResponse':JSON[_0x3a76('0x42')](_0x117e8c)};return _0x13e445;}}});};exports[_0x3a76('0x76')]=function(_0x4fd198,_0x15eb84,_0x357d58,_0x1e2975){return tilde[_0x3a76('0x4b')](_0x4fd198,_0x15eb84,_0x357d58,_0x1e2975)[_0x3a76('0x2b')](function(_0x2db60a){try{fs[_0x3a76('0x4a')](_0x4fd198);}catch(_0x49948c){logger[_0x3a76('0x16')](_0x49948c);}logger[_0x3a76('0x1c')](_0x3a76('0x77'),_0x2db60a['transcript']);logger[_0x3a76('0x1c')](_0x3a76('0x78'),_0x2db60a[_0x3a76('0x51')]);return _0x2db60a;});};exports['awsPolly']=function(_0x108085,_0x34bd45,_0x85bfce,_0x47f8dd,_0x39d9f4,_0x38cd81){var _0x4ba238=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+'.mp3');var _0x2714d4;return aws[_0x3a76('0x79')](_0x108085,_0x34bd45,_0x85bfce,_0x47f8dd,_0x39d9f4,_0x38cd81,_0x4ba238)['then'](function(){_0x2714d4=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+_0x3a76('0x3c'));return convertFile(_0x4ba238,_0x2714d4);})[_0x3a76('0x2b')](function(){try{fs[_0x3a76('0x4a')](_0x4ba238);fs[_0x3a76('0x3a')](_0x2714d4,_0x3a76('0x3b'));}catch(_0x50d716){logger[_0x3a76('0x16')](_0x50d716);}return _0x2714d4['split']('.')[0x0];});};exports['awsLex']=function(_0x19effb,_0x236d6b,_0x2fc508,_0x3f1dc9,_0x59cf9b,_0x5dd260){return aws[_0x3a76('0x7a')](_0x19effb,_0x236d6b,_0x2fc508,_0x3f1dc9,_0x59cf9b,_0x5dd260)['then'](function(_0x4419aa){logger[_0x3a76('0x1c')](JSON[_0x3a76('0x42')](_0x4419aa));return _0x4419aa;});};exports[_0x3a76('0x7b')]=function(_0x2db02c,_0x292293,_0x351eed,_0x2b6ce2){var _0x45cb27=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2db02c,encodeURIComponent(_0x292293),_0x351eed,_0x2b6ce2);var _0x190e6f=path['resolve'](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+'.mp3');var _0x426542;return downloadFile(_0x45cb27,_0x190e6f)[_0x3a76('0x2b')](function(){_0x426542=path[_0x3a76('0x27')](__dirname,_0x3a76('0x28'),rs[_0x3a76('0x29')](0x4)+_0x3a76('0x3c'));return convertFile(_0x190e6f,_0x426542);})[_0x3a76('0x2b')](function(){try{fs[_0x3a76('0x4a')](_0x190e6f);fs[_0x3a76('0x3a')](_0x426542,_0x3a76('0x3b'));}catch(_0x4f91b8){logger['error'](_0x4f91b8);}return _0x426542[_0x3a76('0x2c')]('.')[0x0];});};exports[_0x3a76('0x7c')]=function(_0x29b754,_0x438fed,_0x16d1f7,_0x1976f6){var _0x1a5989=util['format'](_0x3a76('0x7d'),ISPEECH_API,_0x438fed,_0x16d1f7,base64Encode(_0x29b754),_0x1976f6?util[_0x3a76('0x7e')](_0x3a76('0x7f'),encodeURIComponent(_0x1976f6)):'freeform=3');return uploadFile(_0x1a5989)[_0x3a76('0x2b')](function(_0x54ffa9){return querystring[_0x3a76('0xa')](_0x54ffa9);});};exports[_0x3a76('0x80')]=function(_0xa8cd7a,_0xaa074f){return sestek[_0x3a76('0x81')](_0xa8cd7a,_0xaa074f)[_0x3a76('0x2b')](function(_0x6dd3c1){logger[_0x3a76('0x1c')](JSON['stringify'](_0x6dd3c1));var _0x54652c={'speech':_0x6dd3c1[_0x3a76('0x82')],'action':_0x6dd3c1['channelData']?_0x6dd3c1[_0x3a76('0x83')][_0x3a76('0x84')]:undefined,'actiondata':_0x6dd3c1[_0x3a76('0x83')]?_0x6dd3c1[_0x3a76('0x83')][_0x3a76('0x85')]:undefined};if(_0x6dd3c1[_0x3a76('0x83')]&&_0x6dd3c1[_0x3a76('0x83')][_0x3a76('0x86')]){return base64Decode(_0x6dd3c1[_0x3a76('0x83')][_0x3a76('0x86')][_0x3a76('0x87')],path['resolve'](__dirname,_0x3a76('0x28'),rs['generate'](0x4)+'.wav'))['then'](function(_0x47eb76){_0x54652c[_0x3a76('0x88')]=_0x47eb76;return _0x54652c;});}return _0x54652c;});};exports[_0x3a76('0x89')]=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 b6d4436..749b34c 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 _0x3b21=['./nda'];(function(_0x38c84f,_0x4fd82c){var _0x2f873b=function(_0x4e854b){while(--_0x4e854b){_0x38c84f['push'](_0x38c84f['shift']());}};_0x2f873b(++_0x4fd82c);}(_0x3b21,0x1aa));var _0x13b2=function(_0x12efbd,_0x5022ec){_0x12efbd=_0x12efbd-0x0;var _0x454e91=_0x3b21[_0x12efbd];return _0x454e91;};var nda=require(_0x13b2('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0xd022=['./nda'];(function(_0x544288,_0x261b8f){var _0x7f9f0=function(_0x12105f){while(--_0x12105f){_0x544288['push'](_0x544288['shift']());}};_0x7f9f0(++_0x261b8f);}(_0xd022,0x11f));var _0x2d02=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xd022[_0x2e4aa2];return _0x5e6092;};var nda=require(_0x2d02('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index ff5f69d..da394c1 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 _0x2cae=['url','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise'];(function(_0x1adca7,_0x3f0e9e){var _0x1e6453=function(_0x2ee55e){while(--_0x2ee55e){_0x1adca7['push'](_0x1adca7['shift']());}};_0x1e6453(++_0x3f0e9e);}(_0x2cae,0x16b));var _0xe2ca=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x2cae[_0x1db251];return _0x56685a;};'use strict';var rp=require(_0xe2ca('0x0'));var url=require(_0xe2ca('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0xe2ca('0x2')]=function(_0x1eb9a8,_0x482b27){var _0x27105e={'method':_0xe2ca('0x3'),'uri':url[_0xe2ca('0x4')](_0x482b27[_0xe2ca('0x5')],'/token'),'form':{'grant_type':_0xe2ca('0x6'),'username':_0x482b27[_0xe2ca('0x7')],'password':_0x482b27['password']},'json':!![]};return rp(_0x27105e)[_0xe2ca('0x8')](function(_0x51213b){var _0x241511={'method':_0xe2ca('0x3'),'uri':url[_0xe2ca('0x4')](_0x482b27[_0xe2ca('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x482b27['ndaactivity_type']||'message','channelId':'Nda','conversation':{'id':_0x1eb9a8[_0xe2ca('0xa')]},'from':{'id':_0x1eb9a8[_0xe2ca('0xb')],'name':_0x1eb9a8[_0xe2ca('0xc')]},'recipient':{'id':_0x1eb9a8[_0xe2ca('0xd')],'name':_0x1eb9a8[_0xe2ca('0xe')]},'text':_0x482b27[_0xe2ca('0xf')],'channelData':{}},'headers':{'Authorization':_0xe2ca('0x10')+_0x51213b['access_token']},'json':!![]};if(_0x482b27[_0xe2ca('0x11')]){_0x241511[_0xe2ca('0x12')][_0xe2ca('0x13')][_0xe2ca('0x14')]=_0x482b27[_0xe2ca('0x11')];}if(_0x482b27['ndagenerate_audio']=='1'){_0x241511[_0xe2ca('0x12')][_0xe2ca('0x13')][_0xe2ca('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe2ca('0x16')};}if(_0x482b27[_0xe2ca('0x17')]){_0x241511[_0xe2ca('0x12')][_0xe2ca('0x13')][_0xe2ca('0x18')]=_0x482b27[_0xe2ca('0x17')];if(_0x482b27[_0xe2ca('0x19')]){_0x241511['body'][_0xe2ca('0x13')]['CustomActionData']=_0x482b27['custom_action_data'];}}logger[_0xe2ca('0x1a')](JSON[_0xe2ca('0x1b')](_0x241511));return rp(_0x241511);});}; \ No newline at end of file +var _0xd624=['custom_action_data','info','request-promise','url','agi','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','custom_action','CustomAction'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xd624,0x124));var _0x4d62=function(_0x4c9fee,_0x4e8704){_0x4c9fee=_0x4c9fee-0x0;var _0x4e15a0=_0xd624[_0x4c9fee];return _0x4e15a0;};'use strict';var rp=require(_0x4d62('0x0'));var url=require(_0x4d62('0x1'));var logger=require('../../../../../config/logger')(_0x4d62('0x2'));module['exports']=function(_0x4e653d,_0x5e3d4c){var _0xa51ea6={'method':_0x4d62('0x3'),'uri':url[_0x4d62('0x4')](_0x5e3d4c[_0x4d62('0x5')],_0x4d62('0x6')),'form':{'grant_type':_0x4d62('0x7'),'username':_0x5e3d4c['username'],'password':_0x5e3d4c['password']},'json':!![]};return rp(_0xa51ea6)[_0x4d62('0x8')](function(_0x3d6f78){var _0x12bf3c={'method':_0x4d62('0x3'),'uri':url[_0x4d62('0x4')](_0x5e3d4c['ndassistant_url'],_0x4d62('0x9')),'body':{'type':_0x5e3d4c[_0x4d62('0xa')]||_0x4d62('0xb'),'channelId':_0x4d62('0xc'),'conversation':{'id':_0x4e653d['uniqueid']},'from':{'id':_0x4e653d[_0x4d62('0xd')],'name':_0x4e653d[_0x4d62('0xe')]},'recipient':{'id':_0x4e653d[_0x4d62('0xf')],'name':_0x4e653d[_0x4d62('0x10')]},'text':_0x5e3d4c[_0x4d62('0x11')],'channelData':{}},'headers':{'Authorization':_0x4d62('0x12')+_0x3d6f78[_0x4d62('0x13')]},'json':!![]};if(_0x5e3d4c[_0x4d62('0x14')]){_0x12bf3c[_0x4d62('0x15')][_0x4d62('0x16')][_0x4d62('0x17')]=_0x5e3d4c[_0x4d62('0x14')];}if(_0x5e3d4c['ndagenerate_audio']=='1'){_0x12bf3c[_0x4d62('0x15')][_0x4d62('0x16')][_0x4d62('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x5e3d4c[_0x4d62('0x19')]){_0x12bf3c[_0x4d62('0x15')][_0x4d62('0x16')][_0x4d62('0x1a')]=_0x5e3d4c[_0x4d62('0x19')];if(_0x5e3d4c[_0x4d62('0x1b')]){_0x12bf3c[_0x4d62('0x15')]['channelData']['CustomActionData']=_0x5e3d4c[_0x4d62('0x1b')];}}logger[_0x4d62('0x1c')](JSON['stringify'](_0x12bf3c));return rp(_0x12bf3c);});}; \ 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 4c53ba3..50c26b5 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x469de9,_0x1b2db7,_0x17f9b0,_0x307542){return asr(_0x469de9,_0x1b2db7,_0x17f9b0,_0x307542);}; \ No newline at end of file +var _0x54a9=['./lib/api'];(function(_0x328418,_0x581310){var _0x4cfb0d=function(_0x42e7a0){while(--_0x42e7a0){_0x328418['push'](_0x328418['shift']());}};_0x4cfb0d(++_0x581310);}(_0x54a9,0x6f));var _0x954a=function(_0x5a0af3,_0x1a75be){_0x5a0af3=_0x5a0af3-0x0;var _0x2721de=_0x54a9[_0x5a0af3];return _0x2721de;};'use strict';var asr=require(_0x954a('0x0'));module['exports']=function(_0x29b958,_0xc034ab,_0x44c4e3,_0x5aa752){return asr(_0x29b958,_0xc034ab,_0x44c4e3,_0x5aa752);}; \ 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 b562284..5178d63 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 _0x4395=['exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','lodash','../../../../../../config/logger','agi'];(function(_0x5cd722,_0x376dd2){var _0x223c4f=function(_0x3b7fc5){while(--_0x3b7fc5){_0x5cd722['push'](_0x5cd722['shift']());}};_0x223c4f(++_0x376dd2);}(_0x4395,0x134));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x5439('0x0'));var _=require(_0x5439('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x5439('0x2'))(_0x5439('0x3'));module[_0x5439('0x4')]=function(_0x5cfe01,_0x55a3aa,_0x5b9018,_0x495794){return new BPromise(function(_0x1b0a48,_0x553ad4){logger[_0x5439('0x5')](_0x5439('0x6'),_0x495794||_0x5439('0x7'));var _0x5561b0=new WebSocket(_0x495794||_0x5439('0x7'),{'perMessageDeflate':![]});var _0x34b086='';var _0x2b833f='0';var _0x52e004='1';var _0x210555=_0x5439('0x8');function _0x15f3fe(_0xe2300f){var _0x1e25b7=crypto[_0x5439('0x9')](_0x5439('0xa'));_0x1e25b7[_0x5439('0xb')](_0xe2300f);return _0x1e25b7[_0x5439('0xc')](_0x5439('0xd'));}function _0x2ed605(){try{logger['info'](_0x5439('0xe'));var _0x1c5977=moment()[_0x5439('0xf')]();var _0x5e39fc=_0x15f3fe(_0x1c5977+_0x55a3aa+_0x5b9018);_0x5561b0[_0x5439('0x10')](JSON['stringify']({'appID':_0x55a3aa,'timestamp':_0x1c5977,'appKey':_0x5e39fc}));var _0x49bb65=fs['createReadStream'](_0x5cfe01);_0x49bb65['on']('data',function(_0x269c64){_0x5561b0[_0x5439('0x10')](_0x269c64);});_0x49bb65['on'](_0x5439('0x11'),function(){_0x5561b0[_0x5439('0x10')](_0x5439('0x12'));});}catch(_0x1ed339){logger[_0x5439('0x13')](_0x5439('0x14'),JSON[_0x5439('0x15')](_0x1ed339));_0x5561b0[_0x5439('0x16')]();}}function _0x12eab4(_0x5f161b){try{if(_0x5f161b){var _0x112f53=JSON[_0x5439('0x17')](_0x5f161b);switch(_0x112f53['status']){case 0x0:if(_0x112f53[_0x5439('0x18')]){if(_0x112f53[_0x5439('0x18')][_0x5439('0x19')]){logger['info'](_0x5439('0x1a'),JSON['stringify'](_0x112f53[_0x5439('0x18')][_0x5439('0x1b')]));_0x34b086=_0x112f53[_0x5439('0x18')][_0x5439('0x1b')][0x0]['transcript'];_0x2b833f=_0x112f53[_0x5439('0x18')][_0x5439('0x1b')][0x0][_0x5439('0x1c')];_0x52e004='0';_0x210555=_0x5439('0x1d');_0x5561b0[_0x5439('0x16')]();}}break;case 0x1:logger[_0x5439('0x5')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x52e004='1';_0x210555=_0x5439('0x8');break;case 0x2:logger['info'](_0x5439('0x1e'));_0x52e004='2';_0x210555=_0x5439('0x1e');break;case 0x9:logger[_0x5439('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x52e004='9';_0x210555='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0x5439('0x5')]('Authentication\x20failed.');_0x52e004='10';_0x210555=_0x5439('0x1f');break;case 0xb:logger['info'](_0x5439('0x20'));_0x52e004='11';_0x210555='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5a3692){logger[_0x5439('0x13')](_0x5439('0x21'),JSON[_0x5439('0x15')](_0x5a3692));_0x5561b0[_0x5439('0x16')]();}}function _0x1edafc(){logger['info'](_0x5439('0x22'));_0x1b0a48({'transcript':_0x34b086,'confidence':_0x2b833f,'status':_0x52e004,'status_message':_0x210555});}function _0x5231b8(_0x282249){logger[_0x5439('0x13')](_0x5439('0x23'));if(!_[_0x5439('0x24')](_0x282249)){logger[_0x5439('0x13')](_[_0x5439('0x25')](_0x282249)?JSON[_0x5439('0x15')](_0x282249):_0x282249);}}_0x5561b0['on']('open',_0x2ed605);_0x5561b0['on'](_0x5439('0x26'),_0x12eab4);_0x5561b0['on']('close',_0x1edafc);_0x5561b0['on'](_0x5439('0x13'),_0x5231b8);});}; \ No newline at end of file +var _0x3372=['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','isObject','open','message','close','lodash','moment','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','status','result','final','hypotheses','transcript'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3372,0x8c));var _0x2337=function(_0xed9c6b,_0x452f10){_0xed9c6b=_0xed9c6b-0x0;var _0x174608=_0x3372[_0xed9c6b];return _0x174608;};'use strict';var BPromise=require('bluebird');var _=require(_0x2337('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2337('0x1'));var crypto=require('crypto');var logger=require(_0x2337('0x2'))('agi');module[_0x2337('0x3')]=function(_0x1117d3,_0x8b0acd,_0x1c16b6,_0x291dd0){return new BPromise(function(_0x569885,_0x503fda){logger[_0x2337('0x4')](_0x2337('0x5'),_0x291dd0||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x416193=new WebSocket(_0x291dd0||_0x2337('0x6'),{'perMessageDeflate':![]});var _0x24d2f7='';var _0x11e420='0';var _0x58e975='1';var _0x269c79=_0x2337('0x7');function _0x20b373(_0x42b0d5){var _0x130f95=crypto['createHash'](_0x2337('0x8'));_0x130f95[_0x2337('0x9')](_0x42b0d5);return _0x130f95[_0x2337('0xa')](_0x2337('0xb'));}function _0x96d06a(){try{logger[_0x2337('0x4')](_0x2337('0xc'));var _0xca0bc0=moment()[_0x2337('0xd')]();var _0x3491d7=_0x20b373(_0xca0bc0+_0x8b0acd+_0x1c16b6);_0x416193[_0x2337('0xe')](JSON['stringify']({'appID':_0x8b0acd,'timestamp':_0xca0bc0,'appKey':_0x3491d7}));var _0xcebde=fs[_0x2337('0xf')](_0x1117d3);_0xcebde['on'](_0x2337('0x10'),function(_0x1de768){_0x416193[_0x2337('0xe')](_0x1de768);});_0xcebde['on']('close',function(){_0x416193[_0x2337('0xe')](_0x2337('0x11'));});}catch(_0x2fa2d3){logger[_0x2337('0x12')](_0x2337('0x13'),JSON[_0x2337('0x14')](_0x2fa2d3));_0x416193[_0x2337('0x15')]();}}function _0x22dcbd(_0x2f8678){try{if(_0x2f8678){var _0x140dfb=JSON[_0x2337('0x16')](_0x2f8678);switch(_0x140dfb[_0x2337('0x17')]){case 0x0:if(_0x140dfb[_0x2337('0x18')]){if(_0x140dfb[_0x2337('0x18')][_0x2337('0x19')]){logger[_0x2337('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0x2337('0x14')](_0x140dfb[_0x2337('0x18')][_0x2337('0x1a')]));_0x24d2f7=_0x140dfb[_0x2337('0x18')][_0x2337('0x1a')][0x0][_0x2337('0x1b')];_0x11e420=_0x140dfb[_0x2337('0x18')][_0x2337('0x1a')][0x0][_0x2337('0x1c')];_0x58e975='0';_0x269c79=_0x2337('0x1d');_0x416193[_0x2337('0x15')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x58e975='1';_0x269c79=_0x2337('0x7');break;case 0x2:logger['info'](_0x2337('0x1e'));_0x58e975='2';_0x269c79=_0x2337('0x1e');break;case 0x9:logger['info'](_0x2337('0x1f'));_0x58e975='9';_0x269c79=_0x2337('0x1f');break;case 0xa:logger[_0x2337('0x4')](_0x2337('0x20'));_0x58e975='10';_0x269c79=_0x2337('0x20');break;case 0xb:logger['info'](_0x2337('0x21'));_0x58e975='11';_0x269c79='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x3b67d7){logger[_0x2337('0x12')](_0x2337('0x22'),JSON[_0x2337('0x14')](_0x3b67d7));_0x416193[_0x2337('0x15')]();}}function _0x4a501d(){logger[_0x2337('0x4')](_0x2337('0x23'));_0x569885({'transcript':_0x24d2f7,'confidence':_0x11e420,'status':_0x58e975,'status_message':_0x269c79});}function _0x3ceaaa(_0x5f141b){logger[_0x2337('0x12')](_0x2337('0x24'));if(!_[_0x2337('0x25')](_0x5f141b)){logger[_0x2337('0x12')](_[_0x2337('0x26')](_0x5f141b)?JSON[_0x2337('0x14')](_0x5f141b):_0x5f141b);}}_0x416193['on'](_0x2337('0x27'),_0x96d06a);_0x416193['on'](_0x2337('0x28'),_0x22dcbd);_0x416193['on'](_0x2337('0x29'),_0x4a501d);_0x416193['on'](_0x2337('0x12'),_0x3ceaaa);});}; \ 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 6c14415..54652bf 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 _0x7640=['exports','./asr'];(function(_0x12c97b,_0x19eea9){var _0x221c36=function(_0x330c28){while(--_0x330c28){_0x12c97b['push'](_0x12c97b['shift']());}};_0x221c36(++_0x19eea9);}(_0x7640,0x1cb));var _0x0764=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x7640[_0x5ddaac];return _0x2a9c58;};var asr=require(_0x0764('0x0'));module[_0x0764('0x1')]={'asr':asr}; \ No newline at end of file +var _0xf244=['exports'];(function(_0x7598b8,_0x19f0b8){var _0x4fbaab=function(_0x31dc98){while(--_0x31dc98){_0x7598b8['push'](_0x7598b8['shift']());}};_0x4fbaab(++_0x19f0b8);}(_0xf244,0x15c));var _0x4f24=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf244[_0x1cc8fe];return _0x230054;};var asr=require('./asr');module[_0x4f24('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 95aa44c..e0f9f60 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(_0x425d5e,_0x3b9040){var _0x3cc67b=function(_0x121446){while(--_0x121446){_0x425d5e['push'](_0x425d5e['shift']());}};_0x3cc67b(++_0x3b9040);}(_0xe706,0xa3));var _0x6e70=function(_0xf7aa86,_0x171456){_0xf7aa86=_0xf7aa86-0x0;var _0x5eb1ed=_0xe706[_0xf7aa86];return _0x5eb1ed;};'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 _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index a76b4d2..a65843f 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 _0x7da7=['grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','getVariable','no\x20variable\x20found','forEach','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','ndassistant_url','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','out','amazonlex','Amazon\x20Lex\x20Result\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','gotoiftime','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','getPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','template_id','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','lodash','shelljs','moment','mustache','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareOdbc','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','channel','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','POST','PUT','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','replaceAllVariables','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','recursiveNodeIndex','stringify','split','replaceAll','getAndSetVariable','extra','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','no\x20text\x20configured','MRCPSynth','result','noop','mrcprecog'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x7da7,0x10d));var _0x77da=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0x7da7[_0x5c468f];return _0x2136b0;};'use strict';var fs=require('fs');var util=require(_0x77da('0x0'));var _=require(_0x77da('0x1'));var sh=require(_0x77da('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0x77da('0x3'));var Mustache=require(_0x77da('0x4'));var rp=require('request-promise');var logger=require(_0x77da('0x5'))(_0x77da('0x6'));var config=require('../../config/environment');var scripts=require(_0x77da('0x7'));var FILES_PATH=_0x77da('0x8');var recursiveMapAttributes=['rawHeaders',_0x77da('0x9')];var verticesWithRetry=['menu',_0x77da('0xa'),_0x77da('0xb')];var AGIVertices=function(_0x37c5ab,_0x910e5b,_0x252128){this['channel']=_0x37c5ab;this[_0x77da('0xc')]=_0x910e5b;this[_0x77da('0xd')]=_0x252128;};AGIVertices[_0x77da('0xe')]['getVariable']=function(_0x35d06e,_0x1ab717){this[_0x77da('0xc')][_0x77da('0xf')](_0x35d06e)['then'](function(_0x93f149){_0x1ab717(null,_0x93f149?_0x93f149[_0x77da('0x10')]:![]);})[_0x77da('0x11')](function(_0x5d6e2f){_0x1ab717(_0x5d6e2f);});};AGIVertices['prototype'][_0x77da('0x12')]=function(_0x4263d9,_0x589aa1){this[_0x77da('0xc')][_0x77da('0x13')](_0x4263d9)[_0x77da('0x14')](function(_0x3c87c2){_0x589aa1(null,_0x3c87c2?_0x3c87c2['name']:![]);})[_0x77da('0x11')](function(_0x4e130c){_0x589aa1(_0x4e130c);});};AGIVertices[_0x77da('0xe')][_0x77da('0x15')]=function(_0x1b0e17,_0x4500c4){this['rpc']['getSquareProjectById'](_0x1b0e17)['then'](function(_0x482b87){_0x4500c4(null,_0x482b87?_0x482b87[_0x77da('0x10')]:![]);})[_0x77da('0x11')](function(_0x289887){_0x4500c4(_0x289887);});};AGIVertices[_0x77da('0xe')][_0x77da('0x16')]=function(_0x12d2b1,_0x1d325c){this[_0x77da('0xc')]['getSquareOdbcById'](_0x12d2b1)['then'](function(_0xd5a809){_0x1d325c(null,_0xd5a809?_0xd5a809[_0x77da('0x17')]:![]);})['catch'](function(_0x45a122){_0x1d325c(_0x45a122);});};AGIVertices[_0x77da('0xe')][_0x77da('0x18')]=function(_0x5ab79a,_0x58270c){this[_0x77da('0xc')]['getUserById'](_0x5ab79a)[_0x77da('0x14')](function(_0x1c27aa){_0x58270c(null,_0x1c27aa?_0x1c27aa[_0x77da('0x10')]:![]);})[_0x77da('0x11')](function(_0x10399a){_0x58270c(_0x10399a);});};AGIVertices[_0x77da('0xe')][_0x77da('0x19')]=function(_0x50799d,_0x4885ec){this[_0x77da('0xc')][_0x77da('0x1a')](_0x50799d)[_0x77da('0x14')](function(_0xbd06b7){_0x4885ec(null,_0xbd06b7?_0xbd06b7['name']:![]);})[_0x77da('0x11')](function(_0x167240){_0x4885ec(_0x167240);});};AGIVertices[_0x77da('0xe')][_0x77da('0x1b')]=function(_0x446ae7,_0x5997b6){var _0xce24b8=this;this[_0x77da('0xc')][_0x77da('0x1c')](_0x446ae7)[_0x77da('0x14')](function(_0x496ecd){_0x5997b6(null,_0x496ecd?_0xce24b8['getSoundPath'](_0x496ecd['save_name']):![]);})[_0x77da('0x11')](function(_0x30456a){_0x5997b6(_0x30456a);});};AGIVertices[_0x77da('0xe')][_0x77da('0x1d')]=function(_0x34228f,_0x4eeb99){this[_0x77da('0xc')][_0x77da('0x1e')](_0x34228f)[_0x77da('0x14')](function(_0x1d381b){_0x4eeb99(null,_0x1d381b?_0x1d381b:![]);})[_0x77da('0x11')](function(_0x46e6b4){_0x4eeb99(_0x46e6b4);});};AGIVertices['prototype'][_0x77da('0x1f')]=function(_0x228851,_0x1e1fae,_0x38643a){this[_0x77da('0xd')][_0x77da('0x1f')](_0x228851,_0x1e1fae)[_0x77da('0x14')](function(){_0x38643a(null);})[_0x77da('0x11')](function(_0x5b9b05){_0x38643a(_0x5b9b05);});};AGIVertices['prototype'][_0x77da('0x20')]=function(_0x8e6181,_0x49cd8f){this[_0x77da('0xc')][_0x77da('0x21')](_0x8e6181)[_0x77da('0x14')](function(_0x10540a){if(_0x10540a){if(_0x10540a[_0x77da('0x22')]){_0x49cd8f(null,[_0x10540a[_0x77da('0x23')]]);}else{_0x49cd8f(null,_[_0x77da('0x24')](_0x10540a['Intervals'],_0x77da('0x23')));}}else{_0x49cd8f(null,![]);}})['catch'](function(_0x54b7f2){_0x49cd8f(_0x54b7f2);});};AGIVertices['prototype'][_0x77da('0x25')]=function(_0x53543a){return util[_0x77da('0x26')](_0x77da('0x27'),FILES_PATH,_0x53543a);};AGIVertices[_0x77da('0xe')][_0x77da('0x28')]=function(_0x3c46d2,_0x3f0593,_0x43c20a){odbc['open'](_0x3c46d2,function(_0x297d49){if(_0x297d49){logger[_0x77da('0x29')](_0x77da('0x2a'),_0x297d49);_0x43c20a(_0x297d49);}else{logger[_0x77da('0x2b')](_0x77da('0x2c'));odbc[_0x77da('0x2d')](_0x3f0593,function(_0x48fccc,_0x1e02bd){if(_0x48fccc){logger[_0x77da('0x2b')](_0x77da('0x2e'),_0x3f0593);_0x43c20a(_0x48fccc);}else{logger['info'](_0x77da('0x2f'),_0x3f0593);odbc['close'](function(_0x4e1e31){if(_0x4e1e31){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4e1e31);}_0x43c20a(null,_0x1e02bd);});}});}});};AGIVertices[_0x77da('0xe')][_0x77da('0x30')]=function(_0xebdea1,_0x4e4351){this[_0x77da('0xc')]['getSmsAccountById'](_0xebdea1)[_0x77da('0x14')](function(_0x517bd0){_0x4e4351(null,_0x517bd0?_0x517bd0:![]);})[_0x77da('0x11')](function(_0xa19b50){_0x4e4351(_0xa19b50);});};AGIVertices[_0x77da('0xe')][_0x77da('0x31')]=function(_0x240bee,_0x5ecf12){this[_0x77da('0xc')][_0x77da('0x31')](_0x240bee)[_0x77da('0x14')](function(_0x2f14f4){_0x5ecf12(null,_0x2f14f4);})[_0x77da('0x11')](function(_0x390064){_0x5ecf12(_0x390064);});};AGIVertices['prototype'][_0x77da('0x32')]=function(_0x2f0495,_0x21de41,_0x2dfeca){this[_0x77da('0xc')][_0x77da('0x32')]({'uniqueid':this['channel'][_0x77da('0x33')],'node':_0x2f0495['label'],'application':_0x2f0495[_0x77da('0x34')],'data':_0x21de41||null,'project_name':this[_0x77da('0x35')][_0x77da('0x36')],'callerid':this['channel'][_0x77da('0x37')]})[_0x77da('0x14')](function(_0x35a2b9){if(_0x2dfeca){_0x2dfeca(null,_0x35a2b9);}})[_0x77da('0x11')](function(_0x19ed1b){if(_0x2dfeca){_0x2dfeca(_0x19ed1b);}});};AGIVertices[_0x77da('0xe')][_0x77da('0x38')]=function(_0xfdac7a,_0x1bb77c,_0x5964da,_0x4268c7){this[_0x77da('0xc')][_0x77da('0x38')]({'uniqueid':this[_0x77da('0x35')][_0x77da('0x33')],'callerid':this[_0x77da('0x35')]['callerid'],'calleridname':this['channel'][_0x77da('0x39')],'context':this[_0x77da('0x35')][_0x77da('0x3a')],'extension':this[_0x77da('0x35')][_0x77da('0x3b')],'priority':this[_0x77da('0x35')]['priority'],'accountcode':this[_0x77da('0x35')][_0x77da('0x3c')],'dnid':this[_0x77da('0x35')][_0x77da('0x3d')],'projectName':this['channel'][_0x77da('0x36')],'saveName':_0x1bb77c,'filename':_0xfdac7a['file']||_0x1bb77c,'savePath':_0x5964da})['then'](function(_0x36263b){_0x4268c7(null,_0x36263b);})[_0x77da('0x11')](function(_0x143a68){_0x4268c7(_0x143a68);});};AGIVertices[_0x77da('0xe')]['createSquareMessage']=function(_0x16bf4b,_0x1e36ee,_0x56a3d9,_0x731995,_0x3c2d89){this['rpc'][_0x77da('0x3e')]({'uniqueid':this[_0x77da('0x35')][_0x77da('0x33')],'body':_0x16bf4b,'direction':_0x1e36ee,'providerName':_0x56a3d9,'providerResponse':_0x731995})[_0x77da('0x14')](function(_0xfc13ed){if(_0x3c2d89){_0x3c2d89(null,_0xfc13ed);}})[_0x77da('0x11')](function(_0x2b96c1){if(_0x3c2d89){_0x3c2d89(_0x2b96c1);}});};AGIVertices[_0x77da('0xe')][_0x77da('0x3f')]=function(_0x3a34a8,_0x52aa0a){this[_0x77da('0xc')]['createCmContact']({'firstName':_[_0x77da('0x40')](_0x3a34a8[_0x77da('0x10')])||_[_0x77da('0x41')](_0x3a34a8[_0x77da('0x10')])?_0x77da('0x42')+Math[_0x77da('0x43')]():_0x3a34a8[_0x77da('0x10')],'lastName':_['isEmpty'](_0x3a34a8[_0x77da('0x44')])||_[_0x77da('0x41')](_0x3a34a8[_0x77da('0x44')])?null:_0x3a34a8[_0x77da('0x44')],'phone':_0x3a34a8['phone'],'ListId':_0x3a34a8[_0x77da('0x45')],'scheduledat':_0x3a34a8[_0x77da('0x46')],'callbackUniqueid':this[_0x77da('0x35')]['uniqueid'],'tags':'callback','description':_0x77da('0x47')+_0x3a34a8[_0x77da('0x46')][_0x77da('0x48')](),'priority':_0x3a34a8[_0x77da('0x49')]})[_0x77da('0x14')](function(_0x528a32){_0x52aa0a(null,_0x528a32);})['catch'](function(_0x365e91){_0x52aa0a(_0x365e91);});};AGIVertices[_0x77da('0xe')]['getPause']=function(_0xf385e8,_0x45fafd){this[_0x77da('0xc')]['getPauseById'](_0xf385e8)[_0x77da('0x14')](function(_0x111260){_0x45fafd(null,_0x111260?_0x111260['name']:![]);})[_0x77da('0x11')](function(_0x27aa8c){_0x45fafd(_0x27aa8c);});};AGIVertices[_0x77da('0xe')][_0x77da('0x4a')]=function(_0x20cce1,_0x99ac27,_0x1dc4ab){var _0x1719f5={'role':_0x77da('0x4b')};_0x1719f5[_0x20cce1]=this['channel'][_0x77da('0x37')];this[_0x77da('0xc')][_0x77da('0x4a')](_0x1719f5,_0x99ac27,this[_0x77da('0x35')][_0x77da('0x33')])[_0x77da('0x14')](function(_0x4f3d4f){_0x1dc4ab(null,_[_0x77da('0x41')](_0x4f3d4f)?![]:!![]);})[_0x77da('0x11')](function(_0x20fa62){logger['error'](_0x20fa62);_0x1dc4ab(null,![]);});};AGIVertices[_0x77da('0xe')][_0x77da('0x4c')]=function(_0x1991a1,_0x8592c7){var _0x354e51={'role':_0x77da('0x4b')};_0x354e51[_0x1991a1]=this[_0x77da('0x35')]['callerid'];this[_0x77da('0xc')]['agentUnpause'](_0x354e51)[_0x77da('0x14')](function(_0x1922ab){_0x8592c7(null,_[_0x77da('0x41')](_0x1922ab)?![]:!![]);})['catch'](function(_0x30c746){logger[_0x77da('0x29')](_0x30c746);_0x8592c7(null,![]);});};AGIVertices[_0x77da('0xe')][_0x77da('0x4d')]=function(_0x48f639,_0x50a9db){var _0x571b1b={'role':_0x77da('0x4b')};_0x571b1b[_0x48f639]=this[_0x77da('0x35')][_0x77da('0x37')];this[_0x77da('0xc')][_0x77da('0x4d')](_0x571b1b)[_0x77da('0x14')](function(_0x2c30f5){_0x50a9db(null,_[_0x77da('0x41')](_0x2c30f5)?![]:!![]);})[_0x77da('0x11')](function(_0x14e067){logger['error'](_0x14e067);_0x50a9db(null,![]);});};AGIVertices[_0x77da('0xe')][_0x77da('0x4e')]=function(_0x49abfa,_0x52ebdf){var _0x35b129={'role':'agent'};_0x35b129[_0x49abfa]=this[_0x77da('0x35')][_0x77da('0x37')];var _0x1ff554=_0x49abfa!='internal'?util[_0x77da('0x26')](_0x77da('0x4f'),_0x77da('0x50'),this[_0x77da('0x35')][_0x77da('0x37')]):undefined;this['rpc'][_0x77da('0x4e')](_0x35b129,_0x1ff554)[_0x77da('0x14')](function(_0x5f0938){_0x52ebdf(null,_[_0x77da('0x41')](_0x5f0938)?![]:!![]);})[_0x77da('0x11')](function(_0xd14296){logger[_0x77da('0x29')](_0xd14296);_0x52ebdf(null,![]);});};AGIVertices[_0x77da('0xe')][_0x77da('0x51')]=function(_0x13fbfc,_0x4b7260){sh[_0x77da('0x52')](_['trim'](_0x13fbfc),function(_0x2f8080,_0xca2fbc){var _0x470ac0=_0xca2fbc[_0x77da('0x53')](/(\r\n|\n|\r)/gm,'');_0x4b7260(null,_0x470ac0);});};AGIVertices[_0x77da('0xe')][_0x77da('0x54')]=function(_0xf75c3c,_0x103e1b){scripts[_0x77da('0x54')](_0xf75c3c[_0x77da('0x55')],_0xf75c3c[_0x77da('0x56')]||_0x77da('0x57'),_0xf75c3c['text'],_0xf75c3c[_0x77da('0x58')]||_0x77da('0x59'),_0xf75c3c[_0x77da('0x5a')]||_0x77da('0x5b'),_0xf75c3c['audioEncoding']||_0x77da('0x5c'))[_0x77da('0x14')](function(_0x16c7b7){_0x103e1b(null,_0x16c7b7);})['catch'](function(_0x132d14){_0x103e1b(_0x132d14);});};AGIVertices['prototype']['googleTTS']=function(_0x2a4f85,_0x4015f0){scripts[_0x77da('0x5d')](_0x2a4f85[_0x77da('0x57')],_0x2a4f85[_0x77da('0x5e')]||'en',0x1)[_0x77da('0x14')](function(_0x14dec8){_0x4015f0(null,_0x14dec8);})[_0x77da('0x11')](function(_0x470840){_0x4015f0(_0x470840);});};AGIVertices['prototype'][_0x77da('0x5f')]=function(_0xfcf09c,_0x2d3ab4){var _0x1206c7={'uri':_0xfcf09c[_0x77da('0x60')],'method':_0xfcf09c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xfcf09c[_0x77da('0x61')])===_0x77da('0x62')&&parseInt(_0xfcf09c[_0x77da('0x61')])>=0x1?parseInt(_0xfcf09c[_0x77da('0x61')])*0x3e8:0x5*0x3e8};if(_[_0x77da('0x63')]([_0x77da('0x64'),_0x77da('0x65')],_0x1206c7[_0x77da('0x66')][_0x77da('0x67')]())){try{_0x1206c7[_0x77da('0x68')]=_0xfcf09c['rawBody']?JSON['parse'](_0xfcf09c['rawBody']):{};}catch(_0x358dd5){logger[_0x77da('0x29')](_0x77da('0x69'),_0x358dd5);}}try{_0x1206c7['headers']=_0xfcf09c['rawHeaders']?JSON[_0x77da('0x6a')](_0xfcf09c[_0x77da('0x6b')]):{};}catch(_0x17a2e6){logger[_0x77da('0x29')](_0x77da('0x6c'),_0x17a2e6);}if(_0xfcf09c[_0x77da('0x6d')]){try{var _0x3fca4b=require(_0xfcf09c[_0x77da('0x6d')])[_0x77da('0x6e')](this,_0x1206c7);_0x1206c7[_0x77da('0x6f')]=Mustache[_0x77da('0x70')](_0xfcf09c[_0x77da('0x60')],_0x3fca4b,{},['$$','$$']);if(_0x1206c7[_0x77da('0x71')]){_0x1206c7['headers']=JSON['parse'](Mustache[_0x77da('0x70')](JSON['stringify'](_0x1206c7['headers']),_0x3fca4b,{},['$$','$$']));}if(_0x1206c7[_0x77da('0x68')]){_0x1206c7[_0x77da('0x68')]=JSON[_0x77da('0x6a')](Mustache['render'](JSON['stringify'](_0x1206c7[_0x77da('0x68')]),_0x3fca4b,{},['$$','$$']));}}catch(_0x4f1ae0){logger[_0x77da('0x29')](_0x77da('0x72'),_0x4f1ae0);}}rp(_0x1206c7)['then'](function(_0x31834a){var _0x505520={'statusCode':_0x31834a[_0x77da('0x73')]||0xc8,'statusMessage':_0x31834a[_0x77da('0x74')]||'OK','headers':_0x31834a[_0x77da('0x71')]||{},'body':_0x31834a[_0x77da('0x68')]||{}};_0x2d3ab4(null,_0x505520);})['catch'](function(_0x429eb7){var _0x394078={'statusCode':_0x429eb7[_0x77da('0x73')]||0x1f4,'statusMessage':_0x429eb7[_0x77da('0x75')]||_0x77da('0x76'),'headers':_0x429eb7[_0x77da('0x77')][_0x77da('0x71')]||{},'body':_0x429eb7['options']['body']||{}};_0x2d3ab4(null,_0x394078);});};AGIVertices[_0x77da('0xe')][_0x77da('0x78')]=function(_0x3c96b9,_0x55ee92){scripts['googleDialogflow'](this['channel']['uniqueid'],_0x3c96b9[_0x77da('0x79')],_0x3c96b9[_0x77da('0x57')],_0x3c96b9[_0x77da('0x7a')]||'en')['then'](function(_0x1636d6){_0x55ee92(null,_0x1636d6);})['catch'](function(_0x39de26){_0x55ee92(_0x39de26);});};AGIVertices['prototype'][_0x77da('0x7b')]=function(_0x5bbf75,_0x2577fb){scripts[_0x77da('0x7b')](this['channel'][_0x77da('0x33')],_0x5bbf75[_0x77da('0x7c')],_0x5bbf75[_0x77da('0x7d')],_0x5bbf75[_0x77da('0x7e')],_0x5bbf75[_0x77da('0x57')],_0x5bbf75[_0x77da('0x7f')]||'en')[_0x77da('0x14')](function(_0x324872){_0x2577fb(null,_0x324872);})[_0x77da('0x11')](function(_0x485e38){_0x2577fb(_0x485e38);});};AGIVertices['prototype']['sestekNDA']=function(_0x242f8f,_0x330db7){scripts[_0x77da('0x80')](this['channel'],_0x242f8f)[_0x77da('0x14')](function(_0x52638b){_0x330db7(null,_0x52638b);})['catch'](function(_0x3474c2){_0x330db7(_0x3474c2);});};AGIVertices[_0x77da('0xe')]['ispeechTTS']=function(_0x47d98a,_0x3c0cde){scripts[_0x77da('0x81')](_0x47d98a[_0x77da('0x79')],_0x47d98a['text'],_0x47d98a[_0x77da('0x82')]||'en-US',_0x47d98a[_0x77da('0x83')])[_0x77da('0x14')](function(_0x112907){_0x3c0cde(null,_0x112907);})[_0x77da('0x11')](function(_0x196ea2){_0x3c0cde(_0x196ea2);});};AGIVertices[_0x77da('0xe')]['ispeechASR']=function(_0x304029,_0x2410ae,_0x37c59e){scripts[_0x77da('0x84')](_0x2410ae,_0x304029['key'],_0x304029[_0x77da('0x85')]||'en-US',this[_0x77da('0x86')](_0x304029[_0x77da('0x87')])?_0x304029[_0x77da('0x87')]:undefined)[_0x77da('0x14')](function(_0x2c4032){_0x37c59e(null,_0x2c4032);})[_0x77da('0x11')](function(_0xdbbc0){_0x37c59e(_0xdbbc0);});};AGIVertices[_0x77da('0xe')]['awsPolly']=function(_0xcf63e6,_0x3132f0){scripts[_0x77da('0x88')](_0xcf63e6[_0x77da('0x89')],_0xcf63e6[_0x77da('0x8a')],_0xcf63e6[_0x77da('0x8b')],_0xcf63e6[_0x77da('0x8c')]||_0x77da('0x8d'),_0xcf63e6['text'],_0xcf63e6['aws_text_type']||_0x77da('0x57'))[_0x77da('0x14')](function(_0x2f164c){_0x3132f0(null,_0x2f164c);})['catch'](function(_0x30f6a1){_0x3132f0(_0x30f6a1);});};AGIVertices['prototype'][_0x77da('0x8e')]=function(_0x36a846,_0x2214c7){scripts['awsLex'](this['channel'][_0x77da('0x33')],_0x36a846['aws_access_key_id'],_0x36a846['aws_secret_access_key'],_0x36a846[_0x77da('0x8f')],_0x36a846[_0x77da('0x57')],_0x36a846[_0x77da('0x90')])[_0x77da('0x14')](function(_0x59ae3f){_0x2214c7(null,_0x59ae3f);})[_0x77da('0x11')](function(_0x4c5c42){_0x2214c7(_0x4c5c42);});};AGIVertices['prototype']['googleASR']=function(_0x23a94e,_0x3a4050,_0x31a552){scripts[_0x77da('0x91')](_0x3a4050,_0x23a94e[_0x77da('0x79')],_0x23a94e[_0x77da('0x92')]||_0x77da('0x59'))[_0x77da('0x14')](function(_0x5db30f){_0x31a552(null,_0x5db30f);})[_0x77da('0x11')](function(_0x461d88){_0x31a552(_0x461d88);});};AGIVertices['prototype'][_0x77da('0x93')]=function(_0x5177ba,_0x3b6c44,_0x2c1d7c){scripts[_0x77da('0x93')](_0x3b6c44,_0x5177ba[_0x77da('0x94')],_0x5177ba[_0x77da('0x95')],_0x5177ba['uri'])[_0x77da('0x14')](function(_0x244f06){_0x2c1d7c(null,_0x244f06);})['catch'](function(_0x22ff04){_0x2c1d7c(_0x22ff04);});};AGIVertices['prototype']['clear']=function(_0x2ef41b){var _0x502581=_['includes'](verticesWithRetry,_0x2ef41b[_0x77da('0x34')])?_0x2ef41b:_[_0x77da('0x96')](_0x2ef41b);for(var _0x16a55b in _0x502581){if(_0x502581[_0x77da('0x97')](_0x16a55b)){if(_0x502581[_0x16a55b]&&_['isString'](_0x502581[_0x16a55b])){if(_[_0x77da('0x63')](recursiveMapAttributes,_0x16a55b)){_0x502581[_0x16a55b]=this['replaceObjectAllVariables'](_0x502581[_0x16a55b]);}else{_0x502581[_0x16a55b]=this[_0x77da('0x98')](_0x502581[_0x16a55b]);}}}}return _0x502581;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x32c08b){for(var _0x515bd8 in _0x32c08b){if(_0x32c08b[_0x77da('0x97')](_0x515bd8)){if(_[_0x77da('0x99')](_0x32c08b[_0x515bd8])){this['recursiveNodeIndex'](_0x32c08b[_0x515bd8]);}else if(_[_0x77da('0x9a')](_0x32c08b[_0x515bd8])){for(var _0x3ad0b0=0x0;_0x3ad0b0<_0x32c08b[_0x515bd8][_0x77da('0x9b')];_0x3ad0b0++){this['recursiveNodeIndex'](_0x32c08b[_0x515bd8][_0x3ad0b0]);}}else if(_[_0x77da('0x9c')](_0x32c08b[_0x515bd8])){_0x32c08b[_0x515bd8]=this[_0x77da('0x98')](_0x32c08b[_0x515bd8]);}}}};AGIVertices[_0x77da('0xe')][_0x77da('0x9d')]=function(_0x5d1957,_0x38b861){for(var _0x5c1e1b in _0x5d1957){if(_0x5d1957[_0x77da('0x97')](_0x5c1e1b)){if(_[_0x77da('0x99')](_0x5d1957[_0x5c1e1b])){if(!_[_0x77da('0x40')](_0x5d1957[_0x5c1e1b])){this[_0x77da('0x9d')](_0x5d1957[_0x5c1e1b],util[_0x77da('0x26')](_0x77da('0x9e'),_0x38b861,_0x5c1e1b));}}else if(_[_0x77da('0x9a')](_0x5d1957[_0x5c1e1b])){for(var _0x2f2d44=0x0;_0x2f2d44<_0x5d1957[_0x5c1e1b][_0x77da('0x9b')];_0x2f2d44++){this[_0x77da('0x9d')](_0x5d1957[_0x5c1e1b][_0x2f2d44],util[_0x77da('0x26')](_0x77da('0x9e'),_0x38b861,_0x5c1e1b+'['+_0x2f2d44+']'));}}else{if(!_[_0x77da('0x41')](_0x5d1957[_0x5c1e1b])){this['channel'][_0x77da('0x9f')](util['format']('%s.%s',_0x38b861,_0x5c1e1b),_0x5d1957[_0x5c1e1b]);}}}}};AGIVertices[_0x77da('0xe')]['replaceObjectAllVariables']=function(_0x36b5b9){try{var _0x25663c=JSON['parse'](_0x36b5b9);this[_0x77da('0xa0')](_0x25663c);return JSON[_0x77da('0xa1')](_0x25663c);}catch(_0x281cf4){return this[_0x77da('0x98')](_0x36b5b9);}};AGIVertices[_0x77da('0xe')][_0x77da('0x98')]=function(_0xf31a48){var _0x36a6b5=_0xf31a48[_0x77da('0xa2')]('{');for(var _0x2e7460=0x1;_0x2e7460<_0x36a6b5[_0x77da('0x9b')];_0x2e7460+=0x1){var _0x2267c4=_0x36a6b5[_0x2e7460][_0x77da('0xa2')]('}');if(_0x2267c4['length']>0x1){_0xf31a48=_0xf31a48[_0x77da('0xa3')]('{'+_0x2267c4[0x0]+'}',this[_0x77da('0x35')]['getVariable'](_0x2267c4[0x0])['extra']||_0x2267c4[0x0]);}}if(_0x36a6b5[_0x77da('0x9b')]===0x1){return _0xf31a48['toString']();}return this[_0x77da('0x98')](_0xf31a48);};AGIVertices['prototype'][_0x77da('0xa4')]=function(_0x5a4dcd,_0x31a578){var _0x2e887c=this[_0x77da('0x35')]['getVariable'](_0x5a4dcd);if(_0x2e887c['result']===-0x1){return _0x2e887c;}logger[_0x77da('0x2b')](util[_0x77da('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x31a578,_0x2e887c[_0x77da('0xa5')]));return this[_0x77da('0x35')][_0x77da('0x9f')](_0x31a578,_0x2e887c[_0x77da('0xa5')]);};AGIVertices[_0x77da('0xe')][_0x77da('0x86')]=function(_0x1e9dc2){return _0x1e9dc2&&_0x1e9dc2!=='0'&&_0x1e9dc2!=='-1'&&_0x1e9dc2!=='';};AGIVertices[_0x77da('0xe')][_0x77da('0xa6')]=function(_0x442460){this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x442460,'-');_0x442460[_0x77da('0xa7')]=_0x442460['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x77da('0xe')]['mrcpsynth']=function(_0x4bb83a){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xa8'),_0x4bb83a[_0x77da('0xa9')]));if(!this['isConfigured'](_0x4bb83a[_0x77da('0x57')])){return this[_0x77da('0x35')]['noop'](_0x77da('0xaa'));}var _0x29ddde='\x22'+_0x4bb83a[_0x77da('0x57')]+'\x22';if(this[_0x77da('0x86')](_0x4bb83a[_0x77da('0x77')])){_0x29ddde+=','+_0x4bb83a[_0x77da('0x77')];}var _0x56c44a=this[_0x77da('0x35')]['exec'](_0x77da('0xab'),_0x29ddde);if(_0x56c44a[_0x77da('0xac')]===-0x1){return _0x56c44a;}return this['channel'][_0x77da('0xad')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x29ddde));};AGIVertices[_0x77da('0xe')][_0x77da('0xae')]=function(_0x15e7bd){logger['info'](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x15e7bd[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x15e7bd[_0x77da('0xaf')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xb0'));}var _0x380427=_0x15e7bd['grammar'];if(this['isConfigured'](_0x15e7bd[_0x77da('0x77')])){_0x380427+=','+_0x15e7bd[_0x77da('0x77')];}var _0x2bcd26=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0xb1'),_0x380427);if(_0x2bcd26['result']===-0x1){return _0x2bcd26;}var _0x39733f=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x77da('0xb2'));if(_0x39733f[_0x77da('0xac')]===-0x1){return _0x39733f;}var _0x264984=this[_0x77da('0xa4')](_0x77da('0xb3'),_0x77da('0xb4'));if(_0x264984[_0x77da('0xac')]===-0x1){return _0x264984;}var _0x5d4a6e=this[_0x77da('0xa4')](_0x77da('0xb5'),_0x77da('0xb6'));if(_0x5d4a6e[_0x77da('0xac')]===-0x1){return _0x5d4a6e;}return this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0xb7'),_0x380427));};AGIVertices[_0x77da('0xe')][_0x77da('0x6')]=function(_0x4bbfa1){logger['info'](util[_0x77da('0x26')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4bbfa1['label']));return this[_0x77da('0x35')][_0x77da('0x6')]([_0x4bbfa1[_0x77da('0xb8')],_0x4bbfa1['args']]);};AGIVertices['prototype'][_0x77da('0xb9')]=function(_0x4cc0df){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4cc0df['label']));if(this['isConfigured'](_0x4cc0df[_0x77da('0x61')])){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xba'),_0x4cc0df[_0x77da('0x61')]));var _0x4e9d5d=this[_0x77da('0x35')][_0x77da('0xbb')](_0x4cc0df['timeout']);if(_0x4e9d5d['result']===-0x1){return _0x4e9d5d;}}return this[_0x77da('0x35')][_0x77da('0xb9')]();};AGIVertices[_0x77da('0xe')]['callback']=function(_0x20b1fa){logger['info'](util[_0x77da('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x20b1fa['label']));if(!this[_0x77da('0x86')](_0x20b1fa[_0x77da('0x45')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x20b1fa,_0x77da('0xbc'));}_0x20b1fa[_0x77da('0x46')]=moment();if(this[_0x77da('0x86')](_0x20b1fa['delay'])){_0x20b1fa[_0x77da('0x46')]=moment()[_0x77da('0xbd')](_0x20b1fa[_0x77da('0xbe')],'minutes');}if(!this[_0x77da('0x86')](_0x20b1fa[_0x77da('0x49')])){_0x20b1fa[_0x77da('0x49')]=0x2;}this[_0x77da('0x3f')][_0x77da('0x6e')](this,_0x20b1fa);return this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xbf'),_0x20b1fa[_0x77da('0xc0')],_0x20b1fa[_0x77da('0x45')],_0x20b1fa['scheduledAt']));};AGIVertices[_0x77da('0xe')][_0x77da('0xc1')]=function(_0x4b6b4e){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xc2'),_0x4b6b4e[_0x77da('0xa9')]));var _0x359fbd=this['channel'][_0x77da('0x52')](_0x4b6b4e[_0x77da('0xc3')],_0x4b6b4e['options']);if(_0x359fbd[_0x77da('0xac')]===-0x1){return _0x359fbd;}return this[_0x77da('0x35')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x4b6b4e[_0x77da('0xc3')],_0x4b6b4e[_0x77da('0x77')]));};AGIVertices[_0x77da('0xe')][_0x77da('0xc4')]=function(_0x4c047e){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xc5'),_0x4c047e[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x4c047e[_0x77da('0x57')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xaa'));}var _0x1ad0a6='\x22'+_0x4c047e['text']+'\x22';if(this[_0x77da('0x86')](_0x4c047e['options'])){_0x1ad0a6+=','+_0x4c047e[_0x77da('0x77')];}var _0x459c92=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0xab'),_0x1ad0a6);if(_0x459c92[_0x77da('0xac')]===-0x1){return _0x459c92;}return this['channel'][_0x77da('0xad')](util[_0x77da('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1ad0a6));};AGIVertices[_0x77da('0xe')]['sestektts']=function(_0x5670bd){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xc6'),_0x5670bd[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x5670bd[_0x77da('0x57')])){return this['channel']['noop'](_0x77da('0xaa'));}var _0x11229b='\x22'+_0x5670bd['text']+'\x22';if(this['isConfigured'](_0x5670bd[_0x77da('0x77')])){_0x11229b+=','+_0x5670bd[_0x77da('0x77')];}var _0x550c43=this['channel']['exec']('MRCPSynth',_0x11229b);if(_0x550c43[_0x77da('0xac')]===-0x1){return _0x550c43;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xc7'),_0x11229b));};AGIVertices[_0x77da('0xe')][_0x77da('0xc8')]=function(_0x47961a){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xc9'),_0x47961a[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x47961a[_0x77da('0xaf')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xb0'));}var _0x1f9d23=_0x47961a[_0x77da('0xaf')];if(this[_0x77da('0x86')](_0x47961a['options'])){_0x1f9d23+=','+_0x47961a[_0x77da('0x77')];}var _0x299138=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0xb1'),_0x1f9d23);if(_0x299138[_0x77da('0xac')]===-0x1){return _0x299138;}var _0x2d11cc=this[_0x77da('0xa4')]('RECOG_CONFIDENCE()',_0x77da('0xca'));if(_0x2d11cc['result']===-0x1){return _0x2d11cc;}var _0x442836=this[_0x77da('0xa4')](_0x77da('0xb3'),_0x77da('0xcb'));if(_0x442836['result']===-0x1){return _0x442836;}var _0x37fc7a=this[_0x77da('0xa4')]('RECOG_INSTANCE()',_0x77da('0xcc'));if(_0x37fc7a[_0x77da('0xac')]===-0x1){return _0x37fc7a;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xb7'),_0x1f9d23));};AGIVertices[_0x77da('0xe')][_0x77da('0xcd')]=function(_0x35247e){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x35247e[_0x77da('0xa9')]));if(!this['isConfigured'](_0x35247e[_0x77da('0xaf')])){return this['channel']['noop'](_0x77da('0xb0'));}var _0x5e59f8=_0x35247e[_0x77da('0xaf')];if(this[_0x77da('0x86')](_0x35247e['options'])){_0x5e59f8+=','+_0x35247e[_0x77da('0x77')];}var _0x5da3b0=this[_0x77da('0x35')]['exec']('MRCPRecog',_0x5e59f8);if(_0x5da3b0['result']===-0x1){return _0x5da3b0;}var _0x5c6925=this['getAndSetVariable'](_0x77da('0xce'),'SESTEK_ASR_CONFIDENCE');if(_0x5c6925[_0x77da('0xac')]===-0x1){return _0x5c6925;}var _0x1b6e02=this[_0x77da('0xa4')]('RECOG_INPUT()',_0x77da('0xcf'));if(_0x1b6e02['result']===-0x1){return _0x1b6e02;}var _0x2e198f=this['getAndSetVariable'](_0x77da('0xb5'),'SESTEK_ASR_INSTANCE');if(_0x2e198f[_0x77da('0xac')]===-0x1){return _0x2e198f;}return this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xb7'),_0x5e59f8));};AGIVertices[_0x77da('0xe')][_0x77da('0xd0')]=function(_0x19e3ae){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xd1'),_0x19e3ae[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x19e3ae[_0x77da('0xd2')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x19e3ae,'no\x20database\x20selected');}var _0x4bb1a4=this[_0x77da('0x16')][_0x77da('0x6e')](this,_0x19e3ae[_0x77da('0xd2')]);if(!_0x4bb1a4){return this[_0x77da('0x35')][_0x77da('0x29')](_0x19e3ae,_0x77da('0xd3'));}if(!this['isConfigured'](_0x19e3ae[_0x77da('0x2d')])){return this['channel'][_0x77da('0x29')](_0x19e3ae,_0x77da('0xd4'));}var _0x49afc2=_0x19e3ae[_0x77da('0x2d')][_0x77da('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0xd5'),_0x49afc2));var _0x19ee25=this[_0x77da('0x28')][_0x77da('0x6e')](this,_0x4bb1a4,_0x49afc2);this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x19e3ae,_0x49afc2);if(!this[_0x77da('0x86')](_0x19e3ae[_0x77da('0xd6')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xd7'));}var _0x4c46b7=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x19e3ae[_0x77da('0xd6')]);if(!_0x4c46b7){return this[_0x77da('0x35')][_0x77da('0x29')](_0x19e3ae,_0x77da('0xd9'));}var _0x589f28=this;_0x19ee25[_0x77da('0xda')](function(_0x431fdd,_0x34da4c){Object['keys'](_0x431fdd)['forEach'](function(_0x5cbf60){_0x589f28[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')]('%s[%s][%s]',_0x4c46b7,_0x34da4c,_0x5cbf60),_0x431fdd[_0x5cbf60]);});});this[_0x77da('0x35')]['setVariable'](util[_0x77da('0x26')]('%s_ROWS_COUNT',_0x4c46b7),_0x19ee25[_0x77da('0x9b')]);return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xdb'),_0x4c46b7));};AGIVertices[_0x77da('0xe')]['dial']=function(_0x439b2a){logger[_0x77da('0xdc')](util[_0x77da('0x26')](_0x77da('0xdd'),_0x439b2a[_0x77da('0xa9')]));if(!this['isConfigured'](_0x439b2a[_0x77da('0xde')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x439b2a,_0x77da('0xdf'));}var _0x3cf98f=this[_0x77da('0x18')][_0x77da('0x6e')](this,_0x439b2a[_0x77da('0xde')]);if(!_0x3cf98f){return this['channel'][_0x77da('0x29')](_0x439b2a,_0x77da('0xe0'));}var _0x386649=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0xe1'),[util[_0x77da('0x26')]('SIP/%s',_0x3cf98f),_0x439b2a['timeout'],_0x439b2a[_0x77da('0xe2')],_0x439b2a[_0x77da('0x60')]]);if(_0x386649['result']===-0x1){return _0x386649;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xe3'),_0x77da('0xe1')));};AGIVertices['prototype'][_0x77da('0xe4')]=function(_0x3c5ff9){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xe5'),_0x3c5ff9['label']));if(!this[_0x77da('0x86')](_0x3c5ff9[_0x77da('0x79')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xe6'));}if(!this[_0x77da('0x86')](_0x3c5ff9['text'])){return this[_0x77da('0x35')][_0x77da('0xad')]('no\x20text\x20configured');}this[_0x77da('0x35')][_0x77da('0xe7')]=!![];this[_0x77da('0x32')](_0x3c5ff9);this[_0x77da('0x3e')](_0x3c5ff9[_0x77da('0x57')],'in','','');this['channel'][_0x77da('0xad')](util['format'](_0x77da('0xe8'),_0x3c5ff9[_0x77da('0x57')]));var _0x4efece=this[_0x77da('0x78')][_0x77da('0x6e')](this,_0x3c5ff9);if(_0x4efece){for(var _0x31c3db in _0x4efece){if(_0x4efece[_0x77da('0x97')](_0x31c3db)){this[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')](_0x77da('0xe9'),_0x31c3db[_0x77da('0x67')]()),_0x4efece[_0x31c3db]);}}this[_0x77da('0x3e')](_0x4efece[_0x77da('0xea')],'out','dialogflow','');return this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0xeb'),_0x4efece[_0x77da('0xea')]));}return this[_0x77da('0x35')][_0x77da('0x29')](_0x3c5ff9,_0x77da('0xec'));};AGIVertices[_0x77da('0xe')][_0x77da('0xed')]=function(_0x40c4eb){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xee'),_0x40c4eb[_0x77da('0xa9')]));if(!this['isConfigured'](_0x40c4eb['dialogflowV2_project_id'])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xef'));}if(!this[_0x77da('0x86')](_0x40c4eb[_0x77da('0x7d')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xf0'));}if(!this[_0x77da('0x86')](_0x40c4eb['private_key'])){return this['channel'][_0x77da('0xad')](_0x77da('0xf1'));}if(!this[_0x77da('0x86')](_0x40c4eb[_0x77da('0x7f')])){return this[_0x77da('0x35')]['noop']('no\x20anguage\x20configured');}if(!this[_0x77da('0x86')](_0x40c4eb[_0x77da('0x57')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xaa'));}this[_0x77da('0x35')][_0x77da('0xe7')]=!![];this[_0x77da('0x32')](_0x40c4eb);this[_0x77da('0x3e')](_0x40c4eb['text'],'in','','');this['channel']['noop'](util['format']('Trying\x20DialogflowV2:\x20%s',_0x40c4eb[_0x77da('0x57')]));var _0x177019=this[_0x77da('0x7b')][_0x77da('0x6e')](this,_0x40c4eb);if(_0x177019){for(var _0x14c7e3 in _0x177019){if(_0x177019[_0x77da('0x97')](_0x14c7e3)){if(_0x14c7e3!=='providerResponse'){this[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')]('DIALOGFLOW_%s',_0x14c7e3[_0x77da('0x67')]()),_0x177019[_0x14c7e3]);}}}this[_0x77da('0x3e')](_0x177019['speech'],'out',_0x77da('0xed'),_0x177019[_0x77da('0xf2')]);return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xf3'),_0x177019['speech']));}return this[_0x77da('0x35')]['error'](_0x40c4eb,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x77da('0xe')][_0x77da('0xf4')]=function(_0x2d9392){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0xf5'),_0x2d9392[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x2d9392[_0x77da('0xf6')])){return this['channel'][_0x77da('0xad')](_0x77da('0xf7'));}if(!this[_0x77da('0x86')](_0x2d9392[_0x77da('0xf8')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xf9'));}if(!this['isConfigured'](_0x2d9392[_0x77da('0xfa')])){return this[_0x77da('0x35')][_0x77da('0xad')]('no\x20password\x20configured');}if(!this[_0x77da('0x86')](_0x2d9392[_0x77da('0xfb')])){return this[_0x77da('0x35')][_0x77da('0xad')]('no\x20text\x20configured');}this[_0x77da('0x35')][_0x77da('0xe7')]=!![];this[_0x77da('0x32')](_0x2d9392);this[_0x77da('0x3e')](_0x2d9392[_0x77da('0x57')],'in','','');this['channel']['noop'](util['format']('Trying\x20SestekNDA:\x20%s',_0x2d9392[_0x77da('0x57')]));var _0x286962=this[_0x77da('0x80')]['sync'](this,_0x2d9392);if(_0x286962){for(var _0x5db68b in _0x286962){if(_0x286962['hasOwnProperty'](_0x5db68b)){this[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')](_0x77da('0xfc'),_0x5db68b['toUpperCase']()),_0x286962[_0x5db68b]);}}this['createSquareMessage'](_0x286962[_0x77da('0xea')],'out',_0x77da('0xf4'),'');if(_0x286962['audiofile']){this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0xfd'),_0x286962[_0x77da('0xfe')]));var _0x3251e0=this['channel'][_0x77da('0xff')](_0x286962[_0x77da('0xfe')]);try{fs[_0x77da('0x100')](_0x286962['audiofile']+_0x77da('0x101'));}catch(_0x1b7e86){logger[_0x77da('0x29')](_0x1b7e86);}return _0x3251e0;}else{return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')]('SestekNDA\x20Result\x20%s',_0x286962[_0x77da('0xea')]));}}return this[_0x77da('0x35')][_0x77da('0x29')](_0x2d9392,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x77da('0xe')]['end']=function(_0x297b2c){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x102'),_0x297b2c['label']));return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x103'));};AGIVertices['prototype'][_0x77da('0x104')]=function(_0x32ef18){logger[_0x77da('0x2b')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x32ef18[_0x77da('0xa9')]));var _0x1ad03a='';if(_0x32ef18[_0x77da('0x105')]){if(!this[_0x77da('0x86')](_0x32ef18['trunk_id'])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x32ef18,_0x77da('0x106'));}else{var _0xea7645=parseInt(_0x32ef18['trunk_id'],0xa);if(isNaN(_0xea7645)){_0x1ad03a=_0x32ef18[_0x77da('0x105')];}else{_0x1ad03a=this[_0x77da('0x19')][_0x77da('0x6e')](this,_0x32ef18[_0x77da('0x105')]);if(!_0x1ad03a){return this[_0x77da('0x35')][_0x77da('0x29')](_0x32ef18,_0x77da('0x107'));}}}}else if(_0x32ef18[_0x77da('0x108')]){_0x1ad03a=_0x32ef18['trunk_name'];}else{return this[_0x77da('0x35')][_0x77da('0x29')](_0x32ef18,_0x77da('0x106'));}var _0x17a18d=this[_0x77da('0x35')]['exec'](_0x77da('0xe1'),[util[_0x77da('0x26')](_0x77da('0x109'),_0x1ad03a,_0x32ef18[_0x77da('0xc0')]),_0x32ef18[_0x77da('0x61')],_0x32ef18['opts'],_0x32ef18[_0x77da('0x60')]]);if(_0x17a18d[_0x77da('0xac')]===-0x1){return _0x17a18d;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0xe3'),_0x77da('0xe1')));};AGIVertices[_0x77da('0xe')][_0x77da('0x10a')]=function(_0x2aae94){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x10b'),_0x2aae94['label']));return this[_0x77da('0x35')][_0x77da('0xad')]('finally');};AGIVertices['prototype'][_0x77da('0xa')]=function(_0x4775bd){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x10c'),_0x4775bd[_0x77da('0xa9')]));if(_0x4775bd[_0x77da('0xa7')]===0x0){return this[_0x77da('0xa6')](_0x4775bd);}_0x4775bd[_0x77da('0xa7')]-=0x1;if(!this['isConfigured'](_0x4775bd[_0x77da('0x10d')])){return this['channel'][_0x77da('0x29')](_0x4775bd,_0x77da('0x10e'));}var _0xfc16cf=this[_0x77da('0x1b')][_0x77da('0x6e')](this,_0x4775bd[_0x77da('0x10d')]);if(!_0xfc16cf){return this[_0x77da('0x35')][_0x77da('0x29')](_0x4775bd,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x4775bd[_0x77da('0xd6')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x77da('0xd7'));}var _0x1569fc=this['channel'][_0x77da('0x10f')](_0xfc16cf,_0x4775bd[_0x77da('0x110')],_0x4775bd[_0x77da('0x111')]);var _0x8dc14d=_0x1569fc[_0x77da('0xac')]?_0x1569fc[_0x77da('0xac')][_0x77da('0x48')]():'';logger[_0x77da('0x2b')](_0x77da('0x112'),JSON['stringify'](_0x1569fc));if(_0x1569fc['result']===-0x1){this['createSquareDetailsReport'][_0x77da('0x6e')](this,_0x4775bd,_0x8dc14d);return _0x1569fc;}else if(_0x1569fc['extra']===_0x77da('0x61')){_0x1569fc[_0x77da('0xac')]=_0x8dc14d[_0x77da('0x9b')]>=parseInt(_0x4775bd['mindigit'])?'x':'i';}else{_0x1569fc['result']=_0x8dc14d[_0x77da('0x9b')]>=parseInt(_0x4775bd[_0x77da('0x113')])&&_0x8dc14d[_0x77da('0x9b')]<=parseInt(_0x4775bd[_0x77da('0x111')])?'x':'i';}var _0x12cf53=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x4775bd[_0x77da('0xd6')]);if(!_0x12cf53){return this['channel'][_0x77da('0x29')](_0x4775bd,_0x77da('0xd9'));}this['channel']['setVariable'](_0x12cf53,_0x8dc14d);if(this[_0x77da('0x86')](_0x4775bd['hiddendigitsnum'])){var _0x9beef1=parseInt(_0x4775bd['hiddendigitsnum'],0xa);var _0x24a515=rs['generate']({'charset':'*','length':_0x9beef1});var _0x370b83=_0x8dc14d[_0x77da('0x9b')];if(_0x370b83>0x0){if(_0x370b83>_0x9beef1){this['createSquareDetailsReport'][_0x77da('0x6e')](this,_0x4775bd,_0x4775bd[_0x77da('0x114')]==='first'?_0x24a515+_0x8dc14d[_0x77da('0x115')](_0x9beef1):_0x8dc14d[_0x77da('0x115')](0x0,_0x370b83-_0x9beef1)+_0x24a515);}else{this['createSquareDetailsReport'][_0x77da('0x6e')](this,_0x4775bd,rs[_0x77da('0x116')]({'charset':'*','length':_0x370b83}));}}else{this[_0x77da('0x32')]['sync'](this,_0x4775bd,'');}}else{this[_0x77da('0x32')]['sync'](this,_0x4775bd,_0x8dc14d);}return _0x1569fc;};AGIVertices[_0x77da('0xe')][_0x77da('0xb')]=function(_0x1f04a8){logger[_0x77da('0x2b')](util['format'](_0x77da('0x117'),_0x1f04a8[_0x77da('0xa9')]));return this['getdigits'](_0x1f04a8);};AGIVertices[_0x77da('0xe')][_0x77da('0x118')]=function(_0x19ad7c){logger[_0x77da('0x2b')](util['format'](_0x77da('0x119'),_0x19ad7c[_0x77da('0xa9')]));this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x19ad7c,_0x19ad7c['goalname']);return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x11a'),_0x19ad7c[_0x77da('0x11b')]));};AGIVertices['prototype'][_0x77da('0x11c')]=function(_0x93367a){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x11d'),_0x93367a['label']));if(!this[_0x77da('0x86')](_0x93367a[_0x77da('0x89')])||!this[_0x77da('0x86')](_0x93367a[_0x77da('0x8a')])){return this[_0x77da('0x35')]['noop'](_0x77da('0x11e'));}if(!this['isConfigured'](_0x93367a[_0x77da('0x57')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xaa'));}this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x11f'),_0x93367a[_0x77da('0x57')]));var _0xa05664=this[_0x77da('0x88')][_0x77da('0x6e')](this,_0x93367a);if(_0xa05664){this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x120'),_0xa05664));var _0x1e8f14=this[_0x77da('0x35')][_0x77da('0xff')](_0xa05664);try{fs[_0x77da('0x100')](_0xa05664+'.wav');}catch(_0x661b1c){logger[_0x77da('0x29')](_0x661b1c);}return _0x1e8f14;}return this[_0x77da('0x35')][_0x77da('0x29')](_0x93367a,_0x77da('0x121'));};AGIVertices[_0x77da('0xe')][_0x77da('0x122')]=function(_0x1314a6){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x123'),_0x1314a6['label']));if(!this[_0x77da('0x86')](_0x1314a6['aws_access_key_id'])||!this[_0x77da('0x86')](_0x1314a6[_0x77da('0x8a')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x11e'));}if(!this['isConfigured'](_0x1314a6[_0x77da('0x90')])){return this['channel'][_0x77da('0xad')]('no\x20bot\x20name\x20configured');}if(!this[_0x77da('0x86')](_0x1314a6[_0x77da('0x57')])){return this['channel'][_0x77da('0xad')](_0x77da('0xaa'));}this['channel'][_0x77da('0xe7')]=!![];this[_0x77da('0x32')](_0x1314a6);this[_0x77da('0x3e')](_0x1314a6[_0x77da('0x57')],'in','','');this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x124'),_0x1314a6[_0x77da('0x57')]));var _0x4963db=this[_0x77da('0x8e')][_0x77da('0x6e')](this,_0x1314a6);if(_0x4963db){for(var _0x3d0552 in _0x4963db){if(_0x4963db[_0x77da('0x97')](_0x3d0552)&&_[_0x77da('0x9c')](_0x4963db[_0x3d0552])){this[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')](_0x77da('0x125'),_0x3d0552['toUpperCase']()),_0x4963db[_0x3d0552]);}}if(_[_0x77da('0x41')](_0x4963db['message'])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x126'));}else{this[_0x77da('0x3e')](_0x4963db[_0x77da('0x75')],_0x77da('0x127'),_0x77da('0x128'),'');return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x129'),_0x4963db[_0x77da('0x75')]));}}return this['channel'][_0x77da('0x29')](_0x1314a6,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x77da('0xe')]['googleasr']=function(_0x4d44b7){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x12a'),_0x4d44b7[_0x77da('0xa9')],_0x4d44b7[_0x77da('0x61')]));if(!this[_0x77da('0x86')](_0x4d44b7[_0x77da('0x79')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xe6'));}var _0x233b84=_0x77da('0x12b');var _0x3a6f6d=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x48d84d=util[_0x77da('0x26')](_0x77da('0x9e'),_0x3a6f6d,_0x233b84);var _0x3d8da1=!![];if(_0x4d44b7[_0x77da('0x12c')]===_0x77da('0x12d')){_0x3d8da1=![];}var _0x446e3b=this[_0x77da('0x35')][_0x77da('0x12e')](_0x3a6f6d,_0x233b84,_0x4d44b7[_0x77da('0x12f')],_0x4d44b7[_0x77da('0x61')],undefined,_0x3d8da1);if(_0x446e3b[_0x77da('0xac')]!==-0x1){this[_0x77da('0x35')][_0x77da('0xad')](util['format']('google\x20%s\x20file\x20created',_0x48d84d));var _0x25dd27=this[_0x77da('0x91')][_0x77da('0x6e')](this,_0x4d44b7,_0x48d84d);if(_0x25dd27){for(var _0x21411e in _0x25dd27){if(_0x25dd27[_0x77da('0x97')](_0x21411e)){this[_0x77da('0x35')]['setVariable'](util[_0x77da('0x26')](_0x77da('0x130'),_0x21411e[_0x77da('0x67')]()),_0x25dd27[_0x21411e]);}}return this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x131'),JSON[_0x77da('0xa1')](_0x25dd27)));}}return _0x446e3b;};AGIVertices[_0x77da('0xe')]['tildeasr']=function(_0x451dcd){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x132'),_0x451dcd[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x451dcd[_0x77da('0x94')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x133'));}if(!this[_0x77da('0x86')](_0x451dcd[_0x77da('0x95')])){return this['channel'][_0x77da('0xad')](_0x77da('0x134'));}var _0x7511d=_0x77da('0x12b');var _0x4111c0=util[_0x77da('0x26')](_0x77da('0x135'),FILES_PATH,rs['generate'](0x4));var _0x5b7cc3=util[_0x77da('0x26')](_0x77da('0x9e'),_0x4111c0,_0x7511d);var _0x2fc378=!![];if(_0x451dcd[_0x77da('0x12c')]===_0x77da('0x12d')){_0x2fc378=![];}var _0x1c99ea=this['channel'][_0x77da('0x12e')](_0x4111c0,_0x7511d,_0x451dcd[_0x77da('0x12f')],_0x451dcd[_0x77da('0x61')],undefined,_0x2fc378);if(_0x1c99ea[_0x77da('0xac')]!==-0x1){this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x136'),_0x5b7cc3));var _0x967533=this[_0x77da('0x93')]['sync'](this,_0x451dcd,_0x5b7cc3);if(_0x967533){for(var _0x76fc14 in _0x967533){if(_0x967533['hasOwnProperty'](_0x76fc14)){this['channel']['setVariable'](util[_0x77da('0x26')](_0x77da('0x137'),_0x76fc14[_0x77da('0x67')]()),_0x967533[_0x76fc14]);}}return this[_0x77da('0x35')]['noop'](util['format']('TildeASR\x20Result\x20%s',JSON[_0x77da('0xa1')](_0x967533)));}}return _0x1c99ea;};AGIVertices[_0x77da('0xe')][_0x77da('0x138')]=function(_0x201a48){logger[_0x77da('0x2b')](util['format'](_0x77da('0x139'),_0x201a48[_0x77da('0xa9')]));return this['channel'][_0x77da('0x13a')](_0x201a48[_0x77da('0x3a')],_0x201a48[_0x77da('0x3b')],_0x201a48[_0x77da('0x13b')]);};AGIVertices[_0x77da('0xe')][_0x77da('0x13c')]=function(_0x2b3dae){logger['info'](util[_0x77da('0x26')](_0x77da('0x13d'),_0x2b3dae[_0x77da('0xa9')]));if(!this['isConfigured'](_0x2b3dae[_0x77da('0x13e')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x2b3dae,_0x77da('0x13f'));}try{var _0x10fb04=eval(_0x2b3dae[_0x77da('0x13e')])?_0x77da('0x140'):'false';this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')]('EVAL\x20CONDITION\x20%s\x20%s',_0x2b3dae[_0x77da('0x13e')],_0x10fb04));return{'code':0xc8,'result':_0x10fb04};}catch(_0x1ca8b1){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x77da('0xe')][_0x77da('0x141')]=function(_0x4e8547){logger[_0x77da('0x2b')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4e8547['label']));if(!this['isConfigured'](_0x4e8547[_0x77da('0x142')])){return this[_0x77da('0x35')]['error'](_0x4e8547,'no\x20interval\x20configured');}var _0x121635=this[_0x77da('0x20')][_0x77da('0x6e')](this,_0x4e8547[_0x77da('0x142')]);if(!_0x121635){return this[_0x77da('0x35')][_0x77da('0x29')](_0x4e8547,'no\x20intervals\x20found');}for(var _0x5c287e=0x0;_0x5c287e<_0x121635[_0x77da('0x9b')];_0x5c287e+=0x1){var _0x288af0=this[_0x77da('0x35')][_0x77da('0xd8')](util[_0x77da('0x26')](_0x77da('0x143'),_0x121635[_0x5c287e]));if(_0x288af0[_0x77da('0xac')]===-0x1){return _0x288af0;}logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x144'),_0x121635[_0x5c287e],_0x288af0[_0x77da('0xa5')]));if(_0x288af0[_0x77da('0xa5')]===_0x77da('0x140')){logger['info'](util[_0x77da('0x26')]('IFTIME\x20%s\x20%s',_0x121635[_0x5c287e],_0x77da('0x140')));this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x144'),_0x121635[_0x5c287e],'true'));return{'code':0xc8,'result':_0x77da('0x140')};}else{logger['info'](util[_0x77da('0x26')](_0x77da('0x144'),_0x121635[_0x5c287e],_0x77da('0x145')));this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x144'),_0x121635[_0x5c287e],_0x77da('0x145')));}}return{'code':0xc8,'result':_0x77da('0x145')};};AGIVertices['prototype']['hangup']=function(_0x3ee5df){logger['info'](util[_0x77da('0x26')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x3ee5df[_0x77da('0xa9')]));return this[_0x77da('0x35')][_0x77da('0x146')]();};AGIVertices[_0x77da('0xe')][_0x77da('0x147')]=function(_0x24ce25){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x24ce25[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x24ce25[_0x77da('0x79')])){return this[_0x77da('0x35')][_0x77da('0xad')]('no\x20key\x20configured');}var _0x58723e=_0x77da('0x12b');var _0x31c1d2=util[_0x77da('0x26')](_0x77da('0x135'),FILES_PATH,rs[_0x77da('0x116')](0x4));var _0x5ca310=util[_0x77da('0x26')](_0x77da('0x9e'),_0x31c1d2,_0x58723e);var _0x516405=!![];if(_0x24ce25[_0x77da('0x12c')]===_0x77da('0x12d')){_0x516405=![];}var _0x640c1e=this[_0x77da('0x35')]['recordFile'](_0x31c1d2,_0x58723e,_0x24ce25[_0x77da('0x12f')],_0x24ce25[_0x77da('0x61')],undefined,_0x516405);if(_0x640c1e[_0x77da('0xac')]!==-0x1){this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')]('ispeech\x20%s\x20file\x20created',_0x5ca310));var _0x405010=this[_0x77da('0x84')][_0x77da('0x6e')](this,_0x24ce25,_0x5ca310);if(_0x405010){for(var _0x428cf7 in _0x405010){if(_0x405010[_0x77da('0x97')](_0x428cf7)){this['channel'][_0x77da('0x9f')](util[_0x77da('0x26')](_0x77da('0x148'),_0x428cf7['toUpperCase']()),_0x405010[_0x428cf7]);}}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x149'),JSON[_0x77da('0xa1')](_0x405010)));}}return _0x640c1e;};AGIVertices[_0x77da('0xe')]['ispeechtts']=function(_0x277a0e){logger[_0x77da('0x2b')](util['format'](_0x77da('0x14a'),_0x277a0e[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x277a0e[_0x77da('0x79')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xe6'));}if(!this[_0x77da('0x86')](_0x277a0e[_0x77da('0x57')])){return this[_0x77da('0x35')]['noop'](_0x77da('0xaa'));}this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x14b'),_0x277a0e[_0x77da('0x57')]));var _0x4ac657=this['ispeechTTS'][_0x77da('0x6e')](this,_0x277a0e);if(_0x4ac657){this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x14c'),_0x4ac657));var _0x49c711=this['channel'][_0x77da('0xff')](_0x4ac657,_0x277a0e[_0x77da('0x12f')]);try{fs[_0x77da('0x100')](_0x4ac657+_0x77da('0x101'));}catch(_0x27e674){logger[_0x77da('0x29')](_0x27e674);}return _0x49c711;}return this[_0x77da('0x35')][_0x77da('0x29')](_0x277a0e,_0x77da('0x14d'));};AGIVertices[_0x77da('0xe')][_0x77da('0x14e')]=function(_0x3ac958){logger[_0x77da('0x2b')](util['format'](_0x77da('0x14f'),_0x3ac958[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x3ac958['findBy'])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x3ac958,_0x77da('0x150'));}logger[_0x77da('0x2b')](util[_0x77da('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x77da('0x35')][_0x77da('0x37')],_0x3ac958[_0x77da('0x151')]));var _0x101f1c=this[_0x77da('0x4e')][_0x77da('0x6e')](this,_0x3ac958[_0x77da('0x151')]);if(_0x101f1c){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x77da('0x37')],_0x3ac958['findBy']));this['channel']['noop'](util[_0x77da('0x26')](_0x77da('0x152'),this['channel'][_0x77da('0x37')],_0x3ac958[_0x77da('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x77da('0x2b')](util[_0x77da('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x77da('0x35')]['callerid'],_0x3ac958[_0x77da('0x151')]));this['channel'][_0x77da('0xad')](util[_0x77da('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x77da('0x35')][_0x77da('0x37')],_0x3ac958[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x153')};}};AGIVertices[_0x77da('0xe')][_0x77da('0x154')]=function(_0x2e9255){logger['info'](util['format'](_0x77da('0x155'),_0x2e9255['label']));if(!this[_0x77da('0x86')](_0x2e9255[_0x77da('0x151')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x2e9255,'no\x20find\x20by\x20configured');}logger['info'](util[_0x77da('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x77da('0x35')]['callerid'],_0x2e9255[_0x77da('0x151')]));var _0x1cd0bd=this['agentLogout'][_0x77da('0x6e')](this,_0x2e9255[_0x77da('0x151')]);if(_0x1cd0bd){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x152'),this[_0x77da('0x35')][_0x77da('0x37')],_0x2e9255[_0x77da('0x151')]));this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x152'),this['channel'][_0x77da('0x37')],_0x2e9255[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x156')};}else{logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x157'),this[_0x77da('0x35')]['callerid'],_0x2e9255[_0x77da('0x151')]));this[_0x77da('0x35')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x77da('0x35')]['callerid'],_0x2e9255[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x153')};}};AGIVertices['prototype'][_0x77da('0x158')]=function(_0xf61d48){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0xf61d48[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0xf61d48[_0x77da('0x159')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0xf61d48,_0x77da('0x15a'));}this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x15b'),_0xf61d48[_0x77da('0x159')]));var _0x603cda=eval(_0xf61d48[_0x77da('0x159')]);if(!this[_0x77da('0x86')](_0xf61d48[_0x77da('0xd6')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xd7'));}var _0x4cc8ea=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0xf61d48[_0x77da('0xd6')]);if(!_0x4cc8ea){return this[_0x77da('0x35')][_0x77da('0x29')](_0xf61d48,'no\x20variable\x20found');}if(_[_0x77da('0x9a')](_0x603cda)){var _0x42bdff=this;_0x603cda[_0x77da('0xda')](function(_0x18d35e,_0x38f45a){_0x42bdff[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')]('%s[%s]',_0x4cc8ea,_0x38f45a),_0x18d35e);});return this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x15c'),_0x4cc8ea));}else{return this[_0x77da('0x35')][_0x77da('0x9f')](_0x4cc8ea,_0x603cda);}};AGIVertices[_0x77da('0xe')][_0x77da('0x15d')]=function(_0x14533c){logger[_0x77da('0x2b')](util['format'](_0x77da('0x15e'),_0x14533c[_0x77da('0xa9')]));if(_0x14533c[_0x77da('0xa7')]===0x0){return this['maxRetry'](_0x14533c);}_0x14533c['retry']-=0x1;if(!this[_0x77da('0x86')](_0x14533c[_0x77da('0x10d')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x14533c,_0x77da('0x10e'));}var _0x31eec0=this['getSound'][_0x77da('0x6e')](this,_0x14533c[_0x77da('0x10d')]);if(!_0x31eec0){return this[_0x77da('0x35')][_0x77da('0x29')](_0x14533c,'no\x20file\x20audio\x20found');}var _0x357745=this[_0x77da('0x35')]['getData'](_0x31eec0,_0x14533c[_0x77da('0x110')],_0x14533c['digit']);var _0x1a446c=_0x357745[_0x77da('0xac')];if(_0x357745['result']===-0x1){this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x14533c,'-1');return _0x357745;}else if(_0x357745['extra']===_0x77da('0x61')){_0x357745[_0x77da('0xac')]=_0x357745['result'][_0x77da('0x9b')]>0x0?_0x357745[_0x77da('0xac')]:'t';}else if(_[_0x77da('0x40')](_0x357745['result'])){_0x357745['result']='#';_0x1a446c='#';}if(!this[_0x77da('0x86')](_0x14533c[_0x77da('0xd6')])){this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xd7'));}else{var _0x44faff=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x14533c[_0x77da('0xd6')]);if(!_0x44faff){return this[_0x77da('0x35')]['error'](_0x14533c,_0x77da('0xd9'));}this[_0x77da('0x35')][_0x77da('0x9f')](_0x44faff,_0x1a446c);}this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x14533c,_0x1a446c);return _0x357745;};AGIVertices['prototype'][_0x77da('0xad')]=function(_0x43ee45){logger['info'](util[_0x77da('0x26')](_0x77da('0x15f'),_0x43ee45['label']));return this['channel'][_0x77da('0xad')](_0x43ee45['output']||_0x43ee45[_0x77da('0xa9')]);};AGIVertices[_0x77da('0xe')][_0x77da('0x160')]=function(_0x540d6a){logger['info'](util[_0x77da('0x26')](_0x77da('0x161'),_0x540d6a[_0x77da('0xa9')]));if(!this['isConfigured'](_0x540d6a[_0x77da('0x151')])){return this['channel']['error'](_0x540d6a,'no\x20find\x20by\x20configured');}logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x162'),this['channel']['callerid'],_0x540d6a[_0x77da('0x151')]));var _0x4660df=this[_0x77da('0x163')][_0x77da('0x6e')](this,_0x540d6a['pause_id']);var _0x59e5d3=this[_0x77da('0x4a')]['sync'](this,_0x540d6a[_0x77da('0x151')],_0x4660df);if(_0x59e5d3){logger['info'](util[_0x77da('0x26')](_0x77da('0x152'),this[_0x77da('0x35')]['callerid'],_0x540d6a[_0x77da('0x151')]));this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x152'),this['channel'][_0x77da('0x37')],_0x540d6a[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x156')};}else{logger['info'](util[_0x77da('0x26')](_0x77da('0x157'),this[_0x77da('0x35')][_0x77da('0x37')],_0x540d6a[_0x77da('0x151')]));this['channel'][_0x77da('0xad')](util['format'](_0x77da('0x152'),this[_0x77da('0x35')]['callerid'],_0x540d6a['findBy']));return{'code':0xc8,'result':_0x77da('0x153')};}};AGIVertices[_0x77da('0xe')][_0x77da('0x164')]=function(_0x3769e3){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x165'),_0x3769e3[_0x77da('0xa9')]));if(!this['isConfigured'](_0x3769e3[_0x77da('0x10d')])){return this['channel'][_0x77da('0x29')](_0x3769e3,_0x77da('0x10e'));}var _0x41fdb6=this[_0x77da('0x1b')][_0x77da('0x6e')](this,_0x3769e3[_0x77da('0x10d')]);if(!_0x41fdb6){return this[_0x77da('0x35')][_0x77da('0x29')](_0x3769e3,_0x77da('0x166'));}var _0x423164=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0x167'),[_0x41fdb6,_0x3769e3[_0x77da('0xe2')]]);if(_0x423164[_0x77da('0xac')]===-0x1){return _0x423164;}return this['channel']['noop'](util[_0x77da('0x26')](_0x77da('0x168'),'PLAYBACK',_0x41fdb6));};AGIVertices[_0x77da('0xe')][_0x77da('0x169')]=function(_0x12dd79){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x16a'),_0x12dd79[_0x77da('0xa9')]));if(!this['isConfigured'](_0x12dd79['queue_id'])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x12dd79,'no\x20queue\x20selected');}var _0x263094='';var _0x59882f=parseInt(_0x12dd79['queue_id'],0xa);if(isNaN(_0x59882f)){_0x263094=_0x12dd79[_0x77da('0x16b')];}else{_0x263094=this[_0x77da('0x12')][_0x77da('0x6e')](this,_0x12dd79[_0x77da('0x16b')]);if(!_0x263094){return this['channel']['error'](_0x12dd79,_0x77da('0x16c'));}}var _0x3afe4a='';if(this[_0x77da('0x86')](_0x12dd79['file_id'])){var _0x59c161=this[_0x77da('0x1b')][_0x77da('0x6e')](this,_0x12dd79[_0x77da('0x10d')]);if(_0x59c161){_0x3afe4a=_0x59c161;}}this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x12dd79,_0x263094);if(_0x12dd79[_0x77da('0xe2')][_0x77da('0x16d')]('x')<0x0){_0x12dd79[_0x77da('0xe2')]+='x';}if(_0x12dd79[_0x77da('0xe2')][_0x77da('0x16d')]('X')<0x0){_0x12dd79[_0x77da('0xe2')]+='X';}this[_0x77da('0x35')][_0x77da('0x9f')](_0x77da('0x16e'),_0x263094?_0x263094['toLowerCase']():'');var _0x484f9e=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0x16f'),[_0x263094,_0x12dd79[_0x77da('0xe2')],_0x12dd79[_0x77da('0x60')],_0x3afe4a,_0x12dd79[_0x77da('0x61')],_0x12dd79['agi'],_0x12dd79['macro'],_0x12dd79[_0x77da('0x170')],'',_0x12dd79['position']]);if(_0x484f9e[_0x77da('0xac')]===-0x1){return _0x484f9e;}return this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x168'),_0x77da('0x16f'),_0x263094));};AGIVertices[_0x77da('0xe')][_0x77da('0x171')]=function(_0x3bf391){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x172'),_0x3bf391['label']));var _0x185607=_0x3bf391[_0x77da('0x173')]||'wav';var _0xc04ffc=util[_0x77da('0x26')]('%s_%s',this[_0x77da('0x35')]['uniqueid'],rs['generate'](0x5));var _0x14370f=util[_0x77da('0x26')](_0x77da('0x174'),FILES_PATH,_0xc04ffc,_0x185607);var _0x111554=util[_0x77da('0x26')]('%s/recordings/%s',FILES_PATH,_0xc04ffc);this['createSquareRecording'][_0x77da('0x6e')](this,_0x3bf391,_0xc04ffc,_0x14370f);this[_0x77da('0x35')][_0x77da('0x9f')](_0x77da('0x175'),_0xc04ffc);logger[_0x77da('0x2b')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x111554,_0x185607,_0x3bf391[_0x77da('0x176')],_0x3bf391['timeout']);return this[_0x77da('0x35')]['recordFile'](_0x111554,_0x185607,_0x3bf391[_0x77da('0x176')],_0x3bf391[_0x77da('0x61')],undefined,!![]);};AGIVertices['prototype'][_0x77da('0x177')]=function(_0x5878b1){logger[_0x77da('0x2b')](util['format'](_0x77da('0x178'),_0x5878b1['label']));if(!this[_0x77da('0x86')](_0x5878b1[_0x77da('0x60')])){return this['channel']['noop']('no\x20url\x20configured');}var _0x7075c8=this[_0x77da('0x5f')][_0x77da('0x6e')](this,_0x5878b1);logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x179'),util[_0x77da('0x17a')](_0x7075c8,{'showHidden':![],'depth':null})));if(!this[_0x77da('0x86')](_0x5878b1['variable_id'])){return this[_0x77da('0x35')]['noop'](_0x77da('0x17b'));}var _0x21a3fa=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x5878b1['variable_id']);if(!_0x21a3fa){return this[_0x77da('0x35')][_0x77da('0x29')](_0x5878b1,_0x77da('0xd9'));}this[_0x77da('0x35')][_0x77da('0x9f')](util[_0x77da('0x26')](_0x77da('0x17c'),_0x21a3fa),_0x7075c8[_0x77da('0x73')]?_0x7075c8[_0x77da('0x73')]:_0x77da('0x17d'));this[_0x77da('0x35')]['setVariable'](util['format'](_0x77da('0x17e'),_0x21a3fa),_0x7075c8[_0x77da('0x74')]?_0x7075c8[_0x77da('0x74')]:'OK');if(_0x7075c8[_0x77da('0x68')]){try{this[_0x77da('0x9d')](_0x7075c8[_0x77da('0x68')],_0x21a3fa);}catch(_0x151396){logger['error'](util[_0x77da('0x26')](_0x77da('0x17f'),_0x21a3fa));}}return this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0xdb'),_0x21a3fa));};AGIVertices[_0x77da('0xe')][_0x77da('0x180')]=function(_0x578485){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x181'),_0x578485[_0x77da('0xa9')]));return this[_0x77da('0x35')][_0x77da('0x182')](_0x578485['digits'][_0x77da('0x53')](/\s+/g,''),_0x578485[_0x77da('0x176')]);};AGIVertices[_0x77da('0xe')][_0x77da('0x183')]=function(_0x1f1e33){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x184'),_0x1f1e33[_0x77da('0xa9')]));return this[_0x77da('0x35')]['sayNumber'](_0x1f1e33[_0x77da('0x62')][_0x77da('0x53')](/\s+/g,''),_0x1f1e33[_0x77da('0x176')]);};AGIVertices[_0x77da('0xe')]['sayphonetic']=function(_0x57f778){logger['info'](util[_0x77da('0x26')](_0x77da('0x185'),_0x57f778[_0x77da('0xa9')]));return this[_0x77da('0x35')][_0x77da('0x186')](_0x57f778['text'],_0x57f778['escape_digits']);};AGIVertices[_0x77da('0xe')][_0x77da('0x187')]=function(_0x3687a5){logger['info'](util[_0x77da('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3687a5[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x3687a5[_0x77da('0x188')])){return this[_0x77da('0x35')][_0x77da('0xad')]('no\x20mail\x20account\x20configured');}var _0x1b1e6a=this[_0x77da('0x1d')][_0x77da('0x6e')](this,_0x3687a5[_0x77da('0x188')]);if(!_0x1b1e6a||!_0x1b1e6a[_0x77da('0x189')]){return this[_0x77da('0x35')]['error'](_0x3687a5,_0x77da('0x18a'));}var _0x16ffbc={'from':util[_0x77da('0x26')]('\x22%s\x22\x20<%s>',_0x1b1e6a[_0x77da('0x10')],_0x1b1e6a[_0x77da('0x18b')]||_0x1b1e6a[_0x77da('0x189')][_0x77da('0x18c')]),'to':_0x3687a5['to']||'','cc':_0x3687a5['cc']||'','bcc':_0x3687a5[_0x77da('0x18d')]||'','subject':_0x3687a5[_0x77da('0x18e')],'html':_0x3687a5[_0x77da('0x57')],'text':_0x3687a5[_0x77da('0x57')]};if(this[_0x77da('0x86')](_0x3687a5[_0x77da('0x18f')])){}logger[_0x77da('0xdc')]('sendMail\x20message',JSON[_0x77da('0xa1')](_0x16ffbc));this['createSquareDetailsReport'][_0x77da('0x6e')](this,_0x3687a5,_0x3687a5[_0x77da('0x188')]);this[_0x77da('0x35')][_0x77da('0xad')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x1b1e6a[_0x77da('0x10')]));this[_0x77da('0x1f')][_0x77da('0x6e')](this,_0x1b1e6a[_0x77da('0x190')],_0x16ffbc);return this[_0x77da('0x35')][_0x77da('0xad')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x77da('0xe')][_0x77da('0x191')]=function(_0x20a525){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x192'),_0x20a525[_0x77da('0xa9')]));return this[_0x77da('0x35')]['noop'](_0x77da('0x193'));};AGIVertices[_0x77da('0xe')]['sendSMS']=function(_0x43130f){logger[_0x77da('0x2b')](util[_0x77da('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x43130f[_0x77da('0xa9')]));if(!this['isConfigured'](_0x43130f[_0x77da('0x194')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x195'));}var _0x137472=this[_0x77da('0x30')][_0x77da('0x6e')](this,_0x43130f[_0x77da('0x194')]);if(!_0x137472){return this['channel'][_0x77da('0x29')](_0x43130f,_0x77da('0x196'));}var _0x4d1b95={'body':_0x43130f['sms_text'],'phone':_0x43130f['to']||'','SmsAccountId':_0x137472['id']};logger[_0x77da('0xdc')](_0x77da('0x197'),JSON[_0x77da('0xa1')](_0x4d1b95));this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x43130f,_0x43130f['sms_account_id']);this['channel'][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x198'),_0x137472['name']));this[_0x77da('0x31')][_0x77da('0x6e')](this,_0x4d1b95);return this[_0x77da('0x35')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x77da('0xe')]['set']=function(_0x14b748){logger[_0x77da('0x2b')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x14b748[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x14b748[_0x77da('0xd6')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x14b748,_0x77da('0x199'));}var _0x197471=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x14b748['variable_id']);if(!_0x197471){return this[_0x77da('0x35')][_0x77da('0x29')](_0x14b748,_0x77da('0xd9'));}return this[_0x77da('0x35')][_0x77da('0x9f')](_0x197471,_0x14b748['variable_value']);};AGIVertices['prototype']['start']=function(_0xf71007){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x19a'),_0xf71007[_0x77da('0xa9')]));this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x19b'));var _0x249e9c=this['channel']['getVariable'](_0x77da('0x19c'));if(!_['isEmpty'](_0x249e9c[_0x77da('0xa5')])){this[_0x77da('0x35')][_0x77da('0x33')]=_0x249e9c[_0x77da('0xa5')];}if(_0xf71007[_0x77da('0xb9')]===_0x77da('0x19d')){this[_0x77da('0x35')]['noop'](_0x77da('0x19e'));return this['channel']['answer']();}return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0x19f'));};AGIVertices[_0x77da('0xe')]['subproject']=function(_0x2ae94c){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x1a0'),_0x2ae94c[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x2ae94c['project_id'])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x2ae94c,_0x77da('0x1a1'));}var _0x4dd26a=this['getSquareProject'][_0x77da('0x6e')](this,_0x2ae94c[_0x77da('0x1a2')]);if(!this[_0x77da('0x86')](_0x4dd26a)){return this['channel'][_0x77da('0x29')](_0x2ae94c,util['format'](_0x77da('0x1a3'),_0x2ae94c[_0x77da('0x1a2')]));}if(_0x4dd26a===this[_0x77da('0x35')][_0x77da('0x36')]){return this[_0x77da('0x35')]['error'](_0x2ae94c,_0x77da('0x1a4'));}this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x2ae94c,_0x4dd26a);var _0x24b3e7=this[_0x77da('0x35')][_0x77da('0x52')](_0x77da('0x1a5'),util[_0x77da('0x26')](_0x77da('0x1a6'),config[_0x77da('0x6')][_0x77da('0x1a7')]||'127.0.0.1',_0x4dd26a,this[_0x77da('0x35')]['arg_1']));if(_0x24b3e7[_0x77da('0xac')]===-0x1){return _0x24b3e7;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x168'),'AGI',_0x4dd26a));};AGIVertices[_0x77da('0xe')][_0x77da('0x1a8')]=function(_0x4117e9){logger[_0x77da('0x2b')](util['format'](_0x77da('0x1a9'),_0x4117e9[_0x77da('0xa9')]));var _0x4738d7=this['shellCommand'][_0x77da('0x6e')](this,_0x4117e9[_0x77da('0xb8')]);this[_0x77da('0x32')][_0x77da('0x6e')](this,_0x4117e9,_0x4117e9['command']);if(this[_0x77da('0x86')](_0x4117e9[_0x77da('0xd6')])){var _0x32fd39=this[_0x77da('0xd8')][_0x77da('0x6e')](this,_0x4117e9['variable_id']);if(_0x32fd39){this[_0x77da('0x35')][_0x77da('0x9f')](_0x32fd39,_0x4738d7);return this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x1aa'),_0x4117e9[_0x77da('0xb8')],_0x32fd39));}}return this[_0x77da('0x35')]['noop'](util['format'](_0x77da('0x1ab'),_0x4117e9['command']));};AGIVertices[_0x77da('0xe')][_0x77da('0x1ac')]=function(_0x55b2b9){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x1ad'),_0x55b2b9['label']));_0x55b2b9['text']=_0x55b2b9[_0x77da('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x55b2b9[_0x77da('0x55')])){return this[_0x77da('0x35')]['noop'](_0x77da('0x1ae'));}if(!this[_0x77da('0x86')](_0x55b2b9[_0x77da('0x57')])){return this[_0x77da('0x35')][_0x77da('0xad')](_0x77da('0xaa'));}this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x1af'),_0x55b2b9['text']));var _0x332154=this[_0x77da('0x54')][_0x77da('0x6e')](this,_0x55b2b9);if(_0x332154){this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x1b0'),_0x332154));var _0x36aa3b=this['channel'][_0x77da('0xff')](_0x332154);try{fs[_0x77da('0x100')](_0x332154+'.wav');}catch(_0x247c8f){logger[_0x77da('0x29')](_0x247c8f);}return _0x36aa3b;}return this[_0x77da('0x35')][_0x77da('0x29')](_0x55b2b9,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x77da('0x1b1')]=function(_0x3fd6c6){logger['info'](util[_0x77da('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3fd6c6[_0x77da('0xa9')]));_0x3fd6c6[_0x77da('0x57')]=_0x3fd6c6['text'][_0x77da('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x77da('0x86')](_0x3fd6c6[_0x77da('0x57')])){return this[_0x77da('0x35')]['noop']('no\x20text\x20configured');}this[_0x77da('0x35')]['noop'](util[_0x77da('0x26')](_0x77da('0x1b2'),_0x3fd6c6['text']));var _0x4c305b=this[_0x77da('0x5d')]['sync'](this,_0x3fd6c6);if(_0x4c305b){this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x4c305b));var _0x5848c5=this['channel'][_0x77da('0xff')](_0x4c305b);try{fs[_0x77da('0x100')](_0x4c305b+_0x77da('0x101'));}catch(_0x2e80c9){logger[_0x77da('0x29')](_0x2e80c9);}return _0x5848c5;}return this['channel'][_0x77da('0x29')](_0x3fd6c6,_0x77da('0x1b3'));};AGIVertices[_0x77da('0xe')][_0x77da('0x1b4')]=function(_0x3960b3){logger[_0x77da('0x2b')](util['format'](_0x77da('0x1b5'),_0x3960b3[_0x77da('0xa9')]));if(!this['isConfigured'](_0x3960b3[_0x77da('0x151')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x3960b3,'no\x20find\x20by\x20configured');}logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x162'),this[_0x77da('0x35')]['callerid'],_0x3960b3['findBy']));var _0x1755d0=this[_0x77da('0x4c')][_0x77da('0x6e')](this,_0x3960b3[_0x77da('0x151')]);if(_0x1755d0){logger['info'](util[_0x77da('0x26')](_0x77da('0x152'),this[_0x77da('0x35')][_0x77da('0x37')],_0x3960b3[_0x77da('0x151')]));this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x152'),this[_0x77da('0x35')][_0x77da('0x37')],_0x3960b3[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x156')};}else{logger['info'](util[_0x77da('0x26')](_0x77da('0x157'),this['channel'][_0x77da('0x37')],_0x3960b3[_0x77da('0x151')]));this[_0x77da('0x35')][_0x77da('0xad')](util['format'](_0x77da('0x157'),this['channel']['callerid'],_0x3960b3[_0x77da('0x151')]));return{'code':0xc8,'result':_0x77da('0x153')};}};AGIVertices[_0x77da('0xe')][_0x77da('0x1b6')]=function(_0x40757d){logger[_0x77da('0x2b')](util[_0x77da('0x26')](_0x77da('0x1b7'),_0x40757d[_0x77da('0xa9')]));var _0x46d9f1=this['channel']['exec'](_0x77da('0x1b8'),[_0x40757d['mailbox'],_0x40757d[_0x77da('0x77')]]);if(_0x46d9f1['result']===-0x1){return _0x46d9f1;}return this[_0x77da('0x35')][_0x77da('0xad')](util[_0x77da('0x26')](_0x77da('0x168'),_0x77da('0x1b8'),_0x40757d[_0x77da('0x1b9')]));};AGIVertices[_0x77da('0xe')]['vswitch']=function(_0x3b3081){logger['info'](util['format'](_0x77da('0x1ba'),_0x3b3081[_0x77da('0xa9')]));if(!this[_0x77da('0x86')](_0x3b3081[_0x77da('0xd6')])){return this[_0x77da('0x35')][_0x77da('0x29')](_0x3b3081,_0x77da('0x199'));}var _0x444867=this['getVariable'][_0x77da('0x6e')](this,_0x3b3081[_0x77da('0xd6')]);if(!_0x444867){return this[_0x77da('0x35')][_0x77da('0x29')](_0x3b3081,_0x77da('0xd9'));}var _0x2c4902=this[_0x77da('0x35')][_0x77da('0xd8')](_0x444867);return{'code':0xc8,'result':_0x2c4902[_0x77da('0xa5')]?_0x2c4902[_0x77da('0xa5')]:'-'};};String[_0x77da('0xe')][_0x77da('0xa3')]=function(_0x4939a2,_0x38412a){return this[_0x77da('0xa2')](_0x4939a2)[_0x77da('0x1bb')](_0x38412a);};module['exports']=AGIVertices; \ No newline at end of file +var _0x6aa7=['agent','agentPause','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','restAPI','url','number','timeout','POST','PUT','method','parse','headers','rawHeaders','computedVariables','uri','render','body','stringify','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','key','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','saveRestApiResult','%s.%s','length','setVariable','split','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','createSquareDetailsReport','maxRetry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','scheduledAt','delay','sync','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','out','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','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','logout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','pause','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','statusCode','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','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','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','project_id','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','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','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','/var/opt/motion2/server/files','rawBody','menu','getdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getSquareProject','getSquareProjectById','name','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','interval','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','channel','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById'];(function(_0x3fbb62,_0x1c30b4){var _0x1e2f61=function(_0x2ab8fc){while(--_0x2ab8fc){_0x3fbb62['push'](_0x3fbb62['shift']());}};_0x1e2f61(++_0x1c30b4);}(_0x6aa7,0x178));var _0x76aa=function(_0x250ef3,_0x41f721){_0x250ef3=_0x250ef3-0x0;var _0x46ed4c=_0x6aa7[_0x250ef3];return _0x46ed4c;};'use strict';var fs=require('fs');var util=require(_0x76aa('0x0'));var _=require('lodash');var sh=require(_0x76aa('0x1'));var odbc=require(_0x76aa('0x2'))();var rs=require(_0x76aa('0x3'));var moment=require(_0x76aa('0x4'));var Mustache=require('mustache');var rp=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH=_0x76aa('0x8');var recursiveMapAttributes=['rawHeaders',_0x76aa('0x9')];var verticesWithRetry=[_0x76aa('0xa'),_0x76aa('0xb'),'getsecretdigits'];var AGIVertices=function(_0x3dae33,_0x266bd5,_0x3a3f36){this['channel']=_0x3dae33;this[_0x76aa('0xc')]=_0x266bd5;this[_0x76aa('0xd')]=_0x3a3f36;};AGIVertices[_0x76aa('0xe')][_0x76aa('0xf')]=function(_0x37f1ab,_0x128435){this[_0x76aa('0xc')][_0x76aa('0x10')](_0x37f1ab)[_0x76aa('0x11')](function(_0x17a417){_0x128435(null,_0x17a417?_0x17a417['name']:![]);})[_0x76aa('0x12')](function(_0x5df49c){_0x128435(_0x5df49c);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x13')]=function(_0x3f8f6b,_0x8e44ed){this[_0x76aa('0xc')]['getVoiceQueueById'](_0x3f8f6b)['then'](function(_0x2b3b4f){_0x8e44ed(null,_0x2b3b4f?_0x2b3b4f['name']:![]);})[_0x76aa('0x12')](function(_0x319bf1){_0x8e44ed(_0x319bf1);});};AGIVertices['prototype'][_0x76aa('0x14')]=function(_0x550d9a,_0x328381){this['rpc'][_0x76aa('0x15')](_0x550d9a)[_0x76aa('0x11')](function(_0x2ab30b){_0x328381(null,_0x2ab30b?_0x2ab30b[_0x76aa('0x16')]:![]);})[_0x76aa('0x12')](function(_0x3ead3f){_0x328381(_0x3ead3f);});};AGIVertices['prototype']['getSquareOdbc']=function(_0x256636,_0x454dd3){this[_0x76aa('0xc')][_0x76aa('0x17')](_0x256636)[_0x76aa('0x11')](function(_0x191560){_0x454dd3(null,_0x191560?_0x191560[_0x76aa('0x18')]:![]);})[_0x76aa('0x12')](function(_0x385157){_0x454dd3(_0x385157);});};AGIVertices['prototype'][_0x76aa('0x19')]=function(_0x21064c,_0x338a6b){this['rpc'][_0x76aa('0x1a')](_0x21064c)[_0x76aa('0x11')](function(_0x31252f){_0x338a6b(null,_0x31252f?_0x31252f[_0x76aa('0x16')]:![]);})[_0x76aa('0x12')](function(_0xc1044c){_0x338a6b(_0xc1044c);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1b')]=function(_0x32bf9f,_0x2cba6d){this[_0x76aa('0xc')][_0x76aa('0x1c')](_0x32bf9f)[_0x76aa('0x11')](function(_0x4ef9b0){_0x2cba6d(null,_0x4ef9b0?_0x4ef9b0[_0x76aa('0x16')]:![]);})[_0x76aa('0x12')](function(_0x25c614){_0x2cba6d(_0x25c614);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1d')]=function(_0x2f9316,_0x25a803){var _0x282d0a=this;this[_0x76aa('0xc')][_0x76aa('0x1e')](_0x2f9316)['then'](function(_0x3fcb7f){_0x25a803(null,_0x3fcb7f?_0x282d0a['getSoundPath'](_0x3fcb7f[_0x76aa('0x1f')]):![]);})[_0x76aa('0x12')](function(_0x2dec94){_0x25a803(_0x2dec94);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x20')]=function(_0x2d6213,_0x2ee0f9){this[_0x76aa('0xc')][_0x76aa('0x21')](_0x2d6213)[_0x76aa('0x11')](function(_0x5edcd8){_0x2ee0f9(null,_0x5edcd8?_0x5edcd8:![]);})[_0x76aa('0x12')](function(_0x5532c7){_0x2ee0f9(_0x5532c7);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x22')]=function(_0x458ac3,_0x38ecd1,_0x35a705){this['mailRpc'][_0x76aa('0x22')](_0x458ac3,_0x38ecd1)[_0x76aa('0x11')](function(){_0x35a705(null);})['catch'](function(_0x2ee338){_0x35a705(_0x2ee338);});};AGIVertices['prototype'][_0x76aa('0x23')]=function(_0x4c90b6,_0x8479a3){this['rpc']['getIntervalById'](_0x4c90b6)[_0x76aa('0x11')](function(_0x282c56){if(_0x282c56){if(_0x282c56[_0x76aa('0x24')]){_0x8479a3(null,[_0x282c56[_0x76aa('0x25')]]);}else{_0x8479a3(null,_['map'](_0x282c56['Intervals'],_0x76aa('0x25')));}}else{_0x8479a3(null,![]);}})[_0x76aa('0x12')](function(_0x58127c){_0x8479a3(_0x58127c);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x26')]=function(_0x5b57d8){return util[_0x76aa('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x5b57d8);};AGIVertices['prototype'][_0x76aa('0x28')]=function(_0x36d64e,_0x181216,_0x127bc4){odbc['open'](_0x36d64e,function(_0x401c07){if(_0x401c07){logger[_0x76aa('0x29')](_0x76aa('0x2a'),_0x401c07);_0x127bc4(_0x401c07);}else{logger['info'](_0x76aa('0x2b'));odbc[_0x76aa('0x2c')](_0x181216,function(_0x2f7726,_0x147c03){if(_0x2f7726){logger[_0x76aa('0x2d')](_0x76aa('0x2e'),_0x181216);_0x127bc4(_0x2f7726);}else{logger[_0x76aa('0x2d')](_0x76aa('0x2f'),_0x181216);odbc[_0x76aa('0x30')](function(_0x5f022a){if(_0x5f022a){logger[_0x76aa('0x29')](_0x76aa('0x31'),_0x5f022a);}_0x127bc4(null,_0x147c03);});}});}});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x32')]=function(_0x64612e,_0x2957aa){this['rpc']['getSmsAccountById'](_0x64612e)[_0x76aa('0x11')](function(_0x262906){_0x2957aa(null,_0x262906?_0x262906:![]);})[_0x76aa('0x12')](function(_0x365612){_0x2957aa(_0x365612);});};AGIVertices['prototype'][_0x76aa('0x33')]=function(_0x403084,_0x154567){this[_0x76aa('0xc')][_0x76aa('0x33')](_0x403084)['then'](function(_0x13dafe){_0x154567(null,_0x13dafe);})['catch'](function(_0xbb3136){_0x154567(_0xbb3136);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x4f7f3a,_0x144f0a,_0x541594){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x76aa('0x34')][_0x76aa('0x35')],'node':_0x4f7f3a[_0x76aa('0x36')],'application':_0x4f7f3a[_0x76aa('0x37')],'data':_0x144f0a||null,'project_name':this[_0x76aa('0x34')]['arg_1'],'callerid':this[_0x76aa('0x34')][_0x76aa('0x38')]})[_0x76aa('0x11')](function(_0x2d6b7f){if(_0x541594){_0x541594(null,_0x2d6b7f);}})[_0x76aa('0x12')](function(_0x47a308){if(_0x541594){_0x541594(_0x47a308);}});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x39')]=function(_0x5dc67e,_0x2d3441,_0x5a984e,_0x3aa858){this[_0x76aa('0xc')][_0x76aa('0x39')]({'uniqueid':this[_0x76aa('0x34')][_0x76aa('0x35')],'callerid':this[_0x76aa('0x34')][_0x76aa('0x38')],'calleridname':this[_0x76aa('0x34')][_0x76aa('0x3a')],'context':this[_0x76aa('0x34')]['context'],'extension':this[_0x76aa('0x34')]['extension'],'priority':this[_0x76aa('0x34')][_0x76aa('0x3b')],'accountcode':this[_0x76aa('0x34')][_0x76aa('0x3c')],'dnid':this['channel']['dnid'],'projectName':this[_0x76aa('0x34')]['arg_1'],'saveName':_0x2d3441,'filename':_0x5dc67e[_0x76aa('0x3d')]||_0x2d3441,'savePath':_0x5a984e})[_0x76aa('0x11')](function(_0x4315b3){_0x3aa858(null,_0x4315b3);})[_0x76aa('0x12')](function(_0x30c577){_0x3aa858(_0x30c577);});};AGIVertices[_0x76aa('0xe')]['createSquareMessage']=function(_0x564546,_0x2fcf8f,_0x1eafb2,_0x1708d4,_0x40e8ff){this[_0x76aa('0xc')][_0x76aa('0x3e')]({'uniqueid':this['channel'][_0x76aa('0x35')],'body':_0x564546,'direction':_0x2fcf8f,'providerName':_0x1eafb2,'providerResponse':_0x1708d4})[_0x76aa('0x11')](function(_0x26db69){if(_0x40e8ff){_0x40e8ff(null,_0x26db69);}})['catch'](function(_0x30d930){if(_0x40e8ff){_0x40e8ff(_0x30d930);}});};AGIVertices['prototype'][_0x76aa('0x3f')]=function(_0x5e1d84,_0x339b0d){this[_0x76aa('0xc')][_0x76aa('0x3f')]({'firstName':_[_0x76aa('0x40')](_0x5e1d84[_0x76aa('0x16')])||_[_0x76aa('0x41')](_0x5e1d84[_0x76aa('0x16')])?'callback_'+Math[_0x76aa('0x42')]():_0x5e1d84['name'],'lastName':_[_0x76aa('0x40')](_0x5e1d84[_0x76aa('0x43')])||_[_0x76aa('0x41')](_0x5e1d84[_0x76aa('0x43')])?null:_0x5e1d84[_0x76aa('0x43')],'phone':_0x5e1d84[_0x76aa('0x44')],'ListId':_0x5e1d84[_0x76aa('0x45')],'scheduledat':_0x5e1d84['scheduledAt'],'callbackUniqueid':this[_0x76aa('0x34')][_0x76aa('0x35')],'tags':_0x76aa('0x46'),'description':_0x76aa('0x47')+_0x5e1d84['scheduledAt'][_0x76aa('0x48')](),'priority':_0x5e1d84[_0x76aa('0x49')]})[_0x76aa('0x11')](function(_0x410933){_0x339b0d(null,_0x410933);})[_0x76aa('0x12')](function(_0xf7732){_0x339b0d(_0xf7732);});};AGIVertices['prototype'][_0x76aa('0x4a')]=function(_0xbf78c7,_0x2886eb){this[_0x76aa('0xc')][_0x76aa('0x4b')](_0xbf78c7)[_0x76aa('0x11')](function(_0x37babe){_0x2886eb(null,_0x37babe?_0x37babe['name']:![]);})['catch'](function(_0x2c59a6){_0x2886eb(_0x2c59a6);});};AGIVertices[_0x76aa('0xe')]['agentPause']=function(_0x3d7802,_0x1e6f3c,_0x4f832d){var _0x3354b6={'role':_0x76aa('0x4c')};_0x3354b6[_0x3d7802]=this[_0x76aa('0x34')][_0x76aa('0x38')];this[_0x76aa('0xc')][_0x76aa('0x4d')](_0x3354b6,_0x1e6f3c,this[_0x76aa('0x34')][_0x76aa('0x35')])[_0x76aa('0x11')](function(_0x57d778){_0x4f832d(null,_[_0x76aa('0x41')](_0x57d778)?![]:!![]);})['catch'](function(_0x40e746){logger[_0x76aa('0x29')](_0x40e746);_0x4f832d(null,![]);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x4e')]=function(_0x343cf1,_0x260ad2){var _0x18c4b8={'role':_0x76aa('0x4c')};_0x18c4b8[_0x343cf1]=this[_0x76aa('0x34')]['callerid'];this[_0x76aa('0xc')][_0x76aa('0x4e')](_0x18c4b8)[_0x76aa('0x11')](function(_0xe5957d){_0x260ad2(null,_[_0x76aa('0x41')](_0xe5957d)?![]:!![]);})[_0x76aa('0x12')](function(_0x3d6d10){logger[_0x76aa('0x29')](_0x3d6d10);_0x260ad2(null,![]);});};AGIVertices['prototype'][_0x76aa('0x4f')]=function(_0x4d3ad0,_0x35bd2b){var _0x35881c={'role':_0x76aa('0x4c')};_0x35881c[_0x4d3ad0]=this[_0x76aa('0x34')][_0x76aa('0x38')];this[_0x76aa('0xc')][_0x76aa('0x4f')](_0x35881c)['then'](function(_0x9ea0af){_0x35bd2b(null,_[_0x76aa('0x41')](_0x9ea0af)?![]:!![]);})['catch'](function(_0x54334b){logger[_0x76aa('0x29')](_0x54334b);_0x35bd2b(null,![]);});};AGIVertices[_0x76aa('0xe')]['agentLogin']=function(_0x21b99c,_0x35a21f){var _0x12aeee={'role':'agent'};_0x12aeee[_0x21b99c]=this[_0x76aa('0x34')]['callerid'];var _0xf31e1f=_0x21b99c!=_0x76aa('0x50')?util[_0x76aa('0x27')](_0x76aa('0x51'),'LOCAL',this['channel'][_0x76aa('0x38')]):undefined;this['rpc'][_0x76aa('0x52')](_0x12aeee,_0xf31e1f)[_0x76aa('0x11')](function(_0x368a95){_0x35a21f(null,_[_0x76aa('0x41')](_0x368a95)?![]:!![]);})[_0x76aa('0x12')](function(_0x30837c){logger[_0x76aa('0x29')](_0x30837c);_0x35a21f(null,![]);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x53')]=function(_0x54390f,_0x7d02e7){sh[_0x76aa('0x54')](_[_0x76aa('0x55')](_0x54390f),function(_0x45ae9f,_0x4eb2e7){var _0x4c0af4=_0x4eb2e7['replace'](/(\r\n|\n|\r)/gm,'');_0x7d02e7(null,_0x4c0af4);});};AGIVertices[_0x76aa('0xe')]['googleCloudTTS']=function(_0xb61e5,_0x256195){scripts[_0x76aa('0x56')](_0xb61e5[_0x76aa('0x57')],_0xb61e5['google_cloud_tts_text_type']||_0x76aa('0x58'),_0xb61e5['text'],_0xb61e5[_0x76aa('0x59')]||_0x76aa('0x5a'),_0xb61e5[_0x76aa('0x5b')]||_0x76aa('0x5c'),_0xb61e5[_0x76aa('0x5d')]||'MP3')[_0x76aa('0x11')](function(_0x13ae5d){_0x256195(null,_0x13ae5d);})[_0x76aa('0x12')](function(_0x3601d6){_0x256195(_0x3601d6);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x5e')]=function(_0x1d9c6e,_0x18c88a){scripts['googleTTS'](_0x1d9c6e[_0x76aa('0x58')],_0x1d9c6e[_0x76aa('0x5f')]||'en',0x1)['then'](function(_0x3c1b98){_0x18c88a(null,_0x3c1b98);})[_0x76aa('0x12')](function(_0x325487){_0x18c88a(_0x325487);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x60')]=function(_0x51b101,_0x2eaeb5){var _0x5dc923={'uri':_0x51b101[_0x76aa('0x61')],'method':_0x51b101['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x51b101['timeout'])===_0x76aa('0x62')&&parseInt(_0x51b101[_0x76aa('0x63')])>=0x1?parseInt(_0x51b101['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x76aa('0x64'),_0x76aa('0x65')],_0x5dc923[_0x76aa('0x66')]['toUpperCase']())){try{_0x5dc923['body']=_0x51b101[_0x76aa('0x9')]?JSON[_0x76aa('0x67')](_0x51b101[_0x76aa('0x9')]):{};}catch(_0x5d65ec){logger[_0x76aa('0x29')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5d65ec);}}try{_0x5dc923[_0x76aa('0x68')]=_0x51b101[_0x76aa('0x69')]?JSON[_0x76aa('0x67')](_0x51b101[_0x76aa('0x69')]):{};}catch(_0x1e539f){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1e539f);}if(_0x51b101[_0x76aa('0x6a')]){try{var _0x272a28=require(_0x51b101[_0x76aa('0x6a')])['sync'](this,_0x5dc923);_0x5dc923[_0x76aa('0x6b')]=Mustache[_0x76aa('0x6c')](_0x51b101[_0x76aa('0x61')],_0x272a28,{},['$$','$$']);if(_0x5dc923[_0x76aa('0x68')]){_0x5dc923[_0x76aa('0x68')]=JSON['parse'](Mustache[_0x76aa('0x6c')](JSON['stringify'](_0x5dc923[_0x76aa('0x68')]),_0x272a28,{},['$$','$$']));}if(_0x5dc923[_0x76aa('0x6d')]){_0x5dc923[_0x76aa('0x6d')]=JSON[_0x76aa('0x67')](Mustache[_0x76aa('0x6c')](JSON[_0x76aa('0x6e')](_0x5dc923['body']),_0x272a28,{},['$$','$$']));}}catch(_0x555682){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x555682);}}rp(_0x5dc923)['then'](function(_0x2203c3){var _0x22f44f={'statusCode':_0x2203c3['statusCode']||0xc8,'statusMessage':_0x2203c3['statusMessage']||'OK','headers':_0x2203c3['headers']||{},'body':_0x2203c3[_0x76aa('0x6d')]||{}};_0x2eaeb5(null,_0x22f44f);})[_0x76aa('0x12')](function(_0x161593){var _0x506a41={'statusCode':_0x161593['statusCode']||0x1f4,'statusMessage':_0x161593[_0x76aa('0x6f')]||_0x76aa('0x70'),'headers':_0x161593[_0x76aa('0x71')][_0x76aa('0x68')]||{},'body':_0x161593[_0x76aa('0x71')]['body']||{}};_0x2eaeb5(null,_0x506a41);});};AGIVertices['prototype'][_0x76aa('0x72')]=function(_0x5c18b4,_0x5d9381){scripts['googleDialogflow'](this[_0x76aa('0x34')][_0x76aa('0x35')],_0x5c18b4['key'],_0x5c18b4[_0x76aa('0x58')],_0x5c18b4[_0x76aa('0x73')]||'en')['then'](function(_0x22063f){_0x5d9381(null,_0x22063f);})[_0x76aa('0x12')](function(_0x11d91f){_0x5d9381(_0x11d91f);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x74')]=function(_0x458ab9,_0x1a8b6b){scripts[_0x76aa('0x74')](this[_0x76aa('0x34')]['uniqueid'],_0x458ab9[_0x76aa('0x75')],_0x458ab9[_0x76aa('0x76')],_0x458ab9['private_key'],_0x458ab9[_0x76aa('0x58')],_0x458ab9[_0x76aa('0x77')]||'en')[_0x76aa('0x11')](function(_0x5653b3){_0x1a8b6b(null,_0x5653b3);})[_0x76aa('0x12')](function(_0x1ae1ab){_0x1a8b6b(_0x1ae1ab);});};AGIVertices['prototype'][_0x76aa('0x78')]=function(_0x3320a2,_0x203b1f){scripts['sestekNDA'](this[_0x76aa('0x34')],_0x3320a2)[_0x76aa('0x11')](function(_0x50a51f){_0x203b1f(null,_0x50a51f);})['catch'](function(_0x5941a5){_0x203b1f(_0x5941a5);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x79')]=function(_0x10acb2,_0x16643e){scripts['ispeechTTS'](_0x10acb2['key'],_0x10acb2['text'],_0x10acb2[_0x76aa('0x7a')]||'en-US',_0x10acb2[_0x76aa('0x7b')])[_0x76aa('0x11')](function(_0x5f3c24){_0x16643e(null,_0x5f3c24);})[_0x76aa('0x12')](function(_0x33781c){_0x16643e(_0x33781c);});};AGIVertices['prototype'][_0x76aa('0x7c')]=function(_0x238832,_0x41200c,_0xb766ec){scripts[_0x76aa('0x7c')](_0x41200c,_0x238832[_0x76aa('0x7d')],_0x238832['ispeech_asr_language']||_0x76aa('0x5a'),this['isConfigured'](_0x238832['model'])?_0x238832['model']:undefined)['then'](function(_0x519359){_0xb766ec(null,_0x519359);})[_0x76aa('0x12')](function(_0x11f59f){_0xb766ec(_0x11f59f);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x7e')]=function(_0x47c0de,_0x447103){scripts[_0x76aa('0x7e')](_0x47c0de[_0x76aa('0x7f')],_0x47c0de[_0x76aa('0x80')],_0x47c0de[_0x76aa('0x81')],_0x47c0de['aws_polly_voice']||_0x76aa('0x82'),_0x47c0de[_0x76aa('0x58')],_0x47c0de[_0x76aa('0x83')]||_0x76aa('0x58'))[_0x76aa('0x11')](function(_0x40f4a3){_0x447103(null,_0x40f4a3);})[_0x76aa('0x12')](function(_0x5aef82){_0x447103(_0x5aef82);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x84')]=function(_0x537917,_0x5c523b){scripts[_0x76aa('0x84')](this[_0x76aa('0x34')]['uniqueid'],_0x537917[_0x76aa('0x7f')],_0x537917['aws_secret_access_key'],_0x537917[_0x76aa('0x85')],_0x537917['text'],_0x537917[_0x76aa('0x86')])[_0x76aa('0x11')](function(_0x45227e){_0x5c523b(null,_0x45227e);})[_0x76aa('0x12')](function(_0x3d392d){_0x5c523b(_0x3d392d);});};AGIVertices['prototype'][_0x76aa('0x87')]=function(_0x54bfd7,_0x1af32e,_0x9b5fbb){scripts['googleASR'](_0x1af32e,_0x54bfd7['key'],_0x54bfd7[_0x76aa('0x88')]||_0x76aa('0x5a'))[_0x76aa('0x11')](function(_0x238818){_0x9b5fbb(null,_0x238818);})['catch'](function(_0x5a1577){_0x9b5fbb(_0x5a1577);});};AGIVertices[_0x76aa('0xe')]['tildeASR']=function(_0x3c928d,_0x5d18f8,_0x45b761){scripts[_0x76aa('0x89')](_0x5d18f8,_0x3c928d['appid'],_0x3c928d[_0x76aa('0x8a')],_0x3c928d['uri'])['then'](function(_0x32fe97){_0x45b761(null,_0x32fe97);})[_0x76aa('0x12')](function(_0x517096){_0x45b761(_0x517096);});};AGIVertices[_0x76aa('0xe')][_0x76aa('0x8b')]=function(_0x12cd19){var _0x52762c=_[_0x76aa('0x8c')](verticesWithRetry,_0x12cd19[_0x76aa('0x37')])?_0x12cd19:_[_0x76aa('0x8d')](_0x12cd19);for(var _0x1fc2f2 in _0x52762c){if(_0x52762c[_0x76aa('0x8e')](_0x1fc2f2)){if(_0x52762c[_0x1fc2f2]&&_[_0x76aa('0x8f')](_0x52762c[_0x1fc2f2])){if(_[_0x76aa('0x8c')](recursiveMapAttributes,_0x1fc2f2)){_0x52762c[_0x1fc2f2]=this[_0x76aa('0x90')](_0x52762c[_0x1fc2f2]);}else{_0x52762c[_0x1fc2f2]=this[_0x76aa('0x91')](_0x52762c[_0x1fc2f2]);}}}}return _0x52762c;};AGIVertices[_0x76aa('0xe')][_0x76aa('0x92')]=function(_0x3d21e4){for(var _0x488150 in _0x3d21e4){if(_0x3d21e4[_0x76aa('0x8e')](_0x488150)){if(_[_0x76aa('0x93')](_0x3d21e4[_0x488150])){this['recursiveNodeIndex'](_0x3d21e4[_0x488150]);}else if(_[_0x76aa('0x94')](_0x3d21e4[_0x488150])){for(var _0x1d165c=0x0;_0x1d165c<_0x3d21e4[_0x488150]['length'];_0x1d165c++){this['recursiveNodeIndex'](_0x3d21e4[_0x488150][_0x1d165c]);}}else if(_[_0x76aa('0x8f')](_0x3d21e4[_0x488150])){_0x3d21e4[_0x488150]=this[_0x76aa('0x91')](_0x3d21e4[_0x488150]);}}}};AGIVertices['prototype'][_0x76aa('0x95')]=function(_0x429500,_0x24af48){for(var _0x5010c8 in _0x429500){if(_0x429500[_0x76aa('0x8e')](_0x5010c8)){if(_[_0x76aa('0x93')](_0x429500[_0x5010c8])){if(!_['isEmpty'](_0x429500[_0x5010c8])){this[_0x76aa('0x95')](_0x429500[_0x5010c8],util[_0x76aa('0x27')](_0x76aa('0x96'),_0x24af48,_0x5010c8));}}else if(_[_0x76aa('0x94')](_0x429500[_0x5010c8])){for(var _0x2f7f2a=0x0;_0x2f7f2a<_0x429500[_0x5010c8][_0x76aa('0x97')];_0x2f7f2a++){this['saveRestApiResult'](_0x429500[_0x5010c8][_0x2f7f2a],util[_0x76aa('0x27')]('%s.%s',_0x24af48,_0x5010c8+'['+_0x2f7f2a+']'));}}else{if(!_[_0x76aa('0x41')](_0x429500[_0x5010c8])){this[_0x76aa('0x34')][_0x76aa('0x98')](util['format']('%s.%s',_0x24af48,_0x5010c8),_0x429500[_0x5010c8]);}}}}};AGIVertices[_0x76aa('0xe')][_0x76aa('0x90')]=function(_0x19982e){try{var _0xa6fd62=JSON[_0x76aa('0x67')](_0x19982e);this[_0x76aa('0x92')](_0xa6fd62);return JSON['stringify'](_0xa6fd62);}catch(_0x5a4c03){return this[_0x76aa('0x91')](_0x19982e);}};AGIVertices[_0x76aa('0xe')][_0x76aa('0x91')]=function(_0x46614f){var _0x507d7f=_0x46614f[_0x76aa('0x99')]('{');for(var _0x5a6d82=0x1;_0x5a6d82<_0x507d7f['length'];_0x5a6d82+=0x1){var _0x4bc8e3=_0x507d7f[_0x5a6d82][_0x76aa('0x99')]('}');if(_0x4bc8e3[_0x76aa('0x97')]>0x1){_0x46614f=_0x46614f['replaceAll']('{'+_0x4bc8e3[0x0]+'}',this[_0x76aa('0x34')][_0x76aa('0xf')](_0x4bc8e3[0x0])[_0x76aa('0x9a')]||_0x4bc8e3[0x0]);}}if(_0x507d7f[_0x76aa('0x97')]===0x1){return _0x46614f[_0x76aa('0x48')]();}return this[_0x76aa('0x91')](_0x46614f);};AGIVertices[_0x76aa('0xe')]['getAndSetVariable']=function(_0x344ea4,_0x2a3bbf){var _0x212adb=this[_0x76aa('0x34')][_0x76aa('0xf')](_0x344ea4);if(_0x212adb[_0x76aa('0x9b')]===-0x1){return _0x212adb;}logger['info'](util[_0x76aa('0x27')](_0x76aa('0x9c'),_0x2a3bbf,_0x212adb[_0x76aa('0x9a')]));return this[_0x76aa('0x34')]['setVariable'](_0x2a3bbf,_0x212adb[_0x76aa('0x9a')]);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x9d')]=function(_0x3e837d){return _0x3e837d&&_0x3e837d!=='0'&&_0x3e837d!=='-1'&&_0x3e837d!=='';};AGIVertices[_0x76aa('0xe')]['maxRetry']=function(_0x203bc2){this[_0x76aa('0x9e')]['sync'](this,_0x203bc2,'-');_0x203bc2['retry']=_0x203bc2[_0x76aa('0x9f')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x76aa('0xe')][_0x76aa('0xa0')]=function(_0x461075){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x461075[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x461075[_0x76aa('0x58')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xa2'));}var _0x59c946='\x22'+_0x461075[_0x76aa('0x58')]+'\x22';if(this[_0x76aa('0x9d')](_0x461075[_0x76aa('0x71')])){_0x59c946+=','+_0x461075[_0x76aa('0x71')];}var _0x42d71d=this[_0x76aa('0x34')]['exec'](_0x76aa('0xa3'),_0x59c946);if(_0x42d71d['result']===-0x1){return _0x42d71d;}return this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0xa4'),_0x59c946));};AGIVertices['prototype'][_0x76aa('0xa5')]=function(_0x85a254){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0xa6'),_0x85a254[_0x76aa('0x36')]));if(!this['isConfigured'](_0x85a254[_0x76aa('0xa7')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xa8'));}var _0x3b9ed5=_0x85a254[_0x76aa('0xa7')];if(this['isConfigured'](_0x85a254[_0x76aa('0x71')])){_0x3b9ed5+=','+_0x85a254[_0x76aa('0x71')];}var _0x3de02b=this[_0x76aa('0x34')][_0x76aa('0x54')](_0x76aa('0xa9'),_0x3b9ed5);if(_0x3de02b[_0x76aa('0x9b')]===-0x1){return _0x3de02b;}var _0x6962da=this[_0x76aa('0xaa')](_0x76aa('0xab'),_0x76aa('0xac'));if(_0x6962da['result']===-0x1){return _0x6962da;}var _0x219e47=this[_0x76aa('0xaa')](_0x76aa('0xad'),_0x76aa('0xae'));if(_0x219e47[_0x76aa('0x9b')]===-0x1){return _0x219e47;}var _0x81b7ea=this[_0x76aa('0xaa')](_0x76aa('0xaf'),'MRCP_RECOG_INSTANCE');if(_0x81b7ea[_0x76aa('0x9b')]===-0x1){return _0x81b7ea;}return this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xb0'),_0x3b9ed5));};AGIVertices['prototype'][_0x76aa('0x7')]=function(_0x41316b){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xb1'),_0x41316b['label']));return this[_0x76aa('0x34')]['agi']([_0x41316b[_0x76aa('0xb2')],_0x41316b[_0x76aa('0xb3')]]);};AGIVertices['prototype'][_0x76aa('0xb4')]=function(_0x20fb0a){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xb5'),_0x20fb0a[_0x76aa('0x36')]));if(this[_0x76aa('0x9d')](_0x20fb0a[_0x76aa('0x63')])){logger['info'](util[_0x76aa('0x27')](_0x76aa('0xb6'),_0x20fb0a[_0x76aa('0x63')]));var _0x2be7da=this[_0x76aa('0x34')][_0x76aa('0xb7')](_0x20fb0a[_0x76aa('0x63')]);if(_0x2be7da[_0x76aa('0x9b')]===-0x1){return _0x2be7da;}}return this['channel'][_0x76aa('0xb4')]();};AGIVertices[_0x76aa('0xe')][_0x76aa('0x46')]=function(_0x54e450){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xb8'),_0x54e450[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x54e450['list_id'])){return this[_0x76aa('0x34')]['error'](_0x54e450,_0x76aa('0xb9'));}_0x54e450[_0x76aa('0xba')]=moment();if(this[_0x76aa('0x9d')](_0x54e450[_0x76aa('0xbb')])){_0x54e450[_0x76aa('0xba')]=moment()['add'](_0x54e450[_0x76aa('0xbb')],'minutes');}if(!this[_0x76aa('0x9d')](_0x54e450[_0x76aa('0x49')])){_0x54e450[_0x76aa('0x49')]=0x2;}this['createCmContact'][_0x76aa('0xbc')](this,_0x54e450);return this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xbd'),_0x54e450[_0x76aa('0x44')],_0x54e450[_0x76aa('0x45')],_0x54e450[_0x76aa('0xba')]));};AGIVertices['prototype'][_0x76aa('0xbe')]=function(_0x195e95){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xbf'),_0x195e95[_0x76aa('0x36')]));var _0xbfa5f8=this[_0x76aa('0x34')][_0x76aa('0x54')](_0x195e95[_0x76aa('0xc0')],_0x195e95[_0x76aa('0x71')]);if(_0xbfa5f8[_0x76aa('0x9b')]===-0x1){return _0xbfa5f8;}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xc1'),_0x195e95[_0x76aa('0xc0')],_0x195e95[_0x76aa('0x71')]));};AGIVertices['prototype'][_0x76aa('0xc2')]=function(_0x4a9fd7){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x4a9fd7[_0x76aa('0x36')]));if(!this['isConfigured'](_0x4a9fd7[_0x76aa('0x58')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20text\x20configured');}var _0x2e6093='\x22'+_0x4a9fd7['text']+'\x22';if(this['isConfigured'](_0x4a9fd7[_0x76aa('0x71')])){_0x2e6093+=','+_0x4a9fd7['options'];}var _0x85012d=this['channel']['exec'](_0x76aa('0xa3'),_0x2e6093);if(_0x85012d[_0x76aa('0x9b')]===-0x1){return _0x85012d;}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xa4'),_0x2e6093));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xc3')]=function(_0x334615){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xc4'),_0x334615[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x334615['text'])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xa2'));}var _0x1fe2c7='\x22'+_0x334615['text']+'\x22';if(this[_0x76aa('0x9d')](_0x334615['options'])){_0x1fe2c7+=','+_0x334615[_0x76aa('0x71')];}var _0x4dc018=this[_0x76aa('0x34')]['exec'](_0x76aa('0xa3'),_0x1fe2c7);if(_0x4dc018['result']===-0x1){return _0x4dc018;}return this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0xa4'),_0x1fe2c7));};AGIVertices['prototype'][_0x76aa('0xc5')]=function(_0x51feca){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0xc6'),_0x51feca['label']));if(!this['isConfigured'](_0x51feca[_0x76aa('0xa7')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xa8'));}var _0x1f56f6=_0x51feca[_0x76aa('0xa7')];if(this[_0x76aa('0x9d')](_0x51feca[_0x76aa('0x71')])){_0x1f56f6+=','+_0x51feca[_0x76aa('0x71')];}var _0xca1831=this['channel'][_0x76aa('0x54')](_0x76aa('0xa9'),_0x1f56f6);if(_0xca1831[_0x76aa('0x9b')]===-0x1){return _0xca1831;}var _0x7121d6=this[_0x76aa('0xaa')](_0x76aa('0xab'),_0x76aa('0xc7'));if(_0x7121d6[_0x76aa('0x9b')]===-0x1){return _0x7121d6;}var _0x1cb8ad=this[_0x76aa('0xaa')](_0x76aa('0xad'),_0x76aa('0xc8'));if(_0x1cb8ad[_0x76aa('0x9b')]===-0x1){return _0x1cb8ad;}var _0x1d4f1c=this['getAndSetVariable']('RECOG_INSTANCE()',_0x76aa('0xc9'));if(_0x1d4f1c[_0x76aa('0x9b')]===-0x1){return _0x1d4f1c;}return this[_0x76aa('0x34')]['noop'](util['format'](_0x76aa('0xb0'),_0x1f56f6));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xca')]=function(_0x580390){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x580390['label']));if(!this['isConfigured'](_0x580390[_0x76aa('0xa7')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20grammar\x20configured');}var _0x21ec5a=_0x580390[_0x76aa('0xa7')];if(this['isConfigured'](_0x580390['options'])){_0x21ec5a+=','+_0x580390[_0x76aa('0x71')];}var _0x31d0a4=this[_0x76aa('0x34')]['exec'](_0x76aa('0xa9'),_0x21ec5a);if(_0x31d0a4[_0x76aa('0x9b')]===-0x1){return _0x31d0a4;}var _0x546770=this[_0x76aa('0xaa')](_0x76aa('0xab'),'SESTEK_ASR_CONFIDENCE');if(_0x546770[_0x76aa('0x9b')]===-0x1){return _0x546770;}var _0x347211=this['getAndSetVariable'](_0x76aa('0xad'),'SESTEK_ASR_TRANSCRIPT');if(_0x347211['result']===-0x1){return _0x347211;}var _0x159215=this[_0x76aa('0xaa')](_0x76aa('0xaf'),_0x76aa('0xcb'));if(_0x159215[_0x76aa('0x9b')]===-0x1){return _0x159215;}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xb0'),_0x21ec5a));};AGIVertices[_0x76aa('0xe')]['database']=function(_0x539e4d){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xcc'),_0x539e4d[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x539e4d[_0x76aa('0xcd')])){return this['channel'][_0x76aa('0x29')](_0x539e4d,_0x76aa('0xce'));}var _0x17f15e=this[_0x76aa('0xcf')][_0x76aa('0xbc')](this,_0x539e4d[_0x76aa('0xcd')]);if(!_0x17f15e){return this[_0x76aa('0x34')]['error'](_0x539e4d,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x539e4d[_0x76aa('0x2c')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x539e4d,_0x76aa('0xd0'));}var _0x25188a=_0x539e4d['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xd1'),_0x25188a));var _0xe6e51a=this['getQueryOdbc'][_0x76aa('0xbc')](this,_0x17f15e,_0x25188a);this['createSquareDetailsReport'][_0x76aa('0xbc')](this,_0x539e4d,_0x25188a);if(!this['isConfigured'](_0x539e4d['variable_id'])){return this[_0x76aa('0x34')]['noop'](_0x76aa('0xd2'));}var _0x419c5c=this[_0x76aa('0xf')][_0x76aa('0xbc')](this,_0x539e4d[_0x76aa('0xd3')]);if(!_0x419c5c){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x539e4d,_0x76aa('0xd4'));}var _0x5db468=this;_0xe6e51a[_0x76aa('0xd5')](function(_0x37fba1,_0x3ab5c6){Object[_0x76aa('0xd6')](_0x37fba1)[_0x76aa('0xd5')](function(_0x4e9063){_0x5db468[_0x76aa('0x34')]['setVariable'](util[_0x76aa('0x27')]('%s[%s][%s]',_0x419c5c,_0x3ab5c6,_0x4e9063),_0x37fba1[_0x4e9063]);});});this[_0x76aa('0x34')]['setVariable'](util[_0x76aa('0x27')]('%s_ROWS_COUNT',_0x419c5c),_0xe6e51a[_0x76aa('0x97')]);return this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format']('variable\x20%s\x20set',_0x419c5c));};AGIVertices[_0x76aa('0xe')]['dial']=function(_0x36c7ff){logger[_0x76aa('0xd7')](util[_0x76aa('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x36c7ff['label']));if(!this['isConfigured'](_0x36c7ff['sip_id'])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x36c7ff,_0x76aa('0xd8'));}var _0x1ef07e=this[_0x76aa('0x19')][_0x76aa('0xbc')](this,_0x36c7ff[_0x76aa('0xd9')]);if(!_0x1ef07e){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x36c7ff,_0x76aa('0xda'));}var _0x2484fd=this[_0x76aa('0x34')][_0x76aa('0x54')]('DIAL',[util[_0x76aa('0x27')]('SIP/%s',_0x1ef07e),_0x36c7ff[_0x76aa('0x63')],_0x36c7ff[_0x76aa('0xdb')],_0x36c7ff[_0x76aa('0x61')]]);if(_0x2484fd[_0x76aa('0x9b')]===-0x1){return _0x2484fd;}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xdc'),_0x76aa('0xdd')));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xde')]=function(_0x50f9a4){logger['info'](util[_0x76aa('0x27')](_0x76aa('0xdf'),_0x50f9a4['label']));if(!this[_0x76aa('0x9d')](_0x50f9a4[_0x76aa('0x7d')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xe0'));}if(!this[_0x76aa('0x9d')](_0x50f9a4[_0x76aa('0x58')])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xa2'));}this['channel']['bot']=!![];this[_0x76aa('0x9e')](_0x50f9a4);this[_0x76aa('0x3e')](_0x50f9a4[_0x76aa('0x58')],'in','','');this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xe1'),_0x50f9a4[_0x76aa('0x58')]));var _0x3b6241=this[_0x76aa('0x72')][_0x76aa('0xbc')](this,_0x50f9a4);if(_0x3b6241){for(var _0x1cf023 in _0x3b6241){if(_0x3b6241[_0x76aa('0x8e')](_0x1cf023)){this['channel']['setVariable'](util[_0x76aa('0x27')](_0x76aa('0xe2'),_0x1cf023[_0x76aa('0xe3')]()),_0x3b6241[_0x1cf023]);}}this[_0x76aa('0x3e')](_0x3b6241['speech'],'out',_0x76aa('0xde'),'');return this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format']('Dialogflow\x20Result\x20%s',_0x3b6241['speech']));}return this[_0x76aa('0x34')]['error'](_0x50f9a4,_0x76aa('0xe4'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xe5')]=function(_0x22f2cd){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0xe6'),_0x22f2cd[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x22f2cd[_0x76aa('0x75')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xe7'));}if(!this[_0x76aa('0x9d')](_0x22f2cd[_0x76aa('0x76')])){return this[_0x76aa('0x34')]['noop'](_0x76aa('0xe8'));}if(!this['isConfigured'](_0x22f2cd[_0x76aa('0xe9')])){return this['channel'][_0x76aa('0xa1')]('no\x20private_key\x20configured');}if(!this[_0x76aa('0x9d')](_0x22f2cd['dialogflowV2_language'])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xea'));}if(!this[_0x76aa('0x9d')](_0x22f2cd[_0x76aa('0x58')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20text\x20configured');}this[_0x76aa('0x34')][_0x76aa('0xeb')]=!![];this[_0x76aa('0x9e')](_0x22f2cd);this[_0x76aa('0x3e')](_0x22f2cd['text'],'in','','');this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xec'),_0x22f2cd[_0x76aa('0x58')]));var _0x106e9a=this[_0x76aa('0x74')][_0x76aa('0xbc')](this,_0x22f2cd);if(_0x106e9a){for(var _0x364dcf in _0x106e9a){if(_0x106e9a[_0x76aa('0x8e')](_0x364dcf)){if(_0x364dcf!==_0x76aa('0xed')){this[_0x76aa('0x34')]['setVariable'](util['format'](_0x76aa('0xe2'),_0x364dcf[_0x76aa('0xe3')]()),_0x106e9a[_0x364dcf]);}}}this[_0x76aa('0x3e')](_0x106e9a[_0x76aa('0xee')],_0x76aa('0xef'),_0x76aa('0xe5'),_0x106e9a[_0x76aa('0xed')]);return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xf0'),_0x106e9a['speech']));}return this[_0x76aa('0x34')]['error'](_0x22f2cd,_0x76aa('0xf1'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xf2')]=function(_0x14256c){logger[_0x76aa('0x2d')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x14256c[_0x76aa('0x36')]));if(!this['isConfigured'](_0x14256c[_0x76aa('0xf3')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xf4'));}if(!this[_0x76aa('0x9d')](_0x14256c['username'])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xf5'));}if(!this[_0x76aa('0x9d')](_0x14256c[_0x76aa('0xf6')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xf7'));}if(!this[_0x76aa('0x9d')](_0x14256c[_0x76aa('0xf8')])){return this[_0x76aa('0x34')]['noop'](_0x76aa('0xa2'));}this[_0x76aa('0x34')]['bot']=!![];this[_0x76aa('0x9e')](_0x14256c);this[_0x76aa('0x3e')](_0x14256c[_0x76aa('0x58')],'in','','');this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xf9'),_0x14256c['text']));var _0x3c2089=this[_0x76aa('0x78')][_0x76aa('0xbc')](this,_0x14256c);if(_0x3c2089){for(var _0x2f2a27 in _0x3c2089){if(_0x3c2089['hasOwnProperty'](_0x2f2a27)){this[_0x76aa('0x34')][_0x76aa('0x98')](util[_0x76aa('0x27')](_0x76aa('0xfa'),_0x2f2a27[_0x76aa('0xe3')]()),_0x3c2089[_0x2f2a27]);}}this[_0x76aa('0x3e')](_0x3c2089[_0x76aa('0xee')],_0x76aa('0xef'),_0x76aa('0xf2'),'');if(_0x3c2089[_0x76aa('0xfb')]){this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xfc'),_0x3c2089['audiofile']));var _0x52bea1=this[_0x76aa('0x34')][_0x76aa('0xfd')](_0x3c2089['audiofile']);try{fs[_0x76aa('0xfe')](_0x3c2089['audiofile']+_0x76aa('0xff'));}catch(_0x2e9c1a){logger[_0x76aa('0x29')](_0x2e9c1a);}return _0x52bea1;}else{return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x100'),_0x3c2089[_0x76aa('0xee')]));}}return this['channel'][_0x76aa('0x29')](_0x14256c,_0x76aa('0x101'));};AGIVertices['prototype']['end']=function(_0x19cf37){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x102'),_0x19cf37[_0x76aa('0x36')]));return this['channel'][_0x76aa('0xa1')]('end');};AGIVertices[_0x76aa('0xe')][_0x76aa('0x103')]=function(_0x33e5f0){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x104'),_0x33e5f0[_0x76aa('0x36')]));var _0x3ce540='';if(_0x33e5f0[_0x76aa('0x105')]){if(!this[_0x76aa('0x9d')](_0x33e5f0[_0x76aa('0x105')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x33e5f0,'no\x20trunk\x20selected');}else{var _0x4236bb=parseInt(_0x33e5f0['trunk_id'],0xa);if(isNaN(_0x4236bb)){_0x3ce540=_0x33e5f0['trunk_id'];}else{_0x3ce540=this['getTrunk'][_0x76aa('0xbc')](this,_0x33e5f0['trunk_id']);if(!_0x3ce540){return this['channel']['error'](_0x33e5f0,'no\x20trunk\x20found');}}}}else if(_0x33e5f0[_0x76aa('0x106')]){_0x3ce540=_0x33e5f0[_0x76aa('0x106')];}else{return this['channel'][_0x76aa('0x29')](_0x33e5f0,_0x76aa('0x107'));}var _0x70ce1=this['channel']['exec']('DIAL',[util[_0x76aa('0x27')]('SIP/%s/%s',_0x3ce540,_0x33e5f0[_0x76aa('0x44')]),_0x33e5f0[_0x76aa('0x63')],_0x33e5f0['opts'],_0x33e5f0[_0x76aa('0x61')]]);if(_0x70ce1[_0x76aa('0x9b')]===-0x1){return _0x70ce1;}return this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0xdc'),_0x76aa('0xdd')));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x108')]=function(_0x26c6c8){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x109'),_0x26c6c8[_0x76aa('0x36')]));return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x108'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0xb')]=function(_0x3271a5){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3271a5[_0x76aa('0x36')]));if(_0x3271a5[_0x76aa('0x10a')]===0x0){return this[_0x76aa('0x9f')](_0x3271a5);}_0x3271a5['retry']-=0x1;if(!this['isConfigured'](_0x3271a5['file_id'])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x3271a5,'no\x20file\x20audio\x20selected');}var _0x1fb2ad=this['getSound']['sync'](this,_0x3271a5[_0x76aa('0x10b')]);if(!_0x1fb2ad){return this[_0x76aa('0x34')]['error'](_0x3271a5,_0x76aa('0x10c'));}if(!this[_0x76aa('0x9d')](_0x3271a5[_0x76aa('0xd3')])){return this['channel'][_0x76aa('0x29')](_0x76aa('0xd2'));}var _0x44ed9a=this[_0x76aa('0x34')][_0x76aa('0x10d')](_0x1fb2ad,_0x3271a5[_0x76aa('0x10e')],_0x3271a5[_0x76aa('0x10f')]);var _0x29edc7=_0x44ed9a[_0x76aa('0x9b')]?_0x44ed9a[_0x76aa('0x9b')][_0x76aa('0x48')]():'';logger['info'](_0x76aa('0x110'),JSON[_0x76aa('0x6e')](_0x44ed9a));if(_0x44ed9a[_0x76aa('0x9b')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x3271a5,_0x29edc7);return _0x44ed9a;}else if(_0x44ed9a[_0x76aa('0x9a')]===_0x76aa('0x63')){_0x44ed9a[_0x76aa('0x9b')]=_0x29edc7['length']>=parseInt(_0x3271a5[_0x76aa('0x111')])?'x':'i';}else{_0x44ed9a[_0x76aa('0x9b')]=_0x29edc7[_0x76aa('0x97')]>=parseInt(_0x3271a5[_0x76aa('0x111')])&&_0x29edc7[_0x76aa('0x97')]<=parseInt(_0x3271a5[_0x76aa('0x10f')])?'x':'i';}var _0x353fef=this[_0x76aa('0xf')][_0x76aa('0xbc')](this,_0x3271a5[_0x76aa('0xd3')]);if(!_0x353fef){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x3271a5,_0x76aa('0xd4'));}this[_0x76aa('0x34')]['setVariable'](_0x353fef,_0x29edc7);if(this[_0x76aa('0x9d')](_0x3271a5['hiddendigitsnum'])){var _0xe9987d=parseInt(_0x3271a5['hiddendigitsnum'],0xa);var _0x452a57=rs[_0x76aa('0x112')]({'charset':'*','length':_0xe9987d});var _0x1420c4=_0x29edc7['length'];if(_0x1420c4>0x0){if(_0x1420c4>_0xe9987d){this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x3271a5,_0x3271a5[_0x76aa('0x113')]===_0x76aa('0x114')?_0x452a57+_0x29edc7[_0x76aa('0x115')](_0xe9987d):_0x29edc7[_0x76aa('0x115')](0x0,_0x1420c4-_0xe9987d)+_0x452a57);}else{this['createSquareDetailsReport']['sync'](this,_0x3271a5,rs[_0x76aa('0x112')]({'charset':'*','length':_0x1420c4}));}}else{this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x3271a5,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x3271a5,_0x29edc7);}return _0x44ed9a;};AGIVertices[_0x76aa('0xe')][_0x76aa('0x116')]=function(_0x1fdbca){logger['info'](util['format'](_0x76aa('0x117'),_0x1fdbca[_0x76aa('0x36')]));return this[_0x76aa('0xb')](_0x1fdbca);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x118')]=function(_0x2ebf47){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x2ebf47[_0x76aa('0x36')]));this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x2ebf47,_0x2ebf47['goalname']);return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('GOAL\x20%s',_0x2ebf47['goalname']));};AGIVertices[_0x76aa('0xe')]['awspolly']=function(_0x405c3a){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x119'),_0x405c3a['label']));if(!this['isConfigured'](_0x405c3a[_0x76aa('0x7f')])||!this[_0x76aa('0x9d')](_0x405c3a[_0x76aa('0x80')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x11a'));}if(!this['isConfigured'](_0x405c3a[_0x76aa('0x58')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20text\x20configured');}this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x405c3a[_0x76aa('0x58')]));var _0x547766=this['awsPolly'][_0x76aa('0xbc')](this,_0x405c3a);if(_0x547766){this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format'](_0x76aa('0x11b'),_0x547766));var _0x4b198e=this[_0x76aa('0x34')][_0x76aa('0xfd')](_0x547766);try{fs['unlink'](_0x547766+_0x76aa('0xff'));}catch(_0x4806d5){logger['error'](_0x4806d5);}return _0x4b198e;}return this['channel'][_0x76aa('0x29')](_0x405c3a,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x76aa('0xe')]['awslex']=function(_0x51d54c){logger[_0x76aa('0x2d')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x51d54c[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x51d54c[_0x76aa('0x7f')])||!this[_0x76aa('0x9d')](_0x51d54c[_0x76aa('0x80')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x51d54c[_0x76aa('0x86')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x11c'));}if(!this[_0x76aa('0x9d')](_0x51d54c[_0x76aa('0x58')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xa2'));}this['channel']['bot']=!![];this[_0x76aa('0x9e')](_0x51d54c);this[_0x76aa('0x3e')](_0x51d54c[_0x76aa('0x58')],'in','','');this[_0x76aa('0x34')]['noop'](util['format'](_0x76aa('0x11d'),_0x51d54c['text']));var _0x28c627=this[_0x76aa('0x84')]['sync'](this,_0x51d54c);if(_0x28c627){for(var _0x71483 in _0x28c627){if(_0x28c627[_0x76aa('0x8e')](_0x71483)&&_[_0x76aa('0x8f')](_0x28c627[_0x71483])){this[_0x76aa('0x34')][_0x76aa('0x98')](util['format'](_0x76aa('0x11e'),_0x71483[_0x76aa('0xe3')]()),_0x28c627[_0x71483]);}}if(_['isNil'](_0x28c627['message'])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x11f'));}else{this[_0x76aa('0x3e')](_0x28c627[_0x76aa('0x6f')],_0x76aa('0xef'),_0x76aa('0x120'),'');return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x121'),_0x28c627['message']));}}return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x51d54c,_0x76aa('0x122'));};AGIVertices[_0x76aa('0xe')]['googleasr']=function(_0x5392a3){logger['info'](util['format'](_0x76aa('0x123'),_0x5392a3[_0x76aa('0x36')],_0x5392a3[_0x76aa('0x63')]));if(!this[_0x76aa('0x9d')](_0x5392a3[_0x76aa('0x7d')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20key\x20configured');}var _0x4ab296=_0x76aa('0x124');var _0x499a12=util[_0x76aa('0x27')](_0x76aa('0x125'),FILES_PATH,rs[_0x76aa('0x112')](0x4));var _0x5e3622=util[_0x76aa('0x27')](_0x76aa('0x96'),_0x499a12,_0x4ab296);var _0x29e112=!![];if(_0x5392a3[_0x76aa('0x126')]==='NOBEEP'){_0x29e112=![];}var _0x220744=this[_0x76aa('0x34')][_0x76aa('0x127')](_0x499a12,_0x4ab296,_0x5392a3['intKey'],_0x5392a3[_0x76aa('0x63')],undefined,_0x29e112);if(_0x220744[_0x76aa('0x9b')]!==-0x1){this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x128'),_0x5e3622));var _0x158b65=this['googleASR']['sync'](this,_0x5392a3,_0x5e3622);if(_0x158b65){for(var _0x72b9a in _0x158b65){if(_0x158b65[_0x76aa('0x8e')](_0x72b9a)){this[_0x76aa('0x34')][_0x76aa('0x98')](util[_0x76aa('0x27')](_0x76aa('0x129'),_0x72b9a[_0x76aa('0xe3')]()),_0x158b65[_0x72b9a]);}}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x12a'),JSON[_0x76aa('0x6e')](_0x158b65)));}}return _0x220744;};AGIVertices[_0x76aa('0xe')][_0x76aa('0x12b')]=function(_0x1d5b00){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x12c'),_0x1d5b00[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x1d5b00[_0x76aa('0x12d')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x12e'));}if(!this[_0x76aa('0x9d')](_0x1d5b00[_0x76aa('0x8a')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20appsecret\x20configured');}var _0x4588c5=_0x76aa('0x124');var _0xd6cdd3=util[_0x76aa('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x76aa('0x112')](0x4));var _0x30dab8=util[_0x76aa('0x27')]('%s.%s',_0xd6cdd3,_0x4588c5);var _0x252d37=!![];if(_0x1d5b00[_0x76aa('0x126')]==='NOBEEP'){_0x252d37=![];}var _0x3a86cd=this['channel'][_0x76aa('0x127')](_0xd6cdd3,_0x4588c5,_0x1d5b00[_0x76aa('0x12f')],_0x1d5b00[_0x76aa('0x63')],undefined,_0x252d37);if(_0x3a86cd[_0x76aa('0x9b')]!==-0x1){this['channel'][_0x76aa('0xa1')](util['format'](_0x76aa('0x130'),_0x30dab8));var _0x5eb2b9=this[_0x76aa('0x89')]['sync'](this,_0x1d5b00,_0x30dab8);if(_0x5eb2b9){for(var _0x41df74 in _0x5eb2b9){if(_0x5eb2b9[_0x76aa('0x8e')](_0x41df74)){this[_0x76aa('0x34')][_0x76aa('0x98')](util[_0x76aa('0x27')](_0x76aa('0x131'),_0x41df74['toUpperCase']()),_0x5eb2b9[_0x41df74]);}}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x132'),JSON['stringify'](_0x5eb2b9)));}}return _0x3a86cd;};AGIVertices[_0x76aa('0xe')][_0x76aa('0x133')]=function(_0x506cad){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x134'),_0x506cad[_0x76aa('0x36')]));return this[_0x76aa('0x34')]['continueAt'](_0x506cad['context'],_0x506cad[_0x76aa('0x135')],_0x506cad[_0x76aa('0x3b')]);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x136')]=function(_0x4b05fa){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x137'),_0x4b05fa[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x4b05fa['condition'])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x4b05fa,_0x76aa('0x138'));}try{var _0x35a411=eval(_0x4b05fa[_0x76aa('0x139')])?_0x76aa('0x13a'):_0x76aa('0x13b');this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0x13c'),_0x4b05fa[_0x76aa('0x139')],_0x35a411));return{'code':0xc8,'result':_0x35a411};}catch(_0x1cd01e){return{'code':0xc8,'result':_0x76aa('0x13b')};}};AGIVertices['prototype'][_0x76aa('0x13d')]=function(_0x29f36c){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x13e'),_0x29f36c[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x29f36c[_0x76aa('0x13f')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x29f36c,'no\x20interval\x20configured');}var _0x4d2c63=this['getIntervals'][_0x76aa('0xbc')](this,_0x29f36c[_0x76aa('0x13f')]);if(!_0x4d2c63){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x29f36c,_0x76aa('0x140'));}for(var _0x174700=0x0;_0x174700<_0x4d2c63['length'];_0x174700+=0x1){var _0x2feda=this[_0x76aa('0x34')]['getVariable'](util[_0x76aa('0x27')](_0x76aa('0x141'),_0x4d2c63[_0x174700]));if(_0x2feda['result']===-0x1){return _0x2feda;}logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x142'),_0x4d2c63[_0x174700],_0x2feda[_0x76aa('0x9a')]));if(_0x2feda[_0x76aa('0x9a')]==='true'){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x142'),_0x4d2c63[_0x174700],_0x76aa('0x13a')));this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0x142'),_0x4d2c63[_0x174700],_0x76aa('0x13a')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0x76aa('0x27')](_0x76aa('0x142'),_0x4d2c63[_0x174700],_0x76aa('0x13b')));this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('IFTIME\x20%s\x20%s',_0x4d2c63[_0x174700],_0x76aa('0x13b')));}}return{'code':0xc8,'result':_0x76aa('0x13b')};};AGIVertices[_0x76aa('0xe')][_0x76aa('0x143')]=function(_0x4dff0f){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4dff0f[_0x76aa('0x36')]));return this[_0x76aa('0x34')][_0x76aa('0x143')]();};AGIVertices[_0x76aa('0xe')]['ispeechasr']=function(_0x4d8b5e){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x144'),_0x4d8b5e[_0x76aa('0x36')]));if(!this['isConfigured'](_0x4d8b5e['key'])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xe0'));}var _0x102d0b=_0x76aa('0x124');var _0xe0216f=util[_0x76aa('0x27')](_0x76aa('0x125'),FILES_PATH,rs[_0x76aa('0x112')](0x4));var _0x15ec84=util[_0x76aa('0x27')](_0x76aa('0x96'),_0xe0216f,_0x102d0b);var _0x348b30=!![];if(_0x4d8b5e[_0x76aa('0x126')]===_0x76aa('0x145')){_0x348b30=![];}var _0x3e66b5=this['channel'][_0x76aa('0x127')](_0xe0216f,_0x102d0b,_0x4d8b5e[_0x76aa('0x12f')],_0x4d8b5e[_0x76aa('0x63')],undefined,_0x348b30);if(_0x3e66b5[_0x76aa('0x9b')]!==-0x1){this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format'](_0x76aa('0x146'),_0x15ec84));var _0x585dc6=this['ispeechASR'][_0x76aa('0xbc')](this,_0x4d8b5e,_0x15ec84);if(_0x585dc6){for(var _0x5ee91d in _0x585dc6){if(_0x585dc6['hasOwnProperty'](_0x5ee91d)){this[_0x76aa('0x34')]['setVariable'](util[_0x76aa('0x27')]('ISPEECH_ASR_%s',_0x5ee91d[_0x76aa('0xe3')]()),_0x585dc6[_0x5ee91d]);}}return this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0x147'),JSON[_0x76aa('0x6e')](_0x585dc6)));}}return _0x3e66b5;};AGIVertices[_0x76aa('0xe')][_0x76aa('0x148')]=function(_0x15fbbe){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x149'),_0x15fbbe[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x15fbbe['key'])){return this[_0x76aa('0x34')]['noop'](_0x76aa('0xe0'));}if(!this['isConfigured'](_0x15fbbe[_0x76aa('0x58')])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xa2'));}this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x15fbbe[_0x76aa('0x58')]));var _0x5262f0=this[_0x76aa('0x79')][_0x76aa('0xbc')](this,_0x15fbbe);if(_0x5262f0){this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x146'),_0x5262f0));var _0x2925bd=this['channel']['streamFile'](_0x5262f0,_0x15fbbe['intKey']);try{fs['unlink'](_0x5262f0+_0x76aa('0xff'));}catch(_0x3693ab){logger[_0x76aa('0x29')](_0x3693ab);}return _0x2925bd;}return this['channel'][_0x76aa('0x29')](_0x15fbbe,_0x76aa('0x14a'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x14b')]=function(_0xa55da2){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xa55da2[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0xa55da2['findBy'])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0xa55da2,_0x76aa('0x14c'));}logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x14d'),this[_0x76aa('0x34')]['callerid'],_0xa55da2[_0x76aa('0x14e')]));var _0x69ad17=this[_0x76aa('0x52')][_0x76aa('0xbc')](this,_0xa55da2[_0x76aa('0x14e')]);if(_0x69ad17){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x76aa('0x34')][_0x76aa('0x38')],_0xa55da2[_0x76aa('0x14e')]));this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0x14f'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0xa55da2[_0x76aa('0x14e')]));return{'code':0xc8,'result':_0x76aa('0x150')};}else{logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x76aa('0x34')][_0x76aa('0x38')],_0xa55da2[_0x76aa('0x14e')]));this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x151'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0xa55da2[_0x76aa('0x14e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x76aa('0x152')]=function(_0x8490f9){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x8490f9['label']));if(!this[_0x76aa('0x9d')](_0x8490f9[_0x76aa('0x14e')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x8490f9,_0x76aa('0x14c'));}logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x14d'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x8490f9[_0x76aa('0x14e')]));var _0x1ff5bd=this[_0x76aa('0x4f')][_0x76aa('0xbc')](this,_0x8490f9['findBy']);if(_0x1ff5bd){logger['info'](util[_0x76aa('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x76aa('0x34')]['callerid'],_0x8490f9[_0x76aa('0x14e')]));this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x14f'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x8490f9['findBy']));return{'code':0xc8,'result':_0x76aa('0x150')};}else{logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x76aa('0x34')][_0x76aa('0x38')],_0x8490f9[_0x76aa('0x14e')]));this['channel'][_0x76aa('0xa1')](util['format'](_0x76aa('0x151'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x8490f9[_0x76aa('0x14e')]));return{'code':0xc8,'result':_0x76aa('0x153')};}};AGIVertices[_0x76aa('0xe')][_0x76aa('0x154')]=function(_0x6003d4){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x155'),_0x6003d4['label']));if(!this['isConfigured'](_0x6003d4[_0x76aa('0x156')])){return this['channel'][_0x76aa('0x29')](_0x6003d4,_0x76aa('0x157'));}this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x158'),_0x6003d4[_0x76aa('0x156')]));var _0xa5c1c3=eval(_0x6003d4['operation']);if(!this[_0x76aa('0x9d')](_0x6003d4['variable_id'])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xd2'));}var _0x10f1ac=this['getVariable'][_0x76aa('0xbc')](this,_0x6003d4[_0x76aa('0xd3')]);if(!_0x10f1ac){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x6003d4,_0x76aa('0xd4'));}if(_[_0x76aa('0x94')](_0xa5c1c3)){var _0x4f36f6=this;_0xa5c1c3['forEach'](function(_0x5d61b0,_0x48fdfb){_0x4f36f6[_0x76aa('0x34')]['setVariable'](util[_0x76aa('0x27')]('%s[%s]',_0x10f1ac,_0x48fdfb),_0x5d61b0);});return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x159'),_0x10f1ac));}else{return this[_0x76aa('0x34')][_0x76aa('0x98')](_0x10f1ac,_0xa5c1c3);}};AGIVertices[_0x76aa('0xe')][_0x76aa('0xa')]=function(_0x513ec5){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x15a'),_0x513ec5[_0x76aa('0x36')]));if(_0x513ec5['retry']===0x0){return this[_0x76aa('0x9f')](_0x513ec5);}_0x513ec5[_0x76aa('0x10a')]-=0x1;if(!this[_0x76aa('0x9d')](_0x513ec5[_0x76aa('0x10b')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x513ec5,_0x76aa('0x15b'));}var _0x18aaf1=this[_0x76aa('0x1d')][_0x76aa('0xbc')](this,_0x513ec5['file_id']);if(!_0x18aaf1){return this['channel'][_0x76aa('0x29')](_0x513ec5,_0x76aa('0x10c'));}var _0x15b286=this['channel'][_0x76aa('0x10d')](_0x18aaf1,_0x513ec5[_0x76aa('0x10e')],_0x513ec5['digit']);var _0x40b440=_0x15b286[_0x76aa('0x9b')];if(_0x15b286[_0x76aa('0x9b')]===-0x1){this[_0x76aa('0x9e')]['sync'](this,_0x513ec5,'-1');return _0x15b286;}else if(_0x15b286['extra']===_0x76aa('0x63')){_0x15b286[_0x76aa('0x9b')]=_0x15b286['result'][_0x76aa('0x97')]>0x0?_0x15b286[_0x76aa('0x9b')]:'t';}else if(_[_0x76aa('0x40')](_0x15b286[_0x76aa('0x9b')])){_0x15b286['result']='#';_0x40b440='#';}if(!this['isConfigured'](_0x513ec5[_0x76aa('0xd3')])){this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0xd2'));}else{var _0x83ccb3=this[_0x76aa('0xf')][_0x76aa('0xbc')](this,_0x513ec5['variable_id']);if(!_0x83ccb3){return this[_0x76aa('0x34')]['error'](_0x513ec5,_0x76aa('0xd4'));}this[_0x76aa('0x34')][_0x76aa('0x98')](_0x83ccb3,_0x40b440);}this[_0x76aa('0x9e')]['sync'](this,_0x513ec5,_0x40b440);return _0x15b286;};AGIVertices[_0x76aa('0xe')]['noop']=function(_0x590373){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x590373['label']));return this[_0x76aa('0x34')]['noop'](_0x590373['output']||_0x590373[_0x76aa('0x36')]);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x15c')]=function(_0x72c15a){logger['info'](util[_0x76aa('0x27')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x72c15a['label']));if(!this[_0x76aa('0x9d')](_0x72c15a['findBy'])){return this[_0x76aa('0x34')]['error'](_0x72c15a,'no\x20find\x20by\x20configured');}logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x14d'),this[_0x76aa('0x34')]['callerid'],_0x72c15a[_0x76aa('0x14e')]));var _0x53f673=this[_0x76aa('0x4a')]['sync'](this,_0x72c15a[_0x76aa('0x15d')]);var _0x3e353d=this[_0x76aa('0x4d')][_0x76aa('0xbc')](this,_0x72c15a[_0x76aa('0x14e')],_0x53f673);if(_0x3e353d){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x14f'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x72c15a['findBy']));this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x14f'),this[_0x76aa('0x34')]['callerid'],_0x72c15a[_0x76aa('0x14e')]));return{'code':0xc8,'result':_0x76aa('0x150')};}else{logger['info'](util[_0x76aa('0x27')](_0x76aa('0x151'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x72c15a['findBy']));this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x14f'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x72c15a['findBy']));return{'code':0xc8,'result':_0x76aa('0x153')};}};AGIVertices[_0x76aa('0xe')]['playback']=function(_0x1bebab){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x15e'),_0x1bebab['label']));if(!this[_0x76aa('0x9d')](_0x1bebab[_0x76aa('0x10b')])){return this['channel'][_0x76aa('0x29')](_0x1bebab,_0x76aa('0x15b'));}var _0x5c11db=this[_0x76aa('0x1d')][_0x76aa('0xbc')](this,_0x1bebab[_0x76aa('0x10b')]);if(!_0x5c11db){return this['channel']['error'](_0x1bebab,_0x76aa('0x10c'));}var _0x4f2f37=this[_0x76aa('0x34')]['exec']('PLAYBACK',[_0x5c11db,_0x1bebab['opts']]);if(_0x4f2f37[_0x76aa('0x9b')]===-0x1){return _0x4f2f37;}return this['channel'][_0x76aa('0xa1')](util['format'](_0x76aa('0xc1'),'PLAYBACK',_0x5c11db));};AGIVertices['prototype'][_0x76aa('0x15f')]=function(_0x544cc2){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x160'),_0x544cc2['label']));if(!this['isConfigured'](_0x544cc2[_0x76aa('0x161')])){return this[_0x76aa('0x34')]['error'](_0x544cc2,_0x76aa('0x162'));}var _0x55c9c2='';var _0x4857fb=parseInt(_0x544cc2[_0x76aa('0x161')],0xa);if(isNaN(_0x4857fb)){_0x55c9c2=_0x544cc2[_0x76aa('0x161')];}else{_0x55c9c2=this[_0x76aa('0x13')][_0x76aa('0xbc')](this,_0x544cc2[_0x76aa('0x161')]);if(!_0x55c9c2){return this['channel'][_0x76aa('0x29')](_0x544cc2,_0x76aa('0x163'));}}var _0x4a00fc='';if(this[_0x76aa('0x9d')](_0x544cc2[_0x76aa('0x10b')])){var _0x26fe2e=this[_0x76aa('0x1d')][_0x76aa('0xbc')](this,_0x544cc2[_0x76aa('0x10b')]);if(_0x26fe2e){_0x4a00fc=_0x26fe2e;}}this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x544cc2,_0x55c9c2);if(_0x544cc2['opts'][_0x76aa('0x164')]('x')<0x0){_0x544cc2[_0x76aa('0xdb')]+='x';}if(_0x544cc2[_0x76aa('0xdb')]['indexOf']('X')<0x0){_0x544cc2[_0x76aa('0xdb')]+='X';}this['channel']['setVariable'](_0x76aa('0x165'),_0x55c9c2?_0x55c9c2[_0x76aa('0x166')]():'');var _0x5c8984=this[_0x76aa('0x34')][_0x76aa('0x54')](_0x76aa('0x167'),[_0x55c9c2,_0x544cc2[_0x76aa('0xdb')],_0x544cc2[_0x76aa('0x61')],_0x4a00fc,_0x544cc2[_0x76aa('0x63')],_0x544cc2[_0x76aa('0x7')],_0x544cc2[_0x76aa('0x168')],_0x544cc2[_0x76aa('0x169')],'',_0x544cc2[_0x76aa('0x16a')]]);if(_0x5c8984[_0x76aa('0x9b')]===-0x1){return _0x5c8984;}return this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0xc1'),_0x76aa('0x167'),_0x55c9c2));};AGIVertices[_0x76aa('0xe')]['record']=function(_0x35d0af){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x16b'),_0x35d0af[_0x76aa('0x36')]));var _0x8f330=_0x35d0af[_0x76aa('0x16c')]||'wav';var _0x2a8966=util[_0x76aa('0x27')]('%s_%s',this['channel'][_0x76aa('0x35')],rs[_0x76aa('0x112')](0x5));var _0x1d823e=util[_0x76aa('0x27')](_0x76aa('0x16d'),FILES_PATH,_0x2a8966,_0x8f330);var _0x468264=util[_0x76aa('0x27')](_0x76aa('0x125'),FILES_PATH,_0x2a8966);this['createSquareRecording']['sync'](this,_0x35d0af,_0x2a8966,_0x1d823e);this[_0x76aa('0x34')][_0x76aa('0x98')]('RECORDING_SAVENAME',_0x2a8966);logger[_0x76aa('0x2d')](_0x76aa('0x16e'),_0x468264,_0x8f330,_0x35d0af[_0x76aa('0x16f')],_0x35d0af['timeout']);return this['channel'][_0x76aa('0x127')](_0x468264,_0x8f330,_0x35d0af[_0x76aa('0x16f')],_0x35d0af[_0x76aa('0x63')],undefined,!![]);};AGIVertices[_0x76aa('0xe')]['restapi']=function(_0x55baaa){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x170'),_0x55baaa[_0x76aa('0x36')]));if(!this['isConfigured'](_0x55baaa['url'])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x171'));}var _0x415b6f=this['restAPI'][_0x76aa('0xbc')](this,_0x55baaa);logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x172'),util[_0x76aa('0x173')](_0x415b6f,{'showHidden':![],'depth':null})));if(!this[_0x76aa('0x9d')](_0x55baaa[_0x76aa('0xd3')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4d8ec6=this[_0x76aa('0xf')][_0x76aa('0xbc')](this,_0x55baaa[_0x76aa('0xd3')]);if(!_0x4d8ec6){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x55baaa,_0x76aa('0xd4'));}this[_0x76aa('0x34')][_0x76aa('0x98')](util[_0x76aa('0x27')](_0x76aa('0x174'),_0x4d8ec6),_0x415b6f[_0x76aa('0x175')]?_0x415b6f[_0x76aa('0x175')]:_0x76aa('0x176'));this['channel'][_0x76aa('0x98')](util[_0x76aa('0x27')](_0x76aa('0x177'),_0x4d8ec6),_0x415b6f[_0x76aa('0x178')]?_0x415b6f['statusMessage']:'OK');if(_0x415b6f[_0x76aa('0x6d')]){try{this[_0x76aa('0x95')](_0x415b6f['body'],_0x4d8ec6);}catch(_0x39393d){logger['error'](util['format'](_0x76aa('0x179'),_0x4d8ec6));}}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x17a'),_0x4d8ec6));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x17b')]=function(_0xb34891){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0xb34891[_0x76aa('0x36')]));return this[_0x76aa('0x34')][_0x76aa('0x17c')](_0xb34891[_0x76aa('0x17d')][_0x76aa('0x17e')](/\s+/g,''),_0xb34891[_0x76aa('0x16f')]);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x17f')]=function(_0x503562){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x180'),_0x503562['label']));return this[_0x76aa('0x34')]['sayNumber'](_0x503562[_0x76aa('0x62')][_0x76aa('0x17e')](/\s+/g,''),_0x503562[_0x76aa('0x16f')]);};AGIVertices['prototype'][_0x76aa('0x181')]=function(_0x28a4c2){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x182'),_0x28a4c2['label']));return this[_0x76aa('0x34')][_0x76aa('0x183')](_0x28a4c2['text'],_0x28a4c2['escape_digits']);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x184')]=function(_0x41e6e1){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x185'),_0x41e6e1[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x41e6e1['account_id'])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x186'));}var _0x4b702b=this['getMailAccount'][_0x76aa('0xbc')](this,_0x41e6e1[_0x76aa('0x187')]);if(!_0x4b702b||!_0x4b702b[_0x76aa('0x188')]){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x41e6e1,_0x76aa('0x189'));}var _0x2684ce={'from':util['format'](_0x76aa('0x18a'),_0x4b702b[_0x76aa('0x16')],_0x4b702b[_0x76aa('0x18b')]||_0x4b702b[_0x76aa('0x188')][_0x76aa('0x18c')]),'to':_0x41e6e1['to']||'','cc':_0x41e6e1['cc']||'','bcc':_0x41e6e1[_0x76aa('0x18d')]||'','subject':_0x41e6e1[_0x76aa('0x18e')],'html':_0x41e6e1['text'],'text':_0x41e6e1['text']};if(this[_0x76aa('0x9d')](_0x41e6e1[_0x76aa('0x18f')])){}logger[_0x76aa('0xd7')](_0x76aa('0x190'),JSON[_0x76aa('0x6e')](_0x2684ce));this['createSquareDetailsReport'][_0x76aa('0xbc')](this,_0x41e6e1,_0x41e6e1[_0x76aa('0x187')]);this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format'](_0x76aa('0x191'),_0x4b702b[_0x76aa('0x16')]));this['sendMailMessage']['sync'](this,_0x4b702b[_0x76aa('0x192')],_0x2684ce);return this[_0x76aa('0x34')]['noop'](_0x76aa('0x193'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x194')]=function(_0x4e7643){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x195'),_0x4e7643[_0x76aa('0x36')]));return this['channel'][_0x76aa('0xa1')](_0x76aa('0x196'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x197')]=function(_0x143a95){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x198'),_0x143a95['label']));if(!this['isConfigured'](_0x143a95[_0x76aa('0x199')])){return this[_0x76aa('0x34')]['noop'](_0x76aa('0x19a'));}var _0x4bb772=this[_0x76aa('0x32')][_0x76aa('0xbc')](this,_0x143a95[_0x76aa('0x199')]);if(!_0x4bb772){return this[_0x76aa('0x34')]['error'](_0x143a95,_0x76aa('0x19b'));}var _0x626db5={'body':_0x143a95[_0x76aa('0x19c')],'phone':_0x143a95['to']||'','SmsAccountId':_0x4bb772['id']};logger[_0x76aa('0xd7')](_0x76aa('0x19d'),JSON[_0x76aa('0x6e')](_0x626db5));this[_0x76aa('0x9e')]['sync'](this,_0x143a95,_0x143a95[_0x76aa('0x199')]);this[_0x76aa('0x34')]['noop'](util[_0x76aa('0x27')](_0x76aa('0x19e'),_0x4bb772[_0x76aa('0x16')]));this[_0x76aa('0x33')][_0x76aa('0xbc')](this,_0x626db5);return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x19f'));};AGIVertices['prototype'][_0x76aa('0x1a0')]=function(_0x3d2607){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x1a1'),_0x3d2607[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x3d2607[_0x76aa('0xd3')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x3d2607,'no\x20variable\x20selected');}var _0x573787=this[_0x76aa('0xf')][_0x76aa('0xbc')](this,_0x3d2607['variable_id']);if(!_0x573787){return this[_0x76aa('0x34')]['error'](_0x3d2607,'no\x20variable\x20found');}return this[_0x76aa('0x34')][_0x76aa('0x98')](_0x573787,_0x3d2607[_0x76aa('0x1a2')]);};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1a3')]=function(_0x3a1c1c){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x1a4'),_0x3a1c1c[_0x76aa('0x36')]));this[_0x76aa('0x34')]['noop']('START\x20CALLY\x20SQUARE');var _0x44242d=this['channel'][_0x76aa('0xf')](_0x76aa('0x1a5'));if(!_[_0x76aa('0x40')](_0x44242d[_0x76aa('0x9a')])){this[_0x76aa('0x34')][_0x76aa('0x35')]=_0x44242d[_0x76aa('0x9a')];}if(_0x3a1c1c['answer']===_0x76aa('0x1a6')){this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x1a7'));return this[_0x76aa('0x34')][_0x76aa('0xb4')]();}return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x1a8'));};AGIVertices[_0x76aa('0xe')]['subproject']=function(_0x225cdb){logger[_0x76aa('0x2d')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x225cdb[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x225cdb[_0x76aa('0x1a9')])){return this[_0x76aa('0x34')]['error'](_0x225cdb,'no\x20subproject\x20selected');}var _0x2b434f=this[_0x76aa('0x14')][_0x76aa('0xbc')](this,_0x225cdb[_0x76aa('0x1a9')]);if(!this[_0x76aa('0x9d')](_0x2b434f)){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x225cdb,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x225cdb[_0x76aa('0x1a9')]));}if(_0x2b434f===this[_0x76aa('0x34')][_0x76aa('0x1aa')]){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x225cdb,_0x76aa('0x1ab'));}this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x225cdb,_0x2b434f);var _0x383c26=this[_0x76aa('0x34')][_0x76aa('0x54')](_0x76aa('0x1ac'),util['format'](_0x76aa('0x1ad'),config[_0x76aa('0x7')][_0x76aa('0x1ae')]||_0x76aa('0x1af'),_0x2b434f,this['channel']['arg_1']));if(_0x383c26[_0x76aa('0x9b')]===-0x1){return _0x383c26;}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util['format']('Executed\x20command\x20%s\x20%s',_0x76aa('0x1ac'),_0x2b434f));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1b0')]=function(_0x1e2c28){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1e2c28['label']));var _0x1ca1b0=this[_0x76aa('0x53')][_0x76aa('0xbc')](this,_0x1e2c28[_0x76aa('0xb2')]);this[_0x76aa('0x9e')][_0x76aa('0xbc')](this,_0x1e2c28,_0x1e2c28['command']);if(this[_0x76aa('0x9d')](_0x1e2c28['variable_id'])){var _0x3c4e7e=this['getVariable']['sync'](this,_0x1e2c28[_0x76aa('0xd3')]);if(_0x3c4e7e){this['channel'][_0x76aa('0x98')](_0x3c4e7e,_0x1ca1b0);return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1e2c28[_0x76aa('0xb2')],_0x3c4e7e));}}return this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x1b1'),_0x1e2c28[_0x76aa('0xb2')]));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1b2')]=function(_0x3cc82a){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x1b3'),_0x3cc82a['label']));_0x3cc82a[_0x76aa('0x58')]=_0x3cc82a['text'][_0x76aa('0x17e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x76aa('0x9d')](_0x3cc82a[_0x76aa('0x57')])){return this[_0x76aa('0x34')][_0x76aa('0xa1')](_0x76aa('0x1b4'));}if(!this[_0x76aa('0x9d')](_0x3cc82a[_0x76aa('0x58')])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xa2'));}this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x1b5'),_0x3cc82a['text']));var _0x95270d=this[_0x76aa('0x56')]['sync'](this,_0x3cc82a);if(_0x95270d){this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x95270d));var _0xb4d1bb=this['channel']['streamFile'](_0x95270d);try{fs[_0x76aa('0xfe')](_0x95270d+_0x76aa('0xff'));}catch(_0x4950f3){logger[_0x76aa('0x29')](_0x4950f3);}return _0xb4d1bb;}return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x3cc82a,_0x76aa('0x1b6'));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1b7')]=function(_0x38d9d8){logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x1b8'),_0x38d9d8[_0x76aa('0x36')]));_0x38d9d8[_0x76aa('0x58')]=_0x38d9d8[_0x76aa('0x58')][_0x76aa('0x17e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x76aa('0x9d')](_0x38d9d8['text'])){return this['channel'][_0x76aa('0xa1')](_0x76aa('0xa2'));}this['channel'][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x1b9'),_0x38d9d8[_0x76aa('0x58')]));var _0x32c93a=this[_0x76aa('0x5e')][_0x76aa('0xbc')](this,_0x38d9d8);if(_0x32c93a){this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')]('Google\x20TTS\x20%s\x20file\x20created',_0x32c93a));var _0x3225bc=this[_0x76aa('0x34')][_0x76aa('0xfd')](_0x32c93a);try{fs['unlink'](_0x32c93a+_0x76aa('0xff'));}catch(_0x4a7914){logger[_0x76aa('0x29')](_0x4a7914);}return _0x3225bc;}return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x38d9d8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x76aa('0xe')]['unpause']=function(_0x5dbe55){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x1ba'),_0x5dbe55[_0x76aa('0x36')]));if(!this[_0x76aa('0x9d')](_0x5dbe55['findBy'])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x5dbe55,'no\x20find\x20by\x20configured');}logger[_0x76aa('0x2d')](util['format'](_0x76aa('0x14d'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x5dbe55[_0x76aa('0x14e')]));var _0x3c4df7=this[_0x76aa('0x4e')][_0x76aa('0xbc')](this,_0x5dbe55[_0x76aa('0x14e')]);if(_0x3c4df7){logger['info'](util[_0x76aa('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x76aa('0x34')]['callerid'],_0x5dbe55['findBy']));this['channel']['noop'](util[_0x76aa('0x27')](_0x76aa('0x14f'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x5dbe55[_0x76aa('0x14e')]));return{'code':0xc8,'result':_0x76aa('0x150')};}else{logger['info'](util['format'](_0x76aa('0x151'),this[_0x76aa('0x34')]['callerid'],_0x5dbe55[_0x76aa('0x14e')]));this[_0x76aa('0x34')][_0x76aa('0xa1')](util[_0x76aa('0x27')](_0x76aa('0x151'),this[_0x76aa('0x34')][_0x76aa('0x38')],_0x5dbe55[_0x76aa('0x14e')]));return{'code':0xc8,'result':_0x76aa('0x153')};}};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1bb')]=function(_0x383bb3){logger['info'](util[_0x76aa('0x27')](_0x76aa('0x1bc'),_0x383bb3[_0x76aa('0x36')]));var _0x436e5b=this['channel'][_0x76aa('0x54')](_0x76aa('0x1bd'),[_0x383bb3[_0x76aa('0x1be')],_0x383bb3[_0x76aa('0x71')]]);if(_0x436e5b[_0x76aa('0x9b')]===-0x1){return _0x436e5b;}return this['channel'][_0x76aa('0xa1')](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x383bb3[_0x76aa('0x1be')]));};AGIVertices[_0x76aa('0xe')][_0x76aa('0x1bf')]=function(_0x3266cf){logger[_0x76aa('0x2d')](util[_0x76aa('0x27')](_0x76aa('0x1c0'),_0x3266cf[_0x76aa('0x36')]));if(!this['isConfigured'](_0x3266cf[_0x76aa('0xd3')])){return this[_0x76aa('0x34')][_0x76aa('0x29')](_0x3266cf,_0x76aa('0x1c1'));}var _0x55510f=this['getVariable']['sync'](this,_0x3266cf[_0x76aa('0xd3')]);if(!_0x55510f){return this[_0x76aa('0x34')]['error'](_0x3266cf,_0x76aa('0xd4'));}var _0x749cba=this[_0x76aa('0x34')][_0x76aa('0xf')](_0x55510f);return{'code':0xc8,'result':_0x749cba[_0x76aa('0x9a')]?_0x749cba['extra']:'-'};};String['prototype'][_0x76aa('0x1c2')]=function(_0x42dba3,_0x40bc23){return this[_0x76aa('0x99')](_0x42dba3)[_0x76aa('0x1c3')](_0x40bc23);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index af9563a..e22cbed 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 _0x902b=['isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','exports','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','ACW','name','Action','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','format','queue','[ACW][START]\x20%s','message','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s'];(function(_0x8f1e82,_0x5d95bd){var _0x39bb0f=function(_0x259b5f){while(--_0x259b5f){_0x8f1e82['push'](_0x8f1e82['shift']());}};_0x39bb0f(++_0x5d95bd);}(_0x902b,0x163));var _0xb902=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x902b[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xb902('0x0'));var moment=require(_0xb902('0x1'));var ami=require(_0xb902('0x2'));var logger=require('../../../config/logger')(_0xb902('0x3'));var RpcUser=require(_0xb902('0x4'));var RpcVoiceAgentReport=require(_0xb902('0x5'));function Acw(_0x1fcf82){this['voiceQueues']=_0x1fcf82[_0xb902('0x6')];this[_0xb902('0x7')]=_0x1fcf82[_0xb902('0x7')];this[_0xb902('0x8')]=_0x1fcf82[_0xb902('0x8')];this[_0xb902('0x9')]={};ami['on'](_0xb902('0xa'),this[_0xb902('0xb')][_0xb902('0xc')](this));ami['on']('hanguprequest',this[_0xb902('0xd')][_0xb902('0xc')](this));ami['on'](_0xb902('0xe'),this[_0xb902('0xf')][_0xb902('0xc')](this));ami['on'](_0xb902('0x10'),this[_0xb902('0x11')][_0xb902('0xc')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb902('0xc')](this));ami['on'](_0xb902('0x12'),this['syncBlindTransfer'][_0xb902('0xc')](this));ami['on'](_0xb902('0x13'),this['syncAgentConnectPreview'][_0xb902('0xc')](this));}function getDiff(_0x1cc6d8){var _0x7fa5e4=moment()[_0xb902('0x14')](0x0);var _0x50f85c=moment(_0x1cc6d8)[_0xb902('0x14')](0x0);return _0x7fa5e4[_0xb902('0x15')](_0x50f85c,_0xb902('0x16'));}Acw[_0xb902('0x17')][_0xb902('0x18')]=function(_0x2439f2,_0x3e4f9c){var _0x4cfd17=this;var _0x129ec3=getDiff(_0x4cfd17[_0xb902('0x8')][_0x2439f2][_0xb902('0x19')]);clearTimeout(_0x4cfd17['timers'][_0x2439f2]['timer']);_0x4cfd17['timers'][_0x2439f2][_0xb902('0x1a')]=![];return RpcVoiceAgentReport[_0xb902('0x1b')]({'acwtime':_0x129ec3},_0x4cfd17[_0xb902('0x8')][_0x2439f2][_0xb902('0x1c')],_0x2439f2)[_0xb902('0x1d')](function(_0x8a70fc){logger[_0xb902('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x3e4f9c,_0x129ec3,_0x8a70fc);})[_0xb902('0x1f')](function(_0x47e6d6){logger[_0xb902('0x20')](_0xb902('0x21'),_0x3e4f9c,_0x47e6d6);})[_0xb902('0x22')](function(){delete _0x4cfd17['timers'][_0x2439f2];});};Acw[_0xb902('0x17')][_0xb902('0x23')]=function(_0x33bed2){try{var _0x4283c5=this;var _0x582ee9=this[_0xb902('0x9')][_0x33bed2][_0xb902('0x24')];var _0x389727=this['channels'][_0x33bed2]['queue'];var _0x3a6333=this[_0xb902('0x6')][_0x389727];var _0x33881d=![];var _0x2edf88=_0xb902('0x25');if(_0x3a6333['mandatoryDisposition']&&_0x3a6333['mandatoryDispositionPause'][_0xb902('0x26')]){_0x33881d=!![];_0x2edf88=_0x3a6333['mandatoryDispositionPause'][_0xb902('0x26')];}return ami[_0xb902('0x27')]({'action':'QueuePause','interface':_0x582ee9,'paused':!![],'reason':_0x2edf88})[_0xb902('0x1d')](function(){if(_0x4283c5[_0xb902('0x7')][_0x582ee9]){return RpcUser[_0xb902('0x28')](_0x4283c5['agents'][_0x582ee9]['id'])[_0xb902('0x1d')](function(_0x11db48){if(!_0x11db48||_0x11db48[_0xb902('0x29')]){logger[_0xb902('0x1e')](_0xb902('0x2a'),_0x33bed2,_0x582ee9,_0x389727);return;}logger[_0xb902('0x1e')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x33bed2,_0x582ee9,_0x389727);var _0x5b7c78=_0x4283c5[_0xb902('0x9')][_0x33bed2][_0xb902('0x2b')]&&_0x4283c5[_0xb902('0x9')][_0x33bed2][_0xb902('0x2c')]?_0x4283c5[_0xb902('0x9')][_0x33bed2][_0xb902('0x2c')]:_0x33bed2;return RpcUser['savePause'](_0x4283c5['agents'][_0x582ee9],_0x2edf88,_0x5b7c78)['then'](function(_0x53b819){_0x4283c5[_0xb902('0x6')][_0x389727][_0xb902('0x2d')]-=0x1;_0x4283c5[_0xb902('0x6')][_0x389727][_0xb902('0x2e')]+=0x1;return _0x53b819;});})[_0xb902('0x1d')](function(_0x1d73cc){if(_0x33881d||!_0x1d73cc){return;}_0x4283c5[_0xb902('0x8')][_0x582ee9]={};logger[_0xb902('0x1e')](_0xb902('0x2f'),_0x33bed2,_0x4283c5['voiceQueues'][_0x389727]['acwTimeout'],_0x582ee9,_0x389727);_0x4283c5[_0xb902('0x8')][_0x582ee9][_0xb902('0x1a')]=setTimeout(_0x4283c5[_0xb902('0x30')][_0xb902('0xc')](_0x4283c5,_0x582ee9),_0x4283c5[_0xb902('0x6')][_0x389727][_0xb902('0x31')]*0x3e8);_0x4283c5['timers'][_0x582ee9][_0xb902('0x19')]=moment()[_0xb902('0x32')]('YYYY-MM-DD\x20HH:mm:ss');_0x4283c5[_0xb902('0x8')][_0x582ee9][_0xb902('0x1c')]=_0x33bed2;_0x4283c5['timers'][_0x582ee9][_0xb902('0x33')]=_0x389727;_0x4283c5[_0xb902('0x8')][_0x582ee9]['updateAcw']=_0x4283c5[_0xb902('0x18')][_0xb902('0xc')](_0x4283c5,_0x582ee9,_0x33bed2);});}})['catch'](function(){logger[_0xb902('0x20')](_0xb902('0x2f'),_0x33bed2,_0x4283c5[_0xb902('0x6')][_0x389727][_0xb902('0x31')],_0x582ee9,_0x389727);})[_0xb902('0x22')](function(){delete _0x4283c5[_0xb902('0x9')][_0x33bed2];});}catch(_0x2e0dcb){logger[_0xb902('0x20')](_0xb902('0x34'),_0x2e0dcb[_0xb902('0x35')]);}};Acw['prototype'][_0xb902('0x30')]=function(_0x1c2862){try{var _0x12844e=this;if(_0x12844e[_0xb902('0x8')][_0x1c2862]){_0x12844e[_0xb902('0x8')][_0x1c2862][_0xb902('0x1a')]=![];var _0x102e51=_0x12844e[_0xb902('0x8')][_0x1c2862][_0xb902('0x1c')];var _0x26a52e=_0x12844e[_0xb902('0x8')][_0x1c2862][_0xb902('0x33')];var _0x5c9850=_0x12844e[_0xb902('0x6')][_0x26a52e]['acwTimeout'];logger[_0xb902('0x1e')]('[%s][TIMER][STOP][AGENT:%s]',_0x102e51,_0x1c2862);RpcUser[_0xb902('0x28')](this['agents'][_0x1c2862]['id'])[_0xb902('0x1d')](function(_0x28fe67){if(_0x28fe67['pauseType']===_0xb902('0x25')){return RpcUser[_0xb902('0x36')](_0x12844e[_0xb902('0x7')][_0x1c2862]);}});RpcVoiceAgentReport['update']({'acwtime':_0x5c9850,'agentacw':!![]},_0x102e51,_0x1c2862)['then'](function(_0x5432b2){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x102e51,_0x5c9850,_0x5432b2);})['catch'](function(_0x2017e3){logger[_0xb902('0x20')](_0xb902('0x21'),_0x102e51,_0x2017e3);});}else{logger['error'](_0xb902('0x37'),_0x1c2862);if(_0x12844e[_0xb902('0x8')]){logger[_0xb902('0x1e')]('[ACW][TIMERS]',JSON['stringify'](_0x12844e[_0xb902('0x8')]));}}}catch(_0x4595fa){logger[_0xb902('0x20')](_0xb902('0x38'),_0x4595fa['message']);}};Acw['prototype'][_0xb902('0xb')]=function(_0x29ff37){try{if(this[_0xb902('0x6')][_0x29ff37['queue']]&&(this[_0xb902('0x6')][_0x29ff37[_0xb902('0x33')]][_0xb902('0x3')]||this[_0xb902('0x6')][_0x29ff37[_0xb902('0x33')]][_0xb902('0x39')])){if(this[_0xb902('0x7')][_0x29ff37['interface']]){this['channels'][_0x29ff37[_0xb902('0x1c')]]={'queue':_0x29ff37[_0xb902('0x33')],'interface':_0x29ff37[_0xb902('0x24')],'destlinkedid':_0x29ff37[_0xb902('0x2c')]};}}}catch(_0x5ab67f){logger[_0xb902('0x20')](_0xb902('0x3a'),_0x5ab67f[_0xb902('0x35')]);}};Acw[_0xb902('0x17')]['syncAgentConnectPreview']=function(_0x4d01ff){try{if(this['voiceQueues'][_0x4d01ff[_0xb902('0x33')]]&&(this[_0xb902('0x6')][_0x4d01ff[_0xb902('0x33')]]['acw']||this[_0xb902('0x6')][_0x4d01ff[_0xb902('0x33')]][_0xb902('0x39')])){if(this[_0xb902('0x7')][_0x4d01ff[_0xb902('0x24')]]){this[_0xb902('0x9')][_0x4d01ff[_0xb902('0x1c')]]={'queue':_0x4d01ff['queue'],'interface':_0x4d01ff[_0xb902('0x24')]};}}}catch(_0x3a96a2){logger[_0xb902('0x20')](_0xb902('0x3b'),_0x3a96a2[_0xb902('0x35')]);}};Acw[_0xb902('0x17')][_0xb902('0xd')]=function(_0x206374){try{if(this[_0xb902('0x9')][_0x206374[_0xb902('0x1c')]]&&_[_0xb902('0x3c')](this['channels'][_0x206374['uniqueid']]['attended'])){logger[_0xb902('0x1e')]('[%s][HANGUP:UNIQUEID]',_0x206374[_0xb902('0x1c')]);this[_0xb902('0x23')](_0x206374['uniqueid']);}else if(this[_0xb902('0x9')][_0x206374[_0xb902('0x3d')]]&&_['isUndefined'](this['channels'][_0x206374[_0xb902('0x3d')]]['attended'])){logger[_0xb902('0x1e')](_0xb902('0x3e'),_0x206374[_0xb902('0x3d')]);this[_0xb902('0x23')](_0x206374[_0xb902('0x3d')]);}}catch(_0x341c62){logger[_0xb902('0x20')](_0xb902('0x3f'),_0x341c62[_0xb902('0x35')]);}};Acw[_0xb902('0x17')]['syncHangup']=function(_0x291da2){try{if(this[_0xb902('0x9')][_0x291da2['uniqueid']]&&this['channels'][_0x291da2[_0xb902('0x1c')]][_0xb902('0x2b')]){logger[_0xb902('0x1e')](_0xb902('0x40'),_0x291da2[_0xb902('0x1c')]);this['startAcw'](_0x291da2[_0xb902('0x1c')]);}else if(this[_0xb902('0x9')][_0x291da2[_0xb902('0x3d')]]&&this[_0xb902('0x9')][_0x291da2[_0xb902('0x3d')]][_0xb902('0x2b')]){logger[_0xb902('0x1e')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x291da2['linkedid']);this[_0xb902('0x23')](_0x291da2[_0xb902('0x3d')]);}}catch(_0x385593){logger[_0xb902('0x20')](_0xb902('0x41'),_0x385593['message']);}};Acw[_0xb902('0x17')][_0xb902('0x42')]=function(_0x2e27ff){try{if(!_[_0xb902('0x43')](this['channels'][_0x2e27ff[_0xb902('0x44')]])){this[_0xb902('0x23')](_0x2e27ff['transfereeuniqueid']);if(this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x45')]]){this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x45')]]['attended']=!![];this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x46')]]=this['channels'][_0x2e27ff['secondtransfereruniqueid']];delete this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x45')]];}}else if(!_['isNil'](this['channels'][_0x2e27ff[_0xb902('0x46')]])){this[_0xb902('0x23')](_0x2e27ff['transfertargetuniqueid']);if(this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x47')]]){this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x47')]][_0xb902('0x2b')]=!![];this[_0xb902('0x9')][_0x2e27ff['transfereeuniqueid']]=this['channels'][_0x2e27ff[_0xb902('0x47')]];delete this[_0xb902('0x9')][_0x2e27ff[_0xb902('0x47')]];}}}catch(_0x2d4aaf){logger[_0xb902('0x20')](_0xb902('0x48'),_0x2d4aaf['message']);}};Acw[_0xb902('0x17')]['syncBlindTransfer']=function(_0x49515d){try{if(this[_0xb902('0x9')][_0x49515d[_0xb902('0x49')]]){logger[_0xb902('0x1e')](_0xb902('0x4a'),JSON[_0xb902('0x4b')](_0x49515d['transfereruniqueid']));this[_0xb902('0x23')](_0x49515d[_0xb902('0x49')]);}else if(this['channels'][_0x49515d[_0xb902('0x4c')]]){logger[_0xb902('0x1e')](_0xb902('0x4d'),JSON['stringify'](_0x49515d['transfererlinkedid']));this[_0xb902('0x23')](_0x49515d['transfererlinkedid']);}}catch(_0x2b1b38){logger[_0xb902('0x20')]('[ACW][syncBlindTransfer]\x20%s',_0x2b1b38[_0xb902('0x35')]);}};Acw[_0xb902('0x17')]['syncAgentRingNoAnswer']=function(_0x377028){try{if(this[_0xb902('0x6')][_0x377028[_0xb902('0x33')]]&&this[_0xb902('0x6')][_0x377028[_0xb902('0x33')]][_0xb902('0x4e')]===_0xb902('0x4f')){if(this[_0xb902('0x7')][_0x377028[_0xb902('0x24')]]){logger[_0xb902('0x1e')](_0xb902('0x50'),_0x377028[_0xb902('0x1c')],_0x377028['interface'],_0x377028[_0xb902('0x33')]);return RpcUser[_0xb902('0x51')](this['agents'][_0x377028[_0xb902('0x24')]],'Auto-Pause',_0x377028[_0xb902('0x1c')]);}}}catch(_0x4d1cd7){logger[_0xb902('0x20')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4d1cd7[_0xb902('0x35')]);}};module[_0xb902('0x52')]=Acw; \ No newline at end of file +var _0xc8a4=['stopAcw','uniqueid','[%s][TIMER][STOP][AGENT:%s]','pauseType','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','attended','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','syncAgentRingNoAnswer','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangup','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','[ACW][START]\x20%s','message'];(function(_0x1551a7,_0x3e342e){var _0x40a4de=function(_0x541694){while(--_0x541694){_0x1551a7['push'](_0x1551a7['shift']());}};_0x40a4de(++_0x3e342e);}(_0xc8a4,0x75));var _0x4c8a=function(_0x34e0bc,_0x16177c){_0x34e0bc=_0x34e0bc-0x0;var _0x49806c=_0xc8a4[_0x34e0bc];return _0x49806c;};'use strict';var _=require(_0x4c8a('0x0'));var moment=require(_0x4c8a('0x1'));var ami=require(_0x4c8a('0x2'));var logger=require(_0x4c8a('0x3'))(_0x4c8a('0x4'));var RpcUser=require(_0x4c8a('0x5'));var RpcVoiceAgentReport=require(_0x4c8a('0x6'));function Acw(_0x2c57c4){this[_0x4c8a('0x7')]=_0x2c57c4[_0x4c8a('0x7')];this[_0x4c8a('0x8')]=_0x2c57c4[_0x4c8a('0x8')];this[_0x4c8a('0x9')]=_0x2c57c4[_0x4c8a('0x9')];this[_0x4c8a('0xa')]={};ami['on'](_0x4c8a('0xb'),this['syncAgentConnect'][_0x4c8a('0xc')](this));ami['on'](_0x4c8a('0xd'),this['syncHangupRequest'][_0x4c8a('0xc')](this));ami['on']('hangup',this[_0x4c8a('0xe')][_0x4c8a('0xc')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on']('attendedtransfer',this[_0x4c8a('0xf')][_0x4c8a('0xc')](this));ami['on'](_0x4c8a('0x10'),this[_0x4c8a('0x11')]['bind'](this));ami['on'](_0x4c8a('0x12'),this[_0x4c8a('0x13')][_0x4c8a('0xc')](this));}function getDiff(_0x18a65d){var _0xaeb78=moment()[_0x4c8a('0x14')](0x0);var _0x5b1c78=moment(_0x18a65d)['milliseconds'](0x0);return _0xaeb78[_0x4c8a('0x15')](_0x5b1c78,_0x4c8a('0x16'));}Acw[_0x4c8a('0x17')][_0x4c8a('0x18')]=function(_0x3dbb91,_0x417e7a){var _0x80e953=this;var _0xa4a57=getDiff(_0x80e953[_0x4c8a('0x9')][_0x3dbb91]['lastPauseAt']);clearTimeout(_0x80e953['timers'][_0x3dbb91]['timer']);_0x80e953['timers'][_0x3dbb91][_0x4c8a('0x19')]=![];return RpcVoiceAgentReport[_0x4c8a('0x1a')]({'acwtime':_0xa4a57},_0x80e953[_0x4c8a('0x9')][_0x3dbb91]['uniqueid'],_0x3dbb91)['then'](function(_0x1cfe88){logger['info'](_0x4c8a('0x1b'),_0x417e7a,_0xa4a57,_0x1cfe88);})[_0x4c8a('0x1c')](function(_0x48e9c8){logger[_0x4c8a('0x1d')]('[%s][UPDATE][ERRORS:%s]',_0x417e7a,_0x48e9c8);})[_0x4c8a('0x1e')](function(){delete _0x80e953['timers'][_0x3dbb91];});};Acw[_0x4c8a('0x17')][_0x4c8a('0x1f')]=function(_0x13d529){try{var _0x2afbd0=this;var _0x5ce90d=this[_0x4c8a('0xa')][_0x13d529][_0x4c8a('0x20')];var _0x4f1a91=this['channels'][_0x13d529][_0x4c8a('0x21')];var _0xf54356=this[_0x4c8a('0x7')][_0x4f1a91];var _0x5e72b8=![];var _0x17e8fb=_0x4c8a('0x22');if(_0xf54356[_0x4c8a('0x23')]&&_0xf54356[_0x4c8a('0x24')]['name']){_0x5e72b8=!![];_0x17e8fb=_0xf54356['mandatoryDispositionPause'][_0x4c8a('0x25')];}return ami[_0x4c8a('0x26')]({'action':_0x4c8a('0x27'),'interface':_0x5ce90d,'paused':!![],'reason':_0x17e8fb})[_0x4c8a('0x28')](function(){if(_0x2afbd0['agents'][_0x5ce90d]){return RpcUser[_0x4c8a('0x29')](_0x2afbd0[_0x4c8a('0x8')][_0x5ce90d]['id'])[_0x4c8a('0x28')](function(_0xd6d12b){if(!_0xd6d12b||_0xd6d12b[_0x4c8a('0x2a')]){logger[_0x4c8a('0x2b')](_0x4c8a('0x2c'),_0x13d529,_0x5ce90d,_0x4f1a91);return;}logger['info'](_0x4c8a('0x2d'),_0x13d529,_0x5ce90d,_0x4f1a91);var _0x1b97c9=_0x2afbd0['channels'][_0x13d529]['attended']&&_0x2afbd0['channels'][_0x13d529][_0x4c8a('0x2e')]?_0x2afbd0[_0x4c8a('0xa')][_0x13d529][_0x4c8a('0x2e')]:_0x13d529;return RpcUser[_0x4c8a('0x2f')](_0x2afbd0[_0x4c8a('0x8')][_0x5ce90d],_0x17e8fb,_0x1b97c9)[_0x4c8a('0x28')](function(_0x1c5163){_0x2afbd0['voiceQueues'][_0x4f1a91][_0x4c8a('0x30')]-=0x1;_0x2afbd0[_0x4c8a('0x7')][_0x4f1a91][_0x4c8a('0x31')]+=0x1;return _0x1c5163;});})[_0x4c8a('0x28')](function(_0x580720){if(_0x5e72b8||!_0x580720){return;}_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d]={};logger[_0x4c8a('0x2b')](_0x4c8a('0x32'),_0x13d529,_0x2afbd0['voiceQueues'][_0x4f1a91][_0x4c8a('0x33')],_0x5ce90d,_0x4f1a91);_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d][_0x4c8a('0x19')]=setTimeout(_0x2afbd0['stopAcw'][_0x4c8a('0xc')](_0x2afbd0,_0x5ce90d),_0x2afbd0[_0x4c8a('0x7')][_0x4f1a91][_0x4c8a('0x33')]*0x3e8);_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d][_0x4c8a('0x34')]=moment()[_0x4c8a('0x35')](_0x4c8a('0x36'));_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d]['uniqueid']=_0x13d529;_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d][_0x4c8a('0x21')]=_0x4f1a91;_0x2afbd0[_0x4c8a('0x9')][_0x5ce90d][_0x4c8a('0x18')]=_0x2afbd0[_0x4c8a('0x18')]['bind'](_0x2afbd0,_0x5ce90d,_0x13d529);});}})[_0x4c8a('0x1c')](function(){logger[_0x4c8a('0x1d')](_0x4c8a('0x32'),_0x13d529,_0x2afbd0[_0x4c8a('0x7')][_0x4f1a91]['acwTimeout'],_0x5ce90d,_0x4f1a91);})[_0x4c8a('0x1e')](function(){delete _0x2afbd0[_0x4c8a('0xa')][_0x13d529];});}catch(_0x4fc813){logger['error'](_0x4c8a('0x37'),_0x4fc813[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')][_0x4c8a('0x39')]=function(_0x1e6174){try{var _0x2885d9=this;if(_0x2885d9[_0x4c8a('0x9')][_0x1e6174]){_0x2885d9[_0x4c8a('0x9')][_0x1e6174][_0x4c8a('0x19')]=![];var _0x445884=_0x2885d9[_0x4c8a('0x9')][_0x1e6174][_0x4c8a('0x3a')];var _0x34e0bd=_0x2885d9['timers'][_0x1e6174]['queue'];var _0x3b5705=_0x2885d9['voiceQueues'][_0x34e0bd][_0x4c8a('0x33')];logger['info'](_0x4c8a('0x3b'),_0x445884,_0x1e6174);RpcUser[_0x4c8a('0x29')](this['agents'][_0x1e6174]['id'])[_0x4c8a('0x28')](function(_0x35016e){if(_0x35016e[_0x4c8a('0x3c')]===_0x4c8a('0x22')){return RpcUser['saveUnpause'](_0x2885d9[_0x4c8a('0x8')][_0x1e6174]);}});RpcVoiceAgentReport[_0x4c8a('0x1a')]({'acwtime':_0x3b5705,'agentacw':!![]},_0x445884,_0x1e6174)['then'](function(_0x505501){logger[_0x4c8a('0x2b')](_0x4c8a('0x1b'),_0x445884,_0x3b5705,_0x505501);})['catch'](function(_0xd63e4b){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x445884,_0xd63e4b);});}else{logger[_0x4c8a('0x1d')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1e6174);if(_0x2885d9[_0x4c8a('0x9')]){logger[_0x4c8a('0x2b')](_0x4c8a('0x3d'),JSON[_0x4c8a('0x3e')](_0x2885d9['timers']));}}}catch(_0x1d7c09){logger[_0x4c8a('0x1d')](_0x4c8a('0x3f'),_0x1d7c09[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')][_0x4c8a('0x40')]=function(_0x5330a7){try{if(this[_0x4c8a('0x7')][_0x5330a7[_0x4c8a('0x21')]]&&(this[_0x4c8a('0x7')][_0x5330a7[_0x4c8a('0x21')]][_0x4c8a('0x4')]||this['voiceQueues'][_0x5330a7[_0x4c8a('0x21')]]['mandatoryDisposition'])){if(this[_0x4c8a('0x8')][_0x5330a7['interface']]){this[_0x4c8a('0xa')][_0x5330a7[_0x4c8a('0x3a')]]={'queue':_0x5330a7[_0x4c8a('0x21')],'interface':_0x5330a7[_0x4c8a('0x20')],'destlinkedid':_0x5330a7[_0x4c8a('0x2e')]};}}}catch(_0x391901){logger[_0x4c8a('0x1d')](_0x4c8a('0x41'),_0x391901[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')]['syncAgentConnectPreview']=function(_0x53d88f){try{if(this[_0x4c8a('0x7')][_0x53d88f['queue']]&&(this[_0x4c8a('0x7')][_0x53d88f[_0x4c8a('0x21')]][_0x4c8a('0x4')]||this['voiceQueues'][_0x53d88f[_0x4c8a('0x21')]][_0x4c8a('0x23')])){if(this['agents'][_0x53d88f[_0x4c8a('0x20')]]){this[_0x4c8a('0xa')][_0x53d88f[_0x4c8a('0x3a')]]={'queue':_0x53d88f['queue'],'interface':_0x53d88f[_0x4c8a('0x20')]};}}}catch(_0x532fe7){logger[_0x4c8a('0x1d')]('[ACW][syncAgentConnectPreview]\x20%s',_0x532fe7[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')]['syncHangupRequest']=function(_0x1a425c){try{if(this[_0x4c8a('0xa')][_0x1a425c[_0x4c8a('0x3a')]]&&_['isUndefined'](this[_0x4c8a('0xa')][_0x1a425c[_0x4c8a('0x3a')]][_0x4c8a('0x42')])){logger[_0x4c8a('0x2b')]('[%s][HANGUP:UNIQUEID]',_0x1a425c[_0x4c8a('0x3a')]);this['startAcw'](_0x1a425c[_0x4c8a('0x3a')]);}else if(this[_0x4c8a('0xa')][_0x1a425c[_0x4c8a('0x43')]]&&_[_0x4c8a('0x44')](this['channels'][_0x1a425c[_0x4c8a('0x43')]][_0x4c8a('0x42')])){logger[_0x4c8a('0x2b')](_0x4c8a('0x45'),_0x1a425c['linkedid']);this['startAcw'](_0x1a425c[_0x4c8a('0x43')]);}}catch(_0x30d924){logger[_0x4c8a('0x1d')](_0x4c8a('0x46'),_0x30d924[_0x4c8a('0x38')]);}};Acw['prototype']['syncHangup']=function(_0x224905){try{if(this[_0x4c8a('0xa')][_0x224905['uniqueid']]&&this[_0x4c8a('0xa')][_0x224905[_0x4c8a('0x3a')]]['attended']){logger[_0x4c8a('0x2b')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x224905[_0x4c8a('0x3a')]);this[_0x4c8a('0x1f')](_0x224905['uniqueid']);}else if(this[_0x4c8a('0xa')][_0x224905[_0x4c8a('0x43')]]&&this[_0x4c8a('0xa')][_0x224905[_0x4c8a('0x43')]]['attended']){logger[_0x4c8a('0x2b')](_0x4c8a('0x47'),_0x224905['linkedid']);this[_0x4c8a('0x1f')](_0x224905[_0x4c8a('0x43')]);}}catch(_0x3d093e){logger[_0x4c8a('0x1d')](_0x4c8a('0x48'),_0x3d093e[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')]['syncAttendedTransfer']=function(_0x4f68a1){try{if(!_[_0x4c8a('0x49')](this['channels'][_0x4f68a1[_0x4c8a('0x4a')]])){this[_0x4c8a('0x1f')](_0x4f68a1[_0x4c8a('0x4a')]);if(this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4b')]]){this['channels'][_0x4f68a1[_0x4c8a('0x4b')]][_0x4c8a('0x42')]=!![];this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4c')]]=this['channels'][_0x4f68a1['secondtransfereruniqueid']];delete this['channels'][_0x4f68a1[_0x4c8a('0x4b')]];}}else if(!_['isNil'](this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4c')]])){this[_0x4c8a('0x1f')](_0x4f68a1[_0x4c8a('0x4c')]);if(this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4d')]]){this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4d')]][_0x4c8a('0x42')]=!![];this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4a')]]=this['channels'][_0x4f68a1[_0x4c8a('0x4d')]];delete this[_0x4c8a('0xa')][_0x4f68a1[_0x4c8a('0x4d')]];}}}catch(_0x2c75b5){logger[_0x4c8a('0x1d')](_0x4c8a('0x4e'),_0x2c75b5[_0x4c8a('0x38')]);}};Acw[_0x4c8a('0x17')][_0x4c8a('0x11')]=function(_0x4f1ff4){try{if(this[_0x4c8a('0xa')][_0x4f1ff4[_0x4c8a('0x4f')]]){logger['info'](_0x4c8a('0x50'),JSON[_0x4c8a('0x3e')](_0x4f1ff4[_0x4c8a('0x4f')]));this['startAcw'](_0x4f1ff4['transfereruniqueid']);}else if(this[_0x4c8a('0xa')][_0x4f1ff4[_0x4c8a('0x51')]]){logger[_0x4c8a('0x2b')](_0x4c8a('0x52'),JSON[_0x4c8a('0x3e')](_0x4f1ff4[_0x4c8a('0x51')]));this[_0x4c8a('0x1f')](_0x4f1ff4['transfererlinkedid']);}}catch(_0x2236cf){logger[_0x4c8a('0x1d')]('[ACW][syncBlindTransfer]\x20%s',_0x2236cf['message']);}};Acw[_0x4c8a('0x17')][_0x4c8a('0x53')]=function(_0x15b795){try{if(this[_0x4c8a('0x7')][_0x15b795['queue']]&&this[_0x4c8a('0x7')][_0x15b795['queue']]['autopause']==='all'){if(this[_0x4c8a('0x8')][_0x15b795[_0x4c8a('0x20')]]){logger[_0x4c8a('0x2b')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x15b795[_0x4c8a('0x3a')],_0x15b795[_0x4c8a('0x20')],_0x15b795[_0x4c8a('0x21')]);return RpcUser['savePause'](this[_0x4c8a('0x8')][_0x15b795[_0x4c8a('0x20')]],_0x4c8a('0x54'),_0x15b795[_0x4c8a('0x3a')]);}}}catch(_0x3f9c2a){logger[_0x4c8a('0x1d')](_0x4c8a('0x55'),_0x3f9c2a[_0x4c8a('0x38')]);}};module[_0x4c8a('0x56')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3485b40..92a295d 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 _0x5274=['port','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','keepConnected','Action','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','format'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x5274,0x18a));var _0x4527=function(_0x3c1309,_0x66e161){_0x3c1309=_0x3c1309-0x0;var _0x4b71bf=_0x5274[_0x3c1309];return _0x4b71bf;};'use strict';var Manager=require(_0x4527('0x0'));var BPromise=require(_0x4527('0x1'));var util=require(_0x4527('0x2'));var logger=require(_0x4527('0x3'))(_0x4527('0x4'));var config=require(_0x4527('0x5'));var ami=new Manager(config[_0x4527('0x6')]['port'],config[_0x4527('0x6')]['ip'],config[_0x4527('0x6')]['username'],config['asterisk']['password'],!![]);ami[_0x4527('0x7')]();ami[_0x4527('0x8')]=BPromise['promisify'](ami[_0x4527('0x9')]);function error(_0xd7dd41){logger['error'](util['format'](_0x4527('0xa'),config[_0x4527('0x6')][_0x4527('0xb')],config['asterisk']['ip'],config[_0x4527('0x6')]['port'],util[_0x4527('0xc')](_0xd7dd41,![],null)));}function close(){logger[_0x4527('0xd')](util['format'](_0x4527('0xe'),config[_0x4527('0x6')][_0x4527('0xb')],config[_0x4527('0x6')]['ip'],config[_0x4527('0x6')]['port']));}ami[_0x4527('0xf')]=function(){return function(){return ami[_0x4527('0x8')]({'action':_0x4527('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0x4527('0x11')});};};ami[_0x4527('0x12')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x4527('0x13')]=function(){return function(){return ami[_0x4527('0x8')]({'action':_0x4527('0x14')});};};ami[_0x4527('0x15')]=function(){return function(){return ami[_0x4527('0x8')]({'action':'coreshowchannels'});};};function connect(){logger[_0x4527('0x16')](util[_0x4527('0x17')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x4527('0x6')][_0x4527('0xb')],config[_0x4527('0x6')]['ip'],config[_0x4527('0x6')][_0x4527('0x18')]));ami[_0x4527('0x19')](_0x4527('0xd'),error);ami[_0x4527('0x19')](_0x4527('0x1a'),close);}ami['on'](_0x4527('0x1b'),connect);ami['on'](_0x4527('0x1c'),function(_0xeeab33){logger[_0x4527('0x16')](util[_0x4527('0x17')](_0x4527('0x1d'),config[_0x4527('0x6')][_0x4527('0xb')],config[_0x4527('0x6')]['ip'],config[_0x4527('0x6')][_0x4527('0x18')],util[_0x4527('0xc')](_0xeeab33,![],null)));});ami['on'](_0x4527('0x1e'),function(){logger['info'](util[_0x4527('0x17')](_0x4527('0x1f'),config[_0x4527('0x6')][_0x4527('0xb')],config[_0x4527('0x6')]['ip'],config[_0x4527('0x6')]['port']));return Promise[_0x4527('0x20')]()[_0x4527('0x21')](ami[_0x4527('0xf')]())['then'](ami[_0x4527('0x22')]())['then'](ami['actionSipPeerStatus']())[_0x4527('0x21')](ami[_0x4527('0x13')]())[_0x4527('0x21')](ami[_0x4527('0x15')]())[_0x4527('0x23')](function(_0x5cf62e){logger[_0x4527('0xd')](_0x4527('0x24'),util[_0x4527('0xc')](_0x5cf62e,{'showHidden':![],'depth':null}));});});ami['once'](_0x4527('0xd'),error);ami['once'](_0x4527('0x1a'),close);module[_0x4527('0x25')]=ami; \ No newline at end of file +var _0xf95f=['actionDeviceStateList','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipPeerStatus','actionQueueSummary','catch','close','exports','asterisk-manager','util','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionSipShowRegistry'];(function(_0x436e3a,_0x6e9417){var _0x5d7581=function(_0x175b56){while(--_0x175b56){_0x436e3a['push'](_0x436e3a['shift']());}};_0x5d7581(++_0x6e9417);}(_0xf95f,0x19e));var _0xff95=function(_0x1554e6,_0x28607d){_0x1554e6=_0x1554e6-0x0;var _0x4cafbf=_0xf95f[_0x1554e6];return _0x4cafbf;};'use strict';var Manager=require(_0xff95('0x0'));var BPromise=require('bluebird');var util=require(_0xff95('0x1'));var logger=require('../../config/logger')('ami');var config=require('../../config/environment');var ami=new Manager(config[_0xff95('0x2')][_0xff95('0x3')],config[_0xff95('0x2')]['ip'],config[_0xff95('0x2')][_0xff95('0x4')],config['asterisk'][_0xff95('0x5')],!![]);ami[_0xff95('0x6')]();ami[_0xff95('0x7')]=BPromise[_0xff95('0x8')](ami[_0xff95('0x9')]);function error(_0x502ad0){logger[_0xff95('0xa')](util[_0xff95('0xb')](_0xff95('0xc'),config['asterisk'][_0xff95('0x4')],config[_0xff95('0x2')]['ip'],config[_0xff95('0x2')][_0xff95('0x3')],util[_0xff95('0xd')](_0x502ad0,![],null)));}function close(){logger[_0xff95('0xa')](util[_0xff95('0xb')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xff95('0x2')]['username'],config[_0xff95('0x2')]['ip'],config[_0xff95('0x2')]['port']));}ami[_0xff95('0xe')]=function(){return function(){return ami[_0xff95('0x7')]({'action':'sipshowregistry'});};};ami[_0xff95('0xf')]=function(){return function(){return ami[_0xff95('0x7')]({'action':'devicestatelist'});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xff95('0x7')]({'action':_0xff95('0x10')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0xff95('0x11')});};};ami[_0xff95('0x12')]=function(){return function(){return ami[_0xff95('0x7')]({'action':_0xff95('0x13')});};};function connect(){logger[_0xff95('0x14')](util['format'](_0xff95('0x15'),config[_0xff95('0x2')][_0xff95('0x4')],config['asterisk']['ip'],config[_0xff95('0x2')][_0xff95('0x3')]));ami[_0xff95('0x16')](_0xff95('0xa'),error);ami[_0xff95('0x16')]('close',close);}ami['on'](_0xff95('0x17'),connect);ami['on']('shutdown',function(_0x2a4304){logger[_0xff95('0x14')](util[_0xff95('0xb')](_0xff95('0x18'),config[_0xff95('0x2')]['username'],config[_0xff95('0x2')]['ip'],config['asterisk'][_0xff95('0x3')],util[_0xff95('0xd')](_0x2a4304,![],null)));});ami['on'](_0xff95('0x19'),function(){logger[_0xff95('0x14')](util[_0xff95('0xb')](_0xff95('0x1a'),config[_0xff95('0x2')]['username'],config['asterisk']['ip'],config[_0xff95('0x2')]['port']));return Promise['resolve']()[_0xff95('0x1b')](ami[_0xff95('0xe')]())[_0xff95('0x1b')](ami[_0xff95('0xf')]())[_0xff95('0x1b')](ami[_0xff95('0x1c')]())[_0xff95('0x1b')](ami[_0xff95('0x1d')]())[_0xff95('0x1b')](ami[_0xff95('0x12')]())[_0xff95('0x1e')](function(_0x1d9e5b){logger[_0xff95('0xa')]('[ami.js][fullybooted]',util[_0xff95('0xd')](_0x1d9e5b,{'showHidden':![],'depth':null}));});});ami[_0xff95('0x16')](_0xff95('0xa'),error);ami[_0xff95('0x16')](_0xff95('0x1f'),close);module[_0xff95('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index fcb4091..cd92dde 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 _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1deb72,_0x3f6338){_0x1deb72=_0x1deb72-0x0;var _0x18bbdf=_0xcb91[_0x1deb72];return _0x18bbdf;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client; \ No newline at end of file +var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 4f4395c..7319a74 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 _0x4539=['prototype','isTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','length','push','Action','then','content','true','command','iftime\x20%s,%s','timezones','catch','OVERTIME_GLOBAL_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','syncCampaigns','isIVRCampaignActive','resolve','checkIfTime','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','handlePower','power','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_INTERVAL','Timezone:\x20','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','uniqueId','YYYY-MM-DD\x20HH:mm:ss','syncAgentComplete','outboundAnswerCallsDay','agent','agiafterat','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','dialDropMaxRetry','additional','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Abandoned]','channel','actionid','strategy','rrmemory','isNil','locked','paused','stateinterface','queueBooked','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','responsetime','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','Machine','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAMDActive','HANGUP','custom:amd','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','reason19\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Normal\x20Clearing','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','inUse','pTalking','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','dialPreviewRecallmeReminder','filter','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','undefined','enqueue','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','NONE','getCaller','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','Trunk','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','getCallerIdRandom','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','dialNoSuchNumberRetryFrequency','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','reason','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','available','talking','floor','erlangAbandonmentRate','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','BLACKLIST','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','checkIsBlackList','[getContactDialerPredictive]','abandonmentRate','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','exports','util','lodash','uuid','moment','ioredis','./utils','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/voiceQueueRt','./models/history','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','startProgressive','ivrOriginated','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','isUndefined','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','format','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','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','merge','getSeconds','name','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','checkContactLowerLimitOriginate','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','NO_AVAILABLE_CONTACTS','state','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','INACTIVE','isIVRCampaign','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','Error','active','SIP/%s','status','reachable','unmonitored'];(function(_0x1aefdb,_0x1c45a1){var _0x12be3c=function(_0x1ba602){while(--_0x1ba602){_0x1aefdb['push'](_0x1aefdb['shift']());}};_0x12be3c(++_0x1c45a1);}(_0x4539,0x192));var _0x9453=function(_0x525e6b,_0x51e458){_0x525e6b=_0x525e6b-0x0;var _0x3fbe1a=_0x4539[_0x525e6b];return _0x3fbe1a;};'use strict';var util=require(_0x9453('0x0'));var _=require(_0x9453('0x1'));var uuid=require(_0x9453('0x2'));var moment=require(_0x9453('0x3'));var rr=require('rr');var Redis=require(_0x9453('0x4'));var utils=require(_0x9453('0x5'));var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require(_0x9453('0x6'));var logger=require('../../../config/logger')(_0x9453('0x7'));var loggerBooked=require(_0x9453('0x8'))(_0x9453('0x9'));var loggerPredictive=require('../../../config/logger')(_0x9453('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x9453('0xb'));var loggerSyncQueueSummary=require(_0x9453('0x8'))('syncQueueSummary');var ami=require('../ami');config[_0x9453('0xc')]=_[_0x9453('0xd')](config['redis'],{'host':_0x9453('0xe'),'port':0x18eb});var io=require(_0x9453('0xf'))(new Redis(config[_0x9453('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0x9453('0x10'));var RpcSetting=require('../rpc/setting');var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x9453('0x11'));var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x9453('0x12'));var Hangup=require(_0x9453('0x13'));var ipAgi=process[_0x9453('0x14')][_0x9453('0x15')]||'127.0.0.1';var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x15a96e){this[_0x9453('0x16')]=this[_0x9453('0x16')]?this['tail']['finally'](_0x15a96e):_0x15a96e();};function Dialer(_0x279731,_0x5b8a4b){this['sequence']=new Sequence();this[_0x9453('0x17')]=_0x5b8a4b;this['voiceQueues']=_0x279731[_0x9453('0x18')];this[_0x9453('0x19')]=_0x279731['campaigns'];this[_0x9453('0x1a')]=_0x279731['agents'];this[_0x9453('0x1b')]=_0x279731['trunks'];this[_0x9453('0x1c')]=config[_0x9453('0x1c')]||0x2;this['channels']={};this[_0x9453('0x1d')]={};this[_0x9453('0x1e')]={};this['uniqueId']={};this['optionPredictive']={};this['startPredictive']={};this[_0x9453('0x1f')]={};this[_0x9453('0x20')]={};this['queueBooked']={};this['queueBookedRR']={};this[_0x9453('0x21')]={};ami['on'](_0x9453('0x22'),this['syncAgentConnect'][_0x9453('0x23')](this));ami['on'](_0x9453('0x24'),this[_0x9453('0x25')][_0x9453('0x23')](this));ami['on'](_0x9453('0x26'),this[_0x9453('0x27')][_0x9453('0x23')](this));ami['on'](_0x9453('0x28'),this['syncAgentComplete']['bind'](this));ami['on'](_0x9453('0x29'),this[_0x9453('0x2a')][_0x9453('0x23')](this));ami['on'](_0x9453('0x2b'),this[_0x9453('0x2c')][_0x9453('0x23')](this));ami['on']('hangup',this['syncHangup'][_0x9453('0x23')](this));ami['on'](_0x9453('0x2d'),this[_0x9453('0x2e')][_0x9453('0x23')](this));ami['on']('varset',this[_0x9453('0x2f')][_0x9453('0x23')](this));ami['on'](_0x9453('0x30'),this[_0x9453('0x31')][_0x9453('0x23')](this));ami['on']('queuestatuscomplete',this[_0x9453('0x32')][_0x9453('0x23')](this));this[_0x9453('0x33')]();this[_0x9453('0x34')]();RpcSetting[_0x9453('0x35')]()['then'](function(_0xebf7c){previewRecallmeReminderInterval=_0xebf7c[_0x9453('0x36')];});}function isNotNull(_0x23afc6){return _0x23afc6!==null&&!_[_0x9453('0x37')](_0x23afc6);}function msgResponse(_0xa2b08f,_0xed0860,_0x355624){return{'action':_0xa2b08f,'response':_0xed0860,'message':_0x355624,'stack':_0x355624};}function emit(_0x1b7d96,_0x3d1c89,_0x11fe5b){io['to'](_0x1b7d96)[_0x9453('0x38')](_0x3d1c89,_0x11fe5b);}function emitOutboundVoiceQueueSummary(_0x2875ee){if(_0x2875ee[_0x9453('0x39')]===_0x9453('0x3a')){logger[_0x9453('0x3b')](_0x9453('0x3c'),util[_0x9453('0x3d')](_0x2875ee,{'showHidden':![],'depth':null}));emit(util[_0x9453('0x3e')]('voice:queue:%s',_0x2875ee['name']),_0x9453('0x3f'),_0x2875ee);}}function checkGetDataPredictive(_0x3fb949){if(isNotNull(_0x3fb949)&&!_[_0x9453('0x40')](_0x3fb949)){loggerPredictive[_0x9453('0x41')](_0x9453('0x42'));loggerPredictive[_0x9453('0x41')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3fb949['predictiveIntervalTotalCalls']);loggerPredictive[_0x9453('0x41')](_0x9453('0x43'),_0x3fb949['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x9453('0x44'),_0x3fb949['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x9453('0x41')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3fb949[_0x9453('0x45')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x46'),_0x3fb949[_0x9453('0x47')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x48'),_0x3fb949[_0x9453('0x49')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x4a'));if(_0x3fb949[_0x9453('0x4b')]>0x0){if(!_[_0x9453('0x37')](_0x3fb949[_0x9453('0x49')])&&_0x3fb949[_0x9453('0x49')]>0x0){return!![];}loggerPredictive[_0x9453('0x41')](_0x9453('0x4c'));if(!_[_0x9453('0x37')](_0x3fb949[_0x9453('0x47')])&&_0x3fb949['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x9453('0x4d'));}else{loggerPredictive[_0x9453('0x41')](_0x9453('0x4e'));}}else{loggerPredictive[_0x9453('0x41')](_0x9453('0x4f'));}return![];}function mergeDataErlangB(_0x201b84){return function(_0x125e38){loggerPredictive[_0x9453('0x41')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x9453('0x41')](_0x9453('0x50'),_0x125e38[_0x9453('0x51')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x52'),_0x125e38[_0x9453('0x53')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x54'),_0x125e38['erlangAbandonmentRate']);loggerPredictive['info'](_0x9453('0x55'),_0x125e38[_0x9453('0x56')]);loggerPredictive[_0x9453('0x41')](_0x9453('0x54'),_0x125e38['erlangAbandonmentRate']);loggerPredictive['info'](_0x9453('0x4a'));_[_0x9453('0x57')](_0x201b84,_0x125e38);};}function ifInterval(_0x3242fa,_0x1b204d){if(_[_0x9453('0x37')](_0x1b204d)){return![];}return utils[_0x9453('0x58')](undefined,_0x1b204d)<_0x3242fa*0x3c;}function clearPredictiveAttributes(_0x49218f){if(_0x49218f[_0x9453('0x1f')]){_0x49218f[_0x9453('0x1f')]=undefined;loggerPredictive[_0x9453('0x3b')](_0x49218f[_0x9453('0x59')],_0x9453('0x5a'));}if(_0x49218f[_0x9453('0x5b')]){_0x49218f[_0x9453('0x5b')]=undefined;loggerPredictive[_0x9453('0x3b')](_0x49218f[_0x9453('0x59')],_0x9453('0x5c'));}if(_0x49218f['handlePredictive']){clearInterval(_0x49218f[_0x9453('0x5d')]);_0x49218f['handlePredictive']=undefined;loggerPredictive['debug'](_0x49218f[_0x9453('0x59')],_0x9453('0x5e'));}}function loggerCatchPredictive(_0x45516e,_0x3bedb4){return function(_0x8434de){loggerPredictive['error'](_0x3bedb4[_0x9453('0x59')],_0x45516e);loggerPredictive[_0x9453('0x5f')](_0x8434de['stack']);clearPredictiveAttributes(_0x3bedb4);};}function loggerCatch(_0x416fa2){return function(_0x40c43e){logger[_0x9453('0x5f')](_0x416fa2,util['inspect'](_0x40c43e,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4c493d,_0x1259e0,_0x315aa1){return function(_0x5732fe){utils[_0x9453('0x60')](_0x1259e0,_0x315aa1,0x0);_0x1259e0['temp']=0x0;logger[_0x9453('0x5f')](_0x4c493d,util['inspect'](_0x5732fe,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3b7f31){return function(_0x300858){if(isNotNull(_0x300858)&&isNotNull(_0x300858[0x0])){if(_0x300858[0x0][_0x9453('0x61')]>0x0){_0x3b7f31[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x64')];logger[_0x9453('0x41')](_0x9453('0x65')+_0x3b7f31['name'],_0x300858[0x0][_0x9453('0x61')],'contacts');}else{_0x3b7f31['message']=utils[_0x9453('0x63')][_0x9453('0x66')];logger['info']('[getContactDialer2][Empty]'+_0x3b7f31[_0x9453('0x59')]);}}};}function createObjHistory(_0x4cb7d6,_0x2fff15,_0x50b1f5,_0x2252f7,_0x46d023){_0x4cb7d6[_0x9453('0x62')]=_0x50b1f5;var _0xce9d00=new Action(_0x4cb7d6,_0x2fff15);var _0xb103d7=new History(_0xce9d00);_0xb103d7[_0x9453('0x67')]=_0x2252f7;_0xb103d7['statedesc']=_0x46d023;_0xb103d7[_0x9453('0x68')]=_0xce9d00[_0x9453('0x69')];return _0xb103d7;}function unlockQueueStatus(_0x48f5ed,_0x295c5f){setTimeout(function(){if(_['isUndefined'](_0x48f5ed[_0x9453('0x6a')])){loggerBooked[_0x9453('0x5f')](_0x9453('0x6b'),_0x295c5f);}_0x48f5ed['queueStatusComplete']=!![];loggerBooked[_0x9453('0x41')](_0x9453('0x6c'),_0x295c5f,JSON[_0x9453('0x6d')](_[_0x9453('0x6e')](_0x48f5ed,[_0x9453('0x59'),_0x9453('0x6a')])));},0x1f3);}function checkInterval(_0x59b7a5){return function(){if(!isNotNull(_0x59b7a5[_0x9453('0x6f')])){_0x59b7a5['message']=utils[_0x9453('0x63')][_0x9453('0x70')];throw _0x59b7a5[_0x9453('0x59')]+_0x9453('0x71');}if(!isNotNull(_0x59b7a5['Interval'][_0x9453('0x72')])){_0x59b7a5[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x70')];throw _0x59b7a5['name']+_0x9453('0x71');}if(!isNotNull(_[_0x9453('0x40')](_0x59b7a5[_0x9453('0x6f')][_0x9453('0x72')]))){_0x59b7a5[_0x9453('0x62')]=utils[_0x9453('0x63')]['NULL_INTERVAL'];throw _0x59b7a5[_0x9453('0x59')]+_0x9453('0x71');}};}function checkIsIVRCampaignActive(_0x18beec){return function(){if(!utils['isIVRCampaignActive'](_0x18beec)){_0x18beec[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x73')];throw _0x18beec[_0x9453('0x59')]+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0x5f5174){if(utils[_0x9453('0x74')](_0x5f5174)){emit(util['format']('campaign:ivr:%s',_0x5f5174[_0x9453('0x59')]),_0x9453('0x75'),_0x5f5174);}}function loggerCatchQueueSummary(_0x5a9d6a,_0x423949){return function(_0x3d6367){clearPredictiveAttributes(_0x423949);emitCampaignSummary(_0x423949);loggerSyncQueueSummary['debug'](_0x5a9d6a,util['inspect'](_0x3d6367,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x56609c){if(_0x56609c['sendMessageOneNotActive']){if(_0x56609c['originated']===0x0){_0x56609c[_0x9453('0x76')]=![];_0x56609c[_0x9453('0x62')]=utils['CAMPAIGN_STATUS'][_0x9453('0x73')];loggerSyncQueueSummary[_0x9453('0x3b')](_0x9453('0x77'),_0x56609c[_0x9453('0x59')],_0x9453('0x78'));}else{_0x56609c[_0x9453('0x62')]=utils[_0x9453('0x63')]['DISACTIVED'];loggerSyncQueueSummary[_0x9453('0x3b')](_0x9453('0x77'),_0x56609c['name'],_0x9453('0x79'));}emitCampaignSummary(_0x56609c);}}function myreject(_0xa0eafe){return function(_0x57a949){return _0xa0eafe(msgResponse(_0x9453('0x7a'),_0x9453('0x7b'),JSON[_0x9453('0x6d')](_0x57a949)));};}Dialer['prototype']['isTrunkReachable']=function(_0x2eb16b){return!_[_0x9453('0x37')](_0x2eb16b)&&_0x2eb16b&&!_[_0x9453('0x37')](_0x2eb16b[_0x9453('0x59')])&&!_[_0x9453('0x37')](_0x2eb16b[_0x9453('0x7c')])&&_0x2eb16b[_0x9453('0x7c')]&&(this[_0x9453('0x1b')][util[_0x9453('0x3e')](_0x9453('0x7d'),_0x2eb16b['name'])][_0x9453('0x7e')]===_0x9453('0x7f')||this['trunks'][util[_0x9453('0x3e')](_0x9453('0x7d'),_0x2eb16b[_0x9453('0x59')])][_0x9453('0x7e')]===_0x9453('0x80'));};Dialer[_0x9453('0x81')]['checkIsTrunkReachable']=function(_0x2bab3b){var _0x1b477=this;return function(){if(!_0x1b477[_0x9453('0x82')](_0x2bab3b['Trunk'])){if(!_0x1b477[_0x9453('0x82')](_0x2bab3b[_0x9453('0x83')])){_0x2bab3b[_0x9453('0x62')]=utils['CAMPAIGN_STATUS'][_0x9453('0x84')];throw _0x2bab3b[_0x9453('0x59')]+_0x9453('0x85');}}};};Dialer[_0x9453('0x81')]['checkIfTime']=function(_0x348048,_0x2a3d59,_0x470b32,_0x482115){var _0x4763c9=this;return function(){var _0x1ea293=!![];return _0x4763c9[_0x9453('0x86')](_0x348048,_0x2a3d59,_0x470b32,_0x482115,_0x1ea293);};};Dialer[_0x9453('0x81')][_0x9453('0x87')]=function(_0x53e929,_0x287615,_0x164edf,_0x1783b6){var _0x3f6a8b=this;return function(){var _0xd7990c=![];return _0x3f6a8b[_0x9453('0x86')](_0x53e929['Intervals'],_0x287615,_0x164edf,_0x1783b6,_0xd7990c);};};Dialer[_0x9453('0x81')][_0x9453('0x86')]=function(_0x10532e,_0x4b2197,_0xbd8d01,_0x2d9150,_0x42ad05){var _0x589c18=[];return new Promise(function(_0x5c720d,_0x18e5de){if(!isNotNull(_0x10532e)){_0x2d9150[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x70')];return _0x18e5de(msgResponse(_0x9453('0x88'),'Failure',_0xbd8d01+_0x9453('0x89')));}if(_[_0x9453('0x40')](_0x10532e)){_0x2d9150[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x8a')];return _0x18e5de(msgResponse('ifTime','Failure',_0xbd8d01+_0x9453('0x8b')));}if(_0x4b2197&&_['isUndefined'](config['timezones'][_0x4b2197])){_0x2d9150[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x8c')];return _0x18e5de(msgResponse('ifTime',_0x9453('0x8d'),_0xbd8d01+_0x9453('0x8e')+_0x4b2197));}if(_['isArray'](_0x10532e)){for(var _0x266976=0x0;_0x266976<_0x10532e[_0x9453('0x8f')];_0x266976+=0x1){_0x589c18[_0x9453('0x90')](ami[_0x9453('0x91')]({'action':'command','command':util['format']('iftime\x20%s,%s',_0x10532e[_0x266976]['interval'],!_['isUndefined'](config['timezones'][_0x4b2197])?_0x4b2197:'')})[_0x9453('0x92')](function(_0x305fea){return _0x305fea[_0x9453('0x93')]['indexOf'](_0x9453('0x94'))>=0x0;})['catch'](myreject(_0x18e5de)));}}else{_0x589c18[_0x9453('0x90')](ami[_0x9453('0x91')]({'action':_0x9453('0x95'),'command':util[_0x9453('0x3e')](_0x9453('0x96'),_0x10532e,!_['isUndefined'](config[_0x9453('0x97')][_0x4b2197])?_0x4b2197:'')})[_0x9453('0x92')](function(_0x3c7cd3){return _0x3c7cd3[_0x9453('0x93')]['indexOf'](_0x9453('0x94'))>=0x0;})[_0x9453('0x98')](myreject(_0x18e5de)));}Promise['all'](_0x589c18)[_0x9453('0x92')](function(_0x22ccc7){var _0x5a69b1=_['some'](_0x22ccc7);if(_0x5a69b1){return _0x5c720d(_0x5a69b1);}else{_0x2d9150[_0x9453('0x62')]=_0x42ad05?utils[_0x9453('0x63')][_0x9453('0x99')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];return _0x18e5de(msgResponse(_0x9453('0x9a'),'Failure',_0x9453('0x9b')+_0x42ad05+'\x20'+_0xbd8d01+_0x9453('0x9c')+util['inspect'](_0x10532e,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x4b2197));}})[_0x9453('0x98')](function(_0x488412){return _0x18e5de(msgResponse(_0x9453('0x88'),_0x9453('0x8d'),JSON[_0x9453('0x6d')](_0x488412)));});});};Dialer[_0x9453('0x81')]['loopCampaigns']=function(){var _0x5016ee=this;return cmHopper['resetActiveCalls']({'active':![]},{'where':{'active':!![]}})[_0x9453('0x92')](function(){setInterval(function(){_0x5016ee[_0x9453('0x9d')]();},0x3e8);});};Dialer[_0x9453('0x81')][_0x9453('0x9d')]=function(){var _0x25d44f=this;var _0x2bb123;for(var _0xf1a332 in this[_0x9453('0x19')]){if(typeof this[_0x9453('0x19')][_0xf1a332]!=='undefined'){_0x2bb123=this[_0x9453('0x19')][_0xf1a332];if(utils[_0x9453('0x74')](_0x2bb123)&&utils[_0x9453('0x9e')](_0x2bb123)){_0x2bb123[_0x9453('0x76')]=!![];Promise[_0x9453('0x9f')]()[_0x9453('0x92')](checkIsIVRCampaignActive(_0x2bb123))['then'](checkInterval(_0x2bb123))['then'](_0x25d44f['checkIsTrunkReachable'](_0x2bb123))['then'](_0x25d44f[_0x9453('0xa0')](_0x2bb123[_0x9453('0xa1')],_0x2bb123['dialTimezone'],_0x2bb123['name'],_0x2bb123))['then'](_0x25d44f[_0x9453('0x87')](_0x2bb123[_0x9453('0x6f')],_0x2bb123[_0x9453('0xa2')],_0x2bb123[_0x9453('0x59')],_0x2bb123))[_0x9453('0x92')](_0x25d44f[_0x9453('0xa3')](_0x2bb123))[_0x9453('0x98')](loggerCatchQueueSummary(_0x9453('0xa4'),_0x2bb123));}else{notSendMessagesCampaign(_0x2bb123);}}}};Dialer['prototype'][_0x9453('0xa5')]=function(_0x1e17d6){if(_0x1e17d6['dialMethod']!==_0x9453('0xa')){clearPredictiveAttributes(_0x1e17d6);}switch(_0x1e17d6[_0x9453('0xa6')]){case'progressive':this[_0x9453('0xa7')](_0x1e17d6,0x1);break;case _0x9453('0xa8'):this[_0x9453('0xa7')](_0x1e17d6,_0x1e17d6['dialPowerLevel']);break;case _0x9453('0xa'):this[_0x9453('0xa')](_0x1e17d6);break;case _0x9453('0x9'):this[_0x9453('0xa7')](_0x1e17d6,0x1);break;default:logger['error'](_0x9453('0xa9'),_0x1e17d6[_0x9453('0x59')],_0x9453('0xaa'));}};Dialer[_0x9453('0x81')][_0x9453('0x88')]=function(_0x16d4cd,_0x4f09fc){var _0x277a4f=_0x16d4cd[_0x9453('0xa2')];var _0x295b7a=_0x4f09fc?_0x16d4cd[_0x9453('0xa1')]:_0x16d4cd[_0x9453('0x6f')][_0x9453('0x72')];logger[_0x9453('0xab')](_0x9453('0xac'),_0x295b7a,_0x277a4f,_0x16d4cd[_0x9453('0x59')],util['format'](_0x9453('0xad'),_0x16d4cd[_0x9453('0x59')],_0x16d4cd['id']));var _0x3fad95=null;return Interval[_0x9453('0xae')](_0x295b7a,_0x277a4f)['then'](function(_0x3eac44){if(_0x3eac44===!![]){return _0x3eac44;}else{_0x16d4cd[_0x9453('0x62')]=_0x4f09fc?utils['CAMPAIGN_STATUS'][_0x9453('0x99')]:utils[_0x9453('0x63')][_0x9453('0xaf')];_0x3fad95=msgResponse('[ifTime][promiseAll]',_0x9453('0x8d'),_0x9453('0x9b')+_0x4f09fc+'\x20'+_0x16d4cd['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x9453('0x3d')](_0x295b7a,{'showHidden':![],'depth':null})+_0x9453('0xb0')+_0x277a4f);}if(_0x3fad95!==null){logger[_0x9453('0xab')](_0x9453('0xb1'),_0x3fad95);_0x3fad95['isGlobal']=_0x4f09fc;throw _0x3fad95;}})[_0x9453('0x98')](function(_0x37f52a){logger[_0x9453('0x5f')](_0x9453('0xb2'),_0x37f52a);throw msgResponse(_0x9453('0x7a'),'Error',util[_0x9453('0x3d')](_0x37f52a,{'showHidden':![],'depth':null}));});};Dialer[_0x9453('0x81')]['syncAgentConnect']=function(_0x339da7){if(this[_0x9453('0x18')][_0x339da7[_0x9453('0xb3')]]){if(this['uniqueId'][_0x339da7[_0x9453('0xb4')]]&&this['uniqueId'][_0x339da7[_0x9453('0xb4')]][_0x9453('0x39')]!==_0x9453('0xb5')){this[_0x9453('0xb6')](this['voiceQueues'][_0x339da7[_0x9453('0xb3')]]);this[_0x9453('0xb7')][_0x339da7['uniqueid']]['answertime']=moment()['format'](_0x9453('0xb8'));}}};Dialer[_0x9453('0x81')][_0x9453('0xb9')]=function(_0x10a0c5){var _0x1b36c0=this[_0x9453('0xb7')][_0x10a0c5[_0x9453('0xb4')]];if(this[_0x9453('0x18')][_0x10a0c5['queue']]){if(_0x1b36c0&&_0x1b36c0[_0x9453('0x39')]!=='ivr'){delete this[_0x9453('0xb7')][_0x10a0c5[_0x9453('0xb4')]];this['voiceQueues'][_0x10a0c5['queue']][_0x9453('0xba')]+=0x1;var _0x15a3a7=new AgentComplete(_0x1b36c0,_0x10a0c5);if(_0x10a0c5['reason']===_0x9453('0xbb')){_0x15a3a7[_0x9453('0xbc')]=this[_0x9453('0x18')][_0x10a0c5['queue']]['dialQueueProject2']&&this[_0x9453('0x18')][_0x10a0c5[_0x9453('0xb3')]][_0x9453('0xbd')]?moment()[_0x9453('0x3e')](_0x9453('0xb8')):undefined;}hopperUtils[_0x9453('0xbe')](_0x15a3a7)[_0x9453('0x98')](loggerCatch(_0x9453('0xbf')));hopperUtils[_0x9453('0xc0')](_0x15a3a7)[_0x9453('0x98')](loggerCatch(_0x9453('0xc1')));}}};Dialer[_0x9453('0x81')][_0x9453('0x25')]=function(_0x2dd0f8){var _0x14cc27=this[_0x9453('0xb7')][_0x2dd0f8['uniqueid']];var _0x4518c1=this;var _0x14ab98=![];var _0x1b9fcc;var _0x3c572c;if(this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]]){if(_0x14cc27&&_0x14cc27[_0x9453('0x39')]!==_0x9453('0xb5')){delete this[_0x9453('0xb7')][_0x2dd0f8[_0x9453('0xb4')]];this['updateOriginated'](this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]]);_0x14cc27[_0x9453('0xc2')]=moment()[_0x9453('0x3e')](_0x9453('0xb8'));var _0x5ed5f6=new QueueCallerAbandon(_0x14cc27,_0x2dd0f8);if(utils[_0x9453('0x58')](_0x14cc27[_0x9453('0xc2')],_0x14cc27['responsetime'])>=_0x14cc27[_0x9453('0xc3')]){this[_0x9453('0x18')][_0x2dd0f8['queue']][_0x9453('0xc4')]+=0x1;this['voiceQueues'][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xc5')]+=0x1;this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xc6')]+=0x1;_0x5ed5f6[_0x9453('0x67')]=0xa;_0x5ed5f6[_0x9453('0xc7')]=_0x9453('0xc8');_0x5ed5f6[_0x9453('0xc9')]=_0x9453('0xca');_0x5ed5f6['agiafterat']=this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xcb')]?moment()['format'](_0x9453('0xb8')):undefined;_0x5ed5f6[_0x9453('0xcc')]+=0x1;_0x5ed5f6[_0x9453('0xcd')]+=0x1;_0x1b9fcc=this[_0x9453('0x18')][_0x2dd0f8['queue']][_0x9453('0xce')];_0x3c572c=this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xcf')];hopperUtils[_0x9453('0xd0')](_0x5ed5f6,_0x5ed5f6[_0x9453('0x67')],_0x14cc27[_0x9453('0xd1')])[_0x9453('0x92')](function(_0x343943){_0x14ab98=_0x343943['additional']==0x1;if(_0x5ed5f6[_0x9453('0xcc')]>=_0x4518c1['voiceQueues'][_0x2dd0f8['queue']][_0x9453('0xd2')]){_0x4518c1['queueCallerAbandonCreateState'](_0x5ed5f6,_0x343943[_0x9453('0xd3')]);}else{hopperUtils[_0x9453('0xd4')]({'active':![],'countdropretry':_0x5ed5f6[_0x9453('0xcc')],'scheduledat':moment()[_0x9453('0xd5')](_0x4518c1[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]]['dialDropRetryFrequency'],_0x9453('0xd6'))['format'](_0x9453('0xb8')),'ContactId':_0x14cc27[_0x9453('0xd7')],'ListId':_0x14cc27[_0x9453('0xd8')],'VoiceQueueId':_0x14cc27[_0x9453('0xd9')]||undefined,'CampaignId':_0x14cc27[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0xdb')));var _0x59cbd0=new History(_0x5ed5f6);_0x59cbd0[_0x9453('0x67')]=0xa;_0x59cbd0[_0x9453('0xc7')]=_0x9453('0xc8');_0x59cbd0['starttime']=moment()[_0x9453('0x3e')](_0x9453('0xb8'));_0x59cbd0['endtime']=_0x59cbd0['starttime'];_0x59cbd0['calleridname']=_0x5ed5f6[_0x9453('0xdc')];_0x59cbd0[_0x9453('0xdd')]=_0x5ed5f6[_0x9453('0xdd')];hopperUtils[_0x9453('0xbe')](_0x59cbd0)[_0x9453('0x98')](loggerCatch(_0x9453('0xde')));}})[_0x9453('0x92')](function(){if(_0x14ab98)hopperUtils[_0x9453('0xdf')](_0x5ed5f6,_0x1b9fcc,_0x3c572c)[_0x9453('0x92')](function(){return 0x1;});});}else{this['voiceQueues'][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0x45')]+=0x1;this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xe0')]+=0x1;_0x5ed5f6[_0x9453('0x67')]=0xb;_0x5ed5f6[_0x9453('0xc7')]=_0x9453('0xe1');_0x5ed5f6['dropreason']=_0x9453('0xe2');_0x5ed5f6[_0x9453('0xe3')]+=0x1;_0x5ed5f6[_0x9453('0xcd')]+=0x1;_0x1b9fcc=this[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xe4')];_0x3c572c=this[_0x9453('0x18')][_0x2dd0f8['queue']][_0x9453('0xcf')];hopperUtils[_0x9453('0xd0')](_0x5ed5f6,_0x5ed5f6[_0x9453('0x67')],_0x14cc27[_0x9453('0xd1')])[_0x9453('0x92')](function(_0x2fe951){if(_0x5ed5f6[_0x9453('0xe3')]>=_0x4518c1[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]][_0x9453('0xe5')]){_0x4518c1[_0x9453('0xe6')](_0x5ed5f6,_0x2fe951['additional']);}else{hopperUtils[_0x9453('0xd4')]({'active':![],'countabandonedretry':_0x5ed5f6[_0x9453('0xe3')],'scheduledat':moment()[_0x9453('0xd5')](_0x4518c1[_0x9453('0x18')][_0x2dd0f8[_0x9453('0xb3')]]['dialAbandonedRetryFrequency'],_0x9453('0xd6'))[_0x9453('0x3e')](_0x9453('0xb8')),'ContactId':_0x14cc27[_0x9453('0xd7')],'ListId':_0x14cc27[_0x9453('0xd8')],'VoiceQueueId':_0x14cc27[_0x9453('0xd9')]||undefined,'CampaignId':_0x14cc27['CampaignId']||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0xe7')));var _0x16c034=new History(_0x5ed5f6);_0x16c034[_0x9453('0x67')]=0xb;_0x16c034[_0x9453('0xc7')]='Abandoned';_0x16c034['starttime']=moment()[_0x9453('0x3e')](_0x9453('0xb8'));_0x16c034['endtime']=_0x16c034['starttime'];_0x16c034[_0x9453('0xdc')]=_0x5ed5f6[_0x9453('0xdc')];_0x16c034['calleridnum']=_0x5ed5f6[_0x9453('0xdd')];hopperUtils[_0x9453('0xbe')](_0x16c034)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x14ab98)hopperUtils['swapAdditionalPhones'](_0x5ed5f6,_0x1b9fcc,_0x3c572c)['then'](function(){return 0x1;});});}}}};Dialer[_0x9453('0x81')][_0x9453('0x2e')]=function(_0x3eb080){if(this[_0x9453('0x1d')][_0x3eb080[_0x9453('0xb4')]]){this[_0x9453('0x1d')][_0x3eb080['uniqueid']][_0x9453('0xe8')]=_0x3eb080[_0x9453('0xe8')];}if(this[_0x9453('0xb7')][_0x3eb080[_0x9453('0xb4')]]){this[_0x9453('0xb7')][_0x3eb080['uniqueid']]['channel']=_0x3eb080[_0x9453('0xe8')];}};Dialer[_0x9453('0x81')]['syncQueueMember']=function(_0x1feb09){if(!this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]]){return;}var _0x4dcfe6=this[_0x9453('0x18')][this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xb3')]][_0x9453('0xea')]||_0x9453('0xeb');if(_0x4dcfe6==='roundrobin'){if(this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]]&&_[_0x9453('0xec')](this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xed')])&&_0x1feb09[_0x9453('0x7e')]==='1'&&_0x1feb09[_0x9453('0xee')]==='0'){if(this[_0x9453('0x1a')][_0x1feb09['stateinterface']]){if(!this[_0x9453('0x1a')][_0x1feb09[_0x9453('0xef')]][_0x9453('0xed')]){this[_0x9453('0x1a')][_0x1feb09[_0x9453('0xef')]][_0x9453('0xed')]=!![];this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xed')]=!![];this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xef')]=_0x1feb09[_0x9453('0xef')];}}}}else if(_0x4dcfe6===_0x9453('0xeb')){if(this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]]){if(this['agents'][_0x1feb09[_0x9453('0xef')]]){this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xef')]=_0x1feb09['stateinterface'];if(_['isNil'](this[_0x9453('0xf0')][this['actions'][_0x1feb09[_0x9453('0xe9')]]['queue']])){this[_0x9453('0xf0')][this[_0x9453('0x1d')][_0x1feb09['actionid']]['queue']]=[];}this[_0x9453('0xf0')][this['actions'][_0x1feb09[_0x9453('0xe9')]][_0x9453('0xb3')]][_0x9453('0x90')](_[_0x9453('0x57')](_[_0x9453('0x6e')](this[_0x9453('0x1d')][_0x1feb09[_0x9453('0xe9')]],['idHopper',_0x9453('0xef')]),{'status':_0x1feb09[_0x9453('0x7e')],'paused':_0x1feb09['paused']}));}}}};Dialer[_0x9453('0x81')]['syncQueueStatusComplete']=function(_0x350a60){if(!this[_0x9453('0x1d')][_0x350a60['actionid']]){return;}var _0x43c2c0=this;var _0x5c491b=this['voiceQueues'][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]]['queue']];var _0x2017c3=_0x5c491b['strategy']||_0x9453('0xeb');if(_0x2017c3===_0x9453('0xf1')){if(this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]]&&this['actions'][_0x350a60[_0x9453('0xe9')]][_0x9453('0xef')]){this[_0x9453('0x17')][_0x9453('0xf2')](this['actions'][_0x350a60[_0x9453('0xe9')]][_0x9453('0xf3')],this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xef')])[_0x9453('0x98')](function(_0x357bdf){logger[_0x9453('0x5f')](_0x9453('0xf4'),util[_0x9453('0x3d')](_0x357bdf,{'showHidden':![],'depth':null}));})[_0x9453('0xf5')](function(){_0x43c2c0[_0x9453('0xb6')](_0x43c2c0[_0x9453('0x18')][_0x43c2c0[_0x9453('0x1d')][_0x350a60['actionid']]['queue']]);_0x43c2c0['agents'][_0x43c2c0[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xef')]]['locked']=![];delete _0x43c2c0[_0x9453('0x1d')][_0x350a60['actionid']];unlockQueueStatus(_0x5c491b);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]]);hopperUtils[_0x9453('0xd4')]({'active':![],'ContactId':this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]]['ContactId'],'ListId':this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xd8')],'VoiceQueueId':this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xd9')]||undefined,'CampaignId':this[_0x9453('0x1d')][_0x350a60['actionid']][_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0xf6')));delete this['actions'][_0x350a60[_0x9453('0xe9')]];unlockQueueStatus(_0x5c491b);}}else if(_0x2017c3===_0x9453('0xeb')){var _0x9af859;if(this[_0x9453('0x1d')][_0x350a60['actionid']]&&!_[_0x9453('0x40')](this['queueBooked'][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]])){if(this[_0x9453('0xf7')][_0x43c2c0['actions'][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]]){this['queueBookedRR'][_0x43c2c0['actions'][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]]=this[_0x9453('0xf7')][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]]['queue']]?this[_0x9453('0xf7')][this['actions'][_0x350a60['actionid']][_0x9453('0xb3')]]:this[_0x9453('0xf0')][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]]?this[_0x9453('0xf0')][this[_0x9453('0x1d')][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]][_0x9453('0xf8')]||0x0:0x0;}this[_0x9453('0xf0')][this['actions'][_0x350a60[_0x9453('0xe9')]][_0x9453('0xb3')]][_0x9453('0xf8')]=this['queueBookedRR'][this[_0x9453('0x1d')][_0x350a60['actionid']][_0x9453('0xb3')]];for(var _0x46b7d9=0x0;_0x46b7d9=_0x3712fe['dialGlobalMaxRetry']){_0x1d5ed2[_0x9453('0x119')](_0x238649,_0x3e26d2,_0x5859c1,'reason19\x20machine....');}else{if(_0x238649[_0x9453('0x112')]>=_0x3712fe[_0x9453('0x11a')]){_0x1d5ed2[_0x9453('0x11b')](_0x238649,_0x3e26d2,_0x5859c1,'reason\x2019\x20machine....');}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x238649['countmachineretry'],'scheduledat':moment()['add'](_0x3712fe[_0x9453('0x11c')],'minutes')[_0x9453('0x3e')](_0x9453('0xb8')),'ContactId':_0x238649[_0x9453('0xd7')],'ListId':_0x238649[_0x9453('0xd8')],'VoiceQueueId':_0x238649[_0x9453('0xd9')]||undefined,'CampaignId':_0x238649['CampaignId']||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x11d')));_0x3e26d2({'reschedule':0x1});}}});}if(_0x3f7008['type']===_0x9453('0xb5')&&this[_0x9453('0x19')][_0x3f7008[_0x9453('0xb3')]][_0x9453('0x11e')]&&_0x457413[_0x9453('0x110')]===_0x9453('0x11f')){delete this[_0x9453('0xb7')][_0x457413['uniqueid']];this[_0x9453('0xb6')](this[_0x9453('0x19')][_0x3f7008[_0x9453('0xb3')]]);_0x47a862=new Hangup(_0x3f7008,_0x457413);_0x47a862[_0x9453('0x67')]=0x12;_0x47a862[_0x9453('0xc7')]=_0x9453('0x109');_0x47a862[_0x9453('0x10a')]=_0x9453('0x10b');ami[_0x9453('0x38')](_0x9453('0x120'),ut[_0x9453('0x10c')](_0x47a862,'amd'));this[_0x9453('0x10d')](_0x47a862,_0x9453('0x121'),_0x9453('0x122'));}if(_0x3f7008[_0x9453('0x39')]===_0x9453('0xb5')&&this['campaigns'][_0x3f7008['queue']]['dialAMDActive']&&_0x457413[_0x9453('0x110')]==='MACHINE'){return new Promise(function(_0x47babe,_0x461bca){delete _0x1d5ed2[_0x9453('0xb7')][_0x457413[_0x9453('0xb4')]];_0x1d5ed2[_0x9453('0xb6')](_0x1d5ed2[_0x9453('0x19')][_0x3f7008[_0x9453('0xb3')]]);_0x1d5ed2['campaigns'][_0x3f7008[_0x9453('0xb3')]]['outboundAnswerCallsDay']+=0x1;_0x1d5ed2[_0x9453('0x19')][_0x3f7008[_0x9453('0xb3')]][_0x9453('0x108')]+=0x1;var _0x16c72b=_0x1d5ed2[_0x9453('0x19')][_0x3f7008[_0x9453('0xb3')]];var _0x3679f6=new Hangup(_0x3f7008,_0x457413);_0x3679f6['state']=0x13;_0x3679f6[_0x9453('0xc7')]=_0x9453('0x111');_0x3679f6[_0x9453('0x10a')]=_0x9453('0x10b');_0x3679f6[_0x9453('0x112')]+=0x1;_0x3679f6[_0x9453('0xcd')]+=0x1;_0x3679f6[_0x9453('0x113')]=!![];ami[_0x9453('0x38')](_0x9453('0x120'),ut[_0x9453('0x10c')](_0x3679f6,_0x9453('0x113')));hopperUtils[_0x9453('0xbe')](_0x3679f6)['catch'](loggerCatch(_0x9453('0x123')));if(_0x3679f6[_0x9453('0x114')]+_0x3679f6[_0x9453('0x115')]+_0x3679f6[_0x9453('0x116')]+_0x3679f6[_0x9453('0x117')]+_0x3679f6[_0x9453('0xcc')]+_0x3679f6[_0x9453('0xe3')]+_0x3679f6[_0x9453('0x112')]+_0x3679f6['countagentrejectretry']>=_0x16c72b[_0x9453('0x124')]){_0x1d5ed2[_0x9453('0x119')](_0x3679f6,_0x47babe,_0x461bca,_0x9453('0x125'));}else{if(_0x3679f6[_0x9453('0x112')]>=_0x16c72b[_0x9453('0x11a')]){_0x1d5ed2['createStateFinal'](_0x3679f6,_0x47babe,_0x461bca,'reason\x2019\x20machine....');}else{hopperUtils[_0x9453('0xd4')]({'active':![],'countmachineretry':_0x3679f6[_0x9453('0x112')],'scheduledat':moment()[_0x9453('0xd5')](_0x16c72b['dialMachineRetryFrequency'],'minutes')['format'](_0x9453('0xb8')),'ContactId':_0x3679f6['ContactId'],'ListId':_0x3679f6['ListId'],'VoiceQueueId':_0x3679f6[_0x9453('0xd9')]||undefined,'CampaignId':_0x3679f6['CampaignId']||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x11d')));_0x47babe({'reschedule':0x1});}}});}}};Dialer[_0x9453('0x81')]['syncHangup']=function(_0x5162f9){var _0x23d57c=this[_0x9453('0xb7')][_0x5162f9['uniqueid']];var _0x377b13;if(_0x23d57c&&_0x23d57c[_0x9453('0x39')]===_0x9453('0xb5')){delete this[_0x9453('0xb7')][_0x5162f9[_0x9453('0xb4')]];this[_0x9453('0xb6')](this['campaigns'][_0x23d57c[_0x9453('0xb3')]]);this['campaigns'][_0x23d57c[_0x9453('0xb3')]][_0x9453('0x126')]+=0x1;_0x377b13=new Hangup(_0x23d57c,_0x5162f9);hopperUtils['createHistory'](_0x377b13)[_0x9453('0x98')](loggerCatch(_0x9453('0x127')));hopperUtils[_0x9453('0xc0')](_0x377b13)['catch'](loggerCatch(_0x9453('0x128')));}if(_0x23d57c&&_0x23d57c[_0x9453('0x39')]!==_0x9453('0xb5')&&isNotNull(this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]][_0x9453('0x129')])){delete this[_0x9453('0xb7')][_0x5162f9[_0x9453('0xb4')]];this[_0x9453('0xb6')](this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]]);this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]][_0x9453('0xba')]+=0x1;this[_0x9453('0x18')][_0x23d57c['queue']][_0x9453('0x108')]+=0x1;_0x377b13=new Hangup(_0x23d57c,_0x5162f9);_0x377b13[_0x9453('0x67')]=0x10;_0x377b13[_0x9453('0xc7')]='AnswerAGI';_0x377b13[_0x9453('0x10a')]=_0x9453('0x12a');hopperUtils['createHistory'](_0x377b13)['catch'](loggerCatch(_0x9453('0x127')));hopperUtils[_0x9453('0xc0')](_0x377b13)[_0x9453('0x98')](loggerCatch('[syncHangupIvr]'));}if(_0x23d57c&&_0x23d57c[_0x9453('0x39')]!=='ivr'&&!isNotNull(this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]][_0x9453('0x129')])){if(_0x5162f9[_0x9453('0x12b')]===_0x9453('0x12c')){delete this[_0x9453('0xb7')][_0x5162f9[_0x9453('0xb4')]];this['voiceQueues'][_0x23d57c[_0x9453('0xb3')]][_0x9453('0xba')]+=0x1;const _0x3590cf=new AgentComplete(_0x23d57c,_0x5162f9);_0x3590cf['CampaignId']=this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]]['id'];hopperUtils[_0x9453('0xbe')](_0x3590cf)[_0x9453('0x98')](loggerCatch(_0x9453('0xbf')));hopperUtils['moveContactManagedDialer'](_0x3590cf)[_0x9453('0x98')](loggerCatch(_0x9453('0xc1')));}else{delete this['uniqueId'][_0x5162f9[_0x9453('0xb4')]];this['updateOriginated'](this[_0x9453('0x18')][_0x23d57c[_0x9453('0xb3')]]);this[_0x9453('0x18')][_0x23d57c['queue']][_0x9453('0x12d')]+=0x1;_0x377b13=new Hangup(_0x23d57c,_0x5162f9);_0x377b13[_0x9453('0x67')]=0xc;_0x377b13['statedesc']=_0x5162f9['cause-txt'];_0x377b13['membername']=_0x9453('0x12e');hopperUtils[_0x9453('0xbe')](_0x377b13)[_0x9453('0x98')](loggerCatch(_0x9453('0x127')));hopperUtils[_0x9453('0xc0')](_0x377b13)[_0x9453('0x98')](loggerCatch('[syncHangupIvr]'));}}};Dialer[_0x9453('0x81')][_0x9453('0x2a')]=function(_0x3fbd87){var _0x5146ca=this;if(!_0x5146ca[_0x9453('0x21')][_0x3fbd87['name']]){_0x5146ca['queuesSummary'][_0x3fbd87[_0x9453('0x59')]]={'running':![]};}else if(_0x5146ca[_0x9453('0x21')][_0x3fbd87['name']]['running']===!![]){return;}else if(_0x5146ca[_0x9453('0x21')][_0x3fbd87[_0x9453('0x59')]][_0x9453('0x12f')]===![]){_0x5146ca['queuesSummary'][_0x3fbd87[_0x9453('0x59')]]['running']=!![];}var _0x292291=_0x5146ca[_0x9453('0x18')][_0x3fbd87['name']];var _0xc7fa8=_0x292291['message']!==utils[_0x9453('0x63')][_0x9453('0x73')];var _0x140c88=utils[_0x9453('0x130')](_0x292291);_0x292291[_0x9453('0x131')]=utils[_0x9453('0x132')](_0x292291,_0x5146ca['trunks']);Promise[_0x9453('0x9f')]()[_0x9453('0x92')](function(){if(_0x292291['statusMessage']===utils['CAMPAIGN_STATUS'][_0x9453('0x73')]){if(_0xc7fa8){clearPredictiveAttributes(_0x292291);_0x3fbd87[_0x9453('0x5b')]=undefined;_0x3fbd87['startProgressive']=undefined;}if(_0x292291[_0x9453('0x131')]===utils['CAMPAIGN_STATUS'][_0x9453('0x73')]){_0x3fbd87['available']=0x0;_0x3fbd87[_0x9453('0xee')]=0x0;_0x3fbd87[_0x9453('0x133')]=0x0;_0x3fbd87['talking']=0x0;_0x3fbd87[_0x9453('0x134')]=0x0;}}else if(_0x292291['statusMessage']===utils[_0x9453('0x63')]['ACTIVE']&&!_0x140c88){return _0x5146ca[_0x9453('0x88')](_0x292291,!![])[_0x9453('0x92')](function(){return _0x5146ca[_0x9453('0x88')](_0x292291,![]);})[_0x9453('0x92')](function(){return _0x5146ca['checkDialMethod'](_0x292291);})[_0x9453('0x98')](function(_0x18a4f7){loggerSyncQueueSummary['debug'](_0x9453('0x135'),util[_0x9453('0x3d')](_0x18a4f7,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x292291);});}else{clearPredictiveAttributes(_0x292291);}})[_0x9453('0x92')](function(){var _0x5c7d91=_0x3fbd87[_0x9453('0x136')](_0x292291);if(_0x5c7d91||_0x292291[_0x9453('0x137')]){_0x292291[_0x9453('0x137')]=![];_0x3fbd87[_0x9453('0x138')](_0x292291);Object[_0x9453('0x139')](_0x292291,_0x3fbd87);emitOutboundVoiceQueueSummary(_0x3fbd87);}_0x5146ca[_0x9453('0x21')][_0x292291['name']][_0x9453('0x12f')]=![];})[_0x9453('0x98')](function(_0x3990ad){logger[_0x9453('0x5f')](_0x9453('0x135'),util[_0x9453('0x3d')](_0x3990ad,{'showHidden':![],'depth':null}));_0x5146ca[_0x9453('0x21')][_0x292291['name']][_0x9453('0x12f')]=![];});};Dialer[_0x9453('0x81')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x3eecff=_['filter'](this[_0x9453('0x18')],function(_0x48d489){return _0x48d489[_0x9453('0x13a')];});var _0x11826c=_[_0x9453('0x13b')](this[_0x9453('0x1a')],function(_0x2f8d95){return _0x2f8d95['online']&&_0x2f8d95[_0x9453('0x7e')]==='reachable';});if(_0x3eecff[_0x9453('0x8f')]>0x0&&_0x11826c['length']>0x0){return Promise['resolve']()['then'](cmHopper[_0x9453('0x13c')](_[_0x9453('0x13d')](_0x3eecff,'id'),previewRecallmeReminderInterval,_['map'](_0x11826c,'id')))[_0x9453('0x92')](function(_0xb9225e){for(var _0x6941a9=0x0;_0x6941a9<_0xb9225e[_0x9453('0x8f')];_0x6941a9++){var _0x598205=_0xb9225e[_0x6941a9][_0x9453('0x13e')][_0x9453('0x59')];if(_0x598205)io['to'](util[_0x9453('0x3e')](_0x9453('0x13f'),_0x598205))['emit'](_0x9453('0x140'),{'hopper':_0xb9225e[_0x6941a9]});}})[_0x9453('0x98')](function(_0x5f1940){logger['error'](_0x9453('0x141'),_0x5f1940);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x9453('0x81')][_0x9453('0x34')]=function(){var _0x1fe63c=this;setInterval(function(){_0x1fe63c[_0x9453('0x142')](_0x1fe63c[_0x9453('0xb7')],_0x9453('0x143'));_0x1fe63c[_0x9453('0x142')](_0x1fe63c[_0x9453('0x1d')],'[actions]');},0x32c8);};Dialer[_0x9453('0x81')][_0x9453('0x142')]=function(_0x36fe71,_0x37cdbf){var _0xe45d66=this;for(var _0x3a1a1c in _0x36fe71){if(typeof _0x36fe71[_0x3a1a1c]!==_0x9453('0x144')){this['sequence'][_0x9453('0x145')](function(){if(!_[_0x9453('0xec')](_0x36fe71[_0x3a1a1c])){return ami['Action']({'action':_0x9453('0x7e'),'channel':_0x36fe71[_0x3a1a1c]['channel']})[_0x9453('0x98')](function(_0x86fce4){if(_0x86fce4[_0x9453('0x62')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x36fe71[_0x3a1a1c]&&_0x36fe71[_0x3a1a1c][_0x9453('0x39')]!==_0x9453('0xb5')){_0xe45d66[_0x9453('0xb6')](_0xe45d66[_0x9453('0x18')][_0x36fe71[_0x3a1a1c][_0x9453('0xb3')]]);logger[_0x9453('0x5f')]('[Dialer][checkChannel]',_0x37cdbf,_0x3a1a1c,_0x36fe71[_0x3a1a1c][_0x9453('0xb3')]);delete _0x36fe71[_0x3a1a1c];}if(_0x36fe71[_0x3a1a1c]&&_0x36fe71[_0x3a1a1c][_0x9453('0x39')]===_0x9453('0xb5')){_0xe45d66[_0x9453('0xb6')](_0xe45d66['campaigns'][_0x36fe71[_0x3a1a1c][_0x9453('0xb3')]]);logger['error'](_0x9453('0x146'),_0x37cdbf,_0x3a1a1c,_0x36fe71[_0x3a1a1c][_0x9453('0xb3')]);delete _0x36fe71[_0x3a1a1c];}},0x2328);}});}});}}};Dialer[_0x9453('0x81')][_0x9453('0x147')]=function(_0x26b290){return Promise['resolve']()['then'](voiceQueueRt[_0x9453('0x147')](_0x26b290))[_0x9453('0x98')](loggerCatch(_0x9453('0x148')));};Dialer[_0x9453('0x81')]['updateOriginated']=function(_0x3e4202){if(!_[_0x9453('0x37')](_0x3e4202)&&_0x3e4202!==null){if(typeof _0x3e4202[_0x9453('0x149')]!==_0x9453('0x144')){if(_0x3e4202[_0x9453('0x149')]>0x0){_0x3e4202[_0x9453('0x149')]-=0x1;}else{logger[_0x9453('0x5f')](_0x9453('0x14a'));}}}else{logger[_0x9453('0x5f')](_0x9453('0x14b'));}};Dialer[_0x9453('0x81')][_0x9453('0x14c')]=function(_0x5940da,_0x123b2d){var _0x41ef54=this;return function(_0x78882){_0x41ef54['updateOriginated'](_0x123b2d);logger['error'](_0x5940da,util[_0x9453('0x3d')](_0x78882,{'showHidden':![],'depth':null}));};};Dialer[_0x9453('0x81')][_0x9453('0x14d')]=function(_0x3abc41,_0x20cff,_0x4358b5){var _0x59f32d={'state':0x19,'statedesc':_0x9453('0x14e')};this[_0x9453('0xb6')](_0x20cff);this[_0x9453('0x10d')](_[_0x9453('0x57')](_0x59f32d,_['pick'](_0x4358b5,[_0x9453('0xd7'),_0x9453('0xd8'),_0x9453('0x14f'),_0x9453('0xd9'),_0x9453('0xda')])),_0x9453('0x150'),_0x9453('0x151'));logger[_0x9453('0x5f')](_0x3abc41);};Dialer['prototype']['saveInDb']=function(_0x24661d,_0x2b3116,_0x56d28f){hopperUtils[_0x9453('0xbe')](_0x24661d)[_0x9453('0x98')](loggerCatch(_0x2b3116));hopperUtils['moveContactManagedDialer'](_0x24661d)[_0x9453('0x98')](loggerCatch(_0x56d28f));};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x2594cf,_0x10b5db){hopperUtils[_0x9453('0xbe')](_0x2594cf)[_0x9453('0x98')](loggerCatch(_0x9453('0xbf')));if(_0x10b5db==0x0){hopperUtils[_0x9453('0xc0')](_0x2594cf)[_0x9453('0x98')](loggerCatch(_0x9453('0x152')));}};Dialer[_0x9453('0x81')][_0x9453('0x141')]=function(_0x4b4250){return Promise[_0x9453('0x9f')]()[_0x9453('0x92')](cmHopper[_0x9453('0x13c')](_0x4b4250['id'],previewRecallmeReminderInterval))[_0x9453('0x92')](function(_0x277d92){for(var _0x2afea6=0x0;_0x2afea6<_0x277d92['length'];_0x2afea6++){var _0x238087=_0x277d92[_0x2afea6][_0x9453('0x13e')][_0x9453('0x59')];if(_0x238087)io['to'](util[_0x9453('0x3e')]('user:%s',_0x238087))[_0x9453('0x38')]('user:dialPreviewRecallReminder',{'hopper':_0x277d92[_0x2afea6]});}})[_0x9453('0x98')](function(){});};Dialer[_0x9453('0x81')][_0x9453('0xa3')]=function(_0x126b35){var _0xa457c7=this;return function(){_0xa457c7[_0x9453('0x153')](_0x126b35);};};Dialer['prototype'][_0x9453('0x154')]=function(_0x1ea7d2,_0x31e523){var _0x541e9a=this;var _0x3134d1=uuid['v4']();this[_0x9453('0x1d')][_0x3134d1]=new Action(_0x1ea7d2,_0x31e523,_0x3134d1);return new Promise(function(_0x472350,_0x559c33){if(_[_0x9453('0x37')](_0x1ea7d2)&&typeof _0x1ea7d2!==_0x9453('0x155')){return _0x559c33(msgResponse(_0x9453('0x156'),_0x9453('0x8d'),_0x9453('0x157')));}if(_[_0x9453('0x37')](_0x31e523['phone'])||_0x31e523[_0x9453('0x158')]===null){return _0x559c33(msgResponse(_0x9453('0x156'),_0x9453('0x8d'),_0x9453('0x159')));}var _0x51e1d4={'XMD-CALLERID':_0x541e9a[_0x9453('0x1d')][_0x3134d1]['getCaller'](),'XMD-AGI':_0x1ea7d2[_0x9453('0x129')]?util[_0x9453('0x3e')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1ea7d2[_0x9453('0x129')]):'NONE','XMD-AGIAFTER':_0x1ea7d2[_0x9453('0xcb')]?util[_0x9453('0x3e')](_0x9453('0x15a'),ipAgi,_0x1ea7d2[_0x9453('0xcb')]):'NONE','XMD-QUEUE':utils['isOutboundQueue'](_0x1ea7d2)?util[_0x9453('0x3e')](_0x9453('0x15b'),_0x1ea7d2[_0x9453('0x59')],_0x1ea7d2[_0x9453('0x15c')]||'',_0x1ea7d2[_0x9453('0xbd')]?'c':'',_0x1ea7d2[_0x9453('0xc3')]||0x3):_0x9453('0x15d'),'XMD-CONTACTID':_0x31e523[_0x9453('0xd7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x541e9a[_0x9453('0x1d')][_0x3134d1][_0x9453('0x15e')](),'XMD-AMD':_0x1ea7d2['dialAMDActive']?_0x9453('0x15f'):_0x9453('0x15d'),'XMD-DESTINATION':_0x9453('0x107')};if(_0x1ea7d2['dialAMDActive']){_0x51e1d4['XMD-AMDINITIALSILENCE']=_0x1ea7d2[_0x9453('0x160')]||0x9c4;_0x51e1d4[_0x9453('0x161')]=_0x1ea7d2[_0x9453('0x162')]||0x5dc;_0x51e1d4[_0x9453('0x163')]=_0x1ea7d2['dialAMDAfterGreetingSilence']||0x320;_0x51e1d4['XMD-AMDTOTALANALYSISTIME']=_0x1ea7d2[_0x9453('0x164')]||0x1388;_0x51e1d4['XMD-AMDMINWORDLENGTH']=_0x1ea7d2[_0x9453('0x165')]||0x64;_0x51e1d4[_0x9453('0x166')]=_0x1ea7d2[_0x9453('0x167')]||0x32;_0x51e1d4[_0x9453('0x168')]=_0x1ea7d2['dialAMDMaximumNumberOfWords']||0x3;_0x51e1d4[_0x9453('0x169')]=_0x1ea7d2['dialAMDSilenceThreshold']||0x100;_0x51e1d4[_0x9453('0x16a')]=_0x1ea7d2['dialAMDMaximumWordLength']||0x1388;}if(utils[_0x9453('0x16b')](_0x1ea7d2)){_0x51e1d4[_0x9453('0x16c')]=_0x31e523[_0x9453('0xd9')];}else{_0x51e1d4[_0x9453('0x16d')]=_0x31e523[_0x9453('0xda')];}var _0x1ed5b9=utils[_0x9453('0x16e')](_0x31e523[_0x9453('0x16f')]);Object['assign'](_0x51e1d4,_0x1ed5b9);var _0x20b18a=_0x541e9a['isTrunkReachable'](_0x1ea7d2['Trunk'])?utils['getCallerId'](_0x1ea7d2[_0x9453('0x170')][_0x9453('0x171')],_0x1ea7d2[_0x9453('0x172')],_0x1ea7d2[_0x9453('0x173')]>0x0?utils['getCallerIdRandom'](_0x1ea7d2[_0x9453('0x174')],_0x1ea7d2[_0x9453('0x173')]):_0x1ea7d2[_0x9453('0x174')]):utils[_0x9453('0x175')](_['isNil'](_0x1ea7d2[_0x9453('0x83')])?_0x1ea7d2[_0x9453('0x170')]['callerid']:_0x1ea7d2['TrunkBackup'][_0x9453('0x171')],_0x1ea7d2[_0x9453('0x172')],_0x1ea7d2[_0x9453('0x173')]>0x0?utils[_0x9453('0x176')](_0x1ea7d2['dialOriginateCallerIdNumber'],_0x1ea7d2[_0x9453('0x173')]):_0x1ea7d2['dialOriginateCallerIdNumber']);if(_0x20b18a){_0x51e1d4['XMD-ORIGINATECALLERIDNAME']=_0x541e9a['actions'][_0x3134d1]['originatecalleridname']=utils[_0x9453('0x177')](_0x20b18a);_0x51e1d4[_0x9453('0x178')]=_0x31e523['phone'];}_0x1ea7d2[_0x9453('0x179')]=_0x51e1d4;return ami['Action']({'actionid':_0x3134d1,'action':'originate','channel':_0x541e9a[_0x9453('0x82')](_0x1ea7d2[_0x9453('0x170')])?util['format'](_0x9453('0x17a'),_0x1ea7d2[_0x9453('0x170')][_0x9453('0x59')],isNotNull(_0x1ea7d2[_0x9453('0x17b')])?_0x1ea7d2[_0x9453('0x17b')]['trim']()||'':'',_0x1ea7d2[_0x9453('0x17c')]>0x0?_0x31e523['phone']['substring'](_0x1ea7d2[_0x9453('0x17c')]):_0x31e523[_0x9453('0x158')]):util[_0x9453('0x3e')](_0x9453('0x17a'),_[_0x9453('0xec')](_0x1ea7d2[_0x9453('0x83')])?_0x1ea7d2[_0x9453('0x170')]['name']:_0x1ea7d2[_0x9453('0x83')][_0x9453('0x59')],isNotNull(_0x1ea7d2[_0x9453('0x17b')])?_0x1ea7d2[_0x9453('0x17b')][_0x9453('0x17d')]()||'':'',_0x1ea7d2[_0x9453('0x17c')]>0x0?_0x31e523[_0x9453('0x158')]['substring'](_0x1ea7d2['dialCutDigit']):_0x31e523[_0x9453('0x158')]),'callerid':_0x20b18a,'Exten':_0x9453('0x107'),'Context':_0x9453('0x17e'),'Priority':'1','variable':_0x51e1d4,'timeout':(_0x1ea7d2[_0x9453('0x17f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3134d1})[_0x9453('0x92')](function(_0x204b54){return _0x472350(_0x204b54);})[_0x9453('0x98')](function(_0x16e0d5){_0x1ea7d2[_0x9453('0x180')]+=0x1;var _0x3fa3c5=new History(_0x541e9a[_0x9453('0x1d')][_0x3134d1]);logger[_0x9453('0x5f')](util[_0x9453('0x3e')](_0x9453('0x181'),JSON[_0x9453('0x6d')](_0x16e0d5)));_0x3fa3c5[_0x9453('0x67')]=0xe;_0x3fa3c5[_0x9453('0xc7')]=_0x9453('0x182');_0x3fa3c5['starttime']=moment()[_0x9453('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fa3c5[_0x9453('0x68')]=_0x3fa3c5[_0x9453('0x69')];hopperUtils[_0x9453('0xbe')](_0x3fa3c5)[_0x9453('0x98')](loggerCatch(_0x9453('0x183')));_0x541e9a['moveContactManagedDialer'](_0x3fa3c5)[_0x9453('0x98')](loggerCatch(_0x9453('0x183')))[_0x9453('0xf5')](function(){delete _0x541e9a[_0x9453('0x1d')][_0x3134d1];return _0x559c33(msgResponse(_0x9453('0x156'),_0x9453('0x7b'),_0x9453('0x184')));});});});};Dialer[_0x9453('0x81')]['checkRetriveMax']=function(_0x5c3c1d,_0x4baf02,_0x3b87d4){var _0x59ff75=new History(_0x4baf02);if(_0x59ff75[_0x9453('0x114')]+_0x59ff75['countcongestionretry']+_0x59ff75[_0x9453('0x116')]+_0x59ff75[_0x9453('0x117')]+_0x59ff75[_0x9453('0xcc')]+_0x59ff75[_0x9453('0xe3')]+_0x59ff75[_0x9453('0x112')]+_0x59ff75['countagentrejectretry']>=_0x3b87d4[_0x9453('0x124')]-0x1){return!![];}switch(_0x5c3c1d){case 0x3:if(_0x59ff75[_0x9453('0x116')]>=_0x3b87d4['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0x9453('0xd4')]({'active':![],'countnoanswerretry':_0x59ff75['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x3b87d4[_0x9453('0x185')],'minutes')[_0x9453('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59ff75['ContactId'],'ListId':_0x59ff75[_0x9453('0xd8')],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x186')));break;case 0x5:if(_0x59ff75[_0x9453('0x114')]>=_0x3b87d4[_0x9453('0x187')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x59ff75[_0x9453('0x114')]+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4[_0x9453('0x188')],_0x9453('0xd6'))[_0x9453('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59ff75['ContactId'],'ListId':_0x59ff75['ListId'],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75['CampaignId']||undefined})[_0x9453('0x98')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x59ff75['countcongestionretry']>=_0x3b87d4[_0x9453('0x189')]-0x1){return!![];}hopperUtils[_0x9453('0xd4')]({'active':![],'countcongestionretry':_0x59ff75['countcongestionretry']+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4[_0x9453('0x18a')],_0x9453('0xd6'))['format'](_0x9453('0xb8')),'ContactId':_0x59ff75[_0x9453('0xd7')],'ListId':_0x59ff75[_0x9453('0xd8')],'VoiceQueueId':_0x59ff75['VoiceQueueId']||undefined,'CampaignId':_0x59ff75[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x18b')));break;case 0x0:if(_0x59ff75['countnosuchnumberretry']>=_0x3b87d4[_0x9453('0x18c')]-0x1){return!![];}else{hopperUtils[_0x9453('0xd4')]({'active':![],'countnosuchnumberretry':_0x59ff75['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4['dialNoSuchNumberRetryFrequency'],_0x9453('0xd6'))[_0x9453('0x3e')](_0x9453('0xb8')),'ContactId':_0x59ff75[_0x9453('0xd7')],'ListId':_0x59ff75[_0x9453('0xd8')],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x18d')));}break;case 0xa:if(_0x59ff75[_0x9453('0xcc')]>=_0x3b87d4[_0x9453('0xd2')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x59ff75[_0x9453('0xcc')]+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4[_0x9453('0xce')],_0x9453('0xd6'))[_0x9453('0x3e')](_0x9453('0xb8')),'ContactId':_0x59ff75[_0x9453('0xd7')],'ListId':_0x59ff75[_0x9453('0xd8')],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75['CampaignId']||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0xdb')));break;case 0xb:if(_0x59ff75[_0x9453('0xe3')]>=_0x3b87d4[_0x9453('0xe5')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x59ff75['countabandonedretry']+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4['dialAbandonedRetryFrequency'],_0x9453('0xd6'))['format'](_0x9453('0xb8')),'ContactId':_0x59ff75['ContactId'],'ListId':_0x59ff75['ListId'],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0xe7')));break;case 0x13:if(_0x59ff75[_0x9453('0x112')]>=_0x3b87d4['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x9453('0xd4')]({'active':![],'countmachineretry':_0x59ff75[_0x9453('0x112')]+=0x1,'scheduledat':moment()[_0x9453('0xd5')](_0x3b87d4['dialMachineRetryFrequency'],_0x9453('0xd6'))[_0x9453('0x3e')](_0x9453('0xb8')),'ContactId':_0x59ff75[_0x9453('0xd7')],'ListId':_0x59ff75[_0x9453('0xd8')],'VoiceQueueId':_0x59ff75['VoiceQueueId']||undefined,'CampaignId':_0x59ff75[_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x59ff75[_0x9453('0x118')]>=_0x3b87d4[_0x9453('0x18e')]-0x1){return!![];}hopperUtils[_0x9453('0xd4')]({'active':![],'countagentrejectretry':_0x59ff75['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x3b87d4[_0x9453('0x18f')],_0x9453('0xd6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x59ff75[_0x9453('0xd7')],'ListId':_0x59ff75['ListId'],'VoiceQueueId':_0x59ff75[_0x9453('0xd9')]||undefined,'CampaignId':_0x59ff75['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x9453('0x81')][_0x9453('0x102')]=function(_0x310355,_0x2ceab4,_0x3b7a72){var _0x233a53=this;var _0x1ff425=new History(_0x310355);var _0x15ac60=![];var _0x4bfc39;var _0x224630;return new Promise(function(_0x4ebcc7,_0x39e403){if(_[_0x9453('0x37')](_0x2ceab4)&&typeof _0x2ceab4!=='object'){return _0x39e403(msgResponse(_0x9453('0x190'),_0x9453('0x8d'),_0x9453('0x191')));}if(_['isUndefined'](_0x3b7a72)&&typeof _0x3b7a72!=='object'){return _0x39e403(msgResponse(_0x9453('0x190'),_0x9453('0x8d'),_0x9453('0x192')));}hopperUtils[_0x9453('0xd0')](_0x1ff425,_0x3b7a72['reason'],_0x2ceab4)[_0x9453('0x92')](function(_0x55dd24){if(_0x55dd24[_0x9453('0xd3')]==0x1)_0x15ac60=!![];switch(_0x3b7a72['reason']){case'0':_0x2ceab4[_0x9453('0x193')]+=0x1;_0x1ff425['state']=0x0;_0x1ff425[_0x9453('0xc7')]=_0x9453('0x194');_0x1ff425[_0x9453('0x117')]+=0x1;_0x1ff425[_0x9453('0xcd')]+=0x1;ami[_0x9453('0x38')]('custom:agentnosuchnumber',ut[_0x9453('0x10c')](_0x310355,_0x9453('0x195')));_0x4bfc39=_0x2ceab4[_0x9453('0x196')];_0x224630=_0x2ceab4[_0x9453('0xcf')];hopperUtils['createHistory'](_0x1ff425)[_0x9453('0x98')](loggerCatch(_0x9453('0x123')));if(_0x233a53[_0x9453('0x197')](0x0,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425['countnosuchnumberretry']>=_0x2ceab4['dialNoSuchNumberMaxRetry']){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x198'));}else{_0x233a53[_0x9453('0x119')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x198'));}}break;case'3':_0x2ceab4['outboundNoAnswerCallsDay']+=0x1;_0x1ff425['state']=0x3;_0x1ff425[_0x9453('0xc7')]=_0x9453('0x199');_0x1ff425[_0x9453('0x116')]+=0x1;_0x1ff425[_0x9453('0xcd')]+=0x1;var _0x333c1c=ut['buildNoAnswerEventPayload'](_0x310355,_0x2ceab4);ami[_0x9453('0x38')](_0x9453('0x19a'),_0x333c1c);_0x4bfc39=_0x2ceab4[_0x9453('0x185')];_0x224630=_0x2ceab4[_0x9453('0xcf')];hopperUtils[_0x9453('0xbe')](_0x1ff425)['catch'](loggerCatch(_0x9453('0x19b')));if(_0x233a53['checkRetriveMax'](0x3,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425[_0x9453('0x116')]>=_0x2ceab4[_0x9453('0x19c')]){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x19d'));}else{_0x233a53['stateGlobal'](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x19d'));}}break;case'5':_0x2ceab4[_0x9453('0x19e')]+=0x1;_0x1ff425[_0x9453('0x67')]=0x5;_0x1ff425['statedesc']=_0x9453('0x19f');_0x1ff425[_0x9453('0x114')]+=0x1;_0x1ff425[_0x9453('0xcd')]+=0x1;ami[_0x9453('0x38')](_0x9453('0x1a0'),ut['buildObj'](_0x310355,'busy'));_0x4bfc39=_0x2ceab4['dialBusyRetryFrequency'];_0x224630=_0x2ceab4[_0x9453('0xcf')];hopperUtils['createHistory'](_0x1ff425)[_0x9453('0x98')](loggerCatch(_0x9453('0x1a1')));if(_0x233a53[_0x9453('0x197')](0x5,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425[_0x9453('0x114')]>=_0x2ceab4[_0x9453('0x187')]){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,'reason\x205\x20busy');}else{_0x233a53[_0x9453('0x119')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x1a2'));}}break;case'8':_0x2ceab4[_0x9453('0x1a3')]+=0x1;_0x1ff425[_0x9453('0x67')]=0x8;_0x1ff425[_0x9453('0xc7')]=_0x9453('0x1a4');_0x1ff425['countcongestionretry']+=0x1;_0x1ff425[_0x9453('0xcd')]+=0x1;_0x4bfc39=_0x2ceab4[_0x9453('0x18a')];_0x224630=_0x2ceab4[_0x9453('0xcf')];ami['emit']('custom:agentcongestion',ut['buildObj'](_0x310355,'congestion'));hopperUtils[_0x9453('0xbe')](_0x1ff425)[_0x9453('0x98')](loggerCatch(_0x9453('0x1a5')));if(_0x233a53[_0x9453('0x197')](0x8,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425['countcongestionretry']>=_0x2ceab4[_0x9453('0x189')]){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x1a6'));}else{_0x233a53[_0x9453('0x119')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x1a6'));}}break;case'11':_0x2ceab4[_0x9453('0x1a7')]+=0x1;_0x1ff425[_0x9453('0x67')]=0xb;_0x1ff425[_0x9453('0xc7')]=_0x9453('0xe1');_0x1ff425[_0x9453('0xe3')]+=0x1;_0x1ff425['countglobal']+=0x1;_0x4bfc39=_0x2ceab4['dialAbandonedRetryFrequency'];_0x224630=_0x2ceab4[_0x9453('0xcf')];hopperUtils[_0x9453('0xbe')](_0x1ff425)[_0x9453('0x98')](loggerCatch(_0x9453('0x1a8')));if(_0x233a53[_0x9453('0x197')](0xb,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425[_0x9453('0xe3')]>=_0x2ceab4[_0x9453('0xe5')]){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x1a9'));}else{_0x233a53[_0x9453('0x119')](_0x1ff425,_0x4ebcc7,_0x39e403,'reason\x2011\x20abandoned');}}break;case'20':_0x2ceab4[_0x9453('0x1aa')]+=0x1;_0x1ff425[_0x9453('0x67')]=0x14;_0x1ff425[_0x9453('0xc7')]='AgentReject';_0x1ff425[_0x9453('0x118')]+=0x1;_0x1ff425[_0x9453('0xcd')]+=0x1;_0x4bfc39=_0x2ceab4[_0x9453('0x18f')];_0x224630=_0x2ceab4[_0x9453('0xcf')];ami[_0x9453('0x38')](_0x9453('0x1ab'),ut['buildObj'](_0x310355,_0x9453('0x1ac')));hopperUtils['createHistory'](_0x1ff425)[_0x9453('0x98')](loggerCatch(_0x9453('0x1ad')));if(_0x233a53[_0x9453('0x197')](0x14,_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425[_0x9453('0x118')]>=_0x2ceab4['dialAgentRejectMaxRetry']){_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x9453('0x1ae'));}else{_0x233a53['stateGlobal'](_0x1ff425,_0x4ebcc7,_0x39e403,'reason\x2020\x20agentreject');}}break;default:_0x2ceab4[_0x9453('0x12d')]+=0x1;_0x1ff425[_0x9453('0x67')]=0xc;_0x1ff425['statedesc']=_0x3b7a72['reason'];_0x4bfc39=_0x2ceab4[_0x9453('0x18f')];_0x224630=_0x2ceab4[_0x9453('0xcf')];hopperUtils['createHistory'](_0x1ff425)[_0x9453('0x98')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x233a53[_0x9453('0x197')](_0x3b7a72['reason'],_0x310355,_0x2ceab4)&&!_0x15ac60){if(_0x1ff425['countbusyretry']+_0x1ff425[_0x9453('0x115')]+_0x1ff425['countnoanswerretry']+_0x1ff425[_0x9453('0x117')]+_0x1ff425[_0x9453('0xcc')]+_0x1ff425[_0x9453('0xe3')]+_0x1ff425[_0x9453('0x112')]+_0x1ff425[_0x9453('0x118')]>=_0x2ceab4[_0x9453('0x124')]){_0x233a53[_0x9453('0x119')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x3b7a72[_0x9453('0x1af')]);}else{_0x233a53[_0x9453('0x11b')](_0x1ff425,_0x4ebcc7,_0x39e403,_0x3b7a72[_0x9453('0x1af')]);}}}})['then'](function(){if(_0x15ac60){hopperUtils['swapAdditionalPhones'](_0x1ff425,_0x4bfc39,_0x224630)[_0x9453('0x92')](function(){return _0x4ebcc7(0x1);});}});});};Dialer[_0x9453('0x81')][_0x9453('0x119')]=function(_0x530257,_0x109624,_0x4ff186,_0xd57d0b){var _0x4bccee=new Final(_0x530257);_0x4bccee['state']=0xf;_0x4bccee['statedesc']='Global';this[_0x9453('0x11b')](_0x4bccee,_0x109624,_0x4ff186,_0xd57d0b);};Dialer['prototype']['createStateFinal']=function(_0x352958,_0x197b31,_0x87bd43,_0x3b2430){hopperUtils['moveContactManagedDialer'](_0x352958)['then'](function(){return _0x197b31(msgResponse(_0x9453('0x190'),_0x9453('0x101'),_0x3b2430));})[_0x9453('0x98')](function(){return _0x87bd43(msgResponse(_0x9453('0x1b0'),_0x9453('0x8d'),'contact\x20not\x20moved'));});};Dialer[_0x9453('0x81')][_0x9453('0xa')]=function(_0x5058b7){var _0x4ab353=_0x5058b7[_0x9453('0x1b1')]/0x64;var _0x10d01a=_0x5058b7['outboundDropCallsDayTimeout']/(_0x5058b7['outboundDropCallsDayTimeout']+_0x5058b7['outboundAnswerCallsDay']);var _0x315e5f=Math[_0x9453('0x1b2')](_0x5058b7[_0x9453('0x1b3')]*(_0x5058b7[_0x9453('0x1b4')]/0x64));var _0x4d2f8d=Math['round'](_0x5058b7[_0x9453('0x1b3')]*(_0x5058b7[_0x9453('0x1b5')]/0x64));var _0x286297=_0x5058b7[_0x9453('0x1b6')]+_0x5058b7[_0x9453('0x1b7')];var _0x131a38=Math[_0x9453('0x1b8')](_0x5058b7['erlangCalls']*_0x5058b7[_0x9453('0x1b9')]*_0x5058b7[_0x9453('0x1ba')]*_0x5058b7[_0x9453('0x1bb')]);if(_[_0x9453('0x37')](_0x5058b7[_0x9453('0x1f')])){if(!_[_0x9453('0x37')](_0x5058b7[_0x9453('0x5b')])){_0x5058b7[_0x9453('0x5b')]=undefined;loggerPredictive['error'](_0x9453('0x1bc'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x9453('0x37')](_0x5058b7[_0x9453('0x5d')])){loggerPredictive[_0x9453('0x5f')](_0x9453('0x1bc'),_0x9453('0x1bd'));clearInterval(_0x5058b7[_0x9453('0x5d')]);_0x5058b7[_0x9453('0x5d')]=undefined;}_0x5058b7[_0x9453('0x1f')]=moment()[_0x9453('0x3e')](_0x9453('0xb8'));loggerPredictive[_0x9453('0x41')](_0x5058b7[_0x9453('0x59')],_0x9453('0x1be'),_0x5058b7[_0x9453('0x1f')]);this['handlePower'](_0x5058b7,0x1);}else if(ifInterval(_0x5058b7[_0x9453('0x1bf')],_0x5058b7['startProgressive'])){this[_0x9453('0xa7')](_0x5058b7,0x1);loggerPredictiveCalls[_0x9453('0x41')](_0x9453('0x1c0'),_0x5058b7[_0x9453('0x1f')],_0x5058b7[_0x9453('0x59')]);_0x5058b7[_0x9453('0x51')]=0x0;_0x5058b7[_0x9453('0xc6')]=0x0;}else if(_0x4ab353<_0x10d01a&&_0x5058b7['dialPredictiveOptimization']===_0x9453('0x1c1')){clearPredictiveAttributes(_0x5058b7);loggerPredictive[_0x9453('0x41')](_0x9453('0x1c2'),'Dropped\x20calls\x20day',_0x10d01a,_0x9453('0x1f'),_0x5058b7['name']);}else if(_0x131a38<_0x5058b7[_0x9453('0xc6')]&&_0x5058b7[_0x9453('0x1c3')]===_0x9453('0x1c1')){clearPredictiveAttributes(_0x5058b7);loggerPredictive['info'](_0x9453('0x1c4'),_0x9453('0x1c5'),_0x131a38,'Drop\x20in\x20this\x20interval',_0x5058b7[_0x9453('0xc6')],_0x9453('0x1f'),_0x5058b7[_0x9453('0x59')]);}else if(!ifInterval(_0x5058b7[_0x9453('0x1bf')],_0x5058b7['startProgressive'])&&_[_0x9453('0x37')](_0x5058b7[_0x9453('0x5b')])&&!_[_0x9453('0x37')](_0x5058b7[_0x9453('0x1f')])){_0x5058b7['startPredictive']=moment()[_0x9453('0x3e')](_0x9453('0xb8'));loggerPredictive['info'](_0x5058b7[_0x9453('0x59')],_0x9453('0x1c6'),_0x5058b7['startPredictive']);hopperUtils[_0x9453('0x1c7')](_0x5058b7[_0x9453('0x1bf')])[_0x9453('0x92')](this[_0x9453('0x1c8')](_0x5058b7))[_0x9453('0x92')](mergeDataErlangB(_0x5058b7))[_0x9453('0x92')](this['startMethodPredictive'](_0x5058b7))['catch'](loggerCatchPredictive(_0x9453('0x1c9'),_0x5058b7));}else if(!ifInterval(_0x5058b7[_0x9453('0x1bf')],_0x5058b7['startPredictive'])){_0x5058b7[_0x9453('0xc6')]=0x0;_0x5058b7['startPredictive']=moment()[_0x9453('0x3e')](_0x9453('0xb8'));loggerPredictive[_0x9453('0x41')](_0x5058b7[_0x9453('0x59')],_0x9453('0x1ca'),_0x5058b7['startPredictive']);clearInterval(_0x5058b7['handlePredictive']);_0x5058b7['handlePredictive']=undefined;hopperUtils[_0x9453('0x1c7')](_0x5058b7[_0x9453('0x1bf')])[_0x9453('0x92')](this[_0x9453('0x1c8')](_0x5058b7))[_0x9453('0x92')](mergeDataErlangB(_0x5058b7))['then'](this[_0x9453('0x1cb')](_0x5058b7))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x5058b7));}else if(_0x5058b7[_0x9453('0x1b3')]&&_0x286297<_0x5058b7[_0x9453('0x1b3')]-_0x4d2f8d){clearPredictiveAttributes(_0x5058b7);loggerPredictive[_0x9453('0x41')](_0x5058b7[_0x9453('0x59')],_0x9453('0x1cc'),_0x286297,_0x9453('0x1cd'),_0x5058b7[_0x9453('0x1b3')],'-',_0x4d2f8d,'=',_0x5058b7[_0x9453('0x1b3')]-_0x4d2f8d,')');}else if(_0x5058b7[_0x9453('0x1b3')]&&_0x286297>_0x5058b7[_0x9453('0x1b3')]+_0x315e5f){clearPredictiveAttributes(_0x5058b7);loggerPredictive[_0x9453('0x41')](_0x5058b7['name'],_0x9453('0x1cc'),_0x286297,')\x20are\x20more\x20than\x20threshold\x20(',_0x5058b7[_0x9453('0x1b3')],'+',_0x315e5f,'=',_0x5058b7[_0x9453('0x1b3')]+_0x315e5f,')');}};Dialer[_0x9453('0x81')][_0x9453('0x1c8')]=function(_0x11d52d){var _0x30055e=this;return function(_0x3d05fa){return new Promise(function(_0x24fcfb,_0xa0976c){_[_0x9453('0x57')](_0x11d52d,_0x3d05fa[0x0]);if(checkGetDataPredictive(_0x3d05fa[0x0])){var _0x4c01a4=_0x11d52d['predictiveIntervalAvailable']=_0x11d52d['talking']+_0x11d52d[_0x9453('0x1b6')];var _0x9d47c1=_0x11d52d[_0x9453('0x1bf')]*0x3c;var _0x3d658b=_0x3d05fa[0x0]['predictiveIntervalAvgTalktime']+_0x3d05fa[0x0][_0x9453('0x47')];var _0x3484d1=(_0x3d05fa[0x0][_0x9453('0x1ce')]+_0x3d05fa[0x0][_0x9453('0xc4')]+_0x3d05fa[0x0][_0x9453('0x45')])/_0x3d05fa[0x0][_0x9453('0x4b')];_0x11d52d['predictiveIntervalHitRate']=_0x3484d1>0x0?_0x3484d1:0x1;switch(_0x11d52d[_0x9453('0x1c3')]){case _0x9453('0x1c1'):var _0x5aac1f=_0x11d52d[_0x9453('0x1b1')]/0x64;return _0x30055e['abandonmentRate'](_0x4c01a4,_0x9d47c1,_0x3d658b,_0x3484d1,_0x5aac1f)[_0x9453('0x92')](function(_0xe02665){return _0x24fcfb(_0xe02665);});case _0x9453('0x1cf'):var _0x4e092d=_0x11d52d[_0x9453('0x1b1')]/0x64;return _0x30055e[_0x9453('0x1d0')](_0x4c01a4,_0x9d47c1,_0x3d658b,_0x3484d1,_0x4e092d)[_0x9453('0x92')](function(_0x4f076b){return _0x24fcfb(_0x4f076b);});default:return _0xa0976c(msgResponse(_0x9453('0x1d1'),_0x9453('0x8d'),_0x9453('0x1d2')));}}else{return _0xa0976c(msgResponse(_0x9453('0x1d1'),_0x9453('0x8d'),_0x9453('0x1d3')));}});};};Dialer[_0x9453('0x81')][_0x9453('0x1d4')]=function(_0x26fac3){var _0x4eb710=this;return function(_0x2f6c5b){return new Promise(function(_0x43a896,_0x4baae3){_[_0x9453('0x57')](_0x26fac3,_0x2f6c5b[0x0]);if(checkGetDataPredictive(_0x2f6c5b[0x0])){loggerPredictive[_0x9453('0x41')](JSON[_0x9453('0x6d')](_0x2f6c5b[0x0]));if(_0x26fac3[_0x9453('0x1c3')]===_0x9453('0x1c1')){return _0x4eb710[_0x9453('0x147')](_0x26fac3['id'])[_0x9453('0x92')](function(_0x4068f5){var _0x16a001=_0x26fac3[_0x9453('0x1d5')]-_0x4068f5[0x0][_0x9453('0x1d6')];var _0x14e090=_0x26fac3[_0x9453('0x1bf')]*0x3c;var _0x169e8d=_0x2f6c5b[0x0][_0x9453('0x49')]+_0x2f6c5b[0x0]['predictiveIntervalAvgHoldtime'];var _0x598d07=(_0x2f6c5b[0x0][_0x9453('0x1ce')]+_0x2f6c5b[0x0][_0x9453('0xc4')]+_0x2f6c5b[0x0][_0x9453('0x45')])/_0x2f6c5b[0x0][_0x9453('0x4b')];var _0x270cde=_0x26fac3['dialPredictiveOptimizationPercentage']/0x64;_0x26fac3['predictiveIntervalPauses']=_0x4068f5[0x0][_0x9453('0x1d6')]||0x0;_0x26fac3[_0x9453('0x1ba')]=_0x598d07>0x0?_0x598d07:0x1;return _0x4eb710['abandonmentRate'](_0x16a001,_0x14e090,_0x169e8d,_0x598d07,_0x270cde);})[_0x9453('0x92')](function(_0x2990f4){return _0x43a896(_0x2990f4);})[_0x9453('0x98')](function(_0xfce640){return _0x4baae3(msgResponse(_0x9453('0x1d7'),_0x9453('0x8d'),JSON[_0x9453('0x6d')](_0xfce640)));});}if(_0x26fac3['dialPredictiveOptimization']===_0x9453('0x1cf')){return _0x4eb710[_0x9453('0x147')](_0x26fac3['id'])['then'](function(_0x23e52e){var _0x5d8b84=_0x26fac3[_0x9453('0x1d5')]-_0x23e52e[0x0][_0x9453('0x1d6')];var _0x51c1ff=_0x26fac3['dialPredictiveInterval']*0x3c;var _0x1fd22a=_0x2f6c5b[0x0][_0x9453('0x49')]+_0x2f6c5b[0x0][_0x9453('0x47')];var _0x24cc71=(_0x2f6c5b[0x0][_0x9453('0x1ce')]+_0x2f6c5b[0x0][_0x9453('0xc4')]+_0x2f6c5b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2f6c5b[0x0][_0x9453('0x4b')];var _0x23c3ce=_0x26fac3[_0x9453('0x1b1')]/0x64;_0x26fac3[_0x9453('0x1d8')]=_0x23e52e[0x0]['outboundQueuePauses']||0x0;_0x26fac3['predictiveIntervalHitRate']=_0x24cc71>0x0?_0x24cc71:0x1;return _0x4eb710['busyFactor'](_0x5d8b84,_0x51c1ff,_0x1fd22a,_0x24cc71,_0x23c3ce);})[_0x9453('0x92')](function(_0xddbf37){return _0x43a896(_0xddbf37);})[_0x9453('0x98')](function(_0x39ebc4){return _0x4baae3(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x39ebc4)));});}}else{return _0x4baae3(msgResponse('[getDataPredictive]',_0x9453('0x8d'),_0x9453('0x1d3')));}});};};Dialer[_0x9453('0x81')]['startMethodPredictive']=function(_0x53cf69){var _0x712861=this;return function(){var _0x40a4af=0x0;var _0x46840c=Math[_0x9453('0x1b8')](_0x53cf69[_0x9453('0x53')]*0x3e8);if(_0x46840c>0x0){_0x46840c=_0x46840c<0x64?0x64:_0x46840c;loggerPredictive[_0x9453('0x41')](_0x53cf69[_0x9453('0x59')],'one\x20call\x20every:',_0x46840c,'milliseconds');_0x53cf69['handlePredictive']=setInterval(function(){_0x712861[_0x9453('0x5d')](_0x53cf69);loggerPredictiveCalls['info'](_0x9453('0x1d9'),_0x40a4af+=0x1);},_0x46840c);}else{loggerPredictive[_0x9453('0x41')](_0x53cf69[_0x9453('0x59')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x9453('0x81')][_0x9453('0x1da')]=function(_0x50e112,_0x2bd775){var _0x474026=this;return function(_0x10d61c){if(_[_0x9453('0x40')](_0x10d61c)){if(_[_0x9453('0xec')](_0x2bd775[_0x9453('0x14f')])||!_0x2bd775[_0x9453('0x1db')]){if(_0x50e112['dialMethod']==='booked'){_0x50e112[_0x9453('0x6a')]=_[_0x9453('0x37')](_0x50e112[_0x9453('0x6a')])?!![]:_0x50e112['queueStatusComplete'];var _0x43c0fd=uuid['v4']();_0x474026[_0x9453('0x1d')][_0x43c0fd]=new Action(_0x50e112,_0x2bd775,_0x43c0fd);loggerBooked['info'](_0x9453('0x1dc'),_0x43c0fd,_0x9453('0x1dd'),JSON[_0x9453('0x6d')](_0x50e112[_0x9453('0x6a')]),_0x9453('0x1de'),_0x50e112[_0x9453('0x59')]);if(_0x50e112[_0x9453('0x6a')]){_0x50e112[_0x9453('0x6a')]=![];_0x474026[_0x9453('0xf0')][_0x474026[_0x9453('0x1d')][_0x43c0fd][_0x9453('0xb3')]]=[];ami[_0x9453('0x91')]({'actionid':_0x43c0fd,'action':_0x9453('0x1df'),'queue':_0x50e112[_0x9453('0x59')]})[_0x9453('0x98')](function(){_0x474026[_0x9453('0xb6')](_0x50e112);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x474026[_0x9453('0x1d')][_0x43c0fd]['ContactId'],'ListId':_0x474026[_0x9453('0x1d')][_0x43c0fd][_0x9453('0xd8')],'VoiceQueueId':_0x474026['actions'][_0x43c0fd][_0x9453('0xd9')]||undefined,'CampaignId':_0x474026[_0x9453('0x1d')][_0x43c0fd][_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x1e0')));delete _0x474026['actions'][_0x43c0fd];});}else{loggerBooked[_0x9453('0x41')](_0x9453('0x1e1'),JSON[_0x9453('0x6d')](_0x50e112[_0x9453('0x6a')]),_0x9453('0x1de'),_0x50e112['name']);_0x474026[_0x9453('0xb6')](_0x50e112);hopperUtils[_0x9453('0xd4')]({'active':![],'ContactId':_0x474026[_0x9453('0x1d')][_0x43c0fd]['ContactId'],'ListId':_0x474026['actions'][_0x43c0fd][_0x9453('0xd8')],'VoiceQueueId':_0x474026[_0x9453('0x1d')][_0x43c0fd][_0x9453('0xd9')]||undefined,'CampaignId':_0x474026['actions'][_0x43c0fd][_0x9453('0xda')]||undefined})[_0x9453('0x98')](loggerCatch(_0x9453('0x1e0')));delete _0x474026[_0x9453('0x1d')][_0x43c0fd];}}else{return _0x474026[_0x9453('0x154')](_0x50e112,_0x2bd775);}}else{if(utils[_0x9453('0x58')](undefined,_0x2bd775[_0x9453('0x1e2')])<_0x50e112[_0x9453('0x1e3')]*0x3c){if(_0x2bd775['Agent']&&!_0x2bd775[_0x9453('0x13e')][_0x9453('0x1e4')]){_0x474026[_0x9453('0x17')][_0x9453('0xf2')](_0x2bd775['id'])['finally'](function(){_0x474026[_0x9453('0xb6')](_0x50e112);});}else{hopperUtils[_0x9453('0x1e5')]({'active':![]},_0x2bd775['id'],0x1)[_0x9453('0xf5')](function(){_0x474026['updateOriginated'](_0x50e112);});}}else{_0x50e112[_0x9453('0x1e6')]+=0x1;_0x474026[_0x9453('0xb6')](_0x50e112);if(_0x50e112[_0x9453('0x1e7')]){hopperUtils[_0x9453('0xd4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2bd775[_0x9453('0xd7')],'ListId':_0x2bd775['ListId'],'VoiceQueueId':_0x2bd775[_0x9453('0xd9')]||undefined,'CampaignId':_0x2bd775[_0x9453('0xda')]||undefined})['catch'](loggerCatch(_0x9453('0x1e8')));hopperUtils[_0x9453('0xbe')](createObjHistory(_0x50e112,_0x2bd775,utils[_0x9453('0x63')]['QUEUE_RECALL'],0x17,_0x9453('0x1e9')))['catch'](loggerCatch(_0x9453('0x1ea')));}else{_0x474026[_0x9453('0x10d')](createObjHistory(_0x50e112,_0x2bd775,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x9453('0x1eb'),'[Originate][HistoryRecallClose]');}}}}else{_0x50e112[_0x9453('0x1ec')]+=0x1;_0x474026[_0x9453('0x10d')](createObjHistory(_0x50e112,_0x2bd775,utils[_0x9453('0x63')][_0x9453('0x1ed')],0xd,'Blacklist'),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0x9453('0x81')][_0x9453('0x153')]=function(_0xf5f707){var _0x2ce185=this;var _0x125927=_0xf5f707[_0x9453('0x1ee')]-_0xf5f707[_0x9453('0x149')];emitCampaignSummary(_0xf5f707);if(_0x125927>0x0&&_0xf5f707[_0x9453('0x1ef')]==0x0){if(_0x125927>this[_0x9453('0x1c')]){_0x125927=this[_0x9453('0x1c')];}_0xf5f707[_0x9453('0x1ef')]=0x1;hopperUtils[_0x9453('0x1f0')](_0xf5f707,_0x125927)[_0x9453('0x92')](function(_0x25ca12){_0xf5f707['temp']=0x0;if(_0x25ca12){if(!utils[_0x9453('0x1f1')](_0x25ca12)){_0xf5f707[_0x9453('0x62')]=utils['CAMPAIGN_STATUS'][_0x9453('0x66')];logger[_0x9453('0x41')](_0x9453('0x1f2')+_0xf5f707[_0x9453('0x59')]);}else{_0xf5f707[_0x9453('0x149')]+=_0x25ca12[_0x9453('0x8f')];_0xf5f707[_0x9453('0x62')]=utils[_0x9453('0x63')][_0x9453('0x1f3')];for(var _0x1a6fcd=0x0;_0x1a6fcd<_0x25ca12[_0x9453('0x8f')];_0x1a6fcd+=0x1){_0xf5f707[_0x9453('0x1f4')]+=0x1;if(_[_0x9453('0xec')](_0x25ca12[_0x1a6fcd])||_['isNil'](_0x25ca12[_0x1a6fcd][_0x9453('0x16f')])||_[_0x9453('0xec')](_0x25ca12[_0x1a6fcd]['phone'])){_0x2ce185['emptyContact'](_0x9453('0x1f5'),_0xf5f707,_0x25ca12[_0x1a6fcd]);}else{hopperUtils[_0x9453('0x1f6')](_[_0x9453('0x6e')](_0x25ca12[_0x1a6fcd],[_0x9453('0xda'),_0x9453('0x158')]))[_0x9453('0x92')](_0x2ce185[_0x9453('0x1da')](_0xf5f707,_0x25ca12[_0x1a6fcd]))[_0x9453('0x98')](_0x2ce185[_0x9453('0x14c')](_0x9453('0x1f7'),_0xf5f707));}}}}})[_0x9453('0x98')](loggerGetContactDialer(_0x9453('0x1f8'),_0xf5f707,_0x125927));}};Dialer[_0x9453('0x81')]['handlePower']=function(_0x393c75,_0x1b1a47){var _0x22c72b=this;var _0x1c955a=[];if(_0x1b1a47<0x1||_0x393c75['dialMethod']===_0x9453('0x9')){_0x1b1a47=0x1;}var _0x28a400=Math[_0x9453('0x1b8')](_0x393c75[_0x9453('0x1b6')]*_0x1b1a47)-_0x393c75['originated'];if(_0x393c75[_0x9453('0x1f9')]>0x0){var _0xbd161e=_0x393c75['dialLimitQueue']-_0x393c75['originated']-_0x393c75[_0x9453('0x1b7')]-_0x393c75[_0x9453('0x134')];if(_0x28a400>_0xbd161e){_0x28a400=_0xbd161e;}}if(_0x28a400>0x0&&_0x393c75[_0x9453('0x1ef')]==0x0){if(_0x393c75[_0x9453('0xa6')]===_0x9453('0x9')){_0x28a400=0x1;}if(_0x28a400>this['maxNumberOriginate']){_0x28a400=this[_0x9453('0x1c')];}for(var _0x1de7a6 in this['agents']){if(typeof this[_0x9453('0x1a')][_0x1de7a6]!==_0x9453('0x144')){if(this[_0x9453('0x1a')][_0x1de7a6][_0x9453('0x67')]===_0x9453('0x1fa')&&this[_0x9453('0x1a')][_0x1de7a6][_0x9453('0x7e')]===_0x9453('0x7f')){_0x1c955a[_0x9453('0x90')](this['agents'][_0x1de7a6]['id']);}}}_0x393c75['temp']=0x1;hopperUtils[_0x9453('0x1fb')](_0x393c75,_0x1c955a,_0x28a400)['then'](function(_0x2fbf36){_0x393c75[_0x9453('0x1ef')]=0x0;if(_0x2fbf36){if(!utils[_0x9453('0x1f1')](_0x2fbf36)){hopperUtils['countReScheduled'](_0x393c75)[_0x9453('0x92')](sendMessageReschedule(_0x393c75))[_0x9453('0x98')](loggerCatch(_0x9453('0x1fc')));}else{_0x393c75[_0x9453('0x149')]+=_0x2fbf36[_0x9453('0x8f')];_0x393c75[_0x9453('0x62')]=_0x393c75[_0x9453('0xa6')]===_0x9453('0x9')?utils['CAMPAIGN_STATUS'][_0x9453('0x15f')]:utils[_0x9453('0x63')][_0x9453('0x1f3')];for(var _0x5b0b7f=0x0;_0x5b0b7f<_0x2fbf36[_0x9453('0x8f')];_0x5b0b7f+=0x1){if(_[_0x9453('0xec')](_0x2fbf36[_0x5b0b7f])||_[_0x9453('0xec')](_0x2fbf36[_0x5b0b7f][_0x9453('0x16f')])||_['isNil'](_0x2fbf36[_0x5b0b7f][_0x9453('0x158')])){_0x22c72b['emptyContact']('[actionOriginate]\x20',_0x393c75,_0x2fbf36[_0x5b0b7f]);}else{hopperUtils['checkIsBlackList'](_[_0x9453('0x6e')](_0x2fbf36[_0x5b0b7f],['VoiceQueueId',_0x9453('0x158')]))[_0x9453('0x92')](_0x22c72b[_0x9453('0x1da')](_0x393c75,_0x2fbf36[_0x5b0b7f]))[_0x9453('0x98')](_0x22c72b['loggerHandler'](_0x9453('0x1f5'),_0x393c75));}}}}})[_0x9453('0x98')](loggerGetContactDialer(_0x9453('0x1fd'),_0x393c75,_0x28a400));}};Dialer[_0x9453('0x81')][_0x9453('0x5d')]=function(_0x31669c){if(_0x31669c[_0x9453('0x1f9')]>0x0){var _0x2995cc=_0x31669c['dialLimitQueue']-_0x31669c['originated']-_0x31669c['talking'];if(_0x2995cc>0x0&&_0x31669c[_0x9453('0x1ef')]==0x0){this[_0x9453('0x1fe')](_0x31669c);}else{loggerPredictiveCalls[_0x9453('0x41')](_0x9453('0x1ff'));}}else{this[_0x9453('0x1fe')](_0x31669c);}};Dialer[_0x9453('0x81')][_0x9453('0x1fe')]=function(_0x4149cb){var _0x52f5a4=this;var _0x367ea1=[];_0x4149cb['originated']+=0x1;for(var _0x5cb116 in this[_0x9453('0x1a')]){if(typeof this[_0x9453('0x1a')][_0x5cb116]!=='undefined'){if(this[_0x9453('0x1a')][_0x5cb116][_0x9453('0x67')]===_0x9453('0x1fa')&&this['agents'][_0x5cb116]['status']===_0x9453('0x7f')){_0x367ea1[_0x9453('0x90')](this['agents'][_0x5cb116]['id']);}}}_0x4149cb['temp']=0x1;return this[_0x9453('0x1fb')](_0x4149cb['id'],_0x367ea1,0x1,_0x4149cb[_0x9453('0x200')],_0x4149cb)[_0x9453('0x92')](function(_0x2b5cb5){_0x4149cb[_0x9453('0x1ef')]=0x1;if(_0x2b5cb5){if(!utils['checkContactEmpty'](_0x2b5cb5)){utils[_0x9453('0x60')](_0x4149cb,0x1,0x0);return hopperUtils[_0x9453('0x201')](_0x4149cb)[_0x9453('0x92')](sendMessageReschedule(_0x4149cb))[_0x9453('0x98')](loggerCatch(_0x9453('0x1fc')));}else{_0x4149cb['message']=utils[_0x9453('0x63')]['RUNNING'];if(_['isNil'](_0x2b5cb5[0x0])||_[_0x9453('0xec')](_0x2b5cb5[0x0][_0x9453('0x16f')])||_[_0x9453('0xec')](_0x2b5cb5[0x0]['phone'])){_0x52f5a4[_0x9453('0x14d')](_0x9453('0x1f5'),_0x4149cb,_0x2b5cb5[0x0]);}else{return hopperUtils[_0x9453('0x202')](_['pick'](_0x2b5cb5[0x0],[_0x9453('0xd9'),_0x9453('0x158')]))['then'](_0x52f5a4[_0x9453('0x1da')](_0x4149cb,_0x2b5cb5[0x0]))['catch'](_0x52f5a4[_0x9453('0x14c')]('[actionOriginatePredictive]\x20',_0x4149cb));}}}})[_0x9453('0x98')](loggerGetContactDialer(_0x9453('0x203'),_0x4149cb,0x1));};Dialer[_0x9453('0x81')][_0x9453('0x204')]=function(_0x4a1e88,_0xa8a4c6,_0x7e313e,_0x21be5a,_0x2f9907,_0x475f8c){loggerPredictive[_0x9453('0x41')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x9453('0x41')]('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',_0x4a1e88);loggerPredictive[_0x9453('0x41')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xa8a4c6);loggerPredictive['info'](_0x9453('0x205'),_0x7e313e);loggerPredictive[_0x9453('0x41')](_0x9453('0x206'),_0x21be5a);loggerPredictive[_0x9453('0x41')](_0x9453('0x207'),_0x2f9907);loggerPredictive[_0x9453('0x41')](_0x9453('0x4a'));return new Promise(function(_0x422dd9,_0x6dcf03){if(_0x4a1e88<=0x0||isNaN(_0x4a1e88)){return _0x6dcf03(msgResponse(_0x9453('0x208'),'Error',_0x9453('0x209')+_0x4a1e88));}if(_0x7e313e<=0x0||isNaN(_0x7e313e)){return _0x6dcf03(msgResponse('[abandonmentRate]','Error','Ts\x20=\x20'+_0x7e313e));}if(_0x21be5a<=0x0||isNaN(_0x21be5a)){return _0x6dcf03(msgResponse(_0x9453('0x208'),_0x9453('0x7b'),_0x9453('0x20a')+_0x21be5a));}if(_0xa8a4c6<=0x0||isNaN(_0xa8a4c6)){return _0x6dcf03(msgResponse(_0x9453('0x208'),_0x9453('0x7b'),_0x9453('0x20b')+_0xa8a4c6));}if(_0x2f9907<=0x0||isNaN(_0x2f9907)){return _0x6dcf03(msgResponse('[abandonmentRate]',_0x9453('0x7b'),_0x9453('0x20c')+_0x2f9907));}_0x475f8c=_0x475f8c||0x0;var _0x41a642=0x1/_0x7e313e;var _0x1ff6e9=0x0;var _0x406e45=0x0;var _0x3c8ac3=0x0;var _0x211262=0x0;for(var _0x1fb1e3=0x0;_0x3c8ac3<_0x2f9907;_0x1fb1e3+=0x1){_0x406e45=_0x1fb1e3/_0xa8a4c6;_0x1ff6e9=(_0x21be5a*_0x406e45+_0x475f8c)/_0x41a642;_0x3c8ac3=utils[_0x9453('0x20d')](_0x1ff6e9,_0x4a1e88);_0x211262=_0x1ff6e9/_0x4a1e88*(0x1-utils[_0x9453('0x20d')](_0x1ff6e9,_0x4a1e88));}return _0x422dd9({'erlangCalls':_0x1fb1e3,'erlangCallToSecond':_0xa8a4c6/_0x1fb1e3,'erlangAbandonmentRate':_0x3c8ac3,'erlangBusyFactor':_0x211262});});};Dialer[_0x9453('0x81')]['busyFactor']=function(_0x297e7d,_0x2fc8d1,_0x66b1a8,_0x430081,_0x5c198f,_0xdf062f){loggerPredictive[_0x9453('0x41')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x9453('0x41')]('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',_0x297e7d);loggerPredictive[_0x9453('0x41')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2fc8d1);loggerPredictive[_0x9453('0x41')](_0x9453('0x205'),_0x66b1a8);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',_0x430081);loggerPredictive[_0x9453('0x41')](_0x9453('0x20e'),_0x5c198f);loggerPredictive[_0x9453('0x41')](_0x9453('0x4a'));return new Promise(function(_0x42fd22,_0x120872){if(_0x297e7d<=0x0||isNaN(_0x297e7d)){return _0x120872(msgResponse(_0x9453('0x20f'),'Error',_0x9453('0x209')+_0x297e7d));}if(_0x66b1a8<=0x0||isNaN(_0x66b1a8)){return _0x120872(msgResponse(_0x9453('0x20f'),'Error',_0x9453('0x210')+_0x66b1a8));}if(_0x430081<=0x0||isNaN(_0x430081)){return _0x120872(msgResponse(_0x9453('0x20f'),_0x9453('0x7b'),_0x9453('0x20a')+_0x430081));}if(_0x2fc8d1<=0x0||isNaN(_0x2fc8d1)){return _0x120872(msgResponse(_0x9453('0x20f'),_0x9453('0x7b'),_0x9453('0x20b')+_0x2fc8d1));}if(_0x5c198f<=0x0||isNaN(_0x5c198f)){return _0x120872(msgResponse(_0x9453('0x20f'),_0x9453('0x7b'),_0x9453('0x211')+_0x5c198f));}_0xdf062f=_0xdf062f||0x0;var _0x50e2f0=0x1/_0x66b1a8;var _0xc090dc=0x0;var _0x337e17=0x0;var _0x48e410=0x0;var _0x2a0a2d=0x0;for(var _0x347dad=0x0;_0x2a0a2d<_0x5c198f;_0x347dad+=0x1){_0x337e17=_0x347dad/_0x2fc8d1;_0xc090dc=(_0x430081*_0x337e17+_0xdf062f)/_0x50e2f0;_0x48e410=utils[_0x9453('0x20d')](_0xc090dc,_0x297e7d);_0x2a0a2d=_0xc090dc/_0x297e7d*(0x1-utils[_0x9453('0x20d')](_0xc090dc,_0x297e7d));}return _0x42fd22({'erlangCalls':_0x347dad,'erlangCallToSecond':_0x2fc8d1/_0x347dad,'erlangAbandonmentRate':_0x48e410,'erlangBusyFactor':_0x2a0a2d});});};module[_0x9453('0x212')]=Dialer; \ No newline at end of file +var _0xff43=['countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','ContactId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','rrmemory','roundrobin','paused','stateinterface','locked','queueBooked','pick','idHopper','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','rescheduleContact','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','isNil','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','membername','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','outboundAnswerAgiCallsDay','Machine','AMD','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnosuchnumberretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','Normal\x20Clearing','[syncAgentComplete][createHistory]','[syncAgentComplete]','outboundUnknownCallsDay','cause-txt','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','inUse','talking','pTalking','[syncQueueSummary]','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','online','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','sequence','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','[emptyContact][createHistory]','[emptyContact]','checkPreviewRecallReminder','handleIvr','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','Trunk','getCallerId','callerid','dialOriginateCallerIdNumber','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','dialNoSuchNumberRetryFrequency','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','callAdditionalPhoneAfterMin','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','available','abandonmentRate','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','loggedIn','busyFactor','erlangCallToSecond','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','dialMethod','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','getContactDialerIvr','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','checkContactEmpty','countReScheduled','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','[countReScheduled]\x20','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','[busyFactor]','Umin\x20=\x20','exports','util','lodash','uuid','moment','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','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','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','getSeconds','startProgressive\x20value\x20cleared','startPredictive\x20value\x20cleared','handlePredictive','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','endtime','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','prototype','active','SIP/%s','reachable','status','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','Intervals','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','content','catch','push','indexOf','true','some','OVERTIME_INTERVAL','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','isIVRCampaignActive','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','[ifTime][promiseAll]','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','Error','uniqueid','ivr','queue','answertime','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','moveContactManagedDialer','updateOriginated','droptime','responsetime','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','statedesc','Drop'];(function(_0x35839c,_0x28526b){var _0x52d65d=function(_0xc0966e){while(--_0xc0966e){_0x35839c['push'](_0x35839c['shift']());}};_0x52d65d(++_0x28526b);}(_0xff43,0x154));var _0x3ff4=function(_0xec299e,_0x2c9744){_0xec299e=_0xec299e-0x0;var _0x2e4be6=_0xff43[_0xec299e];return _0x2e4be6;};'use strict';var util=require(_0x3ff4('0x0'));var _=require(_0x3ff4('0x1'));var uuid=require(_0x3ff4('0x2'));var moment=require(_0x3ff4('0x3'));var rr=require('rr');var Redis=require(_0x3ff4('0x4'));var utils=require('./utils');var hopperUtils=require(_0x3ff4('0x5'));var ut=require('../preview/util/util');var config=require(_0x3ff4('0x6'));var logger=require(_0x3ff4('0x7'))(_0x3ff4('0x8'));var loggerBooked=require(_0x3ff4('0x7'))(_0x3ff4('0x9'));var loggerPredictive=require('../../../config/logger')(_0x3ff4('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0x3ff4('0xb'));var loggerSyncQueueSummary=require(_0x3ff4('0x7'))(_0x3ff4('0xc'));var ami=require(_0x3ff4('0xd'));config[_0x3ff4('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x3ff4('0xf'))(new Redis(config['redis']));var cmHopper=require(_0x3ff4('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x3ff4('0x11'));var Interval=require(_0x3ff4('0x12'));var Action=require(_0x3ff4('0x13'));var History=require(_0x3ff4('0x14'));var Final=require(_0x3ff4('0x15'));var AgentComplete=require(_0x3ff4('0x16'));var QueueCallerAbandon=require(_0x3ff4('0x17'));var Hangup=require(_0x3ff4('0x18'));var ipAgi=process[_0x3ff4('0x19')][_0x3ff4('0x1a')]||_0x3ff4('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x3ff4('0x1c')]=function(_0x1c65ab){this[_0x3ff4('0x1d')]=this[_0x3ff4('0x1d')]?this['tail'][_0x3ff4('0x1e')](_0x1c65ab):_0x1c65ab();};function Dialer(_0x3d46dd,_0x2798e0){this['sequence']=new Sequence();this[_0x3ff4('0x1f')]=_0x2798e0;this['voiceQueues']=_0x3d46dd[_0x3ff4('0x20')];this[_0x3ff4('0x21')]=_0x3d46dd[_0x3ff4('0x21')];this[_0x3ff4('0x22')]=_0x3d46dd[_0x3ff4('0x22')];this[_0x3ff4('0x23')]=_0x3d46dd[_0x3ff4('0x23')];this['maxNumberOriginate']=config[_0x3ff4('0x24')]||0x2;this[_0x3ff4('0x25')]={};this['actions']={};this['contactsId']={};this[_0x3ff4('0x26')]={};this[_0x3ff4('0x27')]={};this[_0x3ff4('0x28')]={};this[_0x3ff4('0x29')]={};this[_0x3ff4('0x2a')]={};this['queueBooked']={};this[_0x3ff4('0x2b')]={};this[_0x3ff4('0x2c')]={};ami['on']('agentconnect',this[_0x3ff4('0x2d')][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x2f'),this[_0x3ff4('0x30')][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x31'),this['syncOriginateResponse'][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x32'),this[_0x3ff4('0x33')][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x34'),this[_0x3ff4('0xc')][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x35'),this['syncQueueSummaryComplete'][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x36'),this[_0x3ff4('0x37')][_0x3ff4('0x2e')](this));ami['on']('newexten',this[_0x3ff4('0x38')]['bind'](this));ami['on'](_0x3ff4('0x39'),this[_0x3ff4('0x3a')][_0x3ff4('0x2e')](this));ami['on']('queuemember',this[_0x3ff4('0x3b')][_0x3ff4('0x2e')](this));ami['on'](_0x3ff4('0x3c'),this['syncQueueStatusComplete'][_0x3ff4('0x2e')](this));this[_0x3ff4('0x3d')]();this['loopClearZombieChannels']();RpcSetting[_0x3ff4('0x3e')]()[_0x3ff4('0x3f')](function(_0x5bc09c){previewRecallmeReminderInterval=_0x5bc09c[_0x3ff4('0x40')];});}function isNotNull(_0x5882c0){return _0x5882c0!==null&&!_['isUndefined'](_0x5882c0);}function msgResponse(_0x32d67a,_0x465745,_0x1d3778){return{'action':_0x32d67a,'response':_0x465745,'message':_0x1d3778,'stack':_0x1d3778};}function emit(_0x18077a,_0x23ae10,_0x1c83cc){io['to'](_0x18077a)[_0x3ff4('0x41')](_0x23ae10,_0x1c83cc);}function emitOutboundVoiceQueueSummary(_0x294ab8){if(_0x294ab8[_0x3ff4('0x42')]==='outbound'){logger[_0x3ff4('0x43')](_0x3ff4('0x44'),util[_0x3ff4('0x45')](_0x294ab8,{'showHidden':![],'depth':null}));emit(util['format'](_0x3ff4('0x46'),_0x294ab8[_0x3ff4('0x47')]),_0x3ff4('0x48'),_0x294ab8);}}function checkGetDataPredictive(_0x316bb1){if(isNotNull(_0x316bb1)&&!_[_0x3ff4('0x49')](_0x316bb1)){loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x4b'));loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x4c'),_0x316bb1[_0x3ff4('0x4d')]);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x4e'),_0x316bb1[_0x3ff4('0x4f')]);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x50'),_0x316bb1['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x51'),_0x316bb1[_0x3ff4('0x52')]);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x53'),_0x316bb1['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x54'),_0x316bb1[_0x3ff4('0x55')]);loggerPredictive['info'](_0x3ff4('0x56'));if(_0x316bb1['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x316bb1[_0x3ff4('0x55')])&&_0x316bb1[_0x3ff4('0x55')]>0x0){return!![];}loggerPredictive['info'](_0x3ff4('0x57'));if(!_[_0x3ff4('0x58')](_0x316bb1[_0x3ff4('0x59')])&&_0x316bb1[_0x3ff4('0x59')]>0x0){return!![];}loggerPredictive['info'](_0x3ff4('0x5a'));}else{loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x5b'));}}else{loggerPredictive[_0x3ff4('0x4a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x52ef43){return function(_0xe6d606){loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x5c'));loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x5d'),_0xe6d606[_0x3ff4('0x5e')]);loggerPredictive['info'](_0x3ff4('0x5f'),_0xe6d606['erlangCallToSecond']);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x60'),_0xe6d606[_0x3ff4('0x61')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe6d606[_0x3ff4('0x62')]);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x60'),_0xe6d606[_0x3ff4('0x61')]);loggerPredictive[_0x3ff4('0x4a')]('---------------------------');_[_0x3ff4('0x63')](_0x52ef43,_0xe6d606);};}function ifInterval(_0x366aab,_0x1819da){if(_[_0x3ff4('0x58')](_0x1819da)){return![];}return utils[_0x3ff4('0x64')](undefined,_0x1819da)<_0x366aab*0x3c;}function clearPredictiveAttributes(_0x287634){if(_0x287634['startProgressive']){_0x287634[_0x3ff4('0x29')]=undefined;loggerPredictive[_0x3ff4('0x43')](_0x287634[_0x3ff4('0x47')],_0x3ff4('0x65'));}if(_0x287634[_0x3ff4('0x28')]){_0x287634[_0x3ff4('0x28')]=undefined;loggerPredictive['debug'](_0x287634[_0x3ff4('0x47')],_0x3ff4('0x66'));}if(_0x287634[_0x3ff4('0x67')]){clearInterval(_0x287634[_0x3ff4('0x67')]);_0x287634[_0x3ff4('0x67')]=undefined;loggerPredictive[_0x3ff4('0x43')](_0x287634[_0x3ff4('0x47')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x2315b0,_0x8eedfe){return function(_0x2228df){loggerPredictive[_0x3ff4('0x68')](_0x8eedfe[_0x3ff4('0x47')],_0x2315b0);loggerPredictive[_0x3ff4('0x68')](_0x2228df[_0x3ff4('0x69')]);clearPredictiveAttributes(_0x8eedfe);};}function loggerCatch(_0x89440b){return function(_0x3bb766){logger['error'](_0x89440b,util[_0x3ff4('0x45')](_0x3bb766,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x25a6af,_0x488c87,_0xe3b106){return function(_0x4d1830){utils[_0x3ff4('0x6a')](_0x488c87,_0xe3b106,0x0);_0x488c87[_0x3ff4('0x6b')]=0x0;logger['error'](_0x25a6af,util[_0x3ff4('0x45')](_0x4d1830,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1f7362){return function(_0x4f0eb9){if(isNotNull(_0x4f0eb9)&&isNotNull(_0x4f0eb9[0x0])){if(_0x4f0eb9[0x0][_0x3ff4('0x6c')]>0x0){_0x1f7362[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x6f')];logger['info'](_0x3ff4('0x70')+_0x1f7362['name'],_0x4f0eb9[0x0][_0x3ff4('0x6c')],_0x3ff4('0x71'));}else{_0x1f7362[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x72')];logger[_0x3ff4('0x4a')](_0x3ff4('0x73')+_0x1f7362['name']);}}};}function createObjHistory(_0x4390e0,_0x2c48ce,_0x407d7e,_0x2672b3,_0x53b8e9){_0x4390e0[_0x3ff4('0x6d')]=_0x407d7e;var _0x1a629e=new Action(_0x4390e0,_0x2c48ce);var _0x58019a=new History(_0x1a629e);_0x58019a[_0x3ff4('0x74')]=_0x2672b3;_0x58019a['statedesc']=_0x53b8e9;_0x58019a[_0x3ff4('0x75')]=_0x1a629e[_0x3ff4('0x76')];return _0x58019a;}function unlockQueueStatus(_0x33b8b6,_0x47bcfa){setTimeout(function(){if(_['isUndefined'](_0x33b8b6['queueStatusComplete'])){loggerBooked[_0x3ff4('0x68')]('[unlockQueueStatus][undefined]',_0x47bcfa);}_0x33b8b6[_0x3ff4('0x77')]=!![];loggerBooked[_0x3ff4('0x4a')](_0x3ff4('0x78'),_0x47bcfa,JSON[_0x3ff4('0x79')](_['pick'](_0x33b8b6,['name',_0x3ff4('0x77')])));},0x1f3);}function checkInterval(_0x2d3c30){return function(){if(!isNotNull(_0x2d3c30['Interval'])){_0x2d3c30[_0x3ff4('0x6d')]=utils['CAMPAIGN_STATUS'][_0x3ff4('0x7a')];throw _0x2d3c30['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x2d3c30['Interval']['Intervals'])){_0x2d3c30[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')]['NULL_INTERVAL'];throw _0x2d3c30[_0x3ff4('0x47')]+_0x3ff4('0x7b');}if(!isNotNull(_[_0x3ff4('0x49')](_0x2d3c30[_0x3ff4('0x7c')]['Intervals']))){_0x2d3c30[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')]['NULL_INTERVAL'];throw _0x2d3c30[_0x3ff4('0x47')]+_0x3ff4('0x7b');}};}function checkIsIVRCampaignActive(_0x328782){return function(){if(!utils['isIVRCampaignActive'](_0x328782)){_0x328782[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x7d')];throw _0x328782['name']+_0x3ff4('0x7e');}};}function emitCampaignSummary(_0x2b7919){if(utils[_0x3ff4('0x7f')](_0x2b7919)){emit(util[_0x3ff4('0x80')](_0x3ff4('0x81'),_0x2b7919[_0x3ff4('0x47')]),_0x3ff4('0x82'),_0x2b7919);}}function loggerCatchQueueSummary(_0x633855,_0x417f2c){return function(_0x5d07cd){clearPredictiveAttributes(_0x417f2c);emitCampaignSummary(_0x417f2c);loggerSyncQueueSummary[_0x3ff4('0x43')](_0x633855,util[_0x3ff4('0x45')](_0x5d07cd,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x4d23a3){if(_0x4d23a3[_0x3ff4('0x83')]){if(_0x4d23a3['originated']===0x0){_0x4d23a3['sendMessageOneNotActive']=![];_0x4d23a3[_0x3ff4('0x6d')]=utils['CAMPAIGN_STATUS'][_0x3ff4('0x7d')];loggerSyncQueueSummary[_0x3ff4('0x43')](_0x3ff4('0x84'),_0x4d23a3[_0x3ff4('0x47')],_0x3ff4('0x85'));}else{_0x4d23a3[_0x3ff4('0x6d')]=utils['CAMPAIGN_STATUS'][_0x3ff4('0x86')];loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4d23a3[_0x3ff4('0x47')],_0x3ff4('0x87'));}emitCampaignSummary(_0x4d23a3);}}function myreject(_0x55db95){return function(_0x5e5c04){return _0x55db95(msgResponse(_0x3ff4('0x88'),'Error',JSON[_0x3ff4('0x79')](_0x5e5c04)));};}Dialer[_0x3ff4('0x89')]['isTrunkReachable']=function(_0x199dbd){return!_[_0x3ff4('0x58')](_0x199dbd)&&_0x199dbd&&!_[_0x3ff4('0x58')](_0x199dbd['name'])&&!_['isUndefined'](_0x199dbd[_0x3ff4('0x8a')])&&_0x199dbd[_0x3ff4('0x8a')]&&(this[_0x3ff4('0x23')][util[_0x3ff4('0x80')](_0x3ff4('0x8b'),_0x199dbd[_0x3ff4('0x47')])]['status']===_0x3ff4('0x8c')||this[_0x3ff4('0x23')][util[_0x3ff4('0x80')](_0x3ff4('0x8b'),_0x199dbd[_0x3ff4('0x47')])][_0x3ff4('0x8d')]==='unmonitored');};Dialer['prototype'][_0x3ff4('0x8e')]=function(_0xfe693f){var _0x2e6d02=this;return function(){if(!_0x2e6d02[_0x3ff4('0x8f')](_0xfe693f['Trunk'])){if(!_0x2e6d02[_0x3ff4('0x8f')](_0xfe693f[_0x3ff4('0x90')])){_0xfe693f[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')]['TRUNK_NOT_REACHABLE'];throw _0xfe693f['name']+_0x3ff4('0x91');}}};};Dialer['prototype'][_0x3ff4('0x92')]=function(_0x103520,_0x4845ce,_0x3ddef9,_0x2d8a16){var _0x23fe94=this;return function(){var _0x1eed29=!![];return _0x23fe94[_0x3ff4('0x93')](_0x103520,_0x4845ce,_0x3ddef9,_0x2d8a16,_0x1eed29);};};Dialer[_0x3ff4('0x89')][_0x3ff4('0x94')]=function(_0x4e2e5b,_0x2c4c6d,_0x1d0aad,_0x9da7a0){var _0x295138=this;return function(){var _0xe9ec20=![];return _0x295138['ifTimeIvr'](_0x4e2e5b[_0x3ff4('0x95')],_0x2c4c6d,_0x1d0aad,_0x9da7a0,_0xe9ec20);};};Dialer[_0x3ff4('0x89')][_0x3ff4('0x93')]=function(_0x281e09,_0x30e1b7,_0x1a39b6,_0x32b006,_0x48b77a){var _0x58595f=[];return new Promise(function(_0x3ef813,_0x108727){if(!isNotNull(_0x281e09)){_0x32b006[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x7a')];return _0x108727(msgResponse(_0x3ff4('0x96'),_0x3ff4('0x97'),_0x1a39b6+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x3ff4('0x49')](_0x281e09)){_0x32b006[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')]['EMPTY_INTERVAL'];return _0x108727(msgResponse(_0x3ff4('0x96'),_0x3ff4('0x97'),_0x1a39b6+_0x3ff4('0x98')));}if(_0x30e1b7&&_[_0x3ff4('0x58')](config[_0x3ff4('0x99')][_0x30e1b7])){_0x32b006[_0x3ff4('0x6d')]=utils['CAMPAIGN_STATUS']['UNKNOWN_TIMEZONE'];return _0x108727(msgResponse(_0x3ff4('0x96'),'Failure',_0x1a39b6+_0x3ff4('0x9a')+_0x30e1b7));}if(_[_0x3ff4('0x9b')](_0x281e09)){for(var _0x53fdfe=0x0;_0x53fdfe<_0x281e09[_0x3ff4('0x9c')];_0x53fdfe+=0x1){_0x58595f['push'](ami[_0x3ff4('0x9d')]({'action':'command','command':util[_0x3ff4('0x80')](_0x3ff4('0x9e'),_0x281e09[_0x53fdfe]['interval'],!_[_0x3ff4('0x58')](config[_0x3ff4('0x99')][_0x30e1b7])?_0x30e1b7:'')})[_0x3ff4('0x3f')](function(_0x405b8d){return _0x405b8d[_0x3ff4('0x9f')]['indexOf']('true')>=0x0;})[_0x3ff4('0xa0')](myreject(_0x108727)));}}else{_0x58595f[_0x3ff4('0xa1')](ami['Action']({'action':'command','command':util['format'](_0x3ff4('0x9e'),_0x281e09,!_['isUndefined'](config['timezones'][_0x30e1b7])?_0x30e1b7:'')})[_0x3ff4('0x3f')](function(_0x1d91bf){return _0x1d91bf[_0x3ff4('0x9f')][_0x3ff4('0xa2')](_0x3ff4('0xa3'))>=0x0;})[_0x3ff4('0xa0')](myreject(_0x108727)));}Promise['all'](_0x58595f)[_0x3ff4('0x3f')](function(_0x4bae20){var _0x3ae4d1=_[_0x3ff4('0xa4')](_0x4bae20);if(_0x3ae4d1){return _0x3ef813(_0x3ae4d1);}else{_0x32b006[_0x3ff4('0x6d')]=_0x48b77a?utils[_0x3ff4('0x6e')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x3ff4('0x6e')][_0x3ff4('0xa5')];return _0x108727(msgResponse('[ifTime][promiseAll]',_0x3ff4('0x97'),_0x3ff4('0xa6')+_0x48b77a+'\x20'+_0x1a39b6+_0x3ff4('0xa7')+util[_0x3ff4('0x45')](_0x281e09,{'showHidden':![],'depth':null})+_0x3ff4('0xa8')+_0x30e1b7));}})['catch'](function(_0x15010f){return _0x108727(msgResponse(_0x3ff4('0x96'),_0x3ff4('0x97'),JSON['stringify'](_0x15010f)));});});};Dialer[_0x3ff4('0x89')]['loopCampaigns']=function(){var _0x423662=this;return cmHopper[_0x3ff4('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0x3ff4('0x3f')](function(){setInterval(function(){_0x423662['syncCampaigns']();},0x3e8);});};Dialer[_0x3ff4('0x89')][_0x3ff4('0xaa')]=function(){var _0x37f4d9=this;var _0x5c17ce;for(var _0x1a8bcc in this[_0x3ff4('0x21')]){if(typeof this['campaigns'][_0x1a8bcc]!==_0x3ff4('0xab')){_0x5c17ce=this['campaigns'][_0x1a8bcc];if(utils[_0x3ff4('0x7f')](_0x5c17ce)&&utils[_0x3ff4('0xac')](_0x5c17ce)){_0x5c17ce['sendMessageOneNotActive']=!![];Promise[_0x3ff4('0xad')]()['then'](checkIsIVRCampaignActive(_0x5c17ce))['then'](checkInterval(_0x5c17ce))[_0x3ff4('0x3f')](_0x37f4d9['checkIsTrunkReachable'](_0x5c17ce))[_0x3ff4('0x3f')](_0x37f4d9[_0x3ff4('0x92')](_0x5c17ce[_0x3ff4('0xae')],_0x5c17ce[_0x3ff4('0xaf')],_0x5c17ce[_0x3ff4('0x47')],_0x5c17ce))[_0x3ff4('0x3f')](_0x37f4d9['checkIfTimeIntervals'](_0x5c17ce[_0x3ff4('0x7c')],_0x5c17ce[_0x3ff4('0xaf')],_0x5c17ce[_0x3ff4('0x47')],_0x5c17ce))[_0x3ff4('0x3f')](_0x37f4d9[_0x3ff4('0xb0')](_0x5c17ce))[_0x3ff4('0xa0')](loggerCatchQueueSummary(_0x3ff4('0xb1'),_0x5c17ce));}else{notSendMessagesCampaign(_0x5c17ce);}}}};Dialer[_0x3ff4('0x89')][_0x3ff4('0xb2')]=function(_0x31bf08){if(_0x31bf08['dialMethod']!==_0x3ff4('0xa')){clearPredictiveAttributes(_0x31bf08);}switch(_0x31bf08['dialMethod']){case _0x3ff4('0xb3'):this['handlePower'](_0x31bf08,0x1);break;case'power':this[_0x3ff4('0xb4')](_0x31bf08,_0x31bf08[_0x3ff4('0xb5')]);break;case _0x3ff4('0xa'):this[_0x3ff4('0xa')](_0x31bf08);break;case _0x3ff4('0x9'):this[_0x3ff4('0xb4')](_0x31bf08,0x1);break;default:logger[_0x3ff4('0x68')](_0x3ff4('0xb6'),_0x31bf08['name'],_0x3ff4('0xb7'));}};Dialer['prototype']['ifTime']=function(_0x307430,_0x21a894){var _0x540a85=_0x307430['dialTimezone'];var _0x3914ce=_0x21a894?_0x307430['dialGlobalInterval']:_0x307430[_0x3ff4('0x7c')]['Intervals'];logger[_0x3ff4('0xb8')](_0x3ff4('0xb9'),_0x3914ce,_0x540a85,_0x307430[_0x3ff4('0x47')],util[_0x3ff4('0x80')](_0x3ff4('0xba'),_0x307430[_0x3ff4('0x47')],_0x307430['id']));var _0x28efdd=null;return Interval[_0x3ff4('0xbb')](_0x3914ce,_0x540a85)[_0x3ff4('0x3f')](function(_0x2f4200){if(_0x2f4200===!![]){return _0x2f4200;}else{_0x307430[_0x3ff4('0x6d')]=_0x21a894?utils[_0x3ff4('0x6e')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x3ff4('0x6e')][_0x3ff4('0xa5')];_0x28efdd=msgResponse(_0x3ff4('0xbc'),'Failure',_0x3ff4('0xa6')+_0x21a894+'\x20'+_0x307430[_0x3ff4('0x47')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3ff4('0x45')](_0x3914ce,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x540a85);}if(_0x28efdd!==null){logger[_0x3ff4('0xb8')](_0x3ff4('0xbd'),_0x28efdd);_0x28efdd[_0x3ff4('0xbe')]=_0x21a894;throw _0x28efdd;}})[_0x3ff4('0xa0')](function(_0x2f2688){logger[_0x3ff4('0x68')](_0x3ff4('0xbf'),_0x2f2688);throw msgResponse(_0x3ff4('0x88'),_0x3ff4('0xc0'),util[_0x3ff4('0x45')](_0x2f2688,{'showHidden':![],'depth':null}));});};Dialer[_0x3ff4('0x89')][_0x3ff4('0x2d')]=function(_0x25addb){if(this['voiceQueues'][_0x25addb['queue']]){if(this[_0x3ff4('0x26')][_0x25addb[_0x3ff4('0xc1')]]&&this[_0x3ff4('0x26')][_0x25addb['uniqueid']][_0x3ff4('0x42')]!==_0x3ff4('0xc2')){this['updateOriginated'](this['voiceQueues'][_0x25addb[_0x3ff4('0xc3')]]);this[_0x3ff4('0x26')][_0x25addb[_0x3ff4('0xc1')]][_0x3ff4('0xc4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['syncAgentComplete']=function(_0x2b92e3){var _0x379985=this['uniqueId'][_0x2b92e3[_0x3ff4('0xc1')]];if(this[_0x3ff4('0x20')][_0x2b92e3[_0x3ff4('0xc3')]]){if(_0x379985&&_0x379985[_0x3ff4('0x42')]!==_0x3ff4('0xc2')){delete this['uniqueId'][_0x2b92e3['uniqueid']];this[_0x3ff4('0x20')][_0x2b92e3[_0x3ff4('0xc3')]][_0x3ff4('0xc5')]+=0x1;var _0x42589b=new AgentComplete(_0x379985,_0x2b92e3);if(_0x2b92e3[_0x3ff4('0xc6')]===_0x3ff4('0xc7')){_0x42589b[_0x3ff4('0xc8')]=this[_0x3ff4('0x20')][_0x2b92e3[_0x3ff4('0xc3')]][_0x3ff4('0xc9')]&&this[_0x3ff4('0x20')][_0x2b92e3[_0x3ff4('0xc3')]][_0x3ff4('0xca')]?moment()['format'](_0x3ff4('0xcb')):undefined;}hopperUtils[_0x3ff4('0xcc')](_0x42589b)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x3ff4('0xcd')](_0x42589b)[_0x3ff4('0xa0')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype'][_0x3ff4('0x30')]=function(_0x2b8129){var _0x1baf25=this['uniqueId'][_0x2b8129['uniqueid']];var _0x24461e=this;var _0x33c0c5=![];var _0x39f8df;var _0x11f16f;if(this['voiceQueues'][_0x2b8129[_0x3ff4('0xc3')]]){if(_0x1baf25&&_0x1baf25[_0x3ff4('0x42')]!==_0x3ff4('0xc2')){delete this[_0x3ff4('0x26')][_0x2b8129[_0x3ff4('0xc1')]];this[_0x3ff4('0xce')](this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]]);_0x1baf25[_0x3ff4('0xcf')]=moment()['format'](_0x3ff4('0xcb'));var _0x2834d1=new QueueCallerAbandon(_0x1baf25,_0x2b8129);if(utils[_0x3ff4('0x64')](_0x1baf25[_0x3ff4('0xcf')],_0x1baf25[_0x3ff4('0xd0')])>=_0x1baf25[_0x3ff4('0xd1')]){this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xd2')]+=0x1;this['voiceQueues'][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xd3')]+=0x1;this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xd4')]+=0x1;_0x2834d1[_0x3ff4('0x74')]=0xa;_0x2834d1[_0x3ff4('0xd5')]=_0x3ff4('0xd6');_0x2834d1['dropreason']='TIMEOUT';_0x2834d1[_0x3ff4('0xc8')]=this['voiceQueues'][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xc9')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x2834d1[_0x3ff4('0xd7')]+=0x1;_0x2834d1[_0x3ff4('0xd8')]+=0x1;_0x39f8df=this['voiceQueues'][_0x2b8129['queue']][_0x3ff4('0xd9')];_0x11f16f=this['voiceQueues'][_0x2b8129['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x3ff4('0xda')](_0x2834d1,_0x2834d1['state'],_0x1baf25['voiceQueue'])['then'](function(_0x1a1f36){_0x33c0c5=_0x1a1f36[_0x3ff4('0xdb')]==0x1;if(_0x2834d1[_0x3ff4('0xd7')]>=_0x24461e[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xdc')]){_0x24461e[_0x3ff4('0xdd')](_0x2834d1,_0x1a1f36['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x2834d1['countdropretry'],'scheduledat':moment()[_0x3ff4('0xde')](_0x24461e['voiceQueues'][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xd9')],_0x3ff4('0xdf'))[_0x3ff4('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1baf25['ContactId'],'ListId':_0x1baf25[_0x3ff4('0xe0')],'VoiceQueueId':_0x1baf25[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x1baf25[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0xe3')));var _0x595115=new History(_0x2834d1);_0x595115[_0x3ff4('0x74')]=0xa;_0x595115[_0x3ff4('0xd5')]=_0x3ff4('0xd6');_0x595115['starttime']=moment()[_0x3ff4('0x80')](_0x3ff4('0xcb'));_0x595115[_0x3ff4('0x75')]=_0x595115['starttime'];_0x595115[_0x3ff4('0xe4')]=_0x2834d1[_0x3ff4('0xe4')];_0x595115[_0x3ff4('0xe5')]=_0x2834d1[_0x3ff4('0xe5')];hopperUtils['createHistory'](_0x595115)['catch'](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x3ff4('0x3f')](function(){if(_0x33c0c5)hopperUtils[_0x3ff4('0xe6')](_0x2834d1,_0x39f8df,_0x11f16f)[_0x3ff4('0x3f')](function(){return 0x1;});});}else{this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0x52')]+=0x1;this['voiceQueues'][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xe7')]+=0x1;_0x2834d1[_0x3ff4('0x74')]=0xb;_0x2834d1['statedesc']=_0x3ff4('0xe8');_0x2834d1['dropreason']=_0x3ff4('0xe9');_0x2834d1[_0x3ff4('0xea')]+=0x1;_0x2834d1[_0x3ff4('0xd8')]+=0x1;_0x39f8df=this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]][_0x3ff4('0xeb')];_0x11f16f=this[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x3ff4('0xda')](_0x2834d1,_0x2834d1[_0x3ff4('0x74')],_0x1baf25['voiceQueue'])[_0x3ff4('0x3f')](function(_0x516fa6){if(_0x2834d1[_0x3ff4('0xea')]>=_0x24461e[_0x3ff4('0x20')][_0x2b8129['queue']][_0x3ff4('0xec')]){_0x24461e[_0x3ff4('0xdd')](_0x2834d1,_0x516fa6[_0x3ff4('0xdb')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x2834d1[_0x3ff4('0xea')],'scheduledat':moment()[_0x3ff4('0xde')](_0x24461e[_0x3ff4('0x20')][_0x2b8129[_0x3ff4('0xc3')]]['dialAbandonedRetryFrequency'],_0x3ff4('0xdf'))[_0x3ff4('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1baf25[_0x3ff4('0xed')],'ListId':_0x1baf25[_0x3ff4('0xe0')],'VoiceQueueId':_0x1baf25['VoiceQueueId']||undefined,'CampaignId':_0x1baf25[_0x3ff4('0xe2')]||undefined})['catch'](loggerCatch(_0x3ff4('0xee')));var _0x1526da=new History(_0x2834d1);_0x1526da[_0x3ff4('0x74')]=0xb;_0x1526da[_0x3ff4('0xd5')]=_0x3ff4('0xe8');_0x1526da[_0x3ff4('0x76')]=moment()[_0x3ff4('0x80')](_0x3ff4('0xcb'));_0x1526da[_0x3ff4('0x75')]=_0x1526da['starttime'];_0x1526da['calleridname']=_0x2834d1[_0x3ff4('0xe4')];_0x1526da[_0x3ff4('0xe5')]=_0x2834d1[_0x3ff4('0xe5')];hopperUtils[_0x3ff4('0xcc')](_0x1526da)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0xef')));}})[_0x3ff4('0x3f')](function(){if(_0x33c0c5)hopperUtils[_0x3ff4('0xe6')](_0x2834d1,_0x39f8df,_0x11f16f)[_0x3ff4('0x3f')](function(){return 0x1;});});}}}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x38')]=function(_0x196272){if(this[_0x3ff4('0xf0')][_0x196272[_0x3ff4('0xc1')]]){this[_0x3ff4('0xf0')][_0x196272[_0x3ff4('0xc1')]][_0x3ff4('0xf1')]=_0x196272[_0x3ff4('0xf1')];}if(this[_0x3ff4('0x26')][_0x196272['uniqueid']]){this['uniqueId'][_0x196272[_0x3ff4('0xc1')]]['channel']=_0x196272[_0x3ff4('0xf1')];}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x3b')]=function(_0x452e7b){if(!this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]]){return;}var _0x1cf652=this['voiceQueues'][this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]][_0x3ff4('0xf3')]||_0x3ff4('0xf4');if(_0x1cf652===_0x3ff4('0xf5')){if(this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]]&&_['isNil'](this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]]['locked'])&&_0x452e7b[_0x3ff4('0x8d')]==='1'&&_0x452e7b[_0x3ff4('0xf6')]==='0'){if(this[_0x3ff4('0x22')][_0x452e7b[_0x3ff4('0xf7')]]){if(!this[_0x3ff4('0x22')][_0x452e7b[_0x3ff4('0xf7')]][_0x3ff4('0xf8')]){this[_0x3ff4('0x22')][_0x452e7b[_0x3ff4('0xf7')]]['locked']=!![];this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]][_0x3ff4('0xf8')]=!![];this[_0x3ff4('0xf0')][_0x452e7b['actionid']][_0x3ff4('0xf7')]=_0x452e7b['stateinterface'];}}}}else if(_0x1cf652===_0x3ff4('0xf4')){if(this['actions'][_0x452e7b[_0x3ff4('0xf2')]]){if(this[_0x3ff4('0x22')][_0x452e7b[_0x3ff4('0xf7')]]){this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]][_0x3ff4('0xf7')]=_0x452e7b['stateinterface'];if(_['isNil'](this[_0x3ff4('0xf9')][this[_0x3ff4('0xf0')][_0x452e7b['actionid']]['queue']])){this['queueBooked'][this['actions'][_0x452e7b[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]=[];}this[_0x3ff4('0xf9')][this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]['push'](_[_0x3ff4('0x63')](_[_0x3ff4('0xfa')](this[_0x3ff4('0xf0')][_0x452e7b[_0x3ff4('0xf2')]],[_0x3ff4('0xfb'),_0x3ff4('0xf7')]),{'status':_0x452e7b[_0x3ff4('0x8d')],'paused':_0x452e7b[_0x3ff4('0xf6')]}));}}}};Dialer['prototype'][_0x3ff4('0xfc')]=function(_0x31ef5e){if(!this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]]){return;}var _0x106a52=this;var _0x5ebbe1=this['voiceQueues'][this[_0x3ff4('0xf0')][_0x31ef5e['actionid']][_0x3ff4('0xc3')]];var _0x1d6a62=_0x5ebbe1[_0x3ff4('0xf3')]||_0x3ff4('0xf4');if(_0x1d6a62===_0x3ff4('0xf5')){if(this[_0x3ff4('0xf0')][_0x31ef5e['actionid']]&&this[_0x3ff4('0xf0')][_0x31ef5e['actionid']]['stateinterface']){this[_0x3ff4('0x1f')][_0x3ff4('0xfd')](this['actions'][_0x31ef5e['actionid']]['idHopper'],this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xf7')])[_0x3ff4('0xa0')](function(_0x5db389){logger[_0x3ff4('0x68')](_0x3ff4('0xfe'),util[_0x3ff4('0x45')](_0x5db389,{'showHidden':![],'depth':null}));})[_0x3ff4('0x1e')](function(){_0x106a52[_0x3ff4('0xce')](_0x106a52['voiceQueues'][_0x106a52[_0x3ff4('0xf0')][_0x31ef5e['actionid']][_0x3ff4('0xc3')]]);_0x106a52[_0x3ff4('0x22')][_0x106a52['actions'][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xf7')]][_0x3ff4('0xf8')]=![];delete _0x106a52[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]];unlockQueueStatus(_0x5ebbe1);});}else{this['updateOriginated'](this[_0x3ff4('0x20')][this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]]['queue']]);hopperUtils[_0x3ff4('0xff')]({'active':![],'ContactId':this['actions'][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xed')],'ListId':this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xe0')],'VoiceQueueId':this['actions'][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xe1')]||undefined,'CampaignId':this['actions'][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x100')));delete this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]];unlockQueueStatus(_0x5ebbe1);}}else if(_0x1d6a62===_0x3ff4('0xf4')){var _0x2d7257;if(this['actions'][_0x31ef5e[_0x3ff4('0xf2')]]&&!_['isEmpty'](this['queueBooked'][this['actions'][_0x31ef5e[_0x3ff4('0xf2')]]['queue']])){if(this['queueBookedRR'][_0x106a52[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]){this[_0x3ff4('0x2b')][_0x106a52[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]=this[_0x3ff4('0x2b')][this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]?this['queueBookedRR'][this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]][_0x3ff4('0xc3')]]:this['queueBooked'][this[_0x3ff4('0xf0')][_0x31ef5e['actionid']][_0x3ff4('0xc3')]]?this[_0x3ff4('0xf9')][this[_0x3ff4('0xf0')][_0x31ef5e[_0x3ff4('0xf2')]]['queue']][_0x3ff4('0x101')]||0x0:0x0;}this[_0x3ff4('0xf9')][this['actions'][_0x31ef5e['actionid']]['queue']][_0x3ff4('0x101')]=this[_0x3ff4('0x2b')][this['actions'][_0x31ef5e['actionid']][_0x3ff4('0xc3')]];for(var _0x17007b=0x0;_0x17007b=_0x16a144[_0x3ff4('0x12a')]){_0x555e62[_0x3ff4('0x12b')](_0x1690a6,_0xf2afd9,_0x3622d0,_0x3ff4('0x12c'));}else{if(_0x1690a6[_0x3ff4('0x124')]>=_0x16a144[_0x3ff4('0x12d')]){_0x555e62[_0x3ff4('0x12e')](_0x1690a6,_0xf2afd9,_0x3622d0,_0x3ff4('0x12f'));}else{hopperUtils[_0x3ff4('0xff')]({'active':![],'countmachineretry':_0x1690a6[_0x3ff4('0x124')],'scheduledat':moment()[_0x3ff4('0xde')](_0x16a144[_0x3ff4('0x130')],_0x3ff4('0xdf'))[_0x3ff4('0x80')](_0x3ff4('0xcb')),'ContactId':_0x1690a6[_0x3ff4('0xed')],'ListId':_0x1690a6[_0x3ff4('0xe0')],'VoiceQueueId':_0x1690a6[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x1690a6[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x131')));_0xf2afd9({'reschedule':0x1});}}});}if(_0xdaad8a[_0x3ff4('0x42')]==='ivr'&&this['campaigns'][_0xdaad8a[_0x3ff4('0xc3')]]['dialAMDActive']&&_0x506c97[_0x3ff4('0x11f')]==='HANGUP'){delete this['uniqueId'][_0x506c97[_0x3ff4('0xc1')]];this['updateOriginated'](this[_0x3ff4('0x21')][_0xdaad8a['queue']]);_0x18ffaa=new Hangup(_0xdaad8a,_0x506c97);_0x18ffaa['state']=0x12;_0x18ffaa[_0x3ff4('0xd5')]=_0x3ff4('0x117');_0x18ffaa[_0x3ff4('0x118')]=_0x3ff4('0x123');ami['emit']('custom:amd',ut[_0x3ff4('0x11a')](_0x18ffaa,_0x3ff4('0x11b')));this[_0x3ff4('0x11c')](_0x18ffaa,_0x3ff4('0x132'),_0x3ff4('0x133'));}if(_0xdaad8a[_0x3ff4('0x42')]===_0x3ff4('0xc2')&&this[_0x3ff4('0x21')][_0xdaad8a[_0x3ff4('0xc3')]][_0x3ff4('0x115')]&&_0x506c97[_0x3ff4('0x11f')]===_0x3ff4('0x120')){return new Promise(function(_0x3437aa,_0x205c9b){delete _0x555e62['uniqueId'][_0x506c97[_0x3ff4('0xc1')]];_0x555e62['updateOriginated'](_0x555e62[_0x3ff4('0x21')][_0xdaad8a[_0x3ff4('0xc3')]]);_0x555e62[_0x3ff4('0x21')][_0xdaad8a[_0x3ff4('0xc3')]][_0x3ff4('0xc5')]+=0x1;_0x555e62[_0x3ff4('0x21')][_0xdaad8a['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x6a31df=_0x555e62[_0x3ff4('0x21')][_0xdaad8a['queue']];var _0x55e812=new Hangup(_0xdaad8a,_0x506c97);_0x55e812['state']=0x13;_0x55e812['statedesc']=_0x3ff4('0x122');_0x55e812[_0x3ff4('0x118')]='AMD';_0x55e812[_0x3ff4('0x124')]+=0x1;_0x55e812[_0x3ff4('0xd8')]+=0x1;_0x55e812[_0x3ff4('0x11b')]=!![];ami[_0x3ff4('0x41')]('custom:amd',ut[_0x3ff4('0x11a')](_0x55e812,_0x3ff4('0x11b')));hopperUtils[_0x3ff4('0xcc')](_0x55e812)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x125')));if(_0x55e812[_0x3ff4('0x126')]+_0x55e812[_0x3ff4('0x127')]+_0x55e812[_0x3ff4('0x128')]+_0x55e812[_0x3ff4('0x134')]+_0x55e812['countdropretry']+_0x55e812['countabandonedretry']+_0x55e812[_0x3ff4('0x124')]+_0x55e812[_0x3ff4('0x129')]>=_0x6a31df[_0x3ff4('0x12a')]){_0x555e62[_0x3ff4('0x12b')](_0x55e812,_0x3437aa,_0x205c9b,_0x3ff4('0x12c'));}else{if(_0x55e812[_0x3ff4('0x124')]>=_0x6a31df['dialMachineMaxRetry']){_0x555e62[_0x3ff4('0x12e')](_0x55e812,_0x3437aa,_0x205c9b,'reason\x2019\x20machine....');}else{hopperUtils[_0x3ff4('0xff')]({'active':![],'countmachineretry':_0x55e812['countmachineretry'],'scheduledat':moment()[_0x3ff4('0xde')](_0x6a31df[_0x3ff4('0x130')],_0x3ff4('0xdf'))[_0x3ff4('0x80')](_0x3ff4('0xcb')),'ContactId':_0x55e812[_0x3ff4('0xed')],'ListId':_0x55e812['ListId'],'VoiceQueueId':_0x55e812['VoiceQueueId']||undefined,'CampaignId':_0x55e812[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x131')));_0x3437aa({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x3e8c33){var _0x4893f4=this[_0x3ff4('0x26')][_0x3e8c33[_0x3ff4('0xc1')]];var _0x1b8ecb;if(_0x4893f4&&_0x4893f4[_0x3ff4('0x42')]===_0x3ff4('0xc2')){delete this[_0x3ff4('0x26')][_0x3e8c33[_0x3ff4('0xc1')]];this['updateOriginated'](this[_0x3ff4('0x21')][_0x4893f4[_0x3ff4('0xc3')]]);this[_0x3ff4('0x21')][_0x4893f4[_0x3ff4('0xc3')]][_0x3ff4('0x135')]+=0x1;_0x1b8ecb=new Hangup(_0x4893f4,_0x3e8c33);hopperUtils['createHistory'](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x136')));hopperUtils[_0x3ff4('0xcd')](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x137')));}if(_0x4893f4&&_0x4893f4[_0x3ff4('0x42')]!=='ivr'&&isNotNull(this[_0x3ff4('0x20')][_0x4893f4[_0x3ff4('0xc3')]][_0x3ff4('0x138')])){delete this['uniqueId'][_0x3e8c33[_0x3ff4('0xc1')]];this[_0x3ff4('0xce')](this[_0x3ff4('0x20')][_0x4893f4['queue']]);this[_0x3ff4('0x20')][_0x4893f4[_0x3ff4('0xc3')]]['outboundAnswerCallsDay']+=0x1;this[_0x3ff4('0x20')][_0x4893f4['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x1b8ecb=new Hangup(_0x4893f4,_0x3e8c33);_0x1b8ecb[_0x3ff4('0x74')]=0x10;_0x1b8ecb['statedesc']='AnswerAGI';_0x1b8ecb[_0x3ff4('0x118')]=_0x3ff4('0x139');hopperUtils['createHistory'](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x136')));hopperUtils[_0x3ff4('0xcd')](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x137')));}if(_0x4893f4&&_0x4893f4[_0x3ff4('0x42')]!==_0x3ff4('0xc2')&&!isNotNull(this[_0x3ff4('0x20')][_0x4893f4['queue']]['dialQueueProject'])){if(_0x3e8c33['cause-txt']===_0x3ff4('0x13a')){delete this[_0x3ff4('0x26')][_0x3e8c33[_0x3ff4('0xc1')]];this[_0x3ff4('0x20')][_0x4893f4['queue']][_0x3ff4('0xc5')]+=0x1;const _0x9bbcbc=new AgentComplete(_0x4893f4,_0x3e8c33);_0x9bbcbc['CampaignId']=this[_0x3ff4('0x20')][_0x4893f4['queue']]['id'];hopperUtils[_0x3ff4('0xcc')](_0x9bbcbc)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x13b')));hopperUtils['moveContactManagedDialer'](_0x9bbcbc)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x13c')));}else{delete this[_0x3ff4('0x26')][_0x3e8c33['uniqueid']];this[_0x3ff4('0xce')](this['voiceQueues'][_0x4893f4[_0x3ff4('0xc3')]]);this[_0x3ff4('0x20')][_0x4893f4[_0x3ff4('0xc3')]][_0x3ff4('0x13d')]+=0x1;_0x1b8ecb=new Hangup(_0x4893f4,_0x3e8c33);_0x1b8ecb[_0x3ff4('0x74')]=0xc;_0x1b8ecb['statedesc']=_0x3e8c33[_0x3ff4('0x13e')];_0x1b8ecb[_0x3ff4('0x118')]='Unknow';hopperUtils[_0x3ff4('0xcc')](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x136')));hopperUtils[_0x3ff4('0xcd')](_0x1b8ecb)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x137')));}}};Dialer['prototype'][_0x3ff4('0xc')]=function(_0x1b339c){var _0x4cb5cb=this;if(!_0x4cb5cb[_0x3ff4('0x2c')][_0x1b339c[_0x3ff4('0x47')]]){_0x4cb5cb[_0x3ff4('0x2c')][_0x1b339c[_0x3ff4('0x47')]]={'running':![]};}else if(_0x4cb5cb['queuesSummary'][_0x1b339c[_0x3ff4('0x47')]][_0x3ff4('0x13f')]===!![]){return;}else if(_0x4cb5cb[_0x3ff4('0x2c')][_0x1b339c['name']][_0x3ff4('0x13f')]===![]){_0x4cb5cb['queuesSummary'][_0x1b339c[_0x3ff4('0x47')]]['running']=!![];}var _0x3e32f4=_0x4cb5cb[_0x3ff4('0x20')][_0x1b339c[_0x3ff4('0x47')]];var _0x12d9cc=_0x3e32f4[_0x3ff4('0x6d')]!==utils[_0x3ff4('0x6e')][_0x3ff4('0x7d')];var _0x3728eb=utils[_0x3ff4('0x140')](_0x3e32f4);_0x3e32f4[_0x3ff4('0x141')]=utils[_0x3ff4('0x142')](_0x3e32f4,_0x4cb5cb[_0x3ff4('0x23')]);Promise['resolve']()[_0x3ff4('0x3f')](function(){if(_0x3e32f4[_0x3ff4('0x141')]===utils['CAMPAIGN_STATUS'][_0x3ff4('0x7d')]){if(_0x12d9cc){clearPredictiveAttributes(_0x3e32f4);_0x1b339c['startPredictive']=undefined;_0x1b339c[_0x3ff4('0x29')]=undefined;}if(_0x3e32f4[_0x3ff4('0x141')]===utils[_0x3ff4('0x6e')]['INACTIVE']){_0x1b339c['available']=0x0;_0x1b339c['paused']=0x0;_0x1b339c[_0x3ff4('0x143')]=0x0;_0x1b339c[_0x3ff4('0x144')]=0x0;_0x1b339c[_0x3ff4('0x145')]=0x0;}}else if(_0x3e32f4[_0x3ff4('0x141')]===utils[_0x3ff4('0x6e')]['ACTIVE']&&!_0x3728eb){return _0x4cb5cb[_0x3ff4('0x96')](_0x3e32f4,!![])['then'](function(){return _0x4cb5cb[_0x3ff4('0x96')](_0x3e32f4,![]);})['then'](function(){return _0x4cb5cb['checkDialMethod'](_0x3e32f4);})[_0x3ff4('0xa0')](function(_0x120953){loggerSyncQueueSummary[_0x3ff4('0x43')](_0x3ff4('0x146'),util[_0x3ff4('0x45')](_0x120953,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3e32f4);});}else{clearPredictiveAttributes(_0x3e32f4);}})[_0x3ff4('0x3f')](function(){var _0x1dc4d8=_0x1b339c['compareToOutboundQueue'](_0x3e32f4);if(_0x1dc4d8||_0x3e32f4['queueSummaryCountersUpdated']){_0x3e32f4[_0x3ff4('0x147')]=![];_0x1b339c['updateReportFromOutboundQueue'](_0x3e32f4);Object[_0x3ff4('0x148')](_0x3e32f4,_0x1b339c);emitOutboundVoiceQueueSummary(_0x1b339c);}_0x4cb5cb[_0x3ff4('0x2c')][_0x3e32f4[_0x3ff4('0x47')]]['running']=![];})[_0x3ff4('0xa0')](function(_0x171c98){logger[_0x3ff4('0x68')](_0x3ff4('0x146'),util['inspect'](_0x171c98,{'showHidden':![],'depth':null}));_0x4cb5cb[_0x3ff4('0x2c')][_0x3e32f4[_0x3ff4('0x47')]][_0x3ff4('0x13f')]=![];});};Dialer[_0x3ff4('0x89')]['syncQueueSummaryComplete']=_[_0x3ff4('0x149')](function(){var _0x512405=_[_0x3ff4('0x14a')](this['voiceQueues'],function(_0x3be8da){return _0x3be8da[_0x3ff4('0x14b')];});var _0x33c400=_[_0x3ff4('0x14a')](this[_0x3ff4('0x22')],function(_0xf4226d){return _0xf4226d[_0x3ff4('0x14c')]&&_0xf4226d[_0x3ff4('0x8d')]==='reachable';});if(_0x512405[_0x3ff4('0x9c')]>0x0&&_0x33c400[_0x3ff4('0x9c')]>0x0){return Promise[_0x3ff4('0xad')]()[_0x3ff4('0x3f')](cmHopper[_0x3ff4('0x14d')](_[_0x3ff4('0x14e')](_0x512405,'id'),previewRecallmeReminderInterval,_[_0x3ff4('0x14e')](_0x33c400,'id')))['then'](function(_0x36b772){for(var _0x11689a=0x0;_0x11689a<_0x36b772[_0x3ff4('0x9c')];_0x11689a++){var _0x3ca831=_0x36b772[_0x11689a][_0x3ff4('0x14f')][_0x3ff4('0x47')];if(_0x3ca831)io['to'](util['format']('user:%s',_0x3ca831))['emit'](_0x3ff4('0x150'),{'hopper':_0x36b772[_0x11689a]});}})['catch'](function(_0x5cd5ee){logger[_0x3ff4('0x68')]('checkPreviewRecallReminder',_0x5cd5ee);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3ff4('0x89')][_0x3ff4('0x151')]=function(){var _0x22c1b6=this;setInterval(function(){_0x22c1b6[_0x3ff4('0x152')](_0x22c1b6[_0x3ff4('0x26')],_0x3ff4('0x153'));_0x22c1b6[_0x3ff4('0x152')](_0x22c1b6['actions'],_0x3ff4('0x154'));},0x32c8);};Dialer[_0x3ff4('0x89')][_0x3ff4('0x152')]=function(_0xecd0d0,_0x499b47){var _0x1f5ce6=this;for(var _0x3da5ce in _0xecd0d0){if(typeof _0xecd0d0[_0x3da5ce]!==_0x3ff4('0xab')){this[_0x3ff4('0x155')][_0x3ff4('0x1c')](function(){if(!_[_0x3ff4('0x106')](_0xecd0d0[_0x3da5ce])){return ami['Action']({'action':_0x3ff4('0x8d'),'channel':_0xecd0d0[_0x3da5ce][_0x3ff4('0xf1')]})['catch'](function(_0xff9515){if(_0xff9515[_0x3ff4('0x6d')]===_0x3ff4('0x156')){setTimeout(function(){if(_0xecd0d0[_0x3da5ce]&&_0xecd0d0[_0x3da5ce][_0x3ff4('0x42')]!==_0x3ff4('0xc2')){_0x1f5ce6[_0x3ff4('0xce')](_0x1f5ce6[_0x3ff4('0x20')][_0xecd0d0[_0x3da5ce][_0x3ff4('0xc3')]]);logger[_0x3ff4('0x68')](_0x3ff4('0x157'),_0x499b47,_0x3da5ce,_0xecd0d0[_0x3da5ce][_0x3ff4('0xc3')]);delete _0xecd0d0[_0x3da5ce];}if(_0xecd0d0[_0x3da5ce]&&_0xecd0d0[_0x3da5ce]['type']===_0x3ff4('0xc2')){_0x1f5ce6[_0x3ff4('0xce')](_0x1f5ce6[_0x3ff4('0x21')][_0xecd0d0[_0x3da5ce]['queue']]);logger[_0x3ff4('0x68')](_0x3ff4('0x158'),_0x499b47,_0x3da5ce,_0xecd0d0[_0x3da5ce][_0x3ff4('0xc3')]);delete _0xecd0d0[_0x3da5ce];}},0x2328);}});}});}}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x159')]=function(_0x51e3b9){return Promise[_0x3ff4('0xad')]()['then'](voiceQueueRt[_0x3ff4('0x159')](_0x51e3b9))[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x15a')));};Dialer['prototype'][_0x3ff4('0xce')]=function(_0x19bc8a){if(!_[_0x3ff4('0x58')](_0x19bc8a)&&_0x19bc8a!==null){if(typeof _0x19bc8a[_0x3ff4('0x15b')]!=='undefined'){if(_0x19bc8a[_0x3ff4('0x15b')]>0x0){_0x19bc8a['originated']-=0x1;}else{logger[_0x3ff4('0x68')](_0x3ff4('0x15c'));}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x15d')]=function(_0x59580d,_0x457899){var _0x50ddba=this;return function(_0x46e7e3){_0x50ddba['updateOriginated'](_0x457899);logger[_0x3ff4('0x68')](_0x59580d,util['inspect'](_0x46e7e3,{'showHidden':![],'depth':null}));};};Dialer[_0x3ff4('0x89')][_0x3ff4('0x15e')]=function(_0x472ee0,_0x3ac453,_0x56faf0){var _0x8cba45={'state':0x19,'statedesc':_0x3ff4('0x15f')};this[_0x3ff4('0xce')](_0x3ac453);this['saveInDb'](_[_0x3ff4('0x63')](_0x8cba45,_[_0x3ff4('0xfa')](_0x56faf0,['ContactId',_0x3ff4('0xe0'),'UserId',_0x3ff4('0xe1'),_0x3ff4('0xe2')])),_0x3ff4('0x160'),_0x3ff4('0x161'));logger[_0x3ff4('0x68')](_0x472ee0);};Dialer[_0x3ff4('0x89')][_0x3ff4('0x11c')]=function(_0x161bc9,_0x395e36,_0x15d5c1){hopperUtils[_0x3ff4('0xcc')](_0x161bc9)[_0x3ff4('0xa0')](loggerCatch(_0x395e36));hopperUtils[_0x3ff4('0xcd')](_0x161bc9)[_0x3ff4('0xa0')](loggerCatch(_0x15d5c1));};Dialer[_0x3ff4('0x89')][_0x3ff4('0xdd')]=function(_0x196ea9,_0xda50a2){hopperUtils[_0x3ff4('0xcc')](_0x196ea9)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x13b')));if(_0xda50a2==0x0){hopperUtils[_0x3ff4('0xcd')](_0x196ea9)[_0x3ff4('0xa0')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x162')]=function(_0x1cd2a6){return Promise[_0x3ff4('0xad')]()[_0x3ff4('0x3f')](cmHopper['handlePreviewRecallNotifications'](_0x1cd2a6['id'],previewRecallmeReminderInterval))[_0x3ff4('0x3f')](function(_0x3b617c){for(var _0x46a4d9=0x0;_0x46a4d9<_0x3b617c[_0x3ff4('0x9c')];_0x46a4d9++){var _0x4ed9a9=_0x3b617c[_0x46a4d9]['Agent'][_0x3ff4('0x47')];if(_0x4ed9a9)io['to'](util[_0x3ff4('0x80')]('user:%s',_0x4ed9a9))[_0x3ff4('0x41')](_0x3ff4('0x150'),{'hopper':_0x3b617c[_0x46a4d9]});}})['catch'](function(){});};Dialer['prototype'][_0x3ff4('0xb0')]=function(_0xdde77b){var _0x2fffa9=this;return function(){_0x2fffa9[_0x3ff4('0x163')](_0xdde77b);};};Dialer['prototype']['actionOriginate']=function(_0x56fd82,_0x255526){var _0x1731b5=this;var _0x52fb8f=uuid['v4']();this[_0x3ff4('0xf0')][_0x52fb8f]=new Action(_0x56fd82,_0x255526,_0x52fb8f);return new Promise(function(_0x50fe61,_0x1e3f52){if(_[_0x3ff4('0x58')](_0x56fd82)&&typeof _0x56fd82!=='object'){return _0x1e3f52(msgResponse('originate',_0x3ff4('0x97'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3ff4('0x58')](_0x255526[_0x3ff4('0x164')])||_0x255526[_0x3ff4('0x164')]===null){return _0x1e3f52(msgResponse(_0x3ff4('0x165'),_0x3ff4('0x97'),_0x3ff4('0x166')));}var _0x3e49aa={'XMD-CALLERID':_0x1731b5[_0x3ff4('0xf0')][_0x52fb8f]['getCaller'](),'XMD-AGI':_0x56fd82[_0x3ff4('0x138')]?util['format'](_0x3ff4('0x167'),ipAgi,_0x56fd82['dialQueueProject']):_0x3ff4('0x168'),'XMD-AGIAFTER':_0x56fd82[_0x3ff4('0xc9')]?util[_0x3ff4('0x80')](_0x3ff4('0x167'),ipAgi,_0x56fd82[_0x3ff4('0xc9')]):_0x3ff4('0x168'),'XMD-QUEUE':utils['isOutboundQueue'](_0x56fd82)?util['format']('\x22%s,%s%s,,,%s\x22',_0x56fd82[_0x3ff4('0x47')],_0x56fd82[_0x3ff4('0x169')]||'',_0x56fd82[_0x3ff4('0xca')]?'c':'',_0x56fd82[_0x3ff4('0xd1')]||0x3):'NONE','XMD-CONTACTID':_0x255526[_0x3ff4('0xed')],'XMD-CDRTYPE':_0x3ff4('0x8'),'CALLERID(all)':_0x1731b5['actions'][_0x52fb8f][_0x3ff4('0x16a')](),'XMD-AMD':_0x56fd82[_0x3ff4('0x115')]?_0x3ff4('0x16b'):'NONE','XMD-DESTINATION':_0x3ff4('0x114')};if(_0x56fd82[_0x3ff4('0x115')]){_0x3e49aa[_0x3ff4('0x16c')]=_0x56fd82[_0x3ff4('0x16d')]||0x9c4;_0x3e49aa[_0x3ff4('0x16e')]=_0x56fd82['dialAMDGreeting']||0x5dc;_0x3e49aa[_0x3ff4('0x16f')]=_0x56fd82[_0x3ff4('0x170')]||0x320;_0x3e49aa[_0x3ff4('0x171')]=_0x56fd82[_0x3ff4('0x172')]||0x1388;_0x3e49aa[_0x3ff4('0x173')]=_0x56fd82['dialAMDMinWordLength']||0x64;_0x3e49aa[_0x3ff4('0x174')]=_0x56fd82[_0x3ff4('0x175')]||0x32;_0x3e49aa[_0x3ff4('0x176')]=_0x56fd82[_0x3ff4('0x177')]||0x3;_0x3e49aa['XMD-AMDSILENCETHRESHOLD']=_0x56fd82[_0x3ff4('0x178')]||0x100;_0x3e49aa['XMD-AMDMAXIMUMWORDLENGTH']=_0x56fd82[_0x3ff4('0x179')]||0x1388;}if(utils[_0x3ff4('0x17a')](_0x56fd82)){_0x3e49aa[_0x3ff4('0x17b')]=_0x255526['VoiceQueueId'];}else{_0x3e49aa[_0x3ff4('0x17c')]=_0x255526['CampaignId'];}var _0x1520e0=utils['setXMDContactVariables'](_0x255526[_0x3ff4('0x17d')]);Object[_0x3ff4('0x148')](_0x3e49aa,_0x1520e0);var _0x15f561=_0x1731b5['isTrunkReachable'](_0x56fd82[_0x3ff4('0x17e')])?utils[_0x3ff4('0x17f')](_0x56fd82['Trunk'][_0x3ff4('0x180')],_0x56fd82['dialOriginateCallerIdName'],_0x56fd82['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x56fd82[_0x3ff4('0x181')],_0x56fd82['dialRandomLastDigitCallerIdNumber']):_0x56fd82['dialOriginateCallerIdNumber']):utils[_0x3ff4('0x17f')](_[_0x3ff4('0x106')](_0x56fd82['TrunkBackup'])?_0x56fd82[_0x3ff4('0x17e')][_0x3ff4('0x180')]:_0x56fd82[_0x3ff4('0x90')][_0x3ff4('0x180')],_0x56fd82[_0x3ff4('0x182')],_0x56fd82[_0x3ff4('0x183')]>0x0?utils['getCallerIdRandom'](_0x56fd82[_0x3ff4('0x181')],_0x56fd82['dialRandomLastDigitCallerIdNumber']):_0x56fd82[_0x3ff4('0x181')]);if(_0x15f561){_0x3e49aa[_0x3ff4('0x184')]=_0x1731b5['actions'][_0x52fb8f][_0x3ff4('0x185')]=utils['extractCalleridName'](_0x15f561);_0x3e49aa[_0x3ff4('0x186')]=_0x255526[_0x3ff4('0x164')];}_0x56fd82[_0x3ff4('0x187')]=_0x3e49aa;return ami[_0x3ff4('0x9d')]({'actionid':_0x52fb8f,'action':_0x3ff4('0x165'),'channel':_0x1731b5[_0x3ff4('0x8f')](_0x56fd82['Trunk'])?util['format'](_0x3ff4('0x188'),_0x56fd82[_0x3ff4('0x17e')][_0x3ff4('0x47')],isNotNull(_0x56fd82['dialPrefix'])?_0x56fd82[_0x3ff4('0x189')]['trim']()||'':'',_0x56fd82[_0x3ff4('0x18a')]>0x0?_0x255526[_0x3ff4('0x164')][_0x3ff4('0x18b')](_0x56fd82['dialCutDigit']):_0x255526[_0x3ff4('0x164')]):util[_0x3ff4('0x80')]('SIP/%s/%s%s',_[_0x3ff4('0x106')](_0x56fd82[_0x3ff4('0x90')])?_0x56fd82[_0x3ff4('0x17e')]['name']:_0x56fd82['TrunkBackup'][_0x3ff4('0x47')],isNotNull(_0x56fd82[_0x3ff4('0x189')])?_0x56fd82[_0x3ff4('0x189')][_0x3ff4('0x18c')]()||'':'',_0x56fd82[_0x3ff4('0x18a')]>0x0?_0x255526[_0x3ff4('0x164')][_0x3ff4('0x18b')](_0x56fd82[_0x3ff4('0x18a')]):_0x255526['phone']),'callerid':_0x15f561,'Exten':_0x3ff4('0x114'),'Context':_0x3ff4('0x18d'),'Priority':'1','variable':_0x3e49aa,'timeout':(_0x56fd82[_0x3ff4('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x52fb8f})['then'](function(_0x298285){return _0x50fe61(_0x298285);})[_0x3ff4('0xa0')](function(_0x9719f){_0x56fd82[_0x3ff4('0x18f')]+=0x1;var _0x1c41d8=new History(_0x1731b5[_0x3ff4('0xf0')][_0x52fb8f]);logger[_0x3ff4('0x68')](util[_0x3ff4('0x80')](_0x3ff4('0x190'),JSON[_0x3ff4('0x79')](_0x9719f)));_0x1c41d8[_0x3ff4('0x74')]=0xe;_0x1c41d8[_0x3ff4('0xd5')]=_0x3ff4('0x191');_0x1c41d8['starttime']=moment()['format'](_0x3ff4('0xcb'));_0x1c41d8[_0x3ff4('0x75')]=_0x1c41d8[_0x3ff4('0x76')];hopperUtils[_0x3ff4('0xcc')](_0x1c41d8)[_0x3ff4('0xa0')](loggerCatch('[originate][error]'));_0x1731b5[_0x3ff4('0xcd')](_0x1c41d8)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x192')))[_0x3ff4('0x1e')](function(){delete _0x1731b5[_0x3ff4('0xf0')][_0x52fb8f];return _0x1e3f52(msgResponse(_0x3ff4('0x165'),'Error',_0x3ff4('0x193')));});});});};Dialer['prototype'][_0x3ff4('0x194')]=function(_0x2f5667,_0x1c61b9,_0x33ab7d){var _0x12be34=new History(_0x1c61b9);if(_0x12be34[_0x3ff4('0x126')]+_0x12be34[_0x3ff4('0x127')]+_0x12be34['countnoanswerretry']+_0x12be34[_0x3ff4('0x134')]+_0x12be34[_0x3ff4('0xd7')]+_0x12be34[_0x3ff4('0xea')]+_0x12be34['countmachineretry']+_0x12be34[_0x3ff4('0x129')]>=_0x33ab7d[_0x3ff4('0x12a')]-0x1){return!![];}switch(_0x2f5667){case 0x3:if(_0x12be34[_0x3ff4('0x128')]>=_0x33ab7d[_0x3ff4('0x195')]-0x1){return!![];}hopperUtils[_0x3ff4('0xff')]({'active':![],'countnoanswerretry':_0x12be34[_0x3ff4('0x128')]+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0x196')],_0x3ff4('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x12be34['countbusyretry']>=_0x33ab7d[_0x3ff4('0x197')]-0x1){return!![];}hopperUtils[_0x3ff4('0xff')]({'active':![],'countbusyretry':_0x12be34['countbusyretry']+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0x198')],_0x3ff4('0xdf'))[_0x3ff4('0x80')](_0x3ff4('0xcb')),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34['ListId'],'VoiceQueueId':_0x12be34[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x199')));break;case 0x8:if(_0x12be34['countcongestionretry']>=_0x33ab7d[_0x3ff4('0x19a')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x12be34[_0x3ff4('0x127')]+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0x19b')],'minutes')[_0x3ff4('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x19c')));break;case 0x0:if(_0x12be34['countnosuchnumberretry']>=_0x33ab7d['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0x3ff4('0xff')]({'active':![],'countnosuchnumberretry':_0x12be34[_0x3ff4('0x134')]+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d['dialNoSuchNumberRetryFrequency'],_0x3ff4('0xdf'))[_0x3ff4('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x19d')));}break;case 0xa:if(_0x12be34['countdropretry']>=_0x33ab7d[_0x3ff4('0xdc')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x12be34['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x33ab7d['dialDropRetryFrequency'],_0x3ff4('0xdf'))[_0x3ff4('0x80')](_0x3ff4('0xcb')),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34['VoiceQueueId']||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0xe3')));break;case 0xb:if(_0x12be34[_0x3ff4('0xea')]>=_0x33ab7d[_0x3ff4('0xec')]-0x1){return!![];}hopperUtils[_0x3ff4('0xff')]({'active':![],'countabandonedretry':_0x12be34[_0x3ff4('0xea')]+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0xeb')],_0x3ff4('0xdf'))[_0x3ff4('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x12be34['ContactId'],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x12be34[_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x12be34[_0x3ff4('0x124')]>=_0x33ab7d['dialMachineMaxRetry']-0x1){return!![];}hopperUtils[_0x3ff4('0xff')]({'active':![],'countmachineretry':_0x12be34['countmachineretry']+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0x130')],_0x3ff4('0xdf'))['format'](_0x3ff4('0xcb')),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34['VoiceQueueId']||undefined,'CampaignId':_0x12be34['CampaignId']||undefined})[_0x3ff4('0xa0')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x12be34[_0x3ff4('0x129')]>=_0x33ab7d[_0x3ff4('0x19e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x12be34[_0x3ff4('0x129')]+=0x1,'scheduledat':moment()[_0x3ff4('0xde')](_0x33ab7d[_0x3ff4('0x19f')],'minutes')[_0x3ff4('0x80')](_0x3ff4('0xcb')),'ContactId':_0x12be34[_0x3ff4('0xed')],'ListId':_0x12be34[_0x3ff4('0xe0')],'VoiceQueueId':_0x12be34['VoiceQueueId']||undefined,'CampaignId':_0x12be34['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x3ff4('0x10f')]=function(_0x48b122,_0x4feb37,_0x26a4d7){var _0x3c20f5=this;var _0xf82335=new History(_0x48b122);var _0x278c8b=![];var _0x34125b;var _0x3151c5;return new Promise(function(_0x4005cc,_0x165f6a){if(_[_0x3ff4('0x58')](_0x4feb37)&&typeof _0x4feb37!==_0x3ff4('0x1a0')){return _0x165f6a(msgResponse(_0x3ff4('0x1a1'),'Failure',_0x3ff4('0x1a2')));}if(_[_0x3ff4('0x58')](_0x26a4d7)&&typeof _0x26a4d7!==_0x3ff4('0x1a0')){return _0x165f6a(msgResponse('[callProgressDetecting]',_0x3ff4('0x97'),_0x3ff4('0x1a3')));}hopperUtils[_0x3ff4('0xda')](_0xf82335,_0x26a4d7['reason'],_0x4feb37)[_0x3ff4('0x3f')](function(_0x450bd4){if(_0x450bd4[_0x3ff4('0xdb')]==0x1)_0x278c8b=!![];switch(_0x26a4d7[_0x3ff4('0xc6')]){case'0':_0x4feb37[_0x3ff4('0x1a4')]+=0x1;_0xf82335[_0x3ff4('0x74')]=0x0;_0xf82335[_0x3ff4('0xd5')]=_0x3ff4('0x1a5');_0xf82335[_0x3ff4('0x134')]+=0x1;_0xf82335[_0x3ff4('0xd8')]+=0x1;ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x48b122,_0x3ff4('0x1a6')));_0x34125b=_0x4feb37[_0x3ff4('0x1a7')];_0x3151c5=_0x4feb37['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xf82335)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x125')));if(_0x3c20f5[_0x3ff4('0x194')](0x0,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335['countnosuchnumberretry']>=_0x4feb37[_0x3ff4('0x1a8')]){_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1a9'));}else{_0x3c20f5['stateGlobal'](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1a9'));}}break;case'3':_0x4feb37['outboundNoAnswerCallsDay']+=0x1;_0xf82335[_0x3ff4('0x74')]=0x3;_0xf82335[_0x3ff4('0xd5')]=_0x3ff4('0x1aa');_0xf82335['countnoanswerretry']+=0x1;_0xf82335['countglobal']+=0x1;var _0x29aa30=ut[_0x3ff4('0x1ab')](_0x48b122,_0x4feb37);ami[_0x3ff4('0x41')](_0x3ff4('0x1ac'),_0x29aa30);_0x34125b=_0x4feb37['dialNoAnswerRetryFrequency'];_0x3151c5=_0x4feb37[_0x3ff4('0x1ad')];hopperUtils[_0x3ff4('0xcc')](_0xf82335)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x1ae')));if(_0x3c20f5[_0x3ff4('0x194')](0x3,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335['countnoanswerretry']>=_0x4feb37[_0x3ff4('0x195')]){_0x3c20f5['createStateFinal'](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1af'));}else{_0x3c20f5[_0x3ff4('0x12b')](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1af'));}}break;case'5':_0x4feb37[_0x3ff4('0x1b0')]+=0x1;_0xf82335[_0x3ff4('0x74')]=0x5;_0xf82335[_0x3ff4('0xd5')]=_0x3ff4('0x1b1');_0xf82335[_0x3ff4('0x126')]+=0x1;_0xf82335[_0x3ff4('0xd8')]+=0x1;ami[_0x3ff4('0x41')]('custom:agentbusy',ut[_0x3ff4('0x11a')](_0x48b122,_0x3ff4('0x1b2')));_0x34125b=_0x4feb37[_0x3ff4('0x198')];_0x3151c5=_0x4feb37[_0x3ff4('0x1ad')];hopperUtils['createHistory'](_0xf82335)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x1b3')));if(_0x3c20f5[_0x3ff4('0x194')](0x5,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335[_0x3ff4('0x126')]>=_0x4feb37['dialBusyMaxRetry']){_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,'reason\x205\x20busy');}else{_0x3c20f5[_0x3ff4('0x12b')](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1b4'));}}break;case'8':_0x4feb37[_0x3ff4('0x1b5')]+=0x1;_0xf82335[_0x3ff4('0x74')]=0x8;_0xf82335[_0x3ff4('0xd5')]=_0x3ff4('0x1b6');_0xf82335[_0x3ff4('0x127')]+=0x1;_0xf82335['countglobal']+=0x1;_0x34125b=_0x4feb37[_0x3ff4('0x19b')];_0x3151c5=_0x4feb37[_0x3ff4('0x1ad')];ami['emit'](_0x3ff4('0x1b7'),ut[_0x3ff4('0x11a')](_0x48b122,_0x3ff4('0x1b8')));hopperUtils['createHistory'](_0xf82335)[_0x3ff4('0xa0')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x3c20f5['checkRetriveMax'](0x8,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335[_0x3ff4('0x127')]>=_0x4feb37[_0x3ff4('0x19a')]){_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1b9'));}else{_0x3c20f5['stateGlobal'](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1b9'));}}break;case'11':_0x4feb37[_0x3ff4('0x1ba')]+=0x1;_0xf82335['state']=0xb;_0xf82335[_0x3ff4('0xd5')]='Abandoned';_0xf82335[_0x3ff4('0xea')]+=0x1;_0xf82335['countglobal']+=0x1;_0x34125b=_0x4feb37[_0x3ff4('0xeb')];_0x3151c5=_0x4feb37['callAdditionalPhoneAfterMin'];hopperUtils[_0x3ff4('0xcc')](_0xf82335)[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0xef')));if(_0x3c20f5[_0x3ff4('0x194')](0xb,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335['countabandonedretry']>=_0x4feb37[_0x3ff4('0xec')]){_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,_0x3ff4('0x1bb'));}else{_0x3c20f5[_0x3ff4('0x12b')](_0xf82335,_0x4005cc,_0x165f6a,'reason\x2011\x20abandoned');}}break;case'20':_0x4feb37[_0x3ff4('0x1bc')]+=0x1;_0xf82335[_0x3ff4('0x74')]=0x14;_0xf82335[_0x3ff4('0xd5')]=_0x3ff4('0x1bd');_0xf82335[_0x3ff4('0x129')]+=0x1;_0xf82335[_0x3ff4('0xd8')]+=0x1;_0x34125b=_0x4feb37[_0x3ff4('0x19f')];_0x3151c5=_0x4feb37[_0x3ff4('0x1ad')];ami['emit'](_0x3ff4('0x1be'),ut[_0x3ff4('0x11a')](_0x48b122,_0x3ff4('0x1bf')));hopperUtils[_0x3ff4('0xcc')](_0xf82335)['catch'](loggerCatch(_0x3ff4('0x1c0')));if(_0x3c20f5[_0x3ff4('0x194')](0x14,_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335[_0x3ff4('0x129')]>=_0x4feb37[_0x3ff4('0x19e')]){_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,'reason\x2020\x20agentreject');}else{_0x3c20f5[_0x3ff4('0x12b')](_0xf82335,_0x4005cc,_0x165f6a,'reason\x2020\x20agentreject');}}break;default:_0x4feb37[_0x3ff4('0x13d')]+=0x1;_0xf82335[_0x3ff4('0x74')]=0xc;_0xf82335[_0x3ff4('0xd5')]=_0x26a4d7[_0x3ff4('0xc6')];_0x34125b=_0x4feb37[_0x3ff4('0x19f')];_0x3151c5=_0x4feb37['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0xf82335)['catch'](loggerCatch(_0x3ff4('0x1c1')));if(_0x3c20f5['checkRetriveMax'](_0x26a4d7[_0x3ff4('0xc6')],_0x48b122,_0x4feb37)&&!_0x278c8b){if(_0xf82335['countbusyretry']+_0xf82335[_0x3ff4('0x127')]+_0xf82335[_0x3ff4('0x128')]+_0xf82335[_0x3ff4('0x134')]+_0xf82335[_0x3ff4('0xd7')]+_0xf82335['countabandonedretry']+_0xf82335[_0x3ff4('0x124')]+_0xf82335[_0x3ff4('0x129')]>=_0x4feb37[_0x3ff4('0x12a')]){_0x3c20f5[_0x3ff4('0x12b')](_0xf82335,_0x4005cc,_0x165f6a,_0x26a4d7[_0x3ff4('0xc6')]);}else{_0x3c20f5[_0x3ff4('0x12e')](_0xf82335,_0x4005cc,_0x165f6a,_0x26a4d7['reason']);}}}})[_0x3ff4('0x3f')](function(){if(_0x278c8b){hopperUtils[_0x3ff4('0xe6')](_0xf82335,_0x34125b,_0x3151c5)[_0x3ff4('0x3f')](function(){return _0x4005cc(0x1);});}});});};Dialer['prototype'][_0x3ff4('0x12b')]=function(_0x46ddb4,_0x5d1145,_0x94ce4b,_0x4e7464){var _0x48cd98=new Final(_0x46ddb4);_0x48cd98[_0x3ff4('0x74')]=0xf;_0x48cd98[_0x3ff4('0xd5')]=_0x3ff4('0x1c2');this['createStateFinal'](_0x48cd98,_0x5d1145,_0x94ce4b,_0x4e7464);};Dialer[_0x3ff4('0x89')]['createStateFinal']=function(_0x2d48bb,_0xcfb1a9,_0x113616,_0x33a6d2){hopperUtils[_0x3ff4('0xcd')](_0x2d48bb)[_0x3ff4('0x3f')](function(){return _0xcfb1a9(msgResponse('[callProgressDetecting]',_0x3ff4('0x10e'),_0x33a6d2));})[_0x3ff4('0xa0')](function(){return _0x113616(msgResponse(_0x3ff4('0x1c3'),_0x3ff4('0x97'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x3ff4('0xa')]=function(_0x28d269){var _0x3823d8=_0x28d269[_0x3ff4('0x1c4')]/0x64;var _0x3c0ba6=_0x28d269['outboundDropCallsDayTimeout']/(_0x28d269[_0x3ff4('0xd3')]+_0x28d269[_0x3ff4('0xc5')]);var _0x40e40d=Math['round'](_0x28d269[_0x3ff4('0x1c5')]*(_0x28d269[_0x3ff4('0x1c6')]/0x64));var _0x2a159f=Math[_0x3ff4('0x1c7')](_0x28d269[_0x3ff4('0x1c5')]*(_0x28d269[_0x3ff4('0x1c8')]/0x64));var _0xb45130=_0x28d269['available']+_0x28d269[_0x3ff4('0x144')];var _0x23a4d1=Math[_0x3ff4('0x1c9')](_0x28d269[_0x3ff4('0x5e')]*_0x28d269['erlangAbandonmentRate']*_0x28d269[_0x3ff4('0x1ca')]*_0x28d269[_0x3ff4('0x1cb')]);if(_['isUndefined'](_0x28d269['startProgressive'])){if(!_[_0x3ff4('0x58')](_0x28d269['startPredictive'])){_0x28d269[_0x3ff4('0x28')]=undefined;loggerPredictive[_0x3ff4('0x68')](_0x3ff4('0x1cc'),_0x3ff4('0x1cd'));}if(!_[_0x3ff4('0x58')](_0x28d269[_0x3ff4('0x67')])){loggerPredictive[_0x3ff4('0x68')](_0x3ff4('0x1cc'),_0x3ff4('0x1ce'));clearInterval(_0x28d269[_0x3ff4('0x67')]);_0x28d269[_0x3ff4('0x67')]=undefined;}_0x28d269['startProgressive']=moment()[_0x3ff4('0x80')](_0x3ff4('0xcb'));loggerPredictive[_0x3ff4('0x4a')](_0x28d269[_0x3ff4('0x47')],'collection\x20data\x20in\x20progressive\x20at',_0x28d269[_0x3ff4('0x29')]);this[_0x3ff4('0xb4')](_0x28d269,0x1);}else if(ifInterval(_0x28d269[_0x3ff4('0x1cf')],_0x28d269[_0x3ff4('0x29')])){this[_0x3ff4('0xb4')](_0x28d269,0x1);loggerPredictiveCalls[_0x3ff4('0x4a')](_0x3ff4('0x1d0'),_0x28d269[_0x3ff4('0x29')],_0x28d269[_0x3ff4('0x47')]);_0x28d269['erlangCalls']=0x0;_0x28d269[_0x3ff4('0xd4')]=0x0;}else if(_0x3823d8<_0x3c0ba6&&_0x28d269[_0x3ff4('0x1d1')]===_0x3ff4('0x1d2')){clearPredictiveAttributes(_0x28d269);loggerPredictive['info'](_0x3ff4('0x1d3'),_0x3ff4('0x1d4'),_0x3c0ba6,_0x3ff4('0x29'),_0x28d269[_0x3ff4('0x47')]);}else if(_0x23a4d1<_0x28d269[_0x3ff4('0xd4')]&&_0x28d269[_0x3ff4('0x1d1')]===_0x3ff4('0x1d2')){clearPredictiveAttributes(_0x28d269);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x1d5'),'Max\x20Drop\x20',_0x23a4d1,_0x3ff4('0x1d6'),_0x28d269[_0x3ff4('0xd4')],_0x3ff4('0x29'),_0x28d269[_0x3ff4('0x47')]);}else if(!ifInterval(_0x28d269[_0x3ff4('0x1cf')],_0x28d269[_0x3ff4('0x29')])&&_['isUndefined'](_0x28d269[_0x3ff4('0x28')])&&!_[_0x3ff4('0x58')](_0x28d269['startProgressive'])){_0x28d269[_0x3ff4('0x28')]=moment()[_0x3ff4('0x80')](_0x3ff4('0xcb'));loggerPredictive[_0x3ff4('0x4a')](_0x28d269[_0x3ff4('0x47')],_0x3ff4('0x1d7'),_0x28d269['startPredictive']);hopperUtils[_0x3ff4('0x1d8')](_0x28d269[_0x3ff4('0x1cf')])[_0x3ff4('0x3f')](this[_0x3ff4('0x1d9')](_0x28d269))['then'](mergeDataErlangB(_0x28d269))[_0x3ff4('0x3f')](this[_0x3ff4('0x1da')](_0x28d269))[_0x3ff4('0xa0')](loggerCatchPredictive(_0x3ff4('0x1db'),_0x28d269));}else if(!ifInterval(_0x28d269[_0x3ff4('0x1cf')],_0x28d269['startPredictive'])){_0x28d269[_0x3ff4('0xd4')]=0x0;_0x28d269[_0x3ff4('0x28')]=moment()[_0x3ff4('0x80')](_0x3ff4('0xcb'));loggerPredictive['info'](_0x28d269['name'],'recalculate\x20predictive\x20at',_0x28d269['startPredictive']);clearInterval(_0x28d269[_0x3ff4('0x67')]);_0x28d269[_0x3ff4('0x67')]=undefined;hopperUtils[_0x3ff4('0x1d8')](_0x28d269[_0x3ff4('0x1cf')])[_0x3ff4('0x3f')](this[_0x3ff4('0x1d9')](_0x28d269))[_0x3ff4('0x3f')](mergeDataErlangB(_0x28d269))[_0x3ff4('0x3f')](this[_0x3ff4('0x1da')](_0x28d269))['catch'](loggerCatchPredictive(_0x3ff4('0x1dc'),_0x28d269));}else if(_0x28d269[_0x3ff4('0x1c5')]&&_0xb45130<_0x28d269[_0x3ff4('0x1c5')]-_0x2a159f){clearPredictiveAttributes(_0x28d269);loggerPredictive[_0x3ff4('0x4a')](_0x28d269[_0x3ff4('0x47')],_0x3ff4('0x1dd'),_0xb45130,_0x3ff4('0x1de'),_0x28d269[_0x3ff4('0x1c5')],'-',_0x2a159f,'=',_0x28d269[_0x3ff4('0x1c5')]-_0x2a159f,')');}else if(_0x28d269[_0x3ff4('0x1c5')]&&_0xb45130>_0x28d269['predictiveIntervalAvailable']+_0x40e40d){clearPredictiveAttributes(_0x28d269);loggerPredictive['info'](_0x28d269[_0x3ff4('0x47')],_0x3ff4('0x1dd'),_0xb45130,_0x3ff4('0x1df'),_0x28d269[_0x3ff4('0x1c5')],'+',_0x40e40d,'=',_0x28d269['predictiveIntervalAvailable']+_0x40e40d,')');}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x1d9')]=function(_0x18a69c){var _0x3c2856=this;return function(_0x250b8b){return new Promise(function(_0x504d5b,_0x289006){_[_0x3ff4('0x63')](_0x18a69c,_0x250b8b[0x0]);if(checkGetDataPredictive(_0x250b8b[0x0])){var _0x1d1b6d=_0x18a69c[_0x3ff4('0x1c5')]=_0x18a69c['talking']+_0x18a69c[_0x3ff4('0x1e0')];var _0x1b4cda=_0x18a69c[_0x3ff4('0x1cf')]*0x3c;var _0x132dd2=_0x250b8b[0x0][_0x3ff4('0x55')]+_0x250b8b[0x0][_0x3ff4('0x59')];var _0xdb5722=(_0x250b8b[0x0][_0x3ff4('0x4f')]+_0x250b8b[0x0][_0x3ff4('0xd2')]+_0x250b8b[0x0][_0x3ff4('0x52')])/_0x250b8b[0x0]['predictiveIntervalTotalCalls'];_0x18a69c[_0x3ff4('0x1ca')]=_0xdb5722>0x0?_0xdb5722:0x1;switch(_0x18a69c[_0x3ff4('0x1d1')]){case _0x3ff4('0x1d2'):var _0x57399c=_0x18a69c[_0x3ff4('0x1c4')]/0x64;return _0x3c2856[_0x3ff4('0x1e1')](_0x1d1b6d,_0x1b4cda,_0x132dd2,_0xdb5722,_0x57399c)[_0x3ff4('0x3f')](function(_0x2a93f3){return _0x504d5b(_0x2a93f3);});case'agentBusyFactor':var _0x4f9774=_0x18a69c[_0x3ff4('0x1c4')]/0x64;return _0x3c2856['busyFactor'](_0x1d1b6d,_0x1b4cda,_0x132dd2,_0xdb5722,_0x4f9774)['then'](function(_0x482973){return _0x504d5b(_0x482973);});default:return _0x289006(msgResponse('[getDataPredictive]',_0x3ff4('0x97'),'Unknown\x20Predictive'));}}else{return _0x289006(msgResponse(_0x3ff4('0x1e2'),_0x3ff4('0x97'),_0x3ff4('0x1e3')));}});};};Dialer['prototype'][_0x3ff4('0x1e4')]=function(_0x2cb47f){var _0x2b2d2e=this;return function(_0x2066ff){return new Promise(function(_0x8a14d4,_0x4eac48){_[_0x3ff4('0x63')](_0x2cb47f,_0x2066ff[0x0]);if(checkGetDataPredictive(_0x2066ff[0x0])){loggerPredictive['info'](JSON[_0x3ff4('0x79')](_0x2066ff[0x0]));if(_0x2cb47f[_0x3ff4('0x1d1')]===_0x3ff4('0x1d2')){return _0x2b2d2e[_0x3ff4('0x159')](_0x2cb47f['id'])[_0x3ff4('0x3f')](function(_0x51d4dc){var _0x48230c=_0x2cb47f['loggedIn']-_0x51d4dc[0x0][_0x3ff4('0x1e5')];var _0x4b21c6=_0x2cb47f[_0x3ff4('0x1cf')]*0x3c;var _0xe794a5=_0x2066ff[0x0][_0x3ff4('0x55')]+_0x2066ff[0x0][_0x3ff4('0x59')];var _0x2f5a63=(_0x2066ff[0x0][_0x3ff4('0x4f')]+_0x2066ff[0x0][_0x3ff4('0xd2')]+_0x2066ff[0x0][_0x3ff4('0x52')])/_0x2066ff[0x0][_0x3ff4('0x4d')];var _0x13addd=_0x2cb47f[_0x3ff4('0x1c4')]/0x64;_0x2cb47f[_0x3ff4('0x1e6')]=_0x51d4dc[0x0][_0x3ff4('0x1e5')]||0x0;_0x2cb47f[_0x3ff4('0x1ca')]=_0x2f5a63>0x0?_0x2f5a63:0x1;return _0x2b2d2e[_0x3ff4('0x1e1')](_0x48230c,_0x4b21c6,_0xe794a5,_0x2f5a63,_0x13addd);})[_0x3ff4('0x3f')](function(_0x241751){return _0x8a14d4(_0x241751);})['catch'](function(_0x16219a){return _0x4eac48(msgResponse(_0x3ff4('0x1e7'),_0x3ff4('0x97'),JSON[_0x3ff4('0x79')](_0x16219a)));});}if(_0x2cb47f[_0x3ff4('0x1d1')]===_0x3ff4('0x1e8')){return _0x2b2d2e[_0x3ff4('0x159')](_0x2cb47f['id'])[_0x3ff4('0x3f')](function(_0x38bbb4){var _0x3cbf71=_0x2cb47f[_0x3ff4('0x1e9')]-_0x38bbb4[0x0][_0x3ff4('0x1e5')];var _0x4b68eb=_0x2cb47f[_0x3ff4('0x1cf')]*0x3c;var _0x39b07b=_0x2066ff[0x0][_0x3ff4('0x55')]+_0x2066ff[0x0][_0x3ff4('0x59')];var _0x4d4284=(_0x2066ff[0x0]['predictiveIntervalAnsweredCalls']+_0x2066ff[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2066ff[0x0][_0x3ff4('0x52')])/_0x2066ff[0x0][_0x3ff4('0x4d')];var _0x2552f5=_0x2cb47f[_0x3ff4('0x1c4')]/0x64;_0x2cb47f[_0x3ff4('0x1e6')]=_0x38bbb4[0x0][_0x3ff4('0x1e5')]||0x0;_0x2cb47f[_0x3ff4('0x1ca')]=_0x4d4284>0x0?_0x4d4284:0x1;return _0x2b2d2e[_0x3ff4('0x1ea')](_0x3cbf71,_0x4b68eb,_0x39b07b,_0x4d4284,_0x2552f5);})[_0x3ff4('0x3f')](function(_0x4de59b){return _0x8a14d4(_0x4de59b);})[_0x3ff4('0xa0')](function(_0x51cf69){return _0x4eac48(msgResponse('[CatchErlangB]','Failure',JSON[_0x3ff4('0x79')](_0x51cf69)));});}}else{return _0x4eac48(msgResponse('[getDataPredictive]',_0x3ff4('0x97'),_0x3ff4('0x1e3')));}});};};Dialer[_0x3ff4('0x89')][_0x3ff4('0x1da')]=function(_0x573751){var _0x4b013e=this;return function(){var _0x214360=0x0;var _0x83e0b8=Math[_0x3ff4('0x1c9')](_0x573751[_0x3ff4('0x1eb')]*0x3e8);if(_0x83e0b8>0x0){_0x83e0b8=_0x83e0b8<0x64?0x64:_0x83e0b8;loggerPredictive[_0x3ff4('0x4a')](_0x573751[_0x3ff4('0x47')],_0x3ff4('0x1ec'),_0x83e0b8,'milliseconds');_0x573751[_0x3ff4('0x67')]=setInterval(function(){_0x4b013e[_0x3ff4('0x67')](_0x573751);loggerPredictiveCalls['info']('[handlePredictive]',_0x214360+=0x1);},_0x83e0b8);}else{loggerPredictive[_0x3ff4('0x4a')](_0x573751[_0x3ff4('0x47')],_0x3ff4('0x1ed'));}};};Dialer[_0x3ff4('0x89')][_0x3ff4('0x1ee')]=function(_0x1f40f1,_0x5e3de9){var _0x222096=this;return function(_0x447ea6){if(_[_0x3ff4('0x49')](_0x447ea6)){if(_['isNil'](_0x5e3de9['UserId'])||!_0x5e3de9[_0x3ff4('0x1ef')]){if(_0x1f40f1[_0x3ff4('0x1f0')]==='booked'){_0x1f40f1[_0x3ff4('0x77')]=_[_0x3ff4('0x58')](_0x1f40f1['queueStatusComplete'])?!![]:_0x1f40f1[_0x3ff4('0x77')];var _0x5323eb=uuid['v4']();_0x222096[_0x3ff4('0xf0')][_0x5323eb]=new Action(_0x1f40f1,_0x5e3de9,_0x5323eb);loggerBooked[_0x3ff4('0x4a')](_0x3ff4('0x1f1'),_0x5323eb,_0x3ff4('0x1f2'),JSON[_0x3ff4('0x79')](_0x1f40f1[_0x3ff4('0x77')]),'Queue:\x20',_0x1f40f1[_0x3ff4('0x47')]);if(_0x1f40f1[_0x3ff4('0x77')]){_0x1f40f1[_0x3ff4('0x77')]=![];_0x222096[_0x3ff4('0xf9')][_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xc3')]]=[];ami['Action']({'actionid':_0x5323eb,'action':_0x3ff4('0x1f3'),'queue':_0x1f40f1['name']})[_0x3ff4('0xa0')](function(){_0x222096[_0x3ff4('0xce')](_0x1f40f1);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x222096['actions'][_0x5323eb][_0x3ff4('0xed')],'ListId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe0')],'VoiceQueueId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe1')]||undefined,'CampaignId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x1f4')));delete _0x222096[_0x3ff4('0xf0')][_0x5323eb];});}else{loggerBooked[_0x3ff4('0x4a')](_0x3ff4('0x1f5'),JSON['stringify'](_0x1f40f1[_0x3ff4('0x77')]),_0x3ff4('0x1f6'),_0x1f40f1[_0x3ff4('0x47')]);_0x222096[_0x3ff4('0xce')](_0x1f40f1);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xed')],'ListId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe0')],'VoiceQueueId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe1')]||undefined,'CampaignId':_0x222096[_0x3ff4('0xf0')][_0x5323eb][_0x3ff4('0xe2')]||undefined})[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x1f4')));delete _0x222096[_0x3ff4('0xf0')][_0x5323eb];}}else{return _0x222096[_0x3ff4('0x1f7')](_0x1f40f1,_0x5e3de9);}}else{if(utils[_0x3ff4('0x64')](undefined,_0x5e3de9[_0x3ff4('0x1f8')])<_0x1f40f1[_0x3ff4('0x1f9')]*0x3c){if(_0x5e3de9['Agent']&&!_0x5e3de9['Agent'][_0x3ff4('0x1fa')]){_0x222096[_0x3ff4('0x1f')][_0x3ff4('0xfd')](_0x5e3de9['id'])[_0x3ff4('0x1e')](function(){_0x222096[_0x3ff4('0xce')](_0x1f40f1);});}else{hopperUtils['unlockContact']({'active':![]},_0x5e3de9['id'],0x1)[_0x3ff4('0x1e')](function(){_0x222096[_0x3ff4('0xce')](_0x1f40f1);});}}else{_0x1f40f1[_0x3ff4('0x1fb')]+=0x1;_0x222096[_0x3ff4('0xce')](_0x1f40f1);if(_0x1f40f1[_0x3ff4('0x1fc')]){hopperUtils[_0x3ff4('0xff')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e3de9[_0x3ff4('0xed')],'ListId':_0x5e3de9[_0x3ff4('0xe0')],'VoiceQueueId':_0x5e3de9[_0x3ff4('0xe1')]||undefined,'CampaignId':_0x5e3de9[_0x3ff4('0xe2')]||undefined})['catch'](loggerCatch(_0x3ff4('0x1fd')));hopperUtils[_0x3ff4('0xcc')](createObjHistory(_0x1f40f1,_0x5e3de9,utils[_0x3ff4('0x6e')][_0x3ff4('0x1fe')],0x17,'RecallInQueue'))[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x1ff')));}else{_0x222096[_0x3ff4('0x11c')](createObjHistory(_0x1f40f1,_0x5e3de9,utils[_0x3ff4('0x6e')][_0x3ff4('0x200')],0x16,_0x3ff4('0x201')),_0x3ff4('0x202'),_0x3ff4('0x203'));}}}}else{_0x1f40f1[_0x3ff4('0x204')]+=0x1;_0x222096[_0x3ff4('0x11c')](createObjHistory(_0x1f40f1,_0x5e3de9,utils[_0x3ff4('0x6e')][_0x3ff4('0x205')],0xd,_0x3ff4('0x206')),_0x3ff4('0x207'),_0x3ff4('0x208'));throw'inBlackList';}};};Dialer[_0x3ff4('0x89')]['handleIvr']=function(_0x3c1ac3){var _0x2c14ae=this;var _0x1f166a=_0x3c1ac3[_0x3ff4('0x209')]-_0x3c1ac3[_0x3ff4('0x15b')];emitCampaignSummary(_0x3c1ac3);if(_0x1f166a>0x0&&_0x3c1ac3[_0x3ff4('0x6b')]==0x0){if(_0x1f166a>this[_0x3ff4('0x24')]){_0x1f166a=this[_0x3ff4('0x24')];}_0x3c1ac3[_0x3ff4('0x6b')]=0x1;hopperUtils[_0x3ff4('0x20a')](_0x3c1ac3,_0x1f166a)[_0x3ff4('0x3f')](function(_0x4fc1f0){_0x3c1ac3[_0x3ff4('0x6b')]=0x0;if(_0x4fc1f0){if(!utils['checkContactEmpty'](_0x4fc1f0)){_0x3c1ac3[_0x3ff4('0x6d')]=utils['CAMPAIGN_STATUS'][_0x3ff4('0x72')];logger['info'](_0x3ff4('0x20b')+_0x3c1ac3[_0x3ff4('0x47')]);}else{_0x3c1ac3[_0x3ff4('0x15b')]+=_0x4fc1f0[_0x3ff4('0x9c')];_0x3c1ac3[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x20c')];for(var _0x375c02=0x0;_0x375c02<_0x4fc1f0[_0x3ff4('0x9c')];_0x375c02+=0x1){_0x3c1ac3['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4fc1f0[_0x375c02])||_[_0x3ff4('0x106')](_0x4fc1f0[_0x375c02]['Contact'])||_[_0x3ff4('0x106')](_0x4fc1f0[_0x375c02][_0x3ff4('0x164')])){_0x2c14ae[_0x3ff4('0x15e')](_0x3ff4('0x20d'),_0x3c1ac3,_0x4fc1f0[_0x375c02]);}else{hopperUtils[_0x3ff4('0x20e')](_[_0x3ff4('0xfa')](_0x4fc1f0[_0x375c02],[_0x3ff4('0xe2'),_0x3ff4('0x164')]))['then'](_0x2c14ae[_0x3ff4('0x1ee')](_0x3c1ac3,_0x4fc1f0[_0x375c02]))[_0x3ff4('0xa0')](_0x2c14ae[_0x3ff4('0x15d')](_0x3ff4('0x20f'),_0x3c1ac3));}}}}})[_0x3ff4('0xa0')](loggerGetContactDialer('[getContactCampaign2]',_0x3c1ac3,_0x1f166a));}};Dialer[_0x3ff4('0x89')][_0x3ff4('0xb4')]=function(_0x18306c,_0x506c85){var _0x31d7a4=this;var _0x396944=[];if(_0x506c85<0x1||_0x18306c[_0x3ff4('0x1f0')]===_0x3ff4('0x9')){_0x506c85=0x1;}var _0x1de21f=Math['floor'](_0x18306c['available']*_0x506c85)-_0x18306c[_0x3ff4('0x15b')];if(_0x18306c[_0x3ff4('0x210')]>0x0){var _0x3e0c37=_0x18306c[_0x3ff4('0x210')]-_0x18306c[_0x3ff4('0x15b')]-_0x18306c[_0x3ff4('0x144')]-_0x18306c[_0x3ff4('0x145')];if(_0x1de21f>_0x3e0c37){_0x1de21f=_0x3e0c37;}}if(_0x1de21f>0x0&&_0x18306c['temp']==0x0){if(_0x18306c[_0x3ff4('0x1f0')]==='booked'){_0x1de21f=0x1;}if(_0x1de21f>this[_0x3ff4('0x24')]){_0x1de21f=this[_0x3ff4('0x24')];}for(var _0x1893de in this[_0x3ff4('0x22')]){if(typeof this['agents'][_0x1893de]!=='undefined'){if(this[_0x3ff4('0x22')][_0x1893de][_0x3ff4('0x74')]===_0x3ff4('0x211')&&this['agents'][_0x1893de][_0x3ff4('0x8d')]===_0x3ff4('0x8c')){_0x396944['push'](this[_0x3ff4('0x22')][_0x1893de]['id']);}}}_0x18306c[_0x3ff4('0x6b')]=0x1;hopperUtils['getContactDialer'](_0x18306c,_0x396944,_0x1de21f)[_0x3ff4('0x3f')](function(_0x3ddb32){_0x18306c[_0x3ff4('0x6b')]=0x0;if(_0x3ddb32){if(!utils[_0x3ff4('0x212')](_0x3ddb32)){hopperUtils[_0x3ff4('0x213')](_0x18306c)[_0x3ff4('0x3f')](sendMessageReschedule(_0x18306c))[_0x3ff4('0xa0')](loggerCatch('[countReScheduled]\x20'));}else{_0x18306c[_0x3ff4('0x15b')]+=_0x3ddb32['length'];_0x18306c[_0x3ff4('0x6d')]=_0x18306c[_0x3ff4('0x1f0')]===_0x3ff4('0x9')?utils[_0x3ff4('0x6e')][_0x3ff4('0x16b')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x5a69ac=0x0;_0x5a69ac<_0x3ddb32[_0x3ff4('0x9c')];_0x5a69ac+=0x1){if(_[_0x3ff4('0x106')](_0x3ddb32[_0x5a69ac])||_[_0x3ff4('0x106')](_0x3ddb32[_0x5a69ac]['Contact'])||_[_0x3ff4('0x106')](_0x3ddb32[_0x5a69ac][_0x3ff4('0x164')])){_0x31d7a4['emptyContact'](_0x3ff4('0x20d'),_0x18306c,_0x3ddb32[_0x5a69ac]);}else{hopperUtils['checkIsBlackList'](_[_0x3ff4('0xfa')](_0x3ddb32[_0x5a69ac],[_0x3ff4('0xe1'),_0x3ff4('0x164')]))['then'](_0x31d7a4[_0x3ff4('0x1ee')](_0x18306c,_0x3ddb32[_0x5a69ac]))[_0x3ff4('0xa0')](_0x31d7a4[_0x3ff4('0x15d')]('[actionOriginate]\x20',_0x18306c));}}}}})[_0x3ff4('0xa0')](loggerGetContactDialer(_0x3ff4('0x214'),_0x18306c,_0x1de21f));}};Dialer[_0x3ff4('0x89')][_0x3ff4('0x67')]=function(_0x5fe55){if(_0x5fe55[_0x3ff4('0x210')]>0x0){var _0x18e04e=_0x5fe55[_0x3ff4('0x210')]-_0x5fe55[_0x3ff4('0x15b')]-_0x5fe55[_0x3ff4('0x144')];if(_0x18e04e>0x0&&_0x5fe55[_0x3ff4('0x6b')]==0x0){this[_0x3ff4('0x215')](_0x5fe55);}else{loggerPredictiveCalls[_0x3ff4('0x4a')](_0x3ff4('0x216'));}}else{this[_0x3ff4('0x215')](_0x5fe55);}};Dialer['prototype'][_0x3ff4('0x215')]=function(_0x3ca437){var _0x1bb032=this;var _0x59d445=[];_0x3ca437[_0x3ff4('0x15b')]+=0x1;for(var _0x4c2305 in this[_0x3ff4('0x22')]){if(typeof this['agents'][_0x4c2305]!==_0x3ff4('0xab')){if(this['agents'][_0x4c2305][_0x3ff4('0x74')]===_0x3ff4('0x211')&&this['agents'][_0x4c2305][_0x3ff4('0x8d')]==='reachable'){_0x59d445['push'](this[_0x3ff4('0x22')][_0x4c2305]['id']);}}}_0x3ca437[_0x3ff4('0x6b')]=0x1;return this[_0x3ff4('0x217')](_0x3ca437['id'],_0x59d445,0x1,_0x3ca437[_0x3ff4('0x218')],_0x3ca437)[_0x3ff4('0x3f')](function(_0x49881d){_0x3ca437['temp']=0x1;if(_0x49881d){if(!utils[_0x3ff4('0x212')](_0x49881d)){utils[_0x3ff4('0x6a')](_0x3ca437,0x1,0x0);return hopperUtils[_0x3ff4('0x213')](_0x3ca437)[_0x3ff4('0x3f')](sendMessageReschedule(_0x3ca437))[_0x3ff4('0xa0')](loggerCatch(_0x3ff4('0x219')));}else{_0x3ca437[_0x3ff4('0x6d')]=utils[_0x3ff4('0x6e')][_0x3ff4('0x20c')];if(_[_0x3ff4('0x106')](_0x49881d[0x0])||_[_0x3ff4('0x106')](_0x49881d[0x0][_0x3ff4('0x17d')])||_['isNil'](_0x49881d[0x0][_0x3ff4('0x164')])){_0x1bb032['emptyContact']('[actionOriginate]\x20',_0x3ca437,_0x49881d[0x0]);}else{return hopperUtils[_0x3ff4('0x21a')](_['pick'](_0x49881d[0x0],[_0x3ff4('0xe1'),_0x3ff4('0x164')]))[_0x3ff4('0x3f')](_0x1bb032[_0x3ff4('0x1ee')](_0x3ca437,_0x49881d[0x0]))[_0x3ff4('0xa0')](_0x1bb032[_0x3ff4('0x15d')](_0x3ff4('0x21b'),_0x3ca437));}}}})[_0x3ff4('0xa0')](loggerGetContactDialer(_0x3ff4('0x21c'),_0x3ca437,0x1));};Dialer[_0x3ff4('0x89')]['abandonmentRate']=function(_0x5818ce,_0x3b568f,_0x250ff4,_0x4f1bdf,_0x173602,_0x4b05c3){loggerPredictive[_0x3ff4('0x4a')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x21d'),_0x5818ce);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x21e'),_0x3b568f);loggerPredictive[_0x3ff4('0x4a')]('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',_0x250ff4);loggerPredictive['info'](_0x3ff4('0x21f'),_0x4f1bdf);loggerPredictive['info'](_0x3ff4('0x220'),_0x173602);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x56'));return new Promise(function(_0x31c3f8,_0x5d41e5){if(_0x5818ce<=0x0||isNaN(_0x5818ce)){return _0x5d41e5(msgResponse(_0x3ff4('0x221'),'Error',_0x3ff4('0x222')+_0x5818ce));}if(_0x250ff4<=0x0||isNaN(_0x250ff4)){return _0x5d41e5(msgResponse(_0x3ff4('0x221'),_0x3ff4('0xc0'),_0x3ff4('0x223')+_0x250ff4));}if(_0x4f1bdf<=0x0||isNaN(_0x4f1bdf)){return _0x5d41e5(msgResponse(_0x3ff4('0x221'),'Error',_0x3ff4('0x224')+_0x4f1bdf));}if(_0x3b568f<=0x0||isNaN(_0x3b568f)){return _0x5d41e5(msgResponse('[abandonmentRate]','Error',_0x3ff4('0x225')+_0x3b568f));}if(_0x173602<=0x0||isNaN(_0x173602)){return _0x5d41e5(msgResponse(_0x3ff4('0x221'),_0x3ff4('0xc0'),_0x3ff4('0x226')+_0x173602));}_0x4b05c3=_0x4b05c3||0x0;var _0x5e3e77=0x1/_0x250ff4;var _0x192735=0x0;var _0x368f7b=0x0;var _0x2fa447=0x0;var _0x18b9c4=0x0;for(var _0x38a92f=0x0;_0x2fa447<_0x173602;_0x38a92f+=0x1){_0x368f7b=_0x38a92f/_0x3b568f;_0x192735=(_0x4f1bdf*_0x368f7b+_0x4b05c3)/_0x5e3e77;_0x2fa447=utils[_0x3ff4('0x227')](_0x192735,_0x5818ce);_0x18b9c4=_0x192735/_0x5818ce*(0x1-utils[_0x3ff4('0x227')](_0x192735,_0x5818ce));}return _0x31c3f8({'erlangCalls':_0x38a92f,'erlangCallToSecond':_0x3b568f/_0x38a92f,'erlangAbandonmentRate':_0x2fa447,'erlangBusyFactor':_0x18b9c4});});};Dialer[_0x3ff4('0x89')][_0x3ff4('0x1ea')]=function(_0x5c12a0,_0x35c72d,_0x49a568,_0x147ad5,_0x4b81bf,_0x1219dd){loggerPredictive[_0x3ff4('0x4a')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x21d'),_0x5c12a0);loggerPredictive[_0x3ff4('0x4a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x35c72d);loggerPredictive[_0x3ff4('0x4a')]('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',_0x49a568);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x21f'),_0x147ad5);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b81bf);loggerPredictive[_0x3ff4('0x4a')](_0x3ff4('0x56'));return new Promise(function(_0x58b4e0,_0x2bee29){if(_0x5c12a0<=0x0||isNaN(_0x5c12a0)){return _0x2bee29(msgResponse(_0x3ff4('0x228'),_0x3ff4('0xc0'),_0x3ff4('0x222')+_0x5c12a0));}if(_0x49a568<=0x0||isNaN(_0x49a568)){return _0x2bee29(msgResponse(_0x3ff4('0x228'),_0x3ff4('0xc0'),_0x3ff4('0x223')+_0x49a568));}if(_0x147ad5<=0x0||isNaN(_0x147ad5)){return _0x2bee29(msgResponse(_0x3ff4('0x228'),'Error',_0x3ff4('0x224')+_0x147ad5));}if(_0x35c72d<=0x0||isNaN(_0x35c72d)){return _0x2bee29(msgResponse(_0x3ff4('0x228'),_0x3ff4('0xc0'),_0x3ff4('0x225')+_0x35c72d));}if(_0x4b81bf<=0x0||isNaN(_0x4b81bf)){return _0x2bee29(msgResponse(_0x3ff4('0x228'),'Error',_0x3ff4('0x229')+_0x4b81bf));}_0x1219dd=_0x1219dd||0x0;var _0x4b2a9d=0x1/_0x49a568;var _0x213f0f=0x0;var _0x396440=0x0;var _0x1c6958=0x0;var _0x5ba26f=0x0;for(var _0x1e8733=0x0;_0x5ba26f<_0x4b81bf;_0x1e8733+=0x1){_0x396440=_0x1e8733/_0x35c72d;_0x213f0f=(_0x147ad5*_0x396440+_0x1219dd)/_0x4b2a9d;_0x1c6958=utils['erlangb'](_0x213f0f,_0x5c12a0);_0x5ba26f=_0x213f0f/_0x5c12a0*(0x1-utils[_0x3ff4('0x227')](_0x213f0f,_0x5c12a0));}return _0x58b4e0({'erlangCalls':_0x1e8733,'erlangCallToSecond':_0x35c72d/_0x1e8733,'erlangAbandonmentRate':_0x1c6958,'erlangBusyFactor':_0x5ba26f});});};module[_0x3ff4('0x22a')]=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 402770c..c223675 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 _0x2a1a=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','dialCutDigit','substring','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','active','type','dialQueueTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a1a,0x149));var _0xa2a1=function(_0x2376ef,_0x8397c3){_0x2376ef=_0x2376ef-0x0;var _0x1bd5b0=_0x2a1a[_0x2376ef];return _0x1bd5b0;};'use strict';var util=require(_0xa2a1('0x0'));var _=require('lodash');var moment=require(_0xa2a1('0x1'));function checkNameSurname(_0x18e047,_0x262e35,_0x45aac7){var _0xa34cae='';if(!_[_0xa2a1('0x2')](_0x262e35)&&_0xa2a1('0x3')===typeof _0x262e35){_0xa34cae+=_0x262e35;}if(!_[_0xa2a1('0x2')](_0x45aac7)&&_0xa2a1('0x3')===typeof _0x45aac7){_0xa34cae+='\x20'+_0x45aac7;}if(_0xa34cae!==''){return _0xa34cae;}return _0x18e047;}function Action(_0x1f1d0d,_0x53710c,_0x55cd65){this[_0xa2a1('0x4')]=_0x1f1d0d;this[_0xa2a1('0x5')]=_0x55cd65||undefined;this[_0xa2a1('0x6')]=checkNameSurname(_0x53710c[_0xa2a1('0x7')][_0xa2a1('0x8')],_0x53710c['Contact'][_0xa2a1('0x9')],_0x53710c[_0xa2a1('0x7')][_0xa2a1('0xa')]);this[_0xa2a1('0xb')]=_0x53710c['phone'];this['queue']=_0x1f1d0d['name'];this[_0xa2a1('0xc')]=_0x53710c[_0xa2a1('0xc')]||![];this[_0xa2a1('0xd')]=_0x1f1d0d['type'];this[_0xa2a1('0xe')]=_0x1f1d0d[_0xa2a1('0xe')]||0x3;this[_0xa2a1('0xf')]=_0x53710c[_0xa2a1('0xf')];this['countbusyretry']=_0x53710c[_0xa2a1('0x10')];this[_0xa2a1('0x11')]=_0x53710c[_0xa2a1('0x11')];this[_0xa2a1('0x12')]=_0x53710c[_0xa2a1('0x12')];this[_0xa2a1('0x13')]=_0x53710c[_0xa2a1('0x13')];this[_0xa2a1('0x14')]=_0x53710c[_0xa2a1('0x14')];this[_0xa2a1('0x15')]=_0x53710c[_0xa2a1('0x15')];this[_0xa2a1('0x16')]=_0x53710c[_0xa2a1('0x16')];this[_0xa2a1('0x17')]=_0x53710c['countagentrejectretry'];this[_0xa2a1('0x18')]=_0x53710c[_0xa2a1('0x18')];this['ListId']=_0x53710c['ListId'];this[_0xa2a1('0x19')]=_0x53710c['UserId'];this[_0xa2a1('0x1a')]=_0x53710c['VoiceQueueId'];this[_0xa2a1('0x1b')]=_0x53710c[_0xa2a1('0x1b')];this[_0xa2a1('0x1c')]=_0x53710c['id'];this[_0xa2a1('0x1d')]=_0x53710c['Contact'][_0xa2a1('0x9')]||'';this['starttime']=moment()['format'](_0xa2a1('0x1e'));this[_0xa2a1('0x1f')]=_0x53710c[_0xa2a1('0x1f')];this[_0xa2a1('0x20')]=_0x53710c[_0xa2a1('0x20')];this[_0xa2a1('0x21')]=_0x53710c[_0xa2a1('0x21')];this[_0xa2a1('0x22')]=_0x53710c[_0xa2a1('0x22')];this[_0xa2a1('0x23')]='';this[_0xa2a1('0x24')]='';}Action[_0xa2a1('0x25')]['getCaller']=function(){return util[_0xa2a1('0x26')]('\x22%s\x22\x20<%s>',this['name'],this[_0xa2a1('0x4')][_0xa2a1('0x27')]>0x0?this[_0xa2a1('0xb')][_0xa2a1('0x28')](this[_0xa2a1('0x4')][_0xa2a1('0x27')]):this['number']);};Action['prototype'][_0xa2a1('0x29')]=function(){return this['queue'];};module[_0xa2a1('0x2a')]=Action; \ No newline at end of file +var _0x2290=['\x22%s\x22\x20<%s>','dialCutDigit','getQueue','queue','exports','util','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','number','phone','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x2290,0x188));var _0x0229=function(_0x4509b1,_0x5b8596){_0x4509b1=_0x4509b1-0x0;var _0x16b709=_0x2290[_0x4509b1];return _0x16b709;};'use strict';var util=require(_0x0229('0x0'));var _=require('lodash');var moment=require(_0x0229('0x1'));function checkNameSurname(_0x44695a,_0x156ad1,_0x37e32b){var _0x406d56='';if(!_[_0x0229('0x2')](_0x156ad1)&&'string'===typeof _0x156ad1){_0x406d56+=_0x156ad1;}if(!_['isNil'](_0x37e32b)&&_0x0229('0x3')===typeof _0x37e32b){_0x406d56+='\x20'+_0x37e32b;}if(_0x406d56!==''){return _0x406d56;}return _0x44695a;}function Action(_0x3d752a,_0x1f0e33,_0x5f55e8){this[_0x0229('0x4')]=_0x3d752a;this[_0x0229('0x5')]=_0x5f55e8||undefined;this['name']=checkNameSurname(_0x1f0e33[_0x0229('0x6')]['phone'],_0x1f0e33['Contact'][_0x0229('0x7')],_0x1f0e33[_0x0229('0x6')]['lastName']);this[_0x0229('0x8')]=_0x1f0e33[_0x0229('0x9')];this['queue']=_0x3d752a[_0x0229('0xa')];this[_0x0229('0xb')]=_0x1f0e33['active']||![];this[_0x0229('0xc')]=_0x3d752a[_0x0229('0xc')];this[_0x0229('0xd')]=_0x3d752a[_0x0229('0xd')]||0x3;this[_0x0229('0xe')]=_0x1f0e33[_0x0229('0xe')];this[_0x0229('0xf')]=_0x1f0e33[_0x0229('0xf')];this[_0x0229('0x10')]=_0x1f0e33[_0x0229('0x10')];this[_0x0229('0x11')]=_0x1f0e33[_0x0229('0x11')];this[_0x0229('0x12')]=_0x1f0e33['countnosuchnumberretry'];this['countdropretry']=_0x1f0e33['countdropretry'];this[_0x0229('0x13')]=_0x1f0e33[_0x0229('0x13')];this['countmachineretry']=_0x1f0e33[_0x0229('0x14')];this[_0x0229('0x15')]=_0x1f0e33[_0x0229('0x15')];this[_0x0229('0x16')]=_0x1f0e33[_0x0229('0x16')];this[_0x0229('0x17')]=_0x1f0e33['ListId'];this['UserId']=_0x1f0e33[_0x0229('0x18')];this[_0x0229('0x19')]=_0x1f0e33['VoiceQueueId'];this[_0x0229('0x1a')]=_0x1f0e33['CampaignId'];this[_0x0229('0x1b')]=_0x1f0e33['id'];this['ContactFirstName']=_0x1f0e33['Contact'][_0x0229('0x7')]||'';this[_0x0229('0x1c')]=moment()[_0x0229('0x1d')](_0x0229('0x1e'));this[_0x0229('0x1f')]=_0x1f0e33['callback'];this['callbackuniqueid']=_0x1f0e33[_0x0229('0x20')];this[_0x0229('0x21')]=_0x1f0e33[_0x0229('0x21')];this[_0x0229('0x22')]=_0x1f0e33[_0x0229('0x22')];this[_0x0229('0x23')]='';this[_0x0229('0x24')]='';}Action[_0x0229('0x25')]['getCaller']=function(){return util['format'](_0x0229('0x26'),this[_0x0229('0xa')],this[_0x0229('0x4')]['dialCutDigit']>0x0?this[_0x0229('0x8')]['substring'](this[_0x0229('0x4')][_0x0229('0x27')]):this['number']);};Action[_0x0229('0x25')][_0x0229('0x28')]=function(){return this[_0x0229('0x29')];};module[_0x0229('0x2a')]=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 1dd2992..771f33c 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 _0x6a15=['holdtime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds'];(function(_0x4f18f9,_0x1417a1){var _0x107508=function(_0x57818b){while(--_0x57818b){_0x4f18f9['push'](_0x4f18f9['shift']());}};_0x107508(++_0x1417a1);}(_0x6a15,0xdc));var _0x56a1=function(_0x56970a,_0x1caf9d){_0x56970a=_0x56970a-0x0;var _0x316d6a=_0x6a15[_0x56970a];return _0x316d6a;};'use strict';var moment=require(_0x56a1('0x0'));var utils=require('../utils');function AgentComplete(_0x582b69,_0x218ddb){this['state']=0x4;this['statedesc']=_0x56a1('0x1');this[_0x56a1('0x2')]=_0x582b69[_0x56a1('0x2')];this[_0x56a1('0x3')]=_0x582b69['type'];this[_0x56a1('0x4')]=_0x582b69[_0x56a1('0x3')]===_0x56a1('0x5')?_0x56a1('0x6'):_0x582b69[_0x56a1('0x3')];this[_0x56a1('0x7')]=_0x582b69[_0x56a1('0x7')];this['countcongestionretry']=_0x582b69[_0x56a1('0x8')];this[_0x56a1('0x9')]=_0x582b69['countnoanswerretry'];this[_0x56a1('0xa')]=_0x582b69[_0x56a1('0x7')]+_0x582b69[_0x56a1('0x8')]+_0x582b69[_0x56a1('0x9')]+_0x582b69['countnosuchnumberretry']+_0x582b69[_0x56a1('0xb')]+_0x582b69[_0x56a1('0xc')]+_0x582b69[_0x56a1('0xd')]+_0x582b69['countagentrejectretry'];this[_0x56a1('0xe')]=_0x582b69[_0x56a1('0xe')];this[_0x56a1('0xb')]=_0x582b69[_0x56a1('0xb')];this[_0x56a1('0xc')]=_0x582b69[_0x56a1('0xc')];this[_0x56a1('0xd')]=_0x582b69[_0x56a1('0xd')];this[_0x56a1('0xf')]=_0x582b69[_0x56a1('0xf')];this[_0x56a1('0x10')]=_0x218ddb[_0x56a1('0x10')];this[_0x56a1('0x11')]=_0x582b69['name'];this[_0x56a1('0x12')]=_0x582b69['number'];this[_0x56a1('0x13')]=_0x582b69[_0x56a1('0x13')];this['responsetime']=_0x582b69[_0x56a1('0x14')];this[_0x56a1('0x15')]=_0x582b69[_0x56a1('0x15')];this[_0x56a1('0x16')]=moment()['format'](_0x56a1('0x17'));this[_0x56a1('0x18')]=utils[_0x56a1('0x19')](_0x582b69['responsetime'],_0x582b69[_0x56a1('0x13')]);this[_0x56a1('0x1a')]=utils[_0x56a1('0x19')](_0x582b69[_0x56a1('0x15')],_0x582b69[_0x56a1('0x14')]);this['talktime']=utils[_0x56a1('0x19')](this[_0x56a1('0x16')],_0x582b69[_0x56a1('0x15')]);this[_0x56a1('0x6')]=_0x218ddb[_0x56a1('0x6')];this['membername']=_0x218ddb[_0x56a1('0x1b')];this['reason']=_0x218ddb['reason'];this[_0x56a1('0x1c')]=_0x582b69[_0x56a1('0x1c')];this['callbackuniqueid']=_0x582b69[_0x56a1('0x1d')];this[_0x56a1('0x1e')]=_0x582b69[_0x56a1('0x1e')];this[_0x56a1('0x1f')]=_0x582b69['recallme'];this[_0x56a1('0x20')]=_0x582b69[_0x56a1('0x20')];this[_0x56a1('0x21')]=_0x582b69[_0x56a1('0x21')];this[_0x56a1('0x22')]=_0x582b69[_0x56a1('0x22')];this[_0x56a1('0x23')]=_0x582b69['VoiceQueueId'];this[_0x56a1('0x24')]=_0x582b69[_0x56a1('0x24')];this['originatecalleridnum']=_0x582b69[_0x56a1('0x25')]||'';this[_0x56a1('0x26')]=_0x582b69[_0x56a1('0x26')]||'';this['agiafterat']=_0x582b69[_0x56a1('0x27')];}module[_0x56a1('0x28')]=AgentComplete; \ No newline at end of file +var _0x0ff0=['answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0ff0,0x18f));var _0x00ff=function(_0x5364f9,_0x377f8f){_0x5364f9=_0x5364f9-0x0;var _0x2c8473=_0x0ff0[_0x5364f9];return _0x2c8473;};'use strict';var moment=require('moment');var utils=require(_0x00ff('0x0'));function AgentComplete(_0x37007a,_0x4586df){this[_0x00ff('0x1')]=0x4;this[_0x00ff('0x2')]=_0x00ff('0x3');this[_0x00ff('0x4')]=_0x37007a[_0x00ff('0x4')];this[_0x00ff('0x5')]=_0x37007a['type'];this['campaigntype']=_0x37007a[_0x00ff('0x5')]===_0x00ff('0x6')?_0x00ff('0x7'):_0x37007a[_0x00ff('0x5')];this[_0x00ff('0x8')]=_0x37007a[_0x00ff('0x8')];this['countcongestionretry']=_0x37007a['countcongestionretry'];this[_0x00ff('0x9')]=_0x37007a['countnoanswerretry'];this[_0x00ff('0xa')]=_0x37007a[_0x00ff('0x8')]+_0x37007a[_0x00ff('0xb')]+_0x37007a['countnoanswerretry']+_0x37007a['countnosuchnumberretry']+_0x37007a[_0x00ff('0xc')]+_0x37007a[_0x00ff('0xd')]+_0x37007a['countmachineretry']+_0x37007a[_0x00ff('0xe')];this[_0x00ff('0xf')]=_0x37007a['countnosuchnumberretry'];this[_0x00ff('0xc')]=_0x37007a[_0x00ff('0xc')];this[_0x00ff('0xd')]=_0x37007a[_0x00ff('0xd')];this[_0x00ff('0x10')]=_0x37007a[_0x00ff('0x10')];this[_0x00ff('0xe')]=_0x37007a[_0x00ff('0xe')];this[_0x00ff('0x11')]=_0x4586df['uniqueid'];this[_0x00ff('0x12')]=_0x37007a[_0x00ff('0x13')];this[_0x00ff('0x14')]=_0x37007a[_0x00ff('0x15')];this['starttime']=_0x37007a[_0x00ff('0x16')];this[_0x00ff('0x17')]=_0x37007a[_0x00ff('0x17')];this[_0x00ff('0x18')]=_0x37007a[_0x00ff('0x18')];this[_0x00ff('0x19')]=moment()[_0x00ff('0x1a')](_0x00ff('0x1b'));this[_0x00ff('0x1c')]=utils[_0x00ff('0x1d')](_0x37007a[_0x00ff('0x17')],_0x37007a[_0x00ff('0x16')]);this[_0x00ff('0x1e')]=utils['getSeconds'](_0x37007a[_0x00ff('0x18')],_0x37007a[_0x00ff('0x17')]);this[_0x00ff('0x1f')]=utils['getSeconds'](this[_0x00ff('0x19')],_0x37007a[_0x00ff('0x18')]);this[_0x00ff('0x7')]=_0x4586df['queue'];this[_0x00ff('0x20')]=_0x4586df['membername'];this['reason']=_0x4586df[_0x00ff('0x21')];this[_0x00ff('0x22')]=_0x37007a[_0x00ff('0x22')];this[_0x00ff('0x23')]=_0x37007a[_0x00ff('0x23')];this[_0x00ff('0x24')]=_0x37007a[_0x00ff('0x24')];this[_0x00ff('0x25')]=_0x37007a[_0x00ff('0x25')];this[_0x00ff('0x26')]=_0x37007a['ContactId'];this[_0x00ff('0x27')]=_0x37007a[_0x00ff('0x27')];this[_0x00ff('0x28')]=_0x37007a[_0x00ff('0x28')];this[_0x00ff('0x29')]=_0x37007a[_0x00ff('0x29')];this[_0x00ff('0x2a')]=_0x37007a[_0x00ff('0x2a')];this[_0x00ff('0x2b')]=_0x37007a[_0x00ff('0x2b')]||'';this[_0x00ff('0x2c')]=_0x37007a['originatecalleridname']||'';this[_0x00ff('0x2d')]=_0x37007a[_0x00ff('0x2d')];}module[_0x00ff('0x2e')]=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 ad5b18b..4afe9c1 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 _0x625f=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','type','outbound','queue','countbusyretry'];(function(_0x1f9140,_0x5ade2d){var _0xbe51a5=function(_0x22909d){while(--_0x22909d){_0x1f9140['push'](_0x1f9140['shift']());}};_0xbe51a5(++_0x5ade2d);}(_0x625f,0x1bb));var _0xf625=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x625f[_0x41ee16];return _0x1f60de;};'use strict';function Final(_0x530221){this[_0xf625('0x0')]=_0x530221[_0xf625('0x0')];this['scheduledat']=_0x530221['scheduledat'];this[_0xf625('0x1')]=_0x530221[_0xf625('0x1')];this['campaigntype']=_0x530221[_0xf625('0x1')]===_0xf625('0x2')?_0xf625('0x3'):_0x530221['type'];this[_0xf625('0x4')]=_0x530221[_0xf625('0x4')];this[_0xf625('0x5')]=_0x530221['countcongestionretry'];this[_0xf625('0x6')]=_0x530221[_0xf625('0x6')];this['countglobal']=_0x530221[_0xf625('0x4')]+_0x530221[_0xf625('0x5')]+_0x530221[_0xf625('0x6')]+_0x530221[_0xf625('0x7')]+_0x530221[_0xf625('0x8')]+_0x530221['countabandonedretry']+_0x530221[_0xf625('0x9')]+_0x530221[_0xf625('0xa')];this[_0xf625('0x7')]=_0x530221[_0xf625('0x7')];this['countdropretry']=_0x530221['countdropretry'];this['countabandonedretry']=_0x530221[_0xf625('0xb')];this[_0xf625('0x9')]=_0x530221['countmachineretry'];this[_0xf625('0xa')]=_0x530221[_0xf625('0xa')];this[_0xf625('0x3')]=_0x530221[_0xf625('0x3')];this[_0xf625('0xc')]=_0x530221[_0xf625('0xc')];this['calleridnum']=_0x530221[_0xf625('0xd')];this[_0xf625('0xe')]=_0x530221[_0xf625('0xe')];this[_0xf625('0xf')]=_0x530221[_0xf625('0xf')];this['endtime']=_0x530221[_0xf625('0xf')];this[_0xf625('0x10')]=_0x530221[_0xf625('0x10')]||0x0;this[_0xf625('0x11')]=_0x530221[_0xf625('0x11')]||0x0;this['talktime']=_0x530221[_0xf625('0x12')]||0x0;this[_0xf625('0x13')]=_0x530221['callback'];this['callbackuniqueid']=_0x530221[_0xf625('0x14')];this['callbackat']=_0x530221[_0xf625('0x15')];this['recallme']=_0x530221[_0xf625('0x16')];this[_0xf625('0x17')]=_0x530221[_0xf625('0x17')];this[_0xf625('0x18')]=_0x530221[_0xf625('0x18')];this[_0xf625('0x19')]=_0x530221['UserId'];this['VoiceQueueId']=_0x530221[_0xf625('0x1a')];this[_0xf625('0x1b')]=_0x530221[_0xf625('0x1b')];this[_0xf625('0x1c')]=_0x530221['originatecalleridnum']||'';this[_0xf625('0x1d')]=_0x530221[_0xf625('0x1d')]||'';this['state']=_0x530221['state'];this[_0xf625('0x1e')]=_0x530221[_0xf625('0x1e')];}module[_0xf625('0x1f')]=Final; \ No newline at end of file +var _0xb1ce=['countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x4566e2,_0x1150c4){var _0x4d93a9=function(_0x22bf16){while(--_0x22bf16){_0x4566e2['push'](_0x4566e2['shift']());}};_0x4d93a9(++_0x1150c4);}(_0xb1ce,0x14b));var _0xeb1c=function(_0x102914,_0x14a7fa){_0x102914=_0x102914-0x0;var _0x2dc143=_0xb1ce[_0x102914];return _0x2dc143;};'use strict';function Final(_0x22d241){this['uniqueid']=_0x22d241['uniqueid'];this['scheduledat']=_0x22d241[_0xeb1c('0x0')];this[_0xeb1c('0x1')]=_0x22d241[_0xeb1c('0x1')];this[_0xeb1c('0x2')]=_0x22d241['type']===_0xeb1c('0x3')?'queue':_0x22d241['type'];this[_0xeb1c('0x4')]=_0x22d241[_0xeb1c('0x4')];this['countcongestionretry']=_0x22d241[_0xeb1c('0x5')];this[_0xeb1c('0x6')]=_0x22d241[_0xeb1c('0x6')];this[_0xeb1c('0x7')]=_0x22d241[_0xeb1c('0x4')]+_0x22d241[_0xeb1c('0x5')]+_0x22d241['countnoanswerretry']+_0x22d241[_0xeb1c('0x8')]+_0x22d241[_0xeb1c('0x9')]+_0x22d241['countabandonedretry']+_0x22d241[_0xeb1c('0xa')]+_0x22d241[_0xeb1c('0xb')];this[_0xeb1c('0x8')]=_0x22d241[_0xeb1c('0x8')];this[_0xeb1c('0x9')]=_0x22d241['countdropretry'];this[_0xeb1c('0xc')]=_0x22d241[_0xeb1c('0xc')];this['countmachineretry']=_0x22d241[_0xeb1c('0xa')];this['countagentrejectretry']=_0x22d241[_0xeb1c('0xb')];this['queue']=_0x22d241[_0xeb1c('0xd')];this[_0xeb1c('0xe')]=_0x22d241[_0xeb1c('0xe')];this[_0xeb1c('0xf')]=_0x22d241['calleridnum'];this[_0xeb1c('0x10')]=_0x22d241[_0xeb1c('0x10')];this[_0xeb1c('0x11')]=_0x22d241[_0xeb1c('0x11')];this[_0xeb1c('0x12')]=_0x22d241[_0xeb1c('0x11')];this['ringtime']=_0x22d241['ringtime']||0x0;this[_0xeb1c('0x13')]=_0x22d241[_0xeb1c('0x13')]||0x0;this['talktime']=_0x22d241[_0xeb1c('0x14')]||0x0;this[_0xeb1c('0x15')]=_0x22d241[_0xeb1c('0x15')];this['callbackuniqueid']=_0x22d241[_0xeb1c('0x16')];this[_0xeb1c('0x17')]=_0x22d241[_0xeb1c('0x17')];this[_0xeb1c('0x18')]=_0x22d241[_0xeb1c('0x18')];this[_0xeb1c('0x19')]=_0x22d241[_0xeb1c('0x19')];this[_0xeb1c('0x1a')]=_0x22d241[_0xeb1c('0x1a')];this[_0xeb1c('0x1b')]=_0x22d241[_0xeb1c('0x1b')];this['VoiceQueueId']=_0x22d241[_0xeb1c('0x1c')];this[_0xeb1c('0x1d')]=_0x22d241[_0xeb1c('0x1d')];this[_0xeb1c('0x1e')]=_0x22d241[_0xeb1c('0x1e')]||'';this[_0xeb1c('0x1f')]=_0x22d241[_0xeb1c('0x1f')]||'';this['state']=_0x22d241[_0xeb1c('0x20')];this['statedesc']=_0x22d241[_0xeb1c('0x21')];}module['exports']=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 ce2cc45..2083899 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 _0xf62d=['talktime','queue','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','scheduledat','type','campaigntype','outbound','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime'];(function(_0x280b1a,_0xc8c10c){var _0x2113d8=function(_0x38f074){while(--_0x38f074){_0x280b1a['push'](_0x280b1a['shift']());}};_0x2113d8(++_0xc8c10c);}(_0xf62d,0x1c4));var _0xdf62=function(_0x3031be,_0x2fa8b7){_0x3031be=_0x3031be-0x0;var _0x1784cb=_0xf62d[_0x3031be];return _0x1784cb;};'use strict';var moment=require(_0xdf62('0x0'));var utils=require(_0xdf62('0x1'));function Hangup(_0x306472,_0x51786f){this[_0xdf62('0x2')]=0x4;this[_0xdf62('0x3')]='Answer';this[_0xdf62('0x4')]=_0x306472['scheduledat'];this[_0xdf62('0x5')]=_0x306472[_0xdf62('0x5')];this[_0xdf62('0x6')]=_0x306472[_0xdf62('0x5')]===_0xdf62('0x7')?'queue':_0x306472['type'];this[_0xdf62('0x8')]=_0x306472[_0xdf62('0x8')]||![];this[_0xdf62('0x9')]=_0x306472[_0xdf62('0x9')];this['countcongestionretry']=_0x306472['countcongestionretry'];this[_0xdf62('0xa')]=_0x306472[_0xdf62('0xa')];this['countglobal']=_0x306472[_0xdf62('0x9')]+_0x306472['countcongestionretry']+_0x306472[_0xdf62('0xa')]+_0x306472[_0xdf62('0xb')]+_0x306472[_0xdf62('0xc')]+_0x306472[_0xdf62('0xd')]+_0x306472['countmachineretry']+_0x306472[_0xdf62('0xe')];this[_0xdf62('0xb')]=_0x306472[_0xdf62('0xb')];this[_0xdf62('0xc')]=_0x306472[_0xdf62('0xc')];this['countabandonedretry']=_0x306472[_0xdf62('0xd')];this[_0xdf62('0xf')]=_0x306472['countmachineretry'];this['countagentrejectretry']=_0x306472[_0xdf62('0xe')];this[_0xdf62('0x10')]=_0x51786f[_0xdf62('0x10')];this[_0xdf62('0x11')]=_0x306472[_0xdf62('0x12')];this[_0xdf62('0x13')]=_0x306472[_0xdf62('0x14')];this[_0xdf62('0x15')]=_0x306472[_0xdf62('0x15')];this[_0xdf62('0x16')]=_0x306472[_0xdf62('0x16')];this[_0xdf62('0x17')]=moment()[_0xdf62('0x18')](_0xdf62('0x19'));this['ringtime']=utils[_0xdf62('0x1a')](_0x306472[_0xdf62('0x16')],_0x306472[_0xdf62('0x15')]);this[_0xdf62('0x1b')]=0x0;this[_0xdf62('0x1c')]=utils[_0xdf62('0x1a')](this[_0xdf62('0x17')],_0x306472['responsetime']);this[_0xdf62('0x1d')]=_0x306472[_0xdf62('0x1d')];this[_0xdf62('0x1e')]='IVR';this[_0xdf62('0x1f')]=_0x51786f['cause-txt'];this[_0xdf62('0x20')]=_0x306472[_0xdf62('0x20')];this['callbackuniqueid']=_0x306472['callbackuniqueid'];this[_0xdf62('0x21')]=_0x306472[_0xdf62('0x21')];this[_0xdf62('0x22')]=_0x306472[_0xdf62('0x22')];this[_0xdf62('0x23')]=_0x306472[_0xdf62('0x23')];this[_0xdf62('0x24')]=_0x306472[_0xdf62('0x24')];this[_0xdf62('0x25')]=_0x306472[_0xdf62('0x25')];this[_0xdf62('0x26')]=_0x306472['VoiceQueueId'];this[_0xdf62('0x27')]=_0x306472[_0xdf62('0x27')];}module['exports']=Hangup; \ No newline at end of file +var _0x81dc=['exports','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x4918ee,_0x260e4e){var _0x53821c=function(_0x1e0b08){while(--_0x1e0b08){_0x4918ee['push'](_0x4918ee['shift']());}};_0x53821c(++_0x260e4e);}(_0x81dc,0xa9));var _0xc81d=function(_0x1be3b3,_0x4335ee){_0x1be3b3=_0x1be3b3-0x0;var _0x4f8b2d=_0x81dc[_0x1be3b3];return _0x4f8b2d;};'use strict';var moment=require('moment');var utils=require(_0xc81d('0x0'));function Hangup(_0x5e4014,_0x15ef18){this[_0xc81d('0x1')]=0x4;this[_0xc81d('0x2')]=_0xc81d('0x3');this[_0xc81d('0x4')]=_0x5e4014['scheduledat'];this[_0xc81d('0x5')]=_0x5e4014[_0xc81d('0x5')];this[_0xc81d('0x6')]=_0x5e4014['type']===_0xc81d('0x7')?_0xc81d('0x8'):_0x5e4014[_0xc81d('0x5')];this['amd']=_0x5e4014[_0xc81d('0x9')]||![];this['countbusyretry']=_0x5e4014[_0xc81d('0xa')];this[_0xc81d('0xb')]=_0x5e4014[_0xc81d('0xb')];this[_0xc81d('0xc')]=_0x5e4014[_0xc81d('0xc')];this[_0xc81d('0xd')]=_0x5e4014[_0xc81d('0xa')]+_0x5e4014[_0xc81d('0xb')]+_0x5e4014[_0xc81d('0xc')]+_0x5e4014[_0xc81d('0xe')]+_0x5e4014['countdropretry']+_0x5e4014[_0xc81d('0xf')]+_0x5e4014[_0xc81d('0x10')]+_0x5e4014[_0xc81d('0x11')];this[_0xc81d('0xe')]=_0x5e4014['countnosuchnumberretry'];this[_0xc81d('0x12')]=_0x5e4014['countdropretry'];this[_0xc81d('0xf')]=_0x5e4014[_0xc81d('0xf')];this[_0xc81d('0x10')]=_0x5e4014['countmachineretry'];this[_0xc81d('0x11')]=_0x5e4014[_0xc81d('0x11')];this[_0xc81d('0x13')]=_0x15ef18[_0xc81d('0x13')];this[_0xc81d('0x14')]=_0x5e4014['name'];this[_0xc81d('0x15')]=_0x5e4014[_0xc81d('0x16')];this['starttime']=_0x5e4014[_0xc81d('0x17')];this['responsetime']=_0x5e4014[_0xc81d('0x18')];this[_0xc81d('0x19')]=moment()[_0xc81d('0x1a')](_0xc81d('0x1b'));this[_0xc81d('0x1c')]=utils[_0xc81d('0x1d')](_0x5e4014[_0xc81d('0x18')],_0x5e4014['starttime']);this['holdtime']=0x0;this[_0xc81d('0x1e')]=utils[_0xc81d('0x1d')](this['endtime'],_0x5e4014[_0xc81d('0x18')]);this[_0xc81d('0x8')]=_0x5e4014[_0xc81d('0x8')];this[_0xc81d('0x1f')]='IVR';this['reason']=_0x15ef18[_0xc81d('0x20')];this['callback']=_0x5e4014[_0xc81d('0x21')];this[_0xc81d('0x22')]=_0x5e4014[_0xc81d('0x22')];this[_0xc81d('0x23')]=_0x5e4014[_0xc81d('0x23')];this['recallme']=_0x5e4014['recallme'];this[_0xc81d('0x24')]=_0x5e4014[_0xc81d('0x24')];this['ListId']=_0x5e4014[_0xc81d('0x25')];this[_0xc81d('0x26')]=_0x5e4014[_0xc81d('0x26')];this['VoiceQueueId']=_0x5e4014[_0xc81d('0x27')];this['CampaignId']=_0x5e4014[_0xc81d('0x28')];}module[_0xc81d('0x29')]=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 111b3a4..b64c2d5 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 _0xe4c1=['calleridname','name','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xe4c1,0x146));var _0x1e4c=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0xe4c1[_0x4ae829];return _0x256b31;};'use strict';var utils=require(_0x1e4c('0x0'));function History(_0x20483d){this[_0x1e4c('0x1')]=_0x20483d[_0x1e4c('0x1')];this[_0x1e4c('0x2')]=_0x20483d['scheduledat']||undefined;this['type']=_0x20483d[_0x1e4c('0x3')];this[_0x1e4c('0x4')]=_0x20483d[_0x1e4c('0x3')]===_0x1e4c('0x5')?'queue':_0x20483d[_0x1e4c('0x3')];this['countbusyretry']=_0x20483d['countbusyretry'];this[_0x1e4c('0x6')]=_0x20483d[_0x1e4c('0x6')];this[_0x1e4c('0x7')]=_0x20483d[_0x1e4c('0x7')];this[_0x1e4c('0x8')]=_0x20483d[_0x1e4c('0x9')]+_0x20483d[_0x1e4c('0x6')]+_0x20483d[_0x1e4c('0x7')]+_0x20483d[_0x1e4c('0xa')]+_0x20483d['countdropretry']+_0x20483d['countabandonedretry']+_0x20483d[_0x1e4c('0xb')]+_0x20483d[_0x1e4c('0xc')];this[_0x1e4c('0xa')]=_0x20483d[_0x1e4c('0xa')];this['countdropretry']=_0x20483d[_0x1e4c('0xd')];this[_0x1e4c('0xe')]=_0x20483d[_0x1e4c('0xe')];this['countmachineretry']=_0x20483d[_0x1e4c('0xb')];this[_0x1e4c('0xc')]=_0x20483d['countagentrejectretry'];this[_0x1e4c('0xf')]=_0x20483d[_0x1e4c('0xf')];this[_0x1e4c('0x10')]=_0x20483d[_0x1e4c('0x11')];this['calleridnum']=_0x20483d[_0x1e4c('0x12')];this[_0x1e4c('0x13')]=_0x20483d[_0x1e4c('0x13')];this['responsetime']=_0x20483d[_0x1e4c('0x14')];this[_0x1e4c('0x15')]=_0x20483d['responsetime'];this[_0x1e4c('0x16')]=utils[_0x1e4c('0x17')](_0x20483d[_0x1e4c('0x14')],_0x20483d[_0x1e4c('0x13')]);this['holdtime']=0x0;this[_0x1e4c('0x18')]=0x0;this[_0x1e4c('0x19')]=_0x20483d[_0x1e4c('0x19')];this[_0x1e4c('0x1a')]=_0x20483d['callbackuniqueid'];this['callbackat']=_0x20483d['callbackat'];this[_0x1e4c('0x1b')]=_0x20483d[_0x1e4c('0x1b')];this[_0x1e4c('0x1c')]=_0x20483d['ContactId'];this[_0x1e4c('0x1d')]=_0x20483d[_0x1e4c('0x1d')];this[_0x1e4c('0x1e')]=_0x20483d[_0x1e4c('0x1e')];this[_0x1e4c('0x1f')]=_0x20483d[_0x1e4c('0x1f')];this['CampaignId']=_0x20483d[_0x1e4c('0x20')];this[_0x1e4c('0x21')]=_0x20483d[_0x1e4c('0x21')]||'';this[_0x1e4c('0x22')]=_0x20483d[_0x1e4c('0x22')]||'';this['state']=_0x20483d[_0x1e4c('0x23')];this[_0x1e4c('0x24')]=_0x20483d['statedesc'];}module[_0x1e4c('0x25')]=History; \ No newline at end of file +var _0xed23=['countnosuchnumberretry','countdropretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','getSeconds','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x41d697,_0xc4b40b){var _0x3b4832=function(_0x2b2583){while(--_0x2b2583){_0x41d697['push'](_0x41d697['shift']());}};_0x3b4832(++_0xc4b40b);}(_0xed23,0xf6));var _0x3ed2=function(_0x6b05ae,_0x1b6ca0){_0x6b05ae=_0x6b05ae-0x0;var _0x3cd3bb=_0xed23[_0x6b05ae];return _0x3cd3bb;};'use strict';var utils=require(_0x3ed2('0x0'));function History(_0x3a2f44){this[_0x3ed2('0x1')]=_0x3a2f44[_0x3ed2('0x1')];this[_0x3ed2('0x2')]=_0x3a2f44[_0x3ed2('0x2')]||undefined;this[_0x3ed2('0x3')]=_0x3a2f44['type'];this[_0x3ed2('0x4')]=_0x3a2f44[_0x3ed2('0x3')]===_0x3ed2('0x5')?_0x3ed2('0x6'):_0x3a2f44[_0x3ed2('0x3')];this[_0x3ed2('0x7')]=_0x3a2f44[_0x3ed2('0x7')];this[_0x3ed2('0x8')]=_0x3a2f44[_0x3ed2('0x8')];this['countnoanswerretry']=_0x3a2f44['countnoanswerretry'];this[_0x3ed2('0x9')]=_0x3a2f44[_0x3ed2('0x7')]+_0x3a2f44['countcongestionretry']+_0x3a2f44['countnoanswerretry']+_0x3a2f44['countnosuchnumberretry']+_0x3a2f44['countdropretry']+_0x3a2f44[_0x3ed2('0xa')]+_0x3a2f44[_0x3ed2('0xb')]+_0x3a2f44[_0x3ed2('0xc')];this[_0x3ed2('0xd')]=_0x3a2f44[_0x3ed2('0xd')];this['countdropretry']=_0x3a2f44[_0x3ed2('0xe')];this[_0x3ed2('0xa')]=_0x3a2f44[_0x3ed2('0xa')];this[_0x3ed2('0xb')]=_0x3a2f44[_0x3ed2('0xb')];this[_0x3ed2('0xc')]=_0x3a2f44['countagentrejectretry'];this[_0x3ed2('0x6')]=_0x3a2f44['queue'];this[_0x3ed2('0xf')]=_0x3a2f44[_0x3ed2('0x10')];this['calleridnum']=_0x3a2f44[_0x3ed2('0x11')];this[_0x3ed2('0x12')]=_0x3a2f44[_0x3ed2('0x12')];this[_0x3ed2('0x13')]=_0x3a2f44[_0x3ed2('0x13')];this[_0x3ed2('0x14')]=_0x3a2f44['responsetime'];this[_0x3ed2('0x15')]=utils[_0x3ed2('0x16')](_0x3a2f44[_0x3ed2('0x13')],_0x3a2f44[_0x3ed2('0x12')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x3ed2('0x17')]=_0x3a2f44[_0x3ed2('0x17')];this[_0x3ed2('0x18')]=_0x3a2f44[_0x3ed2('0x18')];this[_0x3ed2('0x19')]=_0x3a2f44['callbackat'];this[_0x3ed2('0x1a')]=_0x3a2f44[_0x3ed2('0x1a')];this[_0x3ed2('0x1b')]=_0x3a2f44['ContactId'];this[_0x3ed2('0x1c')]=_0x3a2f44[_0x3ed2('0x1c')];this[_0x3ed2('0x1d')]=_0x3a2f44['UserId'];this[_0x3ed2('0x1e')]=_0x3a2f44['VoiceQueueId'];this[_0x3ed2('0x1f')]=_0x3a2f44['CampaignId'];this['originatecalleridnum']=_0x3a2f44[_0x3ed2('0x20')]||'';this[_0x3ed2('0x21')]=_0x3a2f44[_0x3ed2('0x21')]||'';this[_0x3ed2('0x22')]=_0x3a2f44[_0x3ed2('0x22')];this[_0x3ed2('0x23')]=_0x3a2f44[_0x3ed2('0x23')];}module[_0x3ed2('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 69dc502..0bd944e 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 _0x2d6e=['exports','../utils','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','starttime','droptime','dropreason','endtime','ringtime','getSeconds','responsetime','holdtime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc'];(function(_0x3868fb,_0x581e03){var _0x4521dc=function(_0x201fa0){while(--_0x201fa0){_0x3868fb['push'](_0x3868fb['shift']());}};_0x4521dc(++_0x581e03);}(_0x2d6e,0x82));var _0xe2d6=function(_0x39b632,_0x42d395){_0x39b632=_0x39b632-0x0;var _0x2112bd=_0x2d6e[_0x39b632];return _0x2112bd;};'use strict';var utils=require(_0xe2d6('0x0'));function QueueCallerAbandon(_0x775128,_0x334ccf){this[_0xe2d6('0x1')]=_0x775128[_0xe2d6('0x1')];this['type']=_0x775128['type'];this[_0xe2d6('0x2')]=_0x775128[_0xe2d6('0x3')]===_0xe2d6('0x4')?'queue':_0x775128['type'];this[_0xe2d6('0x5')]=_0x775128[_0xe2d6('0x5')];this['countcongestionretry']=_0x775128[_0xe2d6('0x6')];this['countnoanswerretry']=_0x775128['countnoanswerretry'];this['countglobal']=_0x775128['countbusyretry']+_0x775128[_0xe2d6('0x6')]+_0x775128[_0xe2d6('0x7')]+_0x775128[_0xe2d6('0x8')]+_0x775128['countdropretry']+_0x775128['countabandonedretry']+_0x775128['countmachineretry']+_0x775128[_0xe2d6('0x9')];this[_0xe2d6('0x8')]=_0x775128[_0xe2d6('0x8')];this[_0xe2d6('0xa')]=_0x775128['countdropretry'];this[_0xe2d6('0xb')]=_0x775128[_0xe2d6('0xb')];this[_0xe2d6('0xc')]=_0x775128[_0xe2d6('0xc')];this['countagentrejectretry']=_0x775128['countagentrejectretry'];this[_0xe2d6('0xd')]=_0x334ccf[_0xe2d6('0xd')];this['calleridname']=_0x775128[_0xe2d6('0xe')];this[_0xe2d6('0xf')]=_0x775128['number'];this[_0xe2d6('0x10')]=_0x775128['starttime'];this['responsetime']=_0x775128['responsetime'];this[_0xe2d6('0x11')]=_0x775128['droptime'];this[_0xe2d6('0x12')]=_0x775128['dropreason'];this[_0xe2d6('0x13')]=this[_0xe2d6('0x11')];this[_0xe2d6('0x14')]=utils[_0xe2d6('0x15')](_0x775128[_0xe2d6('0x16')],_0x775128[_0xe2d6('0x10')]);this[_0xe2d6('0x17')]=utils[_0xe2d6('0x15')](this[_0xe2d6('0x11')],_0x775128[_0xe2d6('0x16')]);this[_0xe2d6('0x18')]=0x0;this[_0xe2d6('0x19')]=_0x334ccf[_0xe2d6('0x19')];this['membername']=_0x334ccf[_0xe2d6('0x1a')];this['reason']=_0x334ccf[_0xe2d6('0x1b')];this[_0xe2d6('0x1c')]=_0x775128['callback'];this[_0xe2d6('0x1d')]=_0x775128[_0xe2d6('0x1d')];this[_0xe2d6('0x1e')]=_0x775128[_0xe2d6('0x1e')];this[_0xe2d6('0x1f')]=_0x775128['recallme'];this['ContactId']=_0x775128[_0xe2d6('0x20')];this[_0xe2d6('0x21')]=_0x775128[_0xe2d6('0x21')];this[_0xe2d6('0x22')]=_0x775128[_0xe2d6('0x22')];this['VoiceQueueId']=_0x775128[_0xe2d6('0x23')];this[_0xe2d6('0x24')]=_0x775128[_0xe2d6('0x24')];this[_0xe2d6('0x25')]=_0x775128[_0xe2d6('0x25')]||'';this[_0xe2d6('0x26')]=_0x775128[_0xe2d6('0x26')]||'';this[_0xe2d6('0x27')]=_0x775128['agiafterat'];this[_0xe2d6('0x28')]=_0x775128[_0xe2d6('0x28')];this[_0xe2d6('0x29')]=_0x775128[_0xe2d6('0x29')];}module[_0xe2d6('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0x8b90=['type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','getSeconds','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8b90,0x10c));var _0x08b9=function(_0x11392d,_0x2336c9){_0x11392d=_0x11392d-0x0;var _0x478fa8=_0x8b90[_0x11392d];return _0x478fa8;};'use strict';var utils=require(_0x08b9('0x0'));function QueueCallerAbandon(_0x5ba67d,_0x43e560){this[_0x08b9('0x1')]=_0x5ba67d[_0x08b9('0x1')];this[_0x08b9('0x2')]=_0x5ba67d['type'];this[_0x08b9('0x3')]=_0x5ba67d[_0x08b9('0x2')]===_0x08b9('0x4')?_0x08b9('0x5'):_0x5ba67d[_0x08b9('0x2')];this['countbusyretry']=_0x5ba67d[_0x08b9('0x6')];this[_0x08b9('0x7')]=_0x5ba67d[_0x08b9('0x7')];this['countnoanswerretry']=_0x5ba67d[_0x08b9('0x8')];this[_0x08b9('0x9')]=_0x5ba67d[_0x08b9('0x6')]+_0x5ba67d[_0x08b9('0x7')]+_0x5ba67d[_0x08b9('0x8')]+_0x5ba67d[_0x08b9('0xa')]+_0x5ba67d[_0x08b9('0xb')]+_0x5ba67d[_0x08b9('0xc')]+_0x5ba67d[_0x08b9('0xd')]+_0x5ba67d[_0x08b9('0xe')];this['countnosuchnumberretry']=_0x5ba67d[_0x08b9('0xa')];this['countdropretry']=_0x5ba67d['countdropretry'];this[_0x08b9('0xc')]=_0x5ba67d[_0x08b9('0xc')];this['countmachineretry']=_0x5ba67d[_0x08b9('0xd')];this[_0x08b9('0xe')]=_0x5ba67d[_0x08b9('0xe')];this['uniqueid']=_0x43e560[_0x08b9('0xf')];this[_0x08b9('0x10')]=_0x5ba67d[_0x08b9('0x11')];this[_0x08b9('0x12')]=_0x5ba67d[_0x08b9('0x13')];this[_0x08b9('0x14')]=_0x5ba67d['starttime'];this[_0x08b9('0x15')]=_0x5ba67d[_0x08b9('0x15')];this[_0x08b9('0x16')]=_0x5ba67d[_0x08b9('0x16')];this[_0x08b9('0x17')]=_0x5ba67d[_0x08b9('0x17')];this['endtime']=this[_0x08b9('0x16')];this[_0x08b9('0x18')]=utils[_0x08b9('0x19')](_0x5ba67d['responsetime'],_0x5ba67d[_0x08b9('0x14')]);this[_0x08b9('0x1a')]=utils[_0x08b9('0x19')](this[_0x08b9('0x16')],_0x5ba67d[_0x08b9('0x15')]);this[_0x08b9('0x1b')]=0x0;this[_0x08b9('0x5')]=_0x43e560['queue'];this['membername']=_0x43e560[_0x08b9('0x1c')];this[_0x08b9('0x1d')]=_0x43e560['reason'];this['callback']=_0x5ba67d[_0x08b9('0x1e')];this['callbackuniqueid']=_0x5ba67d[_0x08b9('0x1f')];this[_0x08b9('0x20')]=_0x5ba67d[_0x08b9('0x20')];this['recallme']=_0x5ba67d[_0x08b9('0x21')];this[_0x08b9('0x22')]=_0x5ba67d[_0x08b9('0x22')];this[_0x08b9('0x23')]=_0x5ba67d['ListId'];this[_0x08b9('0x24')]=_0x5ba67d[_0x08b9('0x24')];this[_0x08b9('0x25')]=_0x5ba67d[_0x08b9('0x25')];this[_0x08b9('0x26')]=_0x5ba67d['CampaignId'];this['originatecalleridnum']=_0x5ba67d[_0x08b9('0x27')]||'';this[_0x08b9('0x28')]=_0x5ba67d[_0x08b9('0x28')]||'';this['agiafterat']=_0x5ba67d[_0x08b9('0x29')];this[_0x08b9('0x2a')]=_0x5ba67d[_0x08b9('0x2a')];this[_0x08b9('0x2b')]=_0x5ba67d['statedesc'];}module[_0x08b9('0x2c')]=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 c136ef4..e51ae7c 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 _0xb091=['swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','[countReScheduled]','countReScheduled','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones'];(function(_0x2faf3a,_0x14d2bb){var _0x382dbd=function(_0x84733a){while(--_0x84733a){_0x2faf3a['push'](_0x2faf3a['shift']());}};_0x382dbd(++_0x14d2bb);}(_0xb091,0x16e));var _0x1b09=function(_0xc76ee1,_0x294b4b){_0xc76ee1=_0xc76ee1-0x0;var _0xf866a=_0xb091[_0xc76ee1];return _0xf866a;};'use strict';var util=require('util');var logger=require(_0x1b09('0x0'))(_0x1b09('0x1'));var cmHopper=require(_0x1b09('0x2'));var cmHopperAdditionalPhone=require(_0x1b09('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x1b09('0x4'));function inspectError(_0x59af61){return util['inspect'](_0x59af61,{'showHidden':![],'depth':null});}function getContactDialer(_0x295863,_0x24d22c,_0x4e252c){return cmHopper[_0x1b09('0x5')](_0x295863['id'],_0x24d22c,_0x4e252c,_0x295863[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x5ce726){_0x295863[_0x1b09('0x8')]=0x0;logger[_0x1b09('0x9')](_0x1b09('0xa'),inspectError(_0x5ce726));});}exports[_0x1b09('0x5')]=getContactDialer;function getContactDialerIvr(_0x159b95,_0x3362e4){return cmHopper[_0x1b09('0xb')](_0x159b95['id'],_0x3362e4,_0x159b95[_0x1b09('0x6')])[_0x1b09('0x7')](function(_0x36aa1b){_0x159b95[_0x1b09('0x8')]=0x0;logger['error'](_0x1b09('0xc'),inspectError(_0x36aa1b));});}exports[_0x1b09('0xb')]=getContactDialerIvr;function countReScheduled(_0x5690cb){return cmHopper['countReScheduled'](_0x5690cb)[_0x1b09('0x7')](function(_0x4284ad){logger[_0x1b09('0x9')](_0x1b09('0xd'),inspectError(_0x4284ad));});}exports[_0x1b09('0xe')]=countReScheduled;function rescheduleContact(_0x3a44f1){return cmHopper[_0x1b09('0xf')](_0x3a44f1)['catch'](function(_0x37fdb2){logger['error'](_0x1b09('0x10'),inspectError(_0x37fdb2));});}exports[_0x1b09('0xf')]=rescheduleContact;function unlockContact(_0x11ab46,_0x37673e,_0x10b7eb){return cmHopper[_0x1b09('0x11')](_0x11ab46,_0x37673e,_0x10b7eb)[_0x1b09('0x7')](function(_0x33129b){logger[_0x1b09('0x9')](_0x1b09('0x12'),inspectError(_0x33129b));});}exports[_0x1b09('0x11')]=unlockContact;function moveContactManagedDialer(_0x231ef6){return cmHopper[_0x1b09('0x13')](_0x231ef6)['catch'](function(_0x214c6b){logger[_0x1b09('0x9')]('[moveContactManagedDialer]',inspectError(_0x214c6b));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0xe93ac4){return cmHopperBlack['checkIsBlackList'](_0xe93ac4)[_0x1b09('0x7')](function(_0x5bb127){logger[_0x1b09('0x9')](_0x1b09('0x14'),inspectError(_0x5bb127));});}exports[_0x1b09('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x1e8f97){return cmHopperBlack[_0x1b09('0x16')](_0x1e8f97)[_0x1b09('0x7')](function(_0x363e78){logger[_0x1b09('0x9')]('[checkIsBlackListIvr]',inspectError(_0x363e78));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0x27f4f5,_0x41c786,_0x4ce7dc){return cmHopperAdditionalPhone[_0x1b09('0x17')](_0x27f4f5,_0x41c786,_0x4ce7dc)[_0x1b09('0x7')](function(_0x6e132c){logger[_0x1b09('0x9')]('[verifyAdditionalPhone]',inspectError(_0x6e132c));});}exports[_0x1b09('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x15be49,_0x4936d0,_0x2d3b86){return cmHopperAdditionalPhone[_0x1b09('0x18')](_0x15be49,_0x4936d0,_0x2d3b86)['catch'](function(_0x13c89c){logger[_0x1b09('0x9')](_0x1b09('0x19'),inspectError(_0x13c89c));});}exports[_0x1b09('0x18')]=swapAdditionalPhones;function avgHandleTime(_0x547fbb){return cmHopperHistory[_0x1b09('0x1a')](_0x547fbb)[_0x1b09('0x7')](function(_0x532589){logger[_0x1b09('0x9')](_0x1b09('0x1b'),inspectError(_0x532589));});}exports[_0x1b09('0x1a')]=avgHandleTime;function createHistory(_0x1cbbd5){return cmHopperHistory[_0x1b09('0x1c')](_0x1cbbd5)[_0x1b09('0x7')](function(_0x34620f){logger['error'](_0x1b09('0x1d'),inspectError(_0x34620f));});}exports[_0x1b09('0x1c')]=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(_0x4763f7,_0x7c6950){var _0x5d419e=function(_0x593f4b){while(--_0x593f4b){_0x4763f7['push'](_0x4763f7['shift']());}};_0x5d419e(++_0x7c6950);}(_0x5fab,0x177));var _0xb5fa=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x5fab[_0x2a8c21];return _0x5f3061;};'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 492c471..7dcb19a 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 _0x6911=['dialMethod','preview','isPreviewCampaign','ivr','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','checkContactEmpty','tags','updatedAt','undefined','length','XMD-','toUpperCase','substring','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS'];(function(_0x5ea4b8,_0xbdefdb){var _0x192963=function(_0x28b777){while(--_0x28b777){_0x5ea4b8['push'](_0x5ea4b8['shift']());}};_0x192963(++_0xbdefdb);}(_0x6911,0x190));var _0x1691=function(_0x3a5a1a,_0x5f428e){_0x3a5a1a=_0x3a5a1a-0x0;var _0x2b6fa9=_0x6911[_0x3a5a1a];return _0x2b6fa9;};'use strict';var _=require(_0x1691('0x0'));var moment=require(_0x1691('0x1'));var util=require(_0x1691('0x2'));var logger=require(_0x1691('0x3'))(_0x1691('0x4'));var timezones=require(_0x1691('0x5'))[_0x1691('0x6')];var CAMPAIGN_STATUS={'ACTIVE':_0x1691('0x7'),'BLACKLIST':_0x1691('0x8'),'CONTACTS_RESCHEDULED':_0x1691('0x9'),'DEACTIVATED':_0x1691('0xa'),'DISACTIVED':_0x1691('0xb'),'EMPTY_INTERVAL':_0x1691('0xc'),'INACTIVE':_0x1691('0xd'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':_0x1691('0xe'),'OVERTIME_INTERVAL':_0x1691('0xf'),'OVERTIME_GLOBAL_INTERVAL':_0x1691('0x10'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':'RUNNING','UNKNOWN_TIMEZONE':_0x1691('0x11'),'UNREACHABLE_TRUNK':_0x1691('0x12')};exports[_0x1691('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x43d280){return _0x43d280[_0x1691('0x14')]===_0x1691('0x15');}exports[_0x1691('0x16')]=isPreviewCampaign;function isIVRCampaign(_0xefc798){return _0xefc798['type']===_0x1691('0x17');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x25a4e1){return _0x25a4e1['type']==='outbound';}exports[_0x1691('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x3501b3){return _0x3501b3[_0x1691('0x19')];}exports[_0x1691('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x24d557){return _0x24d557[_0x1691('0x1b')];}exports[_0x1691('0x1c')]=isIVRCampaignActive;function getSeconds(_0x5e102b,_0x2e4686){var _0x74bd6a=moment(_0x5e102b)[_0x1691('0x1d')](0x0);var _0x51fca6=moment(_0x2e4686)['milliseconds'](0x0);return _0x74bd6a[_0x1691('0x1e')](_0x51fca6,'seconds');}exports[_0x1691('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x163719,_0xd3ec87){var _0x46deaa=![];var _0x2fa296=_0x163719['dialMethod']!==_0xd3ec87[_0x1691('0x14')]||_0x163719[_0x1691('0x19')]!==_0xd3ec87[_0x1691('0x19')]||_0x163719[_0x1691('0x20')]!==_0xd3ec87[_0x1691('0x20')];var _0x18a977=_0x163719[_0x1691('0x21')]!==_0xd3ec87[_0x1691('0x21')]||_0x163719['loggedIn']!==_0xd3ec87[_0x1691('0x22')]||_0x163719[_0x1691('0x23')]!==_0xd3ec87[_0x1691('0x23')]||_0x163719['paused']!==_0xd3ec87[_0x1691('0x24')]||_0x163719[_0x1691('0x25')]!==_0xd3ec87[_0x1691('0x25')]||_0x163719[_0x1691('0x26')]!==_0xd3ec87[_0x1691('0x26')]||_0x163719[_0x1691('0x27')]!==_0xd3ec87[_0x1691('0x27')]||_0x163719[_0x1691('0x28')]!==_0xd3ec87[_0x1691('0x28')]||_0x163719[_0x1691('0x29')]!==_0xd3ec87[_0x1691('0x29')];if(_0x163719[_0x1691('0x2a')]&&_0xd3ec87[_0x1691('0x2a')]){_0x46deaa=_0x163719['Trunk'][_0x1691('0x2b')]!==_0xd3ec87[_0x1691('0x2a')][_0x1691('0x2b')]||_0x163719[_0x1691('0x2a')][_0x1691('0x1b')]!==_0xd3ec87[_0x1691('0x2a')][_0x1691('0x1b')];}return _0x2fa296||_0x18a977||_0x46deaa;}exports[_0x1691('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1f95b4){var _0xed3afd=null;var _0x5d43d3=_0x1f95b4[_0x1691('0x2d')];if(_[_0x1691('0x2e')](_0x1f95b4[_0x1691('0x2f')])||_[_0x1691('0x2e')](_0x1f95b4[_0x1691('0x30')])||_[_0x1691('0x2e')](_0x1f95b4['Interval']['Intervals'])){_0xed3afd=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x1f95b4[_0x1691('0x2f')])||_[_0x1691('0x31')](_0x1f95b4[_0x1691('0x30')]['Intervals'])){_0xed3afd=CAMPAIGN_STATUS[_0x1691('0x32')];}else if(_0x5d43d3&&!timezones[_0x5d43d3]){_0xed3afd=CAMPAIGN_STATUS[_0x1691('0x33')];}return _0xed3afd;}function checkAnyValidTrunk(_0x1740ea,_0x109ec2){var _0x3b9a8b=null;var _0x5b2551=_0x1691('0x34');var _0x359e0b=[_0x1691('0x35'),'unmonitored'];var _0x390cc9=!![];if(_0x1740ea['Trunk']&&_0x1740ea[_0x1691('0x2a')][_0x1691('0x1b')]){_0x5b2551+=_0x1740ea[_0x1691('0x2a')][_0x1691('0x2b')];_0x3b9a8b=_0x109ec2[_0x5b2551];_0x390cc9=_0x359e0b[_0x1691('0x36')](_0x3b9a8b[_0x1691('0x37')]);}else if(_0x1740ea[_0x1691('0x38')]&&_0x1740ea['TrunkBackup'][_0x1691('0x1b')]){_0x5b2551+=_0x1740ea[_0x1691('0x38')]['name'];_0x3b9a8b=_0x109ec2[_0x5b2551];_0x390cc9=_0x359e0b['includes'](_0x3b9a8b[_0x1691('0x37')]);}return _0x390cc9;}function getQueueCampaignStatusMessage(_0x1bec1e,_0xb1700b){var _0x3aae18=CAMPAIGN_STATUS[_0x1691('0x7')];var _0x2e64b9=isPreviewCampaign(_0x1bec1e);if(!isQueueCampaignActive(_0x1bec1e)){if(_0x2e64b9){_0x3aae18=CAMPAIGN_STATUS[_0x1691('0x39')];}else{if(_0x1bec1e[_0x1691('0x29')]===0x0&&_0x1bec1e['talking']===0x0&&_0x1bec1e[_0x1691('0x27')]===0x0&&(_0x1bec1e[_0x1691('0x26')]||0x0)===0x0){_0x3aae18=CAMPAIGN_STATUS['INACTIVE'];}else{_0x3aae18=CAMPAIGN_STATUS[_0x1691('0x3a')];}}}else if(_0x1bec1e[_0x1691('0x22')]===0x0){_0x3aae18=CAMPAIGN_STATUS[_0x1691('0x3b')];}else if(!checkAnyValidTrunk(_0x1bec1e,_0xb1700b)){_0x3aae18=CAMPAIGN_STATUS[_0x1691('0x3c')];}else if(!isPreviewCampaign(_0x1bec1e)){var _0x293b82=checkAnyValidQueueCampaignInterval(_0x1bec1e);if(_0x293b82){_0x3aae18=_0x293b82;}}return _0x3aae18;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x1ea144){var _0x5bcf19=CAMPAIGN_STATUS[_0x1691('0x3a')];if(_0x1ea144[_0x1691('0x29')]===0x0&&_0x1ea144[_0x1691('0x25')]===0x0&&_0x1ea144[_0x1691('0x27')]===0x0&&(_0x1ea144[_0x1691('0x26')]||0x0)===0x0){_0x5bcf19=CAMPAIGN_STATUS[_0x1691('0x39')];}return _0x5bcf19;}exports[_0x1691('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x35ae3c){var _0x1a9dfd=_0x35ae3c['match'](/"(.*?)"/);return _0x1a9dfd?_0x1a9dfd[0x1]:_0x35ae3c;}exports[_0x1691('0x3e')]=extractCalleridName;function getCallerId(_0x19184d,_0x58411f,_0x1597e9){if(!_[_0x1691('0x3f')](_0x1597e9)&&typeof _0x1597e9==='string'&&!_[_0x1691('0x31')](_0x1597e9)){if(!_[_0x1691('0x3f')](_0x58411f)&&typeof _0x58411f===_0x1691('0x40')&&!_['isEmpty'](_0x58411f)){return util[_0x1691('0x41')](_0x1691('0x42'),_0x58411f,_0x1597e9);}return util[_0x1691('0x41')](_0x1691('0x42'),_0x1597e9,_0x1597e9);}if(!_['isUndefined'](_0x19184d)&&typeof _0x19184d===_0x1691('0x40')&&!_[_0x1691('0x31')](_0x19184d)){return _0x19184d;}return'\x22\x22\x20<>';}exports[_0x1691('0x43')]=getCallerId;function getCallerIdRandom(_0x390971,_0x39cd1d){var _0xa86d9b;var _0x4e9af5;var _0x4c5119;if(_0x39cd1d<=0x0){_0x39cd1d=0x1;}_0xa86d9b=new RegExp('\x5cw{0,'+_0x39cd1d+'}$');_0x4e9af5=Math['pow'](0xa,_0x39cd1d-0x1);_0x4c5119=Math[_0x1691('0x44')](0xa,_0x39cd1d)-0x1;return util[_0x1691('0x41')]('%s',_[_0x1691('0x45')](_0x390971,_0xa86d9b,_[_0x1691('0x46')](_0x4e9af5,_0x4c5119)[_0x1691('0x47')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x5a1bfd){if(_0x5a1bfd['originated']&&_0x5a1bfd[_0x1691('0x29')]>0x0){_0x5a1bfd[_0x1691('0x29')]-=0x1;}else{logger[_0x1691('0x48')](_0x1691('0x49'));}}exports[_0x1691('0x4a')]=decrementOriginate;function checkContactEmpty(_0x52e64b){return _0x52e64b&&_0x52e64b['length']>0x0;}exports[_0x1691('0x4b')]=checkContactEmpty;function erlangb(_0xfdc4c,_0xee3b85){if(_0xee3b85===0x0){return 0x0;}var _0x18d48a=0x1;for(var _0x443b36=0x1;_0x443b36<=_0xee3b85;_0x443b36+=0x1){_0x18d48a=0x1+_0x18d48a*_0x443b36/_0xfdc4c;}return 0x1/_0x18d48a;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x4f7d33,_0x38fa3f,_0x14be26){if(_0x38fa3f>_0x14be26){for(var _0x43508b=0x0;_0x43508b<_0x38fa3f-_0x14be26;_0x43508b+=0x1){decrementOriginate(_0x4f7d33);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x31e680){var _0x5d791c={};var _0x1de8d8=['id','createdAt',_0x1691('0x4c'),_0x1691('0x4d')];const _0x4f1493=0xfa;if(_0x31e680){for(var _0x270249 in _0x31e680){if(typeof _0x31e680[_0x270249]!==_0x1691('0x4e')){if(!_[_0x1691('0x2e')](_0x31e680[_0x270249])&&!_0x1de8d8[_0x1691('0x36')](_0x270249)){if(_0x270249==='description'&&_0x31e680[_0x270249][_0x1691('0x4f')]>_0x4f1493){_0x5d791c[_0x1691('0x50')+_0x270249[_0x1691('0x51')]()]=_0x31e680[_0x270249][_0x1691('0x47')]()[_0x1691('0x52')](0x0,_0x4f1493);}else{_0x5d791c[_0x1691('0x50')+_0x270249[_0x1691('0x51')]()]=_0x31e680[_0x270249];}}}}}return _0x5d791c;}exports[_0x1691('0x53')]=setXMDContactVariables; \ No newline at end of file +var _0x80e1=['includes','status','TrunkBackup','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','timezones','ACTIVE','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','isIVRCampaignActive','milliseconds','getSeconds','dialMethod','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','active','hasQueueCampaignDataChanged','dialTimezone','isNil','dialGlobalInterval','Interval','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','unmonitored'];(function(_0x2275de,_0x1841af){var _0x5dafa2=function(_0x514ae3){while(--_0x514ae3){_0x2275de['push'](_0x2275de['shift']());}};_0x5dafa2(++_0x1841af);}(_0x80e1,0x1c8));var _0x180e=function(_0x1d841d,_0x492202){_0x1d841d=_0x1d841d-0x0;var _0x2f10fd=_0x80e1[_0x1d841d];return _0x2f10fd;};'use strict';var _=require(_0x180e('0x0'));var moment=require(_0x180e('0x1'));var util=require(_0x180e('0x2'));var logger=require(_0x180e('0x3'))('dialer');var timezones=require('../../../../config/environment/shared')[_0x180e('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0x180e('0x5'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x180e('0x6'),'DISACTIVED':_0x180e('0x7'),'EMPTY_INTERVAL':_0x180e('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x180e('0x9'),'NULL_INTERVAL':_0x180e('0xa'),'OVERTIME_INTERVAL':_0x180e('0xb'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x180e('0xc'),'RECALL_TIMEOUT':_0x180e('0xd'),'RUNNING':_0x180e('0xe'),'UNKNOWN_TIMEZONE':_0x180e('0xf'),'UNREACHABLE_TRUNK':_0x180e('0x10')};exports[_0x180e('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x143d31){return _0x143d31['dialMethod']===_0x180e('0x12');}exports[_0x180e('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x205ed3){return _0x205ed3[_0x180e('0x14')]===_0x180e('0x15');}exports[_0x180e('0x16')]=isIVRCampaign;function isOutboundQueue(_0x2ecca5){return _0x2ecca5[_0x180e('0x14')]===_0x180e('0x17');}exports[_0x180e('0x18')]=isOutboundQueue;function isQueueCampaignActive(_0x2b0065){return _0x2b0065[_0x180e('0x19')];}exports[_0x180e('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0xdaa011){return _0xdaa011['active'];}exports[_0x180e('0x1b')]=isIVRCampaignActive;function getSeconds(_0x3d18e5,_0x1ad1ce){var _0x59afbd=moment(_0x3d18e5)['milliseconds'](0x0);var _0x5740d9=moment(_0x1ad1ce)[_0x180e('0x1c')](0x0);return _0x59afbd['diff'](_0x5740d9,'seconds');}exports[_0x180e('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x55ecba,_0x5d7e70){var _0x4134b5=![];var _0x4d9dad=_0x55ecba[_0x180e('0x1e')]!==_0x5d7e70['dialMethod']||_0x55ecba[_0x180e('0x19')]!==_0x5d7e70[_0x180e('0x19')]||_0x55ecba[_0x180e('0x1f')]!==_0x5d7e70[_0x180e('0x1f')];var _0x581388=_0x55ecba[_0x180e('0x20')]!==_0x5d7e70[_0x180e('0x20')]||_0x55ecba[_0x180e('0x21')]!==_0x5d7e70['loggedIn']||_0x55ecba[_0x180e('0x22')]!==_0x5d7e70[_0x180e('0x22')]||_0x55ecba[_0x180e('0x23')]!==_0x5d7e70[_0x180e('0x23')]||_0x55ecba[_0x180e('0x24')]!==_0x5d7e70[_0x180e('0x24')]||_0x55ecba[_0x180e('0x25')]!==_0x5d7e70[_0x180e('0x25')]||_0x55ecba['waiting']!==_0x5d7e70[_0x180e('0x26')]||_0x55ecba[_0x180e('0x27')]!==_0x5d7e70[_0x180e('0x27')]||_0x55ecba[_0x180e('0x28')]!==_0x5d7e70['originated'];if(_0x55ecba[_0x180e('0x29')]&&_0x5d7e70['Trunk']){_0x4134b5=_0x55ecba[_0x180e('0x29')][_0x180e('0x2a')]!==_0x5d7e70[_0x180e('0x29')][_0x180e('0x2a')]||_0x55ecba[_0x180e('0x29')][_0x180e('0x2b')]!==_0x5d7e70['Trunk'][_0x180e('0x2b')];}return _0x4d9dad||_0x581388||_0x4134b5;}exports[_0x180e('0x2c')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x4ab1ba){var _0x24db9f=null;var _0x1df83f=_0x4ab1ba[_0x180e('0x2d')];if(_[_0x180e('0x2e')](_0x4ab1ba[_0x180e('0x2f')])||_[_0x180e('0x2e')](_0x4ab1ba[_0x180e('0x30')])||_['isNil'](_0x4ab1ba['Interval']['Intervals'])){_0x24db9f=CAMPAIGN_STATUS[_0x180e('0x31')];}else if(_[_0x180e('0x32')](_0x4ab1ba[_0x180e('0x2f')])||_[_0x180e('0x32')](_0x4ab1ba[_0x180e('0x30')]['Intervals'])){_0x24db9f=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x1df83f&&!timezones[_0x1df83f]){_0x24db9f=CAMPAIGN_STATUS[_0x180e('0x33')];}return _0x24db9f;}function checkAnyValidTrunk(_0x39a9fb,_0x48c617){var _0x23d80e=null;var _0x56f0a7=_0x180e('0x34');var _0x1e5dd9=['reachable',_0x180e('0x35')];var _0x1aaca7=!![];if(_0x39a9fb[_0x180e('0x29')]&&_0x39a9fb[_0x180e('0x29')][_0x180e('0x2b')]){_0x56f0a7+=_0x39a9fb[_0x180e('0x29')][_0x180e('0x2a')];_0x23d80e=_0x48c617[_0x56f0a7];_0x1aaca7=_0x1e5dd9[_0x180e('0x36')](_0x23d80e[_0x180e('0x37')]);}else if(_0x39a9fb[_0x180e('0x38')]&&_0x39a9fb[_0x180e('0x38')]['active']){_0x56f0a7+=_0x39a9fb[_0x180e('0x38')][_0x180e('0x2a')];_0x23d80e=_0x48c617[_0x56f0a7];_0x1aaca7=_0x1e5dd9[_0x180e('0x36')](_0x23d80e[_0x180e('0x37')]);}return _0x1aaca7;}function getQueueCampaignStatusMessage(_0x332afc,_0x54bccd){var _0x186fce=CAMPAIGN_STATUS['ACTIVE'];var _0x1f6e46=isPreviewCampaign(_0x332afc);if(!isQueueCampaignActive(_0x332afc)){if(_0x1f6e46){_0x186fce=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x332afc[_0x180e('0x28')]===0x0&&_0x332afc[_0x180e('0x24')]===0x0&&_0x332afc['waiting']===0x0&&(_0x332afc['pTalking']||0x0)===0x0){_0x186fce=CAMPAIGN_STATUS[_0x180e('0x39')];}else{_0x186fce=CAMPAIGN_STATUS[_0x180e('0x3a')];}}}else if(_0x332afc[_0x180e('0x21')]===0x0){_0x186fce=CAMPAIGN_STATUS[_0x180e('0x3b')];}else if(!checkAnyValidTrunk(_0x332afc,_0x54bccd)){_0x186fce=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x332afc)){var _0x159608=checkAnyValidQueueCampaignInterval(_0x332afc);if(_0x159608){_0x186fce=_0x159608;}}return _0x186fce;}exports[_0x180e('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x40f263){var _0x177b69=CAMPAIGN_STATUS[_0x180e('0x3a')];if(_0x40f263[_0x180e('0x28')]===0x0&&_0x40f263[_0x180e('0x24')]===0x0&&_0x40f263[_0x180e('0x26')]===0x0&&(_0x40f263[_0x180e('0x25')]||0x0)===0x0){_0x177b69=CAMPAIGN_STATUS[_0x180e('0x39')];}return _0x177b69;}exports[_0x180e('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x57a9e4){var _0x5de987=_0x57a9e4[_0x180e('0x3e')](/"(.*?)"/);return _0x5de987?_0x5de987[0x1]:_0x57a9e4;}exports[_0x180e('0x3f')]=extractCalleridName;function getCallerId(_0x3772d1,_0x3f37c8,_0x5939c5){if(!_[_0x180e('0x40')](_0x5939c5)&&typeof _0x5939c5===_0x180e('0x41')&&!_[_0x180e('0x32')](_0x5939c5)){if(!_[_0x180e('0x40')](_0x3f37c8)&&typeof _0x3f37c8==='string'&&!_[_0x180e('0x32')](_0x3f37c8)){return util[_0x180e('0x42')](_0x180e('0x43'),_0x3f37c8,_0x5939c5);}return util[_0x180e('0x42')](_0x180e('0x43'),_0x5939c5,_0x5939c5);}if(!_[_0x180e('0x40')](_0x3772d1)&&typeof _0x3772d1==='string'&&!_[_0x180e('0x32')](_0x3772d1)){return _0x3772d1;}return _0x180e('0x44');}exports[_0x180e('0x45')]=getCallerId;function getCallerIdRandom(_0x1e4fec,_0x4bce73){var _0x52b3a5;var _0x59661d;var _0x59b0b7;if(_0x4bce73<=0x0){_0x4bce73=0x1;}_0x52b3a5=new RegExp(_0x180e('0x46')+_0x4bce73+'}$');_0x59661d=Math['pow'](0xa,_0x4bce73-0x1);_0x59b0b7=Math[_0x180e('0x47')](0xa,_0x4bce73)-0x1;return util[_0x180e('0x42')]('%s',_['replace'](_0x1e4fec,_0x52b3a5,_['random'](_0x59661d,_0x59b0b7)[_0x180e('0x48')]()));}exports[_0x180e('0x49')]=getCallerIdRandom;function decrementOriginate(_0x1b1a18){if(_0x1b1a18[_0x180e('0x28')]&&_0x1b1a18[_0x180e('0x28')]>0x0){_0x1b1a18[_0x180e('0x28')]-=0x1;}else{logger[_0x180e('0x4a')](_0x180e('0x4b'));}}exports[_0x180e('0x4c')]=decrementOriginate;function checkContactEmpty(_0x133841){return _0x133841&&_0x133841[_0x180e('0x4d')]>0x0;}exports[_0x180e('0x4e')]=checkContactEmpty;function erlangb(_0x3204c3,_0x160f0e){if(_0x160f0e===0x0){return 0x0;}var _0x4a8fb7=0x1;for(var _0x8dbad8=0x1;_0x8dbad8<=_0x160f0e;_0x8dbad8+=0x1){_0x4a8fb7=0x1+_0x4a8fb7*_0x8dbad8/_0x3204c3;}return 0x1/_0x4a8fb7;}exports[_0x180e('0x4f')]=erlangb;function checkContactLowerLimitOriginate(_0x52df64,_0x2cc3e6,_0x28e22a){if(_0x2cc3e6>_0x28e22a){for(var _0x1fc622=0x0;_0x1fc622<_0x2cc3e6-_0x28e22a;_0x1fc622+=0x1){decrementOriginate(_0x52df64);}}}exports[_0x180e('0x50')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x40515d){var _0x1b8437={};var _0x397903=['id',_0x180e('0x51'),_0x180e('0x52'),'updatedAt'];const _0x1eb724=0xfa;if(_0x40515d){for(var _0x49c5c9 in _0x40515d){if(typeof _0x40515d[_0x49c5c9]!=='undefined'){if(!_[_0x180e('0x2e')](_0x40515d[_0x49c5c9])&&!_0x397903['includes'](_0x49c5c9)){if(_0x49c5c9==='description'&&_0x40515d[_0x49c5c9][_0x180e('0x4d')]>_0x1eb724){_0x1b8437['XMD-'+_0x49c5c9['toUpperCase']()]=_0x40515d[_0x49c5c9][_0x180e('0x48')]()['substring'](0x0,_0x1eb724);}else{_0x1b8437[_0x180e('0x53')+_0x49c5c9['toUpperCase']()]=_0x40515d[_0x49c5c9];}}}}}return _0x1b8437;}exports[_0x180e('0x54')]=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 13457a2..f6be0ab 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(_0x722938,_0x36063f){var _0x168dbf=function(_0x35e039){while(--_0x35e039){_0x722938['push'](_0x722938['shift']());}};_0x168dbf(++_0x36063f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x261366,_0x3a937c){var _0x2f6164=function(_0x19629b){while(--_0x19629b){_0x261366['push'](_0x261366['shift']());}};_0x2f6164(++_0x3a937c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 eec720c..61fbe08 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 _0x5abe=['format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','channelstatedesc','variable','value','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable'];(function(_0x2ad956,_0x58548a){var _0x162bfd=function(_0x81d7f8){while(--_0x81d7f8){_0x2ad956['push'](_0x2ad956['shift']());}};_0x162bfd(++_0x58548a);}(_0x5abe,0x1ed));var _0xe5ab=function(_0x54480e,_0x346bff){_0x54480e=_0x54480e-0x0;var _0x24fee4=_0x5abe[_0x54480e];return _0x24fee4;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xe5ab('0x0'));var moment=require(_0xe5ab('0x1'));var path=require(_0xe5ab('0x2'));var tiff2pdf=require(_0xe5ab('0x3'));var gs=require(_0xe5ab('0x4'));var logger=require(_0xe5ab('0x5'))(_0xe5ab('0x6'));var ami=require('../ami');var rpcDb=require(_0xe5ab('0x7'));var Channel=require(_0xe5ab('0x8'));var ut=require('./util/util');var Action=require(_0xe5ab('0x9'));var faxAccount=require(_0xe5ab('0xa'));var attachment=require(_0xe5ab('0xb'));var faxMessage=require(_0xe5ab('0xc'));function Fax(_0x22f529){this[_0xe5ab('0xd')]={};this[_0xe5ab('0xe')]=_0x22f529['faxAccounts'];this[_0xe5ab('0xf')]=_0x22f529[_0xe5ab('0xf')];this[_0xe5ab('0x10')]={};ami['on'](_0xe5ab('0x11'),this[_0xe5ab('0x12')][_0xe5ab('0x13')](this));ami['on']('varset',this[_0xe5ab('0x14')][_0xe5ab('0x13')](this));ami['on'](_0xe5ab('0x15'),this[_0xe5ab('0x16')][_0xe5ab('0x13')](this));ami['on']('newexten',this[_0xe5ab('0x17')][_0xe5ab('0x13')](this));ami['on'](_0xe5ab('0x18'),this[_0xe5ab('0x19')][_0xe5ab('0x13')](this));ami['on']('receivefax',this[_0xe5ab('0x1a')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xe5ab('0x1b'),this[_0xe5ab('0x1c')][_0xe5ab('0x13')](this));}Fax[_0xe5ab('0x1d')][_0xe5ab('0x12')]=function(_0x274e4f){if(_0x274e4f[_0xe5ab('0x1e')]===_0xe5ab('0x1f')){for(var _0x4346fe in this[_0xe5ab('0xe')]){if(this['faxAccounts'][_0xe5ab('0x20')](_0x4346fe)){if(_0x274e4f[_0xe5ab('0x21')]===this[_0xe5ab('0xe')][_0x4346fe][_0xe5ab('0x22')]){this[_0xe5ab('0xd')][_0x274e4f[_0xe5ab('0x23')]]={};this['channels'][_0x274e4f[_0xe5ab('0x23')]][_0xe5ab('0x24')]=_0x274e4f[_0xe5ab('0x24')];this[_0xe5ab('0xd')][_0x274e4f[_0xe5ab('0x23')]]['id']=this[_0xe5ab('0xe')][_0x4346fe]['id'];this['channels'][_0x274e4f[_0xe5ab('0x23')]][_0xe5ab('0x25')]=this['faxAccounts'][_0x4346fe][_0xe5ab('0x25')];logger[_0xe5ab('0x26')](_0x274e4f['uniqueid'],_0xe5ab('0x27'));}}}}if(this[_0xe5ab('0x10')][_0x274e4f[_0xe5ab('0x23')]]){this[_0xe5ab('0xd')][_0x274e4f['uniqueid']]={};this[_0xe5ab('0xd')][_0x274e4f[_0xe5ab('0x23')]][_0xe5ab('0x24')]=_0x274e4f[_0xe5ab('0x24')];logger[_0xe5ab('0x26')](_0x274e4f['uniqueid'],_0xe5ab('0x27'));}};Fax[_0xe5ab('0x1d')][_0xe5ab('0x14')]=function(_0x3510f9){if(this['channels'][_0x3510f9[_0xe5ab('0x23')]]){for(var _0x296705 in _0x3510f9['variable']){if(_0x3510f9['variable'][_0xe5ab('0x20')](_0x296705)){this[_0xe5ab('0xd')][_0x3510f9[_0xe5ab('0x23')]][_0x296705]=_0x3510f9['value'];}}}};Fax['prototype'][_0xe5ab('0x16')]=function(_0x3ec086){if(this[_0xe5ab('0xd')][_0x3ec086[_0xe5ab('0x23')]]){this[_0xe5ab('0xd')][_0x3ec086[_0xe5ab('0x23')]]['channelstate']=_0x3ec086['channelstate'];this[_0xe5ab('0xd')][_0x3ec086[_0xe5ab('0x23')]][_0xe5ab('0x28')]=_0x3ec086[_0xe5ab('0x28')];}};Fax[_0xe5ab('0x1d')][_0xe5ab('0x17')]=function(_0x2e1d66){if(this[_0xe5ab('0xd')][_0x2e1d66['uniqueid']]){for(var _0x5f0e79 in _0x2e1d66[_0xe5ab('0x29')]){if(_0x2e1d66[_0xe5ab('0x29')]['hasOwnProperty'](_0x5f0e79)){this[_0xe5ab('0xd')][_0x2e1d66[_0xe5ab('0x23')]][_0x5f0e79]=_0x2e1d66[_0xe5ab('0x2a')];}}}};Fax[_0xe5ab('0x1d')][_0xe5ab('0x19')]=function(_0x3b6677){if(this[_0xe5ab('0xd')][_0x3b6677[_0xe5ab('0x23')]]){this[_0xe5ab('0xd')][_0x3b6677[_0xe5ab('0x23')]][_0xe5ab('0x2b')]=_0x3b6677['operation'];this['channels'][_0x3b6677[_0xe5ab('0x23')]][_0xe5ab('0x2c')]=_0x3b6677[_0xe5ab('0x2c')];this[_0xe5ab('0xd')][_0x3b6677[_0xe5ab('0x23')]][_0xe5ab('0x22')]=_0x3b6677[_0xe5ab('0x22')];this[_0xe5ab('0xd')][_0x3b6677[_0xe5ab('0x23')]][_0xe5ab('0x2d')]=_0x3b6677[_0xe5ab('0x2d')];logger[_0xe5ab('0x26')](_0x3b6677[_0xe5ab('0x23')],_0xe5ab('0x2e'));}};Fax[_0xe5ab('0x1d')][_0xe5ab('0x1a')]=function(_0x2f9fad){var _0x26b38d=this;if(this[_0xe5ab('0xd')][_0x2f9fad['uniqueid']]){var _0x358573=this[_0xe5ab('0xd')][_0x2f9fad[_0xe5ab('0x23')]]['id'];this[_0xe5ab('0xd')][_0x2f9fad[_0xe5ab('0x23')]][_0xe5ab('0x2f')]=_0x2f9fad[_0xe5ab('0x2f')];this[_0xe5ab('0xd')][_0x2f9fad['uniqueid']][_0xe5ab('0x30')]=_0x2f9fad['pagestransferred'];this[_0xe5ab('0xd')][_0x2f9fad[_0xe5ab('0x23')]]['localstationid']=_0x2f9fad[_0xe5ab('0x22')];this[_0xe5ab('0xd')][_0x2f9fad[_0xe5ab('0x23')]][_0xe5ab('0x31')]=_0x2f9fad[_0xe5ab('0x31')];this['channels'][_0x2f9fad['uniqueid']][_0xe5ab('0x32')]=_0x2f9fad[_0xe5ab('0x32')];this[_0xe5ab('0xd')][_0x2f9fad['uniqueid']]['filename']=_0x2f9fad[_0xe5ab('0x2d')];this[_0xe5ab('0xd')][_0x2f9fad['uniqueid']][_0xe5ab('0x33')]=_0x2f9fad[_0xe5ab('0x33')];if(this[_0xe5ab('0xd')][_0x2f9fad[_0xe5ab('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x2f9fad[_0xe5ab('0x2d')],_0xe5ab('0x34'),function(_0x39fbd6){logger[_0xe5ab('0x26')](_0x2f9fad[_0xe5ab('0x23')],_0xe5ab('0x35'),_0x39fbd6[_0xe5ab('0x36')]);attachment[_0xe5ab('0x37')]({'name':path[_0xe5ab('0x38')](_0x2f9fad[_0xe5ab('0x2d')])[_0xe5ab('0x25')],'basename':path[_0xe5ab('0x38')](_0x2f9fad['filename'])['name']+_0xe5ab('0x39'),'type':_0xe5ab('0x3a')})[_0xe5ab('0x3b')](function(_0x269295){faxAccount[_0xe5ab('0x3c')](_0x358573,{'from':_0x2f9fad[_0xe5ab('0x33')],'mapKey':_0xe5ab('0x6'),'body':path[_0xe5ab('0x38')](_0x2f9fad[_0xe5ab('0x2d')])[_0xe5ab('0x25')]+'.pdf','AttachmentId':_0x269295['id']})[_0xe5ab('0x3d')](function(_0x458700){logger[_0xe5ab('0x3e')](_0x2f9fad[_0xe5ab('0x23')],_0xe5ab('0x3f'),JSON[_0xe5ab('0x40')](_0x458700));});})[_0xe5ab('0x3d')](function(_0x32315f){logger[_0xe5ab('0x3e')](_0x2f9fad['uniqueid'],_0xe5ab('0x41'),JSON[_0xe5ab('0x40')](_0x32315f));});});}logger[_0xe5ab('0x26')](_0x2f9fad['uniqueid'],_0xe5ab('0x41'));}};Fax[_0xe5ab('0x1d')][_0xe5ab('0x1c')]=function(_0x171d35){if(this[_0xe5ab('0x10')][_0x171d35['uniqueid']]){_[_0xe5ab('0x42')](this['channels'][_0x171d35[_0xe5ab('0x23')]],_['pick'](_0x171d35,[_0xe5ab('0x43'),_0xe5ab('0x44')]));}};function updateStatus(_0x83991b){if(_0x83991b[_0xe5ab('0x45')]){faxMessage[_0xe5ab('0x46')](_0x83991b['AttachmentId'],{'failMessage':_0xe5ab('0x47')})[_0xe5ab('0x3b')](function(_0x1fbcdb){ut[_0xe5ab('0x48')]('[Fax][Message][Error][Updated]',_0x1fbcdb);})[_0xe5ab('0x3d')](function(_0x59f4c6){ut[_0xe5ab('0x48')](_0xe5ab('0x49'),_0x59f4c6);});}else{ut['logger'](_0xe5ab('0x4a'));}}Fax['prototype']['updateStatus']=function(_0x2dd63f,_0xd6ae86,_0x1a9228){var _0x32f6e3=this;var _0x5cfb7c={};if(_0xd6ae86){_0x5cfb7c={'read':_0xd6ae86};}else{_0x5cfb7c={'failMessage':_0x1a9228};}if(this[_0xe5ab('0x10')][_0x2dd63f][_0xe5ab('0x45')]){faxMessage['update'](this[_0xe5ab('0x10')][_0x2dd63f][_0xe5ab('0x45')],_0x5cfb7c)[_0xe5ab('0x3b')](function(_0x27a12d){ut[_0xe5ab('0x48')](_0xe5ab('0x4b'),_0x27a12d);})[_0xe5ab('0x3d')](function(_0x322378){ut[_0xe5ab('0x48')](_0xe5ab('0x4c'),_0x322378);})['finally'](function(){delete _0x32f6e3[_0xe5ab('0xd')][_0x2dd63f];delete _0x32f6e3[_0xe5ab('0x10')][_0x2dd63f];});}else{ut[_0xe5ab('0x48')](_0xe5ab('0x4d'));delete this[_0xe5ab('0xd')][_0x2dd63f];delete this[_0xe5ab('0x10')][_0x2dd63f];}};Fax['prototype'][_0xe5ab('0x4e')]=function(_0x2cb46c){var _0x1a0da0=this;if(this[_0xe5ab('0xd')][_0x2cb46c[_0xe5ab('0x23')]]){if(this[_0xe5ab('0x10')][_0x2cb46c['uniqueid']]){this['channels'][_0x2cb46c['uniqueid']]['id']=this[_0xe5ab('0x10')][_0x2cb46c[_0xe5ab('0x23')]]['id'];this[_0xe5ab('0xd')][_0x2cb46c[_0xe5ab('0x23')]]['name']=this[_0xe5ab('0x10')][_0x2cb46c[_0xe5ab('0x23')]][_0xe5ab('0x25')];}logger[_0xe5ab('0x26')](_0x2cb46c[_0xe5ab('0x23')],this[_0xe5ab('0x10')][_0x2cb46c[_0xe5ab('0x23')]]?_0xe5ab('0x4f'):_0xe5ab('0x50'),JSON[_0xe5ab('0x40')](this['channels'][_0x2cb46c[_0xe5ab('0x23')]]));if(this[_0xe5ab('0x10')][_0x2cb46c[_0xe5ab('0x23')]]){if(this[_0xe5ab('0xd')][_0x2cb46c['uniqueid']][_0xe5ab('0x51')]>0x0&&this[_0xe5ab('0xd')][_0x2cb46c[_0xe5ab('0x23')]]['faxstatus']===_0xe5ab('0x52')){this['updateStatus'](_0x2cb46c['uniqueid'],!![]);}else{this['updateStatus'](_0x2cb46c[_0xe5ab('0x23')],![],this[_0xe5ab('0xd')][_0x2cb46c['uniqueid']][_0xe5ab('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x2cb46c['uniqueid']]['faxstatusstring']:_0xe5ab('0x54'));}}}};Fax['prototype'][_0xe5ab('0x55')]=function(_0x9e195){var _0x224ec7=this;return new BPromise(function(_0x54fc13,_0x5cbb0e){_0x224ec7[_0xe5ab('0x56')](_0x9e195,_0x224ec7[_0xe5ab('0xe')][_0x9e195[_0xe5ab('0x57')]])[_0xe5ab('0x3b')](function(_0x16c9b0){ut[_0xe5ab('0x48')](_0xe5ab('0x58'),_0x16c9b0);_0x54fc13(ut[_0xe5ab('0x36')](_0xe5ab('0x59')));})[_0xe5ab('0x3d')](function(_0x541987){ut[_0xe5ab('0x48')](_0xe5ab('0x5a'),_0x541987);updateStatus(_0x9e195);_0x5cbb0e(ut[_0xe5ab('0x36')](_0xe5ab('0x5b')));});});};Fax['prototype'][_0xe5ab('0x5c')]=function(_0x53d80e){var _0x243425=this;return new BPromise(function(_0x574303,_0x654840){var _0x2d524e=_0x243425[_0xe5ab('0x5d')](_0x243425[_0xe5ab('0xe')][_0x53d80e['FaxAccountId']][_0xe5ab('0x5e')],_0x53d80e);if(_0x2d524e[_0xe5ab('0x5f')]){_0x574303(ut[_0xe5ab('0x36')](_0xe5ab('0x60')));}else{_0x654840(ut[_0xe5ab('0x36')](_0x2d524e['message']));}});};function originate(_0x2895c6,_0x44a3bd,_0x614102){return new BPromise(function(_0x3351b9,_0x5978c2){if(_0x614102){var _0x14dc6e=util[_0xe5ab('0x61')](_0xe5ab('0x62'),path[_0xe5ab('0x38')](_0x2895c6[_0xe5ab('0x2')])[_0xe5ab('0x25')],_0x2895c6[_0xe5ab('0x2')]);gs[_0xe5ab('0x63')](_0x14dc6e)[_0xe5ab('0x3b')](function(){_0x2895c6[_0xe5ab('0x2')]=util['format'](_0xe5ab('0x64'),path['parse'](_0x2895c6[_0xe5ab('0x2')])[_0xe5ab('0x65')],path[_0xe5ab('0x38')](_0x2895c6[_0xe5ab('0x2')])[_0xe5ab('0x25')]);_0x44a3bd[_0xe5ab('0x66')]=_0x2895c6[_0xe5ab('0x2')];ut[_0xe5ab('0x48')](_0xe5ab('0x67'),'');ami[_0xe5ab('0x68')](ut[_0xe5ab('0x69')](_0x2895c6,_0x44a3bd))['then'](function(_0x5bfe24){_0x3351b9(_0x5bfe24);})['catch'](function(_0x5e47ee){_0x5978c2(_0x5e47ee);});})['catch'](function(_0x55b50b){_0x5978c2(_0x55b50b);});}else{ami[_0xe5ab('0x68')](ut[_0xe5ab('0x69')](_0x2895c6,_0x44a3bd))[_0xe5ab('0x3b')](function(_0x2d6117){_0x3351b9(_0x2d6117);})[_0xe5ab('0x3d')](function(_0x716377){_0x5978c2(_0x716377);});}});}Fax['prototype']['execOriginate']=function(_0x475ff2,_0x4dc7ca){var _0xcd3335=this;return new BPromise(function(_0x56e5fe,_0x3a9aab){var _0x3a1335=uuid['v4']();var _0x47df80=ut[_0xe5ab('0x6a')](_0x475ff2,_0x4dc7ca);_0xcd3335[_0xe5ab('0x10')][_0x3a1335]=new Action(_0x3a1335,_0x4dc7ca,_0x475ff2);var _0x235fc2=_0xcd3335['actions'][_0x3a1335];if(path[_0xe5ab('0x38')](_0x475ff2[_0xe5ab('0x2')])[_0xe5ab('0x6b')]==='.pdf'){originate(_0x235fc2,_0x47df80,!![])['then'](function(_0xd82fb2){_0x56e5fe(_0xd82fb2);})[_0xe5ab('0x3d')](function(_0x16269e){_0x3a9aab(_0x16269e);});}else{originate(_0x235fc2,_0x47df80,![])[_0xe5ab('0x3b')](function(_0x15d669){_0x56e5fe(_0x15d669);})[_0xe5ab('0x3d')](function(_0xd42916){_0x3a9aab(_0xd42916);});}});};Fax[_0xe5ab('0x1d')]['isTrunkReachable']=function(_0x5558a4){return!_[_0xe5ab('0x6c')](_0x5558a4)&&!_[_0xe5ab('0x6c')](_0x5558a4[_0xe5ab('0x25')])&&!_['isNil'](_0x5558a4[_0xe5ab('0x6d')])&&_0x5558a4[_0xe5ab('0x6d')]&&!_[_0xe5ab('0x6c')](this['trunks'][util[_0xe5ab('0x61')](_0xe5ab('0x6e'),_0x5558a4[_0xe5ab('0x25')])])&&!_['isNil'](this[_0xe5ab('0xf')][util[_0xe5ab('0x61')](_0xe5ab('0x6e'),_0x5558a4[_0xe5ab('0x25')])][_0xe5ab('0x2c')])&&(this[_0xe5ab('0xf')][util[_0xe5ab('0x61')]('SIP/%s',_0x5558a4[_0xe5ab('0x25')])]['status']===_0xe5ab('0x6f')||this[_0xe5ab('0xf')][util[_0xe5ab('0x61')](_0xe5ab('0x6e'),_0x5558a4[_0xe5ab('0x25')])][_0xe5ab('0x2c')]===_0xe5ab('0x70'));};Fax['prototype'][_0xe5ab('0x5d')]=function(_0x158ca3,_0x5cbe46){if(!this[_0xe5ab('0x71')](_0x158ca3)){ut['logger'](_0xe5ab('0x72'),_['isNil'](_0x158ca3)?'':_0x158ca3[_0xe5ab('0x25')]+_0xe5ab('0x73'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0xe5ab('0x6c')](_0x5cbe46[_0xe5ab('0x6')])){ut[_0xe5ab('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xe5ab('0x40')](_0x5cbe46));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xe5ab('0x6c')](_0x5cbe46[_0xe5ab('0x2')])){ut[_0xe5ab('0x48')](_0xe5ab('0x74'),JSON['stringify'](_0x5cbe46));return{'isValid':![],'message':_0xe5ab('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0xb5b2=['XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','varset','syncVarSet','newstate','bind','syncNewExten','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','\x20syncNewchannel\x20','actions','info','variable','syncNewState','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','format','%s/%s.tif'];(function(_0xf7e66c,_0x225097){var _0x1cff34=function(_0x5da309){while(--_0x5da309){_0xf7e66c['push'](_0xf7e66c['shift']());}};_0x1cff34(++_0x225097);}(_0xb5b2,0x1e4));var _0x2b5b=function(_0x4d3f85,_0x715c4){_0x4d3f85=_0x4d3f85-0x0;var _0x5f2d07=_0xb5b2[_0x4d3f85];return _0x5f2d07;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x2b5b('0x0'));var uuid=require(_0x2b5b('0x1'));var moment=require('moment');var path=require(_0x2b5b('0x2'));var tiff2pdf=require(_0x2b5b('0x3'));var gs=require(_0x2b5b('0x4'));var logger=require(_0x2b5b('0x5'))('fax');var ami=require('../ami');var rpcDb=require(_0x2b5b('0x6'));var Channel=require(_0x2b5b('0x7'));var ut=require('./util/util');var Action=require(_0x2b5b('0x8'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x2b5b('0x9'));var faxMessage=require(_0x2b5b('0xa'));function Fax(_0x3f54bc){this[_0x2b5b('0xb')]={};this['faxAccounts']=_0x3f54bc[_0x2b5b('0xc')];this[_0x2b5b('0xd')]=_0x3f54bc[_0x2b5b('0xd')];this['actions']={};ami['on'](_0x2b5b('0xe'),this['syncNewchannel']['bind'](this));ami['on'](_0x2b5b('0xf'),this[_0x2b5b('0x10')]['bind'](this));ami['on'](_0x2b5b('0x11'),this['syncNewState'][_0x2b5b('0x12')](this));ami['on']('newexten',this[_0x2b5b('0x13')][_0x2b5b('0x12')](this));ami['on']('faxstatus',this[_0x2b5b('0x14')][_0x2b5b('0x12')](this));ami['on'](_0x2b5b('0x15'),this['syncReceiveFax'][_0x2b5b('0x12')](this));ami['on']('hangup',this[_0x2b5b('0x16')]['bind'](this));ami['on'](_0x2b5b('0x17'),this[_0x2b5b('0x18')][_0x2b5b('0x12')](this));}Fax[_0x2b5b('0x19')][_0x2b5b('0x1a')]=function(_0x3d790b){if(_0x3d790b[_0x2b5b('0x1b')]===_0x2b5b('0x1c')){for(var _0x3a8af0 in this[_0x2b5b('0xc')]){if(this[_0x2b5b('0xc')][_0x2b5b('0x1d')](_0x3a8af0)){if(_0x3d790b[_0x2b5b('0x1e')]===this['faxAccounts'][_0x3a8af0]['localstationid']){this[_0x2b5b('0xb')][_0x3d790b[_0x2b5b('0x1f')]]={};this[_0x2b5b('0xb')][_0x3d790b[_0x2b5b('0x1f')]]['channel']=_0x3d790b[_0x2b5b('0x20')];this[_0x2b5b('0xb')][_0x3d790b['uniqueid']]['id']=this[_0x2b5b('0xc')][_0x3a8af0]['id'];this[_0x2b5b('0xb')][_0x3d790b[_0x2b5b('0x1f')]][_0x2b5b('0x21')]=this['faxAccounts'][_0x3a8af0][_0x2b5b('0x21')];logger['info'](_0x3d790b[_0x2b5b('0x1f')],_0x2b5b('0x22'));}}}}if(this[_0x2b5b('0x23')][_0x3d790b['uniqueid']]){this[_0x2b5b('0xb')][_0x3d790b[_0x2b5b('0x1f')]]={};this[_0x2b5b('0xb')][_0x3d790b[_0x2b5b('0x1f')]]['channel']=_0x3d790b['channel'];logger[_0x2b5b('0x24')](_0x3d790b[_0x2b5b('0x1f')],_0x2b5b('0x22'));}};Fax['prototype']['syncVarSet']=function(_0x50ea3d){if(this[_0x2b5b('0xb')][_0x50ea3d[_0x2b5b('0x1f')]]){for(var _0x22af65 in _0x50ea3d[_0x2b5b('0x25')]){if(_0x50ea3d[_0x2b5b('0x25')]['hasOwnProperty'](_0x22af65)){this['channels'][_0x50ea3d[_0x2b5b('0x1f')]][_0x22af65]=_0x50ea3d['value'];}}}};Fax['prototype'][_0x2b5b('0x26')]=function(_0xf6b8e7){if(this[_0x2b5b('0xb')][_0xf6b8e7[_0x2b5b('0x1f')]]){this[_0x2b5b('0xb')][_0xf6b8e7[_0x2b5b('0x1f')]]['channelstate']=_0xf6b8e7[_0x2b5b('0x27')];this[_0x2b5b('0xb')][_0xf6b8e7[_0x2b5b('0x1f')]][_0x2b5b('0x28')]=_0xf6b8e7['channelstatedesc'];}};Fax['prototype'][_0x2b5b('0x13')]=function(_0x2ed8b7){if(this[_0x2b5b('0xb')][_0x2ed8b7[_0x2b5b('0x1f')]]){for(var _0x3fd895 in _0x2ed8b7[_0x2b5b('0x25')]){if(_0x2ed8b7[_0x2b5b('0x25')][_0x2b5b('0x1d')](_0x3fd895)){this[_0x2b5b('0xb')][_0x2ed8b7[_0x2b5b('0x1f')]][_0x3fd895]=_0x2ed8b7['value'];}}}};Fax[_0x2b5b('0x19')][_0x2b5b('0x14')]=function(_0x5322ee){if(this[_0x2b5b('0xb')][_0x5322ee[_0x2b5b('0x1f')]]){this[_0x2b5b('0xb')][_0x5322ee[_0x2b5b('0x1f')]][_0x2b5b('0x29')]=_0x5322ee[_0x2b5b('0x29')];this[_0x2b5b('0xb')][_0x5322ee[_0x2b5b('0x1f')]]['status']=_0x5322ee[_0x2b5b('0x2a')];this[_0x2b5b('0xb')][_0x5322ee[_0x2b5b('0x1f')]][_0x2b5b('0x2b')]=_0x5322ee[_0x2b5b('0x2b')];this[_0x2b5b('0xb')][_0x5322ee[_0x2b5b('0x1f')]][_0x2b5b('0x2c')]=_0x5322ee[_0x2b5b('0x2c')];logger['info'](_0x5322ee[_0x2b5b('0x1f')],_0x2b5b('0x2d'));}};Fax[_0x2b5b('0x19')][_0x2b5b('0x2e')]=function(_0x25fa60){var _0x3ace73=this;if(this[_0x2b5b('0xb')][_0x25fa60['uniqueid']]){var _0x1c2d22=this[_0x2b5b('0xb')][_0x25fa60['uniqueid']]['id'];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]][_0x2b5b('0x2f')]=_0x25fa60[_0x2b5b('0x2f')];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]]['pagestransferred']=_0x25fa60[_0x2b5b('0x30')];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]][_0x2b5b('0x2b')]=_0x25fa60[_0x2b5b('0x2b')];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]]['resolution']=_0x25fa60[_0x2b5b('0x31')];this['channels'][_0x25fa60['uniqueid']][_0x2b5b('0x32')]=_0x25fa60[_0x2b5b('0x32')];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]]['filename']=_0x25fa60[_0x2b5b('0x2c')];this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]][_0x2b5b('0x33')]=_0x25fa60['calleridnum'];if(this[_0x2b5b('0xb')][_0x25fa60[_0x2b5b('0x1f')]][_0x2b5b('0x30')]>0x0){tiff2pdf(_0x25fa60['filename'],_0x2b5b('0x34'),function(_0x19e225){logger['info'](_0x25fa60['uniqueid'],_0x2b5b('0x35'),_0x19e225[_0x2b5b('0x36')]);attachment[_0x2b5b('0x37')]({'name':path[_0x2b5b('0x38')](_0x25fa60[_0x2b5b('0x2c')])[_0x2b5b('0x21')],'basename':path[_0x2b5b('0x38')](_0x25fa60[_0x2b5b('0x2c')])[_0x2b5b('0x21')]+_0x2b5b('0x39'),'type':_0x2b5b('0x3a')})[_0x2b5b('0x3b')](function(_0x543208){faxAccount[_0x2b5b('0x3c')](_0x1c2d22,{'from':_0x25fa60[_0x2b5b('0x33')],'mapKey':_0x2b5b('0x3d'),'body':path['parse'](_0x25fa60[_0x2b5b('0x2c')])['name']+_0x2b5b('0x39'),'AttachmentId':_0x543208['id']})[_0x2b5b('0x3e')](function(_0x5a447b){logger[_0x2b5b('0x3f')](_0x25fa60[_0x2b5b('0x1f')],_0x2b5b('0x40'),JSON[_0x2b5b('0x41')](_0x5a447b));});})['catch'](function(_0xe9422b){logger[_0x2b5b('0x3f')](_0x25fa60[_0x2b5b('0x1f')],'\x20receiveFax\x20',JSON[_0x2b5b('0x41')](_0xe9422b));});});}logger[_0x2b5b('0x24')](_0x25fa60[_0x2b5b('0x1f')],_0x2b5b('0x42'));}};Fax[_0x2b5b('0x19')]['syncOriginateResponse']=function(_0x25b3b2){if(this[_0x2b5b('0x23')][_0x25b3b2['uniqueid']]){_[_0x2b5b('0x43')](this[_0x2b5b('0xb')][_0x25b3b2['uniqueid']],_[_0x2b5b('0x44')](_0x25b3b2,[_0x2b5b('0x45'),'reason']));}};function updateStatus(_0x521f0b){if(_0x521f0b['AttachmentId']){faxMessage[_0x2b5b('0x46')](_0x521f0b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x2b5b('0x3b')](function(_0x67088c){ut[_0x2b5b('0x47')](_0x2b5b('0x48'),_0x67088c);})[_0x2b5b('0x3e')](function(_0x2b87bb){ut[_0x2b5b('0x47')](_0x2b5b('0x49'),_0x2b87bb);});}else{ut[_0x2b5b('0x47')](_0x2b5b('0x4a'));}}Fax[_0x2b5b('0x19')]['updateStatus']=function(_0x544907,_0x1bb4b6,_0x3bbbe2){var _0x2791ef=this;var _0x96c81e={};if(_0x1bb4b6){_0x96c81e={'read':_0x1bb4b6};}else{_0x96c81e={'failMessage':_0x3bbbe2};}if(this[_0x2b5b('0x23')][_0x544907][_0x2b5b('0x4b')]){faxMessage[_0x2b5b('0x46')](this['actions'][_0x544907][_0x2b5b('0x4b')],_0x96c81e)['then'](function(_0x3a5201){ut[_0x2b5b('0x47')](_0x2b5b('0x4c'),_0x3a5201);})[_0x2b5b('0x3e')](function(_0x7ea4dc){ut[_0x2b5b('0x47')](_0x2b5b('0x4d'),_0x7ea4dc);})[_0x2b5b('0x4e')](function(){delete _0x2791ef[_0x2b5b('0xb')][_0x544907];delete _0x2791ef[_0x2b5b('0x23')][_0x544907];});}else{ut[_0x2b5b('0x47')](_0x2b5b('0x4f'));delete this[_0x2b5b('0xb')][_0x544907];delete this['actions'][_0x544907];}};Fax['prototype'][_0x2b5b('0x16')]=function(_0x4e52a6){var _0x5adc94=this;if(this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]]){if(this['actions'][_0x4e52a6[_0x2b5b('0x1f')]]){this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]]['id']=this[_0x2b5b('0x23')][_0x4e52a6[_0x2b5b('0x1f')]]['id'];this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]]['name']=this[_0x2b5b('0x23')][_0x4e52a6[_0x2b5b('0x1f')]][_0x2b5b('0x21')];}logger[_0x2b5b('0x24')](_0x4e52a6['uniqueid'],this[_0x2b5b('0x23')][_0x4e52a6[_0x2b5b('0x1f')]]?_0x2b5b('0x50'):_0x2b5b('0x51'),JSON[_0x2b5b('0x41')](this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]]));if(this[_0x2b5b('0x23')][_0x4e52a6[_0x2b5b('0x1f')]]){if(this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]][_0x2b5b('0x52')]>0x0&&this[_0x2b5b('0xb')][_0x4e52a6[_0x2b5b('0x1f')]][_0x2b5b('0x53')]===_0x2b5b('0x54')){this[_0x2b5b('0x55')](_0x4e52a6[_0x2b5b('0x1f')],!![]);}else{this[_0x2b5b('0x55')](_0x4e52a6['uniqueid'],![],this['channels'][_0x4e52a6[_0x2b5b('0x1f')]][_0x2b5b('0x56')]?_0x2b5b('0x57')+this['channels'][_0x4e52a6[_0x2b5b('0x1f')]][_0x2b5b('0x56')]:_0x2b5b('0x58'));}}}};Fax[_0x2b5b('0x19')][_0x2b5b('0x59')]=function(_0x12ab1){var _0x2ee67a=this;return new BPromise(function(_0x4de0c1,_0x5a3d37){_0x2ee67a['execOriginate'](_0x12ab1,_0x2ee67a[_0x2b5b('0xc')][_0x12ab1[_0x2b5b('0x5a')]])['then'](function(_0x26f7da){ut[_0x2b5b('0x47')](_0x2b5b('0x5b'),_0x26f7da);_0x4de0c1(ut[_0x2b5b('0x36')](_0x2b5b('0x5c')));})['catch'](function(_0x4a076e){ut['logger'](_0x2b5b('0x5d'),_0x4a076e);updateStatus(_0x12ab1);_0x5a3d37(ut[_0x2b5b('0x36')](_0x2b5b('0x5e')));});});};Fax[_0x2b5b('0x19')][_0x2b5b('0x5f')]=function(_0x498ba4){var _0x4fec5a=this;return new BPromise(function(_0x27bc7c,_0x38dc83){var _0x9914c3=_0x4fec5a[_0x2b5b('0x60')](_0x4fec5a['faxAccounts'][_0x498ba4['FaxAccountId']][_0x2b5b('0x61')],_0x498ba4);if(_0x9914c3[_0x2b5b('0x62')]){_0x27bc7c(ut['message']('Trunk\x20Reachable'));}else{_0x38dc83(ut[_0x2b5b('0x36')](_0x9914c3['message']));}});};function originate(_0x579a05,_0x35325e,_0x5bb099){return new BPromise(function(_0x253406,_0x39e756){if(_0x5bb099){var _0x378660=util[_0x2b5b('0x63')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x579a05[_0x2b5b('0x2')])['name'],_0x579a05[_0x2b5b('0x2')]);gs['execute'](_0x378660)[_0x2b5b('0x3b')](function(){_0x579a05[_0x2b5b('0x2')]=util['format'](_0x2b5b('0x64'),path[_0x2b5b('0x38')](_0x579a05['path'])['dir'],path[_0x2b5b('0x38')](_0x579a05[_0x2b5b('0x2')])[_0x2b5b('0x21')]);_0x35325e[_0x2b5b('0x65')]=_0x579a05['path'];ut['logger'](_0x2b5b('0x66'),'');ami[_0x2b5b('0x67')](ut[_0x2b5b('0x68')](_0x579a05,_0x35325e))[_0x2b5b('0x3b')](function(_0x4500ca){_0x253406(_0x4500ca);})['catch'](function(_0x2648ab){_0x39e756(_0x2648ab);});})[_0x2b5b('0x3e')](function(_0x152bbb){_0x39e756(_0x152bbb);});}else{ami[_0x2b5b('0x67')](ut['variablesAction'](_0x579a05,_0x35325e))['then'](function(_0x2f0c56){_0x253406(_0x2f0c56);})[_0x2b5b('0x3e')](function(_0x31a6a6){_0x39e756(_0x31a6a6);});}});}Fax[_0x2b5b('0x19')][_0x2b5b('0x69')]=function(_0x1a44f2,_0x4f8eb2){var _0x5322cc=this;return new BPromise(function(_0x3c7003,_0x2887b1){var _0x43d9d3=uuid['v4']();var _0x3919aa=ut[_0x2b5b('0x6a')](_0x1a44f2,_0x4f8eb2);_0x5322cc['actions'][_0x43d9d3]=new Action(_0x43d9d3,_0x4f8eb2,_0x1a44f2);var _0xa9581b=_0x5322cc[_0x2b5b('0x23')][_0x43d9d3];if(path[_0x2b5b('0x38')](_0x1a44f2[_0x2b5b('0x2')])[_0x2b5b('0x6b')]===_0x2b5b('0x39')){originate(_0xa9581b,_0x3919aa,!![])['then'](function(_0x41b80c){_0x3c7003(_0x41b80c);})[_0x2b5b('0x3e')](function(_0x2fe30e){_0x2887b1(_0x2fe30e);});}else{originate(_0xa9581b,_0x3919aa,![])[_0x2b5b('0x3b')](function(_0x3fcb9e){_0x3c7003(_0x3fcb9e);})[_0x2b5b('0x3e')](function(_0x1ccf48){_0x2887b1(_0x1ccf48);});}});};Fax[_0x2b5b('0x19')][_0x2b5b('0x6c')]=function(_0x231fe3){return!_['isNil'](_0x231fe3)&&!_[_0x2b5b('0x6d')](_0x231fe3['name'])&&!_[_0x2b5b('0x6d')](_0x231fe3[_0x2b5b('0x6e')])&&_0x231fe3[_0x2b5b('0x6e')]&&!_[_0x2b5b('0x6d')](this[_0x2b5b('0xd')][util[_0x2b5b('0x63')]('SIP/%s',_0x231fe3['name'])])&&!_[_0x2b5b('0x6d')](this[_0x2b5b('0xd')][util['format'](_0x2b5b('0x6f'),_0x231fe3[_0x2b5b('0x21')])]['status'])&&(this[_0x2b5b('0xd')][util[_0x2b5b('0x63')]('SIP/%s',_0x231fe3[_0x2b5b('0x21')])][_0x2b5b('0x2a')]==='reachable'||this[_0x2b5b('0xd')][util[_0x2b5b('0x63')](_0x2b5b('0x6f'),_0x231fe3[_0x2b5b('0x21')])][_0x2b5b('0x2a')]===_0x2b5b('0x70'));};Fax[_0x2b5b('0x19')][_0x2b5b('0x60')]=function(_0x46502e,_0x8ff0a2){if(!this[_0x2b5b('0x6c')](_0x46502e)){ut[_0x2b5b('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x2b5b('0x6d')](_0x46502e)?'':_0x46502e['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_[_0x2b5b('0x6d')](_0x8ff0a2[_0x2b5b('0x3d')])){ut[_0x2b5b('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x2b5b('0x41')](_0x8ff0a2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x2b5b('0x6d')](_0x8ff0a2[_0x2b5b('0x2')])){ut[_0x2b5b('0x47')](_0x2b5b('0x71'),JSON[_0x2b5b('0x41')](_0x8ff0a2));return{'isValid':![],'message':_0x2b5b('0x72')};}return{'isValid':!![],'message':_0x2b5b('0x73')};};module[_0x2b5b('0x74')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 32d975e..b8d3830 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 _0xcb85=['catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash','error','inspect','notify'];(function(_0x532d86,_0x2067ff){var _0x152b27=function(_0xa9c796){while(--_0xa9c796){_0x532d86['push'](_0x532d86['shift']());}};_0x152b27(++_0x2067ff);}(_0xcb85,0x1b2));var _0x5cb8=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0xcb85[_0x2df507];return _0x1f7167;};'use strict';var util=require('util');var BPromise=require(_0x5cb8('0x0'));var logger=require(_0x5cb8('0x1'))(_0x5cb8('0x2'));var _=require(_0x5cb8('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x14f620){return function(_0x212b70){logger[_0x5cb8('0x4')](_0x14f620,util[_0x5cb8('0x5')](_0x212b70,{'showHidden':![],'depth':null}));};}exports[_0x5cb8('0x6')]=function(_0x4b171b,_0x4aa522){return BPromise['resolve']()['then'](faxAccount[_0x5cb8('0x6')](_0x4b171b,_0x4aa522))[_0x5cb8('0x7')](loggerCatch(_0x5cb8('0x8')));}; \ No newline at end of file +var _0x051e=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util','bluebird'];(function(_0x1f507a,_0x18edc1){var _0x28b2a6=function(_0x421d1c){while(--_0x421d1c){_0x1f507a['push'](_0x1f507a['shift']());}};_0x28b2a6(++_0x18edc1);}(_0x051e,0xee));var _0xe051=function(_0x39e9b3,_0x48e810){_0x39e9b3=_0x39e9b3-0x0;var _0x53ea9b=_0x051e[_0x39e9b3];return _0x53ea9b;};'use strict';var util=require(_0xe051('0x0'));var BPromise=require(_0xe051('0x1'));var logger=require(_0xe051('0x2'))(_0xe051('0x3'));var _=require(_0xe051('0x4'));var faxAccount=require(_0xe051('0x5'));function loggerCatch(_0x5c7754){return function(_0x1293e7){logger[_0xe051('0x6')](_0x5c7754,util['inspect'](_0x1293e7,{'showHidden':![],'depth':null}));};}exports[_0xe051('0x7')]=function(_0x4460ee,_0x49bd9d){return BPromise[_0xe051('0x8')]()[_0xe051('0x9')](faxAccount['notify'](_0x4460ee,_0x49bd9d))[_0xe051('0xa')](loggerCatch(_0xe051('0xb')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 47e8294..1775b14 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 _0x2bac=['exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird'];(function(_0xc33165,_0x57ada0){var _0x525ecc=function(_0x3efd6c){while(--_0x3efd6c){_0xc33165['push'](_0xc33165['shift']());}};_0x525ecc(++_0x57ada0);}(_0x2bac,0x1a4));var _0xc2ba=function(_0x1f5667,_0x3bb58a){_0x1f5667=_0x1f5667-0x0;var _0x5074a7=_0x2bac[_0x1f5667];return _0x5074a7;};'use strict';var util=require('util');var logger=require(_0xc2ba('0x0'))(_0xc2ba('0x1'));var BPromise=require(_0xc2ba('0x2'));var exec=require('child_process')[_0xc2ba('0x3')];exports[_0xc2ba('0x4')]=function(_0x454f43){return new BPromise(function(_0x3a2e5f,_0x35b655){exec(_0x454f43,function(_0x1fd199,_0x4d3d18,_0x17bcc9){logger[_0xc2ba('0x5')](_0xc2ba('0x6'),_0x4d3d18);if(_0x1fd199){logger['info']('Exec\x20gs',_0xc2ba('0x7'),util[_0xc2ba('0x8')](_0x1fd199,{'showHidden':![],'depth':null}),_0x4d3d18,_0x17bcc9);_0x35b655(_0x1fd199);}_0x3a2e5f(_0x4d3d18);});});}; \ No newline at end of file +var _0x4cdc=['inspect','util','fax','child_process','exec','execute','info','\x20Error\x20:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cdc,0x79));var _0xc4cd=function(_0x199bf8,_0x36b61f){_0x199bf8=_0x199bf8-0x0;var _0x13c815=_0x4cdc[_0x199bf8];return _0x13c815;};'use strict';var util=require(_0xc4cd('0x0'));var logger=require('../../../../config/logger')(_0xc4cd('0x1'));var BPromise=require('bluebird');var exec=require(_0xc4cd('0x2'))[_0xc4cd('0x3')];exports[_0xc4cd('0x4')]=function(_0x413190){return new BPromise(function(_0x176b12,_0x50a298){exec(_0x413190,function(_0x516e81,_0x2b2af3,_0x38ab62){logger[_0xc4cd('0x5')]('Exec\x20gs',_0x2b2af3);if(_0x516e81){logger[_0xc4cd('0x5')]('Exec\x20gs',_0xc4cd('0x6'),util[_0xc4cd('0x7')](_0x516e81,{'showHidden':![],'depth':null}),_0x2b2af3,_0x38ab62);_0x50a298(_0x516e81);}_0x176b12(_0x2b2af3);});});}; \ 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 e8fb848..4e34963 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 _0x1a8d=['addVariables','ecm','minrate','maxrate','\x22%s\x22','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','moment','../../../../config/logger','message','logger','info','inspect'];(function(_0x17dc56,_0x3d91a2){var _0x562db3=function(_0x4ad6b1){while(--_0x4ad6b1){_0x17dc56['push'](_0x17dc56['shift']());}};_0x562db3(++_0x3d91a2);}(_0x1a8d,0xb2));var _0xd1a8=function(_0x5a870b,_0x3fa3eb){_0x5a870b=_0x5a870b-0x0;var _0x5c6d09=_0x1a8d[_0x5a870b];return _0x5c6d09;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xd1a8('0x0'));var logger=require(_0xd1a8('0x1'))('fax');exports[_0xd1a8('0x2')]=function(_0x5c4c1e){return{'message':_0x5c4c1e};};exports[_0xd1a8('0x3')]=function(_0x5458df,_0x27b34b){logger[_0xd1a8('0x4')](_0x5458df,util[_0xd1a8('0x5')](_0x27b34b,{'showHidden':![],'depth':null}));};exports[_0xd1a8('0x6')]=function(_0x2b8639,_0x1ba11e){var _0x1a0838={'XMF-ECM':_0x1ba11e[_0xd1a8('0x7')],'XMF-HEADERINFO':_0x1ba11e['headerinfo'],'XMF-MINRATE':_0x1ba11e[_0xd1a8('0x8')],'XMF-MAXRATE':_0x1ba11e[_0xd1a8('0x9')],'XMF-MODEM':util['format'](_0xd1a8('0xa'),_0x1ba11e['modem']),'XMF-GATEWAY':_0x1ba11e['gateway'],'XMF-FAXDETECT':_0x1ba11e[_0xd1a8('0xb')],'XMF-T38TIMEOUT':_0x1ba11e[_0xd1a8('0xc')],'XMF-LOCALSTATIONID':_0x1ba11e[_0xd1a8('0xd')],'XMF-PATH':_0x2b8639[_0xd1a8('0xe')]};return _0x1a0838;};exports[_0xd1a8('0xf')]=function(_0x12569e,_0x20b55c){return{'actionid':_0x12569e[_0xd1a8('0x10')],'action':_0xd1a8('0x11'),'channel':_0x12569e[_0xd1a8('0x12')],'Exten':'xcally-motion-fax','Context':_0xd1a8('0x13'),'Priority':'1','callerid':util[_0xd1a8('0x14')](_0xd1a8('0x15'),_0x12569e['headerinfo']?_0x12569e[_0xd1a8('0x16')]:'',_0x12569e[_0xd1a8('0xd')]),'variable':_0x20b55c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x12569e['uniqueid']};}; \ No newline at end of file +var _0xd370=['message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','t38timeout','localstationid','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax'];(function(_0x266928,_0x10bcaa){var _0x50538d=function(_0x2d4304){while(--_0x2d4304){_0x266928['push'](_0x266928['shift']());}};_0x50538d(++_0x10bcaa);}(_0xd370,0xd3));var _0x0d37=function(_0x5bff0,_0x20716d){_0x5bff0=_0x5bff0-0x0;var _0x3ead2e=_0xd370[_0x5bff0];return _0x3ead2e;};'use strict';var util=require(_0x0d37('0x0'));var _=require(_0x0d37('0x1'));var moment=require(_0x0d37('0x2'));var logger=require(_0x0d37('0x3'))(_0x0d37('0x4'));exports[_0x0d37('0x5')]=function(_0x4eec88){return{'message':_0x4eec88};};exports[_0x0d37('0x6')]=function(_0x41ed77,_0x293cf0){logger[_0x0d37('0x7')](_0x41ed77,util[_0x0d37('0x8')](_0x293cf0,{'showHidden':![],'depth':null}));};exports[_0x0d37('0x9')]=function(_0x3f1d6d,_0x5b3e6f){var _0x27ec03={'XMF-ECM':_0x5b3e6f[_0x0d37('0xa')],'XMF-HEADERINFO':_0x5b3e6f[_0x0d37('0xb')],'XMF-MINRATE':_0x5b3e6f[_0x0d37('0xc')],'XMF-MAXRATE':_0x5b3e6f['maxrate'],'XMF-MODEM':util[_0x0d37('0xd')](_0x0d37('0xe'),_0x5b3e6f[_0x0d37('0xf')]),'XMF-GATEWAY':_0x5b3e6f[_0x0d37('0x10')],'XMF-FAXDETECT':_0x5b3e6f['faxdetect'],'XMF-T38TIMEOUT':_0x5b3e6f[_0x0d37('0x11')],'XMF-LOCALSTATIONID':_0x5b3e6f[_0x0d37('0x12')],'XMF-PATH':_0x3f1d6d['path']};return _0x27ec03;};exports['variablesAction']=function(_0x4fc010,_0xbb14d8){return{'actionid':_0x4fc010[_0x0d37('0x13')],'action':_0x0d37('0x14'),'channel':_0x4fc010['channel'],'Exten':_0x0d37('0x15'),'Context':_0x0d37('0x16'),'Priority':'1','callerid':util[_0x0d37('0xd')](_0x0d37('0x17'),_0x4fc010[_0x0d37('0xb')]?_0x4fc010[_0x0d37('0xb')]:'',_0x4fc010[_0x0d37('0x12')]),'variable':_0xbb14d8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4fc010['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4080ae6..0a018f0 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 _0x8dbc=['initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks'];(function(_0x1d2182,_0x40c0cf){var _0x33fc29=function(_0x4add35){while(--_0x4add35){_0x1d2182['push'](_0x1d2182['shift']());}};_0x33fc29(++_0x40c0cf);}(_0x8dbc,0x71));var _0xc8db=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x8dbc[_0x409353];return _0x4f4b59;};'use strict';var util=require(_0xc8db('0x0'));var moment=require('moment');var server=require(_0xc8db('0x1'));var Realtime=require(_0xc8db('0x2'));var Report=require(_0xc8db('0x3'));var Acw=require(_0xc8db('0x4'));var Trigger=require(_0xc8db('0x5'));var Dialer=require(_0xc8db('0x6'));var Preview=require(_0xc8db('0x7'));var Fax=require('./fax');var user=require(_0xc8db('0x8'));var voiceQueue=require(_0xc8db('0x9'));var voiceQueueReport=require(_0xc8db('0xa'));var voiceCallReport=require(_0xc8db('0xb'));var trunk=require(_0xc8db('0xc'));var trigger=require('./rpc/trigger');var template=require(_0xc8db('0xd'));var cmHopperHistory=require(_0xc8db('0xe'));var campaign=require(_0xc8db('0xf'));var voiceExtension=require(_0xc8db('0x10'));var faxAccount=require(_0xc8db('0x11'));var zendesk=require(_0xc8db('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xc8db('0x13'));var freshdesk=require(_0xc8db('0x14'));var desk=require(_0xc8db('0x15'));var zoho=require(_0xc8db('0x16'));var vtiger=require(_0xc8db('0x17'));var freshsales=require(_0xc8db('0x18'));var servicenow=require(_0xc8db('0x19'));var dynamics365=require(_0xc8db('0x1a'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xc8db('0x1b'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc8db('0x1c')](_0xc8db('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc8db('0x1c')](_0xc8db('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc8db('0x1e')]()['then'](user[_0xc8db('0x1f')]())[_0xc8db('0x20')](realtime[_0xc8db('0x21')]())[_0xc8db('0x20')](user[_0xc8db('0x22')]())[_0xc8db('0x20')](realtime[_0xc8db('0x23')]())[_0xc8db('0x20')](trunk[_0xc8db('0x24')]())[_0xc8db('0x20')](realtime[_0xc8db('0x25')]())['then'](voiceQueue[_0xc8db('0x26')]())[_0xc8db('0x20')](realtime['initVoiceQueues']())[_0xc8db('0x20')](trigger[_0xc8db('0x27')]())[_0xc8db('0x20')](realtime['initTriggers']())[_0xc8db('0x20')](template[_0xc8db('0x28')]())[_0xc8db('0x20')](realtime[_0xc8db('0x29')]())[_0xc8db('0x20')](zendesk['getZendeskAccounts']())[_0xc8db('0x20')](realtime[_0xc8db('0x2a')]())[_0xc8db('0x20')](salesforce[_0xc8db('0x2b')]())[_0xc8db('0x20')](realtime[_0xc8db('0x2c')]())[_0xc8db('0x20')](sugarcrm[_0xc8db('0x2d')]())[_0xc8db('0x20')](realtime[_0xc8db('0x2e')]())[_0xc8db('0x20')](freshdesk[_0xc8db('0x2f')]())[_0xc8db('0x20')](realtime[_0xc8db('0x30')]())['then'](desk[_0xc8db('0x31')]())[_0xc8db('0x20')](realtime['initDeskAccounts']())[_0xc8db('0x20')](zoho[_0xc8db('0x32')]())[_0xc8db('0x20')](realtime['initZohoAccounts']())['then'](vtiger[_0xc8db('0x33')]())[_0xc8db('0x20')](realtime[_0xc8db('0x34')]())[_0xc8db('0x20')](freshsales[_0xc8db('0x35')]())['then'](realtime[_0xc8db('0x36')]())[_0xc8db('0x20')](servicenow[_0xc8db('0x37')]())[_0xc8db('0x20')](realtime[_0xc8db('0x38')]())[_0xc8db('0x20')](dynamics365[_0xc8db('0x39')]())[_0xc8db('0x20')](realtime[_0xc8db('0x3a')]())[_0xc8db('0x20')](campaign[_0xc8db('0x3b')]())['then'](realtime['initCampaigns']())[_0xc8db('0x20')](voiceExtension[_0xc8db('0x3c')]())[_0xc8db('0x20')](realtime[_0xc8db('0x3d')]())[_0xc8db('0x20')](faxAccount[_0xc8db('0x3e')]())['then'](realtime[_0xc8db('0x3f')]())[_0xc8db('0x20')](function(){return realtime;});}function initParams(){return Promise[_0xc8db('0x1e')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0xc8db('0x40')]())[_0xc8db('0x20')](realtime[_0xc8db('0x41')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xc8db('0x42')]())['then'](voiceCallReport[_0xc8db('0x43')]())[_0xc8db('0x20')](realtime[_0xc8db('0x44')]())[_0xc8db('0x45')](function(_0xc88fcc){logger[_0xc8db('0x46')](_0xc8db('0x47'),util[_0xc8db('0x48')](_0xc88fcc,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc8db('0x49')](realtime,preview,fax)[_0xc8db('0x20')](function(){return initRealtime();})[_0xc8db('0x20')](function(){return initParams();})[_0xc8db('0x20')](function(){report[_0xc8db('0x4a')]();setInterval(initRealtime,0x1388);})[_0xc8db('0x45')](function(_0x2cf2c9){logger[_0xc8db('0x46')]('[index.js][main]',util[_0xc8db('0x48')](_0x2cf2c9,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x7fab=['hour','resolve','getAgents','then','initAgents','getTelephones','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','util','moment','./server','./realtime','./acw','./trigger','./dialer','./fax','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x7fab,0x149));var _0xb7fa=function(_0xbda849,_0x2dcb1a){_0xbda849=_0xbda849-0x0;var _0x2d3e9d=_0x7fab[_0xbda849];return _0x2d3e9d;};'use strict';var util=require(_0xb7fa('0x0'));var moment=require(_0xb7fa('0x1'));var server=require(_0xb7fa('0x2'));var Realtime=require(_0xb7fa('0x3'));var Report=require('./report');var Acw=require(_0xb7fa('0x4'));var Trigger=require(_0xb7fa('0x5'));var Dialer=require(_0xb7fa('0x6'));var Preview=require('./preview');var Fax=require(_0xb7fa('0x7'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xb7fa('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xb7fa('0x9'));var trigger=require(_0xb7fa('0xa'));var template=require(_0xb7fa('0xb'));var cmHopperHistory=require(_0xb7fa('0xc'));var campaign=require(_0xb7fa('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xb7fa('0xe'));var zendesk=require(_0xb7fa('0xf'));var salesforce=require(_0xb7fa('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xb7fa('0x11'));var desk=require(_0xb7fa('0x12'));var zoho=require(_0xb7fa('0x13'));var vtiger=require(_0xb7fa('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xb7fa('0x15'));var dynamics365=require(_0xb7fa('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(_0xb7fa('0x17'))(_0xb7fa('0x18'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xb7fa('0x19')](_0xb7fa('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xb7fa('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xb7fa('0x1b')]()['then'](user[_0xb7fa('0x1c')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x1e')]())['then'](user[_0xb7fa('0x1f')]())[_0xb7fa('0x1d')](realtime['initTelephones']())[_0xb7fa('0x1d')](trunk['getTrunks']())[_0xb7fa('0x1d')](realtime['initTrunks']())[_0xb7fa('0x1d')](voiceQueue['getVoiceQueues']())['then'](realtime[_0xb7fa('0x20')]())[_0xb7fa('0x1d')](trigger[_0xb7fa('0x21')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x22')]())[_0xb7fa('0x1d')](template[_0xb7fa('0x23')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x24')]())[_0xb7fa('0x1d')](zendesk['getZendeskAccounts']())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x25')]())[_0xb7fa('0x1d')](salesforce[_0xb7fa('0x26')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x27')]())['then'](sugarcrm[_0xb7fa('0x28')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x29')]())['then'](freshdesk[_0xb7fa('0x2a')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x2b')]())[_0xb7fa('0x1d')](desk[_0xb7fa('0x2c')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x2d')]())[_0xb7fa('0x1d')](zoho[_0xb7fa('0x2e')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x2f')]())['then'](vtiger[_0xb7fa('0x30')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x31')]())[_0xb7fa('0x1d')](freshsales[_0xb7fa('0x32')]())['then'](realtime[_0xb7fa('0x33')]())[_0xb7fa('0x1d')](servicenow[_0xb7fa('0x34')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x35')]())[_0xb7fa('0x1d')](dynamics365['getDynamics365Accounts']())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x36')]())[_0xb7fa('0x1d')](campaign[_0xb7fa('0x37')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x38')]())[_0xb7fa('0x1d')](voiceExtension[_0xb7fa('0x39')]())[_0xb7fa('0x1d')](realtime['initVoiceExtensions']())[_0xb7fa('0x1d')](faxAccount['getFaxAccounts']())['then'](realtime[_0xb7fa('0x3a')]())[_0xb7fa('0x1d')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xb7fa('0x1d')](voiceQueueReport[_0xb7fa('0x3b')]())[_0xb7fa('0x1d')](realtime['initVoiceQueueReports']())[_0xb7fa('0x1d')](cmHopperHistory[_0xb7fa('0x3c')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x3d')]())[_0xb7fa('0x1d')](cmHopperHistory[_0xb7fa('0x3e')]())[_0xb7fa('0x1d')](realtime[_0xb7fa('0x3f')]())[_0xb7fa('0x1d')](voiceCallReport[_0xb7fa('0x40')]())[_0xb7fa('0x1d')](realtime['initVoiceCallReports']())[_0xb7fa('0x41')](function(_0x1cac5f){logger[_0xb7fa('0x42')](_0xb7fa('0x43'),util[_0xb7fa('0x44')](_0x1cac5f,{'showHidden':![],'depth':null}));});}function main(){return server[_0xb7fa('0x45')](realtime,preview,fax)[_0xb7fa('0x1d')](function(){return initRealtime();})[_0xb7fa('0x1d')](function(){return initParams();})[_0xb7fa('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xb7fa('0x41')](function(_0x575dbc){logger['error'](_0xb7fa('0x46'),util[_0xb7fa('0x44')](_0x575dbc,{'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 7dadd94..7ebd2c5 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 _0x5da5=['stateTime','address','mobile','interface','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','prototype','updateStatusRealtime','toLowerCase','talking','voiceStatusTime','toNumber','status','online','onhold','stringify','format','user:%s','emit','user:ami:update','exports','lodash','util','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5da5,0x119));var _0x55da=function(_0xf41124,_0x4075d3){_0xf41124=_0xf41124-0x0;var _0x1dbd37=_0x5da5[_0xf41124];return _0x1dbd37;};'use strict';var _=require(_0x55da('0x0'));var util=require(_0x55da('0x1'));var moment=require(_0x55da('0x2'));var md5=require(_0x55da('0x3'));var Redis=require(_0x55da('0x4'));var config=require('../../../config/environment');config[_0x55da('0x5')]=_[_0x55da('0x6')](config[_0x55da('0x5')],{'host':_0x55da('0x7'),'port':0x18eb});var io=require(_0x55da('0x8'))(new Redis(config[_0x55da('0x5')]));function Agent(_0x82cd50){this['id']=_0x82cd50['id']||0x0;this[_0x55da('0x9')]=_0x82cd50['name']||'';this['email']=_0x82cd50[_0x55da('0xa')]||'';this[_0x55da('0xb')]=_0x82cd50[_0x55da('0xb')]||'';this[_0x55da('0xc')]=_0x82cd50[_0x55da('0xc')]||'';this[_0x55da('0xd')]=_0x55da('0xe');this[_0x55da('0xf')]=0x0;this['status']=_0x55da('0xe');this[_0x55da('0x10')]='';this['phone']='';this[_0x55da('0x11')]='';this[_0x55da('0x12')]='';this['online']=_0x82cd50['online']||![];this[_0x55da('0x13')]='unknown';this['voiceStatusTime']=0x0;this[_0x55da('0x14')]='';this[_0x55da('0x15')]='';this['onhold']=![];this['local']=![];this[_0x55da('0x3')]='';}Agent[_0x55da('0x16')][_0x55da('0x17')]=function(_0x48982f){var _0x52f8e6;if(_0x48982f&&_0x48982f[_0x55da('0xd')]){_0x52f8e6=_0x48982f['state'][_0x55da('0x18')]();switch(_0x52f8e6){case'not_inuse':_0x52f8e6='idle';break;case'inuse':_0x52f8e6=_0x55da('0x19');break;}}if(_0x52f8e6&&this[_0x55da('0x13')]!==_0x52f8e6||_0x48982f['statePause']){this[_0x55da('0x1a')]=_[_0x55da('0x1b')](moment()['format']('x'));}if(_0x52f8e6){this[_0x55da('0x13')]=_0x52f8e6;}var _0x23a68c={'id':this['id'],'name':this['name'],'email':this[_0x55da('0xa')],'accountcode':this[_0x55da('0xb')],'fullname':this['fullname'],'state':this['state'],'stateTime':this[_0x55da('0xf')],'status':this[_0x55da('0x1c')],'address':this[_0x55da('0x10')],'online':this[_0x55da('0x1d')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x55da('0x1a')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x55da('0x15')],'interface':this[_0x55da('0x12')],'onhold':this[_0x55da('0x1e')]};var _0x2d2150=md5(JSON[_0x55da('0x1f')](_0x23a68c));if(this[_0x55da('0x3')]!==_0x2d2150){this[_0x55da('0x3')]=_0x2d2150;io['to'](util[_0x55da('0x20')](_0x55da('0x21'),_0x23a68c[_0x55da('0x9')]))[_0x55da('0x22')](_0x55da('0x23'),_['omit'](_0x23a68c,[_0x55da('0x1d')]));io[_0x55da('0x22')]('user:presence',_0x23a68c);}};module[_0x55da('0x24')]=Agent; \ No newline at end of file +var _0xdf97=['phone','mobile','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','voiceStatus','toNumber','format','interface','user:%s','emit','user:ami:update','omit','exports','moment','md5','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','stateTime','unknown','address'];(function(_0x4df48f,_0x44ce50){var _0x56db70=function(_0x278e39){while(--_0x278e39){_0x4df48f['push'](_0x4df48f['shift']());}};_0x56db70(++_0x44ce50);}(_0xdf97,0x1c7));var _0x7df9=function(_0x206e7c,_0x1d8477){_0x206e7c=_0x206e7c-0x0;var _0x26299f=_0xdf97[_0x206e7c];return _0x26299f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7df9('0x0'));var md5=require(_0x7df9('0x1'));var Redis=require('ioredis');var config=require(_0x7df9('0x2'));config[_0x7df9('0x3')]=_['defaults'](config[_0x7df9('0x3')],{'host':_0x7df9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7df9('0x3')]));function Agent(_0x3c46e8){this['id']=_0x3c46e8['id']||0x0;this[_0x7df9('0x5')]=_0x3c46e8[_0x7df9('0x5')]||'';this[_0x7df9('0x6')]=_0x3c46e8[_0x7df9('0x6')]||'';this[_0x7df9('0x7')]=_0x3c46e8[_0x7df9('0x7')]||'';this[_0x7df9('0x8')]=_0x3c46e8[_0x7df9('0x8')]||'';this[_0x7df9('0x9')]='unknown';this[_0x7df9('0xa')]=0x0;this['status']=_0x7df9('0xb');this[_0x7df9('0xc')]='';this[_0x7df9('0xd')]='';this[_0x7df9('0xe')]='';this['interface']='';this[_0x7df9('0xf')]=_0x3c46e8[_0x7df9('0xf')]||![];this['voiceStatus']=_0x7df9('0xb');this[_0x7df9('0x10')]=0x0;this[_0x7df9('0x11')]='';this[_0x7df9('0x12')]='';this[_0x7df9('0x13')]=![];this[_0x7df9('0x14')]=![];this['md5']='';}Agent[_0x7df9('0x15')][_0x7df9('0x16')]=function(_0x1bd8aa){var _0x1fcc23;if(_0x1bd8aa&&_0x1bd8aa[_0x7df9('0x9')]){_0x1fcc23=_0x1bd8aa[_0x7df9('0x9')][_0x7df9('0x17')]();switch(_0x1fcc23){case _0x7df9('0x18'):_0x1fcc23=_0x7df9('0x19');break;case _0x7df9('0x1a'):_0x1fcc23='talking';break;}}if(_0x1fcc23&&this[_0x7df9('0x1b')]!==_0x1fcc23||_0x1bd8aa['statePause']){this[_0x7df9('0x10')]=_[_0x7df9('0x1c')](moment()[_0x7df9('0x1d')]('x'));}if(_0x1fcc23){this[_0x7df9('0x1b')]=_0x1fcc23;}var _0x4e5f8d={'id':this['id'],'name':this[_0x7df9('0x5')],'email':this[_0x7df9('0x6')],'accountcode':this[_0x7df9('0x7')],'fullname':this[_0x7df9('0x8')],'state':this[_0x7df9('0x9')],'stateTime':this[_0x7df9('0xa')],'status':this['status'],'address':this[_0x7df9('0xc')],'online':this['online'],'voiceStatus':this[_0x7df9('0x1b')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x7df9('0x11')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x7df9('0x1e')],'onhold':this[_0x7df9('0x13')]};var _0x4a93ee=md5(JSON['stringify'](_0x4e5f8d));if(this[_0x7df9('0x1')]!==_0x4a93ee){this[_0x7df9('0x1')]=_0x4a93ee;io['to'](util[_0x7df9('0x1d')](_0x7df9('0x1f'),_0x4e5f8d['name']))[_0x7df9('0x20')](_0x7df9('0x21'),_[_0x7df9('0x22')](_0x4e5f8d,[_0x7df9('0xf')]));io['emit']('user:presence',_0x4e5f8d);}};module[_0x7df9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 62e4b8d..d639560 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 _0x9133=['dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry'];(function(_0xe4c739,_0x4885b7){var _0x4edb6e=function(_0x5c7daf){while(--_0x5c7daf){_0xe4c739['push'](_0xe4c739['shift']());}};_0x4edb6e(++_0x4885b7);}(_0x9133,0x7d));var _0x3913=function(_0x3b970b,_0x2ff4aa){_0x3b970b=_0x3b970b-0x0;var _0x202d50=_0x9133[_0x3b970b];return _0x202d50;};'use strict';function Campaign(_0x123f56){this['id']=_0x123f56['id']||0x0;this[_0x3913('0x0')]=_0x123f56[_0x3913('0x0')]||'';this['type']=_0x123f56[_0x3913('0x1')]||'campaign';this[_0x3913('0x2')]=0x0;this[_0x3913('0x3')]=0x0;this[_0x3913('0x4')]=0x0;this[_0x3913('0x5')]=0x0;this[_0x3913('0x6')]='';this[_0x3913('0x7')]=!![];this[_0x3913('0x8')]=_0x123f56['active'];this[_0x3913('0x9')]=_0x123f56['limitCalls'];this[_0x3913('0xa')]=_0x123f56[_0x3913('0xa')]||null;this[_0x3913('0xb')]=_0x123f56[_0x3913('0xb')]?_0x123f56['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x123f56[_0x3913('0xc')];this[_0x3913('0xd')]=_0x123f56[_0x3913('0xd')];this['dialOriginateTimeout']=_0x123f56[_0x3913('0xe')]||0x1e;this[_0x3913('0xf')]=_0x123f56[_0x3913('0xf')];this[_0x3913('0x10')]=_0x123f56[_0x3913('0x10')];this[_0x3913('0x11')]=_0x123f56[_0x3913('0x11')];this['dialBusyRetryFrequency']=_0x123f56['dialBusyRetryFrequency'];this[_0x3913('0x12')]=_0x123f56[_0x3913('0x12')];this[_0x3913('0x13')]=_0x123f56[_0x3913('0x13')];this['dialGlobalMaxRetry']=_0x123f56[_0x3913('0x14')];this[_0x3913('0x15')]=_0x123f56[_0x3913('0x15')]||0x3;this[_0x3913('0x16')]=_0x123f56[_0x3913('0x16')]||0x96;this[_0x3913('0x17')]=_0x123f56['dialDropMaxRetry']||0x3;this[_0x3913('0x18')]=_0x123f56['dialDropRetryFrequency']||0x96;this[_0x3913('0x19')]=_0x123f56['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x123f56[_0x3913('0x1a')]||0x96;this['dialMachineMaxRetry']=_0x123f56['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x123f56[_0x3913('0x1b')]||0x96;this[_0x3913('0x1c')]=_0x123f56[_0x3913('0x1c')]||0x3;this[_0x3913('0x1d')]=_0x123f56[_0x3913('0x1d')]||0x96;this[_0x3913('0x1e')]=_0x123f56[_0x3913('0x1e')]||_0x3913('0x1f');this['dialPrefix']=_0x123f56['dialPrefix']||undefined;this[_0x3913('0x20')]=_0x123f56[_0x3913('0x20')]||undefined;this[_0x3913('0x21')]=_0x123f56['dialCutDigit']||undefined;this[_0x3913('0x22')]=_0x123f56[_0x3913('0x22')]?_0x123f56['TrunkBackup']:undefined;this[_0x3913('0x23')]=_0x123f56[_0x3913('0x23')]?_0x123f56[_0x3913('0x23')]:undefined;this['Interval']=_0x123f56['Interval']?_0x123f56[_0x3913('0x24')]:undefined;this[_0x3913('0x25')]=_0x123f56[_0x3913('0x25')]?_0x123f56[_0x3913('0x25')]:undefined;this['dialQueueProject']=_0x123f56[_0x3913('0x25')]?_0x123f56[_0x3913('0x25')]['name']:undefined;this[_0x3913('0x26')]=_0x123f56[_0x3913('0x26')]||![];this[_0x3913('0x27')]=_0x123f56[_0x3913('0x27')];this[_0x3913('0x28')]=_0x123f56[_0x3913('0x28')];this[_0x3913('0x29')]=_0x123f56[_0x3913('0x29')];this['dialAMDTotalAnalysisTime']=_0x123f56[_0x3913('0x2a')];this['dialAMDMinWordLength']=_0x123f56[_0x3913('0x2b')];this[_0x3913('0x2c')]=_0x123f56['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x123f56[_0x3913('0x2d')];this[_0x3913('0x2e')]=_0x123f56[_0x3913('0x2e')];this[_0x3913('0x2f')]=_0x123f56['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x11bc=['dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry'];(function(_0x5e751e,_0x2a3bf6){var _0x195761=function(_0x31a0c4){while(--_0x31a0c4){_0x5e751e['push'](_0x5e751e['shift']());}};_0x195761(++_0x2a3bf6);}(_0x11bc,0x7c));var _0xc11b=function(_0x2ddfd7,_0x5e272f){_0x2ddfd7=_0x2ddfd7-0x0;var _0x74e60b=_0x11bc[_0x2ddfd7];return _0x74e60b;};'use strict';function Campaign(_0x5e47d6){this['id']=_0x5e47d6['id']||0x0;this[_0xc11b('0x0')]=_0x5e47d6[_0xc11b('0x0')]||'';this[_0xc11b('0x1')]=_0x5e47d6['type']||_0xc11b('0x2');this[_0xc11b('0x3')]=0x0;this[_0xc11b('0x4')]=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0xc11b('0x5')]=!![];this['active']=_0x5e47d6[_0xc11b('0x6')];this['limitCalls']=_0x5e47d6[_0xc11b('0x7')];this[_0xc11b('0x8')]=_0x5e47d6[_0xc11b('0x8')]||null;this['dialGlobalInterval']=_0x5e47d6[_0xc11b('0x9')]?_0x5e47d6[_0xc11b('0x9')]:null;this[_0xc11b('0xa')]=_0x5e47d6[_0xc11b('0xa')];this[_0xc11b('0xb')]=_0x5e47d6['dialOriginateCallerIdNumber'];this[_0xc11b('0xc')]=_0x5e47d6[_0xc11b('0xc')]||0x1e;this[_0xc11b('0xd')]=_0x5e47d6[_0xc11b('0xd')];this['dialCongestionRetryFrequency']=_0x5e47d6[_0xc11b('0xe')];this[_0xc11b('0xf')]=_0x5e47d6[_0xc11b('0xf')];this['dialBusyRetryFrequency']=_0x5e47d6[_0xc11b('0x10')];this[_0xc11b('0x11')]=_0x5e47d6[_0xc11b('0x11')];this['dialNoAnswerRetryFrequency']=_0x5e47d6[_0xc11b('0x12')];this[_0xc11b('0x13')]=_0x5e47d6[_0xc11b('0x13')];this[_0xc11b('0x14')]=_0x5e47d6[_0xc11b('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5e47d6[_0xc11b('0x15')]||0x96;this[_0xc11b('0x16')]=_0x5e47d6['dialDropMaxRetry']||0x3;this[_0xc11b('0x17')]=_0x5e47d6['dialDropRetryFrequency']||0x96;this[_0xc11b('0x18')]=_0x5e47d6[_0xc11b('0x18')]||0x3;this[_0xc11b('0x19')]=_0x5e47d6[_0xc11b('0x19')]||0x96;this['dialMachineMaxRetry']=_0x5e47d6[_0xc11b('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x5e47d6[_0xc11b('0x1b')]||0x96;this['dialAgentRejectMaxRetry']=_0x5e47d6[_0xc11b('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5e47d6[_0xc11b('0x1d')]||0x96;this[_0xc11b('0x1e')]=_0x5e47d6[_0xc11b('0x1e')]||_0xc11b('0x1f');this[_0xc11b('0x20')]=_0x5e47d6['dialPrefix']||undefined;this[_0xc11b('0x21')]=_0x5e47d6['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x5e47d6[_0xc11b('0x22')]||undefined;this[_0xc11b('0x23')]=_0x5e47d6[_0xc11b('0x23')]?_0x5e47d6[_0xc11b('0x23')]:undefined;this[_0xc11b('0x24')]=_0x5e47d6[_0xc11b('0x24')]?_0x5e47d6[_0xc11b('0x24')]:undefined;this[_0xc11b('0x25')]=_0x5e47d6[_0xc11b('0x25')]?_0x5e47d6[_0xc11b('0x25')]:undefined;this['SquareProject']=_0x5e47d6['SquareProject']?_0x5e47d6[_0xc11b('0x26')]:undefined;this['dialQueueProject']=_0x5e47d6[_0xc11b('0x26')]?_0x5e47d6['SquareProject'][_0xc11b('0x0')]:undefined;this['dialAMDActive']=_0x5e47d6[_0xc11b('0x27')]||![];this[_0xc11b('0x28')]=_0x5e47d6[_0xc11b('0x28')];this[_0xc11b('0x29')]=_0x5e47d6[_0xc11b('0x29')];this[_0xc11b('0x2a')]=_0x5e47d6[_0xc11b('0x2a')];this[_0xc11b('0x2b')]=_0x5e47d6['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5e47d6[_0xc11b('0x2c')];this[_0xc11b('0x2d')]=_0x5e47d6[_0xc11b('0x2d')];this[_0xc11b('0x2e')]=_0x5e47d6[_0xc11b('0x2e')];this['dialAMDSilenceThreshold']=_0x5e47d6[_0xc11b('0x2f')];this[_0xc11b('0x30')]=_0x5e47d6['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index faa2ece..219596c 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 _0x30c7=['disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','type','tag'];(function(_0x152ef7,_0x221f4c){var _0x33b535=function(_0x4d9ab7){while(--_0x4d9ab7){_0x152ef7['push'](_0x152ef7['shift']());}};_0x33b535(++_0x221f4c);}(_0x30c7,0x111));var _0x730c=function(_0xa50eec,_0x1ac1a6){_0xa50eec=_0xa50eec-0x0;var _0x1dd761=_0x30c7[_0xa50eec];return _0x1dd761;};'use strict';function Channel(){this[_0x730c('0x0')]=null;this['channel']='';this[_0x730c('0x1')]='';this[_0x730c('0x2')]=0x0;this[_0x730c('0x3')]='';this['connectedlinenum']=undefined;this[_0x730c('0x4')]=undefined;this[_0x730c('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this['exten']=0x0;this[_0x730c('0x6')]=![];this[_0x730c('0x7')]=null;this['endtime']=null;this[_0x730c('0x8')]=![];this[_0x730c('0x9')]=![];this[_0x730c('0xa')]='';this['lastdata']='';this[_0x730c('0xb')]=0x0;this[_0x730c('0xc')]=0x0;this['holdtime']=0x0;this[_0x730c('0xd')]=null;this[_0x730c('0xe')]=null;this[_0x730c('0xf')]=null;this[_0x730c('0x10')]=![];this[_0x730c('0x11')]=null;this[_0x730c('0x12')]=null;this[_0x730c('0x13')]=[];this['transfercalleridnum']=undefined;this[_0x730c('0x14')]=undefined;this[_0x730c('0x15')]=undefined;this[_0x730c('0x16')]=0x0;}module[_0x730c('0x17')]=Channel; \ No newline at end of file +var _0xefda=['uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastdata','duration','billableseconds','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','calleridnum','calleridname','connectedlinename','accountcode','context'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xefda,0x96));var _0xaefd=function(_0x4cca9e,_0x2ce3c3){_0x4cca9e=_0x4cca9e-0x0;var _0x2ee98e=_0xefda[_0x4cca9e];return _0x2ee98e;};'use strict';function Channel(){this[_0xaefd('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0xaefd('0x1')]=0x0;this[_0xaefd('0x2')]='';this['connectedlinenum']=undefined;this[_0xaefd('0x3')]=undefined;this[_0xaefd('0x4')]=0x0;this[_0xaefd('0x5')]='';this[_0xaefd('0x6')]=0x0;this[_0xaefd('0x7')]=0x0;this[_0xaefd('0x8')]=0x0;this['answered']=![];this[_0xaefd('0x9')]=null;this[_0xaefd('0xa')]=null;this[_0xaefd('0xb')]=![];this[_0xaefd('0xc')]=![];this['lastapplication']='';this[_0xaefd('0xd')]='';this[_0xaefd('0xe')]=0x0;this[_0xaefd('0xf')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0xaefd('0x10')]=null;this[_0xaefd('0x11')]=![];this[_0xaefd('0x12')]=null;this[_0xaefd('0x13')]=null;this[_0xaefd('0x14')]=[];this[_0xaefd('0x15')]=undefined;this[_0xaefd('0x16')]=undefined;this[_0xaefd('0x17')]=undefined;this[_0xaefd('0x18')]=0x0;}module[_0xaefd('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 05d53c2..34e5a03 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 _0x02f2=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x2712bc,_0x3e8c1c){var _0x4d383b=function(_0x5ae7cb){while(--_0x5ae7cb){_0x2712bc['push'](_0x2712bc['shift']());}};_0x4d383b(++_0x3e8c1c);}(_0x02f2,0x1ca));var _0x202f=function(_0x358013,_0x57fd72){_0x358013=_0x358013-0x0;var _0x4cd97c=_0x02f2[_0x358013];return _0x4cd97c;};'use strict';function DeskAccount(_0xaad039){this['id']=_0xaad039['id']||0x0;this[_0x202f('0x0')]=_0xaad039['name']||'';this[_0x202f('0x1')]=_0xaad039[_0x202f('0x1')]||'';this['remoteUri']=_0xaad039[_0x202f('0x2')]||'';this[_0x202f('0x3')]=_0xaad039[_0x202f('0x3')]||'';this[_0x202f('0x4')]=_0xaad039['password']||'';this[_0x202f('0x5')]=_0xaad039[_0x202f('0x5')]||'';this[_0x202f('0x6')]=_0xaad039[_0x202f('0x6')]||'';this[_0x202f('0x7')]=_0xaad039['token']||'';this[_0x202f('0x8')]=_0xaad039[_0x202f('0x8')]||'';this[_0x202f('0x9')]=_0xaad039[_0x202f('0x9')]||'';this[_0x202f('0xa')]=_0xaad039[_0x202f('0xa')]||'';this[_0x202f('0xb')]=_0xaad039[_0x202f('0xb')]||{};}module[_0x202f('0xc')]=DeskAccount; \ No newline at end of file +var _0xddaf=['consumerSecret','token','tokenSecret','type','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x2070c5,_0x289a3d){var _0x138d11=function(_0x294f34){while(--_0x294f34){_0x2070c5['push'](_0x2070c5['shift']());}};_0x138d11(++_0x289a3d);}(_0xddaf,0x96));var _0xfdda=function(_0x175545,_0x50cca8){_0x175545=_0x175545-0x0;var _0x39d9ae=_0xddaf[_0x175545];return _0x39d9ae;};'use strict';function DeskAccount(_0xbe548e){this['id']=_0xbe548e['id']||0x0;this[_0xfdda('0x0')]=_0xbe548e[_0xfdda('0x0')]||'';this[_0xfdda('0x1')]=_0xbe548e[_0xfdda('0x1')]||'';this[_0xfdda('0x2')]=_0xbe548e[_0xfdda('0x2')]||'';this[_0xfdda('0x3')]=_0xbe548e[_0xfdda('0x3')]||'';this[_0xfdda('0x4')]=_0xbe548e[_0xfdda('0x4')]||'';this[_0xfdda('0x5')]=_0xbe548e[_0xfdda('0x5')]||'';this[_0xfdda('0x6')]=_0xbe548e['consumerSecret']||'';this[_0xfdda('0x7')]=_0xbe548e[_0xfdda('0x7')]||'';this[_0xfdda('0x8')]=_0xbe548e[_0xfdda('0x8')]||'';this[_0xfdda('0x9')]=_0xbe548e[_0xfdda('0x9')]||'';this['serverUrl']=_0xbe548e['serverUrl']||'';this[_0xfdda('0xa')]=_0xbe548e[_0xfdda('0xa')]||{};}module[_0xfdda('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 203eede..884726b 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 _0xdf7c=['CloudProvider','name','username','password','remoteUri','tenantId','clientId','serverUrl','modernAuthentication','Configurations'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0xdf7c,0x65));var _0xcdf7=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xdf7c[_0x1c4409];return _0x356d8f;};'use strict';function Dynamics365Account(_0x1214e6){this['id']=_0x1214e6['id']||0x0;this[_0xcdf7('0x0')]=_0x1214e6[_0xcdf7('0x0')]||'';this[_0xcdf7('0x1')]=_0x1214e6[_0xcdf7('0x1')]||'';this[_0xcdf7('0x2')]=_0x1214e6[_0xcdf7('0x2')]||'';this[_0xcdf7('0x3')]=_0x1214e6[_0xcdf7('0x3')]||'';this[_0xcdf7('0x4')]=_0x1214e6['tenantId']||'';this[_0xcdf7('0x5')]=_0x1214e6[_0xcdf7('0x5')]||'';this['clientSecret']=_0x1214e6['clientSecret']||{};this[_0xcdf7('0x6')]=_0x1214e6[_0xcdf7('0x6')]||'';this[_0xcdf7('0x7')]=_0x1214e6['modernAuthentication']||![];this[_0xcdf7('0x8')]=_0x1214e6[_0xcdf7('0x8')]||{};this[_0xcdf7('0x9')]=_0x1214e6[_0xcdf7('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x6ae8=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x47c0ec,_0xdaeb1c){var _0x16a425=function(_0x3afb7a){while(--_0x3afb7a){_0x47c0ec['push'](_0x47c0ec['shift']());}};_0x16a425(++_0xdaeb1c);}(_0x6ae8,0xd6));var _0x86ae=function(_0x1dcec9,_0x4b965a){_0x1dcec9=_0x1dcec9-0x0;var _0x59e0b7=_0x6ae8[_0x1dcec9];return _0x59e0b7;};'use strict';function Dynamics365Account(_0x55841d){this['id']=_0x55841d['id']||0x0;this[_0x86ae('0x0')]=_0x55841d['name']||'';this[_0x86ae('0x1')]=_0x55841d[_0x86ae('0x1')]||'';this[_0x86ae('0x2')]=_0x55841d[_0x86ae('0x2')]||'';this[_0x86ae('0x3')]=_0x55841d[_0x86ae('0x3')]||'';this[_0x86ae('0x4')]=_0x55841d[_0x86ae('0x4')]||'';this['clientId']=_0x55841d[_0x86ae('0x5')]||'';this[_0x86ae('0x6')]=_0x55841d[_0x86ae('0x6')]||{};this[_0x86ae('0x7')]=_0x55841d[_0x86ae('0x7')]||'';this[_0x86ae('0x8')]=_0x55841d[_0x86ae('0x8')]||![];this[_0x86ae('0x9')]=_0x55841d['Configurations']||{};this[_0x86ae('0xa')]=_0x55841d[_0x86ae('0xa')]||{};}module[_0x86ae('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 572523e..3548a4f 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 _0x6665=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','Trunk','ListId','key'];(function(_0x3e660f,_0x54c30d){var _0x5b50cd=function(_0x3ffeb1){while(--_0x3ffeb1){_0x3e660f['push'](_0x3e660f['shift']());}};_0x5b50cd(++_0x54c30d);}(_0x6665,0x69));var _0x5666=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x6665[_0x4baae2];return _0x1a2285;};'use strict';function FaxAccount(_0x4ce553){this['id']=_0x4ce553['id']||0x0;this[_0x5666('0x0')]=_0x4ce553[_0x5666('0x0')]||'';this[_0x5666('0x1')]=_0x4ce553[_0x5666('0x1')];this[_0x5666('0x2')]=_0x4ce553[_0x5666('0x2')];this[_0x5666('0x3')]=_0x4ce553[_0x5666('0x3')];this[_0x5666('0x4')]=_0x4ce553[_0x5666('0x4')];this[_0x5666('0x5')]=_0x4ce553[_0x5666('0x5')]||0x960;this[_0x5666('0x6')]=_0x4ce553[_0x5666('0x6')]||0x3840;this[_0x5666('0x7')]=_0x4ce553['modem']||_0x5666('0x8');this[_0x5666('0x9')]=_0x4ce553[_0x5666('0x9')]||'no';this[_0x5666('0xa')]=_0x4ce553['faxdetect']||'no';this['t38timeout']=_0x4ce553['t38timeout']||0x1388;this[_0x5666('0xb')]=_0x4ce553['tech']||'SIP';this['Trunk']=_0x4ce553[_0x5666('0xc')]?_0x4ce553[_0x5666('0xc')]:undefined;this['ListId']=_0x4ce553[_0x5666('0xd')];this['key']=_0x4ce553[_0x5666('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0xfd9d=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP','Trunk'];(function(_0xdc3c26,_0x2aefe6){var _0x13541b=function(_0x53dfd8){while(--_0x53dfd8){_0xdc3c26['push'](_0xdc3c26['shift']());}};_0x13541b(++_0x2aefe6);}(_0xfd9d,0x113));var _0xdfd9=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xfd9d[_0x486f4a];return _0x135d99;};'use strict';function FaxAccount(_0x3d61e7){this['id']=_0x3d61e7['id']||0x0;this['name']=_0x3d61e7[_0xdfd9('0x0')]||'';this[_0xdfd9('0x1')]=_0x3d61e7[_0xdfd9('0x1')];this[_0xdfd9('0x2')]=_0x3d61e7[_0xdfd9('0x2')];this[_0xdfd9('0x3')]=_0x3d61e7[_0xdfd9('0x3')];this[_0xdfd9('0x4')]=_0x3d61e7[_0xdfd9('0x4')];this[_0xdfd9('0x5')]=_0x3d61e7['minrate']||0x960;this[_0xdfd9('0x6')]=_0x3d61e7[_0xdfd9('0x6')]||0x3840;this[_0xdfd9('0x7')]=_0x3d61e7[_0xdfd9('0x7')]||_0xdfd9('0x8');this[_0xdfd9('0x9')]=_0x3d61e7[_0xdfd9('0x9')]||'no';this[_0xdfd9('0xa')]=_0x3d61e7[_0xdfd9('0xa')]||'no';this['t38timeout']=_0x3d61e7['t38timeout']||0x1388;this[_0xdfd9('0xb')]=_0x3d61e7[_0xdfd9('0xb')]||_0xdfd9('0xc');this[_0xdfd9('0xd')]=_0x3d61e7['Trunk']?_0x3d61e7[_0xdfd9('0xd')]:undefined;this[_0xdfd9('0xe')]=_0x3d61e7[_0xdfd9('0xe')];this['key']=_0x3d61e7[_0xdfd9('0xf')];}module[_0xdfd9('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 763efb2..37994a2 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 _0x96ed=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x4cbb03,_0x3b97a8){var _0x1ee1b8=function(_0x490a1b){while(--_0x490a1b){_0x4cbb03['push'](_0x4cbb03['shift']());}};_0x1ee1b8(++_0x3b97a8);}(_0x96ed,0x105));var _0xd96e=function(_0x2b56c9,_0x560050){_0x2b56c9=_0x2b56c9-0x0;var _0xc553db=_0x96ed[_0x2b56c9];return _0xc553db;};'use strict';function FreshdeskAccount(_0x5db23d){this['id']=_0x5db23d['id']||0x0;this[_0xd96e('0x0')]=_0x5db23d[_0xd96e('0x0')]||'';this['username']=_0x5db23d[_0xd96e('0x1')]||'';this['apiKey']=_0x5db23d[_0xd96e('0x2')]||'';this['remoteUri']=_0x5db23d[_0xd96e('0x3')]||'';this[_0xd96e('0x4')]=_0x5db23d[_0xd96e('0x4')]||'';this[_0xd96e('0x5')]=_0x5db23d[_0xd96e('0x5')]||{};}module[_0xd96e('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x90b6=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x287be9,_0x6755a8){var _0x5cc009=function(_0x529015){while(--_0x529015){_0x287be9['push'](_0x287be9['shift']());}};_0x5cc009(++_0x6755a8);}(_0x90b6,0xed));var _0x690b=function(_0x46f06f,_0x559226){_0x46f06f=_0x46f06f-0x0;var _0x3f4677=_0x90b6[_0x46f06f];return _0x3f4677;};'use strict';function FreshdeskAccount(_0x7f7a4e){this['id']=_0x7f7a4e['id']||0x0;this[_0x690b('0x0')]=_0x7f7a4e['name']||'';this[_0x690b('0x1')]=_0x7f7a4e[_0x690b('0x1')]||'';this[_0x690b('0x2')]=_0x7f7a4e[_0x690b('0x3')]||'';this[_0x690b('0x4')]=_0x7f7a4e[_0x690b('0x4')]||'';this[_0x690b('0x5')]=_0x7f7a4e[_0x690b('0x5')]||'';this['Configurations']=_0x7f7a4e[_0x690b('0x6')]||{};}module[_0x690b('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index a4ac60a..86fe1ec 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 _0x5577=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey','token'];(function(_0x360a38,_0xf15961){var _0x59de6a=function(_0x37b9f5){while(--_0x37b9f5){_0x360a38['push'](_0x360a38['shift']());}};_0x59de6a(++_0xf15961);}(_0x5577,0x1b4));var _0x7557=function(_0x32a4f7,_0x20f93d){_0x32a4f7=_0x32a4f7-0x0;var _0xb300a=_0x5577[_0x32a4f7];return _0xb300a;};'use strict';function FreshsalesAccount(_0x10e903){this['id']=_0x10e903['id']||0x0;this['name']=_0x10e903[_0x7557('0x0')]||'';this[_0x7557('0x1')]=_0x10e903['username']||'';this[_0x7557('0x2')]=_0x10e903[_0x7557('0x3')]||'';this[_0x7557('0x4')]=_0x10e903[_0x7557('0x4')]||'';this[_0x7557('0x5')]=_0x10e903[_0x7557('0x5')]||'';this['Configurations']=_0x10e903[_0x7557('0x6')]||{};}module[_0x7557('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xab29=['serverUrl','Configurations','exports','name','username','apiKey','remoteUri'];(function(_0x5d176f,_0x33d4d8){var _0x5b1976=function(_0x257533){while(--_0x257533){_0x5d176f['push'](_0x5d176f['shift']());}};_0x5b1976(++_0x33d4d8);}(_0xab29,0x145));var _0x9ab2=function(_0x5dd59f,_0xe1e122){_0x5dd59f=_0x5dd59f-0x0;var _0x2e0f26=_0xab29[_0x5dd59f];return _0x2e0f26;};'use strict';function FreshsalesAccount(_0x54d887){this['id']=_0x54d887['id']||0x0;this[_0x9ab2('0x0')]=_0x54d887[_0x9ab2('0x0')]||'';this[_0x9ab2('0x1')]=_0x54d887['username']||'';this[_0x9ab2('0x2')]=_0x54d887['token']||'';this[_0x9ab2('0x3')]=_0x54d887[_0x9ab2('0x3')]||'';this[_0x9ab2('0x4')]=_0x54d887[_0x9ab2('0x4')]||'';this[_0x9ab2('0x5')]=_0x54d887['Configurations']||{};}module[_0x9ab2('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 9c6c2e2..91f6d7f 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 _0x5e35=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','motionChannel','routealias','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue'];(function(_0x167e10,_0x23a2cc){var _0x566e59=function(_0x59d9a4){while(--_0x59d9a4){_0x167e10['push'](_0x167e10['shift']());}};_0x566e59(++_0x23a2cc);}(_0x5e35,0xdb));var _0x55e3=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x5e35[_0x29d915];return _0x160f86;};'use strict';function QueueReport(){this[_0x55e3('0x0')]=_0x55e3('0x1');this[_0x55e3('0x2')]='';this[_0x55e3('0x3')]='';this[_0x55e3('0x4')]='';this[_0x55e3('0x5')]='';this['queuecallerjoinAt']=null;this[_0x55e3('0x6')]=null;this[_0x55e3('0x7')]=0x1;this[_0x55e3('0x8')]=0x1;this[_0x55e3('0x9')]=![];this['queuecallerabandonAt']=null;this['queuecallercomplete']=![];this[_0x55e3('0xa')]=null;this[_0x55e3('0xb')]=![];this[_0x55e3('0xc')]=null;this['originalposition']=0x1;this[_0x55e3('0xd')]='';this[_0x55e3('0xe')]='';this[_0x55e3('0xf')]='';this[_0x55e3('0x10')]='';this[_0x55e3('0x11')]='';this[_0x55e3('0x12')]='';this['priority']='';this[_0x55e3('0x13')]=0x0;this[_0x55e3('0x14')]=![];this['lastAssignedTo']='';this[_0x55e3('0x15')]='voice';this[_0x55e3('0x16')]=null;this[_0x55e3('0x17')]=0x0;this[_0x55e3('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x7a21=['lastAssignedTo','motionChannel','voice','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','accountcode','context','exten','assigned'];(function(_0x3355e5,_0x157c80){var _0x1cbb5d=function(_0x5553c4){while(--_0x5553c4){_0x3355e5['push'](_0x3355e5['shift']());}};_0x1cbb5d(++_0x157c80);}(_0x7a21,0x123));var _0x17a2=function(_0x5b1e90,_0x2a1efd){_0x5b1e90=_0x5b1e90-0x0;var _0x4b380f=_0x7a21[_0x5b1e90];return _0x4b380f;};'use strict';function QueueReport(){this[_0x17a2('0x0')]=_0x17a2('0x1');this[_0x17a2('0x2')]='';this[_0x17a2('0x3')]='';this[_0x17a2('0x4')]='';this[_0x17a2('0x5')]='';this[_0x17a2('0x6')]=null;this[_0x17a2('0x7')]=null;this[_0x17a2('0x8')]=0x1;this[_0x17a2('0x9')]=0x1;this[_0x17a2('0xa')]=![];this[_0x17a2('0xb')]=null;this[_0x17a2('0xc')]=![];this[_0x17a2('0xd')]=null;this[_0x17a2('0xe')]=![];this[_0x17a2('0xf')]=null;this[_0x17a2('0x10')]=0x1;this['channel']='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x17a2('0x11')]='';this[_0x17a2('0x12')]='';this[_0x17a2('0x13')]='';this['priority']='';this['holdtime']=0x0;this[_0x17a2('0x14')]=![];this[_0x17a2('0x15')]='';this[_0x17a2('0x16')]=_0x17a2('0x17');this['routealias']=null;this[_0x17a2('0x18')]=0x0;this[_0x17a2('0x19')]={};}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 7b00475..ec0a96d 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 _0x4bab=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bab,0xc8));var _0xb4ba=function(_0x75f6f7,_0x3ff5c9){_0x75f6f7=_0x75f6f7-0x0;var _0x5b0a68=_0x4bab[_0x75f6f7];return _0x5b0a68;};'use strict';function SalesforceAccount(_0x554f79){this['id']=_0x554f79['id']||0x0;this[_0xb4ba('0x0')]=_0x554f79[_0xb4ba('0x0')]||'';this[_0xb4ba('0x1')]=_0x554f79[_0xb4ba('0x1')]||'';this[_0xb4ba('0x2')]=_0x554f79[_0xb4ba('0x2')]||'';this[_0xb4ba('0x3')]=_0x554f79[_0xb4ba('0x3')]||'';this['clientId']=_0x554f79[_0xb4ba('0x4')]||'';this[_0xb4ba('0x5')]=_0x554f79[_0xb4ba('0x5')]||'';this['securityToken']=_0x554f79[_0xb4ba('0x6')]||'';this[_0xb4ba('0x7')]=_0x554f79['type']||'integrationTab';this['serverUrl']=_0x554f79[_0xb4ba('0x8')]||'';this[_0xb4ba('0x9')]=_0x554f79[_0xb4ba('0x9')]||{};}module[_0xb4ba('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x633b=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x1864de,_0x44e68b){var _0x37f63c=function(_0x2e79db){while(--_0x2e79db){_0x1864de['push'](_0x1864de['shift']());}};_0x37f63c(++_0x44e68b);}(_0x633b,0xd8));var _0xb633=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x633b[_0x20a584];return _0x4b41a8;};'use strict';function SalesforceAccount(_0x257c11){this['id']=_0x257c11['id']||0x0;this[_0xb633('0x0')]=_0x257c11[_0xb633('0x0')]||'';this[_0xb633('0x1')]=_0x257c11[_0xb633('0x1')]||'';this['remoteUri']=_0x257c11[_0xb633('0x2')]||'';this[_0xb633('0x3')]=_0x257c11[_0xb633('0x3')]||'';this[_0xb633('0x4')]=_0x257c11[_0xb633('0x4')]||'';this[_0xb633('0x5')]=_0x257c11[_0xb633('0x5')]||'';this['securityToken']=_0x257c11[_0xb633('0x6')]||'';this[_0xb633('0x7')]=_0x257c11['type']||_0xb633('0x8');this[_0xb633('0x9')]=_0x257c11[_0xb633('0x9')]||'';this[_0xb633('0xa')]=_0x257c11[_0xb633('0xa')]||{};}module[_0xb633('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index d17b55a..abec1bb 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 _0xa27f=['Configurations','exports','username','password','remoteUri','serverUrl'];(function(_0x3179c7,_0x5d2f06){var _0x369fe5=function(_0x488913){while(--_0x488913){_0x3179c7['push'](_0x3179c7['shift']());}};_0x369fe5(++_0x5d2f06);}(_0xa27f,0x1be));var _0xfa27=function(_0x1f4290,_0x2cf5d4){_0x1f4290=_0x1f4290-0x0;var _0x5cbb0e=_0xa27f[_0x1f4290];return _0x5cbb0e;};'use strict';function ServicenowAccount(_0xa110b3){this['id']=_0xa110b3['id']||0x0;this['name']=_0xa110b3['name']||'';this['username']=_0xa110b3[_0xfa27('0x0')]||'';this[_0xfa27('0x1')]=_0xa110b3['password']||'';this[_0xfa27('0x2')]=_0xa110b3[_0xfa27('0x2')]||'';this[_0xfa27('0x3')]=_0xa110b3[_0xfa27('0x3')]||'';this['Configurations']=_0xa110b3[_0xfa27('0x4')]||{};}module[_0xfa27('0x5')]=ServicenowAccount; \ No newline at end of file +var _0xfb66=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x12b264,_0x237447){var _0x5516c3=function(_0x50276b){while(--_0x50276b){_0x12b264['push'](_0x12b264['shift']());}};_0x5516c3(++_0x237447);}(_0xfb66,0x1ed));var _0x6fb6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xfb66[_0x122096];return _0x3d1966;};'use strict';function ServicenowAccount(_0x39b70e){this['id']=_0x39b70e['id']||0x0;this['name']=_0x39b70e[_0x6fb6('0x0')]||'';this[_0x6fb6('0x1')]=_0x39b70e['username']||'';this[_0x6fb6('0x2')]=_0x39b70e['password']||'';this['remoteUri']=_0x39b70e[_0x6fb6('0x3')]||'';this[_0x6fb6('0x4')]=_0x39b70e[_0x6fb6('0x4')]||'';this[_0x6fb6('0x5')]=_0x39b70e[_0x6fb6('0x5')]||{};}module[_0x6fb6('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index d1b2baf..28114c3 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 _0x6910=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x3681ea,_0xb5e0a5){var _0x5c1982=function(_0x478003){while(--_0x478003){_0x3681ea['push'](_0x3681ea['shift']());}};_0x5c1982(++_0xb5e0a5);}(_0x6910,0x159));var _0x0691=function(_0x5ab602,_0x5bb797){_0x5ab602=_0x5ab602-0x0;var _0x3b7a08=_0x6910[_0x5ab602];return _0x3b7a08;};'use strict';function SugarcrmAccount(_0xd16e7c){this['id']=_0xd16e7c['id']||0x0;this['name']=_0xd16e7c[_0x0691('0x0')]||'';this[_0x0691('0x1')]=_0xd16e7c[_0x0691('0x1')]||'';this[_0x0691('0x2')]=_0xd16e7c[_0x0691('0x2')]||'';this[_0x0691('0x3')]=_0xd16e7c['remoteUri']||'';this['serverUrl']=_0xd16e7c[_0x0691('0x4')]||'';this[_0x0691('0x5')]=_0xd16e7c['Configurations']||{};}module[_0x0691('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x2d80=['remoteUri','Configurations','exports','name','username','password'];(function(_0x179c89,_0x3a69b2){var _0x4b87e5=function(_0xbdf6f2){while(--_0xbdf6f2){_0x179c89['push'](_0x179c89['shift']());}};_0x4b87e5(++_0x3a69b2);}(_0x2d80,0x11d));var _0x02d8=function(_0x35906a,_0x9e0b54){_0x35906a=_0x35906a-0x0;var _0x43ba69=_0x2d80[_0x35906a];return _0x43ba69;};'use strict';function SugarcrmAccount(_0x9e9904){this['id']=_0x9e9904['id']||0x0;this[_0x02d8('0x0')]=_0x9e9904['name']||'';this['username']=_0x9e9904[_0x02d8('0x1')]||'';this['password']=_0x9e9904[_0x02d8('0x2')]||'';this[_0x02d8('0x3')]=_0x9e9904['remoteUri']||'';this['serverUrl']=_0x9e9904['serverUrl']||'';this[_0x02d8('0x4')]=_0x9e9904[_0x02d8('0x4')]||{};}module[_0x02d8('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 5c6d10b..3d7d691 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 _0x828b=['status','address','accountcode','state','unknown','stateTime'];(function(_0x90c385,_0x4a4f7d){var _0xeca686=function(_0x23b11b){while(--_0x23b11b){_0x90c385['push'](_0x90c385['shift']());}};_0xeca686(++_0x4a4f7d);}(_0x828b,0x182));var _0xb828=function(_0x39e2d7,_0x1b15f6){_0x39e2d7=_0x39e2d7-0x0;var _0x413d0d=_0x828b[_0x39e2d7];return _0x413d0d;};'use strict';function Telephone(_0x4f7e0d){this['id']=_0x4f7e0d['id']||0x0;this['name']=_0x4f7e0d['name']||'';this[_0xb828('0x0')]=_0x4f7e0d[_0xb828('0x0')]||'';this[_0xb828('0x1')]=_0xb828('0x2');this[_0xb828('0x3')]=0x0;this[_0xb828('0x4')]=_0xb828('0x2');this[_0xb828('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x6125=['stateTime','unknown','address','exports','name','state'];(function(_0x17f497,_0x52d2f8){var _0x5e7b43=function(_0x292165){while(--_0x292165){_0x17f497['push'](_0x17f497['shift']());}};_0x5e7b43(++_0x52d2f8);}(_0x6125,0x13c));var _0x5612=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6125[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x1bf07e){this['id']=_0x1bf07e['id']||0x0;this[_0x5612('0x0')]=_0x1bf07e['name']||'';this['accountcode']=_0x1bf07e['accountcode']||'';this[_0x5612('0x1')]='unknown';this[_0x5612('0x2')]=0x0;this['status']=_0x5612('0x3');this[_0x5612('0x4')]='';}module[_0x5612('0x5')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 4101d64..e367514 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(_0x298876,_0x31a77a){var _0x81106e=function(_0x50577e){while(--_0x50577e){_0x298876['push'](_0x298876['shift']());}};_0x81106e(++_0x31a77a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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(_0x3e75da,_0x509191){var _0x5fa29a=function(_0x523e94){while(--_0x523e94){_0x3e75da['push'](_0x3e75da['shift']());}};_0x5fa29a(++_0x509191);}(_0xb10b,0x12a));var _0xbb10=function(_0x154b4c,_0xa38e2){_0x154b4c=_0x154b4c-0x0;var _0x100586=_0xb10b[_0x154b4c];return _0x100586;};'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 038ade9..d6f7337 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 _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x5ce3cb,_0xbcb26b){var _0x1fd13e=function(_0x125b49){while(--_0x125b49){_0x5ce3cb['push'](_0x5ce3cb['shift']());}};_0x1fd13e(++_0xbcb26b);}(_0x4fc2,0x111));var _0x24fc=function(_0x2993c1,_0x37681f){_0x2993c1=_0x2993c1-0x0;var _0x41c9cf=_0x4fc2[_0x2993c1];return _0x41c9cf;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x4fc2,0x111));var _0x24fc=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x4fc2[_0x3dc089];return _0x34d9d3;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index b5c736c..d91fa3c 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 _0x3d46=['refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','registry','indexOf','host','port','domain'];(function(_0xb37913,_0x394937){var _0x2d0bfa=function(_0x1574dd){while(--_0x1574dd){_0xb37913['push'](_0xb37913['shift']());}};_0x2d0bfa(++_0x394937);}(_0x3d46,0x76));var _0x63d4=function(_0x579c60,_0xfb3ec7){_0x579c60=_0x579c60-0x0;var _0x8870dc=_0x3d46[_0x579c60];return _0x8870dc;};'use strict';function Trunk(_0x214967){this['id']=_0x214967['id']||0x0;this[_0x63d4('0x0')]=_0x214967['active']||![];this[_0x63d4('0x1')]=_0x214967[_0x63d4('0x1')]||'';this[_0x63d4('0x2')]=_0x63d4('0x3');this[_0x63d4('0x4')]=0x0;this['status']=_0x63d4('0x3');this[_0x63d4('0x5')]=_0x214967[_0x63d4('0x5')]&&_0x214967['registry'][_0x63d4('0x6')](':')?_0x214967[_0x63d4('0x5')]['split'](':')[0x0]:'';this[_0x63d4('0x7')]='';this[_0x63d4('0x8')]='';this[_0x63d4('0x9')]='';this['domainport']='';this[_0x63d4('0xa')]='';this[_0x63d4('0xb')]=_0x63d4('0x3');this[_0x63d4('0xc')]='';this[_0x63d4('0xd')]='';this[_0x63d4('0xe')]=_0x214967['defaultuser']||'';}module[_0x63d4('0xf')]=Trunk; \ No newline at end of file +var _0x1622=['active','name','unknown','stateTime','registry','indexOf','split','host','port','domain','domainport','stateRegistry','address','defaultuser','exports'];(function(_0x134c9b,_0x2b4738){var _0x33f38e=function(_0x53e7b5){while(--_0x53e7b5){_0x134c9b['push'](_0x134c9b['shift']());}};_0x33f38e(++_0x2b4738);}(_0x1622,0x186));var _0x2162=function(_0x1f1e31,_0x27b5c3){_0x1f1e31=_0x1f1e31-0x0;var _0x229b56=_0x1622[_0x1f1e31];return _0x229b56;};'use strict';function Trunk(_0x333cca){this['id']=_0x333cca['id']||0x0;this[_0x2162('0x0')]=_0x333cca['active']||![];this['name']=_0x333cca[_0x2162('0x1')]||'';this['state']=_0x2162('0x2');this[_0x2162('0x3')]=0x0;this['status']=_0x2162('0x2');this[_0x2162('0x4')]=_0x333cca['registry']&&_0x333cca['registry'][_0x2162('0x5')](':')?_0x333cca[_0x2162('0x4')][_0x2162('0x6')](':')[0x0]:'';this[_0x2162('0x7')]='';this[_0x2162('0x8')]='';this[_0x2162('0x9')]='';this[_0x2162('0xa')]='';this['refresh']='';this[_0x2162('0xb')]=_0x2162('0x2');this['registrationtime']='';this[_0x2162('0xc')]='';this[_0x2162('0xd')]=_0x333cca[_0x2162('0xd')]||'';}module[_0x2162('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 8c2b51c..b2758d6 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 _0x7df8=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x62c286,_0x8afc5f){var _0x446c09=function(_0x148b10){while(--_0x148b10){_0x62c286['push'](_0x62c286['shift']());}};_0x446c09(++_0x8afc5f);}(_0x7df8,0xf0));var _0x87df=function(_0x4a34a2,_0x468c8e){_0x4a34a2=_0x4a34a2-0x0;var _0x45a227=_0x7df8[_0x4a34a2];return _0x45a227;};'use strict';function voiceExtension(_0x46b51f){this['id']=_0x46b51f['id']||0x0;this[_0x87df('0x0')]=_0x46b51f[_0x87df('0x0')]||'';this['recordingFormat']=_0x46b51f[_0x87df('0x1')]||_0x87df('0x2');this[_0x87df('0x3')]=_0x46b51f['mandatoryDisposition']||![];}module[_0x87df('0x4')]=voiceExtension; \ No newline at end of file +var _0x1203=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1203,0x69));var _0x3120=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1203[_0x14add3];return _0x4a174f;};'use strict';function voiceExtension(_0x5f5167){this['id']=_0x5f5167['id']||0x0;this[_0x3120('0x0')]=_0x5f5167['exten']||'';this[_0x3120('0x1')]=_0x5f5167[_0x3120('0x1')]||_0x3120('0x2');this[_0x3120('0x3')]=_0x5f5167['mandatoryDisposition']||![];}module[_0x3120('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e56a4ec..7e0fd27 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 _0xc27a=['dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','gsm','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','inbound','waiting','total','sumDuration','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive'];(function(_0x6c42e3,_0x247ad9){var _0x1318a0=function(_0x19b7d9){while(--_0x19b7d9){_0x6c42e3['push'](_0x6c42e3['shift']());}};_0x1318a0(++_0x247ad9);}(_0xc27a,0x1b2));var _0xac27=function(_0x533132,_0xf5b6fa){_0x533132=_0x533132-0x0;var _0x1a7447=_0xc27a[_0x533132];return _0x1a7447;};'use strict';var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xac27('0x0')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xac27('0x1'),'linear':_0xac27('0x2'),'random':_0xac27('0x3'),'ringall':_0xac27('0x4'),'rr':'roundrobin','rrmemory':_0xac27('0x5'),'rrordered':_0xac27('0x6'),'wrandom':_0xac27('0x7')};function VoiceQueue(_0x566930){this['id']=_0x566930['id']||0x0;this[_0xac27('0x8')]=_0x566930[_0xac27('0x8')]||'';this[_0xac27('0x9')]=_0x566930[_0xac27('0x9')]||'';this['type']=_0x566930['type']||_0xac27('0xa');this[_0xac27('0xb')]=0x0;this[_0xac27('0xc')]=0x0;this['answered']=0x0;this[_0xac27('0xd')]=0x0;this['sumHoldTime']=0x0;this[_0xac27('0xe')]=0x0;this[_0xac27('0xf')]=0x0;this[_0xac27('0x10')]=0x0;this[_0xac27('0x11')]=0x0;this[_0xac27('0x12')]=0x0;this['inUse']=0x0;this[_0xac27('0x13')]=0x0;this[_0xac27('0x14')]=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0xac27('0x15')]=0x0;this[_0xac27('0x16')]=0x0;this[_0xac27('0x17')]=0x0;this[_0xac27('0x18')]=0x0;this[_0xac27('0x19')]=0x0;this[_0xac27('0x1a')]=0x0;this[_0xac27('0x1b')]=_0x566930[_0xac27('0x1b')]||![];this[_0xac27('0x1c')]=_0x566930[_0xac27('0x1c')]||0xa;this[_0xac27('0x1d')]=_0x566930[_0xac27('0x1d')]||'no';this[_0xac27('0x1e')]=!![];this[_0xac27('0x1f')]='';this[_0xac27('0x20')]='';this[_0xac27('0x21')]=0x0;this[_0xac27('0x22')]=0x0;this[_0xac27('0x23')]=_0x566930[_0xac27('0x23')]||null;this['dialGlobalInterval']=_0x566930[_0xac27('0x24')]?_0x566930[_0xac27('0x24')]:null;this[_0xac27('0x25')]=_0x566930[_0xac27('0x25')];this[_0xac27('0x26')]=_0x566930[_0xac27('0x26')]||_0xac27('0x27');this[_0xac27('0x28')]=_0x566930[_0xac27('0x28')]||0x0;this[_0xac27('0x29')]=_0x566930[_0xac27('0x29')]||0x0;this[_0xac27('0x2a')]=_0x566930['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x566930['dialPredictiveOptimization']||'dropRate';this[_0xac27('0x2b')]=_0x566930[_0xac27('0x2b')]||0.03;this[_0xac27('0x2c')]=_0x566930[_0xac27('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x566930[_0xac27('0x2d')]||_0xac27('0x2e');this[_0xac27('0x2f')]=_0x566930[_0xac27('0x2f')]||'anonymous';this['dialOriginateTimeout']=_0x566930[_0xac27('0x30')]||0x1e;this[_0xac27('0x31')]=_0x566930['dialQueueOptions']||_0xac27('0x32');this[_0xac27('0x33')]=_0x566930[_0xac27('0x33')]||0x3;this[_0xac27('0x34')]=_0x566930[_0xac27('0x34')]||undefined;this[_0xac27('0x35')]=_0x566930[_0xac27('0x35')]||0x3;this[_0xac27('0x36')]=_0x566930[_0xac27('0x36')]||0x96;this[_0xac27('0x37')]=_0x566930['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x566930[_0xac27('0x38')]||0x96;this['dialNoAnswerMaxRetry']=_0x566930[_0xac27('0x39')]||0x3;this[_0xac27('0x3a')]=_0x566930[_0xac27('0x3a')]||0x96;this[_0xac27('0x3b')]=_0x566930[_0xac27('0x3b')]||0x3;this[_0xac27('0x3c')]=_0x566930[_0xac27('0x3c')]||0x96;this['dialDropMaxRetry']=_0x566930[_0xac27('0x3d')]||0x3;this['dialDropRetryFrequency']=_0x566930[_0xac27('0x3e')]||0x96;this[_0xac27('0x3f')]=_0x566930[_0xac27('0x3f')]||0x3;this[_0xac27('0x40')]=_0x566930[_0xac27('0x40')]||0x96;this[_0xac27('0x41')]=_0x566930[_0xac27('0x41')]||0x3;this['dialMachineRetryFrequency']=_0x566930[_0xac27('0x42')]||0x96;this[_0xac27('0x43')]=_0x566930[_0xac27('0x43')]||0x3;this[_0xac27('0x44')]=_0x566930[_0xac27('0x44')]||0x96;this[_0xac27('0x45')]=_0x566930['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x566930[_0xac27('0x46')]||0x4;this['Trunk']=_0x566930[_0xac27('0x47')]?_0x566930[_0xac27('0x47')]:undefined;this[_0xac27('0x48')]=_0x566930[_0xac27('0x48')]?_0x566930['TrunkBackup']:undefined;this['dialPrefix']=_0x566930[_0xac27('0x49')]||undefined;this[_0xac27('0x4a')]=_0x566930[_0xac27('0x4a')]?_0x566930[_0xac27('0x4a')]:undefined;this[_0xac27('0x4b')]=_0x566930['dialOrderByScheduledAt']||_0xac27('0x4c');this[_0xac27('0x4d')]=_0x566930[_0xac27('0x4d')]||undefined;this[_0xac27('0x4e')]=_0x566930[_0xac27('0x4e')]||undefined;this[_0xac27('0x4f')]=strategy[_0x566930[_0xac27('0x4f')]];this[_0xac27('0x50')]=!![];this[_0xac27('0x51')]=_0x566930[_0xac27('0x51')]||![];this[_0xac27('0x52')]=_0x566930[_0xac27('0x52')];this[_0xac27('0x53')]=_0x566930[_0xac27('0x53')];this[_0xac27('0x54')]=_0x566930[_0xac27('0x54')];this[_0xac27('0x55')]=_0x566930[_0xac27('0x55')];this[_0xac27('0x56')]=_0x566930['dialAMDMinWordLength'];this[_0xac27('0x57')]=_0x566930[_0xac27('0x57')];this[_0xac27('0x58')]=_0x566930[_0xac27('0x58')];this[_0xac27('0x59')]=_0x566930[_0xac27('0x59')];this[_0xac27('0x5a')]=_0x566930[_0xac27('0x5a')];this['outboundRejectCallsDay']=0x0;this[_0xac27('0x5b')]=0x0;this[_0xac27('0x5c')]=_0x566930['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xac27('0x5d')]=0x0;this[_0xac27('0x5e')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xac27('0x5f')]=0x0;this[_0xac27('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xac27('0x61')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xac27('0x62')]=0x0;this[_0xac27('0x63')]=0x0;this[_0xac27('0x64')]=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0xac27('0x65')]=undefined;this[_0xac27('0x66')]=1.05;this[_0xac27('0x67')]=0x0;this[_0xac27('0x68')]=0x0;this[_0xac27('0x69')]=0x0;this[_0xac27('0x6a')]=0x0;this[_0xac27('0x6b')]=0x0;this[_0xac27('0x6c')]=0x0;this[_0xac27('0x6d')]=0x0;this[_0xac27('0x6e')]=0x0;this[_0xac27('0x6f')]=_0x566930['dialPredictiveIntervalMaxThreshold']||0x14;this['predictiveIntervalMinThreshold']=_0x566930[_0xac27('0x70')]||0xa;this[_0xac27('0x71')]=0x0;this[_0xac27('0x72')]=0x0;this[_0xac27('0x73')]=0x1;this[_0xac27('0x74')]=0x0;this[_0xac27('0x75')]=0x0;this[_0xac27('0x76')]=0x0;this[_0xac27('0x77')]=0x0;this[_0xac27('0x78')]=_0x566930[_0xac27('0x78')]||0x1e;this[_0xac27('0x79')]=_0x566930[_0xac27('0x79')]||![];this[_0xac27('0x7a')]=!!_0x566930[_0xac27('0x7a')]||![];this[_0xac27('0x7b')]=!!_0x566930[_0xac27('0x7b')]||![];this['dialQueueProject2']=_0x566930[_0xac27('0x7c')]||undefined;this[_0xac27('0x7d')]=_0x566930[_0xac27('0x7d')]||![];this[_0xac27('0x7e')]=_0x566930[_0xac27('0x7e')]||![];this[_0xac27('0x9')]=monitorFormat[_0x566930[_0xac27('0x9')]]?monitorFormat[_0x566930[_0xac27('0x9')]]:undefined;this[_0xac27('0x7f')]=_0x566930[_0xac27('0x7f')]||![];this[_0xac27('0x80')]=_0x566930['mandatoryDispositionPause']?_0x566930['mandatoryDispositionPause']:undefined;this['queueSummaryCountersUpdated']=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0xacd0=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','leastrecent','random','roundrobin','rrordered','wrandom','name','monitor_format','type','waiting','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','inUse','invalid','loggedIn','notInUse','paused','ringing','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry'];(function(_0x223f7a,_0x1d5215){var _0x23c32c=function(_0xdd6f94){while(--_0xdd6f94){_0x223f7a['push'](_0x223f7a['shift']());}};_0x23c32c(++_0x1d5215);}(_0xacd0,0xc9));var _0x0acd=function(_0x5087b7,_0x117485){_0x5087b7=_0x5087b7-0x0;var _0x3b4c2b=_0xacd0[_0x5087b7];return _0x3b4c2b;};'use strict';var monitorFormat={'wav':_0x0acd('0x0'),'wav49':_0x0acd('0x1'),'gsm':_0x0acd('0x2')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0x0acd('0x3'),'linear':'linear','random':_0x0acd('0x4'),'ringall':'ringall','rr':_0x0acd('0x5'),'rrmemory':'rrmemory','rrordered':_0x0acd('0x6'),'wrandom':_0x0acd('0x7')};function VoiceQueue(_0x46ed23){this['id']=_0x46ed23['id']||0x0;this[_0x0acd('0x8')]=_0x46ed23[_0x0acd('0x8')]||'';this[_0x0acd('0x9')]=_0x46ed23['monitor_format']||'';this['type']=_0x46ed23[_0x0acd('0xa')]||'inbound';this[_0x0acd('0xb')]=0x0;this[_0x0acd('0xc')]=0x0;this['answered']=0x0;this[_0x0acd('0xd')]=0x0;this[_0x0acd('0xe')]=0x0;this[_0x0acd('0xf')]=0x0;this[_0x0acd('0x10')]=0x0;this[_0x0acd('0x11')]=0x0;this[_0x0acd('0x12')]=0x0;this['busy']=0x0;this[_0x0acd('0x13')]=0x0;this[_0x0acd('0x14')]=0x0;this[_0x0acd('0x15')]=0x0;this[_0x0acd('0x16')]=0x0;this['onHold']=0x0;this[_0x0acd('0x17')]=0x0;this[_0x0acd('0x18')]=0x0;this['ringInUse']=0x0;this[_0x0acd('0x19')]=0x0;this[_0x0acd('0x1a')]=0x0;this[_0x0acd('0x1b')]=0x0;this[_0x0acd('0x1c')]=_0x46ed23['acw']||![];this['acwTimeout']=_0x46ed23[_0x0acd('0x1d')]||0xa;this[_0x0acd('0x1e')]=_0x46ed23[_0x0acd('0x1e')]||'no';this[_0x0acd('0x1f')]=!![];this[_0x0acd('0x20')]='';this[_0x0acd('0x21')]='';this[_0x0acd('0x22')]=0x0;this[_0x0acd('0x23')]=0x0;this['dialTimezone']=_0x46ed23['dialTimezone']||null;this[_0x0acd('0x24')]=_0x46ed23['dialGlobalInterval']?_0x46ed23['dialGlobalInterval']:null;this[_0x0acd('0x25')]=_0x46ed23[_0x0acd('0x25')];this[_0x0acd('0x26')]=_0x46ed23[_0x0acd('0x26')]||'progressive';this[_0x0acd('0x27')]=_0x46ed23[_0x0acd('0x27')]||0x0;this['dialLimitQueue']=_0x46ed23['dialLimitQueue']||0x0;this[_0x0acd('0x28')]=_0x46ed23[_0x0acd('0x28')]||0x1;this[_0x0acd('0x29')]=_0x46ed23[_0x0acd('0x29')]||_0x0acd('0x2a');this[_0x0acd('0x2b')]=_0x46ed23[_0x0acd('0x2b')]||0.03;this[_0x0acd('0x2c')]=_0x46ed23[_0x0acd('0x2c')]||0x258;this['dialOriginateCallerIdName']=_0x46ed23[_0x0acd('0x2d')]||_0x0acd('0x2e');this[_0x0acd('0x2f')]=_0x46ed23[_0x0acd('0x2f')]||_0x0acd('0x2e');this[_0x0acd('0x30')]=_0x46ed23[_0x0acd('0x30')]||0x1e;this[_0x0acd('0x31')]=_0x46ed23[_0x0acd('0x31')]||_0x0acd('0x32');this[_0x0acd('0x33')]=_0x46ed23[_0x0acd('0x33')]||0x3;this['dialQueueProject']=_0x46ed23[_0x0acd('0x34')]||undefined;this[_0x0acd('0x35')]=_0x46ed23[_0x0acd('0x35')]||0x3;this['dialCongestionRetryFrequency']=_0x46ed23['dialCongestionRetryFrequency']||0x96;this[_0x0acd('0x36')]=_0x46ed23['dialBusyMaxRetry']||0x3;this[_0x0acd('0x37')]=_0x46ed23['dialBusyRetryFrequency']||0x96;this[_0x0acd('0x38')]=_0x46ed23[_0x0acd('0x38')]||0x3;this['dialNoAnswerRetryFrequency']=_0x46ed23[_0x0acd('0x39')]||0x96;this[_0x0acd('0x3a')]=_0x46ed23[_0x0acd('0x3a')]||0x3;this[_0x0acd('0x3b')]=_0x46ed23[_0x0acd('0x3b')]||0x96;this[_0x0acd('0x3c')]=_0x46ed23[_0x0acd('0x3c')]||0x3;this[_0x0acd('0x3d')]=_0x46ed23[_0x0acd('0x3d')]||0x96;this['dialAbandonedMaxRetry']=_0x46ed23[_0x0acd('0x3e')]||0x3;this['dialAbandonedRetryFrequency']=_0x46ed23[_0x0acd('0x3f')]||0x96;this[_0x0acd('0x40')]=_0x46ed23[_0x0acd('0x40')]||0x3;this[_0x0acd('0x41')]=_0x46ed23[_0x0acd('0x41')]||0x96;this[_0x0acd('0x42')]=_0x46ed23[_0x0acd('0x42')]||0x3;this[_0x0acd('0x43')]=_0x46ed23[_0x0acd('0x43')]||0x96;this['callAdditionalPhoneAfterMin']=_0x46ed23[_0x0acd('0x44')]||0x3;this[_0x0acd('0x45')]=_0x46ed23['dialGlobalMaxRetry']||0x4;this[_0x0acd('0x46')]=_0x46ed23[_0x0acd('0x46')]?_0x46ed23[_0x0acd('0x46')]:undefined;this[_0x0acd('0x47')]=_0x46ed23[_0x0acd('0x47')]?_0x46ed23[_0x0acd('0x47')]:undefined;this['dialPrefix']=_0x46ed23[_0x0acd('0x48')]||undefined;this[_0x0acd('0x49')]=_0x46ed23['Interval']?_0x46ed23[_0x0acd('0x49')]:undefined;this[_0x0acd('0x4a')]=_0x46ed23[_0x0acd('0x4a')]||_0x0acd('0x4b');this[_0x0acd('0x4c')]=_0x46ed23[_0x0acd('0x4c')]||undefined;this[_0x0acd('0x4d')]=_0x46ed23['dialCutDigit']||undefined;this[_0x0acd('0x4e')]=strategy[_0x46ed23['strategy']];this[_0x0acd('0x4f')]=!![];this['dialAMDActive']=_0x46ed23[_0x0acd('0x50')]||![];this[_0x0acd('0x51')]=_0x46ed23[_0x0acd('0x51')];this[_0x0acd('0x52')]=_0x46ed23['dialAMDGreeting'];this[_0x0acd('0x53')]=_0x46ed23[_0x0acd('0x53')];this['dialAMDTotalAnalysisTime']=_0x46ed23[_0x0acd('0x54')];this[_0x0acd('0x55')]=_0x46ed23[_0x0acd('0x55')];this['dialAMDBetweenWordsSilence']=_0x46ed23[_0x0acd('0x56')];this['dialAMDMaximumNumberOfWords']=_0x46ed23['dialAMDMaximumNumberOfWords'];this[_0x0acd('0x57')]=_0x46ed23[_0x0acd('0x57')];this[_0x0acd('0x58')]=_0x46ed23['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x0acd('0x59')]=0x0;this['timeout']=_0x46ed23[_0x0acd('0x5a')];this[_0x0acd('0x5b')]=0x0;this[_0x0acd('0x5c')]=0x0;this[_0x0acd('0x5d')]=0x0;this[_0x0acd('0x5e')]=0x0;this[_0x0acd('0x5f')]=0x0;this[_0x0acd('0x60')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x0acd('0x61')]=0x0;this[_0x0acd('0x62')]=0x0;this[_0x0acd('0x63')]=0x0;this[_0x0acd('0x64')]=0x0;this[_0x0acd('0x65')]=0x0;this['outboundReCallsDay']=0x0;this[_0x0acd('0x66')]=0x0;this[_0x0acd('0x67')]=undefined;this[_0x0acd('0x68')]=undefined;this['handlePredictive']=undefined;this[_0x0acd('0x69')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x0acd('0x6a')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x0acd('0x6b')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x0acd('0x6c')]=0x0;this[_0x0acd('0x6d')]=0x0;this[_0x0acd('0x6e')]=0x0;this['predictiveIntervalMaxThreshold']=_0x46ed23[_0x0acd('0x6f')]||0x14;this[_0x0acd('0x70')]=_0x46ed23['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x0acd('0x71')]=0x0;this[_0x0acd('0x72')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x0acd('0x73')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0x0acd('0x74')]=0x0;this[_0x0acd('0x75')]=_0x46ed23[_0x0acd('0x75')]||0x1e;this[_0x0acd('0x76')]=_0x46ed23['dialRecallInQueue']||![];this[_0x0acd('0x77')]=!!_0x46ed23[_0x0acd('0x77')]||![];this[_0x0acd('0x78')]=!!_0x46ed23[_0x0acd('0x78')]||![];this[_0x0acd('0x79')]=_0x46ed23[_0x0acd('0x79')]||undefined;this[_0x0acd('0x7a')]=_0x46ed23['dialAgiAfterHangupClient']||![];this[_0x0acd('0x7b')]=_0x46ed23[_0x0acd('0x7b')]||![];this[_0x0acd('0x9')]=monitorFormat[_0x46ed23[_0x0acd('0x9')]]?monitorFormat[_0x46ed23[_0x0acd('0x9')]]:undefined;this['mandatoryDisposition']=_0x46ed23[_0x0acd('0x7c')]||![];this['mandatoryDispositionPause']=_0x46ed23[_0x0acd('0x7d')]?_0x46ed23[_0x0acd('0x7d')]:undefined;this[_0x0acd('0x7e')]=![];}module[_0x0acd('0x7f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index bc1a5b7..4ad9bd1 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 _0xac0a=['erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','createReport','loggedin','callers','length','SIP/','incall','status','booked','keys','queue','dialer','exten','prototype','compareToInboundQueue','compareToOutboundQueue','some','updateReportFromOutboundQueue','preview','exports','loggedInDb','paused','talking','waiting','available','answered','inUse','loggedIn','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringing','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls'];(function(_0x295242,_0x238973){var _0x9c4b37=function(_0x30edea){while(--_0x30edea){_0x295242['push'](_0x295242['shift']());}};_0x9c4b37(++_0x238973);}(_0xac0a,0x11e));var _0xaac0=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0xac0a[_0x1ff2ec];return _0x405683;};'use strict';var INBOUND_COUNTERS=['available','loggedIn',_0xaac0('0x0'),_0xaac0('0x1'),'ringing',_0xaac0('0x2'),_0xaac0('0x3')];var OUTBOUND_COUNTERS=[_0xaac0('0x4'),_0xaac0('0x5'),_0xaac0('0x6'),_0xaac0('0x7'),_0xaac0('0x0'),_0xaac0('0x8'),_0xaac0('0x9'),_0xaac0('0xa'),_0xaac0('0xb'),_0xaac0('0xc'),'outboundCongestionCallsDay',_0xaac0('0xd'),_0xaac0('0xe'),'outboundReCallsDay',_0xaac0('0xf'),_0xaac0('0x10'),_0xaac0('0x1'),_0xaac0('0x11'),_0xaac0('0x2'),_0xaac0('0x12'),_0xaac0('0x13'),_0xaac0('0x14'),_0xaac0('0x3')];function VoiceQueueSummary(_0x2dfb69){this['id']=_0x2dfb69['id'];this[_0xaac0('0x15')]=_0x2dfb69[_0xaac0('0x15')];this[_0xaac0('0x16')]=_0x2dfb69[_0xaac0('0x16')];this[_0xaac0('0x17')]=_0x2dfb69[_0xaac0('0x17')]||0x0;this[_0xaac0('0x5')]=_0x2dfb69[_0xaac0('0x5')]||0x0;this[_0xaac0('0x4')]=_0x2dfb69[_0xaac0('0x4')]||0x0;this[_0xaac0('0x18')]=_0x2dfb69[_0xaac0('0x18')]||0x0;this[_0xaac0('0x6')]=_0x2dfb69[_0xaac0('0x6')]||0x0;this[_0xaac0('0x19')]=_0x2dfb69[_0xaac0('0x19')]||0x0;this[_0xaac0('0x7')]=_0x2dfb69['loggedIn']||0x0;this[_0xaac0('0x0')]=_0x2dfb69['loggedInDb']||0x0;this['onHold']=_0x2dfb69[_0xaac0('0x1a')]||0x0;this[_0xaac0('0x1b')]=_0x2dfb69['notInUse']||0x0;this[_0xaac0('0x1')]=_0x2dfb69[_0xaac0('0x1')]||0x0;this['ringing']=_0x2dfb69[_0xaac0('0x1c')]||0x0;this[_0xaac0('0x1d')]=_0x2dfb69[_0xaac0('0x1d')];this[_0xaac0('0x12')]=_0x2dfb69[_0xaac0('0x12')];this[_0xaac0('0x13')]=_0x2dfb69['sumDuration'];this['sumHoldTime']=_0x2dfb69[_0xaac0('0x1e')]||0x0;this[_0xaac0('0x2')]=_0x2dfb69['talking']||0x0;this['total']=_0x2dfb69[_0xaac0('0x14')]||0x0;this[_0xaac0('0x1f')]=_0x2dfb69['type'];this[_0xaac0('0x20')]=_0x2dfb69[_0xaac0('0x20')]||0x0;this[_0xaac0('0x21')]=_0x2dfb69['unknown']||0x0;this[_0xaac0('0x22')]=_0x2dfb69[_0xaac0('0x22')]||0x0;this[_0xaac0('0x3')]=_0x2dfb69[_0xaac0('0x3')]||0x0;if(_0x2dfb69[_0xaac0('0x1f')]===_0xaac0('0x23')){this[_0xaac0('0x11')]=_0x2dfb69['pTalking']||0x0;this[_0xaac0('0x24')]=_0x2dfb69[_0xaac0('0x24')];this[_0xaac0('0x25')]=_0x2dfb69[_0xaac0('0x25')];this['dialOriginateCallerIdName']=_0x2dfb69[_0xaac0('0x26')];this[_0xaac0('0x27')]=_0x2dfb69[_0xaac0('0x27')];this['dialOriginateTimeout']=_0x2dfb69['dialOriginateTimeout'];this[_0xaac0('0x28')]=_0x2dfb69[_0xaac0('0x28')];this['temp']=_0x2dfb69['temp'];this[_0xaac0('0x29')]=_0x2dfb69[_0xaac0('0x29')];this['outboundAnswerCallsDay']=_0x2dfb69['outboundAnswerCallsDay'];this[_0xaac0('0xb')]=_0x2dfb69[_0xaac0('0xb')];this[_0xaac0('0xc')]=_0x2dfb69[_0xaac0('0xc')];this[_0xaac0('0x2a')]=_0x2dfb69['outboundCongestionCallsDay'];this[_0xaac0('0x2b')]=_0x2dfb69[_0xaac0('0x2b')];this[_0xaac0('0x2c')]=_0x2dfb69[_0xaac0('0x2c')];this[_0xaac0('0x2d')]=_0x2dfb69['outboundDropCallsDayTimeout'];this[_0xaac0('0xd')]=_0x2dfb69['outboundNoAnswerCallsDay'];this[_0xaac0('0xe')]=_0x2dfb69[_0xaac0('0xe')];this['outboundOriginateFailureCallsDay']=_0x2dfb69[_0xaac0('0x2e')];this[_0xaac0('0x2f')]=_0x2dfb69['outboundReCallsDay'];this[_0xaac0('0xf')]=_0x2dfb69['outboundRejectCallsDay'];this[_0xaac0('0x10')]=_0x2dfb69['outboundUnknownCallsDay'];this[_0xaac0('0x30')]=_0x2dfb69[_0xaac0('0x30')];this[_0xaac0('0x31')]=_0x2dfb69[_0xaac0('0x31')];this[_0xaac0('0x32')]=_0x2dfb69[_0xaac0('0x32')];this[_0xaac0('0x33')]=_0x2dfb69[_0xaac0('0x33')];this[_0xaac0('0x34')]=_0x2dfb69[_0xaac0('0x34')];this[_0xaac0('0x35')]=_0x2dfb69['predictiveIntervalErlangCalls'];this[_0xaac0('0x36')]=_0x2dfb69[_0xaac0('0x36')];this[_0xaac0('0x37')]=_0x2dfb69[_0xaac0('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x2dfb69['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x2dfb69['predictiveIntervalPauses'];this[_0xaac0('0x38')]=_0x2dfb69[_0xaac0('0x38')];this[_0xaac0('0x39')]=_0x2dfb69['predictiveIntervalTotalCalls'];this['originated']=_0x2dfb69[_0xaac0('0x8')];this[_0xaac0('0x3a')]=_0x2dfb69[_0xaac0('0x3a')];this[_0xaac0('0x3b')]=_0x2dfb69['erlangCallToSecond'];this['erlangAbandonmentRate']=_0x2dfb69['erlangAbandonmentRate'];this[_0xaac0('0x3c')]=_0x2dfb69[_0xaac0('0x3c')];this[_0xaac0('0x3d')]=_0x2dfb69[_0xaac0('0x3d')];this[_0xaac0('0x3e')]=_0x2dfb69['startProgressive'];this[_0xaac0('0x3f')]=_0x2dfb69[_0xaac0('0x3f')];this[_0xaac0('0x40')]=_0x2dfb69[_0xaac0('0x40')];}if(_0x2dfb69['Trunk']){this[_0xaac0('0x41')]={'id':_0x2dfb69[_0xaac0('0x41')]['id'],'name':_0x2dfb69['Trunk'][_0xaac0('0x15')],'active':_0x2dfb69[_0xaac0('0x41')][_0xaac0('0x42')],'callerid':_0x2dfb69[_0xaac0('0x41')]['callerid']};}}VoiceQueueSummary['prototype'][_0xaac0('0x43')]=function(_0x5be612,_0x34c859,_0x15543c,_0x2552d1){this[_0xaac0('0x0')]=0x0;this[_0xaac0('0x2')]=0x0;this[_0xaac0('0x1')]=0x0;this[_0xaac0('0x21')]=0x0;this[_0xaac0('0x1b')]=0x0;this[_0xaac0('0x6')]=0x0;this[_0xaac0('0x18')]=0x0;this['invalid']=0x0;this[_0xaac0('0x20')]=0x0;this[_0xaac0('0x1c')]=0x0;this['ringInUse']=0x0;this[_0xaac0('0x1a')]=0x0;if(_0x15543c){if(_0x15543c[_0xaac0('0x4')]){this['available']=Number(_0x15543c[_0xaac0('0x4')]);}if(_0x15543c[_0xaac0('0x44')]){this[_0xaac0('0x7')]=Number(_0x15543c[_0xaac0('0x44')]);}if(_0x15543c[_0xaac0('0x45')]){this[_0xaac0('0x3')]=Number(_0x15543c['callers']);}}for(var _0x33b170=0x0;_0x33b170<_0x5be612[_0xaac0('0x46')];_0x33b170++){var _0x3baa0b=_0x34c859[_0xaac0('0x47')+_0x5be612[_0x33b170][_0xaac0('0x15')]];if(_0x3baa0b&&_0x3baa0b['online']){this[_0xaac0('0x0')]+=0x1;}if(_0x5be612[_0x33b170][_0xaac0('0x48')]==='1'){this[_0xaac0('0x2')]+=0x1;}if(_0x5be612[_0x33b170][_0xaac0('0x1')]==='1'&&!['2','7','8']['includes'](_0x5be612[_0x33b170][_0xaac0('0x49')])){this['paused']+=0x1;}switch(_0x5be612[_0x33b170][_0xaac0('0x49')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xaac0('0x1b')]+=0x1;break;case'2':this[_0xaac0('0x6')]+=0x1;break;case'3':this[_0xaac0('0x18')]+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0xaac0('0x20')]+=0x1;break;case'6':this[_0xaac0('0x1c')]+=0x1;break;case'7':this[_0xaac0('0x1d')]+=0x1;break;case'8':this[_0xaac0('0x1a')]+=0x1;break;}}if(this[_0xaac0('0x25')]===_0xaac0('0x4a')){var _0x54abfc=Object[_0xaac0('0x4b')](_0x2552d1);for(var _0x446dc4=0x0;_0x446dc4<_0x54abfc['length'];_0x446dc4++){var _0x30a03f=_0x54abfc[_0x446dc4];var _0x2ecd59=_0x2552d1[_0x30a03f];if(_0x2ecd59[_0xaac0('0x4c')]===this[_0xaac0('0x15')]&&_0x2ecd59[_0xaac0('0x1f')]===_0xaac0('0x4d')&&_0x2ecd59[_0xaac0('0x4e')]==='xcally-motion-preview'){this['talking']+=0x1;}}if(this[_0xaac0('0x2')]>this['inUse']){this[_0xaac0('0x2')]=this[_0xaac0('0x6')];}this[_0xaac0('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xaac0('0x4f')][_0xaac0('0x50')]=function(_0x350fb2){var _0x170c92=![];if(_0x350fb2){_0x170c92=INBOUND_COUNTERS['some'](function(_0x22c7e8){return this[_0x22c7e8]!==_0x350fb2[_0x22c7e8];},this);}return _0x170c92;};VoiceQueueSummary[_0xaac0('0x4f')][_0xaac0('0x51')]=function(_0x35814d){var _0x1c2679=![];var _0x3e43a5=![];var _0x44ffca=![];if(_0x35814d){_0x1c2679=this[_0xaac0('0x25')]!==_0x35814d['dialMethod']||this['dialActive']!==_0x35814d[_0xaac0('0x24')]||this['message']!==_0x35814d['message']||this[_0xaac0('0x40')]!==_0x35814d[_0xaac0('0x40')];_0x3e43a5=OUTBOUND_COUNTERS[_0xaac0('0x52')](function(_0x5a72ef){return this[_0x5a72ef]!==_0x35814d[_0x5a72ef];},this);if(this['Trunk']&&_0x35814d['Trunk']){_0x44ffca=this[_0xaac0('0x41')][_0xaac0('0x15')]!==_0x35814d[_0xaac0('0x41')][_0xaac0('0x15')]||this[_0xaac0('0x41')][_0xaac0('0x42')]!==_0x35814d[_0xaac0('0x41')]['active'];}}return _0x1c2679||_0x3e43a5||_0x44ffca;};VoiceQueueSummary[_0xaac0('0x4f')][_0xaac0('0x53')]=function(_0x39861f){this[_0xaac0('0x5')]=_0x39861f[_0xaac0('0x5')];this['message']=_0x39861f[_0xaac0('0x3f')];this[_0xaac0('0x40')]=_0x39861f[_0xaac0('0x40')];this[_0xaac0('0x8')]=_0x39861f[_0xaac0('0x8')];this[_0xaac0('0x9')]=_0x39861f[_0xaac0('0x9')];this['outboundAnswerCallsDay']=_0x39861f[_0xaac0('0xa')];this[_0xaac0('0xb')]=_0x39861f[_0xaac0('0xb')];this[_0xaac0('0xc')]=_0x39861f['outboundBusyCallsDay'];this[_0xaac0('0x2a')]=_0x39861f['outboundCongestionCallsDay'];this[_0xaac0('0xd')]=_0x39861f['outboundNoAnswerCallsDay'];this[_0xaac0('0xe')]=_0x39861f[_0xaac0('0xe')];this[_0xaac0('0x2f')]=_0x39861f[_0xaac0('0x2f')];this[_0xaac0('0xf')]=_0x39861f['outboundRejectCallsDay'];this[_0xaac0('0x10')]=_0x39861f[_0xaac0('0x10')];this[_0xaac0('0x12')]=_0x39861f['sumBillable'];this['sumDuration']=_0x39861f[_0xaac0('0x13')];this[_0xaac0('0x14')]=_0x39861f[_0xaac0('0x14')];if(this[_0xaac0('0x25')]===_0xaac0('0x54')){this[_0xaac0('0x11')]=_0x39861f['pTalking'];}};module[_0xaac0('0x55')]=VoiceQueueSummary; \ No newline at end of file +var _0x64f5=['online','incall','includes','status','booked','keys','length','queue','dialer','xcally-motion-preview','prototype','compareToInboundQueue','some','active','updateReportFromOutboundQueue','outboundAnswerCallsDay','preview','exports','available','ringing','waiting','inUse','loggedIn','loggedInDb','originated','outboundAbandonedCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','talking','sumBillable','sumDuration','name','strategy','abandoned','answered','invalid','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','createReport','busy','loggedin','callers','SIP/'];(function(_0x5e3022,_0x5ef1ae){var _0x1dd4b7=function(_0x133843){while(--_0x133843){_0x5e3022['push'](_0x5e3022['shift']());}};_0x1dd4b7(++_0x5ef1ae);}(_0x64f5,0x17e));var _0x564f=function(_0x37376b,_0x48fd0b){_0x37376b=_0x37376b-0x0;var _0x2b3157=_0x64f5[_0x37376b];return _0x2b3157;};'use strict';var INBOUND_COUNTERS=[_0x564f('0x0'),'loggedIn','loggedInDb','paused',_0x564f('0x1'),'talking',_0x564f('0x2')];var OUTBOUND_COUNTERS=[_0x564f('0x0'),'answered',_0x564f('0x3'),_0x564f('0x4'),_0x564f('0x5'),_0x564f('0x6'),_0x564f('0x7'),'outboundAnswerCallsDay',_0x564f('0x8'),_0x564f('0x9'),_0x564f('0xa'),_0x564f('0xb'),_0x564f('0xc'),_0x564f('0xd'),_0x564f('0xe'),_0x564f('0xf'),_0x564f('0x10'),_0x564f('0x11'),_0x564f('0x12'),_0x564f('0x13'),_0x564f('0x14'),'total','waiting'];function VoiceQueueSummary(_0xcaf1e0){this['id']=_0xcaf1e0['id'];this['name']=_0xcaf1e0[_0x564f('0x15')];this[_0x564f('0x16')]=_0xcaf1e0[_0x564f('0x16')];this['abandoned']=_0xcaf1e0[_0x564f('0x17')]||0x0;this[_0x564f('0x18')]=_0xcaf1e0[_0x564f('0x18')]||0x0;this[_0x564f('0x0')]=_0xcaf1e0[_0x564f('0x0')]||0x0;this['busy']=_0xcaf1e0['busy']||0x0;this[_0x564f('0x3')]=_0xcaf1e0[_0x564f('0x3')]||0x0;this[_0x564f('0x19')]=_0xcaf1e0[_0x564f('0x19')]||0x0;this[_0x564f('0x4')]=_0xcaf1e0[_0x564f('0x4')]||0x0;this[_0x564f('0x5')]=_0xcaf1e0[_0x564f('0x5')]||0x0;this[_0x564f('0x1a')]=_0xcaf1e0[_0x564f('0x1a')]||0x0;this[_0x564f('0x1b')]=_0xcaf1e0['notInUse']||0x0;this[_0x564f('0x10')]=_0xcaf1e0[_0x564f('0x10')]||0x0;this[_0x564f('0x1')]=_0xcaf1e0[_0x564f('0x1')]||0x0;this[_0x564f('0x1c')]=_0xcaf1e0[_0x564f('0x1c')];this[_0x564f('0x13')]=_0xcaf1e0[_0x564f('0x13')];this[_0x564f('0x14')]=_0xcaf1e0[_0x564f('0x14')];this[_0x564f('0x1d')]=_0xcaf1e0['sumHoldTime']||0x0;this[_0x564f('0x12')]=_0xcaf1e0[_0x564f('0x12')]||0x0;this[_0x564f('0x1e')]=_0xcaf1e0['total']||0x0;this[_0x564f('0x1f')]=_0xcaf1e0[_0x564f('0x1f')];this[_0x564f('0x20')]=_0xcaf1e0[_0x564f('0x20')]||0x0;this[_0x564f('0x21')]=_0xcaf1e0['unknown']||0x0;this[_0x564f('0x22')]=_0xcaf1e0['unmanaged']||0x0;this[_0x564f('0x2')]=_0xcaf1e0[_0x564f('0x2')]||0x0;if(_0xcaf1e0[_0x564f('0x1f')]===_0x564f('0x23')){this['pTalking']=_0xcaf1e0[_0x564f('0x11')]||0x0;this[_0x564f('0x24')]=_0xcaf1e0[_0x564f('0x24')];this['dialMethod']=_0xcaf1e0[_0x564f('0x25')];this['dialOriginateCallerIdName']=_0xcaf1e0[_0x564f('0x26')];this[_0x564f('0x27')]=_0xcaf1e0['dialOriginateCallerIdNumber'];this[_0x564f('0x28')]=_0xcaf1e0['dialOriginateTimeout'];this[_0x564f('0x29')]=_0xcaf1e0['dialPrefix'];this[_0x564f('0x2a')]=_0xcaf1e0[_0x564f('0x2a')];this['outboundAnswerAgiCallsDay']=_0xcaf1e0[_0x564f('0x2b')];this['outboundAnswerCallsDay']=_0xcaf1e0['outboundAnswerCallsDay'];this[_0x564f('0x8')]=_0xcaf1e0[_0x564f('0x8')];this[_0x564f('0x9')]=_0xcaf1e0['outboundBusyCallsDay'];this[_0x564f('0xa')]=_0xcaf1e0['outboundCongestionCallsDay'];this[_0x564f('0x2c')]=_0xcaf1e0[_0x564f('0x2c')];this['outboundDropCallsDayCallersExit']=_0xcaf1e0[_0x564f('0x2d')];this['outboundDropCallsDayTimeout']=_0xcaf1e0[_0x564f('0x2e')];this[_0x564f('0xb')]=_0xcaf1e0[_0x564f('0xb')];this[_0x564f('0xc')]=_0xcaf1e0[_0x564f('0xc')];this[_0x564f('0x2f')]=_0xcaf1e0[_0x564f('0x2f')];this[_0x564f('0xd')]=_0xcaf1e0['outboundReCallsDay'];this[_0x564f('0xe')]=_0xcaf1e0[_0x564f('0xe')];this['outboundUnknownCallsDay']=_0xcaf1e0[_0x564f('0xf')];this[_0x564f('0x30')]=_0xcaf1e0[_0x564f('0x30')];this[_0x564f('0x31')]=_0xcaf1e0[_0x564f('0x31')];this[_0x564f('0x32')]=_0xcaf1e0[_0x564f('0x32')];this[_0x564f('0x33')]=_0xcaf1e0[_0x564f('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0xcaf1e0[_0x564f('0x34')];this[_0x564f('0x35')]=_0xcaf1e0[_0x564f('0x35')];this[_0x564f('0x36')]=_0xcaf1e0['predictiveIntervalErlangCallsDroppedCalls'];this['predictiveIntervalHitRate']=_0xcaf1e0['predictiveIntervalHitRate'];this[_0x564f('0x37')]=_0xcaf1e0[_0x564f('0x37')];this[_0x564f('0x38')]=_0xcaf1e0[_0x564f('0x38')];this['predictiveIntervalAvailable']=_0xcaf1e0['predictiveIntervalAvailable'];this[_0x564f('0x39')]=_0xcaf1e0['predictiveIntervalTotalCalls'];this['originated']=_0xcaf1e0[_0x564f('0x6')];this['erlangCalls']=_0xcaf1e0[_0x564f('0x3a')];this[_0x564f('0x3b')]=_0xcaf1e0[_0x564f('0x3b')];this[_0x564f('0x3c')]=_0xcaf1e0['erlangAbandonmentRate'];this[_0x564f('0x3d')]=_0xcaf1e0[_0x564f('0x3d')];this[_0x564f('0x3e')]=_0xcaf1e0['startPredictive'];this[_0x564f('0x3f')]=_0xcaf1e0[_0x564f('0x3f')];this[_0x564f('0x40')]=_0xcaf1e0['message'];this[_0x564f('0x41')]=_0xcaf1e0['statusMessage'];}if(_0xcaf1e0[_0x564f('0x42')]){this[_0x564f('0x42')]={'id':_0xcaf1e0[_0x564f('0x42')]['id'],'name':_0xcaf1e0[_0x564f('0x42')]['name'],'active':_0xcaf1e0[_0x564f('0x42')]['active'],'callerid':_0xcaf1e0['Trunk'][_0x564f('0x43')]};}}VoiceQueueSummary['prototype'][_0x564f('0x44')]=function(_0x2359cf,_0x5b6d9a,_0x13a8c1,_0x39453f){this[_0x564f('0x5')]=0x0;this[_0x564f('0x12')]=0x0;this[_0x564f('0x10')]=0x0;this[_0x564f('0x21')]=0x0;this[_0x564f('0x1b')]=0x0;this[_0x564f('0x3')]=0x0;this[_0x564f('0x45')]=0x0;this[_0x564f('0x19')]=0x0;this[_0x564f('0x20')]=0x0;this[_0x564f('0x1')]=0x0;this['ringInUse']=0x0;this[_0x564f('0x1a')]=0x0;if(_0x13a8c1){if(_0x13a8c1[_0x564f('0x0')]){this['available']=Number(_0x13a8c1['available']);}if(_0x13a8c1[_0x564f('0x46')]){this[_0x564f('0x4')]=Number(_0x13a8c1[_0x564f('0x46')]);}if(_0x13a8c1[_0x564f('0x47')]){this[_0x564f('0x2')]=Number(_0x13a8c1[_0x564f('0x47')]);}}for(var _0x5d84b3=0x0;_0x5d84b3<_0x2359cf['length'];_0x5d84b3++){var _0x1c5c6d=_0x5b6d9a[_0x564f('0x48')+_0x2359cf[_0x5d84b3]['name']];if(_0x1c5c6d&&_0x1c5c6d[_0x564f('0x49')]){this[_0x564f('0x5')]+=0x1;}if(_0x2359cf[_0x5d84b3][_0x564f('0x4a')]==='1'){this['talking']+=0x1;}if(_0x2359cf[_0x5d84b3]['paused']==='1'&&!['2','7','8'][_0x564f('0x4b')](_0x2359cf[_0x5d84b3][_0x564f('0x4c')])){this[_0x564f('0x10')]+=0x1;}switch(_0x2359cf[_0x5d84b3][_0x564f('0x4c')]){case'0':this[_0x564f('0x21')]+=0x1;break;case'1':this[_0x564f('0x1b')]+=0x1;break;case'2':this[_0x564f('0x3')]+=0x1;break;case'3':this[_0x564f('0x45')]+=0x1;break;case'4':this[_0x564f('0x19')]+=0x1;break;case'5':this[_0x564f('0x20')]+=0x1;break;case'6':this[_0x564f('0x1')]+=0x1;break;case'7':this[_0x564f('0x1c')]+=0x1;break;case'8':this[_0x564f('0x1a')]+=0x1;break;}}if(this[_0x564f('0x25')]===_0x564f('0x4d')){var _0x2feef8=Object[_0x564f('0x4e')](_0x39453f);for(var _0x483520=0x0;_0x483520<_0x2feef8[_0x564f('0x4f')];_0x483520++){var _0x549b79=_0x2feef8[_0x483520];var _0x509eda=_0x39453f[_0x549b79];if(_0x509eda[_0x564f('0x50')]===this[_0x564f('0x15')]&&_0x509eda['type']===_0x564f('0x51')&&_0x509eda['exten']===_0x564f('0x52')){this['talking']+=0x1;}}if(this[_0x564f('0x12')]>this['inUse']){this[_0x564f('0x12')]=this[_0x564f('0x3')];}this[_0x564f('0x11')]=0x0;}return this;};VoiceQueueSummary[_0x564f('0x53')][_0x564f('0x54')]=function(_0x4dcfba){var _0x3cbc10=![];if(_0x4dcfba){_0x3cbc10=INBOUND_COUNTERS['some'](function(_0x371f0b){return this[_0x371f0b]!==_0x4dcfba[_0x371f0b];},this);}return _0x3cbc10;};VoiceQueueSummary[_0x564f('0x53')]['compareToOutboundQueue']=function(_0x34b0a5){var _0x318335=![];var _0x1598e7=![];var _0x1ddf04=![];if(_0x34b0a5){_0x318335=this[_0x564f('0x25')]!==_0x34b0a5[_0x564f('0x25')]||this[_0x564f('0x24')]!==_0x34b0a5[_0x564f('0x24')]||this[_0x564f('0x40')]!==_0x34b0a5['message']||this[_0x564f('0x41')]!==_0x34b0a5[_0x564f('0x41')];_0x1598e7=OUTBOUND_COUNTERS[_0x564f('0x55')](function(_0x1c12ff){return this[_0x1c12ff]!==_0x34b0a5[_0x1c12ff];},this);if(this[_0x564f('0x42')]&&_0x34b0a5[_0x564f('0x42')]){_0x1ddf04=this['Trunk'][_0x564f('0x15')]!==_0x34b0a5[_0x564f('0x42')][_0x564f('0x15')]||this[_0x564f('0x42')][_0x564f('0x56')]!==_0x34b0a5[_0x564f('0x42')]['active'];}}return _0x318335||_0x1598e7||_0x1ddf04;};VoiceQueueSummary[_0x564f('0x53')][_0x564f('0x57')]=function(_0x24f7aa){this[_0x564f('0x18')]=_0x24f7aa['answered'];this['message']=_0x24f7aa[_0x564f('0x40')];this[_0x564f('0x41')]=_0x24f7aa[_0x564f('0x41')];this['originated']=_0x24f7aa[_0x564f('0x6')];this['outboundAbandonedCallsDay']=_0x24f7aa[_0x564f('0x7')];this['outboundAnswerCallsDay']=_0x24f7aa[_0x564f('0x58')];this[_0x564f('0x8')]=_0x24f7aa[_0x564f('0x8')];this[_0x564f('0x9')]=_0x24f7aa['outboundBusyCallsDay'];this[_0x564f('0xa')]=_0x24f7aa[_0x564f('0xa')];this[_0x564f('0xb')]=_0x24f7aa[_0x564f('0xb')];this[_0x564f('0xc')]=_0x24f7aa[_0x564f('0xc')];this[_0x564f('0xd')]=_0x24f7aa[_0x564f('0xd')];this[_0x564f('0xe')]=_0x24f7aa[_0x564f('0xe')];this[_0x564f('0xf')]=_0x24f7aa[_0x564f('0xf')];this[_0x564f('0x13')]=_0x24f7aa[_0x564f('0x13')];this[_0x564f('0x14')]=_0x24f7aa['sumDuration'];this[_0x564f('0x1e')]=_0x24f7aa[_0x564f('0x1e')];if(this[_0x564f('0x25')]===_0x564f('0x59')){this[_0x564f('0x11')]=_0x24f7aa['pTalking'];}};module[_0x564f('0x5a')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f3ead5f..4de5a25 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 _0x8e31=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x269ee8,_0x477226){var _0x4d98bd=function(_0x20d4c4){while(--_0x20d4c4){_0x269ee8['push'](_0x269ee8['shift']());}};_0x4d98bd(++_0x477226);}(_0x8e31,0x139));var _0x18e3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x8e31[_0x413feb];return _0x40ee88;};'use strict';function VtigerAccount(_0x5e42a4){this['id']=_0x5e42a4['id']||0x0;this['name']=_0x5e42a4[_0x18e3('0x0')]||'';this[_0x18e3('0x1')]=_0x5e42a4[_0x18e3('0x1')]||'';this[_0x18e3('0x2')]=_0x5e42a4[_0x18e3('0x2')]||'';this[_0x18e3('0x3')]=_0x5e42a4[_0x18e3('0x3')]||'';this['serverUrl']=_0x5e42a4[_0x18e3('0x4')]||'';this[_0x18e3('0x5')]=_0x5e42a4[_0x18e3('0x5')]||{};}module[_0x18e3('0x6')]=VtigerAccount; \ No newline at end of file +var _0xbbdb=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x58ae8a,_0x3c619e){var _0x2f0b6b=function(_0x6db940){while(--_0x6db940){_0x58ae8a['push'](_0x58ae8a['shift']());}};_0x2f0b6b(++_0x3c619e);}(_0xbbdb,0x178));var _0xbbbd=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0xbbdb[_0x21af3a];return _0x268a49;};'use strict';function VtigerAccount(_0x4d422e){this['id']=_0x4d422e['id']||0x0;this[_0xbbbd('0x0')]=_0x4d422e[_0xbbbd('0x0')]||'';this['username']=_0x4d422e[_0xbbbd('0x1')]||'';this[_0xbbbd('0x2')]=_0x4d422e[_0xbbbd('0x2')]||'';this['remoteUri']=_0x4d422e[_0xbbbd('0x3')]||'';this['serverUrl']=_0x4d422e[_0xbbbd('0x4')]||'';this[_0xbbbd('0x5')]=_0x4d422e[_0xbbbd('0x5')]||{};}module[_0xbbbd('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7950b36..67fddad 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 _0xc565=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','password'];(function(_0x49a06a,_0x301c99){var _0x1b3d7a=function(_0x1a72fb){while(--_0x1a72fb){_0x49a06a['push'](_0x49a06a['shift']());}};_0x1b3d7a(++_0x301c99);}(_0xc565,0xe0));var _0x5c56=function(_0x12fc2d,_0x9326ee){_0x12fc2d=_0x12fc2d-0x0;var _0x7a807d=_0xc565[_0x12fc2d];return _0x7a807d;};'use strict';function ZendeskAccount(_0x4a1e42){this['id']=_0x4a1e42['id']||0x0;this['name']=_0x4a1e42['name']||'';this['username']=_0x4a1e42['username']||'';this[_0x5c56('0x0')]=_0x4a1e42['password']||'';this['token']=_0x4a1e42[_0x5c56('0x1')]||'';this[_0x5c56('0x2')]=_0x4a1e42[_0x5c56('0x2')]||'';this[_0x5c56('0x3')]=_0x4a1e42[_0x5c56('0x3')]||'';this['type']=_0x4a1e42[_0x5c56('0x4')]||_0x5c56('0x5');this[_0x5c56('0x6')]=_0x4a1e42[_0x5c56('0x6')]||'';this[_0x5c56('0x7')]=_0x4a1e42[_0x5c56('0x7')]||{};}module[_0x5c56('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x1f71=['type','integrationTab','serverUrl','Configurations','exports','name','username','token','remoteUri','authType'];(function(_0x460c5e,_0x2bd3b6){var _0x266a66=function(_0x5b2d64){while(--_0x5b2d64){_0x460c5e['push'](_0x460c5e['shift']());}};_0x266a66(++_0x2bd3b6);}(_0x1f71,0x1e5));var _0x11f7=function(_0x2d3932,_0x150fae){_0x2d3932=_0x2d3932-0x0;var _0x5918de=_0x1f71[_0x2d3932];return _0x5918de;};'use strict';function ZendeskAccount(_0x34dd59){this['id']=_0x34dd59['id']||0x0;this[_0x11f7('0x0')]=_0x34dd59[_0x11f7('0x0')]||'';this[_0x11f7('0x1')]=_0x34dd59[_0x11f7('0x1')]||'';this['password']=_0x34dd59['password']||'';this['token']=_0x34dd59[_0x11f7('0x2')]||'';this[_0x11f7('0x3')]=_0x34dd59[_0x11f7('0x3')]||'';this[_0x11f7('0x4')]=_0x34dd59[_0x11f7('0x4')]||'';this[_0x11f7('0x5')]=_0x34dd59[_0x11f7('0x5')]||_0x11f7('0x6');this[_0x11f7('0x7')]=_0x34dd59[_0x11f7('0x7')]||'';this['Configurations']=_0x34dd59[_0x11f7('0x8')]||{};}module[_0x11f7('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 305c395..78f4964 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 _0xc5f8=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc5f8,0x1c5));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x5454c7){this['id']=_0x5454c7['id']||0x0;this[_0x8c5f('0x0')]=_0x5454c7[_0x8c5f('0x0')]||'';this[_0x8c5f('0x1')]=_0x5454c7[_0x8c5f('0x1')]||'';this['host']=_0x5454c7[_0x8c5f('0x2')]||'';this[_0x8c5f('0x3')]=_0x5454c7[_0x8c5f('0x3')]||'';this['clientId']=_0x5454c7[_0x8c5f('0x4')]||'';this[_0x8c5f('0x5')]=_0x5454c7[_0x8c5f('0x5')]||'';this[_0x8c5f('0x6')]=_0x5454c7[_0x8c5f('0x6')]||'';this[_0x8c5f('0x7')]=_0x5454c7[_0x8c5f('0x7')]||'';this['refreshToken']=_0x5454c7[_0x8c5f('0x8')]||'';this['Configurations']=_0x5454c7[_0x8c5f('0x9')]||{};}module[_0x8c5f('0xa')]=ZohoAccount; \ No newline at end of file +var _0xa0f3=['serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x2270ed,_0xbd9e2c){var _0x3cbf8c=function(_0x39d8c5){while(--_0x39d8c5){_0x2270ed['push'](_0x2270ed['shift']());}};_0x3cbf8c(++_0xbd9e2c);}(_0xa0f3,0x1c8));var _0x3a0f=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa0f3[_0x5b561d];return _0x431060;};'use strict';function ZohoAccount(_0x10ad92){this['id']=_0x10ad92['id']||0x0;this[_0x3a0f('0x0')]=_0x10ad92[_0x3a0f('0x0')]||'';this[_0x3a0f('0x1')]=_0x10ad92[_0x3a0f('0x1')]||'';this['host']=_0x10ad92[_0x3a0f('0x2')]||'';this[_0x3a0f('0x3')]=_0x10ad92['zone']||'';this['clientId']=_0x10ad92[_0x3a0f('0x4')]||'';this[_0x3a0f('0x5')]=_0x10ad92['clientSecret']||'';this[_0x3a0f('0x6')]=_0x10ad92[_0x3a0f('0x6')]||'';this[_0x3a0f('0x7')]=_0x10ad92['code']||'';this['refreshToken']=_0x10ad92[_0x3a0f('0x8')]||'';this[_0x3a0f('0x9')]=_0x10ad92['Configurations']||{};}module[_0x3a0f('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 55cf827..00edd84 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 _0x7916=['membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','number','util','moment','isNil','string','idContact','type','queue','dialAnswer'];(function(_0x5c697c,_0x294022){var _0x2b4ac0=function(_0x5d83ab){while(--_0x5d83ab){_0x5c697c['push'](_0x5c697c['shift']());}};_0x2b4ac0(++_0x294022);}(_0x7916,0x128));var _0x6791=function(_0x204198,_0x8139d0){_0x204198=_0x204198-0x0;var _0x281e02=_0x7916[_0x204198];return _0x281e02;};'use strict';var util=require(_0x6791('0x0'));var _=require('lodash');var moment=require(_0x6791('0x1'));function checkNameSurname(_0xdaaf2b,_0x4ca50a,_0x325c54){var _0x2d8cc8='';if(!_[_0x6791('0x2')](_0x4ca50a)&&_0x6791('0x3')===typeof _0x4ca50a){_0x2d8cc8+=_0x4ca50a;}if(!_['isNil'](_0x325c54)&&_0x6791('0x3')===typeof _0x325c54){_0x2d8cc8+='\x20'+_0x325c54;}if(_0x2d8cc8!==''){return _0x2d8cc8;}return _0xdaaf2b;}function Action(_0x5a5726,_0x3ca328,_0x3277a8,_0x5ad8c0,_0x8b85ff){this['uniqueid']=_0x3277a8||undefined;this[_0x6791('0x4')]=_0x5a5726['id'];this['queue']=_0x3ca328['name'];this[_0x6791('0x5')]=_0x3ca328[_0x6791('0x5')];this['campaigntype']=_0x6791('0x6');this[_0x6791('0x7')]=![];this[_0x6791('0x8')]=_['isNil'](_0x5a5726[_0x6791('0x9')])?undefined:_0x5a5726[_0x6791('0x9')][_0x6791('0xa')];this[_0x6791('0xb')]=this[_0x6791('0x8')]?util[_0x6791('0xc')](_0x6791('0xd'),this[_0x6791('0x8')]):_0x5ad8c0||undefined;this[_0x6791('0xe')]=checkNameSurname(_0x5a5726[_0x6791('0xf')][_0x6791('0x10')],_0x5a5726['Contact']['firstName'],_0x5a5726[_0x6791('0xf')]['lastName']);this[_0x6791('0x11')]=_0x5a5726['active']||![];this[_0x6791('0x12')]=_0x5a5726[_0x6791('0x10')];this['scheduledat']=_0x5a5726[_0x6791('0x13')];this['countbusyretry']=_0x5a5726[_0x6791('0x14')]||0x0;this[_0x6791('0x15')]=_0x5a5726['countcongestionretry']||0x0;this[_0x6791('0x16')]=_0x5a5726[_0x6791('0x16')]||0x0;this['countglobal']=(_0x5a5726[_0x6791('0x14')]||0x0)+(_0x5a5726['countcongestionretry']||0x0)+(_0x5a5726[_0x6791('0x16')]||0x0)+(_0x5a5726[_0x6791('0x17')]||0x0)+(_0x5a5726[_0x6791('0x18')]||0x0)+(_0x5a5726[_0x6791('0x19')]||0x0)+(_0x5a5726[_0x6791('0x1a')]||0x0)+(_0x5a5726[_0x6791('0x1b')]||0x0);this[_0x6791('0x17')]=_0x5a5726['countnosuchnumberretry']||0x0;this[_0x6791('0x18')]=_0x5a5726[_0x6791('0x18')]||0x0;this['countabandonedretry']=_0x5a5726[_0x6791('0x19')]||0x0;this[_0x6791('0x1a')]=_0x5a5726['countmachineretry']||0x0;this[_0x6791('0x1b')]=_0x5a5726[_0x6791('0x1b')]||0x0;this[_0x6791('0x1c')]=_0x5a5726[_0x6791('0x1c')];this['callbackuniqueid']=_0x5a5726[_0x6791('0x1d')];this[_0x6791('0x1e')]=_0x5a5726['callbackat'];this['recallme']=_0x5a5726['recallme'];this[_0x6791('0x1f')]=_0x5a5726['ContactId'];this[_0x6791('0x20')]=_0x5a5726['ListId'];this['UserId']=_['isNil'](_0x5a5726[_0x6791('0x9')])?_0x5a5726[_0x6791('0x21')]:_0x5a5726[_0x6791('0x9')]['id'];this['VoiceQueueId']=_0x5a5726[_0x6791('0x22')];this[_0x6791('0x23')]='';this['originatecalleridname']='';}Action[_0x6791('0x24')]['getCaller']=function(){return util[_0x6791('0xc')]('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x6791('0x25')]);};module['exports']=Action; \ No newline at end of file +var _0xdb28=['name','type','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue'];(function(_0x3531ad,_0x338afd){var _0x53c496=function(_0x3477df){while(--_0x3477df){_0x3531ad['push'](_0x3531ad['shift']());}};_0x53c496(++_0x338afd);}(_0xdb28,0x106));var _0x8db2=function(_0x45e8d8,_0x1e0af6){_0x45e8d8=_0x45e8d8-0x0;var _0x46e787=_0xdb28[_0x45e8d8];return _0x46e787;};'use strict';var util=require(_0x8db2('0x0'));var _=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));function checkNameSurname(_0xf66e59,_0x585da1,_0x1f4c45){var _0x11c26d='';if(!_[_0x8db2('0x3')](_0x585da1)&&_0x8db2('0x4')===typeof _0x585da1){_0x11c26d+=_0x585da1;}if(!_[_0x8db2('0x3')](_0x1f4c45)&&'string'===typeof _0x1f4c45){_0x11c26d+='\x20'+_0x1f4c45;}if(_0x11c26d!==''){return _0x11c26d;}return _0xf66e59;}function Action(_0x21a03e,_0x1d2dd3,_0x5f42ee,_0x494b40,_0x477f50){this[_0x8db2('0x5')]=_0x5f42ee||undefined;this[_0x8db2('0x6')]=_0x21a03e['id'];this[_0x8db2('0x7')]=_0x1d2dd3[_0x8db2('0x8')];this[_0x8db2('0x9')]=_0x1d2dd3[_0x8db2('0x9')];this['campaigntype']=_0x8db2('0x7');this[_0x8db2('0xa')]=![];this[_0x8db2('0xb')]=_['isNil'](_0x21a03e[_0x8db2('0xc')])?undefined:_0x21a03e[_0x8db2('0xc')]['name'];this[_0x8db2('0xd')]=this[_0x8db2('0xb')]?util[_0x8db2('0xe')](_0x8db2('0xf'),this[_0x8db2('0xb')]):_0x494b40||undefined;this['calleridname']=checkNameSurname(_0x21a03e['Contact'][_0x8db2('0x10')],_0x21a03e[_0x8db2('0x11')][_0x8db2('0x12')],_0x21a03e[_0x8db2('0x11')][_0x8db2('0x13')]);this[_0x8db2('0x14')]=_0x21a03e[_0x8db2('0x14')]||![];this[_0x8db2('0x15')]=_0x21a03e[_0x8db2('0x10')];this[_0x8db2('0x16')]=_0x21a03e['scheduledat'];this[_0x8db2('0x17')]=_0x21a03e[_0x8db2('0x17')]||0x0;this['countcongestionretry']=_0x21a03e[_0x8db2('0x18')]||0x0;this[_0x8db2('0x19')]=_0x21a03e[_0x8db2('0x19')]||0x0;this[_0x8db2('0x1a')]=(_0x21a03e[_0x8db2('0x17')]||0x0)+(_0x21a03e[_0x8db2('0x18')]||0x0)+(_0x21a03e['countnoanswerretry']||0x0)+(_0x21a03e['countnosuchnumberretry']||0x0)+(_0x21a03e[_0x8db2('0x1b')]||0x0)+(_0x21a03e[_0x8db2('0x1c')]||0x0)+(_0x21a03e[_0x8db2('0x1d')]||0x0)+(_0x21a03e[_0x8db2('0x1e')]||0x0);this['countnosuchnumberretry']=_0x21a03e[_0x8db2('0x1f')]||0x0;this[_0x8db2('0x1b')]=_0x21a03e[_0x8db2('0x1b')]||0x0;this[_0x8db2('0x1c')]=_0x21a03e[_0x8db2('0x1c')]||0x0;this['countmachineretry']=_0x21a03e[_0x8db2('0x1d')]||0x0;this[_0x8db2('0x1e')]=_0x21a03e[_0x8db2('0x1e')]||0x0;this[_0x8db2('0x20')]=_0x21a03e[_0x8db2('0x20')];this[_0x8db2('0x21')]=_0x21a03e[_0x8db2('0x21')];this['callbackat']=_0x21a03e[_0x8db2('0x22')];this['recallme']=_0x21a03e['recallme'];this['ContactId']=_0x21a03e['ContactId'];this[_0x8db2('0x23')]=_0x21a03e[_0x8db2('0x23')];this[_0x8db2('0x24')]=_[_0x8db2('0x3')](_0x21a03e[_0x8db2('0xc')])?_0x21a03e[_0x8db2('0x24')]:_0x21a03e['Agent']['id'];this[_0x8db2('0x25')]=_0x21a03e[_0x8db2('0x25')];this[_0x8db2('0x26')]='';this[_0x8db2('0x27')]='';}Action['prototype'][_0x8db2('0x28')]=function(){return util[_0x8db2('0xe')](_0x8db2('0x29'),this[_0x8db2('0x2a')],this[_0x8db2('0x2b')]);};module[_0x8db2('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 752a9c3..230acd9 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(_0x25600d,_0x4e923e){var _0x105e43=function(_0x498236){while(--_0x498236){_0x25600d['push'](_0x25600d['shift']());}};_0x105e43(++_0x4e923e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'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(_0x7976e7,_0xbfc4ed){var _0x1a7c6b=function(_0x19557b){while(--_0x19557b){_0x7976e7['push'](_0x7976e7['shift']());}};_0x1a7c6b(++_0xbfc4ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 3add30a..72b37c7 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 _0xc78d=['context','exten','xcally-motion-preview','assigned','membername','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','error','inspect','createHistory','[createHistory]\x20','resolve','then','catch','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0xc78d,0x16b));var _0xdc78=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc78d[_0x502c7d];return _0x30b7ed;};'use strict';var util=require(_0xdc78('0x0'));var BPromise=require('bluebird');var logger=require(_0xdc78('0x1'))('preview');var cmHopper=require(_0xdc78('0x2'));var cmHopperHistory=require(_0xdc78('0x3'));var cmHopperBlack=require(_0xdc78('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x134faf){return function(_0x3a9652){logger[_0xdc78('0x5')](_0x134faf,util[_0xdc78('0x6')](_0x3a9652,{'showHidden':![],'depth':null}));};}function create(_0x53d2ae){return cmHopperHistory[_0xdc78('0x7')](_0x53d2ae)['catch'](loggerCatch(_0xdc78('0x8')));}function createAgent(_0x590dad){return BPromise[_0xdc78('0x9')]()[_0xdc78('0xa')](agentReportPreview[_0xdc78('0x7')](_0x590dad))[_0xdc78('0xb')](loggerCatch(_0xdc78('0x8')));}function moveContact(_0xcf101f){return cmHopper['moveContactManagedDialer'](_0xcf101f,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xdc78('0xc')]=function(_0x3f0a5c){return cmHopperBlack[_0xdc78('0xc')](_0x3f0a5c)[_0xdc78('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xdc78('0xd')]=function(_0x12ec61){return BPromise['resolve']()['then'](cmHopper[_0xdc78('0xd')](_0x12ec61))['catch'](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x22e60a,_0x34a55e){create(_0x22e60a)[_0xdc78('0xb')](loggerCatch(_0x34a55e));moveContact(_0x22e60a)['catch'](loggerCatch(_0x34a55e));};exports[_0xdc78('0xe')]=function(_0x398dcd,_0x215c4a){createAgent(_0x398dcd)[_0xdc78('0xb')](loggerCatch(_0x215c4a));};exports[_0xdc78('0xf')]=function(_0x4c0b77,_0x3a248d){create(_0x4c0b77)[_0xdc78('0xb')](loggerCatch(_0x3a248d));};exports['createCustomerFinal']=function(_0x59a584,_0xb108a4){moveContact(_0x59a584)[_0xdc78('0xb')](loggerCatch(_0xb108a4));};exports[_0xdc78('0x10')]=function(_0x2b4a6b,_0x67220e,_0x302be9){if(_0x67220e){_0x2b4a6b[_0xdc78('0x11')]=null;}if(_0x302be9){_0x2b4a6b['active']=![];}return cmHopper['rescheduleContact'](_0x2b4a6b)[_0xdc78('0xb')](loggerCatch(_0xdc78('0x12')));};exports[_0xdc78('0x13')]=function(_0x4e8a68){return cmHopper['countReScheduled'](_0x4e8a68)[_0xdc78('0xb')](loggerCatch(_0xdc78('0x14')));};exports['unlockContact']=function(_0x5c8d08){return cmHopper[_0xdc78('0x15')]({'UserId':null},_0x5c8d08,0x1)[_0xdc78('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0xdc78('0x16')]=function(_0x253a09){return cmHopper[_0xdc78('0x15')]({'active':![]},_0x253a09,0x1)['catch'](loggerCatch('[activeContact]\x20'));};exports['crateCustomerReportQueue']=function(_0x32e207){var _0x2a5607={};_0x2a5607[_0xdc78('0x17')]=_0x32e207[_0xdc78('0x17')];_0x2a5607[_0xdc78('0x18')]=_0x32e207[_0xdc78('0x18')];_0x2a5607[_0xdc78('0x19')]=_0x32e207[_0xdc78('0x19')];_0x2a5607['calleridname']=_0x32e207[_0xdc78('0x1a')];_0x2a5607['queue']=_0x32e207['queue'];_0x2a5607[_0xdc78('0x1b')]=_0x32e207[_0xdc78('0x1c')];_0x2a5607[_0xdc78('0x1d')]=_0x32e207[_0xdc78('0x1c')];_0x2a5607[_0xdc78('0x1e')]=0x1;_0x2a5607['queuecallercompleteAt']=_0x32e207[_0xdc78('0x1f')];_0x2a5607[_0xdc78('0x20')]=_0x32e207['membername'];_0x2a5607[_0xdc78('0x21')]='from-sip';_0x2a5607[_0xdc78('0x22')]=_0xdc78('0x23');_0x2a5607['holdtime']=0x0;_0x2a5607[_0xdc78('0x24')]=0x1;_0x2a5607['lastAssignedTo']=_0x32e207[_0xdc78('0x25')];_0x2a5607[_0xdc78('0x26')]=_0xdc78('0x27');return BPromise[_0xdc78('0x9')]()[_0xdc78('0xa')](voiceQueueReport['create'](_0x2a5607))[_0xdc78('0xb')](loggerCatch(_0xdc78('0x28')));};exports[_0xdc78('0x29')]=function(_0x587955,_0x1bf92f){return BPromise[_0xdc78('0x9')]()['then'](cmHopper[_0xdc78('0x29')](_0x587955,_0x1bf92f))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xdc78('0x2a')]=function(_0x58fc06){return cmHopper[_0xdc78('0x10')](_0x58fc06,!![],!![])[_0xdc78('0xb')](loggerCatch(_0xdc78('0x2b')));}; \ No newline at end of file +var _0x58bf=['error','catch','[createHistory]\x20','resolve','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/voiceQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x58bf,0xce));var _0xf58b=function(_0x28951d,_0x28dbcb){_0x28951d=_0x28951d-0x0;var _0x4e8c1e=_0x58bf[_0x28951d];return _0x4e8c1e;};'use strict';var util=require(_0xf58b('0x0'));var BPromise=require(_0xf58b('0x1'));var logger=require('../../../config/logger')(_0xf58b('0x2'));var cmHopper=require(_0xf58b('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xf58b('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xf58b('0x5'));function loggerCatch(_0x1865cb){return function(_0x54300c){logger[_0xf58b('0x6')](_0x1865cb,util['inspect'](_0x54300c,{'showHidden':![],'depth':null}));};}function create(_0x46087b){return cmHopperHistory['createHistory'](_0x46087b)[_0xf58b('0x7')](loggerCatch(_0xf58b('0x8')));}function createAgent(_0x47b034){return BPromise[_0xf58b('0x9')]()['then'](agentReportPreview[_0xf58b('0xa')](_0x47b034))['catch'](loggerCatch(_0xf58b('0x8')));}function moveContact(_0x232c7c){return cmHopper[_0xf58b('0xb')](_0x232c7c,!![])[_0xf58b('0x7')](loggerCatch(_0xf58b('0xc')));}exports[_0xf58b('0xd')]=function(_0x3c6cb9){return cmHopperBlack[_0xf58b('0xd')](_0x3c6cb9)[_0xf58b('0x7')](loggerCatch(_0xf58b('0xe')));};exports[_0xf58b('0xf')]=function(_0x49c93){return BPromise['resolve']()[_0xf58b('0x10')](cmHopper[_0xf58b('0xf')](_0x49c93))[_0xf58b('0x7')](loggerCatch(_0xf58b('0x11')));};exports['createHistory']=function(_0x452531,_0x360952){create(_0x452531)[_0xf58b('0x7')](loggerCatch(_0x360952));moveContact(_0x452531)['catch'](loggerCatch(_0x360952));};exports[_0xf58b('0x12')]=function(_0xc0a706,_0x43cec9){createAgent(_0xc0a706)[_0xf58b('0x7')](loggerCatch(_0x43cec9));};exports['createCustomerHistory']=function(_0x276eae,_0x1ac875){create(_0x276eae)[_0xf58b('0x7')](loggerCatch(_0x1ac875));};exports[_0xf58b('0x13')]=function(_0x1601df,_0xe04b01){moveContact(_0x1601df)[_0xf58b('0x7')](loggerCatch(_0xe04b01));};exports['rescheduleContact']=function(_0x538d04,_0x586d45,_0x175884){if(_0x586d45){_0x538d04[_0xf58b('0x14')]=null;}if(_0x175884){_0x538d04[_0xf58b('0x15')]=![];}return cmHopper[_0xf58b('0x16')](_0x538d04)[_0xf58b('0x7')](loggerCatch(_0xf58b('0x17')));};exports[_0xf58b('0x18')]=function(_0x114856){return cmHopper[_0xf58b('0x18')](_0x114856)[_0xf58b('0x7')](loggerCatch('[countReScheduled]\x20'));};exports[_0xf58b('0x19')]=function(_0x1e7e4f){return cmHopper['unlockContact']({'UserId':null},_0x1e7e4f,0x1)[_0xf58b('0x7')](loggerCatch(_0xf58b('0x1a')));};exports['disableContact']=function(_0x23517d){return cmHopper[_0xf58b('0x19')]({'active':![]},_0x23517d,0x1)[_0xf58b('0x7')](loggerCatch(_0xf58b('0x1b')));};exports[_0xf58b('0x1c')]=function(_0x177f7c){var _0x4cba3a={};_0x4cba3a[_0xf58b('0x1d')]=_0x177f7c[_0xf58b('0x1d')];_0x4cba3a[_0xf58b('0x1e')]=_0x177f7c[_0xf58b('0x1e')];_0x4cba3a[_0xf58b('0x1f')]=_0x177f7c['calleridnum'];_0x4cba3a[_0xf58b('0x20')]=_0x177f7c[_0xf58b('0x20')];_0x4cba3a[_0xf58b('0x21')]=_0x177f7c[_0xf58b('0x21')];_0x4cba3a[_0xf58b('0x22')]=_0x177f7c['answertime'];_0x4cba3a[_0xf58b('0x23')]=_0x177f7c[_0xf58b('0x24')];_0x4cba3a[_0xf58b('0x25')]=0x1;_0x4cba3a[_0xf58b('0x26')]=_0x177f7c[_0xf58b('0x27')];_0x4cba3a[_0xf58b('0x28')]=_0x177f7c[_0xf58b('0x29')];_0x4cba3a[_0xf58b('0x2a')]=_0xf58b('0x2b');_0x4cba3a['exten']=_0xf58b('0x2c');_0x4cba3a[_0xf58b('0x2d')]=0x0;_0x4cba3a[_0xf58b('0x2e')]=0x1;_0x4cba3a[_0xf58b('0x2f')]=_0x177f7c[_0xf58b('0x29')];_0x4cba3a[_0xf58b('0x30')]=_0xf58b('0x31');return BPromise[_0xf58b('0x9')]()[_0xf58b('0x10')](voiceQueueReport[_0xf58b('0x32')](_0x4cba3a))['catch'](loggerCatch(_0xf58b('0x33')));};exports[_0xf58b('0x34')]=function(_0x42e6d5,_0x10ef81){return BPromise[_0xf58b('0x9')]()[_0xf58b('0x10')](cmHopper[_0xf58b('0x34')](_0x42e6d5,_0x10ef81))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports['rescheduleContactInQueue']=function(_0x58cbcb){return cmHopper[_0xf58b('0x16')](_0x58cbcb,!![],!![])['catch'](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 a2f2814..310820a 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 _0x8906=['YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','endtime','ringtime','UserId','logCustomer','responsetime','talktime','answertime','getSeconds','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','calleridnum','from-sip','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','membername','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x8906,0x184));var _0x6890=function(_0x131cd0,_0x10787e){_0x131cd0=_0x131cd0-0x0;var _0x1fe648=_0x8906[_0x131cd0];return _0x1fe648;};'use strict';var util=require('util');var _=require(_0x6890('0x0'));var moment=require(_0x6890('0x1'));var logger=require(_0x6890('0x2'))('preview');var ipAgi=process['env'][_0x6890('0x3')]||_0x6890('0x4');var utils=require('../../dialer/utils');exports[_0x6890('0x5')]=function(_0x200b3b){return function(_0x4fb953){logger[_0x6890('0x6')](_0x200b3b,util[_0x6890('0x7')](_0x4fb953,{'showHidden':![],'depth':null}));};};exports[_0x6890('0x8')]=function(_0x25b99a,_0x395717){logger[_0x6890('0x9')](_0x25b99a,util['inspect'](_0x395717,{'showHidden':![],'depth':null}));};exports[_0x6890('0xa')]=function(_0x181100,_0x334969){logger[_0x6890('0x6')](_0x181100,util[_0x6890('0x7')](_0x334969,{'showHidden':![],'depth':null}));};exports[_0x6890('0xb')]=function(_0x1d6b74){return function(_0x5ac1e1){logger[_0x6890('0x9')](_0x1d6b74,util[_0x6890('0x7')](_0x5ac1e1,{'showHidden':![],'depth':null}));};};exports[_0x6890('0xc')]=function(_0x29551e,_0x131345,_0x4f3efd){return{'message':_0x29551e,'unlock':_0x131345,'active':_0x4f3efd};};exports[_0x6890('0xd')]=function(_0x2e6ada,_0x3bae4f,_0x4a6332){if(!_[_0x6890('0xe')](_0x4a6332)&&_0x6890('0xf')===typeof _0x4a6332&&!_[_0x6890('0x10')](_0x4a6332)){if(!_[_0x6890('0xe')](_0x3bae4f)&&_0x6890('0xf')===typeof _0x3bae4f&&!_[_0x6890('0x10')](_0x3bae4f)){return util[_0x6890('0x11')](_0x6890('0x12'),_0x3bae4f,_0x4a6332);}return util[_0x6890('0x11')](_0x6890('0x12'),_0x4a6332,_0x4a6332);}if(!_[_0x6890('0xe')](_0x2e6ada)&&'string'===typeof _0x2e6ada&&!_['isEmpty'](_0x2e6ada)){return _0x2e6ada;}return _0x6890('0x13');};exports[_0x6890('0x14')]=function(_0x50f74c){if(_['isNil'](_0x50f74c)){return![];}return _0x50f74c;};exports[_0x6890('0x15')]=function(_0x575401,_0x417a31,_0x5b24a6,_0x297d69,_0x68007b,_0xf89b4b){var _0x581d69={'XMD-QUEUE':_0x417a31['Queue']?_0x417a31['Queue']['name']:'','XMD-CALLERID':_0x297d69,'XMD-CALLERID-PREVIEW':_0xf89b4b?util[_0x6890('0x11')](_0x6890('0x12'),_0xf89b4b['calleridname'],_0xf89b4b['calleridnum']):_0x297d69,'XMD-DIALID':_0x68007b,'XMD-CONTACTID':_0x417a31[_0x6890('0x16')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x297d69,'XMD-VOICEQUEUEID':_0x417a31[_0x6890('0x17')],'XMD-DIALCHANNEL':_0x5b24a6,'XMD-DIALTIMEOUT':_0x575401[_0x6890('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x6890('0x11')](_0x6890('0x19'),_0x575401['dialQueueProject2']?'g':'',_[_0x6890('0x10')](_0x575401[_0x6890('0x1a')])?'':_0x6890('0x1b')),'XMD-DIALURL':_0x575401[_0x6890('0x1c')]||'','XMD-AGI':_0x575401[_0x6890('0x1d')]?util['format'](_0x6890('0x1e'),ipAgi,_0x575401[_0x6890('0x1d')]):_0x6890('0x1f'),'XMD-AGIAFTER':_0x575401['dialQueueProject2']?util['format'](_0x6890('0x1e'),ipAgi,_0x575401['dialQueueProject2']):_0x6890('0x1f'),'XMD-ORIGINATECALLERIDNUM':_0xf89b4b?_0xf89b4b['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0xf89b4b?_0xf89b4b['originatecalleridname']:'','XMD-DESTINATION':_0x6890('0x20'),'SIPADDHEADER':_0x6890('0x21')};if(!_['isEmpty'](_0x575401[_0x6890('0x1a')])){_0x581d69[util[_0x6890('0x11')]('%s',_0x6890('0x22'))]=_0x575401[_0x6890('0x1a')];_0x581d69[util[_0x6890('0x11')]('%s',_0x6890('0x23'))]=_0x68007b;}return _0x581d69;};exports[_0x6890('0x24')]=function(_0x1750c3){var _0x55c7a2={};for(var _0x23a75a in _0x1750c3){if(_0x1750c3[_0x6890('0x25')](_0x23a75a)){_0x55c7a2[util[_0x6890('0x11')]('%s',_['toLower'](_0x23a75a))]=_0x1750c3[_0x23a75a];}}return{'variables':_0x55c7a2};};exports[_0x6890('0x26')]=function(_0x5d1516,_0x4bb229){if(!_[_0x6890('0x27')](_0x5d1516)){if(_0x5d1516['hasOwnProperty'](_0x6890('0x28'))){if(_0x5d1516[_0x6890('0x28')]>0x0){_0x5d1516[_0x6890('0x28')]-=0x1;}else{logger[_0x6890('0x6')](_0x6890('0x29'),_0x4bb229);}}}else{logger[_0x6890('0x6')](_0x6890('0x2a'),_0x4bb229);}};exports[_0x6890('0x2b')]=function(_0x2707dc){var _0x3e80c8=moment()[_0x6890('0x11')](_0x6890('0x2c'));_0x2707dc[_0x6890('0x2d')]=0xd;_0x2707dc[_0x6890('0x2e')]='Blacklist';_0x2707dc[_0x6890('0x2f')]=_0x3e80c8;_0x2707dc['responsetime']=_0x3e80c8;_0x2707dc[_0x6890('0x30')]=_0x3e80c8;};exports['logAgent']=function(_0x2207bf,_0x496337,_0x209400){var _0x3b14e9=moment()[_0x6890('0x11')](_0x6890('0x2c'));_0x2207bf[_0x6890('0x2d')]=_0x496337;_0x2207bf[_0x6890('0x2e')]=_0x209400;_0x2207bf['responsetime']=_0x3b14e9;_0x2207bf[_0x6890('0x31')]=utils['getSeconds'](_0x2207bf['responsetime'],_0x2207bf[_0x6890('0x2f')]);};exports['logLookAgent']=function(_0x462596,_0x4e1a83,_0x23746a){_0x462596['membername']=_0x4e1a83;_0x462596[_0x6890('0x32')]=_0x23746a;};exports[_0x6890('0x33')]=function(_0x44c8a1,_0x1045e4,_0xced4ea){var _0x568aca=moment()[_0x6890('0x11')](_0x6890('0x2c'));_0x44c8a1[_0x6890('0x2d')]=_0x1045e4;_0x44c8a1[_0x6890('0x2e')]=_0xced4ea;_0x44c8a1[_0x6890('0x34')]=_0x44c8a1[_0x6890('0x34')]?_0x44c8a1[_0x6890('0x34')]:_0x568aca;_0x44c8a1['endtime']=_0x44c8a1['endtime']?_0x44c8a1['endtime']:_0x568aca;_0x44c8a1['ringtime']=utils['getSeconds'](_0x44c8a1[_0x6890('0x34')]||0x0,_0x44c8a1[_0x6890('0x2f')]||0x0);_0x44c8a1[_0x6890('0x35')]=_0x44c8a1[_0x6890('0x36')]?utils[_0x6890('0x37')](_0x44c8a1[_0x6890('0x30')],_0x44c8a1[_0x6890('0x36')]):0x0;};exports[_0x6890('0x38')]=function(_0x5c216f){return _0x5c216f===_0x6890('0x39');};exports[_0x6890('0x3a')]=function(_0xe5c875,_0x4fd6ec,_0x11b8db,_0x40fdc4,_0x1897d5){var _0x28d73b=_0x40fdc4?_0x6890('0x3b'):_0xe5c875[_0x6890('0x3c')];_0x28d73b=_0x1897d5?'BOOKED':_0x28d73b;return{'actionid':_0xe5c875[_0x6890('0x3d')],'action':_0x6890('0x3e'),'channel':_0xe5c875[_0x6890('0x3f')],'callerid':util[_0x6890('0x11')]('\x22%s\x22\x20<%s>',_0x28d73b,_0xe5c875[_0x6890('0x40')]),'Exten':_0x6890('0x20'),'Context':_0x6890('0x41'),'Priority':'1','variable':_0x11b8db,'timeout':(_0x4fd6ec['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0xe5c875[_0x6890('0x3d')]};};exports['totalGlobal']=function(_0x3f684d){return _0x3f684d['countbusyretry']+_0x3f684d[_0x6890('0x42')]+_0x3f684d['countnoanswerretry']+_0x3f684d[_0x6890('0x43')]+_0x3f684d[_0x6890('0x44')];};exports[_0x6890('0x45')]=function(_0x591838){var _0x56bc01=_['clone'](_0x591838);_0x56bc01[_0x6890('0x2d')]=0xf;_0x56bc01['statedesc']=_0x6890('0x46');return _0x56bc01;};exports[_0x6890('0x47')]=function(_0x4f0e34,_0x151fc2,_0x178aee){var _0x21407e={};_0x21407e[_0x151fc2]=_0x4f0e34[_0x151fc2];_0x21407e[_0x6890('0x48')]=![];_0x21407e[_0x6890('0x49')]=moment()[_0x6890('0x4a')](_0x178aee,_0x6890('0x4b'))[_0x6890('0x11')](_0x6890('0x2c'));_0x21407e[_0x6890('0x16')]=_0x4f0e34[_0x6890('0x16')];_0x21407e[_0x6890('0x4c')]=_0x4f0e34['ListId'];_0x21407e[_0x6890('0x17')]=_0x4f0e34[_0x6890('0x17')]||undefined;return _0x21407e;};exports[_0x6890('0x4d')]=function(_0x2b463b,_0x3414ce){if(!_[_0x6890('0x27')](_0x2b463b)){if(_0x2b463b[_0x6890('0x4e')]>0x0){_0x2b463b['pTalking']-=0x1;}else{logger[_0x6890('0x6')](_0x3414ce,_0x6890('0x4f'));}}else{logger[_0x6890('0x6')](_0x3414ce,_0x6890('0x50'));}};exports[_0x6890('0x51')]=function(_0x399772){if(_0x399772<=0x0){return!![];}return![];};function buildObj(_0x1d530f,_0x26c8b3,_0x23a188){_0x1d530f[_0x6890('0x52')]=_0x26c8b3;_0x1d530f[_0x6890('0x53')]=_0x1d530f[_0x6890('0x54')];_0x1d530f[_0x6890('0x55')]=_0x1d530f[_0x6890('0x3f')];_0x1d530f['motionChannel']='voice';if(_0x23a188){_0x1d530f[_0x6890('0x56')]=_0x23a188[_0x6890('0x56')];}return _0x1d530f;}exports[_0x6890('0x57')]=buildObj;exports[_0x6890('0x58')]=function(_0x3dd8d5){var _0x155db0=[];for(var _0x194451 in _0x3dd8d5){if(_0x3dd8d5[_0x6890('0x25')](_0x194451)){if(!_[_0x6890('0x27')](_0x3dd8d5[_0x194451])&&_0x3dd8d5[_0x194451]['state']===_0x6890('0x59')&&_0x3dd8d5[_0x194451][_0x6890('0x5a')]==='reachable'){_0x155db0[_0x6890('0x5b')](_0x3dd8d5[_0x194451]['id']);}}}return _0x155db0;};exports[_0x6890('0x5c')]=function(_0x4574f6){var _0x127bbd=moment()[_0x6890('0x5d')](0x0);var _0x441b0d=moment(_0x4574f6)[_0x6890('0x5d')](0x0);return _0x127bbd[_0x6890('0x5e')](_0x441b0d,'seconds');};exports[_0x6890('0x5f')]=function(_0x538de3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x538de3[_0x6890('0x16')],'ListId':_0x538de3[_0x6890('0x4c')],'VoiceQueueId':_0x538de3['VoiceQueueId']||undefined,'CampaignId':_0x538de3[_0x6890('0x60')]||undefined};};exports[_0x6890('0x61')]=function(_0x248cce){if(_0x248cce===_0x6890('0x3d')||_0x248cce===_0x6890('0x62')||_0x248cce==='queue'||_0x248cce===_0x6890('0x63')||_0x248cce===_0x6890('0x64')||_0x248cce===_0x6890('0x65')||_0x248cce===_0x6890('0x66')||_0x248cce==='channelAgent'||_0x248cce===_0x6890('0x3c')||_0x248cce==='active'||_0x248cce==='calleridnum'||_0x248cce===_0x6890('0x49')||_0x248cce===_0x6890('0x67')||_0x248cce===_0x6890('0x42')||_0x248cce===_0x6890('0x68')||_0x248cce===_0x6890('0x69')||_0x248cce===_0x6890('0x6a')||_0x248cce===_0x6890('0x6b')||_0x248cce===_0x6890('0x6c')||_0x248cce===_0x6890('0x6d')||_0x248cce===_0x6890('0x16')||_0x248cce===_0x6890('0x4c')||_0x248cce==='UserId'||_0x248cce==='VoiceQueueId'||_0x248cce===_0x6890('0x6e')||_0x248cce==='xmd-voicequeueid'||_0x248cce===_0x6890('0x6f')||_0x248cce==='xmd-phone'||_0x248cce===_0x6890('0x70')||_0x248cce===_0x6890('0x71')||_0x248cce===_0x6890('0x72')||_0x248cce===_0x6890('0x73')||_0x248cce===_0x6890('0x74')||_0x248cce===_0x6890('0x75')||_0x248cce===_0x6890('0x76')||_0x248cce===_0x6890('0x77')||_0x248cce==='xmd-callerid'||_0x248cce===_0x6890('0x78')||_0x248cce===_0x6890('0x79')||_0x248cce===_0x6890('0x7a')||_0x248cce===_0x6890('0x7b')||_0x248cce===_0x6890('0x7c')||_0x248cce===_0x6890('0x7d')||_0x248cce===_0x6890('0x7e')||_0x248cce===_0x6890('0x7f')||_0x248cce===_0x6890('0x80')||_0x248cce===_0x6890('0x81')||_0x248cce===_0x6890('0x7a')||_0x248cce===_0x6890('0x7b')||_0x248cce===_0x6890('0x7c')||_0x248cce===_0x6890('0x7d')||_0x248cce==='rtpaudioqosloss'||_0x248cce===_0x6890('0x7f')||_0x248cce===_0x6890('0x80')||_0x248cce===_0x6890('0x81')||_0x248cce===_0x6890('0x82')||_0x248cce===_0x6890('0x83')||_0x248cce===_0x6890('0x2d')||_0x248cce===_0x6890('0x2e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1adf51,_0x86e47a){var _0x2ea142,_0x48601f,_0x3f0ee0;if(_0x86e47a<=0x0){_0x86e47a=0x1;}_0x2ea142=new RegExp(_0x6890('0x84')+_0x86e47a+'}$');_0x48601f=Math[_0x6890('0x85')](0xa,_0x86e47a-0x1);_0x3f0ee0=Math[_0x6890('0x85')](0xa,_0x86e47a)-0x1;return util[_0x6890('0x11')]('%s',_[_0x6890('0x86')](_0x1adf51,_0x2ea142,_[_0x6890('0x87')](_0x48601f,_0x3f0ee0)));};exports[_0x6890('0x88')]=function(_0x1b2bb0){var _0x32fe59=_0x1b2bb0[_0x6890('0x89')](/"(.*?)"/);return _0x32fe59?_0x32fe59[0x1]:_0x1b2bb0;};exports[_0x6890('0x8a')]=function(_0x31b092){var _0x3d7c00=_0x31b092[_0x6890('0x89')](/<(.*?)>/);return _0x3d7c00?_0x3d7c00[0x1]:_0x31b092;};function buildNoAnswerEventPayload(_0x29dcbb,_0x4d7a9a){var _0x5edb24=buildObj(_0x29dcbb,_0x6890('0x8b'));if(!_[_0x6890('0x10')](_0x4d7a9a[_0x6890('0x8c')])){Object[_0x6890('0x8d')](_0x4d7a9a[_0x6890('0x8c')])[_0x6890('0x8e')](function(_0x1b2aee){_0x5edb24[_0x1b2aee[_0x6890('0x8f')]()]=_0x4d7a9a[_0x6890('0x8c')][_0x1b2aee];});}return _0x5edb24;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xa13f=['membername','logCustomer','talktime','answertime','Failure','variablesAction','uniqueid','originate','xcally-motion-preview','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','clone','active','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','not_inuse','status','reachable','push','getDiff','diff','seconds','CampaignId','filterKey','idContact','campaigntype','dialAnswer','channelAgent','calleridname','scheduledat','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','keys','variables','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','toLowerVariables','updateOriginated','hasOwnProperty','originated','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','getSeconds','logLookAgent'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa13f,0x15f));var _0xfa13=function(_0xc4b27a,_0x373416){_0xc4b27a=_0xc4b27a-0x0;var _0x3d53b3=_0xa13f[_0xc4b27a];return _0x3d53b3;};'use strict';var util=require(_0xfa13('0x0'));var _=require(_0xfa13('0x1'));var moment=require(_0xfa13('0x2'));var logger=require(_0xfa13('0x3'))(_0xfa13('0x4'));var ipAgi=process[_0xfa13('0x5')][_0xfa13('0x6')]||_0xfa13('0x7');var utils=require(_0xfa13('0x8'));exports[_0xfa13('0x9')]=function(_0x43b8d4){return function(_0x2831e3){logger[_0xfa13('0xa')](_0x43b8d4,util[_0xfa13('0xb')](_0x2831e3,{'showHidden':![],'depth':null}));};};exports[_0xfa13('0xc')]=function(_0x4abef9,_0x10226e){logger[_0xfa13('0xd')](_0x4abef9,util[_0xfa13('0xb')](_0x10226e,{'showHidden':![],'depth':null}));};exports[_0xfa13('0xe')]=function(_0x3908db,_0x3dd29a){logger[_0xfa13('0xa')](_0x3908db,util[_0xfa13('0xb')](_0x3dd29a,{'showHidden':![],'depth':null}));};exports[_0xfa13('0xf')]=function(_0x458d09){return function(_0x4f76fa){logger['info'](_0x458d09,util[_0xfa13('0xb')](_0x4f76fa,{'showHidden':![],'depth':null}));};};exports[_0xfa13('0x10')]=function(_0x5a019a,_0x282a7c,_0x33acce){return{'message':_0x5a019a,'unlock':_0x282a7c,'active':_0x33acce};};exports[_0xfa13('0x11')]=function(_0x4c0ca7,_0x327b98,_0x1aa000){if(!_['isUndefined'](_0x1aa000)&&'string'===typeof _0x1aa000&&!_[_0xfa13('0x12')](_0x1aa000)){if(!_[_0xfa13('0x13')](_0x327b98)&&_0xfa13('0x14')===typeof _0x327b98&&!_[_0xfa13('0x12')](_0x327b98)){return util[_0xfa13('0x15')](_0xfa13('0x16'),_0x327b98,_0x1aa000);}return util[_0xfa13('0x15')]('\x22%s\x22\x20<%s>',_0x1aa000,_0x1aa000);}if(!_[_0xfa13('0x13')](_0x4c0ca7)&&_0xfa13('0x14')===typeof _0x4c0ca7&&!_[_0xfa13('0x12')](_0x4c0ca7)){return _0x4c0ca7;}return _0xfa13('0x17');};exports[_0xfa13('0x18')]=function(_0x1e430c){if(_[_0xfa13('0x19')](_0x1e430c)){return![];}return _0x1e430c;};exports[_0xfa13('0x1a')]=function(_0x129f2b,_0x28687d,_0x48b9f1,_0x288d10,_0x171e16,_0x59a3dc){var _0x5691e3={'XMD-QUEUE':_0x28687d[_0xfa13('0x1b')]?_0x28687d['Queue'][_0xfa13('0x1c')]:'','XMD-CALLERID':_0x288d10,'XMD-CALLERID-PREVIEW':_0x59a3dc?util[_0xfa13('0x15')](_0xfa13('0x16'),_0x59a3dc['calleridname'],_0x59a3dc[_0xfa13('0x1d')]):_0x288d10,'XMD-DIALID':_0x171e16,'XMD-CONTACTID':_0x28687d[_0xfa13('0x1e')],'XMD-CDRTYPE':_0xfa13('0x1f'),'CALLERID(all)':_0x288d10,'XMD-VOICEQUEUEID':_0x28687d[_0xfa13('0x20')],'XMD-DIALCHANNEL':_0x48b9f1,'XMD-DIALTIMEOUT':_0x129f2b[_0xfa13('0x21')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xfa13('0x22'),_0x129f2b[_0xfa13('0x23')]?'g':'',_[_0xfa13('0x12')](_0x129f2b[_0xfa13('0x24')])?'':_0xfa13('0x25')),'XMD-DIALURL':_0x129f2b[_0xfa13('0x26')]||'','XMD-AGI':_0x129f2b[_0xfa13('0x27')]?util[_0xfa13('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x129f2b['dialQueueProject']):_0xfa13('0x28'),'XMD-AGIAFTER':_0x129f2b[_0xfa13('0x23')]?util[_0xfa13('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x129f2b[_0xfa13('0x23')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x59a3dc?_0x59a3dc['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x59a3dc?_0x59a3dc[_0xfa13('0x29')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xfa13('0x2a')};if(!_[_0xfa13('0x12')](_0x129f2b[_0xfa13('0x24')])){_0x5691e3[util['format']('%s',_0xfa13('0x2b'))]=_0x129f2b[_0xfa13('0x24')];_0x5691e3[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x171e16;}return _0x5691e3;};exports[_0xfa13('0x2c')]=function(_0xf905){var _0x7c4dcd={};for(var _0x44a836 in _0xf905){if(_0xf905['hasOwnProperty'](_0x44a836)){_0x7c4dcd[util['format']('%s',_['toLower'](_0x44a836))]=_0xf905[_0x44a836];}}return{'variables':_0x7c4dcd};};exports[_0xfa13('0x2d')]=function(_0x2d2b38,_0x3552cb){if(!_[_0xfa13('0x19')](_0x2d2b38)){if(_0x2d2b38[_0xfa13('0x2e')]('originated')){if(_0x2d2b38['originated']>0x0){_0x2d2b38[_0xfa13('0x2f')]-=0x1;}else{logger[_0xfa13('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3552cb);}}}else{logger[_0xfa13('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x3552cb);}};exports['logBlacklist']=function(_0xf1056f){var _0x5e80e7=moment()[_0xfa13('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0xf1056f['state']=0xd;_0xf1056f['statedesc']='Blacklist';_0xf1056f[_0xfa13('0x30')]=_0x5e80e7;_0xf1056f[_0xfa13('0x31')]=_0x5e80e7;_0xf1056f[_0xfa13('0x32')]=_0x5e80e7;};exports['logAgent']=function(_0x1eec17,_0x14c836,_0x41cd2e){var _0x2e3d9a=moment()[_0xfa13('0x15')](_0xfa13('0x33'));_0x1eec17[_0xfa13('0x34')]=_0x14c836;_0x1eec17[_0xfa13('0x35')]=_0x41cd2e;_0x1eec17[_0xfa13('0x31')]=_0x2e3d9a;_0x1eec17[_0xfa13('0x36')]=utils[_0xfa13('0x37')](_0x1eec17[_0xfa13('0x31')],_0x1eec17[_0xfa13('0x30')]);};exports[_0xfa13('0x38')]=function(_0x56891c,_0x3e51ef,_0x26f56f){_0x56891c[_0xfa13('0x39')]=_0x3e51ef;_0x56891c['UserId']=_0x26f56f;};exports[_0xfa13('0x3a')]=function(_0x37621a,_0x3b3e81,_0x4a61a3){var _0x3d98ed=moment()[_0xfa13('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x37621a[_0xfa13('0x34')]=_0x3b3e81;_0x37621a[_0xfa13('0x35')]=_0x4a61a3;_0x37621a[_0xfa13('0x31')]=_0x37621a['responsetime']?_0x37621a[_0xfa13('0x31')]:_0x3d98ed;_0x37621a[_0xfa13('0x32')]=_0x37621a[_0xfa13('0x32')]?_0x37621a['endtime']:_0x3d98ed;_0x37621a[_0xfa13('0x36')]=utils[_0xfa13('0x37')](_0x37621a['responsetime']||0x0,_0x37621a[_0xfa13('0x30')]||0x0);_0x37621a[_0xfa13('0x3b')]=_0x37621a[_0xfa13('0x3c')]?utils['getSeconds'](_0x37621a[_0xfa13('0x32')],_0x37621a[_0xfa13('0x3c')]):0x0;};exports['isFailure']=function(_0x49e450){return _0x49e450===_0xfa13('0x3d');};exports[_0xfa13('0x3e')]=function(_0x1a4e38,_0x2fc200,_0x383dfe,_0x441bfd,_0x406539){var _0x343cbe=_0x441bfd?'RECALL':_0x1a4e38['calleridname'];_0x343cbe=_0x406539?'BOOKED':_0x343cbe;return{'actionid':_0x1a4e38[_0xfa13('0x3f')],'action':_0xfa13('0x40'),'channel':_0x1a4e38['channelAgent'],'callerid':util[_0xfa13('0x15')]('\x22%s\x22\x20<%s>',_0x343cbe,_0x1a4e38[_0xfa13('0x1d')]),'Exten':_0xfa13('0x41'),'Context':_0xfa13('0x42'),'Priority':'1','variable':_0x383dfe,'timeout':(_0x2fc200[_0xfa13('0x43')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1a4e38[_0xfa13('0x3f')]};};exports['totalGlobal']=function(_0x3ff608){return _0x3ff608[_0xfa13('0x44')]+_0x3ff608[_0xfa13('0x45')]+_0x3ff608[_0xfa13('0x46')]+_0x3ff608['countagentrejectretry']+_0x3ff608['countnosuchnumberretry'];};exports['cloneAction']=function(_0x39082f){var _0x49b806=_[_0xfa13('0x47')](_0x39082f);_0x49b806[_0xfa13('0x34')]=0xf;_0x49b806[_0xfa13('0x35')]='Global';return _0x49b806;};exports['scheduledAt']=function(_0x13e6b8,_0x48ec05,_0x2ad0db){var _0x47806d={};_0x47806d[_0x48ec05]=_0x13e6b8[_0x48ec05];_0x47806d[_0xfa13('0x48')]=![];_0x47806d['scheduledat']=moment()[_0xfa13('0x49')](_0x2ad0db,'minutes')[_0xfa13('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x47806d[_0xfa13('0x1e')]=_0x13e6b8['ContactId'];_0x47806d[_0xfa13('0x4a')]=_0x13e6b8[_0xfa13('0x4a')];_0x47806d[_0xfa13('0x20')]=_0x13e6b8[_0xfa13('0x20')]||undefined;return _0x47806d;};exports['decrementTalkink']=function(_0x1ba19d,_0x723792){if(!_[_0xfa13('0x19')](_0x1ba19d)){if(_0x1ba19d[_0xfa13('0x4b')]>0x0){_0x1ba19d[_0xfa13('0x4b')]-=0x1;}else{logger[_0xfa13('0xa')](_0x723792,_0xfa13('0x4c'));}}else{logger[_0xfa13('0xa')](_0x723792,_0xfa13('0x4d'));}};exports[_0xfa13('0x4e')]=function(_0x16b48b){if(_0x16b48b<=0x0){return!![];}return![];};function buildObj(_0x287a21,_0x326c03,_0x531535){_0x287a21[_0xfa13('0x4f')]=_0x326c03;_0x287a21[_0xfa13('0x1c')]=_0x287a21[_0xfa13('0x50')];_0x287a21[_0xfa13('0x51')]=_0x287a21['channelAgent'];_0x287a21['motionChannel']=_0xfa13('0x52');if(_0x531535){_0x287a21[_0xfa13('0x53')]=_0x531535['mandatoryDisposition'];}return _0x287a21;}exports[_0xfa13('0x54')]=buildObj;exports[_0xfa13('0x55')]=function(_0x5969ae){var _0x46f5b6=[];for(var _0x3ee005 in _0x5969ae){if(_0x5969ae[_0xfa13('0x2e')](_0x3ee005)){if(!_['isNil'](_0x5969ae[_0x3ee005])&&_0x5969ae[_0x3ee005][_0xfa13('0x34')]===_0xfa13('0x56')&&_0x5969ae[_0x3ee005][_0xfa13('0x57')]===_0xfa13('0x58')){_0x46f5b6[_0xfa13('0x59')](_0x5969ae[_0x3ee005]['id']);}}}return _0x46f5b6;};exports[_0xfa13('0x5a')]=function(_0x3a06dd){var _0x1a9a7b=moment()['milliseconds'](0x0);var _0x39a545=moment(_0x3a06dd)['milliseconds'](0x0);return _0x1a9a7b[_0xfa13('0x5b')](_0x39a545,_0xfa13('0x5c'));};exports['createBody']=function(_0x3aed53){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3aed53[_0xfa13('0x1e')],'ListId':_0x3aed53[_0xfa13('0x4a')],'VoiceQueueId':_0x3aed53['VoiceQueueId']||undefined,'CampaignId':_0x3aed53[_0xfa13('0x5d')]||undefined};};exports[_0xfa13('0x5e')]=function(_0x3d9df8){if(_0x3d9df8===_0xfa13('0x3f')||_0x3d9df8===_0xfa13('0x5f')||_0x3d9df8===_0xfa13('0x50')||_0x3d9df8==='type'||_0x3d9df8===_0xfa13('0x60')||_0x3d9df8===_0xfa13('0x61')||_0x3d9df8===_0xfa13('0x39')||_0x3d9df8===_0xfa13('0x62')||_0x3d9df8===_0xfa13('0x63')||_0x3d9df8===_0xfa13('0x48')||_0x3d9df8==='calleridnum'||_0x3d9df8===_0xfa13('0x64')||_0x3d9df8===_0xfa13('0x44')||_0x3d9df8===_0xfa13('0x45')||_0x3d9df8===_0xfa13('0x46')||_0x3d9df8===_0xfa13('0x65')||_0x3d9df8===_0xfa13('0x66')||_0x3d9df8===_0xfa13('0x67')||_0x3d9df8===_0xfa13('0x68')||_0x3d9df8==='recallme'||_0x3d9df8==='ContactId'||_0x3d9df8==='ListId'||_0x3d9df8==='UserId'||_0x3d9df8===_0xfa13('0x20')||_0x3d9df8===_0xfa13('0x69')||_0x3d9df8===_0xfa13('0x6a')||_0x3d9df8===_0xfa13('0x6b')||_0x3d9df8==='xmd-phone'||_0x3d9df8===_0xfa13('0x6c')||_0x3d9df8==='xmd-dialurl'||_0x3d9df8===_0xfa13('0x6d')||_0x3d9df8==='xmd-dialoptions'||_0x3d9df8===_0xfa13('0x6e')||_0x3d9df8===_0xfa13('0x6f')||_0x3d9df8===_0xfa13('0x70')||_0x3d9df8===_0xfa13('0x71')||_0x3d9df8===_0xfa13('0x72')||_0x3d9df8===_0xfa13('0x73')||_0x3d9df8===_0xfa13('0x74')||_0x3d9df8===_0xfa13('0x75')||_0x3d9df8==='rtpaudioqosbridged'||_0x3d9df8===_0xfa13('0x76')||_0x3d9df8==='rtpaudioqosjitterbridged'||_0x3d9df8===_0xfa13('0x77')||_0x3d9df8===_0xfa13('0x78')||_0x3d9df8===_0xfa13('0x79')||_0x3d9df8===_0xfa13('0x7a')||_0x3d9df8===_0xfa13('0x75')||_0x3d9df8===_0xfa13('0x7b')||_0x3d9df8===_0xfa13('0x76')||_0x3d9df8==='rtpaudioqosjitterbridged'||_0x3d9df8===_0xfa13('0x77')||_0x3d9df8===_0xfa13('0x78')||_0x3d9df8===_0xfa13('0x79')||_0x3d9df8===_0xfa13('0x7a')||_0x3d9df8===_0xfa13('0x7c')||_0x3d9df8===_0xfa13('0x7d')||_0x3d9df8===_0xfa13('0x34')||_0x3d9df8==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2c41f1,_0x4c5b92){var _0x32adb5,_0x235527,_0x13c26b;if(_0x4c5b92<=0x0){_0x4c5b92=0x1;}_0x32adb5=new RegExp(_0xfa13('0x7e')+_0x4c5b92+'}$');_0x235527=Math['pow'](0xa,_0x4c5b92-0x1);_0x13c26b=Math[_0xfa13('0x7f')](0xa,_0x4c5b92)-0x1;return util[_0xfa13('0x15')]('%s',_[_0xfa13('0x80')](_0x2c41f1,_0x32adb5,_[_0xfa13('0x81')](_0x235527,_0x13c26b)));};exports[_0xfa13('0x82')]=function(_0x18b6ff){var _0x56a52d=_0x18b6ff['match'](/"(.*?)"/);return _0x56a52d?_0x56a52d[0x1]:_0x18b6ff;};exports[_0xfa13('0x83')]=function(_0x5358d8){var _0x484e65=_0x5358d8[_0xfa13('0x84')](/<(.*?)>/);return _0x484e65?_0x484e65[0x1]:_0x5358d8;};function buildNoAnswerEventPayload(_0x455d90,_0x28b523){var _0x2fc355=buildObj(_0x455d90,'noanswer');if(!_[_0xfa13('0x12')](_0x28b523['variables'])){Object[_0xfa13('0x85')](_0x28b523[_0xfa13('0x86')])['forEach'](function(_0x586594){_0x2fc355[_0x586594[_0xfa13('0x87')]()]=_0x28b523[_0xfa13('0x86')][_0x586594];});}return _0x2fc355;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d365ecb..e573e77 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 _0x8f85=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x49e883,_0x5866ef){var _0x5b7cfc=function(_0xf654c0){while(--_0xf654c0){_0x49e883['push'](_0x49e883['shift']());}};_0x5b7cfc(++_0x5866ef);}(_0x8f85,0xa6));var _0x58f8=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x8f85[_0x2e4aa2];return _0x5e6092;};'use strict';exports[_0x58f8('0x0')]={'queue':{'type':_0x58f8('0x1'),'required':!![]},'interface':{'type':_0x58f8('0x1'),'required':!![]},'membername':{'type':_0x58f8('0x1'),'required':!![]},'penalty':{'type':_0x58f8('0x2'),'required':![]},'paused':{'type':_0x58f8('0x3'),'required':![]}};exports[_0x58f8('0x4')]={'queue':{'type':_0x58f8('0x1'),'required':!![]},'interface':{'type':_0x58f8('0x1'),'required':!![]}};exports[_0x58f8('0x5')]={'interface':{'type':_0x58f8('0x1'),'required':!![]},'paused':{'type':_0x58f8('0x3')},'reason':{'type':_0x58f8('0x1'),'required':![]}};exports[_0x58f8('0x6')]={'module':{'type':_0x58f8('0x1'),'required':![]}};exports[_0x58f8('0x7')]={'uniqueid':{'type':_0x58f8('0x1'),'required':!![]}};exports[_0x58f8('0x8')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x58f8('0x1')},'format':{'type':_0x58f8('0x1')},'mixmonitorid':{'type':_0x58f8('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x58f8('0x1'),'required':!![]}};exports[_0x58f8('0x9')]={'uniqueid':{'type':_0x58f8('0x1'),'required':!![]},'exten':{'type':_0x58f8('0x1'),'required':!![]},'context':{'type':_0x58f8('0x1')}}; \ No newline at end of file +var _0x3d21=['number','boolean','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x4e06f3,_0x5c35db){var _0x1ed6f1=function(_0x4eda45){while(--_0x4eda45){_0x4e06f3['push'](_0x4e06f3['shift']());}};_0x1ed6f1(++_0x5c35db);}(_0x3d21,0x12a));var _0x13d2=function(_0x2d8f0b,_0x216dae){_0x2d8f0b=_0x2d8f0b-0x0;var _0x39a92b=_0x3d21[_0x2d8f0b];return _0x39a92b;};'use strict';exports[_0x13d2('0x0')]={'queue':{'type':_0x13d2('0x1'),'required':!![]},'interface':{'type':_0x13d2('0x1'),'required':!![]},'membername':{'type':_0x13d2('0x1'),'required':!![]},'penalty':{'type':_0x13d2('0x2'),'required':![]},'paused':{'type':_0x13d2('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x13d2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x13d2('0x4')]={'interface':{'type':_0x13d2('0x1'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x13d2('0x5')]={'module':{'type':_0x13d2('0x1'),'required':![]}};exports[_0x13d2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x13d2('0x7')]={'uniqueid':{'type':_0x13d2('0x1'),'required':!![]},'filename':{'type':_0x13d2('0x1')},'format':{'type':_0x13d2('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x13d2('0x8')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x13d2('0x9')]={'uniqueid':{'type':_0x13d2('0x1'),'required':!![]},'exten':{'type':_0x13d2('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index ea8f6c8..fa426f4 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 _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x1e7555,_0x5689e1){var _0x26755d=function(_0x5e35b6){while(--_0x5e35b6){_0x1e7555['push'](_0x1e7555['shift']());}};_0x26755d(++_0x5689e1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x14e8e5,_0x2be694){_0x14e8e5=_0x14e8e5-0x0;var _0x344a5b=_0x5f2f[_0x14e8e5];return _0x344a5b;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=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(_0x47d2d1,_0x881aa2){var _0x252589=function(_0x1a80c2){while(--_0x1a80c2){_0x47d2d1['push'](_0x47d2d1['shift']());}};_0x252589(++_0x881aa2);}(_0xb10b,0x12a));var _0xbb10=function(_0x97de28,_0x243e31){_0x97de28=_0x97de28-0x0;var _0x17cd18=_0xb10b[_0x97de28];return _0x17cd18;};'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 b719a11..b87236a 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 _0x4c2b=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x103fe2,_0x55dd47){var _0xf67b45=function(_0x376fd2){while(--_0x376fd2){_0x103fe2['push'](_0x103fe2['shift']());}};_0xf67b45(++_0x55dd47);}(_0x4c2b,0x169));var _0xb4c2=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x4c2b[_0x26bf51];return _0x503415;};'use strict';function mergeDBDataToRealtime(_0x29d3d0,_0xa742a9){var _0x4aa10c=Object[_0xb4c2('0x0')]({},_0x29d3d0);for(var _0x15a64a in _0xa742a9){if(_0x4aa10c[_0xb4c2('0x1')](_0x15a64a)){_0x4aa10c[_0x15a64a]=_0xa742a9[_0x15a64a];}}return _0x4aa10c;}exports[_0xb4c2('0x2')]=mergeDBDataToRealtime; \ No newline at end of file +var _0x8494=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0xe411d5,_0x18d3e6){var _0x4ee3f2=function(_0x493ef){while(--_0x493ef){_0xe411d5['push'](_0xe411d5['shift']());}};_0x4ee3f2(++_0x18d3e6);}(_0x8494,0x18c));var _0x4849=function(_0x397ec6,_0x50f7f1){_0x397ec6=_0x397ec6-0x0;var _0x1b0c69=_0x8494[_0x397ec6];return _0x1b0c69;};'use strict';function mergeDBDataToRealtime(_0x18a3c8,_0x2e7c0c){var _0x9a5dc2=Object[_0x4849('0x0')]({},_0x18a3c8);for(var _0x46602d in _0x2e7c0c){if(_0x9a5dc2[_0x4849('0x1')](_0x46602d)){_0x9a5dc2[_0x46602d]=_0x2e7c0c[_0x46602d];}}return _0x9a5dc2;}exports[_0x4849('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 a4012ca..1ea5c1a 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 _0xe625=['YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','context','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','membername','monitor','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','name','length','connectedlinenum','format','SIP/%s','queuecallercomplete'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xe625,0x1ab));var _0x5e62=function(_0x20e52c,_0x134094){_0x20e52c=_0x20e52c-0x0;var _0xad1c3c=_0xe625[_0x20e52c];return _0xad1c3c;};'use strict';var _=require(_0x5e62('0x0'));var moment=require(_0x5e62('0x1'));var util=require(_0x5e62('0x2'));var config=require('../../../config/environment');var ami=require(_0x5e62('0x3'));var RpcVoiceAgentReport=require(_0x5e62('0x4'));var RpcVoiceCallReport=require(_0x5e62('0x5'));var RpcVoiceDialReport=require(_0x5e62('0x6'));var RpcMemberReport=require(_0x5e62('0x7'));var RpcVoiceQueueReport=require(_0x5e62('0x8'));var RpcVoiceRecording=require(_0x5e62('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x5e62('0xa'));var VoiceAgentReport=require(_0x5e62('0xb'));var VoiceDialReport=require(_0x5e62('0xc'));var UserReport=require(_0x5e62('0xd'));function Report(_0x282140){this[_0x5e62('0xe')]=_0x282140;this[_0x5e62('0xf')]=_0x282140[_0x5e62('0xf')];this[_0x5e62('0x10')]=_0x282140[_0x5e62('0x10')];}Report[_0x5e62('0x11')]['sync']=function(_0xf6e7ce){var _0x23ea2e=new VoiceQueueReport(this[_0x5e62('0xe')]);var _0x397f8d=new VoiceAgentReport(this[_0x5e62('0xe')]);var _0x39ec99=new VoiceDialReport(this[_0x5e62('0xe')]);var _0x996b29=new VoiceCallReport(this[_0x5e62('0xe')]);var _0x5b99ea=new UserReport(this['realtime']);if(config[_0x5e62('0x12')]&&config['xdr'][_0x5e62('0x13')]){ami['on'](_0x5e62('0x14'),this[_0x5e62('0x15')]['bind'](this));ami['on'](_0x5e62('0x16'),this[_0x5e62('0x17')][_0x5e62('0x18')](this));ami['on'](_0x5e62('0x19'),this[_0x5e62('0x1a')]['bind'](this));ami['on'](_0x5e62('0x1b'),this['voiceDialReport'][_0x5e62('0x18')](this));ami['on'](_0x5e62('0x1c'),this[_0x5e62('0x1d')]['bind'](this));ami['on'](_0x5e62('0x1e'),this[_0x5e62('0x1f')][_0x5e62('0x18')](this));}};Report[_0x5e62('0x11')][_0x5e62('0x20')]=function(_0x26365e){var _0x1fd83c;_0x1fd83c=_[_0x5e62('0x21')](this['agents'],function(_0x3c143d){return _0x3c143d[_0x5e62('0x22')]==_0x26365e||_0x3c143d['name']==_0x26365e;});if(_[_0x5e62('0x23')](_0x1fd83c)){var _0x47ba99=_['find'](this['telephones'],function(_0x28486c){return _0x28486c[_0x5e62('0x22')]==_0x26365e||_0x28486c['name']==_0x26365e;});if(_0x47ba99){_0x1fd83c=_[_0x5e62('0x21')](this[_0x5e62('0xf')],function(_0x44fafc){return _0x44fafc[_0x5e62('0x24')]==util['format']('SIP/%s',_0x47ba99[_0x5e62('0x25')]);});}}return _0x1fd83c;};Report[_0x5e62('0x11')]['voiceQueueReport']=function(_0x670ef9){for(var _0x11959e=0x0;_0x11959e<_0x670ef9[_0x5e62('0x26')];_0x11959e+=0x1){var _0x4b72f3=this[_0x5e62('0x20')](_0x670ef9[_0x11959e][_0x5e62('0x27')]);if(_0x4b72f3){_0x670ef9[_0x11959e][_0x5e62('0x22')]=_0x4b72f3['accountcode'];_0x670ef9[_0x11959e]['assigned']=!![];_0x670ef9[_0x11959e]['lastAssignedTo']=_0x4b72f3[_0x5e62('0x25')];_0x670ef9[_0x11959e][_0x5e62('0x24')]=_[_0x5e62('0x23')](_0x4b72f3[_0x5e62('0x24')])?util[_0x5e62('0x28')](_0x5e62('0x29'),_0x4b72f3[_0x5e62('0x25')]):_0x4b72f3[_0x5e62('0x24')];if(_0x670ef9[_0x11959e][_0x5e62('0x2a')]){_0x670ef9[_0x11959e]['queuecallercompleteAt']=moment()['format'](_0x5e62('0x2b'));}if(_0x670ef9[_0x11959e][_0x5e62('0x2c')]){_0x670ef9[_0x11959e][_0x5e62('0x2d')]=moment()[_0x5e62('0x28')](_0x5e62('0x2b'));}RpcMemberReport[_0x5e62('0x15')](_0x670ef9[_0x11959e]);}RpcVoiceQueueReport[_0x5e62('0x2e')](_0x670ef9[_0x11959e]);}};function extractCalleridNumber(_0x19b4a4){var _0x14eaef=_0x19b4a4[_0x5e62('0x2f')](/<(.*?)>/);return _0x14eaef?_0x14eaef[0x1]:_0x19b4a4;}Report['prototype'][_0x5e62('0x30')]=function(_0x3fd630){for(var _0x1ac629=0x0;_0x1ac629','linkedid','transfers','uniqueid','UserId','membername','monitorFilename','monitors','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','phone','transfererlinkedid','exports','lodash','moment','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer'];(function(_0x3fb166,_0x4eb985){var _0x5e91be=function(_0x53f4d9){while(--_0x53f4d9){_0x3fb166['push'](_0x3fb166['shift']());}};_0x5e91be(++_0x4eb985);}(_0x4f8f,0x9b));var _0xf4f8=function(_0x342e91,_0x174a0){_0x342e91=_0x342e91-0x0;var _0x4839cd=_0x4f8f[_0x342e91];return _0x4839cd;};'use strict';var _=require(_0xf4f8('0x0'));var moment=require(_0xf4f8('0x1'));var util=require('util');var config=require(_0xf4f8('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xf4f8('0x3'));var RpcVoiceCallReport=require(_0xf4f8('0x4'));var RpcVoiceDialReport=require(_0xf4f8('0x5'));var RpcMemberReport=require(_0xf4f8('0x6'));var RpcVoiceQueueReport=require(_0xf4f8('0x7'));var RpcVoiceRecording=require(_0xf4f8('0x8'));var RpcVoiceTransferReport=require(_0xf4f8('0x9'));var VoiceQueueReport=require(_0xf4f8('0xa'));var VoiceCallReport=require(_0xf4f8('0xb'));var VoiceAgentReport=require(_0xf4f8('0xc'));var VoiceDialReport=require(_0xf4f8('0xd'));var UserReport=require(_0xf4f8('0xe'));function Report(_0x54ce93){this['realtime']=_0x54ce93;this[_0xf4f8('0xf')]=_0x54ce93[_0xf4f8('0xf')];this['telephones']=_0x54ce93[_0xf4f8('0x10')];}Report['prototype'][_0xf4f8('0x11')]=function(_0x39ddad){var _0x1da71b=new VoiceQueueReport(this[_0xf4f8('0x12')]);var _0x11c822=new VoiceAgentReport(this['realtime']);var _0x319f8c=new VoiceDialReport(this[_0xf4f8('0x12')]);var _0x3a7ba2=new VoiceCallReport(this[_0xf4f8('0x12')]);var _0x1a9543=new UserReport(this[_0xf4f8('0x12')]);if(config[_0xf4f8('0x13')]&&config['xdr'][_0xf4f8('0x14')]){ami['on'](_0xf4f8('0x15'),this['voiceQueueReport']['bind'](this));ami['on'](_0xf4f8('0x16'),this[_0xf4f8('0x17')][_0xf4f8('0x18')](this));ami['on']('custom:voiceAgentReport',this[_0xf4f8('0x19')]['bind'](this));ami['on'](_0xf4f8('0x1a'),this[_0xf4f8('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0xf4f8('0x1c')][_0xf4f8('0x18')](this));ami['on'](_0xf4f8('0x1d'),this[_0xf4f8('0x1e')]['bind'](this));}};Report[_0xf4f8('0x1f')][_0xf4f8('0x20')]=function(_0x375545){var _0x4c578e;_0x4c578e=_[_0xf4f8('0x21')](this[_0xf4f8('0xf')],function(_0x44328b){return _0x44328b['accountcode']==_0x375545||_0x44328b['name']==_0x375545;});if(_[_0xf4f8('0x22')](_0x4c578e)){var _0x9f4159=_[_0xf4f8('0x21')](this[_0xf4f8('0x10')],function(_0x27a854){return _0x27a854[_0xf4f8('0x23')]==_0x375545||_0x27a854[_0xf4f8('0x24')]==_0x375545;});if(_0x9f4159){_0x4c578e=_[_0xf4f8('0x21')](this[_0xf4f8('0xf')],function(_0x57b981){return _0x57b981[_0xf4f8('0x25')]==util[_0xf4f8('0x26')](_0xf4f8('0x27'),_0x9f4159[_0xf4f8('0x24')]);});}}return _0x4c578e;};Report[_0xf4f8('0x1f')]['voiceQueueReport']=function(_0x45e435){for(var _0x462aac=0x0;_0x462aac<_0x45e435[_0xf4f8('0x28')];_0x462aac+=0x1){var _0x2f9c9a=this[_0xf4f8('0x20')](_0x45e435[_0x462aac][_0xf4f8('0x29')]);if(_0x2f9c9a){_0x45e435[_0x462aac][_0xf4f8('0x23')]=_0x2f9c9a['accountcode'];_0x45e435[_0x462aac][_0xf4f8('0x2a')]=!![];_0x45e435[_0x462aac]['lastAssignedTo']=_0x2f9c9a[_0xf4f8('0x24')];_0x45e435[_0x462aac]['interface']=_[_0xf4f8('0x22')](_0x2f9c9a['interface'])?util[_0xf4f8('0x26')](_0xf4f8('0x27'),_0x2f9c9a['name']):_0x2f9c9a[_0xf4f8('0x25')];if(_0x45e435[_0x462aac][_0xf4f8('0x2b')]){_0x45e435[_0x462aac][_0xf4f8('0x2c')]=moment()[_0xf4f8('0x26')](_0xf4f8('0x2d'));}if(_0x45e435[_0x462aac][_0xf4f8('0x2e')]){_0x45e435[_0x462aac][_0xf4f8('0x2f')]=moment()['format'](_0xf4f8('0x2d'));}RpcMemberReport[_0xf4f8('0x30')](_0x45e435[_0x462aac]);}RpcVoiceQueueReport[_0xf4f8('0x31')](_0x45e435[_0x462aac]);}};function extractCalleridNumber(_0x10d689){var _0x1fd6b2=_0x10d689[_0xf4f8('0x32')](/<(.*?)>/);return _0x1fd6b2?_0x1fd6b2[0x1]:_0x10d689;}Report[_0xf4f8('0x1f')]['getAgentByInternal']=function(_0x44d501){for(var _0x46d28e=0x0;_0x46d28e0x0?!![]:![];if(!_0x339a24){return this[_0x1617('0x1a')](this[_0x1617('0x15')][_0x1617('0x6c')]);}};VoiceQueueReport[_0x1617('0xb')]['syncQueueMember']=function(_0x2bf32d){var _0x41cd5c=this[_0x1617('0x15')]['id'];if(this[_0x1617('0x15')]['queuestatus'][_0x41cd5c]&&this[_0x1617('0x15')][_0x1617('0x68')][_0x41cd5c][_0x2bf32d[_0x1617('0x5f')]]){this['summary']['queuestatus'][_0x41cd5c][_0x2bf32d[_0x1617('0x5f')]]['agents'][_0x1617('0x6d')](_0x2bf32d);}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x18')]=function(_0x3853c1){var _0x59910b=this;try{if(this[_0x1617('0x6e')](_0x3853c1)&&this['isNotNull'](_0x3853c1[_0x1617('0x52')])){logger['debug'](_0x1617('0x6f'),util[_0x1617('0x44')](_0x3853c1,{'showHidden':![],'depth':null}));var _0x3f02d2=this[_0x1617('0x13')][_0x3853c1['queue']];if(_0x3f02d2){logger['debug'](_0x1617('0x70'),_0x3f02d2[_0x1617('0x5b')]);this['summary'][_0x1617('0x62')][_0x3f02d2[_0x1617('0x5b')]]={'summaryEvent':_0x3853c1};this[_0x1617('0x15')][_0x1617('0x6b')]+=0x1;return ami['Action']({'action':_0x1617('0x68'),'queue':_0x3f02d2[_0x1617('0x5b')]})[_0x1617('0x71')](function(_0x2efc1f){if(!_0x59910b['summary']['queuestatus'][_0x3853c1[_0x1617('0x5f')]]){_0x59910b[_0x1617('0x15')][_0x1617('0x68')][_0x3853c1[_0x1617('0x5f')]]={};}_0x59910b[_0x1617('0x15')][_0x1617('0x68')][_0x3853c1[_0x1617('0x5f')]][_0x2efc1f[_0x1617('0x5f')]]={'queue':_0x3f02d2['name'],'agents':[]};})[_0x1617('0x42')](function(_0x119e4f){throw _0x119e4f;});}}}catch(_0xca082f){logger[_0x1617('0x45')](_0x1617('0x60'),util['inspect'](_0xca082f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')]['syncQueueSummaryComplete']=function(_0x36bc64){if(this[_0x1617('0x15')][_0x1617('0x6b')]>0x0){this[_0x1617('0x15')]['completeEvent']=_0x36bc64;return;}logger[_0x1617('0x4c')](_0x1617('0x72'),util[_0x1617('0x44')](_0x36bc64,{'showHidden':![],'depth':null}));this[_0x1617('0x15')]=initializeSummary();ami[_0x1617('0x4a')](_0x1617('0x73'),{});};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x1f')]=function(_0x213b1b){try{if(this[_0x1617('0x6e')](_0x213b1b)){logger[_0x1617('0x4c')](_0x1617('0x74'),_0x213b1b[_0x1617('0x4f')],util[_0x1617('0x44')](_0x213b1b,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x1617('0xe')][_0x213b1b[_0x1617('0x4f')]])){this[_0x1617('0xe')][_0x213b1b[_0x1617('0x4f')]]=[];}if(_['isUndefined'](this[_0x1617('0x11')][_0x213b1b[_0x1617('0x4f')]])){this[_0x1617('0x11')][_0x213b1b[_0x1617('0x4f')]]={};}var _0x39e9db=new QueueReport();_0x39e9db[_0x1617('0x52')]=_0x213b1b[_0x1617('0x52')];_0x39e9db['type']=this[_0x1617('0x13')][_0x39e9db[_0x1617('0x52')]]&&this[_0x1617('0x13')][_0x39e9db[_0x1617('0x52')]]['type']?this[_0x1617('0x13')][_0x39e9db['queue']][_0x1617('0x59')]||_0x1617('0x75'):_0x1617('0x75');_0x39e9db[_0x1617('0x76')]=moment()[_0x1617('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x39e9db['position']=_0x213b1b[_0x1617('0x77')];_0x39e9db[_0x1617('0x78')]=_0x213b1b[_0x1617('0x78')];_0x39e9db[_0x1617('0x4f')]=_0x213b1b[_0x1617('0x4f')];_0x39e9db[_0x1617('0x79')]=this[_0x1617('0x11')][_0x213b1b[_0x1617('0x4f')]][_0x1617('0x79')];logger['info'](_0x1617('0x7a'),_0x39e9db['queue'],_0x39e9db[_0x1617('0x59')]);Object[_0x1617('0x7b')](_0x39e9db,_[_0x1617('0x7c')](_0x213b1b,_[_0x1617('0x7d')](_0x39e9db)));this['queueReports'][_0x213b1b[_0x1617('0x4f')]][_0x1617('0x6d')](_0x39e9db);this['channels'][_0x213b1b[_0x1617('0x4f')]]=_0x39e9db;this['emitVoiceQueueChannelSave'](_0x39e9db,_0x1617('0x1e'));}}catch(_0x52c833){logger['error'](_0x1617('0x74'),_0x213b1b[_0x1617('0x4f')],util[_0x1617('0x44')](_0x52c833,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x7e')]=function(_0x475c5f){try{if(this[_0x1617('0x6e')](_0x475c5f)){logger[_0x1617('0x4c')](_0x1617('0x7f'),_0x475c5f[_0x1617('0x4f')],util['inspect'](_0x475c5f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x475c5f[_0x1617('0x4f')]]){var _0x417357=_['last'](this[_0x1617('0xe')][_0x475c5f[_0x1617('0x4f')]]);_0x417357[_0x1617('0x39')]=![];_0x417357[_0x1617('0x80')]=null;_0x417357[_0x1617('0x81')]=_0x475c5f['holdtime'];_0x417357[_0x1617('0x82')]=_0x475c5f[_0x1617('0x82')];_0x417357['queuecallerabandon']=!![];_0x417357[_0x1617('0x83')]=moment()[_0x1617('0x50')](_0x1617('0x84'));_0x417357[_0x1617('0x85')]=_0x1617('0x86');_0x417357[_0x1617('0x87')]=null;logger[_0x1617('0x88')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x417357[_0x1617('0x52')],_0x417357[_0x1617('0x59')]);this[_0x1617('0x11')][_0x475c5f[_0x1617('0x4f')]]=_0x417357;this[_0x1617('0x48')](_0x417357,_0x1617('0x20'));}}}catch(_0x18b2e5){logger['error'](_0x1617('0x7f'),_0x475c5f[_0x1617('0x4f')],util['inspect'](_0x18b2e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1617('0x21')]=function(_0x31c297){try{if(this[_0x1617('0x6e')](_0x31c297)){logger[_0x1617('0x4c')](_0x1617('0x89'),_0x31c297[_0x1617('0x4f')],util[_0x1617('0x44')](_0x31c297,{'showHidden':![],'depth':null}));if(this[_0x1617('0xe')][_0x31c297['uniqueid']]){var _0x49ac3b=_['last'](this[_0x1617('0xe')][_0x31c297[_0x1617('0x4f')]]);_0x49ac3b[_0x1617('0x8a')]=moment()[_0x1617('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x49ac3b[_0x1617('0x8b')]=_0x31c297[_0x1617('0x8b')];_0x49ac3b[_0x1617('0x8c')]=_0x31c297[_0x1617('0x8c')];logger[_0x1617('0x88')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x49ac3b[_0x1617('0x52')],_0x49ac3b[_0x1617('0x59')],_0x31c297[_0x1617('0x8b')],_0x31c297['connectedlinename']);this[_0x1617('0x11')][_0x31c297[_0x1617('0x4f')]]=_0x49ac3b;this[_0x1617('0x4b')](_0x49ac3b,_0x1617('0x8d'));}}}catch(_0x14ea23){logger['error'](_0x1617('0x89'),_0x31c297['uniqueid'],util[_0x1617('0x44')](_0x14ea23,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x23')]=function(_0x4e9d4c){try{if(this[_0x1617('0x6e')](_0x4e9d4c)){logger[_0x1617('0x4c')](_0x1617('0x8e'),_0x4e9d4c[_0x1617('0x4f')],util['inspect'](_0x4e9d4c,{'showHidden':![],'depth':null}));if(this[_0x1617('0xe')][_0x4e9d4c[_0x1617('0x4f')]]){var _0x5eb539=_['last'](this[_0x1617('0xe')][_0x4e9d4c[_0x1617('0x4f')]]);_0x5eb539[_0x1617('0x39')]=!![];_0x5eb539[_0x1617('0x85')]=_0x1617('0x8f');logger['info'](_0x1617('0x90'),_0x5eb539[_0x1617('0x52')],_0x5eb539[_0x1617('0x59')]);}}}catch(_0x1a68b4){logger[_0x1617('0x45')](_0x1617('0x8e'),_0x4e9d4c[_0x1617('0x4f')],util['inspect'](_0x1a68b4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x22')]=function(_0x32941d){try{if(this[_0x1617('0x6e')](_0x32941d)){logger[_0x1617('0x4c')](_0x1617('0x91'),_0x32941d['uniqueid'],util[_0x1617('0x44')](_0x32941d,{'showHidden':![],'depth':null}));if(this[_0x1617('0xe')][_0x32941d[_0x1617('0x4f')]]){var _0x57824c=_[_0x1617('0x92')](this[_0x1617('0xe')][_0x32941d[_0x1617('0x4f')]]);_0x57824c[_0x1617('0x20')]=![];_0x57824c[_0x1617('0x83')]=null;_0x57824c[_0x1617('0x93')]=!![];_0x57824c[_0x1617('0x87')]=_0x32941d['membername'];_0x57824c[_0x1617('0x81')]=_0x32941d[_0x1617('0x81')];_0x57824c[_0x1617('0x39')]=!![];_0x57824c[_0x1617('0x38')]=![];_0x57824c['queuecallerexitAt']=null;if(!_0x57824c[_0x1617('0x94')]){if(_0x32941d['reason']==_0x1617('0x94')){_0x57824c[_0x1617('0x85')]=_0x1617('0x95');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x57824c[_0x1617('0x52')],_0x57824c['type']);}else{if(_['startsWith'](_0x32941d[_0x1617('0x41')][_0x1617('0x96')](),'local/')){if(this['queueReports'][_0x32941d[_0x1617('0x97')]]){var _0x253128=_[_0x1617('0x92')](this[_0x1617('0xe')][_0x32941d[_0x1617('0x97')]]);_0x253128[_0x1617('0x39')]=![];_0x253128[_0x1617('0x38')]=!![];_0x253128[_0x1617('0x98')]=moment(_0x57824c[_0x1617('0x76')])[_0x1617('0x99')](_0x32941d['holdtime'],_0x1617('0x9a'))[_0x1617('0x50')](_0x1617('0x84'));_0x253128[_0x1617('0x85')]=_0x1617('0x9b');_0x253128[_0x1617('0x94')]=!![];_0x253128[_0x1617('0x9c')]=_0x1617('0x9d');_0x253128['transferexten']=_0x32941d[_0x1617('0x9e')];_0x253128[_0x1617('0x9f')]=_0x32941d[_0x1617('0x4f')];logger[_0x1617('0x88')](_0x1617('0xa0'),_0x253128[_0x1617('0x52')],_0x253128[_0x1617('0x59')]);var _0x56ea01=this[_0x1617('0xe')][_0x32941d['linkedid']];this[_0x1617('0xe')][_0x32941d[_0x1617('0x97')]]=this[_0x1617('0xe')][_0x32941d[_0x1617('0x4f')]];this['queueReports'][_0x32941d['uniqueid']]=_0x56ea01;}}else{_0x57824c['queuecallerexitreason']=_0x1617('0xa1')+_0x32941d['reason'][_0x1617('0xa2')]();logger[_0x1617('0x88')](_0x1617('0xa3'),_0x57824c[_0x1617('0x52')],_0x57824c[_0x1617('0x59')],_0x57824c[_0x1617('0x85')]);}}}this[_0x1617('0x11')][_0x32941d['uniqueid']]=_0x57824c;}}}catch(_0x2aab75){logger['error'](_0x1617('0x91'),_0x32941d[_0x1617('0x4f')],util[_0x1617('0x44')](_0x2aab75,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0x25')]=function(_0x3206ea){try{if(this[_0x1617('0x6e')](_0x3206ea)){logger['debug'](_0x1617('0xa4'),_0x3206ea['uniqueid'],util['inspect'](_0x3206ea,{'showHidden':![],'depth':null}));this['addVariable'](_0x3206ea[_0x1617('0x4f')],_[_0x1617('0x7d')](_0x3206ea[_0x1617('0xa5')])[0x0],_0x3206ea['value']);if(this['queueReports'][_0x3206ea[_0x1617('0x4f')]]){var _0x59a76b=_['last'](this[_0x1617('0xe')][_0x3206ea[_0x1617('0x4f')]]);if(_0x59a76b){if(this[_0x1617('0x6e')](_0x3206ea[_0x1617('0xa5')])&&this[_0x1617('0x6e')](_0x3206ea[_0x1617('0xa5')][_0x1617('0x68')])){switch(_0x3206ea[_0x1617('0xa6')]){case _0x1617('0xa7'):_0x59a76b[_0x1617('0x38')]=![];_0x59a76b['queuecallerexitAt']=null;break;case _0x1617('0xa8'):_0x59a76b[_0x1617('0xa9')]=_0x1617('0xaa');_0x59a76b[_0x1617('0x38')]=!![];_0x59a76b['queuecallerexitAt']=moment()[_0x1617('0x50')](_0x1617('0x84'));_0x59a76b['queuecallerleaveAt']=moment()[_0x1617('0x50')](_0x1617('0x84'));logger[_0x1617('0x4c')](_0x1617('0xab'),_0x3206ea['uniqueid'],util[_0x1617('0x44')](_0x59a76b,{'showHidden':![],'depth':null}));ami[_0x1617('0x4a')](_0x1617('0xac'),_0x59a76b);break;default:_0x59a76b['queuecallerexit']=!![];_0x59a76b[_0x1617('0x98')]=moment()[_0x1617('0x50')](_0x1617('0x84'));_0x59a76b[_0x1617('0x8a')]=moment()[_0x1617('0x50')](_0x1617('0x84'));}_0x59a76b[_0x1617('0x20')]=![];_0x59a76b['queuecallerabandonAt']=null;_0x59a76b['queuecallerexitreason']=_0x3206ea[_0x1617('0xa6')];this['channels'][_0x3206ea[_0x1617('0x4f')]]=_0x59a76b;this[_0x1617('0x48')](_0x59a76b,_0x1617('0x24'));}else if(this[_0x1617('0x6e')](_0x3206ea[_0x1617('0xa5')])&&this[_0x1617('0x6e')](_0x3206ea[_0x1617('0xa5')][_0x1617('0xad')])){if(!_0x59a76b['queuecallerabandon']){_0x59a76b['queuecallerexit']=!![];_0x59a76b['queuecallerexitAt']=moment()[_0x1617('0x50')](_0x1617('0x84'));_0x59a76b[_0x1617('0x85')]=_0x1617('0xae');_0x59a76b[_0x1617('0x8a')]=moment()['format'](_0x1617('0x84'));this[_0x1617('0x11')][_0x3206ea['uniqueid']]=_0x59a76b;}}logger[_0x1617('0x88')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3206ea[_0x1617('0x4f')],_0x59a76b[_0x1617('0x52')],_0x59a76b[_0x1617('0x59')],_[_0x1617('0x7d')](_0x3206ea['variable'])[0x0],_0x3206ea[_0x1617('0xa6')]);_0x59a76b[_0x1617('0x16')]=this[_0x1617('0x16')][_0x3206ea['uniqueid']];}}}}catch(_0x53203f){logger[_0x1617('0x45')]('[%s][voiceQueueReport][varset]',_0x3206ea[_0x1617('0x4f')],util[_0x1617('0x44')](_0x53203f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0xaf')]=function(_0x33db50,_0x123ef6,_0x4ddbdc){var _0x5ee38f=[_0x1617('0xb0'),'rtpaudioqosbridged',_0x1617('0xb1'),_0x1617('0xb2'),_0x1617('0xb3'),_0x1617('0xb4'),_0x1617('0xb5'),'rtpaudioqosrttbridged',_0x1617('0xb6'),_0x1617('0xb7'),_0x1617('0xb8'),_0x1617('0xb9'),_0x1617('0xba'),_0x1617('0xbb'),_0x1617('0xbc'),'memberlastcall',_0x1617('0xbd'),_0x1617('0xbe'),_0x1617('0xbf')];if(!_[_0x1617('0x3e')](_0x123ef6)&&!_['includes'](_0x5ee38f,_0x123ef6)){if(_['isUndefined'](this[_0x1617('0x16')][_0x33db50])){this[_0x1617('0x16')][_0x33db50]={};}this[_0x1617('0x16')][_0x33db50][_0x123ef6]=_0x4ddbdc;}};VoiceQueueReport[_0x1617('0xb')][_0x1617('0xc0')]=function(_0x1d349c,_0x107ab5,_0x5798da){try{var _0x55b270={};if(this['queueReports'][_0x1d349c]){for(var _0x3038b1=0x0;_0x3038b10x0?!![]:![];if(!_0x258810){return this[_0xa681('0x1c')](this[_0xa681('0x17')][_0xa681('0x71')]);}};VoiceQueueReport[_0xa681('0xb')]['syncQueueMember']=function(_0x5652ea){var _0x1a01b6=this[_0xa681('0x17')]['id'];if(this[_0xa681('0x17')]['queuestatus'][_0x1a01b6]&&this['summary'][_0xa681('0x68')][_0x1a01b6][_0x5652ea['actionid']]){this['summary'][_0xa681('0x68')][_0x1a01b6][_0x5652ea[_0xa681('0x67')]][_0xa681('0x12')]['push'](_0x5652ea);}};VoiceQueueReport['prototype'][_0xa681('0x19')]=function(_0x3650c1){var _0x5b0272=this;try{if(this[_0xa681('0x60')](_0x3650c1)&&this[_0xa681('0x60')](_0x3650c1[_0xa681('0x52')])){logger[_0xa681('0x4e')](_0xa681('0x72'),util[_0xa681('0x47')](_0x3650c1,{'showHidden':![],'depth':null}));var _0x1ab026=this[_0xa681('0x15')][_0x3650c1[_0xa681('0x52')]];if(_0x1ab026){logger['debug'](_0xa681('0x73'),_0x1ab026[_0xa681('0x5e')]);this['summary'][_0xa681('0x62')][_0x1ab026[_0xa681('0x5e')]]={'summaryEvent':_0x3650c1};this[_0xa681('0x17')][_0xa681('0x70')]+=0x1;return ami[_0xa681('0x61')]({'action':_0xa681('0x68'),'queue':_0x1ab026[_0xa681('0x5e')]})['then'](function(_0x421634){if(!_0x5b0272[_0xa681('0x17')][_0xa681('0x68')][_0x3650c1[_0xa681('0x67')]]){_0x5b0272[_0xa681('0x17')]['queuestatus'][_0x3650c1[_0xa681('0x67')]]={};}_0x5b0272[_0xa681('0x17')][_0xa681('0x68')][_0x3650c1[_0xa681('0x67')]][_0x421634[_0xa681('0x67')]]={'queue':_0x1ab026['name'],'agents':[]};})[_0xa681('0x63')](function(_0x2f4997){throw _0x2f4997;});}}}catch(_0x3a24bd){logger[_0xa681('0x48')](_0xa681('0x69'),util[_0xa681('0x47')](_0x3a24bd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')][_0xa681('0x1c')]=function(_0x1b26c4){if(this[_0xa681('0x17')][_0xa681('0x70')]>0x0){this[_0xa681('0x17')][_0xa681('0x71')]=_0x1b26c4;return;}logger[_0xa681('0x4e')](_0xa681('0x74'),util[_0xa681('0x47')](_0x1b26c4,{'showHidden':![],'depth':null}));this[_0xa681('0x17')]=initializeSummary();ami[_0xa681('0x4c')](_0xa681('0x75'),{});};VoiceQueueReport['prototype'][_0xa681('0x21')]=function(_0x232a57){try{if(this[_0xa681('0x60')](_0x232a57)){logger[_0xa681('0x4e')](_0xa681('0x76'),_0x232a57[_0xa681('0x50')],util[_0xa681('0x47')](_0x232a57,{'showHidden':![],'depth':null}));if(_[_0xa681('0x77')](this[_0xa681('0x10')][_0x232a57['uniqueid']])){this[_0xa681('0x10')][_0x232a57[_0xa681('0x50')]]=[];}if(_[_0xa681('0x77')](this[_0xa681('0x13')][_0x232a57['uniqueid']])){this[_0xa681('0x13')][_0x232a57[_0xa681('0x50')]]={};}var _0x1716b0=new QueueReport();_0x1716b0[_0xa681('0x52')]=_0x232a57['queue'];_0x1716b0[_0xa681('0x5b')]=this[_0xa681('0x15')][_0x1716b0[_0xa681('0x52')]]&&this[_0xa681('0x15')][_0x1716b0[_0xa681('0x52')]][_0xa681('0x5b')]?this[_0xa681('0x15')][_0x1716b0[_0xa681('0x52')]][_0xa681('0x5b')]||_0xa681('0x5c'):'inbound';_0x1716b0[_0xa681('0x78')]=moment()[_0xa681('0x58')](_0xa681('0x79'));_0x1716b0[_0xa681('0x7a')]=_0x232a57[_0xa681('0x7a')];_0x1716b0['count']=_0x232a57[_0xa681('0x7b')];_0x1716b0[_0xa681('0x50')]=_0x232a57[_0xa681('0x50')];_0x1716b0[_0xa681('0x7c')]=this[_0xa681('0x13')][_0x232a57[_0xa681('0x50')]][_0xa681('0x7c')];logger[_0xa681('0x7d')](_0xa681('0x7e'),_0x1716b0['queue'],_0x1716b0[_0xa681('0x5b')]);Object[_0xa681('0x6e')](_0x1716b0,_['pick'](_0x232a57,_['keys'](_0x1716b0)));this['queueReports'][_0x232a57[_0xa681('0x50')]][_0xa681('0x7f')](_0x1716b0);this[_0xa681('0x13')][_0x232a57[_0xa681('0x50')]]=_0x1716b0;this[_0xa681('0x4d')](_0x1716b0,_0xa681('0x20'));}}catch(_0x3a08cc){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x232a57[_0xa681('0x50')],util[_0xa681('0x47')](_0x3a08cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')][_0xa681('0x23')]=function(_0x58fd65){try{if(this[_0xa681('0x60')](_0x58fd65)){logger['debug'](_0xa681('0x80'),_0x58fd65[_0xa681('0x50')],util[_0xa681('0x47')](_0x58fd65,{'showHidden':![],'depth':null}));if(this[_0xa681('0x10')][_0x58fd65[_0xa681('0x50')]]){var _0x4d84e9=_['last'](this[_0xa681('0x10')][_0x58fd65[_0xa681('0x50')]]);_0x4d84e9[_0xa681('0x3e')]=![];_0x4d84e9[_0xa681('0x81')]=null;_0x4d84e9[_0xa681('0x82')]=_0x58fd65[_0xa681('0x82')];_0x4d84e9[_0xa681('0x83')]=_0x58fd65['originalposition'];_0x4d84e9['queuecallerabandon']=!![];_0x4d84e9['queuecallerabandonAt']=moment()[_0xa681('0x58')](_0xa681('0x79'));_0x4d84e9['queuecallerexitreason']='ABANDONED';_0x4d84e9[_0xa681('0x84')]=null;logger['info'](_0xa681('0x85'),_0x4d84e9['queue'],_0x4d84e9[_0xa681('0x5b')]);this[_0xa681('0x13')][_0x58fd65['uniqueid']]=_0x4d84e9;this[_0xa681('0x86')](_0x4d84e9,_0xa681('0x22'));}}}catch(_0x407235){logger[_0xa681('0x48')](_0xa681('0x80'),_0x58fd65[_0xa681('0x50')],util[_0xa681('0x47')](_0x407235,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')][_0xa681('0x25')]=function(_0x16c4b7){try{if(this['isNotNull'](_0x16c4b7)){logger[_0xa681('0x4e')](_0xa681('0x87'),_0x16c4b7[_0xa681('0x50')],util[_0xa681('0x47')](_0x16c4b7,{'showHidden':![],'depth':null}));if(this[_0xa681('0x10')][_0x16c4b7[_0xa681('0x50')]]){var _0x29eab2=_[_0xa681('0x88')](this[_0xa681('0x10')][_0x16c4b7['uniqueid']]);_0x29eab2[_0xa681('0x89')]=moment()[_0xa681('0x58')](_0xa681('0x79'));_0x29eab2['connectedlinenum']=_0x16c4b7[_0xa681('0x8a')];_0x29eab2[_0xa681('0x8b')]=_0x16c4b7[_0xa681('0x8b')];logger[_0xa681('0x7d')](_0xa681('0x8c'),_0x29eab2[_0xa681('0x52')],_0x29eab2[_0xa681('0x5b')],_0x16c4b7[_0xa681('0x8a')],_0x16c4b7[_0xa681('0x8b')]);this[_0xa681('0x13')][_0x16c4b7[_0xa681('0x50')]]=_0x29eab2;this[_0xa681('0x4d')](_0x29eab2,_0xa681('0x24'));}}}catch(_0x4a5268){logger[_0xa681('0x48')](_0xa681('0x87'),_0x16c4b7[_0xa681('0x50')],util[_0xa681('0x47')](_0x4a5268,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa681('0x29')]=function(_0x325f3a){try{if(this[_0xa681('0x60')](_0x325f3a)){logger[_0xa681('0x4e')](_0xa681('0x8d'),_0x325f3a[_0xa681('0x50')],util[_0xa681('0x47')](_0x325f3a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x325f3a['uniqueid']]){var _0x3e58d6=_['last'](this[_0xa681('0x10')][_0x325f3a[_0xa681('0x50')]]);_0x3e58d6[_0xa681('0x3e')]=!![];_0x3e58d6[_0xa681('0x56')]=_0xa681('0x8e');logger[_0xa681('0x7d')](_0xa681('0x8f'),_0x3e58d6['queue'],_0x3e58d6[_0xa681('0x5b')]);}}}catch(_0x138499){logger[_0xa681('0x48')](_0xa681('0x8d'),_0x325f3a[_0xa681('0x50')],util[_0xa681('0x47')](_0x138499,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')]['syncAgentComplete']=function(_0x3e7ce1){try{if(this['isNotNull'](_0x3e7ce1)){logger['debug'](_0xa681('0x90'),_0x3e7ce1[_0xa681('0x50')],util['inspect'](_0x3e7ce1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e7ce1[_0xa681('0x50')]]){var _0x5d3350=_['last'](this['queueReports'][_0x3e7ce1[_0xa681('0x50')]]);_0x5d3350['queuecallerabandon']=![];_0x5d3350[_0xa681('0x91')]=null;_0x5d3350[_0xa681('0x92')]=!![];_0x5d3350[_0xa681('0x84')]=_0x3e7ce1[_0xa681('0x93')];_0x5d3350[_0xa681('0x82')]=_0x3e7ce1[_0xa681('0x82')];_0x5d3350[_0xa681('0x3e')]=!![];_0x5d3350[_0xa681('0x3d')]=![];_0x5d3350['queuecallerexitAt']=null;if(!_0x5d3350[_0xa681('0x94')]){if(_0x3e7ce1[_0xa681('0x95')]==_0xa681('0x94')){_0x5d3350['queuecallerexitreason']=_0xa681('0x96');logger[_0xa681('0x7d')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5d3350['queue'],_0x5d3350['type']);}else{if(_[_0xa681('0x97')](_0x3e7ce1[_0xa681('0x43')][_0xa681('0x98')](),_0xa681('0x99'))){if(this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x9a')]]){var _0x2d8f78=_['last'](this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x9a')]]);_0x2d8f78[_0xa681('0x3e')]=![];_0x2d8f78['queuecallerexit']=!![];_0x2d8f78[_0xa681('0x9b')]=moment(_0x5d3350['queuecallerjoinAt'])[_0xa681('0x9c')](_0x3e7ce1[_0xa681('0x82')],'seconds')[_0xa681('0x58')](_0xa681('0x79'));_0x2d8f78['queuecallerexitreason']='FORWARDTRANSFER';_0x2d8f78[_0xa681('0x94')]=!![];_0x2d8f78[_0xa681('0x9d')]=_0xa681('0x9e');_0x2d8f78[_0xa681('0x9f')]=_0x3e7ce1[_0xa681('0xa0')];_0x2d8f78[_0xa681('0xa1')]=_0x3e7ce1[_0xa681('0x50')];logger['info'](_0xa681('0xa2'),_0x2d8f78[_0xa681('0x52')],_0x2d8f78['type']);var _0x51e1ef=this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x9a')]];this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x9a')]]=this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x50')]];this[_0xa681('0x10')][_0x3e7ce1[_0xa681('0x50')]]=_0x51e1ef;}}else{_0x5d3350['queuecallerexitreason']=_0xa681('0xa3')+_0x3e7ce1[_0xa681('0x95')][_0xa681('0xa4')]();logger[_0xa681('0x7d')](_0xa681('0xa5'),_0x5d3350[_0xa681('0x52')],_0x5d3350[_0xa681('0x5b')],_0x5d3350[_0xa681('0x56')]);}}}this[_0xa681('0x13')][_0x3e7ce1[_0xa681('0x50')]]=_0x5d3350;}}}catch(_0x487a83){logger[_0xa681('0x48')](_0xa681('0x90'),_0x3e7ce1[_0xa681('0x50')],util['inspect'](_0x487a83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')][_0xa681('0x2a')]=function(_0x5d42ca){try{if(this['isNotNull'](_0x5d42ca)){logger[_0xa681('0x4e')](_0xa681('0xa6'),_0x5d42ca[_0xa681('0x50')],util['inspect'](_0x5d42ca,{'showHidden':![],'depth':null}));this[_0xa681('0xa7')](_0x5d42ca[_0xa681('0x50')],_[_0xa681('0xa8')](_0x5d42ca['variable'])[0x0],_0x5d42ca['value']);if(this[_0xa681('0x10')][_0x5d42ca[_0xa681('0x50')]]){var _0x3d906b=_['last'](this[_0xa681('0x10')][_0x5d42ca['uniqueid']]);if(_0x3d906b){if(this[_0xa681('0x60')](_0x5d42ca[_0xa681('0xa9')])&&this[_0xa681('0x60')](_0x5d42ca[_0xa681('0xa9')][_0xa681('0x68')])){switch(_0x5d42ca['value']){case _0xa681('0xaa'):_0x3d906b[_0xa681('0x3d')]=![];_0x3d906b['queuecallerexitAt']=null;break;case'TIMEOUT':_0x3d906b[_0xa681('0xab')]=_0xa681('0xac');_0x3d906b[_0xa681('0x3d')]=!![];_0x3d906b[_0xa681('0x9b')]=moment()[_0xa681('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d906b[_0xa681('0x89')]=moment()[_0xa681('0x58')](_0xa681('0x79'));logger[_0xa681('0x4e')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x5d42ca['uniqueid'],util['inspect'](_0x3d906b,{'showHidden':![],'depth':null}));ami[_0xa681('0x4c')]('custom:timeout',_0x3d906b);break;default:_0x3d906b[_0xa681('0x3d')]=!![];_0x3d906b['queuecallerexitAt']=moment()['format'](_0xa681('0x79'));_0x3d906b[_0xa681('0x89')]=moment()[_0xa681('0x58')](_0xa681('0x79'));}_0x3d906b[_0xa681('0x22')]=![];_0x3d906b['queuecallerabandonAt']=null;_0x3d906b[_0xa681('0x56')]=_0x5d42ca['value'];this[_0xa681('0x13')][_0x5d42ca['uniqueid']]=_0x3d906b;this['emitVoiceQueueChannelRemove'](_0x3d906b,'varset');}else if(this['isNotNull'](_0x5d42ca[_0xa681('0xa9')])&&this['isNotNull'](_0x5d42ca['variable']['queueposition'])){if(!_0x3d906b['queuecallerabandon']){_0x3d906b['queuecallerexit']=!![];_0x3d906b[_0xa681('0x9b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d906b[_0xa681('0x56')]=_0xa681('0xad');_0x3d906b[_0xa681('0x89')]=moment()[_0xa681('0x58')](_0xa681('0x79'));this['channels'][_0x5d42ca['uniqueid']]=_0x3d906b;}}logger[_0xa681('0x7d')](_0xa681('0xae'),_0x5d42ca[_0xa681('0x50')],_0x3d906b[_0xa681('0x52')],_0x3d906b[_0xa681('0x5b')],_['keys'](_0x5d42ca[_0xa681('0xa9')])[0x0],_0x5d42ca[_0xa681('0xaf')]);_0x3d906b[_0xa681('0x18')]=this[_0xa681('0x18')][_0x5d42ca['uniqueid']];}}}}catch(_0x35ec65){logger['error']('[%s][voiceQueueReport][varset]',_0x5d42ca[_0xa681('0x50')],util[_0xa681('0x47')](_0x35ec65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa681('0xb')][_0xa681('0xa7')]=function(_0x5855d2,_0x17766d,_0x3356cc){var _0x35c353=[_0xa681('0xb0'),_0xa681('0xb1'),_0xa681('0xb2'),'rtpaudioqosjitterbridged',_0xa681('0xb3'),_0xa681('0xb4'),'rtpaudioqosrtt',_0xa681('0xb5'),'sipcallid',_0xa681('0xb6'),_0xa681('0xb7'),'bridgepvtcallid','membercalls','memberdynamic',_0xa681('0xb8'),'memberlastcall',_0xa681('0x93'),'memberpenalty',_0xa681('0xb9')];if(!_[_0xa681('0x41')](_0x17766d)&&!_[_0xa681('0xba')](_0x35c353,_0x17766d)){if(_['isUndefined'](this[_0xa681('0x18')][_0x5855d2])){this[_0xa681('0x18')][_0x5855d2]={};}this[_0xa681('0x18')][_0x5855d2][_0x17766d]=_0x3356cc;}};VoiceQueueReport['prototype'][_0xa681('0xbb')]=function(_0x4ab85e,_0x4d6e70,_0x4a5dea){try{var _0x5e8f08={};if(this[_0xa681('0x10')][_0x4ab85e]){for(var _0x593351=0x0;_0x593351=0x0?moment(_0x2ef33f[_0xc1d9('0x19')])[_0xc1d9('0x1a')](_0x2ef33f['starttime'],_0xc1d9('0xd')):null,'data1':_0xc1d9('0x1b'),'data2':_0x2ef33f['accountcode'],'data3':_0x2ef33f['exten'],'data4':_0x2ef33f['dialstring']||null,'role':_0xc1d9('0x12'),'internal':_0x2ef33f[_0xc1d9('0x13')]?_[_0xc1d9('0x14')](_0x2ef33f[_0xc1d9('0x13')]):undefined,'uniqueid':_0x2ef33f[_0xc1d9('0x15')]},'log':_0xc1d9('0x4')});}; \ No newline at end of file +var _0xe87b=['voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','diff','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','voice','membername','endtime','outbound','dialstring','moment','lodash','util','../client'];(function(_0x5486f1,_0x444861){var _0x54ef14=function(_0x1db199){while(--_0x1db199){_0x5486f1['push'](_0x5486f1['shift']());}};_0x54ef14(++_0x444861);}(_0xe87b,0xd5));var _0xbe87=function(_0x5b1f02,_0x2ae95d){_0x5b1f02=_0x5b1f02-0x0;var _0x51381b=_0xe87b[_0x5b1f02];return _0x51381b;};'use strict';var moment=require(_0xbe87('0x0'));var _=require(_0xbe87('0x1'));var util=require(_0xbe87('0x2'));var client=require(_0xbe87('0x3'));exports[_0xbe87('0x4')]=function(_0x7d0bd3){var _0x4d6d62=_0x7d0bd3[_0xbe87('0x5')]||_0x7d0bd3[_0xbe87('0x6')];return client[_0xbe87('0x7')](_0xbe87('0x8'),{'body':{'channel':'voice','membername':_0x7d0bd3['lastAssignedTo'],'interface':_[_0xbe87('0x9')](_0x7d0bd3[_0xbe87('0xa')])?util[_0xbe87('0xb')](_0xbe87('0xc'),_0x7d0bd3[_0xbe87('0xd')]):_0x7d0bd3[_0xbe87('0xa')],'type':_0xbe87('0xe'),'enterAt':_0x7d0bd3['queuecallerleaveAt'],'exitAt':_0x4d6d62,'duration':moment(_0x4d6d62)[_0xbe87('0xf')](_0x7d0bd3[_0xbe87('0x10')],_0xbe87('0x11')),'data1':'inbound','data2':_0x7d0bd3[_0xbe87('0x12')],'data3':_0x7d0bd3[_0xbe87('0x13')],'data4':null,'data5':_0x7d0bd3[_0xbe87('0x14')],'role':_0xbe87('0x15'),'internal':_0x7d0bd3['accountcode']?_[_0xbe87('0x16')](_0x7d0bd3[_0xbe87('0x17')]):undefined,'uniqueid':_0x7d0bd3[_0xbe87('0x18')]},'log':_0xbe87('0x8')});};exports[_0xbe87('0x19')]=function(_0x20f103){return client[_0xbe87('0x7')](_0xbe87('0x8'),{'body':{'channel':_0xbe87('0x1a'),'membername':_0x20f103[_0xbe87('0x1b')],'interface':_0x20f103['interface'],'type':_0xbe87('0xe'),'enterAt':_0x20f103['starttime'],'exitAt':_0x20f103['endtime'],'duration':moment(_0x20f103[_0xbe87('0x1c')])[_0xbe87('0xf')](_0x20f103['starttime'],_0xbe87('0x11'))>=0x0?moment(_0x20f103[_0xbe87('0x1c')])[_0xbe87('0xf')](_0x20f103['starttime'],_0xbe87('0x11')):null,'data1':_0xbe87('0x1d'),'data2':_0x20f103[_0xbe87('0x17')],'data3':_0x20f103['exten'],'data4':_0x20f103[_0xbe87('0x1e')]||null,'role':_0xbe87('0x15'),'internal':_0x20f103[_0xbe87('0x17')]?_['toNumber'](_0x20f103['accountcode']):undefined,'uniqueid':_0x20f103[_0xbe87('0x18')]},'log':_0xbe87('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2be5e25..3e1f73c 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 _0xa9e2=['Request','GetSettings','getSettings'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xa9e2,0x1e5));var _0x2a9e=function(_0x38c25b,_0x189886){_0x38c25b=_0x38c25b-0x0;var _0x3c09a6=_0xa9e2[_0x38c25b];return _0x3c09a6;};'use strict';var client=require('../client');exports[_0x2a9e('0x0')]=function(){return client[_0x2a9e('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0x2a9e('0x2')});}; \ No newline at end of file +var _0xe11d=['GetSettings','../client','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x1e041e,_0x245114){var _0x3739de=function(_0x58665d){while(--_0x58665d){_0x1e041e['push'](_0x1e041e['shift']());}};_0x3739de(++_0x245114);}(_0xe11d,0x1eb));var _0xde11=function(_0x2d31bb,_0x3041ad){_0x2d31bb=_0x2d31bb-0x0;var _0x1569c2=_0xe11d[_0x2d31bb];return _0x1569c2;};'use strict';var client=require(_0xde11('0x0'));exports['getSettings']=function(){return client[_0xde11('0x1')](_0xde11('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xde11('0x3'),'previewRecallmeReminderInterval']},'log':_0xde11('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index f859c66..de23398 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 _0xfe9d=['../client','getTemplates','Request','name','GetTemplate'];(function(_0x1155bb,_0xa23b84){var _0x281ccf=function(_0x42e53b){while(--_0x42e53b){_0x1155bb['push'](_0x1155bb['shift']());}};_0x281ccf(++_0xa23b84);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x684c95,_0x290fe8){_0x684c95=_0x684c95-0x0;var _0x1c32eb=_0xfe9d[_0x684c95];return _0x1c32eb;};'use strict';var client=require(_0xdfe9('0x0'));exports[_0xdfe9('0x1')]=function(_0x75737a){return function(_0x2c789b){return client[_0xdfe9('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xdfe9('0x3'),'html']},'log':_0xdfe9('0x4')});};}; \ No newline at end of file +var _0x5ea2=['GetTemplate','name','html','../client','Request'];(function(_0xc48448,_0x8339ac){var _0xe437c7=function(_0x4bb38f){while(--_0x4bb38f){_0xc48448['push'](_0xc48448['shift']());}};_0xe437c7(++_0x8339ac);}(_0x5ea2,0x99));var _0x25ea=function(_0x28e800,_0x2798a5){_0x28e800=_0x28e800-0x0;var _0x2cb00e=_0x5ea2[_0x28e800];return _0x2cb00e;};'use strict';var client=require(_0x25ea('0x0'));exports['getTemplates']=function(_0x57e182){return function(_0x34af5d){return client[_0x25ea('0x1')](_0x25ea('0x2'),{'options':{'raw':!![],'attributes':['id',_0x25ea('0x3'),_0x25ea('0x4')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 9e14de0..934bc4f 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 _0x08e8=['field','operator','value','Condition','AnyConditions','Action','action','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','channel','status','AllConditions'];(function(_0x1102fa,_0xb08169){var _0x543934=function(_0x8dcada){while(--_0x8dcada){_0x1102fa['push'](_0x1102fa['shift']());}};_0x543934(++_0xb08169);}(_0x08e8,0xf0));var _0x808e=function(_0x35cbf7,_0x2567cd){_0x35cbf7=_0x35cbf7-0x0;var _0x384f31=_0x08e8[_0x35cbf7];return _0x384f31;};'use strict';var client=require(_0x808e('0x0'));exports[_0x808e('0x1')]=function(_0x5098fd){return function(_0x39a1de){return client[_0x808e('0x2')](_0x808e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x808e('0x4'),_0x808e('0x5')],'include':[{'model':'Condition','as':_0x808e('0x6'),'attributes':['id',_0x808e('0x7'),_0x808e('0x8'),_0x808e('0x9')]},{'model':_0x808e('0xa'),'as':_0x808e('0xb'),'attributes':['id','field',_0x808e('0x8'),_0x808e('0x9')]},{'model':_0x808e('0xc'),'as':'Actions','attributes':['id',_0x808e('0xd'),'data1',_0x808e('0xe'),'data3',_0x808e('0xf'),_0x808e('0x10'),_0x808e('0x11'),_0x808e('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x9f50=['GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','action','data2','data3','data4','data6','data7','../client','getTriggers','Request'];(function(_0x31a7c4,_0x33aeb0){var _0x41a4ea=function(_0x569159){while(--_0x569159){_0x31a7c4['push'](_0x31a7c4['shift']());}};_0x41a4ea(++_0x33aeb0);}(_0x9f50,0xb1));var _0x09f5=function(_0x3d2438,_0x2e7922){_0x3d2438=_0x3d2438-0x0;var _0xd18de5=_0x9f50[_0x3d2438];return _0xd18de5;};'use strict';var client=require(_0x09f5('0x0'));exports[_0x09f5('0x1')]=function(_0x2c36c6){return function(_0x482a98){return client[_0x09f5('0x2')](_0x09f5('0x3'),{'options':{'raw':![],'attributes':['id',_0x09f5('0x4'),_0x09f5('0x5'),_0x09f5('0x6')],'include':[{'model':_0x09f5('0x7'),'as':_0x09f5('0x8'),'attributes':['id',_0x09f5('0x9'),_0x09f5('0xa'),'value']},{'model':_0x09f5('0x7'),'as':_0x09f5('0xb'),'attributes':['id',_0x09f5('0x9'),_0x09f5('0xa'),_0x09f5('0xc')]},{'model':_0x09f5('0xd'),'as':'Actions','attributes':['id',_0x09f5('0xe'),'data1',_0x09f5('0xf'),_0x09f5('0x10'),_0x09f5('0x11'),'data5',_0x09f5('0x12'),_0x09f5('0x13')]}]},'log':_0x09f5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 8c4e09b..49c168a 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 _0xa0e7=['GetTrunk','defaultuser','../client','getTrunks'];(function(_0x3cc552,_0x4f04c3){var _0x550969=function(_0x333124){while(--_0x333124){_0x3cc552['push'](_0x3cc552['shift']());}};_0x550969(++_0x4f04c3);}(_0xa0e7,0xaa));var _0x7a0e=function(_0x5da215,_0x5da150){_0x5da215=_0x5da215-0x0;var _0x3b0e8a=_0xa0e7[_0x5da215];return _0x3b0e8a;};'use strict';var client=require(_0x7a0e('0x0'));exports[_0x7a0e('0x1')]=function(_0x5eab55){return function(_0x114c23){return client['Request'](_0x7a0e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry',_0x7a0e('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x0048=['registry','defaultuser','getTrunks','Request','GetTrunk'];(function(_0x240992,_0x3291c0){var _0x3759b5=function(_0x86d4ff){while(--_0x86d4ff){_0x240992['push'](_0x240992['shift']());}};_0x3759b5(++_0x3291c0);}(_0x0048,0x129));var _0x8004=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x0048[_0x382168];return _0x3ecf7e;};'use strict';var client=require('../client');exports[_0x8004('0x0')]=function(_0x184b61){return function(_0x568043){return client[_0x8004('0x1')](_0x8004('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x8004('0x3'),_0x8004('0x4')]},'log':_0x8004('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index f9fe605..c346f33 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['internal','savePause','PauseUser','saveUnpause','UnpauseUser','ShowUser','getAgent','../client','getAgents','Request','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','GetUser','telephone'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe706,0xa3));var _0x6e70=function(_0x2a2166,_0x3a077f){_0x2a2166=_0x2a2166-0x0;var _0x3bcf50=_0xe706[_0x2a2166];return _0x3bcf50;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0x6e70('0x3')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6'),_0x6e70('0x7'),_0x6e70('0x8'),_0x6e70('0x9'),_0x6e70('0xa'),_0x6e70('0xb'),_0x6e70('0xc'),_0x6e70('0xd'),_0x6e70('0xe'),_0x6e70('0xf')]},'log':_0x6e70('0x1')});};};exports[_0x6e70('0x10')]=function(){return function(){return client[_0x6e70('0x2')](_0x6e70('0x11'),{'options':{'raw':!![],'where':{'role':_0x6e70('0x12')},'attributes':['id',_0x6e70('0x4'),_0x6e70('0x6'),_0x6e70('0x13')]},'log':_0x6e70('0x10')});};};exports[_0x6e70('0x14')]=function(_0x4600f9,_0x5b3d07,_0x47f6b2){return client[_0x6e70('0x2')](_0x6e70('0x15'),{'body':{'type':_0x5b3d07,'uniqueid':_0x47f6b2},'options':{'where':{'id':_0x4600f9['id']}},'log':_0x6e70('0x14')});};exports[_0x6e70('0x16')]=function(_0x3b38f3){return client[_0x6e70('0x2')](_0x6e70('0x17'),{'body':{},'options':{'where':{'id':_0x3b38f3['id']}},'log':_0x6e70('0x14')});};exports['getAgent']=function(_0x52737e){return client['Request'](_0x6e70('0x18'),{'options':{'raw':![],'where':{'role':'agent','id':_0x52737e},'attributes':['id','name',_0x6e70('0x5'),_0x6e70('0x6'),'fullname',_0x6e70('0x8'),'lastLoginAt',_0x6e70('0xa'),_0x6e70('0xb'),'voicePause','interface']},'log':_0x6e70('0x19')});}; \ No newline at end of file +var _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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xe706,0xa3));var _0x6e70=function(_0x44db60,_0x4ec8ca){_0x44db60=_0x44db60-0x0;var _0x3fa929=_0xe706[_0x44db60];return _0x3fa929;};'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 7d8abfd..fb6e872 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 _0xd21d=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x27b53e,_0x4320de){var _0x488a0c=function(_0x56fdaf){while(--_0x56fdaf){_0x27b53e['push'](_0x27b53e['shift']());}};_0x488a0c(++_0x4320de);}(_0xd21d,0x118));var _0xdd21=function(_0x3b2395,_0x1cf2c1){_0x3b2395=_0x3b2395-0x0;var _0x2e6751=_0xd21d[_0x3b2395];return _0x2e6751;};'use strict';var client=require('../client');exports[_0xdd21('0x0')]=function(_0x381236){return client[_0xdd21('0x1')](_0xdd21('0x2'),{'body':_0x381236,'log':'CreateVoiceAgentReport'});};exports[_0xdd21('0x3')]=function(_0x161905,_0x4e9f83,_0x108f91){return client[_0xdd21('0x1')](_0xdd21('0x4'),{'body':_0x161905,'options':{'where':{'uniqueid':_0x4e9f83,'interface':_0x108f91,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x9cd8=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x503f22,_0x58908b){var _0x6bfa9d=function(_0x30c5a3){while(--_0x30c5a3){_0x503f22['push'](_0x503f22['shift']());}};_0x6bfa9d(++_0x58908b);}(_0x9cd8,0x1c5));var _0x89cd=function(_0xf4faeb,_0x505c3e){_0xf4faeb=_0xf4faeb-0x0;var _0x31000d=_0x9cd8[_0xf4faeb];return _0x31000d;};'use strict';var client=require(_0x89cd('0x0'));exports[_0x89cd('0x1')]=function(_0x562b9a){return client[_0x89cd('0x2')](_0x89cd('0x3'),{'body':_0x562b9a,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x4528f0,_0x45c5f7,_0x104bd5){return client[_0x89cd('0x2')](_0x89cd('0x4'),{'body':_0x4528f0,'options':{'where':{'uniqueid':_0x45c5f7,'interface':_0x104bd5,'agentcomplete':!![]}},'log':_0x89cd('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index fd62e6e..0d2995e 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 _0xe610=['CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','Request','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create'];(function(_0x5581c9,_0x2f141b){var _0x404c93=function(_0x511056){while(--_0x511056){_0x5581c9['push'](_0x5581c9['shift']());}};_0x404c93(++_0x2f141b);}(_0xe610,0x1df));var _0x0e61=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe610[_0x397e5f];return _0x5302b8;};'use strict';var moment=require(_0x0e61('0x0'));var util=require('util');var _=require(_0x0e61('0x1'));var client=require(_0x0e61('0x2'));exports[_0x0e61('0x3')]=function(_0x14c64c){return client['Request'](_0x0e61('0x4'),{'body':_[_0x0e61('0x5')](_0x14c64c,{'source':_0x14c64c[_0x0e61('0x6')],'destinationcontext':_0x14c64c[_0x0e61('0x7')],'callerid':_0x14c64c['callerid'],'amaflags':_0x0e61('0x8')}),'log':_0x0e61('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x0e61('0x9')](_0x0e61('0xa'),{'options':{'where':{'type':[_0x0e61('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x0e61('0xc'))[_0x0e61('0xd')](_0x0e61('0xe')),moment()[_0x0e61('0xf')](_0x0e61('0xc'))[_0x0e61('0xd')](_0x0e61('0xe'))]}},'attributes':[_0x0e61('0x10'),_0x0e61('0x11'),_0x0e61('0x12'),_0x0e61('0x13')]},'log':_0x0e61('0x14')});};}; \ No newline at end of file +var _0xbf02=['callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','format','type','duration','GetVoiceCallReports','moment','util','lodash','../client','Request','merge','context'];(function(_0x4adfa4,_0x121c5a){var _0x14cec1=function(_0x4fd975){while(--_0x4fd975){_0x4adfa4['push'](_0x4adfa4['shift']());}};_0x14cec1(++_0x121c5a);}(_0xbf02,0xb6));var _0x2bf0=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xbf02[_0x500419];return _0x241c1a;};'use strict';var moment=require(_0x2bf0('0x0'));var util=require(_0x2bf0('0x1'));var _=require(_0x2bf0('0x2'));var client=require(_0x2bf0('0x3'));exports['create']=function(_0x1c3cd3){return client[_0x2bf0('0x4')]('CreateVoiceCallReport',{'body':_[_0x2bf0('0x5')](_0x1c3cd3,{'source':_0x1c3cd3['calleridnum'],'destinationcontext':_0x1c3cd3[_0x2bf0('0x6')],'callerid':_0x1c3cd3[_0x2bf0('0x7')],'amaflags':_0x2bf0('0x8')}),'log':_0x2bf0('0x9')});};exports[_0x2bf0('0xa')]=function(){return function(){return client[_0x2bf0('0x4')](_0x2bf0('0xb'),{'options':{'where':{'type':[_0x2bf0('0xc')],'createdAt':{'$between':[moment()[_0x2bf0('0xd')](_0x2bf0('0xe'))['format'](_0x2bf0('0xf')),moment()[_0x2bf0('0x10')](_0x2bf0('0xe'))[_0x2bf0('0x11')](_0x2bf0('0xf'))]}},'attributes':[_0x2bf0('0x12'),'disposition',_0x2bf0('0x13'),'billableseconds']},'log':_0x2bf0('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f5452e2..76a2264 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 _0xb536=['Request','CreateVoiceDialReport','../client','create'];(function(_0xa12088,_0x2ae726){var _0xff19c=function(_0x2ddc87){while(--_0x2ddc87){_0xa12088['push'](_0xa12088['shift']());}};_0xff19c(++_0x2ae726);}(_0xb536,0x19a));var _0x6b53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb536[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6b53('0x0'));exports[_0x6b53('0x1')]=function(_0x2ec711){return client[_0x6b53('0x2')](_0x6b53('0x3'),{'body':_0x2ec711,'log':_0x6b53('0x3')});}; \ No newline at end of file +var _0x21ce=['../client','Request','CreateVoiceDialReport'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x21ce,0x132));var _0xe21c=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x21ce[_0x1e4360];return _0x31e6b4;};'use strict';var client=require(_0xe21c('0x0'));exports['create']=function(_0x2a963e){return client[_0xe21c('0x1')]('CreateVoiceDialReport',{'body':_0x2a963e,'log':_0xe21c('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index ebc276c..6ad3bb3 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 _0x3f19=['../client','exten','getVoiceExtensions'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x3f19,0xc0));var _0x93f1=function(_0x3a441a,_0x43eb56){_0x3a441a=_0x3a441a-0x0;var _0x3128a2=_0x3f19[_0x3a441a];return _0x3128a2;};'use strict';var client=require(_0x93f1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x93f1('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x93f1('0x2')});};}; \ No newline at end of file +var _0x3f19=['../client','exten','getVoiceExtensions'];(function(_0x113a6c,_0x10df30){var _0x1ac632=function(_0xbd4fb9){while(--_0xbd4fb9){_0x113a6c['push'](_0x113a6c['shift']());}};_0x1ac632(++_0x10df30);}(_0x3f19,0xc0));var _0x93f1=function(_0x1aa277,_0x1edd4f){_0x1aa277=_0x1aa277-0x0;var _0x2f21e5=_0x3f19[_0x1aa277];return _0x2f21e5;};'use strict';var client=require(_0x93f1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x93f1('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x93f1('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index e655e02..188e52c 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 _0x89bb=['dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','active','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','Request','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x3055a2,_0xc1dfaa){var _0x465c2a=function(_0x49f6c4){while(--_0x49f6c4){_0x3055a2['push'](_0x3055a2['shift']());}};_0x465c2a(++_0xc1dfaa);}(_0x89bb,0x1c2));var _0xb89b=function(_0x4daaa5,_0x38bdb6){_0x4daaa5=_0x4daaa5-0x0;var _0x359ae1=_0x89bb[_0x4daaa5];return _0x359ae1;};'use strict';var client=require(_0xb89b('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0xb89b('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xb89b('0x2'),_0xb89b('0x3'),'monitor_format',_0xb89b('0x4'),_0xb89b('0x5'),_0xb89b('0x6'),_0xb89b('0x7'),_0xb89b('0x8'),_0xb89b('0x9'),_0xb89b('0xa'),_0xb89b('0xb'),_0xb89b('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0xb89b('0xd'),_0xb89b('0xe'),'dialQueueTimeout',_0xb89b('0xf'),'dialCongestionMaxRetry',_0xb89b('0x10'),_0xb89b('0x11'),_0xb89b('0x12'),'dialNoAnswerMaxRetry',_0xb89b('0x13'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix',_0xb89b('0x14'),_0xb89b('0x15'),_0xb89b('0x16'),_0xb89b('0x17'),_0xb89b('0x18'),_0xb89b('0x19'),_0xb89b('0x1a'),_0xb89b('0x1b'),_0xb89b('0x1c'),_0xb89b('0x1d'),_0xb89b('0x1e'),_0xb89b('0x1f'),_0xb89b('0x20'),'dialRecallInQueue',_0xb89b('0x21'),_0xb89b('0x22'),'dialAgiAfterHangupClient','dialQueueProject2',_0xb89b('0x23'),_0xb89b('0x24'),_0xb89b('0x25'),'dialCutDigit',_0xb89b('0x26'),_0xb89b('0x27'),_0xb89b('0x28'),'dialDropRetryFrequency',_0xb89b('0x29'),_0xb89b('0x2a'),_0xb89b('0x2b'),_0xb89b('0x2c'),_0xb89b('0x2d'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0xb89b('0x2e'),_0xb89b('0x2f'),_0xb89b('0x30'),_0xb89b('0x31')],'include':[{'model':_0xb89b('0x32'),'as':_0xb89b('0x32'),'attributes':['id',_0xb89b('0x33'),'callerid',_0xb89b('0x34')]},{'model':'Pause','as':_0xb89b('0x35'),'attributes':['id','name']},{'model':'Trunk','as':_0xb89b('0x36'),'attributes':['id','name',_0xb89b('0x37'),_0xb89b('0x34')]},{'model':_0xb89b('0x38'),'as':'Interval','attributes':['id',_0xb89b('0x33')],'include':[{'model':_0xb89b('0x38'),'as':_0xb89b('0x39'),'attributes':['id','name',_0xb89b('0x3a')]}]}]},'log':_0xb89b('0x3b')});};}; \ No newline at end of file +var _0x2991=['dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Intervals','../client','Request','name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x37c098,_0x5ec0d){var _0x250aa8=function(_0x4cc701){while(--_0x4cc701){_0x37c098['push'](_0x37c098['shift']());}};_0x250aa8(++_0x5ec0d);}(_0x2991,0x132));var _0x1299=function(_0x22f698,_0x32071e){_0x22f698=_0x22f698-0x0;var _0x39d723=_0x2991[_0x22f698];return _0x39d723;};'use strict';var client=require(_0x1299('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x1299('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x1299('0x2'),_0x1299('0x3'),_0x1299('0x4'),'autopause',_0x1299('0x5'),'type',_0x1299('0x6'),_0x1299('0x7'),'dialLimitChannel',_0x1299('0x8'),_0x1299('0x9'),_0x1299('0xa'),'dialPredictiveOptimizationPercentage',_0x1299('0xb'),'dialOriginateCallerIdName',_0x1299('0xc'),_0x1299('0xd'),_0x1299('0xe'),'dialQueueTimeout','dialQueueProject',_0x1299('0xf'),'dialCongestionRetryFrequency',_0x1299('0x10'),_0x1299('0x11'),'dialNoAnswerMaxRetry',_0x1299('0x12'),'dialGlobalMaxRetry',_0x1299('0x13'),_0x1299('0x14'),_0x1299('0x15'),'dialCheckDuplicateType','dialAMDActive',_0x1299('0x16'),_0x1299('0x17'),_0x1299('0x18'),_0x1299('0x19'),_0x1299('0x1a'),_0x1299('0x1b'),'dialAMDMaximumNumberOfWords',_0x1299('0x1c'),_0x1299('0x1d'),'timeout',_0x1299('0x1e'),_0x1299('0x1f'),_0x1299('0x20'),'dialAgiAfterHangupAgent',_0x1299('0x21'),_0x1299('0x22'),_0x1299('0x5'),_0x1299('0x23'),'dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry',_0x1299('0x24'),_0x1299('0x25'),_0x1299('0x26'),_0x1299('0x27'),_0x1299('0x28'),_0x1299('0x29'),_0x1299('0x2a'),_0x1299('0x2b'),_0x1299('0x2c'),'mandatoryDisposition',_0x1299('0x2d'),_0x1299('0x2e'),_0x1299('0x2f'),_0x1299('0x30')],'include':[{'model':_0x1299('0x31'),'as':'Trunk','attributes':['id','name',_0x1299('0x32'),'active']},{'model':_0x1299('0x33'),'as':_0x1299('0x34'),'attributes':['id','name']},{'model':_0x1299('0x31'),'as':_0x1299('0x35'),'attributes':['id',_0x1299('0x2'),_0x1299('0x32'),_0x1299('0x36')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':'Interval','as':_0x1299('0x37'),'attributes':['id','name','interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a363805..8a64b8f 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(_0x3467fb,_0x3b6601){var _0x51981f=function(_0x60f88d){while(--_0x60f88d){_0x3467fb['push'](_0x3467fb['shift']());}};_0x51981f(++_0x3b6601);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x5878d1,_0x57ea11){var _0x1a366c=function(_0x831131){while(--_0x831131){_0x5878d1['push'](_0x5878d1['shift']());}};_0x1a366c(++_0x57ea11);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 50f75a8..838630c 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 _0xec5e=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x35ad40,_0x51a847){var _0xf1acc=function(_0x38dc08){while(--_0x38dc08){_0x35ad40['push'](_0x35ad40['shift']());}};_0xf1acc(++_0x51a847);}(_0xec5e,0x1bf));var _0xeec5=function(_0x99190,_0x18a327){_0x99190=_0x99190-0x0;var _0x50af10=_0xec5e[_0x99190];return _0x50af10;};'use strict';var client=require(_0xeec5('0x0'));exports[_0xeec5('0x1')]=function(_0x46e89a){return function(){return client[_0xeec5('0x2')](_0xeec5('0x3'),{'options':{'where':{'VoiceQueueId':_0x46e89a,'paused':!![]},'raw':!![]},'log':_0xeec5('0x1')});};}; \ No newline at end of file +var _0xe19f=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x438b39,_0x4a16f1){var _0x511bfd=function(_0x37ec6e){while(--_0x37ec6e){_0x438b39['push'](_0x438b39['shift']());}};_0x511bfd(++_0x4a16f1);}(_0xe19f,0x90));var _0xfe19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe19f[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports[_0xfe19('0x0')]=function(_0x9642aa){return function(){return client[_0xfe19('0x1')](_0xfe19('0x2'),{'options':{'where':{'VoiceQueueId':_0x9642aa,'paused':!![]},'raw':!![]},'log':_0xfe19('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 8d8981b..1529fa5 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(_0x1165ac,_0x1fc27e){var _0x40b09d=function(_0x36d8c5){while(--_0x36d8c5){_0x1165ac['push'](_0x1165ac['shift']());}};_0x40b09d(++_0x1fc27e);}(_0x7a54,0x106));var _0x47a5=function(_0x52cdb1,_0xc2aaf7){_0x52cdb1=_0x52cdb1-0x0;var _0x4cabd7=_0x7a54[_0x52cdb1];return _0x4cabd7;};'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(_0xa84dee,_0x4db734){var _0x509890=function(_0x5b2e11){while(--_0x5b2e11){_0xa84dee['push'](_0xa84dee['shift']());}};_0x509890(++_0x4db734);}(_0x7a54,0x106));var _0x47a5=function(_0x1bbd24,_0x2951b6){_0x1bbd24=_0x1bbd24-0x0;var _0x317623=_0x7a54[_0x1bbd24];return _0x317623;};'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 d59ecc9..def8f55 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 _0xab27=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x4df1bc,_0x1ae554){var _0x428b59=function(_0x212b79){while(--_0x212b79){_0x4df1bc['push'](_0x4df1bc['shift']());}};_0x428b59(++_0x1ae554);}(_0xab27,0x104));var _0x7ab2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab27[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7ab2('0x0'));exports[_0x7ab2('0x1')]={};exports[_0x7ab2('0x2')]=function(_0x45bd1d){return client[_0x7ab2('0x3')](_0x7ab2('0x4'),{'body':{'result':_0x45bd1d['result'],'transfererchannel':_0x45bd1d[_0x7ab2('0x5')],'transferercalleridnum':_0x45bd1d[_0x7ab2('0x6')],'transferercalleridname':_0x45bd1d[_0x7ab2('0x7')],'transfererconnectedlinenum':_0x45bd1d['transfererconnectedlinenum'],'transfererconnectedlinename':_0x45bd1d[_0x7ab2('0x8')],'transfereraccountcode':_0x45bd1d[_0x7ab2('0x9')],'transferercontext':_0x45bd1d[_0x7ab2('0xa')],'transfererexten':_0x45bd1d[_0x7ab2('0xb')],'transfererlinkedid':_0x45bd1d['transfererlinkedid'],'transfereechannel':_0x45bd1d[_0x7ab2('0xc')],'transfereecalleridnum':_0x45bd1d[_0x7ab2('0xd')],'transfereecalleridname':_0x45bd1d[_0x7ab2('0xe')],'transfereeconnectedlinenum':_0x45bd1d[_0x7ab2('0xf')],'transfereeconnectedlinename':_0x45bd1d[_0x7ab2('0x10')],'transfereeaccountcode':_0x45bd1d[_0x7ab2('0x11')],'transfereecontext':_0x45bd1d[_0x7ab2('0x12')],'transfereeexten':_0x45bd1d[_0x7ab2('0x13')],'transfereelinkedid':_0x45bd1d[_0x7ab2('0x14')],'isexternal':_0x45bd1d['isexternal'],'context':_0x45bd1d[_0x7ab2('0x15')],'extension':_0x45bd1d['extension'],'type':'blind'},'log':_0x7ab2('0x4')});};exports[_0x7ab2('0x16')]=function(_0x25880e){return client[_0x7ab2('0x3')](_0x7ab2('0x4'),{'body':{'result':_0x25880e[_0x7ab2('0x17')],'transfererchannel':_0x25880e[_0x7ab2('0x18')],'transferercalleridnum':_0x25880e[_0x7ab2('0x19')],'transferercalleridname':_0x25880e[_0x7ab2('0x1a')],'transfererconnectedlinenum':_0x25880e[_0x7ab2('0x1b')],'transfererconnectedlinename':_0x25880e['secondtransfererconnectedlinename'],'transfereraccountcode':_0x25880e['origtransfereraccountcode'],'transferercontext':_0x25880e[_0x7ab2('0x1c')],'transfererexten':_0x25880e['secondtransfererexten'],'transfererlinkedid':_0x25880e[_0x7ab2('0x1d')],'transfereechannel':_0x25880e[_0x7ab2('0x1e')],'transfereecalleridnum':_0x25880e[_0x7ab2('0x1f')],'transfereecalleridname':_0x25880e[_0x7ab2('0x20')],'transfereeconnectedlinenum':_0x25880e[_0x7ab2('0x21')],'transfereeconnectedlinename':_0x25880e[_0x7ab2('0x22')],'transfereeaccountcode':_0x25880e[_0x7ab2('0x23')],'transfereecontext':_0x25880e[_0x7ab2('0x24')],'transfereeexten':_0x25880e[_0x7ab2('0x25')],'transfereelinkedid':_0x25880e[_0x7ab2('0x26')],'isexternal':_0x25880e[_0x7ab2('0x27')],'context':_0x25880e['origtransferercontext'],'extension':_0x25880e[_0x7ab2('0x28')],'type':_0x7ab2('0x29')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x913d=['transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','context','extension','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname'];(function(_0x48fd1a,_0xd7764c){var _0x561d03=function(_0x13d57a){while(--_0x13d57a){_0x48fd1a['push'](_0x48fd1a['shift']());}};_0x561d03(++_0xd7764c);}(_0x913d,0xdc));var _0xd913=function(_0x4020ae,_0x377a4a){_0x4020ae=_0x4020ae-0x0;var _0x303fa1=_0x913d[_0x4020ae];return _0x303fa1;};'use strict';var client=require('../client');exports[_0xd913('0x0')]={};exports[_0xd913('0x1')]=function(_0x3eeb09){return client[_0xd913('0x2')](_0xd913('0x3'),{'body':{'result':_0x3eeb09[_0xd913('0x4')],'transfererchannel':_0x3eeb09[_0xd913('0x5')],'transferercalleridnum':_0x3eeb09[_0xd913('0x6')],'transferercalleridname':_0x3eeb09[_0xd913('0x7')],'transfererconnectedlinenum':_0x3eeb09[_0xd913('0x8')],'transfererconnectedlinename':_0x3eeb09[_0xd913('0x9')],'transfereraccountcode':_0x3eeb09[_0xd913('0xa')],'transferercontext':_0x3eeb09['transferercontext'],'transfererexten':_0x3eeb09[_0xd913('0xb')],'transfererlinkedid':_0x3eeb09['transfererlinkedid'],'transfereechannel':_0x3eeb09[_0xd913('0xc')],'transfereecalleridnum':_0x3eeb09[_0xd913('0xd')],'transfereecalleridname':_0x3eeb09[_0xd913('0xe')],'transfereeconnectedlinenum':_0x3eeb09['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3eeb09['transfereeconnectedlinename'],'transfereeaccountcode':_0x3eeb09[_0xd913('0xf')],'transfereecontext':_0x3eeb09[_0xd913('0x10')],'transfereeexten':_0x3eeb09['transfereeexten'],'transfereelinkedid':_0x3eeb09['transfereelinkedid'],'isexternal':_0x3eeb09['isexternal'],'context':_0x3eeb09[_0xd913('0x11')],'extension':_0x3eeb09[_0xd913('0x12')],'type':_0xd913('0x13')},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x3cb638){return client[_0xd913('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x3cb638[_0xd913('0x4')],'transfererchannel':_0x3cb638[_0xd913('0x14')],'transferercalleridnum':_0x3cb638[_0xd913('0x15')],'transferercalleridname':_0x3cb638[_0xd913('0x16')],'transfererconnectedlinenum':_0x3cb638['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3cb638[_0xd913('0x17')],'transfereraccountcode':_0x3cb638[_0xd913('0x18')],'transferercontext':_0x3cb638['secondtransferercontext'],'transfererexten':_0x3cb638[_0xd913('0x19')],'transfererlinkedid':_0x3cb638['origtransfererlinkedid'],'transfereechannel':_0x3cb638[_0xd913('0x1a')],'transfereecalleridnum':_0x3cb638[_0xd913('0x1b')],'transfereecalleridname':_0x3cb638[_0xd913('0x1c')],'transfereeconnectedlinenum':_0x3cb638['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3cb638[_0xd913('0x1d')],'transfereeaccountcode':_0x3cb638[_0xd913('0x1e')],'transfereecontext':_0x3cb638[_0xd913('0x1f')],'transfereeexten':_0x3cb638[_0xd913('0x20')],'transfereelinkedid':_0x3cb638[_0xd913('0x21')],'isexternal':_0x3cb638[_0xd913('0x22')],'context':_0x3cb638[_0xd913('0x23')],'extension':_0x3cb638[_0xd913('0x24')],'type':_0xd913('0x25')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 2e3e02c..c887dc7 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 _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(_0x2cce01,_0x7e5089){var _0x3054ca=function(_0x7580ac){while(--_0x7580ac){_0x2cce01['push'](_0x2cce01['shift']());}};_0x3054ca(++_0x7e5089);}(_0xb10b,0x12a));var _0xbb10=function(_0x27999e,_0x1cbbd2){_0x27999e=_0x27999e-0x0;var _0x19498d=_0xb10b[_0x27999e];return _0x19498d;};'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 +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(_0x575677,_0x1cb0f7){var _0x1d3967=function(_0x376f01){while(--_0x376f01){_0x575677['push'](_0x575677['shift']());}};_0x1d3967(++_0x1cb0f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x308944,_0x1c462e){_0x308944=_0x308944-0x0;var _0x2bf805=_0xb10b[_0x308944];return _0x2bf805;};'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 8155fec..d7df4a7 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 _0x94ee=['uniqueid','[CM][%s][%s]\x20Contact\x20not\x20found','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','push','format','name','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s'];(function(_0x60c50b,_0x208bec){var _0x3b8588=function(_0x2f8a66){while(--_0x2f8a66){_0x60c50b['push'](_0x60c50b['shift']());}};_0x3b8588(++_0x208bec);}(_0x94ee,0x11d));var _0xe94e=function(_0x1700f4,_0x5df6a9){_0x1700f4=_0x1700f4-0x0;var _0xe1d8b5=_0x94ee[_0x1700f4];return _0xe1d8b5;};'use strict';var _=require(_0xe94e('0x0'));var BPromise=require(_0xe94e('0x1'));var Redis=require(_0xe94e('0x2'));var util=require(_0xe94e('0x3'));var config=require(_0xe94e('0x4'));var logger=require('../../../../config/logger')(_0xe94e('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xe94e('0x6')]=_[_0xe94e('0x7')](config[_0xe94e('0x6')],{'host':_0xe94e('0x8'),'port':0x18eb});var io=require(_0xe94e('0x9'))(new Redis(config['redis']));function emit(_0x5e0c91,_0x23c34e,_0x574102,_0x29ca7d,_0x25b017){logger[_0xe94e('0xa')]('[CM][%s][%s]',_0x5e0c91,_0x23c34e['id'],_0x574102,_0x29ca7d,JSON['stringify'](_0x25b017));io['to'](_0x574102)[_0xe94e('0xb')](_0x29ca7d,_0x25b017);}exports[_0xe94e('0xc')]=function(_0x11503f,_0x2d716b,_0x152257,_0x53c3f5){var _0x265d2b,_0x4fbcef;var _0x5af4c4={};var _0xe3c97d;var _0x227568=Number(_0x152257[_0xe94e('0xd')]);var _0x4808b9=_0x152257[_0xe94e('0xe')]?Boolean(Number(_0x152257[_0xe94e('0xe')])):![];var _0x20d378;var _0x49c923=![];if(!_[_0xe94e('0xf')](_0x152257[_0xe94e('0x10')])){if(_0x152257[_0xe94e('0x10')]=='1')_0x49c923=!![];}if(!_0x49c923){if(_0x53c3f5[_0xe94e('0x11')]){_0x5af4c4['id']=_0x53c3f5[_0xe94e('0x11')];}}if(!_0x5af4c4['id']){_0x5af4c4[_0xe94e('0x12')]=_0x227568;_0x20d378=_0x152257[_0xe94e('0x13')]&&_0x152257[_0xe94e('0x13')]!=='0'?_0x152257[_0xe94e('0x13')][_0xe94e('0x14')](','):[_0xe94e('0x15')];_0x5af4c4[_0xe94e('0x16')]=_[_0xe94e('0x17')](_0x20d378,function(_0x28a54e){var _0x6fe901={};_0x6fe901[_0x28a54e]=_0x53c3f5[_0xe94e('0x18')]?_0x53c3f5[_0xe94e('0x19')]:_0x53c3f5[_0xe94e('0x1a')];return _0x6fe901;});_0xe3c97d=_0x53c3f5[_0xe94e('0x18')]?_0x53c3f5['destcalleridnum']:_0x53c3f5[_0xe94e('0x1a')];}var _0x22e7a3=['id',_0xe94e('0x1b'),'lastName',_0xe94e('0x15'),_0xe94e('0x1c'),_0xe94e('0x1d'),'ListId',_0xe94e('0x1e'),_0xe94e('0x1f'),_0xe94e('0x20')];var _0xa71046=_[_0xe94e('0x21')](_0x22e7a3,_0x20d378);BPromise[_0xe94e('0x22')]()[_0xe94e('0x23')](cmContactRpc[_0xe94e('0x24')]({'attributes':_0xa71046,'where':_0x5af4c4,'phone':_0xe3c97d}))['then'](function(_0x2853ae){_0x4fbcef=_0x2853ae;if(!_['isEmpty'](_0x4fbcef)){if(_0x4fbcef[_0xe94e('0x25')]===0x1){_0x265d2b=_0x4fbcef[0x0];logger[_0xe94e('0xa')](_0xe94e('0x26'),_0x53c3f5[_0xe94e('0x27')],_0x2d716b['id'],_0x265d2b['id']);}else{logger[_0xe94e('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x53c3f5['uniqueid'],_0x2d716b['id'],_[_0xe94e('0x17')](_0x4fbcef,'id')['join'](','));}return;}else{logger[_0xe94e('0xa')](_0xe94e('0x28'),_0x53c3f5[_0xe94e('0x27')],_0x2d716b['id']);var _0x495a8b={'ListId':_0x227568};var _0x5ad809=_0x152257['data4']&&_0x152257['data4']!=='0'?_0x152257['data4']:_0xe94e('0x15');if(_0x4808b9){logger[_0xe94e('0xa')](_0xe94e('0x29'),_0x53c3f5['uniqueid'],_0x2d716b['id']);_0x495a8b[_0x5ad809]=_[_0xe94e('0xf')](_0x53c3f5['routeId'])?_0x53c3f5['calleridnum']:_0x53c3f5[_0xe94e('0x19')];if(_[_0xe94e('0xf')](_0x53c3f5[_0xe94e('0x18')])){_0x495a8b[_0xe94e('0x1b')]=_0x53c3f5[_0xe94e('0x2a')]&&_0x53c3f5['calleridname']!==_0xe94e('0x2b')?_0x53c3f5[_0xe94e('0x2a')]:_0xe94e('0x2c');}else{_0x495a8b[_0xe94e('0x1b')]=_0x53c3f5['destcalleridname']&&_0x53c3f5['destcalleridname']!==''?_0x53c3f5[_0xe94e('0x2d')]:_0xe94e('0x2c');}return BPromise[_0xe94e('0x22')]()[_0xe94e('0x23')](cmContactRpc[_0xe94e('0x2e')](_0x495a8b))[_0xe94e('0x23')](function(_0x1b1dfd){_0x265d2b=_0x1b1dfd;_0x4fbcef['push'](_0x1b1dfd);if(_0x265d2b){logger['info'](_0xe94e('0x2f'),_0x53c3f5['uniqueid'],_0x2d716b['id'],_0x265d2b['id']);}return;});}else{logger[_0xe94e('0xa')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x53c3f5[_0xe94e('0x27')],_0x2d716b['id']);_0x495a8b[_0x5ad809]=_[_0xe94e('0xf')](_0x53c3f5[_0xe94e('0x18')])?_0x53c3f5['calleridnum']:_0x53c3f5['destcalleridnum'];if(_['isNil'](_0x53c3f5['routeId'])){_0x495a8b['firstName']=_0x53c3f5['calleridname']&&_0x53c3f5[_0xe94e('0x2a')]!==''?_0x53c3f5['calleridname']:_0xe94e('0x2c');}else{_0x495a8b[_0xe94e('0x1b')]=_0x53c3f5[_0xe94e('0x2d')]&&_0x53c3f5['destcalleridname']!==_0xe94e('0x2b')?_0x53c3f5[_0xe94e('0x2d')]:'Unknown';}_0x265d2b=_0x495a8b;_0x4fbcef[_0xe94e('0x30')](_0x495a8b);return;}}})[_0xe94e('0x23')](function(){if(_0x11503f){emit(_0x53c3f5[_0xe94e('0x27')],_0x2d716b,util[_0xe94e('0x31')]('user:%s',_0x11503f[_0xe94e('0x32')]),util[_0xe94e('0x31')](_0xe94e('0x33'),_0x152257['action'][_0xe94e('0x34')]()),{'evt':_[_0xe94e('0x35')](_0x53c3f5,{'autoCreate':_0x4808b9}),'contact':_0x265d2b===undefined?{}:_0x265d2b,'contacts':_0x4fbcef['length']===0x0?undefined:_0x4fbcef});}});}; \ No newline at end of file +var _0x18ec=['destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','','format','user:%s','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','data1','data2','isNil','data5','ListId','data3','split','destcalleridnum','calleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','Unknown'];(function(_0x448086,_0x1cea96){var _0x33f585=function(_0x3f55b6){while(--_0x3f55b6){_0x448086['push'](_0x448086['shift']());}};_0x33f585(++_0x1cea96);}(_0x18ec,0x6c));var _0xc18e=function(_0xd67cc9,_0x66ef86){_0xd67cc9=_0xd67cc9-0x0;var _0x4409de=_0x18ec[_0xd67cc9];return _0x4409de;};'use strict';var _=require(_0xc18e('0x0'));var BPromise=require(_0xc18e('0x1'));var Redis=require(_0xc18e('0x2'));var util=require(_0xc18e('0x3'));var config=require('../../../../config/environment');var logger=require(_0xc18e('0x4'))(_0xc18e('0x5'));var cmContactRpc=require(_0xc18e('0x6'));config[_0xc18e('0x7')]=_['defaults'](config[_0xc18e('0x7')],{'host':_0xc18e('0x8'),'port':0x18eb});var io=require(_0xc18e('0x9'))(new Redis(config[_0xc18e('0x7')]));function emit(_0x43a65a,_0x59cd9f,_0xbec8ad,_0x34342f,_0x21fd26){logger[_0xc18e('0xa')](_0xc18e('0xb'),_0x43a65a,_0x59cd9f['id'],_0xbec8ad,_0x34342f,JSON['stringify'](_0x21fd26));io['to'](_0xbec8ad)[_0xc18e('0xc')](_0x34342f,_0x21fd26);}exports['exec']=function(_0x2fd42a,_0x1a0b70,_0x25adcc,_0x2486c1){var _0x288bad,_0x552fa7;var _0x5bb166={};var _0x271b4f;var _0x48a445=Number(_0x25adcc[_0xc18e('0xd')]);var _0x5c112a=_0x25adcc[_0xc18e('0xe')]?Boolean(Number(_0x25adcc[_0xc18e('0xe')])):![];var _0x592a2d;var _0x3a3ca0=![];if(!_[_0xc18e('0xf')](_0x25adcc[_0xc18e('0x10')])){if(_0x25adcc['data5']=='1')_0x3a3ca0=!![];}if(!_0x3a3ca0){if(_0x2486c1['xmd-contactid']){_0x5bb166['id']=_0x2486c1['xmd-contactid'];}}if(!_0x5bb166['id']){_0x5bb166[_0xc18e('0x11')]=_0x48a445;_0x592a2d=_0x25adcc['data3']&&_0x25adcc[_0xc18e('0x12')]!=='0'?_0x25adcc[_0xc18e('0x12')][_0xc18e('0x13')](','):['phone'];_0x5bb166['$or']=_['map'](_0x592a2d,function(_0x450689){var _0x4cd1bd={};_0x4cd1bd[_0x450689]=_0x2486c1['routeId']?_0x2486c1[_0xc18e('0x14')]:_0x2486c1[_0xc18e('0x15')];return _0x4cd1bd;});_0x271b4f=_0x2486c1['routeId']?_0x2486c1[_0xc18e('0x14')]:_0x2486c1[_0xc18e('0x15')];}var _0x701ba9=['id',_0xc18e('0x16'),_0xc18e('0x17'),_0xc18e('0x18'),'mobile',_0xc18e('0x19'),_0xc18e('0x11'),'createdAt',_0xc18e('0x1a'),_0xc18e('0x1b')];var _0x91dd6a=_[_0xc18e('0x1c')](_0x701ba9,_0x592a2d);BPromise[_0xc18e('0x1d')]()[_0xc18e('0x1e')](cmContactRpc[_0xc18e('0x1f')]({'attributes':_0x91dd6a,'where':_0x5bb166,'phone':_0x271b4f}))[_0xc18e('0x1e')](function(_0x4707a3){_0x552fa7=_0x4707a3;if(!_['isEmpty'](_0x552fa7)){if(_0x552fa7[_0xc18e('0x20')]===0x1){_0x288bad=_0x552fa7[0x0];logger['info'](_0xc18e('0x21'),_0x2486c1[_0xc18e('0x22')],_0x1a0b70['id'],_0x288bad['id']);}else{logger['info'](_0xc18e('0x23'),_0x2486c1[_0xc18e('0x22')],_0x1a0b70['id'],_['map'](_0x552fa7,'id')[_0xc18e('0x24')](','));}return;}else{logger[_0xc18e('0xa')]('[CM][%s][%s]\x20Contact\x20not\x20found',_0x2486c1['uniqueid'],_0x1a0b70['id']);var _0x119046={'ListId':_0x48a445};var _0x1e044e=_0x25adcc[_0xc18e('0x25')]&&_0x25adcc[_0xc18e('0x25')]!=='0'?_0x25adcc[_0xc18e('0x25')]:_0xc18e('0x18');if(_0x5c112a){logger['info'](_0xc18e('0x26'),_0x2486c1[_0xc18e('0x22')],_0x1a0b70['id']);_0x119046[_0x1e044e]=_[_0xc18e('0xf')](_0x2486c1[_0xc18e('0x27')])?_0x2486c1['calleridnum']:_0x2486c1[_0xc18e('0x14')];if(_['isNil'](_0x2486c1[_0xc18e('0x27')])){_0x119046[_0xc18e('0x16')]=_0x2486c1[_0xc18e('0x28')]&&_0x2486c1[_0xc18e('0x28')]!==''?_0x2486c1[_0xc18e('0x28')]:_0xc18e('0x29');}else{_0x119046['firstName']=_0x2486c1['destcalleridname']&&_0x2486c1[_0xc18e('0x2a')]!==''?_0x2486c1[_0xc18e('0x2a')]:_0xc18e('0x29');}return BPromise[_0xc18e('0x1d')]()['then'](cmContactRpc[_0xc18e('0x2b')](_0x119046))[_0xc18e('0x1e')](function(_0x481db5){_0x288bad=_0x481db5;_0x552fa7[_0xc18e('0x2c')](_0x481db5);if(_0x288bad){logger[_0xc18e('0xa')](_0xc18e('0x2d'),_0x2486c1[_0xc18e('0x22')],_0x1a0b70['id'],_0x288bad['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2486c1[_0xc18e('0x22')],_0x1a0b70['id']);_0x119046[_0x1e044e]=_['isNil'](_0x2486c1[_0xc18e('0x27')])?_0x2486c1['calleridnum']:_0x2486c1[_0xc18e('0x14')];if(_[_0xc18e('0xf')](_0x2486c1[_0xc18e('0x27')])){_0x119046[_0xc18e('0x16')]=_0x2486c1[_0xc18e('0x28')]&&_0x2486c1[_0xc18e('0x28')]!==_0xc18e('0x2e')?_0x2486c1[_0xc18e('0x28')]:_0xc18e('0x29');}else{_0x119046[_0xc18e('0x16')]=_0x2486c1[_0xc18e('0x2a')]&&_0x2486c1['destcalleridname']!==_0xc18e('0x2e')?_0x2486c1[_0xc18e('0x2a')]:_0xc18e('0x29');}_0x288bad=_0x119046;_0x552fa7[_0xc18e('0x2c')](_0x119046);return;}}})['then'](function(){if(_0x2fd42a){emit(_0x2486c1[_0xc18e('0x22')],_0x1a0b70,util[_0xc18e('0x2f')](_0xc18e('0x30'),_0x2fd42a['name']),util[_0xc18e('0x2f')]('trigger:%s',_0x25adcc['action']['toLowerCase']()),{'evt':_[_0xc18e('0x31')](_0x2486c1,{'autoCreate':_0x5c112a}),'contact':_0x288bad===undefined?{}:_0x288bad,'contacts':_0x552fa7['length']===0x0?undefined:_0x552fa7});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 88acd7f..fa594bf 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 _0x33b9=['Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','uri','buildUri','isNil','data3','data4','location','windowWidth','data5','800','data6','600','winapp','winApplication','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','exec','integration','queue','urlforward','script','search','replace','AllConditions','channel','AnyConditions','some','checkTrigger:\x20trigger','field','account','chat','ChatWebsiteId','operator','value','upperFirst','event','agent','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','redis','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','checkTrigger','variables','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x33b9,0x138));var _0x933b=function(_0xad0505,_0x208f4f){_0xad0505=_0xad0505-0x0;var _0x4b4338=_0x33b9[_0xad0505];return _0x4b4338;};'use strict';var util=require('util');var _=require(_0x933b('0x0'));var url=require(_0x933b('0x1'));var Mustache=require(_0x933b('0x2'));var Redis=require(_0x933b('0x3'));var urlforward=require(_0x933b('0x4'));var integration=require(_0x933b('0x5'));var cmContact=require(_0x933b('0x6'));var script=require(_0x933b('0x7'));var config=require(_0x933b('0x8'));var logger=require('../../../config/logger')(_0x933b('0x9'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x933b('0xa')],{'host':_0x933b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x933b('0xa')]));var operators={'equals':function(_0x4e7ea8,_0x187b40){return _0x4e7ea8==_0x187b40;},'not_equals':function(_0x1d0824,_0x52a81d){return _0x1d0824!=_0x52a81d;}};var barAndWebActions=[_0x933b('0xc'),_0x933b('0x1'),'winapp'];function Trigger(_0x3571dc){this[_0x933b('0xd')]=_0x3571dc[_0x933b('0xd')];this[_0x933b('0xe')]=_0x3571dc[_0x933b('0xe')];this[_0x933b('0xf')]=_0x3571dc['voiceQueues'];this[_0x933b('0x10')]=_0x3571dc[_0x933b('0x10')];this[_0x933b('0x11')]=_0x3571dc[_0x933b('0x11')];this[_0x933b('0x12')]=_0x3571dc[_0x933b('0x12')];this['freshdeskAccounts']=_0x3571dc['freshdeskAccounts'];this[_0x933b('0x13')]=_0x3571dc[_0x933b('0x13')];this[_0x933b('0x14')]=_0x3571dc[_0x933b('0x14')];this[_0x933b('0x15')]=_0x3571dc[_0x933b('0x15')];this[_0x933b('0x16')]=_0x3571dc[_0x933b('0x16')];this[_0x933b('0x17')]=_0x3571dc[_0x933b('0x17')];this[_0x933b('0x18')]=_0x3571dc[_0x933b('0x18')];this[_0x933b('0x19')]=_0x3571dc[_0x933b('0x19')];this['freshsalesAccounts']=_0x3571dc[_0x933b('0x1a')];this[_0x933b('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x933b('0x1c')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x933b('0x15')],'desk':this[_0x933b('0x16')],'vtiger':this[_0x933b('0x17')],'dynamics365':this[_0x933b('0x19')],'freshsales':this[_0x933b('0x1a')],'servicenow':this[_0x933b('0x18')]};ami['on'](_0x933b('0x1d'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x20'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x21'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x22'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x23'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x933b('0x1f')](this));ami['on'](_0x933b('0x24'),this['syncCustomEvent'][_0x933b('0x1f')](this));ami['on']('custom:agentreject',this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x25'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x26'),this[_0x933b('0x1e')]['bind'](this));ami['on'](_0x933b('0x27'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x28'),this[_0x933b('0x29')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2a'),this['syncAgentDial'][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2b'),this[_0x933b('0x29')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2c'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0x933b('0x2e'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2f'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x30'),this[_0x933b('0x1e')]['bind'](this));ami['on'](_0x933b('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x933b('0x32'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x33'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));}Trigger[_0x933b('0x34')]['emit']=function(_0x2c75c3,_0x562092,_0x210e0c){logger[_0x933b('0x35')](_0x2c75c3,_0x562092,JSON[_0x933b('0x36')](_0x210e0c));io['to'](_0x2c75c3)[_0x933b('0x37')](_0x562092,_0x210e0c);};Trigger[_0x933b('0x34')][_0x933b('0x1e')]=function(_0x1b968d){var _0x160682=_[_0x933b('0x38')](_0x1b968d);if(typeof _0x160682[_0x933b('0x39')]===_0x933b('0x3a')){_0x160682[_0x933b('0x39')]=_0x933b('0x3b');}logger[_0x933b('0x3c')]('syncCustomEvent',util[_0x933b('0x3d')](_0x160682,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x160682);};Trigger[_0x933b('0x34')]['syncAgentDial']=function(_0x1cc6ce){if(this[_0x933b('0xe')][_0x1cc6ce['interface']]){this[_0x933b('0x1e')](_0x1cc6ce);}};Trigger[_0x933b('0x34')][_0x933b('0x3e')]=function(_0x2d0a28){var _0x25e235;for(var _0x14fc07 in this[_0x933b('0xd')]){if(this[_0x933b('0xd')]['hasOwnProperty'](_0x14fc07)){if(this[_0x933b('0xd')][_0x14fc07]['status']){_0x25e235=this[_0x933b('0x3f')](this[_0x933b('0xd')][_0x14fc07],_0x2d0a28);if(_0x25e235){_['merge'](_0x2d0a28,_0x2d0a28[_0x933b('0x40')]);for(var _0xcc9e74=0x0,_0x33256a,_0x5393aa,_0xe0b074;_0xcc9e740x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});}; \ No newline at end of file +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x422205,_0x56e415){_0x422205=_0x422205-0x0;var _0x2a7299=_0xe14b[_0x422205];return _0x2a7299;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 33b6528..f181fbb 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 _0x5000=['toLowerCase','telephone1','GET','contacts?$select=','&$filter=','replace','%2b','nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','modernAuthentication','tenantId','CloudProvider','data2','POST','clientId','remoteUri','password','clientSecret','then','access_token','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','catch','outbound','destcalleridnum','calleridnum','contacts','4.0','body','headers','odata-entityid','substring','lastIndexOf','enduserId'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x5000,0xa8));var _0x0500=function(_0x318ca1,_0x263b46){_0x318ca1=_0x318ca1-0x0;var _0x380e6e=_0x5000[_0x318ca1];return _0x380e6e;};'use strict';var _=require(_0x0500('0x0'));var rp=require(_0x0500('0x1'));var util=require(_0x0500('0x2'));var intUtil=require(_0x0500('0x3'));var md5=require('md5');var Redis=require(_0x0500('0x4'));var logger=require(_0x0500('0x5'))(_0x0500('0x6'));var config=require(_0x0500('0x7'));config['redis']=_[_0x0500('0x8')](config[_0x0500('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x0500('0xa'))(new Redis(config[_0x0500('0x9')]));function getAuthToken(_0x4735eb,_0x4c957a,_0x5c9bc2){if(_0x4735eb[_0x0500('0xb')]){_0x4735eb['remoteUri']=_0x4735eb['CloudProvider']['data7'];_0x4735eb[_0x0500('0xc')]=_0x4735eb[_0x0500('0xd')][_0x0500('0xe')];return Promise['resolve'](_0x4735eb[_0x0500('0xd')]['data5']);}var _0x595ea3={'method':_0x0500('0xf'),'uri':_0x4c957a,'form':{'client_id':_0x4735eb[_0x0500('0x10')],'resource':_0x4735eb[_0x0500('0x11')],'username':_0x4735eb['username'],'password':_0x4735eb[_0x0500('0x12')],'grant_type':_0x0500('0x12'),'client_secret':_0x4735eb[_0x0500('0x13')]},'json':!![]};return rp(_0x595ea3)[_0x0500('0x14')](function(_0x146abe){return _0x146abe[_0x0500('0x15')];})['catch'](function(_0x516941){logger[_0x0500('0x16')]('['+[_0x5c9bc2['toUpperCase']()]+_0x0500('0x17'));return _0x516941[_0x0500('0x18')];});}function getUser(_0x503995,_0x2a59c7,_0xb89c86,_0x3dbce2,_0x283aab,_0x2d91c6){return new Promise(function(_0x59345c,_0x362386){return getAuthToken(_0x2a59c7,_0x3dbce2,_0x2d91c6)[_0x0500('0x14')](function(_0x4440bd){var _0x627a6={'method':'GET','uri':_0x283aab+_0x0500('0x19'),'headers':{'Authorization':_0x0500('0x1a')+_0x4440bd,'OData-Version':'4.0'},'json':!![]};return rp(_0x627a6);})[_0x0500('0x14')](function(_0x14cc32){var _0x418b42=_0x14cc32[_0x0500('0x1b')];var _0x2254c8=![];var _0x346972=null;if(!_[_0x0500('0x1c')](_0xb89c86)){if(intUtil[_0x0500('0x1d')](_0xb89c86[_0x0500('0x1e')])){_0x503995[_0x0500('0x1f')]=_0xb89c86[_0x0500('0x1e')];for(_0x346972=0x0;_0x346972<_0x418b42[_0x0500('0x20')];_0x346972++){if(_0x418b42[_0x346972][_0x0500('0x21')]===_0xb89c86[_0x0500('0x1e')]&&!_0x418b42[_0x346972][_0x0500('0x22')]){_0x2254c8=!![];logger[_0x0500('0x23')]('['+[_0x2d91c6[_0x0500('0x24')]()]+_0x0500('0x25')+_0x418b42[_0x346972][_0x0500('0x26')]+'!');_0x503995[_0x0500('0x27')]=_0x418b42[_0x346972][_0x0500('0x26')];}}}}if(!_0x2254c8){logger[_0x0500('0x23')]('['+[_0x2d91c6[_0x0500('0x24')]()]+_0x0500('0x28'));_0x503995['userEmail']=_0x2a59c7[_0x0500('0x29')];for(_0x346972=0x0;_0x346972<_0x418b42[_0x0500('0x20')];_0x346972++){if(_0x418b42[_0x346972]['internalemailaddress']===_0x2a59c7[_0x0500('0x29')]){_0x503995[_0x0500('0x27')]=_0x418b42[_0x346972][_0x0500('0x26')];}}}_0x59345c(_0x503995);})[_0x0500('0x2a')](function(_0x4a25e2){_0x362386(_0x4a25e2[_0x0500('0x18')]);});});}function createEndUser(_0x4c9def,_0x568967,_0x3fda41,_0x53a8b7,_0x4a7db8,_0x507548,_0x58857d){return new Promise(function(_0x3b11ec,_0x20ee04){return getAuthToken(_0x568967,_0x3fda41,_0x507548)[_0x0500('0x14')](function(_0x5a7231){var _0x19ac56=_0x507548['toLowerCase']()===_0x0500('0x2b')?_0x4a7db8[_0x0500('0x2c')]:_0x4a7db8[_0x0500('0x2d')];var _0x17159a={'method':_0x0500('0xf'),'uri':_0x53a8b7+_0x0500('0x2e'),'body':{'fullname':_0x19ac56,'firstname':_0x19ac56,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4c9def[_0x0500('0x27')]+')'},'headers':{'Authorization':_0x0500('0x1a')+_0x5a7231,'OData-Version':_0x0500('0x2f')},'json':!![],'resolveWithFullResponse':!![]};_0x17159a[_0x0500('0x30')][_0x58857d]=_0x19ac56;return rp(_0x17159a);})[_0x0500('0x14')](function(_0xfa6f29){var _0x566f37=_0xfa6f29[_0x0500('0x31')][_0x0500('0x32')];var _0x34c695=_0x566f37[_0x0500('0x33')](_0x566f37[_0x0500('0x34')]('(')+0x1,_0x566f37['lastIndexOf'](')'));_0x4c9def[_0x0500('0x35')]=_0x34c695;_0x3b11ec(_0x4c9def);})['catch'](function(_0xa49457){_0x20ee04(_0xa49457[_0x0500('0x18')]);});});}function getEndUser(_0x356a87,_0xff9ec5,_0x31ea2f,_0x3f455b,_0x530fc1,_0x2438a5,_0x17b1c0,_0x49ff9c){var _0x39714b=_0x2438a5[_0x0500('0x36')]()==='outbound'?_0x530fc1[_0x0500('0x2c')]:_0x530fc1[_0x0500('0x2d')];return getAuthToken(_0xff9ec5,_0x31ea2f,_0x2438a5)[_0x0500('0x14')](function(_0x5d73dd){_0x49ff9c=_0x49ff9c?_0x49ff9c:_0x0500('0x37');var _0x494653={'method':_0x0500('0x38'),'uri':_0x3f455b+_0x0500('0x39')+_0x49ff9c+_0x0500('0x3a')+_0x49ff9c+'\x20eq\x20\x27'+_0x39714b[_0x0500('0x3b')]('+',_0x0500('0x3c'))+'\x27','headers':{'Authorization':_0x0500('0x1a')+_0x5d73dd,'If-None-Match':null,'OData-Version':_0x0500('0x2f')},'json':!![]};return rp(_0x494653);})['then'](function(_0x255dfa){var _0x342ce6=![];if(!_0x255dfa)return _0x342ce6;var _0x5d956=_0x255dfa[_0x0500('0x1b')];for(var _0x1504c5=0x0;_0x1504c5<_0x5d956[_0x0500('0x20')];_0x1504c5++){if(_0x5d956[_0x1504c5][_0x49ff9c]===_0x39714b){_0x342ce6=!![];_0x356a87['enduserId']=_0x5d956[_0x1504c5]['contactid'];}}return _0x342ce6;})[_0x0500('0x14')](function(_0x594e9b){if(_0x594e9b)return _0x356a87;if(_0x17b1c0===_0x0500('0x3d')){logger[_0x0500('0x23')]('['+[_0x2438a5[_0x0500('0x24')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x356a87;}return createEndUser(_0x356a87,_0xff9ec5,_0x31ea2f,_0x3f455b,_0x530fc1,_0x2438a5,_0x49ff9c)['then'](function(_0x2e95f4){logger['info']('['+[_0x2438a5[_0x0500('0x24')]()]+_0x0500('0x3e'),_0x2e95f4[_0x0500('0x35')]);return _0x2e95f4;});});}function getCustomFields(_0x215e64,_0x1c53bd,_0x31cdc6){var _0x1e6ffe={};if(_0x215e64[_0x0500('0x20')]>0x0){_[_0x0500('0x3f')](_0x215e64,function(_0x5b6496){if(_[_0x0500('0x40')](['string',_0x0500('0x41')],_0x5b6496[_0x0500('0x42')])&&_0x5b6496[_0x0500('0x43')]&&!_0x5b6496[_0x0500('0x44')]){var _0x11b9d9=_0x5b6496[_0x0500('0x45')]['toLowerCase']();var _0x49a2d9=_0x11b9d9[_0x0500('0x33')](0x0,_0x11b9d9[_0x0500('0x46')]('_'));var _0x1359eb=_0x11b9d9['substring'](_0x11b9d9[_0x0500('0x46')]('_')+0x1);if(_0x49a2d9===_0x31cdc6){_0x1e6ffe[_0x1359eb]=_0x5b6496['content'];}}});}return _0x1e6ffe;}function getTicket(_0x4bd865,_0x43f705,_0x5d1894,_0xc5b6e8,_0x55758b,_0x47987e,_0x4ebf24){return new Promise(function(_0x3edf4e,_0x227520){var _0x19d8ef;return getAuthToken(_0x43f705,_0x5d1894,_0x4ebf24)['then'](function(_0x15b7a7){if(_0x47987e[_0x0500('0x47')]===_0x0500('0x48')){_0x19d8ef={'method':_0x0500('0xf'),'uri':_0xc5b6e8+'incidents','body':Object[_0x0500('0x49')]({},{'title':intUtil[_0x0500('0x4a')](_0x47987e[_0x0500('0x4b')],_0x55758b,'\x20'),'description':intUtil[_0x0500('0x4a')](_0x47987e[_0x0500('0x4c')],_0x55758b,'\x0a'),'customerid_contact@odata.bind':_0x4bd865[_0x0500('0x35')]?_0x0500('0x4d')+_0x4bd865[_0x0500('0x35')]+')':undefined,'ownerid@odata.bind':_0x0500('0x4e')+_0x4bd865[_0x0500('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x47987e[_0x0500('0x4f')],_0x55758b,_0x47987e[_0x0500('0x47')])),'headers':{'Authorization':_0x0500('0x1a')+_0x15b7a7,'OData-Version':_0x0500('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x47987e[_0x0500('0x47')]===_0x0500('0x50')){var _0xab7b04=_0x4bd865[_0x0500('0x35')]?[{'partyid_systemuser@odata.bind':_0x0500('0x4e')+_0x4bd865[_0x0500('0x27')]+')','participationtypemask':_0x4bd865[_0x0500('0x51')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x0500('0x4d')+_0x4bd865[_0x0500('0x35')]+')','participationtypemask':_0x4bd865[_0x0500('0x51')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x0500('0x4e')+_0x4bd865[_0x0500('0x27')]+')','participationtypemask':_0x4bd865['callDirection']===_0x0500('0x52')?0x2:0x1}];_0x19d8ef={'method':_0x0500('0xf'),'uri':_0xc5b6e8+_0x0500('0x53'),'body':Object[_0x0500('0x49')]({},{'subject':intUtil[_0x0500('0x4a')](_0x47987e['Subjects'],_0x55758b,'\x20'),'phonenumber':String(_0x55758b[_0x0500('0x2d')]),'description':intUtil[_0x0500('0x4a')](_0x47987e[_0x0500('0x4c')],_0x55758b,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4bd865['enduserId']?_0x0500('0x4d')+_0x4bd865[_0x0500('0x35')]+')':undefined,'ownerid@odata.bind':_0x0500('0x4e')+_0x4bd865[_0x0500('0x27')]+')','directioncode':_0x4bd865[_0x0500('0x51')]===_0x0500('0x52')?![]:!![],'phonecall_activity_parties':_0xab7b04},getCustomFields(_0x47987e[_0x0500('0x4f')],_0x55758b,_0x47987e['ticketType'])),'headers':{'Authorization':_0x0500('0x1a')+_0x15b7a7,'OData-Version':_0x0500('0x2f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x19d8ef);})[_0x0500('0x14')](function(_0x307a54){var _0x16b1e5=_0x307a54[_0x0500('0x31')][_0x0500('0x32')];var _0x49c9e4=_0x16b1e5[_0x0500('0x33')](_0x16b1e5[_0x0500('0x34')]('(')+0x1,_0x16b1e5[_0x0500('0x34')](')'));_0x4bd865[_0x0500('0x54')]=_0x49c9e4;_0x3edf4e(_0x4bd865);})[_0x0500('0x2a')](function(_0x1d50f0){_0x227520(_0x1d50f0[_0x0500('0x18')]);});});}function emit(_0x2c2e81,_0x785e8f,_0x2440cc,_0x392727){var _0x2ea057={'uri':util[_0x0500('0x55')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2c2e81,_0x2440cc,_0x392727)};io['to'](util[_0x0500('0x55')]('user:%s',_0x785e8f))[_0x0500('0x56')](_0x0500('0x57'),_0x2ea057);}exports['cs']=function(_0x4a9977,_0x20f1c9,_0x3144dc,_0x5d01ac,_0x491e25,_0x5eadff,_0x136994,_0xb2d2a0){var _0x85986a={};_0x5eadff[_0x0500('0x11')]=_0x5eadff[_0x0500('0xb')]?intUtil[_0x0500('0x58')](_0x5eadff['CloudProvider'][_0x0500('0x59')]):intUtil[_0x0500('0x58')](_0x5eadff[_0x0500('0x11')]);_0x5eadff[_0x0500('0x5a')]=intUtil['stripTrailingSlash'](_0x5eadff['serverUrl']);_0x85986a['callDirection']=_0xb2d2a0===_0x0500('0x52')||_0xb2d2a0===_0x0500('0x5b')?'queue':_0x0500('0x2b');var _0x967190=_0x5eadff[_0x0500('0xb')]?util[_0x0500('0x55')](_0x0500('0x5c'),_0x5eadff[_0x0500('0xd')]['data7']):util[_0x0500('0x55')](_0x0500('0x5c'),_0x5eadff[_0x0500('0x11')]);var _0x467551=util[_0x0500('0x55')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5eadff[_0x0500('0xc')]);var _0xc11d56=util[_0x0500('0x55')](_0x0500('0x5d'),_0x5eadff[_0x0500('0x5a')],_0x20f1c9[_0x0500('0x5e')],md5(_0x20f1c9[_0x0500('0x5e')]));if(_0x491e25&&_0x491e25[_0x0500('0x5f')]){logger[_0x0500('0x23')](_0x0500('0x60'),_0x0500('0x61'));_0x20f1c9[_0x0500('0x62')]=_0xc11d56;}else if(_0x136994&&_0x136994['recordingFormat']&&_0x136994[_0x0500('0x63')]!=='none'){logger['info'](_0x0500('0x64'),_0x0500('0x61'));_0x20f1c9['recordingURL']=_0xc11d56;}else{_0x20f1c9[_0x0500('0x62')]='';}return getUser(_0x85986a,_0x5eadff,_0x5d01ac,_0x467551,_0x967190,_0xb2d2a0)['then'](function(_0x55dfb6){logger[_0x0500('0x23')]('['+_0xb2d2a0[_0x0500('0x24')]()+_0x0500('0x65'),_0x55dfb6[_0x0500('0x27')]);logger[_0x0500('0x23')]('['+_0xb2d2a0['toUpperCase']()+_0x0500('0x66'),_0x55dfb6['userEmail']);return getEndUser(_0x55dfb6,_0x5eadff,_0x467551,_0x967190,_0x20f1c9,_0xb2d2a0,_0x3144dc[_0x0500('0x67')],_0x3144dc['additionalSearchContact']);})[_0x0500('0x14')](function(_0xcb3c67){logger[_0x0500('0x23')]('['+_0xb2d2a0['toUpperCase']()+_0x0500('0x68'),_0xcb3c67[_0x0500('0x35')]);logger[_0x0500('0x23')]('['+_0xb2d2a0['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x20f1c9[_0x0500('0x2d')]);return getTicket(_0xcb3c67,_0x5eadff,_0x467551,_0x967190,_0x20f1c9,_0x3144dc,_0xb2d2a0);})[_0x0500('0x14')](function(_0x267aaa){logger['info'](util['format']('['+_0xb2d2a0['toUpperCase']()+_0x0500('0x69'),_0x3144dc[_0x0500('0x47')],_0x267aaa[_0x0500('0x54')]));logger[_0x0500('0x23')](util[_0x0500('0x55')]('['+_0xb2d2a0[_0x0500('0x24')]()+']\x20Call\x20direction:\x20%s',_0xb2d2a0));if(_0xb2d2a0!==_0x0500('0x5b')&&_0x3144dc[_0x0500('0x6a')]){logger[_0x0500('0x23')]('['+_0xb2d2a0['toUpperCase']()+']',_0x0500('0x6b'));emit(_0x5eadff[_0x0500('0x11')],_0x5d01ac[_0x0500('0x6c')],_0x3144dc['ticketType'],_0x267aaa[_0x0500('0x54')]);}})[_0x0500('0x2a')](function(_0x583fdb){logger[_0x0500('0x16')]('['+_0xb2d2a0[_0x0500('0x24')]()+_0x0500('0x6d'),_0x583fdb['message']);console['error'](_0x0500('0x6e'),_0x583fdb);});}; \ No newline at end of file +var _0xfcf5=['validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid','userEmail','toLowerCase','destcalleridnum','calleridnum','body','headers','enduserId','outbound','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','value','nothing',']\x20Enduser\x20created!','includes','string','picklist','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','assign','Subjects','getString','/contacts(','/systemusers(','Fields','queue','callDirection','phonecalls','Descriptions','odata-entityid','lastIndexOf','ticketId','message','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','additionalSearchContact',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','Error\x20running\x20Dynamics365\x20integration','lodash','util','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil'];(function(_0x2265b0,_0x279abe){var _0xc4900b=function(_0x549d54){while(--_0x549d54){_0x2265b0['push'](_0x2265b0['shift']());}};_0xc4900b(++_0x279abe);}(_0xfcf5,0xc2));var _0x5fcf=function(_0x1b3b22,_0x1b657f){_0x1b3b22=_0x1b3b22-0x0;var _0x2341af=_0xfcf5[_0x1b3b22];return _0x2341af;};'use strict';var _=require(_0x5fcf('0x0'));var rp=require('request-promise');var util=require(_0x5fcf('0x1'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x5fcf('0x2'))(_0x5fcf('0x3'));var config=require(_0x5fcf('0x4'));config[_0x5fcf('0x5')]=_[_0x5fcf('0x6')](config[_0x5fcf('0x5')],{'host':_0x5fcf('0x7'),'port':0x18eb});var io=require(_0x5fcf('0x8'))(new Redis(config['redis']));function getAuthToken(_0x4e03b7,_0x3d1e34,_0x4ec7d7){if(_0x4e03b7['modernAuthentication']){_0x4e03b7[_0x5fcf('0x9')]=_0x4e03b7[_0x5fcf('0xa')][_0x5fcf('0xb')];_0x4e03b7['tenantId']=_0x4e03b7[_0x5fcf('0xa')][_0x5fcf('0xc')];return Promise[_0x5fcf('0xd')](_0x4e03b7['CloudProvider'][_0x5fcf('0xe')]);}var _0x1ca7a5={'method':_0x5fcf('0xf'),'uri':_0x3d1e34,'form':{'client_id':_0x4e03b7[_0x5fcf('0x10')],'resource':_0x4e03b7[_0x5fcf('0x9')],'username':_0x4e03b7[_0x5fcf('0x11')],'password':_0x4e03b7['password'],'grant_type':_0x5fcf('0x12'),'client_secret':_0x4e03b7[_0x5fcf('0x13')]},'json':!![]};return rp(_0x1ca7a5)[_0x5fcf('0x14')](function(_0x275b90){return _0x275b90[_0x5fcf('0x15')];})[_0x5fcf('0x16')](function(_0x4a1e38){logger[_0x5fcf('0x17')]('['+[_0x4ec7d7['toUpperCase']()]+_0x5fcf('0x18'));return _0x4a1e38['message'];});}function getUser(_0x1420ce,_0x40acf3,_0x143f73,_0x23a883,_0x41797f,_0x7905f3){return new Promise(function(_0xa38dcc,_0x29bf33){return getAuthToken(_0x40acf3,_0x23a883,_0x7905f3)[_0x5fcf('0x14')](function(_0x3b6178){var _0x2d3fae={'method':_0x5fcf('0x19'),'uri':_0x41797f+_0x5fcf('0x1a'),'headers':{'Authorization':_0x5fcf('0x1b')+_0x3b6178,'OData-Version':_0x5fcf('0x1c')},'json':!![]};return rp(_0x2d3fae);})[_0x5fcf('0x14')](function(_0x475bd0){var _0x4a28d1=_0x475bd0['value'];var _0xf6d1f=![];var _0x3dbe62=null;if(!_[_0x5fcf('0x1d')](_0x143f73)){if(intUtil[_0x5fcf('0x1e')](_0x143f73['email'])){_0x1420ce['userEmail']=_0x143f73[_0x5fcf('0x1f')];for(_0x3dbe62=0x0;_0x3dbe62<_0x4a28d1[_0x5fcf('0x20')];_0x3dbe62++){if(_0x4a28d1[_0x3dbe62][_0x5fcf('0x21')]===_0x143f73[_0x5fcf('0x1f')]&&!_0x4a28d1[_0x3dbe62][_0x5fcf('0x22')]){_0xf6d1f=!![];logger[_0x5fcf('0x23')]('['+[_0x7905f3[_0x5fcf('0x24')]()]+_0x5fcf('0x25')+_0x4a28d1[_0x3dbe62]['systemuserid']+'!');_0x1420ce[_0x5fcf('0x26')]=_0x4a28d1[_0x3dbe62][_0x5fcf('0x27')];}}}}if(!_0xf6d1f){logger['info']('['+[_0x7905f3['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x1420ce[_0x5fcf('0x28')]=_0x40acf3[_0x5fcf('0x11')];for(_0x3dbe62=0x0;_0x3dbe62<_0x4a28d1[_0x5fcf('0x20')];_0x3dbe62++){if(_0x4a28d1[_0x3dbe62][_0x5fcf('0x21')]===_0x40acf3[_0x5fcf('0x11')]){_0x1420ce['userId']=_0x4a28d1[_0x3dbe62][_0x5fcf('0x27')];}}}_0xa38dcc(_0x1420ce);})[_0x5fcf('0x16')](function(_0x38ded0){_0x29bf33(_0x38ded0['message']);});});}function createEndUser(_0x4b9479,_0x1aad06,_0x2b9a1d,_0x9882e5,_0x1e52e8,_0x465940,_0x4be2fe){return new Promise(function(_0x400d16,_0x5760de){return getAuthToken(_0x1aad06,_0x2b9a1d,_0x465940)[_0x5fcf('0x14')](function(_0x3b16f4){var _0x47897d=_0x465940[_0x5fcf('0x29')]()==='outbound'?_0x1e52e8[_0x5fcf('0x2a')]:_0x1e52e8[_0x5fcf('0x2b')];var _0x39a582={'method':_0x5fcf('0xf'),'uri':_0x9882e5+'contacts','body':{'fullname':_0x47897d,'firstname':_0x47897d,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x4b9479[_0x5fcf('0x26')]+')'},'headers':{'Authorization':_0x5fcf('0x1b')+_0x3b16f4,'OData-Version':_0x5fcf('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x39a582[_0x5fcf('0x2c')][_0x4be2fe]=_0x47897d;return rp(_0x39a582);})[_0x5fcf('0x14')](function(_0x202875){var _0x1b03d6=_0x202875[_0x5fcf('0x2d')]['odata-entityid'];var _0x208666=_0x1b03d6['substring'](_0x1b03d6['lastIndexOf']('(')+0x1,_0x1b03d6['lastIndexOf'](')'));_0x4b9479[_0x5fcf('0x2e')]=_0x208666;_0x400d16(_0x4b9479);})[_0x5fcf('0x16')](function(_0x549158){_0x5760de(_0x549158['message']);});});}function getEndUser(_0x2d1c6b,_0x1bcbb9,_0x39af07,_0xc99964,_0x567c45,_0x1111ee,_0x284443,_0x549c87){var _0x301436=_0x1111ee['toLowerCase']()===_0x5fcf('0x2f')?_0x567c45[_0x5fcf('0x2a')]:_0x567c45[_0x5fcf('0x2b')];return getAuthToken(_0x1bcbb9,_0x39af07,_0x1111ee)[_0x5fcf('0x14')](function(_0x5ee42c){_0x549c87=_0x549c87?_0x549c87:_0x5fcf('0x30');var _0x2c5a91={'method':_0x5fcf('0x19'),'uri':_0xc99964+_0x5fcf('0x31')+_0x549c87+_0x5fcf('0x32')+_0x549c87+_0x5fcf('0x33')+_0x301436[_0x5fcf('0x34')]('+','%2b')+'\x27','headers':{'Authorization':_0x5fcf('0x1b')+_0x5ee42c,'If-None-Match':null,'OData-Version':_0x5fcf('0x1c')},'json':!![]};return rp(_0x2c5a91);})[_0x5fcf('0x14')](function(_0x59318f){var _0x1680d3=![];if(!_0x59318f)return _0x1680d3;var _0x222c9e=_0x59318f[_0x5fcf('0x35')];for(var _0x3c36b3=0x0;_0x3c36b3<_0x222c9e[_0x5fcf('0x20')];_0x3c36b3++){if(_0x222c9e[_0x3c36b3][_0x549c87]===_0x301436){_0x1680d3=!![];_0x2d1c6b[_0x5fcf('0x2e')]=_0x222c9e[_0x3c36b3]['contactid'];}}return _0x1680d3;})[_0x5fcf('0x14')](function(_0x36df9a){if(_0x36df9a)return _0x2d1c6b;if(_0x284443===_0x5fcf('0x36')){logger[_0x5fcf('0x23')]('['+[_0x1111ee[_0x5fcf('0x24')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x2d1c6b;}return createEndUser(_0x2d1c6b,_0x1bcbb9,_0x39af07,_0xc99964,_0x567c45,_0x1111ee,_0x549c87)['then'](function(_0x1faf29){logger['info']('['+[_0x1111ee[_0x5fcf('0x24')]()]+_0x5fcf('0x37'),_0x1faf29['enduserId']);return _0x1faf29;});});}function getCustomFields(_0x539bb8,_0x30d04e,_0x3203fa){var _0x2fab1c={};if(_0x539bb8['length']>0x0){_['forEach'](_0x539bb8,function(_0x4f8784){if(_[_0x5fcf('0x38')]([_0x5fcf('0x39'),_0x5fcf('0x3a')],_0x4f8784[_0x5fcf('0x3b')])&&_0x4f8784[_0x5fcf('0x3c')]&&!_0x4f8784[_0x5fcf('0x3d')]){var _0x5bfeb9=_0x4f8784[_0x5fcf('0x3e')][_0x5fcf('0x29')]();var _0x57c59b=_0x5bfeb9[_0x5fcf('0x3f')](0x0,_0x5bfeb9[_0x5fcf('0x40')]('_'));var _0xf3ded5=_0x5bfeb9[_0x5fcf('0x3f')](_0x5bfeb9['indexOf']('_')+0x1);if(_0x57c59b===_0x3203fa){_0x2fab1c[_0xf3ded5]=_0x4f8784[_0x5fcf('0x41')];}}});}return _0x2fab1c;}function getTicket(_0x2125d6,_0x40b39d,_0x22b31a,_0x3178f9,_0x190d32,_0xcc9304,_0xb472bd){return new Promise(function(_0x44ed31,_0x39dac1){var _0x273643;return getAuthToken(_0x40b39d,_0x22b31a,_0xb472bd)['then'](function(_0x361cf3){if(_0xcc9304[_0x5fcf('0x42')]===_0x5fcf('0x43')){_0x273643={'method':_0x5fcf('0xf'),'uri':_0x3178f9+'incidents','body':Object[_0x5fcf('0x44')]({},{'title':intUtil['getString'](_0xcc9304[_0x5fcf('0x45')],_0x190d32,'\x20'),'description':intUtil[_0x5fcf('0x46')](_0xcc9304['Descriptions'],_0x190d32,'\x0a'),'customerid_contact@odata.bind':_0x2125d6[_0x5fcf('0x2e')]?_0x5fcf('0x47')+_0x2125d6['enduserId']+')':undefined,'ownerid@odata.bind':_0x5fcf('0x48')+_0x2125d6[_0x5fcf('0x26')]+')','caseorigincode':'1'},getCustomFields(_0xcc9304[_0x5fcf('0x49')],_0x190d32,_0xcc9304[_0x5fcf('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x361cf3,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xcc9304['ticketType']==='phonecall'){var _0x49d466=_0x2125d6[_0x5fcf('0x2e')]?[{'partyid_systemuser@odata.bind':_0x5fcf('0x48')+_0x2125d6[_0x5fcf('0x26')]+')','participationtypemask':_0x2125d6['callDirection']===_0x5fcf('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0x5fcf('0x47')+_0x2125d6['enduserId']+')','participationtypemask':_0x2125d6['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5fcf('0x48')+_0x2125d6[_0x5fcf('0x26')]+')','participationtypemask':_0x2125d6[_0x5fcf('0x4b')]===_0x5fcf('0x4a')?0x2:0x1}];_0x273643={'method':'POST','uri':_0x3178f9+_0x5fcf('0x4c'),'body':Object[_0x5fcf('0x44')]({},{'subject':intUtil[_0x5fcf('0x46')](_0xcc9304[_0x5fcf('0x45')],_0x190d32,'\x20'),'phonenumber':String(_0x190d32[_0x5fcf('0x2b')]),'description':intUtil[_0x5fcf('0x46')](_0xcc9304[_0x5fcf('0x4d')],_0x190d32,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2125d6[_0x5fcf('0x2e')]?_0x5fcf('0x47')+_0x2125d6['enduserId']+')':undefined,'ownerid@odata.bind':_0x5fcf('0x48')+_0x2125d6[_0x5fcf('0x26')]+')','directioncode':_0x2125d6[_0x5fcf('0x4b')]===_0x5fcf('0x4a')?![]:!![],'phonecall_activity_parties':_0x49d466},getCustomFields(_0xcc9304[_0x5fcf('0x49')],_0x190d32,_0xcc9304[_0x5fcf('0x42')])),'headers':{'Authorization':_0x5fcf('0x1b')+_0x361cf3,'OData-Version':_0x5fcf('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x273643);})[_0x5fcf('0x14')](function(_0x3e224f){var _0x2f2145=_0x3e224f[_0x5fcf('0x2d')][_0x5fcf('0x4e')];var _0x5a12fc=_0x2f2145['substring'](_0x2f2145[_0x5fcf('0x4f')]('(')+0x1,_0x2f2145[_0x5fcf('0x4f')](')'));_0x2125d6[_0x5fcf('0x50')]=_0x5a12fc;_0x44ed31(_0x2125d6);})[_0x5fcf('0x16')](function(_0x3b77c8){_0x39dac1(_0x3b77c8[_0x5fcf('0x51')]);});});}function emit(_0x4a163b,_0x1f35a6,_0x23022b,_0x4d1c3c){var _0x3673cf={'uri':util[_0x5fcf('0x52')](_0x5fcf('0x53'),_0x4a163b,_0x23022b,_0x4d1c3c)};io['to'](util[_0x5fcf('0x52')](_0x5fcf('0x54'),_0x1f35a6))[_0x5fcf('0x55')](_0x5fcf('0x56'),_0x3673cf);}exports['cs']=function(_0x35a5b5,_0x479a67,_0x196229,_0x3557ae,_0x2c6c23,_0xb37b30,_0x53f7be,_0x22ec4c){var _0x15bb46={};_0xb37b30[_0x5fcf('0x9')]=_0xb37b30[_0x5fcf('0x57')]?intUtil[_0x5fcf('0x58')](_0xb37b30[_0x5fcf('0xa')]['data7']):intUtil[_0x5fcf('0x58')](_0xb37b30[_0x5fcf('0x9')]);_0xb37b30[_0x5fcf('0x59')]=intUtil['stripTrailingSlash'](_0xb37b30[_0x5fcf('0x59')]);_0x15bb46['callDirection']=_0x22ec4c===_0x5fcf('0x4a')||_0x22ec4c==='unmanaged'?'queue':_0x5fcf('0x2f');var _0x2150c0=_0xb37b30[_0x5fcf('0x57')]?util[_0x5fcf('0x52')](_0x5fcf('0x5a'),_0xb37b30[_0x5fcf('0xa')][_0x5fcf('0xb')]):util['format'](_0x5fcf('0x5a'),_0xb37b30[_0x5fcf('0x9')]);var _0x5aab5b=util['format'](_0x5fcf('0x5b'),_0xb37b30[_0x5fcf('0x5c')]);var _0x2a0c54=util[_0x5fcf('0x52')](_0x5fcf('0x5d'),_0xb37b30[_0x5fcf('0x59')],_0x479a67[_0x5fcf('0x5e')],md5(_0x479a67['uniqueid']));if(_0x2c6c23&&_0x2c6c23[_0x5fcf('0x5f')]){logger[_0x5fcf('0x23')](_0x5fcf('0x60'),'Recording\x20is\x20enabled!');_0x479a67['recordingURL']=_0x2a0c54;}else if(_0x53f7be&&_0x53f7be[_0x5fcf('0x61')]&&_0x53f7be['recordingFormat']!==_0x5fcf('0x62')){logger['info'](_0x5fcf('0x63'),_0x5fcf('0x64'));_0x479a67['recordingURL']=_0x2a0c54;}else{_0x479a67[_0x5fcf('0x65')]='';}return getUser(_0x15bb46,_0xb37b30,_0x3557ae,_0x5aab5b,_0x2150c0,_0x22ec4c)['then'](function(_0x44f1af){logger[_0x5fcf('0x23')]('['+_0x22ec4c[_0x5fcf('0x24')]()+_0x5fcf('0x66'),_0x44f1af[_0x5fcf('0x26')]);logger[_0x5fcf('0x23')]('['+_0x22ec4c[_0x5fcf('0x24')]()+_0x5fcf('0x67'),_0x44f1af[_0x5fcf('0x28')]);return getEndUser(_0x44f1af,_0xb37b30,_0x5aab5b,_0x2150c0,_0x479a67,_0x22ec4c,_0x196229['moduleCreate'],_0x196229[_0x5fcf('0x68')]);})[_0x5fcf('0x14')](function(_0x3891c9){logger[_0x5fcf('0x23')]('['+_0x22ec4c['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x3891c9['enduserId']);logger[_0x5fcf('0x23')]('['+_0x22ec4c[_0x5fcf('0x24')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x479a67['calleridnum']);return getTicket(_0x3891c9,_0xb37b30,_0x5aab5b,_0x2150c0,_0x479a67,_0x196229,_0x22ec4c);})[_0x5fcf('0x14')](function(_0x548ad0){logger[_0x5fcf('0x23')](util['format']('['+_0x22ec4c[_0x5fcf('0x24')]()+_0x5fcf('0x69'),_0x196229['ticketType'],_0x548ad0[_0x5fcf('0x50')]));logger[_0x5fcf('0x23')](util[_0x5fcf('0x52')]('['+_0x22ec4c[_0x5fcf('0x24')]()+_0x5fcf('0x6a'),_0x22ec4c));if(_0x22ec4c!==_0x5fcf('0x6b')&&_0x196229[_0x5fcf('0x6c')]){logger['info']('['+_0x22ec4c[_0x5fcf('0x24')]()+']',_0x5fcf('0x6d'));emit(_0xb37b30[_0x5fcf('0x9')],_0x3557ae[_0x5fcf('0x6e')],_0x196229[_0x5fcf('0x42')],_0x548ad0['ticketId']);}})[_0x5fcf('0x16')](function(_0x345fc3){logger['error']('['+_0x22ec4c[_0x5fcf('0x24')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x345fc3[_0x5fcf('0x51')]);console[_0x5fcf('0x17')](_0x5fcf('0x6f'),_0x345fc3);});}; \ 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 cbaa9f7..c458db9 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 _0x6512=['./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','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\x20created.','Basic\x20%s','toString','stringify','GET','map','picklist','type','nameField','customField','content','includes','push','idField','variable','variableName','customVariable','Variable','toLowerCase','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','%s/helpdesk/tickets/%d','error','unmanaged','lastevent','toUpperCase','request-promise','md5','ioredis'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x6512,0xad));var _0x2651=function(_0x4d989a,_0x24edd){_0x4d989a=_0x4d989a-0x0;var _0x4293a0=_0x6512[_0x4d989a];return _0x4293a0;};'use strict';var _=require('lodash');var rp=require(_0x2651('0x0'));var md5=require(_0x2651('0x1'));var util=require('util');var Redis=require(_0x2651('0x2'));var intUtil=require(_0x2651('0x3'));var config=require(_0x2651('0x4'));var logger=require(_0x2651('0x5'))('freshdesk');config[_0x2651('0x6')]=_[_0x2651('0x7')](config[_0x2651('0x6')],{'host':_0x2651('0x8'),'port':0x18eb});var io=require(_0x2651('0x9'))(new Redis(config[_0x2651('0x6')]));var headers={'Content-Type':_0x2651('0xa'),'Accept':'application/json'};function emit(_0x49522e,_0x2d9b52,_0xcb9a51){io['to'](_0x49522e)[_0x2651('0xb')](_0x2d9b52,_0xcb9a51);}function getTicket(_0x16d50a,_0x285830,_0x32c4dd,_0x21b260,_0x169298){logger[_0x2651('0xc')]('Creating\x20new\x20ticket...');var _0x5ca76f=_[_0x2651('0xd')]({'responder_id':_0x285830['id'],'requester_id':_0x32c4dd['id'],'name':util[_0x2651('0xe')](_0x2651('0xf'),_0x169298[_0x2651('0x10')]),'phone':_0x169298[_0x2651('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2651('0x12')](_0x21b260[_0x2651('0x13')],_0x169298,'\x20'),'description':intUtil[_0x2651('0x12')](_0x21b260['Descriptions'],_0x169298,'
'),'tags':getTags(_0x21b260[_0x2651('0x14')],_0x2651('0x15'))},getCustomFields(_0x21b260[_0x2651('0x16')],_0x169298));_0x5ca76f[_0x2651('0x17')]=_[_0x2651('0x18')](_[_0x2651('0x19')](_0x5ca76f[_0x2651('0x17')],'id'),'value');return request({'uri':util[_0x2651('0xe')](_0x2651('0x1a'),_0x16d50a[_0x2651('0x1b')]),'method':_0x2651('0x1c'),'body':_0x5ca76f})[_0x2651('0x1d')](function(_0x409320){logger[_0x2651('0xc')](_0x2651('0x1e'));return _0x409320;});}function getUser(_0x3a5ca5,_0x255169){if(intUtil['validateEmail'](_0x255169)){return request({'uri':util[_0x2651('0xe')](_0x2651('0x1f'),_0x3a5ca5['remoteUri']),'qs':{'email':_0x255169}})[_0x2651('0x1d')](function(_0x1959af){if(_0x1959af[_0x2651('0x20')]){logger['info'](_0x2651('0x21'));return _['find'](_0x1959af,function(_0xd83832){return _0xd83832[_0x2651('0x22')]['email']===_0x255169;});}else{logger[_0x2651('0xc')](_0x2651('0x23'));return request({'uri':util['format'](_0x2651('0x24'),_0x3a5ca5[_0x2651('0x1b')])})[_0x2651('0x1d')](function(_0x3cb92b){logger[_0x2651('0xc')](_0x2651('0x25'));return _0x3cb92b;});}});}else{logger[_0x2651('0xc')](_0x2651('0x26'));return request({'uri':util[_0x2651('0xe')]('%s/api/v2/agents/me',_0x3a5ca5[_0x2651('0x1b')])})[_0x2651('0x1d')](function(_0x24a86c){logger[_0x2651('0xc')](_0x2651('0x25'));return _0x24a86c;});}}function getEndUser(_0x18dbb1,_0x342568,_0x26aea7){logger[_0x2651('0xc')](_0x2651('0x27'),_0x26aea7);return request({'uri':util[_0x2651('0xe')](_0x2651('0x28'),_0x18dbb1[_0x2651('0x1b')]),'qs':{'phone':_0x26aea7}})[_0x2651('0x1d')](function(_0x49ead1){if(_0x49ead1[_0x2651('0x20')]){logger[_0x2651('0xc')](_0x2651('0x29'));return _[_0x2651('0x2a')](_0x49ead1,{'phone':_0x26aea7});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x2651('0x28'),_0x18dbb1[_0x2651('0x1b')]),'method':_0x2651('0x1c'),'body':{'name':_0x342568,'phone':_0x26aea7}})[_0x2651('0x1d')](function(_0x3c6e38){logger[_0x2651('0xc')](_0x2651('0x2b'));return _0x3c6e38;});}});}function getAuth(_0x3ca80e){return util[_0x2651('0xe')](_0x2651('0x2c'),new Buffer(_0x3ca80e['apiKey']+':X')[_0x2651('0x2d')]('base64'));}function request(_0x10b21e){logger['debug']('[HTTP]',JSON[_0x2651('0x2e')](_0x10b21e));return rp(_[_0x2651('0x7')](_0x10b21e,{'method':_0x2651('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x35d364,_0x129ebd){var _0x4285e6=[];if(_0x35d364&&_0x35d364[_0x2651('0x20')]>0x0){_0x4285e6=_[_0x2651('0x30')](_0x35d364,_0x129ebd);}return _0x4285e6;}function getCustomFields(_0x53cb02,_0x4671f9){var _0x45c893=[];var _0x3395a0={'custom_fields':[]};if(_0x53cb02[_0x2651('0x20')]>0x0){_['forEach'](_0x53cb02,function(_0x4acaa0){if(_['includes'](['string',_0x2651('0x31')],_0x4acaa0[_0x2651('0x32')])&&_0x4acaa0[_0x2651('0x33')]&&!_0x4acaa0[_0x2651('0x34')]){_0x3395a0[_0x4acaa0[_0x2651('0x33')]['toLowerCase']()]=_0x4acaa0[_0x2651('0x35')][_0x2651('0x2d')]();}else if(_[_0x2651('0x36')](['string','picklist'],_0x4acaa0['type'])&&_0x4acaa0['idField']&&_0x4acaa0[_0x2651('0x34')]){_0x3395a0[_0x2651('0x17')][_0x2651('0x37')]({'id':_0x4acaa0[_0x2651('0x38')],'value':_0x4acaa0['content'][_0x2651('0x2d')]()});}else if(_0x4acaa0[_0x2651('0x32')]===_0x2651('0x39')&&_0x4acaa0[_0x2651('0x3a')]&&_0x4acaa0[_0x2651('0x38')]&&_0x4acaa0[_0x2651('0x34')]){_0x4671f9[_0x4acaa0[_0x2651('0x3a')]]&&_0x3395a0[_0x2651('0x17')]['push']({'id':_0x4acaa0[_0x2651('0x38')],'value':_0x4671f9[_0x4acaa0[_0x2651('0x3a')]][_0x2651('0x2d')]()});}else if(_0x4acaa0[_0x2651('0x32')]===_0x2651('0x3b')&&_0x4acaa0[_0x2651('0x3c')]&&_0x4acaa0[_0x2651('0x3c')][_0x2651('0x15')]&&_0x4acaa0[_0x2651('0x38')]&&_0x4acaa0[_0x2651('0x34')]){_0x4671f9[_0x4acaa0['Variable'][_0x2651('0x15')][_0x2651('0x3d')]()]&&_0x3395a0[_0x2651('0x17')][_0x2651('0x37')]({'id':_0x4acaa0[_0x2651('0x38')],'value':_0x4671f9[_0x4acaa0['Variable']['name'][_0x2651('0x3d')]()][_0x2651('0x2d')]()});}});}return _0x3395a0;}exports['queue']=function(_0x249c40,_0x421bb3,_0x45b186,_0x1b513f,_0x30e44b,_0x44d63b){var _0x4e2164,_0x217b3e;_0x44d63b['remoteUri']=intUtil['stripTrailingSlash'](_0x44d63b[_0x2651('0x1b')]);_0x44d63b['serverUrl']=intUtil['stripTrailingSlash'](_0x44d63b[_0x2651('0x3e')]);if(_0x30e44b&&_0x30e44b[_0x2651('0x3f')]){logger[_0x2651('0xc')](_0x2651('0x40'),_0x2651('0x41'));_0x421bb3[_0x2651('0x42')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x44d63b[_0x2651('0x3e')],_0x421bb3[_0x2651('0x43')],md5(_0x421bb3[_0x2651('0x43')]));}else{_0x421bb3[_0x2651('0x42')]='';}headers[_0x2651('0x44')]=getAuth(_0x44d63b);return getUser(_0x44d63b,_0x1b513f[_0x2651('0x45')])[_0x2651('0x1d')](function(_0x55c803){_0x4e2164=_0x55c803;logger['info'](_0x2651('0x46'),_0x4e2164['id']);return getEndUser(_0x44d63b,_0x421bb3[_0x2651('0x10')],_0x421bb3[_0x2651('0x11')]);})['then'](function(_0x231a0f){_0x217b3e=_0x231a0f;logger['info'](_0x2651('0x47'),_0x217b3e['id']);return getTicket(_0x44d63b,_0x4e2164,_0x217b3e,_0x45b186,_0x421bb3);})[_0x2651('0x1d')](function(_0x18a27d){if(_0x18a27d&&_0x18a27d['id']){logger[_0x2651('0xc')](_0x2651('0x1e'));logger[_0x2651('0xc')](_0x2651('0x48'),_0x18a27d['id']);logger[_0x2651('0xc')](_0x2651('0x40'),_0x2651('0x49'));emit(util['format'](_0x2651('0x4a'),_0x1b513f[_0x2651('0x15')]),_0x2651('0x4b'),{'uri':util[_0x2651('0xe')]('%s/helpdesk/tickets/%d',_0x44d63b[_0x2651('0x1b')],_0x18a27d['id'])});}})[_0x2651('0x4c')](function(_0x444918){logger['error']('[QUEUE]',JSON[_0x2651('0x2e')](_0x444918));});};exports['outbound']=function(_0x379e2c,_0x65fc63,_0x2536da,_0x226c3a,_0x507c8a,_0x51ecfd,_0x2844b3){var _0x33f458,_0x280be4;_0x51ecfd[_0x2651('0x1b')]=intUtil[_0x2651('0x4d')](_0x51ecfd['remoteUri']);_0x51ecfd[_0x2651('0x3e')]=intUtil[_0x2651('0x4d')](_0x51ecfd[_0x2651('0x3e')]);if(_0x2844b3&&_0x2844b3[_0x2651('0x4e')]&&_0x2844b3[_0x2651('0x4e')]!==_0x2651('0x4f')){logger[_0x2651('0xc')](_0x2651('0x50'),_0x2651('0x41'));_0x65fc63[_0x2651('0x42')]=util[_0x2651('0xe')](_0x2651('0x51'),_0x51ecfd['serverUrl'],_0x65fc63[_0x2651('0x43')],md5(_0x65fc63['uniqueid']));}headers[_0x2651('0x44')]=getAuth(_0x51ecfd);return getUser(_0x51ecfd,_0x226c3a['email'])[_0x2651('0x1d')](function(_0x5a7175){_0x33f458=_0x5a7175;logger[_0x2651('0xc')](_0x2651('0x46'),_0x33f458['id']);return getEndUser(_0x51ecfd,_0x65fc63['destcalleridname'],_0x65fc63[_0x2651('0x52')]);})['then'](function(_0x4e4f29){_0x280be4=_0x4e4f29;logger[_0x2651('0xc')]('The\x20Enduser\x20ID\x20is:',_0x280be4['id']);return getTicket(_0x51ecfd,_0x33f458,_0x280be4,_0x2536da,_0x65fc63);})['then'](function(_0x3c728b){if(_0x3c728b&&_0x3c728b['id']){logger[_0x2651('0xc')]('Ticket\x20created!');logger['info'](_0x2651('0x48'),_0x3c728b['id']);logger[_0x2651('0xc')](_0x2651('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2651('0xe')]('user:%s',_0x226c3a[_0x2651('0x15')]),_0x2651('0x4b'),{'uri':util[_0x2651('0xe')](_0x2651('0x53'),_0x51ecfd['remoteUri'],_0x3c728b['id'])});}})[_0x2651('0x4c')](function(_0x127cf2){logger[_0x2651('0x54')](_0x2651('0x50'),JSON['stringify'](_0x127cf2));});};exports[_0x2651('0x55')]=function(_0x3f2c7e,_0x2e8519,_0x310051,_0x1ee2e9,_0x1f2f2b,_0x41309f){var _0x13275d,_0x4acb77;_0x41309f['remoteUri']=intUtil[_0x2651('0x4d')](_0x41309f['remoteUri']);_0x41309f['serverUrl']=intUtil[_0x2651('0x4d')](_0x41309f['serverUrl']);if(_0x1f2f2b&&_0x1f2f2b[_0x2651('0x3f')]){logger[_0x2651('0xc')]('['+_0x2e8519[_0x2651('0x56')][_0x2651('0x57')]()+']',_0x2651('0x41'));_0x2e8519[_0x2651('0x42')]=util['format'](_0x2651('0x51'),_0x41309f[_0x2651('0x3e')],_0x2e8519[_0x2651('0x43')],md5(_0x2e8519[_0x2651('0x43')]));}else{_0x2e8519[_0x2651('0x42')]='';}headers['Authorization']=getAuth(_0x41309f);return getUser(_0x41309f,'')[_0x2651('0x1d')](function(_0x516027){_0x13275d=_0x516027;logger[_0x2651('0xc')]('The\x20User\x20ID\x20is:',_0x13275d['id']);return getEndUser(_0x41309f,_0x2e8519[_0x2651('0x10')],_0x2e8519[_0x2651('0x11')]);})[_0x2651('0x1d')](function(_0x51aca4){_0x4acb77=_0x51aca4;logger[_0x2651('0xc')](_0x2651('0x47'),_0x4acb77['id']);return getTicket(_0x41309f,_0x13275d,_0x4acb77,_0x310051,_0x2e8519);})[_0x2651('0x1d')](function(_0xf3417f){if(_0xf3417f){logger['info'](_0x2651('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xf3417f['id']);}})[_0x2651('0x4c')](function(_0xb97b62){logger[_0x2651('0x54')]('['+_0x2e8519[_0x2651('0x56')]['toUpperCase']()+']',JSON[_0x2651('0x2e')](_0xb97b62));});}; \ No newline at end of file +var _0x5e84=['../../../../config/logger','defaults','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','
','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','base64','[HTTP]','stringify','GET','map','forEach','string','nameField','customField','content','toString','type','idField','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','destcalleridname','destcalleridnum','[OUTBOUND]','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x164087,_0x56d757){var _0x3e9266=function(_0x4493de){while(--_0x4493de){_0x164087['push'](_0x164087['shift']());}};_0x3e9266(++_0x56d757);}(_0x5e84,0x166));var _0x45e8=function(_0x24b649,_0x570400){_0x24b649=_0x24b649-0x0;var _0x48cae2=_0x5e84[_0x24b649];return _0x48cae2;};'use strict';var _=require(_0x45e8('0x0'));var rp=require('request-promise');var md5=require(_0x45e8('0x1'));var util=require(_0x45e8('0x2'));var Redis=require(_0x45e8('0x3'));var intUtil=require(_0x45e8('0x4'));var config=require(_0x45e8('0x5'));var logger=require(_0x45e8('0x6'))('freshdesk');config['redis']=_[_0x45e8('0x7')](config[_0x45e8('0x8')],{'host':_0x45e8('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x45e8('0x8')]));var headers={'Content-Type':_0x45e8('0xa'),'Accept':'application/json'};function emit(_0x2d6bb0,_0x280601,_0x165c31){io['to'](_0x2d6bb0)[_0x45e8('0xb')](_0x280601,_0x165c31);}function getTicket(_0x479525,_0xec742b,_0x3adbcd,_0x329ac0,_0x128df4){logger[_0x45e8('0xc')](_0x45e8('0xd'));var _0x19ca5d=_['merge']({'responder_id':_0xec742b['id'],'requester_id':_0x3adbcd['id'],'name':util[_0x45e8('0xe')](_0x45e8('0xf'),_0x128df4['calleridname']),'phone':_0x128df4[_0x45e8('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x329ac0[_0x45e8('0x11')],_0x128df4,'\x20'),'description':intUtil[_0x45e8('0x12')](_0x329ac0[_0x45e8('0x13')],_0x128df4,_0x45e8('0x14')),'tags':getTags(_0x329ac0['Tags'],_0x45e8('0x15'))},getCustomFields(_0x329ac0[_0x45e8('0x16')],_0x128df4));_0x19ca5d[_0x45e8('0x17')]=_['mapValues'](_[_0x45e8('0x18')](_0x19ca5d['custom_fields'],'id'),'value');return request({'uri':util[_0x45e8('0xe')](_0x45e8('0x19'),_0x479525[_0x45e8('0x1a')]),'method':_0x45e8('0x1b'),'body':_0x19ca5d})[_0x45e8('0x1c')](function(_0x560942){logger['info'](_0x45e8('0x1d'));return _0x560942;});}function getUser(_0x45d4c1,_0x46f480){if(intUtil['validateEmail'](_0x46f480)){return request({'uri':util[_0x45e8('0xe')](_0x45e8('0x1e'),_0x45d4c1[_0x45e8('0x1a')]),'qs':{'email':_0x46f480}})[_0x45e8('0x1c')](function(_0x20a949){if(_0x20a949[_0x45e8('0x1f')]){logger[_0x45e8('0xc')](_0x45e8('0x20'));return _['find'](_0x20a949,function(_0x10afff){return _0x10afff[_0x45e8('0x21')][_0x45e8('0x22')]===_0x46f480;});}else{logger[_0x45e8('0xc')](_0x45e8('0x23'));return request({'uri':util[_0x45e8('0xe')]('%s/api/v2/agents/me',_0x45d4c1[_0x45e8('0x1a')])})[_0x45e8('0x1c')](function(_0xd6db1e){logger[_0x45e8('0xc')](_0x45e8('0x24'));return _0xd6db1e;});}});}else{logger[_0x45e8('0xc')](_0x45e8('0x25'));return request({'uri':util[_0x45e8('0xe')](_0x45e8('0x26'),_0x45d4c1['remoteUri'])})[_0x45e8('0x1c')](function(_0xfb7038){logger[_0x45e8('0xc')](_0x45e8('0x24'));return _0xfb7038;});}}function getEndUser(_0x44cd2a,_0x3f8659,_0x3e5c7a){logger[_0x45e8('0xc')]('Searching\x20enduser\x20with\x20phone',_0x3e5c7a);return request({'uri':util[_0x45e8('0xe')](_0x45e8('0x27'),_0x44cd2a[_0x45e8('0x1a')]),'qs':{'phone':_0x3e5c7a}})['then'](function(_0x275cc9){if(_0x275cc9['length']){logger[_0x45e8('0xc')]('Enduser\x20found!');return _[_0x45e8('0x28')](_0x275cc9,{'phone':_0x3e5c7a});}else{logger[_0x45e8('0xc')](_0x45e8('0x29'));return request({'uri':util['format']('%s/api/v2/contacts',_0x44cd2a['remoteUri']),'method':'POST','body':{'name':_0x3f8659,'phone':_0x3e5c7a}})[_0x45e8('0x1c')](function(_0x26dd0d){logger[_0x45e8('0xc')](_0x45e8('0x2a'));return _0x26dd0d;});}});}function getAuth(_0x26a7e6){return util[_0x45e8('0xe')]('Basic\x20%s',new Buffer(_0x26a7e6[_0x45e8('0x2b')]+':X')['toString'](_0x45e8('0x2c')));}function request(_0x4fc1e8){logger['debug'](_0x45e8('0x2d'),JSON[_0x45e8('0x2e')](_0x4fc1e8));return rp(_[_0x45e8('0x7')](_0x4fc1e8,{'method':_0x45e8('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x53ef51,_0x5578c7){var _0xfd5956=[];if(_0x53ef51&&_0x53ef51[_0x45e8('0x1f')]>0x0){_0xfd5956=_[_0x45e8('0x30')](_0x53ef51,_0x5578c7);}return _0xfd5956;}function getCustomFields(_0x451f4c,_0x22821a){var _0xb7cf29=[];var _0xb9f485={'custom_fields':[]};if(_0x451f4c[_0x45e8('0x1f')]>0x0){_[_0x45e8('0x31')](_0x451f4c,function(_0x277e13){if(_['includes']([_0x45e8('0x32'),'picklist'],_0x277e13['type'])&&_0x277e13[_0x45e8('0x33')]&&!_0x277e13[_0x45e8('0x34')]){_0xb9f485[_0x277e13[_0x45e8('0x33')]['toLowerCase']()]=_0x277e13[_0x45e8('0x35')][_0x45e8('0x36')]();}else if(_['includes']([_0x45e8('0x32'),'picklist'],_0x277e13[_0x45e8('0x37')])&&_0x277e13[_0x45e8('0x38')]&&_0x277e13['customField']){_0xb9f485[_0x45e8('0x17')][_0x45e8('0x39')]({'id':_0x277e13[_0x45e8('0x38')],'value':_0x277e13[_0x45e8('0x35')][_0x45e8('0x36')]()});}else if(_0x277e13['type']===_0x45e8('0x3a')&&_0x277e13['variableName']&&_0x277e13[_0x45e8('0x38')]&&_0x277e13[_0x45e8('0x34')]){_0x22821a[_0x277e13[_0x45e8('0x3b')]]&&_0xb9f485[_0x45e8('0x17')][_0x45e8('0x39')]({'id':_0x277e13[_0x45e8('0x38')],'value':_0x22821a[_0x277e13[_0x45e8('0x3b')]][_0x45e8('0x36')]()});}else if(_0x277e13[_0x45e8('0x37')]===_0x45e8('0x3c')&&_0x277e13[_0x45e8('0x3d')]&&_0x277e13['Variable'][_0x45e8('0x15')]&&_0x277e13[_0x45e8('0x38')]&&_0x277e13[_0x45e8('0x34')]){_0x22821a[_0x277e13[_0x45e8('0x3d')][_0x45e8('0x15')][_0x45e8('0x3e')]()]&&_0xb9f485[_0x45e8('0x17')][_0x45e8('0x39')]({'id':_0x277e13['idField'],'value':_0x22821a[_0x277e13[_0x45e8('0x3d')][_0x45e8('0x15')][_0x45e8('0x3e')]()]['toString']()});}});}return _0xb9f485;}exports[_0x45e8('0x3f')]=function(_0xaceec8,_0x32ae64,_0x781928,_0x1f2a39,_0x73b3ce,_0x2af4b3){var _0x5cafab,_0x4e1e00;_0x2af4b3['remoteUri']=intUtil['stripTrailingSlash'](_0x2af4b3['remoteUri']);_0x2af4b3[_0x45e8('0x40')]=intUtil[_0x45e8('0x41')](_0x2af4b3['serverUrl']);if(_0x73b3ce&&_0x73b3ce[_0x45e8('0x42')]){logger[_0x45e8('0xc')](_0x45e8('0x43'),_0x45e8('0x44'));_0x32ae64[_0x45e8('0x45')]=util[_0x45e8('0xe')](_0x45e8('0x46'),_0x2af4b3[_0x45e8('0x40')],_0x32ae64[_0x45e8('0x47')],md5(_0x32ae64['uniqueid']));}else{_0x32ae64['recordingURL']='';}headers[_0x45e8('0x48')]=getAuth(_0x2af4b3);return getUser(_0x2af4b3,_0x1f2a39[_0x45e8('0x22')])[_0x45e8('0x1c')](function(_0x3786da){_0x5cafab=_0x3786da;logger[_0x45e8('0xc')](_0x45e8('0x49'),_0x5cafab['id']);return getEndUser(_0x2af4b3,_0x32ae64['calleridname'],_0x32ae64[_0x45e8('0x10')]);})[_0x45e8('0x1c')](function(_0x29d3ef){_0x4e1e00=_0x29d3ef;logger[_0x45e8('0xc')](_0x45e8('0x4a'),_0x4e1e00['id']);return getTicket(_0x2af4b3,_0x5cafab,_0x4e1e00,_0x781928,_0x32ae64);})[_0x45e8('0x1c')](function(_0x7a2a2){if(_0x7a2a2&&_0x7a2a2['id']){logger[_0x45e8('0xc')](_0x45e8('0x1d'));logger[_0x45e8('0xc')](_0x45e8('0x4b'),_0x7a2a2['id']);logger['info'](_0x45e8('0x43'),_0x45e8('0x4c'));emit(util[_0x45e8('0xe')](_0x45e8('0x4d'),_0x1f2a39[_0x45e8('0x15')]),_0x45e8('0x4e'),{'uri':util[_0x45e8('0xe')](_0x45e8('0x4f'),_0x2af4b3[_0x45e8('0x1a')],_0x7a2a2['id'])});}})[_0x45e8('0x50')](function(_0x140758){logger[_0x45e8('0x51')]('[QUEUE]',JSON[_0x45e8('0x2e')](_0x140758));});};exports[_0x45e8('0x52')]=function(_0x30ead0,_0xcf6cd3,_0xe1117d,_0x5e739f,_0x184c51,_0x5b606e,_0x3f274d){var _0x4464ad,_0x2a264f;_0x5b606e['remoteUri']=intUtil[_0x45e8('0x41')](_0x5b606e['remoteUri']);_0x5b606e[_0x45e8('0x40')]=intUtil[_0x45e8('0x41')](_0x5b606e[_0x45e8('0x40')]);if(_0x3f274d&&_0x3f274d[_0x45e8('0x53')]&&_0x3f274d[_0x45e8('0x53')]!=='none'){logger[_0x45e8('0xc')]('[OUTBOUND]',_0x45e8('0x44'));_0xcf6cd3[_0x45e8('0x45')]=util[_0x45e8('0xe')](_0x45e8('0x46'),_0x5b606e[_0x45e8('0x40')],_0xcf6cd3[_0x45e8('0x47')],md5(_0xcf6cd3[_0x45e8('0x47')]));}headers[_0x45e8('0x48')]=getAuth(_0x5b606e);return getUser(_0x5b606e,_0x5e739f[_0x45e8('0x22')])[_0x45e8('0x1c')](function(_0x5432a3){_0x4464ad=_0x5432a3;logger['info'](_0x45e8('0x49'),_0x4464ad['id']);return getEndUser(_0x5b606e,_0xcf6cd3[_0x45e8('0x54')],_0xcf6cd3[_0x45e8('0x55')]);})[_0x45e8('0x1c')](function(_0x1316c1){_0x2a264f=_0x1316c1;logger[_0x45e8('0xc')](_0x45e8('0x4a'),_0x2a264f['id']);return getTicket(_0x5b606e,_0x4464ad,_0x2a264f,_0xe1117d,_0xcf6cd3);})[_0x45e8('0x1c')](function(_0x1781eb){if(_0x1781eb&&_0x1781eb['id']){logger['info']('Ticket\x20created!');logger[_0x45e8('0xc')](_0x45e8('0x4b'),_0x1781eb['id']);logger['info'](_0x45e8('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x45e8('0xe')](_0x45e8('0x4d'),_0x5e739f[_0x45e8('0x15')]),_0x45e8('0x4e'),{'uri':util[_0x45e8('0xe')](_0x45e8('0x4f'),_0x5b606e[_0x45e8('0x1a')],_0x1781eb['id'])});}})[_0x45e8('0x50')](function(_0x507201){logger[_0x45e8('0x51')](_0x45e8('0x56'),JSON[_0x45e8('0x2e')](_0x507201));});};exports[_0x45e8('0x57')]=function(_0x1c258c,_0x56984b,_0x517c7c,_0x3fd5ae,_0x12913d,_0x3a3380){var _0x1c947d,_0x4a0511;_0x3a3380[_0x45e8('0x1a')]=intUtil[_0x45e8('0x41')](_0x3a3380[_0x45e8('0x1a')]);_0x3a3380['serverUrl']=intUtil[_0x45e8('0x41')](_0x3a3380[_0x45e8('0x40')]);if(_0x12913d&&_0x12913d[_0x45e8('0x42')]){logger[_0x45e8('0xc')]('['+_0x56984b[_0x45e8('0x58')][_0x45e8('0x59')]()+']','Recording\x20is\x20enabled!');_0x56984b['recordingURL']=util[_0x45e8('0xe')](_0x45e8('0x46'),_0x3a3380['serverUrl'],_0x56984b[_0x45e8('0x47')],md5(_0x56984b[_0x45e8('0x47')]));}else{_0x56984b['recordingURL']='';}headers[_0x45e8('0x48')]=getAuth(_0x3a3380);return getUser(_0x3a3380,'')['then'](function(_0x33fd76){_0x1c947d=_0x33fd76;logger[_0x45e8('0xc')](_0x45e8('0x49'),_0x1c947d['id']);return getEndUser(_0x3a3380,_0x56984b[_0x45e8('0x5a')],_0x56984b[_0x45e8('0x10')]);})[_0x45e8('0x1c')](function(_0x549965){_0x4a0511=_0x549965;logger[_0x45e8('0xc')](_0x45e8('0x4a'),_0x4a0511['id']);return getTicket(_0x3a3380,_0x1c947d,_0x4a0511,_0x517c7c,_0x56984b);})[_0x45e8('0x1c')](function(_0x2e4fad){if(_0x2e4fad){logger[_0x45e8('0xc')]('Ticket\x20created!');logger[_0x45e8('0xc')](_0x45e8('0x4b'),_0x2e4fad['id']);}})[_0x45e8('0x50')](function(_0x5b87a5){logger[_0x45e8('0x51')]('['+_0x56984b[_0x45e8('0x58')]['toUpperCase']()+']',JSON[_0x45e8('0x2e')](_0x5b87a5));});}; \ 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 9a6bb1f..daaaff3 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 _0x7f94=['agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','YYYY-MM-DDTHH:mm:ss','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','ticketId','name','inspect','lodash','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list'];(function(_0x28125e,_0x370d11){var _0x2c694f=function(_0x24fa54){while(--_0x24fa54){_0x28125e['push'](_0x28125e['shift']());}};_0x2c694f(++_0x370d11);}(_0x7f94,0x1ea));var _0x47f9=function(_0x3ed0e1,_0xa0a0d3){_0x3ed0e1=_0x3ed0e1-0x0;var _0x3f06dd=_0x7f94[_0x3ed0e1];return _0x3f06dd;};'use strict';var _=require(_0x47f9('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x47f9('0x1'));var moment=require(_0x47f9('0x2'));var Promise=require(_0x47f9('0x3'));var Redis=require(_0x47f9('0x4'));var intUtil=require('./util');var config=require(_0x47f9('0x5'));var logger=require('../../../../config/logger')(_0x47f9('0x6'));config[_0x47f9('0x7')]=_[_0x47f9('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x47f9('0x7')]));function getAdminId(_0x89d12c,_0x419da9,_0x4e4811,_0xc24f6d){return new Promise(function(_0x1979bc,_0x3ed359){var _0x1836b9=![];var _0x63afef={'method':_0x47f9('0x9'),'uri':_0xc24f6d+_0x47f9('0xa'),'json':!![]};_0x63afef[_0x47f9('0xb')]=_0x4e4811;logger[_0x47f9('0xc')](_0x47f9('0xd'));return rp(_0x63afef)[_0x47f9('0xe')](function(_0x3f90e1){if(_0x3f90e1){var _0x431430=_0x3f90e1[_0x47f9('0xf')];var _0x169c38=null;for(_0x169c38=0x0;_0x169c38<_0x431430[_0x47f9('0x10')];_0x169c38++){if(_0x431430[_0x169c38][_0x47f9('0x11')]===_0x89d12c[_0x47f9('0x12')]){_0x89d12c['adminId']=_0x431430[_0x169c38]['id'];_0x1836b9=!![];}}if(_0x1836b9){logger['info'](_0x47f9('0x13'),_0x89d12c[_0x47f9('0x14')]);_0x1979bc(_0x89d12c);}else{_0x3ed359({'statusCode':0x194,'message':_0x47f9('0x15')});}}else{_0x3ed359({'statusCode':0x194,'message':_0x47f9('0x15')});}})[_0x47f9('0x16')](function(_0x1f73a4){logger[_0x47f9('0x17')]('['+[_0x419da9[_0x47f9('0x18')]()]+']',_0x1f73a4['message']);_0x3ed359(_0x1f73a4);});});}function getUser(_0x4e60d6,_0x2a853a,_0x5dfc64){return function(_0x2218f5){return new Promise(function(_0x2c43f8,_0x28f67e){var _0x2f6e49={'method':_0x47f9('0x9'),'uri':_0x5dfc64+_0x47f9('0xa'),'json':!![]};_0x2f6e49[_0x47f9('0xb')]=_0x2a853a;logger[_0x47f9('0xc')](_0x47f9('0x19'));return rp(_0x2f6e49)[_0x47f9('0xe')](function(_0x4f5f1a){if(_0x4f5f1a){var _0x3e68d4=_0x4f5f1a['users'];var _0x441341=![];var _0x54c127=null;if(_0x2218f5[_0x47f9('0x1a')]!==null){logger['info'](_0x47f9('0x1b'),_0x2218f5['agentEmail']);_0x2218f5[_0x47f9('0x1c')]=_0x2218f5[_0x47f9('0x1a')];for(_0x54c127=0x0;_0x54c127<_0x3e68d4[_0x47f9('0x10')];_0x54c127++){if(_0x3e68d4[_0x54c127][_0x47f9('0x11')]===_0x2218f5[_0x47f9('0x1a')]){_0x441341=!![];_0x2218f5[_0x47f9('0x1d')]=_0x3e68d4[_0x54c127]['id'];logger[_0x47f9('0xc')]('User\x20found:',_0x2218f5[_0x47f9('0x1d')]);}}}if(!_0x441341){logger['info'](_0x47f9('0x1e'));_0x2218f5[_0x47f9('0x1c')]=_0x2218f5[_0x47f9('0x12')];_0x2218f5[_0x47f9('0x1d')]=_0x2218f5[_0x47f9('0x14')];_0x441341=!![];}if(_0x441341){_0x2c43f8(_0x2218f5);}else{_0x28f67e({'statusCode':0x194,'message':_0x47f9('0x15')});}}else{_0x28f67e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x47f9('0x16')](function(_0xad26ae){logger[_0x47f9('0x17')]('['+[_0x4e60d6['toUpperCase']()]+']',_0xad26ae[_0x47f9('0x1f')]);_0x28f67e(_0xad26ae);});});};}function searchContact(_0x155a1e,_0x5174de,_0x2416b3,_0x1571e4){return new Promise(function(_0x143f32,_0x332a73){var _0x5c4e38={'method':_0x47f9('0x9'),'headers':_0x5174de,'uri':_0x155a1e+_0x47f9('0x20')+_0x1571e4+_0x47f9('0x21')+_0x2416b3+_0x47f9('0x22'),'json':!![]};rp(_0x5c4e38)['then'](function(_0x385b4a){var _0x109e46=_['find'](_0x385b4a[_0x47f9('0x23')]['contacts'],[_0x2416b3,_0x1571e4]);_0x143f32(_0x109e46);})['catch'](function(_0xa51652){_0x332a73(_0xa51652);});});}function getEndUser(_0x5d1414,_0x19eb1,_0x6dbc04){return function(_0x200a27){return new Promise(function(_0xb46e8,_0x59f708){logger[_0x47f9('0xc')](util[_0x47f9('0x24')](_0x47f9('0x25'),_0x200a27[_0x47f9('0x26')]));searchContact(_0x6dbc04,_0x19eb1,_0x47f9('0x27'),_0x200a27[_0x47f9('0x26')])['then'](function(_0x585af0){if(_0x585af0){_0x200a27['endUserId']=_0x585af0['id'];logger['info'](_0x47f9('0x28'),_0x200a27[_0x47f9('0x29')]);return _0xb46e8(_0x200a27);}searchContact(_0x6dbc04,_0x19eb1,_0x47f9('0x2a'),_0x200a27[_0x47f9('0x26')])[_0x47f9('0xe')](function(_0x3dc5ed){if(_0x3dc5ed){_0x200a27[_0x47f9('0x29')]=_0x3dc5ed['id'];logger[_0x47f9('0xc')](_0x47f9('0x2b'),_0x200a27[_0x47f9('0x29')]);return _0xb46e8(_0x200a27);}createEndUser(_0x200a27,_0x5d1414,_0x19eb1,_0x6dbc04)[_0x47f9('0xe')](function(_0x2f46d5){logger[_0x47f9('0xc')](_0x47f9('0x2c'),_0x2f46d5[_0x47f9('0x29')]);return _0xb46e8(_0x2f46d5);});});})[_0x47f9('0x16')](function(_0x5a9a7e){_0x59f708(_0x5a9a7e);});});};}function createEndUser(_0x428237,_0x8ddd3d,_0x208814,_0x5dc1df){return new Promise(function(_0x591362,_0x2fcb56){var _0x1eb476=moment();var _0x247e0c={'method':_0x47f9('0x2d'),'uri':_0x5dc1df+_0x47f9('0x2e'),'body':{'contact':{'last_name':_0x428237[_0x47f9('0x26')],'work_number':_0x428237['contactNumber'],'mobile_number':_0x428237['contactNumber'],'owner_id':_0x428237[_0x47f9('0x1d')],'created_at':_0x1eb476[_0x47f9('0x24')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x247e0c[_0x47f9('0xb')]=_0x208814;logger[_0x47f9('0xc')](_0x47f9('0x2f'));return rp(_0x247e0c)['then'](function(_0x212f19){_0x428237[_0x47f9('0x29')]=_0x212f19[_0x47f9('0x30')]['id'];_0x591362(_0x428237);})['catch'](function(_0x43e45e){logger[_0x47f9('0x17')]('['+[_0x8ddd3d['toUpperCase']()]+']',_0x43e45e['message']);_0x2fcb56(_0x43e45e[_0x47f9('0x1f')]);});});}function getTicket(_0x2fe4d2,_0x1b51c2,_0x5bbda1,_0x388dac,_0x53078b){return function(_0x9414bc){logger[_0x47f9('0xc')](_0x47f9('0x31'));return new Promise(function(_0xdbdfaf,_0x1a8756){var _0x4aef5b=moment();var _0x50b6ab={'method':'POST','uri':_0x5bbda1+_0x47f9('0x32'),'body':{'title':intUtil[_0x47f9('0x33')](_0x388dac[_0x47f9('0x34')],_0x53078b,'\x20'),'description':intUtil[_0x47f9('0x33')](_0x388dac[_0x47f9('0x35')],_0x53078b,'\x0a'),'owner_id':_0x9414bc[_0x47f9('0x1d')],'creater_id':_0x9414bc[_0x47f9('0x14')],'targetable_id':_0x9414bc[_0x47f9('0x29')],'targetable_type':_0x47f9('0x36'),'created_at':_0x4aef5b[_0x47f9('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x4aef5b[_0x47f9('0x37')](0x1e,'m')[_0x47f9('0x24')](_0x47f9('0x38'))},'json':!![]};_0x50b6ab[_0x47f9('0xb')]=_0x1b51c2;return rp(_0x50b6ab)['then'](function(_0x3f2c74){_0x9414bc['ticketId']=_0x3f2c74['task']['id'];logger['info'](_0x47f9('0x39'),_0x9414bc['ticketId']);_0xdbdfaf(_0x9414bc);})[_0x47f9('0x16')](function(_0x1ef691){logger[_0x47f9('0x17')]('['+[_0x2fe4d2[_0x47f9('0x18')]()]+']',_0x1ef691[_0x47f9('0x1f')]);_0x1a8756(_0x1ef691[_0x47f9('0x1f')]);});});};}function emit(_0x146f41,_0x153ef1,_0x4c676c){var _0x4bb6ed={'uri':_0x146f41+_0x47f9('0x3a')+_0x4c676c};io['to'](util[_0x47f9('0x24')](_0x47f9('0x3b'),_0x153ef1))[_0x47f9('0x3c')](_0x47f9('0x3d'),_0x4bb6ed);}exports['cs']=function(_0x1fe16d,_0x208f8d,_0x1da808,_0x315e0b,_0x4cdd1b,_0x588a42,_0x3345ff,_0x32e4cb){var _0x1e4afb={};var _0x5801fb={'Authorization':_0x47f9('0x3e')+_0x588a42[_0x47f9('0x3f')]};_0x588a42[_0x47f9('0x40')]=intUtil[_0x47f9('0x41')](_0x588a42[_0x47f9('0x40')]);_0x588a42[_0x47f9('0x42')]=intUtil[_0x47f9('0x41')](_0x588a42[_0x47f9('0x42')]);var _0x2105a3=_0x588a42[_0x47f9('0x40')];_0x1e4afb['adminEmail']=_0x588a42['username'];_0x1e4afb['contactNumber']=_0x32e4cb[_0x47f9('0x43')]()===_0x47f9('0x44')?_0x208f8d[_0x47f9('0x45')]:_0x208f8d[_0x47f9('0x46')];_0x1e4afb[_0x47f9('0x47')]=_0x32e4cb===_0x47f9('0x48')||_0x32e4cb===_0x47f9('0x49')?_0x47f9('0x48'):_0x47f9('0x44');if(_0x315e0b){_0x1e4afb[_0x47f9('0x1a')]=_0x315e0b[_0x47f9('0x11')];}var _0x5dea9e=util[_0x47f9('0x24')](_0x47f9('0x4a'),_0x588a42[_0x47f9('0x42')],_0x208f8d[_0x47f9('0x4b')],md5(_0x208f8d[_0x47f9('0x4b')]));if(_0x4cdd1b&&_0x4cdd1b[_0x47f9('0x4c')]){logger[_0x47f9('0xc')](_0x47f9('0x4d'),_0x47f9('0x4e'));_0x208f8d[_0x47f9('0x4f')]=_0x5dea9e;}else if(_0x3345ff&&_0x3345ff['recordingFormat']&&_0x3345ff[_0x47f9('0x50')]!=='none'){logger[_0x47f9('0xc')](_0x47f9('0x51'),_0x47f9('0x4e'));_0x208f8d[_0x47f9('0x4f')]=_0x5dea9e;}else{_0x208f8d[_0x47f9('0x4f')]='';}return getAdminId(_0x1e4afb,_0x32e4cb,_0x5801fb,_0x2105a3)[_0x47f9('0xe')](getUser(_0x32e4cb,_0x5801fb,_0x2105a3))[_0x47f9('0xe')](getEndUser(_0x32e4cb,_0x5801fb,_0x2105a3))[_0x47f9('0xe')](getTicket(_0x32e4cb,_0x5801fb,_0x2105a3,_0x1da808,_0x208f8d))[_0x47f9('0xe')](function(_0x589139){logger[_0x47f9('0xc')](util[_0x47f9('0x24')](_0x47f9('0x52'),_0x589139[_0x47f9('0x53')]));if(_0x32e4cb!==_0x47f9('0x49')){logger['info']('['+[_0x32e4cb[_0x47f9('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x2105a3,_0x315e0b[_0x47f9('0x54')],_0x589139[_0x47f9('0x29')]);}})['catch'](function(_0x2b4a68){logger['error']('['+[_0x32e4cb[_0x47f9('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x47f9('0x55')](_0x2b4a68,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8b0b=[']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','ioredis','./util','freshsales','redis','defaults','socket.io-emitter','/api/selector/owners','headers','info','then','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','Getting\x20user\x20list','users','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...'];(function(_0x57014b,_0x360c0f){var _0x2b258a=function(_0x52c4a3){while(--_0x52c4a3){_0x57014b['push'](_0x57014b['shift']());}};_0x2b258a(++_0x360c0f);}(_0x8b0b,0x1b5));var _0xb8b0=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0x8b0b[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xb8b0('0x0'));var rp=require(_0xb8b0('0x1'));var md5=require(_0xb8b0('0x2'));var util=require(_0xb8b0('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0xb8b0('0x4'));var intUtil=require(_0xb8b0('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb8b0('0x6'));config[_0xb8b0('0x7')]=_[_0xb8b0('0x8')](config[_0xb8b0('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xb8b0('0x9'))(new Redis(config[_0xb8b0('0x7')]));function getAdminId(_0x663818,_0x4208dc,_0x747c8e,_0x59f02f){return new Promise(function(_0x303aa9,_0x49ce67){var _0x3b4a07=![];var _0x25425b={'method':'GET','uri':_0x59f02f+_0xb8b0('0xa'),'json':!![]};_0x25425b[_0xb8b0('0xb')]=_0x747c8e;logger[_0xb8b0('0xc')]('Getting\x20admin\x20information');return rp(_0x25425b)[_0xb8b0('0xd')](function(_0x55c30c){if(_0x55c30c){var _0x3841d6=_0x55c30c['users'];var _0x22204c=null;for(_0x22204c=0x0;_0x22204c<_0x3841d6[_0xb8b0('0xe')];_0x22204c++){if(_0x3841d6[_0x22204c][_0xb8b0('0xf')]===_0x663818[_0xb8b0('0x10')]){_0x663818[_0xb8b0('0x11')]=_0x3841d6[_0x22204c]['id'];_0x3b4a07=!![];}}if(_0x3b4a07){logger[_0xb8b0('0xc')](_0xb8b0('0x12'),_0x663818[_0xb8b0('0x11')]);_0x303aa9(_0x663818);}else{_0x49ce67({'statusCode':0x194,'message':_0xb8b0('0x13')});}}else{_0x49ce67({'statusCode':0x194,'message':_0xb8b0('0x13')});}})[_0xb8b0('0x14')](function(_0x3c3192){logger['error']('['+[_0x4208dc[_0xb8b0('0x15')]()]+']',_0x3c3192[_0xb8b0('0x16')]);_0x49ce67(_0x3c3192);});});}function getUser(_0x2a2175,_0x2f6ab4,_0x60f4a4){return function(_0x18f60a){return new Promise(function(_0x3b2687,_0x5ba6e4){var _0x28b87c={'method':_0xb8b0('0x17'),'uri':_0x60f4a4+_0xb8b0('0xa'),'json':!![]};_0x28b87c['headers']=_0x2f6ab4;logger['info'](_0xb8b0('0x18'));return rp(_0x28b87c)['then'](function(_0x200cc6){if(_0x200cc6){var _0x296f4c=_0x200cc6[_0xb8b0('0x19')];var _0x16c50=![];var _0x1e7d56=null;if(_0x18f60a['agentEmail']!==null){logger[_0xb8b0('0xc')]('Getting\x20user\x20with\x20email',_0x18f60a[_0xb8b0('0x1a')]);_0x18f60a[_0xb8b0('0x1b')]=_0x18f60a[_0xb8b0('0x1a')];for(_0x1e7d56=0x0;_0x1e7d56<_0x296f4c[_0xb8b0('0xe')];_0x1e7d56++){if(_0x296f4c[_0x1e7d56][_0xb8b0('0xf')]===_0x18f60a['agentEmail']){_0x16c50=!![];_0x18f60a[_0xb8b0('0x1c')]=_0x296f4c[_0x1e7d56]['id'];logger['info'](_0xb8b0('0x1d'),_0x18f60a[_0xb8b0('0x1c')]);}}}if(!_0x16c50){logger[_0xb8b0('0xc')](_0xb8b0('0x1e'));_0x18f60a[_0xb8b0('0x1b')]=_0x18f60a[_0xb8b0('0x10')];_0x18f60a[_0xb8b0('0x1c')]=_0x18f60a[_0xb8b0('0x11')];_0x16c50=!![];}if(_0x16c50){_0x3b2687(_0x18f60a);}else{_0x5ba6e4({'statusCode':0x194,'message':_0xb8b0('0x13')});}}else{_0x5ba6e4({'statusCode':0x194,'message':_0xb8b0('0x13')});}})[_0xb8b0('0x14')](function(_0x139db7){logger['error']('['+[_0x2a2175[_0xb8b0('0x15')]()]+']',_0x139db7[_0xb8b0('0x16')]);_0x5ba6e4(_0x139db7);});});};}function searchContact(_0x32ec41,_0x30b11e,_0x45f01b,_0x481979){return new Promise(function(_0x46b4c9,_0x4e4c45){var _0x3f40ea={'method':'GET','headers':_0x30b11e,'uri':_0x32ec41+_0xb8b0('0x1f')+_0x481979+_0xb8b0('0x20')+_0x45f01b+_0xb8b0('0x21'),'json':!![]};rp(_0x3f40ea)[_0xb8b0('0xd')](function(_0xf98d2d){var _0x58164e=_[_0xb8b0('0x22')](_0xf98d2d[_0xb8b0('0x23')][_0xb8b0('0x23')],[_0x45f01b,_0x481979]);_0x46b4c9(_0x58164e);})[_0xb8b0('0x14')](function(_0x228dbf){_0x4e4c45(_0x228dbf);});});}function getEndUser(_0x5c5ec4,_0x279ee8,_0x23ebca){return function(_0x47d80b){return new Promise(function(_0x527aab,_0x582ac9){logger[_0xb8b0('0xc')](util[_0xb8b0('0x24')](_0xb8b0('0x25'),_0x47d80b[_0xb8b0('0x26')]));searchContact(_0x23ebca,_0x279ee8,_0xb8b0('0x27'),_0x47d80b[_0xb8b0('0x26')])['then'](function(_0x33bf4d){if(_0x33bf4d){_0x47d80b[_0xb8b0('0x28')]=_0x33bf4d['id'];logger[_0xb8b0('0xc')](_0xb8b0('0x29'),_0x47d80b[_0xb8b0('0x28')]);return _0x527aab(_0x47d80b);}searchContact(_0x23ebca,_0x279ee8,_0xb8b0('0x2a'),_0x47d80b[_0xb8b0('0x26')])[_0xb8b0('0xd')](function(_0x11fd49){if(_0x11fd49){_0x47d80b[_0xb8b0('0x28')]=_0x11fd49['id'];logger[_0xb8b0('0xc')](_0xb8b0('0x2b'),_0x47d80b[_0xb8b0('0x28')]);return _0x527aab(_0x47d80b);}createEndUser(_0x47d80b,_0x5c5ec4,_0x279ee8,_0x23ebca)[_0xb8b0('0xd')](function(_0xc3665a){logger[_0xb8b0('0xc')](_0xb8b0('0x2c'),_0xc3665a[_0xb8b0('0x28')]);return _0x527aab(_0xc3665a);});});})['catch'](function(_0x5c9528){_0x582ac9(_0x5c9528);});});};}function createEndUser(_0x2d38ea,_0x206d27,_0x47f4ef,_0x185aec){return new Promise(function(_0x4793db,_0x105c02){var _0x50b7a3=moment();var _0x491a4e={'method':_0xb8b0('0x2d'),'uri':_0x185aec+_0xb8b0('0x2e'),'body':{'contact':{'last_name':_0x2d38ea[_0xb8b0('0x26')],'work_number':_0x2d38ea[_0xb8b0('0x26')],'mobile_number':_0x2d38ea['contactNumber'],'owner_id':_0x2d38ea[_0xb8b0('0x1c')],'created_at':_0x50b7a3['format'](_0xb8b0('0x2f'))}},'json':!![]};_0x491a4e[_0xb8b0('0xb')]=_0x47f4ef;logger[_0xb8b0('0xc')](_0xb8b0('0x30'));return rp(_0x491a4e)[_0xb8b0('0xd')](function(_0x2df5d2){_0x2d38ea[_0xb8b0('0x28')]=_0x2df5d2[_0xb8b0('0x31')]['id'];_0x4793db(_0x2d38ea);})[_0xb8b0('0x14')](function(_0x4eccd5){logger[_0xb8b0('0x32')]('['+[_0x206d27[_0xb8b0('0x15')]()]+']',_0x4eccd5['message']);_0x105c02(_0x4eccd5[_0xb8b0('0x16')]);});});}function getTicket(_0x4255b9,_0x2d5c33,_0x4548b3,_0x66910c,_0x43c4cb){return function(_0x4a5437){logger[_0xb8b0('0xc')](_0xb8b0('0x33'));return new Promise(function(_0x5920a7,_0x21c795){var _0x5a605d=moment();var _0x5db18b={'method':_0xb8b0('0x2d'),'uri':_0x4548b3+_0xb8b0('0x34'),'body':{'title':intUtil['getString'](_0x66910c['Subjects'],_0x43c4cb,'\x20'),'description':intUtil[_0xb8b0('0x35')](_0x66910c[_0xb8b0('0x36')],_0x43c4cb,'\x0a'),'owner_id':_0x4a5437[_0xb8b0('0x1c')],'creater_id':_0x4a5437[_0xb8b0('0x11')],'targetable_id':_0x4a5437[_0xb8b0('0x28')],'targetable_type':_0xb8b0('0x37'),'created_at':_0x5a605d[_0xb8b0('0x24')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x5a605d[_0xb8b0('0x38')](0x1e,'m')[_0xb8b0('0x24')](_0xb8b0('0x2f'))},'json':!![]};_0x5db18b[_0xb8b0('0xb')]=_0x2d5c33;return rp(_0x5db18b)[_0xb8b0('0xd')](function(_0x29244b){_0x4a5437[_0xb8b0('0x39')]=_0x29244b['task']['id'];logger[_0xb8b0('0xc')](_0xb8b0('0x3a'),_0x4a5437[_0xb8b0('0x39')]);_0x5920a7(_0x4a5437);})[_0xb8b0('0x14')](function(_0x4176a5){logger[_0xb8b0('0x32')]('['+[_0x4255b9[_0xb8b0('0x15')]()]+']',_0x4176a5[_0xb8b0('0x16')]);_0x21c795(_0x4176a5[_0xb8b0('0x16')]);});});};}function emit(_0x2a4d47,_0x58da6f,_0x3fc220){var _0x391f35={'uri':_0x2a4d47+'/contacts/'+_0x3fc220};io['to'](util[_0xb8b0('0x24')](_0xb8b0('0x3b'),_0x58da6f))[_0xb8b0('0x3c')](_0xb8b0('0x3d'),_0x391f35);}exports['cs']=function(_0x13da48,_0x1fa89e,_0x3b82e2,_0x1845fc,_0x585a99,_0x3f4132,_0x2a451b,_0x136a88){var _0x2631ab={};var _0x442cae={'Authorization':_0xb8b0('0x3e')+_0x3f4132[_0xb8b0('0x3f')]};_0x3f4132[_0xb8b0('0x40')]=intUtil[_0xb8b0('0x41')](_0x3f4132[_0xb8b0('0x40')]);_0x3f4132[_0xb8b0('0x42')]=intUtil[_0xb8b0('0x41')](_0x3f4132[_0xb8b0('0x42')]);var _0x22a835=_0x3f4132[_0xb8b0('0x40')];_0x2631ab[_0xb8b0('0x10')]=_0x3f4132[_0xb8b0('0x43')];_0x2631ab[_0xb8b0('0x26')]=_0x136a88[_0xb8b0('0x44')]()==='outbound'?_0x1fa89e[_0xb8b0('0x45')]:_0x1fa89e[_0xb8b0('0x46')];_0x2631ab[_0xb8b0('0x47')]=_0x136a88===_0xb8b0('0x48')||_0x136a88===_0xb8b0('0x49')?_0xb8b0('0x48'):_0xb8b0('0x4a');if(_0x1845fc){_0x2631ab[_0xb8b0('0x1a')]=_0x1845fc['email'];}var _0x17bed2=util[_0xb8b0('0x24')](_0xb8b0('0x4b'),_0x3f4132[_0xb8b0('0x42')],_0x1fa89e[_0xb8b0('0x4c')],md5(_0x1fa89e[_0xb8b0('0x4c')]));if(_0x585a99&&_0x585a99[_0xb8b0('0x4d')]){logger['info'](_0xb8b0('0x4e'),_0xb8b0('0x4f'));_0x1fa89e['recordingURL']=_0x17bed2;}else if(_0x2a451b&&_0x2a451b[_0xb8b0('0x50')]&&_0x2a451b[_0xb8b0('0x50')]!=='none'){logger[_0xb8b0('0xc')](_0xb8b0('0x51'),_0xb8b0('0x4f'));_0x1fa89e[_0xb8b0('0x52')]=_0x17bed2;}else{_0x1fa89e[_0xb8b0('0x52')]='';}return getAdminId(_0x2631ab,_0x136a88,_0x442cae,_0x22a835)[_0xb8b0('0xd')](getUser(_0x136a88,_0x442cae,_0x22a835))['then'](getEndUser(_0x136a88,_0x442cae,_0x22a835))[_0xb8b0('0xd')](getTicket(_0x136a88,_0x442cae,_0x22a835,_0x3b82e2,_0x1fa89e))[_0xb8b0('0xd')](function(_0x1636c4){logger[_0xb8b0('0xc')](util['format'](_0xb8b0('0x53'),_0x1636c4[_0xb8b0('0x39')]));if(_0x136a88!==_0xb8b0('0x49')){logger['info']('['+[_0x136a88[_0xb8b0('0x15')]()]+']',_0xb8b0('0x54'));emit(_0x22a835,_0x1845fc['name'],_0x1636c4[_0xb8b0('0x28')]);}})[_0xb8b0('0x14')](function(_0x2b8655){logger[_0xb8b0('0x32')]('['+[_0x136a88[_0xb8b0('0x15')]()]+_0xb8b0('0x55'),util[_0xb8b0('0x56')](_0x2b8655,{'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 1e8279c..fe1ee86 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 _0x502f=['./zoho','./desk','./vtiger','./servicenow','./freshsales','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','freshdesk','error','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk'];(function(_0x4dfafb,_0x4bc1f2){var _0x595625=function(_0xddaef3){while(--_0xddaef3){_0x4dfafb['push'](_0x4dfafb['shift']());}};_0x595625(++_0x4bc1f2);}(_0x502f,0x16d));var _0xf502=function(_0x2d86b4,_0x4b4ff0){_0x2d86b4=_0x2d86b4-0x0;var _0x41f5ed=_0x502f[_0x2d86b4];return _0x41f5ed;};'use strict';var _=require(_0xf502('0x0'));var util=require(_0xf502('0x1'));var zendesk=require(_0xf502('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0xf502('0x3'));var freshdesk=require(_0xf502('0x4'));var zoho=require(_0xf502('0x5'));var desk=require(_0xf502('0x6'));var vtiger=require(_0xf502('0x7'));var servicenow=require(_0xf502('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0xf502('0x9'));var integrations=['zendesk','salesforce',_0xf502('0xa'),'freshdesk',_0xf502('0xb'),_0xf502('0xc'),_0xf502('0xd'),_0xf502('0xe'),_0xf502('0xf'),'servicenow'];exports[_0xf502('0x10')]=function(_0x42974b,_0x2bd6d6,_0x3075c1,_0x2045ac,_0x4d217e,_0x5b9911){if(_0x3075c1){if(_[_0xf502('0x11')](integrations,_0x42974b[_0xf502('0x12')][_0xf502('0x13')]())){try{var _0x58f16b=null;var _0x46e7ef='';var _0x2914df=_0x3075c1[_0x42974b[_0xf502('0x12')]['toLowerCase']()];if(_0x2914df){var _0x164505=_0x2914df[_0x42974b[_0xf502('0x14')]];if(_0x164505){var _0x22c0fa=_[_0xf502('0x15')](_0x164505['Configurations'],{'id':parseInt(_0x42974b[_0xf502('0x16')],0xa)});if(_0x22c0fa){if(_0x2045ac){if(_0x4d217e&&_0x2bd6d6[_0xf502('0x17')]){_0x46e7ef='queue';}else if(_0x2bd6d6['routeId']){_0x46e7ef=_0xf502('0x18');}else{console[_0xf502('0x19')](_0xf502('0x1a'),_0x2bd6d6);}}else{_0x46e7ef=_0xf502('0x1b');}switch(_0x42974b['data1'][_0xf502('0x13')]()){case _0xf502('0x1c'):zendesk[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0x1d'):salesforce[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0xa'):sugarcrm[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0x1e'):freshdesk[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0xb'):zoho[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0xc'):desk[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0xd'):vtiger[_0x46e7ef](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911);break;case _0xf502('0xf'):freshsales['cs'](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911,_0x46e7ef);break;case'servicenow':servicenow['cs'](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911,_0x46e7ef);break;case _0xf502('0xe'):dynamics365['cs'](_0x42974b,_0x2bd6d6,_0x22c0fa,_0x2045ac,_0x4d217e,_0x164505,_0x5b9911,_0x46e7ef);break;default:console[_0xf502('0x19')]('unknown\x20integration');}}else{_0x58f16b=require('../../../../config/logger')(_0x42974b[_0xf502('0x12')][_0xf502('0x13')]());_0x58f16b[_0xf502('0x1f')]('[EXEC]',util[_0xf502('0x20')](_0xf502('0x21'),_0x42974b[_0xf502('0x12')][_0xf502('0x13')](),_0x42974b['data3']));}}else{_0x58f16b=require(_0xf502('0x22'))(_0x42974b[_0xf502('0x12')][_0xf502('0x13')]());_0x58f16b[_0xf502('0x1f')](_0xf502('0x23'),util['format'](_0xf502('0x24'),_0x42974b[_0xf502('0x12')][_0xf502('0x13')](),_0x42974b[_0xf502('0x14')]));}}else{}}catch(_0x3243ba){console[_0xf502('0x1f')](_0x3243ba);}}}}; \ No newline at end of file +var _0xde28=['dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged'];(function(_0x2584a5,_0x3e6635){var _0x49bd37=function(_0x32a2c8){while(--_0x32a2c8){_0x2584a5['push'](_0x2584a5['shift']());}};_0x49bd37(++_0x3e6635);}(_0xde28,0xc4));var _0x8de2=function(_0x4a57c6,_0x4810ee){_0x4a57c6=_0x4a57c6-0x0;var _0x2cfa7e=_0xde28[_0x4a57c6];return _0x2cfa7e;};'use strict';var _=require(_0x8de2('0x0'));var util=require(_0x8de2('0x1'));var zendesk=require(_0x8de2('0x2'));var salesforce=require(_0x8de2('0x3'));var sugarcrm=require(_0x8de2('0x4'));var freshdesk=require(_0x8de2('0x5'));var zoho=require(_0x8de2('0x6'));var desk=require(_0x8de2('0x7'));var vtiger=require(_0x8de2('0x8'));var servicenow=require('./servicenow');var dynamics365=require(_0x8de2('0x9'));var freshsales=require('./freshsales');var integrations=[_0x8de2('0xa'),_0x8de2('0xb'),_0x8de2('0xc'),_0x8de2('0xd'),_0x8de2('0xe'),_0x8de2('0xf'),_0x8de2('0x10'),'dynamics365',_0x8de2('0x11'),_0x8de2('0x12')];exports[_0x8de2('0x13')]=function(_0x1d6424,_0x496c1e,_0x4c9be5,_0x4fb968,_0x103861,_0x24425b){if(_0x4c9be5){if(_[_0x8de2('0x14')](integrations,_0x1d6424[_0x8de2('0x15')]['toLowerCase']())){try{var _0x3cba25=null;var _0x178360='';var _0x1da736=_0x4c9be5[_0x1d6424['data1'][_0x8de2('0x16')]()];if(_0x1da736){var _0x123afd=_0x1da736[_0x1d6424[_0x8de2('0x17')]];if(_0x123afd){var _0xdec70b=_[_0x8de2('0x18')](_0x123afd[_0x8de2('0x19')],{'id':parseInt(_0x1d6424[_0x8de2('0x1a')],0xa)});if(_0xdec70b){if(_0x4fb968){if(_0x103861&&_0x496c1e[_0x8de2('0x1b')]){_0x178360=_0x8de2('0x1b');}else if(_0x496c1e['routeId']){_0x178360=_0x8de2('0x1c');}else{console[_0x8de2('0x1d')](_0x8de2('0x1e'),_0x496c1e);}}else{_0x178360=_0x8de2('0x1f');}switch(_0x1d6424[_0x8de2('0x15')][_0x8de2('0x16')]()){case _0x8de2('0xa'):zendesk[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case'salesforce':salesforce[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case'sugarcrm':sugarcrm[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case'freshdesk':freshdesk[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case _0x8de2('0xe'):zoho[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case _0x8de2('0xf'):desk[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case _0x8de2('0x10'):vtiger[_0x178360](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b);break;case _0x8de2('0x11'):freshsales['cs'](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b,_0x178360);break;case _0x8de2('0x12'):servicenow['cs'](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b,_0x178360);break;case _0x8de2('0x20'):dynamics365['cs'](_0x1d6424,_0x496c1e,_0xdec70b,_0x4fb968,_0x103861,_0x123afd,_0x24425b,_0x178360);break;default:console[_0x8de2('0x1d')]('unknown\x20integration');}}else{_0x3cba25=require(_0x8de2('0x21'))(_0x1d6424['data1'][_0x8de2('0x16')]());_0x3cba25[_0x8de2('0x22')](_0x8de2('0x23'),util[_0x8de2('0x24')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1d6424[_0x8de2('0x15')][_0x8de2('0x16')](),_0x1d6424[_0x8de2('0x1a')]));}}else{_0x3cba25=require(_0x8de2('0x21'))(_0x1d6424[_0x8de2('0x15')][_0x8de2('0x16')]());_0x3cba25[_0x8de2('0x22')]('[EXEC]',util[_0x8de2('0x24')](_0x8de2('0x25'),_0x1d6424[_0x8de2('0x15')]['toLowerCase'](),_0x1d6424[_0x8de2('0x17')]));}}else{}}catch(_0x44b82f){console['error'](_0x44b82f);}}}}; \ 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 7c0973b..4860de4 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 _0x5b84=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','ioredis','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','contact','lead','WhoId','endUserType','account','Case','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','find','execute','then','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','length','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','first','Phone','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.','LastName','','format','Company','No\x20Company','upperFirst','forEach','string','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','password','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format'];(function(_0x305c62,_0x31ebff){var _0xfd08b1=function(_0x55a9cd){while(--_0x55a9cd){_0x305c62['push'](_0x305c62['shift']());}};_0xfd08b1(++_0x31ebff);}(_0x5b84,0xa1));var _0x45b8=function(_0x317a89,_0x2a7e08){_0x317a89=_0x317a89-0x0;var _0x33fc7c=_0x5b84[_0x317a89];return _0x33fc7c;};'use strict';var _=require(_0x45b8('0x0'));var rp=require(_0x45b8('0x1'));var moment=require(_0x45b8('0x2'));var BPromise=require(_0x45b8('0x3'));var md5=require(_0x45b8('0x4'));var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x45b8('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x45b8('0x6'));config[_0x45b8('0x7')]=_['defaults'](config[_0x45b8('0x7')],{'host':_0x45b8('0x8'),'port':0x18eb});var io=require(_0x45b8('0x9'))(new Redis(config['redis']));function emit(_0x54b5c5,_0x2b4b64,_0xa88355){io['to'](_0x54b5c5)[_0x45b8('0xa')](_0x2b4b64,_0xa88355);}function getTicket(_0x2aaa24,_0x35bd83,_0x253f39,_0x55efaf,_0x25fb8c,_0x106905,_0x10bffe,_0x10fd08){var _0x114281=Object[_0x45b8('0xb')]({},{'OwnerId':_0x35bd83['id'],'Subject':intUtil[_0x45b8('0xc')](_0x55efaf['Subjects'],_0x25fb8c,'\x20'),'Description':intUtil[_0x45b8('0xc')](_0x55efaf[_0x45b8('0xd')],_0x25fb8c,'\x0a')},getCustomFields(_0x106905,_0x25fb8c));if(_0x253f39){if(_0x55efaf[_0x45b8('0xe')]===_0x45b8('0xf')){_0x114281[_0x45b8('0x10')]=moment['utc']();_0x114281['IsReminderSet']=![];_0x114281[_0x45b8('0x11')]=![];if(_0x253f39['endUserType']===_0x45b8('0x12')||_0x253f39['endUserType']===_0x45b8('0x13')){_0x114281[_0x45b8('0x14')]=_0x253f39['id'];}else if(_0x253f39[_0x45b8('0x15')]===_0x45b8('0x16')){_0x114281['WhatId']=_0x253f39['id'];}}else if(_0x55efaf[_0x45b8('0xe')]===_0x45b8('0x17')){if(_0x253f39['endUserType']==='contact'){_0x114281['ContactId']=_0x253f39['id'];}else if(_0x253f39[_0x45b8('0x15')]===_0x45b8('0x16')){_0x114281['AccountId']=_0x253f39['id'];}else if(_0x253f39[_0x45b8('0x15')]===_0x45b8('0x13')&&_0x55efaf['leadId']){_0x114281[_0x55efaf[_0x45b8('0x18')]]=_0x253f39['id'];}else{logger[_0x45b8('0x19')](_0x45b8('0x1a'));}}}return _0x10bffe[_0x45b8('0x1b')](_0x55efaf[_0x45b8('0xe')])[_0x45b8('0x1c')](_0x114281);}function getUser(_0x2da39a,_0x530017,_0x2e0fd1){if(!_[_0x45b8('0x1d')](_0x530017)&&intUtil[_0x45b8('0x1e')](_0x530017)){var _0x2aad41={'Email':_0x530017};var _0x43df61={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2e0fd1[_0x45b8('0x1b')]('User')[_0x45b8('0x1f')](_0x2aad41,_0x43df61)[_0x45b8('0x20')]()[_0x45b8('0x21')](function(_0x4b2ab3){if(_0x4b2ab3['length']){var _0x2cf33e=_[_0x45b8('0x1f')](_0x4b2ab3,function(_0x31099f){return _0x31099f[_0x45b8('0x22')]===_0x530017;});if(_0x2cf33e){logger[_0x45b8('0x19')](_0x45b8('0x23'),_0x530017);return BPromise[_0x45b8('0x24')]({'id':_0x2cf33e['Id'],'name':_0x2cf33e[_0x45b8('0x25')]});}}else{logger[_0x45b8('0x19')](_0x45b8('0x26'),_0x530017);return _0x2e0fd1[_0x45b8('0x27')]()[_0x45b8('0x21')](function(_0x1b9de6){return BPromise['resolve']({'id':_0x1b9de6[_0x45b8('0x28')],'name':_0x1b9de6[_0x45b8('0x29')]});});}});}else{logger[_0x45b8('0x19')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x530017);return _0x2e0fd1[_0x45b8('0x27')]()[_0x45b8('0x21')](function(_0x41a758){return BPromise[_0x45b8('0x24')]({'id':_0x41a758[_0x45b8('0x28')],'name':_0x41a758[_0x45b8('0x29')]});});}}function getEndUser(_0x1e5bb7,_0x171406,_0x3aa08b,_0x42eb6b,_0x360e1b){var _0x54a64f={'$or':{'Phone':_0x42eb6b}};var _0x39b378={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x45b8('0x24')]()[_0x45b8('0x21')](function(){logger['info'](_0x45b8('0x2a'),_0x42eb6b,_0x171406['moduleSearch']);switch(_0x171406[_0x45b8('0x2b')]){case _0x45b8('0x2c'):var _0x3bdbb0=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406[_0x45b8('0x2e')]){var _0x4f7e19={};_0x4f7e19[_0x171406['additionalSearchContact']]=_0x42eb6b;_[_0x45b8('0x2f')](_0x3bdbb0[_0x45b8('0x30')],_0x4f7e19);}return _0x360e1b[_0x45b8('0x1b')](_0x45b8('0x31'))[_0x45b8('0x1f')](_0x3bdbb0,_0x39b378)[_0x45b8('0x20')]()[_0x45b8('0x21')](function(_0x283b3c){if(_0x283b3c&&_0x283b3c[_0x45b8('0x32')]){return _0x283b3c;}else{var _0x8d3a5b=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406[_0x45b8('0x33')]){var _0x4cf4eb={};_0x4cf4eb[_0x171406[_0x45b8('0x33')]]=_0x42eb6b;_['merge'](_0x8d3a5b[_0x45b8('0x30')],_0x4cf4eb);}return _0x360e1b['sobject']('Lead')[_0x45b8('0x1f')](_0x8d3a5b,_0x39b378);}});case _0x45b8('0x34'):var _0x3bf155=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406[_0x45b8('0x35')]){var _0x4f7e19={};_0x4f7e19[_0x171406['additionalSearchAccount']]=_0x42eb6b;_['merge'](_0x3bf155['$or'],_0x4f7e19);}return _0x360e1b[_0x45b8('0x1b')](_0x45b8('0x36'))[_0x45b8('0x1f')](_0x3bf155,_0x39b378)[_0x45b8('0x20')]()['then'](function(_0x4db2a4){if(_0x4db2a4&&_0x4db2a4[_0x45b8('0x32')]){return _0x4db2a4;}else{var _0x285623=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406[_0x45b8('0x2e')]){var _0x3c889a={};_0x3c889a[_0x171406[_0x45b8('0x2e')]]=_0x42eb6b;_[_0x45b8('0x2f')](_0x285623[_0x45b8('0x30')],_0x3c889a);}return _0x360e1b['sobject'](_0x45b8('0x31'))[_0x45b8('0x1f')](_0x285623,_0x39b378)[_0x45b8('0x21')](function(_0x31bfe8){if(_0x31bfe8&&_0x31bfe8[_0x45b8('0x32')]){return _0x31bfe8;}else{var _0x338441=_['cloneDeep'](_0x54a64f);if(_0x171406[_0x45b8('0x33')]){var _0x1e49b4={};_0x1e49b4[_0x171406['additionalSearchLead']]=_0x42eb6b;_[_0x45b8('0x2f')](_0x338441[_0x45b8('0x30')],_0x1e49b4);}return _0x360e1b[_0x45b8('0x1b')]('Lead')['find'](_0x338441,_0x39b378);}});}});case _0x45b8('0x12'):var _0x3bdbb0=_['cloneDeep'](_0x54a64f);if(_0x171406[_0x45b8('0x2e')]){var _0x4f7e19={};_0x4f7e19[_0x171406['additionalSearchContact']]=_0x42eb6b;_[_0x45b8('0x2f')](_0x3bdbb0[_0x45b8('0x30')],_0x4f7e19);}return _0x360e1b['sobject'](_0x45b8('0x31'))[_0x45b8('0x1f')](_0x3bdbb0,_0x39b378)[_0x45b8('0x20')]();case _0x45b8('0x13'):var _0x333365=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406[_0x45b8('0x33')]){var _0x4f7e19={};_0x4f7e19[_0x171406[_0x45b8('0x33')]]=_0x42eb6b;_['merge'](_0x333365['$or'],_0x4f7e19);}return _0x360e1b[_0x45b8('0x1b')]('Lead')['find'](_0x333365,_0x39b378);case _0x45b8('0x16'):var _0x3bf155=_[_0x45b8('0x2d')](_0x54a64f);if(_0x171406['additionalSearchAccount']){var _0x4f7e19={};_0x4f7e19[_0x171406[_0x45b8('0x35')]]=_0x42eb6b;_[_0x45b8('0x2f')](_0x3bf155[_0x45b8('0x30')],_0x4f7e19);}return _0x360e1b[_0x45b8('0x1b')](_0x45b8('0x36'))[_0x45b8('0x1f')](_0x3bf155,_0x39b378);default:return null;}})[_0x45b8('0x21')](function(_0x257033){if(_0x257033&&_0x257033['length']){var _0x5b909b=_[_0x45b8('0x37')](_0x257033);if(_0x5b909b){return BPromise[_0x45b8('0x24')]({'id':_0x5b909b['Id'],'name':_0x5b909b[_0x45b8('0x25')],'phone':_0x5b909b[_0x45b8('0x38')],'endUserType':_0x5b909b[_0x45b8('0x39')]['type'][_0x45b8('0x3a')]()});}}})[_0x45b8('0x21')](function(_0x4158a6){if(_0x4158a6){logger[_0x45b8('0x19')](_0x45b8('0x3b'),_0x4158a6['endUserType'],_0x42eb6b);return BPromise[_0x45b8('0x24')](_0x4158a6);}else{logger['info'](_0x45b8('0x3c'),_0x42eb6b);var _0x355b5b={'Phone':_0x42eb6b};if(_0x171406[_0x45b8('0x3d')]){if(_0x171406[_0x45b8('0x3d')]===_0x45b8('0x12')){logger['info'](_0x45b8('0x3e'),_0x42eb6b,_0x171406['moduleCreate']);_0x355b5b[_0x45b8('0x3f')]=_0x3aa08b!==_0x45b8('0x40')?_0x3aa08b:util[_0x45b8('0x41')]('Caller\x20-\x20%s',_0x42eb6b);}else if(_0x171406[_0x45b8('0x3d')]===_0x45b8('0x13')){logger[_0x45b8('0x19')](_0x45b8('0x3e'),_0x42eb6b,_0x171406[_0x45b8('0x3d')]);_0x355b5b[_0x45b8('0x3f')]=_0x3aa08b!==_0x45b8('0x40')?_0x3aa08b:util['format']('Caller\x20-\x20%s',_0x42eb6b);_0x355b5b[_0x45b8('0x42')]=_0x45b8('0x43');}else if(_0x171406[_0x45b8('0x3d')]===_0x45b8('0x16')){logger['info'](_0x45b8('0x3e'),_0x42eb6b,_0x171406[_0x45b8('0x3d')]);_0x355b5b[_0x45b8('0x25')]=_0x3aa08b!==''?_0x3aa08b:util[_0x45b8('0x41')]('Caller\x20-\x20%s',_0x42eb6b);}else{return null;}}return _0x360e1b[_0x45b8('0x1b')](_[_0x45b8('0x44')](_0x171406[_0x45b8('0x3d')]))[_0x45b8('0x1c')](_0x355b5b)[_0x45b8('0x21')](function(_0x322b53){return BPromise[_0x45b8('0x24')]({'id':_0x322b53['id'],'endUserType':_0x171406['moduleCreate']});});}});}function getCustomFields(_0x3646a0,_0x54877a){var _0x4d0a1f={};if(_0x3646a0[_0x45b8('0x32')]>0x0){_[_0x45b8('0x45')](_0x3646a0,function(_0x57d0bd){if(_['includes']([_0x45b8('0x46'),_0x45b8('0x47')],_0x57d0bd[_0x45b8('0x48')])&&_0x57d0bd['idField']){_0x4d0a1f[_0x57d0bd[_0x45b8('0x49')]]=_0x57d0bd[_0x45b8('0x4a')]['toString']();}else if(_0x57d0bd[_0x45b8('0x48')]===_0x45b8('0x4b')&&_0x57d0bd[_0x45b8('0x4c')]&&_0x57d0bd['idField']){_0x54877a[_0x57d0bd[_0x45b8('0x4c')]]&&(_0x4d0a1f[_0x57d0bd[_0x45b8('0x49')]]=_0x54877a[_0x57d0bd[_0x45b8('0x4c')]][_0x45b8('0x4d')]());}else if(_0x57d0bd[_0x45b8('0x48')]===_0x45b8('0x4e')&&_0x57d0bd[_0x45b8('0x4f')]&&_0x57d0bd[_0x45b8('0x4f')]['name']&&_0x57d0bd['idField']){_0x54877a[_0x57d0bd['Variable']['name'][_0x45b8('0x3a')]()]&&(_0x4d0a1f[_0x57d0bd[_0x45b8('0x49')]]=_0x54877a[_0x57d0bd['Variable']['name']['toLowerCase']()]['toString']());}});}return _0x4d0a1f;}function getConnection(_0x3fc78a){var _0x3375ba=_0x3fc78a[_0x45b8('0x50')]['concat'](_0x3fc78a['securityToken']);var _0x300fd6=new jsforce[(_0x45b8('0x51'))]({'oauth2':{'loginUrl':_0x3fc78a[_0x45b8('0x52')]||_0x45b8('0x53'),'clientId':_0x3fc78a[_0x45b8('0x54')],'clientSecret':_0x3fc78a[_0x45b8('0x55')]}});return _0x300fd6[_0x45b8('0x56')](_0x3fc78a[_0x45b8('0x57')],_0x3375ba)[_0x45b8('0x21')](function(){logger['info'](_0x45b8('0x58'));return _0x300fd6;});}exports[_0x45b8('0x59')]=function(_0x4f9656,_0x2c94e9,_0xd5909,_0x47a205,_0x264566,_0xe3b768){var _0x3f0026,_0x3fcf22,_0x151723,_0x1c610c;_0xe3b768[_0x45b8('0x5a')]=intUtil[_0x45b8('0x5b')](_0xe3b768[_0x45b8('0x5a')]);_0xe3b768[_0x45b8('0x52')]=intUtil[_0x45b8('0x5b')](_0xe3b768[_0x45b8('0x52')]);if(_0x264566&&_0x264566[_0x45b8('0x5c')]){logger['info'](_0x45b8('0x5d'),_0x45b8('0x5e'));_0x2c94e9[_0x45b8('0x5f')]=util[_0x45b8('0x41')](_0x45b8('0x60'),_0xe3b768['serverUrl'],_0x2c94e9[_0x45b8('0x61')],md5(_0x2c94e9[_0x45b8('0x61')]));}else{_0x2c94e9['recordingURL']='';}return getConnection(_0xe3b768)[_0x45b8('0x21')](function(_0x144c8a){_0x1c610c=_0x144c8a;return getUser(_0xe3b768,_0x47a205[_0x45b8('0x62')],_0x1c610c);})[_0x45b8('0x21')](function(_0x2aec90){_0x3f0026=_0x2aec90;return getEndUser(_0xe3b768,_0xd5909,_0x2c94e9[_0x45b8('0x63')],_0x2c94e9[_0x45b8('0x64')],_0x1c610c);})[_0x45b8('0x21')](function(_0x26c01f){_0x3fcf22=_0x26c01f;return getTicket(_0xe3b768,_0x3f0026,_0x3fcf22,_0xd5909,_0x2c94e9,_0xd5909[_0x45b8('0x65')],_0x1c610c,_0x45b8('0x59'));})[_0x45b8('0x21')](function(_0x17a2bf){_0x151723=_0x17a2bf;logger[_0x45b8('0x19')](_0x45b8('0x66'),_0x151723['id']);logger['info'](_0x45b8('0x67'),_0x151723['id'],_0x47a205[_0x45b8('0x68')],_0xe3b768[_0x45b8('0x48')]);switch(_0xe3b768['type']){case _0x45b8('0x69'):emit(util[_0x45b8('0x41')](_0x45b8('0x6a'),_0x47a205[_0x45b8('0x68')]),_0x45b8('0x6b'),{'recordId':_0x151723['id']});break;case _0x45b8('0x6c'):emit(util[_0x45b8('0x41')](_0x45b8('0x6a'),_0x47a205[_0x45b8('0x68')]),_0x45b8('0x6d'),{'uri':util[_0x45b8('0x41')](_0x45b8('0x6e'),_0x1c610c[_0x45b8('0x6f')],_0x151723['id'])});break;default:logger[_0x45b8('0x70')](_0x45b8('0x71'));}})[_0x45b8('0x72')](function(_0x2f1a47){logger['error'](_0x45b8('0x5d'),_0x2f1a47);});};exports[_0x45b8('0x73')]=function(_0x59fe21,_0x2a3e02,_0x5ba5af,_0x730c01,_0x492c2f,_0x38872f,_0x4494ca){var _0x1c346c,_0x2e2293,_0x103f59,_0x115849;_0x38872f[_0x45b8('0x5a')]=intUtil[_0x45b8('0x5b')](_0x38872f[_0x45b8('0x5a')]);_0x38872f[_0x45b8('0x52')]=intUtil[_0x45b8('0x5b')](_0x38872f['remoteUri']);if(_0x4494ca&&_0x4494ca[_0x45b8('0x74')]&&_0x4494ca[_0x45b8('0x74')]!==_0x45b8('0x75')){logger[_0x45b8('0x19')](_0x45b8('0x76'),_0x45b8('0x5e'));_0x2a3e02['recordingURL']=util[_0x45b8('0x41')](_0x45b8('0x60'),_0x38872f[_0x45b8('0x5a')],_0x2a3e02['uniqueid'],md5(_0x2a3e02['uniqueid']));}return getConnection(_0x38872f)[_0x45b8('0x21')](function(_0x57d993){_0x115849=_0x57d993;return getUser(_0x38872f,_0x730c01[_0x45b8('0x62')],_0x115849);})['then'](function(_0x43ad8a){_0x1c346c=_0x43ad8a;return getEndUser(_0x38872f,_0x5ba5af,_0x2a3e02[_0x45b8('0x77')],_0x2a3e02[_0x45b8('0x78')],_0x115849);})[_0x45b8('0x21')](function(_0x3c554a){_0x2e2293=_0x3c554a;return getTicket(_0x38872f,_0x1c346c,_0x2e2293,_0x5ba5af,_0x2a3e02,_0x5ba5af[_0x45b8('0x65')],_0x115849,_0x45b8('0x73'));})[_0x45b8('0x21')](function(_0xe208c6){_0x103f59=_0xe208c6;logger[_0x45b8('0x19')](_0x45b8('0x79'),_0x103f59['id']);logger[_0x45b8('0x19')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x103f59['id'],_0x730c01[_0x45b8('0x68')],_0x38872f[_0x45b8('0x48')]);switch(_0x38872f[_0x45b8('0x48')]){case _0x45b8('0x69'):emit(util['format']('user:%s',_0x730c01[_0x45b8('0x68')]),_0x45b8('0x6b'),{'recordId':_0x103f59['id']});break;case _0x45b8('0x6c'):emit(util['format'](_0x45b8('0x6a'),_0x730c01[_0x45b8('0x68')]),_0x45b8('0x6d'),{'uri':util[_0x45b8('0x41')]('%s/%s/e',_0x115849[_0x45b8('0x6f')],_0x103f59['id'])});break;default:logger[_0x45b8('0x70')](_0x45b8('0x76'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x45b8('0x72')](function(_0xb269b6){logger[_0x45b8('0x70')](_0x45b8('0x76'),_0xb269b6);});};exports[_0x45b8('0x7a')]=function(_0x3b1f2f,_0x2c7f1d,_0x253231,_0x26543f,_0x53752d,_0x1630e0){var _0x1cfbe6,_0x3573fa,_0xc72403,_0xee3246;_0x1630e0[_0x45b8('0x5a')]=intUtil[_0x45b8('0x5b')](_0x1630e0[_0x45b8('0x5a')]);_0x1630e0['remoteUri']=intUtil[_0x45b8('0x5b')](_0x1630e0[_0x45b8('0x52')]);if(_0x53752d&&_0x53752d[_0x45b8('0x5c')]){logger[_0x45b8('0x19')]('['+_0x2c7f1d[_0x45b8('0x7b')][_0x45b8('0x7c')]()+']',_0x45b8('0x5e'));_0x2c7f1d['recordingURL']=util[_0x45b8('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1630e0[_0x45b8('0x5a')],_0x2c7f1d['uniqueid'],md5(_0x2c7f1d['uniqueid']));}else{_0x2c7f1d[_0x45b8('0x5f')]='';}return getConnection(_0x1630e0)[_0x45b8('0x21')](function(_0x452fe3){_0xee3246=_0x452fe3;if(!_['isNil'](_0x26543f)){return getUser(_0x1630e0,_0x26543f['name'],_0xee3246);}else{return getUser(_0x1630e0,null,_0xee3246);}})[_0x45b8('0x21')](function(_0x326122){_0x1cfbe6=_0x326122;return getEndUser(_0x1630e0,_0x253231,_0x2c7f1d[_0x45b8('0x63')],_0x2c7f1d['calleridnum'],_0xee3246);})['then'](function(_0x205207){_0x3573fa=_0x205207;return getTicket(_0x1630e0,_0x1cfbe6,_0x3573fa,_0x253231,_0x2c7f1d,_0x253231[_0x45b8('0x65')],_0xee3246);})[_0x45b8('0x21')](function(_0x4eafc7){_0xc72403=_0x4eafc7;logger[_0x45b8('0x19')]('['+_0x2c7f1d[_0x45b8('0x7b')]['toUpperCase']()+_0x45b8('0x7d'),_0xc72403['id']);logger[_0x45b8('0x19')]('['+_0x2c7f1d[_0x45b8('0x7b')][_0x45b8('0x7c')]()+_0x45b8('0x7e'),_0x1630e0[_0x45b8('0x48')]);})[_0x45b8('0x72')](function(_0x27028a){logger['error']('['+_0x2c7f1d[_0x45b8('0x7b')][_0x45b8('0x7c')]()+']',_0x27028a);});}; \ No newline at end of file +var _0x79b8=['destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','./util','salesforce','defaults','localhost','socket.io-emitter','redis','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','execute','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','then','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','additionalSearchLead','$or','Lead','cloneDeep','additionalSearchAccount','Account','Contact','first','Phone','attributes','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','Caller\x20-\x20%s','Company','No\x20Company','format','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email'];(function(_0x485d8b,_0x1697a0){var _0x5c5293=function(_0x1701aa){while(--_0x1701aa){_0x485d8b['push'](_0x485d8b['shift']());}};_0x5c5293(++_0x1697a0);}(_0x79b8,0x8b));var _0x879b=function(_0x5b07c2,_0x171b94){_0x5b07c2=_0x5b07c2-0x0;var _0x51a53c=_0x79b8[_0x5b07c2];return _0x51a53c;};'use strict';var _=require(_0x879b('0x0'));var rp=require(_0x879b('0x1'));var moment=require(_0x879b('0x2'));var BPromise=require(_0x879b('0x3'));var md5=require(_0x879b('0x4'));var jsforce=require(_0x879b('0x5'));var util=require('util');var Redis=require(_0x879b('0x6'));var intUtil=require(_0x879b('0x7'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x879b('0x8'));config['redis']=_[_0x879b('0x9')](config['redis'],{'host':_0x879b('0xa'),'port':0x18eb});var io=require(_0x879b('0xb'))(new Redis(config[_0x879b('0xc')]));function emit(_0x4d48c4,_0x271166,_0x5baaa6){io['to'](_0x4d48c4)[_0x879b('0xd')](_0x271166,_0x5baaa6);}function getTicket(_0x301b59,_0x2d675b,_0x261583,_0x588644,_0x51070b,_0x2333eb,_0x9d1bf3,_0x48719d){var _0x59b06f=Object[_0x879b('0xe')]({},{'OwnerId':_0x2d675b['id'],'Subject':intUtil['getString'](_0x588644[_0x879b('0xf')],_0x51070b,'\x20'),'Description':intUtil[_0x879b('0x10')](_0x588644['Descriptions'],_0x51070b,'\x0a')},getCustomFields(_0x2333eb,_0x51070b));if(_0x261583){if(_0x588644[_0x879b('0x11')]===_0x879b('0x12')){_0x59b06f[_0x879b('0x13')]=moment[_0x879b('0x14')]();_0x59b06f[_0x879b('0x15')]=![];_0x59b06f[_0x879b('0x16')]=![];if(_0x261583[_0x879b('0x17')]===_0x879b('0x18')||_0x261583[_0x879b('0x17')]===_0x879b('0x19')){_0x59b06f[_0x879b('0x1a')]=_0x261583['id'];}else if(_0x261583[_0x879b('0x17')]===_0x879b('0x1b')){_0x59b06f[_0x879b('0x1c')]=_0x261583['id'];}}else if(_0x588644['ticketType']===_0x879b('0x1d')){if(_0x261583[_0x879b('0x17')]===_0x879b('0x18')){_0x59b06f['ContactId']=_0x261583['id'];}else if(_0x261583[_0x879b('0x17')]==='account'){_0x59b06f[_0x879b('0x1e')]=_0x261583['id'];}else if(_0x261583[_0x879b('0x17')]===_0x879b('0x19')&&_0x588644['leadId']){_0x59b06f[_0x588644[_0x879b('0x1f')]]=_0x261583['id'];}else{logger[_0x879b('0x20')](_0x879b('0x21'));}}}return _0x9d1bf3[_0x879b('0x22')](_0x588644[_0x879b('0x11')])['create'](_0x59b06f);}function getUser(_0x50a78a,_0x1251f9,_0x112106){if(!_[_0x879b('0x23')](_0x1251f9)&&intUtil['validateEmail'](_0x1251f9)){var _0x4f2d94={'Email':_0x1251f9};var _0x9fdfff={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x112106['sobject'](_0x879b('0x24'))[_0x879b('0x25')](_0x4f2d94,_0x9fdfff)[_0x879b('0x26')]()['then'](function(_0x203d33){if(_0x203d33[_0x879b('0x27')]){var _0x553560=_[_0x879b('0x25')](_0x203d33,function(_0x291ff0){return _0x291ff0['Email']===_0x1251f9;});if(_0x553560){logger[_0x879b('0x20')](_0x879b('0x28'),_0x1251f9);return BPromise['resolve']({'id':_0x553560['Id'],'name':_0x553560[_0x879b('0x29')]});}}else{logger[_0x879b('0x20')](_0x879b('0x2a'),_0x1251f9);return _0x112106[_0x879b('0x2b')]()[_0x879b('0x2c')](function(_0x37085e){return BPromise[_0x879b('0x2d')]({'id':_0x37085e['user_id'],'name':_0x37085e['display_name']});});}});}else{logger[_0x879b('0x20')](_0x879b('0x2a'),_0x1251f9);return _0x112106[_0x879b('0x2b')]()['then'](function(_0x48c570){return BPromise[_0x879b('0x2d')]({'id':_0x48c570[_0x879b('0x2e')],'name':_0x48c570[_0x879b('0x2f')]});});}}function getEndUser(_0x115a73,_0x2c9cf9,_0x35d90a,_0x25c810,_0x5c12d2){var _0x19410c={'$or':{'Phone':_0x25c810}};var _0x3023e1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x879b('0x2d')]()[_0x879b('0x2c')](function(){logger[_0x879b('0x20')](_0x879b('0x30'),_0x25c810,_0x2c9cf9['moduleSearch']);switch(_0x2c9cf9[_0x879b('0x31')]){case'contact_lead':var _0x2a336c=_['cloneDeep'](_0x19410c);if(_0x2c9cf9['additionalSearchContact']){var _0x2f4b82={};_0x2f4b82[_0x2c9cf9[_0x879b('0x32')]]=_0x25c810;_[_0x879b('0x33')](_0x2a336c['$or'],_0x2f4b82);}return _0x5c12d2[_0x879b('0x22')]('Contact')[_0x879b('0x25')](_0x2a336c,_0x3023e1)[_0x879b('0x26')]()[_0x879b('0x2c')](function(_0x398e6a){if(_0x398e6a&&_0x398e6a[_0x879b('0x27')]){return _0x398e6a;}else{var _0x1263de=_['cloneDeep'](_0x19410c);if(_0x2c9cf9[_0x879b('0x34')]){var _0x578a65={};_0x578a65[_0x2c9cf9[_0x879b('0x34')]]=_0x25c810;_[_0x879b('0x33')](_0x1263de[_0x879b('0x35')],_0x578a65);}return _0x5c12d2[_0x879b('0x22')](_0x879b('0x36'))['find'](_0x1263de,_0x3023e1);}});case'account_contact_lead':var _0x5ed7cf=_[_0x879b('0x37')](_0x19410c);if(_0x2c9cf9[_0x879b('0x38')]){var _0x2f4b82={};_0x2f4b82[_0x2c9cf9[_0x879b('0x38')]]=_0x25c810;_['merge'](_0x5ed7cf['$or'],_0x2f4b82);}return _0x5c12d2[_0x879b('0x22')](_0x879b('0x39'))[_0x879b('0x25')](_0x5ed7cf,_0x3023e1)[_0x879b('0x26')]()[_0x879b('0x2c')](function(_0x59a2d4){if(_0x59a2d4&&_0x59a2d4['length']){return _0x59a2d4;}else{var _0x4ebb78=_[_0x879b('0x37')](_0x19410c);if(_0x2c9cf9[_0x879b('0x32')]){var _0x17d907={};_0x17d907[_0x2c9cf9[_0x879b('0x32')]]=_0x25c810;_[_0x879b('0x33')](_0x4ebb78[_0x879b('0x35')],_0x17d907);}return _0x5c12d2['sobject'](_0x879b('0x3a'))[_0x879b('0x25')](_0x4ebb78,_0x3023e1)[_0x879b('0x2c')](function(_0x13731c){if(_0x13731c&&_0x13731c[_0x879b('0x27')]){return _0x13731c;}else{var _0x3fed75=_[_0x879b('0x37')](_0x19410c);if(_0x2c9cf9[_0x879b('0x34')]){var _0x4e2311={};_0x4e2311[_0x2c9cf9[_0x879b('0x34')]]=_0x25c810;_[_0x879b('0x33')](_0x3fed75['$or'],_0x4e2311);}return _0x5c12d2[_0x879b('0x22')](_0x879b('0x36'))[_0x879b('0x25')](_0x3fed75,_0x3023e1);}});}});case _0x879b('0x18'):var _0x2a336c=_[_0x879b('0x37')](_0x19410c);if(_0x2c9cf9[_0x879b('0x32')]){var _0x2f4b82={};_0x2f4b82[_0x2c9cf9[_0x879b('0x32')]]=_0x25c810;_[_0x879b('0x33')](_0x2a336c['$or'],_0x2f4b82);}return _0x5c12d2['sobject'](_0x879b('0x3a'))['find'](_0x2a336c,_0x3023e1)['execute']();case'lead':var _0x4eccf2=_['cloneDeep'](_0x19410c);if(_0x2c9cf9[_0x879b('0x34')]){var _0x2f4b82={};_0x2f4b82[_0x2c9cf9[_0x879b('0x34')]]=_0x25c810;_[_0x879b('0x33')](_0x4eccf2[_0x879b('0x35')],_0x2f4b82);}return _0x5c12d2[_0x879b('0x22')](_0x879b('0x36'))['find'](_0x4eccf2,_0x3023e1);case _0x879b('0x1b'):var _0x5ed7cf=_[_0x879b('0x37')](_0x19410c);if(_0x2c9cf9[_0x879b('0x38')]){var _0x2f4b82={};_0x2f4b82[_0x2c9cf9[_0x879b('0x38')]]=_0x25c810;_[_0x879b('0x33')](_0x5ed7cf['$or'],_0x2f4b82);}return _0x5c12d2[_0x879b('0x22')](_0x879b('0x39'))['find'](_0x5ed7cf,_0x3023e1);default:return null;}})['then'](function(_0x454f34){if(_0x454f34&&_0x454f34[_0x879b('0x27')]){var _0x4bd15a=_[_0x879b('0x3b')](_0x454f34);if(_0x4bd15a){return BPromise['resolve']({'id':_0x4bd15a['Id'],'name':_0x4bd15a[_0x879b('0x29')],'phone':_0x4bd15a[_0x879b('0x3c')],'endUserType':_0x4bd15a[_0x879b('0x3d')]['type']['toLowerCase']()});}}})[_0x879b('0x2c')](function(_0x358142){if(_0x358142){logger[_0x879b('0x20')](_0x879b('0x3e'),_0x358142[_0x879b('0x17')],_0x25c810);return BPromise[_0x879b('0x2d')](_0x358142);}else{logger['info'](_0x879b('0x3f'),_0x25c810);var _0x4b7697={'Phone':_0x25c810};if(_0x2c9cf9['moduleCreate']){if(_0x2c9cf9[_0x879b('0x40')]===_0x879b('0x18')){logger[_0x879b('0x20')](_0x879b('0x41'),_0x25c810,_0x2c9cf9[_0x879b('0x40')]);_0x4b7697['LastName']=_0x35d90a!==_0x879b('0x42')?_0x35d90a:util['format']('Caller\x20-\x20%s',_0x25c810);}else if(_0x2c9cf9[_0x879b('0x40')]===_0x879b('0x19')){logger[_0x879b('0x20')](_0x879b('0x41'),_0x25c810,_0x2c9cf9[_0x879b('0x40')]);_0x4b7697[_0x879b('0x43')]=_0x35d90a!==''?_0x35d90a:util['format'](_0x879b('0x44'),_0x25c810);_0x4b7697[_0x879b('0x45')]=_0x879b('0x46');}else if(_0x2c9cf9[_0x879b('0x40')]===_0x879b('0x1b')){logger[_0x879b('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x25c810,_0x2c9cf9['moduleCreate']);_0x4b7697[_0x879b('0x29')]=_0x35d90a!==''?_0x35d90a:util[_0x879b('0x47')](_0x879b('0x44'),_0x25c810);}else{return null;}}return _0x5c12d2[_0x879b('0x22')](_[_0x879b('0x48')](_0x2c9cf9[_0x879b('0x40')]))['create'](_0x4b7697)[_0x879b('0x2c')](function(_0xa14e62){return BPromise[_0x879b('0x2d')]({'id':_0xa14e62['id'],'endUserType':_0x2c9cf9[_0x879b('0x40')]});});}});}function getCustomFields(_0x1ffe48,_0x4e5285){var _0x5da03f={};if(_0x1ffe48['length']>0x0){_[_0x879b('0x49')](_0x1ffe48,function(_0x102dde){if(_[_0x879b('0x4a')]([_0x879b('0x4b'),_0x879b('0x4c')],_0x102dde[_0x879b('0x4d')])&&_0x102dde[_0x879b('0x4e')]){_0x5da03f[_0x102dde[_0x879b('0x4e')]]=_0x102dde[_0x879b('0x4f')][_0x879b('0x50')]();}else if(_0x102dde[_0x879b('0x4d')]===_0x879b('0x51')&&_0x102dde[_0x879b('0x52')]&&_0x102dde[_0x879b('0x4e')]){_0x4e5285[_0x102dde['variableName']]&&(_0x5da03f[_0x102dde['idField']]=_0x4e5285[_0x102dde[_0x879b('0x52')]]['toString']());}else if(_0x102dde[_0x879b('0x4d')]===_0x879b('0x53')&&_0x102dde[_0x879b('0x54')]&&_0x102dde[_0x879b('0x54')]['name']&&_0x102dde[_0x879b('0x4e')]){_0x4e5285[_0x102dde[_0x879b('0x54')][_0x879b('0x55')]['toLowerCase']()]&&(_0x5da03f[_0x102dde[_0x879b('0x4e')]]=_0x4e5285[_0x102dde[_0x879b('0x54')][_0x879b('0x55')][_0x879b('0x56')]()][_0x879b('0x50')]());}});}return _0x5da03f;}function getConnection(_0x3cf2ba){var _0x1b5180=_0x3cf2ba[_0x879b('0x57')][_0x879b('0x58')](_0x3cf2ba[_0x879b('0x59')]);var _0x228b61=new jsforce[(_0x879b('0x5a'))]({'oauth2':{'loginUrl':_0x3cf2ba[_0x879b('0x5b')]||'https://login.salesforce.com','clientId':_0x3cf2ba[_0x879b('0x5c')],'clientSecret':_0x3cf2ba['clientSecret']}});return _0x228b61[_0x879b('0x5d')](_0x3cf2ba[_0x879b('0x5e')],_0x1b5180)[_0x879b('0x2c')](function(){logger[_0x879b('0x20')](_0x879b('0x5f'));return _0x228b61;});}exports[_0x879b('0x60')]=function(_0x3f14a6,_0x16f224,_0xc9c7aa,_0xa210d6,_0x53c6b8,_0x570e8f){var _0x525b5a,_0x576d72,_0x9b80f3,_0x503997;_0x570e8f[_0x879b('0x61')]=intUtil[_0x879b('0x62')](_0x570e8f[_0x879b('0x61')]);_0x570e8f[_0x879b('0x5b')]=intUtil['stripTrailingSlash'](_0x570e8f[_0x879b('0x5b')]);if(_0x53c6b8&&_0x53c6b8[_0x879b('0x63')]){logger[_0x879b('0x20')](_0x879b('0x64'),'Recording\x20is\x20enabled!');_0x16f224[_0x879b('0x65')]=util[_0x879b('0x47')](_0x879b('0x66'),_0x570e8f['serverUrl'],_0x16f224[_0x879b('0x67')],md5(_0x16f224[_0x879b('0x67')]));}else{_0x16f224[_0x879b('0x65')]='';}return getConnection(_0x570e8f)[_0x879b('0x2c')](function(_0x232b27){_0x503997=_0x232b27;return getUser(_0x570e8f,_0xa210d6['email'],_0x503997);})[_0x879b('0x2c')](function(_0x1f2012){_0x525b5a=_0x1f2012;return getEndUser(_0x570e8f,_0xc9c7aa,_0x16f224[_0x879b('0x68')],_0x16f224[_0x879b('0x69')],_0x503997);})[_0x879b('0x2c')](function(_0x20cec4){_0x576d72=_0x20cec4;return getTicket(_0x570e8f,_0x525b5a,_0x576d72,_0xc9c7aa,_0x16f224,_0xc9c7aa[_0x879b('0x6a')],_0x503997,_0x879b('0x60'));})['then'](function(_0x44da3d){_0x9b80f3=_0x44da3d;logger['info'](_0x879b('0x6b'),_0x9b80f3['id']);logger['info'](_0x879b('0x6c'),_0x9b80f3['id'],_0xa210d6['name'],_0x570e8f[_0x879b('0x4d')]);switch(_0x570e8f[_0x879b('0x4d')]){case'integrationTab':emit(util[_0x879b('0x47')]('user:%s',_0xa210d6[_0x879b('0x55')]),_0x879b('0x6d'),{'recordId':_0x9b80f3['id']});break;case _0x879b('0x6e'):emit(util['format'](_0x879b('0x6f'),_0xa210d6[_0x879b('0x55')]),_0x879b('0x70'),{'uri':util[_0x879b('0x47')](_0x879b('0x71'),_0x503997[_0x879b('0x72')],_0x9b80f3['id'])});break;default:logger[_0x879b('0x73')](_0x879b('0x74'));}})[_0x879b('0x75')](function(_0x23d02c){logger[_0x879b('0x73')](_0x879b('0x64'),_0x23d02c);});};exports[_0x879b('0x76')]=function(_0xe89851,_0x4e9591,_0x3bd117,_0x595499,_0x406b55,_0x5b244f,_0x49a2dc){var _0x524ecf,_0x27e289,_0x72dd25,_0x2d18e1;_0x5b244f[_0x879b('0x61')]=intUtil[_0x879b('0x62')](_0x5b244f[_0x879b('0x61')]);_0x5b244f[_0x879b('0x5b')]=intUtil['stripTrailingSlash'](_0x5b244f[_0x879b('0x5b')]);if(_0x49a2dc&&_0x49a2dc[_0x879b('0x77')]&&_0x49a2dc[_0x879b('0x77')]!=='none'){logger[_0x879b('0x20')](_0x879b('0x78'),_0x879b('0x79'));_0x4e9591['recordingURL']=util[_0x879b('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b244f[_0x879b('0x61')],_0x4e9591[_0x879b('0x67')],md5(_0x4e9591[_0x879b('0x67')]));}return getConnection(_0x5b244f)[_0x879b('0x2c')](function(_0x1531e2){_0x2d18e1=_0x1531e2;return getUser(_0x5b244f,_0x595499[_0x879b('0x7a')],_0x2d18e1);})[_0x879b('0x2c')](function(_0x544065){_0x524ecf=_0x544065;return getEndUser(_0x5b244f,_0x3bd117,_0x4e9591[_0x879b('0x7b')],_0x4e9591[_0x879b('0x7c')],_0x2d18e1);})[_0x879b('0x2c')](function(_0x6148de){_0x27e289=_0x6148de;return getTicket(_0x5b244f,_0x524ecf,_0x27e289,_0x3bd117,_0x4e9591,_0x3bd117[_0x879b('0x6a')],_0x2d18e1,'outbound');})[_0x879b('0x2c')](function(_0x3b0d77){_0x72dd25=_0x3b0d77;logger['info'](_0x879b('0x7d'),_0x72dd25['id']);logger[_0x879b('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x72dd25['id'],_0x595499[_0x879b('0x55')],_0x5b244f[_0x879b('0x4d')]);switch(_0x5b244f['type']){case'integrationTab':emit(util[_0x879b('0x47')](_0x879b('0x6f'),_0x595499[_0x879b('0x55')]),_0x879b('0x6d'),{'recordId':_0x72dd25['id']});break;case _0x879b('0x6e'):emit(util['format'](_0x879b('0x6f'),_0x595499['name']),_0x879b('0x70'),{'uri':util['format']('%s/%s/e',_0x2d18e1['instanceUrl'],_0x72dd25['id'])});break;default:logger[_0x879b('0x73')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x879b('0x75')](function(_0x4e7e96){logger[_0x879b('0x73')](_0x879b('0x78'),_0x4e7e96);});};exports[_0x879b('0x7e')]=function(_0xade567,_0x4ce956,_0x1115a5,_0x1385e5,_0x279900,_0x12a42b){var _0x306f12,_0x3c2e87,_0x44d50c,_0x16492f;_0x12a42b['serverUrl']=intUtil[_0x879b('0x62')](_0x12a42b['serverUrl']);_0x12a42b[_0x879b('0x5b')]=intUtil['stripTrailingSlash'](_0x12a42b['remoteUri']);if(_0x279900&&_0x279900[_0x879b('0x63')]){logger[_0x879b('0x20')]('['+_0x4ce956['lastevent'][_0x879b('0x7f')]()+']',_0x879b('0x79'));_0x4ce956[_0x879b('0x65')]=util[_0x879b('0x47')](_0x879b('0x66'),_0x12a42b[_0x879b('0x61')],_0x4ce956[_0x879b('0x67')],md5(_0x4ce956[_0x879b('0x67')]));}else{_0x4ce956[_0x879b('0x65')]='';}return getConnection(_0x12a42b)[_0x879b('0x2c')](function(_0x266995){_0x16492f=_0x266995;if(!_[_0x879b('0x23')](_0x1385e5)){return getUser(_0x12a42b,_0x1385e5[_0x879b('0x55')],_0x16492f);}else{return getUser(_0x12a42b,null,_0x16492f);}})['then'](function(_0xbf8fd7){_0x306f12=_0xbf8fd7;return getEndUser(_0x12a42b,_0x1115a5,_0x4ce956[_0x879b('0x68')],_0x4ce956['calleridnum'],_0x16492f);})['then'](function(_0x505251){_0x3c2e87=_0x505251;return getTicket(_0x12a42b,_0x306f12,_0x3c2e87,_0x1115a5,_0x4ce956,_0x1115a5[_0x879b('0x6a')],_0x16492f);})[_0x879b('0x2c')](function(_0x21f211){_0x44d50c=_0x21f211;logger[_0x879b('0x20')]('['+_0x4ce956[_0x879b('0x80')][_0x879b('0x7f')]()+_0x879b('0x81'),_0x44d50c['id']);logger[_0x879b('0x20')]('['+_0x4ce956[_0x879b('0x80')]['toUpperCase']()+_0x879b('0x82'),_0x12a42b[_0x879b('0x4d')]);})[_0x879b('0x75')](function(_0x2ab5cb){logger[_0x879b('0x73')]('['+_0x4ce956[_0x879b('0x80')]['toUpperCase']()+']',_0x2ab5cb);});}; \ 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 c4eb9f7..c2093a6 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 _0x3443=['number',']\x20getTicket\x20crm','label','label_entry','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','./util','../../../../config/environment','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','true','userId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','toString','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','getString','Descriptions','ticketId','ticketNumber'];(function(_0x50e74f,_0x38f621){var _0x3919eb=function(_0x55dd47){while(--_0x55dd47){_0x50e74f['push'](_0x50e74f['shift']());}};_0x3919eb(++_0x38f621);}(_0x3443,0x1c6));var _0x3344=function(_0x1bca14,_0x2db9d8){_0x1bca14=_0x1bca14-0x0;var _0x348df5=_0x3443[_0x1bca14];return _0x348df5;};'use strict';var _=require(_0x3344('0x0'));var Promise=require(_0x3344('0x1'));var rp=require('request-promise');var util=require(_0x3344('0x2'));var md5=require(_0x3344('0x3'));var Redis=require('ioredis');var intUtil=require(_0x3344('0x4'));var config=require(_0x3344('0x5'));var logger=require('../../../../config/logger')('servicenow');config[_0x3344('0x6')]=_['defaults'](config[_0x3344('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3344('0x6')]));function getAdminUser(_0x310bc3,_0xae2bf2,_0x1c6fd5,_0x38758b,_0x1605d0,_0x3a3368){return new Promise(function(_0x57cc91,_0x3462ab){var _0x52846b={'method':_0x3344('0x7'),'uri':_0x38758b+_0x3344('0x8')+'&'+_0x1605d0+'&'+_0x3a3368,'auth':_0xae2bf2,'json':!![]};return rp(_0x52846b)[_0x3344('0x9')](function(_0x1cbacb){if(_0x1cbacb['result'][_0x3344('0xa')]>0x0){_0x1c6fd5[_0x3344('0xb')]=_0x1cbacb[_0x3344('0xc')][0x0][_0x3344('0xd')];}logger[_0x3344('0xe')]('['+[_0x310bc3[_0x3344('0xf')]()]+_0x3344('0x10'),_0x1c6fd5);_0x57cc91(_0x1c6fd5);})[_0x3344('0x11')](function(_0x14c03c){logger[_0x3344('0x12')]('['+[_0x310bc3[_0x3344('0xf')]()]+']',_0x14c03c[_0x3344('0x13')]);_0x3462ab(_0x14c03c[_0x3344('0x13')]);});});}function getUser(_0x1137b3,_0x3d9c00,_0x58d2b3,_0x4460fa,_0x3fbb2e){return function(_0x28319a){logger[_0x3344('0xe')]('['+[_0x1137b3[_0x3344('0xf')]()]+_0x3344('0x14'),_0x28319a);return new Promise(function(_0x415ea0,_0xd07cd2){if(intUtil[_0x3344('0x15')](_0x28319a[_0x3344('0x16')])){var _0x1929ed={'method':_0x3344('0x7'),'uri':_0x58d2b3+_0x3344('0x17')+_0x28319a['userEmail']+'&'+_0x4460fa+'&'+_0x3fbb2e,'auth':_0x3d9c00,'json':!![]};logger[_0x3344('0xe')]('['+[_0x1137b3[_0x3344('0xf')]()]+_0x3344('0x18'),_0x1929ed);return rp(_0x1929ed)[_0x3344('0x9')](function(_0x11ca21){logger['info']('['+[_0x1137b3[_0x3344('0xf')]()]+'],\x20getUser\x20entity',_0x11ca21);if(_0x11ca21[_0x3344('0xc')][_0x3344('0xa')]>0x0&&String(_0x11ca21['result'][0x0]['active'])===_0x3344('0x19')){_0x28319a[_0x3344('0x1a')]=_0x11ca21[_0x3344('0xc')][0x0][_0x3344('0xd')];}else{_0x28319a[_0x3344('0x1a')]=_0x28319a['adminId'];_0x28319a[_0x3344('0x16')]=_0x28319a[_0x3344('0x1b')];}logger[_0x3344('0xe')]('['+[_0x1137b3[_0x3344('0xf')]()]+'],\x20getUser\x20crm',_0x28319a);_0x415ea0(_0x28319a);})[_0x3344('0x11')](function(_0x5035ba){logger[_0x3344('0x12')]('['+[_0x1137b3[_0x3344('0xf')]()]+']',_0x5035ba[_0x3344('0x13')]);_0xd07cd2(_0x5035ba[_0x3344('0x13')]);});}else{logger[_0x3344('0xe')]('['+[_0x1137b3['toUpperCase']()]+_0x3344('0x1c'));_0x28319a[_0x3344('0x1a')]=_0x28319a[_0x3344('0xb')];_0x28319a[_0x3344('0x16')]=_0x28319a[_0x3344('0x1b')];_0x415ea0(_0x28319a);}});};}function createEndUser(_0x52378d,_0x110715,_0x18214a,_0x16e173,_0x28ddd5){logger[_0x3344('0xe')]('['+[_0x52378d['toUpperCase']()]+_0x3344('0x1d'),_0x18214a);return new Promise(function(_0x804886,_0x5d948e){var _0x101503={'method':_0x3344('0x1e'),'uri':_0x16e173+_0x3344('0x1f')+_0x28ddd5,'body':{'user_name':_0x18214a[_0x3344('0x20')],'roles':_0x3344('0x21'),'first_name':_0x18214a[_0x3344('0x20')],'active':'true','date_format':'System','phone':_0x18214a[_0x3344('0x20')]},'auth':_0x110715,'json':!![]};return rp(_0x101503)[_0x3344('0x9')](function(_0x4ab957){logger[_0x3344('0xe')]('['+[_0x52378d[_0x3344('0xf')]()]+_0x3344('0x22'),_0x4ab957['result']);_0x18214a[_0x3344('0x23')]=_0x4ab957[_0x3344('0xc')]['sys_id'];_0x804886(_0x18214a);})[_0x3344('0x11')](function(_0x142d3f){logger[_0x3344('0x12')]('['+[_0x52378d['toUpperCase']()]+']',_0x142d3f[_0x3344('0x13')]);_0x5d948e(_0x142d3f[_0x3344('0x13')]);});});}function getEndUser(_0x4bb5c8,_0x148fd3,_0x28aeee,_0x16f1a8,_0x4ba6d7){return function(_0x566215){logger['info']('['+[_0x4bb5c8['toUpperCase']()]+_0x3344('0x24'),_0x566215);return new Promise(function(_0x257c30,_0x820ebf){var _0x4f5197={'method':_0x3344('0x7'),'uri':_0x28aeee+_0x3344('0x25')+_0x566215[_0x3344('0x20')]+'&'+_0x16f1a8+'&'+_0x4ba6d7,'auth':_0x148fd3,'json':!![]};return rp(_0x4f5197)[_0x3344('0x9')](function(_0x34b4f0){if(_0x34b4f0[_0x3344('0xc')][_0x3344('0xa')]>0x0){_0x566215['endUserId']=_0x34b4f0[_0x3344('0xc')][0x0][_0x3344('0xd')];logger[_0x3344('0xe')]('['+[_0x4bb5c8['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x566215);_0x257c30(_0x566215);}else{return createEndUser(_0x4bb5c8,_0x148fd3,_0x566215,_0x28aeee,_0x16f1a8)[_0x3344('0x9')](function(_0x5703bc){logger[_0x3344('0xe')]('['+[_0x4bb5c8[_0x3344('0xf')]()]+_0x3344('0x26'),_0x5703bc);_0x257c30(_0x5703bc);});}})[_0x3344('0x11')](function(_0x22c278){logger[_0x3344('0x12')]('['+[_0x4bb5c8['toUpperCase']()]+']',_0x22c278[_0x3344('0x13')]);_0x820ebf(_0x22c278[_0x3344('0x13')]);});});};}function getCustomFields(_0x1e8a85,_0xf34f74){var _0x19af7c={};if(_0x1e8a85['length']>0x0){_[_0x3344('0x27')](_0x1e8a85,function(_0x26c524){if(_[_0x3344('0x28')](['string',_0x3344('0x29')],_0x26c524[_0x3344('0x2a')])&&_0x26c524[_0x3344('0x2b')]&&!_0x26c524[_0x3344('0x2c')]){_0x19af7c[_0x26c524[_0x3344('0x2b')][_0x3344('0x2d')]()]=_0x26c524[_0x3344('0x2e')]['toString']();}else if(_[_0x3344('0x28')](['string',_0x3344('0x29')],_0x26c524[_0x3344('0x2a')])&&_0x26c524['idField']&&_0x26c524[_0x3344('0x2c')]){_0x19af7c[_0x26c524[_0x3344('0x2f')][_0x3344('0x2d')]()]=_0x26c524['content']['toString']();}else if(_0x26c524['type']===_0x3344('0x30')&&_0x26c524[_0x3344('0x31')]&&_0x26c524['idField']&&_0x26c524[_0x3344('0x2c')]){_0x19af7c[_0x26c524['idField']['toLowerCase']()]=_0xf34f74[_0x26c524[_0x3344('0x31')]][_0x3344('0x32')]();}else if(_0x26c524[_0x3344('0x2a')]===_0x3344('0x33')&&_0x26c524[_0x3344('0x34')]&&_0x26c524[_0x3344('0x34')][_0x3344('0x35')]&&_0x26c524[_0x3344('0x2f')]&&_0x26c524[_0x3344('0x2c')]){_0x19af7c[_0x26c524[_0x3344('0x2f')][_0x3344('0x2d')]()]=_0xf34f74[_0x26c524[_0x3344('0x34')][_0x3344('0x35')][_0x3344('0x2d')]()][_0x3344('0x32')]();}});}return _0x19af7c;}function getTicket(_0x1a221c,_0x3a9a77,_0x186f71,_0x21732a,_0x4c24cd,_0x49864e){return function(_0x4a0b08){logger[_0x3344('0xe')]('['+[_0x1a221c[_0x3344('0xf')]()]+_0x3344('0x36'),_0x4a0b08);return new Promise(function(_0x44f1c3,_0x46f2cd){var _0x299bba=_0x1a221c[_0x3344('0x2d')]()==='outbound'?_0x4a0b08[_0x3344('0x1a')]:_0x4a0b08[_0x3344('0x23')];var _0xd3f6d3={'method':_0x3344('0x1e'),'uri':_0x186f71+_0x3344('0x37')+'?'+_0x49864e,'body':Object[_0x3344('0x38')]({},{'active':_0x3344('0x19'),'caller_id':_0x299bba,'assigned_to':_0x4a0b08[_0x3344('0x1a')],'short_description':intUtil[_0x3344('0x39')](_0x21732a['Subjects'],_0x4c24cd,'\x20'),'description':intUtil[_0x3344('0x39')](_0x21732a[_0x3344('0x3a')],_0x4c24cd,'\x0a')},getCustomFields(_0x21732a['Fields'],_0x4c24cd)),'auth':_0x3a9a77,'json':!![]};return rp(_0xd3f6d3)['then'](function(_0x131c9f){logger[_0x3344('0xe')]('['+[_0x1a221c['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x131c9f[_0x3344('0xc')]);_0x4a0b08[_0x3344('0x3b')]=_0x131c9f['result']['sys_id'];_0x4a0b08[_0x3344('0x3c')]=_0x131c9f[_0x3344('0xc')][_0x3344('0x3d')];logger[_0x3344('0xe')]('['+[_0x1a221c[_0x3344('0xf')]()]+_0x3344('0x3e'),_0x4a0b08);_0x44f1c3(_0x4a0b08);})[_0x3344('0x11')](function(_0x1be578){logger[_0x3344('0x12')]('['+[_0x1a221c[_0x3344('0xf')]()]+']',_0x1be578[_0x3344('0x13')]);_0x46f2cd(_0x1be578[_0x3344('0x13')]);});});};}function createRemoteTag(_0x415cb8,_0x452c63,_0x13c025,_0x27a507){return new Promise(function(_0xf57bd4,_0x8da7c){var _0x1af394={'method':_0x3344('0x1e'),'uri':_0x13c025+'label'+'?'+_0x27a507,'body':{'short_description':_0x415cb8,'global':!![],'active':!![],'name':_0x415cb8},'auth':_0x452c63,'json':!![]};return rp(_0x1af394)[_0x3344('0x9')](function(_0x15a359){var _0x449ba6=_0x15a359[_0x3344('0xc')][_0x3344('0xd')];_0xf57bd4(_0x449ba6);});});}function getRemoteTag(_0x2adc1e,_0x109856,_0x2e8a53,_0x55084b,_0x3e29e6){return new Promise(function(_0x173a0b,_0x508c8a){var _0x5e7c59={'method':_0x3344('0x7'),'uri':_0x2e8a53+_0x3344('0x3f')+'?sysparm_query=name%3D'+_0x2adc1e+'&'+_0x55084b,'auth':_0x109856,'json':!![]};return rp(_0x5e7c59)[_0x3344('0x9')](function(_0x98b9e2){if(_0x98b9e2[_0x3344('0xc')][_0x3344('0xa')]>0x0){var _0x23a41b=_0x98b9e2['result'][0x0]['sys_id'];_0x173a0b(_0x23a41b);}else{return createRemoteTag(_0x2adc1e,_0x109856,_0x2e8a53,_0x55084b)[_0x3344('0x9')](function(_0x5411e7){_0x173a0b(_0x5411e7);});}});});}function assignTagToIncident(_0x169c71,_0x5e8006,_0x277691,_0x1323ca,_0x3a5cc0){return new Promise(function(_0x47008c,_0x13a587){var _0x1eb447={'method':_0x3344('0x1e'),'uri':_0x277691+_0x3344('0x40')+'?'+_0x3a5cc0,'body':{'label':_0x169c71,'table':_0x3344('0x37'),'id_type':'Incident','table_key':_0x1323ca[_0x3344('0x3b')],'title':_0x3344('0x41')+_0x1323ca[_0x3344('0x3c')],'id_display':_0x1323ca[_0x3344('0x3c')]},'auth':_0x5e8006,'json':!![]};return rp(_0x1eb447)[_0x3344('0x9')](function(_0x28c8d2){_0x47008c();})[_0x3344('0x11')](function(){_0x47008c();});});}function manageTags(_0x24c09f,_0x29629c,_0x448627,_0x72acc5,_0x548d19,_0x55ba3d,_0x5e921d){return new Promise(function(_0x2075f3,_0x4106fa){var _0x10897e=[];_0x29629c['forEach'](function(_0x9b8f8d){_0x10897e['push'](getRemoteTag(_0x9b8f8d,_0x448627,_0x72acc5,_0x55ba3d,_0x5e921d));});return Promise[_0x3344('0x42')](_0x10897e)[_0x3344('0x9')](function(_0x19a331){if(_0x19a331[_0x3344('0xa')]){logger[_0x3344('0xe')]('['+[_0x24c09f[_0x3344('0xf')]()]+_0x3344('0x43'),_0x19a331);var _0x3af9b9=[];_0x19a331['forEach'](function(_0x2996fe){_0x3af9b9[_0x3344('0x44')](assignTagToIncident(_0x2996fe,_0x448627,_0x72acc5,_0x548d19,_0x55ba3d));});return Promise['all'](_0x3af9b9)[_0x3344('0x9')](function(){_0x2075f3();})[_0x3344('0x11')](function(){_0x2075f3();});}else{_0x2075f3();}});});}function getTags(_0x594d1a,_0x58ac99,_0x27de33,_0x43a4bf,_0x277103,_0x37e934){return function(_0x11f49c){return new Promise(function(_0x5e1de1,_0x263828){var _0x53bc56=[];var _0x4e568e=_0x43a4bf[_0x3344('0x45')];if(_0x4e568e&&_0x4e568e['length']>0x0){_0x53bc56=_[_0x3344('0x46')](_0x4e568e,'name');}if(_0x53bc56[_0x3344('0xa')]>0x0){return manageTags(_0x594d1a,_0x53bc56,_0x58ac99,_0x27de33,_0x11f49c,_0x277103,_0x37e934)[_0x3344('0x9')](function(){_0x5e1de1(_0x11f49c);});}else{_0x5e1de1(_0x11f49c);}});};}function emit(_0x17431b,_0x16ee21,_0x3442d2){var _0x55b24c=_0x3344('0x47')+_0x3344('0x48')+_0x3344('0x49')+_0x3344('0x4a');var _0x5e5065={'uri':_0x17431b+_0x3344('0x4b')+_0x3442d2+_0x55b24c};io['to'](util[_0x3344('0x4c')]('user:%s',_0x16ee21))[_0x3344('0x4d')](_0x3344('0x4e'),_0x5e5065);}exports['cs']=function(_0x1003b7,_0x1a6824,_0x2ca9db,_0x3e215a,_0x4b726e,_0x12b5d5,_0x1ff8ef,_0x2ecded){var _0x4702de={};var _0x19e4b2={'user':_0x12b5d5['username'],'pass':_0x12b5d5[_0x3344('0x4f')]};var _0x578359=_0x3344('0x50');var _0x121e04=_0x3344('0x51');_0x12b5d5[_0x3344('0x52')]=intUtil[_0x3344('0x53')](_0x12b5d5[_0x3344('0x52')]);_0x12b5d5[_0x3344('0x54')]=intUtil[_0x3344('0x53')](_0x12b5d5[_0x3344('0x54')]);var _0x76bd71=util[_0x3344('0x4c')](_0x3344('0x55'),_0x12b5d5[_0x3344('0x52')]);_0x4702de[_0x3344('0x16')]=!_[_0x3344('0x56')](_0x3e215a)?_0x3e215a[_0x3344('0x57')]:null;_0x4702de['adminEmail']=_0x12b5d5['email'];_0x4702de[_0x3344('0x20')]=_0x2ecded['toLowerCase']()===_0x3344('0x58')?_0x1a6824[_0x3344('0x59')]:_0x1a6824['calleridnum'];_0x4702de[_0x3344('0x5a')]=_0x2ecded===_0x3344('0x5b')||_0x2ecded===_0x3344('0x5c')?_0x3344('0x5b'):'outbound';var _0x3981d7=util[_0x3344('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12b5d5['serverUrl'],_0x1a6824[_0x3344('0x5d')],md5(_0x1a6824[_0x3344('0x5d')]));if(_0x4b726e&&_0x4b726e[_0x3344('0x5e')]){logger[_0x3344('0xe')](_0x3344('0x5f'),_0x3344('0x60'));_0x1a6824[_0x3344('0x61')]=_0x3981d7;}else if(_0x1ff8ef&&_0x1ff8ef[_0x3344('0x62')]&&_0x1ff8ef[_0x3344('0x62')]!==_0x3344('0x63')){logger[_0x3344('0xe')](_0x3344('0x64'),'Recording\x20is\x20enabled!');_0x1a6824[_0x3344('0x61')]=_0x3981d7;}else{_0x1a6824[_0x3344('0x61')]='';}return getAdminUser(_0x2ecded,_0x19e4b2,_0x4702de,_0x76bd71,_0x121e04,_0x578359)['then'](getUser(_0x2ecded,_0x19e4b2,_0x76bd71,_0x121e04,_0x578359))[_0x3344('0x9')](getEndUser(_0x2ecded,_0x19e4b2,_0x76bd71,_0x121e04,_0x578359))[_0x3344('0x9')](getTicket(_0x2ecded,_0x19e4b2,_0x76bd71,_0x2ca9db,_0x1a6824,_0x121e04))[_0x3344('0x9')](function(_0x5e4de0){logger['info'](util[_0x3344('0x4c')]('The\x20ticket\x20ID\x20is:\x20%s',_0x5e4de0['ticketId']));logger[_0x3344('0xe')](util[_0x3344('0x4c')]('call\x20direction:\x20%s',_0x2ecded));if(_0x2ecded!=='unmanaged'){logger[_0x3344('0xe')]('['+[_0x2ecded[_0x3344('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x12b5d5[_0x3344('0x52')],_0x3e215a[_0x3344('0x35')],_0x5e4de0[_0x3344('0x3b')]);}})['catch'](function(_0x49bf4f){logger[_0x3344('0x12')]('['+[_0x2ecded['toUpperCase']()]+_0x3344('0x65'),util[_0x3344('0x66')](_0x49bf4f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x7238=['active','true','userId','],\x20createEndUser\x20input\x20crm','sys_user?','user','endUserNumber','System','then','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','customField','content','toString','toLowerCase','variableName','idField','customVariable','Variable',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','forEach','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','emit','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','format','%s/api/now/table/','isNil','adminEmail','email','outbound','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','util','md5','./util','../../../../config/environment','defaults','localhost','redis','GET','sys_user?sysparm_query=user_name%3Dadmin','length','adminId','result','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7238,0x1e5));var _0x8723=function(_0xf3052b,_0x36d8f2){_0xf3052b=_0xf3052b-0x0;var _0x18b357=_0x7238[_0xf3052b];return _0x18b357;};'use strict';var _=require('lodash');var Promise=require(_0x8723('0x0'));var rp=require('request-promise');var util=require(_0x8723('0x1'));var md5=require(_0x8723('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8723('0x3'));var config=require(_0x8723('0x4'));var logger=require('../../../../config/logger')('servicenow');config['redis']=_[_0x8723('0x5')](config['redis'],{'host':_0x8723('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8723('0x7')]));function getAdminUser(_0x2ba7b7,_0x545179,_0x396f5c,_0x19c48e,_0x50c1e1,_0x5cfbac){return new Promise(function(_0x111e46,_0x15a014){var _0x30921c={'method':_0x8723('0x8'),'uri':_0x19c48e+_0x8723('0x9')+'&'+_0x50c1e1+'&'+_0x5cfbac,'auth':_0x545179,'json':!![]};return rp(_0x30921c)['then'](function(_0x5509f9){if(_0x5509f9['result'][_0x8723('0xa')]>0x0){_0x396f5c[_0x8723('0xb')]=_0x5509f9[_0x8723('0xc')][0x0][_0x8723('0xd')];}logger['info']('['+[_0x2ba7b7[_0x8723('0xe')]()]+_0x8723('0xf'),_0x396f5c);_0x111e46(_0x396f5c);})[_0x8723('0x10')](function(_0x2da43c){logger[_0x8723('0x11')]('['+[_0x2ba7b7[_0x8723('0xe')]()]+']',_0x2da43c[_0x8723('0x12')]);_0x15a014(_0x2da43c[_0x8723('0x12')]);});});}function getUser(_0x2c02b4,_0x3b4799,_0x50056c,_0x1dcc65,_0x4ea00d){return function(_0x2eaf3d){logger[_0x8723('0x13')]('['+[_0x2c02b4[_0x8723('0xe')]()]+_0x8723('0x14'),_0x2eaf3d);return new Promise(function(_0x1630e7,_0x3f3882){if(intUtil['validateEmail'](_0x2eaf3d[_0x8723('0x15')])){var _0x2594d0={'method':_0x8723('0x8'),'uri':_0x50056c+_0x8723('0x16')+_0x2eaf3d[_0x8723('0x15')]+'&'+_0x1dcc65+'&'+_0x4ea00d,'auth':_0x3b4799,'json':!![]};logger[_0x8723('0x13')]('['+[_0x2c02b4[_0x8723('0xe')]()]+_0x8723('0x17'),_0x2594d0);return rp(_0x2594d0)['then'](function(_0x4b05b4){logger['info']('['+[_0x2c02b4[_0x8723('0xe')]()]+_0x8723('0x18'),_0x4b05b4);if(_0x4b05b4[_0x8723('0xc')][_0x8723('0xa')]>0x0&&String(_0x4b05b4[_0x8723('0xc')][0x0][_0x8723('0x19')])===_0x8723('0x1a')){_0x2eaf3d[_0x8723('0x1b')]=_0x4b05b4[_0x8723('0xc')][0x0][_0x8723('0xd')];}else{_0x2eaf3d[_0x8723('0x1b')]=_0x2eaf3d[_0x8723('0xb')];_0x2eaf3d[_0x8723('0x15')]=_0x2eaf3d['adminEmail'];}logger[_0x8723('0x13')]('['+[_0x2c02b4[_0x8723('0xe')]()]+'],\x20getUser\x20crm',_0x2eaf3d);_0x1630e7(_0x2eaf3d);})[_0x8723('0x10')](function(_0x40f26f){logger[_0x8723('0x11')]('['+[_0x2c02b4[_0x8723('0xe')]()]+']',_0x40f26f[_0x8723('0x12')]);_0x3f3882(_0x40f26f[_0x8723('0x12')]);});}else{logger['info']('['+[_0x2c02b4['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x2eaf3d[_0x8723('0x1b')]=_0x2eaf3d['adminId'];_0x2eaf3d[_0x8723('0x15')]=_0x2eaf3d['adminEmail'];_0x1630e7(_0x2eaf3d);}});};}function createEndUser(_0x4448b2,_0x452045,_0x4091e9,_0x75d074,_0x348af3){logger[_0x8723('0x13')]('['+[_0x4448b2[_0x8723('0xe')]()]+_0x8723('0x1c'),_0x4091e9);return new Promise(function(_0x548042,_0x28ecd7){var _0x1da9f8={'method':'POST','uri':_0x75d074+_0x8723('0x1d')+_0x348af3,'body':{'user_name':_0x4091e9['endUserNumber'],'roles':_0x8723('0x1e'),'first_name':_0x4091e9[_0x8723('0x1f')],'active':_0x8723('0x1a'),'date_format':_0x8723('0x20'),'phone':_0x4091e9[_0x8723('0x1f')]},'auth':_0x452045,'json':!![]};return rp(_0x1da9f8)[_0x8723('0x21')](function(_0x2fefcf){logger[_0x8723('0x13')]('['+[_0x4448b2[_0x8723('0xe')]()]+_0x8723('0x22'),_0x2fefcf[_0x8723('0xc')]);_0x4091e9['endUserId']=_0x2fefcf[_0x8723('0xc')][_0x8723('0xd')];_0x548042(_0x4091e9);})['catch'](function(_0x5be30f){logger[_0x8723('0x11')]('['+[_0x4448b2['toUpperCase']()]+']',_0x5be30f[_0x8723('0x12')]);_0x28ecd7(_0x5be30f[_0x8723('0x12')]);});});}function getEndUser(_0x13c51f,_0x4c86e9,_0x20cf6f,_0x4840a2,_0x104dd4){return function(_0x5beea2){logger[_0x8723('0x13')]('['+[_0x13c51f[_0x8723('0xe')]()]+_0x8723('0x23'),_0x5beea2);return new Promise(function(_0x240061,_0x5e38e8){var _0x5b1963={'method':'GET','uri':_0x20cf6f+_0x8723('0x24')+_0x5beea2[_0x8723('0x1f')]+'&'+_0x4840a2+'&'+_0x104dd4,'auth':_0x4c86e9,'json':!![]};return rp(_0x5b1963)[_0x8723('0x21')](function(_0x656f59){if(_0x656f59[_0x8723('0xc')][_0x8723('0xa')]>0x0){_0x5beea2[_0x8723('0x25')]=_0x656f59[_0x8723('0xc')][0x0]['sys_id'];logger[_0x8723('0x13')]('['+[_0x13c51f['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x5beea2);_0x240061(_0x5beea2);}else{return createEndUser(_0x13c51f,_0x4c86e9,_0x5beea2,_0x20cf6f,_0x4840a2)[_0x8723('0x21')](function(_0x3feb0c){logger[_0x8723('0x13')]('['+[_0x13c51f['toUpperCase']()]+_0x8723('0x26'),_0x3feb0c);_0x240061(_0x3feb0c);});}})[_0x8723('0x10')](function(_0x365310){logger[_0x8723('0x11')]('['+[_0x13c51f[_0x8723('0xe')]()]+']',_0x365310[_0x8723('0x12')]);_0x5e38e8(_0x365310[_0x8723('0x12')]);});});};}function getCustomFields(_0x1545d7,_0xb613d7){var _0x20c879={};if(_0x1545d7[_0x8723('0xa')]>0x0){_['forEach'](_0x1545d7,function(_0x44d47a){if(_[_0x8723('0x27')]([_0x8723('0x28'),_0x8723('0x29')],_0x44d47a[_0x8723('0x2a')])&&_0x44d47a[_0x8723('0x2b')]&&!_0x44d47a[_0x8723('0x2c')]){_0x20c879[_0x44d47a['nameField']['toLowerCase']()]=_0x44d47a[_0x8723('0x2d')][_0x8723('0x2e')]();}else if(_[_0x8723('0x27')]([_0x8723('0x28'),'picklist'],_0x44d47a[_0x8723('0x2a')])&&_0x44d47a['idField']&&_0x44d47a['customField']){_0x20c879[_0x44d47a['idField'][_0x8723('0x2f')]()]=_0x44d47a['content'][_0x8723('0x2e')]();}else if(_0x44d47a['type']==='variable'&&_0x44d47a[_0x8723('0x30')]&&_0x44d47a[_0x8723('0x31')]&&_0x44d47a[_0x8723('0x2c')]){_0x20c879[_0x44d47a[_0x8723('0x31')]['toLowerCase']()]=_0xb613d7[_0x44d47a[_0x8723('0x30')]][_0x8723('0x2e')]();}else if(_0x44d47a[_0x8723('0x2a')]===_0x8723('0x32')&&_0x44d47a[_0x8723('0x33')]&&_0x44d47a[_0x8723('0x33')]['name']&&_0x44d47a['idField']&&_0x44d47a[_0x8723('0x2c')]){_0x20c879[_0x44d47a[_0x8723('0x31')]['toLowerCase']()]=_0xb613d7[_0x44d47a[_0x8723('0x33')]['name'][_0x8723('0x2f')]()][_0x8723('0x2e')]();}});}return _0x20c879;}function getTicket(_0x368d4c,_0x1f0482,_0xa3cac2,_0x33c83d,_0x384a16,_0x2c7c45){return function(_0x2204f8){logger[_0x8723('0x13')]('['+[_0x368d4c[_0x8723('0xe')]()]+_0x8723('0x34'),_0x2204f8);return new Promise(function(_0x3b9e10,_0x44e461){var _0x33eeb2=_0x368d4c[_0x8723('0x2f')]()==='outbound'?_0x2204f8['userId']:_0x2204f8[_0x8723('0x25')];var _0x396e32={'method':_0x8723('0x35'),'uri':_0xa3cac2+_0x8723('0x36')+'?'+_0x2c7c45,'body':Object[_0x8723('0x37')]({},{'active':_0x8723('0x1a'),'caller_id':_0x33eeb2,'assigned_to':_0x2204f8['userId'],'short_description':intUtil[_0x8723('0x38')](_0x33c83d[_0x8723('0x39')],_0x384a16,'\x20'),'description':intUtil[_0x8723('0x38')](_0x33c83d['Descriptions'],_0x384a16,'\x0a')},getCustomFields(_0x33c83d[_0x8723('0x3a')],_0x384a16)),'auth':_0x1f0482,'json':!![]};return rp(_0x396e32)[_0x8723('0x21')](function(_0x1a946c){logger[_0x8723('0x13')]('['+[_0x368d4c[_0x8723('0xe')]()]+_0x8723('0x3b'),_0x1a946c['result']);_0x2204f8[_0x8723('0x3c')]=_0x1a946c[_0x8723('0xc')]['sys_id'];_0x2204f8[_0x8723('0x3d')]=_0x1a946c['result'][_0x8723('0x3e')];logger[_0x8723('0x13')]('['+[_0x368d4c[_0x8723('0xe')]()]+']\x20getTicket\x20crm',_0x2204f8);_0x3b9e10(_0x2204f8);})[_0x8723('0x10')](function(_0x26cf2e){logger[_0x8723('0x11')]('['+[_0x368d4c['toUpperCase']()]+']',_0x26cf2e['message']);_0x44e461(_0x26cf2e[_0x8723('0x12')]);});});};}function createRemoteTag(_0x363fe6,_0x3d073c,_0x3369e6,_0x45e8de){return new Promise(function(_0x28426b,_0x5674a7){var _0x542aea={'method':_0x8723('0x35'),'uri':_0x3369e6+_0x8723('0x3f')+'?'+_0x45e8de,'body':{'short_description':_0x363fe6,'global':!![],'active':!![],'name':_0x363fe6},'auth':_0x3d073c,'json':!![]};return rp(_0x542aea)['then'](function(_0x41fa8b){var _0x3721d0=_0x41fa8b['result'][_0x8723('0xd')];_0x28426b(_0x3721d0);});});}function getRemoteTag(_0x311a00,_0x1abe11,_0x26db92,_0x3b7cbb,_0x29f65e){return new Promise(function(_0x581e67,_0x2c3677){var _0x113f28={'method':_0x8723('0x8'),'uri':_0x26db92+_0x8723('0x3f')+_0x8723('0x40')+_0x311a00+'&'+_0x3b7cbb,'auth':_0x1abe11,'json':!![]};return rp(_0x113f28)[_0x8723('0x21')](function(_0x28d056){if(_0x28d056['result'][_0x8723('0xa')]>0x0){var _0x15cdaf=_0x28d056['result'][0x0][_0x8723('0xd')];_0x581e67(_0x15cdaf);}else{return createRemoteTag(_0x311a00,_0x1abe11,_0x26db92,_0x3b7cbb)[_0x8723('0x21')](function(_0x242b77){_0x581e67(_0x242b77);});}});});}function assignTagToIncident(_0x57efea,_0x229638,_0x40384b,_0x482fde,_0x49346d){return new Promise(function(_0x464bc5,_0x4c462c){var _0x317234={'method':_0x8723('0x35'),'uri':_0x40384b+_0x8723('0x41')+'?'+_0x49346d,'body':{'label':_0x57efea,'table':'incident','id_type':_0x8723('0x42'),'table_key':_0x482fde[_0x8723('0x3c')],'title':_0x8723('0x43')+_0x482fde[_0x8723('0x3d')],'id_display':_0x482fde[_0x8723('0x3d')]},'auth':_0x229638,'json':!![]};return rp(_0x317234)[_0x8723('0x21')](function(_0x2a16ff){_0x464bc5();})[_0x8723('0x10')](function(){_0x464bc5();});});}function manageTags(_0x2f2695,_0x35096a,_0x4ba4fc,_0xb4b035,_0x54a089,_0x12ae05,_0x56a9ed){return new Promise(function(_0x5e0d34,_0x592534){var _0x2e0bce=[];_0x35096a['forEach'](function(_0x48a931){_0x2e0bce[_0x8723('0x44')](getRemoteTag(_0x48a931,_0x4ba4fc,_0xb4b035,_0x12ae05,_0x56a9ed));});return Promise[_0x8723('0x45')](_0x2e0bce)[_0x8723('0x21')](function(_0x320b3a){if(_0x320b3a[_0x8723('0xa')]){logger[_0x8723('0x13')]('['+[_0x2f2695[_0x8723('0xe')]()]+_0x8723('0x46'),_0x320b3a);var _0x21e23a=[];_0x320b3a[_0x8723('0x47')](function(_0x13e505){_0x21e23a[_0x8723('0x44')](assignTagToIncident(_0x13e505,_0x4ba4fc,_0xb4b035,_0x54a089,_0x12ae05));});return Promise['all'](_0x21e23a)['then'](function(){_0x5e0d34();})[_0x8723('0x10')](function(){_0x5e0d34();});}else{_0x5e0d34();}});});}function getTags(_0x1c410f,_0x2d495c,_0x307365,_0x32383e,_0x3223fb,_0x5c1289){return function(_0x8acfad){return new Promise(function(_0x52c530,_0x369017){var _0x434c10=[];var _0x775cb2=_0x32383e['Tags'];if(_0x775cb2&&_0x775cb2[_0x8723('0xa')]>0x0){_0x434c10=_['map'](_0x775cb2,'name');}if(_0x434c10['length']>0x0){return manageTags(_0x1c410f,_0x434c10,_0x2d495c,_0x307365,_0x8acfad,_0x3223fb,_0x5c1289)[_0x8723('0x21')](function(){_0x52c530(_0x8acfad);});}else{_0x52c530(_0x8acfad);}});};}function emit(_0xe1b414,_0x83bcec,_0x4fc175){var _0x558a85='%26sysparm_record_target%3Dincident'+_0x8723('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x8723('0x49');var _0x514470={'uri':_0xe1b414+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x4fc175+_0x558a85};io['to'](util['format']('user:%s',_0x83bcec))[_0x8723('0x4a')]('trigger:browser:url',_0x514470);}exports['cs']=function(_0x31e608,_0x429bb4,_0x382ae6,_0x4fcb13,_0xfd6472,_0x58ea53,_0x4fd178,_0x3cf494){var _0x2692b1={};var _0x59ab94={'user':_0x58ea53['username'],'pass':_0x58ea53[_0x8723('0x4b')]};var _0x44c1a7=_0x8723('0x4c');var _0x29d062='sysparm_display_value=true';_0x58ea53['remoteUri']=intUtil[_0x8723('0x4d')](_0x58ea53[_0x8723('0x4e')]);_0x58ea53[_0x8723('0x4f')]=intUtil[_0x8723('0x4d')](_0x58ea53[_0x8723('0x4f')]);var _0x2ca4cc=util[_0x8723('0x50')](_0x8723('0x51'),_0x58ea53[_0x8723('0x4e')]);_0x2692b1[_0x8723('0x15')]=!_[_0x8723('0x52')](_0x4fcb13)?_0x4fcb13['email']:null;_0x2692b1[_0x8723('0x53')]=_0x58ea53[_0x8723('0x54')];_0x2692b1[_0x8723('0x1f')]=_0x3cf494[_0x8723('0x2f')]()===_0x8723('0x55')?_0x429bb4[_0x8723('0x56')]:_0x429bb4['calleridnum'];_0x2692b1[_0x8723('0x57')]=_0x3cf494===_0x8723('0x58')||_0x3cf494==='unmanaged'?_0x8723('0x58'):_0x8723('0x55');var _0x537dc9=util[_0x8723('0x50')](_0x8723('0x59'),_0x58ea53['serverUrl'],_0x429bb4['uniqueid'],md5(_0x429bb4[_0x8723('0x5a')]));if(_0xfd6472&&_0xfd6472[_0x8723('0x5b')]){logger['info']('[QUEUE]',_0x8723('0x5c'));_0x429bb4[_0x8723('0x5d')]=_0x537dc9;}else if(_0x4fd178&&_0x4fd178['recordingFormat']&&_0x4fd178['recordingFormat']!==_0x8723('0x5e')){logger[_0x8723('0x13')](_0x8723('0x5f'),_0x8723('0x5c'));_0x429bb4[_0x8723('0x5d')]=_0x537dc9;}else{_0x429bb4[_0x8723('0x5d')]='';}return getAdminUser(_0x3cf494,_0x59ab94,_0x2692b1,_0x2ca4cc,_0x29d062,_0x44c1a7)['then'](getUser(_0x3cf494,_0x59ab94,_0x2ca4cc,_0x29d062,_0x44c1a7))[_0x8723('0x21')](getEndUser(_0x3cf494,_0x59ab94,_0x2ca4cc,_0x29d062,_0x44c1a7))[_0x8723('0x21')](getTicket(_0x3cf494,_0x59ab94,_0x2ca4cc,_0x382ae6,_0x429bb4,_0x29d062))[_0x8723('0x21')](function(_0x2b5834){logger[_0x8723('0x13')](util['format'](_0x8723('0x60'),_0x2b5834['ticketId']));logger[_0x8723('0x13')](util['format'](_0x8723('0x61'),_0x3cf494));if(_0x3cf494!=='unmanaged'){logger[_0x8723('0x13')]('['+[_0x3cf494['toUpperCase']()]+']',_0x8723('0x62'));emit(_0x58ea53[_0x8723('0x4e')],_0x4fcb13[_0x8723('0x63')],_0x2b5834[_0x8723('0x3c')]);}})[_0x8723('0x10')](function(_0x10a323){logger[_0x8723('0x11')]('['+[_0x3cf494[_0x8723('0xe')]()]+_0x8723('0x64'),util[_0x8723('0x65')](_0x10a323,{'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 fbf2e25..8fd16bd 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 _0x764e=['PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','toUpperCase','error','lodash','bluebird','util','./util','../../../../config/environment','sugarcrm','defaults','redis','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','isNil','Getting\x20agent\x20with\x20name','user_name','then','entry_list','find','resolve','value','name_value_list','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','customField','toLowerCase','custom_fields','content','toString','variable','customVariable','Variable','POST'];(function(_0x1bee28,_0x3dea30){var _0x2ce0e0=function(_0x290041){while(--_0x290041){_0x1bee28['push'](_0x1bee28['shift']());}};_0x2ce0e0(++_0x3dea30);}(_0x764e,0x113));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe764('0x0'));var rp=require('request-promise');var BPromise=require(_0xe764('0x1'));var md5=require('md5');var util=require(_0xe764('0x2'));var Redis=require('ioredis');var intUtil=require(_0xe764('0x3'));var config=require(_0xe764('0x4'));var logger=require('../../../../config/logger')(_0xe764('0x5'));config['redis']=_[_0xe764('0x6')](config[_0xe764('0x7')],{'host':_0xe764('0x8'),'port':0x18eb});var io=require(_0xe764('0x9'))(new Redis(config[_0xe764('0x7')]));var def={'method':'POST','json':!![]};function emit(_0xbf4f27,_0x1e6dc0,_0xa4c3c9){io['to'](_0xbf4f27)[_0xe764('0xa')](_0x1e6dc0,_0xa4c3c9);}function getTicket(_0x71a8eb,_0xa52f11,_0x3086b1,_0x50a987,_0x28f7ae,_0x2129d2,_0x54e563,_0x449cc0){logger[_0xe764('0xb')](_0xe764('0xc'));var _0x272ca5=new Date();var _0x38c7c6=[{'name':_0xe764('0xd'),'value':intUtil[_0xe764('0xe')](_0x50a987[_0xe764('0xf')],_0x28f7ae,'\x20')},{'name':'assigned_user_id','value':_0xa52f11['id']},{'name':_0xe764('0x10'),'value':_0xa52f11['id']},{'name':_0xe764('0x11'),'value':intUtil[_0xe764('0xe')](_0x50a987[_0xe764('0x12')],_0x28f7ae,'\x0a')},{'name':_0xe764('0x13'),'value':_0x272ca5[_0xe764('0x14')]()[_0xe764('0x15')](0x0,0x13)[_0xe764('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xe764('0x17'),'value':'15'},{'name':_0xe764('0x18'),'value':_0x3086b1['id']},{'name':'parent_type','value':_0xe764('0x19')},{'name':_0xe764('0x1a'),'value':_0x3086b1['name']},{'name':_0xe764('0x1b'),'value':_0x449cc0}];if(_0x2129d2[_0xe764('0x1c')]){_[_0xe764('0x1d')](_0x2129d2,function(_0x19b7bf){if(_0x28f7ae[_0x19b7bf[_0xe764('0x1e')]]){_0x38c7c6[_0xe764('0x1f')]({'name':_0x19b7bf[_0xe764('0x20')],'value':_0x28f7ae[_0x19b7bf[_0xe764('0x1e')]]});}});}return request({'form':{'method':_0xe764('0x21'),'input_type':_0xe764('0x22'),'response_type':_0xe764('0x22'),'rest_data':JSON[_0xe764('0x23')]({'session':_0x54e563['id'],'module_name':_0xe764('0x24'),'name_value_list':_0x38c7c6})}});}function getAuth(_0x390992){return util[_0xe764('0x25')]('Basic\x20%s',new Buffer(_0x390992['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0xf8ff93){return request({'form':{'method':'get_server_info','input_type':_0xe764('0x22'),'response_type':'JSON','rest_data':JSON[_0xe764('0x23')]({'session':_0xf8ff93['id']})}});}function getUser(_0x51bca9,_0x3a34d6,_0x3ac6cc){if(!_[_0xe764('0x26')](_0x3a34d6)){logger[_0xe764('0xb')](_0xe764('0x27'),_0x3a34d6);return request({'form':{'method':'get_entry_list','input_type':_0xe764('0x22'),'response_type':'JSON','rest_data':JSON[_0xe764('0x23')]({'session':_0x3ac6cc['id'],'module_name':'Employees','query':util[_0xe764('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x3a34d6),'order_by':'','offset':'0','select_fields':['id',_0xe764('0xd'),_0xe764('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe764('0x29')](function(_0x5d95f8){if(_0x5d95f8[_0xe764('0x2a')][_0xe764('0x1c')]){var _0x1709b7=_[_0xe764('0x2b')](_0x5d95f8[_0xe764('0x2a')],function(_0x599b1d){return _0x599b1d['name_value_list'][_0xe764('0x28')]['value']===_0x3a34d6;});if(_0x1709b7){logger[_0xe764('0xb')]('Agent\x20found!');return BPromise[_0xe764('0x2c')]({'id':_0x1709b7['name_value_list']['id'][_0xe764('0x2d')],'name':_0x1709b7[_0xe764('0x2e')][_0xe764('0xd')][_0xe764('0x2d')]});}}logger[_0xe764('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xe764('0x2c')]({'id':_0x3ac6cc[_0xe764('0x2e')][_0xe764('0x2f')][_0xe764('0x2d')],'name':_0x3ac6cc['name_value_list']['user_name'][_0xe764('0x2d')]});});}else{logger[_0xe764('0xb')](_0xe764('0x30'));return BPromise[_0xe764('0x2c')]({'id':_0x3ac6cc[_0xe764('0x2e')][_0xe764('0x2f')]['value'],'name':_0x3ac6cc['name_value_list'][_0xe764('0x28')]['value']});}}function getEndUser(_0x5e65d1,_0x1d3cc2,_0x389488,_0x2a5c15){logger[_0xe764('0xb')](_0xe764('0x31'),_0x389488);return request({'form':{'method':_0xe764('0x32'),'input_type':_0xe764('0x22'),'response_type':_0xe764('0x22'),'rest_data':JSON[_0xe764('0x23')]({'session':_0x2a5c15['id'],'module_name':_0xe764('0x19'),'query':util[_0xe764('0x25')](_0xe764('0x33'),_0x389488),'order_by':'','offset':'0','select_fields':['id',_0xe764('0xd'),_0xe764('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x20f68c){if(_0x20f68c[_0xe764('0x2a')]['length']){var _0x5cb47c=_['find'](_0x20f68c[_0xe764('0x2a')],function(_0x6b23ac){return _0x6b23ac['name_value_list'][_0xe764('0x34')][_0xe764('0x2d')]===_0x389488;});if(_0x5cb47c){logger[_0xe764('0xb')](_0xe764('0x35'));return BPromise[_0xe764('0x2c')]({'id':_0x5cb47c[_0xe764('0x2e')]['id'][_0xe764('0x2d')],'name':_0x5cb47c[_0xe764('0x2e')]['name']['value'],'phone':_0x5cb47c[_0xe764('0x2e')][_0xe764('0x34')][_0xe764('0x2d')]});}}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xe764('0x21'),'input_type':_0xe764('0x22'),'response_type':_0xe764('0x22'),'rest_data':JSON[_0xe764('0x23')]({'session':_0x2a5c15['id'],'module_name':_0xe764('0x19'),'name_value_list':[{'name':_0xe764('0x36'),'value':_0x1d3cc2!==_0xe764('0x37')?_0x1d3cc2:util[_0xe764('0x25')](_0xe764('0x38'),_0x389488)},{'name':'phone_home','value':_0x389488}]})}})[_0xe764('0x29')](function(_0x14d67e){logger['info'](_0xe764('0x39'));return BPromise[_0xe764('0x2c')]({'id':_0x14d67e['id'],'name':_0x14d67e[_0xe764('0x2a')][_0xe764('0x36')][_0xe764('0x2d')],'phone':_0x14d67e['entry_list']['phone_home'][_0xe764('0x2d')]});});}});}function request(_0x29325e){logger[_0xe764('0x3a')](_0xe764('0x3b'),JSON[_0xe764('0x23')](_0x29325e));return rp(_['merge'](def,_0x29325e));}function getTags(_0x33e0ab,_0x3095f3){var _0x5d0a2d=[];if(_0x33e0ab&&_0x33e0ab['length']>0x0){_0x5d0a2d=_[_0xe764('0x3c')](_0x33e0ab,_0x3095f3);}return _0x5d0a2d;}function getCustomFields(_0x157cd9,_0x294b92){var _0x397134=[];var _0x5ac579={'custom_fields':[]};if(_0x157cd9[_0xe764('0x1c')]>0x0){_[_0xe764('0x1d')](_0x157cd9,function(_0x1f2a3b){if(_0x1f2a3b[_0xe764('0x3d')]===_0xe764('0x3e')&&_0x1f2a3b[_0xe764('0x3f')]&&!_0x1f2a3b[_0xe764('0x40')]){_0x5ac579[_0x1f2a3b['nameField'][_0xe764('0x41')]()]=_0x1f2a3b['content']['toString']();}else if(_0x1f2a3b[_0xe764('0x3d')]===_0xe764('0x3e')&&_0x1f2a3b[_0xe764('0x20')]&&_0x1f2a3b[_0xe764('0x40')]){_0x5ac579[_0xe764('0x42')]['push']({'id':_0x1f2a3b[_0xe764('0x20')],'value':_0x1f2a3b[_0xe764('0x43')][_0xe764('0x44')]()});}else if(_0x1f2a3b[_0xe764('0x3d')]===_0xe764('0x45')&&_0x1f2a3b[_0xe764('0x1e')]&&_0x1f2a3b['idField']&&_0x1f2a3b['customField']){_0x294b92[_0x1f2a3b[_0xe764('0x1e')]]&&_0x5ac579[_0xe764('0x42')][_0xe764('0x1f')]({'id':_0x1f2a3b[_0xe764('0x20')],'value':_0x294b92[_0x1f2a3b[_0xe764('0x1e')]]['toString']()});}else if(_0x1f2a3b[_0xe764('0x3d')]===_0xe764('0x46')&&_0x1f2a3b[_0xe764('0x47')]&&_0x1f2a3b[_0xe764('0x47')]['name']&&_0x1f2a3b['idField']&&_0x1f2a3b[_0xe764('0x40')]){_0x294b92[_0x1f2a3b['Variable']['name']['toLowerCase']()]&&_0x5ac579[_0xe764('0x42')]['push']({'id':_0x1f2a3b[_0xe764('0x20')],'value':_0x294b92[_0x1f2a3b[_0xe764('0x47')][_0xe764('0xd')][_0xe764('0x41')]()]['toString']()});}});}return _0x5ac579;}function getConnection(_0x490220){return request({'method':_0xe764('0x48'),'form':{'method':'login','input_type':_0xe764('0x22'),'response_type':_0xe764('0x22'),'rest_data':JSON[_0xe764('0x23')]({'user_auth':{'user_name':_0x490220['username'],'password':_0x490220['password'],'encryption':_0xe764('0x49')},'application':_0xe764('0x4a')})}})['then'](function(_0x47c391){var _0x2278fa=_0x47c391;if(_0x2278fa['id']){def['sessionID']=_0x2278fa['id'];return BPromise[_0xe764('0x2c')](_0x2278fa);}else{throw new Error(util[_0xe764('0x25')](_0xe764('0x4b'),_0x490220['id']));}});}function setRelationship(_0x4af158,_0xc174d2,_0x4ed87d,_0x565742){return request({'form':{'method':_0xe764('0x4c'),'input_type':_0xe764('0x22'),'response_type':_0xe764('0x22'),'rest_data':JSON[_0xe764('0x23')]({'session':_0x4af158['id'],'module_name':'Calls','module_id':_0x4ed87d['id'],'link_field_name':_0x565742,'related_ids':[_0xc174d2['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xe764('0x4d')]=function(_0x4ef1a4,_0x4339ee,_0x5d8dd5,_0x5d6e9a,_0x968d95,_0x5480e0){var _0x384a82,_0x4abcf5,_0x3bda31,_0x7d3e09;_0x5480e0['remoteUri']=intUtil['stripTrailingSlash'](_0x5480e0[_0xe764('0x4e')]);_0x5480e0[_0xe764('0x4f')]=intUtil[_0xe764('0x50')](_0x5480e0[_0xe764('0x4f')]);def[_0xe764('0x51')]=util['format'](_0xe764('0x52'),_0x5480e0['remoteUri']);if(_0x968d95&&_0x968d95[_0xe764('0x53')]){logger[_0xe764('0xb')](_0xe764('0x54'),'Recording\x20is\x20enabled!');_0x4339ee[_0xe764('0x55')]=util[_0xe764('0x25')](_0xe764('0x56'),_0x5480e0['serverUrl'],_0x4339ee[_0xe764('0x57')],md5(_0x4339ee[_0xe764('0x57')]));}else{_0x4339ee['recordingURL']='';}return getConnection(_0x5480e0)[_0xe764('0x29')](function(_0x275f10){_0x7d3e09=_0x275f10;return getUser(_0x5480e0,_0x5d6e9a[_0xe764('0xd')],_0x7d3e09);})['then'](function(_0x204eca){_0x384a82=_0x204eca;logger[_0xe764('0xb')](_0xe764('0x58'),_0x384a82['id']);return getEndUser(_0x5480e0,_0x4339ee[_0xe764('0x59')],_0x4339ee[_0xe764('0x5a')],_0x7d3e09);})['then'](function(_0x8e7f75){_0x4abcf5=_0x8e7f75;logger['info'](_0xe764('0x5b'),_0x4abcf5['id']);return getTicket(_0x5480e0,_0x384a82,_0x4abcf5,_0x5d8dd5,_0x4339ee,_0x5d8dd5[_0xe764('0x5c')],_0x7d3e09,_0xe764('0x5d'));})[_0xe764('0x29')](function(_0x10b173){_0x3bda31=_0x10b173;logger['info']('Ticket\x20created!');logger[_0xe764('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3bda31['id']);return setRelationship(_0x7d3e09,_0x384a82,_0x3bda31,_0xe764('0x5e'));})[_0xe764('0x29')](function(){return setRelationship(_0x7d3e09,_0x4abcf5,_0x3bda31,_0xe764('0x5f'));})[_0xe764('0x29')](function(){return getServerInfo(_0x7d3e09);})[_0xe764('0x29')](function(_0x5ba9a6){var _0x9f506d=parseInt(_0x5ba9a6['version'][_0xe764('0x60')](0x0));var _0x1033d7=util[_0xe764('0x25')](_0xe764('0x61'),_0x5480e0[_0xe764('0x4e')],_0x3bda31['id']);if(_0x9f506d>0x6){_0x1033d7=util['format'](_0xe764('0x62'),_0x5480e0['remoteUri'],_0x3bda31['id']);}logger['info'](_0xe764('0x54'),_0xe764('0x63'));emit(util[_0xe764('0x25')](_0xe764('0x64'),_0x5d6e9a[_0xe764('0xd')]),_0xe764('0x65'),{'uri':_0x1033d7});})[_0xe764('0x66')](function(_0x229912){logger['error'](_0xe764('0x54'),JSON['stringify'](_0x229912));});};exports[_0xe764('0x67')]=function(_0x14651d,_0x343483,_0x5cc02e,_0x48df2f,_0x293b47,_0x2b9442,_0x54377f){var _0x1b3c3e,_0x2391e0,_0x401e6e,_0xc478b5;_0x2b9442[_0xe764('0x4e')]=intUtil['stripTrailingSlash'](_0x2b9442['remoteUri']);_0x2b9442['serverUrl']=intUtil[_0xe764('0x50')](_0x2b9442[_0xe764('0x4f')]);def[_0xe764('0x51')]=util[_0xe764('0x25')]('%s/service/v4_1/rest.php',_0x2b9442[_0xe764('0x4e')]);if(_0x54377f&&_0x54377f[_0xe764('0x68')]&&_0x54377f[_0xe764('0x68')]!==_0xe764('0x69')){logger[_0xe764('0xb')](_0xe764('0x6a'),_0xe764('0x6b'));_0x343483[_0xe764('0x55')]=util[_0xe764('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b9442[_0xe764('0x4f')],_0x343483[_0xe764('0x57')],md5(_0x343483[_0xe764('0x57')]));}return getConnection(_0x2b9442)[_0xe764('0x29')](function(_0x335afc){_0xc478b5=_0x335afc;return getUser(_0x2b9442,_0x48df2f['name'],_0xc478b5);})[_0xe764('0x29')](function(_0x5c6a95){_0x1b3c3e=_0x5c6a95;logger[_0xe764('0xb')](_0xe764('0x58'),_0x1b3c3e['id']);return getEndUser(_0x2b9442,_0x343483[_0xe764('0x6c')],_0x343483[_0xe764('0x6d')],_0xc478b5);})[_0xe764('0x29')](function(_0x5922c5){_0x2391e0=_0x5922c5;logger[_0xe764('0xb')](_0xe764('0x5b'),_0x2391e0['id']);return getTicket(_0x2b9442,_0x1b3c3e,_0x2391e0,_0x5cc02e,_0x343483,_0x5cc02e['Fields'],_0xc478b5,'Outbound');})['then'](function(_0x402027){_0x401e6e=_0x402027;logger[_0xe764('0xb')](_0xe764('0x6e'));logger[_0xe764('0xb')](_0xe764('0x6f'),_0x401e6e['id']);return setRelationship(_0xc478b5,_0x1b3c3e,_0x401e6e,_0xe764('0x5e'));})[_0xe764('0x29')](function(){return setRelationship(_0xc478b5,_0x2391e0,_0x401e6e,_0xe764('0x5f'));})[_0xe764('0x29')](function(){return getServerInfo(_0xc478b5);})[_0xe764('0x29')](function(_0xfa5889){var _0x4a8776=parseInt(_0xfa5889['version'][_0xe764('0x60')](0x0));var _0x2478cc=util[_0xe764('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2b9442['remoteUri'],_0x401e6e['id']);if(_0x4a8776>0x6){_0x2478cc=util[_0xe764('0x25')](_0xe764('0x62'),_0x2b9442['remoteUri'],_0x401e6e['id']);}logger[_0xe764('0xb')](_0xe764('0x6a'),_0xe764('0x63'));emit(util['format'](_0xe764('0x64'),_0x48df2f[_0xe764('0xd')]),_0xe764('0x65'),{'uri':_0x2478cc});})[_0xe764('0x66')](function(_0xf5b86){logger['error'](_0xe764('0x6a'),JSON[_0xe764('0x23')](_0xf5b86));});};exports[_0xe764('0x70')]=function(_0x554849,_0x385b6e,_0x3d0435,_0x3808ac,_0x17035b,_0xf485c0){var _0x59c250,_0x44c589,_0x1fd4cb,_0x2b5b0d;_0xf485c0['remoteUri']=intUtil['stripTrailingSlash'](_0xf485c0[_0xe764('0x4e')]);_0xf485c0[_0xe764('0x4f')]=intUtil['stripTrailingSlash'](_0xf485c0[_0xe764('0x4f')]);def[_0xe764('0x51')]=util[_0xe764('0x25')](_0xe764('0x52'),_0xf485c0[_0xe764('0x4e')]);if(_0x17035b&&_0x17035b[_0xe764('0x53')]){logger[_0xe764('0xb')]('['+_0x385b6e[_0xe764('0x71')][_0xe764('0x72')]()+']',_0xe764('0x6b'));_0x385b6e['recordingURL']=util[_0xe764('0x25')](_0xe764('0x56'),_0xf485c0[_0xe764('0x4f')],_0x385b6e['uniqueid'],md5(_0x385b6e[_0xe764('0x57')]));}else{_0x385b6e[_0xe764('0x55')]='';}return getConnection(_0xf485c0)[_0xe764('0x29')](function(_0x268946){_0x2b5b0d=_0x268946;if(!_[_0xe764('0x26')](_0x3808ac)){return getUser(_0xf485c0,_0x3808ac['name'],_0x2b5b0d);}else{return getUser(_0xf485c0,null,_0x2b5b0d);}})[_0xe764('0x29')](function(_0x247f1f){_0x59c250=_0x247f1f;logger[_0xe764('0xb')](_0xe764('0x58'),_0x59c250['id']);return getEndUser(_0xf485c0,_0x385b6e[_0xe764('0x59')],_0x385b6e[_0xe764('0x5a')],_0x2b5b0d);})['then'](function(_0xf52d50){_0x44c589=_0xf52d50;logger[_0xe764('0xb')](_0xe764('0x5b'),_0x44c589['id']);return getTicket(_0xf485c0,_0x59c250,_0x44c589,_0x3d0435,_0x385b6e,_0x3d0435[_0xe764('0x5c')],_0x2b5b0d,'Inbound');})['then'](function(_0x3e605a){_0x1fd4cb=_0x3e605a;logger[_0xe764('0xb')](_0xe764('0x6e'));logger[_0xe764('0xb')](_0xe764('0x6f'),_0x1fd4cb['id']);return setRelationship(_0x2b5b0d,_0x59c250,_0x1fd4cb,_0xe764('0x5e'));})['then'](function(){return setRelationship(_0x2b5b0d,_0x44c589,_0x1fd4cb,'contacts');})['then'](function(){return getServerInfo(_0x2b5b0d);})[_0xe764('0x66')](function(_0x52eeb0){logger[_0xe764('0x73')]('['+_0x385b6e[_0xe764('0x71')][_0xe764('0x72')]()+']',JSON['stringify'](_0x52eeb0));});}; \ No newline at end of file +var _0x2c2d=['date_start','toISOString','slice','duration_hours','duration_minutes','parent_type','parent_name','direction','length','forEach','variableName','idField','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','Caller\x20-\x20%s','Enduser\x20created.','merge','map','type','string','nameField','toLowerCase','content','customField','custom_fields','push','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','contacts','charAt','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','[OUTBOUND]','unmanaged','lastevent','toUpperCase','isNil','Inbound','users','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by'];(function(_0x2a217b,_0xb039df){var _0x29a6ac=function(_0x36071f){while(--_0x36071f){_0x2a217b['push'](_0x2a217b['shift']());}};_0x29a6ac(++_0xb039df);}(_0x2c2d,0x1db));var _0xd2c2=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x2c2d[_0xef8146];return _0x5a6cb0;};'use strict';var _=require('lodash');var rp=require(_0xd2c2('0x0'));var BPromise=require(_0xd2c2('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xd2c2('0x2'));var intUtil=require(_0xd2c2('0x3'));var config=require(_0xd2c2('0x4'));var logger=require(_0xd2c2('0x5'))(_0xd2c2('0x6'));config['redis']=_[_0xd2c2('0x7')](config['redis'],{'host':_0xd2c2('0x8'),'port':0x18eb});var io=require(_0xd2c2('0x9'))(new Redis(config['redis']));var def={'method':'POST','json':!![]};function emit(_0x52b282,_0x270430,_0x1b0895){io['to'](_0x52b282)['emit'](_0x270430,_0x1b0895);}function getTicket(_0x1e2a45,_0x4ad4ad,_0x8069d9,_0x2ce0f0,_0x1dadb2,_0x572e62,_0x18ce5d,_0x40b37d){logger[_0xd2c2('0xa')](_0xd2c2('0xb'));var _0x4ced5a=new Date();var _0x51dc65=[{'name':_0xd2c2('0xc'),'value':intUtil[_0xd2c2('0xd')](_0x2ce0f0[_0xd2c2('0xe')],_0x1dadb2,'\x20')},{'name':_0xd2c2('0xf'),'value':_0x4ad4ad['id']},{'name':_0xd2c2('0x10'),'value':_0x4ad4ad['id']},{'name':'description','value':intUtil['getString'](_0x2ce0f0['Descriptions'],_0x1dadb2,'\x0a')},{'name':_0xd2c2('0x11'),'value':_0x4ced5a[_0xd2c2('0x12')]()[_0xd2c2('0x13')](0x0,0x13)['replace']('T','\x20')},{'name':_0xd2c2('0x14'),'value':'0'},{'name':_0xd2c2('0x15'),'value':'15'},{'name':'parent_id','value':_0x8069d9['id']},{'name':_0xd2c2('0x16'),'value':'Contacts'},{'name':_0xd2c2('0x17'),'value':_0x8069d9[_0xd2c2('0xc')]},{'name':_0xd2c2('0x18'),'value':_0x40b37d}];if(_0x572e62[_0xd2c2('0x19')]){_[_0xd2c2('0x1a')](_0x572e62,function(_0x9dbb23){if(_0x1dadb2[_0x9dbb23[_0xd2c2('0x1b')]]){_0x51dc65['push']({'name':_0x9dbb23[_0xd2c2('0x1c')],'value':_0x1dadb2[_0x9dbb23[_0xd2c2('0x1b')]]});}});}return request({'form':{'method':_0xd2c2('0x1d'),'input_type':'JSON','response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'session':_0x18ce5d['id'],'module_name':_0xd2c2('0x20'),'name_value_list':_0x51dc65})}});}function getAuth(_0x4b4ec4){return util['format']('Basic\x20%s',new Buffer(_0x4b4ec4[_0xd2c2('0x21')]+':X')[_0xd2c2('0x22')](_0xd2c2('0x23')));}function getServerInfo(_0x41f67d){return request({'form':{'method':_0xd2c2('0x24'),'input_type':'JSON','response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'session':_0x41f67d['id']})}});}function getUser(_0x3eeb90,_0xcddc47,_0x4423fb){if(!_['isNil'](_0xcddc47)){logger[_0xd2c2('0xa')](_0xd2c2('0x25'),_0xcddc47);return request({'form':{'method':'get_entry_list','input_type':_0xd2c2('0x1e'),'response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'session':_0x4423fb['id'],'module_name':_0xd2c2('0x26'),'query':util[_0xd2c2('0x27')](_0xd2c2('0x28'),_0xcddc47),'order_by':'','offset':'0','select_fields':['id','name',_0xd2c2('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x39f49e){if(_0x39f49e[_0xd2c2('0x2a')][_0xd2c2('0x19')]){var _0x59e375=_['find'](_0x39f49e[_0xd2c2('0x2a')],function(_0x31f16c){return _0x31f16c['name_value_list']['user_name'][_0xd2c2('0x2b')]===_0xcddc47;});if(_0x59e375){logger[_0xd2c2('0xa')](_0xd2c2('0x2c'));return BPromise[_0xd2c2('0x2d')]({'id':_0x59e375['name_value_list']['id'][_0xd2c2('0x2b')],'name':_0x59e375[_0xd2c2('0x2e')][_0xd2c2('0xc')][_0xd2c2('0x2b')]});}}logger[_0xd2c2('0xa')](_0xd2c2('0x2f'));return BPromise['resolve']({'id':_0x4423fb[_0xd2c2('0x2e')]['user_id'][_0xd2c2('0x2b')],'name':_0x4423fb[_0xd2c2('0x2e')][_0xd2c2('0x29')][_0xd2c2('0x2b')]});});}else{logger['info'](_0xd2c2('0x30'));return BPromise[_0xd2c2('0x2d')]({'id':_0x4423fb[_0xd2c2('0x2e')][_0xd2c2('0x31')][_0xd2c2('0x2b')],'name':_0x4423fb['name_value_list'][_0xd2c2('0x29')][_0xd2c2('0x2b')]});}}function getEndUser(_0x4f5bd5,_0x4a637f,_0x2e34f4,_0x1e7b12){logger[_0xd2c2('0xa')]('Searching\x20enduser\x20with\x20phone',_0x2e34f4);return request({'form':{'method':_0xd2c2('0x32'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x1e7b12['id'],'module_name':'Contacts','query':util[_0xd2c2('0x27')](_0xd2c2('0x33'),_0x2e34f4),'order_by':'','offset':'0','select_fields':['id',_0xd2c2('0xc'),_0xd2c2('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xd2c2('0x35')](function(_0x540498){if(_0x540498['entry_list'][_0xd2c2('0x19')]){var _0x5ab6b0=_[_0xd2c2('0x36')](_0x540498[_0xd2c2('0x2a')],function(_0x19a0f8){return _0x19a0f8[_0xd2c2('0x2e')][_0xd2c2('0x34')][_0xd2c2('0x2b')]===_0x2e34f4;});if(_0x5ab6b0){logger[_0xd2c2('0xa')](_0xd2c2('0x37'));return BPromise['resolve']({'id':_0x5ab6b0['name_value_list']['id'][_0xd2c2('0x2b')],'name':_0x5ab6b0['name_value_list'][_0xd2c2('0xc')]['value'],'phone':_0x5ab6b0[_0xd2c2('0x2e')][_0xd2c2('0x34')][_0xd2c2('0x2b')]});}}else{logger[_0xd2c2('0xa')](_0xd2c2('0x38'));return request({'form':{'method':_0xd2c2('0x1d'),'input_type':_0xd2c2('0x1e'),'response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'session':_0x1e7b12['id'],'module_name':_0xd2c2('0x39'),'name_value_list':[{'name':_0xd2c2('0x3a'),'value':_0x4a637f!==''?_0x4a637f:util[_0xd2c2('0x27')](_0xd2c2('0x3b'),_0x2e34f4)},{'name':'phone_home','value':_0x2e34f4}]})}})['then'](function(_0x3c1b90){logger[_0xd2c2('0xa')](_0xd2c2('0x3c'));return BPromise[_0xd2c2('0x2d')]({'id':_0x3c1b90['id'],'name':_0x3c1b90[_0xd2c2('0x2a')][_0xd2c2('0x3a')][_0xd2c2('0x2b')],'phone':_0x3c1b90[_0xd2c2('0x2a')][_0xd2c2('0x34')][_0xd2c2('0x2b')]});});}});}function request(_0x3aa81d){logger['debug']('[HTTP]',JSON['stringify'](_0x3aa81d));return rp(_[_0xd2c2('0x3d')](def,_0x3aa81d));}function getTags(_0x9c28e3,_0x47872f){var _0x1774fa=[];if(_0x9c28e3&&_0x9c28e3[_0xd2c2('0x19')]>0x0){_0x1774fa=_[_0xd2c2('0x3e')](_0x9c28e3,_0x47872f);}return _0x1774fa;}function getCustomFields(_0x4748e1,_0x3cbc6f){var _0x3f741a=[];var _0x1ca4ff={'custom_fields':[]};if(_0x4748e1[_0xd2c2('0x19')]>0x0){_[_0xd2c2('0x1a')](_0x4748e1,function(_0x3c17aa){if(_0x3c17aa[_0xd2c2('0x3f')]===_0xd2c2('0x40')&&_0x3c17aa[_0xd2c2('0x41')]&&!_0x3c17aa['customField']){_0x1ca4ff[_0x3c17aa['nameField'][_0xd2c2('0x42')]()]=_0x3c17aa[_0xd2c2('0x43')][_0xd2c2('0x22')]();}else if(_0x3c17aa['type']===_0xd2c2('0x40')&&_0x3c17aa[_0xd2c2('0x1c')]&&_0x3c17aa[_0xd2c2('0x44')]){_0x1ca4ff[_0xd2c2('0x45')][_0xd2c2('0x46')]({'id':_0x3c17aa['idField'],'value':_0x3c17aa['content'][_0xd2c2('0x22')]()});}else if(_0x3c17aa[_0xd2c2('0x3f')]===_0xd2c2('0x47')&&_0x3c17aa['variableName']&&_0x3c17aa[_0xd2c2('0x1c')]&&_0x3c17aa[_0xd2c2('0x44')]){_0x3cbc6f[_0x3c17aa[_0xd2c2('0x1b')]]&&_0x1ca4ff[_0xd2c2('0x45')][_0xd2c2('0x46')]({'id':_0x3c17aa[_0xd2c2('0x1c')],'value':_0x3cbc6f[_0x3c17aa[_0xd2c2('0x1b')]][_0xd2c2('0x22')]()});}else if(_0x3c17aa[_0xd2c2('0x3f')]===_0xd2c2('0x48')&&_0x3c17aa['Variable']&&_0x3c17aa[_0xd2c2('0x49')][_0xd2c2('0xc')]&&_0x3c17aa[_0xd2c2('0x1c')]&&_0x3c17aa[_0xd2c2('0x44')]){_0x3cbc6f[_0x3c17aa[_0xd2c2('0x49')][_0xd2c2('0xc')][_0xd2c2('0x42')]()]&&_0x1ca4ff[_0xd2c2('0x45')]['push']({'id':_0x3c17aa['idField'],'value':_0x3cbc6f[_0x3c17aa[_0xd2c2('0x49')][_0xd2c2('0xc')]['toLowerCase']()]['toString']()});}});}return _0x1ca4ff;}function getConnection(_0x19fa1c){return request({'method':'POST','form':{'method':_0xd2c2('0x4a'),'input_type':_0xd2c2('0x1e'),'response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'user_auth':{'user_name':_0x19fa1c[_0xd2c2('0x4b')],'password':_0x19fa1c['password'],'encryption':_0xd2c2('0x4c')},'application':_0xd2c2('0x4d')})}})[_0xd2c2('0x35')](function(_0x1a107c){var _0x580fab=_0x1a107c;if(_0x580fab['id']){def[_0xd2c2('0x4e')]=_0x580fab['id'];return BPromise[_0xd2c2('0x2d')](_0x580fab);}else{throw new Error(util['format'](_0xd2c2('0x4f'),_0x19fa1c['id']));}});}function setRelationship(_0x4664b4,_0x1d0c61,_0xb04976,_0x1fadc5){return request({'form':{'method':_0xd2c2('0x50'),'input_type':_0xd2c2('0x1e'),'response_type':_0xd2c2('0x1e'),'rest_data':JSON[_0xd2c2('0x1f')]({'session':_0x4664b4['id'],'module_name':_0xd2c2('0x20'),'module_id':_0xb04976['id'],'link_field_name':_0x1fadc5,'related_ids':[_0x1d0c61['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xd2c2('0x51')]=function(_0x76dd0c,_0x1542c5,_0x676b4a,_0x1a4583,_0x27efaf,_0x1e9e99){var _0x4dc9d4,_0x82f276,_0x5b76fd,_0x178238;_0x1e9e99['remoteUri']=intUtil[_0xd2c2('0x52')](_0x1e9e99[_0xd2c2('0x53')]);_0x1e9e99[_0xd2c2('0x54')]=intUtil['stripTrailingSlash'](_0x1e9e99[_0xd2c2('0x54')]);def[_0xd2c2('0x55')]=util[_0xd2c2('0x27')]('%s/service/v4_1/rest.php',_0x1e9e99['remoteUri']);if(_0x27efaf&&_0x27efaf[_0xd2c2('0x56')]){logger['info'](_0xd2c2('0x57'),_0xd2c2('0x58'));_0x1542c5['recordingURL']=util[_0xd2c2('0x27')](_0xd2c2('0x59'),_0x1e9e99[_0xd2c2('0x54')],_0x1542c5[_0xd2c2('0x5a')],md5(_0x1542c5['uniqueid']));}else{_0x1542c5[_0xd2c2('0x5b')]='';}return getConnection(_0x1e9e99)['then'](function(_0x574356){_0x178238=_0x574356;return getUser(_0x1e9e99,_0x1a4583[_0xd2c2('0xc')],_0x178238);})[_0xd2c2('0x35')](function(_0x4d0b63){_0x4dc9d4=_0x4d0b63;logger['info'](_0xd2c2('0x5c'),_0x4dc9d4['id']);return getEndUser(_0x1e9e99,_0x1542c5[_0xd2c2('0x5d')],_0x1542c5[_0xd2c2('0x5e')],_0x178238);})['then'](function(_0x20d394){_0x82f276=_0x20d394;logger['info']('The\x20Enduser\x20ID\x20is:',_0x82f276['id']);return getTicket(_0x1e9e99,_0x4dc9d4,_0x82f276,_0x676b4a,_0x1542c5,_0x676b4a[_0xd2c2('0x5f')],_0x178238,'Inbound');})[_0xd2c2('0x35')](function(_0x37fa45){_0x5b76fd=_0x37fa45;logger['info'](_0xd2c2('0x60'));logger[_0xd2c2('0xa')](_0xd2c2('0x61'),_0x5b76fd['id']);return setRelationship(_0x178238,_0x4dc9d4,_0x5b76fd,'users');})[_0xd2c2('0x35')](function(){return setRelationship(_0x178238,_0x82f276,_0x5b76fd,'contacts');})['then'](function(){return getServerInfo(_0x178238);})[_0xd2c2('0x35')](function(_0x552bec){var _0x5911e1=parseInt(_0x552bec[_0xd2c2('0x62')]['charAt'](0x0));var _0x10c621=util['format'](_0xd2c2('0x63'),_0x1e9e99['remoteUri'],_0x5b76fd['id']);if(_0x5911e1>0x6){_0x10c621=util[_0xd2c2('0x27')](_0xd2c2('0x64'),_0x1e9e99[_0xd2c2('0x53')],_0x5b76fd['id']);}logger[_0xd2c2('0xa')](_0xd2c2('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd2c2('0x27')]('user:%s',_0x1a4583[_0xd2c2('0xc')]),_0xd2c2('0x65'),{'uri':_0x10c621});})['catch'](function(_0x46e5d5){logger[_0xd2c2('0x66')](_0xd2c2('0x57'),JSON[_0xd2c2('0x1f')](_0x46e5d5));});};exports[_0xd2c2('0x67')]=function(_0x38bd1a,_0x2a4c01,_0xdc43a5,_0x22ac8b,_0x83cbbf,_0x267f89,_0x205cb6){var _0x8eb72e,_0x395b6c,_0x504f6c,_0x5079b7;_0x267f89[_0xd2c2('0x53')]=intUtil[_0xd2c2('0x52')](_0x267f89[_0xd2c2('0x53')]);_0x267f89['serverUrl']=intUtil[_0xd2c2('0x52')](_0x267f89[_0xd2c2('0x54')]);def[_0xd2c2('0x55')]=util['format'](_0xd2c2('0x68'),_0x267f89[_0xd2c2('0x53')]);if(_0x205cb6&&_0x205cb6[_0xd2c2('0x69')]&&_0x205cb6[_0xd2c2('0x69')]!==_0xd2c2('0x6a')){logger[_0xd2c2('0xa')]('[OUTBOUND]',_0xd2c2('0x58'));_0x2a4c01[_0xd2c2('0x5b')]=util[_0xd2c2('0x27')](_0xd2c2('0x59'),_0x267f89[_0xd2c2('0x54')],_0x2a4c01[_0xd2c2('0x5a')],md5(_0x2a4c01[_0xd2c2('0x5a')]));}return getConnection(_0x267f89)[_0xd2c2('0x35')](function(_0x12c8d5){_0x5079b7=_0x12c8d5;return getUser(_0x267f89,_0x22ac8b[_0xd2c2('0xc')],_0x5079b7);})[_0xd2c2('0x35')](function(_0x4e55e8){_0x8eb72e=_0x4e55e8;logger[_0xd2c2('0xa')]('The\x20User\x20ID\x20is:',_0x8eb72e['id']);return getEndUser(_0x267f89,_0x2a4c01[_0xd2c2('0x6b')],_0x2a4c01[_0xd2c2('0x6c')],_0x5079b7);})[_0xd2c2('0x35')](function(_0x588d5b){_0x395b6c=_0x588d5b;logger[_0xd2c2('0xa')](_0xd2c2('0x6d'),_0x395b6c['id']);return getTicket(_0x267f89,_0x8eb72e,_0x395b6c,_0xdc43a5,_0x2a4c01,_0xdc43a5[_0xd2c2('0x5f')],_0x5079b7,_0xd2c2('0x6e'));})[_0xd2c2('0x35')](function(_0xf95dcb){_0x504f6c=_0xf95dcb;logger['info'](_0xd2c2('0x60'));logger[_0xd2c2('0xa')](_0xd2c2('0x61'),_0x504f6c['id']);return setRelationship(_0x5079b7,_0x8eb72e,_0x504f6c,'users');})[_0xd2c2('0x35')](function(){return setRelationship(_0x5079b7,_0x395b6c,_0x504f6c,_0xd2c2('0x6f'));})[_0xd2c2('0x35')](function(){return getServerInfo(_0x5079b7);})['then'](function(_0x1116c3){var _0x4ade6e=parseInt(_0x1116c3[_0xd2c2('0x62')][_0xd2c2('0x70')](0x0));var _0x292499=util[_0xd2c2('0x27')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x267f89[_0xd2c2('0x53')],_0x504f6c['id']);if(_0x4ade6e>0x6){_0x292499=util[_0xd2c2('0x27')](_0xd2c2('0x64'),_0x267f89[_0xd2c2('0x53')],_0x504f6c['id']);}logger[_0xd2c2('0xa')]('[OUTBOUND]',_0xd2c2('0x71'));emit(util[_0xd2c2('0x27')](_0xd2c2('0x72'),_0x22ac8b[_0xd2c2('0xc')]),_0xd2c2('0x65'),{'uri':_0x292499});})[_0xd2c2('0x73')](function(_0x5d6221){logger['error'](_0xd2c2('0x74'),JSON[_0xd2c2('0x1f')](_0x5d6221));});};exports[_0xd2c2('0x75')]=function(_0x18f599,_0x51d931,_0x47a3f1,_0x9c3dcd,_0xdb2e07,_0x578ec8){var _0x137c90,_0x1d8402,_0x142f99,_0x439194;_0x578ec8[_0xd2c2('0x53')]=intUtil[_0xd2c2('0x52')](_0x578ec8[_0xd2c2('0x53')]);_0x578ec8[_0xd2c2('0x54')]=intUtil[_0xd2c2('0x52')](_0x578ec8[_0xd2c2('0x54')]);def[_0xd2c2('0x55')]=util[_0xd2c2('0x27')](_0xd2c2('0x68'),_0x578ec8[_0xd2c2('0x53')]);if(_0xdb2e07&&_0xdb2e07[_0xd2c2('0x56')]){logger[_0xd2c2('0xa')]('['+_0x51d931[_0xd2c2('0x76')][_0xd2c2('0x77')]()+']',_0xd2c2('0x58'));_0x51d931[_0xd2c2('0x5b')]=util[_0xd2c2('0x27')](_0xd2c2('0x59'),_0x578ec8[_0xd2c2('0x54')],_0x51d931['uniqueid'],md5(_0x51d931[_0xd2c2('0x5a')]));}else{_0x51d931['recordingURL']='';}return getConnection(_0x578ec8)[_0xd2c2('0x35')](function(_0x19c6c9){_0x439194=_0x19c6c9;if(!_[_0xd2c2('0x78')](_0x9c3dcd)){return getUser(_0x578ec8,_0x9c3dcd[_0xd2c2('0xc')],_0x439194);}else{return getUser(_0x578ec8,null,_0x439194);}})['then'](function(_0x3de8a3){_0x137c90=_0x3de8a3;logger[_0xd2c2('0xa')]('The\x20User\x20ID\x20is:',_0x137c90['id']);return getEndUser(_0x578ec8,_0x51d931['calleridname'],_0x51d931[_0xd2c2('0x5e')],_0x439194);})[_0xd2c2('0x35')](function(_0x287b7a){_0x1d8402=_0x287b7a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x1d8402['id']);return getTicket(_0x578ec8,_0x137c90,_0x1d8402,_0x47a3f1,_0x51d931,_0x47a3f1[_0xd2c2('0x5f')],_0x439194,_0xd2c2('0x79'));})[_0xd2c2('0x35')](function(_0x287cf7){_0x142f99=_0x287cf7;logger[_0xd2c2('0xa')]('Ticket\x20created!');logger[_0xd2c2('0xa')](_0xd2c2('0x61'),_0x142f99['id']);return setRelationship(_0x439194,_0x137c90,_0x142f99,_0xd2c2('0x7a'));})[_0xd2c2('0x35')](function(){return setRelationship(_0x439194,_0x1d8402,_0x142f99,_0xd2c2('0x6f'));})['then'](function(){return getServerInfo(_0x439194);})[_0xd2c2('0x73')](function(_0x1a4b59){logger[_0xd2c2('0x66')]('['+_0x51d931[_0xd2c2('0x76')][_0xd2c2('0x77')]()+']',JSON[_0xd2c2('0x1f')](_0x1a4b59));});}; \ 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 b8d6237..7fc48ce 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 _0x4265=['push','customVariable','Variable','name','toLowerCase','toString','keyType','key','format','keyContent','%s:\x20%s','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','type','string','content','variable','variableName'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x4265,0x7e));var _0x5426=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x4265[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x5426('0x0'));var util=require(_0x5426('0x1'));exports[_0x5426('0x2')]=function(_0x5cf512,_0xd1632,_0x394562){var _0x44ecdd=[];if(_0x5cf512[_0x5426('0x3')]>0x0){var _0x46e7d4=_['sortBy'](_0x5cf512,['id']);for(var _0x3dd7c0=0x0;_0x3dd7c0<_0x46e7d4['length'];_0x3dd7c0++){var _0x28df09=_0x46e7d4[_0x3dd7c0];if(_0x28df09[_0x5426('0x4')]===_0x5426('0x5')){_0x44ecdd['push'](_0x28df09[_0x5426('0x6')]);}else if(_0x28df09[_0x5426('0x4')]===_0x5426('0x7')&&_0x28df09['variableName']){_0xd1632[_0x28df09[_0x5426('0x8')]]&&_0x44ecdd[_0x5426('0x9')](_0xd1632[_0x28df09[_0x5426('0x8')]]['toString']());}else if(_0x28df09['type']===_0x5426('0xa')&&_0x28df09[_0x5426('0xb')]&&_0x28df09[_0x5426('0xb')][_0x5426('0xc')]){_0xd1632[_0x28df09[_0x5426('0xb')]['name'][_0x5426('0xd')]()]&&_0x44ecdd[_0x5426('0x9')](_0xd1632[_0x28df09[_0x5426('0xb')][_0x5426('0xc')][_0x5426('0xd')]()][_0x5426('0xe')]());}else if(_0x28df09[_0x5426('0x4')]==='keyValue'){if(_0x28df09[_0x5426('0xf')]==='string'&&_0x28df09[_0x5426('0x10')]){_0x44ecdd[_0x5426('0x9')](util[_0x5426('0x11')]('%s:\x20%s',_0x28df09['key'],_0x28df09[_0x5426('0x12')]));}else if(_0x28df09[_0x5426('0xf')]==='variable'&&_0x28df09['variableName']&&_0x28df09[_0x5426('0x10')]){_0xd1632[_0x28df09[_0x5426('0x8')]]&&_0x44ecdd['push'](util['format'](_0x5426('0x13'),_0x28df09[_0x5426('0x10')],_0xd1632[_0x28df09[_0x5426('0x8')]]));}else if(_0x28df09[_0x5426('0xf')]==='customVariable'&&_0x28df09['Variable']&&_0x28df09[_0x5426('0xb')][_0x5426('0xc')]&&_0x28df09[_0x5426('0x10')]){_0xd1632[_0x28df09[_0x5426('0xb')][_0x5426('0xc')][_0x5426('0xd')]()]&&_0x44ecdd['push'](util['format'](_0x5426('0x13'),_0x28df09[_0x5426('0x10')],_0xd1632[_0x28df09[_0x5426('0xb')]['name'][_0x5426('0xd')]()]));}}}}return _0x44ecdd['join'](_0x394562);};exports[_0x5426('0x14')]=function(_0x2ec537){var _0x56e124=_0x2ec537[_0x5426('0x15')](-0x1);if(_0x56e124==='/'){_0x2ec537=_0x2ec537[_0x5426('0x16')](0x0,_0x2ec537[_0x5426('0x17')](_0x56e124));}return _0x2ec537;};exports[_0x5426('0x18')]=function(_0x1417fb){if(!_[_0x5426('0x19')](_0x1417fb)&&_0x1417fb!==''){var _0x572825=/^(([^<>()\[\]\\.,;:\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 _0x572825[_0x5426('0x1a')](String(_0x1417fb)[_0x5426('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x9a23=['lastIndexOf','validateEmail','isNil','lodash','util','getString','length','type','push','content','variableName','toString','customVariable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','Variable','join','stripTrailingSlash','slice'];(function(_0x227a49,_0x57b7a6){var _0x1cd5e0=function(_0x157a06){while(--_0x157a06){_0x227a49['push'](_0x227a49['shift']());}};_0x1cd5e0(++_0x57b7a6);}(_0x9a23,0x155));var _0x39a2=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x9a23[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x39a2('0x0'));var util=require(_0x39a2('0x1'));exports[_0x39a2('0x2')]=function(_0x2a62bc,_0x5caa5a,_0x4a8a81){var _0x844ef=[];if(_0x2a62bc[_0x39a2('0x3')]>0x0){var _0x4a89d4=_['sortBy'](_0x2a62bc,['id']);for(var _0x270112=0x0;_0x270112<_0x4a89d4['length'];_0x270112++){var _0x5e8c46=_0x4a89d4[_0x270112];if(_0x5e8c46[_0x39a2('0x4')]==='string'){_0x844ef[_0x39a2('0x5')](_0x5e8c46[_0x39a2('0x6')]);}else if(_0x5e8c46[_0x39a2('0x4')]==='variable'&&_0x5e8c46[_0x39a2('0x7')]){_0x5caa5a[_0x5e8c46[_0x39a2('0x7')]]&&_0x844ef[_0x39a2('0x5')](_0x5caa5a[_0x5e8c46[_0x39a2('0x7')]][_0x39a2('0x8')]());}else if(_0x5e8c46[_0x39a2('0x4')]===_0x39a2('0x9')&&_0x5e8c46['Variable']&&_0x5e8c46['Variable'][_0x39a2('0xa')]){_0x5caa5a[_0x5e8c46['Variable'][_0x39a2('0xa')][_0x39a2('0xb')]()]&&_0x844ef[_0x39a2('0x5')](_0x5caa5a[_0x5e8c46['Variable']['name'][_0x39a2('0xb')]()][_0x39a2('0x8')]());}else if(_0x5e8c46[_0x39a2('0x4')]===_0x39a2('0xc')){if(_0x5e8c46[_0x39a2('0xd')]===_0x39a2('0xe')&&_0x5e8c46[_0x39a2('0xf')]){_0x844ef['push'](util[_0x39a2('0x10')](_0x39a2('0x11'),_0x5e8c46[_0x39a2('0xf')],_0x5e8c46[_0x39a2('0x12')]));}else if(_0x5e8c46[_0x39a2('0xd')]==='variable'&&_0x5e8c46[_0x39a2('0x7')]&&_0x5e8c46[_0x39a2('0xf')]){_0x5caa5a[_0x5e8c46[_0x39a2('0x7')]]&&_0x844ef[_0x39a2('0x5')](util['format'](_0x39a2('0x11'),_0x5e8c46[_0x39a2('0xf')],_0x5caa5a[_0x5e8c46[_0x39a2('0x7')]]));}else if(_0x5e8c46[_0x39a2('0xd')]===_0x39a2('0x9')&&_0x5e8c46[_0x39a2('0x13')]&&_0x5e8c46['Variable'][_0x39a2('0xa')]&&_0x5e8c46[_0x39a2('0xf')]){_0x5caa5a[_0x5e8c46[_0x39a2('0x13')][_0x39a2('0xa')][_0x39a2('0xb')]()]&&_0x844ef[_0x39a2('0x5')](util['format']('%s:\x20%s',_0x5e8c46[_0x39a2('0xf')],_0x5caa5a[_0x5e8c46[_0x39a2('0x13')][_0x39a2('0xa')][_0x39a2('0xb')]()]));}}}}return _0x844ef[_0x39a2('0x14')](_0x4a8a81);};exports[_0x39a2('0x15')]=function(_0x110981){var _0x168df6=_0x110981[_0x39a2('0x16')](-0x1);if(_0x168df6==='/'){_0x110981=_0x110981['substring'](0x0,_0x110981[_0x39a2('0x17')](_0x168df6));}return _0x110981;};exports[_0x39a2('0x18')]=function(_0xca1bd5){if(!_[_0x39a2('0x19')](_0xca1bd5)&&_0xca1bd5!==''){var _0x55c2c2=/^(([^<>()\[\]\\.,;:\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 _0x55c2c2['test'](String(_0xca1bd5)[_0x39a2('0xb')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index d659572..e01478d 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x585112,_0x4fc4de){var _0xb0407e=function(_0x2bd757){while(--_0x2bd757){_0x585112['push'](_0x585112['shift']());}};_0xb0407e(++_0x4fc4de);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0xa4a725,_0x1fc2eb){var _0x5f0ed4=function(_0x280f89){while(--_0x280f89){_0xa4a725['push'](_0xa4a725['shift']());}};_0x5f0ed4(++_0x1fc2eb);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'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 30d24d3..cafecdc 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 _0xe78b=['%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','newTab','toUpperCase','calleridname','lastevent','lodash','request-promise','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','%s/tickets.json','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','stringify','GET','map','forEach','includes','string','nameField','customField','content','picklist','type','custom_fields','push','idField','variable','variableName','customVariable','Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url'];(function(_0x548ddf,_0x422aa5){var _0x967a8a=function(_0x120ede){while(--_0x120ede){_0x548ddf['push'](_0x548ddf['shift']());}};_0x967a8a(++_0x422aa5);}(_0xe78b,0x7e));var _0xbe78=function(_0x46e182,_0x1046a8){_0x46e182=_0x46e182-0x0;var _0x42ade0=_0xe78b[_0x46e182];return _0x42ade0;};'use strict';var _=require(_0xbe78('0x0'));var rp=require(_0xbe78('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xbe78('0x2'));var config=require(_0xbe78('0x3'));var logger=require(_0xbe78('0x4'))('zendesk');config[_0xbe78('0x5')]=_[_0xbe78('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbe78('0x5')]));function emit(_0x19cfce,_0x5655ae,_0x251920){io['to'](_0x19cfce)[_0xbe78('0x7')](_0x5655ae,_0x251920);}var headers={'Content-Type':_0xbe78('0x8'),'Accept':'application/json'};function getTicket(_0x532614,_0xee4910,_0x4441e4,_0x634da6,_0x30ebc6){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xbe78('0x9'),_0x532614['remoteUri']),'method':_0xbe78('0xa'),'body':{'ticket':_[_0xbe78('0xb')]({'requester_id':_0x4441e4['id'],'submitter_id':_0xee4910?_0xee4910['id']:undefined,'assignee_id':_0xee4910?_0xee4910['id']:undefined,'tags':getTags(_0x634da6[_0xbe78('0xc')],'name'),'subject':intUtil[_0xbe78('0xd')](_0x634da6[_0xbe78('0xe')],_0x30ebc6,'\x20'),'description':intUtil['getString'](_0x634da6[_0xbe78('0xf')],_0x30ebc6,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x634da6[_0xbe78('0xf')],_0x30ebc6,'\x0a')}},getCustomFields(_0x634da6[_0xbe78('0x10')],_0x30ebc6))}})[_0xbe78('0x11')](function(_0x22ec89){logger[_0xbe78('0x12')](_0xbe78('0x13'));return _0x22ec89[_0xbe78('0x14')];});}function getUser(_0x5c4975,_0x22060f){if(intUtil[_0xbe78('0x15')](_0x22060f)){logger['info'](_0xbe78('0x16'),_0x22060f);return request({'uri':util[_0xbe78('0x17')](_0xbe78('0x18'),_0x5c4975[_0xbe78('0x19')]),'qs':{'query':util[_0xbe78('0x17')](_0xbe78('0x1a'),_0x22060f)}})[_0xbe78('0x11')](function(_0x147f2f){if(_0x147f2f[_0xbe78('0x1b')]){logger[_0xbe78('0x12')]('Agent\x20found!');return _[_0xbe78('0x1c')](_0x147f2f[_0xbe78('0x1d')],{'email':_0x22060f,'role':_0xbe78('0x1e')});}else{logger[_0xbe78('0x12')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xbe78('0x17')]('%s/users/me.json',_0x5c4975[_0xbe78('0x19')])})[_0xbe78('0x11')](function(_0x335ec2){logger['info']('Admin\x20account\x20selected.');return _0x335ec2['user'];});}});}else{logger[_0xbe78('0x12')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xbe78('0x17')](_0xbe78('0x1f'),_0x5c4975[_0xbe78('0x19')])})[_0xbe78('0x11')](function(_0x6e277b){logger['info'](_0xbe78('0x20'));return _0x6e277b[_0xbe78('0x21')];});}}function getEndUser(_0x18186d,_0x157b1d,_0x251a98){logger['info'](_0xbe78('0x22'),_0x251a98);return request({'uri':util[_0xbe78('0x17')]('%s/search.json',_0x18186d[_0xbe78('0x19')]),'qs':{'query':util[_0xbe78('0x17')](_0xbe78('0x23'),_0x251a98)}})[_0xbe78('0x11')](function(_0x35d141){var _0x3d0c09;if(_0x35d141['results'][_0xbe78('0x24')]){_0x35d141['results']=_[_0xbe78('0x25')](_0x35d141[_0xbe78('0x1d')],{'suspended':![],'role':_0xbe78('0x26')});if(_0x35d141[_0xbe78('0x1d')][_0xbe78('0x24')]){_0x3d0c09=_['first'](_0x35d141[_0xbe78('0x1d')]);}}if(_0x3d0c09){logger[_0xbe78('0x12')]('Enduser\x20found!');return _0x3d0c09;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe78('0x17')](_0xbe78('0x27'),_0x18186d[_0xbe78('0x19')]),'method':'POST','body':{'user':{'role':_0xbe78('0x26'),'name':util['format'](_0xbe78('0x28'),_0x157b1d||_0x251a98),'phone':_0x251a98}}})[_0xbe78('0x11')](function(_0x4ee019){logger['info'](_0xbe78('0x29'));return _0x4ee019[_0xbe78('0x21')];});}});}function getAuth(_0x5447d0){var _0x2f041b;if(_0x5447d0[_0xbe78('0x2a')]===_0xbe78('0x2b')){_0x2f041b=util[_0xbe78('0x17')](_0xbe78('0x2c'),_0x5447d0[_0xbe78('0x2d')],_0x5447d0[_0xbe78('0x2b')]);}else if(_0x5447d0[_0xbe78('0x2a')]===_0xbe78('0x2e')){_0x2f041b=util[_0xbe78('0x17')](_0xbe78('0x2f'),_0x5447d0['username'],_0x5447d0[_0xbe78('0x2e')]);}return util[_0xbe78('0x17')]('Basic\x20%s',new Buffer(_0x2f041b)[_0xbe78('0x30')](_0xbe78('0x31')));}function request(_0x39381d){logger[_0xbe78('0x32')]('[HTTP]',JSON[_0xbe78('0x33')](_0x39381d));return rp(_[_0xbe78('0x6')](_0x39381d,{'method':_0xbe78('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x2961f4,_0x35ce4a){var _0x4ac7c8=[];if(_0x2961f4&&_0x2961f4[_0xbe78('0x24')]>0x0){_0x4ac7c8=_[_0xbe78('0x35')](_0x2961f4,_0x35ce4a);}return _0x4ac7c8;}function getCustomFields(_0x403880,_0x2fabc8){var _0x41af25=[];var _0x5d62c6={'custom_fields':[]};if(_0x403880['length']>0x0){_[_0xbe78('0x36')](_0x403880,function(_0xcbfdef){if(_[_0xbe78('0x37')]([_0xbe78('0x38'),'picklist'],_0xcbfdef['type'])&&_0xcbfdef[_0xbe78('0x39')]&&!_0xcbfdef[_0xbe78('0x3a')]){_0x5d62c6[_0xcbfdef[_0xbe78('0x39')]['toLowerCase']()]=_0xcbfdef[_0xbe78('0x3b')][_0xbe78('0x30')]();}else if(_[_0xbe78('0x37')](['string',_0xbe78('0x3c')],_0xcbfdef[_0xbe78('0x3d')])&&_0xcbfdef['idField']&&_0xcbfdef[_0xbe78('0x3a')]){_0x5d62c6[_0xbe78('0x3e')][_0xbe78('0x3f')]({'id':_0xcbfdef[_0xbe78('0x40')],'value':_0xcbfdef[_0xbe78('0x3b')][_0xbe78('0x30')]()});}else if(_0xcbfdef[_0xbe78('0x3d')]===_0xbe78('0x41')&&_0xcbfdef[_0xbe78('0x42')]&&_0xcbfdef['idField']&&_0xcbfdef[_0xbe78('0x3a')]){_0x2fabc8[_0xcbfdef[_0xbe78('0x42')]]&&_0x5d62c6[_0xbe78('0x3e')]['push']({'id':_0xcbfdef[_0xbe78('0x40')],'value':_0x2fabc8[_0xcbfdef[_0xbe78('0x42')]][_0xbe78('0x30')]()});}else if(_0xcbfdef[_0xbe78('0x3d')]===_0xbe78('0x43')&&_0xcbfdef[_0xbe78('0x44')]&&_0xcbfdef[_0xbe78('0x44')][_0xbe78('0x45')]&&_0xcbfdef[_0xbe78('0x40')]&&_0xcbfdef['customField']){_0x2fabc8[_0xcbfdef[_0xbe78('0x44')][_0xbe78('0x45')][_0xbe78('0x46')]()]&&_0x5d62c6[_0xbe78('0x3e')][_0xbe78('0x3f')]({'id':_0xcbfdef[_0xbe78('0x40')],'value':_0x2fabc8[_0xcbfdef[_0xbe78('0x44')][_0xbe78('0x45')][_0xbe78('0x46')]()][_0xbe78('0x30')]()});}});}return _0x5d62c6;}exports[_0xbe78('0x47')]=function(_0x18c54f,_0x2960f3,_0x4b14c5,_0xda6c78,_0x2e0776,_0x562d6b){var _0x2cc555,_0x25d658;_0x562d6b[_0xbe78('0x19')]=intUtil[_0xbe78('0x48')](_0x562d6b[_0xbe78('0x19')]);_0x562d6b[_0xbe78('0x49')]=intUtil[_0xbe78('0x48')](_0x562d6b['serverUrl']);if(_0x2e0776&&_0x2e0776[_0xbe78('0x4a')]){logger[_0xbe78('0x12')](_0xbe78('0x4b'),_0xbe78('0x4c'));_0x2960f3[_0xbe78('0x4d')]=util[_0xbe78('0x17')](_0xbe78('0x4e'),_0x562d6b[_0xbe78('0x49')],_0x2960f3[_0xbe78('0x4f')],md5(_0x2960f3[_0xbe78('0x4f')]));}else{_0x2960f3[_0xbe78('0x4d')]='';}headers[_0xbe78('0x50')]=getAuth(_0x562d6b);return getUser(_0x562d6b,_0xda6c78[_0xbe78('0x51')])[_0xbe78('0x11')](function(_0x457f8d){_0x2cc555=_0x457f8d;logger['info'](_0xbe78('0x52'),_0x2cc555['id']);return getEndUser(_0x562d6b,_0x2960f3['calleridname'],_0x2960f3[_0xbe78('0x53')]);})[_0xbe78('0x11')](function(_0x31a50f){_0x25d658=_0x31a50f;logger['info'](_0xbe78('0x54'),_0x25d658['id']);return getTicket(_0x562d6b,_0x2cc555,_0x25d658,_0x4b14c5,_0x2960f3);})[_0xbe78('0x11')](function(_0x5db545){if(_0x5db545){logger[_0xbe78('0x12')](_0xbe78('0x55'),_0x5db545['id']);switch(_0x562d6b['type']){case _0xbe78('0x56'):logger[_0xbe78('0x12')](_0xbe78('0x4b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xbe78('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x562d6b[_0xbe78('0x19')],_0x2cc555['id'],_0x5db545['id']),'method':_0xbe78('0xa')});case'newTab':logger[_0xbe78('0x12')](_0xbe78('0x4b'),_0xbe78('0x57'));emit(util[_0xbe78('0x17')](_0xbe78('0x58'),_0xda6c78[_0xbe78('0x45')]),_0xbe78('0x59'),{'uri':util['format'](_0xbe78('0x5a'),_0x562d6b[_0xbe78('0x19')][_0xbe78('0x5b')](_0xbe78('0x5c'),''),_0x5db545['id'])});break;default:logger[_0xbe78('0x5d')](_0xbe78('0x4b'),_0xbe78('0x5e'));}}})[_0xbe78('0x5f')](function(_0x2d1617){logger[_0xbe78('0x5d')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xbe78('0x60')](_0x2d1617,{'showHidden':!![],'depth':null}));});};exports[_0xbe78('0x61')]=function(_0x3ff028,_0x4db86d,_0x3bc4c9,_0x562ce5,_0x1f45a6,_0x4d37eb,_0x5c7ea9){var _0x2ee580,_0x4f12da;_0x4d37eb[_0xbe78('0x19')]=intUtil[_0xbe78('0x48')](_0x4d37eb[_0xbe78('0x19')]);_0x4d37eb[_0xbe78('0x49')]=intUtil[_0xbe78('0x48')](_0x4d37eb[_0xbe78('0x49')]);if(_0x5c7ea9&&_0x5c7ea9['recordingFormat']&&_0x5c7ea9[_0xbe78('0x62')]!==_0xbe78('0x63')){logger['info'](_0xbe78('0x64'),_0xbe78('0x4c'));_0x4db86d['recordingURL']=util['format'](_0xbe78('0x4e'),_0x4d37eb[_0xbe78('0x49')],_0x4db86d[_0xbe78('0x4f')],md5(_0x4db86d['uniqueid']));}headers[_0xbe78('0x50')]=getAuth(_0x4d37eb);return getUser(_0x4d37eb,_0x562ce5[_0xbe78('0x51')])[_0xbe78('0x11')](function(_0x5aebe3){_0x2ee580=_0x5aebe3;logger[_0xbe78('0x12')](_0xbe78('0x52'),_0x2ee580['id']);return getEndUser(_0x4d37eb,_0x4db86d[_0xbe78('0x65')],_0x4db86d[_0xbe78('0x66')]);})['then'](function(_0x38d754){_0x4f12da=_0x38d754;logger[_0xbe78('0x12')](_0xbe78('0x54'),_0x4f12da['id']);return getTicket(_0x4d37eb,_0x2ee580,_0x4f12da,_0x3bc4c9,_0x4db86d);})[_0xbe78('0x11')](function(_0x3cba65){if(_0x3cba65){logger[_0xbe78('0x12')](_0xbe78('0x55'),_0x3cba65['id']);switch(_0x4d37eb[_0xbe78('0x3d')]){case _0xbe78('0x56'):logger['info'](_0xbe78('0x64'),_0xbe78('0x67'));return request({'uri':util[_0xbe78('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d37eb[_0xbe78('0x19')],_0x2ee580['id'],_0x3cba65['id']),'method':'POST'});case _0xbe78('0x68'):logger[_0xbe78('0x12')](_0xbe78('0x64'),_0xbe78('0x57'));emit(util[_0xbe78('0x17')](_0xbe78('0x58'),_0x562ce5[_0xbe78('0x45')]),'trigger:browser:url',{'uri':util['format'](_0xbe78('0x5a'),_0x4d37eb[_0xbe78('0x19')][_0xbe78('0x5b')](_0xbe78('0x5c'),''),_0x3cba65['id'])});break;default:logger[_0xbe78('0x5d')]('[OUTBOUND]',_0xbe78('0x5e'));}}})['catch'](function(_0x1b4610){logger[_0xbe78('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xbe78('0x60')](_0x1b4610,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x24a65e,_0x30d2f5,_0x34435f,_0x2bf1fc,_0x1d83f1,_0x2b4d78){var _0x158af3,_0x2142f9;_0x2b4d78[_0xbe78('0x19')]=intUtil[_0xbe78('0x48')](_0x2b4d78[_0xbe78('0x19')]);_0x2b4d78[_0xbe78('0x49')]=intUtil[_0xbe78('0x48')](_0x2b4d78[_0xbe78('0x49')]);if(_0x1d83f1&&_0x1d83f1[_0xbe78('0x4a')]){logger[_0xbe78('0x12')]('['+_0x30d2f5['lastevent'][_0xbe78('0x69')]()+']',_0xbe78('0x4c'));_0x30d2f5[_0xbe78('0x4d')]=util['format'](_0xbe78('0x4e'),_0x2b4d78[_0xbe78('0x49')],_0x30d2f5[_0xbe78('0x4f')],md5(_0x30d2f5[_0xbe78('0x4f')]));}else{_0x30d2f5[_0xbe78('0x4d')]='';}headers[_0xbe78('0x50')]=getAuth(_0x2b4d78);return getUser(_0x2b4d78)[_0xbe78('0x11')](function(_0x457eba){_0x158af3=_0x457eba;logger[_0xbe78('0x12')](_0xbe78('0x52'),_0x158af3['id']);return getEndUser(_0x2b4d78,_0x30d2f5[_0xbe78('0x6a')],_0x30d2f5[_0xbe78('0x53')]);})[_0xbe78('0x11')](function(_0x4c8d13){_0x2142f9=_0x4c8d13;logger[_0xbe78('0x12')](_0xbe78('0x54'),_0x2142f9['id']);return getTicket(_0x2b4d78,_0x158af3,_0x2142f9,_0x34435f,_0x30d2f5);})['then'](function(_0x3bd1b9){if(_0x3bd1b9){logger[_0xbe78('0x12')](_0xbe78('0x55'),_0x3bd1b9['id']);}})[_0xbe78('0x5f')](function(_0x37a80d){logger[_0xbe78('0x5d')]('['+_0x30d2f5[_0xbe78('0x6b')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0xbe78('0x60')](_0x37a80d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf31a=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','POST','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','forEach','includes','picklist','type','nameField','customField','content','toString','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL'];(function(_0x4e8789,_0x7ab216){var _0x267eef=function(_0x22a9ee){while(--_0x22a9ee){_0x4e8789['push'](_0x4e8789['shift']());}};_0x267eef(++_0x7ab216);}(_0xf31a,0x1e6));var _0xaf31=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xf31a[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xaf31('0x0'));var rp=require(_0xaf31('0x1'));var md5=require(_0xaf31('0x2'));var util=require(_0xaf31('0x3'));var Redis=require(_0xaf31('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xaf31('0x5'))(_0xaf31('0x6'));config[_0xaf31('0x7')]=_[_0xaf31('0x8')](config[_0xaf31('0x7')],{'host':_0xaf31('0x9'),'port':0x18eb});var io=require(_0xaf31('0xa'))(new Redis(config[_0xaf31('0x7')]));function emit(_0x5eaccd,_0x31bf9f,_0x4dac42){io['to'](_0x5eaccd)['emit'](_0x31bf9f,_0x4dac42);}var headers={'Content-Type':_0xaf31('0xb'),'Accept':_0xaf31('0xb')};function getTicket(_0x34662a,_0x53e15c,_0x56bc03,_0x3b9d39,_0x5d89a0){logger[_0xaf31('0xc')](_0xaf31('0xd'));return request({'uri':util[_0xaf31('0xe')](_0xaf31('0xf'),_0x34662a[_0xaf31('0x10')]),'method':'POST','body':{'ticket':_[_0xaf31('0x11')]({'requester_id':_0x56bc03['id'],'submitter_id':_0x53e15c?_0x53e15c['id']:undefined,'assignee_id':_0x53e15c?_0x53e15c['id']:undefined,'tags':getTags(_0x3b9d39[_0xaf31('0x12')],_0xaf31('0x13')),'subject':intUtil[_0xaf31('0x14')](_0x3b9d39[_0xaf31('0x15')],_0x5d89a0,'\x20'),'description':intUtil[_0xaf31('0x14')](_0x3b9d39[_0xaf31('0x16')],_0x5d89a0,'\x0a'),'comment':{'public':![],'body':intUtil[_0xaf31('0x14')](_0x3b9d39['Descriptions'],_0x5d89a0,'\x0a')}},getCustomFields(_0x3b9d39['Fields'],_0x5d89a0))}})[_0xaf31('0x17')](function(_0x17b78b){logger[_0xaf31('0xc')](_0xaf31('0x18'));return _0x17b78b[_0xaf31('0x19')];});}function getUser(_0xdedf10,_0x3021ad){if(intUtil[_0xaf31('0x1a')](_0x3021ad)){logger[_0xaf31('0xc')](_0xaf31('0x1b'),_0x3021ad);return request({'uri':util[_0xaf31('0xe')](_0xaf31('0x1c'),_0xdedf10[_0xaf31('0x10')]),'qs':{'query':util[_0xaf31('0xe')](_0xaf31('0x1d'),_0x3021ad)}})[_0xaf31('0x17')](function(_0xb9ee29){if(_0xb9ee29[_0xaf31('0x1e')]){logger['info']('Agent\x20found!');return _['find'](_0xb9ee29[_0xaf31('0x1f')],{'email':_0x3021ad,'role':_0xaf31('0x20')});}else{logger['info'](_0xaf31('0x21'));return request({'uri':util[_0xaf31('0xe')](_0xaf31('0x22'),_0xdedf10[_0xaf31('0x10')])})['then'](function(_0x80c3bb){logger[_0xaf31('0xc')](_0xaf31('0x23'));return _0x80c3bb[_0xaf31('0x24')];});}});}else{logger[_0xaf31('0xc')](_0xaf31('0x21'));return request({'uri':util[_0xaf31('0xe')](_0xaf31('0x22'),_0xdedf10[_0xaf31('0x10')])})[_0xaf31('0x17')](function(_0xe6615f){logger[_0xaf31('0xc')]('Admin\x20account\x20selected.');return _0xe6615f['user'];});}}function getEndUser(_0x505c63,_0x4c3217,_0xd9819d){logger['info'](_0xaf31('0x25'),_0xd9819d);return request({'uri':util[_0xaf31('0xe')]('%s/search.json',_0x505c63[_0xaf31('0x10')]),'qs':{'query':util[_0xaf31('0xe')](_0xaf31('0x26'),_0xd9819d)}})[_0xaf31('0x17')](function(_0x42709e){var _0xaa044d;if(_0x42709e[_0xaf31('0x1f')]['length']){_0x42709e['results']=_[_0xaf31('0x27')](_0x42709e[_0xaf31('0x1f')],{'suspended':![],'role':_0xaf31('0x28')});if(_0x42709e[_0xaf31('0x1f')][_0xaf31('0x29')]){_0xaa044d=_[_0xaf31('0x2a')](_0x42709e[_0xaf31('0x1f')]);}}if(_0xaa044d){logger[_0xaf31('0xc')](_0xaf31('0x2b'));return _0xaa044d;}else{logger[_0xaf31('0xc')](_0xaf31('0x2c'));return request({'uri':util[_0xaf31('0xe')](_0xaf31('0x2d'),_0x505c63[_0xaf31('0x10')]),'method':'POST','body':{'user':{'role':_0xaf31('0x28'),'name':util[_0xaf31('0xe')]('Caller\x20-\x20%s',_0x4c3217||_0xd9819d),'phone':_0xd9819d}}})['then'](function(_0x14a50c){logger[_0xaf31('0xc')](_0xaf31('0x2e'));return _0x14a50c[_0xaf31('0x24')];});}});}function getAuth(_0x242c87){var _0x17e1dc;if(_0x242c87[_0xaf31('0x2f')]===_0xaf31('0x30')){_0x17e1dc=util[_0xaf31('0xe')]('%s:%s',_0x242c87['username'],_0x242c87[_0xaf31('0x30')]);}else if(_0x242c87[_0xaf31('0x2f')]===_0xaf31('0x31')){_0x17e1dc=util[_0xaf31('0xe')]('%s/token:%s',_0x242c87['username'],_0x242c87[_0xaf31('0x31')]);}return util[_0xaf31('0xe')](_0xaf31('0x32'),new Buffer(_0x17e1dc)['toString'](_0xaf31('0x33')));}function request(_0x2d8c82){logger[_0xaf31('0x34')](_0xaf31('0x35'),JSON[_0xaf31('0x36')](_0x2d8c82));return rp(_['defaults'](_0x2d8c82,{'method':_0xaf31('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x1b78f5,_0x200707){var _0xeaeb95=[];if(_0x1b78f5&&_0x1b78f5['length']>0x0){_0xeaeb95=_['map'](_0x1b78f5,_0x200707);}return _0xeaeb95;}function getCustomFields(_0x32d1a5,_0x5d5d43){var _0x44a74f=[];var _0x21315f={'custom_fields':[]};if(_0x32d1a5[_0xaf31('0x29')]>0x0){_[_0xaf31('0x38')](_0x32d1a5,function(_0x45df6e){if(_[_0xaf31('0x39')](['string',_0xaf31('0x3a')],_0x45df6e[_0xaf31('0x3b')])&&_0x45df6e[_0xaf31('0x3c')]&&!_0x45df6e[_0xaf31('0x3d')]){_0x21315f[_0x45df6e['nameField']['toLowerCase']()]=_0x45df6e[_0xaf31('0x3e')][_0xaf31('0x3f')]();}else if(_['includes']([_0xaf31('0x40'),_0xaf31('0x3a')],_0x45df6e[_0xaf31('0x3b')])&&_0x45df6e[_0xaf31('0x41')]&&_0x45df6e[_0xaf31('0x3d')]){_0x21315f[_0xaf31('0x42')][_0xaf31('0x43')]({'id':_0x45df6e[_0xaf31('0x41')],'value':_0x45df6e[_0xaf31('0x3e')]['toString']()});}else if(_0x45df6e[_0xaf31('0x3b')]===_0xaf31('0x44')&&_0x45df6e[_0xaf31('0x45')]&&_0x45df6e[_0xaf31('0x41')]&&_0x45df6e[_0xaf31('0x3d')]){_0x5d5d43[_0x45df6e[_0xaf31('0x45')]]&&_0x21315f[_0xaf31('0x42')][_0xaf31('0x43')]({'id':_0x45df6e[_0xaf31('0x41')],'value':_0x5d5d43[_0x45df6e['variableName']][_0xaf31('0x3f')]()});}else if(_0x45df6e['type']===_0xaf31('0x46')&&_0x45df6e[_0xaf31('0x47')]&&_0x45df6e['Variable'][_0xaf31('0x13')]&&_0x45df6e[_0xaf31('0x41')]&&_0x45df6e['customField']){_0x5d5d43[_0x45df6e['Variable'][_0xaf31('0x13')][_0xaf31('0x48')]()]&&_0x21315f[_0xaf31('0x42')][_0xaf31('0x43')]({'id':_0x45df6e['idField'],'value':_0x5d5d43[_0x45df6e['Variable'][_0xaf31('0x13')][_0xaf31('0x48')]()]['toString']()});}});}return _0x21315f;}exports[_0xaf31('0x49')]=function(_0x50d9e4,_0x47074a,_0xbadfde,_0xdea580,_0x5c8dfd,_0x52fd1e){var _0xa258d9,_0x238ce8;_0x52fd1e[_0xaf31('0x10')]=intUtil['stripTrailingSlash'](_0x52fd1e['remoteUri']);_0x52fd1e[_0xaf31('0x4a')]=intUtil['stripTrailingSlash'](_0x52fd1e['serverUrl']);if(_0x5c8dfd&&_0x5c8dfd[_0xaf31('0x4b')]){logger[_0xaf31('0xc')](_0xaf31('0x4c'),_0xaf31('0x4d'));_0x47074a[_0xaf31('0x4e')]=util[_0xaf31('0xe')](_0xaf31('0x4f'),_0x52fd1e[_0xaf31('0x4a')],_0x47074a['uniqueid'],md5(_0x47074a[_0xaf31('0x50')]));}else{_0x47074a[_0xaf31('0x4e')]='';}headers['Authorization']=getAuth(_0x52fd1e);return getUser(_0x52fd1e,_0xdea580[_0xaf31('0x51')])[_0xaf31('0x17')](function(_0x4af2f0){_0xa258d9=_0x4af2f0;logger[_0xaf31('0xc')](_0xaf31('0x52'),_0xa258d9['id']);return getEndUser(_0x52fd1e,_0x47074a[_0xaf31('0x53')],_0x47074a[_0xaf31('0x54')]);})[_0xaf31('0x17')](function(_0x5f2359){_0x238ce8=_0x5f2359;logger[_0xaf31('0xc')](_0xaf31('0x55'),_0x238ce8['id']);return getTicket(_0x52fd1e,_0xa258d9,_0x238ce8,_0xbadfde,_0x47074a);})[_0xaf31('0x17')](function(_0x2a657f){if(_0x2a657f){logger[_0xaf31('0xc')](_0xaf31('0x56'),_0x2a657f['id']);switch(_0x52fd1e[_0xaf31('0x3b')]){case'integrationTab':logger[_0xaf31('0xc')](_0xaf31('0x4c'),_0xaf31('0x57'));return request({'uri':util[_0xaf31('0xe')](_0xaf31('0x58'),_0x52fd1e['remoteUri'],_0xa258d9['id'],_0x2a657f['id']),'method':_0xaf31('0x59')});case _0xaf31('0x5a'):logger['info'](_0xaf31('0x4c'),_0xaf31('0x5b'));emit(util[_0xaf31('0xe')](_0xaf31('0x5c'),_0xdea580[_0xaf31('0x13')]),_0xaf31('0x5d'),{'uri':util[_0xaf31('0xe')]('%s/agent/tickets/%s',_0x52fd1e[_0xaf31('0x10')][_0xaf31('0x5e')](_0xaf31('0x5f'),''),_0x2a657f['id'])});break;default:logger[_0xaf31('0x60')](_0xaf31('0x4c'),_0xaf31('0x61'));}}})[_0xaf31('0x62')](function(_0x82665){logger[_0xaf31('0x60')](_0xaf31('0x63'),util[_0xaf31('0x64')](_0x82665,{'showHidden':!![],'depth':null}));});};exports[_0xaf31('0x65')]=function(_0x11ceff,_0x5edd19,_0xb4b998,_0x2d1acd,_0x50c68e,_0x4e2ed1,_0x4756ff){var _0x206b71,_0x2d7258;_0x4e2ed1[_0xaf31('0x10')]=intUtil[_0xaf31('0x66')](_0x4e2ed1[_0xaf31('0x10')]);_0x4e2ed1['serverUrl']=intUtil[_0xaf31('0x66')](_0x4e2ed1[_0xaf31('0x4a')]);if(_0x4756ff&&_0x4756ff[_0xaf31('0x67')]&&_0x4756ff[_0xaf31('0x67')]!==_0xaf31('0x68')){logger[_0xaf31('0xc')](_0xaf31('0x69'),_0xaf31('0x4d'));_0x5edd19[_0xaf31('0x4e')]=util[_0xaf31('0xe')](_0xaf31('0x4f'),_0x4e2ed1[_0xaf31('0x4a')],_0x5edd19['uniqueid'],md5(_0x5edd19[_0xaf31('0x50')]));}headers[_0xaf31('0x6a')]=getAuth(_0x4e2ed1);return getUser(_0x4e2ed1,_0x2d1acd['email'])['then'](function(_0x45f4a0){_0x206b71=_0x45f4a0;logger[_0xaf31('0xc')]('The\x20User\x20ID\x20is:',_0x206b71['id']);return getEndUser(_0x4e2ed1,_0x5edd19[_0xaf31('0x6b')],_0x5edd19['destcalleridnum']);})[_0xaf31('0x17')](function(_0x5d3fde){_0x2d7258=_0x5d3fde;logger[_0xaf31('0xc')](_0xaf31('0x55'),_0x2d7258['id']);return getTicket(_0x4e2ed1,_0x206b71,_0x2d7258,_0xb4b998,_0x5edd19);})[_0xaf31('0x17')](function(_0x5138a0){if(_0x5138a0){logger[_0xaf31('0xc')](_0xaf31('0x56'),_0x5138a0['id']);switch(_0x4e2ed1['type']){case'integrationTab':logger['info'](_0xaf31('0x69'),_0xaf31('0x57'));return request({'uri':util[_0xaf31('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4e2ed1[_0xaf31('0x10')],_0x206b71['id'],_0x5138a0['id']),'method':'POST'});case _0xaf31('0x5a'):logger[_0xaf31('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaf31('0xe')](_0xaf31('0x5c'),_0x2d1acd[_0xaf31('0x13')]),_0xaf31('0x5d'),{'uri':util['format'](_0xaf31('0x6c'),_0x4e2ed1[_0xaf31('0x10')][_0xaf31('0x5e')](_0xaf31('0x5f'),''),_0x5138a0['id'])});break;default:logger[_0xaf31('0x60')](_0xaf31('0x69'),_0xaf31('0x61'));}}})[_0xaf31('0x62')](function(_0x56b035){logger[_0xaf31('0x60')](_0xaf31('0x6d'),util[_0xaf31('0x64')](_0x56b035,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x4e07e9,_0x3fa7af,_0x22741d,_0x1eb821,_0x3549f3,_0xf8d1d2){var _0x6374dc,_0x15bbc3;_0xf8d1d2[_0xaf31('0x10')]=intUtil[_0xaf31('0x66')](_0xf8d1d2['remoteUri']);_0xf8d1d2['serverUrl']=intUtil['stripTrailingSlash'](_0xf8d1d2[_0xaf31('0x4a')]);if(_0x3549f3&&_0x3549f3[_0xaf31('0x4b')]){logger['info']('['+_0x3fa7af[_0xaf31('0x6e')][_0xaf31('0x6f')]()+']','Recording\x20is\x20enabled!');_0x3fa7af[_0xaf31('0x4e')]=util[_0xaf31('0xe')](_0xaf31('0x4f'),_0xf8d1d2[_0xaf31('0x4a')],_0x3fa7af[_0xaf31('0x50')],md5(_0x3fa7af['uniqueid']));}else{_0x3fa7af[_0xaf31('0x4e')]='';}headers[_0xaf31('0x6a')]=getAuth(_0xf8d1d2);return getUser(_0xf8d1d2)[_0xaf31('0x17')](function(_0x325862){_0x6374dc=_0x325862;logger[_0xaf31('0xc')](_0xaf31('0x52'),_0x6374dc['id']);return getEndUser(_0xf8d1d2,_0x3fa7af[_0xaf31('0x53')],_0x3fa7af[_0xaf31('0x54')]);})[_0xaf31('0x17')](function(_0x2a8b07){_0x15bbc3=_0x2a8b07;logger[_0xaf31('0xc')]('The\x20Enduser\x20ID\x20is:',_0x15bbc3['id']);return getTicket(_0xf8d1d2,_0x6374dc,_0x15bbc3,_0x22741d,_0x3fa7af);})['then'](function(_0x7a27e6){if(_0x7a27e6){logger[_0xaf31('0xc')](_0xaf31('0x56'),_0x7a27e6['id']);}})[_0xaf31('0x62')](function(_0x286eef){logger[_0xaf31('0x60')]('['+_0x3fa7af[_0xaf31('0x6e')]['toUpperCase']()+']'+_0xaf31('0x70'),util['inspect'](_0x286eef,{'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 51e3292..146b11f 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 _0x1ecf=['Zoho-oauthtoken\x20','code','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','talktime','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','complete','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','/downloads?type=uniqueid&token=','zoho.eu','com','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','The\x20Call\x20ID\x20is:','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','refreshToken','clientId','clientSecret','refresh_token','add','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name'];(function(_0x208961,_0x5e6cf6){var _0x4236f5=function(_0x28856f){while(--_0x28856f){_0x208961['push'](_0x208961['shift']());}};_0x4236f5(++_0x5e6cf6);}(_0x1ecf,0xf4));var _0xf1ec=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x1ecf[_0x1488cd];return _0x63fa13;};'use strict';var _=require(_0xf1ec('0x0'));var rp=require(_0xf1ec('0x1'));var md5=require('md5');var util=require(_0xf1ec('0x2'));var intUtil=require(_0xf1ec('0x3'));var moment=require(_0xf1ec('0x4'));var Redis=require(_0xf1ec('0x5'));var BPromise=require(_0xf1ec('0x6'));var config=require(_0xf1ec('0x7'));var logger=require(_0xf1ec('0x8'))(_0xf1ec('0x9'));config[_0xf1ec('0xa')]=_[_0xf1ec('0xb')](config[_0xf1ec('0xa')],{'host':_0xf1ec('0xc'),'port':0x18eb});var io=require(_0xf1ec('0xd'))(new Redis(config[_0xf1ec('0xa')]));function emit(_0x15dbf9,_0x19b0f3,_0x1a332a){io['to'](_0x15dbf9)[_0xf1ec('0xe')](_0x19b0f3,_0x1a332a);}function request(_0xe57e36){logger[_0xf1ec('0xf')](_0xf1ec('0x10'),JSON[_0xf1ec('0x11')](_0xe57e36));return rp(_0xe57e36);}function getCustomFields(_0x3635eb,_0x11ce6d){var _0x517f12={};if(_0x3635eb[_0xf1ec('0x12')]>0x0){_[_0xf1ec('0x13')](_0x3635eb,function(_0x2b1d08){if(_['includes']([_0xf1ec('0x14'),_0xf1ec('0x15')],_0x2b1d08[_0xf1ec('0x16')])&&_0x2b1d08['idField']){_0x517f12[_0x2b1d08[_0xf1ec('0x17')]]=_0x2b1d08['content'][_0xf1ec('0x18')]();}else if(_0x2b1d08[_0xf1ec('0x16')]===_0xf1ec('0x19')&&_0x2b1d08[_0xf1ec('0x1a')]&&_0x2b1d08[_0xf1ec('0x17')]&&_0x11ce6d[_0x2b1d08[_0xf1ec('0x1a')]]){_0x517f12[_0x2b1d08[_0xf1ec('0x17')]]=_0x11ce6d[_0x2b1d08['variableName']][_0xf1ec('0x18')]();}else if(_0x2b1d08[_0xf1ec('0x16')]===_0xf1ec('0x1b')&&_0x2b1d08[_0xf1ec('0x1c')]&&_0x2b1d08[_0xf1ec('0x1c')][_0xf1ec('0x1d')]&&_0x2b1d08[_0xf1ec('0x17')]&&_0x11ce6d[_0x2b1d08[_0xf1ec('0x1c')][_0xf1ec('0x1d')][_0xf1ec('0x1e')]()]){_0x517f12[_0x2b1d08[_0xf1ec('0x17')]]=_0x11ce6d[_0x2b1d08[_0xf1ec('0x1c')]['name'][_0xf1ec('0x1e')]()][_0xf1ec('0x18')]();}});}return _0x517f12;}function getName(_0x39eaeb){if(_0x39eaeb[_0xf1ec('0x1f')]('\x20')>0x0){var _0x37808e=_0x39eaeb[_0xf1ec('0x20')](/ (.+)/);if(_0x37808e[0x1]){return _0x37808e;}}return[_0x39eaeb,_0x39eaeb];}var accountsTokens={};function getAccessToken(_0x5de349){return new Promise(function(_0x1d4d7e,_0x134c5a){if(!_[_0xf1ec('0x21')](accountsTokens[_0x5de349['id']])&&!_[_0xf1ec('0x21')](accountsTokens[_0x5de349['id']]['access_token'])){if(moment()[_0xf1ec('0x22')](accountsTokens[_0x5de349['id']][_0xf1ec('0x23')])){_0x1d4d7e(accountsTokens[_0x5de349['id']][_0xf1ec('0x24')]);}}var _0x43244d;switch(_0x5de349['zone']){case'US':_0x43244d=_0xf1ec('0x25');break;case'AU':_0x43244d=_0xf1ec('0x26');break;case'EU':_0x43244d='https://accounts.zoho.eu';break;case'IN':_0x43244d=_0xf1ec('0x27');break;case'CN':_0x43244d=_0xf1ec('0x28');break;default:_0x43244d='https://accounts.zoho.eu';break;}var _0x38f2b3={'method':'POST','uri':_0x43244d+'/oauth/v2/token','qs':{'refresh_token':_0x5de349[_0xf1ec('0x29')],'client_id':_0x5de349[_0xf1ec('0x2a')],'client_secret':_0x5de349[_0xf1ec('0x2b')],'grant_type':_0xf1ec('0x2c')},'json':!![]};return rp(_0x38f2b3)['then'](function(_0x23c107){accountsTokens[_0x5de349['id']]={'access_token':_0x23c107[_0xf1ec('0x24')],'expires_in':moment()[_0xf1ec('0x2d')](_0x23c107[_0xf1ec('0x23')],'seconds')};_0x1d4d7e(_0x23c107['access_token']);})['catch'](function(_0x4bd2b2){logger[_0xf1ec('0x2e')](_0xf1ec('0x2f'),_0x4bd2b2[_0xf1ec('0x30')]);_0x134c5a(_0x4bd2b2);});});}function getUser(_0x12ce73,_0x11dea9,_0x4094a6,_0x4cec49){logger[_0xf1ec('0x31')](_0xf1ec('0x32'));return request({'method':_0xf1ec('0x33'),'uri':util[_0xf1ec('0x34')](_0xf1ec('0x35'),_0x11dea9),'qs':{'type':_0xf1ec('0x36')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x12ce73},'json':!![]})[_0xf1ec('0x37')](function(_0x581fa0){if(_0x581fa0[_0xf1ec('0x38')]){var _0x10ee05=-0x1;if(_[_0xf1ec('0x39')](_0x581fa0[_0xf1ec('0x38')])){if(!_[_0xf1ec('0x21')](_0x4cec49)){_0x10ee05=_[_0xf1ec('0x3a')](_0x581fa0[_0xf1ec('0x38')],function(_0x5e0b3f){return _0x5e0b3f[_0xf1ec('0x3b')]===_0x4cec49;});}if(_0x10ee05>=0x0){logger[_0xf1ec('0x31')](_0xf1ec('0x3c'));}else{logger[_0xf1ec('0x31')]('Using\x20the\x20admin\x20account!');_0x10ee05=_[_0xf1ec('0x3a')](_0x581fa0[_0xf1ec('0x38')],function(_0xd3a67b){return _0xd3a67b['profile']['name']===_0xf1ec('0x3d');});}return _0x581fa0[_0xf1ec('0x38')][_0x10ee05];}else{if(_0x581fa0[_0xf1ec('0x3e')][_0xf1ec('0x3f')][_0xf1ec('0x1d')]==='Administrator'){logger[_0xf1ec('0x31')](_0xf1ec('0x40'));user=_0x581fa0['user'];return user;}else{logger[_0xf1ec('0x2e')](_0xf1ec('0x41'),JSON[_0xf1ec('0x11')](_0x581fa0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x581fa0));}}}else{logger[_0xf1ec('0x2e')](_0xf1ec('0x41'),JSON[_0xf1ec('0x11')](_0x581fa0));throw new Error(_0xf1ec('0x42')+JSON[_0xf1ec('0x11')](_0x581fa0));}})[_0xf1ec('0x43')](function(_0x3a9aa0){console[_0xf1ec('0x2e')](_0x3a9aa0);});}function getZohoUser(_0x5f20e0,_0x32f080){return new BPromise(function(_0x1eb6cf,_0x2b772e){request(_0x5f20e0)[_0xf1ec('0x37')](function(_0x384953){var _0x534a59=null;if(_0x384953){_0x534a59=_0x384953[_0xf1ec('0x44')][0x0];_0x534a59[_0xf1ec('0x45')]=_0x32f080;}_0x1eb6cf(_0x534a59);})[_0xf1ec('0x43')](function(_0x4381f9){_0x2b772e(_0x4381f9);});});}function createEndUser(_0x2f7f27,_0x188b9e,_0x17ba43,_0x5c6bf1,_0x68d8db,_0x2d066b){var _0x17ba43=getName(_0x17ba43);return request({'method':_0xf1ec('0x46'),'uri':_0xf1ec('0x47')+_0x188b9e+_0xf1ec('0x48')+_[_0xf1ec('0x49')](_0x2d066b[_0xf1ec('0x4a')])+'s','body':{'data':[{'Last_Name':_0x17ba43[0x1],'First_Name':_0x17ba43[0x0],'Phone':_0x5c6bf1,'Owner':{'name':!_[_0xf1ec('0x21')](_0x68d8db['role'][_0xf1ec('0x1d')])?_0x68d8db[_0xf1ec('0x4b')][_0xf1ec('0x1d')]:!_[_0xf1ec('0x21')](_0x68d8db['first_name'])?_0x68d8db[_0xf1ec('0x4c')]+'\x20'+_0x68d8db[_0xf1ec('0x4d')]:_0x68d8db[_0xf1ec('0x4d')],'id':_0x68d8db['id']}}]},'headers':{'Authorization':_0xf1ec('0x4e')+_0x2f7f27},'json':!![]})[_0xf1ec('0x37')](function(_0x2f7e68){if(_0x2f7e68&&_0x2f7e68[_0xf1ec('0x44')][0x0][_0xf1ec('0x4f')]===_0xf1ec('0x50')){var _0xf3cdb3=_0x2f7e68[_0xf1ec('0x44')][0x0][_0xf1ec('0x51')];_0xf3cdb3[_0xf1ec('0x45')]=_[_0xf1ec('0x49')](_0x2d066b[_0xf1ec('0x4a')])+'s';return _0xf3cdb3;}logger[_0xf1ec('0x2e')](_0xf1ec('0x41'),JSON[_0xf1ec('0x11')](data));throw new Error('Error:\x20'+JSON[_0xf1ec('0x11')](data));})[_0xf1ec('0x43')](function(_0x144054){console[_0xf1ec('0x52')](_0xf1ec('0x53'),_0x144054);});}function getEndUser(_0x5b0fac,_0x2362e6,_0x38bdbf,_0x5bd934,_0x4fea55,_0x8a2b63,_0x3c9d08){var _0x293e60={'method':_0xf1ec('0x33'),'uri':'','headers':{'Authorization':_0xf1ec('0x4e')+_0x5b0fac},'json':!![]};switch(_0x3c9d08[_0xf1ec('0x54')]){case _0xf1ec('0x55'):_0x293e60['uri']=_0xf1ec('0x47')+_0x2362e6+_0xf1ec('0x56')+_0x4fea55+'))';return getZohoUser(_0x293e60,_0xf1ec('0x57'))[_0xf1ec('0x37')](function(_0x1a7a94){if(_0x1a7a94)return _0x1a7a94;_0x293e60[_0xf1ec('0x58')]='https://www.zohoapis.'+_0x2362e6+_0xf1ec('0x59')+_0x4fea55+'))';return getZohoUser(_0x293e60,_0xf1ec('0x5a'))[_0xf1ec('0x37')](function(_0x115f03){if(_0x115f03)return _0x115f03;if(_0x3c9d08[_0xf1ec('0x4a')]!=_0xf1ec('0x5b')){return createEndUser(_0x5b0fac,_0x2362e6,_0x5bd934,_0x4fea55,_0x8a2b63,_0x3c9d08);}else{return{};}});});break;case'contact':_0x293e60[_0xf1ec('0x58')]='https://www.zohoapis.'+_0x2362e6+_0xf1ec('0x56')+_0x4fea55+'))';return getZohoUser(_0x293e60,_0xf1ec('0x57'))[_0xf1ec('0x37')](function(_0x2591b9){if(_0x2591b9)return _0x2591b9;if(_0x3c9d08['moduleCreate']!='nothing'){return createEndUser(_0x5b0fac,_0x2362e6,_0x5bd934,_0x4fea55,_0x8a2b63,_0x3c9d08);}else{return{};}});break;case _0xf1ec('0x5c'):_0x293e60['uri']=_0xf1ec('0x47')+_0x2362e6+_0xf1ec('0x59')+_0x4fea55+'))';return getZohoUser(_0x293e60,_0xf1ec('0x5a'))[_0xf1ec('0x37')](function(_0x29a96f){if(_0x29a96f)return _0x29a96f;if(_0x3c9d08['moduleCreate']!=_0xf1ec('0x5b')){return createEndUser(_0x5b0fac,_0x2362e6,_0x5bd934,_0x4fea55,_0x8a2b63,_0x3c9d08);}else{return{};}});break;}}function getCall(_0x151ed5,_0x4f2fcc,_0x3460ed,_0x227653,_0x35914c,_0x2dfac3,_0x49bffb,_0x5e6a4d){logger[_0xf1ec('0x31')]('Creating\x20new\x20call...');var _0x46c534={};_0x46c534[_0xf1ec('0x5d')]={'name':!_[_0xf1ec('0x21')](_0x227653[_0xf1ec('0x4b')][_0xf1ec('0x1d')])&&!_[_0xf1ec('0x21')](_0x227653[_0xf1ec('0x3f')][_0xf1ec('0x1d')])&&_0x227653[_0xf1ec('0x3f')]['name']===_0xf1ec('0x5e')?_0x227653[_0xf1ec('0x4b')]['name']:!_[_0xf1ec('0x21')](_0x227653[_0xf1ec('0x4c')])?_0x227653[_0xf1ec('0x4c')]+'\x20'+_0x227653[_0xf1ec('0x4d')]:_0x227653[_0xf1ec('0x4d')],'id':_0x227653['id']};_0x46c534[_0xf1ec('0x5f')]=intUtil[_0xf1ec('0x60')](_0x2dfac3[_0xf1ec('0x61')],_0x49bffb,'\x20');_0x46c534[_0xf1ec('0x62')]=intUtil[_0xf1ec('0x60')](_0x2dfac3[_0xf1ec('0x63')],_0x49bffb,'\x0a');if(_0x35914c[_0xf1ec('0x45')]===_0xf1ec('0x57')){_0x46c534['Who_Id']={'name':!_['isNil'](_0x35914c['Full_Name'])?_0x35914c[_0xf1ec('0x64')]:!_['isNil'](_0x35914c['First_Name'])?_0x35914c[_0xf1ec('0x65')]+'\x20'+_0x35914c['Last_Name']:_0x35914c[_0xf1ec('0x66')],'id':_0x35914c['id']};}if(_0x35914c[_0xf1ec('0x45')]==='Leads'){_0x46c534[_0xf1ec('0x67')]={'name':!_['isNil'](_0x35914c[_0xf1ec('0x64')])?_0x35914c['Full_Name']:!_[_0xf1ec('0x21')](_0x35914c[_0xf1ec('0x65')])?_0x35914c[_0xf1ec('0x65')]+'\x20'+_0x35914c[_0xf1ec('0x66')]:_0x35914c['Last_Name'],'id':_0x35914c['id']};_0x46c534[_0xf1ec('0x68')]=_[_0xf1ec('0x49')](_0x35914c[_0xf1ec('0x45')]);}if(_0x49bffb['talktime']){_0x46c534[_0xf1ec('0x69')]=moment['utc'](parseInt(_0x49bffb[_0xf1ec('0x6a')])*0x3e8)['format']('mm:ss');}else if(_0x49bffb[_0xf1ec('0x6b')]&&_0x49bffb[_0xf1ec('0x6c')]){_0x46c534['Call_Duration']=moment['utc'](moment(_0x49bffb[_0xf1ec('0x6c')],'YYYY-MM-DDTHH:mm:ss')[_0xf1ec('0x6d')](moment(_0x49bffb[_0xf1ec('0x6e')],_0xf1ec('0x6f'))))[_0xf1ec('0x34')]('mm:ss');}switch(_0x49bffb[_0xf1ec('0x70')]){case _0xf1ec('0x71'):_0x46c534['Call_Result']='Called';break;case _0xf1ec('0x72'):case _0xf1ec('0x73'):_0x46c534[_0xf1ec('0x74')]=_0xf1ec('0x75');break;case _0xf1ec('0x76'):_0x46c534[_0xf1ec('0x74')]='Rejected';break;case _0xf1ec('0x77'):_0x46c534[_0xf1ec('0x74')]=_0xf1ec('0x78');break;case _0xf1ec('0x79'):_0x46c534['Call_Result']=_0xf1ec('0x7a');default:}_0x46c534[_0xf1ec('0x7b')]=(_0x5e6a4d==='outbound'?moment(_0x49bffb[_0xf1ec('0x6e')])[_0xf1ec('0x34')](_0xf1ec('0x6f')):moment(_0x49bffb[_0xf1ec('0x7c')])[_0xf1ec('0x34')](_0xf1ec('0x6f')))||moment()['format'](_0xf1ec('0x6f'));_0x46c534[_0xf1ec('0x7d')]=_0x5e6a4d||_0xf1ec('0x7e');_0x46c534=_[_0xf1ec('0x7f')](_0x46c534,getCustomFields(_0x2dfac3['Fields'],_0x49bffb));return request({'method':_0xf1ec('0x46'),'uri':_0xf1ec('0x47')+_0x4f2fcc+_0xf1ec('0x80'),'headers':{'Authorization':_0xf1ec('0x4e')+_0x151ed5},'body':{'data':[_0x46c534]},'json':!![]})['then'](function(_0x5164d3){if(_0x5164d3&&_0x5164d3['data'][0x0]['code']===_0xf1ec('0x50')){logger[_0xf1ec('0x31')](_0xf1ec('0x81'));return{'id':_0x5164d3[_0xf1ec('0x44')][0x0]['details']['id']};}})[_0xf1ec('0x43')](function(_0x33e8c8){logger[_0xf1ec('0x31')](_0xf1ec('0x82'),_0x33e8c8[_0xf1ec('0x30')]);console[_0xf1ec('0x52')]('err',_0x33e8c8);});}exports['queue']=function(_0x3c55ce,_0x126770,_0x3e8a81,_0x1aee2a,_0x4bc6d4,_0x22f92a){var _0x5f1b44,_0x338815,_0x229fb5;_0x22f92a[_0xf1ec('0x83')]=intUtil[_0xf1ec('0x84')](_0x22f92a['host']);_0x22f92a[_0xf1ec('0x85')]=intUtil[_0xf1ec('0x84')](_0x22f92a[_0xf1ec('0x85')]);if(_0x4bc6d4&&_0x4bc6d4[_0xf1ec('0x86')]){logger[_0xf1ec('0x31')](_0xf1ec('0x87'),_0xf1ec('0x88'));_0x126770[_0xf1ec('0x89')]=_0x22f92a[_0xf1ec('0x85')]+_0xf1ec('0x8a')+_0x126770['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x126770[_0xf1ec('0x8b')]);}else{_0x126770[_0xf1ec('0x89')]='';}var _0x1d86a2=_0x22f92a[_0xf1ec('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x22f92a)['then'](function(_0xeca96d){_0x229fb5=_0xeca96d;return getUser(_0x229fb5,_0x1d86a2,_0x22f92a,_0x1aee2a[_0xf1ec('0x3b')]);})[_0xf1ec('0x37')](function(_0x5f4b49){_0x5f1b44=_0x5f4b49;logger['info'](_0xf1ec('0x8c'),_0x5f1b44['id']);return getEndUser(_0x229fb5,_0x1d86a2,_0x22f92a,_0x126770[_0xf1ec('0x8d')],_0x126770[_0xf1ec('0x8e')],_0x5f1b44,_0x3e8a81);})[_0xf1ec('0x37')](function(_0x5e99a8){_0x338815=_0x5e99a8;return getCall(_0x229fb5,_0x1d86a2,_0x22f92a,_0x5f1b44,_0x338815,_0x3e8a81,_0x126770,_0xf1ec('0x7e'));})['then'](function(_0x46d7b8){if(_0x46d7b8){logger['info']('The\x20Call\x20ID\x20is:',_0x46d7b8['id']);logger[_0xf1ec('0x31')](_0xf1ec('0x87'),_0xf1ec('0x8f'));emit(util[_0xf1ec('0x34')](_0xf1ec('0x90'),_0x1aee2a[_0xf1ec('0x1d')]),_0xf1ec('0x91'),{'uri':_0xf1ec('0x92')+_0x22f92a[_0xf1ec('0x83')]+_0xf1ec('0x93')+_0x46d7b8['id']});}})[_0xf1ec('0x43')](function(_0x47a54d){logger[_0xf1ec('0x2e')]('[QUEUE]',JSON[_0xf1ec('0x11')](_0x47a54d));});};exports[_0xf1ec('0x94')]=function(_0x2724d1,_0x505e6e,_0x361b4b,_0x239e6f,_0x1686ed,_0x4cb4a5,_0xb01f1){var _0x17fec5,_0x12b32c,_0x514c17;_0x4cb4a5[_0xf1ec('0x83')]=intUtil[_0xf1ec('0x84')](_0x4cb4a5[_0xf1ec('0x83')]);_0x4cb4a5[_0xf1ec('0x85')]=intUtil[_0xf1ec('0x84')](_0x4cb4a5[_0xf1ec('0x85')]);if(_0xb01f1&&_0xb01f1['recordingFormat']&&_0xb01f1[_0xf1ec('0x95')]!==_0xf1ec('0x96')){logger[_0xf1ec('0x31')]('[OUTBOUND]',_0xf1ec('0x88'));_0x505e6e[_0xf1ec('0x89')]=_0x4cb4a5[_0xf1ec('0x85')]+'/api/voice/recordings/'+_0x505e6e[_0xf1ec('0x8b')]+_0xf1ec('0x97')+md5(_0x505e6e[_0xf1ec('0x8b')]);}var _0x12c829=_0x4cb4a5[_0xf1ec('0x83')]===_0xf1ec('0x98')?'eu':_0xf1ec('0x99');return getAccessToken(_0x4cb4a5)[_0xf1ec('0x37')](function(_0x19d37b){_0x514c17=_0x19d37b;return getUser(_0x514c17,_0x12c829,_0x4cb4a5,_0x239e6f['email']);})['then'](function(_0xb468){_0x17fec5=_0xb468;logger[_0xf1ec('0x31')](_0xf1ec('0x8c'),_0x17fec5['id']);return getEndUser(_0x514c17,_0x12c829,_0x4cb4a5,_0x505e6e[_0xf1ec('0x9a')],_0x505e6e[_0xf1ec('0x9b')],_0x17fec5,_0x361b4b);})['then'](function(_0x18926f){_0x12b32c=_0x18926f;return getCall(_0x514c17,_0x12c829,_0x4cb4a5,_0x17fec5,_0x12b32c,_0x361b4b,_0x505e6e,_0xf1ec('0x9c'));})['then'](function(_0x2b0f44){if(_0x2b0f44){logger[_0xf1ec('0x31')]('The\x20Call\x20ID\x20is:',_0x2b0f44['id']);logger[_0xf1ec('0x31')](_0xf1ec('0x9d'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf1ec('0x34')]('user:%s',_0x239e6f[_0xf1ec('0x1d')]),'trigger:browser:url',{'uri':_0xf1ec('0x92')+_0x4cb4a5[_0xf1ec('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2b0f44['id']});}})['catch'](function(_0x1c52cb){logger[_0xf1ec('0x2e')](_0xf1ec('0x9d'),JSON[_0xf1ec('0x11')](_0x1c52cb));});};exports[_0xf1ec('0x9e')]=function(_0x235a33,_0x4b97e3,_0x51ee01,_0x354102,_0x10f081,_0x4fa10d){var _0x3336b4,_0x58c1b4,_0x458bc7;_0x4fa10d[_0xf1ec('0x83')]=intUtil[_0xf1ec('0x84')](_0x4fa10d['host']);_0x4fa10d[_0xf1ec('0x85')]=intUtil['stripTrailingSlash'](_0x4fa10d[_0xf1ec('0x85')]);if(_0x10f081&&_0x10f081[_0xf1ec('0x86')]){logger[_0xf1ec('0x31')]('['+_0x4b97e3[_0xf1ec('0x70')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4b97e3[_0xf1ec('0x89')]=_0x4fa10d[_0xf1ec('0x85')]+_0xf1ec('0x8a')+_0x4b97e3['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x4b97e3[_0xf1ec('0x8b')]);}else{_0x4b97e3[_0xf1ec('0x89')]='';}var _0x592204=_0x4fa10d[_0xf1ec('0x83')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x4fa10d)[_0xf1ec('0x37')](function(_0x202616){_0x458bc7=_0x202616;return getUser(_0x458bc7,_0x592204,_0x4fa10d);})['then'](function(_0x3050c7){_0x3336b4=_0x3050c7;logger[_0xf1ec('0x31')](_0xf1ec('0x8c'),_0x3336b4['id']);return getEndUser(_0x458bc7,_0x592204,_0x4fa10d,_0x4b97e3[_0xf1ec('0x8d')],_0x4b97e3[_0xf1ec('0x8e')],_0x3336b4,_0x51ee01);})[_0xf1ec('0x37')](function(_0x3f49a9){_0x58c1b4=_0x3f49a9;return getCall(_0x458bc7,_0x592204,_0x4fa10d,_0x3336b4,_0x58c1b4,_0x51ee01,_0x4b97e3,_0xf1ec('0x7e'));})[_0xf1ec('0x37')](function(_0x286d22){if(_0x286d22){logger[_0xf1ec('0x31')](_0xf1ec('0x9f'),_0x286d22['id']);}})['catch'](function(_0x5a7342){logger['error']('['+_0x4b97e3[_0xf1ec('0x70')][_0xf1ec('0xa0')]()+']',JSON[_0xf1ec('0x11')](_0x5a7342));});}; \ No newline at end of file +var _0x5fae=['com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','outbound','recordingFormat','none','Recording\x20is\x20enabled!','recordingURL','destcalleridnum','Outbound','[OUTBOUND]','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','emit','[HTTP]','stringify','length','forEach','string','picklist','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','format','ActiveUsers','users','isArrayLikeObject','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','https://www.zohoapis.','/crm/v2/','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','data','details','startCase','Error:\x20','log','GET','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','moduleCreate','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','starttime','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu'];(function(_0x1f0692,_0x24909e){var _0x10931a=function(_0x1ad2e3){while(--_0x1ad2e3){_0x1f0692['push'](_0x1f0692['shift']());}};_0x10931a(++_0x24909e);}(_0x5fae,0x152));var _0xe5fa=function(_0x4ebec5,_0x54ab2f){_0x4ebec5=_0x4ebec5-0x0;var _0x31bb77=_0x5fae[_0x4ebec5];return _0x31bb77;};'use strict';var _=require(_0xe5fa('0x0'));var rp=require(_0xe5fa('0x1'));var md5=require(_0xe5fa('0x2'));var util=require(_0xe5fa('0x3'));var intUtil=require(_0xe5fa('0x4'));var moment=require(_0xe5fa('0x5'));var Redis=require(_0xe5fa('0x6'));var BPromise=require(_0xe5fa('0x7'));var config=require('../../../../config/environment');var logger=require(_0xe5fa('0x8'))(_0xe5fa('0x9'));config[_0xe5fa('0xa')]=_[_0xe5fa('0xb')](config[_0xe5fa('0xa')],{'host':_0xe5fa('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe5fa('0xa')]));function emit(_0x4087b8,_0x1d857a,_0x4bda75){io['to'](_0x4087b8)[_0xe5fa('0xd')](_0x1d857a,_0x4bda75);}function request(_0x36d955){logger['debug'](_0xe5fa('0xe'),JSON[_0xe5fa('0xf')](_0x36d955));return rp(_0x36d955);}function getCustomFields(_0x44544e,_0x308b77){var _0xed76f={};if(_0x44544e[_0xe5fa('0x10')]>0x0){_[_0xe5fa('0x11')](_0x44544e,function(_0x4c3008){if(_['includes']([_0xe5fa('0x12'),_0xe5fa('0x13')],_0x4c3008[_0xe5fa('0x14')])&&_0x4c3008[_0xe5fa('0x15')]){_0xed76f[_0x4c3008[_0xe5fa('0x15')]]=_0x4c3008['content'][_0xe5fa('0x16')]();}else if(_0x4c3008['type']===_0xe5fa('0x17')&&_0x4c3008[_0xe5fa('0x18')]&&_0x4c3008[_0xe5fa('0x15')]&&_0x308b77[_0x4c3008[_0xe5fa('0x18')]]){_0xed76f[_0x4c3008[_0xe5fa('0x15')]]=_0x308b77[_0x4c3008[_0xe5fa('0x18')]]['toString']();}else if(_0x4c3008[_0xe5fa('0x14')]===_0xe5fa('0x19')&&_0x4c3008['Variable']&&_0x4c3008['Variable']['name']&&_0x4c3008[_0xe5fa('0x15')]&&_0x308b77[_0x4c3008[_0xe5fa('0x1a')][_0xe5fa('0x1b')][_0xe5fa('0x1c')]()]){_0xed76f[_0x4c3008['idField']]=_0x308b77[_0x4c3008[_0xe5fa('0x1a')]['name'][_0xe5fa('0x1c')]()][_0xe5fa('0x16')]();}});}return _0xed76f;}function getName(_0x1dd6fc){if(_0x1dd6fc['indexOf']('\x20')>0x0){var _0x3156ca=_0x1dd6fc['split'](/ (.+)/);if(_0x3156ca[0x1]){return _0x3156ca;}}return[_0x1dd6fc,_0x1dd6fc];}var accountsTokens={};function getAccessToken(_0x50f1ef){return new Promise(function(_0x1b839d,_0x564dd6){if(!_[_0xe5fa('0x1d')](accountsTokens[_0x50f1ef['id']])&&!_[_0xe5fa('0x1d')](accountsTokens[_0x50f1ef['id']][_0xe5fa('0x1e')])){if(moment()[_0xe5fa('0x1f')](accountsTokens[_0x50f1ef['id']][_0xe5fa('0x20')])){_0x1b839d(accountsTokens[_0x50f1ef['id']]['access_token']);}}var _0x2839a4;switch(_0x50f1ef[_0xe5fa('0x21')]){case'US':_0x2839a4=_0xe5fa('0x22');break;case'AU':_0x2839a4=_0xe5fa('0x23');break;case'EU':_0x2839a4=_0xe5fa('0x24');break;case'IN':_0x2839a4=_0xe5fa('0x25');break;case'CN':_0x2839a4='https://accounts.zoho.com.cn';break;default:_0x2839a4=_0xe5fa('0x24');break;}var _0x43aa6f={'method':_0xe5fa('0x26'),'uri':_0x2839a4+_0xe5fa('0x27'),'qs':{'refresh_token':_0x50f1ef['refreshToken'],'client_id':_0x50f1ef[_0xe5fa('0x28')],'client_secret':_0x50f1ef[_0xe5fa('0x29')],'grant_type':_0xe5fa('0x2a')},'json':!![]};return rp(_0x43aa6f)[_0xe5fa('0x2b')](function(_0x1b433f){accountsTokens[_0x50f1ef['id']]={'access_token':_0x1b433f['access_token'],'expires_in':moment()[_0xe5fa('0x2c')](_0x1b433f[_0xe5fa('0x20')],_0xe5fa('0x2d'))};_0x1b839d(_0x1b433f[_0xe5fa('0x1e')]);})[_0xe5fa('0x2e')](function(_0x560975){logger['error'](_0xe5fa('0x2f'),_0x560975[_0xe5fa('0x30')]);_0x564dd6(_0x560975);});});}function getUser(_0x57e403,_0x2e6c1d,_0x2082f8,_0x5d2d2b){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0xe5fa('0x31')]('https://www.zohoapis.%s/crm/v2/users',_0x2e6c1d),'qs':{'type':_0xe5fa('0x32')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x57e403},'json':!![]})[_0xe5fa('0x2b')](function(_0x385c95){if(_0x385c95[_0xe5fa('0x33')]){var _0x5c805d=-0x1;if(_[_0xe5fa('0x34')](_0x385c95[_0xe5fa('0x33')])){if(!_[_0xe5fa('0x1d')](_0x5d2d2b)){_0x5c805d=_[_0xe5fa('0x35')](_0x385c95[_0xe5fa('0x33')],function(_0x27a257){return _0x27a257['email']===_0x5d2d2b;});}if(_0x5c805d>=0x0){logger['info'](_0xe5fa('0x36'));}else{logger[_0xe5fa('0x37')](_0xe5fa('0x38'));_0x5c805d=_['findIndex'](_0x385c95[_0xe5fa('0x33')],function(_0x5ca16d){return _0x5ca16d[_0xe5fa('0x39')]['name']==='Administrator';});}return _0x385c95[_0xe5fa('0x33')][_0x5c805d];}else{if(_0x385c95[_0xe5fa('0x3a')][_0xe5fa('0x39')][_0xe5fa('0x1b')]===_0xe5fa('0x3b')){logger[_0xe5fa('0x37')]('Using\x20the\x20admin\x20account!');user=_0x385c95['user'];return user;}else{logger[_0xe5fa('0x3c')](_0xe5fa('0x3d'),JSON[_0xe5fa('0xf')](_0x385c95));throw new Error(_0xe5fa('0x3e')+JSON[_0xe5fa('0xf')](_0x385c95));}}}else{logger['error'](_0xe5fa('0x3d'),JSON['stringify'](_0x385c95));throw new Error(_0xe5fa('0x3e')+JSON[_0xe5fa('0xf')](_0x385c95));}})[_0xe5fa('0x2e')](function(_0x6be281){console[_0xe5fa('0x3c')](_0x6be281);});}function getZohoUser(_0x35aa53,_0x11ac5b){return new BPromise(function(_0x504047,_0x3c5064){request(_0x35aa53)[_0xe5fa('0x2b')](function(_0x3729ec){var _0x3f5fa3=null;if(_0x3729ec){_0x3f5fa3=_0x3729ec['data'][0x0];_0x3f5fa3[_0xe5fa('0x3f')]=_0x11ac5b;}_0x504047(_0x3f5fa3);})[_0xe5fa('0x2e')](function(_0x106b25){_0x3c5064(_0x106b25);});});}function createEndUser(_0xa46f8e,_0x507dd8,_0x4baa92,_0x40d8f4,_0x4f8222,_0x2385f2){var _0x4baa92=getName(_0x4baa92);return request({'method':_0xe5fa('0x26'),'uri':_0xe5fa('0x40')+_0x507dd8+_0xe5fa('0x41')+_['startCase'](_0x2385f2['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x4baa92[0x1],'First_Name':_0x4baa92[0x0],'Phone':_0x40d8f4,'Owner':{'name':!_[_0xe5fa('0x1d')](_0x4f8222[_0xe5fa('0x42')]['name'])?_0x4f8222[_0xe5fa('0x42')]['name']:!_['isNil'](_0x4f8222[_0xe5fa('0x43')])?_0x4f8222[_0xe5fa('0x43')]+'\x20'+_0x4f8222[_0xe5fa('0x44')]:_0x4f8222[_0xe5fa('0x44')],'id':_0x4f8222['id']}}]},'headers':{'Authorization':_0xe5fa('0x45')+_0xa46f8e},'json':!![]})[_0xe5fa('0x2b')](function(_0x2e8312){if(_0x2e8312&&_0x2e8312['data'][0x0][_0xe5fa('0x46')]===_0xe5fa('0x47')){var _0x18c770=_0x2e8312[_0xe5fa('0x48')][0x0][_0xe5fa('0x49')];_0x18c770[_0xe5fa('0x3f')]=_[_0xe5fa('0x4a')](_0x2385f2['moduleCreate'])+'s';return _0x18c770;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xe5fa('0xf')](data));throw new Error(_0xe5fa('0x4b')+JSON['stringify'](data));})['catch'](function(_0x3356ad){console[_0xe5fa('0x4c')]('CREATE\x20ERROR',_0x3356ad);});}function getEndUser(_0x392510,_0x64fb4a,_0x252025,_0x4cf74f,_0x36c696,_0x27d77c,_0x26469a){var _0x4748aa={'method':_0xe5fa('0x4d'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x392510},'json':!![]};switch(_0x26469a[_0xe5fa('0x4e')]){case _0xe5fa('0x4f'):_0x4748aa[_0xe5fa('0x50')]=_0xe5fa('0x40')+_0x64fb4a+_0xe5fa('0x51')+_0x36c696+'))';return getZohoUser(_0x4748aa,_0xe5fa('0x52'))['then'](function(_0xa49762){if(_0xa49762)return _0xa49762;_0x4748aa[_0xe5fa('0x50')]=_0xe5fa('0x40')+_0x64fb4a+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x36c696+'))';return getZohoUser(_0x4748aa,_0xe5fa('0x53'))[_0xe5fa('0x2b')](function(_0x4f55c6){if(_0x4f55c6)return _0x4f55c6;if(_0x26469a['moduleCreate']!=_0xe5fa('0x54')){return createEndUser(_0x392510,_0x64fb4a,_0x4cf74f,_0x36c696,_0x27d77c,_0x26469a);}else{return{};}});});break;case _0xe5fa('0x55'):_0x4748aa[_0xe5fa('0x50')]=_0xe5fa('0x40')+_0x64fb4a+_0xe5fa('0x51')+_0x36c696+'))';return getZohoUser(_0x4748aa,_0xe5fa('0x52'))[_0xe5fa('0x2b')](function(_0x1a7153){if(_0x1a7153)return _0x1a7153;if(_0x26469a[_0xe5fa('0x56')]!=_0xe5fa('0x54')){return createEndUser(_0x392510,_0x64fb4a,_0x4cf74f,_0x36c696,_0x27d77c,_0x26469a);}else{return{};}});break;case'lead':_0x4748aa[_0xe5fa('0x50')]='https://www.zohoapis.'+_0x64fb4a+_0xe5fa('0x57')+_0x36c696+'))';return getZohoUser(_0x4748aa,'Leads')['then'](function(_0x9040b){if(_0x9040b)return _0x9040b;if(_0x26469a[_0xe5fa('0x56')]!=_0xe5fa('0x54')){return createEndUser(_0x392510,_0x64fb4a,_0x4cf74f,_0x36c696,_0x27d77c,_0x26469a);}else{return{};}});break;}}function getCall(_0x25ee8d,_0x2e48f4,_0x4b9e9e,_0x3a6cf4,_0x12f601,_0x2e5191,_0x705531,_0x5473c6){logger[_0xe5fa('0x37')]('Creating\x20new\x20call...');var _0x55a01c={};_0x55a01c[_0xe5fa('0x58')]={'name':!_['isNil'](_0x3a6cf4['role']['name'])&&!_[_0xe5fa('0x1d')](_0x3a6cf4['profile'][_0xe5fa('0x1b')])&&_0x3a6cf4[_0xe5fa('0x39')][_0xe5fa('0x1b')]===_0xe5fa('0x59')?_0x3a6cf4[_0xe5fa('0x42')][_0xe5fa('0x1b')]:!_['isNil'](_0x3a6cf4[_0xe5fa('0x43')])?_0x3a6cf4[_0xe5fa('0x43')]+'\x20'+_0x3a6cf4[_0xe5fa('0x44')]:_0x3a6cf4[_0xe5fa('0x44')],'id':_0x3a6cf4['id']};_0x55a01c[_0xe5fa('0x5a')]=intUtil[_0xe5fa('0x5b')](_0x2e5191['Subjects'],_0x705531,'\x20');_0x55a01c[_0xe5fa('0x5c')]=intUtil[_0xe5fa('0x5b')](_0x2e5191[_0xe5fa('0x5d')],_0x705531,'\x0a');if(_0x12f601['enduserType']==='Contacts'){_0x55a01c[_0xe5fa('0x5e')]={'name':!_[_0xe5fa('0x1d')](_0x12f601[_0xe5fa('0x5f')])?_0x12f601['Full_Name']:!_[_0xe5fa('0x1d')](_0x12f601[_0xe5fa('0x60')])?_0x12f601[_0xe5fa('0x60')]+'\x20'+_0x12f601[_0xe5fa('0x61')]:_0x12f601['Last_Name'],'id':_0x12f601['id']};}if(_0x12f601[_0xe5fa('0x3f')]===_0xe5fa('0x53')){_0x55a01c[_0xe5fa('0x62')]={'name':!_[_0xe5fa('0x1d')](_0x12f601[_0xe5fa('0x5f')])?_0x12f601[_0xe5fa('0x5f')]:!_[_0xe5fa('0x1d')](_0x12f601[_0xe5fa('0x60')])?_0x12f601['First_Name']+'\x20'+_0x12f601[_0xe5fa('0x61')]:_0x12f601[_0xe5fa('0x61')],'id':_0x12f601['id']};_0x55a01c[_0xe5fa('0x63')]=_['startCase'](_0x12f601[_0xe5fa('0x3f')]);}if(_0x705531[_0xe5fa('0x64')]){_0x55a01c[_0xe5fa('0x65')]=moment[_0xe5fa('0x66')](parseInt(_0x705531[_0xe5fa('0x64')])*0x3e8)[_0xe5fa('0x31')]('mm:ss');}else if(_0x705531[_0xe5fa('0x67')]&&_0x705531['endtime']){_0x55a01c['Call_Duration']=moment[_0xe5fa('0x66')](moment(_0x705531[_0xe5fa('0x68')],_0xe5fa('0x69'))[_0xe5fa('0x6a')](moment(_0x705531['starttime'],'YYYY-MM-DDTHH:mm:ss')))['format'](_0xe5fa('0x6b'));}switch(_0x705531[_0xe5fa('0x6c')]){case _0xe5fa('0x6d'):_0x55a01c['Call_Result']=_0xe5fa('0x6e');break;case _0xe5fa('0x6f'):case _0xe5fa('0x70'):_0x55a01c[_0xe5fa('0x71')]=_0xe5fa('0x72');break;case _0xe5fa('0x73'):_0x55a01c[_0xe5fa('0x71')]='Rejected';break;case _0xe5fa('0x74'):_0x55a01c[_0xe5fa('0x71')]='Abandoned';break;case _0xe5fa('0x75'):_0x55a01c[_0xe5fa('0x71')]=_0xe5fa('0x76');default:}_0x55a01c[_0xe5fa('0x77')]=(_0x5473c6==='outbound'?moment(_0x705531[_0xe5fa('0x78')])[_0xe5fa('0x31')](_0xe5fa('0x69')):moment(_0x705531['agentcalledAt'])[_0xe5fa('0x31')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x55a01c[_0xe5fa('0x79')]=_0x5473c6||_0xe5fa('0x7a');_0x55a01c=_[_0xe5fa('0x7b')](_0x55a01c,getCustomFields(_0x2e5191[_0xe5fa('0x7c')],_0x705531));return request({'method':_0xe5fa('0x26'),'uri':_0xe5fa('0x40')+_0x2e48f4+_0xe5fa('0x7d'),'headers':{'Authorization':_0xe5fa('0x45')+_0x25ee8d},'body':{'data':[_0x55a01c]},'json':!![]})[_0xe5fa('0x2b')](function(_0x598eb2){if(_0x598eb2&&_0x598eb2[_0xe5fa('0x48')][0x0][_0xe5fa('0x46')]===_0xe5fa('0x47')){logger['info'](_0xe5fa('0x7e'));return{'id':_0x598eb2['data'][0x0][_0xe5fa('0x49')]['id']};}})[_0xe5fa('0x2e')](function(_0x3f2c4f){logger[_0xe5fa('0x37')](_0xe5fa('0x7f'),_0x3f2c4f[_0xe5fa('0x30')]);console[_0xe5fa('0x4c')](_0xe5fa('0x7f'),_0x3f2c4f);});}exports['queue']=function(_0x74c14f,_0x489197,_0xe3c076,_0x312f4b,_0x39327b,_0xa3685b){var _0x4a677d,_0x56a9a7,_0x43114a;_0xa3685b['host']=intUtil[_0xe5fa('0x80')](_0xa3685b[_0xe5fa('0x81')]);_0xa3685b[_0xe5fa('0x82')]=intUtil[_0xe5fa('0x80')](_0xa3685b[_0xe5fa('0x82')]);if(_0x39327b&&_0x39327b[_0xe5fa('0x83')]){logger[_0xe5fa('0x37')]('[QUEUE]','Recording\x20is\x20enabled!');_0x489197['recordingURL']=_0xa3685b[_0xe5fa('0x82')]+_0xe5fa('0x84')+_0x489197[_0xe5fa('0x85')]+_0xe5fa('0x86')+md5(_0x489197[_0xe5fa('0x85')]);}else{_0x489197['recordingURL']='';}var _0x5f503e=_0xa3685b[_0xe5fa('0x81')]===_0xe5fa('0x87')?'eu':_0xe5fa('0x88');return getAccessToken(_0xa3685b)[_0xe5fa('0x2b')](function(_0x540c6f){_0x43114a=_0x540c6f;return getUser(_0x43114a,_0x5f503e,_0xa3685b,_0x312f4b[_0xe5fa('0x89')]);})['then'](function(_0x1c67de){_0x4a677d=_0x1c67de;logger[_0xe5fa('0x37')](_0xe5fa('0x8a'),_0x4a677d['id']);return getEndUser(_0x43114a,_0x5f503e,_0xa3685b,_0x489197[_0xe5fa('0x8b')],_0x489197[_0xe5fa('0x8c')],_0x4a677d,_0xe3c076);})['then'](function(_0x570a67){_0x56a9a7=_0x570a67;return getCall(_0x43114a,_0x5f503e,_0xa3685b,_0x4a677d,_0x56a9a7,_0xe3c076,_0x489197,_0xe5fa('0x7a'));})[_0xe5fa('0x2b')](function(_0x239bb0){if(_0x239bb0){logger['info'](_0xe5fa('0x8d'),_0x239bb0['id']);logger[_0xe5fa('0x37')](_0xe5fa('0x8e'),_0xe5fa('0x8f'));emit(util[_0xe5fa('0x31')](_0xe5fa('0x90'),_0x312f4b['name']),_0xe5fa('0x91'),{'uri':_0xe5fa('0x92')+_0xa3685b[_0xe5fa('0x81')]+'/crm/EntityInfo.do?module=Calls&id='+_0x239bb0['id']});}})[_0xe5fa('0x2e')](function(_0x9712e8){logger[_0xe5fa('0x3c')](_0xe5fa('0x8e'),JSON[_0xe5fa('0xf')](_0x9712e8));});};exports[_0xe5fa('0x93')]=function(_0x11caeb,_0x426298,_0x511396,_0xdd16d,_0x5841e3,_0x54c4a0,_0x223b86){var _0x436389,_0x1eefaf,_0x4e1ffc;_0x54c4a0['host']=intUtil['stripTrailingSlash'](_0x54c4a0[_0xe5fa('0x81')]);_0x54c4a0[_0xe5fa('0x82')]=intUtil['stripTrailingSlash'](_0x54c4a0[_0xe5fa('0x82')]);if(_0x223b86&&_0x223b86[_0xe5fa('0x94')]&&_0x223b86['recordingFormat']!==_0xe5fa('0x95')){logger[_0xe5fa('0x37')]('[OUTBOUND]',_0xe5fa('0x96'));_0x426298[_0xe5fa('0x97')]=_0x54c4a0['serverUrl']+_0xe5fa('0x84')+_0x426298['uniqueid']+_0xe5fa('0x86')+md5(_0x426298[_0xe5fa('0x85')]);}var _0xdb31c6=_0x54c4a0[_0xe5fa('0x81')]===_0xe5fa('0x87')?'eu':_0xe5fa('0x88');return getAccessToken(_0x54c4a0)['then'](function(_0x41c242){_0x4e1ffc=_0x41c242;return getUser(_0x4e1ffc,_0xdb31c6,_0x54c4a0,_0xdd16d[_0xe5fa('0x89')]);})[_0xe5fa('0x2b')](function(_0x1b5e31){_0x436389=_0x1b5e31;logger[_0xe5fa('0x37')](_0xe5fa('0x8a'),_0x436389['id']);return getEndUser(_0x4e1ffc,_0xdb31c6,_0x54c4a0,_0x426298['destcalleridname'],_0x426298[_0xe5fa('0x98')],_0x436389,_0x511396);})[_0xe5fa('0x2b')](function(_0x16e53f){_0x1eefaf=_0x16e53f;return getCall(_0x4e1ffc,_0xdb31c6,_0x54c4a0,_0x436389,_0x1eefaf,_0x511396,_0x426298,_0xe5fa('0x99'));})[_0xe5fa('0x2b')](function(_0x3fad8f){if(_0x3fad8f){logger[_0xe5fa('0x37')](_0xe5fa('0x8d'),_0x3fad8f['id']);logger[_0xe5fa('0x37')](_0xe5fa('0x9a'),_0xe5fa('0x8f'));emit(util[_0xe5fa('0x31')](_0xe5fa('0x90'),_0xdd16d[_0xe5fa('0x1b')]),_0xe5fa('0x91'),{'uri':_0xe5fa('0x92')+_0x54c4a0[_0xe5fa('0x81')]+_0xe5fa('0x9b')+_0x3fad8f['id']});}})[_0xe5fa('0x2e')](function(_0x4141ce){logger[_0xe5fa('0x3c')]('[OUTBOUND]',JSON[_0xe5fa('0xf')](_0x4141ce));});};exports[_0xe5fa('0x9c')]=function(_0x4f040b,_0x3e9fdf,_0x4de479,_0x3ec6f7,_0x171baf,_0x1ff996){var _0x454459,_0x5eebb3,_0x37f5a6;_0x1ff996[_0xe5fa('0x81')]=intUtil['stripTrailingSlash'](_0x1ff996['host']);_0x1ff996[_0xe5fa('0x82')]=intUtil[_0xe5fa('0x80')](_0x1ff996[_0xe5fa('0x82')]);if(_0x171baf&&_0x171baf[_0xe5fa('0x83')]){logger[_0xe5fa('0x37')]('['+_0x3e9fdf['lastevent'][_0xe5fa('0x9d')]()+']',_0xe5fa('0x96'));_0x3e9fdf[_0xe5fa('0x97')]=_0x1ff996['serverUrl']+'/api/voice/recordings/'+_0x3e9fdf[_0xe5fa('0x85')]+_0xe5fa('0x86')+md5(_0x3e9fdf[_0xe5fa('0x85')]);}else{_0x3e9fdf['recordingURL']='';}var _0x10ec2b=_0x1ff996['host']==='zoho.eu'?'eu':_0xe5fa('0x88');return getAccessToken(_0x1ff996)[_0xe5fa('0x2b')](function(_0x2c82c5){_0x37f5a6=_0x2c82c5;return getUser(_0x37f5a6,_0x10ec2b,_0x1ff996);})[_0xe5fa('0x2b')](function(_0xe5b82){_0x454459=_0xe5b82;logger['info'](_0xe5fa('0x8a'),_0x454459['id']);return getEndUser(_0x37f5a6,_0x10ec2b,_0x1ff996,_0x3e9fdf['calleridname'],_0x3e9fdf[_0xe5fa('0x8c')],_0x454459,_0x4de479);})[_0xe5fa('0x2b')](function(_0x3f8a14){_0x5eebb3=_0x3f8a14;return getCall(_0x37f5a6,_0x10ec2b,_0x1ff996,_0x454459,_0x5eebb3,_0x4de479,_0x3e9fdf,_0xe5fa('0x7a'));})['then'](function(_0x39e570){if(_0x39e570){logger[_0xe5fa('0x37')](_0xe5fa('0x8d'),_0x39e570['id']);}})[_0xe5fa('0x2e')](function(_0x31711d){logger[_0xe5fa('0x3c')]('['+_0x3e9fdf[_0xe5fa('0x6c')][_0xe5fa('0x9d')]()+']',JSON[_0xe5fa('0xf')](_0x31711d));});}; \ 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 2a9f75c..6fc9383 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 _0xaad5=['trigger','exec','data2','Script','data3','render','error','format','util','mustache','../../../../config/logger'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xaad5,0x168));var _0x5aad=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xaad5[_0x24061a];return _0x82054e;};'use strict';var util=require(_0x5aad('0x0'));var sh=require('shelljs');var Mustache=require(_0x5aad('0x1'));var logger=require(_0x5aad('0x2'))(_0x5aad('0x3'));exports[_0x5aad('0x4')]=function(_0x468f70,_0x217f3d){var _0x7ab00b=_0x468f70[_0x5aad('0x5')]?_0x468f70[_0x5aad('0x5')]:_0x5aad('0x6');var _0x1ef38e=_0x468f70[_0x5aad('0x7')]?Mustache[_0x5aad('0x8')](_0x468f70[_0x5aad('0x7')],_0x217f3d):_0x217f3d;sh['exec'](_0x1ef38e,function(_0x4c8b33,_0x87fbb,_0x9b8190){if(_0x4c8b33!==0x0){logger[_0x5aad('0x9')](util['format']('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x7ab00b,_0x1ef38e,_0x4c8b33,_0x9b8190));}else{logger['info'](util[_0x5aad('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x7ab00b,_0x1ef38e,_0x87fbb));}});}; \ No newline at end of file +var _0x3393=['data2','Script','render','data3','exec','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','shelljs','trigger'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x3393,0x17a));var _0x3339=function(_0x1aae06,_0x4990c7){_0x1aae06=_0x1aae06-0x0;var _0x37bf56=_0x3393[_0x1aae06];return _0x37bf56;};'use strict';var util=require('util');var sh=require(_0x3339('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x3339('0x1'));exports['exec']=function(_0x224838,_0xfe2a77){var _0x69251=_0x224838[_0x3339('0x2')]?_0x224838['data2']:_0x3339('0x3');var _0x17a591=_0x224838['data3']?Mustache[_0x3339('0x4')](_0x224838[_0x3339('0x5')],_0xfe2a77):_0xfe2a77;sh[_0x3339('0x6')](_0x17a591,function(_0x2b1e43,_0xff668c,_0x1f102e){if(_0x2b1e43!==0x0){logger['error'](util['format'](_0x3339('0x7'),_0x69251,_0x17a591,_0x2b1e43,_0x1f102e));}else{logger[_0x3339('0x8')](util[_0x3339('0x9')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x69251,_0x17a591,_0xff668c));}});}; \ 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 f4a452d..9609d45 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 _0x54d1=['data6','error','stack','POST','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','util','mustache','trigger','data1','toUpperCase','render','data2','data5','number'];(function(_0x4a2c8f,_0xea2882){var _0x2aeb38=function(_0x3b7372){while(--_0x3b7372){_0x4a2c8f['push'](_0x4a2c8f['shift']());}};_0x2aeb38(++_0xea2882);}(_0x54d1,0xe6));var _0x154d=function(_0x3b7816,_0x30fca7){_0x3b7816=_0x3b7816-0x0;var _0x5b7042=_0x54d1[_0x3b7816];return _0x5b7042;};'use strict';var rp=require(_0x154d('0x0'));var util=require(_0x154d('0x1'));var _=require('lodash');var Mustache=require(_0x154d('0x2'));var logger=require('../../../../config/logger')(_0x154d('0x3'));exports['exec']=function(_0x467a1c,_0x35484d){var _0x58dfce,_0x310c52;var _0x51787a={'method':_0x467a1c[_0x154d('0x4')][_0x154d('0x5')](),'uri':Mustache[_0x154d('0x6')](_0x467a1c[_0x154d('0x7')],_0x35484d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x467a1c[_0x154d('0x8')])===_0x154d('0x9')&&parseInt(_0x467a1c[_0x154d('0x8')])>=0x1&&parseInt(_0x467a1c[_0x154d('0x8')])<=0xa?parseInt(_0x467a1c['data5'])*0x3e8:0x5*0x3e8};try{_0x51787a['headers']=_0x467a1c[_0x154d('0xa')]?JSON['parse'](Mustache['render'](_0x467a1c[_0x154d('0xa')],_0x35484d)):{};}catch(_0x3c7224){logger[_0x154d('0xb')](_0x3c7224[_0x154d('0xc')]);}switch(_0x467a1c['data1'][_0x154d('0x5')]()){case'GET':case'DELETE':_0x58dfce=null;_0x51787a['qs']=_0x35484d;break;case _0x154d('0xd'):case _0x154d('0xe'):if(_0x467a1c[_0x154d('0xf')]){try{_0x58dfce=JSON[_0x154d('0x10')](Mustache[_0x154d('0x6')](_0x467a1c['data7'],_0x35484d));_0x51787a[_0x154d('0x11')]=_0x58dfce;}catch(_0x3eedef){logger[_0x154d('0xb')](_0x3eedef[_0x154d('0xc')]);logger[_0x154d('0xb')](_0x154d('0x12'));}}else{_0x58dfce=_0x35484d;_0x51787a['body']=_0x58dfce;}break;}logger[_0x154d('0x13')](util[_0x154d('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x467a1c[_0x154d('0x4')],_0x467a1c['data2'],JSON[_0x154d('0x15')](_0x51787a)));rp(_0x51787a)['then'](function(_0x3bab10){_0x58dfce=!_[_0x154d('0x16')](_0x58dfce)?_0x154d('0x17')+_0x58dfce:'';_0x310c52=typeof _0x3bab10[_0x154d('0x11')]===_0x154d('0x18')?JSON[_0x154d('0x15')](_0x3bab10[_0x154d('0x11')]):_0x3bab10['body'];logger[_0x154d('0x13')](util[_0x154d('0x14')](_0x154d('0x19'),_0x467a1c[_0x154d('0x4')],_0x467a1c[_0x154d('0x7')],_0x3bab10['statusCode'],_0x310c52));})['catch'](function(_0x4f2d4f){logger[_0x154d('0xb')](util['format'](_0x154d('0x1a'),_0x467a1c['data1'],_0x467a1c[_0x154d('0x7')],_0x4f2d4f[_0x154d('0x1b')],_0x4f2d4f[_0x154d('0x1c')],_0x4f2d4f[_0x154d('0x1d')]));});}; \ No newline at end of file +var _0x9f8b=['isNil','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','headers','data6','GET','DELETE','POST','PUT','data7','parse','body','error','stack','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then'];(function(_0x1406c8,_0x40a801){var _0x3ec6f8=function(_0xc1183a){while(--_0xc1183a){_0x1406c8['push'](_0x1406c8['shift']());}};_0x3ec6f8(++_0x40a801);}(_0x9f8b,0x117));var _0xb9f8=function(_0x404cde,_0x27b51c){_0x404cde=_0x404cde-0x0;var _0x139882=_0x9f8b[_0x404cde];return _0x139882;};'use strict';var rp=require(_0xb9f8('0x0'));var util=require(_0xb9f8('0x1'));var _=require(_0xb9f8('0x2'));var Mustache=require('mustache');var logger=require(_0xb9f8('0x3'))(_0xb9f8('0x4'));exports[_0xb9f8('0x5')]=function(_0x48c03e,_0x4d62ab){var _0x546b5f,_0x2b3267;var _0x23b940={'method':_0x48c03e[_0xb9f8('0x6')][_0xb9f8('0x7')](),'uri':Mustache[_0xb9f8('0x8')](_0x48c03e['data2'],_0x4d62ab),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x48c03e[_0xb9f8('0x9')])===_0xb9f8('0xa')&&parseInt(_0x48c03e[_0xb9f8('0x9')])>=0x1&&parseInt(_0x48c03e[_0xb9f8('0x9')])<=0xa?parseInt(_0x48c03e[_0xb9f8('0x9')])*0x3e8:0x5*0x3e8};try{_0x23b940[_0xb9f8('0xb')]=_0x48c03e[_0xb9f8('0xc')]?JSON['parse'](Mustache['render'](_0x48c03e[_0xb9f8('0xc')],_0x4d62ab)):{};}catch(_0x991f4a){logger['error'](_0x991f4a['stack']);}switch(_0x48c03e[_0xb9f8('0x6')]['toUpperCase']()){case _0xb9f8('0xd'):case _0xb9f8('0xe'):_0x546b5f=null;_0x23b940['qs']=_0x4d62ab;break;case _0xb9f8('0xf'):case _0xb9f8('0x10'):if(_0x48c03e[_0xb9f8('0x11')]){try{_0x546b5f=JSON[_0xb9f8('0x12')](Mustache['render'](_0x48c03e[_0xb9f8('0x11')],_0x4d62ab));_0x23b940[_0xb9f8('0x13')]=_0x546b5f;}catch(_0x4d443e){logger[_0xb9f8('0x14')](_0x4d443e[_0xb9f8('0x15')]);logger[_0xb9f8('0x14')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x546b5f=_0x4d62ab;_0x23b940[_0xb9f8('0x13')]=_0x546b5f;}break;}logger[_0xb9f8('0x16')](util['format'](_0xb9f8('0x17'),_0x48c03e[_0xb9f8('0x6')],_0x48c03e[_0xb9f8('0x18')],JSON[_0xb9f8('0x19')](_0x23b940)));rp(_0x23b940)[_0xb9f8('0x1a')](function(_0x4d6f48){_0x546b5f=!_[_0xb9f8('0x1b')](_0x546b5f)?',\x20request\x20body:\x20'+_0x546b5f:'';_0x2b3267=typeof _0x4d6f48[_0xb9f8('0x13')]==='object'?JSON[_0xb9f8('0x19')](_0x4d6f48[_0xb9f8('0x13')]):_0x4d6f48[_0xb9f8('0x13')];logger[_0xb9f8('0x16')](util[_0xb9f8('0x1c')](_0xb9f8('0x1d'),_0x48c03e['data1'],_0x48c03e[_0xb9f8('0x18')],_0x4d6f48[_0xb9f8('0x1e')],_0x2b3267));})[_0xb9f8('0x1f')](function(_0x56730e){logger[_0xb9f8('0x14')](util[_0xb9f8('0x1c')](_0xb9f8('0x20'),_0x48c03e[_0xb9f8('0x6')],_0x48c03e[_0xb9f8('0x18')],_0x56730e[_0xb9f8('0x1e')],_0x56730e[_0xb9f8('0x21')],_0x56730e['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index bdd1aa0..ab73bdc 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 _0x8153=['routing','client','http','Request','then','debug','rpc','error','result','catch','exports','jayson/promise'];(function(_0x2fc666,_0x19ed60){var _0x333166=function(_0x5b643){while(--_0x5b643){_0x2fc666['push'](_0x2fc666['shift']());}};_0x333166(++_0x19ed60);}(_0x8153,0x1af));var _0x3815=function(_0x4dbb4a,_0x2f489e){_0x4dbb4a=_0x4dbb4a-0x0;var _0x1d3bad=_0x8153[_0x4dbb4a];return _0x1d3bad;};'use strict';var jayson=require(_0x3815('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x3815('0x1'));var client=jayson[_0x3815('0x2')][_0x3815('0x3')]({'port':0x2329});client[_0x3815('0x4')]=function(_0x5ec988,_0x3270df){return new BPromise(function(_0x1a3570,_0x40a0a6){return client['request'](_0x5ec988,_0x3270df)[_0x3815('0x5')](function(_0x51195c){logger[_0x3815('0x6')](_0x3815('0x7'),_0x3815('0x1'),_0x5ec988,_0x3270df,_0x51195c);if(_0x51195c[_0x3815('0x8')]){logger[_0x3815('0x8')](_0x3815('0x7'),_0x3815('0x1'),_0x5ec988,_0x51195c['error']['message'],_0x3270df);return _0x40a0a6(_0x51195c['error']['message']);}else{return _0x1a3570(_0x51195c[_0x3815('0x9')]);}})[_0x3815('0xa')](function(_0x12e716){logger['error'](_0x3815('0x7'),_0x3815('0x1'),_0x5ec988,_0x12e716,_0x3270df);return _0x40a0a6(_0x12e716);});});};module[_0x3815('0xb')]=client; \ No newline at end of file +var _0xfc27=['catch','jayson/promise','routing','http','Request','then','debug','rpc','error','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc27,0x1ae));var _0x7fc2=function(_0x24d2a0,_0x44a3c5){_0x24d2a0=_0x24d2a0-0x0;var _0x1866b4=_0xfc27[_0x24d2a0];return _0x1866b4;};'use strict';var jayson=require(_0x7fc2('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x7fc2('0x1'));var client=jayson['client'][_0x7fc2('0x2')]({'port':0x2329});client[_0x7fc2('0x3')]=function(_0x107c81,_0x162860){return new BPromise(function(_0x885ceb,_0x13a661){return client['request'](_0x107c81,_0x162860)[_0x7fc2('0x4')](function(_0x3d417e){logger[_0x7fc2('0x5')](_0x7fc2('0x6'),'routing',_0x107c81,_0x162860,_0x3d417e);if(_0x3d417e[_0x7fc2('0x7')]){logger[_0x7fc2('0x7')](_0x7fc2('0x6'),_0x7fc2('0x1'),_0x107c81,_0x3d417e['error'][_0x7fc2('0x8')],_0x162860);return _0x13a661(_0x3d417e[_0x7fc2('0x7')][_0x7fc2('0x8')]);}else{return _0x885ceb(_0x3d417e[_0x7fc2('0x9')]);}})[_0x7fc2('0xa')](function(_0x519ab1){logger[_0x7fc2('0x7')](_0x7fc2('0x6'),_0x7fc2('0x1'),_0x107c81,_0x519ab1,_0x162860);return _0x13a661(_0x519ab1);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 6586e7c..a7409b2 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 _0x73f7=['mailAccounts','listen','getSettings','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','resolve','then','refresh'];(function(_0x1832fd,_0x5236b8){var _0x1d5881=function(_0x49cd1a){while(--_0x49cd1a){_0x1832fd['push'](_0x1832fd['shift']());}};_0x1d5881(++_0x5236b8);}(_0x73f7,0xc7));var _0x773f=function(_0x3e4e8a,_0x5a190d){_0x3e4e8a=_0x3e4e8a-0x0;var _0x48f74b=_0x73f7[_0x3e4e8a];return _0x48f74b;};'use strict';var server=require(_0x773f('0x0'));var Realtime=require(_0x773f('0x1'));var EmailChannel=require(_0x773f('0x2'));var mailAccount=require(_0x773f('0x3'));var setting=require(_0x773f('0x4'));var logger=require(_0x773f('0x5'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x773f('0x6')]()['then'](mailAccount['getMailAccounts']())[_0x773f('0x7')](realtime['initMailAccounts']())[_0x773f('0x7')](function(){email[_0x773f('0x8')](realtime[_0x773f('0x9')]);return realtime;});}function main(){return server[_0x773f('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0x773f('0x7')](function(){return setting[_0x773f('0xb')]();})[_0x773f('0x7')](function(_0x597b36){return setInterval(initRealtime,_0x597b36['loginMailFrequency']*0x3e8);})['catch'](function(_0x3b6623){logger['error'](_0x773f('0xc'),_0x3b6623);});}main(); \ No newline at end of file +var _0x88a1=['Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','email','resolve','then','getMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','error'];(function(_0x21331b,_0x447e4d){var _0x3b6c20=function(_0xf3a33){while(--_0xf3a33){_0x21331b['push'](_0x21331b['shift']());}};_0x3b6c20(++_0x447e4d);}(_0x88a1,0x187));var _0x188a=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0x88a1[_0x5de1bc];return _0x19f4b8;};'use strict';var server=require(_0x188a('0x0'));var Realtime=require(_0x188a('0x1'));var EmailChannel=require(_0x188a('0x2'));var mailAccount=require(_0x188a('0x3'));var setting=require(_0x188a('0x4'));var logger=require('../../config/logger')(_0x188a('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x188a('0x6')]()[_0x188a('0x7')](mailAccount[_0x188a('0x8')]())['then'](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0x188a('0x9')]);return realtime;});}function main(){return server[_0x188a('0xa')](realtime,email)[_0x188a('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0x188a('0xb')]();})[_0x188a('0x7')](function(_0x3e0c77){return setInterval(initRealtime,_0x3e0c77[_0x188a('0xc')]*0x3e8);})['catch'](function(_0x5426e7){logger[_0x188a('0xd')](_0x188a('0xe'),_0x5426e7);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 3366cd7..1313d5a 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 _0xc2a7=['socket.io-emitter','info','mailAccounts','imapAccounts','prototype','name','key','Imap','messageStatus','total','isNil','stringify','mailAccount:update','hasOwnProperty','active','service','provider','custom','handleImapBox','bind','error','status','disabled','emit','connected','messages','handleImapEmail','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','sendMail','smtp','Smtp','verified','lodash','moment','bluebird','md5','ioredis','email','redis','defaults'];(function(_0x39f961,_0xf54d28){var _0x1b01f4=function(_0x2afae9){while(--_0x2afae9){_0x39f961['push'](_0x39f961['shift']());}};_0x1b01f4(++_0xf54d28);}(_0xc2a7,0x14f));var _0x7c2a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xc2a7[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7c2a('0x0'));var moment=require(_0x7c2a('0x1'));var BPromise=require(_0x7c2a('0x2'));var md5=require(_0x7c2a('0x3'));var Redis=require(_0x7c2a('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7c2a('0x5'));config[_0x7c2a('0x6')]=_[_0x7c2a('0x7')](config[_0x7c2a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7c2a('0x8'))(new Redis(config['redis']));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x171267){logger[_0x7c2a('0x9')]('start\x20email\x20channel');this[_0x7c2a('0xa')]=_0x171267[_0x7c2a('0xa')];this[_0x7c2a('0xb')]={};this['smtp']=new EmailSmtp();}EmailChannel[_0x7c2a('0xc')]['emit']=function(_0x5c2822){var _0x43bdf5=this[_0x7c2a('0xa')][_0x5c2822];var _0x1ed4cf={'id':_0x43bdf5['id'],'name':_0x43bdf5[_0x7c2a('0xd')],'key':_0x43bdf5[_0x7c2a('0xe')],'active':_0x43bdf5['active'],'Imap':{'status':_0x43bdf5[_0x7c2a('0xf')]['status'],'messageStatus':_0x43bdf5[_0x7c2a('0xf')][_0x7c2a('0x10')],'total':_0x43bdf5[_0x7c2a('0xf')][_0x7c2a('0x11')]}};if(_[_0x7c2a('0x12')](md5Accounts[_0x5c2822])){md5Accounts[_0x5c2822]={};}var _0xbaa04d=md5(JSON[_0x7c2a('0x13')](_0x1ed4cf));if(md5Accounts[_0x5c2822][_0x7c2a('0x3')]!==_0xbaa04d){md5Accounts[_0x5c2822][_0x7c2a('0x3')]=_0xbaa04d;io['emit'](_0x7c2a('0x14'),_0x1ed4cf);}};EmailChannel['prototype']['refresh']=function(_0x302832){for(var _0x28324b in _0x302832){if(_0x302832[_0x7c2a('0x15')](_0x28324b)){if(_0x302832[_0x28324b]['Imap']&&_0x302832[_0x28324b][_0x7c2a('0x16')]){var _0x209925=_0x302832[_0x28324b][_0x7c2a('0xf')];if(!_0x209925[_0x7c2a('0x17')]&&_0x302832[_0x28324b][_0x7c2a('0x18')]!==_0x7c2a('0x19'))_0x209925[_0x7c2a('0x17')]=_0x302832[_0x28324b][_0x7c2a('0x18')];if(!this[_0x7c2a('0xb')]['hasOwnProperty'](_0x209925['id'])){this[_0x7c2a('0xb')][_0x209925['id']]=new EmailImap(_0x209925,_0x302832[_0x28324b]['email']);this[_0x7c2a('0xb')][_0x209925['id']]['on']('box',this[_0x7c2a('0x1a')][_0x7c2a('0x1b')](this,_0x28324b));this['imapAccounts'][_0x209925['id']]['on'](_0x7c2a('0x5'),this['handleImapEmail']['bind'](this,_0x28324b));this[_0x7c2a('0xb')][_0x209925['id']]['on']('end',this['handleImapEnd']['bind'](this,_0x28324b));this[_0x7c2a('0xb')][_0x209925['id']]['on'](_0x7c2a('0x1c'),this['handleImapError'][_0x7c2a('0x1b')](this,_0x28324b));}}else{if(_['isNil'](this[_0x7c2a('0xa')][_0x28324b][_0x7c2a('0xf')])){this[_0x7c2a('0xa')][_0x28324b][_0x7c2a('0xf')]={};}this[_0x7c2a('0xa')][_0x28324b][_0x7c2a('0xf')][_0x7c2a('0x1d')]=_0x7c2a('0x1e');this[_0x7c2a('0xa')][_0x28324b][_0x7c2a('0xf')][_0x7c2a('0x10')]='';this[_0x7c2a('0x1f')](_0x28324b);}}}};EmailChannel[_0x7c2a('0xc')][_0x7c2a('0x1a')]=function(_0x1deb11,_0x40f130){if(this['mailAccounts'][_0x1deb11]){this[_0x7c2a('0xa')][_0x1deb11][_0x7c2a('0xf')][_0x7c2a('0x1d')]=_0x7c2a('0x20');this['mailAccounts'][_0x1deb11][_0x7c2a('0xf')][_0x7c2a('0x10')]=_0x40f130[_0x7c2a('0xd')];if(_0x40f130[_0x7c2a('0x21')]){this[_0x7c2a('0xa')][_0x1deb11][_0x7c2a('0xf')]['total']=_0x40f130[_0x7c2a('0x21')][_0x7c2a('0x11')];}return this['emit'](_0x1deb11);}};EmailChannel[_0x7c2a('0xc')][_0x7c2a('0x22')]=function(_0x4c77c2,_0x46deb3){logger[_0x7c2a('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x46deb3[_0x7c2a('0x23')],_0x46deb3[_0x7c2a('0x24')],_0x46deb3[_0x7c2a('0x25')],_0x4c77c2);if(this[_0x7c2a('0xa')][_0x4c77c2]){return mailAccount[_0x7c2a('0x26')](_0x4c77c2,_0x46deb3)[_0x7c2a('0x27')](function(_0x5a919f){if(_0x5a919f){logger[_0x7c2a('0x9')]('Mail\x20accepted\x20from\x20routing');}})[_0x7c2a('0x28')](function(_0x2f5fc1){logger[_0x7c2a('0x1c')](_0x7c2a('0x29'),JSON[_0x7c2a('0x13')](_0x2f5fc1));});}};EmailChannel[_0x7c2a('0xc')][_0x7c2a('0x2a')]=function(_0x552ebd){if(this['mailAccounts'][_0x552ebd]&&this[_0x7c2a('0xa')][_0x552ebd][_0x7c2a('0xf')]){if(this[_0x7c2a('0xb')][this[_0x7c2a('0xa')][_0x552ebd][_0x7c2a('0xf')]['id']]){delete this[_0x7c2a('0xb')][this['mailAccounts'][_0x552ebd][_0x7c2a('0xf')]['id']];}this[_0x7c2a('0xa')][_0x552ebd][_0x7c2a('0xf')][_0x7c2a('0x2b')]=moment();this[_0x7c2a('0x1f')](_0x552ebd);}};EmailChannel[_0x7c2a('0xc')][_0x7c2a('0x2c')]=function(_0x1ef201,_0x3bb695){if(this[_0x7c2a('0xa')][_0x1ef201]){this[_0x7c2a('0xa')][_0x1ef201][_0x7c2a('0xf')]['status']=_0x7c2a('0x1c');this['mailAccounts'][_0x1ef201]['Imap'][_0x7c2a('0x10')]=_0x3bb695;return this[_0x7c2a('0x1f')](_0x1ef201);}};EmailChannel['prototype'][_0x7c2a('0x2d')]=function(_0x4c6b8f,_0x58e35a){return this[_0x7c2a('0x2e')]['send'](_0x4c6b8f,_0x58e35a);};EmailChannel[_0x7c2a('0xc')]['verifySmtp']=function(_0x2a9a58){var _0x5f1b6d=this;if(this[_0x7c2a('0xa')][_0x2a9a58['id']]){if(_['isNil'](this[_0x7c2a('0xa')][_0x2a9a58['id']]['Smtp'])){this[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')]={};}this[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')][_0x7c2a('0x2b')]=moment();return new BPromise(function(_0x5c8cf4,_0x23eb4e){return _0x5f1b6d[_0x7c2a('0x2e')]['verify'](_0x2a9a58)[_0x7c2a('0x27')](function(_0x35ba64){_0x5f1b6d[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')][_0x7c2a('0x1d')]=_0x7c2a('0x30');_0x5f1b6d[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')]['messageStatus']='';_0x5f1b6d['emit'](_0x2a9a58['id']);_0x5c8cf4(_0x35ba64);})['catch'](function(_0x2a510f){_0x5f1b6d[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')][_0x7c2a('0x1d')]=_0x7c2a('0x1c');_0x5f1b6d[_0x7c2a('0xa')][_0x2a9a58['id']][_0x7c2a('0x2f')][_0x7c2a('0x10')]=_0x2a510f;_0x5f1b6d['emit'](_0x2a9a58['id']);_0x23eb4e(_0x2a510f);});});}return this[_0x7c2a('0x2e')]['verify'](_0x2a9a58);};module['exports']=EmailChannel; \ No newline at end of file +var _0x07a2=['from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','Smtp','verify','verified','exports','lodash','moment','bluebird','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./smtp','../rpc/mailAccount','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','refresh','service','provider','hasOwnProperty','handleImapBox','bind','imapAccounts','handleImapEmail','handleImapEnd','error','handleImapError','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x07a2,0x186));var _0x207a=function(_0x2adac5,_0x38fea6){_0x2adac5=_0x2adac5-0x0;var _0x1661ab=_0x07a2[_0x2adac5];return _0x1661ab;};'use strict';var _=require(_0x207a('0x0'));var moment=require(_0x207a('0x1'));var BPromise=require(_0x207a('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x207a('0x3'));var logger=require(_0x207a('0x4'))(_0x207a('0x5'));config[_0x207a('0x6')]=_[_0x207a('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x207a('0x8'))(new Redis(config[_0x207a('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x207a('0x9'));var mailAccount=require(_0x207a('0xa'));var md5Accounts={};function EmailChannel(_0x142cde){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x142cde[_0x207a('0xb')];this['imapAccounts']={};this[_0x207a('0xc')]=new EmailSmtp();}EmailChannel[_0x207a('0xd')][_0x207a('0xe')]=function(_0x5ef81e){var _0xe8ff07=this[_0x207a('0xb')][_0x5ef81e];var _0x3b1535={'id':_0xe8ff07['id'],'name':_0xe8ff07[_0x207a('0xf')],'key':_0xe8ff07[_0x207a('0x10')],'active':_0xe8ff07[_0x207a('0x11')],'Imap':{'status':_0xe8ff07[_0x207a('0x12')][_0x207a('0x13')],'messageStatus':_0xe8ff07['Imap'][_0x207a('0x14')],'total':_0xe8ff07[_0x207a('0x12')][_0x207a('0x15')]}};if(_[_0x207a('0x16')](md5Accounts[_0x5ef81e])){md5Accounts[_0x5ef81e]={};}var _0x2c82f0=md5(JSON[_0x207a('0x17')](_0x3b1535));if(md5Accounts[_0x5ef81e][_0x207a('0x18')]!==_0x2c82f0){md5Accounts[_0x5ef81e][_0x207a('0x18')]=_0x2c82f0;io[_0x207a('0xe')]('mailAccount:update',_0x3b1535);}};EmailChannel[_0x207a('0xd')][_0x207a('0x19')]=function(_0x105574){for(var _0x19b625 in _0x105574){if(_0x105574['hasOwnProperty'](_0x19b625)){if(_0x105574[_0x19b625][_0x207a('0x12')]&&_0x105574[_0x19b625][_0x207a('0x11')]){var _0x21d18d=_0x105574[_0x19b625][_0x207a('0x12')];if(!_0x21d18d[_0x207a('0x1a')]&&_0x105574[_0x19b625][_0x207a('0x1b')]!=='custom')_0x21d18d[_0x207a('0x1a')]=_0x105574[_0x19b625][_0x207a('0x1b')];if(!this['imapAccounts'][_0x207a('0x1c')](_0x21d18d['id'])){this['imapAccounts'][_0x21d18d['id']]=new EmailImap(_0x21d18d,_0x105574[_0x19b625][_0x207a('0x5')]);this['imapAccounts'][_0x21d18d['id']]['on']('box',this[_0x207a('0x1d')][_0x207a('0x1e')](this,_0x19b625));this[_0x207a('0x1f')][_0x21d18d['id']]['on']('email',this[_0x207a('0x20')][_0x207a('0x1e')](this,_0x19b625));this[_0x207a('0x1f')][_0x21d18d['id']]['on']('end',this[_0x207a('0x21')][_0x207a('0x1e')](this,_0x19b625));this[_0x207a('0x1f')][_0x21d18d['id']]['on'](_0x207a('0x22'),this[_0x207a('0x23')][_0x207a('0x1e')](this,_0x19b625));}}else{if(_['isNil'](this[_0x207a('0xb')][_0x19b625][_0x207a('0x12')])){this[_0x207a('0xb')][_0x19b625]['Imap']={};}this[_0x207a('0xb')][_0x19b625][_0x207a('0x12')][_0x207a('0x13')]='disabled';this[_0x207a('0xb')][_0x19b625][_0x207a('0x12')][_0x207a('0x14')]='';this['emit'](_0x19b625);}}}};EmailChannel[_0x207a('0xd')]['handleImapBox']=function(_0x23ec31,_0x380d7b){if(this[_0x207a('0xb')][_0x23ec31]){this['mailAccounts'][_0x23ec31]['Imap'][_0x207a('0x13')]=_0x207a('0x24');this['mailAccounts'][_0x23ec31]['Imap']['messageStatus']=_0x380d7b[_0x207a('0xf')];if(_0x380d7b['messages']){this[_0x207a('0xb')][_0x23ec31][_0x207a('0x12')]['total']=_0x380d7b[_0x207a('0x25')]['total'];}return this[_0x207a('0xe')](_0x23ec31);}};EmailChannel[_0x207a('0xd')][_0x207a('0x20')]=function(_0x434b97,_0x54f8f7){logger[_0x207a('0x26')](_0x207a('0x27'),_0x54f8f7[_0x207a('0x28')],_0x54f8f7[_0x207a('0x29')],_0x54f8f7[_0x207a('0x2a')],_0x434b97);if(this[_0x207a('0xb')][_0x434b97]){return mailAccount[_0x207a('0x2b')](_0x434b97,_0x54f8f7)[_0x207a('0x2c')](function(_0x3737b2){if(_0x3737b2){logger[_0x207a('0x26')](_0x207a('0x2d'));}})[_0x207a('0x2e')](function(_0x145d05){logger[_0x207a('0x22')](_0x207a('0x2f'),JSON['stringify'](_0x145d05));});}};EmailChannel[_0x207a('0xd')][_0x207a('0x21')]=function(_0x3d5089){if(this[_0x207a('0xb')][_0x3d5089]&&this[_0x207a('0xb')][_0x3d5089]['Imap']){if(this['imapAccounts'][this[_0x207a('0xb')][_0x3d5089][_0x207a('0x12')]['id']]){delete this[_0x207a('0x1f')][this[_0x207a('0xb')][_0x3d5089][_0x207a('0x12')]['id']];}this[_0x207a('0xb')][_0x3d5089][_0x207a('0x12')][_0x207a('0x30')]=moment();this[_0x207a('0xe')](_0x3d5089);}};EmailChannel[_0x207a('0xd')]['handleImapError']=function(_0x41acb6,_0x2241e7){if(this[_0x207a('0xb')][_0x41acb6]){this[_0x207a('0xb')][_0x41acb6][_0x207a('0x12')][_0x207a('0x13')]=_0x207a('0x22');this['mailAccounts'][_0x41acb6]['Imap'][_0x207a('0x14')]=_0x2241e7;return this[_0x207a('0xe')](_0x41acb6);}};EmailChannel['prototype'][_0x207a('0x31')]=function(_0x1ef8f5,_0x5b67ac){return this[_0x207a('0xc')]['send'](_0x1ef8f5,_0x5b67ac);};EmailChannel['prototype']['verifySmtp']=function(_0x57381c){var _0x1983b3=this;if(this['mailAccounts'][_0x57381c['id']]){if(_['isNil'](this[_0x207a('0xb')][_0x57381c['id']][_0x207a('0x32')])){this['mailAccounts'][_0x57381c['id']]['Smtp']={};}this[_0x207a('0xb')][_0x57381c['id']][_0x207a('0x32')][_0x207a('0x30')]=moment();return new BPromise(function(_0x2240e1,_0x39fe38){return _0x1983b3[_0x207a('0xc')][_0x207a('0x33')](_0x57381c)[_0x207a('0x2c')](function(_0x2eaa65){_0x1983b3[_0x207a('0xb')][_0x57381c['id']]['Smtp'][_0x207a('0x13')]=_0x207a('0x34');_0x1983b3[_0x207a('0xb')][_0x57381c['id']][_0x207a('0x32')][_0x207a('0x14')]='';_0x1983b3['emit'](_0x57381c['id']);_0x2240e1(_0x2eaa65);})[_0x207a('0x2e')](function(_0x7ab400){_0x1983b3['mailAccounts'][_0x57381c['id']][_0x207a('0x32')][_0x207a('0x13')]='error';_0x1983b3['mailAccounts'][_0x57381c['id']][_0x207a('0x32')][_0x207a('0x14')]=_0x7ab400;_0x1983b3[_0x207a('0xe')](_0x57381c['id']);_0x39fe38(_0x7ab400);});});}return this[_0x207a('0xc')]['verify'](_0x57381c);};module[_0x207a('0x35')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index b26830d..79ff827 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 _0xc6f4=['iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','once','end','error','bind','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleError','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','handleEnd','stringify','textCode','hasOwnProperty','lodash','imap','mailparser','simpleParser'];(function(_0x709d5a,_0x3654af){var _0x46ab58=function(_0x9a4b43){while(--_0x9a4b43){_0x709d5a['push'](_0x709d5a['shift']());}};_0x46ab58(++_0x3654af);}(_0xc6f4,0x78));var _0x4c6f=function(_0x1cdb0a,_0x4527b1){_0x1cdb0a=_0x1cdb0a-0x0;var _0x531527=_0xc6f4[_0x1cdb0a];return _0x531527;};'use strict';var _=require(_0x4c6f('0x0'));var util=require('util');var Imap=require(_0x4c6f('0x1'));var simpleParser=require(_0x4c6f('0x2'))[_0x4c6f('0x3')];var Iconv=require(_0x4c6f('0x4'))['Iconv'];var EventEmitter=require(_0x4c6f('0x5'))[_0x4c6f('0x6')];var utils=require(_0x4c6f('0x7'));var logger=require(_0x4c6f('0x8'))(_0x4c6f('0x9'));function EmailImap(_0x16f58d,_0x221dbe){this[_0x4c6f('0xa')]=_0x16f58d[_0x4c6f('0xa')];this[_0x4c6f('0xb')]=this[_0x4c6f('0xc')](_0x16f58d,_0x221dbe);this[_0x4c6f('0x1')]=new Imap(this['account']);this[_0x4c6f('0x1')][_0x4c6f('0xd')]('ready',this['handleReady']['bind'](this));this[_0x4c6f('0x1')][_0x4c6f('0xd')](_0x4c6f('0xe'),this['handleEnd']['bind'](this));this[_0x4c6f('0x1')]['on'](_0x4c6f('0xf'),this['handleError'][_0x4c6f('0x10')](this));this['imap'][_0x4c6f('0x11')]();}util[_0x4c6f('0x12')](EmailImap,EventEmitter);EmailImap[_0x4c6f('0x13')][_0x4c6f('0xc')]=function(_0x2ff3d6,_0x495e84){var _0x343bfa={'connTimeout':_0x2ff3d6[_0x4c6f('0x14')]?_0x2ff3d6['connTimeout']*0x3e8:0x2710,'authTimeout':_0x2ff3d6[_0x4c6f('0x15')]?_0x2ff3d6[_0x4c6f('0x15')]*0x3e8:0x1388};if(_0x2ff3d6[_0x4c6f('0x16')]){_0x343bfa[_0x4c6f('0x17')]=_0x2ff3d6[_0x4c6f('0x17')];if(_0x2ff3d6[_0x4c6f('0x18')]){_0x343bfa['xoauth2']=utils[_0x4c6f('0x19')](_0x2ff3d6[_0x4c6f('0x1a')][_0x4c6f('0x1b')],_0x2ff3d6['user']);}else{_0x343bfa[_0x4c6f('0x1c')]=_0x2ff3d6[_0x4c6f('0x1c')];}}else{if(_0x2ff3d6[_0x4c6f('0x1d')]){_0x343bfa[_0x4c6f('0x17')]=_0x2ff3d6[_0x4c6f('0x17')];_0x343bfa['password']=_0x2ff3d6[_0x4c6f('0x1c')];}}_0x343bfa[_0x4c6f('0x9')]=_0x495e84||_0x2ff3d6[_0x4c6f('0x17')]||_0x4c6f('0x1e');_0x343bfa[_0x4c6f('0x1f')]=_0x2ff3d6[_0x4c6f('0x1f')];_0x343bfa[_0x4c6f('0x20')]=_0x2ff3d6[_0x4c6f('0x20')]||0x3e1;if(_0x2ff3d6[_0x4c6f('0x21')]){_0x343bfa['tls']=!![];}else{_0x343bfa[_0x4c6f('0x21')]=![];_0x343bfa[_0x4c6f('0x22')]=_0x4c6f('0x23');}return _0x343bfa;};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x24')]=function(){this['imap'][_0x4c6f('0x25')](this['mailbox'],![],this[_0x4c6f('0x26')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x338034,_0x4d1de2){if(_0x338034){this['handleError'](_0x338034,!![]);}else{this[_0x4c6f('0x27')](_0x4c6f('0x28'),_0x4d1de2);this[_0x4c6f('0x29')]();}};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x2a')]=function(_0x59d2dc){if(_0x59d2dc){this[_0x4c6f('0x2b')](_0x59d2dc,!![]);}else{this[_0x4c6f('0x1')][_0x4c6f('0xe')]();}};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x29')]=function(){this['imap'][_0x4c6f('0x2c')](['UNSEEN'],this[_0x4c6f('0x2d')]['bind'](this));};EmailImap[_0x4c6f('0x13')]['handleReadUnseen']=function(_0x5a116c,_0x1991e4){if(_0x5a116c){this[_0x4c6f('0x2b')](_0x5a116c,!![]);}else{if(_0x1991e4[_0x4c6f('0x2e')]){try{var _0x30f4f2=this[_0x4c6f('0x1')][_0x4c6f('0x2f')](_0x1991e4,{'bodies':'','markSeen':!![]});_0x30f4f2['on'](_0x4c6f('0x30'),this[_0x4c6f('0x31')]['bind'](this));_0x30f4f2[_0x4c6f('0xd')](_0x4c6f('0xf'),this['handleFetchError'][_0x4c6f('0x10')](this));_0x30f4f2['once'](_0x4c6f('0xe'),this[_0x4c6f('0x32')]['bind'](this));}catch(_0x172de4){logger[_0x4c6f('0xf')](_0x172de4);}}else{this[_0x4c6f('0x1')][_0x4c6f('0x33')](!![],this['handleCloseBox'][_0x4c6f('0x10')](this));}}};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x31')]=function(_0x3efcda){_0x3efcda['on']('body',this[_0x4c6f('0x34')][_0x4c6f('0x10')](this));_0x3efcda[_0x4c6f('0xd')](_0x4c6f('0x35'),this['handleMessageAttributes']['bind'](this));_0x3efcda[_0x4c6f('0xd')](_0x4c6f('0xe'),this[_0x4c6f('0x36')][_0x4c6f('0x10')](this));};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x34')]=function(_0xdcbec6){simpleParser(_0xdcbec6,{'Iconv':Iconv},this[_0x4c6f('0x37')]['bind'](this));};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x38')]=function(){};EmailImap['prototype'][_0x4c6f('0x36')]=function(){};EmailImap[_0x4c6f('0x13')]['handleSimpleParser']=function(_0x2bddfd,_0x16ee02){if(_0x2bddfd){logger[_0x4c6f('0xf')](_0x2bddfd);}else{var _0x4c6440=this;utils[_0x4c6f('0x39')](this['account'],_0x16ee02,function(_0x1d1f14){_0x4c6440['emit']('email',_0x1d1f14);});}};EmailImap[_0x4c6f('0x13')]['handleFetchEnd']=function(){this[_0x4c6f('0x1')][_0x4c6f('0x33')](!![],this['handleCloseBox'][_0x4c6f('0x10')](this));};EmailImap[_0x4c6f('0x13')]['handleFetchError']=function(_0x4c9799){this[_0x4c6f('0x2b')](_0x4c9799);this[_0x4c6f('0x1')][_0x4c6f('0x33')](!![],this[_0x4c6f('0x2a')][_0x4c6f('0x10')](this));};EmailImap['prototype'][_0x4c6f('0x3a')]=function(){this[_0x4c6f('0x27')](_0x4c6f('0xe'));};EmailImap[_0x4c6f('0x13')][_0x4c6f('0x2b')]=function(_0x4f4a7a,_0x3aa847){logger[_0x4c6f('0xf')](_0x4c6f('0x2b'),this[_0x4c6f('0xb')][_0x4c6f('0x9')],JSON[_0x4c6f('0x3b')](_0x4f4a7a));var _0x5e448b='';if(_0x4f4a7a){if(_0x4f4a7a[_0x4c6f('0x3c')]){_0x5e448b=_0x4f4a7a['textCode'];}else{for(var _0x382e16 in _0x4f4a7a){if(_0x4f4a7a[_0x4c6f('0x3d')](_0x382e16)){_0x5e448b+=_['upperFirst'](_0x382e16)+':\x20'+_0x4f4a7a[_0x382e16]+'\x0a';}}}}if(_0x3aa847){this[_0x4c6f('0x1')][_0x4c6f('0xe')]();}else{this['emit'](_0x4c6f('0xf'),_0x5e448b);this[_0x4c6f('0x27')](_0x4c6f('0xe'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x98f8=['handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','lodash','util','imap','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','account','once','ready','end','handleEnd','handleError','bind','connect','getAccount','connTimeout','authTimeout','service','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','port','tls','autotls','required','prototype'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x98f8,0x1cc));var _0x898f=function(_0x48b7e8,_0x2f4a23){_0x48b7e8=_0x48b7e8-0x0;var _0x37382d=_0x98f8[_0x48b7e8];return _0x37382d;};'use strict';var _=require(_0x898f('0x0'));var util=require(_0x898f('0x1'));var Imap=require(_0x898f('0x2'));var simpleParser=require('mailparser')[_0x898f('0x3')];var Iconv=require(_0x898f('0x4'))['Iconv'];var EventEmitter=require(_0x898f('0x5'))[_0x898f('0x6')];var utils=require(_0x898f('0x7'));var logger=require(_0x898f('0x8'))(_0x898f('0x9'));function EmailImap(_0x106e69,_0x9aa1e){this[_0x898f('0xa')]=_0x106e69['mailbox'];this[_0x898f('0xb')]=this['getAccount'](_0x106e69,_0x9aa1e);this[_0x898f('0x2')]=new Imap(this[_0x898f('0xb')]);this[_0x898f('0x2')][_0x898f('0xc')](_0x898f('0xd'),this['handleReady']['bind'](this));this['imap'][_0x898f('0xc')](_0x898f('0xe'),this[_0x898f('0xf')]['bind'](this));this[_0x898f('0x2')]['on']('error',this[_0x898f('0x10')][_0x898f('0x11')](this));this[_0x898f('0x2')][_0x898f('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x898f('0x13')]=function(_0x5d4a7d,_0x46ff69){var _0x348b30={'connTimeout':_0x5d4a7d[_0x898f('0x14')]?_0x5d4a7d[_0x898f('0x14')]*0x3e8:0x2710,'authTimeout':_0x5d4a7d[_0x898f('0x15')]?_0x5d4a7d['authTimeout']*0x3e8:0x1388};if(_0x5d4a7d[_0x898f('0x16')]){_0x348b30[_0x898f('0x17')]=_0x5d4a7d[_0x898f('0x17')];if(_0x5d4a7d['modernAuthentication']){_0x348b30[_0x898f('0x18')]=utils[_0x898f('0x19')](_0x5d4a7d[_0x898f('0x1a')][_0x898f('0x1b')],_0x5d4a7d['user']);}else{_0x348b30[_0x898f('0x1c')]=_0x5d4a7d['password'];}}else{if(_0x5d4a7d[_0x898f('0x1d')]){_0x348b30[_0x898f('0x17')]=_0x5d4a7d['user'];_0x348b30[_0x898f('0x1c')]=_0x5d4a7d[_0x898f('0x1c')];}}_0x348b30['email']=_0x46ff69||_0x5d4a7d[_0x898f('0x17')]||_0x898f('0x1e');_0x348b30['host']=_0x5d4a7d['host'];_0x348b30[_0x898f('0x1f')]=_0x5d4a7d[_0x898f('0x1f')]||0x3e1;if(_0x5d4a7d['tls']){_0x348b30[_0x898f('0x20')]=!![];}else{_0x348b30[_0x898f('0x20')]=![];_0x348b30[_0x898f('0x21')]=_0x898f('0x22');}return _0x348b30;};EmailImap[_0x898f('0x23')]['handleReady']=function(){this[_0x898f('0x2')]['openBox'](this[_0x898f('0xa')],![],this[_0x898f('0x24')][_0x898f('0x11')](this));};EmailImap[_0x898f('0x23')][_0x898f('0x24')]=function(_0x245f87,_0x226c31){if(_0x245f87){this[_0x898f('0x10')](_0x245f87,!![]);}else{this[_0x898f('0x25')](_0x898f('0x26'),_0x226c31);this[_0x898f('0x27')]();}};EmailImap['prototype'][_0x898f('0x28')]=function(_0x359d90){if(_0x359d90){this[_0x898f('0x10')](_0x359d90,!![]);}else{this[_0x898f('0x2')][_0x898f('0xe')]();}};EmailImap[_0x898f('0x23')][_0x898f('0x27')]=function(){this[_0x898f('0x2')][_0x898f('0x29')]([_0x898f('0x2a')],this[_0x898f('0x2b')][_0x898f('0x11')](this));};EmailImap['prototype'][_0x898f('0x2b')]=function(_0x54aca9,_0x5d698b){if(_0x54aca9){this[_0x898f('0x10')](_0x54aca9,!![]);}else{if(_0x5d698b[_0x898f('0x2c')]){try{var _0x599af2=this[_0x898f('0x2')][_0x898f('0x2d')](_0x5d698b,{'bodies':'','markSeen':!![]});_0x599af2['on'](_0x898f('0x2e'),this[_0x898f('0x2f')]['bind'](this));_0x599af2[_0x898f('0xc')](_0x898f('0x30'),this[_0x898f('0x31')][_0x898f('0x11')](this));_0x599af2[_0x898f('0xc')](_0x898f('0xe'),this[_0x898f('0x32')][_0x898f('0x11')](this));}catch(_0x3b3e7f){logger[_0x898f('0x30')](_0x3b3e7f);}}else{this[_0x898f('0x2')][_0x898f('0x33')](!![],this[_0x898f('0x28')][_0x898f('0x11')](this));}}};EmailImap[_0x898f('0x23')][_0x898f('0x2f')]=function(_0x51ea2d){_0x51ea2d['on'](_0x898f('0x34'),this['handleMessageBody'][_0x898f('0x11')](this));_0x51ea2d[_0x898f('0xc')]('attributes',this[_0x898f('0x35')][_0x898f('0x11')](this));_0x51ea2d['once'](_0x898f('0xe'),this[_0x898f('0x36')][_0x898f('0x11')](this));};EmailImap[_0x898f('0x23')][_0x898f('0x37')]=function(_0x2e6dc1){simpleParser(_0x2e6dc1,{'Iconv':Iconv},this[_0x898f('0x38')][_0x898f('0x11')](this));};EmailImap['prototype'][_0x898f('0x35')]=function(){};EmailImap['prototype'][_0x898f('0x36')]=function(){};EmailImap[_0x898f('0x23')]['handleSimpleParser']=function(_0x51bf34,_0x30fdab){if(_0x51bf34){logger[_0x898f('0x30')](_0x51bf34);}else{var _0x57836a=this;utils[_0x898f('0x39')](this[_0x898f('0xb')],_0x30fdab,function(_0x18a26b){_0x57836a[_0x898f('0x25')](_0x898f('0x9'),_0x18a26b);});}};EmailImap[_0x898f('0x23')]['handleFetchEnd']=function(){this['imap'][_0x898f('0x33')](!![],this[_0x898f('0x28')][_0x898f('0x11')](this));};EmailImap[_0x898f('0x23')][_0x898f('0x31')]=function(_0x47439c){this[_0x898f('0x10')](_0x47439c);this[_0x898f('0x2')][_0x898f('0x33')](!![],this['handleCloseBox'][_0x898f('0x11')](this));};EmailImap[_0x898f('0x23')][_0x898f('0xf')]=function(){this[_0x898f('0x25')](_0x898f('0xe'));};EmailImap['prototype'][_0x898f('0x10')]=function(_0x4349b9,_0x2a20a5){logger['error'](_0x898f('0x10'),this['account']['email'],JSON[_0x898f('0x3a')](_0x4349b9));var _0x59cdca='';if(_0x4349b9){if(_0x4349b9[_0x898f('0x3b')]){_0x59cdca=_0x4349b9[_0x898f('0x3b')];}else{for(var _0x3358ae in _0x4349b9){if(_0x4349b9['hasOwnProperty'](_0x3358ae)){_0x59cdca+=_[_0x898f('0x3c')](_0x3358ae)+':\x20'+_0x4349b9[_0x3358ae]+'\x0a';}}}}if(_0x2a20a5){this[_0x898f('0x2')]['end']();}else{this['emit'](_0x898f('0x30'),_0x59cdca);this['emit'](_0x898f('0xe'));}};module[_0x898f('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index c35ba85..cd88cf8 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 _0x85b2=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x259c59,_0x56c41d){var _0x360f54=function(_0x4fab82){while(--_0x4fab82){_0x259c59['push'](_0x259c59['shift']());}};_0x360f54(++_0x56c41d);}(_0x85b2,0x126));var _0x285b=function(_0x4a1fde,_0x13def6){_0x4a1fde=_0x4a1fde-0x0;var _0x42fce6=_0x85b2[_0x4a1fde];return _0x42fce6;};'use strict';var nodemailer=require(_0x285b('0x0'));var inlineBase64=require(_0x285b('0x1'));function EmailSmtp(){}EmailSmtp[_0x285b('0x2')]['send']=function(_0x312049,_0x3bf061){return new Promise(function(_0x47b4f7,_0x117a41){var _0x127e09=nodemailer[_0x285b('0x3')](_0x312049);_0x127e09[_0x285b('0x4')](_0x285b('0x5'),inlineBase64());_0x127e09[_0x285b('0x6')](_0x3bf061,function(_0x582137,_0x23bc3c){if(_0x582137){_0x117a41(_0x582137[_0x285b('0x7')]());}else{_0x47b4f7(_0x23bc3c);}});});};EmailSmtp[_0x285b('0x2')][_0x285b('0x8')]=function(_0x587ebc){return new Promise(function(_0x61ee5b,_0x55eed9){var _0xe8df25=nodemailer[_0x285b('0x3')](_0x587ebc);_0xe8df25[_0x285b('0x8')](function(_0x411659,_0x40d7){if(_0x411659){_0x55eed9(_0x411659[_0x285b('0x7')]());}else{if(_0x40d7){_0x61ee5b(_0x40d7);}else{_0x55eed9(_0x285b('0x9'));}}});});};module[_0x285b('0xa')]=EmailSmtp; \ No newline at end of file +var _0x2162=['toString','verify','Not\x20verifired','exports','nodemailer','prototype','send','createTransport','use'];(function(_0x23ac3a,_0x160858){var _0xe0e6e3=function(_0x16da7d){while(--_0x16da7d){_0x23ac3a['push'](_0x23ac3a['shift']());}};_0xe0e6e3(++_0x160858);}(_0x2162,0x1e1));var _0x2216=function(_0x5bdaee,_0x25939a){_0x5bdaee=_0x5bdaee-0x0;var _0xf8b124=_0x2162[_0x5bdaee];return _0xf8b124;};'use strict';var nodemailer=require(_0x2216('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x2216('0x1')][_0x2216('0x2')]=function(_0x27e9be,_0x2a5ea5){return new Promise(function(_0x132457,_0x3ae157){var _0x44558e=nodemailer[_0x2216('0x3')](_0x27e9be);_0x44558e[_0x2216('0x4')]('compile',inlineBase64());_0x44558e['sendMail'](_0x2a5ea5,function(_0x149278,_0x5c07b8){if(_0x149278){_0x3ae157(_0x149278[_0x2216('0x5')]());}else{_0x132457(_0x5c07b8);}});});};EmailSmtp[_0x2216('0x1')][_0x2216('0x6')]=function(_0x40ee0a){return new Promise(function(_0x50bbb0,_0x4f6281){var _0x2ec150=nodemailer[_0x2216('0x3')](_0x40ee0a);_0x2ec150['verify'](function(_0x4bb208,_0x1f235b){if(_0x4bb208){_0x4f6281(_0x4bb208[_0x2216('0x5')]());}else{if(_0x1f235b){_0x50bbb0(_0x1f235b);}else{_0x4f6281(_0x2216('0x7'));}}});});};module[_0x2216('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 b82415d..4590033 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 _0xa89f=['

Empty\x20message

','user=','utf-8','base64','lodash','moment','randomstring','path','util','../../../config/logger','value','address','anonymous','generate','name','substring','indexOf','length','head','split','pop','isEmpty','@xcally.com','html','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','email','originCc','includes','bcc','attach','attachment','attachment-','format','%s-%s','now','join','server/files/attachments/','writeFileSync','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','info','content','BodyHTML','Attachments','Title','Data'];(function(_0x24673e,_0xdb40e4){var _0x51ff18=function(_0x5472f5){while(--_0x5472f5){_0x24673e['push'](_0x24673e['shift']());}};_0x51ff18(++_0xdb40e4);}(_0xa89f,0x15d));var _0xfa89=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xa89f[_0x9cfe28];return _0x54a1d0;};'use strict';var _=require(_0xfa89('0x0'));var moment=require(_0xfa89('0x1'));var random=require(_0xfa89('0x2'));var fs=require('fs');var path=require(_0xfa89('0x3'));var util=require(_0xfa89('0x4'));var tnef=require('node-tnef');var logger=require(_0xfa89('0x5'))('email');var config=require('../../../config/environment');function getAddress(_0xf75d6e){var _0x584351=_['head'](_0xf75d6e[_0xfa89('0x6')]);return _0x584351&&_0x584351[_0xfa89('0x7')]?_0x584351['address']:_0xfa89('0x8')+random[_0xfa89('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x1b8660){var _0xe8e9b6=_['head'](_0x1b8660['value']);if(_0xe8e9b6&&_0xe8e9b6[_0xfa89('0xa')]){if(_0xe8e9b6['name']==_0xe8e9b6['address']){return _0xe8e9b6['name'][_0xfa89('0xb')](0x0,_0xe8e9b6['name'][_0xfa89('0xc')]('@'));}var _0x4c7b38=_0xe8e9b6['name']['split'](/\s+/);return _0x4c7b38[_0xfa89('0xd')]>0x1?_0x4c7b38['slice'](0x0,-0x1)['join']('\x20'):_0xe8e9b6[_0xfa89('0xa')];}return'Anonymous';}function getLastName(_0x1c354f){var _0x1d10b1=_[_0xfa89('0xe')](_0x1c354f['value']);if(_0x1d10b1&&_0x1d10b1[_0xfa89('0xa')]){var _0x1d15c1=_0x1d10b1[_0xfa89('0xa')][_0xfa89('0xf')](/\s+/);return _0x1d15c1[_0xfa89('0xd')]>0x1?_0x1d15c1[_0xfa89('0x10')]():'';}return'';}function getMails(_0x3694ee,_0x50425e){var _0x349338='';for(var _0x1688c9=0x0;_0x1688c9<_0x50425e[_0xfa89('0x6')]['length'];_0x1688c9+=0x1){if(_0x50425e['value'][_0x1688c9][_0xfa89('0x7')]!==_0x3694ee){if(!_[_0xfa89('0x11')](_0x349338)){_0x349338+=',';}_0x349338+=_0x50425e[_0xfa89('0x6')][_0x1688c9][_0xfa89('0xa')]||_0x50425e[_0xfa89('0x6')][_0x1688c9]['address']||'';_0x349338+='\x20<';_0x349338+=_0x50425e[_0xfa89('0x6')][_0x1688c9][_0xfa89('0x7')]?_0x50425e[_0xfa89('0x6')][_0x1688c9]['address']:'anonymous'+random[_0xfa89('0x9')](0x6)+_0xfa89('0x12');_0x349338+='>';}}return _0x349338;}function parseEmail(_0x407686,_0x12776a,_0x23aefc){if(_0x12776a[_0xfa89('0x13')]){var _0x5bc877=/)<[^<]*)*<\/script>/gi;while(_0x5bc877['test'](_0x12776a[_0xfa89('0x13')])){_0x12776a[_0xfa89('0x13')]=_0x12776a[_0xfa89('0x13')][_0xfa89('0x14')](_0x5bc877,'');}if(_0x12776a[_0xfa89('0x13')]['includes'](_0xfa89('0x15'))){var _0x1c8f14=[];_0x12776a[_0xfa89('0x16')][_0xfa89('0x17')](_0x391ea8=>{_0x1c8f14[_0xfa89('0x18')](_0x391ea8[_0xfa89('0x19')]);});var _0x50f72c=/]+>/g;var _0xb323b5=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xd03641=_0x12776a[_0xfa89('0x13')][_0xfa89('0x14')](_0xb323b5,_0xfa89('0x1a'));var _0x18c204=_0xd03641['replace'](_0x50f72c,_0xfa89('0x1b'));for(let _0x5e4a80=0x0;_0x5e4a80<_0x1c8f14[_0xfa89('0xd')];_0x5e4a80++){var _0x3aac85=_0x18c204[_0xfa89('0x14')]('_IMG',_0xfa89('0x1c')+_0x1c8f14[_0x5e4a80]+_0xfa89('0x1d'));_0x18c204=_0x3aac85;}_0x12776a[_0xfa89('0x13')]=_0x18c204;}_0x23aefc[_0xfa89('0x1e')]=_0x12776a['html'];}else{_0x23aefc[_0xfa89('0x1e')]=_0x12776a[_0xfa89('0x1f')];}if(_0x23aefc[_0xfa89('0x1e')]){_0x23aefc['body']=_0x23aefc[_0xfa89('0x1e')][_0xfa89('0x14')](/0x0){var _0xe12b8a=[_0xfa89('0x31'),_0xfa89('0x32'),_0xfa89('0x33')];for(var _0x4925a4=0x0;_0x4925a4<_0x12776a['headerLines'][_0xfa89('0xd')];_0x4925a4++){var _0xa190d5=_[_0xfa89('0xc')](_0xe12b8a,_0x12776a[_0xfa89('0x30')][_0x4925a4]['line']);if(_0xa190d5>=0x0){_0x23aefc['isAutoreply']=!![];}}}return _0x23aefc;}exports['parser']=function(_0x245664,_0x26d1e9,_0x4fb4f4){var _0x826145={'from':getAddress(_0x26d1e9['from']),'firstName':getFirstName(_0x26d1e9[_0xfa89('0x34')]),'lastName':getLastName(_0x26d1e9[_0xfa89('0x34')]),'mapKey':_0xfa89('0x22'),'message':{'from':getMails(_0x245664[_0xfa89('0x22')],_0x26d1e9[_0xfa89('0x34')]),'to':_0x245664[_0xfa89('0x22')],'cc':'','subject':_0x26d1e9[_0xfa89('0x35')]||'','messageId':_0x26d1e9[_0xfa89('0x36')],'inReplyTo':_0x26d1e9[_0xfa89('0x37')],'sentAt':moment(_0x26d1e9[_0xfa89('0x38')])[_0xfa89('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x26d1e9[_0xfa89('0x13')]&&!_0x26d1e9[_0xfa89('0x1f')]){var _0x1968c3=_[_0xfa89('0x39')](_0x26d1e9[_0xfa89('0x16')],{'contentType':_0xfa89('0x3a')});if(_0x1968c3[_0xfa89('0xd')]){logger[_0xfa89('0x3b')](util[_0xfa89('0x29')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x26d1e9[_0xfa89('0x36')]));tnef['parseBuffer'](_['first'](_0x1968c3)[_0xfa89('0x3c')],function(_0x4d8d12,_0x4804bc){if(_0x4804bc){_0x26d1e9[_0xfa89('0x13')]=_0x4804bc[_0xfa89('0x3d')]||'

Empty\x20message

';if(_0x4804bc[_0xfa89('0x3e')]){for(var _0x37aac0=0x0;_0x37aac0<_0x4804bc[_0xfa89('0x3e')][_0xfa89('0xd')];_0x37aac0++){var _0x49abb0=_0x4804bc[_0xfa89('0x3e')][_0x37aac0];_0x826145[_0xfa89('0x20')][_0xfa89('0x16')][_0xfa89('0x18')]({'filename':_0x49abb0[_0xfa89('0x3f')],'content':Buffer[_0xfa89('0x34')](_0x49abb0[_0xfa89('0x40')])});}}}_0x4fb4f4(parseEmail(_0x245664,_0x26d1e9,_0x826145));});}else{_0x26d1e9[_0xfa89('0x13')]=_0xfa89('0x41');_0x4fb4f4(parseEmail(_0x245664,_0x26d1e9,_0x826145));}}else{_0x4fb4f4(parseEmail(_0x245664,_0x26d1e9,_0x826145));}};exports['generateXOAuth2Token']=function(_0x17517c,_0x53ba70){var _0x4c677c=[_0xfa89('0x42')+(_0x53ba70||''),'auth=Bearer\x20'+_0x17517c,'',''];return Buffer[_0xfa89('0x34')](_0x4c677c[_0xfa89('0x2c')](''),_0xfa89('0x43'))['toString'](_0xfa89('0x44'));}; \ No newline at end of file +var _0x34e7=['application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','Title','user=','auth=Bearer\x20','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','email','originCc','bcc','attachments','attach','filename','attachment-','%s-%s','now','root','server/files/attachments/','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date'];(function(_0x4b30a1,_0x44d5d0){var _0x473882=function(_0x1bcc40){while(--_0x1bcc40){_0x4b30a1['push'](_0x4b30a1['shift']());}};_0x473882(++_0x44d5d0);}(_0x34e7,0xe1));var _0x734e=function(_0xd77fa2,_0x489a23){_0xd77fa2=_0xd77fa2-0x0;var _0x101679=_0x34e7[_0xd77fa2];return _0x101679;};'use strict';var _=require(_0x734e('0x0'));var moment=require(_0x734e('0x1'));var random=require(_0x734e('0x2'));var fs=require('fs');var path=require(_0x734e('0x3'));var util=require(_0x734e('0x4'));var tnef=require(_0x734e('0x5'));var logger=require('../../../config/logger')('email');var config=require(_0x734e('0x6'));function getAddress(_0x51d681){var _0x57d19f=_[_0x734e('0x7')](_0x51d681['value']);return _0x57d19f&&_0x57d19f[_0x734e('0x8')]?_0x57d19f[_0x734e('0x8')]:_0x734e('0x9')+random[_0x734e('0xa')](0x6)+_0x734e('0xb');}function getFirstName(_0x484c49){var _0x3d7175=_[_0x734e('0x7')](_0x484c49[_0x734e('0xc')]);if(_0x3d7175&&_0x3d7175['name']){if(_0x3d7175[_0x734e('0xd')]==_0x3d7175[_0x734e('0x8')]){return _0x3d7175['name'][_0x734e('0xe')](0x0,_0x3d7175[_0x734e('0xd')][_0x734e('0xf')]('@'));}var _0x32a98e=_0x3d7175[_0x734e('0xd')][_0x734e('0x10')](/\s+/);return _0x32a98e[_0x734e('0x11')]>0x1?_0x32a98e[_0x734e('0x12')](0x0,-0x1)[_0x734e('0x13')]('\x20'):_0x3d7175[_0x734e('0xd')];}return _0x734e('0x14');}function getLastName(_0x3a40a0){var _0x3f6add=_['head'](_0x3a40a0[_0x734e('0xc')]);if(_0x3f6add&&_0x3f6add[_0x734e('0xd')]){var _0x11df96=_0x3f6add['name'][_0x734e('0x10')](/\s+/);return _0x11df96[_0x734e('0x11')]>0x1?_0x11df96[_0x734e('0x15')]():'';}return'';}function getMails(_0x6620bd,_0x2e253f){var _0x4085e0='';for(var _0x47f2d1=0x0;_0x47f2d1<_0x2e253f[_0x734e('0xc')][_0x734e('0x11')];_0x47f2d1+=0x1){if(_0x2e253f['value'][_0x47f2d1][_0x734e('0x8')]!==_0x6620bd){if(!_[_0x734e('0x16')](_0x4085e0)){_0x4085e0+=',';}_0x4085e0+=_0x2e253f['value'][_0x47f2d1]['name']||_0x2e253f[_0x734e('0xc')][_0x47f2d1][_0x734e('0x8')]||'';_0x4085e0+='\x20<';_0x4085e0+=_0x2e253f[_0x734e('0xc')][_0x47f2d1][_0x734e('0x8')]?_0x2e253f['value'][_0x47f2d1][_0x734e('0x8')]:_0x734e('0x9')+random[_0x734e('0xa')](0x6)+_0x734e('0xb');_0x4085e0+='>';}}return _0x4085e0;}function parseEmail(_0x264de3,_0x2f550a,_0x4a1ff2){if(_0x2f550a[_0x734e('0x17')]){var _0x476d82=/)<[^<]*)*<\/script>/gi;while(_0x476d82[_0x734e('0x18')](_0x2f550a['html'])){_0x2f550a['html']=_0x2f550a[_0x734e('0x17')]['replace'](_0x476d82,'');}if(_0x2f550a[_0x734e('0x17')][_0x734e('0x19')](_0x734e('0x1a'))){var _0x505cbf=[];_0x2f550a['attachments']['forEach'](_0x20477a=>{_0x505cbf[_0x734e('0x1b')](_0x20477a['filename']);});var _0x5418ba=/]+>/g;var _0x47a15a=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xd4fbff=_0x2f550a[_0x734e('0x17')][_0x734e('0x1c')](_0x47a15a,_0x734e('0x1d'));var _0x58f2e1=_0xd4fbff[_0x734e('0x1c')](_0x5418ba,_0x734e('0x1e'));for(let _0x106bde=0x0;_0x106bde<_0x505cbf[_0x734e('0x11')];_0x106bde++){var _0x5afcc9=_0x58f2e1['replace'](_0x734e('0x1e'),_0x734e('0x1f')+_0x505cbf[_0x106bde]+_0x734e('0x20'));_0x58f2e1=_0x5afcc9;}_0x2f550a[_0x734e('0x17')]=_0x58f2e1;}_0x4a1ff2['body']=_0x2f550a[_0x734e('0x17')];}else{_0x4a1ff2[_0x734e('0x21')]=_0x2f550a[_0x734e('0x22')];}if(_0x4a1ff2['body']){_0x4a1ff2['body']=_0x4a1ff2[_0x734e('0x21')][_0x734e('0x1c')](/0x0){var _0x369c5c=[_0x734e('0x32'),'X-Auto-Response-Suppress:\x20All',_0x734e('0x33')];for(var _0xb4313a=0x0;_0xb4313a<_0x2f550a['headerLines']['length'];_0xb4313a++){var _0x249c86=_[_0x734e('0xf')](_0x369c5c,_0x2f550a[_0x734e('0x31')][_0xb4313a][_0x734e('0x34')]);if(_0x249c86>=0x0){_0x4a1ff2[_0x734e('0x35')]=!![];}}}return _0x4a1ff2;}exports[_0x734e('0x36')]=function(_0x4de756,_0x4db783,_0x76175b){var _0x46cda4={'from':getAddress(_0x4db783[_0x734e('0x37')]),'firstName':getFirstName(_0x4db783[_0x734e('0x37')]),'lastName':getLastName(_0x4db783[_0x734e('0x37')]),'mapKey':_0x734e('0x25'),'message':{'from':getMails(_0x4de756[_0x734e('0x25')],_0x4db783['from']),'to':_0x4de756[_0x734e('0x25')],'cc':'','subject':_0x4db783[_0x734e('0x38')]||'','messageId':_0x4db783[_0x734e('0x39')],'inReplyTo':_0x4db783['inReplyTo'],'sentAt':moment(_0x4db783[_0x734e('0x3a')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4db783[_0x734e('0x17')]&&!_0x4db783[_0x734e('0x22')]){var _0x338114=_['filter'](_0x4db783[_0x734e('0x28')],{'contentType':_0x734e('0x3b')});if(_0x338114['length']){logger[_0x734e('0x3c')](util['format'](_0x734e('0x3d'),_0x4db783['messageId']));tnef[_0x734e('0x3e')](_[_0x734e('0x3f')](_0x338114)[_0x734e('0x30')],function(_0x27a79f,_0x5b07f3){if(_0x5b07f3){_0x4db783['html']=_0x5b07f3['BodyHTML']||_0x734e('0x40');if(_0x5b07f3[_0x734e('0x41')]){for(var _0x460f59=0x0;_0x460f59<_0x5b07f3[_0x734e('0x41')]['length'];_0x460f59++){var _0x3f1e30=_0x5b07f3[_0x734e('0x41')][_0x460f59];_0x46cda4[_0x734e('0x23')][_0x734e('0x28')][_0x734e('0x1b')]({'filename':_0x3f1e30[_0x734e('0x42')],'content':Buffer[_0x734e('0x37')](_0x3f1e30['Data'])});}}}_0x76175b(parseEmail(_0x4de756,_0x4db783,_0x46cda4));});}else{_0x4db783['html']=_0x734e('0x40');_0x76175b(parseEmail(_0x4de756,_0x4db783,_0x46cda4));}}else{_0x76175b(parseEmail(_0x4de756,_0x4db783,_0x46cda4));}};exports['generateXOAuth2Token']=function(_0x50ef24,_0x5a6b66){var _0x58c676=[_0x734e('0x43')+(_0x5a6b66||''),_0x734e('0x44')+_0x50ef24,'',''];return Buffer[_0x734e('0x37')](_0x58c676[_0x734e('0x13')](''),_0x734e('0x45'))['toString'](_0x734e('0x46'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 55ee425..2c30227 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 _0xa16a=['exports','lodash','Service','SERV','active','Imap','Smtp'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa16a,0x8d));var _0xaa16=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xa16a[_0x24875d];return _0x181471;};'use strict';var _=require(_0xaa16('0x0'));function MailAccount(_0x367d78){this['id']=_0x367d78['id']||0x0;this['name']=_0x367d78['name']||_0xaa16('0x1');this['key']=_0x367d78['key']||_0xaa16('0x2');this['active']=_0x367d78[_0xaa16('0x3')]||![];this[_0xaa16('0x4')]=_0x367d78[_0xaa16('0x4')]||[];this[_0xaa16('0x5')]=_0x367d78['Smtp']||[];}module[_0xaa16('0x6')]=MailAccount; \ No newline at end of file +var _0x2258=['Service','key','active','Smtp','lodash','name'];(function(_0x2612b5,_0x683318){var _0x1aee47=function(_0x4e1abb){while(--_0x4e1abb){_0x2612b5['push'](_0x2612b5['shift']());}};_0x1aee47(++_0x683318);}(_0x2258,0xee));var _0x8225=function(_0x4ff731,_0x5791a5){_0x4ff731=_0x4ff731-0x0;var _0x357702=_0x2258[_0x4ff731];return _0x357702;};'use strict';var _=require(_0x8225('0x0'));function MailAccount(_0x43fbe7){this['id']=_0x43fbe7['id']||0x0;this['name']=_0x43fbe7[_0x8225('0x1')]||_0x8225('0x2');this['key']=_0x43fbe7[_0x8225('0x3')]||'SERV';this[_0x8225('0x4')]=_0x43fbe7[_0x8225('0x4')]||![];this['Imap']=_0x43fbe7['Imap']||[];this[_0x8225('0x5')]=_0x43fbe7[_0x8225('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4699b42..724eed3 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 _0x5acb=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','mailAccounts','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x5d4ca7,_0x19113b){var _0x3efc03=function(_0x59675b){while(--_0x59675b){_0x5d4ca7['push'](_0x5d4ca7['shift']());}};_0x3efc03(++_0x19113b);}(_0x5acb,0x13d));var _0xb5ac=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5acb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xb5ac('0x0'));var MailAccount=require(_0xb5ac('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x1e0b61,_0x5bdb0d,_0x330611){var _0x35716e=_[_0xb5ac('0x2')](_0x1e0b61,function(_0x2da4f9,_0x5a7c9f){return _0x2da4f9[_0x330611];});for(var _0x5842c in _0x5bdb0d){if(_0x5bdb0d[_0xb5ac('0x3')](_0x5842c)){if(!_0x35716e[_0x5842c]){delete _0x5bdb0d[_0x5842c];}}}}Realtime['prototype'][_0xb5ac('0x4')]=function(_0x555e7a,_0x4c9a53){for(var _0x26f502 in _0x4c9a53){if(_0x555e7a['hasOwnProperty'](_0x26f502)){_0x555e7a[_0x26f502]=_0x4c9a53[_0x26f502];}}};Realtime[_0xb5ac('0x5')][_0xb5ac('0x6')]=function(){var _0x44c601=this;return function(_0x2321a0){if(_0x2321a0){freeIsNotKey(_0x2321a0,_0x44c601[_0xb5ac('0x7')],'id');for(var _0x27624d=0x0,_0x176434={},_0x507dd1={};_0x27624d<_0x2321a0[_0xb5ac('0x8')];_0x27624d+=0x1){_0x176434=_0x2321a0[_0x27624d];if(_[_0xb5ac('0x9')](_0x44c601[_0xb5ac('0x7')][_0x176434['id']])){_0x44c601[_0xb5ac('0x7')][_0x176434['id']]=new MailAccount(_0x176434);}else{_[_0xb5ac('0xa')](_0x44c601[_0xb5ac('0x7')][_0x176434['id']],_0x176434);}}}return _0x44c601['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x8e75=['hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x63a591,_0x34cd51){var _0x5736b3=function(_0x2aefda){while(--_0x2aefda){_0x63a591['push'](_0x63a591['shift']());}};_0x5736b3(++_0x34cd51);}(_0x8e75,0x1a4));var _0x58e7=function(_0x488832,_0x1173a0){_0x488832=_0x488832-0x0;var _0x274cc1=_0x8e75[_0x488832];return _0x274cc1;};'use strict';var _=require('lodash');var MailAccount=require(_0x58e7('0x0'));var Realtime=function(){this[_0x58e7('0x1')]={};};function freeIsNotKey(_0x4b6790,_0x5cb35f,_0x51a1fe){var _0xa6ac9f=_[_0x58e7('0x2')](_0x4b6790,function(_0x1338d,_0x4bf8ea){return _0x1338d[_0x51a1fe];});for(var _0x5a7b65 in _0x5cb35f){if(_0x5cb35f[_0x58e7('0x3')](_0x5a7b65)){if(!_0xa6ac9f[_0x5a7b65]){delete _0x5cb35f[_0x5a7b65];}}}}Realtime[_0x58e7('0x4')]['mergeFromDatabase']=function(_0x2046ad,_0x30070f){for(var _0x14c0ed in _0x30070f){if(_0x2046ad[_0x58e7('0x3')](_0x14c0ed)){_0x2046ad[_0x14c0ed]=_0x30070f[_0x14c0ed];}}};Realtime['prototype'][_0x58e7('0x5')]=function(){var _0x1730d6=this;return function(_0x21bddf){if(_0x21bddf){freeIsNotKey(_0x21bddf,_0x1730d6[_0x58e7('0x1')],'id');for(var _0x2102d1=0x0,_0x4ef98f={},_0x470792={};_0x2102d1<_0x21bddf[_0x58e7('0x6')];_0x2102d1+=0x1){_0x4ef98f=_0x21bddf[_0x2102d1];if(_[_0x58e7('0x7')](_0x1730d6[_0x58e7('0x1')][_0x4ef98f['id']])){_0x1730d6[_0x58e7('0x1')][_0x4ef98f['id']]=new MailAccount(_0x4ef98f);}else{_[_0x58e7('0x8')](_0x1730d6[_0x58e7('0x1')][_0x4ef98f['id']],_0x4ef98f);}}}return _0x1730d6['mailAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index a0a1b7a..6f284c7 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 _0x2499=['GetMailAccount','name','service','email','active','ListId','TemplateId','MailServerIn','CloudProvider','type','data5','MailServerOut','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x2499,0x7d));var _0x9249=function(_0x4c5eea,_0xc893b){_0x4c5eea=_0x4c5eea-0x0;var _0x146f9f=_0x2499[_0x4c5eea];return _0x146f9f;};'use strict';var client=require(_0x9249('0x0'));exports[_0x9249('0x1')]=function(){return function(){return client[_0x9249('0x2')](_0x9249('0x3'),{'options':{'attributes':['id',_0x9249('0x4'),'provider',_0x9249('0x5'),_0x9249('0x6'),_0x9249('0x7'),'key',_0x9249('0x8'),_0x9249('0x9')],'raw':![],'include':[{'model':_0x9249('0xa'),'as':'Imap','include':[{'model':_0x9249('0xb'),'attributes':['id',_0x9249('0x4'),_0x9249('0x5'),_0x9249('0xc'),_0x9249('0xd')],'as':_0x9249('0xb')}]},{'model':_0x9249('0xe'),'as':'Smtp','include':[{'model':_0x9249('0xb'),'attributes':['id',_0x9249('0x4'),'service','type',_0x9249('0xd')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x6d247a,_0x425e59){return client[_0x9249('0x2')](_0x9249('0xf'),{'account':{'id':_0x6d247a},'body':_0x425e59,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x3c03=['Imap','CloudProvider','type','data5','MailServerOut','Smtp','notify','NotifyMailAccount','../client','name','provider','service','email','key','ListId','TemplateId','MailServerIn'];(function(_0x4d6d94,_0x59a501){var _0x36bfbf=function(_0x2718a2){while(--_0x2718a2){_0x4d6d94['push'](_0x4d6d94['shift']());}};_0x36bfbf(++_0x59a501);}(_0x3c03,0x16d));var _0x33c0=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x3c03[_0x50aa2e];return _0x5e07f0;};'use strict';var client=require(_0x33c0('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x33c0('0x1'),_0x33c0('0x2'),_0x33c0('0x3'),_0x33c0('0x4'),'active',_0x33c0('0x5'),_0x33c0('0x6'),_0x33c0('0x7')],'raw':![],'include':[{'model':_0x33c0('0x8'),'as':_0x33c0('0x9'),'include':[{'model':_0x33c0('0xa'),'attributes':['id',_0x33c0('0x1'),'service',_0x33c0('0xb'),_0x33c0('0xc')],'as':'CloudProvider'}]},{'model':_0x33c0('0xd'),'as':_0x33c0('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0x33c0('0x1'),_0x33c0('0x3'),_0x33c0('0xb'),_0x33c0('0xc')],'as':'CloudProvider'}]}]},'log':'getMailAccount'});};};exports[_0x33c0('0xf')]=function(_0x71eac3,_0x5f37ac){return client['Request']('NotifyMailAccount',{'account':{'id':_0x71eac3},'body':_0x5f37ac,'log':_0x33c0('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 3432412..3c8ba1e 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 _0x09b5=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x1ee977,_0x3437bb){var _0x309b39=function(_0x1cbaf7){while(--_0x1cbaf7){_0x1ee977['push'](_0x1ee977['shift']());}};_0x309b39(++_0x3437bb);}(_0x09b5,0xd7));var _0x509b=function(_0x11dd81,_0x253651){_0x11dd81=_0x11dd81-0x0;var _0x328f16=_0x09b5[_0x11dd81];return _0x328f16;};'use strict';var client=require('../client');exports[_0x509b('0x0')]=function(){return client[_0x509b('0x1')](_0x509b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x509b('0x3')]},'log':_0x509b('0x4')});}; \ No newline at end of file +var _0xcccf=['getSettings','Request','GetSettings','../client'];(function(_0x40874e,_0x21e801){var _0x4d17c8=function(_0x17732b){while(--_0x17732b){_0x40874e['push'](_0x40874e['shift']());}};_0x4d17c8(++_0x21e801);}(_0xcccf,0x7b));var _0xfccc=function(_0xc7567e,_0x4a26f5){_0xc7567e=_0xc7567e-0x0;var _0x5b8b71=_0xcccf[_0xc7567e];return _0x5b8b71;};'use strict';var client=require(_0xfccc('0x0'));exports[_0xfccc('0x1')]=function(){return client[_0xfccc('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xfccc('0x3')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d9eade2..e4cdc3b 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(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 6723d4c..ba85fc7 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 _0x1cd4=['createServer','timeout','listen','socket.io','polling','redis','localhost','adapter','../../config/triggers','../../config/socketio','default','../../routes','once','listening','port','exports','lodash','http','express','sticky-session','ioredis','../../config/environment'];(function(_0x5c2e0,_0x388670){var _0xecb2a6=function(_0x197c69){while(--_0x197c69){_0x5c2e0['push'](_0x5c2e0['shift']());}};_0xecb2a6(++_0x388670);}(_0x1cd4,0x1de));var _0x41cd=function(_0x2215c2,_0xc39a17){_0x2215c2=_0x2215c2-0x0;var _0x40ba4f=_0x1cd4[_0x2215c2];return _0x40ba4f;};'use strict';var _=require(_0x41cd('0x0'));var http=require(_0x41cd('0x1'));var express=require(_0x41cd('0x2'));var sticky=require(_0x41cd('0x3'));var Redis=require(_0x41cd('0x4'));var config=require(_0x41cd('0x5'));var app=express();var server=http[_0x41cd('0x6')](app);server[_0x41cd('0x7')]=0xdbba0;if(sticky[_0x41cd('0x8')](server,config['port'])){var socketio=require(_0x41cd('0x9'))(server,{'transports':['websocket',_0x41cd('0xa')]});config[_0x41cd('0xb')]=_['defaults'](config['redis'],{'host':_0x41cd('0xc'),'port':0x18eb});socketio[_0x41cd('0xd')](require('socket.io-redis')({'pubClient':new Redis(config[_0x41cd('0xb')]),'subClient':new Redis(config[_0x41cd('0xb')])}));require(_0x41cd('0xe'))['default']();require(_0x41cd('0xf'))[_0x41cd('0x10')](socketio);require('../../config/express')[_0x41cd('0x10')](app);require(_0x41cd('0x11'))['default'](app);}else{server[_0x41cd('0x12')](_0x41cd('0x13'),function(){console['log']('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x41cd('0x14')]);});}exports=module[_0x41cd('0x15')]=app; \ No newline at end of file +var _0x982b=['timeout','listen','socket.io','websocket','polling','redis','defaults','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','../../config/environment','createServer'];(function(_0x12545f,_0x2bcaf2){var _0x2108c5=function(_0x59f157){while(--_0x59f157){_0x12545f['push'](_0x12545f['shift']());}};_0x2108c5(++_0x2bcaf2);}(_0x982b,0x7f));var _0xb982=function(_0x21f4ec,_0x10230a){_0x21f4ec=_0x21f4ec-0x0;var _0x8b6a3f=_0x982b[_0x21f4ec];return _0x8b6a3f;};'use strict';var _=require('lodash');var http=require(_0xb982('0x0'));var express=require(_0xb982('0x1'));var sticky=require(_0xb982('0x2'));var Redis=require('ioredis');var config=require(_0xb982('0x3'));var app=express();var server=http[_0xb982('0x4')](app);server[_0xb982('0x5')]=0xdbba0;if(sticky[_0xb982('0x6')](server,config['port'])){var socketio=require(_0xb982('0x7'))(server,{'transports':[_0xb982('0x8'),_0xb982('0x9')]});config[_0xb982('0xa')]=_[_0xb982('0xb')](config[_0xb982('0xa')],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xb982('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xb982('0xa')])}));require(_0xb982('0xd'))[_0xb982('0xe')]();require('../../config/socketio')[_0xb982('0xe')](socketio);require(_0xb982('0xf'))[_0xb982('0xe')](app);require(_0xb982('0x10'))['default'](app);}else{server['once'](_0xb982('0x11'),function(){console[_0xb982('0x12')](_0xb982('0x13'),config[_0xb982('0x14')]);});}exports=module[_0xb982('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 8f27a77..4795942 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 _0x2993=['debug','rpc','error','message','result','catch','jayson/promise','../../config/logger','routing','http','Request','then'];(function(_0x320dd0,_0x266a5b){var _0x1ffb02=function(_0x23fc0c){while(--_0x23fc0c){_0x320dd0['push'](_0x320dd0['shift']());}};_0x1ffb02(++_0x266a5b);}(_0x2993,0x8a));var _0x3299=function(_0x50d682,_0xe221ed){_0x50d682=_0x50d682-0x0;var _0x56f8ff=_0x2993[_0x50d682];return _0x56f8ff;};'use strict';var jayson=require(_0x3299('0x0'));var BPromise=require('bluebird');var logger=require(_0x3299('0x1'))(_0x3299('0x2'));var client=jayson['client'][_0x3299('0x3')]({'port':0x2329});client[_0x3299('0x4')]=function(_0x26c5fc,_0x1775df){return new BPromise(function(_0x210124,_0x10db58){return client['request'](_0x26c5fc,_0x1775df)[_0x3299('0x5')](function(_0x178baa){logger[_0x3299('0x6')](_0x3299('0x7'),'routing',_0x26c5fc,_0x1775df,_0x178baa);if(_0x178baa[_0x3299('0x8')]){logger[_0x3299('0x8')]('rpc','routing',_0x26c5fc,_0x178baa['error'][_0x3299('0x9')],_0x1775df);return _0x10db58(_0x178baa[_0x3299('0x8')][_0x3299('0x9')]);}else{return _0x210124(_0x178baa[_0x3299('0xa')]);}})[_0x3299('0xb')](function(_0x1cde2d){logger[_0x3299('0x8')](_0x3299('0x7'),_0x3299('0x2'),_0x26c5fc,_0x1cde2d,_0x1775df);return _0x10db58(_0x1cde2d);});});};module['exports']=client; \ No newline at end of file +var _0xc9eb=['client','http','Request','request','debug','error','message','result','rpc','exports','jayson/promise','routing'];(function(_0x482e88,_0x58c604){var _0x156dc0=function(_0x493739){while(--_0x493739){_0x482e88['push'](_0x482e88['shift']());}};_0x156dc0(++_0x58c604);}(_0xc9eb,0x6a));var _0xbc9e=function(_0x29df9c,_0x2f319e){_0x29df9c=_0x29df9c-0x0;var _0x133b54=_0xc9eb[_0x29df9c];return _0x133b54;};'use strict';var jayson=require(_0xbc9e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xbc9e('0x1'));var client=jayson[_0xbc9e('0x2')][_0xbc9e('0x3')]({'port':0x2329});client[_0xbc9e('0x4')]=function(_0xa7f122,_0x580167){return new BPromise(function(_0x502ab9,_0xdbe810){return client[_0xbc9e('0x5')](_0xa7f122,_0x580167)['then'](function(_0x1d0e42){logger[_0xbc9e('0x6')]('rpc','routing',_0xa7f122,_0x580167,_0x1d0e42);if(_0x1d0e42[_0xbc9e('0x7')]){logger['error']('rpc',_0xbc9e('0x1'),_0xa7f122,_0x1d0e42[_0xbc9e('0x7')][_0xbc9e('0x8')],_0x580167);return _0xdbe810(_0x1d0e42['error'][_0xbc9e('0x8')]);}else{return _0x502ab9(_0x1d0e42[_0xbc9e('0x9')]);}})['catch'](function(_0x161e20){logger[_0xbc9e('0x7')](_0xbc9e('0xa'),_0xbc9e('0x1'),_0xa7f122,_0x161e20,_0x580167);return _0xdbe810(_0x161e20);});});};module[_0xbc9e('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index efdc106..9266768 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 _0x2900=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getWhatsappQueues','initWhatsappQueues','catch','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x27a21c,_0x13a464){var _0x7db0c2=function(_0x2e4fb9){while(--_0x2e4fb9){_0x27a21c['push'](_0x27a21c['shift']());}};_0x7db0c2(++_0x13a464);}(_0x2900,0x1b2));var _0x0290=function(_0x715d76,_0x402d60){_0x715d76=_0x715d76-0x0;var _0x48fe88=_0x2900[_0x715d76];return _0x48fe88;};'use strict';var BPromise=require(_0x0290('0x0'));var server=require('./server');var Realtime=require(_0x0290('0x1'));var user=require(_0x0290('0x2'));var interval=require(_0x0290('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x0290('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x0290('0x5'));var faxQueue=require(_0x0290('0x6'));var whatsappQueue=require(_0x0290('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x0290('0x8')]()[_0x0290('0x9')](user[_0x0290('0xa')]())[_0x0290('0x9')](realtime[_0x0290('0xb')]())[_0x0290('0x9')](interval[_0x0290('0xc')]())[_0x0290('0x9')](realtime[_0x0290('0xd')]())[_0x0290('0x9')](openchannelQueue[_0x0290('0xe')]())[_0x0290('0x9')](realtime[_0x0290('0xf')]())[_0x0290('0x9')](chatQueue[_0x0290('0x10')]())['then'](realtime[_0x0290('0x11')]())[_0x0290('0x9')](smsQueue[_0x0290('0x12')]())['then'](realtime[_0x0290('0x13')]())[_0x0290('0x9')](mailQueue[_0x0290('0x14')]())['then'](realtime[_0x0290('0x15')]())['then'](faxQueue['getFaxQueues']())['then'](realtime['initFaxQueues']())['then'](whatsappQueue[_0x0290('0x16')]())[_0x0290('0x9')](realtime[_0x0290('0x17')]())[_0x0290('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x0290('0x9')](function(_0x836a9d){return initRealtime();})[_0x0290('0x9')](function(_0x55c46b){return setInterval(initRealtime,0x1388);})[_0x0290('0x18')](function(_0x1ac95c){console['log'](_0x1ac95c);});}main(); \ No newline at end of file +var _0xa9ff=['./rpc/openchannelQueue','./rpc/faxQueue','resolve','then','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval'];(function(_0x180a8d,_0x432a75){var _0xe5b5c8=function(_0x48a91d){while(--_0x48a91d){_0x180a8d['push'](_0x180a8d['shift']());}};_0xe5b5c8(++_0x432a75);}(_0xa9ff,0x1b3));var _0xfa9f=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0xa9ff[_0x291aaf];return _0x5571e6;};'use strict';var BPromise=require(_0xfa9f('0x0'));var server=require(_0xfa9f('0x1'));var Realtime=require(_0xfa9f('0x2'));var user=require(_0xfa9f('0x3'));var interval=require(_0xfa9f('0x4'));var openchannelQueue=require(_0xfa9f('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xfa9f('0x6'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0xfa9f('0x7')]()[_0xfa9f('0x8')](user['getAgents']())[_0xfa9f('0x8')](realtime['initAgents']())[_0xfa9f('0x8')](interval['getIntervals']())[_0xfa9f('0x8')](realtime['initIntervals']())[_0xfa9f('0x8')](openchannelQueue[_0xfa9f('0x9')]())[_0xfa9f('0x8')](realtime['initOpenchannelQueues']())[_0xfa9f('0x8')](chatQueue[_0xfa9f('0xa')]())[_0xfa9f('0x8')](realtime[_0xfa9f('0xb')]())[_0xfa9f('0x8')](smsQueue[_0xfa9f('0xc')]())['then'](realtime[_0xfa9f('0xd')]())[_0xfa9f('0x8')](mailQueue[_0xfa9f('0xe')]())[_0xfa9f('0x8')](realtime['initMailQueues']())[_0xfa9f('0x8')](faxQueue['getFaxQueues']())[_0xfa9f('0x8')](realtime[_0xfa9f('0xf')]())[_0xfa9f('0x8')](whatsappQueue[_0xfa9f('0x10')]())['then'](realtime[_0xfa9f('0x11')]())[_0xfa9f('0x8')](function(){return realtime;});}function main(){return server[_0xfa9f('0x12')](realtime)[_0xfa9f('0x8')](function(_0x54a0b6){return initRealtime();})[_0xfa9f('0x8')](function(_0x16efe7){return setInterval(initRealtime,0x1388);})['catch'](function(_0x2b7359){console[_0xfa9f('0x13')](_0x2b7359);});}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 db26928..59956c7 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(_0x51ba06,_0x4ed036){var _0x32a797=function(_0x110c95){while(--_0x110c95){_0x51ba06['push'](_0x51ba06['shift']());}};_0x32a797(++_0x4ed036);}(_0x326f,0xd1));var _0xf326=function(_0x323764,_0x2bbe9b){_0x323764=_0x323764-0x0;var _0x662032=_0x326f[_0x323764];return _0x662032;};'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(_0x8522cf,_0x4115d0){var _0x5a7215=function(_0x47cb71){while(--_0x47cb71){_0x8522cf['push'](_0x8522cf['shift']());}};_0x5a7215(++_0x4115d0);}(_0x7a54,0x106));var _0x47a5=function(_0x3da580,_0x172ffb){_0x3da580=_0x3da580-0x0;var _0x5021bb=_0x7a54[_0x3da580];return _0x5021bb;};'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 f0cfc91..e344969 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 _0xb470=['then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','request'];(function(_0x34373f,_0x338e75){var _0x14be7f=function(_0x2abd71){while(--_0x2abd71){_0x34373f['push'](_0x34373f['shift']());}};_0x14be7f(++_0x338e75);}(_0xb470,0x193));var _0x0b47=function(_0x257c40,_0x56c174){_0x257c40=_0x257c40-0x0;var _0x5c7699=_0xb470[_0x257c40];return _0x5c7699;};'use strict';var BPromise=require(_0x0b47('0x0'));var jayson=require(_0x0b47('0x1'));var client=jayson['client'][_0x0b47('0x2')]({'port':0x232b});function request(_0x1e71c8,_0x123243){return new BPromise(function(_0x3c9efb,_0x3dbd54){return client[_0x0b47('0x3')](_0x1e71c8,_0x123243)[_0x0b47('0x4')](function(_0x3e5bc3){if(_0x3e5bc3[_0x0b47('0x5')]){return _0x3dbd54(_0x3e5bc3['error'][_0x0b47('0x6')]);}else{return _0x3c9efb(_0x3e5bc3[_0x0b47('0x7')]);}})[_0x0b47('0x8')](function(_0x524534){return _0x3dbd54(_0x524534);});});}exports[_0x0b47('0x9')]=function(_0x5d0bbc,_0x4958ff){return request(_0x0b47('0xa'),{'account':_0x5d0bbc,'message':_0x4958ff});}; \ No newline at end of file +var _0xd9e8=['SendMail','bluebird','client','request','then','error','result','catch','sendMailMessage'];(function(_0x17726c,_0x372fb4){var _0x458a1b=function(_0x34c8ab){while(--_0x34c8ab){_0x17726c['push'](_0x17726c['shift']());}};_0x458a1b(++_0x372fb4);}(_0xd9e8,0x172));var _0x8d9e=function(_0x59c2f8,_0x515317){_0x59c2f8=_0x59c2f8-0x0;var _0x50e296=_0xd9e8[_0x59c2f8];return _0x50e296;};'use strict';var BPromise=require(_0x8d9e('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x8d9e('0x1')]['http']({'port':0x232b});function request(_0x1e763c,_0x574ba7){return new BPromise(function(_0x5e3aba,_0x3f10eb){return client[_0x8d9e('0x2')](_0x1e763c,_0x574ba7)[_0x8d9e('0x3')](function(_0x841304){if(_0x841304[_0x8d9e('0x4')]){return _0x3f10eb(_0x841304[_0x8d9e('0x4')]['message']);}else{return _0x5e3aba(_0x841304[_0x8d9e('0x5')]);}})[_0x8d9e('0x6')](function(_0x540efa){return _0x3f10eb(_0x540efa);});});}exports[_0x8d9e('0x7')]=function(_0x2e0bdc,_0x3be3d2){return request(_0x8d9e('0x8'),{'account':_0x2e0bdc,'message':_0x3be3d2});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 6c0ead9..6aa461f 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 _0xa46e=['openchannel','fax','whatsapp','length','Status','StatusTime','toNumber','format','faxPause','chatCurrentCapacity','mailStatusTime','whatsappStatus','whatsappCurrentCapacity','busyQueue','chatWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','stringify','omit','exports','lodash','md5','ioredis','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatus','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','mailWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working'];(function(_0x2fc697,_0x1858e9){var _0xe06af8=function(_0x1b2959){while(--_0x1b2959){_0x2fc697['push'](_0x2fc697['shift']());}};_0xe06af8(++_0x1858e9);}(_0xa46e,0x8a));var _0xea46=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xa46e[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xea46('0x0'));var md5=require(_0xea46('0x1'));var moment=require('moment');var Redis=require(_0xea46('0x2'));var config=require(_0xea46('0x3'));config[_0xea46('0x4')]=_['defaults'](config[_0xea46('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xea46('0x5'))(new Redis(config['redis']));function Agent(_0x3599fc){this['id']=_0x3599fc['id']||0x0;this['name']=_0x3599fc[_0xea46('0x6')]||'';this[_0xea46('0x7')]=_0x3599fc['online']||!![];this[_0xea46('0x8')]=_0x3599fc[_0xea46('0x8')]||![];this[_0xea46('0x9')]=_0x3599fc[_0xea46('0x9')]||![];this[_0xea46('0xa')]=_0x3599fc['mailPause']||![];this['faxPause']=_0x3599fc['faxPause']||![];this[_0xea46('0xb')]=_0x3599fc[_0xea46('0xb')]||![];this['openchannelPause']=_0x3599fc[_0xea46('0xc')]||![];this[_0xea46('0xd')]=_0xea46('0xe');this['chatStatusTime']=0x0;this[_0xea46('0xf')]=_0x3599fc[_0xea46('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this[_0xea46('0x10')]=_0xea46('0xe');this['mailStatusTime']=0x0;this[_0xea46('0x11')]=_0x3599fc['mailCapacity']||0x0;this[_0xea46('0x12')]=0x0;this[_0xea46('0x13')]=_0xea46('0xe');this[_0xea46('0x14')]=0x0;this[_0xea46('0x15')]=_0x3599fc[_0xea46('0x15')]||0x0;this[_0xea46('0x16')]=0x0;this[_0xea46('0x17')]=_0xea46('0xe');this['smsStatusTime']=0x0;this[_0xea46('0x18')]=_0x3599fc[_0xea46('0x18')]||0x0;this[_0xea46('0x19')]=0x0;this['whatsappStatus']='unknown';this[_0xea46('0x1a')]=0x0;this[_0xea46('0x1b')]=_0x3599fc['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this[_0xea46('0x1c')]=_0xea46('0xe');this['openchannelStatusTime']=0x0;this[_0xea46('0x1d')]=_0x3599fc[_0xea46('0x1d')]||0x0;this[_0xea46('0x1e')]=0x0;this[_0xea46('0x1f')]=![];this['busyQueue']=undefined;this[_0xea46('0x1')]='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this[_0xea46('0x20')]={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xea46('0x21')]();}Agent[_0xea46('0x22')][_0xea46('0x23')]=function(_0x5beb44){if(this[_0x5beb44+_0xea46('0x24')]>0x0){if(this[_0x5beb44+'Capacity']>0x0&&this[_0x5beb44+_0xea46('0x24')]>=this[_0x5beb44+_0xea46('0x25')]){return'maxcapacity';}else{return _0xea46('0x26');}}else{return'idle';}};Agent[_0xea46('0x22')][_0xea46('0x21')]=function(){var _0xd4cf78=['mail','chat',_0xea46('0x27'),_0xea46('0x28'),'sms',_0xea46('0x29')];for(var _0x4999b0=0x0;_0x4999b0<_0xd4cf78[_0xea46('0x2a')];_0x4999b0+=0x1){var _0x51ca27=this[_0xea46('0x23')](_0xd4cf78[_0x4999b0]);if(this[_0xd4cf78[_0x4999b0]+_0xea46('0x2b')]!==_0x51ca27){this[_0xd4cf78[_0x4999b0]+_0xea46('0x2c')]=_[_0xea46('0x2d')](moment()[_0xea46('0x2e')]('x'));}this[_0xd4cf78[_0x4999b0]+_0xea46('0x2b')]=_0x51ca27;}var _0x4a5149={'id':this['id'],'name':this[_0xea46('0x6')],'online':this[_0xea46('0x7')],'voicePause':this[_0xea46('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0xea46('0xa')],'smsPause':this[_0xea46('0xb')],'faxPause':this[_0xea46('0x2f')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xea46('0xf')],'chatCurrentCapacity':this[_0xea46('0x30')],'mailStatus':this[_0xea46('0x10')],'mailStatusTime':this[_0xea46('0x31')],'mailCapacity':this[_0xea46('0x11')],'mailCurrentCapacity':this[_0xea46('0x12')],'faxStatus':this[_0xea46('0x13')],'faxStatusTime':this[_0xea46('0x14')],'faxCapacity':this[_0xea46('0x15')],'faxCurrentCapacity':this[_0xea46('0x16')],'smsStatus':this[_0xea46('0x17')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xea46('0x18')],'smsCurrentCapacity':this[_0xea46('0x19')],'whatsappStatus':this[_0xea46('0x32')],'whatsappStatusTime':this[_0xea46('0x1a')],'whatsappCapacity':this[_0xea46('0x1b')],'whatsappCurrentCapacity':this[_0xea46('0x33')],'openchannelStatus':this[_0xea46('0x1c')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xea46('0x1d')],'openchannelCurrentCapacity':this[_0xea46('0x1e')],'busy':this[_0xea46('0x1f')],'busyQueue':this[_0xea46('0x34')],'chatWaitingInteractions':this[_0xea46('0x35')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this[_0xea46('0x36')],'smsWaitingInteractions':this[_0xea46('0x37')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x38d970=md5(JSON[_0xea46('0x38')](_0x4a5149));if(this[_0xea46('0x1')]!==_0x38d970){this[_0xea46('0x1')]=_0x38d970;io['emit']('user:routing:update',_[_0xea46('0x39')](_0x4a5149,['online']));}};module[_0xea46('0x3a')]=Agent; \ No newline at end of file +var _0x7046=['socket.io-emitter','name','online','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','fax','length','StatusTime','toNumber','faxStatusTime','smsStatus','whatsappStatus','openchannelStatus','openchannelWaitingInteractions','smsWaitingInteractions','emit','user:routing:update','omit','exports','lodash','md5','moment','ioredis','redis','defaults'];(function(_0x21685b,_0x5d98f4){var _0x5b0f99=function(_0x9a3df5){while(--_0x9a3df5){_0x21685b['push'](_0x21685b['shift']());}};_0x5b0f99(++_0x5d98f4);}(_0x7046,0x144));var _0x6704=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7046[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6704('0x0'));var md5=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var Redis=require(_0x6704('0x3'));var config=require('../../../config/environment');config[_0x6704('0x4')]=_[_0x6704('0x5')](config[_0x6704('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x6704('0x6'))(new Redis(config[_0x6704('0x4')]));function Agent(_0x3f4169){this['id']=_0x3f4169['id']||0x0;this[_0x6704('0x7')]=_0x3f4169[_0x6704('0x7')]||'';this['online']=_0x3f4169[_0x6704('0x8')]||!![];this['voicePause']=_0x3f4169['voicePause']||![];this[_0x6704('0x9')]=_0x3f4169['chatPause']||![];this['mailPause']=_0x3f4169[_0x6704('0xa')]||![];this[_0x6704('0xb')]=_0x3f4169[_0x6704('0xb')]||![];this[_0x6704('0xc')]=_0x3f4169[_0x6704('0xc')]||![];this[_0x6704('0xd')]=_0x3f4169[_0x6704('0xd')]||![];this[_0x6704('0xe')]='unknown';this[_0x6704('0xf')]=0x0;this[_0x6704('0x10')]=_0x3f4169['chatCapacity']||0x0;this[_0x6704('0x11')]=0x0;this[_0x6704('0x12')]=_0x6704('0x13');this[_0x6704('0x14')]=0x0;this[_0x6704('0x15')]=_0x3f4169[_0x6704('0x15')]||0x0;this[_0x6704('0x16')]=0x0;this[_0x6704('0x17')]=_0x6704('0x13');this['faxStatusTime']=0x0;this[_0x6704('0x18')]=_0x3f4169[_0x6704('0x18')]||0x0;this[_0x6704('0x19')]=0x0;this['smsStatus']=_0x6704('0x13');this[_0x6704('0x1a')]=0x0;this[_0x6704('0x1b')]=_0x3f4169[_0x6704('0x1b')]||0x0;this[_0x6704('0x1c')]=0x0;this['whatsappStatus']=_0x6704('0x13');this[_0x6704('0x1d')]=0x0;this[_0x6704('0x1e')]=_0x3f4169[_0x6704('0x1e')]||0x0;this[_0x6704('0x1f')]=0x0;this['openchannelStatus']=_0x6704('0x13');this[_0x6704('0x20')]=0x0;this[_0x6704('0x21')]=_0x3f4169[_0x6704('0x21')]||0x0;this[_0x6704('0x22')]=0x0;this[_0x6704('0x23')]=![];this[_0x6704('0x24')]=undefined;this['md5']='';this[_0x6704('0x25')]={};this[_0x6704('0x26')]={};this[_0x6704('0x27')]={};this['openchannelWaitingInteractions']={};this['smsWaitingInteractions']={};this[_0x6704('0x28')]={};this[_0x6704('0x29')]();}Agent[_0x6704('0x2a')][_0x6704('0x2b')]=function(_0x41f89e){if(this[_0x41f89e+'CurrentCapacity']>0x0){if(this[_0x41f89e+_0x6704('0x2c')]>0x0&&this[_0x41f89e+_0x6704('0x2d')]>=this[_0x41f89e+_0x6704('0x2c')]){return _0x6704('0x2e');}else{return _0x6704('0x2f');}}else{return _0x6704('0x30');}};Agent[_0x6704('0x2a')][_0x6704('0x29')]=function(){var _0x896227=[_0x6704('0x31'),_0x6704('0x32'),_0x6704('0x33'),_0x6704('0x34'),'sms','whatsapp'];for(var _0x167312=0x0;_0x167312<_0x896227[_0x6704('0x35')];_0x167312+=0x1){var _0x86fc1d=this[_0x6704('0x2b')](_0x896227[_0x167312]);if(this[_0x896227[_0x167312]+'Status']!==_0x86fc1d){this[_0x896227[_0x167312]+_0x6704('0x36')]=_[_0x6704('0x37')](moment()['format']('x'));}this[_0x896227[_0x167312]+'Status']=_0x86fc1d;}var _0x16e749={'id':this['id'],'name':this['name'],'online':this[_0x6704('0x8')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x6704('0xa')],'smsPause':this[_0x6704('0xc')],'faxPause':this[_0x6704('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0x6704('0xe')],'chatStatusTime':this[_0x6704('0xf')],'chatCapacity':this[_0x6704('0x10')],'chatCurrentCapacity':this[_0x6704('0x11')],'mailStatus':this[_0x6704('0x12')],'mailStatusTime':this[_0x6704('0x14')],'mailCapacity':this[_0x6704('0x15')],'mailCurrentCapacity':this[_0x6704('0x16')],'faxStatus':this[_0x6704('0x17')],'faxStatusTime':this[_0x6704('0x38')],'faxCapacity':this[_0x6704('0x18')],'faxCurrentCapacity':this[_0x6704('0x19')],'smsStatus':this[_0x6704('0x39')],'smsStatusTime':this[_0x6704('0x1a')],'smsCapacity':this[_0x6704('0x1b')],'smsCurrentCapacity':this[_0x6704('0x1c')],'whatsappStatus':this[_0x6704('0x3a')],'whatsappStatusTime':this[_0x6704('0x1d')],'whatsappCapacity':this[_0x6704('0x1e')],'whatsappCurrentCapacity':this[_0x6704('0x1f')],'openchannelStatus':this[_0x6704('0x3b')],'openchannelStatusTime':this[_0x6704('0x20')],'openchannelCapacity':this[_0x6704('0x21')],'openchannelCurrentCapacity':this[_0x6704('0x22')],'busy':this[_0x6704('0x23')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this[_0x6704('0x27')],'openchannelWaitingInteractions':this[_0x6704('0x3c')],'smsWaitingInteractions':this[_0x6704('0x3d')],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x1c3cd9=md5(JSON['stringify'](_0x16e749));if(this[_0x6704('0x1')]!==_0x1c3cd9){this[_0x6704('0x1')]=_0x1c3cd9;io[_0x6704('0x3e')](_0x6704('0x3f'),_[_0x6704('0x40')](_0x16e749,[_0x6704('0x8')]));}};module[_0x6704('0x41')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 3397673..5a150c8 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 _0xaa8d=['localhost','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','Agents','loggedIn','paused','available','stringify','format','emit','chat_queue:save','exports','md5','util','ioredis','redis','defaults'];(function(_0x5dcd27,_0x419fbd){var _0x2c03a9=function(_0x91baec){while(--_0x91baec){_0x5dcd27['push'](_0x5dcd27['shift']());}};_0x2c03a9(++_0x419fbd);}(_0xaa8d,0x8b));var _0xdaa8=function(_0x4de07e,_0x231e9e){_0x4de07e=_0x4de07e-0x0;var _0x34e431=_0xaa8d[_0x4de07e];return _0x34e431;};'use strict';var _=require('lodash');var md5=require(_0xdaa8('0x0'));var util=require(_0xdaa8('0x1'));var Redis=require(_0xdaa8('0x2'));var config=require('../../../config/environment');config[_0xdaa8('0x3')]=_[_0xdaa8('0x4')](config[_0xdaa8('0x3')],{'host':_0xdaa8('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x39ee72){this['id']=_0x39ee72['id']||0x0;this[_0xdaa8('0x6')]=_0x39ee72[_0xdaa8('0x6')]||'';this[_0xdaa8('0x7')]=_0x39ee72[_0xdaa8('0x7')]||0xa;this[_0xdaa8('0x8')]=_0x39ee72[_0xdaa8('0x8')]||_0xdaa8('0x9');this['Agents']=_0x39ee72['Agents'];this[_0xdaa8('0xa')]={};this[_0xdaa8('0xb')]=0x0;this[_0xdaa8('0x0')]='';this[_0xdaa8('0xc')]();this[_0xdaa8('0xd')]();}ChatQueue[_0xdaa8('0xe')][_0xdaa8('0xc')]=function(){var _0x11fcbb=this[_0xdaa8('0xa')]['_rr'];this['mapAgentsId']=_['map'](this[_0xdaa8('0xf')],'id');this['mapAgentsId']['_rr']=_0x11fcbb;};ChatQueue[_0xdaa8('0xe')]['updateRealtime']=function(){this[_0xdaa8('0x10')]=0x0;this[_0xdaa8('0x11')]=0x0;for(var _0x211bf1=0x0;_0x211bf1=0x0?this['available']:0x0;var _0x20dc5b={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdaa8('0x10')],'name':this[_0xdaa8('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x493b3b=md5(JSON[_0xdaa8('0x13')](_0x20dc5b));if(this[_0xdaa8('0x0')]!==_0x493b3b){this[_0xdaa8('0x0')]=_0x493b3b;io['to'](util[_0xdaa8('0x14')]('chat:queue:%s',_0x20dc5b[_0xdaa8('0x6')]))[_0xdaa8('0x15')](_0xdaa8('0x16'),_0x20dc5b);}};module[_0xdaa8('0x17')]=ChatQueue; \ No newline at end of file +var _0x26ab=['waiting','updateRealtime','updateRouting','mapAgentsId','map','_rr','prototype','loggedIn','paused','chatPause','available','format','chat:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents'];(function(_0x2f7353,_0x463b18){var _0x432ce5=function(_0x531417){while(--_0x531417){_0x2f7353['push'](_0x2f7353['shift']());}};_0x432ce5(++_0x463b18);}(_0x26ab,0x15f));var _0xb26a=function(_0x51a157,_0x972af){_0x51a157=_0x51a157-0x0;var _0x3b014b=_0x26ab[_0x51a157];return _0x3b014b;};'use strict';var _=require(_0xb26a('0x0'));var md5=require(_0xb26a('0x1'));var util=require(_0xb26a('0x2'));var Redis=require(_0xb26a('0x3'));var config=require(_0xb26a('0x4'));config[_0xb26a('0x5')]=_[_0xb26a('0x6')](config[_0xb26a('0x5')],{'host':_0xb26a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb26a('0x5')]));function ChatQueue(_0x423b1b){this['id']=_0x423b1b['id']||0x0;this[_0xb26a('0x8')]=_0x423b1b[_0xb26a('0x8')]||'';this[_0xb26a('0x9')]=_0x423b1b[_0xb26a('0x9')]||0xa;this[_0xb26a('0xa')]=_0x423b1b[_0xb26a('0xa')]||_0xb26a('0xb');this['Agents']=_0x423b1b[_0xb26a('0xc')];this['mapAgentsId']={};this[_0xb26a('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0xb26a('0xe')]();}ChatQueue['prototype'][_0xb26a('0xf')]=function(){var _0x437b05=this[_0xb26a('0x10')]['_rr'];this['mapAgentsId']=_[_0xb26a('0x11')](this[_0xb26a('0xc')],'id');this[_0xb26a('0x10')][_0xb26a('0x12')]=_0x437b05;};ChatQueue[_0xb26a('0x13')][_0xb26a('0xe')]=function(){this[_0xb26a('0x14')]=0x0;this[_0xb26a('0x15')]=0x0;for(var _0x1335f9=0x0;_0x1335f9=0x0?this[_0xb26a('0x17')]:0x0;var _0x62f1da={'id':this['id'],'available':this[_0xb26a('0x17')],'loggedIn':this[_0xb26a('0x14')],'name':this[_0xb26a('0x8')],'paused':this['paused'],'waiting':this[_0xb26a('0xd')]};var _0x21438d=md5(JSON['stringify'](_0x62f1da));if(this['md5']!==_0x21438d){this[_0xb26a('0x1')]=_0x21438d;io['to'](util[_0xb26a('0x18')](_0xb26a('0x19'),_0x62f1da[_0xb26a('0x8')]))[_0xb26a('0x1a')]('chat_queue:save',_0x62f1da);}};module[_0xb26a('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 333ff27..2bdfe82 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 _0x3e62=['available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','faxPause','paused'];(function(_0x2ad64c,_0x59668f){var _0x1ea8e2=function(_0x312a93){while(--_0x312a93){_0x2ad64c['push'](_0x2ad64c['shift']());}};_0x1ea8e2(++_0x59668f);}(_0x3e62,0xe7));var _0x23e6=function(_0x430b8d,_0x19c0cf){_0x430b8d=_0x430b8d-0x0;var _0x28e9f1=_0x3e62[_0x430b8d];return _0x28e9f1;};'use strict';var _=require(_0x23e6('0x0'));var md5=require(_0x23e6('0x1'));var util=require(_0x23e6('0x2'));var Redis=require(_0x23e6('0x3'));var config=require(_0x23e6('0x4'));config[_0x23e6('0x5')]=_['defaults'](config[_0x23e6('0x5')],{'host':_0x23e6('0x6'),'port':0x18eb});var io=require(_0x23e6('0x7'))(new Redis(config['redis']));function FaxQueue(_0x2559e6){this['id']=_0x2559e6['id']||0x0;this[_0x23e6('0x8')]=_0x2559e6['name']||'';this[_0x23e6('0x9')]=_0x2559e6[_0x23e6('0x9')]||0xa;this[_0x23e6('0xa')]=_0x2559e6[_0x23e6('0xa')]||_0x23e6('0xb');this[_0x23e6('0xc')]=_0x2559e6[_0x23e6('0xc')];this['mapAgentsId']={};this[_0x23e6('0xd')]=0x0;this[_0x23e6('0x1')]='';this[_0x23e6('0xe')]();this[_0x23e6('0xf')]();}FaxQueue[_0x23e6('0x10')]['updateRouting']=function(){var _0x14a5eb=this[_0x23e6('0x11')][_0x23e6('0x12')];this[_0x23e6('0x11')]=_[_0x23e6('0x13')](this[_0x23e6('0xc')],'id');this[_0x23e6('0x11')][_0x23e6('0x12')]=_0x14a5eb;};FaxQueue[_0x23e6('0x10')][_0x23e6('0xf')]=function(){this[_0x23e6('0x14')]=0x0;this['paused']=0x0;for(var _0x5452b1=0x0;_0x5452b1=0x0?this['available']:0x0;var _0x42a963={'id':this['id'],'available':this[_0x23e6('0x19')],'loggedIn':this[_0x23e6('0x14')],'name':this[_0x23e6('0x8')],'paused':this[_0x23e6('0x18')],'waiting':this['waiting']};var _0x1ecc3d=md5(JSON[_0x23e6('0x1a')](_0x42a963));if(this['md5']!==_0x1ecc3d){this['md5']=_0x1ecc3d;io['to'](util[_0x23e6('0x1b')](_0x23e6('0x1c'),_0x42a963[_0x23e6('0x8')]))[_0x23e6('0x1d')](_0x23e6('0x1e'),_0x42a963);}};module[_0x23e6('0x1f')]=FaxQueue; \ No newline at end of file +var _0xfc46=['fax_queue:save','exports','lodash','md5','util','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s'];(function(_0x3328bd,_0x34b6cc){var _0xf2012a=function(_0x35a4e5){while(--_0x35a4e5){_0x3328bd['push'](_0x3328bd['shift']());}};_0xf2012a(++_0x34b6cc);}(_0xfc46,0x1ef));var _0x6fc4=function(_0x24cc72,_0x4dc73a){_0x24cc72=_0x24cc72-0x0;var _0xd49f1e=_0xfc46[_0x24cc72];return _0xd49f1e;};'use strict';var _=require(_0x6fc4('0x0'));var md5=require(_0x6fc4('0x1'));var util=require(_0x6fc4('0x2'));var Redis=require('ioredis');var config=require(_0x6fc4('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x6fc4('0x4'),'port':0x18eb});var io=require(_0x6fc4('0x5'))(new Redis(config[_0x6fc4('0x6')]));function FaxQueue(_0x4c5acd){this['id']=_0x4c5acd['id']||0x0;this[_0x6fc4('0x7')]=_0x4c5acd[_0x6fc4('0x7')]||'';this['timeout']=_0x4c5acd[_0x6fc4('0x8')]||0xa;this['strategy']=_0x4c5acd['strategy']||_0x6fc4('0x9');this[_0x6fc4('0xa')]=_0x4c5acd['Agents'];this[_0x6fc4('0xb')]={};this[_0x6fc4('0xc')]=0x0;this[_0x6fc4('0x1')]='';this[_0x6fc4('0xd')]();this[_0x6fc4('0xe')]();}FaxQueue[_0x6fc4('0xf')]['updateRouting']=function(){var _0x23e04f=this[_0x6fc4('0xb')][_0x6fc4('0x10')];this[_0x6fc4('0xb')]=_[_0x6fc4('0x11')](this[_0x6fc4('0xa')],'id');this[_0x6fc4('0xb')]['_rr']=_0x23e04f;};FaxQueue[_0x6fc4('0xf')][_0x6fc4('0xe')]=function(){this[_0x6fc4('0x12')]=0x0;this[_0x6fc4('0x13')]=0x0;for(var _0x2aa552=0x0;_0x2aa552=0x0?this[_0x6fc4('0x17')]:0x0;var _0x110e59={'id':this['id'],'available':this[_0x6fc4('0x17')],'loggedIn':this[_0x6fc4('0x12')],'name':this[_0x6fc4('0x7')],'paused':this[_0x6fc4('0x13')],'waiting':this[_0x6fc4('0xc')]};var _0x17f596=md5(JSON[_0x6fc4('0x18')](_0x110e59));if(this[_0x6fc4('0x1')]!==_0x17f596){this[_0x6fc4('0x1')]=_0x17f596;io['to'](util[_0x6fc4('0x19')](_0x6fc4('0x1a'),_0x110e59[_0x6fc4('0x7')]))['emit'](_0x6fc4('0x1b'),_0x110e59);}};module[_0x6fc4('0x1c')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 2522cf9..182100a 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 _0x606a=['Intervals'];(function(_0x5c8776,_0x133fc3){var _0x4ebef=function(_0x4bb93b){while(--_0x4bb93b){_0x5c8776['push'](_0x5c8776['shift']());}};_0x4ebef(++_0x133fc3);}(_0x606a,0xcd));var _0xa606=function(_0x55f3f2,_0x57e704){_0x55f3f2=_0x55f3f2-0x0;var _0x4c848a=_0x606a[_0x55f3f2];return _0x4c848a;};'use strict';function Interval(_0x50f7c7){this['id']=_0x50f7c7['id']||0x0;this['name']=_0x50f7c7['name']||'';this[_0xa606('0x0')]=_0x50f7c7[_0xa606('0x0')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xce3f=['exports','name','Intervals'];(function(_0xa6dbc7,_0x846877){var _0x3c073f=function(_0x5ae737){while(--_0x5ae737){_0xa6dbc7['push'](_0xa6dbc7['shift']());}};_0x3c073f(++_0x846877);}(_0xce3f,0xd3));var _0xfce3=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xce3f[_0x18ab2a];return _0x16dcee;};'use strict';function Interval(_0x35272c){this['id']=_0x35272c['id']||0x0;this['name']=_0x35272c[_0xfce3('0x0')]||'';this[_0xfce3('0x1')]=_0x35272c[_0xfce3('0x1')]||{};}module[_0xfce3('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 0368bbf..fe0f08c 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 _0xb3c3=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter'];(function(_0x5e0f1a,_0x1d3041){var _0x487653=function(_0x2bd8d1){while(--_0x2bd8d1){_0x5e0f1a['push'](_0x5e0f1a['shift']());}};_0x487653(++_0x1d3041);}(_0xb3c3,0x1d8));var _0x3b3c=function(_0xb557d1,_0x559ad3){_0xb557d1=_0xb557d1-0x0;var _0x263a2e=_0xb3c3[_0xb557d1];return _0x263a2e;};'use strict';var _=require(_0x3b3c('0x0'));var md5=require(_0x3b3c('0x1'));var util=require(_0x3b3c('0x2'));var Redis=require(_0x3b3c('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x3b3c('0x4')](config[_0x3b3c('0x5')],{'host':_0x3b3c('0x6'),'port':0x18eb});var io=require(_0x3b3c('0x7'))(new Redis(config[_0x3b3c('0x5')]));function MailQueue(_0x32ff92){this['id']=_0x32ff92['id']||0x0;this[_0x3b3c('0x8')]=_0x32ff92[_0x3b3c('0x8')]||'';this[_0x3b3c('0x9')]=_0x32ff92[_0x3b3c('0x9')]||0xa;this[_0x3b3c('0xa')]=_0x32ff92[_0x3b3c('0xa')]||_0x3b3c('0xb');this[_0x3b3c('0xc')]=_0x32ff92[_0x3b3c('0xc')];this[_0x3b3c('0xd')]={};this[_0x3b3c('0xe')]=0x0;this['md5']='';this[_0x3b3c('0xf')]();this[_0x3b3c('0x10')]();}MailQueue[_0x3b3c('0x11')]['updateRouting']=function(){var _0x2e7120=this['mapAgentsId'][_0x3b3c('0x12')];this[_0x3b3c('0xd')]=_['map'](this[_0x3b3c('0xc')],'id');this[_0x3b3c('0xd')][_0x3b3c('0x12')]=_0x2e7120;};MailQueue[_0x3b3c('0x11')][_0x3b3c('0x10')]=function(){this[_0x3b3c('0x13')]=0x0;this[_0x3b3c('0x14')]=0x0;for(var _0x2f6b4b=0x0;_0x2f6b4b=0x0?this['available']:0x0;var _0x294b69={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x3b3c('0x8')],'paused':this[_0x3b3c('0x14')],'waiting':this[_0x3b3c('0xe')]};var _0x5a4036=md5(JSON['stringify'](_0x294b69));if(this[_0x3b3c('0x1')]!==_0x5a4036){this['md5']=_0x5a4036;io['to'](util[_0x3b3c('0x19')](_0x3b3c('0x1a'),_0x294b69[_0x3b3c('0x8')]))[_0x3b3c('0x1b')](_0x3b3c('0x1c'),_0x294b69);}};module[_0x3b3c('0x1d')]=MailQueue; \ No newline at end of file +var _0x6c1f=['strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','mailPause','available','format','exports','md5','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x6c1f,0x179));var _0xf6c1=function(_0x5309f0,_0x381caf){_0x5309f0=_0x5309f0-0x0;var _0x3c5ff0=_0x6c1f[_0x5309f0];return _0x3c5ff0;};'use strict';var _=require('lodash');var md5=require(_0xf6c1('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0xf6c1('0x1'));config[_0xf6c1('0x2')]=_[_0xf6c1('0x3')](config[_0xf6c1('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0xf6c1('0x4'))(new Redis(config[_0xf6c1('0x2')]));function MailQueue(_0x42fa96){this['id']=_0x42fa96['id']||0x0;this['name']=_0x42fa96[_0xf6c1('0x5')]||'';this['timeout']=_0x42fa96[_0xf6c1('0x6')]||0xa;this[_0xf6c1('0x7')]=_0x42fa96[_0xf6c1('0x7')]||_0xf6c1('0x8');this[_0xf6c1('0x9')]=_0x42fa96[_0xf6c1('0x9')];this[_0xf6c1('0xa')]={};this[_0xf6c1('0xb')]=0x0;this[_0xf6c1('0x0')]='';this[_0xf6c1('0xc')]();this[_0xf6c1('0xd')]();}MailQueue[_0xf6c1('0xe')][_0xf6c1('0xc')]=function(){var _0x52c832=this[_0xf6c1('0xa')][_0xf6c1('0xf')];this[_0xf6c1('0xa')]=_['map'](this[_0xf6c1('0x9')],'id');this[_0xf6c1('0xa')][_0xf6c1('0xf')]=_0x52c832;};MailQueue[_0xf6c1('0xe')][_0xf6c1('0xd')]=function(){this[_0xf6c1('0x10')]=0x0;this[_0xf6c1('0x11')]=0x0;for(var _0x30a2a4=0x0;_0x30a2a4=0x0?this[_0xf6c1('0x15')]:0x0;var _0x107bb9={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf6c1('0x10')],'name':this[_0xf6c1('0x5')],'paused':this['paused'],'waiting':this[_0xf6c1('0xb')]};var _0x296857=md5(JSON['stringify'](_0x107bb9));if(this[_0xf6c1('0x0')]!==_0x296857){this[_0xf6c1('0x0')]=_0x296857;io['to'](util[_0xf6c1('0x16')]('mail:queue:%s',_0x107bb9['name']))['emit']('mail_queue:save',_0x107bb9);}};module[_0xf6c1('0x17')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 4921919..21d40a4 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['stringify','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','paused','length','online','available','loggedIn','name'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x2ef3,0xba));var _0x32ef=function(_0x460958,_0x5331ca){_0x460958=_0x460958-0x0;var _0x3772ca=_0x2ef3[_0x460958];return _0x3772ca;};'use strict';var _=require(_0x32ef('0x0'));var md5=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var Redis=require(_0x32ef('0x3'));var config=require(_0x32ef('0x4'));config[_0x32ef('0x5')]=_['defaults'](config[_0x32ef('0x5')],{'host':_0x32ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x32ef('0x5')]));function OpenchannelQueue(_0x37dd1d){this['id']=_0x37dd1d['id']||0x0;this['name']=_0x37dd1d['name']||'';this[_0x32ef('0x7')]=_0x37dd1d[_0x32ef('0x7')]||0xa;this[_0x32ef('0x8')]=_0x37dd1d[_0x32ef('0x8')]||_0x32ef('0x9');this[_0x32ef('0xa')]=_0x37dd1d[_0x32ef('0xa')];this[_0x32ef('0xb')]={};this[_0x32ef('0xc')]=0x0;this[_0x32ef('0x1')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x32ef('0xd')][_0x32ef('0xe')]=function(){var _0x45bfd5=this[_0x32ef('0xb')]['_rr'];this[_0x32ef('0xb')]=_['map'](this[_0x32ef('0xa')],'id');this['mapAgentsId'][_0x32ef('0xf')]=_0x45bfd5;};OpenchannelQueue[_0x32ef('0xd')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x32ef('0x10')]=0x0;for(var _0x4d8009=0x0;_0x4d8009=0x0?this[_0x32ef('0x13')]:0x0;var _0x286bfb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x32ef('0x14')],'name':this[_0x32ef('0x15')],'paused':this['paused'],'waiting':this[_0x32ef('0xc')]};var _0x314ef1=md5(JSON[_0x32ef('0x16')](_0x286bfb));if(this[_0x32ef('0x1')]!==_0x314ef1){this[_0x32ef('0x1')]=_0x314ef1;io['to'](util[_0x32ef('0x17')]('openchannel:queue:%s',_0x286bfb[_0x32ef('0x15')]))['emit'](_0x32ef('0x18'),_0x286bfb);}};module[_0x32ef('0x19')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x1261,0x144));var _0x1126=function(_0x3bb557,_0x2d4e15){_0x3bb557=_0x3bb557-0x0;var _0x5eebcb=_0x1261[_0x3bb557];return _0x5eebcb;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('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 c3d37c6..30ac73e 100644 --- a/server/services/routing/model/smsQueue.js +++ b/server/services/routing/model/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f69=['prototype','updateRealtime','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s','sms_queue:save','util','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x0f69,0x173));var _0x90f6=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x0f69[_0x2261ce];return _0x524640;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x90f6('0x0'));var Redis=require('ioredis');var config=require(_0x90f6('0x1'));config[_0x90f6('0x2')]=_['defaults'](config[_0x90f6('0x2')],{'host':_0x90f6('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90f6('0x2')]));function SmsQueue(_0x558130){this['id']=_0x558130['id']||0x0;this[_0x90f6('0x4')]=_0x558130[_0x90f6('0x4')]||'';this[_0x90f6('0x5')]=_0x558130[_0x90f6('0x5')]||0xa;this[_0x90f6('0x6')]=_0x558130[_0x90f6('0x6')]||_0x90f6('0x7');this[_0x90f6('0x8')]=_0x558130[_0x90f6('0x8')];this[_0x90f6('0x9')]={};this[_0x90f6('0xa')]=0x0;this[_0x90f6('0xb')]='';this[_0x90f6('0xc')]();this['updateRealtime']();}SmsQueue[_0x90f6('0xd')][_0x90f6('0xc')]=function(){var _0x51930c=this[_0x90f6('0x9')]['_rr'];this[_0x90f6('0x9')]=_['map'](this['Agents'],'id');this[_0x90f6('0x9')]['_rr']=_0x51930c;};SmsQueue[_0x90f6('0xd')][_0x90f6('0xe')]=function(){this[_0x90f6('0xf')]=0x0;this[_0x90f6('0x10')]=0x0;for(var _0x47fd3c=0x0;_0x47fd3c=0x0?this[_0x90f6('0x13')]:0x0;var _0x2898a8={'id':this['id'],'available':this['available'],'loggedIn':this[_0x90f6('0xf')],'name':this[_0x90f6('0x4')],'paused':this[_0x90f6('0x10')],'waiting':this[_0x90f6('0xa')]};var _0x3e6dc0=md5(JSON[_0x90f6('0x14')](_0x2898a8));if(this[_0x90f6('0xb')]!==_0x3e6dc0){this['md5']=_0x3e6dc0;io['to'](util[_0x90f6('0x15')](_0x90f6('0x16'),_0x2898a8['name']))['emit'](_0x90f6('0x17'),_0x2898a8);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xfd2f=['socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','online','loggedIn','smsPause','paused','available','name','format','sms_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis'];(function(_0xbc5053,_0x2cf59d){var _0x4df1f5=function(_0x3c2a1d){while(--_0x3c2a1d){_0xbc5053['push'](_0xbc5053['shift']());}};_0x4df1f5(++_0x2cf59d);}(_0xfd2f,0x14a));var _0xffd2=function(_0x476340,_0x746bb8){_0x476340=_0x476340-0x0;var _0x4ea2f5=_0xfd2f[_0x476340];return _0x4ea2f5;};'use strict';var _=require(_0xffd2('0x0'));var md5=require(_0xffd2('0x1'));var util=require(_0xffd2('0x2'));var Redis=require('ioredis');var config=require(_0xffd2('0x3'));config['redis']=_[_0xffd2('0x4')](config[_0xffd2('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xffd2('0x6'))(new Redis(config[_0xffd2('0x5')]));function SmsQueue(_0x4aef44){this['id']=_0x4aef44['id']||0x0;this['name']=_0x4aef44['name']||'';this[_0xffd2('0x7')]=_0x4aef44[_0xffd2('0x7')]||0xa;this['strategy']=_0x4aef44[_0xffd2('0x8')]||'beepall';this['Agents']=_0x4aef44[_0xffd2('0x9')];this[_0xffd2('0xa')]={};this[_0xffd2('0xb')]=0x0;this[_0xffd2('0x1')]='';this['updateRouting']();this[_0xffd2('0xc')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x506d58=this[_0xffd2('0xa')][_0xffd2('0xd')];this[_0xffd2('0xa')]=_[_0xffd2('0xe')](this[_0xffd2('0x9')],'id');this[_0xffd2('0xa')][_0xffd2('0xd')]=_0x506d58;};SmsQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2f0d34=0x0;_0x2f0d34=0x0?this[_0xffd2('0x13')]:0x0;var _0x214737={'id':this['id'],'available':this['available'],'loggedIn':this[_0xffd2('0x10')],'name':this[_0xffd2('0x14')],'paused':this[_0xffd2('0x12')],'waiting':this[_0xffd2('0xb')]};var _0x49690c=md5(JSON['stringify'](_0x214737));if(this[_0xffd2('0x1')]!==_0x49690c){this[_0xffd2('0x1')]=_0x49690c;io['to'](util[_0xffd2('0x15')]('sms:queue:%s',_0x214737[_0xffd2('0x14')]))['emit'](_0xffd2('0x16'),_0x214737);}};module[_0xffd2('0x17')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index ba57c29..8287742 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 _0xcd72=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','whatsappPause','available','md5','format','whatsapp:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name'];(function(_0x3440e1,_0x144ab3){var _0x520ec3=function(_0x18f865){while(--_0x18f865){_0x3440e1['push'](_0x3440e1['shift']());}};_0x520ec3(++_0x144ab3);}(_0xcd72,0x11a));var _0x2cd7=function(_0xfd495c,_0x4a3c1a){_0xfd495c=_0xfd495c-0x0;var _0x561dd8=_0xcd72[_0xfd495c];return _0x561dd8;};'use strict';var _=require(_0x2cd7('0x0'));var md5=require('md5');var util=require(_0x2cd7('0x1'));var Redis=require(_0x2cd7('0x2'));var config=require(_0x2cd7('0x3'));config[_0x2cd7('0x4')]=_[_0x2cd7('0x5')](config['redis'],{'host':_0x2cd7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x19521e){this['id']=_0x19521e['id']||0x0;this[_0x2cd7('0x7')]=_0x19521e[_0x2cd7('0x7')]||'';this['timeout']=_0x19521e[_0x2cd7('0x8')]||0xa;this['strategy']=_0x19521e[_0x2cd7('0x9')]||_0x2cd7('0xa');this[_0x2cd7('0xb')]=_0x19521e[_0x2cd7('0xb')];this[_0x2cd7('0xc')]={};this[_0x2cd7('0xd')]=0x0;this['md5']='';this[_0x2cd7('0xe')]();this[_0x2cd7('0xf')]();}WhatsappQueue[_0x2cd7('0x10')]['updateRouting']=function(){var _0x5d4851=this[_0x2cd7('0xc')]['_rr'];this['mapAgentsId']=_[_0x2cd7('0x11')](this[_0x2cd7('0xb')],'id');this[_0x2cd7('0xc')][_0x2cd7('0x12')]=_0x5d4851;};WhatsappQueue[_0x2cd7('0x10')][_0x2cd7('0xf')]=function(){this[_0x2cd7('0x13')]=0x0;this[_0x2cd7('0x14')]=0x0;for(var _0x2b66ee=0x0;_0x2b66ee=0x0?this[_0x2cd7('0x17')]:0x0;var _0x256e08={'id':this['id'],'available':this[_0x2cd7('0x17')],'loggedIn':this[_0x2cd7('0x13')],'name':this[_0x2cd7('0x7')],'paused':this['paused'],'waiting':this[_0x2cd7('0xd')]};var _0x42e4d3=md5(JSON['stringify'](_0x256e08));if(this[_0x2cd7('0x18')]!==_0x42e4d3){this[_0x2cd7('0x18')]=_0x42e4d3;io['to'](util[_0x2cd7('0x19')](_0x2cd7('0x1a'),_0x256e08['name']))[_0x2cd7('0x1b')]('whatsapp_queue:save',_0x256e08);}};module[_0x2cd7('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x5cc7=['_rr','prototype','updateRealtime','loggedIn','paused','length','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting'];(function(_0x4e7ee0,_0x25eb02){var _0x509369=function(_0x43cfa9){while(--_0x43cfa9){_0x4e7ee0['push'](_0x4e7ee0['shift']());}};_0x509369(++_0x25eb02);}(_0x5cc7,0xcb));var _0x75cc=function(_0x1ad164,_0x56a17f){_0x1ad164=_0x1ad164-0x0;var _0x2ad9e0=_0x5cc7[_0x1ad164];return _0x2ad9e0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x75cc('0x0'));var Redis=require(_0x75cc('0x1'));var config=require('../../../config/environment');config[_0x75cc('0x2')]=_[_0x75cc('0x3')](config[_0x75cc('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x75cc('0x4'))(new Redis(config[_0x75cc('0x2')]));function WhatsappQueue(_0x18e5fd){this['id']=_0x18e5fd['id']||0x0;this[_0x75cc('0x5')]=_0x18e5fd[_0x75cc('0x5')]||'';this[_0x75cc('0x6')]=_0x18e5fd[_0x75cc('0x6')]||0xa;this['strategy']=_0x18e5fd['strategy']||_0x75cc('0x7');this['Agents']=_0x18e5fd[_0x75cc('0x8')];this[_0x75cc('0x9')]={};this[_0x75cc('0xa')]=0x0;this[_0x75cc('0xb')]='';this[_0x75cc('0xc')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0x75cc('0xc')]=function(){var _0xc28b3d=this[_0x75cc('0x9')]['_rr'];this[_0x75cc('0x9')]=_['map'](this['Agents'],'id');this[_0x75cc('0x9')][_0x75cc('0xd')]=_0xc28b3d;};WhatsappQueue[_0x75cc('0xe')][_0x75cc('0xf')]=function(){this[_0x75cc('0x10')]=0x0;this[_0x75cc('0x11')]=0x0;for(var _0x2e4ecf=0x0;_0x2e4ecf=0x0?this['available']:0x0;var _0x42b670={'id':this['id'],'available':this[_0x75cc('0x15')],'loggedIn':this[_0x75cc('0x10')],'name':this['name'],'paused':this[_0x75cc('0x11')],'waiting':this[_0x75cc('0xa')]};var _0x43afdf=md5(JSON[_0x75cc('0x16')](_0x42b670));if(this[_0x75cc('0xb')]!==_0x43afdf){this['md5']=_0x43afdf;io['to'](util[_0x75cc('0x17')](_0x75cc('0x18'),_0x42b670['name']))['emit'](_0x75cc('0x19'),_0x42b670);}};module[_0x75cc('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index afc0f8b..b5e9e60 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x294ae8,_0x40b1b8){var _0x218d65=function(_0x2c3d33){while(--_0x2c3d33){_0x294ae8['push'](_0x294ae8['shift']());}};_0x218d65(++_0x40b1b8);}(_0xb10b,0x12a));var _0xbb10=function(_0x5cb5fc,_0x6cdda3){_0x5cb5fc=_0x5cb5fc-0x0;var _0x4b6fab=_0xb10b[_0x5cb5fc];return _0x4b6fab;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 1269ca4..cdf5ee8 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 _0x1e44=['UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xc6aa4f,_0x221107){var _0x22a3a8=function(_0x100c86){while(--_0x100c86){_0xc6aa4f['push'](_0xc6aa4f['shift']());}};_0x22a3a8(++_0x221107);}(_0x1e44,0x7b));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x41e4('0x0'));exports[_0x41e4('0x1')]=function(_0x21828,_0x83d827){return client[_0x41e4('0x2')](_0x41e4('0x3'),{'body':_0x83d827,'options':{'where':{'id':_0x21828}},'log':_0x41e4('0x4')});};exports['addTags']=function(_0x3d4edb,_0x18b184){return client[_0x41e4('0x2')](_0x41e4('0x5'),{'body':_0x18b184,'options':{'where':{'id':_0x3d4edb}},'log':_0x41e4('0x6')});}; \ No newline at end of file +var _0xd531=['updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xd531,0x129));var _0x1d53=function(_0x13c82f,_0x353a63){_0x13c82f=_0x13c82f-0x0;var _0x117e17=_0xd531[_0x13c82f];return _0x117e17;};'use strict';var client=require('../client');exports[_0x1d53('0x0')]=function(_0x1a56e3,_0x3de272){return client[_0x1d53('0x1')](_0x1d53('0x2'),{'body':_0x3de272,'options':{'where':{'id':_0x1a56e3}},'log':_0x1d53('0x3')});};exports['addTags']=function(_0xf3fffe,_0x132a62){return client[_0x1d53('0x1')](_0x1d53('0x4'),{'body':_0x132a62,'options':{'where':{'id':_0xf3fffe}},'log':_0x1d53('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 10bf948..17de452 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 _0xec3b=['create','Request','../client'];(function(_0x263754,_0x5cd642){var _0x16d109=function(_0x1cd382){while(--_0x1cd382){_0x263754['push'](_0x263754['shift']());}};_0x16d109(++_0x5cd642);}(_0xec3b,0x179));var _0xbec3=function(_0x1f6801,_0x496ebc){_0x1f6801=_0x1f6801-0x0;var _0x546735=_0xec3b[_0x1f6801];return _0x546735;};'use strict';var client=require(_0xbec3('0x0'));exports[_0xbec3('0x1')]=function(_0x4fbedb){return client[_0xbec3('0x2')]('CreateChatMessage',{'body':_0x4fbedb,'log':'createChatMessage'});}; \ No newline at end of file +var _0x41b7=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x8212b9,_0x4b8686){var _0x10184c=function(_0x43292c){while(--_0x43292c){_0x8212b9['push'](_0x8212b9['shift']());}};_0x10184c(++_0x4b8686);}(_0x41b7,0x1d2));var _0x741b=function(_0x46e515,_0x390228){_0x46e515=_0x46e515-0x0;var _0x3753f0=_0x41b7[_0x46e515];return _0x3753f0;};'use strict';var client=require(_0x741b('0x0'));exports[_0x741b('0x1')]=function(_0x53c088){return client[_0x741b('0x2')](_0x741b('0x3'),{'body':_0x53c088,'log':_0x741b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2b86b6f..a05770b 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 _0xe132=['Agents','getChatQueues','../client','Request','GetChatQueue','name','timeout','strategy'];(function(_0x43b1bd,_0x5784aa){var _0x41f044=function(_0x5d308d){while(--_0x5d308d){_0x43b1bd['push'](_0x43b1bd['shift']());}};_0x41f044(++_0x5784aa);}(_0xe132,0x162));var _0x2e13=function(_0x103aac,_0x3e1929){_0x103aac=_0x103aac-0x0;var _0x187ccc=_0xe132[_0x103aac];return _0x187ccc;};'use strict';var client=require(_0x2e13('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x2e13('0x1')](_0x2e13('0x2'),{'options':{'raw':![],'attributes':['id',_0x2e13('0x3'),_0x2e13('0x4'),_0x2e13('0x5')],'include':[{'model':'User','as':_0x2e13('0x6'),'attributes':['id',_0x2e13('0x3'),'online','chatPause']}]},'log':_0x2e13('0x7')});};}; \ No newline at end of file +var _0x9649=['chatPause','../client','getChatQueues','Request','GetChatQueue','timeout','strategy','Agents','online'];(function(_0x1824c6,_0x79fcc3){var _0xbc0e9a=function(_0x4262ef){while(--_0x4262ef){_0x1824c6['push'](_0x1824c6['shift']());}};_0xbc0e9a(++_0x79fcc3);}(_0x9649,0x19f));var _0x9964=function(_0x1601aa,_0x333d2b){_0x1601aa=_0x1601aa-0x0;var _0x4dbbde=_0x9649[_0x1601aa];return _0x4dbbde;};'use strict';var client=require(_0x9964('0x0'));exports[_0x9964('0x1')]=function(){return function(){return client[_0x9964('0x2')](_0x9964('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9964('0x4'),_0x9964('0x5')],'include':[{'model':'User','as':_0x9964('0x6'),'attributes':['id','name',_0x9964('0x7'),_0x9964('0x8')]}]},'log':_0x9964('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index a8d74fe..3204fd2 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 _0x3a25=['create','Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3a25,0x15d));var _0x53a2=function(_0x41ac9e,_0x168e0d){_0x41ac9e=_0x41ac9e-0x0;var _0x2773c1=_0x3a25[_0x41ac9e];return _0x2773c1;};'use strict';var client=require(_0x53a2('0x0'));exports[_0x53a2('0x1')]=function(_0x200e41){return client[_0x53a2('0x2')](_0x53a2('0x3'),{'body':_0x200e41,'log':_0x53a2('0x3')});};exports[_0x53a2('0x4')]=function(_0x1f138b,_0x3f9730){return client[_0x53a2('0x2')](_0x53a2('0x5'),{'body':_0x3f9730,'options':{'where':{'uniqueid':_0x1f138b},'order':[['id',_0x53a2('0x6')]],'limit':0x1},'log':_0x53a2('0x5')});}; \ No newline at end of file +var _0xb6b1=['CreateChatQueueReport','Request','UpdateChatQueueReport','DESC','../client'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xb6b1[_0x587ba2];return _0x50ec73;};'use strict';var client=require(_0x1b6b('0x0'));exports['create']=function(_0x669faa){return client['Request'](_0x1b6b('0x1'),{'body':_0x669faa,'log':_0x1b6b('0x1')});};exports['update']=function(_0x3f12e2,_0x5100e5){return client[_0x1b6b('0x2')](_0x1b6b('0x3'),{'body':_0x5100e5,'options':{'where':{'uniqueid':_0x3f12e2},'order':[['id',_0x1b6b('0x4')]],'limit':0x1},'log':_0x1b6b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 21cec36..9e60080 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1d8915,_0x285a4e){var _0xa9b9a8=function(_0x15f99e){while(--_0x15f99e){_0x1d8915['push'](_0x1d8915['shift']());}};_0xa9b9a8(++_0x285a4e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xe59818,_0x303785){var _0x2ced94=function(_0x4b389a){while(--_0x4b389a){_0xe59818['push'](_0xe59818['shift']());}};_0x2ced94(++_0x303785);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index f71d43e..53669f6 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 _0xf7bf=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0xf7bf,0x1f1));var _0xff7b=function(_0x3249e5,_0x449631){_0x3249e5=_0x3249e5-0x0;var _0x1618ce=_0xf7bf[_0x3249e5];return _0x1618ce;};'use strict';var client=require(_0xff7b('0x0'));exports[_0xff7b('0x1')]=function(_0x24136d){return client['Request'](_0xff7b('0x2'),{'body':_0x24136d,'log':_0xff7b('0x3')});}; \ No newline at end of file +var _0x9802=['../client','create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9802,0xaf));var _0x2980=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9802[_0x8c43de];return _0xa6591b;};'use strict';var client=require(_0x2980('0x0'));exports[_0x2980('0x1')]=function(_0x3bb5d6){return client[_0x2980('0x2')](_0x2980('0x3'),{'body':_0x3bb5d6,'log':_0x2980('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4e9dc70..f9fd22a 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 _0xfd7a=['Request','GetFaxQueue','timeout','strategy','User','name','faxPause','../client'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xfd7a,0x1c7));var _0xafd7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd7a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xafd7('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xafd7('0x1')](_0xafd7('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xafd7('0x3'),_0xafd7('0x4')],'include':[{'model':_0xafd7('0x5'),'as':'Agents','attributes':['id',_0xafd7('0x6'),'online',_0xafd7('0x7')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x28d7=['../client','GetFaxQueue','name','timeout','User','online','faxPause','getFaxQueues'];(function(_0x4f0b9a,_0x2d4722){var _0x482f2f=function(_0x15a683){while(--_0x15a683){_0x4f0b9a['push'](_0x4f0b9a['shift']());}};_0x482f2f(++_0x2d4722);}(_0x28d7,0x108));var _0x728d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28d7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x728d('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x728d('0x1'),{'options':{'raw':![],'attributes':['id',_0x728d('0x2'),_0x728d('0x3'),'strategy'],'include':[{'model':_0x728d('0x4'),'as':'Agents','attributes':['id',_0x728d('0x2'),_0x728d('0x5'),_0x728d('0x6')]}]},'log':_0x728d('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 72156de..3a82cb4 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 _0xc0b5=['Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x1450b1,_0x2293d2){var _0x285070=function(_0x3235d0){while(--_0x3235d0){_0x1450b1['push'](_0x1450b1['shift']());}};_0x285070(++_0x2293d2);}(_0xc0b5,0x132));var _0x5c0b=function(_0x2b0aec,_0x25f904){_0x2b0aec=_0x2b0aec-0x0;var _0x290468=_0xc0b5[_0x2b0aec];return _0x290468;};'use strict';var client=require(_0x5c0b('0x0'));exports[_0x5c0b('0x1')]=function(_0x4acb24){return client[_0x5c0b('0x2')](_0x5c0b('0x3'),{'body':_0x4acb24,'log':'CreateFaxQueueReport'});};exports[_0x5c0b('0x4')]=function(_0x363cd4,_0x3a4fe7){return client[_0x5c0b('0x2')](_0x5c0b('0x5'),{'body':_0x3a4fe7,'options':{'where':{'uniqueid':_0x363cd4},'order':[['id',_0x5c0b('0x6')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x1a49=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x4f4c22,_0x15c10b){var _0x2525a3=function(_0x4f5340){while(--_0x4f5340){_0x4f4c22['push'](_0x4f4c22['shift']());}};_0x2525a3(++_0x15c10b);}(_0x1a49,0x1bb));var _0x91a4=function(_0x2b12be,_0xb9ff1){_0x2b12be=_0x2b12be-0x0;var _0x4093e0=_0x1a49[_0x2b12be];return _0x4093e0;};'use strict';var client=require(_0x91a4('0x0'));exports[_0x91a4('0x1')]=function(_0x22de9a){return client[_0x91a4('0x2')](_0x91a4('0x3'),{'body':_0x22de9a,'log':_0x91a4('0x3')});};exports['update']=function(_0x5169e2,_0x10d5fb){return client[_0x91a4('0x2')](_0x91a4('0x4'),{'body':_0x10d5fb,'options':{'where':{'uniqueid':_0x5169e2},'order':[['id',_0x91a4('0x5')]],'limit':0x1},'log':_0x91a4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a3030a5..610a9c4 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 _0x04ad=['name','Interval','Intervals','../client','getIntervals','Request','GetInterval'];(function(_0x246f61,_0x358b96){var _0xc28ed3=function(_0x19367e){while(--_0x19367e){_0x246f61['push'](_0x246f61['shift']());}};_0xc28ed3(++_0x358b96);}(_0x04ad,0x145));var _0xd04a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x04ad[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xd04a('0x0'));exports[_0xd04a('0x1')]=function(){return function(){return client[_0xd04a('0x2')](_0xd04a('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd04a('0x4')],'include':[{'model':_0xd04a('0x5'),'as':_0xd04a('0x6'),'attributes':['id','name','interval']}]},'log':_0xd04a('0x1')});};}; \ No newline at end of file +var _0xc255=['../client','getIntervals','Request','GetInterval','Interval','Intervals','name','interval'];(function(_0x59e7c0,_0x2f6c31){var _0x5ab750=function(_0x3c23d7){while(--_0x3c23d7){_0x59e7c0['push'](_0x59e7c0['shift']());}};_0x5ab750(++_0x2f6c31);}(_0xc255,0x98));var _0x5c25=function(_0x62f1a2,_0x7d84cb){_0x62f1a2=_0x62f1a2-0x0;var _0x137fb0=_0xc255[_0x62f1a2];return _0x137fb0;};'use strict';var client=require(_0x5c25('0x0'));exports[_0x5c25('0x1')]=function(){return function(){return client[_0x5c25('0x2')](_0x5c25('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x5c25('0x4'),'as':_0x5c25('0x5'),'attributes':['id',_0x5c25('0x6'),_0x5c25('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 778bada..ba5f0cd 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 _0x8603=['update','updateMailInteraction','addTags','Request','addTagsToChatInteraction'];(function(_0x447678,_0x3a16b3){var _0x4355ba=function(_0x415e47){while(--_0x415e47){_0x447678['push'](_0x447678['shift']());}};_0x4355ba(++_0x3a16b3);}(_0x8603,0x190));var _0x3860=function(_0x9a825b,_0x35c63e){_0x9a825b=_0x9a825b-0x0;var _0x4e5706=_0x8603[_0x9a825b];return _0x4e5706;};'use strict';var client=require('../client');exports[_0x3860('0x0')]=function(_0x3b9c54,_0x96d2bc){return client['Request']('UpdateMailInteraction',{'body':_0x96d2bc,'options':{'where':{'id':_0x3b9c54}},'log':_0x3860('0x1')});};exports[_0x3860('0x2')]=function(_0x2f56a3,_0x490262){return client[_0x3860('0x3')]('AddTagsToMailInteraction',{'body':_0x490262,'options':{'where':{'id':_0x2f56a3}},'log':_0x3860('0x4')});}; \ No newline at end of file +var _0xb145=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x223315,_0x1493c7){var _0x97697=function(_0x582be3){while(--_0x582be3){_0x223315['push'](_0x223315['shift']());}};_0x97697(++_0x1493c7);}(_0xb145,0xa3));var _0x5b14=function(_0x5d7842,_0x3fc5a4){_0x5d7842=_0x5d7842-0x0;var _0x4d072a=_0xb145[_0x5d7842];return _0x4d072a;};'use strict';var client=require('../client');exports[_0x5b14('0x0')]=function(_0xc54593,_0x935de1){return client[_0x5b14('0x1')](_0x5b14('0x2'),{'body':_0x935de1,'options':{'where':{'id':_0xc54593}},'log':_0x5b14('0x3')});};exports[_0x5b14('0x4')]=function(_0x34b4cd,_0x5111cd){return client[_0x5b14('0x1')](_0x5b14('0x5'),{'body':_0x5111cd,'options':{'where':{'id':_0x34b4cd}},'log':_0x5b14('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 89e865c..4282ef3 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 _0x63be=['createMailMessage','../client','create','CreateMailMessage'];(function(_0x5bf529,_0x26a711){var _0xeb9350=function(_0x107638){while(--_0x107638){_0x5bf529['push'](_0x5bf529['shift']());}};_0xeb9350(++_0x26a711);}(_0x63be,0x175));var _0xe63b=function(_0x1f7f54,_0x5d6801){_0x1f7f54=_0x1f7f54-0x0;var _0x515d30=_0x63be[_0x1f7f54];return _0x515d30;};'use strict';var client=require(_0xe63b('0x0'));exports[_0xe63b('0x1')]=function(_0x190cdb){return client['Request'](_0xe63b('0x2'),{'body':_0x190cdb,'log':_0xe63b('0x3')});}; \ No newline at end of file +var _0x9a14=['createMailMessage','../client','create','CreateMailMessage'];(function(_0x574093,_0x5096bc){var _0x3e9b44=function(_0x3792c7){while(--_0x3792c7){_0x574093['push'](_0x574093['shift']());}};_0x3e9b44(++_0x5096bc);}(_0x9a14,0x129));var _0x49a1=function(_0x67696b,_0x365f1f){_0x67696b=_0x67696b-0x0;var _0x167465=_0x9a14[_0x67696b];return _0x167465;};'use strict';var client=require(_0x49a1('0x0'));exports[_0x49a1('0x1')]=function(_0x4ff116){return client['Request'](_0x49a1('0x2'),{'body':_0x4ff116,'log':_0x49a1('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 61e5716..ffc6d23 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 _0x0088=['Request','strategy','Agents','name','online','getMailQueues','../client'];(function(_0x289e48,_0x2fe387){var _0x56d497=function(_0x2abb13){while(--_0x2abb13){_0x289e48['push'](_0x289e48['shift']());}};_0x56d497(++_0x2fe387);}(_0x0088,0xa0));var _0x8008=function(_0x11e6e1,_0x4d96c9){_0x11e6e1=_0x11e6e1-0x0;var _0x4522c8=_0x0088[_0x11e6e1];return _0x4522c8;};'use strict';var client=require(_0x8008('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x8008('0x1')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x8008('0x2')],'include':[{'model':'User','as':_0x8008('0x3'),'attributes':['id',_0x8008('0x4'),_0x8008('0x5'),'mailPause']}]},'log':_0x8008('0x6')});};}; \ No newline at end of file +var _0xab63=['name','getMailQueues','../client','Request','GetMailQueue','User'];(function(_0x5bdeb6,_0x97decc){var _0x3f5c44=function(_0x1c885b){while(--_0x1c885b){_0x5bdeb6['push'](_0x5bdeb6['shift']());}};_0x3f5c44(++_0x97decc);}(_0xab63,0x16a));var _0x3ab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab63[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3ab6('0x0'));exports['getMailQueues']=function(){return function(){return client[_0x3ab6('0x1')](_0x3ab6('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x3ab6('0x3'),'as':'Agents','attributes':['id',_0x3ab6('0x4'),'online','mailPause']}]},'log':_0x3ab6('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index be96557..9c51a2e 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 _0x00eb=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x4aa0f5,_0x226f68){var _0x55bc62=function(_0xfd87f){while(--_0xfd87f){_0x4aa0f5['push'](_0x4aa0f5['shift']());}};_0x55bc62(++_0x226f68);}(_0x00eb,0x69));var _0xb00e=function(_0x5ed28e,_0x512a85){_0x5ed28e=_0x5ed28e-0x0;var _0x1ef1b7=_0x00eb[_0x5ed28e];return _0x1ef1b7;};'use strict';var client=require(_0xb00e('0x0'));exports[_0xb00e('0x1')]=function(_0x32ac0a){return client[_0xb00e('0x2')](_0xb00e('0x3'),{'body':_0x32ac0a,'log':_0xb00e('0x3')});};exports[_0xb00e('0x4')]=function(_0x1ce112,_0x174360){return client[_0xb00e('0x2')](_0xb00e('0x5'),{'body':_0x174360,'options':{'where':{'uniqueid':_0x1ce112},'order':[['id',_0xb00e('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xcc2f=['../client','create','Request','CreateMailQueueReport','UpdateMailQueueReport'];(function(_0x393efc,_0x10412c){var _0x48a571=function(_0x3b08e7){while(--_0x3b08e7){_0x393efc['push'](_0x393efc['shift']());}};_0x48a571(++_0x10412c);}(_0xcc2f,0xc3));var _0xfcc2=function(_0x22927f,_0x294eee){_0x22927f=_0x22927f-0x0;var _0xb50bee=_0xcc2f[_0x22927f];return _0xb50bee;};'use strict';var client=require(_0xfcc2('0x0'));exports[_0xfcc2('0x1')]=function(_0x29cee5){return client[_0xfcc2('0x2')](_0xfcc2('0x3'),{'body':_0x29cee5,'log':_0xfcc2('0x3')});};exports['update']=function(_0xa060dd,_0x33fad0){return client[_0xfcc2('0x2')](_0xfcc2('0x4'),{'body':_0x33fad0,'options':{'where':{'uniqueid':_0xa060dd},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 93a981f..6df6b20 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 _0xb15a=['update','Request','UpdateOpenchannelInteraction','addTags','../client'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xb15a,0x199));var _0xab15=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xb15a[_0x29dda1];return _0x21b0ef;};'use strict';var client=require(_0xab15('0x0'));exports[_0xab15('0x1')]=function(_0xeefed0,_0x3f6d17){return client[_0xab15('0x2')](_0xab15('0x3'),{'body':_0x3f6d17,'options':{'where':{'id':_0xeefed0}},'log':'updateOpenchannelInteraction'});};exports[_0xab15('0x4')]=function(_0x120a48,_0x482b93){return client[_0xab15('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x482b93,'options':{'where':{'id':_0x120a48}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xc6f7=['addTagsToChatInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x3857b7,_0x29800c){var _0x1d465e=function(_0xab067f){while(--_0xab067f){_0x3857b7['push'](_0x3857b7['shift']());}};_0x1d465e(++_0x29800c);}(_0xc6f7,0x189));var _0x7c6f=function(_0x405de2,_0x1f0d4a){_0x405de2=_0x405de2-0x0;var _0x17e765=_0xc6f7[_0x405de2];return _0x17e765;};'use strict';var client=require(_0x7c6f('0x0'));exports[_0x7c6f('0x1')]=function(_0x4948dd,_0x9e5357){return client[_0x7c6f('0x2')](_0x7c6f('0x3'),{'body':_0x9e5357,'options':{'where':{'id':_0x4948dd}},'log':_0x7c6f('0x4')});};exports[_0x7c6f('0x5')]=function(_0x48005b,_0xddb1fb){return client['Request'](_0x7c6f('0x6'),{'body':_0xddb1fb,'options':{'where':{'id':_0x48005b}},'log':_0x7c6f('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7e2aac1..2db78f8 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 _0x71e3=['createOpenchannelMessage','../client','create','Request'];(function(_0x579e9e,_0x434822){var _0x2cc65d=function(_0x2ce412){while(--_0x2ce412){_0x579e9e['push'](_0x579e9e['shift']());}};_0x2cc65d(++_0x434822);}(_0x71e3,0x69));var _0x371e=function(_0x3891e4,_0x26fd9b){_0x3891e4=_0x3891e4-0x0;var _0x14a16a=_0x71e3[_0x3891e4];return _0x14a16a;};'use strict';var client=require(_0x371e('0x0'));exports[_0x371e('0x1')]=function(_0x4e8890){return client[_0x371e('0x2')]('CreateOpenchannelMessage',{'body':_0x4e8890,'log':_0x371e('0x3')});}; \ No newline at end of file +var _0xa0e9=['create','Request','CreateOpenchannelMessage','../client'];(function(_0x2050aa,_0x2e48ea){var _0x5b03bd=function(_0x16ee1){while(--_0x16ee1){_0x2050aa['push'](_0x2050aa['shift']());}};_0x5b03bd(++_0x2e48ea);}(_0xa0e9,0xa7));var _0x9a0e=function(_0x5c697d,_0xe8128){_0x5c697d=_0x5c697d-0x0;var _0x17d8df=_0xa0e9[_0x5c697d];return _0x17d8df;};'use strict';var client=require(_0x9a0e('0x0'));exports[_0x9a0e('0x1')]=function(_0x4c50a6){return client[_0x9a0e('0x2')](_0x9a0e('0x3'),{'body':_0x4c50a6,'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 5444df1..010e184 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 _0x3a27=['name','timeout','strategy','User','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x3a27,0x19c));var _0x73a2=function(_0x48dc2f,_0x481fef){_0x48dc2f=_0x48dc2f-0x0;var _0x4dd8be=_0x3a27[_0x48dc2f];return _0x4dd8be;};'use strict';var client=require(_0x73a2('0x0'));exports[_0x73a2('0x1')]=function(){return function(){return client[_0x73a2('0x2')](_0x73a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x73a2('0x4'),_0x73a2('0x5'),_0x73a2('0x6')],'include':[{'model':_0x73a2('0x7'),'as':'Agents','attributes':['id',_0x73a2('0x4'),'online','openchannelPause']}]},'log':_0x73a2('0x1')});};}; \ No newline at end of file +var _0xfb93=['timeout','strategy','name','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue'];(function(_0x174caf,_0xf2a0c4){var _0xae0c3e=function(_0x105d5a){while(--_0x105d5a){_0x174caf['push'](_0x174caf['shift']());}};_0xae0c3e(++_0xf2a0c4);}(_0xfb93,0x115));var _0x3fb9=function(_0x108151,_0x3b865a){_0x108151=_0x108151-0x0;var _0x488cca=_0xfb93[_0x108151];return _0x488cca;};'use strict';var client=require(_0x3fb9('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x3fb9('0x1')](_0x3fb9('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3fb9('0x3'),_0x3fb9('0x4')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x3fb9('0x5'),'online',_0x3fb9('0x6')]}]},'log':_0x3fb9('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5535f3a..578166e 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 _0x957b=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x957b,0x1ee));var _0xb957=function(_0x1471a6,_0x4f0dd7){_0x1471a6=_0x1471a6-0x0;var _0xb2d901=_0x957b[_0x1471a6];return _0xb2d901;};'use strict';var client=require(_0xb957('0x0'));exports[_0xb957('0x1')]=function(_0x252bef){return client[_0xb957('0x2')](_0xb957('0x3'),{'body':_0x252bef,'log':_0xb957('0x3')});};exports[_0xb957('0x4')]=function(_0x182599,_0x182ac3){return client[_0xb957('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x182ac3,'options':{'where':{'uniqueid':_0x182599},'order':[['id',_0xb957('0x5')]],'limit':0x1},'log':_0xb957('0x6')});}; \ No newline at end of file +var _0x9b00=['../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x367759,_0x3ccdb9){var _0x3c8b9f=function(_0x1fec1c){while(--_0x1fec1c){_0x367759['push'](_0x367759['shift']());}};_0x3c8b9f(++_0x3ccdb9);}(_0x9b00,0xcc));var _0x09b0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9b00[_0x465028];return _0xb783d4;};'use strict';var client=require(_0x09b0('0x0'));exports[_0x09b0('0x1')]=function(_0x32881a){return client['Request'](_0x09b0('0x2'),{'body':_0x32881a,'log':_0x09b0('0x2')});};exports[_0x09b0('0x3')]=function(_0x21e010,_0x405978){return client[_0x09b0('0x4')](_0x09b0('0x5'),{'body':_0x405978,'options':{'where':{'uniqueid':_0x21e010},'order':[['id','DESC']],'limit':0x1},'log':_0x09b0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c634abc..2dc012a 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 _0x8d9b=['../client','update','Request','addTags'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xb8d9('0x0'));exports[_0xb8d9('0x1')]=function(_0x2a3616,_0x8360b6){return client[_0xb8d9('0x2')]('UpdateSmsInteraction',{'body':_0x8360b6,'options':{'where':{'id':_0x2a3616}},'log':'updateSmsInteraction'});};exports[_0xb8d9('0x3')]=function(_0x47b650,_0x2192ff){return client[_0xb8d9('0x2')]('AddTagsToSmsInteraction',{'body':_0x2192ff,'options':{'where':{'id':_0x47b650}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0x4b1f=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','Request'];(function(_0x3c0c92,_0x267969){var _0xe3859b=function(_0x4d38f2){while(--_0x4d38f2){_0x3c0c92['push'](_0x3c0c92['shift']());}};_0xe3859b(++_0x267969);}(_0x4b1f,0x195));var _0xf4b1=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x4b1f[_0x12fc8d];return _0x3f9d04;};'use strict';var client=require(_0xf4b1('0x0'));exports[_0xf4b1('0x1')]=function(_0x4c24e7,_0x3012de){return client[_0xf4b1('0x2')](_0xf4b1('0x3'),{'body':_0x3012de,'options':{'where':{'id':_0x4c24e7}},'log':'updateSmsInteraction'});};exports[_0xf4b1('0x4')]=function(_0x2b99e2,_0x31acb0){return client['Request']('AddTagsToSmsInteraction',{'body':_0x31acb0,'options':{'where':{'id':_0x2b99e2}},'log':_0xf4b1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 9d1710f..96e3aa9 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 _0x3fdf=['../client','create'];(function(_0x29eb58,_0x535bad){var _0x38a130=function(_0x412de9){while(--_0x412de9){_0x29eb58['push'](_0x29eb58['shift']());}};_0x38a130(++_0x535bad);}(_0x3fdf,0x100));var _0xf3fd=function(_0x1e7647,_0x35cd6d){_0x1e7647=_0x1e7647-0x0;var _0x4ce2a1=_0x3fdf[_0x1e7647];return _0x4ce2a1;};'use strict';var client=require(_0xf3fd('0x0'));exports[_0xf3fd('0x1')]=function(_0x21f8b6){return client['Request']('CreateSmsMessage',{'body':_0x21f8b6,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xbfc7=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x16565f,_0x3ef846){var _0x59af6c=function(_0x527007){while(--_0x527007){_0x16565f['push'](_0x16565f['shift']());}};_0x59af6c(++_0x3ef846);}(_0xbfc7,0x121));var _0x7bfc=function(_0x5a9230,_0x52d1f8){_0x5a9230=_0x5a9230-0x0;var _0x28765e=_0xbfc7[_0x5a9230];return _0x28765e;};'use strict';var client=require(_0x7bfc('0x0'));exports[_0x7bfc('0x1')]=function(_0x38c68a){return client[_0x7bfc('0x2')](_0x7bfc('0x3'),{'body':_0x38c68a,'log':_0x7bfc('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 8b544b1..d5b1b37 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0xf3435e,_0x3f78df){var _0xe621da=function(_0xb97f6b){while(--_0xb97f6b){_0xf3435e['push'](_0xf3435e['shift']());}};_0xe621da(++_0x3f78df);}(_0xe706,0xa3));var _0x6e70=function(_0x2cf891,_0x54171b){_0x2cf891=_0x2cf891-0x0;var _0x307493=_0xe706[_0x2cf891];return _0x307493;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xb7e7=['online','../client','Request','name','strategy','Agents'];(function(_0x7a373e,_0x43e705){var _0x5e4028=function(_0xa879da){while(--_0xa879da){_0x7a373e['push'](_0x7a373e['shift']());}};_0x5e4028(++_0x43e705);}(_0xb7e7,0x121));var _0x7b7e=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xb7e7[_0x68ee8b];return _0x5148f7;};'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 08e34c0..44c3d72 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x51f975,_0x2bdf64){var _0x7f443d=function(_0x24e56f){while(--_0x24e56f){_0x51f975['push'](_0x51f975['shift']());}};_0x7f443d(++_0x2bdf64);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x3f697c,_0xbbb338){var _0x473143=function(_0x503b30){while(--_0x503b30){_0x3f697c['push'](_0x3f697c['shift']());}};_0x473143(++_0xbbb338);}(_0x34e8,0x12c));var _0x834e=function(_0x43ab6c,_0x1a144f){_0x43ab6c=_0x43ab6c-0x0;var _0x253746=_0x34e8[_0x43ab6c];return _0x253746;};'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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4f28145..16a0351 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(_0xeac4e0,_0xf8007a){var _0x4dd4ad=function(_0x4d20c5){while(--_0x4d20c5){_0xeac4e0['push'](_0xeac4e0['shift']());}};_0x4dd4ad(++_0xf8007a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x387e34,_0x4893bb){var _0x100885=function(_0x1d9fd6){while(--_0x1d9fd6){_0x387e34['push'](_0x387e34['shift']());}};_0x100885(++_0x4893bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('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 c8472fb..534d659 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 _0xda19=['updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','update','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda19,0xd5));var _0x9da1=function(_0x3663cd,_0x46eedc){_0x3663cd=_0x3663cd-0x0;var _0x7f0858=_0xda19[_0x3663cd];return _0x7f0858;};'use strict';var client=require('../client');exports[_0x9da1('0x0')]=function(_0x430d39,_0x52772b){return client[_0x9da1('0x1')]('UpdateWhatsappInteraction',{'body':_0x52772b,'options':{'where':{'id':_0x430d39}},'log':_0x9da1('0x2')});};exports['addTags']=function(_0x2a77c7,_0xef6f5a){return client[_0x9da1('0x1')](_0x9da1('0x3'),{'body':_0xef6f5a,'options':{'where':{'id':_0x2a77c7}},'log':_0x9da1('0x4')});}; \ No newline at end of file +var _0xe3da=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x274a2c,_0x10f093){var _0x5ade9d=function(_0x4566c7){while(--_0x4566c7){_0x274a2c['push'](_0x274a2c['shift']());}};_0x5ade9d(++_0x10f093);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0xae3d('0x0'));exports[_0xae3d('0x1')]=function(_0x2788fe,_0x405f17){return client[_0xae3d('0x2')](_0xae3d('0x3'),{'body':_0x405f17,'options':{'where':{'id':_0x2788fe}},'log':_0xae3d('0x4')});};exports[_0xae3d('0x5')]=function(_0xb2dfd3,_0x22bacf){return client[_0xae3d('0x2')](_0xae3d('0x6'),{'body':_0x22bacf,'options':{'where':{'id':_0xb2dfd3}},'log':_0xae3d('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index f8d38fb..cb9c84f 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 _0x1a17=['../client','create','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0x1a17,0x1f4));var _0x71a1=function(_0x3c5132,_0x26455b){_0x3c5132=_0x3c5132-0x0;var _0x1c0d6a=_0x1a17[_0x3c5132];return _0x1c0d6a;};'use strict';var client=require(_0x71a1('0x0'));exports[_0x71a1('0x1')]=function(_0x3c71c9){return client['Request'](_0x71a1('0x2'),{'body':_0x3c71c9,'log':_0x71a1('0x3')});}; \ No newline at end of file +var _0x18d2=['CreateWhatsappMessage','Request'];(function(_0x50f326,_0x1fc4f6){var _0x35cbe1=function(_0x5799ff){while(--_0x5799ff){_0x50f326['push'](_0x50f326['shift']());}};_0x35cbe1(++_0x1fc4f6);}(_0x18d2,0x1ed));var _0x218d=function(_0x4f7ee0,_0x48402d){_0x4f7ee0=_0x4f7ee0-0x0;var _0x5e9e68=_0x18d2[_0x4f7ee0];return _0x5e9e68;};'use strict';var client=require('../client');exports['create']=function(_0x3009a1){return client[_0x218d('0x0')](_0x218d('0x1'),{'body':_0x3009a1,'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 f7bf054..6afc180 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 _0xb77a=['whatsappPause','../client','getWhatsappQueues','Request','timeout','Agents','online'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb77a,0x17b));var _0xab77=function(_0x230897,_0x19c166){_0x230897=_0x230897-0x0;var _0x4812be=_0xb77a[_0x230897];return _0x4812be;};'use strict';var client=require(_0xab77('0x0'));exports[_0xab77('0x1')]=function(){return function(){return client[_0xab77('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name',_0xab77('0x3'),'strategy'],'include':[{'model':'User','as':_0xab77('0x4'),'attributes':['id','name',_0xab77('0x5'),_0xab77('0x6')]}]},'log':_0xab77('0x1')});};}; \ No newline at end of file +var _0x4f6c=['timeout','User','Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name'];(function(_0x310c0a,_0x4ec103){var _0x599109=function(_0x18a58b){while(--_0x18a58b){_0x310c0a['push'](_0x310c0a['shift']());}};_0x599109(++_0x4ec103);}(_0x4f6c,0x12e));var _0xc4f6=function(_0x406bf1,_0x1ea817){_0x406bf1=_0x406bf1-0x0;var _0x244df4=_0x4f6c[_0x406bf1];return _0x244df4;};'use strict';var client=require('../client');exports[_0xc4f6('0x0')]=function(){return function(){return client[_0xc4f6('0x1')](_0xc4f6('0x2'),{'options':{'raw':![],'attributes':['id',_0xc4f6('0x3'),_0xc4f6('0x4'),'strategy'],'include':[{'model':_0xc4f6('0x5'),'as':_0xc4f6('0x6'),'attributes':['id',_0xc4f6('0x3'),_0xc4f6('0x7'),_0xc4f6('0x8')]}]},'log':_0xc4f6('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 85d650e..42252c3 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 _0xadaf=['UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport','update','DESC'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xadaf,0x174));var _0xfada=function(_0x192570,_0x5db279){_0x192570=_0x192570-0x0;var _0x3e569e=_0xadaf[_0x192570];return _0x3e569e;};'use strict';var client=require(_0xfada('0x0'));exports[_0xfada('0x1')]=function(_0x5919fb){return client[_0xfada('0x2')](_0xfada('0x3'),{'body':_0x5919fb,'log':_0xfada('0x3')});};exports[_0xfada('0x4')]=function(_0x280caa,_0x511620){return client[_0xfada('0x2')]('UpdateWhatsappQueueReport',{'body':_0x511620,'options':{'where':{'uniqueid':_0x280caa},'order':[['id',_0xfada('0x5')]],'limit':0x1},'log':_0xfada('0x6')});}; \ No newline at end of file +var _0x7f8c=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7f8c,0x110));var _0xc7f8=function(_0xa8553d,_0x92da20){_0xa8553d=_0xa8553d-0x0;var _0x532beb=_0x7f8c[_0xa8553d];return _0x532beb;};'use strict';var client=require(_0xc7f8('0x0'));exports[_0xc7f8('0x1')]=function(_0x4a0824){return client[_0xc7f8('0x2')](_0xc7f8('0x3'),{'body':_0x4a0824,'log':'CreateWhatsappQueueReport'});};exports[_0xc7f8('0x4')]=function(_0x3c6f15,_0xcf350d){return client[_0xc7f8('0x2')]('UpdateWhatsappQueueReport',{'body':_0xcf350d,'options':{'where':{'uniqueid':_0x3c6f15},'order':[['id',_0xc7f8('0x5')]],'limit':0x1},'log':_0xc7f8('0x6')});}; \ 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 7365d0d..2fff330 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 _0x563e=['[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','message','stop','find','timeout','atimeout','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x1a7ac0,_0x5798be){var _0x5f1f6b=function(_0x4dc588){while(--_0x4dc588){_0x1a7ac0['push'](_0x1a7ac0['shift']());}};_0x5f1f6b(++_0x5798be);}(_0x563e,0x6e));var _0xe563=function(_0x26d9b3,_0x591f4e){_0x26d9b3=_0x26d9b3-0x0;var _0x15c226=_0x563e[_0x26d9b3];return _0x15c226;};'use strict';var schema=require(_0xe563('0x0'));var _=require(_0xe563('0x1'));var util=require(_0xe563('0x2'));var seqqueue=require(_0xe563('0x3'));var logger=require(_0xe563('0x4'))(_0xe563('0x5'));var strategy=require(_0xe563('0x6'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xe563('0x7')},'timeout':{'type':_0xe563('0x8'),'message':_0xe563('0x9')}});function writeLog(_0x23fb74,_0x1f64a1,_0xe05464){return logger[_0xe563('0xa')](util['format'](_0xe563('0xb'),_0x23fb74,_0x1f64a1[_0xe563('0xc')],_0xe05464));}function handleFindAgent(_0x53a8a4){return function(_0x3ba0a5){return _0x3ba0a5[_0xe563('0xc')][_0xe563('0xd')]()===_0x53a8a4['toLowerCase']();};}exports[_0xe563('0xe')]=function(_0x343916,_0x3f5068,_0x4eb403,_0xfbfa39){return function(_0x2a5937){try{var _0x33a638={'name':_0x3f5068[0x0],'timeout':_0x3f5068[0x1]};var _0x13e217=queue[_0xe563('0x0')](_0x33a638,{'typecast':!![]});if(_0x13e217['length']){logger[_0xe563('0xf')](_0xe563('0x10'),_0x343916,_['map'](_0x13e217,_0xe563('0x11'))['join'](',\x20'));_0x2a5937[_0xe563('0x12')]();}else{var _0x37dcc9=_[_0xe563('0x13')](_0x4eb403['agents'],handleFindAgent(_0x33a638['name']));if(_0x37dcc9){var _0x11c706=(_0x33a638[_0xe563('0x14')]||0xa)*0x3e8;var _0xffe39b,_0x989f42;var _0x4e4dba=seqqueue['createQueue'](_0x11c706);_0x4e4dba['id']=_0x343916;_0x4e4dba[_0xe563('0x15')]=_0x11c706;_0x4e4dba[_0xe563('0x16')]=_0xfbfa39[_0xe563('0x16')];writeLog(_0x343916,_0x37dcc9,util[_0xe563('0x17')](_0xe563('0x18'),_0x11c706));_0x4eb403[_0xe563('0x19')][_0x343916]['on'](_0xe563('0x1a'),function(){logger[_0xe563('0xa')](_0xe563('0x1b'),_0x343916);clearTimeout(_0x989f42);_0x989f42=undefined;_0x4e4dba[_0xe563('0x1c')]();if(_0x4eb403[_0xe563('0x19')][_0x343916]){delete _0x4eb403[_0xe563('0x19')][_0x343916];}_0x2a5937[_0xe563('0x12')]();});_0x4eb403[_0xe563('0x19')][_0x343916]['on']('complete',function(){if(_0x4eb403[_0xe563('0x19')][_0x343916]){delete _0x4eb403['rules'][_0x343916];}});_0x989f42=setTimeout(function(){logger[_0xe563('0xa')](_0xe563('0x1d'),_0x343916);clearTimeout(_0x989f42);_0x4e4dba['close']();_0x2a5937[_0xe563('0x1e')]();},_0x11c706);strategy[_0xe563('0x1f')](_0x4e4dba,_0x37dcc9,_0x4eb403,_0xfbfa39);}else{logger[_0xe563('0xf')](_0xe563('0x20'),_0x343916,_0x33a638[_0xe563('0xc')]);_0x2a5937[_0xe563('0x12')]();}}}catch(_0x13699c){console[_0xe563('0x21')](_0x13699c);logger[_0xe563('0xf')](_0xe563('0x22'),_0x343916,_0x13699c[_0xe563('0x23')]);_0x2a5937[_0xe563('0x12')]();}};}; \ No newline at end of file +var _0xad7f=['end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','lodash','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules'];(function(_0x3d9473,_0x312025){var _0x5a8289=function(_0x294cbe){while(--_0x294cbe){_0x3d9473['push'](_0x3d9473['shift']());}};_0x5a8289(++_0x312025);}(_0xad7f,0x157));var _0xfad7=function(_0x4978de,_0x5912e4){_0x4978de=_0x4978de-0x0;var _0x675221=_0xad7f[_0x4978de];return _0x675221;};'use strict';var schema=require('validate');var _=require(_0xfad7('0x0'));var util=require('util');var seqqueue=require(_0xfad7('0x1'));var logger=require(_0xfad7('0x2'))(_0xfad7('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xfad7('0x4'),'required':!![],'message':_0xfad7('0x5')},'timeout':{'type':_0xfad7('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5b4c5a,_0x46ff77,_0x21cfeb){return logger[_0xfad7('0x7')](util['format'](_0xfad7('0x8'),_0x5b4c5a,_0x46ff77[_0xfad7('0x9')],_0x21cfeb));}function handleFindAgent(_0x1d5d33){return function(_0x4a665f){return _0x4a665f[_0xfad7('0x9')][_0xfad7('0xa')]()===_0x1d5d33['toLowerCase']();};}exports['consequence']=function(_0x2334a4,_0x32c4e4,_0x4e1c0e,_0x4e0873){return function(_0x35a6e6){try{var _0x123ab5={'name':_0x32c4e4[0x0],'timeout':_0x32c4e4[0x1]};var _0x4e348a=queue[_0xfad7('0xb')](_0x123ab5,{'typecast':!![]});if(_0x4e348a[_0xfad7('0xc')]){logger[_0xfad7('0xd')](_0xfad7('0xe'),_0x2334a4,_[_0xfad7('0xf')](_0x4e348a,_0xfad7('0x10'))[_0xfad7('0x11')](',\x20'));_0x35a6e6[_0xfad7('0x12')]();}else{var _0x1cbfef=_[_0xfad7('0x13')](_0x4e1c0e[_0xfad7('0x14')],handleFindAgent(_0x123ab5[_0xfad7('0x9')]));if(_0x1cbfef){var _0x78c339=(_0x123ab5[_0xfad7('0x15')]||0xa)*0x3e8;var _0x59bca7,_0x374282;var _0x3bebb1=seqqueue[_0xfad7('0x16')](_0x78c339);_0x3bebb1['id']=_0x2334a4;_0x3bebb1[_0xfad7('0x17')]=_0x78c339;_0x3bebb1[_0xfad7('0x18')]=_0x4e0873[_0xfad7('0x18')];writeLog(_0x2334a4,_0x1cbfef,util['format'](_0xfad7('0x19'),_0x78c339));_0x4e1c0e[_0xfad7('0x1a')][_0x2334a4]['on'](_0xfad7('0x1b'),function(){logger[_0xfad7('0x7')](_0xfad7('0x1c'),_0x2334a4);clearTimeout(_0x374282);_0x374282=undefined;_0x3bebb1[_0xfad7('0x1d')]();if(_0x4e1c0e[_0xfad7('0x1a')][_0x2334a4]){delete _0x4e1c0e[_0xfad7('0x1a')][_0x2334a4];}_0x35a6e6['stop']();});_0x4e1c0e[_0xfad7('0x1a')][_0x2334a4]['on'](_0xfad7('0x1e'),function(){if(_0x4e1c0e[_0xfad7('0x1a')][_0x2334a4]){delete _0x4e1c0e['rules'][_0x2334a4];}});_0x374282=setTimeout(function(){logger['info'](_0xfad7('0x1f'),_0x2334a4);clearTimeout(_0x374282);_0x3bebb1[_0xfad7('0x1d')]();_0x35a6e6[_0xfad7('0x20')]();},_0x78c339);strategy[_0xfad7('0x21')](_0x3bebb1,_0x1cbfef,_0x4e1c0e,_0x4e0873);}else{logger['error'](_0xfad7('0x22'),_0x2334a4,_0x123ab5[_0xfad7('0x9')]);_0x35a6e6[_0xfad7('0x12')]();}}}catch(_0x47069f){console[_0xfad7('0x23')](_0x47069f);logger['error'](_0xfad7('0x24'),_0x2334a4,_0x47069f['stack']);_0x35a6e6['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 6d279ea..1422ec3 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 _0x3896=['create','then','catch','error','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerName','providerResponse','dialogState','Failed','stringify','lodash','moment','aws-sdk','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message'];(function(_0x1c764d,_0x2969f3){var _0x4233af=function(_0x3dd349){while(--_0x3dd349){_0x1c764d['push'](_0x1c764d['shift']());}};_0x4233af(++_0x2969f3);}(_0x3896,0x121));var _0x6389=function(_0x4304c8,_0xffb23e){_0x4304c8=_0x4304c8-0x0;var _0x298888=_0x3896[_0x4304c8];return _0x298888;};'use strict';var _=require(_0x6389('0x0'));var moment=require(_0x6389('0x1'));var AWS=require(_0x6389('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x6389('0x3')),'openchannelMessage':require(_0x6389('0x4')),'mailMessage':require(_0x6389('0x5')),'smsMessage':require(_0x6389('0x6')),'faxMessage':require(_0x6389('0x7')),'whatsappMessage':require(_0x6389('0x8'))};exports[_0x6389('0x9')]=function(_0x16bd5b,_0x23aa2c){return function(_0x3c8158){try{if(!_[_0x6389('0xa')](this[_0x6389('0xb')][_0x6389('0xc')])){logger[_0x6389('0xd')](_0x6389('0xe'),_0x16bd5b,_0x6389('0xf'));return _0x3c8158[_0x6389('0x10')]();}var _0x28893a={'ContactId':this[_0x6389('0x11')]['id'],'sentAt':moment()[_0x6389('0x12')](_0x6389('0x13')),'direction':_0x6389('0x14')};if(this['channel']===_0x6389('0x15')||this[_0x6389('0x16')]===_0x6389('0x17')){_0x28893a[_0x6389('0x18')]=this[_0x6389('0xb')][_0x6389('0x18')];}var _0x894b5c=this[_0x6389('0x16')];if(_0x894b5c===_0x6389('0x19')){_0x28893a[_0x6389('0x1a')]=this[_0x6389('0x1b')]['id'];}else{_0x28893a[_[_0x6389('0x1c')](_0x894b5c)+_0x6389('0x1d')]=this[_0x6389('0x1b')]['id'];}_0x28893a[_[_0x6389('0x1c')](_0x894b5c)+_0x6389('0x1e')]=this[_0x6389('0xb')]['id'];if(this[_0x6389('0xb')][_0x6389('0x1f')]){var _0x1be83e=_0x23aa2c[0x4];if(!_['isEmpty'](_0x1be83e)){_0x28893a[_0x6389('0x20')]=utils[_0x6389('0x21')](_0x1be83e,this);return rpc[_0x894b5c+_0x6389('0x22')][_0x6389('0x23')](_0x28893a)[_0x6389('0x24')](function(_0x1ee08b){logger[_0x6389('0xd')](_0x6389('0xe'),_0x16bd5b,_0x28893a['body']);})[_0x6389('0x25')](function(_0x2e7d60){logger[_0x6389('0x26')](_0x6389('0xe'),_0x16bd5b,JSON['stringify'](_0x2e7d60));})[_0x6389('0x27')](function(){logger[_0x6389('0xd')](_0x6389('0x28'),_0x16bd5b);_0x3c8158[_0x6389('0x29')]();});}else{logger[_0x6389('0xd')](_0x6389('0x2a'),_0x16bd5b);_0x3c8158[_0x6389('0x29')]();}}else{var _0x21cba4=this;var _0x291ac6=new AWS[(_0x6389('0x2b'))]({'accessKeyId':_0x23aa2c[0x0],'secretAccessKey':_0x23aa2c[0x1],'region':_0x23aa2c[0x2]});var _0x377162={'botAlias':_0x6389('0x2c'),'botName':_0x23aa2c[0x3],'inputText':this['message']['body'],'userId':this[_0x6389('0x16')]+':'+this['interaction']['id'][_0x6389('0x2d')]()};_0x291ac6[_0x6389('0x2e')](_0x377162,function(_0x592bdb,_0x3fcfd4){if(_0x592bdb){logger['error'](_0x6389('0xe'),_0x16bd5b,_0x592bdb[_0x6389('0x2f')]);_0x3c8158[_0x6389('0x10')]();}else if(_0x3fcfd4&&_0x3fcfd4[_0x6389('0x2f')]){_0x21cba4[_0x6389('0x20')][_0x6389('0x30')]=_0x3fcfd4;_0x28893a[_0x6389('0x20')]=_0x3fcfd4['message'];_0x28893a[_0x6389('0x31')]=_0x6389('0x30');_0x28893a[_0x6389('0x32')]=JSON['stringify'](_0x3fcfd4);return rpc[_0x894b5c+_0x6389('0x22')][_0x6389('0x23')](_0x28893a)[_0x6389('0x24')](function(_0x1849ff){logger[_0x6389('0xd')](_0x6389('0xe'),_0x16bd5b,_0x28893a[_0x6389('0x20')]);if(_0x3fcfd4[_0x6389('0x33')]==_0x6389('0x34')){_0x3c8158['next']();}else{_0x3c8158['stop']();}})['catch'](function(_0x201e21){logger[_0x6389('0x26')](_0x6389('0xe'),_0x16bd5b,JSON[_0x6389('0x35')](_0x201e21));_0x3c8158[_0x6389('0x10')]();});}else{_0x3c8158[_0x6389('0x10')]();}});}}catch(_0x429500){logger[_0x6389('0x26')]('[%s][AMAZONLEX]\x20%s',_0x16bd5b,JSON[_0x6389('0x35')](_0x429500));_0x3c8158[_0x6389('0x29')]();}};}; \ No newline at end of file +var _0x256e=['body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','$LATEST','message','postText','amazonlex','providerName','providerResponse','then','dialogState','Failed','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','Message','create','info'];(function(_0x38ecda,_0x3b551e){var _0x3fa8f3=function(_0x4e196c){while(--_0x4e196c){_0x38ecda['push'](_0x38ecda['shift']());}};_0x3fa8f3(++_0x3b551e);}(_0x256e,0x176));var _0xe256=function(_0x251e91,_0xe8eb0b){_0x251e91=_0x251e91-0x0;var _0x2157ce=_0x256e[_0x251e91];return _0x2157ce;};'use strict';var _=require(_0xe256('0x0'));var moment=require(_0xe256('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xe256('0x2'))(_0xe256('0x3'));var rpc={'chatMessage':require(_0xe256('0x4')),'openchannelMessage':require(_0xe256('0x5')),'mailMessage':require(_0xe256('0x6')),'smsMessage':require(_0xe256('0x7')),'faxMessage':require(_0xe256('0x8')),'whatsappMessage':require(_0xe256('0x9'))};exports[_0xe256('0xa')]=function(_0xc9ebcc,_0xdfe79){return function(_0x1ee628){try{if(!_[_0xe256('0xb')](this['interaction'][_0xe256('0xc')])){logger['info'](_0xe256('0xd'),_0xc9ebcc,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1ee628[_0xe256('0xe')]();}var _0x42560a={'ContactId':this[_0xe256('0xf')]['id'],'sentAt':moment()[_0xe256('0x10')](_0xe256('0x11')),'direction':'out'};if(this[_0xe256('0x12')]===_0xe256('0x13')||this[_0xe256('0x12')]==='whatsapp'){_0x42560a[_0xe256('0x14')]=this[_0xe256('0x15')][_0xe256('0x14')];}var _0xfa20a5=this[_0xe256('0x12')];if(_0xfa20a5===_0xe256('0x16')){_0x42560a[_0xe256('0x17')]=this[_0xe256('0x18')]['id'];}else{_0x42560a[_[_0xe256('0x19')](_0xfa20a5)+_0xe256('0x1a')]=this[_0xe256('0x18')]['id'];}_0x42560a[_[_0xe256('0x19')](_0xfa20a5)+_0xe256('0x1b')]=this['interaction']['id'];if(this['interaction'][_0xe256('0x1c')]){var _0x159f7f=_0xdfe79[0x4];if(!_[_0xe256('0x1d')](_0x159f7f)){_0x42560a['body']=utils[_0xe256('0x1e')](_0x159f7f,this);return rpc[_0xfa20a5+_0xe256('0x1f')][_0xe256('0x20')](_0x42560a)['then'](function(_0x52c628){logger[_0xe256('0x21')](_0xe256('0xd'),_0xc9ebcc,_0x42560a[_0xe256('0x22')]);})[_0xe256('0x23')](function(_0x3405a0){logger[_0xe256('0x24')](_0xe256('0xd'),_0xc9ebcc,JSON[_0xe256('0x25')](_0x3405a0));})[_0xe256('0x26')](function(){logger[_0xe256('0x21')](_0xe256('0x27'),_0xc9ebcc);_0x1ee628['stop']();});}else{logger[_0xe256('0x21')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0xc9ebcc);_0x1ee628['stop']();}}else{var _0x2131a0=this;var _0x498a25=new AWS[(_0xe256('0x28'))]({'accessKeyId':_0xdfe79[0x0],'secretAccessKey':_0xdfe79[0x1],'region':_0xdfe79[0x2]});var _0x8770b0={'botAlias':_0xe256('0x29'),'botName':_0xdfe79[0x3],'inputText':this[_0xe256('0x2a')]['body'],'userId':this[_0xe256('0x12')]+':'+this[_0xe256('0x15')]['id']['toString']()};_0x498a25[_0xe256('0x2b')](_0x8770b0,function(_0x4360ae,_0x33b1c4){if(_0x4360ae){logger[_0xe256('0x24')](_0xe256('0xd'),_0xc9ebcc,_0x4360ae[_0xe256('0x2a')]);_0x1ee628[_0xe256('0xe')]();}else if(_0x33b1c4&&_0x33b1c4[_0xe256('0x2a')]){_0x2131a0[_0xe256('0x22')][_0xe256('0x2c')]=_0x33b1c4;_0x42560a['body']=_0x33b1c4['message'];_0x42560a[_0xe256('0x2d')]=_0xe256('0x2c');_0x42560a[_0xe256('0x2e')]=JSON[_0xe256('0x25')](_0x33b1c4);return rpc[_0xfa20a5+_0xe256('0x1f')]['create'](_0x42560a)[_0xe256('0x2f')](function(_0x5e9e5a){logger[_0xe256('0x21')](_0xe256('0xd'),_0xc9ebcc,_0x42560a[_0xe256('0x22')]);if(_0x33b1c4[_0xe256('0x30')]==_0xe256('0x31')){_0x1ee628['next']();}else{_0x1ee628[_0xe256('0x32')]();}})[_0xe256('0x23')](function(_0x7910d4){logger[_0xe256('0x24')](_0xe256('0xd'),_0xc9ebcc,JSON[_0xe256('0x25')](_0x7910d4));_0x1ee628[_0xe256('0xe')]();});}else{_0x1ee628[_0xe256('0xe')]();}});}}catch(_0x38a2e4){logger[_0xe256('0x24')](_0xe256('0xd'),_0xc9ebcc,JSON['stringify'](_0x38a2e4));_0x1ee628[_0xe256('0x32')]();}};}; \ 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 013b108..c704f90 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 _0xee3a=['ChatWebsiteId','account','AccountId','upperFirst','Message','inReplyTo','messageId','html','','replace','','headers','All','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','autoreplyExecuted','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','isNil','created','interaction','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat'];(function(_0x2123e1,_0x6314a0){var _0x1281da=function(_0x3df2e2){while(--_0x3df2e2){_0x2123e1['push'](_0x2123e1['shift']());}};_0x1281da(++_0x6314a0);}(_0xee3a,0xec));var _0xaee3=function(_0x4643f4,_0x55beef){_0x4643f4=_0x4643f4-0x0;var _0x56c5d3=_0xee3a[_0x4643f4];return _0x56c5d3;};'use strict';var _=require(_0xaee3('0x0'));var moment=require(_0xaee3('0x1'));var utils=require(_0xaee3('0x2'));var logger=require(_0xaee3('0x3'))(_0xaee3('0x4'));var rpc={'chatMessage':require(_0xaee3('0x5')),'openchannelMessage':require(_0xaee3('0x6')),'mailMessage':require(_0xaee3('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaee3('0x8')),'whatsappMessage':require(_0xaee3('0x9')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xaee3('0xa')),'mailInteraction':require(_0xaee3('0xb')),'smsInteraction':require(_0xaee3('0xc')),'faxInteraction':require(_0xaee3('0xd')),'whatsappInteraction':require(_0xaee3('0xe'))};var mailRpc=require('../../mailRpc');exports[_0xaee3('0xf')]=function(_0x48f911,_0x308f4f,_0x9d4ef0,_0x109157){return function(_0x51b5b2){try{var _0x245654=this[_0xaee3('0x10')];if(_0x245654===_0xaee3('0x11')&&_0x109157[_0xaee3('0x12')][_0xaee3('0x13')]){logger[_0xaee3('0x14')](_0xaee3('0x15'),_0x48f911,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x51b5b2[_0xaee3('0x16')]();}if(_0x308f4f[0x0]==='1'&&(_[_0xaee3('0x17')](this['interaction'][_0xaee3('0x18')])||!this[_0xaee3('0x19')][_0xaee3('0x18')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x48f911,_0xaee3('0x1a'));return _0x51b5b2[_0xaee3('0x16')]();}if(_0x308f4f[0x0]==='2'&&this[_0xaee3('0x19')]['autoreplyExecuted']){logger[_0xaee3('0x14')](_0xaee3('0x1b'),_0x48f911,_0xaee3('0x1c'));return _0x51b5b2[_0xaee3('0x16')]();}var _0x2ab344={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xaee3('0x1d')),'direction':'out'};if(this[_0xaee3('0x10')]===_0xaee3('0x11')){_0x2ab344[_0xaee3('0x12')]=utils[_0xaee3('0x1e')](_0x308f4f[0x2],this);}else{_0x2ab344[_0xaee3('0x12')]=utils['getMustacheRender'](_0x308f4f[0x1],this);}if(this[_0xaee3('0x1f')]){_0x2ab344['to']=this[_0xaee3('0x1f')][_0xaee3('0x20')]||'';if(this[_0xaee3('0x10')]===_0xaee3('0x11')&&_0x308f4f[0x1]==='1'){_0x2ab344['cc']=this['message']['cc']||'';}_0x2ab344[_0xaee3('0x20')]=this['message']['to']||'';_0x2ab344['phone']=this[_0xaee3('0x1f')][_0xaee3('0x21')]||'';_0x2ab344[_0xaee3('0x22')]=!![];if(this[_0xaee3('0x1f')][_0xaee3('0x23')]){_0x2ab344[_0xaee3('0x23')]='';_0x2ab344['subject']+=_[_0xaee3('0x24')](this[_0xaee3('0x1f')][_0xaee3('0x23')],_0xaee3('0x25'))?'':_0xaee3('0x26');_0x2ab344[_0xaee3('0x23')]+=this[_0xaee3('0x1f')][_0xaee3('0x23')];}}if(this[_0xaee3('0x10')]===_0xaee3('0x27')){_0x2ab344[_0xaee3('0x28')]=this[_0xaee3('0x29')]['id'];}else{_0x2ab344[_['upperFirst'](this[_0xaee3('0x10')])+_0xaee3('0x2a')]=this[_0xaee3('0x29')]['id'];}_0x2ab344[_[_0xaee3('0x2b')](this['channel'])+'InteractionId']=this[_0xaee3('0x19')]['id'];var _0x4898e5=this[_0xaee3('0x19')];if(rpc[this[_0xaee3('0x10')]+_0xaee3('0x2c')]){if(this['channel']===_0xaee3('0x11')){_0x2ab344[_0xaee3('0x2d')]=this[_0xaee3('0x1f')][_0xaee3('0x2e')];_0x2ab344[_0xaee3('0x2f')]=_0xaee3('0x30')+_[_0xaee3('0x31')](_0x2ab344[_0xaee3('0x12')],'','replace','','headers','auto-replied','All','auto_reply','account','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','autoreplyExecuted','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','resolve','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x34e4,0x13f));var _0x434e=function(_0xc48bd8,_0x355a3c){_0xc48bd8=_0xc48bd8-0x0;var _0x437282=_0x34e4[_0xc48bd8];return _0x437282;};'use strict';var _=require(_0x434e('0x0'));var moment=require(_0x434e('0x1'));var utils=require(_0x434e('0x2'));var logger=require(_0x434e('0x3'))(_0x434e('0x4'));var rpc={'chatMessage':require(_0x434e('0x5')),'openchannelMessage':require(_0x434e('0x6')),'mailMessage':require(_0x434e('0x7')),'smsMessage':require(_0x434e('0x8')),'faxMessage':require(_0x434e('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x434e('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x434e('0xb')),'smsInteraction':require(_0x434e('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x434e('0xd'));exports[_0x434e('0xe')]=function(_0x1f7b75,_0x328748,_0x2b17c0,_0x21f401){return function(_0x3aabaa){try{var _0x411161=this[_0x434e('0xf')];if(_0x411161===_0x434e('0x10')&&_0x21f401[_0x434e('0x11')][_0x434e('0x12')]){logger[_0x434e('0x13')](_0x434e('0x14'),_0x1f7b75,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x3aabaa['next']();}if(_0x328748[0x0]==='1'&&(_[_0x434e('0x15')](this[_0x434e('0x16')][_0x434e('0x17')])||!this[_0x434e('0x16')]['created'])){logger['info'](_0x434e('0x14'),_0x1f7b75,_0x434e('0x18'));return _0x3aabaa[_0x434e('0x19')]();}if(_0x328748[0x0]==='2'&&this[_0x434e('0x16')]['autoreplyExecuted']){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x1f7b75,'One\x20Time\x20already\x20sent');return _0x3aabaa['next']();}var _0x5cf97e={'ContactId':this[_0x434e('0x1a')]['id'],'sentAt':moment()['format'](_0x434e('0x1b')),'direction':_0x434e('0x1c')};if(this[_0x434e('0xf')]===_0x434e('0x10')){_0x5cf97e['body']=utils['getMustacheRender'](_0x328748[0x2],this);}else{_0x5cf97e[_0x434e('0x11')]=utils[_0x434e('0x1d')](_0x328748[0x1],this);}if(this[_0x434e('0x1e')]){_0x5cf97e['to']=this[_0x434e('0x1e')][_0x434e('0x1f')]||'';if(this['channel']===_0x434e('0x10')&&_0x328748[0x1]==='1'){_0x5cf97e['cc']=this[_0x434e('0x1e')]['cc']||'';}_0x5cf97e['from']=this[_0x434e('0x1e')]['to']||'';_0x5cf97e[_0x434e('0x20')]=this[_0x434e('0x1e')][_0x434e('0x20')]||'';_0x5cf97e[_0x434e('0x21')]=!![];if(this[_0x434e('0x1e')][_0x434e('0x22')]){_0x5cf97e[_0x434e('0x22')]='';_0x5cf97e['subject']+=_['startsWith'](this[_0x434e('0x1e')]['subject'],_0x434e('0x23'))?'':_0x434e('0x24');_0x5cf97e[_0x434e('0x22')]+=this['message'][_0x434e('0x22')];}}if(this[_0x434e('0xf')]==='chat'){_0x5cf97e[_0x434e('0x25')]=this['account']['id'];}else{_0x5cf97e[_['upperFirst'](this[_0x434e('0xf')])+'AccountId']=this['account']['id'];}_0x5cf97e[_[_0x434e('0x26')](this[_0x434e('0xf')])+_0x434e('0x27')]=this[_0x434e('0x16')]['id'];var _0xa1f0ce=this['interaction'];if(rpc[this[_0x434e('0xf')]+_0x434e('0x28')]){if(this[_0x434e('0xf')]===_0x434e('0x10')){_0x5cf97e[_0x434e('0x29')]=this[_0x434e('0x1e')][_0x434e('0x2a')];_0x5cf97e[_0x434e('0x2b')]=_0x434e('0x2c')+_[_0x434e('0x2d')](_0x5cf97e[_0x434e('0x11')],_0x434e('0x2e'),']+(>|$)/g,''),'priorityTrue':_0x591e36[0x1],'priorityFalse':_0x591e36[0x2]};var _0x1ec797=gotoif['validate'](_0x1b2452,{'typecast':!![]});if(_0x1ec797['length']){logger[_0x1096('0xe')](_0x1096('0xf'),_0x52e9c1,_['map'](_0x1ec797,_0x1096('0x10'))['join'](',\x20'));_0x590d5d[_0x1096('0x11')]();}else{try{var _0x58c35f=eval('('+_0x1b2452['condition']+')');var _0x58bbd6=_0x58c35f?_0x1b2452[_0x1096('0x12')]:_0x1b2452[_0x1096('0x13')];logger['info'](_0x1096('0x14'),_0x52e9c1,_0x1b2452[_0x1096('0x15')],_0x58c35f,_0x58bbd6||_0x1096('0x16'));if(_0x58bbd6){var _0x81f2da=_[_0x1096('0x17')](_0x590d5d['rules'](),{'p':_0x58bbd6});if(_0x81f2da>=0x0){logger[_0x1096('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x52e9c1,_0x58bbd6||_0x1096('0x16'),_0x81f2da);_0x590d5d[_0x1096('0x16')](_0x81f2da);}else{logger[_0x1096('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x52e9c1,_0x58bbd6||_0x1096('0x16'));_0x590d5d[_0x1096('0x11')]();}}else{_0x590d5d['next']();}}catch(_0x1fb61c){logger[_0x1096('0xe')](_0x1096('0x19'),_0x52e9c1,_0x1fb61c[_0x1096('0x10')]);_0x590d5d['stop']();}}}catch(_0x73cedf){logger['error'](_0x1096('0xf'),_0x52e9c1,JSON[_0x1096('0x1a')](_0x73cedf));_0x590d5d[_0x1096('0x11')]();}};}; \ No newline at end of file +var _0x969b=['replace','length','error','map','message','join','stop','condition','priorityTrue','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','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x969b,0x1e3));var _0xb969=function(_0x3b5aa1,_0x268e6f){_0x3b5aa1=_0x3b5aa1-0x0;var _0x1c53b2=_0x969b[_0x3b5aa1];return _0x1c53b2;};'use strict';var schema=require(_0xb969('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xb969('0x1'));var logger=require(_0xb969('0x2'))(_0xb969('0x3'));var gotoif=schema({'condition':{'type':_0xb969('0x4'),'required':!![],'message':_0xb969('0x5')},'priorityTrue':{'type':_0xb969('0x6'),'message':_0xb969('0x7')},'priorityFalse':{'type':_0xb969('0x6'),'message':_0xb969('0x8')}});exports['consequence']=function(_0x2fe6af,_0xb267c3){return function(_0x18c484){try{var _0x4cefef={'condition':htmlToText['fromString'](utils[_0xb969('0x9')](_0xb267c3[0x0],this),{'wordwrap':![]})[_0xb969('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xb267c3[0x1],'priorityFalse':_0xb267c3[0x2]};var _0x1e2854=gotoif[_0xb969('0x0')](_0x4cefef,{'typecast':!![]});if(_0x1e2854[_0xb969('0xb')]){logger[_0xb969('0xc')]('[%s][GOTOIF]\x20%s',_0x2fe6af,_[_0xb969('0xd')](_0x1e2854,_0xb969('0xe'))[_0xb969('0xf')](',\x20'));_0x18c484[_0xb969('0x10')]();}else{try{var _0x2edd17=eval('('+_0x4cefef[_0xb969('0x11')]+')');var _0x2176f0=_0x2edd17?_0x4cefef[_0xb969('0x12')]:_0x4cefef[_0xb969('0x13')];logger[_0xb969('0x14')](_0xb969('0x15'),_0x2fe6af,_0x4cefef[_0xb969('0x11')],_0x2edd17,_0x2176f0||_0xb969('0x16'));if(_0x2176f0){var _0x867bb7=_[_0xb969('0x17')](_0x18c484[_0xb969('0x18')](),{'p':_0x2176f0});if(_0x867bb7>=0x0){logger[_0xb969('0x14')](_0xb969('0x19'),_0x2fe6af,_0x2176f0||_0xb969('0x16'),_0x867bb7);_0x18c484[_0xb969('0x16')](_0x867bb7);}else{logger[_0xb969('0x14')](_0xb969('0x1a'),_0x2fe6af,_0x2176f0||_0xb969('0x16'));_0x18c484[_0xb969('0x10')]();}}else{_0x18c484[_0xb969('0x16')]();}}catch(_0x2ecd84){logger[_0xb969('0xc')](_0xb969('0x1b'),_0x2fe6af,_0x2ecd84[_0xb969('0xe')]);_0x18c484[_0xb969('0x10')]();}}}catch(_0x3a568a){logger[_0xb969('0xc')]('[%s][GOTOIF]\x20%s',_0x2fe6af,JSON[_0xb969('0x1c')](_0x3a568a));_0x18c484[_0xb969('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 11607f9..b4fa8ac 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 _0xd384=['join','stop','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','error','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','[%s][GOTOP]\x20%s','map','message'];(function(_0x2860ab,_0x27440f){var _0x3037c4=function(_0x1eb3f3){while(--_0x1eb3f3){_0x2860ab['push'](_0x2860ab['shift']());}};_0x3037c4(++_0x27440f);}(_0xd384,0x107));var _0x4d38=function(_0x3f1978,_0x817d3d){_0x3f1978=_0x3f1978-0x0;var _0x516735=_0xd384[_0x3f1978];return _0x516735;};'use strict';var schema=require(_0x4d38('0x0'));var _=require(_0x4d38('0x1'));var logger=require(_0x4d38('0x2'))(_0x4d38('0x3'));var gotop=schema({'priority':{'type':_0x4d38('0x4'),'required':!![],'message':_0x4d38('0x5')}});exports['consequence']=function(_0x8505e,_0x508496){return function(_0x393d67){try{var _0x5102a5={'priority':_0x508496[0x0]};var _0x51e6b3=gotop[_0x4d38('0x0')](_0x5102a5,{'typecast':!![]});if(_0x51e6b3[_0x4d38('0x6')]){logger['error'](_0x4d38('0x7'),_0x8505e,_[_0x4d38('0x8')](_0x51e6b3,_0x4d38('0x9'))[_0x4d38('0xa')](',\x20'));_0x393d67[_0x4d38('0xb')]();}else{logger['info'](_0x4d38('0xc'),_0x8505e,_0x5102a5['priority']);if(_0x5102a5['priority']){var _0x3e9564=_[_0x4d38('0xd')](_0x393d67[_0x4d38('0xe')](),{'p':_0x5102a5[_0x4d38('0xf')]});if(_0x3e9564>=0x0){logger[_0x4d38('0x10')](_0x4d38('0x11'),_0x8505e,_0x5102a5[_0x4d38('0xf')]||_0x4d38('0x12'),_0x3e9564);_0x393d67[_0x4d38('0x12')](_0x3e9564);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x8505e,_0x5102a5[_0x4d38('0xf')]||_0x4d38('0x12'));_0x393d67[_0x4d38('0xb')]();}}else{_0x393d67[_0x4d38('0x12')]();}}}catch(_0x1b87e7){logger[_0x4d38('0x13')](_0x4d38('0x7'),_0x8505e,JSON[_0x4d38('0x14')](_0x1b87e7));_0x393d67['stop']();}};}; \ No newline at end of file +var _0xde6a=['stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message'];(function(_0x388319,_0x1aacd0){var _0x1d9ff9=function(_0x5ebec7){while(--_0x5ebec7){_0x388319['push'](_0x388319['shift']());}};_0x1d9ff9(++_0x1aacd0);}(_0xde6a,0xa8));var _0xade6=function(_0x3ba67f,_0x490c2d){_0x3ba67f=_0x3ba67f-0x0;var _0x14a818=_0xde6a[_0x3ba67f];return _0x14a818;};'use strict';var schema=require(_0xade6('0x0'));var _=require(_0xade6('0x1'));var logger=require(_0xade6('0x2'))(_0xade6('0x3'));var gotop=schema({'priority':{'type':_0xade6('0x4'),'required':!![],'message':_0xade6('0x5')}});exports[_0xade6('0x6')]=function(_0x5ed1dd,_0xeb3af6){return function(_0x1c7ba6){try{var _0x43f397={'priority':_0xeb3af6[0x0]};var _0x4e83e7=gotop[_0xade6('0x0')](_0x43f397,{'typecast':!![]});if(_0x4e83e7[_0xade6('0x7')]){logger[_0xade6('0x8')](_0xade6('0x9'),_0x5ed1dd,_[_0xade6('0xa')](_0x4e83e7,_0xade6('0xb'))['join'](',\x20'));_0x1c7ba6[_0xade6('0xc')]();}else{logger[_0xade6('0xd')]('[%s][GOTOP]\x20priority\x20%s',_0x5ed1dd,_0x43f397[_0xade6('0xe')]);if(_0x43f397[_0xade6('0xe')]){var _0x16e900=_[_0xade6('0xf')](_0x1c7ba6[_0xade6('0x10')](),{'p':_0x43f397['priority']});if(_0x16e900>=0x0){logger[_0xade6('0xd')](_0xade6('0x11'),_0x5ed1dd,_0x43f397[_0xade6('0xe')]||_0xade6('0x12'),_0x16e900);_0x1c7ba6[_0xade6('0x12')](_0x16e900);}else{logger['info'](_0xade6('0x13'),_0x5ed1dd,_0x43f397[_0xade6('0xe')]||_0xade6('0x12'));_0x1c7ba6[_0xade6('0xc')]();}}else{_0x1c7ba6['next']();}}}catch(_0x2f322e){logger[_0xade6('0x8')](_0xade6('0x9'),_0x5ed1dd,JSON['stringify'](_0x2f322e));_0x1c7ba6['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 a512d74..4a6af4f 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 _0x24e9=['error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','chat','ChatWebsiteId','account','upperFirst','AccountId','channel','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','catch'];(function(_0x24211e,_0x3a2546){var _0x1b80e6=function(_0x48ee66){while(--_0x48ee66){_0x24211e['push'](_0x24211e['shift']());}};_0x1b80e6(++_0x3a2546);}(_0x24e9,0x85));var _0x924e=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0x24e9[_0x622035];return _0x326cf2;};'use strict';var _=require(_0x924e('0x0'));var utils=require('./utils');var logger=require(_0x924e('0x1'))(_0x924e('0x2'));var rpc={'chatMessage':require(_0x924e('0x3')),'openchannelMessage':require(_0x924e('0x4')),'mailMessage':require(_0x924e('0x5')),'smsMessage':require(_0x924e('0x6')),'faxMessage':require(_0x924e('0x7')),'whatsappMessage':require(_0x924e('0x8'))};exports['consequence']=function(_0x18346f,_0x31f0c3){return function(_0x13accc){try{var _0x19370a={'body':utils[_0x924e('0x9')](_0x31f0c3[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0x924e('0xa')){_0x19370a[_0x924e('0xb')]=this[_0x924e('0xc')]['id'];}else{_0x19370a[_[_0x924e('0xd')](this['channel'])+_0x924e('0xe')]=this[_0x924e('0xc')]['id'];}_0x19370a[_['upperFirst'](this[_0x924e('0xf')])+'InteractionId']=this[_0x924e('0x10')]['id'];if(rpc[this[_0x924e('0xf')]+_0x924e('0x11')]){return rpc[this[_0x924e('0xf')]+_0x924e('0x11')][_0x924e('0x12')](_0x19370a)[_0x924e('0x13')](function(_0x380bb5){logger['info'](_0x924e('0x14'),_0x18346f,_0x19370a['body']);_0x13accc[_0x924e('0x15')]();})[_0x924e('0x16')](function(_0x12dcec){logger[_0x924e('0x17')](_0x924e('0x14'),_0x18346f,JSON[_0x924e('0x18')](_0x12dcec));_0x13accc['stop']();});}}catch(_0x4df52c){logger[_0x924e('0x17')](_0x924e('0x14'),_0x18346f,JSON['stringify'](_0x4df52c));_0x13accc[_0x924e('0x19')]();}};}; \ No newline at end of file +var _0x3ba4=['AccountId','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','account','upperFirst'];(function(_0xa0c73a,_0x50f0b2){var _0x4094a3=function(_0x173ad5){while(--_0x173ad5){_0xa0c73a['push'](_0xa0c73a['shift']());}};_0x4094a3(++_0x50f0b2);}(_0x3ba4,0xc2));var _0x43ba=function(_0xa9465f,_0xe91d87){_0xa9465f=_0xa9465f-0x0;var _0x1e574d=_0x3ba4[_0xa9465f];return _0x1e574d;};'use strict';var _=require(_0x43ba('0x0'));var utils=require('./utils');var logger=require(_0x43ba('0x1'))(_0x43ba('0x2'));var rpc={'chatMessage':require(_0x43ba('0x3')),'openchannelMessage':require(_0x43ba('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x43ba('0x5')),'faxMessage':require(_0x43ba('0x6')),'whatsappMessage':require(_0x43ba('0x7'))};exports[_0x43ba('0x8')]=function(_0x152b99,_0x1866e6){return function(_0x3a30a9){try{var _0x172917={'body':utils[_0x43ba('0x9')](_0x1866e6[0x0],this),'ContactId':this['contact']['id']};if(this[_0x43ba('0xa')]==='chat'){_0x172917[_0x43ba('0xb')]=this[_0x43ba('0xc')]['id'];}else{_0x172917[_[_0x43ba('0xd')](this['channel'])+_0x43ba('0xe')]=this[_0x43ba('0xc')]['id'];}_0x172917[_[_0x43ba('0xd')](this[_0x43ba('0xa')])+_0x43ba('0xf')]=this[_0x43ba('0x10')]['id'];if(rpc[this[_0x43ba('0xa')]+_0x43ba('0x11')]){return rpc[this[_0x43ba('0xa')]+_0x43ba('0x11')][_0x43ba('0x12')](_0x172917)[_0x43ba('0x13')](function(_0x3f0732){logger['info'](_0x43ba('0x14'),_0x152b99,_0x172917[_0x43ba('0x15')]);_0x3a30a9[_0x43ba('0x16')]();})['catch'](function(_0x3b4ef5){logger[_0x43ba('0x17')](_0x43ba('0x14'),_0x152b99,JSON[_0x43ba('0x18')](_0x3b4ef5));_0x3a30a9[_0x43ba('0x19')]();});}}catch(_0x322c17){logger['error']('[%s][MESSAGE]\x20%s',_0x152b99,JSON[_0x43ba('0x18')](_0x322c17));_0x3a30a9[_0x43ba('0x19')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index dbb490c..0842025 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 _0x1bdd=['[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger','info','getMustacheRender','next','error'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x1bdd,0xa5));var _0xd1bd=function(_0x5c418a,_0x5392ac){_0x5c418a=_0x5c418a-0x0;var _0x20f968=_0x1bdd[_0x5c418a];return _0x20f968;};'use strict';var utils=require(_0xd1bd('0x0'));var logger=require(_0xd1bd('0x1'))('routing');exports['consequence']=function(_0xffc4e8,_0x48d8c7){return function(_0x7cf9f4){try{logger[_0xd1bd('0x2')]('[%s][NOOP]\x20%s',_0xffc4e8,utils[_0xd1bd('0x3')](_0x48d8c7[0x0],this));_0x7cf9f4[_0xd1bd('0x4')]();}catch(_0x2c01d7){logger[_0xd1bd('0x5')](_0xd1bd('0x6'),_0xffc4e8,JSON[_0xd1bd('0x7')](_0x2c01d7));_0x7cf9f4[_0xd1bd('0x8')]();}};}; \ No newline at end of file +var _0x4828=['consequence','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x34bbd5,_0x3c810a){var _0x46244f=function(_0x5884b9){while(--_0x5884b9){_0x34bbd5['push'](_0x34bbd5['shift']());}};_0x46244f(++_0x3c810a);}(_0x4828,0x93));var _0x8482=function(_0x46a727,_0x2f3ad2){_0x46a727=_0x46a727-0x0;var _0x2f774f=_0x4828[_0x46a727];return _0x2f774f;};'use strict';var utils=require(_0x8482('0x0'));var logger=require(_0x8482('0x1'))(_0x8482('0x2'));exports[_0x8482('0x3')]=function(_0x5a8318,_0xa5c5a7){return function(_0x31be2b){try{logger['info'](_0x8482('0x4'),_0x5a8318,utils[_0x8482('0x5')](_0xa5c5a7[0x0],this));_0x31be2b[_0x8482('0x6')]();}catch(_0x5d0222){logger[_0x8482('0x7')]('[%s][NOOP]\x20%s',_0x5a8318,JSON[_0x8482('0x8')](_0x5d0222));_0x31be2b[_0x8482('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 b9f90af..84455df 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 _0x018b=['name','QueueReport','catch','error','create\x20queue\x20report','Interaction','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','map','join','find','Queues','timeout','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','moment','routing','redis','socket.io-emitter','account','queue','from','joinAt','emit','queue_id','push','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]'];(function(_0x2e26a0,_0x3caa1d){var _0x22015c=function(_0x73d6ab){while(--_0x73d6ab){_0x2e26a0['push'](_0x2e26a0['shift']());}};_0x22015c(++_0x3caa1d);}(_0x018b,0x1c0));var _0xb018=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x018b[_0x39096d];return _0x13da4f;};'use strict';var schema=require('validate');var _=require(_0xb018('0x0'));var util=require(_0xb018('0x1'));var seqqueue=require(_0xb018('0x2'));var moment=require(_0xb018('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xb018('0x4'));var strategy=require('./strategy');config[_0xb018('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb018('0x6'))(new Redis(config['redis']));var attributes=['id','queue_id',_0xb018('0x7'),_0xb018('0x8'),_0xb018('0x9'),_0xb018('0xa')];function emit(_0x16e766,_0x8a8ae0,_0x11fa98){io['to'](_0x16e766)[_0xb018('0xb')](_0x8a8ae0,_0x11fa98);}function emitChannelQueueInteraction(_0x3e8135,_0x518353,_0x559c98,_0x4235ee,_0x5b2136,_0x38eb0c,_0x27b34d,_0x699f2c){var _0x3cd2fa=_['clone'](_0x559c98);_0x3cd2fa[_0xb018('0xc')]=_0x699f2c;_0x3cd2fa[_0xb018('0x8')]=_0x518353;_0x3cd2fa[_0xb018('0x7')]=_0x4235ee;_0x3cd2fa['id']=_0x5b2136;if(_0x38eb0c){attributes[_0xb018('0xd')](_[_0xb018('0xe')](_0x3e8135)+'InteractionId');_0x27b34d[util[_0xb018('0xf')](_0xb018('0x10'),_0x3e8135)][_0x5b2136]=_[_0xb018('0x11')](_0x3cd2fa,attributes);}else{delete _0x27b34d[util['format'](_0xb018('0x10'),_0x3e8135)][_0x5b2136];}emit(util[_0xb018('0xf')](_0xb018('0x12'),_0x3e8135,_0x518353),util['format']('%s_queue_waiting_interaction:%s',_0x3e8135,_0x38eb0c?_0xb018('0x13'):_0xb018('0x14')),_[_0xb018('0x11')](_0x3cd2fa,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb018('0x15')),'chatQueueReport':require(_0xb018('0x16')),'smsQueueReport':require(_0xb018('0x17')),'faxQueueReport':require(_0xb018('0x18')),'whatsappQueueReport':require(_0xb018('0x19')),'chatInteraction':require(_0xb018('0x1a')),'faxInteraction':require(_0xb018('0x1b')),'mailInteraction':require(_0xb018('0x1c')),'openchannelInteraction':require(_0xb018('0x1d')),'smsInteraction':require(_0xb018('0x1e')),'whatsappInteraction':require(_0xb018('0x1f'))};var queue=schema({'name':{'type':_0xb018('0x20'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb018('0x21'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x1000e5,_0x1376ec,_0x5ac7de,_0x34be33){if(_0x1000e5&&_0x1376ec&&_0x5ac7de){_0x1376ec[_0xb018('0x22')]+=0x1;var _0x3402bf={'uniqueid':_0x1000e5,'from':_0x5ac7de[_0xb018('0x23')]?_0x5ac7de[_0xb018('0x23')][_0xb018('0x9')]:'','joinAt':moment()[_0xb018('0xf')](_0xb018('0x24')),'ContactId':_0x5ac7de['contact']?_0x5ac7de[_0xb018('0x25')]['id']:null,'ListId':_0x5ac7de[_0xb018('0x26')]?_0x5ac7de[_0xb018('0x26')]['id']:null};_0x3402bf[_[_0xb018('0x27')](_0x5ac7de[_0xb018('0x28')])+_0xb018('0x29')]=_0x1376ec['id']||null;_0x3402bf[_[_0xb018('0x27')](_0x5ac7de['channel'])+_0xb018('0x2a')]=_0x5ac7de['interaction']?_0x5ac7de[_0xb018('0x2b')]['id']:null;_0x3402bf[_[_0xb018('0x27')](_0x5ac7de[_0xb018('0x28')])+_0xb018('0x2c')]=_0x5ac7de[_0xb018('0x2d')]?_0x5ac7de[_0xb018('0x2d')]['id']:null;_0x3402bf[_['upperFirst'](_0x5ac7de['channel'])+(_0x5ac7de[_0xb018('0x28')]!=='chat'?_0xb018('0x2e'):_0xb018('0x2f'))]=_0x5ac7de['account']?_0x5ac7de[_0xb018('0x7')]['id']:null;logger[_0xb018('0x30')](util[_0xb018('0xf')](_0xb018('0x31'),_0x1000e5,_0x1376ec[_0xb018('0x32')]));emitChannelQueueInteraction(_0x5ac7de['channel'],_0x1376ec[_0xb018('0x32')],_0x3402bf,_0x5ac7de['account']['name'],_0x5ac7de['message']['id'],!![],_0x34be33,_0x1376ec['id']);if(rpc[_0x5ac7de[_0xb018('0x28')]+_0xb018('0x33')]){return rpc[_0x5ac7de[_0xb018('0x28')]+'QueueReport']['create'](_0x3402bf)[_0xb018('0x34')](function(_0x31f2ee){logger[_0xb018('0x35')](_0xb018('0x36'),_0x31f2ee);});}}}function stopRouting(_0x2779d1,_0x1a6308,_0x244290,_0xfbce7f){if(_0x2779d1&&_0x1a6308){_0x1a6308[_0xb018('0x22')]-=0x1;var _0x48ecd9={'leaveAt':moment()[_0xb018('0xf')](_0xb018('0x24')),'acceptAt':moment()[_0xb018('0xf')](_0xb018('0x24')),'reason':'accepted'};logger['info'](util[_0xb018('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x2779d1,_0x1a6308[_0xb018('0x32')]));emitChannelQueueInteraction(_0x244290[_0xb018('0x28')],_0x1a6308[_0xb018('0x32')],_0x244290['body'],_0x244290['account'][_0xb018('0x32')],_0x244290[_0xb018('0x2d')]['id'],![],_0xfbce7f,_0x1a6308['id']);return rpc[_0x244290[_0xb018('0x28')]+_0xb018('0x37')][_0xb018('0x38')](_0x244290[_0xb018('0x2b')]['id'],{'queueId':_0x1a6308['id']})['then'](function(){if(rpc[_0x244290['channel']+_0xb018('0x33')]){return rpc[_0x244290[_0xb018('0x28')]+'QueueReport'][_0xb018('0x38')](_0x2779d1,_0x48ecd9)[_0xb018('0x34')](function(_0x3c09e4){logger[_0xb018('0x35')](_0xb018('0x39'),_0x3c09e4);});}});}}function endRouting(_0x31ca2c,_0x4ccc16,_0x40e2b8,_0x343073){if(_0x31ca2c&&_0x4ccc16){_0x4ccc16[_0xb018('0x22')]-=0x1;var _0x217f11={'leaveAt':moment()[_0xb018('0xf')](_0xb018('0x24')),'exitAt':moment()[_0xb018('0xf')](_0xb018('0x24')),'reason':'timeout'};logger[_0xb018('0x30')](util[_0xb018('0xf')](_0xb018('0x3a'),_0x31ca2c,_0x4ccc16[_0xb018('0x32')]));emitChannelQueueInteraction(_0x40e2b8[_0xb018('0x28')],_0x4ccc16[_0xb018('0x32')],_0x40e2b8[_0xb018('0x23')],_0x40e2b8[_0xb018('0x7')][_0xb018('0x32')],_0x40e2b8['message']['id'],![],_0x343073);if(rpc[_0x40e2b8[_0xb018('0x28')]+_0xb018('0x33')]){return rpc[_0x40e2b8[_0xb018('0x28')]+_0xb018('0x33')][_0xb018('0x38')](_0x31ca2c,_0x217f11)[_0xb018('0x34')](function(_0x50548c){logger[_0xb018('0x35')]('update\x20queue\x20report',_0x50548c);});}}}function handleFindQueue(_0x56768f){return function(_0xae9352){return _0xae9352['name'][_0xb018('0x3b')]()===_0x56768f[_0xb018('0x3b')]();};}exports[_0xb018('0x3c')]=function(_0x5b8bf1,_0x2728aa,_0x49a492,_0x581136){return function(_0x54ec4d){try{var _0x37caae={'name':_0x2728aa[0x0],'timeout':_0x2728aa[0x1]};var _0x114225=queue[_0xb018('0x3d')](_0x37caae,{'typecast':!![]});if(_0x114225[_0xb018('0x3e')]){logger[_0xb018('0x35')]('[%s][QUEUE]\x20%s',_0x5b8bf1,_[_0xb018('0x3f')](_0x114225,_0xb018('0x2d'))[_0xb018('0x40')](',\x20'));_0x54ec4d['stop']();}else{var _0x271fcd=_[_0xb018('0x41')](_0x49a492[_0x581136[_0xb018('0x28')]+_0xb018('0x42')],handleFindQueue(_0x37caae[_0xb018('0x32')]));if(_0x271fcd){startRouting(_0x5b8bf1,_0x271fcd,_0x581136,_0x49a492);var _0x3f896f=(_0x271fcd[_0xb018('0x43')]||0xa)*0x3e8;var _0x14adbc=(_0x37caae[_0xb018('0x43')]||0x14)*0x3e8;var _0x23e677;if(_0x3f896f>_0x14adbc){_0x14adbc=_0x3f896f;}var _0x15248c=seqqueue['createQueue'](_0x3f896f);_0x15248c['id']=_0x5b8bf1;_0x15248c[_0xb018('0x44')]=_0x3f896f;_0x15248c[_0xb018('0x45')]=_0x14adbc;_0x15248c[_0xb018('0x28')]=_0x581136['channel'];_0x49a492[_0xb018('0x46')][_0x5b8bf1]['on']('end',function(){logger['info'](_0xb018('0x47'),_0x5b8bf1);stopRouting(_0x5b8bf1,_0x271fcd,_0x581136,_0x49a492);clearTimeout(_0x23e677);_0x23e677=undefined;_0x15248c[_0xb018('0x48')](!![]);if(_0x49a492['rules'][_0x5b8bf1]){delete _0x49a492['rules'][_0x5b8bf1];}_0x54ec4d[_0xb018('0x49')]();});_0x49a492[_0xb018('0x46')][_0x5b8bf1]['on'](_0xb018('0x4a'),function(){if(_0x49a492['rules'][_0x5b8bf1]){delete _0x49a492[_0xb018('0x46')][_0x5b8bf1];}});_0x23e677=setTimeout(function(){logger[_0xb018('0x30')](_0xb018('0x4b'),_0x5b8bf1);endRouting(_0x5b8bf1,_0x271fcd,_0x581136,_0x49a492);clearTimeout(_0x23e677);_0x15248c[_0xb018('0x48')](!![]);_0x54ec4d[_0xb018('0x4c')]();},_0x14adbc);switch(_0x271fcd[_0xb018('0x4d')]){case _0xb018('0x4e'):strategy[_0xb018('0x4e')](_0x15248c,_0x271fcd,_0x49a492,_0x581136);break;default:strategy[_0xb018('0x4f')](_0x15248c,_0x271fcd,_0x49a492,_0x581136);}}else{logger[_0xb018('0x35')](_0xb018('0x50'),_0x5b8bf1,_0x37caae[_0xb018('0x32')]);_0x54ec4d[_0xb018('0x49')]();}}}catch(_0xf2edf4){logger[_0xb018('0x35')](_0xb018('0x51'),_0x5b8bf1,_0xf2edf4[_0xb018('0x52')]);_0x54ec4d[_0xb018('0x49')]();}};}; \ No newline at end of file +var _0x4594=['validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','joinAt','emit','clone','queue','push','capitalize','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/smsInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','Interaction','then','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update','catch','error','toLowerCase','consequence','length','join','stop','Queues','timeout','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','[%s][QUEUE]\x20%s'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x4594,0x144));var _0x4459=function(_0x20154d,_0x3bb38){_0x20154d=_0x20154d-0x0;var _0x36bc1c=_0x4594[_0x20154d];return _0x36bc1c;};'use strict';var schema=require(_0x4459('0x0'));var _=require('lodash');var util=require(_0x4459('0x1'));var seqqueue=require(_0x4459('0x2'));var moment=require(_0x4459('0x3'));var Redis=require(_0x4459('0x4'));var config=require(_0x4459('0x5'));var logger=require(_0x4459('0x6'))(_0x4459('0x7'));var strategy=require(_0x4459('0x8'));config[_0x4459('0x9')]=_[_0x4459('0xa')](config[_0x4459('0x9')],{'host':_0x4459('0xb'),'port':0x18eb});var io=require(_0x4459('0xc'))(new Redis(config[_0x4459('0x9')]));var attributes=['id',_0x4459('0xd'),_0x4459('0xe'),'queue','from',_0x4459('0xf')];function emit(_0x8ff4ed,_0x496600,_0xc95f40){io['to'](_0x8ff4ed)[_0x4459('0x10')](_0x496600,_0xc95f40);}function emitChannelQueueInteraction(_0x411d78,_0x12d3e3,_0x1ad257,_0xae5cf5,_0x1d62a4,_0x32279c,_0x2dc70e,_0x2a267f){var _0x9fabd0=_[_0x4459('0x11')](_0x1ad257);_0x9fabd0[_0x4459('0xd')]=_0x2a267f;_0x9fabd0[_0x4459('0x12')]=_0x12d3e3;_0x9fabd0[_0x4459('0xe')]=_0xae5cf5;_0x9fabd0['id']=_0x1d62a4;if(_0x32279c){attributes[_0x4459('0x13')](_[_0x4459('0x14')](_0x411d78)+'InteractionId');_0x2dc70e[util['format']('%sQueuesWaitingInteractions',_0x411d78)][_0x1d62a4]=_['pick'](_0x9fabd0,attributes);}else{delete _0x2dc70e[util[_0x4459('0x15')](_0x4459('0x16'),_0x411d78)][_0x1d62a4];}emit(util[_0x4459('0x15')](_0x4459('0x17'),_0x411d78,_0x12d3e3),util['format'](_0x4459('0x18'),_0x411d78,_0x32279c?_0x4459('0x19'):_0x4459('0x1a')),_['pick'](_0x9fabd0,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x4459('0x1b')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x4459('0x1c')),'chatInteraction':require(_0x4459('0x1d')),'faxInteraction':require('../../rpc/faxInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x4459('0x1e')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0x4459('0x1f'),'required':!![],'message':_0x4459('0x20')},'timeout':{'type':_0x4459('0x21'),'message':_0x4459('0x22')}});function startRouting(_0x315401,_0xed1b65,_0x4159d0,_0x10cb12){if(_0x315401&&_0xed1b65&&_0x4159d0){_0xed1b65[_0x4459('0x23')]+=0x1;var _0x1638ff={'uniqueid':_0x315401,'from':_0x4159d0[_0x4459('0x24')]?_0x4159d0['body']['from']:'','joinAt':moment()[_0x4459('0x15')](_0x4459('0x25')),'ContactId':_0x4159d0[_0x4459('0x26')]?_0x4159d0['contact']['id']:null,'ListId':_0x4159d0[_0x4459('0x27')]?_0x4159d0[_0x4459('0x27')]['id']:null};_0x1638ff[_[_0x4459('0x28')](_0x4159d0[_0x4459('0x29')])+_0x4459('0x2a')]=_0xed1b65['id']||null;_0x1638ff[_[_0x4459('0x28')](_0x4159d0[_0x4459('0x29')])+'InteractionId']=_0x4159d0['interaction']?_0x4159d0[_0x4459('0x2b')]['id']:null;_0x1638ff[_[_0x4459('0x28')](_0x4159d0[_0x4459('0x29')])+_0x4459('0x2c')]=_0x4159d0[_0x4459('0x2d')]?_0x4159d0['message']['id']:null;_0x1638ff[_['upperFirst'](_0x4159d0[_0x4459('0x29')])+(_0x4159d0['channel']!=='chat'?_0x4459('0x2e'):'WebsiteId')]=_0x4159d0[_0x4459('0xe')]?_0x4159d0[_0x4459('0xe')]['id']:null;logger[_0x4459('0x2f')](util[_0x4459('0x15')](_0x4459('0x30'),_0x315401,_0xed1b65[_0x4459('0x31')]));emitChannelQueueInteraction(_0x4159d0[_0x4459('0x29')],_0xed1b65[_0x4459('0x31')],_0x1638ff,_0x4159d0[_0x4459('0xe')][_0x4459('0x31')],_0x4159d0[_0x4459('0x2d')]['id'],!![],_0x10cb12,_0xed1b65['id']);if(rpc[_0x4159d0[_0x4459('0x29')]+_0x4459('0x32')]){return rpc[_0x4159d0[_0x4459('0x29')]+_0x4459('0x32')][_0x4459('0x33')](_0x1638ff)['catch'](function(_0x329859){logger['error'](_0x4459('0x34'),_0x329859);});}}}function stopRouting(_0x57e410,_0xb3f0c9,_0x5e2a84,_0x553e4e){if(_0x57e410&&_0xb3f0c9){_0xb3f0c9['waiting']-=0x1;var _0x28db7d={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x4459('0x15')](_0x4459('0x25')),'reason':_0x4459('0x35')};logger[_0x4459('0x2f')](util[_0x4459('0x15')](_0x4459('0x36'),_0x57e410,_0xb3f0c9[_0x4459('0x31')]));emitChannelQueueInteraction(_0x5e2a84['channel'],_0xb3f0c9['name'],_0x5e2a84[_0x4459('0x24')],_0x5e2a84[_0x4459('0xe')][_0x4459('0x31')],_0x5e2a84['message']['id'],![],_0x553e4e,_0xb3f0c9['id']);return rpc[_0x5e2a84[_0x4459('0x29')]+_0x4459('0x37')]['update'](_0x5e2a84[_0x4459('0x2b')]['id'],{'queueId':_0xb3f0c9['id']})[_0x4459('0x38')](function(){if(rpc[_0x5e2a84[_0x4459('0x29')]+_0x4459('0x32')]){return rpc[_0x5e2a84[_0x4459('0x29')]+_0x4459('0x32')]['update'](_0x57e410,_0x28db7d)['catch'](function(_0x17612e){logger['error'](_0x4459('0x39'),_0x17612e);});}});}}function endRouting(_0x3c49ee,_0x5cb19a,_0x24f677,_0x22ad51){if(_0x3c49ee&&_0x5cb19a){_0x5cb19a[_0x4459('0x23')]-=0x1;var _0x460c41={'leaveAt':moment()['format'](_0x4459('0x25')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':'timeout'};logger[_0x4459('0x2f')](util['format'](_0x4459('0x3a'),_0x3c49ee,_0x5cb19a[_0x4459('0x31')]));emitChannelQueueInteraction(_0x24f677[_0x4459('0x29')],_0x5cb19a[_0x4459('0x31')],_0x24f677[_0x4459('0x24')],_0x24f677[_0x4459('0xe')][_0x4459('0x31')],_0x24f677[_0x4459('0x2d')]['id'],![],_0x22ad51);if(rpc[_0x24f677[_0x4459('0x29')]+_0x4459('0x32')]){return rpc[_0x24f677[_0x4459('0x29')]+_0x4459('0x32')][_0x4459('0x3b')](_0x3c49ee,_0x460c41)[_0x4459('0x3c')](function(_0x20b273){logger[_0x4459('0x3d')](_0x4459('0x39'),_0x20b273);});}}}function handleFindQueue(_0x51a288){return function(_0x411477){return _0x411477['name'][_0x4459('0x3e')]()===_0x51a288['toLowerCase']();};}exports[_0x4459('0x3f')]=function(_0x34ba3b,_0x37b87e,_0x5252bc,_0x2904b9){return function(_0x178d3b){try{var _0x2b90b5={'name':_0x37b87e[0x0],'timeout':_0x37b87e[0x1]};var _0x382f1b=queue[_0x4459('0x0')](_0x2b90b5,{'typecast':!![]});if(_0x382f1b[_0x4459('0x40')]){logger[_0x4459('0x3d')]('[%s][QUEUE]\x20%s',_0x34ba3b,_['map'](_0x382f1b,'message')[_0x4459('0x41')](',\x20'));_0x178d3b[_0x4459('0x42')]();}else{var _0x27ca9f=_['find'](_0x5252bc[_0x2904b9[_0x4459('0x29')]+_0x4459('0x43')],handleFindQueue(_0x2b90b5['name']));if(_0x27ca9f){startRouting(_0x34ba3b,_0x27ca9f,_0x2904b9,_0x5252bc);var _0x5bd4eb=(_0x27ca9f[_0x4459('0x44')]||0xa)*0x3e8;var _0x504ab0=(_0x2b90b5[_0x4459('0x44')]||0x14)*0x3e8;var _0x17966f;if(_0x5bd4eb>_0x504ab0){_0x504ab0=_0x5bd4eb;}var _0x4e0817=seqqueue[_0x4459('0x45')](_0x5bd4eb);_0x4e0817['id']=_0x34ba3b;_0x4e0817[_0x4459('0x46')]=_0x5bd4eb;_0x4e0817[_0x4459('0x47')]=_0x504ab0;_0x4e0817[_0x4459('0x29')]=_0x2904b9[_0x4459('0x29')];_0x5252bc[_0x4459('0x48')][_0x34ba3b]['on'](_0x4459('0x49'),function(){logger['info'](_0x4459('0x4a'),_0x34ba3b);stopRouting(_0x34ba3b,_0x27ca9f,_0x2904b9,_0x5252bc);clearTimeout(_0x17966f);_0x17966f=undefined;_0x4e0817[_0x4459('0x4b')](!![]);if(_0x5252bc[_0x4459('0x48')][_0x34ba3b]){delete _0x5252bc[_0x4459('0x48')][_0x34ba3b];}_0x178d3b[_0x4459('0x42')]();});_0x5252bc[_0x4459('0x48')][_0x34ba3b]['on'](_0x4459('0x4c'),function(){if(_0x5252bc[_0x4459('0x48')][_0x34ba3b]){delete _0x5252bc[_0x4459('0x48')][_0x34ba3b];}});_0x17966f=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x34ba3b);endRouting(_0x34ba3b,_0x27ca9f,_0x2904b9,_0x5252bc);clearTimeout(_0x17966f);_0x4e0817['close'](!![]);_0x178d3b[_0x4459('0x4d')]();},_0x504ab0);switch(_0x27ca9f[_0x4459('0x4e')]){case _0x4459('0x4f'):strategy[_0x4459('0x4f')](_0x4e0817,_0x27ca9f,_0x5252bc,_0x2904b9);break;default:strategy['beepall'](_0x4e0817,_0x27ca9f,_0x5252bc,_0x2904b9);}}else{logger[_0x4459('0x3d')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x34ba3b,_0x2b90b5[_0x4459('0x31')]);_0x178d3b[_0x4459('0x42')]();}}}catch(_0x190685){logger['error'](_0x4459('0x50'),_0x34ba3b,_0x190685['stack']);_0x178d3b['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 c6baab7..9c35648 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 _0x24ca=['bind','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','busy','saveWaitingNotification','channel','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','removeWaitingNotification','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout'];(function(_0x55ee58,_0xab0bf5){var _0x4878d8=function(_0x215a6d){while(--_0x215a6d){_0x55ee58['push'](_0x55ee58['shift']());}};_0x4878d8(++_0xab0bf5);}(_0x24ca,0x1bc));var _0xa24c=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x24ca[_0x4a7631];return _0x1a5a6f;};'use strict';var _=require(_0xa24c('0x0'));var uuid=require('uuid');var util=require(_0xa24c('0x1'));var logger=require(_0xa24c('0x2'))(_0xa24c('0x3'));var Agent=function(_0x5876d6,_0x18497e,_0x8a54a0,_0x195e60){this[_0xa24c('0x4')]=uuid['v4']();this[_0xa24c('0x5')]=_0x5876d6;this[_0xa24c('0x6')]=_0x18497e;this[_0xa24c('0x7')]=_0x8a54a0;this[_0xa24c('0x3')]=_0x195e60;this[_0xa24c('0x5')][_0xa24c('0x8')](this[_0xa24c('0x9')]['bind'](this),this[_0xa24c('0xa')][_0xa24c('0xb')](this));this[_0xa24c('0x5')]['on']('timeout',this[_0xa24c('0xa')][_0xa24c('0xb')](this));this[_0xa24c('0x5')]['on'](_0xa24c('0xc'),this[_0xa24c('0xd')][_0xa24c('0xb')](this));};Agent[_0xa24c('0xe')][_0xa24c('0x8')]=function(){this[_0xa24c('0x5')]['push'](this[_0xa24c('0x9')][_0xa24c('0xb')](this),this[_0xa24c('0xa')][_0xa24c('0xb')](this));};Agent['prototype'][_0xa24c('0xd')]=function(){this[_0xa24c('0xa')](!![]);};Agent[_0xa24c('0xe')][_0xa24c('0x9')]=function(){logger[_0xa24c('0xf')](_0xa24c('0x10'),this[_0xa24c('0x5')]['id'],this['agent']['id']);if(_['isNil'](this[_0xa24c('0x7')][_0xa24c('0x11')][this['agent']['id']])){logger['debug'](_0xa24c('0x12'),this[_0xa24c('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa24c('0x8')]['bind'](this),0x3e8);}else{if(this[_0xa24c('0x3')][_0xa24c('0x13')]||util[_0xa24c('0x14')](this[_0xa24c('0x5')]['id'],this['realtime'][_0xa24c('0x11')][this[_0xa24c('0x6')]['id']],this[_0xa24c('0x5')]['channel'],![])){this['realtime']['agents'][this['agent']['id']][_0xa24c('0x15')]=!![];this[_0xa24c('0x7')][_0xa24c('0x11')][this[_0xa24c('0x6')]['id']]['busyQueue']=undefined;util[_0xa24c('0x16')](this['realtime'],this[_0xa24c('0x3')],this[_0xa24c('0x6')],this['squeue'][_0xa24c('0x17')]);util[_0xa24c('0x18')](this[_0xa24c('0x4')],this[_0xa24c('0x5')]['id'],this[_0xa24c('0x7')]['agents'][this[_0xa24c('0x6')]['id']],null,this['routing']);util[_0xa24c('0x19')](this[_0xa24c('0x5')]['id'],this[_0xa24c('0x7')]['agents'][this[_0xa24c('0x6')]['id']],_0xa24c('0x1a')+(this[_0xa24c('0x3')][_0xa24c('0x13')]?_0xa24c('0x1b'):''));}else{logger[_0xa24c('0xf')](_0xa24c('0x1c'),this['squeue']['id'],this[_0xa24c('0x6')]['id']);setTimeout(this[_0xa24c('0x8')][_0xa24c('0xb')](this),0x3e8);}}};Agent[_0xa24c('0xe')]['handleTimeout']=function(_0x21d2a8){if(_[_0xa24c('0x1d')](this[_0xa24c('0x7')]['agents'][this[_0xa24c('0x6')]['id']])){return logger[_0xa24c('0xf')](_0xa24c('0x12'),this['squeue']['id'],this[_0xa24c('0x6')]['id']);}else{logger['debug'](_0xa24c('0x1e'),this[_0xa24c('0x5')]['id'],this[_0xa24c('0x6')]['id']);util['hideNotification'](this[_0xa24c('0x4')],this[_0xa24c('0x5')]['id'],this[_0xa24c('0x7')]['agents'][this[_0xa24c('0x6')]['id']],null,this['routing']);this[_0xa24c('0x7')][_0xa24c('0x11')][this['agent']['id']]['busy']=![];this[_0xa24c('0x7')][_0xa24c('0x11')][this[_0xa24c('0x6')]['id']][_0xa24c('0x1f')]=undefined;util[_0xa24c('0x20')](this[_0xa24c('0x7')],this[_0xa24c('0x3')],this['agent'],this[_0xa24c('0x5')][_0xa24c('0x17')]);util[_0xa24c('0x19')](this[_0xa24c('0x5')]['id'],this[_0xa24c('0x7')][_0xa24c('0x11')][this[_0xa24c('0x6')]['id']],_0x21d2a8?_0xa24c('0x21'):_0xa24c('0x22'));}if(!_0x21d2a8){setTimeout(this[_0xa24c('0x8')]['bind'](this),0x3e8);}};function agent(_0x70a957,_0x66f5a6,_0x2b362d,_0x1b0757){return new Agent(_0x70a957,_0x66f5a6,_0x2b362d,_0x1b0757);}module['exports']=agent; \ No newline at end of file +var _0x2123=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','showNotification','writeLog','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','busy','busyQueue','removeWaitingNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','push','bind','timeout','handleTimeout','drained','handleDrained','prototype','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime'];(function(_0x13ff52,_0x389e83){var _0x1fd16b=function(_0x312d74){while(--_0x312d74){_0x13ff52['push'](_0x13ff52['shift']());}};_0x1fd16b(++_0x389e83);}(_0x2123,0x190));var _0x3212=function(_0x5c851b,_0x50dd16){_0x5c851b=_0x5c851b-0x0;var _0x39d867=_0x2123[_0x5c851b];return _0x39d867;};'use strict';var _=require(_0x3212('0x0'));var uuid=require(_0x3212('0x1'));var util=require(_0x3212('0x2'));var logger=require(_0x3212('0x3'))(_0x3212('0x4'));var Agent=function(_0x2ff863,_0x8c047,_0x2e951f,_0x304f80){this[_0x3212('0x5')]=uuid['v4']();this[_0x3212('0x6')]=_0x2ff863;this[_0x3212('0x7')]=_0x8c047;this['realtime']=_0x2e951f;this[_0x3212('0x4')]=_0x304f80;this[_0x3212('0x6')][_0x3212('0x8')](this['handleRun'][_0x3212('0x9')](this),this['handleTimeout'][_0x3212('0x9')](this));this[_0x3212('0x6')]['on'](_0x3212('0xa'),this[_0x3212('0xb')]['bind'](this));this['squeue']['on'](_0x3212('0xc'),this[_0x3212('0xd')][_0x3212('0x9')](this));};Agent[_0x3212('0xe')][_0x3212('0x8')]=function(){this[_0x3212('0x6')][_0x3212('0x8')](this[_0x3212('0xf')][_0x3212('0x9')](this),this[_0x3212('0xb')][_0x3212('0x9')](this));};Agent[_0x3212('0xe')][_0x3212('0xd')]=function(){this[_0x3212('0xb')](!![]);};Agent[_0x3212('0xe')][_0x3212('0xf')]=function(){logger[_0x3212('0x10')](_0x3212('0x11'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);if(_[_0x3212('0x12')](this[_0x3212('0x13')]['agents'][this[_0x3212('0x7')]['id']])){logger[_0x3212('0x10')](_0x3212('0x14'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);setTimeout(this[_0x3212('0x8')][_0x3212('0x9')](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util[_0x3212('0x15')](this['squeue']['id'],this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']],this[_0x3212('0x6')][_0x3212('0x17')],![])){this['realtime'][_0x3212('0x16')][this[_0x3212('0x7')]['id']]['busy']=!![];this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']]['busyQueue']=undefined;util['saveWaitingNotification'](this[_0x3212('0x13')],this[_0x3212('0x4')],this[_0x3212('0x7')],this[_0x3212('0x6')][_0x3212('0x17')]);util[_0x3212('0x18')](this['notificationId'],this['squeue']['id'],this[_0x3212('0x13')]['agents'][this[_0x3212('0x7')]['id']],null,this[_0x3212('0x4')]);util[_0x3212('0x19')](this['squeue']['id'],this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']],'RINGING'+(this[_0x3212('0x4')][_0x3212('0x1a')]?_0x3212('0x1b'):''));}else{logger[_0x3212('0x10')](_0x3212('0x1c'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);setTimeout(this[_0x3212('0x8')][_0x3212('0x9')](this),0x3e8);}}};Agent[_0x3212('0xe')][_0x3212('0xb')]=function(_0x3c0b9b){if(_['isNil'](this[_0x3212('0x13')][_0x3212('0x16')][this[_0x3212('0x7')]['id']])){return logger[_0x3212('0x10')](_0x3212('0x14'),this[_0x3212('0x6')]['id'],this[_0x3212('0x7')]['id']);}else{logger['debug'](_0x3212('0x1d'),this['squeue']['id'],this[_0x3212('0x7')]['id']);util['hideNotification'](this[_0x3212('0x5')],this['squeue']['id'],this['realtime'][_0x3212('0x16')][this['agent']['id']],null,this[_0x3212('0x4')]);this[_0x3212('0x13')][_0x3212('0x16')][this['agent']['id']][_0x3212('0x1e')]=![];this[_0x3212('0x13')][_0x3212('0x16')][this['agent']['id']][_0x3212('0x1f')]=undefined;util[_0x3212('0x20')](this[_0x3212('0x13')],this[_0x3212('0x4')],this[_0x3212('0x7')],this['squeue'][_0x3212('0x17')]);util[_0x3212('0x19')](this[_0x3212('0x6')]['id'],this['realtime'][_0x3212('0x16')][this[_0x3212('0x7')]['id']],_0x3c0b9b?_0x3212('0x21'):_0x3212('0x22'));}if(!_0x3c0b9b){setTimeout(this['push'][_0x3212('0x9')](this),0x3e8);}};function agent(_0x3f157c,_0xf5d848,_0x39ffd0,_0x5ae0cc){return new Agent(_0x3f157c,_0xf5d848,_0x39ffd0,_0x5ae0cc);}module['exports']=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 0338a00..b175034 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 _0xe883=['RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','removeWaitingNotification','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','handleRun','bind','handleTimeout','timeout','handleDrained','push','prototype','isNil','Agents','length','realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0xe883,0x18c));var _0x3e88=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe883[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x3e88('0x0'));var uuid=require('uuid');var util=require(_0x3e88('0x1'));var logger=require(_0x3e88('0x2'))(_0x3e88('0x3'));var Beepall=function(_0x578f32,_0x10d423,_0x120590,_0x1bcd3c){this[_0x3e88('0x4')]=uuid['v4']();this[_0x3e88('0x5')]=_0x578f32;this[_0x3e88('0x6')]=_0x10d423;this['realtime']=_0x120590;this[_0x3e88('0x3')]=_0x1bcd3c;this[_0x3e88('0x5')]['push'](this[_0x3e88('0x7')][_0x3e88('0x8')](this),this[_0x3e88('0x9')][_0x3e88('0x8')](this));this[_0x3e88('0x5')]['on'](_0x3e88('0xa'),this[_0x3e88('0x9')][_0x3e88('0x8')](this));this['squeue']['on']('drained',this[_0x3e88('0xb')]['bind'](this));};Beepall['prototype'][_0x3e88('0xc')]=function(){this[_0x3e88('0x5')][_0x3e88('0xc')](this[_0x3e88('0x7')]['bind'](this),this[_0x3e88('0x9')][_0x3e88('0x8')](this));};Beepall[_0x3e88('0xd')][_0x3e88('0xb')]=function(){this['handleTimeout'](!![]);};Beepall[_0x3e88('0xd')][_0x3e88('0x7')]=function(){var _0x28f3b8=!![];if(!_[_0x3e88('0xe')](this[_0x3e88('0x6')])&&!_[_0x3e88('0xe')](this[_0x3e88('0x6')][_0x3e88('0xf')])&&this[_0x3e88('0x6')][_0x3e88('0xf')][_0x3e88('0x10')]>0x0){for(var _0x284855=0x0,_0x3332a7;_0x2848550x0){for(var _0x48f6b4=0x0,_0x4e31a9;_0x48f6b40x0&&_0x51d25c[_0x5e2d17+_0xad1c('0x22')]>=_0x51d25c[_0x5e2d17+_0xad1c('0x20')]){writeLog(_0xa80469,_0x51d25c,_0x5e2d17['toUpperCase']()+_0xad1c('0x23'));return![];}}return!![];};exports['showNotification']=function(_0x3893a3,_0x18bd4c,_0x3f2edc,_0x156d04,_0x5951b2){return sendNotification(!![],_0x3893a3,_0x18bd4c,_0x3f2edc,_0x156d04,_0x5951b2);};exports[_0xad1c('0x24')]=function(_0x996162,_0x44a938,_0x345174,_0x30abaa,_0x5c1203){return sendNotification(![],_0x996162,_0x44a938,_0x345174,_0x30abaa,_0x5c1203);};exports[_0xad1c('0x25')]=function(_0x5518e0,_0x16f56c,_0x2a70f9){var _0x537965=_0x16f56c[_0xad1c('0x26')][_0xad1c('0x27')];if(!_0x537965&&_0x2a70f9){_0x537965=_0x2a70f9['id'];}var _0x474f6f=_['some'](_0x5518e0[_0x16f56c['channel']+_0xad1c('0x28')],function(_0x553367){var _0x34d32c=_['capitalize'](_0x16f56c[_0xad1c('0x29')])+'InteractionId';return _0x553367[_0x34d32c]===_0x16f56c[_0xad1c('0x26')]['id'];});if(!_0x474f6f&&_0x537965&&_0x5518e0[_0xad1c('0x2a')][_0x537965]){_0x474f6f=_[_0xad1c('0x2b')](_0x5518e0[_0xad1c('0x2a')][_0x537965][_0x16f56c[_0xad1c('0x29')]+_0xad1c('0x2c')],function(_0xf5bb38){return _0xf5bb38['id']===_0x16f56c[_0xad1c('0x26')]['id'];});}return _0x474f6f;};exports[_0xad1c('0x2d')]=function(_0x2262dc,_0x4bcd3d,_0x11cf29,_0x39622b){if(_0x11cf29&&_0x11cf29['id']&&_0x2262dc['agents']&&_0x2262dc[_0xad1c('0x2a')][_0x11cf29['id']]){_0x2262dc[_0xad1c('0x2a')][_0x11cf29['id']][_0x39622b+_0xad1c('0x2c')][_0x4bcd3d['message']['id']]={'id':_0x4bcd3d['interaction']['id']};}};exports[_0xad1c('0x2e')]=function(_0x52a6cb,_0x3c411c,_0x2cc3a,_0x2867d5){if(_0x2cc3a&&_0x2cc3a['id']&&_0x52a6cb[_0xad1c('0x2a')]&&_0x52a6cb[_0xad1c('0x2a')][_0x2cc3a['id']]){delete _0x52a6cb['agents'][_0x2cc3a['id']][_0x2867d5+_0xad1c('0x2c')][_0x3c411c[_0xad1c('0x12')]['id']];}};exports[_0xad1c('0x2f')]=writeLog; \ No newline at end of file +var _0xe4d3=['localhost','socket.io-emitter','\x20interaction','name','account','notificationSound','notificationShake','body','queue','msg','format','[%s][QUEUE]\x20%s','user:%s','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','busy','BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','checkWaitingNotifications','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','interaction','agents','WaitingInteractions','saveWaitingNotification','message','removeWaitingNotification','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults'];(function(_0xf7f67b,_0x28fa85){var _0x2f93cd=function(_0x483e1f){while(--_0x483e1f){_0xf7f67b['push'](_0xf7f67b['shift']());}};_0x2f93cd(++_0x28fa85);}(_0xe4d3,0xbc));var _0x3e4d=function(_0x4318e7,_0x338da1){_0x4318e7=_0x4318e7-0x0;var _0xa565e8=_0xe4d3[_0x4318e7];return _0xa565e8;};'use strict';var _=require('lodash');var util=require(_0x3e4d('0x0'));var utils=require(_0x3e4d('0x1'));var Redis=require(_0x3e4d('0x2'));var config=require(_0x3e4d('0x3'));var logger=require(_0x3e4d('0x4'))(_0x3e4d('0x5'));config[_0x3e4d('0x6')]=_[_0x3e4d('0x7')](config['redis'],{'host':_0x3e4d('0x8'),'port':0x18eb});var io=require(_0x3e4d('0x9'))(new Redis(config[_0x3e4d('0x6')]));function sendNotification(_0x55624c,_0x42bece,_0x46d7c6,_0x45829a,_0x4b60fd,_0x820dd8){var _0x1ea05b=_0x820dd8||{};var _0xaf958b=_0x46d7c6['split']('.');var _0x1e5647={'uniqueid':_0x42bece,'channel':_0xaf958b[0x0],'id':_0xaf958b[0x1],'title':_0xaf958b[0x0]+_0x3e4d('0xa'),'interactionId':_0xaf958b[0x2],'queue':_0x4b60fd?_0x4b60fd[_0x3e4d('0xb')]:null,'sound':_0x1ea05b[_0x3e4d('0xc')][_0x3e4d('0xd')],'shake':_0x1ea05b[_0x3e4d('0xc')][_0x3e4d('0xe')]};try{if(!_0x1ea05b[_0x3e4d('0xf')]){_0x1ea05b[_0x3e4d('0xf')]={};}if(_0x4b60fd){_0x1ea05b[_0x3e4d('0xf')][_0x3e4d('0x10')]=_0x4b60fd;}else if(_0x1ea05b[_0x3e4d('0xf')][_0x3e4d('0x10')]){delete _0x1ea05b['body'][_0x3e4d('0x10')];}_0x1e5647[_0x3e4d('0x11')]=utils['getMustacheRender'](_0x1ea05b['account']['notificationTemplate'],_0x1ea05b);}catch(_0x38bd52){_0x1e5647[_0x3e4d('0x11')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x3e4d('0x12')](_0x3e4d('0x13'),_0x42bece,_0x38bd52['message']));}io['to'](util[_0x3e4d('0x12')](_0x3e4d('0x14'),_0x45829a[_0x3e4d('0xb')]))['emit'](util[_0x3e4d('0x12')](_0x3e4d('0x15'),_0x55624c?_0x3e4d('0x16'):_0x3e4d('0x17')),_0x1e5647);}function writeLog(_0x482221,_0x4b5135,_0x49816a){return logger[_0x3e4d('0x18')](util[_0x3e4d('0x12')](_0x3e4d('0x19'),_0x482221,_0x4b5135[_0x3e4d('0xb')],_0x49816a));}exports['isAgentAvailable']=function(_0x50eb69,_0xd1deac,_0x2d8e20,_0x350cb6){if(_0xd1deac[_0x3e4d('0x1a')]){writeLog(_0x50eb69,_0xd1deac,_0x3e4d('0x1b'));return![];}if(!_0xd1deac[_0x3e4d('0x1c')]){writeLog(_0x50eb69,_0xd1deac,_0x3e4d('0x1d'));return![];}if(_0xd1deac[_0x2d8e20+'Pause']){writeLog(_0x50eb69,_0xd1deac,_0x3e4d('0x1e'));return![];}if(_0x350cb6&&_0xd1deac[_0x3e4d('0x1f')](_0x2d8e20+_0x3e4d('0x20'))&&_0xd1deac[_0x3e4d('0x1f')](_0x2d8e20+_0x3e4d('0x21'))){if(_0xd1deac[_0x2d8e20+_0x3e4d('0x20')]>0x0&&_0xd1deac[_0x2d8e20+_0x3e4d('0x21')]>=_0xd1deac[_0x2d8e20+_0x3e4d('0x20')]){writeLog(_0x50eb69,_0xd1deac,_0x2d8e20[_0x3e4d('0x22')]()+_0x3e4d('0x23'));return![];}}return!![];};exports['showNotification']=function(_0xca562d,_0xb7a5a1,_0x10ee62,_0x15dec3,_0x2fe863){return sendNotification(!![],_0xca562d,_0xb7a5a1,_0x10ee62,_0x15dec3,_0x2fe863);};exports[_0x3e4d('0x24')]=function(_0x2e999b,_0xd65dd9,_0x582d89,_0x2973ed,_0x440e79){return sendNotification(![],_0x2e999b,_0xd65dd9,_0x582d89,_0x2973ed,_0x440e79);};exports[_0x3e4d('0x25')]=function(_0x3b25ab,_0x4d5e39,_0x388834){var _0x86d99e=_0x4d5e39['interaction'][_0x3e4d('0x26')];if(!_0x86d99e&&_0x388834){_0x86d99e=_0x388834['id'];}var _0x7338fd=_['some'](_0x3b25ab[_0x4d5e39[_0x3e4d('0x27')]+_0x3e4d('0x28')],function(_0x3bd00a){var _0x5d711a=_[_0x3e4d('0x29')](_0x4d5e39[_0x3e4d('0x27')])+_0x3e4d('0x2a');return _0x3bd00a[_0x5d711a]===_0x4d5e39[_0x3e4d('0x2b')]['id'];});if(!_0x7338fd&&_0x86d99e&&_0x3b25ab[_0x3e4d('0x2c')][_0x86d99e]){_0x7338fd=_['some'](_0x3b25ab[_0x3e4d('0x2c')][_0x86d99e][_0x4d5e39['channel']+_0x3e4d('0x2d')],function(_0x478e8e){return _0x478e8e['id']===_0x4d5e39[_0x3e4d('0x2b')]['id'];});}return _0x7338fd;};exports[_0x3e4d('0x2e')]=function(_0x49c16d,_0x5d7525,_0x32ccea,_0x2ef1bd){if(_0x32ccea&&_0x32ccea['id']&&_0x49c16d[_0x3e4d('0x2c')]&&_0x49c16d[_0x3e4d('0x2c')][_0x32ccea['id']]){_0x49c16d[_0x3e4d('0x2c')][_0x32ccea['id']][_0x2ef1bd+'WaitingInteractions'][_0x5d7525[_0x3e4d('0x2f')]['id']]={'id':_0x5d7525[_0x3e4d('0x2b')]['id']};}};exports[_0x3e4d('0x30')]=function(_0x453381,_0xca3ed9,_0x49b47c,_0xde401){if(_0x49b47c&&_0x49b47c['id']&&_0x453381[_0x3e4d('0x2c')]&&_0x453381[_0x3e4d('0x2c')][_0x49b47c['id']]){delete _0x453381['agents'][_0x49b47c['id']][_0xde401+_0x3e4d('0x2d')][_0xca3ed9[_0x3e4d('0x2f')]['id']];}};exports['writeLog']=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 d1caedb..36574a2 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 _0xa921=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','map','join'];(function(_0x16da72,_0x5430f0){var _0x3972bf=function(_0x4d8a14){while(--_0x4d8a14){_0x16da72['push'](_0x16da72['shift']());}};_0x3972bf(++_0x5430f0);}(_0xa921,0x181));var _0x1a92=function(_0x8e1f5f,_0x4212b0){_0x8e1f5f=_0x8e1f5f-0x0;var _0x220547=_0xa921[_0x8e1f5f];return _0x220547;};'use strict';var schema=require(_0x1a92('0x0'));var sh=require('shelljs');var _=require(_0x1a92('0x1'));var utils=require(_0x1a92('0x2'));var logger=require(_0x1a92('0x3'))(_0x1a92('0x4'));var system=schema({'command':{'type':_0x1a92('0x5'),'required':!![],'message':_0x1a92('0x6')}});exports[_0x1a92('0x7')]=function(_0x9ff29b,_0x506c34){return function(_0x3731f7){try{var _0x5bc85d={'command':_0x506c34[0x0]};var _0x47b1fe=system[_0x1a92('0x0')](_0x5bc85d,{'typecast':!![]});if(_0x47b1fe['length']){logger['error'](_0x1a92('0x8'),_0x9ff29b,_[_0x1a92('0x9')](_0x47b1fe,'message')[_0x1a92('0xa')](',\x20'));logger[_0x1a92('0xb')](_0x1a92('0xc'),_0x9ff29b);_0x3731f7[_0x1a92('0xd')]();}else{var _0x1b3033=this;var _0x45f691=utils['getMustacheRender'](_0x506c34[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x9ff29b,_0x45f691);sh[_0x1a92('0xe')](_[_0x1a92('0xf')](_0x45f691),function(_0x5bb017,_0x5e79e9){logger[_0x1a92('0xb')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x9ff29b,_0x5bb017);if(_0x5bb017==0x0){var _0x4ff87e=_0x5e79e9['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x1a92('0x10')](_0x506c34[0x1])||_[_0x1a92('0x11')](_0x506c34[0x1])){logger[_0x1a92('0xb')](_0x1a92('0x12'),_0x9ff29b);_0x1b3033[_0x1a92('0x13')][_0x506c34[0x1]]=_0x4ff87e;}else{logger[_0x1a92('0xb')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x9ff29b,_0x506c34[0x1],_0x4ff87e);_0x1b3033[_0x1a92('0x13')][_0x506c34[0x1]]=_0x4ff87e;}}_0x3731f7[_0x1a92('0xd')]();});}}catch(_0x461968){logger[_0x1a92('0x14')](_0x1a92('0x8'),_0x9ff29b,_['isObject'](_0x461968)?JSON[_0x1a92('0x15')](_0x461968):_0x461968);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x9ff29b);_0x3731f7[_0x1a92('0xd')]();}};}; \ No newline at end of file +var _0x16e4=['routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','info','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','validate','shelljs','lodash','./utils','../../../../config/logger'];(function(_0x5953d3,_0xebf3f3){var _0x3a4d54=function(_0x13f7a4){while(--_0x13f7a4){_0x5953d3['push'](_0x5953d3['shift']());}};_0x3a4d54(++_0xebf3f3);}(_0x16e4,0x97));var _0x416e=function(_0x36cc67,_0x162f4f){_0x36cc67=_0x36cc67-0x0;var _0x3915e5=_0x16e4[_0x36cc67];return _0x3915e5;};'use strict';var schema=require(_0x416e('0x0'));var sh=require(_0x416e('0x1'));var _=require(_0x416e('0x2'));var utils=require(_0x416e('0x3'));var logger=require(_0x416e('0x4'))(_0x416e('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x416e('0x6')}});exports['consequence']=function(_0x344e7b,_0x30af74){return function(_0x5cd6b1){try{var _0x1dad5d={'command':_0x30af74[0x0]};var _0x2f7484=system[_0x416e('0x0')](_0x1dad5d,{'typecast':!![]});if(_0x2f7484[_0x416e('0x7')]){logger[_0x416e('0x8')](_0x416e('0x9'),_0x344e7b,_[_0x416e('0xa')](_0x2f7484,_0x416e('0xb'))[_0x416e('0xc')](',\x20'));logger['info'](_0x416e('0xd'),_0x344e7b);_0x5cd6b1['next']();}else{var _0x286d17=this;var _0x14bbf6=utils[_0x416e('0xe')](_0x30af74[0x0],this);logger['info'](_0x416e('0xf'),_0x344e7b,_0x14bbf6);sh[_0x416e('0x10')](_[_0x416e('0x11')](_0x14bbf6),function(_0x5ca749,_0x27cf66){logger['info'](_0x416e('0x12'),_0x344e7b,_0x5ca749);if(_0x5ca749==0x0){var _0x2ec3e8=_0x27cf66[_0x416e('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x416e('0x14')](_0x30af74[0x1])||_['isEmpty'](_0x30af74[0x1])){logger[_0x416e('0x15')](_0x416e('0x16'),_0x344e7b);_0x286d17[_0x416e('0x17')][_0x30af74[0x1]]=_0x2ec3e8;}else{logger[_0x416e('0x15')](_0x416e('0x18'),_0x344e7b,_0x30af74[0x1],_0x2ec3e8);_0x286d17[_0x416e('0x17')][_0x30af74[0x1]]=_0x2ec3e8;}}_0x5cd6b1[_0x416e('0x19')]();});}}catch(_0x162420){logger[_0x416e('0x8')]('[%s][SYSTEM]\x20%s',_0x344e7b,_['isObject'](_0x162420)?JSON['stringify'](_0x162420):_0x162420);logger[_0x416e('0x15')](_0x416e('0xd'),_0x344e7b);_0x5cd6b1[_0x416e('0x19')]();}};}; \ 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 6fa064f..26fd342 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 _0xfb00=['interaction','catch','error','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','stringify','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x5ac3dc,_0x13e2ea){var _0x3b745a=function(_0x3a49fb){while(--_0x3a49fb){_0x5ac3dc['push'](_0x5ac3dc['shift']());}};_0x3b745a(++_0x13e2ea);}(_0xfb00,0xe0));var _0x0fb0=function(_0x368726,_0x4a651d){_0x368726=_0x368726-0x0;var _0x3fc2e7=_0xfb00[_0x368726];return _0x3fc2e7;};'use strict';var schema=require(_0x0fb0('0x0'));var _=require(_0x0fb0('0x1'));var rpc={'chatInteraction':require(_0x0fb0('0x2')),'openchannelInteraction':require(_0x0fb0('0x3')),'smsInteraction':require(_0x0fb0('0x4')),'mailInteraction':require(_0x0fb0('0x5')),'faxInteraction':require(_0x0fb0('0x6')),'whatsappInteraction':require(_0x0fb0('0x7'))};var logger=require(_0x0fb0('0x8'))(_0x0fb0('0x9'));var tag=schema({'tag':{'type':_0x0fb0('0xa'),'required':!![],'message':_0x0fb0('0xb')}});exports[_0x0fb0('0xc')]=function(_0x23273d,_0x235fad,_0x2c113a,_0x397363){return function(_0x47635d){try{var _0x13df4a={'tag':_0x235fad[0x0]};var _0x397357=tag['validate'](_0x13df4a,{'typecast':!![]});if(_0x397357[_0x0fb0('0xd')]){logger['error'](_0x0fb0('0xe'),_0x23273d,_[_0x0fb0('0xf')](_0x397357,_0x0fb0('0x10'))[_0x0fb0('0x11')](',\x20'));logger[_0x0fb0('0x12')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x23273d);_0x47635d[_0x0fb0('0x13')]();}else{var _0x2d0ee2={'ids':[_0x235fad[0x0]]};if(rpc[_0x397363[_0x0fb0('0x14')]+_0x0fb0('0x15')]){rpc[_0x397363[_0x0fb0('0x14')]+'Interaction']['addTags'](_0x397363['interaction']['id'],_0x2d0ee2)[_0x0fb0('0x16')](function(_0x574ad6){logger[_0x0fb0('0x12')](_0x0fb0('0x17'),_0x23273d,_0x235fad[0x1],_0x397363['channel'],_0x397363[_0x0fb0('0x18')]['id']);})[_0x0fb0('0x19')](function(_0x13a23c){logger[_0x0fb0('0x1a')](_0x0fb0('0xe'),_0x23273d,JSON['stringify'](_0x13a23c));logger[_0x0fb0('0x12')](_0x0fb0('0x1b'),_0x23273d);})[_0x0fb0('0x1c')](function(){_0x47635d[_0x0fb0('0x13')]();});}}}catch(_0x2e219b){logger[_0x0fb0('0x1a')](_0x0fb0('0xe'),_0x23273d,_[_0x0fb0('0x1d')](_0x2e219b)?JSON[_0x0fb0('0x1e')](_0x2e219b):_0x2e219b);logger[_0x0fb0('0x12')](_0x0fb0('0x1b'),_0x23273d);_0x47635d[_0x0fb0('0x13')]();}};}; \ No newline at end of file +var _0x8aa4=['then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','finally','next','isObject','stringify','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','addTags','interaction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8aa4,0x18c));var _0x48aa=function(_0x195871,_0x4a0f1e){_0x195871=_0x195871-0x0;var _0x57a24c=_0x8aa4[_0x195871];return _0x57a24c;};'use strict';var schema=require(_0x48aa('0x0'));var _=require(_0x48aa('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x48aa('0x2')),'smsInteraction':require(_0x48aa('0x3')),'mailInteraction':require(_0x48aa('0x4')),'faxInteraction':require(_0x48aa('0x5')),'whatsappInteraction':require(_0x48aa('0x6'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x48aa('0x7'),'required':!![],'message':_0x48aa('0x8')}});exports[_0x48aa('0x9')]=function(_0x13dedb,_0x43bff9,_0x5a2156,_0xdfcca4){return function(_0x1095ad){try{var _0x2cd8b4={'tag':_0x43bff9[0x0]};var _0x4a7c38=tag['validate'](_0x2cd8b4,{'typecast':!![]});if(_0x4a7c38[_0x48aa('0xa')]){logger[_0x48aa('0xb')](_0x48aa('0xc'),_0x13dedb,_['map'](_0x4a7c38,'message')[_0x48aa('0xd')](',\x20'));logger[_0x48aa('0xe')](_0x48aa('0xf'),_0x13dedb);_0x1095ad['next']();}else{var _0x2d5c6f={'ids':[_0x43bff9[0x0]]};if(rpc[_0xdfcca4['channel']+_0x48aa('0x10')]){rpc[_0xdfcca4[_0x48aa('0x11')]+_0x48aa('0x10')][_0x48aa('0x12')](_0xdfcca4[_0x48aa('0x13')]['id'],_0x2d5c6f)[_0x48aa('0x14')](function(_0x59ee33){logger[_0x48aa('0xe')](_0x48aa('0x15'),_0x13dedb,_0x43bff9[0x1],_0xdfcca4[_0x48aa('0x11')],_0xdfcca4[_0x48aa('0x13')]['id']);})['catch'](function(_0x5c2609){logger['error'](_0x48aa('0xc'),_0x13dedb,JSON['stringify'](_0x5c2609));logger['info'](_0x48aa('0xf'),_0x13dedb);})[_0x48aa('0x16')](function(){_0x1095ad[_0x48aa('0x17')]();});}}}catch(_0x44a260){logger[_0x48aa('0xb')](_0x48aa('0xc'),_0x13dedb,_[_0x48aa('0x18')](_0x44a260)?JSON[_0x48aa('0x19')](_0x44a260):_0x44a260);logger[_0x48aa('0xe')](_0x48aa('0xf'),_0x13dedb);_0x1095ad['next']();}};}; \ 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 c3f9a90..a6336dc 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 _0x1200=['stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','utf8','POST','application/json-rpc','parse','result','logged','channelId=','&sessionId=','&data=','stringify','then','info','error','[%s][TVOX]\x20%s','isObject'];(function(_0x18f648,_0x1fbcf9){var _0x363e5f=function(_0x3b62c5){while(--_0x3b62c5){_0x18f648['push'](_0x18f648['shift']());}};_0x363e5f(++_0x1fbcf9);}(_0x1200,0x113));var _0x0120=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x1200[_0x27bcf5];return _0x4ce4cf;};'use strict';var rp=require(_0x0120('0x0'));var logger=require(_0x0120('0x1'))(_0x0120('0x2'));var _=require(_0x0120('0x3'));var arr=[];exports[_0x0120('0x4')]=function(_0x5376a9,_0x321ced){return function(_0x2d8357){var _0x4d0fdc=_0x321ced[0xa];var _0x47748f=_0x321ced[0xb];var _0x259372=_0x321ced[0xc];var _0x3f69df=_0x321ced[0xd];var _0x1a7c78=_0x321ced[0xe];var _0x4c3688=_0x321ced[0xf][_0x0120('0x5')](/\n/g,_0x0120('0x6'));var _0x2aacfe=_0x321ced[0x10][_0x0120('0x5')](/\n/g,'\x20');if(!arr['includes'](_0x47748f)){arr[_0x0120('0x7')](_0x47748f);var _0x5f2554=_0x321ced[0x3];var _0x5865a7=_0x321ced[0x4];var _0xbc6117=_0x321ced[0x1];var _0x3bab19=_0x321ced[0x0];var _0x50c4db={};_0x50c4db[_0x0120('0x8')]=_0x321ced[0x8]+_0x0120('0x9')+_0x259372+'|'+_0x4d0fdc+'|'+_0x3f69df+'|'+_0x47748f+'|'+_0x1a7c78;_0x50c4db[_0x0120('0xa')]=_0x321ced[0x7]+'?params='+_0x259372+'|'+_0x4d0fdc+'|'+_0x3f69df+'|'+_0x47748f+'|'+_0x1a7c78+'|'+_0x4c3688+'|'+_0x2aacfe;_0x50c4db[_0x0120('0xb')]=_0x321ced[0x9];var _0x5cbc23={};_0x5cbc23[_0x0120('0xc')]=_0x0120('0xd');_0x5cbc23[_0x0120('0xe')]=_0x0120('0xf');var _0x5c09bb=[];_0x5c09bb[_0x0120('0x7')](_0x321ced[0x2]);_0x5c09bb['push'](_0x321ced[0x5]);_0x5c09bb[_0x0120('0x7')](_0x321ced[0x6]);_0x5cbc23['params']=_0x5c09bb;_0x5cbc23['id']=0x1;var _0x4c35b9=JSON['stringify'](_0x5cbc23);var _0x8d5ecc={'encoding':_0x0120('0x10'),'method':_0x0120('0x11'),'timeout':0x2710,'url':_0x5f2554,'headers':{'Content-Type':_0x0120('0x12')},'body':_0x4c35b9};return rp(_0x8d5ecc)['then'](function(_0xce8d85){const _0x17f0bc=JSON[_0x0120('0x13')](_0xce8d85);if(!_0x17f0bc[_0x0120('0x14')][_0x0120('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x1902e7=_0x47748f;var _0x330ac7=_0x0120('0x16')+_0xbc6117+'&serviceId='+_0x3bab19+_0x0120('0x17')+_0x1902e7+_0x0120('0x18')+JSON[_0x0120('0x19')](_0x50c4db);var _0x54014f=_0x5865a7+'?'+_0x330ac7;return rp(_0x54014f);})[_0x0120('0x1a')](function(_0x44397a){logger[_0x0120('0x1b')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5376a9,_0x44397a);_0x2d8357['stop']();})['catch'](function(_0x1d3307){logger[_0x0120('0x1c')](_0x0120('0x1d'),_0x5376a9,_[_0x0120('0x1e')](_0x1d3307)?JSON[_0x0120('0x19')](_0x1d3307):_0x1d3307);_0x2d8357[_0x0120('0x1f')]();});}else{logger[_0x0120('0x1b')](_0x0120('0x20'),_0x5376a9);_0x2d8357[_0x0120('0x21')]();}};}; \ No newline at end of file +var _0x634e=['includes','urlOnRing','?params=','title','jsonrpc','2.0','login','push','params','stringify','utf8','POST','application/json-rpc','then','parse','result','logged','channelId=','&sessionId=','&data=','stop','error','isObject','info','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20'];(function(_0x25fcde,_0x17d750){var _0xec49d0=function(_0x2e0689){while(--_0x2e0689){_0x25fcde['push'](_0x25fcde['shift']());}};_0xec49d0(++_0x17d750);}(_0x634e,0x119));var _0xe634=function(_0x40bc32,_0x428c83){_0x40bc32=_0x40bc32-0x0;var _0x2351e3=_0x634e[_0x40bc32];return _0x2351e3;};'use strict';var rp=require(_0xe634('0x0'));var logger=require(_0xe634('0x1'))(_0xe634('0x2'));var _=require(_0xe634('0x3'));var arr=[];exports[_0xe634('0x4')]=function(_0x549547,_0x1449e6){return function(_0x3b42b6){var _0x257585=_0x1449e6[0xa];var _0xb5494=_0x1449e6[0xb];var _0x1c5f47=_0x1449e6[0xc];var _0x350217=_0x1449e6[0xd];var _0x4da827=_0x1449e6[0xe];var _0x2a39c3=_0x1449e6[0xf][_0xe634('0x5')](/\n/g,_0xe634('0x6'));var _0x19daf8=_0x1449e6[0x10][_0xe634('0x5')](/\n/g,'\x20');if(!arr[_0xe634('0x7')](_0xb5494)){arr['push'](_0xb5494);var _0x514bb5=_0x1449e6[0x3];var _0x377ddb=_0x1449e6[0x4];var _0x38bb37=_0x1449e6[0x1];var _0x1a24d3=_0x1449e6[0x0];var _0x1b39eb={};_0x1b39eb['urlOnAnswer']=_0x1449e6[0x8]+'?params='+_0x1c5f47+'|'+_0x257585+'|'+_0x350217+'|'+_0xb5494+'|'+_0x4da827;_0x1b39eb[_0xe634('0x8')]=_0x1449e6[0x7]+_0xe634('0x9')+_0x1c5f47+'|'+_0x257585+'|'+_0x350217+'|'+_0xb5494+'|'+_0x4da827+'|'+_0x2a39c3+'|'+_0x19daf8;_0x1b39eb[_0xe634('0xa')]=_0x1449e6[0x9];var _0x1c9120={};_0x1c9120[_0xe634('0xb')]=_0xe634('0xc');_0x1c9120['method']=_0xe634('0xd');var _0x15d57b=[];_0x15d57b['push'](_0x1449e6[0x2]);_0x15d57b[_0xe634('0xe')](_0x1449e6[0x5]);_0x15d57b['push'](_0x1449e6[0x6]);_0x1c9120[_0xe634('0xf')]=_0x15d57b;_0x1c9120['id']=0x1;var _0x595aba=JSON[_0xe634('0x10')](_0x1c9120);var _0x4ce3cb={'encoding':_0xe634('0x11'),'method':_0xe634('0x12'),'timeout':0x2710,'url':_0x514bb5,'headers':{'Content-Type':_0xe634('0x13')},'body':_0x595aba};return rp(_0x4ce3cb)[_0xe634('0x14')](function(_0x97e640){const _0x3ad05f=JSON[_0xe634('0x15')](_0x97e640);if(!_0x3ad05f[_0xe634('0x16')][_0xe634('0x17')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x4f72fa=_0xb5494;var _0x405d92=_0xe634('0x18')+_0x38bb37+'&serviceId='+_0x1a24d3+_0xe634('0x19')+_0x4f72fa+_0xe634('0x1a')+JSON[_0xe634('0x10')](_0x1b39eb);var _0xfabc5a=_0x377ddb+'?'+_0x405d92;return rp(_0xfabc5a);})[_0xe634('0x14')](function(_0x362d1b){logger['info']('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x549547,_0x362d1b);_0x3b42b6[_0xe634('0x1b')]();})['catch'](function(_0x3991e2){logger[_0xe634('0x1c')]('[%s][TVOX]\x20%s',_0x549547,_[_0xe634('0x1d')](_0x3991e2)?JSON[_0xe634('0x10')](_0x3991e2):_0x3991e2);_0x3b42b6[_0xe634('0x1b')]();});}else{logger[_0xe634('0x1e')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x549547);_0x3b42b6[_0xe634('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 8ac395d..74dc912 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3802ea,_0x6bca28){var _0xa0dcbb=function(_0xd7ee23){while(--_0xd7ee23){_0x3802ea['push'](_0x3802ea['shift']());}};_0xa0dcbb(++_0x6bca28);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x2347d6,_0x13c20e){var _0x213fd7=function(_0x4dfeaf){while(--_0x4dfeaf){_0x2347d6['push'](_0x2347d6['shift']());}};_0x213fd7(++_0x13c20e);}(_0xe706,0xa3));var _0x6e70=function(_0x20713e,_0x44f710){_0x20713e=_0x20713e-0x0;var _0x7d998b=_0xe706[_0x20713e];return _0x7d998b;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 48dccfb..069b7c3 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 _0xa329=['body','condition','intervals','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agents','agent','busy','busyQueue','channel','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','waiting','mailQueues','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','./applications/utils','./applications/strategy/util','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','Intervals','interval','listen','message','interaction','checkWaitingNotifications','isArray','applications','length','join','app','.js','appdata','split','push','dialogflow','slice','amazonlex','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId'];(function(_0x4b8ecc,_0x4cd01c){var _0x48c1b9=function(_0x308aa3){while(--_0x308aa3){_0x4b8ecc['push'](_0x4b8ecc['shift']());}};_0x48c1b9(++_0x4cd01c);}(_0xa329,0x162));var _0x9a32=function(_0xaa376a,_0x492654){_0xaa376a=_0xaa376a-0x0;var _0x950d8b=_0xa329[_0xaa376a];return _0x950d8b;};'use strict';var _=require(_0x9a32('0x0'));var util=require(_0x9a32('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x9a32('0x2'));var BPromise=require('bluebird');var utils=require(_0x9a32('0x3'));var sUtils=require(_0x9a32('0x4'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x9a32('0x5')),'mailQueueReport':require(_0x9a32('0x6')),'chatQueueReport':require(_0x9a32('0x7')),'smsQueueReport':require(_0x9a32('0x8')),'faxQueueReport':require(_0x9a32('0x9')),'whatsappQueueReport':require(_0x9a32('0xa'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x5b8b5e,_0x4dc7f8,_0x344b35){return util[_0x9a32('0xb')]('%s.%s.%s',_0x5b8b5e,_0x4dc7f8||0x0,_0x344b35||0x0);}function getIntervals(_0x38f6cc,_0x184a41){var _0x231d97=[];if(!_[_0x9a32('0xc')](_0x184a41[_0x9a32('0xd')])&&!_[_0x9a32('0xc')](_0x38f6cc[_0x184a41['IntervalId']])&&!_[_0x9a32('0xc')](_0x38f6cc[_0x184a41[_0x9a32('0xd')]]['Intervals'])){_0x231d97=_['map'](_0x38f6cc[_0x184a41[_0x9a32('0xd')]][_0x9a32('0xe')],'interval');}else if(!_['isNil'](_0x184a41[_0x9a32('0xf')])){_0x231d97=[_0x184a41[_0x9a32('0xf')]];}return _0x231d97;}exports[_0x9a32('0x10')]=function(_0x897c93){_0x897c93['rules']={};return new BPromise(function(_0x224747,_0x37ab43){var _0x5d35ed={'Start':function(_0x1f8314){var _0x96a800=this;return new Promise(function(_0x301fab,_0x448fd6){if(_0x1f8314){try{var _0x20ae14=[];var _0x1dbf9d=getId(_0x1f8314['channel'],_0x1f8314[_0x9a32('0x11')]?_0x1f8314[_0x9a32('0x11')]['id']:0x0,_0x1f8314[_0x9a32('0x12')]?_0x1f8314['interaction']['id']:0x0);var _0x3606ab=sUtils[_0x9a32('0x13')](_0x897c93,_0x1f8314);if(_0x1f8314['transfer']||!_0x3606ab&&_0x1f8314['applications']&&_[_0x9a32('0x14')](_0x1f8314[_0x9a32('0x15')])&&_0x1f8314[_0x9a32('0x15')][_0x9a32('0x16')]){for(var _0x112e95=0x0;_0x112e95<_0x1f8314['applications'][_0x9a32('0x16')];_0x112e95+=0x1){var _0xd3f35f=_0x1f8314[_0x9a32('0x15')][_0x112e95];if(fs['existsSync'](path[_0x9a32('0x17')](__dirname,_0x9a32('0x15'),_0xd3f35f[_0x9a32('0x18')]+_0x9a32('0x19')))){var _0x3b3e66=[];switch(_0xd3f35f[_0x9a32('0x18')]['toLowerCase']()){case'autoreply':var _0x44b3b4=_0xd3f35f[_0x9a32('0x1a')][_0x9a32('0x1b')](',');if(_0x1f8314['channel']==='mail'){_0x3b3e66[_0x9a32('0x1c')](_0x44b3b4[0x0]);_0x3b3e66[_0x9a32('0x1c')](_0x44b3b4[0x1]);_0x3b3e66[_0x9a32('0x1c')](_0x44b3b4['slice'](0x2,_0x44b3b4['length'])['join'](','));}else{_0x3b3e66[_0x9a32('0x1c')](_0x44b3b4[0x0]);_0x3b3e66['push'](_0x44b3b4['slice'](0x1,_0x44b3b4['length'])[_0x9a32('0x17')](','));}break;case _0x9a32('0x1d'):var _0x10edcf=_0xd3f35f[_0x9a32('0x1a')][_0x9a32('0x1b')](',');_0x3b3e66[_0x9a32('0x1c')](_0x10edcf[0x0]);_0x3b3e66[_0x9a32('0x1c')](_0x10edcf[0x1]);_0x3b3e66[_0x9a32('0x1c')](_0x10edcf[_0x9a32('0x1e')](0x2,_0x10edcf[_0x9a32('0x16')])[_0x9a32('0x17')](','));break;case'dialogflowv2':var _0x1acb00=_0xd3f35f[_0x9a32('0x1a')]['split'](',');_0x3b3e66[_0x9a32('0x1c')](_0x1acb00[0x0]);_0x3b3e66['push'](_0x1acb00[0x1]);_0x3b3e66[_0x9a32('0x1c')](_0x1acb00[0x2]);_0x3b3e66[_0x9a32('0x1c')](_0x1acb00[0x3]);_0x3b3e66[_0x9a32('0x1c')](_0x1acb00[_0x9a32('0x1e')](0x4,_0x1acb00[_0x9a32('0x16')])['join'](','));break;case _0x9a32('0x1f'):var _0x432508=_0xd3f35f[_0x9a32('0x1a')][_0x9a32('0x1b')](',');_0x3b3e66[_0x9a32('0x1c')](_0x432508[0x0]);_0x3b3e66[_0x9a32('0x1c')](_0x432508[0x1]);_0x3b3e66['push'](_0x432508[0x2]);_0x3b3e66[_0x9a32('0x1c')](_0x432508[0x3]);_0x3b3e66[_0x9a32('0x1c')](_0x432508[_0x9a32('0x1e')](0x4,_0x432508[_0x9a32('0x16')])[_0x9a32('0x17')](','));break;case'message':_0x3b3e66[_0x9a32('0x1c')](_0xd3f35f['appdata']);break;case _0x9a32('0x20'):_0x3b3e66['push'](_0xd3f35f['TagId']);_0x3b3e66['push'](_0xd3f35f['appdata']);break;case _0x9a32('0x21'):var _0xabb8cf=utils['getMustacheRender'](_0x1f8314[_0x9a32('0x22')][_0x9a32('0x23')],_0x1f8314);var _0xd1337e=_0xd3f35f[_0x9a32('0x1a')][_0x9a32('0x1b')](',');_0x3b3e66['push'](_0xd1337e[0x0]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x1]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x2]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x3]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x4]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x5]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x6]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x7]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x8]);_0x3b3e66[_0x9a32('0x1c')](_0xd1337e[0x9]);_0x3b3e66['push'](_0xd1337e[0xa]);_0x3b3e66[_0x9a32('0x1c')](_0x1f8314['interaction']['id']);_0x3b3e66[_0x9a32('0x1c')](_0x1f8314[_0x9a32('0x11')]['id']);_0x3b3e66[_0x9a32('0x1c')](_0xd3f35f[_0x9a32('0x24')]);_0x3b3e66[_0x9a32('0x1c')](_0x1f8314[_0x9a32('0x12')][_0x9a32('0x25')]);_0x3b3e66[_0x9a32('0x1c')](_0x1f8314[_0x9a32('0x26')][_0x9a32('0x26')]);_0x3b3e66[_0x9a32('0x1c')](_0xabb8cf);break;default:_0x3b3e66=_[_0x9a32('0xc')](_0xd3f35f['appdata'])?[]:_0xd3f35f[_0x9a32('0x1a')]['split'](',');}var _0x120288={'id':util[_0x9a32('0xb')]('%s:%s:%s',_0x1dbf9d,_0xd3f35f['id'],_0xd3f35f['app']),'condition':require('./interval')[_0x9a32('0x27')](_0x1dbf9d,getIntervals(_0x897c93[_0x9a32('0x28')],_0xd3f35f),_0x897c93),'consequence':require('./applications/'+_0xd3f35f[_0x9a32('0x18')])['consequence'](_0x1dbf9d,_0x3b3e66,_0x897c93,_0x1f8314),'p':_0xd3f35f[_0x9a32('0x29')]||0x0};logger[_0x9a32('0x2a')](_0x9a32('0x2b'),_0x120288['id'],_0x9a32('0x2c'),getIntervals(_0x897c93[_0x9a32('0x28')],_0xd3f35f)[_0x9a32('0x17')](_0x9a32('0x2d')));_0x20ae14['push'](_0x120288);}else{logger[_0x9a32('0x2e')](_0x9a32('0x2f'),path[_0x9a32('0x17')](__dirname,'applications',_0xd3f35f[_0x9a32('0x18')]+'.js'));}}_0x897c93[_0x9a32('0x30')][_0x1dbf9d]=new RuleEngine(_0x20ae14);_0x897c93[_0x9a32('0x30')][_0x1dbf9d][_0x9a32('0x31')](_0x1f8314,function(_0x47e362){logger[_0x9a32('0x2a')](_0x9a32('0x32'),JSON[_0x9a32('0x33')](_0x47e362[_0x9a32('0x34')]));if(_0x897c93[_0x9a32('0x30')][_0x1dbf9d]){_0x897c93[_0x9a32('0x30')][_0x1dbf9d][_0x9a32('0x35')](_0x9a32('0x36'));}});return _0x301fab({'code':0xc8,'message':_0x1f8314});}else{if(_0x3606ab){logger['info'](util[_0x9a32('0xb')]('Skipped\x20routing\x20for\x20%s',_0x1dbf9d));}else{logger[_0x9a32('0x2a')](_0x9a32('0x37'));}return _0x301fab({'code':0xc8,'message':_0x1f8314});}}catch(_0xc8bb34){logger[_0x9a32('0x2e')](_0xc8bb34[_0x9a32('0x38')]);return _0x448fd6(_0x96a800[_0x9a32('0x2e')](0x1f4,_0xc8bb34));}}return _0x448fd6(_0x9a32('0x39'));});},'AcceptMessage':function(_0x30cc3f){var _0x2a71e6=this;return new Promise(function(_0x3069be,_0x35b7e3){if(_0x30cc3f['agent']&&_0x30cc3f['agent']['id']){if(_0x897c93[_0x9a32('0x3a')][_0x30cc3f['agent']['id']]){_0x897c93[_0x9a32('0x3a')][_0x30cc3f[_0x9a32('0x3b')]['id']][_0x9a32('0x3c')]=![];_0x897c93[_0x9a32('0x3a')][_0x30cc3f['agent']['id']][_0x9a32('0x3d')]=undefined;}}if(_0x30cc3f[_0x9a32('0x11')]&&_0x30cc3f[_0x9a32('0x11')]['id']){try{var _0x1f5987=getId(_0x30cc3f[_0x9a32('0x3e')],_0x30cc3f[_0x9a32('0x11')]?_0x30cc3f[_0x9a32('0x11')]['id']:0x0,_0x30cc3f[_0x9a32('0x12')]?_0x30cc3f[_0x9a32('0x12')]['id']:0x0);if(_0x897c93['rules'][_0x1f5987]){_0x897c93[_0x9a32('0x30')][_0x1f5987][_0x9a32('0x35')](_0x9a32('0x3f'));if(rpc[_0x30cc3f[_0x9a32('0x3e')]+_0x9a32('0x40')]){rpc[_0x30cc3f[_0x9a32('0x3e')]+'QueueReport'][_0x9a32('0x41')](_0x1f5987,{'UserId':_0x30cc3f['message'][_0x9a32('0x42')]})[_0x9a32('0x43')](function(){logger[_0x9a32('0x2e')](_0x9a32('0x44'));});}}return _0x3069be({'code':0xc8,'message':_0x30cc3f});}catch(_0x3b1682){logger[_0x9a32('0x2e')](_0x3b1682[_0x9a32('0x38')]);return _0x35b7e3(_0x2a71e6[_0x9a32('0x2e')](0x1f4,_0x3b1682));}}logger['error'](_0x9a32('0x45'));return _0x35b7e3(_0x2a71e6[_0x9a32('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4d5740){var _0x323b77=this;return new Promise(function(_0x2ac555,_0x53324b){if(_0x4d5740[_0x9a32('0x3b')]&&_0x4d5740[_0x9a32('0x3b')]['id']){try{if(_0x897c93[_0x9a32('0x3a')][_0x4d5740['agent']['id']]){_0x897c93[_0x9a32('0x3a')][_0x4d5740[_0x9a32('0x3b')]['id']][_0x9a32('0x3c')]=![];_0x897c93['agents'][_0x4d5740[_0x9a32('0x3b')]['id']]['busyQueue']=undefined;}return _0x2ac555({'code':0xc8,'message':_0x4d5740});}catch(_0x492a42){logger[_0x9a32('0x2e')](_0x492a42[_0x9a32('0x38')]);return _0x53324b(_0x323b77[_0x9a32('0x2e')](0x1f4,_0x492a42));}}logger['error'](_0x9a32('0x45'));return _0x53324b(_0x323b77[_0x9a32('0x2e')](0x1f4,_0x9a32('0x45')));});},'AbandonInteraction':function(_0x24944b){var _0x1a56b2=this;return new Promise(function(_0x3e0f91,_0x2fca0a){if(_0x24944b[_0x9a32('0x3e')]&&_0x24944b['interaction']&&_0x24944b['interaction']['id']){try{var _0x5c67c8=getId(_0x24944b[_0x9a32('0x3e')],_0x24944b[_0x9a32('0x11')]?_0x24944b['message']['id']:0x0,_0x24944b[_0x9a32('0x12')]?_0x24944b[_0x9a32('0x12')]['id']:0x0);if(_0x897c93[_0x9a32('0x30')][_0x5c67c8]){_0x897c93[_0x9a32('0x30')][_0x5c67c8][_0x9a32('0x35')](_0x9a32('0x3f'));}return _0x3e0f91({'code':0xc8,'message':_0x24944b});}catch(_0x31f8b3){logger[_0x9a32('0x2e')](_0x31f8b3[_0x9a32('0x38')]);return _0x2fca0a(_0x1a56b2['error'](0x1f4,_0x31f8b3));}}logger['error'](_0x9a32('0x45'));return _0x2fca0a(_0x1a56b2[_0x9a32('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x4ddb3f){var _0x120df6=this;return new Promise(function(_0xc777cc,_0x225171){if(_0x897c93[_0x9a32('0x3a')][_0x9a32('0x46')](_0x4ddb3f['id'])){for(var _0x2e25d3 in _0x4ddb3f[_0x9a32('0x47')]){if(_0x4ddb3f['capacity'][_0x9a32('0x46')](_0x2e25d3)){if(_0x897c93[_0x9a32('0x3a')][_0x4ddb3f['id']][_0x9a32('0x46')](_0x2e25d3+_0x9a32('0x48'))){_0x897c93[_0x9a32('0x3a')][_0x4ddb3f['id']][_0x2e25d3+_0x9a32('0x48')]=parseInt(_0x4ddb3f[_0x9a32('0x47')][_0x2e25d3],0xa);}}}_0x897c93[_0x9a32('0x3a')][_0x4ddb3f['id']][_0x9a32('0x49')]();return _0xc777cc({'code':0xc8,'message':_0x897c93['agents'][_0x4ddb3f['id']]});}else{return _0x225171(_0x120df6[_0x9a32('0x2e')](0x1f4,_0x9a32('0x4a')));}});},'Agents':function(_0x80266){return new Promise(function(_0x147219){var _0x14d9c2=_[_0x9a32('0x4b')](_0x897c93[_0x9a32('0x3a')]);if(_0x80266&&_0x80266['id']){var _0x66ac62=_['find'](_0x14d9c2,function(_0x1d95ab){return _0x1d95ab['id']===_0x80266['id'];});_0x147219(_0x66ac62);}else{_0x147219({'count':_0x14d9c2[_0x9a32('0x16')],'rows':_0x14d9c2});}});},'ChatQueues':function(){return new Promise(function(_0x188653){var _0x2b294c=[];for(var _0x54cf22 in _0x897c93[_0x9a32('0x4c')]){if(_0x897c93[_0x9a32('0x4c')][_0x9a32('0x46')](_0x54cf22)){var _0x367663=_0x897c93[_0x9a32('0x4c')][_0x54cf22];var _0x17308d={'id':_0x367663['id'],'available':_0x367663[_0x9a32('0x4d')],'loggedIn':_0x367663['loggedIn'],'name':_0x367663[_0x9a32('0x4e')],'paused':_0x367663['paused'],'waiting':_0x367663[_0x9a32('0x4f')]};_0x2b294c['push'](_0x17308d);}}_0x188653({'count':_0x2b294c[_0x9a32('0x16')],'rows':_0x2b294c});});},'MailQueues':function(){return new Promise(function(_0x3a4126){var _0x3bcef3=[];for(var _0x8d74c2 in _0x897c93[_0x9a32('0x50')]){if(_0x897c93['mailQueues'][_0x9a32('0x46')](_0x8d74c2)){var _0x25d363=_0x897c93['mailQueues'][_0x8d74c2];var _0x128c6e={'id':_0x25d363['id'],'available':_0x25d363[_0x9a32('0x4d')],'loggedIn':_0x25d363[_0x9a32('0x51')],'name':_0x25d363[_0x9a32('0x4e')],'paused':_0x25d363[_0x9a32('0x52')],'waiting':_0x25d363[_0x9a32('0x4f')]};_0x3bcef3['push'](_0x128c6e);}}_0x3a4126({'count':_0x3bcef3[_0x9a32('0x16')],'rows':_0x3bcef3});});},'OpenchannelQueues':function(){return new Promise(function(_0x1a504f){var _0x201226=[];for(var _0x3768ce in _0x897c93[_0x9a32('0x53')]){if(_0x897c93[_0x9a32('0x53')][_0x9a32('0x46')](_0x3768ce)){var _0x3ed9b4=_0x897c93[_0x9a32('0x53')][_0x3768ce];var _0x5a0e74={'id':_0x3ed9b4['id'],'available':_0x3ed9b4[_0x9a32('0x4d')],'loggedIn':_0x3ed9b4[_0x9a32('0x51')],'name':_0x3ed9b4[_0x9a32('0x4e')],'paused':_0x3ed9b4[_0x9a32('0x52')],'waiting':_0x3ed9b4[_0x9a32('0x4f')]};_0x201226[_0x9a32('0x1c')](_0x5a0e74);}}_0x1a504f({'count':_0x201226['length'],'rows':_0x201226});});},'SmsQueues':function(){return new Promise(function(_0x4c4a85){var _0x5e1bf0=[];for(var _0x5c00d0 in _0x897c93[_0x9a32('0x54')]){if(_0x897c93[_0x9a32('0x54')][_0x9a32('0x46')](_0x5c00d0)){var _0x5c3fed=_0x897c93[_0x9a32('0x54')][_0x5c00d0];var _0x31e938={'id':_0x5c3fed['id'],'available':_0x5c3fed['available'],'loggedIn':_0x5c3fed['loggedIn'],'name':_0x5c3fed[_0x9a32('0x4e')],'paused':_0x5c3fed[_0x9a32('0x52')],'waiting':_0x5c3fed[_0x9a32('0x4f')]};_0x5e1bf0[_0x9a32('0x1c')](_0x31e938);}}_0x4c4a85({'count':_0x5e1bf0[_0x9a32('0x16')],'rows':_0x5e1bf0});});},'FaxQueues':function(){return new Promise(function(_0x5c7454){var _0x97d3aa=[];for(var _0x30b661 in _0x897c93[_0x9a32('0x55')]){if(_0x897c93[_0x9a32('0x55')][_0x9a32('0x46')](_0x30b661)){var _0x5cabc9=_0x897c93[_0x9a32('0x55')][_0x30b661];var _0x421706={'id':_0x5cabc9['id'],'available':_0x5cabc9[_0x9a32('0x4d')],'loggedIn':_0x5cabc9[_0x9a32('0x51')],'name':_0x5cabc9[_0x9a32('0x4e')],'paused':_0x5cabc9['paused'],'waiting':_0x5cabc9['waiting']};_0x97d3aa[_0x9a32('0x1c')](_0x421706);}}_0x5c7454({'count':_0x97d3aa['length'],'rows':_0x97d3aa});});},'WhatsappQueues':function(){return new Promise(function(_0x345696){var _0x2613c4=[];for(var _0x19a30b in _0x897c93[_0x9a32('0x56')]){if(_0x897c93[_0x9a32('0x56')][_0x9a32('0x46')](_0x19a30b)){var _0x1afcb4=_0x897c93[_0x9a32('0x56')][_0x19a30b];var _0x68b2a7={'id':_0x1afcb4['id'],'available':_0x1afcb4[_0x9a32('0x4d')],'loggedIn':_0x1afcb4[_0x9a32('0x51')],'name':_0x1afcb4[_0x9a32('0x4e')],'paused':_0x1afcb4[_0x9a32('0x52')],'waiting':_0x1afcb4['waiting']};_0x2613c4[_0x9a32('0x1c')](_0x68b2a7);}}_0x345696({'count':_0x2613c4[_0x9a32('0x16')],'rows':_0x2613c4});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x421ea3){var _0x3b8947=_['values'](_0x897c93[_0x9a32('0x57')]);_0x421ea3({'count':_0x3b8947[_0x9a32('0x16')],'rows':_0x3b8947});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2ad932){var _0x10416b=_[_0x9a32('0x4b')](_0x897c93[_0x9a32('0x58')]);_0x2ad932({'count':_0x10416b[_0x9a32('0x16')],'rows':_0x10416b});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3e490c){var _0x3487e3=_[_0x9a32('0x4b')](_0x897c93[_0x9a32('0x59')]);_0x3e490c({'count':_0x3487e3[_0x9a32('0x16')],'rows':_0x3487e3});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4889b2){var _0x442514=_[_0x9a32('0x4b')](_0x897c93[_0x9a32('0x5a')]);_0x4889b2({'count':_0x442514[_0x9a32('0x16')],'rows':_0x442514});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4eeb90){var _0x220a45=_[_0x9a32('0x4b')](_0x897c93[_0x9a32('0x5b')]);_0x4eeb90({'count':_0x220a45[_0x9a32('0x16')],'rows':_0x220a45});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x519f41){var _0x3487d5=_['values'](_0x897c93[_0x9a32('0x5c')]);_0x519f41({'count':_0x3487d5[_0x9a32('0x16')],'rows':_0x3487d5});});}};var _0x1a5f2f=jayson[_0x9a32('0x5d')](_0x5d35ed)[_0x9a32('0x5e')]();_0x1a5f2f['on']('error',function(_0x1c3742){logger[_0x9a32('0x2e')](JSON[_0x9a32('0x33')](_0x1c3742));return _0x37ab43(_0x1c3742);});_0x1a5f2f[_0x9a32('0x10')](0x232c,_0x9a32('0x5f'),function(){console['log'](_0x9a32('0x60'),0x232c);return _0x224747(_0x9a32('0x61')+0x232c);});});}; \ No newline at end of file +var _0x21c9=['routing\x20is\x20empty','agent','agents','busy','end','QueueReport','UserId','catch','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','loggedIn','paused','waiting','mailQueues','available','name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','stringify','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/utils','./applications/strategy/util','routing','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','checkWaitingNotifications','transfer','applications','isArray','length','join','.js','app','autoreply','appdata','split','channel','push','slice','dialogflow','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','./interval','condition','./applications/','consequence','priority','on\x20interval','intervals','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','matchPath','emit','complete','stack','error'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x21c9,0xea));var _0x921c=function(_0x544be0,_0x2e3c41){_0x544be0=_0x544be0-0x0;var _0xde271a=_0x21c9[_0x544be0];return _0xde271a;};'use strict';var _=require(_0x921c('0x0'));var util=require(_0x921c('0x1'));var path=require(_0x921c('0x2'));var fs=require('fs');var jayson=require(_0x921c('0x3'));var BPromise=require('bluebird');var utils=require(_0x921c('0x4'));var sUtils=require(_0x921c('0x5'));var logger=require('../../../config/logger')(_0x921c('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x921c('0x7')),'smsQueueReport':require(_0x921c('0x8')),'faxQueueReport':require(_0x921c('0x9')),'whatsappQueueReport':require(_0x921c('0xa'))};var RuleEngine=require(_0x921c('0xb'));function getId(_0x260119,_0x4ed3af,_0x5274c2){return util[_0x921c('0xc')]('%s.%s.%s',_0x260119,_0x4ed3af||0x0,_0x5274c2||0x0);}function getIntervals(_0x385790,_0x4eb749){var _0xbdf09e=[];if(!_[_0x921c('0xd')](_0x4eb749['IntervalId'])&&!_[_0x921c('0xd')](_0x385790[_0x4eb749[_0x921c('0xe')]])&&!_['isNil'](_0x385790[_0x4eb749[_0x921c('0xe')]]['Intervals'])){_0xbdf09e=_[_0x921c('0xf')](_0x385790[_0x4eb749[_0x921c('0xe')]][_0x921c('0x10')],'interval');}else if(!_['isNil'](_0x4eb749['interval'])){_0xbdf09e=[_0x4eb749[_0x921c('0x11')]];}return _0xbdf09e;}exports[_0x921c('0x12')]=function(_0x15f569){_0x15f569[_0x921c('0x13')]={};return new BPromise(function(_0x451317,_0x4be115){var _0x33174d={'Start':function(_0x1651c7){var _0x4e785d=this;return new Promise(function(_0x5cf13c,_0x402ea4){if(_0x1651c7){try{var _0x32c264=[];var _0x348bf7=getId(_0x1651c7['channel'],_0x1651c7[_0x921c('0x14')]?_0x1651c7['message']['id']:0x0,_0x1651c7[_0x921c('0x15')]?_0x1651c7['interaction']['id']:0x0);var _0x5a39f6=sUtils[_0x921c('0x16')](_0x15f569,_0x1651c7);if(_0x1651c7[_0x921c('0x17')]||!_0x5a39f6&&_0x1651c7[_0x921c('0x18')]&&_[_0x921c('0x19')](_0x1651c7[_0x921c('0x18')])&&_0x1651c7[_0x921c('0x18')][_0x921c('0x1a')]){for(var _0x565ff9=0x0;_0x565ff9<_0x1651c7[_0x921c('0x18')]['length'];_0x565ff9+=0x1){var _0x3c2796=_0x1651c7['applications'][_0x565ff9];if(fs['existsSync'](path[_0x921c('0x1b')](__dirname,_0x921c('0x18'),_0x3c2796['app']+_0x921c('0x1c')))){var _0x2890f3=[];switch(_0x3c2796[_0x921c('0x1d')]['toLowerCase']()){case _0x921c('0x1e'):var _0x1b3816=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');if(_0x1651c7[_0x921c('0x21')]==='mail'){_0x2890f3[_0x921c('0x22')](_0x1b3816[0x0]);_0x2890f3[_0x921c('0x22')](_0x1b3816[0x1]);_0x2890f3[_0x921c('0x22')](_0x1b3816[_0x921c('0x23')](0x2,_0x1b3816['length'])['join'](','));}else{_0x2890f3[_0x921c('0x22')](_0x1b3816[0x0]);_0x2890f3['push'](_0x1b3816['slice'](0x1,_0x1b3816[_0x921c('0x1a')])['join'](','));}break;case _0x921c('0x24'):var _0x843c00=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');_0x2890f3['push'](_0x843c00[0x0]);_0x2890f3[_0x921c('0x22')](_0x843c00[0x1]);_0x2890f3[_0x921c('0x22')](_0x843c00[_0x921c('0x23')](0x2,_0x843c00[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x25'):var _0xb29e3e=_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');_0x2890f3[_0x921c('0x22')](_0xb29e3e[0x0]);_0x2890f3['push'](_0xb29e3e[0x1]);_0x2890f3['push'](_0xb29e3e[0x2]);_0x2890f3['push'](_0xb29e3e[0x3]);_0x2890f3[_0x921c('0x22')](_0xb29e3e['slice'](0x4,_0xb29e3e[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x26'):var _0x2982bb=_0x3c2796['appdata'][_0x921c('0x20')](',');_0x2890f3[_0x921c('0x22')](_0x2982bb[0x0]);_0x2890f3['push'](_0x2982bb[0x1]);_0x2890f3['push'](_0x2982bb[0x2]);_0x2890f3[_0x921c('0x22')](_0x2982bb[0x3]);_0x2890f3[_0x921c('0x22')](_0x2982bb[_0x921c('0x23')](0x4,_0x2982bb[_0x921c('0x1a')])[_0x921c('0x1b')](','));break;case _0x921c('0x14'):_0x2890f3['push'](_0x3c2796['appdata']);break;case _0x921c('0x27'):_0x2890f3['push'](_0x3c2796[_0x921c('0x28')]);_0x2890f3['push'](_0x3c2796[_0x921c('0x1f')]);break;case _0x921c('0x29'):var _0x2f6f93=utils[_0x921c('0x2a')](_0x1651c7[_0x921c('0x2b')][_0x921c('0x2c')],_0x1651c7);var _0x4afca7=_0x3c2796[_0x921c('0x1f')]['split'](',');_0x2890f3['push'](_0x4afca7[0x0]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x1]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x2]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x3]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x4]);_0x2890f3['push'](_0x4afca7[0x5]);_0x2890f3['push'](_0x4afca7[0x6]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x7]);_0x2890f3['push'](_0x4afca7[0x8]);_0x2890f3[_0x921c('0x22')](_0x4afca7[0x9]);_0x2890f3['push'](_0x4afca7[0xa]);_0x2890f3[_0x921c('0x22')](_0x1651c7['interaction']['id']);_0x2890f3['push'](_0x1651c7[_0x921c('0x14')]['id']);_0x2890f3['push'](_0x3c2796[_0x921c('0x2d')]);_0x2890f3['push'](_0x1651c7[_0x921c('0x15')][_0x921c('0x2e')]);_0x2890f3[_0x921c('0x22')](_0x1651c7['body']['body']);_0x2890f3[_0x921c('0x22')](_0x2f6f93);break;default:_0x2890f3=_[_0x921c('0xd')](_0x3c2796['appdata'])?[]:_0x3c2796[_0x921c('0x1f')][_0x921c('0x20')](',');}var _0x19ce99={'id':util[_0x921c('0xc')]('%s:%s:%s',_0x348bf7,_0x3c2796['id'],_0x3c2796['app']),'condition':require(_0x921c('0x2f'))[_0x921c('0x30')](_0x348bf7,getIntervals(_0x15f569['intervals'],_0x3c2796),_0x15f569),'consequence':require(_0x921c('0x31')+_0x3c2796[_0x921c('0x1d')])[_0x921c('0x32')](_0x348bf7,_0x2890f3,_0x15f569,_0x1651c7),'p':_0x3c2796[_0x921c('0x33')]||0x0};logger['info']('Push\x20new\x20rule',_0x19ce99['id'],_0x921c('0x34'),getIntervals(_0x15f569[_0x921c('0x35')],_0x3c2796)[_0x921c('0x1b')]('\x20|\x20'));_0x32c264[_0x921c('0x22')](_0x19ce99);}else{logger['error'](_0x921c('0x36'),path[_0x921c('0x1b')](__dirname,_0x921c('0x18'),_0x3c2796[_0x921c('0x1d')]+'.js'));}}_0x15f569[_0x921c('0x13')][_0x348bf7]=new RuleEngine(_0x32c264);_0x15f569[_0x921c('0x13')][_0x348bf7][_0x921c('0x37')](_0x1651c7,function(_0x4b2a2e){logger[_0x921c('0x38')](_0x921c('0x39'),JSON['stringify'](_0x4b2a2e[_0x921c('0x3a')]));if(_0x15f569['rules'][_0x348bf7]){_0x15f569[_0x921c('0x13')][_0x348bf7][_0x921c('0x3b')](_0x921c('0x3c'));}});return _0x5cf13c({'code':0xc8,'message':_0x1651c7});}else{if(_0x5a39f6){logger[_0x921c('0x38')](util['format']('Skipped\x20routing\x20for\x20%s',_0x348bf7));}else{logger[_0x921c('0x38')]('No\x20applications\x20to\x20execute');}return _0x5cf13c({'code':0xc8,'message':_0x1651c7});}}catch(_0x508e08){logger['error'](_0x508e08[_0x921c('0x3d')]);return _0x402ea4(_0x4e785d[_0x921c('0x3e')](0x1f4,_0x508e08));}}return _0x402ea4(_0x921c('0x3f'));});},'AcceptMessage':function(_0x460a58){var _0x25b2d0=this;return new Promise(function(_0x33c13e,_0x1a030f){if(_0x460a58['agent']&&_0x460a58[_0x921c('0x40')]['id']){if(_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']]){_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']][_0x921c('0x42')]=![];_0x15f569[_0x921c('0x41')][_0x460a58[_0x921c('0x40')]['id']]['busyQueue']=undefined;}}if(_0x460a58[_0x921c('0x14')]&&_0x460a58[_0x921c('0x14')]['id']){try{var _0x4358f6=getId(_0x460a58[_0x921c('0x21')],_0x460a58[_0x921c('0x14')]?_0x460a58[_0x921c('0x14')]['id']:0x0,_0x460a58[_0x921c('0x15')]?_0x460a58[_0x921c('0x15')]['id']:0x0);if(_0x15f569[_0x921c('0x13')][_0x4358f6]){_0x15f569[_0x921c('0x13')][_0x4358f6][_0x921c('0x3b')](_0x921c('0x43'));if(rpc[_0x460a58[_0x921c('0x21')]+'QueueReport']){rpc[_0x460a58[_0x921c('0x21')]+_0x921c('0x44')]['update'](_0x4358f6,{'UserId':_0x460a58[_0x921c('0x14')][_0x921c('0x45')]})[_0x921c('0x46')](function(){logger[_0x921c('0x3e')]('error\x20update\x20queue\x20report');});}}return _0x33c13e({'code':0xc8,'message':_0x460a58});}catch(_0x3f8a05){logger[_0x921c('0x3e')](_0x3f8a05[_0x921c('0x3d')]);return _0x1a030f(_0x25b2d0[_0x921c('0x3e')](0x1f4,_0x3f8a05));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x1a030f(_0x25b2d0[_0x921c('0x3e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x19d029){var _0x480b93=this;return new Promise(function(_0x541a5d,_0x2cfce4){if(_0x19d029[_0x921c('0x40')]&&_0x19d029[_0x921c('0x40')]['id']){try{if(_0x15f569[_0x921c('0x41')][_0x19d029[_0x921c('0x40')]['id']]){_0x15f569['agents'][_0x19d029['agent']['id']]['busy']=![];_0x15f569[_0x921c('0x41')][_0x19d029[_0x921c('0x40')]['id']][_0x921c('0x48')]=undefined;}return _0x541a5d({'code':0xc8,'message':_0x19d029});}catch(_0x1012ca){logger[_0x921c('0x3e')](_0x1012ca['stack']);return _0x2cfce4(_0x480b93[_0x921c('0x3e')](0x1f4,_0x1012ca));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x2cfce4(_0x480b93['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0xcca7bf){var _0x40f32c=this;return new Promise(function(_0x250219,_0x4e2001){if(_0xcca7bf[_0x921c('0x21')]&&_0xcca7bf['interaction']&&_0xcca7bf[_0x921c('0x15')]['id']){try{var _0x31c337=getId(_0xcca7bf[_0x921c('0x21')],_0xcca7bf[_0x921c('0x14')]?_0xcca7bf[_0x921c('0x14')]['id']:0x0,_0xcca7bf[_0x921c('0x15')]?_0xcca7bf['interaction']['id']:0x0);if(_0x15f569['rules'][_0x31c337]){_0x15f569[_0x921c('0x13')][_0x31c337][_0x921c('0x3b')](_0x921c('0x43'));}return _0x250219({'code':0xc8,'message':_0xcca7bf});}catch(_0x3878dd){logger[_0x921c('0x3e')](_0x3878dd[_0x921c('0x3d')]);return _0x4e2001(_0x40f32c['error'](0x1f4,_0x3878dd));}}logger[_0x921c('0x3e')](_0x921c('0x47'));return _0x4e2001(_0x40f32c['error'](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x505657){var _0x4121fa=this;return new Promise(function(_0x2fa6eb,_0x4fc7b1){if(_0x15f569['agents'][_0x921c('0x49')](_0x505657['id'])){for(var _0xcfd81e in _0x505657[_0x921c('0x4a')]){if(_0x505657['capacity'][_0x921c('0x49')](_0xcfd81e)){if(_0x15f569[_0x921c('0x41')][_0x505657['id']][_0x921c('0x49')](_0xcfd81e+_0x921c('0x4b'))){_0x15f569[_0x921c('0x41')][_0x505657['id']][_0xcfd81e+_0x921c('0x4b')]=parseInt(_0x505657[_0x921c('0x4a')][_0xcfd81e],0xa);}}}_0x15f569['agents'][_0x505657['id']]['updateRealtime']();return _0x2fa6eb({'code':0xc8,'message':_0x15f569[_0x921c('0x41')][_0x505657['id']]});}else{return _0x4fc7b1(_0x4121fa['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2d2122){return new Promise(function(_0x646e98){var _0x1babf7=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x41')]);if(_0x2d2122&&_0x2d2122['id']){var _0x235e33=_[_0x921c('0x4d')](_0x1babf7,function(_0x3668cb){return _0x3668cb['id']===_0x2d2122['id'];});_0x646e98(_0x235e33);}else{_0x646e98({'count':_0x1babf7['length'],'rows':_0x1babf7});}});},'ChatQueues':function(){return new Promise(function(_0x2a7614){var _0x168463=[];for(var _0x33e323 in _0x15f569[_0x921c('0x4e')]){if(_0x15f569[_0x921c('0x4e')][_0x921c('0x49')](_0x33e323)){var _0x2fa63a=_0x15f569[_0x921c('0x4e')][_0x33e323];var _0x44a403={'id':_0x2fa63a['id'],'available':_0x2fa63a['available'],'loggedIn':_0x2fa63a[_0x921c('0x4f')],'name':_0x2fa63a['name'],'paused':_0x2fa63a[_0x921c('0x50')],'waiting':_0x2fa63a[_0x921c('0x51')]};_0x168463['push'](_0x44a403);}}_0x2a7614({'count':_0x168463[_0x921c('0x1a')],'rows':_0x168463});});},'MailQueues':function(){return new Promise(function(_0x4e033f){var _0xd82da0=[];for(var _0x4ef186 in _0x15f569[_0x921c('0x52')]){if(_0x15f569[_0x921c('0x52')][_0x921c('0x49')](_0x4ef186)){var _0x38200a=_0x15f569[_0x921c('0x52')][_0x4ef186];var _0x1c57c6={'id':_0x38200a['id'],'available':_0x38200a[_0x921c('0x53')],'loggedIn':_0x38200a[_0x921c('0x4f')],'name':_0x38200a[_0x921c('0x54')],'paused':_0x38200a['paused'],'waiting':_0x38200a['waiting']};_0xd82da0[_0x921c('0x22')](_0x1c57c6);}}_0x4e033f({'count':_0xd82da0[_0x921c('0x1a')],'rows':_0xd82da0});});},'OpenchannelQueues':function(){return new Promise(function(_0x2a0a71){var _0x3787e3=[];for(var _0x405b4a in _0x15f569[_0x921c('0x55')]){if(_0x15f569[_0x921c('0x55')][_0x921c('0x49')](_0x405b4a)){var _0x125621=_0x15f569[_0x921c('0x55')][_0x405b4a];var _0x199522={'id':_0x125621['id'],'available':_0x125621[_0x921c('0x53')],'loggedIn':_0x125621[_0x921c('0x4f')],'name':_0x125621[_0x921c('0x54')],'paused':_0x125621['paused'],'waiting':_0x125621['waiting']};_0x3787e3[_0x921c('0x22')](_0x199522);}}_0x2a0a71({'count':_0x3787e3[_0x921c('0x1a')],'rows':_0x3787e3});});},'SmsQueues':function(){return new Promise(function(_0x4877df){var _0x3d5f29=[];for(var _0x5358c1 in _0x15f569[_0x921c('0x56')]){if(_0x15f569['smsQueues'][_0x921c('0x49')](_0x5358c1)){var _0xcd4cbf=_0x15f569[_0x921c('0x56')][_0x5358c1];var _0x112e13={'id':_0xcd4cbf['id'],'available':_0xcd4cbf['available'],'loggedIn':_0xcd4cbf[_0x921c('0x4f')],'name':_0xcd4cbf[_0x921c('0x54')],'paused':_0xcd4cbf[_0x921c('0x50')],'waiting':_0xcd4cbf[_0x921c('0x51')]};_0x3d5f29['push'](_0x112e13);}}_0x4877df({'count':_0x3d5f29[_0x921c('0x1a')],'rows':_0x3d5f29});});},'FaxQueues':function(){return new Promise(function(_0x51f498){var _0x24e418=[];for(var _0x5c68cf in _0x15f569[_0x921c('0x57')]){if(_0x15f569['faxQueues'][_0x921c('0x49')](_0x5c68cf)){var _0x199d50=_0x15f569[_0x921c('0x57')][_0x5c68cf];var _0x464952={'id':_0x199d50['id'],'available':_0x199d50[_0x921c('0x53')],'loggedIn':_0x199d50[_0x921c('0x4f')],'name':_0x199d50[_0x921c('0x54')],'paused':_0x199d50[_0x921c('0x50')],'waiting':_0x199d50[_0x921c('0x51')]};_0x24e418[_0x921c('0x22')](_0x464952);}}_0x51f498({'count':_0x24e418[_0x921c('0x1a')],'rows':_0x24e418});});},'WhatsappQueues':function(){return new Promise(function(_0x4aeb1f){var _0x2e1b65=[];for(var _0x4a80dc in _0x15f569['whatsappQueues']){if(_0x15f569[_0x921c('0x58')][_0x921c('0x49')](_0x4a80dc)){var _0xb99c4e=_0x15f569[_0x921c('0x58')][_0x4a80dc];var _0x5c8b0d={'id':_0xb99c4e['id'],'available':_0xb99c4e[_0x921c('0x53')],'loggedIn':_0xb99c4e[_0x921c('0x4f')],'name':_0xb99c4e[_0x921c('0x54')],'paused':_0xb99c4e['paused'],'waiting':_0xb99c4e['waiting']};_0x2e1b65[_0x921c('0x22')](_0x5c8b0d);}}_0x4aeb1f({'count':_0x2e1b65[_0x921c('0x1a')],'rows':_0x2e1b65});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x355742){var _0x1269da=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x59')]);_0x355742({'count':_0x1269da['length'],'rows':_0x1269da});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x564dc2){var _0x254626=_[_0x921c('0x4c')](_0x15f569['mailQueuesWaitingInteractions']);_0x564dc2({'count':_0x254626['length'],'rows':_0x254626});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x5ec529){var _0x32d63f=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5a')]);_0x5ec529({'count':_0x32d63f[_0x921c('0x1a')],'rows':_0x32d63f});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x252f9b){var _0x3b42bf=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5b')]);_0x252f9b({'count':_0x3b42bf[_0x921c('0x1a')],'rows':_0x3b42bf});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x128ed2){var _0x1a6e99=_[_0x921c('0x4c')](_0x15f569[_0x921c('0x5c')]);_0x128ed2({'count':_0x1a6e99[_0x921c('0x1a')],'rows':_0x1a6e99});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1ea2cf){var _0x47ed1b=_[_0x921c('0x4c')](_0x15f569['whatsappQueuesWaitingInteractions']);_0x1ea2cf({'count':_0x47ed1b[_0x921c('0x1a')],'rows':_0x47ed1b});});}};var _0x48383f=jayson[_0x921c('0x5d')](_0x33174d)[_0x921c('0x5e')]();_0x48383f['on'](_0x921c('0x3e'),function(_0x255f9e){logger[_0x921c('0x3e')](JSON[_0x921c('0x5f')](_0x255f9e));return _0x4be115(_0x255f9e);});_0x48383f[_0x921c('0x12')](0x232c,'127.0.0.1',function(){console[_0x921c('0x60')](_0x921c('0x61'),0x232c);return _0x451317(_0x921c('0x62')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index f6dfae5..1db8a8c 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 _0xf55c=['../../../config/logger','routing','client','http','request','then','error','message','result','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','true','catch','all','some','[%s][INTERVAL]\x20%s\x20%s','when','join','\x20|\x20','bluebird','jayson/promise','lodash'];(function(_0x4632ee,_0x107f81){var _0x301a47=function(_0x12ae36){while(--_0x12ae36){_0x4632ee['push'](_0x4632ee['shift']());}};_0x301a47(++_0x107f81);}(_0xf55c,0x93));var _0xcf55=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xf55c[_0x6c993a];return _0x27f547;};'use strict';var util=require('util');var BPromise=require(_0xcf55('0x0'));var jayson=require(_0xcf55('0x1'));var _=require(_0xcf55('0x2'));var logger=require(_0xcf55('0x3'))(_0xcf55('0x4'));var client=jayson[_0xcf55('0x5')][_0xcf55('0x6')]({'port':0x232a});function request(_0x229a85,_0x778b1d){return new BPromise(function(_0x4fdd17,_0x44a2c4){return client[_0xcf55('0x7')](_0x229a85,_0x778b1d)[_0xcf55('0x8')](function(_0x4e0856){if(_0x4e0856['error']){return _0x44a2c4(_0x4e0856[_0xcf55('0x9')][_0xcf55('0xa')]);}else{return _0x4fdd17(_0x4e0856[_0xcf55('0xb')]);}})['catch'](function(_0x47c5d8){return _0x44a2c4(_0x47c5d8);});});}exports[_0xcf55('0xc')]=function(_0x2bd3d9,_0x591b71,_0x3984ce){return function(_0x20e303){if(_0x3984ce[_0xcf55('0xd')]&&!_0x3984ce[_0xcf55('0xd')][_0x2bd3d9]){logger[_0xcf55('0xe')](_0xcf55('0xf'),_0x2bd3d9);return _0x20e303[_0xcf55('0x10')]();}var _0x3e4124=[];for(var _0x390dd3=0x0;_0x390dd3<_0x591b71[_0xcf55('0x11')];_0x390dd3+=0x1){_0x3e4124[_0xcf55('0x12')](request(_0xcf55('0x13'),{'command':util[_0xcf55('0x14')](_0xcf55('0x15'),_0x591b71[_0x390dd3])})[_0xcf55('0x8')](function(_0x39126e){return _0x39126e&&_0x39126e[_0xcf55('0xa')]&&_0x39126e['message']['indexOf'](_0xcf55('0x16'))>=0x0?!![]:![];})[_0xcf55('0x17')](function(){logger[_0xcf55('0x9')]('[%s][INTERVAL]\x20%s',_0x2bd3d9,_0x591b71[_0x390dd3]);}));}BPromise[_0xcf55('0x18')](_0x3e4124)['then'](function(_0x3992db){var _0x4ddf10=_[_0xcf55('0x19')](_0x3992db);logger[_0xcf55('0xe')](_0xcf55('0x1a'),_0x2bd3d9,_0x591b71['join']('\x20|\x20'),_0x4ddf10);_0x20e303[_0xcf55('0x1b')](_0x4ddf10);})[_0xcf55('0x17')](function(_0x4dcf4b){logger[_0xcf55('0x9')](_0xcf55('0x1a'),_0x2bd3d9,_0x591b71[_0xcf55('0x1c')](_0xcf55('0x1d')),_0x4dcf4b['stack']);_0x20e303['stop']();});};}; \ No newline at end of file +var _0xa44c=['indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','lodash','../../../config/logger','routing','client','http','then','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xa44c,0x1ca));var _0xca44=function(_0x524b17,_0x3fe12f){_0x524b17=_0x524b17-0x0;var _0xa52881=_0xa44c[_0x524b17];return _0xa52881;};'use strict';var util=require(_0xca44('0x0'));var BPromise=require(_0xca44('0x1'));var jayson=require('jayson/promise');var _=require(_0xca44('0x2'));var logger=require(_0xca44('0x3'))(_0xca44('0x4'));var client=jayson[_0xca44('0x5')][_0xca44('0x6')]({'port':0x232a});function request(_0x1b8e0e,_0x412780){return new BPromise(function(_0x3be500,_0x5ecb7e){return client['request'](_0x1b8e0e,_0x412780)[_0xca44('0x7')](function(_0x25509d){if(_0x25509d[_0xca44('0x8')]){return _0x5ecb7e(_0x25509d['error']['message']);}else{return _0x3be500(_0x25509d[_0xca44('0x9')]);}})[_0xca44('0xa')](function(_0x4c1347){return _0x5ecb7e(_0x4c1347);});});}exports[_0xca44('0xb')]=function(_0x318db3,_0x3a4a0b,_0x678171){return function(_0x465b02){if(_0x678171['rules']&&!_0x678171[_0xca44('0xc')][_0x318db3]){logger[_0xca44('0xd')](_0xca44('0xe'),_0x318db3);return _0x465b02[_0xca44('0xf')]();}var _0x2067ac=[];for(var _0x6f698c=0x0;_0x6f698c<_0x3a4a0b[_0xca44('0x10')];_0x6f698c+=0x1){_0x2067ac[_0xca44('0x11')](request(_0xca44('0x12'),{'command':util[_0xca44('0x13')](_0xca44('0x14'),_0x3a4a0b[_0x6f698c])})['then'](function(_0x53ea90){return _0x53ea90&&_0x53ea90[_0xca44('0x15')]&&_0x53ea90[_0xca44('0x15')][_0xca44('0x16')](_0xca44('0x17'))>=0x0?!![]:![];})[_0xca44('0xa')](function(){logger['error'](_0xca44('0x18'),_0x318db3,_0x3a4a0b[_0x6f698c]);}));}BPromise[_0xca44('0x19')](_0x2067ac)[_0xca44('0x7')](function(_0x11c790){var _0x2f6893=_[_0xca44('0x1a')](_0x11c790);logger[_0xca44('0xd')](_0xca44('0x1b'),_0x318db3,_0x3a4a0b[_0xca44('0x1c')](_0xca44('0x1d')),_0x2f6893);_0x465b02[_0xca44('0x1e')](_0x2f6893);})[_0xca44('0xa')](function(_0x4be004){logger[_0xca44('0x8')](_0xca44('0x1b'),_0x318db3,_0x3a4a0b[_0xca44('0x1c')]('\x20|\x20'),_0x4be004[_0xca44('0x1f')]);_0x465b02[_0xca44('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ae12f69..91cd3eb 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 _0xdb94=['transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','calleridnum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','debug','[%s][agents][agentcalled]','destuniqueid','connectedlinenum','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','membername','agentringnoanswerAt','now','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten'];(function(_0x3147ef,_0x5ad165){var _0x467392=function(_0x1880c1){while(--_0x1880c1){_0x3147ef['push'](_0x3147ef['shift']());}};_0x467392(++_0x5ad165);}(_0xdb94,0xab));var _0x4db9=function(_0x4ff6a1,_0x4cb028){_0x4ff6a1=_0x4ff6a1-0x0;var _0x9cba4e=_0xdb94[_0x4ff6a1];return _0x9cba4e;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var utils=require(_0x4db9('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x39909a,_0x3b4f98){utils['info'](util[_0x4db9('0x3')](_0x4db9('0x4'),_0x39909a['uniqueid'],_0x39909a['channel'],_0x39909a[_0x4db9('0x5')],_0x39909a['membername'],_0x39909a['interface'],_0x39909a[_0x4db9('0x6')],_0x39909a['connectedlinenum'],_0x39909a[_0x4db9('0x7')]));if(_0x39909a['queue']){utils[_0x4db9('0x8')](_0x39909a[_0x4db9('0x5')])[_0x4db9('0x9')](function(_0xbbc1eb){if(_0xbbc1eb){_0x39909a[_0x4db9('0xa')]=_0xbbc1eb[_0x4db9('0xa')];_0x39909a[_0x4db9('0xb')]=_0x39909a[_0x4db9('0xc')]?_0xbbc1eb[_0x4db9('0xd')]:![];_0x39909a[_0x4db9('0xe')]=_0x39909a[_0x4db9('0xb')]?_0xbbc1eb['acwTimeout']:0x0;}utils[_0x4db9('0xf')](_0x4db9('0x10'),_0x39909a);});}else{utils['request']('CreateVoiceAgentReport',_0x39909a);}if(_0x3b4f98){delete transfers[_0x39909a[_0x4db9('0x11')]];}else{delete agents[_0x39909a['destuniqueid']];}}exports['agentcalled']=function(_0x34fc7d){try{utils[_0x4db9('0x12')](util['format'](_0x4db9('0x13'),_0x34fc7d[_0x4db9('0x11')]),_0x34fc7d);agents[_0x34fc7d[_0x4db9('0x14')]]=_0x34fc7d;agents[_0x34fc7d[_0x4db9('0x14')]]['agentcalledAt']=utils['now']();agents[_0x34fc7d[_0x4db9('0x14')]][_0x4db9('0x7')]='called';agents[_0x34fc7d[_0x4db9('0x14')]][_0x4db9('0x15')]=null;agents[_0x34fc7d['destuniqueid']]['connectedlinename']=null;utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x17'),_0x34fc7d[_0x4db9('0x11')],agents[_0x34fc7d[_0x4db9('0x14')]]['membername'],_0x34fc7d[_0x4db9('0x14')]));}catch(_0x1214ee){utils[_0x4db9('0x18')](util['format'](_0x4db9('0x13'),_0x34fc7d[_0x4db9('0x11')]),_0x1214ee);}};exports[_0x4db9('0x19')]=function(_0x4c92e8){try{if(!_[_0x4db9('0x1a')](agents[_0x4c92e8[_0x4db9('0x14')]])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x1b'),_0x4c92e8[_0x4db9('0x11')]),_0x4c92e8);utils[_0x4db9('0x16')](util['format'](_0x4db9('0x1c'),_0x4c92e8[_0x4db9('0x11')],agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x1d')],_0x4c92e8['destuniqueid']));agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x19')]=!![];agents[_0x4c92e8['destuniqueid']][_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();agents[_0x4c92e8[_0x4db9('0x14')]]['lastevent']=_0x4db9('0x20');agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x21')]=_0x4db9('0x20');agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x22')]=_0x4c92e8[_0x4db9('0x23')]?parseInt(_0x4c92e8[_0x4db9('0x23')])/0x3e8:0x0;agents[_0x4c92e8[_0x4db9('0x14')]][_0x4db9('0x24')]=0x0;unanswered[_0x4db9('0x25')](_0x4c92e8[_0x4db9('0x14')]);}}catch(_0x2d646d){utils[_0x4db9('0x18')](util['format']('[%s][agents][agentringnoanswer]',_0x4c92e8[_0x4db9('0x11')]),_0x2d646d);}};exports[_0x4db9('0x26')]=function(_0x119371){try{_[_0x4db9('0x27')](agents,function(_0x2af884,_0x459131){if(_0x2af884['uniqueid']==_0x119371[_0x4db9('0x11')]&&!_['includes'](unanswered,_0x2af884[_0x4db9('0x14')])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x28'),_0x119371[_0x4db9('0x11')]),_0x119371);utils['info'](util['format'](_0x4db9('0x29'),_0x119371['uniqueid'],_0x2af884[_0x4db9('0x1d')],_0x2af884[_0x4db9('0x14')]));_0x2af884['agentringnoanswer']=!![];_0x2af884[_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();_0x2af884[_0x4db9('0x7')]='abandoned';_0x2af884[_0x4db9('0x21')]='abandoned';_0x2af884[_0x4db9('0x22')]=_0x119371[_0x4db9('0x22')];_0x2af884[_0x4db9('0x24')]=0x0;writeDB(_0x2af884);}});}catch(_0x4dbcd3){utils['error'](util[_0x4db9('0x3')](_0x4db9('0x28'),_0x119371[_0x4db9('0x11')]),_0x4dbcd3);}};exports[_0x4db9('0x2a')]=function(_0x2dca24){try{if(agents[_0x2dca24[_0x4db9('0x14')]]){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x2b'),_0x2dca24['uniqueid']),_0x2dca24);utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x2c'),_0x2dca24[_0x4db9('0x11')],agents[_0x2dca24['destuniqueid']][_0x4db9('0x1d')],_0x2dca24[_0x4db9('0x14')]));agents[_0x2dca24[_0x4db9('0x14')]]['agentconnectAt']=utils[_0x4db9('0x1f')]();agents[_0x2dca24[_0x4db9('0x14')]][_0x4db9('0x15')]=_0x2dca24[_0x4db9('0x15')];agents[_0x2dca24['destuniqueid']]['connectedlinename']=_0x2dca24[_0x4db9('0x2d')];agents[_0x2dca24[_0x4db9('0x14')]][_0x4db9('0x22')]=_0x2dca24[_0x4db9('0x23')];agents[_0x2dca24[_0x4db9('0x14')]]['lastevent']=_0x4db9('0x2e');_[_0x4db9('0x27')](agents,function(_0x23affc,_0x367c4c){if(_0x23affc[_0x4db9('0x14')]!=_0x2dca24['destuniqueid']&&_0x23affc[_0x4db9('0x11')]==_0x2dca24[_0x4db9('0x11')]){_0x23affc[_0x4db9('0x24')]=0x0;_0x23affc['holdtime']=_0x2dca24[_0x4db9('0x23')];_0x23affc[_0x4db9('0x19')]=!![];_0x23affc[_0x4db9('0x1e')]=utils[_0x4db9('0x1f')]();_0x23affc[_0x4db9('0x7')]=_0x4db9('0x2f');_0x23affc[_0x4db9('0x21')]=_0x4db9('0x2f');_0x23affc[_0x4db9('0x30')]=_0x2dca24[_0x4db9('0x14')];_0x23affc['answeredelsewheremembername']=_0x2dca24['membername'];writeDB(_0x23affc);}});}}catch(_0x48aaf5){utils[_0x4db9('0x18')](util[_0x4db9('0x3')]('[%s][agents][agentconnect]',_0x2dca24[_0x4db9('0x11')]),_0x48aaf5);}};exports[_0x4db9('0xc')]=function(_0x563416){try{if(!_['isNil'](agents[_0x563416[_0x4db9('0x14')]])){utils['debug'](util[_0x4db9('0x3')](_0x4db9('0x31'),_0x563416['uniqueid']),_0x563416);utils[_0x4db9('0x16')](util[_0x4db9('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x563416[_0x4db9('0x11')],agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x1d')],_0x563416['destuniqueid']));agents[_0x563416['destuniqueid']][_0x4db9('0xc')]=!![];agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x24')]=utils[_0x4db9('0x33')](agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x32')],agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x34')]);agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x21')]=_0x563416['reason'];agents[_0x563416[_0x4db9('0x14')]][_0x4db9('0x7')]=_0x4db9('0x35');writeDB(agents[_0x563416[_0x4db9('0x14')]]);}}catch(_0x329822){utils[_0x4db9('0x18')](util[_0x4db9('0x3')](_0x4db9('0x31'),_0x563416[_0x4db9('0x11')]),_0x329822);}};exports[_0x4db9('0x36')]=function(_0x10dccb){try{if(!_['isNil'](agents[_0x10dccb['transfereruniqueid']])){utils[_0x4db9('0x12')](util[_0x4db9('0x3')](_0x4db9('0x37'),_0x10dccb[_0x4db9('0x11')]),_0x10dccb);utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x38'),_0x10dccb[_0x4db9('0x11')],agents[_0x10dccb['transfereruniqueid']][_0x4db9('0x1d')],agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x11')]));agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3a')]=!![];agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3b')]=_0x4db9('0x3c');agents[_0x10dccb['transfereruniqueid']][_0x4db9('0x3d')]=_0x10dccb[_0x4db9('0x3e')];agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x3f')]=agents[_0x10dccb[_0x4db9('0x39')]][_0x4db9('0x11')];}}catch(_0x4e88c2){utils[_0x4db9('0x18')](util['format'](_0x4db9('0x37'),_0x10dccb['uniqueid']),_0x4e88c2);}};exports['attendedtransfer']=function(_0x2604bf){try{utils['debug'](util[_0x4db9('0x3')](_0x4db9('0x40'),_0x2604bf[_0x4db9('0x41')]),_0x2604bf);if(_0x2604bf[_0x4db9('0x41')]==_0x2604bf['origtransfererlinkedid']){if(!_[_0x4db9('0x1a')](agents[_0x2604bf['secondtransfereruniqueid']])){utils[_0x4db9('0x16')](util[_0x4db9('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x2604bf[_0x4db9('0x41')],agents[_0x2604bf['secondtransfereruniqueid']][_0x4db9('0x1d')]));agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3a')]=!![];agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3b')]=_0x4db9('0x43');agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3d')]=_0x2604bf[_0x4db9('0x44')];agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x3f')]=_0x2604bf[_0x4db9('0x41')];}if(_0x2604bf[_0x4db9('0x45')]&&agents[_0x2604bf[_0x4db9('0x45')]]){agents[_0x2604bf[_0x4db9('0x45')]]['agententerreason']=0x1;transfers[_0x2604bf[_0x4db9('0x45')]]=_[_0x4db9('0x46')](agents[_0x2604bf['transfereeuniqueid']]);transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x6')]=agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x6')];transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x47')]=agents[_0x2604bf[_0x4db9('0x42')]][_0x4db9('0x47')];transfers[_0x2604bf[_0x4db9('0x45')]]['agentcalledAt']=utils['now']();transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x34')]=utils[_0x4db9('0x1f')]();transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x22')]=0x0;transfers[_0x2604bf[_0x4db9('0x45')]][_0x4db9('0x48')]=0x2;}}else if(_0x2604bf[_0x4db9('0x42')]==_0x2604bf[_0x4db9('0x49')]){if(!_[_0x4db9('0x1a')](agents[_0x2604bf['origtransfereruniqueid']])){utils[_0x4db9('0x16')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x2604bf['origtransfereruniqueid'],agents[_0x2604bf['origtransfereruniqueid']][_0x4db9('0x1d')]));agents[_0x2604bf['origtransfereruniqueid']]['transfer']=!![];agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3b')]=_0x4db9('0x43');agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3d')]=_0x2604bf[_0x4db9('0x4a')];agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x3f')]=_0x2604bf[_0x4db9('0x42')];}if(_0x2604bf[_0x4db9('0x4b')]&&agents[_0x2604bf[_0x4db9('0x4b')]]){agents[_0x2604bf[_0x4db9('0x4b')]][_0x4db9('0x48')]=0x1;transfers[_0x2604bf[_0x4db9('0x4b')]]=_[_0x4db9('0x46')](agents[_0x2604bf[_0x4db9('0x4b')]]);transfers[_0x2604bf['transfertargetuniqueid']]['calleridnum']=agents[_0x2604bf['origtransfereruniqueid']][_0x4db9('0x6')];transfers[_0x2604bf['transfertargetuniqueid']][_0x4db9('0x47')]=agents[_0x2604bf[_0x4db9('0x41')]][_0x4db9('0x47')];transfers[_0x2604bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4db9('0x1f')]();transfers[_0x2604bf['transfertargetuniqueid']][_0x4db9('0x34')]=utils[_0x4db9('0x1f')]();transfers[_0x2604bf[_0x4db9('0x4b')]][_0x4db9('0x22')]=0x0;transfers[_0x2604bf[_0x4db9('0x4b')]]['agententerreason']=0x2;}}}catch(_0x1c2c6d){utils['error'](util[_0x4db9('0x3')](_0x4db9('0x40'),_0x2604bf[_0x4db9('0x41')]),_0x1c2c6d);}};exports[_0x4db9('0x4c')]=function(_0x12c1b5){try{utils['debug'](util['format'](_0x4db9('0x4d'),_0x12c1b5[_0x4db9('0x11')]),_0x12c1b5);if(agents[_0x12c1b5['uniqueid']]&&agents[_0x12c1b5['uniqueid']][_0x4db9('0x21')]==='timeout'){if(_0x12c1b5[_0x4db9('0x4e')]==='21'){agents[_0x12c1b5['uniqueid']][_0x4db9('0x21')]=_0x4db9('0x4f');agents[_0x12c1b5['uniqueid']]['lastevent']=_0x4db9('0x4f');}utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5[_0x4db9('0x11')],agents[_0x12c1b5['uniqueid']]['membername'],agents[_0x12c1b5['uniqueid']]['reason'],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x7')]));writeDB(agents[_0x12c1b5[_0x4db9('0x11')]]);var _0x3a7b70=unanswered['indexOf'](_0x12c1b5[_0x4db9('0x11')]);if(_0x3a7b70>-0x1){unanswered['splice'](_0x3a7b70,0x1);}}if(transfers[_0x12c1b5[_0x4db9('0x11')]]){transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0xc')]=!![];transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();transfers[_0x12c1b5[_0x4db9('0x11')]]['talktime']=utils[_0x4db9('0x33')](transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')],transfers[_0x12c1b5['uniqueid']][_0x4db9('0x34')]);transfers[_0x12c1b5[_0x4db9('0x11')]]['reason']='agent';transfers[_0x12c1b5[_0x4db9('0x11')]]['lastevent']='complete';utils[_0x4db9('0x16')](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5['uniqueid'],transfers[_0x12c1b5['uniqueid']]['membername'],transfers[_0x12c1b5['uniqueid']]['reason'],transfers[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x7')]));writeDB(transfers[_0x12c1b5[_0x4db9('0x11')]],!![]);}if(agents[_0x12c1b5[_0x4db9('0x11')]]&&agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x34')]){agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0xc')]=!![];agents[_0x12c1b5['uniqueid']][_0x4db9('0x32')]=utils[_0x4db9('0x1f')]();agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x24')]=utils[_0x4db9('0x33')](agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x32')],agents[_0x12c1b5[_0x4db9('0x11')]]['agentconnectAt']);agents[_0x12c1b5[_0x4db9('0x11')]]['reason']=agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x3a')]?_0x4db9('0x3a'):_0x4db9('0x51');agents[_0x12c1b5['uniqueid']]['lastevent']=_0x4db9('0x35');utils['info'](util[_0x4db9('0x3')](_0x4db9('0x50'),_0x12c1b5[_0x4db9('0x11')],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x1d')],agents[_0x12c1b5[_0x4db9('0x11')]][_0x4db9('0x21')],agents[_0x12c1b5[_0x4db9('0x11')]]['lastevent']));writeDB(agents[_0x12c1b5[_0x4db9('0x11')]]);}}catch(_0xdc3e6f){utils[_0x4db9('0x18')](util[_0x4db9('0x3')]('[%s][agents][hangup]',_0x12c1b5[_0x4db9('0x11')]),_0xdc3e6f);}}; \ No newline at end of file +var _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%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','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x275d56,_0xba06a3){var _0x1510b6=function(_0x1eb3da){while(--_0x1eb3da){_0x275d56['push'](_0x275d56['shift']());}};_0x1510b6(++_0xba06a3);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb9a7[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index f611807..b7dc584 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 _0xadad=['toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','gotoif','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','[%s][calls][newchannel]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','transfer','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','destinationchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x5c661c,_0x998ebb){var _0x34c220=function(_0x46384b){while(--_0x46384b){_0x5c661c['push'](_0x5c661c['shift']());}};_0x34c220(++_0x998ebb);}(_0xadad,0x6d));var _0xdada=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0xadad[_0x562ec5];return _0x279c8c;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0xdada('0x0'),'FAILED',_0xdada('0x1'),'NO\x20ANSWER',_0xdada('0x1'),_0xdada('0x2'),_0xdada('0x3'),_0xdada('0x0'),_0xdada('0x0'),_0xdada('0x0')];var channels={};function writeDB(_0x42d321){utils[_0xdada('0x4')](util[_0xdada('0x5')](_0xdada('0x6'),_0x42d321[_0xdada('0x7')],_0x42d321[_0xdada('0x8')],_0x42d321[_0xdada('0x9')],_0x42d321[_0xdada('0xa')],_0x42d321[_0xdada('0xb')],_0x42d321[_0xdada('0xc')],_0x42d321[_0xdada('0xd')],_0x42d321[_0xdada('0xe')]));if(_0x42d321[_0xdada('0xf')]){utils[_0xdada('0x10')](_0x42d321[_0xdada('0xf')])[_0xdada('0x11')](function(_0x1cd61c){if(_0x1cd61c){_0x42d321[_0xdada('0x12')]=_0x1cd61c['id'];}utils[_0xdada('0x13')](_0xdada('0x14'),_0x42d321);});}else{utils['request']('CreateVoiceCallReport',_0x42d321);}if(channels[_0x42d321[_0xdada('0x7')]]){delete channels[_0x42d321['uniqueid']];}}exports[_0xdada('0x15')]=function(_0x1d6671){try{utils[_0xdada('0x16')](util[_0xdada('0x5')]('[%s][calls][newchannel]',_0x1d6671['uniqueid']),_0x1d6671);if(_0x1d6671['uniqueid']==_0x1d6671[_0xdada('0x17')]&&_0x1d6671[_0xdada('0x8')]!=_0xdada('0x18')){utils[_0xdada('0x4')](util[_0xdada('0x5')](_0xdada('0x19'),_0x1d6671['uniqueid'],_0x1d6671['context'],_0x1d6671[_0xdada('0x1a')]));channels[_0x1d6671[_0xdada('0x7')]]={'uniqueid':_0x1d6671[_0xdada('0x7')],'accountcode':_0x1d6671[_0xdada('0xf')],'source':_0x1d6671[_0xdada('0xc')],'destination':_0x1d6671[_0xdada('0x1a')],'destinationcontext':_0x1d6671[_0xdada('0x1b')],'channel':_0x1d6671[_0xdada('0x8')],'starttime':utils[_0xdada('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xdada('0x1d')};}}catch(_0x11302f){utils[_0xdada('0x1e')](util[_0xdada('0x5')](_0xdada('0x1f'),_0x1d6671[_0xdada('0x7')]),_0x11302f);}};exports['newstate']=function(_0x3b12ff){try{utils[_0xdada('0x16')](util['format']('[%s][calls][newstate]',_0x3b12ff['uniqueid']),_0x3b12ff);if(!_['isNil'](channels[_0x3b12ff[_0xdada('0x7')]])&&_0x3b12ff[_0xdada('0x20')]==0x6){utils['info'](util[_0xdada('0x5')](_0xdada('0x21'),_0x3b12ff[_0xdada('0x7')],_0x3b12ff[_0xdada('0x1b')],_0x3b12ff[_0xdada('0x8')]));if(_[_0xdada('0x22')](channels[_0x3b12ff[_0xdada('0x7')]][_0xdada('0x23')])){channels[_0x3b12ff['uniqueid']]['systemanswertime']=utils[_0xdada('0x1c')]();}}else if(!_['isNil'](channels[_0x3b12ff['linkedid']])&&_0x3b12ff['channelstate']==0x6&&_0x3b12ff['context']!=_0xdada('0x24')){utils[_0xdada('0x4')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3b12ff[_0xdada('0x7')],_0x3b12ff[_0xdada('0x17')],_0x3b12ff[_0xdada('0x1b')],_0x3b12ff['channel']));channels[_0x3b12ff[_0xdada('0x17')]]['accountcode']=_0x3b12ff[_0xdada('0xf')];channels[_0x3b12ff[_0xdada('0x17')]]['destinationchannel']=_0x3b12ff['channel'];if(_[_0xdada('0x22')](channels[_0x3b12ff[_0xdada('0x17')]][_0xdada('0x25')])){channels[_0x3b12ff[_0xdada('0x17')]][_0xdada('0x25')]=utils[_0xdada('0x1c')]();}channels[_0x3b12ff['linkedid']][_0xdada('0x26')]=dispositions[_[_0xdada('0x27')](_0x3b12ff[_0xdada('0x20')])]||_0xdada('0x2');}}catch(_0x419126){utils['error'](util[_0xdada('0x5')]('[%s][calls][newstate]',_0x3b12ff[_0xdada('0x7')]),_0x419126);}};exports[_0xdada('0x28')]=function(_0x30ac48){try{if(!_[_0xdada('0x22')](channels[_0x30ac48[_0xdada('0x7')]])){utils[_0xdada('0x16')](util[_0xdada('0x5')](_0xdada('0x29'),_0x30ac48[_0xdada('0x7')]),_0x30ac48);if(_[_0xdada('0x22')](channels[_0x30ac48[_0xdada('0x7')]][_0xdada('0x2a')])){channels[_0x30ac48['uniqueid']][_0xdada('0x2a')]=_0x30ac48[_0xdada('0x2b')]+'\x20<'+_0x30ac48[_0xdada('0xc')]+'>';}utils[_0xdada('0x4')](util['format'](_0xdada('0x2c'),_0x30ac48[_0xdada('0x7')],channels[_0x30ac48[_0xdada('0x7')]]['callerid'],_0x30ac48['cause-txt']));channels[_0x30ac48[_0xdada('0x7')]][_0xdada('0x2d')]=utils['now']();channels[_0x30ac48[_0xdada('0x7')]]['duration']=utils['diffTime'](channels[_0x30ac48[_0xdada('0x7')]][_0xdada('0x2d')],channels[_0x30ac48['uniqueid']][_0xdada('0x2e')]);channels[_0x30ac48['uniqueid']][_0xdada('0x2f')]=channels[_0x30ac48['uniqueid']][_0xdada('0x25')]?utils['diffTime'](channels[_0x30ac48[_0xdada('0x7')]][_0xdada('0x2d')],channels[_0x30ac48['uniqueid']]['answertime']):0x0;writeDB(channels[_0x30ac48['uniqueid']]);}}catch(_0x1a9624){utils['error'](util[_0xdada('0x5')](_0xdada('0x29'),_0x30ac48['uniqueid']),_0x1a9624);}};exports[_0xdada('0x30')]=function(_0x4842cb){try{if(!_[_0xdada('0x22')](channels[_0x4842cb[_0xdada('0x31')]])){utils['debug'](util['format'](_0xdada('0x32'),_0x4842cb[_0xdada('0x33')]),_0x4842cb);if(channels[_0x4842cb[_0xdada('0x31')]][_0xdada('0x8')]==_0x4842cb['transfereechannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4842cb[_0xdada('0x33')],_0x4842cb['localtwolinkedid'],_0x4842cb[_0xdada('0x34')]));channels[_0x4842cb[_0xdada('0x31')]]['destinationchannel']=_0x4842cb[_0xdada('0x34')];channels[_0x4842cb[_0xdada('0x31')]][_0xdada('0x35')]=_0xdada('0x36');}else if(channels[_0x4842cb[_0xdada('0x31')]][_0xdada('0x8')]=_0x4842cb[_0xdada('0x37')]){utils[_0xdada('0x4')](util[_0xdada('0x5')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x4842cb[_0xdada('0x33')],_0x4842cb[_0xdada('0x31')],_0x4842cb['origtransfererchannel']));channels[_0x4842cb['localtwolinkedid']][_0xdada('0x38')]=_0x4842cb[_0xdada('0x39')];channels[_0x4842cb[_0xdada('0x31')]][_0xdada('0x35')]=_0xdada('0x36');}}}catch(_0x46c5c6){utils[_0xdada('0x1e')](util[_0xdada('0x5')](_0xdada('0x32'),_0x4842cb[_0xdada('0x33')]),_0x46c5c6);}};exports['musiconholdstart']=function(_0x3ba124){try{if(!_['isNil'](channels[_0x3ba124[_0xdada('0x7')]])){utils[_0xdada('0x16')](util[_0xdada('0x5')](_0xdada('0x3a'),_0x3ba124[_0xdada('0x7')]),_0x3ba124);channels[_0x3ba124[_0xdada('0x7')]][_0xdada('0x3b')]=utils[_0xdada('0x1c')]();utils[_0xdada('0x4')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3ba124[_0xdada('0x7')],channels[_0x3ba124[_0xdada('0x7')]][_0xdada('0x3b')]));}}catch(_0x361d33){utils[_0xdada('0x1e')](util[_0xdada('0x5')](_0xdada('0x3a'),_0x3ba124[_0xdada('0x7')]),_0x361d33);}};exports[_0xdada('0x3c')]=function(_0x549b2c){try{if(!_[_0xdada('0x22')](channels[_0x549b2c[_0xdada('0x7')]])){utils[_0xdada('0x16')](util[_0xdada('0x5')](_0xdada('0x3d'),_0x549b2c['uniqueid']),_0x549b2c);if(!_[_0xdada('0x22')](channels[_0x549b2c['uniqueid']][_0xdada('0x3b')])){channels[_0x549b2c[_0xdada('0x7')]][_0xdada('0x3e')]+=utils[_0xdada('0x3f')](utils[_0xdada('0x1c')](),channels[_0x549b2c[_0xdada('0x7')]][_0xdada('0x3b')]);utils['info'](util[_0xdada('0x5')](_0xdada('0x40'),_0x549b2c[_0xdada('0x7')],channels[_0x549b2c[_0xdada('0x7')]]['mohtime']));delete channels[_0x549b2c[_0xdada('0x7')]][_0xdada('0x3b')];}}}catch(_0x1a6dd2){utils[_0xdada('0x1e')](util[_0xdada('0x5')]('[%s][calls][musiconholdstop]',_0x549b2c['uniqueid']),_0x1a6dd2);}};exports[_0xdada('0x41')]=function(_0x54eaf){try{if(!_[_0xdada('0x22')](channels[_0x54eaf[_0xdada('0x7')]])){utils[_0xdada('0x16')](util['format'](_0xdada('0x42'),_0x54eaf['uniqueid']),_0x54eaf);if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')]['xmd-originatecalleridnum'])){utils[_0xdada('0x4')](util[_0xdada('0x5')](_0xdada('0x44'),_0x54eaf['uniqueid'],_0x54eaf[_0xdada('0x45')]));channels[_0x54eaf['uniqueid']][_0xdada('0x46')]=_0x54eaf[_0xdada('0x45')];}if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x47')])){utils[_0xdada('0x4')](util['format'](_0xdada('0x48'),_0x54eaf[_0xdada('0x7')],_0x54eaf[_0xdada('0x45')]));channels[_0x54eaf['uniqueid']][_0xdada('0x49')]=_0x54eaf[_0xdada('0x45')];channels[_0x54eaf[_0xdada('0x7')]][_0xdada('0x2a')]='\x22'+_0x54eaf[_0xdada('0x45')]+'\x22\x20<'+_0x54eaf['value']+'>';}if(!_['isNil'](_0x54eaf['variable']['xmd-callerid-preview'])||!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x4a')])){utils[_0xdada('0x4')](util[_0xdada('0x5')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x54eaf[_0xdada('0x7')],!_['isNil'](_0x54eaf[_0xdada('0x43')][_0xdada('0x4b')])?'xmd-callerid-preview':'xmd-callerid',_0x54eaf[_0xdada('0x45')]));channels[_0x54eaf[_0xdada('0x7')]][_0xdada('0x2a')]=_0x54eaf[_0xdada('0x45')];}if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x4c')])||!_['isNil'](_0x54eaf['variable'][_0xdada('0x4d')])){utils[_0xdada('0x4')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x54eaf[_0xdada('0x7')],!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x4c')])?_0xdada('0x4c'):_0xdada('0x4d'),_0x54eaf[_0xdada('0x45')]));channels[_0x54eaf[_0xdada('0x7')]][_0xdada('0x4e')]=_0xdada('0x4f');channels[_0x54eaf[_0xdada('0x7')]][_0xdada('0x50')]=_0x54eaf['value'];channels[_0x54eaf[_0xdada('0x7')]]['queue']=!![];}if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')]['xmd-contactid'])){utils[_0xdada('0x4')](util[_0xdada('0x5')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x54eaf[_0xdada('0x7')],_0x54eaf['value']));channels[_0x54eaf[_0xdada('0x7')]][_0xdada('0x51')]=_0x54eaf[_0xdada('0x45')];}if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x52')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x54eaf[_0xdada('0x7')],_0x54eaf[_0xdada('0x45')]));channels[_0x54eaf['uniqueid']]['type']=_0x54eaf[_0xdada('0x45')];}if(!_[_0xdada('0x22')](_0x54eaf['variable']['outboundrouteid'])){utils[_0xdada('0x4')](util[_0xdada('0x5')](_0xdada('0x53'),_0x54eaf[_0xdada('0x7')],_0x54eaf['value']));channels[_0x54eaf[_0xdada('0x7')]]['routeid']=_0x54eaf[_0xdada('0x45')];}if(!_[_0xdada('0x22')](_0x54eaf[_0xdada('0x43')][_0xdada('0x54')])){utils[_0xdada('0x4')](util[_0xdada('0x5')](_0xdada('0x55'),_0x54eaf[_0xdada('0x7')],_0x54eaf['value']));channels[_0x54eaf['uniqueid']][_0xdada('0x54')]=_0x54eaf['value'];}}}catch(_0x5a170c){utils[_0xdada('0x1e')](util[_0xdada('0x5')](_0xdada('0x42'),_0x54eaf['uniqueid']),_0x5a170c);}};exports['newexten']=function(_0x417051){try{if(!_[_0xdada('0x22')](channels[_0x417051['uniqueid']])){utils[_0xdada('0x16')](util[_0xdada('0x5')](_0xdada('0x56'),_0x417051['uniqueid']),_0x417051);utils['info'](util['format'](_0xdada('0x57'),_0x417051[_0xdada('0x7')],_0x417051[_0xdada('0x58')],_0x417051['appdata']));if(_0x417051[_0xdada('0x58')][_0xdada('0x59')]()==_0xdada('0x5a')&&_[_0xdada('0x5b')](_0x417051[_0xdada('0x5c')][_0xdada('0x59')](),_0xdada('0x5d'))){var _0x3b6d3b=_0x417051[_0xdada('0x5c')][_0xdada('0x5e')]('=');var _0x2e7834=_0x3b6d3b[0x0][_0xdada('0x5f')](_0x3b6d3b[0x0][_0xdada('0x60')]('(')+0x1,_0x3b6d3b[0x0][_0xdada('0x60')](')'));var _0x258a34=_0x3b6d3b[0x1];channels[_0x417051['uniqueid']][_0x2e7834]=_0x258a34;}if(!_[_0xdada('0x61')]([_0xdada('0x28'),'noop','execif','set',_0xdada('0x62')],_0x417051[_0xdada('0x58')][_0xdada('0x59')]())){channels[_0x417051[_0xdada('0x7')]]['lastapplication']=_0x417051[_0xdada('0x58')];channels[_0x417051[_0xdada('0x7')]]['lastdata']=_0x417051[_0xdada('0x5c')];}}}catch(_0x26d300){utils[_0xdada('0x1e')](util[_0xdada('0x5')]('[%s][calls][newexten]',_0x417051[_0xdada('0x7')]),_0x26d300);}}; \ No newline at end of file +var _0x0629=['lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','gotoif','application','lastapplication','[%s][calls][newexten]','lodash','util','./utils','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','NO\x20ANSWER','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0629,0xed));var _0x9062=function(_0x4db8b7,_0x57e13d){_0x4db8b7=_0x4db8b7-0x0;var _0x57afa4=_0x0629[_0x4db8b7];return _0x57afa4;};'use strict';var _=require(_0x9062('0x0'));var util=require(_0x9062('0x1'));var utils=require(_0x9062('0x2'));var dispositions=['NO\x20ANSWER',_0x9062('0x3'),_0x9062('0x3'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER',_0x9062('0x4'),_0x9062('0x5'),_0x9062('0x3'),_0x9062('0x3'),_0x9062('0x3')];var channels={};function writeDB(_0x2caf95){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x8'),_0x2caf95[_0x9062('0x9')],_0x2caf95[_0x9062('0xa')],_0x2caf95[_0x9062('0xb')],_0x2caf95[_0x9062('0xc')],_0x2caf95[_0x9062('0xd')],_0x2caf95['calleridnum'],_0x2caf95[_0x9062('0xe')],_0x2caf95['lastevent']));if(_0x2caf95[_0x9062('0xf')]){utils['getUserByInternal'](_0x2caf95[_0x9062('0xf')])[_0x9062('0x10')](function(_0x49d5eb){if(_0x49d5eb){_0x2caf95[_0x9062('0x11')]=_0x49d5eb['id'];}utils[_0x9062('0x12')](_0x9062('0x13'),_0x2caf95);});}else{utils['request'](_0x9062('0x13'),_0x2caf95);}if(channels[_0x2caf95[_0x9062('0x9')]]){delete channels[_0x2caf95[_0x9062('0x9')]];}}exports[_0x9062('0x14')]=function(_0x5a003d){try{utils[_0x9062('0x15')](util[_0x9062('0x7')]('[%s][calls][newchannel]',_0x5a003d[_0x9062('0x9')]),_0x5a003d);if(_0x5a003d[_0x9062('0x9')]==_0x5a003d['linkedid']&&_0x5a003d[_0x9062('0xa')]!='OutgoingSpoolFailed'){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x16'),_0x5a003d[_0x9062('0x9')],_0x5a003d[_0x9062('0x17')],_0x5a003d[_0x9062('0x18')]));channels[_0x5a003d[_0x9062('0x9')]]={'uniqueid':_0x5a003d[_0x9062('0x9')],'accountcode':_0x5a003d[_0x9062('0xf')],'source':_0x5a003d[_0x9062('0x19')],'destination':_0x5a003d[_0x9062('0x18')],'destinationcontext':_0x5a003d[_0x9062('0x17')],'channel':_0x5a003d[_0x9062('0xa')],'starttime':utils[_0x9062('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x9062('0x1b'),'amaflags':'DOCUMENTATION'};}}catch(_0x265b79){utils[_0x9062('0x1c')](util[_0x9062('0x7')](_0x9062('0x1d'),_0x5a003d[_0x9062('0x9')]),_0x265b79);}};exports[_0x9062('0x1e')]=function(_0x1f0db5){try{utils[_0x9062('0x15')](util[_0x9062('0x7')](_0x9062('0x1f'),_0x1f0db5[_0x9062('0x9')]),_0x1f0db5);if(!_[_0x9062('0x20')](channels[_0x1f0db5[_0x9062('0x9')]])&&_0x1f0db5[_0x9062('0x21')]==0x6){utils['info'](util[_0x9062('0x7')](_0x9062('0x22'),_0x1f0db5['uniqueid'],_0x1f0db5[_0x9062('0x17')],_0x1f0db5[_0x9062('0xa')]));if(_['isNil'](channels[_0x1f0db5[_0x9062('0x9')]]['systemanswertime'])){channels[_0x1f0db5[_0x9062('0x9')]]['systemanswertime']=utils['now']();}}else if(!_[_0x9062('0x20')](channels[_0x1f0db5[_0x9062('0x23')]])&&_0x1f0db5[_0x9062('0x21')]==0x6&&_0x1f0db5[_0x9062('0x17')]!=_0x9062('0x24')){utils[_0x9062('0x6')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1f0db5['uniqueid'],_0x1f0db5[_0x9062('0x23')],_0x1f0db5['context'],_0x1f0db5[_0x9062('0xa')]));channels[_0x1f0db5['linkedid']]['accountcode']=_0x1f0db5[_0x9062('0xf')];channels[_0x1f0db5['linkedid']][_0x9062('0x25')]=_0x1f0db5[_0x9062('0xa')];if(_['isNil'](channels[_0x1f0db5[_0x9062('0x23')]][_0x9062('0x26')])){channels[_0x1f0db5[_0x9062('0x23')]]['answertime']=utils[_0x9062('0x1a')]();}channels[_0x1f0db5['linkedid']][_0x9062('0x27')]=dispositions[_[_0x9062('0x28')](_0x1f0db5[_0x9062('0x21')])]||_0x9062('0x4');}}catch(_0x572d2a){utils[_0x9062('0x1c')](util['format'](_0x9062('0x1f'),_0x1f0db5['uniqueid']),_0x572d2a);}};exports[_0x9062('0x29')]=function(_0x399632){try{if(!_['isNil'](channels[_0x399632[_0x9062('0x9')]])){utils[_0x9062('0x15')](util[_0x9062('0x7')](_0x9062('0x2a'),_0x399632[_0x9062('0x9')]),_0x399632);if(_['isNil'](channels[_0x399632[_0x9062('0x9')]][_0x9062('0x2b')])){channels[_0x399632[_0x9062('0x9')]]['callerid']=_0x399632[_0x9062('0x2c')]+'\x20<'+_0x399632['calleridnum']+'>';}utils['info'](util['format'](_0x9062('0x2d'),_0x399632[_0x9062('0x9')],channels[_0x399632[_0x9062('0x9')]][_0x9062('0x2b')],_0x399632[_0x9062('0x2e')]));channels[_0x399632[_0x9062('0x9')]][_0x9062('0x2f')]=utils[_0x9062('0x1a')]();channels[_0x399632[_0x9062('0x9')]][_0x9062('0x30')]=utils['diffTime'](channels[_0x399632['uniqueid']][_0x9062('0x2f')],channels[_0x399632[_0x9062('0x9')]][_0x9062('0x31')]);channels[_0x399632[_0x9062('0x9')]][_0x9062('0x32')]=channels[_0x399632['uniqueid']]['answertime']?utils[_0x9062('0x33')](channels[_0x399632[_0x9062('0x9')]]['endtime'],channels[_0x399632['uniqueid']][_0x9062('0x26')]):0x0;writeDB(channels[_0x399632[_0x9062('0x9')]]);}}catch(_0x1ca68e){utils[_0x9062('0x1c')](util[_0x9062('0x7')](_0x9062('0x2a'),_0x399632[_0x9062('0x9')]),_0x1ca68e);}};exports[_0x9062('0x34')]=function(_0xa2b548){try{if(!_['isNil'](channels[_0xa2b548['localtwolinkedid']])){utils[_0x9062('0x15')](util['format'](_0x9062('0x35'),_0xa2b548[_0x9062('0x36')]),_0xa2b548);if(channels[_0xa2b548['localtwolinkedid']][_0x9062('0xa')]==_0xa2b548[_0x9062('0x37')]){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x38'),_0xa2b548[_0x9062('0x36')],_0xa2b548[_0x9062('0x39')],_0xa2b548[_0x9062('0x3a')]));channels[_0xa2b548[_0x9062('0x39')]][_0x9062('0x25')]=_0xa2b548[_0x9062('0x3a')];channels[_0xa2b548[_0x9062('0x39')]][_0x9062('0x3b')]='_attended';}else if(channels[_0xa2b548[_0x9062('0x39')]]['channel']=_0xa2b548[_0x9062('0x3c')]){utils[_0x9062('0x6')](util['format'](_0x9062('0x38'),_0xa2b548[_0x9062('0x36')],_0xa2b548[_0x9062('0x39')],_0xa2b548[_0x9062('0x3d')]));channels[_0xa2b548[_0x9062('0x39')]]['destinationchannel']=_0xa2b548[_0x9062('0x3d')];channels[_0xa2b548[_0x9062('0x39')]][_0x9062('0x3b')]=_0x9062('0x3e');}}}catch(_0x504466){utils[_0x9062('0x1c')](util['format'](_0x9062('0x35'),_0xa2b548['origtransfereruniqueid']),_0x504466);}};exports[_0x9062('0x3f')]=function(_0x5f5cba){try{if(!_['isNil'](channels[_0x5f5cba[_0x9062('0x9')]])){utils[_0x9062('0x15')](util[_0x9062('0x7')](_0x9062('0x40'),_0x5f5cba[_0x9062('0x9')]),_0x5f5cba);channels[_0x5f5cba[_0x9062('0x9')]][_0x9062('0x41')]=utils[_0x9062('0x1a')]();utils['info'](util[_0x9062('0x7')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x5f5cba[_0x9062('0x9')],channels[_0x5f5cba[_0x9062('0x9')]][_0x9062('0x41')]));}}catch(_0x872c36){utils[_0x9062('0x1c')](util[_0x9062('0x7')](_0x9062('0x40'),_0x5f5cba[_0x9062('0x9')]),_0x872c36);}};exports[_0x9062('0x42')]=function(_0x512e4b){try{if(!_[_0x9062('0x20')](channels[_0x512e4b[_0x9062('0x9')]])){utils[_0x9062('0x15')](util[_0x9062('0x7')]('[%s][calls][musiconholdstop]',_0x512e4b['uniqueid']),_0x512e4b);if(!_[_0x9062('0x20')](channels[_0x512e4b[_0x9062('0x9')]][_0x9062('0x41')])){channels[_0x512e4b[_0x9062('0x9')]]['mohtime']+=utils[_0x9062('0x33')](utils[_0x9062('0x1a')](),channels[_0x512e4b['uniqueid']][_0x9062('0x41')]);utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x43'),_0x512e4b[_0x9062('0x9')],channels[_0x512e4b['uniqueid']][_0x9062('0x44')]));delete channels[_0x512e4b['uniqueid']][_0x9062('0x41')];}}}catch(_0xf59e26){utils[_0x9062('0x1c')](util[_0x9062('0x7')]('[%s][calls][musiconholdstop]',_0x512e4b[_0x9062('0x9')]),_0xf59e26);}};exports[_0x9062('0x45')]=function(_0x3313d1){try{if(!_['isNil'](channels[_0x3313d1['uniqueid']])){utils[_0x9062('0x15')](util[_0x9062('0x7')](_0x9062('0x46'),_0x3313d1[_0x9062('0x9')]),_0x3313d1);if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')][_0x9062('0x48')])){utils['info'](util['format'](_0x9062('0x49'),_0x3313d1[_0x9062('0x9')],_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x4b')]=_0x3313d1[_0x9062('0x4a')];}if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')][_0x9062('0x4c')])){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x4d'),_0x3313d1[_0x9062('0x9')],_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x4e')]=_0x3313d1[_0x9062('0x4a')];channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x2b')]='\x22'+_0x3313d1[_0x9062('0x4a')]+'\x22\x20<'+_0x3313d1['value']+'>';}if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')][_0x9062('0x4f')])||!_['isNil'](_0x3313d1[_0x9062('0x47')]['xmd-callerid'])){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x50'),_0x3313d1[_0x9062('0x9')],!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')][_0x9062('0x4f')])?_0x9062('0x4f'):_0x9062('0x51'),_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x2b')]=_0x3313d1[_0x9062('0x4a')];}if(!_['isNil'](_0x3313d1[_0x9062('0x47')][_0x9062('0x52')])||!_['isNil'](_0x3313d1[_0x9062('0x47')][_0x9062('0x53')])){utils[_0x9062('0x6')](util[_0x9062('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x3313d1[_0x9062('0x9')],!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')]['xmd-queue'])?'xmd-queue':_0x9062('0x53'),_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]]['lastapplication']='Queue';channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x54')]=_0x3313d1[_0x9062('0x4a')];channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0xb')]=!![];}if(!_['isNil'](_0x3313d1[_0x9062('0x47')][_0x9062('0x55')])){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x56'),_0x3313d1[_0x9062('0x9')],_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]]['ContactId']=_0x3313d1['value'];}if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')][_0x9062('0x57')])){utils[_0x9062('0x6')](util[_0x9062('0x7')](_0x9062('0x58'),_0x3313d1[_0x9062('0x9')],_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]]['type']=_0x3313d1[_0x9062('0x4a')];}if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')]['outboundrouteid'])){utils['info'](util[_0x9062('0x7')](_0x9062('0x59'),_0x3313d1[_0x9062('0x9')],_0x3313d1['value']));channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x5a')]=_0x3313d1[_0x9062('0x4a')];}if(!_[_0x9062('0x20')](_0x3313d1[_0x9062('0x47')]['sipcallid'])){utils[_0x9062('0x6')](util['format'](_0x9062('0x5b'),_0x3313d1[_0x9062('0x9')],_0x3313d1[_0x9062('0x4a')]));channels[_0x3313d1[_0x9062('0x9')]][_0x9062('0x5c')]=_0x3313d1[_0x9062('0x4a')];}}}catch(_0x30b932){utils['error'](util['format'](_0x9062('0x46'),_0x3313d1[_0x9062('0x9')]),_0x30b932);}};exports[_0x9062('0x5d')]=function(_0x4d5eb6){try{if(!_['isNil'](channels[_0x4d5eb6[_0x9062('0x9')]])){utils['debug'](util[_0x9062('0x7')]('[%s][calls][newexten]',_0x4d5eb6[_0x9062('0x9')]),_0x4d5eb6);utils['info'](util[_0x9062('0x7')](_0x9062('0x5e'),_0x4d5eb6[_0x9062('0x9')],_0x4d5eb6['application'],_0x4d5eb6[_0x9062('0x5f')]));if(_0x4d5eb6['application'][_0x9062('0x60')]()==_0x9062('0x61')&&_[_0x9062('0x62')](_0x4d5eb6[_0x9062('0x5f')][_0x9062('0x60')](),_0x9062('0x63'))){var _0xaaa14e=_0x4d5eb6[_0x9062('0x5f')]['split']('=');var _0x42367b=_0xaaa14e[0x0][_0x9062('0x64')](_0xaaa14e[0x0]['lastIndexOf']('(')+0x1,_0xaaa14e[0x0][_0x9062('0x65')](')'));var _0x4211ce=_0xaaa14e[0x1];channels[_0x4d5eb6[_0x9062('0x9')]][_0x42367b]=_0x4211ce;}if(!_[_0x9062('0x66')]([_0x9062('0x29'),'noop','execif',_0x9062('0x61'),_0x9062('0x67')],_0x4d5eb6[_0x9062('0x68')][_0x9062('0x60')]())){channels[_0x4d5eb6[_0x9062('0x9')]][_0x9062('0x69')]=_0x4d5eb6['application'];channels[_0x4d5eb6[_0x9062('0x9')]][_0x9062('0x54')]=_0x4d5eb6[_0x9062('0x5f')];}}}catch(_0x423451){utils[_0x9062('0x1c')](util[_0x9062('0x7')](_0x9062('0x6a'),_0x4d5eb6['uniqueid']),_0x423451);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c4e0b0a..9eb20f9 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 _0x4b39=['[core]\x20fullybooted','error','[core]\x20error','managerevent','info','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x538790,_0x1d71a9){var _0x41d133=function(_0x2cfc54){while(--_0x2cfc54){_0x538790['push'](_0x538790['shift']());}};_0x41d133(++_0x1d71a9);}(_0x4b39,0x64));var _0x94b3=function(_0xedf8c,_0x18813b){_0xedf8c=_0xedf8c-0x0;var _0x2320be=_0x4b39[_0xedf8c];return _0x2320be;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x94b3('0x0')]('[core]\x20connected');};exports[_0x94b3('0x1')]=function(){utils[_0x94b3('0x0')](_0x94b3('0x2'));};exports[_0x94b3('0x3')]=function(){utils[_0x94b3('0x0')](_0x94b3('0x4'));};exports[_0x94b3('0x5')]=function(_0x4b5393){utils[_0x94b3('0x5')](_0x94b3('0x6'),_0x4b5393);};exports['close']=function(){utils[_0x94b3('0x0')]('[core]\x20close');};exports[_0x94b3('0x7')]=function(_0xe266b6){}; \ No newline at end of file +var _0x4ac7=['[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','shutdown','fullybooted','error'];(function(_0x5a3ca4,_0x9a74e9){var _0x470ff8=function(_0x331d34){while(--_0x331d34){_0x5a3ca4['push'](_0x5a3ca4['shift']());}};_0x470ff8(++_0x9a74e9);}(_0x4ac7,0x16c));var _0x74ac=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x4ac7[_0x36eaaa];return _0x461349;};'use strict';var utils=require('./utils');exports[_0x74ac('0x0')]=function(){utils[_0x74ac('0x1')](_0x74ac('0x2'));};exports[_0x74ac('0x3')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x74ac('0x4')]=function(){utils[_0x74ac('0x1')]('[core]\x20fullybooted');};exports[_0x74ac('0x5')]=function(_0x4ee90f){utils['error'](_0x74ac('0x6'),_0x4ee90f);};exports[_0x74ac('0x7')]=function(){utils[_0x74ac('0x1')](_0x74ac('0x8'));};exports[_0x74ac('0x9')]=function(_0x527a00){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6215b8f..7a8d6f3 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 _0x7fc0=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','cause-txt','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','./utils','info','format','channel','dialstring','connectedlinenum','dialstatus','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','isNil','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s'];(function(_0x1d705c,_0x19b331){var _0x4bf826=function(_0x4d7428){while(--_0x4d7428){_0x1d705c['push'](_0x1d705c['shift']());}};_0x4bf826(++_0x19b331);}(_0x7fc0,0x16f));var _0x07fc=function(_0x49efb2,_0x4b9081){_0x49efb2=_0x49efb2-0x0;var _0x2cd91b=_0x7fc0[_0x49efb2];return _0x2cd91b;};'use strict';var _=require(_0x07fc('0x0'));var util=require(_0x07fc('0x1'));var utils=require(_0x07fc('0x2'));var dials={};function writeDB(_0x1e649c){utils[_0x07fc('0x3')](util[_0x07fc('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x1e649c['uniqueid'],_0x1e649c[_0x07fc('0x5')],_0x1e649c[_0x07fc('0x6')],_0x1e649c['calleridnum'],_0x1e649c[_0x07fc('0x7')],_0x1e649c[_0x07fc('0x8')]));utils['request']('CreateVoiceDialReport',_0x1e649c);delete dials[_0x1e649c['uniqueid']];}exports[_0x07fc('0x9')]=function(_0x5d427f){try{utils[_0x07fc('0xa')](util[_0x07fc('0x4')](_0x07fc('0xb'),_0x5d427f[_0x07fc('0xc')]),_0x5d427f);utils[_0x07fc('0x3')](util[_0x07fc('0x4')](_0x07fc('0xd'),_0x5d427f[_0x07fc('0xc')],_0x5d427f[_0x07fc('0xe')],_0x5d427f['appdata']));if(_0x5d427f[_0x07fc('0xe')][_0x07fc('0xf')]()==_0x07fc('0x10')&&_[_0x07fc('0x11')](_0x5d427f[_0x07fc('0x12')]['toLowerCase'](),_0x07fc('0x13'))){var _0x4b8095=_0x5d427f[_0x07fc('0x12')]['split']('=');dials[_0x5d427f[_0x07fc('0xc')]]={'routeId':_0x4b8095[0x1]};}}catch(_0x5af1f8){utils[_0x07fc('0x14')](util[_0x07fc('0x4')](_0x07fc('0xb'),_0x5d427f[_0x07fc('0xc')]),_0x5af1f8);}};exports[_0x07fc('0x15')]=function(_0x27bfb6){try{utils[_0x07fc('0xa')](util[_0x07fc('0x4')](_0x07fc('0x16'),_0x27bfb6['uniqueid']),_0x27bfb6);if(!_['isNil'](_0x27bfb6[_0x07fc('0x17')][_0x07fc('0x18')])){utils['info'](util[_0x07fc('0x4')](_0x07fc('0x19'),_0x27bfb6[_0x07fc('0xc')],_0x27bfb6[_0x07fc('0x1a')]));dials[_0x27bfb6[_0x07fc('0xc')]]={'routeId':_0x27bfb6[_0x07fc('0x1a')]};}}catch(_0x557b62){utils['error'](util[_0x07fc('0x4')](_0x07fc('0x16'),_0x27bfb6[_0x07fc('0xc')]),_0x557b62);}};exports[_0x07fc('0x1b')]=function(_0x42293a){try{if(!_['isNil'](dials[_0x42293a[_0x07fc('0xc')]])){utils[_0x07fc('0xa')](util[_0x07fc('0x4')]('[%s][dials][dialbegin]',_0x42293a['uniqueid']),_0x42293a);dials[_0x42293a[_0x07fc('0xc')]]=_[_0x07fc('0x1c')](dials[_0x42293a[_0x07fc('0xc')]],_0x42293a);dials[_0x42293a[_0x07fc('0xc')]][_0x07fc('0x1d')]=utils[_0x07fc('0x1e')]();dials[_0x42293a['uniqueid']]['lastevent']='called';utils['info'](util[_0x07fc('0x4')](_0x07fc('0x1f'),_0x42293a[_0x07fc('0xc')],dials[_0x42293a[_0x07fc('0xc')]][_0x07fc('0x1d')]));}}catch(_0x227d1d){utils['error'](util[_0x07fc('0x4')](_0x07fc('0x20'),_0x42293a[_0x07fc('0xc')]),_0x227d1d);}};exports[_0x07fc('0x21')]=function(_0x144abd){try{if(!_[_0x07fc('0x22')](dials[_0x144abd[_0x07fc('0xc')]])){utils[_0x07fc('0xa')](util[_0x07fc('0x4')]('[%s][dials][dialend]',_0x144abd[_0x07fc('0xc')]),_0x144abd);dials[_0x144abd[_0x07fc('0xc')]][_0x07fc('0x8')]=_0x144abd[_0x07fc('0x8')];if(_0x144abd['dialstatus']==_0x07fc('0x23')){dials[_0x144abd[_0x07fc('0xc')]]=_[_0x07fc('0x1c')](dials[_0x144abd[_0x07fc('0xc')]],_0x144abd);dials[_0x144abd['uniqueid']][_0x07fc('0x24')]=utils['now']();dials[_0x144abd['uniqueid']][_0x07fc('0x25')]=_0x07fc('0x26');utils[_0x07fc('0x3')](util['format'](_0x07fc('0x27'),_0x144abd[_0x07fc('0xc')],_0x144abd[_0x07fc('0x8')],dials[_0x144abd[_0x07fc('0xc')]][_0x07fc('0x24')]));}else{utils['info'](util[_0x07fc('0x4')](_0x07fc('0x28'),_0x144abd[_0x07fc('0xc')],_0x144abd[_0x07fc('0x8')]));}}}catch(_0x18dc20){utils['error'](util[_0x07fc('0x4')]('[%s][dials][dialend]',_0x144abd['uniqueid']),_0x18dc20);}};exports['hangup']=function(_0x4f5dd9){try{if(!_[_0x07fc('0x22')](dials[_0x4f5dd9[_0x07fc('0xc')]])){utils[_0x07fc('0xa')](util[_0x07fc('0x4')](_0x07fc('0x29'),_0x4f5dd9[_0x07fc('0xc')]),_0x4f5dd9);utils[_0x07fc('0x3')](util['format'](_0x07fc('0x2a'),_0x4f5dd9['uniqueid'],_0x4f5dd9[_0x07fc('0x2b')],_0x4f5dd9[_0x07fc('0x2c')],_0x4f5dd9[_0x07fc('0x2d')]));dials[_0x4f5dd9[_0x07fc('0xc')]]=_[_0x07fc('0x1c')](dials[_0x4f5dd9[_0x07fc('0xc')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4f5dd9['uniqueid']][_0x07fc('0x2e')]=utils['diffTime'](dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x2f')],dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x1d')]);dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x30')]=utils[_0x07fc('0x31')](dials[_0x4f5dd9[_0x07fc('0xc')]]['answertime']||dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x2f')],dials[_0x4f5dd9[_0x07fc('0xc')]]['starttime']);dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x32')]=dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x24')]?utils[_0x07fc('0x31')](dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x2f')],dials[_0x4f5dd9[_0x07fc('0xc')]][_0x07fc('0x24')]):0x0;writeDB(dials[_0x4f5dd9['uniqueid']]);}}catch(_0x600b8e){utils[_0x07fc('0x14')](util[_0x07fc('0x4')](_0x07fc('0x29'),_0x4f5dd9[_0x07fc('0xc')]),_0x600b8e);}}; \ No newline at end of file +var _0xb1c3=['connectedlinenum','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr(routeid)','split','error','[%s][dials][newexten]','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','isNil','debug','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','answertime','now','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','calleridname','cause-txt','complete','diffTime','endtime','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum'];(function(_0x4893d0,_0x38f242){var _0x19b63d=function(_0x2f7b7e){while(--_0x2f7b7e){_0x4893d0['push'](_0x4893d0['shift']());}};_0x19b63d(++_0x38f242);}(_0xb1c3,0x160));var _0x3b1c=function(_0x3f8f53,_0x2262c5){_0x3f8f53=_0x3f8f53-0x0;var _0x4fe664=_0xb1c3[_0x3f8f53];return _0x4fe664;};'use strict';var _=require(_0x3b1c('0x0'));var util=require('util');var utils=require(_0x3b1c('0x1'));var dials={};function writeDB(_0x5cc757){utils[_0x3b1c('0x2')](util[_0x3b1c('0x3')](_0x3b1c('0x4'),_0x5cc757[_0x3b1c('0x5')],_0x5cc757[_0x3b1c('0x6')],_0x5cc757['dialstring'],_0x5cc757[_0x3b1c('0x7')],_0x5cc757[_0x3b1c('0x8')],_0x5cc757['dialstatus']));utils[_0x3b1c('0x9')](_0x3b1c('0xa'),_0x5cc757);delete dials[_0x5cc757[_0x3b1c('0x5')]];}exports[_0x3b1c('0xb')]=function(_0x3db5db){try{utils['debug'](util[_0x3b1c('0x3')]('[%s][dials][newexten]',_0x3db5db[_0x3b1c('0x5')]),_0x3db5db);utils['info'](util[_0x3b1c('0x3')](_0x3b1c('0xc'),_0x3db5db['uniqueid'],_0x3db5db['application'],_0x3db5db['appdata']));if(_0x3db5db[_0x3b1c('0xd')][_0x3b1c('0xe')]()==_0x3b1c('0xf')&&_['startsWith'](_0x3db5db[_0x3b1c('0x10')][_0x3b1c('0xe')](),_0x3b1c('0x11'))){var _0x5e40cf=_0x3db5db[_0x3b1c('0x10')][_0x3b1c('0x12')]('=');dials[_0x3db5db[_0x3b1c('0x5')]]={'routeId':_0x5e40cf[0x1]};}}catch(_0x39eb62){utils[_0x3b1c('0x13')](util[_0x3b1c('0x3')](_0x3b1c('0x14'),_0x3db5db[_0x3b1c('0x5')]),_0x39eb62);}};exports['varset']=function(_0x2b5374){try{utils['debug'](util['format'](_0x3b1c('0x15'),_0x2b5374[_0x3b1c('0x5')]),_0x2b5374);if(!_['isNil'](_0x2b5374['variable'][_0x3b1c('0x16')])){utils[_0x3b1c('0x2')](util[_0x3b1c('0x3')](_0x3b1c('0x17'),_0x2b5374[_0x3b1c('0x5')],_0x2b5374['value']));dials[_0x2b5374[_0x3b1c('0x5')]]={'routeId':_0x2b5374['value']};}}catch(_0x31e089){utils[_0x3b1c('0x13')](util['format'](_0x3b1c('0x15'),_0x2b5374[_0x3b1c('0x5')]),_0x31e089);}};exports['dialbegin']=function(_0x52d3be){try{if(!_[_0x3b1c('0x18')](dials[_0x52d3be[_0x3b1c('0x5')]])){utils[_0x3b1c('0x19')](util[_0x3b1c('0x3')](_0x3b1c('0x1a'),_0x52d3be[_0x3b1c('0x5')]),_0x52d3be);dials[_0x52d3be[_0x3b1c('0x5')]]=_[_0x3b1c('0x1b')](dials[_0x52d3be[_0x3b1c('0x5')]],_0x52d3be);dials[_0x52d3be[_0x3b1c('0x5')]][_0x3b1c('0x1c')]=utils['now']();dials[_0x52d3be[_0x3b1c('0x5')]][_0x3b1c('0x1d')]=_0x3b1c('0x1e');utils[_0x3b1c('0x2')](util['format'](_0x3b1c('0x1f'),_0x52d3be['uniqueid'],dials[_0x52d3be['uniqueid']]['starttime']));}}catch(_0x161a2a){utils[_0x3b1c('0x13')](util['format']('[%s][dials][dialbegin]',_0x52d3be[_0x3b1c('0x5')]),_0x161a2a);}};exports[_0x3b1c('0x20')]=function(_0x28f06a){try{if(!_[_0x3b1c('0x18')](dials[_0x28f06a[_0x3b1c('0x5')]])){utils['debug'](util[_0x3b1c('0x3')](_0x3b1c('0x21'),_0x28f06a[_0x3b1c('0x5')]),_0x28f06a);dials[_0x28f06a[_0x3b1c('0x5')]]['dialstatus']=_0x28f06a[_0x3b1c('0x22')];if(_0x28f06a[_0x3b1c('0x22')]=='ANSWER'){dials[_0x28f06a[_0x3b1c('0x5')]]=_['assign'](dials[_0x28f06a[_0x3b1c('0x5')]],_0x28f06a);dials[_0x28f06a[_0x3b1c('0x5')]][_0x3b1c('0x23')]=utils[_0x3b1c('0x24')]();dials[_0x28f06a[_0x3b1c('0x5')]][_0x3b1c('0x1d')]='connect';utils[_0x3b1c('0x2')](util[_0x3b1c('0x3')](_0x3b1c('0x25'),_0x28f06a[_0x3b1c('0x5')],_0x28f06a[_0x3b1c('0x22')],dials[_0x28f06a[_0x3b1c('0x5')]]['answertime']));}else{utils['info'](util[_0x3b1c('0x3')](_0x3b1c('0x26'),_0x28f06a['uniqueid'],_0x28f06a['dialstatus']));}}}catch(_0x57c4ec){utils[_0x3b1c('0x13')](util[_0x3b1c('0x3')](_0x3b1c('0x21'),_0x28f06a['uniqueid']),_0x57c4ec);}};exports['hangup']=function(_0xbd6c89){try{if(!_[_0x3b1c('0x18')](dials[_0xbd6c89[_0x3b1c('0x5')]])){utils[_0x3b1c('0x19')](util[_0x3b1c('0x3')](_0x3b1c('0x27'),_0xbd6c89[_0x3b1c('0x5')]),_0xbd6c89);utils[_0x3b1c('0x2')](util[_0x3b1c('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xbd6c89['uniqueid'],_0xbd6c89['calleridnum'],_0xbd6c89[_0x3b1c('0x28')],_0xbd6c89[_0x3b1c('0x29')]));dials[_0xbd6c89[_0x3b1c('0x5')]]=_[_0x3b1c('0x1b')](dials[_0xbd6c89['uniqueid']],{'endtime':utils[_0x3b1c('0x24')](),'lastevent':_0x3b1c('0x2a')});dials[_0xbd6c89['uniqueid']]['duration']=utils[_0x3b1c('0x2b')](dials[_0xbd6c89[_0x3b1c('0x5')]][_0x3b1c('0x2c')],dials[_0xbd6c89[_0x3b1c('0x5')]]['starttime']);dials[_0xbd6c89[_0x3b1c('0x5')]]['holdtime']=utils[_0x3b1c('0x2b')](dials[_0xbd6c89['uniqueid']][_0x3b1c('0x23')]||dials[_0xbd6c89[_0x3b1c('0x5')]][_0x3b1c('0x2c')],dials[_0xbd6c89[_0x3b1c('0x5')]][_0x3b1c('0x1c')]);dials[_0xbd6c89[_0x3b1c('0x5')]]['billableseconds']=dials[_0xbd6c89[_0x3b1c('0x5')]][_0x3b1c('0x23')]?utils[_0x3b1c('0x2b')](dials[_0xbd6c89[_0x3b1c('0x5')]]['endtime'],dials[_0xbd6c89[_0x3b1c('0x5')]]['answertime']):0x0;writeDB(dials[_0xbd6c89[_0x3b1c('0x5')]]);}}catch(_0xb73252){utils[_0x3b1c('0x13')](util[_0x3b1c('0x3')]('[%s][dials][hangup]',_0xbd6c89[_0x3b1c('0x5')]),_0xb73252);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 065498a..0993938 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 _0x7b8d=['agentringnoanswer','[%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]','musiconholdstop','[%s][index][musiconholdstop]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','../../config/environment','util','xdr','disabled','env','production','asterisk','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid'];(function(_0x19d291,_0x2358c4){var _0x440129=function(_0x502307){while(--_0x502307){_0x19d291['push'](_0x19d291['shift']());}};_0x440129(++_0x2358c4);}(_0x7b8d,0xfa));var _0xd7b8=function(_0x1f0d37,_0x583f04){_0x1f0d37=_0x1f0d37-0x0;var _0xb1ea10=_0x7b8d[_0x1f0d37];return _0xb1ea10;};var AsteriskManager=require('asterisk-manager');var config=require(_0xd7b8('0x0'));var utils=require('./utils');var util=require(_0xd7b8('0x1'));var isXDREnabled=config[_0xd7b8('0x2')]&&config[_0xd7b8('0x2')][_0xd7b8('0x3')]?!config[_0xd7b8('0x2')]['disabled']:!![];var isProduction=config[_0xd7b8('0x4')]===_0xd7b8('0x5')||![];var isLocalAsterisk=config[_0xd7b8('0x2')]&&config[_0xd7b8('0x2')]['local']===!![]||![];var ami=new AsteriskManager(config[_0xd7b8('0x6')]['port'],config[_0xd7b8('0x6')]['ip'],config[_0xd7b8('0x6')][_0xd7b8('0x7')],config[_0xd7b8('0x6')][_0xd7b8('0x8')],!![]);ami[_0xd7b8('0x9')]();if(!isXDREnabled){utils['info'](_0xd7b8('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xd7b8('0xb')](_0xd7b8('0xc'));}else{var agents=require(_0xd7b8('0xd'));var calls=require(_0xd7b8('0xe'));var queues=require('./queues.controller');var recordings=require(_0xd7b8('0xf'));var members=require(_0xd7b8('0x10'));var dials=require(_0xd7b8('0x11'));var transfers=require(_0xd7b8('0x12'));var core=require(_0xd7b8('0x13'));ami['on'](_0xd7b8('0x14'),core['connect']);ami['on']('shutdown',core[_0xd7b8('0x15')]);ami['on'](_0xd7b8('0x16'),core[_0xd7b8('0x16')]);ami['on'](_0xd7b8('0x17'),core[_0xd7b8('0x17')]);ami['on'](_0xd7b8('0x18'),core['close']);ami['on'](_0xd7b8('0x19'),core['managerevent']);ami['on'](_0xd7b8('0x1a'),function(_0x47f9c1){try{utils['debug'](util[_0xd7b8('0x1b')](_0xd7b8('0x1c'),_0x47f9c1[_0xd7b8('0x1d')]),_0x47f9c1);members[_0xd7b8('0x1a')](_0x47f9c1);}catch(_0xf08f84){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x1c'),_0x47f9c1['device']),_0xf08f84);}});ami['on'](_0xd7b8('0x1e'),function(_0x85499e){try{utils[_0xd7b8('0x1f')](util['format'](_0xd7b8('0x20'),_0x85499e['uniqueid']),_0x85499e);agents[_0xd7b8('0x1e')](_0x85499e);}catch(_0x138201){utils[_0xd7b8('0x17')](util['format'](_0xd7b8('0x20'),_0x85499e[_0xd7b8('0x21')]),_0x138201);}});ami['on'](_0xd7b8('0x22'),function(_0x4904be){try{utils[_0xd7b8('0x1f')](util['format'](_0xd7b8('0x23'),_0x4904be[_0xd7b8('0x21')]),_0x4904be);agents[_0xd7b8('0x22')](_0x4904be);}catch(_0x27208f){utils[_0xd7b8('0x17')](util['format'](_0xd7b8('0x23'),_0x4904be[_0xd7b8('0x21')]),_0x27208f);}});ami['on']('agentconnect',function(_0x5d4d35){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')]('[%s][index][agentconnect]',_0x5d4d35['uniqueid']),_0x5d4d35);agents[_0xd7b8('0x24')](_0x5d4d35);queues[_0xd7b8('0x24')](_0x5d4d35);}catch(_0x41eed7){utils['error'](util['format'](_0xd7b8('0x25'),_0x5d4d35[_0xd7b8('0x21')]),_0x41eed7);}});ami['on'](_0xd7b8('0x26'),function(_0x328d4d){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')]('[%s][index][agentcomplete]',_0x328d4d['uniqueid']),_0x328d4d);agents['agentcomplete'](_0x328d4d);queues[_0xd7b8('0x26')](_0x328d4d);members[_0xd7b8('0x26')](_0x328d4d);}catch(_0x2e8869){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x27'),_0x328d4d[_0xd7b8('0x21')]),_0x2e8869);}});ami['on'](_0xd7b8('0x28'),function(_0x2fe191){try{utils['debug'](util['format'](_0xd7b8('0x29'),_0x2fe191['uniqueid']),_0x2fe191);agents[_0xd7b8('0x28')](_0x2fe191);queues[_0xd7b8('0x28')](_0x2fe191);}catch(_0x5dabf5){utils['error'](util[_0xd7b8('0x1b')](_0xd7b8('0x29'),_0x2fe191['uniqueid']),_0x5dabf5);}});ami['on'](_0xd7b8('0x2a'),function(_0x20fea8){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')](_0xd7b8('0x2b'),_0x20fea8[_0xd7b8('0x21')]),_0x20fea8);queues['queuecallerjoin'](_0x20fea8);recordings[_0xd7b8('0x2a')](_0x20fea8);}catch(_0x5db850){utils['error'](util[_0xd7b8('0x1b')](_0xd7b8('0x2b'),_0x20fea8[_0xd7b8('0x21')]),_0x5db850);}});ami['on'](_0xd7b8('0x2c'),function(_0x3c0562){try{utils['debug'](util[_0xd7b8('0x1b')](_0xd7b8('0x2d'),_0x3c0562[_0xd7b8('0x21')]),_0x3c0562);queues[_0xd7b8('0x2c')](_0x3c0562);}catch(_0x59a8a8){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x2d'),_0x3c0562[_0xd7b8('0x21')]),_0x59a8a8);}});ami['on'](_0xd7b8('0x2e'),function(_0x1e150){try{utils['debug'](util[_0xd7b8('0x1b')](_0xd7b8('0x2f'),_0x1e150[_0xd7b8('0x21')]),_0x1e150);queues['musiconholdstart'](_0x1e150);calls['musiconholdstart'](_0x1e150);}catch(_0x15226b){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x2f'),_0x1e150[_0xd7b8('0x21')]),_0x15226b);}});ami['on'](_0xd7b8('0x30'),function(_0x5b102){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')](_0xd7b8('0x31'),_0x5b102[_0xd7b8('0x21')]),_0x5b102);queues[_0xd7b8('0x30')](_0x5b102);calls[_0xd7b8('0x30')](_0x5b102);}catch(_0x2edd13){utils[_0xd7b8('0x17')](util['format'](_0xd7b8('0x31'),_0x5b102[_0xd7b8('0x21')]),_0x2edd13);}});ami['on'](_0xd7b8('0x32'),function(_0x806ad){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')]('[%s][index][newstate]',_0x806ad[_0xd7b8('0x21')]),_0x806ad);calls[_0xd7b8('0x32')](_0x806ad);recordings[_0xd7b8('0x32')](_0x806ad);}catch(_0x1faade){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')]('[%s][index][newstate]',_0x806ad[_0xd7b8('0x21')]),_0x1faade);}});ami['on'](_0xd7b8('0x33'),function(_0xf8e164){try{utils['debug'](util['format'](_0xd7b8('0x34'),_0xf8e164[_0xd7b8('0x21')]),_0xf8e164);calls['hangup'](_0xf8e164);recordings[_0xd7b8('0x33')](_0xf8e164);dials[_0xd7b8('0x33')](_0xf8e164);agents[_0xd7b8('0x33')](_0xf8e164);queues[_0xd7b8('0x33')](_0xf8e164);}catch(_0x233753){utils['error'](util[_0xd7b8('0x1b')](_0xd7b8('0x34'),_0xf8e164[_0xd7b8('0x21')]),_0x233753);}});ami['on'](_0xd7b8('0x35'),function(_0x2c84da){try{utils['debug'](util['format'](_0xd7b8('0x36'),_0x2c84da['uniqueid']),_0x2c84da);members['cdr'](_0x2c84da);}catch(_0x15ee52){utils['error'](util[_0xd7b8('0x1b')](_0xd7b8('0x36'),_0x2c84da[_0xd7b8('0x21')]),_0x15ee52);}});ami['on'](_0xd7b8('0x37'),function(_0x1a4906){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')](_0xd7b8('0x38'),_0x1a4906[_0xd7b8('0x21')]),_0x1a4906);queues[_0xd7b8('0x37')](_0x1a4906);agents['blindtransfer'](_0x1a4906);transfers[_0xd7b8('0x37')](_0x1a4906);}catch(_0x465fd8){utils['error'](util['format'](_0xd7b8('0x38'),_0x1a4906[_0xd7b8('0x21')]),_0x465fd8);}});ami['on'](_0xd7b8('0x39'),function(_0x19425b){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')](_0xd7b8('0x3a'),_0x19425b['origtransfereruniqueid']),_0x19425b);queues[_0xd7b8('0x39')](_0x19425b);transfers[_0xd7b8('0x39')](_0x19425b);agents['attendedtransfer'](_0x19425b);calls['attendedtransfer'](_0x19425b);}catch(_0x5bded6){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x3a'),_0x19425b[_0xd7b8('0x3b')]),_0x5bded6);}});ami['on'](_0xd7b8('0x3c'),function(_0x420029){try{utils[_0xd7b8('0x1f')](util[_0xd7b8('0x1b')](_0xd7b8('0x3d'),_0x420029['uniqueid']),_0x420029);queues[_0xd7b8('0x3c')](_0x420029);recordings[_0xd7b8('0x3c')](_0x420029);calls[_0xd7b8('0x3c')](_0x420029);dials[_0xd7b8('0x3c')](_0x420029);}catch(_0x350523){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')]('[%s][index][varset]',_0x420029['uniqueid']),_0x350523);}});ami['on'](_0xd7b8('0x3e'),function(_0x1d82fc){try{utils[_0xd7b8('0x1f')](util['format']('[%s][index][newexten]',_0x1d82fc[_0xd7b8('0x21')]),_0x1d82fc);calls['newexten'](_0x1d82fc);recordings[_0xd7b8('0x3e')](_0x1d82fc);dials[_0xd7b8('0x3e')](_0x1d82fc);}catch(_0xb4bfa0){utils[_0xd7b8('0x17')](util['format'](_0xd7b8('0x3f'),_0x1d82fc['uniqueid']),_0xb4bfa0);}});ami['on'](_0xd7b8('0x40'),function(_0x9e1453){try{utils['debug'](util[_0xd7b8('0x1b')](_0xd7b8('0x41'),_0x9e1453['uniqueid']),_0x9e1453);calls['newchannel'](_0x9e1453);recordings[_0xd7b8('0x40')](_0x9e1453);}catch(_0x18538d){utils[_0xd7b8('0x17')](util['format'](_0xd7b8('0x41'),_0x9e1453[_0xd7b8('0x21')]),_0x18538d);}});ami['on'](_0xd7b8('0x42'),function(_0x306313){try{utils[_0xd7b8('0x1f')](util['format'](_0xd7b8('0x43'),_0x306313['uniqueid']),_0x306313);dials[_0xd7b8('0x42')](_0x306313);}catch(_0xf9ba41){utils[_0xd7b8('0x17')](util[_0xd7b8('0x1b')](_0xd7b8('0x44'),_0x306313[_0xd7b8('0x21')]),_0xf9ba41);}});ami['on']('dialend',function(_0x46bd87){try{utils[_0xd7b8('0x1f')](util['format'](_0xd7b8('0x45'),_0x46bd87[_0xd7b8('0x21')]),_0x46bd87);dials[_0xd7b8('0x46')](_0x46bd87);}catch(_0x475760){utils['error'](util['format']('[%s][index][dialend]',_0x46bd87[_0xd7b8('0x21')]),_0x475760);}});} \ No newline at end of file +var _0x1de8=['queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','local','port','asterisk','username','keepConnected','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]'];(function(_0x3ba422,_0x53303c){var _0x20b5dd=function(_0x10b8a7){while(--_0x10b8a7){_0x3ba422['push'](_0x3ba422['shift']());}};_0x20b5dd(++_0x53303c);}(_0x1de8,0x1c4));var _0x81de=function(_0x21a2b3,_0x5d6564){_0x21a2b3=_0x21a2b3-0x0;var _0x4651a7=_0x1de8[_0x21a2b3];return _0x4651a7;};var AsteriskManager=require(_0x81de('0x0'));var config=require(_0x81de('0x1'));var utils=require(_0x81de('0x2'));var util=require(_0x81de('0x3'));var isXDREnabled=config[_0x81de('0x4')]&&config[_0x81de('0x4')][_0x81de('0x5')]?!config['xdr'][_0x81de('0x5')]:!![];var isProduction=config[_0x81de('0x6')]==='production'||![];var isLocalAsterisk=config[_0x81de('0x4')]&&config['xdr'][_0x81de('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x81de('0x8')],config[_0x81de('0x9')]['ip'],config[_0x81de('0x9')][_0x81de('0xa')],config[_0x81de('0x9')]['password'],!![]);ami[_0x81de('0xb')]();if(!isXDREnabled){utils[_0x81de('0xc')](_0x81de('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x81de('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x81de('0xe'));var calls=require(_0x81de('0xf'));var queues=require(_0x81de('0x10'));var recordings=require('./recordings.controller');var members=require(_0x81de('0x11'));var dials=require(_0x81de('0x12'));var transfers=require(_0x81de('0x13'));var core=require(_0x81de('0x14'));ami['on']('connect',core['connect']);ami['on'](_0x81de('0x15'),core[_0x81de('0x15')]);ami['on'](_0x81de('0x16'),core[_0x81de('0x16')]);ami['on']('error',core[_0x81de('0x17')]);ami['on'](_0x81de('0x18'),core[_0x81de('0x18')]);ami['on'](_0x81de('0x19'),core[_0x81de('0x19')]);ami['on'](_0x81de('0x1a'),function(_0x56293f){try{utils['debug'](util[_0x81de('0x1b')](_0x81de('0x1c'),_0x56293f[_0x81de('0x1d')]),_0x56293f);members[_0x81de('0x1a')](_0x56293f);}catch(_0x877743){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x1c'),_0x56293f[_0x81de('0x1d')]),_0x877743);}});ami['on'](_0x81de('0x1e'),function(_0x53928d){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x20'),_0x53928d[_0x81de('0x21')]),_0x53928d);agents[_0x81de('0x1e')](_0x53928d);}catch(_0x149185){utils['error'](util[_0x81de('0x1b')]('[%s][index][agentcalled]',_0x53928d['uniqueid']),_0x149185);}});ami['on']('agentringnoanswer',function(_0x320d53){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x22'),_0x320d53['uniqueid']),_0x320d53);agents[_0x81de('0x23')](_0x320d53);}catch(_0xfe6df7){utils[_0x81de('0x17')](util['format']('[%s][index][agentringnoanswer]',_0x320d53[_0x81de('0x21')]),_0xfe6df7);}});ami['on'](_0x81de('0x24'),function(_0x39cc3b){try{utils[_0x81de('0x1f')](util['format'](_0x81de('0x25'),_0x39cc3b['uniqueid']),_0x39cc3b);agents[_0x81de('0x24')](_0x39cc3b);queues[_0x81de('0x24')](_0x39cc3b);}catch(_0x42943e){utils['error'](util[_0x81de('0x1b')]('[%s][index][agentconnect]',_0x39cc3b['uniqueid']),_0x42943e);}});ami['on'](_0x81de('0x26'),function(_0x46fdcc){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x27'),_0x46fdcc[_0x81de('0x21')]),_0x46fdcc);agents[_0x81de('0x26')](_0x46fdcc);queues[_0x81de('0x26')](_0x46fdcc);members[_0x81de('0x26')](_0x46fdcc);}catch(_0x5d442f){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x27'),_0x46fdcc[_0x81de('0x21')]),_0x5d442f);}});ami['on']('queuecallerabandon',function(_0x49153b){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x28'),_0x49153b['uniqueid']),_0x49153b);agents[_0x81de('0x29')](_0x49153b);queues[_0x81de('0x29')](_0x49153b);}catch(_0x53c410){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x28'),_0x49153b[_0x81de('0x21')]),_0x53c410);}});ami['on'](_0x81de('0x2a'),function(_0x4a3561){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')]('[%s][index][queuecallerjoin]',_0x4a3561[_0x81de('0x21')]),_0x4a3561);queues[_0x81de('0x2a')](_0x4a3561);recordings[_0x81de('0x2a')](_0x4a3561);}catch(_0x1d3056){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x2b'),_0x4a3561['uniqueid']),_0x1d3056);}});ami['on']('queuecallerleave',function(_0x77a481){try{utils['debug'](util['format'](_0x81de('0x2c'),_0x77a481['uniqueid']),_0x77a481);queues[_0x81de('0x2d')](_0x77a481);}catch(_0x33e51d){utils[_0x81de('0x17')](util['format'](_0x81de('0x2c'),_0x77a481[_0x81de('0x21')]),_0x33e51d);}});ami['on'](_0x81de('0x2e'),function(_0x59d35d){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x2f'),_0x59d35d['uniqueid']),_0x59d35d);queues['musiconholdstart'](_0x59d35d);calls[_0x81de('0x2e')](_0x59d35d);}catch(_0x40a961){utils[_0x81de('0x17')](util['format']('[%s][index][musiconholdstart]',_0x59d35d['uniqueid']),_0x40a961);}});ami['on'](_0x81de('0x30'),function(_0x315f27){try{utils['debug'](util[_0x81de('0x1b')](_0x81de('0x31'),_0x315f27['uniqueid']),_0x315f27);queues[_0x81de('0x30')](_0x315f27);calls[_0x81de('0x30')](_0x315f27);}catch(_0x2ef28f){utils[_0x81de('0x17')](util['format'](_0x81de('0x31'),_0x315f27[_0x81de('0x21')]),_0x2ef28f);}});ami['on'](_0x81de('0x32'),function(_0x16787d){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x33'),_0x16787d['uniqueid']),_0x16787d);calls['newstate'](_0x16787d);recordings[_0x81de('0x32')](_0x16787d);}catch(_0x32bdfb){utils['error'](util[_0x81de('0x1b')](_0x81de('0x33'),_0x16787d[_0x81de('0x21')]),_0x32bdfb);}});ami['on'](_0x81de('0x34'),function(_0xe19b19){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')]('[%s][index][hangup]',_0xe19b19[_0x81de('0x21')]),_0xe19b19);calls[_0x81de('0x34')](_0xe19b19);recordings[_0x81de('0x34')](_0xe19b19);dials[_0x81de('0x34')](_0xe19b19);agents['hangup'](_0xe19b19);queues[_0x81de('0x34')](_0xe19b19);}catch(_0x217d7f){utils[_0x81de('0x17')](util[_0x81de('0x1b')]('[%s][index][hangup]',_0xe19b19[_0x81de('0x21')]),_0x217d7f);}});ami['on'](_0x81de('0x35'),function(_0x51d7c3){try{utils['debug'](util[_0x81de('0x1b')](_0x81de('0x36'),_0x51d7c3[_0x81de('0x21')]),_0x51d7c3);members[_0x81de('0x35')](_0x51d7c3);}catch(_0x42ab41){utils['error'](util[_0x81de('0x1b')]('[%s][index][cdr]',_0x51d7c3[_0x81de('0x21')]),_0x42ab41);}});ami['on']('blindtransfer',function(_0x54e476){try{utils[_0x81de('0x1f')](util['format'](_0x81de('0x37'),_0x54e476[_0x81de('0x21')]),_0x54e476);queues[_0x81de('0x38')](_0x54e476);agents[_0x81de('0x38')](_0x54e476);transfers[_0x81de('0x38')](_0x54e476);}catch(_0x3f67ac){utils['error'](util[_0x81de('0x1b')](_0x81de('0x37'),_0x54e476[_0x81de('0x21')]),_0x3f67ac);}});ami['on'](_0x81de('0x39'),function(_0x52948d){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x3a'),_0x52948d[_0x81de('0x3b')]),_0x52948d);queues[_0x81de('0x39')](_0x52948d);transfers['attendedtransfer'](_0x52948d);agents['attendedtransfer'](_0x52948d);calls[_0x81de('0x39')](_0x52948d);}catch(_0x14540d){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x3a'),_0x52948d[_0x81de('0x3b')]),_0x14540d);}});ami['on'](_0x81de('0x3c'),function(_0x79e8f){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x3d'),_0x79e8f[_0x81de('0x21')]),_0x79e8f);queues[_0x81de('0x3c')](_0x79e8f);recordings[_0x81de('0x3c')](_0x79e8f);calls[_0x81de('0x3c')](_0x79e8f);dials[_0x81de('0x3c')](_0x79e8f);}catch(_0x87307d){utils[_0x81de('0x17')](util['format'](_0x81de('0x3d'),_0x79e8f['uniqueid']),_0x87307d);}});ami['on'](_0x81de('0x3e'),function(_0xbf0e5){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x3f'),_0xbf0e5[_0x81de('0x21')]),_0xbf0e5);calls[_0x81de('0x3e')](_0xbf0e5);recordings[_0x81de('0x3e')](_0xbf0e5);dials[_0x81de('0x3e')](_0xbf0e5);}catch(_0x2a9b98){utils[_0x81de('0x17')](util['format'](_0x81de('0x3f'),_0xbf0e5['uniqueid']),_0x2a9b98);}});ami['on'](_0x81de('0x40'),function(_0x1d79e1){try{utils[_0x81de('0x1f')](util[_0x81de('0x1b')](_0x81de('0x41'),_0x1d79e1[_0x81de('0x21')]),_0x1d79e1);calls['newchannel'](_0x1d79e1);recordings[_0x81de('0x40')](_0x1d79e1);}catch(_0x48a015){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x41'),_0x1d79e1[_0x81de('0x21')]),_0x48a015);}});ami['on']('dialbegin',function(_0x33a578){try{utils['debug'](util[_0x81de('0x1b')](_0x81de('0x42'),_0x33a578[_0x81de('0x21')]),_0x33a578);dials[_0x81de('0x43')](_0x33a578);}catch(_0x597eb2){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x44'),_0x33a578[_0x81de('0x21')]),_0x597eb2);}});ami['on'](_0x81de('0x45'),function(_0x5e9269){try{utils['debug'](util[_0x81de('0x1b')](_0x81de('0x46'),_0x5e9269[_0x81de('0x21')]),_0x5e9269);dials[_0x81de('0x45')](_0x5e9269);}catch(_0x733aab){utils[_0x81de('0x17')](util[_0x81de('0x1b')](_0x81de('0x46'),_0x5e9269['uniqueid']),_0x733aab);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index da1271f..50b7831 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 _0x5562=['some','startsWith','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','agent','NOT_INUSE','isNil','now','duration','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','type','interface','getUserByInterface','membername','name','internal','request','CreateMemberReport','getUserByName','catch','error','[%s][members][writeDB]'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x5562,0x8b));var _0x2556=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x5562[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x2556('0x0'));var util=require(_0x2556('0x1'));var utils=require(_0x2556('0x2'));var members={};var exclude=[_0x2556('0x3'),_0x2556('0x4')];function writeDB(_0x5c8d2b){utils[_0x2556('0x5')](util[_0x2556('0x6')](_0x2556('0x7'),_0x5c8d2b[_0x2556('0x8')],_0x5c8d2b['interface'],_0x5c8d2b[_0x2556('0x9')],_0x5c8d2b[_0x2556('0xa')],_0x5c8d2b['membername'],_0x5c8d2b[_0x2556('0xb')]));if(_0x5c8d2b[_0x2556('0xc')]){utils[_0x2556('0xd')](_0x5c8d2b[_0x2556('0xc')])['then'](function(_0x142dc6){if(_0x142dc6){_0x5c8d2b[_0x2556('0xe')]=_0x142dc6[_0x2556('0xf')];_0x5c8d2b[_0x2556('0x10')]=_0x142dc6[_0x2556('0x10')];utils[_0x2556('0x11')](_0x2556('0x12'),_0x5c8d2b);}else{utils[_0x2556('0x13')](_0x5c8d2b[_0x2556('0xc')]['split']('/')[0x1])['then'](function(_0x215e9f){if(_0x215e9f){_0x5c8d2b[_0x2556('0xe')]=_0x215e9f[_0x2556('0xf')];_0x5c8d2b[_0x2556('0x10')]=_0x215e9f[_0x2556('0x10')];utils[_0x2556('0x11')](_0x2556('0x12'),_0x5c8d2b);}});}})[_0x2556('0x14')](function(_0x2c573a){utils[_0x2556('0x15')](util['format'](_0x2556('0x16'),_0x5c8d2b[_0x2556('0x8')]),_0x2c573a);});}delete members[_0x5c8d2b[_0x2556('0xc')]];}function startsWith(_0x444f21,_0x34fc69){return _[_0x2556('0x17')](_0x444f21,function(_0x12039a){return _[_0x2556('0x18')](_0x34fc69,_0x12039a);});}exports['devicestatechange']=function(_0x46c92a){try{utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x1a'),members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x8')]:_0x46c92a[_0x2556('0x1b')]),_0x46c92a);utils[_0x2556('0x5')](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x8')]:_0x46c92a[_0x2556('0x1b')],_0x46c92a[_0x2556('0x1c')],_0x46c92a[_0x2556('0x1b')]));switch(_0x46c92a[_0x2556('0x1c')]){case _0x2556('0x1d'):case _0x2556('0x1e'):if(!startsWith(exclude,_0x46c92a[_0x2556('0x1b')])){members[_0x46c92a[_0x2556('0x1b')]]={'channel':_0x2556('0x1f'),'interface':_0x46c92a[_0x2556('0x1b')],'type':_0x2556('0x20'),'enterAt':utils['now'](),'role':_0x2556('0x21')};}break;case _0x2556('0x22'):if(!_[_0x2556('0x23')](members[_0x46c92a[_0x2556('0x1b')]])){members[_0x46c92a[_0x2556('0x1b')]]['exitAt']=utils[_0x2556('0x24')]();members[_0x46c92a['device']][_0x2556('0x25')]=utils['diffTime'](members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x26')],members[_0x46c92a[_0x2556('0x1b')]][_0x2556('0x27')]);if(members[_0x46c92a['device']]['uniqueid']){writeDB(members[_0x46c92a[_0x2556('0x1b')]]);}}break;default:break;}}catch(_0x3c4726){utils[_0x2556('0x15')](util['format'](_0x2556('0x1a'),members[_0x46c92a[_0x2556('0x1b')]]?members[_0x46c92a[_0x2556('0x1b')]]['uniqueid']:_0x46c92a[_0x2556('0x1b')]),_0x3c4726);}};exports[_0x2556('0x28')]=function(_0x10a9a8){try{if(!_[_0x2556('0x23')](members[_0x10a9a8[_0x2556('0xc')]])){utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x29'),_0x10a9a8['uniqueid']),_0x10a9a8);utils['info'](util['format'](_0x2556('0x2a'),_0x10a9a8[_0x2556('0x8')],_0x10a9a8[_0x2556('0xc')],_0x10a9a8[_0x2556('0x2b')]));members[_0x10a9a8['interface']]=_[_0x2556('0x2c')](members[_0x10a9a8[_0x2556('0xc')]],{'data4':_0x10a9a8[_0x2556('0x2b')],'uniqueid':_0x10a9a8[_0x2556('0x8')]});}}catch(_0x58fca1){utils[_0x2556('0x15')](util[_0x2556('0x6')](_0x2556('0x29'),_0x10a9a8[_0x2556('0x8')]),_0x58fca1);}};exports[_0x2556('0x2d')]=function(_0x199f44){try{utils[_0x2556('0x19')](util[_0x2556('0x6')](_0x2556('0x2e'),_0x199f44[_0x2556('0x8')]),_0x199f44);if(_0x199f44[_0x2556('0x9')]){var _0x425b06=_0x199f44['channel'][_0x2556('0x2f')]('-')[0x0];if(!_['isNil'](members[_0x425b06])){members[_0x425b06]=_[_0x2556('0x2c')](members[_0x425b06],{'data1':members[_0x425b06][_0x2556('0x30')]||_0x199f44[_0x2556('0xb')],'data2':members[_0x425b06][_0x2556('0xa')]||_0x199f44[_0x2556('0x31')],'data3':members[_0x425b06][_0x2556('0x32')]||_0x199f44[_0x2556('0x33')],'uniqueid':members[_0x425b06][_0x2556('0x8')]||_0x199f44[_0x2556('0x8')]});utils['info'](util['format'](_0x2556('0x34'),_0x199f44[_0x2556('0x8')],members[_0x425b06][_0x2556('0x30')],members[_0x425b06][_0x2556('0xa')],members[_0x425b06][_0x2556('0x32')]));if(members[_0x425b06]['exitAt']){writeDB(members[_0x425b06]);}}}if(_0x199f44[_0x2556('0x35')]){var _0x5c238b=_0x199f44[_0x2556('0x35')]['split']('-')[0x0];if(!_[_0x2556('0x23')](members[_0x5c238b])){members[_0x5c238b]=_[_0x2556('0x2c')](members[_0x5c238b],{'data1':members[_0x5c238b]['data1']||_0x199f44[_0x2556('0xb')],'data2':members[_0x5c238b][_0x2556('0xa')]||_0x199f44['source'],'data3':members[_0x5c238b][_0x2556('0x32')]||_0x199f44[_0x2556('0x33')],'uniqueid':members[_0x5c238b][_0x2556('0x8')]||_0x199f44[_0x2556('0x8')]});utils['info'](util[_0x2556('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x199f44[_0x2556('0x8')],members[_0x5c238b]['data1'],members[_0x5c238b][_0x2556('0xa')],members[_0x5c238b][_0x2556('0x32')]));if(members[_0x5c238b][_0x2556('0x26')]){writeDB(members[_0x5c238b]);}}}}catch(_0x131496){utils['error'](util[_0x2556('0x6')]('[%s][members][cdr]',_0x199f44[_0x2556('0x8')]),_0x131496);}}; \ No newline at end of file +var _0xa7a3=['[%s][members][devicestatechange]','device','format','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','NOT_INUSE','isNil','exitAt','duration','enterAt','agentcomplete','debug','queue','assign','error','[%s][members][agentcomplete]','cdr','[%s][members][cdr]','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','split','request','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa7a3,0x7c));var _0x3a7a=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xa7a3[_0x172747];return _0x509692;};'use strict';var _=require(_0x3a7a('0x0'));var util=require(_0x3a7a('0x1'));var utils=require(_0x3a7a('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x3a7a('0x3')];function writeDB(_0x58b92d){utils[_0x3a7a('0x4')](util['format'](_0x3a7a('0x5'),_0x58b92d['uniqueid'],_0x58b92d[_0x3a7a('0x6')],_0x58b92d[_0x3a7a('0x7')],_0x58b92d[_0x3a7a('0x8')],_0x58b92d[_0x3a7a('0x9')],_0x58b92d[_0x3a7a('0xa')]));if(_0x58b92d[_0x3a7a('0x6')]){utils[_0x3a7a('0xb')](_0x58b92d[_0x3a7a('0x6')])[_0x3a7a('0xc')](function(_0x138c26){if(_0x138c26){_0x58b92d['membername']=_0x138c26[_0x3a7a('0xd')];_0x58b92d[_0x3a7a('0xe')]=_0x138c26['internal'];utils['request'](_0x3a7a('0xf'),_0x58b92d);}else{utils[_0x3a7a('0x10')](_0x58b92d[_0x3a7a('0x6')][_0x3a7a('0x11')]('/')[0x1])[_0x3a7a('0xc')](function(_0x1bfcc7){if(_0x1bfcc7){_0x58b92d['membername']=_0x1bfcc7['name'];_0x58b92d['internal']=_0x1bfcc7[_0x3a7a('0xe')];utils[_0x3a7a('0x12')]('CreateMemberReport',_0x58b92d);}});}})['catch'](function(_0x1218a0){utils['error'](util['format'](_0x3a7a('0x13'),_0x58b92d[_0x3a7a('0x14')]),_0x1218a0);});}delete members[_0x58b92d['interface']];}function startsWith(_0x55a31c,_0x28b8ce){return _['some'](_0x55a31c,function(_0x5e0370){return _[_0x3a7a('0x15')](_0x28b8ce,_0x5e0370);});}exports[_0x3a7a('0x16')]=function(_0x5d4d33){try{utils['debug'](util['format'](_0x3a7a('0x17'),members[_0x5d4d33[_0x3a7a('0x18')]]?members[_0x5d4d33[_0x3a7a('0x18')]]['uniqueid']:_0x5d4d33['device']),_0x5d4d33);utils['info'](util[_0x3a7a('0x19')](_0x3a7a('0x1a'),members[_0x5d4d33['device']]?members[_0x5d4d33[_0x3a7a('0x18')]][_0x3a7a('0x14')]:_0x5d4d33[_0x3a7a('0x18')],_0x5d4d33[_0x3a7a('0x1b')],_0x5d4d33[_0x3a7a('0x18')]));switch(_0x5d4d33[_0x3a7a('0x1b')]){case _0x3a7a('0x1c'):case'BUSY':if(!startsWith(exclude,_0x5d4d33['device'])){members[_0x5d4d33[_0x3a7a('0x18')]]={'channel':_0x3a7a('0x1d'),'interface':_0x5d4d33[_0x3a7a('0x18')],'type':_0x3a7a('0x1e'),'enterAt':utils[_0x3a7a('0x1f')](),'role':'agent'};}break;case _0x3a7a('0x20'):if(!_[_0x3a7a('0x21')](members[_0x5d4d33[_0x3a7a('0x18')]])){members[_0x5d4d33[_0x3a7a('0x18')]][_0x3a7a('0x22')]=utils[_0x3a7a('0x1f')]();members[_0x5d4d33[_0x3a7a('0x18')]][_0x3a7a('0x23')]=utils['diffTime'](members[_0x5d4d33[_0x3a7a('0x18')]]['exitAt'],members[_0x5d4d33['device']][_0x3a7a('0x24')]);if(members[_0x5d4d33[_0x3a7a('0x18')]][_0x3a7a('0x14')]){writeDB(members[_0x5d4d33[_0x3a7a('0x18')]]);}}break;default:break;}}catch(_0x2d60f5){utils['error'](util['format'](_0x3a7a('0x17'),members[_0x5d4d33['device']]?members[_0x5d4d33['device']][_0x3a7a('0x14')]:_0x5d4d33[_0x3a7a('0x18')]),_0x2d60f5);}};exports[_0x3a7a('0x25')]=function(_0xe04d13){try{if(!_['isNil'](members[_0xe04d13[_0x3a7a('0x6')]])){utils[_0x3a7a('0x26')](util[_0x3a7a('0x19')]('[%s][members][agentcomplete]',_0xe04d13[_0x3a7a('0x14')]),_0xe04d13);utils['info'](util[_0x3a7a('0x19')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0xe04d13[_0x3a7a('0x14')],_0xe04d13[_0x3a7a('0x6')],_0xe04d13[_0x3a7a('0x27')]));members[_0xe04d13[_0x3a7a('0x6')]]=_[_0x3a7a('0x28')](members[_0xe04d13[_0x3a7a('0x6')]],{'data4':_0xe04d13['queue'],'uniqueid':_0xe04d13[_0x3a7a('0x14')]});}}catch(_0x512a6d){utils[_0x3a7a('0x29')](util[_0x3a7a('0x19')](_0x3a7a('0x2a'),_0xe04d13[_0x3a7a('0x14')]),_0x512a6d);}};exports[_0x3a7a('0x2b')]=function(_0x151436){try{utils[_0x3a7a('0x26')](util[_0x3a7a('0x19')](_0x3a7a('0x2c'),_0x151436[_0x3a7a('0x14')]),_0x151436);if(_0x151436[_0x3a7a('0x7')]){var _0x1d82ae=_0x151436['channel'][_0x3a7a('0x11')]('-')[0x0];if(!_[_0x3a7a('0x21')](members[_0x1d82ae])){members[_0x1d82ae]=_[_0x3a7a('0x28')](members[_0x1d82ae],{'data1':members[_0x1d82ae]['data1']||_0x151436[_0x3a7a('0xa')],'data2':members[_0x1d82ae][_0x3a7a('0x8')]||_0x151436['source'],'data3':members[_0x1d82ae][_0x3a7a('0x2d')]||_0x151436['destination'],'uniqueid':members[_0x1d82ae][_0x3a7a('0x14')]||_0x151436[_0x3a7a('0x14')]});utils[_0x3a7a('0x4')](util['format'](_0x3a7a('0x2e'),_0x151436[_0x3a7a('0x14')],members[_0x1d82ae][_0x3a7a('0x2f')],members[_0x1d82ae][_0x3a7a('0x8')],members[_0x1d82ae][_0x3a7a('0x2d')]));if(members[_0x1d82ae][_0x3a7a('0x22')]){writeDB(members[_0x1d82ae]);}}}if(_0x151436[_0x3a7a('0x30')]){var _0x1599cb=_0x151436[_0x3a7a('0x30')][_0x3a7a('0x11')]('-')[0x0];if(!_[_0x3a7a('0x21')](members[_0x1599cb])){members[_0x1599cb]=_[_0x3a7a('0x28')](members[_0x1599cb],{'data1':members[_0x1599cb][_0x3a7a('0x2f')]||_0x151436['type'],'data2':members[_0x1599cb]['data2']||_0x151436['source'],'data3':members[_0x1599cb][_0x3a7a('0x2d')]||_0x151436['destination'],'uniqueid':members[_0x1599cb][_0x3a7a('0x14')]||_0x151436[_0x3a7a('0x14')]});utils[_0x3a7a('0x4')](util[_0x3a7a('0x19')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x151436[_0x3a7a('0x14')],members[_0x1599cb]['data1'],members[_0x1599cb]['data2'],members[_0x1599cb][_0x3a7a('0x2d')]));if(members[_0x1599cb]['exitAt']){writeDB(members[_0x1599cb]);}}}}catch(_0x3aaab7){utils[_0x3a7a('0x29')](util['format'](_0x3a7a('0x2c'),_0x151436[_0x3a7a('0x14')]),_0x3aaab7);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index df84752..6b84357 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 _0x2266=['transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertype','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','CreateVoiceQueueReport','transfereduniqueid','uniqueid','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x2266,0x98));var _0x6226=function(_0x42f9a1,_0x229b92){_0x42f9a1=_0x42f9a1-0x0;var _0x2c3462=_0x2266[_0x42f9a1];return _0x2c3462;};'use strict';var _=require(_0x6226('0x0'));var util=require(_0x6226('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x5423f2){utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x4'),_0x5423f2['uniqueid'],_0x5423f2[_0x6226('0x5')],_0x5423f2[_0x6226('0x6')],_0x5423f2[_0x6226('0x7')],_0x5423f2[_0x6226('0x8')],_0x5423f2[_0x6226('0x9')],_0x5423f2[_0x6226('0xa')]));if(_0x5423f2[_0x6226('0x6')]){utils[_0x6226('0xb')](_0x5423f2[_0x6226('0x6')])['then'](function(_0x48cd54){if(_0x48cd54){_0x5423f2['type']=_0x48cd54['type'];}utils['request'](_0x6226('0xc'),_0x5423f2);});}else{utils['request'](_0x6226('0xc'),_0x5423f2);}if(_0x5423f2[_0x6226('0xd')]){delete queues[_0x5423f2[_0x6226('0xd')]];}else{delete queues[_0x5423f2[_0x6226('0xe')]];}}exports['queuecallerjoin']=function(_0x19ba61){try{utils['debug'](util[_0x6226('0x3')](_0x6226('0xf'),_0x19ba61[_0x6226('0xe')]),_0x19ba61);utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x10'),_0x19ba61[_0x6226('0xe')],_0x19ba61[_0x6226('0x6')],_0x19ba61['position']));queues[_0x19ba61[_0x6226('0xe')]]=_[_0x6226('0x11')](_0x19ba61,{'originalposition':_0x19ba61[_0x6226('0x12')],'queuecallerjoinAt':utils[_0x6226('0x13')](),'mohtime':0x0});}catch(_0x3b3e9f){utils[_0x6226('0x14')](util[_0x6226('0x3')]('[%s][queues][queuecallerjoin]',_0x19ba61[_0x6226('0xe')]),_0x3b3e9f);}};exports[_0x6226('0x15')]=function(_0x694818){try{if(!_[_0x6226('0x16')](queues[_0x694818[_0x6226('0xe')]])){utils[_0x6226('0x17')](util[_0x6226('0x3')](_0x6226('0x18'),_0x694818[_0x6226('0xe')]),_0x694818);if(queues[_0x694818[_0x6226('0xe')]][_0x6226('0x19')]){if(!queues[_0x694818[_0x6226('0xe')]][_0x6226('0x1a')]&&!queues[_0x694818[_0x6226('0xe')]][_0x6226('0x1b')]){queues[_0x694818['uniqueid']][_0x6226('0x1c')]=!![];queues[_0x694818[_0x6226('0xe')]][_0x6226('0x1d')]=utils[_0x6226('0x13')]();queues[_0x694818[_0x6226('0xe')]][_0x6226('0xa')]=_0x6226('0x1e');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x694818['uniqueid'],queues[_0x694818[_0x6226('0xe')]][_0x6226('0x1f')],queues[_0x694818['uniqueid']][_0x6226('0xa')]));writeDB(queues[_0x694818[_0x6226('0xe')]]);}else if(queues[_0x694818[_0x6226('0xe')]][_0x6226('0xd')]){utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x20'),_0x694818[_0x6226('0xe')],queues[_0x694818['uniqueid']][_0x6226('0x1f')],queues[_0x694818[_0x6226('0xe')]][_0x6226('0xd')]));queues[queues[_0x694818['uniqueid']]['transfereduniqueid']]=queues[_0x694818[_0x6226('0xe')]];queues[queues[_0x694818['uniqueid']][_0x6226('0xd')]][_0x6226('0x21')]=0x2;delete queues[_0x694818['uniqueid']];}}}catch(_0x1beb75){utils[_0x6226('0x14')](util['format'](_0x6226('0x18'),_0x694818[_0x6226('0xe')]),_0x1beb75);}};exports[_0x6226('0x22')]=function(_0x56ba0d){try{utils['debug'](util[_0x6226('0x3')](_0x6226('0x23'),_0x56ba0d[_0x6226('0xe')]),_0x56ba0d);if(!_[_0x6226('0x16')](_0x56ba0d[_0x6226('0x24')][_0x6226('0x25')])&&_0x56ba0d[_0x6226('0x26')][_0x6226('0x27')]()!==_0x6226('0x28')){if(!_['isNil'](queues[_0x56ba0d[_0x6226('0xe')]])){queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1a')]=![];queues[_0x56ba0d['uniqueid']][_0x6226('0x29')]=null;queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1b')]=!![];queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x2a')]=utils[_0x6226('0x13')]();queues[_0x56ba0d[_0x6226('0xe')]]['queuecallerexitreason']=_0x56ba0d[_0x6226('0x26')]['toUpperCase']();utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x2b'),_0x56ba0d['uniqueid'],queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1f')],_0x56ba0d[_0x6226('0x26')],queues[_0x56ba0d['uniqueid']][_0x6226('0xa')]));writeDB(queues[_0x56ba0d['uniqueid']]);}}else if(!_[_0x6226('0x16')](_0x56ba0d[_0x6226('0x24')][_0x6226('0x2c')])){if(!_['isNil'](queues[_0x56ba0d[_0x6226('0xe')]])&&!queues[_0x56ba0d['uniqueid']]['queuecallerabandon']){queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1a')]=![];queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x29')]=null;queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1b')]=!![];queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x2a')]=utils['now']();queues[_0x56ba0d[_0x6226('0xe')]]['queuecallerexitreason']=_0x6226('0x2d');utils[_0x6226('0x2')](util[_0x6226('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x56ba0d['uniqueid'],queues[_0x56ba0d[_0x6226('0xe')]][_0x6226('0x1f')],_0x56ba0d[_0x6226('0x26')],queues[_0x56ba0d['uniqueid']][_0x6226('0xa')]));}}}catch(_0x191920){utils['error'](util['format'](_0x6226('0x23'),_0x56ba0d['uniqueid']),_0x191920);}};exports[_0x6226('0x1a')]=function(_0x268c61){try{if(!_[_0x6226('0x16')](queues[_0x268c61['uniqueid']])){utils[_0x6226('0x17')](util[_0x6226('0x3')](_0x6226('0x2e'),_0x268c61['uniqueid']),_0x268c61);queues[_0x268c61['uniqueid']]['queuecallerexit']=![];queues[_0x268c61[_0x6226('0xe')]]['queuecallerexitAt']=null;queues[_0x268c61['uniqueid']]['queuecallerabandon']=!![];queues[_0x268c61['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x268c61['uniqueid']][_0x6226('0xa')]=_0x6226('0x2f');utils[_0x6226('0x2')](util['format'](_0x6226('0x30'),_0x268c61[_0x6226('0xe')],queues[_0x268c61[_0x6226('0xe')]][_0x6226('0x1f')],queues[_0x268c61[_0x6226('0xe')]][_0x6226('0xa')]));}}catch(_0x10d930){utils['error'](util['format'](_0x6226('0x2e'),_0x268c61[_0x6226('0xe')]),_0x10d930);}};exports[_0x6226('0x31')]=function(_0x1f7786){try{if(!_['isNil'](queues[_0x1f7786['uniqueid']])){utils['debug'](util[_0x6226('0x3')]('[%s][queues][queuecallerleave]',_0x1f7786[_0x6226('0xe')]),_0x1f7786);utils['info'](util[_0x6226('0x3')](_0x6226('0x32'),_0x1f7786[_0x6226('0xe')],queues[_0x1f7786['uniqueid']][_0x6226('0x1f')],_0x1f7786['connectedlinenum'],_0x1f7786['connectedlinename']));queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x31')]=!![];queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x19')]=utils[_0x6226('0x13')]();queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x33')]=utils['diffTime'](queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x19')],queues[_0x1f7786['uniqueid']][_0x6226('0x34')]);queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x12')]=_0x1f7786[_0x6226('0x12')];queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x35')]=_0x1f7786[_0x6226('0x35')];queues[_0x1f7786[_0x6226('0xe')]][_0x6226('0x36')]=_0x1f7786[_0x6226('0x36')];queues[_0x1f7786['uniqueid']][_0x6226('0x37')]=_0x1f7786['connectedlinename'];}}catch(_0x11171d){utils[_0x6226('0x14')](util[_0x6226('0x3')](_0x6226('0x38'),_0x1f7786[_0x6226('0xe')]),_0x11171d);}};exports[_0x6226('0x39')]=function(_0x5a8258){try{if(!_[_0x6226('0x16')](queues[_0x5a8258[_0x6226('0xe')]])){utils[_0x6226('0x17')](util['format'](_0x6226('0x3a'),_0x5a8258[_0x6226('0xe')]),_0x5a8258);utils[_0x6226('0x2')](util['format'](_0x6226('0x3b'),_0x5a8258[_0x6226('0xe')],queues[_0x5a8258[_0x6226('0xe')]][_0x6226('0x1f')],_0x5a8258[_0x6226('0x3c')],_0x5a8258[_0x6226('0x3d')]));queues[_0x5a8258[_0x6226('0xe')]][_0x6226('0x1a')]=![];queues[_0x5a8258['uniqueid']][_0x6226('0x1a')]=![];queues[_0x5a8258['uniqueid']][_0x6226('0x29')]=null;queues[_0x5a8258[_0x6226('0xe')]][_0x6226('0x1b')]=![];queues[_0x5a8258[_0x6226('0xe')]]['queuecallerexitreason']=null;queues[_0x5a8258['uniqueid']]['queuecallerexitAt']=null;queues[_0x5a8258['uniqueid']][_0x6226('0x3e')]=!![];queues[_0x5a8258['uniqueid']][_0x6226('0x9')]=_0x5a8258[_0x6226('0x3d')];queues[_0x5a8258[_0x6226('0xe')]][_0x6226('0x7')]=_0x5a8258['membername'];}}catch(_0x423b74){utils[_0x6226('0x14')](util[_0x6226('0x3')]('[%s][queues][agentconnect]',_0x5a8258[_0x6226('0xe')]),_0x423b74);}};exports[_0x6226('0x3f')]=function(_0x5b843c){try{if(!_[_0x6226('0x16')](queues[_0x5b843c['uniqueid']])){if(queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x19')]){utils[_0x6226('0x17')](util[_0x6226('0x3')](_0x6226('0x40'),_0x5b843c[_0x6226('0xe')]),_0x5b843c);queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x1a')]=![];queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x1a')]=![];queues[_0x5b843c['uniqueid']][_0x6226('0x29')]=null;queues[_0x5b843c['uniqueid']]['queuecallerexit']=![];queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x2a')]=null;queues[_0x5b843c['uniqueid']][_0x6226('0x3e')]=!![];queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x7')]=_0x5b843c['membername'];queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x1c')]=!![];queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x1d')]=utils['now']();if(_0x5b843c[_0x6226('0x41')]==_0x6226('0x42')){if(!queues[_0x5b843c['uniqueid']]['transfer']){queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0xa')]=_0x6226('0x43');}}else{queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0xa')]=_0x6226('0x44')+_0x5b843c[_0x6226('0x41')]['toUpperCase']();}utils[_0x6226('0x2')](util['format'](_0x6226('0x45'),_0x5b843c[_0x6226('0xe')],queues[_0x5b843c[_0x6226('0xe')]][_0x6226('0x1f')],_0x5b843c[_0x6226('0x3c')],queues[_0x5b843c['uniqueid']][_0x6226('0xa')]));writeDB(queues[_0x5b843c[_0x6226('0xe')]]);}}}catch(_0x3f791e){utils[_0x6226('0x14')](util['format']('[%s][queues][agentcomplete]',_0x5b843c[_0x6226('0xe')]),_0x3f791e);}};exports[_0x6226('0x46')]=function(_0xa5e4f7){try{if(!_[_0x6226('0x16')](queues[_0xa5e4f7[_0x6226('0x47')]])){utils[_0x6226('0x17')](util[_0x6226('0x3')]('[%s][queues][blindtransfer]',_0xa5e4f7['uniqueid']),_0xa5e4f7);queues[_0xa5e4f7['transfereeuniqueid']][_0x6226('0x42')]=!![];queues[_0xa5e4f7[_0x6226('0x47')]]['transfertype']=_0x6226('0x48');queues[_0xa5e4f7[_0x6226('0x47')]][_0x6226('0x49')]=_0xa5e4f7[_0x6226('0x4a')];queues[_0xa5e4f7['transfereeuniqueid']][_0x6226('0x4b')]=_0xa5e4f7['transfereeuniqueid'];queues[_0xa5e4f7['transfereeuniqueid']][_0x6226('0xa')]=_0x6226('0x4c');utils['info'](util[_0x6226('0x3')](_0x6226('0x4d'),_0xa5e4f7[_0x6226('0xe')],queues[_0xa5e4f7[_0x6226('0x47')]][_0x6226('0x1f')],_0xa5e4f7[_0x6226('0x47')],_0xa5e4f7['extension']));}}catch(_0x1cb19f){utils['error'](util[_0x6226('0x3')](_0x6226('0x4e'),_0xa5e4f7[_0x6226('0xe')]),_0x1cb19f);}};exports[_0x6226('0x4f')]=function(_0x587a45){try{utils['debug'](util[_0x6226('0x3')](_0x6226('0x50'),_0x587a45['origtransfereruniqueid']),_0x587a45);if(_0x587a45[_0x6226('0x51')]==_0x587a45[_0x6226('0x52')]){if(!_[_0x6226('0x16')](queues[_0x587a45[_0x6226('0x53')]])){utils[_0x6226('0x2')](util['format'](_0x6226('0x54'),_0x587a45[_0x6226('0x51')],queues[_0x587a45[_0x6226('0x53')]]['name'],_0x587a45['origtransfererexten']));queues[_0x587a45['secondtransfererlinkedid']][_0x6226('0x42')]=!![];queues[_0x587a45[_0x6226('0x53')]][_0x6226('0x55')]=_0x6226('0x56');queues[_0x587a45[_0x6226('0x53')]][_0x6226('0x49')]=_0x587a45[_0x6226('0x57')];queues[_0x587a45['secondtransfererlinkedid']][_0x6226('0x4b')]=_0x587a45[_0x6226('0x51')];queues[_0x587a45[_0x6226('0x53')]][_0x6226('0xa')]=_0x6226('0x58');}if(!_['isNil'](queues[_0x587a45[_0x6226('0x52')]])){if(_0x587a45['transfereelinkedid']&&queues[_0x587a45['transfereelinkedid']]){queues[_0x587a45[_0x6226('0x59')]][_0x6226('0x21')]=0x1;queues[_0x587a45['transfereeuniqueid']]=_[_0x6226('0x5a')](queues[_0x587a45['transfereelinkedid']]);queues[_0x587a45[_0x6226('0x47')]][_0x6226('0xd')]=_0x587a45[_0x6226('0x5b')];queues[_0x587a45[_0x6226('0x47')]]['queuecallerenterreason']=0x2;queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x8')]=queues[_0x587a45[_0x6226('0x53')]][_0x6226('0x8')];queues[_0x587a45['transfereeuniqueid']][_0x6226('0x5c')]=queues[_0x587a45[_0x6226('0x53')]]['calleridname'];queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x34')]=utils[_0x6226('0x13')]();queues[_0x587a45['transfereeuniqueid']][_0x6226('0x19')]=utils[_0x6226('0x13')]();queues[_0x587a45[_0x6226('0x47')]]['holdtime']=0x0;queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x5d')]=0x0;utils['info'](util[_0x6226('0x3')](_0x6226('0x5e'),_0x587a45['origtransfereruniqueid'],queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x1f')],queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x8')],queues[_0x587a45[_0x6226('0x47')]][_0x6226('0x5c')]));}else{utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x5f'),_0x587a45[_0x6226('0x51')],queues[_0x587a45[_0x6226('0x52')]]['name'],_0x587a45[_0x6226('0x53')]));queues[_0x587a45['origtransfererlinkedid']]['transfereduniqueid']=_0x587a45[_0x6226('0x53')];}}}else if(_0x587a45[_0x6226('0x60')]==_0x587a45[_0x6226('0x53')]){if(!_[_0x6226('0x16')](queues[_0x587a45[_0x6226('0x52')]])){utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x61'),_0x587a45[_0x6226('0x51')],queues[_0x587a45[_0x6226('0x52')]][_0x6226('0x1f')],_0x587a45[_0x6226('0x60')],_0x587a45['secondtransfererexten']));queues[_0x587a45[_0x6226('0x52')]][_0x6226('0x42')]=!![];queues[_0x587a45['origtransfererlinkedid']][_0x6226('0x55')]=_0x6226('0x56');queues[_0x587a45[_0x6226('0x52')]][_0x6226('0x49')]=_0x587a45[_0x6226('0x62')];queues[_0x587a45[_0x6226('0x52')]]['transferuniqueid']=_0x587a45[_0x6226('0x60')];queues[_0x587a45[_0x6226('0x52')]]['queuecallerexitreason']=_0x6226('0x58');}if(!_[_0x6226('0x16')](queues[_0x587a45[_0x6226('0x53')]])){if(_0x587a45[_0x6226('0x63')]&&queues[_0x587a45[_0x6226('0x63')]]){queues[_0x587a45[_0x6226('0x63')]][_0x6226('0x21')]=0x1;queues[_0x587a45[_0x6226('0x5b')]]=_['clone'](queues[_0x587a45[_0x6226('0x63')]]);queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0xd')]=_0x587a45[_0x6226('0x5b')];queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x21')]=0x2;queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x8')]=queues[_0x587a45[_0x6226('0x52')]][_0x6226('0x8')];queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x5c')]=queues[_0x587a45[_0x6226('0x52')]][_0x6226('0x5c')];queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x34')]=utils[_0x6226('0x13')]();queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x19')]=utils[_0x6226('0x13')]();queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x33')]=0x0;queues[_0x587a45[_0x6226('0x5b')]]['mohtime']=0x0;utils['info'](util[_0x6226('0x3')](_0x6226('0x64'),_0x587a45[_0x6226('0x51')],queues[_0x587a45['transfertargetuniqueid']]['name'],queues[_0x587a45[_0x6226('0x5b')]]['transfereduniqueid'],queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x8')],queues[_0x587a45[_0x6226('0x5b')]][_0x6226('0x5c')]));}else{utils['info'](util[_0x6226('0x3')](_0x6226('0x5f'),_0x587a45[_0x6226('0x51')],queues[_0x587a45[_0x6226('0x53')]][_0x6226('0x1f')],_0x587a45[_0x6226('0x52')]));queues[_0x587a45[_0x6226('0x53')]][_0x6226('0xd')]=_0x587a45['origtransfererlinkedid'];}}}}catch(_0xf0ba78){utils['error'](util[_0x6226('0x3')](_0x6226('0x50'),_0x587a45['origtransfereruniqueid']),_0xf0ba78);}};exports[_0x6226('0x65')]=function(_0x3b8bff){try{if(!_['isNil'](queues[_0x3b8bff[_0x6226('0xe')]])){utils[_0x6226('0x17')](util[_0x6226('0x3')](_0x6226('0x66'),_0x3b8bff[_0x6226('0xe')]),_0x3b8bff);queues[_0x3b8bff[_0x6226('0xe')]]['musiconholdstartAt']=utils['now']();utils[_0x6226('0x2')](util['format'](_0x6226('0x67'),_0x3b8bff[_0x6226('0xe')],queues[_0x3b8bff[_0x6226('0xe')]][_0x6226('0x1f')],queues[_0x3b8bff[_0x6226('0xe')]][_0x6226('0x68')]));}}catch(_0x2ff580){utils[_0x6226('0x14')](util[_0x6226('0x3')](_0x6226('0x66'),_0x3b8bff[_0x6226('0xe')]),_0x2ff580);}};exports[_0x6226('0x69')]=function(_0x17061b){try{if(!_[_0x6226('0x16')](queues[_0x17061b[_0x6226('0xe')]])){if(!_[_0x6226('0x16')](queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x68')])){utils[_0x6226('0x17')](util[_0x6226('0x3')]('[%s][queues][musiconholdstop]',_0x17061b[_0x6226('0xe')]),_0x17061b);queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x5d')]+=utils[_0x6226('0x6a')](utils[_0x6226('0x13')](),queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x68')]);utils[_0x6226('0x2')](util[_0x6226('0x3')](_0x6226('0x6b'),_0x17061b[_0x6226('0xe')],queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x1f')],queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x5d')]));delete queues[_0x17061b[_0x6226('0xe')]][_0x6226('0x68')];}}}catch(_0x275c13){utils[_0x6226('0x14')](util[_0x6226('0x3')](_0x6226('0x6c'),_0x17061b[_0x6226('0xe')]),_0x275c13);}}; \ No newline at end of file +var _0x5a09=['[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','info','format','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','error','varset','[%s][queues][varset]','variable','queuestatus','CONTINUE','isNil','queuecallerabandonAt','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','name','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x36a92d,_0x30e3ef){var _0x558a68=function(_0xdd3bb2){while(--_0xdd3bb2){_0x36a92d['push'](_0x36a92d['shift']());}};_0x558a68(++_0x30e3ef);}(_0x5a09,0x161));var _0x95a0=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x5a09[_0x4bdf64];return _0x9a1a19;};'use strict';var _=require(_0x95a0('0x0'));var util=require(_0x95a0('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2c65a2){utils[_0x95a0('0x2')](util[_0x95a0('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2c65a2[_0x95a0('0x4')],_0x2c65a2[_0x95a0('0x5')],_0x2c65a2[_0x95a0('0x6')],_0x2c65a2[_0x95a0('0x7')],_0x2c65a2['calleridnum'],_0x2c65a2[_0x95a0('0x8')],_0x2c65a2[_0x95a0('0x9')]));if(_0x2c65a2[_0x95a0('0x6')]){utils[_0x95a0('0xa')](_0x2c65a2[_0x95a0('0x6')])[_0x95a0('0xb')](function(_0x18a79b){if(_0x18a79b){_0x2c65a2[_0x95a0('0xc')]=_0x18a79b[_0x95a0('0xc')];}utils[_0x95a0('0xd')](_0x95a0('0xe'),_0x2c65a2);});}else{utils[_0x95a0('0xd')](_0x95a0('0xe'),_0x2c65a2);}if(_0x2c65a2[_0x95a0('0xf')]){delete queues[_0x2c65a2[_0x95a0('0xf')]];}else{delete queues[_0x2c65a2[_0x95a0('0x4')]];}}exports[_0x95a0('0x10')]=function(_0x43bb79){try{utils['debug'](util[_0x95a0('0x3')](_0x95a0('0x11'),_0x43bb79[_0x95a0('0x4')]),_0x43bb79);utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x12'),_0x43bb79['uniqueid'],_0x43bb79[_0x95a0('0x6')],_0x43bb79[_0x95a0('0x13')]));queues[_0x43bb79[_0x95a0('0x4')]]=_[_0x95a0('0x14')](_0x43bb79,{'originalposition':_0x43bb79[_0x95a0('0x13')],'queuecallerjoinAt':utils[_0x95a0('0x15')](),'mohtime':0x0});}catch(_0x282329){utils['error'](util[_0x95a0('0x3')]('[%s][queues][queuecallerjoin]',_0x43bb79['uniqueid']),_0x282329);}};exports['hangup']=function(_0x3b1739){try{if(!_['isNil'](queues[_0x3b1739[_0x95a0('0x4')]])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')](_0x95a0('0x17'),_0x3b1739['uniqueid']),_0x3b1739);if(queues[_0x3b1739['uniqueid']][_0x95a0('0x18')]){if(!queues[_0x3b1739['uniqueid']][_0x95a0('0x19')]&&!queues[_0x3b1739['uniqueid']][_0x95a0('0x1a')]){queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0x1b')]=!![];queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0x1c')]=utils[_0x95a0('0x15')]();queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0x9')]='COMPLETEDBYAGENT';}utils[_0x95a0('0x2')](util['format'](_0x95a0('0x1d'),_0x3b1739[_0x95a0('0x4')],queues[_0x3b1739['uniqueid']]['name'],queues[_0x3b1739['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x3b1739['uniqueid']]);}else if(queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0xf')]){utils['info'](util[_0x95a0('0x3')](_0x95a0('0x1e'),_0x3b1739['uniqueid'],queues[_0x3b1739[_0x95a0('0x4')]]['name'],queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0xf')]));queues[queues[_0x3b1739['uniqueid']][_0x95a0('0xf')]]=queues[_0x3b1739[_0x95a0('0x4')]];queues[queues[_0x3b1739[_0x95a0('0x4')]][_0x95a0('0xf')]]['queuecallerenterreason']=0x2;delete queues[_0x3b1739['uniqueid']];}}}catch(_0x2081ed){utils[_0x95a0('0x1f')](util[_0x95a0('0x3')](_0x95a0('0x17'),_0x3b1739['uniqueid']),_0x2081ed);}};exports[_0x95a0('0x20')]=function(_0x4a5147){try{utils['debug'](util[_0x95a0('0x3')](_0x95a0('0x21'),_0x4a5147[_0x95a0('0x4')]),_0x4a5147);if(!_['isNil'](_0x4a5147[_0x95a0('0x22')][_0x95a0('0x23')])&&_0x4a5147['value']['toUpperCase']()!==_0x95a0('0x24')){if(!_[_0x95a0('0x25')](queues[_0x4a5147['uniqueid']])){queues[_0x4a5147[_0x95a0('0x4')]]['queuecallerabandon']=![];queues[_0x4a5147['uniqueid']][_0x95a0('0x26')]=null;queues[_0x4a5147[_0x95a0('0x4')]]['queuecallerexit']=!![];queues[_0x4a5147[_0x95a0('0x4')]]['queuecallerexitAt']=utils['now']();queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x9')]=_0x4a5147[_0x95a0('0x27')][_0x95a0('0x28')]();utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x29'),_0x4a5147[_0x95a0('0x4')],queues[_0x4a5147['uniqueid']][_0x95a0('0x2a')],_0x4a5147['value'],queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x9')]));writeDB(queues[_0x4a5147[_0x95a0('0x4')]]);}}else if(!_[_0x95a0('0x25')](_0x4a5147['variable'][_0x95a0('0x2b')])){if(!_[_0x95a0('0x25')](queues[_0x4a5147[_0x95a0('0x4')]])&&!queues[_0x4a5147['uniqueid']][_0x95a0('0x19')]){queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x19')]=![];queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x26')]=null;queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x1a')]=!![];queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x2c')]=utils[_0x95a0('0x15')]();queues[_0x4a5147[_0x95a0('0x4')]]['queuecallerexitreason']=_0x95a0('0x2d');utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x2e'),_0x4a5147[_0x95a0('0x4')],queues[_0x4a5147[_0x95a0('0x4')]]['name'],_0x4a5147[_0x95a0('0x27')],queues[_0x4a5147[_0x95a0('0x4')]][_0x95a0('0x9')]));}}}catch(_0x455cf2){utils[_0x95a0('0x1f')](util[_0x95a0('0x3')](_0x95a0('0x21'),_0x4a5147['uniqueid']),_0x455cf2);}};exports[_0x95a0('0x19')]=function(_0x803e49){try{if(!_[_0x95a0('0x25')](queues[_0x803e49['uniqueid']])){utils[_0x95a0('0x16')](util['format'](_0x95a0('0x2f'),_0x803e49[_0x95a0('0x4')]),_0x803e49);queues[_0x803e49['uniqueid']][_0x95a0('0x1a')]=![];queues[_0x803e49[_0x95a0('0x4')]][_0x95a0('0x2c')]=null;queues[_0x803e49[_0x95a0('0x4')]][_0x95a0('0x19')]=!![];queues[_0x803e49[_0x95a0('0x4')]][_0x95a0('0x26')]=utils[_0x95a0('0x15')]();queues[_0x803e49[_0x95a0('0x4')]][_0x95a0('0x9')]=_0x95a0('0x30');utils['info'](util[_0x95a0('0x3')](_0x95a0('0x31'),_0x803e49[_0x95a0('0x4')],queues[_0x803e49['uniqueid']][_0x95a0('0x2a')],queues[_0x803e49[_0x95a0('0x4')]][_0x95a0('0x9')]));}}catch(_0x321c5e){utils[_0x95a0('0x1f')](util['format']('[%s][queues][queuecallerabandon]',_0x803e49[_0x95a0('0x4')]),_0x321c5e);}};exports[_0x95a0('0x32')]=function(_0x1d5c1c){try{if(!_['isNil'](queues[_0x1d5c1c[_0x95a0('0x4')]])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')](_0x95a0('0x33'),_0x1d5c1c['uniqueid']),_0x1d5c1c);utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x34'),_0x1d5c1c[_0x95a0('0x4')],queues[_0x1d5c1c[_0x95a0('0x4')]]['name'],_0x1d5c1c[_0x95a0('0x35')],_0x1d5c1c[_0x95a0('0x36')]));queues[_0x1d5c1c[_0x95a0('0x4')]]['queuecallerleave']=!![];queues[_0x1d5c1c['uniqueid']][_0x95a0('0x18')]=utils[_0x95a0('0x15')]();queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x37')]=utils[_0x95a0('0x38')](queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x18')],queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x39')]);queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x13')]=_0x1d5c1c[_0x95a0('0x13')];queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x3a')]=_0x1d5c1c[_0x95a0('0x3a')];queues[_0x1d5c1c[_0x95a0('0x4')]]['connectedlinenum']=_0x1d5c1c[_0x95a0('0x35')];queues[_0x1d5c1c[_0x95a0('0x4')]][_0x95a0('0x36')]=_0x1d5c1c[_0x95a0('0x36')];}}catch(_0xa6c14a){utils['error'](util[_0x95a0('0x3')](_0x95a0('0x33'),_0x1d5c1c[_0x95a0('0x4')]),_0xa6c14a);}};exports[_0x95a0('0x3b')]=function(_0x39b81d){try{if(!_[_0x95a0('0x25')](queues[_0x39b81d[_0x95a0('0x4')]])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')](_0x95a0('0x3c'),_0x39b81d['uniqueid']),_0x39b81d);utils['info'](util['format'](_0x95a0('0x3d'),_0x39b81d[_0x95a0('0x4')],queues[_0x39b81d[_0x95a0('0x4')]]['name'],_0x39b81d[_0x95a0('0x3e')],_0x39b81d[_0x95a0('0x3f')]));queues[_0x39b81d[_0x95a0('0x4')]]['queuecallerabandon']=![];queues[_0x39b81d[_0x95a0('0x4')]]['queuecallerabandon']=![];queues[_0x39b81d[_0x95a0('0x4')]][_0x95a0('0x26')]=null;queues[_0x39b81d[_0x95a0('0x4')]][_0x95a0('0x1a')]=![];queues[_0x39b81d[_0x95a0('0x4')]][_0x95a0('0x9')]=null;queues[_0x39b81d['uniqueid']]['queuecallerexitAt']=null;queues[_0x39b81d['uniqueid']][_0x95a0('0x40')]=!![];queues[_0x39b81d[_0x95a0('0x4')]][_0x95a0('0x8')]=_0x39b81d[_0x95a0('0x3f')];queues[_0x39b81d['uniqueid']]['lastAssignedTo']=_0x39b81d[_0x95a0('0x3e')];}}catch(_0x31f54e){utils[_0x95a0('0x1f')](util[_0x95a0('0x3')](_0x95a0('0x3c'),_0x39b81d[_0x95a0('0x4')]),_0x31f54e);}};exports['agentcomplete']=function(_0x534a48){try{if(!_['isNil'](queues[_0x534a48['uniqueid']])){if(queues[_0x534a48['uniqueid']][_0x95a0('0x18')]){utils[_0x95a0('0x16')](util['format'](_0x95a0('0x41'),_0x534a48[_0x95a0('0x4')]),_0x534a48);queues[_0x534a48['uniqueid']]['queuecallerabandon']=![];queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x19')]=![];queues[_0x534a48['uniqueid']]['queuecallerabandonAt']=null;queues[_0x534a48['uniqueid']][_0x95a0('0x1a')]=![];queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x2c')]=null;queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x40')]=!![];queues[_0x534a48['uniqueid']]['lastAssignedTo']=_0x534a48['membername'];queues[_0x534a48['uniqueid']][_0x95a0('0x1b')]=!![];queues[_0x534a48[_0x95a0('0x4')]]['queuecallercompleteAt']=utils['now']();if(_0x534a48[_0x95a0('0x42')]==_0x95a0('0x43')){if(!queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x43')]){queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x9')]=_0x95a0('0x44');}}else{queues[_0x534a48['uniqueid']][_0x95a0('0x9')]=_0x95a0('0x45')+_0x534a48[_0x95a0('0x42')][_0x95a0('0x28')]();}utils[_0x95a0('0x2')](util[_0x95a0('0x3')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x534a48['uniqueid'],queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x2a')],_0x534a48[_0x95a0('0x3e')],queues[_0x534a48[_0x95a0('0x4')]][_0x95a0('0x9')]));writeDB(queues[_0x534a48[_0x95a0('0x4')]]);}}}catch(_0x472154){utils[_0x95a0('0x1f')](util[_0x95a0('0x3')](_0x95a0('0x41'),_0x534a48[_0x95a0('0x4')]),_0x472154);}};exports[_0x95a0('0x46')]=function(_0x569a48){try{if(!_[_0x95a0('0x25')](queues[_0x569a48['transfereeuniqueid']])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')](_0x95a0('0x47'),_0x569a48[_0x95a0('0x4')]),_0x569a48);queues[_0x569a48[_0x95a0('0x48')]][_0x95a0('0x43')]=!![];queues[_0x569a48[_0x95a0('0x48')]][_0x95a0('0x49')]=_0x95a0('0x4a');queues[_0x569a48[_0x95a0('0x48')]][_0x95a0('0x4b')]=_0x569a48['extension'];queues[_0x569a48['transfereeuniqueid']][_0x95a0('0x4c')]=_0x569a48['transfereeuniqueid'];queues[_0x569a48[_0x95a0('0x48')]]['queuecallerexitreason']=_0x95a0('0x4d');utils['info'](util[_0x95a0('0x3')](_0x95a0('0x4e'),_0x569a48[_0x95a0('0x4')],queues[_0x569a48[_0x95a0('0x48')]]['name'],_0x569a48[_0x95a0('0x48')],_0x569a48[_0x95a0('0x4f')]));}}catch(_0x216b73){utils['error'](util[_0x95a0('0x3')]('[%s][queues][blindtransfer]',_0x569a48['uniqueid']),_0x216b73);}};exports[_0x95a0('0x50')]=function(_0x427caa){try{utils['debug'](util[_0x95a0('0x3')](_0x95a0('0x51'),_0x427caa['origtransfereruniqueid']),_0x427caa);if(_0x427caa[_0x95a0('0x52')]==_0x427caa['origtransfererlinkedid']){if(!_[_0x95a0('0x25')](queues[_0x427caa['secondtransfererlinkedid']])){utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x53'),_0x427caa['origtransfereruniqueid'],queues[_0x427caa[_0x95a0('0x54')]]['name'],_0x427caa[_0x95a0('0x55')]));queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x43')]=!![];queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x49')]=_0x95a0('0x56');queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x4b')]=_0x427caa['origtransfererexten'];queues[_0x427caa['secondtransfererlinkedid']][_0x95a0('0x4c')]=_0x427caa['origtransfereruniqueid'];queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x427caa[_0x95a0('0x57')]])){if(_0x427caa[_0x95a0('0x58')]&&queues[_0x427caa[_0x95a0('0x58')]]){queues[_0x427caa[_0x95a0('0x58')]][_0x95a0('0x59')]=0x1;queues[_0x427caa[_0x95a0('0x48')]]=_[_0x95a0('0x5a')](queues[_0x427caa['transfereelinkedid']]);queues[_0x427caa['transfereeuniqueid']]['transfereduniqueid']=_0x427caa[_0x95a0('0x5b')];queues[_0x427caa[_0x95a0('0x48')]]['queuecallerenterreason']=0x2;queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x5c')]=queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x5c')];queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x5d')]=queues[_0x427caa['secondtransfererlinkedid']]['calleridname'];queues[_0x427caa[_0x95a0('0x48')]]['queuecallerjoinAt']=utils[_0x95a0('0x15')]();queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x18')]=utils['now']();queues[_0x427caa['transfereeuniqueid']][_0x95a0('0x37')]=0x0;queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x5e')]=0x0;utils[_0x95a0('0x2')](util['format'](_0x95a0('0x5f'),_0x427caa['origtransfereruniqueid'],queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x2a')],queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x5c')],queues[_0x427caa[_0x95a0('0x48')]][_0x95a0('0x5d')]));}else{utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x60'),_0x427caa[_0x95a0('0x52')],queues[_0x427caa[_0x95a0('0x57')]]['name'],_0x427caa[_0x95a0('0x54')]));queues[_0x427caa[_0x95a0('0x57')]]['transfereduniqueid']=_0x427caa[_0x95a0('0x54')];}}}else if(_0x427caa['secondtransfereruniqueid']==_0x427caa[_0x95a0('0x54')]){if(!_[_0x95a0('0x25')](queues[_0x427caa[_0x95a0('0x57')]])){utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x61'),_0x427caa[_0x95a0('0x52')],queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x2a')],_0x427caa[_0x95a0('0x62')],_0x427caa[_0x95a0('0x63')]));queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x43')]=!![];queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x49')]=_0x95a0('0x56');queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x4b')]=_0x427caa[_0x95a0('0x63')];queues[_0x427caa[_0x95a0('0x57')]]['transferuniqueid']=_0x427caa[_0x95a0('0x62')];queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x9')]=_0x95a0('0x64');}if(!_['isNil'](queues[_0x427caa['secondtransfererlinkedid']])){if(_0x427caa['transfertargetlinkedid']&&queues[_0x427caa[_0x95a0('0x65')]]){queues[_0x427caa[_0x95a0('0x65')]][_0x95a0('0x59')]=0x1;queues[_0x427caa['transfertargetuniqueid']]=_[_0x95a0('0x5a')](queues[_0x427caa[_0x95a0('0x65')]]);queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0xf')]=_0x427caa['transfertargetuniqueid'];queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x59')]=0x2;queues[_0x427caa[_0x95a0('0x5b')]]['calleridnum']=queues[_0x427caa['origtransfererlinkedid']][_0x95a0('0x5c')];queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x5d')]=queues[_0x427caa[_0x95a0('0x57')]][_0x95a0('0x5d')];queues[_0x427caa['transfertargetuniqueid']][_0x95a0('0x39')]=utils[_0x95a0('0x15')]();queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x18')]=utils['now']();queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x37')]=0x0;queues[_0x427caa[_0x95a0('0x5b')]]['mohtime']=0x0;utils[_0x95a0('0x2')](util[_0x95a0('0x3')](_0x95a0('0x66'),_0x427caa['origtransfereruniqueid'],queues[_0x427caa['transfertargetuniqueid']][_0x95a0('0x2a')],queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0xf')],queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x5c')],queues[_0x427caa[_0x95a0('0x5b')]][_0x95a0('0x5d')]));}else{utils[_0x95a0('0x2')](util[_0x95a0('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x427caa[_0x95a0('0x52')],queues[_0x427caa[_0x95a0('0x54')]][_0x95a0('0x2a')],_0x427caa[_0x95a0('0x57')]));queues[_0x427caa[_0x95a0('0x54')]]['transfereduniqueid']=_0x427caa[_0x95a0('0x57')];}}}}catch(_0x5b90b1){utils[_0x95a0('0x1f')](util['format'](_0x95a0('0x51'),_0x427caa['origtransfereruniqueid']),_0x5b90b1);}};exports[_0x95a0('0x67')]=function(_0x36baf9){try{if(!_[_0x95a0('0x25')](queues[_0x36baf9['uniqueid']])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')]('[%s][queues][musiconholdstart]',_0x36baf9[_0x95a0('0x4')]),_0x36baf9);queues[_0x36baf9[_0x95a0('0x4')]][_0x95a0('0x68')]=utils[_0x95a0('0x15')]();utils['info'](util[_0x95a0('0x3')](_0x95a0('0x69'),_0x36baf9[_0x95a0('0x4')],queues[_0x36baf9[_0x95a0('0x4')]][_0x95a0('0x2a')],queues[_0x36baf9[_0x95a0('0x4')]][_0x95a0('0x68')]));}}catch(_0x5f0813){utils['error'](util[_0x95a0('0x3')](_0x95a0('0x6a'),_0x36baf9[_0x95a0('0x4')]),_0x5f0813);}};exports[_0x95a0('0x6b')]=function(_0x41bf88){try{if(!_['isNil'](queues[_0x41bf88[_0x95a0('0x4')]])){if(!_[_0x95a0('0x25')](queues[_0x41bf88[_0x95a0('0x4')]][_0x95a0('0x68')])){utils[_0x95a0('0x16')](util[_0x95a0('0x3')](_0x95a0('0x6c'),_0x41bf88['uniqueid']),_0x41bf88);queues[_0x41bf88['uniqueid']][_0x95a0('0x5e')]+=utils[_0x95a0('0x38')](utils[_0x95a0('0x15')](),queues[_0x41bf88[_0x95a0('0x4')]][_0x95a0('0x68')]);utils[_0x95a0('0x2')](util[_0x95a0('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x41bf88[_0x95a0('0x4')],queues[_0x41bf88['uniqueid']][_0x95a0('0x2a')],queues[_0x41bf88[_0x95a0('0x4')]][_0x95a0('0x5e')]));delete queues[_0x41bf88[_0x95a0('0x4')]][_0x95a0('0x68')];}}}catch(_0x42df0a){utils[_0x95a0('0x1f')](util[_0x95a0('0x3')]('[%s][queues][musiconholdstop]',_0x41bf88['uniqueid']),_0x42df0a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 861aa22..98e0758 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 _0x988e=['calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','info','exten','context','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt'];(function(_0x307ada,_0x207bce){var _0x524c1f=function(_0x5c62f5){while(--_0x5c62f5){_0x307ada['push'](_0x307ada['shift']());}};_0x524c1f(++_0x207bce);}(_0x988e,0x140));var _0xe988=function(_0x181fb5,_0x31e352){_0x181fb5=_0x181fb5-0x0;var _0x17f50b=_0x988e[_0x181fb5];return _0x17f50b;};'use strict';var _=require('lodash');var util=require(_0xe988('0x0'));var utils=require(_0xe988('0x1'));var recordings={};function writeDB(_0x3c97e6){utils['info'](util[_0xe988('0x2')](_0xe988('0x3'),_0x3c97e6[_0xe988('0x4')]));if(_0x3c97e6[_0xe988('0x5')]){utils[_0xe988('0x6')](_0x3c97e6['accountcode'])[_0xe988('0x7')](function(_0x4a3c11){if(_0x4a3c11){_0x3c97e6['membername']=_0x4a3c11[_0xe988('0x8')];_0x3c97e6[_0xe988('0x9')]=_0x4a3c11['id'];}utils[_0xe988('0xa')](_0xe988('0xb'),_0x3c97e6);});}else{utils[_0xe988('0xa')](_0xe988('0xb'),_0x3c97e6);}}exports[_0xe988('0xc')]=function(_0x25692d){try{utils[_0xe988('0xd')](util['format']('[%s][recordings][newchannel]',_0x25692d[_0xe988('0x4')]),_0x25692d);if(_0x25692d[_0xe988('0x4')]==_0x25692d[_0xe988('0xe')]){utils[_0xe988('0xf')](util[_0xe988('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x25692d[_0xe988('0x4')],_0x25692d['context'],_0x25692d[_0xe988('0x10')]));recordings[_0x25692d[_0xe988('0x4')]]={'uniqueid':_0x25692d['uniqueid'],'accountcode':_0x25692d[_0xe988('0x5')],'exten':_0x25692d[_0xe988('0x10')],'context':_0x25692d[_0xe988('0x11')],'channel':_0x25692d['channel'],'monitors':[]};}}catch(_0x3ad25e){utils[_0xe988('0x12')](util[_0xe988('0x2')](_0xe988('0x13'),_0x25692d[_0xe988('0x4')]),_0x3ad25e);}};exports['newstate']=function(_0x118f24){try{utils[_0xe988('0xd')](util['format'](_0xe988('0x14'),_0x118f24[_0xe988('0x4')]),_0x118f24);if(!_[_0xe988('0x15')](recordings[_0x118f24[_0xe988('0x4')]])&&_0x118f24[_0xe988('0x16')]==0x6){utils[_0xe988('0xf')](util[_0xe988('0x2')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x118f24[_0xe988('0x4')],_0x118f24['context'],_0x118f24[_0xe988('0x17')]));}else if(!_[_0xe988('0x15')](recordings[_0x118f24[_0xe988('0xe')]])&&_0x118f24[_0xe988('0x16')]==0x6&&_0x118f24[_0xe988('0x11')]!=_0xe988('0x18')){utils['info'](util[_0xe988('0x2')](_0xe988('0x19'),_0x118f24[_0xe988('0x4')],_0x118f24[_0xe988('0xe')],_0x118f24['context'],_0x118f24[_0xe988('0x17')]));recordings[_0x118f24['linkedid']][_0xe988('0x5')]=_0x118f24[_0xe988('0x5')];}}catch(_0x6a326a){utils[_0xe988('0x12')](util[_0xe988('0x2')](_0xe988('0x14'),_0x118f24['uniqueid']),_0x6a326a);}};exports['varset']=function(_0x47995a){try{if(!_[_0xe988('0x15')](_0x47995a[_0xe988('0x1a')])&&!_[_0xe988('0x15')](_0x47995a[_0xe988('0x1a')]['mixmonitor_filename'])){utils[_0xe988('0xd')](util[_0xe988('0x2')](_0xe988('0x1b'),_0x47995a[_0xe988('0x4')]),_0x47995a);utils[_0xe988('0xf')](util['format'](_0xe988('0x1c'),_0x47995a['uniqueid'],_0x47995a[_0xe988('0x1a')],_0x47995a['value']));if(_[_0xe988('0x1d')](_0x47995a[_0xe988('0x1e')],_0xe988('0x1f'))){_0x47995a['value']=_0x47995a[_0xe988('0x1e')][_0xe988('0x20')]('.wav49',_0xe988('0x21'));}if(recordings[_0x47995a[_0xe988('0xe')]]){var _0x2588bb=_['find'](recordings[_0x47995a[_0xe988('0xe')]][_0xe988('0x22')],{'value':_0x47995a[_0xe988('0x1e')]});if(_[_0xe988('0x15')](_0x2588bb)){recordings[_0x47995a[_0xe988('0xe')]][_0xe988('0x22')][_0xe988('0x23')]({'value':_0x47995a[_0xe988('0x1e')]});}}}}catch(_0x1c77b6){utils[_0xe988('0x12')](util[_0xe988('0x2')]('[%s][recordings][varset]',_0x47995a[_0xe988('0x4')]),_0x1c77b6);}};exports['hangup']=function(_0x62a052){try{if(!_[_0xe988('0x15')](recordings[_0x62a052[_0xe988('0x4')]])){utils[_0xe988('0xd')](util[_0xe988('0x2')](_0xe988('0x24'),_0x62a052[_0xe988('0x4')]),_0x62a052);utils[_0xe988('0xf')](util[_0xe988('0x2')](_0xe988('0x25'),_0x62a052['uniqueid'],_0x62a052['calleridnum'],_0x62a052[_0xe988('0x26')],_0x62a052[_0xe988('0x27')]));recordings[_0x62a052['uniqueid']]['calleridnum']=_0x62a052[_0xe988('0x28')];recordings[_0x62a052[_0xe988('0x4')]]['calleridname']=_0x62a052[_0xe988('0x26')];recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x29')]=_0x62a052[_0xe988('0x29')];recordings[_0x62a052[_0xe988('0x4')]]['connectedlinename']=_0x62a052[_0xe988('0x2a')];if(recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x2b')]==_0xe988('0x2c')&&recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x5')]){recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x29')]=recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x5')];recordings[_0x62a052['uniqueid']][_0xe988('0x2a')]='';}recordings[_0x62a052[_0xe988('0x4')]][_0xe988('0x22')][_0xe988('0x2d')](function(_0x2ca7d8){var _0x22aa21=_[_0xe988('0x2e')](recordings[_0x62a052[_0xe988('0x4')]]);_0x22aa21[_0xe988('0x1e')]=_0x2ca7d8[_0xe988('0x1e')];writeDB(_0x22aa21);});delete recordings[_0x62a052[_0xe988('0x4')]];}}catch(_0x52b610){utils[_0xe988('0x12')](util['format'](_0xe988('0x24'),_0x62a052[_0xe988('0x4')]),_0x52b610);}};exports[_0xe988('0x2f')]=function(_0x2ae477){try{if(!_[_0xe988('0x15')](recordings[_0x2ae477[_0xe988('0x4')]])){utils[_0xe988('0xd')](util[_0xe988('0x2')](_0xe988('0x30'),_0x2ae477['uniqueid']),_0x2ae477);utils[_0xe988('0xf')](util['format'](_0xe988('0x31'),_0x2ae477['uniqueid'],_0x2ae477[_0xe988('0x32')],_0x2ae477[_0xe988('0x33')]));if(_0x2ae477[_0xe988('0x32')][_0xe988('0x34')]()=='set'&&_[_0xe988('0x35')](_0x2ae477[_0xe988('0x33')][_0xe988('0x34')](),'cdr')){var _0x568f0e=_0x2ae477[_0xe988('0x33')]['split']('=');var _0x42f0f9=_0x568f0e[0x0][_0xe988('0x36')](_0x568f0e[0x0][_0xe988('0x37')]('(')+0x1,_0x568f0e[0x0]['lastIndexOf'](')'));var _0x28d193=_0x568f0e[0x1];recordings[_0x2ae477[_0xe988('0x4')]][_0x42f0f9]=_0x28d193;}}}catch(_0x4a7b80){utils[_0xe988('0x12')](util[_0xe988('0x2')](_0xe988('0x30'),_0x2ae477[_0xe988('0x4')]),_0x4a7b80);}};exports[_0xe988('0x38')]=function(_0x210351){try{if(!_[_0xe988('0x15')](recordings[_0x210351[_0xe988('0x4')]])){utils['debug'](util[_0xe988('0x2')](_0xe988('0x39'),_0x210351[_0xe988('0x4')]),_0x210351);utils['info'](util[_0xe988('0x2')](_0xe988('0x3a'),_0x210351[_0xe988('0x4')],_0x210351[_0xe988('0x3b')]));recordings[_0x210351[_0xe988('0x4')]][_0xe988('0x3b')]=_0x210351['queue'];}}catch(_0xe267f2){utils[_0xe988('0x12')](util[_0xe988('0x2')]('[%s][recordings][queuecallerjoin]',_0x210351[_0xe988('0x4')]),_0xe267f2);}}; \ No newline at end of file +var _0xe5d7=['type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','cdr','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','uniqueid','accountcode','getUserByInternal','then','name','UserId','request','CreateVoiceRecording','newchannel','format','[%s][recordings][newchannel]','linkedid','exten','error','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','channel','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','isNil','mixmonitor_filename','debug','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename'];(function(_0x336711,_0x2de898){var _0x590253=function(_0x41883e){while(--_0x41883e){_0x336711['push'](_0x336711['shift']());}};_0x590253(++_0x2de898);}(_0xe5d7,0x1ef));var _0x7e5d=function(_0x197362,_0x4e193e){_0x197362=_0x197362-0x0;var _0x3e0d7c=_0xe5d7[_0x197362];return _0x3e0d7c;};'use strict';var _=require(_0x7e5d('0x0'));var util=require('util');var utils=require(_0x7e5d('0x1'));var recordings={};function writeDB(_0x46fd9a){utils[_0x7e5d('0x2')](util['format']('[%s][recordings][writeDB]',_0x46fd9a[_0x7e5d('0x3')]));if(_0x46fd9a[_0x7e5d('0x4')]){utils[_0x7e5d('0x5')](_0x46fd9a['accountcode'])[_0x7e5d('0x6')](function(_0xa33545){if(_0xa33545){_0x46fd9a['membername']=_0xa33545[_0x7e5d('0x7')];_0x46fd9a[_0x7e5d('0x8')]=_0xa33545['id'];}utils[_0x7e5d('0x9')](_0x7e5d('0xa'),_0x46fd9a);});}else{utils[_0x7e5d('0x9')](_0x7e5d('0xa'),_0x46fd9a);}}exports[_0x7e5d('0xb')]=function(_0x596f7d){try{utils['debug'](util[_0x7e5d('0xc')](_0x7e5d('0xd'),_0x596f7d[_0x7e5d('0x3')]),_0x596f7d);if(_0x596f7d[_0x7e5d('0x3')]==_0x596f7d[_0x7e5d('0xe')]){utils['info'](util['format']('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x596f7d['uniqueid'],_0x596f7d['context'],_0x596f7d[_0x7e5d('0xf')]));recordings[_0x596f7d[_0x7e5d('0x3')]]={'uniqueid':_0x596f7d[_0x7e5d('0x3')],'accountcode':_0x596f7d[_0x7e5d('0x4')],'exten':_0x596f7d[_0x7e5d('0xf')],'context':_0x596f7d['context'],'channel':_0x596f7d['channel'],'monitors':[]};}}catch(_0x539bde){utils[_0x7e5d('0x10')](util[_0x7e5d('0xc')](_0x7e5d('0xd'),_0x596f7d[_0x7e5d('0x3')]),_0x539bde);}};exports['newstate']=function(_0x1f9214){try{utils['debug'](util[_0x7e5d('0xc')](_0x7e5d('0x11'),_0x1f9214[_0x7e5d('0x3')]),_0x1f9214);if(!_['isNil'](recordings[_0x1f9214['uniqueid']])&&_0x1f9214[_0x7e5d('0x12')]==0x6){utils[_0x7e5d('0x2')](util[_0x7e5d('0xc')](_0x7e5d('0x13'),_0x1f9214['uniqueid'],_0x1f9214[_0x7e5d('0x14')],_0x1f9214[_0x7e5d('0x15')]));}else if(!_['isNil'](recordings[_0x1f9214[_0x7e5d('0xe')]])&&_0x1f9214[_0x7e5d('0x12')]==0x6&&_0x1f9214[_0x7e5d('0x14')]!=_0x7e5d('0x16')){utils['info'](util['format'](_0x7e5d('0x17'),_0x1f9214['uniqueid'],_0x1f9214['linkedid'],_0x1f9214[_0x7e5d('0x14')],_0x1f9214[_0x7e5d('0x15')]));recordings[_0x1f9214[_0x7e5d('0xe')]][_0x7e5d('0x4')]=_0x1f9214['accountcode'];}}catch(_0x3ab923){utils['error'](util['format'](_0x7e5d('0x11'),_0x1f9214[_0x7e5d('0x3')]),_0x3ab923);}};exports[_0x7e5d('0x18')]=function(_0x54a7aa){try{if(!_[_0x7e5d('0x19')](_0x54a7aa['variable'])&&!_['isNil'](_0x54a7aa['variable'][_0x7e5d('0x1a')])){utils[_0x7e5d('0x1b')](util[_0x7e5d('0xc')](_0x7e5d('0x1c'),_0x54a7aa[_0x7e5d('0x3')]),_0x54a7aa);utils[_0x7e5d('0x2')](util['format'](_0x7e5d('0x1d'),_0x54a7aa[_0x7e5d('0x3')],_0x54a7aa[_0x7e5d('0x1e')],_0x54a7aa[_0x7e5d('0x1f')]));if(_[_0x7e5d('0x20')](_0x54a7aa[_0x7e5d('0x1f')],_0x7e5d('0x21'))){_0x54a7aa[_0x7e5d('0x1f')]=_0x54a7aa[_0x7e5d('0x1f')][_0x7e5d('0x22')](_0x7e5d('0x21'),_0x7e5d('0x23'));}if(recordings[_0x54a7aa[_0x7e5d('0xe')]]){var _0x223d7f=_[_0x7e5d('0x24')](recordings[_0x54a7aa[_0x7e5d('0xe')]][_0x7e5d('0x25')],{'value':_0x54a7aa[_0x7e5d('0x1f')]});if(_['isNil'](_0x223d7f)){recordings[_0x54a7aa['linkedid']]['monitors'][_0x7e5d('0x26')]({'value':_0x54a7aa[_0x7e5d('0x1f')]});}}}}catch(_0x5cd631){utils[_0x7e5d('0x10')](util[_0x7e5d('0xc')]('[%s][recordings][varset]',_0x54a7aa['uniqueid']),_0x5cd631);}};exports['hangup']=function(_0x5c8b1e){try{if(!_[_0x7e5d('0x19')](recordings[_0x5c8b1e['uniqueid']])){utils['debug'](util[_0x7e5d('0xc')](_0x7e5d('0x27'),_0x5c8b1e[_0x7e5d('0x3')]),_0x5c8b1e);utils[_0x7e5d('0x2')](util[_0x7e5d('0xc')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x5c8b1e[_0x7e5d('0x3')],_0x5c8b1e[_0x7e5d('0x28')],_0x5c8b1e[_0x7e5d('0x29')],_0x5c8b1e[_0x7e5d('0x2a')]));recordings[_0x5c8b1e['uniqueid']]['calleridnum']=_0x5c8b1e['calleridnum'];recordings[_0x5c8b1e[_0x7e5d('0x3')]][_0x7e5d('0x29')]=_0x5c8b1e['calleridname'];recordings[_0x5c8b1e['uniqueid']][_0x7e5d('0x2b')]=_0x5c8b1e[_0x7e5d('0x2b')];recordings[_0x5c8b1e[_0x7e5d('0x3')]][_0x7e5d('0x2c')]=_0x5c8b1e[_0x7e5d('0x2c')];if(recordings[_0x5c8b1e[_0x7e5d('0x3')]][_0x7e5d('0x2d')]==_0x7e5d('0x2e')&&recordings[_0x5c8b1e[_0x7e5d('0x3')]]['accountcode']){recordings[_0x5c8b1e['uniqueid']][_0x7e5d('0x2b')]=recordings[_0x5c8b1e['uniqueid']][_0x7e5d('0x4')];recordings[_0x5c8b1e[_0x7e5d('0x3')]]['connectedlinename']='';}recordings[_0x5c8b1e['uniqueid']][_0x7e5d('0x25')][_0x7e5d('0x2f')](function(_0x409db4){var _0x252a90=_[_0x7e5d('0x30')](recordings[_0x5c8b1e[_0x7e5d('0x3')]]);_0x252a90['value']=_0x409db4['value'];writeDB(_0x252a90);});delete recordings[_0x5c8b1e['uniqueid']];}}catch(_0x39d24c){utils[_0x7e5d('0x10')](util[_0x7e5d('0xc')](_0x7e5d('0x27'),_0x5c8b1e[_0x7e5d('0x3')]),_0x39d24c);}};exports[_0x7e5d('0x31')]=function(_0x4d8027){try{if(!_[_0x7e5d('0x19')](recordings[_0x4d8027['uniqueid']])){utils[_0x7e5d('0x1b')](util[_0x7e5d('0xc')](_0x7e5d('0x32'),_0x4d8027[_0x7e5d('0x3')]),_0x4d8027);utils[_0x7e5d('0x2')](util[_0x7e5d('0xc')](_0x7e5d('0x33'),_0x4d8027['uniqueid'],_0x4d8027[_0x7e5d('0x34')],_0x4d8027[_0x7e5d('0x35')]));if(_0x4d8027[_0x7e5d('0x34')]['toLowerCase']()=='set'&&_[_0x7e5d('0x36')](_0x4d8027[_0x7e5d('0x35')]['toLowerCase'](),_0x7e5d('0x37'))){var _0x30cf51=_0x4d8027[_0x7e5d('0x35')]['split']('=');var _0x2d21db=_0x30cf51[0x0]['substring'](_0x30cf51[0x0][_0x7e5d('0x38')]('(')+0x1,_0x30cf51[0x0][_0x7e5d('0x38')](')'));var _0xeb8da0=_0x30cf51[0x1];recordings[_0x4d8027[_0x7e5d('0x3')]][_0x2d21db]=_0xeb8da0;}}}catch(_0x5d4a8c){utils[_0x7e5d('0x10')](util[_0x7e5d('0xc')](_0x7e5d('0x32'),_0x4d8027[_0x7e5d('0x3')]),_0x5d4a8c);}};exports['queuecallerjoin']=function(_0x2865c9){try{if(!_[_0x7e5d('0x19')](recordings[_0x2865c9[_0x7e5d('0x3')]])){utils['debug'](util[_0x7e5d('0xc')](_0x7e5d('0x39'),_0x2865c9[_0x7e5d('0x3')]),_0x2865c9);utils['info'](util[_0x7e5d('0xc')](_0x7e5d('0x3a'),_0x2865c9[_0x7e5d('0x3')],_0x2865c9[_0x7e5d('0x3b')]));recordings[_0x2865c9[_0x7e5d('0x3')]][_0x7e5d('0x3b')]=_0x2865c9['queue'];}}catch(_0x1f4919){utils[_0x7e5d('0x10')](util[_0x7e5d('0xc')](_0x7e5d('0x39'),_0x2865c9[_0x7e5d('0x3')]),_0x1f4919);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3da4663..7dc76c7 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 _0xe018=['origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','lodash','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','request','CreateVoiceTransferReport','blindtransfer','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','debug','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinename'];(function(_0x2299a0,_0x1229f0){var _0x1eebca=function(_0x4d794c){while(--_0x4d794c){_0x2299a0['push'](_0x2299a0['shift']());}};_0x1eebca(++_0x1229f0);}(_0xe018,0x7a));var _0x8e01=function(_0x33a0a9,_0x49bb8b){_0x33a0a9=_0x33a0a9-0x0;var _0x3466bc=_0xe018[_0x33a0a9];return _0x3466bc;};'use strict';var _=require(_0x8e01('0x0'));var util=require(_0x8e01('0x1'));var utils=require(_0x8e01('0x2'));function writeDB(_0xf20067){utils['info'](util[_0x8e01('0x3')](_0x8e01('0x4'),_0xf20067[_0x8e01('0x5')]===_0x8e01('0x6')?_0xf20067['origtransfereruniqueid']:_0xf20067['uniqueid'],_0xf20067[_0x8e01('0x5')]));utils[_0x8e01('0x7')](_0x8e01('0x8'),_0xf20067);}exports[_0x8e01('0x9')]=function(_0x474101){try{utils['debug'](util[_0x8e01('0x3')]('[%s][transfers][blindtransfer]',_0x474101[_0x8e01('0xa')]),_0x474101);utils['info'](util['format'](_0x8e01('0xb'),_0x474101[_0x8e01('0xa')],_0x474101['transferercalleridnum'],_0x474101['transferercalleridname'],_0x474101[_0x8e01('0xc')],_0x474101[_0x8e01('0xd')]));_0x474101[_0x8e01('0x5')]=_0x8e01('0xe');writeDB(_0x474101);}catch(_0x288765){utils[_0x8e01('0xf')](util[_0x8e01('0x3')](_0x8e01('0x10'),_0x474101[_0x8e01('0xa')]),_0x288765);}};exports['attendedtransfer']=function(_0xed39f3){try{utils[_0x8e01('0x11')](util[_0x8e01('0x3')](_0x8e01('0x12'),_0xed39f3['origtransfereruniqueid']),_0xed39f3);utils['info'](util[_0x8e01('0x3')](_0x8e01('0x13'),_0xed39f3[_0x8e01('0x14')],_0xed39f3[_0x8e01('0x15')],_0xed39f3[_0x8e01('0x16')],_0xed39f3[_0x8e01('0x17')],_0xed39f3['transfertargetcalleridname']));_0xed39f3=_['assign'](_0xed39f3,{'transfererchannel':_0xed39f3[_0x8e01('0x18')],'transferercalleridnum':_0xed39f3[_0x8e01('0x15')],'transferercalleridname':_0xed39f3['origtransferercalleridname'],'transfererconnectedlinenum':_0xed39f3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xed39f3[_0x8e01('0x19')],'transfereraccountcode':_0xed39f3[_0x8e01('0x1a')],'transferercontext':_0xed39f3['secondtransferercontext'],'transfererexten':_0xed39f3['secondtransfererexten'],'transfererlinkedid':_0xed39f3[_0x8e01('0x1b')],'context':_0xed39f3[_0x8e01('0x1c')],'extension':_0xed39f3['origtransfererexten'],'type':_0x8e01('0x6')});if(_[_0x8e01('0x1d')](_0xed39f3[_0x8e01('0x1e')])){_0xed39f3=_[_0x8e01('0x1f')](_0xed39f3,{'transfereechannel':_0xed39f3[_0x8e01('0x20')],'transfereecalleridnum':_0xed39f3[_0x8e01('0x17')],'transfereecalleridname':_0xed39f3['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xed39f3[_0x8e01('0x21')],'transfereeconnectedlinename':_0xed39f3[_0x8e01('0x22')],'transfereeaccountcode':_0xed39f3['transfertargetaccountcode'],'transfereecontext':_0xed39f3[_0x8e01('0x23')],'transfereeexten':_0xed39f3['transfertargetexten'],'transfereelinkedid':_0xed39f3[_0x8e01('0x24')]});}writeDB(_0xed39f3);}catch(_0x33e422){utils['error'](util['format']('[%s][transfers][attendedtransfer]',_0xed39f3[_0x8e01('0x14')]),_0x33e422);}}; \ No newline at end of file +var _0xa35a=['blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','uniqueid','request','CreateVoiceTransferReport'];(function(_0x498c70,_0x140439){var _0x18f191=function(_0xd45535){while(--_0xd45535){_0x498c70['push'](_0x498c70['shift']());}};_0x18f191(++_0x140439);}(_0xa35a,0xcd));var _0xaa35=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xa35a[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0xaa35('0x0'));var util=require(_0xaa35('0x1'));var utils=require(_0xaa35('0x2'));function writeDB(_0x3e16cf){utils[_0xaa35('0x3')](util[_0xaa35('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x3e16cf[_0xaa35('0x5')]===_0xaa35('0x6')?_0x3e16cf['origtransfereruniqueid']:_0x3e16cf[_0xaa35('0x7')],_0x3e16cf['type']));utils[_0xaa35('0x8')](_0xaa35('0x9'),_0x3e16cf);}exports[_0xaa35('0xa')]=function(_0x1f4993){try{utils[_0xaa35('0xb')](util[_0xaa35('0x4')](_0xaa35('0xc'),_0x1f4993[_0xaa35('0x7')]),_0x1f4993);utils['info'](util['format'](_0xaa35('0xd'),_0x1f4993[_0xaa35('0x7')],_0x1f4993[_0xaa35('0xe')],_0x1f4993['transferercalleridname'],_0x1f4993['transfereecalleridnum'],_0x1f4993[_0xaa35('0xf')]));_0x1f4993['type']=_0xaa35('0x10');writeDB(_0x1f4993);}catch(_0x1e0338){utils[_0xaa35('0x11')](util[_0xaa35('0x4')]('[%s][transfers][blindtransfer]',_0x1f4993[_0xaa35('0x7')]),_0x1e0338);}};exports[_0xaa35('0x12')]=function(_0x548e82){try{utils[_0xaa35('0xb')](util[_0xaa35('0x4')](_0xaa35('0x13'),_0x548e82[_0xaa35('0x14')]),_0x548e82);utils[_0xaa35('0x3')](util[_0xaa35('0x4')](_0xaa35('0x15'),_0x548e82[_0xaa35('0x14')],_0x548e82[_0xaa35('0x16')],_0x548e82[_0xaa35('0x17')],_0x548e82[_0xaa35('0x18')],_0x548e82['transfertargetcalleridname']));_0x548e82=_['assign'](_0x548e82,{'transfererchannel':_0x548e82[_0xaa35('0x19')],'transferercalleridnum':_0x548e82['origtransferercalleridnum'],'transferercalleridname':_0x548e82['origtransferercalleridname'],'transfererconnectedlinenum':_0x548e82[_0xaa35('0x1a')],'transfererconnectedlinename':_0x548e82[_0xaa35('0x1b')],'transfereraccountcode':_0x548e82[_0xaa35('0x1c')],'transferercontext':_0x548e82['secondtransferercontext'],'transfererexten':_0x548e82[_0xaa35('0x1d')],'transfererlinkedid':_0x548e82[_0xaa35('0x1e')],'context':_0x548e82[_0xaa35('0x1f')],'extension':_0x548e82[_0xaa35('0x20')],'type':_0xaa35('0x6')});if(_[_0xaa35('0x21')](_0x548e82[_0xaa35('0x22')])){_0x548e82=_[_0xaa35('0x23')](_0x548e82,{'transfereechannel':_0x548e82[_0xaa35('0x24')],'transfereecalleridnum':_0x548e82[_0xaa35('0x18')],'transfereecalleridname':_0x548e82[_0xaa35('0x25')],'transfereeconnectedlinenum':_0x548e82[_0xaa35('0x26')],'transfereeconnectedlinename':_0x548e82[_0xaa35('0x27')],'transfereeaccountcode':_0x548e82['transfertargetaccountcode'],'transfereecontext':_0x548e82[_0xaa35('0x28')],'transfereeexten':_0x548e82[_0xaa35('0x29')],'transfereelinkedid':_0x548e82[_0xaa35('0x2a')]});}writeDB(_0x548e82);}catch(_0x64c5e1){utils[_0xaa35('0x11')](util['format'](_0xaa35('0x13'),_0x548e82['origtransfereruniqueid']),_0x64c5e1);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index c852b9d..dc0b5fd 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 _0xb996=['info','debug','inspect','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','error','[utils][getUserByInternal]','getUserByInterface','found','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','type','acwTimeout','result','[utils][getVoiceQueueByName]','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','format','isAfter','isBefore','bluebird','jayson/promise','moment','client','http','../../config/logger','xdr'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb996,0x179));var _0x6b99=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xb996[_0x37bd26];return _0xe83dc4;};'use strict';var BPromise=require(_0x6b99('0x0'));var jayson=require(_0x6b99('0x1'));var moment=require(_0x6b99('0x2'));var util=require('util');var client=jayson[_0x6b99('0x3')][_0x6b99('0x4')]({'port':0x2329});var logger=require(_0x6b99('0x5'))(_0x6b99('0x6'));exports[_0x6b99('0x7')]=function(_0x492fef,_0x4beb8a){logger[_0x6b99('0x7')](_0x492fef,_0x4beb8a?util['inspect'](_0x4beb8a,{'showHidden':![],'depth':null}):'');};exports[_0x6b99('0x8')]=function(_0x3c2843,_0x427d9f){logger[_0x6b99('0x8')](_0x3c2843,_0x427d9f?util['inspect'](_0x427d9f,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x38f1ec,_0xd4001a){logger['error'](_0x38f1ec,_0xd4001a?util[_0x6b99('0x9')](_0xd4001a,{'showHidden':![],'depth':null}):'');};exports[_0x6b99('0xa')]=function(_0x34bbb2,_0x46ae8f){return client[_0x6b99('0xa')](_0x34bbb2,{'body':_0x46ae8f})[_0x6b99('0xb')](function(_0x6a445f){logger[_0x6b99('0x8')](_0x6b99('0xc'),_0x34bbb2,_0x6a445f?util['inspect'](_0x6a445f,{'showHidden':![],'depth':null}):'');})[_0x6b99('0xd')](function(_0x41e6f1){logger['error'](_0x6b99('0xc'),_0x34bbb2,_0x41e6f1?util[_0x6b99('0x9')](_0x41e6f1,{'showHidden':![],'depth':null}):'');});};function getUser(_0x49936e){return client[_0x6b99('0xa')](_0x6b99('0xe'),{'options':{'raw':!![],'attributes':['id',_0x6b99('0xf'),_0x6b99('0x10'),_0x6b99('0x11')],'where':_0x49936e,'limit':0x1}})['then'](function(_0x10c55a){logger['debug'](_0x6b99('0x12'),JSON[_0x6b99('0x13')](_0x49936e),_0x10c55a?util[_0x6b99('0x9')](_0x10c55a,{'showHidden':![],'depth':null}):'');return _0x10c55a['result'][_0x6b99('0x14')]?_0x10c55a['result'][0x0]:null;});}exports[_0x6b99('0x15')]=function(_0x34e48d){return new BPromise(function(_0x3695ad,_0x5eb938){if(_0x34e48d){return getUser({'internal':_0x34e48d})['then'](function(_0x2681ee){logger[_0x6b99('0x7')](_0x6b99('0x16'),_0x34e48d,_0x2681ee?'found':'notfound');return _0x3695ad(_0x2681ee);})[_0x6b99('0xd')](function(_0x203716){logger[_0x6b99('0x17')](_0x6b99('0x18'),_0x203716?util['inspect'](_0x203716,{'showHidden':![],'depth':null}):'');return _0x3695ad(null);});}return _0x3695ad(null);});};exports[_0x6b99('0x19')]=function(_0xfffc59){return new BPromise(function(_0x3ad619,_0x169390){if(_0xfffc59){return getUser({'interface':_0xfffc59})[_0x6b99('0xb')](function(_0x569c95){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0xfffc59,_0x569c95?_0x6b99('0x1a'):'notfound');return _0x3ad619(_0x569c95);})[_0x6b99('0xd')](function(_0x1febc5){logger[_0x6b99('0x17')](_0x6b99('0x1b'),_0x1febc5?util[_0x6b99('0x9')](_0x1febc5,{'showHidden':![],'depth':null}):'');return _0x3ad619(null);});}return _0x3ad619(null);});};exports[_0x6b99('0x1c')]=function(_0x45946b){return new BPromise(function(_0x25bc71,_0xce4d2a){if(_0x45946b){return getUser({'name':_0x45946b})[_0x6b99('0xb')](function(_0x2c8cea){logger[_0x6b99('0x7')](_0x6b99('0x1d'),_0x45946b,_0x2c8cea?_0x6b99('0x1a'):_0x6b99('0x1e'));return _0x25bc71(_0x2c8cea);})[_0x6b99('0xd')](function(_0x59231d){logger[_0x6b99('0x17')](_0x6b99('0x1f'),_0x59231d?util[_0x6b99('0x9')](_0x59231d,{'showHidden':![],'depth':null}):'');return _0x25bc71(null);});}return _0x25bc71(null);});};exports['getVoiceQueueByName']=function(_0x432fa6){return new BPromise(function(_0x51df7a,_0x77a7db){if(_0x432fa6){return client[_0x6b99('0xa')](_0x6b99('0x20'),{'options':{'raw':!![],'attributes':['id','name',_0x6b99('0x21'),'acw',_0x6b99('0x22')],'where':{'name':_0x432fa6},'limit':0x1}})['then'](function(_0x118b87){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x432fa6,_0x118b87?util[_0x6b99('0x9')](_0x118b87,{'showHidden':![],'depth':null}):'');logger[_0x6b99('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x432fa6,_0x118b87?_0x6b99('0x1a'):_0x6b99('0x1e'));return _0x51df7a(_0x118b87[_0x6b99('0x23')][_0x6b99('0x14')]?_0x118b87[_0x6b99('0x23')][0x0]:null);})['catch'](function(_0x18725a){logger[_0x6b99('0x17')](_0x6b99('0x24'),_0x18725a?util['inspect'](_0x18725a,{'showHidden':![],'depth':null}):'');return _0x51df7a(null);});}return _0x51df7a(null);});};exports['addTime']=function(_0x49e4b5,_0x5a489c){return moment(_0x49e4b5)['add'](_0x5a489c,_0x6b99('0x25'))['format'](_0x6b99('0x26'));};exports[_0x6b99('0x27')]=function(_0x35edba,_0x1f4ca0){return moment(_0x35edba)[_0x6b99('0x28')](_0x1f4ca0,_0x6b99('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x6b99('0x29')]=function(_0x2281a8,_0x595b7b){return moment(_0x2281a8)[_0x6b99('0x2a')](moment(_0x595b7b),_0x6b99('0x25'));};exports[_0x6b99('0x2b')]=function(_0xecf6bb,_0x2d5d73){return parseInt(_0xecf6bb,0xa)+parseInt(_0x2d5d73,0xa);};exports[_0x6b99('0x2c')]=function(){return moment()[_0x6b99('0x2d')](_0x6b99('0x26'));};exports[_0x6b99('0x2e')]=function(_0x54d505,_0x4f256c){if(_0x4f256c){return moment(_0x54d505)[_0x6b99('0x2e')](_0x4f256c);}return!![];};exports[_0x6b99('0x2f')]=function(_0x402b00,_0x4f8a71){if(_0x4f8a71){return moment(_0x402b00)[_0x6b99('0x2f')](_0x4f8a71);}else if(_0x402b00){return!![];}return![];}; \ No newline at end of file +var _0x8efc=['getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]','addTime','add','format','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isAfter','isBefore','moment','client','../../config/logger','xdr','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','getUserByInterface','info','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x4edda2,_0x472bc0){var _0x1b3455=function(_0x2e8634){while(--_0x2e8634){_0x4edda2['push'](_0x4edda2['shift']());}};_0x1b3455(++_0x472bc0);}(_0x8efc,0x8f));var _0xc8ef=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x8efc[_0x5c2c7c];return _0xea7ffe;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xc8ef('0x0'));var util=require('util');var client=jayson[_0xc8ef('0x1')]['http']({'port':0x2329});var logger=require(_0xc8ef('0x2'))(_0xc8ef('0x3'));exports['info']=function(_0x4ee0cc,_0x13b577){logger['info'](_0x4ee0cc,_0x13b577?util[_0xc8ef('0x4')](_0x13b577,{'showHidden':![],'depth':null}):'');};exports[_0xc8ef('0x5')]=function(_0x1648ac,_0x1f7596){logger[_0xc8ef('0x5')](_0x1648ac,_0x1f7596?util['inspect'](_0x1f7596,{'showHidden':![],'depth':null}):'');};exports[_0xc8ef('0x6')]=function(_0x4f59b2,_0x35597b){logger[_0xc8ef('0x6')](_0x4f59b2,_0x35597b?util[_0xc8ef('0x4')](_0x35597b,{'showHidden':![],'depth':null}):'');};exports[_0xc8ef('0x7')]=function(_0x49f653,_0x504d31){return client['request'](_0x49f653,{'body':_0x504d31})[_0xc8ef('0x8')](function(_0x20b2ef){logger[_0xc8ef('0x5')](_0xc8ef('0x9'),_0x49f653,_0x20b2ef?util['inspect'](_0x20b2ef,{'showHidden':![],'depth':null}):'');})[_0xc8ef('0xa')](function(_0x99f830){logger[_0xc8ef('0x6')](_0xc8ef('0x9'),_0x49f653,_0x99f830?util[_0xc8ef('0x4')](_0x99f830,{'showHidden':![],'depth':null}):'');});};function getUser(_0x242be4){return client[_0xc8ef('0x7')](_0xc8ef('0xb'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xc8ef('0xc')],'where':_0x242be4,'limit':0x1}})[_0xc8ef('0x8')](function(_0x3ff131){logger[_0xc8ef('0x5')](_0xc8ef('0xd'),JSON[_0xc8ef('0xe')](_0x242be4),_0x3ff131?util[_0xc8ef('0x4')](_0x3ff131,{'showHidden':![],'depth':null}):'');return _0x3ff131[_0xc8ef('0xf')]['length']?_0x3ff131['result'][0x0]:null;});}exports[_0xc8ef('0x10')]=function(_0x1dc488){return new BPromise(function(_0x166ec4,_0x183c85){if(_0x1dc488){return getUser({'internal':_0x1dc488})['then'](function(_0x5dc90b){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1dc488,_0x5dc90b?_0xc8ef('0x11'):'notfound');return _0x166ec4(_0x5dc90b);})[_0xc8ef('0xa')](function(_0x34b7a8){logger[_0xc8ef('0x6')]('[utils][getUserByInternal]',_0x34b7a8?util[_0xc8ef('0x4')](_0x34b7a8,{'showHidden':![],'depth':null}):'');return _0x166ec4(null);});}return _0x166ec4(null);});};exports[_0xc8ef('0x12')]=function(_0x190ec2){return new BPromise(function(_0x46eb23,_0x1d8a88){if(_0x190ec2){return getUser({'interface':_0x190ec2})[_0xc8ef('0x8')](function(_0x1db74d){logger[_0xc8ef('0x13')](_0xc8ef('0x14'),_0x190ec2,_0x1db74d?_0xc8ef('0x11'):_0xc8ef('0x15'));return _0x46eb23(_0x1db74d);})[_0xc8ef('0xa')](function(_0x52f695){logger['error'](_0xc8ef('0x16'),_0x52f695?util[_0xc8ef('0x4')](_0x52f695,{'showHidden':![],'depth':null}):'');return _0x46eb23(null);});}return _0x46eb23(null);});};exports[_0xc8ef('0x17')]=function(_0x5f50){return new BPromise(function(_0x16c6d4,_0x50238c){if(_0x5f50){return getUser({'name':_0x5f50})['then'](function(_0x14c3d0){logger[_0xc8ef('0x13')](_0xc8ef('0x18'),_0x5f50,_0x14c3d0?'found':_0xc8ef('0x15'));return _0x16c6d4(_0x14c3d0);})[_0xc8ef('0xa')](function(_0xf285d9){logger[_0xc8ef('0x6')]('[utils][getUserByName]',_0xf285d9?util['inspect'](_0xf285d9,{'showHidden':![],'depth':null}):'');return _0x16c6d4(null);});}return _0x16c6d4(null);});};exports[_0xc8ef('0x19')]=function(_0xc203df){return new BPromise(function(_0xa257a3,_0x59ec97){if(_0xc203df){return client[_0xc8ef('0x7')](_0xc8ef('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xc8ef('0x1b'),'type',_0xc8ef('0x1c'),_0xc8ef('0x1d')],'where':{'name':_0xc203df},'limit':0x1}})[_0xc8ef('0x8')](function(_0x3a54d4){logger[_0xc8ef('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0xc203df,_0x3a54d4?util[_0xc8ef('0x4')](_0x3a54d4,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0xc203df,_0x3a54d4?_0xc8ef('0x11'):'notfound');return _0xa257a3(_0x3a54d4[_0xc8ef('0xf')]['length']?_0x3a54d4['result'][0x0]:null);})[_0xc8ef('0xa')](function(_0x41da86){logger[_0xc8ef('0x6')](_0xc8ef('0x1e'),_0x41da86?util[_0xc8ef('0x4')](_0x41da86,{'showHidden':![],'depth':null}):'');return _0xa257a3(null);});}return _0xa257a3(null);});};exports[_0xc8ef('0x1f')]=function(_0x4c7ca3,_0x673423){return moment(_0x4c7ca3)[_0xc8ef('0x20')](_0x673423,'seconds')[_0xc8ef('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x11b749,_0x18680b){return moment(_0x11b749)[_0xc8ef('0x22')](_0x18680b,_0xc8ef('0x23'))['format'](_0xc8ef('0x24'));};exports[_0xc8ef('0x25')]=function(_0x23fab4,_0x1bda5f){return moment(_0x23fab4)[_0xc8ef('0x26')](moment(_0x1bda5f),_0xc8ef('0x23'));};exports[_0xc8ef('0x27')]=function(_0x5d32c8,_0x21e53d){return parseInt(_0x5d32c8,0xa)+parseInt(_0x21e53d,0xa);};exports['now']=function(){return moment()['format'](_0xc8ef('0x24'));};exports[_0xc8ef('0x28')]=function(_0x1110e8,_0x1bb28e){if(_0x1bb28e){return moment(_0x1110e8)[_0xc8ef('0x28')](_0x1bb28e);}return!![];};exports[_0xc8ef('0x29')]=function(_0x38c56a,_0x432eb0){if(_0x432eb0){return moment(_0x38c56a)[_0xc8ef('0x29')](_0x432eb0);}else if(_0x38c56a){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 f9c150a..72252e4 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 _0xd9db=['api','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_id','test','setupLoggers','fs-extra','lodash','express-winston','path','util','./loggers','./safe-template','./mask-sensitive-data','maskSensitiveData','join','log','xcally','client','role','name','ensureDir','user','then','no-user','timestamp','catch','error'];(function(_0x4383e9,_0xa4b307){var _0x355405=function(_0x545b5b){while(--_0x545b5b){_0x4383e9['push'](_0x4383e9['shift']());}};_0x355405(++_0xa4b307);}(_0xd9db,0x1b6));var _0xbd9d=function(_0x804749,_0x32242a){_0x804749=_0x804749-0x0;var _0x53e2ff=_0xd9db[_0x804749];return _0x53e2ff;};var fs=require(_0xbd9d('0x0'));var _=require(_0xbd9d('0x1'));var ewinston=require(_0xbd9d('0x2'));var path=require(_0xbd9d('0x3'));var util=require(_0xbd9d('0x4'));var fileLogger=require(_0xbd9d('0x5'))['fileLogger'];var safeTemplate=require(_0xbd9d('0x6'))['safeTemplate'];var maskSensitiveData=require(_0xbd9d('0x7'))[_0xbd9d('0x8')];function ClientSideLogger(){function _0xbc7bd4(_0x36d25b){var _0x29aee2=path[_0xbd9d('0x9')]('/var',_0xbd9d('0xa'),_0xbd9d('0xb'));var _0x15db3f=path[_0xbd9d('0x9')](_0xbd9d('0xc'),_0x36d25b[_0xbd9d('0xd')]+'-'+_0x36d25b[_0xbd9d('0xe')]);return fs[_0xbd9d('0xf')](path[_0xbd9d('0x9')](_0x29aee2,_0x15db3f))['then'](function(){var _0x3fd5f7=fileLogger(_0xbd9d('0xc'),path[_0xbd9d('0x9')](_0x29aee2,_0x15db3f));return _0x3fd5f7;})['catch'](function(_0x53bcae){throw _0x53bcae;});}this[_0xbd9d('0xa')]=function(_0x179fc2,_0x552062,_0x4bcc29,_0x443903){return _0xbc7bd4(_0x179fc2[_0xbd9d('0x10')])[_0xbd9d('0x11')](function(_0x5506bd){var _0x5399ba=_0x5506bd[_0x552062];return _0x5399ba;})['then'](function(_0x1f9b07){var _0x3641a4=_0x179fc2[_0xbd9d('0x10')]?_0x179fc2[_0xbd9d('0x10')]['id']:_0xbd9d('0x12');var _0x10a93b=_0x443903['data'];var _0x254247=_0x443903[_0xbd9d('0x13')];var _0x22ec1c=new Date(Number(_0x254247));return _0x1f9b07(_0x3641a4,_0x22ec1c,_0x4bcc29,_0x10a93b);})[_0xbd9d('0x14')](function(_0xe3b320){fileLogger(_0xbd9d('0xc'))[_0xbd9d('0x15')](_0xe3b320);});};}function setupLoggers(_0x772a49){return new Promise(function(_0x518f9f){var _0x3d3cad=new ClientSideLogger();var _0x1283c6=fileLogger(_0xbd9d('0x16'));var _0x198ea3=fileLogger('auth');_0x772a49['set'](_0xbd9d('0x17'),_0x3d3cad);_0x772a49[_0xbd9d('0x18')](ewinston[_0xbd9d('0x19')]({'winstonInstance':_0x1283c6,'meta':![],'statusLevels':!![],'msg':function(_0x35f920,_0x301dd8){var _0x2fc140=_0xbd9d('0x1a');if(!_['isEmpty'](_0x35f920[_0xbd9d('0x1b')])){_0x2fc140+=_0xbd9d('0x1c');var _0xb1ac9d=_0x35f920[_0xbd9d('0x1b')];maskSensitiveData(_0xb1ac9d);}return safeTemplate(util[_0xbd9d('0x1d')](_0x2fc140,_0x35f920[_0xbd9d('0x1e')],_0x35f920[_0xbd9d('0x1f')][_0xbd9d('0x20')]?_0x35f920['headers']['x-forwarded-for']:_0x35f920[_0xbd9d('0x21')][_0xbd9d('0x22')]||_0x35f920['ip'],_0x35f920[_0xbd9d('0x23')],_0x301dd8[_0xbd9d('0x24')],_0x301dd8[_0xbd9d('0x25')],_0x35f920['user']?_0x35f920[_0xbd9d('0x10')]['id']:null,_0x35f920['user']?_0x35f920[_0xbd9d('0x10')][_0xbd9d('0xe')]:null,_0x35f920[_0xbd9d('0x10')]?_0x35f920['user'][_0xbd9d('0xd')]:null,_0xb1ac9d?util[_0xbd9d('0x26')](_0xb1ac9d,![],null):''));}}));_0x772a49[_0xbd9d('0x18')](ewinston[_0xbd9d('0x19')]({'winstonInstance':_0x198ea3,'meta':![],'statusLevels':!![],'msg':function(_0x34e1f0,_0x3b4402){var _0x4cc09e=_0xbd9d('0x27');if(_0x34e1f0[_0xbd9d('0x1b')]&&_0x34e1f0['body'][_0xbd9d('0x28')]&&_0x34e1f0['body']['agent_id']){_0x4cc09e=_0xbd9d('0x29');}return util[_0xbd9d('0x1d')](_0x4cc09e,_0x34e1f0[_0xbd9d('0x1e')],_0x34e1f0[_0xbd9d('0x1f')][_0xbd9d('0x20')]?_0x34e1f0[_0xbd9d('0x1f')]['x-forwarded-for']:_0x34e1f0[_0xbd9d('0x21')][_0xbd9d('0x22')]||_0x34e1f0['ip'],_0x34e1f0[_0xbd9d('0x23')],_0x3b4402[_0xbd9d('0x24')],_0x3b4402[_0xbd9d('0x25')],_0x34e1f0['user']?_0x34e1f0[_0xbd9d('0x10')]['id']:null,_0x34e1f0['user']?_0x34e1f0['user'][_0xbd9d('0xe')]:null,_0x34e1f0[_0xbd9d('0x10')]?_0x34e1f0['user'][_0xbd9d('0xd')]:null,_0x34e1f0['body']&&_0x34e1f0[_0xbd9d('0x1b')]['device']?_0x34e1f0[_0xbd9d('0x1b')][_0xbd9d('0x28')]:_0xbd9d('0x2a'),_0x34e1f0[_0xbd9d('0x1b')]&&_0x34e1f0[_0xbd9d('0x1b')][_0xbd9d('0x2b')]?_0x34e1f0[_0xbd9d('0x1b')][_0xbd9d('0x2b')]:'',_0x34e1f0[_0xbd9d('0x1b')]&&_0x34e1f0['body']['agent_name']?_0x34e1f0[_0xbd9d('0x1b')]['agent_name']:'');},'ignoreRoute':function(_0x37fedb){var _0x23a429=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x23a429[_0xbd9d('0x2c')](_0x37fedb[_0xbd9d('0x23')]);}}));return _0x518f9f();});}exports[_0xbd9d('0x2d')]=setupLoggers; \ No newline at end of file +var _0x6dc3=['role','inspect','use','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','agent_name','setupLoggers','fs-extra','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','log','xcally','join','name','ensureDir','client','catch','user','then','no-user','data','timestamp','error','auth','client-side-logger','logger','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','url','statusCode','responseTime'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x6dc3,0x182));var _0x36dc=function(_0xb1136a,_0xbfed72){_0xb1136a=_0xb1136a-0x0;var _0x1112b8=_0x6dc3[_0xb1136a];return _0x1112b8;};var fs=require(_0x36dc('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require('path');var util=require('util');var fileLogger=require(_0x36dc('0x1'))[_0x36dc('0x2')];var safeTemplate=require(_0x36dc('0x3'))[_0x36dc('0x4')];var maskSensitiveData=require(_0x36dc('0x5'))[_0x36dc('0x6')];function ClientSideLogger(){function _0x511a35(_0x11d6b0){var _0x18b7ed=path['join']('/var',_0x36dc('0x7'),_0x36dc('0x8'));var _0x56ae21=path[_0x36dc('0x9')]('client',_0x11d6b0['role']+'-'+_0x11d6b0[_0x36dc('0xa')]);return fs[_0x36dc('0xb')](path['join'](_0x18b7ed,_0x56ae21))['then'](function(){var _0x3f7c2f=fileLogger(_0x36dc('0xc'),path[_0x36dc('0x9')](_0x18b7ed,_0x56ae21));return _0x3f7c2f;})[_0x36dc('0xd')](function(_0x3397fa){throw _0x3397fa;});}this[_0x36dc('0x7')]=function(_0x3d99f7,_0x387c91,_0x22dfa7,_0x5ac51f){return _0x511a35(_0x3d99f7[_0x36dc('0xe')])[_0x36dc('0xf')](function(_0x214256){var _0x2d326d=_0x214256[_0x387c91];return _0x2d326d;})[_0x36dc('0xf')](function(_0x26d81e){var _0x3e5058=_0x3d99f7[_0x36dc('0xe')]?_0x3d99f7[_0x36dc('0xe')]['id']:_0x36dc('0x10');var _0x2303da=_0x5ac51f[_0x36dc('0x11')];var _0x476b48=_0x5ac51f[_0x36dc('0x12')];var _0x52e85c=new Date(Number(_0x476b48));return _0x26d81e(_0x3e5058,_0x52e85c,_0x22dfa7,_0x2303da);})['catch'](function(_0xbf2b06){fileLogger(_0x36dc('0xc'))[_0x36dc('0x13')](_0xbf2b06);});};}function setupLoggers(_0x3833be){return new Promise(function(_0x523dc3){var _0x33e83f=new ClientSideLogger();var _0x128cbd=fileLogger('api');var _0x3b915f=fileLogger(_0x36dc('0x14'));_0x3833be['set'](_0x36dc('0x15'),_0x33e83f);_0x3833be['use'](ewinston[_0x36dc('0x16')]({'winstonInstance':_0x128cbd,'meta':![],'statusLevels':!![],'msg':function(_0x252e3f,_0x3d9704){var _0x352f41='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x36dc('0x17')](_0x252e3f[_0x36dc('0x18')])){_0x352f41+=_0x36dc('0x19');var _0x63c830=_0x252e3f[_0x36dc('0x18')];maskSensitiveData(_0x63c830);}return safeTemplate(util[_0x36dc('0x1a')](_0x352f41,_0x252e3f[_0x36dc('0x1b')],_0x252e3f['headers'][_0x36dc('0x1c')]?_0x252e3f[_0x36dc('0x1d')]['x-forwarded-for']:_0x252e3f[_0x36dc('0x1e')]['remoteAddress']||_0x252e3f['ip'],_0x252e3f[_0x36dc('0x1f')],_0x3d9704[_0x36dc('0x20')],_0x3d9704[_0x36dc('0x21')],_0x252e3f[_0x36dc('0xe')]?_0x252e3f[_0x36dc('0xe')]['id']:null,_0x252e3f[_0x36dc('0xe')]?_0x252e3f[_0x36dc('0xe')][_0x36dc('0xa')]:null,_0x252e3f[_0x36dc('0xe')]?_0x252e3f['user'][_0x36dc('0x22')]:null,_0x63c830?util[_0x36dc('0x23')](_0x63c830,![],null):''));}}));_0x3833be[_0x36dc('0x24')](ewinston['logger']({'winstonInstance':_0x3b915f,'meta':![],'statusLevels':!![],'msg':function(_0x32e5d1,_0x3d549a){var _0x42d363='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x32e5d1['body']&&_0x32e5d1[_0x36dc('0x18')]['device']&&_0x32e5d1[_0x36dc('0x18')][_0x36dc('0x25')]){_0x42d363=_0x36dc('0x26');}return util[_0x36dc('0x1a')](_0x42d363,_0x32e5d1[_0x36dc('0x1b')],_0x32e5d1[_0x36dc('0x1d')][_0x36dc('0x1c')]?_0x32e5d1[_0x36dc('0x1d')]['x-forwarded-for']:_0x32e5d1[_0x36dc('0x1e')][_0x36dc('0x27')]||_0x32e5d1['ip'],_0x32e5d1[_0x36dc('0x1f')],_0x3d549a['statusCode'],_0x3d549a[_0x36dc('0x21')],_0x32e5d1[_0x36dc('0xe')]?_0x32e5d1[_0x36dc('0xe')]['id']:null,_0x32e5d1[_0x36dc('0xe')]?_0x32e5d1[_0x36dc('0xe')]['name']:null,_0x32e5d1[_0x36dc('0xe')]?_0x32e5d1[_0x36dc('0xe')][_0x36dc('0x22')]:null,_0x32e5d1[_0x36dc('0x18')]&&_0x32e5d1[_0x36dc('0x18')]['device']?_0x32e5d1['body']['device']:'other',_0x32e5d1['body']&&_0x32e5d1[_0x36dc('0x18')][_0x36dc('0x25')]?_0x32e5d1[_0x36dc('0x18')]['agent_id']:'',_0x32e5d1[_0x36dc('0x18')]&&_0x32e5d1[_0x36dc('0x18')][_0x36dc('0x28')]?_0x32e5d1[_0x36dc('0x18')][_0x36dc('0x28')]:'');},'ignoreRoute':function(_0x5a1cce){var _0x1f101e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1f101e['test'](_0x5a1cce['url']);}}));return _0x523dc3();});}exports[_0x36dc('0x29')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index b00c601..a15ed01 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b7a=['exports','circularDoWInterval','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','timeCompare','format','ddd','dowCompare','daysInMonth','min','max','domCompare','MMM','includes','test','isMoment','padStart','length','iftime','moment-timezone','map','source','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b7a,0xf8));var _0xa5b7=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x5b7a[_0x2aea9e];return _0x430b92;};var _=require('lodash');var moment=require(_0xa5b7('0x0'));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][_0xa5b7('0x1')](function(_0xfe917){return _0xfe917[_0xa5b7('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xa5b7('0x3');var EINVALID_DATE=_0xa5b7('0x4');function throwIfDateNotValid(_0x20d201){if(!_0x20d201[_0xa5b7('0x5')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x33ab73){var _0xcec610=_0x33ab73[_0xa5b7('0x6')](':')[_0xa5b7('0x1')](function(_0x4bd183){return parseInt(_0x4bd183,0xa);});var _0x41833a=_0xcec610[0x0];var _0x3d94c3=_0xcec610[0x1];if(_0x41833a<0x0||_0x41833a>0x17||_0x3d94c3<0x0||_0x3d94c3>0x3b){throw new Error(EINVALID_DATE);}return[_0x41833a,_0x3d94c3];}function circularDoWInterval(_0x233d53,_0x50575a){if(_0x233d53===_0x50575a){return[_0x233d53];}else{var _0x2e98ad=moment['locale']();moment[_0xa5b7('0x7')]('en');var _0x3cf3c5=moment['weekdaysShort']()[_0xa5b7('0x1')](function(_0x2e2c85){return _0x2e2c85[_0xa5b7('0x8')]();});moment[_0xa5b7('0x7')](_0x2e98ad);var _0x5581c7=_0x3cf3c5[_0xa5b7('0x9')](_0x233d53);var _0x5c5069=_0x3cf3c5[_0xa5b7('0x9')](_0x50575a);if(_0x5c5069>_0x5581c7){return _0x3cf3c5[_0xa5b7('0xa')](_0x5581c7,_0x5c5069+0x1);}else{var _0x3006ae=_0x3cf3c5[_0xa5b7('0xa')](0x0,_0x5c5069+0x1);var _0x136d76=_0x3cf3c5[_0xa5b7('0xa')](_0x5581c7);return _0x136d76['concat'](_0x3006ae);}}}module[_0xa5b7('0xb')][_0xa5b7('0xc')]=circularDoWInterval;function circularMonthInterval(_0x2533f8,_0x3975fc){if(_0x2533f8===_0x3975fc){return[_0x2533f8];}else{var _0x3f9ad7=moment['locale']();moment[_0xa5b7('0x7')]('en');var _0x5da917=moment['monthsShort']()['map'](function(_0x1561e6){return _0x1561e6[_0xa5b7('0x8')]();});moment['locale'](_0x3f9ad7);var _0x21e3e6=_0x5da917[_0xa5b7('0x9')](_0x2533f8);var _0x5219de=_0x5da917[_0xa5b7('0x9')](_0x3975fc);if(_0x5219de>_0x21e3e6){return _0x5da917[_0xa5b7('0xa')](_0x21e3e6,_0x5219de+0x1);}else{var _0x273024=_0x5da917['slice'](0x0,_0x5219de+0x1);var _0x1a5c93=_0x5da917['slice'](_0x21e3e6);return _0x1a5c93['concat'](_0x273024);}}}module[_0xa5b7('0xb')][_0xa5b7('0xd')]=circularMonthInterval;function parseDom(_0x37684a){var _0x547969=parseInt(_0x37684a,0xa);if(_0x547969<0x1||_0x547969>0x1f){throw new Error(EINVALID_DATE);}return _0x547969;}function timeCompare(_0x58326f,_0x345e43,_0x363ddd){var _0x2f1cf2=_0x58326f[_0xa5b7('0xe')]();var _0x1dec55=extractTime(_0x345e43);var _0x869e2e=_0x1dec55[0x0];var _0x145cd7=_0x1dec55[0x1];var _0x3b6040=_0x58326f['clone']()['hours'](_0x869e2e)['minutes'](_0x145cd7);throwIfDateNotValid(_0x3b6040);var _0x3caf1d=extractTime(_0x363ddd);var _0x3c2f83=_0x3caf1d[0x0];var _0x76062d=_0x3caf1d[0x1];var _0x57ffe0=_0x58326f[_0xa5b7('0xe')]()[_0xa5b7('0xf')](_0x3c2f83)[_0xa5b7('0x10')](_0x76062d);throwIfDateNotValid(_0x57ffe0);if(_0x57ffe0[_0xa5b7('0x11')](_0x3b6040)){var _0x5319a8=_0x2f1cf2[_0xa5b7('0xe')]()[_0xa5b7('0x12')](_0xa5b7('0x13'));var _0x13ad5c=_0x2f1cf2['clone']()[_0xa5b7('0x14')]('day');return _0x2f1cf2[_0xa5b7('0x15')](_0x3b6040,_0x13ad5c,undefined,'[]')||_0x2f1cf2['isBetween'](_0x5319a8,_0x57ffe0,undefined,'[]');}else{return _0x2f1cf2['isBetween'](_0x3b6040,_0x57ffe0,undefined,'[]');}}module['exports'][_0xa5b7('0x16')]=timeCompare;function dowCompare(_0x292721,_0x5ebbb6,_0x4ac0b1){var _0x594d65=_0x292721['locale']('en')[_0xa5b7('0x17')](_0xa5b7('0x18'))[_0xa5b7('0x8')]();return circularDoWInterval(_0x5ebbb6,_0x4ac0b1)['includes'](_0x594d65);}module[_0xa5b7('0xb')][_0xa5b7('0x19')]=dowCompare;function domCompare(_0x18de59,_0x4c2278,_0xa55a0b){var _0x3afd99=_0x18de59['date']();if(_0x4c2278===_0xa55a0b){return _0x3afd99===_0x4c2278;}else{var _0x42f515=_0x18de59[_0xa5b7('0x1a')]();var _0x2ac4a9=_0x4c2278<_0xa55a0b;let _0x36bc77=![];var _0x208165=0x0;var _0x1be569=0x0;if(_0x2ac4a9){_0x208165=Math['max'](0x1,_0x4c2278);_0x1be569=Math[_0xa5b7('0x1b')](_0xa55a0b,_0x42f515);_0x36bc77=_0x3afd99>=_0x208165&&_0x3afd99<=_0x1be569;}else{_0x208165=Math['min'](_0x4c2278,_0x42f515);_0x1be569=Math[_0xa5b7('0x1c')](0x1,_0xa55a0b);_0x36bc77=_0x3afd99>=_0x208165||_0x3afd99<=_0x1be569;}return _0x36bc77;}}module[_0xa5b7('0xb')][_0xa5b7('0x1d')]=domCompare;function monthCompare(_0x2c71c0,_0x2b3e2f,_0x5c67cf){var _0x45bd2c=_0x2c71c0[_0xa5b7('0x7')]('en')[_0xa5b7('0x17')](_0xa5b7('0x1e'))[_0xa5b7('0x8')]();return circularMonthInterval(_0x2b3e2f,_0x5c67cf)[_0xa5b7('0x1f')](_0x45bd2c);}module[_0xa5b7('0xb')]['monthCompare']=monthCompare;function iftime(_0x595343,_0x4d196c=moment['tz']['guess'](),_0x5af2c1=moment()){if(!validateRx[_0xa5b7('0x20')](_0x595343)){throw new Error(EINVALID_STRING);}else{var _0x1bd7fc=(moment[_0xa5b7('0x21')](_0x5af2c1)?_0x5af2c1['clone']():moment(_0x5af2c1))['tz'](_0x4d196c)[_0xa5b7('0x7')]('en');throwIfDateNotValid(_0x1bd7fc);var _0x3cef45=_0x595343[_0xa5b7('0x6')](',');var _0x3f201d=_0x3cef45[0x0];var _0x4bf513=_0x3cef45[0x1];var _0x3fa1fe=_0x3cef45[0x2];var _0x3995f3=_0x3cef45[0x3];let _0x458e40=!![];if(_0x3f201d!=='*'){var _0x28c88a=_0x3f201d['split']('-');var _0x4e3cef=_[_0xa5b7('0x22')](_0x28c88a[0x0],0x5,'0');var _0x2ea955=_0x28c88a[_0xa5b7('0x23')]===0x2?_['padStart'](_0x28c88a[0x1],0x5,'0'):_0x4e3cef;_0x458e40=timeCompare(_0x1bd7fc,_0x4e3cef,_0x2ea955);}let _0x650ee1=!![];if(_0x4bf513!=='*'){var _0x47fc4f=_0x4bf513['split']('-');var _0x59be64=_0x47fc4f[0x0];var _0x22ccb5=_0x47fc4f[_0xa5b7('0x23')]===0x2?_0x47fc4f[0x1]:_0x59be64;_0x650ee1=dowCompare(_0x1bd7fc,_0x59be64,_0x22ccb5);}let _0x2f6333=!![];if(_0x3fa1fe!=='*'){var _0x423bdd=_0x3fa1fe[_0xa5b7('0x6')]('-');var _0x92105d=parseDom(_0x423bdd[0x0]);var _0x3c172c=_0x423bdd[_0xa5b7('0x23')]===0x2?parseDom(_0x423bdd[0x1]):_0x92105d;_0x2f6333=domCompare(_0x1bd7fc,_0x92105d,_0x3c172c);}let _0x218941=!![];if(_0x3995f3!=='*'){var _0x327a49=_0x3995f3[_0xa5b7('0x6')]('-');var _0x37b4d7=_0x327a49[0x0];var _0x249854=_0x327a49[_0xa5b7('0x23')]===0x2?_0x327a49[0x1]:_0x327a49[0x0];_0x218941=monthCompare(_0x1bd7fc,_0x37b4d7,_0x249854);}return _0x458e40&&_0x650ee1&&_0x2f6333&&_0x218941;}}module[_0xa5b7('0xb')][_0xa5b7('0x24')]=iftime; \ No newline at end of file +var _0xcbd3=['MMM','monthCompare','padStart','length','iftime','lodash','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','monthsShort','circularMonthInterval','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','exports','format','ddd','includes','dowCompare','date','max','min','domCompare'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xcbd3,0x77));var _0x3cbd=function(_0x398701,_0x41c06a){_0x398701=_0x398701-0x0;var _0x457469=_0xcbd3[_0x398701];return _0x457469;};var _=require(_0x3cbd('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][_0x3cbd('0x1')](function(_0x1ba40a){return _0x1ba40a[_0x3cbd('0x2')];})[_0x3cbd('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x3cbd('0x4');var EINVALID_DATE=_0x3cbd('0x5');function throwIfDateNotValid(_0x5af304){if(!_0x5af304['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x1cbbad){var _0x48b130=_0x1cbbad[_0x3cbd('0x6')](':')['map'](function(_0x45f39a){return parseInt(_0x45f39a,0xa);});var _0x1c0b38=_0x48b130[0x0];var _0x48b68b=_0x48b130[0x1];if(_0x1c0b38<0x0||_0x1c0b38>0x17||_0x48b68b<0x0||_0x48b68b>0x3b){throw new Error(EINVALID_DATE);}return[_0x1c0b38,_0x48b68b];}function circularDoWInterval(_0x4e30f5,_0x20755f){if(_0x4e30f5===_0x20755f){return[_0x4e30f5];}else{var _0x55b43e=moment[_0x3cbd('0x7')]();moment[_0x3cbd('0x7')]('en');var _0x577be0=moment[_0x3cbd('0x8')]()['map'](function(_0x3cd662){return _0x3cd662[_0x3cbd('0x9')]();});moment[_0x3cbd('0x7')](_0x55b43e);var _0x214c91=_0x577be0[_0x3cbd('0xa')](_0x4e30f5);var _0x52a5b4=_0x577be0[_0x3cbd('0xa')](_0x20755f);if(_0x52a5b4>_0x214c91){return _0x577be0[_0x3cbd('0xb')](_0x214c91,_0x52a5b4+0x1);}else{var _0x210ece=_0x577be0['slice'](0x0,_0x52a5b4+0x1);var _0x176120=_0x577be0[_0x3cbd('0xb')](_0x214c91);return _0x176120[_0x3cbd('0xc')](_0x210ece);}}}module['exports'][_0x3cbd('0xd')]=circularDoWInterval;function circularMonthInterval(_0x5948a8,_0x350dc2){if(_0x5948a8===_0x350dc2){return[_0x5948a8];}else{var _0x4d2f3d=moment[_0x3cbd('0x7')]();moment[_0x3cbd('0x7')]('en');var _0x1b7485=moment[_0x3cbd('0xe')]()['map'](function(_0xe6b9ec){return _0xe6b9ec['toLowerCase']();});moment[_0x3cbd('0x7')](_0x4d2f3d);var _0x4ca87c=_0x1b7485[_0x3cbd('0xa')](_0x5948a8);var _0x579dde=_0x1b7485[_0x3cbd('0xa')](_0x350dc2);if(_0x579dde>_0x4ca87c){return _0x1b7485[_0x3cbd('0xb')](_0x4ca87c,_0x579dde+0x1);}else{var _0x12b055=_0x1b7485[_0x3cbd('0xb')](0x0,_0x579dde+0x1);var _0x4d50c0=_0x1b7485[_0x3cbd('0xb')](_0x4ca87c);return _0x4d50c0[_0x3cbd('0xc')](_0x12b055);}}}module['exports'][_0x3cbd('0xf')]=circularMonthInterval;function parseDom(_0x4cdd37){var _0x187272=parseInt(_0x4cdd37,0xa);if(_0x187272<0x1||_0x187272>0x1f){throw new Error(EINVALID_DATE);}return _0x187272;}function timeCompare(_0x112a1c,_0x4986ad,_0x3c1c40){var _0x506f55=_0x112a1c[_0x3cbd('0x10')]();var _0x520659=extractTime(_0x4986ad);var _0x5bda65=_0x520659[0x0];var _0x56cce5=_0x520659[0x1];var _0x37983d=_0x112a1c[_0x3cbd('0x10')]()[_0x3cbd('0x11')](_0x5bda65)[_0x3cbd('0x12')](_0x56cce5);throwIfDateNotValid(_0x37983d);var _0x5f4fab=extractTime(_0x3c1c40);var _0x1db709=_0x5f4fab[0x0];var _0x2f81a9=_0x5f4fab[0x1];var _0x5c5675=_0x112a1c[_0x3cbd('0x10')]()[_0x3cbd('0x11')](_0x1db709)[_0x3cbd('0x12')](_0x2f81a9);throwIfDateNotValid(_0x5c5675);if(_0x5c5675[_0x3cbd('0x13')](_0x37983d)){var _0x3ccc19=_0x506f55[_0x3cbd('0x10')]()[_0x3cbd('0x14')](_0x3cbd('0x15'));var _0x10cdc4=_0x506f55[_0x3cbd('0x10')]()[_0x3cbd('0x16')]('day');return _0x506f55[_0x3cbd('0x17')](_0x37983d,_0x10cdc4,undefined,'[]')||_0x506f55['isBetween'](_0x3ccc19,_0x5c5675,undefined,'[]');}else{return _0x506f55['isBetween'](_0x37983d,_0x5c5675,undefined,'[]');}}module[_0x3cbd('0x18')]['timeCompare']=timeCompare;function dowCompare(_0x58af92,_0x174d6e,_0x1fcf2e){var _0x4f70c8=_0x58af92['locale']('en')[_0x3cbd('0x19')](_0x3cbd('0x1a'))[_0x3cbd('0x9')]();return circularDoWInterval(_0x174d6e,_0x1fcf2e)[_0x3cbd('0x1b')](_0x4f70c8);}module[_0x3cbd('0x18')][_0x3cbd('0x1c')]=dowCompare;function domCompare(_0x1eba68,_0x28b3f1,_0x1edbf7){var _0x45db08=_0x1eba68[_0x3cbd('0x1d')]();if(_0x28b3f1===_0x1edbf7){return _0x45db08===_0x28b3f1;}else{var _0x34e046=_0x1eba68['daysInMonth']();var _0x404baa=_0x28b3f1<_0x1edbf7;let _0x9fafd5=![];var _0x1858d2=0x0;var _0x4dfeef=0x0;if(_0x404baa){_0x1858d2=Math[_0x3cbd('0x1e')](0x1,_0x28b3f1);_0x4dfeef=Math[_0x3cbd('0x1f')](_0x1edbf7,_0x34e046);_0x9fafd5=_0x45db08>=_0x1858d2&&_0x45db08<=_0x4dfeef;}else{_0x1858d2=Math[_0x3cbd('0x1f')](_0x28b3f1,_0x34e046);_0x4dfeef=Math['max'](0x1,_0x1edbf7);_0x9fafd5=_0x45db08>=_0x1858d2||_0x45db08<=_0x4dfeef;}return _0x9fafd5;}}module[_0x3cbd('0x18')][_0x3cbd('0x20')]=domCompare;function monthCompare(_0x533cd2,_0x18b26e,_0x4692a9){var _0x17f3d8=_0x533cd2[_0x3cbd('0x7')]('en')[_0x3cbd('0x19')](_0x3cbd('0x21'))[_0x3cbd('0x9')]();return circularMonthInterval(_0x18b26e,_0x4692a9)[_0x3cbd('0x1b')](_0x17f3d8);}module[_0x3cbd('0x18')][_0x3cbd('0x22')]=monthCompare;function iftime(_0x43a644,_0x5c84b7=moment['tz']['guess'](),_0x4add00=moment()){if(!validateRx['test'](_0x43a644)){throw new Error(EINVALID_STRING);}else{var _0x5a097c=(moment['isMoment'](_0x4add00)?_0x4add00[_0x3cbd('0x10')]():moment(_0x4add00))['tz'](_0x5c84b7)[_0x3cbd('0x7')]('en');throwIfDateNotValid(_0x5a097c);var _0x49c34d=_0x43a644['split'](',');var _0x487462=_0x49c34d[0x0];var _0x1a0587=_0x49c34d[0x1];var _0x1b9c5b=_0x49c34d[0x2];var _0x2189ae=_0x49c34d[0x3];let _0x35f212=!![];if(_0x487462!=='*'){var _0x433822=_0x487462[_0x3cbd('0x6')]('-');var _0x2f9b22=_[_0x3cbd('0x23')](_0x433822[0x0],0x5,'0');var _0x4bacee=_0x433822[_0x3cbd('0x24')]===0x2?_[_0x3cbd('0x23')](_0x433822[0x1],0x5,'0'):_0x2f9b22;_0x35f212=timeCompare(_0x5a097c,_0x2f9b22,_0x4bacee);}let _0x2dc3a6=!![];if(_0x1a0587!=='*'){var _0x32efd0=_0x1a0587[_0x3cbd('0x6')]('-');var _0x9749b=_0x32efd0[0x0];var _0x4bda63=_0x32efd0[_0x3cbd('0x24')]===0x2?_0x32efd0[0x1]:_0x9749b;_0x2dc3a6=dowCompare(_0x5a097c,_0x9749b,_0x4bda63);}let _0x5345c8=!![];if(_0x1b9c5b!=='*'){var _0x86b3f1=_0x1b9c5b[_0x3cbd('0x6')]('-');var _0x43f2a8=parseDom(_0x86b3f1[0x0]);var _0x303c4b=_0x86b3f1['length']===0x2?parseDom(_0x86b3f1[0x1]):_0x43f2a8;_0x5345c8=domCompare(_0x5a097c,_0x43f2a8,_0x303c4b);}let _0x159efd=!![];if(_0x2189ae!=='*'){var _0x272a57=_0x2189ae[_0x3cbd('0x6')]('-');var _0xe694f=_0x272a57[0x0];var _0x5c3faf=_0x272a57[_0x3cbd('0x24')]===0x2?_0x272a57[0x1]:_0x272a57[0x0];_0x159efd=monthCompare(_0x5a097c,_0xe694f,_0x5c3faf);}return _0x35f212&&_0x2dc3a6&&_0x5345c8&&_0x159efd;}}module[_0x3cbd('0x18')][_0x3cbd('0x25')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 56b1e07..2d2b7a8 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2e82=['replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','warn','Logger','File','%s-%s','error','transports','Console','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','/var/log/xcally','join','format','message'];(function(_0x7fdde0,_0x543091){var _0x48f610=function(_0x4c43e6){while(--_0x4c43e6){_0x7fdde0['push'](_0x7fdde0['shift']());}};_0x48f610(++_0x543091);}(_0x2e82,0xf6));var _0x22e8=function(_0x345b8d,_0x400c1b){_0x345b8d=_0x345b8d-0x0;var _0x289c91=_0x2e82[_0x345b8d];return _0x289c91;};'use strict';var path=require(_0x22e8('0x0'));var util=require(_0x22e8('0x1'));var moment=require(_0x22e8('0x2'));var winston=require(_0x22e8('0x3'));var config=require(_0x22e8('0x4'));var debugLevel=config[_0x22e8('0x5')]?config['debugLevel'][_0x22e8('0x6')]():_0x22e8('0x7');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':_0x22e8('0x8'),'warn':_0x22e8('0x9'),'info':_0x22e8('0xa'),'print':_0x22e8('0xb'),'success':_0x22e8('0xc'),'http':_0x22e8('0xd'),'verbose':_0x22e8('0xe'),'debug':_0x22e8('0xf'),'silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x12fbba,_0x51512d,_0x9847e9){var _0x2b50f5=_0x12fbba||_0x22e8('0x10');return path[_0x22e8('0x11')](_0x2b50f5,util[_0x22e8('0x12')]('%s-%s.log',_0x51512d,_0x9847e9));}function formatter(_0x5ca395,_0xfe5545){_0xfe5545[_0x22e8('0x13')]=_0xfe5545[_0x22e8('0x13')][_0x22e8('0x14')](/@@{/g,_0x22e8('0x15'))['replace'](/}@@/g,_0x22e8('0x16'))[_0x22e8('0x14')](/@{/g,'{{')[_0x22e8('0x14')](/}@/g,'}}');return util['format'](_0x22e8('0x17'),moment()[_0x22e8('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),_0xfe5545['level'][_0x22e8('0x18')](),_0x5ca395,_0xfe5545[_0x22e8('0x13')]);}function fileFormat(_0x15512e,_0x534f5a){_0x534f5a[_0x22e8('0x13')]=_0x534f5a[_0x22e8('0x13')][_0x22e8('0x14')](/@@{/g,_0x22e8('0x15'))[_0x22e8('0x14')](/}@@/g,_0x22e8('0x16'))[_0x22e8('0x14')](/@{/g,'{{')[_0x22e8('0x14')](/}@/g,'}}');var _0x38872d=_0x534f5a[_0x22e8('0x19')]&&Object[_0x22e8('0x1a')](_0x534f5a[_0x22e8('0x19')])[_0x22e8('0x1b')]?'\x0a\x09'+JSON[_0x22e8('0x1c')](_0x534f5a[_0x22e8('0x19')]):'';return util['format'](_0x22e8('0x1d'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x534f5a['level']['toUpperCase'](),_0x15512e,_0x534f5a['message'],_0x38872d);}function consoleLogger(){var _0x68773e=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports']['Console']({'level':_0x22e8('0x1e'),'json':![],'formatter':function(_0x5c0928){return formatter('',_0x5c0928);}})]});return _0x68773e;}function fileLogger(_0xfafc6c,_0x1a0bac){var _0x2d8f04=new winston[(_0x22e8('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x22e8('0x20'))]({'name':util[_0x22e8('0x12')](_0x22e8('0x21'),_0xfafc6c,_0x22e8('0x22')),'filename':getLogFileName(_0x1a0bac,_0xfafc6c,_0x22e8('0x22')),'level':_0x22e8('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c9b8b){return fileFormat(_0xfafc6c,_0x5c9b8b);}}),new winston[(_0x22e8('0x23'))][(_0x22e8('0x20'))]({'name':util['format'](_0x22e8('0x21'),_0xfafc6c,debugLevel),'filename':getLogFileName(_0x1a0bac,_0xfafc6c,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10c948){return fileFormat(_0xfafc6c,_0x10c948);}}),new winston[(_0x22e8('0x23'))][(_0x22e8('0x24'))]({'level':_0x22e8('0x1e'),'json':![],'formatter':function(_0x4b426c){return fileFormat(_0xfafc6c,_0x4b426c);}})]});return _0x2d8f04;}exports['consoleLogger']=consoleLogger;exports[_0x22e8('0x25')]=fileLogger; \ No newline at end of file +var _0x7e44=['addColors','/var/log/xcally','join','%s-%s.log','message','{{{','replace','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','level','Logger','transports','Console','File','error','%s-%s','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','red','white','bold\x20green','gray','bold\x20magenta','bold\x20cyan'];(function(_0x472ee0,_0x10405c){var _0x113520=function(_0x2de144){while(--_0x2de144){_0x472ee0['push'](_0x472ee0['shift']());}};_0x113520(++_0x10405c);}(_0x7e44,0x1d3));var _0x47e4=function(_0x12d812,_0x496bb7){_0x12d812=_0x12d812-0x0;var _0x3711ab=_0x7e44[_0x12d812];return _0x3711ab;};'use strict';var path=require(_0x47e4('0x0'));var util=require(_0x47e4('0x1'));var moment=require(_0x47e4('0x2'));var winston=require('winston');var config=require(_0x47e4('0x3'));var debugLevel=config[_0x47e4('0x4')]?config[_0x47e4('0x4')][_0x47e4('0x5')]():_0x47e4('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x47e4('0x7'),'warn':'bold\x20yellow','info':_0x47e4('0x8'),'print':'bold\x20white','success':_0x47e4('0x9'),'http':_0x47e4('0xa'),'verbose':_0x47e4('0xb'),'debug':'bold\x20blue','silly':_0x47e4('0xc')};winston[_0x47e4('0xd')](XC_LOG_COLORS);function getLogFileName(_0x332279,_0x214e6a,_0x5088a1){var _0x3ff048=_0x332279||_0x47e4('0xe');return path[_0x47e4('0xf')](_0x3ff048,util['format'](_0x47e4('0x10'),_0x214e6a,_0x5088a1));}function formatter(_0x461b4c,_0xb129ab){_0xb129ab[_0x47e4('0x11')]=_0xb129ab[_0x47e4('0x11')]['replace'](/@@{/g,_0x47e4('0x12'))[_0x47e4('0x13')](/}@@/g,_0x47e4('0x14'))['replace'](/@{/g,'{{')[_0x47e4('0x13')](/}@/g,'}}');return util[_0x47e4('0x15')](_0x47e4('0x16'),moment()[_0x47e4('0x15')](_0x47e4('0x17')),_0xb129ab['level'][_0x47e4('0x18')](),_0x461b4c,_0xb129ab[_0x47e4('0x11')]);}function fileFormat(_0x2122ac,_0x52b495){_0x52b495[_0x47e4('0x11')]=_0x52b495['message'][_0x47e4('0x13')](/@@{/g,'{{{')['replace'](/}@@/g,_0x47e4('0x14'))[_0x47e4('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x37bf7b=_0x52b495[_0x47e4('0x19')]&&Object[_0x47e4('0x1a')](_0x52b495['meta'])[_0x47e4('0x1b')]?'\x0a\x09'+JSON[_0x47e4('0x1c')](_0x52b495['meta']):'';return util['format'](_0x47e4('0x1d'),moment()[_0x47e4('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),_0x52b495[_0x47e4('0x1e')]['toUpperCase'](),_0x2122ac,_0x52b495[_0x47e4('0x11')],_0x37bf7b);}function consoleLogger(){var _0x3af926=new winston[(_0x47e4('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x47e4('0x20'))][(_0x47e4('0x21'))]({'level':'warn','json':![],'formatter':function(_0x330d16){return formatter('',_0x330d16);}})]});return _0x3af926;}function fileLogger(_0x346c95,_0xd98c9a){var _0x4b247c=new winston[(_0x47e4('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x47e4('0x22'))]({'name':util[_0x47e4('0x15')]('%s-%s',_0x346c95,_0x47e4('0x23')),'filename':getLogFileName(_0xd98c9a,_0x346c95,_0x47e4('0x23')),'level':_0x47e4('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x410cb0){return fileFormat(_0x346c95,_0x410cb0);}}),new winston['transports'][(_0x47e4('0x22'))]({'name':util[_0x47e4('0x15')](_0x47e4('0x24'),_0x346c95,debugLevel),'filename':getLogFileName(_0xd98c9a,_0x346c95,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x853f09){return fileFormat(_0x346c95,_0x853f09);}}),new winston[(_0x47e4('0x20'))]['Console']({'level':_0x47e4('0x25'),'json':![],'formatter':function(_0x21798b){return fileFormat(_0x346c95,_0x21798b);}})]});return _0x4b247c;}exports[_0x47e4('0x26')]=consoleLogger;exports[_0x47e4('0x27')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 003044e..a1aa477 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 _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x4975,0x86));var _0x5497=function(_0x6f981e,_0x5290c9){_0x6f981e=_0x6f981e-0x0;var _0x14884e=_0x4975[_0x6f981e];return _0x14884e;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x558c67,_0x302e59){var _0x5d302d=function(_0x5ae23b){while(--_0x5ae23b){_0x558c67['push'](_0x558c67['shift']());}};_0x5d302d(++_0x302e59);}(_0xda2d,0x102));var _0xdda2=function(_0x10359,_0x31be8f){_0x10359=_0x10359-0x0;var _0x1dd75c=_0xda2d[_0x10359];return _0x1dd75c;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 41481c9..eb4b728 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['exports','replace','\x5c$&'];(function(_0x458ed6,_0x504646){var _0xa5dfd9=function(_0x504e7b){while(--_0x504e7b){_0x458ed6['push'](_0x458ed6['shift']());}};_0xa5dfd9(++_0x504646);}(_0x2ef3,0xba));var _0x32ef=function(_0x350b01,_0x3e7aeb){_0x350b01=_0x350b01-0x0;var _0x48ac21=_0x2ef3[_0x350b01];return _0x48ac21;};module[_0x32ef('0x0')]={'escapeRegExp'(_0x11c049,_0x47513a=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x11c049[_0x32ef('0x1')](_0x47513a,_0x32ef('0x2'));}}; \ No newline at end of file +var _0x7a54=['exports','\x5c$&'];(function(_0x5a6c04,_0x5976a7){var _0x14e87b=function(_0x1fb93e){while(--_0x1fb93e){_0x5a6c04['push'](_0x5a6c04['shift']());}};_0x14e87b(++_0x5976a7);}(_0x7a54,0x106));var _0x47a5=function(_0x293971,_0xfb1570){_0x293971=_0x293971-0x0;var _0x2abdb0=_0x7a54[_0x293971];return _0x2abdb0;};module[_0x47a5('0x0')]={'escapeRegExp'(_0x46f3fa,_0x44b31e=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x46f3fa['replace'](_0x44b31e,_0x47a5('0x1'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 6163b63..711718c 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 _0x8952=['exports','safeTemplate','{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','keys','reduce'];(function(_0x4884a7,_0x18e38a){var _0x56b60e=function(_0x2ba8a3){while(--_0x2ba8a3){_0x4884a7['push'](_0x4884a7['shift']());}};_0x56b60e(++_0x18e38a);}(_0x8952,0x17e));var _0x2895=function(_0x55d562,_0x1ba23b){_0x55d562=_0x55d562-0x0;var _0x44903a=_0x8952[_0x55d562];return _0x44903a;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2a7389){return _0x2a7389==='{{'?_0x2895('0x0'):_0x2895('0x1');}function safeTemplate(_0x2d485c){var _0x2454c5=_0x2d485c;if(typeof _0x2d485c==='string'){_0x2454c5=_0x2d485c[_0x2895('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2895('0x3')](_0x2d485c)){_0x2454c5=_0x2d485c[_0x2895('0x4')](function(_0x5b28c6){return safeTemplate(_0x5b28c6);});}else if(_[_0x2895('0x5')](_0x2d485c)){_0x2454c5=Object[_0x2895('0x6')](_0x2d485c)[_0x2895('0x7')](function(_0x4ea619,_0x526c32){_0x4ea619[_0x526c32]=safeTemplate(_0x2d485c[_0x526c32]);return _0x4ea619;},{});}return _0x2454c5;}module[_0x2895('0x8')][_0x2895('0x9')]=safeTemplate; \ No newline at end of file +var _0xb7e7=['reduce','safeTemplate','lodash','{\x20{\x20','string','isArray','map'];(function(_0x3f636a,_0x228ddd){var _0x9f5afd=function(_0x393705){while(--_0x393705){_0x3f636a['push'](_0x3f636a['shift']());}};_0x9f5afd(++_0x228ddd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};var _=require(_0x7b7e('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x545d7d){return _0x545d7d==='{{'?_0x7b7e('0x1'):'\x20}\x20}';}function safeTemplate(_0x1b7cc7){var _0x54a37f=_0x1b7cc7;if(typeof _0x1b7cc7===_0x7b7e('0x2')){_0x54a37f=_0x1b7cc7['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x7b7e('0x3')](_0x1b7cc7)){_0x54a37f=_0x1b7cc7[_0x7b7e('0x4')](function(_0x1d9384){return safeTemplate(_0x1d9384);});}else if(_['isPlainObject'](_0x1b7cc7)){_0x54a37f=Object['keys'](_0x1b7cc7)[_0x7b7e('0x5')](function(_0x372bde,_0x7f87e0){_0x372bde[_0x7f87e0]=safeTemplate(_0x1b7cc7[_0x7f87e0]);return _0x372bde;},{});}return _0x54a37f;}module['exports'][_0x7b7e('0x6')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 19b3cc0..b8c3e5d 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 _0x39b3=['updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','path','../config/environment','resolve','legacy-libs','isArray','apps','findIndex','motion2','env','NODE_PATH','string','pathExists','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39b3,0x9d));var _0x339b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x39b3[_0x110c3d];return _0x226d67;};var fs=require(_0x339b('0x0'));var path=require(_0x339b('0x1'));var config=require(_0x339b('0x2'));var root=config['root'];var APP_JSON_PATH=path[_0x339b('0x3')](root,'server/app.json');var NODEPATH=path[_0x339b('0x3')](root,_0x339b('0x4'));function setLegacyLibsNodeEnvPath(_0x256a51){let _0x2fb6a4=![];if(Array[_0x339b('0x5')](_0x256a51[_0x339b('0x6')])){var _0x493300=_0x256a51['apps'][_0x339b('0x7')](function(_0x50e2bd){return _0x50e2bd['name']===_0x339b('0x8');});if(_0x493300>-0x1){var _0x5a2a83=_0x256a51[_0x339b('0x6')][_0x493300];if(typeof _0x5a2a83[_0x339b('0x9')][_0x339b('0xa')]!==_0x339b('0xb')){_0x5a2a83['env'][_0x339b('0xa')]=NODEPATH;_0x2fb6a4=!![];}}return{'appConfig':_0x256a51,'updated':_0x2fb6a4};}}function updateAppConfig(_0x44b8c9){return fs[_0x339b('0xc')](APP_JSON_PATH)['then'](function(_0x45598f){if(_0x45598f){return fs['readJSON'](APP_JSON_PATH)[_0x339b('0xd')](function(_0x14f077){var _0x437286=setLegacyLibsNodeEnvPath(_0x14f077);if(_0x437286[_0x339b('0xe')]){_0x44b8c9[_0x339b('0xf')](_0x339b('0x10'));return fs[_0x339b('0x11')](APP_JSON_PATH,_0x14f077,{'spaces':0x2});}else{return Promise[_0x339b('0x3')]();}});}else{return Promise[_0x339b('0x3')]();}});}module[_0x339b('0x12')]=updateAppConfig; \ No newline at end of file +var _0x50ec=['name','motion2','string','then','readJSON','updated','info','Updating\x20app.json','writeJSON','exports','fs-extra','root','resolve','server/app.json','findIndex'];(function(_0x2500ae,_0x27b769){var _0x2709d9=function(_0x4f1c52){while(--_0x4f1c52){_0x2500ae['push'](_0x2500ae['shift']());}};_0x2709d9(++_0x27b769);}(_0x50ec,0x163));var _0xc50e=function(_0x22588a,_0x4b072b){_0x22588a=_0x22588a-0x0;var _0x31a581=_0x50ec[_0x22588a];return _0x31a581;};var fs=require(_0xc50e('0x0'));var path=require('path');var config=require('../config/environment');var root=config[_0xc50e('0x1')];var APP_JSON_PATH=path[_0xc50e('0x2')](root,_0xc50e('0x3'));var NODEPATH=path['resolve'](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x50a28e){let _0x42e77e=![];if(Array['isArray'](_0x50a28e['apps'])){var _0x46b1e9=_0x50a28e['apps'][_0xc50e('0x4')](function(_0x3f56a8){return _0x3f56a8[_0xc50e('0x5')]===_0xc50e('0x6');});if(_0x46b1e9>-0x1){var _0x33bc64=_0x50a28e['apps'][_0x46b1e9];if(typeof _0x33bc64['env']['NODE_PATH']!==_0xc50e('0x7')){_0x33bc64['env']['NODE_PATH']=NODEPATH;_0x42e77e=!![];}}return{'appConfig':_0x50a28e,'updated':_0x42e77e};}}function updateAppConfig(_0x46a73b){return fs['pathExists'](APP_JSON_PATH)[_0xc50e('0x8')](function(_0x558cff){if(_0x558cff){return fs[_0xc50e('0x9')](APP_JSON_PATH)[_0xc50e('0x8')](function(_0x393906){var _0x17e254=setLegacyLibsNodeEnvPath(_0x393906);if(_0x17e254[_0xc50e('0xa')]){_0x46a73b[_0xc50e('0xb')](_0xc50e('0xc'));return fs[_0xc50e('0xd')](APP_JSON_PATH,_0x393906,{'spaces':0x2});}else{return Promise[_0xc50e('0x2')]();}});}else{return Promise[_0xc50e('0x2')]();}});}module[_0xc50e('0xe')]=updateAppConfig; \ No newline at end of file